diff --git a/jan/fba.chm b/jan/fba.chm deleted file mode 100644 index 52961f2c6..000000000 Binary files a/jan/fba.chm and /dev/null differ diff --git a/jan/fbahelpfilesrc/Table of Contents.hhc b/jan/fbahelpfilesrc/Table of Contents.hhc deleted file mode 100644 index 17ea92f80..000000000 --- a/jan/fbahelpfilesrc/Table of Contents.hhc +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - diff --git a/jan/fbahelpfilesrc/acknowledgments.htm b/jan/fbahelpfilesrc/acknowledgments.htm deleted file mode 100644 index 2d63050b5..000000000 --- a/jan/fbahelpfilesrc/acknowledgments.htm +++ /dev/null @@ -1,36 +0,0 @@ - - - - -Acknowledgments - - - - - - - - - - -
FB Alpha
- -

Acknowledgments

- -

The original FBA Team was Jan_Klaassen, LoopMaster, KEV, Mike_Haggar, TrebleWinner (Barry), Ayeye and HyperYagami.

- -

There have also been big contributions from iq_132, Captain CPS-X, JacKc, dink and OopsWare.

- -

Individual acknowledgements are also credited in the whatsnew.html file distributed with FB Alpha.

- -

The current active Team is Barry, KEV, iq_132, JackC and dink.

- -

The following is the original acknowledgements from the old readme.txt;

- -

"Thanks to: Dave, ElSemi, Gangta, OG, Razoola, Logiqx, TRAC, CrashTest, Andrea Mazzoleni, Derek Liauw Kie Fa, Dirk Stevens, Maxim Stepin, the MAME team, Shawn and Craig at XGaming.

- -

Thanks also to everyone who has made suggestions, submitted code, or helped in any other way."

- -
- - diff --git a/jan/fbahelpfilesrc/cheat_format.htm b/jan/fbahelpfilesrc/cheat_format.htm deleted file mode 100644 index 96594ddab..000000000 --- a/jan/fbahelpfilesrc/cheat_format.htm +++ /dev/null @@ -1,55 +0,0 @@ - - - - -Cheat Format - - - - - - - - - - -
FB Alpha
- -

Cheat Format

- -

Below is a short description of the FB Alpha cheat file format. Cheat files must be placed in the cheats support file folder, and named according to the short name/name of the zip file containing the ROMs, with the extension being either .INI (e.g. 1941.zip becomes 1941.ini). FBA will present a warning and some additional info whenever it encounters an error in a cheat file, and will stop processing the file at that point.

- -
Cheat File Format
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
// TextComment
include "filename"Include another cheat file
cheat "cheatname" {New cheat called "cheatname" (the curly bracket is optional)
      type nSpecify cheat type (optional, defaults to 0) -
type 0 = apply each frame, save original value and remain active
type 1 = one-shot, fire and forget;
type 2 = one-shot, save original value and remain active
      default nSet default option to n (0 <= n <= 95)
      0 "name"Text displayed in the cheat dialog when the cheat is disabled
      n "name", o, p, qAdd option n (1 <= n <= 95), called "name"
Store byte value q at address p in the address space of CPU o
You can specify upto 32 o/p/q groups per option, all must be on the same line
}Required if you used a curly bracket above, considered an error otherwise
- -
- - diff --git a/jan/fbahelpfilesrc/command.htm b/jan/fbahelpfilesrc/command.htm deleted file mode 100644 index 7e2c6c84e..000000000 --- a/jan/fbahelpfilesrc/command.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - -Command Line - - - - - - - - - - -
FB Alpha
- -

Command Line

- -

FB Alpha can be invoked with command line options. When invoked this way, FB Alpha will automatically switch to fullscreen mode when a game is loaded, and the Escape key quits FB Alpha. The options are as follows;

- -

fba <game> [-listinfo|-w|-a|-r <width>x<height>x<depth>]

- -

<game> = The game's romname. You can specify the filename of a savestate or input recording instead.
--w = Run in a window instead of fullscreen.
--a = Use the same resolution as the original arcade game.
--r = Specify a resolution. Depth is optional.

- -

If neither -a nor -r are specified, the default fullscreen resolution is used.

- -

Examples:

- - -

fba sfa3 -r 800x600x32

- -

fba awesome_sfzch_recording.fr -w

- -

fba vsav2 -a

-
- -

For front-ends, you can also do fba -listinfo, -listinfomdonly, -listinfopceonly, -listinfotg16only, -listinfosgxonly, -listinfosg1000only, -listinfocolecoonly, or -listinfosmsonly, -listinfoggonly, or -listinfomsxonly which will output information about the supported games to -stdout, and the ROM files they need in the MAME XML format.

- -

You can also do fba -listextrainfo. This will output the following data in a tab-delimited format to stdout; setname, visible size, aspect ratio, hardware code, hardware description, working status, max players, comments.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_cheats.htm b/jan/fbahelpfilesrc/dialog_cheats.htm deleted file mode 100644 index 99c975f5c..000000000 --- a/jan/fbahelpfilesrc/dialog_cheats.htm +++ /dev/null @@ -1,28 +0,0 @@ - - - - -Cheat Dialog - - - - - - - - - - -
FB Alpha
- -

Cheat Dialog

- -

If you have cheats for a game in the cheat support file path then you can enable these cheats in this dialog.

- -

FB Alpha will look for cheats in it's own format or the Nebula/Kawaks format. For the FB Alpha format the file should be named after the games short name with an INI file extension, for the Nebula/Kawaks format the file should have the DAT file extension. FB Alpha will also look for cheats in the old MAME format cheat.dat file.

- -

To change the status of a cheat simply select it in the list and then change it in the dropdown. To save your changes and return to the game click OK. To change the cheats back to the default status you can click Default and then click OK to save the changes and return to the game.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_choose_monitor.htm b/jan/fbahelpfilesrc/dialog_choose_monitor.htm deleted file mode 100644 index c77092cf3..000000000 --- a/jan/fbahelpfilesrc/dialog_choose_monitor.htm +++ /dev/null @@ -1,26 +0,0 @@ - - - - -Choose Monitor for Full Screen Dialog - - - - - - - - - - -
FB Alpha
- -

Choose Monitor for Full Screen Dialog

- -

This dialog can be used to choose which monitor to use for running games in full screen. This is useful if you have a multi-monitor setup.

- -

You can select a different monitor for horizontal and vertical games if desired. Simply select the required monitor from the dropdowns and press the OK button.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_dips.htm b/jan/fbahelpfilesrc/dialog_dips.htm deleted file mode 100644 index c8f37e576..000000000 --- a/jan/fbahelpfilesrc/dialog_dips.htm +++ /dev/null @@ -1,28 +0,0 @@ - - - - -Dip Switch Dialog - - - - - - - - - - -
FB Alpha
- -

Dip Switch Dialog

- -

Some arcade games used Dip Switches to configure things like difficulty or coinage. This dialog allows you to change these settings for games that had these switches.

- -

To change a setting, simply select it from the list and then make your changes in the dropdown box below. Once you are finished click OK to save your changes. Most games will require a reset for the changes to take effect.

- -

To reset the settings back to the defaults simply click the Defaults button and then press OK to save.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_game_info.htm b/jan/fbahelpfilesrc/dialog_game_info.htm deleted file mode 100644 index 3e080d92f..000000000 --- a/jan/fbahelpfilesrc/dialog_game_info.htm +++ /dev/null @@ -1,30 +0,0 @@ - - - - -Game Information Dialog - - - - - - - - - - -
FB Alpha
- -

Game Information Dialog

- -

This dialog allows you to view various items of information about the highlighted game. This includes driver information, rom/sample information and various details from external support files (images/history.dat entries, etc.)

- -

Simply click on the different tabs to select the information you want to view.

- -

The Rescan Romset button allows you to rescan the indivdual romset for the highlighted game. The Favorite checkbox allows you to add/remove the game from your favorites filter in the Game Selection dialog.

- -

The Close closes the dialog box.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_game_select.htm b/jan/fbahelpfilesrc/dialog_game_select.htm deleted file mode 100644 index 2e5ec424d..000000000 --- a/jan/fbahelpfilesrc/dialog_game_select.htm +++ /dev/null @@ -1,79 +0,0 @@ - - - - -Game Select Dialog - - - - - - - - - - -
FB Alpha
- -

Game Select Dialog

- -

The purpose of this dialog is to choose a game to play. When you click on a game in the list the dialog will display a preview image of the game if you have a PNG file in the folder you have defined as your previews folder with the games short name (the same applies to a screenshot of the games title screen, if a file exists in the titles folder). The info panel under the gamelist will also be refreshed and will display information about the game.

- -

To play a game either double-click on it in the list, or select it and press the Play button.

- -

The game list can be filtered using any of the filters in the dialog. This allows you to filter by Hardware, Favorites, Genre, Family (Game Series), or Board Type. Once you (de)select a filter the game list is automatically refreshed. (De)selecting a parent filter will (de)select all the child filters below it. You can also search using the search box in the dialog. Typing in this box will filter the gamelist based on what you typed.

- -

The games in the list may have status icons next to them. These are;

- - - - - - - - - - - - -
This game doesn't work.
This game wasn't found when the roms were last scanned.
Some non-essential roms for this game were not found when the last scan was done.
- - -

The following options are available in the Options section of the dialog;

- - - - - - - - - - - - - - - - - - -
Show AvailableFilters the gamelist to show games available on your system (ie, that you have the roms for).
Show UnavailableFilters the gamelist to show games unavailable on your system (ie, that you don't have the roms for).
Always show clonesWill expand the gamelist to show clone games without the user having to click the "+" on the parent.
Use zipnamesWill show the games shortname before the main title.
Latin text onlyWill show only Latin text in the games title.
- -

There are two buttons with these options. The first is ROMs Dirs.... Clicking this button will bring up the Rom Path Dialog. The second is Scan ROMs. This will rescan your roms so the emulator knows what you have available. If you add games into the Rom paths then click this button to rescan for them.

- -

Under the info panel is some information relating to the number of sets displayed and the number unavailable.

- -

To get information about the roms and/or samples required by a game, select the game in the list and then click the Rom Info button.

- -

If a game has IPS patches available, then the IPS Manager button becomes enabled when you click on the game in the gamelist. Clicking this button will bring up the IPS Manager Dialog. If you configure some patches to apply then the Apply Patches checkbox becomes available. Checking this box will enable the patches to be applied when you click the Play button.

- -

You can view game information, by clicking on the Game Info button. This opens the Game Information Dialog.

- -

You can also right-click on a game in the list to open a context menu. Pressing Play from this menu, will play the game highlighted. View Game Information will open the Game Information Dialog. View in Progetto EMMA will open the games information page on Progetto EMMA (external web link). Favorite will add the game to your Favorites, which are available from the filters.

- -

The dialog is resizable. You can drag any edge or any corner and the dialog controls will move/resize as appropriate. The dialog size is restored on entry and saved when the program is exited.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_inputs.htm b/jan/fbahelpfilesrc/dialog_inputs.htm deleted file mode 100644 index 546626f87..000000000 --- a/jan/fbahelpfilesrc/dialog_inputs.htm +++ /dev/null @@ -1,32 +0,0 @@ - - - - -Inputs Dialog - - - - - - - - - - -
FB Alpha
- -

Inputs Dialog

- -

This dialog is used to define the controls used to control a game. The available inputs are listed. Double click on an input to open up a dialog box that allows you to map the control you want to use for that input.

- -

As well as inputs for the game being emulated, there can also be various extra inputs for Auto-Fire or macros for simulating multiple button presses with one input.

- -

You can also choose from various presets by using the dropdown boxes below the inputs. Simply select the player from the first box, the controller from the second, and the control type from the third. The control type can be Auto-center or Normal. Once you have made your selection click Use preset to change the inputs for the selected game or click Make default to make your selection be the default for all games which have not been currently configured.

- -

You can create presets by clicking the Save preset button. This will save a file with the current input definitions in a hardware specific file. If you are playing a CPS game, the file will be called cps.ini, for Neo-Geo games, the file will be called neogeo.ini, for PGM games the file will be called pgm.ini, and for all other games the file will be called preset.ini.

- -

Controls are first assigned from the games specific ini file. If that isn't found, then the hardware specific ini file is tried (cps.ini, neogeo.ini, pgm.ini). If this isn't found then the default preset (applied by clicking Make default) is tried. If this isn't found then the application's default controls are mapped.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_ips_manager.htm b/jan/fbahelpfilesrc/dialog_ips_manager.htm deleted file mode 100644 index 38dce53de..000000000 --- a/jan/fbahelpfilesrc/dialog_ips_manager.htm +++ /dev/null @@ -1,30 +0,0 @@ - - - - -IPS Patch Manager Dialog - - - - - - - - - - -
FB Alpha
- -

IPS Patch Manager Dialog

- -

The IPS Patch Manager allows you to configure IPS patches. IPS patches can be used to change a game, for example, they can enable hidden characters, provide cheat functionality, translations or all sorts of other possibilities.

- -

When you enter the IPS Patch Manager you will see a list of the available patches. These are grouped by their category. If you click on a patch then you will see an image preview of it to the right of the list and a description in the textbox below. To enable patches simply check them and click the OK button. This will save the configuration and you can then use the Apply Patches checkbox in the Game Select Dialog.

- -

You can change the language used to display the patches by choosing it from the dropdown. If there is no data available for your selected language then the reference language will be used.

- -

You can deselect all patches by clicking the Deselect All button.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_multislot.htm b/jan/fbahelpfilesrc/dialog_multislot.htm deleted file mode 100644 index 1dd2d5586..000000000 --- a/jan/fbahelpfilesrc/dialog_multislot.htm +++ /dev/null @@ -1,28 +0,0 @@ - - - - -Game Select Dialog - - - - - - - - - - -
FB Alpha
- -

NeoGeo MVS Multislot Game Select Dialog

- -

The purpose of this dialog is to choose which Neo-Geo MVS games to load. There are six slots available in which a game can be loaded. To load a game in a slot, click the relevant Select button. This will open the Game Select Dialog, showing only MVS cartridges, allowing you to choose a game to load in the slot. To clear a game from a slot, click the relevant Clear button.

- -

When you have made your selections, click the OK button to start the MVS Multislot driver with your games loaded. Once you enter a credit, before starting a game you can select which game to play by pressing the select buttons. By default these are mapped to 3 and 4 on your keyboard. Pressing these buttons will cycle through the games you have loaded.

- -

Your slot selections are saved when the dialog is closed.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_neocdz.htm b/jan/fbahelpfilesrc/dialog_neocdz.htm deleted file mode 100644 index 86881eb04..000000000 --- a/jan/fbahelpfilesrc/dialog_neocdz.htm +++ /dev/null @@ -1,32 +0,0 @@ - - - - -Neo Geo CDZ Game Select Dialog - - - - - - - - - - -
FB Alpha
- -

Neo Geo CDZ Game Select Dialog

- -

The purpose of this dialog is to choose a Neo Geo CDZ game to play. When you click on a game in the list the dialog will display images of the games cd covers, if you have PNG files in the folder you have defined as your Neo Geo CDZ Covers folder with the games four digit NGCD-ID code, appended with either -front or -back, eg, 0030-front.png. The info panel under the gamelist will also be refreshed and will display information about the game.

- -

To play a game either double-click on it in the list, or select it and press the Play button.

- -

When you enter the dialog, a scan will take place of the ISO/CUE files in the folder you have defined as the Neo Geo CDZ games folder. If a game is recognised it is added to the dialog list. To force the scan to run again you can click the Scan Games button. You can force the scan to look in sub-directories of the folder you defined by selecting the Scan sub-dirs option. You can also force the scan to look for ISO's only and ignore CUE files by selecting the Scan for ISO only option.

- -

You can use the Directories button to open the Support File Path Dialog to change the folders to use for the games and/or covers.

- -

To view a full-size image of the covers, you can click on a cover image to open the image in a larger dialog box.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_palette_viewer.htm b/jan/fbahelpfilesrc/dialog_palette_viewer.htm deleted file mode 100644 index 0dd3adf92..000000000 --- a/jan/fbahelpfilesrc/dialog_palette_viewer.htm +++ /dev/null @@ -1,28 +0,0 @@ - - - - -Palette Viewer Dialog - - - - - - - - - - -
FB Alpha
- -

Palette Viewer Dialog

- -

This dialog allows you to view the games palette. It isn't supported by all drivers, but most do support this feature.

- -

256 palette entries are displayed on screen at once, and the Previous... and Next... buttons move between the entries in mutliples of 256.

- -

The Close closes the dialog box.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_rom_paths.htm b/jan/fbahelpfilesrc/dialog_rom_paths.htm deleted file mode 100644 index 4f5a690e2..000000000 --- a/jan/fbahelpfilesrc/dialog_rom_paths.htm +++ /dev/null @@ -1,30 +0,0 @@ - - - - -Rom Path Dialog - - - - - - - - - - -
FB Alpha
- -

Rom Path Dialog

- -

This dialog allows you to configure the folders that FB Alpha will search for roms. You can configure up to 20 folders to search in. Simply select the folder number from the tabs and then click Browse... to select the folder. Once you have finished click OK and if you have made any changes then FB Alpha will scan your roms.

- -

The last ten folders (numbers 11 to 20) are special supplementary cases. Usually FB Alpha will take the first file for a rom it finds and ignore any in the later folders. Any files placed in the last ten folders will be searched as well as the first file found. So, if you have some roms that require extra files than that found in MAME (the Neo-Geo bios is a good example), then you could put the extra files in ones of these folders.

- -

It is recommended to put the console (Megadrive/PC-Engine/Sega SG-1000/Colecovision/Master System/Game Gear) games in one of these special paths to prevent conflicts. Although, internally, FB Alpha uses an md_ prefix for the Megadrive games shortnames, either a pce_, tg_, or sgx_ prefix for PC-Engine games shortnames, cv_ for Colecovision game shortnames, sg1k_ for Sega SG-1000 game shortnames, sms_ for Sega Master System game shortnames, and gg_ for Sega Game Gear game shortnames this prefix should not be applied to the zipfiles the roms are stored in. This means you can point some of the supplementary rom paths at your MESS software list folder(s) for Megadrive, PC-Engine, TurboGrafx 16, SuperGrafx, ColecoVision, Sega SG-1000, Sega Master System or Game Gear and you're done.

- -

DO NOT ASK US WHERE TO FIND ROMS. They are copyrighted and we can't help you.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_shot_factory.htm b/jan/fbahelpfilesrc/dialog_shot_factory.htm deleted file mode 100644 index 46700e9e0..000000000 --- a/jan/fbahelpfilesrc/dialog_shot_factory.htm +++ /dev/null @@ -1,28 +0,0 @@ - - - - -Shot Factory Dialog - - - - - - - - - - -
FB Alpha
- -

Shot Factory Dialog

- -

This dialog can be used to enable/disable parts of the games layers and then take a screenshot. This can be useful for sprite capture or similar tasks.

- -

To enable or disable a layer simply check or uncheck it in the list. To take a screenshot click Capture, to advance a frame click Advance Frame. When you are finished click Done to close the dialog.

- -

Not all games support the dialog, and those that do may not have all the layers that are displayed in the dialog.

- -
- - diff --git a/jan/fbahelpfilesrc/dialog_support_path.htm b/jan/fbahelpfilesrc/dialog_support_path.htm deleted file mode 100644 index 596a83299..000000000 --- a/jan/fbahelpfilesrc/dialog_support_path.htm +++ /dev/null @@ -1,103 +0,0 @@ - - - - -Support File Path Dialog - - - - - - - - - - -
FB Alpha
- -

Support File Dialog

- -

This dialog allows you to configure the folders to search for support files. Simply select the type of support file you want to configure from the tabs and click Browse... to configure the folder to use for those files. Press OK when you have finished to save the changes.

- -

Most support files are named after a games short name. This is a unique name and can be found in the Game Select Dialog by enabling the Use Zipnames option. For example if you wanted to place a preview file for X-Men vs. Street Fighter you would call it xmvsf.png.

- -

To use the support files they should be placed in the folder which you have configured.

- -

The table below gives an overview of all the support files and how they should be named.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PreviewsThis will display an in-game preview image in several dialog boxes. The files should be named shortgamename.png.
TitlesThis will display an image of the game's title screen in the Game Selection Dialog, and the Game Info Dialog. The files should be named shortgamename.png.
IconsThis will display an icon for the game's in the Game Selection Dialog. The files should be named shortgamename.ico.
CheatsThese files provide cheat functionality for the Cheat Dialog. Cheat files can be in one of three formats. The FB Alpha format requires a filename of shortgamename.ini, the Nebula/Kawaks format requires a filename of shortgamename.dat and the old MAME format requires all the cheats in the one cheat.dat file.
High ScoresYou can use this file to save high scores in your games. Place the hiscore.dat file in the folder you configure and enable the Save high scores when supported option from the Misc menu. High scores will only be saved for games that have support for it flagged.
SamplesSome games require sound samples recorded from the original games in order to recreate the full sound of the original. The samples required by FB Alpha are the same as those required by MAME.
IPSThis will enable IPS Patches if the patches are placed in this path. See the IPS Manager Dialog for more information.
Neo Geo CDZ GamesKeep any Neo Geo CDZ games you have in this folder and they will be shown in the Neo Geo CDZ Game Select Dialog.
Neo Geo CDZ CoversThis will display the cover for Neo Geo CDZ games. See the Neo Geo CDZ Game Select Dialog for more information.
Blend FilesThese files provide alpha blending functionality for the supported games (currently Capcom CPS-1/CPS-2 and Neo Geo). The blend file format requires a filename of shortgamename.bld.
Select PreviewsThis will display an image of the game's select screen in the Game Info Dialog. The files should be named shortgamename.png.
Versus PreviewsThis will display an image of the game's versus screen in the Game Info Dialog. The files should be named shortgamename.png.
HowTo PreviewsThis will display an image of the game's howto screen in the Game Info Dialog. The files should be named shortgamename.png.
Scores PreviewsThis will display an image of the game's high score screen in the Game Info Dialog. The files should be named shortgamename.png.
Bosses PreviewsThis will display an image of the game's bosses screen in the Game Info Dialog. The files should be named shortgamename.png.
Game Over PreviewsThis will display an image of the game's game over screen in the Game Info Dialog. The files should be named shortgamename.png.
FlyersThis will display an image of the game's flyer in the Game Info Dialog. The files should be named shortgamename.png.
MarqueesThis will display an image of the game's marquee in the Game Info Dialog. The files should be named shortgamename.png.
Control PanelsThis will display an image of the game's control panel in the Game Info Dialog. The files should be named shortgamename.png.
CabinetsThis will display an image of the game's cabinet in the Game Info Dialog. The files should be named shortgamename.png.
PCBsThis will display an image of the game's PCB in the Game Info Dialog. The files should be named shortgamename.png.
History.datThe location of the history.dat file. This file provides various details of the game in the Game Info Dialog.
EEPROM SavesGames that use NVRAM or EEPROMs will save their data in this folder.
- -
- - diff --git a/jan/fbahelpfilesrc/fba.chm b/jan/fbahelpfilesrc/fba.chm deleted file mode 100644 index 52961f2c6..000000000 Binary files a/jan/fbahelpfilesrc/fba.chm and /dev/null differ diff --git a/jan/fbahelpfilesrc/fba.hhk b/jan/fbahelpfilesrc/fba.hhk deleted file mode 100644 index b3a5f0c9b..000000000 --- a/jan/fbahelpfilesrc/fba.hhk +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/jan/fbahelpfilesrc/fba.hhp b/jan/fbahelpfilesrc/fba.hhp deleted file mode 100644 index da6a8fcba..000000000 --- a/jan/fbahelpfilesrc/fba.hhp +++ /dev/null @@ -1,42 +0,0 @@ -[OPTIONS] -Compatibility=1.1 or later -Compiled file=fba.chm -Contents file=Table of Contents.hhc -Default topic=intro.htm -Display compile progress=No -Index file=fba.hhk -Language=0x809 English (United Kingdom) - - -[FILES] -sysreq.htm -acknowledgments.htm -cheat_format.htm -command.htm -dialog_cheats.htm -dialog_dips.htm -dialog_game_select.htm -dialog_inputs.htm -dialog_rom_paths.htm -dialog_shot_factory.htm -dialog_support_path.htm -intro.htm -keys.htm -localise_app.htm -menu_audio.htm -menu_game.htm -menu_help.htm -menu_input.htm -menu_misc.htm -menu_video.htm -presets.htm -dialog_ips_manager.htm -dialog_multislot.htm -dialog_neocdz.htm -localise_gamelist.htm -dialog_palette_viewer.htm -dialog_game_info.htm -dialog_choose_monitor.htm - -[INFOTYPES] - diff --git a/jan/fbahelpfilesrc/images/misc.bmp b/jan/fbahelpfilesrc/images/misc.bmp deleted file mode 100644 index 408da009c..000000000 Binary files a/jan/fbahelpfilesrc/images/misc.bmp and /dev/null differ diff --git a/jan/fbahelpfilesrc/images/tv not found non essential.ico b/jan/fbahelpfilesrc/images/tv not found non essential.ico deleted file mode 100644 index 367cb47cf..000000000 Binary files a/jan/fbahelpfilesrc/images/tv not found non essential.ico and /dev/null differ diff --git a/jan/fbahelpfilesrc/images/tv not found.ico b/jan/fbahelpfilesrc/images/tv not found.ico deleted file mode 100644 index 9cfa60df9..000000000 Binary files a/jan/fbahelpfilesrc/images/tv not found.ico and /dev/null differ diff --git a/jan/fbahelpfilesrc/images/tv not working.ico b/jan/fbahelpfilesrc/images/tv not working.ico deleted file mode 100644 index 9149eeba3..000000000 Binary files a/jan/fbahelpfilesrc/images/tv not working.ico and /dev/null differ diff --git a/jan/fbahelpfilesrc/intro.htm b/jan/fbahelpfilesrc/intro.htm deleted file mode 100644 index 8b509805d..000000000 --- a/jan/fbahelpfilesrc/intro.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - -Introducing FB Alpha - - - - - - - - - - -
FB Alpha
- -

Introducing FB Alpha

- -

FB Alpha is an arcade emulator supporting the following platforms;

- - - -

FB Alpha also has WIP console/computer drivers for Sega Megadrive/Genesis, ColecoVision, Sega SG-1000, Sega Master System/Game Gear, MSX-1 and also PC-Engine/TurboGrafx 16/SuperGrafx.

- -

FB Alpha can currently be obtained from https://www.fbalpha.com.

- -
- - diff --git a/jan/fbahelpfilesrc/keys.htm b/jan/fbahelpfilesrc/keys.htm deleted file mode 100644 index f123b01bf..000000000 --- a/jan/fbahelpfilesrc/keys.htm +++ /dev/null @@ -1,131 +0,0 @@ - - - - -Keys - - - - - - - - - - -
FB Alpha
- -

Keys

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
F6Open game selection dialog.
CTRL and F6Start a game via netplay.
F5Open inputs dialog.
CTRL and F5Open dip switch dialog.
CTRL and F4Exit Game.
ALT and F4Exit emulator.
PausePause the emulation.
F1Hold to fast forward emulation.
ALT and EnterSwitch to fullscreen.
EscReturn to windowed mode from fullscreen.
ALT and +Volume up.
ALT and -Volume down.
BackspaceToggle Frames per Second display.
TOn-screen chat (netplay only)
F7Insert or eject a memory card.
CTRL and F7Select memory card.
CTRL, SHIFT and F7Create a memory card.
CTRL and F9Load savestate.
CTRL and F10Save savestate.
F8Activate previous savestate slot.
F11Activate next savestate slot.
F9Load savestate from active slot.
F10Save savestate to active slot.
Shift and F8Undo savestate in active slot.
F12Save screenshot.
CTRL and F12Open shot factory.
CTRL, SHIFT and F1Invoke debugger (debug builds only).
CTRL and F1Enable cheats.
CTRL and HOMEStart New Cheat Search.
CTRL and /Cheat value not changed.
CTRL and *Cheat value changed.
CTRL and +Cheat value increased.
CTRL and -Cheat value decreased.
Double-click on game screenEnter full screen.
Right-click on game screenShow/hide menu bar.
- -
- - diff --git a/jan/fbahelpfilesrc/localise_app.htm b/jan/fbahelpfilesrc/localise_app.htm deleted file mode 100644 index 0e4686058..000000000 --- a/jan/fbahelpfilesrc/localise_app.htm +++ /dev/null @@ -1,32 +0,0 @@ - - - - -Localising the Application - - - - - - - - - - -
FB Alpha
- -

Localising the Application

- -

The application can be localised using templates. To generate a template click on the Misc Menu, then UI Language, Export UI translation template....

- -

Save the template where you want and then open it in a text editor. Localise the strings by amending them and saving the file.

- -

To enable your localisation, click on the Misc Menu, then UI Language, Select UI Language and then open your template.

- -

To remove an applied template, click on the Misc Menu, then UI Language, Reset UI default Language.

- -

It is also possible to download localisation files from within the program. To do this, click on the Misc Menu, then UI Language, Download UI language. This will open a dialog showing the languages available for download. Once you select a language press the OK button the template will be downloaded and applied.

- -
- - diff --git a/jan/fbahelpfilesrc/localise_gamelist.htm b/jan/fbahelpfilesrc/localise_gamelist.htm deleted file mode 100644 index 69d1ac073..000000000 --- a/jan/fbahelpfilesrc/localise_gamelist.htm +++ /dev/null @@ -1,32 +0,0 @@ - - - - -Localising the Gamelist - - - - - - - - - - -
FB Alpha
- -

Localising the Gamelist

- -

The gamelist can be localised using templates. To generate a template click on the Misc Menu, then Gamelist Language, Export gamelist translation template....

- -

Save the template where you want and then open it in a text editor. The file is a tab-delimited text file, containing the games shortname and longname. Simply localise the longnames and save the file. If you are using multi-byte characters and need to use a different codepage than the system default, then uncomment the codepage line at the top of the file (remove the // ), and change the number to the relevant codepage.

- -

To enable your localisation, click on the Misc Menu, then Gamelist Language, Select gamelist Language and then open your template.

- -

To remove an applied template, click on the Misc Menu, then Gamelist Language, Reset gamelist default Language.

- -

You can use MAME+ LST files for the template. Simply rename the file's extension to glt (eg, if the file is called mame_kr.lst, change it to mame_kr.glt), and add any necessary codepage definition if required. FB Alpha will ignore any extra text after the first two tab-delimited tokens.

- -
- - diff --git a/jan/fbahelpfilesrc/menu_audio.htm b/jan/fbahelpfilesrc/menu_audio.htm deleted file mode 100644 index 59850702d..000000000 --- a/jan/fbahelpfilesrc/menu_audio.htm +++ /dev/null @@ -1,83 +0,0 @@ - - - - -Audio Menu - - - - - - - - - - -
FB Alpha
- -

Audio Menu

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select pluginSelect the audio plugin to use.
Plugin optionsConfigure the selected plugin (see below).
2-point 1st order sample interpolationEnable sample interpolation on some of the APDCM cores.
4-point 3rd order sample interpolationEnable higher quality (but slower) sample interpolation on some of the APDCM cores.
Disable FM interpolationDisable interpolation on the FM cores.
4-point 3rd order FM interpolationEnable sample interpolation on the FM cores.
Sound LoggingStart or stop logging sound to a file.
Buffer SizeSet the number of frames to buffer sound for. Most users shouldn't need to change this.
- -

DirectSound Audio Plugin Menu

- - - - - - - - - - - - -
Use Low-pass filterEnable a low-pass filter.
Sound DisabledDisable sound.
11025Hz, 22050Hz, 44100Hz, 48000Hz Sample RateSet the sound frequency. Higher is better quality but slightly slower.
- -

XAudio2 Audio Plugin Menu

- - - - - - - - - - - - - - - -
Use Low-pass filterEnable a low-pass filter.
Use ReverbEnable a reverb filter.
Sound DisabledDisable sound.
11025Hz, 22050Hz, 44100Hz, 48000Hz Sample RateSet the sound frequency. Higher is better quality but slightly slower.
- -
- - diff --git a/jan/fbahelpfilesrc/menu_game.htm b/jan/fbahelpfilesrc/menu_game.htm deleted file mode 100644 index 0eeb407b9..000000000 --- a/jan/fbahelpfilesrc/menu_game.htm +++ /dev/null @@ -1,113 +0,0 @@ - - - - -Game Menu - - - - - - - - - - -
FB Alpha
- -

Game Menu

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Load GameOpens the Game Select Dialog to choose a game to load.
Play via KailleraOpens the Game Select Dialog to choose a game to load for netplay.
Most recent gamesDisplays the ten most recent games. Click on one to start that game.
Start Neo Geo Multi-slotOpens the NeoGeo MVS Multislot Game Select Dialog.
Load Neo Geo CDZ gameOpens the NeoGeo CDZ Game Select Dialog.
Select CD Image (ISO/CUE)Opens a file select dialog, which allows you to choose and ISO/CUE CD image to use with the Neo Geo CDZ driver.
Start Neo Geo CDZStarts the Neo Geo CDZ emulation, using the current loaded ISO/CUE CD image.
Exit GameCloses the current game.
Pause GamePauses the current game.
Adjust CPU speedAllows you to over or underclock the games CPU. Only some drivers support this.
Reset CPU speed to 100%Turns off any over or underclocking of the games CPU.
Create new memory cardCreates a new memory card file (only used by the Neo Geo driver).
Select Memory CardAllows you to select a memory card file (only used by the Neo Geo driver).
Insert Memory CardInserts the currently selected memory card (only used by the Neo Geo driver).
Eject Memory CardEjects the current memory card (only used by the Neo Geo driver).
Replay InputPrompts for an input recording file (.FR), loads the game and plays back the input recording.
Record InputStart recording an input recording file (.FR).
Stop Replay/RecordStops the current playing back or recording of an input recording.
Load StatePrompt for a savestate file (.FS) to load from disc.
Save StateSaves the games state to a savestate file (.FS). This can be used to save your current game for later play.
Activate Previous SlotActivates the previous savestate slot.
Activate Next SlotActivates the next savestate slot.
Load state from active slotLoads the savestate from the current selected slot.
Save state to active slotSaves the savestate to the current selected slot.
Undo last state saveUndoes the last save state in the active slot.
Restore full state on loadThis option will automatically take a savestate when you exit a game and load that state when you load the game.
Record AVIOpens the codec selection dialog ready to start recording an AVI file.
Stop recordingStops recording an AVI file.
Exit EmulatorExits the application.
- -
- - diff --git a/jan/fbahelpfilesrc/menu_help.htm b/jan/fbahelpfilesrc/menu_help.htm deleted file mode 100644 index 835a00568..000000000 --- a/jan/fbahelpfilesrc/menu_help.htm +++ /dev/null @@ -1,47 +0,0 @@ - - - - -Help Menu - - - - - - - - - - -
FB Alpha
- -

Help Menu

- - - - - - - - - - - - - - - - - - - - - - - - -
HelpView this file.
What's NewView the what's new document.
FB Alpha hompageVisit the FB Alpha homepage.
FB Alpha ForumsVisit the FB Alpha forums.
Neo-Source ForumsVisit the Neo-Source forums - this forum is active and is the best place to report bugs or discuss FBA.
System InformationView information about your system.
About FB AlphaView the About dialog containing the license and version info.
- -
- - diff --git a/jan/fbahelpfilesrc/menu_input.htm b/jan/fbahelpfilesrc/menu_input.htm deleted file mode 100644 index 5d3403de7..000000000 --- a/jan/fbahelpfilesrc/menu_input.htm +++ /dev/null @@ -1,38 +0,0 @@ - - - - -Input Menu - - - - - - - - - - -
FB Alpha
- -

Input Menu

- - - - - - - - - - - - - - - -
Select pluginSelect the input plugin to use - currently does nothing.
Auto-Fire RateSets the rate (speed) of auto-fire). Options available are Slow, Medium, Fast and Very Fast.
Map Game InputsOpens the game inputs dialog.
Set dipswitchesOpens the game dipswitch dialog.
- -
- - diff --git a/jan/fbahelpfilesrc/menu_misc.htm b/jan/fbahelpfilesrc/menu_misc.htm deleted file mode 100644 index 2f19b8e89..000000000 --- a/jan/fbahelpfilesrc/menu_misc.htm +++ /dev/null @@ -1,131 +0,0 @@ - - - - -Misc Menu - - - - - - - - - - -
FB Alpha
- -

Misc Menu

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Auto PauseWill automatically pause the emulator if it loses focus or you switch to another window.
Always process keyboard inputWill process the keyboard input.
Display Mode IndicatorWill show an indicator telling when the emulator is paused, recording, etc.
Don't change Num Lock statusEnabling this will stop FB Alpha from changing the Num Lock status when starting or exiting. Enabling this option means that you will manually have to control the Num Lock status if you want to use Hotrod or X-Arcade sticks.
Create support folders at runtimeDisabling this will prevent FB Alpha creating the support file folders at program start.
Set application thread prioritySet the applications thread priority. Set it to higher to go faster, or lower to be more co-operative with multi-tasking windows apps.
Save high scores when supportedEnable this to turn on high score saving. See the Support File Path Dialog section for more information.
Use alpha blend effects when supportedEnable this to turn on alpha blend effects for supported games. See the Support File Path Dialog section for more information.
Display Gear-Shift Indicator when supportedShow the current gear on-screen for games that support it. This is usually a L for low gear, and a H for high gear.
AVI Writer Output SizeMultiplier to scale the resolution when writing an AVI file, options are 1x, 2x, 3x.
Generate dat fileGenerate dat files for use with rom managers. FB Alpha can output dat files in the clrmamepro (xml format). You can choose to ouput a dat file for the arcade games, or a console/computer specific dat file (for Megadrive, PC-Engine, TurboGrafx 16, SuprGrafx, Sega SG-1000, ColecoVision, Sega Master System, Game Gear, or MSX-1).
Generate all datsGenerate dat files for use with rom managers. FB Alpha can output dat files in the clrmamepro (xml format). This option outputs all dat files to the folder selected.
Configure ROM pathsOpen the Rom Path Dialog.
Configure support file pathsOpen the Support File Path Dialog.
UI LanguageSee the Localising the Application section for more information.
Gamelist LanguageSee the Localising the Gamelist section for more information.
Enable driver icons displayEnables game icons in the Game Selection Dialog.
Icon sizeChoose between 16 x 16, 24 x 24, or 32 x 32.
Save SnapshotSaves a snapshot in the screenshot folder.
Shot FactoryOpens the Shot Factory Dialog.
Enable CheatsOpens the Cheat Dialog to allow you to apply cheats. This item is only enabled if you have a valid cheat file in the cheat support file folder.
Start New SearchWill start a new cheat search.
Target value has not changedTell the cheat search that the value you are looking for has not changed.
Target value has changedTell the cheat search that the value you are looking for has changed.
Target value has decreasedTell the cheat search that the value you are looking for has decreased.
Target value has increasedTell the cheat search that the value you are looking for has increased.
Dump search to fileDumps all the remaining addresses and values from a cheat search into a file called cheatsearchdump.txt in the FB Alpha root folder.
Exit Cheat SearchExits the cheat search mode.
Palette ViewerOpens the Palette Viewer Dialog.
Associate with .fs and .fr filesAssociates .fs and .fr files with windows so that you can open FB Alpha using one of these files from explorer.
Disassociate with .fs and .fr filesRemoves the association with .fs and .fr files from Windows.
Save input mapping nowWill save the input and dip switch settings for the current game to the games config file.
Auto-save input mappingIf this is enabled then FB Alpha will automatically save the input and dip switch settings for the current game to the games config file when you close the game.
Save settings to .ini nowWill save the application settings to the .ini file. This also happens automatically when you close the application.
Reload settings from .iniWill reload the application settings from the .ini file.
- -
- - diff --git a/jan/fbahelpfilesrc/menu_video.htm b/jan/fbahelpfilesrc/menu_video.htm deleted file mode 100644 index 0be90d5fa..000000000 --- a/jan/fbahelpfilesrc/menu_video.htm +++ /dev/null @@ -1,228 +0,0 @@ - - - - -Video Menu - - - - - - - - - - -
FB Alpha
- -

Video Menu

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select blitterSelect which blitter to use.
Blitter optionsConfigure the selected blitter (see below).
StretchChoose between Normal, Full, or Correct Aspect Ratio. The recommended setting is Correct Aspect Ratio to preserve the games original look.
Enable Gamma CorrectionEnables gamma correction.
Darken mid-tones, Lighten mid-tones, Other Gamma valueAllows you to configure the gamma value to use.
Use video hardware when possible, use video hardware exclusively, use software exclusivelyTells FB Alpha how to apply the gamma correction. Recommended setting is Use video hardware exclusively unless this gives you problems.
Window sizeDetermines the size of the window when not in fullscreen. Choose between Auto, Single Size, Double Size, Triple Size, Quadruple Size, or Maximise.
Toggle fullscreen modeSwitch to fullscreen.
Auto Switch to Fullscreen after loadingEnabling this option will automatically switch to fullscreen after you load a game from the Game Select Dialog.
Full Screen ResolutionAllows you to set the fullscreen resolution to use. This can be configured independently for hoziontal and vertical games. You can select between Arcade (which attempts to use the games native resolution, Single Size, Double Size, Triple Size, Quadruple Size or you can specify a specific resolution to use.
Fullscreen bitdepthAllows you to choose between 16-bit, 24-bit and 32-bit colour modes for use in fullscreen.
Choose Fullscreen MonitorOpens the Choose Monitor for Full Screen dialog.
Automatically detect aspect ratioIf this is enabled FB Alpha will automatically attempt to determine the aspect ratio of your monitor.
Normal CRT, Normal LCD, Widescreen CRT, Widescreen LCD aspect ratio Select the one that best describes your monitor. This will help to preserve the look of the original game. This option will be selected for you automatically if the Automatically detect aspect ratio item is enabled.
Mirrored vertical alignmentIf enabled will mirror the aspect ratio settings for vertical games.
Rotate vertically aligned gamesIf this option is enabled then vertical games will be rotated by FB Alpha. Only disable this if you want to align your monitor vertically to play vertical games.
Force 60hz refresh rateThis option will force the video to ouput at 60hz. This will help to eliminate tearing but may induce other problems.
Enable Triple Buffering (Fullscreen)Use a triple buffer in fullscreen.
Enable VSync (Windowed)Enabling this will help to eliminate tearing in Windowed mode but you may see slightly juttering scrolling.
Auto frameskipThis will skip frames in the video output if necessary to keep the game running at fullspeed. This is only necessary for slower computers but it is recommended to leave it on for all computers.
- -

Basic (DirectDraw 7) Blitter Menu

- - - - - - - - - - - - - - - - - - - - - -
No EffectsTurns off all effects.
ScanlinesWill turn on a scanline effect.
Scanlines 50%Will turn on an alternative scanline effect.
Rotate scanlinesIf this is enabled then scanlines will be rotated for vertical games.
Force FlipForces hardware flipping for games that require it. This is usually detected as an available feature, but due to DirectDraw being old, the support doesn't usually get detected. This option will force the flipping if a game needs it. This is best used with the System Memory Buffering Method. This option will likely force Windows to disable Aero and revert to basic settings, and is therefore recommended for older computers still using Windows XP only. If you are using a version of Windows newer than XP then you should be using the Enhanced or DirectX 9 blitters.
Buffering MethodChoose between Autodetect, Video memory, and System memory. The recommended setting is Autodetect unless this causes you problems.
- -

SoftFX (DirectDraw 7) Blitter Menu

- - - - - - - - - - - - - - - -
Filter ListChoose a graphics filter to apply. These will only work with the colour depths specified.
Force image to SoftFX sizeWill force the video image to the selected filter size.
Buffering MethodChoose between Autodetect, Video memory, and System memory. The recommended setting is Autodetect unless this causes you problems.
Directly access video memoryLeave this enabled unless it causes you problems.
- -

Enhanced (Direct3D 7) Blitter Menu

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Disable all effectsTurns off all effects.
Enable bi-linear filteringEnables bi-linear filtering.
Rotate scanlines and RGB effectsIf this is enabled then scanlines and RGB effects will be rotated for vertical games.
Enable Pre-scaleEnables pre-scale for use with the SoftFX filters.
Pre-scale using SoftFXTurns on prescaling using SoftFX.
SoftFX AlgorithmChoose a SoftFX filter to apply to the video.
Force image to SoftFX sizeWill force the video image to the selected filter size.
Enable scanlinesWill turn on a scanline effect.
Set scanline intensityAllows you to set the scanline intensity.
Enable phosphor feedbackWill turn on a phosphor feedback effect.
Set phosphor feedback intensityAllows you to set the phosphor feedback intensity.
No Effects, RGB Effects, 3D ProjectionAllows you to turn on RGB Effects, 3D Projection or turn off all RGB and 3D Projection effects.
Auto size scanlined RGB presetEnabling this will auto size any scanlined RGB presets.
Manually select RGB presetAllows you to select and RGB preset to use.
Set 3D Projection propertiesAllows you to set the 3D Projection Angle and Fishbowl factor.
Force 16-bit emulationIt is recommended to leave this off, as it will break games that require 32-bit colour depths.
Use DirectX texture managmentIt is recommended to leave this on.
- -

Experimental (DirectX Graphics 9) Blitter Menu

- - - - - - - - - - - - - - - - - - - - - -
Enable point/linear/cubic filteringEnable point, linear or cubic filtering.
Cubic filter qualitySet the quality of the cubic filter.
Enable point/linear/cubic filteringEnable point, linear or cubic filtering.
Enable scanlinesWill turn on a scanline effect.
Set scanline intensityAllows you to set the scanline intensity.
Single-pass, Multi-pass, High performanceSee the Experimental Blitter section of System Requirements for details.
- -

DirectX 9 Alt (DirectX Graphics 9) Blitter Menu

- - - - - - - - - - - - - - - -
Enable point/linear/ filteringEnable point or linear filtering.
SoftFX AlgorithmChoose a SoftFX filter to apply to the video.
Hardware vertex processingEnable hardware vertex processing.
Motion blurEnable motion blur.
- - -
- - diff --git a/jan/fbahelpfilesrc/presets.htm b/jan/fbahelpfilesrc/presets.htm deleted file mode 100644 index 965e98df4..000000000 --- a/jan/fbahelpfilesrc/presets.htm +++ /dev/null @@ -1,30 +0,0 @@ - - - - -Creating Presets - - - - - - - - - - -
FB Alpha
- -

Creating Input Presets

- -

You can create preset controls that can be listed in the Inputs Dialog for you to select.

- -

To do this you need to create an .INI file in the config\presets folder. An example is included with FB Alpha in the zip file preset-example.zip.

- -

In the .INI file it it is possible to use specific names such as "P1 Low Punch" or generic names such as "P1 Fire 1". When a game is allocating inputs it will look for specific name first, and then the generic ones.

- -

A good starting point can be take the .INI file for a game, copy it to the config/presets folder and rename it to what you want your preset to be called and then edit that file.

- -
- - diff --git a/jan/fbahelpfilesrc/sysreq.htm b/jan/fbahelpfilesrc/sysreq.htm deleted file mode 100644 index 22add432c..000000000 --- a/jan/fbahelpfilesrc/sysreq.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - -System Requirements - - - - - - - - - - -
FB Alpha
- -

System Requirements

- -
Operating System
- -

You will need at least Windows XP to run FB Alpha. Windows 7 or later is highly recommended. You should have the latest DirectX runtimes installed.

- -

If you are running Windows XP, then you will need to use the separately available Windows XP binary.

- -
CPU & RAM
- -

A CPU capable of running Windows XP or greater should be sufficient for most games. Exact requirements will vary by game and/or your chosen video and audio settings. You shouldn't have any issues with anything that even slightly resembles a modern CPU.

- -

The minimum amount of RAM recommended is 192MB. Most people shouldn't have any problems with RAM these days.

- -
Video
- -

15/16/24/32 BPP displays are supported.

- -

Basic Blitter: DirectDraw7 support is required. The Basic blitter will work with any videocard that supports the minimum requirements.

- -

Enhanced Blitter:DirectDraw7 + Direct3D7 support is required. The Enhanced blitter will not work with every video card available, specifically older Voodoo cards (up Voodoo 3000) will not work.

- -

Experimental Blitter: DirectX Graphics 9 support is required. The Experimental blitter has limited functionality with DirectX 8.1 compatible hardware, but needs DirectX 9 for full functionality. For optimal results, Geforce FX 5900 series or Radeon 9800 series (or faster) graphics cards are required. For these cards, select the appropriate filter version from the Advanced options submenu. For all other compatible cards (e.g. Geforce FX series or Radeon 8500 and higher), select the high-performance option.

- -

DirectX9 Alt Blitter: Same as Experimental Blitter above.

- -
Sound
- -

Any sound hardware supporting DirectSound3 should work. Most people should have no problems.

- -
Input
- -

The keyboard and system mouse will always work. There is preliminary support for additional mice, and devices such as the X Arcade joystick which act as a keyboard are supported. All standard or DirectInput8 compatible joysticks/joypads, and mice should work.

- -
- - diff --git a/jan/makefile b/jan/makefile deleted file mode 100644 index 920082e1a..000000000 --- a/jan/makefile +++ /dev/null @@ -1,101 +0,0 @@ -# Main Makefile for FB Alpha, execute an appropriate system-specific makefile - -export - -# -# Declare variables -# - -# Make a special build, pass the quoted text as comment (use FORCE_UPDATE declaration below to force recompilation of resources) -# SPECIALBUILD = "This text will appear in the property sheet of the .exe file" - - - -# -# Flags. Uncomment any of these declarations to enable their function. -# - -# Include Unicode support -UNICODE = 1 - -# Use Segoe Fonts (installed by default on Windows Vista and newer) -USE_SEGOE = 1 - -# Build A68K ASM 68000 core -#BUILD_A68K = 1 - -# Include x86 Assembly routines -BUILD_X86_ASM = 1 - -# Build for x64 targets (MinGW64 and MSVC only, this will undefine BUILD_A68K and BUILD_X86_ASM) -#BUILD_X64_EXE = 1 - -# Build for Windows XP target (for use with Visual Studio 2012-15) -#BUILD_VS_XP_TARGET = 1 - -# Include 7-zip support -INCLUDE_7Z_SUPPORT = 1 - -# Include AVI recording support (uses Video For Windows) -INCLUDE_AVI_RECORDING = 1 - -# Include Toaplan sound sample hacks for games without MCU dumps -TOAPLAN_SOUND_SAMPLES_HACK = 1 - -# Include Files that require C++11 (Killer Instinct, Midway Mortal Kombat style drivers, and associated files) - requires C++11 support -INCLUDE_CPLUSPLUS11_FILES = 1 - -# Include symbols and other debug information in the executable -#SYMBOL = 1 - -# Include features for debugging drivers -DEBUG = 1 - -# Include rom set verifying features (comment this for release builds) -#ROM_VERIFY = 1 - -# Force recompilation of files that need it (i.e. use __TIME__, __DATE__, SPECIALBUILD). -FORCE_UPDATE = 1 - -# Use the __fastcall calling convention when interfacing with A68K/Musashi/Doze -FASTCALL = 1 - -# Compress executable with upx (the DEBUG option ignores this) -# COMPRESS = 1 - -# Perl is available -PERL = 1 - -# Endianness -LSB_FIRST = 1 - -# Include png.h from burner.h -INCLUDE_LIB_PNGH = 1 - - -# -# execute an appropriate system-specific makefile -# - -mingw345: FORCE - @$(MAKE) -s -f makefile.mingw GCC345=1 - -mingw452: FORCE - @$(MAKE) -s -f makefile.mingw GCC452=1 - -mingw471: FORCE - @$(MAKE) -s -f makefile.mingw GCC471=1 - -mingw510: FORCE - @$(MAKE) -s -f makefile.mingw GCC510=1 - -mamemingw: FORCE - @$(MAKE) -s -f makefile.mamemingw - -sdl: FORCE - @$(MAKE) -s -f makefile.sdl - -vc: FORCE - @$(MAKE) -s -f makefile.vc - -FORCE: \ No newline at end of file diff --git a/jan/makefile.burn_rules b/jan/makefile.burn_rules deleted file mode 100644 index 4eab7367f..000000000 --- a/jan/makefile.burn_rules +++ /dev/null @@ -1,166 +0,0 @@ -alldir = burn burn/devices burn/snd burn/drv burn/drv/capcom burn/drv/cave burn/drv/coleco burn/drv/cps3 burn/drv/dataeast \ - burn/drv/galaxian burn/drv/irem burn/drv/konami burn/drv/megadrive burn/drv/midway burn/drv/pce burn/drv/pst90s burn/drv/pre90s \ - burn/drv/neogeo burn/drv/pgm burn/drv/psikyo burn/drv/sega burn/drv/sg1000 burn/drv/sms burn/drv/msx burn/drv/snes burn/drv/taito \ - burn/drv/toaplan cpu cpu/a68k cpu/arm cpu/arm7 cpu/h6280 cpu/hd6309 cpu/i8039 cpu/i8051 cpu/konami cpu/m68k cpu/m6502 cpu/m6800 \ - cpu/m6805 cpu/m6809 cpu/nec cpu/pic16c5x cpu/s2650 cpu/tlcs90 cpu/sh2 cpu/tms32010 cpu/upd7725 cpu/upd7810 cpu/v60 cpu/z80 - -drvobj = d_dodonpachi.o d_donpachi.o d_esprade.o d_feversos.o d_gaia.o d_guwange.o d_hotdogst.o d_korokoro.o d_mazinger.o \ - d_metmqstr.o d_pwrinst2.o d_sailormn.o d_tjumpman.o d_uopoko.o \ - \ - d_cps1.o \ - \ - d_cps2.o \ - \ - d_cps3.o \ - \ - d_actfancr.o d_backfire.o d_boogwing.o d_bwing.o d_cbuster.o d_chanbara.o d_cninja.o d_darkseal.o d_dassault.o d_dblewing.o d_dec0.o \ - d_dec8.o d_dietgogo.o d_funkyjet.o d_karnov.o d_kchamp.o d_lemmings.o d_pktgaldx.o d_rohga.o d_shootout.o d_sidepckt.o d_simpl156.o d_supbtime.o \ - d_tumblep.o d_vaportra.o \ - \ - d_galaxian.o \ - \ - d_m62.o d_m63.o d_m72.o d_m90.o d_m92.o d_m107.o d_vigilant.o \ - \ - d_88games.o d_ajax.o d_aliens.o d_asterix.o d_battlex.o d_battlnts.o d_bishi.o d_bladestl.o d_blockhl.o d_bottom9.o d_chqflag.o d_circusc.o \ - d_contra.o d_crimfght.o d_dbz.o d_finalzr.o d_gberet.o d_gijoe.o d_gbusters.o d_gradius3.o d_gyruss.o d_hcastle.o d_hexion.o d_hyperspt.o \ - d_ironhors.o d_jackal.o d_jailbrek.o d_junofrst.o d_kontest.o d_labyrunr.o d_lethal.o d_mainevt.o d_megazone.o d_mikie.o d_mogura.o d_moo.o \ - d_mystwarr.o d_nemesis.o d_pandoras.o d_parodius.o d_pingpong.o d_pooyan.o d_rocnrope.o d_rockrage.o d_rollerg.o d_scotrsht.o d_shaolins.o \ - d_simpsons.o d_spy.o d_surpratk.o d_thunderx.o d_timeplt.o d_tmnt.o d_tp84.o d_trackfld.o d_tutankhm.o d_twin16.o d_ultraman.o d_vendetta.o \ - d_xexex.o d_xmen.o d_yiear.o \ - \ - d_neogeo.o \ - \ - d_pgm.o \ - \ - d_psikyo.o d_psikyo4.o d_psikyosh.o \ - \ - d_angelkds.o d_appoooh.o d_bankp.o d_dotrikun.o d_hangon.o d_outrun.o d_segae.o d_suprloco.o d_sys1.o d_sys16a.o d_sys16b.o d_sys18.o \ - d_xbrd.o d_ybrd.o d_zaxxon.o \ - \ - d_arkanoid.o d_ashnojoe.o d_asuka.o d_bublbobl.o d_chaknpop.o d_darius2.o d_darkmist.o d_exzisus.o d_flstory.o d_ksayakyu.o d_lkage.o \ - d_minivdr.o d_othunder.o d_retofinv.o d_rollrace.o d_slapshot.o d_superchs.o d_supridr.o d_taitob.o d_taitoh.o d_taitof2.o d_taitof3.o \ - d_taitol.o d_taitomisc.o d_taitox.o d_taitoz.o d_tnzs.o d_wyvernf0.o \ - \ - d_batrider.o d_batsugun.o d_battleg.o d_bbakraid.o d_demonwld.o d_dogyuun.o d_fixeight.o d_ghox.o d_hellfire.o \ - d_kbash.o d_kbash2.o d_mahoudai.o d_outzone.o d_pipibibs.o d_rallybik.o d_samesame.o d_shippumd.o d_slapfght.o \ - d_snowbro2.o d_tekipaki.o d_truxton.o d_truxton2.o d_vfive.o d_vimana.o d_wardner.o d_zerowing.o \ - \ - d_4enraya.o d_1942.o d_1943.o d_aeroboto.o d_alinvade.o d_alpha68k.o d_alpha68k1.o d_alpha68k2.o d_ambush.o d_arabian.o d_armedf.o d_atetris.o d_aztarac.o \ - d_baraduke.o d_bbusters.o d_battlane.o d_bionicc.o d_blktiger.o d_blockout.o d_blueprnt.o d_bogeyman.o d_bombjack.o d_btime.o d_brkthru.o \ - d_cabal.o d_calorie.o d_canyon.o d_capbowl.o d_cclimber.o d_cheekyms.o d_chinagat.o d_citycon.o d_cloak.o d_commando.o d_cybertnk.o \ - d_dacholer.o d_ddragon.o d_djboy.o d_dkong.o d_docastle.o d_dogfgt.o d_drmicro.o d_dynduke.o d_epos.o d_exedexes.o d_fantland.o d_fastfred.o \ - d_firetrap.o d_freekick.o d_funkybee.o d_galaga.o d_galivan.o d_gaplus.o d_gauntlet.o d_ginganin.o d_gng.o d_gunsmoke.o d_higemaru.o d_himesiki.o \ - d_hvyunit.o d_ikki.o d_invaders.o d_jack.o d_jrpacman.o d_kangaroo.o d_kncljoe.o d_kyugo.o d_ladybug.o d_lasso.o d_lastduel.o d_lwings.o d_mainsnk.o \ - d_mappy.o d_marineb.o d_mario.o d_markham.o d_megasys1.o d_meijinsn.o d_metlfrzr.o d_millipede.o d_mirax.o d_mitchell.o d_mole.o d_momoko.o d_mouser.o \ - d_mrdo.o d_mrflea.o d_mrjong.o d_munchmo.o d_mustache.o d_mystston.o d_namcos1.o d_namcos86.o d_ninjakd2.o d_naughtyb.o d_pacland.o d_pacman.o d_pac2650.o \ - d_pengadvb.o d_phoenix.o d_pkunwar.o d_popeye.o d_prehisle.o d_psychic5.o d_pturn.o d_punchout.o d_qbert.o d_quizo.o d_rallyx.o d_renegade.o \ - d_route16.o d_rpunch.o d_safarir.o d_sauro.o d_scregg.o d_seicross.o d_sf.o d_sidearms.o d_skyarmy.o d_skyfox.o d_skykid.o d_snk.o \ - d_snk68.o d_solomon.o d_sonson.o d_srumbler.o d_ssozumo.o d_sub.o d_suna8.o d_tail2nose.o d_tbowl.o d_tecmo.o d_terracre.o d_thedeep.o \ - d_tigeroad.o d_timelimt.o d_toki.o d_toypop.o d_travrusa.o d_tsamurai.o d_twincobr.o d_usgames.o d_vastar.o d_vulgus.o d_wallc.o d_warpwarp.o d_wc90.o \ - d_wc90b.o d_wiz.o d_wrally.o d_wwfsstar.o d_xain.o d_xxmissio.o d_zodiack.o \ - \ - d_1945kiii.o d_aerofgt.o d_airbustr.o d_aquarium.o d_bestleag.o d_bigstrkb.o d_blmbycar.o d_bloodbro.o d_crospang.o d_crshrace.o d_dcon.o \ - d_ddragon3.o d_deniam.o d_diverboy.o d_dooyong.o d_dreamwld.o d_drgnmst.o d_drtomy.o d_egghunt.o d_esd16.o d_f1gp.o d_funybubl.o d_fuukifg2.o \ - d_fuukifg3.o d_gaelco.o d_gaelco2.o d_gaiden.o d_galpanic.o d_galspnbl.o d_gotcha.o d_gumbo.o d_hyperpac.o d_jchan.o d_kaneko16.o d_lordgun.o \ - d_macrossp.o d_mcatadv.o d_metro.o d_midas.o d_mugsmash.o d_mwarr.o d_namcos2.o d_news.o d_nmg5.o d_nmk16.o d_ohmygod.o d_onetwo.o d_pass.o d_pirates.o \ - d_playmark.o d_powerins.o d_pushman.o d_raiden.o d_raiden2.o d_sandscrp.o d_seta.o d_seta2.o d_shadfrce.o d_silkroad.o d_silvmil.o d_speedspn.o \ - d_ssv.o d_suna16.o d_suprnova.o d_taotaido.o d_tecmo16.o d_tecmosys.o d_tetrisp2.o d_tumbleb.o d_unico.o d_vmetal.o d_welltris.o d_wwfwfest.o \ - d_xorworld.o d_yunsun16.o d_yunsung8.o d_zerozone.o \ - \ - d_parent.o \ - \ - d_megadrive.o \ - \ - d_pce.o \ - \ - d_sms.o \ - \ - d_msx.o \ - \ - d_snes.o \ - \ - d_coleco.o \ - \ - d_sg1000.o - -ifdef INCLUDE_CPLUSPLUS11_FILES - drvobj += d_kinst.o d_wunit.o -endif - -depobj := $(drvobj) \ - \ - burn.o burn_gun.o burn_led.o burn_shift.o burn_memory.o burn_pal.o burn_sound.o burn_sound_c.o cheat.o debug_track.o hiscore.o load.o \ - tilemap_generic.o tiles_generic.o timer.o vector.o \ - \ - 6821pia.o 8255ppi.o 8257dma.o c169.o eeprom.o gaelco_crypt.o joyprocess.o nb1414m4.o nb1414m4_8bit.o nmk004.o nmk112.o kaneko_tmap.o mb87078.o \ - mermaid.o namco_c45.o namcoio.o pandora.o resnet.o seibusnd.o sknsspr.o slapstic.o st0020.o t5182.o timekpr.o tms34061.o v3021.o vdc.o tms9928a.o \ - watchdog.o \ - \ - ay8910.o burn_y8950.o burn_ym2151.o burn_ym2203.o burn_ym2413.o burn_ym2608.o burn_ym2610.o burn_ym2612.o \ - burn_ym3526.o burn_ym3812.o burn_ymf278b.o c6280.o dac.o es5506.o es8712.o flt_rc.o fm.o fmopl.o gaelco.o ics2115.o iremga20.o \ - k005289.o k007232.o k051649.o k053260.o k054539.o msm5205.o msm5232.o msm6295.o namco_snd.o c140.o nes_apu.o tms36xx.o phoenixsound.o \ - pleiadssound.o pokey.o rf5c68.o saa1099.o samples.o segapcm.o sn76477.o sn76496.o upd7759.o vlm5030.o x1010.o ym2151.o ym2413.o \ - ymdeltat.o ymf278b.o ymz280b.o \ - \ - arm7_intf.o arm_intf.o h6280_intf.o hd6309_intf.o konami_intf.o m6502_intf.o m6800_intf.o m6805_intf.o m6809_intf.o \ - m68000_intf.o nec_intf.o pic16c5x_intf.o s2650_intf.o tlcs90_intf.o z80_intf.o \ - \ - arm.o arm7.o h6280.o hd6309.o i8039.o mcs51.o konami.o m6502.o m6800.o m6805.o m6809.o nec.o pic16c5x.o s2650.o sh2.o tms32010.o tlcs90.o \ - upd7725.o upd7810.o v25.o v60.o z80.o z80daisy.o \ - \ - cave.o cave_palette.o cave_sprite.o cave_tile.o \ - \ - cps2_crpt.o cps.o cps_config.o cps_draw.o cps_mem.o cps_obj.o cps_pal.o cps_run.o cps_rw.o cps_scr.o cpsr.o cpsrd.o \ - cpst.o ctv.o fcrash_snd.o kabuki.o ps.o ps_m.o ps_z.o qs.o qs_c.o qs_z.o sf2mdt_snd.o \ - \ - cps3run.o cps3snd.o \ - \ - deco16ic.o deco146.o \ - \ - gal_gfx.o gal_run.o gal_sound.o gal_stars.o \ - \ - irem_cpu.o \ - \ - k007342_k007420.o k051316.o k051733.o k051960.o k052109.o k053245.o k053247.o k053250.o k053251.o k053936.o k054000.o \ - k054338.o k055555.o k056832.o konamigx.o konamiic.o timeplt_snd.o \ - \ - neo_decrypt.o neo_palette.o neo_run.o neo_sprite.o neo_text.o neo_upd4990a.o neogeo.o \ - \ - pgm_crypt.o pgm_draw.o pgm_run.o pgm_asic3.o pgm_asic27a_type1.o pgm_asic27a_type2.o pgm_asic27a_type3.o pgm_asic25.o \ - \ - psikyo_palette.o psikyo_sprite.o psikyo_tile.o psikyosh_render.o \ - \ - fd1089.o fd1094.o genesis_vid.o mc8123.o sega_315_5195.o sys16_fd1094.o sys16_gfx.o sys16_run.o \ - \ - cchip.o pc080sn.o pc090oj.o taito.o taito_ic.o taitof3_snd.o taitof3_video.o taito_m68705.o tc0100scn.o tc0110pcr.o tc0140syt.o tc0150rod.o \ - tc0180vcu.o tc0220ioc.o tc0280grd.o tc0360pri.o tc0480scp.o tc0510nio.o tc0640fio.o tnzs_prot.o \ - \ - toa_bcu2.o toa_extratext.o toa_gp9001.o toa_palette.o toaplan1.o toaplan.o \ - \ - megadrive.o \ - \ - pce.o \ - \ - sms.o smspio.o smssystem.o smsvdp.o smsfmintf.o smsrender.o smssound.o smstms.o \ - \ - snes_65816.o snes_io.o snes_main.o snes_ppu.o snes_spc700.o - - -ifdef DEBUG - depobj += m68kdasm.o -endif - -ifdef BUILD_X86_ASM - autobj += burn_sound_a.o -endif - - -ifdef INCLUDE_CPLUSPLUS11_FILES - alldir += cpu/mips3 cpu/tms34010 cpu/adsp2100 - depobj += ide.o cop0.o cop1.o mips3.o mips3_intf.o dcs2k.o midwayic.o midwunit.o tms34010.o tms34010_optable.o tms34010_intf.o \ - adsp2100.o adsp2100_intf.o -ifdef BUILD_X64_EXE - alldir += cpu/mips3/x64 - depobj += mips3_x64.o -endif -endif \ No newline at end of file diff --git a/jan/makefile.burner_win32_rules b/jan/makefile.burner_win32_rules deleted file mode 100644 index 5b74fcd30..000000000 --- a/jan/makefile.burner_win32_rules +++ /dev/null @@ -1,43 +0,0 @@ -alldir += burner burner/win32 dep/kaillera/client dep/libs/libpng dep/libs/lib7z dep/libs/zlib intf intf/video \ - intf/video/scalers intf/video/win32 intf/audio intf/audio/win32 intf/input intf/input/win32 intf/cd intf/cd/win32 \ - intf/perfcount intf/perfcount/win32 dep/generated - -depobj += about.o bzip.o choose_monitor.o cona.o debugger.o drv.o dynhuff.o fba_kaillera.o gameinfo.o image_win32.o inpc.o \ - inpcheat.o inpd.o inpdipsw.o inps.o ips_manager.o localise.o localise_download.o localise_gamelist.o main.o \ - media.o memcard.o menu.o misc_win32.o neocdlist.o neocdsel.o numdial.o paletteviewer.o popup_win32.o progress.o \ - replay.o res.o roms.o run.o scrn.o sel.o sfactd.o splash.o stated.o support_paths.o systeminfo.o wave.o \ - \ - conc.o cong.o dat.o gamc.o gami.o image.o ioapi.o misc.o sshot.o state.o statec.o unzip.o zipfn.o \ - \ - adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o \ - trees.o uncompr.o zutil.o \ - \ - png.o pngerror.o pngget.o pngmem.o pngpread.o pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o \ - pngwrite.o pngwtran.o pngwutil.o \ - \ - net.o \ - \ - aud_dsp.o aud_interface.o cd_interface.o inp_interface.o interface.o lowpass2.o prf_interface.o vid_interface.o \ - vid_softfx.o vid_support.o \ - \ - 2xpm.o 2xsai.o ddt3x.o epx.o hq2xs.o hq2xs_16.o xbr.o \ - \ - aud_dsound3.o aud_xaudio2.o cd_isowav.o cdsound.o ddraw_core.o dinput_core.o directx9_core.o dsound_core.o \ - inp_dinput.o prf_performance_counter.o vid_d3d.o vid_ddraw.o vid_ddrawfx.o vid_directx9.o vid_directx_support.o - -ifdef INCLUDE_7Z_SUPPORT -depobj += un7z.o \ - \ - 7zArcIn.o 7zBuf.o 7zBuf2.o 7zCrc.o 7zCrcOpt.o 7zDec.o 7zFile.o 7zStream.o Bcj2.o Bra.o Bra86.o BraIA64.o CpuArch.o \ - Delta.o LzmaDec.o Lzma2Dec.o Ppmd7.o Ppmd7Dec.o Sha256.o Xz.o XzCrc64.o XzCrc64Opt.o XzDec.o -endif - -ifdef INCLUDE_AVI_RECORDING -depobj += avi.o -endif - -autobj += $(depobj) - -ifdef BUILD_X86_ASM -autobj += eagle_fm.o 2xsaimmx.o hq2x32.o hq3x32.o hq4x32.o superscale.o -endif \ No newline at end of file diff --git a/jan/makefile.libretro b/jan/makefile.libretro deleted file mode 100644 index 6a3cb0f62..000000000 --- a/jan/makefile.libretro +++ /dev/null @@ -1,391 +0,0 @@ -DEBUG = 0 -LIBRETRO_OPTIMIZATIONS = 1 -FRONTEND_SUPPORTS_RGB565 = 1 -HAVE_GRIFFIN = 0 - -ifeq ($(platform),) -platform = unix -ifeq ($(shell uname -a),) - platform = win -else ifneq ($(findstring Darwin,$(shell uname -a)),) - platform = osx -else ifneq ($(findstring MINGW,$(shell uname -a)),) - platform = win -endif -endif - -# system platform -system_platform = unix -ifeq ($(shell uname -a),) - system_platform = win -EXE_EXT=.exe -else ifneq ($(findstring Darwin,$(shell uname -a)),) - system_platform = osx -else ifneq ($(findstring MINGW,$(shell uname -a)),) - system_platform = win -endif - - -MAIN_FBA_DIR := src -FBA_BURN_DIR := $(MAIN_FBA_DIR)/burn -FBA_BURN_DRIVERS_DIR := $(MAIN_FBA_DIR)/burn/drv -FBA_BURNER_DIR := $(MAIN_FBA_DIR)/burner -LIBRETRO_DIR := $(FBA_BURNER_DIR)/libretro -FBA_CPU_DIR := $(MAIN_FBA_DIR)/cpu -FBA_LIB_DIR := $(MAIN_FBA_DIR)/dep/libs -FBA_INTERFACE_DIR := $(MAIN_FBA_DIR)/intf -FBA_GENERATED_DIR = $(MAIN_FBA_DIR)/dep/generated -FBA_SCRIPTS_DIR = $(MAIN_FBA_DIR)/dep/scripts -GRIFFIN_DIR = griffin-libretro - -EXTERNAL_ZLIB = 0 - -ifeq ($(platform), unix) - TARGET := libretro.so - fpic := -fPIC - SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(LIBRETRO_DIR)/link.T - ENDIANNESS_DEFINES := -DLSB_FIRST -else ifeq ($(platform), osx) - TARGET := libretro.dylib - fpic := -fPIC - SHARED := -dynamiclib - ENDIANNESS_DEFINES := -DLSB_FIRST -else ifeq ($(platform), ps3) - TARGET := 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 - ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN - PLATFORM_DEFINES += -D__CELLOS_LV2__ - EXTERNAL_ZLIB = 1 -else ifeq ($(platform), sncps3) - TARGET := libretro_ps3.a - CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe - CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe - AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe - ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN - PLATFORM_DEFINES += -D__CELLOS_LV2__ -DSN_TARGET_PS3 - EXTERNAL_ZLIB = 1 -else ifeq ($(platform), psl1ght) - TARGET := libretro_psl1ght.a - CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) - CXX = $(PS3DEV)/ppu/bin/ppu-g++$(EXE_EXT) - AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT) - ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN - PLATFORM_DEFINES += -D__CELLOS_LV2__ - EXTERNAL_ZLIB = 1 -else ifeq ($(platform), xenon) - TARGET := libretro_xenon360.a - CC = xenon-gcc$(EXE_EXT) - CXX = xenon-g++$(EXE_EXT) - AR = xenon-ar$(EXE_EXT) - ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN - PLATFORM_DEFINES := -D__LIBXENON__ -m32 -D__ppc__ -else ifeq ($(platform), ngc) - TARGET := libretro_ngc.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) - ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN - PLATFORM_DEFINES := -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float - EXTERNAL_ZLIB = 1 -else ifeq ($(platform), wii) - TARGET := 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) - ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN - PLATFORM_DEFINES := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float - EXTERNAL_ZLIB = 1 -else - TARGET := retro.dll - CC = gcc - CXX = g++ - SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(LIBRETRO_DIR)/link.T - LDFLAGS += -static-libgcc -static-libstdc++ - ENDIANNESS_DEFINES := -DLSB_FIRST -endif - -CC_SYSTEM = gcc -CXX_SYSTEM = g++ - -.PHONY: clean generate-files generate-files-clean clean-objs - -all: $(TARGET) - -BURN_BLACKLIST := $(FBA_BURNER_DIR)/un7z.cpp \ - $(FBA_CPU_DIR)/arm7/arm7exec.c \ - $(FBA_CPU_DIR)/arm7/arm7core.c \ - $(FBA_CPU_DIR)/hd6309/6309tbl.c \ - $(FBA_CPU_DIR)/hd6309/6309ops.c \ - $(FBA_CPU_DIR)/konami/konamtbl.c \ - $(FBA_CPU_DIR)/konami/konamops.c \ - $(FBA_CPU_DIR)/m68k/m68k_in.c \ - $(FBA_CPU_DIR)/m6800/6800ops.c \ - $(FBA_CPU_DIR)/m6800/6800tbl.c \ - $(FBA_CPU_DIR)/m6805/6805ops.c \ - $(FBA_CPU_DIR)/m6809/6809ops.c \ - $(FBA_CPU_DIR)/m6809/6809tbl.c \ - $(FBA_CPU_DIR)/sh2/mksh2.cpp \ - $(FBA_CPU_DIR)/sh2/mksh2-x86.cpp \ - $(FBA_CPU_DIR)/m68k/m68kmake.c \ - $(FBA_BURNER_DIR)/wave_writer.cpp \ - $(FBA_CPU_DIR)/m68k/m68kdasm.c \ - $(FBA_LIBRETRO_DIR)/menu.cpp \ - $(FBA_CPU_DIR)/sh2/mksh2.cpp \ - $(FBA_BURNER_DIR)/sshot.cpp \ - $(FBA_BURNER_DIR)/conc.cpp \ - $(FBA_BURNER_DIR)/dat.cpp \ - $(FBA_BURNER_DIR)/cong.cpp \ - $(FBA_BURNER_DIR)/image.cpp \ - $(FBA_BURNER_DIR)/misc.cpp \ - $(FBA_CPU_DIR)/h6280/tblh6280.c \ - $(FBA_CPU_DIR)/m6502/t65sc02.c \ - $(FBA_CPU_DIR)/m6502/t65c02.c \ - $(FBA_CPU_DIR)/m6502/tdeco16.c \ - $(FBA_CPU_DIR)/m6502/tn2a03.c \ - $(FBA_CPU_DIR)/m6502/t6502.c \ - $(FBA_CPU_DIR)/nec/v25sfr.c \ - $(FBA_CPU_DIR)/nec/v25instr.c \ - $(FBA_CPU_DIR)/nec/necinstr.c \ - $(FBA_BURN_DIR)/drv/capcom/ctv_make.cpp - -#ifeq ($(LIBRETRO_OPTIMIZATIONS), 1) -#BURN_BLACKLIST += $(FBA_BURN_DIR)/drv/capcom/ctv.cpp -#endif - -ifeq ($(EXTERNAL_ZLIB), 1) -BURN_BLACKLIST += $(FBA_BURNER_DIR)/unzip.c \ - $(FBA_BURNER_DIR)/ioapi.c -endif - -ifeq ($(HAVE_GRIFFIN), 1) -GRIFFIN_CXXSRCFILES := $(GRIFFIN_DIR)/cps12.cpp $(GRIFFIN_DIR)/cps3.cpp $(GRIFFIN_DIR)/neogeo.cpp $(GRIFFIN_DIR)/pgm.cpp $(GRIFFIN_DIR)/snes.cpp $(GRIFFIN_DIR)/galaxian.cpp $(GRIFFIN_DIR)/cpu-m68k.cpp -BURN_BLACKLIST += $(FBA_CPU_DIR)/m68000_intf.cpp -else -CPS2_DIR := $(FBA_BURN_DRIVERS_DIR)/capcom -CPS3_DIR := $(FBA_BURN_DRIVERS_DIR)/cps3 -GALAXIAN_DIR := $(FBA_BURN_DRIVERS_DIR)/galaxian -NEOGEO_DIR := $(FBA_BURN_DRIVERS_DIR)/neogeo -PGM_DIR := $(FBA_BURN_DRIVERS_DIR)/pgm -SNES_DIR := $(FBA_BURN_DRIVERS_DIR)/snes -M68K_DIR := $(FBA_CPU_DIR)/m68k -endif - -FBA_BURN_DIRS := $(FBA_BURN_DIR) \ - $(FBA_BURN_DIR)/devices \ - $(FBA_BURN_DIR)/snd \ - $(CPS2_DIR) \ - $(FBA_BURN_DRIVERS_DIR)/cave \ - $(CPS3_DIR) \ - $(FBA_BURN_DRIVERS_DIR)/dataeast \ - $(GALAXIAN_DIR) \ - $(FBA_BURN_DRIVERS_DIR)/irem \ - $(FBA_BURN_DRIVERS_DIR)/konami \ - $(FBA_BURN_DRIVERS_DIR)/megadrive \ - $(NEOGEO_DIR) \ - $(FBA_BURN_DRIVERS_DIR)/pce \ - $(PGM_DIR) \ - $(FBA_BURN_DRIVERS_DIR)/pre90s \ - $(FBA_BURN_DRIVERS_DIR)/psikyo \ - $(FBA_BURN_DRIVERS_DIR)/pst90s \ - $(FBA_BURN_DRIVERS_DIR)/sega \ - $(SNES_DIR) \ - $(FBA_BURN_DRIVERS_DIR)/taito \ - $(FBA_BURN_DRIVERS_DIR)/toaplan - -FBA_CPU_DIRS := $(FBA_CPU_DIR) \ - $(FBA_CPU_DIR)/arm \ - $(FBA_CPU_DIR)/arm7 \ - $(FBA_CPU_DIR)/h6280 \ - $(FBA_CPU_DIR)/hd6309 \ - $(FBA_CPU_DIR)/i8039 \ - $(FBA_CPU_DIR)/konami \ - $(M68K_DIR) \ - $(FBA_CPU_DIR)/m6502 \ - $(FBA_CPU_DIR)/m6800 \ - $(FBA_CPU_DIR)/m6805 \ - $(FBA_CPU_DIR)/m6809 \ - $(FBA_CPU_DIR)/nec \ - $(FBA_CPU_DIR)/s2650 \ - $(FBA_CPU_DIR)/sh2 \ - $(FBA_CPU_DIR)/z80 - -FBA_LIB_DIRS := $(FBA_LIB_DIR)/zlib - -FBA_SRC_DIRS := $(FBA_BURNER_DIR) $(FBA_BURN_DIRS) $(FBA_CPU_DIRS) $(FBA_BURNER_DIRS) - - -ifeq ($(EXTERNAL_ZLIB), 1) -FBA_DEFINES += -DEXTERNAL_ZLIB -else -FBA_SRC_DIRS += $(FBA_LIB_DIRS) -endif - -FBA_CXXSRCS := $(GRIFFIN_CXXSRCFILES) $(filter-out $(BURN_BLACKLIST),$(foreach dir,$(FBA_SRC_DIRS),$(wildcard $(dir)/*.cpp))) -FBA_CXXSRCS += $(LIBRETRO_DIR)/libretro.cpp $(LIBRETRO_DIR)/neocdlist.cpp -FBA_CXXOBJ := $(FBA_CXXSRCS:.cpp=.o) -FBA_CSRCS := $(filter-out $(BURN_BLACKLIST),$(foreach dir,$(FBA_SRC_DIRS),$(wildcard $(dir)/*.c))) -FBA_COBJ := $(FBA_CSRCS:.c=.o) - -OBJS := $(FBA_COBJ) $(FBA_CXXOBJ) - -FBA_DEFINES := -DUSE_SPEEDHACKS -D__LIBRETRO__ \ - -D__LIBRETRO_OPTIMIZATIONS__ \ - $(ENDIANNESS_DEFINES) \ - $(PLATFORM_DEFINES) \ - -DINLINE="static inline" \ - -DSH2_INLINE="static inline" - -INCDIRS := -I$(FBA_BURNER_DIR)/win32 \ - -I$(LIBRETRO_DIR) \ - -I$(LIBRETRO_DIR)/tchar \ - -I$(FBA_BURN_DIR) \ - -I$(MAIN_FBA_DIR)/cpu \ - -I$(FBA_BURN_DIR)/snd \ - -I$(FBA_BURN_DIR)/devices \ - -I$(FBA_INTERFACE_DIR) \ - -I$(FBA_INTERFACE_DIR)/input \ - -I$(FBA_INTERFACE_DIR)/cd \ - -I$(FBA_BURNER_DIR) \ - -I$(FBA_CPU_DIR) \ - -I$(FBA_CPU_DIR)/i8039 \ - -I$(FBA_LIB_DIR)/zlib \ - -I$(FBA_BURN_DIR)/drv/capcom \ - -I$(FBA_BURN_DIR)/drv/dataeast \ - -I$(FBA_BURN_DIR)/drv/cave \ - -I$(FBA_BURN_DIR)/drv/neogeo \ - -I$(FBA_BURN_DIR)/drv/psikyo \ - -I$(FBA_BURN_DIR)/drv/sega \ - -I$(FBA_BURN_DIR)/drv/toaplan \ - -I$(FBA_BURN_DIR)/drv/taito \ - -I$(FBA_GENERATED_DIR) \ - -I$(FBA_LIB_DIR) - -ifeq ($(LIBRETRO_OPTIMIZATIONS), 1) -FBA_DEFINES += -D__LIBRETRO_OPTIMIZATIONS__ -endif - -ifeq ($(DEBUG), 1) -CFLAGS += -O0 -g -CXXFLAGS += -O0 -g -else -CFLAGS += -O3 -DNDEBUG -CXXFLAGS += -O3 -DNDEBUG -endif - -ifeq ($(platform), sncps3) -WARNINGS_DEFINES = -else -WARNINGS_DEFINES = -Wno-write-strings -C_STD_DEFINES = -std=gnu99 -endif - -CFLAGS += $(C_STD_DEFINES) $(fpic) $(WARNINGS_DEFINES) $(FBA_DEFINES) -CXXFLAGS += $(fpic) $(WARNINGS_DEFINES) $(FBA_DEFINES) -LDFLAGS += $(fpic) - -ifeq ($(FRONTEND_SUPPORTS_RGB565), 1) -CFLAGS += -DFRONTEND_SUPPORTS_RGB565 -CXXFLAGS += -DFRONTEND_SUPPORTS_RGB565 -endif - -ifeq ($(ZLIB_INTERNAL), 0) -INCDIRS += -I$(FBA_LIB_DIR) -endif - -ifeq ($(LIBRETRO_OPTIMIZATIONS), 1) -GENERATE_OPTS := -D__LIBRETRO_OPTIMIZATIONS__ -else -GENERATE_OPTS := -endif - -PERL = perl$(EXE_EXT) -M68KMAKE_EXE = m68kmake$(EXE_EXT) -CTVMAKE_EXE = ctvmake$(EXE_EXT) -PGM_SPRITE_CREATE_EXE = pgmspritecreate$(EXE_EXT) -EXE_PREFIX = ./ - -generate-files-clean: - rm -rf $(FBA_GENERATED_DIR)/ - rm -rf $(FBA_CPU_DIR)/m68k/m68kopac.c - rm -rf $(FBA_CPU_DIR)/m68k/m68kopdm.c - rm -rf $(FBA_CPU_DIR)/m68k/m68kopnz.c - rm -rf $(FBA_CPU_DIR)/m68k/m68kops.c - rm -rf $(FBA_CPU_DIR)/m68k/m68kops.h - -generate-files: - @mkdir -p $(FBA_GENERATED_DIR) 2>/dev/null || /bin/true - @echo "Generating $(FBA_GENERATED_DIR)/driverlist.h..." - @echo "" - $(PERL) $(FBA_SCRIPTS_DIR)/gamelist.pl -o $(FBA_GENERATED_DIR)/driverlist.h -l gamelist.txt $(FBA_BURN_DRIVERS_DIR)/capcom $(FBA_BURN_DRIVERS_DIR)/cave $(FBA_BURN_DRIVERS_DIR)/cps3 $(FBA_BURN_DRIVERS_DIR)/dataeast $(FBA_BURN_DRIVERS_DIR)/galaxian $(FBA_BURN_DRIVERS_DIR)/irem $(FBA_BURN_DRIVERS_DIR)/konami $(FBA_BURN_DRIVERS_DIR)/megadrive $(FBA_BURN_DRIVERS_DIR)/neogeo $(FBA_BURN_DRIVERS_DIR)/pce $(FBA_BURN_DRIVERS_DIR)/pgm $(FBA_BURN_DRIVERS_DIR)/pre90s $(FBA_BURN_DRIVERS_DIR)/psikyo $(FBA_BURN_DRIVERS_DIR)/pst90s $(FBA_BURN_DRIVERS_DIR)/sega $(FBA_BURN_DRIVERS_DIR)/snes $(FBA_BURN_DRIVERS_DIR)/taito $(FBA_BURN_DRIVERS_DIR)/toaplan - @echo "" - @echo "Generating $(FBA_GENERATED_DIR)/neo_sprite_func.h..." - @echo "" - @echo "Generating $(FBA_GENERATED_DIR)/neo_sprite_func_table.h..." - @echo "" - $(PERL) $(FBA_SCRIPTS_DIR)/neo_sprite_func.pl -o $(FBA_GENERATED_DIR)/neo_sprite_func.h $(LIBRETRO_OPTIMIZATIONS) - @echo "" - @echo "Generating $(FBA_GENERATED_DIR)/psikyo_tile_func.h..." - @echo "" - @echo "Generating $(FBA_GENERATED_DIR)/psikyo_tile_func_table.h..." - @echo "" - $(PERL) $(FBA_SCRIPTS_DIR)/psikyo_tile_func.pl -o $(FBA_GENERATED_DIR)/psikyo_tile_func.h - @echo "Generating $(FBA_GENERATED_DIR)/cave_sprite_func.h..." - @echo "" - @echo "Generating[ $(FBA_GENERATED_DIR)/cave_tile_func_table.h" - @echo "" - $(PERL) $(FBA_SCRIPTS_DIR)/cave_sprite_func.pl -o $(FBA_GENERATED_DIR)/cave_sprite_func.h - $(PERL) $(FBA_SCRIPTS_DIR)/cave_tile_func.pl -o $(FBA_GENERATED_DIR)/cave_tile_func.h - @echo "" - @echo "Generate $(FBA_GENERATED_DIR)/toa_gp9001_func_table.h" - @echo "" - $(PERL) $(FBA_SCRIPTS_DIR)/toa_gp9001_func.pl -o $(FBA_GENERATED_DIR)/toa_gp9001_func.h - $(CXX_SYSTEM) $(GENERATE_OPTS) -o $(PGM_SPRITE_CREATE_EXE) $(FBA_BURN_DRIVERS_DIR)/pgm/pgm_sprite_create.cpp - @echo "" - @echo "Generating $(FBA_GENERATED_DIR)/pgm_sprite.h..." - @echo "" - $(EXE_PREFIX)$(PGM_SPRITE_CREATE_EXE) > $(FBA_GENERATED_DIR)/pgm_sprite.h - $(CC_SYSTEM) $(GENERATE_OPTS) -o $(M68KMAKE_EXE) $(FBA_CPU_DIR)/m68k/m68kmake.c - $(EXE_PREFIX)$(M68KMAKE_EXE) $(FBA_CPU_DIR)/m68k/ $(FBA_CPU_DIR)/m68k/m68k_in.c - $(CXX_SYSTEM) $(GENERATE_OPTS) -o $(CTVMAKE_EXE) $(FBA_BURN_DRIVERS_DIR)/capcom/ctv_make.cpp - @echo "" - @echo "Generating $(FBA_GENERATED_DIR)/ctv.h..." - @echo "" - $(EXE_PREFIX)$(CTVMAKE_EXE) > $(FBA_GENERATED_DIR)/ctv.h - -$(TARGET): $(OBJS) - @echo "LD $@" -ifeq ($(platform), ps3) - @$(AR) rcs $@ $(OBJS) -else ifeq ($(platform), sncps3) - $(AR) rcs $@ $(OBJS) -else ifeq ($(platform), psl1ght) - $(AR) rcs $@ $(OBJS) -else ifeq ($(platform), xenon) - @$(AR) rcs $@ $(OBJS) -else ifeq ($(platform), ngc) - @$(AR) rcs $@ $(OBJS) -else ifeq ($(platform), wii) - @$(AR) rcs $@ $(OBJS) -else - @$(CXX) -o $@ $(SHARED) $(OBJS) $(LDFLAGS) -endif - -%.o: %.cpp - @echo "CXX $<" - @$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS) - -%.o: %.c - @echo "CC $<" - @$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) - -clean-objs: - rm -f $(OBJS) - -clean: - rm -f $(TARGET) - rm -f $(OBJS) - rm -f $(M68KMAKE_EXE) - rm -f $(PGM_SPRITE_CREATE_EXE) - rm -f $(CTVMAKE_EXE) diff --git a/jan/makefile.mamemingw b/jan/makefile.mamemingw deleted file mode 100644 index 9cddfdab7..000000000 --- a/jan/makefile.mamemingw +++ /dev/null @@ -1,666 +0,0 @@ -# Makefile for FBA, for use with GNU make & GCC (MinGW) -# -# The first pass makes sure all intermediary targets are present. The second pass updates -# any targets, if necessary. (Intermediary) targets which have their own unique rules -# are generated as required. - -unexport - -# -# Flags. Uncomment any of these declarations to enable their function. -# - -# Check for changes in header files -DEPEND = 1 - - - -# -# Declare variables -# - -# Specify the name of the executable file, without ".exe" -NAME = fba -COMPILENAME = 3 - -ifdef BUILD_X64_EXE -ifdef BUILD_A68K -undefine BUILD_A68K -endif -ifdef BUILD_X86_ASM -undefine BUILD_X86_ASM -endif -endif - -ifndef DEBUG -undefine BUILD_A68K -endif - -ifndef CPUTYPE - CPUTYPE = i686 -endif - -ifdef BUILD_X86_ASM - MMX = 1 -else - MMX = 0 -endif - -ifndef BUILD_X86_ASM - NAME := $(NAME)x - COMPILENAME := $(COMPILENAME)x -endif -ifdef BUILD_X64_EXE - NAME = fba64 - COMPILENAME = 6 -endif -ifdef DEBUG - NAME := $(NAME)d - COMPILENAME := $(COMPILENAME)d -endif -ifdef SYMBOL - NAME := $(NAME)s - COMPILENAME := $(COMPILENAME)s -endif -ifndef UNICODE - NAME := $(NAME)a - COMPILENAME := $(COMPILENAME)a -endif - -ifeq ($(CPUTYPE),i686) - ppro = ppro -else - NAME := $(NAME)$(CPUTYPE) -endif - - - -# -# Specify paths/files -# - - -objdir = obj/$(COMPILENAME)/ - - -srcdir = src/ - -include makefile.burn_rules -include makefile.burner_win32_rules - -incdir = $(foreach dir,$(alldir),-I$(srcdir)$(dir)) -I$(objdir)dep/generated -I$(srcdir)dep/mingw/include -I$(srcdir)dep/mingw/include/directx9 -I$(srcdir)dep/mingw/include/xaudio2 - - -ifdef UNICODE -# lib = -lunicows -endif - -lib += -luser32 -lgdi32 -lcomdlg32 -lcomctl32 -lshell32 -lwinmm -lshlwapi -ladvapi32 -lsetupapi -lole32 -luuid -lwininet - - -depobj += resource.o \ - -autdep = $(depobj:.o=.d) - -ifdef BUILD_A68K -a68k.o = $(objdir)cpu/a68k/a68k.o -endif - -app_gnuc.rc = $(srcdir)dep/generated/app_gnuc.rc -license.rtf = $(srcdir)dep/generated/license.rtf -driverlist.h = $(srcdir)dep/generated/driverlist.h -ctv.h = $(srcdir)dep/generated/ctv.h -toa_gp9001_func.h = $(srcdir)dep/generated/toa_gp9001_func.h -neo_sprite_func.h = $(srcdir)dep/generated/neo_sprite_func.h -cave_tile_func.h = $(srcdir)dep/generated/cave_tile_func.h -cave_sprite_func.h = $(srcdir)dep/generated/cave_sprite_func.h -psikyo_tile_func.h = $(srcdir)dep/generated/psikyo_tile_func.h -pgm_sprite.h = $(srcdir)dep/generated/pgm_sprite.h -build_details.h = $(srcdir)dep/generated/build_details.h - -allobj = $(objdir)cpu/m68k/m68kcpu.o $(objdir)cpu/m68k/m68kops.o \ - $(foreach file,$(autobj:.o=.c), \ - $(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \ - $(firstword $(subst .c,.o,$(wildcard $(srcdir)$(dir)/$(file))))))) \ - $(foreach file,$(autobj:.o=.cpp), \ - $(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \ - $(firstword $(subst .cpp,.o,$(wildcard $(srcdir)$(dir)/$(file))))))) \ - $(foreach file,$(autobj:.o=.asm), \ - $(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \ - $(firstword $(subst .asm,.o,$(wildcard $(srcdir)$(dir)/$(file))))))) \ - $(foreach file,$(autobj:.o=.rc), \ - $(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \ - $(firstword $(subst .rc,.o,$(wildcard $(srcdir)$(dir)/$(file))))))) - -ifdef BUILD_A68K -allobj += $(a68k.o) -endif - -alldep = $(foreach file,$(autobj:.o=.c), \ - $(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \ - $(firstword $(subst .c,.d,$(wildcard $(srcdir)$(dir)/$(file))))))) \ - $(foreach file,$(autobj:.o=.cpp), \ - $(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \ - $(firstword $(subst .cpp,.d,$(wildcard $(srcdir)$(dir)/$(file))))))) \ - $(foreach file,$(autobj:.o=.rc), \ - $(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \ - $(firstword $(subst .rc,.d,$(wildcard $(srcdir)$(dir)/$(file))))))) - -# -# -# Specify compiler/linker/assembler -# -# - -CC = gcc -CXX = g++ -LD = $(CXX) -AS = nasm - -LDFLAGS = -static - -CFLAGS = -pipe \ - -std=gnu99 -O1 \ - -mwindows \ - -fforce-addr -finline-limit=1200 -fthread-jumps \ - -fexpensive-optimizations \ - -Wall -Wno-long-long -Wno-sign-compare -Wno-uninitialized -Wno-unused \ - -Wno-sequence-point \ - $(DEF) $(incdir) - -CXXFLAGS = -pipe \ - -std=gnu++11 -O1 \ - -mwindows \ - -fforce-addr -finline-limit=1200 -fthread-jumps \ - -fexpensive-optimizations -fcheck-new \ - -Wall -W -pedantic -Wshadow -Wno-long-long -Wno-write-strings \ - -Wunknown-pragmas -Wundef -Wno-conversion -Wno-missing-braces -Wno-multichar \ - -Wuninitialized -Wpointer-arith -Wno-inline -Wno-address -Wno-unused-value \ - -Wno-unused-but-set-variable -Wno-sequence-point -Wno-narrowing -Wno-extra \ - $(DEF) $(incdir) - -ifdef BUILD_X64_EXE - CFLAGS += -m64 - CXXFLAGS += -m64 - LDFLAGS += -m64 -else - CFLAGS += -m32 - CXXFLAGS += -m32 - LDFLAGS += -m32 -endif - -ASFLAGS = -O1 -f coff -w-orphan-labels - -# D3DUtils & D3DMath need these -# DEF = -Dsinf=\(float\)sin -Dcosf=\(float\)cos -Dasinf=\(float\)asin -Dacosf=\(float\)acos -Dsqrtf=\(float\)sqrt - - DEF := -DBUILD_WIN32 -DUSE_SPEEDHACKS -DFILENAME=$(NAME) -DMMX=$(MMX) - -ifdef UNICODE - DEF := $(DEF) -D_UNICODE -endif - -ifdef SPECIALBUILD - DEF := $(DEF) -DSPECIALBUILD=$(SPECIALBUILD) -endif - -ifdef FASTCALL - DEF := $(DEF) -DFASTCALL -endif - -ifdef DEBUG - DEF := $(DEF) -DFBA_DEBUG -endif - -ifdef ROM_VERIFY - DEF := $(DEF) -DROM_VERIFY -endif - -ifdef INCLUDE_7Z_SUPPORT - DEF := $(DEF) -DINCLUDE_7Z_SUPPORT -endif - -ifdef TOAPLAN_SOUND_SAMPLES_HACK - DEF := $(DEF) -DTOAPLAN_SOUND_SAMPLES_HACK -endif - -ifdef LSB_FIRST - DEF := $(DEF) -DLSB_FIRST -endif - -ifdef INCLUDE_LIB_PNGH - DEF := $(DEF) -DINCLUDE_LIB_PNGH -endif - -ifdef BUILD_A68K - DEF := $(DEF) -DBUILD_A68K -endif - -ifdef BUILD_X86_ASM - DEF := $(DEF) -DBUILD_X86_ASM -endif - -ifdef BUILD_X64_EXE - DEF := $(DEF) -DBUILD_X64_EXE -ifdef INCLUDE_CPLUSPLUS11_FILES - DEF := $(DEF) -DXBYAK_NO_OP_NAMES -DMIPS3_X64_DRC -endif -endif - -ifdef USE_SEGOE - DEF := $(DEF) -DUSE_SEGOE -endif - -ifdef SYMBOL - - CFLAGS += -ggdb3 - ASFLAGS += -g - DEF := $(DEF) -D_DEBUG - -ifdef PROFILE - CFLAGS += -pg - CXXFLAGS += -pg -else - CFLAGS += -fomit-frame-pointer - CXXFLAGS += -fomit-frame-pointer -endif - -else - LDFLAGS += -s -endif - -ifdef BUILD_X86_ASM - CFLAGS += -mmmx - CXXFLAGS += -mmmx -endif - -# For zlib -DEF := $(DEF) -DNO_VIZ -D_LARGEFILE64_SOURCE=0 -D_FILE_OFFSET_BITS=32 - -# For lib7z -ifdef INCLUDE_7Z_SUPPORT -DEF := $(DEF) -D_7ZIP_PPMD_SUPPPORT -endif - -# -# -# Specify paths -# -# - -vpath %.asm $(foreach dir,$(alldir),$(srcdir)$(dir)/ ) -vpath %.cpp $(foreach dir,$(alldir),$(srcdir)$(dir)/ ) -vpath %.c $(foreach dir,$(alldir),$(srcdir)$(dir)/ ) -vpath %.h $(foreach dir,$(alldir),$(srcdir)$(dir)/ ) -vpath %.rc $(foreach dir,$(alldir),$(srcdir)$(dir)/ ) - -vpath %.o $(foreach dir,$(alldir),$(objdir)$(dir)/ ) -vpath %.d $(foreach dir,$(alldir),$(objdir)$(dir)/ ) - -# -# -# Rules -# -# - -.PHONY: all init cleandep touch clean - -ifeq ($(MAKELEVEL),1) -ifdef DEPEND - -all: init $(autdep) $(autobj) - @$(MAKE) -f makefile.mamemingw -s GCC471=1 - -else - -all: init $(autobj) - - @$(MAKE) -f makefile.mamemingw -s GCC471=1 - - -endif -else - -all: $(NAME).exe - -endif - -# -# -# Rule for linking the executable -# -# - -ifeq ($(MAKELEVEL),2) - -$(NAME).exe: $(allobj) - @echo - @echo Linking executable... $(NAME).exe - @$(LD) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(lib) - -ifdef DEBUG - -# Don't compress when making a debug build - -else -ifdef COMPRESS - @upx --best $@ -endif -endif -endif - -ifeq ($(MAKELEVEL),1) -ifdef FORCE_UPDATE -$(build_details.h): FORCE -endif -endif - -# -# Generate the gamelist -# - -burn.o burn.d: driverlist.h - -$(driverlist.h): $(drvobj) $(srcdir)dep/scripts/gamelist.pl -ifdef PERL - @$(srcdir)dep/scripts/gamelist.pl -o $@ -l gamelist.txt \ - $(filter %.cpp,$(foreach file,$(drvobj:.o=.cpp),$(foreach dir,$(alldir), \ - $(firstword $(wildcard $(srcdir)$(dir)/$(file)))))) -else -ifeq ($(MAKELEVEL),2) - @echo - @echo Warning: Perl is not available on this system. - @echo $@ cannot be updated or created! - @echo -endif -endif - -# -# Verify if driverlist.h needs to be updated -# - -#ifeq ($(MAKELEVEL),1) -#ifdef FORCE_UPDATE -#$(driverlist.h): FORCE -#endif -#endif - - -# -# Fix the .rc file -# - -resource.o resource.d: $(app_gnuc.rc) string.rc version.rc version.h $(build_details.h) - -$(license.rtf): $(srcdir)license.txt $(srcdir)dep/scripts/license2rtf.pl - -ifdef PERL -ifdef USE_SEGOE - @$(srcdir)dep/scripts/license2rtf.pl $< -o $(srcdir)dep/generated/$(@F:.rc=.rtf) -f 'Segoe UI' -else - @$(srcdir)dep/scripts/license2rtf.pl $< -o $(srcdir)dep/generated/$(@F:.rc=.rtf) -endif -else -ifeq ($(MAKELEVEL),2) - @echo - @echo Warning: Perl is not available on this system. - @echo $@ cannot be updated or created! - @echo -endif -endif - -$(app_gnuc.rc): app.rc $(license.rc) $(license.rtf) $(srcdir)dep/scripts/fixrc.pl $(srcdir)burner/resource/fba.ico $(srcdir)burner/resource/about.bmp $(srcdir)burner/resource/splash.bmp $(srcdir)burner/resource/misc.bmp - -ifdef PERL - @$(srcdir)dep/scripts/fixrc.pl $< -o $@ -else -ifeq ($(MAKELEVEL),2) - @echo - @echo Warning: Perl is not available on this system. - @echo $@ cannot be updated or created! - @echo -endif -endif - -# -# Generate some info on the build details -# - -about.o about.d: $(build_details.h) - -$(build_details.h): $(srcdir)dep/scripts/build_details.cpp - $(CXX) -mconsole $(CXXFLAGS) $(LDFLAGS) $< -o $(objdir)/dep/generated/build_details.exe - obj\\$(COMPILENAME)\\dep\\generated\\build_details.exe >$@ - -# -# Compile 68000 cores -# - -# A68K - -ifdef BUILD_A68K -$(a68k.o): fba_make68k.c - @echo Compiling A68K MC68000 core... - @$(CC) -mconsole $(CFLAGS) $(LDFLAGS) -DWIN32 -Wno-unused -Wno-conversion -Wno-missing-prototypes \ - -s $< -o $(subst $(srcdir),$(objdir),$($@ - -# -# Extra rules for generated header file toa_gp9001_func.h, needed by toa_gp9001.cpp -# - -toa_bcu2.d toa_bcu2.o toa_gp9001.d toa_gp9001.o: $(toa_gp9001_func.h) - -$(toa_gp9001_func.h): $(srcdir)dep/scripts/toa_gp9001_func.pl - @$(srcdir)dep/scripts/toa_gp9001_func.pl -o $(toa_gp9001_func.h) - -# -# Extra rules for generated header file neo_sprite_func.h, needed by neo_sprite.cpp -# - -neo_sprite.d neo_sprite.o: $(neo_sprite_func.h) - -$(neo_sprite_func.h): $(srcdir)dep/scripts/neo_sprite_func.pl - @$(srcdir)dep/scripts/neo_sprite_func.pl -o $(neo_sprite_func.h) - -# -# Extra rules for generated header file cave_tile_func.h, needed by cave_tile.cpp -# - -cave_tile.d cave_tile.o: $(cave_tile_func.h) - -$(cave_tile_func.h): $(srcdir)dep/scripts/cave_tile_func.pl - @$(srcdir)dep/scripts/cave_tile_func.pl -o $(cave_tile_func.h) - -# -# Extra rules for generated header file cave_sprite_func.h, needed by cave_sprite.cpp -# - -cave_sprite.d cave_sprite.o: $(cave_sprite_func.h) - -$(cave_sprite_func.h): $(srcdir)dep/scripts/cave_sprite_func.pl - @$(srcdir)dep/scripts/cave_sprite_func.pl -o $(cave_sprite_func.h) - -# -# Extra rules for generated header file psikyo_tile_func.h / psikyo_sprite_func.h, needed by psikyo_tile.cpp / psikyo_sprite.cpp -# - -psikyo_tile.d psikyo_tile.o psikyosprite.d psikyo_sprite.o: $(psikyo_tile_func.h) - -$(psikyo_tile_func.h): $(srcdir)dep/scripts/psikyo_tile_func.pl - $(srcdir)dep/scripts/psikyo_tile_func.pl -o $(psikyo_tile_func.h) - -# -# Extra rules for generated header file pgm_sprite.h, needed by pgm_draw.cpp -# - -pgm_draw.d pgm_draw.o: $(pgm_sprite.h) - -$(pgm_sprite.h): pgm_sprite_create.cpp - echo Generating $(srcdir)dep/generated/$(@F)... - $(CC) -mconsole $(CXXFLAGS) $(LDFLAGS) $< -o $(subst $(srcdir),$(objdir),$($@ - - - -ifeq ($(MAKELEVEL),2) -ifdef DEPEND - -include $(alldep) - -endif -endif - -# -# Generic rule for resource files -# - -%.o: %.rc - @echo Compiling resource file $($(subst $(srcdir),$(objdir),$($(subst $(srcdir),$(objdir),$($(subst $(srcdir),$(objdir),$($@ - -# -# Compile 68000 cores -# - -# A68K - -ifdef BUILD_A68K -$(a68k.o): fba_make68k.c - @echo Compiling A68K MC68000 core... - @$(CC) -mconsole $(CFLAGS) $(LDFLAGS) -DWIN32 -Wno-unused -Wno-conversion -Wno-missing-prototypes \ - -s $< -o $(subst $(srcdir),$(objdir),$($@ - -# -# Extra rules for generated header file toa_gp9001_func.h, needed by toa_gp9001.cpp -# - -toa_bcu2.d toa_bcu2.o toa_gp9001.d toa_gp9001.o: $(toa_gp9001_func.h) - -$(toa_gp9001_func.h): $(srcdir)dep/scripts/toa_gp9001_func.pl - @$(srcdir)dep/scripts/toa_gp9001_func.pl -o $(toa_gp9001_func.h) - -# -# Extra rules for generated header file neo_sprite_func.h, needed by neo_sprite.cpp -# - -neo_sprite.d neo_sprite.o: $(neo_sprite_func.h) - -$(neo_sprite_func.h): $(srcdir)dep/scripts/neo_sprite_func.pl - @$(srcdir)dep/scripts/neo_sprite_func.pl -o $(neo_sprite_func.h) - -# -# Extra rules for generated header file cave_tile_func.h, needed by cave_tile.cpp -# - -cave_tile.d cave_tile.o: $(cave_tile_func.h) - -$(cave_tile_func.h): $(srcdir)dep/scripts/cave_tile_func.pl - @$(srcdir)dep/scripts/cave_tile_func.pl -o $(cave_tile_func.h) - -# -# Extra rules for generated header file cave_sprite_func.h, needed by cave_sprite.cpp -# - -cave_sprite.d cave_sprite.o: $(cave_sprite_func.h) - -$(cave_sprite_func.h): $(srcdir)dep/scripts/cave_sprite_func.pl - @$(srcdir)dep/scripts/cave_sprite_func.pl -o $(cave_sprite_func.h) - -# -# Extra rules for generated header file psikyo_tile_func.h / psikyo_sprite_func.h, needed by psikyo_tile.cpp / psikyo_sprite.cpp -# - -psikyo_tile.d psikyo_tile.o psikyosprite.d psikyo_sprite.o: $(psikyo_tile_func.h) - -$(psikyo_tile_func.h): $(srcdir)dep/scripts/psikyo_tile_func.pl - $(srcdir)dep/scripts/psikyo_tile_func.pl -o $(psikyo_tile_func.h) - -# -# Extra rules for generated header file pgm_sprite.h, needed by pgm_draw.cpp -# - -pgm_draw.d pgm_draw.o: $(pgm_sprite.h) - -$(pgm_sprite.h): pgm_sprite_create.cpp - @echo Generating $(srcdir)dep/generated/$(@F)... - @$(CC) -mconsole $(CXXFLAGS) $(LDFLAGS) $< \ - -o $(subst $(srcdir),$(objdir),$($@ - - -ifeq ($(MAKELEVEL),2) -ifdef DEPEND - -include $(alldep) - -endif -endif - -# -# Generic rule for resource files -# - -%.o: %.rc - @echo Compiling resource file $($(subst $(srcdir),$(objdir),$($(subst $(srcdir),$(objdir),$($(subst $(srcdir),$(objdir),$($@ - -# -# Extra rules for generated header file toa_gp9001_func.h, needed by toa_gp9001.cpp -# - -toa_bcu2.d toa_bcu2.o toa_gp9001.d toa_gp9001.o: $(toa_gp9001_func.h) - -$(toa_gp9001_func.h): $(srcdir)dep/scripts/toa_gp9001_func.pl - @$(srcdir)dep/scripts/toa_gp9001_func.pl -o $(toa_gp9001_func.h) - -# -# Extra rules for generated header file neo_sprite_func.h, needed by neo_sprite.cpp -# - -neo_sprite.d neo_sprite.o: $(neo_sprite_func.h) - -$(neo_sprite_func.h): $(srcdir)dep/scripts/neo_sprite_func.pl - @$(srcdir)dep/scripts/neo_sprite_func.pl -o $(neo_sprite_func.h) - -# -# Extra rules for generated header file cave_tile_func.h, needed by cave_tile.cpp -# - -cave_tile.d cave_tile.o: $(cave_tile_func.h) - -$(cave_tile_func.h): $(srcdir)dep/scripts/cave_tile_func.pl - @perl $(srcdir)dep/scripts/cave_tile_func.pl -o $(cave_tile_func.h) - -# -# Extra rules for generated header file cave_sprite_func.h, needed by cave_sprite.cpp -# - -cave_sprite.d cave_sprite.o: $(cave_sprite_func.h) - -$(cave_sprite_func.h): $(srcdir)dep/scripts/cave_sprite_func.pl - @perl $(srcdir)dep/scripts/cave_sprite_func.pl -o $(cave_sprite_func.h) - -# -# Extra rules for generated header file psikyo_tile_func.h / psikyo_sprite_func.h, needed by psikyo_tile.cpp / psikyo_sprite.cpp -# - -psikyo_tile.d psikyo_tile.o psikyosprite.d psikyo_sprite.o: $(psikyo_tile_func.h) - -$(psikyo_tile_func.h): $(srcdir)dep/scripts/psikyo_tile_func.pl - @perl $(srcdir)dep/scripts/psikyo_tile_func.pl -o $(psikyo_tile_func.h) - -# -# Extra rules for generated header file pgm_sprite.h, needed by pgm_draw.cpp -# - -pgm_draw.d pgm_draw.o: $(pgm_sprite.h) - -$(pgm_sprite.h): pgm_sprite_create.cpp - @echo Generating $(srcdir)dep/generated/$(@F)... - @$(HOSTCXX) $(LDFLAGS) $< -o $(objdir)dep/generated/pgm_sprite_create - @$(objdir)dep/generated/pgm_sprite_create >$@ - -ifeq ($(MAKELEVEL),2) -ifdef DEPEND - -include $(alldep) - -endif -endif - -# -# Generic rule for resource files -# - -%.o: %.rc - @echo Compiling resource file $($(subst $(srcdir),$(objdir),$($(subst $(srcdir),$(objdir),$($(subst $(srcdir),$(objdir),$($@ - -# -# Compile 68000 cores -# - -# A68K - -ifdef BUILD_A68K -$(a68k.o): fba_make68k.c - echo "Compiling A68K MC68000 core... " - $(CC) $(CFLAGS) -DWIN32 $< /Fo$(subst $(srcdir),$(objdir),$($@ - -# -# Extra rules for generated header file toa_gp9001_func.h, needed by toa_gp9001.cpp -# - -toa_bcu2.o toa_gp9001.o: $(toa_gp9001_func.h) - -$(toa_gp9001_func.h): $(srcdir)dep/scripts/toa_gp9001_func.pl - $(srcdir)dep/scripts/toa_gp9001_func.pl -o $(toa_gp9001_func.h) - -# -# Extra rules for generated header file neo_sprite_func.h, needed by neo_sprite.cpp -# - -neo_sprite.o: $(neo_sprite_func.h) - -$(neo_sprite_func.h): $(srcdir)dep/scripts/neo_sprite_func.pl - $(srcdir)dep/scripts/neo_sprite_func.pl -o $(neo_sprite_func.h) - -# -# Extra rules for generated header file cave_tile_func.h, needed by cave_tile.cpp -# - -cave_tile.o: $(cave_tile_func.h) - -$(cave_tile_func.h): $(srcdir)dep/scripts/cave_tile_func.pl - $(srcdir)dep/scripts/cave_tile_func.pl -o $(cave_tile_func.h) - -# -# Extra rules for generated header file cave_sprite_func.h, needed by cave_sprite.cpp -# - -cave_sprite.o: $(cave_sprite_func.h) - -$(cave_sprite_func.h): $(srcdir)dep/scripts/cave_sprite_func.pl - $(srcdir)dep/scripts/cave_sprite_func.pl -o $(cave_sprite_func.h) - -# -# Extra rules for generated header file psikyo_tile_func.h / psikyo_sprite_func.h, needed by psikyo_tile.cpp / psikyo_sprite.cpp -# - -psikyo_tile.o psikyo_sprite.o: $(psikyo_tile_func.h) - -$(psikyo_tile_func.h): $(srcdir)dep/scripts/psikyo_tile_func.pl - $(srcdir)dep/scripts/psikyo_tile_func.pl -o $(psikyo_tile_func.h) - -# -# Extra rules for generated header file pgm_sprite.h, needed by pgm_draw.cpp -# - -pgm_draw.d pgm_draw.o: $(pgm_sprite.h) - -$(pgm_sprite.h): pgm_sprite_create.cpp - @echo Generating... $(srcdir)dep/generated/$(@F) - $(CC) $(CXXFLAGS) $< /Fo$(subst $(srcdir),$(objdir),$($@ - -# -# Generic rule for resource files -# - -%.res: %.rc - @echo Compiling resource file... $( $$CTV_HEADER.target; \ - rm ctv_make - -#------------------------------------------------------------------------------- -# perl scripts -#------------------------------------------------------------------------------- - -# cave_sprite_func.h -CAVE_SPRFUNC_HEADER.depends = GENERATED -CAVE_SPRFUNC_HEADER.target = $$GEN/cave_sprite_func.h -CAVE_SPRFUNC_HEADER.commands = \ - @echo "Generating cave_sprite_func.h"; \ - perl $$SCRIPTS/cave_sprite_func.pl -o $$CAVE_SPRFUNC_HEADER.target; - -# cave_tile_func.h -CAVE_TILEFUNC_HEADER.depends = GENERATED -CAVE_TILEFUNC_HEADER.target = $$GEN/cave_tile_func.h -CAVE_TILEFUNC_HEADER.commands = \ - @echo "Generating cave_tile_func.h"; \ - perl $$SCRIPTS/cave_tile_func.pl -o $$CAVE_TILEFUNC_HEADER.target; - -# neo_sprite_func.h -NEO_SPRFUNC_HEADER.depends = GENERATED -NEO_SPRFUNC_HEADER.target = $$GEN/neo_sprite_func.h -NEO_SPRFUNC_HEADER.commands = \ - @echo "Generating neo_sprite_func.h"; \ - perl $$SCRIPTS/neo_sprite_func.pl -o $$NEO_SPRFUNC_HEADER.target; - -# psikyo_tile_func.h -PSIKYO_TILEFUNC_HEADER.depends = GENERATED -PSIKYO_TILEFUNC_HEADER.target = $$GEN/psikyo_tile_func.h -PSIKYO_TILEFUNC_HEADER.commands = \ - @echo "Generating psikyo_tile_func.h"; \ - perl $$SCRIPTS/psikyo_tile_func.pl -o $$PSIKYO_TILEFUNC_HEADER.target; - -# toa_gp9001_func -TOA_GP9001_FUNC_HEADER.depends = GENERATED -TOA_GP9001_FUNC_HEADER.target = $$GEN/toa_gp9001_func.h -TOA_GP9001_FUNC_HEADER.commands = \ - @echo "Generating toa_gp9001_func.h"; \ - perl $$SCRIPTS/toa_gp9001_func.pl -o $$TOA_GP9001_FUNC_HEADER.target; - -#------------------------------------------------------------------------------- -# pgm_sprite.h -#------------------------------------------------------------------------------- -PGM_SPRITE_CREATE.depends = GENERATED -PGM_SPRITE_CREATE.target = $$GEN/pgm_sprite_create -PGM_SPRITE_CREATE.commands =\ - @echo "Compiling pgm_sprite_create.cpp"; \ - $$QMAKE_CXX $$SRC/burn/drv/pgm/pgm_sprite_create.cpp -o $$PGM_SPRITE_CREATE.target; - -PGM_SPRITE_HEADER.depends = PGM_SPRITE_CREATE -PGM_SPRITE_HEADER.target = $$GEN/pgm_sprite.h -PGM_SPRITE_HEADER.commands =\ - @echo "Generating pgm_sprite.h"; \ - $$PGM_SPRITE_CREATE.target > $$PGM_SPRITE_HEADER.target - - - -#------------------------------------------------------------------------------- -# Musashi68k -#------------------------------------------------------------------------------- -M68K_MAKE.target = $$GEN/m68kmake -M68K_MAKE.depends = $$SRC/cpu/m68k/m68kmake.c GENERATED -M68K_MAKE.commands = \ - @echo "Compiling Musashi MC680x0 core: m68kmake.c..."; \ - $$QMAKE_CC $$SRC/cpu/m68k/m68kmake.c -I$$SRC/burn -o $$M68K_MAKE.target; \ - $$M68K_MAKE.target $$GEN/ $$SRC/cpu/m68k/m68k_in.c; - -# objects - -M68K_OPS.target = $$GEN/m68kops.o -M68K_OPS.depends = M68K_MAKE -M68K_OPS.commands = \ - @echo "Compiling Musashi MC680x0 core: m68kops.c..."; \ - $$QMAKE_CC $$QMAKE_CFLAGS -I$$SRC/cpu/m68k -I$$SRC/burn $$GEN/m68kops.c -c -o $$M68K_OPS.target; - -M68K_OPS_HEADER.target = $$GEN/m68kops.h -M68K_OPS_HEADER.depends = M68K_MAKE -M68K_OPS_HEADER.commands = \ - $$M68K_MAKE.target $$GEN/ $$SRC/cpu/m68k/m68k_in.c; - -M68K_LIB.target = $$GEN/libm68kops.o -M68K_LIB.depends = M68K_MAKE M68K_OPS M68K_OPS_HEADER -M68K_LIB.commands = \ - @echo "Partially linking Musashi MC680x0 core: libm68kops.o..."; \ - $$FBA_LD -r $$M68K_OPS.target -o $$M68K_LIB.target - - -OBJECTS += $$M68K_LIB.target - -#------------------------------------------------------------------------------- -# Gamelist -#------------------------------------------------------------------------------- -DRIVERLIST.depends = GENERATED -DRIVERLIST.target = $$GEN/driverlist.h - -DRIVERLIST_PATHS = -$$DRV_SMS:DRIVERLIST_PATHS += $$SRC/burn/drv/sms -$$DRV_PCE:DRIVERLIST_PATHS += $$SRC/burn/drv/pce -$$DRV_PGM:DRIVERLIST_PATHS += $$SRC/burn/drv/pgm -$$DRV_CAVE:DRIVERLIST_PATHS += $$SRC/burn/drv/cave -$$DRV_CPS3:DRIVERLIST_PATHS += $$SRC/burn/drv/cps3 -$$DRV_IREM:DRIVERLIST_PATHS += $$SRC/burn/drv/irem -$$DRV_SEGA:DRIVERLIST_PATHS += $$SRC/burn/drv/sega -$$DRV_SNES:DRIVERLIST_PATHS += $$SRC/burn/drv/snes -$$DRV_TAITO:DRIVERLIST_PATHS += $$SRC/burn/drv/taito -$$DRV_CAPCOM:DRIVERLIST_PATHS += $$SRC/burn/drv/capcom -$$DRV_NEOGEO:DRIVERLIST_PATHS += $$SRC/burn/drv/neogeo -$$DRV_KONAMI:DRIVERLIST_PATHS += $$SRC/burn/drv/konami -$$DRV_PRE90S:DRIVERLIST_PATHS += $$SRC/burn/drv/pre90s -$$DRV_PST90S:DRIVERLIST_PATHS += $$SRC/burn/drv/pst90s -$$DRV_PSIKYO:DRIVERLIST_PATHS += $$SRC/burn/drv/psikyo -$$DRV_TOAPLAN:DRIVERLIST_PATHS += $$SRC/burn/drv/toaplan -$$DRV_DATAEAST:DRIVERLIST_PATHS += $$SRC/burn/drv/dataeast -$$DRV_GALAXIAN:DRIVERLIST_PATHS += $$SRC/burn/drv/galaxian -$$DRV_MEGADRIVE:DRIVERLIST_PATHS += $$SRC/burn/drv/megadrive -$$DRV_MIDWAY:DRIVERLIST_PATHS += $$SRC/burn/drv/midway - -DRIVERLIST.commands = \ - @echo "Generating driverlist.h"; \ - perl $$SCRIPTS/gamelist.pl -o $$DRIVERLIST.target $$DRIVERLIST_PATHS; - -#=============================================================================== -# OPENGL DEPS -#=============================================================================== - -LINUX_VIDEO_GLX = true -MACX_VIDEO_CGL = true - -linux { - - $${LINUX_VIDEO_GLX} { - LIBS += -lX11 -lXext -lGLEW -lGL - } -} - -macx { -} - - -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -QMAKE_EXTRA_TARGETS += \ - GENERATED \ - CTV_HEADER \ - CAVE_SPRFUNC_HEADER \ - CAVE_TILEFUNC_HEADER \ - NEO_SPRFUNC_HEADER \ - PSIKYO_TILEFUNC_HEADER \ - PGM_SPRITE_CREATE \ - PGM_SPRITE_HEADER \ - TOA_GP9001_FUNC_HEADER \ - DRIVERLIST \ - M68K_MAKE \ - M68K_OPAC \ - M68K_OPDM \ - M68K_OPNZ \ - M68K_OPS \ - M68K_OPS_HEADER \ - M68K_LIB - -PRE_TARGETDEPS += \ - $$CTV_HEADER.target \ - $$CAVE_SPRFUNC_HEADER.target \ - $$CAVE_TILEFUNC_HEADER.target \ - $$NEO_SPRFUNC_HEADER.target \ - $$PSIKYO_TILEFUNC_HEADER.target \ - $$PGM_SPRITE_HEADER.target \ - $$TOA_GP9001_FUNC_HEADER.target \ - $$DRIVERLIST.target \ - $$M68K_LIB.target \ - -LIBS += -lSDL -linux:LIBS += -lpulse-simple - -QMAKE_CLEAN += $$GEN/* -#=============================================================================== -# CAPCOM DRIVERS -#=============================================================================== -$$DRV_CAPCOM { - message("Capcom drivers enabled") - - HEADERS += $$files(../../src/burn/drv/capcom/*.h) - SOURCES += $$files(../../src/burn/drv/capcom/*.cpp) - SOURCES -= ../../src/burn/drv/capcom/ctv_make.cpp -} - -#=============================================================================== -# CAVE DRIVERS -#=============================================================================== -$$DRV_CAVE { - message("Cave drivers enabled") - HEADERS += $$files(../../src/burn/drv/cave/*.h) - SOURCES += $$files(../../src/burn/drv/cave/*.cpp) -} - -#=============================================================================== -# CPS3 DRIVERS -#=============================================================================== -$$DRV_CPS3 { - message("CPS3 drivers enabled") - - HEADERS += $$files(../../src/burn/drv/cps3/*.h) - SOURCES += $$files(../../src/burn/drv/cps3/*.cpp) -} - -#=============================================================================== -# DATAEAST DRIVERS -#=============================================================================== -$$DRV_DATAEAST { - message("Dataeast drivers enabled") - - HEADERS += $$files(../../src/burn/drv/dataeast/*.h) - SOURCES += $$files(../../src/burn/drv/dataeast/*.cpp) -} - -#=============================================================================== -# GALAXIAN DRIVERS -#=============================================================================== -$$DRV_GALAXIAN { - message("Galaxian drivers enabled") - - HEADERS += $$files(../../src/burn/drv/galaxian/*.h) - SOURCES += $$files(../../src/burn/drv/galaxian/*.cpp) -} - -#=============================================================================== -# IREM DRIVERS -#=============================================================================== -$$DRV_IREM { - message("Irem drivers enabled") - - HEADERS += $$files(../../src/burn/drv/irem/*.h) - SOURCES += $$files(../../src/burn/drv/irem/*.cpp) -} - -#=============================================================================== -# KONAMI DRIVERS -#=============================================================================== -$$DRV_KONAMI { - message("Konami drivers enabled") - - HEADERS += $$files(../../src/burn/drv/konami/*.h) - SOURCES += $$files(../../src/burn/drv/konami/*.cpp) -} - -#=============================================================================== -# MEGADRIVE DRIVERS -#=============================================================================== -$$DRV_MEGADRIVE { - message("Megadrive drivers enabled") - - HEADERS += $$files(../../src/burn/drv/megadrive/*.h) - SOURCES += $$files(../../src/burn/drv/megadrive/*.cpp) -} - -#=============================================================================== -# NEOGEO DRIVERS -#=============================================================================== -$$DRV_NEOGEO { - message("Neogeo drivers enabled") - - HEADERS += $$files(../../src/burn/drv/neogeo/*.h) - SOURCES += $$files(../../src/burn/drv/neogeo/*.cpp) - SOURCES *= ../../src/burner/qt/neocdlist.cpp -} - -#=============================================================================== -# PC-ENGINE DRIVERS -#=============================================================================== -$$DRV_PCE { - message("PC-Engine drivers enabled") - - HEADERS += $$files(../../src/burn/drv/pce/*.h) - SOURCES += $$files(../../src/burn/drv/pce/*.cpp) -} - -#=============================================================================== -# PGM DRIVERS -#=============================================================================== -$$DRV_PGM { - message("PGM drivers enabled") - - HEADERS += $$files(../../src/burn/drv/pgm/*.h) - SOURCES += $$files(../../src/burn/drv/pgm/*.cpp) - SOURCES -= ../../src/burn/drv/pgm/pgm_sprite_create.cpp -} - -#=============================================================================== -# PRE90S DRIVERS -#=============================================================================== -$$DRV_PRE90S { - message("Pre90s drivers enabled") - - HEADERS += $$files(../../src/burn/drv/pre90s/*.h) - SOURCES += $$files(../../src/burn/drv/pre90s/*.cpp) - - HEADERS *= ../../src/burn/drv/sega/mc8123.h - SOURCES *= ../../src/burn/drv/sega/mc8123.cpp - # CAPCOM deps... - HEADERS *= $$files(../../src/burn/drv/capcom/*.h) - SOURCES *= $$files(../../src/burn/drv/capcom/*.cpp) - SOURCES -= ../../src/burn/drv/capcom/ctv_make.cpp - # KONAMI deps... - HEADERS *= $$files(../../src/burn/drv/konami/*.h) - SOURCES *= $$files(../../src/burn/drv/konami/k*.cpp) - -} - - -#=============================================================================== -# PSIKYO DRIVERS -#=============================================================================== -$$DRV_PSIKYO { - message("Psikyo drivers enabled") - - HEADERS += $$files(../../src/burn/drv/psikyo/*.h) - SOURCES += $$files(../../src/burn/drv/psikyo/*.cpp) -} - - -#=============================================================================== -# PST90S DRIVERS -#=============================================================================== -$$DRV_PST90S { - message("Pst90s drivers enabled") - HEADERS += $$files(../../src/burn/drv/pst90s/*.h) - SOURCES += $$files(../../src/burn/drv/pst90s/*.cpp) -} - -#=============================================================================== -# SEGA DRIVERS -#=============================================================================== -$$DRV_SEGA { - message("Sega drivers enabled") - - HEADERS *= $$files(../../src/burn/drv/sega/*.h) - SOURCES *= $$files(../../src/burn/drv/sega/*.cpp) -} - -#=============================================================================== -# MASTERSYSTEM DRIVERS -#=============================================================================== -$$DRV_SMS { - message("SMS drivers enabled") - - HEADERS += $$files(../../src/burn/drv/sms/*.h) - SOURCES += $$files(../../src/burn/drv/sms/*.cpp) -} - -#=============================================================================== -# SNES DRIVERS -#=============================================================================== -$$DRV_SNES { - message("SNES drivers enabled") - - HEADERS += $$files(../../src/burn/drv/snes/*.h) - SOURCES += $$files(../../src/burn/drv/snes/*.cpp) -} - - -#=============================================================================== -# TAITO DRIVERS -#=============================================================================== -$$DRV_TAITO { - message("Taito drivers enabled") - - HEADERS += $$files(../../src/burn/drv/taito/*.h) - SOURCES += $$files(../../src/burn/drv/taito/*.cpp) -} - - -#=============================================================================== -# TOAPLAN DRIVERS -#=============================================================================== -$$DRV_TOAPLAN { - message("Toaplan drivers enabled") - - HEADERS += $$files(../../src/burn/drv/toaplan/*.h) - SOURCES += $$files(../../src/burn/drv/toaplan/*.cpp) -} - -#=============================================================================== -# MIDWAY DRIVERS -#=============================================================================== -$$DRV_MIDWAY { - message("Midway drivers enabled") - HEADERS += $$files(../../src/burn/drv/midway/*.h) - SOURCES += $$files(../../src/burn/drv/midway/*.cpp) -} - -SOURCES += \ - ../../src/burn/devices/8255ppi.cpp \ - ../../src/burn/devices/8257dma.cpp \ - ../../src/burn/devices/eeprom.cpp \ - ../../src/burn/devices/pandora.cpp \ - ../../src/burn/devices/seibusnd.cpp \ - ../../src/burn/devices/sknsspr.cpp \ - ../../src/burn/devices/slapstic.cpp \ - ../../src/burn/devices/t5182.cpp \ - ../../src/burn/devices/timekpr.cpp \ - ../../src/burn/devices/tms34061.cpp \ - ../../src/burn/devices/v3021.cpp \ - ../../src/burn/devices/vdc.cpp \ - ../../src/burn/snd/burn_y8950.cpp \ - ../../src/burn/snd/burn_ym2151.cpp \ - ../../src/burn/snd/burn_ym2203.cpp \ - ../../src/burn/snd/burn_ym2413.cpp \ - ../../src/burn/snd/burn_ym2608.cpp \ - ../../src/burn/snd/burn_ym2610.cpp \ - ../../src/burn/snd/burn_ym2612.cpp \ - ../../src/burn/snd/burn_ym3526.cpp \ - ../../src/burn/snd/burn_ym3812.cpp \ - ../../src/burn/snd/burn_ymf278b.cpp \ - ../../src/burn/snd/c6280.cpp \ - ../../src/burn/snd/dac.cpp \ - ../../src/burn/snd/es5506.cpp \ - ../../src/burn/snd/es8712.cpp \ - ../../src/burn/snd/flt_rc.cpp \ - ../../src/burn/snd/ics2115.cpp \ - ../../src/burn/snd/iremga20.cpp \ - ../../src/burn/snd/k005289.cpp \ - ../../src/burn/snd/k007232.cpp \ - ../../src/burn/snd/k051649.cpp \ - ../../src/burn/snd/k053260.cpp \ - ../../src/burn/snd/k054539.cpp \ - ../../src/burn/snd/msm5205.cpp \ - ../../src/burn/snd/msm5232.cpp \ - ../../src/burn/snd/msm6295.cpp \ - ../../src/burn/snd/namco_snd.cpp \ - ../../src/burn/snd/nes_apu.cpp \ - ../../src/burn/snd/rf5c68.cpp \ - ../../src/burn/snd/saa1099.cpp \ - ../../src/burn/snd/samples.cpp \ - ../../src/burn/snd/segapcm.cpp \ - ../../src/burn/snd/sn76496.cpp \ - ../../src/burn/snd/upd7759.cpp \ - ../../src/burn/snd/vlm5030.cpp \ - ../../src/burn/snd/x1010.cpp \ - ../../src/burn/snd/ymz280b.cpp \ - ../../src/burn/snd/ay8910.c \ - ../../src/burn/snd/fm.c \ - ../../src/burn/snd/fmopl.c \ - ../../src/burn/snd/ym2151.c \ - ../../src/burn/snd/ym2413.c \ - ../../src/burn/snd/ymdeltat.c \ - ../../src/burn/snd/ymf278b.c \ - ../../src/burn/snd/pokey.cpp \ - ../../src/burn/burn_sound.cpp \ - ../../src/burn/burn.cpp \ - ../../src/burn/cheat.cpp \ - ../../src/burn/debug_track.cpp \ - ../../src/burn/hiscore.cpp \ - ../../src/burn/load.cpp \ - ../../src/burn/tiles_generic.cpp \ - ../../src/burn/timer.cpp \ - ../../src/burn/vector.cpp \ - ../../src/burn/burn_sound_c.cpp \ - ../../src/burn/burn_memory.cpp \ - ../../src/burn/burn_led.cpp \ - ../../src/burn/burn_gun.cpp \ - ../../src/cpu/hd6309_intf.cpp \ - ../../src/cpu/konami_intf.cpp \ - ../../src/cpu/m6502_intf.cpp \ - ../../src/cpu/m6800_intf.cpp \ - ../../src/cpu/m6805_intf.cpp \ - ../../src/cpu/m6809_intf.cpp \ - ../../src/cpu/m68000_intf.cpp \ - ../../src/cpu/nec_intf.cpp \ - ../../src/cpu/pic16c5x_intf.cpp \ - ../../src/cpu/s2650_intf.cpp \ - ../../src/cpu/h6280_intf.cpp \ - ../../src/cpu/arm7_intf.cpp \ - ../../src/cpu/arm_intf.cpp \ - ../../src/cpu/arm/arm.cpp \ - ../../src/cpu/arm7/arm7.cpp \ - ../../src/cpu/arm7/arm7core.c \ - ../../src/cpu/arm7/arm7exec.c \ - ../../src/cpu/h6280/h6280.cpp \ - ../../src/cpu/h6280/tblh6280.c \ - ../../src/cpu/hd6309/hd6309.cpp \ - ../../src/cpu/hd6309/6309ops.c \ - ../../src/cpu/hd6309/6309tbl.c \ - ../../src/cpu/i8039/i8039.cpp \ - ../../src/cpu/konami/konami.cpp \ - ../../src/cpu/konami/konamops.c \ - ../../src/cpu/konami/konamtbl.c \ - ../../src/cpu/m6502/m6502.cpp \ - ../../src/cpu/m6502/t65c02.c \ - ../../src/cpu/m6502/t65sc02.c \ - ../../src/cpu/m6502/t6502.c \ - ../../src/cpu/m6502/tdeco16.c \ - ../../src/cpu/m6502/tn2a03.c \ - ../../src/cpu/m6800/m6800.cpp \ - ../../src/cpu/m6800/6800ops.c \ - ../../src/cpu/m6800/6800tbl.c \ - ../../src/cpu/m6805/m6805.cpp \ - ../../src/cpu/m6805/6805ops.c \ - ../../src/cpu/m6809/m6809.cpp \ - ../../src/cpu/m6809/6809ops.c \ - ../../src/cpu/m6809/6809tbl.c \ - ../../src/cpu/nec/nec.cpp \ - ../../src/cpu/nec/v25.cpp \ - ../../src/cpu/nec/necinstr.c \ - ../../src/cpu/nec/v25instr.c \ - ../../src/cpu/nec/v25sfr.c \ - ../../src/cpu/pic16c5x/pic16c5x.cpp \ - ../../src/cpu/s2650/s2650.cpp \ - ../../src/cpu/sh2/sh2.cpp \ - ../../src/cpu/z80/z80.cpp \ - ../../src/cpu/z80/z80daisy.cpp \ - ../../src/cpu/m68k/m68kcpu.c \ - ../../src/burner/conc.cpp \ - ../../src/burner/cong.cpp \ - ../../src/burner/dat.cpp \ - ../../src/burner/gamc.cpp \ - ../../src/burner/gami.cpp \ - ../../src/burner/image.cpp \ - ../../src/burner/misc.cpp \ - ../../src/burner/sshot.cpp \ - ../../src/burner/state.cpp \ - ../../src/burner/statec.cpp \ - ../../src/burner/zipfn.cpp \ - ../../src/burner/ioapi.c \ - ../../src/burner/unzip.c \ - ../../src/dep/libs/libpng/png.c \ - ../../src/dep/libs/libpng/pngerror.c \ - ../../src/dep/libs/libpng/pngget.c \ - ../../src/dep/libs/libpng/pngmem.c \ - ../../src/dep/libs/libpng/pngpread.c \ - ../../src/dep/libs/libpng/pngread.c \ - ../../src/dep/libs/libpng/pngrio.c \ - ../../src/dep/libs/libpng/pngrtran.c \ - ../../src/dep/libs/libpng/pngrutil.c \ - ../../src/dep/libs/libpng/pngset.c \ - ../../src/dep/libs/libpng/pngtrans.c \ - ../../src/dep/libs/libpng/pngwio.c \ - ../../src/dep/libs/libpng/pngwrite.c \ - ../../src/dep/libs/libpng/pngwtran.c \ - ../../src/dep/libs/libpng/pngwutil.c \ - ../../src/intf/interface.cpp \ - ../../src/intf/audio/aud_dsp.cpp \ - ../../src/intf/audio/aud_interface.cpp \ - ../../src/intf/audio/lowpass2.cpp \ - ../../src/intf/cd/cd_interface.cpp \ - ../../src/intf/input/inp_interface.cpp \ - ../../src/intf/video/vid_interface.cpp \ - ../../src/intf/video/vid_support.cpp \ - ../../src/cpu/z80_intf.cpp \ - ../../src/burner/qt/main.cpp \ - ../../src/burner/qt/aboutdialog.cpp \ - ../../src/burner/qt/bzip.cpp \ - ../../src/burner/qt/dipswitchdialog.cpp \ - ../../src/burner/qt/driver.cpp \ - ../../src/burner/qt/emuworker.cpp \ - ../../src/burner/qt/mainwindow.cpp \ - ../../src/burner/qt/progress.cpp \ - ../../src/burner/qt/qaudiointerface.cpp \ - ../../src/burner/qt/qinputinterface.cpp \ - ../../src/burner/qt/qutil.cpp \ - ../../src/burner/qt/romdirsdialog.cpp \ - ../../src/burner/qt/rominfodialog.cpp \ - ../../src/burner/qt/romscandialog.cpp \ - ../../src/burner/qt/selectdialog.cpp \ - ../../src/burner/qt/stringset.cpp \ - ../../src/burner/qt/supportdirsdialog.cpp \ - ../../src/dep/libs/zlib/adler32.c \ - ../../src/dep/libs/zlib/compress.c \ - ../../src/dep/libs/zlib/crc32.c \ - ../../src/dep/libs/zlib/deflate.c \ - ../../src/dep/libs/zlib/gzclose.c \ - ../../src/dep/libs/zlib/gzlib.c \ - ../../src/dep/libs/zlib/gzread.c \ - ../../src/dep/libs/zlib/gzwrite.c \ - ../../src/dep/libs/zlib/infback.c \ - ../../src/dep/libs/zlib/inffast.c \ - ../../src/dep/libs/zlib/inflate.c \ - ../../src/dep/libs/zlib/inftrees.c \ - ../../src/dep/libs/zlib/trees.c \ - ../../src/dep/libs/zlib/uncompr.c \ - ../../src/dep/libs/zlib/zutil.c \ - ../../src/burn/devices/nmk004.cpp \ - ../../src/cpu/tlcs90/tlcs90.cpp \ - ../../src/cpu/tlcs90_intf.cpp \ - ../../src/burn/devices/kaneko_tmap.cpp \ - ../../src/burner/qt/inputdialog.cpp \ - ../../src/burner/qt/widgets/hexspinbox.cpp \ - ../../src/burner/qt/logdialog.cpp \ - ../../src/burner/qt/inputsetdialog.cpp \ - ../../src/burner/qt/oglviewport.cpp \ - ../../src/intf/video/opengl/vid_opengl.cpp \ - ../../src/intf/video/opengl/shader.cpp \ - ../../src/cpu/mips3/cop0.cpp \ - ../../src/cpu/mips3/cop1.cpp \ - ../../src/cpu/mips3/mips3_dasm.cpp \ - ../../src/cpu/mips3/mips3.cpp \ - ../../src/cpu/mips3_intf.cpp \ - ../../src/cpu/adsp2100_intf.cpp \ - ../../src/cpu/adsp2100/adsp2100.cpp \ - ../../src/cpu/adsp2100/2100dasm.cpp - - - -HEADERS += \ - ../../src/burn/devices/8255ppi.h \ - ../../src/burn/devices/8257dma.h \ - ../../src/burn/devices/eeprom.h \ - ../../src/burn/devices/pandora.h \ - ../../src/burn/devices/seibusnd.h \ - ../../src/burn/devices/sknsspr.h \ - ../../src/burn/devices/slapstic.h \ - ../../src/burn/devices/t5182.h \ - ../../src/burn/devices/timekpr.h \ - ../../src/burn/devices/tms34061.h \ - ../../src/burn/devices/v3021.h \ - ../../src/burn/devices/vdc.h \ - ../../src/burn/snd/ay8910.h \ - ../../src/burn/snd/burn_y8950.h \ - ../../src/burn/snd/burn_ym2151.h \ - ../../src/burn/snd/burn_ym2203.h \ - ../../src/burn/snd/burn_ym2413.h \ - ../../src/burn/snd/burn_ym2608.h \ - ../../src/burn/snd/burn_ym2610.h \ - ../../src/burn/snd/burn_ym2612.h \ - ../../src/burn/snd/burn_ym3526.h \ - ../../src/burn/snd/burn_ym3812.h \ - ../../src/burn/snd/burn_ymf278b.h \ - ../../src/burn/snd/c6280.h \ - ../../src/burn/snd/dac.h \ - ../../src/burn/snd/es5506.h \ - ../../src/burn/snd/es8712.h \ - ../../src/burn/snd/flt_rc.h \ - ../../src/burn/snd/fm.h \ - ../../src/burn/snd/fmopl.h \ - ../../src/burn/snd/ics2115.h \ - ../../src/burn/snd/iremga20.h \ - ../../src/burn/snd/k005289.h \ - ../../src/burn/snd/k007232.h \ - ../../src/burn/snd/k051649.h \ - ../../src/burn/snd/k053260.h \ - ../../src/burn/snd/k054539.h \ - ../../src/burn/snd/msm5205.h \ - ../../src/burn/snd/msm5232.h \ - ../../src/burn/snd/msm6295.h \ - ../../src/burn/snd/namco_snd.h \ - ../../src/burn/snd/nes_apu.h \ - ../../src/burn/snd/nes_defs.h \ - ../../src/burn/snd/rescap.h \ - ../../src/burn/snd/rf5c68.h \ - ../../src/burn/snd/saa1099.h \ - ../../src/burn/snd/samples.h \ - ../../src/burn/snd/segapcm.h \ - ../../src/burn/snd/sn76496.h \ - ../../src/burn/snd/upd7759.h \ - ../../src/burn/snd/vlm5030.h \ - ../../src/burn/snd/x1010.h \ - ../../src/burn/snd/ym2151.h \ - ../../src/burn/snd/ym2413.h \ - ../../src/burn/snd/ymdeltat.h \ - ../../src/burn/snd/ymf278b.h \ - ../../src/burn/snd/ymz280b.h \ - ../../src/burn/snd/pokey.h \ - ../../src/burn/burn_sound.h \ - ../../src/burn/burn.h \ - ../../src/burn/burnint.h \ - ../../src/burn/cheat.h \ - ../../src/burn/driver.h \ - ../../src/burn/hiscore.h \ - ../../src/burn/state.h \ - ../../src/burn/stdfunc.h \ - ../../src/burn/tiles_generic.h \ - ../../src/burn/timer.h \ - ../../src/burn/vector.h \ - ../../src/burn/version.h \ - ../../src/burn/burn_led.h \ - ../../src/burn/burn_gun.h \ - ../../src/burn/bitswap.h \ - ../../src/cpu/h6280_intf.h \ - ../../src/cpu/hd6309_intf.h \ - ../../src/cpu/konami_intf.h \ - ../../src/cpu/m6502_intf.h \ - ../../src/cpu/m6800_intf.h \ - ../../src/cpu/m6805_intf.h \ - ../../src/cpu/m6809_intf.h \ - ../../src/cpu/m68000_debug.h \ - ../../src/cpu/m68000_intf.h \ - ../../src/cpu/nec_intf.h \ - ../../src/cpu/pic16c5x_intf.h \ - ../../src/cpu/s2650_intf.h \ - ../../src/cpu/arm7_intf.h \ - ../../src/cpu/arm_intf.h \ - ../../src/cpu/arm7/arm7core.h \ - ../../src/cpu/h6280/h6280.h \ - ../../src/cpu/h6280/h6280ops.h \ - ../../src/cpu/hd6309/hd6309.h \ - ../../src/cpu/i8039/i8039.h \ - ../../src/cpu/konami/konami.h \ - ../../src/cpu/m6502/ill02.h \ - ../../src/cpu/m6502/m6502.h \ - ../../src/cpu/m6502/ops02.h \ - ../../src/cpu/m6502/opsc02.h \ - ../../src/cpu/m6502/opsn2a03.h \ - ../../src/cpu/m6800/m6800.h \ - ../../src/cpu/m6805/m6805.h \ - ../../src/cpu/m6809/m6809.h \ - ../../src/cpu/nec/nec.h \ - ../../src/cpu/nec/necea.h \ - ../../src/cpu/nec/necinstr.h \ - ../../src/cpu/nec/necmacro.h \ - ../../src/cpu/nec/necmodrm.h \ - ../../src/cpu/nec/necpriv.h \ - ../../src/cpu/nec/v25instr.h \ - ../../src/cpu/nec/v25priv.h \ - ../../src/cpu/pic16c5x/pic16c5x.h \ - ../../src/cpu/s2650/s2650.h \ - ../../src/cpu/z80/z80.h \ - ../../src/cpu/z80/z80daisy.h \ - ../../src/cpu/m68k/m68kcpu.h \ - ../../src/cpu/m68k/m68kconf.h \ - ../../src/burner/burner.h \ - ../../src/burner/gameinp.h \ - ../../src/burner/ioapi.h \ - ../../src/burner/neocdlist.h \ - ../../src/burner/title.h \ - ../../src/burner/unzip.h \ - ../../src/dep/libs/libpng/png.h \ - ../../src/dep/libs/libpng/pngconf.h \ - ../../src/dep/libs/libpng/pngdebug.h \ - ../../src/dep/libs/libpng/pnginfo.h \ - ../../src/dep/libs/libpng/pnglibconf.h \ - ../../src/dep/libs/libpng/pngpriv.h \ - ../../src/dep/libs/libpng/pngstruct.h \ - ../../src/intf/interface.h \ - ../../src/intf/audio/aud_dsp.h \ - ../../src/intf/audio/lowpass2.h \ - ../../src/intf/cd/cd_interface.h \ - ../../src/intf/input/inp_keys.h \ - ../../src/intf/video/vid_support.h \ - ../../src/cpu/sh2_intf.h \ - ../../src/cpu/z80_intf.h \ - ../../src/burner/qt/aboutdialog.h \ - ../../src/burner/qt/burner_qt.h \ - ../../src/burner/qt/dipswitchdialog.h \ - ../../src/burner/qt/emuworker.h \ - ../../src/burner/qt/mainwindow.h \ - ../../src/burner/qt/qaudiointerface.h \ - ../../src/burner/qt/qinputinterface.h \ - ../../src/burner/qt/qutil.h \ - ../../src/burner/qt/romdirsdialog.h \ - ../../src/burner/qt/rominfodialog.h \ - ../../src/burner/qt/romscandialog.h \ - ../../src/burner/qt/selectdialog.h \ - ../../src/burner/qt/supportdirsdialog.h \ - ../../src/burner/qt/tchar.h \ - ../../src/dep/libs/zlib/crc32.h \ - ../../src/dep/libs/zlib/deflate.h \ - ../../src/dep/libs/zlib/gzguts.h \ - ../../src/dep/libs/zlib/inffast.h \ - ../../src/dep/libs/zlib/inffixed.h \ - ../../src/dep/libs/zlib/inflate.h \ - ../../src/dep/libs/zlib/inftrees.h \ - ../../src/dep/libs/zlib/trees.h \ - ../../src/dep/libs/zlib/zconf.h \ - ../../src/dep/libs/zlib/zconf.h.in \ - ../../src/dep/libs/zlib/zlib.h \ - ../../src/dep/libs/zlib/zutil.h \ - ../../src/burn/devices/nmk004.h \ - ../../src/burn/devices/kaneko_tmap.h \ - ../../src/burner/qt/inputdialog.h \ - ../../src/burner/qt/widgets/hexspinbox.h \ - ../../src/burner/qt/logdialog.h \ - ../../src/burner/qt/inputsetdialog.h \ - ../../src/burner/qt/oglviewport.h \ - ../../src/intf/video/opengl/shader.h \ - ../../src/cpu/mips3/mips3_common.h \ - ../../src/cpu/mips3/mips3_memory.h \ - ../../src/cpu/mips3/mips3.h \ - ../../src/cpu/mips3/mips3_arithm.h \ - ../../src/cpu/mips3/mips3_bitops.h \ - ../../src/cpu/mips3/mips3_branch.h \ - ../../src/cpu/mips3/mips3_misc.h \ - ../../src/cpu/mips3/mips3_rw.h \ - ../../src/cpu/mips3/mips3_shift.h \ - ../../src/cpu/mips3/mipsdef.h \ - ../../src/cpu/mips3_intf.h \ - ../../src/cpu/adsp2100_intf.h \ - ../../src/cpu/adsp2100/adsp2100.h \ - ../../src/cpu/adsp2100/adsp2100_defs.h \ - ../../src/cpu/adsp2100/cpuintrf.h - - -#------------------------------------------------------------------------------- -# MIPS3 x64 recompiler -#------------------------------------------------------------------------------- - -$$DRC_MIPS3_X64 { - message("MIPS3 x64 dynarec enabled") - DEFINES += \ - XBYAK_NO_OP_NAMES \ - MIPS3_X64_DRC - - HEADERS += \ - ../../src/cpu/mips3/x64/mips3_x64.h \ - ../../src/cpu/mips3/x64/mips3_x64_arithm.h \ - ../../src/cpu/mips3/x64/mips3_x64_bitops.h \ - ../../src/cpu/mips3/x64/mips3_x64_branch.h \ - ../../src/cpu/mips3/x64/mips3_x64_cop0.h \ - ../../src/cpu/mips3/x64/mips3_x64_cop1.h \ - ../../src/cpu/mips3/x64/mips3_x64_defs.h \ - ../../src/cpu/mips3/x64/mips3_x64_misc.h \ - ../../src/cpu/mips3/x64/mips3_x64_rw.h \ - ../../src/cpu/mips3/x64/mips3_x64_shift.h \ - ../../src/cpu/mips3/x64/xbyak/xbyak.h \ - ../../src/cpu/mips3/x64/xbyak/xbyak_bin2hex.h \ - ../../src/cpu/mips3/x64/xbyak/xbyak_mnemonic.h \ - ../../src/cpu/mips3/x64/xbyak/xbyak_util.h - - SOURCES += \ - ../../src/cpu/mips3/x64/mips3_x64.cpp -} - - -#------------------------------------------------------------------------------- -# Linux only drivers -#------------------------------------------------------------------------------- -linux: HEADERS += ../../src/intf/audio/linux/ringbuffer.h -linux: SOURCES += ../../src/intf/audio/linux/aud_pulse_simple.cpp - -OTHER_FILES += - -RESOURCES += \ - ../../src/burner/qt/rscr.qrc - -FORMS += \ - ../../src/burner/qt/aboutdialog.ui \ - ../../src/burner/qt/dipswitchdialog.ui \ - ../../src/burner/qt/romdirsdialog.ui \ - ../../src/burner/qt/rominfodialog.ui \ - ../../src/burner/qt/romscandialog.ui \ - ../../src/burner/qt/selectdialog.ui \ - ../../src/burner/qt/supportdirsdialog.ui \ - ../../src/burner/qt/inputdialog.ui \ - ../../src/burner/qt/logdialog.ui \ - ../../src/burner/qt/inputsetdialog.ui \ diff --git a/jan/projectfiles/qtcreator/fba_sdl.pro b/jan/projectfiles/qtcreator/fba_sdl.pro deleted file mode 100644 index 6b2d44b3e..000000000 --- a/jan/projectfiles/qtcreator/fba_sdl.pro +++ /dev/null @@ -1,1271 +0,0 @@ -#=============================================================================== -# FINAL BURN ALPHA QT -#=============================================================================== -TARGET = fbasdl - -#=============================================================================== -# DRIVERS -#=============================================================================== -DRV_CAPCOM = true -DRV_CAVE = true -DRV_CPS3 = true -DRV_DATAEAST = true -DRV_GALAXIAN = true -DRV_IREM = true -DRV_KONAMI = true -DRV_SMS = true -DRV_MEGADRIVE = true -DRV_NEOGEO = true -DRV_PCE = true -DRV_PGM = true -DRV_PRE90S = true -DRV_PST90S = true -DRV_SEGA = true -DRV_SNES = true -DRV_TAITO = true -DRV_TOAPLAN = true -DRV_PSIKYO = true - -#=============================================================================== -# DEPENDENCIES -#=============================================================================== - -#------------------------------------------------------------------------------- -# for Linux, absolute paths -#------------------------------------------------------------------------------- -SRC = $$system(readlink -m $$PWD/../../src) -SCRIPTS = $$SRC/dep/scripts -GEN = $$SRC/dep/generated - -# We need ld -FBA_LD = ld - -#------------------------------------------------------------------------------- -# Additional include paths -#------------------------------------------------------------------------------- -INCLUDEPATH += \ - $$GEN \ - $$SRC/dep/qtcreator \ - $$SRC/burn \ - $$SRC/burn/snd \ - $$SRC/burn/devices \ - $$SRC/burn/drv/capcom \ - $$SRC/burn/drv/cave \ - $$SRC/burn/drv/konami \ - $$SRC/burn/drv/neogeo \ - $$SRC/burn/drv/pgm \ - $$SRC/burn/drv/pre90s \ - $$SRC/burn/drv/psikyo \ - $$SRC/burn/drv/pst90s \ - $$SRC/burn/drv/taito \ - $$SRC/burn/drv/toaplan \ - $$SRC/burner \ - $$SRC/burner/sdl \ - $$SRC/cpu \ - $$SRC/cpu/i8039 \ - $$SRC/cpu/konami \ - $$SRC/cpu/m68k \ - $$SRC/intf \ - $$SRC/intf/video \ - $$SRC/intf/video/scalers \ - $$SRC/intf/input \ - $$SRC/intf/audio \ - $$SRC/intf/cd \ - $$SRC/dep/libs/libpng \ - $$SRC/dep/libs/zlib \ - -DEFINES += BUILD_SDL \ - LSB_FIRST \ - "__fastcall=" \ - "_fastcall=" \ - WITH_QTCREATOR \ - INCLUDE_LIB_PNGH - -# no warnings... -QMAKE_CXXFLAGS += -w -QMAKE_CFLAGS += -w - - -#------------------------------------------------------------------------------- -# C++11 -#------------------------------------------------------------------------------- -CONFIG += c++11 - -#------------------------------------------------------------------------------- -# src/dep/generated -#------------------------------------------------------------------------------- -GENERATED.target = $$GEN/empty -GENERATED.commands = \ - @echo "Creating generated directory..."; \ - cd $$SRC/dep; \ - mkdir generated; \ - touch generated/empty - -#------------------------------------------------------------------------------- -# src/dep/generated/ctv.h -#------------------------------------------------------------------------------- -CTV_HEADER.depends = GENERATED -CTV_HEADER.target = $$GEN/ctv.h - -CTV_HEADER.commands = \ - @echo "Building ctv..."; \ - cd $$SRC/burn/drv/capcom; \ - $$QMAKE_CXX ctv_make.cpp -o ctv_make; \ - ./ctv_make > $$CTV_HEADER.target; \ - rm ctv_make - -#------------------------------------------------------------------------------- -# perl scripts -#------------------------------------------------------------------------------- - -# cave_sprite_func.h -CAVE_SPRFUNC_HEADER.depends = GENERATED -CAVE_SPRFUNC_HEADER.target = $$GEN/cave_sprite_func.h -CAVE_SPRFUNC_HEADER.commands = \ - @echo "Generating cave_sprite_func.h"; \ - perl $$SCRIPTS/cave_sprite_func.pl -o $$CAVE_SPRFUNC_HEADER.target; - -# cave_tile_func.h -CAVE_TILEFUNC_HEADER.depends = GENERATED -CAVE_TILEFUNC_HEADER.target = $$GEN/cave_tile_func.h -CAVE_TILEFUNC_HEADER.commands = \ - @echo "Generating cave_tile_func.h"; \ - perl $$SCRIPTS/cave_tile_func.pl -o $$CAVE_TILEFUNC_HEADER.target; - -# neo_sprite_func.h -NEO_SPRFUNC_HEADER.depends = GENERATED -NEO_SPRFUNC_HEADER.target = $$GEN/neo_sprite_func.h -NEO_SPRFUNC_HEADER.commands = \ - @echo "Generating neo_sprite_func.h"; \ - perl $$SCRIPTS/neo_sprite_func.pl -o $$NEO_SPRFUNC_HEADER.target; - -# psikyo_tile_func.h -PSIKYO_TILEFUNC_HEADER.depends = GENERATED -PSIKYO_TILEFUNC_HEADER.target = $$GEN/psikyo_tile_func.h -PSIKYO_TILEFUNC_HEADER.commands = \ - @echo "Generating psikyo_tile_func.h"; \ - perl $$SCRIPTS/psikyo_tile_func.pl -o $$PSIKYO_TILEFUNC_HEADER.target; - -# toa_gp9001_func -TOA_GP9001_FUNC_HEADER.depends = GENERATED -TOA_GP9001_FUNC_HEADER.target = $$GEN/toa_gp9001_func.h -TOA_GP9001_FUNC_HEADER.commands = \ - @echo "Generating toa_gp9001_func.h"; \ - perl $$SCRIPTS/toa_gp9001_func.pl -o $$TOA_GP9001_FUNC_HEADER.target; - -#------------------------------------------------------------------------------- -# pgm_sprite.h -#------------------------------------------------------------------------------- -PGM_SPRITE_CREATE.depends = GENERATED -PGM_SPRITE_CREATE.target = $$GEN/pgm_sprite_create -PGM_SPRITE_CREATE.commands =\ - @echo "Compiling pgm_sprite_create.cpp"; \ - $$QMAKE_CXX $$SRC/burn/drv/pgm/pgm_sprite_create.cpp -o $$PGM_SPRITE_CREATE.target; - -PGM_SPRITE_HEADER.depends = PGM_SPRITE_CREATE -PGM_SPRITE_HEADER.target = $$GEN/pgm_sprite.h -PGM_SPRITE_HEADER.commands =\ - @echo "Generating pgm_sprite.h"; \ - $$PGM_SPRITE_CREATE.target > $$PGM_SPRITE_HEADER.target - - - -#------------------------------------------------------------------------------- -# Musashi68k -#------------------------------------------------------------------------------- -M68K_MAKE.target = $$GEN/m68kmake -M68K_MAKE.depends = $$SRC/cpu/m68k/m68kmake.c GENERATED -M68K_MAKE.commands = \ - @echo "Compiling Musashi MC680x0 core: m68kmake.c..."; \ - $$QMAKE_CC $$SRC/cpu/m68k/m68kmake.c -o $$M68K_MAKE.target; \ - $$M68K_MAKE.target $$GEN/ $$SRC/cpu/m68k/m68k_in.c; - -# objects -M68K_OPAC.target = $$GEN/m68kopac.o -M68K_OPAC.depends = M68K_MAKE -M68K_OPAC.commands = \ - @echo "Compiling Musashi MC680x0 core: m68kopac.c..."; \ - $$QMAKE_CC $$QMAKE_CFLAGS -I$$SRC/cpu/m68k $$GEN/m68kopac.c -c -o $$M68K_OPAC.target; - -M68K_OPDM.target = $$GEN/m68kopdm.o -M68K_OPDM.depends = M68K_MAKE -M68K_OPDM.commands = \ - @echo "Compiling Musashi MC680x0 core: m68kopdm.c..."; \ - $$QMAKE_CC $$QMAKE_CFLAGS -I$$SRC/cpu/m68k $$GEN/m68kopdm.c -c -o $$M68K_OPDM.target; - -M68K_OPNZ.target = $$GEN/m68kopnz.o -M68K_OPNZ.depends = M68K_MAKE -M68K_OPNZ.commands = \ - @echo "Compiling Musashi MC680x0 core: m68kopnz.c..."; \ - $$QMAKE_CC $$QMAKE_CFLAGS -I$$SRC/cpu/m68k $$GEN/m68kopnz.c -c -o $$M68K_OPNZ.target; - -M68K_OPS.target = $$GEN/m68kops.o -M68K_OPS.depends = M68K_MAKE -M68K_OPS.commands = \ - @echo "Compiling Musashi MC680x0 core: m68kops.c..."; \ - $$QMAKE_CC $$QMAKE_CFLAGS -I$$SRC/cpu/m68k $$GEN/m68kops.c -c -o $$M68K_OPS.target; - -M68K_OPS_HEADER.target = $$GEN/m68kops.h -M68K_OPS_HEADER.depends = M68K_MAKE -M68K_OPS_HEADER.commands = \ - $$M68K_MAKE.target $$GEN/ $$SRC/cpu/m68k/m68k_in.c; - -M68K_LIB.target = $$GEN/libm68kops.o -M68K_LIB.depends = M68K_MAKE M68K_OPAC M68K_OPDM M68K_OPNZ M68K_OPS M68K_OPS_HEADER -M68K_LIB.commands = \ - @echo "Partially linking Musashi MC680x0 core: libm68kops.o..."; \ - $$FBA_LD -r $$M68K_OPAC.target $$M68K_OPDM.target \ - $$M68K_OPNZ.target $$M68K_OPS.target -o $$M68K_LIB.target - - -OBJECTS += $$M68K_LIB.target - -#------------------------------------------------------------------------------- -# Gamelist -#------------------------------------------------------------------------------- -DRIVERLIST.depends = GENERATED -DRIVERLIST.target = $$GEN/driverlist.h - -DRIVERLIST_PATHS = -$$DRV_SMS:DRIVERLIST_PATHS += $$SRC/burn/drv/sms -$$DRV_PCE:DRIVERLIST_PATHS += $$SRC/burn/drv/pce -$$DRV_PGM:DRIVERLIST_PATHS += $$SRC/burn/drv/pgm -$$DRV_CAVE:DRIVERLIST_PATHS += $$SRC/burn/drv/cave -$$DRV_CPS3:DRIVERLIST_PATHS += $$SRC/burn/drv/cps3 -$$DRV_IREM:DRIVERLIST_PATHS += $$SRC/burn/drv/irem -$$DRV_SEGA:DRIVERLIST_PATHS += $$SRC/burn/drv/sega -$$DRV_SNES:DRIVERLIST_PATHS += $$SRC/burn/drv/snes -$$DRV_TAITO:DRIVERLIST_PATHS += $$SRC/burn/drv/taito -$$DRV_CAPCOM:DRIVERLIST_PATHS += $$SRC/burn/drv/capcom -$$DRV_NEOGEO:DRIVERLIST_PATHS += $$SRC/burn/drv/neogeo -$$DRV_KONAMI:DRIVERLIST_PATHS += $$SRC/burn/drv/konami -$$DRV_PRE90S:DRIVERLIST_PATHS += $$SRC/burn/drv/pre90s -$$DRV_PST90S:DRIVERLIST_PATHS += $$SRC/burn/drv/pst90s -$$DRV_PSIKYO:DRIVERLIST_PATHS += $$SRC/burn/drv/psikyo -$$DRV_TOAPLAN:DRIVERLIST_PATHS += $$SRC/burn/drv/toaplan -$$DRV_DATAEAST:DRIVERLIST_PATHS += $$SRC/burn/drv/dataeast -$$DRV_GALAXIAN:DRIVERLIST_PATHS += $$SRC/burn/drv/galaxian -$$DRV_MEGADRIVE:DRIVERLIST_PATHS += $$SRC/burn/drv/megadrive - -DRIVERLIST.commands = \ - @echo "Generating driverlist.h"; \ - perl $$SCRIPTS/gamelist.pl -o $$DRIVERLIST.target $$DRIVERLIST_PATHS; - -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -QMAKE_EXTRA_TARGETS += \ - GENERATED \ - CTV_HEADER \ - CAVE_SPRFUNC_HEADER \ - CAVE_TILEFUNC_HEADER \ - NEO_SPRFUNC_HEADER \ - PSIKYO_TILEFUNC_HEADER \ - PGM_SPRITE_CREATE \ - PGM_SPRITE_HEADER \ - TOA_GP9001_FUNC_HEADER \ - DRIVERLIST \ - M68K_MAKE \ - M68K_OPAC \ - M68K_OPDM \ - M68K_OPNZ \ - M68K_OPS \ - M68K_OPS_HEADER \ - M68K_LIB - -PRE_TARGETDEPS += \ - $$CTV_HEADER.target \ - $$CAVE_SPRFUNC_HEADER.target \ - $$CAVE_TILEFUNC_HEADER.target \ - $$NEO_SPRFUNC_HEADER.target \ - $$PSIKYO_TILEFUNC_HEADER.target \ - $$PGM_SPRITE_HEADER.target \ - $$TOA_GP9001_FUNC_HEADER.target \ - $$DRIVERLIST.target \ - $$M68K_LIB.target \ - -LIBS += -lSDL - -QMAKE_CLEAN += $$GEN/* -#=============================================================================== -# CAPCOM DRIVERS -#=============================================================================== -$$DRV_CAPCOM { - message("Capcom drivers enabled") - - HEADERS += \ - ../../src/burn/drv/capcom/cps.h \ - ../../src/burn/drv/capcom/ctv_do.h - - SOURCES += \ - ../../src/burn/drv/capcom/cps_config.cpp \ - ../../src/burn/drv/capcom/cps_draw.cpp \ - ../../src/burn/drv/capcom/cps_mem.cpp \ - ../../src/burn/drv/capcom/cps_obj.cpp \ - ../../src/burn/drv/capcom/cps_pal.cpp \ - ../../src/burn/drv/capcom/cps_run.cpp \ - ../../src/burn/drv/capcom/cps_rw.cpp \ - ../../src/burn/drv/capcom/cps_scr.cpp \ - ../../src/burn/drv/capcom/cps.cpp \ - ../../src/burn/drv/capcom/cps2_crpt.cpp \ - ../../src/burn/drv/capcom/cpsr.cpp \ - ../../src/burn/drv/capcom/cpsrd.cpp \ - ../../src/burn/drv/capcom/cpst.cpp \ - ../../src/burn/drv/capcom/ctv.cpp \ - ../../src/burn/drv/capcom/d_cps1.cpp \ - ../../src/burn/drv/capcom/d_cps2.cpp \ - ../../src/burn/drv/capcom/fcrash_snd.cpp \ - ../../src/burn/drv/capcom/kabuki.cpp \ - ../../src/burn/drv/capcom/ps_m.cpp \ - ../../src/burn/drv/capcom/ps_z.cpp \ - ../../src/burn/drv/capcom/ps.cpp \ - ../../src/burn/drv/capcom/qs_c.cpp \ - ../../src/burn/drv/capcom/qs_z.cpp \ - ../../src/burn/drv/capcom/qs.cpp \ - ../../src/burn/drv/capcom/sf2mdt_snd.cpp -} - -#=============================================================================== -# CAVE DRIVERS -#=============================================================================== -$$DRV_CAVE { - message("Cave drivers enabled") - HEADERS += \ - ../../src/burn/drv/cave/cave_sprite_render_zoom.h \ - ../../src/burn/drv/cave/cave_sprite_render.h \ - ../../src/burn/drv/cave/cave_tile_render.h \ - ../../src/burn/drv/cave/cave.h - - SOURCES += \ - ../../src/burn/drv/cave/cave_palette.cpp \ - ../../src/burn/drv/cave/cave_sprite.cpp \ - ../../src/burn/drv/cave/cave_tile.cpp \ - ../../src/burn/drv/cave/cave.cpp \ - ../../src/burn/drv/cave/d_dodonpachi.cpp \ - ../../src/burn/drv/cave/d_donpachi.cpp \ - ../../src/burn/drv/cave/d_esprade.cpp \ - ../../src/burn/drv/cave/d_feversos.cpp \ - ../../src/burn/drv/cave/d_gaia.cpp \ - ../../src/burn/drv/cave/d_guwange.cpp \ - ../../src/burn/drv/cave/d_hotdogst.cpp \ - ../../src/burn/drv/cave/d_korokoro.cpp \ - ../../src/burn/drv/cave/d_mazinger.cpp \ - ../../src/burn/drv/cave/d_metmqstr.cpp \ - ../../src/burn/drv/cave/d_pwrinst2.cpp \ - ../../src/burn/drv/cave/d_sailormn.cpp \ - ../../src/burn/drv/cave/d_tjumpman.cpp \ - ../../src/burn/drv/cave/d_uopoko.cpp -} - -#=============================================================================== -# CPS3 DRIVERS -#=============================================================================== -$$DRV_CPS3 { - message("CPS3 drivers enabled") - - HEADERS += \ - ../../src/burn/drv/cps3/cps3.h - - SOURCES += \ - ../../src/burn/drv/cps3/cps3run.cpp \ - ../../src/burn/drv/cps3/cps3snd.cpp \ - ../../src/burn/drv/cps3/d_cps3.cpp -} - -#=============================================================================== -# DATAEAST DRIVERS -#=============================================================================== -$$DRV_DATAEAST { - message("Dataeast drivers enabled") - - HEADERS += \ - ../../src/burn/drv/dataeast/deco16ic.h - - SOURCES += \ - ../../src/burn/drv/dataeast/d_actfancr.cpp \ - ../../src/burn/drv/dataeast/d_backfire.cpp \ - ../../src/burn/drv/dataeast/d_boogwing.cpp \ - ../../src/burn/drv/dataeast/d_cbuster.cpp \ - ../../src/burn/drv/dataeast/d_cninja.cpp \ - ../../src/burn/drv/dataeast/d_darkseal.cpp \ - ../../src/burn/drv/dataeast/d_dassault.cpp \ - ../../src/burn/drv/dataeast/d_dec0.cpp \ - ../../src/burn/drv/dataeast/d_dec8.cpp \ - ../../src/burn/drv/dataeast/d_dietgogo.cpp \ - ../../src/burn/drv/dataeast/d_funkyjet.cpp \ - ../../src/burn/drv/dataeast/d_karnov.cpp \ - ../../src/burn/drv/dataeast/d_lemmings.cpp \ - ../../src/burn/drv/dataeast/d_pktgaldx.cpp \ - ../../src/burn/drv/dataeast/d_rohga.cpp \ - ../../src/burn/drv/dataeast/d_sidepckt.cpp \ - ../../src/burn/drv/dataeast/d_simpl156.cpp \ - ../../src/burn/drv/dataeast/d_supbtime.cpp \ - ../../src/burn/drv/dataeast/d_tumblep.cpp \ - ../../src/burn/drv/dataeast/d_vaportra.cpp \ - ../../src/burn/drv/dataeast/deco16ic.cpp -} - -#=============================================================================== -# GALAXIAN DRIVERS -#=============================================================================== -$$DRV_GALAXIAN { - message("Galaxian drivers enabled") - - HEADERS += \ - ../../src/burn/drv/galaxian/gal.h - - SOURCES += \ - ../../src/burn/drv/galaxian/d_galaxian.cpp \ - ../../src/burn/drv/galaxian/gal_gfx.cpp \ - ../../src/burn/drv/galaxian/gal_run.cpp \ - ../../src/burn/drv/galaxian/gal_sound.cpp \ - ../../src/burn/drv/galaxian/gal_stars.cpp -} - -#=============================================================================== -# IREM DRIVERS -#=============================================================================== -$$DRV_IREM { - message("Irem drivers enabled") - - HEADERS += \ - ../../src/burn/drv/irem/irem_cpu.h - - SOURCES += \ - ../../src/burn/drv/irem/d_m62.cpp \ - ../../src/burn/drv/irem/d_m63.cpp \ - ../../src/burn/drv/irem/d_m72.cpp \ - ../../src/burn/drv/irem/d_m90.cpp \ - ../../src/burn/drv/irem/d_m92.cpp \ - ../../src/burn/drv/irem/d_m107.cpp \ - ../../src/burn/drv/irem/d_vigilant.cpp \ - ../../src/burn/drv/irem/irem_cpu.cpp -} - -#=============================================================================== -# KONAMI DRIVERS -#=============================================================================== -$$DRV_KONAMI { - message("Konami drivers enabled") - - HEADERS += \ - ../../src/burn/drv/konami/konamiic.h - - SOURCES += \ - ../../src/burn/drv/konami/d_88games.cpp \ - ../../src/burn/drv/konami/d_ajax.cpp \ - ../../src/burn/drv/konami/d_aliens.cpp \ - ../../src/burn/drv/konami/d_blockhl.cpp \ - ../../src/burn/drv/konami/d_bottom9.cpp \ - ../../src/burn/drv/konami/d_contra.cpp \ - ../../src/burn/drv/konami/d_crimfght.cpp \ - ../../src/burn/drv/konami/d_gberet.cpp \ - ../../src/burn/drv/konami/d_gbusters.cpp \ - ../../src/burn/drv/konami/d_gradius3.cpp \ - ../../src/burn/drv/konami/d_gyruss.cpp \ - ../../src/burn/drv/konami/d_hcastle.cpp \ - ../../src/burn/drv/konami/d_hexion.cpp \ - ../../src/burn/drv/konami/d_kontest.cpp \ - ../../src/burn/drv/konami/d_mainevt.cpp \ - ../../src/burn/drv/konami/d_mikie.cpp \ - ../../src/burn/drv/konami/d_mogura.cpp \ - ../../src/burn/drv/konami/d_nemesis.cpp \ - ../../src/burn/drv/konami/d_parodius.cpp \ - ../../src/burn/drv/konami/d_pooyan.cpp \ - ../../src/burn/drv/konami/d_rollerg.cpp \ - ../../src/burn/drv/konami/d_scotrsht.cpp \ - ../../src/burn/drv/konami/d_simpsons.cpp \ - ../../src/burn/drv/konami/d_spy.cpp \ - ../../src/burn/drv/konami/d_surpratk.cpp \ - ../../src/burn/drv/konami/d_thunderx.cpp \ - ../../src/burn/drv/konami/d_tmnt.cpp \ - ../../src/burn/drv/konami/d_twin16.cpp \ - ../../src/burn/drv/konami/d_ultraman.cpp \ - ../../src/burn/drv/konami/d_vendetta.cpp \ - ../../src/burn/drv/konami/d_xmen.cpp \ - ../../src/burn/drv/konami/k051316.cpp \ - ../../src/burn/drv/konami/k051733.cpp \ - ../../src/burn/drv/konami/k051960.cpp \ - ../../src/burn/drv/konami/k052109.cpp \ - ../../src/burn/drv/konami/k053245.cpp \ - ../../src/burn/drv/konami/k053247.cpp \ - ../../src/burn/drv/konami/k053251.cpp \ - ../../src/burn/drv/konami/k053936.cpp \ - ../../src/burn/drv/konami/k054000.cpp \ - ../../src/burn/drv/konami/konamiic.cpp -} - -#=============================================================================== -# MEGADRIVE DRIVERS -#=============================================================================== -$$DRV_MEGADRIVE { - message("Megadrive drivers enabled") - - HEADERS += \ - ../../src/burn/drv/megadrive/megadrive.h - - SOURCES += \ - ../../src/burn/drv/megadrive/d_megadrive.cpp \ - ../../src/burn/drv/megadrive/megadrive.cpp -} - -#=============================================================================== -# NEOGEO DRIVERS -#=============================================================================== -$$DRV_NEOGEO { - message("Neogeo drivers enabled") - - HEADERS += \ - ../../src/burn/drv/neogeo/neo_sprite_render.h \ - ../../src/burn/drv/neogeo/neo_text_render.h \ - ../../src/burn/drv/neogeo/neogeo.h - - SOURCES += \ - ../../src/burn/drv/neogeo/d_neogeo.cpp \ - ../../src/burn/drv/neogeo/neo_decrypt.cpp \ - ../../src/burn/drv/neogeo/neo_palette.cpp \ - ../../src/burn/drv/neogeo/neo_run.cpp \ - ../../src/burn/drv/neogeo/neo_sprite.cpp \ - ../../src/burn/drv/neogeo/neo_text.cpp \ - ../../src/burn/drv/neogeo/neo_upd4990a.cpp \ - ../../src/burn/drv/neogeo/neogeo.cpp -} - -#=============================================================================== -# PC-ENGINE DRIVERS -#=============================================================================== -$$DRV_PCE { - message("PC-Engine drivers enabled") - - HEADERS += \ - ../../src/burn/drv/pce/pce.h - - SOURCES += \ - ../../src/burn/drv/pce/d_pce.cpp \ - ../../src/burn/drv/pce/pce.cpp -} - -#=============================================================================== -# PGM DRIVERS -#=============================================================================== -$$DRV_PGM { - message("PGM drivers enabled") - - HEADERS += \ - ../../src/burn/drv/pgm/pgm.h - - SOURCES += \ - ../../src/burn/drv/pgm/d_pgm.cpp \ - ../../src/burn/drv/pgm/pgm_crypt.cpp \ - ../../src/burn/drv/pgm/pgm_draw.cpp \ - ../../src/burn/drv/pgm/pgm_prot.cpp \ - ../../src/burn/drv/pgm/pgm_run.cpp -} - -#=============================================================================== -# PRE90S DRIVERS -#=============================================================================== -$$DRV_PRE90S { - message("Pre90s drivers enabled") - - SOURCES += \ - ../../src/burn/drv/pre90s/d_4enraya.cpp \ - ../../src/burn/drv/pre90s/d_1942.cpp \ - ../../src/burn/drv/pre90s/d_1943.cpp \ - ../../src/burn/drv/pre90s/d_ambush.cpp \ - ../../src/burn/drv/pre90s/d_arabian.cpp \ - ../../src/burn/drv/pre90s/d_armedf.cpp \ - ../../src/burn/drv/pre90s/d_atetris.cpp \ - ../../src/burn/drv/pre90s/d_aztarac.cpp \ - ../../src/burn/drv/pre90s/d_baraduke.cpp \ - ../../src/burn/drv/pre90s/d_bionicc.cpp \ - ../../src/burn/drv/pre90s/d_blktiger.cpp \ - ../../src/burn/drv/pre90s/d_blockout.cpp \ - ../../src/burn/drv/pre90s/d_blueprnt.cpp \ - ../../src/burn/drv/pre90s/d_bombjack.cpp \ - ../../src/burn/drv/pre90s/d_capbowl.cpp \ - ../../src/burn/drv/pre90s/d_commando.cpp \ - ../../src/burn/drv/pre90s/d_cybertnk.cpp \ - ../../src/burn/drv/pre90s/d_ddragon.cpp \ - ../../src/burn/drv/pre90s/d_dkong.cpp \ - ../../src/burn/drv/pre90s/d_dynduke.cpp \ - ../../src/burn/drv/pre90s/d_epos.cpp \ - ../../src/burn/drv/pre90s/d_exedexes.cpp \ - ../../src/burn/drv/pre90s/d_funkybee.cpp \ - ../../src/burn/drv/pre90s/d_galaga.cpp \ - ../../src/burn/drv/pre90s/d_gauntlet.cpp \ - ../../src/burn/drv/pre90s/d_ginganin.cpp \ - ../../src/burn/drv/pre90s/d_gng.cpp \ - ../../src/burn/drv/pre90s/d_gunsmoke.cpp \ - ../../src/burn/drv/pre90s/d_higemaru.cpp \ - ../../src/burn/drv/pre90s/d_ikki.cpp \ - ../../src/burn/drv/pre90s/d_jack.cpp \ - ../../src/burn/drv/pre90s/d_kangaroo.cpp \ - ../../src/burn/drv/pre90s/d_kyugo.cpp \ - ../../src/burn/drv/pre90s/d_ladybug.cpp \ - ../../src/burn/drv/pre90s/d_lwings.cpp \ - ../../src/burn/drv/pre90s/d_madgear.cpp \ - ../../src/burn/drv/pre90s/d_marineb.cpp \ - ../../src/burn/drv/pre90s/d_markham.cpp \ - ../../src/burn/drv/pre90s/d_meijinsn.cpp \ - ../../src/burn/drv/pre90s/d_mitchell.cpp \ - ../../src/burn/drv/pre90s/d_mole.cpp \ - ../../src/burn/drv/pre90s/d_momoko.cpp \ - ../../src/burn/drv/pre90s/d_mrdo.cpp \ - ../../src/burn/drv/pre90s/d_mrflea.cpp \ - ../../src/burn/drv/pre90s/d_mustache.cpp \ - ../../src/burn/drv/pre90s/d_mystston.cpp \ - ../../src/burn/drv/pre90s/d_pac2650.cpp \ - ../../src/burn/drv/pre90s/d_pacland.cpp \ - ../../src/burn/drv/pre90s/d_pacman.cpp \ - ../../src/burn/drv/pre90s/d_pkunwar.cpp \ - ../../src/burn/drv/pre90s/d_prehisle.cpp \ - ../../src/burn/drv/pre90s/d_punchout.cpp \ - ../../src/burn/drv/pre90s/d_quizo.cpp \ - ../../src/burn/drv/pre90s/d_rallyx.cpp \ - ../../src/burn/drv/pre90s/d_renegade.cpp \ - ../../src/burn/drv/pre90s/d_route16.cpp \ - ../../src/burn/drv/pre90s/d_rpunch.cpp \ - ../../src/burn/drv/pre90s/d_scregg.cpp \ - ../../src/burn/drv/pre90s/d_sf.cpp \ - ../../src/burn/drv/pre90s/d_skyfox.cpp \ - ../../src/burn/drv/pre90s/d_skykid.cpp \ - ../../src/burn/drv/pre90s/d_snk68.cpp \ - ../../src/burn/drv/pre90s/d_solomon.cpp \ - ../../src/burn/drv/pre90s/d_sonson.cpp \ - ../../src/burn/drv/pre90s/d_srumbler.cpp \ - ../../src/burn/drv/pre90s/d_tail2nose.cpp \ - ../../src/burn/drv/pre90s/d_tecmo.cpp \ - ../../src/burn/drv/pre90s/d_terracre.cpp \ - ../../src/burn/drv/pre90s/d_tigeroad.cpp \ - ../../src/burn/drv/pre90s/d_toki.cpp \ - ../../src/burn/drv/pre90s/d_vulgus.cpp \ - ../../src/burn/drv/pre90s/d_wallc.cpp \ - ../../src/burn/drv/pre90s/d_wc90.cpp \ - ../../src/burn/drv/pre90s/d_wc90b.cpp \ - ../../src/burn/drv/pre90s/d_wwfsstar.cpp \ - ../../src/burn/drv/pre90s/d_xain.cpp -} - - -#=============================================================================== -# PSIKYO DRIVERS -#=============================================================================== -$$DRV_PSIKYO { - message("Psikyo drivers enabled") - - HEADERS += \ - ../../src/burn/drv/psikyo/psikyo_render.h \ - ../../src/burn/drv/psikyo/psikyo_sprite_func.h \ - ../../src/burn/drv/psikyo/psikyo.h \ - ../../src/burn/drv/psikyo/psikyosh_render.h - - SOURCES += \ - ../../src/burn/drv/psikyo/d_psikyo.cpp \ - ../../src/burn/drv/psikyo/d_psikyo4.cpp \ - ../../src/burn/drv/psikyo/d_psikyosh.cpp \ - ../../src/burn/drv/psikyo/psikyo_palette.cpp \ - ../../src/burn/drv/psikyo/psikyo_sprite.cpp \ - ../../src/burn/drv/psikyo/psikyo_tile.cpp \ - ../../src/burn/drv/psikyo/psikyosh_render.cpp -} - - -#=============================================================================== -# PST90S DRIVERS -#=============================================================================== -$$DRV_PST90S { - message("Pst90s drivers enabled") - - HEADERS += \ - ../../src/burn/drv/pst90s/kanekotb.h \ - ../../src/burn/drv/pst90s/nmk004.h - - SOURCES += \ - ../../src/burn/drv/pst90s/d_1945kiii.cpp \ - ../../src/burn/drv/pst90s/d_aerofgt.cpp \ - ../../src/burn/drv/pst90s/d_airbustr.cpp \ - ../../src/burn/drv/pst90s/d_aquarium.cpp \ - ../../src/burn/drv/pst90s/d_blmbycar.cpp \ - ../../src/burn/drv/pst90s/d_bloodbro.cpp \ - ../../src/burn/drv/pst90s/d_crospang.cpp \ - ../../src/burn/drv/pst90s/d_crshrace.cpp \ - ../../src/burn/drv/pst90s/d_dcon.cpp \ - ../../src/burn/drv/pst90s/d_ddragon3.cpp \ - ../../src/burn/drv/pst90s/d_deniam.cpp \ - ../../src/burn/drv/pst90s/d_diverboy.cpp \ - ../../src/burn/drv/pst90s/d_drgnmst.cpp \ - ../../src/burn/drv/pst90s/d_drtomy.cpp \ - ../../src/burn/drv/pst90s/d_egghunt.cpp \ - ../../src/burn/drv/pst90s/d_esd16.cpp \ - ../../src/burn/drv/pst90s/d_f1gp.cpp \ - ../../src/burn/drv/pst90s/d_fstarfrc.cpp \ - ../../src/burn/drv/pst90s/d_funybubl.cpp \ - ../../src/burn/drv/pst90s/d_fuukifg3.cpp \ - ../../src/burn/drv/pst90s/d_gaelco.cpp \ - ../../src/burn/drv/pst90s/d_gaiden.cpp \ - ../../src/burn/drv/pst90s/d_galpanic.cpp \ - ../../src/burn/drv/pst90s/d_galspnbl.cpp \ - ../../src/burn/drv/pst90s/d_gotcha.cpp \ - ../../src/burn/drv/pst90s/d_gumbo.cpp \ - ../../src/burn/drv/pst90s/d_hyperpac.cpp \ - ../../src/burn/drv/pst90s/d_jchan.cpp \ - ../../src/burn/drv/pst90s/d_kaneko16.cpp \ - ../../src/burn/drv/pst90s/d_lordgun.cpp \ - ../../src/burn/drv/pst90s/d_mcatadv.cpp \ - ../../src/burn/drv/pst90s/d_midas.cpp \ - ../../src/burn/drv/pst90s/d_mugsmash.cpp \ - ../../src/burn/drv/pst90s/d_news.cpp \ - ../../src/burn/drv/pst90s/d_nmg5.cpp \ - ../../src/burn/drv/pst90s/d_nmk16.cpp \ - ../../src/burn/drv/pst90s/d_ohmygod.cpp \ - ../../src/burn/drv/pst90s/d_pass.cpp \ - ../../src/burn/drv/pst90s/d_pirates.cpp \ - ../../src/burn/drv/pst90s/d_playmark.cpp \ - ../../src/burn/drv/pst90s/d_powerins.cpp \ - ../../src/burn/drv/pst90s/d_pushman.cpp \ - ../../src/burn/drv/pst90s/d_raiden.cpp \ - ../../src/burn/drv/pst90s/d_seta.cpp \ - ../../src/burn/drv/pst90s/d_seta2.cpp \ - ../../src/burn/drv/pst90s/d_shadfrce.cpp \ - ../../src/burn/drv/pst90s/d_silkroad.cpp \ - ../../src/burn/drv/pst90s/d_silvmil.cpp \ - ../../src/burn/drv/pst90s/d_speedspn.cpp \ - ../../src/burn/drv/pst90s/d_suna16.cpp \ - ../../src/burn/drv/pst90s/d_suprnova.cpp \ - ../../src/burn/drv/pst90s/d_taotaido.cpp \ - ../../src/burn/drv/pst90s/d_tecmosys.cpp \ - ../../src/burn/drv/pst90s/d_tumbleb.cpp \ - ../../src/burn/drv/pst90s/d_unico.cpp \ - ../../src/burn/drv/pst90s/d_vmetal.cpp \ - ../../src/burn/drv/pst90s/d_welltris.cpp \ - ../../src/burn/drv/pst90s/d_wwfwfest.cpp \ - ../../src/burn/drv/pst90s/d_xorworld.cpp \ - ../../src/burn/drv/pst90s/d_yunsun16.cpp \ - ../../src/burn/drv/pst90s/d_zerozone.cpp \ - ../../src/burn/drv/pst90s/nmk004.cpp -} - -#=============================================================================== -# SEGA DRIVERS -#=============================================================================== -$$DRV_SEGA { - message("Sega drivers enabled") - - HEADERS += \ - ../../src/burn/drv/sega/fd1094.h \ - ../../src/burn/drv/sega/genesis_vid.h \ - ../../src/burn/drv/sega/mc8123.h \ - ../../src/burn/drv/sega/sys16.h - - SOURCES += \ - ../../src/burn/drv/sega/d_angelkds.cpp \ - ../../src/burn/drv/sega/d_bankp.cpp \ - ../../src/burn/drv/sega/d_dotrikun.cpp \ - ../../src/burn/drv/sega/d_hangon.cpp \ - ../../src/burn/drv/sega/d_outrun.cpp \ - ../../src/burn/drv/sega/d_suprloco.cpp \ - ../../src/burn/drv/sega/d_sys1.cpp \ - ../../src/burn/drv/sega/d_sys16a.cpp \ - ../../src/burn/drv/sega/d_sys16b.cpp \ - ../../src/burn/drv/sega/d_sys18.cpp \ - ../../src/burn/drv/sega/d_xbrd.cpp \ - ../../src/burn/drv/sega/d_ybrd.cpp \ - ../../src/burn/drv/sega/fd1089.cpp \ - ../../src/burn/drv/sega/fd1094.cpp \ - ../../src/burn/drv/sega/genesis_vid.cpp \ - ../../src/burn/drv/sega/mc8123.cpp \ - ../../src/burn/drv/sega/sys16_fd1094.cpp \ - ../../src/burn/drv/sega/sys16_gfx.cpp \ - ../../src/burn/drv/sega/sys16_run.cpp -} - -#=============================================================================== -# MASTERSYSTEM DRIVERS -#=============================================================================== -$$DRV_SMS { - message("SMS drivers enabled") - - HEADERS += \ - ../../src/burn/drv/sms/sms.h - - SOURCES += \ - ../../src/burn/drv/sms/d_sms.cpp \ - ../../src/burn/drv/sms/sms.cpp -} - -#=============================================================================== -# SNES DRIVERS -#=============================================================================== -$$DRV_SNES { - message("SNES drivers enabled") - - HEADERS += \ - ../../src/burn/drv/snes/snes.h - - SOURCES += \ - ../../src/burn/drv/snes/d_snes.cpp \ - ../../src/burn/drv/snes/snes_65816.cpp \ - ../../src/burn/drv/snes/snes_io.cpp \ - ../../src/burn/drv/snes/snes_main.cpp \ - ../../src/burn/drv/snes/snes_ppu.cpp \ - ../../src/burn/drv/snes/snes_spc700.cpp -} - - -#=============================================================================== -# TAITO DRIVERS -#=============================================================================== -$$DRV_TAITO { - message("Taito drivers enabled") - - HEADERS += \ - ../../src/burn/drv/taito/taito_ic.h \ - ../../src/burn/drv/taito/taito_m68705.h \ - ../../src/burn/drv/taito/taito.h \ - ../../src/burn/drv/taito/tnzs_prot.h - - SOURCES += \ - ../../src/burn/drv/taito/cchip.cpp \ - ../../src/burn/drv/taito/d_arkanoid.cpp \ - ../../src/burn/drv/taito/d_ashnojoe.cpp \ - ../../src/burn/drv/taito/d_asuka.cpp \ - ../../src/burn/drv/taito/d_bublbobl.cpp \ - ../../src/burn/drv/taito/d_chaknpop.cpp \ - ../../src/burn/drv/taito/d_darius2.cpp \ - ../../src/burn/drv/taito/d_darkmist.cpp \ - ../../src/burn/drv/taito/d_exzisus.cpp \ - ../../src/burn/drv/taito/d_flstory.cpp \ - ../../src/burn/drv/taito/d_lkage.cpp \ - ../../src/burn/drv/taito/d_minivdr.cpp \ - ../../src/burn/drv/taito/d_othunder.cpp \ - ../../src/burn/drv/taito/d_retofinv.cpp \ - ../../src/burn/drv/taito/d_slapshot.cpp \ - ../../src/burn/drv/taito/d_superchs.cpp \ - ../../src/burn/drv/taito/d_taitob.cpp \ - ../../src/burn/drv/taito/d_taitof2.cpp \ - ../../src/burn/drv/taito/d_taitomisc.cpp \ - ../../src/burn/drv/taito/d_taitox.cpp \ - ../../src/burn/drv/taito/d_taitoz.cpp \ - ../../src/burn/drv/taito/d_tnzs.cpp \ - ../../src/burn/drv/taito/d_wyvernf0.cpp \ - ../../src/burn/drv/taito/pc080sn.cpp \ - ../../src/burn/drv/taito/pc090oj.cpp \ - ../../src/burn/drv/taito/taito_ic.cpp \ - ../../src/burn/drv/taito/taito_m68705.cpp \ - ../../src/burn/drv/taito/taito.cpp \ - ../../src/burn/drv/taito/tc0100scn.cpp \ - ../../src/burn/drv/taito/tc0110pcr.cpp \ - ../../src/burn/drv/taito/tc0140syt.cpp \ - ../../src/burn/drv/taito/tc0150rod.cpp \ - ../../src/burn/drv/taito/tc0180vcu.cpp \ - ../../src/burn/drv/taito/tc0220ioc.cpp \ - ../../src/burn/drv/taito/tc0280grd.cpp \ - ../../src/burn/drv/taito/tc0360pri.cpp \ - ../../src/burn/drv/taito/tc0480scp.cpp \ - ../../src/burn/drv/taito/tc0510nio.cpp \ - ../../src/burn/drv/taito/tc0640fio.cpp \ - ../../src/burn/drv/taito/tnzs_prot.cpp -} - - -#=============================================================================== -# TOAPLAN DRIVERS -#=============================================================================== -$$DRV_TOAPLAN { - message("Toaplan drivers enabled") - - HEADERS += \ - ../../src/burn/drv/toaplan/toa_extratext.h \ - ../../src/burn/drv/toaplan/toa_gp9001_render.h \ - ../../src/burn/drv/toaplan/toaplan.h - - SOURCES += \ - ../../src/burn/drv/toaplan/d_batrider.cpp \ - ../../src/burn/drv/toaplan/d_batsugun.cpp \ - ../../src/burn/drv/toaplan/d_battleg.cpp \ - ../../src/burn/drv/toaplan/d_bbakraid.cpp \ - ../../src/burn/drv/toaplan/d_demonwld.cpp \ - ../../src/burn/drv/toaplan/d_dogyuun.cpp \ - ../../src/burn/drv/toaplan/d_fixeight.cpp \ - ../../src/burn/drv/toaplan/d_ghox.cpp \ - ../../src/burn/drv/toaplan/d_hellfire.cpp \ - ../../src/burn/drv/toaplan/d_kbash.cpp \ - ../../src/burn/drv/toaplan/d_kbash2.cpp \ - ../../src/burn/drv/toaplan/d_mahoudai.cpp \ - ../../src/burn/drv/toaplan/d_outzone.cpp \ - ../../src/burn/drv/toaplan/d_pipibibs.cpp \ - ../../src/burn/drv/toaplan/d_rallybik.cpp \ - ../../src/burn/drv/toaplan/d_samesame.cpp \ - ../../src/burn/drv/toaplan/d_shippumd.cpp \ - ../../src/burn/drv/toaplan/d_snowbro2.cpp \ - ../../src/burn/drv/toaplan/d_tekipaki.cpp \ - ../../src/burn/drv/toaplan/d_tigerheli.cpp \ - ../../src/burn/drv/toaplan/d_truxton.cpp \ - ../../src/burn/drv/toaplan/d_truxton2.cpp \ - ../../src/burn/drv/toaplan/d_vfive.cpp \ - ../../src/burn/drv/toaplan/d_vimana.cpp \ - ../../src/burn/drv/toaplan/d_zerowing.cpp \ - ../../src/burn/drv/toaplan/toa_bcu2.cpp \ - ../../src/burn/drv/toaplan/toa_extratext.cpp \ - ../../src/burn/drv/toaplan/toa_gp9001.cpp \ - ../../src/burn/drv/toaplan/toa_palette.cpp \ - ../../src/burn/drv/toaplan/toaplan.cpp \ - ../../src/burn/drv/toaplan/toaplan1.cpp -} - -SOURCES += \ - ../../src/burn/devices/8255ppi.cpp \ - ../../src/burn/devices/8257dma.cpp \ - ../../src/burn/devices/eeprom.cpp \ - ../../src/burn/devices/pandora.cpp \ - ../../src/burn/devices/seibusnd.cpp \ - ../../src/burn/devices/sknsspr.cpp \ - ../../src/burn/devices/slapstic.cpp \ - ../../src/burn/devices/t5182.cpp \ - ../../src/burn/devices/timekpr.cpp \ - ../../src/burn/devices/tms34061.cpp \ - ../../src/burn/devices/v3021.cpp \ - ../../src/burn/devices/vdc.cpp \ - ../../src/burn/snd/burn_y8950.cpp \ - ../../src/burn/snd/burn_ym2151.cpp \ - ../../src/burn/snd/burn_ym2203.cpp \ - ../../src/burn/snd/burn_ym2413.cpp \ - ../../src/burn/snd/burn_ym2608.cpp \ - ../../src/burn/snd/burn_ym2610.cpp \ - ../../src/burn/snd/burn_ym2612.cpp \ - ../../src/burn/snd/burn_ym3526.cpp \ - ../../src/burn/snd/burn_ym3812.cpp \ - ../../src/burn/snd/burn_ymf278b.cpp \ - ../../src/burn/snd/c6280.cpp \ - ../../src/burn/snd/dac.cpp \ - ../../src/burn/snd/es5506.cpp \ - ../../src/burn/snd/es8712.cpp \ - ../../src/burn/snd/flt_rc.cpp \ - ../../src/burn/snd/ics2115.cpp \ - ../../src/burn/snd/iremga20.cpp \ - ../../src/burn/snd/k005289.cpp \ - ../../src/burn/snd/k007232.cpp \ - ../../src/burn/snd/k051649.cpp \ - ../../src/burn/snd/k053260.cpp \ - ../../src/burn/snd/k054539.cpp \ - ../../src/burn/snd/msm5205.cpp \ - ../../src/burn/snd/msm5232.cpp \ - ../../src/burn/snd/msm6295.cpp \ - ../../src/burn/snd/namco_snd.cpp \ - ../../src/burn/snd/nes_apu.cpp \ - ../../src/burn/snd/rf5c68.cpp \ - ../../src/burn/snd/saa1099.cpp \ - ../../src/burn/snd/samples.cpp \ - ../../src/burn/snd/segapcm.cpp \ - ../../src/burn/snd/sn76496.cpp \ - ../../src/burn/snd/upd7759.cpp \ - ../../src/burn/snd/vlm5030.cpp \ - ../../src/burn/snd/x1010.cpp \ - ../../src/burn/snd/ymz280b.cpp \ - ../../src/burn/snd/ay8910.c \ - ../../src/burn/snd/fm.c \ - ../../src/burn/snd/fmopl.c \ - ../../src/burn/snd/ym2151.c \ - ../../src/burn/snd/ym2413.c \ - ../../src/burn/snd/ymdeltat.c \ - ../../src/burn/snd/ymf278b.c \ - ../../src/burn/burn_sound.cpp \ - ../../src/burn/burn.cpp \ - ../../src/burn/cheat.cpp \ - ../../src/burn/debug_track.cpp \ - ../../src/burn/hiscore.cpp \ - ../../src/burn/load.cpp \ - ../../src/burn/tiles_generic.cpp \ - ../../src/burn/timer.cpp \ - ../../src/burn/vector.cpp \ - ../../src/burn/burn_sound_c.cpp \ - ../../src/burn/burn_memory.cpp \ - ../../src/burn/burn_led.cpp \ - ../../src/burn/burn_gun.cpp \ - ../../src/cpu/hd6309_intf.cpp \ - ../../src/cpu/konami_intf.cpp \ - ../../src/cpu/m6502_intf.cpp \ - ../../src/cpu/m6800_intf.cpp \ - ../../src/cpu/m6805_intf.cpp \ - ../../src/cpu/m6809_intf.cpp \ - ../../src/cpu/m68000_intf.cpp \ - ../../src/cpu/nec_intf.cpp \ - ../../src/cpu/pic16c5x_intf.cpp \ - ../../src/cpu/s2650_intf.cpp \ - ../../src/cpu/h6280_intf.cpp \ - ../../src/cpu/arm7_intf.cpp \ - ../../src/cpu/arm_intf.cpp \ - ../../src/cpu/arm/arm.cpp \ - ../../src/cpu/arm7/arm7.cpp \ - ../../src/cpu/arm7/arm7core.c \ - ../../src/cpu/arm7/arm7exec.c \ - ../../src/cpu/h6280/h6280.cpp \ - ../../src/cpu/h6280/tblh6280.c \ - ../../src/cpu/hd6309/hd6309.cpp \ - ../../src/cpu/hd6309/6309ops.c \ - ../../src/cpu/hd6309/6309tbl.c \ - ../../src/cpu/i8039/i8039.cpp \ - ../../src/cpu/konami/konami.cpp \ - ../../src/cpu/konami/konamops.c \ - ../../src/cpu/konami/konamtbl.c \ - ../../src/cpu/m6502/m6502.cpp \ - ../../src/cpu/m6502/t65c02.c \ - ../../src/cpu/m6502/t65sc02.c \ - ../../src/cpu/m6502/t6502.c \ - ../../src/cpu/m6502/tdeco16.c \ - ../../src/cpu/m6502/tn2a03.c \ - ../../src/cpu/m6800/m6800.cpp \ - ../../src/cpu/m6800/6800ops.c \ - ../../src/cpu/m6800/6800tbl.c \ - ../../src/cpu/m6805/m6805.cpp \ - ../../src/cpu/m6805/6805ops.c \ - ../../src/cpu/m6809/m6809.cpp \ - ../../src/cpu/m6809/6809ops.c \ - ../../src/cpu/m6809/6809tbl.c \ - ../../src/cpu/nec/nec.cpp \ - ../../src/cpu/nec/v25.cpp \ - ../../src/cpu/nec/necinstr.c \ - ../../src/cpu/nec/v25instr.c \ - ../../src/cpu/nec/v25sfr.c \ - ../../src/cpu/pic16c5x/pic16c5x.cpp \ - ../../src/cpu/s2650/s2650.cpp \ - ../../src/cpu/sh2/sh2.cpp \ - ../../src/cpu/z80/z80.cpp \ - ../../src/cpu/z80/z80daisy.cpp \ - ../../src/cpu/m68k/m68kcpu.c \ - ../../src/burner/conc.cpp \ - ../../src/burner/cong.cpp \ - ../../src/burner/dat.cpp \ - ../../src/burner/gamc.cpp \ - ../../src/burner/gami.cpp \ - ../../src/burner/image.cpp \ - ../../src/burner/misc.cpp \ - ../../src/burner/sshot.cpp \ - ../../src/burner/state.cpp \ - ../../src/burner/statec.cpp \ - ../../src/burner/zipfn.cpp \ - ../../src/burner/ioapi.c \ - ../../src/burner/unzip.c \ - ../../src/burner/sdl/bzip.cpp \ - ../../src/burner/sdl/config.cpp \ - ../../src/burner/sdl/drv.cpp \ - ../../src/burner/sdl/inpdipsw.cpp \ - ../../src/burner/sdl/main.cpp \ - ../../src/burner/sdl/run.cpp \ - ../../src/burner/sdl/stated.cpp \ - ../../src/burner/sdl/stringset.cpp \ - ../../src/dep/libs/libpng/png.c \ - ../../src/dep/libs/libpng/pngerror.c \ - ../../src/dep/libs/libpng/pngget.c \ - ../../src/dep/libs/libpng/pngmem.c \ - ../../src/dep/libs/libpng/pngpread.c \ - ../../src/dep/libs/libpng/pngread.c \ - ../../src/dep/libs/libpng/pngrio.c \ - ../../src/dep/libs/libpng/pngrtran.c \ - ../../src/dep/libs/libpng/pngrutil.c \ - ../../src/dep/libs/libpng/pngset.c \ - ../../src/dep/libs/libpng/pngtrans.c \ - ../../src/dep/libs/libpng/pngwio.c \ - ../../src/dep/libs/libpng/pngwrite.c \ - ../../src/dep/libs/libpng/pngwtran.c \ - ../../src/dep/libs/libpng/pngwutil.c \ - ../../src/dep/libs/zlib/adler32.c \ - ../../src/dep/libs/zlib/compress.c \ - ../../src/dep/libs/zlib/crc32.c \ - ../../src/dep/libs/zlib/deflate.c \ - ../../src/dep/libs/zlib/gzclose.c \ - ../../src/dep/libs/zlib/gzlib.c \ - ../../src/dep/libs/zlib/gzread.c \ - ../../src/dep/libs/zlib/gzwrite.c \ - ../../src/dep/libs/zlib/infback.c \ - ../../src/dep/libs/zlib/inffast.c \ - ../../src/dep/libs/zlib/inflate.c \ - ../../src/dep/libs/zlib/inftrees.c \ - ../../src/dep/libs/zlib/trees.c \ - ../../src/dep/libs/zlib/uncompr.c \ - ../../src/dep/libs/zlib/zutil.c \ - ../../src/intf/interface.cpp \ - ../../src/intf/audio/aud_dsp.cpp \ - ../../src/intf/audio/aud_interface.cpp \ - ../../src/intf/audio/lowpass2.cpp \ - ../../src/intf/audio/sdl/aud_sdl.cpp \ - ../../src/intf/cd/cd_interface.cpp \ - ../../src/intf/input/inp_interface.cpp \ - ../../src/intf/input/sdl/inp_sdl.cpp \ - ../../src/intf/video/vid_interface.cpp \ - ../../src/intf/video/vid_support.cpp \ - ../../src/intf/video/sdl/vid_sdlfx.cpp \ - ../../src/intf/video/sdl/vid_sdlopengl.cpp \ - ../../src/cpu/z80_intf.cpp \ - ../../src/burner/libretro/neocdlist.cpp \ - ../../src/intf/video/vid_softfx.cpp \ - ../../src/intf/video/scalers/2xpm.cpp \ - ../../src/intf/video/scalers/2xsai.cpp \ - ../../src/intf/video/scalers/ddt3x.cpp \ - ../../src/intf/video/scalers/epx.cpp \ - ../../src/intf/video/scalers/hq2xs_16.cpp \ - ../../src/intf/video/scalers/hq2xs.cpp \ - ../../src/intf/video/scalers/xbr.cpp - -HEADERS += \ - ../../src/burn/devices/8255ppi.h \ - ../../src/burn/devices/8257dma.h \ - ../../src/burn/devices/eeprom.h \ - ../../src/burn/devices/pandora.h \ - ../../src/burn/devices/seibusnd.h \ - ../../src/burn/devices/sknsspr.h \ - ../../src/burn/devices/slapstic.h \ - ../../src/burn/devices/t5182.h \ - ../../src/burn/devices/timekpr.h \ - ../../src/burn/devices/tms34061.h \ - ../../src/burn/devices/v3021.h \ - ../../src/burn/devices/vdc.h \ - ../../src/burn/snd/ay8910.h \ - ../../src/burn/snd/burn_y8950.h \ - ../../src/burn/snd/burn_ym2151.h \ - ../../src/burn/snd/burn_ym2203.h \ - ../../src/burn/snd/burn_ym2413.h \ - ../../src/burn/snd/burn_ym2608.h \ - ../../src/burn/snd/burn_ym2610.h \ - ../../src/burn/snd/burn_ym2612.h \ - ../../src/burn/snd/burn_ym3526.h \ - ../../src/burn/snd/burn_ym3812.h \ - ../../src/burn/snd/burn_ymf278b.h \ - ../../src/burn/snd/c6280.h \ - ../../src/burn/snd/dac.h \ - ../../src/burn/snd/es5506.h \ - ../../src/burn/snd/es8712.h \ - ../../src/burn/snd/flt_rc.h \ - ../../src/burn/snd/fm.h \ - ../../src/burn/snd/fmopl.h \ - ../../src/burn/snd/ics2115.h \ - ../../src/burn/snd/iremga20.h \ - ../../src/burn/snd/k005289.h \ - ../../src/burn/snd/k007232.h \ - ../../src/burn/snd/k051649.h \ - ../../src/burn/snd/k053260.h \ - ../../src/burn/snd/k054539.h \ - ../../src/burn/snd/msm5205.h \ - ../../src/burn/snd/msm5232.h \ - ../../src/burn/snd/msm6295.h \ - ../../src/burn/snd/namco_snd.h \ - ../../src/burn/snd/nes_apu.h \ - ../../src/burn/snd/nes_defs.h \ - ../../src/burn/snd/rescap.h \ - ../../src/burn/snd/rf5c68.h \ - ../../src/burn/snd/saa1099.h \ - ../../src/burn/snd/samples.h \ - ../../src/burn/snd/segapcm.h \ - ../../src/burn/snd/sn76496.h \ - ../../src/burn/snd/upd7759.h \ - ../../src/burn/snd/vlm5030.h \ - ../../src/burn/snd/x1010.h \ - ../../src/burn/snd/ym2151.h \ - ../../src/burn/snd/ym2413.h \ - ../../src/burn/snd/ymdeltat.h \ - ../../src/burn/snd/ymf278b.h \ - ../../src/burn/snd/ymz280b.h \ - ../../src/burn/burn_sound.h \ - ../../src/burn/burn.h \ - ../../src/burn/burnint.h \ - ../../src/burn/cheat.h \ - ../../src/burn/driver.h \ - ../../src/burn/hiscore.h \ - ../../src/burn/state.h \ - ../../src/burn/stdfunc.h \ - ../../src/burn/tiles_generic.h \ - ../../src/burn/timer.h \ - ../../src/burn/vector.h \ - ../../src/burn/version.h \ - ../../src/burn/burn_led.h \ - ../../src/burn/burn_gun.h \ - ../../src/burn/bitswap.h \ - ../../src/cpu/h6280_intf.h \ - ../../src/cpu/hd6309_intf.h \ - ../../src/cpu/konami_intf.h \ - ../../src/cpu/m6502_intf.h \ - ../../src/cpu/m6800_intf.h \ - ../../src/cpu/m6805_intf.h \ - ../../src/cpu/m6809_intf.h \ - ../../src/cpu/m68000_debug.h \ - ../../src/cpu/m68000_intf.h \ - ../../src/cpu/nec_intf.h \ - ../../src/cpu/pic16c5x_intf.h \ - ../../src/cpu/s2650_intf.h \ - ../../src/cpu/arm7_intf.h \ - ../../src/cpu/arm_intf.h \ - ../../src/cpu/arm7/arm7core.h \ - ../../src/cpu/h6280/h6280.h \ - ../../src/cpu/h6280/h6280ops.h \ - ../../src/cpu/hd6309/hd6309.h \ - ../../src/cpu/i8039/i8039.h \ - ../../src/cpu/konami/konami.h \ - ../../src/cpu/m6502/ill02.h \ - ../../src/cpu/m6502/m6502.h \ - ../../src/cpu/m6502/ops02.h \ - ../../src/cpu/m6502/opsc02.h \ - ../../src/cpu/m6502/opsn2a03.h \ - ../../src/cpu/m6800/m6800.h \ - ../../src/cpu/m6805/m6805.h \ - ../../src/cpu/m6809/m6809.h \ - ../../src/cpu/nec/nec.h \ - ../../src/cpu/nec/necea.h \ - ../../src/cpu/nec/necinstr.h \ - ../../src/cpu/nec/necmacro.h \ - ../../src/cpu/nec/necmodrm.h \ - ../../src/cpu/nec/necpriv.h \ - ../../src/cpu/nec/v25instr.h \ - ../../src/cpu/nec/v25priv.h \ - ../../src/cpu/pic16c5x/pic16c5x.h \ - ../../src/cpu/s2650/s2650.h \ - ../../src/cpu/z80/z80.h \ - ../../src/cpu/z80/z80daisy.h \ - ../../src/cpu/m68k/m68kcpu.h \ - ../../src/cpu/m68k/m68kconf.h \ - ../../src/burner/burner.h \ - ../../src/burner/gameinp.h \ - ../../src/burner/ioapi.h \ - ../../src/burner/neocdlist.h \ - ../../src/burner/title.h \ - ../../src/burner/unzip.h \ - ../../src/burner/sdl/tchar.h \ - ../../src/dep/libs/libpng/png.h \ - ../../src/dep/libs/libpng/pngconf.h \ - ../../src/dep/libs/libpng/pngdebug.h \ - ../../src/dep/libs/libpng/pnginfo.h \ - ../../src/dep/libs/libpng/pnglibconf.h \ - ../../src/dep/libs/libpng/pngpriv.h \ - ../../src/dep/libs/libpng/pngstruct.h \ - ../../src/dep/libs/zlib/crc32.h \ - ../../src/dep/libs/zlib/deflate.h \ - ../../src/dep/libs/zlib/gzguts.h \ - ../../src/dep/libs/zlib/inffast.h \ - ../../src/dep/libs/zlib/inffixed.h \ - ../../src/dep/libs/zlib/inflate.h \ - ../../src/dep/libs/zlib/inftrees.h \ - ../../src/dep/libs/zlib/trees.h \ - ../../src/dep/libs/zlib/zconf.h \ - ../../src/dep/libs/zlib/zconf.h.in \ - ../../src/dep/libs/zlib/zlib.h \ - ../../src/dep/libs/zlib/zutil.h \ - ../../src/intf/interface.h \ - ../../src/intf/audio/aud_dsp.h \ - ../../src/intf/audio/lowpass2.h \ - ../../src/intf/cd/cd_interface.h \ - ../../src/intf/input/inp_keys.h \ - ../../src/intf/input/sdl/inp_sdl_keys.h \ - ../../src/intf/video/vid_support.h \ - ../../src/burner/sdl/burner_sdl.h \ - ../../src/cpu/sh2_intf.h \ - ../../src/cpu/z80_intf.h \ - ../../src/intf/video/vid_softfx.h \ - ../../src/intf/video/scalers/hq_shared32.h \ - ../../src/intf/video/scalers/hq2xs.h \ - ../../src/intf/video/scalers/hq3xs.h \ - ../../src/intf/video/scalers/interp.h \ - ../../src/intf/video/scalers/scale2x_vc.h \ - ../../src/intf/video/scalers/scale2x.h \ - ../../src/intf/video/scalers/scale3x.h \ - ../../src/intf/video/scalers/xbr.h - -OTHER_FILES += diff --git a/jan/projectfiles/visualstudio-2003-libretro-xbox1/fba_vs2003_libretro_xbox1.sln b/jan/projectfiles/visualstudio-2003-libretro-xbox1/fba_vs2003_libretro_xbox1.sln deleted file mode 100644 index d606ab40a..000000000 --- a/jan/projectfiles/visualstudio-2003-libretro-xbox1/fba_vs2003_libretro_xbox1.sln +++ /dev/null @@ -1,30 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "visualstudio-2003-libretro-xbox1", "fba_vs2003_libretro_xbox1.vcproj", "{812368D1-1F0C-4480-81F1-7FB1EC247E58}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Profile = Profile - Profile_FastCap = Profile_FastCap - Release = Release - Release_LTCG = Release_LTCG - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Debug.ActiveCfg = Debug|Xbox - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Debug.Build.0 = Debug|Xbox - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Profile.ActiveCfg = Profile|Xbox - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Profile.Build.0 = Profile|Xbox - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Profile_FastCap.ActiveCfg = Profile_FastCap|Xbox - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Profile_FastCap.Build.0 = Profile_FastCap|Xbox - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Release.ActiveCfg = Release|Xbox - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Release.Build.0 = Release|Xbox - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Release_LTCG.ActiveCfg = Release_LTCG|Xbox - {812368D1-1F0C-4480-81F1-7FB1EC247E58}.Release_LTCG.Build.0 = Release_LTCG|Xbox - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/jan/projectfiles/visualstudio-2003-libretro-xbox1/fba_vs2003_libretro_xbox1.vcproj b/jan/projectfiles/visualstudio-2003-libretro-xbox1/fba_vs2003_libretro_xbox1.vcproj deleted file mode 100644 index a4b004389..000000000 --- a/jan/projectfiles/visualstudio-2003-libretro-xbox1/fba_vs2003_libretro_xbox1.vcproj +++ /dev/null @@ -1,3112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jan/projectfiles/visualstudio-2003-libretro-xbox1/stdint.h b/jan/projectfiles/visualstudio-2003-libretro-xbox1/stdint.h deleted file mode 100644 index 9d8fe7b0a..000000000 --- a/jan/projectfiles/visualstudio-2003-libretro-xbox1/stdint.h +++ /dev/null @@ -1,249 +0,0 @@ -// ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2008 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. The name of the author may be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// -#ifndef __RARCH_STDINT_H -#define __RARCH_STDINT_H - -#if _MSC_VER && (_MSC_VER < 1600) -//pre-MSVC 2010 needs an implementation of stdint.h - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include - -// For Visual Studio 6 in C++ mode and for many Visual Studio versions when -// compiling for ARM we should wrap include with 'extern "C++" {}' -// or compiler give many errors like this: -// error C2733: second C linkage of overloaded function 'wmemchr' not allowed -#ifdef __cplusplus -extern "C" { -#endif -# include -#ifdef __cplusplus -} -#endif - -// Define _W64 macros to mark types changing their size, like intptr_t. -#ifndef _W64 -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif -#endif - - -// 7.18.1 Integer types - -// 7.18.1.1 Exact-width integer types - -// Visual Studio 6 and Embedded Visual C++ 4 doesn't -// realize that, e.g. char has the same size as __int8 -// so we give up on __intX for them. -#if (_MSC_VER < 1300) - typedef signed char int8_t; - typedef signed short int16_t; - typedef signed int int32_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; -#else - typedef signed __int8 int8_t; - typedef signed __int16 int16_t; - typedef signed __int32 int32_t; - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; -#endif -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - - -// 7.18.1.2 Minimum-width integer types -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -typedef int64_t int_least64_t; -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -typedef uint64_t uint_least64_t; - -// 7.18.1.3 Fastest minimum-width integer types -typedef int8_t int_fast8_t; -typedef int16_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef int64_t int_fast64_t; -typedef uint8_t uint_fast8_t; -typedef uint16_t uint_fast16_t; -typedef uint32_t uint_fast32_t; -typedef uint64_t uint_fast64_t; - -// 7.18.1.4 Integer types capable of holding object pointers -#ifdef _WIN64 // [ - typedef signed __int64 intptr_t; - typedef unsigned __int64 uintptr_t; -#else // _WIN64 ][ - typedef _W64 signed int intptr_t; - typedef _W64 unsigned int uintptr_t; -#endif // _WIN64 ] - -// 7.18.1.5 Greatest-width integer types -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; - - -// 7.18.2 Limits of specified-width integer types - -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 - -// 7.18.2.1 Limits of exact-width integer types -#define INT8_MIN ((int8_t)_I8_MIN) -#define INT8_MAX _I8_MAX -#define INT16_MIN ((int16_t)_I16_MIN) -#define INT16_MAX _I16_MAX -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#define UINT8_MAX _UI8_MAX -#define UINT16_MAX _UI16_MAX -#define UINT32_MAX _UI32_MAX -#define UINT64_MAX _UI64_MAX - -// 7.18.2.2 Limits of minimum-width integer types -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MIN INT64_MIN -#define INT_LEAST64_MAX INT64_MAX -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -// 7.18.2.3 Limits of fastest minimum-width integer types -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MIN INT64_MIN -#define INT_FAST64_MAX INT64_MAX -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -// 7.18.2.4 Limits of integer types capable of holding object pointers -#ifdef _WIN64 // [ -# define INTPTR_MIN INT64_MIN -# define INTPTR_MAX INT64_MAX -# define UINTPTR_MAX UINT64_MAX -#else // _WIN64 ][ -# define INTPTR_MIN INT32_MIN -# define INTPTR_MAX INT32_MAX -# define UINTPTR_MAX UINT32_MAX -#endif // _WIN64 ] - -// 7.18.2.5 Limits of greatest-width integer types -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -// 7.18.3 Limits of other integer types - -#ifdef _WIN64 // [ -# define PTRDIFF_MIN _I64_MIN -# define PTRDIFF_MAX _I64_MAX -#else // _WIN64 ][ -# define PTRDIFF_MIN _I32_MIN -# define PTRDIFF_MAX _I32_MAX -#endif // _WIN64 ] - -#define SIG_ATOMIC_MIN INT_MIN -#define SIG_ATOMIC_MAX INT_MAX - -#ifndef SIZE_MAX // [ -# ifdef _WIN64 // [ -# define SIZE_MAX _UI64_MAX -# else // _WIN64 ][ -# define SIZE_MAX _UI32_MAX -# endif // _WIN64 ] -#endif // SIZE_MAX ] - -// WCHAR_MIN and WCHAR_MAX are also defined in -#ifndef WCHAR_MIN // [ -# define WCHAR_MIN 0 -#endif // WCHAR_MIN ] -#ifndef WCHAR_MAX // [ -# define WCHAR_MAX _UI16_MAX -#endif // WCHAR_MAX ] - -#define WINT_MIN 0 -#define WINT_MAX _UI16_MAX - -#endif // __STDC_LIMIT_MACROS ] - - -// 7.18.4 Limits of other integer types - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -#define INTMAX_C INT64_C -#define UINTMAX_C UINT64_C - -#endif // __STDC_CONSTANT_MACROS ] - -#else -//sanity for everything else -#include -#endif - -#endif diff --git a/jan/projectfiles/visualstudio-2003-libretro-xbox1/zconf.h b/jan/projectfiles/visualstudio-2003-libretro-xbox1/zconf.h deleted file mode 100644 index fa1e786ff..000000000 --- a/jan/projectfiles/visualstudio-2003-libretro-xbox1/zconf.h +++ /dev/null @@ -1,327 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* added for file_extractor; OK to remove, just increases executable size */ -#define DYNAMIC_CRC_TABLE - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define deflatePrime z_deflatePrime -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table -# define zError z_zError - -# define alloc_func z_alloc_func -# define free_func z_free_func -# define in_func z_in_func -# define out_func z_out_func -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -# ifdef FAR -# undef FAR -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/jan/projectfiles/visualstudio-2003-libretro-xbox1/zlib.h b/jan/projectfiles/visualstudio-2003-libretro-xbox1/zlib.h deleted file mode 100644 index e47687170..000000000 --- a/jan/projectfiles/visualstudio-2003-libretro-xbox1/zlib.h +++ /dev/null @@ -1,1357 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - const char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumualte before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - the value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, - Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() stop - if and when it gets to the next deflate block boundary. When decoding the - zlib or gzip format, this will cause inflate() to return immediately after - the header and before the first block. When doing a raw inflate, inflate() - will go ahead and process the first block, and will return when it gets to - the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 - if inflate() is currently decoding the last block in the deflate stream, - plus 128 if inflate() returned immediately after decoding an end-of-block - code or decoding the complete header up to just before the first byte of the - deflate stream. The end-of-block will not be indicated until all of the - uncompressed data from that block has been written to strm->next_out. The - number of unused bits may in general be greater than seven, except when - bit 7 of data_type is set, in which case the number of unused bits will be - less than eight. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster approach - may be used for the single inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() will decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically. Any information - contained in the gzip header is not retained, so applications that need that - information should instead use raw inflate, see inflateInit2() below, or - inflateBack() and perform their own processing of the gzip header and - trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may then - call inflateSync() to look for a good compression block if a partial recovery - of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as - Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy - parameter only affects the compression ratio but not the correctness of the - compressed output even if it is not set appropriately. Z_FIXED prevents the - use of dynamic Huffman codes, allowing for a simpler decoder for special - applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. In addition, the - current implementation of deflate will use at most the window size minus - 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() - or deflateInit2(). This would be used to allocate an output buffer - for deflation in a single pass, and so would be called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the - bits leftover from a previous deflate stream when appending to it. As such, - this function can only be used for raw deflate, and must be used before the - first deflate() call after a deflateInit2() or deflateReset(). bits must be - less than or equal to 16, and that many of the least significant bits of - value will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is - a crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg - is set to null if there is no error message. inflateInit2 does not perform - any decompression apart from reading the zlib header if present: this will - be done by inflate(). (So next_in and avail_in may be modified, but next_out - and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK can be used to - force inflate() to return immediately after header processing is complete - and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When - any of extra, name, or comment are not Z_NULL and the respective field is - not present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not - be allocated, or Z_VERSION_ERROR if the version of the library does not - match the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free - the allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects - only the raw deflate stream to decompress. This is different from the - normal behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format - error in the deflate stream (in which case strm->msg is set to indicate the - nature of the error), or Z_STREAM_ERROR if the stream was not properly - initialized. In the case of Z_BUF_ERROR, an input or output error can be - distinguished using strm->next_in which will be Z_NULL only if in() returned - an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to - out() returning non-zero. (in() will always be called before out(), so - strm->next_in is assured to be defined if out() returns non-zero.) Note - that inflateBack() cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least the value returned - by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before - a compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - -typedef voidp gzFile; - -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h", or 'R' for run-length encoding - as in "wb1R". (See the description of deflateInit2 for more information - about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). The number of - uncompressed bytes written is limited to 4095. The caller should assure that - this limit is not exceeded. If it is exceeded, then gzprintf() will return - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read again later. - Only one character of push-back is allowed. gzungetc() returns the - character pushed, or -1 on failure. gzungetc() will fail if a - character has been pushed but not read yet, or if c is -1. The pushed - character will be discarded if the stream is repositioned with gzseek() - or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns 1 if file is being read directly without decompression, otherwise - zero. -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); -/* - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is NULL, this function returns the required initial - value for the for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - -/* - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - - -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ -#endif - -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ diff --git a/jan/projectfiles/visualstudio-2010-libretro-360/fba_vs2010_libretro_360.sln b/jan/projectfiles/visualstudio-2010-libretro-360/fba_vs2010_libretro_360.sln deleted file mode 100644 index 17244b946..000000000 --- a/jan/projectfiles/visualstudio-2010-libretro-360/fba_vs2010_libretro_360.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libretro-msvc2010-360", "fba_vs2010_libretro_360.vcxproj", "{00AAF92F-A249-4DF2-AE24-0C5427DB319E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - CodeAnalysis|Xbox 360 = CodeAnalysis|Xbox 360 - Debug|Xbox 360 = Debug|Xbox 360 - Profile_FastCap|Xbox 360 = Profile_FastCap|Xbox 360 - Profile|Xbox 360 = Profile|Xbox 360 - Release_LTCG|Xbox 360 = Release_LTCG|Xbox 360 - Release|Xbox 360 = Release|Xbox 360 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.CodeAnalysis|Xbox 360.ActiveCfg = CodeAnalysis|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.CodeAnalysis|Xbox 360.Build.0 = CodeAnalysis|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Profile_FastCap|Xbox 360.ActiveCfg = Profile_FastCap|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Profile_FastCap|Xbox 360.Build.0 = Profile_FastCap|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Profile|Xbox 360.ActiveCfg = Profile|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Profile|Xbox 360.Build.0 = Profile|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Release_LTCG|Xbox 360.ActiveCfg = Release_LTCG|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Release_LTCG|Xbox 360.Build.0 = Release_LTCG|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 - {00AAF92F-A249-4DF2-AE24-0C5427DB319E}.Release|Xbox 360.Build.0 = Release|Xbox 360 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/jan/projectfiles/visualstudio-2010-libretro-360/fba_vs2010_libretro_360.vcxproj b/jan/projectfiles/visualstudio-2010-libretro-360/fba_vs2010_libretro_360.vcxproj deleted file mode 100644 index 6133770a1..000000000 --- a/jan/projectfiles/visualstudio-2010-libretro-360/fba_vs2010_libretro_360.vcxproj +++ /dev/null @@ -1,868 +0,0 @@ - - - - - CodeAnalysis - Xbox 360 - - - Debug - Xbox 360 - - - Profile - Xbox 360 - - - Profile_FastCap - Xbox 360 - - - Release - Xbox 360 - - - Release_LTCG - Xbox 360 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - - - - - - - - - - - - - - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - - - - - - - - - - - - - - - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - - - - - - true - - - true - - - - - - - true - - - - true - - - true - - - - - - - true - - - true - - - - - true - - - true - - - true - - - true - - - true - - - - - true - - - true - - - - - true - - - - - true - - - true - - - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - true - - - true - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - CompileAsC - - - true - - - - true - - - - true - - - true - - - - - - - - - - - {00AAF92F-A249-4DF2-AE24-0C5427DB319E} - Xbox360Proj - - - - StaticLibrary - MultiByte - - - StaticLibrary - MultiByte - - - StaticLibrary - MultiByte - - - StaticLibrary - MultiByte - - - StaticLibrary - MultiByte - true - - - StaticLibrary - true - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - $(OutDir)$(ProjectName).lib - - - $(OutDir)$(ProjectName).lib - - - $(OutDir)$(ProjectName).lib - - - $(OutDir)$(ProjectName).lib - - - $(OutDir)libretro$(TargetExt) - - - $(OutDir)$(ProjectName).lib - - - - NotUsing - Level3 - ProgramDatabase - Disabled - false - true - false - $(OutDir)$(ProjectName).pch - MultiThreadedDebug - _DEBUG;_XBOX;_XBOX360;_LIB;%(PreprocessorDefinitions);USE_SPEEDHACKS;__LIBRETRO__;INLINE=__inline static;EXTERNAL_ZLIB;__fastcall=;MAME_INLINE=_inline static;MSB_FIRST;__LIBRETRO_OPTIMIZATIONS__;FRONTEND_SUPPORTS_RGB565 - Callcap - $(SolutionDir)\..\..\src\burn\drv\taito;$(SolutionDir)\..\..\src\dep\generated;$(SolutionDir)\..\..\src\burner\libretro;$(SolutionDir)\..\..\src\burner;$(SolutionDir)\..\..\src\burn;$(SolutionDir)\..\..\src\burn\drv\pgm;$(SolutionDir)\..\..\src\burn\devices;$(SolutionDir)\..\..\src\burn\snd;$(SolutionDir)\..\..\src\cpu\;$(SolutionDir)\..\..\src\cpu\arm;$(SolutionDir)\..\..\src\cpu\arm7;$(SolutionDir)\..\..\src\cpu\h6280;$(SolutionDir)\..\..\src\cpu\hd6309;$(SolutionDir)\..\..\src\cpu\i8039;$(SolutionDir)\..\..\src\cpu\konami;$(SolutionDir)\..\..\src\cpu\m6502;$(SolutionDir)\..\..\src\cpu\m6800;$(SolutionDir)\..\..\src\cpu\m6805;$(SolutionDir)\..\..\src\cpu\m6809;$(SolutionDir)\..\..\src\cpu\m68k;$(SolutionDir)\..\..\src\cpu\nec;$(SolutionDir)\..\..\src\cpu\s2650;$(SolutionDir)\..\..\src\cpu\sh2;$(SolutionDir)\..\..\src\cpu\z80;$(SolutionDir)\..\..\src\intf\input;$(SolutionDir)\..\..\src\intf;$(SolutionDir)\..\..\src\dep\libs\zlib;$(SolutionDir)\..\..\src\intf\cd - true - - - true - - - - - NotUsing - Level4 - ProgramDatabase - Disabled - false - true - AnalyzeOnly - false - $(OutDir)$(ProjectName).pch - MultiThreadedDebug - _DEBUG;_XBOX;_XBOX360;_LIB;%(PreprocessorDefinitions);USE_SPEEDHACKS;__LIBRETRO__;INLINE=__inline static;EXTERNAL_ZLIB;__fastcall=;MAME_INLINE=_inline static;MSB_FIRST;__LIBRETRO_OPTIMIZATIONS__;FRONTEND_SUPPORTS_RGB565 - Callcap - $(SolutionDir)\..\..\src\burn\drv\taito;$(SolutionDir)\..\..\src\dep\generated;$(SolutionDir)\..\..\src\burner\libretro;$(SolutionDir)\..\..\src\burner;$(SolutionDir)\..\..\src\burn;$(SolutionDir)\..\..\src\burn\drv\pgm;$(SolutionDir)\..\..\src\burn\devices;$(SolutionDir)\..\..\src\burn\snd;$(SolutionDir)\..\..\src\cpu\;$(SolutionDir)\..\..\src\cpu\arm;$(SolutionDir)\..\..\src\cpu\arm7;$(SolutionDir)\..\..\src\cpu\h6280;$(SolutionDir)\..\..\src\cpu\hd6309;$(SolutionDir)\..\..\src\cpu\i8039;$(SolutionDir)\..\..\src\cpu\konami;$(SolutionDir)\..\..\src\cpu\m6502;$(SolutionDir)\..\..\src\cpu\m6800;$(SolutionDir)\..\..\src\cpu\m6805;$(SolutionDir)\..\..\src\cpu\m6809;$(SolutionDir)\..\..\src\cpu\m68k;$(SolutionDir)\..\..\src\cpu\nec;$(SolutionDir)\..\..\src\cpu\s2650;$(SolutionDir)\..\..\src\cpu\sh2;$(SolutionDir)\..\..\src\cpu\z80;$(SolutionDir)\..\..\src\intf\input;$(SolutionDir)\..\..\src\intf;$(SolutionDir)\..\..\src\dep\libs\zlib;$(SolutionDir)\..\..\src\intf\cd - true - - - true - - - - - Level3 - NotUsing - Full - true - false - true - ProgramDatabase - Size - false - $(OutDir)$(ProjectName).pch - MultiThreaded - NDEBUG;_XBOX;_XBOX360;PROFILE;_LIB;%(PreprocessorDefinitions);USE_SPEEDHACKS;__LIBRETRO__;INLINE=__inline static;EXTERNAL_ZLIB;__fastcall=;MAME_INLINE=_inline static;MSB_FIRST;__LIBRETRO_OPTIMIZATIONS__;FRONTEND_SUPPORTS_RGB565 - Callcap - $(SolutionDir)\..\..\src\burn\drv\taito;$(SolutionDir)\..\..\src\dep\generated;$(SolutionDir)\..\..\src\burner\libretro;$(SolutionDir)\..\..\src\burner;$(SolutionDir)\..\..\src\burn;$(SolutionDir)\..\..\src\burn\drv\pgm;$(SolutionDir)\..\..\src\burn\devices;$(SolutionDir)\..\..\src\burn\snd;$(SolutionDir)\..\..\src\cpu\;$(SolutionDir)\..\..\src\cpu\arm;$(SolutionDir)\..\..\src\cpu\arm7;$(SolutionDir)\..\..\src\cpu\h6280;$(SolutionDir)\..\..\src\cpu\hd6309;$(SolutionDir)\..\..\src\cpu\i8039;$(SolutionDir)\..\..\src\cpu\konami;$(SolutionDir)\..\..\src\cpu\m6502;$(SolutionDir)\..\..\src\cpu\m6800;$(SolutionDir)\..\..\src\cpu\m6805;$(SolutionDir)\..\..\src\cpu\m6809;$(SolutionDir)\..\..\src\cpu\m68k;$(SolutionDir)\..\..\src\cpu\nec;$(SolutionDir)\..\..\src\cpu\s2650;$(SolutionDir)\..\..\src\cpu\sh2;$(SolutionDir)\..\..\src\cpu\z80;$(SolutionDir)\..\..\src\intf\input;$(SolutionDir)\..\..\src\intf;$(SolutionDir)\..\..\src\dep\libs\zlib;$(SolutionDir)\..\..\src\intf\cd - true - - - true - false - xapilib.lib;%(IgnoreSpecificDefaultLibraries) - true - - - - - Level3 - NotUsing - Full - true - false - true - ProgramDatabase - Fastcap - Size - false - $(OutDir)$(ProjectName).pch - MultiThreaded - NDEBUG;_XBOX;_XBOX360;PROFILE;FASTCAP;_LIB;%(PreprocessorDefinitions);USE_SPEEDHACKS;__LIBRETRO__;INLINE=__inline static;EXTERNAL_ZLIB;__fastcall=;MAME_INLINE=_inline static;MSB_FIRST;__LIBRETRO_OPTIMIZATIONS__;FRONTEND_SUPPORTS_RGB565 - $(SolutionDir)\..\..\src\burn\drv\taito;$(SolutionDir)\..\..\src\generated;$(SolutionDir)\..\..\src\burner\libretro;$(SolutionDir)\..\..\src\burner;$(SolutionDir)\..\..\src\burn;$(SolutionDir)\..\..\src\burn\drv\pgm;$(SolutionDir)\..\..\src\burn\devices;$(SolutionDir)\..\..\src\burn\snd;$(SolutionDir)\..\..\src\cpu\;$(SolutionDir)\..\..\src\cpu\arm;$(SolutionDir)\..\..\src\cpu\arm7;$(SolutionDir)\..\..\src\cpu\h6280;$(SolutionDir)\..\..\src\cpu\hd6309;$(SolutionDir)\..\..\src\cpu\i8039;$(SolutionDir)\..\..\src\cpu\konami;$(SolutionDir)\..\..\src\cpu\m6502;$(SolutionDir)\..\..\src\cpu\m6800;$(SolutionDir)\..\..\src\cpu\m6805;$(SolutionDir)\..\..\src\cpu\m6809;$(SolutionDir)\..\..\src\cpu\m68k;$(SolutionDir)\..\..\src\cpu\nec;$(SolutionDir)\..\..\src\cpu\s2650;$(SolutionDir)\..\..\src\cpu\sh2;$(SolutionDir)\..\..\src\cpu\z80;$(SolutionDir)\..\..\src\intf\input;$(SolutionDir)\..\..\src\intf;$(SolutionDir)\..\..\src\dep\libs\zlib;$(SolutionDir)\..\..\src\intf\cd - true - - - true - false - true - - - - - Level3 - NotUsing - Full - true - true - ProgramDatabase - Size - false - false - $(OutDir)$(ProjectName).pch - MultiThreaded - NDEBUG;_XBOX;_XBOX360;_LIB;%(PreprocessorDefinitions);USE_SPEEDHACKS;__LIBRETRO__;INLINE=__inline static;EXTERNAL_ZLIB;__fastcall=;MAME_INLINE=_inline static;MSB_FIRST;__LIBRETRO_OPTIMIZATIONS__;FRONTEND_SUPPORTS_RGB565 - $(SolutionDir)\..\..\src\burn\drv\taito;$(SolutionDir)\..\..\src\dep\generated;$(SolutionDir)\..\..\src\burner\libretro;$(SolutionDir)\..\..\src\burner;$(SolutionDir)\..\..\src\burn;$(SolutionDir)\..\..\src\burn\drv\pgm;$(SolutionDir)\..\..\src\burn\devices;$(SolutionDir)\..\..\src\burn\snd;$(SolutionDir)\..\..\src\cpu\;$(SolutionDir)\..\..\src\cpu\arm;$(SolutionDir)\..\..\src\cpu\arm7;$(SolutionDir)\..\..\src\cpu\h6280;$(SolutionDir)\..\..\src\cpu\hd6309;$(SolutionDir)\..\..\src\cpu\i8039;$(SolutionDir)\..\..\src\cpu\konami;$(SolutionDir)\..\..\src\cpu\m6502;$(SolutionDir)\..\..\src\cpu\m6800;$(SolutionDir)\..\..\src\cpu\m6805;$(SolutionDir)\..\..\src\cpu\m6809;$(SolutionDir)\..\..\src\cpu\m68k;$(SolutionDir)\..\..\src\cpu\nec;$(SolutionDir)\..\..\src\cpu\s2650;$(SolutionDir)\..\..\src\cpu\sh2;$(SolutionDir)\..\..\src\cpu\z80;$(SolutionDir)\..\..\src\intf\input;$(SolutionDir)\..\..\src\intf;$(SolutionDir)\..\..\src\dep\libs\zlib;$(SolutionDir)\..\..\src\intf\cd - true - true - - - true - true - true - - - - - Level3 - NotUsing - Full - true - true - ProgramDatabase - Size - false - false - $(OutDir)$(ProjectName).pch - MultiThreaded - NDEBUG;_XBOX;_XBOX360;LTCG;_LIB;%(PreprocessorDefinitions);USE_SPEEDHACKS;__LIBRETRO__;INLINE=__inline static;EXTERNAL_ZLIB;__fastcall=;MAME_INLINE=_inline static;MSB_FIRST;__LIBRETRO_OPTIMIZATIONS__;FRONTEND_SUPPORTS_RGB565 - $(SolutionDir)\..\..\src\burn\drv\taito;$(SolutionDir)\..\..\src\dep\generated;$(SolutionDir)\..\..\src\burner\libretro;$(SolutionDir)\..\..\src\burner;$(SolutionDir)\..\..\src\burn;$(SolutionDir)\..\..\src\burn\drv\pgm;$(SolutionDir)\..\..\src\burn\devices;$(SolutionDir)\..\..\src\burn\snd;$(SolutionDir)\..\..\src\cpu\;$(SolutionDir)\..\..\src\cpu\arm;$(SolutionDir)\..\..\src\cpu\arm7;$(SolutionDir)\..\..\src\cpu\h6280;$(SolutionDir)\..\..\src\cpu\hd6309;$(SolutionDir)\..\..\src\cpu\i8039;$(SolutionDir)\..\..\src\cpu\konami;$(SolutionDir)\..\..\src\cpu\m6502;$(SolutionDir)\..\..\src\cpu\m6800;$(SolutionDir)\..\..\src\cpu\m6805;$(SolutionDir)\..\..\src\cpu\m6809;$(SolutionDir)\..\..\src\cpu\m68k;$(SolutionDir)\..\..\src\cpu\nec;$(SolutionDir)\..\..\src\cpu\s2650;$(SolutionDir)\..\..\src\cpu\sh2;$(SolutionDir)\..\..\src\cpu\z80;$(SolutionDir)\..\..\src\intf\input;$(SolutionDir)\..\..\src\intf;$(SolutionDir)\..\..\src\dep\libs\zlib;$(SolutionDir)\..\..\src\intf\cd - true - - - true - true - true - - - - - - \ No newline at end of file diff --git a/jan/projectfiles/visualstudio-2010-libretro-360/fba_vs2010_libretro_360.vcxproj.filters b/jan/projectfiles/visualstudio-2010-libretro-360/fba_vs2010_libretro_360.vcxproj.filters deleted file mode 100644 index ba2a5bacf..000000000 --- a/jan/projectfiles/visualstudio-2010-libretro-360/fba_vs2010_libretro_360.vcxproj.filters +++ /dev/null @@ -1,1611 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {5934b0a0-a392-46b1-a6b9-85680f426502} - - - {7c7aaba6-9639-446b-97ad-78934fe6257e} - - - {19ce1c3e-fbdf-4f4c-a2c5-b388e3d5b300} - - - {80c3d021-c22f-4966-a9ed-200bf11c7711} - - - {9b42773a-1929-47d0-8c89-956aef201ae0} - - - {bb09c40c-3bc8-4b28-b784-b6cd023e5512} - - - {be7d8be7-fecc-423c-aea1-1f2afd87d36a} - - - {5d6ecda8-d51d-45e8-b3f7-82eea2707c27} - - - {6b45ac37-2362-4d09-9622-46a3bcf7d68d} - - - {25e3cd1c-1fcc-41de-a4c4-cd2b8b496a0a} - - - {f5b330a7-4220-4c25-99e1-0d96dff79849} - - - {414d8631-5515-4093-92ea-b4a8bf383345} - - - {5325ef73-60f6-4b8b-9aab-44d0121e1981} - - - {fbab1812-0ae7-4ddd-83f8-94aee0284c9e} - - - {ab923f25-32a8-42c7-bd0f-6ed2c688ca11} - - - {610fa212-4405-452d-a849-fb70d7e0ef63} - - - {8c63af19-d7d7-4531-84d1-9bf349c8a8e3} - - - {b7f20cc9-683f-43c2-bc98-e62b2fd559dc} - - - {e5072976-2218-4f59-ad88-781c310d79c5} - - - {25acca22-2077-4e00-bdbf-14bc6d910891} - - - {af0f0827-8ccc-419c-8050-7a5cd3fa65df} - - - {4424fa18-bbca-4bf9-bb5c-b587e15a1bdd} - - - {5a0edcb9-76f2-48c3-937c-4fe535375637} - - - {98d5634b-00af-461d-b1e8-5ddb78a01358} - - - {8038da63-c558-4a07-b86c-5dfbbac7a440} - - - {d52a4de1-1f51-4ec6-be1b-69678b7abf9c} - - - {a37ddb81-83fd-4d7e-9d51-32ae6213552a} - - - {feedda35-2155-4f29-8d40-0c37531357d0} - - - {2490bcbc-49fd-44af-905f-bd2457903f9f} - - - {132bbd53-5e65-4def-93c9-6965688b90e8} - - - {eb5987df-30e3-4820-bdc9-994f6a6e1296} - - - {65990e1c-3971-4672-b2a9-dcacaac8a82b} - - - {95c99912-6a6e-4b1d-804d-a8fa62290a5a} - - - {64a01927-1d33-44c6-b011-22c0b88fa1b1} - - - {a16f8dee-998c-4c1c-a8a2-787b8191c4b5} - - - {6f9fd21b-f948-49f2-b50d-55ebd40a2c1a} - - - {44d80511-457a-4de2-81ef-0324f6950b51} - - - {56be89cb-445f-47cf-8d08-654f93832a11} - - - {aa239b2a-4448-46ed-aa06-51a84303473a} - - - {7f4ef354-8a73-47f9-9c04-9924b98358ff} - - - - - Source Files\burn\drv\cps3 - - - Source Files\burn\drv\cps3 - - - Source Files\burn\drv\cps3 - - - Source Files\burner - - - Source Files\burner - - - Source Files\burner - - - Source Files\burner - - - Source Files\burner - - - Source Files\burn\drv\snes - - - Source Files\burn\drv\snes - - - Source Files\burn\drv\snes - - - Source Files\burn\drv\snes - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\cave - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\dataeast - - - Source Files\burn\drv\galaxian - - - Source Files\burn\drv\galaxian - - - Source Files\burn\drv\galaxian - - - Source Files\burn\drv\galaxian - - - Source Files\burn\drv\galaxian - - - Source Files\burn\drv\irem - - - Source Files\burn\drv\irem - - - Source Files\burn\drv\irem - - - Source Files\burn\drv\irem - - - Source Files\burn\drv\irem - - - Source Files\burn\drv\irem - - - Source Files\burn\drv\irem - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\konami - - - Source Files\burn\drv\megadrive - - - Source Files\burn\drv\megadrive - - - Source Files\burn\drv\neogeo - - - Source Files\burn\drv\neogeo - - - Source Files\burn\drv\neogeo - - - Source Files\burn\drv\neogeo - - - Source Files\burn\drv\neogeo - - - Source Files\burn\drv\neogeo - - - Source Files\burn\drv\neogeo - - - Source Files\burn\drv\neogeo - - - Source Files\burn\drv\pce - - - Source Files\burn\drv\pce - - - Source Files\burn\drv\pgm - - - Source Files\burn\drv\pgm - - - Source Files\burn\drv\pgm - - - Source Files\burn\drv\pgm - - - Source Files\burn\drv\pgm - - - Source Files\burn\drv\pgm - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\psikyo - - - Source Files\burn\drv\psikyo - - - Source Files\burn\drv\psikyo - - - Source Files\burn\drv\psikyo - - - Source Files\burn\drv\psikyo - - - Source Files\burn\drv\psikyo - - - Source Files\burn\drv\psikyo - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\sega - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\taito - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\drv\toaplan - - - Source Files\burn\devices - - - Source Files\burn\devices - - - Source Files\burn\devices - - - Source Files\burn\devices - - - Source Files\burn\devices - - - Source Files\burn\devices - - - Source Files\burn\devices - - - Source Files\burn\devices - - - Source Files\cpu\arm - - - Source Files\cpu\arm7 - - - Source Files\cpu\arm7 - - - Source Files\cpu\arm7 - - - Source Files\cpu\h6280 - - - Source Files\cpu\h6280 - - - Source Files\cpu\hd6309 - - - Source Files\cpu\hd6309 - - - Source Files\cpu\hd6309 - - - Source Files\cpu\i8039 - - - Source Files\cpu\konami - - - Source Files\cpu\konami - - - Source Files\cpu\konami - - - Source Files\cpu\sh2 - - - Source Files\cpu\z80 - - - Source Files\cpu\z80 - - - Source Files\cpu\s2650 - - - Source Files\cpu\nec - - - Source Files\cpu\nec - - - Source Files\cpu\nec - - - Source Files\cpu\nec - - - Source Files\cpu\nec - - - Source Files\cpu\m68k - - - Source Files\cpu\m68k - - - Source Files\cpu\m68k - - - Source Files\cpu\m68k - - - Source Files\cpu\m6809 - - - Source Files\cpu\m6809 - - - Source Files\cpu\m6809 - - - Source Files\cpu\m6805 - - - Source Files\cpu\m6805 - - - Source Files\cpu\m6800 - - - Source Files\cpu\m6800 - - - Source Files\cpu\m6800 - - - Source Files\cpu\m6502 - - - Source Files\cpu\m6502 - - - Source Files\cpu\m6502 - - - Source Files\cpu\m6502 - - - Source Files\cpu\m6502 - - - Source Files\cpu\m6502 - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\burn\snd - - - Source Files\cpu\m68k - - - Source Files\cpu\m68k - - - Source Files\cpu\m68k - - - Source Files\cpu\m68k - - - Source Files\burner\libretro - - - Source Files\burner\libretro - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\capcom - - - Source Files\burn\drv\pst90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\burn\drv\pre90s - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\cpu - - - Source Files\burn\snd - - - Source Files\burn\drv\konami - - - Source Files\burn\devices - - - Source Files\burn\devices - - - \ No newline at end of file diff --git a/jan/projectfiles/visualstudio-2010/fba_vs2010.sln b/jan/projectfiles/visualstudio-2010/fba_vs2010.sln deleted file mode 100644 index d38382c2e..000000000 --- a/jan/projectfiles/visualstudio-2010/fba_vs2010.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fba_vs2010", "fba_vs2010.vcxproj", "{86D06C32-A849-4988-A176-A38D014C36C1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {86D06C32-A849-4988-A176-A38D014C36C1}.Debug|Win32.ActiveCfg = Debug|Win32 - {86D06C32-A849-4988-A176-A38D014C36C1}.Debug|Win32.Build.0 = Debug|Win32 - {86D06C32-A849-4988-A176-A38D014C36C1}.Debug|x64.ActiveCfg = Debug|x64 - {86D06C32-A849-4988-A176-A38D014C36C1}.Debug|x64.Build.0 = Debug|x64 - {86D06C32-A849-4988-A176-A38D014C36C1}.Release|Win32.ActiveCfg = Release|Win32 - {86D06C32-A849-4988-A176-A38D014C36C1}.Release|Win32.Build.0 = Release|Win32 - {86D06C32-A849-4988-A176-A38D014C36C1}.Release|x64.ActiveCfg = Debug|x64 - {86D06C32-A849-4988-A176-A38D014C36C1}.Release|x64.Build.0 = Debug|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/jan/projectfiles/visualstudio-2010/fba_vs2010.vcxproj b/jan/projectfiles/visualstudio-2010/fba_vs2010.vcxproj deleted file mode 100644 index 514e3be0f..000000000 --- a/jan/projectfiles/visualstudio-2010/fba_vs2010.vcxproj +++ /dev/null @@ -1,1018 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - Default - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ..\..\src\burner\;%(AdditionalIncludeDirectories) - - - - - {86D06C32-A849-4988-A176-A38D014C36C1} - fba_vs2010 - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - MultiByte - - - Application - false - true - MultiByte - - - - - - - - - - - - - - - - - - - C:\Program Files %28x86%29\Visual Leak Detector\include;..\..\src\dep\vc\include;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath) - $(SolutionDir)$(Configuration)\ - C:\Program Files %28x86%29\Visual Leak Detector\lib;$(LibraryPath) - - - src\depend\dx7\include;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath) - - - - Level3 - Disabled - ..\..\src\dep\libs\lib7z;..\..\src\burner\win32\resource;..\..\src\burn\drv\taito;..\..\src\burn\drv\misc_post90s;..\..\src\burn\devices;..\..\src\dep\generated;..\..\src\intf\audio\win32;..\..\src\intf\audio;..\..\src\intf\;..\..\src\intf\video\scalers;..\..\src\intf\video\win32;..\..\src\intf\video;..\..\src\intf\perfcount\win32;..\..\src\intf\perfcount;..\..\src\intf\input\win32;..\..\src\intf\input;..\..\src\intf\cd\win32;..\..\src\intf\cd;..\..\src\intf;..\..\src\burner\win32;..\..\src\dep\libs\zlib;..\..\src\dep\libs\libpng;..\..\src\dep\libs;..\..\src\dep\kaillera\client;..\..\src\dep\kaillera;..\..\src\burn\snd;..\..\src\cpu;..\..\src\burner;..\..\src\burn;..\..\src\cpu\z80;..\..\src\cpu\sh2;..\..\src\cpu\s2650;..\..\src\cpu\nec;..\..\src\cpu\m6809;..\..\src\cpu\m6805;..\..\src\cpu\m6800;..\..\src\cpu\m6502;..\..\src\cpu\m68k;..\..\src\cpu\i8039;..\..\src\cpu\konami;..\..\src\cpu\hd6309;..\..\src\cpu\h6280;..\..\src\cpu\arm7;..\..\src\cpu\arm;..\..\src\cpu\g65816;..\..\src\cpu\spc700;%(AdditionalIncludeDirectories) - Default - BUILD_WIN32;FASTCALL;_DEBUG;FBA_DEBUG;LSB_FIRST;INLINE=__inline static;INCLUDE_LIB_PNGH;C_INLINE=__inline;MAME_INLINE=__inline static;%(PreprocessorDefinitions) - - - true - C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;%(AdditionalLibraryDirectories) - LinkVerbose - user32.lib;gdi32.lib;comdlg32.lib;comctl32.lib;shell32.lib;winmm.lib;ole32.lib;shlwapi.lib;advapi32.lib;setupapi.lib;d3d9.lib;d3dx9.lib;dsound.lib;dinput8.lib;%(AdditionalDependencies) - false - - - $(MSBuildProjectDirectory)/../../src/dep/vs2010/pre.bat "$(VCInstallDir) - - - - - Level3 - Disabled - src\burn\drivers\taito;src\burn\drivers\misc_post90s;src\burn\devices;src\depend\generated;src\interface\scalers;src\interface\win32\resource;src\interface\win32;src\interface;src\burner\win32\resource;src\burner\win32;src\depend\libs\zlib;src\depend\libs\libpng;src\depend\libs;src\depend\kaillera\client;src\depend\kaillera;src\burn\sound;src\cpu;src\burner;src\burn;src\cpu\z80;src\cpu\sh2;src\cpu\s2650;src\cpu\nec;src\cpu\m6809;src\cpu\m6805;src\cpu\m6800;src\cpu\m6502;src\cpu\m68k;src\cpu\i8039;src\cpu\konami;src\cpu\hd6309;src\cpu\h6280;src\cpu\arm7;src\cpu\arm;%(AdditionalIncludeDirectories) - CompileAsCpp - BUILD_WIN32;FASTCALL;%(PreprocessorDefinitions) - - - true - C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;%(AdditionalLibraryDirectories) - LinkVerbose - user32.lib;gdi32.lib;comdlg32.lib;comctl32.lib;shell32.lib;winmm.lib;ole32.lib;shlwapi.lib;advapi32.lib;setupapi.lib;d3d9.lib;d3dx9.lib;dsound.lib;dinput8.lib;%(AdditionalDependencies) - false - - - - - Level3 - MaxSpeed - true - true - src\burn\drivers\taito;src\burn\drivers\misc_post90s;src\burn\devices;src\depend\generated;src\interface\scalers;src\interface\win32\resource;src\interface\win32;src\interface;src\burner\win32\resource;src\burner\win32;src\depend\libs\zlib;src\depend\libs\libpng;src\depend\libs;src\depend\kaillera\client;src\depend\kaillera;src\burn\sound;src\cpu;src\burner;src\burn;src\cpu\z80;src\cpu\sh2;src\cpu\s2650;src\cpu\nec;src\cpu\m6809;src\cpu\m6805;src\cpu\m6800;src\cpu\m6502;src\cpu\m68k;src\cpu\i8039;src\cpu\konami;src\cpu\hd6309;src\cpu\h6280;src\cpu\arm7;src\cpu\arm;%(AdditionalIncludeDirectories) - BUILD_WIN32;FASTCALL;_MBCS;%(PreprocessorDefinitions) - - - true - true - true - user32.lib;gdi32.lib;comdlg32.lib;comctl32.lib;shell32.lib;winmm.lib;ole32.lib;shlwapi.lib;advapi32.lib;setupapi.lib;d3d9.lib;d3dx9.lib;dsound.lib;dinput8.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - src\burn\drivers\taito;src\burn\drivers\misc_post90s;src\burn\devices;src\depend\generated;src\interface\scalers;src\interface\win32\resource;src\interface\win32;src\interface;src\burner\win32\resource;src\burner\win32;src\depend\libs\zlib;src\depend\libs\libpng;src\depend\libs;src\depend\kaillera\client;src\depend\kaillera;src\burn\sound;src\cpu;src\burner;src\burn;src\cpu\z80;src\cpu\sh2;src\cpu\s2650;src\cpu\nec;src\cpu\m6809;src\cpu\m6805;src\cpu\m6800;src\cpu\m6502;src\cpu\m68k;src\cpu\i8039;src\cpu\konami;src\cpu\hd6309;src\cpu\h6280;src\cpu\arm7;src\cpu\arm;%(AdditionalIncludeDirectories) - BUILD_WIN32;FASTCALL;_MBCS;%(PreprocessorDefinitions) - - - true - true - true - user32.lib;gdi32.lib;comdlg32.lib;comctl32.lib;shell32.lib;winmm.lib;ole32.lib;shlwapi.lib;advapi32.lib;setupapi.lib;d3d9.lib;d3dx9.lib;dsound.lib;dinput8.lib;%(AdditionalDependencies) - - - - - - \ No newline at end of file diff --git a/jan/projectfiles/visualstudio-2010/fba_vs2010.vcxproj.filters b/jan/projectfiles/visualstudio-2010/fba_vs2010.vcxproj.filters deleted file mode 100644 index d0a4de47c..000000000 --- a/jan/projectfiles/visualstudio-2010/fba_vs2010.vcxproj.filters +++ /dev/null @@ -1,2773 +0,0 @@ - - - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cps3 - - - Burn\drv\dataeast - - - Burn\drv\galaxian - - - Burn\drv\irem - - - Burn\drv\konami - - - Burn\drv\megadrive - - - Burn\drv\neogeo - - - Burn\drv\neogeo - - - Burn\drv\neogeo - - - Burn\drv\pce - - - Burn\drv\pgm - - - Burn\drv\psikyo - - - Burn\drv\psikyo - - - Burn\drv\psikyo - - - Burn\drv\psikyo - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\snes - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus\arm7 - - - cpus\h6280 - - - cpus\h6280 - - - cpus\hd6309 - - - cpus\i8039 - - - cpus\konami - - - cpus\m6502 - - - cpus\m6502 - - - cpus\m6502 - - - cpus\m6502 - - - cpus\m6502 - - - cpus\m6800 - - - cpus\m6805 - - - cpus - - - cpus\nec - - - cpus\nec - - - cpus\nec - - - cpus\nec - - - cpus\nec - - - cpus\nec - - - cpus\nec - - - cpus\nec - - - cpus\s2650 - - - cpus - - - cpus - - - cpus\m68k - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - interfaces - - - interfaces\audio - - - interfaces\audio - - - interfaces\audio\win32 - - - interfaces\cd - - - interfaces\cd\win32 - - - interfaces\input - - - interfaces\input\win32 - - - interfaces\video - - - interfaces\video - - - interfaces\video\win32 - - - interfaces\video\win32 - - - interfaces\video\win32 - - - interfaces\video\win32 - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - shitty networking code - - - shitty networking code - - - Burn\drv\sms - - - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\snd - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\devices - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\capcom - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cave - - - Burn\drv\cps3 - - - Burn\drv\cps3 - - - Burn\drv\cps3 - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\dataeast - - - Burn\drv\galaxian - - - Burn\drv\galaxian - - - Burn\drv\galaxian - - - Burn\drv\galaxian - - - Burn\drv\galaxian - - - Burn\drv\irem - - - Burn\drv\irem - - - Burn\drv\irem - - - Burn\drv\irem - - - Burn\drv\irem - - - Burn\drv\irem - - - Burn\drv\irem - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\konami - - - Burn\drv\megadrive - - - Burn\drv\megadrive - - - Burn\drv\neogeo - - - Burn\drv\neogeo - - - Burn\drv\neogeo - - - Burn\drv\neogeo - - - Burn\drv\neogeo - - - Burn\drv\neogeo - - - Burn\drv\neogeo - - - Burn\drv\neogeo - - - Burn\drv\pce - - - Burn\drv\pce - - - Burn\drv\pgm - - - Burn\drv\pgm - - - Burn\drv\pgm - - - Burn\drv\pgm - - - Burn\drv\pgm - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\pre90s - - - Burn\drv\psikyo - - - Burn\drv\psikyo - - - Burn\drv\psikyo - - - Burn\drv\psikyo - - - Burn\drv\psikyo - - - Burn\drv\psikyo - - - Burn\drv\psikyo - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\post90s - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\sega - - - Burn\drv\snes - - - Burn\drv\snes - - - Burn\drv\snes - - - Burn\drv\snes - - - Burn\drv\snes - - - Burn\drv\snes - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\taito - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - Burn\drv\toaplan - - - cpus\arm - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus - - - cpus\arm7 - - - cpus\h6280 - - - cpus\hd6309 - - - cpus\i8039 - - - cpus\konami - - - cpus\m6502 - - - cpus\m6800 - - - cpus\m6805 - - - cpus\nec - - - cpus\nec - - - cpus\s2650 - - - cpus\sh2 - - - cpus - - - cpus - - - cpus\m68k - - - cpus\m68k - - - cpus\m68k - - - cpus\m68k - - - cpus\m68k - - - cpus\m6809 - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - burner\win32 - - - interfaces - - - interfaces\audio - - - interfaces\audio - - - interfaces\audio - - - interfaces\audio\win32 - - - interfaces\audio\win32 - - - interfaces\audio\win32 - - - interfaces\cd - - - interfaces\cd\win32 - - - interfaces\cd\win32 - - - interfaces\input - - - interfaces\input\win32 - - - interfaces\input\win32 - - - interfaces\video - - - interfaces\video - - - interfaces\video - - - interfaces\video\win32 - - - interfaces\video\win32 - - - interfaces\video\win32 - - - interfaces\video\win32 - - - interfaces\video\win32 - - - interfaces\video\win32 - - - interfaces\video\win32 - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\perf - - - interfaces\perf\win32 - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\zlib - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\libpng - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - libs\7z - - - cpus\m68k - - - shitty networking code - - - Burn\drv\sms - - - Burn\drv\sms - - - - - {20c66404-b041-4c1c-92d5-e247bed49381} - - - {6fb047bd-f52c-4c9e-aafe-1a083b0b5e7b} - - - {be891496-733a-468e-b938-3a04ff7da28e} - - - {157177a2-3cd7-44b7-abe0-2f7b96b670f6} - - - {35dfe3ae-1f3b-4f8c-8362-670dd008d911} - - - {bdc4c8f8-e20e-4ee1-ac54-51563fdeff45} - - - {4fd52931-a65f-49a4-aae5-521161f7a82a} - - - {c16fd15f-a44a-4691-94ad-0f7bc7199f3d} - - - {c4b93ffc-1f2a-4461-a73b-d7153fd1a1e6} - - - {0937431a-c5c3-4079-86ff-f553d99ef136} - - - {c9f79ec1-aa17-4960-ae86-875f4946c39c} - - - {921dd117-a8fb-4b7c-beba-816870ec29b1} - - - {15e73a36-20e3-4787-9098-93110d20385d} - - - {6c7e826a-8962-479c-8584-38f4c4bda59f} - - - {14559fe7-78ad-4e5d-9fde-0a27cfebe3f2} - - - {1ee2e0f5-6bec-41dd-8b09-f110a36e0fbd} - - - {e84ef75c-1e60-48a1-b3a7-c4c007594961} - - - {ea0abb96-fbd6-4b68-b495-ffdc0d9b007e} - - - {33f8a601-1bcb-458c-8818-aff159407b66} - - - {92c33e19-ba3d-48e8-aaa5-0be3efbbd9bb} - - - {cfa988bf-dda1-4336-b896-65c08a977e45} - - - {ec5d82b7-2cb0-4fb4-a5dc-16ab24a692c8} - - - {63ac0368-033b-4bab-ab4f-a4e2f2480828} - - - {ac9d3e68-c859-431c-afcf-a45a59bde41f} - - - {181a963c-900f-43fe-88c7-76b3ca2db96a} - - - {2f6c4a65-24db-4b48-a4bc-5f3dc417ce2a} - - - {022cec73-4f7c-4e2b-b5ae-961baf57059a} - - - {7f799802-3d11-4d1b-a292-44e8081c8506} - - - {d8cca765-414c-4d1f-b707-0fcce579f63f} - - - {bd20b85f-0fc1-48e9-9300-5512f0b48d32} - - - {7b46bc32-63cc-4d07-926c-6521e5e3734a} - - - {b75322ce-7e8d-4ebb-9417-0c21fc7ca996} - - - {30900300-8680-4de9-949f-e5730750f260} - - - {38ae639d-7a13-425e-8992-6ccfb38ebff9} - - - {abfb0299-f5db-42c5-9d0e-8d4f719efcc5} - - - {bb4aef48-9a9c-44da-95e9-c62d6e6b026f} - - - {258c1673-602b-41dc-b192-6ef0c1c21e99} - - - {3c2c0e48-8c0b-4de2-bc84-a6b2ad8dd9df} - - - {c1631cbb-48f8-4fcd-9b5d-f978c18d97e1} - - - {216c2b82-0104-409a-98c6-c6368441eb39} - - - {7bc6d679-0841-4db6-b257-8070b73933b9} - - - {7caa12c1-b685-4ae8-964a-dc887e3b0aa4} - - - {fb178d63-1f81-415e-8cd7-a48079015c54} - - - {8d48ac20-3c2b-4c0a-b151-8e9f55f8a55a} - - - {688e8e7c-7d25-4fb2-8b08-99830cf36885} - - - {ac6b8038-053a-4b04-a976-516b7cf1c6a7} - - - {ec55b2b2-6ba4-4d8e-ae94-9aa7cba90fd0} - - - {77a52c8d-cc17-42bd-bb06-f256cef06e7a} - - - {71d3f67e-bf57-4151-a259-00d382e81c46} - - - {c9aa7869-9ab8-4b00-8662-d8972e1967f0} - - - {f88c916d-3b4e-4035-91f9-b395dbf046e1} - - - {3d547c1f-d964-4d1b-bb82-71e414c1a83f} - - - {3a50b1b9-d941-4370-b3f0-33fec23251ad} - - - {6b4ef829-71a4-4561-81d3-e4c25f7a8f40} - - - {f7d4de4f-dfdc-43b3-a668-f4acd52b2a23} - - - {16c81b29-859d-4d57-963e-e6e08ba76fdb} - - - {9cda8029-cb8c-41ad-821d-ea5f7689041d} - - - {4419ca8b-16c8-43ef-ab6b-cdd4da2922f2} - - - - - Burn - - - interfaces\video\win32\resource - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - interfaces\video\scalers - - - libs\zlib - - - libs\libpng - - - libs\7z - - - - - burner\win32 - - - libs\7z - - - \ No newline at end of file diff --git a/jan/src/burn/bitswap.h b/jan/src/burn/bitswap.h deleted file mode 100644 index 537eb1686..000000000 --- a/jan/src/burn/bitswap.h +++ /dev/null @@ -1,116 +0,0 @@ -#define BITSWAP32(n, \ - bit31, bit30, bit29, bit28, bit27, bit26, bit25, bit24, \ - bit23, bit22, bit21, bit20, bit19, bit18, bit17, bit16, \ - bit15, bit14, bit13, bit12, bit11, bit10, bit09, bit08, \ - bit07, bit06, bit05, bit04, bit03, bit02, bit01, bit00) \ - (((((n) >> (bit31)) & 1) << 31) | \ - ((((n) >> (bit30)) & 1) << 30) | \ - ((((n) >> (bit29)) & 1) << 29) | \ - ((((n) >> (bit28)) & 1) << 28) | \ - ((((n) >> (bit27)) & 1) << 27) | \ - ((((n) >> (bit26)) & 1) << 26) | \ - ((((n) >> (bit25)) & 1) << 25) | \ - ((((n) >> (bit24)) & 1) << 24) | \ - ((((n) >> (bit23)) & 1) << 23) | \ - ((((n) >> (bit22)) & 1) << 22) | \ - ((((n) >> (bit21)) & 1) << 21) | \ - ((((n) >> (bit20)) & 1) << 20) | \ - ((((n) >> (bit19)) & 1) << 19) | \ - ((((n) >> (bit18)) & 1) << 18) | \ - ((((n) >> (bit17)) & 1) << 17) | \ - ((((n) >> (bit16)) & 1) << 16) | \ - ((((n) >> (bit15)) & 1) << 15) | \ - ((((n) >> (bit14)) & 1) << 14) | \ - ((((n) >> (bit13)) & 1) << 13) | \ - ((((n) >> (bit12)) & 1) << 12) | \ - ((((n) >> (bit11)) & 1) << 11) | \ - ((((n) >> (bit10)) & 1) << 10) | \ - ((((n) >> (bit09)) & 1) << 9) | \ - ((((n) >> (bit08)) & 1) << 8) | \ - ((((n) >> (bit07)) & 1) << 7) | \ - ((((n) >> (bit06)) & 1) << 6) | \ - ((((n) >> (bit05)) & 1) << 5) | \ - ((((n) >> (bit04)) & 1) << 4) | \ - ((((n) >> (bit03)) & 1) << 3) | \ - ((((n) >> (bit02)) & 1) << 2) | \ - ((((n) >> (bit01)) & 1) << 1) | \ - ((((n) >> (bit00)) & 1) << 0)) - -#define BITSWAP24(n, \ - bit23, bit22, bit21, bit20, bit19, bit18, bit17, bit16, \ - bit15, bit14, bit13, bit12, bit11, bit10, bit09, bit08, \ - bit07, bit06, bit05, bit04, bit03, bit02, bit01, bit00) \ - (((((n) >> (bit23)) & 1) << 23) | \ - ((((n) >> (bit22)) & 1) << 22) | \ - ((((n) >> (bit21)) & 1) << 21) | \ - ((((n) >> (bit20)) & 1) << 20) | \ - ((((n) >> (bit19)) & 1) << 19) | \ - ((((n) >> (bit18)) & 1) << 18) | \ - ((((n) >> (bit17)) & 1) << 17) | \ - ((((n) >> (bit16)) & 1) << 16) | \ - ((((n) >> (bit15)) & 1) << 15) | \ - ((((n) >> (bit14)) & 1) << 14) | \ - ((((n) >> (bit13)) & 1) << 13) | \ - ((((n) >> (bit12)) & 1) << 12) | \ - ((((n) >> (bit11)) & 1) << 11) | \ - ((((n) >> (bit10)) & 1) << 10) | \ - ((((n) >> (bit09)) & 1) << 9) | \ - ((((n) >> (bit08)) & 1) << 8) | \ - ((((n) >> (bit07)) & 1) << 7) | \ - ((((n) >> (bit06)) & 1) << 6) | \ - ((((n) >> (bit05)) & 1) << 5) | \ - ((((n) >> (bit04)) & 1) << 4) | \ - ((((n) >> (bit03)) & 1) << 3) | \ - ((((n) >> (bit02)) & 1) << 2) | \ - ((((n) >> (bit01)) & 1) << 1) | \ - ((((n) >> (bit00)) & 1) << 0)) - -#define BITSWAP16(n, \ - bit15, bit14, bit13, bit12, bit11, bit10, bit09, bit08, \ - bit07, bit06, bit05, bit04, bit03, bit02, bit01, bit00) \ - (((((n) >> (bit15)) & 1) << 15) | \ - ((((n) >> (bit14)) & 1) << 14) | \ - ((((n) >> (bit13)) & 1) << 13) | \ - ((((n) >> (bit12)) & 1) << 12) | \ - ((((n) >> (bit11)) & 1) << 11) | \ - ((((n) >> (bit10)) & 1) << 10) | \ - ((((n) >> (bit09)) & 1) << 9) | \ - ((((n) >> (bit08)) & 1) << 8) | \ - ((((n) >> (bit07)) & 1) << 7) | \ - ((((n) >> (bit06)) & 1) << 6) | \ - ((((n) >> (bit05)) & 1) << 5) | \ - ((((n) >> (bit04)) & 1) << 4) | \ - ((((n) >> (bit03)) & 1) << 3) | \ - ((((n) >> (bit02)) & 1) << 2) | \ - ((((n) >> (bit01)) & 1) << 1) | \ - ((((n) >> (bit00)) & 1) << 0)) - -#define BITSWAP08(n, \ - bit07, bit06, bit05, bit04, bit03, bit02, bit01, bit00) \ - (((((n) >> (bit07)) & 1) << 7) | \ - ((((n) >> (bit06)) & 1) << 6) | \ - ((((n) >> (bit05)) & 1) << 5) | \ - ((((n) >> (bit04)) & 1) << 4) | \ - ((((n) >> (bit03)) & 1) << 3) | \ - ((((n) >> (bit02)) & 1) << 2) | \ - ((((n) >> (bit01)) & 1) << 1) | \ - ((((n) >> (bit00)) & 1) << 0)) - -#define BIT(x,n) (((x)>>(n))&1) - -/* ----- macros for accessing bytes and words within larger chunks ----- */ -#ifdef LSB_FIRST - #define BYTE_XOR_BE(a) ((a) ^ 1) /* read/write a byte to a 16-bit space */ - #define BYTE_XOR_LE(a) (a) - #define BYTE4_XOR_BE(a) ((a) ^ 3) /* read/write a byte to a 32-bit space */ - #define BYTE4_XOR_LE(a) (a) - #define WORD_XOR_BE(a) ((a) ^ 2) /* read/write a word to a 32-bit space */ - #define WORD_XOR_LE(a) (a) -#else - #define BYTE_XOR_BE(a) (a) - #define BYTE_XOR_LE(a) ((a) ^ 1) /* read/write a byte to a 16-bit space */ - #define BYTE4_XOR_BE(a) (a) - #define BYTE4_XOR_LE(a) ((a) ^ 3) /* read/write a byte to a 32-bit space */ - #define WORD_XOR_BE(a) (a) - #define WORD_XOR_LE(a) ((a) ^ 2) /* read/write a word to a 32-bit space */ -#endif diff --git a/jan/src/burn/burn.cpp b/jan/src/burn/burn.cpp deleted file mode 100644 index 6141abbad..000000000 --- a/jan/src/burn/burn.cpp +++ /dev/null @@ -1,1056 +0,0 @@ -// Burn - Drivers module - -#include "version.h" -#include "burnint.h" -#include "burn_sound.h" -#include "driverlist.h" - -#ifndef __LIBRETRO__ -// filler function, used if the application is not printing debug messages -static INT32 __cdecl BurnbprintfFiller(INT32, TCHAR* , ...) { return 0; } -// pointer to burner printing function -#ifndef bprintf -INT32 (__cdecl *bprintf)(INT32 nStatus, TCHAR* szFormat, ...) = BurnbprintfFiller; -#endif -#endif - -INT32 nBurnVer = BURN_VERSION; // Version number of the library - -UINT32 nBurnDrvCount = 0; // Count of game drivers -UINT32 nBurnDrvActive = ~0U; // Which game driver is selected -UINT32 nBurnDrvSelect[8] = { ~0U, ~0U, ~0U, ~0U, ~0U, ~0U, ~0U, ~0U }; // Which games are selected (i.e. loaded but not necessarily active) - -bool bBurnUseMMX; -#if defined BUILD_A68K -bool bBurnUseASMCPUEmulation = false; -#endif - -#if defined (FBA_DEBUG) - clock_t starttime = 0; -#endif - -UINT32 nCurrentFrame; // Framecount for emulated game - -UINT32 nFramesEmulated; // Counters for FPS display -UINT32 nFramesRendered; // -bool bForce60Hz = false; -bool bBurnUseBlend = true; -INT32 nBurnFPS = 6000; -INT32 nBurnCPUSpeedAdjust = 0x0100; // CPU speed adjustment (clock * nBurnCPUSpeedAdjust / 0x0100) - -// Burn Draw: -UINT8* pBurnDraw = NULL; // Pointer to correctly sized bitmap -INT32 nBurnPitch = 0; // Pitch between each line -INT32 nBurnBpp; // Bytes per pixel (2, 3, or 4) - -INT32 nBurnSoundRate = 0; // sample rate of sound or zero for no sound -INT32 nBurnSoundLen = 0; // length in samples per frame -INT16* pBurnSoundOut = NULL; // pointer to output buffer - -INT32 nInterpolation = 1; // Desired interpolation level for ADPCM/PCM sound -INT32 nFMInterpolation = 0; // Desired interpolation level for FM sound - -UINT8 nBurnLayer = 0xFF; // Can be used externally to select which layers to show -UINT8 nSpriteEnable = 0xFF; // Can be used externally to select which layers to show - -INT32 nMaxPlayers; - -bool bSaveCRoms = 0; - -UINT32 *pBurnDrvPalette; - -bool BurnCheckMMXSupport() -{ -#if defined BUILD_X86_ASM - UINT32 nSignatureEAX = 0, nSignatureEBX = 0, nSignatureECX = 0, nSignatureEDX = 0; - - CPUID(1, nSignatureEAX, nSignatureEBX, nSignatureECX, nSignatureEDX); - - return (nSignatureEDX >> 23) & 1; // bit 23 of edx indicates MMX support -#else - return 0; -#endif -} - -extern "C" INT32 BurnLibInit() -{ - BurnLibExit(); - nBurnDrvCount = sizeof(pDriver) / sizeof(pDriver[0]); // count available drivers - - cmc_4p_Precalc(); - bBurnUseMMX = BurnCheckMMXSupport(); - - return 0; -} - -extern "C" INT32 BurnLibExit() -{ - nBurnDrvCount = 0; - - return 0; -} - -INT32 BurnGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = pDriver[nBurnDrvActive]->szShortName; - } else { - INT32 nOldBurnDrvSelect = nBurnDrvActive; - UINT32 j = pDriver[nBurnDrvActive]->szBoardROM ? 1 : 0; - - // Try BIOS/board ROMs first - if (i == 1 && j == 1) { // There is a BIOS/board ROM - pszGameName = pDriver[nBurnDrvActive]->szBoardROM; - } - - if (pszGameName == NULL) { - // Go through the list to seek out the parent - while (j < i) { - char* pszParent = pDriver[nBurnDrvActive]->szParent; - pszGameName = NULL; - - if (pszParent == NULL) { // No parent - break; - } - - for (nBurnDrvActive = 0; nBurnDrvActive < nBurnDrvCount; nBurnDrvActive++) { - if (strcmp(pszParent, pDriver[nBurnDrvActive]->szShortName) == 0) { // Found parent - pszGameName = pDriver[nBurnDrvActive]->szShortName; - break; - } - } - - j++; - } - } - - nBurnDrvActive = nOldBurnDrvSelect; - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - - strcpy(szFilename, pszGameName); - - *pszName = szFilename; - - return 0; -} - -// ---------------------------------------------------------------------------- -// Static functions which forward to each driver's data and functions - -INT32 BurnStateMAMEScan(INT32 nAction, INT32* pnMin); -void BurnStateExit(); -INT32 BurnStateInit(); - -// Get the text fields for the driver in TCHARs -extern "C" TCHAR* BurnDrvGetText(UINT32 i) -{ - char* pszStringA = NULL; - wchar_t* pszStringW = NULL; - static char* pszCurrentNameA; - static wchar_t* pszCurrentNameW; - -#if defined (_UNICODE) - - static wchar_t szShortNameW[32]; - static wchar_t szDateW[32]; - static wchar_t szFullNameW[256]; - static wchar_t szCommentW[256]; - static wchar_t szManufacturerW[256]; - static wchar_t szSystemW[256]; - static wchar_t szParentW[32]; - static wchar_t szBoardROMW[32]; - static wchar_t szSampleNameW[32]; - -#else - - static char szShortNameA[32]; - static char szDateA[32]; - static char szFullNameA[256]; - static char szCommentA[256]; - static char szManufacturerA[256]; - static char szSystemA[256]; - static char szParentA[32]; - static char szBoardROMA[32]; - static char szSampleNameA[32]; - -#endif - - if (!(i & DRV_ASCIIONLY)) { - switch (i & 0xFF) { -#ifndef __LIBRETRO__ - case DRV_FULLNAME: - pszStringW = pDriver[nBurnDrvActive]->szFullNameW; - - if (i & DRV_NEXTNAME) { - if (pszCurrentNameW && pDriver[nBurnDrvActive]->szFullNameW) { - pszCurrentNameW += wcslen(pszCurrentNameW) + 1; - if (!pszCurrentNameW[0]) { - return NULL; - } - pszStringW = pszCurrentNameW; - } - } else { - -#if !defined (_UNICODE) - - // Ensure all of the Unicode titles are printable in the current locale - pszCurrentNameW = pDriver[nBurnDrvActive]->szFullNameW; - if (pszCurrentNameW && pszCurrentNameW[0]) { - INT32 nRet; - - do { - nRet = wcstombs(szFullNameA, pszCurrentNameW, 256); - pszCurrentNameW += wcslen(pszCurrentNameW) + 1; - } while (nRet >= 0 && pszCurrentNameW[0]); - - // If all titles can be printed, we can use the Unicode versions - if (nRet >= 0) { - pszStringW = pszCurrentNameW = pDriver[nBurnDrvActive]->szFullNameW; - } - } - -#else - - pszStringW = pszCurrentNameW = pDriver[nBurnDrvActive]->szFullNameW; - -#endif - - } - break; -#endif // __LIBRETRO__ - case DRV_COMMENT: - pszStringW = pDriver[nBurnDrvActive]->szCommentW; - break; - case DRV_MANUFACTURER: - pszStringW = pDriver[nBurnDrvActive]->szManufacturerW; - break; - case DRV_SYSTEM: - pszStringW = pDriver[nBurnDrvActive]->szSystemW; - } - -#if defined (_UNICODE) - - if (pszStringW && pszStringW[0]) { - return pszStringW; - } - -#else - - switch (i & 0xFF) { - case DRV_NAME: - pszStringA = szShortNameA; - break; - case DRV_DATE: - pszStringA = szDateA; - break; - case DRV_FULLNAME: - pszStringA = szFullNameA; - break; - case DRV_COMMENT: - pszStringA = szCommentA; - break; - case DRV_MANUFACTURER: - pszStringA = szManufacturerA; - break; - case DRV_SYSTEM: - pszStringA = szSystemA; - break; - case DRV_PARENT: - pszStringA = szParentA; - break; - case DRV_BOARDROM: - pszStringA = szBoardROMA; - break; - case DRV_SAMPLENAME: - pszStringA = szSampleNameA; - break; - } - - if (pszStringW && pszStringA && pszStringW[0]) { - if (wcstombs(pszStringA, pszStringW, 256) != -1U) { - return pszStringA; - } - - } - - pszStringA = NULL; - -#endif - - } - - if (i & DRV_UNICODEONLY) { - return NULL; - } - - switch (i & 0xFF) { - case DRV_NAME: - pszStringA = pDriver[nBurnDrvActive]->szShortName; - break; - case DRV_DATE: - pszStringA = pDriver[nBurnDrvActive]->szDate; - break; - case DRV_FULLNAME: - pszStringA = pDriver[nBurnDrvActive]->szFullNameA; - - if (i & DRV_NEXTNAME) { - if (!pszCurrentNameW && pDriver[nBurnDrvActive]->szFullNameA) { - pszCurrentNameA += strlen(pszCurrentNameA) + 1; - if (!pszCurrentNameA[0]) { - return NULL; - } - pszStringA = pszCurrentNameA; - } - } else { - pszStringA = pszCurrentNameA = pDriver[nBurnDrvActive]->szFullNameA; - pszCurrentNameW = NULL; - } - break; - case DRV_COMMENT: - pszStringA = pDriver[nBurnDrvActive]->szCommentA; - break; - case DRV_MANUFACTURER: - pszStringA = pDriver[nBurnDrvActive]->szManufacturerA; - break; - case DRV_SYSTEM: - pszStringA = pDriver[nBurnDrvActive]->szSystemA; - break; - case DRV_PARENT: - pszStringA = pDriver[nBurnDrvActive]->szParent; - break; - case DRV_BOARDROM: - pszStringA = pDriver[nBurnDrvActive]->szBoardROM; - break; - case DRV_SAMPLENAME: - pszStringA = pDriver[nBurnDrvActive]->szSampleName; - } - -#if defined (_UNICODE) - - switch (i & 0xFF) { - case DRV_NAME: - pszStringW = szShortNameW; - break; - case DRV_DATE: - pszStringW = szDateW; - break; - case DRV_FULLNAME: - pszStringW = szFullNameW; - break; - case DRV_COMMENT: - pszStringW = szCommentW; - break; - case DRV_MANUFACTURER: - pszStringW = szManufacturerW; - break; - case DRV_SYSTEM: - pszStringW = szSystemW; - break; - case DRV_PARENT: - pszStringW = szParentW; - break; - case DRV_BOARDROM: - pszStringW = szBoardROMW; - break; - case DRV_SAMPLENAME: - pszStringW = szSampleNameW; - break; - } - - if (pszStringW && pszStringA && pszStringA[0]) { - if (mbstowcs(pszStringW, pszStringA, 256) != -1U) { - return pszStringW; - } - } - -#else - - if (pszStringA && pszStringA[0]) { - return pszStringA; - } - -#endif - - return NULL; -} - - -// Get the ASCII text fields for the driver in ASCII format; -extern "C" char* BurnDrvGetTextA(UINT32 i) -{ - switch (i) { - case DRV_NAME: - return pDriver[nBurnDrvActive]->szShortName; - case DRV_DATE: - return pDriver[nBurnDrvActive]->szDate; - case DRV_FULLNAME: - return pDriver[nBurnDrvActive]->szFullNameA; - case DRV_COMMENT: - return pDriver[nBurnDrvActive]->szCommentA; - case DRV_MANUFACTURER: - return pDriver[nBurnDrvActive]->szManufacturerA; - case DRV_SYSTEM: - return pDriver[nBurnDrvActive]->szSystemA; - case DRV_PARENT: - return pDriver[nBurnDrvActive]->szParent; - case DRV_BOARDROM: - return pDriver[nBurnDrvActive]->szBoardROM; - case DRV_SAMPLENAME: - return pDriver[nBurnDrvActive]->szSampleName; - default: - return NULL; - } -} - -#if defined (_UNICODE) -void BurnLocalisationSetName(char *szName, TCHAR *szLongName) -{ - for (UINT32 i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - if (!strcmp(szName, pDriver[i]->szShortName)) { - pDriver[i]->szFullNameW = szLongName; - } - } -} -#endif - -// Get the zip names for the driver -extern "C" INT32 BurnDrvGetZipName(char** pszName, UINT32 i) -{ - if (pDriver[nBurnDrvActive]->GetZipName) { // Forward to drivers function - return pDriver[nBurnDrvActive]->GetZipName(pszName, i); - } - - return BurnGetZipName(pszName, i); // Forward to general function -} - -extern "C" INT32 BurnDrvGetRomInfo(struct BurnRomInfo* pri, UINT32 i) // Forward to drivers function -{ - return pDriver[nBurnDrvActive]->GetRomInfo(pri, i); -} - -extern "C" INT32 BurnDrvGetRomName(char** pszName, UINT32 i, INT32 nAka) // Forward to drivers function -{ - return pDriver[nBurnDrvActive]->GetRomName(pszName, i, nAka); -} - -extern "C" INT32 BurnDrvGetInputInfo(struct BurnInputInfo* pii, UINT32 i) // Forward to drivers function -{ - return pDriver[nBurnDrvActive]->GetInputInfo(pii, i); -} - -extern "C" INT32 BurnDrvGetDIPInfo(struct BurnDIPInfo* pdi, UINT32 i) -{ - if (pDriver[nBurnDrvActive]->GetDIPInfo) { // Forward to drivers function - return pDriver[nBurnDrvActive]->GetDIPInfo(pdi, i); - } - - return 1; // Fail automatically -} - -extern "C" INT32 BurnDrvGetSampleInfo(struct BurnSampleInfo* pri, UINT32 i) // Forward to drivers function -{ - return pDriver[nBurnDrvActive]->GetSampleInfo(pri, i); -} - -extern "C" INT32 BurnDrvGetSampleName(char** pszName, UINT32 i, INT32 nAka) // Forward to drivers function -{ - return pDriver[nBurnDrvActive]->GetSampleName(pszName, i, nAka); -} - -// Get the screen size -extern "C" INT32 BurnDrvGetVisibleSize(INT32* pnWidth, INT32* pnHeight) -{ - *pnWidth =pDriver[nBurnDrvActive]->nWidth; - *pnHeight=pDriver[nBurnDrvActive]->nHeight; - - return 0; -} - -extern "C" INT32 BurnDrvGetVisibleOffs(INT32* pnLeft, INT32* pnTop) -{ - *pnLeft = 0; - *pnTop = 0; - - return 0; -} - -extern "C" INT32 BurnDrvGetFullSize(INT32* pnWidth, INT32* pnHeight) -{ - if (pDriver[nBurnDrvActive]->Flags & BDF_ORIENTATION_VERTICAL) { - *pnWidth =pDriver[nBurnDrvActive]->nHeight; - *pnHeight=pDriver[nBurnDrvActive]->nWidth; - } else { - *pnWidth =pDriver[nBurnDrvActive]->nWidth; - *pnHeight=pDriver[nBurnDrvActive]->nHeight; - } - - return 0; -} - -// Get screen aspect ratio -extern "C" INT32 BurnDrvGetAspect(INT32* pnXAspect, INT32* pnYAspect) -{ - *pnXAspect = pDriver[nBurnDrvActive]->nXAspect; - *pnYAspect = pDriver[nBurnDrvActive]->nYAspect; - - return 0; -} - -extern "C" INT32 BurnDrvSetVisibleSize(INT32 pnWidth, INT32 pnHeight) -{ - if (pDriver[nBurnDrvActive]->Flags & BDF_ORIENTATION_VERTICAL) { - pDriver[nBurnDrvActive]->nHeight = pnWidth; - pDriver[nBurnDrvActive]->nWidth = pnHeight; - } else { - pDriver[nBurnDrvActive]->nWidth = pnWidth; - pDriver[nBurnDrvActive]->nHeight = pnHeight; - } - - return 0; -} - -extern "C" INT32 BurnDrvSetAspect(INT32 pnXAspect,INT32 pnYAspect) -{ - pDriver[nBurnDrvActive]->nXAspect = pnXAspect; - pDriver[nBurnDrvActive]->nYAspect = pnYAspect; - - return 0; -} - -// Get the hardware code -extern "C" INT32 BurnDrvGetHardwareCode() -{ - return pDriver[nBurnDrvActive]->Hardware; -} - -// Get flags, including BDF_GAME_WORKING flag -extern "C" INT32 BurnDrvGetFlags() -{ - return pDriver[nBurnDrvActive]->Flags; -} - -// Return BDF_WORKING flag -extern "C" bool BurnDrvIsWorking() -{ - return pDriver[nBurnDrvActive]->Flags & BDF_GAME_WORKING; -} - -// Return max. number of players -extern "C" INT32 BurnDrvGetMaxPlayers() -{ - return pDriver[nBurnDrvActive]->Players; -} - -// Return genre flags -extern "C" INT32 BurnDrvGetGenreFlags() -{ - return pDriver[nBurnDrvActive]->Genre; -} - -// Return family flags -extern "C" INT32 BurnDrvGetFamilyFlags() -{ - return pDriver[nBurnDrvActive]->Family; -} - -// Init game emulation (loading any needed roms) -extern "C" INT32 BurnDrvInit() -{ - INT32 nReturnValue; - - if (nBurnDrvActive >= nBurnDrvCount) { - return 1; - } - -#if defined (FBA_DEBUG) - { - TCHAR szText[1024] = _T(""); - TCHAR* pszPosition = szText; - TCHAR* pszName = BurnDrvGetText(DRV_FULLNAME); - INT32 nName = 1; - - while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) { - nName++; - } - - // Print the title - - bprintf(PRINT_IMPORTANT, _T("*** Starting emulation of %s - %s.\n"), BurnDrvGetText(DRV_NAME), BurnDrvGetText(DRV_FULLNAME)); - -#ifdef BUILD_A68K - if (bBurnUseASMCPUEmulation) - bprintf(PRINT_ERROR, _T("*** WARNING: Assembly MC68000 core is enabled for this session!\n")); -#endif - - // Then print the alternative titles - - if (nName > 1) { - bprintf(PRINT_IMPORTANT, _T(" Alternative %s "), (nName > 2) ? _T("titles are") : _T("title is")); - pszName = BurnDrvGetText(DRV_FULLNAME); - nName = 1; - while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) { - if (pszPosition + _tcslen(pszName) - 1022 > szText) { - break; - } - if (nName > 1) { - bprintf(PRINT_IMPORTANT, _T(SEPERATOR_1)); - } - bprintf(PRINT_IMPORTANT, _T("%s"), pszName); - nName++; - } - bprintf(PRINT_IMPORTANT, _T(".\n")); - } - } -#endif - - BurnSetRefreshRate(60.0); - - CheatInit(); - HiscoreInit(); - BurnStateInit(); - BurnInitMemoryManager(); - BurnRandomInit(); - - nReturnValue = pDriver[nBurnDrvActive]->Init(); // Forward to drivers function - - nMaxPlayers = pDriver[nBurnDrvActive]->Players; - -#if defined (FBA_DEBUG) - if (!nReturnValue) { - starttime = clock(); - nFramesEmulated = 0; - nFramesRendered = 0; - nCurrentFrame = 0; - } else { - starttime = 0; - } -#endif - - return nReturnValue; -} - -// Exit game emulation -extern "C" INT32 BurnDrvExit() -{ -#if defined (FBA_DEBUG) - if (starttime) { - clock_t endtime; - clock_t nElapsedSecs; - - endtime = clock(); - nElapsedSecs = (endtime - starttime); - bprintf(PRINT_IMPORTANT, _T(" ** Emulation ended (running for %.2f seconds).\n"), (float)nElapsedSecs / CLOCKS_PER_SEC); - bprintf(PRINT_IMPORTANT, _T(" %.2f%% of frames rendered (%d out of a total %d).\n"), (float)nFramesRendered / nFramesEmulated * 100, nFramesRendered, nFramesEmulated); - bprintf(PRINT_IMPORTANT, _T(" %.2f frames per second (average).\n"), (float)nFramesRendered / nFramesEmulated * nBurnFPS / 100); - bprintf(PRINT_NORMAL, _T("\n")); - } -#endif - - CheatExit(); - CheatSearchExit(); - HiscoreExit(); - BurnStateExit(); - - nBurnCPUSpeedAdjust = 0x0100; - - pBurnDrvPalette = NULL; - - INT32 nRet = pDriver[nBurnDrvActive]->Exit(); // Forward to drivers function - - BurnExitMemoryManager(); -#if defined FBA_DEBUG - DebugTrackerExit(); -#endif - - return nRet; -} - -INT32 (__cdecl* BurnExtCartridgeSetupCallback)(BurnCartrigeCommand nCommand) = NULL; - -INT32 BurnDrvCartridgeSetup(BurnCartrigeCommand nCommand) -{ - if (nBurnDrvActive >= nBurnDrvCount || BurnExtCartridgeSetupCallback == NULL) { - return 1; - } - - if (nCommand == CART_EXIT) { - return pDriver[nBurnDrvActive]->Exit(); - } - - if (nCommand != CART_INIT_END && nCommand != CART_INIT_START) { - return 1; - } - - BurnExtCartridgeSetupCallback(CART_INIT_END); - -#if defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T(" * Loading")); -#endif - - if (BurnExtCartridgeSetupCallback(CART_INIT_START)) { - return 1; - } - - if (nCommand == CART_INIT_START) { - return pDriver[nBurnDrvActive]->Init(); - } - - return 0; -} - -// Do one frame of game emulation -extern "C" INT32 BurnDrvFrame() -{ - CheatApply(); // Apply cheats (if any) - HiscoreApply(); - return pDriver[nBurnDrvActive]->Frame(); // Forward to drivers function -} - -// Force redraw of the screen -extern "C" INT32 BurnDrvRedraw() -{ - if (pDriver[nBurnDrvActive]->Redraw) { - return pDriver[nBurnDrvActive]->Redraw(); // Forward to drivers function - } - - return 1; // No funtion provide, so simply return -} - -// Refresh Palette -extern "C" INT32 BurnRecalcPal() -{ - if (nBurnDrvActive < nBurnDrvCount) { - UINT8* pr = pDriver[nBurnDrvActive]->pRecalcPal; - if (pr == NULL) return 1; - *pr = 1; // Signal for the driver to refresh it's palette - } - - return 0; -} - -extern "C" INT32 BurnDrvGetPaletteEntries() -{ - return pDriver[nBurnDrvActive]->nPaletteEntries; -} - -// ---------------------------------------------------------------------------- - -INT32 (__cdecl *BurnExtProgressRangeCallback)(double fProgressRange) = NULL; -INT32 (__cdecl *BurnExtProgressUpdateCallback)(double fProgress, const TCHAR* pszText, bool bAbs) = NULL; - -INT32 BurnSetProgressRange(double fProgressRange) -{ - if (BurnExtProgressRangeCallback) { - return BurnExtProgressRangeCallback(fProgressRange); - } - - return 1; -} - -INT32 BurnUpdateProgress(double fProgress, const TCHAR* pszText, bool bAbs) -{ - if (BurnExtProgressUpdateCallback) { - return BurnExtProgressUpdateCallback(fProgress, pszText, bAbs); - } - - return 1; -} - -// ---------------------------------------------------------------------------- - -INT32 BurnSetRefreshRate(double dFrameRate) -{ - if (!bForce60Hz) { - nBurnFPS = (INT32)(100.0 * dFrameRate); - } - - return 0; -} - -inline static INT32 BurnClearSize(INT32 w, INT32 h) -{ - UINT8 *pl; - INT32 y; - - w *= nBurnBpp; - - // clear the screen to zero - for (pl = pBurnDraw, y = 0; y < h; pl += nBurnPitch, y++) { - memset(pl, 0x00, w); - } - - return 0; -} - -INT32 BurnClearScreen() -{ - struct BurnDriver* pbd = pDriver[nBurnDrvActive]; - - if (pbd->Flags & BDF_ORIENTATION_VERTICAL) { - BurnClearSize(pbd->nHeight, pbd->nWidth); - } else { - BurnClearSize(pbd->nWidth, pbd->nHeight); - } - - return 0; -} - -// Byteswaps an area of memory -INT32 BurnByteswap(UINT8* pMem, INT32 nLen) -{ - nLen >>= 1; - for (INT32 i = 0; i < nLen; i++, pMem += 2) { - UINT8 t = pMem[0]; - pMem[0] = pMem[1]; - pMem[1] = t; - } - - return 0; -} - -// Application-defined rom loading function: -INT32 (__cdecl *BurnExtLoadRom)(UINT8 *Dest, INT32 *pnWrote, INT32 i) = NULL; - -// Application-defined colour conversion function -static UINT32 __cdecl BurnHighColFiller(INT32, INT32, INT32, INT32) { return (UINT32)(~0); } -UINT32 (__cdecl *BurnHighCol) (INT32 r, INT32 g, INT32 b, INT32 i) = BurnHighColFiller; - -// ---------------------------------------------------------------------------- -// Savestate support - -// Application-defined callback for processing the area -static INT32 __cdecl DefAcb (struct BurnArea* /* pba */) { return 1; } -INT32 (__cdecl *BurnAcb) (struct BurnArea* pba) = DefAcb; - -// Scan driver data -INT32 BurnAreaScan(INT32 nAction, INT32* pnMin) -{ - INT32 nRet = 0; - - // Handle any MAME-style variables - if (nAction & ACB_DRIVER_DATA) { - nRet = BurnStateMAMEScan(nAction, pnMin); - } - - // Forward to the driver - if (pDriver[nBurnDrvActive]->AreaScan) { - nRet |= pDriver[nBurnDrvActive]->AreaScan(nAction, pnMin); - } - - return nRet; -} - -// ---------------------------------------------------------------------------- -// State-able random generator, based on early BSD LCG rand -static UINT64 nBurnRandSeed = 0; - -UINT16 BurnRandom() -{ - if (!nBurnRandSeed) { // for the rare rollover-to-0 occurance - nBurnRandSeed = 0x2d1e0f; - } - - nBurnRandSeed = nBurnRandSeed * 1103515245 + 12345; - - return (UINT32)(nBurnRandSeed / 65536) % 0x10000; -} - -void BurnRandomScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nBurnRandSeed); - } -} - -void BurnRandomInit() -{ // for states & input recordings - init before emulation starts - nBurnRandSeed = time(NULL); -} - -// ---------------------------------------------------------------------------- -// Wrappers for MAME-specific function calls - -#include "driver.h" - -// ---------------------------------------------------------------------------- -// Wrapper for MAME logerror calls - -#if defined (FBA_DEBUG) && defined (MAME_USE_LOGERROR) -void logerror(char* szFormat, ...) -{ - static char szLogMessage[1024]; - - va_list vaFormat; - va_start(vaFormat, szFormat); - - _vsnprintf(szLogMessage, 1024, szFormat, vaFormat); - - va_end(vaFormat); - - bprintf(PRINT_ERROR, _T("%hs"), szLogMessage); - - return; -} -#endif - -// ---------------------------------------------------------------------------- -// Wrapper for MAME state_save_register_* calls - -struct BurnStateEntry { BurnStateEntry* pNext; BurnStateEntry* pPrev; char szName[256]; void* pValue; UINT32 nSize; }; - -static BurnStateEntry* pStateEntryAnchor = NULL; -typedef void (*BurnPostloadFunction)(); -static BurnPostloadFunction BurnPostload[8]; - -static void BurnStateRegister(const char* module, INT32 instance, const char* name, void* val, UINT32 size) -{ - // Allocate new node - BurnStateEntry* pNewEntry = (BurnStateEntry*)BurnMalloc(sizeof(BurnStateEntry)); - if (pNewEntry == NULL) { - return; - } - - memset(pNewEntry, 0, sizeof(BurnStateEntry)); - - // Link the new node - pNewEntry->pNext = pStateEntryAnchor; - if (pStateEntryAnchor) { - pStateEntryAnchor->pPrev = pNewEntry; - } - pStateEntryAnchor = pNewEntry; - - sprintf(pNewEntry->szName, "%s:%s %i", module, name, instance); - - pNewEntry->pValue = val; - pNewEntry->nSize = size; -} - -void BurnStateExit() -{ - if (pStateEntryAnchor) { - BurnStateEntry* pCurrentEntry = pStateEntryAnchor; - BurnStateEntry* pNextEntry; - - do { - pNextEntry = pCurrentEntry->pNext; - BurnFree(pCurrentEntry); - } while ((pCurrentEntry = pNextEntry) != 0); - } - - pStateEntryAnchor = NULL; - - for (INT32 i = 0; i < 8; i++) { - BurnPostload[i] = NULL; - } -} - -INT32 BurnStateInit() -{ - BurnStateExit(); - - return 0; -} - -INT32 BurnStateMAMEScan(INT32 nAction, INT32* pnMin) -{ - if (nAction & ACB_VOLATILE) { - - if (pnMin && *pnMin < 0x029418) { // Return minimum compatible version - *pnMin = 0x029418; - } - - if (pStateEntryAnchor) { - struct BurnArea ba; - BurnStateEntry* pCurrentEntry = pStateEntryAnchor; - - do { - ba.Data = pCurrentEntry->pValue; - ba.nLen = pCurrentEntry->nSize; - ba.nAddress = 0; - ba.szName = pCurrentEntry->szName; - BurnAcb(&ba); - - } while ((pCurrentEntry = pCurrentEntry->pNext) != 0); - } - - if (nAction & ACB_WRITE) { - for (INT32 i = 0; i < 8; i++) { - if (BurnPostload[i]) { - BurnPostload[i](); - } - } - } - } - - return 0; -} - -// wrapper functions - -extern "C" void state_save_register_func_postload(void (*pFunction)()) -{ - for (INT32 i = 0; i < 8; i++) { - if (BurnPostload[i] == NULL) { - BurnPostload[i] = pFunction; - break; - } - } -} - -extern "C" void state_save_register_INT8(const char* module, INT32 instance, const char* name, INT8* val, UINT32 size) -{ - BurnStateRegister(module, instance, name, (void*)val, size * sizeof(INT8)); -} - -extern "C" void state_save_register_UINT8(const char* module, INT32 instance, const char* name, UINT8* val, UINT32 size) -{ - BurnStateRegister(module, instance, name, (void*)val, size * sizeof(UINT8)); -} - -extern "C" void state_save_register_INT16(const char* module, INT32 instance, const char* name, INT16* val, UINT32 size) -{ - BurnStateRegister(module, instance, name, (void*)val, size * sizeof(INT16)); -} - -extern "C" void state_save_register_UINT16(const char* module, INT32 instance, const char* name, UINT16* val, UINT32 size) -{ - BurnStateRegister(module, instance, name, (void*)val, size * sizeof(UINT16)); -} - -extern "C" void state_save_register_INT32(const char* module, INT32 instance, const char* name, INT32* val, UINT32 size) -{ - BurnStateRegister(module, instance, name, (void*)val, size * sizeof(INT32)); -} - -extern "C" void state_save_register_UINT32(const char* module, INT32 instance, const char* name, UINT32* val, UINT32 size) -{ - BurnStateRegister(module, instance, name, (void*)val, size * sizeof(UINT32)); -} - -extern "C" void state_save_register_int(const char* module, INT32 instance, const char* name, INT32* val) -{ - BurnStateRegister(module, instance, name, (void*)val, sizeof(INT32)); -} - -extern "C" void state_save_register_float(const char* module, INT32 instance, const char* name, float* val, UINT32 size) -{ - BurnStateRegister(module, instance, name, (void*)val, size * sizeof(float)); -} - -extern "C" void state_save_register_double(const char* module, INT32 instance, const char* name, double* val, UINT32 size) -{ - BurnStateRegister(module, instance, name, (void*)val, size * sizeof(double)); -} diff --git a/jan/src/burn/burn.h b/jan/src/burn/burn.h deleted file mode 100644 index 70f4c3d17..000000000 --- a/jan/src/burn/burn.h +++ /dev/null @@ -1,641 +0,0 @@ -// FB Alpha - Emulator for MC68000/Z80 based arcade games -// Refer to the "license.txt" file for more info - -// Burner emulation library - -#ifdef __cplusplus - extern "C" { -#endif - -#if !defined (_WIN32) - #define __cdecl -#endif - -#ifndef MAX_PATH - #define MAX_PATH 260 -#endif - -#include - -extern TCHAR szAppHiscorePath[MAX_PATH]; -extern TCHAR szAppSamplesPath[MAX_PATH]; -extern TCHAR szAppBlendPath[MAX_PATH]; -extern TCHAR szAppEEPROMPath[MAX_PATH]; - -// Alignment macro, to keep savestates compatible between 32/64bit platforms. -#ifdef _MSC_VER -#define ALIGN_VAR(x) __declspec(align(x)) -#else -#define ALIGN_VAR(x) __attribute__((aligned(x))) -#endif - -// Enable the MAME logerror() function in debug builds -// #define MAME_USE_LOGERROR - -// Give access to the CPUID function for various compilers -#if defined (__GNUC__) - #define CPUID(f,ra,rb,rc,rd) __asm__ __volatile__ ("cpuid" \ - : "=a" (ra), "=b" (rb), "=c" (rc), "=d" (rd) \ - : "a" (f) \ - ); -#elif defined (_MSC_VER) - #define CPUID(f,ra,rb,rc,rd) __asm { __asm mov eax, f \ - __asm cpuid \ - __asm mov ra, eax \ - __asm mov rb, ebx \ - __asm mov rc, ecx \ - __asm mov rd, edx } -#else - #define CPUID(f,ra,rb,rc,rd) -#endif - -#ifndef BUILD_X86_ASM - #undef CPUID - #define CPUID(f,ra,rb,rc,rd) -#endif - -#ifdef _UNICODE - #define SEPERATOR_1 " \u2022 " - #define SEPERATOR_2 " \u25E6 " -#else - #define SEPERATOR_1 " ~ " - #define SEPERATOR_2 " ~ " -#endif - -#ifdef _UNICODE - #define WRITE_UNICODE_BOM(file) { UINT16 BOM[] = { 0xFEFF }; fwrite(BOM, 2, 1, file); } -#else - #define WRITE_UNICODE_BOM(file) -#endif - -typedef unsigned char UINT8; -typedef signed char INT8; -typedef unsigned short UINT16; -typedef signed short INT16; -typedef unsigned int UINT32; -typedef signed int INT32; -#ifdef _MSC_VER -typedef signed __int64 INT64; -typedef unsigned __int64 UINT64; -#else -__extension__ typedef unsigned long long UINT64; -__extension__ typedef long long INT64; -#endif - -#include "state.h" -#include "cheat.h" -#include "hiscore.h" -#include "joyprocess.h" - -extern INT32 nBurnVer; // Version number of the library - -enum BurnCartrigeCommand { CART_INIT_START, CART_INIT_END, CART_EXIT }; - -// --------------------------------------------------------------------------- -// Callbacks - -// Application-defined rom loading function -extern INT32 (__cdecl *BurnExtLoadRom)(UINT8* Dest, INT32* pnWrote, INT32 i); - -// Application-defined progress indicator functions -extern INT32 (__cdecl *BurnExtProgressRangeCallback)(double dProgressRange); -extern INT32 (__cdecl *BurnExtProgressUpdateCallback)(double dProgress, const TCHAR* pszText, bool bAbs); - -// Application-defined catridge initialisation function -extern INT32 (__cdecl *BurnExtCartridgeSetupCallback)(BurnCartrigeCommand nCommand); - -// Application-defined colour conversion function -extern UINT32 (__cdecl *BurnHighCol) (INT32 r, INT32 g, INT32 b, INT32 i); - -// --------------------------------------------------------------------------- - -extern UINT32 nCurrentFrame; - -inline static INT32 GetCurrentFrame() { - return nCurrentFrame; -} - -inline static void SetCurrentFrame(const UINT32 n) { - nCurrentFrame = n; -} - -// --------------------------------------------------------------------------- -// Driver info structures - -// ROMs - -#define BRF_PRG (1 << 20) -#define BRF_GRA (1 << 21) -#define BRF_SND (1 << 22) - -#define BRF_ESS (1 << 24) -#define BRF_BIOS (1 << 25) -#define BRF_SELECT (1 << 26) -#define BRF_OPT (1 << 27) -#define BRF_NODUMP (1 << 28) - -struct BurnRomInfo { - char szName[100]; - UINT32 nLen; - UINT32 nCrc; - UINT32 nType; -}; - -struct BurnSampleInfo { - char szName[100]; - UINT32 nFlags; -}; - -// Inputs - -#define BIT_DIGITAL (1) - -#define BIT_GROUP_ANALOG (4) -#define BIT_ANALOG_REL (4) -#define BIT_ANALOG_ABS (5) - -#define BIT_GROUP_CONSTANT (8) -#define BIT_CONSTANT (8) -#define BIT_DIPSWITCH (9) - -struct BurnInputInfo { - char* szName; - UINT8 nType; - union { - UINT8* pVal; // Most inputs use a char* - UINT16* pShortVal; // All analog inputs use a short* - }; - char* szInfo; -}; - -// DIPs - -struct BurnDIPInfo { - INT32 nInput; - UINT8 nFlags; - UINT8 nMask; - UINT8 nSetting; - char* szText; -}; - - -// --------------------------------------------------------------------------- -// Common CPU definitions - -#define CPU_IRQSTATUS_NONE 0 -#define CPU_IRQSTATUS_ACK 1 -#define CPU_IRQSTATUS_AUTO 2 -#define CPU_IRQSTATUS_HOLD 4 - -#define CPU_IRQLINE0 0 -#define CPU_IRQLINE1 1 -#define CPU_IRQLINE2 2 -#define CPU_IRQLINE3 3 -#define CPU_IRQLINE4 4 -#define CPU_IRQLINE5 5 -#define CPU_IRQLINE6 6 -#define CPU_IRQLINE7 7 - -#define CPU_IRQLINE_IRQ CPU_IRQLINE0 -#define CPU_IRQLINE_FIRQ CPU_IRQLINE1 -#define CPU_IRQLINE_NMI 0x20 - -#define MAP_READ 1 -#define MAP_WRITE 2 -#define MAP_FETCHOP 4 -#define MAP_FETCHARG 8 -#define MAP_FETCH (MAP_FETCHOP|MAP_FETCHARG) -#define MAP_ROM (MAP_READ|MAP_FETCH) -#define MAP_RAM (MAP_ROM|MAP_WRITE) - - -// --------------------------------------------------------------------------- - -extern bool bBurnUseMMX; -#ifdef BUILD_A68K -extern bool bBurnUseASMCPUEmulation; -#endif - -extern UINT32 nFramesEmulated; -extern UINT32 nFramesRendered; -extern clock_t starttime; // system time when emulation started and after roms loaded - -extern bool bForce60Hz; -extern bool bBurnUseBlend; - -extern INT32 nBurnFPS; -extern INT32 nBurnCPUSpeedAdjust; - -extern UINT32 nBurnDrvCount; // Count of game drivers -extern UINT32 nBurnDrvActive; // Which game driver is selected -extern UINT32 nBurnDrvSelect[8]; // Which games are selected (i.e. loaded but not necessarily active) - -extern INT32 nMaxPlayers; - -extern UINT8 *pBurnDraw; // Pointer to correctly sized bitmap -extern INT32 nBurnPitch; // Pitch between each line -extern INT32 nBurnBpp; // Bytes per pixel (2, 3, or 4) - -extern UINT8 nBurnLayer; // Can be used externally to select which layers to show -extern UINT8 nSpriteEnable; // Can be used externally to select which Sprites to show - -extern INT32 nBurnSoundRate; // Samplerate of sound -extern INT32 nBurnSoundLen; // Length in samples per frame -extern INT16* pBurnSoundOut; // Pointer to output buffer - -extern INT32 nInterpolation; // Desired interpolation level for ADPCM/PCM sound -extern INT32 nFMInterpolation; // Desired interpolation level for FM sound - -extern UINT32 *pBurnDrvPalette; - -#define PRINT_NORMAL (0) -#define PRINT_UI (1) -#define PRINT_IMPORTANT (2) -#define PRINT_ERROR (3) -#define PRINT_LEVEL1 (4) -#define PRINT_LEVEL2 (5) -#define PRINT_LEVEL3 (6) -#define PRINT_LEVEL4 (7) -#define PRINT_LEVEL5 (8) -#define PRINT_LEVEL6 (9) -#define PRINT_LEVEL7 (10) -#define PRINT_LEVEL8 (11) -#define PRINT_LEVEL9 (12) -#define PRINT_LEVEL10 (13) - -#ifndef bprintf -extern INT32 (__cdecl *bprintf) (INT32 nStatus, TCHAR* szFormat, ...); -#endif - -INT32 BurnLibInit(); -INT32 BurnLibExit(); - -INT32 BurnDrvInit(); -INT32 BurnDrvExit(); - -INT32 BurnDrvCartridgeSetup(BurnCartrigeCommand nCommand); - -INT32 BurnDrvFrame(); -INT32 BurnDrvRedraw(); -INT32 BurnRecalcPal(); -INT32 BurnDrvGetPaletteEntries(); - -INT32 BurnSetProgressRange(double dProgressRange); -INT32 BurnUpdateProgress(double dProgressStep, const TCHAR* pszText, bool bAbs); - -void BurnLocalisationSetName(char *szName, TCHAR *szLongName); - -UINT16 BurnRandom(); // State-able Random Number Generator (0-32767) -void BurnRandomScan(INT32 nAction); // Must be called in driver's DrvScan() if BurnRandom() is used -void BurnRandomInit(); // Called automatically in BurnDrvInit() / Internal use only - -// --------------------------------------------------------------------------- -// Retrieve driver information - -#define DRV_NAME (0) -#define DRV_DATE (1) -#define DRV_FULLNAME (2) -//#define DRV_MEDIUMNAME (3) -#define DRV_COMMENT (4) -#define DRV_MANUFACTURER (5) -#define DRV_SYSTEM (6) -#define DRV_PARENT (7) -#define DRV_BOARDROM (8) -#define DRV_SAMPLENAME (9) - -#define DRV_NEXTNAME (1 << 8) -#define DRV_ASCIIONLY (1 << 12) -#define DRV_UNICODEONLY (1 << 13) - -TCHAR* BurnDrvGetText(UINT32 i); -char* BurnDrvGetTextA(UINT32 i); - -INT32 BurnDrvGetZipName(char** pszName, UINT32 i); -INT32 BurnDrvGetRomInfo(struct BurnRomInfo *pri, UINT32 i); -INT32 BurnDrvGetRomName(char** pszName, UINT32 i, INT32 nAka); -INT32 BurnDrvGetInputInfo(struct BurnInputInfo* pii, UINT32 i); -INT32 BurnDrvGetDIPInfo(struct BurnDIPInfo* pdi, UINT32 i); -INT32 BurnDrvGetVisibleSize(INT32* pnWidth, INT32* pnHeight); -INT32 BurnDrvGetVisibleOffs(INT32* pnLeft, INT32* pnTop); -INT32 BurnDrvGetFullSize(INT32* pnWidth, INT32* pnHeight); -INT32 BurnDrvGetAspect(INT32* pnXAspect, INT32* pnYAspect); -INT32 BurnDrvGetHardwareCode(); -INT32 BurnDrvGetFlags(); -bool BurnDrvIsWorking(); -INT32 BurnDrvGetMaxPlayers(); -INT32 BurnDrvSetVisibleSize(INT32 pnWidth, INT32 pnHeight); -INT32 BurnDrvSetAspect(INT32 pnXAspect, INT32 pnYAspect); -INT32 BurnDrvGetGenreFlags(); -INT32 BurnDrvGetFamilyFlags(); -INT32 BurnDrvGetSampleInfo(struct BurnSampleInfo *pri, UINT32 i); -INT32 BurnDrvGetSampleName(char** pszName, UINT32 i, INT32 nAka); - -void Reinitialise(); - -extern bool bDoIpsPatch; -void IpsApplyPatches(UINT8* base, char* rom_name); - -// --------------------------------------------------------------------------- -// Flags used with the Burndriver structure - -// Flags for the flags member -#define BDF_GAME_NOT_WORKING (0) -#define BDF_GAME_WORKING (1 << 0) -#define BDF_ORIENTATION_FLIPPED (1 << 1) -#define BDF_ORIENTATION_VERTICAL (1 << 2) -#define BDF_BOARDROM (1 << 3) -#define BDF_CLONE (1 << 4) -#define BDF_BOOTLEG (1 << 5) -#define BDF_PROTOTYPE (1 << 6) -#define BDF_16BIT_ONLY (1 << 7) -#define BDF_HACK (1 << 8) -#define BDF_HOMEBREW (1 << 9) -#define BDF_DEMO (1 << 10) -#define BDF_HISCORE_SUPPORTED (1 << 11) - -// Flags for the hardware member -// Format: 0xDDEEFFFF, where EE: Manufacturer, DD: Hardware platform, FFFF: Flags (used by driver) - -#define HARDWARE_PUBLIC_MASK (0xFFFF0000) - -#define HARDWARE_PREFIX_CARTRIDGE ((INT32)0x80000000) - -#define HARDWARE_PREFIX_MISC_PRE90S (0x00000000) -#define HARDWARE_PREFIX_CAPCOM (0x01000000) -#define HARDWARE_PREFIX_SEGA (0x02000000) -#define HARDWARE_PREFIX_KONAMI (0x03000000) -#define HARDWARE_PREFIX_TOAPLAN (0x04000000) -#define HARDWARE_PREFIX_SNK (0x05000000) -#define HARDWARE_PREFIX_CAVE (0x06000000) -#define HARDWARE_PREFIX_CPS2 (0x07000000) -#define HARDWARE_PREFIX_IGS_PGM (0x08000000) -#define HARDWARE_PREFIX_CPS3 (0x09000000) -#define HARDWARE_PREFIX_MISC_POST90S (0x0a000000) -#define HARDWARE_PREFIX_TAITO (0x0b000000) -#define HARDWARE_PREFIX_SEGA_MEGADRIVE (0x0c000000) -#define HARDWARE_PREFIX_PSIKYO (0x0d000000) -#define HARDWARE_PREFIX_KANEKO (0x0e000000) -#define HARDWARE_PREFIX_PACMAN (0x0f000000) -#define HARDWARE_PREFIX_GALAXIAN (0x10000000) -#define HARDWARE_PREFIX_IREM (0x11000000) -//#define HARDWARE_PREFIX_NINTENDO_SNES (0x12000000) -#define HARDWARE_PREFIX_DATAEAST (0x13000000) -#define HARDWARE_PREFIX_CAPCOM_MISC (0x14000000) -#define HARDWARE_PREFIX_SETA (0x15000000) -#define HARDWARE_PREFIX_TECHNOS (0x16000000) -#define HARDWARE_PREFIX_PCENGINE (0x17000000) -#define HARDWARE_PREFIX_SEGA_MASTER_SYSTEM (0x18000000) -#define HARDWARE_PREFIX_SEGA_SG1000 (0x19000000) -#define HARDWARE_PREFIX_COLECO (0x1A000000) -#define HARDWARE_PREFIX_MIDWAY (0x1B000000) -#define HARDWARE_PREFIX_SEGA_GAME_GEAR (0x12000000) -#define HARDWARE_PREFIX_MSX (0x1C000000) - -#define HARDWARE_MISC_PRE90S (HARDWARE_PREFIX_MISC_PRE90S) -#define HARDWARE_MISC_POST90S (HARDWARE_PREFIX_MISC_POST90S) - -#define HARDWARE_CAPCOM_CPS1 (HARDWARE_PREFIX_CAPCOM | 0x00010000) -#define HARDWARE_CAPCOM_CPS1_QSOUND (HARDWARE_PREFIX_CAPCOM | 0x00020000) -#define HARDWARE_CAPCOM_CPS1_GENERIC (HARDWARE_PREFIX_CAPCOM | 0x00030000) -#define HARDWARE_CAPCOM_CPSCHANGER (HARDWARE_PREFIX_CAPCOM | 0x00040000) -#define HARDWARE_CAPCOM_CPS2 (HARDWARE_PREFIX_CPS2 | 0x00010000) -#define HARDWARE_CAPCOM_CPS2_SIMM (0x0002) - -#define HARDWARE_SEGA_SYSTEMX (HARDWARE_PREFIX_SEGA | 0x00010000) -#define HARDWARE_SEGA_SYSTEMY (HARDWARE_PREFIX_SEGA | 0x00020000) -#define HARDWARE_SEGA_SYSTEM16A (HARDWARE_PREFIX_SEGA | 0x00030000) -#define HARDWARE_SEGA_SYSTEM16B (HARDWARE_PREFIX_SEGA | 0x00040000) -#define HARDWARE_SEGA_SYSTEM16M (HARDWARE_PREFIX_SEGA | 0x00050000) -#define HARDWARE_SEGA_SYSTEM18 (HARDWARE_PREFIX_SEGA | 0x00060000) -#define HARDWARE_SEGA_HANGON (HARDWARE_PREFIX_SEGA | 0x00070000) -#define HARDWARE_SEGA_OUTRUN (HARDWARE_PREFIX_SEGA | 0x00080000) -#define HARDWARE_SEGA_SYSTEM1 (HARDWARE_PREFIX_SEGA | 0x00090000) -#define HARDWARE_SEGA_MISC (HARDWARE_PREFIX_SEGA | 0x000a0000) - -#define HARDWARE_SEGA_PCB_MASK (0x0f) -#define HARDWARE_SEGA_5358 (0x01) -#define HARDWARE_SEGA_5358_SMALL (0x02) -#define HARDWARE_SEGA_5704 (0x03) -#define HARDWARE_SEGA_5521 (0x04) -#define HARDWARE_SEGA_5797 (0x05) -#define HARDWARE_SEGA_5704_PS2 (0x06) -#define HARDWARE_SEGA_171_SHADOW (0x07) -#define HARDWARE_SEGA_171_5874 (0x08) -#define HARDWARE_SEGA_171_5987 (0x09) -#define HARDWARE_SEGA_837_7525 (0x0a) - -#define HARDWARE_SEGA_FD1089A_ENC (0x0010) -#define HARDWARE_SEGA_FD1089B_ENC (0x0020) -#define HARDWARE_SEGA_MC8123_ENC (0x0040) -#define HARDWARE_SEGA_FD1094_ENC (0x0080) -#define HARDWARE_SEGA_SPRITE_LOAD32 (0x0100) -#define HARDWARE_SEGA_YM2203 (0x0200) -#define HARDWARE_SEGA_INVERT_TILES (0x0400) -#define HARDWARE_SEGA_YM2413 (0x0800) -#define HARDWARE_SEGA_FD1094_ENC_CPU2 (0x1000) -#define HARDWARE_SEGA_ISGSM (0x2000) - -#define HARDWARE_KONAMI_68K_Z80 (HARDWARE_PREFIX_KONAMI | 0x00010000) -#define HARDWARE_KONAMI_68K_ONLY (HARDWARE_PREFIX_KONAMI | 0x00020000) - -#define HARDWARE_TOAPLAN_RAIZING (HARDWARE_PREFIX_TOAPLAN | 0x00010000) -#define HARDWARE_TOAPLAN_68K_Zx80 (HARDWARE_PREFIX_TOAPLAN | 0x00020000) -#define HARDWARE_TOAPLAN_68K_ONLY (HARDWARE_PREFIX_TOAPLAN | 0x00030000) -#define HARDWARE_TOAPLAN_MISC (HARDWARE_PREFIX_TOAPLAN | 0x00040000) - -#define HARDWARE_SNK_NEOGEO (HARDWARE_PREFIX_SNK | 0x00010000) -#define HARDWARE_SNK_SWAPP (0x0001) // Swap code roms -#define HARDWARE_SNK_SWAPV (0x0002) // Swap sound roms -#define HARDWARE_SNK_SWAPC (0x0004) // Swap sprite roms -#define HARDWARE_SNK_CMC42 (0x0008) // CMC42 encryption chip -#define HARDWARE_SNK_CMC50 (0x0010) // CMC50 encryption chip -#define HARDWARE_SNK_ALTERNATE_TEXT (0x0020) // KOF2000 text layer banks -#define HARDWARE_SNK_SMA_PROTECTION (0x0040) // SMA protection -#define HARDWARE_SNK_KOF2K3 (0x0080) // KOF2K3 hardware -#define HARDWARE_SNK_ENCRYPTED_M1 (0x0100) // M1 encryption -#define HARDWARE_SNK_P32 (0x0200) // SWAP32 P ROMs -#define HARDWARE_SNK_SPRITE32 (0x0400) - -#define HARDWARE_SNK_CONTROLMASK (0xF000) -#define HARDWARE_SNK_JOYSTICK (0x0000) // Uses joysticks -#define HARDWARE_SNK_PADDLE (0x1000) // Uses joysticks or paddles -#define HARDWARE_SNK_TRACKBALL (0x2000) // Uses a trackball -#define HARDWARE_SNK_4_JOYSTICKS (0x3000) // Uses 4 joysticks -#define HARDWARE_SNK_MAHJONG (0x4000) // Uses a special mahjong controller -#define HARDWARE_SNK_GAMBLING (0x5000) // Uses gambling controls - -#define HARDWARE_SNK_MVS (HARDWARE_PREFIX_SNK | 0x00020000) -#define HARDWARE_SNK_NEOCD (HARDWARE_PREFIX_SNK | 0x00030000) -#define HARDWARE_SNK_DEDICATED_PCB (HARDWARE_PREFIX_SNK | 0x00040000) - -#define HARDWARE_CAVE_68K_ONLY (HARDWARE_PREFIX_CAVE) -#define HARDWARE_CAVE_68K_Z80 (HARDWARE_PREFIX_CAVE | 0x0001) -#define HARDWARE_CAVE_M6295 (0x0002) -#define HARDWARE_CAVE_YM2151 (0x0004) - -#define HARDWARE_IGS_PGM (HARDWARE_PREFIX_IGS_PGM) -#define HARDWARE_IGS_USE_ARM_CPU (0x0001) - -#define HARDWARE_CAPCOM_CPS3 (HARDWARE_PREFIX_CPS3) -#define HARDWARE_CAPCOM_CPS3_NO_CD (0x0001) - -#define HARDWARE_TAITO_TAITOZ (HARDWARE_PREFIX_TAITO | 0x00010000) -#define HARDWARE_TAITO_TAITOF2 (HARDWARE_PREFIX_TAITO | 0x00020000) -#define HARDWARE_TAITO_MISC (HARDWARE_PREFIX_TAITO | 0x00030000) -#define HARDWARE_TAITO_TAITOX (HARDWARE_PREFIX_TAITO | 0x00040000) -#define HARDWARE_TAITO_TAITOB (HARDWARE_PREFIX_TAITO | 0x00050000) - -#define HARDWARE_IREM_M62 (HARDWARE_PREFIX_IREM | 0x00010000) -#define HARDWARE_IREM_M63 (HARDWARE_PREFIX_IREM | 0x00020000) -#define HARDWARE_IREM_M72 (HARDWARE_PREFIX_IREM | 0x00030000) -#define HARDWARE_IREM_M90 (HARDWARE_PREFIX_IREM | 0x00040000) -#define HARDWARE_IREM_M92 (HARDWARE_PREFIX_IREM | 0x00050000) -#define HARDWARE_IREM_MISC (HARDWARE_PREFIX_IREM | 0x00060000) - -#define HARDWARE_SEGA_MASTER_SYSTEM (HARDWARE_PREFIX_SEGA_MASTER_SYSTEM) - -#define HARDWARE_SMS_MAPPER_CODIES (0x01) -#define HARDWARE_SMS_MAPPER_MSX (0x02) -#define HARDWARE_SMS_MAPPER_MSX_NEMESIS (0x03) -#define HARDWARE_SMS_MAPPER_KOREA (0x04) -#define HARDWARE_SMS_MAPPER_KOREA8K (0x05) -#define HARDWARE_SMS_MAPPER_KOREA16K (0x06) -#define HARDWARE_SMS_MAPPER_4PAK (0x07) -#define HARDWARE_SMS_MAPPER_XIN1 (0x08) -#define HARDWARE_SMS_MAPPER_NONE (0x0F) - -#define HARDWARE_SMS_GG_SMS_MODE (0x2000) -#define HARDWARE_SMS_DISPLAY_PAL (0x4000) -#define HARDWARE_SMS_JAPANESE (0x8000) - -#define HARDWARE_SEGA_GAME_GEAR (HARDWARE_PREFIX_SEGA_GAME_GEAR) - -#define HARDWARE_SEGA_MEGADRIVE (HARDWARE_PREFIX_SEGA_MEGADRIVE) - -#define HARDWARE_SEGA_SG1000 (HARDWARE_PREFIX_SEGA_SG1000) -#define HARDWARE_SEGA_SG1000_RAMEXP (0x2000) -#define HARDWARE_COLECO (HARDWARE_PREFIX_COLECO) - -#define HARDWARE_MSX (HARDWARE_PREFIX_MSX) -#define HARDWARE_MSX_MAPPER_ASCII8 (0x01) -#define HARDWARE_MSX_MAPPER_ASCII8_SRAM (0x01) -#define HARDWARE_MSX_MAPPER_ASCII16 (0x02) -#define HARDWARE_MSX_MAPPER_ASCII16_SRAM (0x02) -#define HARDWARE_MSX_MAPPER_KONAMI (0x03) -#define HARDWARE_MSX_MAPPER_KONAMI_SCC (0x04) -#define HARDWARE_MSX_MAPPER_BASIC (0x05) -#define HARDWARE_MSX_MAPPER_DOOLY (0x06) -#define HARDWARE_MSX_MAPPER_RTYPE (0x07) -#define HARDWARE_MSX_MAPPER_CROSS_BLAIM (0x08) - -#define HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM (1) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM (2) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_FRAM (3) -#define HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART (4) -#define HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART_SEPROM (5) -#define HARDWARE_SEGA_MEGADRIVE_PCB_CODE_MASTERS (6) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SSF2 (7) -#define HARDWARE_SEGA_MEGADRIVE_PCB_GAME_KANDUME (8) -#define HARDWARE_SEGA_MEGADRIVE_PCB_BEGGAR (9) -#define HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM (10) -#define HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM_TE (11) -#define HARDWARE_SEGA_MEGADRIVE_PCB_NFL_QB_96 (12) -#define HARDWARE_SEGA_MEGADRIVE_PCB_C_SLAM (13) -#define HARDWARE_SEGA_MEGADRIVE_PCB_EA_NHLPA (14) -#define HARDWARE_SEGA_MEGADRIVE_PCB_LIONK3 (15) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SDK99 (16) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SKINGKONG (17) -#define HARDWARE_SEGA_MEGADRIVE_PCB_REDCL_EN (18) -#define HARDWARE_SEGA_MEGADRIVE_PCB_RADICA (19) -#define HARDWARE_SEGA_MEGADRIVE_PCB_KOF98 (20) -#define HARDWARE_SEGA_MEGADRIVE_PCB_KOF99 (21) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SOULBLAD (22) -#define HARDWARE_SEGA_MEGADRIVE_PCB_MJLOVER (23) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SQUIRRELK (24) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SMOUSE (25) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SMB (26) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SMB2 (27) -#define HARDWARE_SEGA_MEGADRIVE_PCB_KAIJU (28) -#define HARDWARE_SEGA_MEGADRIVE_PCB_CHINFIGHT3 (29) -#define HARDWARE_SEGA_MEGADRIVE_PCB_LIONK2 (30) -#define HARDWARE_SEGA_MEGADRIVE_PCB_BUGSLIFE (31) -#define HARDWARE_SEGA_MEGADRIVE_PCB_ELFWOR (32) -#define HARDWARE_SEGA_MEGADRIVE_PCB_ROCKMANX3 (33) -#define HARDWARE_SEGA_MEGADRIVE_PCB_SBUBBOB (34) -#define HARDWARE_SEGA_MEGADRIVE_PCB_REALTEC (35) -#define HARDWARE_SEGA_MEGADRIVE_PCB_MC_SUP19IN1 (36) -#define HARDWARE_SEGA_MEGADRIVE_PCB_MC_SUP15IN1 (37) -#define HARDWARE_SEGA_MEGADRIVE_PCB_MC_12IN1 (38) -#define HARDWARE_SEGA_MEGADRIVE_PCB_TOPFIGHTER (39) -#define HARDWARE_SEGA_MEGADRIVE_PCB_POKEMON (40) -#define HARDWARE_SEGA_MEGADRIVE_PCB_POKEMON2 (41) -#define HARDWARE_SEGA_MEGADRIVE_PCB_MULAN (42) - -#define HARDWARE_SEGA_MEGADRIVE_SRAM_00400 (0x0100) -#define HARDWARE_SEGA_MEGADRIVE_SRAM_00800 (0x0200) -#define HARDWARE_SEGA_MEGADRIVE_SRAM_01000 (0x0400) -#define HARDWARE_SEGA_MEGADRIVE_SRAM_04000 (0x0800) -#define HARDWARE_SEGA_MEGADRIVE_SRAM_10000 (0x1000) -#define HARDWARE_SEGA_MEGADRIVE_FRAM_00400 (0x2000) - -#define HARDWARE_PSIKYO (HARDWARE_PREFIX_PSIKYO) - -#define HARDWARE_KANEKO16 (HARDWARE_PREFIX_KANEKO | 0x10000) -#define HARDWARE_KANEKO_MISC (HARDWARE_PREFIX_KANEKO | 0x20000) -#define HARDWARE_KANEKO_SKNS (HARDWARE_PREFIX_KANEKO | 0x30000) - -#define HARDWARE_PACMAN (HARDWARE_PREFIX_PACMAN) - -#define HARDWARE_GALAXIAN (HARDWARE_PREFIX_GALAXIAN) - -//#define HARDWARE_NINTENDO_SNES (HARDWARE_PREFIX_NINTENDO_SNES) - -#define HARWARE_CAPCOM_MISC (HARDWARE_PREFIX_CAPCOM_MISC) - -#define HARDWARE_SETA1 (HARDWARE_PREFIX_SETA | 0x10000) -#define HARDWARE_SETA2 (HARDWARE_PREFIX_SETA | 0x20000) -#define HARDWARE_SETA_SSV (HARDWARE_PREFIX_SETA | 0x30000) - -#define HARDWARE_TECHNOS (HARDWARE_PREFIX_TECHNOS) - -#define HARDWARE_PCENGINE_PCENGINE (HARDWARE_PREFIX_PCENGINE | 0x00010000) -#define HARDWARE_PCENGINE_TG16 (HARDWARE_PREFIX_PCENGINE | 0x00020000) -#define HARDWARE_PCENGINE_SGX (HARDWARE_PREFIX_PCENGINE | 0x00030000) - -// flags for the genre member -#define GBF_HORSHOOT (1 << 0) -#define GBF_VERSHOOT (1 << 1) -#define GBF_SCRFIGHT (1 << 2) -#define GBF_VSFIGHT (1 << 3) -#define GBF_BIOS (1 << 4) -#define GBF_BREAKOUT (1 << 5) -#define GBF_CASINO (1 << 6) -#define GBF_BALLPADDLE (1 << 7) -#define GBF_MAZE (1 << 8) -#define GBF_MINIGAMES (1 << 9) -#define GBF_PINBALL (1 << 10) -#define GBF_PLATFORM (1 << 11) -#define GBF_PUZZLE (1 << 12) -#define GBF_QUIZ (1 << 13) -#define GBF_SPORTSMISC (1 << 14) -#define GBF_SPORTSFOOTBALL (1 << 15) -#define GBF_MISC (1 << 16) -#define GBF_MAHJONG (1 << 17) -#define GBF_RACING (1 << 18) -#define GBF_SHOOT (1 << 19) - -// flags for the family member -#define FBF_MSLUG (1 << 0) -#define FBF_SF (1 << 1) -#define FBF_KOF (1 << 2) -#define FBF_DSTLK (1 << 3) -#define FBF_FATFURY (1 << 4) -#define FBF_SAMSHO (1 << 5) -#define FBF_19XX (1 << 6) -#define FBF_SONICWI (1 << 7) -#define FBF_PWRINST (1 << 8) - -#ifdef __cplusplus - } // End of extern "C" -#endif - diff --git a/jan/src/burn/burn_gun.cpp b/jan/src/burn/burn_gun.cpp deleted file mode 100644 index be2859597..000000000 --- a/jan/src/burn/burn_gun.cpp +++ /dev/null @@ -1,209 +0,0 @@ -#include "burnint.h" -#include "burn_gun.h" - -// Generic Light Gun support for FBA -// written by Barry Harris (Treble Winner) based on the code in Kev's opwolf driver - -INT32 nBurnGunNumPlayers = 0; -bool bBurnGunAutoHide = 1; -static bool bBurnGunDrawTargets = true; - -static INT32 nBurnGunMaxX = 0; -static INT32 nBurnGunMaxY = 0; - -INT32 BurnGunX[MAX_GUNS]; -INT32 BurnGunY[MAX_GUNS]; - -#define a 0, -#define b 1, - -UINT8 BurnGunTargetData[18][18] = { - { a a a a a a a a b a a a a a a a a a }, - { a a a a a a b b b b b a a a a a a a }, - { a a a a b b a a b a a b b a a a a a }, - { a a a b a a a a b a a a a b a a a a }, - { a a b a a a a a b a a a a a b a a a }, - { a a b a a a a b b b a a a a b a a a }, - { a b a a a a b b b b b a a a a b a a }, - { a b a a a b b a a a a b a a a b a a }, - { b b b b b b b a a a b b b b b b b a }, - { a b a a a b b a a a a b b a a b a a }, - { a b a a a a b a b a b b a a a b a a }, - { a a b a a a a b b b b a a a b a a a }, - { a a b a a a a a b b a a a a b a a a }, - { a a a b a a a a b a a a a b a a a a }, - { a a a a b b a a b a a b b a a a a a }, - { a a a a a a b b b b b a a a a a a a }, - { a a a a a a a a b a a a a a a a a a }, - { a a a a a a a a a a a a a a a a a a }, -}; -#undef b -#undef a - -#define GunTargetHideTime 60 * 4 /* 4 seconds @ 60 fps */ -static INT32 GunTargetTimer[MAX_GUNS] = {0, 0, 0, 0}; -static INT32 GunTargetLastX[MAX_GUNS] = {0, 0, 0, 0}; -static INT32 GunTargetLastY[MAX_GUNS] = {0, 0, 0, 0}; - -static void GunTargetUpdate(INT32 player) -{ - if (GunTargetLastX[player] != BurnGunReturnX(player) || GunTargetLastY[player] != BurnGunReturnY(player)) { - GunTargetLastX[player] = BurnGunReturnX(player); - GunTargetLastY[player] = BurnGunReturnY(player); - GunTargetTimer[player] = nCurrentFrame; - } -} - -static UINT8 GunTargetShouldDraw(INT32 player) -{ - return ((INT32)nCurrentFrame < GunTargetTimer[player] + GunTargetHideTime); -} -#undef GunTargetHideTime - -UINT8 BurnGunReturnX(INT32 num) -{ -#if defined FBA_DEBUG - if (!Debug_BurnGunInitted) bprintf(PRINT_ERROR, _T("BurnGunReturnX called without init\n")); - if (num >= nBurnGunNumPlayers) bprintf(PRINT_ERROR, _T("BurnGunReturnX called with invalid player %x\n"), num); -#endif - - if (num > MAX_GUNS - 1) return 0xff; - - float temp = (float)((BurnGunX[num] >> 8) + 8) / nBurnGunMaxX * 0xff; - return (UINT8)temp; -} - -UINT8 BurnGunReturnY(INT32 num) -{ -#if defined FBA_DEBUG - if (!Debug_BurnGunInitted) bprintf(PRINT_ERROR, _T("BurnGunReturnY called without init\n")); - if (num >= nBurnGunNumPlayers) bprintf(PRINT_ERROR, _T("BurnGunReturnY called with invalid player %x\n"), num); -#endif - - if (num > MAX_GUNS - 1) return 0xff; - - float temp = (float)((BurnGunY[num] >> 8) + 8) / nBurnGunMaxY * 0xff; - return (UINT8)temp; -} - -void BurnGunMakeInputs(INT32 num, INT16 x, INT16 y) -{ -#if defined FBA_DEBUG - if (!Debug_BurnGunInitted) bprintf(PRINT_ERROR, _T("BurnGunMakeInputs called without init\n")); - if (num >= nBurnGunNumPlayers) bprintf(PRINT_ERROR, _T("BurnGunMakeInputs called with invalid player %x\n"), num); -#endif - - if (num > MAX_GUNS - 1) return; - - const INT32 MinX = -8 * 0x100; - const INT32 MinY = -8 * 0x100; - - if (y == 1 || y == -1 || x == 1 || x == -1) return; // prevent walking crosshair - - BurnGunX[num] += x; - BurnGunY[num] += y; - - if (BurnGunX[num] < MinX) BurnGunX[num] = MinX; - if (BurnGunX[num] > MinX + nBurnGunMaxX * 0x100) BurnGunX[num] = MinX + nBurnGunMaxX * 0x100; - if (BurnGunY[num] < MinY) BurnGunY[num] = MinY; - if (BurnGunY[num] > MinY + nBurnGunMaxY * 0x100) BurnGunY[num] = MinY + nBurnGunMaxY * 0x100; - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) - GunTargetUpdate(i); -} - -void BurnGunInit(INT32 nNumPlayers, bool bDrawTargets) -{ - Debug_BurnGunInitted = 1; - - if (nNumPlayers > MAX_GUNS) nNumPlayers = MAX_GUNS; - nBurnGunNumPlayers = nNumPlayers; - bBurnGunDrawTargets = bDrawTargets; - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nBurnGunMaxY, &nBurnGunMaxX); - } else { - BurnDrvGetVisibleSize(&nBurnGunMaxX, &nBurnGunMaxY); - } - - for (INT32 i = 0; i < MAX_GUNS; i++) { - BurnGunX[i] = ((nBurnGunMaxX / 2) - 7) << 8; - BurnGunY[i] = ((nBurnGunMaxY / 2) - 8) << 8; - } -} - -void BurnGunExit() -{ -#if defined FBA_DEBUG - if (!Debug_BurnGunInitted) bprintf(PRINT_ERROR, _T("BurnGunExit called without init\n")); -#endif - - nBurnGunNumPlayers = 0; - bBurnGunDrawTargets = true; - - nBurnGunMaxX = 0; - nBurnGunMaxY = 0; - - for (INT32 i = 0; i < MAX_GUNS; i++) { - BurnGunX[i] = 0; - BurnGunY[i] = 0; - } - - Debug_BurnGunInitted = 0; -} - -void BurnGunScan() -{ -#if defined FBA_DEBUG - if (!Debug_BurnGunInitted) bprintf(PRINT_ERROR, _T("BurnGunScan called without init\n")); -#endif - - SCAN_VAR(BurnGunX); - SCAN_VAR(BurnGunY); -} - -void BurnGunDrawTarget(INT32 num, INT32 x, INT32 y) -{ -#if defined FBA_DEBUG - if (!Debug_BurnGunInitted) bprintf(PRINT_ERROR, _T("BurnGunDrawTarget called without init\n")); - if (num >= nBurnGunNumPlayers) bprintf(PRINT_ERROR, _T("BurnGunDrawTarget called with invalid player %x\n"), num); -#endif - - if (bBurnGunDrawTargets == false) return; - - if (num > MAX_GUNS - 1) return; - - if (bBurnGunAutoHide && !GunTargetShouldDraw(num)) return; - - UINT8* pTile = pBurnDraw + nBurnGunMaxX * nBurnBpp * (y - 1) + nBurnBpp * x; - - UINT32 nTargetCol = 0; - if (num == 0) nTargetCol = BurnHighCol(0xfc, 0x12, 0xee, 0); - if (num == 1) nTargetCol = BurnHighCol(0x1c, 0xfc, 0x1c, 0); - if (num == 2) nTargetCol = BurnHighCol(0x15, 0x93, 0xfd, 0); - if (num == 3) nTargetCol = BurnHighCol(0xf7, 0xfa, 0x0e, 0); - - for (INT32 y2 = 0; y2 < 17; y2++) { - - pTile += nBurnGunMaxX * nBurnBpp; - - if ((y + y2) < 0 || (y + y2) > nBurnGunMaxY - 1) { - continue; - } - - for (INT32 x2 = 0; x2 < 17; x2++) { - - if ((x + x2) < 0 || (x + x2) > nBurnGunMaxX - 1) { - continue; - } - - if (BurnGunTargetData[y2][x2]) { - if (nBurnBpp == 2) { - ((UINT16*)pTile)[x2] = (UINT16)nTargetCol; - } else { - ((UINT32*)pTile)[x2] = nTargetCol; - } - } - } - } -} diff --git a/jan/src/burn/burn_gun.h b/jan/src/burn/burn_gun.h deleted file mode 100644 index bd3bf66da..000000000 --- a/jan/src/burn/burn_gun.h +++ /dev/null @@ -1,16 +0,0 @@ -#define MAX_GUNS 4 - -extern INT32 nBurnGunNumPlayers; -extern bool bBurnGunAutoHide; - -extern INT32 BurnGunX[MAX_GUNS]; -extern INT32 BurnGunY[MAX_GUNS]; - -UINT8 BurnGunReturnX(INT32 num); -UINT8 BurnGunReturnY(INT32 num); - -extern void BurnGunInit(INT32 nNumPlayers, bool bDrawTargets); -void BurnGunExit(); -void BurnGunScan(); -extern void BurnGunDrawTarget(INT32 num, INT32 x, INT32 y); -extern void BurnGunMakeInputs(INT32 num, INT16 x, INT16 y); diff --git a/jan/src/burn/burn_led.cpp b/jan/src/burn/burn_led.cpp deleted file mode 100644 index 3f9be8d95..000000000 --- a/jan/src/burn/burn_led.cpp +++ /dev/null @@ -1,264 +0,0 @@ -#include "burnint.h" -#include "burn_led.h" - -#define MAX_LED 8 - -static INT32 led_status[MAX_LED]; - -static INT32 led_count; -static INT32 led_alpha_level; -static INT32 led_alpha_level2; -static INT32 led_color; -static INT32 led_size; -static INT32 led_position0; -static INT32 led_position; -static INT32 led_xpos; -static INT32 led_ypos; -static INT32 led_xadv; -static INT32 led_yadv; - -static INT32 nScreenWidth, nScreenHeight; -static INT32 screen_flipped; -static INT32 flipscreen = -1; - -static inline UINT32 alpha_blend32(UINT32 d) -{ - return (((((led_color & 0xff00ff) * led_alpha_level) + ((d & 0xff00ff) * led_alpha_level2)) & 0xff00ff00) | - ((((led_color & 0x00ff00) * led_alpha_level) + ((d & 0x00ff00) * led_alpha_level2)) & 0x00ff0000)) >> 8; -} - -static void set_led_draw_position() -{ - led_position = led_position0; - - if (screen_flipped ^ flipscreen) { - switch (led_position & 3) { - case LED_POSITION_TOP_LEFT: led_position = LED_POSITION_BOTTOM_RIGHT; break; - case LED_POSITION_TOP_RIGHT: led_position = LED_POSITION_BOTTOM_LEFT; break; - case LED_POSITION_BOTTOM_LEFT: led_position = LED_POSITION_TOP_RIGHT; break; - case LED_POSITION_BOTTOM_RIGHT: led_position = LED_POSITION_TOP_LEFT; break; - } - } - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nScreenHeight, &nScreenWidth); - - led_xadv = 0; - led_yadv = led_size + 1; - - switch (led_position & 3) - { - case LED_POSITION_TOP_LEFT: - led_xpos = (nScreenWidth - 1) - led_size; - led_ypos = 1; - break; - - case LED_POSITION_BOTTOM_RIGHT: - led_xpos = 1; - led_ypos = (nScreenHeight - 1) - (led_yadv * led_count); - break; - - case LED_POSITION_BOTTOM_LEFT: - led_xpos = 1; - led_ypos = 1; - break; - - case LED_POSITION_TOP_RIGHT: - default: - led_xpos = (nScreenWidth - 1) - led_size; - led_ypos = (nScreenHeight - 1) - (led_yadv * led_count); - break; - } - } else { - BurnDrvGetVisibleSize(&nScreenWidth, &nScreenHeight); - - led_xadv = led_size + 1; - led_yadv = 0; - - switch (led_position & 3) - { - case LED_POSITION_BOTTOM_LEFT: - led_xpos = 1; - led_ypos = (nScreenHeight - 1) - led_size; -// led_ypos; - break; - - case LED_POSITION_TOP_RIGHT: - led_xpos = (nScreenWidth - 1) - (led_xadv * led_count); - led_ypos = 1; - break; - - case LED_POSITION_TOP_LEFT: - led_xpos = 1; - led_ypos = 1; - break; - - case LED_POSITION_BOTTOM_RIGHT: - default: - led_xpos = (nScreenWidth - 1) - (led_xadv * led_count); - led_ypos = (nScreenHeight - 1) - led_size; - break; - } - } -} - -void BurnLEDSetFlipscreen(INT32 flip) -{ -#if defined FBA_DEBUG - if (!Debug_BurnLedInitted) bprintf(PRINT_ERROR, _T("BurnLEDSetFlipscreen called without init\n")); -#endif - - flip = flip ? 1 : 0; - - if (flipscreen != flip) { - flipscreen = flip; - set_led_draw_position(); - } -} - -void BurnLEDReset() -{ -#if defined FBA_DEBUG - if (!Debug_BurnLedInitted) bprintf(PRINT_ERROR, _T("BurnLEDReset called without init\n")); -#endif - - memset (led_status, 0, MAX_LED * sizeof(INT32)); - - BurnLEDSetFlipscreen(0); -} - -void BurnLEDInit(INT32 num, INT32 position, INT32 size, INT32 color, INT32 transparency) -{ - Debug_BurnLedInitted = 1; - - if (num >= MAX_LED) num = MAX_LED - 1; - - led_count = num; - led_color = color; - led_size = size; - led_position0 = position; - - led_alpha_level = (255 * transparency) / 100; - led_alpha_level2 = 256 - led_alpha_level; - - screen_flipped = (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) ? 1 : 0; - - BurnLEDReset(); -} - -void BurnLEDSetStatus(INT32 led, UINT32 status) -{ -#if defined FBA_DEBUG - if (!Debug_BurnLedInitted) bprintf(PRINT_ERROR, _T("BurnLEDSetStatus called without init\n")); - if (led >= led_count) bprintf(PRINT_ERROR, _T("BurnLEDSetStatus called with invalid led %x\n"), led); -#endif - - if (led >= led_count) return; - - if (screen_flipped ^ flipscreen) { - led = (led_count - 1) - led; - } - - led_status[led] = status ? 1 : 0; -} - -void BurnLEDExit() -{ -#if defined FBA_DEBUG - if (!Debug_BurnLedInitted) bprintf(PRINT_ERROR, _T("BurnLEDExit called without init\n")); -#endif - - BurnLEDReset(); - - led_count = 0; - - led_alpha_level = 0; - led_alpha_level2 = 0; - led_color = 0; - led_size = 0; - led_position = 0; - led_position0 = 0; - - led_xpos = 0; - led_ypos = 0; - - screen_flipped = 0; - nScreenWidth = 0; - nScreenHeight = 0; - - flipscreen = -1; - - Debug_BurnLedInitted = 0; -} - -void BurnLEDRender() -{ -#if defined FBA_DEBUG - if (!Debug_BurnLedInitted) bprintf(PRINT_ERROR, _T("BurnLEDRender called without init\n")); -#endif - - INT32 xpos = led_xpos; - INT32 ypos = led_ypos; - int color = BurnHighCol((led_color >> 16) & 0xff, (led_color >> 8) & 0xff, (led_color >> 0) & 0xff, 0); - - for (INT32 i = 0; i < led_count; i++) - { - if (xpos < 0 || xpos > (nScreenWidth - led_size)) break; - - if (led_status[i]) - { - for (INT32 y = 0; y < led_size; y++) - { - UINT8 *ptr = pBurnDraw + (((ypos + y) * nScreenWidth) + xpos) * nBurnBpp; - - for (INT32 x = 0; x < led_size; x++) - { - if (nBurnBpp >= 4) - { - *((UINT32*)ptr) = alpha_blend32(*((UINT32*)ptr)); - } - else if (nBurnBpp == 3) - { - UINT32 t = alpha_blend32((ptr[2] << 16) | (ptr[1] << 8) | ptr[0]); - - ptr[2] = t >> 16; - ptr[1] = t >> 8; - ptr[0] = t >> 0; - } - else if (nBurnBpp == 2) // alpha blend not supported for 16-bit - { - *((UINT16*)ptr) = color; - } - - ptr += nBurnBpp; - } - } - } - - xpos += led_xadv; - ypos += led_yadv; - } -} - -INT32 BurnLEDScan(INT32 nAction, INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!Debug_BurnLedInitted) bprintf(PRINT_ERROR, _T("BurnLEDScan called without init\n")); -#endif - - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_DRIVER_DATA) { - ba.Data = &led_status; - ba.nLen = led_count * sizeof(INT32); - ba.nAddress = 0; - ba.szName = "Led status"; - BurnAcb(&ba); - } - - return 0; -} diff --git a/jan/src/burn/burn_led.h b/jan/src/burn/burn_led.h deleted file mode 100644 index 166be06c4..000000000 --- a/jan/src/burn/burn_led.h +++ /dev/null @@ -1,30 +0,0 @@ - -#define LED_COLOR_RED 0xff0000 -#define LED_COLOR_GREEN 0x00ff00 -#define LED_COLOR_BLUE 0x0000ff -#define LED_COLOR_WHITE 0xffffff -#define LED_COLOR_YELLOW 0xffff00 - -#define LED_SIZE_2x2 2 -#define LED_SIZE_3x3 3 -#define LED_SIZE_4x4 4 -#define LED_SIZE_5x5 5 -#define LED_SIZE_6x6 6 -#define LED_SIZE_7x7 7 -#define LED_SIZE_8x8 8 - -#define LED_POSITION_TOP_LEFT 0 -#define LED_POSITION_TOP_RIGHT 1 -#define LED_POSITION_BOTTOM_LEFT 2 -#define LED_POSITION_BOTTOM_RIGHT 3 - -// transparency is a percentage 0 - 100 -void BurnLEDInit(INT32 num, INT32 position, INT32 size, INT32 color, INT32 transparency); - -void BurnLEDReset(); -void BurnLEDSetStatus(INT32 led, UINT32 status); -void BurnLEDSetFlipscreen(INT32 flip); -void BurnLEDRender(); -void BurnLEDExit(); - -INT32 BurnLEDScan(INT32 nAction, INT32 *pnMin); diff --git a/jan/src/burn/burn_memory.cpp b/jan/src/burn/burn_memory.cpp deleted file mode 100644 index 1d4402959..000000000 --- a/jan/src/burn/burn_memory.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// FB Alpha memory management module - -// The purpose of this module is to offer replacement functions for standard C/C++ ones -// that allocate and free memory. This should help deal with the problem of memory -// leaks and non-null pointers on game exit. - -#include "burnint.h" - -#define MAX_MEM_PTR 0x400 // more than 1024 malloc calls should be insane... - -static UINT8 *memptr[MAX_MEM_PTR]; // pointer to allocated memory - -// this should be called early on... BurnDrvInit? - -void BurnInitMemoryManager() -{ - memset (memptr, 0, MAX_MEM_PTR * sizeof(UINT8 **)); -} - -// should we pass the pointer as a variable here so that we can save a pointer to it -// and then ensure it is NULL'd in BurnFree or BurnExitMemoryManager? - -// call instead of 'malloc' -UINT8 *BurnMalloc(INT32 size) -{ - for (INT32 i = 0; i < MAX_MEM_PTR; i++) - { - if (memptr[i] == NULL) { - memptr[i] = (UINT8*)malloc(size); - - if (memptr[i] == NULL) { - bprintf (0, _T("BurnMalloc failed to allocate %d bytes of memory!\n"), size); - return NULL; - } - - memset (memptr[i], 0, size); // set contents to 0 - - return memptr[i]; - } - } - - bprintf (0, _T("BurnMalloc called too many times!\n")); - - return NULL; // Freak out! -} - -// call instead of "free" -void _BurnFree(void *ptr) -{ - UINT8 *mptr = (UINT8*)ptr; - - for (INT32 i = 0; i < MAX_MEM_PTR; i++) - { - if (memptr[i] == mptr) { - free (memptr[i]); - memptr[i] = NULL; - - break; - } - } -} - -// call in BurnDrvExit? - -void BurnExitMemoryManager() -{ - for (INT32 i = 0; i < MAX_MEM_PTR; i++) - { - if (memptr[i] != NULL) { -#if defined FBA_DEBUG - bprintf(PRINT_ERROR, _T("BurnExitMemoryManager had to free mem pointer %i\n"), i); -#endif - free (memptr[i]); - memptr[i] = NULL; - } - } -} diff --git a/jan/src/burn/burn_pal.cpp b/jan/src/burn/burn_pal.cpp deleted file mode 100644 index 2d36cb0e5..000000000 --- a/jan/src/burn/burn_pal.cpp +++ /dev/null @@ -1,303 +0,0 @@ -#include "burnint.h" -#include "burn_pal.h" - -UINT32 *BurnPalette = NULL; -UINT8 *BurnPalRAM = NULL; - -//------------------------------------------------------------------------------------- - -static inline UINT32 PaletteWrite4Bit(INT32 offset, INT32 rshift, INT32 gshift, INT32 bshift) -{ - if (BurnPalRAM == NULL) return 0; - - UINT16 *pal = (UINT16*)BurnPalRAM; - UINT16 p = BURN_ENDIAN_SWAP_INT16(pal[offset]); - - UINT8 r = (p >> rshift) & 0xf; - UINT8 g = (p >> gshift) & 0xf; - UINT8 b = (p >> bshift) & 0xf; - - return BurnHighCol(r+(r*16), b+(b*16), g+(g*16), 0); -} - -static inline void PaletteUpdate4Bit(INT32 rshift, INT32 gshift, INT32 bshift) -{ - if (BurnPalette == NULL) return; - - for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++) - { - BurnPalette[i] = PaletteWrite4Bit(i, rshift, gshift, bshift); - } -} - -void BurnPaletteUpdate_xxxxBBBBGGGGRRRR() -{ - PaletteUpdate4Bit(0, 4, 8); -} - -void BurnPaletteUpdate_xxxxBBBBRRRRGGGG() -{ - PaletteUpdate4Bit(4, 0, 8); -} - -void BurnPaletteUpdate_xxxxRRRRGGGGBBBB() -{ - PaletteUpdate4Bit(8, 4, 0); -} - -void BurnPaletteWrite_xxxxBBBBGGGGRRRR(INT32 offset) -{ - offset /= 2; - - BurnPalette[offset] = PaletteWrite4Bit(offset, 0, 4, 8); -} - -void BurnPaletteWrite_xxxxBBBBRRRRGGGG(INT32 offset) -{ - offset /= 2; - - BurnPalette[offset] = PaletteWrite4Bit(offset, 4, 0, 8); -} - -void BurnPaletteWrite_xxxxRRRRGGGGBBBB(INT32 offset) -{ - offset /= 2; - - BurnPalette[offset] = PaletteWrite4Bit(offset, 8, 4, 0); -} - -//------------------------------------------------------------------------------------- - -static inline UINT32 PaletteWrite5Bit(INT32 offset, INT32 rshift, INT32 gshift, INT32 bshift) -{ - if (BurnPalRAM == NULL) return 0; - - UINT16 *pal = (UINT16*)BurnPalRAM; - UINT16 p = BURN_ENDIAN_SWAP_INT16(pal[offset]); - - UINT8 r = (p >> rshift) & 0x1f; - UINT8 g = (p >> gshift) & 0x1f; - UINT8 b = (p >> bshift) & 0x1f; - - r = (r * 8) + (r / 4); - g = (g * 8) + (g / 4); - b = (b * 8) + (b / 4); - - return BurnHighCol(r, g, b, 0); -} - -static inline void PaletteUpdate5Bit(INT32 rshift, INT32 gshift, INT32 bshift) -{ - if (BurnPalette == NULL) return; - - for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++) - { - BurnPalette[i] = PaletteWrite5Bit(i, rshift, gshift, bshift); - } -} - -void BurnPaletteUpdate_xRRRRRGGGGGBBBBB() -{ - PaletteUpdate5Bit(10, 5, 0); -} - -void BurnPaletteUpdate_xBBBBBGGGGGRRRRR() -{ - PaletteUpdate5Bit(0, 5, 10); -} - -void BurnPaletteUpdate_xGGGGGBBBBBRRRRR() -{ - PaletteUpdate5Bit(0, 10, 5); -} - -void BurnPaletteUpdate_xGGGGGRRRRRBBBBB() -{ - PaletteUpdate5Bit(5, 10, 0); -} - -void BurnPaletteUpdate_GGGGGRRRRRBBBBBx() -{ - PaletteUpdate5Bit(6, 11, 1); -} - -void BurnPaletteWrite_xRRRRRGGGGGBBBBB(INT32 offset) -{ - offset /= 2; - - if (BurnPalette) { - BurnPalette[offset] = PaletteWrite5Bit(offset, 10, 5, 0); - } -} - -void BurnPaletteWrite_xBBBBBGGGGGRRRRR(INT32 offset) -{ - offset /= 2; - - if (BurnPalette) { - BurnPalette[offset] = PaletteWrite5Bit(offset, 0, 5, 10); - } -} - -void BurnPaletteWrite_xGGGGGBBBBBRRRRR(INT32 offset) -{ - offset /= 2; - - if (BurnPalette) { - BurnPalette[offset] = PaletteWrite5Bit(offset, 0, 10, 5); - } -} - -void BurnPaletteWrite_xGGGGGRRRRRBBBBB(INT32 offset) -{ - offset /= 2; - - if (BurnPalette) { - BurnPalette[offset] = PaletteWrite5Bit(offset, 5, 10, 0); - } -} - -void BurnPaletteWrite_GGGGGRRRRRBBBBBx(INT32 offset) -{ - offset /= 2; - - if (BurnPalette) { - BurnPalette[offset] = PaletteWrite5Bit(offset, 6, 11, 1); - } -} - -//------------------------------------------------------------------------------------- - -void BurnPaletteUpdate_RRRRGGGGBBBBRGBx() -{ - if (BurnPalRAM == NULL || BurnPalette == NULL) return; - - UINT16 *pal = (UINT16*)BurnPalRAM; - - for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++) - { - UINT16 p = BURN_ENDIAN_SWAP_INT16(pal[i]); - - UINT8 r = ((p >> 11) & 0x1e) | ((p >> 3) & 0x01); - UINT8 g = ((p >> 7) & 0x1e) | ((p >> 2) & 0x01); - UINT8 b = ((p >> 3) & 0x1e) | ((p >> 1) & 0x01); - - r = (r * 8) + (r / 4); - g = (g * 8) + (g / 4); - b = (b * 8) + (b / 4); - - BurnPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -void BurnPaletteWrite_RRRRGGGGBBBBRGBx(INT32 offset) -{ - if (BurnPalRAM == NULL || BurnPalette == NULL) return; - - offset /= 2; - - UINT16 *pal = (UINT16*)BurnPalRAM; - UINT16 p = BURN_ENDIAN_SWAP_INT16(pal[offset]); - - UINT8 r = ((p >> 11) & 0x1e) | ((p >> 3) & 0x01); - UINT8 g = ((p >> 7) & 0x1e) | ((p >> 2) & 0x01); - UINT8 b = ((p >> 3) & 0x1e) | ((p >> 1) & 0x01); - - r = (r * 8) + (r / 4); - g = (g * 8) + (g / 4); - b = (b * 8) + (b / 4); - - BurnPalette[offset] = BurnHighCol(r, g, b, 0); -} - -//------------------------------------------------------------------------------------- - -static inline void palette_update_8bit(INT32 r_mask, INT32 g_mask, INT32 b_mask, INT32 r_shift, INT32 g_shift, INT32 b_shift, INT32 invert) -{ - if (BurnPalRAM == NULL || BurnPalette == NULL) return; - - r_mask = (1 << r_mask) - 1; - g_mask = (1 << g_mask) - 1; - b_mask = (1 << b_mask) - 1; - invert = (invert) ? 0xff : 0; - - for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++) - { - UINT8 p = BurnPalRAM[i] ^ invert; - UINT8 r = (p >> r_shift) & r_mask; - UINT8 g = (p >> g_shift) & g_mask; - UINT8 b = (p >> b_shift) & b_mask; - - if (r_mask == 3) r = pal2bit(r); - if (r_mask == 7) r = pal3bit(r); - - if (g_mask == 3) g = pal2bit(r); - if (g_mask == 7) g = pal3bit(r); - - if (b_mask == 3) b = pal2bit(r); - if (b_mask == 7) b = pal3bit(r); - - BurnPalette[i] = BurnHighCol(r,g,b,0); - } -} - -void BurnPaletteUpdate_BBGGGRRR() -{ - palette_update_8bit(3, 3, 2, 0, 3, 6, 0); -} - -void BurnPaletteUpdate_RRRGGGBB() -{ - palette_update_8bit(3, 3, 2, 5, 2, 0, 0); -} - -void BurnPaletteUpdate_BBGGGRRR_inverted() -{ - palette_update_8bit(3, 3, 2, 0, 3, 6, 1); -} - -void BurnPaletteUpdate_RRRGGGBB_inverted() -{ - palette_update_8bit(3, 3, 2, 5, 2, 0, 1); -} - -static inline void palette_write_8bit(INT32 offset, INT32 r_shift, INT32 g_shift, INT32 b_shift, INT32 r_mask, INT32 g_mask, INT32 b_mask, INT32 invert) -{ - if (BurnPalRAM == NULL || BurnPalette == NULL) return; - - UINT8 p = BurnPalRAM[offset] ^ invert; - UINT8 r = (p >> r_shift) & r_mask; - UINT8 g = (p >> g_shift) & g_mask; - UINT8 b = (p >> b_shift) & b_mask; - - if (r_mask == 3) r = pal2bit(r); - if (r_mask == 7) r = pal3bit(r); - - if (g_mask == 3) g = pal2bit(r); - if (g_mask == 7) g = pal3bit(r); - - if (b_mask == 3) b = pal2bit(r); - if (b_mask == 7) b = pal3bit(r); - - BurnPalette[offset] = BurnHighCol(r,g,b,0); -} - -void BurnPaletteWrite_BBGGGRRR(INT32 offset) -{ - palette_write_8bit(offset, 3, 3, 2, 0, 3, 6, 0); -} - -void BurnPaletteWrite_RRRGGGBB(INT32 offset) -{ - palette_write_8bit(offset, 3, 3, 2, 5, 2, 0, 0); -} - -void BurnPaletteWrite_BBGGGRRR_inverted(INT32 offset) -{ - palette_write_8bit(offset, 3, 3, 2, 0, 3, 6, 1); -} - -void BurnPaletteWrite_RRRGGGBB_inverted(INT32 offset) -{ - palette_write_8bit(offset, 3, 3, 2, 5, 2, 0, 1); -} diff --git a/jan/src/burn/burn_pal.h b/jan/src/burn/burn_pal.h deleted file mode 100644 index e0d58d471..000000000 --- a/jan/src/burn/burn_pal.h +++ /dev/null @@ -1,47 +0,0 @@ -// Common RAM-based palette decoding functions - -// point these to destination palette and to palette ram - -extern UINT32 *BurnPalette; -extern UINT8 *BurnPalRAM; - -// palette update functions are called to recalculate the entire palette - -void BurnPaletteUpdate_xxxxBBBBRRRRGGGG(); -void BurnPaletteUpdate_xxxxBBBBGGGGRRRR(); -void BurnPaletteUpdate_xxxxRRRRGGGGBBBB(); -void BurnPaletteUpdate_xRRRRRGGGGGBBBBB(); -void BurnPaletteUpdate_xBBBBBGGGGGRRRRR(); -void BurnPaletteUpdate_xGGGGGBBBBBRRRRR(); -void BurnPaletteUpdate_xGGGGGRRRRRBBBBB(); -void BurnPaletteUpdate_GGGGGRRRRRBBBBBx(); -void BurnPaletteUpdate_RRRRGGGGBBBBRGBx(); -void BurnPaletteUpdate_BBGGGRRR(); -void BurnPaletteUpdate_RRRGGGBB(); -void BurnPaletteUpdate_BBGGGRRR_inverted(); -void BurnPaletteUpdate_RRRGGGBB_inverted(); - -// palette write functions called to write single palette entry -// note that the offset should not be shifted, only masked for palette size - -void BurnPaletteWrite_xxxxBBBBRRRRGGGG(INT32 offset); -void BurnPaletteWrite_xxxxBBBBGGGGRRRR(INT32 offset); -void BurnPaletteWrite_xxxxRRRRGGGGBBBB(INT32 offset); -void BurnPaletteWrite_xRRRRRGGGGGBBBBB(INT32 offset); -void BurnPaletteWrite_xBBBBBGGGGGRRRRR(INT32 offset); -void BurnPaletteWrite_xGGGGGBBBBBRRRRR(INT32 offset); -void BurnPaletteWrite_xGGGGGRRRRRBBBBB(INT32 offset); -void BurnPaletteWrite_GGGGGRRRRRBBBBBx(INT32 offset); -void BurnPaletteWrite_RRRRGGGGBBBBRGBx(INT32 offset); -void BurnPaletteWrite_BBGGGRRR(INT32 offset); -void BurnPaletteWrite_RRRGGGBB(INT32 offset); -void BurnPaletteWrite_BBGGGRRR_inverted(INT32 offset); -void BurnPaletteWrite_RRRGGGBB_inverted(INT32 offset); - -// palette expansion macros - -#define pal5bit(x) ((((x) & 0x1f)<<3)|(((x) & 0x1f) >> 2)) -#define pal4bit(x) ((((x) & 0x0f)<<4)|(((x) & 0x0f) << 4)) -#define pal3bit(x) ((((x) & 0x07)<<5)|(((x) & 0x07) << 2)|(((x) & 0x07) >> 1)) -#define pal2bit(x) ((((x) & 0x03)<<6)|(((x) & 0x03) << 4)|(((x) & 0x03) << 2) | ((x) & 0x03)) -#define pal1bit(x) (((x) & 1) ? 0xff : 0) diff --git a/jan/src/burn/burn_shift.cpp b/jan/src/burn/burn_shift.cpp deleted file mode 100644 index e98c1f6d4..000000000 --- a/jan/src/burn/burn_shift.cpp +++ /dev/null @@ -1,402 +0,0 @@ -// FBAlpha Toggable Shifter and Gear Display -// -// For how-to, search BurnShift in konami/d_chqflag.cpp :) -// - -#include "burnint.h" -#include "burn_shift.h" - -INT32 BurnShiftEnabled = 1; // enable/disable rendering -INT32 bBurnShiftStatus; // current status of shifter - -static INT32 prev_shift; - -static INT32 shift_alpha_level; -static INT32 shift_alpha_level2; -static INT32 shift_alpha_level_grey; -static INT32 shift_alpha_level2_grey; -static INT32 shift_color; -static INT32 shift_size; -static INT32 shift_position0; -static INT32 shift_position; -static INT32 shift_xpos; -static INT32 shift_ypos; -static INT32 shift_xadv; -static INT32 shift_yadv; - -static INT32 nScreenWidth, nScreenHeight; -static INT32 screen_flipped; -static INT32 screen_vertical; -static INT32 flipscreen = -1; -static INT32 colortab[10] = { 0, 0, 0x42f4f4, 0xffffff, 0x0000ff, 0x9200f4, 0xf4f400, 0xf45900, 0x00d8f4, 0 }; -static INT32 lhtimer = 0; // color-cycle effect counter - -#define a 0, -#define b 1, -#define c 2, -#define d 3, -UINT8 BurnGearRender[8*8]; -#if 0 -// small font -UINT8 BurnGearL[8*8] = { - a a a a a a a a - a a a a a a a a - a a a b c a a a - a a a b c a a a - a a a b c c c a - a a a b b b c a - a a a c c c c a - a a a a a a a a }; - -UINT8 BurnGearH[8*8] = { - a a a a a a a a - a a a a a a a a - a a a b c b c a - a a a b b b c a - a a a b c b c a - a a a c c c c a - a a a a a a a a - a a a a a a a a }; -#endif -#if 0 -// blocky font (Gab75) -UINT8 BurnGearL[8*8] = { - b b d a a d a a - b b d a a d a a - d d d d d d d d - b b d a a d a a - b b d a a d a a - d d d d d d d d - b b d b b d b b - b b d b b d b b }; - -UINT8 BurnGearH[8*8] = { - b b d a a d b b - b b d a a d b b - d d d d d d d d - b b d b b d b b - b b d b b d b b - d d d d d d d d - b b d a a d b b - b b d a a d b b }; -#endif -#if 1 -// Shadow font (Gab75) -UINT8 BurnGearL[8*8] = { - a a a a a a a a - a a b b a a a a - a a b b c a a a - a a b b c a a a - a a b b c a a a - a a b b b b a a - a a a c c c c a - a a a a a a a a }; - -UINT8 BurnGearH[8*8] = { - a a a a a a a a - a b b a a b b a - a b b c a b b c - a b b b b b b c - a b b c c b b c - a b b c a b b c - a a c c a a c c - a a a a a a a a }; -#endif -#undef b -#undef a -#undef c -#undef d - -static UINT32 alpha_blend32(UINT32 d, UINT32 col) -{ - if (col == 3) col = 3 /*0x1f1f1f*/; else - if (col == 2) col = 0; else - if (lhtimer == 0) col = colortab[1]; else - col = colortab[lhtimer/2]; - - - if (col == 3) { // handle grey with a lighter transparency - col = 0x1f1f1f; - return (((((col & 0xff00ff) * shift_alpha_level_grey) + ((d & 0xff00ff) * shift_alpha_level2_grey)) & 0xff00ff00) | - ((((col & 0x00ff00) * shift_alpha_level_grey) + ((d & 0x00ff00) * shift_alpha_level2_grey)) & 0x00ff0000)) >> 8; - } - - return (((((col & 0xff00ff) * shift_alpha_level) + ((d & 0xff00ff) * shift_alpha_level2)) & 0xff00ff00) | - ((((col & 0x00ff00) * shift_alpha_level) + ((d & 0x00ff00) * shift_alpha_level2)) & 0x00ff0000)) >> 8; -} - -static void set_shift_draw_position() -{ - shift_position = shift_position0; - - if (screen_flipped ^ flipscreen) { - switch (shift_position & 3) { - case SHIFT_POSITION_TOP_LEFT: shift_position = SHIFT_POSITION_BOTTOM_RIGHT; break; - case SHIFT_POSITION_TOP_RIGHT: shift_position = SHIFT_POSITION_BOTTOM_LEFT; break; - case SHIFT_POSITION_BOTTOM_LEFT: shift_position = SHIFT_POSITION_TOP_RIGHT; break; - case SHIFT_POSITION_BOTTOM_RIGHT: shift_position = SHIFT_POSITION_TOP_LEFT; break; - } - } - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nScreenHeight, &nScreenWidth); - - screen_vertical = 1; - - shift_xadv = 0; - shift_yadv = shift_size + 1; - - switch (shift_position & 3) - { - case SHIFT_POSITION_TOP_LEFT: - shift_xpos = (nScreenWidth - 1) - shift_size; - shift_ypos = 1; - break; - - case SHIFT_POSITION_BOTTOM_RIGHT: - shift_xpos = 1; - shift_ypos = (nScreenHeight - 1) - (shift_yadv * 1); - break; - - case SHIFT_POSITION_BOTTOM_LEFT: - shift_xpos = 1; - shift_ypos = 1; - break; - - case SHIFT_POSITION_TOP_RIGHT: - default: - shift_xpos = (nScreenWidth - 1) - shift_size; - shift_ypos = (nScreenHeight - 1) - (shift_yadv * 1); - break; - } - } else { - BurnDrvGetVisibleSize(&nScreenWidth, &nScreenHeight); - - screen_vertical = 0; - - shift_xadv = shift_size + 1; - shift_yadv = 0; - - switch (shift_position & 3) - { - case SHIFT_POSITION_BOTTOM_LEFT: - shift_xpos = 1; - shift_ypos = (nScreenHeight - 1) - shift_size; -// shift_ypos; - break; - - case SHIFT_POSITION_TOP_RIGHT: - shift_xpos = (nScreenWidth - 1) - (shift_xadv * 1); - shift_ypos = 1; - break; - - case SHIFT_POSITION_TOP_LEFT: - shift_xpos = 1; - shift_ypos = 1; - break; - - case SHIFT_POSITION_BOTTOM_RIGHT: - default: - shift_xpos = (nScreenWidth - 1) - (shift_xadv * 1); - shift_ypos = (nScreenHeight - 1) - shift_size; - break; - } - } -} - -void BurnShiftSetFlipscreen(INT32 flip) -{ -#if defined FBA_DEBUG - if (!Debug_BurnShiftInitted) bprintf(PRINT_ERROR, _T("BurnShiftSetFlipscreen called without init\n")); -#endif - - flip = flip ? 1 : 0; - - if (flipscreen != flip) { - flipscreen = flip; - set_shift_draw_position(); - } -} - -void BurnShiftReset() -{ -#if defined FBA_DEBUG - if (!Debug_BurnShiftInitted) bprintf(PRINT_ERROR, _T("BurnShiftReset called without init\n")); -#endif - - prev_shift = 0; - - BurnShiftSetStatus(0); - - BurnShiftSetFlipscreen(0); - - lhtimer = 0; -} - -void BurnShiftInit(INT32 position, INT32 color, INT32 transparency) -{ - Debug_BurnShiftInitted = 1; - - colortab[1] = shift_color = color; - - shift_size = 8; - shift_position0 = position; - - shift_alpha_level = (255 * transparency) / 100; - shift_alpha_level2 = 256 - shift_alpha_level; - - shift_alpha_level_grey = (255 * 20) / 100; - shift_alpha_level2_grey = 256 - shift_alpha_level_grey; - - screen_flipped = (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) ? 1 : 0; - screen_vertical = (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) ? 1 : 0; - - BurnShiftReset(); -} - -void BurnShiftInitDefault() -{ - BurnShiftInit(SHIFT_POSITION_BOTTOM_RIGHT, SHIFT_COLOR_GREEN, 80); -} - -INT32 BurnShiftInputCheckToggle(UINT8 shiftinput) -{ - if (prev_shift != shiftinput && shiftinput) { - bBurnShiftStatus = !bBurnShiftStatus; - BurnShiftSetStatus(bBurnShiftStatus); - } - - prev_shift = shiftinput; - - return bBurnShiftStatus; -} - -void BurnShiftSetStatus(UINT32 status) -{ -#if defined FBA_DEBUG - if (!Debug_BurnShiftInitted) bprintf(PRINT_ERROR, _T("BurnShiftSetStatus called without init\n")); -#endif - - bBurnShiftStatus = status ? 1 : 0; - - UINT8 *source = (status) ? &BurnGearH[0] : &BurnGearL[0]; - - for (UINT8 y = 0; y < 8; y++) - for (UINT8 x = 0; x < 8; x++) - { - if ((screen_flipped ^ flipscreen)) { - if (screen_vertical) - { // flipped + vertical - BurnGearRender[(y * 8) + x] = source[(x * 8) + (7-y)]; - } - else - { // flipped - BurnGearRender[(y * 8) + x] = source[(y * 8) + (7-x)]; - } - } else if (screen_vertical) - { // vertical - BurnGearRender[(y * 8) + x] = source[(x * 8) + y]; - } else - { // normal - BurnGearRender[(y * 8) + x] = source[(y * 8) + x]; - } - } - lhtimer = 19; // for color effects -} - -void BurnShiftExit() -{ -#if defined FBA_DEBUG - if (!Debug_BurnShiftInitted) bprintf(PRINT_ERROR, _T("BurnShiftExit called without init\n")); -#endif - - shift_alpha_level = 0; - shift_alpha_level2 = 0; - shift_alpha_level_grey = 0; - shift_alpha_level2_grey = 0; - shift_color = 0; - shift_size = 0; - shift_position = 0; - shift_position0 = 0; - - shift_xpos = 0; - shift_ypos = 0; - - screen_flipped = 0; - nScreenWidth = 0; - nScreenHeight = 0; - lhtimer = 0; - - flipscreen = -1; - - Debug_BurnShiftInitted = 0; -} - -void BurnShiftRender() -{ -#if defined FBA_DEBUG - if (!Debug_BurnShiftInitted) bprintf(PRINT_ERROR, _T("BurnShiftRender called without init\n")); -#endif - - if (!BurnShiftEnabled) return; - - INT32 xpos = shift_xpos; - INT32 ypos = shift_ypos; - INT32 color = BurnHighCol((shift_color >> 16) & 0xff, (shift_color >> 8) & 0xff, (shift_color >> 0) & 0xff, 0); - - { - if (xpos < 0 || xpos > (nScreenWidth - shift_size)) return; - - { - for (INT32 y = 0; y < 8; y++) - { - UINT8 *ptr = pBurnDraw + (((ypos + y) * nScreenWidth) + xpos) * nBurnBpp; - - for (INT32 x = 0; x < 8; x++) { - if (BurnGearRender[(y*8)+x]) - { - if (nBurnBpp >= 4) - { - *((UINT32*)ptr) = alpha_blend32(*((UINT32*)ptr), BurnGearRender[(y*8)+x]); - } - else if (nBurnBpp == 3) - { - UINT32 t = alpha_blend32((ptr[2] << 16) | (ptr[1] << 8) | ptr[0], BurnGearRender[(y*8)+x]); - - ptr[2] = t >> 16; - ptr[1] = t >> 8; - ptr[0] = t >> 0; - } - else if (nBurnBpp == 2 && BurnGearRender[(y*8)+x] == 1) // alpha blend not supported for 16-bit - { - *((UINT16*)ptr) = color; - } - } - ptr += nBurnBpp; - } - } - } - - xpos += shift_xadv; - ypos += shift_yadv; - } - if (lhtimer > 0) lhtimer--; -} - -INT32 BurnShiftScan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!Debug_BurnShiftInitted) bprintf(PRINT_ERROR, _T("BurnShiftScan called without init\n")); -#endif - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(bBurnShiftStatus); - } - - if (nAction & ACB_WRITE) { - BurnShiftSetStatus(bBurnShiftStatus); - lhtimer = 0; - } - - return 0; -} diff --git a/jan/src/burn/burn_shift.h b/jan/src/burn/burn_shift.h deleted file mode 100644 index 04010624e..000000000 --- a/jan/src/burn/burn_shift.h +++ /dev/null @@ -1,27 +0,0 @@ - -#define SHIFT_COLOR_RED 0xff0000 -#define SHIFT_COLOR_GREEN 0x00ff00 -#define SHIFT_COLOR_BLUE 0x0000ff -#define SHIFT_COLOR_WHITE 0xffffff -#define SHIFT_COLOR_YELLOW 0xffff00 - -#define SHIFT_POSITION_TOP_LEFT 0 -#define SHIFT_POSITION_TOP_RIGHT 1 -#define SHIFT_POSITION_BOTTOM_LEFT 2 -#define SHIFT_POSITION_BOTTOM_RIGHT 3 - -// transparency is a percentage 0 - 100 -void BurnShiftInit(INT32 position, INT32 color, INT32 transparency); -void BurnShiftInitDefault(); - -void BurnShiftReset(); -void BurnShiftSetFlipscreen(INT32 flip); -void BurnShiftRender(); -void BurnShiftSetStatus(UINT32 status); -INT32 BurnShiftInputCheckToggle(UINT8 shiftinput); -void BurnShiftExit(); - -INT32 BurnShiftScan(INT32 nAction); - -extern INT32 BurnShiftEnabled; -extern INT32 bBurnShiftStatus; diff --git a/jan/src/burn/burn_sound.cpp b/jan/src/burn/burn_sound.cpp deleted file mode 100644 index 46850ce94..000000000 --- a/jan/src/burn/burn_sound.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" - -INT16 Precalc[4096 *4]; - -// Routine used to precalculate the table used for interpolation -INT32 cmc_4p_Precalc() -{ - INT32 a, x, x2, x3; - - for (a = 0; a < 4096; a++) { - x = a * 4; // x = 0..16384 - x2 = x * x / 16384; // pow(x, 2); - x3 = x2 * x / 16384; // pow(x, 3); - - Precalc[a * 4 + 0] = (INT16)(-x / 3 + x2 / 2 - x3 / 6); - Precalc[a * 4 + 1] = (INT16)(-x / 2 - x2 + x3 / 2 + 16384); - Precalc[a * 4 + 2] = (INT16)( x + x2 / 2 - x3 / 2); - Precalc[a * 4 + 3] = (INT16)(-x / 6 + x3 / 6); - } - - return 0; -} diff --git a/jan/src/burn/burn_sound.h b/jan/src/burn/burn_sound.h deleted file mode 100644 index f923e56f8..000000000 --- a/jan/src/burn/burn_sound.h +++ /dev/null @@ -1,48 +0,0 @@ -// burn_sound.h - General sound support functions -// based on code by Daniel Moreno (ComaC) < comac2k@teleline.es > - -#if defined BUILD_X86_ASM -extern "C" { - int __cdecl ChannelMix_QS_A(int* Dest, int nLen, - char* Sample, int LoopEnd, - int* Pos, - int VolL, int VolR, - int LoopLen, - int IncPos, - char* EndBuff); - - void __cdecl BurnSoundCopyClamp_A(int* Src, short* Dest, int Len); - void __cdecl BurnSoundCopyClamp_Add_A(int* Src, short* Dest, int Len); - - void __cdecl BurnSoundCopyClamp_Mono_A(int* Src, short* Dest, int Len); - void __cdecl BurnSoundCopyClamp_Mono_Add_A(int* Src, short* Dest, int Len); - - void __cdecl BurnSoundCopy_FM_A(short* SrcL, short* SrcR, short* Dest, int Len, int VolL, int VolR); - void __cdecl BurnSoundCopy_FM_Add_A(short* SrcL, short* SrcR, short* Dest, int Len, int VolL, int VolR); - - /* SrcOPN should have left channel data at SrcOPN, right channel at SrcOPN + 4096, SrcPSG should have all summed channels */ - void __cdecl BurnSoundCopy_FM_OPN_A(short* SrcOPN, int* SrcPSG, short* Dest, int Len, int VolPSGL, int VolPSGR); - void __cdecl BurnSoundCopy_FM_OPN_Add_A(short* SrcOPN, int* SrcPSG, short* Dest, int Len, int VolPSGL, int VolPSGR); -} -#endif - -void BurnSoundCopyClamp_C(INT32* Src, INT16* Dest, INT32 Len); -void BurnSoundCopyClamp_Add_C(INT32* Src, INT16* Dest, INT32 Len); -void BurnSoundCopyClamp_Mono_C(INT32* Src, INT16* Dest, INT32 Len); -void BurnSoundCopyClamp_Mono_Add_C(INT32* Src, INT16* Dest, INT32 Len); - -extern INT32 cmc_4p_Precalc(); - -#ifdef __ELF__ - #define Precalc _Precalc -#endif - -extern "C" INT16 Precalc[]; - -#define INTERPOLATE4PS_8BIT(fp, sN, s0, s1, s2) (((INT32)((sN) * Precalc[(INT32)(fp) * 4 + 0]) + (INT32)((s0) * Precalc[(INT32)(fp) * 4 + 1]) + (INT32)((s1) * Precalc[(INT32)(fp) * 4 + 2]) + (INT32)((s2) * Precalc[(INT32)(fp) * 4 + 3])) / 64) -#define INTERPOLATE4PS_16BIT(fp, sN, s0, s1, s2) (((INT32)((sN) * Precalc[(INT32)(fp) * 4 + 0]) + (INT32)((s0) * Precalc[(INT32)(fp) * 4 + 1]) + (INT32)((s1) * Precalc[(INT32)(fp) * 4 + 2]) + (INT32)((s2) * Precalc[(INT32)(fp) * 4 + 3])) / 16384) -#define INTERPOLATE4PS_CUSTOM(fp, sN, s0, s1, s2, v) (((INT32)((sN) * Precalc[(INT32)(fp) * 4 + 0]) + (INT32)((s0) * Precalc[(INT32)(fp) * 4 + 1]) + (INT32)((s1) * Precalc[(INT32)(fp) * 4 + 2]) + (INT32)((s2) * Precalc[(INT32)(fp) * 4 + 3])) / (INT32)(v)) - -#define INTERPOLATE4PU_8BIT(fp, sN, s0, s1, s2) (((UINT32)((sN) * Precalc[(INT32)(fp) * 4 + 0]) + (UINT32)((s0) * Precalc[(INT32)(fp) * 4 + 1]) + (UINT32)((s1) * Precalc[(INT32)(fp) * 4 + 2]) + (UINT32)((s2) * Precalc[(INT32)(fp) * 4 + 3])) / 64) -#define INTERPOLATE4PU_16BIT(fp, sN, s0, s1, s2) (((UINT32)((sN) * Precalc[(INT32)(fp) * 4 + 0]) + (UINT32)((s0) * Precalc[(INT32)(fp) * 4 + 1]) + (UINT32)((s1) * Precalc[(INT32)(fp) * 4 + 2]) + (UINT32)((s2) * Precalc[(INT32)(fp) * 4 + 3])) / 16384) -#define INTERPOLATE4PU_CUSTOM(fp, sN, s0, s1, s2, v) (((UINT32)((sN) * Precalc[(INT32)(fp) * 4 + 0]) + (UINT32)((s0) * Precalc[(INT32)(fp) * 4 + 1]) + (UINT32)((s1) * Precalc[(INT32)(fp) * 4 + 2]) + (UINT32)((s2) * Precalc[(INT32)(fp) * 4 + 3])) / (UINT32)(v)) diff --git a/jan/src/burn/burn_sound_a.asm b/jan/src/burn/burn_sound_a.asm deleted file mode 100644 index 577358851..000000000 --- a/jan/src/burn/burn_sound_a.asm +++ /dev/null @@ -1,751 +0,0 @@ -; MMX general sound support + PCM channel mixing -; based on code by Daniel Moreno (ComaC) - 2001 < comac2k@teleline.es > - -; ChannelMix_QS mixes one channel using 4 point, 3rd order interpolation. -; The volume of the resulting audio is 64 times louder, to have extra precision -; when mixing the channels. -; -; The BurnSoundCopy* functions convert a 32-bit (interleaved stereo or mono) buffer -; to interleaved 16-bit stereo, clamping and dividing volume by 256 on the fly. -; -; BurnSoundCopy_FM interleaves 2 16-bit buffers into a single interleaved stereo buffer, -; correcting volume (variable) on the fly -; -; BurnSoundCopy_FM interleaves 2 16-bit buffers into a single interleaved stereo buffer, -; adding a 3rd 32-bit buffer correcting volume on the 3rd buffer (variable) on the fly - -[BITS 32] - -global ChannelMix_QS_A -global _ChannelMix_QS_A - -global ChannelMix_8U_A -global _ChannelMix_8U_A - -global BurnSoundCopyClamp_A -global _BurnSoundCopyClamp_A -global BurnSoundCopyClamp_Add_A -global _BurnSoundCopyClamp_Add_A - -global _BurnSoundCopyClamp_Mono_A -global BurnSoundCopyClamp_Mono_A -global _BurnSoundCopyClamp_Mono_Add_A -global BurnSoundCopyClamp_Mono_Add_A - -global BurnSoundCopy_FM_A -global _BurnSoundCopy_FM_A -global BurnSoundCopy_FM_Add_A -global _BurnSoundCopy_FM_Add_A - -global _BurnSoundCopy_FM_OPN_A -global BurnSoundCopy_FM_OPN_A -global _BurnSoundCopy_FM_OPN_Add_A -global BurnSoundCopy_FM_OPN_Add_A - -extern _Precalc - - - -section .text - -; This macro is used from other functions. It contains the main mixing -; loop for 8 bit samples. At its input it expects: -; -; EAX -> pointer to sample buffer -; EBX -> index inside sample (current position) -; ECX -> index of the first sample that does NOT have to play (LoopEnd) -; ESI -> pointer to destination buffer -; mm3 -> Volumes Low = Left, High = Right -; -; Param 1 -> dword containing position increment -; Param 2 -> dword containing loop length -; Param 3 -> dword containing size of out buffer in samples -; Param 4 -> pointer to enf buffer -; Param 5 -> instructions to do to unpacked samples, or text NONE if none -; -; At exit: -; -; EBX -> next position to play -; EDX -> destroyed -; [Param 2] -> updated acordingly -; [Param 4] -> zero -; mm0 -> destroyed -; mm1 -> destroyed - -%macro Mix_Loop 5 - -%define INCR %1 -%define LOOP %2 -%define BUFLEN %3 -%define ENDBUF %4 - - cmp EBX, ECX ; Past the end? - jl %%Sigue ; No? -> Continue - -%%PassedEnd: - mov EDX, ECX ; We are at or near the end of the sample - add EDX, 0x3000 ; We need to either stop, set the pointer - and EDX, (0xFFFF << 12) ; to the loop point, or render a few samples - cmp EBX, EDX ; from the end buffer - jge %%LoopCheck ; - - ; We need to render samples from the end buffer - - push EBX ; We need to copy EBX to EDX (!!!) - pxor mm0, mm0 ; Zero mm0 (to do zero extension of sample) - - add EBX, 0x4000 ; load end buffer in EDX, index in EBX - sub EBX, EDX ; - mov EDX, ENDBUF ; - shr EBX, 12 ; - - punpcklbw mm0, [EDX + EBX] ; Load & unpack samples (from the end buffer) to 16 bit - - pop EDX ; !!! - jmp %%Interpolate - -%%LoopCheck: - cmp LOOP, 0x1000 ; > 0x1000 - jg %%SetLoopPoint ; Yes -> Loop Sample - cmp LOOP, 0 - je %%EndSample - - mov EBX, ECX ; Kludge to work around some situations - add EBX, 0x2000 ; where the QSound hardware is left in - jmp %%End_StayOn ; a non-standard state (e.g. DDTOD, DDSOM) - -%%EndSample: - xor EBX, EBX - xor EAX, EAX ; set bKey to zero - jmp %%End ; exit function - -%%SetLoopPoint: - sub EBX, LOOP ; Set EBX to the loop point - -%%NextSample: - cmp EBX, ECX ; Passed the end? - jge %%PassedEnd - -%%Sigue: - mov EDX, EBX - and EBX, (0xFFFF << 12) ; QSound banks are 0x10000 bytes - shr EBX, 12 ; EBX = Integer(nPos) - - pxor mm0, mm0 ; Zero mm0 (to do zero extension of sample) - punpcklbw mm0, [EAX + EBX] ; Load & unpack samples to 16 bit - -%%Interpolate: - mov EBX, EDX - and EDX, 0x0FFF ; EDX = Decimal(nPos) - - ; Execute sign adaptation instructions if necessary: - -%ifnidni %5, NONE - pxor mm0, %5 -%endif - - ; Interpolate sample - - pmaddwd mm0, [_Precalc + EDX*8] ; Get multipliers - movq mm1, mm0 ; We need High(mm0) + Low(mm0) - psrlq mm0, 32 ; mm0 = High(mm0) - paddd mm0, mm1 ; mm0 = Sample interpolated * 16384 - psrad mm0, 16 ; Shift samples right - packssdw mm0, mm0 ; Hi(mm0) = sample, Low(mm0) = sample - - add EBX, INCR ; Advance counters - pmaddwd mm0, mm3 ; Multiply samples with volume - dec BUFLEN ; 1 sample less left - - paddd mm0, [ESI] ; Add to buffer - movq [ESI], mm0 ; Store result on buffer - - lea ESI, [ESI + 8] - jnz %%NextSample ; Continue if there are more samples - -%%End_StayOn: - mov EAX, 1 ; leave bKey at 1 -%%End: - -%endmacro - -; Parameters to ChannelMix_QS/8U: - -%define BuffDest dword [EBP + 8] -%define BuffLen dword [EBP + 12] -%define SampleBuff dword [EBP + 16] -%define LoopEnd dword [EBP + 20] -%define PosPtr dword [EBP + 24] -%define Volumes qword [EBP + 28] -%define LoopLen dword [EBP + 36] -%define IncrPos dword [EBP + 40] -%define EndBuff dword [EBP + 44] - -_ChannelMix_QS_A: -ChannelMix_QS_A: - - push EBP - mov EBP, ESP - - push EBX - push ESI - push EDI - - mov EAX, SampleBuff ; EAX = Sample Buffer - mov EBX, PosPtr - - movq mm3, Volumes ; mm3 = Volumes - - mov EBX, [EBX] ; EBX = Sample Position - mov ECX, LoopEnd ; ECX = LoopEnd - sub ECX, 0x3000 - mov ESI, BuffDest ; ESI = destionation buffer - mov EDI, IncrPos ; EDI = IncrPos - - Mix_Loop EDI, LoopLen, BuffLen, EndBuff, NONE - - mov ECX, PosPtr - pop EDI - pop ESI - mov [ECX], EBX ; Save position - -; emms - pop EBX - pop EBP - ret - - -_ChannelMix_8U_A: -ChannelMix_8U_A: - - push EBP - mov EBP, ESP - - push EBX - push ESI - push EDI - - mov EAX, SampleBuff ; EAX = Sample Buffer - mov EBX, PosPtr - - movq mm3, Volumes ; mm3 = Volumes - movq mm4, [XorSign] ; mm4 = Value to xor to adapt sign - - dec EAX - mov EBX, [EBX] ; EBX = Sample Position - mov ECX, LoopEnd ; ECX = LoopEnd - mov ESI, BuffDest ; ESI = destionation buffer - mov EDI, IncrPos ; EDI = IncrPos - - Mix_Loop EDI, LoopLen, BuffLen, EndBuff, mm4 - - mov ECX, PosPtr - pop EDI - pop ESI - mov [ECX], EBX ; Save position - -; emms - pop EBX - pop EBP - ret - - -; Parameters to BurnSoundCopyClamp* functions - -%define BufSrc [EBP + 8] -%define BufDest [EBP + 12] -%define Len [EBP + 16] - -_BurnSoundCopyClamp_A: -BurnSoundCopyClamp_A: - - push EBP - mov EBP, ESP - - mov ECX, BufSrc ; ECX = Buff Src - mov EDX, BufDest ; EDX = Buff Dest - - mov EAX, Len ; EAX = Length - shr EAX, 1 - je .LastSample - -.Loop: - movq mm0, [ECX] ; Hi(mm0) = SampleR*256, Low(mm0) = SampleL*256 - movq mm1, [ECX + 8] ; Load next sample too - psrad mm0, 8 ; Hi(mm0) = Sample1R, Low(mm0) = Sample1L - psrad mm1, 8 ; Hi(mm1) = Sample2R, Low(mm1) = Sample2L - add ECX, byte 16 ; ECX -> next samples - - packssdw mm0, mm1 ; We have both samples packed here - dec EAX ; 2 samples less left - - movq [EDX], mm0 ; Save the result - - lea EDX, [EDX + 8] ; EDX -> next sample - jnz .Loop ; Continue if there are more samples - -.LastSample: - mov EAX, Len ; EAX = Length - test EAX, 1 - je .End - - ; We need to handle an odd amount of sample pairs. - ; Handle the last sample pair here - - movq mm0, [ECX] - psrad mm0, 8 - packssdw mm0, mm0 - movd [EDX], mm0 - -.End: - emms ; Done with MMX - pop EBP - ret - -_BurnSoundCopyClamp_Add_A: -BurnSoundCopyClamp_Add_A: - - push EBP - mov EBP, ESP - - mov ECX, BufSrc ; ECX = Buff Src - mov EDX, BufDest ; EDX = Buff Dest - - mov EAX, Len ; EAX = Length - shr EAX, 1 - je .LastSample - -.Loop: - movq mm0, [ECX] ; Hi(mm0) = SampleR*256, Low(mm0) = SampleL*256 - movq mm1, [ECX + 8] ; Load next sample too - psrad mm0, 8 ; Hi(mm0) = Sample1R, Low(mm0) = Sample1L - psrad mm1, 8 ; Hi(mm1) = Sample2R, Low(mm1) = Sample2L - add ECX, byte 16 ; ECX -> next samples - - packssdw mm0, mm1 ; Here we have the 2 samples packed - - paddsw mm0, [EDX] ; Add to the contents of the buffer - dec EAX ; 2 samples less left - - movq [EDX], mm0 ; Save the result - - lea EDX, [EDX + 8] ; EDX -> next 2 samples - jnz .Loop ; Continue if there are more samples - -.LastSample: - mov EAX, Len ; EAX = Length - test EAX, 1 - je .End - - ; We need to handle an odd amount of sample pairs. - ; Handle the last sample pair here - - movq mm0, [ECX] - psrad mm0, 8 - packssdw mm0, mm0 - movd mm1, [EDX] - paddsw mm0, mm1 - movd [EDX], mm0 - -.End: - emms ; Done with MMX - pop EBP - ret - -_BurnSoundCopyClamp_Mono_A: -BurnSoundCopyClamp_Mono_A: - - push EBP - mov EBP, ESP - - mov ECX, BufSrc ; ECX = Buff Src - mov EDX, BufDest ; EDX = Buff Dest - - mov EAX, Len ; EAX = Length - shr EAX, 1 - je .LastSample - -.Loop: - movq mm0, [ECX] ; Hi(mm0) = Sample2*256, Low(mm0) = Sample1*256 - psrad mm0, 8 ; Hi(mm0) = Sample2, Low(mm0) = Sample1 - add ECX, byte 8 ; ECX -> next samples - packssdw mm0, mm0 ; We have both samples packed here - punpcklwd mm0, mm0 - - dec EAX ; 2 samples less left - - movq [EDX], mm0 ; Save the result - - lea EDX, [EDX + 8] ; EDX -> next sample - jnz .Loop ; Continue if there are more samples - -.LastSample: - mov EAX, Len ; EAX = Length - test EAX, 1 - je .End - - ; We need to handle an odd amount of samples. - ; Handle the last sample here - - movd mm0, [ECX] - psrad mm0, 8 - packssdw mm0, mm0 - punpcklwd mm0, mm0 - movd [EDX], mm0 - -.End: - emms ; Done with MMX - pop EBP - ret - -_BurnSoundCopyClamp_Mono_Add_A: -BurnSoundCopyClamp_Mono_Add_A: - - push EBP - mov EBP, ESP - - mov ECX, BufSrc ; ECX = Buff Src - mov EDX, BufDest ; EDX = Buff Dest - - mov EAX, Len ; EAX = Length - shr EAX, 1 - je .LastSample - -.Loop: - movq mm0, [ECX] ; Hi(mm0) = Sample2*256, Low(mm0) = Sample1*256 - psrad mm0, 8 ; Hi(mm0) = Sample2, Low(mm0) = Sample1 - add ECX, byte 8 ; ECX -> next samples - packssdw mm0, mm0 ; We have both samples packed here - punpcklwd mm0, mm0 - - paddsw mm0, [EDX] ; Add to the contents of the buffer - dec EAX ; 2 samples less left - - movq [EDX], mm0 ; Save the result - - lea EDX, [EDX + 8] ; EDX -> next 2 samples - jnz .Loop ; Continue if there are more samples - -.LastSample: - mov EAX, Len ; EAX = Length - test EAX, 1 - je .End - - ; We need to handle an odd amount of samples. - ; Handle the last sample here - - movd mm0, [ECX] - psrad mm0, 8 - packssdw mm0, mm0 - punpcklwd mm0, mm0 - movd mm1, [EDX] - paddsw mm0, mm1 - movd [EDX], mm0 - -.End: - emms ; Done with MMX - pop EBP - ret - -; Parameters to BurnSoundCopy_FM - -%define BufSrcL dword [EBP + 8] -%define BufSrcR dword [EBP + 12] -%define BufDest dword [EBP + 16] -%define Len dword [EBP + 20] -%define Volumes qword [EBP + 24] - -_BurnSoundCopy_FM_A: -BurnSoundCopy_FM_A: - - push EBP - mov EBP, ESP - push EBX - - movq mm1, Volumes - packssdw mm1, Volumes - - ; mm1 now holds the volumes as packed words - - mov EAX, Len ; EAX = Length - - mov EDX, BufDest ; EDX = BufDest - mov ECX, BufSrcR ; ECX = BufSrcR - mov EBX, BufSrcL ; EBX = BufSrcL - - shr EAX, 1 - je .LastSample - -.Loop: - movd mm0, [EBX] - punpcklwd mm0, [ECX] - - ; mm0 now has SrcR2 - SrcL2 - SrcR1 - SrcL1 - - pmulhw mm0, mm1 ; Multiply mm0 with volumes - - add EBX, byte 4 ; EBX -> next samples - add ECX, byte 4 ; ECX -> next samples - - dec EAX ; 2 sample less left - - movq [EDX], mm0 ; Save the result - - lea EDX, [EDX + 8] ; EDX -> next sample - jnz .Loop ; Continue if there are more samples - -.LastSample: - mov EAX, Len ; EAX = Length - test EAX, 1 - je .End - - ; We need to handle an odd amount of sample pairs. - ; Handle the last sample pair here - - movd mm0, [EBX] - punpcklwd mm0, [ECX] - - ; mm0 now has ? - ? - SrcR1 - SrcL1 - - pmulhw mm0, mm1 ; Multiply mm0 with volumes - - movd [EDX], mm0 ; Save the result - -.End: - emms ; Done with MMX - pop EBX - pop EBP - ret - -_BurnSoundCopy_FM_Add_A: -BurnSoundCopy_FM_Add_A: - - push EBP - mov EBP, ESP - push EBX - - movq mm1, Volumes - packssdw mm1, Volumes - - ; mm1 now holds the volumes as packed words - - mov EAX, Len ; EAX = Length - - mov EDX, BufDest ; EDX = BufDest - mov ECX, BufSrcR ; ECX = BufSrcR - mov EBX, BufSrcL ; EBX = BufSrcL - - shr EAX, 1 - je .LastSample - -.Loop: - movd mm0, [EBX] - punpcklwd mm0, [ECX] - - ; mm0 now has SrcR2 - SrcL2 - SrcR1 - SrcL1 - - pmulhw mm0, mm1 ; Multiply mm0 with volumes - - add EBX, byte 4 ; EBX -> next samples - add ECX, byte 4 ; ECX -> next samples - - paddsw mm0, [EDX] ; Add to the contents of the buffer - dec EAX ; 2 sample less left - - movq [EDX], mm0 ; Save the result - - lea EDX, [EDX + 8] ; EDX -> next sample - jnz .Loop ; Continue if there are more samples - -.LastSample: - mov EAX, Len ; EAX = Length - test EAX, 1 - je .End - - ; We need to handle an odd amount of sample pairs. - ; Handle the last sample pair here - - movd mm0, [EBX] - punpcklwd mm0, [ECX] - - ; mm0 now has ? - ? - SrcR1 - SrcL1 - - pmulhw mm0, mm1 ; Multiply mm0 with volumes - - movd mm1, [EDX] - paddsw mm0, mm1 ; Add to the contents of the buffer - movd [EDX], mm0 ; Save the result - -.End: - emms ; Done with MMX - pop EBX - pop EBP - ret - -; Parameters to BurnSoundCopyFM_OPN_A - -%define BufSrcOPN dword [EBP + 8] -%define BufSrcPSG dword [EBP + 12] -%define BufDest dword [EBP + 16] -%define Len dword [EBP + 20] -%define Volumes qword [EBP + 24] - -_BurnSoundCopy_FM_OPN_A: -BurnSoundCopy_FM_OPN_A: - - push EBP - mov EBP, ESP - push EBX - - movq mm4, Volumes - packssdw mm4, Volumes - - mov EBX, BufSrcOPN ; EBX = Buff Src (OPN) - mov ECX, BufSrcPSG ; ECX = Buff Src (PSG) - mov EDX, BufDest ; EDX = Buff Dest - - mov EAX, Len ; EAX = Length - shr EAX, 1 - je .LastSample - -.Loop: - movq mm0, [ECX] ; Hi(mm0) = Sample2, Low(mm0) = Sample1 - add ECX, byte 8 ; ECX -> next samples - - packssdw mm0, mm0 - - movd mm1, [EBX] ; OPN sample left - - punpcklwd mm0, mm0 - - ; mm0 now has SrcPSGR2 - SrcPSGL2 - SrcPSGR1 - SrcPSGL1 - - punpcklwd mm1, [EBX + 8192] ; OPN sample right - - ; mm1 now has SrcOPNR2 - SrcOPNL2 - SrcOPNR1 - SrcOPNL1 - - pmulhw mm0, mm4 ; Multiply mm0 with volumes - - add EBX, byte 4 ; EBX -> next samples - - paddsw mm0, mm1 - - dec EAX ; 2 samples less left - - movq [EDX], mm0 ; Save the result - - lea EDX, [EDX + 8] ; EDX -> next sample - jnz .Loop ; Continue if there are more samples - -.LastSample: - mov EAX, Len ; EAX = Length - test EAX, 1 - je .End - - ; We need to handle an odd amount of samples. - ; Handle the last sample here - - movd mm0, [ECX] - packssdw mm0, mm0 - movd mm1, [EBX] - punpcklwd mm0, mm0 - punpcklwd mm1, [EBX + 8192] - pmulhw mm0, mm4 - paddsw mm0, mm1 - - movd [EDX], mm0 - -.End: - emms ; Done with MMX - pop EBX - pop EBP - ret - -_BurnSoundCopy_FM_OPN_Add_A: -BurnSoundCopy_FM_OPN_Add_A: - - push EBP - mov EBP, ESP - push EBX - - movq mm4, Volumes - packssdw mm4, Volumes - - mov EBX, BufSrcOPN ; EBX = Buff Src (OPN) - mov ECX, BufSrcPSG ; ECX = Buff Src (PSG) - mov EDX, BufDest ; EDX = Buff Dest - - mov EAX, Len ; EAX = Length - shr EAX, 1 - je .LastSample - -.Loop: - movq mm0, [ECX] ; Hi(mm0) = Sample2, Low(mm0) = Sample1 - add ECX, byte 8 ; ECX -> next samples - - packssdw mm0, mm0 - - movd mm1, [EBX] ; OPN sample left - - punpcklwd mm0, mm0 - - ; mm0 now has SrcPSGR2 - SrcPSGL2 - SrcPSGR1 - SrcPSGL1 - - punpcklwd mm1, [EBX + 8192] ; OPN sample right - - ; mm1 now has SrcOPNR2 - SrcOPNL2 - SrcOPNR1 - SrcOPNL1 - - pmulhw mm0, mm4 ; Multiply mm0 with volumes - - add EBX, byte 4 ; EBX -> next samples - - paddsw mm0, mm1 - - paddsw mm0, [EDX] ; Add to the contents of the buffer - - dec EAX ; 2 samples less left - - movq [EDX], mm0 ; Save the result - - lea EDX, [EDX + 8] ; EDX -> next sample - jnz .Loop ; Continue if there are more samples - -.LastSample: - mov EAX, Len ; EAX = Length - test EAX, 1 - je .End - - ; We need to handle an odd amount of samples. - ; Handle the last sample here - - movd mm0, [ECX] - packssdw mm0, mm0 - movd mm1, [EBX] - punpcklwd mm0, mm0 - punpcklwd mm1, [EBX + 8192] - pmulhw mm0, mm4 - paddsw mm0, mm1 - - movd mm1, [EDX] - paddsw mm0, mm1 ; Add to the contents of the buffer - - movd [EDX], mm0 - -.End: - emms ; Done with MMX - pop EBX - pop EBP - ret - - -section .data - -; Used to xor with the unpacked samples to change sign: -XorSign: dw 0x8000, 0x8000, 0x8000, 0x8000 - - - -section .bss - -VolMMX: resd 2 -ActiveFlag: resb 1 diff --git a/jan/src/burn/burn_sound_c.cpp b/jan/src/burn/burn_sound_c.cpp deleted file mode 100644 index 961efdb3e..000000000 --- a/jan/src/burn/burn_sound_c.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" - -#define CLIP(A) ((A) < -0x8000 ? -0x8000 : (A) > 0x7fff ? 0x7fff : (A)) - -void BurnSoundCopyClamp_C(INT32 *Src, INT16 *Dest, INT32 Len) -{ - Len *= 2; - while (Len--) { - *Dest = CLIP((*Src >> 8)); - Src++; - Dest++; - } -} - -void BurnSoundCopyClamp_Add_C(INT32 *Src, INT16 *Dest, INT32 Len) -{ - Len *= 2; - while (Len--) { - *Dest = CLIP((*Src >> 8) + *Dest); - Src++; - Dest++; - } -} - -void BurnSoundCopyClamp_Mono_C(INT32 *Src, INT16 *Dest, INT32 Len) -{ - while (Len--) { - Dest[0] = CLIP((*Src >> 8)); - Dest[1] = CLIP((*Src >> 8)); - Src++; - Dest += 2; - } -} - -void BurnSoundCopyClamp_Mono_Add_C(INT32 *Src, INT16 *Dest, INT32 Len) -{ - while (Len--) { - Dest[0] = CLIP((*Src >> 8) + Dest[0]); - Dest[1] = CLIP((*Src >> 8) + Dest[1]); - Src++; - Dest += 2; - } -} - -#undef CLIP diff --git a/jan/src/burn/burnint.h b/jan/src/burn/burnint.h deleted file mode 100644 index 172f52a80..000000000 --- a/jan/src/burn/burnint.h +++ /dev/null @@ -1,244 +0,0 @@ -// Burn - Arcade emulator library - internal code - -// Standard headers -#include -#include -#include -#include -#include - -#if defined(__LIBRETRO__) && defined(_MSC_VER) -#include -#else -#include "tchar.h" -#endif - -#ifdef __LIBRETRO_OPTIMIZATIONS__ -#include "burn_libretro_opts.h" -#endif - -#include "burn.h" - -#ifdef LSB_FIRST -typedef union -{ - struct { UINT8 l,h,h2,h3; } b; - struct { UINT16 l,h; } w; - UINT32 d; -} PAIR; - -#define BURN_ENDIAN_SWAP_INT8(x) x -#define BURN_ENDIAN_SWAP_INT16(x) x -#define BURN_ENDIAN_SWAP_INT32(x) x -#define BURN_ENDIAN_SWAP_INT64(x) x -#else -// define the above union and BURN_ENDIAN_SWAP macros in the following platform specific header -#include "burn_endian.h" -#endif - -// --------------------------------------------------------------------------- -// Driver information - -struct BurnDriver { - char* szShortName; // The filename of the zip file (without extension) - char* szParent; // The filename of the parent (without extension, NULL if not applicable) - char* szBoardROM; // The filename of the board ROMs (without extension, NULL if not applicable) - char* szSampleName; // The filename of the samples zip file (without extension, NULL if not applicable) - char* szDate; - - // szFullNameA, szCommentA, szManufacturerA and szSystemA should always contain valid info - // szFullNameW, szCommentW, szManufacturerW and szSystemW should be used only if characters or scripts are needed that ASCII can't handle - char* szFullNameA; char* szCommentA; char* szManufacturerA; char* szSystemA; - wchar_t* szFullNameW; wchar_t* szCommentW; wchar_t* szManufacturerW; wchar_t* szSystemW; - - INT32 Flags; // See burn.h - INT32 Players; // Max number of players a game supports (so we can remove single player games from netplay) - INT32 Hardware; // Which type of hardware the game runs on - INT32 Genre; - INT32 Family; - INT32 (*GetZipName)(char** pszName, UINT32 i); // Function to get possible zip names - INT32 (*GetRomInfo)(struct BurnRomInfo* pri, UINT32 i); // Function to get the length and crc of each rom - INT32 (*GetRomName)(char** pszName, UINT32 i, INT32 nAka); // Function to get the possible names for each rom - INT32 (*GetSampleInfo)(struct BurnSampleInfo* pri, UINT32 i); // Function to get the sample flags - INT32 (*GetSampleName)(char** pszName, UINT32 i, INT32 nAka); // Function to get the possible names for each sample - INT32 (*GetInputInfo)(struct BurnInputInfo* pii, UINT32 i); // Function to get the input info for the game - INT32 (*GetDIPInfo)(struct BurnDIPInfo* pdi, UINT32 i); // Function to get the input info for the game - INT32 (*Init)(); INT32 (*Exit)(); INT32 (*Frame)(); INT32 (*Redraw)(); INT32 (*AreaScan)(INT32 nAction, INT32* pnMin); - UINT8* pRecalcPal; UINT32 nPaletteEntries; // Set to 1 if the palette needs to be fully re-calculated - INT32 nWidth, nHeight; INT32 nXAspect, nYAspect; // Screen width, height, x/y aspect -}; - -#define BurnDriverD BurnDriver // Debug status -#define BurnDriverX BurnDriver // Exclude from build - -// Standard functions for dealing with ROM and input info structures -#include "stdfunc.h" - -// --------------------------------------------------------------------------- - -// burn.cpp -INT32 BurnSetRefreshRate(double dRefreshRate); -INT32 BurnByteswap(UINT8* pm,INT32 nLen); -INT32 BurnClearScreen(); - -// load.cpp - -/* - Flags for use with BurnLoadRomExt - - GROUP(x) load this many bytes, then skip by nGap from start position (flag is optional) - REVERSE load the bytes in a group in reverse order (0,1,2,3 -> 3,2,1,0) - INVERT Src ^= 0xff - BYTESWAP change order of bytes from 0,1,2,3 to 1,0,3,2 - NIBBLES Dest[0] = (byte & & 0xf); Dest[1] = (byte >> 4) & 0xf; - XOR Dest ^= Src -*/ - -#define LD_GROUP(x) ((x) & 0xff) // 256 - plenty -#define LD_REVERSE (1<<8) -#define LD_INVERT (1<<9) -#define LD_BYTESWAP (1<<10) -#define LD_NIBBLES (1<<11) -#define LD_XOR (1<<12) - -INT32 BurnLoadRomExt(UINT8 *Dest, INT32 i, INT32 nGap, INT32 nFlags); -INT32 BurnLoadRom(UINT8* Dest, INT32 i, INT32 nGap); -INT32 BurnXorRom(UINT8 *Dest, INT32 i, INT32 nGap); -INT32 BurnLoadBitField(UINT8* pDest, UINT8* pSrc, INT32 nField, INT32 nSrcLen); - -// --------------------------------------------------------------------------- -// Plotting pixels - -inline static void PutPix(UINT8* pPix, UINT32 c) -{ - if (nBurnBpp >= 4) { - *((UINT32*)pPix) = c; - } else { - if (nBurnBpp == 2) { - *((UINT16*)pPix) = (UINT16)c; - } else { - pPix[0] = (UINT8)(c >> 0); - pPix[1] = (UINT8)(c >> 8); - pPix[2] = (UINT8)(c >> 16); - } - } -} - -// --------------------------------------------------------------------------- -// Setting up cpus for cheats - -struct cpu_core_config { - void (*open)(INT32); // cpu open - void (*close)(); // cpu close - - UINT8 (*read)(UINT32); // read - void (*write)(UINT32, UINT8); // write - INT32 (*active)(); // active cpu - INT32 (*totalcycles)(); // total cycles - void (*newframe)(); // new frame - - INT32 (*run)(INT32); // execute cycles - void (*runend)(); // end run - void (*reset)(); // reset cpu - - UINT64 nMemorySize; // how large is our memory range? - UINT32 nAddressXor; // fix endianness for some cpus -}; - -void CpuCheatRegister(INT32 type, cpu_core_config *config); - -// burn_memory.cpp -void BurnInitMemoryManager(); -UINT8 *BurnMalloc(INT32 size); -void _BurnFree(void *ptr); -#define BurnFree(x) _BurnFree(x); x = NULL; -void BurnExitMemoryManager(); - -// --------------------------------------------------------------------------- -// Sound clipping macro -#define BURN_SND_CLIP(A) ((A) < -0x8000 ? -0x8000 : (A) > 0x7fff ? 0x7fff : (A)) - -// sound routes -#define BURN_SND_ROUTE_LEFT 1 -#define BURN_SND_ROUTE_RIGHT 2 -#define BURN_SND_ROUTE_BOTH (BURN_SND_ROUTE_LEFT | BURN_SND_ROUTE_RIGHT) - -// --------------------------------------------------------------------------- -// Debug Tracker - -extern UINT8 Debug_BurnTransferInitted; -extern UINT8 Debug_BurnGunInitted; -extern UINT8 Debug_BurnLedInitted; -extern UINT8 Debug_BurnShiftInitted; -extern UINT8 Debug_HiscoreInitted; -extern UINT8 Debug_GenericTilesInitted; - -extern UINT8 DebugDev_8255PPIInitted; -extern UINT8 DebugDev_8257DMAInitted; -extern UINT8 DebugDev_EEPROMInitted; -extern UINT8 DebugDev_PandoraInitted; -extern UINT8 DebugDev_SeibuSndInitted; -extern UINT8 DebugDev_SknsSprInitted; -extern UINT8 DebugDev_SlapsticInitted; -extern UINT8 DebugDev_T5182Initted; -extern UINT8 DebugDev_TimeKprInitted; -extern UINT8 DebugDev_Tms34061Initted; -extern UINT8 DebugDev_V3021Initted; -extern UINT8 DebugDev_VDCInitted; - -extern UINT8 DebugSnd_AY8910Initted; -extern UINT8 DebugSnd_Y8950Initted; -extern UINT8 DebugSnd_YM2151Initted; -extern UINT8 DebugSnd_YM2203Initted; -extern UINT8 DebugSnd_YM2413Initted; -extern UINT8 DebugSnd_YM2608Initted; -extern UINT8 DebugSnd_YM2610Initted; -extern UINT8 DebugSnd_YM2612Initted; -extern UINT8 DebugSnd_YM3526Initted; -extern UINT8 DebugSnd_YM3812Initted; -extern UINT8 DebugSnd_YMF278BInitted; -extern UINT8 DebugSnd_C6280Initted; -extern UINT8 DebugSnd_DACInitted; -extern UINT8 DebugSnd_ES5506Initted; -extern UINT8 DebugSnd_ES8712Initted; -extern UINT8 DebugSnd_FilterRCInitted; -extern UINT8 DebugSnd_ICS2115Initted; -extern UINT8 DebugSnd_IremGA20Initted; -extern UINT8 DebugSnd_K005289Initted; -extern UINT8 DebugSnd_K007232Initted; -extern UINT8 DebugSnd_K051649Initted; -extern UINT8 DebugSnd_K053260Initted; -extern UINT8 DebugSnd_K054539Initted; -extern UINT8 DebugSnd_MSM5205Initted; -extern UINT8 DebugSnd_MSM5232Initted; -extern UINT8 DebugSnd_MSM6295Initted; -extern UINT8 DebugSnd_NamcoSndInitted; -extern UINT8 DebugSnd_NESAPUSndInitted; -extern UINT8 DebugSnd_RF5C68Initted; -extern UINT8 DebugSnd_SAA1099Initted; -extern UINT8 DebugSnd_SamplesInitted; -extern UINT8 DebugSnd_SegaPCMInitted; -extern UINT8 DebugSnd_SN76496Initted; -extern UINT8 DebugSnd_UPD7759Initted; -extern UINT8 DebugSnd_VLM5030Initted; -extern UINT8 DebugSnd_X1010Initted; -extern UINT8 DebugSnd_YMZ280BInitted; - -extern UINT8 DebugCPU_ARM7Initted; -extern UINT8 DebugCPU_ARMInitted; -extern UINT8 DebugCPU_H6280Initted; -extern UINT8 DebugCPU_HD6309Initted; -extern UINT8 DebugCPU_KonamiInitted; -extern UINT8 DebugCPU_M6502Initted; -extern UINT8 DebugCPU_M6800Initted; -extern UINT8 DebugCPU_M6805Initted; -extern UINT8 DebugCPU_M6809Initted; -extern UINT8 DebugCPU_S2650Initted; -extern UINT8 DebugCPU_SekInitted; -extern UINT8 DebugCPU_VezInitted; -extern UINT8 DebugCPU_ZetInitted; -extern UINT8 DebugCPU_PIC16C5XInitted; -extern UINT8 DebugCPU_I8039Initted; -extern UINT8 DebugCPU_SH2Initted; - -void DebugTrackerExit(); diff --git a/jan/src/burn/cheat.cpp b/jan/src/burn/cheat.cpp deleted file mode 100644 index 15c99a297..000000000 --- a/jan/src/burn/cheat.cpp +++ /dev/null @@ -1,538 +0,0 @@ -// Cheat module - -#include "burnint.h" - -#define CHEAT_MAXCPU 8 // enough? - - -bool bCheatsAllowed; -CheatInfo* pCheatInfo = NULL; - -static bool bCheatsEnabled = false; -static INT32 cheat_core_init_pointer = 0; - -struct cheat_core { - cpu_core_config *cpuconfig; - - INT32 nCPU; // which cpu -}; - -static struct cheat_core cpus[CHEAT_MAXCPU]; -static cheat_core *cheat_ptr; -static cpu_core_config *cheat_subptr; - -void CpuCheatRegister(INT32 nCPU, cpu_core_config *config) -{ - cheat_core *s_ptr = &cpus[cheat_core_init_pointer]; - - s_ptr->cpuconfig = config; - s_ptr->nCPU = nCPU; - - cheat_core_init_pointer++; -} - -INT32 CheatUpdate() -{ - bCheatsEnabled = false; - - if (bCheatsAllowed) { - CheatInfo* pCurrentCheat = pCheatInfo; - CheatAddressInfo* pAddressInfo; - - while (pCurrentCheat) { - if (pCurrentCheat->nStatus > 1) { - pAddressInfo = pCurrentCheat->pOption[pCurrentCheat->nCurrent]->AddressInfo; - if (pAddressInfo->nAddress) { - bCheatsEnabled = true; - } - } - pCurrentCheat = pCurrentCheat->pNext; - } - } - - return 0; -} - -INT32 CheatEnable(INT32 nCheat, INT32 nOption) // -1 / 0 - disable, -2 disable & don't undo memory -{ - INT32 nCurrentCheat = 0; - CheatInfo* pCurrentCheat = pCheatInfo; - CheatAddressInfo* pAddressInfo; - INT32 nOpenCPU = -1; - INT32 no_undo = 0; - - if (!bCheatsAllowed) { - return 1; - } - - if (nOption >= CHEAT_MAX_OPTIONS) { - return 1; - } - - cheat_ptr = &cpus[0]; // first cpu... - cheat_subptr = cheat_ptr->cpuconfig; - - while (pCurrentCheat && nCurrentCheat <= nCheat) { - if (nCurrentCheat == nCheat) { // Cheat found, let's process it. - INT32 deactivate = 0; - - if (nOption == -1 || nOption == 0 || nOption == -2) { // -2 = dont write back previous - if (nOption == -2) no_undo = 1; - nOption = pCurrentCheat->nDefault; - deactivate = 1; - } - - // Return OK if the cheat is already active with the same option - if (pCurrentCheat->nCurrent == nOption) { - return 0; - } - - if (deactivate) { // disable cheat option - if (pCurrentCheat->nType != 1) { - nOption = 1; // Set to the first option as there is no addressinfo associated with default (disabled) cheat entry. -dink - - // Deactivate old option (if any) - pAddressInfo = pCurrentCheat->pOption[nOption]->AddressInfo; - - while (pAddressInfo->nAddress) { - if (pAddressInfo->nCPU != nOpenCPU) { - - if (nOpenCPU != -1) { - cheat_subptr->close(); - } - - nOpenCPU = pAddressInfo->nCPU; - cheat_ptr = &cpus[nOpenCPU]; - cheat_subptr = cheat_ptr->cpuconfig; - cheat_subptr->open(cheat_ptr->nCPU); - } - - if (!no_undo) { - // Write back original values to memory - bprintf(0, _T("Cheat #%d, option #%d. action: "), nCheat, nOption); - bprintf(0, _T("Undo cheat @ 0x%X -> 0x%X.\n"), pAddressInfo->nAddress, pAddressInfo->nOriginalValue); - cheat_subptr->write(pAddressInfo->nAddress, pAddressInfo->nOriginalValue); - } - pAddressInfo++; - } - nOption = 0; // Set back to 0 (see above line: nOption = 1;) - } - } else { // activate cheat option - pAddressInfo = pCurrentCheat->pOption[nOption]->AddressInfo; - - while (pAddressInfo->nAddress) { - if (pAddressInfo->nCPU != nOpenCPU) { - if (nOpenCPU != -1) { - cheat_subptr->close(); - } - - nOpenCPU = pAddressInfo->nCPU; - cheat_ptr = &cpus[nOpenCPU]; - cheat_subptr = cheat_ptr->cpuconfig; - cheat_subptr->open(cheat_ptr->nCPU); - } - - pCurrentCheat->bModified = 0; - - // Copy the original values - pAddressInfo->nOriginalValue = cheat_subptr->read(pAddressInfo->nAddress); - - bprintf(0, _T("Cheat #%d, option #%d. action: "), nCheat, nOption); - if (pCurrentCheat->bWatchMode) { - bprintf(0, _T("Watch memory @ 0x%X (0x%X)\n"), pAddressInfo->nAddress, pAddressInfo->nOriginalValue); - } else - if (pCurrentCheat->bOneShot) { - bprintf(0, _T("Apply cheat @ 0x%X -> 0x%X. (Before 0x%X - One-Shot mode)\n"), pAddressInfo->nAddress, pAddressInfo->nValue, pAddressInfo->nOriginalValue); - pCurrentCheat->bOneShot = 3; // re-load the one-shot frame counter - } else { - bprintf(0, _T("Apply cheat @ 0x%X -> 0x%X. (Undo 0x%X)\n"), pAddressInfo->nAddress, pAddressInfo->nValue, pAddressInfo->nOriginalValue); - } - if (pCurrentCheat->bWaitForModification) - bprintf(0, _T(" - Triggered by: Waiting for modification!\n")); - - if (pCurrentCheat->nType != 0) { - if (pAddressInfo->nCPU != nOpenCPU) { - if (nOpenCPU != -1) { - cheat_subptr->close(); - } - - nOpenCPU = pAddressInfo->nCPU; - cheat_ptr = &cpus[nOpenCPU]; - cheat_subptr = cheat_ptr->cpuconfig; - cheat_subptr->open(cheat_ptr->nCPU); - } - - if (!pCurrentCheat->bWatchMode && !pCurrentCheat->bWaitForModification) { - // Activate the cheat - cheat_subptr->write(pAddressInfo->nAddress, pAddressInfo->nValue); - } - } - - pAddressInfo++; - } - } - - // Set cheat status and active option - if (pCurrentCheat->nType != 1) { - pCurrentCheat->nCurrent = nOption; - } - if (pCurrentCheat->nType == 0) { - pCurrentCheat->nStatus = 2; - } - if (pCurrentCheat->nType == 2) { - pCurrentCheat->nStatus = 1; - } - - break; - } - pCurrentCheat = pCurrentCheat->pNext; - nCurrentCheat++; - } - - if (nOpenCPU != -1) { - cheat_subptr->close(); - } - - CheatUpdate(); - - if (nCurrentCheat == nCheat && pCurrentCheat) { - return 0; - } - - return 1; -} - -#if defined (BUILD_WIN32) -extern INT32 VidSNewTinyMsg(const TCHAR* pText, INT32 nRGB = 0, INT32 nDuration = 0, INT32 nPriority = 5); -#endif - -INT32 CheatApply() -{ - if (!bCheatsEnabled) { - return 0; - } - - INT32 nOpenCPU = -1; - INT32 nCurrentCheat = 0; - - CheatInfo* pCurrentCheat = pCheatInfo; - CheatAddressInfo* pAddressInfo; - while (pCurrentCheat) { - if (pCurrentCheat->nStatus > 1) { - pAddressInfo = pCurrentCheat->pOption[pCurrentCheat->nCurrent]->AddressInfo; - - while (pAddressInfo->nAddress) { - - if (pAddressInfo->nCPU != nOpenCPU) { - if (nOpenCPU != -1) { - cheat_subptr->close(); - } - - nOpenCPU = pAddressInfo->nCPU; - cheat_ptr = &cpus[nOpenCPU]; - cheat_subptr = cheat_ptr->cpuconfig; - cheat_subptr->open(cheat_ptr->nCPU); - } - - if (pCurrentCheat->bWatchMode) { - // Watch address mode, Win32-only for now. -#if defined (BUILD_WIN32) - pAddressInfo->nOriginalValue = cheat_subptr->read(pAddressInfo->nAddress); - wchar_t framestring[32]; - swprintf(framestring, L"%X", pAddressInfo->nOriginalValue); - VidSNewTinyMsg(framestring, 0, 5, 5); -#endif - } else { - // update the cheat - if (pCurrentCheat->bWaitForModification) { - UINT32 nValNow = cheat_subptr->read(pAddressInfo->nAddress); - if (nValNow != pAddressInfo->nOriginalValue) { - bprintf(0, _T(" - Address modified! old = %X new = %X\n"),pAddressInfo->nOriginalValue, nValNow); - cheat_subptr->write(pAddressInfo->nAddress, pAddressInfo->nValue); - pCurrentCheat->bModified = 1; - pAddressInfo->nOriginalValue = pAddressInfo->nValue; - } - } else { - // Write the value. - cheat_subptr->write(pAddressInfo->nAddress, pAddressInfo->nValue); - pCurrentCheat->bModified = 1; - } - } - pAddressInfo++; - } - if (pCurrentCheat->bModified) { - if (pCurrentCheat->bOneShot == 2) { - if (nOpenCPU != -1) { - cheat_subptr->close(); - nOpenCPU = -1; - } - bprintf(0, _T("One-Shot cheat #%d ends.\n"), nCurrentCheat); - CheatEnable(nCurrentCheat, -2); - } - if (pCurrentCheat->bOneShot > 1) pCurrentCheat->bOneShot--; - } - } - pCurrentCheat = pCurrentCheat->pNext; - nCurrentCheat++; - } - - if (nOpenCPU != -1) { - cheat_subptr->close(); - } - - return 0; -} - -INT32 CheatInit() -{ - CheatExit(); - - bCheatsEnabled = false; - - return 0; -} - -void CheatExit() -{ - if (pCheatInfo) { - CheatInfo* pCurrentCheat = pCheatInfo; - CheatInfo* pNextCheat; - - do { - pNextCheat = pCurrentCheat->pNext; - for (INT32 i = 0; i < CHEAT_MAX_OPTIONS; i++) { - BurnFree(pCurrentCheat->pOption[i]); - } - BurnFree(pCurrentCheat); - } while ((pCurrentCheat = pNextCheat) != 0); - } - - memset (cpus, 0, sizeof(cheat_core)); - - cheat_core_init_pointer = 0; - - pCheatInfo = NULL; - - CheatSearchInitCallbackFunction = NULL; -} - -// Cheat search - -static UINT8 *MemoryValues = NULL; -static UINT8 *MemoryStatus = NULL; -static UINT32 nMemorySize = 0; -CheatSearchInitCallback CheatSearchInitCallbackFunction = NULL; - -#define NOT_IN_RESULTS 0 -#define IN_RESULTS 1 - -UINT32 CheatSearchShowResultAddresses[CHEATSEARCH_SHOWRESULTS]; -UINT32 CheatSearchShowResultValues[CHEATSEARCH_SHOWRESULTS]; - -INT32 CheatSearchInit() -{ - return 1; -} - -void CheatSearchExit() -{ - BurnFree(MemoryValues); - BurnFree(MemoryStatus); - - nMemorySize = 0; - - memset(CheatSearchShowResultAddresses, 0, CHEATSEARCH_SHOWRESULTS); - memset(CheatSearchShowResultValues, 0, CHEATSEARCH_SHOWRESULTS); -} - -void CheatSearchStart() -{ - UINT32 nAddress; - - INT32 nActiveCPU = 0; - cheat_ptr = &cpus[nActiveCPU]; - cheat_subptr = cheat_ptr->cpuconfig; - cheat_subptr->open(cheat_ptr->nCPU); - - nActiveCPU = cheat_subptr->active(); - if (nActiveCPU >= 0) cheat_subptr->close(); - cheat_subptr->open(cheat_ptr->nCPU); - nMemorySize = cheat_subptr->nMemorySize; - - MemoryValues = (UINT8*)BurnMalloc(nMemorySize); - MemoryStatus = (UINT8*)BurnMalloc(nMemorySize); - - memset(MemoryStatus, IN_RESULTS, nMemorySize); - - if (CheatSearchInitCallbackFunction) CheatSearchInitCallbackFunction(); - - for (nAddress = 0; nAddress < nMemorySize; nAddress++) { - if (MemoryStatus[nAddress] == NOT_IN_RESULTS) continue; - MemoryValues[nAddress] = cheat_subptr->read(nAddress); - } - - cheat_subptr->close(); - if (nActiveCPU >= 0) cheat_subptr->open(nActiveCPU); -} - -static void CheatSearchGetResults() -{ - UINT32 nAddress; - UINT32 nResultsPos = 0; - - memset(CheatSearchShowResultAddresses, 0, CHEATSEARCH_SHOWRESULTS); - memset(CheatSearchShowResultValues, 0, CHEATSEARCH_SHOWRESULTS); - - for (nAddress = 0; nAddress < nMemorySize; nAddress++) { - if (MemoryStatus[nAddress] == IN_RESULTS) { - CheatSearchShowResultAddresses[nResultsPos] = nAddress; - CheatSearchShowResultValues[nResultsPos] = MemoryValues[nAddress]; - nResultsPos++; - } - } -} - -UINT32 CheatSearchValueNoChange() -{ - UINT32 nMatchedAddresses = 0; - UINT32 nAddress; - - INT32 nActiveCPU = 0; - - nActiveCPU = cheat_subptr->active(); - if (nActiveCPU >= 0) cheat_subptr->close(); - cheat_subptr->open(0); - - for (nAddress = 0; nAddress < nMemorySize; nAddress++) { - if (MemoryStatus[nAddress] == NOT_IN_RESULTS) continue; - if (cheat_subptr->read(nAddress) == MemoryValues[nAddress]) { - MemoryValues[nAddress] = cheat_subptr->read(nAddress); - nMatchedAddresses++; - } else { - MemoryStatus[nAddress] = NOT_IN_RESULTS; - } - } - - cheat_subptr->close(); - if (nActiveCPU >= 0) cheat_subptr->open(nActiveCPU); - - if (nMatchedAddresses <= CHEATSEARCH_SHOWRESULTS) CheatSearchGetResults(); - - return nMatchedAddresses; -} - -UINT32 CheatSearchValueChange() -{ - UINT32 nMatchedAddresses = 0; - UINT32 nAddress; - - INT32 nActiveCPU = 0; - - nActiveCPU = cheat_subptr->active(); - if (nActiveCPU >= 0) cheat_subptr->close(); - cheat_subptr->open(0); - - for (nAddress = 0; nAddress < nMemorySize; nAddress++) { - if (MemoryStatus[nAddress] == NOT_IN_RESULTS) continue; - if (cheat_subptr->read(nAddress) != MemoryValues[nAddress]) { - MemoryValues[nAddress] = cheat_subptr->read(nAddress); - nMatchedAddresses++; - } else { - MemoryStatus[nAddress] = NOT_IN_RESULTS; - } - } - - cheat_subptr->close(); - if (nActiveCPU >= 0) cheat_subptr->open(nActiveCPU); - - if (nMatchedAddresses <= CHEATSEARCH_SHOWRESULTS) CheatSearchGetResults(); - - return nMatchedAddresses; -} - -UINT32 CheatSearchValueDecreased() -{ - UINT32 nMatchedAddresses = 0; - UINT32 nAddress; - - INT32 nActiveCPU = 0; - - nActiveCPU = cheat_subptr->active(); - if (nActiveCPU >= 0) cheat_subptr->close(); - cheat_subptr->open(0); - - for (nAddress = 0; nAddress < nMemorySize; nAddress++) { - if (MemoryStatus[nAddress] == NOT_IN_RESULTS) continue; - if (cheat_subptr->read(nAddress) < MemoryValues[nAddress]) { - MemoryValues[nAddress] = cheat_subptr->read(nAddress); - nMatchedAddresses++; - } else { - MemoryStatus[nAddress] = NOT_IN_RESULTS; - } - } - - cheat_subptr->close(); - if (nActiveCPU >= 0) cheat_subptr->open(nActiveCPU); - - if (nMatchedAddresses <= CHEATSEARCH_SHOWRESULTS) CheatSearchGetResults(); - - return nMatchedAddresses; -} - -UINT32 CheatSearchValueIncreased() -{ - UINT32 nMatchedAddresses = 0; - UINT32 nAddress; - - INT32 nActiveCPU = 0; - - nActiveCPU = cheat_subptr->active(); - if (nActiveCPU >= 0) cheat_subptr->close(); - cheat_subptr->open(0); - - for (nAddress = 0; nAddress < nMemorySize; nAddress++) { - if (MemoryStatus[nAddress] == NOT_IN_RESULTS) continue; - if (cheat_subptr->read(nAddress) > MemoryValues[nAddress]) { - MemoryValues[nAddress] = cheat_subptr->read(nAddress); - nMatchedAddresses++; - } else { - MemoryStatus[nAddress] = NOT_IN_RESULTS; - } - } - - cheat_subptr->close(); - if (nActiveCPU >= 0) cheat_subptr->open(nActiveCPU); - - if (nMatchedAddresses <= CHEATSEARCH_SHOWRESULTS) CheatSearchGetResults(); - - return nMatchedAddresses; -} - -void CheatSearchDumptoFile() -{ - FILE *fp = fopen("cheatsearchdump.txt", "wt"); - UINT32 nAddress; - - if (fp) { - char Temp[256]; - - for (nAddress = 0; nAddress < nMemorySize; nAddress++) { - if (MemoryStatus[nAddress] == IN_RESULTS) { - sprintf(Temp, "Address %08X Value %02X\n", nAddress, MemoryValues[nAddress]); - fwrite(Temp, 1, strlen(Temp), fp); - } - } - - fclose(fp); - } -} - -void CheatSearchExcludeAddressRange(UINT32 nStart, UINT32 nEnd) -{ - for (UINT32 nAddress = nStart; nAddress <= nEnd; nAddress++) { - MemoryStatus[nAddress] = NOT_IN_RESULTS; - } -} - -#undef NOT_IN_RESULTS -#undef IN_RESULTS diff --git a/jan/src/burn/cheat.h b/jan/src/burn/cheat.h deleted file mode 100644 index c9bf79677..000000000 --- a/jan/src/burn/cheat.h +++ /dev/null @@ -1,57 +0,0 @@ -#define CHEAT_MAX_ADDRESS (512) -#define CHEAT_MAX_OPTIONS (512) -#define CHEAT_MAX_NAME (128) - -extern bool bCheatsAllowed; - -struct CheatAddressInfo { - INT32 nCPU; - INT32 nAddress; - UINT32 nValue; - UINT32 nOriginalValue; -}; - -struct CheatOption { - TCHAR szOptionName[CHEAT_MAX_NAME]; - struct CheatAddressInfo AddressInfo[CHEAT_MAX_ADDRESS + 1]; -}; - -struct CheatInfo { - struct CheatInfo* pNext; - struct CheatInfo* pPrevious; - INT32 nType; // Cheat type - INT32 nStatus; // 0 = Inactive - INT32 nCurrent; // Currently selected option - INT32 nDefault; // Default option - INT32 bOneShot; // For one-shot cheats, also acts as a frame counter for them. - INT32 bWatchMode; // Display value on screen - INT32 bWaitForModification; // Wait for Modification before changing - INT32 bModified; // Wrote cheat? - TCHAR szCheatName[CHEAT_MAX_NAME]; - struct CheatOption* pOption[CHEAT_MAX_OPTIONS]; -}; - -extern CheatInfo* pCheatInfo; - -INT32 CheatUpdate(); -INT32 CheatEnable(INT32 nCheat, INT32 nOption); -INT32 CheatApply(); -INT32 CheatInit(); -void CheatExit(); - -#define CHEATSEARCH_SHOWRESULTS 3 -extern UINT32 CheatSearchShowResultAddresses[CHEATSEARCH_SHOWRESULTS]; -extern UINT32 CheatSearchShowResultValues[CHEATSEARCH_SHOWRESULTS]; - -INT32 CheatSearchInit(); -void CheatSearchExit(); -void CheatSearchStart(); -UINT32 CheatSearchValueNoChange(); -UINT32 CheatSearchValueChange(); -UINT32 CheatSearchValueDecreased(); -UINT32 CheatSearchValueIncreased(); -void CheatSearchDumptoFile(); - -typedef void (*CheatSearchInitCallback)(); -extern CheatSearchInitCallback CheatSearchInitCallbackFunction; -void CheatSearchExcludeAddressRange(UINT32 nStart, UINT32 nEnd); diff --git a/jan/src/burn/debug_track.cpp b/jan/src/burn/debug_track.cpp deleted file mode 100644 index 7b18e9af1..000000000 --- a/jan/src/burn/debug_track.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// A module to track if various support devices, cpus, sound modules are in use - -#include "burnint.h" - -UINT8 Debug_BurnTransferInitted; -UINT8 Debug_BurnGunInitted; -UINT8 Debug_BurnLedInitted; -UINT8 Debug_BurnShiftInitted; -UINT8 Debug_HiscoreInitted; -UINT8 Debug_GenericTilesInitted; - -UINT8 DebugDev_8255PPIInitted; -UINT8 DebugDev_8257DMAInitted; -UINT8 DebugDev_EEPROMInitted; -UINT8 DebugDev_PandoraInitted; -UINT8 DebugDev_SeibuSndInitted; -UINT8 DebugDev_SknsSprInitted; -UINT8 DebugDev_SlapsticInitted; -UINT8 DebugDev_T5182Initted; -UINT8 DebugDev_TimeKprInitted; -UINT8 DebugDev_Tms34061Initted; -UINT8 DebugDev_V3021Initted; -UINT8 DebugDev_VDCInitted; - -UINT8 DebugSnd_AY8910Initted; -UINT8 DebugSnd_Y8950Initted; -UINT8 DebugSnd_YM2151Initted; -UINT8 DebugSnd_YM2203Initted; -UINT8 DebugSnd_YM2413Initted; -UINT8 DebugSnd_YM2608Initted; -UINT8 DebugSnd_YM2610Initted; -UINT8 DebugSnd_YM2612Initted; -UINT8 DebugSnd_YM3526Initted; -UINT8 DebugSnd_YM3812Initted; -UINT8 DebugSnd_YMF278BInitted; -UINT8 DebugSnd_C6280Initted; -UINT8 DebugSnd_DACInitted; -UINT8 DebugSnd_ES5506Initted; -UINT8 DebugSnd_ES8712Initted; -UINT8 DebugSnd_FilterRCInitted; -UINT8 DebugSnd_ICS2115Initted; -UINT8 DebugSnd_IremGA20Initted; -UINT8 DebugSnd_K005289Initted; -UINT8 DebugSnd_K007232Initted; -UINT8 DebugSnd_K051649Initted; -UINT8 DebugSnd_K053260Initted; -UINT8 DebugSnd_K054539Initted; -UINT8 DebugSnd_MSM5205Initted; -UINT8 DebugSnd_MSM5232Initted; -UINT8 DebugSnd_MSM6295Initted; -UINT8 DebugSnd_NamcoSndInitted; -UINT8 DebugSnd_NESAPUSndInitted; -UINT8 DebugSnd_RF5C68Initted; -UINT8 DebugSnd_SAA1099Initted; -UINT8 DebugSnd_SamplesInitted; -UINT8 DebugSnd_SegaPCMInitted; -UINT8 DebugSnd_SN76496Initted; -UINT8 DebugSnd_UPD7759Initted; -UINT8 DebugSnd_VLM5030Initted; -UINT8 DebugSnd_X1010Initted; -UINT8 DebugSnd_YMZ280BInitted; - -UINT8 DebugCPU_ARM7Initted; -UINT8 DebugCPU_ARMInitted; -UINT8 DebugCPU_H6280Initted; -UINT8 DebugCPU_HD6309Initted; -UINT8 DebugCPU_KonamiInitted; -UINT8 DebugCPU_M6502Initted; -UINT8 DebugCPU_M6800Initted; -UINT8 DebugCPU_M6805Initted; -UINT8 DebugCPU_M6809Initted; -UINT8 DebugCPU_S2650Initted; -UINT8 DebugCPU_SekInitted; -UINT8 DebugCPU_VezInitted; -UINT8 DebugCPU_ZetInitted; -UINT8 DebugCPU_PIC16C5XInitted; -UINT8 DebugCPU_I8039Initted; -UINT8 DebugCPU_SH2Initted; - -void DebugTrackerExit() -{ - if (Debug_BurnTransferInitted) bprintf(PRINT_ERROR, _T("BurnTransfer Not Exited\n")); - if (Debug_BurnGunInitted) bprintf(PRINT_ERROR, _T("BurnGun Not Exited\n")); - if (Debug_BurnLedInitted) bprintf(PRINT_ERROR, _T("BurnLed Not Exited\n")); - if (Debug_BurnShiftInitted) bprintf(PRINT_ERROR, _T("BurnShit Not Exited\n")); - if (Debug_HiscoreInitted) bprintf(PRINT_ERROR, _T("Hiscore Not Exited\n")); - if (Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("GenericTiles Not Exited\n")); - - if (DebugDev_8255PPIInitted) bprintf(PRINT_ERROR, _T("Device 8255PPI Not Exited\n")); - if (DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("Device 8257DMA Not Exited\n")); - if (DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("Device EEPROM Not Exited\n")); - if (DebugDev_PandoraInitted) bprintf(PRINT_ERROR, _T("Device Pandora Not Exited\n")); - if (DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("Device SeibuSnd Not Exited\n")); - if (DebugDev_SknsSprInitted) bprintf(PRINT_ERROR, _T("Device SknsSpr Not Exited\n")); - if (DebugDev_SlapsticInitted) bprintf(PRINT_ERROR, _T("Device Slapstic Not Exited\n")); - if (DebugDev_T5182Initted) bprintf(PRINT_ERROR, _T("Device T5182 Not Exited\n")); - if (DebugDev_TimeKprInitted) bprintf(PRINT_ERROR, _T("Device TimeKpr Not Exited\n")); - if (DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("Device TMS34061 Not Exited\n")); - if (DebugDev_V3021Initted) bprintf(PRINT_ERROR, _T("Device V3021 Not Exited\n")); - if (DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("Device VDC Not Exited\n")); - - if (DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("Sound Module AY8910 Not Exited\n")); - if (DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("Sound Module Y8950 Not Exited\n")); - if (DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("Sound Module YM2151 Not Exited\n")); - if (DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("Sound Module YM2203 Not Exited\n")); - if (DebugSnd_YM2413Initted) bprintf(PRINT_ERROR, _T("Sound Module YM2413 Not Exited\n")); - if (DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("Sound Module YM2608 Not Exited\n")); - if (DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("Sound Module YM2610 Not Exited\n")); - if (DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("Sound Module YM2612 Not Exited\n")); - if (DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("Sound Module YM3526 Not Exited\n")); - if (DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("Sound Module YM3812 Not Exited\n")); - if (DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("Sound Module YMF278B Not Exited\n")); - if (DebugSnd_C6280Initted) bprintf(PRINT_ERROR, _T("Sound Module C6280 Not Exited\n")); - if (DebugSnd_DACInitted) bprintf(PRINT_ERROR, _T("Sound Module DAC Not Exited\n")); - if (DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("Sound Module ES5506 Not Exited\n")); - if (DebugSnd_ES8712Initted) bprintf(PRINT_ERROR, _T("Sound Module ES8712 Not Exited\n")); - if (DebugSnd_FilterRCInitted) bprintf(PRINT_ERROR, _T("Sound Module Filter RC Not Exited\n")); - if (DebugSnd_ICS2115Initted) bprintf(PRINT_ERROR, _T("Sound Module ICS2115 Not Exited\n")); - if (DebugSnd_IremGA20Initted) bprintf(PRINT_ERROR, _T("Sound Module IremGA20 Not Exited\n")); - if (DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("Sound Module K005289 Not Exited\n")); - if (DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("Sound Module K007232 Not Exited\n")); - if (DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("Sound Module K051649 Not Exited\n")); - if (DebugSnd_K053260Initted) bprintf(PRINT_ERROR, _T("Sound Module K053260 Not Exited\n")); - if (DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("Sound Module K054539 Not Exited\n")); - if (DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("Sound Module MSM5205 Not Exited\n")); - if (DebugSnd_MSM5232Initted) bprintf(PRINT_ERROR, _T("Sound Module MSM5232 Not Exited\n")); - if (DebugSnd_MSM6295Initted) bprintf(PRINT_ERROR, _T("Sound Module MSM6295 Not Exited\n")); - if (DebugSnd_NamcoSndInitted) bprintf(PRINT_ERROR, _T("Sound Module NamcoSnd Not Exited\n")); - if (DebugSnd_NESAPUSndInitted) bprintf(PRINT_ERROR, _T("Sound Module NESAPUSnd Not Exited\n")); - if (DebugSnd_SAA1099Initted) bprintf(PRINT_ERROR, _T("Sound Module SAA1099 Not Exited\n")); - if (DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("Sound Module Samples Not Exited\n")); - if (DebugSnd_SegaPCMInitted) bprintf(PRINT_ERROR, _T("Sound Module SegaPCM Not Exited\n")); - if (DebugSnd_SN76496Initted) bprintf(PRINT_ERROR, _T("Sound Module SN76496 Not Exited\n")); - if (DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("Sound Module UPD7759 Not Exited\n")); - if (DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("Sound Module VLM5030 Not Exited\n")); - if (DebugSnd_X1010Initted) bprintf(PRINT_ERROR, _T("Sound Module X1010 Not Exited\n")); - if (DebugSnd_YMZ280BInitted) bprintf(PRINT_ERROR, _T("Sound Module YMZ280B Not Exited\n")); - - if (DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("CPU ARM7 Not Exited\n")); - if (DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("CPU ARM Not Exited\n")); - if (DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("CPU H6280 Not Exited\n")); - if (DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("CPU HD6309 Not Exited\n")); - if (DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("CPU Konami Not Exited\n")); - if (DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("CPU M6502 Not Exited\n")); - if (DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("CPU M6800 Not Exited\n")); - if (DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("CPU M6805 Not Exited\n")); - if (DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("CPU M6809 Not Exited\n")); - if (DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("CPU S2650 Not Exited\n")); - if (DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("CPU Sek Not Exited\n")); - if (DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("CPU Vez Not Exited\n")); - if (DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("CPU Zet Not Exited\n")); - if (DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("CPU PIC16C5X Not Exited\n")); - if (DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("CPU I8039 Not Exited\n")); - if (DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("CPU SH2 Not Exited\n")); -} diff --git a/jan/src/burn/devices/6821pia.cpp b/jan/src/burn/devices/6821pia.cpp deleted file mode 100644 index 71531aaf7..000000000 --- a/jan/src/burn/devices/6821pia.cpp +++ /dev/null @@ -1,1015 +0,0 @@ -/********************************************************************** - - Motorola 6821 PIA interface and emulation - - This function emulates all the functionality of up to 8 M6821 - peripheral interface adapters. - - MAME sources by Nathan Woods - -**********************************************************************/ - -#include -#include -#include "burnint.h" -#include "6821pia.h" - -#ifdef __LP64__ -#define FPTR unsigned long /* 64bit: sizeof(void *) is sizeof(long) */ -#else -#define FPTR unsigned int -#endif - -#define VERBOSE 0 - -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif - - -/******************* internal PIA data structure *******************/ - -struct pia6821 -{ - const struct pia6821_interface *intf; - UINT8 addr; - - UINT8 in_a; - UINT8 in_ca1; - UINT8 in_ca2; - UINT8 out_a; - UINT8 out_ca2; - UINT8 ddr_a; - UINT8 ctl_a; - UINT8 irq_a1; - UINT8 irq_a2; - UINT8 irq_a_state; - - UINT8 in_b; - UINT8 in_cb1; - UINT8 in_cb2; - UINT8 out_b; - UINT8 out_cb2; - UINT8 ddr_b; - UINT8 ctl_b; - UINT8 irq_b1; - UINT8 irq_b2; - UINT8 irq_b_state; - UINT8 in_set; // which input ports are set -}; - - -/******************* convenince macros and defines *******************/ - -#define PIA_IRQ1 0x80 -#define PIA_IRQ2 0x40 - -#define IRQ1_ENABLED(c) (c & 0x01) -#define IRQ1_DISABLED(c) (!(c & 0x01)) -#define C1_LOW_TO_HIGH(c) (c & 0x02) -#define C1_HIGH_TO_LOW(c) (!(c & 0x02)) -#define OUTPUT_SELECTED(c) (c & 0x04) -#define DDR_SELECTED(c) (!(c & 0x04)) -#define IRQ2_ENABLED(c) (c & 0x08) -#define IRQ2_DISABLED(c) (!(c & 0x08)) -#define STROBE_E_RESET(c) (c & 0x08) -#define STROBE_C1_RESET(c) (!(c & 0x08)) -#define SET_C2(c) (c & 0x08) -#define RESET_C2(c) (!(c & 0x08)) -#define C2_LOW_TO_HIGH(c) (c & 0x10) -#define C2_HIGH_TO_LOW(c) (!(c & 0x10)) -#define C2_SET_MODE(c) (c & 0x10) -#define C2_STROBE_MODE(c) (!(c & 0x10)) -#define C2_OUTPUT(c) (c & 0x20) -#define C2_INPUT(c) (!(c & 0x20)) - -#define PIA_IN_SET_A 0x01 -#define PIA_IN_SET_CA1 0x02 -#define PIA_IN_SET_CA2 0x04 -#define PIA_IN_SET_B 0x08 -#define PIA_IN_SET_CB1 0x10 -#define PIA_IN_SET_CB2 0x20 - -/******************* static variables *******************/ - -static struct pia6821 pia[MAX_PIA]; - -static const UINT8 swizzle_address[4] = { 0, 2, 1, 3 }; - - - -/******************* stave state *******************/ -#if 0 -static void update_6821_interrupts(struct pia6821 *p); - -static void pia_postload(int which) -{ - struct pia6821 *p = pia + which; - update_6821_interrupts(p); - if (p->intf->out_a_func && p->ddr_a) p->intf->out_a_func(0, p->out_a & p->ddr_a); - if (p->intf->out_b_func && p->ddr_b) p->intf->out_b_func(0, p->out_b & p->ddr_b); - if (p->intf->out_ca2_func) p->intf->out_ca2_func(0, p->out_ca2); - if (p->intf->out_cb2_func) p->intf->out_cb2_func(0, p->out_cb2); -} - -static void pia_postload_0(void) -{ - pia_postload(0); -} - -static void pia_postload_1(void) -{ - pia_postload(1); -} - -static void pia_postload_2(void) -{ - pia_postload(2); -} - -static void pia_postload_3(void) -{ - pia_postload(3); -} - -static void pia_postload_4(void) -{ - pia_postload(4); -} - -static void pia_postload_5(void) -{ - pia_postload(5); -} - -static void pia_postload_6(void) -{ - pia_postload(6); -} - -static void pia_postload_7(void) -{ - pia_postload(7); -} - -static void (*pia_postload_funcs[MAX_PIA])(void) = -{ - pia_postload_0, - pia_postload_1, - pia_postload_2, - pia_postload_3, - pia_postload_4, - pia_postload_5, - pia_postload_6, - pia_postload_7 -}; - -void pia_init(int count) -{ - int i; - for (i = 0; i < count; i++) - { - state_save_register_UINT8("6821pia", i, "in_a", &pia[i].in_a, 1); - state_save_register_UINT8("6821pia", i, "in_ca1", &pia[i].in_ca1, 1); - state_save_register_UINT8("6821pia", i, "in_ca2", &pia[i].in_ca2, 1); - state_save_register_UINT8("6821pia", i, "out_a", &pia[i].out_a, 1); - state_save_register_UINT8("6821pia", i, "out_ca2", &pia[i].out_ca2, 1); - state_save_register_UINT8("6821pia", i, "ddr_a", &pia[i].ddr_a, 1); - state_save_register_UINT8("6821pia", i, "ctl_a", &pia[i].ctl_a, 1); - state_save_register_UINT8("6821pia", i, "irq_a1", &pia[i].irq_a1, 1); - state_save_register_UINT8("6821pia", i, "irq_a2", &pia[i].irq_a2, 1); - state_save_register_UINT8("6821pia", i, "in_b", &pia[i].in_b, 1); - state_save_register_UINT8("6821pia", i, "in_cb1", &pia[i].in_cb1, 1); - state_save_register_UINT8("6821pia", i, "in_cb2", &pia[i].in_cb2, 1); - state_save_register_UINT8("6821pia", i, "out_b", &pia[i].out_b, 1); - state_save_register_UINT8("6821pia", i, "out_cb2", &pia[i].out_cb2, 1); - state_save_register_UINT8("6821pia", i, "ddr_b", &pia[i].ddr_b, 1); - state_save_register_UINT8("6821pia", i, "ctl_b", &pia[i].ctl_b, 1); - state_save_register_UINT8("6821pia", i, "irq_b1", &pia[i].irq_b1, 1); - state_save_register_UINT8("6821pia", i, "irq_b2", &pia[i].irq_b2, 1); - state_save_register_UINT8("6821pia", i, "in_set", &pia[i].in_set, 1); - state_save_register_func_postload(pia_postload_funcs[i]); - } -} -#endif - -/******************* un-configuration *******************/ - -void pia_init(void) // was pia_unconfig -{ - memset(&pia, 0, sizeof(pia)); -} - -void pia_exit(void) -{ - pia_init(); -} - -/******************* configuration *******************/ - -void pia_config(int which, int addressing, const struct pia6821_interface *intf) -{ - if (which >= MAX_PIA) return; - memset(&pia[which], 0, sizeof(pia[0])); - if (!intf) return; - pia[which].intf = intf; - pia[which].addr = addressing; - // set default read values. - // Ports A,CA1,CA2 default to 1 - // Ports B,CB1,CB2 are three-state and undefined (set to 0) - pia[which].in_a = pia[which].in_ca1 = pia[which].in_ca2 = 0xff; - if ((intf->in_a_func) && ((FPTR)(intf->in_a_func) <= 0x100)) - { pia[which].in_a = ((FPTR)(intf->in_a_func) - 1); pia[which].in_set |= PIA_IN_SET_A; } - if ((intf->in_b_func) && ((FPTR)(intf->in_b_func) <= 0x100)) - { pia[which].in_b = ((FPTR)(intf->in_b_func) - 1); pia[which].in_set |= PIA_IN_SET_B; } - if ((intf->in_ca1_func) && ((FPTR)(intf->in_ca1_func) <= 0x100)) - { pia[which].in_ca1 = ((FPTR)(intf->in_ca1_func) - 1); pia[which].in_set |= PIA_IN_SET_CA1; } - if ((intf->in_ca2_func) && ((FPTR)(intf->in_ca2_func) <= 0x100)) - { pia[which].in_ca2 = ((FPTR)(intf->in_ca2_func) - 1); pia[which].in_set |= PIA_IN_SET_CA2; } - if ((intf->in_cb1_func) && ((FPTR)(intf->in_cb1_func) <= 0x100)) - { pia[which].in_cb1 = ((FPTR)(intf->in_cb1_func) - 1); pia[which].in_set |= PIA_IN_SET_CB1; } - if ((intf->in_cb2_func) && ((FPTR)(intf->in_cb2_func) <= 0x100)) - { pia[which].in_cb2 = ((FPTR)(intf->in_cb2_func) - 1); pia[which].in_set |= PIA_IN_SET_CB2; } -} - - -/******************* reset *******************/ - -void pia_reset(void) -{ - int i; - - /* zap each structure, preserving the interface and swizzle */ - for (i = 0; i < MAX_PIA; i++) pia_config(i, pia[i].addr, pia[i].intf); -} - - -/******************* wire-OR for all interrupt handlers *******************/ - -static void update_shared_irq_handler(void (*irq_func)(int state)) -{ - int i; - - /* search all PIAs for this same IRQ function */ - for (i = 0; i < MAX_PIA; i++) - if (pia[i].intf) - { - /* check IRQ A */ - if (pia[i].intf->irq_a_func == irq_func && pia[i].irq_a_state) - { - (*irq_func)(1); - return; - } - - /* check IRQ B */ - if (pia[i].intf->irq_b_func == irq_func && pia[i].irq_b_state) - { - (*irq_func)(1); - return; - } - } - - /* if we found nothing, the state is off */ - (*irq_func)(0); -} - - -/******************* external interrupt check *******************/ - -static void update_6821_interrupts(struct pia6821 *p) -{ - int new_state; - - /* start with IRQ A */ - new_state = 0; - if ((p->irq_a1 && IRQ1_ENABLED(p->ctl_a)) || (p->irq_a2 && IRQ2_ENABLED(p->ctl_a))) new_state = 1; - if (new_state != p->irq_a_state) - { - p->irq_a_state = new_state; - if (p->intf->irq_a_func) update_shared_irq_handler(p->intf->irq_a_func); - } - - /* then do IRQ B */ - new_state = 0; - if ((p->irq_b1 && IRQ1_ENABLED(p->ctl_b)) || (p->irq_b2 && IRQ2_ENABLED(p->ctl_b))) new_state = 1; - if (new_state != p->irq_b_state) - { - p->irq_b_state = new_state; - if (p->intf->irq_b_func) update_shared_irq_handler(p->intf->irq_b_func); - } -} - - -/******************* CPU interface for PIA read *******************/ - -int pia_read(int which, int offset) -{ - struct pia6821 *p = pia + which; - int val = 0; - - /* adjust offset for 16-bit and ordering */ - offset &= 3; - if (p->addr & PIA_ALTERNATE_ORDERING) offset = swizzle_address[offset]; - - switch (offset) - { - /******************* port A output/DDR read *******************/ - case PIA_DDRA: - - /* read output register */ - if (OUTPUT_SELECTED(p->ctl_a)) - { - /* update the input */ - if ((FPTR)(p->intf->in_a_func) > 0x100) - p->in_a = p->intf->in_a_func(0); -#ifdef MAME_DEBUG - else if ((p->ddr_a ^ 0xff) && !(p->in_set & PIA_IN_SET_A)) { - logerror("PIA%d: Warning! no port A read handler. Assuming pins %02x not connected\n", - which, p->ddr_a ^ 0xff); - p->in_set |= PIA_IN_SET_A; // disable logging - } -#endif // MAME_DEBUG - - /* combine input and output values */ - val = (p->out_a & p->ddr_a) + (p->in_a & ~p->ddr_a); - - /* IRQ flags implicitly cleared by a read */ - p->irq_a1 = p->irq_a2 = 0; - update_6821_interrupts(p); - - /* CA2 is configured as output and in read strobe mode */ - if (C2_OUTPUT(p->ctl_a) && C2_STROBE_MODE(p->ctl_a)) - { - /* this will cause a transition low; call the output function if we're currently high */ - if (p->out_ca2) - if (p->intf->out_ca2_func) p->intf->out_ca2_func(0, 0); - p->out_ca2 = 0; - - /* if the CA2 strobe is cleared by the E, reset it right away */ - if (STROBE_E_RESET(p->ctl_a)) - { - if (p->intf->out_ca2_func) p->intf->out_ca2_func(0, 1); - p->out_ca2 = 1; - } - } - - LOG(("%04x: PIA%d read port A = %02X\n", activecpu_get_previouspc(), which, val)); - } - - /* read DDR register */ - else - { - val = p->ddr_a; - LOG(("%04x: PIA%d read DDR A = %02X\n", activecpu_get_previouspc(), which, val)); - } - break; - - /******************* port B output/DDR read *******************/ - case PIA_DDRB: - - /* read output register */ - if (OUTPUT_SELECTED(p->ctl_b)) - { - /* update the input */ - if ((FPTR)(p->intf->in_b_func) > 0x100) - p->in_b = p->intf->in_b_func(0); -#ifdef MAME_DEBUG - else if ((p->ddr_b ^ 0xff) && !(p->in_set & PIA_IN_SET_B)) { - logerror("PIA%d: Error! no port B read handler. Three-state pins %02x are undefined\n", - which, p->ddr_b ^ 0xff); - p->in_set |= PIA_IN_SET_B; // disable logging - } -#endif // MAME_DEBUG - - /* combine input and output values */ - val = (p->out_b & p->ddr_b) + (p->in_b & ~p->ddr_b); - - /* This read will implicitly clear the IRQ B1 flag. If CB2 is in write-strobe - output mode with CB1 restore, and a CB1 active transition set the flag, - clearing it will cause CB2 to go high again. Note that this is different - from what happens with port A. */ - if (p->irq_b1 && C2_OUTPUT(p->ctl_b) && C2_STROBE_MODE(p->ctl_b) && STROBE_C1_RESET(p->ctl_b)) - { - /* call the CB2 output function */ - if (!p->out_cb2) - if (p->intf->out_cb2_func) p->intf->out_cb2_func(0, 1); - - /* clear CB2 */ - p->out_cb2 = 1; - } - - /* IRQ flags implicitly cleared by a read */ - p->irq_b1 = p->irq_b2 = 0; - update_6821_interrupts(p); - - LOG(("%04x: PIA%d read port B = %02X\n", activecpu_get_previouspc(), which, val)); - } - - /* read DDR register */ - else - { - val = p->ddr_b; - LOG(("%04x: PIA%d read DDR B = %02X\n", activecpu_get_previouspc(), which, val)); - } - break; - - /******************* port A control read *******************/ - case PIA_CTLA: - - /* Update CA1 & CA2 if callback exists, these in turn may update IRQ's */ - if ((FPTR)(p->intf->in_ca1_func) > 0x100) - pia_set_input_ca1(which, p->intf->in_ca1_func(0)); -#ifdef MAME_DEBUG - else if (!(p->in_set & PIA_IN_SET_CA1)) { - logerror("PIA%d: Warning! no CA1 read handler. Assuming pin not connected\n",which); - p->in_set |= PIA_IN_SET_CA1; // disable logging - } -#endif // MAME_DEBUG - if ((FPTR)(p->intf->in_ca2_func) > 0x100) - pia_set_input_ca2(which, p->intf->in_ca2_func(0)); -#ifdef MAME_DEBUG - else if (C2_INPUT(p->ctl_a) && !(p->in_set & PIA_IN_SET_CA2)) { - logerror("PIA%d: Warning! no CA2 read handler. Assuming pin not connected\n",which); - p->in_set |= PIA_IN_SET_CA2; // disable logging - } -#endif // MAME_DEBUG - - /* read control register */ - val = p->ctl_a; - - /* set the IRQ flags if we have pending IRQs */ - if (p->irq_a1) val |= PIA_IRQ1; - if (p->irq_a2 && C2_INPUT(p->ctl_a)) val |= PIA_IRQ2; - - LOG(("%04x: PIA%d read control A = %02X\n", activecpu_get_previouspc(), which, val)); - break; - - /******************* port B control read *******************/ - case PIA_CTLB: - - /* Update CB1 & CB2 if callback exists, these in turn may update IRQ's */ - if ((FPTR)(p->intf->in_cb1_func) > 0x100) - pia_set_input_cb1(which, p->intf->in_cb1_func(0)); -#ifdef MAME_DEBUG - else if (!(p->in_set & PIA_IN_SET_CB1)) { - logerror("PIA%d: Error! no CB1 read handler. Three-state pin is undefined\n",which); - p->in_set |= PIA_IN_SET_CB1; // disable logging - } -#endif // MAME_DEBUG - if ((FPTR)(p->intf->in_cb2_func) > 0x100) - pia_set_input_cb2(which, p->intf->in_cb2_func(0)); -#ifdef MAME_DEBUG - else if (C2_INPUT(p->ctl_b) && !(p->in_set & PIA_IN_SET_CB2)) { - logerror("PIA%d: Error! no CB2 read handler. Three-state pin is undefined\n",which); - p->in_set |= PIA_IN_SET_CB2; // disable logging - } -#endif // MAME_DEBUG - - /* read control register */ - val = p->ctl_b; - - /* set the IRQ flags if we have pending IRQs */ - if (p->irq_b1) val |= PIA_IRQ1; - if (p->irq_b2 && C2_INPUT(p->ctl_b)) val |= PIA_IRQ2; - - LOG(("%04x: PIA%d read control B = %02X\n", activecpu_get_previouspc(), which, val)); - break; - } - - return val; -} - - -/******************* CPU interface for PIA write *******************/ - -void pia_write(int which, int offset, int data) -{ - struct pia6821 *p = pia + which; - - /* adjust offset for 16-bit and ordering */ - offset &= 3; - if (p->addr & PIA_ALTERNATE_ORDERING) offset = swizzle_address[offset]; - - switch (offset) - { - /******************* port A output/DDR write *******************/ - case PIA_DDRA: - - /* write output register */ - if (OUTPUT_SELECTED(p->ctl_a)) - { - LOG(("%04x: PIA%d port A write = %02X\n", activecpu_get_previouspc(), which, data)); - - /* update the output value */ - p->out_a = data;/* & p->ddr_a; */ /* NS990130 - don't mask now, DDR could change later */ - - /* send it to the output function */ - if (p->intf->out_a_func && p->ddr_a) p->intf->out_a_func(0, p->out_a & p->ddr_a); /* NS990130 */ - } - - /* write DDR register */ - else - { - LOG(("%04x: PIA%d DDR A write = %02X\n", activecpu_get_previouspc(), which, data)); - - if (p->ddr_a != data) - { - /* NS990130 - if DDR changed, call the callback again */ - p->ddr_a = data; - - /* send it to the output function */ - if (p->intf->out_a_func && p->ddr_a) p->intf->out_a_func(0, p->out_a & p->ddr_a); - } - } - break; - - /******************* port B output/DDR write *******************/ - case PIA_DDRB: - - /* write output register */ - if (OUTPUT_SELECTED(p->ctl_b)) - { - LOG(("%04x: PIA%d port B write = %02X\n", activecpu_get_previouspc(), which, data)); - - /* update the output value */ - p->out_b = data;/* & p->ddr_b */ /* NS990130 - don't mask now, DDR could change later */ - - /* send it to the output function */ - if (p->intf->out_b_func && p->ddr_b) p->intf->out_b_func(0, p->out_b & p->ddr_b); /* NS990130 */ - - /* CB2 is configured as output and in write strobe mode */ - if (C2_OUTPUT(p->ctl_b) && C2_STROBE_MODE(p->ctl_b)) - { - /* this will cause a transition low; call the output function if we're currently high */ - if (p->out_cb2) - if (p->intf->out_cb2_func) p->intf->out_cb2_func(0, 0); - p->out_cb2 = 0; - - /* if the CB2 strobe is cleared by the E, reset it right away */ - if (STROBE_E_RESET(p->ctl_b)) - { - if (p->intf->out_cb2_func) p->intf->out_cb2_func(0, 1); - p->out_cb2 = 1; - } - } - } - - /* write DDR register */ - else - { - LOG(("%04x: PIA%d DDR B write = %02X\n", activecpu_get_previouspc(), which, data)); - - if (p->ddr_b != data) - { - /* NS990130 - if DDR changed, call the callback again */ - p->ddr_b = data; - - /* send it to the output function */ - if (p->intf->out_b_func && p->ddr_b) p->intf->out_b_func(0, p->out_b & p->ddr_b); - } - } - break; - - /******************* port A control write *******************/ - case PIA_CTLA: - - /* Bit 7 and 6 read only - PD 16/01/00 */ - - data &= 0x3f; - - - LOG(("%04x: PIA%d control A write = %02X\n", activecpu_get_previouspc(), which, data)); - - /* CA2 is configured as output */ - if (C2_OUTPUT(data)) - { - int temp; - - if (C2_SET_MODE(data)) - { - /* set/reset mode--bit value determines the new output */ - temp = SET_C2(data) ? 1 : 0; - } - else { - /* strobe mode--output is always high unless strobed. */ - temp = 1; - } - - /* if we're going from input to output mode, or we're already in output mode - and this change creates a transition, call the CA2 output function */ - if (C2_INPUT(p->ctl_a) || (C2_OUTPUT(p->ctl_a) && (p->out_ca2 ^ temp))) - if (p->intf->out_ca2_func) p->intf->out_ca2_func(0, temp); - - /* set the new value */ - p->out_ca2 = temp; - } - - /* update the control register */ - p->ctl_a = data; - - /* update externals */ - update_6821_interrupts(p); - break; - - /******************* port B control write *******************/ - case PIA_CTLB: - - /* Bit 7 and 6 read only - PD 16/01/00 */ - - data &= 0x3f; - - LOG(("%04x: PIA%d control B write = %02X\n", activecpu_get_previouspc(), which, data)); - - /* CB2 is configured as output */ - if (C2_OUTPUT(data)) - { - int temp; - - if (C2_SET_MODE(data)) - { - /* set/reset mode--bit value determines the new output */ - temp = SET_C2(data) ? 1 : 0; - } - else { - /* strobe mode--output is always high unless strobed. */ - temp = 1; - } - - /* if we're going from input to output mode, or we're already in output mode - and this change creates a transition, call the CB2 output function */ - if (C2_INPUT(p->ctl_b) || (C2_OUTPUT(p->ctl_b) && (p->out_cb2 ^ temp))) - if (p->intf->out_cb2_func) p->intf->out_cb2_func(0, temp); - - /* set the new value */ - p->out_cb2 = temp; - } - - /* update the control register */ - p->ctl_b = data; - - /* update externals */ - update_6821_interrupts(p); - break; - } -} - - -/******************* interface setting PIA port A input *******************/ - -void pia_set_input_a(int which, int data) -{ - struct pia6821 *p = pia + which; - - /* set the input, what could be easier? */ - p->in_a = data; - p->in_set |= PIA_IN_SET_A; -} - - - -/******************* interface setting PIA port CA1 input *******************/ - -void pia_set_input_ca1(int which, int data) -{ - struct pia6821 *p = pia + which; - - /* limit the data to 0 or 1 */ - data = data ? 1 : 0; - - /* the new state has caused a transition */ - if (p->in_ca1 ^ data) - { - /* handle the active transition */ - if ((data && C1_LOW_TO_HIGH(p->ctl_a)) || (!data && C1_HIGH_TO_LOW(p->ctl_a))) - { - /* mark the IRQ */ - p->irq_a1 = 1; - - /* update externals */ - update_6821_interrupts(p); - - /* CA2 is configured as output and in read strobe mode and cleared by a CA1 transition */ - if (C2_OUTPUT(p->ctl_a) && C2_STROBE_MODE(p->ctl_a) && STROBE_C1_RESET(p->ctl_a)) - { - /* call the CA2 output function */ - if (!p->out_ca2) - if (p->intf->out_ca2_func) p->intf->out_ca2_func(0, 1); - - /* clear CA2 */ - p->out_ca2 = 1; - } - } - } - - /* set the new value for CA1 */ - p->in_ca1 = data; - p->in_set |= PIA_IN_SET_CA1; -} - - - -/******************* interface setting PIA port CA2 input *******************/ - -void pia_set_input_ca2(int which, int data) -{ - struct pia6821 *p = pia + which; - - /* limit the data to 0 or 1 */ - data = data ? 1 : 0; - - /* CA2 is in input mode */ - if (C2_INPUT(p->ctl_a)) - { - /* the new state has caused a transition */ - if (p->in_ca2 ^ data) - { - /* handle the active transition */ - if ((data && C2_LOW_TO_HIGH(p->ctl_a)) || (!data && C2_HIGH_TO_LOW(p->ctl_a))) - { - /* mark the IRQ */ - p->irq_a2 = 1; - - /* update externals */ - update_6821_interrupts(p); - } - } - } - - /* set the new value for CA2 */ - p->in_ca2 = data; - p->in_set |= PIA_IN_SET_CA2; -} - - - -/******************* interface setting PIA port B input *******************/ - -void pia_set_input_b(int which, int data) -{ - struct pia6821 *p = pia + which; - - /* set the input, what could be easier? */ - p->in_b = data; - p->in_set |= PIA_IN_SET_B; -} - - - -/******************* interface setting PIA port CB1 input *******************/ - -void pia_set_input_cb1(int which, int data) -{ - struct pia6821 *p = pia + which; - - /* limit the data to 0 or 1 */ - data = data ? 1 : 0; - - /* the new state has caused a transition */ - if (p->in_cb1 ^ data) - { - /* handle the active transition */ - if ((data && C1_LOW_TO_HIGH(p->ctl_b)) || (!data && C1_HIGH_TO_LOW(p->ctl_b))) - { - /* mark the IRQ */ - p->irq_b1 = 1; - - /* update externals */ - update_6821_interrupts(p); - - /* If CB2 is configured as a write-strobe output which is reset by a CB1 - transition, this reset will only happen when a read from port B implicitly - clears the IRQ B1 flag. So we handle the CB2 reset there. Note that this - is different from what happens with port A. */ - } - } - - /* set the new value for CB1 */ - p->in_cb1 = data; - p->in_set |= PIA_IN_SET_CB1; -} - - - -/******************* interface setting PIA port CB2 input *******************/ - -void pia_set_input_cb2(int which, int data) -{ - struct pia6821 *p = pia + which; - - /* limit the data to 0 or 1 */ - data = data ? 1 : 0; - - /* CB2 is in input mode */ - if (C2_INPUT(p->ctl_b)) - { - /* the new state has caused a transition */ - if (p->in_cb2 ^ data) - { - /* handle the active transition */ - if ((data && C2_LOW_TO_HIGH(p->ctl_b)) || (!data && C2_HIGH_TO_LOW(p->ctl_b))) - { - /* mark the IRQ */ - p->irq_b2 = 1; - - /* update externals */ - update_6821_interrupts(p); - } - } - } - - /* set the new value for CA2 */ - p->in_cb2 = data; - p->in_set |= PIA_IN_SET_CB2; -} - - - -/******************* interface retrieving DDR *******************/ - -UINT8 pia_get_ddr_a(int which) -{ - struct pia6821 *p = pia + which; - return p->ddr_a; -} - - - -UINT8 pia_get_ddr_b(int which) -{ - struct pia6821 *p = pia + which; - return p->ddr_b; -} - - - -#if 0 -/******************* Standard 8-bit CPU interfaces, D0-D7 *******************/ - -READ8_HANDLER( pia_0_r ) { return pia_read(0, offset); } -READ8_HANDLER( pia_1_r ) { return pia_read(1, offset); } -READ8_HANDLER( pia_2_r ) { return pia_read(2, offset); } -READ8_HANDLER( pia_3_r ) { return pia_read(3, offset); } -READ8_HANDLER( pia_4_r ) { return pia_read(4, offset); } -READ8_HANDLER( pia_5_r ) { return pia_read(5, offset); } -READ8_HANDLER( pia_6_r ) { return pia_read(6, offset); } -READ8_HANDLER( pia_7_r ) { return pia_read(7, offset); } - -WRITE8_HANDLER( pia_0_w ) { pia_write(0, offset, data); } -WRITE8_HANDLER( pia_1_w ) { pia_write(1, offset, data); } -WRITE8_HANDLER( pia_2_w ) { pia_write(2, offset, data); } -WRITE8_HANDLER( pia_3_w ) { pia_write(3, offset, data); } -WRITE8_HANDLER( pia_4_w ) { pia_write(4, offset, data); } -WRITE8_HANDLER( pia_5_w ) { pia_write(5, offset, data); } -WRITE8_HANDLER( pia_6_w ) { pia_write(6, offset, data); } -WRITE8_HANDLER( pia_7_w ) { pia_write(7, offset, data); } - -/******************* Standard 16-bit CPU interfaces, D0-D7 *******************/ - -READ16_HANDLER( pia_0_lsb_r ) { return pia_read(0, offset); } -READ16_HANDLER( pia_1_lsb_r ) { return pia_read(1, offset); } -READ16_HANDLER( pia_2_lsb_r ) { return pia_read(2, offset); } -READ16_HANDLER( pia_3_lsb_r ) { return pia_read(3, offset); } -READ16_HANDLER( pia_4_lsb_r ) { return pia_read(4, offset); } -READ16_HANDLER( pia_5_lsb_r ) { return pia_read(5, offset); } -READ16_HANDLER( pia_6_lsb_r ) { return pia_read(6, offset); } -READ16_HANDLER( pia_7_lsb_r ) { return pia_read(7, offset); } - -WRITE16_HANDLER( pia_0_lsb_w ) { if (ACCESSING_LSB) pia_write(0, offset, data & 0xff); } -WRITE16_HANDLER( pia_1_lsb_w ) { if (ACCESSING_LSB) pia_write(1, offset, data & 0xff); } -WRITE16_HANDLER( pia_2_lsb_w ) { if (ACCESSING_LSB) pia_write(2, offset, data & 0xff); } -WRITE16_HANDLER( pia_3_lsb_w ) { if (ACCESSING_LSB) pia_write(3, offset, data & 0xff); } -WRITE16_HANDLER( pia_4_lsb_w ) { if (ACCESSING_LSB) pia_write(4, offset, data & 0xff); } -WRITE16_HANDLER( pia_5_lsb_w ) { if (ACCESSING_LSB) pia_write(5, offset, data & 0xff); } -WRITE16_HANDLER( pia_6_lsb_w ) { if (ACCESSING_LSB) pia_write(6, offset, data & 0xff); } -WRITE16_HANDLER( pia_7_lsb_w ) { if (ACCESSING_LSB) pia_write(7, offset, data & 0xff); } - -/******************* Standard 16-bit CPU interfaces, D8-D15 *******************/ - -READ16_HANDLER( pia_0_msb_r ) { return pia_read(0, offset) << 8; } -READ16_HANDLER( pia_1_msb_r ) { return pia_read(1, offset) << 8; } -READ16_HANDLER( pia_2_msb_r ) { return pia_read(2, offset) << 8; } -READ16_HANDLER( pia_3_msb_r ) { return pia_read(3, offset) << 8; } -READ16_HANDLER( pia_4_msb_r ) { return pia_read(4, offset) << 8; } -READ16_HANDLER( pia_5_msb_r ) { return pia_read(5, offset) << 8; } -READ16_HANDLER( pia_6_msb_r ) { return pia_read(6, offset) << 8; } -READ16_HANDLER( pia_7_msb_r ) { return pia_read(7, offset) << 8; } - -WRITE16_HANDLER( pia_0_msb_w ) { if (ACCESSING_MSB) pia_write(0, offset, data >> 8); } -WRITE16_HANDLER( pia_1_msb_w ) { if (ACCESSING_MSB) pia_write(1, offset, data >> 8); } -WRITE16_HANDLER( pia_2_msb_w ) { if (ACCESSING_MSB) pia_write(2, offset, data >> 8); } -WRITE16_HANDLER( pia_3_msb_w ) { if (ACCESSING_MSB) pia_write(3, offset, data >> 8); } -WRITE16_HANDLER( pia_4_msb_w ) { if (ACCESSING_MSB) pia_write(4, offset, data >> 8); } -WRITE16_HANDLER( pia_5_msb_w ) { if (ACCESSING_MSB) pia_write(5, offset, data >> 8); } -WRITE16_HANDLER( pia_6_msb_w ) { if (ACCESSING_MSB) pia_write(6, offset, data >> 8); } -WRITE16_HANDLER( pia_7_msb_w ) { if (ACCESSING_MSB) pia_write(7, offset, data >> 8); } - -/******************* 8-bit A/B port interfaces *******************/ - -WRITE8_HANDLER( pia_0_porta_w ) { pia_set_input_a(0, data); } -WRITE8_HANDLER( pia_1_porta_w ) { pia_set_input_a(1, data); } -WRITE8_HANDLER( pia_2_porta_w ) { pia_set_input_a(2, data); } -WRITE8_HANDLER( pia_3_porta_w ) { pia_set_input_a(3, data); } -WRITE8_HANDLER( pia_4_porta_w ) { pia_set_input_a(4, data); } -WRITE8_HANDLER( pia_5_porta_w ) { pia_set_input_a(5, data); } -WRITE8_HANDLER( pia_6_porta_w ) { pia_set_input_a(6, data); } -WRITE8_HANDLER( pia_7_porta_w ) { pia_set_input_a(7, data); } - -WRITE8_HANDLER( pia_0_portb_w ) { pia_set_input_b(0, data); } -WRITE8_HANDLER( pia_1_portb_w ) { pia_set_input_b(1, data); } -WRITE8_HANDLER( pia_2_portb_w ) { pia_set_input_b(2, data); } -WRITE8_HANDLER( pia_3_portb_w ) { pia_set_input_b(3, data); } -WRITE8_HANDLER( pia_4_portb_w ) { pia_set_input_b(4, data); } -WRITE8_HANDLER( pia_5_portb_w ) { pia_set_input_b(5, data); } -WRITE8_HANDLER( pia_6_portb_w ) { pia_set_input_b(6, data); } -WRITE8_HANDLER( pia_7_portb_w ) { pia_set_input_b(7, data); } - -READ8_HANDLER( pia_0_porta_r ) { return pia[0].in_a; } -READ8_HANDLER( pia_1_porta_r ) { return pia[1].in_a; } -READ8_HANDLER( pia_2_porta_r ) { return pia[2].in_a; } -READ8_HANDLER( pia_3_porta_r ) { return pia[3].in_a; } -READ8_HANDLER( pia_4_porta_r ) { return pia[4].in_a; } -READ8_HANDLER( pia_5_porta_r ) { return pia[5].in_a; } -READ8_HANDLER( pia_6_porta_r ) { return pia[6].in_a; } -READ8_HANDLER( pia_7_porta_r ) { return pia[7].in_a; } - -READ8_HANDLER( pia_0_portb_r ) { return pia[0].in_b; } -READ8_HANDLER( pia_1_portb_r ) { return pia[1].in_b; } -READ8_HANDLER( pia_2_portb_r ) { return pia[2].in_b; } -READ8_HANDLER( pia_3_portb_r ) { return pia[3].in_b; } -READ8_HANDLER( pia_4_portb_r ) { return pia[4].in_b; } -READ8_HANDLER( pia_5_portb_r ) { return pia[5].in_b; } -READ8_HANDLER( pia_6_portb_r ) { return pia[6].in_b; } -READ8_HANDLER( pia_7_portb_r ) { return pia[7].in_b; } - -/******************* 1-bit CA1/CA2/CB1/CB2 port interfaces *******************/ - -WRITE8_HANDLER( pia_0_ca1_w ) { pia_set_input_ca1(0, data); } -WRITE8_HANDLER( pia_1_ca1_w ) { pia_set_input_ca1(1, data); } -WRITE8_HANDLER( pia_2_ca1_w ) { pia_set_input_ca1(2, data); } -WRITE8_HANDLER( pia_3_ca1_w ) { pia_set_input_ca1(3, data); } -WRITE8_HANDLER( pia_4_ca1_w ) { pia_set_input_ca1(4, data); } -WRITE8_HANDLER( pia_5_ca1_w ) { pia_set_input_ca1(5, data); } -WRITE8_HANDLER( pia_6_ca1_w ) { pia_set_input_ca1(6, data); } -WRITE8_HANDLER( pia_7_ca1_w ) { pia_set_input_ca1(7, data); } -WRITE8_HANDLER( pia_0_ca2_w ) { pia_set_input_ca2(0, data); } -WRITE8_HANDLER( pia_1_ca2_w ) { pia_set_input_ca2(1, data); } -WRITE8_HANDLER( pia_2_ca2_w ) { pia_set_input_ca2(2, data); } -WRITE8_HANDLER( pia_3_ca2_w ) { pia_set_input_ca2(3, data); } -WRITE8_HANDLER( pia_4_ca2_w ) { pia_set_input_ca2(4, data); } -WRITE8_HANDLER( pia_5_ca2_w ) { pia_set_input_ca2(5, data); } -WRITE8_HANDLER( pia_6_ca2_w ) { pia_set_input_ca2(6, data); } -WRITE8_HANDLER( pia_7_ca2_w ) { pia_set_input_ca2(7, data); } - -WRITE8_HANDLER( pia_0_cb1_w ) { pia_set_input_cb1(0, data); } -WRITE8_HANDLER( pia_1_cb1_w ) { pia_set_input_cb1(1, data); } -WRITE8_HANDLER( pia_2_cb1_w ) { pia_set_input_cb1(2, data); } -WRITE8_HANDLER( pia_3_cb1_w ) { pia_set_input_cb1(3, data); } -WRITE8_HANDLER( pia_4_cb1_w ) { pia_set_input_cb1(4, data); } -WRITE8_HANDLER( pia_5_cb1_w ) { pia_set_input_cb1(5, data); } -WRITE8_HANDLER( pia_6_cb1_w ) { pia_set_input_cb1(6, data); } -WRITE8_HANDLER( pia_7_cb1_w ) { pia_set_input_cb1(7, data); } -WRITE8_HANDLER( pia_0_cb2_w ) { pia_set_input_cb2(0, data); } -WRITE8_HANDLER( pia_1_cb2_w ) { pia_set_input_cb2(1, data); } -WRITE8_HANDLER( pia_2_cb2_w ) { pia_set_input_cb2(2, data); } -WRITE8_HANDLER( pia_3_cb2_w ) { pia_set_input_cb2(3, data); } -WRITE8_HANDLER( pia_4_cb2_w ) { pia_set_input_cb2(4, data); } -WRITE8_HANDLER( pia_5_cb2_w ) { pia_set_input_cb2(5, data); } -WRITE8_HANDLER( pia_6_cb2_w ) { pia_set_input_cb2(6, data); } -WRITE8_HANDLER( pia_7_cb2_w ) { pia_set_input_cb2(7, data); } - -READ8_HANDLER( pia_0_ca1_r ) { return pia[0].in_ca1; } -READ8_HANDLER( pia_1_ca1_r ) { return pia[1].in_ca1; } -READ8_HANDLER( pia_2_ca1_r ) { return pia[2].in_ca1; } -READ8_HANDLER( pia_3_ca1_r ) { return pia[3].in_ca1; } -READ8_HANDLER( pia_4_ca1_r ) { return pia[4].in_ca1; } -READ8_HANDLER( pia_5_ca1_r ) { return pia[5].in_ca1; } -READ8_HANDLER( pia_6_ca1_r ) { return pia[6].in_ca1; } -READ8_HANDLER( pia_7_ca1_r ) { return pia[7].in_ca1; } -READ8_HANDLER( pia_0_ca2_r ) { return pia[0].in_ca2; } -READ8_HANDLER( pia_1_ca2_r ) { return pia[1].in_ca2; } -READ8_HANDLER( pia_2_ca2_r ) { return pia[2].in_ca2; } -READ8_HANDLER( pia_3_ca2_r ) { return pia[3].in_ca2; } -READ8_HANDLER( pia_4_ca2_r ) { return pia[4].in_ca2; } -READ8_HANDLER( pia_5_ca2_r ) { return pia[5].in_ca2; } -READ8_HANDLER( pia_6_ca2_r ) { return pia[6].in_ca2; } -READ8_HANDLER( pia_7_ca2_r ) { return pia[7].in_ca2; } - -READ8_HANDLER( pia_0_cb1_r ) { return pia[0].in_cb1; } -READ8_HANDLER( pia_1_cb1_r ) { return pia[1].in_cb1; } -READ8_HANDLER( pia_2_cb1_r ) { return pia[2].in_cb1; } -READ8_HANDLER( pia_3_cb1_r ) { return pia[3].in_cb1; } -READ8_HANDLER( pia_4_cb1_r ) { return pia[4].in_cb1; } -READ8_HANDLER( pia_5_cb1_r ) { return pia[5].in_cb1; } -READ8_HANDLER( pia_6_cb1_r ) { return pia[6].in_cb1; } -READ8_HANDLER( pia_7_cb1_r ) { return pia[7].in_cb1; } -READ8_HANDLER( pia_0_cb2_r ) { return pia[0].in_cb2; } -READ8_HANDLER( pia_1_cb2_r ) { return pia[1].in_cb2; } -READ8_HANDLER( pia_2_cb2_r ) { return pia[2].in_cb2; } -READ8_HANDLER( pia_3_cb2_r ) { return pia[3].in_cb2; } -READ8_HANDLER( pia_4_cb2_r ) { return pia[4].in_cb2; } -READ8_HANDLER( pia_5_cb2_r ) { return pia[5].in_cb2; } -READ8_HANDLER( pia_6_cb2_r ) { return pia[6].in_cb2; } -READ8_HANDLER( pia_7_cb2_r ) { return pia[7].in_cb2; } -#endif diff --git a/jan/src/burn/devices/6821pia.h b/jan/src/burn/devices/6821pia.h deleted file mode 100644 index c45ca338d..000000000 --- a/jan/src/burn/devices/6821pia.h +++ /dev/null @@ -1,238 +0,0 @@ -/********************************************************************** - - Motorola 6821 PIA interface and emulation - - This function emulates all the functionality of up to 4 M6821 - peripheral interface adapters. - -**********************************************************************/ -#define MAX_PIA 8 - - -/* this is the standard ordering of the registers */ -/* alternate ordering swaps registers 1 and 2 */ -#define PIA_DDRA 0 -#define PIA_CTLA 1 -#define PIA_DDRB 2 -#define PIA_CTLB 3 - -/* PIA addressing modes */ -#define PIA_STANDARD_ORDERING 0 -#define PIA_ALTERNATE_ORDERING 1 - -#ifdef MESS -#define PIA_8BIT 0 -#define PIA_AUTOSENSE 8 -#endif - - -struct pia6821_interface -{ - UINT8 (*in_a_func)(UINT16 offset); - UINT8 (*in_b_func)(UINT16 offset); - UINT8 (*in_ca1_func)(UINT16 offset); - UINT8 (*in_cb1_func)(UINT16 offset); - UINT8 (*in_ca2_func)(UINT16 offset); - UINT8 (*in_cb2_func)(UINT16 offset); - void (*out_a_func)(UINT16 offset, UINT8 data); - void (*out_b_func)(UINT16 offset, UINT8 data); - void (*out_ca2_func)(UINT16 offset, UINT8 data); - void (*out_cb2_func)(UINT16 offset, UINT8 data); - void (*irq_a_func)(int state); - void (*irq_b_func)(int state); -}; - -#ifdef __cplusplus -extern "C" { -#endif - -//void pia_init(int count); -void pia_init(void); -void pia_exit(void); -void pia_config(int which, int addressing, const struct pia6821_interface *intf); -void pia_reset(void); -int pia_read(int which, int offset); -void pia_write(int which, int offset, int data); -void pia_set_input_a(int which, int data); -void pia_set_input_ca1(int which, int data); -void pia_set_input_ca2(int which, int data); -void pia_set_input_b(int which, int data); -void pia_set_input_cb1(int which, int data); -void pia_set_input_cb2(int which, int data); -UINT8 pia_get_ddr_a(int which); -UINT8 pia_get_ddr_b(int which); - -#if 0 -#define PIA_UNUSED_VAL(x) ((read8_handler)(x+1)) -/******************* Standard 8-bit CPU interfaces, D0-D7 *******************/ - -READ8_HANDLER( pia_0_r ); -READ8_HANDLER( pia_1_r ); -READ8_HANDLER( pia_2_r ); -READ8_HANDLER( pia_3_r ); -READ8_HANDLER( pia_4_r ); -READ8_HANDLER( pia_5_r ); -READ8_HANDLER( pia_6_r ); -READ8_HANDLER( pia_7_r ); - -WRITE8_HANDLER( pia_0_w ); -WRITE8_HANDLER( pia_1_w ); -WRITE8_HANDLER( pia_2_w ); -WRITE8_HANDLER( pia_3_w ); -WRITE8_HANDLER( pia_4_w ); -WRITE8_HANDLER( pia_5_w ); -WRITE8_HANDLER( pia_6_w ); -WRITE8_HANDLER( pia_7_w ); - -/******************* Standard 16-bit CPU interfaces, D0-D7 *******************/ - -READ16_HANDLER( pia_0_lsb_r ); -READ16_HANDLER( pia_1_lsb_r ); -READ16_HANDLER( pia_2_lsb_r ); -READ16_HANDLER( pia_3_lsb_r ); -READ16_HANDLER( pia_4_lsb_r ); -READ16_HANDLER( pia_5_lsb_r ); -READ16_HANDLER( pia_6_lsb_r ); -READ16_HANDLER( pia_7_lsb_r ); - -WRITE16_HANDLER( pia_0_lsb_w ); -WRITE16_HANDLER( pia_1_lsb_w ); -WRITE16_HANDLER( pia_2_lsb_w ); -WRITE16_HANDLER( pia_3_lsb_w ); -WRITE16_HANDLER( pia_4_lsb_w ); -WRITE16_HANDLER( pia_5_lsb_w ); -WRITE16_HANDLER( pia_6_lsb_w ); -WRITE16_HANDLER( pia_7_lsb_w ); - -/******************* Standard 16-bit CPU interfaces, D8-D15 *******************/ - -READ16_HANDLER( pia_0_msb_r ); -READ16_HANDLER( pia_1_msb_r ); -READ16_HANDLER( pia_2_msb_r ); -READ16_HANDLER( pia_3_msb_r ); -READ16_HANDLER( pia_4_msb_r ); -READ16_HANDLER( pia_5_msb_r ); -READ16_HANDLER( pia_6_msb_r ); -READ16_HANDLER( pia_7_msb_r ); - -WRITE16_HANDLER( pia_0_msb_w ); -WRITE16_HANDLER( pia_1_msb_w ); -WRITE16_HANDLER( pia_2_msb_w ); -WRITE16_HANDLER( pia_3_msb_w ); -WRITE16_HANDLER( pia_4_msb_w ); -WRITE16_HANDLER( pia_5_msb_w ); -WRITE16_HANDLER( pia_6_msb_w ); -WRITE16_HANDLER( pia_7_msb_w ); - -/******************* 8-bit A/B port interfaces *******************/ - -WRITE8_HANDLER( pia_0_porta_w ); -WRITE8_HANDLER( pia_1_porta_w ); -WRITE8_HANDLER( pia_2_porta_w ); -WRITE8_HANDLER( pia_3_porta_w ); -WRITE8_HANDLER( pia_4_porta_w ); -WRITE8_HANDLER( pia_5_porta_w ); -WRITE8_HANDLER( pia_6_porta_w ); -WRITE8_HANDLER( pia_7_porta_w ); - -WRITE8_HANDLER( pia_0_portb_w ); -WRITE8_HANDLER( pia_1_portb_w ); -WRITE8_HANDLER( pia_2_portb_w ); -WRITE8_HANDLER( pia_3_portb_w ); -WRITE8_HANDLER( pia_4_portb_w ); -WRITE8_HANDLER( pia_5_portb_w ); -WRITE8_HANDLER( pia_6_portb_w ); -WRITE8_HANDLER( pia_7_portb_w ); - -READ8_HANDLER( pia_0_porta_r ); -READ8_HANDLER( pia_1_porta_r ); -READ8_HANDLER( pia_2_porta_r ); -READ8_HANDLER( pia_3_porta_r ); -READ8_HANDLER( pia_4_porta_r ); -READ8_HANDLER( pia_5_porta_r ); -READ8_HANDLER( pia_6_porta_r ); -READ8_HANDLER( pia_7_porta_r ); - -READ8_HANDLER( pia_0_portb_r ); -READ8_HANDLER( pia_1_portb_r ); -READ8_HANDLER( pia_2_portb_r ); -READ8_HANDLER( pia_3_portb_r ); -READ8_HANDLER( pia_4_portb_r ); -READ8_HANDLER( pia_5_portb_r ); -READ8_HANDLER( pia_6_portb_r ); -READ8_HANDLER( pia_7_portb_r ); - -/******************* 1-bit CA1/CA2/CB1/CB2 port interfaces *******************/ - -WRITE8_HANDLER( pia_0_ca1_w ); -WRITE8_HANDLER( pia_1_ca1_w ); -WRITE8_HANDLER( pia_2_ca1_w ); -WRITE8_HANDLER( pia_3_ca1_w ); -WRITE8_HANDLER( pia_4_ca1_w ); -WRITE8_HANDLER( pia_5_ca1_w ); -WRITE8_HANDLER( pia_6_ca1_w ); -WRITE8_HANDLER( pia_7_ca1_w ); -WRITE8_HANDLER( pia_0_ca2_w ); -WRITE8_HANDLER( pia_1_ca2_w ); -WRITE8_HANDLER( pia_2_ca2_w ); -WRITE8_HANDLER( pia_3_ca2_w ); -WRITE8_HANDLER( pia_4_ca2_w ); -WRITE8_HANDLER( pia_5_ca2_w ); -WRITE8_HANDLER( pia_6_ca2_w ); -WRITE8_HANDLER( pia_7_ca2_w ); - -WRITE8_HANDLER( pia_0_cb1_w ); -WRITE8_HANDLER( pia_1_cb1_w ); -WRITE8_HANDLER( pia_2_cb1_w ); -WRITE8_HANDLER( pia_3_cb1_w ); -WRITE8_HANDLER( pia_4_cb1_w ); -WRITE8_HANDLER( pia_5_cb1_w ); -WRITE8_HANDLER( pia_6_cb1_w ); -WRITE8_HANDLER( pia_7_cb1_w ); -WRITE8_HANDLER( pia_0_cb2_w ); -WRITE8_HANDLER( pia_1_cb2_w ); -WRITE8_HANDLER( pia_2_cb2_w ); -WRITE8_HANDLER( pia_3_cb2_w ); -WRITE8_HANDLER( pia_4_cb2_w ); -WRITE8_HANDLER( pia_5_cb2_w ); -WRITE8_HANDLER( pia_6_cb2_w ); -WRITE8_HANDLER( pia_7_cb2_w ); - -READ8_HANDLER( pia_0_ca1_r ); -READ8_HANDLER( pia_1_ca1_r ); -READ8_HANDLER( pia_2_ca1_r ); -READ8_HANDLER( pia_3_ca1_r ); -READ8_HANDLER( pia_4_ca1_r ); -READ8_HANDLER( pia_5_ca1_r ); -READ8_HANDLER( pia_6_ca1_r ); -READ8_HANDLER( pia_7_ca1_r ); -READ8_HANDLER( pia_0_ca2_r ); -READ8_HANDLER( pia_1_ca2_r ); -READ8_HANDLER( pia_2_ca2_r ); -READ8_HANDLER( pia_3_ca2_r ); -READ8_HANDLER( pia_4_ca2_r ); -READ8_HANDLER( pia_5_ca2_r ); -READ8_HANDLER( pia_6_ca2_r ); -READ8_HANDLER( pia_7_ca2_r ); - -READ8_HANDLER( pia_0_cb1_r ); -READ8_HANDLER( pia_1_cb1_r ); -READ8_HANDLER( pia_2_cb1_r ); -READ8_HANDLER( pia_3_cb1_r ); -READ8_HANDLER( pia_4_cb1_r ); -READ8_HANDLER( pia_5_cb1_r ); -READ8_HANDLER( pia_6_cb1_r ); -READ8_HANDLER( pia_7_cb1_r ); -READ8_HANDLER( pia_0_cb2_r ); -READ8_HANDLER( pia_1_cb2_r ); -READ8_HANDLER( pia_2_cb2_r ); -READ8_HANDLER( pia_3_cb2_r ); -READ8_HANDLER( pia_4_cb2_r ); -READ8_HANDLER( pia_5_cb2_r ); -READ8_HANDLER( pia_6_cb2_r ); -READ8_HANDLER( pia_7_cb2_r ); -#endif - -#ifdef __cplusplus -} -#endif diff --git a/jan/src/burn/devices/8255ppi.cpp b/jan/src/burn/devices/8255ppi.cpp deleted file mode 100644 index 95b63e533..000000000 --- a/jan/src/burn/devices/8255ppi.cpp +++ /dev/null @@ -1,486 +0,0 @@ -// Based on MAME driver by Curt Coder - -#include "burnint.h" -#include "8255ppi.h" - -#define MAX_PPIS 3 - -PPIPortRead PPI0PortReadA; -PPIPortRead PPI0PortReadB; -PPIPortRead PPI0PortReadC; -PPIPortWrite PPI0PortWriteA; -PPIPortWrite PPI0PortWriteB; -PPIPortWrite PPI0PortWriteC; -PPIPortRead PPI1PortReadA; -PPIPortRead PPI1PortReadB; -PPIPortRead PPI1PortReadC; -PPIPortWrite PPI1PortWriteA; -PPIPortWrite PPI1PortWriteB; -PPIPortWrite PPI1PortWriteC; -PPIPortRead PPI2PortReadA; -PPIPortRead PPI2PortReadB; -PPIPortRead PPI2PortReadC; -PPIPortWrite PPI2PortWriteA; -PPIPortWrite PPI2PortWriteB; -PPIPortWrite PPI2PortWriteC; - -typedef struct -{ - /* mode flags */ - UINT8 groupA_mode; - UINT8 groupB_mode; - UINT8 portA_dir; - UINT8 portB_dir; - UINT8 portCH_dir; - UINT8 portCL_dir; - - /* handshake signals (1=asserted; 0=non-asserted) */ - UINT8 obf_a; - UINT8 obf_b; - UINT8 ibf_a; - UINT8 ibf_b; - UINT8 inte_a; - UINT8 inte_b; - - UINT8 in_mask[3]; /* input mask */ - UINT8 out_mask[3]; /* output mask */ - UINT8 read[3]; /* data read from ports */ - UINT8 latch[3]; /* data written to ports */ - UINT8 output[3]; /* actual output data */ -} ppi8255; - -static ppi8255 chips[MAX_PPIS]; -static INT32 nNumChips = 0; - -static void ppi8255_get_handshake_signals(ppi8255 *chip, UINT8 *result) -{ - UINT8 handshake = 0x00; - UINT8 mask = 0x00; - - /* group A */ - if (chip->groupA_mode == 1) - { - if (chip->portA_dir) - { - handshake |= chip->ibf_a ? 0x20 : 0x00; - handshake |= (chip->ibf_a && chip->inte_a) ? 0x08 : 0x00; - mask |= 0x28; - } - else - { - handshake |= chip->obf_a ? 0x00 : 0x80; - handshake |= (chip->obf_a && chip->inte_a) ? 0x08 : 0x00; - mask |= 0x88; - } - } - else if (chip->groupA_mode == 2) - { - handshake |= chip->inte_a ? 0x08 : 0x00; - handshake |= chip->obf_a ? 0x00 : 0x80; - handshake |= chip->ibf_a ? 0x20 : 0x00; - mask |= 0xA8; - } - - /* group B */ - if (chip->groupB_mode == 1) - { - if (chip->portA_dir) - { - handshake |= chip->ibf_b ? 0x02 : 0x00; - handshake |= (chip->ibf_b && chip->inte_b) ? 0x01 : 0x00; - mask |= 0x03; - } - else - { - handshake |= chip->obf_b ? 0x00 : 0x02; - handshake |= (chip->obf_b && chip->inte_b) ? 0x01 : 0x00; - mask |= 0x03; - } - } - - *result &= ~mask; - *result |= handshake & mask; -} - -static void ppi8255_write_port(ppi8255 *chip, INT32 port, INT32 chipnum) -{ - UINT8 write_data; - - write_data = chip->latch[port] & chip->out_mask[port]; - write_data |= 0xFF & ~chip->out_mask[port]; - - /* write out special port 2 signals */ - if (port == 2) - ppi8255_get_handshake_signals(chip, &write_data); - - chip->output[port] = write_data; - - if (chipnum == 0 && port == 0) { - if (PPI0PortWriteA) PPI0PortWriteA(write_data); - } - - if (chipnum == 0 && port == 1) { - if (PPI0PortWriteB) PPI0PortWriteB(write_data); - } - - if (chipnum == 0 && port == 2) { - if (PPI0PortWriteC) PPI0PortWriteC(write_data); - } - - if (chipnum == 1 && port == 0) { - if (PPI1PortWriteA) PPI1PortWriteA(write_data); - } - - if (chipnum == 1 && port == 1) { - if (PPI1PortWriteB) PPI1PortWriteB(write_data); - } - - if (chipnum == 1 && port == 2) { - if (PPI1PortWriteC) PPI1PortWriteC(write_data); - } - - if (chipnum == 2 && port == 0) { - if (PPI2PortWriteA) PPI2PortWriteA(write_data); - } - - if (chipnum == 2 && port == 1) { - if (PPI2PortWriteB) PPI2PortWriteB(write_data); - } - - if (chipnum == 2 && port == 2) { - if (PPI2PortWriteC) PPI2PortWriteC(write_data); - } -} - -static void ppi8255_input(ppi8255 *chip, INT32 port, UINT8 data, INT32 which) -{ - INT32 changed = 0; - - chip->read[port] = data; - - /* port C is special */ - if (port == 2) - { - if (((chip->groupA_mode == 1) && (chip->portA_dir == 0)) || (chip->groupA_mode == 2)) - { - /* is !ACKA asserted? */ - if (chip->obf_a && !(data & 0x40)) - { - chip->obf_a = 0; - changed = 1; - } - } - - if ((chip->groupB_mode == 1) && (chip->portB_dir == 0)) - { - /* is !ACKB asserted? */ - if (chip->obf_b && !(data & 0x04)) - { - chip->obf_b = 0; - changed = 1; - } - } - - if (changed) - ppi8255_write_port(chip, 2, which); - } -} - -static UINT8 ppi8255_read_port(ppi8255 *chip, INT32 port, INT32 chipnum) -{ - UINT8 result = 0x00; - - if (chip->in_mask[port]) - { - if (chipnum == 0 && port == 0) { - ppi8255_input(chip, port, (PPI0PortReadA) ? PPI0PortReadA() : 0, chipnum); - } - - if (chipnum == 0 && port == 1) { - ppi8255_input(chip, port, (PPI0PortReadB) ? PPI0PortReadB() : 0, chipnum); - } - - if (chipnum == 0 && port == 2) { - ppi8255_input(chip, port, (PPI0PortReadC) ? PPI0PortReadC() : 0, chipnum); - } - - if (chipnum == 1 && port == 0) { - ppi8255_input(chip, port, (PPI1PortReadA) ? PPI1PortReadA() : 0, chipnum); - } - - if (chipnum == 1 && port == 1) { - ppi8255_input(chip, port, (PPI1PortReadB) ? PPI1PortReadB() : 0, chipnum); - } - - if (chipnum == 1 && port == 2) { - ppi8255_input(chip, port, (PPI1PortReadC) ? PPI1PortReadC() : 0, chipnum); - } - - if (chipnum == 2 && port == 0) { - ppi8255_input(chip, port, (PPI2PortReadA) ? PPI2PortReadA() : 0, chipnum); - } - - if (chipnum == 2 && port == 1) { - ppi8255_input(chip, port, (PPI2PortReadB) ? PPI2PortReadB() : 0, chipnum); - } - - if (chipnum == 2 && port == 2) { - ppi8255_input(chip, port, (PPI2PortReadC) ? PPI2PortReadC() : 0, chipnum); - } - - result |= chip->read[port] & chip->in_mask[port]; - } - result |= chip->latch[port] & chip->out_mask[port]; - - /* read special port 2 signals */ - if (port == 2) - ppi8255_get_handshake_signals(chip, &result); - - return result; -} - -UINT8 ppi8255_r(INT32 which, INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugDev_8255PPIInitted) bprintf(PRINT_ERROR, _T("ppi8255_r called without init\n")); - if (which > nNumChips) bprintf(PRINT_ERROR, _T("ppi8255_r called with invalid chip %x\n"), which); -#endif - - ppi8255 *chip = &chips[which]; - UINT8 result = 0; - - offset %= 4; - - switch(offset) - { - case 0: /* Port A read */ - case 1: /* Port B read */ - case 2: /* Port C read */ - result = ppi8255_read_port(chip, offset, which); - break; - - case 3: /* Control word */ - result = 0xFF; - break; - } - - return result; -} - -static void set_mode(INT32 which, INT32 data, INT32 call_handlers) -{ - ppi8255 *chip = &chips[which]; - INT32 i; - - /* parse out mode */ - chip->groupA_mode = (data >> 5) & 3; - chip->groupB_mode = (data >> 2) & 1; - chip->portA_dir = (data >> 4) & 1; - chip->portB_dir = (data >> 1) & 1; - chip->portCH_dir = (data >> 3) & 1; - chip->portCL_dir = (data >> 0) & 1; - - /* normalize groupA_mode */ - if (chip->groupA_mode == 3) - chip->groupA_mode = 2; - - /* Port A direction */ - if (chip->portA_dir) - chip->in_mask[0] = 0xFF, chip->out_mask[0] = 0x00; /* input */ - else - chip->in_mask[0] = 0x00, chip->out_mask[0] = 0xFF; /* output */ - - /* Port B direction */ - if (chip->portB_dir) - chip->in_mask[1] = 0xFF, chip->out_mask[1] = 0x00; /* input */ - else - chip->in_mask[1] = 0x00, chip->out_mask[1] = 0xFF; /* output */ - - /* Port C upper direction */ - if (chip->portCH_dir) - chip->in_mask[2] = 0xF0, chip->out_mask[2] = 0x00; /* input */ - else - chip->in_mask[2] = 0x00, chip->out_mask[2] = 0xF0; /* output */ - - /* Port C lower direction */ - if (chip->portCL_dir) - chip->in_mask[2] |= 0x0F; /* input */ - else - chip->out_mask[2] |= 0x0F; /* output */ - - /* now depending on the group modes, certain Port C lines may be replaced - * with varying control signals */ - switch(chip->groupA_mode) - { - case 0: /* Group A mode 0 */ - /* no changes */ - break; - - case 1: /* Group A mode 1 */ - /* bits 5-3 are reserved by Group A mode 1 */ - chip->in_mask[2] &= ~0x38; - chip->out_mask[2] &= ~0x38; - break; - - case 2: /* Group A mode 2 */ - /* bits 7-3 are reserved by Group A mode 2 */ - chip->in_mask[2] &= ~0xF8; - chip->out_mask[2] &= ~0xF8; - break; - } - - switch(chip->groupB_mode) - { - case 0: /* Group B mode 0 */ - /* no changes */ - break; - - case 1: /* Group B mode 1 */ - /* bits 2-0 are reserved by Group B mode 1 */ - chip->in_mask[2] &= ~0x07; - chip->out_mask[2] &= ~0x07; - break; - } - - /* KT: 25-Dec-99 - 8255 resets latches when mode set */ - chip->latch[0] = chip->latch[1] = chip->latch[2] = 0; - - if (call_handlers) - { - for (i = 0; i < 3; i++) - ppi8255_write_port(chip, i, which); - } -} - -void ppi8255_w(INT32 which, INT32 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_8255PPIInitted) bprintf(PRINT_ERROR, _T("ppi8255_w called without init\n")); - if (which > nNumChips) bprintf(PRINT_ERROR, _T("ppi8255_w called with invalid chip %x\n"), which); -#endif - - ppi8255 *chip = &chips[which]; - - offset %= 4; - - switch( offset ) - { - case 0: /* Port A write */ - case 1: /* Port B write */ - case 2: /* Port C write */ - chip->latch[offset] = data; - ppi8255_write_port(chip, offset, which); - - switch(offset) - { - case 0: - if (!chip->portA_dir && (chip->groupA_mode != 0)) - { - chip->obf_a = 1; - ppi8255_write_port(chip, 2, which); - } - break; - - case 1: - if (!chip->portB_dir && (chip->groupB_mode != 0)) - { - chip->obf_b = 1; - ppi8255_write_port(chip, 2, which); - } - break; - } - break; - - case 3: /* Control word */ - if (data & 0x80) - { - set_mode(which, data & 0x7f, 1); - } - else - { - /* bit set/reset */ - INT32 bit; - - bit = (data >> 1) & 0x07; - - if (data & 1) - chip->latch[2] |= (1<latch[2] &= ~(1< nNumChips) bprintf(PRINT_ERROR, _T("ppi8255_set_portC called with invalid chip %x\n"), which); -#endif - - ppi8255_input(&chips[which], 2, data, which); -} - -#undef MAX_PPIS diff --git a/jan/src/burn/devices/8255ppi.h b/jan/src/burn/devices/8255ppi.h deleted file mode 100644 index c88a76f6a..000000000 --- a/jan/src/burn/devices/8255ppi.h +++ /dev/null @@ -1,27 +0,0 @@ -typedef UINT8 (*PPIPortRead)(); -typedef void (*PPIPortWrite)(UINT8 data); -extern PPIPortRead PPI0PortReadA; -extern PPIPortRead PPI0PortReadB; -extern PPIPortRead PPI0PortReadC; -extern PPIPortWrite PPI0PortWriteA; -extern PPIPortWrite PPI0PortWriteB; -extern PPIPortWrite PPI0PortWriteC; -extern PPIPortRead PPI1PortReadA; -extern PPIPortRead PPI1PortReadB; -extern PPIPortRead PPI1PortReadC; -extern PPIPortWrite PPI1PortWriteA; -extern PPIPortWrite PPI1PortWriteB; -extern PPIPortWrite PPI1PortWriteC; -extern PPIPortRead PPI2PortReadA; -extern PPIPortRead PPI2PortReadB; -extern PPIPortRead PPI2PortReadC; -extern PPIPortWrite PPI2PortWriteA; -extern PPIPortWrite PPI2PortWriteB; -extern PPIPortWrite PPI2PortWriteC; - -void ppi8255_init(INT32 num); -void ppi8255_exit(); -void ppi8255_scan(); -UINT8 ppi8255_r(INT32 which, INT32 offset); -void ppi8255_w(INT32 which, INT32 offset, UINT8 data); -void ppi8255_set_portC( INT32 which, UINT8 data ); diff --git a/jan/src/burn/devices/8257dma.cpp b/jan/src/burn/devices/8257dma.cpp deleted file mode 100644 index f668eaf3d..000000000 --- a/jan/src/burn/devices/8257dma.cpp +++ /dev/null @@ -1,440 +0,0 @@ -/********************************************************************** - - 8257 DMA interface and emulation - - For datasheet http://www.threedee.com/jcm/library/index.html - - 2008/05 Miodrag Milanovic - - - added support for autoload mode - - fixed bug in calculating count - - 2007/11 couriersud - - - architecture copied from 8237 DMA - - significant changes to implementation - - The DMA works like this: - - 1. The device asserts the DRQn line - 2. The DMA clears the TC (terminal count) line - 3. The DMA asserts the CPU's HRQ (halt request) line - 4. Upon acknowledgement of the halt, the DMA will let the device - know that it needs to send information by asserting the DACKn - line - 5. The DMA will read the byte from the device - 6. The device clears the DRQn line - 7. The DMA clears the CPU's HRQ line - 8. (steps 3-7 are repeated for every byte in the chain) - - MAME sources by Curt Coder,Carl - -**********************************************************************/ - -#include "burnint.h" -#include "driver.h" -#include "8257dma.h" - -#define I8257_NUM_CHANNELS (4) - -#define I8257_STATUS_UPDATE 0x10 -#define I8257_STATUS_TC_CH3 0x08 -#define I8257_STATUS_TC_CH2 0x04 -#define I8257_STATUS_TC_CH1 0x02 -#define I8257_STATUS_TC_CH0 0x01 - -#define DMA_MODE_AUTOLOAD(mode) ((mode) & 0x80) -#define DMA_MODE_TCSTOP(mode) ((mode) & 0x40) -#define DMA_MODE_EXWRITE(mode) ((mode) & 0x20) -#define DMA_MODE_ROTPRIO(mode) ((mode) & 0x10) -#define DMA_MODE_CH_EN(mode, chan) ((mode) & (1 << (chan))) - -#define TIMER_OPERATION 0 -#define TIMER_MSBFLIP 1 -#define TIMER_DRQ_SYNC 2 - -static void (*m_out_hrq_func)(INT32 line); // halt -static void (*m_out_tc_func)(INT32 line); -static void (*m_out_mark_func)(INT32 line); - -static UINT8 (*m_in_memr_func)(UINT16 address); -static void (*m_out_memw_func)(UINT16 address, UINT8 data); -static ior_in_functs m_in_ior_func[I8257_NUM_CHANNELS]; -static ior_out_functs m_out_iow_func[I8257_NUM_CHANNELS]; -static INT32 (*m_idle_func)(INT32); - -static UINT16 m_registers[I8257_NUM_CHANNELS*2]; -static UINT16 m_address[I8257_NUM_CHANNELS]; -static UINT16 m_count[I8257_NUM_CHANNELS]; -static UINT8 m_rwmode[I8257_NUM_CHANNELS]; -static UINT8 m_mode; -static UINT8 m_rr; -static UINT8 m_msb; -static UINT8 m_drq; -static UINT8 m_status; /* bits 0- 3 : Terminal count for channels 0-3 */ - -void i8257_update_status(); - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -// fake functions to keep everything safe -static void null_line(INT32){} -static UINT8 null_in(UINT16){ return 0; } -static void null_out(UINT16,UINT8){} -static INT32 null_idle(INT32){return 0;} - -static INT32 trigger_transfer = 0; - -void i8257Init() -{ - DebugDev_8257DMAInitted = 1; - - // these aren't used atm. - m_out_hrq_func = null_line; - m_out_tc_func = null_line; - m_out_mark_func = null_line; - - m_in_memr_func = null_in; - m_out_memw_func = null_out; - - m_idle_func = null_idle; - - for (INT32 i = 0; i < I8257_NUM_CHANNELS; i++) { - m_in_ior_func[i] = null_in; - m_out_iow_func[i] = null_out; - } -} - -void i8257Exit() -{ -#if defined FBA_DEBUG - if (!DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("i8257Exit called without init\n")); -#endif - - DebugDev_8257DMAInitted = 0; -} - -void i8257Config(UINT8 (*cpuread)(UINT16), void (*cpuwrite)(UINT16,UINT8), INT32 (*idle)(INT32), ior_in_functs *read_f, ior_out_functs *write_f) -{ -#if defined FBA_DEBUG - if (!DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("i8257Config called without init\n")); -#endif - - m_in_memr_func = cpuread; - m_out_memw_func = cpuwrite; - - for (INT32 i = 0; i < I8257_NUM_CHANNELS; i++) { - if (read_f != NULL) m_in_ior_func[i] = (read_f[i] != NULL) ? read_f[i] : null_in; - if (write_f != NULL) m_out_iow_func[i] = (write_f[i] != NULL) ? write_f[i] : null_out; - } - - if (idle != NULL) m_idle_func = idle; -} - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void i8257Reset() -{ -#if defined FBA_DEBUG - if (!DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("i8257Reset called without init\n")); -#endif - - trigger_transfer = 0; - m_status &= 0xf0; - m_mode = 0; - i8257_update_status(); -} - -static INT32 i8257_do_operation(INT32 channel) -{ - INT32 done = 0; - UINT8 data; - - UINT8 mode = m_rwmode[channel]; - - if (m_count[channel] == 0x0000) - { - m_status |= (0x01 << channel); - - m_out_tc_func(ASSERT_LINE); - } - - switch (mode) - { - case 0: - m_address[channel]++; - m_count[channel]--; - done = (m_count[channel] == 0xFFFF); - break; - - case 1: - data = m_in_memr_func(m_address[channel]); - m_out_iow_func[channel](m_address[channel], data); - m_address[channel]++; - m_count[channel]--; - done = (m_count[channel] == 0xFFFF); - break; - - case 2: - data = m_in_ior_func[channel](m_address[channel]); - m_out_memw_func(m_address[channel], data); - m_address[channel]++; - m_count[channel]--; - done = (m_count[channel] == 0xFFFF); - break; - } - - if (done) - { - if ((channel==2) && DMA_MODE_AUTOLOAD(m_mode)) - { - /* in case of autoload at the end channel 3 info is */ - /* copied to channel 2 info */ - m_registers[4] = m_registers[6]; - m_registers[5] = m_registers[7]; - } - - m_out_tc_func(CLEAR_LINE); - } - - return done; -} - -static void i8257_timer(INT32 id, INT32 param) -{ - switch (id) - { - case TIMER_OPERATION: - { - INT32 i, channel = 0, rr; - INT32 done; - - rr = DMA_MODE_ROTPRIO(m_mode) ? m_rr : 0; - for (i = 0; i < I8257_NUM_CHANNELS; i++) - { - channel = (i + rr) % I8257_NUM_CHANNELS; - if ((m_status & (1 << channel)) == 0) - { - if (m_mode & m_drq & (1 << channel)) - { - break; - } - } - } - - done = i8257_do_operation(channel); - m_rr = (channel + 1) & 0x03; - - if (done) - { - m_drq &= ~(0x01 << channel); - trigger_transfer = 1; // i8257_update_status(); - if (!(DMA_MODE_AUTOLOAD(m_mode) && channel==2)) - { - if (DMA_MODE_TCSTOP(m_mode)) - { - m_mode &= ~(0x01 << channel); - } - } - } - break; - } - - case TIMER_MSBFLIP: - m_msb ^= 1; - break; - - case TIMER_DRQ_SYNC: - { - INT32 channel = param >> 1; - INT32 state = param & 0x01; - - /* normalize state */ - if (state) - { - m_drq |= 0x01 << channel; - m_address[channel] = m_registers[channel * 2]; - m_count[channel] = m_registers[channel * 2 + 1] & 0x3FFF; - m_rwmode[channel] = m_registers[channel * 2 + 1] >> 14; - /* clear channel TC */ - m_status &= ~(0x01 << channel); - } - else - m_drq &= ~(0x01 << channel); - - trigger_transfer = 1; // i8257_update_status(); - break; - } - } -} - -void i8257_update_status() -{ -#if defined FBA_DEBUG - if (!DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("i8257_update_status called without init\n")); -#endif - - UINT16 pending_transfer; - - /* no transfer is active right now; is there a transfer pending right now? */ - pending_transfer = m_drq & (m_mode & 0x0F); - - while (pending_transfer) - { - m_idle_func(4); - i8257_timer(TIMER_OPERATION, 0); - - pending_transfer = m_drq & (m_mode & 0x0F); - } - - /* set the halt line */ - m_out_hrq_func(pending_transfer ? ASSERT_LINE : CLEAR_LINE); -} - -static void i8257_prepare_msb_flip() -{ - i8257_timer(TIMER_MSBFLIP, 0); -} - -UINT8 i8257Read(UINT8 offset) -{ -#if defined FBA_DEBUG - if (!DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("i8257Read called without init\n")); -#endif - - UINT8 data = 0xFF; - - switch (offset & 0x0f) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - /* DMA address/count register */ - data = ( m_registers[offset & 7] >> (m_msb ? 8 : 0) ) & 0xFF; - i8257_prepare_msb_flip(); - break; - - case 8: - /* DMA status register */ - data = (UINT8) m_status; - /* read resets status ! */ - m_status &= 0xF0; - break; - - default: - data = 0xFF; - break; - } - - return data; -} - -void i8257Write(UINT8 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("i8257Write called without init\n")); -#endif - - switch (offset & 0x0f) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - /* DMA address/count register */ - if (m_msb) - { - m_registers[offset & 0x7] |= ((UINT16) data) << 8; - } - else - { - m_registers[offset & 0x7] = data; - } - - if (DMA_MODE_AUTOLOAD(m_mode)) - { - /* in case of autoload when inserting channel 2 info */ - /* it is automaticaly copied to channel 3 info */ - switch(offset) - { - case 4: - case 5: - if (m_msb) - { - m_registers[(offset & 0x7)+2] |= ((UINT16) data) << 8; - } - else - { - m_registers[(offset & 0x7)+2] = data; - } - } - } - - i8257_prepare_msb_flip(); - break; - - case 8: - /* DMA mode register */ - m_mode = data; - break; - } -} - -void i8257_drq_write(INT32 channel, INT32 state) -{ -#if defined FBA_DEBUG - if (!DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("i8257_drq_write called without init\n")); -#endif - - INT32 param = (channel << 1) | (state ? 1 : 0); - - i8257_timer(TIMER_DRQ_SYNC, param); -} - -void i8257_do_transfer(INT32) -{ -#if defined FBA_DEBUG - if (!DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("i8257_do_transfer called without init\n")); -#endif - - if (trigger_transfer) - i8257_update_status(); - trigger_transfer = 0; -} - -void i8257Scan() -{ -#if defined FBA_DEBUG - if (!DebugDev_8257DMAInitted) bprintf(PRINT_ERROR, _T("i8257Scan called without init\n")); -#endif - - for (INT32 i = 0; i < I8257_NUM_CHANNELS; i++) { - SCAN_VAR(m_registers[i * 2 + 0]); - SCAN_VAR(m_registers[i * 2 + 1]); - - SCAN_VAR(m_address[i]); - SCAN_VAR(m_count[i]); - SCAN_VAR(m_rwmode[i]); - } - - SCAN_VAR(m_mode); - SCAN_VAR(m_rr); - SCAN_VAR(m_msb); - SCAN_VAR(m_drq); - SCAN_VAR(m_status); - - SCAN_VAR(trigger_transfer); -} diff --git a/jan/src/burn/devices/8257dma.h b/jan/src/burn/devices/8257dma.h deleted file mode 100644 index 40819003d..000000000 --- a/jan/src/burn/devices/8257dma.h +++ /dev/null @@ -1,13 +0,0 @@ - -typedef UINT8 (*ior_in_functs)(UINT16 address); -typedef void (*ior_out_functs)(UINT16 address, UINT8 data); - -void i8257Reset(); -UINT8 i8257Read(UINT8 offset); -void i8257Write(UINT8 offset, UINT8 data); -void i8257_drq_write(INT32 channel, INT32 state); -void i8257_do_transfer(INT32 state); // call after last drq_write -void i8257Init(); -void i8257Exit(); -void i8257Config(UINT8 (*cpuread)(UINT16), void (*cpuwrite)(UINT16,UINT8), INT32 (*idle)(INT32), ior_in_functs *read_f, ior_out_functs *write_f); -void i8257Scan(); diff --git a/jan/src/burn/devices/c169.cpp b/jan/src/burn/devices/c169.cpp deleted file mode 100644 index c14c7b35c..000000000 --- a/jan/src/burn/devices/c169.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include "tiles_generic.h" - -static UINT32 size; -static INT32 color; -static INT32 priority; - -static INT32 left; -static INT32 top; -static INT32 incxx; -static INT32 incxy; -static INT32 incyx; -static INT32 incyy; - -static INT32 startx=0; -static INT32 starty=0; - -static INT32 clip_min_y; -static INT32 clip_max_y; -static INT32 clip_min_x; -static INT32 clip_max_x; - -static INT32 global_priority = 0; - -static UINT8 *roz_ram; -static UINT8 *roz_ctrl; -static UINT16 *roz_bitmap; - -void c169_roz_init(UINT8 *ram, UINT8 *control, UINT16 *bitmap) -{ - roz_ram = ram; - roz_ctrl = control; - roz_bitmap = bitmap; -} - -static void c169_roz_unpack_params(const UINT16 *source) -{ - const INT32 xoffset = 36, yoffset = 3; - - UINT16 temp = source[1]; - size = 512 << ((temp & 0x0300) >> 8); - color = (temp & 0x000f) * 256; - priority = (temp & 0x00f0) >> 4; - - temp = source[2]; - left = (temp & 0x7000) >> 3; - if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend - incxx = (INT16)temp; - - temp = source[3]; - top = (temp&0x7000)>>3; - if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend - incxy = (INT16)temp; - - temp = source[4]; - if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend - incyx = (INT16)temp; - - temp = source[5]; - if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend - incyy = (INT16)temp; - - startx = (INT16)source[6]; - starty = (INT16)source[7]; - startx <<= 4; - starty <<= 4; - - startx += xoffset * incxx + yoffset * incyx; - starty += xoffset * incxy + yoffset * incyy; - - startx <<= 8; - starty <<= 8; - incxx <<= 8; - incxy <<= 8; - incyx <<= 8; - incyy <<= 8; -} - -static void c169_roz_draw_helper() -{ - UINT32 size_mask = size - 1; - UINT16 *srcbitmap = roz_bitmap; - UINT32 hstartx = startx + clip_min_x * incxx + clip_min_y * incyx; - UINT32 hstarty = starty + clip_min_x * incxy + clip_min_y * incyy; - INT32 sx = clip_min_x; - INT32 sy = clip_min_y; - while (sy <= clip_max_y) - { - INT32 x = sx; - UINT32 cx = hstartx; - UINT32 cy = hstarty; - UINT16 *dest = pTransDraw + (sy * nScreenWidth) + sx; - UINT8 *prio = pPrioDraw + (sy * nScreenWidth) + sx; - while (x <= clip_max_x) - { - UINT32 xpos = (((cx >> 16) & size_mask) + left) & 0xfff; - UINT32 ypos = (((cy >> 16) & size_mask) + top) & 0xfff; - INT32 pxl = srcbitmap[(ypos * 0x1000) + xpos]; - if ((pxl & 0x8000) == 0) { - *dest = srcbitmap[(ypos * 0x1000) + xpos] + color; - *prio = global_priority; - } - cx += incxx; - cy += incxy; - x++; - dest++; - prio++; - } - hstartx += incyx; - hstarty += incyy; - sy++; - } -} - -static void c169_roz_draw_scanline(INT32 line, INT32 pri) -{ - if (line >= 0 && line <= clip_max_y) // namco's clipping is 1 less for max_* - { - INT32 row = line / 8; - INT32 offs = row * 0x100 + (line & 7) * 0x10 + 0xe080; - UINT16 *source = (UINT16*)(roz_ram + offs); - - if ((source[1] & 0x8000) == 0) - { - if (pri == priority) - { - c169_roz_unpack_params(source); - - INT32 oldmin = clip_min_y; - INT32 oldmax = clip_max_y; - - clip_min_y = line; - clip_max_y = line+1; - - c169_roz_draw_helper(); - - clip_min_y = oldmin; - clip_max_y = oldmax; - } - } - } -} - -void c169_roz_draw(INT32 pri, INT32 line) -{ - GenericTilesGetClip(&clip_min_x, &clip_max_x, &clip_min_y, &clip_max_y); - - if (line != -1) { - if (line >= clip_min_y && line <= clip_max_y) { - clip_min_y = line; - clip_max_y = line+1; - } else { - return; // nothing to draw due to clipping - } - } - - const UINT16 *source = (UINT16*)roz_ctrl; - - INT32 mode = source[0]; // 0x8000 or 0x1000 - - global_priority = pri; - - for (INT32 which = 1; which >= 0; which--) - { - UINT16 attrs = source[1 + (which*8)]; - if ((attrs & 0x8000) == 0) - { - if (which == 1 && mode == 0x8000) - { - for (INT32 scanline = clip_min_y; scanline <= clip_max_y; scanline++) - c169_roz_draw_scanline(scanline, pri); - } - else - { - c169_roz_unpack_params(source + (which*8)); - if (priority == pri) - c169_roz_draw_helper(); - } - } - } -} - diff --git a/jan/src/burn/devices/c169.h b/jan/src/burn/devices/c169.h deleted file mode 100644 index c154ca4b8..000000000 --- a/jan/src/burn/devices/c169.h +++ /dev/null @@ -1,2 +0,0 @@ -void c169_roz_init(UINT8 *ram, UINT8 *control, UINT16 *bitmap); -void c169_roz_draw(INT32 pri, INT32 line); diff --git a/jan/src/burn/devices/eeprom.cpp b/jan/src/burn/devices/eeprom.cpp deleted file mode 100644 index 091fb4dbe..000000000 --- a/jan/src/burn/devices/eeprom.cpp +++ /dev/null @@ -1,385 +0,0 @@ -// MAME sources by ???? - -#include "burnint.h" -#include "eeprom.h" - -#define SERIAL_BUFFER_LENGTH 40 -#define MEMORY_SIZE 1024 - -static const eeprom_interface *intf; - -static INT32 serial_count; -static UINT8 serial_buffer[SERIAL_BUFFER_LENGTH]; -static UINT8 eeprom_data[MEMORY_SIZE]; -static INT32 eeprom_data_bits; -static INT32 eeprom_read_address; -static INT32 eeprom_clock_count; -static INT32 latch, reset_line, clock_line, sending; -static INT32 locked; -static INT32 reset_delay; - -static INT32 neeprom_available = 0; - -static INT32 overrun_errmsg_ignore = 0; - -static INT32 eeprom_command_match(const char *buf, const char *cmd, INT32 len) -{ - if ( cmd == 0 ) return 0; - if ( len == 0 ) return 0; - - for (;len>0;) - { - char b = *buf; - char c = *cmd; - - if ((b==0) || (c==0)) - return (b==c); - - switch ( c ) - { - case '0': - case '1': - if (b != c) return 0; - case 'X': - case 'x': - buf++; - len--; - cmd++; - break; - - case '*': - c = cmd[1]; - switch( c ) - { - case '0': - case '1': - if (b == c) { cmd++; } - else { buf++; len--; } - break; - default: return 0; - } - } - } - return (*cmd==0); -} - -INT32 EEPROMAvailable() -{ -#if defined FBA_DEBUG - if (!DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("EEPROMAvailable called without init\n")); -#endif - - return neeprom_available; -} - -void EEPROMInit(const eeprom_interface *interface) -{ - DebugDev_EEPROMInitted = 1; - - intf = interface; - - if ((1 << intf->address_bits) * intf->data_bits / 8 > MEMORY_SIZE) - { - bprintf(0, _T("EEPROM larger than eeprom allows")); - } - - memset(eeprom_data,0xff,(1 << intf->address_bits) * intf->data_bits / 8); - serial_count = 0; - latch = 0; - reset_line = EEPROM_ASSERT_LINE; - clock_line = EEPROM_ASSERT_LINE; - eeprom_read_address = 0; - sending = 0; - if (intf->cmd_unlock) locked = 1; - else locked = 0; - - TCHAR output[MAX_PATH]; - _stprintf (output, _T("%s%s.nv"), szAppEEPROMPath, BurnDrvGetText(DRV_NAME)); - - neeprom_available = 0; - - INT32 len = ((1 << intf->address_bits) * (intf->data_bits >> 3)) & (MEMORY_SIZE-1); - - FILE *fz = _tfopen(output, _T("rb")); - if (fz != NULL) { - neeprom_available = 1; - fread (eeprom_data, len, 1, fz); - fclose (fz); - } -} - -void EEPROMExit() -{ -#if defined FBA_DEBUG - if (!DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("EEPROMExit called without init\n")); -#endif - - if (!DebugDev_EEPROMInitted) return; - - TCHAR output[MAX_PATH]; - _stprintf (output, _T("%s%s.nv"), szAppEEPROMPath, BurnDrvGetText(DRV_NAME)); - - neeprom_available = 0; - - INT32 len = ((1 << intf->address_bits) * (intf->data_bits >> 3)) & (MEMORY_SIZE-1); - - FILE *fz = _tfopen(output, _T("wb")); - if (fz) { - fwrite (eeprom_data, len, 1, fz); - fclose (fz); - } - - overrun_errmsg_ignore = 0; - - DebugDev_EEPROMInitted = 0; -} - -void EEPROMIgnoreErrMessage(INT32 onoff) -{ - overrun_errmsg_ignore = (onoff) ? 1 : 0; -} - -static void eeprom_write(INT32 bit) -{ - if (serial_count >= SERIAL_BUFFER_LENGTH-1) - { - if (!overrun_errmsg_ignore) { - bprintf(0, _T("error: EEPROM serial buffer overflow\n")); - } - return; - } - - serial_buffer[serial_count++] = (bit ? '1' : '0'); - serial_buffer[serial_count] = 0; - - if ( (serial_count > intf->address_bits) && - eeprom_command_match((char*)serial_buffer,intf->cmd_read,strlen((char*)serial_buffer)-intf->address_bits) ) - { - INT32 i,address; - - address = 0; - for (i = serial_count-intf->address_bits;i < serial_count;i++) - { - address <<= 1; - if (serial_buffer[i] == '1') address |= 1; - } - if (intf->data_bits == 16) - eeprom_data_bits = (eeprom_data[2*address+0] << 8) + eeprom_data[2*address+1]; - else - eeprom_data_bits = eeprom_data[address]; - eeprom_read_address = address; - eeprom_clock_count = 0; - sending = 1; - serial_count = 0; - } - else if ( (serial_count > intf->address_bits) && - eeprom_command_match((char*)serial_buffer,intf->cmd_erase,strlen((char*)serial_buffer)-intf->address_bits) ) - { - INT32 i,address; - - address = 0; - for (i = serial_count-intf->address_bits;i < serial_count;i++) - { - address <<= 1; - if (serial_buffer[i] == '1') address |= 1; - } - - if (locked == 0) - { - if (intf->data_bits == 16) - { - eeprom_data[2*address+0] = 0xff; - eeprom_data[2*address+1] = 0xff; - } - else - eeprom_data[address] = 0xff; - } - else - serial_count = 0; - } - else if ( (serial_count > (intf->address_bits + intf->data_bits)) && - eeprom_command_match((char*)serial_buffer,intf->cmd_write,strlen((char*)serial_buffer)-(intf->address_bits + intf->data_bits)) ) - { - INT32 i,address,data; - - address = 0; - for (i = serial_count-intf->data_bits-intf->address_bits;i < (serial_count-intf->data_bits);i++) - { - address <<= 1; - if (serial_buffer[i] == '1') address |= 1; - } - data = 0; - for (i = serial_count-intf->data_bits;i < serial_count;i++) - { - data <<= 1; - if (serial_buffer[i] == '1') data |= 1; - } - - if (locked == 0) - { - if (intf->data_bits == 16) - { - eeprom_data[2*address+0] = data >> 8; - eeprom_data[2*address+1] = data & 0xff; - } - else - eeprom_data[address] = data; - } - else - serial_count = 0; - } - else if ( eeprom_command_match((char*)serial_buffer,intf->cmd_lock,strlen((char*)serial_buffer)) ) - { - locked = 1; - serial_count = 0; - } - else if ( eeprom_command_match((char*)serial_buffer,intf->cmd_unlock,strlen((char*)serial_buffer)) ) - { - locked = 0; - serial_count = 0; - } -} - -void EEPROMReset() -{ -#if defined FBA_DEBUG - if (!DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("EEPROMReset called without init\n")); -#endif - - serial_count = 0; - sending = 0; - reset_delay = intf->reset_delay; -} - -void EEPROMWriteBit(INT32 bit) -{ -#if defined FBA_DEBUG - if (!DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("EEPROMWriteBit called without init\n")); -#endif - - latch = bit; -} - -INT32 EEPROMRead() -{ -#if defined FBA_DEBUG - if (!DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("EEPROMRead called without init\n")); -#endif - - INT32 res; - - if (sending) - res = (eeprom_data_bits >> intf->data_bits) & 1; - else - { - if (reset_delay > 0) - { - /* this is needed by wbeachvl */ - reset_delay--; - res = 0; - } - else - res = 1; - } - - return res; -} - -void EEPROMSetCSLine(INT32 state) -{ -#if defined FBA_DEBUG - if (!DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("EEPROMSetCSLine called without init\n")); -#endif - - reset_line = state; - - if (reset_line != EEPROM_CLEAR_LINE) - EEPROMReset(); -} - -void EEPROMSetClockLine(INT32 state) -{ -#if defined FBA_DEBUG - if (!DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("EEPROMSetClockLine called without init\n")); -#endif - - if (state == EEPROM_PULSE_LINE || (clock_line == EEPROM_CLEAR_LINE && state != EEPROM_CLEAR_LINE)) - { - if (reset_line == EEPROM_CLEAR_LINE) - { - if (sending) - { - if (eeprom_clock_count == intf->data_bits && intf->enable_multi_read) - { - eeprom_read_address = (eeprom_read_address + 1) & ((1 << intf->address_bits) - 1); - if (intf->data_bits == 16) - eeprom_data_bits = (eeprom_data[2*eeprom_read_address+0] << 8) + eeprom_data[2*eeprom_read_address+1]; - else - eeprom_data_bits = eeprom_data[eeprom_read_address]; - eeprom_clock_count = 0; - } - eeprom_data_bits = (eeprom_data_bits << 1) | 1; - eeprom_clock_count++; - } - else - eeprom_write(latch); - } - } - - clock_line = state; -} - -void EEPROMFill(const UINT8 *data, INT32 offset, INT32 length) -{ -#if defined FBA_DEBUG - if (!DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("EEPROMFill called without init\n")); -#endif - - memcpy(eeprom_data + offset, data, length); -} - -void EEPROMScan(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugDev_EEPROMInitted) bprintf(PRINT_ERROR, _T("EEPROMScan called without init\n")); -#endif - - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - - if (pnMin && *pnMin < 0x020902) { - *pnMin = 0x029705; - } - - memset(&ba, 0, sizeof(ba)); - ba.Data = serial_buffer; - ba.nLen = SERIAL_BUFFER_LENGTH; - ba.szName = "Serial Buffer"; - BurnAcb(&ba); - - SCAN_VAR(serial_count); - SCAN_VAR(eeprom_data_bits); - SCAN_VAR(eeprom_read_address); - SCAN_VAR(eeprom_clock_count); - SCAN_VAR(latch); - SCAN_VAR(reset_line); - SCAN_VAR(clock_line); - SCAN_VAR(sending); - SCAN_VAR(locked); - SCAN_VAR(reset_delay); - } - -// if (nAction & ACB_NVRAM) { -// -// if (pnMin && (nAction & ACB_TYPEMASK) == ACB_NVRAM) { -// *pnMin = 0x02705; -// } -// -// memset(&ba, 0, sizeof(ba)); -// ba.Data = eeprom_data; -// ba.nLen = MEMORY_SIZE; -// ba.szName = "EEPROM memory"; -// BurnAcb(&ba); -// } -} diff --git a/jan/src/burn/devices/eeprom.h b/jan/src/burn/devices/eeprom.h deleted file mode 100644 index 998e00f46..000000000 --- a/jan/src/burn/devices/eeprom.h +++ /dev/null @@ -1,59 +0,0 @@ - -typedef struct _eeprom_interface eeprom_interface; -struct _eeprom_interface -{ - INT32 address_bits; /* EEPROM has 2^address_bits cells */ - INT32 data_bits; /* every cell has this many bits (8 or 16) */ - const char *cmd_read; /* read command string, e.g. "0110" */ - const char *cmd_write; /* write command string, e.g. "0111" */ - const char *cmd_erase; /* erase command string, or 0 if n/a */ - const char *cmd_lock; /* lock command string, or 0 if n/a */ - const char *cmd_unlock; /* unlock command string, or 0 if n/a */ - INT32 enable_multi_read; /* set to 1 to enable multiple values to be read from one read command */ - INT32 reset_delay; /* number of times eeprom_read_bit() should return 0 after a reset, */ - /* before starting to return 1. */ -}; - -// default for most in fba -const eeprom_interface eeprom_interface_93C46 = -{ - 6, // address bits 6 - 16, // data bits 16 - "*110", // read 1 10 aaaaaa - "*101", // write 1 01 aaaaaa dddddddddddddddd - "*111", // erase 1 11 aaaaaa - "*10000xxxx", // lock 1 00 00xxxx - "*10011xxxx", // unlock 1 00 11xxxx - 1, - 0 -}; - -#define EEPROM_CLEAR_LINE 0 -#define EEPROM_ASSERT_LINE 1 -#define EEPROM_PULSE_LINE 2 - -void EEPROMInit(const eeprom_interface *interface); -void EEPROMReset(); -void EEPROMExit(); - -INT32 EEPROMAvailable(); // are we loading an eeprom file? - -INT32 EEPROMRead(); - -// Write each individually -void EEPROMWriteBit(INT32 bit); -void EEPROMSetCSLine(INT32 state); -void EEPROMSetClockLine(INT32 state); - -// Or all at once -#define EEPROMWrite(clock, cs, bit) \ - EEPROMWriteBit(bit); \ - EEPROMSetCSLine(cs ? EEPROM_CLEAR_LINE : EEPROM_ASSERT_LINE); \ - EEPROMSetClockLine(clock ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE) - -void EEPROMFill(const UINT8 *data, INT32 offset, INT32 length); - -void EEPROMScan(INT32 nAction, INT32* pnMin); - -// Some buggy games throw a lot of garbage at the EEPROM (Taito F3) -void EEPROMIgnoreErrMessage(INT32 onoff); diff --git a/jan/src/burn/devices/gaelco_crypt.cpp b/jan/src/burn/devices/gaelco_crypt.cpp deleted file mode 100644 index 12e34205c..000000000 --- a/jan/src/burn/devices/gaelco_crypt.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Based on sources by Manuel Abadia - -#include "burnint.h" -#include "m68000_intf.h" -#include "bitswap.h" - -static INT32 decrypt(INT32 const param1, INT32 const param2, INT32 const enc_prev_word, INT32 const dec_prev_word, INT32 const enc_word) -{ - INT32 const swap = (BIT(dec_prev_word, 8) << 1) | BIT(dec_prev_word, 7); - INT32 const type = (BIT(dec_prev_word,12) << 1) | BIT(dec_prev_word, 2); - INT32 res=0; - INT32 k=0; - - switch (swap) - { - case 0: res = BITSWAP16(enc_word, 1, 2, 0,14,12,15, 4, 8,13, 7, 3, 6,11, 5,10, 9); break; - case 1: res = BITSWAP16(enc_word, 14,10, 4,15, 1, 6,12,11, 8, 0, 9,13, 7, 3, 5, 2); break; - case 2: res = BITSWAP16(enc_word, 2,13,15, 1,12, 8,14, 4, 6, 0, 9, 5,10, 7, 3,11); break; - case 3: res = BITSWAP16(enc_word, 3, 8, 1,13,14, 4,15, 0,10, 2, 7,12, 6,11, 9, 5); break; - } - - res ^= param2; - - switch (type) - { - case 0: - k = 0x003a; - break; - - case 1: - k = (BIT(dec_prev_word, 0) << 0) | - (BIT(dec_prev_word, 1) << 1) | - (BIT(dec_prev_word, 1) << 2) | - (BIT(enc_prev_word, 3) << 3) | - (BIT(enc_prev_word, 8) << 4) | - (BIT(enc_prev_word,15) << 5); - break; - - case 2: - k = (BIT(enc_prev_word, 5) << 0) | - (BIT(dec_prev_word, 5) << 1) | - (BIT(enc_prev_word, 7) << 2) | - (BIT(enc_prev_word, 3) << 3) | - (BIT(enc_prev_word,13) << 4) | - (BIT(enc_prev_word,14) << 5); - break; - - case 3: - k = (BIT(enc_prev_word, 0) << 0) | - (BIT(enc_prev_word, 9) << 1) | - (BIT(enc_prev_word, 6) << 2) | - (BIT(dec_prev_word, 4) << 3) | - (BIT(enc_prev_word, 2) << 4) | - (BIT(dec_prev_word,11) << 5); - break; - } - - k ^= param1; - - res = ((res & 0xffc0) | ((res + k) & 0x003f)) ^ param1; - - switch (type) - { - case 0: - k = (BIT(enc_word, 9) << 0) | - (BIT(res,2) << 1) | - (BIT(enc_word, 5) << 2) | - (BIT(res,5) << 3) | - (BIT(res,4) << 4); - break; - - case 1: - k = (BIT(dec_prev_word, 2) << 0) | - (BIT(enc_prev_word, 4) << 1) | - (BIT(dec_prev_word,14) << 2) | - (BIT(res, 1) << 3) | - (BIT(dec_prev_word,12) << 4); - break; - - case 2: - k = (BIT(enc_prev_word, 6) << 0) | - (BIT(dec_prev_word, 6) << 1) | - (BIT(dec_prev_word,15) << 2) | - (BIT(res,0) << 3) | - (BIT(dec_prev_word, 7) << 4); - break; - - case 3: - k = (BIT(dec_prev_word, 2) << 0) | - (BIT(dec_prev_word, 9) << 1) | - (BIT(enc_prev_word, 5) << 2) | - (BIT(dec_prev_word, 1) << 3) | - (BIT(enc_prev_word,10) << 4); - - break; - } - - k ^= param1; - - res = ((res & 0x003f) | ((res + (k << 6)) & 0x07c0) | ((res + (k << 11)) & 0xf800)) ^ ((param1 << 6) | (param1 << 11)); - - return BITSWAP16(res, 2,6,0,11,14,12,7,10,5,4,8,3,9,1,13,15); -} - -UINT16 __fastcall gaelco_decrypt(INT32 offset, INT32 data, INT32 param1, INT32 param2) -{ - static INT32 lastpc, lastoffset, lastencword, lastdecword; - - INT32 thispc = SekGetPC(-1); - - if (lastpc == thispc && offset == lastoffset + 1) - { - lastpc = 0; - data = decrypt(param1, param2, lastencword, lastdecword, data); - } - else - { - lastpc = thispc; - lastoffset = offset; - lastencword = data; - - data = decrypt(param1, param2, 0, 0, data); - - lastdecword = data; - } - - return BURN_ENDIAN_SWAP_INT16(data); -} diff --git a/jan/src/burn/devices/gaelco_crypt.h b/jan/src/burn/devices/gaelco_crypt.h deleted file mode 100644 index fee1afda0..000000000 --- a/jan/src/burn/devices/gaelco_crypt.h +++ /dev/null @@ -1 +0,0 @@ -UINT16 __fastcall gaelco_decrypt(INT32 offset, INT32 data, INT32 param1, INT32 param2); diff --git a/jan/src/burn/devices/joyprocess.cpp b/jan/src/burn/devices/joyprocess.cpp deleted file mode 100644 index 98c7de8ea..000000000 --- a/jan/src/burn/devices/joyprocess.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "burnint.h" -#include "joyprocess.h" - -#define INPUT_4WAY 2 -#define INPUT_CLEAROPPOSITES 4 -#define INPUT_MAKEACTIVELOW 8 - -void ProcessJoystick(UINT8 *input, INT8 playernum, INT8 up_bit, INT8 down_bit, INT8 left_bit, INT8 right_bit, UINT8 flags) -{ - // Fixed Apr. 26, 2016: Limitation: this only works on the first 4 bits - active high to start with - // Note: only works on the first 4 or last 4 bits for udlr - active high to start with - // grep ProcessJoystick in drv/pre90s for examples - - static INT32 fourway[4] = { 0, 0, 0, 0 }; // 4-way buffer - static UINT8 DrvInputPrev[4] = { 0, 0, 0, 0 }; // 4-way buffer - - UINT8 mask1 = (up_bit > 3) ? 0xf0 : 0xf; - UINT8 mask2 = (up_bit > 3) ? 0xf : 0xf0; - - UINT8 ud = (1 << up_bit) | (1 << down_bit); - UINT8 rl = (1 << right_bit) | (1 << left_bit); - - if (flags & INPUT_4WAY) { - playernum &= 3; // just incase. - if(*input != DrvInputPrev[playernum]) { - fourway[playernum] = *input & mask1; //0xf; - - if((fourway[playernum] & rl) && (fourway[playernum] & ud)) - fourway[playernum] ^= (fourway[playernum] & (DrvInputPrev[playernum] & 0xf)); - - if((fourway[playernum] & rl) && (fourway[playernum] & ud)) // if it starts out diagonally, pick a direction - fourway[playernum] &= (rand()&1) ? rl : ud; - } - - DrvInputPrev[playernum] = *input; - - *input = fourway[playernum] | (DrvInputPrev[playernum] & mask2);//0xf0); // preserve the unprocessed/other bits - } - - if (flags & INPUT_CLEAROPPOSITES) { - if ((*input & rl) == rl) { - *input &= ~rl; - } - if ((*input & ud) == ud) { - *input &= ~ud; - } - } - - if (flags & INPUT_MAKEACTIVELOW) { - *input = 0xff - *input; - } -} - -void CompileInput(UINT8 **input, void *output, INT32 num, INT32 bits, UINT32 *init) -{ - for (INT32 j = 0; j < num; j++) { - if (bits > 16) ((UINT32*)output)[j] = init[j]; - if (bits > 8 && bits < 17) ((UINT16*)output)[j] = init[j]; - if (bits < 9) ((UINT8*)output)[j] = init[j]; - - for (INT32 i = 0; i < bits; i++) { - if (bits > 16) ((UINT32*)output)[j] ^= (input[j][i] & 1) << i; - if (bits > 8 && bits < 17) ((UINT16*)output)[j] ^= (input[j][i] & 1) << i; - if (bits < 9) ((UINT8*)output)[j] ^= (input[j][i] & 1) << i; - } - } -} diff --git a/jan/src/burn/devices/joyprocess.h b/jan/src/burn/devices/joyprocess.h deleted file mode 100644 index cd0df60b5..000000000 --- a/jan/src/burn/devices/joyprocess.h +++ /dev/null @@ -1,7 +0,0 @@ -#define INPUT_4WAY 2 -#define INPUT_CLEAROPPOSITES 4 -#define INPUT_MAKEACTIVELOW 8 - -void ProcessJoystick(UINT8 *input, INT8 playernum, INT8 up_bit, INT8 down_bit, INT8 left_bit, INT8 right_bit, UINT8 flags); -void CompileInput(UINT8 **input, void *output, INT32 num, INT32 bits, UINT32 *init); - diff --git a/jan/src/burn/devices/kaneko_tmap.cpp b/jan/src/burn/devices/kaneko_tmap.cpp deleted file mode 100644 index 24b80ce91..000000000 --- a/jan/src/burn/devices/kaneko_tmap.cpp +++ /dev/null @@ -1,180 +0,0 @@ -// Based on MAME sources by Luca Elia, David Haywood - -#include "tiles_generic.h" -#include "kaneko_tmap.h" - -static INT32 kaneko_view2_xoff[MAX_VIEW2_CHIPS] = { 0, 0 }; -static INT32 kaneko_view2_yoff[MAX_VIEW2_CHIPS] = { 0, 0 }; -static UINT8 *kaneko_view2_vram[MAX_VIEW2_CHIPS] = { NULL, NULL }; -static UINT8 *kaneko_view2_regs[MAX_VIEW2_CHIPS] = { NULL, NULL }; -static UINT8 *kaneko_view2_gfx[MAX_VIEW2_CHIPS] = { NULL, NULL }; -static UINT8 *kaneko_view2_gfx_trans[MAX_VIEW2_CHIPS] = { NULL, NULL }; -static INT32 kaneko_color_offset[MAX_VIEW2_CHIPS] = { 0, 0 }; - -void kaneko_view2_init(INT32 chip, UINT8 *video_ram, UINT8 *reg_ram, UINT8 *gfx_rom, INT32 color_offset, UINT8 *gfx_trans, INT32 global_x, INT32 global_y) -{ - kaneko_view2_vram[chip] = video_ram; - kaneko_view2_regs[chip] = reg_ram; - kaneko_view2_gfx[chip] = gfx_rom; - kaneko_color_offset[chip] = color_offset; - kaneko_view2_gfx_trans[chip] = gfx_trans; - - kaneko_view2_xoff[chip] = global_x; - kaneko_view2_yoff[chip] = global_y; -} - -void kaneko_view2_exit() -{ - for (INT32 i = 0; i < MAX_VIEW2_CHIPS; i++) { - kaneko_view2_vram[i] = NULL; - kaneko_view2_regs[i] = NULL; - kaneko_view2_gfx[i] = NULL; - kaneko_color_offset[i] = 0; - kaneko_view2_gfx_trans[i] = NULL; - - kaneko_view2_xoff[i] = 0; - kaneko_view2_yoff[i] = 0; - } -} - -void kaneko_view2_draw_layer(INT32 chip, INT32 layer, INT32 priority) -{ - UINT16 *vram = (UINT16*)(kaneko_view2_vram[chip] + (layer ? 0x0000 : 0x1000)); - UINT16 *sram = (UINT16*)(kaneko_view2_vram[chip] + (layer ? 0x2000 : 0x3000)); - UINT16 *regs = (UINT16*)kaneko_view2_regs[chip]; - - INT32 tmflip = BURN_ENDIAN_SWAP_INT16(regs[4]); - - INT32 enable = ~tmflip & (layer ? 0x0010 : 0x1000); - if (enable == 0) return; // disable! - - INT32 tmflipx = tmflip & 0x0200; // flip whole tilemap x - INT32 tmflipy = tmflip & 0x0100; // flip whole tilemap y - - INT32 lsenable = tmflip & (layer ? 0x0008 : 0x0800); // linescroll - - INT32 xscroll = BURN_ENDIAN_SWAP_INT16(regs[2 - (layer * 2)]); - INT32 yscroll = BURN_ENDIAN_SWAP_INT16(regs[3 - (layer * 2)]) >> 6; - - xscroll += (tmflipx) ? -((344 + (layer * 2)) * 64) : ((kaneko_view2_xoff[chip] + (layer * 2)) * 64); - yscroll += ((tmflipy) ? -260 : 11) + kaneko_view2_yoff[chip]; - yscroll &= 0x1ff; - - if (lsenable) - { - UINT16 *dest = pTransDraw; - - for (INT32 y = 0; y < nScreenHeight; y++, dest += nScreenWidth) // line by line - { - INT32 scrollyy = (yscroll + y) & 0x1ff; - INT32 scrollxx = ((xscroll + BURN_ENDIAN_SWAP_INT16(sram[y])) >> 6) & 0x1ff; - - INT32 srcy = (scrollyy & 0x1ff) >> 4; - INT32 srcx = (scrollxx & 0x1ff) >> 4; - - for (INT32 x = 0; x < nScreenWidth + 16; x+=16) - { - INT32 offs = ((srcy << 5) | ((srcx + (x >> 4)) & 0x1f)); - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 1]) & 0x1fff; - INT32 color = ((attr & 0x00fc) << 2) + kaneko_color_offset[chip]; - INT32 flipx = (attr & 0x0002) ? 0x0f : 0; - INT32 flipy = (attr & 0x0001) ? 0xf0 : 0; - INT32 group = (attr & 0x0700) >> 8; - - if (kaneko_view2_gfx_trans[chip]) { - if (kaneko_view2_gfx_trans[chip][code]) continue; - } - - if (group != priority) continue; - - UINT8 *gfxsrc = kaneko_view2_gfx[chip] + (code << 8) + (((scrollyy & 0x0f) << 4) ^ flipy); - - for (INT32 dx = 0; dx < 16; dx++) - { - INT32 dst = (x + dx) - (scrollxx & 0x0f); - if (dst < 0 || dst >= nScreenWidth) continue; - - if (gfxsrc[dx^flipx]) { - dest[dst] = color + gfxsrc[dx^flipx]; - } - } - } - } - } - else - { - INT32 scrollx = (xscroll >> 6) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 16; - INT32 sy = (offs / 0x20) * 16; - - sy -= yscroll; - if (sy < -15) sy += 512; - sx -= scrollx; - if (sx < -15) sx += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 1]) & 0x1fff; - INT32 color = ((attr & 0x00fc) >> 2) + (0x400 >> 4); - INT32 flipx = (attr & 0x0002); - INT32 flipy = (attr & 0x0001); - INT32 group = (attr & 0x0700) >> 8; - - if (kaneko_view2_gfx_trans[chip]) { - if (kaneko_view2_gfx_trans[chip][code]) continue; - } - - if (tmflipy) { - flipy ^= 1; - sy = 224 - sy; // fix later - } - - if (tmflipx) { - flipx ^= 2; - sx = 304 - sx; // fix later! - } - - if (group != priority) continue; - - if (sx >= 0 && sy >=0 && sx <= (nScreenWidth - 16) && sy <= (nScreenHeight-16)) // non-clipped - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, 0, kaneko_view2_gfx[chip]); - } else { - Render16x16Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 4, 0, 0, kaneko_view2_gfx[chip]); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 4, 0, 0, kaneko_view2_gfx[chip]); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, 0, kaneko_view2_gfx[chip]); - } - } - } - else // clipped - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, kaneko_view2_gfx[chip]); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, kaneko_view2_gfx[chip]); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, kaneko_view2_gfx[chip]); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, kaneko_view2_gfx[chip]); - } - } - } - } - } -} - diff --git a/jan/src/burn/devices/kaneko_tmap.h b/jan/src/burn/devices/kaneko_tmap.h deleted file mode 100644 index 3facae7ca..000000000 --- a/jan/src/burn/devices/kaneko_tmap.h +++ /dev/null @@ -1,5 +0,0 @@ -#define MAX_VIEW2_CHIPS 2 - -void kaneko_view2_init(INT32 chip, UINT8 *video_ram, UINT8 *reg_ram, UINT8 *gfx_rom, INT32 color_offset, UINT8 *gfx_trans, INT32 global_x, INT32 global_y); -void kaneko_view2_exit(); -void kaneko_view2_draw_layer(INT32 chip, INT32 layer, INT32 priority); diff --git a/jan/src/burn/devices/mb87078.cpp b/jan/src/burn/devices/mb87078.cpp deleted file mode 100644 index e5604047d..000000000 --- a/jan/src/burn/devices/mb87078.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// Based on MAME sources by Fabio Priuli,Philip Bennett - -#include "burnint.h" -#include "mb87078.h" - -static INT32 m_gain[4]; /* gain index 0-63,64,65 */ -static INT32 m_channel_latch; /* current channel */ -static UINT8 m_latch[2][4]; /* 6bit+3bit 4 data latches */ -static UINT8 m_reset_comp; -static void (*m_gain_changed_cb)(INT32, INT32) = NULL; - -static void reset_comp_w( int level ); - -static const float mb87078_gain_decibel[66] = { - 0.0, -0.5, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, - -4.0, -4.5, -5.0, -5.5, -6.0, -6.5, -7.0, -7.5, - -8.0, -8.5, -9.0, -9.5,-10.0,-10.5,-11.0,-11.5, - -12.0,-12.5,-13.0,-13.5,-14.0,-14.5,-15.0,-15.5, - -16.0,-16.5,-17.0,-17.5,-18.0,-18.5,-19.0,-19.5, - -20.0,-20.5,-21.0,-21.5,-22.0,-22.5,-23.0,-23.5, - -24.0,-24.5,-25.0,-25.5,-26.0,-26.5,-27.0,-27.5, - -28.0,-28.5,-29.0,-29.5,-30.0,-30.5,-31.0,-31.5, - -32.0, -256.0 - }; - -static const int mb87078_gain_percent[66] = { - 100,94,89,84,79,74,70,66, - 63,59,56,53,50,47,44,42, - 39,37,35,33,31,29,28,26, - 25,23,22,21,19,18,17,16, - 15,14,14,13,12,11,11,10, - 10, 9, 8, 8, 7, 7, 7, 6, - 6, 5, 5, 5, 5, 4, 4, 4, - 3, 3, 3, 3, 3, 2, 2, 2, - 2, 0 -}; - -void mb87078_init(void (*callback)(INT32, INT32)) -{ - m_gain_changed_cb = callback; - mb87078_reset(); -} - -void mb87078_exit() -{ - // nothing to do here -} - -void mb87078_scan() -{ - SCAN_VAR(m_channel_latch); - SCAN_VAR(m_reset_comp); - SCAN_VAR(m_gain); - SCAN_VAR(m_latch); -} - -void mb87078_reset() -{ - m_channel_latch = 0; - m_reset_comp = 0; - m_gain[0] = m_gain[1] = m_gain[2] = m_gain[3] = 0; - memset(m_latch, 0, sizeof(m_latch)); - - /* reset chip */ - reset_comp_w(0); - reset_comp_w(1); -} - -/***************************************************************************** - IMPLEMENTATION -*****************************************************************************/ - -#define GAIN_MAX_INDEX 64 -#define GAIN_INFINITY_INDEX 65 - - -static INT32 calc_gain_index( INT32 data0, INT32 data1 ) -{ -//data 0: GD0-GD5 -//data 1: 1 2 4 8 16 -// c1 c2 EN C0 C32 - - if (!(data1 & 0x04)) - { - return GAIN_INFINITY_INDEX; - } - else - { - if (data1 & 0x10) - { - return GAIN_MAX_INDEX; - } - else - { - if (data1 & 0x08) - { - return 0; - } - else - { - return (data0 ^ 0x3f); - } - } - } -} - - -static void gain_recalc() -{ - for (INT32 i = 0; i < 4; i++) - { - INT32 old_index = m_gain[i]; - m_gain[i] = calc_gain_index(m_latch[0][i], m_latch[1][i]); - if (old_index != m_gain[i]) - m_gain_changed_cb(i, mb87078_gain_percent[m_gain[i]]); - } -} - - -void mb87078_write(INT32 dsel, INT32 data) -{ - if (m_reset_comp == 0) - return; - - if (dsel == 0) /* gd0 - gd5 */ - { - m_latch[0][m_channel_latch] = data & 0x3f; - } - else /* dcs1, dsc2, en, c0, c32, X */ - { - m_channel_latch = data & 3; - m_latch[1][m_channel_latch] = data & 0x1f; //always zero bit 5 - } - gain_recalc(); -} - - -float mb87078_gain_decibel_r( INT32 channel ) -{ - return mb87078_gain_decibel[m_gain[channel]]; -} - - -INT32 mb87078_gain_percent_r( INT32 channel ) -{ - return mb87078_gain_percent[m_gain[channel]]; -} - -static void reset_comp_w( INT32 level ) -{ - m_reset_comp = level; - - /*this seems to be true, according to the datasheets*/ - if (level == 0) - { - m_latch[0][0] = 0x3f; - m_latch[0][1] = 0x3f; - m_latch[0][2] = 0x3f; - m_latch[0][3] = 0x3f; - - m_latch[1][0] = 0x0 | 0x4; - m_latch[1][1] = 0x1 | 0x4; - m_latch[1][2] = 0x2 | 0x4; - m_latch[1][3] = 0x3 | 0x4; - } - - gain_recalc(); -} diff --git a/jan/src/burn/devices/mb87078.h b/jan/src/burn/devices/mb87078.h deleted file mode 100644 index 8639479c4..000000000 --- a/jan/src/burn/devices/mb87078.h +++ /dev/null @@ -1,8 +0,0 @@ -void mb87078_init(void (*callback)(INT32, INT32)); -void mb87078_exit(); -void mb87078_scan(); -void mb87078_reset(); -void mb87078_write(INT32 dsel, INT32 data); -float mb87078_gain_decibel_r(INT32 channel); -INT32 mb87078_gain_percent_r(INT32 channel); - diff --git a/jan/src/burn/devices/mermaid.cpp b/jan/src/burn/devices/mermaid.cpp deleted file mode 100644 index 5e13e24ec..000000000 --- a/jan/src/burn/devices/mermaid.cpp +++ /dev/null @@ -1,167 +0,0 @@ -// Based on Mermaid / Beast MCU code by Angelo Salese, Tomasz Slanina, David Haywood - -#include "burnint.h" -#include "z80_intf.h" -#include "mcs51.h" - -static UINT8 *mermaid_inputs; -static UINT8 mermaid_p[4] = { 0, 0, 0, 0 }; -static UINT8 data_to_mermaid; -static UINT8 data_to_z80; -static INT32 z80_to_mermaid_full; -static INT32 mermaid_to_z80_full; -static INT32 mermaid_int0; -static INT32 mermaid_initted = 0; -INT32 mermaid_sub_z80_reset; - -void mermaidWrite(UINT8 data) -{ - data_to_mermaid = data; - z80_to_mermaid_full = 1; - mermaid_int0 = 0; - mcs51_set_irq_line(MCS51_INT0_LINE, CPU_IRQSTATUS_ACK); -} - -UINT8 mermaidRead() -{ - mermaid_to_z80_full = 0; - return data_to_z80; -} - -UINT8 mermaidStatus() -{ - return (!mermaid_to_z80_full << 2) | (z80_to_mermaid_full << 3); -} - -static void mermaid_write_port(INT32 port, UINT8 data) -{ - switch (port) - { - case MCS51_PORT_P0: - { - if ((mermaid_p[0] & 2) == 0 && (data & 2)) { - mermaid_to_z80_full = 1; - data_to_z80 = mermaid_p[1]; - } - if (data & 1) z80_to_mermaid_full = 0; - - mermaid_p[0] = data; - } - return; - - case MCS51_PORT_P1: - { - if (data == 0xff) { - mermaid_int0 = 1; - mcs51_set_irq_line(MCS51_INT0_LINE, CPU_IRQSTATUS_NONE); - } - - mermaid_p[1] = data; - } - return; - - case MCS51_PORT_P2: - return; - - case MCS51_PORT_P3: - { - if ((data & 2) == 0) { - ZetOpen(1); - ZetReset(); - ZetClose(); - mermaid_sub_z80_reset = 1; - } else { - mermaid_sub_z80_reset = 0; - } - } - return; - } -} - -static UINT8 mermaid_read_port(INT32 port) -{ -#define BIT(x,y) (((x)>>(y))&1) - - switch (port) - { - case MCS51_PORT_P0: - return 0; - - case MCS51_PORT_P1: - if (mermaid_p[0] & 1) return 0; - return data_to_mermaid; - - case MCS51_PORT_P2: - return mermaid_inputs[(mermaid_p[0] >> 2) & 3]; - - case MCS51_PORT_P3: - { - UINT8 dsw = 0; - UINT8 dsw1 = mermaid_inputs[4]; - UINT8 dsw2 = mermaid_inputs[5]; - - switch ((mermaid_p[0] >> 5) & 3) - { - case 0: dsw = (BIT(dsw2, 4) << 3) | (BIT(dsw2, 0) << 2) | (BIT(dsw1, 4) << 1) | BIT(dsw1, 0); break; - case 1: dsw = (BIT(dsw2, 5) << 3) | (BIT(dsw2, 1) << 2) | (BIT(dsw1, 5) << 1) | BIT(dsw1, 1); break; - case 2: dsw = (BIT(dsw2, 6) << 3) | (BIT(dsw2, 2) << 2) | (BIT(dsw1, 6) << 1) | BIT(dsw1, 2); break; - case 3: dsw = (BIT(dsw2, 7) << 3) | (BIT(dsw2, 3) << 2) | (BIT(dsw1, 7) << 1) | BIT(dsw1, 3); break; - } - - return (dsw << 4) | (mermaid_int0 << 2) | (mermaid_to_z80_full << 3); - } - } - - return 0; -#undef BIT -} - -void mermaidReset() -{ - mcs51_reset(); - - memset (mermaid_p, 0, 4); - mermaid_sub_z80_reset = 0; - data_to_mermaid = 0; - data_to_z80 = 0; - z80_to_mermaid_full = 0; - mermaid_to_z80_full = 0; - mermaid_int0 = 0; -} - -void mermaidInit(UINT8 *rom, UINT8 *inputs) -{ - mcs51_program_data=rom; - mermaid_inputs = inputs; - mcs51_init (); - mcs51_set_write_handler(mermaid_write_port); - mcs51_set_read_handler(mermaid_read_port); - mermaid_initted = 1; -} - -void mermaidExit() -{ - if (!mermaid_initted) return; - mermaid_initted = 0; - mcs51_exit(); -} - -INT32 mermaidRun(INT32 cycles) -{ - mcs51Run(cycles / 12); - - return cycles; -} - -INT32 mermaidScan(INT32 nAction) -{ - SCAN_VAR(mermaid_sub_z80_reset); - SCAN_VAR(data_to_mermaid); - SCAN_VAR(data_to_z80); - SCAN_VAR(z80_to_mermaid_full); - SCAN_VAR(mermaid_to_z80_full); - SCAN_VAR(mermaid_int0); - mcs51_scan(nAction); - - return 0; -} diff --git a/jan/src/burn/devices/mermaid.h b/jan/src/burn/devices/mermaid.h deleted file mode 100644 index 9f24b5cf0..000000000 --- a/jan/src/burn/devices/mermaid.h +++ /dev/null @@ -1,13 +0,0 @@ -#include "mcs51.h" - -void mermaidWrite(UINT8 data); -UINT8 mermaidRead(); -UINT8 mermaidStatus(); - -extern INT32 mermaid_sub_z80_reset; -void mermaidReset(); -void mermaidInit(UINT8 *rom, UINT8 *inputs); -void mermaidExit(); -INT32 mermaidRun(INT32 cycles); -INT32 mermaidScan(INT32 nAction); - diff --git a/jan/src/burn/devices/namco_c45.cpp b/jan/src/burn/devices/namco_c45.cpp deleted file mode 100644 index 87f63cf90..000000000 --- a/jan/src/burn/devices/namco_c45.cpp +++ /dev/null @@ -1,224 +0,0 @@ -#include "tiles_generic.h" -#include "m68000_intf.h" - -UINT8 *c45RoadRAM = NULL; // external - -static UINT8 *c45RoadTiles = NULL; -static UINT16 *c45RoadBitmap = NULL; -static UINT8 *c45RoadClut = NULL; -static UINT8 c45_temp_clut[0x100]; - -void c45RoadReset() -{ - if (c45RoadRAM != NULL) memset (c45RoadRAM, 0, 0x20000); - if (c45RoadTiles != NULL) memset (c45RoadTiles, 0, 0x40000); -} - -void c45RoadInit(UINT32 , UINT8 *clut) -{ - c45RoadRAM = (UINT8*)BurnMalloc(0x20000); - c45RoadTiles = (UINT8*)BurnMalloc(0x40000); - - c45RoadClut = clut; - c45RoadBitmap = (UINT16*)BurnMalloc(0x400 * sizeof(UINT16)); - - if (c45RoadClut == NULL) { - c45RoadClut = c45_temp_clut; - for (INT32 i = 0; i < 0x100; i++) c45RoadClut[i] = i; - } -} - -void c45RoadExit() -{ - if (c45RoadRAM != NULL) BurnFree(c45RoadRAM); - if (c45RoadTiles != NULL) BurnFree(c45RoadTiles); - if (c45RoadBitmap != NULL) BurnFree(c45RoadBitmap); - - c45RoadRAM = NULL; - c45RoadTiles = NULL; - c45RoadBitmap = NULL; - - c45RoadClut = NULL; -} - -static inline void update_tile_pixel(INT32 offset) -{ - UINT16 s = *((UINT16*)(c45RoadRAM + (offset * 2))); - - UINT8 *pxl = c45RoadTiles + ((offset * 8) & 0x3fff8); - - for (INT32 x = 7; x >= 0; x--) { - pxl[7-x] = (((s >> (x + 8)) & 1) << 1) | ((s >> x) & 1); - } -} - -static void __fastcall c45_road_write_word(UINT32 address, UINT16 data) -{ - UINT16 *ram = (UINT16*)c45RoadRAM; - - INT32 offset = (address & 0x1ffff) / 2; - - if (offset < (0x1fa00 / 2)) // tiles - { - if (data != ram[offset]) { - ram[offset] = data; - update_tile_pixel(offset); - } - } - else // scroll regs - { - ram[offset] = data; - } -} - -static void __fastcall c45_road_write_byte(UINT32 address, UINT8 data) -{ - UINT16 *ram = (UINT16*)c45RoadRAM; - - INT32 offset = (address & 0x1ffff) ^ 1; - - if (offset < 0x1fa00) // tiles - { - if (data != ram[offset]) { - c45RoadRAM[offset] = data; - update_tile_pixel(offset/2); - } - } - else // scroll regs - { - c45RoadRAM[offset] = data; - } -} - -void c45RoadMap68k(UINT32 address) -{ - SekMapHandler(7, address, address | 0x1ffff, MAP_WRITE); - SekSetWriteWordHandler(7, c45_road_write_word); - SekSetWriteByteHandler(7, c45_road_write_byte); - - SekMapMemory(c45RoadRAM, address, address | 0x0ffff, MAP_WRITE); -} - -static void predraw_c45_road_tiles_line(UINT32 line, UINT32 startx, UINT32 pixels_wide, UINT32 incx) -{ - UINT16 *ram = (UINT16*)c45RoadRAM; - - INT32 startx_shift = startx >> 20; - INT32 endx_shift = (((pixels_wide * incx) >> 20) + 1) + startx_shift; - - INT32 offs = ((line / 16) * 64) + startx_shift; - - INT32 code_offset = (line & 0xf) * 16; - - for (INT32 sx = startx_shift; sx < endx_shift; sx++, offs++) - { - INT32 color = ((ram[offs] >> 10) << 2); - UINT8 *gfx = c45RoadTiles + ((ram[offs] & 0x3ff) * 256 + code_offset); - UINT8 *clut = c45RoadClut + color; - - for (INT32 x = 0; x < 16; x++) - { - c45RoadBitmap[((sx * 16) + x) & 0x3ff] = clut[gfx[x]] + 0xf00; - } - } -} - -void c45RoadDraw() -{ - INT32 min_x, min_y, max_x, max_y; - - GenericTilesGetClip(&min_x, &max_x, &min_y, &max_y); - - UINT16 *m_lineram = (UINT16*)(c45RoadRAM + 0x1fa00); - - UINT32 yscroll = m_lineram[0x3fe/2]; - - static INT32 ROAD_COLS = 64; - static INT32 ROAD_ROWS = 512; - static INT32 ROAD_TILE_SIZE = 16; - static INT32 ROAD_TILEMAP_WIDTH = ROAD_TILE_SIZE * ROAD_COLS; - static INT32 ROAD_TILEMAP_HEIGHT = ROAD_TILE_SIZE * ROAD_ROWS; - - // loop over scanlines - for (INT32 y = min_y; y < max_y; y++) - { - // skip if we are not the right priority - INT32 screenx = m_lineram[y + 15]; - - INT32 pri = (screenx & 0xf000) >> 12; - - // skip if we don't have a valid zoom factor - UINT32 zoomx = m_lineram[0x400/2 + y + 15] & 0x3ff; - if (zoomx == 0) - continue; - - // skip if we don't have a valid source increment - UINT32 sourcey = m_lineram[0x200/2 + y + 15] + yscroll; - const UINT16 *source_gfx = c45RoadBitmap; - UINT32 dsourcex = (ROAD_TILEMAP_WIDTH << 16) / zoomx; - if (dsourcex == 0) - continue; - - // mask off priority bits and sign-extend - screenx &= 0x0fff; - if (screenx & 0x0800) - screenx |= ~0x7ff; - - // adjust the horizontal placement - screenx -= 64; // needs adjustment to left - - INT32 numpixels = (44 * ROAD_TILE_SIZE << 16) / dsourcex; - UINT32 sourcex = 0; - - // crop left - INT32 clip_pixels = min_x - screenx; - if (clip_pixels > 0) - { - numpixels -= clip_pixels; - sourcex += dsourcex*clip_pixels; - screenx = min_x; - } - - // crop right - clip_pixels = (screenx + numpixels) - (max_x+1); - if (clip_pixels > 0) - numpixels -= clip_pixels; - - UINT16 *dest = pTransDraw + y * nScreenWidth; - UINT8 *pdest = pPrioDraw + y * nScreenWidth; - - predraw_c45_road_tiles_line(sourcey & (ROAD_TILEMAP_HEIGHT - 1), sourcex, numpixels, dsourcex); - - while (numpixels-- > 0) - { - if (pdest[screenx] <= pri) { - dest[screenx] = source_gfx[sourcex >> 16]; - pdest[screenx] = pri; - } - screenx++; - sourcex += dsourcex; - } - } -} - -// call from save state -void c45RoadState(INT32 nAction) -{ - if (c45RoadRAM == NULL) return; - - struct BurnArea ba; - memset(&ba, 0, sizeof(ba)); - ba.Data = c45RoadRAM; - ba.nLen = 0x20000; - ba.szName = "C45 Road RAM"; - BurnAcb(&ba); - - if (nAction & ACB_WRITE) - { - INT32 Planes[2] = { 0, 8 }; - INT32 XOffs[16] = { STEP8(0, 1), STEP8(16, 1) }; - INT32 YOffs[16] = { STEP16(0, 32) }; - - GfxDecode(0x0400, 2, 16, 16, Planes, XOffs, YOffs, 0x200, c45RoadRAM + 0x10000, c45RoadTiles); - } -} diff --git a/jan/src/burn/devices/namco_c45.h b/jan/src/burn/devices/namco_c45.h deleted file mode 100644 index 5cf17e335..000000000 --- a/jan/src/burn/devices/namco_c45.h +++ /dev/null @@ -1,9 +0,0 @@ -extern UINT8 *c45RoadRAM; // external - -void c45RoadReset(); -void c45RoadInit(UINT32 trans_color, UINT8 *clut); -void c45RoadExit(); -void c45RoadDraw(); -void c45RoadState(INT32 nAction); - -void c45RoadMap68k(UINT32 address); diff --git a/jan/src/burn/devices/namcoio.cpp b/jan/src/burn/devices/namcoio.cpp deleted file mode 100644 index 49dea5a17..000000000 --- a/jan/src/burn/devices/namcoio.cpp +++ /dev/null @@ -1,479 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/*************************************************************************** - -The following Namco custom chips are all instances of the same 4-bit MCU, -the Fujitsu MB8843 (42-pin DIP package) and MB8842/MB8844 (28-pin DIP), -differently programmed. - -chip MCU pins function ----- ------ ---- -------- -56XX 42 I/O (coin management built-in) -58XX 42 I/O (coin management built-in) -62XX 28 I/O and explosion (noise) generator - -16XX interface: ---------------- -Super Pac Man 56XX 56XX ---- ---- -Pac & Pal 56XX 59XX ---- ---- -Mappy 58XX 58XX ---- ---- -Phozon 58XX 56XX ---- ---- -The Tower of Druaga 58XX 56XX ---- ---- -Grobda 58XX 56XX ---- ---- -Dig Dug II 58XX 56XX ---- ---- -Motos 56XX 56XX ---- ---- -Gaplus 56XX 58XX 62XX ---- -Gaplus (alt.) 58XX 56XX 62XX ---- -Libble Rabble 58XX 56XX 56XX ---- -Toy Pop 58XX 56XX 56XX ---- - - -Pinouts: - - MB8843 MB8842/MB8844 - +------+ +------+ - EXTAL|1 42|Vcc EXTAL|1 28|Vcc - XTAL|2 41|K3 XTAL|2 27|K3 - /RESET|3 40|K2 /RESET|3 26|K2 - /IRQ|4 39|K1 O0|4 25|K1 - SO|5 38|K0 O1|5 24|K0 - SI|6 37|R15 O2|6 23|R10 /IRQ -/SC /TO|7 36|R14 O3|7 22|R9 /TC - /TC|8 35|R13 O4|8 21|R8 - P0|9 34|R12 O5|9 20|R7 - P1|10 33|R11 O6|10 19|R6 - P2|11 32|R10 O7|11 18|R5 - P3|12 31|R9 R0|12 17|R4 - O0|13 30|R8 R1|13 16|R3 - O1|14 29|R7 GND|14 15|R2 - O2|15 28|R6 +------+ - O3|16 27|R5 - O4|17 26|R4 - O5|18 25|R3 - O6|19 24|R2 - O7|20 23|R1 - GND|21 22|R0 - +------+ - - - O O R R R K -62XX O O IO O I - - P O O R R R R K -56XX O O O I I I IO I -58XX O O O I I I IO I -59XX O O O I I I IO I - - -Namco custom I/O chips 56XX, 58XX, 59XX - -These chips work together with a 16XX, that interfaces them with the buffer -RAM. Each chip uses 16 nibbles of memory; the 16XX supports up to 4 chips, -but most games use only 2. - -The 56XX, 58XX and 59XX are pin-to-pin compatible, but not functionally equivalent: -they provide the same functions, but the command codes and memory addresses -are different, so they cannot be exchanged. - -The devices have 42 pins. There are 16 input lines and 8 output lines to be -used for I/O. - - -pin description ---- ----------- -1 clock (Mappy, Super Pac-Man) -2 clock (Gaplus; equivalent to the above?) -3 reset -4 irq -5-6 (to/from 16XX) (this is probably a normal I/O port used to synchronize with the 16XX) -7-8 ? -9-12 address to r/w from RAM; 12 also goes to the 16XX and acts as r/w line, so - the chip can only read from addresses 0-7 and only write to addresses 8-F - (this is probably a normal I/O port used for that purpose) -13-16 out port A -17-20 out port B -21 GND -22-25 in port B -26-29 in port C -30-33 in port D -34-37 (to 16XX) probably data to r/w from RAM - (this is probably a normal I/O port used for that purpose) -38-41 in port A -42 Vcc - -TODO: -- It's likely that the 56XX and 58XX chips, when in "coin mode", also internally - handle outputs for start lamps, coin counters and coin lockout, like the 51XX. - Such lines are NOT present in the Mappy and Super Pacman schematics, so they - were probably not used for those games, but they might have been used in - others (most likely Gaplus). - -***************************************************************************/ - -#include "burnint.h" -#include "namcoio.h" -#include "driver.h" - -struct ChipData -{ - UINT8 (*in_0_cb)(UINT8); - UINT8 (*in_1_cb)(UINT8); - UINT8 (*in_2_cb)(UINT8); - UINT8 (*in_3_cb)(UINT8); - void (*out_0_cb)(UINT8, UINT8); - void (*out_1_cb)(UINT8, UINT8); - void (*run_func)(INT32); - INT32 type; - - UINT8 ram[16]; - INT32 reset; - INT32 lastcoins; - INT32 lastbuttons; - INT32 credits; - INT32 coins[2]; - INT32 coins_per_cred[2]; - INT32 creds_per_coin[2]; - INT32 in_count; -}; - -static struct ChipData Chips[5]; - -static UINT8 fakeIn(UINT8) { return 0; } -static void fakeOut(UINT8,UINT8) { } - -void namcoio_init(INT32 chip, INT32 type, UINT8 (*in0)(UINT8), UINT8 (*in1)(UINT8), UINT8 (*in2)(UINT8), UINT8 (*in3)(UINT8), void (*out0)(UINT8, UINT8), void (*out1)(UINT8, UINT8)) -{ - ChipData *ptr = &Chips[chip]; - - ptr->type = type; - - ptr->in_0_cb = (in0 == NULL) ? fakeIn : in0; - ptr->in_1_cb = (in1 == NULL) ? fakeIn : in1; - ptr->in_2_cb = (in2 == NULL) ? fakeIn : in2; - ptr->in_3_cb = (in3 == NULL) ? fakeIn : in3; - ptr->out_0_cb = (out0 == NULL) ? fakeOut : out0; - ptr->out_1_cb = (out1 == NULL) ? fakeOut : out1; - - switch (type) - { - case NAMCO56xx: ptr->run_func = namco56xx_customio_run; break; - case NAMCO58xx: ptr->run_func = namco58xx_customio_run; break; - case NAMCO59xx: ptr->run_func = namco59xx_customio_run; break; - } -} - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void namcoio_set_reset_line(INT32 chip, INT32 state) -{ - ChipData *ptr = &Chips[chip]; - - ptr->reset = (state == ASSERT_LINE) ? 1 : 0; - if (state != CLEAR_LINE) - { - /* reset internal registers */ - ptr->credits = 0; - ptr->coins[0] = 0; - ptr->coins_per_cred[0] = 1; - ptr->creds_per_coin[0] = 1; - ptr->coins[1] = 0; - ptr->coins_per_cred[1] = 1; - ptr->creds_per_coin[1] = 1; - ptr->in_count = 0; - } -} - -void namcoio_reset(INT32 chip) -{ - namcoio_set_reset_line(chip, ASSERT_LINE); - namcoio_set_reset_line(chip, CLEAR_LINE); -} - -/***************************************************************************** - DEVICE HANDLERS -*****************************************************************************/ - -#define IORAM_READ(offset) (ptr->ram[offset] & 0x0f) -#define IORAM_WRITE(offset,data) {ptr->ram[offset] = (data) & 0x0f;} - -static void handle_coins( INT32 chip, int swap ) -{ - int val, toggled; - int credit_add = 0; - int credit_sub = 0; - int button; - - ChipData *ptr = &Chips[chip]; - - val = ~ptr->in_0_cb(0 & 0x0f); // pins 38-41 - toggled = val ^ ptr->lastcoins; - ptr->lastcoins = val; - - /* check coin insertion */ - if (val & toggled & 0x01) - { - ptr->coins[0]++; - if (ptr->coins[0] >= (ptr->coins_per_cred[0] & 7)) - { - credit_add = ptr->creds_per_coin[0] - (ptr->coins_per_cred[0] >> 3); - ptr->coins[0] -= ptr->coins_per_cred[0] & 7; - } - else if (ptr->coins_per_cred[0] & 8) - credit_add = 1; - } - if (val & toggled & 0x02) - { - ptr->coins[1]++; - if (ptr->coins[1] >= (ptr->coins_per_cred[1] & 7)) - { - credit_add = ptr->creds_per_coin[1] - (ptr->coins_per_cred[1] >> 3); - ptr->coins[1] -= ptr->coins_per_cred[1] & 7; - } - else if (ptr->coins_per_cred[1] & 8) - credit_add = 1; - } - if (val & toggled & 0x08) - { - credit_add = 1; - } - - val = ~ptr->in_3_cb(0 & 0x0f); // pins 30-33 - toggled = val ^ ptr->lastbuttons; - ptr->lastbuttons = val; - - /* check start buttons, only if the game allows */ - if (IORAM_READ(9) == 0) - // the other argument is IORAM_READ(10) = 1, meaning unknown - { - if (val & toggled & 0x04) - { - if (ptr->credits >= 1) credit_sub = 1; - } - else if (val & toggled & 0x08) - { - if (ptr->credits >= 2) credit_sub = 2; - } - } - - ptr->credits += credit_add - credit_sub; - - IORAM_WRITE(0 ^ swap, ptr->credits / 10); // BCD credits - IORAM_WRITE(1 ^ swap, ptr->credits % 10); // BCD credits - IORAM_WRITE(2 ^ swap, credit_add); // credit increment (coin inputs) - IORAM_WRITE(3 ^ swap, credit_sub); // credit decrement (start buttons) - IORAM_WRITE(4, ~ptr->in_1_cb(0 & 0x0f)); // pins 22-25 - button = ((val & 0x05) << 1) | (val & toggled & 0x05); - IORAM_WRITE(5, button); // pins 30 & 32 normal and impulse - IORAM_WRITE(6, ~ptr->in_2_cb(0 & 0x0f)); // pins 26-29 - button = (val & 0x0a) | ((val & toggled & 0x0a) >> 1); - IORAM_WRITE(7, button); // pins 31 & 33 normal and impulse -} - - -void namco56xx_customio_run(INT32 chip) -{ - ChipData *ptr = &Chips[chip]; - - switch (IORAM_READ(8)) - { - case 1: // read switch inputs - IORAM_WRITE(0, ~ptr->in_0_cb(0 & 0x0f)); // pins 38-41 - IORAM_WRITE(1, ~ptr->in_1_cb(0 & 0x0f)); // pins 22-25 - IORAM_WRITE(2, ~ptr->in_2_cb(0 & 0x0f)); // pins 26-29 - IORAM_WRITE(3, ~ptr->in_3_cb(0 & 0x0f)); // pins 30-33 - ptr->out_0_cb((UINT8)0, IORAM_READ(9)); // output to pins 13-16 (motos, pacnpal, gaplus) - ptr->out_1_cb((UINT8)0, IORAM_READ(10)); // output to pins 17-20 (gaplus) - break; - - case 2: // initialize coinage settings - ptr->coins_per_cred[0] = IORAM_READ(9); - ptr->creds_per_coin[0] = IORAM_READ(10); - ptr->coins_per_cred[1] = IORAM_READ(11); - ptr->creds_per_coin[1] = IORAM_READ(12); - break; - - case 4: - handle_coins(chip,0); - break; - - case 7: // bootup check (liblrabl only) - { - IORAM_WRITE(2, 0xe); - IORAM_WRITE(7, 0x6); - } - break; - - case 8: // bootup check - { - int i, sum; - - sum = 0; - for (i = 9; i < 16; i++) - sum += IORAM_READ(i); - IORAM_WRITE(0, sum >> 4); - IORAM_WRITE(1, sum & 0xf); - } - break; - - case 9: // read dip switches and inputs - ptr->out_0_cb((UINT8)0, 0 & 0x0f); // set pin 13 = 0 - IORAM_WRITE(0, ~ptr->in_0_cb(0 & 0x0f)); // pins 38-41, pin 13 = 0 - IORAM_WRITE(2, ~ptr->in_1_cb(0 & 0x0f)); // pins 22-25, pin 13 = 0 - IORAM_WRITE(4, ~ptr->in_2_cb(0 & 0x0f)); // pins 26-29, pin 13 = 0 - IORAM_WRITE(6, ~ptr->in_3_cb(0 & 0x0f)); // pins 30-33, pin 13 = 0 - ptr->out_0_cb((UINT8)0, 1 & 0x0f); // set pin 13 = 1 - IORAM_WRITE(1, ~ptr->in_0_cb(0 & 0x0f)); // pins 38-41, pin 13 = 1 - IORAM_WRITE(3, ~ptr->in_1_cb(0 & 0x0f)); // pins 22-25, pin 13 = 1 - IORAM_WRITE(5, ~ptr->in_2_cb(0 & 0x0f)); // pins 26-29, pin 13 = 1 - IORAM_WRITE(7, ~ptr->in_3_cb(0 & 0x0f)); // pins 30-33, pin 13 = 1 - break; - } -} - -void namco59xx_customio_run(INT32 chip) -{ - ChipData *ptr = &Chips[chip]; - - switch (IORAM_READ(8)) - { - case 3: // pacnpal chip #1: read dip switches and inputs - IORAM_WRITE(4, ~ptr->in_0_cb(0 & 0x0f)); // pins 38-41, pin 13 = 0 ? - IORAM_WRITE(5, ~ptr->in_2_cb(0 & 0x0f)); // pins 26-29 ? - IORAM_WRITE(6, ~ptr->in_1_cb(0 & 0x0f)); // pins 22-25 ? - IORAM_WRITE(7, ~ptr->in_3_cb(0 & 0x0f)); // pins 30-33 - break; - } -} - -void namco58xx_customio_run(INT32 chip) -{ - ChipData *ptr = &Chips[chip]; - - switch (IORAM_READ(8)) - { - case 1: // read switch inputs - IORAM_WRITE(4, ~ptr->in_0_cb(0 & 0x0f)); // pins 38-41 - IORAM_WRITE(5, ~ptr->in_1_cb(0 & 0x0f)); // pins 22-25 - IORAM_WRITE(6, ~ptr->in_2_cb(0 & 0x0f)); // pins 26-29 - IORAM_WRITE(7, ~ptr->in_3_cb(0 & 0x0f)); // pins 30-33 - ptr->out_0_cb((UINT8)0, IORAM_READ(9)); // output to pins 13-16 (toypop) - ptr->out_1_cb((UINT8)0, IORAM_READ(10)); // output to pins 17-20 (toypop) - break; - - case 2: // initialize coinage settings - ptr->coins_per_cred[0] = IORAM_READ(9); - ptr->creds_per_coin[0] = IORAM_READ(10); - ptr->coins_per_cred[1] = IORAM_READ(11); - ptr->creds_per_coin[1] = IORAM_READ(12); - break; - - case 3: // process coin and start inputs, read switch inputs - handle_coins(chip,2); - break; - - case 4: // read dip switches and inputs - ptr->out_0_cb((UINT8)0, 0 & 0x0f); // set pin 13 = 0 - IORAM_WRITE(0, ~ptr->in_0_cb(0 & 0x0f)); // pins 38-41, pin 13 = 0 - IORAM_WRITE(2, ~ptr->in_1_cb(0 & 0x0f)); // pins 22-25, pin 13 = 0 - IORAM_WRITE(4, ~ptr->in_2_cb(0 & 0x0f)); // pins 26-29, pin 13 = 0 - IORAM_WRITE(6, ~ptr->in_3_cb(0 & 0x0f)); // pins 30-33, pin 13 = 0 - ptr->out_0_cb((UINT8)0, 1 & 0x0f); // set pin 13 = 1 - IORAM_WRITE(1, ~ptr->in_0_cb(0 & 0x0f)); // pins 38-41, pin 13 = 1 - IORAM_WRITE(3, ~ptr->in_1_cb(0 & 0x0f)); // pins 22-25, pin 13 = 1 - IORAM_WRITE(5, ~ptr->in_2_cb(0 & 0x0f)); // pins 26-29, pin 13 = 1 - IORAM_WRITE(7, ~ptr->in_3_cb(0 & 0x0f)); // pins 30-33, pin 13 = 1 - break; - - case 5: // bootup check - { - int i, n, rng, seed; - #define NEXT(n) ((((n) & 1) ? (n) ^ 0x90 : (n)) >> 1) - - /* initialize the LFSR depending on the first two arguments */ - n = (IORAM_READ(9) * 16 + IORAM_READ(10)) & 0x7f; - seed = 0x22; - for (i = 0; i < n; i++) - seed = NEXT(seed); - - /* calculate the answer */ - for (i = 1; i < 8; i++) - { - n = 0; - rng = seed; - if (rng & 1) { n ^= ~IORAM_READ(11); } - rng = NEXT(rng); - seed = rng; // save state for next loop - if (rng & 1) { n ^= ~IORAM_READ(10); } - rng = NEXT(rng); - if (rng & 1) { n ^= ~IORAM_READ(9); } - rng = NEXT(rng); - if (rng & 1) { n ^= ~IORAM_READ(15); } - rng = NEXT(rng); - if (rng & 1) { n ^= ~IORAM_READ(14); } - rng = NEXT(rng); - if (rng & 1) { n ^= ~IORAM_READ(13); } - rng = NEXT(rng); - if (rng & 1) { n ^= ~IORAM_READ(12); } - - IORAM_WRITE(i, ~n); - } - IORAM_WRITE(0, 0x0); - /* kludge for gaplus */ - if (IORAM_READ(9) == 0xf) IORAM_WRITE(0, 0xf); - } - break; - } -} - -void namcoio_run(INT32 chip) -{ - ChipData *ptr = &Chips[chip]; - - ptr->run_func(chip); -} - -UINT8 namcoio_read(INT32 chip, UINT8 offset) -{ - ChipData *ptr = &Chips[chip]; - - // RAM is 4-bit wide; Pac & Pal requires the | 0xf0 otherwise Easter egg doesn't work - offset &= 0x3f; - - return 0xf0 | ptr->ram[offset]; -} - -void namcoio_write(INT32 chip, UINT8 offset, UINT8 data) -{ - ChipData *ptr = &Chips[chip]; - - offset &= 0x3f; - data &= 0x0f; // RAM is 4-bit wide - - ptr->ram[offset] = data; -} - -UINT8 namcoio_read_reset_line(INT32 chip) -{ - ChipData *ptr = &Chips[chip]; - - return ptr->reset; -} - -INT32 namcoio_scan(INT32 chip) -{ - ChipData *ptr = &Chips[chip]; - - SCAN_VAR(ptr->ram); - SCAN_VAR(ptr->reset); - SCAN_VAR(ptr->lastcoins); - SCAN_VAR(ptr->lastbuttons); - SCAN_VAR(ptr->coins); - SCAN_VAR(ptr->credits); - SCAN_VAR(ptr->coins_per_cred); - SCAN_VAR(ptr->creds_per_coin); - SCAN_VAR(ptr->in_count); - - return 0; -} diff --git a/jan/src/burn/devices/namcoio.h b/jan/src/burn/devices/namcoio.h deleted file mode 100644 index 16f01caee..000000000 --- a/jan/src/burn/devices/namcoio.h +++ /dev/null @@ -1,19 +0,0 @@ - -#define NAMCO56xx 0 -#define NAMCO58xx 1 -#define NAMCO59xx 2 - -void namcoio_init(INT32 chip, INT32 type, UINT8 (*in0)(UINT8), UINT8 (*in1)(UINT8), UINT8 (*in2)(UINT8), UINT8 (*in3)(UINT8), void (*out0)(UINT8, UINT8), void (*out1)(UINT8, UINT8)); -void namcoio_reset(INT32 chip); -INT32 namcoio_scan(INT32 chip); - -void namco56xx_customio_run(INT32 chip); -void namco59xx_customio_run(INT32 chip); -void namco58xx_customio_run(INT32 chip); - -void namcoio_run(INT32 chip); - -UINT8 namcoio_read(INT32 chip, UINT8 offset); -void namcoio_write(INT32 chip, UINT8 offset, UINT8 data); -UINT8 namcoio_read_reset_line(INT32 chip); -void namcoio_set_reset_line(INT32 chip, INT32 state); diff --git a/jan/src/burn/devices/nb1414m4.cpp b/jan/src/burn/devices/nb1414m4.cpp deleted file mode 100644 index 883500b2f..000000000 --- a/jan/src/burn/devices/nb1414m4.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// license:MAME -// copyright-holders:Angelo Salese -/******************************************************************************************************************* - -Nichibutsu 1414M4 device emulation - -Written by Angelo Salese, based on researches by Tomasz Slanina with Legion - -This is some fancy MCU / blitter that copies text strings in various Nihon Bussan games; - -TODO: -- where is the condition that makes "insert coin" text to properly blink? -- first byte meaning is completely unknown; -- Ninja Emaki triggers unknown commands 0x8000 & 0xff20; -- Ninja Emaki continue screen is corrupt; -- How to NOT draw the params? -- Device-ify this; - -Notes: -- Just before any string in the "MCU" rom, there's a control byte, this meaning is as follows: - 0?-- ---- ---- ---- interpret as data? - 10-- ---- ---- ---- single string transfer - 11-- ---- ---- ---- src -> dst copy, if destination != 0 fixed src, otherwise do a src -> dst - --xx xxxx xxxx xxxx destination offset in the VRAM tilemap - -- I'm sure that this is a shared device, that shares everything. All of the known differences are due of not - understood features of the chip (some bytes in the ROM etc.) - -********************************************************************************************************************/ - -#include "tiles_generic.h" // for UINT* etc -#include "nb1414m4.h" - -UINT8 *nb1414_blit_data = NULL; -UINT32 nb1414_frame = 0; - -static void nichibutsu_1414m4_dma(UINT16 src,UINT16 dst,UINT16 size, UINT8 condition,UINT16 *vram) -{ - UINT8 * data = nb1414_blit_data; - int i; - - for(i=0;i 1) /* ONE OR TWO PLAYERS */ - { - dst = ((data[0x0ad]<<8)|(data[0x0ae]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x00af,dst,0x18,fl_cond,vram); - } -} - -static void kozure_score_msg(UINT16 dst,UINT8 src_base,UINT16 *vram) -{ - int i; - UINT8 first_digit; - UINT8 res; - UINT8 * data = nb1414_blit_data; - - first_digit = 0; - - for(i=0;i<6;i++) - { - res = ((vram[(i/2)+5+src_base*3] >> (!(i & 1) * 4)) & 0xf); - - if(first_digit || res) - { - vram[i+dst+0x0000] = res + 0x30; - first_digit = 1; - } - else - vram[i+dst+0x0000] = 0x20; - - vram[i+dst+0x0400] = data[0x10f+(src_base*0x1c)+i]; - } - - vram[6+dst+0x0000] = 0x30; - vram[6+dst+0x0400] = data[0x10f+(src_base*0x1c)+6]; - vram[7+dst+0x0000] = 0x30; - vram[7+dst+0x0400] = data[0x10f+(src_base*0x1c)+7]; - -} - -static void nichibutsu_1414m4_0200( UINT16 mcu_cmd,UINT16 *vram) -{ - UINT8 * data = nb1414_blit_data; - UINT16 dst; - - dst = (data[0x330+((mcu_cmd & 0xf)*2)]<<8)|(data[0x331+((mcu_cmd & 0xf)*2)]&0xff); - - dst &= 0x3fff; - - if(dst & 0x7ff) // fill - nichibutsu_1414m4_fill(0x0000,data[dst & 0x3fff],data[dst+1],vram); - else // src -> dst - nichibutsu_1414m4_dma(dst & 0x3fff,0x0000,0x400,1,vram); -} - -/* -[0x02] & 0x01 p1 up -[0x02] & 0x02 p1 down -[0x02] & 0x04 p1 left -[0x02] & 0x08 p1 right -[0x02] & 0x10 p1 button 1 -[0x02] & 0x20 p1 button 2 -[0x02] & 0x40 p1 button 3 -[0x03] & 0x01 p2 up -[0x03] & 0x02 p2 down -[0x03] & 0x04 p2 left -[0x03] & 0x08 p2 right -[0x03] & 0x10 p2 button 1 -[0x03] & 0x20 p2 button 2 -[0x03] & 0x40 p2 button 3 -[0x04] & 0x10 service -[0x04] & 0x04 coin A -[0x04] & 0x08 coin B -[0x04] & 0x01 start 1 -[0x04] & 0x02 start 2 -[0x05] DSW1 -[0x06] DSW2 -[0x07] & 0x40 demo sounds ON / OFF -[0x07] & 0x7 lives setting -[0x07] & 0x80 cabinet (upright / table) -[0x07] & 0x30 difficulty (easy / normal / hard / hardest) -[0x0f] coinage A -[0x10] coinage B -[0x11] sound test num -*/ -static void nichibutsu_1414m4_0600( UINT8 is2p,UINT16 *vram) -{ - UINT8 * data = nb1414_blit_data; - UINT16 dst; - int i; - - dst = ((data[0x1f5]<<8)|(data[0x1f6]&0xff)) & 0x3fff; - vram[dst] = (vram[7] & 0x7) + 0x30;//data[0x1f7]; - - dst = ((data[0x1f8]<<8)|(data[0x1f9]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x1fa + (((vram[7] & 0x30) >> 4) * 0x18),dst,12,1,vram); - - // 0x25a - 0x261 unknown meaning - - dst = ((data[0x262]<<8)|(data[0x263]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x264 + (((vram[7] & 0x80) >> 7) * 0x18),dst,12,1,vram); - - dst = ((data[0x294]<<8)|(data[0x295]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x296 + (((vram[7] & 0x40) >> 6) * 0x18),dst,12,1,vram); - - dst = ((data[0x2c6]<<8)|(data[0x2c7]&0xff)) & 0x3fff; - vram[dst] = ((vram[0xf] & 0xf0) >> 4) + 0x30;//data[0x2c8]; - - dst = ((data[0x2c9]<<8)|(data[0x2ca]&0xff)) & 0x3fff; - vram[dst] = ((vram[0xf] & 0x0f) >> 0) + 0x30;//data[0x2cb]; - - dst = ((data[0x2cc]<<8)|(data[0x2cd]&0xff)) & 0x3fff; - vram[dst] = ((vram[0x10] & 0xf0) >> 4) + 0x30;//data[0x2ce]; - - dst = ((data[0x2cf]<<8)|(data[0x2d0]&0xff)) & 0x3fff; - vram[dst] = ((vram[0x10] & 0x0f) >> 0) + 0x30;//data[0x2d1]; - - dst = ((data[0x2d2]<<8)|(data[0x2d3]&0xff)) & 0x3fff; - vram[dst+0] = ((vram[0x11] & 0xf0) >> 4) + 0x30;//data[0x2d4]; - vram[dst+1] = (vram[0x11] & 0x0f) + 0x30;//data[0x2d5]; - - dst = ((data[0x2d6]<<8)|(data[0x2d7]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x2d8 + (is2p * 0x18),dst,12,1,vram); // 1p / 2p string - - dst = ((data[0x308]<<8)|(data[0x309]&0xff)) & 0x3fff; - for(i=0;i<5;i++) /* system inputs */ - nichibutsu_1414m4_dma(0x310 + (((vram[0x04] >> (4-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram); - - dst = ((data[0x30a]<<8)|(data[0x30b]&0xff)) & 0x3fff; - for(i=0;i<7;i++) /* 1p / 2p inputs */ - nichibutsu_1414m4_dma(0x310 + (((vram[0x02 + is2p] >> (6-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram); - - dst = ((data[0x30c]<<8)|(data[0x30d]&0xff)) & 0x3fff; - for(i=0;i<8;i++) /* dips */ - nichibutsu_1414m4_dma(0x310 + (((vram[0x05] >> (7-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram); - - dst = ((data[0x30e]<<8)|(data[0x30f]&0xff)) & 0x3fff; - for(i=0;i<8;i++) /* dips */ - nichibutsu_1414m4_dma(0x310 + (((vram[0x06] >> (7-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram); -} - -static void nichibutsu_1414m4_0e00(UINT16 mcu_cmd,UINT16 *vram) -{ - UINT8 * data = nb1414_blit_data; - UINT16 dst; - - dst = ((data[0xdf]<<8)|(data[0xe0]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x00e1,dst,8,1,vram); /* hi-score */ - - if(mcu_cmd & 0x04) - { - dst = ((data[0xfb]<<8)|(data[0xfc]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x00fd,dst,8,!(mcu_cmd & 1),vram); /* 1p-msg */ - dst = ((data[0x10d]<<8)|(data[0x10e]&0xff)) & 0x3fff; - kozure_score_msg(dst,0,vram); /* 1p score */ - if(mcu_cmd & 0x80) - { - dst = ((data[0x117]<<8)|(data[0x118]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x0119,dst,8,!(mcu_cmd & 2),vram); /* 2p-msg */ - dst = ((data[0x129]<<8)|(data[0x12a]&0xff)) & 0x3fff; - kozure_score_msg(dst,1,vram); /* 2p score */ - } - } - else - { - dst = ((data[0x133]<<8)|(data[0x134]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x0135,dst,0x10,!(mcu_cmd & 1),vram); /* game over */ - insert_coin_msg(vram); - if((mcu_cmd & 0x18) == 0) // TODO: either one of these two disables credit display - credit_msg(vram); - } -} - -void nb_1414m4_exec(UINT16 mcu_cmd,UINT16 *vram,UINT16 *scrollx,UINT16 *scrolly) -{ - /* latch fg scroll values */ - *scrollx = (vram[0x0d] & 0xff) | ((vram[0x0e] & 0xff) << 8); - *scrolly = (vram[0x0b] & 0xff) | ((vram[0x0c] & 0xff) << 8); - - /* process the command */ - switch(mcu_cmd & 0xff00) - { - /* title screen / continue screens */ - case 0x0000: insert_coin_msg(vram); credit_msg(vram); break; - - /* direct DMA'ing / fill */ - case 0x0200: nichibutsu_1414m4_0200(mcu_cmd & 0x87,vram); break; - - /* service mode */ - case 0x0600: nichibutsu_1414m4_0600(mcu_cmd & 1,vram); break; - - /* gameplay */ - case 0x0e00: nichibutsu_1414m4_0e00(mcu_cmd & 0xff,vram); break; - - case 0x8000: break; //Ninja Emaki, attract mode - case 0xff00: break; //Ninja Emaki POST, presumably invalid - default: - //popmessage("NB 1414M4 executes %04x command, contact MAMEdev\n",mcu_cmd); - break; - } -} diff --git a/jan/src/burn/devices/nb1414m4.h b/jan/src/burn/devices/nb1414m4.h deleted file mode 100644 index 93c6581fa..000000000 --- a/jan/src/burn/devices/nb1414m4.h +++ /dev/null @@ -1,5 +0,0 @@ -void nb_1414m4_exec(UINT16 mcu_cmd,UINT16 *vram,UINT16 *scrollx,UINT16 *scrolly); - -extern UINT8 *nb1414_blit_data; -extern UINT32 nb1414_frame; - diff --git a/jan/src/burn/devices/nb1414m4_8bit.cpp b/jan/src/burn/devices/nb1414m4_8bit.cpp deleted file mode 100644 index 1fc757724..000000000 --- a/jan/src/burn/devices/nb1414m4_8bit.cpp +++ /dev/null @@ -1,311 +0,0 @@ -// license:MAME -// copyright-holders:Angelo Salese -/******************************************************************************************************************* - -Nichibutsu 1414M4 device emulation - -Written by Angelo Salese, based on researches by Tomasz Slanina with Legion - -This is some fancy MCU / blitter that copies text strings in various Nihon Bussan games; - -TODO: -- where is the condition that makes "insert coin" text to properly blink? -- first byte meaning is completely unknown; -- Ninja Emaki triggers unknown commands 0x8000 & 0xff20; -- Ninja Emaki continue screen is corrupt; -- How to NOT draw the params? -- Device-ify this; - -Notes: -- Just before any string in the "MCU" rom, there's a control byte, this meaning is as follows: - 0?-- ---- ---- ---- interpret as data? - 10-- ---- ---- ---- single string transfer - 11-- ---- ---- ---- src -> dst copy, if destination != 0 fixed src, otherwise do a src -> dst - --xx xxxx xxxx xxxx destination offset in the VRAM tilemap - -- I'm sure that this is a shared device, that shares everything. All of the known differences are due of not - understood features of the chip (some bytes in the ROM etc.) - -********************************************************************************************************************/ - -#include "tiles_generic.h" // for UINT* etc -#include "nb1414m4_8bit.h" - -UINT8 *nb1414_blit_data8b = NULL; -UINT32 nb1414_frame8b = 0; - -static void nichibutsu_1414m4_dma(UINT16 src,UINT16 dst,UINT16 size, UINT8 condition,UINT8 *vram) -{ - UINT8 * data = nb1414_blit_data8b; - int i; - - for(i=0;i 1) /* ONE OR TWO PLAYERS */ - { - dst = ((data[0x0ad]<<8)|(data[0x0ae]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x00af,dst,0x18,fl_cond,vram); - } -} - -static void kozure_score_msg(UINT16 dst,UINT8 src_base,UINT8 *vram) -{ - int i; - UINT8 first_digit; - UINT8 res; - UINT8 * data = nb1414_blit_data8b; - - first_digit = 0; - - for(i=0;i<6;i++) - { - res = ((vram[(i/2)+5+src_base*3] >> (!(i & 1) * 4)) & 0xf); - - if(first_digit || res) - { - vram[i+dst+0x0000] = res + 0x30; - first_digit = 1; - } - else - vram[i+dst+0x0000] = 0x20; - - vram[i+dst+0x0400] = data[0x10f+(src_base*0x1c)+i]; - } - - vram[6+dst+0x0000] = 0x30; - vram[6+dst+0x0400] = data[0x10f+(src_base*0x1c)+6]; - vram[7+dst+0x0000] = 0x30; - vram[7+dst+0x0400] = data[0x10f+(src_base*0x1c)+7]; - -} - -static void nichibutsu_1414m4_0200( UINT16 mcu_cmd,UINT8 *vram) -{ - UINT8 * data = nb1414_blit_data8b; - UINT16 dst; - - dst = (data[0x330+((mcu_cmd & 0xf)*2)]<<8)|(data[0x331+((mcu_cmd & 0xf)*2)]&0xff); - - dst &= 0x3fff; - - if(dst & 0x7ff) // fill - nichibutsu_1414m4_fill(0x0000,data[dst & 0x3fff],data[dst+1],vram); - else // src -> dst - nichibutsu_1414m4_dma(dst & 0x3fff,0x0000,0x400,1,vram); -} - -/* -[0x02] & 0x01 p1 up -[0x02] & 0x02 p1 down -[0x02] & 0x04 p1 left -[0x02] & 0x08 p1 right -[0x02] & 0x10 p1 button 1 -[0x02] & 0x20 p1 button 2 -[0x02] & 0x40 p1 button 3 -[0x03] & 0x01 p2 up -[0x03] & 0x02 p2 down -[0x03] & 0x04 p2 left -[0x03] & 0x08 p2 right -[0x03] & 0x10 p2 button 1 -[0x03] & 0x20 p2 button 2 -[0x03] & 0x40 p2 button 3 -[0x04] & 0x10 service -[0x04] & 0x04 coin A -[0x04] & 0x08 coin B -[0x04] & 0x01 start 1 -[0x04] & 0x02 start 2 -[0x05] DSW1 -[0x06] DSW2 -[0x07] & 0x40 demo sounds ON / OFF -[0x07] & 0x7 lives setting -[0x07] & 0x80 cabinet (upright / table) -[0x07] & 0x30 difficulty (easy / normal / hard / hardest) -[0x0f] coinage A -[0x10] coinage B -[0x11] sound test num -*/ -static void nichibutsu_1414m4_0600( UINT8 is2p,UINT8 *vram) -{ - UINT8 * data = nb1414_blit_data8b; - UINT16 dst; - int i; - - dst = ((data[0x1f5]<<8)|(data[0x1f6]&0xff)) & 0x3fff; - vram[dst] = (vram[7] & 0x7) + 0x30;//data[0x1f7]; - - dst = ((data[0x1f8]<<8)|(data[0x1f9]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x1fa + (((vram[7] & 0x30) >> 4) * 0x18),dst,12,1,vram); - - // 0x25a - 0x261 unknown meaning - - dst = ((data[0x262]<<8)|(data[0x263]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x264 + (((vram[7] & 0x80) >> 7) * 0x18),dst,12,1,vram); - - dst = ((data[0x294]<<8)|(data[0x295]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x296 + (((vram[7] & 0x40) >> 6) * 0x18),dst,12,1,vram); - - dst = ((data[0x2c6]<<8)|(data[0x2c7]&0xff)) & 0x3fff; - vram[dst] = ((vram[0xf] & 0xf0) >> 4) + 0x30;//data[0x2c8]; - - dst = ((data[0x2c9]<<8)|(data[0x2ca]&0xff)) & 0x3fff; - vram[dst] = ((vram[0xf] & 0x0f) >> 0) + 0x30;//data[0x2cb]; - - dst = ((data[0x2cc]<<8)|(data[0x2cd]&0xff)) & 0x3fff; - vram[dst] = ((vram[0x10] & 0xf0) >> 4) + 0x30;//data[0x2ce]; - - dst = ((data[0x2cf]<<8)|(data[0x2d0]&0xff)) & 0x3fff; - vram[dst] = ((vram[0x10] & 0x0f) >> 0) + 0x30;//data[0x2d1]; - - dst = ((data[0x2d2]<<8)|(data[0x2d3]&0xff)) & 0x3fff; - vram[dst+0] = ((vram[0x11] & 0xf0) >> 4) + 0x30;//data[0x2d4]; - vram[dst+1] = (vram[0x11] & 0x0f) + 0x30;//data[0x2d5]; - - dst = ((data[0x2d6]<<8)|(data[0x2d7]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x2d8 + (is2p * 0x18),dst,12,1,vram); // 1p / 2p string - - dst = ((data[0x308]<<8)|(data[0x309]&0xff)) & 0x3fff; - for(i=0;i<5;i++) /* system inputs */ - nichibutsu_1414m4_dma(0x310 + (((vram[0x04] >> (4-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram); - - dst = ((data[0x30a]<<8)|(data[0x30b]&0xff)) & 0x3fff; - for(i=0;i<7;i++) /* 1p / 2p inputs */ - nichibutsu_1414m4_dma(0x310 + (((vram[0x02 + is2p] >> (6-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram); - - dst = ((data[0x30c]<<8)|(data[0x30d]&0xff)) & 0x3fff; - for(i=0;i<8;i++) /* dips */ - nichibutsu_1414m4_dma(0x310 + (((vram[0x05] >> (7-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram); - - dst = ((data[0x30e]<<8)|(data[0x30f]&0xff)) & 0x3fff; - for(i=0;i<8;i++) /* dips */ - nichibutsu_1414m4_dma(0x310 + (((vram[0x06] >> (7-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram); -} - -static void nichibutsu_1414m4_0e00(UINT16 mcu_cmd,UINT8 *vram) -{ - UINT8 * data = nb1414_blit_data8b; - UINT16 dst; - - dst = ((data[0xdf]<<8)|(data[0xe0]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x00e1,dst,8,1,vram); /* hi-score */ - - if(mcu_cmd & 0x04) - { - dst = ((data[0xfb]<<8)|(data[0xfc]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x00fd,dst,8,!(mcu_cmd & 1),vram); /* 1p-msg */ - dst = ((data[0x10d]<<8)|(data[0x10e]&0xff)) & 0x3fff; - kozure_score_msg(dst,0,vram); /* 1p score */ - if(mcu_cmd & 0x80) - { - dst = ((data[0x117]<<8)|(data[0x118]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x0119,dst,8,!(mcu_cmd & 2),vram); /* 2p-msg */ - dst = ((data[0x129]<<8)|(data[0x12a]&0xff)) & 0x3fff; - kozure_score_msg(dst,1,vram); /* 2p score */ - } - } - else - { - dst = ((data[0x133]<<8)|(data[0x134]&0xff)) & 0x3fff; - nichibutsu_1414m4_dma(0x0135,dst,0x10,!(mcu_cmd & 1),vram); /* game over */ - insert_coin_msg(vram); - if((mcu_cmd & 0x18) == 0) // TODO: either one of these two disables credit display - credit_msg(vram); - } -} - -void nb_1414m4_exec8b(UINT16 mcu_cmd,UINT8 *vram,UINT16 *scrollx,UINT16 *scrolly,INT32 emakimode) -{ - /* latch fg scroll values */ - *scrollx = (vram[0x0d] & 0xff) | ((vram[0x0e] & 0xff) << 8); - *scrolly = (vram[0x0b] & 0xff) | ((vram[0x0c] & 0xff) << 8); - - if (emakimode && mcu_cmd == 0x286) { - // this fixes the continue screen in Ninja Emaki - memset(vram, 0x00, 18); - } - - /* process the command */ - switch(mcu_cmd & 0xff00) - { - /* title screen / continue screens */ - case 0x0000: insert_coin_msg(vram); credit_msg(vram); break; - - /* direct DMA'ing / fill */ - case 0x0200: nichibutsu_1414m4_0200(mcu_cmd & 0x87,vram); break; - - /* service mode */ - case 0x0600: nichibutsu_1414m4_0600(mcu_cmd & 1,vram); break; - - /* gameplay */ - case 0x0e00: nichibutsu_1414m4_0e00(mcu_cmd & 0xff,vram); break; - - case 0x8000: break; //Ninja Emaki, attract mode - case 0xff00: break; //Ninja Emaki POST, presumably invalid - default: - //popmessage("NB 1414M4 executes %04x command, contact MAMEdev\n",mcu_cmd); - break; - } -} diff --git a/jan/src/burn/devices/nb1414m4_8bit.h b/jan/src/burn/devices/nb1414m4_8bit.h deleted file mode 100644 index d7b2e0763..000000000 --- a/jan/src/burn/devices/nb1414m4_8bit.h +++ /dev/null @@ -1,5 +0,0 @@ -void nb_1414m4_exec8b(UINT16 mcu_cmd,UINT8 *vram,UINT16 *scrollx,UINT16 *scrolly,INT32 emakimode); - -extern UINT8 *nb1414_blit_data8b; -extern UINT32 nb1414_frame8b; - diff --git a/jan/src/burn/devices/nmk004.cpp b/jan/src/burn/devices/nmk004.cpp deleted file mode 100644 index 75b63f567..000000000 --- a/jan/src/burn/devices/nmk004.cpp +++ /dev/null @@ -1,239 +0,0 @@ -// NMK004 device -// Based on MAME device by David Haywood and trap15 - -#include "burnint.h" -#include "m68000_intf.h" -#include "tlcs90_intf.h" -#include "nmk004.h" -#include "burn_ym2203.h" -#include "msm6295.h" - -UINT8 *NMK004OKIROM0; -UINT8 *NMK004OKIROM1; -UINT8 *NMK004PROGROM; - -static UINT8 *ram; - -static UINT8 to_nmk004 = 0; -static UINT8 to_main = 0; -static INT32 bankdata[2] = { 0, 0 }; - -static INT32 nmk004_initted = 0; - -static UINT8 nmk004_tlcs90_read(UINT32 address) -{ - if (address >= 0xfec0 && address < 0xffc0) { // internal ram - return ram[0x800 + (address - 0xfec0)]; - } - - switch (address) - { - case 0xf800: - case 0xf801: - return BurnYM2203Read(0, address & 1); - - case 0xf900: - return MSM6295ReadStatus(0); - - case 0xfa00: - return MSM6295ReadStatus(1); - - case 0xfb00: - return to_nmk004; - } - - return 0; -} - -static void oki_bankswitch(INT32 chip, INT32 bank) -{ - UINT8 *rom = (chip) ? NMK004OKIROM1 : NMK004OKIROM0; - - bankdata[chip] = bank; - bank = (bank + 1) & 3; - - memcpy (rom + 0x20000, rom + 0x20000 + bank * 0x20000, 0x20000); -} - -static void nmk004_tlcs90_write(UINT32 address, UINT8 data) -{ - if (address >= 0xfec0 && address < 0xffc0) { // internal ram - ram[0x800 + (address - 0xfec0)] = data; - return; - } - - switch (address) - { - case 0xf800: - case 0xf801: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xf900: - MSM6295Command(0, data); - return; - - case 0xfa00: - MSM6295Command(1, data); - return; - - case 0xfc00: - to_main = data; - return; - - case 0xfc01: - oki_bankswitch(0, data); - return; - - case 0xfc02: - oki_bankswitch(1, data); - return; - } -} - -static void nmk004_tlcs90_write_port(UINT16 port, UINT8 data) -{ - switch (port) - { - case 0xffc8: { // hack - disable watchdog function - if (data & 1) { - // SekReset(); - // bprintf (0, _T("Resetting 68k!\n")); - } else { - // bprintf (0, _T("Clear 68k reset!\n")); - } - } - } -} - -void NMK004_reset() -{ - memset (ram, 0, 0x900); - - tlcs90Open(0); - tlcs90Reset(); - BurnYM2203Reset(); - tlcs90Close(); - - MSM6295Reset(0); - MSM6295Reset(1); - - oki_bankswitch(0,0); - oki_bankswitch(1,0); - to_main = 0; - to_nmk004 = 0; -} - -static void NMK004YM2203IrqHandler(INT32, INT32 nStatus) -{ - tlcs90SetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static double NMK004GetTime() -{ - return (double)tlcs90TotalCycles() / 8000000; -} - -inline static INT32 NMK004SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(tlcs90TotalCycles() * nSoundRate / 8000000); -} - -void NMK004_init() -{ - nmk004_initted = 1; - ram = (UINT8*)BurnMalloc(0x900); - - tlcs90Init(0, 8000000); - tlcs90Open(0); - tlcs90MapMemory(NMK004PROGROM, 0x0000, 0xefff, MAP_ROM); - tlcs90MapMemory(ram, 0xf000, 0xf7ff, MAP_RAM); - tlcs90SetReadHandler(nmk004_tlcs90_read); - tlcs90SetWriteHandler(nmk004_tlcs90_write); - tlcs90SetWritePortHandler(nmk004_tlcs90_write_port); - tlcs90Close(); - - BurnYM2203Init(1, 1500000, &NMK004YM2203IrqHandler, NMK004SynchroniseStream, NMK004GetTime, 0); - BurnTimerAttachTlcs90(8000000); - /* reminder: these route#s are opposite of MAME, for example: - MCFG_SOUND_ROUTE(0, "mono", 0.50) - MCFG_SOUND_ROUTE(1, "mono", 0.50) - MCFG_SOUND_ROUTE(2, "mono", 0.50) - MCFG_SOUND_ROUTE(3, "mono", 1.20) - Is equal to the 4 route lines below. -dink - */ - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 1.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.50, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 4000000 / 165, 1); - MSM6295Init(1, 4000000 / 165, 1); - MSM6295SetRoute(0, 0.10, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.10, BURN_SND_ROUTE_BOTH); -} - -void NMK004_exit() -{ - if (!nmk004_initted) return; - - nmk004_initted = 0; - - BurnFree(ram); - ram = NULL; - - tlcs90Exit(); - BurnYM2203Exit(); - MSM6295Exit(0); - MSM6295Exit(1); -} - -INT32 NMK004Scan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = ram; - ba.nLen = 0x900; - ba.szName = "tlcs90 ram"; - BurnAcb(&ba); - - tlcs90Scan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - SCAN_VAR(to_nmk004); - SCAN_VAR(to_main); - SCAN_VAR(bankdata[0]); - SCAN_VAR(bankdata[1]); - } - - if (nAction & ACB_WRITE) - { - oki_bankswitch(0,bankdata[0]); - oki_bankswitch(1,bankdata[1]); - } - - return 0; -} - -void NMK004NmiWrite(INT32 data) -{ - data ^= 0xff; // hack - no game works properly without this being inverted. - - tlcs90SetIRQLine(0x20 /*nmi*/, (data & 1) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -void NMK004Write(INT32, INT32 data) -{ - to_nmk004 = data & 0xff; -} - -UINT8 NMK004Read() -{ - return to_main; -} diff --git a/jan/src/burn/devices/nmk004.h b/jan/src/burn/devices/nmk004.h deleted file mode 100644 index 46b42880d..000000000 --- a/jan/src/burn/devices/nmk004.h +++ /dev/null @@ -1,14 +0,0 @@ -extern UINT8 *NMK004OKIROM0; -extern UINT8 *NMK004OKIROM1; -extern UINT8 *NMK004PROGROM; - -void NMK004_init(); -void NMK004_reset(); -void NMK004_exit(); - -void NMK004NmiWrite(INT32 data); - -void NMK004Write(INT32, INT32 data); -UINT8 NMK004Read(); - -INT32 NMK004Scan(INT32 nAction, INT32* pnMin); diff --git a/jan/src/burn/devices/nmk112.cpp b/jan/src/burn/devices/nmk112.cpp deleted file mode 100644 index 605e041ab..000000000 --- a/jan/src/burn/devices/nmk112.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Alex W. Jackson -// NMK112 - NMK custom IC for bankswitching the sample ROMs of a pair of OKI6295 ADPCM chips - -#include "burnint.h" -#include "msm6295.h" - -#define TABLESIZE 0x100 -#define BANKSIZE 0x10000 - -static UINT8 page_mask; -static UINT8 current_bank[8]; -static UINT32 romlen[2]; -static UINT8 *romdata[2]; - -void NMK112_okibank_write(INT32 offset, UINT8 data) -{ - current_bank[offset] = data; - - INT32 chip = (offset & 4) / 4; - INT32 size = romlen[chip]; - if (size == 0) return; - - INT32 banknum = offset & 3; - INT32 paged = (page_mask & (1 << chip)); - - UINT8 *rom = romdata[chip]; - - INT32 bankaddr = (data * BANKSIZE) % size; - - if ((paged) && (banknum == 0)) - { - MSM6295SetBank(chip, rom + bankaddr + 0x400, 0x00400, (BANKSIZE - 1)); - } - else - { - MSM6295SetBank(chip, rom + bankaddr, 0x00000 + (banknum * BANKSIZE), (banknum * BANKSIZE) + (BANKSIZE - 1)); - } - - if (paged) - { - MSM6295SetBank(chip, rom + bankaddr + (banknum * TABLESIZE), (banknum * TABLESIZE), (banknum * TABLESIZE) + (TABLESIZE - 1)); - } -} - -void NMK112Reset() -{ - for (INT32 i = 0; i < 8; i++) { - NMK112_okibank_write(i, 0); - } -} - -void NMK112_init(UINT8 disable_page_mask, UINT8 *region0, UINT8 *region1, INT32 length0, INT32 length1) -{ - romdata[0] = region0; - romdata[1] = region1; - romlen[0] = length0; - romlen[1] = length1; - page_mask = ~disable_page_mask; - - NMK112Reset(); -} - -INT32 NMK112_Scan(INT32 nAction) -{ - SCAN_VAR(current_bank); - - if (nAction & ACB_WRITE) { - for (INT32 i = 0; i < 8; i++) { - NMK112_okibank_write(i, current_bank[i]); - } - } - - return 0; -} diff --git a/jan/src/burn/devices/nmk112.h b/jan/src/burn/devices/nmk112.h deleted file mode 100644 index be13de3e4..000000000 --- a/jan/src/burn/devices/nmk112.h +++ /dev/null @@ -1,4 +0,0 @@ -void NMK112_okibank_write(INT32 offset, UINT8 data); -void NMK112Reset(); -void NMK112_init(UINT8 disable_page_mask, UINT8 *region0, UINT8 *region1, INT32 len0, INT32 len1); -INT32 NMK112_Scan(INT32 nAction); diff --git a/jan/src/burn/devices/pandora.cpp b/jan/src/burn/devices/pandora.cpp deleted file mode 100644 index 8bea17117..000000000 --- a/jan/src/burn/devices/pandora.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// Kaneko Pandora module -// Based on MAME sources by David Haywood, Luca Elia - -#include "tiles_generic.h" - -static UINT16 *pandora_temp = NULL; -static UINT8 *pandora_ram = NULL; -static UINT8 *pandora_gfx = NULL; -static INT32 pandora_clear; -static INT32 pandora_xoffset; -static INT32 pandora_yoffset; -static INT32 pandora_color_offset; -static INT32 pandora_code_max; -INT32 pandora_flipscreen; - -void pandora_set_clear(INT32 clear) -{ -#if defined FBA_DEBUG - if (!DebugDev_PandoraInitted) bprintf(PRINT_ERROR, _T("pandora_set_clear called without init\n")); -#endif - - pandora_clear = clear; -} - -void pandora_update(UINT16 *dest) -{ -#if defined FBA_DEBUG - if (!DebugDev_PandoraInitted) bprintf(PRINT_ERROR, _T("pandora_update called without init\n")); -#endif - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - if (pandora_temp[i]) { - dest[i] = pandora_temp[i] & 0x3ff; - } - } -} - -void pandora_buffer_sprites() -{ -#if defined FBA_DEBUG - if (!DebugDev_PandoraInitted) bprintf(PRINT_ERROR, _T("pandora_buffer_sprites called without init\n")); -#endif - - INT32 sx=0, sy=0, x=0, y=0; - - if (pandora_clear) memset (pandora_temp, 0, nScreenWidth * nScreenHeight * sizeof(UINT16)); - - for (INT32 offs = 0; offs < 0x1000; offs += 8) - { - INT32 attr = pandora_ram[offs+7]; - INT32 code = pandora_ram[offs+6] + ((attr & 0x3f) << 8); - INT32 dy = pandora_ram[offs+5]; - INT32 dx = pandora_ram[offs+4]; - INT32 color = pandora_ram[offs+3]; - INT32 flipy = attr & 0x40; - INT32 flipx = attr & 0x80; - - if (color & 1) dx |= 0x100; - if (color & 2) dy |= 0x100; - - if (color & 4) - { - x += dx; - y += dy; - } - else - { - x = dx; - y = dy; - } - - code &= pandora_code_max; - - if (pandora_flipscreen) - { - sx = 240 - x; - sy = 240 - y; - flipx = !flipx; - flipy = !flipy; - } - else - { - sx = x; - sy = y; - } - - sx = (sx + pandora_xoffset) & 0x1ff; - sy = (sy + pandora_yoffset) & 0x1ff; - if (sx & 0x100) sx -= 0x200; - if (sy & 0x100) sy -= 0x200; - - if (sx >= nScreenWidth || sx < -15) continue; - if (sy >= nScreenHeight || sy < -15) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pandora_temp, code, sx, sy, color >> 4, 4, 0, pandora_color_offset, pandora_gfx); - } else { - Render16x16Tile_Mask_FlipY_Clip(pandora_temp, code, sx, sy, color >> 4, 4, 0, pandora_color_offset, pandora_gfx); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pandora_temp, code, sx, sy, color >> 4, 4, 0, pandora_color_offset, pandora_gfx); - } else { - Render16x16Tile_Mask_Clip(pandora_temp, code, sx, sy, color >> 4, 4, 0, pandora_color_offset, pandora_gfx); - } - } - } -} - -// must be called after GenericTilesInit() -void pandora_init(UINT8 *ram, UINT8 *gfx, INT32 gfx_mod, INT32 color_offset, INT32 x, INT32 y) -{ - DebugDev_PandoraInitted = 1; - - pandora_ram = ram; - pandora_xoffset = x; - pandora_yoffset = y; - pandora_gfx = gfx; - pandora_color_offset = color_offset; - pandora_code_max = gfx_mod; - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nScreenHeight, &nScreenWidth); - } else { - BurnDrvGetVisibleSize(&nScreenWidth, &nScreenHeight); - } - - pandora_temp = (UINT16*)BurnMalloc(nScreenWidth * nScreenHeight * sizeof(UINT16)); - pandora_clear = 1; -} - -void pandora_exit() -{ -#if defined FBA_DEBUG - if (!DebugDev_PandoraInitted) bprintf(PRINT_ERROR, _T("pandora_exit called without init\n")); -#endif - - BurnFree (pandora_temp); - - pandora_ram = pandora_gfx = NULL; - - DebugDev_PandoraInitted = 0; -} diff --git a/jan/src/burn/devices/pandora.h b/jan/src/burn/devices/pandora.h deleted file mode 100644 index 49374993d..000000000 --- a/jan/src/burn/devices/pandora.h +++ /dev/null @@ -1,7 +0,0 @@ -extern INT32 pandora_flipscreen; - -void pandora_set_clear(INT32 clear); -void pandora_update(UINT16 *dest); -void pandora_buffer_sprites(); -void pandora_init(UINT8 *ram, UINT8 *gfx, INT32 gfx_mod, INT32 color_offset, INT32 x, INT32 y); -void pandora_exit(); diff --git a/jan/src/burn/devices/resnet.cpp b/jan/src/burn/devices/resnet.cpp deleted file mode 100644 index 60b226367..000000000 --- a/jan/src/burn/devices/resnet.cpp +++ /dev/null @@ -1,151 +0,0 @@ -// Based on MAME sources by Couriersud - -#include "burnint.h" -#include "resnet.h" - -double compute_resistor_weights(INT32 minval, INT32 maxval, double scaler, INT32 count_1, const INT32 * resistances_1, double * weights_1, INT32 pulldown_1, INT32 pullup_1, INT32 count_2, const INT32 * resistances_2, double * weights_2, INT32 pulldown_2, INT32 pullup_2, INT32 count_3, const INT32 * resistances_3, double * weights_3, INT32 pulldown_3, INT32 pullup_3) -{ - INT32 networks_no; - - INT32 rescount[MAX_NETS]; /* number of resistors in each of the nets */ - double r[MAX_NETS][MAX_RES_PER_NET]; /* resistances */ - double w[MAX_NETS][MAX_RES_PER_NET]; /* calulated weights */ - double ws[MAX_NETS][MAX_RES_PER_NET]; /* calulated, scaled weights */ - INT32 r_pd[MAX_NETS]; /* pulldown resistances */ - INT32 r_pu[MAX_NETS]; /* pullup resistances */ - - double max_out[MAX_NETS]; - double * out[MAX_NETS]; - - INT32 i,j,n; - double scale; - double max; - - /* parse input parameters */ - - networks_no = 0; - for (n = 0; n < MAX_NETS; n++) - { - INT32 count, pd, pu; - const INT32 * resistances; - double * weights; - - switch(n){ - case 0: - count = count_1; - resistances = resistances_1; - weights = weights_1; - pd = pulldown_1; - pu = pullup_1; - break; - case 1: - count = count_2; - resistances = resistances_2; - weights = weights_2; - pd = pulldown_2; - pu = pullup_2; - break; - case 2: - default: - count = count_3; - resistances = resistances_3; - weights = weights_3; - pd = pulldown_3; - pu = pullup_3; - break; - } - - /* parameters validity check */ - if (count > MAX_RES_PER_NET) - bprintf(PRINT_ERROR, _T("compute_resistor_weights(): too many resistors in net #%i. The maximum allowed is %i, the number requested was: %i\n"), n, MAX_RES_PER_NET, count); - - if (count > 0) - { - rescount[networks_no] = count; - for (i=0; i < count; i++) - { - r[networks_no][i] = 1.0 * resistances[i]; - } - out[networks_no] = weights; - r_pd[networks_no] = pd; - r_pu[networks_no] = pu; - networks_no++; - } - } - if (networks_no < 1) - bprintf(PRINT_ERROR, _T("compute_resistor_weights(): no input data\n")); - - /* calculate outputs for all given networks */ - for( i = 0; i < networks_no; i++ ) - { - double R0, R1, Vout, dst; - - /* of n resistors */ - for(n = 0; n < rescount[i]; n++) - { - R0 = ( r_pd[i] == 0 ) ? 1.0/1e12 : 1.0/r_pd[i]; - R1 = ( r_pu[i] == 0 ) ? 1.0/1e12 : 1.0/r_pu[i]; - - for( j = 0; j < rescount[i]; j++ ) - { - if( j==n ) /* only one resistance in the network connected to Vcc */ - { - if (r[i][j] != 0.0) - R1 += 1.0/r[i][j]; - } - else - if (r[i][j] != 0.0) - R0 += 1.0/r[i][j]; - } - - /* now determine the voltage */ - R0 = 1.0/R0; - R1 = 1.0/R1; - Vout = (maxval - minval) * R0 / (R1 + R0) + minval; - - /* and convert it to a destination value */ - dst = (Vout < minval) ? minval : (Vout > maxval) ? maxval : Vout; - - w[i][n] = dst; - } - } - - /* calculate maximum outputs for all given networks */ - j = 0; - max = 0.0; - for( i = 0; i < networks_no; i++ ) - { - double sum = 0.0; - - /* of n resistors */ - for( n = 0; n < rescount[i]; n++ ) - sum += w[i][n]; /* maximum output, ie when each resistance is connected to Vcc */ - - max_out[i] = sum; - if (max < sum) - { - max = sum; - j = i; - } - } - - - if (scaler < 0.0) /* use autoscale ? */ - /* calculate the output scaler according to the network with the greatest output */ - scale = ((double)maxval) / max_out[j]; - else /* use scaler provided on entry */ - scale = scaler; - - /* calculate scaled output and fill the output table(s)*/ - for(i = 0; i < networks_no;i++) - { - for (n = 0; n < rescount[i]; n++) - { - ws[i][n] = w[i][n]*scale; /* scale the result */ - (out[i])[n] = ws[i][n]; /* fill the output table */ - } - } - - return (scale); - -} diff --git a/jan/src/burn/devices/resnet.h b/jan/src/burn/devices/resnet.h deleted file mode 100644 index a0dd796ab..000000000 --- a/jan/src/burn/devices/resnet.h +++ /dev/null @@ -1,10 +0,0 @@ -#define MAX_NETS 3 -#define MAX_RES_PER_NET 18 - -#define combine_6_weights(tab,w0,w1,w2,w3,w4,w5) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4) + (tab)[5]*(w5)) + 0.5)) -#define combine_5_weights(tab,w0,w1,w2,w3,w4) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4)) + 0.5)) -#define combine_4_weights(tab,w0,w1,w2,w3) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3)) + 0.5)) -#define combine_3_weights(tab,w0,w1,w2) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5)) -#define combine_2_weights(tab,w0,w1) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5)) - -double compute_resistor_weights(INT32 minval, INT32 maxval, double scaler, INT32 count_1, const INT32 * resistances_1, double * weights_1, INT32 pulldown_1, INT32 pullup_1, INT32 count_2, const INT32 * resistances_2, double * weights_2, INT32 pulldown_2, INT32 pullup_2, INT32 count_3, const INT32 * resistances_3, double * weights_3, INT32 pulldown_3, INT32 pullup_3); diff --git a/jan/src/burn/devices/seibusnd.cpp b/jan/src/burn/devices/seibusnd.cpp deleted file mode 100644 index ced2ab7e5..000000000 --- a/jan/src/burn/devices/seibusnd.cpp +++ /dev/null @@ -1,747 +0,0 @@ -// -// FB Alpha Seibu sound hardware module -// -// Based on MAME sources by Bryan McPhail, R. Belmont -// -// Games using this hardware: -// -// Dead Angle 2x YM2203 + adpcm -- not implemented -// -// Dynamite Duke 1x YM3812 + 1x M6295 -// Toki 1x YM3812 + 1x M6295 -// Raiden 1x YM3812 + 1x M6295 -// Blood Brothers 1x YM3812 + 1x M6295 -// D-Con 1x YM3812 + 1x M6295 -// Legionnaire 1x YM3812 + 1x M6295 -// -// SD Gundam PSK 1x YM2151 + 1x M6295 -// Raiden II 1x YM2151 + 2x M6295 -// Raiden DX 1x YM2151 + 2x M6295 -// Zero Team 1x YM2151 + 2x M6295 -// -// Cross Shooter 1x YM2151 + ? -// Cabal 1x YM2151 + adpcm -// - -#include "burnint.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "burn_ym2151.h" -#include "burn_ym2203.h" -#include "msm6295.h" -#include "bitswap.h" - -static UINT8 main2sub[2]; -static UINT8 sub2main[2]; -static INT32 main2sub_pending; -static INT32 sub2main_pending; -static INT32 SeibuSoundBank; -static INT32 irq1,irq2; - -UINT8 *SeibuZ80DecROM = NULL; -UINT8 *SeibuZ80ROM = NULL; -UINT8 *SeibuZ80RAM = NULL; -INT32 seibu_coin_input; - -static INT32 seibu_sndcpu_frequency; -static INT32 seibu_snd_type; -static INT32 is_sdgndmps = 0; - -// ADPCM related -static UINT16 adpcmcurrent[2]; -static UINT8 adpcmnibble[2]; -static UINT16 adpcmend[2]; -static UINT8 adpcmplaying[2]; -static INT32 adpcmfrequency[2]; -static INT32 adpcmsignal[2]; -static INT32 adpcmstep[2]; - -static INT32 diff_lookup[49*16]; -static const INT32 index_shift[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; - -static void adpcm_init(); // forward -static void adpcm_reset(); // forward - -UINT8 *SeibuADPCMData[2]; -INT32 SeibuADPCMDataLen[2]; - -enum -{ - VECTOR_INIT, - RST10_ASSERT, - RST10_CLEAR, - RST18_ASSERT, - RST18_CLEAR -}; - -static void update_irq_lines(INT32 param) -{ - switch(param) - { - case VECTOR_INIT: - irq1 = irq2 = 0xff; - break; - - case RST10_ASSERT: - irq1 = 0xd7; - break; - - case RST10_CLEAR: - irq1 = 0xff; - break; - - case RST18_ASSERT: - irq2 = 0xdf; - break; - - case RST18_CLEAR: - irq2 = 0xff; - break; - } - - if ((irq1 & irq2) == 0xff) { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } else { - ZetSetVector(irq1 & irq2); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } -} - -UINT8 seibu_main_word_read(INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_main_word_read called without init\n")); -#endif - - offset = (offset >> 1) & 7; - - switch (offset) - { - case 2: - case 3: - return sub2main[offset-2]; - case 5: - return main2sub_pending ? 1 : 0; - default: - return 0xff; - } -} - -void seibu_main_word_write(INT32 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_main_word_write called without init\n")); -#endif - - offset = (offset >> 1) & 7; - - switch (offset) - { - case 0: - case 1: - main2sub[offset] = data; - break; - - case 4: - //if (is_sdgndmps) update_irq_lines(RST10_ASSERT); - update_irq_lines(RST18_ASSERT); - break; - - case 6: - sub2main_pending = 0; - main2sub_pending = 1; - break; - - default: - break; - } -} - -void seibu_sound_mustb_write_word(INT32 /*offset*/, UINT16 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_sound_mustb_write_word called without init\n")); -#endif - - main2sub[0] = data & 0xff; - main2sub[1] = data >> 8; - - update_irq_lines(RST18_ASSERT); -} - -static void seibu_z80_bank(INT32 data) -{ - SeibuSoundBank = data & 1; - - ZetMapArea(0x8000, 0xffff, 0, SeibuZ80ROM + 0x10000 + (data & 1) * 0x8000); - ZetMapArea(0x8000, 0xffff, 2, SeibuZ80ROM + 0x10000 + (data & 1) * 0x8000); -} - -void __fastcall seibu_sound_write(UINT16 address, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_sound_write called without init\n")); -#endif - - switch (address) - { - case 0x4000: - main2sub_pending = 0; - sub2main_pending = 1; - return; - - case 0x4001: - if (!is_sdgndmps) - update_irq_lines(VECTOR_INIT); - return; - - case 0x4002: - // rst10 ack (unused) - return; - - case 0x4003: - update_irq_lines(RST18_CLEAR); - return; - - case 0x4005: - adpcmcurrent[0] = data << 8; - adpcmnibble[0] = 4; - return; - - case 0x4006: - adpcmend[0] = data << 8; - return; - - case 0x4007: - seibu_z80_bank(data); - return; - - case 0x401a: // raiden2 - if ((seibu_snd_type & 8) == 0) { - seibu_z80_bank(data); - } else { // Cabal ADPCM - if (data < 2) adpcmplaying[0] = data; - } - return; - - case 0x4008: - switch (seibu_snd_type & 3) - { - case 0: - BurnYM3812Write(0, 0, data); - return; - - case 1: - BurnYM2151SelectRegister(data); - return; - - case 2: - BurnYM2203Write(0, 0, data); - return; - } - return; - - case 0x4009: - switch (seibu_snd_type & 3) - { - case 0: - BurnYM3812Write(0, 1, data); - return; - - case 1: - BurnYM2151WriteRegister(data); - return; - - case 2: - BurnYM2203Write(0, 1, data); - return; - } - return; - - case 0x4018: - case 0x4019: - sub2main[address & 1] = data; - return; - - case 0x401b: - // coin counters - return; - - case 0x6000: - if ((seibu_snd_type & 8) == 0) MSM6295Command(0, data); - return; - - case 0x6002: - if (seibu_snd_type & 4) MSM6295Command(1, data); - return; - - case 0x6005: - adpcmcurrent[1] = data << 8; - adpcmnibble[1] = 4; - return; - - case 0x6006: - adpcmend[1] = data << 8; - return; - - // type 2 - case 0x6008: - case 0x6009: - if (seibu_snd_type == 2) BurnYM2203Write(1, address & 1, data); - return; - - case 0x601a: - if (data < 2) adpcmplaying[1] = data; - return; - - } -} - -UINT8 __fastcall seibu_sound_read(UINT16 address) -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_sound_read called without init\n")); -#endif - - switch (address) - { - case 0x4008: - switch (seibu_snd_type & 3) - { - case 0: - return BurnYM3812Read(0, 0); - - case 1: - return BurnYM2151ReadStatus(); - - case 2: - return BurnYM2203Read(0, 0); - } - return 0; - - case 0x4009: { - if ((seibu_snd_type&3)==1) return BurnYM2151ReadStatus(); - if ((seibu_snd_type&3) < 2) return 0; - return BurnYM2203Read(0, 1); - } - - case 0x4010: - case 0x4011: - return main2sub[address & 1]; - - case 0x4012: - return sub2main_pending ? 1 : 0; - - case 0x4013: - return seibu_coin_input; - - case 0x6000: - return (((seibu_snd_type & 8) == 0) ? MSM6295ReadStatus(0) : 0); - - case 0x6002: - if (seibu_snd_type & 4) return MSM6295ReadStatus(1); - } - - return 0; -} - -static UINT8 decrypt_data(INT32 a,INT32 src) -{ - if ( BIT(a,9) & BIT(a,8)) src ^= 0x80; - if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40; - if ( BIT(a,11) & ~BIT(a,8) & BIT(a,1)) src ^= 0x04; - if ( BIT(a,13) & ~BIT(a,6) & BIT(a,4)) src ^= 0x02; - if (~BIT(a,11) & BIT(a,9) & BIT(a,2)) src ^= 0x01; - - if (BIT(a,13) & BIT(a,4)) src = BITSWAP08(src,7,6,5,4,3,2,0,1); - if (BIT(a, 8) & BIT(a,4)) src = BITSWAP08(src,7,6,5,4,2,3,1,0); - - return src; -} - -static UINT8 decrypt_opcode(INT32 a,INT32 src) -{ - if ( BIT(a,9) & BIT(a,8)) src ^= 0x80; - if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40; - if (~BIT(a,13) & BIT(a,12)) src ^= 0x20; - if (~BIT(a,6) & BIT(a,1)) src ^= 0x10; - if (~BIT(a,12) & BIT(a,2)) src ^= 0x08; - if ( BIT(a,11) & ~BIT(a,8) & BIT(a,1)) src ^= 0x04; - if ( BIT(a,13) & ~BIT(a,6) & BIT(a,4)) src ^= 0x02; - if (~BIT(a,11) & BIT(a,9) & BIT(a,2)) src ^= 0x01; - - if (BIT(a,13) & BIT(a,4)) src = BITSWAP08(src,7,6,5,4,3,2,0,1); - if (BIT(a, 8) & BIT(a,4)) src = BITSWAP08(src,7,6,5,4,2,3,1,0); - if (BIT(a,12) & BIT(a,9)) src = BITSWAP08(src,7,6,4,5,3,2,1,0); - if (BIT(a,11) & ~BIT(a,6)) src = BITSWAP08(src,6,7,5,4,3,2,1,0); - - return src; -} - -static void seibu_sound_decrypt(INT32 length) -{ - for (INT32 i = 0; i < length; i++) - { - UINT8 src = SeibuZ80ROM[i]; - - SeibuZ80ROM[i] = decrypt_data(i,src); - SeibuZ80DecROM[i] = decrypt_opcode(i,src); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / seibu_sndcpu_frequency; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - update_irq_lines(RST10_ASSERT); - } else { - update_irq_lines(RST10_CLEAR); - } -} - -static void Drv2151FMIRQHandler(INT32 nStatus) -{ - DrvFMIRQHandler(0, nStatus); -} - -static double Drv2203GetTime() -{ - return (double)ZetTotalCycles() / seibu_sndcpu_frequency; -} - -void seibu_sound_reset() -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_sound_reset called without init\n")); -#endif - - ZetOpen(0); - ZetReset(); - update_irq_lines(VECTOR_INIT); - seibu_z80_bank(0); // default banking. (fix for raiden2/dx coin-up) - ZetClose(); - - switch (seibu_snd_type & 3) - { - case 0: - BurnYM3812Reset(); - break; - - case 1: - BurnYM2151Reset(); - break; - - case 2: - BurnYM2203Reset(); - break; - } - - if ((seibu_snd_type & 8) == 0) MSM6295Reset(0); - if (seibu_snd_type & 4) MSM6295Reset(1); - - memset (main2sub, 0, 2); - memset (sub2main, 0, 2); - main2sub_pending = 0; - sub2main_pending = 0; - - seibu_coin_input = 0; - //SeibuSoundBank = 0; // set w/ seibu_z80_bank(); - - adpcm_reset(); -} - -void seibu_sound_init(INT32 type, INT32 len, INT32 freq0 /*cpu*/, INT32 freq1 /*ym*/, INT32 freq2 /*oki*/) -{ - DebugDev_SeibuSndInitted = 1; - - seibu_snd_type = type; - - if (len && SeibuZ80DecROM != NULL) { - seibu_sound_decrypt(len); - } else { - SeibuZ80DecROM = SeibuZ80ROM; - } - - seibu_sndcpu_frequency = freq0; - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x1fff, 0, SeibuZ80ROM); - ZetMapArea(0x0000, 0x1fff, 2, SeibuZ80DecROM, SeibuZ80ROM); - ZetMapArea(0x2000, 0x27ff, 0, SeibuZ80RAM); - ZetMapArea(0x2000, 0x27ff, 1, SeibuZ80RAM); - ZetMapArea(0x2000, 0x27ff, 2, SeibuZ80RAM); - ZetSetWriteHandler(seibu_sound_write); - ZetSetReadHandler(seibu_sound_read); - ZetClose(); - - switch (seibu_snd_type & 3) - { - case 0: - BurnYM3812Init(1, freq1, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(freq0); - break; - - case 1: - BurnYM2151Init(freq1); - BurnYM2151SetIrqHandler(&Drv2151FMIRQHandler); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - break; - - case 2: - BurnYM2203Init(2, freq1, DrvFMIRQHandler, DrvSynchroniseStream, Drv2203GetTime, 0); - BurnTimerAttachZet(freq0); - break; - } - - if ((seibu_snd_type & 8) == 0) { - MSM6295Init(0, freq2, 1); - MSM6295SetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - - if (seibu_snd_type & 4) { - MSM6295Init(1, freq2, 1); - MSM6295SetRoute(1, 0.40, BURN_SND_ROUTE_BOTH); - } - } else { - adpcmfrequency[0] = freq2; - adpcmfrequency[1] = freq2; - adpcm_init(); - } - - // init kludge for sdgndmps - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "sdgndmps")) { - is_sdgndmps = 1; - } -} - -void seibu_sound_exit() -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_sound_exit called without init\n")); -#endif - - if (!DebugDev_SeibuSndInitted) return; - - switch (seibu_snd_type & 3) - { - case 0: - BurnYM3812Exit(); - break; - - case 1: - BurnYM2151Exit(); - break; - - case 2: - BurnYM2203Exit(); - break; - } - - ZetExit(); - - if ((seibu_snd_type & 8) == 0) MSM6295Exit(0); - if (seibu_snd_type & 4) MSM6295Exit(1); - - MSM6295ROM = NULL; - - SeibuZ80DecROM = NULL; - SeibuZ80ROM = NULL; - SeibuZ80RAM = NULL; - seibu_sndcpu_frequency = 0; - is_sdgndmps = 0; - - DebugDev_SeibuSndInitted = 0; -} - -static void adpcm_init() -{ - /* nibble to bit map */ - static const INT32 nbl2bit[16][4] = - { - { 1, 0, 0, 0}, { 1, 0, 0, 1}, { 1, 0, 1, 0}, { 1, 0, 1, 1}, - { 1, 1, 0, 0}, { 1, 1, 0, 1}, { 1, 1, 1, 0}, { 1, 1, 1, 1}, - {-1, 0, 0, 0}, {-1, 0, 0, 1}, {-1, 0, 1, 0}, {-1, 0, 1, 1}, - {-1, 1, 0, 0}, {-1, 1, 0, 1}, {-1, 1, 1, 0}, {-1, 1, 1, 1} - }; - - INT32 step, nib; - - /* loop over all possible steps */ - for (step = 0; step <= 48; step++) - { - /* compute the step value */ - INT32 stepval = (INT32)(floor (16.0 * pow (11.0 / 10.0, (double)step))); - - /* loop over all nibbles and compute the difference */ - for (nib = 0; nib < 16; nib++) - { - diff_lookup[step*16 + nib] = nbl2bit[nib][0] * - (stepval * nbl2bit[nib][1] + - stepval/2 * nbl2bit[nib][2] + - stepval/4 * nbl2bit[nib][3] + - stepval/8); - } - } - - adpcm_reset(); -} - -static void adpcm_reset() -{ - for (INT32 i = 0; i < 2; i++) { - adpcmcurrent[i] = 0; - adpcmnibble[i] = 0; - adpcmend[i] = 0; - adpcmplaying[i] = 0; - adpcmsignal[i] = -2; - adpcmstep[i] = 0; - } -} - -static INT32 adpcm_clock(INT32 chip, UINT8 nibble) -{ - adpcmsignal[chip] += diff_lookup[adpcmstep[chip] * 16 + (nibble & 15)]; - - if (adpcmsignal[chip] > 2047) - adpcmsignal[chip] = 2047; - else if (adpcmsignal[chip] < -2048) - adpcmsignal[chip] = -2048; - - adpcmstep[chip] += index_shift[nibble & 7]; - if (adpcmstep[chip] > 48) - adpcmstep[chip] = 48; - else if (adpcmstep[chip] < 0) - adpcmstep[chip] = 0; - - return adpcmsignal[chip]; -} - -static void adpcm_update(INT32 chip, INT16 *pbuf, INT32 samples) -{ - UINT8 *adpcmrom = SeibuADPCMData[chip]; - INT32 val, samp, i; - - while (adpcmplaying[chip] && samples > 0) - { - val = (adpcmrom[adpcmcurrent[chip]] >> adpcmnibble[chip]) & 0xf; - - adpcmnibble[chip] ^= 4; - if (adpcmnibble[chip] == 4) - { - adpcmcurrent[chip]++; - if (adpcmcurrent[chip] >= adpcmend[chip]) - adpcmplaying[chip] = 0; - } - - samp = ((adpcm_clock(chip, val) << 4)); - - for (i = 0; (i < 6) && (samples > 0); i++) { // slow it down - *pbuf = BURN_SND_CLIP(*pbuf + samp); - pbuf++; - *pbuf = BURN_SND_CLIP(*pbuf + samp); - pbuf++; - samples--; - } - } -} - -void seibu_sound_update(INT16 *pbuf, INT32 nLen) -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_sound_update called without init\n")); -#endif - - switch (seibu_snd_type & 3) - { - case 0: - BurnYM3812Update(pbuf, nLen); - break; - - case 1: - BurnYM2151Render(pbuf, nLen); - break; - - case 2: - BurnYM2203Update(pbuf, nLen); - break; - } - - if ((seibu_snd_type & 8) == 0) { - MSM6295Render(0, pbuf, nLen); - - if (seibu_snd_type & 4) - MSM6295Render(1, pbuf, nLen); - } -} - -void seibu_sound_update_cabal(INT16 *pbuf, INT32 nLen) -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_sound_update called without init\n")); -#endif - - adpcm_update(0, pbuf, nLen); - adpcm_update(1, pbuf, nLen); -} - -void seibu_sound_scan(INT32 *pnMin, INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugDev_SeibuSndInitted) bprintf(PRINT_ERROR, _T("seibu_sound_scan called without init\n")); -#endif - - if (nAction & ACB_VOLATILE) - { - ZetScan(nAction); - - ZetOpen(0); - switch (seibu_snd_type & 3) - { - case 0: - BurnYM3812Scan(nAction, pnMin); - break; - - case 1: - BurnYM2151Scan(nAction); - break; - - case 2: - BurnYM2203Scan(nAction, pnMin); - break; - } - ZetClose(); - - if ((seibu_snd_type & 8) == 0) { - MSM6295Scan(0, nAction); - if (seibu_snd_type & 4) { - MSM6295Scan(1, nAction); - } - } - - SCAN_VAR(main2sub[0]); - SCAN_VAR(main2sub[1]); - SCAN_VAR(sub2main[0]); - SCAN_VAR(sub2main[1]); - SCAN_VAR(main2sub_pending); - SCAN_VAR(sub2main_pending); - SCAN_VAR(SeibuSoundBank); - SCAN_VAR(irq1); - SCAN_VAR(irq2); - - SCAN_VAR(adpcmcurrent); - SCAN_VAR(adpcmnibble); - SCAN_VAR(adpcmend); - SCAN_VAR(adpcmplaying); - } - - if (nAction & ACB_WRITE) - { - ZetOpen(0); - seibu_z80_bank(SeibuSoundBank); - ZetClose(); - } -} diff --git a/jan/src/burn/devices/seibusnd.h b/jan/src/burn/devices/seibusnd.h deleted file mode 100644 index 95f377abf..000000000 --- a/jan/src/burn/devices/seibusnd.h +++ /dev/null @@ -1,40 +0,0 @@ -#include "burn_ym3812.h" -#include "burn_ym2151.h" -#include "burn_ym2203.h" -#include "msm6295.h" - -extern UINT8 *SeibuZ80DecROM; -extern UINT8 *SeibuZ80ROM; -extern UINT8 *SeibuZ80RAM; - -extern UINT8 *SeibuADPCMData[2]; -extern INT32 SeibuADPCMDataLen[2]; - -extern INT32 seibu_coin_input; - -unsigned char seibu_main_word_read(INT32 offset); -void seibu_main_word_write(INT32 offset, UINT8 data); -void seibu_sound_mustb_write_word(INT32 offset, UINT16 data); - -void seibu_sound_reset(); - -void seibu_sound_update(INT16 *pbuf, INT32 nLen); -void seibu_sound_update_cabal(INT16 *pbuf, INT32 nLen); - -/* - type & 3 - - Type 0 - YM3812 - Type 1 - YM2151 - Type 2 - YM2203 - - type & 8 - adpcm (disable oki6295) - - otherwise add a single oki6295 - add 4 to init a second oki6295 -*/ - -void seibu_sound_init(INT32 type, INT32 encrypted_len, INT32 freq0 /*cpu*/, INT32 freq1 /*ym*/, INT32 freq2 /*oki*/); -void seibu_sound_exit(); - -void seibu_sound_scan(INT32 *pnMin, INT32 nAction); diff --git a/jan/src/burn/devices/sknsspr.cpp b/jan/src/burn/devices/sknsspr.cpp deleted file mode 100644 index bdfba5b63..000000000 --- a/jan/src/burn/devices/sknsspr.cpp +++ /dev/null @@ -1,558 +0,0 @@ -/* Super Kaneko Nova System Sprites - - "CG24173 6186" & "CG24143 4181" (always used as a pair?) - - - used by suprnova.c - galpani3.c - jchan.c - - - ToDo: - Get rid of sprite position kludges - Fix zooming precision/rounding (most noticeable on jchan backgrounds) - - Ported from MAME 0.144u4 - based on MAME sources by David Haywood -*/ - -#include "tiles_generic.h" - -#define cliprect_min_y 0 -#define cliprect_max_y (nScreenHeight-1) -#define cliprect_min_x 0 -#define cliprect_max_x (nScreenWidth - 1) - -#define SUPRNOVA_DECODE_BUFFER_SIZE 0x2000 - -static INT32 sprite_kludge_x, sprite_kludge_y; -static UINT8 decodebuffer[0x2000]; - -static INT32 skns_rle_decode ( INT32 romoffset, INT32 size, UINT8*gfx_source, INT32 gfx_length ) -{ - UINT8 *src = gfx_source; - INT32 srcsize = gfx_length; - UINT8 *dst = decodebuffer; - INT32 decodeoffset = 0; - - while(size>0) { - UINT8 code = src[(romoffset++)%srcsize]; - size -= (code & 0x7f) + 1; - if(code & 0x80) { /* (code & 0x7f) normal values will follow */ - code &= 0x7f; - do { - dst[(decodeoffset++)%SUPRNOVA_DECODE_BUFFER_SIZE] = src[(romoffset++)%srcsize]; - code--; - } while(code != 0xff); - } else { /* repeat next value (code & 0x7f) times */ - UINT8 val = src[(romoffset++)%srcsize]; - do { - dst[(decodeoffset++)%SUPRNOVA_DECODE_BUFFER_SIZE] = val; - code--; - } while(code != 0xff); - } - } - return &src[romoffset%srcsize]-gfx_source; -} - -void skns_sprite_kludge(INT32 x, INT32 y) -{ -#if defined FBA_DEBUG - if (!DebugDev_SknsSprInitted) bprintf(PRINT_ERROR, _T("skns_sprite_kludge called without init\n")); -#endif - - sprite_kludge_x = x; - sprite_kludge_y = y; -} - -/* Zooming blitter, zoom is by way of both source and destination offsets */ -/* We are working in .6 fixed point if you hadn't guessed */ - -#define z_decls(step) \ - UINT16 zxs = 0x40-(zx_m>>2); \ - UINT16 zxd = 0x40-(zx_s>>2); \ - UINT16 zys = 0x40-(zy_m>>2); \ - UINT16 zyd = 0x40-(zy_s>>2); \ - INT32 xs, ys, xd, yd, old, old2; \ - INT32 step_spr = step; \ - INT32 bxs = 0, bys = 0; \ - INT32 clip_min_x = cliprect_min_x<<6; \ - INT32 clip_max_x = (cliprect_max_x+1)<<6; \ - INT32 clip_min_y = cliprect_min_y<<6; \ - INT32 clip_max_y = (cliprect_max_y+1)<<6; \ - sx <<= 6; \ - sy <<= 6; \ - x <<= 6; \ - y <<= 6; - -#define z_clamp_x_min() \ - if(x < clip_min_x) { \ - do { \ - bxs += zxs; \ - x += zxd; \ - } while(x < clip_min_x); \ - } - -#define z_clamp_x_max() \ - if(x > clip_max_x) { \ - do { \ - bxs += zxs; \ - x -= zxd; \ - } while(x > clip_max_x); \ - } - -#define z_clamp_y_min() \ - if(y < clip_min_y) { \ - do { \ - bys += zys; \ - y += zyd; \ - } while(y < clip_min_y); \ - src += (bys>>6)*step_spr; \ - } - -#define z_clamp_y_max() \ - if(y > clip_max_y) { \ - do { \ - bys += zys; \ - y -= zyd; \ - } while(y > clip_max_y); \ - src += (bys>>6)*step_spr; \ - } - -#define z_loop_x() \ - xs = bxs; \ - xd = x; \ - while(xs < sx && xd <= clip_max_x) - -#define z_loop_x_flip() \ - xs = bxs; \ - xd = x; \ - while(xs < sx && xd >= clip_min_x) - -#define z_loop_y() \ - ys = bys; \ - yd = y; \ - while(ys < sy && yd <= clip_max_y) - -#define z_loop_y_flip() \ - ys = bys; \ - yd = y; \ - while(ys < sy && yd >= clip_min_y) - -#define z_draw_pixel() \ - UINT8 val = src[xs >> 6]; \ - if(val) \ - if ((yd>>6) < nScreenHeight && (xd>>6) < nScreenWidth) \ - bitmap[(yd>>6) * nScreenWidth + (xd>>6)] = val + colour; - -#define z_x_dst(op) \ - old = xd; \ - do { \ - xs += zxs; \ - xd op zxd; \ - } while(!((xd^old) & ~0x3f)); - -#define z_y_dst(op) \ - old = yd; \ - old2 = ys; \ - do { \ - ys += zys; \ - yd op zyd; \ - } while(!((yd^old) & ~0x3f)); \ - while((ys^old2) & ~0x3f) { \ - src += step_spr; \ - old2 += 0x40; \ - } - -static void blit_nf_z(UINT16 *bitmap, const UINT8 *src, INT32 x, INT32 y, INT32 sx, INT32 sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, INT32 colour) -{ - z_decls(sx); - z_clamp_x_min(); - z_clamp_y_min(); - z_loop_y() { - z_loop_x() { - z_draw_pixel(); - z_x_dst(+=); - } - z_y_dst(+=); - } -} - -static void blit_fy_z(UINT16 *bitmap, const UINT8 *src, INT32 x, INT32 y, INT32 sx, INT32 sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, INT32 colour) -{ - z_decls(sx); - z_clamp_x_min(); - z_clamp_y_max(); - z_loop_y_flip() { - z_loop_x() { - z_draw_pixel(); - z_x_dst(+=); - } - z_y_dst(-=); - } -} - -static void blit_fx_z(UINT16 *bitmap, const UINT8 *src, INT32 x, INT32 y, INT32 sx, INT32 sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, INT32 colour) -{ - z_decls(sx); - z_clamp_x_max(); - z_clamp_y_min(); - z_loop_y() { - z_loop_x_flip() { - z_draw_pixel(); - z_x_dst(-=); - } - z_y_dst(+=); - } -} - -static void blit_fxy_z(UINT16 *bitmap, const UINT8 *src, INT32 x, INT32 y, INT32 sx, INT32 sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, INT32 colour) -{ - z_decls(sx); - z_clamp_x_max(); - z_clamp_y_max(); - z_loop_y_flip() { - z_loop_x_flip() { - z_draw_pixel(); - z_x_dst(-=); - } - z_y_dst(-=); - } -} - -static void (*const blit_z[4])(UINT16 *bitmap, const UINT8 *src, INT32 x, INT32 y, INT32 sx, INT32 sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, INT32 colour) = { - blit_nf_z, - blit_fy_z, - blit_fx_z, - blit_fxy_z, -}; - -// disable_priority is a hack to make jchan drawing a bit quicker (rather than moving the sprites around different bitmaps and adding colors -void skns_draw_sprites(UINT16 *bitmap, UINT32* spriteram_source, INT32 spriteram_size, UINT8* gfx_source, INT32 gfx_length, UINT32* sprite_regs, INT32 disable_priority) -{ -#if defined FBA_DEBUG - if (!DebugDev_SknsSprInitted) bprintf(PRINT_ERROR, _T("skns_draw_sprites called without init\n")); -#endif - - /*- SPR RAM Format -** - - 16 bytes per sprite - - 0x00 --ss --SS z--- ---- jjjg g-ff ppcc cccc - - s = y size - S = x size - j = joint - g = group sprite is part of (if groups are enabled) - f = flip - p = priority - c = palette - - 0x04 ---- -aaa aaaa aaaa aaaa aaaa aaaa aaaa - - a = ROM address of sprite data - - 0x08 ZZZZ ZZ-- zzzz zz-- xxxx xxxx xx-- ---- - - Z = horizontal zoom table - z = horizontal zoom subtable - x = x position - - 0x0C ZZZZ ZZ-- zzzz zz-- yyyy yyyy yy-- ---- - - Z = vertical zoom table - z = vertical zoom subtable - x = y position - - **- End of Comments -*/ - - UINT32 *source = spriteram_source; - UINT32 *finish = source + spriteram_size/4; - - INT32 group_x_offset[4]; - INT32 group_y_offset[4]; - INT32 group_enable; - INT32 group_number; - INT32 sprite_flip; - INT32 sprite_x_scroll; - INT32 sprite_y_scroll; - INT32 disabled = sprite_regs[0x04/4] & 0x08; // RWR1 - INT32 xsize,ysize, size, xpos=0,ypos=0, pri=0, romoffset, colour=0, xflip,yflip, joint; - INT32 sx,sy; - INT32 endromoffs=0, gfxlen; - INT32 grow; - UINT16 zoomx_m, zoomx_s, zoomy_m, zoomy_s; - - if ((!disabled)){ - - group_enable = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x00/4]) & 0x0040) >> 6; // RWR0 - - /* Sengekis uses global flip */ - sprite_flip = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x04/4]) & 0x03); // RWR1 - - sprite_y_scroll = ((BURN_ENDIAN_SWAP_INT32(sprite_regs[0x08/4]) & 0x7fc0) >> 6); // RWR2 - sprite_x_scroll = ((BURN_ENDIAN_SWAP_INT32(sprite_regs[0x10/4]) & 0x7fc0) >> 6); // RWR4 - if (sprite_y_scroll&0x100) sprite_y_scroll -= 0x200; // Signed - if (sprite_x_scroll&0x100) sprite_x_scroll -= 0x200; // Signed - - group_x_offset[0] = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x18/4]) & 0xffc0) >> 6; // RWR6 - group_y_offset[0] = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x1c/4]) & 0xffc0) >> 6; // RWR7 - if (group_x_offset[0]&0x200) group_x_offset[0] -= 0x400; // Signed - if (group_y_offset[0]&0x200) group_y_offset[0] -= 0x400; // Signed - - group_x_offset[1] = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x20/4]) & 0xffc0) >> 6; // RWR8 - group_y_offset[1] = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x24/4]) & 0xffc0) >> 6; // RWR9 - if (group_x_offset[1]&0x200) group_x_offset[1] -= 0x400; // Signed - if (group_y_offset[1]&0x200) group_y_offset[1] -= 0x400; // Signed - - group_x_offset[2] = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x28/4]) & 0xffc0) >> 6; // RWR10 - group_y_offset[2] = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x2c/4]) & 0xffc0) >> 6; // RWR11 - if (group_x_offset[2]&0x200) group_x_offset[2] -= 0x400; // Signed - if (group_y_offset[2]&0x200) group_y_offset[2] -= 0x400; // Signed - - group_x_offset[3] = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x30/4]) & 0xffc0) >> 6; // RWR12 - group_y_offset[3] = (BURN_ENDIAN_SWAP_INT32(sprite_regs[0x34/4]) & 0xffc0) >> 6; // RWR13 - if (group_x_offset[3]&0x200) group_x_offset[3] -= 0x400; // Signed - if (group_y_offset[3]&0x200) group_y_offset[3] -= 0x400; // Signed - - /* Seems that sprites are consistently off by a fixed no. of pixels in different games - (Patterns emerge through Manufacturer/Date/Orientation) */ - sprite_x_scroll += sprite_kludge_x; - sprite_y_scroll += sprite_kludge_y; - - - gfxlen = gfx_length; - while( source> 9; - yflip = (BURN_ENDIAN_SWAP_INT32(source[0]) & 0x00000100) >> 8; - - ysize = (BURN_ENDIAN_SWAP_INT32(source[0]) & 0x30000000) >> 28; - xsize = (BURN_ENDIAN_SWAP_INT32(source[0]) & 0x03000000) >> 24; - xsize ++; - ysize ++; - - xsize *= 16; - ysize *= 16; - - size = xsize * ysize; - - joint = (BURN_ENDIAN_SWAP_INT32(source[0]) & 0x0000e000) >> 13; - - if (!(joint & 1)) - { - xpos = (BURN_ENDIAN_SWAP_INT32(source[2]) & 0x0000ffc0) >> 6; - ypos = (BURN_ENDIAN_SWAP_INT32(source[3]) & 0x0000ffc0) >> 6; - - xpos += sprite_x_scroll; // Global offset - ypos += sprite_y_scroll; - - if (group_enable) - { - group_number = (BURN_ENDIAN_SWAP_INT32(source[0]) & 0x00001800) >> 11; - - /* the group positioning doesn't seem to be working as i'd expect, - if I apply the x position the cursor on galpani4 ends up moving - from the correct position to too far right, also the y offset - seems to cause the position to be off by one in galpans2 even if - it fixes the position in galpani4? - - even if I take into account the global sprite scroll registers - it isn't right - - global offset kludged using game specific offset -pjp */ - - xpos += group_x_offset[group_number]; - ypos += group_y_offset[group_number]; - } - } - else - { - xpos += (BURN_ENDIAN_SWAP_INT32(source[2]) & 0x0000ffc0) >> 6; - ypos += (BURN_ENDIAN_SWAP_INT32(source[3]) & 0x0000ffc0) >> 6; - } - - if (xpos > 0x1ff) xpos -= 0x400; - if (ypos > 0x1ff) ypos -= 0x400; - - /* Local sprite offset (for taking flip into account and drawing offset) */ - sx = xpos; - sy = ypos; - - /* Global Sprite Flip (sengekis) */ - if (sprite_flip&2) - { - xflip ^= 1; - sx = nScreenWidth - sx; - } - if (sprite_flip&1) - { - yflip ^= 1; - sy = nScreenHeight - sy; - } - - /* Palette linking */ - if (!(joint & 2)) - { - colour = (BURN_ENDIAN_SWAP_INT32(source[0]) & 0x0000003f) >> 0; - } - - /* Priority and Tile linking */ - if (!(joint & 4)) - { - romoffset = (BURN_ENDIAN_SWAP_INT32(source[1]) & 0x07ffffff) >> 0; - pri = (BURN_ENDIAN_SWAP_INT32(source[0]) & 0x000000c0) >> 6; - } else { - romoffset = endromoffs; - } - - grow = (BURN_ENDIAN_SWAP_INT32(source[0])>>23) & 1; - - if (!grow) - { - zoomx_m = (BURN_ENDIAN_SWAP_INT32(source[2]) >> 24)&0x00fc; - zoomx_s = (BURN_ENDIAN_SWAP_INT32(source[2]) >> 16)&0x00fc; - zoomy_m = (BURN_ENDIAN_SWAP_INT32(source[3]) >> 24)&0x00fc; - zoomy_s = (BURN_ENDIAN_SWAP_INT32(source[3]) >> 16)&0x00fc; - } - else - { - // sengekis uses this on sprites which are shrinking as they head towards the ground - // it's also used on the input test of Gals Panic S2 - // - // it appears to offer a higher precision 'shrink' mode (although I'm not entirely - // convinced this implementation is correct because we simply end up ignoring - // part of the data) - zoomx_m = 0; - zoomx_s = (BURN_ENDIAN_SWAP_INT32(source[2]) >> 24)&0x00fc; - zoomy_m = 0; - zoomy_s = (BURN_ENDIAN_SWAP_INT32(source[3]) >> 24)&0x00fc; - - - } - - romoffset &= gfxlen-1; - - endromoffs = skns_rle_decode ( romoffset, size, gfx_source, gfx_length ); - - // in Cyvern - - // train in tunnel pri = 0x00 - // nothing? = 0x01 - // players etc. pri = 0x02 - // pickups etc. pri = 0x03 - - { - INT32 NewColour = (colour<<8); - if (disable_priority) { - NewColour += disable_priority; // jchan hack - } else { - NewColour += (pri << 14); - } - - if(zoomx_m || zoomx_s || zoomy_m || zoomy_s) - { - blit_z[ (xflip<<1) | yflip ](bitmap, decodebuffer, sx, sy, xsize, ysize, zoomx_m, zoomx_s, zoomy_m, zoomy_s, NewColour); - } - else - { - if (!xflip && !yflip) { - INT32 xx,yy; - - for (xx = 0; xx= cliprect_min_x)) - { - for (yy = 0; yy= cliprect_min_y)) - { - INT32 pix; - pix = decodebuffer[xsize*yy+xx]; - if (pix) - bitmap[(sy+yy) * nScreenWidth + (sx+xx)] = pix+ NewColour; // change later - } - } - } - } - } else if (!xflip && yflip) { - INT32 xx,yy; - sy -= ysize; - - for (xx = 0; xx= cliprect_min_x)) - { - for (yy = 0; yy= cliprect_min_y)) - { - INT32 pix; - pix = decodebuffer[xsize*yy+xx]; - if (pix) - bitmap[(sy+(ysize-1-yy)) * nScreenWidth + (sx+xx)] = pix+ NewColour; // change later - } - } - } - } - } else if (xflip && !yflip) { - INT32 xx,yy; - sx -= xsize; - - for (xx = 0; xx= cliprect_min_x)) - { - for (yy = 0; yy= cliprect_min_y)) - { - INT32 pix; - pix = decodebuffer[xsize*yy+xx]; - if (pix) - bitmap[(sy+yy) * nScreenWidth + (sx+(xsize-1-xx))] = pix+ NewColour; // change later - } - } - } - } - } else if (xflip && yflip) { - INT32 xx,yy; - sx -= xsize; - sy -= ysize; - - for (xx = 0; xx= cliprect_min_x)) - { - for (yy = 0; yy= cliprect_min_y)) - { - INT32 pix; - pix = decodebuffer[xsize*yy+xx]; - if (pix) - bitmap[(sy+(ysize-1-yy)) * nScreenWidth + (sx+(xsize-1-xx))] = pix+ NewColour; // change later - } - } - } - } - } - } - } - - source+=4; - } - } -} - -void skns_init() -{ - DebugDev_SknsSprInitted = 1; -} - -void skns_exit() -{ -#if defined FBA_DEBUG - if (!DebugDev_SknsSprInitted) bprintf(PRINT_ERROR, _T("skns_exit called without init\n")); -#endif - - DebugDev_SknsSprInitted = 0; -} diff --git a/jan/src/burn/devices/sknsspr.h b/jan/src/burn/devices/sknsspr.h deleted file mode 100644 index 1f90f862a..000000000 --- a/jan/src/burn/devices/sknsspr.h +++ /dev/null @@ -1,4 +0,0 @@ -void skns_sprite_kludge(INT32 x, INT32 y); -void skns_draw_sprites(UINT16 *bitmap, UINT32* spriteram_source, INT32 spriteram_size, UINT8* gfx_source, INT32 gfx_length, UINT32* sprite_regs, INT32 disable_priority); -void skns_init(); -void skns_exit(); diff --git a/jan/src/burn/devices/slapstic.cpp b/jan/src/burn/devices/slapstic.cpp deleted file mode 100644 index 024ebb516..000000000 --- a/jan/src/burn/devices/slapstic.cpp +++ /dev/null @@ -1,1136 +0,0 @@ -/************************************************************************* - - Atari Slapstic decoding helper - -************************************************************************** - - Atari Slapstic FAQ - Version 1.12 - by Aaron Giles and Frank Palazzolo - 9/12/2002 - - - What is a slapstic? - - The slapstic was a security chip made by Atari, which was used for - bank switching and security in several coin-operated video games from - 1984 through 1990. - - - What is a SLOOP? - - The SLOOP (or "SLOOPstic") is a follow-on chip to the slapstic. It - provides a similar type of security, but is programmed onto a GAL6001, - rather than a custom part. It was created because Atari was running - out of slapstics to use in their games, and the original masks for the - slapstic had been lost by the company that manufactured them. A separate - FAQ for this chip is planned for the future. - - - How do I identify a slapstic chip on my board? - - Look for a small, socketed 20-pin DIP on the board. The number on - the chip will be 137412-1xx. - - - Are slapstic chips interchangeable? - - Sadly, no. They were designed to prevent operators from burning - new EPROMs and "upgrading" their PCBs to a new game without buying - the necessary kits from Atari. For example, the five System 1 games - each used a different slapstic, so that you couldn't take, say, - a Marble Madness machine, burn new EPROMs, and convert it into - an Indiana Jones. - - That said, however, there are two pairs of the slapstics that appear - to be functionally identical, despite the fact that they have - different part numbers: - - 137412-103 (Marble Madness) appears to be functionally identical - to 137412-110 (Road Blasters & APB) - - 137412-106 (Gauntlet II) appears to be functionally identical - to 137412-109 (Championship Sprint) - - Note, however, that I have not tried these swaps to confirm that they - work. Your mileage may vary. - - - How many different slapstics are there? - - All told, a total of 13 actual slapstics have been found. However, - there are gaps in the numbering which indicate that more may exist. - - - Do all slapstics work the same? - - In general, yes. However, matters are complicated by the existence - of multiple revisions of the chip design: - - SLAPSTIC Part #137412-101 through 137412-110 - SLAPSTIC-2 Part #137412-111 through 137412-118 - - In the simplest case, both revs act the same. However, they differ - in how the more complex modes of operation are used. - - - How is the slapstic connected to the game? - - The slapstic generally sits between the CPU's address bus and one - of the program ROMs. Here's a pinout: - - A9 1 +-v-+ 20 A8 - A10 2 | | 19 A7 - A11 3 | | 18 A6 - A12 4 | | 17 A5 - A13 5 | | 16 A4 - /CS 6 | | 15 A3 - CLK 7 | | 14 A2 - VCC 8 | | 13 A1 - BS1 9 | | 12 A0 - BS0 10 +---+ 11 GND - - A0-A13 are the address lines from the CPU. CLK and /CS together - trigger a state change. BS0 and BS1 are the bank select outputs, - which usually connect to the protected program ROM in place of - two address lines (traditionally A12 and A13). - - Most slapstics were used on 68000 or T-11 based games, which had - a 16-bit address bus. This meant that A0-A13 on the slapstic were - generally connected to A1-A14 on the CPU. However, two 8-bit - games (Tetris and Empire Strikes Back) used the slapstic as well. - This slapstic (#101) has a slightly different pinout, though it - operates similarly to the others in its class. - - A8 1 +-v-+ 20 A7 - A9 2 | | 19 A6 - A10 3 | | 18 A5 - A11 4 | | 17 A4 - A12 5 | | 16 A3 - /CS 6 | | 15 A2 - CLK 7 | | 14 A1 - VCC 8 | | 13 A0 - /BS1 9 | | 12 GND - BS1 10 +---+ 11 BS0 - - - Which games used slapstics? - - 137412-101 Empire Strikes Back - 137412-101 Tetris - 137412-103 Marble Madness - 137412-104 Gauntlet - 137412-105 Paperboy - 137412-105 Indiana Jones & the Temple of Doom - 137412-106 Gauntlet II - 137412-107 2-Player Gauntlet - 137412-107 Peter Packrat - 137412-107 720 Degrees - 137412-107 Xybots - 137412-108 Road Runner - 137412-108 Super Sprint - 137412-109 Championship Sprint - 137412-109 Road Blasters (some versions) - 137412-110 Road Blasters - 137412-110 APB - 137412-111 Pit Fighter - 137412-112 Pit Fighter (Europe) - 137412-113 Unknown (Europe) - 137412-115 Race Drivin' DSK board - 137412-116 Hydra - 137412-116 Tournament Cyberball 2072 - 137412-117 Race Drivin' main board - 137412-118 Rampart - 137412-118 Vindicators Part II - - - How does the slapstic work? - - On power-up, the slapstic starts by pointing to bank 0 or bank 3. - After that, certain sequences of addresses will trigger a bankswitch. - Each sequence begins with an access to location $0000, followed by one - or more special addresses. - - Each slapstic has a 'simple' mode of bankswitching, consisting of an - access to $0000 followed by an access to one of four bank addresses. - Other accesses are allowed in between these two accesses without - affecting the outcome. - - Additionally, each slapstic has a trickier variant of the - bankswitching, which requires an access to $0000, followed by accesses - to two specific addresses, followed by one of four alternate bank - addresses. All three accesses following the $0000 must occur in - sequence with no interruptions, or else the sequence is invalidated. - - Finally, each slapstic has a mechanism for modifying the value of the - current bank. Earlier chips (101-110) allowed you to twiddle the - specific bits of the bank number, clearing or setting bits 0 and 1 - independently. Later chips (111-118) provided a mechanism of adding - 1, 2, or 3 to the number of the current bank. - - Surprisingly, the slapstic appears to have used DRAM cells to store - the current bank. After 5 or 6 seconds without a clock, the chip - reverts to the default bank, with the chip reset (bank select - addresses are enabled). Typically, the slapstic region is accessed - often enough to cause a problem. - - For full details, see the MAME source code. - - Ported from MAME 0.146u3 - *alt2_kludge may need additional code fixes - -*************************************************************************/ - -#include "burnint.h" -#include "m68000_intf.h" -#include "m68000_debug.h" - - -/************************************* - * - * Structure of slapstic params - * - *************************************/ - -struct mask_value -{ - INT32 mask, value; -}; - - -struct slapstic_data -{ - INT32 bankstart; - INT32 bank[4]; - - struct mask_value alt1; - struct mask_value alt2; - struct mask_value alt3; - struct mask_value alt4; - INT32 altshift; - - struct mask_value bit1; - struct mask_value bit2c0; - struct mask_value bit2s0; - struct mask_value bit2c1; - struct mask_value bit2s1; - struct mask_value bit3; - - struct mask_value add1; - struct mask_value add2; - struct mask_value addplus1; - struct mask_value addplus2; - struct mask_value add3; -}; - - -/************************************* - * - * Shorthand - * - *************************************/ - -#define UNKNOWN 0xffff -#define NO_BITWISE \ - { UNKNOWN,UNKNOWN }, \ - { UNKNOWN,UNKNOWN }, \ - { UNKNOWN,UNKNOWN }, \ - { UNKNOWN,UNKNOWN }, \ - { UNKNOWN,UNKNOWN }, \ - { UNKNOWN,UNKNOWN } -#define NO_ADDITIVE \ - { UNKNOWN,UNKNOWN }, \ - { UNKNOWN,UNKNOWN }, \ - { UNKNOWN,UNKNOWN }, \ - { UNKNOWN,UNKNOWN }, \ - { UNKNOWN,UNKNOWN } - -#define MATCHES_MASK_VALUE(val, maskval) (((val) & (maskval).mask) == (maskval).value) - - -/************************************* - * - * Constants - * - *************************************/ - -enum -{ - DISABLED, - ENABLED, - ALTERNATE1, - ALTERNATE2, - ALTERNATE3, - BITWISE1, - BITWISE2, - BITWISE3, - ADDITIVE1, - ADDITIVE2, - ADDITIVE3 -}; - - -/************************************* - * - * Slapstic definitions - * - *************************************/ - -/* slapstic 137412-101: Empire Strikes Back/Tetris (NOT confirmed) */ -static const struct slapstic_data slapstic101 = -{ - /* basic banking */ - 3, /* starting bank */ - { 0x0080,0x0090,0x00a0,0x00b0 }, /* bank select values */ - - /* alternate banking */ - { 0x007f,UNKNOWN }, /* 1st mask/value in sequence */ - { 0x1fff,0x1dff }, /* 2nd mask/value in sequence */ - { 0x1ffc,0x1b5c }, /* 3rd mask/value in sequence */ - { 0x1fcf,0x0080 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - { 0x1ff0,0x1540 }, /* 1st mask/value in sequence */ - { 0x1ff3,0x1540 }, /* clear bit 0 value */ - { 0x1ff3,0x1541 }, /* set bit 0 value */ - { 0x1ff3,0x1542 }, /* clear bit 1 value */ - { 0x1ff3,0x1543 }, /* set bit 1 value */ - { 0x1ff8,0x1550 }, /* final mask/value in sequence */ - - /* additive banking */ - NO_ADDITIVE -}; - - -/* slapstic 137412-103: Marble Madness (confirmed) */ -static const struct slapstic_data slapstic103 = -{ - /* basic banking */ - 3, /* starting bank */ - { 0x0040,0x0050,0x0060,0x0070 }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x002d }, /* 1st mask/value in sequence */ - { 0x3fff,0x3d14 }, /* 2nd mask/value in sequence */ - { 0x3ffc,0x3d24 }, /* 3rd mask/value in sequence */ - { 0x3fcf,0x0040 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - { 0x3ff0,0x34c0 }, /* 1st mask/value in sequence */ - { 0x3ff3,0x34c0 }, /* clear bit 0 value */ - { 0x3ff3,0x34c1 }, /* set bit 0 value */ - { 0x3ff3,0x34c2 }, /* clear bit 1 value */ - { 0x3ff3,0x34c3 }, /* set bit 1 value */ - { 0x3ff8,0x34d0 }, /* final mask/value in sequence */ - - /* additive banking */ - NO_ADDITIVE -}; - - -/* slapstic 137412-104: Gauntlet (confirmed) */ -static const struct slapstic_data slapstic104 = -{ - /* basic banking */ - 3, /* starting bank */ - { 0x0020,0x0028,0x0030,0x0038 }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x0069 }, /* 1st mask/value in sequence */ - { 0x3fff,0x3735 }, /* 2nd mask/value in sequence */ - { 0x3ffc,0x3764 }, /* 3rd mask/value in sequence */ - { 0x3fe7,0x0020 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - { 0x3ff0,0x3d90 }, /* 1st mask/value in sequence */ - { 0x3ff3,0x3d90 }, /* clear bit 0 value */ - { 0x3ff3,0x3d91 }, /* set bit 0 value */ - { 0x3ff3,0x3d92 }, /* clear bit 1 value */ - { 0x3ff3,0x3d93 }, /* set bit 1 value */ - { 0x3ff8,0x3da0 }, /* final mask/value in sequence */ - - /* additive banking */ - NO_ADDITIVE -}; - - -/* slapstic 137412-105: Indiana Jones/Paperboy (confirmed) */ -static const struct slapstic_data slapstic105 = -{ - /* basic banking */ - 3, /* starting bank */ - { 0x0010,0x0014,0x0018,0x001c }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x003d }, /* 1st mask/value in sequence */ - { 0x3fff,0x0092 }, /* 2nd mask/value in sequence */ - { 0x3ffc,0x00a4 }, /* 3rd mask/value in sequence */ - { 0x3ff3,0x0010 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - { 0x3ff0,0x35b0 }, /* 1st mask/value in sequence */ - { 0x3ff3,0x35b0 }, /* clear bit 0 value */ - { 0x3ff3,0x35b1 }, /* set bit 0 value */ - { 0x3ff3,0x35b2 }, /* clear bit 1 value */ - { 0x3ff3,0x35b3 }, /* set bit 1 value */ - { 0x3ff8,0x35c0 }, /* final mask/value in sequence */ - - /* additive banking */ - NO_ADDITIVE -}; - - -/* slapstic 137412-106: Gauntlet II (confirmed) */ -static const struct slapstic_data slapstic106 = -{ - /* basic banking */ - 3, /* starting bank */ - { 0x0008,0x000a,0x000c,0x000e }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x002b }, /* 1st mask/value in sequence */ - { 0x3fff,0x0052 }, /* 2nd mask/value in sequence */ - { 0x3ffc,0x0064 }, /* 3rd mask/value in sequence */ - { 0x3ff9,0x0008 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - { 0x3ff0,0x3da0 }, /* 1st mask/value in sequence */ - { 0x3ff3,0x3da0 }, /* clear bit 0 value */ - { 0x3ff3,0x3da1 }, /* set bit 0 value */ - { 0x3ff3,0x3da2 }, /* clear bit 1 value */ - { 0x3ff3,0x3da3 }, /* set bit 1 value */ - { 0x3ff8,0x3db0 }, /* final mask/value in sequence */ - - /* additive banking */ - NO_ADDITIVE -}; - - -/* slapstic 137412-107: Peter Packrat/Xybots/2p Gauntlet/720 (confirmed) */ -static const struct slapstic_data slapstic107 = -{ - /* basic banking */ - 3, /* starting bank */ - { 0x0018,0x001a,0x001c,0x001e }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x006b }, /* 1st mask/value in sequence */ - { 0x3fff,0x3d52 }, /* 2nd mask/value in sequence */ - { 0x3ffc,0x3d64 }, /* 3rd mask/value in sequence */ - { 0x3ff9,0x0018 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - { 0x3ff0,0x00a0 }, /* 1st mask/value in sequence */ - { 0x3ff3,0x00a0 }, /* clear bit 0 value */ - { 0x3ff3,0x00a1 }, /* set bit 0 value */ - { 0x3ff3,0x00a2 }, /* clear bit 1 value */ - { 0x3ff3,0x00a3 }, /* set bit 1 value */ - { 0x3ff8,0x00b0 }, /* final mask/value in sequence */ - - /* additive banking */ - NO_ADDITIVE -}; - - -/* slapstic 137412-108: Road Runner/Super Sprint (confirmed) */ -static const struct slapstic_data slapstic108 = -{ - /* basic banking */ - 3, /* starting bank */ - { 0x0028,0x002a,0x002c,0x002e }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x001f }, /* 1st mask/value in sequence */ - { 0x3fff,0x3772 }, /* 2nd mask/value in sequence */ - { 0x3ffc,0x3764 }, /* 3rd mask/value in sequence */ - { 0x3ff9,0x0028 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - { 0x3ff0,0x0060 }, /* 1st mask/value in sequence */ - { 0x3ff3,0x0060 }, /* clear bit 0 value */ - { 0x3ff3,0x0061 }, /* set bit 0 value */ - { 0x3ff3,0x0062 }, /* clear bit 1 value */ - { 0x3ff3,0x0063 }, /* set bit 1 value */ - { 0x3ff8,0x0070 }, /* final mask/value in sequence */ - - /* additive banking */ - NO_ADDITIVE -}; - - -/* slapstic 137412-109: Championship Sprint/Road Blasters (confirmed) */ -static const struct slapstic_data slapstic109 = -{ - /* basic banking */ - 3, /* starting bank */ - { 0x0008,0x000a,0x000c,0x000e }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x002b }, /* 1st mask/value in sequence */ - { 0x3fff,0x0052 }, /* 2nd mask/value in sequence */ - { 0x3ffc,0x0064 }, /* 3rd mask/value in sequence */ - { 0x3ff9,0x0008 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - { 0x3ff0,0x3da0 }, /* 1st mask/value in sequence */ - { 0x3ff3,0x3da0 }, /* clear bit 0 value */ - { 0x3ff3,0x3da1 }, /* set bit 0 value */ - { 0x3ff3,0x3da2 }, /* clear bit 1 value */ - { 0x3ff3,0x3da3 }, /* set bit 1 value */ - { 0x3ff8,0x3db0 }, /* final mask/value in sequence */ - - /* additive banking */ - NO_ADDITIVE -}; - - -/* slapstic 137412-110: Road Blasters/APB (confirmed) */ -static const struct slapstic_data slapstic110 = -{ - /* basic banking */ - 3, /* starting bank */ - { 0x0040,0x0050,0x0060,0x0070 }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x002d }, /* 1st mask/value in sequence */ - { 0x3fff,0x3d14 }, /* 2nd mask/value in sequence */ - { 0x3ffc,0x3d24 }, /* 3rd mask/value in sequence */ - { 0x3fcf,0x0040 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - { 0x3ff0,0x34c0 }, /* 1st mask/value in sequence */ - { 0x3ff3,0x34c0 }, /* clear bit 0 value */ - { 0x3ff3,0x34c1 }, /* set bit 0 value */ - { 0x3ff3,0x34c2 }, /* clear bit 1 value */ - { 0x3ff3,0x34c3 }, /* set bit 1 value */ - { 0x3ff8,0x34d0 }, /* final mask/value in sequence */ - - /* additive banking */ - NO_ADDITIVE -}; - - -/************************************* - * - * Slapstic-2 definitions - * - *************************************/ - -/* slapstic 137412-111: Pit Fighter (confirmed) */ -static const struct slapstic_data slapstic111 = -{ - /* basic banking */ - 0, /* starting bank */ - { 0x0042,0x0052,0x0062,0x0072 }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x000a }, /* 1st mask/value in sequence */ - { 0x3fff,0x28a4 }, /* 2nd mask/value in sequence */ - { 0x0784,0x0080 }, /* 3rd mask/value in sequence */ - { 0x3fcf,0x0042 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - NO_BITWISE, - - /* additive banking */ - { 0x3fff,0x00a1 }, /* 1st mask/value in sequence */ - { 0x3fff,0x00a2 }, /* 2nd mask/value in sequence */ - { 0x3c4f,0x284d }, /* +1 mask/value */ - { 0x3a5f,0x285d }, /* +2 mask/value */ - { 0x3ff8,0x2800 } /* final mask/value in sequence */ -}; - - -/* slapstic 137412-112: Pit Fighter (Japan) (confirmed) */ -static const struct slapstic_data slapstic112 = -{ - /* basic banking */ - 0, /* starting bank */ - { 0x002c,0x003c,0x006c,0x007c }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x0014 }, /* 1st mask/value in sequence */ - { 0x3fff,0x29a0 }, /* 2nd mask/value in sequence */ - { 0x0073,0x0010 }, /* 3rd mask/value in sequence */ - { 0x3faf,0x002c }, /* 4th mask/value in sequence */ - 2, /* shift to get bank from 3rd */ - - /* bitwise banking */ - NO_BITWISE, - - /* additive banking */ - { 0x3fff,0x2dce }, /* 1st mask/value in sequence */ - { 0x3fff,0x2dcf }, /* 2nd mask/value in sequence */ - { 0x3def,0x15e2 }, /* +1 mask/value */ - { 0x3fbf,0x15a2 }, /* +2 mask/value */ - { 0x3ffc,0x1450 } /* final mask/value in sequence */ -}; - - -/* slapstic 137412-113: Unknown (Europe) (confirmed) */ -static const struct slapstic_data slapstic113 = -{ - /* basic banking */ - 0, /* starting bank */ - { 0x0008,0x0018,0x0028,0x0038 }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x0059 }, /* 1st mask/value in sequence */ - { 0x3fff,0x11a5 }, /* 2nd mask/value in sequence */ - { 0x0860,0x0800 }, /* 3rd mask/value in sequence */ - { 0x3fcf,0x0008 }, /* 4th mask/value in sequence */ - 3, /* shift to get bank from 3rd */ - - /* bitwise banking */ - NO_BITWISE, - - /* additive banking */ - { 0x3fff,0x049b }, /* 1st mask/value in sequence */ - { 0x3fff,0x049c }, /* 2nd mask/value in sequence */ - { 0x3fcf,0x3ec7 }, /* +1 mask/value */ - { 0x3edf,0x3ed7 }, /* +2 mask/value */ - { 0x3fff,0x3fb2 } /* final mask/value in sequence */ -}; - - -/* slapstic 137412-114: Pit Fighter (rev 9) (confirmed) */ -static const struct slapstic_data slapstic114 = -{ - /* basic banking */ - 0, /* starting bank */ - { 0x0040,0x0048,0x0050,0x0058 }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x0016 }, /* 1st mask/value in sequence */ - { 0x3fff,0x24de }, /* 2nd mask/value in sequence */ - { 0x3871,0x0000 }, /* 3rd mask/value in sequence */ - { 0x3fe7,0x0040 }, /* 4th mask/value in sequence */ - 1, /* shift to get bank from 3rd */ - - /* bitwise banking */ - NO_BITWISE, - - /* additive banking */ - { 0x3fff,0x0ab7 }, /* 1st mask/value in sequence */ - { 0x3fff,0x0ab8 }, /* 2nd mask/value in sequence */ - { 0x3f63,0x0d40 }, /* +1 mask/value */ - { 0x3fd9,0x0dc8 }, /* +2 mask/value */ - { 0x3fff,0x0ab0 } /* final mask/value in sequence */ -}; - - -/* slapstic 137412-115: Race Drivin' DSK board (confirmed) */ -static const struct slapstic_data slapstic115 = -{ - /* basic banking */ - 0, /* starting bank */ - { 0x0020,0x0022,0x0024,0x0026 }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x0054 }, /* 1st mask/value in sequence */ - { 0x3fff,0x3e01 }, /* 2nd mask/value in sequence */ - { 0x3879,0x0029 }, /* 3rd mask/value in sequence */ - { 0x3ff9,0x0020 }, /* 4th mask/value in sequence */ - 1, /* shift to get bank from 3rd */ - - /* bitwise banking */ - NO_BITWISE, - - /* additive banking */ - { 0x3fff,0x2591 }, /* 1st mask/value in sequence */ - { 0x3fff,0x2592 }, /* 2nd mask/value in sequence */ - { 0x3fe6,0x3402 }, /* +1 mask/value */ - { 0x3fb4,0x3410 }, /* +2 mask/value */ - { 0x3fff,0x34a2 } /* final mask/value in sequence */ -}; - - -/* slapstic 137412-116: Hydra (confirmed) */ -static const struct slapstic_data slapstic116 = -{ - /* basic banking */ - 0, /* starting bank */ - { 0x0044,0x004c,0x0054,0x005c }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x0069 }, /* 1st mask/value in sequence */ - { 0x3fff,0x2bab }, /* 2nd mask/value in sequence */ - { 0x387c,0x0808 }, /* 3rd mask/value in sequence */ - { 0x3fe7,0x0044 }, /* 4th mask/value in sequence */ - 0, /* shift to get bank from 3rd */ - - /* bitwise banking */ - NO_BITWISE, - - /* additive banking */ - { 0x3fff,0x3f7c }, /* 1st mask/value in sequence */ - { 0x3fff,0x3f7d }, /* 2nd mask/value in sequence */ - { 0x3db2,0x3c12 }, /* +1 mask/value */ - { 0x3fe3,0x3e43 }, /* +2 mask/value */ - { 0x3fff,0x2ba8 } /* final mask/value in sequence */ -}; - - -/* slapstic 137412-117: Race Drivin' main board (confirmed) */ -static const struct slapstic_data slapstic117 = -{ - /* basic banking */ - 0, /* starting bank */ - { 0x0008,0x001a,0x002c,0x003e }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x007d }, /* 1st mask/value in sequence */ - { 0x3fff,0x3580 }, /* 2nd mask/value in sequence */ - { 0x0079,0x0020 }, /* 3rd mask/value in sequence */ - { 0x3fc9,0x0008 }, /* 4th mask/value in sequence */ - 1, /* shift to get bank from 3rd */ - - /* bitwise banking */ - NO_BITWISE, - - /* additive banking */ - { 0x3fff,0x0676 }, /* 1st mask/value in sequence */ - { 0x3fff,0x0677 }, /* 2nd mask/value in sequence */ - { 0x3e62,0x1a42 }, /* +1 mask/value */ - { 0x3e35,0x1a11 }, /* +2 mask/value */ - { 0x3fff,0x1a42 } /* final mask/value in sequence */ -}; - - -/* slapstic 137412-118: Rampart/Vindicators II (confirmed) */ -static const struct slapstic_data slapstic118 = -{ - /* basic banking */ - 0, /* starting bank */ - { 0x0014,0x0034,0x0054,0x0074 }, /* bank select values */ - - /* alternate banking */ - { 0x007f,0x0002 }, /* 1st mask/value in sequence */ - { 0x3fff,0x1950 }, /* 2nd mask/value in sequence */ - { 0x0067,0x0020 }, /* 3rd mask/value in sequence */ - { 0x3f9f,0x0014 }, /* 4th mask/value in sequence */ - 3, /* shift to get bank from 3rd */ - - /* bitwise banking */ - NO_BITWISE, - - /* additive banking */ - { 0x3fff,0x1958 }, /* 1st mask/value in sequence */ - { 0x3fff,0x1959 }, /* 2nd mask/value in sequence */ - { 0x3f73,0x3052 }, /* +1 mask/value */ - { 0x3f67,0x3042 }, /* +2 mask/value */ - { 0x3ff8,0x30e0 } /* final mask/value in sequence */ -}; - - -/************************************* - * - * Master slapstic table - * - *************************************/ - -/* master table */ -static const struct slapstic_data *const slapstic_table[] = -{ - &slapstic101, /* NOT confirmed! */ - NULL, /* never seen */ - &slapstic103, - &slapstic104, - &slapstic105, - &slapstic106, - &slapstic107, - &slapstic108, - &slapstic109, - &slapstic110, - &slapstic111, - &slapstic112, - &slapstic113, - &slapstic114, - &slapstic115, - &slapstic116, - &slapstic117, - &slapstic118 -}; - - -/************************************* - * - * Statics - * - *************************************/ - -static UINT8 state; -static UINT8 current_bank; -static UINT8 access_68k; - -static UINT8 alt_bank; -static UINT8 bit_bank; -static UINT8 add_bank; -static UINT8 bit_xor; - -static struct slapstic_data slapstic; - - -/************************************* - * - * Initialization - * - *************************************/ - -void SlapsticReset(void) -{ -#if defined FBA_DEBUG - if (!DebugDev_SlapsticInitted) bprintf(PRINT_ERROR, _T("SlapsticReset called without init\n")); -#endif - - /* reset the chip */ - state = DISABLED; - - /* the 111 and later chips seem to reset to bank 0 */ - current_bank = slapstic.bankstart; -} - - -void SlapsticInit(INT32 chip) -{ - DebugDev_SlapsticInitted = 1; - - /* only a small number of chips are known to exist */ - if (chip < 101 || chip > 118) - return; - - /* set up the parameters */ - if (!slapstic_table[chip - 101]) - return; - - slapstic = *slapstic_table[chip - 101]; - - /* reset the chip */ - SlapsticReset(); - - /* see if we're 68k or 6502/6809 based */ - extern INT32 nSekCount; - access_68k = (nSekCount != -1); // Ok? -} - -void SlapsticExit() -{ -#if defined FBA_DEBUG - if (!DebugDev_SlapsticInitted) bprintf(PRINT_ERROR, _T("SlapsticExit called without init\n")); -#endif - - DebugDev_SlapsticInitted = 0; -} - -/************************************* - * - * Returns active bank without tweaking - * - *************************************/ - -INT32 SlapsticBank(void) -{ -#if defined FBA_DEBUG - if (!DebugDev_SlapsticInitted) bprintf(PRINT_ERROR, _T("SlapsticBank called without init\n")); -#endif - - return current_bank; -} - - -/************************************* - * - * Kludge to catch alt seqeuences - * - *************************************/ - -static INT32 alt2_kludge(UINT32 /*offset*/) -{ - /* Of the 3 alternate addresses, only the middle one needs to actually hit - in the slapstic region; the first and third ones can be anywhere in the - address space. For this reason, the read/write handlers usually only - see the 2nd access. For the 68000-based games, we do the following - kludge to examine the opcode that is executing and look for the 1st - and 3rd accesses. */ - if (access_68k) - { - static const SekRegister SekRegs1[8] = { SEK_REG_A0, SEK_REG_A1, SEK_REG_A2, SEK_REG_A3, SEK_REG_A4, SEK_REG_A5, SEK_REG_A6, SEK_REG_A7 }; - - /* first verify that the prefetched PC matches the first alternate */ - if (MATCHES_MASK_VALUE((INT32)(SekGetPC(-1) >> 1), slapstic.alt1)) - { - /* now look for a move.w (An),(An) or cmpm.w (An)+,(An)+ */ - UINT16 opcode = SekFetchWord((SekGetPC(-1) - 4) & 0xffffff); // IQ_132 check this! - // UINT16 opcode = space->direct().read_decrypted_word(cpu_get_previouspc(&space->device()) & 0xffffff); - if ((opcode & 0xf1f8) == 0x3090 || (opcode & 0xf1f8) == 0xb148) - { - /* fetch the value of the register for the second operand, and see */ - /* if it matches the third alternate */ - UINT32 regval = SekDbgGetRegister(SekRegs1[((opcode >> 9) & 7)]) >> 1; - if (MATCHES_MASK_VALUE((INT32)regval, slapstic.alt3)) - { - alt_bank = (regval >> slapstic.altshift) & 3; - return ALTERNATE3; - } - } - } - - /* if there's no second memory hit within this instruction, the next */ - /* opcode fetch will botch the operation, so just fall back to */ - /* the enabled state */ - return ENABLED; - } - - /* kludge for ESB */ - return ALTERNATE2; -} - - -/************************************* - * - * Call this *after* every access - * - *************************************/ - -INT32 SlapsticTweak(INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugDev_SlapsticInitted) bprintf(PRINT_ERROR, _T("SlapsticTweak called without init\n")); -#endif - - /* reset is universal */ - if (offset == 0x0000) - { - state = ENABLED; - } - - /* otherwise, use the state machine */ - else - { - switch (state) - { - /* DISABLED state: everything is ignored except a reset */ - case DISABLED: - break; - - /* ENABLED state: the chip has been activated and is ready for a bankswitch */ - case ENABLED: - - /* check for request to enter bitwise state */ - if (MATCHES_MASK_VALUE(offset, slapstic.bit1)) - { - state = BITWISE1; - } - - /* check for request to enter additive state */ - else if (MATCHES_MASK_VALUE(offset, slapstic.add1)) - { - state = ADDITIVE1; - } - - /* check for request to enter alternate state */ - else if (MATCHES_MASK_VALUE(offset, slapstic.alt1)) - { - state = ALTERNATE1; - } - - /* special kludge for catching the second alternate address if */ - /* the first one was missed (since it's usually an opcode fetch) */ - else if (MATCHES_MASK_VALUE(offset, slapstic.alt2)) - { - state = alt2_kludge(offset); - } - - /* check for standard bankswitches */ - else if (offset == slapstic.bank[0]) - { - state = DISABLED; - current_bank = 0; - } - else if (offset == slapstic.bank[1]) - { - state = DISABLED; - current_bank = 1; - } - else if (offset == slapstic.bank[2]) - { - state = DISABLED; - current_bank = 2; - } - else if (offset == slapstic.bank[3]) - { - state = DISABLED; - current_bank = 3; - } - break; - - /* ALTERNATE1 state: look for alternate2 offset, or else fall back to ENABLED */ - case ALTERNATE1: - if (MATCHES_MASK_VALUE(offset, slapstic.alt2)) - { - state = ALTERNATE2; - } - else - { - state = ENABLED; - } - break; - - /* ALTERNATE2 state: look for altbank offset, or else fall back to ENABLED */ - case ALTERNATE2: - if (MATCHES_MASK_VALUE(offset, slapstic.alt3)) - { - state = ALTERNATE3; - alt_bank = (offset >> slapstic.altshift) & 3; - } - else - { - state = ENABLED; - } - break; - - /* ALTERNATE3 state: wait for the final value to finish the transaction */ - case ALTERNATE3: - if (MATCHES_MASK_VALUE(offset, slapstic.alt4)) - { - state = DISABLED; - current_bank = alt_bank; - } - break; - - /* BITWISE1 state: waiting for a bank to enter the BITWISE state */ - case BITWISE1: - if (offset == slapstic.bank[0] || offset == slapstic.bank[1] || - offset == slapstic.bank[2] || offset == slapstic.bank[3]) - { - state = BITWISE2; - bit_bank = current_bank; - bit_xor = 0; - } - break; - - /* BITWISE2 state: watch for twiddling and the escape mechanism */ - case BITWISE2: - - /* check for clear bit 0 case */ - if (MATCHES_MASK_VALUE(offset ^ bit_xor, slapstic.bit2c0)) - { - bit_bank &= ~1; - bit_xor ^= 3; - } - - /* check for set bit 0 case */ - else if (MATCHES_MASK_VALUE(offset ^ bit_xor, slapstic.bit2s0)) - { - bit_bank |= 1; - bit_xor ^= 3; - } - - /* check for clear bit 1 case */ - else if (MATCHES_MASK_VALUE(offset ^ bit_xor, slapstic.bit2c1)) - { - bit_bank &= ~2; - bit_xor ^= 3; - } - - /* check for set bit 1 case */ - else if (MATCHES_MASK_VALUE(offset ^ bit_xor, slapstic.bit2s1)) - { - bit_bank |= 2; - bit_xor ^= 3; - } - - /* check for escape case */ - else if (MATCHES_MASK_VALUE(offset, slapstic.bit3)) - { - state = BITWISE3; - } - break; - - /* BITWISE3 state: waiting for a bank to seal the deal */ - case BITWISE3: - if (offset == slapstic.bank[0] || offset == slapstic.bank[1] || - offset == slapstic.bank[2] || offset == slapstic.bank[3]) - { - state = DISABLED; - current_bank = bit_bank; - } - break; - - /* ADDITIVE1 state: look for add2 offset, or else fall back to ENABLED */ - case ADDITIVE1: - if (MATCHES_MASK_VALUE(offset, slapstic.add2)) - { - state = ADDITIVE2; - add_bank = current_bank; - } - else - { - state = ENABLED; - } - break; - - /* ADDITIVE2 state: watch for twiddling and the escape mechanism */ - case ADDITIVE2: - - /* check for add 1 case -- can intermix */ - if (MATCHES_MASK_VALUE(offset, slapstic.addplus1)) - { - add_bank = (add_bank + 1) & 3; - } - - /* check for add 2 case -- can intermix */ - if (MATCHES_MASK_VALUE(offset, slapstic.addplus2)) - { - add_bank = (add_bank + 2) & 3; - } - - /* check for escape case -- can intermix with the above */ - if (MATCHES_MASK_VALUE(offset, slapstic.add3)) - { - state = ADDITIVE3; - } - break; - - /* ADDITIVE3 state: waiting for a bank to seal the deal */ - case ADDITIVE3: - if (offset == slapstic.bank[0] || offset == slapstic.bank[1] || - offset == slapstic.bank[2] || offset == slapstic.bank[3]) - { - state = DISABLED; - current_bank = add_bank; - } - break; - } - } - - /* return the active bank */ - return current_bank; -} - - -void SlapsticScan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugDev_SlapsticInitted) bprintf(PRINT_ERROR, _T("SlapsticScan called without init\n")); -#endif - - if (nAction & ACB_NVRAM) { - SCAN_VAR(state); - SCAN_VAR(current_bank); - SCAN_VAR(alt_bank); - SCAN_VAR(bit_bank); - SCAN_VAR(add_bank); - SCAN_VAR(bit_xor); - } -} diff --git a/jan/src/burn/devices/slapstic.h b/jan/src/burn/devices/slapstic.h deleted file mode 100644 index dcfa7aadf..000000000 --- a/jan/src/burn/devices/slapstic.h +++ /dev/null @@ -1,19 +0,0 @@ -/************************************************************************* - - Atari Slapstic decoding helper - -************************************************************************** - - For more information on the slapstic, see slapstic.html, or go to - http://www.aarongiles.com/slapstic.html - -*************************************************************************/ - -void SlapsticInit(INT32 chip); -void SlapsticExit(); -void SlapsticReset(void); - -INT32 SlapsticBank(void); -INT32 SlapsticTweak(INT32 offset); - -void SlapsticScan(INT32 nAction); diff --git a/jan/src/burn/devices/st0020.cpp b/jan/src/burn/devices/st0020.cpp deleted file mode 100644 index 03e098d16..000000000 --- a/jan/src/burn/devices/st0020.cpp +++ /dev/null @@ -1,184 +0,0 @@ -// Based on MAME sources by Luca Elia,David Haywood - -#include "tiles_generic.h" -#include "st0020.h" - -// directly map sprite ram - -UINT8 *st0020BlitRAM; -UINT8 *st0020SprRAM; -UINT8 *st0020GfxRAM; -UINT8 *st0020GfxROM; -INT32 st0020GfxROMLen; - -static INT32 is_jclub2 = 0; -static INT32 is_st0032 = 0; - -UINT16 st0020GfxramReadWord(UINT32 offset) -{ - INT32 bank = (st0020BlitRAM[0x8a] & 3) * 0x100000; - - UINT16 *ram = (UINT16*)(st0020GfxRAM + (offset & 0xfffff) + bank); - - return (ram[0] << 8) | (ram[0] >> 8); -} - -UINT8 st0020GfxramReadByte(UINT32 offset) -{ - INT32 bank = (st0020BlitRAM[0x8a] & 3) * 0x100000; - - return st0020GfxRAM[((offset & 0xfffff) + bank)^1]; -} - -void st0020GfxramWriteByte(UINT32 offset, UINT8 data) -{ - INT32 bank = (st0020BlitRAM[0x8a] & 3) * 0x100000; - - st0020GfxRAM[((offset & 0xfffff) + bank) ^ 1] = data; -} - -void st0020GfxramWriteWord(UINT32 offset, UINT16 data) -{ - INT32 bank = (st0020BlitRAM[0x8a] & 3) * 0x100000; - - UINT16 *ram = (UINT16*)(st0020GfxRAM + (offset & 0xfffff) + bank); - - data = (data << 8) | (data >> 8); - - ram[0] = data; -} - -static void st0020_blitter_write() -{ - UINT16 *st0020_blitram = (UINT16*)st0020BlitRAM; - UINT16 *st0020_gfxram = (UINT16*)st0020GfxRAM; - - UINT32 src = (st0020_blitram[0xc0/2] + (st0020_blitram[0xc2/2] << 16)) << 1; - UINT32 dst = (st0020_blitram[0xc4/2] + (st0020_blitram[0xc6/2] << 16)) << 4; - UINT32 len = (st0020_blitram[0xc8/2]) << 4; - UINT32 size = st0020GfxROMLen; - - dst &= 0x3fffff; - src &= 0xffffff; - - if ((src+len <= size) && (dst+len <= 4 * 0x100000) ) - { - memcpy( &st0020_gfxram[dst/2], &st0020GfxROM[src], len ); - } -} - -void st0020_blitram_write_word(UINT32 offset, UINT16 data) -{ - UINT16 *st0020_blitram = (UINT16*)st0020BlitRAM; - - st0020_blitram[(offset/2)&0x7f] = data; - - if ((offset & 0xfe) == 0xca) st0020_blitter_write(); -} - -UINT16 st0020_blitram_read_word(UINT32 offset) -{ - UINT16 *st0020_blitram = (UINT16*)st0020BlitRAM; - - return st0020_blitram[(offset/2)&0x7f]; -} - -void st0020_blitram_write_byte(UINT32 offset, UINT8 data) -{ - st0020BlitRAM[(offset & 0xff)] = data; - if ((offset & 0xfe) == 0xca) st0020_blitter_write(); -} - -static void st0020_draw_zooming_sprites(INT32 priority) -{ - UINT16 *spriteram16_2 = (UINT16*)st0020SprRAM; - UINT16 *s1 = spriteram16_2; - UINT16 *end1 = spriteram16_2 + 0x02000/2; - - const INT32 ramoffs[2][4] = { { 0, 1, 2, 3 }, { 2, 3, 1, 0 } }; - - priority <<= 4; - - for ( ; s1 < end1; s1+=8/2 ) - { - int attr, code, color, num, sprite, zoom, size; - int sx, x, xoffs, flipx, xnum, xstart, xend, xinc, xdim, xscale; - int sy, y, yoffs, flipy, ynum, ystart, yend, yinc, ydim, yscale; - - xoffs = s1[ ramoffs[is_st0032][0] ]; - yoffs = s1[ ramoffs[is_st0032][1] ]; - sprite = s1[ ramoffs[is_st0032][2] ]; - num = s1[ ramoffs[is_st0032][3] ] % 0x101; // how many? - - if (sprite & 0x8000) break; - - int s2 = 0; - int spritebase = (sprite & 0x7fff) * 16/2; - - for( ; num > 0; num--,s2+=16/2 ) - { - code = spriteram16_2[(spritebase + s2 + 0 )&0x3ffff]; - attr = spriteram16_2[(spritebase + s2 + 1 )&0x3ffff]; - sx = spriteram16_2[(spritebase + s2 + 2 )&0x3ffff]; - sy = spriteram16_2[(spritebase + s2 + 3 )&0x3ffff]; - zoom = spriteram16_2[(spritebase + s2 + 4 )&0x3ffff]; - size = spriteram16_2[(spritebase + s2 + 5 )&0x3ffff]; - - if (priority != (size & 0xf0)) - break; - - flipx = (attr & 0x8000); - flipy = (attr & 0x4000); - - color = (attr & 0x0400) ? attr : attr * 4; - - xnum = 1 << ((size >> 0) & 3); - ynum = 1 << ((size >> 2) & 3); - - xnum = (xnum + 1) / 2; - - if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; } - else { xstart = 0; xend = xnum; xinc = +1; } - - if (flipy) { ystart = ynum-1; yend = -1; yinc = -1; } - else { ystart = 0; yend = ynum; yinc = +1; } - - sx += xoffs; - sy += yoffs; - - sx = (sx & 0x1ff) - (sx & 0x200); - sy = (sy & 0x1ff) - (sy & 0x200); - - sy = -sy; - - if (is_jclub2) - sy += 0x100; - - sx <<= 16; - sy <<= 16; - - xdim = ( ( ((zoom >> 0) & 0xff) + 1) << 16 ) / xnum; - ydim = ( ( ((zoom >> 8) & 0xff) + 1) << 16 ) / ynum; - - xscale = xdim / 16; - yscale = ydim / 8; - - if (xscale & 0xffff) xscale += (1<<16) / 16; - if (yscale & 0xffff) yscale += (1<<16) / 8; - - for (x = xstart; x != xend; x += xinc) - { - for (y = ystart; y != yend; y += yinc, code++) - { - RenderZoomedTile(pTransDraw, st0020GfxRAM, code % (0x400000/0x80), color * 64, 0, (sx + x * xdim) / 0x10000, (sy + y * ydim) / 0x10000, flipx, flipy, 16, 8, xscale, yscale); - } - } - } - } -} - -void st0020Draw() -{ - for (int pri = 0; pri < 0x10; pri++) - st0020_draw_zooming_sprites(pri); -} diff --git a/jan/src/burn/devices/st0020.h b/jan/src/burn/devices/st0020.h deleted file mode 100644 index 0d231669a..000000000 --- a/jan/src/burn/devices/st0020.h +++ /dev/null @@ -1,15 +0,0 @@ -extern UINT8 *st0020BlitRAM; // 0x100 bytes -extern UINT8 *st0020SprRAM; // 0x80000 bytes -extern UINT8 *st0020GfxRAM; // 0x400000 bytes -extern UINT8 *st0020GfxROM; -extern INT32 st0020GfxROMLen; - -UINT16 st0020GfxramReadWord(UINT32 offset); -UINT8 st0020GfxramReadByte(UINT32 offset); -void st0020GfxramWriteByte(UINT32 offset, UINT8 data); -void st0020GfxramWriteWord(UINT32 offset, UINT16 data); - -void st0020_blitram_write_word(UINT32 offset, UINT16 data); -void st0020_blitram_write_byte(UINT32 offset, UINT8 data); -UINT16 st0020_blitram_read_word(UINT32 offset); -void st0020Draw(); diff --git a/jan/src/burn/devices/t5182.cpp b/jan/src/burn/devices/t5182.cpp deleted file mode 100644 index bf5ce693e..000000000 --- a/jan/src/burn/devices/t5182.cpp +++ /dev/null @@ -1,222 +0,0 @@ -// FB Alpha t5182 core -// Based on MAME sources by Jonathan Gevaryahu - -#include "burnint.h" -#include "t5182.h" -#include "z80_intf.h" -#include "burn_ym2151.h" - -// only used in t5182.c -static INT32 irqstate; -static UINT8 *t5182RAM = NULL; - -static INT32 nCPU; -static INT32 coin_frame; - -// use externally -UINT8 *t5182SharedRAM = NULL; // allocate externally -UINT8 *t5182ROM = NULL; // allocate externally - -UINT8 t5182_semaphore_snd = 0; -UINT8 t5182_semaphore_main = 0; -UINT8 t5182_coin_input; - -void t5182_setirq_callback(INT32 param) -{ -#if defined FBA_DEBUG - if (!DebugDev_T5182Initted) bprintf(PRINT_ERROR, _T("t5182_setirq_callback called without init\n")); -#endif - - switch (param) - { - case YM2151_ASSERT: - irqstate |= 1|4; - break; - - case YM2151_CLEAR: - irqstate &= ~1; - break; - - case YM2151_ACK: - irqstate &= ~4; - break; - - case CPU_ASSERT: - irqstate |= 2; - break; - - case CPU_CLEAR: - irqstate &= ~2; - break; - } - - ZetSetIRQLine(0, (irqstate) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - - -static void __fastcall t5182_port_write(UINT16 p, UINT8 d) -{ - switch (p & 0xff) - { - case 0x00: - BurnYM2151SelectRegister(d); - return; - - case 0x01: - BurnYM2151WriteRegister(d); - return; - - case 0x10: - case 0x11: - t5182_semaphore_snd = ~p & 1; - return; - - case 0x12: - t5182_setirq_callback(YM2151_ACK); - return; - - case 0x13: - t5182_setirq_callback(CPU_CLEAR); - return; - } -} - -static UINT8 __fastcall t5182_port_read(UINT16 p) -{ - switch (p & 0xff) - { - case 0x00: - case 0x01: - return BurnYM2151ReadStatus(); - - case 0x20: - return t5182_semaphore_main | (irqstate & 2); - - case 0x30: { - // hack to make coins pulse - if (t5182_coin_input == 0) { - coin_frame = 0; - } else { - if (coin_frame == 0) { - coin_frame = GetCurrentFrame(); - } else { - if ((GetCurrentFrame() - coin_frame) >= 2) { - return 0; // no coins - } - } - } - return t5182_coin_input; - } - } - - return 0; -} - -static void t5182YM2151IrqHandler(INT32 Irq) -{ - t5182_setirq_callback((Irq) ? YM2151_ASSERT : YM2151_CLEAR); -} - -void t5182Reset() -{ -#if defined FBA_DEBUG - if (!DebugDev_T5182Initted) bprintf(PRINT_ERROR, _T("t5182Reset called without init\n")); -#endif - - ZetOpen(nCPU); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - t5182_semaphore_snd = 0; - t5182_semaphore_main = 0; - - coin_frame = 0; - - irqstate = 0; -} - -void t5182Init(INT32 nZ80CPU, INT32 clock) -{ - DebugDev_T5182Initted = 1; - - nCPU = nZ80CPU; - - t5182RAM = (UINT8*)BurnMalloc(0x800); - - ZetInit(nCPU); - ZetOpen(nCPU); - ZetMapMemory(t5182ROM + 0x0000, 0x0000, 0x1fff, MAP_ROM); - - for (INT32 i = 0x2000; i < 0x4000; i += 0x800) { - ZetMapMemory(t5182RAM, i, i + 0x7ff, MAP_RAM); // internal ram - } - - for (INT32 i = 0x4000; i < 0x8000; i += 0x100) { - ZetMapMemory(t5182SharedRAM, i, i + 0x0ff, MAP_RAM); // shared ram - } - - ZetMapMemory(t5182ROM + 0x8000, 0x8000, 0xffff, MAP_ROM); // external rom - - ZetSetOutHandler(t5182_port_write); - ZetSetInHandler(t5182_port_read); - ZetClose(); - - BurnYM2151Init(clock); - BurnYM2151SetIrqHandler(&t5182YM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); -} - -void t5182Exit() -{ -#if defined FBA_DEBUG - if (!DebugDev_T5182Initted) bprintf(PRINT_ERROR, _T("t5182Exit called without init\n")); -#endif - - if (!DebugDev_T5182Initted) return; - - BurnYM2151Exit(); - - if (nHasZet > 0) { - ZetExit(); - } - - BurnFree (t5182RAM); - - t5182SharedRAM = NULL; - t5182RAM = NULL; - t5182ROM = NULL; - - DebugDev_T5182Initted = 0; -} - -INT32 t5182Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugDev_T5182Initted) bprintf(PRINT_ERROR, _T("t5182Scan called without init\n")); -#endif - - struct BurnArea ba; - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = t5182RAM; - ba.nLen = 0x00800; - ba.szName = "t5182 RAM"; - BurnAcb(&ba); - - if (nCPU == 0) { // if this is z80 #0, it is likely the only one - ZetScan(nAction); - } - - BurnYM2151Scan(nAction); - - SCAN_VAR(t5182_semaphore_snd); - SCAN_VAR(t5182_semaphore_main); - SCAN_VAR(irqstate); - } - - return 0; -} diff --git a/jan/src/burn/devices/t5182.h b/jan/src/burn/devices/t5182.h deleted file mode 100644 index ca020387e..000000000 --- a/jan/src/burn/devices/t5182.h +++ /dev/null @@ -1,25 +0,0 @@ - -#define T5182_CLOCK (14318180/4) - -enum -{ - VECTOR_INIT, - YM2151_ASSERT, - YM2151_CLEAR, - YM2151_ACK, - CPU_ASSERT, - CPU_CLEAR -}; - -extern UINT8 *t5182SharedRAM; // allocate in driver -extern UINT8 *t5182ROM; // allocate in driver -extern UINT8 t5182_semaphore_snd; -extern UINT8 t5182_semaphore_main; -extern UINT8 t5182_coin_input; // coin input in driver - -void t5182_setirq_callback(INT32 param); - -void t5182Reset(); -void t5182Init(INT32 nZ80CPU, INT32 clock); -void t5182Exit(); -INT32 t5182Scan(INT32 nAction); diff --git a/jan/src/burn/devices/timekpr.cpp b/jan/src/burn/devices/timekpr.cpp deleted file mode 100644 index 9ba39050a..000000000 --- a/jan/src/burn/devices/timekpr.cpp +++ /dev/null @@ -1,401 +0,0 @@ -// Based on MAME sources by Aaron Giles,smf - -#include "burnint.h" -#include "time.h" -#include "timekpr.h" - -typedef struct -{ - UINT8 control; - UINT8 seconds; - UINT8 minutes; - UINT8 hours; - UINT8 day; - UINT8 date; - UINT8 month; - UINT8 year; - UINT8 century; - UINT8 *data; - INT32 type; - INT32 size; - INT32 offset_control; - INT32 offset_seconds; - INT32 offset_minutes; - INT32 offset_hours; - INT32 offset_day; - INT32 offset_date; - INT32 offset_month; - INT32 offset_year; - INT32 offset_century; - INT32 offset_flags; -} timekeeper_chip; - -static timekeeper_chip Chip; - -static INT32 AllocatedOwnDataArea = 0; - -#define MASK_SECONDS ( 0x7f ) -#define MASK_MINUTES ( 0x7f ) -#define MASK_HOURS ( 0x3f ) -#define MASK_DAY ( 0x07 ) -#define MASK_DATE ( 0x3f ) -#define MASK_MONTH ( 0x1f ) -#define MASK_YEAR ( 0xff ) -#define MASK_CENTURY ( 0xff ) - -#define CONTROL_W ( 0x80 ) -#define CONTROL_R ( 0x40 ) -#define CONTROL_S ( 0x20 ) /* not emulated */ -#define CONTROL_CALIBRATION ( 0x1f ) /* not emulated */ - -#define SECONDS_ST ( 0x80 ) - -#define DAY_FT ( 0x40 ) /* M48T37 - not emulated */ -#define DAY_CEB ( 0x20 ) /* M48T35/M48T58 */ -#define DAY_CB ( 0x10 ) /* M48T35/M48T58 */ - -#define DATE_BLE ( 0x80 ) /* M48T58: not emulated */ -#define DATE_BL ( 0x40 ) /* M48T58: not emulated */ - -#define FLAGS_BL ( 0x10 ) /* MK48T08/M48T37: not emulated */ -#define FLAGS_AF ( 0x40 ) /* M48T37: not emulated */ -#define FLAGS_WDF ( 0x80 ) /* M48T37: not emulated */ - -static inline UINT8 make_bcd(UINT8 data) -{ - return ( ( ( data / 10 ) % 10 ) << 4 ) + ( data % 10 ); -} - -static inline UINT8 from_bcd(UINT8 data) -{ - return ( ( ( data >> 4 ) & 15 ) * 10 ) + ( data & 15 ); -} - -static INT32 inc_bcd( UINT8 *data, INT32 mask, INT32 min, INT32 max ) -{ - INT32 bcd; - INT32 carry; - - bcd = ( *( data ) + 1 ) & mask; - carry = 0; - - if( ( bcd & 0x0f ) > 9 ) - { - bcd &= 0xf0; - bcd += 0x10; - if( bcd > max ) - { - bcd = min; - carry = 1; - } - } - - *( data ) = ( *( data ) & ~mask ) | ( bcd & mask ); - return carry; -} - -static void counter_to_ram(UINT8 *data, INT32 offset, INT32 counter) -{ - if( offset >= 0 ) - { - data[ offset ] = counter; - } -} - -static void counters_to_ram() -{ - counter_to_ram( Chip.data, Chip.offset_control, Chip.control ); - counter_to_ram( Chip.data, Chip.offset_seconds, Chip.seconds ); - counter_to_ram( Chip.data, Chip.offset_minutes, Chip.minutes ); - counter_to_ram( Chip.data, Chip.offset_hours, Chip.hours ); - counter_to_ram( Chip.data, Chip.offset_day, Chip.day ); - counter_to_ram( Chip.data, Chip.offset_date, Chip.date ); - counter_to_ram( Chip.data, Chip.offset_month, Chip.month ); - counter_to_ram( Chip.data, Chip.offset_year, Chip.year ); - counter_to_ram( Chip.data, Chip.offset_century, Chip.century ); -} - -static INT32 counter_from_ram(UINT8 *data, INT32 offset) -{ - if( offset >= 0 ) - { - return data[ offset ]; - } - return 0; -} - -static void counters_from_ram() -{ - Chip.control = counter_from_ram( Chip.data, Chip.offset_control ); - Chip.seconds = counter_from_ram( Chip.data, Chip.offset_seconds ); - Chip.minutes = counter_from_ram( Chip.data, Chip.offset_minutes ); - Chip.hours = counter_from_ram( Chip.data, Chip.offset_hours ); - Chip.day = counter_from_ram( Chip.data, Chip.offset_day ); - Chip.date = counter_from_ram( Chip.data, Chip.offset_date ); - Chip.month = counter_from_ram( Chip.data, Chip.offset_month ); - Chip.year = counter_from_ram( Chip.data, Chip.offset_year ); - Chip.century = counter_from_ram( Chip.data, Chip.offset_century ); -} - -UINT8 TimeKeeperRead(UINT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugDev_TimeKprInitted) bprintf(PRINT_ERROR, _T("TimeKeeperRead called without init\n")); -#endif - - return Chip.data[offset]; -} - -INT32 TimeKeeperIsEmpty() -{ -#if defined FBA_DEBUG - if (!DebugDev_TimeKprInitted) bprintf(PRINT_ERROR, _T("TimeKeeperIsEmpty called without init\n")); -#endif - - INT32 found = 0; - - for (INT32 i = 0; i < Chip.size; i++) { - if (Chip.data[i] != 0xff) - found = 1; - } - - return !found; -} - -UINT8* TimeKeeperGetRaw() -{ -#if defined FBA_DEBUG - if (!DebugDev_TimeKprInitted) bprintf(PRINT_ERROR, _T("TimeKeeperGetRaw called without init\n")); -#endif - - return Chip.data; -} - -void TimeKeeperWrite(INT32 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_TimeKprInitted) bprintf(PRINT_ERROR, _T("TimeKeeperWrite called without init\n")); -#endif - - if( offset == Chip.offset_control ) - { - if( ( Chip.control & CONTROL_W ) != 0 && - ( data & CONTROL_W ) == 0 ) - { - counters_from_ram(); - } - Chip.control = data; - } - else if( (Chip.type == TIMEKEEPER_M48T58 || Chip.type == TIMEKEEPER_M48T35) && offset == Chip.offset_day ) - { - Chip.day = ( Chip.day & ~DAY_CEB ) | ( data & DAY_CEB ); - } - - Chip.data[ offset ] = data; -} - -void TimeKeeperTick() -{ -#if defined FBA_DEBUG - if (!DebugDev_TimeKprInitted) bprintf(PRINT_ERROR, _T("TimeKeeperTick called without init\n")); -#endif - - INT32 carry; - - if( ( Chip.seconds & SECONDS_ST ) != 0 || - ( Chip.control & CONTROL_W ) != 0 ) - { - return; - } - - carry = inc_bcd( &Chip.seconds, MASK_SECONDS, 0x00, 0x59 ); - if( carry ) - { - carry = inc_bcd( &Chip.minutes, MASK_MINUTES, 0x00, 0x59 ); - } - if( carry ) - { - carry = inc_bcd( &Chip.hours, MASK_HOURS, 0x00, 0x23 ); - } - - if( carry ) - { - UINT8 month; - UINT8 year; - UINT8 maxdays; - static const UINT8 daysinmonth[] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; - - inc_bcd( &Chip.day, MASK_DAY, 0x01, 0x07 ); - - month = from_bcd( Chip.month ); - year = from_bcd( Chip.year ); - - if( month == 2 && ( year % 4 ) == 0 ) - { - maxdays = 0x29; - } - else if( month >= 1 && month <= 12 ) - { - maxdays = daysinmonth[ month - 1 ]; - } - else - { - maxdays = 0x31; - } - - carry = inc_bcd( &Chip.date, MASK_DATE, 0x01, maxdays ); - } - if( carry ) - { - carry = inc_bcd( &Chip.month, MASK_MONTH, 0x01, 0x12 ); - } - if( carry ) - { - carry = inc_bcd( &Chip.year, MASK_YEAR, 0x00, 0x99 ); - } - if( carry ) - { - carry = inc_bcd( &Chip.century, MASK_CENTURY, 0x00, 0x99 ); - if( (Chip.type == TIMEKEEPER_M48T58 || Chip.type == TIMEKEEPER_M48T35) && ( Chip.day & DAY_CEB ) != 0 ) - { - Chip.day ^= DAY_CB; - } - } - - if( ( Chip.control & CONTROL_R ) == 0 ) - { - counters_to_ram(); - } -} - -void TimeKeeperInit(INT32 type, UINT8 *data) -{ - DebugDev_TimeKprInitted = 1; - - time_t rawtime; - struct tm *timeinfo; - - Chip.type = type; - - switch( Chip.type ) - { - case TIMEKEEPER_M48T02: - Chip.offset_control = 0x7f8; - Chip.offset_seconds = 0x7f9; - Chip.offset_minutes = 0x7fa; - Chip.offset_hours = 0x7fb; - Chip.offset_day = 0x7fc; - Chip.offset_date = 0x7fd; - Chip.offset_month = 0x7fe; - Chip.offset_year = 0x7ff; - Chip.offset_century = -1; - Chip.offset_flags = -1; - Chip.size = 0x800; - break; - case TIMEKEEPER_M48T35: - Chip.offset_control = 0x7ff8; - Chip.offset_seconds = 0x7ff9; - Chip.offset_minutes = 0x7ffa; - Chip.offset_hours = 0x7ffb; - Chip.offset_day = 0x7ffc; - Chip.offset_date = 0x7ffd; - Chip.offset_month = 0x7ffe; - Chip.offset_year = 0x7fff; - Chip.offset_century = -1; - Chip.offset_flags = -1; - Chip.size = 0x8000; - break; - case TIMEKEEPER_M48T37: - Chip.offset_control = 0x7ff8; - Chip.offset_seconds = 0x7ff9; - Chip.offset_minutes = 0x7ffa; - Chip.offset_hours = 0x7ffb; - Chip.offset_day = 0x7ffc; - Chip.offset_date = 0x7ffd; - Chip.offset_month = 0x7ffe; - Chip.offset_year = 0x7fff; - Chip.offset_century = 0x7ff1; - Chip.offset_flags = 0x7ff0; - Chip.size = 0x8000; - break; - case TIMEKEEPER_M48T58: - Chip.offset_control = 0x1ff8; - Chip.offset_seconds = 0x1ff9; - Chip.offset_minutes = 0x1ffa; - Chip.offset_hours = 0x1ffb; - Chip.offset_day = 0x1ffc; - Chip.offset_date = 0x1ffd; - Chip.offset_month = 0x1ffe; - Chip.offset_year = 0x1fff; - Chip.offset_century = -1; - Chip.offset_flags = -1; - Chip.size = 0x2000; - break; - case TIMEKEEPER_MK48T08: - Chip.offset_control = 0x1ff8; - Chip.offset_seconds = 0x1ff9; - Chip.offset_minutes = 0x1ffa; - Chip.offset_hours = 0x1ffb; - Chip.offset_day = 0x1ffc; - Chip.offset_date = 0x1ffd; - Chip.offset_month = 0x1ffe; - Chip.offset_year = 0x1fff; - Chip.offset_century = 0x1ff1; - Chip.offset_flags = 0x1ff0; - Chip.size = 0x2000; - break; - } - - if( data == NULL ) - { - data = (UINT8*)BurnMalloc(Chip.size); - memset(data, 0xff, Chip.size ); - AllocatedOwnDataArea = 1; - } - Chip.data = data; - - time(&rawtime); - timeinfo = localtime(&rawtime); - - Chip.control = 0; - Chip.seconds = make_bcd(timeinfo->tm_sec); - Chip.minutes = make_bcd(timeinfo->tm_min); - Chip.hours = make_bcd(timeinfo->tm_hour); - Chip.day = make_bcd(timeinfo->tm_wday + 1 ); - Chip.date = make_bcd(timeinfo->tm_mday ); - Chip.month = make_bcd(timeinfo->tm_mon + 1 ); - Chip.year = make_bcd(timeinfo->tm_year % 100 ); - Chip.century = make_bcd(timeinfo->tm_year / 100 ); -} - -void TimeKeeperExit() -{ -#if defined FBA_DEBUG - if (!DebugDev_TimeKprInitted) bprintf(PRINT_ERROR, _T("TimeKeeperExit called without init\n")); -#endif - - if (AllocatedOwnDataArea) { - BurnFree (Chip.data); - } - AllocatedOwnDataArea = 0; - memset(&Chip, 0, sizeof(Chip)); - - DebugDev_TimeKprInitted = 0; -} - -void TimeKeeperScan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugDev_TimeKprInitted) bprintf(PRINT_ERROR, _T("TimeKeeperScan called without init\n")); -#endif - - struct BurnArea ba; - - if (nAction & ACB_NVRAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = Chip.data; - ba.nLen = Chip.size; - ba.szName = "Time Keeper RAM"; - BurnAcb(&ba); - } -} diff --git a/jan/src/burn/devices/timekpr.h b/jan/src/burn/devices/timekpr.h deleted file mode 100644 index e8b8b6c79..000000000 --- a/jan/src/burn/devices/timekpr.h +++ /dev/null @@ -1,15 +0,0 @@ -#define TIMEKEEPER_M48T02 1 -#define TIMEKEEPER_M48T35 2 -#define TIMEKEEPER_M48T37 3 -#define TIMEKEEPER_M48T58 4 -#define TIMEKEEPER_MK48T08 5 - -UINT8 TimeKeeperRead(UINT32 offset); -void TimeKeeperWrite(INT32 offset, UINT8 data); -void TimeKeeperTick(); -void TimeKeeperInit(INT32 type, UINT8 *data); -void TimeKeeperExit(); -void TimeKeeperScan(INT32 nAction); -INT32 TimeKeeperIsEmpty(); -UINT8* TimeKeeperGetRaw(); - diff --git a/jan/src/burn/devices/tms34061.cpp b/jan/src/burn/devices/tms34061.cpp deleted file mode 100644 index 551df93ad..000000000 --- a/jan/src/burn/devices/tms34061.cpp +++ /dev/null @@ -1,623 +0,0 @@ -/**************************************************************************** - * * - * Functions to emulate the TMS34061 video controller * - * * - * Created by Zsolt Vasvari on 5/26/1998. * - * Updated by Aaron Giles on 11/21/2000. * - * Modified for use in FBA by iq_132 4/15/2014 * - * * - * This is far from complete. See the TMS34061 User's Guide available on * - * www.spies.com/arcade * - * * - ****************************************************************************/ - -#include "burnint.h" -#include "driver.h" - -/* register constants */ -enum -{ - TMS34061_HORENDSYNC = 0, - TMS34061_HORENDBLNK, - TMS34061_HORSTARTBLNK, - TMS34061_HORTOTAL, - TMS34061_VERENDSYNC, - TMS34061_VERENDBLNK, - TMS34061_VERSTARTBLNK, - TMS34061_VERTOTAL, - TMS34061_DISPUPDATE, - TMS34061_DISPSTART, - TMS34061_VERINT, - TMS34061_CONTROL1, - TMS34061_CONTROL2, - TMS34061_STATUS, - TMS34061_XYOFFSET, - TMS34061_XYADDRESS, - TMS34061_DISPADDRESS, - TMS34061_VERCOUNTER, - TMS34061_REGCOUNT -}; - -static UINT8 m_rowshift; -static UINT32 m_vramsize; -static UINT16 m_regs[TMS34061_REGCOUNT]; -static UINT16 m_xmask; -static UINT8 m_yshift; -static UINT32 m_vrammask; -static UINT8 * m_vram; -static UINT8 * m_vram_orig; -static UINT8 * m_latchram; -static UINT8 * m_latchram_orig; -static UINT8 m_latchdata; -static UINT8 * m_shiftreg; -static INT32 m_timer; -static void (*m_interrupt_cb)(INT32 state); -static void (*m_partial_update)(); -INT32 tms34061_current_scanline; - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void tms34061_reset() -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_reset called without init\n")); -#endif - - memset (m_vram, 0, m_vramsize); - memset (m_latchram, 0, m_vramsize); - - /* initialize registers to their default values from the manual */ - m_regs[TMS34061_HORENDSYNC] = 0x0010; - m_regs[TMS34061_HORENDBLNK] = 0x0020; - m_regs[TMS34061_HORSTARTBLNK] = 0x01f0; - m_regs[TMS34061_HORTOTAL] = 0x0200; - m_regs[TMS34061_VERENDSYNC] = 0x0004; - m_regs[TMS34061_VERENDBLNK] = 0x0010; - m_regs[TMS34061_VERSTARTBLNK] = 0x00f0; - m_regs[TMS34061_VERTOTAL] = 0x0100; - m_regs[TMS34061_DISPUPDATE] = 0x0000; - m_regs[TMS34061_DISPSTART] = 0x0000; - m_regs[TMS34061_VERINT] = 0x0000; - m_regs[TMS34061_CONTROL1] = 0x7000; - m_regs[TMS34061_CONTROL2] = 0x0600; - m_regs[TMS34061_STATUS] = 0x0000; - m_regs[TMS34061_XYOFFSET] = 0x0010; - m_regs[TMS34061_XYADDRESS] = 0x0000; - m_regs[TMS34061_DISPADDRESS] = 0x0000; - m_regs[TMS34061_VERCOUNTER] = 0x0000; - - /* start vertical interrupt timer */ - m_timer = -1; // disable -} - -void tms34061_init(UINT8 rowshift, UINT32 ram_size, void (*partial_update)(), void (*callback)(INT32 state)) -{ - DebugDev_Tms34061Initted = 1; - - m_partial_update = partial_update; - m_rowshift = rowshift; - m_vramsize = ram_size; - - /* resolve callbak */ - m_interrupt_cb = callback; - - /* reset the data */ - m_vrammask = m_vramsize - 1; - - /* allocate memory for VRAM */ - m_vram = m_vram_orig = (UINT8*)BurnMalloc(m_vramsize + 256 * 2); - - /* allocate memory for latch RAM */ - m_latchram = m_latchram_orig = (UINT8*)BurnMalloc(m_vramsize + 256 * 2); - - /* add some buffer space for VRAM and latch RAM */ - m_vram += 256; - m_latchram += 256; - - /* point the shift register to the base of VRAM for now */ - m_shiftreg = m_vram; -} - -void tms34061_exit() -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_exit called without init\n")); -#endif - - BurnFree(m_vram_orig); - m_vram = NULL; - BurnFree(m_latchram_orig); - m_latchram = NULL; - - DebugDev_Tms34061Initted = 0; -} - -/************************************* - * - * Interrupt handling - * - *************************************/ - -static void update_interrupts() -{ - /* if we have a callback, process it */ - if (m_interrupt_cb) - { - /* if the status bit is set, and ints are enabled, turn it on */ - if ((m_regs[TMS34061_STATUS] & 0x0001) && (m_regs[TMS34061_CONTROL1] & 0x0400)) - m_interrupt_cb(ASSERT_LINE); - else - m_interrupt_cb(CLEAR_LINE); - } -} - - -void tms34061_interrupt() -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_interrupt called without init\n")); -#endif - - if (tms34061_current_scanline != m_timer) return; - - /* set the interrupt bit in the status reg */ - m_regs[TMS34061_STATUS] |= 1; - - /* update the interrupt state */ - update_interrupts(); -} - - - -/************************************* - * - * Register writes - * - *************************************/ - -static void register_w(INT32 offset, UINT8 data) -{ - INT32 scanline; - INT32 regnum = offset >> 2; - - /* certain registers affect the display directly */ - if ((regnum >= TMS34061_HORENDSYNC && regnum <= TMS34061_DISPSTART) || - (regnum == TMS34061_CONTROL2)) - m_partial_update(); - - /* store the hi/lo half */ - if (regnum < TMS34061_REGCOUNT) - { - if (offset & 0x02) - m_regs[regnum] = (m_regs[regnum] & 0x00ff) | (data << 8); - else - m_regs[regnum] = (m_regs[regnum] & 0xff00) | data; - } - - /* update the state of things */ - switch (regnum) - { - /* vertical interrupt: adjust the timer */ - case TMS34061_VERINT: - scanline = m_regs[TMS34061_VERINT] - m_regs[TMS34061_VERENDBLNK]; - - if (scanline < 0) - scanline += m_regs[TMS34061_VERTOTAL]; - - // FBA -- this isn't accurate, it will only trigger on a per-scanline basis, but should be - // scanline and horizontal position in the scanline. It doesn't seem to bother the tested - // games much though, so don't worry about it - m_timer = scanline; //m_regs[TMS34061_HORSTARTBLNK]; - // m_timer->adjust(m_screen->time_until_pos(scanline, m_regs[TMS34061_HORSTARTBLNK])); - break; - - /* XY offset: set the X and Y masks */ - case TMS34061_XYOFFSET: - switch (m_regs[TMS34061_XYOFFSET] & 0x00ff) - { - case 0x01: m_yshift = 2; break; - case 0x02: m_yshift = 3; break; - case 0x04: m_yshift = 4; break; - case 0x08: m_yshift = 5; break; - case 0x10: m_yshift = 6; break; - case 0x20: m_yshift = 7; break; - case 0x40: m_yshift = 8; break; - case 0x80: m_yshift = 9; break; - default: /*logerror("Invalid value for XYOFFSET = %04x\n", m_regs[TMS34061_XYOFFSET]);*/ break; - } - m_xmask = (1 << m_yshift) - 1; - break; - - /* CONTROL1: they could have turned interrupts on */ - case TMS34061_CONTROL1: - update_interrupts(); - break; - - /* other supported registers */ - case TMS34061_XYADDRESS: - break; - } -} - - - -/************************************* - * - * Register reads - * - *************************************/ - -static UINT8 register_r(INT32 offset) -{ - INT32 regnum = offset >> 2; - UINT16 result; - - /* extract the correct portion of the register */ - if (regnum < TMS34061_REGCOUNT) - result = m_regs[regnum]; - else - result = 0xffff; - - /* special cases: */ - switch (regnum) - { - /* status register: a read here clears it */ - case TMS34061_STATUS: - m_regs[TMS34061_STATUS] = 0; - update_interrupts(); - break; - - /* vertical count register: return the current scanline */ - case TMS34061_VERCOUNTER: - result = (tms34061_current_scanline + m_regs[TMS34061_VERENDBLNK]) % m_regs[TMS34061_VERTOTAL]; - break; - } - - /* log it */ - return (offset & 0x02) ? (result >> 8) : result; -} - - - -/************************************* - * - * XY addressing - * - *************************************/ - -static void adjust_xyaddress(INT32 offset) -{ - /* note that carries are allowed if the Y coordinate isn't being modified */ - switch (offset & 0x1e) - { - case 0x00: /* no change */ - break; - - case 0x02: /* X + 1 */ - m_regs[TMS34061_XYADDRESS]++; - break; - - case 0x04: /* X - 1 */ - m_regs[TMS34061_XYADDRESS]--; - break; - - case 0x06: /* X = 0 */ - m_regs[TMS34061_XYADDRESS] &= ~m_xmask; - break; - - case 0x08: /* Y + 1 */ - m_regs[TMS34061_XYADDRESS] += 1 << m_yshift; - break; - - case 0x0a: /* X + 1, Y + 1 */ - m_regs[TMS34061_XYADDRESS] = (m_regs[TMS34061_XYADDRESS] & ~m_xmask) | - ((m_regs[TMS34061_XYADDRESS] + 1) & m_xmask); - m_regs[TMS34061_XYADDRESS] += 1 << m_yshift; - break; - - case 0x0c: /* X - 1, Y + 1 */ - m_regs[TMS34061_XYADDRESS] = (m_regs[TMS34061_XYADDRESS] & ~m_xmask) | - ((m_regs[TMS34061_XYADDRESS] - 1) & m_xmask); - m_regs[TMS34061_XYADDRESS] += 1 << m_yshift; - break; - - case 0x0e: /* X = 0, Y + 1 */ - m_regs[TMS34061_XYADDRESS] &= ~m_xmask; - m_regs[TMS34061_XYADDRESS] += 1 << m_yshift; - break; - - case 0x10: /* Y - 1 */ - m_regs[TMS34061_XYADDRESS] -= 1 << m_yshift; - break; - - case 0x12: /* X + 1, Y - 1 */ - m_regs[TMS34061_XYADDRESS] = (m_regs[TMS34061_XYADDRESS] & ~m_xmask) | - ((m_regs[TMS34061_XYADDRESS] + 1) & m_xmask); - m_regs[TMS34061_XYADDRESS] -= 1 << m_yshift; - break; - - case 0x14: /* X - 1, Y - 1 */ - m_regs[TMS34061_XYADDRESS] = (m_regs[TMS34061_XYADDRESS] & ~m_xmask) | - ((m_regs[TMS34061_XYADDRESS] - 1) & m_xmask); - m_regs[TMS34061_XYADDRESS] -= 1 << m_yshift; - break; - - case 0x16: /* X = 0, Y - 1 */ - m_regs[TMS34061_XYADDRESS] &= ~m_xmask; - m_regs[TMS34061_XYADDRESS] -= 1 << m_yshift; - break; - - case 0x18: /* Y = 0 */ - m_regs[TMS34061_XYADDRESS] &= m_xmask; - break; - - case 0x1a: /* X + 1, Y = 0 */ - m_regs[TMS34061_XYADDRESS]++; - m_regs[TMS34061_XYADDRESS] &= m_xmask; - break; - - case 0x1c: /* X - 1, Y = 0 */ - m_regs[TMS34061_XYADDRESS]--; - m_regs[TMS34061_XYADDRESS] &= m_xmask; - break; - - case 0x1e: /* X = 0, Y = 0 */ - m_regs[TMS34061_XYADDRESS] = 0; - break; - } -} - - -static void xypixel_w(INT32 offset, UINT8 data) -{ - /* determine the offset, then adjust it */ - INT32 pixeloffs = m_regs[TMS34061_XYADDRESS]; - if (offset) - adjust_xyaddress(offset); - - /* adjust for the upper bits */ - pixeloffs |= (m_regs[TMS34061_XYOFFSET] & 0x0f00) << 8; - - /* mask to the VRAM size */ - pixeloffs &= m_vrammask; - - /* set the pixel data */ - m_vram[pixeloffs] = data; - m_latchram[pixeloffs] = m_latchdata; -} - - -static UINT8 xypixel_r(INT32 offset) -{ - /* determine the offset, then adjust it */ - INT32 pixeloffs = m_regs[TMS34061_XYADDRESS]; - if (offset) - adjust_xyaddress(offset); - - /* adjust for the upper bits */ - pixeloffs |= (m_regs[TMS34061_XYOFFSET] & 0x0f00) << 8; - - /* mask to the VRAM size */ - pixeloffs &= m_vrammask; - - /* return the result */ - return m_vram[pixeloffs]; -} - - - -/************************************* - * - * Core writes - * - *************************************/ - -void tms34061_write(INT32 col, INT32 row, INT32 func, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_write called without init\n")); -#endif - - INT32 offs; - - /* the function code determines what to do */ - switch (func) - { - /* both 0 and 2 map to register access */ - case 0: - case 2: - register_w(col, data); - break; - - /* function 1 maps to XY access; col is the address adjustment */ - case 1: - xypixel_w(col, data); - break; - - /* function 3 maps to direct access */ - case 3: - offs = ((row << m_rowshift) | col) & m_vrammask; - if (m_regs[TMS34061_CONTROL2] & 0x0040) - offs |= (m_regs[TMS34061_CONTROL2] & 3) << 16; - - if (m_vram[offs] != data || m_latchram[offs] != m_latchdata) - { - m_vram[offs] = data; - m_latchram[offs] = m_latchdata; - } - break; - - /* function 4 performs a shift reg transfer to VRAM */ - case 4: - offs = col << m_rowshift; - if (m_regs[TMS34061_CONTROL2] & 0x0040) - offs |= (m_regs[TMS34061_CONTROL2] & 3) << 16; - offs &= m_vrammask; - - memcpy(&m_vram[offs], m_shiftreg, (size_t)1 << m_rowshift); - memset(&m_latchram[offs], m_latchdata, (size_t)1 << m_rowshift); - break; - - /* function 5 performs a shift reg transfer from VRAM */ - case 5: - offs = col << m_rowshift; - if (m_regs[TMS34061_CONTROL2] & 0x0040) - offs |= (m_regs[TMS34061_CONTROL2] & 3) << 16; - offs &= m_vrammask; - - m_shiftreg = &m_vram[offs]; - break; - - /* log anything else */ - default: - break; - } -} - - -UINT8 tms34061_read(INT32 col, INT32 row, INT32 func) -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_read called without init\n")); -#endif - - INT32 result = 0; - INT32 offs; - - /* the function code determines what to do */ - switch (func) - { - /* both 0 and 2 map to register access */ - case 0: - case 2: - result = register_r(col); - break; - - /* function 1 maps to XY access; col is the address adjustment */ - case 1: - result = xypixel_r(col); - break; - - /* funtion 3 maps to direct access */ - case 3: - offs = ((row << m_rowshift) | col) & m_vrammask; - result = m_vram[offs]; - break; - - /* function 4 performs a shift reg transfer to VRAM */ - case 4: - offs = col << m_rowshift; - if (m_regs[TMS34061_CONTROL2] & 0x0040) - offs |= (m_regs[TMS34061_CONTROL2] & 3) << 16; - offs &= m_vrammask; - - memcpy(&m_vram[offs], m_shiftreg, (size_t)1 << m_rowshift); - memset(&m_latchram[offs], m_latchdata, (size_t)1 << m_rowshift); - break; - - /* function 5 performs a shift reg transfer from VRAM */ - case 5: - offs = col << m_rowshift; - if (m_regs[TMS34061_CONTROL2] & 0x0040) - offs |= (m_regs[TMS34061_CONTROL2] & 3) << 16; - offs &= m_vrammask; - - m_shiftreg = &m_vram[offs]; - break; - - /* log anything else */ - default: - break; - } - - return result; -} - - - -/************************************* - * - * Misc functions - * - *************************************/ - -UINT8 tms34061_latch_read() -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_latch_read called without init\n")); -#endif - - return m_latchdata; -} - - -void tms34061_latch_write(UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_latch_write called without init\n")); -#endif - - m_latchdata = data; -} - -INT32 tms34061_display_blanked() -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_display_blanked called without init\n")); -#endif - - return (~m_regs[TMS34061_CONTROL2] >> 13) & 1; -} - -UINT8 *tms34061_get_vram_pointer() -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_get_vram_pointer called without init\n")); -#endif - - return m_vram; -} - - -/************************************* - * - * Save function - * - *************************************/ - -INT32 tms34061_scan(INT32 nAction, INT32 *) -{ -#if defined FBA_DEBUG - if (!DebugDev_Tms34061Initted) bprintf(PRINT_ERROR, _T("tms34061_scan called without init\n")); -#endif - - struct BurnArea ba; - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = m_vram; - ba.nLen = m_vramsize+256; - ba.szName = "tms34061 video ram"; - BurnAcb(&ba); - - ba.Data = m_latchram; - ba.nLen = m_vramsize+256; - ba.szName = "tms34061 latch ram"; - BurnAcb(&ba); - - ba.Data = m_regs; - ba.nLen = TMS34061_REGCOUNT * sizeof(UINT16); - ba.szName = "tms34061 registers"; - BurnAcb(&ba); - - SCAN_VAR(m_xmask); - SCAN_VAR(m_yshift); - SCAN_VAR(m_latchdata); - SCAN_VAR(m_timer); - } - - return 0; -} diff --git a/jan/src/burn/devices/tms34061.h b/jan/src/burn/devices/tms34061.h deleted file mode 100644 index 3d7532de7..000000000 --- a/jan/src/burn/devices/tms34061.h +++ /dev/null @@ -1,15 +0,0 @@ - -UINT8 tms34061_latch_read(); -void tms34061_latch_write(UINT8 data); -UINT8 tms34061_read(INT32 col, INT32 row, INT32 func); -void tms34061_write(INT32 col, INT32 row, INT32 func, UINT8 data); - -INT32 tms34061_display_blanked(); -UINT8 *tms34061_get_vram_pointer(); -extern INT32 tms34061_current_scanline; - -void tms34061_interrupt(); -void tms34061_init(UINT8 rowshift, UINT32 ram_size, void (*partial_update)(), void (*callback)(INT32 state)); -void tms34061_reset(); -void tms34061_exit(); -INT32 tms34061_scan(INT32 nAction, INT32 *); diff --git a/jan/src/burn/devices/tms9928a.cpp b/jan/src/burn/devices/tms9928a.cpp deleted file mode 100644 index 95acdb2dc..000000000 --- a/jan/src/burn/devices/tms9928a.cpp +++ /dev/null @@ -1,632 +0,0 @@ -// Based on MAME sources by Sean Young, Nathan Woods, Aaron Giles, Wilbert Pol, and hap - -#include "tiles_generic.h" -#include "tms9928a.h" - -/* Some defines used in defining the screens */ -#define TMS9928A_TOTAL_HORZ 342 -#define TMS9928A_TOTAL_VERT_NTSC 262 -#define TMS9928A_TOTAL_VERT_PAL 313 - -#define TMS9928A_HORZ_DISPLAY_START (2 + 14 + 8 + 13) -#define TMS9928A_VERT_DISPLAY_START_PAL 16 -#define TMS9928A_VERT_DISPLAY_START_NTSC 16 - -static INT32 TMS9928A_palette[16] = { - 0x000000, 0x000000, 0x21c842, 0x5edc78, 0x5455ed, 0x7d76fc, 0xd4524d, 0x42ebf5, - 0xfc5554, 0xff7978, 0xd4c154, 0xe6ce80, 0x21b03b, 0xc95bba, 0xcccccc, 0xffffff -}; - -typedef struct { - UINT8 mode; - UINT8 ReadAhead; - UINT8 Regs[8]; - UINT8 StatusReg; - UINT8 FifthSprite; - UINT8 FirstByte; - UINT8 latch; - UINT8 INT; - INT32 Addr; - INT32 colour; - INT32 pattern; - INT32 nametbl; - INT32 spriteattribute; - INT32 spritepattern; - INT32 colourmask; - INT32 patternmask; - - UINT8 *vMem; - UINT16 *tmpbmp; - INT32 tmpbmpsize; - INT32 vramsize; - INT32 model; - INT32 revA; - - INT32 LimitSprites; - INT32 top_border; - INT32 bottom_border; - INT32 vertical_size; - - void (*INTCallback)(INT32); -} TMS9928A; - -static TMS9928A tms; - -static INT32 TMS9928A_initted = 0; - -static UINT32 Palette[16]; // high color support - -static void TMS89928aPaletteRecalc() -{ - for (INT32 i = 0; i < 16; i++) { - Palette[i] = BurnHighCol(TMS9928A_palette[i] >> 16, TMS9928A_palette[i] >> 8, TMS9928A_palette[i] >> 0 , 0); - } -} - -static void check_interrupt() -{ - INT32 b = (tms.StatusReg & 0x80 && tms.Regs[1] & 0x20) ? 1 : 0; - if (b != tms.INT) { - tms.INT = b; - if (tms.INTCallback) tms.INTCallback (tms.INT); - } -} - -static void update_table_masks() -{ - tms.colourmask = (tms.Regs[3] & 0x7f) * 8 | 7; - tms.patternmask = (tms.Regs[4] & 3) * 256 | (tms.colourmask & 0xff); -} - -static void change_register(INT32 reg, UINT8 val) -{ - static const UINT8 Mask[8] = { 0x03, 0xfb, 0x0f, 0xff, 0x07, 0x7f, 0x07, 0xff }; - - val &= Mask[reg]; - tms.Regs[reg] = val; - - switch (reg) - { - case 0: - { - if (val & 2) { - tms.colour = ((tms.Regs[3] & 0x80) * 64) & (tms.vramsize - 1); - tms.pattern = ((tms.Regs[4] & 4) * 2048) & (tms.vramsize - 1); - update_table_masks(); - } else { - tms.colour = (tms.Regs[3] * 64) & (tms.vramsize - 1); - tms.pattern = (tms.Regs[4] * 2048) & (tms.vramsize - 1); - } - tms.mode = ( (tms.revA ? (tms.Regs[0] & 2) : 0) | ((tms.Regs[1] & 0x10)>>4) | ((tms.Regs[1] & 8)>>1)); - } - break; - - case 1: - { - tms.mode = ( (tms.revA ? (tms.Regs[0] & 2) : 0) | ((tms.Regs[1] & 0x10)>>4) | ((tms.Regs[1] & 8)>>1)); - check_interrupt(); - } - break; - - case 2: - tms.nametbl = (val * 1024) & (tms.vramsize - 1); - break; - - case 3: - { - if (tms.Regs[0] & 2) { - tms.colour = ((val & 0x80) * 64) & (tms.vramsize - 1); - update_table_masks(); - } else { - tms.colour = (val * 64) & (tms.vramsize - 1); - } - } - break; - - case 4: - { - if (tms.Regs[0] & 2) { - tms.pattern = ((val & 4) * 2048) & (tms.vramsize - 1); - update_table_masks(); - } else { - tms.pattern = (val * 2048) & (tms.vramsize - 1); - } - } - break; - - case 5: - tms.spriteattribute = (val * 128) & (tms.vramsize - 1); - break; - - case 6: - tms.spritepattern = (val * 2048) & (tms.vramsize - 1); - break; - - case 7: - /* The backdrop is updated at TMS9928A_refresh() */ - break; - } -} - -void TMS9928AReset() -{ - for (INT32 i = 0; i < 8; i++) - tms.Regs[i] = 0; - - memset(tms.vMem, 0, tms.vramsize); - memset(tms.tmpbmp, 0, tms.tmpbmpsize); - - tms.StatusReg = 0; - tms.FifthSprite = 31; - tms.nametbl = tms.pattern = tms.colour = 0; - tms.spritepattern = tms.spriteattribute = 0; - tms.colourmask = tms.patternmask = 0x3fff; - tms.Addr = tms.ReadAhead = tms.INT = 0; - tms.FirstByte = 0; - tms.latch = 0; - tms.mode = 0; -} - -void TMS9928AInit(INT32 model, INT32 vram, INT32 borderx, INT32 bordery, void (*INTCallback)(int)) -{ - TMS9928A_initted = 1; - - GenericTilesInit(); - - memset(&tms, 0, sizeof(tms)); - tms.model = model; - tms.revA = 1; - - tms.INTCallback = INTCallback; - - tms.top_border = TMS9928A_VERT_DISPLAY_START_NTSC; - tms.bottom_border = ((tms.model == TMS9929) || (tms.model == TMS9929A)) ? 51 : 24; - tms.vertical_size = TMS9928A_TOTAL_VERT_NTSC; - - tms.vramsize = vram; - tms.vMem = (UINT8*)BurnMalloc(tms.vramsize); - - tms.tmpbmpsize = TMS9928A_TOTAL_HORZ * TMS9928A_TOTAL_VERT_PAL * sizeof(short) * 2; - tms.tmpbmp = (UINT16*)BurnMalloc(tms.tmpbmpsize); - - TMS9928AReset (); - tms.LimitSprites = 1; -} - -void TMS9928AExit() -{ - if (!TMS9928A_initted) return; - - TMS9928A_initted = 0; - TMS9928AReset(); - - GenericTilesExit(); - - BurnFree (tms.tmpbmp); - BurnFree (tms.vMem); -} - -void TMS9928APostLoad() -{ - for (INT32 i = 0; i < 8; i++) - change_register(i, tms.Regs[i]); - - if (tms.INTCallback) tms.INTCallback(tms.INT); -} - -UINT8 TMS9928AReadVRAM() -{ - INT32 b = tms.ReadAhead; - tms.ReadAhead = tms.vMem[tms.Addr]; - tms.Addr = (tms.Addr + 1) & (tms.vramsize - 1); - tms.latch = 0; - return b; -} - -void TMS9928AWriteVRAM(INT32 data) -{ - tms.vMem[tms.Addr] = data; - tms.Addr = (tms.Addr + 1) & (tms.vramsize - 1); - tms.ReadAhead = data; - tms.latch = 0; -} - -UINT8 TMS9928AReadRegs() -{ - INT32 b = tms.StatusReg; - tms.StatusReg = tms.FifthSprite; - check_interrupt(); - tms.latch = 0; - return b; -} - -void TMS9928AWriteRegs(INT32 data) -{ - if (tms.latch) { - /* set high part of read/write address */ - tms.Addr = ((UINT16)data << 8 | (tms.Addr & 0xff)) & (tms.vramsize - 1); - if (data & 0x80) { - change_register(data & 0x07, tms.FirstByte); - } else { - if (!(data & 0x40)) { - TMS9928AReadVRAM(); - } - } - - tms.latch = 0; - } else { - /* set low part of read/write address */ - tms.Addr = ((tms.Addr & 0xff00) | data) & (tms.vramsize - 1); - tms.FirstByte = data; - tms.latch = 1; - } -} - -void TMS9928ASetSpriteslimit(INT32 limit) -{ - tms.LimitSprites = limit; -} - -static inline UINT8 readvmem(INT32 vaddr) -{ - return tms.vMem[vaddr]; -} - -static void TMS9928AScanline_INT(INT32 vpos) -{ - UINT16 BackColour = tms.Regs[7] & 0xf; - UINT16 *p = tms.tmpbmp + (vpos * TMS9928A_TOTAL_HORZ); - - INT32 y = vpos - tms.top_border; - - if ( y < 0 || y >= 192 || !(tms.Regs[1] & 0x40) ) - { - /* Draw backdrop colour */ - for ( INT32 i = 0; i < TMS9928A_TOTAL_HORZ; i++ ) - p[i] = BackColour; - - /* vblank is set at the last cycle of the first inactive line */ - if ( y == 193 ) - { - tms.StatusReg |= 0x80; - check_interrupt(); - } - } - else - { - /* Draw regular line */ - - /* Left border */ - for ( INT32 i = 0; i < TMS9928A_HORZ_DISPLAY_START; i++ ) - p[i] = BackColour; - - /* Active display */ - - switch( tms.mode ) - { - case 0: /* MODE 0 */ - { - UINT16 addr = tms.nametbl + ( ( y & 0xF8 ) << 2 ); - - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 256; x+= 8, addr++ ) - { - UINT8 charcode = readvmem( addr ); - UINT8 pattern = readvmem( tms.pattern + ( charcode << 3 ) + ( y & 7 ) ); - UINT8 colour = readvmem( tms.colour + ( charcode >> 3 ) ); - UINT16 fg = (colour >> 4) ? (colour >> 4) : BackColour; - UINT16 bg = (colour & 15) ? (colour & 15) : BackColour; - - for ( INT32 i = 0; i < 8; pattern <<= 1, i++ ) - p[x+i] = ( pattern & 0x80 ) ? fg : bg; - } - } - break; - - case 1: /* MODE 1 */ - { - UINT16 addr = tms.nametbl + ( ( y >> 3 ) * 40 ); - UINT16 fg = (tms.Regs[7] >> 4) ? (tms.Regs[7] >> 4) : BackColour; - UINT16 bg = BackColour; - - /* Extra 6 pixels left border */ - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 6; x++ ) - p[x] = bg; - - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START + 6; x < TMS9928A_HORZ_DISPLAY_START + 246; x+= 6, addr++ ) - { - UINT16 charcode = readvmem( addr ); - UINT8 pattern = readvmem( tms.pattern + ( charcode << 3 ) + ( y & 7 ) ); - - for ( INT32 i = 0; i < 6; pattern <<= 1, i++ ) - p[x+i] = ( pattern & 0x80 ) ? fg : bg; - } - - /* Extra 10 pixels right border */ - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START + 246; x < TMS9928A_HORZ_DISPLAY_START + 256; x++ ) - p[x] = bg; - } - break; - - case 2: /* MODE 2 */ - { - UINT16 addr = tms.nametbl + ( ( y >> 3 ) * 32 ); - - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 256; x+= 8, addr++ ) - { - UINT16 charcode = readvmem( addr ) + ( ( y >> 6 ) << 8 ); - UINT8 pattern = readvmem( tms.pattern + ( ( charcode & tms.patternmask ) << 3 ) + ( y & 7 ) ); - UINT8 colour = readvmem( tms.colour + ( ( charcode & tms.colourmask ) << 3 ) + ( y & 7 ) ); - UINT16 fg = (colour >> 4) ? (colour >> 4) : BackColour; - UINT16 bg = (colour & 15) ? (colour & 15) : BackColour; - - for ( INT32 i = 0; i < 8; pattern <<= 1, i++ ) - p[x+i] = ( pattern & 0x80 ) ? fg : bg; - } - } - break; - - case 3: /* MODE 1+2 */ - { - UINT16 addr = tms.nametbl + ( ( y >> 3 ) * 40 ); - UINT16 fg = (tms.Regs[7] >> 4) ? (tms.Regs[7] >> 4) : BackColour; - UINT16 bg = BackColour; - - /* Extra 6 pixels left border */ - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 6; x++ ) - p[x] = bg; - - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START + 6; x < TMS9928A_HORZ_DISPLAY_START + 246; x+= 6, addr++ ) - { - UINT16 charcode = ( readvmem( addr ) + ( ( y >> 6 ) << 8 ) ) & tms.patternmask; - UINT8 pattern = readvmem( tms.pattern + ( charcode << 3 ) + ( y & 7 ) ); - - for ( INT32 i = 0; i < 6; pattern <<= 1, i++ ) - p[x+i] = ( pattern & 0x80 ) ? fg : bg; - } - - /* Extra 10 pixels right border */ - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START + 246; x < TMS9928A_HORZ_DISPLAY_START + 256; x++ ) - p[x] = bg; - } - break; - - case 4: /* MODE 3 */ - { - UINT16 addr = tms.nametbl + ( ( y >> 3 ) * 32 ); - - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 256; x+= 8, addr++ ) - { - UINT8 charcode = readvmem( addr ); - UINT8 colour = readvmem( tms.pattern + ( charcode << 3 ) + ( ( y >> 2 ) & 7 ) ); - UINT16 fg = (colour >> 4) ? (colour >> 4) : BackColour; - UINT16 bg = (colour & 15) ? (colour & 15) : BackColour; - - p[x+0] = p[x+1] = p[x+2] = p[x+3] = fg; - p[x+4] = p[x+5] = p[x+6] = p[x+7] = bg; - } - } - break; - - case 5: case 7: /* MODE bogus */ - { - UINT16 fg = (tms.Regs[7] >> 4) ? (tms.Regs[7] >> 4) : BackColour; - UINT16 bg = BackColour; - - /* Extra 6 pixels left border */ - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 6; x++ ) - p[x] = bg; - - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START + 6; x < TMS9928A_HORZ_DISPLAY_START + 246; x+= 6 ) - { - p[x+0] = p[x+1] = p[x+2] = p[x+3] = fg; - p[x+4] = p[x+5] = bg; - } - - /* Extra 10 pixels right border */ - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START + 246; x < TMS9928A_HORZ_DISPLAY_START + 256; x++ ) - p[x] = bg; - } - break; - - case 6: /* MODE 2+3 */ - { - UINT16 addr = tms.nametbl + ( ( y >> 3 ) * 32 ); - - for ( INT32 x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 256; x+= 8, addr++ ) - { - UINT8 charcode = readvmem( addr ); - UINT8 colour = readvmem( tms.pattern + ( ( ( charcode + ( ( y >> 2 ) & 7 ) + ( ( y >> 6 ) << 8 ) ) & tms.patternmask ) << 3 ) ); - UINT16 fg = (colour >> 4) ? (colour >> 4) : BackColour; - UINT16 bg = (colour & 15) ? (colour & 15) : BackColour; - - p[x+0] = p[x+1] = p[x+2] = p[x+3] = fg; - p[x+4] = p[x+5] = p[x+6] = p[x+7] = bg; - } - } - break; - } - - /* Draw sprites */ - if ( ( tms.Regs[1] & 0x50 ) != 0x40 ) - { - /* sprites are disabled */ - tms.FifthSprite = 31; - } - else - { - UINT8 sprite_size = ( tms.Regs[1] & 0x02 ) ? 16 : 8; - UINT8 sprite_mag = tms.Regs[1] & 0x01; - UINT8 sprite_height = sprite_size * ( sprite_mag + 1 ); - UINT8 spr_drawn[32+256+32] = { 0 }; - UINT8 num_sprites = 0; - bool fifth_encountered = false; - - for ( UINT16 sprattr = 0; sprattr < 128; sprattr += 4 ) - { - INT32 spr_y = readvmem( tms.spriteattribute + sprattr + 0 ); - - tms.FifthSprite = sprattr / 4; - - /* Stop processing sprites */ - if ( spr_y == 208 ) - break; - - if ( spr_y > 0xE0 ) - spr_y -= 256; - - /* vert pos 255 is displayed on the first line of the screen */ - spr_y++; - - /* is sprite enabled on this line? */ - if ( spr_y <= y && y < spr_y + sprite_height ) - { - INT32 spr_x = readvmem( tms.spriteattribute + sprattr + 1 ); - UINT8 sprcode = readvmem( tms.spriteattribute + sprattr + 2 ); - UINT8 sprcol = readvmem( tms.spriteattribute + sprattr + 3 ); - UINT16 pataddr = tms.spritepattern + ( ( sprite_size == 16 ) ? sprcode & ~0x03 : sprcode ) * 8; - - num_sprites++; - - /* Fifth sprite encountered? */ - if ( num_sprites == 5 ) - { - fifth_encountered = true; - break; - } - - if ( sprite_mag ) - pataddr += ( ( ( y - spr_y ) & 0x1F ) >> 1 ); - else - pataddr += ( ( y - spr_y ) & 0x0F ); - - UINT8 pattern = readvmem( pataddr ); - - if ( sprcol & 0x80 ) - spr_x -= 32; - - sprcol &= 0x0f; - - for ( INT32 s = 0; s < sprite_size; s += 8 ) - { - for ( INT32 i = 0; i < 8; pattern <<= 1, i++ ) - { - INT32 colission_index = spr_x + ( sprite_mag ? i * 2 : i ) + 32; - - for ( INT32 z = 0; z <= sprite_mag; colission_index++, z++ ) - { - /* Check if pixel should be drawn */ - if ( pattern & 0x80 ) - { - if ( colission_index >= 32 && colission_index < 32 + 256 ) - { - /* Check for colission */ - if ( spr_drawn[ colission_index ] ) - tms.StatusReg |= 0x20; - spr_drawn[ colission_index ] |= 0x01; - - if ( sprcol ) - { - /* Has another sprite already drawn here? */ - if ( ! ( spr_drawn[ colission_index ] & 0x02 ) ) - { - spr_drawn[ colission_index ] |= 0x02; - p[ TMS9928A_HORZ_DISPLAY_START + colission_index - 32 ] = sprcol; - } - } - } - } - } - } - - pattern = readvmem( pataddr + 16 ); - spr_x += sprite_mag ? 16 : 8; - } - } - } - - /* Update sprite overflow bits */ - if (~tms.StatusReg & 0x40) - { - tms.StatusReg = (tms.StatusReg & 0xe0) | tms.FifthSprite; - if (fifth_encountered && ~tms.StatusReg & 0x80) - tms.StatusReg |= 0x40; - } - } - - /* Right border */ - for ( INT32 i = TMS9928A_HORZ_DISPLAY_START + 256; i < TMS9928A_TOTAL_HORZ; i++ ) - p[i] = BackColour; - } -} - -void TMS9928AScanline(INT32 vpos) -{ - if (vpos==0) // draw the border on the first scanline, border shouldn't use any cpu - { // to render. this keeps cv defender's radar working. - for (INT32 i = 0; i < tms.top_border+1; i++) - { - TMS9928AScanline_INT(i); - } - } else { - TMS9928AScanline_INT(vpos + tms.top_border); - } -} - -INT32 TMS9928ADraw() -{ - TMS89928aPaletteRecalc(); - - { - for (INT32 y = 0; y < nScreenHeight; y++) - { - for (INT32 x = 0; x < nScreenWidth; x++) - { - pTransDraw[y * nScreenWidth + x] = tms.tmpbmp[y * TMS9928A_TOTAL_HORZ + ((TMS9928A_HORZ_DISPLAY_START/2)+10)+x]; - } - } - } - - BurnTransferCopy(Palette); - - return 0; -} - -INT32 TMS9928AScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029708; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = tms.vMem; - ba.nLen = tms.vramsize; - ba.szName = "video ram"; - BurnAcb(&ba); - - ba.Data = tms.Regs; - ba.nLen = 8; - ba.szName = "tms registers"; - BurnAcb(&ba); - - SCAN_VAR(tms.ReadAhead); - SCAN_VAR(tms.StatusReg); - SCAN_VAR(tms.FirstByte); - SCAN_VAR(tms.latch); - SCAN_VAR(tms.mode); - SCAN_VAR(tms.INT); - SCAN_VAR(tms.Addr); - SCAN_VAR(tms.colour); - SCAN_VAR(tms.pattern); - SCAN_VAR(tms.nametbl); - SCAN_VAR(tms.spriteattribute); - SCAN_VAR(tms.spritepattern); - SCAN_VAR(tms.colourmask); - SCAN_VAR(tms.patternmask); - } - - return 0; -} diff --git a/jan/src/burn/devices/tms9928a.h b/jan/src/burn/devices/tms9928a.h deleted file mode 100644 index 61877709c..000000000 --- a/jan/src/burn/devices/tms9928a.h +++ /dev/null @@ -1,27 +0,0 @@ - -#define TMS9928A_PALETTE_SIZE 16 - -typedef enum -{ - TMS_INVALID_MODEL, - TMS99x8, - TMS9929, - TMS99x8A, - TMS9929A -} tms9928a_model; - -void TMS9928AInit(INT32 model, INT32 vram, INT32 borderx, INT32 bordery, void (*INTCallback)(INT32)); -void TMS9928AReset(); -void TMS9928AExit(); -void TMS9928AScanline(INT32 scanline); -INT32 TMS9928ADraw(); - -void TMS9928ASetSpriteslimit(INT32 limit); - -void TMS9928AWriteRegs(INT32 data); -UINT8 TMS9928AReadRegs(); - -void TMS9928AWriteVRAM(INT32 data); -UINT8 TMS9928AReadVRAM(); - -INT32 TMS9928AScan(INT32 nAction, INT32 *pnMin); diff --git a/jan/src/burn/devices/v3021.cpp b/jan/src/burn/devices/v3021.cpp deleted file mode 100644 index caf993a1e..000000000 --- a/jan/src/burn/devices/v3021.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* v3021 Calendar Emulation */ -/* Based on MAME sources by Angelo Salese */ - -#include "burnint.h" - -static UINT8 CalVal, CalMask, CalCom=0, CalCnt=0; - -static UINT8 bcd(UINT8 data) -{ - return ((data / 10) << 4) | (data % 10); -} - -UINT8 v3021Read() -{ -#if defined FBA_DEBUG - if (!DebugDev_V3021Initted) bprintf(PRINT_ERROR, _T("v3021Read called without init\n")); -#endif - - UINT8 calr; - calr = (CalVal & CalMask) ? 1 : 0; - CalMask <<= 1; - return calr; -} - -void v3021Write(UINT16 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_V3021Initted) bprintf(PRINT_ERROR, _T("v3021Write called without init\n")); -#endif - - time_t nLocalTime = time(NULL); - tm* tmLocalTime = localtime(&nLocalTime); - - CalCom <<= 1; - CalCom |= data & 1; - ++CalCnt; - if(CalCnt==4) - { - CalMask = 1; - CalVal = 1; - CalCnt = 0; - - switch(CalCom & 0xf) - { - case 0x1: case 0x3: case 0x5: case 0x7: case 0x9: case 0xb: case 0xd: - CalVal++; - break; - - case 0x0: // Day - CalVal=bcd(tmLocalTime->tm_wday); - break; - - case 0x2: // Hours - CalVal=bcd(tmLocalTime->tm_hour); - break; - - case 0x4: // Seconds - CalVal=bcd(tmLocalTime->tm_sec); - break; - - case 0x6: // Month - CalVal=bcd(tmLocalTime->tm_mon + 1); // not bcd in MVS - break; - - case 0x8: // Milliseconds? - CalVal=0; - break; - - case 0xa: // Day - CalVal=bcd(tmLocalTime->tm_mday); - break; - - case 0xc: // Minute - CalVal=bcd(tmLocalTime->tm_min); - break; - - case 0xe: // Year - CalVal=bcd(tmLocalTime->tm_year % 100); - break; - - case 0xf: // Load Date - tmLocalTime = localtime(&nLocalTime); - break; - } - } -} - -void v3021Init() -{ - DebugDev_V3021Initted = 1; -} - -void v3021Exit() -{ -#if defined FBA_DEBUG - if (!DebugDev_V3021Initted) bprintf(PRINT_ERROR, _T("v3021Exit called without init\n")); -#endif - - DebugDev_V3021Initted = 0; -} - -INT32 v3021Scan() -{ -#if defined FBA_DEBUG - if (!DebugDev_V3021Initted) bprintf(PRINT_ERROR, _T("v3021Scan called without init\n")); -#endif - - SCAN_VAR(CalVal); - SCAN_VAR(CalMask); - SCAN_VAR(CalCom); - SCAN_VAR(CalCnt); - - return 0; -} diff --git a/jan/src/burn/devices/v3021.h b/jan/src/burn/devices/v3021.h deleted file mode 100644 index ccdfeff4a..000000000 --- a/jan/src/burn/devices/v3021.h +++ /dev/null @@ -1,9 +0,0 @@ -/* v3021 Calendar Emulation */ - -UINT8 v3021Read(); -void v3021Write(UINT16 data); - -void v3021Init(); -void v3021Exit(); - -INT32 v3021Scan(); diff --git a/jan/src/burn/devices/vdc.cpp b/jan/src/burn/devices/vdc.cpp deleted file mode 100644 index c653246fe..000000000 --- a/jan/src/burn/devices/vdc.cpp +++ /dev/null @@ -1,1296 +0,0 @@ -// Based on MESS driver by Charles MacDonald - -#include "tiles_generic.h" -#include "h6280_intf.h" - -UINT16 *vce_data; // allocate externally! -static UINT16 vce_address; -static UINT16 vce_control; - -static INT32 vce_current_bitmap_line; - -UINT8 *vdc_vidram[2]; // allocate externally! - -static UINT8 vdc_register[2]; -static UINT16 vdc_data[2][32]; -static UINT8 vdc_latch[2]; -static UINT16 vdc_yscroll[2]; -static UINT16 vdc_width[2]; -static UINT16 vdc_height[2]; -static UINT8 vdc_inc[2]; -static UINT8 vdc_dvssr_write[2]; -static UINT8 vdc_status[2]; -static UINT16 vdc_sprite_ram[2][0x100]; - -static INT32 vdc_vblank_triggered[2]; -static UINT16 vdc_current_segment[2]; -static UINT16 vdc_current_segment_line[2]; -static INT32 vdc_raster_count[2]; -static INT32 vdc_curline[2]; -static INT32 vdc_satb_countdown[2]; - -UINT16 *vdc_tmp_draw; // allocate externally! - -static UINT16 vpc_priority; -static UINT16 vpc_window1; -static UINT16 vpc_window2; -static UINT8 vpc_vdc_select; -static UINT8 vpc_prio[4]; -static UINT8 vpc_vdc0_enabled[4]; -static UINT8 vpc_vdc1_enabled[4]; -static UINT8 vpc_prio_map[0x200]; - -//-------------------------------------------------------------------------------------------------------------------------------- - -static void vpc_update_prio_map() -{ - for (INT32 i = 0; i < 512; i++) - { - vpc_prio_map[i] = 0; - if (vpc_window1 < 0x40 || i > vpc_window1) vpc_prio_map[i] |= 1; - if (vpc_window2 < 0x40 || i > vpc_window2) vpc_prio_map[i] |= 2; - } -} - -void vpc_write(UINT8 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vpc_write called without init\n")); -#endif - - switch (offset & 0x07) - { - case 0x00: /* Priority register #0 */ - vpc_priority = (vpc_priority & 0xff00) | data; - vpc_prio[0] = ( data >> 2 ) & 3; - vpc_vdc0_enabled[0] = data & 1; - vpc_vdc1_enabled[0] = data & 2; - vpc_prio[1] = ( data >> 6 ) & 3; - vpc_vdc0_enabled[1] = data & 0x10; - vpc_vdc1_enabled[1] = data & 0x20; - break; - - case 0x01: /* Priority register #1 */ - vpc_priority = (vpc_priority & 0x00ff) | (data << 8); - vpc_prio[2] = ( data >> 2 ) & 3; - vpc_vdc0_enabled[2] = data & 1; - vpc_vdc1_enabled[2] = data & 2; - vpc_prio[3] = ( data >> 6 ) & 3; - vpc_vdc0_enabled[3] = data & 0x10; - vpc_vdc1_enabled[3] = data & 0x20; - break; - - case 0x02: /* Window 1 LSB */ - vpc_window1 = (vpc_window1 & 0xff00) | data; - vpc_update_prio_map(); - break; - - case 0x03: /* Window 1 MSB */ - vpc_window1 = (vpc_window1 & 0x00ff) | ((data & 3) << 8); - vpc_update_prio_map(); - break; - - case 0x04: /* Window 2 LSB */ - vpc_window2 = (vpc_window2 & 0xff00) | data; - vpc_update_prio_map(); - break; - - case 0x05: /* Window 2 MSB */ - vpc_window2 = (vpc_window2 & 0x00ff) | ((data & 3) << 8); - vpc_update_prio_map(); - break; - - case 0x06: /* VDC I/O select */ - vpc_vdc_select = data & 1; - break; - } -} - -UINT8 vpc_read(UINT8 offset) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vpc_read called without init\n")); -#endif - - switch (offset & 0x07) - { - case 0x00: /* Priority register #0 */ - return vpc_priority & 0xff; - - case 0x01: /* Priority register #1 */ - return vpc_priority >> 8; - - case 0x02: /* Window 1 LSB */ - return vpc_window1 & 0xff; - - case 0x03: /* Window 1 MSB; high bits are 0 or 1? */ - return vpc_window1 >> 8; - - case 0x04: /* Window 2 LSB */ - return vpc_window2 & 0xff; - - case 0x05: /* Window 2 MSB; high bits are 0 or 1? */ - return vpc_window2 >> 8; - } - - return 0; -} - -void vpc_reset() -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vpc_reset called without init\n")); -#endif - - memset (vpc_prio, 0, 4); - memset (vpc_vdc0_enabled, 0, 4); - memset (vpc_vdc1_enabled, 0, 4); - memset (vpc_prio_map, 0, 0x200); - - vpc_write(0, 0x11); - vpc_write(1, 0x11); - vpc_window1 = 0; - vpc_window2 = 0; - vpc_vdc_select = 0; - vpc_priority = 0; -} - -//-------------------------------------------------------------------------------------------------------------------------------- - -UINT8 vce_read(UINT8 offset) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vce_read called without init\n")); -#endif - - switch (offset & 7) - { - case 0x04: - return (vce_data[vce_address] >> 0) & 0xff; //.l - - case 0x05: - UINT8 ret = ((vce_data[vce_address] >> 8) & 0xff) | 0xfe; //.h - vce_address = (vce_address + 1) & 0x01ff; - return ret; - } - - return 0xff; -} - -void vce_write(UINT8 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vce_write called without init\n")); -#endif - - switch (offset & 7) - { - case 0x00: - vce_control = data; - break; - - case 0x02: - vce_address = (vce_address & 0x100) | data; - break; - - case 0x03: - vce_address = (vce_address & 0x0ff) | ((data & 1) << 8); - break; - - case 0x04: - vce_data[vce_address] = (vce_data[vce_address] & 0x100) | data; - break; - - case 0x05: - vce_data[vce_address] = (vce_data[vce_address] & 0x0ff) | ((data & 1) << 8); - vce_address = (vce_address + 1) & 0x01ff; - break; - } -} - -void vce_palette_init(UINT32 *Palette) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vce_palette_init called without init\n")); -#endif - - for (INT32 i = 0; i < 512; i++) - { - INT32 r = ((i >> 3) & 7) << 5; - INT32 g = ((i >> 6) & 7) << 5; - INT32 b = ((i >> 0) & 7) << 5; - - INT32 y = ((66 * r + 129 * g + 25 * b + 128) >> 8) + 16; - - Palette[0x000 + i] = BurnHighCol(r, g, b, 0); - Palette[0x200 + i] = BurnHighCol(y, y, y, 0); - } -} - -void vce_reset() -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vce_reset called without init\n")); -#endif - - memset (vce_data, 0, 512 * sizeof(UINT16)); - - vce_address = 0; - vce_control = 0; - - vce_current_bitmap_line = 0; -} - - -//-------------------------------------------------------------------------------------------------------------------------------- - -#define STATE_VSW 0 -#define STATE_VDS 1 -#define STATE_VDW 2 -#define STATE_VCR 3 - -#define VDC_WPF 684 /* width of a line in frame including blanking areas */ -#define VDC_LPF 262 /* number of lines in a single frame */ - -#define VDC_BSY 0x40 /* Set when the VDC accesses VRAM */ -#define VDC_VD 0x20 /* Set when in the vertical blanking period */ -#define VDC_DV 0x10 /* Set when a VRAM > VRAM DMA transfer is done */ -#define VDC_DS 0x08 /* Set when a VRAM > SATB DMA transfer is done */ -#define VDC_RR 0x04 /* Set when the current scanline equals the RCR register */ -#define VDC_OR 0x02 /* Set when there are more than 16 sprites on a line */ -#define VDC_CR 0x01 /* Set when sprite #0 overlaps with another sprite */ - -#define CR_BB 0x80 /* Background blanking */ -#define CR_SB 0x40 /* Object blanking */ -#define CR_VR 0x08 /* Interrupt on vertical blank enable */ -#define CR_RC 0x04 /* Interrupt on line compare enable */ -#define CR_OV 0x02 /* Interrupt on sprite overflow enable */ -#define CR_CC 0x01 /* Interrupt on sprite #0 collision enable */ - -#define DCR_DSR 0x10 /* VRAM > SATB auto-transfer enable */ -#define DCR_DID 0x08 /* Destination diretion */ -#define DCR_SID 0x04 /* Source direction */ -#define DCR_DVC 0x02 /* VRAM > VRAM EOT interrupt enable */ -#define DCR_DSC 0x01 /* VRAM > SATB EOT interrupt enable */ - -enum vdc_regs {MAWR = 0, MARR, VxR, reg3, reg4, CR, RCR, BXR, BYR, MWR, HSR, HDR, VPR, VDW, VCR, DCR, SOUR, DESR, LENR, DVSSR }; - - -static void conv_obj(INT32 which, INT32 i, INT32 l, INT32 hf, INT32 vf, UINT8 *buf) -{ - INT32 b0, b1, b2, b3, i0, i1, i2, i3, x; - INT32 xi; - INT32 tmp; - - l &= 0x0F; - if(vf) l = (15 - l); - - tmp = l + ( i << 5); - - b0 = vdc_vidram[which][(tmp + 0x00) * 2 + 0]; - b0 |= vdc_vidram[which][(tmp + 0x00) * 2 + 1]<<8; - b1 = vdc_vidram[which][(tmp + 0x10) * 2 + 0]; - b1 |= vdc_vidram[which][(tmp + 0x10) * 2 + 1]<<8; - b2 = vdc_vidram[which][(tmp + 0x20) * 2 + 0]; - b2 |= vdc_vidram[which][(tmp + 0x20) * 2 + 1]<<8; - b3 = vdc_vidram[which][(tmp + 0x30) * 2 + 0]; - b3 |= vdc_vidram[which][(tmp + 0x30) * 2 + 1]<<8; - - for(x=0;x<16;x++) - { - if(hf) xi = x; else xi = (15 - x); - i0 = (b0 >> xi) & 1; - i1 = (b1 >> xi) & 1; - i2 = (b2 >> xi) & 1; - i3 = (b3 >> xi) & 1; - buf[x] = (i3 << 3 | i2 << 2 | i1 << 1 | i0); - } -} - -static void pce_refresh_sprites(INT32 which, INT32 line, UINT8 *drawn, UINT16 *line_buffer) -{ - INT32 i; - UINT8 sprites_drawn = 0; - - /* Are we in greyscale mode or in color mode? */ - INT32 color_base = vce_control & 0x80 ? 512 : 0; - - /* count up: Highest priority is Sprite 0 */ - for(i = 0; i < 64; i++) - { - static const INT32 cgy_table[] = {16, 32, 64, 64}; - - INT32 obj_y = (vdc_sprite_ram[which][(i << 2) + 0] & 0x03FF) - 64; - INT32 obj_x = (vdc_sprite_ram[which][(i << 2) + 1] & 0x03FF) - 32; - INT32 obj_i = (vdc_sprite_ram[which][(i << 2) + 2] & 0x07FE); - INT32 obj_a = (vdc_sprite_ram[which][(i << 2) + 3]); - INT32 cgx = (obj_a >> 8) & 1; /* sprite width */ - INT32 cgy = (obj_a >> 12) & 3; /* sprite height */ - INT32 hf = (obj_a >> 11) & 1; /* horizontal flip */ - INT32 vf = (obj_a >> 15) & 1; /* vertical flip */ - INT32 palette = (obj_a & 0x000F); - INT32 priority = (obj_a >> 7) & 1; - INT32 obj_h = cgy_table[cgy]; - INT32 obj_l = (line - obj_y); - INT32 cgypos; - UINT8 buf[16]; - - if ((obj_y == -64) || (obj_y > line)) continue; - if ((obj_x == -32) || (obj_x >= vdc_width[which])) continue; - - /* no need to draw an object that's ABOVE where we are. */ - if((obj_y + obj_h) < line) continue; - - /* If CGX is set, bit 0 of sprite pattern index is forced to 0 */ - if ( cgx ) - obj_i &= ~2; - - /* If CGY is set to 1, bit 1 of the sprite pattern index is forced to 0. */ - if ( cgy & 1 ) - obj_i &= ~4; - - /* If CGY is set to 2 or 3, bit 1 and 2 of the sprite pattern index are forced to 0. */ - if ( cgy & 2 ) - obj_i &= ~12; - - if (obj_l < obj_h) - { - sprites_drawn++; - if(sprites_drawn > 16) - { - if(vdc_data[which][0x05] & 0x02) - { - /* note: flag is set only if irq is taken, Mizubaku Daibouken relies on this behaviour */ - vdc_status[which] |= 0x02; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - continue; /* Should cause an interrupt */ - } - - cgypos = (obj_l >> 4); - if(vf) cgypos = ((obj_h - 1) >> 4) - cgypos; - - if(cgx == 0) - { - INT32 x; - INT32 pixel_x = ( ( obj_x * 512 ) / vdc_width[which] ); - - conv_obj(which, obj_i + (cgypos << 2), obj_l, hf, vf, buf); - - for(x = 0; x < 16; x++) - { - if(((obj_x + x) < (vdc_width[which])) && ((obj_x + x) >= 0)) - { - if ( buf[x] ) - { - if( drawn[pixel_x] < 2 ) - { - if( priority || drawn[pixel_x] == 0 ) - { - line_buffer[pixel_x] = color_base + vce_data[0x100 + (palette << 4) + buf[x]]; - - if ( vdc_width[which] != 512 ) - { - INT32 dp = 1; - while ( pixel_x + dp < ( ( ( obj_x + x + 1 ) * 512 ) / vdc_width[which] ) ) - { - drawn[pixel_x + dp] = i + 2; - line_buffer[pixel_x + dp] = color_base + vce_data[0x100 + (palette << 4) + buf[x]]; - dp++; - } - } - } - drawn[pixel_x] = i + 2; - } - /* Check for sprite #0 collision */ - else if (drawn[pixel_x] == 2) - { - if(vdc_data[which][0x05] & 0x01) - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - vdc_status[which] |= 0x01; - } - } - } - if ( vdc_width[which] != 512 ) - { - pixel_x = ( ( obj_x + x + 1 ) * 512 ) / vdc_width[which]; - } - else - { - pixel_x += 1; - } - } - } - else - { - INT32 x; - INT32 pixel_x = ( ( obj_x * 512 ) / vdc_width[which] ); - - conv_obj(which, obj_i + (cgypos << 2) + (hf ? 2 : 0), obj_l, hf, vf, buf); - - for(x = 0; x < 16; x++) - { - if(((obj_x + x) < (vdc_width[which])) && ((obj_x + x) >= 0)) - { - if ( buf[x] ) - { - if( drawn[pixel_x] < 2 ) - { - if ( priority || drawn[pixel_x] == 0 ) - { - line_buffer[pixel_x] = color_base + vce_data[0x100 + (palette << 4) + buf[x]]; - if ( vdc_width[which] != 512 ) - { - INT32 dp = 1; - while ( pixel_x + dp < ( ( ( obj_x + x + 1 ) * 512 ) / vdc_width[which] ) ) - { - drawn[pixel_x + dp] = i + 2; - line_buffer[pixel_x + dp] = color_base + vce_data[0x100 + (palette << 4) + buf[x]]; - dp++; - } - } - } - drawn[pixel_x] = i + 2; - } - /* Check for sprite #0 collision */ - else if ( drawn[pixel_x] == 2 ) - { - if(vdc_data[which][0x05] & 0x01) - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - vdc_status[which] |= 0x01; - } - } - } - if ( vdc_width[which] != 512 ) - { - pixel_x = ( ( obj_x + x + 1 ) * 512 ) / vdc_width[which]; - } - else - { - pixel_x += 1; - } - } - - /* 32 pixel wide sprites are counted as 2 sprites and the right half - is only drawn if there are 2 open slots. - */ - sprites_drawn++; - if( sprites_drawn > 16 ) - { - if(vdc_data[which][0x05] & 0x02) - { - /* note: flag is set only if irq is taken, Mizubaku Daibouken relies on this behaviour */ - vdc_status[which] |= 0x02; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - } - else - { - conv_obj(which, obj_i + (cgypos << 2) + (hf ? 0 : 2), obj_l, hf, vf, buf); - for(x = 0; x < 16; x++) - { - if(((obj_x + 0x10 + x) < (vdc_width[which])) && ((obj_x + 0x10 + x) >= 0)) - { - if ( buf[x] ) - { - if( drawn[pixel_x] < 2 ) - { - if( priority || drawn[pixel_x] == 0 ) - { - line_buffer[pixel_x] = color_base + vce_data[0x100 + (palette << 4) + buf[x]]; - if ( vdc_width[which] != 512 ) - { - INT32 dp = 1; - while ( pixel_x + dp < ( ( ( obj_x + x + 17 ) * 512 ) / vdc_width[which] ) ) - { - drawn[pixel_x + dp] = i + 2; - line_buffer[pixel_x + dp] = color_base + vce_data[0x100 + (palette << 4) + buf[x]]; - dp++; - } - } - } - drawn[pixel_x] = i + 2; - } - /* Check for sprite #0 collision */ - else if ( drawn[pixel_x] == 2 ) - { - if(vdc_data[which][0x05] & 0x01) - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - vdc_status[which] |= 0x01; - } - } - } - if ( vdc_width[which] != 512 ) - { - pixel_x = ( ( obj_x + x + 17 ) * 512 ) / vdc_width[which]; - } - else - { - pixel_x += 1; - } - } - } - } - } - } -} - - -static void draw_overscan_line(INT32 line) -{ - INT32 i; - - /* Are we in greyscale mode or in color mode? */ - INT32 color_base = vce_control & 0x80 ? 512 : 0; - - /* our line buffer */ - UINT16 *line_buffer = vdc_tmp_draw + line * 684; //&vce.bmp->pix16(line); - - for ( i = 0; i < 684; i++ ) - line_buffer[i] = color_base + vce_data[0x100]; -} - -static void draw_sgx_overscan_line(INT32 line) -{ - INT32 i; - - /* Are we in greyscale mode or in color mode? */ - INT32 color_base = vce_control & 0x80 ? 512 : 0; - - /* our line buffer */ - UINT16 *line_buffer = vdc_tmp_draw + line * 684; //&vce.bmp->pix16(line); - - for ( i = 0; i < VDC_WPF; i++ ) - line_buffer[i] = color_base + vce_data[0]; -} - -static void draw_black_line(INT32 line) -{ - UINT16 *line_buffer = vdc_tmp_draw + line * 684; //&vce.bmp->pix16(line); - - for(INT32 i=0; i< 684; i++) - line_buffer[i] = 0x400; // black -} - -static void vdc_advance_line(INT32 which) -{ - INT32 ret = 0; - - vdc_curline[which] += 1; - vdc_current_segment_line[which] += 1; - vdc_raster_count[which] += 1; - - if ( vdc_satb_countdown[which] ) - { - vdc_satb_countdown[which] -= 1; - if ( vdc_satb_countdown[which] == 0 ) - { - if ( vdc_data[which][DCR] & DCR_DSC ) - { - vdc_status[which] |= VDC_DS; /* set satb done flag */ - ret = 1; - } - } - } - - if ( vce_current_bitmap_line == 0 ) - { - vdc_current_segment[which] = STATE_VSW; - vdc_current_segment_line[which] = 0; - vdc_vblank_triggered[which] = 0; - vdc_curline[which] = 0; - } - - if ( STATE_VSW == vdc_current_segment[which] && vdc_current_segment_line[which] >= ( (vdc_data[which][VPR]&0xff) & 0x1F ) ) - { - vdc_current_segment[which] = STATE_VDS; - vdc_current_segment_line[which] = 0; - } - - if ( STATE_VDS == vdc_current_segment[which] && vdc_current_segment_line[which] >= (vdc_data[which][VPR] >> 8) ) - { - vdc_current_segment[which] = STATE_VDW; - vdc_current_segment_line[which] = 0; - vdc_raster_count[which] = 0x40; - } - - if ( STATE_VDW == vdc_current_segment[which] && vdc_current_segment_line[which] > ( vdc_data[which][VDW] & 0x01FF ) ) - { - vdc_current_segment[which] = STATE_VCR; - vdc_current_segment_line[which] = 0; - - /* Generate VBlank interrupt, sprite DMA */ - vdc_vblank_triggered[which] = 1; - if ( vdc_data[which][CR] & CR_VR ) - { - vdc_status[which] |= VDC_VD; - ret = 1; - } - - /* do VRAM > SATB DMA if the enable bit is set or the DVSSR reg. was written to */ - if( ( vdc_data[which][DCR] & DCR_DSR ) || vdc_dvssr_write[which] ) - { - INT32 i; - - vdc_dvssr_write[which] = 0; - - for( i = 0; i < 256; i++ ) - { - vdc_sprite_ram[which][i] = ( vdc_vidram[which][ ( vdc_data[which][DVSSR] << 1 ) + i * 2 + 1 ] << 8 ) | vdc_vidram[which][ ( vdc_data[which][DVSSR] << 1 ) + i * 2 ]; - } - - /* generate interrupt if needed */ - if ( vdc_data[which][DCR] & DCR_DSC ) - { - vdc_satb_countdown[which] = 4; - } - } - } - - if ( STATE_VCR == vdc_current_segment[which] ) - { - if ( vdc_current_segment_line[which] >= 3 && vdc_current_segment_line[which] >= (vdc_data[which][VCR]&0xff) ) - { - vdc_current_segment[which] = STATE_VSW; - vdc_current_segment_line[which] = 0; - vdc_curline[which] = 0; - } - } - - /* generate interrupt on line compare if necessary */ - if ( vdc_raster_count[which] == vdc_data[which][RCR] && vdc_data[which][CR] & CR_RC ) - { - vdc_status[which] |= VDC_RR; - ret = 1; - } - - /* handle frame events */ - if(vdc_curline[which] == 261 && ! vdc_vblank_triggered[which] ) - { - - vdc_vblank_triggered[which] = 1; - if(vdc_data[which][CR] & CR_VR) - { /* generate IRQ1 if enabled */ - vdc_status[which] |= VDC_VD; /* set vblank flag */ - ret = 1; - } - - /* do VRAM > SATB DMA if the enable bit is set or the DVSSR reg. was written to */ - if ( ( vdc_data[which][DCR] & DCR_DSR ) || vdc_dvssr_write[which] ) - { - INT32 i; - - vdc_dvssr_write[which] = 0; - - for( i = 0; i < 256; i++ ) - { - vdc_sprite_ram[which][i] = ( vdc_vidram[which][ ( vdc_data[which][DVSSR] << 1 ) + i * 2 + 1 ] << 8 ) | vdc_vidram[which][ ( vdc_data[which][DVSSR] << 1 ) + i * 2 ]; - } - - /* generate interrupt if needed */ - if(vdc_data[which][DCR] & DCR_DSC) - { - vdc_satb_countdown[which] = 4; - } - } - } - - if (ret) - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); -} - -static void pce_refresh_line(INT32 which, INT32 /*line*/, INT32 external_input, UINT8 *drawn, UINT16 *line_buffer) -{ - static const INT32 width_table[4] = {5, 6, 7, 7}; - - INT32 scroll_y = ( vdc_yscroll[which] & 0x01FF); - INT32 scroll_x = (vdc_data[which][BXR] & 0x03FF); - INT32 nt_index; - - /* is virtual map 32 or 64 characters tall ? (256 or 512 pixels) */ - INT32 v_line = (scroll_y) & (vdc_data[which][MWR] & 0x0040 ? 0x1FF : 0x0FF); - - /* row within character */ - INT32 v_row = (v_line & 7); - - /* row of characters in BAT */ - INT32 nt_row = (v_line >> 3); - - /* virtual X size (# bits to shift) */ - INT32 v_width = width_table[(vdc_data[which][MWR] >> 4) & 3]; - - /* pointer to the name table (Background Attribute Table) in VRAM */ - UINT8 *bat = &(vdc_vidram[which][nt_row << (v_width+1)]); - - /* Are we in greyscale mode or in color mode? */ - INT32 color_base = vce_control & 0x80 ? 512 : 0; - - INT32 b0, b1, b2, b3; - INT32 i0, i1, i2, i3; - INT32 cell_pattern_index; - INT32 cell_palette; - INT32 x, c, i; - - /* character blanking bit */ - if(!(vdc_data[which][CR] & CR_BB)) - { - return; - } - else - { - INT32 pixel = 0; - INT32 phys_x = - ( scroll_x & 0x07 ); - - for(i=0;i<(vdc_width[which] >> 3) + 1;i++) - { - nt_index = (i + (scroll_x >> 3)) & ((2 << (v_width-1))-1); - nt_index *= 2; - - /* get name table data: */ - - /* palette # = index from 0-15 */ - cell_palette = ( bat[nt_index + 1] >> 4 ) & 0x0F; - - /* This is the 'character number', from 0-0x0FFF */ - /* then it is shifted left 4 bits to form a VRAM address */ - /* and one more bit to convert VRAM word offset to a */ - /* byte-offset within the VRAM space */ - cell_pattern_index = ( ( ( bat[nt_index + 1] << 8 ) | bat[nt_index] ) & 0x0FFF) << 5; - - INT32 vram_offs = (cell_pattern_index + (v_row << 1)) & 0xffff; - - b0 = vdc_vidram[which][vram_offs + 0x00]; - b1 = vdc_vidram[which][vram_offs + 0x01]; - b2 = vdc_vidram[which][vram_offs + 0x10]; - b3 = vdc_vidram[which][vram_offs + 0x11]; - - for(x=0;x<8;x++) - { - i0 = (b0 >> (7-x)) & 1; - i1 = (b1 >> (7-x)) & 1; - i2 = (b2 >> (7-x)) & 1; - i3 = (b3 >> (7-x)) & 1; - c = (cell_palette << 4 | i3 << 3 | i2 << 2 | i1 << 1 | i0); - - /* colour #0 always comes from palette #0 */ - if ( ! ( c & 0x0F ) ) - c &= 0x0F; - - if ( phys_x >= 0 && phys_x < vdc_width[which] ) - { - drawn[ pixel ] = c ? 1 : 0; - if ( c || ! external_input ) - line_buffer[ pixel ] = color_base + vce_data[c]; - pixel++; - if ( vdc_width[which] != 512 ) - { - while ( pixel < ( ( ( phys_x + 1 ) * 512 ) / vdc_width[which] ) ) - { - drawn[ pixel ] = c ? 1 : 0; - if ( c || ! external_input ) - line_buffer[ pixel ] = color_base + vce_data[c]; - pixel++; - } - } - } - phys_x += 1; - } - } - } -} - -void pce_interrupt() -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("pce_interrupt called without init\n")); -#endif - - INT32 which = 0; // only 1 on pce - - if (vce_current_bitmap_line >= 14 && vce_current_bitmap_line < 256) - { - draw_overscan_line(vce_current_bitmap_line); - - if (vdc_current_segment[which] == 0x02) - { - UINT8 drawn[684]; - UINT16 *line_buffer = vdc_tmp_draw + (vce_current_bitmap_line * 684) + 86; - - memset (drawn, 0, 684); - - vdc_yscroll[which] = (vdc_current_segment_line[which] == 0) ? vdc_data[which][BYR] : (vdc_yscroll[which] + 1); - - pce_refresh_line(0, vdc_current_segment_line[which], 0, drawn, line_buffer); - - if (vdc_data[which][CR] & CR_SB) - { - pce_refresh_sprites(0, vdc_current_segment_line[which], drawn, line_buffer); - } - } - } - else - { - draw_black_line(vce_current_bitmap_line); - } - - vce_current_bitmap_line = (vce_current_bitmap_line + 1) % VDC_LPF; - vdc_advance_line(0); -} - -void sgx_interrupt() -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("sgx_interrupt called without init\n")); -#endif - - if (vce_current_bitmap_line >= 14 && vce_current_bitmap_line < 256) - { - draw_sgx_overscan_line(vce_current_bitmap_line); - - if ( vdc_current_segment[0] == STATE_VDW ) - { - UINT8 drawn[2][512]; - UINT16 *line_buffer; - UINT16 temp_buffer[2][512]; - INT32 i; - - memset( drawn, 0, sizeof(drawn) ); - - vdc_yscroll[0] = ( vdc_current_segment_line[0] == 0 ) ? vdc_data[0][BYR] : ( vdc_yscroll[0] + 1 ); - vdc_yscroll[1] = ( vdc_current_segment_line[1] == 0 ) ? vdc_data[1][BYR] : ( vdc_yscroll[1] + 1 ); - - pce_refresh_line( 0, vdc_current_segment_line[0], 0, drawn[0], temp_buffer[0]); - - if(vdc_data[0][CR] & CR_SB) - { - pce_refresh_sprites(0, vdc_current_segment_line[0], drawn[0], temp_buffer[0]); - } - - pce_refresh_line( 1, vdc_current_segment_line[1], 1, drawn[1], temp_buffer[1]); - - if ( vdc_data[1][CR] & CR_SB ) - { - pce_refresh_sprites(1, vdc_current_segment_line[1], drawn[1], temp_buffer[1]); - } - - line_buffer = vdc_tmp_draw + (vce_current_bitmap_line * 684) + 86; - - for( i = 0; i < 512; i++ ) - { - INT32 cur_prio = vpc_prio_map[i]; - - if ( vpc_vdc0_enabled[cur_prio] ) - { - if ( vpc_vdc1_enabled[cur_prio] ) - { - switch( vpc_prio[cur_prio] ) - { - case 0: /* BG1 SP1 BG0 SP0 */ - if ( drawn[0][i] ) - { - line_buffer[i] = temp_buffer[0][i]; - } - else if ( drawn[1][i] ) - { - line_buffer[i] = temp_buffer[1][i]; - } - break; - case 1: /* BG1 BG0 SP1 SP0 */ - if ( drawn[0][i] ) - { - if ( drawn[0][i] > 1 ) - { - line_buffer[i] = temp_buffer[0][i]; - } - else - { - if ( drawn[1][i] > 1 ) - { - line_buffer[i] = temp_buffer[1][i]; - } - else - { - line_buffer[i] = temp_buffer[0][i]; - } - } - } - else if ( drawn[1][i] ) - { - line_buffer[i] = temp_buffer[1][i]; - } - break; - case 2: - if ( drawn[0][i] ) - { - if ( drawn[0][i] > 1 ) - { - if ( drawn[1][i] == 1 ) - { - line_buffer[i] = temp_buffer[1][i]; - } - else - { - line_buffer[i] = temp_buffer[0][i]; - } - } - else - { - line_buffer[i] = temp_buffer[0][i]; - } - } - else if ( drawn[1][i] ) - { - line_buffer[i] = temp_buffer[1][i]; - } - break; - } - } - else - { - if ( drawn[0][i] ) - { - line_buffer[i] = temp_buffer[0][i]; - } - } - } - else - { - if ( vpc_vdc1_enabled[cur_prio] ) - { - if ( drawn[1][i] ) - { - line_buffer[i] = temp_buffer[1][i]; - } - } - } - } - } - } - else - { - draw_black_line(vce_current_bitmap_line); - } - - /* bump current scanline */ - vce_current_bitmap_line = ( vce_current_bitmap_line + 1 ) % VDC_LPF; - vdc_advance_line( 0 ); - vdc_advance_line( 1 ); -} - -static void vdc_do_dma(INT32 which) -{ - INT32 src = vdc_data[which][0x10]; - INT32 dst = vdc_data[which][0x11]; - INT32 len = vdc_data[which][0x12]; - - INT32 did = (vdc_data[which][0x0f] >> 3) & 1; - INT32 sid = (vdc_data[which][0x0f] >> 2) & 1; - INT32 dvc = (vdc_data[which][0x0f] >> 1) & 1; - - do { - UINT8 l, h; - - l = vdc_vidram[which][((src * 2) + 0) & 0xffff]; - h = vdc_vidram[which][((src * 2) + 1) & 0xffff]; - - if ((dst & 0x8000) == 0) { - vdc_vidram[which][(dst * 2) + 0] = l; - vdc_vidram[which][(dst * 2) + 1] = h; - } - - if(sid) src = (src - 1) & 0xffff; - else src = (src + 1) & 0xffff; - - if(did) dst = (dst - 1) & 0xffff; - else dst = (dst + 1) & 0xffff; - - len = (len - 1) & 0xffff; - - } while (len != 0xffff); - - vdc_status[which] |= 0x10; - vdc_data[which][0x10] = src; - vdc_data[which][0x11] = dst; - vdc_data[which][0x12] = len; - - if (dvc) - { - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - } -} - -void vdc_write(INT32 which, UINT8 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vdc_write called without init\n")); -#endif - - switch (offset & 3) - { - case 0x00: - vdc_register[which] = data & 0x1f; - break; - - case 0x02: - { - vdc_data[which][vdc_register[which]] = (vdc_data[which][vdc_register[which]] & 0xff00) | data; - - switch (vdc_register[which]) - { - case VxR:{ - vdc_latch[which] = data; - } - break; - - case BYR: { - vdc_yscroll[which]=vdc_data[which][BYR]; - } - break; - - case HDR: { - vdc_width[which] = ((data & 0x003F) + 1) << 3; - } - break; - - case VDW: { - vdc_height[which] &= 0xFF00; - vdc_height[which] |= (data & 0xFF); - vdc_height[which] &= 0x01FF; - } - break; - - case LENR: - case SOUR: - case DESR: - break; - } - } - break; - - case 0x03: - { - vdc_data[which][vdc_register[which]] = (vdc_data[which][vdc_register[which]] & 0x00ff) | (data << 8); - - switch (vdc_register[which]) - { - case VxR: - { - INT32 voff = vdc_data[which][MAWR] * 2; - if ((voff & 0x10000) == 0) { - vdc_vidram[which][voff + 0] = vdc_latch[which]; - vdc_vidram[which][voff + 1] = data; - } - vdc_data[which][MAWR] += vdc_inc[which]; - } - break; - - case CR: - { - static const UINT8 inctab[] = {1, 32, 64, 128}; - vdc_inc[which] = inctab[(data >> 3) & 3]; - } - break; - - case VDW: - { - vdc_height[which] &= 0x00FF; - vdc_height[which] |= (data << 8); - vdc_height[which] &= 0x01FF; - } - break; - - case DVSSR: - vdc_dvssr_write[which] = 1; - break; - - case BYR: - vdc_yscroll[which]=vdc_data[which][BYR]; - break; - - case LENR: - vdc_do_dma( which ); - break; - - case SOUR: - case DESR: - break; - } - } - break; - } -} - -UINT8 vdc_read(INT32 which, UINT8 offset) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vdc_read called without init\n")); -#endif - - switch(offset & 3) - { - case 0x00: { - UINT8 ret = vdc_status[which]; - vdc_status[which] &= ~0x3f; - h6280SetIRQLine(0, CPU_IRQSTATUS_NONE); - return ret; - } - - case 0x02: { - INT32 voff = (vdc_data[which][1] * 2 + 0) & 0xffff; - return vdc_vidram[which][voff]; - } - - case 0x03: { - INT32 voff = (vdc_data[which][1] * 2 + 1) & 0xffff; - if (vdc_register[which] == 0x02) vdc_data[which][1] += vdc_inc[which]; - return vdc_vidram[which][voff]; - } - } - - return 0; -} - -void sgx_vdc_write(UINT8 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("sgx_vdc_write called without init\n")); -#endif - - if (vpc_vdc_select) - { - vdc_write( 1, offset, data ); - } - else - { - vdc_write( 0, offset, data ); - } -} - -UINT8 sgx_vdc_read(UINT8 offset) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("sgx_vdc_read called without init\n")); -#endif - - return (vpc_vdc_select) ? vdc_read( 1, offset ) : vdc_read( 0, offset ); -} - -void vdc_reset() -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vdc_reset called without init\n")); -#endif - - memset (vdc_register, 0, 2); - memset (vdc_data, 0, 2 * 32 * sizeof(UINT16)); - memset (vdc_latch, 0, 2); - memset (vdc_yscroll, 0, 2 * sizeof(UINT16)); - memset (vdc_width, 0, 2 * sizeof(UINT16)); - memset (vdc_height, 0, 2 * sizeof(UINT16)); - memset (vdc_inc, 0, 2); - memset (vdc_dvssr_write, 0, 2); - memset (vdc_status, 0, 2); - memset (vdc_sprite_ram, 0, 2 * 0x100 * sizeof(UINT16)); - memset (vdc_vblank_triggered, 0, 2 * sizeof(INT32)); - memset (vdc_current_segment, 0, 2 * sizeof(UINT16)); - memset (vdc_current_segment_line, 0, 2 * sizeof(UINT16)); - memset (vdc_raster_count, 0, 2 * sizeof(INT32)); - memset (vdc_curline, 0, 2 * sizeof(INT32)); - memset (vdc_satb_countdown, 0, 2 * sizeof(INT32)); - - vdc_inc[0] = 1; - vdc_inc[1] = 1; -} - -void vdc_get_dimensions(INT32 which, INT32 *x, INT32 *y) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vdc_get_dimensions called without init\n")); -#endif - - *x = vdc_width[which] * 2; - *y = vdc_height[which]; -} - -void vdc_init() -{ - DebugDev_VDCInitted = 1; -} - -void vdc_exit() -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vdc_exit called without init\n")); -#endif - - DebugDev_VDCInitted = 0; -} - -INT32 vdc_scan(INT32 nAction, INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugDev_VDCInitted) bprintf(PRINT_ERROR, _T("vdc_scan called without init\n")); -#endif - - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i < 2; i++) { - SCAN_VAR(vdc_register[i]); - SCAN_VAR(vdc_data[i]); - SCAN_VAR(vdc_latch[i]); - SCAN_VAR(vdc_yscroll[i]); - SCAN_VAR(vdc_width[i]); - SCAN_VAR(vdc_height[i]); - SCAN_VAR(vdc_inc[i]); - SCAN_VAR(vdc_dvssr_write[i]); - SCAN_VAR(vdc_status[i]); - SCAN_VAR(vdc_sprite_ram[i]); - SCAN_VAR(vdc_vblank_triggered[i]); - SCAN_VAR(vdc_current_segment[i]); - SCAN_VAR(vdc_current_segment_line[i]); - SCAN_VAR(vdc_raster_count[i]); - SCAN_VAR(vdc_curline[i]); - SCAN_VAR(vdc_satb_countdown[i]); - } - - ba.Data = vdc_sprite_ram; - ba.nLen = 2 * 0x100 * sizeof(UINT16); - ba.nAddress = 0; - ba.szName = "VDC Sprite RAM"; - BurnAcb(&ba); - - ba.Data = vdc_data; - ba.nLen = 2 * 0x20 * sizeof(UINT16); - ba.nAddress = 0; - ba.szName = "VDC DATA"; - BurnAcb(&ba); - - SCAN_VAR(vce_address); - SCAN_VAR(vce_control); - SCAN_VAR(vce_current_bitmap_line); - - SCAN_VAR(vpc_window1); - SCAN_VAR(vpc_window2); - SCAN_VAR(vpc_vdc_select); - SCAN_VAR(vpc_priority); - - for (INT32 i = 0; i < 4; i++) { - SCAN_VAR(vpc_prio[i]); - SCAN_VAR(vpc_vdc0_enabled[i]); - SCAN_VAR(vpc_vdc1_enabled[i]); - } - - ba.Data = vpc_prio_map; - ba.nLen = 0x0000200; - ba.nAddress = 0; - ba.szName = "VPC Priority Map"; - BurnAcb(&ba); - } - - return 0; -} diff --git a/jan/src/burn/devices/vdc.h b/jan/src/burn/devices/vdc.h deleted file mode 100644 index 7a2bc9eea..000000000 --- a/jan/src/burn/devices/vdc.h +++ /dev/null @@ -1,33 +0,0 @@ - -// video -void vdc_reset(); -void vdc_write(INT32 which, UINT8 offset, UINT8 data); -UINT8 vdc_read(INT32 which, UINT8 offset); -extern UINT8 *vdc_vidram[2]; -extern UINT16 *vdc_tmp_draw; - -void pce_interrupt(); // update scanline... -void sgx_interrupt(); - -void vdc_get_dimensions(INT32 which, INT32 *x, INT32 *y); // get resolution - -void sgx_vdc_write(UINT8 offset, UINT8 data); -UINT8 sgx_vdc_read(UINT8 offset); - -void vdc_init(); -void vdc_exit(); - - -// priority -void vpc_reset(); -void vpc_write(UINT8 offset, UINT8 data); -UINT8 vpc_read(UINT8 offset); - -// palette -void vce_reset(); -void vce_palette_init(UINT32 *Palette); -void vce_write(UINT8 offset, UINT8 data); -UINT8 vce_read(UINT8 offset); -extern UINT16 *vce_data; - -INT32 vdc_scan(INT32 nAction, INT32 *pnMin); diff --git a/jan/src/burn/devices/watchdog.cpp b/jan/src/burn/devices/watchdog.cpp deleted file mode 100644 index da3903178..000000000 --- a/jan/src/burn/devices/watchdog.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "burnint.h" - -static INT32 (*WatchdogReset)(INT32 clear_mem) = NULL; -static INT32 WatchdogFrames = 0; -static INT32 Watchdog = 0; -static INT32 WatchdogEnable = 0; - -void BurnWatchogWrite() -{ - Watchdog = 0; - WatchdogEnable = 1; -} - -UINT8 BurnWatchdogRead() -{ - Watchdog = 0; - WatchdogEnable = 1; - - return 0; -} - -void BurnWatchdogReset() -{ - Watchdog = 0; - WatchdogEnable = 0; -} - -void BurnWatchdogInit(INT32 (*reset)(INT32 clear_mem), INT32 frames) -{ - if (reset == NULL) { -#if defined FBA_DEBUG - bprintf (PRINT_ERROR, _T("Error: BurnWatchdogInit called with no reset!\n")); -#endif - return; - } - - if (frames == 0) { -#if defined FBA_DEBUG - bprintf (PRINT_ERROR, _T("Error: BurnWatchdogInit called with 0 frames (%d)!\n"), frames); -#endif - frames = 180; // default - } - - WatchdogReset = reset; - WatchdogFrames = frames; -} - -void BurnWatchdogUpdate() -{ - if (WatchdogFrames == -1) { - return; - } - - if (WatchdogEnable) { - Watchdog++; - } - - if (Watchdog >= WatchdogFrames) { - if (WatchdogReset != NULL) { - WatchdogReset(0); -#if defined FBA_DEBUG - bprintf (0, _T("BurnWatchdogUpdate - Watchdog triggered!\n")); -#endif - - } - } - - Watchdog = 0; -} - -INT32 BurnWatchdogScan(INT32 nAction) -{ - if (nAction & ACB_VOLATILE) - { - SCAN_VAR(WatchdogEnable); - SCAN_VAR(Watchdog); - } - - return 0; -} diff --git a/jan/src/burn/devices/watchdog.h b/jan/src/burn/devices/watchdog.h deleted file mode 100644 index 87c59816c..000000000 --- a/jan/src/burn/devices/watchdog.h +++ /dev/null @@ -1,25 +0,0 @@ - -// call this when resetting the watchdog timer on writes -// the watchdog will never trigger if the timer hasn't been reset once -void BurnWatchogWrite(); - -// call this when resetting the watchdog time on reads -// the watchdog will never trigger if the timer hasn't been reset once -UINT8 BurnWatchdogRead(); - -// call this in the DrvReset -void BurnWatchdogReset(); - -// call this to initialize the watchdog -// pass the DrvReset routine though this (note INT32 DrvReset(INT32 clear_mem)) -// note watchdog should not clear ram! It should really only reset the cpus and -// sound cores(?) -// pass the number of frames without resetting the timer before triggering -// pass -1 for frames to disable watchdog entirely -void BurnWatchdogInit(INT32 (*reset)(INT32 clear_mem), INT32 frames); - -// update the wathdog timer, call at the start of the 'Frame function. -void BurnWatchdogUpdate(); - -// save state support -INT32 BurnWatchdogScan(INT32 nAction); diff --git a/jan/src/burn/driver.h b/jan/src/burn/driver.h deleted file mode 100644 index ffddfe60a..000000000 --- a/jan/src/burn/driver.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * For the MAME sound cores - */ - -#ifndef DRIVER_H -#define DRIVER_H - -#include -#include -#include -#include - -#if !defined (_WIN32) - #define __cdecl -#endif - -#ifndef INLINE - #define INLINE __inline static -#endif - -#define FBA - -typedef unsigned char UINT8; -typedef signed char INT8; -typedef unsigned short UINT16; -typedef signed short INT16; -typedef unsigned int UINT32; -typedef signed int INT32; -#ifdef _MSC_VER -typedef signed __int64 INT64; -typedef unsigned __int64 UINT64; -#else -__extension__ typedef unsigned long long UINT64; -__extension__ typedef long long INT64; -#endif - -// Alignment macro, to keep savestates compatible between 32/64bit platforms. -#ifdef _MSC_VER -#define ALIGN_VAR(x) __declspec(align(x)) -#else -#define ALIGN_VAR(x) __attribute__((aligned(x))) -#endif - -#define OSD_CPU_H - -/* U64 and S64 are used to wrap long integer constants. */ -#if defined(__GNUC__) || defined(_MSC_VER) -#define U64(val) val##ULL -#define S64(val) val##LL -#else -#define U64(val) val -#define S64(val) val -#endif - -/* OPN */ -#define HAS_YM2203 1 -#define HAS_YM2608 1 -#define HAS_YM2610 1 -#define HAS_YM2610B 1 -#define HAS_YM2612 1 -#define HAS_YM3438 1 -/* OPL */ -#define HAS_YM3812 1 -#define HAS_YM3526 1 -#define HAS_Y8950 1 - -enum { - CLEAR_LINE = 0, - ASSERT_LINE, - HOLD_LINE, - PULSE_LINE -}; - -#define timer_get_time() BurnTimerGetTime() - -#define READ8_HANDLER(name) UINT8 name(void) -#define WRITE8_HANDLER(name) void name(UINT8 data) - -#ifdef __cplusplus - extern "C" { -#endif - double BurnTimerGetTime(void); - - typedef UINT8 (*read8_handler)(UINT32 offset); - typedef void (*write8_handler)(UINT32 offset, UINT32 data); - - #ifdef MAME_USE_LOGERROR - void __cdecl logerror(char* szFormat, ...); - #else - #define logerror - #endif -#ifdef __cplusplus - } -#endif - -#endif /* DRIVER_H */ diff --git a/jan/src/burn/drv/capcom/cps.cpp b/jan/src/burn/drv/capcom/cps.cpp deleted file mode 100644 index d5480fb0a..000000000 --- a/jan/src/burn/drv/capcom/cps.cpp +++ /dev/null @@ -1,2107 +0,0 @@ -#include "cps.h" -// CPS (general) - -INT32 Cps = 0; // 1 = CPS1, 2 = CPS2, 3 = CPS Changer -INT32 Cps1Qs = 0; -INT32 Cps1DisablePSnd = 0; // Disables the Z80 as well -INT32 Cps2DisableQSnd = 0; // Disables the Z80 as well - -INT32 nCPS68KClockspeed = 0; -INT32 nCpsCycles = 0; // 68K Cycles per frame -INT32 nCpsZ80Cycles; - -UINT8 *CpsGfx =NULL; UINT32 nCpsGfxLen =0; // All the graphics -UINT8 *CpsRom =NULL; UINT32 nCpsRomLen =0; // Program Rom (as in rom) -UINT8 *CpsCode=NULL; UINT32 nCpsCodeLen=0; // Program Rom (decrypted) -UINT8 *CpsZRom=NULL; UINT32 nCpsZRomLen=0; // Z80 Roms -INT8 *CpsQSam=NULL; UINT32 nCpsQSamLen=0; // QSound Sample Roms -UINT8 *CpsAd =NULL; UINT32 nCpsAdLen =0; // ADPCM Data -UINT8 *CpsStar=NULL; -UINT8 *CpsKey=NULL; UINT32 nCpsKeyLen = 0; -UINT32 nCpsGfxScroll[4]={0,0,0,0}; // Offset to Scroll tiles -UINT32 nCpsGfxMask=0; // Address mask - -// Separate out the bits of a byte -inline static UINT32 Separate(UINT32 b) -{ - UINT32 a = b; // 00000000 00000000 00000000 11111111 - a =((a & 0x000000F0) << 12) | (a & 0x0000000F); // 00000000 00001111 00000000 00001111 - a = ((a & 0x000C000C) << 6) | (a & 0x00030003); // 00000011 00000011 00000011 00000011 - a = ((a & 0x02020202) << 3) | (a & 0x01010101); // 00010001 00010001 00010001 00010001 - - return a; -} - -// Precalculated table of the Separate function -static UINT32 SepTable[256]; - -static INT32 SepTableCalc() -{ - static INT32 bDone = 0; - if (bDone) { - return 0; // Already done it - } - - for (INT32 i = 0; i < 256; i++) { - SepTable[i] = Separate(255 - i); - } - - bDone = 1; // done it - return 0; -} - -// Allocate space and load up a rom -static INT32 LoadUp(UINT8** pRom, INT32* pnRomLen, INT32 nNum) -{ - UINT8 *Rom; - struct BurnRomInfo ri; - - ri.nLen = 0; - BurnDrvGetRomInfo(&ri, nNum); // Find out how big the rom is - if (ri.nLen <= 0) { - return 1; - } - - // Load the rom - Rom = (UINT8*)BurnMalloc(ri.nLen); - if (Rom == NULL) { - return 1; - } - - if (BurnLoadRom(Rom,nNum,1)) { - BurnFree(Rom); - return 1; - } - - // Success - *pRom = Rom; *pnRomLen = ri.nLen; - return 0; -} - -static INT32 LoadUpSplit(UINT8** pRom, INT32* pnRomLen, INT32 nNum, INT32 nNumRomsGroup) -{ - UINT8 *Rom; - struct BurnRomInfo ri; - UINT32 nRomSize[8], nTotalRomSize = 0; - INT32 i; - - ri.nLen = 0; - for (i = 0; i < nNumRomsGroup; i++) { - BurnDrvGetRomInfo(&ri, nNum + i); - nRomSize[i] = ri.nLen; - } - - for (i = 0; i < nNumRomsGroup; i++) { - nTotalRomSize += nRomSize[i]; - } - if (!nTotalRomSize) return 1; - - Rom = (UINT8*)BurnMalloc(nTotalRomSize); - if (Rom == NULL) return 1; - - INT32 Offset = 0; - for (i = 0; i < nNumRomsGroup; i++) { - if (i > 0) Offset += nRomSize[i - 1]; - if (BurnLoadRom(Rom + Offset, nNum + i, 1)) { - BurnFree(Rom); - return 1; - } - } - - *pRom = Rom; - *pnRomLen = nTotalRomSize; - - return 0; -} - -// ----------------------------CPS1-------------------------------- -// Load 1 rom and interleave in the CPS style: -// rom : aa bb -// --ba --ba --ba --ba --ba --ba --ba --ba 8 pixels (four bytes) -// (skip four bytes) - -static INT32 CpsLoadOne(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < nRomLen; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOnePang(UINT8 *Tile,INT32 nNum,INT32 nWord,INT32 nShift) -{ - INT32 i=0; - UINT8 *Rom = NULL; INT32 nRomLen = 0; - UINT8 *pt = NULL, *pr = NULL; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - - nRomLen &= ~1; // make sure even - - for (i = 0x100000, pt = Tile, pr = Rom + 0x100000; i < nRomLen; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneHack160(UINT8 *Tile, INT32 nNum, INT32 nWord, INT32 nType) -{ - INT32 i = 0, j = 0; - UINT8 *Rom1 = NULL, *Rom2 = NULL; - INT32 nRomLen1 = 0, nRomLen2 = 0; - UINT8 *pt = NULL, *pr = NULL; - - LoadUp(&Rom1, &nRomLen1, nNum); - if (Rom1 == NULL) { - return 1; - } - LoadUp(&Rom2, &nRomLen2, nNum + 1); - if (Rom2 == NULL) { - return 1; - } - - INT32 TileOffset[4] = { 0x000000, 0x000004, 0x200000, 0x200004 }; - if (nType == 1) { - TileOffset[1] = 0x200000; - TileOffset[2] = 0x000004; - } - - for (j = 0; j < 4; j++) { - for (i = 0, pt = Tile + TileOffset[j], pr = Rom1 + (0x80000 * j); i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= 0; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + TileOffset[j], pr = Rom2 + (0x80000 * j); i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= 2; - *((UINT32 *)pt) |= Pix; - } - } - - BurnFree(Rom2); - BurnFree(Rom1); - return 0; -} - -static INT32 CpsLoadOneBootleg(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x40000; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneBootlegSmallSingle(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneBootlegType2(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x40000; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 0x200000, pr = Rom + 0x80000; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 0x200004, pr = Rom + 0xc0000; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneBootlegType2Small(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x40000; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneBootlegType2SmallSingle(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < 0x40000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneBootlegType3(UINT8 *Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < nRomLen; pt += 4) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneBootlegType3Swap(UINT8 *Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; int nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < nRomLen; pt += 4) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= (nShift + 1); - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneSf2ebbl(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < 0x10000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x10000; i < 0x10000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneSf2b(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile + 4, pr = Rom; i < 0x10000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile, pr = Rom + 0x10000; i < 0x10000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneSf2koryu(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < nRomLen >> 1; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - Tile += 4; - - for (i = 0, pt = Tile, pr = Rom + (nRomLen >> 1); i < nRomLen >> 1; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneSf2stt(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom + (nRomLen >> 1); i < nRomLen >> 1; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - Tile += 4; - - for (i = 0, pt = Tile, pr = Rom; i < nRomLen >> 1; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadOneWonder3b(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen=0; - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - - nRomLen &= ~1; // make sure even - - for (i = 0, pt = Tile, pr = Rom; i < (nRomLen >> 1); pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 0x200000, pr = Rom + 0x40000; i < (nRomLen >> 1); pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - if (nWord) { - b = *pr++; i++; Pix |= SepTable[b] << 1; - } - - Pix <<= nShift; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadPunisherbTiles(UINT8* Tile, INT32 nNum) -{ - UINT8 *Rom = (UINT8*)BurnMalloc(0x400000 * sizeof(UINT8)); - UINT8 *pt = NULL, *pr = NULL; - INT32 i, j; - - if (Rom == NULL) { - return 1; - } - - if (BurnLoadRom(Rom + 0x000000, nNum + 0, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Rom + 0x000001, nNum + 1, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Rom + 0x100000, nNum + 2, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Rom + 0x100001, nNum + 3, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Rom + 0x200000, nNum + 4, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Rom + 0x200001, nNum + 5, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Rom + 0x300000, nNum + 6, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Rom + 0x300001, nNum + 7, 2)) { - BurnFree(Rom); - return 1; - } - - INT32 TileOffset[4] = { 0x000000, 0x200000, 0x000004, 0x200004 }; - - for (j = 0; j < 4; j++) { - for (i = 0, pt = Tile + TileOffset[j], pr = Rom + (0x80000 * j); i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 0; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + TileOffset[j], pr = Rom + 0x200000 + (0x80000 * j); i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 2; - *((UINT32 *)pt) |= Pix; - } - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadSf2ceuab3Tiles(UINT8* Tile, INT32 nNum) -{ - UINT8 *Rom = (UINT8*)BurnMalloc(0x200000 * sizeof(UINT8)); - UINT8 *Temp = (UINT8*)BurnMalloc(0x200000 * sizeof(UINT8)); - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - if (Rom == NULL) { - return 1; - } - - if (BurnLoadRom(Temp + 0x000000, nNum + 0, 1)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x100000, nNum + 1, 1)) { - BurnFree(Rom); - return 1; - } - - for (i = 0; i < 0x100000; i += 2) { - Rom[i + 0x000000] = Temp[i + 0x000000]; - Rom[i + 0x000001] = Temp[i + 0x100000]; - Rom[i + 0x100000] = Temp[i + 0x000001]; - Rom[i + 0x100001] = Temp[i + 0x100001]; - } - - BurnFree(Temp); - - for (i = 0, pt = Tile, pr = Rom; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 0; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x80000; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 0; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile, pr = Rom + 0x100000; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 2; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x180000; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 2; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadSf2ceeablTiles(UINT8* Tile, INT32 nNum) -{ - UINT8 *Rom = (UINT8*)BurnMalloc(0x200000 * sizeof(UINT8)); - UINT8 *Temp = (UINT8*)BurnMalloc(0x200000 * sizeof(UINT8)); - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - if (Rom == NULL) { - return 1; - } - - if (BurnLoadRom(Temp + 0x000000, nNum + 0, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x000001, nNum + 1, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x100000, nNum + 2, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x100001, nNum + 3, 2)) { - BurnFree(Rom); - return 1; - } - - for (i = 0; i < 0x100000; i += 2) { - Rom[i + 0x000000] = Temp[i + 0x000000]; - Rom[i + 0x000001] = Temp[i + 0x100000]; - Rom[i + 0x100000] = Temp[i + 0x000001]; - Rom[i + 0x100001] = Temp[i + 0x100001]; - } - - BurnFree(Temp); - - for (i = 0, pt = Tile, pr = Rom; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 0; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x80000; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 0; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile, pr = Rom + 0x100000; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 2; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x180000; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 2; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -static INT32 CpsLoadSf2ceuab7Tiles(UINT8* Tile, INT32 nNum) -{ - UINT8 *Rom = (UINT8*)BurnMalloc(0x200000 * sizeof(UINT8)); - UINT8 *Temp = (UINT8*)BurnMalloc(0x200000 * sizeof(UINT8)); - UINT8 *pt = NULL, *pr = NULL; - INT32 i; - - if (Rom == NULL) { - return 1; - } - - if (BurnLoadRom(Temp + 0x000000, nNum + 0, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x080000, nNum + 1, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x000001, nNum + 2, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x080001, nNum + 3, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x100000, nNum + 4, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x180000, nNum + 5, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x100001, nNum + 6, 2)) { - BurnFree(Rom); - return 1; - } - - if (BurnLoadRom(Temp + 0x180001, nNum + 7, 2)) { - BurnFree(Rom); - return 1; - } - - for (i = 0; i < 0x100000; i += 2) { - Rom[i + 0x000000] = Temp[i + 0x000000]; - Rom[i + 0x000001] = Temp[i + 0x100000]; - Rom[i + 0x100000] = Temp[i + 0x000001]; - Rom[i + 0x100001] = Temp[i + 0x100001]; - } - - BurnFree(Temp); - - for (i = 0, pt = Tile, pr = Rom; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 0; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x80000; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 0; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile, pr = Rom + 0x100000; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 2; - *((UINT32 *)pt) |= Pix; - } - - for (i = 0, pt = Tile + 4, pr = Rom + 0x180000; i < 0x80000; pt += 8) { - UINT32 Pix; // Eight pixels - UINT8 b; - b = *pr++; i++; Pix = SepTable[b]; - b = *pr++; i++; Pix |= SepTable[b] << 1; - - Pix <<= 2; - *((UINT32 *)pt) |= Pix; - } - - BurnFree(Rom); - return 0; -} - -INT32 CpsLoadTiles(UINT8* Tile, INT32 nStart) -{ - // left side of 16x16 tiles - CpsLoadOne(Tile, nStart , 1, 0); - CpsLoadOne(Tile, nStart + 1, 1, 2); - // right side of 16x16 tiles - CpsLoadOne(Tile + 4, nStart + 2, 1, 0); - CpsLoadOne(Tile + 4, nStart + 3, 1, 2); - return 0; -} - -INT32 CpsLoadTilesByte(UINT8* Tile, INT32 nStart) -{ - CpsLoadOne(Tile, nStart + 0, 0, 0); - CpsLoadOne(Tile, nStart + 1, 0, 1); - CpsLoadOne(Tile, nStart + 2, 0, 2); - CpsLoadOne(Tile, nStart + 3, 0, 3); - CpsLoadOne(Tile + 4, nStart + 4, 0, 0); - CpsLoadOne(Tile + 4, nStart + 5, 0, 1); - CpsLoadOne(Tile + 4, nStart + 6, 0, 2); - CpsLoadOne(Tile + 4, nStart + 7, 0, 3); - return 0; -} - -INT32 CpsLoadTilesForgottn(INT32 nStart) -{ - CpsLoadOne(CpsGfx + 0 + 0x000000, nStart + 0, 0, 0); - CpsLoadOne(CpsGfx + 0 + 0x000000, nStart + 1, 0, 1); - CpsLoadOne(CpsGfx + 0 + 0x000000, nStart + 2, 1, 2); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 3, 0, 0); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 4, 0, 1); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 5, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 6, 0, 3); - CpsLoadOne(CpsGfx + 0 + 0x100000, nStart + 7, 0, 0); - CpsLoadOne(CpsGfx + 0 + 0x100000, nStart + 8, 0, 1); - CpsLoadOne(CpsGfx + 4 + 0x100000, nStart + 9, 0, 0); - CpsLoadOne(CpsGfx + 4 + 0x100000, nStart + 10, 0, 1); - CpsLoadOne(CpsGfx + 4 + 0x100000, nStart + 11, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x100000, nStart + 12, 0, 3); - CpsLoadOne(CpsGfx + 0 + 0x200000, nStart + 13, 1, 0); - CpsLoadOne(CpsGfx + 0 + 0x200000, nStart + 14, 0, 2); - CpsLoadOne(CpsGfx + 0 + 0x200000, nStart + 15, 0, 3); - CpsLoadOne(CpsGfx + 4 + 0x200000, nStart + 16, 1, 0); - CpsLoadOne(CpsGfx + 4 + 0x200000, nStart + 17, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x200000, nStart + 18, 0, 3); - CpsLoadOne(CpsGfx + 0 + 0x300000, nStart + 19, 0, 2); - CpsLoadOne(CpsGfx + 0 + 0x300000, nStart + 20, 0, 3); - CpsLoadOne(CpsGfx + 4 + 0x300000, nStart + 21, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x300000, nStart + 22, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesForgottna(INT32 nStart) -{ - CpsLoadOne(CpsGfx + 0 + 0x000000, nStart + 0, 0, 0); - CpsLoadOne(CpsGfx + 0 + 0x000000, nStart + 1, 0, 1); - CpsLoadOne(CpsGfx + 0 + 0x000000, nStart + 2, 1, 2); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 3, 1, 0); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 4, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 5, 0, 3); - CpsLoadOne(CpsGfx + 0 + 0x100000, nStart + 6, 0, 0); - CpsLoadOne(CpsGfx + 0 + 0x100000, nStart + 7, 0, 1); - CpsLoadOne(CpsGfx + 4 + 0x100000, nStart + 8, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x100000, nStart + 9, 0, 3); - CpsLoadOne(CpsGfx + 0 + 0x200000, nStart + 10, 1, 0); - CpsLoadOne(CpsGfx + 0 + 0x200000, nStart + 11, 0, 2); - CpsLoadOne(CpsGfx + 0 + 0x200000, nStart + 12, 0, 3); - CpsLoadOne(CpsGfx + 4 + 0x200000, nStart + 13, 1, 0); - CpsLoadOne(CpsGfx + 4 + 0x200000, nStart + 14, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x200000, nStart + 15, 0, 3); - CpsLoadOne(CpsGfx + 0 + 0x300000, nStart + 16, 0, 2); - CpsLoadOne(CpsGfx + 0 + 0x300000, nStart + 17, 0, 3); - CpsLoadOne(CpsGfx + 4 + 0x300000, nStart + 18, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x300000, nStart + 19, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesForgottnu(INT32 nStart) -{ - CpsLoadOne(CpsGfx + 0 + 0x000000, nStart + 0, 0, 0); - CpsLoadOne(CpsGfx + 0 + 0x000000, nStart + 1, 0, 1); - CpsLoadOne(CpsGfx + 0 + 0x000000, nStart + 2, 1, 2); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 3, 1, 0); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 4, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x000000, nStart + 5, 0, 3); - CpsLoadOne(CpsGfx + 0 + 0x100000, nStart + 6, 0, 0); - CpsLoadOne(CpsGfx + 0 + 0x100000, nStart + 7, 0, 1); - CpsLoadOne(CpsGfx + 4 + 0x100000, nStart + 8, 0, 2); - CpsLoadOne(CpsGfx + 4 + 0x100000, nStart + 9, 0, 3); - CpsLoadOne(CpsGfx + 0 + 0x200000, nStart + 10, 1, 0); - CpsLoadOne(CpsGfx + 0 + 0x200000, nStart + 11, 0, 2); - CpsLoadOne(CpsGfx + 0 + 0x200000, nStart + 12, 0, 3); - CpsLoadOne(CpsGfx + 4 + 0x200000, nStart + 13, 1, 0); - CpsLoadOne(CpsGfx + 4 + 0x200000, nStart + 14, 1, 2); - CpsLoadOne(CpsGfx + 0 + 0x300000, nStart + 15, 0, 2); - CpsLoadOne(CpsGfx + 0 + 0x300000, nStart + 16, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesPang(UINT8* Tile, INT32 nStart) -{ - CpsLoadOne( Tile, nStart, 1, 0); - CpsLoadOne( Tile, nStart + 1, 1, 2); - CpsLoadOnePang(Tile + 4, nStart, 1, 0); - CpsLoadOnePang(Tile + 4, nStart + 1, 1, 2); - - return 0; -} - -static INT32 CpsLoadTilesBootleg(UINT8 *Tile, INT32 nStart) -{ - CpsLoadOneBootleg(Tile, nStart + 0, 0, 0); - CpsLoadOneBootleg(Tile, nStart + 1, 0, 1); - CpsLoadOneBootleg(Tile, nStart + 2, 0, 2); - CpsLoadOneBootleg(Tile, nStart + 3, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesSf2ebbl(UINT8 *Tile, INT32 nStart) -{ - CpsLoadOneSf2ebbl(Tile, nStart + 0, 0, 0); - CpsLoadOneSf2ebbl(Tile, nStart + 1, 0, 2); - CpsLoadOneSf2ebbl(Tile, nStart + 2, 0, 1); - CpsLoadOneSf2ebbl(Tile, nStart + 3, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesSf2b(UINT8 *Tile, INT32 nStart) -{ - CpsLoadOneSf2b(Tile, nStart + 0, 0, 0); - CpsLoadOneSf2b(Tile, nStart + 1, 0, 2); - CpsLoadOneSf2b(Tile, nStart + 2, 0, 1); - CpsLoadOneSf2b(Tile, nStart + 3, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesSf2koryuExtra(UINT8* Tile, INT32 nStart) -{ - CpsLoadOneSf2koryu(Tile, nStart + 0, 1, 0); - CpsLoadOneSf2koryu(Tile, nStart + 1, 1, 2); - - return 0; -} - -static INT32 CpsLoadTilesBootlegType3(UINT8 *Tile, INT32 nStart) -{ - CpsLoadOneBootlegType3(Tile, nStart + 0, 0, 0); - CpsLoadOneBootlegType3(Tile, nStart + 1, 0, 1); - CpsLoadOneBootlegType3(Tile, nStart + 2, 0, 2); - CpsLoadOneBootlegType3(Tile, nStart + 3, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesHack160(INT32 nStart) -{ - CpsLoadOneHack160(CpsGfx, nStart, 1, 0); - - return 0; -} - -INT32 CpsLoadTilesHack160Alt(INT32 nStart) -{ - CpsLoadOneHack160(CpsGfx, nStart, 1, 1); - - return 0; -} - -INT32 CpsLoadTilesSf2koryu(INT32 nStart) -{ - CpsLoadOneSf2koryu(CpsGfx + 0x000000, nStart + 0, 1, 0); - CpsLoadOneSf2koryu(CpsGfx + 0x000000, nStart + 1, 1, 2); - CpsLoadOneSf2koryu(CpsGfx + 0x200000, nStart + 2, 1, 0); - CpsLoadOneSf2koryu(CpsGfx + 0x200000, nStart + 3, 1, 2); - CpsLoadOneSf2koryu(CpsGfx + 0x400000, nStart + 4, 1, 0); - CpsLoadOneSf2koryu(CpsGfx + 0x400000, nStart + 5, 1, 2); - - return 0; -} - -INT32 CpsLoadTilesSf2stt(INT32 nStart) -{ - CpsLoadOneSf2stt(CpsGfx + 0x000000, nStart + 0, 1, 0); - CpsLoadOneSf2stt(CpsGfx + 0x000000, nStart + 1, 1, 2); - CpsLoadOneSf2stt(CpsGfx + 0x200000, nStart + 2, 1, 0); - CpsLoadOneSf2stt(CpsGfx + 0x200000, nStart + 3, 1, 2); - CpsLoadOneSf2stt(CpsGfx + 0x400000, nStart + 4, 1, 0); - CpsLoadOneSf2stt(CpsGfx + 0x400000, nStart + 5, 1, 2); - - return 0; -} - -INT32 CpsLoadTilesSf2mdt(INT32 nStart) -{ - CpsLoadTilesBootlegType3(CpsGfx + 0x000000, nStart + 0); - CpsLoadTilesBootlegType3(CpsGfx + 0x200000, nStart + 4); - CpsLoadTilesBootlegType3(CpsGfx + 0x400000, nStart + 8); - - return 0; -} - -INT32 CpsLoadTilesSf2mdta(INT32 nStart) -{ - CpsLoadOneBootlegType3Swap(CpsGfx + 0x000000, nStart + 0, 0, 0); - CpsLoadOneBootlegType3Swap(CpsGfx + 0x000000, nStart + 1, 0, 2); - CpsLoadOneBootlegType3Swap(CpsGfx + 0x200000, nStart + 2, 0, 0); - CpsLoadOneBootlegType3Swap(CpsGfx + 0x200000, nStart + 3, 0, 2); - CpsLoadOneBootlegType3Swap(CpsGfx + 0x400000, nStart + 4, 0, 0); - CpsLoadOneBootlegType3Swap(CpsGfx + 0x400000, nStart + 5, 0, 2); - - return 0; -} - -INT32 CpsLoadTilesSf2ceuab3(INT32 nStart) -{ - CpsLoadOneBootlegType2(CpsGfx + 0x000000, nStart + 0, 0, 0); - CpsLoadOneBootlegType2(CpsGfx + 0x000000, nStart + 1, 0, 1); - CpsLoadOneBootlegType2(CpsGfx + 0x000000, nStart + 2, 0, 2); - CpsLoadOneBootlegType2(CpsGfx + 0x000000, nStart + 3, 0, 3); - // The last two roms are a complete pain, handled by this custom function - CpsLoadSf2ceuab3Tiles(CpsGfx + 0x400000, nStart + 4); - - return 0; -} - -INT32 CpsLoadTilesSf2ceeabl(INT32 nStart) -{ - CpsLoadOneBootlegType2Small(CpsGfx + 0x000000, nStart + 0, 0, 0); - CpsLoadOneBootlegType2Small(CpsGfx + 0x200000, nStart + 1, 0, 0); - CpsLoadOneBootlegType2Small(CpsGfx + 0x000000, nStart + 2, 0, 1); - CpsLoadOneBootlegType2Small(CpsGfx + 0x200000, nStart + 3, 0, 1); - CpsLoadOneBootlegType2Small(CpsGfx + 0x000000, nStart + 4, 0, 2); - CpsLoadOneBootlegType2Small(CpsGfx + 0x200000, nStart + 5, 0, 2); - CpsLoadOneBootlegType2Small(CpsGfx + 0x000000, nStart + 6, 0, 3); - CpsLoadOneBootlegType2Small(CpsGfx + 0x200000, nStart + 7, 0, 3); - // The last four roms are a complete pain, handled by this custom function - CpsLoadSf2ceeablTiles(CpsGfx + 0x400000, nStart + 8); - - return 0; -} - -INT32 CpsLoadTilesSf2ceuab7(INT32 nStart) -{ - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x000000, nStart + 0, 0, 0); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x000004, nStart + 1, 0, 0); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x200000, nStart + 2, 0, 0); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x200004, nStart + 3, 0, 0); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x000000, nStart + 4, 0, 1); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x000004, nStart + 5, 0, 1); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x200000, nStart + 6, 0, 1); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x200004, nStart + 7, 0, 1); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x000000, nStart + 8, 0, 2); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x000004, nStart + 9, 0, 2); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x200000, nStart + 10, 0, 2); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x200004, nStart + 11, 0, 2); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x000000, nStart + 12, 0, 3); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x000004, nStart + 13, 0, 3); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x200000, nStart + 14, 0, 3); - CpsLoadOneBootlegType2SmallSingle(CpsGfx + 0x200004, nStart + 15, 0, 3); - - // The last eight roms are a complete pain, handled by this custom function - CpsLoadSf2ceuab7Tiles(CpsGfx + 0x400000, nStart + 16); - - return 0; -} - -INT32 CpsLoadTilesSf2ebbl3(INT32 nStart) -{ - CpsLoadOne(CpsGfx + 0x000000, nStart , 1, 0); - CpsLoadOne(CpsGfx + 0x000000, nStart + 1, 1, 2); - CpsLoadOne(CpsGfx + 0x000004, nStart + 2, 0, 0); - CpsLoadOne(CpsGfx + 0x000004, nStart + 3, 0, 1); - CpsLoadOne(CpsGfx + 0x000004, nStart + 4, 0, 2); - CpsLoadOne(CpsGfx + 0x000004, nStart + 5, 0, 3); - CpsLoadOne(CpsGfx + 0x200000, nStart + 6, 0, 0); - CpsLoadOne(CpsGfx + 0x200000, nStart + 7, 0, 1); - CpsLoadOne(CpsGfx + 0x200000, nStart + 8, 1, 2); - CpsLoadOne(CpsGfx + 0x200004, nStart + 9, 1, 0); - CpsLoadOne(CpsGfx + 0x200004, nStart + 10, 0, 2); - CpsLoadOne(CpsGfx + 0x200004, nStart + 11, 0, 3); - CpsLoadOne(CpsGfx + 0x400000, nStart + 12, 1, 0); - CpsLoadOne(CpsGfx + 0x400000, nStart + 13, 1, 2); - CpsLoadOne(CpsGfx + 0x400004, nStart + 14, 1, 0); - CpsLoadOne(CpsGfx + 0x400004, nStart + 15, 1, 2); - - return 0; -} - -INT32 CpsLoadTilesFcrash(INT32 nStart) -{ - CpsLoadTilesBootlegType3(CpsGfx + 0x000000, nStart + 0); - CpsLoadTilesBootlegType3(CpsGfx + 0x080000, nStart + 4); - CpsLoadTilesBootlegType3(CpsGfx + 0x100000, nStart + 8); - CpsLoadTilesBootlegType3(CpsGfx + 0x180000, nStart + 12); - - return 0; -} - -INT32 CpsLoadTilesCawingbl(INT32 nStart) -{ - CpsLoadTilesBootlegType3(CpsGfx + 0x000000, nStart + 0); - - return 0; -} - -INT32 CpsLoadTilesCaptcommb(INT32 nStart) -{ - CpsLoadOneBootlegType2(CpsGfx + 0x000000, nStart + 0, 0, 0); - CpsLoadOneBootlegType2(CpsGfx + 0x000000, nStart + 1, 0, 1); - CpsLoadOneBootlegType2(CpsGfx + 0x000000, nStart + 2, 0, 2); - CpsLoadOneBootlegType2(CpsGfx + 0x000000, nStart + 3, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesDinopic(INT32 nStart) -{ - CpsLoadTilesBootleg(CpsGfx + 0x000000, nStart + 0); - CpsLoadTilesBootleg(CpsGfx + 0x200000, nStart + 4); - - return 0; -} - -INT32 CpsLoadTilesDinopic4(INT32 nStart) -{ - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x000000, nStart + 0, 0, 0); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x000004, nStart + 1, 0, 0); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x000000, nStart + 2, 0, 1); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x000004, nStart + 3, 0, 1); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x000000, nStart + 4, 0, 2); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x000004, nStart + 5, 0, 2); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x000000, nStart + 6, 0, 3); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x000004, nStart + 7, 0, 3); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x200000, nStart + 8, 0, 0); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x200004, nStart + 9, 0, 0); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x200000, nStart + 10, 0, 1); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x200004, nStart + 11, 0, 1); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x200000, nStart + 12, 0, 2); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x200004, nStart + 13, 0, 2); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x200000, nStart + 14, 0, 3); - CpsLoadOneBootlegSmallSingle(CpsGfx + 0x200004, nStart + 15, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesSlampic(INT32 nStart) -{ - CpsLoadTilesBootleg(CpsGfx + 0x000000, nStart + 0); - CpsLoadTilesBootleg(CpsGfx + 0x200000, nStart + 4); - CpsLoadTilesBootleg(CpsGfx + 0x400000, nStart + 8); - - return 0; -} - -INT32 CpsLoadTilesKodb(INT32 nStart) -{ - CpsLoadTilesByte(CpsGfx, nStart); - - return 0; -} - -INT32 CpsLoadTilesWonder3b(INT32 nStart) -{ - CpsLoadOneWonder3b(CpsGfx + 0x000000, nStart + 0, 0, 0); - CpsLoadOneWonder3b(CpsGfx + 0x000000, nStart + 1, 0, 2); - CpsLoadOneWonder3b(CpsGfx + 0x000004, nStart + 2, 0, 0); - CpsLoadOneWonder3b(CpsGfx + 0x000004, nStart + 3, 0, 2); - CpsLoadOneWonder3b(CpsGfx + 0x000000, nStart + 4, 0, 1); - CpsLoadOneWonder3b(CpsGfx + 0x000000, nStart + 5, 0, 3); - CpsLoadOneWonder3b(CpsGfx + 0x000004, nStart + 6, 0, 1); - CpsLoadOneWonder3b(CpsGfx + 0x000004, nStart + 7, 0, 3); - - return 0; -} - -INT32 CpsLoadTilesPang3r1a(INT32 nStart) -{ - CpsLoadOne(CpsGfx + 0x000000, nStart + 0, 1, 0); - CpsLoadOne(CpsGfx + 0x200000, nStart + 1, 1, 0); - CpsLoadOne(CpsGfx + 0x000004, nStart + 2, 1, 0); - CpsLoadOne(CpsGfx + 0x200004, nStart + 3, 1, 0); - CpsLoadOne(CpsGfx + 0x000000, nStart + 4, 1, 2); - CpsLoadOne(CpsGfx + 0x200000, nStart + 5, 1, 2); - CpsLoadOne(CpsGfx + 0x000004, nStart + 6, 1, 2); - CpsLoadOne(CpsGfx + 0x200004, nStart + 7, 1, 2); - - return 0; -} - -INT32 CpsLoadTilesPunisherb(INT32 nStart) -{ - CpsLoadPunisherbTiles(CpsGfx, nStart); - - return 0; -} - -INT32 CpsLoadStars(UINT8* pStar, INT32 nStart) -{ - UINT8* pTemp[2] = { NULL, NULL}; - INT32 nLen; - - for (INT32 i = 0; i < 2; i++) { - if (LoadUp(&pTemp[i], &nLen, nStart + (i << 1))) { - BurnFree(pTemp[0]); - BurnFree(pTemp[1]); - } - } - - for (INT32 i = 0; i < 0x1000; i++) { - pStar[i] = pTemp[0][i << 1]; - pStar[0x01000 + i] = pTemp[1][i << 1]; - } - - BurnFree(pTemp[0]); - BurnFree(pTemp[1]); - - return 0; -} - -INT32 CpsLoadStarsByte(UINT8* pStar, INT32 nStart) -{ - UINT8* pTemp[2] = { NULL, NULL}; - INT32 nLen; - - for (INT32 i = 0; i < 2; i++) { - if (LoadUp(&pTemp[i], &nLen, nStart + (i * 4))) { - BurnFree(pTemp[0]); - BurnFree(pTemp[1]); - } - } - - for (INT32 i = 0; i < 0x1000; i++) { - pStar[i] = pTemp[0][i]; - pStar[0x01000 + i] = pTemp[1][i]; - } - - BurnFree(pTemp[0]); - BurnFree(pTemp[1]); - - return 0; -} - -INT32 CpsLoadStarsForgottnAlt(UINT8* pStar, INT32 nStart) -{ - UINT8* pTemp[2] = { NULL, NULL}; - INT32 nLen; - - for (INT32 i = 0; i < 2; i++) { - if (LoadUp(&pTemp[i], &nLen, nStart + (i * 3))) { - BurnFree(pTemp[0]); - BurnFree(pTemp[1]); - } - } - - for (INT32 i = 0; i < 0x1000; i++) { - pStar[i] = pTemp[0][i << 1]; - pStar[0x01000 + i] = pTemp[1][i << 1]; - } - - BurnFree(pTemp[0]); - BurnFree(pTemp[1]); - - return 0; -} - -// ----------------------------CPS2-------------------------------- -// Load 1 rom and interleve in the CPS2 style: -// rom : aa bb -- -- (4 bytes) -// --ba --ba --ba --ba --ba --ba --ba --ba 8 pixels (four bytes) -// (skip four bytes) - -// memory 000000-100000 are in even word fields of first 080000 section -// memory 100000-200000 are in odd word fields of first 080000 section -// i = ABCD nnnn nnnn nnnn nnnn n000 -// s = 00AB Cnnn nnnn nnnn nnnn nnD0 - -inline static void Cps2Load100000(UINT8* Tile, UINT8* Sect, INT32 nShift) -{ - UINT8 *pt, *pEnd, *ps; - pt = Tile; pEnd = Tile + 0x100000; ps = Sect; - - do { - UINT32 Pix; // Eight pixels - Pix = SepTable[ps[0]]; - Pix |= SepTable[ps[1]] << 1; - Pix <<= nShift; - *((UINT32*)pt) |= Pix; - - pt += 8; ps += 4; - } - while (pt < pEnd); -} - -static INT32 Cps2LoadOne(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift) -{ - UINT8 *Rom = NULL; INT32 nRomLen = 0; - UINT8 *pt, *pr; - - LoadUp(&Rom, &nRomLen, nNum); - if (Rom == NULL) { - return 1; - } - - if (nWord == 0) { - UINT8*Rom2 = NULL; INT32 nRomLen2 = 0; - UINT8*Rom3 = Rom; - - LoadUp(&Rom2, &nRomLen2, nNum + 1); - if (Rom2 == NULL) { - return 1; - } - - nRomLen <<= 1; - Rom = (UINT8*)BurnMalloc(nRomLen); - if (Rom == NULL) { - BurnFree(Rom2); - BurnFree(Rom3); - return 1; - } - - for (INT32 i = 0; i < nRomLen2; i++) { - Rom[(i << 1) + 0] = Rom3[i]; - Rom[(i << 1) + 1] = Rom2[i]; - } - - BurnFree(Rom2); - BurnFree(Rom3); - } - - // Go through each section - pt = Tile; pr = Rom; - for (INT32 b = 0; b < nRomLen >> 19; b++) { - Cps2Load100000(pt, pr, nShift); pt += 0x100000; - Cps2Load100000(pt, pr + 2, nShift); pt += 0x100000; - pr += 0x80000; - } - - BurnFree(Rom); - - return 0; -} - -static INT32 Cps2LoadSplit(UINT8* Tile, INT32 nNum, INT32 nShift, INT32 nNumRomsGroup) -{ - UINT8 *Rom = NULL; INT32 nRomLen = 0; - UINT8 *pt, *pr; - - LoadUpSplit(&Rom, &nRomLen, nNum, nNumRomsGroup); - if (Rom == NULL) { - return 1; - } - - // Go through each section - pt = Tile; pr = Rom; - for (INT32 b = 0; b < nRomLen >> 19; b++) { - Cps2Load100000(pt, pr, nShift); pt += 0x100000; - Cps2Load100000(pt, pr + 2, nShift); pt += 0x100000; - pr += 0x80000; - } - - BurnFree(Rom); - - return 0; -} - -INT32 Cps2LoadTiles(UINT8* Tile, INT32 nStart) -{ - // left side of 16x16 tiles - Cps2LoadOne(Tile, nStart, 1, 0); - Cps2LoadOne(Tile, nStart + 1, 1, 2); - // right side of 16x16 tiles - Cps2LoadOne(Tile + 4, nStart + 2, 1, 0); - Cps2LoadOne(Tile + 4, nStart + 3, 1, 2); - - return 0; -} - -INT32 Cps2LoadTilesSplit4(UINT8* Tile, INT32 nStart) -{ - // left side of 16x16 tiles - Cps2LoadSplit(Tile, nStart + 0, 0, 4); - Cps2LoadSplit(Tile, nStart + 4, 2, 4); - // right side of 16x16 tiles - Cps2LoadSplit(Tile + 4, nStart + 8, 0, 4); - Cps2LoadSplit(Tile + 4, nStart + 12, 2, 4); - - return 0; -} - -INT32 Cps2LoadTilesSplit8(UINT8* Tile, INT32 nStart) -{ - // left side of 16x16 tiles - Cps2LoadSplit(Tile, nStart + 0, 0, 8); - Cps2LoadSplit(Tile, nStart + 8, 2, 8); - // right side of 16x16 tiles - Cps2LoadSplit(Tile + 4, nStart + 16, 0, 8); - Cps2LoadSplit(Tile + 4, nStart + 24, 2, 8); - - return 0; -} - -INT32 Cps2LoadTilesSIM(UINT8* Tile, INT32 nStart) -{ - Cps2LoadOne(Tile, nStart, 0, 0); - Cps2LoadOne(Tile, nStart + 2, 0, 2); - Cps2LoadOne(Tile + 4, nStart + 4, 0, 0); - Cps2LoadOne(Tile + 4, nStart + 6, 0, 2); - - return 0; -} - -INT32 Cps2LoadTiles19xxj(UINT8* Tile, INT32 nStart) -{ - // left - Cps2LoadOne(Tile + 0x000000, nStart + 0, 1, 0); - Cps2LoadOne(Tile + 0x000000, nStart + 1, 1, 2); - - // right - Cps2LoadOne(Tile + 0x000004, nStart + 2, 1, 0); - Cps2LoadOne(Tile + 0x000004, nStart + 3, 1, 2); - - // left - Cps2LoadOne(Tile + 0x800000, nStart + 4, 1, 0); - Cps2LoadOne(Tile + 0xa00000, nStart + 5, 1, 0); - Cps2LoadOne(Tile + 0xc00000, nStart + 6, 1, 0); - Cps2LoadOne(Tile + 0xe00000, nStart + 7, 1, 0); - Cps2LoadOne(Tile + 0x800000, nStart + 8, 1, 2); - Cps2LoadOne(Tile + 0xa00000, nStart + 9, 1, 2); - Cps2LoadOne(Tile + 0xc00000, nStart + 10, 1, 2); - Cps2LoadOne(Tile + 0xe00000, nStart + 11, 1, 2); - - // right - Cps2LoadOne(Tile + 0x800004, nStart + 12, 1, 0); - Cps2LoadOne(Tile + 0xa00004, nStart + 13, 1, 0); - Cps2LoadOne(Tile + 0xc00004, nStart + 14, 1, 0); - Cps2LoadOne(Tile + 0xe00004, nStart + 15, 1, 0); - Cps2LoadOne(Tile + 0x800004, nStart + 16, 1, 2); - Cps2LoadOne(Tile + 0xa00004, nStart + 17, 1, 2); - Cps2LoadOne(Tile + 0xc00004, nStart + 18, 1, 2); - Cps2LoadOne(Tile + 0xe00004, nStart + 19, 1, 2); - - return 0; -} - -INT32 Cps2LoadTilesGigaman2(UINT8 *Tile, UINT8 *pSrc) -{ - UINT8 *pt = Tile; - UINT8 *pr = pSrc; - for (INT32 b = 0; b < 0x200000 >> 19; b++) { - Cps2Load100000(pt, pr, 0); pt += 0x100000; - Cps2Load100000(pt, pr + 2, 0); pt += 0x100000; - pr += 0x80000; - } - - pt = Tile; - pr = pSrc + 0x200000; - for (INT32 b = 0; b < 0x200000 >> 19; b++) { - Cps2Load100000(pt, pr, 2); pt += 0x100000; - Cps2Load100000(pt, pr + 2, 2); pt += 0x100000; - pr += 0x80000; - } - - pt = Tile + 4; - pr = pSrc + 0x400000; - for (INT32 b = 0; b < 0x200000 >> 19; b++) { - Cps2Load100000(pt, pr, 0); pt += 0x100000; - Cps2Load100000(pt, pr + 2, 0); pt += 0x100000; - pr += 0x80000; - } - - pt = Tile + 4; - pr = pSrc + 0x600000; - for (INT32 b = 0; b < 0x200000 >> 19; b++) { - Cps2Load100000(pt, pr, 2); pt += 0x100000; - Cps2Load100000(pt, pr + 2, 2); pt += 0x100000; - pr += 0x80000; - } - - return 0; -} - -// ---------------------------------------------------------------- - -// The file extension indicates the data contained in a file. -// it consists of 2 numbers optionally followed by a single letter. -// The letter indicates the version. The meaning for the nubmers -// is as follows: -// 01 - 02 : Z80 program -// 03 - 10 : 68K program (filenames ending with x contain the XOR table) -// 11 - 12 : QSound sample data -// 13 - nn : Graphics data - -static UINT32 nGfxMaxSize; - -static INT32 CpsGetROMs(bool bLoad) -{ - struct BurnRomInfo ri; - - UINT8* CpsCodeLoad = CpsCode; - UINT8* CpsRomLoad = CpsRom; - UINT8* CpsGfxLoad = CpsGfx; - UINT8* CpsZRomLoad = CpsZRom; - UINT8* CpsQSamLoad = (UINT8*)CpsQSam; - UINT8* CpsKeyLoad = CpsKey; - - INT32 nGfxNum = 0; - - if (bLoad) { - if (!CpsCodeLoad || !CpsRomLoad || !CpsGfxLoad || !CpsZRomLoad || !CpsQSamLoad) { - return 1; - } - } else { - nCpsCodeLen = nCpsRomLen = nCpsGfxLen = nCpsZRomLen = nCpsQSamLen = 0; - - nGfxMaxSize = 0; - if (BurnDrvGetHardwareCode() & HARDWARE_CAPCOM_CPS2_SIMM) { - nGfxMaxSize = ~0U; - } - } - - INT32 i = 0; - do { - ri.nLen = 0; - ri.nType = 0; - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 0x0f) == CPS2_PRG_68K) { - if (bLoad) { - if (BurnLoadRom(CpsRomLoad, i, 1)) return 1; - CpsRomLoad += ri.nLen; - } else { - nCpsRomLen += ri.nLen; - } - i++; - } - - if ((ri.nType & 0x0f) == CPS2_PRG_68K_SIMM) { - if (bLoad) { - if (BurnLoadRom(CpsRomLoad + 0x000001, i + 0, 2)) return 1; - if (BurnLoadRom(CpsRomLoad + 0x000000, i + 1, 2)) return 1; - CpsRomLoad += ri.nLen * 2; - i += 2; - } else { - nCpsRomLen += ri.nLen; - i++; - } - } - - if ((ri.nType & 0x0f) == CPS2_PRG_68K_XOR_TABLE) { - if (bLoad) { - if (BurnLoadRom(CpsCodeLoad, i, 1)) return 1; - CpsCodeLoad += ri.nLen; - } else { - nCpsCodeLen += ri.nLen; - } - i++; - } - - if ((ri.nType & 0x0f) == CPS2_GFX) { - if (bLoad) { - Cps2LoadTiles(CpsGfxLoad, i); - CpsGfxLoad += (nGfxMaxSize == ~0U ? ri.nLen : nGfxMaxSize) * 4; - i += 4; - } else { - if (ri.nLen > nGfxMaxSize) { - nGfxMaxSize = ri.nLen; - } - if (ri.nLen < nGfxMaxSize) { - nGfxMaxSize = ~0U; - } - nCpsGfxLen += ri.nLen; - nGfxNum++; - i++; - } - } - - if ((ri.nType & 0x0f) == CPS2_GFX_SIMM) { - if (bLoad) { - Cps2LoadTilesSIM(CpsGfxLoad, i); - CpsGfxLoad += ri.nLen * 8; - i += 8; - } else { - nCpsGfxLen += ri.nLen; - i++; - } - } - - if ((ri.nType & 0x0f) == CPS2_GFX_SPLIT4) { - if (bLoad) { - Cps2LoadTilesSplit4(CpsGfxLoad, i); - CpsGfxLoad += (nGfxMaxSize == ~0U ? ri.nLen : nGfxMaxSize) * 16; - i += 16; - } else { - if (ri.nLen > nGfxMaxSize) { - nGfxMaxSize = ri.nLen; - } - if (ri.nLen < nGfxMaxSize) { - nGfxMaxSize = ~0U; - } - nCpsGfxLen += ri.nLen; - nGfxNum++; - i++; - } - } - - if ((ri.nType & 0x0f) == CPS2_GFX_SPLIT8) { - if (bLoad) { - Cps2LoadTilesSplit8(CpsGfxLoad, i); - CpsGfxLoad += (nGfxMaxSize == ~0U ? ri.nLen : nGfxMaxSize) * 32; - i += 32; - } else { - if (ri.nLen > nGfxMaxSize) { - nGfxMaxSize = ri.nLen; - } - if (ri.nLen < nGfxMaxSize) { - nGfxMaxSize = ~0U; - } - nCpsGfxLen += ri.nLen; - nGfxNum++; - i++; - } - } - - if ((ri.nType & 0x0f) == CPS2_GFX_19XXJ) { - if (bLoad) { - Cps2LoadTiles19xxj(CpsGfxLoad, i); - CpsGfxLoad += (nGfxMaxSize == ~0U ? ri.nLen : nGfxMaxSize) * 20; - i += 20; - } else { - nGfxMaxSize = 0xcd000; - nCpsGfxLen += ri.nLen; - nGfxNum++; - i++; - } - } - - if ((ri.nType & 0x0f) == CPS2_PRG_Z80) { - if (bLoad) { - BurnLoadRom(CpsZRomLoad, i, 1); - CpsZRomLoad += ri.nLen; - } else { - nCpsZRomLen += ri.nLen; - } - i++; - } - - if ((ri.nType & 0x0f) == CPS2_QSND) { - if (bLoad) { - BurnLoadRom(CpsQSamLoad, i, 1); - BurnByteswap(CpsQSamLoad, ri.nLen); - CpsQSamLoad += ri.nLen; - } else { - nCpsQSamLen += ri.nLen; - } - i++; - } - - if ((ri.nType & 0x0f) == CPS2_QSND_SIMM) { - if (bLoad) { - BurnLoadRom(CpsQSamLoad, i, 1); - BurnByteswap(CpsQSamLoad, ri.nLen); - CpsQSamLoad += ri.nLen; - } else { - nCpsQSamLen += ri.nLen; - } - i++; - } - - if ((ri.nType & 0x0f) == CPS2_QSND_SIMM_BYTESWAP) { - if (bLoad) { - BurnLoadRom(CpsQSamLoad + 1, i + 0, 2); - BurnLoadRom(CpsQSamLoad + 0, i + 1, 2); - i += 2; - } else { - nCpsQSamLen += ri.nLen; - i++; - } - } - - if ((ri.nType & 0x0f) == CPS2_ENCRYPTION_KEY) { - if (bLoad) { - if (BurnLoadRom(CpsKeyLoad, i, 1)) return 1; - CpsKeyLoad += ri.nLen; - } else { - nCpsKeyLen += ri.nLen; - } - i++; - } - } while (ri.nLen); - - if (bLoad) { -#if 0 - for (UINT32 i = 0; i < nCpsCodeLen / 4; i++) { - ((UINT32*)CpsCode)[i] ^= ((UINT32*)CpsRom)[i]; - } -#endif - cps2_decrypt_game_data(); - -// if (!nCpsCodeLen) return 1; - } else { - - if (nGfxMaxSize != ~0U) { - nCpsGfxLen = nGfxNum * nGfxMaxSize; - } - -#if 1 && defined FBA_DEBUG - if (!nCpsCodeLen) { - bprintf(PRINT_IMPORTANT, _T(" - 68K ROM size:\t0x%08X (Decrypted with key)\n"), nCpsRomLen); - } else { - bprintf(PRINT_IMPORTANT, _T(" - 68K ROM size:\t0x%08X (XOR table size: 0x%08X)\n"), nCpsRomLen, nCpsCodeLen); - } - bprintf(PRINT_IMPORTANT, _T(" - Z80 ROM size:\t0x%08X\n"), nCpsZRomLen); - bprintf(PRINT_IMPORTANT, _T(" - Graphics data:\t0x%08X\n"), nCpsGfxLen); - bprintf(PRINT_IMPORTANT, _T(" - QSound data:\t0x%08X\n"), nCpsQSamLen); - bprintf(PRINT_IMPORTANT, _T(" - Key data:\t\t0x%08X\n"), nCpsKeyLen); -#endif - - if (/*!nCpsCodeLen ||*/ !nCpsRomLen || !nCpsGfxLen || !nCpsZRomLen || ! nCpsQSamLen) { - return 1; - } - } - - return 0; -} - -// ---------------------------------------------------------------- - -INT32 CpsInit() -{ - INT32 nMemLen, i; - - if (Cps == 1) { - BurnSetRefreshRate(59.61); - } else { - if (Cps == 2) { - BurnSetRefreshRate(59.629403); - } - } - - if (!nCPS68KClockspeed) { - if (!(Cps & 1)) { - nCPS68KClockspeed = 11800000; - } else { - nCPS68KClockspeed = 10000000; - } - } - nCPS68KClockspeed = nCPS68KClockspeed * 100 / nBurnFPS; - - nMemLen = nCpsGfxLen + nCpsRomLen + nCpsCodeLen + nCpsZRomLen + nCpsQSamLen + nCpsAdLen + nCpsKeyLen; - - if (Cps1Qs == 1) { - nMemLen += nCpsZRomLen * 2; - } - - // Allocate Gfx, Rom and Z80 Roms - CpsGfx = (UINT8*)BurnMalloc(nMemLen); - if (CpsGfx == NULL) { - return 1; - } - memset(CpsGfx, 0, nMemLen); - - CpsRom = CpsGfx + nCpsGfxLen; - CpsCode = CpsRom + nCpsRomLen; - if (Cps1Qs == 1) { - CpsEncZRom = CpsCode + nCpsCodeLen; - CpsZRom = CpsEncZRom + nCpsZRomLen * 2; - } else { - CpsZRom = CpsCode + nCpsCodeLen; - } - CpsQSam =(INT8*)(CpsZRom + nCpsZRomLen); - CpsAd =(UINT8*)(CpsQSam + nCpsQSamLen); - CpsKey =(UINT8*)(CpsAd + nCpsAdLen); - - // Create Gfx addr mask - for (i = 0; i < 31; i++) { - if ((1 << i) >= (INT32)nCpsGfxLen) { - break; - } - } - nCpsGfxMask = (1 << i) - 1; - - // Offset to Scroll tiles - if (!(Cps & 1)) { - nCpsGfxScroll[1] = nCpsGfxScroll[2] = nCpsGfxScroll[3] = 0x800000; - } else { - nCpsGfxScroll[1] = nCpsGfxScroll[2] = nCpsGfxScroll[3] = 0; - } - -#if 0 - if (nCpsZRomLen>=5) { - // 77->cfff and rst 00 in case driver doesn't load - CpsZRom[0] = 0x3E; CpsZRom[1] = 0x77; - CpsZRom[2] = 0x32; CpsZRom[3] = 0xFF; CpsZRom[4] = 0xCF; - CpsZRom[5] = 0xc7; - } -#endif - - SepTableCalc(); // Precalc the separate table - - CpsReset = 0; Cpi01A = Cpi01C = Cpi01E = 0; // blank other inputs - - // Use this as default - all CPS-2 games use it - SetCpsBId(CPS_B_21_DEF, 0); - - return 0; -} - -INT32 Cps2Init() -{ - Cps = 2; - - if (CpsGetROMs(false)) { - return 1; - } - - CpsInit(); - - if (CpsGetROMs(true)) { - return 1; - } - - return CpsRunInit(); -} - -INT32 CpsExit() -{ - if (!(Cps & 1)) { - CpsRunExit(); - } - - CpsLayEn[1] = CpsLayEn[2] = CpsLayEn[3] = CpsLayEn[4] = CpsLayEn[5] = 0; - nCpsLcReg = 0; - nCpsGfxScroll[1] = nCpsGfxScroll[2] = nCpsGfxScroll[3] = 0; - nCpsGfxMask = 0; - - Scroll1TileMask = 0; - Scroll2TileMask = 0; - Scroll3TileMask = 0; - - nCpsCodeLen = nCpsRomLen = nCpsGfxLen = nCpsZRomLen = nCpsQSamLen = nCpsAdLen = nCpsKeyLen = 0; - CpsRom = CpsZRom = CpsAd = CpsStar = NULL; - CpsQSam = NULL; - CpsKey = NULL; - - // All Memory is allocated to this (this is the only one we can free) - BurnFree(CpsGfx); - - BurnFree(CpsCode); - - bCpsUpdatePalEveryFrame = 0; - - nCPS68KClockspeed = 0; - Cps = 0; - nCpsNumScanlines = 259; - - return 0; -} diff --git a/jan/src/burn/drv/capcom/cps.h b/jan/src/burn/drv/capcom/cps.h deleted file mode 100644 index ec6219f3d..000000000 --- a/jan/src/burn/drv/capcom/cps.h +++ /dev/null @@ -1,506 +0,0 @@ -// CPS ---------------------------------- -#include "burnint.h" -#include "m68000_intf.h" -#include "z80_intf.h" - -#include "msm6295.h" -#include "eeprom.h" -#include "timer.h" - -// Maximum number of beam-synchronized interrupts to check -#define MAX_RASTER 10 - -extern UINT32 CpsMProt[4]; // Mprot changes -extern UINT32 CpsBID[3]; // Board ID changes - -// cps.cpp -extern INT32 Cps; // 1 = CPS1, 2 = CPS2, 3 = CPS CHanger -extern INT32 Cps1Qs; -extern INT32 Cps1DisablePSnd; -extern INT32 Cps2DisableQSnd; -extern INT32 nCPS68KClockspeed; -extern INT32 nCpsCycles; // Cycles per frame -extern INT32 nCpsZ80Cycles; -extern UINT8 *CpsGfx; extern UINT32 nCpsGfxLen; // All the graphics -extern UINT8 *CpsRom; extern UINT32 nCpsRomLen; // Program Rom (as in rom) -extern UINT8 *CpsCode; extern UINT32 nCpsCodeLen; // Program Rom (decrypted) -extern UINT8 *CpsZRom; extern UINT32 nCpsZRomLen; // Z80 Roms -extern INT8 *CpsQSam; extern UINT32 nCpsQSamLen; // QSound Sample Roms -extern UINT8 *CpsAd; extern UINT32 nCpsAdLen; // ADPCM Data -extern UINT8 *CpsKey; extern UINT32 nCpsKeyLen; -extern UINT32 nCpsGfxScroll[4]; // Offset to Scroll tiles -extern UINT32 nCpsGfxMask; // Address mask -extern UINT8* CpsStar; -INT32 CpsInit(); -INT32 Cps2Init(); -INT32 CpsExit(); -INT32 CpsLoadTiles(UINT8 *Tile,INT32 nStart); -INT32 CpsLoadTilesByte(UINT8 *Tile,INT32 nStart); -INT32 CpsLoadTilesForgottn(INT32 nStart); -INT32 CpsLoadTilesForgottna(INT32 nStart); -INT32 CpsLoadTilesForgottnu(INT32 nStart); -INT32 CpsLoadTilesPang(UINT8 *Tile,INT32 nStart); -INT32 CpsLoadTilesSf2ebbl(UINT8 *Tile, INT32 nStart); -INT32 CpsLoadTilesSf2b(UINT8 *Tile, INT32 nStart); -INT32 CpsLoadTilesSf2koryuExtra(UINT8 *Tile, INT32 nStart); -INT32 CpsLoadTilesHack160(INT32 nStart); -INT32 CpsLoadTilesHack160Alt(INT32 nStart); -INT32 CpsLoadTilesSf2koryu(INT32 nStart); -INT32 CpsLoadTilesSf2stt(INT32 nStart); -INT32 CpsLoadTilesSf2mdt(INT32 nStart); -INT32 CpsLoadTilesSf2mdta(INT32 nStart); -INT32 CpsLoadTilesSf2ceuab3(INT32 nStart); -INT32 CpsLoadTilesSf2ceeabl(INT32 nStart); -INT32 CpsLoadTilesSf2ceuab7(INT32 nStart); -INT32 CpsLoadTilesSf2ebbl3(INT32 nStart); -INT32 CpsLoadTilesFcrash(INT32 nStart); -INT32 CpsLoadTilesCawingbl(INT32 nStart); -INT32 CpsLoadTilesCaptcommb(INT32 nStart); -INT32 CpsLoadTilesDinopic(INT32 nStart); -INT32 CpsLoadTilesDinopic4(INT32 nStart); -INT32 CpsLoadTilesSlampic(INT32 nStart); -INT32 CpsLoadTilesKodb(INT32 nStart); -INT32 CpsLoadTilesWonder3b(INT32 nStart); -INT32 CpsLoadTilesPang3r1a(INT32 nStart); -INT32 CpsLoadTilesPunisherb(INT32 nStart); -INT32 CpsLoadStars(UINT8 *pStar, INT32 nStart); -INT32 CpsLoadStarsByte(UINT8 *pStar, INT32 nStart); -INT32 CpsLoadStarsForgottnAlt(UINT8 *pStar, INT32 nStart); -INT32 Cps2LoadTiles(UINT8 *Tile,INT32 nStart); -INT32 Cps2LoadTilesSIM(UINT8 *Tile,INT32 nStart); -INT32 Cps2LoadTilesGigaman2(UINT8 *Tile, UINT8 *pSrc); - -// cps_config.h -#define CPS_B_01 0 -#define CPS_B_02 1 -#define CPS_B_03 2 -#define CPS_B_04 3 -#define CPS_B_05 4 -#define CPS_B_11 5 -#define CPS_B_12 6 -#define CPS_B_13 7 -#define CPS_B_14 8 -#define CPS_B_15 9 -#define CPS_B_16 10 -#define CPS_B_17 11 -#define CPS_B_18 12 -#define CPS_B_21_DEF 13 -#define CPS_B_21_BT1 14 -#define CPS_B_21_BT2 15 -#define CPS_B_21_BT3 16 -#define CPS_B_21_BT4 17 -#define CPS_B_21_BT5 18 -#define CPS_B_21_BT6 19 -#define CPS_B_21_BT7 20 -#define CPS_B_21_QS1 21 -#define CPS_B_21_QS2 22 -#define CPS_B_21_QS3 23 -#define CPS_B_21_QS4 24 -#define CPS_B_21_QS5 25 -#define HACK_B_1 26 -#define HACK_B_2 27 -#define HACK_B_3 28 -#define HACK_B_4 29 -#define HACK_B_5 30 -#define HACK_B_6 31 - -#define GFXTYPE_SPRITES (1<<0) -#define GFXTYPE_SCROLL1 (1<<1) -#define GFXTYPE_SCROLL2 (1<<2) -#define GFXTYPE_SCROLL3 (1<<3) -#define GFXTYPE_STARS (1<<4) - -#define mapper_LWCHR 0 -#define mapper_LW621 1 -#define mapper_DM620 2 -#define mapper_ST24M1 3 -#define mapper_DM22A 4 -#define mapper_DAM63B 5 -#define mapper_ST22B 6 -#define mapper_TK22B 7 -#define mapper_WL24B 8 -#define mapper_S224B 9 -#define mapper_YI24B 10 -#define mapper_AR24B 11 -#define mapper_AR22B 12 -#define mapper_O224B 13 -#define mapper_MS24B 14 -#define mapper_CK24B 15 -#define mapper_NM24B 16 -#define mapper_CA24B 17 -#define mapper_CA22B 18 -#define mapper_STF29 19 -#define mapper_RT24B 20 -#define mapper_RT22B 21 -#define mapper_KD29B 22 -#define mapper_CC63B 23 -#define mapper_KR63B 24 -#define mapper_S9263B 25 -#define mapper_VA63B 26 -#define mapper_VA22B 27 -#define mapper_Q522B 28 -#define mapper_TK263B 29 -#define mapper_CD63B 30 -#define mapper_PS63B 31 -#define mapper_MB63B 32 -#define mapper_QD22B 33 -#define mapper_QD63B 34 -#define mapper_TN2292 35 -#define mapper_RCM63B 36 -#define mapper_PKB10B 37 -#define mapper_pang3 38 -#define mapper_sfzch 39 -#define mapper_cps2 40 -#define mapper_frog 41 -#define mapper_pokon 42 -#define mapper_KNM10B 43 -extern void SetGfxMapper(INT32 MapperId); -extern INT32 GfxRomBankMapper(INT32 Type, INT32 Code); -extern void SetCpsBId(INT32 CpsBId, INT32 bStars); - -// cps_pal.cpp -extern UINT32* CpsPal; // Hicolor version of palette -extern INT32 nCpsPalCtrlReg; -extern INT32 bCpsUpdatePalEveryFrame; -INT32 CpsPalInit(); -INT32 CpsPalExit(); -INT32 CpsPalUpdate(UINT8 *pNewPal); - -// cps_mem.cpp -extern UINT8 *CpsRam90; -extern UINT8 *CpsZRamC0,*CpsZRamF0; -extern UINT8 *CpsSavePal; -extern UINT8 *CpsRam708,*CpsReg,*CpsFrg; -extern UINT8 *CpsSaveReg[MAX_RASTER + 1]; -extern UINT8 *CpsSaveFrg[MAX_RASTER + 1]; -extern UINT8 *CpsRamFF; -void CpsMapObjectBanks(INT32 nBank); -INT32 CpsMemInit(); -INT32 CpsMemExit(); -INT32 CpsAreaScan(INT32 nAction,INT32 *pnMin); - -typedef INT32 (*CpsMemScanCallback)(INT32, INT32*); -extern CpsMemScanCallback CpsMemScanCallbackFunction; - -// cps_run.cpp -extern UINT8 CpsReset; -extern UINT8 Cpi01A, Cpi01C, Cpi01E; -extern UINT8 fFakeDip; -extern INT32 nIrqLine50, nIrqLine52; // The scanlines at which the interrupts are triggered -extern INT32 nCpsNumScanlines; -extern INT32 Cps1VBlankIRQLine; -extern INT32 CpsDrawSpritesInReverse; -INT32 CpsRunInit(); -INT32 CpsRunExit(); -INT32 Cps1Frame(); -INT32 Cps2Frame(); -typedef INT32 (*CpsRunInitCallback)(); -extern CpsRunInitCallback CpsRunInitCallbackFunction; -typedef INT32 (*CpsRunExitCallback)(); -extern CpsRunExitCallback CpsRunExitCallbackFunction; -typedef INT32 (*CpsRunResetCallback)(); -extern CpsRunResetCallback CpsRunResetCallbackFunction; -typedef void (*CpsRunFrameStartCallback)(); -extern CpsRunFrameStartCallback CpsRunFrameStartCallbackFunction; -typedef void (*CpsRunFrameMiddleCallback)(); -extern CpsRunFrameMiddleCallback CpsRunFrameMiddleCallbackFunction; -typedef void (*CpsRunFrameEndCallback)(); -extern CpsRunFrameEndCallback CpsRunFrameEndCallbackFunction; - -inline static UINT8* CpsFindGfxRam(INT32 nAddr,INT32 nLen) -{ - nAddr&=0xffffff; // 24-bit bus - if (nAddr>=0x900000 && nAddr+nLen<=0x930000) return CpsRam90+nAddr-0x900000; - return NULL; -} - -inline static void GetPalette(INT32 nStart, INT32 nCount) -{ - // Update Palette (Ghouls points to the wrong place on boot up I think) - INT32 nPal = (BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x0A))) << 8) & 0xFFFC00; - - UINT8* Find = CpsFindGfxRam(nPal, 0xc00 << 1); - if (Find) { - memcpy(CpsSavePal + (nStart << 10), Find + (nStart << 10), nCount << 10); - } -} - -// cps_rw.cpp -// Treble Winner - Added INP(1FD) for sf2ue -#define CPSINPSET INP(000) INP(001) INP(006) INP(007) INP(008) INP(010) INP(011) INP(012) INP(018) INP(019) INP(01B) INP(020) INP(021) INP(029) INP(176) INP(177) INP(179) INP(186) INP(1fd) - -// prototype for input bits -#define INP(nnn) extern UINT8 CpsInp##nnn[8]; -CPSINPSET -#undef INP - -#define INP(nnn) extern UINT8 Inp##nnn; -CPSINPSET -#undef INP - -#define CPSINPEX INP(c000) INP(c001) INP(c002) INP(c003) - -#define INP(nnnn) extern UINT8 CpsInp##nnnn[8]; -CPSINPEX -#undef INP - -// For the Forgotten Worlds analog controls -extern UINT16 CpsInp055, CpsInp05d; -extern UINT16 CpsInpPaddle1, CpsInpPaddle2; -extern UINT8 CpsDigUD[4]; - -extern INT32 PangEEP; -extern INT32 Forgottn; -extern INT32 Cps1QsHack; -extern INT32 Kodh; -extern INT32 Cawingb; -extern INT32 Wofh; -extern INT32 Sf2thndr; -extern INT32 Pzloop2; -extern INT32 Mmatrix; -extern INT32 Sfa2ObjHack; -extern INT32 Ssf2tb; -extern INT32 Dinohunt; -extern INT32 Port6SoundWrite; -extern INT32 CpsBootlegEEPROM; - -extern UINT8* CpsEncZRom; - -INT32 CpsRwInit(); -INT32 CpsRwExit(); -INT32 CpsRwGetInp(); -void CpsWritePort(const UINT32 ia, UINT8 d); -UINT8 __fastcall CpsReadByte(UINT32 a); -void __fastcall CpsWriteByte(UINT32 a, UINT8 d); -UINT16 __fastcall CpsReadWord(UINT32 a); -void __fastcall CpsWriteWord(UINT32 a, UINT16 d); - -typedef void (*CpsRWSoundCommandCallback)(UINT16); -extern CpsRWSoundCommandCallback CpsRWSoundCommandCallbackFunction; - -// cps_draw.cpp -extern UINT8 CpsRecalcPal; // Flag - If it is 1, recalc the whole palette -extern INT32 nCpsLcReg; // Address of layer controller register -extern INT32 CpsLayEn[6]; // bits for layer enable -extern INT32 nStartline, nEndline; // specify the vertical slice of the screen to render -extern INT32 nRasterline[MAX_RASTER + 2]; // The lines at which an interrupt occurs -extern INT32 MaskAddr[4]; -extern INT32 CpsLayer1XOffs; -extern INT32 CpsLayer2XOffs; -extern INT32 CpsLayer3XOffs; -extern INT32 CpsLayer1YOffs; -extern INT32 CpsLayer2YOffs; -extern INT32 CpsLayer3YOffs; -extern INT32 Cps1DisableBgHi; -extern INT32 CpsDisableRowScroll; -extern INT32 Cps1OverrideLayers; -extern INT32 nCps1Layers[4]; -extern INT32 nCps1LayerOffs[3]; -void DrawFnInit(); -INT32 CpsDraw(); -INT32 CpsRedraw(); - -#define BURN_SND_QSND_OUTPUT_1 0 -#define BURN_SND_QSND_OUTPUT_2 1 - -INT32 QsndInit(); -void QsndSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void QsndExit(); -void QsndReset(); -void QsndNewFrame(); -void QsndEndFrame(); -void QsndSyncZ80(); -INT32 QsndScan(INT32 nAction); - -// qs_z.cpp -INT32 QsndZInit(); -INT32 QsndZExit(); -INT32 QsndZScan(INT32 nAction); - -// qs_c.cpp -INT32 QscInit(INT32 nRate); -void QscSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void QscReset(); -void QscExit(); -INT32 QscScan(INT32 nAction); -void QscNewFrame(); -void QscWrite(INT32 a, INT32 d); -INT32 QscUpdate(INT32 nEnd); - -// cps_tile.cpp -extern UINT32* CpstPal; -extern UINT32 nCpstType; extern INT32 nCpstX,nCpstY; -extern UINT32 nCpstTile; extern INT32 nCpstFlip; -extern UINT32 nCpsBlend; -extern short* CpstRowShift; -extern UINT32 CpstPmsk; // Pixel mask - -inline static void CpstSetPal(INT32 nPal) -{ - nPal <<= 4; - nPal &= 0x7F0; - CpstPal= CpsPal + nPal; -} - -// ctv.cpp -extern INT32 nBgHi; -extern UINT16 ZValue; -extern UINT16 *ZBuf; -extern UINT16 *pZVal; -extern UINT32 nCtvRollX,nCtvRollY; -extern UINT8 *pCtvTile; // Pointer to tile data -extern INT32 nCtvTileAdd; // Amount to add after each tile line -extern UINT8 *pCtvLine; // Pointer to output bitmap -typedef INT32 (*CtvDoFn)(); -typedef INT32 (*CpstOneDoFn)(); -extern CtvDoFn CtvDoX[0x20]; -extern CtvDoFn CtvDoXM[0x20]; -extern CtvDoFn CtvDoXB[0x20]; -extern CpstOneDoFn CpstOneDoX[3]; -extern CpstOneDoFn CpstOneObjDoX[2]; -INT32 CtvReady(); - -// nCpstType constants -// To get size do (nCpstType & 24) + 8 -#define CTT_FLIPX ( 1) -#define CTT_CARE ( 2) -#define CTT_ROWS ( 4) -#define CTT_8X8 ( 0) -#define CTT_16X16 ( 8) -#define CTT_32X32 (24) - -// cps_obj.cpp -extern INT32 nCpsObjectBank; -extern UINT8 *CpsBootlegSpriteRam; -extern INT32 Cps1LockSpriteList910000; -extern INT32 Cps1DetectEndSpriteList8000; - -typedef INT32 (*Cps1ObjGetCallback)(); -extern Cps1ObjGetCallback Cps1ObjGetCallbackFunction; -typedef INT32 (*Cps1ObjDrawCallback)(INT32, INT32); -extern Cps1ObjDrawCallback Cps1ObjDrawCallbackFunction; - -INT32 CpsObjInit(); -INT32 CpsObjExit(); -INT32 CpsObjGet(); -INT32 FcrashObjGet(); -INT32 KodbObjGet(); -INT32 DinopicObjGet(); -INT32 DaimakaibObjGet(); -INT32 WofhObjGet(); -INT32 Sf2mdtObjGet(); -void CpsObjDrawInit(); -INT32 Cps1ObjDraw(INT32 nLevelFrom,INT32 nLevelTo); -INT32 Cps2ObjDraw(INT32 nLevelFrom,INT32 nLevelTo); -INT32 FcrashObjDraw(INT32 nLevelFrom,INT32 nLevelTo); - -// cps_scr.cpp -#define SCROLL_2 0 -#define SCROLL_3 1 -extern INT32 Ghouls; -extern INT32 Ssf2t; -extern INT32 Xmcota; - -extern INT32 Scroll1TileMask; -extern INT32 Scroll2TileMask; -extern INT32 Scroll3TileMask; -INT32 Cps1Scr1Draw(UINT8 *Base,INT32 sx,INT32 sy); -INT32 Cps1Scr3Draw(UINT8 *Base,INT32 sx,INT32 sy); -INT32 Cps2Scr1Draw(UINT8 *Base,INT32 sx,INT32 sy); -INT32 Cps2Scr3Draw(UINT8 *Base,INT32 sx,INT32 sy); - -// cpsr.cpp -extern UINT8 *CpsrBase; // Tile data base -extern INT32 nCpsrScrX,nCpsrScrY; // Basic scroll info -extern UINT16 *CpsrRows; // Row scroll table, 0x400 words long -extern INT32 nCpsrRowStart; // Start of row scroll (can wrap?) - -// Information needed to draw a line -struct CpsrLineInfo { - INT32 nStart; // 0-0x3ff - where to start drawing tiles from - INT32 nWidth; // 0-0x400 - width of scroll shifts - // e.g. for no rowscroll at all, nWidth=0 - INT32 nTileStart; // Range of tiles which are visible onscreen - INT32 nTileEnd; // (e.g. 0x20 -> 0x50 , wraps around to 0x10) - INT16 Rows[16]; // 16 row scroll values for this line - INT32 nMaxLeft, nMaxRight; // Maximum row shifts left and right -}; -extern struct CpsrLineInfo CpsrLineInfo[15]; -INT32 Cps1rPrepare(); -INT32 Cps2rPrepare(); - -// cpsrd.cpp -INT32 Cps1rRender(); -INT32 Cps2rRender(); - -// dc_input.cpp -extern struct BurnInputInfo CpsFsi[0x1B]; - -// ps.cpp -extern UINT8 PsndCode, PsndFade; // Sound code/fade sent to the z80 program -INT32 PsndInit(); -INT32 PsndExit(); -void PsndNewFrame(); -INT32 PsndSyncZ80(INT32 nCycles); -INT32 PsndScan(INT32 nAction); - -// ps_z.cpp -INT32 PsndZInit(); -INT32 PsndZExit(); -INT32 PsndZScan(INT32 nAction); -extern INT32 Kodb; - -// ps_m.cpp -extern INT32 bPsmOkay; // 1 if the module is okay -INT32 PsmInit(); -INT32 PsmExit(); -void PsmNewFrame(); -INT32 PsmUpdate(INT32 nEnd); - -// kabuki.cpp -void wof_decode(); -void dino_decode(); -void punisher_decode(); -void slammast_decode(); - -// cps2_crypt.cpp -void cps2_decrypt_game_data(); - -// fcrash_snd.cpp -void FcrashSoundCommand(UINT16 d); -INT32 FcrashSoundInit(); -INT32 FcrashSoundReset(); -INT32 FcrashSoundExit(); -void FcrashSoundFrameStart(); -void FcrashSoundFrameEnd(); -INT32 FcrashScanSound(INT32 nAction, INT32 *pnMin); - -// sf2mdt_snd.cpp -void Sf2mdtSoundCommand(UINT16 d); -INT32 Sf2mdtSoundInit(); -INT32 Sf2mdtSoundReset(); -INT32 Sf2mdtSoundExit(); -void Sf2mdtSoundFrameStart(); -void Sf2mdtSoundFrameEnd(); -INT32 Sf2mdtScanSound(INT32 nAction, INT32 *pnMin); - -// d_cps2.cpp -#define CPS2_PRG_68K 1 -#define CPS2_PRG_68K_SIMM 2 -#define CPS2_PRG_68K_XOR_TABLE 3 -#define CPS2_GFX 5 -#define CPS2_GFX_SIMM 6 -#define CPS2_GFX_SPLIT4 7 -#define CPS2_GFX_SPLIT8 8 -#define CPS2_GFX_19XXJ 9 -#define CPS2_PRG_Z80 10 -#define CPS2_QSND 12 -#define CPS2_QSND_SIMM 13 -#define CPS2_QSND_SIMM_BYTESWAP 14 -#define CPS2_ENCRYPTION_KEY 15 - -extern INT32 Cps2Volume; -extern UINT16 Cps2VolumeStates[40]; -extern INT32 Cps2DisableDigitalVolume; -extern UINT8 Cps2VolUp; -extern UINT8 Cps2VolDwn; diff --git a/jan/src/burn/drv/capcom/cps2_crpt.cpp b/jan/src/burn/drv/capcom/cps2_crpt.cpp deleted file mode 100644 index 81d03e16a..000000000 --- a/jan/src/burn/drv/capcom/cps2_crpt.cpp +++ /dev/null @@ -1,802 +0,0 @@ -/****************************************************************************** - -CPS-2 Encryption - -All credit goes to Andreas Naive for breaking the encryption algorithm. -Code by Nicola Salmoria. -Thanks to Charles MacDonald and Razoola for extracting the data from the hardware. - - -The encryption only affects opcodes, not data. - -It consists of two 4-round Feistel networks (FN) and involves both -the 16-bit opcode and the low 16 bits of the address. - -Let be: - -E = 16-bit ciphertext -A = 16-bit address -K = 64-bit key -D = 16-bit plaintext -y = FN1(x,k) = function describing the first Feistel network (x,y = 16 bit, k = 64 bit) -y = FN2(x,k) = function describing the second Feistel network (x,y = 16 bit, k = 64 bit) -y = EX(x) = fixed function that expands the 16-bit x to the 64-bit y - -Then the cipher can be described as: - -D = FN2( E, K XOR EX( FN1(A, K ) ) ) - - -Each round of the Feistel networks consists of four substitution boxes. The boxes -have 6 inputs and 2 outputs. Usually the input is the XOR of a data bit and a key -bit, however in some cases only the key is used. - -(TODO-notes about accuracy of s-boxes) - -The s-boxes were chosen in order to use an empty key (all FF) for the dead board. - - -Also, the hardware has different watchdog opcodes and address range (see below) -which are stored in the battery backed RAM. There doesn't appear to be any relation -between those and the 64-bit encryption key, so they probably use an additional -64 bits of battery-backed RAM. - - - -First FN: - - B(0 1 3 5 8 9 11 12) A(10 4 6 7 2 13 15 14) - L0 R0 - | | - XOR<-----------[F1]<------------| - | | - R1 L1 - | | - |------------>[F2]----------->XOR - | | - L2 R2 - | | - XOR<-----------[F3]<------------| - | | - R3 L3 - | | - |------------>[F4]----------->XOR - | | - L4 R4 - (10 4 6 7 2 13 15 14) (0 1 3 5 8 9 11 12) - - -Second FN: - - B(3 5 9 10 8 15 12 11) A(6 0 2 13 1 4 14 7) - L0 R0 - | | - XOR<-----------[F1]<------------| - | | - R1 L1 - | | - |------------>[F2]----------->XOR - | | - L2 R2 - | | - XOR<-----------[F3]<------------| - | | - R3 L3 - | | - |------------>[F4]----------->XOR - | | - L4 R4 - (6 0 2 13 1 4 14 7) (3 5 9 10 8 15 12 11) - -****************************************************************************** - -Some Encryption notes. ----------------------- - -Address range. - -The encryption does _not_ cover the entire address space. The range covered -differs per game. - - -Encryption Watchdog. - -The CPS2 system has a watchdog system that will disable the decryption -of data if the watchdog isn't triggered at least once every few seconds. -The trigger varies from game to game (some games do use the same) and is -basically a 68000 opcode/s instruction. The instruction is the same for -all regions of the game. The watchdog instructions are listed alongside -the decryption keys. - -*******************************************************************************/ - -#if 0 -#include "driver.h" -#include "cpu/m68000/m68kmame.h" -#include "ui.h" -#include "includes/cps1.h" -#endif - -#if 1 -#include "cps.h" -#include "bitswap.h" - -#define BIT(x,n) (((x)>>(n))&1) -#define BITSWAP8(a, b, c, d, e, f, g, h, i) BITSWAP08(a, b, c, d, e, f, g, h, i) -#endif - - -/******************************************************************************/ - -static const INT32 fn1_groupA[8] = { 10, 4, 6, 7, 2, 13, 15, 14 }; -static const INT32 fn1_groupB[8] = { 0, 1, 3, 5, 8, 9, 11, 12 }; - -static const INT32 fn2_groupA[8] = { 6, 0, 2, 13, 1, 4, 14, 7 }; -static const INT32 fn2_groupB[8] = { 3, 5, 9, 10, 8, 15, 12, 11 }; - -/******************************************************************************/ - -// The order of the input and output bits in the s-boxes is arbitrary. -// Each s-box can be XORed with an arbitrary vale in range 0-3 (but the same value -// must be used for the corresponding output bits in f1 and f3 or in f2 and f4) - -struct sbox -{ - const UINT8 table[64]; - const INT32 inputs[6]; // positions of the inputs bits, -1 means no input except from key - const INT32 outputs[2]; // positions of the output bits -}; - -// the above struct better defines how the hardware works, however -// to speed up the decryption at run time we convert it to the -// following one -struct optimised_sbox -{ - UINT8 input_lookup[256]; - UINT8 output[64]; -}; - - -static const struct sbox fn1_r1_boxes[4] = -{ - { // subkey bits 0- 5 - { - 0,2,2,0,1,0,1,1,3,2,0,3,0,3,1,2,1,1,1,2,1,3,2,2,2,3,3,2,1,1,1,2, - 2,2,0,0,3,1,3,1,1,1,3,0,0,1,0,0,1,2,2,1,2,3,2,2,2,3,1,3,2,0,1,3, - }, - { 3, 4, 5, 6, -1, -1 }, - { 3, 6 } - }, - { // subkey bits 6-11 - { - 3,0,2,2,2,1,1,1,1,2,1,0,0,0,2,3,2,3,1,3,0,0,0,2,1,2,2,3,0,3,3,3, - 0,1,3,2,3,3,3,1,1,1,1,2,0,1,2,1,3,2,3,1,1,3,2,2,2,3,1,3,2,3,0,0, - }, - { 0, 1, 2, 4, 7, -1 }, - { 2, 7 } - }, - { // subkey bits 12-17 - { - 3,0,3,1,1,0,2,2,3,1,2,0,3,3,2,3,0,1,0,1,2,3,0,2,0,2,0,1,0,0,1,0, - 2,3,1,2,1,0,2,0,2,1,0,1,0,2,1,0,3,1,2,3,1,3,1,1,1,2,0,2,2,0,0,0, - }, - { 0, 1, 2, 3, 6, 7 }, - { 0, 1 } - }, - { // subkey bits 18-23 - { - 3,2,0,3,0,2,2,1,1,2,3,2,1,3,2,1,2,2,1,3,3,2,1,0,1,0,1,3,0,0,0,2, - 2,1,0,1,0,1,0,1,3,1,1,2,2,3,2,0,3,3,2,0,2,1,3,3,0,0,3,0,1,1,3,3, - }, - { 0, 1, 3, 5, 6, 7 }, - { 4, 5 } - }, -}; - -static const struct sbox fn1_r2_boxes[4] = -{ - { // subkey bits 24-29 - { - 3,3,2,0,3,0,3,1,0,3,0,1,0,2,1,3,1,3,0,3,3,1,3,3,3,2,3,2,2,3,1,2, - 0,2,2,1,0,1,2,0,3,3,0,1,3,2,1,2,3,0,1,3,0,1,2,2,1,2,1,2,0,1,3,0, - }, - { 0, 1, 2, 3, 6, -1 }, - { 1, 6 } - }, - { // subkey bits 30-35 - { - 1,2,3,2,1,3,0,1,1,0,2,0,0,2,3,2,3,3,0,1,2,2,1,0,1,0,1,2,3,2,1,3, - 2,2,2,0,1,0,2,3,2,1,2,1,2,1,0,3,0,1,2,3,1,2,1,3,2,0,3,2,3,0,2,0, - }, - { 2, 4, 5, 6, 7, -1 }, - { 5, 7 } - }, - { // subkey bits 36-41 - { - 0,1,0,2,1,1,0,1,0,2,2,2,1,3,0,0,1,1,3,1,2,2,2,3,1,0,3,3,3,2,2,2, - 1,1,3,0,3,1,3,0,1,3,3,2,1,1,0,0,1,2,2,2,1,1,1,2,2,0,0,3,2,3,1,3, - }, - { 1, 2, 3, 4, 5, 7 }, - { 0, 3 } - }, - { // subkey bits 42-47 - { - 2,1,0,3,3,3,2,0,1,2,1,1,1,0,3,1,1,3,3,0,1,2,1,0,0,0,3,0,3,0,3,0, - 1,3,3,3,0,3,2,0,2,1,2,2,2,1,1,3,0,1,0,1,0,1,1,1,1,3,1,0,1,2,3,3, - }, - { 0, 1, 3, 4, 6, 7 }, - { 2, 4 } - }, -}; - -static const struct sbox fn1_r3_boxes[4] = -{ - { // subkey bits 48-53 - { - 0,0,0,3,3,1,1,0,2,0,2,0,0,0,3,2,0,1,2,3,2,2,1,0,3,0,0,0,0,0,2,3, - 3,0,0,1,1,2,3,3,0,1,3,2,0,1,3,3,2,0,0,1,0,2,0,0,0,3,1,3,3,3,3,3, - }, - { 0, 1, 5, 6, 7, -1 }, - { 0, 5 } - }, - { // subkey bits 54-59 - { - 2,3,2,3,0,2,3,0,2,2,3,0,3,2,0,2,1,0,2,3,1,1,1,0,0,1,0,2,1,2,2,1, - 3,0,2,1,2,3,3,0,3,2,3,1,0,2,1,0,1,2,2,3,0,2,1,3,1,3,0,2,1,1,1,3, - }, - { 2, 3, 4, 6, 7, -1 }, - { 6, 7 } - }, - { // subkey bits 60-65 - { - 3,0,2,1,1,3,1,2,2,1,2,2,2,0,0,1,2,3,1,0,2,0,0,2,3,1,2,0,0,0,3,0, - 2,1,1,2,0,0,1,2,3,1,1,2,0,1,3,0,3,1,1,0,0,2,3,0,0,0,0,3,2,0,0,0, - }, - { 0, 2, 3, 4, 5, 6 }, - { 1, 4 } - }, - { // subkey bits 66-71 - { - 0,1,0,0,2,1,3,2,3,3,2,1,0,1,1,1,1,1,0,3,3,1,1,0,0,2,2,1,0,3,3,2, - 1,3,3,0,3,0,2,1,1,2,3,2,2,2,1,0,0,3,3,3,2,2,3,1,0,2,3,0,3,1,1,0, - }, - { 0, 1, 2, 3, 5, 7 }, - { 2, 3 } - }, -}; - -static const struct sbox fn1_r4_boxes[4] = -{ - { // subkey bits 72-77 - { - 1,1,1,1,1,0,1,3,3,2,3,0,1,2,0,2,3,3,0,1,2,1,2,3,0,3,2,3,2,0,1,2, - 0,1,0,3,2,1,3,2,3,1,2,3,2,0,1,2,2,0,0,0,2,1,3,0,3,1,3,0,1,3,3,0, - }, - { 1, 2, 3, 4, 5, 7 }, - { 0, 4 } - }, - { // subkey bits 78-83 - { - 3,0,0,0,0,1,0,2,3,3,1,3,0,3,1,2,2,2,3,1,0,0,2,0,1,0,2,2,3,3,0,0, - 1,1,3,0,2,3,0,3,0,3,0,2,0,2,0,1,0,3,0,1,3,1,1,0,0,1,3,3,2,2,1,0, - }, - { 0, 1, 2, 3, 5, 6 }, - { 1, 3 } - }, - { // subkey bits 84-89 - { - 0,1,1,2,0,1,3,1,2,0,3,2,0,0,3,0,3,0,1,2,2,3,3,2,3,2,0,1,0,0,1,0, - 3,0,2,3,0,2,2,2,1,1,0,2,2,0,0,1,2,1,1,1,2,3,0,3,1,2,3,3,1,1,3,0, - }, - { 0, 2, 4, 5, 6, 7 }, - { 2, 6 } - }, - { // subkey bits 90-95 - { - 0,1,2,2,0,1,0,3,2,2,1,1,3,2,0,2,0,1,3,3,0,2,2,3,3,2,0,0,2,1,3,3, - 1,1,1,3,1,2,1,1,0,3,3,2,3,2,3,0,3,1,0,0,3,0,0,0,2,2,2,1,2,3,0,0, - }, - { 0, 1, 3, 4, 6, 7 }, - { 5, 7 } - }, -}; - -/******************************************************************************/ - -static const struct sbox fn2_r1_boxes[4] = -{ - { // subkey bits 0- 5 - { - 2,0,2,0,3,0,0,3,1,1,0,1,3,2,0,1,2,0,1,2,0,2,0,2,2,2,3,0,2,1,3,0, - 0,1,0,1,2,2,3,3,0,3,0,2,3,0,1,2,1,1,0,2,0,3,1,1,2,2,1,3,1,1,3,1, - }, - { 0, 3, 4, 5, 7, -1 }, - { 6, 7 } - }, - { // subkey bits 6-11 - { - 1,1,0,3,0,2,0,1,3,0,2,0,1,1,0,0,1,3,2,2,0,2,2,2,2,0,1,3,3,3,1,1, - 1,3,1,3,2,2,2,2,2,2,0,1,0,1,1,2,3,1,1,2,0,3,3,3,2,2,3,1,1,1,3,0, - }, - { 1, 2, 3, 4, 6, -1 }, - { 3, 5 } - }, - { // subkey bits 12-17 - { - 1,0,2,2,3,3,3,3,1,2,2,1,0,1,2,1,1,2,3,1,2,0,0,1,2,3,1,2,0,0,0,2, - 2,0,1,1,0,0,2,0,0,0,2,3,2,3,0,1,3,0,0,0,2,3,2,0,1,3,2,1,3,1,1,3, - }, - { 1, 2, 4, 5, 6, 7 }, - { 1, 4 } - }, - { // subkey bits 18-23 - { - 1,3,3,0,3,2,3,1,3,2,1,1,3,3,2,1,2,3,0,3,1,0,0,2,3,0,0,0,3,3,0,1, - 2,3,0,0,0,1,2,1,3,0,0,1,0,2,2,2,3,3,1,2,1,3,0,0,0,3,0,1,3,2,2,0, - }, - { 0, 2, 3, 5, 6, 7 }, - { 0, 2 } - }, -}; - -static const struct sbox fn2_r2_boxes[4] = -{ - { // subkey bits 24-29 - { - 3,1,3,0,3,0,3,1,3,0,0,1,1,3,0,3,1,1,0,1,2,3,2,3,3,1,2,2,2,0,2,3, - 2,2,2,1,1,3,3,0,3,1,2,1,1,1,0,2,0,3,3,0,0,2,0,0,1,1,2,1,2,1,1,0, - }, - { 0, 2, 4, 6, -1, -1 }, - { 4, 6 } - }, - { // subkey bits 30-35 - { - 0,3,0,3,3,2,1,2,3,1,1,1,2,0,2,3,0,3,1,2,2,1,3,3,3,2,1,2,2,0,1,0, - 2,3,0,1,2,0,1,1,2,0,2,1,2,0,2,3,3,1,0,2,3,3,0,3,1,1,3,0,0,1,2,0, - }, - { 1, 3, 4, 5, 6, 7 }, - { 0, 3 } - }, - { // subkey bits 36-41 - { - 0,0,2,1,3,2,1,0,1,2,2,2,1,1,0,3,1,2,2,3,2,1,1,0,3,0,0,1,1,2,3,1, - 3,3,2,2,1,0,1,1,1,2,0,1,2,3,0,3,3,0,3,2,2,0,2,2,1,2,3,2,1,0,2,1, - }, - { 0, 1, 3, 4, 5, 7 }, - { 1, 7 } - }, - { // subkey bits 42-47 - { - 0,2,1,2,0,2,2,0,1,3,2,0,3,2,3,0,3,3,2,3,1,2,3,1,2,2,0,0,2,2,1,2, - 2,3,3,3,1,1,0,0,0,3,2,0,3,2,3,1,1,1,1,0,1,0,1,3,0,0,1,2,2,3,2,0, - }, - { 1, 2, 3, 5, 6, 7 }, - { 2, 5 } - }, -}; - -static const struct sbox fn2_r3_boxes[4] = -{ - { // subkey bits 48-53 - { - 2,1,2,1,2,3,1,3,2,2,1,3,3,0,0,1,0,2,0,3,3,1,0,0,1,1,0,2,3,2,1,2, - 1,1,2,1,1,3,2,2,0,2,2,3,3,3,2,0,0,0,0,0,3,3,3,0,1,2,1,0,2,3,3,1, - }, - { 2, 3, 4, 6, -1, -1 }, - { 3, 5 } - }, - { // subkey bits 54-59 - { - 3,2,3,3,1,0,3,0,2,0,1,1,1,0,3,0,3,1,3,1,0,1,2,3,2,2,3,2,0,1,1,2, - 3,0,0,2,1,0,0,2,2,0,1,0,0,2,0,0,1,3,1,3,2,0,3,3,1,0,2,2,2,3,0,0, - }, - { 0, 1, 3, 5, 7, -1 }, - { 0, 2 } - }, - { // subkey bits 60-65 - { - 2,2,1,0,2,3,3,0,0,0,1,3,1,2,3,2,2,3,1,3,0,3,0,3,3,2,2,1,0,0,0,2, - 1,2,2,2,0,0,1,2,0,1,3,0,2,3,2,1,3,2,2,2,3,1,3,0,2,0,2,1,0,3,3,1, - }, - { 0, 1, 2, 3, 5, 7 }, - { 1, 6 } - }, - { // subkey bits 66-71 - { - 1,2,3,2,0,2,1,3,3,1,0,1,1,2,2,0,0,1,1,1,2,1,1,2,0,1,3,3,1,1,1,2, - 3,3,1,0,2,1,1,1,2,1,0,0,2,2,3,2,3,2,2,0,2,2,3,3,0,2,3,0,2,2,1,1, - }, - { 0, 2, 4, 5, 6, 7 }, - { 4, 7 } - }, -}; - -static const struct sbox fn2_r4_boxes[4] = -{ - { // subkey bits 72-77 - { - 2,0,1,1,2,1,3,3,1,1,1,2,0,1,0,2,0,1,2,0,2,3,0,2,3,3,2,2,3,2,0,1, - 3,0,2,0,2,3,1,3,2,0,0,1,1,2,3,1,1,1,0,1,2,0,3,3,1,1,1,3,3,1,1,0, - }, - { 0, 1, 3, 6, 7, -1 }, - { 0, 3 } - }, - { // subkey bits 78-83 - { - 1,2,2,1,0,3,3,1,0,2,2,2,1,0,1,0,1,1,0,1,0,2,1,0,2,1,0,2,3,2,3,3, - 2,2,1,2,2,3,1,3,3,3,0,1,0,1,3,0,0,0,1,2,0,3,3,2,3,2,1,3,2,1,0,2, - }, - { 0, 1, 2, 4, 5, 6 }, - { 4, 7 } - }, - { // subkey bits 84-89 - { - 2,3,2,1,3,2,3,0,0,2,1,1,0,0,3,2,3,1,0,1,2,2,2,1,3,2,2,1,0,2,1,2, - 0,3,1,0,0,3,1,1,3,3,2,0,1,0,1,3,0,0,1,2,1,2,3,2,1,0,0,3,2,1,1,3, - }, - { 0, 2, 3, 4, 5, 7 }, - { 1, 2 } - }, - { // subkey bits 90-95 - { - 2,0,0,3,2,2,2,1,3,3,1,1,2,0,0,3,1,0,3,2,1,0,2,0,3,2,2,3,2,0,3,0, - 1,3,0,2,2,1,3,3,0,1,0,3,1,1,3,2,0,3,0,2,3,2,1,3,2,3,0,0,1,3,2,1, - }, - { 2, 3, 4, 5, 6, 7 }, - { 5, 6 } - }, -}; - -/******************************************************************************/ - - -static UINT8 fn(UINT8 in, const struct optimised_sbox *sboxes, UINT32 key) -{ - const struct optimised_sbox *sbox1 = &sboxes[0]; - const struct optimised_sbox *sbox2 = &sboxes[1]; - const struct optimised_sbox *sbox3 = &sboxes[2]; - const struct optimised_sbox *sbox4 = &sboxes[3]; - - return - sbox1->output[sbox1->input_lookup[in] ^ ((key >> 0) & 0x3f)] | - sbox2->output[sbox2->input_lookup[in] ^ ((key >> 6) & 0x3f)] | - sbox3->output[sbox3->input_lookup[in] ^ ((key >> 12) & 0x3f)] | - sbox4->output[sbox4->input_lookup[in] ^ ((key >> 18) & 0x3f)]; -} - - - -// srckey is the 64-bit master key (2x32 bits) -// dstkey will contain the 96-bit key for the 1st FN (4x24 bits) -static void expand_1st_key(UINT32 *dstkey, const UINT32 *srckey) -{ - static const INT32 bits[96] = - { - 33, 58, 49, 36, 0, 31, - 22, 30, 3, 16, 5, 53, - 10, 41, 23, 19, 27, 39, - 43, 6, 34, 12, 61, 21, - 48, 13, 32, 35, 6, 42, - 43, 14, 21, 41, 52, 25, - 18, 47, 46, 37, 57, 53, - 20, 8, 55, 54, 59, 60, - 27, 33, 35, 18, 8, 15, - 63, 1, 50, 44, 16, 46, - 5, 4, 45, 51, 38, 25, - 13, 11, 62, 29, 48, 2, - 59, 61, 62, 56, 51, 57, - 54, 9, 24, 63, 22, 7, - 26, 42, 45, 40, 23, 14, - 2, 31, 52, 28, 44, 17, - }; - INT32 i; - - dstkey[0] = 0; - dstkey[1] = 0; - dstkey[2] = 0; - dstkey[3] = 0; - - for (i = 0; i < 96; ++i) - dstkey[i / 24] |= BIT(srckey[bits[i] / 32], bits[i] % 32) << (i % 24); -} - - -// srckey is the 64-bit master key (2x32 bits) XORed with the subkey -// dstkey will contain the 96-bit key for the 2nd FN (4x24 bits) -static void expand_2nd_key(UINT32 *dstkey, const UINT32 *srckey) -{ - static const INT32 bits[96] = - { - 34, 9, 32, 24, 44, 54, - 38, 61, 47, 13, 28, 7, - 29, 58, 18, 1, 20, 60, - 15, 6, 11, 43, 39, 19, - 63, 23, 16, 62, 54, 40, - 31, 3, 56, 61, 17, 25, - 47, 38, 55, 57, 5, 4, - 15, 42, 22, 7, 2, 19, - 46, 37, 29, 39, 12, 30, - 49, 57, 31, 41, 26, 27, - 24, 36, 11, 63, 33, 16, - 56, 62, 48, 60, 59, 32, - 12, 30, 53, 48, 10, 0, - 50, 35, 3, 59, 14, 49, - 51, 45, 44, 2, 21, 33, - 55, 52, 23, 28, 8, 26, - }; - INT32 i; - - dstkey[0] = 0; - dstkey[1] = 0; - dstkey[2] = 0; - dstkey[3] = 0; - - for (i = 0; i < 96; ++i) - dstkey[i / 24] |= BIT(srckey[bits[i] / 32], bits[i] % 32) << (i % 24); -} - - - -// seed is the 16-bit seed generated by the first FN -// subkey will contain the 64-bit key to be XORed with the master key -// for the 2nd FN (2x32 bits) -static void expand_subkey(UINT32* subkey, UINT16 seed) -{ - // Note that each row of the table is a permutation of the seed bits. - static const INT32 bits[64] = - { - 5, 10, 14, 9, 4, 0, 15, 6, 1, 8, 3, 2, 12, 7, 13, 11, - 5, 12, 7, 2, 13, 11, 9, 14, 4, 1, 6, 10, 8, 0, 15, 3, - 4, 10, 2, 0, 6, 9, 12, 1, 11, 7, 15, 8, 13, 5, 14, 3, - 14, 11, 12, 7, 4, 5, 2, 10, 1, 15, 0, 9, 8, 6, 13, 3, - }; - INT32 i; - - subkey[0] = 0; - subkey[1] = 0; - - for (i = 0; i < 64; ++i) - subkey[i / 32] |= BIT(seed, bits[i]) << (i % 32); -} - - - -static UINT16 feistel(UINT16 val, const INT32 *bitsA, const INT32 *bitsB, - const struct optimised_sbox* boxes1, const struct optimised_sbox* boxes2, const struct optimised_sbox* boxes3, const struct optimised_sbox* boxes4, - UINT32 key1, UINT32 key2, UINT32 key3, UINT32 key4) -{ - UINT8 l = BITSWAP8(val, bitsB[7],bitsB[6],bitsB[5],bitsB[4],bitsB[3],bitsB[2],bitsB[1],bitsB[0]); - UINT8 r = BITSWAP8(val, bitsA[7],bitsA[6],bitsA[5],bitsA[4],bitsA[3],bitsA[2],bitsA[1],bitsA[0]); - - l ^= fn(r, boxes1, key1); - r ^= fn(l, boxes2, key2); - l ^= fn(r, boxes3, key3); - r ^= fn(l, boxes4, key4); - - return - (BIT(l, 0) << bitsA[0]) | - (BIT(l, 1) << bitsA[1]) | - (BIT(l, 2) << bitsA[2]) | - (BIT(l, 3) << bitsA[3]) | - (BIT(l, 4) << bitsA[4]) | - (BIT(l, 5) << bitsA[5]) | - (BIT(l, 6) << bitsA[6]) | - (BIT(l, 7) << bitsA[7]) | - (BIT(r, 0) << bitsB[0]) | - (BIT(r, 1) << bitsB[1]) | - (BIT(r, 2) << bitsB[2]) | - (BIT(r, 3) << bitsB[3]) | - (BIT(r, 4) << bitsB[4]) | - (BIT(r, 5) << bitsB[5]) | - (BIT(r, 6) << bitsB[6]) | - (BIT(r, 7) << bitsB[7]); -} - - - -static INT32 extract_inputs(UINT32 val, const INT32 *inputs) -{ - INT32 i; - INT32 res = 0; - - for (i = 0; i < 6; ++i) - { - if (inputs[i] != -1) - res |= BIT(val, inputs[i]) << i; - } - - return res; -} - - - -static void optimise_sboxes(struct optimised_sbox* out, const struct sbox* in) -{ - INT32 box; - - for (box = 0; box < 4; ++box) - { - INT32 i; - - // precalculate the input lookup - for (i = 0; i < 256; ++i) - { - out[box].input_lookup[i] = extract_inputs(i, in[box].inputs); - } - - // precalculate the output masks - for (i = 0; i < 64; ++i) - { - INT32 o = in[box].table[i]; - - out[box].output[i] = 0; - if (o & 1) - out[box].output[i] |= 1 << in[box].outputs[0]; - if (o & 2) - out[box].output[i] |= 1 << in[box].outputs[1]; - } - } -} - -static void cps2_decrypt(const UINT32 *master_key, UINT32 lower_limit, UINT32 upper_limit) -{ - UINT16 *rom = (UINT16 *)CpsRom; - UINT32 length = (upper_limit > 0) ? (upper_limit * 2) : nCpsRomLen; - if (length > nCpsRomLen) length = nCpsRomLen; - CpsCode = (UINT8*)BurnMalloc(length); - nCpsCodeLen = length; - UINT16 *dec = (UINT16*)CpsCode; - - INT32 i; - UINT32 key1[4]; - struct optimised_sbox sboxes1[4*4]; - struct optimised_sbox sboxes2[4*4]; - - optimise_sboxes(&sboxes1[0*4], fn1_r1_boxes); - optimise_sboxes(&sboxes1[1*4], fn1_r2_boxes); - optimise_sboxes(&sboxes1[2*4], fn1_r3_boxes); - optimise_sboxes(&sboxes1[3*4], fn1_r4_boxes); - optimise_sboxes(&sboxes2[0*4], fn2_r1_boxes); - optimise_sboxes(&sboxes2[1*4], fn2_r2_boxes); - optimise_sboxes(&sboxes2[2*4], fn2_r3_boxes); - optimise_sboxes(&sboxes2[3*4], fn2_r4_boxes); - - - // expand master key to 1st FN 96-bit key - expand_1st_key(key1, master_key); - - // add extra bits for s-boxes with less than 6 inputs - key1[0] ^= BIT(key1[0], 1) << 4; - key1[0] ^= BIT(key1[0], 2) << 5; - key1[0] ^= BIT(key1[0], 8) << 11; - key1[1] ^= BIT(key1[1], 0) << 5; - key1[1] ^= BIT(key1[1], 8) << 11; - key1[2] ^= BIT(key1[2], 1) << 5; - key1[2] ^= BIT(key1[2], 8) << 11; - - for (i = 0; i < 0x10000; ++i) - { - INT32 a; - UINT16 seed; - UINT32 subkey[2]; - UINT32 key2[4]; - - if ((i & 0xff) == 0) - { -#if 0 - char loadingMessage[256]; // for displaying with UI - sprintf(loadingMessage, "Decrypting %d%%", i*100/0x10000); - ui_set_startup_text(loadingMessage,FALSE); -#endif - -#if 1 - TCHAR loadingMessage[256]; // for displaying with UI - _stprintf(loadingMessage, _T("Decrypting 68000 ROMs with key %d %s"), (i*100/0x10000), _T("%")); - BurnUpdateProgress(0.0, loadingMessage, 0); -#endif - } - - - // pass the address through FN1 - seed = feistel(i, fn1_groupA, fn1_groupB, - &sboxes1[0*4], &sboxes1[1*4], &sboxes1[2*4], &sboxes1[3*4], - key1[0], key1[1], key1[2], key1[3]); - - - // expand the result to 64-bit - expand_subkey(subkey, seed); - - // XOR with the master key - subkey[0] ^= master_key[0]; - subkey[1] ^= master_key[1]; - - // expand key to 2nd FN 96-bit key - expand_2nd_key(key2, subkey); - - // add extra bits for s-boxes with less than 6 inputs - key2[0] ^= BIT(key2[0], 0) << 5; - key2[0] ^= BIT(key2[0], 6) << 11; - key2[1] ^= BIT(key2[1], 0) << 5; - key2[1] ^= BIT(key2[1], 1) << 4; - key2[2] ^= BIT(key2[2], 2) << 5; - key2[2] ^= BIT(key2[2], 3) << 4; - key2[2] ^= BIT(key2[2], 7) << 11; - key2[3] ^= BIT(key2[3], 1) << 5; - - - // decrypt the opcodes - for (a = i; a < length/2; a += 0x10000) - { - if (a >= lower_limit && a <= upper_limit) { - dec[a] = BURN_ENDIAN_SWAP_INT16(feistel(BURN_ENDIAN_SWAP_INT16(rom[a]), fn2_groupA, fn2_groupB, - &sboxes2[0 * 4], &sboxes2[1 * 4], &sboxes2[2 * 4], &sboxes2[3 * 4], - key2[0], key2[1], key2[2], key2[3])); - } else { - dec[a] = rom[a]; - } - } - } -#if 0 - memory_set_decrypted_region(0, 0x000000, length - 1, dec); - m68k_set_encrypted_opcode_range(0,0,length); -#endif -} - - -#if 1 -void cps2_decrypt_game_data() -{ - if (CpsKey) { - UINT32 key[2]; - UINT32 lower; - UINT32 upper; - - UINT16 decoded[10]; - memset(decoded, 0, sizeof(decoded)); - - for (INT32 b = 0; b < 10 * 16; b++) { - INT32 bit = (317 - b) % 160; - if ((CpsKey[bit / 8] >> ((bit ^ 7) % 8)) & 1) { - decoded[b / 16] |= (0x8000 >> (b % 16)); - } - } - - key[0] = (decoded[0] << 16) | decoded[1]; - key[1] = (decoded[2] << 16) | decoded[3]; - - if (decoded[9] == 0xffff) { - upper = 0xffffff; - lower = 0xff0000; - } else { - upper = (((~decoded[9] & 0x3ff) << 14) | 0x3fff) + 1; - lower = 0; - } - -// bprintf(PRINT_NORMAL, _T("%08X, %08X, %08X, %08X\n"), key[0], key[1], lower, upper); - - cps2_decrypt(key, lower / 2, upper / 2); - } -} -#endif - -#if 0 -DRIVER_INIT( cps2 ) -{ - const char *gamename = machine->gamedrv->name; - const struct game_keys *k = &keys_table[0]; - - while (k->name) - { - if (strcmp(k->name, gamename) == 0) - { - // we have a proper key so use it to decrypt - cps2_decrypt(k->keys, k->upper_limit ? k->upper_limit : 0x400000); - - break; - } - ++k; - } - - init_cps2_video(machine); -} -#endif diff --git a/jan/src/burn/drv/capcom/cps_config.cpp b/jan/src/burn/drv/capcom/cps_config.cpp deleted file mode 100644 index cbdb9cc66..000000000 --- a/jan/src/burn/drv/capcom/cps_config.cpp +++ /dev/null @@ -1,1757 +0,0 @@ -#include "cps.h" - -struct GfxRange { - INT32 Type; - INT32 Start; - INT32 End; - INT32 Bank; -}; - -static const struct GfxRange *GfxBankMapper = NULL; -static INT32 GfxBankSizes[4] = { 0, 0, 0, 0 }; - -static const struct GfxRange mapper_LWCHR_table[] = { - { GFXTYPE_SPRITES, 0x00000, 0x07fff, 0 }, - { GFXTYPE_SCROLL1, 0x00000, 0x1ffff, 0 }, - - { GFXTYPE_STARS, 0x00000, 0x1ffff, 1 }, - { GFXTYPE_SCROLL2, 0x00000, 0x1ffff, 1 }, - { GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_LW621_table[] = { - { GFXTYPE_SPRITES, 0x00000, 0x07fff, 0 }, - { GFXTYPE_SCROLL1, 0x00000, 0x1ffff, 0 }, - - { GFXTYPE_STARS, 0x00000, 0x1ffff, 1 }, - { GFXTYPE_SCROLL2, 0x00000, 0x1ffff, 1 }, - { GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_DM620_table[] = { - { GFXTYPE_SCROLL3, 0x8000, 0xbfff, 1 }, - - { GFXTYPE_SPRITES, 0x2000, 0x3fff, 2 }, - - { GFXTYPE_STARS | GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_DM22A_table[] = { - { GFXTYPE_SPRITES, 0x00000, 0x01fff, 0 }, - { GFXTYPE_SCROLL1, 0x02000, 0x03fff, 0 }, - - { GFXTYPE_SCROLL2, 0x04000, 0x07fff, 1 }, - - { GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 2 }, - - { GFXTYPE_SPRITES, 0x02000, 0x03fff, 3 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_DAM63B_table[] = { - { GFXTYPE_SPRITES, 0x00000, 0x01fff, 0 }, - { GFXTYPE_SCROLL1, 0x02000, 0x02fff, 0 }, - { GFXTYPE_SCROLL2, 0x04000, 0x07fff, 0 }, - - { GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 1 }, - { GFXTYPE_SPRITES, 0x02000, 0x03fff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_ST24M1_table[] = -{ - { GFXTYPE_STARS, 0x00000, 0x003ff, 0 }, - { GFXTYPE_SPRITES, 0x00000, 0x04fff, 0 }, - { GFXTYPE_SCROLL2, 0x04000, 0x07fff, 0 }, - - { GFXTYPE_SCROLL3, 0x00000, 0x07fff, 1 }, - { GFXTYPE_SCROLL1, 0x07000, 0x07fff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_ST22B_table[] = { - { GFXTYPE_STARS, 0x00000, 0x1ffff, 0 }, - { GFXTYPE_SPRITES, 0x00000, 0x03fff, 0 }, - - { GFXTYPE_SPRITES, 0x04000, 0x04fff, 1 }, - { GFXTYPE_SCROLL2, 0x04000, 0x07fff, 1 }, - - { GFXTYPE_SCROLL3, 0x00000, 0x03fff, 2 }, - - { GFXTYPE_SCROLL3, 0x04000, 0x07fff, 3 }, - { GFXTYPE_SCROLL1, 0x07000, 0x07fff, 3 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_TK22B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x3fff, 0 }, - - { GFXTYPE_SPRITES, 0x4000, 0x5fff, 1 }, - { GFXTYPE_SCROLL1, 0x6000, 0x7fff, 1 }, - - { GFXTYPE_SCROLL3, 0x0000, 0x3fff, 2 }, - - { GFXTYPE_SCROLL2, 0x4000, 0x7fff, 3 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_WL24B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x4fff, 0 }, - { GFXTYPE_SCROLL3, 0x5000, 0x6fff, 0 }, - { GFXTYPE_SCROLL1, 0x7000, 0x7fff, 0 }, - - { GFXTYPE_SCROLL2, 0x0000, 0x3fff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_S224B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x43ff, 0 }, - { GFXTYPE_SCROLL1, 0x4400, 0x4bff, 0 }, - { GFXTYPE_SCROLL3, 0x4c00, 0x5fff, 0 }, - { GFXTYPE_SCROLL2, 0x6000, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_YI24B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x1fff, 0 }, - { GFXTYPE_SCROLL3, 0x2000, 0x3fff, 0 }, - { GFXTYPE_SCROLL1, 0x4000, 0x47ff, 0 }, - { GFXTYPE_SCROLL2, 0x4800, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_AR24B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x2fff, 0 }, - { GFXTYPE_SCROLL1, 0x3000, 0x3fff, 0 }, - { GFXTYPE_SCROLL2, 0x4000, 0x5fff, 0 }, - { GFXTYPE_SCROLL3, 0x6000, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_AR22B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x2fff, 0 }, - { GFXTYPE_SCROLL1, 0x3000, 0x3fff, 0 }, - - { GFXTYPE_SCROLL2, 0x4000, 0x5fff, 1 }, - { GFXTYPE_SCROLL3, 0x6000, 0x7fff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_O224B_table[] = { - { GFXTYPE_SCROLL1, 0x0000, 0x0bff, 0 }, - { GFXTYPE_SCROLL2, 0x0c00, 0x3bff, 0 }, - { GFXTYPE_SCROLL3, 0x3c00, 0x4bff, 0 }, - { GFXTYPE_SPRITES, 0x4c00, 0x7fff, 0 }, - - { GFXTYPE_SPRITES, 0x8000, 0xa7ff, 1 }, - { GFXTYPE_SCROLL2, 0xa800, 0xb7ff, 1 }, - { GFXTYPE_SCROLL3, 0xb800, 0xbfff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_MS24B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x3fff, 0 }, - { GFXTYPE_SCROLL1, 0x4000, 0x4fff, 0 }, - { GFXTYPE_SCROLL2, 0x5000, 0x6fff, 0 }, - { GFXTYPE_SCROLL3, 0x7000, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_CK24B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x2fff, 0 }, - { GFXTYPE_SCROLL1, 0x3000, 0x3fff, 0 }, - { GFXTYPE_SCROLL2, 0x4000, 0x6fff, 0 }, - { GFXTYPE_SCROLL3, 0x7000, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_NM24B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x3fff, 0 }, - { GFXTYPE_SCROLL2, 0x0000, 0x3fff, 0 }, - { GFXTYPE_SCROLL1, 0x4000, 0x47ff, 0 }, - { GFXTYPE_SPRITES, 0x4800, 0x67ff, 0 }, - { GFXTYPE_SCROLL2, 0x4800, 0x67ff, 0 }, - { GFXTYPE_SCROLL3, 0x6800, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_CA24B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x2fff, 0 }, - { GFXTYPE_SCROLL2, 0x0000, 0x2fff, 0 }, - { GFXTYPE_SCROLL3, 0x3000, 0x4fff, 0 }, - { GFXTYPE_SCROLL1, 0x5000, 0x57ff, 0 }, - { GFXTYPE_SPRITES, 0x5800, 0x7fff, 0 }, - { GFXTYPE_SCROLL2, 0x5800, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_CA22B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x2fff, 0 }, - { GFXTYPE_SCROLL2, 0x0000, 0x2fff, 0 }, - { GFXTYPE_SCROLL3, 0x3000, 0x3fff, 0 }, - - { GFXTYPE_SCROLL3, 0x4000, 0x4fff, 1 }, - { GFXTYPE_SCROLL1, 0x5000, 0x57ff, 1 }, - { GFXTYPE_SPRITES, 0x5800, 0x7fff, 1 }, - { GFXTYPE_SCROLL2, 0x5800, 0x7fff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_STF29_table[] = { - { GFXTYPE_SPRITES, 0x00000, 0x07fff, 0 }, - - { GFXTYPE_SPRITES, 0x08000, 0x0ffff, 1 }, - - { GFXTYPE_SPRITES, 0x10000, 0x11fff, 2 }, - { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 2 }, - { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 2 }, - { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 2 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_RT24B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x53ff, 0 }, - { GFXTYPE_SCROLL1, 0x5400, 0x6fff, 0 }, - { GFXTYPE_SCROLL3, 0x7000, 0x7fff, 0 }, - - { GFXTYPE_SCROLL3, 0x0000, 0x3fff, 1 }, - { GFXTYPE_SCROLL2, 0x2800, 0x7fff, 1 }, - { GFXTYPE_SPRITES, 0x5400, 0x7fff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_RT22B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x3fff, 0 }, - - { GFXTYPE_SPRITES, 0x4000, 0x53ff, 1 }, - { GFXTYPE_SCROLL1, 0x5400, 0x6fff, 1 }, - { GFXTYPE_SCROLL3, 0x7000, 0x7fff, 1 }, - - { GFXTYPE_SCROLL3, 0x0000, 0x3fff, 2 }, - { GFXTYPE_SCROLL2, 0x2800, 0x3fff, 2 }, - - { GFXTYPE_SCROLL2, 0x4000, 0x7fff, 3 }, - { GFXTYPE_SPRITES, 0x5400, 0x7fff, 3 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_KD29B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x7fff, 0 }, - - { GFXTYPE_SPRITES, 0x8000, 0x8fff, 1 }, - { GFXTYPE_SCROLL2, 0x9000, 0xbfff, 1 }, - { GFXTYPE_SCROLL1, 0xc000, 0xd7ff, 1 }, - { GFXTYPE_SCROLL3, 0xd800, 0xffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_CC63B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x7fff, 0 }, - { GFXTYPE_SCROLL2, 0x0000, 0x7fff, 0 }, - - { GFXTYPE_SPRITES, 0x8000, 0xffff, 1 }, - { GFXTYPE_SCROLL1, 0x8000, 0xffff, 1 }, - { GFXTYPE_SCROLL2, 0x8000, 0xffff, 1 }, - { GFXTYPE_SCROLL3, 0x8000, 0xffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_KR63B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x7fff, 0 }, - { GFXTYPE_SCROLL2, 0x0000, 0x7fff, 0 }, - - { GFXTYPE_SCROLL1, 0x8000, 0x9fff, 1 }, - { GFXTYPE_SPRITES, 0x8000, 0xcfff, 1 }, - { GFXTYPE_SCROLL2, 0x8000, 0xcfff, 1 }, - { GFXTYPE_SCROLL3, 0xd000, 0xffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_S9263B_table[] = { - { GFXTYPE_SPRITES, 0x00000, 0x07fff, 0 }, - - { GFXTYPE_SPRITES, 0x08000, 0x0ffff, 1 }, - - { GFXTYPE_SPRITES, 0x10000, 0x11fff, 2 }, - { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 2 }, - { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 2 }, - { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 2 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_VA63B_table[] = { - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00000, 0x07fff, 0 }, - { 0 , 0, 0 , 0 } -}; - -static const struct GfxRange mapper_VA22B_table[] = { - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00000, 0x03fff, 0 }, - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x04000, 0x07fff, 1 }, - { 0 , 0, 0 , 0 } -}; - -static const struct GfxRange mapper_Q522B_table[] = { - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x0000, 0x6fff, 0 }, - { GFXTYPE_SCROLL3, 0x7000, 0x77ff, 0 }, - { GFXTYPE_SCROLL1, 0x7800, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_TK263B_table[] = { - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00000, 0x07fff, 0 }, - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x08000, 0x0ffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_CD63B_table[] = { - { GFXTYPE_SCROLL1, 0x0000, 0x0fff, 0 }, - { GFXTYPE_SPRITES, 0x1000, 0x7fff, 0 }, - - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x8000, 0xdfff, 1 }, - { GFXTYPE_SCROLL3, 0xe000, 0xffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_PS63B_table[] = { - { GFXTYPE_SCROLL1, 0x0000, 0x0fff, 0 }, - { GFXTYPE_SPRITES, 0x1000, 0x7fff, 0 }, - - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x8000, 0xdbff, 1 }, - { GFXTYPE_SCROLL3, 0xdc00, 0xffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_MB63B_table[] = { - { GFXTYPE_SCROLL1, 0x00000, 0x00fff, 0 }, - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x01000, 0x07fff, 0 }, - - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x08000, 0x0ffff, 1 }, - - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x10000, 0x167ff, 2 }, - { GFXTYPE_SCROLL3, 0x16800, 0x17fff, 2 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_QD22B_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x3fff, 0 }, - { GFXTYPE_SCROLL1, 0x0000, 0x3fff, 0 }, - { GFXTYPE_SCROLL2, 0x0000, 0x3fff, 0 }, - { GFXTYPE_SCROLL3, 0x0000, 0x3fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_QD63B_table[] = { - { GFXTYPE_SCROLL1, 0x0000, 0x07ff, 0 }, - { GFXTYPE_SCROLL3, 0x0800, 0x1fff, 0 }, - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x2000, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_TN2292_table[] = { - { GFXTYPE_SCROLL1, 0x0000, 0x0fff, 0 }, - { GFXTYPE_SCROLL3, 0x1000, 0x3fff, 0 }, - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x4000, 0x7fff, 0 }, - - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x8000, 0xffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_RCM63B_table[] = { - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00000, 0x07fff, 0 }, - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x08000, 0x0ffff, 1 }, - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x10000, 0x17fff, 2 }, - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x18000, 0x1ffff, 3 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_PKB10B_table[] = { - { GFXTYPE_SCROLL1, 0x0000, 0x0fff, 0 }, - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x1000, 0x5fff, 0 }, - { GFXTYPE_SCROLL3, 0x6000, 0x7fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_pang3_table[] = { - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x0000, 0x7fff, 0 }, - - { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x8000, 0x9fff, 1 }, - { GFXTYPE_SCROLL1, 0xa000, 0xbfff, 1 }, - { GFXTYPE_SCROLL3, 0xc000, 0xffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_pokonyan_table[] = { - { GFXTYPE_SPRITES, 0x0000, 0x2fff, 0 }, - { GFXTYPE_SCROLL1, 0x7000, 0x7fff, 0 }, - { GFXTYPE_SCROLL3, 0x3000, 0x3fff, 0 }, - { GFXTYPE_SCROLL2, 0x4000, 0x6fff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_sfzch_table[] = { - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00000, 0x1ffff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_cps2_table[] = -{ - { GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3 | GFXTYPE_SPRITES, 0x00000, 0x1ffff, 1 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_frog_table[] = { - { GFXTYPE_SPRITES | GFXTYPE_SCROLL1 | GFXTYPE_SCROLL2 | GFXTYPE_SCROLL3, 0x00001, 0x1ffff, 0 }, - { 0 , 0, 0, 0 } -}; - -static const struct GfxRange mapper_KNM10B_table[] = { - { GFXTYPE_SPRITES, 0x00000, 0x07fff, 0 }, - { GFXTYPE_SPRITES, 0x08000, 0x0ffff, 1 }, - { GFXTYPE_SPRITES, 0x10000, 0x17fff, 2 }, - { GFXTYPE_SCROLL2, 0x04000, 0x07fff, 2 }, - { GFXTYPE_SCROLL1, 0x01000, 0x01fff, 2 }, - { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 2 }, - { 0 , 0, 0, 0 } -}; - -void SetGfxMapper(INT32 MapperId) -{ - switch (MapperId) { - case mapper_LWCHR: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_LWCHR_table; - return; - } - - case mapper_LW621: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_LW621_table; - return; - } - - case mapper_DM620: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x2000; - GfxBankSizes[2] = 0x2000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_DM620_table; - return; - } - - case mapper_DM22A: { - GfxBankSizes[0] = 0x4000; - GfxBankSizes[1] = 0x4000; - GfxBankSizes[2] = 0x2000; - GfxBankSizes[3] = 0x2000; - GfxBankMapper = mapper_DM22A_table; - return; - } - - case mapper_DAM63B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_DAM63B_table; - return; - } - - case mapper_ST24M1: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_ST24M1_table; - return; - } - - case mapper_ST22B: { - GfxBankSizes[0] = 0x4000; - GfxBankSizes[1] = 0x4000; - GfxBankSizes[2] = 0x4000; - GfxBankSizes[3] = 0x4000; - GfxBankMapper = mapper_ST22B_table; - return; - } - - case mapper_TK22B: { - GfxBankSizes[0] = 0x4000; - GfxBankSizes[1] = 0x4000; - GfxBankSizes[2] = 0x4000; - GfxBankSizes[3] = 0x4000; - GfxBankMapper = mapper_TK22B_table; - return; - } - - case mapper_WL24B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_WL24B_table; - return; - } - - case mapper_S224B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_S224B_table; - return; - } - - case mapper_YI24B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_YI24B_table; - return; - } - - case mapper_AR24B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_AR24B_table; - return; - } - - case mapper_AR22B: { - GfxBankSizes[0] = 0x4000; - GfxBankSizes[1] = 0x4000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_AR22B_table; - return; - } - - case mapper_O224B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x4000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_O224B_table; - return; - } - - case mapper_MS24B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_MS24B_table; - return; - } - - case mapper_CK24B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_CK24B_table; - return; - } - - case mapper_NM24B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_NM24B_table; - return; - } - - case mapper_CA24B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_CA24B_table; - return; - } - - case mapper_CA22B: { - GfxBankSizes[0] = 0x4000; - GfxBankSizes[1] = 0x4000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_CA22B_table; - return; - } - - case mapper_STF29: { - GfxBankSizes[0] = 0x08000; - GfxBankSizes[1] = 0x08000; - GfxBankSizes[2] = 0x08000; - GfxBankSizes[3] = 0x00000; - GfxBankMapper = mapper_STF29_table; - return; - } - - case mapper_RT24B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_RT24B_table; - return; - } - - case mapper_RT22B: { - GfxBankSizes[0] = 0x4000; - GfxBankSizes[1] = 0x4000; - GfxBankSizes[2] = 0x4000; - GfxBankSizes[3] = 0x4000; - GfxBankMapper = mapper_RT22B_table; - return; - } - - case mapper_KD29B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_KD29B_table; - return; - } - - case mapper_CC63B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_CC63B_table; - return; - } - - case mapper_KR63B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_KR63B_table; - return; - } - - case mapper_S9263B: { - GfxBankSizes[0] = 0x08000; - GfxBankSizes[1] = 0x08000; - GfxBankSizes[2] = 0x08000; - GfxBankSizes[3] = 0x00000; - GfxBankMapper = mapper_S9263B_table; - return; - } - - case mapper_VA63B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_VA63B_table; - return; - } - - case mapper_VA22B: { - GfxBankSizes[0] = 0x4000; - GfxBankSizes[1] = 0x4000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_VA22B_table; - return; - } - - case mapper_Q522B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_Q522B_table; - return; - } - - case mapper_TK263B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_TK263B_table; - return; - } - - case mapper_CD63B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_CD63B_table; - return; - } - - case mapper_PS63B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_PS63B_table; - return; - } - - case mapper_MB63B: { - GfxBankSizes[0] = 0x08000; - GfxBankSizes[1] = 0x08000; - GfxBankSizes[2] = 0x08000; - GfxBankSizes[3] = 0x00000; - GfxBankMapper = mapper_MB63B_table; - return; - } - - case mapper_QD22B: { - GfxBankSizes[0] = 0x4000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_QD22B_table; - return; - } - - case mapper_QD63B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_QD63B_table; - return; - } - - case mapper_TN2292: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_TN2292_table; - return; - } - - case mapper_RCM63B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x8000; - GfxBankSizes[3] = 0x8000; - GfxBankMapper = mapper_RCM63B_table; - return; - } - - case mapper_PKB10B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x0000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_PKB10B_table; - return; - } - - case mapper_pang3: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x0000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_pang3_table; - return; - } - - case mapper_pokon: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x8000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_pokonyan_table; - return; - } - - case mapper_sfzch: { - GfxBankSizes[0] = 0x20000; - GfxBankSizes[1] = 0x00000; - GfxBankSizes[2] = 0x00000; - GfxBankSizes[3] = 0x00000; - GfxBankMapper = mapper_sfzch_table; - return; - } - - case mapper_cps2: { - GfxBankSizes[0] = 0x20000; - GfxBankSizes[1] = 0x20000; - GfxBankSizes[2] = 0x00000; - GfxBankSizes[3] = 0x00000; - GfxBankMapper = mapper_cps2_table; - return; - } - - case mapper_frog: { - GfxBankSizes[0] = 0x20000; - GfxBankSizes[1] = 0x00000; - GfxBankSizes[2] = 0x00000; - GfxBankSizes[3] = 0x00000; - GfxBankMapper = mapper_frog_table; - return; - } - - case mapper_KNM10B: { - GfxBankSizes[0] = 0x8000; - GfxBankSizes[1] = 0x8000; - GfxBankSizes[2] = 0x8000; - GfxBankSizes[3] = 0x0000; - GfxBankMapper = mapper_KNM10B_table; - return; - } - } -} - -INT32 GfxRomBankMapper(INT32 Type, INT32 Code) -{ - const struct GfxRange *Range = GfxBankMapper; - INT32 Shift = 0; - - switch (Type) { - case GFXTYPE_SPRITES: Shift = 1; break; - case GFXTYPE_SCROLL1: Shift = 0; break; - case GFXTYPE_SCROLL2: Shift = 1; break; - case GFXTYPE_SCROLL3: Shift = 3; break; - } - - Code <<= Shift; - - while (Range->Type) { - if (Code >= Range->Start && Code <= Range->End) { - if (Range->Type & Type) { - INT32 Base = 0; - INT32 i; - - for (i = 0; i < Range->Bank; ++i) - Base += GfxBankSizes[i]; - - return (Base + (Code & (GfxBankSizes[Range->Bank] - 1))) >> Shift; - } - } - - ++Range; - } - -// bprintf(PRINT_NORMAL, _T("tile %02x/%04x out of range\n"), Type,Code>>Shift); - - return -1; -} - -void SetCpsBId(INT32 CpsBId, INT32 bStars) -{ - switch (CpsBId) { - case CPS_B_01: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x66; - MaskAddr[0] = 0x68; - MaskAddr[1] = 0x6a; - MaskAddr[2] = 0x6c; - MaskAddr[3] = 0x6e; - - nCpsPalCtrlReg = 0x70; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x30; - CpsLayEn[5] = 0x30; - } - return; - } - - case CPS_B_02: { - CpsBID[0] = 0x60; - CpsBID[1] = 0x00; - CpsBID[2] = 0x02; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x6c; - MaskAddr[0] = 0x6a; - MaskAddr[1] = 0x68; - MaskAddr[2] = 0x66; - MaskAddr[3] = 0x64; - - nCpsPalCtrlReg = 0x62; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_03: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x70; - MaskAddr[0] = 0x6e; - MaskAddr[1] = 0x6c; - MaskAddr[2] = 0x6a; - MaskAddr[3] = 0x68; - - nCpsPalCtrlReg = 0x66; - - CpsLayEn[1] = 0x20; - CpsLayEn[2] = 0x10; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_04: { - CpsBID[0] = 0x60; - CpsBID[1] = 0x00; - CpsBID[2] = 0x04; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x6e; - MaskAddr[0] = 0x66; - MaskAddr[1] = 0x70; - MaskAddr[2] = 0x68; - MaskAddr[3] = 0x72; - - nCpsPalCtrlReg = 0x6a; - - CpsLayEn[1] = 0x02; - //CpsLayEn[2] = 0x0c; - CpsLayEn[2] = 0x04; - //CpsLayEn[3] = 0x0c; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_05: { - CpsBID[0] = 0x60; - CpsBID[1] = 0x00; - CpsBID[2] = 0x05; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x68; - MaskAddr[0] = 0x6a; - MaskAddr[1] = 0x6c; - MaskAddr[2] = 0x6e; - MaskAddr[3] = 0x70; - - nCpsPalCtrlReg = 0x72; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x08; - CpsLayEn[3] = 0x20; - if (bStars) { - CpsLayEn[4] = 0x14; - CpsLayEn[5] = 0x14; - } - return; - } - - case CPS_B_11: { - CpsBID[0] = 0x72; - CpsBID[1] = 0x04; - CpsBID[2] = 0x01; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x66; - MaskAddr[0] = 0x68; - MaskAddr[1] = 0x6a; - MaskAddr[2] = 0x6c; - MaskAddr[3] = 0x6e; - - nCpsPalCtrlReg = 0x70; - - CpsLayEn[1] = 0x08; - CpsLayEn[2] = 0x10; - CpsLayEn[3] = 0x20; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_12: { - CpsBID[0] = 0x60; - CpsBID[1] = 0x04; - CpsBID[2] = 0x02; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x6c; - MaskAddr[0] = 0x6a; - MaskAddr[1] = 0x68; - MaskAddr[2] = 0x66; - MaskAddr[3] = 0x64; - - nCpsPalCtrlReg = 0x62; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_13: { - CpsBID[0] = 0x6e; - CpsBID[1] = 0x04; - CpsBID[2] = 0x03; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x62; - MaskAddr[0] = 0x64; - MaskAddr[1] = 0x66; - MaskAddr[2] = 0x68; - MaskAddr[3] = 0x6a; - - nCpsPalCtrlReg = 0x6c; - - CpsLayEn[1] = 0x20; - CpsLayEn[2] = 0x02; - CpsLayEn[3] = 0x04; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_14: { - CpsBID[0] = 0x5e; - CpsBID[1] = 0x04; - CpsBID[2] = 0x04; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x52; - MaskAddr[0] = 0x54; - MaskAddr[1] = 0x56; - MaskAddr[2] = 0x58; - MaskAddr[3] = 0x5a; - - nCpsPalCtrlReg = 0x5c; - - CpsLayEn[1] = 0x08; - CpsLayEn[2] = 0x20; - CpsLayEn[3] = 0x10; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_15: { - CpsBID[0] = 0x4e; - CpsBID[1] = 0x04; - CpsBID[2] = 0x05; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x42; - MaskAddr[0] = 0x44; - MaskAddr[1] = 0x46; - MaskAddr[2] = 0x48; - MaskAddr[3] = 0x4a; - - nCpsPalCtrlReg = 0x4c; - - CpsLayEn[1] = 0x04; - CpsLayEn[2] = 0x02; - CpsLayEn[3] = 0x20; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_16: { - CpsBID[0] = 0x40; - CpsBID[1] = 0x04; - CpsBID[2] = 0x06; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x4c; - MaskAddr[0] = 0x4a; - MaskAddr[1] = 0x48; - MaskAddr[2] = 0x46; - MaskAddr[3] = 0x44; - - nCpsPalCtrlReg = 0x42; - - CpsLayEn[1] = 0x10; - CpsLayEn[2] = 0x0a; - CpsLayEn[3] = 0x0a; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_17: { - CpsBID[0] = 0x48; - CpsBID[1] = 0x04; - CpsBID[2] = 0x07; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x54; - MaskAddr[0] = 0x52; - MaskAddr[1] = 0x50; - MaskAddr[2] = 0x4e; - MaskAddr[3] = 0x4c; - - nCpsPalCtrlReg = 0x4a; - - CpsLayEn[1] = 0x08; - CpsLayEn[2] = 0x14; - CpsLayEn[3] = 0x02; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_18: { - CpsBID[0] = 0xd0; - CpsBID[1] = 0x04; - CpsBID[2] = 0x08; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0xdc; - MaskAddr[0] = 0xda; - MaskAddr[1] = 0xd8; - MaskAddr[2] = 0xd6; - MaskAddr[3] = 0xd4; - - nCpsPalCtrlReg = 0xd2; - - CpsLayEn[1] = 0x10; - CpsLayEn[2] = 0x08; - CpsLayEn[3] = 0x02; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_BT1: { - CpsBID[0] = 0x72; - CpsBID[1] = 0x08; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x4e; - CpsMProt[1] = 0x4c; - CpsMProt[2] = 0x4a; - CpsMProt[3] = 0x48; - - nCpsLcReg = 0x68; - MaskAddr[0] = 0x66; - MaskAddr[1] = 0x64; - MaskAddr[2] = 0x62; - MaskAddr[3] = 0x60; - - nCpsPalCtrlReg = 0x70; - - CpsLayEn[1] = 0x20; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x12; - CpsLayEn[5] = 0x12; - } - return; - } - - case CPS_B_21_BT2: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x5e; - CpsMProt[1] = 0x5c; - CpsMProt[2] = 0x5a; - CpsMProt[3] = 0x58; - - nCpsLcReg = 0x60; - MaskAddr[0] = 0x6e; - MaskAddr[1] = 0x6c; - MaskAddr[2] = 0x6a; - MaskAddr[3] = 0x68; - - nCpsPalCtrlReg = 0x70; - - CpsLayEn[1] = 0x30; - CpsLayEn[2] = 0x08; - CpsLayEn[3] = 0x30; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_BT3: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x46; - CpsMProt[1] = 0x44; - CpsMProt[2] = 0x42; - CpsMProt[3] = 0x40; - - nCpsLcReg = 0x60; - MaskAddr[0] = 0x6e; - MaskAddr[1] = 0x6c; - MaskAddr[2] = 0x6a; - MaskAddr[3] = 0x68; - - nCpsPalCtrlReg = 0x70; - - CpsLayEn[1] = 0x20; - CpsLayEn[2] = 0x12; - CpsLayEn[3] = 0x12; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_BT4: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x46; - CpsMProt[1] = 0x44; - CpsMProt[2] = 0x42; - CpsMProt[3] = 0x40; - - nCpsLcReg = 0x68; - MaskAddr[0] = 0x66; - MaskAddr[1] = 0x64; - MaskAddr[2] = 0x62; - MaskAddr[3] = 0x60; - - nCpsPalCtrlReg = 0x70; - - CpsLayEn[1] = 0x20; - CpsLayEn[2] = 0x10; - CpsLayEn[3] = 0x02; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_BT5: { - CpsBID[0] = 0x32; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x4e; - CpsMProt[1] = 0x4c; - CpsMProt[2] = 0x4a; - CpsMProt[3] = 0x48; - - nCpsLcReg = 0x60; - MaskAddr[0] = 0x6e; - MaskAddr[1] = 0x6c; - MaskAddr[2] = 0x6a; - MaskAddr[3] = 0x68; - - nCpsPalCtrlReg = 0x70; - - CpsLayEn[1] = 0x20; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x02; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_BT6: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x60; - MaskAddr[0] = 0x6e; - MaskAddr[1] = 0x6c; - MaskAddr[2] = 0x6a; - MaskAddr[3] = 0x68; - - nCpsPalCtrlReg = 0x70; - - CpsLayEn[1] = 0x20; - CpsLayEn[2] = 0x14; - CpsLayEn[3] = 0x14; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_BT7: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x6c; - MaskAddr[0] = 0x00; - MaskAddr[1] = 0x00; - MaskAddr[2] = 0x00; - MaskAddr[3] = 0x00; - - nCpsPalCtrlReg = 0x52; - - CpsLayEn[1] = 0x14; - CpsLayEn[2] = 0x02; - CpsLayEn[3] = 0x14; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_DEF: { - CpsBID[0] = 0x32; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x40; - CpsMProt[1] = 0x42; - CpsMProt[2] = 0x44; - CpsMProt[3] = 0x46; - - nCpsLcReg = 0x66; - MaskAddr[0] = 0x68; - MaskAddr[1] = 0x6a; - MaskAddr[2] = 0x6c; - MaskAddr[3] = 0x6e; - - nCpsPalCtrlReg = 0x70; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x30; - CpsLayEn[5] = 0x30; - } - return; - } - - case CPS_B_21_QS1: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x62; - MaskAddr[0] = 0x64; - MaskAddr[1] = 0x66; - MaskAddr[2] = 0x68; - MaskAddr[3] = 0x6a; - - nCpsPalCtrlReg = 0x6c; - - CpsLayEn[1] = 0x10; - CpsLayEn[2] = 0x08; - CpsLayEn[3] = 0x04; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_QS2: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x4a; - MaskAddr[0] = 0x4c; - MaskAddr[1] = 0x4e; - MaskAddr[2] = 0x40; - MaskAddr[3] = 0x42; - - nCpsPalCtrlReg = 0x44; - - CpsLayEn[1] = 0x16; - CpsLayEn[2] = 0x16; - CpsLayEn[3] = 0x16; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_QS3: { - CpsBID[0] = 0x4e; - CpsBID[1] = 0x0c; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x52; - MaskAddr[0] = 0x54; - MaskAddr[1] = 0x56; - MaskAddr[2] = 0x48; - MaskAddr[3] = 0x4a; - - nCpsPalCtrlReg = 0x4c; - - CpsLayEn[1] = 0x04; - CpsLayEn[2] = 0x02; - CpsLayEn[3] = 0x20; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_QS4: { - CpsBID[0] = 0x6e; - CpsBID[1] = 0x0c; - CpsBID[2] = 0x01; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x56; - MaskAddr[0] = 0x40; - MaskAddr[1] = 0x42; - MaskAddr[2] = 0x68; - MaskAddr[3] = 0x6a; - - nCpsPalCtrlReg = 0x6c; - - CpsLayEn[1] = 0x04; - CpsLayEn[2] = 0x08; - CpsLayEn[3] = 0x10; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case CPS_B_21_QS5: { - CpsBID[0] = 0x5e; - CpsBID[1] = 0x0c; - CpsBID[2] = 0x02; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x6a; - MaskAddr[0] = 0x6c; - MaskAddr[1] = 0x6e; - MaskAddr[2] = 0x70; - MaskAddr[3] = 0x72; - - nCpsPalCtrlReg = 0x5c; - - CpsLayEn[1] = 0x04; - CpsLayEn[2] = 0x08; - CpsLayEn[3] = 0x10; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case HACK_B_1: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x54; - MaskAddr[0] = 0x52; - MaskAddr[1] = 0x50; - MaskAddr[2] = 0x4e; - MaskAddr[3] = 0x4c; - - nCpsPalCtrlReg = 0x4a; - - CpsLayEn[1] = 0xff; - CpsLayEn[2] = 0xff; - CpsLayEn[3] = 0xff; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case HACK_B_2: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0xc4; - MaskAddr[0] = 0x52; - MaskAddr[1] = 0x50; - MaskAddr[2] = 0x4e; - MaskAddr[3] = 0x4c; - - nCpsPalCtrlReg = 0x4a; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x02; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case HACK_B_3: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x60; - MaskAddr[0] = 0x68; - MaskAddr[1] = 0x6a; - MaskAddr[2] = 0x6c; - MaskAddr[3] = 0x6e; - - nCpsPalCtrlReg = 0x6a; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x30; - CpsLayEn[5] = 0x30; - } - return; - } - - case HACK_B_4: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x70; - MaskAddr[0] = 0x6e; - MaskAddr[1] = 0x6c; - MaskAddr[2] = 0x6a; - MaskAddr[3] = 0x68; - - nCpsPalCtrlReg = 0x66; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x00; - CpsLayEn[5] = 0x00; - } - return; - } - - case HACK_B_5: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x60; - MaskAddr[0] = 0x66; - MaskAddr[1] = 0x70; - MaskAddr[2] = 0x68; - MaskAddr[3] = 0x72; - - nCpsPalCtrlReg = 0x6a; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x30; - CpsLayEn[5] = 0x30; - } - return; - } - - case HACK_B_6: { - CpsBID[0] = 0x00; - CpsBID[1] = 0x00; - CpsBID[2] = 0x00; - - CpsMProt[0] = 0x00; - CpsMProt[1] = 0x00; - CpsMProt[2] = 0x00; - CpsMProt[3] = 0x00; - - nCpsLcReg = 0x60; - MaskAddr[0] = 0x66; - MaskAddr[1] = 0x68; - MaskAddr[2] = 0x6c; - MaskAddr[3] = 0x6e; - - nCpsPalCtrlReg = 0x6a; - - CpsLayEn[1] = 0x02; - CpsLayEn[2] = 0x04; - CpsLayEn[3] = 0x08; - if (bStars) { - CpsLayEn[4] = 0x30; - CpsLayEn[5] = 0x30; - } - return; - } - } -} diff --git a/jan/src/burn/drv/capcom/cps_draw.cpp b/jan/src/burn/drv/capcom/cps_draw.cpp deleted file mode 100644 index 2321633b3..000000000 --- a/jan/src/burn/drv/capcom/cps_draw.cpp +++ /dev/null @@ -1,516 +0,0 @@ -#include "cps.h" -// CPS - Draw - -UINT8 CpsRecalcPal = 0; // Flag - If it is 1, recalc the whole palette - -static INT32 LayerCont; -INT32 nStartline, nEndline; -INT32 nRasterline[MAX_RASTER + 2]; - -INT32 nCpsLcReg = 0; // Address of layer controller register -INT32 CpsLayEn[6] = {0, 0, 0, 0, 0, 0}; // bits for layer enable -INT32 MaskAddr[4] = {0, 0, 0, 0}; - -INT32 CpsLayer1XOffs = 0; -INT32 CpsLayer2XOffs = 0; -INT32 CpsLayer3XOffs = 0; -INT32 CpsLayer1YOffs = 0; -INT32 CpsLayer2YOffs = 0; -INT32 CpsLayer3YOffs = 0; - -INT32 Cps1DisableBgHi = 0; -INT32 CpsDisableRowScroll = 0; - -INT32 Cps1OverrideLayers = 0; -INT32 nCps1Layers[4] = { -1, -1, -1, -1 }; -INT32 nCps1LayerOffs[3] = { -1, -1, -1 }; - -static void Cps1Layers(); -static void Cps2Layers(); - -typedef INT32 (*CpsObjDrawDoFn)(INT32,INT32); -typedef INT32 (*CpsScrXDrawDoFn)(UINT8 *,INT32,INT32); -typedef void (*CpsLayersDoFn)(); -typedef INT32 (*CpsrPrepareDoFn)(); -typedef INT32 (*CpsrRenderDoFn)(); - -CpsObjDrawDoFn CpsObjDrawDoX; -CpsScrXDrawDoFn CpsScr1DrawDoX; -CpsScrXDrawDoFn CpsScr3DrawDoX; -CpsLayersDoFn CpsLayersDoX; -CpsrPrepareDoFn CpsrPrepareDoX; -CpsrRenderDoFn CpsrRenderDoX; - -void DrawFnInit() -{ - if(Cps == 2) { - CpsLayersDoX = Cps2Layers; - CpsScr1DrawDoX = Cps2Scr1Draw; - CpsScr3DrawDoX = Cps2Scr3Draw; - CpsObjDrawDoX = Cps2ObjDraw; - CpsrPrepareDoX = Cps2rPrepare; - CpsrRenderDoX = Cps2rRender; - } else { - CpsLayersDoX = Cps1Layers; - CpsScr1DrawDoX = Cps1Scr1Draw; - CpsScr3DrawDoX = Cps1Scr3Draw; - CpsObjDrawDoX = Cps1ObjDraw; - CpsrPrepareDoX = Cps1rPrepare; - CpsrRenderDoX = Cps1rRender; - } -} - -static INT32 DrawScroll1(INT32 i) -{ - // Draw Scroll 1 - INT32 nOff, nScrX, nScrY; - UINT8 *Find; - - nOff = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x02))); - if (Cps1OverrideLayers && nCps1LayerOffs[0] != -1) { - nOff = BURN_ENDIAN_SWAP_INT16(nCps1LayerOffs[0]); - } - - // Get scroll coordinates - nScrX = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x0c))); // Scroll 1 X - nScrY = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x0e))); // Scroll 1 Y - - nScrX += 0x40; - -// bprintf(PRINT_NORMAL, _T("1 %x, %x, %x\n"), nOff, nScrX, nScrY); - - nScrX += CpsLayer1XOffs; - nScrY += 0x10; - nScrY += CpsLayer1YOffs; - nOff <<= 8; - nOff &= 0xffc000; - Find = CpsFindGfxRam(nOff, 0x4000); - if (Find == NULL) { - return 1; - } - CpsScr1DrawDoX(Find, nScrX, nScrY); - return 0; -} - -static INT32 DrawScroll2Init(INT32 i) -{ - // Draw Scroll 2 - INT32 nScr2Off; INT32 n; - - nScr2Off = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x04))); - if (Cps1OverrideLayers && nCps1LayerOffs[1] != -1) { - nScr2Off = BURN_ENDIAN_SWAP_INT16(nCps1LayerOffs[1]); - } - - // Get scroll coordinates - nCpsrScrX= BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x10))); // Scroll 2 X - nCpsrScrY= BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x12))); // Scroll 2 Ytess - - // Get row scroll information - n = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x22))); - - nScr2Off <<= 8; - - nCpsrScrX += 0x40; - -// bprintf(PRINT_NORMAL, _T("2 %x, %x, %x\n"), nScr2Off, nCpsrScrX, nCpsrScrY); - - nCpsrScrX += CpsLayer2XOffs; - nCpsrScrX &= 0x03FF; - - nCpsrScrY += 0x10; - nCpsrScrY += CpsLayer2YOffs; - nCpsrScrY &= 0x03FF; - - nScr2Off &= 0xFFC000; - CpsrBase = CpsFindGfxRam(nScr2Off, 0x4000); - if (CpsrBase == NULL) { - return 1; - } - - CpsrRows = NULL; - - if ((n & 1) && !CpsDisableRowScroll) { - INT32 nTab, nStart; - // Find row scroll table: - - nTab = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x08))); - nStart = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x20))); - - nTab <<= 8; - nTab &= 0xFFF800; // Vampire - Row scroll effect in VS screen background - - CpsrRows = (UINT16 *)CpsFindGfxRam(nTab, 0x0800); - - // Find start offset - nCpsrRowStart = nStart + 16; - } - - CpsrPrepareDoX(); - return 0; -} - -inline static INT32 DrawScroll2Exit() -{ - CpsrBase = NULL; - nCpsrScrX = 0; - nCpsrScrY = 0; - CpsrRows = NULL; - return 0; -} - -inline static INT32 DrawScroll2Do() -{ - if (CpsrBase == NULL) { - return 1; - } - CpsrRenderDoX(); - return 0; -} - -static INT32 DrawScroll3(INT32 i) -{ - // Draw Scroll 3 - INT32 nOff, nScrX, nScrY; - UINT8 *Find; - - nOff = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x06))); - if (Cps1OverrideLayers && nCps1LayerOffs[2] != -1) { - nOff = BURN_ENDIAN_SWAP_INT16(nCps1LayerOffs[2]); - } - - // Get scroll coordinates - nScrX = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x14))); // Scroll 3 X - nScrY = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[i] + 0x16))); // Scroll 3 Y - - nScrX += 0x40; - -// bprintf(PRINT_NORMAL, _T("3 %x, %x, %x\n"), nOff, nScrX, nScrY); - - nScrX += CpsLayer3XOffs; - nScrY += 0x10; - nScrY += CpsLayer3YOffs; - - nOff <<= 8; - nOff &= 0xffc000; - Find=CpsFindGfxRam(nOff, 0x4000); - if (Find == NULL) { - return 1; - } - CpsScr3DrawDoX(Find, nScrX, nScrY); - return 0; -} - -static INT32 DrawStar(INT32 nLayer) -{ - INT32 nStar, nStarXPos, nStarYPos, nStarColour; - UINT8* pStar = CpsStar + (nLayer << 12); - - for (nStar = 0; nStar < 0x1000; nStar++) { - nStarColour = pStar[nStar]; - - if (nStarColour != 0x0F) { - nStarXPos = (((nStar >> 8) << 5) - *((INT16*)(CpsSaveReg[0] + 0x18 + (nLayer << 2))) + (nStarColour & 0x1F) - 64) & 0x01FF; - nStarYPos = ((nStar & 0xFF) - *((INT16*)(CpsSaveReg[0] + 0x1A + (nLayer << 2))) - 16) & 0xFF; - - if (nStarXPos < 384 && nStarYPos < 224) { - nStarColour = ((nStarColour & 0xE0) >> 1) + ((GetCurrentFrame() >> 4) & 0x0F); - PutPix(pBurnDraw + (nBurnPitch * nStarYPos) + (nBurnBpp * nStarXPos), CpsPal[0x0800 + (nLayer << 9) + nStarColour]); - } - } - } - - return 0; -} - -static void Cps1Layers() -{ - INT32 Draw[4]={-1,-1,-1,-1}; - INT32 nDrawMask=0; - INT32 i=0; - - nDrawMask=1; // Sprites always on - LayerCont = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[0] + nCpsLcReg))); - // Get correct bits from Layer Controller - if (LayerCont & CpsLayEn[1]) nDrawMask|=2; - if (LayerCont & CpsLayEn[2]) nDrawMask|=4; - if (LayerCont & CpsLayEn[3]) nDrawMask|=8; - nDrawMask&=nBurnLayer; // User choice of layers to display - - // Layer control: - Draw[0]=(LayerCont>>12)&3; // top layer - Draw[1]=(LayerCont>>10)&3; - Draw[2]=(LayerCont>> 8)&3; - Draw[3]=(LayerCont>> 6)&3; // bottom layer (most covered up) - - if (Cps1OverrideLayers) { - nDrawMask = 1; - Draw[0] = nCps1Layers[0]; - Draw[1] = nCps1Layers[1]; - Draw[2] = nCps1Layers[2]; - Draw[3] = nCps1Layers[3]; - if (Draw[1] != -1) nDrawMask |= 2; - if (Draw[2] != -1) nDrawMask |= 4; - if (Draw[3] != -1) nDrawMask |= 8; - nDrawMask &= nBurnLayer; - } - - // Check for repeated layers and if there are any, the lower layer is omitted -#define CRP(a,b) if (Draw[a]==Draw[b]) Draw[b]=-1; - CRP(0,1) CRP(0,2) CRP(0,3) CRP(1,2) CRP(1,3) CRP(2,3) -#undef CRP - - for (i = 0; i < 2; i++) { - if (LayerCont & CpsLayEn[4 + i]) { - DrawStar(i); - } - } - - // prepare layer 2 - DrawScroll2Init(0); - - // draw layers, bottom -> top - for (i=3;i>=0;i--) - { - INT32 n=Draw[i]; // Find out which layer to draw - - if (n==0) { - if (nDrawMask & 1) CpsObjDrawDoX(0,7); - - if (!Cps1DisableBgHi && i+1 < 4) { - nBgHi=1; - switch (Draw[i+1]) { - case 1: - if (nDrawMask & 2) DrawScroll1(0); - break; - case 2: - if (nDrawMask & 4) DrawScroll2Do(); - break; - case 3: - if (nDrawMask & 8) DrawScroll3(0); - break; - } - nBgHi=0; - } - } - - // Then Draw the scroll layer on top - switch (n) { - case 1: - if (nDrawMask & 2) DrawScroll1(0); - break; - case 2: - if (nDrawMask & 4) DrawScroll2Do(); - break; - case 3: - if (nDrawMask & 8) DrawScroll3(0); - break; - } - } - - DrawScroll2Exit(); -} - -static void Cps2Layers() -{ - INT32 Draw[MAX_RASTER][4]; - INT32 Prio[MAX_RASTER][4]; - INT32 nDrawMask[MAX_RASTER]; - - CpsObjDrawInit(); - - INT32 nSlice = 0; - do { - LayerCont = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(CpsSaveReg[nSlice] + nCpsLcReg))); - - // Determine which layers are enabled - nDrawMask[nSlice] = 1; // Sprites always on - if (LayerCont & CpsLayEn[1]) nDrawMask[nSlice] |= 2; - if (LayerCont & CpsLayEn[2]) nDrawMask[nSlice] |= 4; - if (LayerCont & CpsLayEn[3]) nDrawMask[nSlice] |= 8; - nDrawMask[nSlice] &= nBurnLayer; // User choice of layers to display - - // Determine layer priority: - Draw[nSlice][3] = (LayerCont >> 12) & 3; // top layer - Draw[nSlice][2] = (LayerCont >> 10) & 3; - Draw[nSlice][1] = (LayerCont >> 8) & 3; - Draw[nSlice][0] = (LayerCont >> 6) & 3; // bottom layer (most covered up) - - // Determine layer-sprite priority (layer >= sprites -> layer on top) - INT32 nLayPri = (CpsSaveFrg[nSlice][4] << 8) | CpsSaveFrg[nSlice][5]; // Layer priority register at word (400004) - Prio[nSlice][3] = (nLayPri >> 12) & 7; - Prio[nSlice][2] = (nLayPri >> 8) & 7; - Prio[nSlice][1] = (nLayPri >> 4) & 7; - Prio[nSlice][0] = 0; - - // Check for repeated layers (if found, discard the lower layer) -#define CRP(a, b) if (Draw[nSlice][a] == Draw[nSlice][b]) Draw[nSlice][b] = -1; - CRP(3, 2) CRP(3, 1) CRP(2, 1) CRP(3, 0) CRP(2, 0) CRP(1, 0) -#undef CRP - - // Pre-process priorities - // Higher priority layers must have higher layer-sprite priorities - // N.B. If this is not the case, masking effects may occur (not emulated) -#if 0 - // Raise sprite priorities of top layers if needed - INT32 nHighPrio = 0; - for (INT32 i = 0; i < 4; i++) { - if (Draw[nSlice][i] > 0) { - if (Prio[nSlice][Draw[nSlice][i]] < nHighPrio) { - Prio[nSlice][Draw[nSlice][i]] = nHighPrio; - } else { - nHighPrio = Prio[nSlice][Draw[nSlice][i]]; - } - } - } -#else - // Lower sprite priorities of bottom layers if needed - INT32 nHighPrio = 9999; - for (INT32 i = 3; i >= 0; i--) { - if (Draw[nSlice][i] > 0) { - if (Prio[nSlice][Draw[nSlice][i]] > nHighPrio) { - Prio[nSlice][Draw[nSlice][i]] = nHighPrio; - } else { - nHighPrio = Prio[nSlice][Draw[nSlice][i]]; - } - } - } -#endif - nSlice++; - } while (nSlice < MAX_RASTER && nRasterline[nSlice]); - - INT32 nPrevPrio = -1; - for (INT32 nCurrPrio = 0; nCurrPrio < 8; nCurrPrio++) { - - nSlice = 0; - do { - for (INT32 i = 0; i < 4; i++) { - if ((Draw[nSlice][i] >= 0) && Prio[nSlice][Draw[nSlice][i]] == nCurrPrio) { - - // Render sprites between the previous layer and this one - if ((nDrawMask[0] & 1) && (nPrevPrio < nCurrPrio)) { - CpsObjDrawDoX(nPrevPrio + 1, nCurrPrio); - nPrevPrio = nCurrPrio; - } - - nStartline = nRasterline[nSlice]; - nEndline = nRasterline[nSlice + 1]; - if (!nEndline) { - nEndline = 224; - } - - // Render layer - switch (Draw[nSlice][i]) { - case 1: - if (nDrawMask[nSlice] & 2) { - DrawScroll1(nSlice); - } - break; - case 2: - if (nDrawMask[nSlice] & 4) { - DrawScroll2Init(nSlice); - DrawScroll2Do(); - DrawScroll2Exit(); - } - break; - case 3: - if (nDrawMask[nSlice] & 8) { - DrawScroll3(nSlice); - } - break; - } - } - } - nSlice++; - } while (nSlice < MAX_RASTER && nRasterline[nSlice]); - } - - // Render highest priority sprites - if ((nDrawMask[0] & 1) && (nPrevPrio < 7)) { - CpsObjDrawDoX(nPrevPrio + 1, 7); - } -} - -void CpsClearScreen() -{ - if (Cps == 1) { - switch (nBurnBpp) { - case 4: { - UINT32* pClear = (UINT32*)pBurnDraw; - UINT32 nColour = CpsPal[0xbff ^ 15]; - for (INT32 i = 0; i < 384 * 224 / 8; i++) { - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - } - break; - } - - case 3: { - UINT8* pClear = pBurnDraw; - UINT8 r = CpsPal[0xbff ^ 15]; - UINT8 g = (CpsPal[0xbff ^ 15] >> 8) & 0xFF; - UINT8 b = (CpsPal[0xbff ^ 15] >> 16) & 0xFF; - r &= 0xFF; - for (INT32 i = 0; i < 384 * 224; i++) { - *pClear++ = r; - *pClear++ = g; - *pClear++ = b; - } - break; - } - - case 2: { - UINT32* pClear = (UINT32*)pBurnDraw; - UINT32 nColour = CpsPal[0xbff ^ 15] | CpsPal[0xbff ^ 15] << 16; - for (INT32 i = 0; i < 384 * 224 / 16; i++) { - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - } - break; - } - } - } else { - memset(pBurnDraw, 0, 384 * 224 * nBurnBpp); - } -} - -static void DoDraw(INT32 Recalc) -{ - CtvReady(); // Point to correct tile drawing functions - - if (CpsRecalcPal || bCpsUpdatePalEveryFrame) GetPalette(0, 6); - if (Recalc || bCpsUpdatePalEveryFrame) CpsPalUpdate(CpsSavePal); // recalc whole palette if needed - - CpsClearScreen(); - - CpsLayersDoX(); -} - -INT32 CpsDraw() -{ - DoDraw(CpsRecalcPal); - - CpsRecalcPal = 0; - return 0; -} - -INT32 CpsRedraw() -{ - DoDraw(1); - - CpsRecalcPal = 0; - return 0; -} - diff --git a/jan/src/burn/drv/capcom/cps_mem.cpp b/jan/src/burn/drv/capcom/cps_mem.cpp deleted file mode 100644 index 4d9cb9d58..000000000 --- a/jan/src/burn/drv/capcom/cps_mem.cpp +++ /dev/null @@ -1,439 +0,0 @@ -#include "cps.h" -// CPS - Memory - -UINT32 CpsMProt[4]; -UINT32 CpsBID[3]; - -static UINT8 *CpsMem=NULL,*CpsMemEnd=NULL; -UINT8 *CpsRam90=NULL; -UINT8 *CpsZRamC0=NULL,*CpsZRamF0=NULL,*CpsEncZRom=NULL; -UINT8 *CpsSavePal=NULL; -UINT8 *CpsSaveReg[MAX_RASTER + 1]; -UINT8 *CpsSaveFrg[MAX_RASTER + 1]; -static UINT8 *CpsSaveRegData = NULL; -static UINT8 *CpsSaveFrgData = NULL; -UINT8 *CpsRam660=NULL,*CpsRam708=NULL,*CpsReg=NULL,*CpsFrg=NULL; -UINT8 *CpsRamFF=NULL; - -CpsMemScanCallback CpsMemScanCallbackFunction = NULL; - -// This routine is called first to determine how much memory is needed -// and then to set up all the pointers. -static INT32 CpsMemIndex() -{ - UINT8* Next; Next = CpsMem; - - CpsRam90 = Next; Next += 0x030000; // Video Ram - CpsRamFF = Next; Next += 0x010000; // Work Ram - CpsReg = Next; Next += 0x000100; // Registers - - CpsSavePal = Next; Next += 0x002000; // Draw Copy of Correct Palette - - if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) { - CpsZRamC0 = Next; Next += 0x001000; // Z80 c000-cfff - CpsZRamF0 = Next; Next += 0x001000; // Z80 f000-ffff - } - - if (Cps == 2) { - CpsRam660 = Next; Next += 0x004000; // Extra Memory - CpsRam708 = Next; Next += 0x010000; // Obj Ram - CpsFrg = Next; Next += 0x000010; // 'Four' Registers (Registers at 0x400000) - - ZBuf = (UINT16*)Next; Next += 384 * 224 * 2; // Sprite Masking Z buffer - - CpsSaveRegData = Next; Next += 0x0100 * (MAX_RASTER + 1); // Draw Copy of registers - CpsSaveFrgData = Next; Next += 0x0010 * (MAX_RASTER + 1); // Draw Copy of 'Four' Registers - - for (INT32 i = 0; i < MAX_RASTER + 1; i++) { - CpsSaveReg[i] = CpsSaveRegData + i * 0x0100; - CpsSaveFrg[i] = CpsSaveFrgData + i * 0x0010; - } - - } else { - CpsSaveRegData = Next; Next += 0x0100; // Draw Copy of registers - CpsSaveFrgData = Next; Next += 0x0010; // Draw Copy of 'Four' Registers - - CpsSaveReg[0] = CpsSaveRegData; - CpsSaveFrg[0] = CpsSaveFrgData; - } - - CpsMemEnd = Next; - - return 0; -} - -static INT32 AllocateMemory() -{ - INT32 nLen; - - CpsMem = NULL; // Find out how much memory is needed - CpsMemIndex(); - nLen = CpsMemEnd - (UINT8*)0; - - if ((CpsMem = (UINT8*)BurnMalloc(nLen)) == NULL) { - return 1; - } - - memset(CpsMem, 0, nLen); // blank all memory - CpsMemIndex(); // Index the allocated memory - - return 0; -} - -// Map the correct bank of obj memory to the 68000 address space (including mirrors). -void CpsMapObjectBanks(INT32 nBank) -{ - if (nBank != nCpsObjectBank) { - nCpsObjectBank = nBank; - - if (nCpsObjectBank) { - SekMapMemory(CpsRam708 + 0x8000, 0x708000, 0x709FFF, MAP_RAM); - SekMapMemory(CpsRam708 + 0x8000, 0x70A000, 0x70BFFF, MAP_RAM); - SekMapMemory(CpsRam708 + 0x8000, 0x70C000, 0x70DFFF, MAP_RAM); - SekMapMemory(CpsRam708 + 0x8000, 0x70E000, 0x70FFFF, MAP_RAM); - } else { - SekMapMemory(CpsRam708, 0x708000, 0x709FFF, MAP_RAM); - SekMapMemory(CpsRam708, 0x70A000, 0x70BFFF, MAP_RAM); - SekMapMemory(CpsRam708, 0x70C000, 0x70DFFF, MAP_RAM); - SekMapMemory(CpsRam708, 0x70E000, 0x70FFFF, MAP_RAM); - } - } -} - -INT32 __fastcall CPSResetCallback() -{ - // Reset instruction on 68000 - if (((Cps & 1) && !Cps1DisablePSnd) || ((Cps == 2) && !Cps2DisableQSnd)) ZetReset(); // Reset Z80 (CPU #1) - - return 0; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall CPSQSoundC0ReadByte(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, _T(" QS %06X read\n"), sekAddress); - - if (!(sekAddress & 1)) { - return 0xFF; - } - - QsndSyncZ80(); - - sekAddress &= 0x1FFF; - return CpsZRamC0[sekAddress >> 1]; -} - -void __fastcall CPSQSoundC0WriteByte(UINT32 sekAddress, UINT8 byteValue) -{ -// bprintf(PRINT_NORMAL, _T(" QS %06X -> %02X\n"), sekAddress, byteValue); - - if (!(sekAddress & 1)) { - return; - } - - sekAddress &= 0x1FFF; - -#if 1 && defined USE_SPEEDHACKS - // Sync only when the last byte of the sound command is written - if (sekAddress == 0x001F) { - QsndSyncZ80(); - } -#else - QsndSyncZ80(); -#endif - - CpsZRamC0[sekAddress >> 1] = byteValue; -} - -UINT8 __fastcall CPSQSoundF0ReadByte(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, _T(" QS %06X read\n"), sekAddress); - - if (!(sekAddress & 1)) { - return 0xFF; - } - - QsndSyncZ80(); - - sekAddress &= 0x1FFF; - return CpsZRamF0[sekAddress >> 1]; -} - -void __fastcall CPSQSoundF0WriteByte(UINT32 sekAddress, UINT8 byteValue) -{ -// bprintf(PRINT_NORMAL, _T(" QS %06X -> %02X\n"), sekAddress, byteValue); - - if (!(sekAddress & 1)) { - return; - } - - sekAddress &= 0x1FFF; - -#if 1 && defined USE_SPEEDHACKS - // Sync only when the last byte of the sound command is written - if (sekAddress == 0x001F) { - QsndSyncZ80(); - } -#else - QsndSyncZ80(); -#endif - - CpsZRamF0[sekAddress >> 1] = byteValue; -} - -// ---------------------------------------------------------------------------- - -#if 0 -UINT8 __fastcall CPSExtraNVRAMReadByte(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, _T(" - 0x%06X read.\n"), sekAddress); - - sekAddress &= 0x3FFF; - return CpsRam660[sekAddress]; -} - -void __fastcall CPSExtraNVRAMWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ -// bprintf(PRINT_NORMAL, _T(" - 0x%06X -> %02X\n"), sekAddress, byteValue); - - sekAddress &= 0x3FFF; - CpsRam660[sekAddress] = byteValue; -} -#endif - -// ---------------------------------------------------------------------------- - -/* -INT32 prevline; - -void __fastcall CpsWriteSpriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (prevline != SekCurrentScanline()) { - prevline = SekCurrentScanline(); -// bprintf(PRINT_NORMAL, _T(" - sb (%3i)\n"), prevline); - } - - sekAddress &= 0x1FFF; - CpsRam708[sekAddress + nCpsObjectBank * 0x8000] = byteValue; -} - -void __fastcall CpsWriteSpriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (prevline != SekCurrentScanline()) { - prevline = SekCurrentScanline(); -// bprintf(PRINT_NORMAL, _T(" - sw (%3i)\n"), prevline); - } - - sekAddress &= 0x1FFE; - CpsRam708[sekAddress + nCpsObjectBank * 0x8000 + 1] = wordValue >> 8; - CpsRam708[sekAddress + nCpsObjectBank * 0x8000 + 0] = wordValue & 255; -} -*/ - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall haxx0rReadByte(UINT32 sekAddress) -{ - sekAddress &= 0xFFFF; - bprintf(PRINT_NORMAL, _T(" QS %06X read (%02X)\n"), sekAddress, CpsEncZRom[sekAddress]); - return CpsEncZRom[sekAddress]; -} - -INT32 CpsMemInit() -{ - if (AllocateMemory()) { - return 1; - } - - SekOpen(0); - - SekSetResetCallback(CPSResetCallback); - - // Map in memory: - // 68000 Rom (as seen as is, through read) - SekMapMemory(CpsRom, 0, nCpsRomLen - 1, MAP_READ); - - // 68000 Rom (as seen decrypted, through fetch) - if (nCpsCodeLen > 0) { - // Decoded part (up to nCpsCodeLen) - SekMapMemory(CpsCode, 0, nCpsCodeLen - 1, MAP_FETCH); - } - if (nCpsRomLen > nCpsCodeLen) { - // The rest (up to nCpsRomLen) - SekMapMemory(CpsRom + nCpsCodeLen, nCpsCodeLen, nCpsRomLen - 1, MAP_FETCH); - } - - if (Cps == 2) { - nCpsObjectBank = -1; - CpsMapObjectBanks(0); - -#if 0 - SekMapHandler(3, 0x660000, 0x663FFF, MAP_RAM); - SekSetReadByteHandler(3, CPSExtraNVRAMReadByte); - SekSetWriteByteHandler(3, CPSExtraNVRAMWriteByte); -#else - SekMapMemory(CpsRam660, 0x660000, 0x663FFF, MAP_RAM); -#endif - -// SekMapHandler(4, 0x708000, 0x709FFF, MAP_WRITE); -// SekMapHandler(4, 0x70A000, 0x70BFFF, MAP_WRITE); -// SekMapHandler(4, 0x70C000, 0x70DFFF, MAP_WRITE); -// SekMapHandler(4, 0x70E000, 0x70FFFF, MAP_WRITE); - -// SekSetWriteByteHandler(4, CpsWriteSpriteByte); -// SekSetWriteWordHandler(4, CpsWriteSpriteWord); - } - - SekMapMemory(CpsRam90, 0x900000, 0x92FFFF, MAP_RAM); // Gfx Ram - SekMapMemory(CpsRamFF, 0xFF0000, 0xFFFFFF, MAP_RAM); // Work Ram - - SekSetReadByteHandler(0, CpsReadByte); - SekSetWriteByteHandler(0, CpsWriteByte); - SekSetReadWordHandler(0, CpsReadWord); - SekSetWriteWordHandler(0, CpsWriteWord); - - // QSound - if ((Cps == 2) && !Cps2DisableQSnd) { - SekMapHandler(1, 0x618000, 0x619FFF, MAP_RAM); - - SekSetReadByteHandler(1, CPSQSoundC0ReadByte); - SekSetWriteByteHandler(1, CPSQSoundC0WriteByte); - } - - if (Cps1Qs == 1) { - // Map the 1st 32KB of the QSound ROM into the 68K address space - for (INT32 i = 0x7FFF; i >= 0; i--) { - CpsEncZRom[(i << 1) + 0] = CpsEncZRom[i]; - CpsEncZRom[(i << 1) + 1] = 0xFF; - } - SekMapMemory(CpsEncZRom, 0xF00000, 0xF0FFFF, MAP_ROM); - - // QSound shared RAM - SekMapHandler(1, 0xF18000, 0xF19FFF, MAP_RAM); - SekMapHandler(2, 0xF1E000, 0xF1FFFF, MAP_RAM); - - SekSetReadByteHandler(1, CPSQSoundC0ReadByte); - SekSetWriteByteHandler(1, CPSQSoundC0WriteByte); - SekSetReadByteHandler(2, CPSQSoundF0ReadByte); - SekSetWriteByteHandler(2, CPSQSoundF0WriteByte); - } - - SekClose(); - - return 0; -} - -INT32 CpsMemExit() -{ -#if 0 - FILE* fp = fopen("mem.raw", "wb"); - if (fp) { - fwrite(CpsRam660, 1, 0x4000, fp); - fclose(fp); - } -#endif - - // Deallocate all used memory - BurnFree(CpsMem); - - CpsMemScanCallbackFunction = NULL; - - return 0; -} - -static INT32 ScanRam() -{ - // scan ram: - struct BurnArea ba; - memset(&ba, 0, sizeof(ba)); - - ba.Data = CpsRam90; ba.nLen = 0x030000; ba.szName = "CpsRam90"; BurnAcb(&ba); - ba.Data = CpsRamFF; ba.nLen = 0x010000; ba.szName = "CpsRamFF"; BurnAcb(&ba); - ba.Data = CpsReg; ba.nLen = 0x000100; ba.szName = "CpsReg"; BurnAcb(&ba); - - if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) { - ba.Data = CpsZRamC0; ba.nLen = 0x001000; ba.szName = "CpsZRamC0"; BurnAcb(&ba); - ba.Data = CpsZRamF0; ba.nLen = 0x001000; ba.szName = "CpsZRamF0"; BurnAcb(&ba); - } - - if (Cps == 2) { - ba.Data = CpsRam708; ba.nLen = 0x010000; ba.szName = "CpsRam708"; BurnAcb(&ba); - ba.Data = CpsFrg; ba.nLen = 0x000010; ba.szName = "CpsFrg"; BurnAcb(&ba); - } - - return 0; -} - -// Scan the current state of the CPS1/2 machine -INT32 CpsAreaScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (CpsMem == NULL) { - return 1; - } - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029521; - } - - if (nAction & ACB_MEMORY_ROM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = CpsRom; - ba.nLen = nCpsRomLen; - ba.szName = "CpsRom"; - BurnAcb(&ba); - - if (nCpsZRomLen) { - ba.Data = CpsZRom; - ba.nLen = nCpsZRomLen; - ba.szName = "CpsZRom"; - BurnAcb(&ba); - } - } - - if (Cps == 2 || Cps1Qs == 1 || PangEEP == 1 || CpsBootlegEEPROM == 1) { // Scan EEPROM - EEPROMScan(nAction, pnMin); - } - - if (nAction & ACB_MEMORY_RAM) { - - ScanRam(); - - if (Cps == 2) { - memset(&ba, 0, sizeof(ba)); - ba.Data = CpsRam660; - ba.nLen = 0x004000; - ba.szName = "CpsRam660"; - BurnAcb(&ba); - } - } - - - if (nAction & ACB_DRIVER_DATA) { // Scan volatile variables/registers/RAM - - SekScan(nAction); // Scan 68000 state - - if (Cps1OverrideLayers) { - SCAN_VAR(nCps1Layers); - SCAN_VAR(nCps1LayerOffs); - } - - if (nAction & ACB_WRITE) { // Palette could have changed - CpsRecalcPal = 1; - } - } - - if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) { // Scan QSound chips - QsndScan(nAction); - } else { // Scan PSound chips - if ((Cps & 1) && !Cps1DisablePSnd) PsndScan(nAction); - } - - if (CpsMemScanCallbackFunction) { - CpsMemScanCallbackFunction(nAction, pnMin); - } - - return 0; -} diff --git a/jan/src/burn/drv/capcom/cps_obj.cpp b/jan/src/burn/drv/capcom/cps_obj.cpp deleted file mode 100644 index cd316e1a7..000000000 --- a/jan/src/burn/drv/capcom/cps_obj.cpp +++ /dev/null @@ -1,869 +0,0 @@ -#include "cps.h" -// CPS Objs (sprites) - -INT32 nCpsObjectBank; -INT32 Sfa2ObjHack = 0; - -UINT8 *CpsBootlegSpriteRam = NULL; - -INT32 Cps1LockSpriteList910000 = 0; -INT32 Cps1DetectEndSpriteList8000 = 0; - -Cps1ObjGetCallback Cps1ObjGetCallbackFunction = NULL; -Cps1ObjDrawCallback Cps1ObjDrawCallbackFunction = NULL; - -// Our copy of the sprite table -static UINT8 *ObjMem = NULL; - -static INT32 nMax = 0; -static INT32 nGetNext = 0; - -static INT32 nMaxZValue; -static INT32 nMaxZMask; - -static INT32 nZOffset; - -// Object frames, so you can lag the Objs by nFrameCount-1 frames -struct ObjFrame { - INT32 nShiftX, nShiftY; - UINT8* Obj; - INT32 nCount; -}; - -static INT32 nFrameCount = 0; -static struct ObjFrame of[3]; - -static UINT8 *blendtable; - -static void CpsBlendInit() -{ - blendtable = NULL; - - TCHAR filename[MAX_PATH]; - - _stprintf(filename, _T("%s%s.bld"), szAppBlendPath, BurnDrvGetText(DRV_NAME)); - - FILE *fa = _tfopen(filename, _T("rt")); - - if (fa == NULL) { - _stprintf(filename, _T("%s%s.bld"), szAppBlendPath, BurnDrvGetText(DRV_PARENT)); - - fa = _tfopen(filename, _T("rt")); - - if (fa == NULL) { - return; - } - } - - bprintf (PRINT_IMPORTANT, _T("Using sprite blending (.bld) table!\n")); - - blendtable = (UINT8*)BurnMalloc(0x40000); // maximum number of sprites - memset (blendtable, 0, 0x40000); // no blend - - char szLine[64]; - - INT32 table[4] = { 0, 0xff-0x3f, 0xff-0x7f, 0xff-0x7f }; // last one 7f? - - while (1) - { - if (fgets (szLine, 64, fa) == NULL) break; - - if (strncmp ("Game", szLine, 4) == 0) continue; // don't care - if (strncmp ("Name", szLine, 4) == 0) continue; // don't care - if (szLine[0] == ';') continue; // comment (also don't care) - - INT32 type, single_entry = -1; - UINT32 min,max,k; - - for (k = 0; k < strlen(szLine); k++) { - if (szLine[k] == '-') { single_entry = k+1; break; } - } - - if (single_entry < 0) { - sscanf(szLine,"%x %d",&max,&type); - min = max; - } else { - sscanf(szLine,"%x",&min); - sscanf(szLine+single_entry,"%x %d",&max,&type); - } - - for (k = min; k <= max; k++) { - if (k < 0x40000) - blendtable[k] = table[type&3]; - } - } - - fclose (fa); -} - -INT32 CpsObjInit() -{ - if (bBurnUseBlend) CpsBlendInit(); - - nMax = 0x100; // CPS1 has 256 sprites - - if (Cps == 2) { // CPS2 has 1024 sprites - nMax = 0x400; - } - - nFrameCount = 2; // CPS2 sprites lagged by 1 frame and double buffered - // CPS1 sprites lagged by 1 frame - - ObjMem = (UINT8*)BurnMalloc((nMax << 3) * nFrameCount); - if (ObjMem == NULL) { - return 1; - } - - // Set up the frame buffers - for (INT32 i = 0; i < nFrameCount; i++) { - of[i].Obj = ObjMem + (nMax << 3) * i; - of[i].nCount = 0; - } - - nGetNext=0; - - if (Cps == 2) { - memset(ZBuf, 0, 384 * 224 * 2); - nMaxZMask = nZOffset = 0; - nMaxZValue = 1; - } - - return 0; -} - -INT32 CpsObjExit() -{ - if (blendtable) - BurnFree(blendtable); - - for (INT32 i = 0; i < nFrameCount; i++) { - of[i].Obj = NULL; - of[i].nCount = 0; - } - - BurnFree(ObjMem); - - nFrameCount = 0; - nMax = 0; - - Cps1DetectEndSpriteList8000 = 0; - - Cps1ObjGetCallbackFunction = NULL; - Cps1ObjDrawCallbackFunction = NULL; - - return 0; -} - -// Get CPS sprites into Obj -INT32 CpsObjGet() -{ - INT32 i; - UINT8 *pg, *po; - struct ObjFrame* pof; - UINT8* Get = NULL; - - if (Cps1ObjGetCallbackFunction) { - return Cps1ObjGetCallbackFunction(); - } - - pof = of + nGetNext; - - pof->nCount = 0; - - po = pof->Obj; - pof->nShiftX = -0x40; - pof->nShiftY = -0x10; - - if (Cps == 2) { - Get = CpsRam708 + ((nCpsObjectBank ^ 1) << 15); // Select CPS2 sprite buffer -// Get = CpsRam708 + ((GetCurrentFrame() & 1) << 15); // Select CPS2 sprite buffer - - pof->nShiftX = -CpsSaveFrg[0][0x9]; - pof->nShiftY = -CpsSaveFrg[0][0xB]; - } else { - INT32 nOff = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x00))) << 8; - nOff &= 0xfff800; - Get = CpsFindGfxRam(nOff, 0x800); - - if (Cps1LockSpriteList910000) { - Get = CpsFindGfxRam(0x910000, 0x800); - } - } - - if (Get==NULL) return 1; - - // Make a copy of all active sprites in the list - for (pg = Get, i = 0; i < nMax; pg += 8, i++) { - UINT16* ps = (UINT16*)pg; - - if (Cps == 2) { - if (BURN_ENDIAN_SWAP_INT16(ps[1]) & 0x8000) { // end of sprite list - break; - } - if (BURN_ENDIAN_SWAP_INT16(ps[3]) >= 0xff00) { // end of sprite list (ringdest) - break; - } - } else { - if (BURN_ENDIAN_SWAP_INT16(ps[3]) >= 0xff00) { // end of sprite list - break; - } - if (Cps1DetectEndSpriteList8000) { - if (BURN_ENDIAN_SWAP_INT16(ps[1]) & 0x8000) { - break; - } - } - } - - if ((BURN_ENDIAN_SWAP_INT16(ps[0]) | BURN_ENDIAN_SWAP_INT16(ps[3])) == 0) { // sprite blank - continue; - } - - // Okay - this sprite is active: - memcpy(po, pg, 8); // copy it over - - pof->nCount++; - po += 8; - } - - nGetNext++; - if (nGetNext >= nFrameCount) { - nGetNext = 0; - } - - return 0; -} - -void CpsObjDrawInit() -{ - nZOffset = nMaxZMask; - - if (nZOffset >= 0xFC00) { - // The Z buffer might moverflow the next fram, so initialise it - memset(ZBuf, 0, 384 * 224 * 2); - nZOffset = 0; - } - - nMaxZValue = nZOffset + 1; - nMaxZMask = nZOffset; - - return; -} - -INT32 Cps1ObjDraw(INT32 nLevelFrom,INT32 nLevelTo) -{ - INT32 i; UINT16 *ps; INT32 nPsAdd; - struct ObjFrame *pof; - (void)nLevelFrom; (void)nLevelTo; - - if (Cps1ObjDrawCallbackFunction) { - return Cps1ObjDrawCallbackFunction(nLevelFrom, nLevelTo); - } - - // Draw the earliest frame we have in history - pof=of+nGetNext; - - // Point to Obj list - ps=(UINT16 *)pof->Obj; - - if (!CpsDrawSpritesInReverse) { - ps+=(pof->nCount-1)<<2; nPsAdd=-4; // CPS1 is reversed - } else { - nPsAdd=4; - } - - // Go through all the Objs - for (i=0; inCount; i++,ps+=nPsAdd) { - INT32 x,y,n,a,bx,by,dx,dy; INT32 nFlip; - - x = BURN_ENDIAN_SWAP_INT16(ps[0]); y = BURN_ENDIAN_SWAP_INT16(ps[1]); n = BURN_ENDIAN_SWAP_INT16(ps[2]); a = BURN_ENDIAN_SWAP_INT16(ps[3]); - - // Find out sprite size - bx=((a>> 8)&15)+1; - by=((a>>12)&15)+1; - - n = GfxRomBankMapper(GFXTYPE_SPRITES, n); - if (n == -1) continue; - - n |= (y & 0x6000) << 3; // high bits of address - - // CPS1 coords are 9 bit signed? - x&=0x01ff; if (x>=0x1c0) x-=0x200; - y&=0x01ff; y^=0x100; y-=0x100; - - x+=pof->nShiftX; - y+=pof->nShiftY; - - // Find the palette for the tiles on this sprite - CpstPal = CpsPal + ((a & 0x1F) << 4); - - nFlip=(a>>5)&3; - - // Take care with tiles if the sprite goes off the screen - if (x<0 || y<0 || x+(bx<<4)>384 || y+(by<<4)>224) { - nCpstType=CTT_16X16 | CTT_CARE; - } else { - nCpstType=CTT_16X16; - } - - nCpstFlip=nFlip; - for (dy=0;dyObj + nPsAdd * (nMaxZValue - nZOffset - 1); - nCount = nZOffset + pof->nCount; - - // Go through all the Objs - for (ZValue = (UINT16)nMaxZValue; ZValue <= nCount; ZValue++, ps += nPsAdd) { - INT32 x, y, n, a, bx, by, dx, dy; - INT32 nFlip; - INT32 v = BURN_ENDIAN_SWAP_INT16(ps[0]) >> 13; - - if ((nSpriteEnable & (1 << v)) == 0) { - continue; - } - - // Check if sprite is between these levels - if (v > nLevelTo) { - bMask = 1; - continue; - } - if (v < nLevelFrom) { - continue; - } - - if (bMask) { - nMaxZMask = ZValue; - } else { - nMaxZValue = ZValue; - } - - // Select CpstOne function; - if (bMask || nMaxZMask > nMaxZValue) { - pCpstOne = CpstOneObjDoX[1]; - } else { - pCpstOne = CpstOneObjDoX[0]; - } - - x = BURN_ENDIAN_SWAP_INT16(ps[0]); - y = BURN_ENDIAN_SWAP_INT16(ps[1]); - n = BURN_ENDIAN_SWAP_INT16(ps[2]); - a = BURN_ENDIAN_SWAP_INT16(ps[3]); - - if (a & 0x80) { // marvel vs capcom ending sprite off-set - x += CpsSaveFrg[0][0x9]; - } - - // CPS2 coords are 10 bit signed (-512 to 511) - x &= 0x03FF; x ^= 0x200; x -= 0x200; - y &= 0x03FF; y ^= 0x200; y -= 0x200; - -#if 0 - // This *MAY* be needed to get correct sprite positions when raster interrups are used. - if (nRasterline[1]) { - for (INT32 i = 1; i < MAX_RASTER; i++) { - if ((y < nRasterline[i]) || (nRasterline[i] == 0)) { - x -= CpsSaveFrg[i - 1][0x09]; - y -= CpsSaveFrg[i - 1][0x0B]; - break; - } - } - } else { - x -= CpsSaveFrg[0][0x9]; - y -= CpsSaveFrg[0][0xB]; - } -#else - // Ignore sprite offsets when raster interrupts are used (seems to work for all games). - x += pof->nShiftX; - y += pof->nShiftY; - -// x -= CpsSaveFrg[0][0x9]; -// y -= CpsSaveFrg[0][0xB]; - -#endif - n |= (BURN_ENDIAN_SWAP_INT16(ps[1]) & 0x6000) << 3; // high bits of address - - // Find the palette for the tiles on this sprite - CpstPal = CpsPal + ((a & 0x1F) << 4); - - nFlip = (a >> 5) & 3; - // Find out sprite size - bx = ((a >> 8) & 15) + 1; - by = ((a >> 12) & 15) + 1; - - // Take care with tiles if the sprite goes off the screen - if (x < 0 || y < 0 || x + (bx << 4) > 383 || y + (by << 4) > 223) { - nCpstType = CTT_16X16 | CTT_CARE; - } else { - nCpstType = CTT_16X16; - } - -// if (v == 0) { -// bprintf(PRINT_IMPORTANT, _T(" - %4i: 0x%04X 0x%04X 0x%04X 0x%04X\n"), ZValue - (UINT16)nMaxZValue, ps[0], ps[1], ps[2], ps[3]); -// } - - nCpstFlip = nFlip; - for (dy = 0; dy < by; dy++) { - for (dx = 0; dx < bx; dx++) { - INT32 ex, ey; - - if (nFlip & 1) { - ex = (bx - dx - 1); - } else { - ex = dx; - } - - if (nFlip & 2) { - ey = (by - dy - 1); - } else { - ey = dy; - } - - nCpstX = x + (ex << 4); - nCpstY = y + (ey << 4); - -// nCpstTile = n + (dy << 4) + dx; // normal version - nCpstTile = (n & ~0x0F) + (dy << 4) + ((n + dx) & 0x0F); // pgear fix - - if (Sfa2ObjHack) { - // hack to not render blue squares on high score screen after name entry - they should be hidden by priority from what I can see - if (nCpstTile == 0x1a410 && (a & 0x1f) == 0 && (nCpstX == 0x40 || nCpstX == 0x100) && nCpstY == 0x50 && v == 0 && nLevelFrom == 0 && nLevelTo == 0) continue; - if (nCpstTile == 0x1a411 && (a & 0x1f) == 0 && (nCpstX == 0x50 || nCpstX == 0x110) && nCpstY == 0x50 && v == 0 && nLevelFrom == 0 && nLevelTo == 0) continue; - //if (ps[2] == 0xa410) bprintf(PRINT_NORMAL, _T("%x, %x, %x, %x, %x, %x, %x\n"), nCpstTile, a & 0x1f, nCpstX, nCpstY, v, nLevelFrom, nLevelTo); - } - - nCpsBlend = (blendtable) ? blendtable[nCpstTile] : 0; - nCpstTile <<= 7; // Find real tile address - - pCpstOne(); - nCpsBlend = 0; - } - } - } - - return 0; -} - -// Final crash sprites - -INT32 FcrashObjGet() -{ - INT32 i; - UINT8 *pg, *po; - struct ObjFrame* pof; - UINT8* Get = NULL; - - pof = of + nGetNext; - - pof->nCount = 0; - - po = pof->Obj; - pof->nShiftX = -0x40; - pof->nShiftY = -0x10; - - Get = CpsRam90 + 0x50c8; - - if (Get==NULL) return 1; - - // Make a copy of all active sprites in the list - for (pg = Get, i = 0; i < nMax; pg += 8, i++) { - UINT16* ps = (UINT16*)pg; - INT32 n, y, x, a; - - y = BURN_ENDIAN_SWAP_INT16(ps[-1]); - - if (y == 0x8000) { // end of sprite list - break; - } - - n = BURN_ENDIAN_SWAP_INT16(ps[0]); - a = BURN_ENDIAN_SWAP_INT16(ps[1]); - x = BURN_ENDIAN_SWAP_INT16(ps[2]); - - po[0] = n & 0xff; - po[1] = n >> 8; - po[2] = a & 0xff; - po[3] = a >> 8; - po[4] = x & 0xff; - po[5] = x >> 8; - po[6] = y & 0xff; - po[7] = y >> 8; - - pof->nCount++; - po += 8; - } - - nGetNext++; - if (nGetNext >= nFrameCount) { - nGetNext = 0; - } - - return 0; -} - -INT32 KodbObjGet() -{ - INT32 i; - UINT8 *pg, *po; - struct ObjFrame* pof; - UINT8* Get = NULL; - - pof = of + nGetNext; - - pof->nCount = 0; - - po = pof->Obj; - pof->nShiftX = -0x40; - pof->nShiftY = -0x10; - - Get = CpsBootlegSpriteRam + 0x1000; - - if (Get==NULL) return 1; - - // Make a copy of all active sprites in the list - for (pg = Get, i = 0; i < nMax; pg += 8, i++) { - UINT16* ps = (UINT16*)pg; - INT32 n, y, x, a; - - y = BURN_ENDIAN_SWAP_INT16(ps[-1]); - - if (y == 0xffff) { // end of sprite list - break; - } - - n = BURN_ENDIAN_SWAP_INT16(ps[0]); - a = BURN_ENDIAN_SWAP_INT16(ps[1]); - x = BURN_ENDIAN_SWAP_INT16(ps[2]); - - po[0] = n & 0xff; - po[1] = n >> 8; - po[2] = a & 0xff; - po[3] = a >> 8; - po[4] = x & 0xff; - po[5] = x >> 8; - po[6] = y & 0xff; - po[7] = y >> 8; - - pof->nCount++; - po += 8; - } - - nGetNext++; - if (nGetNext >= nFrameCount) { - nGetNext = 0; - } - - return 0; -} - -INT32 DinopicObjGet() -{ - INT32 i; - UINT8 *pg, *po; - struct ObjFrame* pof; - UINT8* Get = NULL; - - pof = of + nGetNext; - - pof->nCount = 0; - - po = pof->Obj; - pof->nShiftX = -0x40; - pof->nShiftY = -0x10; - - Get = CpsBootlegSpriteRam + 0x1000; - - if (Get==NULL) return 1; - - // Make a copy of all active sprites in the list - for (pg = Get, i = 0; i < nMax; pg += 8, i++) { - UINT16* ps = (UINT16*)pg; - INT32 n, y, x, a; - - y = BURN_ENDIAN_SWAP_INT16(ps[-1]); - - if (y == 0x8000) { // end of sprite list - break; - } - - n = BURN_ENDIAN_SWAP_INT16(ps[0]); - a = BURN_ENDIAN_SWAP_INT16(ps[1]); - x = BURN_ENDIAN_SWAP_INT16(ps[2]); - - po[0] = n & 0xff; - po[1] = n >> 8; - po[2] = a & 0xff; - po[3] = a >> 8; - po[4] = x & 0xff; - po[5] = x >> 8; - po[6] = y & 0xff; - po[7] = y >> 8; - - pof->nCount++; - po += 8; - } - - nGetNext++; - if (nGetNext >= nFrameCount) { - nGetNext = 0; - } - - return 0; -} - -INT32 DaimakaibObjGet() -{ - INT32 i; - UINT8 *pg, *po; - struct ObjFrame* pof; - UINT8* Get = NULL; - - pof = of + nGetNext; - - pof->nCount = 0; - - po = pof->Obj; - pof->nShiftX = -0x40; - pof->nShiftY = -0x10; - - // writes a blank sprite, followed by end of sprite list marker, start at 0x10 to ignore these - Get = CpsBootlegSpriteRam + 0x1010; - - if (Get==NULL) return 1; - - // Make a copy of all active sprites in the list - for (pg = Get, i = 0; i < nMax; pg += 8, i++) { - UINT16* ps = (UINT16*)pg; - INT32 n, y, x, a; - - y = BURN_ENDIAN_SWAP_INT16(ps[-1]); - - if (y == 0x8000) { // end of sprite list - break; - } - - n = BURN_ENDIAN_SWAP_INT16(ps[0]); - a = BURN_ENDIAN_SWAP_INT16(ps[1]); - x = BURN_ENDIAN_SWAP_INT16(ps[2]); - - n = GfxRomBankMapper(GFXTYPE_SPRITES, n); - if (n == -1) continue; - - n |= (y & 0x6000) << 3; // high bits of address - - po[0] = n & 0xff; - po[1] = n >> 8; - po[2] = a & 0xff; - po[3] = a >> 8; - po[4] = x & 0xff; - po[5] = x >> 8; - po[6] = y & 0xff; - po[7] = y >> 8; - - pof->nCount++; - po += 8; - } - - nGetNext++; - if (nGetNext >= nFrameCount) { - nGetNext = 0; - } - - return 0; -} - -INT32 WofhObjGet() -{ - INT32 i; - UINT8 *pg, *po; - struct ObjFrame* pof; - UINT8* Get = NULL; - - pof = of + nGetNext; - - pof->nCount = 0; - - po = pof->Obj; - pof->nShiftX = -0x40; - pof->nShiftY = -0x10; - - Get = CpsRam90 + 0x1000; - - if (Get==NULL) return 1; - - // Make a copy of all active sprites in the list - for (pg = Get, i = 0; i < nMax; pg += 8, i++) { - UINT16* ps = (UINT16*)pg; - INT32 n, y, x, a; - - y = BURN_ENDIAN_SWAP_INT16(ps[-1]); - - if (y == 0x8000) { // end of sprite list - break; - } - - n = BURN_ENDIAN_SWAP_INT16(ps[0]); - a = BURN_ENDIAN_SWAP_INT16(ps[1]); - x = BURN_ENDIAN_SWAP_INT16(ps[2]); - - po[0] = n & 0xff; - po[1] = n >> 8; - po[2] = a & 0xff; - po[3] = a >> 8; - po[4] = x & 0xff; - po[5] = x >> 8; - po[6] = y & 0xff; - po[7] = y >> 8; - - pof->nCount++; - po += 8; - } - - nGetNext++; - if (nGetNext >= nFrameCount) { - nGetNext = 0; - } - - return 0; -} - -INT32 Sf2mdtObjGet() -{ - INT32 i; - UINT8 *pg, *po; - struct ObjFrame* pof; - UINT8* Get = NULL; - - pof = of + nGetNext; - - pof->nCount = 0; - - po = pof->Obj; - pof->nShiftX = -0x40; - pof->nShiftY = -0x10; - - Get = CpsBootlegSpriteRam + 0x1000; - - if (Get==NULL) return 1; - - // Make a copy of all active sprites in the list - for (pg = Get, i = 0; i < nMax; pg += 8, i++) { - UINT16* ps = (UINT16*)pg; - INT32 n, y, x, a; - - y = BURN_ENDIAN_SWAP_INT16(ps[-1]); - - if (y == 0x8000) { // end of sprite list - break; - } - - n = BURN_ENDIAN_SWAP_INT16(ps[0]); - a = BURN_ENDIAN_SWAP_INT16(ps[1]); - x = BURN_ENDIAN_SWAP_INT16(ps[2]) + 0x03; - - po[0] = n & 0xff; - po[1] = n >> 8; - po[2] = a & 0xff; - po[3] = a >> 8; - po[4] = x & 0xff; - po[5] = x >> 8; - po[6] = y & 0xff; - po[7] = y >> 8; - - pof->nCount++; - po += 8; - } - - nGetNext++; - if (nGetNext >= nFrameCount) { - nGetNext = 0; - } - - return 0; -} - -INT32 FcrashObjDraw(INT32 nLevelFrom,INT32 nLevelTo) -{ - INT32 i; UINT16 *ps; INT32 nPsAdd; - struct ObjFrame *pof; - (void)nLevelFrom; (void)nLevelTo; - - // Draw the earliest frame we have in history - pof=of+nGetNext; - - // Point to Obj list - ps=(UINT16 *)pof->Obj; - - nPsAdd=4; - - // Go through all the Objs - for (i=0; inCount; i++,ps+=nPsAdd) { - INT32 x,y,n,a; INT32 nFlip; - - n = BURN_ENDIAN_SWAP_INT16(ps[0]); - a = BURN_ENDIAN_SWAP_INT16(ps[1]); - x = BURN_ENDIAN_SWAP_INT16(ps[2]); - y = BURN_ENDIAN_SWAP_INT16(ps[3]); - - x &= 0x1ff; - y &= 0x1ff; - - x -= 16; - y = 224 - y; - - // Find the palette for the tiles on this sprite - CpstPal = CpsPal + ((a & 0x1F) << 4); - - nFlip=(a>>5)&3; - - // Take care with tiles if the sprite goes off the screen - if (x<0 || y<0 || x+(1<<4)>384 || y+(1<<4)>224) { - nCpstType=CTT_16X16 | CTT_CARE; - } else { - nCpstType=CTT_16X16; - } - - nCpstFlip=nFlip; - nCpstX=x; - nCpstY=y; - nCpstTile = n; - nCpstTile <<= 7; - CpstOneObjDoX[0](); - } - - return 0; -} diff --git a/jan/src/burn/drv/capcom/cps_pal.cpp b/jan/src/burn/drv/capcom/cps_pal.cpp deleted file mode 100644 index 03c2c2e64..000000000 --- a/jan/src/burn/drv/capcom/cps_pal.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "cps.h" -#include "bitswap.h" - -// CPS (palette) - -static UINT8* CpsPalSrc = NULL; // Copy of current input palette -UINT32* CpsPal = NULL; // Hicolor version of palette -INT32 nCpsPalCtrlReg; -INT32 bCpsUpdatePalEveryFrame = 0; // Some of the hacks need this as they don't write to CpsReg 0x0a - -INT32 CpsPalInit() -{ - INT32 nLen = 0; - - nLen = 0xc00 * sizeof(UINT16); - CpsPalSrc = (UINT8*)BurnMalloc(nLen); - if (CpsPalSrc == NULL) { - return 1; - } - memset(CpsPalSrc, 0, nLen); - - nLen = 0xc00 * sizeof(UINT32); - CpsPal = (UINT32*)BurnMalloc(nLen); - if (CpsPal == NULL) { - return 1; - } - - return 0; -} - -INT32 CpsPalExit() -{ - BurnFree(CpsPal); - BurnFree(CpsPalSrc); - return 0; -} - -// Update CpsPal with the new palette at pNewPal (length 0xc00 bytes) -INT32 CpsPalUpdate(UINT8* pNewPal) -{ - UINT16 *ps, *pn; - - ps = (UINT16*)CpsPalSrc; - pn = (UINT16*)pNewPal; - - memcpy(ps, pn, 0xc00 * sizeof(UINT16)); - - INT32 nCtrl = CpsReg[nCpsPalCtrlReg]; - UINT16 *PaletteRAM = (UINT16*)CpsPalSrc; - - for (INT32 nPage = 0; nPage < 6; nPage++) { - if (BIT(nCtrl, nPage)) { - for (INT32 Offset = 0; Offset < 0x200; ++Offset) { - INT32 Palette = BURN_ENDIAN_SWAP_INT16(*(PaletteRAM++)); - INT32 r, g, b, Bright; - - Bright = 0x0f + ((Palette >> 12) << 1); - - r = ((Palette >> 8) & 0x0f) * 0x11 * Bright / 0x2d; - g = ((Palette >> 4) & 0x0f) * 0x11 * Bright / 0x2d; - b = ((Palette >> 0) & 0x0f) * 0x11 * Bright / 0x2d; - - CpsPal[(0x200 * nPage) + (Offset ^ 15)] = BurnHighCol(r, g, b, 0); - } - } else { - if (PaletteRAM != (UINT16*)CpsPalSrc) { - PaletteRAM += 0x200; - } - } - } - - return 0; -} diff --git a/jan/src/burn/drv/capcom/cps_run.cpp b/jan/src/burn/drv/capcom/cps_run.cpp deleted file mode 100644 index c81adaa1f..000000000 --- a/jan/src/burn/drv/capcom/cps_run.cpp +++ /dev/null @@ -1,530 +0,0 @@ -// CPS - Run -#include "cps.h" - -// Inputs: -UINT8 CpsReset = 0; -UINT8 Cpi01A = 0, Cpi01C = 0, Cpi01E = 0; - -static INT32 nInterrupt; -static INT32 nIrqLine, nIrqCycles; -static bool bEnableAutoIrq50, bEnableAutoIrq52; // Trigger an interrupt every 32 scanlines - -static const INT32 nFirstLine = 0x10; // The first scanline of the display - -static INT32 nCpsCyclesExtra; - -INT32 CpsDrawSpritesInReverse = 0; - -INT32 nIrqLine50, nIrqLine52; - -INT32 nCpsNumScanlines = 259; -INT32 Cps1VBlankIRQLine = 2; - -CpsRunInitCallback CpsRunInitCallbackFunction = NULL; -CpsRunInitCallback CpsRunExitCallbackFunction = NULL; -CpsRunResetCallback CpsRunResetCallbackFunction = NULL; -CpsRunFrameStartCallback CpsRunFrameStartCallbackFunction = NULL; -CpsRunFrameMiddleCallback CpsRunFrameMiddleCallbackFunction = NULL; -CpsRunFrameEndCallback CpsRunFrameEndCallbackFunction = NULL; - -static void CpsQSoundCheatSearchCallback() -{ - // Q-Sound Shared RAM ranges - not useful for cheat searching, and runs the Z80 - // in the handler, exclude it from cheat searching - if (Cps == 2) { - CheatSearchExcludeAddressRange(0x618000, 0x619FFF); - } - - if (Cps1Qs == 1) { - CheatSearchExcludeAddressRange(0xF18000, 0xF19FFF); - CheatSearchExcludeAddressRange(0xF1E000, 0xF1FFFF); - } -} - -static INT32 DrvReset() -{ - // Reset machine - if (Cps == 2 || PangEEP || Cps1Qs == 1 || CpsBootlegEEPROM) EEPROMReset(); - - SekOpen(0); - SekReset(); - SekClose(); - - if (((Cps & 1) && !Cps1DisablePSnd) || ((Cps == 2) && !Cps2DisableQSnd)) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } - - if (Cps == 2) { - // Disable beam-synchronized interrupts - *((UINT16*)(CpsReg + 0x4E)) = BURN_ENDIAN_SWAP_INT16(0x0200); - *((UINT16*)(CpsReg + 0x50)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines); - *((UINT16*)(CpsReg + 0x52)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines); - } - - SekOpen(0); - CpsMapObjectBanks(0); - SekClose(); - - nCpsCyclesExtra = 0; - - if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) { // Sound init (QSound) - QsndReset(); - } - - if (CpsRunResetCallbackFunction) { - CpsRunResetCallbackFunction(); - } - - HiscoreReset(); - - return 0; -} - -static const eeprom_interface qsound_eeprom_interface = -{ - 7, /* address bits */ - 8, /* data bits */ - "0110", /* read command */ - "0101", /* write command */ - "0111", /* erase command */ - 0, - 0, - 0, - 0 -}; - -static const eeprom_interface cps2_eeprom_interface = -{ - 6, /* address bits */ - 16, /* data bits */ - "0110", /* read command */ - "0101", /* write command */ - "0111", /* erase command */ - 0, - 0, - 0, - 0 -}; - -INT32 CpsRunInit() -{ - SekInit(0, 0x68000); // Allocate 68000 - - if (CpsMemInit()) { // Memory init - return 1; - } - - if (Cps == 2 || PangEEP) { - EEPROMInit(&cps2_eeprom_interface); - } else { - if (Cps1Qs == 1 || CpsBootlegEEPROM) { - EEPROMInit(&qsound_eeprom_interface); - } - } - - CpsRwInit(); // Registers setup - - if (CpsPalInit()) { // Palette init - return 1; - } - if (CpsObjInit()) { // Sprite init - return 1; - } - - if ((Cps & 1) && Cps1Qs == 0 && Cps1DisablePSnd == 0) { // Sound init (MSM6295 + YM2151) - if (PsndInit()) { - return 1; - } - } - - if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) { // Sound init (QSound) - if (QsndInit()) { - return 1; - } - QsndSetRoute(BURN_SND_QSND_OUTPUT_1, 1.00, BURN_SND_ROUTE_LEFT); - QsndSetRoute(BURN_SND_QSND_OUTPUT_2, 1.00, BURN_SND_ROUTE_RIGHT); - } - - if (Cps == 2 || PangEEP || Cps1Qs == 1 || CpsBootlegEEPROM) EEPROMReset(); - - if (CpsRunInitCallbackFunction) { - CpsRunInitCallbackFunction(); - } - - DrvReset(); - - //Init Draw Function - DrawFnInit(); - - pBurnDrvPalette = CpsPal; - - if (Cps == 2 || Cps1Qs == 1) { - CheatSearchInitCallbackFunction = CpsQSoundCheatSearchCallback; - } - - return 0; -} - -INT32 CpsRunExit() -{ - if (Cps == 2 || PangEEP || Cps1Qs == 1 || CpsBootlegEEPROM) EEPROMExit(); - - // Sound exit - if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) QsndExit(); - if (Cps != 2 && Cps1Qs == 0 && !Cps1DisablePSnd) PsndExit(); - - // Graphics exit - CpsObjExit(); - CpsPalExit(); - - // Sprite Masking exit - ZBuf = NULL; - - // Memory exit - CpsRwExit(); - CpsMemExit(); - - SekExit(); - - if (CpsRunExitCallbackFunction) { - CpsRunExitCallbackFunction(); - CpsRunExitCallbackFunction = NULL; - } - CpsRunInitCallbackFunction = NULL; - CpsRunResetCallbackFunction = NULL; - CpsRunFrameStartCallbackFunction = NULL; - CpsRunFrameMiddleCallbackFunction = NULL; - CpsRunFrameEndCallbackFunction = NULL; - - Cps1VBlankIRQLine = 2; - - Cps2DisableQSnd = 0; - CpsBootlegEEPROM = 0; - - return 0; -} - -inline static void CopyCpsReg(INT32 i) -{ - memcpy(CpsSaveReg[i], CpsReg, 0x0100); -} - -inline static void CopyCpsFrg(INT32 i) -{ - memcpy(CpsSaveFrg[i], CpsFrg, 0x0010); -} - -// Schedule a beam-synchronized interrupt -static void ScheduleIRQ() -{ - INT32 nLine = nCpsNumScanlines; - - if (nIrqLine50 <= nLine) { - nLine = nIrqLine50; - } - if (nIrqLine52 < nLine) { - nLine = nIrqLine52; - } - - if (nLine < nCpsNumScanlines) { - nIrqLine = nLine; - nIrqCycles = (nLine * nCpsCycles / nCpsNumScanlines) + 1; - } else { - nIrqCycles = nCpsCycles + 1; - } - - return; -} - -// Execute a beam-synchronised interrupt and schedule the next one -static void DoIRQ() -{ - // 0x4E - bit 9 = 1: Beam Synchronized interrupts disabled - // 0x50 - Beam synchronized interrupt #1 occurs at raster line. - // 0x52 - Beam synchronized interrupt #2 occurs at raster line. - - // Trigger IRQ and copy registers. - if (nIrqLine >= nFirstLine) { - - nInterrupt++; - nRasterline[nInterrupt] = nIrqLine - nFirstLine; - } - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekRun(nCpsCycles * 0x01 / nCpsNumScanlines); - if (nRasterline[nInterrupt] < 224) { - CopyCpsReg(nInterrupt); - CopyCpsFrg(nInterrupt); - } else { - nRasterline[nInterrupt] = 0; - } - - // Schedule next interrupt - if (!bEnableAutoIrq50) { - if (nIrqLine >= nIrqLine50) { - nIrqLine50 = nCpsNumScanlines; - } - } else { - if (bEnableAutoIrq50 && nIrqLine == nIrqLine50) { - nIrqLine50 += 32; - } - } - if (!bEnableAutoIrq52 && nIrqLine >= nIrqLine52) { - nIrqLine52 = nCpsNumScanlines; - } else { - if (bEnableAutoIrq52 && nIrqLine == nIrqLine52) { - nIrqLine52 += 32; - } - } - ScheduleIRQ(); - if (nIrqCycles < SekTotalCycles()) { - nIrqCycles = SekTotalCycles() + 1; - } - - return; -} - -INT32 Cps1Frame() -{ - INT32 nDisplayEnd, nNext, i; - - if (CpsReset) { - DrvReset(); - } - - SekNewFrame(); - if (Cps1Qs == 1) { - QsndNewFrame(); - } else { - if (!Cps1DisablePSnd) { - ZetOpen(0); - PsndNewFrame(); - } - } - - if (CpsRunFrameStartCallbackFunction) { - CpsRunFrameStartCallbackFunction(); - } - - nCpsCycles = (INT32)((INT64)nCPS68KClockspeed * nBurnCPUSpeedAdjust >> 8); - - CpsRwGetInp(); // Update the input port values - - nDisplayEnd = (nCpsCycles * (nFirstLine + 224)) / nCpsNumScanlines; // Account for VBlank - - SekOpen(0); - - SekRun((nCpsCycles * nFirstLine / nCpsNumScanlines) + nCpsCyclesExtra); // run 68K for the first few lines - - CpsObjGet(); // Get objects - - for (i = 0; i < 4; i++) { - nNext = ((i + 1) * nCpsCycles) >> 2; // find out next cycle count to run to - - if (i == 2 && CpsRunFrameMiddleCallbackFunction) { - CpsRunFrameMiddleCallbackFunction(); - } - - if (SekTotalCycles() < nDisplayEnd && nNext > nDisplayEnd) { - - SekRun(nNext - nDisplayEnd); // run 68K - - memcpy(CpsSaveReg[0], CpsReg, 0x100); // Registers correct now - - SekSetIRQLine(Cps1VBlankIRQLine, CPU_IRQSTATUS_AUTO); // Trigger VBlank interrupt - } - - SekRun(nNext - SekTotalCycles()); // run 68K - } - - if (pBurnDraw) { - CpsDraw(); // Draw frame - } - - if (Cps1Qs == 1) { - QsndEndFrame(); - } else { - if (!Cps1DisablePSnd) { - PsndSyncZ80(nCpsZ80Cycles); - PsmUpdate(nBurnSoundLen); - ZetClose(); - } - } - - if (CpsRunFrameEndCallbackFunction) { - CpsRunFrameEndCallbackFunction(); - } - - nCpsCyclesExtra = SekTotalCycles() - nCpsCycles; - - SekClose(); - - return 0; -} - -INT32 Cps2Frame() -{ - INT32 nDisplayEnd, nNext; // variables to keep track of executed 68K cyles - INT32 i; - - if (CpsReset) { - DrvReset(); - } - -// extern INT32 prevline; -// prevline = -1; - - SekNewFrame(); - if (!Cps2DisableQSnd) QsndNewFrame(); - - nCpsCycles = (INT32)(((INT64)nCPS68KClockspeed * nBurnCPUSpeedAdjust) / 0x0100); - SekOpen(0); - SekSetCyclesScanline(nCpsCycles / nCpsNumScanlines); - - CpsRwGetInp(); // Update the input port values - - // Check the volumes every 5 frames or so - if (GetCurrentFrame() % 5 == 0) { - if (Cps2VolUp) Cps2Volume++; - if (Cps2VolDwn) Cps2Volume--; - - if (Cps2Volume > 39) Cps2Volume = 39; - if (Cps2Volume < 0) Cps2Volume = 0; - - QscSetRoute(BURN_SND_QSND_OUTPUT_1, Cps2Volume / 39.0, BURN_SND_ROUTE_LEFT); - QscSetRoute(BURN_SND_QSND_OUTPUT_2, Cps2Volume / 39.0, BURN_SND_ROUTE_RIGHT); - } - - nDisplayEnd = nCpsCycles * (nFirstLine + 224) / nCpsNumScanlines; // Account for VBlank - - nInterrupt = 0; - for (i = 0; i < MAX_RASTER + 2; i++) { - nRasterline[i] = 0; - } - - // Determine which (if any) of the line counters generates the first IRQ - bEnableAutoIrq50 = bEnableAutoIrq52 = false; - nIrqLine50 = nIrqLine52 = nCpsNumScanlines; - if (BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x50))) & 0x8000) { - bEnableAutoIrq50 = true; - } - if (bEnableAutoIrq50 || (BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x4E))) & 0x0200) == 0) { - nIrqLine50 = (BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x50))) & 0x01FF); - } - if (BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x52))) & 0x8000) { - bEnableAutoIrq52 = true; - } - if (bEnableAutoIrq52 || (BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x4E))) & 0x0200) == 0) { - nIrqLine52 = (BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x52))) & 0x01FF); - } - ScheduleIRQ(); - - if (nIrqCycles < nCpsCycles * nFirstLine / nCpsNumScanlines) { - SekRun(nIrqCycles + nCpsCyclesExtra); - nCpsCyclesExtra = 0; - DoIRQ(); - } - nNext = nCpsCycles * nFirstLine / nCpsNumScanlines; - if (SekTotalCycles() < nNext) { - SekRun(nNext - SekTotalCycles()); - } - - CopyCpsReg(0); // Get inititial copy of registers - CopyCpsFrg(0); // - - if (nIrqLine >= nCpsNumScanlines && (BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x4E))) & 0x0200) == 0) { - nIrqLine50 = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x50))) & 0x01FF; - nIrqLine52 = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(CpsReg + 0x52))) & 0x01FF; - ScheduleIRQ(); - } - - for (i = 0; i < 3; i++) { - nNext = ((i + 1) * nDisplayEnd) / 3; // find out next cycle count to run to - - while (nNext > nIrqCycles && nInterrupt < MAX_RASTER) { - SekRun(nIrqCycles - SekTotalCycles()); - DoIRQ(); - } - SekRun(nNext - SekTotalCycles()); // run cpu - } - - CpsObjGet(); // Get objects - -// nCpsCyclesSegment[0] = (nCpsCycles * nVBlank) / nCpsNumScanlines; -// nDone += SekRun(nCpsCyclesSegment[0] - nDone); - - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); // VBlank - if (pBurnDraw) { - CpsDraw(); - } - SekRun(nCpsCycles - SekTotalCycles()); - - nCpsCyclesExtra = SekTotalCycles() - nCpsCycles; - - if (!Cps2DisableQSnd) QsndEndFrame(); - - SekClose(); - -// bprintf(PRINT_NORMAL, _T(" -\n")); - -#if 0 && defined FBA_DEBUG - if (nInterrupt) { - bprintf(PRINT_IMPORTANT, _T("Beam synchronized interrupt at line %2X.\r"), nRasterline[nInterrupt]); - } else { - bprintf(PRINT_NORMAL, _T("Beam synchronized interrupt disabled. \r")); - } - - extern INT32 counter; - if (counter) { - bprintf(PRINT_NORMAL, _T("\n\nSlices start at: ")); - for (i = 0; i < MAX_RASTER + 2; i++) { - bprintf(PRINT_NORMAL, _T("%2X "), nRasterline[i]); - } - bprintf(PRINT_NORMAL, _T("\n")); - for (i = 0; i < 0x80; i++) { - if (*((UINT16*)(CpsSaveReg[0] + i * 2)) != *((UINT16*)(CpsSaveReg[nInterrupt] + i * 2))) { - bprintf(PRINT_NORMAL, _T("Register %2X: %4X -> %4X\n"), i * 2, *((UINT16*)(CpsSaveReg[0] + i * 2)), *((UINT16*)(CpsSaveReg[nInterrupt] + i * 2))); - } - } - bprintf(PRINT_NORMAL, _T("\n")); - for (i = 0; i < 0x010; i++) { - if (CpsSaveFrg[0][i] != CpsSaveFrg[nInterrupt][i]) { - bprintf(PRINT_NORMAL, _T("FRG %X: %02X -> %02X\n"), i, CpsSaveFrg[0][i], CpsSaveFrg[nInterrupt][i]); - } - } - bprintf(PRINT_NORMAL, _T("\n")); - if (((CpsSaveFrg[0][4] << 8) | CpsSaveFrg[0][5]) != ((CpsSaveFrg[nInterrupt][4] << 8) | CpsSaveFrg[nInterrupt][5])) { - bprintf(PRINT_NORMAL, _T("Layer-sprite priority: %04X -> %04X\n"), ((CpsSaveFrg[0][4] << 8) | CpsSaveFrg[0][5]), ((CpsSaveFrg[nInterrupt][4] << 8) | CpsSaveFrg[nInterrupt][5])); - } - - bprintf(PRINT_NORMAL, _T("\n")); - for (INT32 j = 0; j <= nInterrupt; j++) { - if (j) { - bprintf(PRINT_NORMAL, _T("IRQ : %i (triggered at line %3i)\n\n"), j, nRasterline[j]); - } else { - bprintf(PRINT_NORMAL, _T("Initial register status\n\n")); - } - - for (i = 0; i < 0x080; i+= 8) { - bprintf(PRINT_NORMAL, _T("%2X: %4X %4X %4X %4X %4X %4X %4X %4X\n"), i * 2, *((UINT16*)(CpsSaveReg[j] + 0 + i * 2)), *((UINT16*)(CpsSaveReg[j] + 2 + i * 2)), *((UINT16*)(CpsSaveReg[j] + 4 + i * 2)), *((UINT16*)(CpsSaveReg[j] + 6 + i * 2)), *((UINT16*)(CpsSaveReg[j] + 8 + i * 2)), *((UINT16*)(CpsSaveReg[j] + 10 + i * 2)), *((UINT16*)(CpsSaveReg[j] + 12 + i * 2)), *((UINT16*)(CpsSaveReg[j] + 14 + i * 2))); - } - - bprintf(PRINT_NORMAL, _T("\nFRG: ")); - for (i = 0; i < 0x010; i++) { - bprintf(PRINT_NORMAL, _T("%02X "), CpsSaveFrg[j][i]); - } - bprintf(PRINT_NORMAL, _T("\n\n")); - - } - - extern INT32 bRunPause; - bRunPause = 1; - counter = 0; - } -#endif - - return 0; -} - diff --git a/jan/src/burn/drv/capcom/cps_rw.cpp b/jan/src/burn/drv/capcom/cps_rw.cpp deleted file mode 100644 index 1ad8bc8b4..000000000 --- a/jan/src/burn/drv/capcom/cps_rw.cpp +++ /dev/null @@ -1,627 +0,0 @@ -#include "cps.h" -// CPS - Read/Write - -// Input bits -#define INP(nnn) UINT8 CpsInp##nnn[8]; -CPSINPSET -#undef INP - -// Bytes to return from ports -#define INP(nnn) UINT8 Inp##nnn; -CPSINPSET -#undef INP - -UINT16 CpsInp055 = 0; -UINT16 CpsInp05d = 0; -UINT8 CpsDigUD[4] = {0, 0, 0, 0}; -UINT16 CpsInpPaddle1 = 0; -UINT16 CpsInpPaddle2 = 0; -static INT32 ReadPaddle = 0; -INT32 CpsPaddle1Value = 0; -INT32 CpsPaddle2Value = 0; -INT32 CpsPaddle1 = 0; -INT32 CpsPaddle2 = 0; -static INT32 nDial055, nDial05d; -UINT8 fFakeDip = 0; - -INT32 PangEEP = 0; -INT32 Forgottn = 0; -INT32 Cps1QsHack = 0; -INT32 Kodh = 0; -INT32 Cawingb = 0; -INT32 Wofh = 0; -INT32 Sf2thndr = 0; -INT32 Pzloop2 = 0; -INT32 Ssf2tb = 0; -INT32 Dinohunt = 0; -INT32 Port6SoundWrite = 0; -INT32 CpsBootlegEEPROM = 0; - -CpsRWSoundCommandCallback CpsRWSoundCommandCallbackFunction = NULL; - -static INT32 nCalc[2] = {0, 0}; - -static const bool nCPSExtraNVRAM = false; -static INT32 n664001; - -#define INP(nnnn) UINT8 CpsInp##nnnn[8]; -CPSINPEX -#undef INP - -#define INP(nnnn) static UINT8 Inp##nnnn; -CPSINPEX -#undef INP - - -// Read input port 0x000-0x1ff -static UINT8 CpsReadPort(const UINT32 ia) -{ - UINT8 d = 0xFF; - - if (ia == 0x000) { - d = (UINT8)~Inp000; - if (Pzloop2) { - if (ReadPaddle) { - d -= CpsPaddle2Value; - } else { - d = CpsPaddle2; - } - } - return d; - } - if (ia == 0x001) { - d = (UINT8)~Inp001; - if (Pzloop2) { - if (ReadPaddle) { - d -= CpsPaddle1Value; - } else { - d = CpsPaddle1; - } - } - return d; - } - if (ia == 0x010) { - d = (UINT8)~Inp010; - return d; - } - if (ia == 0x011) { - d = (UINT8)~Inp011; - return d; - } - if (ia == 0x012) { - d = (UINT8)~Inp012; - return d; - } - if (ia == 0x018) { - d = (UINT8)~Inp018; - return d; - } - if (ia == 0x019) { - d = (UINT8)~Inp019; - return d; - } - if (ia == 0x01B) { - d = (UINT8)~Inp01B; - return d; - } - - if (ia == 0x01A) { - d = (UINT8)~Cpi01A; - return d; - } - if (ia == 0x01C) { - d = (UINT8)~Cpi01C; - return d; - } - if (ia == 0x01E) { - d = (UINT8)~Cpi01E; - return d; - } - - if (Cps == 2) { - // Used on CPS2 only I think - if (ia == 0x020) { - d = (UINT8)~Inp020; - return d; - } - if (ia == 0x021) { - d = (UINT8)~Inp021; - d &= 0xFE; - d |= EEPROMRead(); - return d; - } - - // CPS2 Volume control - if (ia == 0x030) { - if (Ssf2tb) { - d = 0x20; - } else { - d = Cps2VolumeStates[Cps2Volume] >> 8; - if (Cps2DisableDigitalVolume) d = 0xd0; - } - return d; - } - if (ia == 0x031) { - d = Cps2VolumeStates[Cps2Volume] & 0xff; - return d; - } - - if (ia >= 0x0100 && ia < 0x0200) { - static INT32 nRasterLine; - -// bprintf(PRINT_NORMAL, _T(" - port 0x%02X (%3i)\n"), ia & 255, SekCurrentScanline()); - - // The linecounters seem to return the line at which the last IRQ triggered by this counter is scheduled minus the current line - if ((ia & 0x0FE) == 0x50) { - if ((ia & 1) == 0) { - nRasterLine = nIrqLine50 - SekCurrentScanline(); - return nRasterLine >> 8; - } else { - return nRasterLine & 0xFF; - } - } - if ((ia & 0x0FE) == 0x52) { - if ((ia & 1) == 0) { - nRasterLine = nIrqLine52 - SekCurrentScanline(); - return nRasterLine >> 8; - } else { - return nRasterLine & 0xFF; - } - } - - } - } else { - // Board ID - if (ia == 0x100 + CpsBID[0]) { - d = (UINT8)CpsBID[1]; - return d; - } - if (ia == 0x100 + (CpsBID[0] + 1)) { - d = (UINT8)CpsBID[2]; - return d; - } - - if (Sf2thndr) { - // this reads the B-ID from here on startup as well as the normal location in-game - if (ia == 0x1c8) { - d = (UINT8)CpsBID[1]; - return d; - } - - if (ia == 0x1c9) { - d = (UINT8)CpsBID[2]; - return d; - } - } - - // CPS1 EEPROM read - if (ia == 0xC007) { - if (Cps1Qs || CpsBootlegEEPROM) { - return EEPROMRead(); - } else { - return 0; - } - } - - // Pang3 EEPROM - if (PangEEP == 1) { - if (ia == 0x17B) { - return EEPROMRead(); - } - } - - // Extra Input ports (move from game-to-game) - if (ia == 0x006) { - d = (UINT8)~Inp006; - return d; - } - if (ia == 0x007) { - d = (UINT8)~Inp007; - return d; - } - if (ia == 0x008) { - d = (UINT8)~Inp008; - return d; - } - if (ia == 0x029) { - d = (UINT8)~Inp029; - return d; - } - if (ia == 0x176) { - d = (UINT8)~Inp176; - return d; - } - if (ia == 0x177) { - d = (UINT8)~Inp177; - return d; - } - if (ia == 0x179) { - d = (UINT8)~Inp179; - return d; - } - if (ia == 0x186) { - d = (UINT8)~Inp186; - return d; - } - if (ia == 0x1fd) { - d = (UINT8)~Inp1fd; - return d; - } - if (ia == 0xC000) { - d = (UINT8)~Inpc000; - return d; - } - if (ia == 0xC001) { - d = (UINT8)~Inpc001; - return d; - } - if (ia == 0xC002) { - d = (UINT8)~Inpc002; - return d; - } - if (ia == 0xC003) { - d = (UINT8)~Inpc003; - return d; - } - - // Forgotten Worlds Dial - if (Forgottn) { - if (ia == 0x053) { - return (nDial055 >> 8) & 0xFF; - } - if (ia == 0x055) { - return (nDial055 >> 16) & 0xFF; - } - if (ia == 0x05B) { - return (nDial05d >> 8) & 0xFF; - } - if (ia == 0x05D) { - return (nDial05d >> 16) & 0xFF; - } - } - } - -// bprintf(PRINT_NORMAL, _T("Read Port %x\n"), ia); - - return d; -} - -// Write output port 0x000-0x1ff -void CpsWritePort(const UINT32 ia, UINT8 d) -{ - if ((Cps & 1) && Cps1Qs == 0) { - if (!Cps1DisablePSnd) { - // CPS1 sound code - if (ia == 0x181 || (Port6SoundWrite && (ia == 0x006 || ia == 0x007))) { - PsndSyncZ80((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles); - - PsndCode = d; - return; - } - - // CPS1 sound fade - if (ia == 0x189) { - PsndSyncZ80((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles); - - PsndFade = d; - return; - } - } else { - if (ia == 0x181 || (Port6SoundWrite && (ia == 0x006 || ia == 0x007))) { - if (CpsRWSoundCommandCallbackFunction) { - CpsRWSoundCommandCallbackFunction(d); - } - } - } - - if (ia == 0x041) { - nDial055 = 0; - } - if (ia == 0x049) { - nDial05d = 0; - } - } - - if (Cps == 1 && Cps1QsHack == 1) { - if (ia == 0x181) { - // Pass the Sound Code to the Q-Sound Shared Ram - CpsZRamC0[0x001] = d; - } - } - - // CPS registers - if (ia >= 0x100 && ia < 0x200) { - //Pang3 EEPROM - if (PangEEP == 1 && ia == 0x17B) { - EEPROMWrite(d & 0x40, d & 0x80, d & 0x01); - return; - } - CpsReg[(ia ^ 1) & 0xFF] = d; - - if (ia == 0x10b) { - GetPalette(0, 6); - CpsPalUpdate(CpsSavePal); - } - return; - } - - if (Cps == 2) { - if (ia == 0x40) { - EEPROMWrite(d & 0x20, d& 0x40, d & 0x10); - return; - } - - // CPS2 object bank select - if ((ia & 0x1FF) == 0x0E1) { -// bprintf(PRINT_NORMAL, _T(" - %2i (%3i)\n"), d & 1, SekCurrentScanline()); -// CpsObjGet(); - CpsMapObjectBanks(d & 1); - return; - } - - if (ia == 0x41 && Pzloop2) { - ReadPaddle = d & 0x02; - } - } - - if (Cps1Qs == 1 || CpsBootlegEEPROM) { - //CPS1 EEPROM write - if (ia == 0xc007) { - EEPROMWrite(d & 0x40, d & 0x80, d & 0x01); - return; - } - } - -// bprintf(PRINT_NORMAL, _T("Write Port %x, %x\n"), ia, d); -} - -UINT8 __fastcall CpsReadByte(UINT32 a) -{ - // Input ports mirrored between 0x800000 and 0x807fff - if ((a & 0xFF8000) == 0x800000) { - return CpsReadPort(a & 0x1FF); - } - - if (Cps == 2) { - if ((a & 0xFF8000) == 0x660000) { - if (a == 0x664001) { - return n664001; - } - } - - return 0x00; - } - - if (a >= 0xF1C000 && a <= 0xF1C007) { - return CpsReadPort(a & 0xC00F); - } - - if (Dinohunt && a == 0xfc0001) return (UINT8)~Inpc001; - -// bprintf(PRINT_NORMAL, _T("Read Byte %x\n"), a); - - return 0x00; -} - -void __fastcall CpsWriteByte(UINT32 a,UINT8 d) -{ - // Output ports mirrored between 0x800000 and 0x807fff - if ((a & 0xFF8000) == 0x800000) { - CpsWritePort(a & 0x1FF, d); - return; - } - - if (Cps == 2) { - // 0x400000 registers - if ((a & 0xFFFFF0) == 0x400000) { - CpsFrg[a & 0x0F] = d; - return; - } - if ((a & 0xFF8000) == 0x660000) { - if (a == 0x664001) { - // bit 1 toggled on/off each frame - n664001 = d; - } - - return; - } - - return; - } - - if (Cps1Qs == 1 || CpsBootlegEEPROM) { - // CPS1 EEPROM - if (a == 0xf1c007) { - CpsWritePort(a & 0xC00F, d); - return; - } - } - -// bprintf(PRINT_NORMAL, _T("Write Byte %x, %x\n"), a, d); -} - -UINT16 __fastcall CpsReadWord(UINT32 a) -{ - if ((a & 0xFF8FFF) == 0x800100 + CpsMProt[3]) { - return (UINT16)((nCalc[0] * nCalc[1]) >> 16); - } - // ports mirrored between 0x800000 and 0x807fff - if ((a & 0xFF8FFF) == 0x800100 + CpsMProt[2]) { - return (UINT16)((nCalc[0] * nCalc[1])); - } - -// bprintf(PRINT_NORMAL, _T("Read Word %x\n"), a); - - SEK_DEF_READ_WORD(0, a); -} - -void __fastcall CpsWriteWord(UINT32 a, UINT16 d) -{ - // ports mirrored between 0x800000 and 0x807fff - if ((a & 0xFF8FFF) == 0x800100 + CpsMProt[0]) - nCalc[0] = d; - if ((a & 0xFF8FFF) == 0x800100 + CpsMProt[1]) - nCalc[1] = d; - - if (a == 0x804040) { - if ((d & 0x0008) == 0) { - if (!Cps2DisableQSnd) ZetReset(); - } - } - -// bprintf(PRINT_NORMAL, _T("Write Word %x, %x\n"), a, d); - - SEK_DEF_WRITE_WORD(0, a, d); -} - -// Reset all inputs to zero -static INT32 InpBlank() -{ -#define INP(nnn) Inp##nnn = 0; memset(CpsInp##nnn, 0, sizeof(CpsInp##nnn)); - CPSINPSET -#undef INP - -#define INP(nnnn) Inp##nnnn = 0; memset(CpsInp##nnnn, 0, sizeof(CpsInp##nnnn)); - CPSINPEX -#undef INP - - CpsInp055 = CpsInp05d = 0; - memset(CpsDigUD, 0, sizeof(CpsDigUD)); - - return 0; -} - -INT32 CpsRwInit() -{ - InpBlank(); - return 0; -} - -INT32 CpsRwExit() -{ - InpBlank(); - CpsRWSoundCommandCallbackFunction = NULL; - return 0; -} - -inline static void StopOpposite(UINT8* pInput) -{ - if ((*pInput & 0x03) == 0x03) { - *pInput &= ~0x03; - } - if ((*pInput & 0x0C) == 0x0C) { - *pInput &= ~0x0C; - } -} - -INT32 CpsRwGetInp() -{ - // Compile separate buttons into Inpxxx -#define INP(nnn) \ - { INT32 i = 0; Inp##nnn = 0; \ - for (i = 0; i < 8; i++) { Inp##nnn |= (CpsInp##nnn[i] & 1) << i; } } - CPSINPSET -#undef INP - - -#define INP(nnnn) \ - { INT32 i = 0; Inp##nnnn = 0; \ - for (i = 0; i < 8; i++) { Inp##nnnn |= (CpsInp##nnnn[i] & 1) << i; } } - CPSINPEX -#undef INP - - if (Forgottn) { - // Handle analog controls - if (fFakeDip & 0x80) { - if (CpsDigUD[0]) nDial055 += 4080; // p1 - if (CpsDigUD[1]) nDial055 -= 4080; - if (CpsDigUD[2]) nDial05d += 4080; // p2 - if (CpsDigUD[3]) nDial05d -= 4080; - nDial055 += (INT32)((INT16)CpsInp055) * 4; - nDial05d += (INT32)((INT16)CpsInp05d) * 4; - } else { - if (CpsDigUD[0]) nDial055 -= 4080; // p1 - if (CpsDigUD[1]) nDial055 += 4080; - if (CpsDigUD[2]) nDial05d -= 4080; // p2 - if (CpsDigUD[3]) nDial05d += 4080; - nDial055 -= (INT32)((INT16)CpsInp055) * 4; - nDial05d -= (INT32)((INT16)CpsInp05d) * 4; - } - } - - if (Pzloop2) { - if (ReadPaddle) { - CpsPaddle1Value = 0; - CpsPaddle2Value = 0; - if (CpsInpPaddle1) { - if (CpsInpPaddle1 > 0x8000) { - CpsPaddle1Value = 2; - } - - if (CpsInpPaddle1 < 0x7fff) { - CpsPaddle1Value = 1; - } - } - - if (CpsInpPaddle2) { - if (CpsInpPaddle2 > 0x8000) { - CpsPaddle2Value = 2; - } - - if (CpsInpPaddle2 < 0x7fff) { - CpsPaddle2Value = 1; - } - } - } - - CpsPaddle1 += (CpsInpPaddle1 >> 8) & 0xff; - CpsPaddle2 += (CpsInpPaddle2 >> 8) & 0xff; - } - - StopOpposite(&Inp000); - StopOpposite(&Inp001); - - // Ghouls uses a 4-way stick - if (Ghouls) { - static UINT8 nPrevInp000, nPrevInp001; - - if ((Inp000 & 0x03) && (Inp000 & 0x0C)) { - Inp000 ^= (nPrevInp000 & 0x0F); - } else { - nPrevInp000 = Inp000; - } - - if ((Inp001 & 0x03) && (Inp001 & 0x0C)) { - Inp001 ^= (nPrevInp001 & 0x0F); - } else { - nPrevInp001 = Inp001; - } - } - - if (nMaxPlayers > 2) { - if (Cps == 2) { - StopOpposite(&Inp011); - if (nMaxPlayers == 4) { - StopOpposite(&Inp010); - } - } else { - StopOpposite(&Inp177); - if (nMaxPlayers == 4) { - StopOpposite(&Inp179); - } - if (Cps1Qs) { - StopOpposite(&Inpc001); - if (nMaxPlayers == 4) { - StopOpposite(&Inpc003); - } - } - } - } - - return 0; -} - -void CpsSoundCmd(UINT16 sound_code) { -// CpsWritePort(0x181, sound_code); - PsndCode = sound_code; -} diff --git a/jan/src/burn/drv/capcom/cps_scr.cpp b/jan/src/burn/drv/capcom/cps_scr.cpp deleted file mode 100644 index 881f07b57..000000000 --- a/jan/src/burn/drv/capcom/cps_scr.cpp +++ /dev/null @@ -1,262 +0,0 @@ -#include "cps.h" - -// CPS Scroll (Background Layers) - -// Base = 0x4000 long tile map -// sx=Scroll X value, sy=Scroll Y value, -INT32 Ghouls=0; -INT32 Ssf2t=0; -INT32 Xmcota=0; - -INT32 Scroll1TileMask = 0; -INT32 Scroll2TileMask = 0; -INT32 Scroll3TileMask = 0; - -INT32 Cps1Scr1Draw(UINT8 *Base,INT32 sx,INT32 sy) -{ - INT32 x,y; - INT32 ix,iy; - INT32 nKnowBlank=-1; // The tile we know is blank - - ix=(sx>>3)+1; iy=(sy>>3)+1; - sx&=7; sy&=7; sx=8-sx; sy=8-sy; - - for (y=-1; y<28; y++) - { - for (x=-1; x<48; x++) - { - INT32 t,a; - UINT16 *pst; - INT32 fx,fy,p; - fx=ix+x; fy=iy+y; // fx/fy= 0 to 63 - - // Find tile address - p=((fy&0x20)<<8) | ((fx&0x3f)<<7) | ((fy&0x1f)<<2); - p&=0x3fff; - pst=(UINT16 *)(Base + p); - - t = BURN_ENDIAN_SWAP_INT16(pst[0]); - - if (Scroll1TileMask) t &= Scroll1TileMask; - - t = GfxRomBankMapper(GFXTYPE_SCROLL1, t); - if (t == -1) continue; - - t<<=6; // Get real tile address - - t+=nCpsGfxScroll[1]; // add on offset to scroll tiles - if (t==nKnowBlank) continue; // Don't draw: we know it's blank - - a = BURN_ENDIAN_SWAP_INT16(pst[1]); - - CpstSetPal(0x20 | (a&0x1f)); - - // Don't need to clip except around the border - if (x<0 || x>=48-1 || y<0 || y>=28-1) - nCpstType=CTT_8X8 | CTT_CARE; - else - nCpstType=CTT_8X8; - - nCpstX=sx+(x<<3); nCpstY=sy+(y<<3); - nCpstTile=t; nCpstFlip=(a>>5)&3; - - if (nBgHi) { - CpstPmsk = BURN_ENDIAN_SWAP_INT16(*(UINT16*)(CpsSaveReg[0] + MaskAddr[(a & 0x180) >> 7])); - } - - if(CpstOneDoX[nBgHi]()) nKnowBlank=t; - - } - } - - return 0; -} - -INT32 Cps2Scr1Draw(UINT8 *Base, INT32 sx, INT32 sy) -{ - INT32 x, y; - INT32 ix, iy; - INT32 nFirstY, nLastY; - INT32 nKnowBlank = -1; // The tile we know is blank - - ix = (sx >> 3) + 1; - sx &= 7; - sx = 8 - sx; - - iy = (sy >> 3) + 1; - sy &= 7; - - nLastY = (nEndline + sy) >> 3; - nFirstY = (nStartline + sy) >> 3; - - sy = 8 - sy; - - for (y = nFirstY - 1; y < nLastY; y++) { - INT32 nClipY = ((y << 3) < nStartline) | (((y << 3) + 8) >= nEndline); - for (x = -1; x < 48; x++) { - INT32 t, a; - UINT16 *pst; - INT32 fx, fy, p; - fx = ix + x; - fy = iy + y; // 0 <= fx/fy <= 63 - - // Find tile address - p = ((fy & 0x20) << 8) | ((fx & 0x3F) << 7) | ((fy & 0x1F) << 2); - p &= 0x3FFF; - pst = (UINT16 *)(Base + p); - - t = BURN_ENDIAN_SWAP_INT16(pst[0]); - t <<= 6; // Get real tile address - - t += nCpsGfxScroll[1]; // add on offset to scroll tiles - - if (t != nKnowBlank) { // Draw tile - a = BURN_ENDIAN_SWAP_INT16(pst[1]); - - CpstSetPal(0x20 | (a & 0x1F)); - - nCpstX = sx + (x << 3); - nCpstY = sy + (y << 3); - nCpstTile = t; - nCpstFlip = (a >> 5) & 3; - - // Don't need to clip except around the border - if (x < 0 || x >= 48 - 1 || nClipY) { - nCpstType = CTT_8X8 | CTT_CARE; - } else { - nCpstType = CTT_8X8; - } - - if (CpstOneDoX[2]()) { - nKnowBlank = t; - } - } - } - } - return 0; -} - -INT32 Cps1Scr3Draw(UINT8 *Base,INT32 sx,INT32 sy) -{ - INT32 x,y; - INT32 ix,iy; - INT32 nKnowBlank=-1; // The tile we know is blank - ix=(sx>>5)+1; iy=(sy>>5)+1; - sx&=31; sy&=31; sx=32-sx; sy=32-sy; - - for (y=-1; y<7; y++) - { - for (x=-1; x<12; x++) - { - INT32 t,a; - UINT16 *pst; - INT32 fx,fy,p; - fx=ix+x; fy=iy+y; // fx/fy= 0 to 63 - - // Find tile address - p=((fy&0x38)<<8) | ((fx&0x3f)<<5) | ((fy&0x07)<<2); - p&=0x3fff; - pst=(UINT16 *)(Base + p); - - t = BURN_ENDIAN_SWAP_INT16(pst[0]); - - if (Scroll3TileMask) t &= Scroll3TileMask; - - t = GfxRomBankMapper(GFXTYPE_SCROLL3, t); - if (t == -1) continue; - - t<<=9; // Get real tile address - t+=nCpsGfxScroll[3]; // add on offset to scroll tiles - - if (t==nKnowBlank) continue; // Don't draw: we know it's blank - - a = BURN_ENDIAN_SWAP_INT16(pst[1]); - - CpstSetPal(0x60 | (a&0x1f)); - - // Don't need to clip except around the border - if (x<0 || x>=12-1 || y<0 || y>=7-1) - nCpstType=CTT_32X32 | CTT_CARE; - else - nCpstType=CTT_32X32; - - nCpstX=sx+(x<<5); nCpstY=sy+(y<<5); - nCpstTile=t; nCpstFlip=(a>>5)&3; - - if (nBgHi) { - CpstPmsk = BURN_ENDIAN_SWAP_INT16(*(UINT16*)(CpsSaveReg[0] + MaskAddr[(a & 0x180) >> 7])); - } - - if(CpstOneDoX[nBgHi]()) nKnowBlank=t; - } - } - - return 0; -} - -INT32 Cps2Scr3Draw(UINT8 *Base, INT32 sx, INT32 sy) -{ - INT32 x, y; - INT32 ix, iy; - INT32 nFirstY, nLastY; - INT32 nKnowBlank = -1; // The tile we know is blank - - ix = (sx >> 5) + 1; - sx &= 31; - sx = 32 - sx; - - iy = (sy >> 5) + 1; - sy &= 31; - - nLastY = (nEndline + sy) >> 5; - nFirstY = (nStartline + sy) >> 5; - - sy = 32 - sy; - - for (y = nFirstY - 1; y < nLastY; y++) { - INT32 nClipY = ((y << 5) < nStartline) | (((y << 5) + 32) >= nEndline); - for (x = -1; x < 12; x++) { - INT32 t, a; - UINT16 *pst; - INT32 fx, fy, p; - fx = ix + x; - fy = iy + y; // 0 <= fx/fy <= 63 - - // Find tile address - p = ((fy & 0x38) << 8) | ((fx & 0x3F) << 5) | ((fy & 0x07) << 2); - p &= 0x3FFF; - pst = (UINT16 *)(Base + p); - - t = BURN_ENDIAN_SWAP_INT16(pst[0]); - - if(Xmcota && t>=0x5800) t-=0x4000; - else if(Ssf2t && t<0x5600) t+=0x4000; - t <<= 9; // Get real tile address - t += nCpsGfxScroll[3]; // add on offset to scroll tiles - - if (t != nKnowBlank) { // Draw tile - a = BURN_ENDIAN_SWAP_INT16(pst[1]); - - CpstSetPal(0x60 | (a & 0x1F)); - - nCpstX = sx + (x << 5); - nCpstY = sy + (y << 5); - nCpstTile = t; - nCpstFlip = (a >> 5) & 3; - - // Don't need to clip except around the border - if (x < 0 || x >= 12 - 1 || nClipY) { - nCpstType = CTT_32X32 | CTT_CARE; - } else { - nCpstType = CTT_32X32; - } - - if (CpstOneDoX[2]()) { - nKnowBlank = t; - } - } - } - } - return 0; -} - diff --git a/jan/src/burn/drv/capcom/cpsr.cpp b/jan/src/burn/drv/capcom/cpsr.cpp deleted file mode 100644 index 4406b84a7..000000000 --- a/jan/src/burn/drv/capcom/cpsr.cpp +++ /dev/null @@ -1,199 +0,0 @@ -#include "cps.h" - -// CPS Scroll2 with Row scroll support - -UINT8 *CpsrBase=NULL; // Tile data base -INT32 nCpsrScrX=0,nCpsrScrY=0; // Basic scroll info -UINT16 *CpsrRows=NULL; // Row scroll table, 0x400 words long -int nCpsrRowStart=0; // Start of row scroll (can wrap?) -static INT32 nShiftY=0; -static INT32 EndLineInfo=0; - -struct CpsrLineInfo CpsrLineInfo[15]; - -static void GetRowsRange(INT32 *pnStart,INT32 *pnWidth,INT32 nRowFrom,INT32 nRowTo) -{ - INT32 i,nStart,nWidth; - - // Get the range of scroll values within nRowCount rows - // Start with zero range - nStart = BURN_ENDIAN_SWAP_INT16(CpsrRows[nRowFrom&0x3ff]); nStart&=0x3ff; nWidth=0; - for (i=nRowFrom;i=0) - { - // On the right - if (nDiff>=nWidth) nWidth=nDiff; // expand width to cover it - } - else - { - // On the left - nStart+=nDiff; nStart&=0x3ff; - nWidth-=nDiff; // expand width to cover it - } - } - - if (nWidth>0x400) nWidth=0x400; - - *pnStart=nStart; - *pnWidth=nWidth; -} - - -static INT32 PrepareRows() -{ - INT32 y; INT32 r; - struct CpsrLineInfo *pli; - // Calculate the amount of pixels to shift each - // row of the tile lines, assuming we draw tile x at - // (x-pli->nTileStart)<<4 - i.e. 0, 16, ... - - r=nShiftY-16; - for (y = -1, pli = CpsrLineInfo; y < EndLineInfo; y++, pli++) - { - // Maximum row scroll left and right on this line - INT32 nMaxLeft=0,nMaxRight=0; - INT32 ty; INT16 *pr; - - if (CpsrRows==NULL) - { - // No row shift - all the same - INT32 v; - v =(pli->nTileStart<<4)-nCpsrScrX; - nMaxLeft=v; nMaxRight=v; - for (ty=0,pr=pli->Rows; ty<16; ty++,pr++) - { - *pr=(INT16)v; - } - } - else - { - for (ty=0,pr=pli->Rows; ty<16; ty++,pr++,r++) - { - // Get the row offset, if it's in range - if (r>=0 && rnTileStart<<4)-nCpsrScrX; - v -= BURN_ENDIAN_SWAP_INT16(CpsrRows[(nCpsrRowStart+r)&0x3ff]); - // clip to 10-bit signed - v+=0x200; v&=0x3ff; v-=0x200; - *pr=(INT16)v; - if (vnMaxRight) nMaxRight=v; - } - else - { - *pr=0; - } - } - } - - pli->nMaxLeft =nMaxLeft; - pli->nMaxRight=nMaxRight; - } - - return 0; -} - -// Prepare to draw Scroll 2 with rows, by seeing how much -// row scroll each tile line uses (pli->nStart/nWidth), -// and finding which tiles are visible onscreen (pli->nTileStart/End). - -INT32 Cps1rPrepare() -{ - INT32 y; struct CpsrLineInfo *pli; - if (CpsrBase==NULL) return 1; - - nEndline = 224; - EndLineInfo = 14; - nShiftY=16-(nCpsrScrY&15); - - for (y=-1,pli=CpsrLineInfo; y224) nRowTo=224; - - // Shift by row table start offset - nRowFrom+=nCpsrRowStart; - nRowTo +=nCpsrRowStart; - - // Find out what range of scroll values there are for this line - GetRowsRange(&nStart,&nWidth,nRowFrom,nRowTo); - } - - nStart+=nCpsrScrX; - nStart&=0x3ff; - - // Save info in CpsrLineInfo table - pli->nStart=nStart; - pli->nWidth=nWidth; - // Find range of tiles to draw to see whole width: - pli->nTileStart=nStart>>4; - pli->nTileEnd=(nStart+nWidth+0x18f)>>4; - } - - PrepareRows(); - return 0; -} - -INT32 Cps2rPrepare() -{ - INT32 y; - struct CpsrLineInfo *pli; - if (CpsrBase==NULL) return 1; - - EndLineInfo = ((nEndline + 15) >> 4); - - nShiftY=16-(nCpsrScrY&15); - for (y = -1, pli = CpsrLineInfo; y < EndLineInfo; y++, pli++) - { - INT32 nStart=0,nWidth=0; - - if (CpsrRows!=NULL) - { - INT32 nRowFrom,nRowTo; - // Find out which rows we need to check - nRowFrom=(y<<4)+nShiftY; - nRowTo=nRowFrom+16; - if (nRowFrom < 0) nRowFrom = 0; - if (nRowTo > nEndline) nRowTo = nEndline; - - // Shift by row table start offset - nRowFrom+=nCpsrRowStart; - nRowTo +=nCpsrRowStart; - - // Find out what range of scroll values there are for this line - GetRowsRange(&nStart,&nWidth,nRowFrom,nRowTo); - } - - nStart+=nCpsrScrX; - nStart&=0x3ff; - - // Save info in CpsrLineInfo table - pli->nStart=nStart; - pli->nWidth=nWidth; - // Find range of tiles to draw to see whole width: - pli->nTileStart=nStart>>4; - pli->nTileEnd=(nStart+nWidth+0x18f)>>4; - } - - PrepareRows(); - return 0; -} - diff --git a/jan/src/burn/drv/capcom/cpsrd.cpp b/jan/src/burn/drv/capcom/cpsrd.cpp deleted file mode 100644 index 4598db76e..000000000 --- a/jan/src/burn/drv/capcom/cpsrd.cpp +++ /dev/null @@ -1,235 +0,0 @@ -#include "cps.h" - -// CPS Scroll2 with Row scroll - Draw -static INT32 nKnowBlank=-1; // The tile we know is blank -static INT32 nFirstY, nLastY; -static INT32 bVCare; - -inline static UINT16 *FindTile(INT32 fx,INT32 fy) -{ - INT32 p; UINT16 *pst; - // Find tile address - p=((fy&0x30)<<8) | ((fx&0x3f)<<6) | ((fy&0x0f)<<2); - pst=(UINT16 *)(CpsrBase + p); - return pst; -} - -// Draw a tile line without Row Shift -static void Cps1TileLine(INT32 y,INT32 sx) -{ - INT32 x,ix,iy,sy; - - bVCare=0; - if (y<0 || y>=14-1) bVCare=1; // Take care on the edges - - ix=(sx>>4)+1; sx&=15; sx=16-sx; - sy=16-(nCpsrScrY&15); iy=(nCpsrScrY>>4)+1; - nCpstY=sy+(y<<4); - - for (x=-1; x<24; x++) - { - UINT16 *pst; INT32 t,a; - // Don't need to clip except around the border - if (bVCare || x<0 || x>=24-1) nCpstType=CTT_16X16 | CTT_CARE; - else nCpstType=CTT_16X16; - - pst=FindTile(ix+x,iy+y); - t = BURN_ENDIAN_SWAP_INT16(pst[0]); - - if (Scroll2TileMask) t &= Scroll2TileMask; - - t = GfxRomBankMapper(GFXTYPE_SCROLL2, t); - if (t == -1) continue; - - t<<=7; // Get real tile address - t+=nCpsGfxScroll[2]; // add on offset to scroll tile - if (t==nKnowBlank) continue; // Don't draw: we know it's blank - - a = BURN_ENDIAN_SWAP_INT16(pst[1]); - - CpstSetPal(0x40 | (a&0x1f)); - nCpstX=sx+(x<<4); nCpstTile=t; nCpstFlip=(a>>5)&3; - - if(nBgHi) CpstPmsk = BURN_ENDIAN_SWAP_INT16(*(UINT16 *)(CpsSaveReg[0] + MaskAddr[(a&0x180)>>7])); - if(CpstOneDoX[nBgHi]()) nKnowBlank=t; - } -} - -static void Cps2TileLine(INT32 y,INT32 sx) -{ - INT32 x,ix,iy,sy; - - ix=(sx>>4)+1; sx&=15; sx=16-sx; - sy=16-(nCpsrScrY&15); iy=(nCpsrScrY>>4)+1; - nCpstY=sy+(y<<4); - - for (x=-1; x<24; x++) - { - UINT16 *pst; INT32 t,a; - // Don't need to clip except around the border - if (bVCare || x<0 || x>=24-1) nCpstType=CTT_16X16 | CTT_CARE; - else nCpstType=CTT_16X16; - - pst=FindTile(ix+x,iy+y); - t = BURN_ENDIAN_SWAP_INT16(pst[0]); - t<<=7; // Get real tile address - t+=nCpsGfxScroll[2]; // add on offset to scroll tiles - if (t==nKnowBlank) continue; // Don't draw: we know it's blank - a = BURN_ENDIAN_SWAP_INT16(pst[1]); - - CpstSetPal(0x40 | (a&0x1f)); - nCpstX=sx+(x<<4); nCpstTile=t; nCpstFlip=(a>>5)&3; - if(CpstOneDoX[2]()) nKnowBlank=t; - } -} - -// Draw a tile line with Row Shift -static void Cps1TileLineRows(INT32 y,struct CpsrLineInfo *pli) -{ - INT32 sy,iy,x; - INT32 nTileCount; - INT32 nLimLeft,nLimRight; - - bVCare=0; - if (y<0 || y>=14-1) bVCare=1; // Take care on the edges - - nTileCount=pli->nTileEnd-pli->nTileStart; - - sy=16-(nCpsrScrY&15); iy=(nCpsrScrY>>4)+1; - nCpstY=sy+(y<<4); - CpstRowShift=pli->Rows; - - // If these rowshift limits go off the edges, we should take - // care drawing the tile. - nLimLeft =pli->nMaxLeft; - nLimRight=pli->nMaxRight; - for (x=0; xnTileStart+x; - - // See if we have to clip vertically anyway - bCare=bVCare; - if (bCare==0) // If we don't... - { - // Check screen limits of this tile - if (nLimLeft < 0) bCare=1; // Will cross left egde - if (nLimRight> 384-16) bCare=1; // Will cross right edge - } - if (bCare) nCpstType=CTT_16X16 | CTT_ROWS | CTT_CARE; - else nCpstType=CTT_16X16 | CTT_ROWS; - - pst=FindTile(tx,iy+y); - t = BURN_ENDIAN_SWAP_INT16(pst[0]); - - if (Scroll2TileMask) t &= Scroll2TileMask; - - t = GfxRomBankMapper(GFXTYPE_SCROLL2, t); - if (t == -1) continue; - - t<<=7; // Get real tile address - t+=nCpsGfxScroll[2]; // add on offset to scroll tiles - if (t==nKnowBlank) continue; // Don't draw: we know it's blank - - a = BURN_ENDIAN_SWAP_INT16(pst[1]); - - CpstSetPal(0x40 | (a&0x1f)); - - nCpstX=x<<4; nCpstTile=t; nCpstFlip=(a>>5)&3; - - if (nBgHi) { - CpstPmsk = BURN_ENDIAN_SWAP_INT16(*(UINT16*)(CpsSaveReg[0] + MaskAddr[(a & 0x180) >> 7])); - } - - if(CpstOneDoX[nBgHi]()) nKnowBlank=t; - } -} - -static void Cps2TileLineRows(INT32 y,struct CpsrLineInfo *pli) -{ - INT32 sy,iy,x; - INT32 nTileCount; - INT32 nLimLeft,nLimRight; - - nTileCount=pli->nTileEnd-pli->nTileStart; - - sy=16-(nCpsrScrY&15); iy=(nCpsrScrY>>4)+1; - nCpstY=sy+(y<<4); - CpstRowShift=pli->Rows; - - // If these rowshift limits go off the edges, we should take - // care drawing the tile. - nLimLeft =pli->nMaxLeft; - nLimRight=pli->nMaxRight; - for (x=0; xnTileStart+x; - - // See if we have to clip vertically anyway - bCare=bVCare; - if (bCare==0) // If we don't... - { - // Check screen limits of this tile - if (nLimLeft < 0) bCare=1; // Will cross left egde - if (nLimRight> 384-16) bCare=1; // Will cross right edge - } - if (bCare) nCpstType=CTT_16X16 | CTT_ROWS | CTT_CARE; - else nCpstType=CTT_16X16 | CTT_ROWS; - - pst=FindTile(tx,iy+y); - t = BURN_ENDIAN_SWAP_INT16(pst[0]); - t<<=7; // Get real tile address - t+=nCpsGfxScroll[2]; // add on offset to scroll tiles - - if (t==nKnowBlank) continue; // Don't draw: we know it's blank - a = BURN_ENDIAN_SWAP_INT16(pst[1]); - - CpstSetPal(0x40 | (a&0x1f)); - - nCpstX=x<<4; nCpstTile=t; nCpstFlip=(a>>5)&3; - if(CpstOneDoX[2]()) nKnowBlank=t; - } -} - -INT32 Cps1rRender() -{ - INT32 y; struct CpsrLineInfo *pli; - if (CpsrBase==NULL) return 1; - - nKnowBlank=-1; // We don't know which tile is blank yet - - for (y=-1,pli=CpsrLineInfo; y<14; y++,pli++) - { - if (pli->nWidth==0) - Cps1TileLine(y,pli->nStart); // no rowscroll needed - else - Cps1TileLineRows(y,pli); // row scroll - } - return 0; -} - -INT32 Cps2rRender() -{ - INT32 y; - struct CpsrLineInfo *pli; - if (CpsrBase==NULL) return 1; - - nKnowBlank = -1; // We don't know which tile is blank yet - - nLastY = (nEndline + (nCpsrScrY & 15)) >> 4; - nFirstY = (nStartline + (nCpsrScrY & 15)) >> 4; - for (y = nFirstY - 1, pli = CpsrLineInfo + nFirstY; y < nLastY; y++, pli++) { - - bVCare = ((y << 4) < nStartline) | (((y << 4) + 16) >= nEndline); - - if (pli->nWidth==0) { - Cps2TileLine(y,pli->nStart); // no rowscroll needed - } else { - Cps2TileLineRows(y,pli); // row scroll - } - } - return 0; -} diff --git a/jan/src/burn/drv/capcom/cpst.cpp b/jan/src/burn/drv/capcom/cpst.cpp deleted file mode 100644 index 0d8d38a76..000000000 --- a/jan/src/burn/drv/capcom/cpst.cpp +++ /dev/null @@ -1,193 +0,0 @@ -#include "cps.h" - -// CPS Tiles -UINT32 *CpstPal=NULL; - -// Arguments for the tile draw function -UINT32 nCpstType = 0; -INT32 nCpstX = 0, nCpstY = 0; -UINT32 nCpstTile = 0; -UINT32 nCpsBlend = 0; -INT32 nCpstFlip = 0; -INT16 *CpstRowShift = NULL; -UINT32 CpstPmsk = 0; // Pixel mask - -INT32 nBgHi = 0; -UINT16 ZValue = 1; -UINT16* ZBuf = NULL; -UINT16* pZVal = NULL; - -static INT32 CpstOne(); -static INT32 Cps2tOne(); -static INT32 CpstOneBgHi(); -static INT32 CpstOneObjZ(); -CpstOneDoFn CpstOneDoX[3] = { CpstOne, CpstOneBgHi, Cps2tOne}; -CpstOneDoFn CpstOneObjDoX[2] = { CpstOne, CpstOneObjZ}; - -static INT32 CpstOne() -{ - INT32 nFun; INT32 nSize; - nSize=(nCpstType&24)+8; - - if (nCpstType&CTT_CARE) - { - if ((nCpstType&CTT_ROWS)==0) - { - // Return if not visible at all - if (nCpstX <= -nSize) return 0; - if (nCpstX >= 384) return 0; - if (nCpstY <= -nSize) return 0; - if (nCpstY >= 224) return 0; - } - nCtvRollX=0x4000017f + nCpstX * 0x7fff; - nCtvRollY=0x400000df + nCpstY * 0x7fff; - } - - // Clip to loaded graphics data (we have a gap of 0x200 at the end) - nCpstTile&=nCpsGfxMask; if (nCpstTile>=nCpsGfxLen) return 1; - pCtvTile=CpsGfx+nCpstTile; - - // Find pLine (pointer to first pixel) - pCtvLine=pBurnDraw + nCpstY*nBurnPitch + nCpstX*nBurnBpp; - - if (nSize==32) nCtvTileAdd=16; else nCtvTileAdd=8; - - if (nCpstFlip&2) - { - // Flip vertically - if (nSize==16) { nCtvTileAdd= -8; pCtvTile+=15* 8; } - else if (nSize==32) { nCtvTileAdd=-16; pCtvTile+=31*16; } - else { nCtvTileAdd= -8; pCtvTile+= 7* 8; } - } - - nFun =nCpstType&0x1e; - nFun|=nCpstFlip&1; - return CtvDoX[nFun](); -} - -static INT32 CpstOneBgHi() -{ - INT32 nFun; INT32 nSize; - nSize=(nCpstType&24)+8; - - if (nCpstType&CTT_CARE) - { - if ((nCpstType&CTT_ROWS)==0) - { - // Return if not visible at all - if (nCpstX<=-nSize) return 0; - if (nCpstX>=384) return 0; - if (nCpstY<=-nSize) return 0; - if (nCpstY>=224) return 0; - } - nCtvRollX=0x4000017f + nCpstX * 0x7fff; - nCtvRollY=0x400000df + nCpstY * 0x7fff; - } - - // Clip to loaded graphics data (we have a gap of 0x200 at the end) - nCpstTile&=nCpsGfxMask; - if (nCpstTile>=nCpsGfxLen) return 1; - pCtvTile=CpsGfx+nCpstTile; - - // Find pLine (pointer to first pixel) - pCtvLine=pBurnDraw + nCpstY*nBurnPitch + nCpstX*nBurnBpp; - - if (nSize==32) nCtvTileAdd=16; else nCtvTileAdd=8; - - if (nCpstFlip&2) - { - // Flip vertically - if (nSize==16) { nCtvTileAdd= -8; pCtvTile+=15* 8; } - else if (nSize==32) { nCtvTileAdd=-16; pCtvTile+=31*16; } - else { nCtvTileAdd= -8; pCtvTile+= 7* 8; } - } - - nFun =nCpstType&0x1e; - nFun|=nCpstFlip&1; - return CtvDoXB[nFun](); -} - -static INT32 Cps2tOne() -{ - INT32 nFun; INT32 nSize; - nSize=(nCpstType&24)+8; - - if (nCpstType&CTT_CARE) - { - if ((nCpstType&CTT_ROWS)==0) - { - // Return if not visible at all - if (nCpstX <= -nSize) return 0; - if (nCpstX >= 384) return 0; - if (nCpstY <= -nStartline - nSize) return 0; - if (nCpstY >= nEndline) return 0; - } - nCtvRollX=0x4000017f + nCpstX * 0x7fff; - nCtvRollY=0x40000000 + nEndline - nStartline - 1 + (nCpstY - nStartline) * 0x7fff; - } - - // Clip to loaded graphics data (we have a gap of 0x200 at the end) - nCpstTile&=nCpsGfxMask; if (nCpstTile>=nCpsGfxLen) return 0; - pCtvTile=CpsGfx+nCpstTile; - - // Find pLine (pointer to first pixel) - pCtvLine=pBurnDraw + nCpstY*nBurnPitch + nCpstX*nBurnBpp; - - if (nSize==32) nCtvTileAdd=16; else nCtvTileAdd=8; - - if (nCpstFlip&2) - { - // Flip vertically - if (nSize==16) { nCtvTileAdd= -8; pCtvTile+=15* 8; } - else if (nSize==32) { nCtvTileAdd=-16; pCtvTile+=31*16; } - else { nCtvTileAdd= -8; pCtvTile+= 7* 8; } - } - - nFun =nCpstType&0x1e; - nFun|=nCpstFlip&1; - return CtvDoX[nFun](); -} - -static INT32 CpstOneObjZ() -{ - INT32 nFun; INT32 nSize; - nSize=(nCpstType&24)+8; - - - if (nCpstType&CTT_CARE) - { - if ((nCpstType&CTT_ROWS)==0) - { - // Return if not visible at all - if (nCpstX <= -nSize) return 0; - if (nCpstX >= 384) return 0; - if (nCpstY <= -nSize) return 0; - if (nCpstY >= 224) return 0; - } - nCtvRollX=0x4000017f + nCpstX * 0x7fff; - nCtvRollY=0x400000df + nCpstY * 0x7fff; - } - - - // Clip to loaded graphics data (we have a gap of 0x200 at the end) - nCpstTile&=nCpsGfxMask; if (nCpstTile>=nCpsGfxLen) return 1; - pCtvTile=CpsGfx+nCpstTile; - - // Find pLine (pointer to first pixel) - pCtvLine=pBurnDraw + nCpstY*nBurnPitch + nCpstX*nBurnBpp; - pZVal=ZBuf + nCpstY*384 + nCpstX; - - if (nSize==32) nCtvTileAdd=16; else nCtvTileAdd=8; - - if (nCpstFlip&2) - { - // Flip vertically - if (nSize==16) { nCtvTileAdd= -8; pCtvTile+=15* 8; } - else if (nSize==32) { nCtvTileAdd=-16; pCtvTile+=31*16; } - else { nCtvTileAdd= -8; pCtvTile+= 7* 8; } - } - - nFun =nCpstType&0x1e; - nFun|=nCpstFlip&1; - return CtvDoXM[nFun](); -} diff --git a/jan/src/burn/drv/capcom/ctv.cpp b/jan/src/burn/drv/capcom/ctv.cpp deleted file mode 100644 index ff3d247ce..000000000 --- a/jan/src/burn/drv/capcom/ctv.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "cps.h" - -// CPS Tile Variants -// horizontal/vertical clip rolls -UINT32 nCtvRollX=0,nCtvRollY=0; -// Add 0x7fff after each pixel/line -// If nRollX/Y&0x20004000 both == 0, you can draw the pixel - -UINT8 *pCtvTile=NULL; // Pointer to tile data -INT32 nCtvTileAdd=0; // Amount to add after each tile line -UINT8 *pCtvLine=NULL; // Pointer to output bitmap - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s, UINT32 p) -{ - INT32 a = 255 - p; - - return (((((s & 0xff00ff) * p) + ((d & 0xff00ff) * a)) & 0xff00ff00) + - ((((s & 0x00ff00) * p) + ((d & 0x00ff00) * a)) & 0x00ff0000)) >> 8; -} - -// Include all tile variants: -#include "ctv.h" - -static INT32 nLastBpp=0; -INT32 CtvReady() -{ - // Set up the CtvDoX functions to point to the correct bpp functions. - // Must be called before calling CpstOne - if (nBurnBpp!=nLastBpp) - { - if (nBurnBpp==2) { - memcpy(CtvDoX,CtvDo2,sizeof(CtvDoX)); - memcpy(CtvDoXM,CtvDo2m,sizeof(CtvDoXM)); - memcpy(CtvDoXB,CtvDo2b,sizeof(CtvDoXB)); - } - else if (nBurnBpp==3) { - memcpy(CtvDoX,CtvDo3,sizeof(CtvDoX)); - memcpy(CtvDoXM,CtvDo3m,sizeof(CtvDoXM)); - memcpy(CtvDoXB,CtvDo3b,sizeof(CtvDoXB)); - } - else if (nBurnBpp==4) { - memcpy(CtvDoX,CtvDo4,sizeof(CtvDoX)); - memcpy(CtvDoXM,CtvDo4m,sizeof(CtvDoXM)); - memcpy(CtvDoXB,CtvDo4b,sizeof(CtvDoXB)); - } - } - nLastBpp=nBurnBpp; - return 0; -} diff --git a/jan/src/burn/drv/capcom/ctv_do.h b/jan/src/burn/drv/capcom/ctv_do.h deleted file mode 100644 index 37e9ca903..000000000 --- a/jan/src/burn/drv/capcom/ctv_do.h +++ /dev/null @@ -1,192 +0,0 @@ -// CPS Tiles (header) - -// Draw a nxn tile -// pCtvLine, pTile, nTileAdd are defined -// CU_FLIPX is 1 to flip the tile horizontally -// CU_CARE is 1 to clip output based on nCtvRollX/Y -// CU_ROWS is 1 to shift output based on CpstRowShift -// CU_SIZE is 8, 16 or 32 -// CU_BPP is 1 2 3 4 bytes per pixel -// CU_MASK CPS1 BgHi CPS2 Sprite Masking - -#ifndef CU_FLIPX - #error "CU_FLIPX wasn\'t defined" -#endif - -#ifndef CU_CARE - #error "CU_CARE wasn\'t defined" -#endif - -#ifndef CU_ROWS - #error "CU_ROWS wasn\'t defined" -#endif - -#ifndef CU_SIZE - #error "CU_SIZE wasn\'t defined" -#endif - -#ifndef CU_BPP - #error "CU_BPP wasn\'t defined" -#endif - -#ifndef CU_MASK - #error "CU_MASK wasn\'t defined" -#endif - -{ - INT32 y; - UINT32 *ctp; - UINT32 nBlank = 0; - - UINT32 b; // Eight bit-packed pixels (msb) AAAABBBB CCCCDDDD EEEEFFFF GGGGHHHH (lsb) - UINT32 c; // 32-bit colour value - UINT8 *pPix; // Pointer to output bitmap - -#if CU_ROWS == 1 - INT16 *Rows = CpstRowShift; -#endif - - ctp = CpstPal; - -for (y = 0; y < CU_SIZE; y++, pCtvLine += nBurnPitch, pCtvTile += nCtvTileAdd - -#if CU_ROWS==1 - ,Rows++ -#endif - -#if CU_MASK==1 - ,pZVal += 384 -#endif - -) -{ -#if CU_CARE==1 - UINT32 rx = nCtvRollX; // Copy of nCtvRollX -#endif - -#if CU_MASK==1 - UINT16 *pPixZ; -#endif - -#if CU_CARE==1 - if (nCtvRollY & 0x20004000) { nCtvRollY += 0x7fff; continue; } else nCtvRollY += 0x7fff; // okay to plot line -#endif - - // Point to the line to draw - pPix = pCtvLine; -#if CU_MASK==1 - pPixZ = pZVal; -#endif - -#if CU_ROWS==1 - #if CU_MASK==1 - pPixZ += Rows[0]; - #endif - pPix += Rows[0] * nBurnBpp; - #if CU_CARE==1 - rx += Rows[0] * 0x7fff; - #endif -#endif - -// Make macros for plotting c and advancing pPix by one pixel -#if CU_BPP==2 - #if CU_MASK==1 - #define PLOT { if(*pPixZ < ZValue) { *((UINT16 *)pPix)=(UINT16)c; *pPixZ=ZValue; } } - #define ADV { pPix+=2; pPixZ++; } - #else - #define PLOT { *((UINT16 *)pPix)=(UINT16)c; } - #define ADV pPix+=2 - #endif -#elif CU_BPP==3 - #if CU_MASK==1 - #define PLOT { if(*pPixZ < ZValue) { if (nCpsBlend) { c = alpha_blend(pPix[0]|(pPix[1]<<8)|(pPix[2]<<16), c, nCpsBlend); } pPix[0]=(UINT8)c; pPix[1]=(UINT8)(c>>8); pPix[2]=(UINT8)(c>>16); } } - #define ADV { pPix+=3; pPixZ++; } - #else - #define PLOT { if (nCpsBlend) { c = alpha_blend(pPix[0]|(pPix[1]<<8)|(pPix[2]<<16), c, nCpsBlend); } pPix[0]=(UINT8)c; pPix[1]=(UINT8)(c>>8); pPix[2]=(UINT8)(c>>16); } - #define ADV pPix+=3 - #endif -#elif CU_BPP==4 - #if CU_MASK==1 - #define PLOT { if(*pPixZ < ZValue) { if (nCpsBlend) { c = alpha_blend(*((UINT32 *)pPix), c, nCpsBlend); } *((UINT32 *)pPix)=c; *pPixZ=ZValue; } } - #define ADV { pPix+=4; pPixZ++; } - #else - #define PLOT { if (nCpsBlend) { c = alpha_blend(*((UINT32 *)pPix), c, nCpsBlend); } *((UINT32 *)pPix)=c; } - #define ADV pPix+=4 - #endif -#else - #error Unsupported CU_BPP -#endif - -// Make macros for plotting the next pixel from 'b' (= 8 packed pixels) -// or skipping the pixel. -#if CU_FLIPX==0 - #define NEXTPIXEL ADV; b <<= 4; - #if CU_MASK==2 - #define DRAWPIXEL { c = (b >> 28); if (c && CpstPmsk & (1 << (c ^ 15))) { c = ctp[c]; PLOT } } - #else - #define DRAWPIXEL { if (b & 0xf0000000) { c = ctp[b >> 28]; PLOT } } - #endif -#else - #define NEXTPIXEL ADV; b >>= 4; - #if CU_MASK==2 - #define DRAWPIXEL { c = (b & 15); if (c && CpstPmsk & (1 << (c ^ 15))) { c = ctp[c]; PLOT } } - #else - #define DRAWPIXEL { if (b & 0x0000000f) { c = ctp[b & 15]; PLOT } } - #endif -#endif - -#define EIGHT(x) x x x x x x x x - -#if CU_CARE==1 - // If we need to clip left or right, check nCtvRollX before plotting - #define DO_PIX if ((rx & 0x20004000) == 0) DRAWPIXEL NEXTPIXEL rx += 0x7fff; -#else - // Always plot - #define DO_PIX DRAWPIXEL NEXTPIXEL -#endif - -#define DRAW_8 nBlank |= b; EIGHT(DO_PIX) - -#if CU_SIZE==8 - // 8x8 tiles - b=*((UINT32 *)(pCtvTile+0)); DRAW_8 -#elif CU_SIZE==16 - // 16x16 tiles - #if CU_FLIPX==0 - b=*((UINT32 *)(pCtvTile+0)); DRAW_8 - b=*((UINT32 *)(pCtvTile+4)); DRAW_8 - #else - b=*((UINT32 *)(pCtvTile+4)); DRAW_8 - b=*((UINT32 *)(pCtvTile+0)); DRAW_8 - #endif - -#elif CU_SIZE==32 - // 32x32 tiles - #if CU_FLIPX==0 - b=*((UINT32 *)(pCtvTile+ 0)); DRAW_8 - b=*((UINT32 *)(pCtvTile+ 4)); DRAW_8 - b=*((UINT32 *)(pCtvTile+ 8)); DRAW_8 - b=*((UINT32 *)(pCtvTile+12)); DRAW_8 - #else - b=*((UINT32 *)(pCtvTile+12)); DRAW_8 - b=*((UINT32 *)(pCtvTile+ 8)); DRAW_8 - b=*((UINT32 *)(pCtvTile+ 4)); DRAW_8 - b=*((UINT32 *)(pCtvTile+ 0)); DRAW_8 - #endif - -#else - #error Unsupported CU_SIZE -#endif - -#undef DRAW_8 -#undef DO_PIX -#undef EIGHT -#undef DRAWPIXEL -#undef NEXTPIXEL - -#undef ADV -#undef PLOT -} - - return nBlank == 0; -} diff --git a/jan/src/burn/drv/capcom/ctv_make.cpp b/jan/src/burn/drv/capcom/ctv_make.cpp deleted file mode 100644 index f39e55978..000000000 --- a/jan/src/burn/drv/capcom/ctv_make.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include - -// Create the ctv.h header file -// which includes all combinations of the cps tile drawing functions - -int main() -{ - int nCuMask=0; - int nCuBpp=0; - int nCuSize=0; - int nCuRows=0; - int nCuCare=0; - int nCuFlipX=0; - - for (nCuMask=0; nCuMask<=2; nCuMask++) - { - printf ("#define CU_MASK (%d)\n\n",nCuMask); - for (nCuBpp=2; nCuBpp<=4; nCuBpp++) - { - printf ("#define CU_BPP (%d)\n\n",nCuBpp); - for (nCuSize=8; nCuSize<=32; nCuSize<<=1) - { - printf ("#define CU_SIZE (%d)\n\n",nCuSize); - for (nCuRows=0; nCuRows<2; nCuRows++) - { - printf ("#define CU_ROWS (%d)\n\n",nCuRows); - for (nCuCare=0; nCuCare<2; nCuCare++) - { - printf ("#define CU_CARE (%d)\n",nCuCare); - for (nCuFlipX=0; nCuFlipX<2; nCuFlipX++) - { - printf ("#define CU_FLIPX (%d)\n",nCuFlipX); - - if (((nCuRows && (nCuSize != 16)) || (nCuRows && nCuMask))) { - printf("// Invalid combination of capabilities.\n"); - } else { - printf ("static INT32 "); - printf ("CtvDo"); - printf ("%d",nCuBpp); - printf ("%.2d",nCuSize); - if (nCuRows) printf ("r"); else printf ("_"); - if (nCuCare) printf ("c"); else printf ("_"); - if (nCuFlipX) printf ("f"); else printf ("_"); - if (nCuMask==1) printf ("m()\n#include \"ctv_do.h\"\n"); - else if (nCuMask==2) printf ("b()\n#include \"ctv_do.h\"\n"); - else printf ("_()\n#include \"ctv_do.h\"\n"); - } - - - - printf ("#undef CU_FLIPX\n"); - } - printf ("#undef CU_CARE\n\n"); - } - printf ("#undef CU_ROWS\n\n"); - } - printf ("#undef CU_SIZE\n\n"); - } - printf ("#undef CU_BPP\n\n"); - } - printf ("#undef CU_MASK\n\n"); - } - - printf ("\n\n"); - - printf ("// Filler function\n"); - printf ("static INT32 CtvDo_______() { return 0; }\n\n\n\n"); - - for (nCuMask=0; nCuMask<=2; nCuMask++) - { - for (nCuBpp=2; nCuBpp<=4; nCuBpp++) - { - int i=0; - - if (nCuMask==1) - { - printf ("// Lookup table for %d bpp with Sprite Masking\n",nCuBpp); - printf ("static CtvDoFn CtvDo%dm[0x20]={\n",nCuBpp); - } - else if (nCuMask==2) - { - printf ("// Lookup table for %d bpp with BgHi\n",nCuBpp); - printf ("static CtvDoFn CtvDo%db[0x20]={\n",nCuBpp); - } - else - { - printf ("// Lookup table for %d bpp\n",nCuBpp); - printf ("static CtvDoFn CtvDo%d[0x20]={\n",nCuBpp); - } - - for (i=0;i<0x20;i++) - { - int s; - printf ("CtvDo"); - - s=(i&24)+8; - if (s!=8 && s!=16 && s!=32) { printf ("_______"); goto End; } - if ((i&4) && (s!=16)) { printf ("_______"); goto End; } - if ((i&4) && nCuMask) { printf ("_______"); goto End; } - printf ("%d",nCuBpp); - printf ("%.2d",s); - if (i&4) printf ("r"); else printf ("_"); - if (i&2) printf ("c"); else printf ("_"); - if (i&1) printf ("f"); else printf ("_"); - if (nCuMask==1) printf ("m"); - else if (nCuMask==2) printf ("b"); - else printf ("_"); - - End: - printf (","); - if (((i+1)&3)==0) printf("\n"); - } - printf ("};\n"); - } - } - - printf ("\n\n"); - printf ("// Current BPP:\n"); - printf ("CtvDoFn CtvDoX[0x20];\n"); - printf ("CtvDoFn CtvDoXM[0x20];\n"); - printf ("CtvDoFn CtvDoXB[0x20];\n"); - printf ("\n\n"); - - return 0; -} diff --git a/jan/src/burn/drv/capcom/d_cps1.cpp b/jan/src/burn/drv/capcom/d_cps1.cpp deleted file mode 100644 index 83c5da42a..000000000 --- a/jan/src/burn/drv/capcom/d_cps1.cpp +++ /dev/null @@ -1,21335 +0,0 @@ -#include "cps.h" -#include "timekpr.h" - -#define CPS1_68K_PROGRAM_BYTESWAP 1 -#define CPS1_68K_PROGRAM_NO_BYTESWAP 2 -#define CPS1_Z80_PROGRAM 3 -#define CPS1_TILES 4 -#define CPS1_OKIM6295_SAMPLES 5 -#define CPS1_QSOUND_SAMPLES 6 -#define CPS1_PIC 7 -#define CPS1_EXTRA_TILES_SF2EBBL_400000 8 -#define CPS1_EXTRA_TILES_400000 9 -#define CPS1_EXTRA_TILES_SF2KORYU_400000 10 -#define CPS1_EXTRA_TILES_SF2B_400000 11 - -typedef INT32 (*Cps1Callback)(INT32); -static Cps1Callback Cps1GfxLoadCallbackFunction = NULL; - -// Input Definitions - -static struct BurnInputInfo NTFOInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Special" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Special" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(NTFO) - -static struct BurnInputInfo ThreeWondersInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Button 2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Button 2" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(ThreeWonders) - -static struct BurnInputInfo CaptcommInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp177+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp177+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp177+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp177+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp177+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp177+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp177+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp177+5, "p3 fire 2" }, - - {"P4 Coin" , BIT_DIGITAL , CpsInp179+6, "p4 coin" }, - {"P4 Start" , BIT_DIGITAL , CpsInp179+7, "p4 start" }, - {"P4 Up" , BIT_DIGITAL , CpsInp179+3, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , CpsInp179+2, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , CpsInp179+1, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , CpsInp179+0, "p4 right" }, - {"P4 Attack" , BIT_DIGITAL , CpsInp179+4, "p4 fire 1" }, - {"P4 Jump" , BIT_DIGITAL , CpsInp179+5, "p4 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Captcomm) - -static struct BurnInputInfo CawingInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Special" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Special" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Cawing) - -static struct BurnInputInfo Cworld2jInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Answer 1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Answer 2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Answer 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Answer 4" , BIT_DIGITAL , CpsInp001+7, "p1 fire 4" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Answer 1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Answer 2" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Answer 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Answer 4" , BIT_DIGITAL , CpsInp000+7, "p2 fire 4" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Cworld2j) - -static struct BurnInputInfo DinoInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0 , "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4 , "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3 , "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2 , "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1 , "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0 , "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4 , "p1 fire 1"}, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5 , "p1 fire 2"}, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1 , "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5 , "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3 , "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2 , "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1 , "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0 , "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4 , "p2 fire 1"}, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5 , "p2 fire 2"}, - - {"P3 Coin" , BIT_DIGITAL , CpsInpc001+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInpc001+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInpc001+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInpc001+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInpc001+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInpc001+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInpc001+4, "p3 fire 1"}, - {"P3 Jump" , BIT_DIGITAL , CpsInpc001+5, "p3 fire 2"}, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6 , "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2 , "service" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Dino) - -static struct BurnInputInfo DinohInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0 , "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4 , "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3 , "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2 , "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1 , "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0 , "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4 , "p1 fire 1"}, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5 , "p1 fire 2"}, - {"P1 Bomb" , BIT_DIGITAL , CpsInp001+6 , "p1 fire 3"}, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1 , "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5 , "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3 , "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2 , "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1 , "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0 , "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4 , "p2 fire 1"}, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5 , "p2 fire 2"}, - {"P2 Bomb" , BIT_DIGITAL , CpsInp000+6 , "p2 fire 3"}, - - {"P3 Coin" , BIT_DIGITAL , CpsInp177+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp177+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp177+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp177+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp177+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp177+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp177+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp177+5, "p3 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6 , "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2 , "service" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Dinoh) - -static struct BurnInputInfo DynwarInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack Left" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Attack Right" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Special" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack Left" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Attack Right" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Special" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Dynwar) - -static struct BurnInputInfo FfightInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Special" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Special" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Ffight) - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo ForgottnInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL, CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL, CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL, CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL, CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL, CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL, CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL, CpsInp001+4, "p1 fire 1"}, - A("P1 Turn (analog)", BIT_ANALOG_REL, &CpsInp055, "p1 z-axis"), - {"P1 Turn - (digital)", BIT_DIGITAL, CpsDigUD+0, "p1 fire 2"}, - {"P1 Turn + (digital)", BIT_DIGITAL, CpsDigUD+1, "p1 fire 3"}, - - {"P2 Coin" , BIT_DIGITAL, CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL, CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL, CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL, CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL, CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL, CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL, CpsInp000+4, "p2 fire 1"}, - A("P2 Turn (analog)", BIT_ANALOG_REL, &CpsInp05d, "p2 z-axis"), - {"P2 Turn - (digital)", BIT_DIGITAL, CpsDigUD+2, "p2 fire 2"}, - {"P2 Turn + (digital)", BIT_DIGITAL, CpsDigUD+3, "p2 fire 3"}, - - {"Reset" , BIT_DIGITAL, &CpsReset, "reset" }, - {"Service" , BIT_DIGITAL, CpsInp018+2, "service" }, - - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, - {"Dip D" , BIT_DIPSWITCH, &fFakeDip , "dip" }, -}; - -#undef A - -STDINPUTINFO(Forgottn) - -static struct BurnInputInfo GanbareInputList[] = { - {"Coin 1" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"Left Switch" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"Right Switch" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"Show Switch" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"Pay Switch" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Ganbare) - -static struct BurnInputInfo GhoulsInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Fire" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Fire" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Ghouls) - -static struct BurnInputInfo KnightsInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp177+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp177+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp177+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp177+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp177+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp177+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp177+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp177+5, "p3 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Knights) - -static struct BurnInputInfo KodInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp177+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp177+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp177+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp177+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp177+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp177+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp177+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp177+5, "p3 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Kod) - -static struct BurnInputInfo KodhInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInpc000+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInpc000+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInpc000+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInpc000+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInpc000+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInpc000+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInpc000+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInpc000+5, "p3 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Kodh) - -static struct BurnInputInfo MegamanInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Fire" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Select" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Fire" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Select" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Megaman) - -static struct BurnInputInfo MercsInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Special" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Special" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp177+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp177+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp177+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp177+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp177+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp177+0, "p3 right" }, - {"P3 Shot" , BIT_DIGITAL , CpsInp177+4, "p3 fire 1" }, - {"P3 Special" , BIT_DIGITAL , CpsInp177+5, "p3 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Mercs) - -static struct BurnInputInfo MswordInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Msword) - -static struct BurnInputInfo MtwinsInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Special" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Special" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Mtwins) - -static struct BurnInputInfo NemoInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Nemo) - -static struct BurnInputInfo Pang3InputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot 1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Shot 2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot 1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Shot 2" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Pang3) - -static struct BurnInputInfo PnickjInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Turn 1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Turn 2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Turn 1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Turn 2" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Pnickj) - -static struct BurnInputInfo PokonyanInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Pokonyan) - -static struct BurnInputInfo PunisherInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Punisher) - -static struct BurnInputInfo PunisherbzInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Super" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Super" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, -}; - -STDINPUTINFO(Punisherbz) - -static struct BurnInputInfo QadInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Answer 1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Answer 2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Answer 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Answer 4" , BIT_DIGITAL , CpsInp001+7, "p1 fire 4" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Answer 1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Answer 2" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Answer 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Answer 4" , BIT_DIGITAL , CpsInp000+7, "p2 fire 4" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Qad) - -static struct BurnInputInfo Qtono2jInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Answer 1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Answer 2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Answer 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Answer 4" , BIT_DIGITAL , CpsInp001+7, "p1 fire 4" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Answer 1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Answer 2" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Answer 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Answer 4" , BIT_DIGITAL , CpsInp000+7, "p2 fire 4" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Qtono2j) - -static struct BurnInputInfo Sf2InputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Weak Punch" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Medium Punch" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Strong Punch" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Weak Kick" , BIT_DIGITAL , CpsInp177+0, "p1 fire 4" }, - {"P1 Medium Kick" , BIT_DIGITAL , CpsInp177+1, "p1 fire 5" }, - {"P1 Strong Kick" , BIT_DIGITAL , CpsInp177+2, "p1 fire 6" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Weak Punch" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Medium Punch" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Strong Punch" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Weak Kick" , BIT_DIGITAL , CpsInp177+4, "p2 fire 4" }, - {"P2 Medium Kick" , BIT_DIGITAL , CpsInp177+5, "p2 fire 5" }, - {"P2 Strong Kick" , BIT_DIGITAL , CpsInp177+6, "p2 fire 6" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Sf2) - -static struct BurnInputInfo Sf2ueInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Weak Punch" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Medium Punch" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Strong Punch" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Weak Kick" , BIT_DIGITAL , CpsInp1fd+0, "p1 fire 4" }, - {"P1 Medium Kick" , BIT_DIGITAL , CpsInp1fd+1, "p1 fire 5" }, - {"P1 Strong Kick" , BIT_DIGITAL , CpsInp1fd+2, "p1 fire 6" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Weak Punch" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Medium Punch" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Strong Punch" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Weak Kick" , BIT_DIGITAL , CpsInp1fd+4, "p2 fire 4" }, - {"P2 Medium Kick" , BIT_DIGITAL , CpsInp1fd+5, "p2 fire 5" }, - {"P2 Strong Kick" , BIT_DIGITAL , CpsInp1fd+6, "p2 fire 6" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Sf2ue) - -static struct BurnInputInfo Sf2yycInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp019+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp019+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Weak Punch" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Medium Punch" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Strong Punch" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Weak Kick" , BIT_DIGITAL , CpsInp176+0, "p1 fire 4" }, - {"P1 Medium Kick" , BIT_DIGITAL , CpsInp176+1, "p1 fire 5" }, - {"P1 Strong Kick" , BIT_DIGITAL , CpsInp176+2, "p1 fire 6" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp019+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp019+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Weak Punch" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Medium Punch" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Strong Punch" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Weak Kick" , BIT_DIGITAL , CpsInp176+4, "p2 fire 4" }, - {"P2 Medium Kick" , BIT_DIGITAL , CpsInp176+5, "p2 fire 5" }, - {"P2 Strong Kick" , BIT_DIGITAL , CpsInp176+6, "p2 fire 6" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp019+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp019+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Sf2yyc) - -static struct BurnInputInfo Sf2ceeablInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Weak Punch" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Medium Punch" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Strong Punch" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Weak Kick" , BIT_DIGITAL , CpsInp012+0, "p1 fire 4" }, - {"P1 Medium Kick" , BIT_DIGITAL , CpsInp012+1, "p1 fire 5" }, - {"P1 Strong Kick" , BIT_DIGITAL , CpsInp012+2, "p1 fire 6" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Weak Punch" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Medium Punch" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Strong Punch" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Weak Kick" , BIT_DIGITAL , CpsInp012+4, "p2 fire 4" }, - {"P2 Medium Kick" , BIT_DIGITAL , CpsInp012+5, "p2 fire 5" }, - {"P2 Strong Kick" , BIT_DIGITAL , CpsInp012+6, "p2 fire 6" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Sf2ceeabl) - -static struct BurnInputInfo Sf2ceuablInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp029+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp029+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp011+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp011+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp011+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp011+0, "p1 right" }, - {"P1 Weak Punch" , BIT_DIGITAL , CpsInp011+4, "p1 fire 1" }, - {"P1 Medium Punch" , BIT_DIGITAL , CpsInp011+5, "p1 fire 2" }, - {"P1 Strong Punch" , BIT_DIGITAL , CpsInp011+6, "p1 fire 3" }, - {"P1 Weak Kick" , BIT_DIGITAL , CpsInp186+0, "p1 fire 4" }, - {"P1 Medium Kick" , BIT_DIGITAL , CpsInp186+1, "p1 fire 5" }, - {"P1 Strong Kick" , BIT_DIGITAL , CpsInp186+2, "p1 fire 6" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp029+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp029+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp010+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp010+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp010+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp010+0, "p2 right" }, - {"P2 Weak Punch" , BIT_DIGITAL , CpsInp010+4, "p2 fire 1" }, - {"P2 Medium Punch" , BIT_DIGITAL , CpsInp010+5, "p2 fire 2" }, - {"P2 Strong Punch" , BIT_DIGITAL , CpsInp010+6, "p2 fire 3" }, - {"P2 Weak Kick" , BIT_DIGITAL , CpsInp186+4, "p2 fire 4" }, - {"P2 Medium Kick" , BIT_DIGITAL , CpsInp186+5, "p2 fire 5" }, - {"P2 Strong Kick" , BIT_DIGITAL , CpsInp186+6, "p2 fire 6" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp029+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp029+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Sf2ceuabl) - -static struct BurnInputInfo SfzchInputList[] = -{ - {"P1 Pause" , BIT_DIGITAL , CpsInp018+2, "" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Weak Punch" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Medium Punch" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Strong Punch" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Weak Kick" , BIT_DIGITAL , CpsInp001+7, "p1 fire 4" }, - {"P1 Medium Kick" , BIT_DIGITAL , CpsInp018+0, "p1 fire 5" }, - {"P1 Strong Kick" , BIT_DIGITAL , CpsInp018+6, "p1 fire 6" }, - - {"P2 Pause" , BIT_DIGITAL , CpsInp018+3, "" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Weak Punch" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Medium Punch" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Strong Punch" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Weak Kick" , BIT_DIGITAL , CpsInp000+7, "p2 fire 4" }, - {"P2 Medium Kick" , BIT_DIGITAL , CpsInp018+1, "p2 fire 5" }, - {"P2 Strong Kick" , BIT_DIGITAL , CpsInp018+7, "p2 fire 6" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, -}; - -STDINPUTINFO(Sfzch) - -static struct BurnInputInfo SlammastInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Pin" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Pin" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInpc001+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInpc001+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInpc001+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInpc001+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInpc001+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInpc001+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInpc001+4, "p3 fire 1"}, - {"P3 Jump" , BIT_DIGITAL , CpsInpc001+5, "p3 fire 2"}, - {"P3 Pin" , BIT_DIGITAL , CpsInp001+7 , "p3 fire 3"}, - - {"P4 Coin" , BIT_DIGITAL , CpsInpc003+6, "p4 coin" }, - {"P4 Start" , BIT_DIGITAL , CpsInpc003+7, "p4 start" }, - {"P4 Up" , BIT_DIGITAL , CpsInpc003+3, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , CpsInpc003+2, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , CpsInpc003+1, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , CpsInpc003+0, "p4 right" }, - {"P4 Attack" , BIT_DIGITAL , CpsInpc003+4, "p4 fire 1"}, - {"P4 Jump" , BIT_DIGITAL , CpsInpc003+5, "p4 fire 2"}, - {"P4 Pin" , BIT_DIGITAL , CpsInp000+7 , "p4 fire 3"}, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6 , "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2 , "service" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Slammast) - -static struct BurnInputInfo StriderInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Strider) - -static struct BurnInputInfo UnsquadInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Special" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Special" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, - -}; - -STDINPUTINFO(Unsquad) - -static struct BurnInputInfo VarthInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Bomb" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Bomb" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Varth) - -static struct BurnInputInfo WillowInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Willow) - -static struct BurnInputInfo WofInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInpc001+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInpc001+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInpc001+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInpc001+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInpc001+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInpc001+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInpc001+4, "p3 fire 1"}, - {"P3 Jump" , BIT_DIGITAL , CpsInpc001+5, "p3 fire 2"}, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Wof) - -static struct BurnInputInfo WofchInputList[] = -{ - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"P3 Start" , BIT_DIGITAL , CpsInpc001+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInpc001+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInpc001+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInpc001+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInpc001+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInpc001+4, "p3 fire 1"}, - {"P3 Jump" , BIT_DIGITAL , CpsInpc001+5, "p3 fire 2"}, - {"P3 Fire" , BIT_DIGITAL , CpsInpc001+6, "p3 fire 3"}, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, -}; - -STDINPUTINFO(Wofch) - -static struct BurnInputInfo WofhfhInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp177+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp177+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp177+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp177+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp177+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp177+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp177+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp177+5, "p3 fire 2" }, - {"P3 Fire 3" , BIT_DIGITAL , CpsInp177+6, "p3 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Wofhfh) - -static struct BurnInputInfo WofhInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp177+6, "p3 coin" }, // doesn't work in some sets? - {"P3 Start" , BIT_DIGITAL , CpsInp177+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp177+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp177+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp177+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp177+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp177+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp177+5, "p3 fire 2" }, - {"P3 Fire 3" , BIT_DIGITAL , CpsInp177+6, "p3 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Wofh) - -static struct BurnInputInfo Wof3jsInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"P3 Start" , BIT_DIGITAL , CpsInp177+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp177+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp177+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp177+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp177+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp177+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp177+5, "p3 fire 2" }, - {"P3 Fire 3" , BIT_DIGITAL , CpsInp177+6, "p3 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Wof3js) - -// don't know where this one reads config data from (if at all), reads values at 0x80001a, 0x80001e, 0x80001f (but values make no difference) -// if I force it to use EEPROM, the config data gets forgotten -static struct BurnInputInfo WofsjbInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp018+0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp018+4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp018+1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp018+5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp01B+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp01B+7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp01B+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp01B+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp01B+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp01B+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp01B+4, "p3 fire 1"}, - {"P3 Jump" , BIT_DIGITAL , CpsInp01B+5, "p3 fire 2"}, - {"P3 Fire 3" , BIT_DIGITAL , CpsInp01B+6, "p3 fire 3"}, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp018+6, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp018+2, "service" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, -}; - -STDINPUTINFO(Wofsjb) - -// Dip Switch Definitions - -#define CPS1_COINAGE_1(dipval) \ - {0 , 0xfe, 0 , 8 , "Coin A" }, \ - {dipval, 0x01, 0x07, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x06, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x05, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x00, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, \ - \ - {0 , 0xfe, 0 , 8 , "Coin B" }, \ - {dipval, 0x01, 0x38, 0x38, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x38, 0x30, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x38, 0x28, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x38, 0x00, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x38, 0x20, "1 Coin 6 Credits" }, - -#define CPS1_COINAGE_2(dipval) \ - {0 , 0xfe, 0 , 8 , "Coinage" }, \ - {dipval, 0x01, 0x07, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x06, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x05, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x00, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - -#define CPS1_COINAGE_3(dipval) \ - {0 , 0xfe, 0 , 8 , "Coin A" }, \ - {dipval, 0x01, 0x07, 0x06, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x05, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x04, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x07, "2 Coins 1 Credit (1 to cont)"}, \ - {dipval, 0x01, 0x07, 0x00, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, \ - \ - {0 , 0xfe, 0 , 8 , "Coin B" }, \ - {dipval, 0x01, 0x38, 0x30, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x38, 0x28, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x38, 0x20, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x38, 0x38, "2 Coins 1 Credit (1 to cont)"}, \ - {dipval, 0x01, 0x38, 0x00, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, - -#define CPS1_DIFFICULTY_1(dipval) \ - {0 , 0xfe, 0 , 8 , "Difficulty" }, \ - {dipval, 0x01, 0x07, 0x00, "1 (Easiest)" }, \ - {dipval, 0x01, 0x07, 0x01, "2" }, \ - {dipval, 0x01, 0x07, 0x02, "3" }, \ - {dipval, 0x01, 0x07, 0x03, "4 (Normal)" }, \ - {dipval, 0x01, 0x07, 0x04, "5" }, \ - {dipval, 0x01, 0x07, 0x05, "6" }, \ - {dipval, 0x01, 0x07, 0x06, "7" }, \ - {dipval, 0x01, 0x07, 0x07, "8 (Hardest)" }, - -#define CPS1_DIFFICULTY_2(dipval) \ - {0 , 0xfe, 0 , 8 , "Difficulty" }, \ - {dipval, 0x01, 0x07, 0x03, "1 (Easiest)" }, \ - {dipval, 0x01, 0x07, 0x02, "2" }, \ - {dipval, 0x01, 0x07, 0x01, "3" }, \ - {dipval, 0x01, 0x07, 0x00, "4 (Normal)" }, \ - {dipval, 0x01, 0x07, 0x04, "5" }, \ - {dipval, 0x01, 0x07, 0x05, "6" }, \ - {dipval, 0x01, 0x07, 0x06, "7" }, \ - {dipval, 0x01, 0x07, 0x07, "8 (Hardest)" }, - -static struct BurnDIPInfo NTFODIPList[]= -{ - // Defaults - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x12) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x13) - - {0 , 0xfe, 0 , 4 , "Level Up Timer" }, - {0x13, 0x01, 0x18, 0x00, "More Slowly" }, - {0x13, 0x01, 0x18, 0x08, "Slowly" }, - {0x13, 0x01, 0x18, 0x10, "Quickly" }, - {0x13, 0x01, 0x18, 0x18, "More Quickly" }, - - {0 , 0xfe, 0 , 4 , "Bullet's Speed" }, - {0x13, 0x01, 0x60, 0x00, "Very Slow" }, - {0x13, 0x01, 0x60, 0x20, "Slow" }, - {0x13, 0x01, 0x60, 0x40, "Fast" }, - {0x13, 0x01, 0x60, 0x60, "Very Fast" }, - - {0 , 0xfe, 0 , 2 , "Initital Vitality" }, - {0x13, 0x01, 0x80, 0x00, "3 bars" }, - {0x13, 0x01, 0x80, 0x80, "4 bars" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Throttle Game Speed" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x04, 0x00, "Off" }, - {0x14, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x14, 0x01, 0x80, 0x00, "Game" }, - {0x14, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(NTFO) - -static struct BurnDIPInfo ThreeWondersDIPList[]= -{ - // Defaults - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x65, NULL }, - {0x15, 0xff, 0xff, 0x66, NULL }, - - // Dip A - CPS1_COINAGE_1(0x13) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, - - // Dip B - {0 , 0xfe, 0 , 4 , "Action Lives" }, - {0x14, 0x01, 0x03, 0x00, "1" }, - {0x14, 0x01, 0x03, 0x01, "2" }, - {0x14, 0x01, 0x03, 0x02, "3" }, - {0x14, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 4 , "Action Game Level" }, - {0x14, 0x01, 0x0c, 0x00, "Easy" }, - {0x14, 0x01, 0x0c, 0x04, "Normal" }, - {0x14, 0x01, 0x0c, 0x08, "Hard" }, - {0x14, 0x01, 0x0c, 0x0c, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Shooting Lives" }, - {0x14, 0x01, 0x30, 0x00, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x20, "3" }, - {0x14, 0x01, 0x30, 0x30, "5" }, - - {0 , 0xfe, 0 , 4 , "Shooting Game Level" }, - {0x14, 0x01, 0xc0, 0x00, "Easy" }, - {0x14, 0x01, 0xc0, 0x40, "Normal" }, - {0x14, 0x01, 0xc0, 0x80, "Hard" }, - {0x14, 0x01, 0xc0, 0xc0, "Hardest" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Puzzle Lives" }, - {0x15, 0x01, 0x03, 0x00, "1" }, - {0x15, 0x01, 0x03, 0x01, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 4 , "Puzzle Game Level" }, - {0x15, 0x01, 0x0c, 0x00, "Easy" }, - {0x15, 0x01, 0x0c, 0x04, "Normal" }, - {0x15, 0x01, 0x0c, 0x08, "Hard" }, - {0x15, 0x01, 0x0c, 0x0c, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x10, 0x00, "Off" }, - {0x15, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x15, 0x01, 0x80, 0x00, "Game" }, - {0x15, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(ThreeWonders) - -static struct BurnDIPInfo CaptcommDIPList[]= -{ - // Defaults - {0x23, 0xff, 0xff, 0x00, NULL }, - {0x24, 0xff, 0xff, 0x0b, NULL }, - {0x25, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_2(0x23) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x23, 0x01, 0x40, 0x00, "Off" }, - {0x23, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x24) - - {0 , 0xfe, 0 , 4 , "Difficulty 2" }, - {0x24, 0x01, 0x18, 0x00, "Easy" }, - {0x24, 0x01, 0x18, 0x08, "Normal" }, - {0x24, 0x01, 0x18, 0x10, "Hard" }, - {0x24, 0x01, 0x18, 0x18, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Play Mode" }, - {0x24, 0x01, 0xc0, 0x80, "1 Player" }, - {0x24, 0x01, 0xc0, 0x00, "2 Player" }, - {0x24, 0x01, 0xc0, 0x40, "3 Player" }, - {0x24, 0x01, 0xc0, 0xc0, "4 Player" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x25, 0x01, 0x03, 0x03, "1" }, - {0x25, 0x01, 0x03, 0x00, "2" }, - {0x25, 0x01, 0x03, 0x01, "3" }, - {0x25, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x25, 0x01, 0x04, 0x00, "Off" }, - {0x25, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x25, 0x01, 0x08, 0x00, "Off" }, - {0x25, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x25, 0x01, 0x10, 0x00, "Off" }, - {0x25, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x25, 0x01, 0x20, 0x00, "Off" }, - {0x25, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x25, 0x01, 0x40, 0x00, "Off" }, - {0x25, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x25, 0x01, 0x80, 0x00, "Game" }, - {0x25, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Captcomm) - -static struct BurnDIPInfo CawingDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x03, NULL }, - {0x17, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x15) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - // Dip B - {0 , 0xfe, 0 , 8 , "Difficulty (Enemys strength)"}, - {0x16, 0x01, 0x07, 0x00, "1 (Easiest)" }, - {0x16, 0x01, 0x07, 0x01, "2" }, - {0x16, 0x01, 0x07, 0x02, "3" }, - {0x16, 0x01, 0x07, 0x03, "4 (Normal)" }, - {0x16, 0x01, 0x07, 0x04, "5" }, - {0x16, 0x01, 0x07, 0x05, "6" }, - {0x16, 0x01, 0x07, 0x06, "7" }, - {0x16, 0x01, 0x07, 0x07, "8 (Hardest)" }, - - {0 , 0xfe, 0 , 4 , "Difficulty (Players strength)"}, - {0x16, 0x01, 0x18, 0x08, "Easy" }, - {0x16, 0x01, 0x18, 0x00, "Normal" }, - {0x16, 0x01, 0x18, 0x10, "Difficult" }, - {0x16, 0x01, 0x18, 0x18, "Very Difficult" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x17, 0x01, 0x04, 0x00, "Off" }, - {0x17, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x17, 0x01, 0x08, 0x00, "Off" }, - {0x17, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x17, 0x01, 0x10, 0x00, "Off" }, - {0x17, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Sound" }, - {0x17, 0x01, 0x20, 0x00, "Off" }, - {0x17, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x17, 0x01, 0x80, 0x00, "Game" }, - {0x17, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Cawing) - -static struct BurnDIPInfo Cworld2jDIPList[]= -{ - // Defaults - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x01, NULL }, - {0x11, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_2(0x0f) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Extended Test Mode" }, - {0x0f, 0x01, 0x80, 0x00, "Off" }, - {0x0f, 0x01, 0x80, 0x80, "On" }, - - // Dip B - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0x07, 0x01, "0" }, - {0x10, 0x01, 0x07, 0x02, "1" }, - {0x10, 0x01, 0x07, 0x03, "2" }, - {0x10, 0x01, 0x07, 0x04, "3" }, - {0x10, 0x01, 0x07, 0x05, "4" }, - - {0 , 0xfe, 0 , 3 , "Extend" }, - {0x10, 0x01, 0x18, 0x18, "D" }, - {0x10, 0x01, 0x18, 0x08, "E" }, - {0x10, 0x01, 0x18, 0x00, "N" }, - - {0 , 0xfe, 0 , 5 , "Lives" }, - {0x10, 0x01, 0xe0, 0xe0, "1" }, - {0x10, 0x01, 0xe0, 0x60, "2" }, - {0x10, 0x01, 0xe0, 0x00, "3" }, - {0x10, 0x01, 0xe0, 0x40, "4" }, - {0x10, 0x01, 0xe0, 0x20, "5" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x11, 0x01, 0x04, 0x00, "Off" }, - {0x11, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x11, 0x01, 0x80, 0x00, "Game" }, - {0x11, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Cworld2j) - -static struct BurnDIPInfo DinoDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1b, 0x01, 0x08, 0x00, "Off" }, - {0x1b, 0x01, 0x08, 0x08, "On" }, -}; - -STDDIPINFO(Dino) - -static struct BurnDIPInfo DinohDIPList[]= -{ - // Defaults - {0x1d, 0xff, 0xff, 0x00, NULL }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, -}; - -STDDIPINFO(Dinoh) - -static struct BurnDIPInfo DynwarDIPList[]= -{ - // Defaults - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - // Dip A - CPS1_COINAGE_3(0x14) - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, - - // Dip B - CPS1_DIFFICULTY_2(0x15) - - // Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x16, 0x01, 0x01, 0x00, "Off" }, - {0x16, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Turbo Mode" }, - {0x16, 0x01, 0x02, 0x00, "Off" }, - {0x16, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x16, 0x01, 0x10, 0x00, "Off" }, - {0x16, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x16, 0x01, 0x80, 0x00, "Game" }, - {0x16, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Dynwar) - -static struct BurnDIPInfo FfightDIPList[]= -{ - // Defaults - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x0b, NULL }, - {0x16, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x14) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x15) - - {0 , 0xfe, 0 , 4 , "Difficulty 2" }, - {0x15, 0x01, 0x18, 0x00, "Easy" }, - {0x15, 0x01, 0x18, 0x08, "Normal" }, - {0x15, 0x01, 0x18, 0x10, "Hard" }, - {0x15, 0x01, 0x18, 0x18, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x60, 0x00, "100k" }, - {0x15, 0x01, 0x60, 0x20, "200k" }, - {0x15, 0x01, 0x60, 0x40, "100k and every 200k" }, - {0x15, 0x01, 0x60, 0x60, "None" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x03, 0x03, "1" }, - {0x16, 0x01, 0x03, 0x00, "2" }, - {0x16, 0x01, 0x03, 0x01, "3" }, - {0x16, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x16, 0x01, 0x08, 0x00, "Off" }, - {0x16, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x16, 0x01, 0x10, 0x00, "Off" }, - {0x16, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x16, 0x01, 0x20, 0x00, "Off" }, - {0x16, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x16, 0x01, 0x80, 0x00, "Game" }, - {0x16, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Ffight) - -static struct BurnDIPInfo ForgottnDIPList[]= -{ - // Defaults - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x03, NULL }, - {0x18, 0xff, 0xff, 0x00, NULL }, - {0x19, 0xff, 0xff, 0x00, NULL }, - - // Dip A - CPS1_COINAGE_1(0x16) - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x16, 0x01, 0x80, 0x00, "Off" }, - {0x16, 0x01, 0x80, 0x80, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x17) - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x17, 0x01, 0x80, 0x00, "Off" }, - {0x17, 0x01, 0x80, 0x80, "On" }, - - // Fake dip for "turn"-input inversion - {0 , 0xfe, 0 , 2 , "Invert \"Turn\" inputs" }, - {0x19, 0x01, 0x80, 0x00, "Off" }, - {0x19, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Forgottn) - -static struct BurnDIPInfo GanbareDIPList[]= -{ - // Defaults - {0x0a, 0xff, 0xff, 0x00, NULL }, - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - - // Dip A - {0 , 0xfe, 0 , 2 , "Medal Setup" }, - {0x0a, 0x01, 0x01, 0x00, "1 Medal 1 Credit" }, - {0x0a, 0x01, 0x01, 0x01, "Don't use" }, - - {0 , 0xfe, 0 , 2 , "Coin Setup" }, - {0x0a, 0x01, 0x02, 0x00, "100 Yen" }, - {0x0a, 0x01, 0x02, 0x02, "10 Yen" }, - - {0 , 0xfe, 0 , 8 , "Change Setup" }, - {0x0a, 0x01, 0x1c, 0x18, "12" }, - {0x0a, 0x01, 0x1c, 0x1c, "11" }, - {0x0a, 0x01, 0x1c, 0x00, "10" }, - {0x0a, 0x01, 0x1c, 0x04, "8" }, - {0x0a, 0x01, 0x1c, 0x08, "7" }, - {0x0a, 0x01, 0x1c, 0x0c, "6" }, - {0x0a, 0x01, 0x1c, 0x10, "5" }, - {0x0a, 0x01, 0x1c, 0x14, "No change" }, - - {0 , 0xfe, 0 , 4 , "10 Yen Setup" }, - {0x0a, 0x01, 0x60, 0x00, "1 Coin 1 Credit" }, - {0x0a, 0x01, 0x60, 0x20, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x60, 0x40, "3 Coins 1 Credit" }, - {0x0a, 0x01, 0x60, 0x60, "Don't use" }, - - {0 , 0xfe, 0 , 2 , "Payout Setup" }, - {0x0a, 0x01, 0x80, 0x00, "Credit Mode" }, - {0x0a, 0x01, 0x80, 0x80, "Payout Mode" }, - - // Dip B - {0 , 0xfe, 0 , 8 , "Payout Rate Setup" }, - {0x0b, 0x01, 0x07, 0x06, "90%" }, - {0x0b, 0x01, 0x07, 0x07, "85%" }, - {0x0b, 0x01, 0x07, 0x00, "80%" }, - {0x0b, 0x01, 0x07, 0x01, "75%" }, - {0x0b, 0x01, 0x07, 0x02, "70%" }, - {0x0b, 0x01, 0x07, 0x03, "65%" }, - {0x0b, 0x01, 0x07, 0x04, "60%" }, - {0x0b, 0x01, 0x07, 0x05, "55%" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Demo Sound Setup" }, - {0x0c, 0x01, 0x03, 0x00, "Always" }, - {0x0c, 0x01, 0x03, 0x01, "Every second sound" }, - {0x0c, 0x01, 0x03, 0x02, "Every third sound" }, - {0x0c, 0x01, 0x03, 0x03, "Off" }, - - {0 , 0xfe, 0 , 2 , "Clear RAM" }, - {0x0c, 0x01, 0x40, 0x00, "No" }, - {0x0C, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Test Mode Display" }, - {0x0c, 0x01, 0x80, 0x00, "Off" }, - {0x0C, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Ganbare) - -static struct BurnDIPInfo GhoulsDIPList[]= -{ - // Defaults - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - // Dip A - CPS1_COINAGE_1(0x12) - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x12, 0x01, 0xc0, 0x00, "Upright 1 Player" }, - {0x12, 0x01, 0xc0, 0x40, "Upright 2 Players" }, - {0x12, 0x01, 0xc0, 0xc0, "Cocktail" }, - - // Dip B - CPS1_DIFFICULTY_2(0x13) - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x30, 0x10, "10k, 30k and every 30k" }, - {0x13, 0x01, 0x30, 0x20, "20k, 50k and every 70k" }, - {0x13, 0x01, 0x30, 0x00, "30k, 60k and every 70k" }, - {0x13, 0x01, 0x30, 0x30, "40k, 70k and every 80k" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x03, 0x00, "3" }, - {0x14, 0x01, 0x03, 0x01, "4" }, - {0x14, 0x01, 0x03, 0x02, "5" }, - {0x14, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x14, 0x01, 0x80, 0x00, "Game" }, - {0x14, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Ghouls) - -static struct BurnDIPInfo GhoulsuDIPList[]= -{ - // Defaults - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - // Dip A - CPS1_COINAGE_1(0x12) - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x12, 0x01, 0xc0, 0x00, "Upright 1 Player" }, - {0x12, 0x01, 0xc0, 0x40, "Upright 2 Players" }, - {0x12, 0x01, 0xc0, 0xc0, "Cocktail" }, - - // Dip B - CPS1_DIFFICULTY_2(0x13) - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x30, 0x10, "10k, 30k and every 30k" }, - {0x13, 0x01, 0x30, 0x20, "20k, 50k and every 70k" }, - {0x13, 0x01, 0x30, 0x00, "30k, 60k and every 70k" }, - {0x13, 0x01, 0x30, 0x30, "40k, 70k and every 80k" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x03, 0x03, "2" }, - {0x14, 0x01, 0x03, 0x00, "3" }, - {0x14, 0x01, 0x03, 0x01, "4" }, - {0x14, 0x01, 0x03, 0x02, "5" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x14, 0x01, 0x80, 0x00, "Game" }, - {0x14, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Ghoulsu) - -static struct BurnDIPInfo DaimakaiDIPList[]= -{ - // Defaults - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - // Dip A - CPS1_COINAGE_1(0x12) - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x12, 0x01, 0xc0, 0x00, "Upright 1 Player" }, - {0x12, 0x01, 0xc0, 0x40, "Upright 2 Players" }, - {0x12, 0x01, 0xc0, 0xc0, "Cocktail" }, - - // Dip B - CPS1_DIFFICULTY_2(0x13) - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x30, 0x10, "10k, 30k and every 30k" }, - {0x13, 0x01, 0x30, 0x20, "20k, 50k and every 70k" }, - {0x13, 0x01, 0x30, 0x00, "30k, 60k and every 70k" }, - {0x13, 0x01, 0x30, 0x30, "40k, 70k and every 80k" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x03, 0x00, "3" }, - {0x14, 0x01, 0x03, 0x01, "4" }, - {0x14, 0x01, 0x03, 0x02, "5" }, - {0x14, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x14, 0x01, 0x80, 0x00, "Game" }, - {0x14, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Daimakai) - -static struct BurnDIPInfo KnightsDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x03, NULL }, - {0x1d, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_2(0x1b) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x1b, 0x01, 0x40, 0x00, "Off" }, - {0x1b, 0x01, 0x40, 0x40, "On" }, - - // Dip B - {0 , 0xfe, 0 , 8 , "Enemys Attack Frequency"}, - {0x1c, 0x01, 0x07, 0x00, "1 (Easiest)" }, - {0x1c, 0x01, 0x07, 0x01, "2" }, - {0x1c, 0x01, 0x07, 0x02, "3" }, - {0x1c, 0x01, 0x07, 0x03, "4 (Normal)" }, - {0x1c, 0x01, 0x07, 0x04, "5" }, - {0x1c, 0x01, 0x07, 0x05, "6" }, - {0x1c, 0x01, 0x07, 0x06, "7" }, - {0x1c, 0x01, 0x07, 0x07, "8 (Hardest)" }, - - {0 , 0xfe, 0 , 8 , "Enemys Attack Power" }, - {0x1c, 0x01, 0x38, 0x38, "1 (Easiest)" }, - {0x1c, 0x01, 0x38, 0x30, "2" }, - {0x1c, 0x01, 0x38, 0x28, "3" }, - {0x1c, 0x01, 0x38, 0x00, "4 (Normal)" }, - {0x1c, 0x01, 0x38, 0x08, "5" }, - {0x1c, 0x01, 0x38, 0x10, "6" }, - {0x1c, 0x01, 0x38, 0x18, "7" }, - {0x1c, 0x01, 0x38, 0x20, "8 (Hardest)" }, - - {0 , 0xfe, 0 , 2 , "Coin Slots" }, - {0x1c, 0x01, 0x40, 0x40, "1" }, - {0x1c, 0x01, 0x40, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Play Mode" }, - {0x1c, 0x01, 0x80, 0x80, "2P" }, - {0x1c, 0x01, 0x80, 0x00, "3P" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x1d, 0x01, 0x03, 0x03, "1" }, - {0x1d, 0x01, 0x03, 0x00, "2" }, - {0x1d, 0x01, 0x03, 0x01, "3" }, - {0x1d, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x1d, 0x01, 0x04, 0x00, "Off" }, - {0x1d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x1d, 0x01, 0x40, 0x00, "Off" }, - {0x1d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x1d, 0x01, 0x80, 0x00, "Game" }, - {0x1d, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Knights) - -static struct BurnDIPInfo KodDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x03, NULL }, - {0x1d, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_2(0x1b) - - {0 , 0xfe, 0 , 2 , "Coin Slots" }, - {0x1b, 0x01, 0x08, 0x08, "1" }, - {0x1b, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Play Mode" }, - {0x1b, 0x01, 0x10, 0x10, "2 Players" }, - {0x1b, 0x01, 0x10, 0x00, "3 Players" }, - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x1b, 0x01, 0x40, 0x00, "Off" }, - {0x1b, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x1c) - - {0 , 0xfe, 0 , 8 , "Lives" }, - {0x1c, 0x01, 0x38, 0x08, "1" }, - {0x1c, 0x01, 0x38, 0x00, "2" }, - {0x1c, 0x01, 0x38, 0x10, "3" }, - {0x1c, 0x01, 0x38, 0x18, "4" }, - {0x1c, 0x01, 0x38, 0x20, "5" }, - {0x1c, 0x01, 0x38, 0x28, "6" }, - {0x1c, 0x01, 0x38, 0x30, "7" }, - {0x1c, 0x01, 0x38, 0x38, "8" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x1c, 0x01, 0xc0, 0x40, "80k and every 400k" }, - {0x1c, 0x01, 0xc0, 0x80, "160k and every 450k" }, - {0x1c, 0x01, 0xc0, 0x00, "200k and every 450k" }, - {0x1c, 0x01, 0xc0, 0xc0, "None" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x1d, 0x01, 0x04, 0x00, "Off" }, - {0x1d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x1d, 0x01, 0x40, 0x00, "Off" }, - {0x1d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x1d, 0x01, 0x80, 0x00, "Game" }, - {0x1d, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Kod) - -static struct BurnDIPInfo Kodr1DIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x03, NULL }, - {0x1d, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_2(0x1b) - - {0 , 0xfe, 0 , 2 , "Coin Slots" }, - {0x1b, 0x01, 0x08, 0x08, "1" }, - {0x1b, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Play Mode" }, - {0x1b, 0x01, 0x10, 0x10, "2 Players" }, - {0x1b, 0x01, 0x10, 0x00, "3 Players" }, - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x1b, 0x01, 0x40, 0x00, "Off" }, - {0x1b, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x1c) - - {0 , 0xfe, 0 , 8 , "Lives" }, - {0x1c, 0x01, 0x38, 0x08, "1" }, - {0x1c, 0x01, 0x38, 0x00, "2" }, - {0x1c, 0x01, 0x38, 0x10, "3" }, - {0x1c, 0x01, 0x38, 0x18, "4" }, - {0x1c, 0x01, 0x38, 0x20, "5" }, - {0x1c, 0x01, 0x38, 0x28, "6" }, - {0x1c, 0x01, 0x38, 0x30, "7" }, - {0x1c, 0x01, 0x38, 0x38, "8" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x1c, 0x01, 0xc0, 0x40, "80k and every 400k" }, - {0x1c, 0x01, 0xc0, 0x00, "160k and every 450k" }, - {0x1c, 0x01, 0xc0, 0x80, "200k and every 450k" }, - {0x1c, 0x01, 0xc0, 0xc0, "None" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x1d, 0x01, 0x04, 0x00, "Off" }, - {0x1d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x1d, 0x01, 0x40, 0x00, "Off" }, - {0x1d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x1d, 0x01, 0x80, 0x00, "Game" }, - {0x1d, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Kodr1) - -static struct BurnDIPInfo MegamanDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x01, NULL }, - {0x17, 0xff, 0xff, 0x00, NULL }, - - // Dip A - {0 , 0xfe, 0 , 19 , "Coinage" }, - {0x15, 0x01, 0x1f, 0x00, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x1f, 0x01, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x1f, 0x02, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x1f, 0x03, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x1f, 0x04, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x1f, 0x05, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x1f, 0x06, "1 Coin 7 Credits" }, - {0x15, 0x01, 0x1f, 0x07, "1 Coin 8 Credits" }, - {0x15, 0x01, 0x1f, 0x08, "1 Coin 9 Credits" }, - {0x15, 0x01, 0x1f, 0x09, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0a, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0b, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0c, "5 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0d, "6 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0e, "7 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0f, "8 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x10, "9 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x11, "2 Coins Start 1 Coin Continue"}, - {0x15, 0x01, 0x1f, 0x12, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Coin Slots" }, - {0x15, 0x01, 0x60, 0x40, "1, Common" }, - {0x15, 0x01, 0x60, 0x00, "2, Common" }, - {0x15, 0x01, 0x60, 0x20, "2, Individual" }, - - // Dip B - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x00, "Easy" }, - {0x16, 0x01, 0x03, 0x01, "Normal" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time" }, - {0x16, 0x01, 0x0c, 0x00, "100" }, - {0x16, 0x01, 0x0c, 0x04, "90" }, - {0x16, 0x01, 0x0c, 0x08, "70" }, - {0x16, 0x01, 0x0c, 0x0c, "60" }, - - {0 , 0xfe, 0 , 2 , "Voice" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x17, 0x01, 0x01, 0x00, "Off" }, - {0x17, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x17, 0x01, 0x02, 0x02, "Off" }, - {0x17, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x04, 0x04, "Off" }, - {0x17, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x17, 0x01, 0x80, 0x00, "Game" }, - {0x17, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Megaman) - -static struct BurnDIPInfo RockmanjDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x01, NULL }, - {0x17, 0xff, 0xff, 0x00, NULL }, - - // Dip A - {0 , 0xfe, 0 , 19 , "Coinage" }, - {0x15, 0x01, 0x1f, 0x00, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x1f, 0x01, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x1f, 0x02, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x1f, 0x03, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x1f, 0x04, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x1f, 0x05, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x1f, 0x06, "1 Coin 7 Credits" }, - {0x15, 0x01, 0x1f, 0x07, "1 Coin 8 Credits" }, - {0x15, 0x01, 0x1f, 0x08, "1 Coin 9 Credits" }, - {0x15, 0x01, 0x1f, 0x09, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0a, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0b, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0c, "5 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0d, "6 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0e, "7 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x0f, "8 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x10, "9 Coins 1 Credit" }, - {0x15, 0x01, 0x1f, 0x11, "2 Coins Start 1 Coin Continue"}, - {0x15, 0x01, 0x1f, 0x12, "Free Play" }, - - {0 , 0xfe, 0 , 3 , "Coin Slots" }, - {0x15, 0x01, 0x60, 0x40, "1, Common" }, - {0x15, 0x01, 0x60, 0x00, "2, Common" }, - {0x15, 0x01, 0x60, 0x20, "2, Individual" }, - - // Dip B - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x00, "Easy" }, - {0x16, 0x01, 0x03, 0x01, "Normal" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time" }, - {0x16, 0x01, 0x0c, 0x00, "100" }, - {0x16, 0x01, 0x0c, 0x04, "90" }, - {0x16, 0x01, 0x0c, 0x08, "70" }, - {0x16, 0x01, 0x0c, 0x0c, "60" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x17, 0x01, 0x01, 0x00, "Off" }, - {0x17, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x17, 0x01, 0x02, 0x02, "Off" }, - {0x17, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x04, 0x04, "Off" }, - {0x17, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x17, 0x01, 0x80, 0x00, "Game" }, - {0x17, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Rockmanj) - -static struct BurnDIPInfo MercsDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x03, NULL }, - {0x1d, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_2(0x1b) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x1b, 0x01, 0x40, 0x00, "Off" }, - {0x1b, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x1c) - - {0 , 0xfe, 0 , 2 , "Coin Slots" }, - {0x1c, 0x01, 0x08, 0x08, "1" }, - {0x1c, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Play Mode" }, - {0x1c, 0x01, 0x10, 0x10, "2 Player" }, - {0x1c, 0x01, 0x10, 0x00, "3 Player" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x1d, 0x01, 0x40, 0x00, "Off" }, - {0x1d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x1d, 0x01, 0x80, 0x00, "Off" }, - {0x1d, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Mercs) - -static struct BurnDIPInfo MswordDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x03, NULL }, - {0x17, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x15) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - // Dip B - {0 , 0xfe, 0 , 8 , "Players vitality consumption"}, - {0x16, 0x01, 0x07, 0x00, "1 (Easiest)" }, - {0x16, 0x01, 0x07, 0x01, "2" }, - {0x16, 0x01, 0x07, 0x02, "3" }, - {0x16, 0x01, 0x07, 0x03, "4 (Normal)" }, - {0x16, 0x01, 0x07, 0x04, "5" }, - {0x16, 0x01, 0x07, 0x05, "6" }, - {0x16, 0x01, 0x07, 0x06, "7" }, - {0x16, 0x01, 0x07, 0x07, "8 (Hardest)" }, - - {0 , 0xfe, 0 , 8 , "Level 2" }, - {0x16, 0x01, 0x38, 0x18, "1 (Easiest)" }, - {0x16, 0x01, 0x38, 0x10, "2" }, - {0x16, 0x01, 0x38, 0x08, "3" }, - {0x16, 0x01, 0x38, 0x00, "4 (Normal)" }, - {0x16, 0x01, 0x38, 0x20, "5" }, - {0x16, 0x01, 0x38, 0x28, "6" }, - {0x16, 0x01, 0x38, 0x30, "7" }, - {0x16, 0x01, 0x38, 0x38, "8 (Hardest)" }, - - {0 , 0xfe, 0 , 2 , "Stage Select" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Vitality" }, - {0x17, 0x01, 0x03, 0x03, "1" }, - {0x17, 0x01, 0x03, 0x00, "2" }, - {0x17, 0x01, 0x03, 0x01, "3 (2 when continue)" }, - {0x17, 0x01, 0x03, 0x02, "4 (3 when continue)" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x17, 0x01, 0x04, 0x00, "Off" }, - {0x17, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x17, 0x01, 0x08, 0x00, "Off" }, - {0x17, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x17, 0x01, 0x10, 0x00, "Off" }, - {0x17, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x17, 0x01, 0x20, 0x00, "Off" }, - {0x17, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x17, 0x01, 0x80, 0x00, "Game" }, - {0x17, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Msword) - -static struct BurnDIPInfo MtwinsDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x03, NULL }, - {0x17, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x15) - - // Dip B - CPS1_DIFFICULTY_1(0x16) - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x38, 0x28, "1" }, - {0x16, 0x01, 0x38, 0x20, "2" }, - {0x16, 0x01, 0x38, 0x30, "3" }, - {0x16, 0x01, 0x38, 0x38, "4" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x17, 0x01, 0x04, 0x00, "Off" }, - {0x17, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x17, 0x01, 0x08, 0x00, "Off" }, - {0x17, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x17, 0x01, 0x10, 0x00, "Off" }, - {0x17, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x17, 0x01, 0x20, 0x00, "Off" }, - {0x17, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x17, 0x01, 0x80, 0x00, "Game" }, - {0x17, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Mtwins) - -static struct BurnDIPInfo NemoDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x03, NULL }, - {0x17, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x15) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x16) - - {0 , 0xfe, 0 , 3 , "Life Bar" }, - {0x16, 0x01, 0x18, 0x18, "Minimum" }, - {0x16, 0x01, 0x18, 0x00, "Medium" }, - {0x16, 0x01, 0x18, 0x10, "Maximum" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x17, 0x01, 0x03, 0x01, "1" }, - {0x17, 0x01, 0x03, 0x00, "2" }, - {0x17, 0x01, 0x03, 0x02, "3" }, - {0x17, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x17, 0x01, 0x04, 0x00, "Off" }, - {0x17, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x17, 0x01, 0x08, 0x00, "Off" }, - {0x17, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x17, 0x01, 0x10, 0x00, "Off" }, - {0x17, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x17, 0x01, 0x20, 0x00, "Off" }, - {0x17, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x17, 0x01, 0x80, 0x00, "Game" }, - {0x17, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Nemo) - -static struct BurnDIPInfo Pang3DIPList[]= -{ - // Defaults - {0x13, 0xff, 0xff, 0x00, NULL }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, -}; - -STDDIPINFO(Pang3) - -static struct BurnDIPInfo PnickjDIPList[]= -{ - // Defaults - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x03, NULL }, - {0x15, 0xff, 0xff, 0x20, NULL }, - - // Dip A - CPS1_COINAGE_2(0x13) - - {0 , 0xfe, 0 , 2 , "Coin Slots" }, - {0x13, 0x01, 0x08, 0x00, "1" }, - {0x13, 0x01, 0x08, 0x08, "2" }, - - // Dip B - CPS1_DIFFICULTY_1(0x14) - - {0 , 0xfe, 0 , 4 , "Vs. Play Mode" }, - {0x14, 0x01, 0xc0, 0x00, "1 Game Match" }, - {0x14, 0x01, 0xc0, 0x40, "3 Games Match" }, - {0x14, 0x01, 0xc0, 0x80, "5 Games Match" }, - {0x14, 0x01, 0xc0, 0xc0, "7 Games Match" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x15, 0x01, 0x10, 0x00, "Off" }, - {0x15, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x15, 0x01, 0x80, 0x00, "Game" }, - {0x15, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Pnickj) - -static struct BurnDIPInfo PokonyanDIPList[]= -{ - // Defaults - {0x14, 0xff, 0xff, 0x41, NULL }, - {0x15, 0xff, 0xff, 0x04, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x14, 0x01, 0x03, 0x03, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x03, 0x02, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x03, 0x00, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x03, 0x01, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Controls" }, - {0x14, 0x01, 0x40, 0x40, "Digital" }, - {0x14, 0x01, 0x40, 0x00, "Wheel" }, // I assume this enables the wheel as the directions don't work (and the left/right input check just flashes) - not worked out to hook the wheel up yet though - - // Dip B - {0 , 0xfe, 0 , 4 , "Demo Sounds" }, - {0x15, 0x01, 0x03, 0x03, "Off" }, - {0x15, 0x01, 0x03, 0x02, "Every 4" }, - {0x15, 0x01, 0x03, 0x01, "Every 2" }, - {0x15, 0x01, 0x03, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Prize Mode" }, - {0x15, 0x01, 0x04, 0x04, "Not Used" }, - {0x15, 0x01, 0x04, 0x00, "Used" }, - - {0 , 0xfe, 0 , 2 , "Credit Mode" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Max Stage" }, - {0x15, 0x01, 0x10, 0x10, "2" }, - {0x15, 0x01, 0x10, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Card Check" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Unknown" }, - {0x15, 0x01, 0x80, 0x80, "1.0 sec" }, - {0x15, 0x01, 0x80, 0x00, "1.2 sec" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Body Check" }, - {0x16, 0x01, 0x02, 0x00, "Off" }, - {0x16, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Screen Stop" }, - {0x16, 0x01, 0x08, 0x00, "Off" }, - {0x16, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x16, 0x01, 0x10, 0x00, "Off" }, - {0x16, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x16, 0x01, 0x80, 0x00, "Game" }, - {0x16, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Pokonyan) - -static struct BurnDIPInfo PunisherDIPList[]= -{ - // Defaults - {0x13, 0xff, 0xff, 0x00, NULL }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, -}; - -STDDIPINFO(Punisher) - -static struct BurnDIPInfo PunisherbzDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x10, NULL }, - {0x16, 0xff, 0xff, 0x6B, NULL }, - - // Dip A - CPS1_COINAGE_2(0x15) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x30, 0x00, "1" }, - {0x15, 0x01, 0x30, 0x10, "2" }, - {0x15, 0x01, 0x30, 0x20, "3" }, - {0x15, 0x01, 0x30, 0x30, "4" }, - - {0 , 0xfe, 0 , 2 , "Sound" }, - {0x15, 0x01, 0x40, 0x00, "Q Sound" }, - {0x15, 0x01, 0x40, 0x40, "Monaural" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, - - // Dip B - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x16, 0x01, 0x07, 0x00, "0 (Easiest)" }, - {0x16, 0x01, 0x07, 0x01, "1" }, - {0x16, 0x01, 0x07, 0x02, "2" }, - {0x16, 0x01, 0x07, 0x03, "3 (Normal)" }, - {0x16, 0x01, 0x07, 0x04, "4" }, - {0x16, 0x01, 0x07, 0x05, "5" }, - {0x16, 0x01, 0x07, 0x06, "6" }, - {0x16, 0x01, 0x07, 0x07, "7 (Hardest)" }, - - {0 , 0xfe, 0 , 4 , "Extend" }, - {0x16, 0x01, 0x18, 0x00, "800000" }, - {0x16, 0x01, 0x18, 0x08, "1800000" }, - {0x16, 0x01, 0x18, 0x10, "2800000" }, - {0x16, 0x01, 0x18, 0x18, "No Extend" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x20, 0x00, "Off" }, - {0x16, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Punisherbz) - -static struct BurnDIPInfo QadDIPList[]= -{ - // Defaults - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x0b, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - // Dip A - CPS1_COINAGE_2(0x0f) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - // Dip B - {0 , 0xfe, 0 , 5 , "Difficulty" }, - {0x10, 0x01, 0x07, 0x01, "Easiest" }, - {0x10, 0x01, 0x07, 0x02, "Easy" }, - {0x10, 0x01, 0x07, 0x03, "Normal" }, - {0x10, 0x01, 0x07, 0x04, "Hard" }, - {0x10, 0x01, 0x07, 0x05, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Wisdom of Enemy" }, - {0x10, 0x01, 0x18, 0x00, "Easy" }, - {0x10, 0x01, 0x18, 0x08, "Normal" }, - {0x10, 0x01, 0x18, 0x10, "Hard" }, - {0x10, 0x01, 0x18, 0x18, "Hardest" }, - - {0 , 0xfe, 0 , 5 , "Lives" }, - {0x10, 0x01, 0xe0, 0x80, "1" }, - {0x10, 0x01, 0xe0, 0x60, "2" }, - {0x10, 0x01, 0xe0, 0x40, "3" }, - {0x10, 0x01, 0xe0, 0x20, "4" }, - {0x10, 0x01, 0xe0, 0x00, "5" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x11, 0x01, 0x04, 0x00, "Off" }, - {0x11, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x11, 0x01, 0x80, 0x00, "Game" }, - {0x11, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Qad) - -static struct BurnDIPInfo QadjrDIPList[]= -{ - // Defaults - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x20, NULL }, - - // Dip A - CPS1_COINAGE_2(0x0f) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - // Dip B - {0 , 0xfe, 0 , 5 , "Difficulty" }, - {0x10, 0x01, 0x07, 0x00, "0" }, - {0x10, 0x01, 0x07, 0x01, "1" }, - {0x10, 0x01, 0x07, 0x02, "2" }, - {0x10, 0x01, 0x07, 0x03, "3" }, - {0x10, 0x01, 0x07, 0x04, "4" }, - - {0 , 0xfe, 0 , 3 , "Lives" }, - {0x10, 0x01, 0xe0, 0x40, "1" }, - {0x10, 0x01, 0xe0, 0x20, "2" }, - {0x10, 0x01, 0xe0, 0x00, "3" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x11, 0x01, 0x04, 0x00, "Off" }, - {0x11, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x11, 0x01, 0x80, 0x00, "Game" }, - {0x11, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Qadjr) - -static struct BurnDIPInfo Qtono2jDIPList[]= -{ - // Defaults - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x03, NULL }, - {0x11, 0xff, 0xff, 0x20, NULL }, - - // Dip A - CPS1_COINAGE_2(0x0f) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x10) - - {0 , 0xfe, 0 , 5 , "Lives" }, - {0x10, 0x01, 0xe0, 0x80, "1" }, - {0x10, 0x01, 0xe0, 0x60, "2" }, - {0x10, 0x01, 0xe0, 0x00, "3" }, - {0x10, 0x01, 0xe0, 0x40, "4" }, - {0x10, 0x01, 0xe0, 0x20, "5" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Infinite Lives" }, - {0x11, 0x01, 0x02, 0x00, "Off" }, - {0x11, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x11, 0x01, 0x04, 0x00, "Off" }, - {0x11, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x11, 0x01, 0x80, 0x00, "Game" }, - {0x11, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Qtono2j) - -static struct BurnDIPInfo Sf2DIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x03, NULL }, - {0x1d, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x1b) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x1b, 0x01, 0x40, 0x00, "Off" }, - {0x1b, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x1c) - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x1d, 0x01, 0x04, 0x00, "Off" }, - {0x1d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x1d, 0x01, 0x40, 0x00, "Off" }, - {0x1d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x1d, 0x01, 0x80, 0x00, "Game" }, - {0x1d, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Sf2) - -static struct BurnDIPInfo Sf2amfDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x03, NULL }, - {0x1d, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x1b) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x1b, 0x01, 0x40, 0x00, "Off" }, - {0x1b, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x1c) - - {0 , 0xfe, 0 , 2 , "Turbo Mode" }, - {0x1c, 0x01, 0x38, 0x00, "Off" }, - {0x1c, 0x01, 0x38, 0x38, "On" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x1d, 0x01, 0x04, 0x00, "Off" }, - {0x1d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x1d, 0x01, 0x40, 0x00, "Off" }, - {0x1d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x1d, 0x01, 0x80, 0x00, "Game" }, - {0x1d, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Sf2amf) - -static struct BurnDIPInfo Sf2jDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x03, NULL }, - {0x1d, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x1b) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x1b, 0x01, 0x40, 0x00, "Off" }, - {0x1b, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x1c) - - {0 , 0xfe, 0 , 2 , "2 Players Game" }, - {0x1c, 0x01, 0x08, 0x00, "1 Credit/No Continue" }, - {0x1c, 0x01, 0x08, 0x08, "2 Credits/Winner Continue"}, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x1d, 0x01, 0x04, 0x00, "Off" }, - {0x1d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x1d, 0x01, 0x40, 0x00, "Off" }, - {0x1d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x1d, 0x01, 0x80, 0x00, "Game" }, - {0x1d, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Sf2j) - -static struct BurnDIPInfo Sf2bhhDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x03, NULL }, - {0x1d, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x1b) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x1b, 0x01, 0x40, 0x00, "Off" }, - {0x1b, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x1c) - - // Dip C - {0 , 0xfe, 0 , 2 , "Speed" }, - {0x1d, 0x01, 0x01, 0x00, "Normal" }, - {0x1d, 0x01, 0x01, 0x01, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x1d, 0x01, 0x04, 0x00, "Off" }, - {0x1d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x1d, 0x01, 0x40, 0x00, "Off" }, - {0x1d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x1d, 0x01, 0x80, 0x00, "Game" }, - {0x1d, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Sf2bhh) - -static struct BurnDIPInfo Sf2megaDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x13, NULL }, // 0x10 high to boot - {0x1d, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x1b) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x1b, 0x01, 0x40, 0x00, "Off" }, - {0x1b, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x1c) - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x1d, 0x01, 0x04, 0x00, "Off" }, - {0x1d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1d, 0x01, 0x08, 0x00, "Off" }, - {0x1d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x1d, 0x01, 0x40, 0x00, "Off" }, - {0x1d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x1d, 0x01, 0x80, 0x00, "Game" }, - {0x1d, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Sf2mega) - -static struct BurnDIPInfo SlammastDIPList[]= -{ - // Defaults - {0x23, 0xff, 0xff, 0x00, NULL }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x23, 0x01, 0x08, 0x08, "Off" }, - {0x23, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Slammast) - -static struct BurnDIPInfo StriderDIPList[]= -{ - // Defaults - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - // Dip A - CPS1_COINAGE_1(0x14) - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x14, 0x01, 0xc0, 0x00, "Upright 1P" }, - {0x14, 0x01, 0xc0, 0x40, "Upright 2P" }, - {0x14, 0x01, 0xc0, 0xc0, "Cocktail" }, - - // Dip B - CPS1_DIFFICULTY_2(0x15) - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x30, 0x00, "20k, 40k and every 60k" }, - {0x15, 0x01, 0x30, 0x10, "30k, 50k and every 70k" }, - {0x15, 0x01, 0x30, 0x20, "20k & 60k only" }, - {0x15, 0x01, 0x30, 0x30, "30k & 60k only" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x03, 0x03, "2" }, - {0x16, 0x01, 0x03, 0x00, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x02, "5" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x16, 0x01, 0x08, 0x00, "Off" }, - {0x16, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x16, 0x01, 0x10, 0x00, "Off" }, - {0x16, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Sound" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x16, 0x01, 0x80, 0x00, "Game" }, - {0x16, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Strider) - -static struct BurnDIPInfo StrideruaDIPList[]= -{ - // Defaults - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - // Dip A - CPS1_COINAGE_1(0x14) - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x14, 0x01, 0xc0, 0x00, "Upright 1P" }, - {0x14, 0x01, 0xc0, 0x40, "Upright 2P" }, - {0x14, 0x01, 0xc0, 0xc0, "Cocktail" }, - - // Dip B - CPS1_DIFFICULTY_2(0x15) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x30, 0x00, "20k, 40k and every 60k" }, - {0x15, 0x01, 0x30, 0x10, "30k, 50k and every 70k" }, - {0x15, 0x01, 0x30, 0x20, "20k & 60k only" }, - {0x15, 0x01, 0x30, 0x30, "30k & 60k only" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x03, 0x03, "2" }, - {0x16, 0x01, 0x03, 0x00, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x02, "5" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x16, 0x01, 0x08, 0x00, "Off" }, - {0x16, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x16, 0x01, 0x10, 0x00, "Off" }, - {0x16, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Sound" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x16, 0x01, 0x80, 0x00, "Game" }, - {0x16, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Striderua) - -static struct BurnDIPInfo UnsquadDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x03, NULL }, - {0x17, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_3(0x15) - - // Dip B - CPS1_DIFFICULTY_1(0x16) - - {0 , 0xfe, 0 , 4 , "Damage" }, - {0x16, 0x01, 0x18, 0x08, "Small" }, - {0x16, 0x01, 0x18, 0x00, "Normal" }, - {0x16, 0x01, 0x18, 0x10, "Big" }, - {0x16, 0x01, 0x18, 0x18, "Biggest" }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x17, 0x01, 0x04, 0x00, "Off" }, - {0x17, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x17, 0x01, 0x08, 0x00, "Off" }, - {0x17, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip" }, - {0x17, 0x01, 0x10, 0x00, "Off" }, - {0x17, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x17, 0x01, 0x20, 0x00, "Off" }, - {0x17, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x17, 0x01, 0x80, 0x00, "Game" }, - {0x17, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Unsquad) - -static struct BurnDIPInfo VarthDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x0b, NULL }, - {0x17, 0xff, 0xff, 0x60, NULL }, - - // Dip A - CPS1_COINAGE_1(0x15) - - {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - // Dip B - CPS1_DIFFICULTY_1(0x16) - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0x18, 0x00, "600k and every 1400k" }, - {0x16, 0x01, 0x18, 0x08, "600k, 2000k and every 4500k"}, - {0x16, 0x01, 0x18, 0x10, "1200k, 3500k" }, - {0x16, 0x01, 0x18, 0x18, "2000k only" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x17, 0x01, 0x03, 0x01, "1" }, - {0x17, 0x01, 0x03, 0x02, "2" }, - {0x17, 0x01, 0x03, 0x00, "3" }, - {0x17, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x17, 0x01, 0x04, 0x00, "Off" }, - {0x17, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x17, 0x01, 0x08, 0x00, "Off" }, - {0x17, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x17, 0x01, 0x10, 0x00, "Off" }, - {0x17, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x17, 0x01, 0x20, 0x00, "Off" }, - {0x17, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x17, 0x01, 0x80, 0x00, "Game" }, - {0x17, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Varth) - -static struct BurnDIPInfo WillowDIPList[]= -{ - // Defaults - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x00, NULL }, - - // Dip A - CPS1_COINAGE_3(0x15) - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x15, 0x01, 0xc0, 0x00, "Upright 1P" }, - {0x15, 0x01, 0xc0, 0x40, "Upright 2P" }, - {0x15, 0x01, 0xc0, 0xc0, "Cocktail" }, - - // Dip B - CPS1_DIFFICULTY_2(0x16) - - {0 , 0xfe, 0 , 4 , "Nando Speed" }, - {0x16, 0x01, 0x18, 0x08, "Slow" }, - {0x16, 0x01, 0x18, 0x00, "Normal" }, - {0x16, 0x01, 0x18, 0x10, "Fast" }, - {0x16, 0x01, 0x18, 0x18, "Very Fast" }, - - {0 , 0xfe, 0 , 2 , "Stage Magic Continue" }, - {0x16, 0x01, 0x80, 0x00, "Off" }, - {0x16, 0x01, 0x80, 0x80, "On" }, - - // Dip C - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x17, 0x01, 0x03, 0x01, "1" }, - {0x17, 0x01, 0x03, 0x00, "2" }, - {0x17, 0x01, 0x03, 0x02, "3" }, - {0x17, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 4 , "Vitality" }, - {0x17, 0x01, 0x0c, 0x0c, "2" }, - {0x17, 0x01, 0x0c, 0x00, "3" }, - {0x17, 0x01, 0x0c, 0x04, "4" }, - {0x17, 0x01, 0x0c, 0x08, "5" }, - - {0 , 0xfe, 0 , 2 , "Screen" }, - {0x17, 0x01, 0x10, 0x00, "Off" }, - {0x17, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x17, 0x01, 0x20, 0x20, "Off" }, - {0x17, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x17, 0x01, 0x80, 0x00, "Game" }, - {0x17, 0x01, 0x80, 0x80, "Test" }, -}; - -STDDIPINFO(Willow) - -static struct BurnDIPInfo WofDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - - // Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1b, 0x01, 0x08, 0x08, "Off" }, - {0x1b, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Wof) - -static struct BurnDIPInfo WofhfhDIPList[]= -{ - // Defaults - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x13, NULL }, - {0x1d, 0xff, 0xff, 0x00, NULL }, - - // Dip A - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x1b, 0x01, 0x03, 0x00, "1 Coin 1 Credit" }, - {0x1b, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0x03, 0x03, "1 Coin 4 Credits" }, - - // Dip B - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x1c, 0x01, 0x07, 0x00, "Extra Easy" }, - {0x1c, 0x01, 0x07, 0x01, "Very Easy" }, - {0x1c, 0x01, 0x07, 0x02, "Easy" }, - {0x1c, 0x01, 0x07, 0x03, "Normal" }, - {0x1c, 0x01, 0x07, 0x04, "Hard" }, - {0x1c, 0x01, 0x07, 0x05, "Very Hard" }, - {0x1c, 0x01, 0x07, 0x06, "Extra Hard" }, - {0x1c, 0x01, 0x07, 0x07, "Hardest" }, - - {0 , 0xfe, 0 , 8 , "Lives" }, - {0x1c, 0x01, 0x70, 0x70, "Start 4 Continue 5" }, - {0x1c, 0x01, 0x70, 0x60, "Start 3 Continue 4" }, - {0x1c, 0x01, 0x70, 0x50, "Start 2 Continue 3" }, - {0x1c, 0x01, 0x70, 0x40, "Start 1 Continue 2" }, - {0x1c, 0x01, 0x70, 0x30, "Start 4 Continue 4" }, - {0x1c, 0x01, 0x70, 0x20, "Start 3 Continue 3" }, - {0x1c, 0x01, 0x70, 0x10, "Start 2 Continue 2" }, - {0x1c, 0x01, 0x70, 0x00, "Start 1 Continue 1" }, - - // Dip C - {0 , 0xfe, 0 , 3 , "Coin Slots" }, - {0x1d, 0x01, 0x03, 0x02, "2 Players 1 Shooter" }, - {0x1d, 0x01, 0x03, 0x01, "3 Players 1 Shooter" }, - {0x1d, 0x01, 0x03, 0x00, "3 Players 3 Shooters" }, -}; - -STDDIPINFO(Wofhfh) - -static struct BurnDIPInfo WofhDIPList[]= -{ - // Defaults - {0x1a, 0xff, 0xff, 0x00, NULL }, - {0x1b, 0xff, 0xff, 0x00, NULL }, - {0x1c, 0xff, 0xff, 0x13, NULL }, - - // Dip A - {0 , 0xfe, 0 , 3 , "Coin Slots" }, - {0x1a, 0x01, 0x03, 0x02, "2 Players 1 Shooter" }, - {0x1a, 0x01, 0x03, 0x01, "3 Players 1 Shooter" }, - {0x1a, 0x01, 0x03, 0x00, "3 Players 3 Shooters" }, - - // Dip B - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x1b, 0x01, 0x03, 0x00, "1 Coin 1 Credit" }, - {0x1b, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0x03, 0x03, "1 Coin 4 Credits" }, - - // Dip C - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x1c, 0x01, 0x07, 0x00, "Extra Easy" }, - {0x1c, 0x01, 0x07, 0x01, "Very Easy" }, - {0x1c, 0x01, 0x07, 0x02, "Easy" }, - {0x1c, 0x01, 0x07, 0x03, "Normal" }, - {0x1c, 0x01, 0x07, 0x04, "Hard" }, - {0x1c, 0x01, 0x07, 0x05, "Very Hard" }, - {0x1c, 0x01, 0x07, 0x06, "Extra Hard" }, - {0x1c, 0x01, 0x07, 0x07, "Hardest" }, - - {0 , 0xfe, 0 , 8 , "Lives" }, - {0x1c, 0x01, 0x70, 0x70, "Start 4 Continue 5" }, - {0x1c, 0x01, 0x70, 0x60, "Start 3 Continue 4" }, - {0x1c, 0x01, 0x70, 0x50, "Start 2 Continue 3" }, - {0x1c, 0x01, 0x70, 0x40, "Start 1 Continue 2" }, - {0x1c, 0x01, 0x70, 0x30, "Start 4 Continue 4" }, - {0x1c, 0x01, 0x70, 0x20, "Start 3 Continue 3" }, - {0x1c, 0x01, 0x70, 0x10, "Start 2 Continue 2" }, - {0x1c, 0x01, 0x70, 0x00, "Start 1 Continue 1" }, -}; - -STDDIPINFO(Wofh) - -static struct BurnDIPInfo Wof3jsDIPList[]= -{ - // Defaults - {0x1c, 0xff, 0xff, 0x00, NULL }, - {0x1d, 0xff, 0xff, 0x00, NULL }, - {0x1e, 0xff, 0xff, 0x00, NULL }, - - // Dip A - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x1c, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x1c, 0x01, 0x03, 0x00, "1 Coin 1 Credit" }, - {0x1c, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x1c, 0x01, 0x03, 0x03, "1 Coin 3 Credits" }, - - // Dip B - {0 , 0xfe, 0 , 2 , "Coin Slots" }, - {0x1d, 0x01, 0x01, 0x01, "3 Players 1 Shooter" }, - {0x1d, 0x01, 0x01, 0x00, "3 Players 3 Shooters" }, - - // Dip C - // not sure about difficulty (no way to test) - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x1e, 0x01, 0x07, 0x00, "Value 0" }, - {0x1e, 0x01, 0x07, 0x01, "Value 1" }, - {0x1e, 0x01, 0x07, 0x02, "Value 2" }, - {0x1e, 0x01, 0x07, 0x03, "Value 3" }, - {0x1e, 0x01, 0x07, 0x04, "Value 4" }, - {0x1e, 0x01, 0x07, 0x05, "Value 5" }, - {0x1e, 0x01, 0x07, 0x06, "Value 6" }, - {0x1e, 0x01, 0x07, 0x07, "Value 7" }, - - {0 , 0xfe, 0 , 5 , "Lives" }, - {0x1e, 0x01, 0x70, 0x40, "Start 1 Continue 1" }, - {0x1e, 0x01, 0x70, 0x30, "Start 4 Continue 3" }, - {0x1e, 0x01, 0x70, 0x20, "Start 4 Continue 4" }, - {0x1e, 0x01, 0x70, 0x10, "Start 3 Continue 3" }, - {0x1e, 0x01, 0x70, 0x00, "Start 2 Continue 2" }, -}; - -STDDIPINFO(Wof3js) - -static struct BurnDIPInfo Wof3jsaDIPList[]= -{ - // Defaults - {0x1c, 0xff, 0xff, 0x00, NULL }, - {0x1d, 0xff, 0xff, 0x00, NULL }, - {0x1e, 0xff, 0xff, 0x13, NULL }, - - // Dip A - {0 , 0xfe, 0 , 3 , "Coin Slots" }, - {0x1c, 0x01, 0x03, 0x02, "2 Players 1 Shooter" }, - {0x1c, 0x01, 0x03, 0x01, "3 Players 1 Shooter" }, - {0x1c, 0x01, 0x03, 0x00, "3 Players 3 Shooters" }, - - // Dip B - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x1d, 0x01, 0x03, 0x00, "1 Coin 1 Credit" }, - {0x1d, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x1d, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - {0x1d, 0x01, 0x03, 0x03, "1 Coin 4 Credits" }, - - // Dip C - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x1e, 0x01, 0x07, 0x00, "Extra Easy" }, - {0x1e, 0x01, 0x07, 0x01, "Very Easy" }, - {0x1e, 0x01, 0x07, 0x02, "Easy" }, - {0x1e, 0x01, 0x07, 0x03, "Normal" }, - {0x1e, 0x01, 0x07, 0x04, "Hard" }, - {0x1e, 0x01, 0x07, 0x05, "Very Hard" }, - {0x1e, 0x01, 0x07, 0x06, "Extra Hard" }, - {0x1e, 0x01, 0x07, 0x07, "Hardest" }, - - {0 , 0xfe, 0 , 8 , "Lives" }, - {0x1e, 0x01, 0x70, 0x70, "Start 4 Continue 5" }, - {0x1e, 0x01, 0x70, 0x60, "Start 3 Continue 4" }, - {0x1e, 0x01, 0x70, 0x50, "Start 2 Continue 3" }, - {0x1e, 0x01, 0x70, 0x40, "Start 1 Continue 2" }, - {0x1e, 0x01, 0x70, 0x30, "Start 4 Continue 4" }, - {0x1e, 0x01, 0x70, 0x20, "Start 3 Continue 3" }, - {0x1e, 0x01, 0x70, 0x10, "Start 2 Continue 2" }, - {0x1e, 0x01, 0x70, 0x00, "Start 1 Continue 1" }, -}; - -STDDIPINFO(Wof3jsa) - -static struct BurnDIPInfo Wof3sjDIPList[]= -{ - // Defaults - {0x1a, 0xff, 0xff, 0x00, NULL }, - {0x1b, 0xff, 0xff, 0x13, NULL }, - {0x1c, 0xff, 0xff, 0x00, NULL }, - - // Dip A - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x1a, 0x01, 0x03, 0x00, "1 Coin 1 Credit" }, - {0x1a, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x1a, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - {0x1a, 0x01, 0x03, 0x03, "1 Coin 4 Credits" }, - - // Dip B - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x1b, 0x01, 0x07, 0x00, "Extra Easy" }, - {0x1b, 0x01, 0x07, 0x01, "Very Easy" }, - {0x1b, 0x01, 0x07, 0x02, "Easy" }, - {0x1b, 0x01, 0x07, 0x03, "Normal" }, - {0x1b, 0x01, 0x07, 0x04, "Hard" }, - {0x1b, 0x01, 0x07, 0x05, "Very Hard" }, - {0x1b, 0x01, 0x07, 0x06, "Extra Hard" }, - {0x1b, 0x01, 0x07, 0x07, "Hardest" }, - - {0 , 0xfe, 0 , 8 , "Lives" }, - {0x1b, 0x01, 0x70, 0x70, "Start 4 Continue 5" }, - {0x1b, 0x01, 0x70, 0x60, "Start 3 Continue 4" }, - {0x1b, 0x01, 0x70, 0x50, "Start 2 Continue 3" }, - {0x1b, 0x01, 0x70, 0x40, "Start 1 Continue 2" }, - {0x1b, 0x01, 0x70, 0x30, "Start 4 Continue 4" }, - {0x1b, 0x01, 0x70, 0x20, "Start 3 Continue 3" }, - {0x1b, 0x01, 0x70, 0x10, "Start 2 Continue 2" }, - {0x1b, 0x01, 0x70, 0x00, "Start 1 Continue 1" }, - - // Dip C - {0 , 0xfe, 0 , 3 , "Coin Slots" }, - {0x1c, 0x01, 0x03, 0x02, "2 Players 1 Shooter" }, - {0x1c, 0x01, 0x03, 0x01, "3 Players 1 Shooter" }, - {0x1c, 0x01, 0x03, 0x00, "3 Players 3 Shooters" }, -}; - -STDDIPINFO(Wof3sj) - -// Rom Definitions - -#define A_BOARD_PLDS \ - { "buf1", 0x000117, 0xeb122de7, BRF_OPT }, \ - { "ioa1", 0x000117, 0x59c7ee3b, BRF_OPT }, \ - { "prg1", 0x000117, 0xf1129744, BRF_OPT }, \ - { "rom1", 0x000117, 0x41dc73b9, BRF_OPT }, \ - { "sou1", 0x000117, 0x84f4b2fe, BRF_OPT }, - -#define A_BOARD_QSOUND_PLDS \ - { "buf1", 0x000117, 0xeb122de7, BRF_OPT }, \ - { "ioa1", 0x000117, 0x59c7ee3b, BRF_OPT }, \ - { "prg2", 0x000117, 0x4386879a, BRF_OPT }, \ - { "rom1", 0x000117, 0x41dc73b9, BRF_OPT }, \ - -static struct BurnRomInfo NTFODrvRomDesc[] = { - { "41em_30.11f", 0x020000, 0x4249ec61, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41em_35.11h", 0x020000, 0xddbee5eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41em_31.12f", 0x020000, 0x584e88e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41em_36.12h", 0x020000, 0x3cfc31d0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41-32m.8h", 0x080000, 0x4e9648ca, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "41-5m.7a", 0x080000, 0x01d1cb11, BRF_GRA | CPS1_TILES }, - { "41-7m.9a", 0x080000, 0xaeaa3509, BRF_GRA | CPS1_TILES }, - { "41-1m.3a", 0x080000, 0xff77985a, BRF_GRA | CPS1_TILES }, - { "41-3m.5a", 0x080000, 0x983be58f, BRF_GRA | CPS1_TILES }, - - { "41_9.12b", 0x010000, 0x0f9d8527, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "41_18.11c", 0x020000, 0xd1f15aeb, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "41_19.12c", 0x020000, 0x15aec3a6, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "yi24b.1a", 0x000117, 0x3004dcdf, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(NTFODrv) -STD_ROM_FN(NTFODrv) - -static struct BurnRomInfo NTFOR1DrvRomDesc[] = { - { "41e_30.11f", 0x020000, 0x9deb1e75, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41e_35.11h", 0x020000, 0xd63942b3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41e_31.12f", 0x020000, 0xdf201112, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41e_36.12h", 0x020000, 0x816a818f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41-32m.8h", 0x080000, 0x4e9648ca, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "41-5m.7a", 0x080000, 0x01d1cb11, BRF_GRA | CPS1_TILES }, - { "41-7m.9a", 0x080000, 0xaeaa3509, BRF_GRA | CPS1_TILES }, - { "41-1m.3a", 0x080000, 0xff77985a, BRF_GRA | CPS1_TILES }, - { "41-3m.5a", 0x080000, 0x983be58f, BRF_GRA | CPS1_TILES }, - - { "41_9.12b", 0x010000, 0x0f9d8527, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "41_18.11c", 0x020000, 0xd1f15aeb, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "41_19.12c", 0x020000, 0x15aec3a6, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "yi24b.1a", 0x000117, 0x3004dcdf, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(NTFOR1Drv) -STD_ROM_FN(NTFOR1Drv) - -static struct BurnRomInfo NTFOUDrvRomDesc[] = { - { "41u_30.11f", 0x020000, 0xbe5439d0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41u_35.11h", 0x020000, 0x6ac96595, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41u_31.12f", 0x020000, 0x9811d6eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41u_36.12h", 0x020000, 0xa87e6137, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41-32m.8h", 0x080000, 0x4e9648ca, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "41-5m.7a", 0x080000, 0x01d1cb11, BRF_GRA | CPS1_TILES }, - { "41-7m.9a", 0x080000, 0xaeaa3509, BRF_GRA | CPS1_TILES }, - { "41-1m.3a", 0x080000, 0xff77985a, BRF_GRA | CPS1_TILES }, - { "41-3m.5a", 0x080000, 0x983be58f, BRF_GRA | CPS1_TILES }, - - { "41_9.12b", 0x010000, 0x0f9d8527, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "41e_18.11c", 0x020000, 0xd1f15aeb, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "41_19.12c", 0x020000, 0x15aec3a6, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "yi24b.1a", 0x000117, 0x3004dcdf, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(NTFOUDrv) -STD_ROM_FN(NTFOUDrv) - -static struct BurnRomInfo NTFOJDrvRomDesc[] = { - { "41_36.12f", 0x020000, 0x7fbd42ab, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41_42.12h", 0x020000, 0xc7781f89, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41_37.13f", 0x020000, 0xc6464b0b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41_43.13h", 0x020000, 0x440fc0b5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41_34.10f", 0x020000, 0xb5f341ec, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41_40.10h", 0x020000, 0x3979837d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41_35.11f", 0x020000, 0x95cc979a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41_41.11h", 0x020000, 0x57496819, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "41_09.4b", 0x020000, 0xbe1b6bc2, BRF_GRA | CPS1_TILES }, - { "41_01.4a", 0x020000, 0xd8946fc1, BRF_GRA | CPS1_TILES }, - { "41_13.9b", 0x020000, 0x2e06d0ec, BRF_GRA | CPS1_TILES }, - { "41_05.9a", 0x020000, 0xd8ba28e0, BRF_GRA | CPS1_TILES }, - { "41_24.5e", 0x020000, 0x5aa43cee, BRF_GRA | CPS1_TILES }, - { "41_17.5c", 0x020000, 0xbbeff902, BRF_GRA | CPS1_TILES }, - { "41_38.8h", 0x020000, 0x8889c0aa, BRF_GRA | CPS1_TILES }, - { "41_32.8f", 0x020000, 0xf0168249, BRF_GRA | CPS1_TILES }, - { "41_10.5b", 0x020000, 0xb7eb6a6d, BRF_GRA | CPS1_TILES }, - { "41_02.5a", 0x020000, 0x802e8153, BRF_GRA | CPS1_TILES }, - { "41_14.10b", 0x020000, 0x5a33f676, BRF_GRA | CPS1_TILES }, - { "41_06.10a", 0x020000, 0x4e53650b, BRF_GRA | CPS1_TILES }, - { "41_25.7e", 0x020000, 0x94add360, BRF_GRA | CPS1_TILES }, - { "41_18.7c", 0x020000, 0xa5e1c1f3, BRF_GRA | CPS1_TILES }, - { "41_39.9h", 0x020000, 0x5b5c3949, BRF_GRA | CPS1_TILES }, - { "41_33.9f", 0x020000, 0x7a31b0e2, BRF_GRA | CPS1_TILES }, - - { "41_23.13b", 0x010000, 0x0f9d8527, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "41_30.12c", 0x020000, 0xd1f15aeb, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "41_31.13c", 0x020000, 0x15aec3a6, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "yi22b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs - { "lwio.12e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(NTFOJDrv) -STD_ROM_FN(NTFOJDrv) - -static struct BurnRomInfo ThreeWondersRomDesc[] = { - { "rte_30a.11f", 0x020000, 0xef5b8b33, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_35a.11h", 0x020000, 0x7d705529, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_31a.12f", 0x020000, 0x32835e5e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_36a.12h", 0x020000, 0x7637975f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rt_28a.9f", 0x020000, 0x054137c8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rt_33a.9h", 0x020000, 0x7264cb1b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_29a.10f", 0x020000, 0xcddaa919, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_34a.10h", 0x020000, 0xed52e7e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "rt-5m.7a", 0x080000, 0x86aef804, BRF_GRA | CPS1_TILES }, - { "rt-7m.9a", 0x080000, 0x4f057110, BRF_GRA | CPS1_TILES }, - { "rt-1m.3a", 0x080000, 0x902489d0, BRF_GRA | CPS1_TILES }, - { "rt-3m.5a", 0x080000, 0xe35ce720, BRF_GRA | CPS1_TILES }, - { "rt-6m.8a", 0x080000, 0x13cb0e7c, BRF_GRA | CPS1_TILES }, - { "rt-8m.10a", 0x080000, 0x1f055014, BRF_GRA | CPS1_TILES }, - { "rt-2m.4a", 0x080000, 0xe9a034f4, BRF_GRA | CPS1_TILES }, - { "rt-4m.6a", 0x080000, 0xdf0eea8b, BRF_GRA | CPS1_TILES }, - - { "rt_9.12b", 0x010000, 0xabfca165, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "rt_18.11c", 0x020000, 0x26b211ab, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "rt_19.12c", 0x020000, 0xdbe64ad0, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "rt24b.1a", 0x000117, 0x54b85159, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(ThreeWonders) -STD_ROM_FN(ThreeWonders) - -static struct BurnRomInfo ThreeWondersr1RomDesc[] = { - { "rte_30.11f", 0x020000, 0x0d541519, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_35.11h", 0x020000, 0x73dd0e20, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_31.12f", 0x020000, 0x33e0337d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_36.12h", 0x020000, 0xa8865243, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_28.9f", 0x020000, 0x054137c8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_33.9h", 0x020000, 0x7264cb1b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_29.10f", 0x020000, 0x9a8df1e4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_34.10h", 0x020000, 0x6348a79d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "rt-5m.7a", 0x080000, 0x86aef804, BRF_GRA | CPS1_TILES }, - { "rt-7m.9a", 0x080000, 0x4f057110, BRF_GRA | CPS1_TILES }, - { "rt-1m.3a", 0x080000, 0x902489d0, BRF_GRA | CPS1_TILES }, - { "rt-3m.5a", 0x080000, 0xe35ce720, BRF_GRA | CPS1_TILES }, - { "rt-6m.8a", 0x080000, 0x13cb0e7c, BRF_GRA | CPS1_TILES }, - { "rt-8m.10a", 0x080000, 0x1f055014, BRF_GRA | CPS1_TILES }, - { "rt-2m.4a", 0x080000, 0xe9a034f4, BRF_GRA | CPS1_TILES }, - { "rt-4m.6a", 0x080000, 0xdf0eea8b, BRF_GRA | CPS1_TILES }, - - { "rt_9.12b", 0x010000, 0x7d5a77a7, BRF_PRG | CPS1_Z80_PROGRAM }, // 1 byte different from 3wonders, pcb verified - - { "rt_18.11c", 0x020000, 0xf6dc0d3d, BRF_SND | CPS1_OKIM6295_SAMPLES }, // 6 bytes different from 3wonders, pcb verified - { "rt_19.12c", 0x020000, 0xdbe64ad0, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "rt24b.1a", 0x000117, 0x54b85159, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(ThreeWondersr1) -STD_ROM_FN(ThreeWondersr1) - -static struct BurnRomInfo Wonder3uRomDesc[] = { - { "rtu_30a.11f", 0x020000, 0x0b156fd8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtu_35a.11h", 0x020000, 0x57350bf4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtu_31a.12f", 0x020000, 0x0e723fcc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtu_36a.12h", 0x020000, 0x523a45dc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rt_28a.9f", 0x020000, 0x054137c8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rt_33a.9h", 0x020000, 0x7264cb1b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtu_29a.10f", 0x020000, 0x37ba3e20, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtu_34a.10h", 0x020000, 0xf99f46c0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "rt-5m.7a", 0x080000, 0x86aef804, BRF_GRA | CPS1_TILES }, - { "rt-7m.9a", 0x080000, 0x4f057110, BRF_GRA | CPS1_TILES }, - { "rt-1m.3a", 0x080000, 0x902489d0, BRF_GRA | CPS1_TILES }, - { "rt-3m.5a", 0x080000, 0xe35ce720, BRF_GRA | CPS1_TILES }, - { "rt-6m.8a", 0x080000, 0x13cb0e7c, BRF_GRA | CPS1_TILES }, - { "rt-8m.10a", 0x080000, 0x1f055014, BRF_GRA | CPS1_TILES }, - { "rt-2m.4a", 0x080000, 0xe9a034f4, BRF_GRA | CPS1_TILES }, - { "rt-4m.6a", 0x080000, 0xdf0eea8b, BRF_GRA | CPS1_TILES }, - - { "rt_9.12b", 0x010000, 0xabfca165, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "rt_18.11c", 0x020000, 0x26b211ab, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "rt_19.12c", 0x020000, 0xdbe64ad0, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "rt24b.1a", 0x000117, 0x54b85159, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Wonder3u) -STD_ROM_FN(Wonder3u) - -static struct BurnRomInfo Wonder3RomDesc[] = { - { "rtj_36.12f", 0x020000, 0xe3741247, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtj_42.12h", 0x020000, 0xb4baa117, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtj_37.13f", 0x020000, 0xa1f677b0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtj_43.13h", 0x020000, 0x85337a47, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rt_34.10f", 0x020000, 0x054137c8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rt_40.10h", 0x020000, 0x7264cb1b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtj_35.11f", 0x020000, 0xe72f9ea3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rtj_41.11h", 0x020000, 0xa11ee998, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "rt_09.4b", 0x020000, 0x2c40e480, BRF_GRA | CPS1_TILES }, - { "rt_01.4a", 0x020000, 0x3e11f8cd, BRF_GRA | CPS1_TILES }, - { "rt_13.9b", 0x020000, 0x51009117, BRF_GRA | CPS1_TILES }, - { "rt_05.9a", 0x020000, 0x283fd470, BRF_GRA | CPS1_TILES }, - { "rt_24.5e", 0x020000, 0xee4484ce, BRF_GRA | CPS1_TILES }, - { "rt_17.5c", 0x020000, 0xe5dcddeb, BRF_GRA | CPS1_TILES }, - { "rt_38.8h", 0x020000, 0xb2940c2d, BRF_GRA | CPS1_TILES }, - { "rt_32.8f", 0x020000, 0x08e2b758, BRF_GRA | CPS1_TILES }, - { "rt_10.5b", 0x020000, 0xe3f3ff94, BRF_GRA | CPS1_TILES }, - { "rt_02.5a", 0x020000, 0xfcffd73c, BRF_GRA | CPS1_TILES }, - { "rt_14.10b", 0x020000, 0x5c546d9a, BRF_GRA | CPS1_TILES }, - { "rt_06.10a", 0x020000, 0xd9650bc4, BRF_GRA | CPS1_TILES }, - { "rt_25.7e", 0x020000, 0x11b28831, BRF_GRA | CPS1_TILES }, - { "rt_18.7c", 0x020000, 0xce1afb7c, BRF_GRA | CPS1_TILES }, - { "rt_39.9h", 0x020000, 0xea7ac9ee, BRF_GRA | CPS1_TILES }, - { "rt_33.9f", 0x020000, 0xd6a99384, BRF_GRA | CPS1_TILES }, - { "rt_11.7b", 0x020000, 0x04f3c298, BRF_GRA | CPS1_TILES }, - { "rt_03.7a", 0x020000, 0x98087e08, BRF_GRA | CPS1_TILES }, - { "rt_15.11b", 0x020000, 0xb6aba565, BRF_GRA | CPS1_TILES }, - { "rt_07.11a", 0x020000, 0xc62defa1, BRF_GRA | CPS1_TILES }, - { "rt_26.8e", 0x020000, 0x532f542e, BRF_GRA | CPS1_TILES }, - { "rt_19.8c", 0x020000, 0x1f0f72bd, BRF_GRA | CPS1_TILES }, - { "rt_28.10e", 0x020000, 0x6064e499, BRF_GRA | CPS1_TILES }, - { "rt_21.10c", 0x020000, 0x20012ddc, BRF_GRA | CPS1_TILES }, - { "rt_12.8b", 0x020000, 0xe54664cc, BRF_GRA | CPS1_TILES }, - { "rt_04.8a", 0x020000, 0x4d7b9a1a, BRF_GRA | CPS1_TILES }, - { "rt_16.12b", 0x020000, 0x37c96cfc, BRF_GRA | CPS1_TILES }, - { "rt_08.12a", 0x020000, 0x75f4975b, BRF_GRA | CPS1_TILES }, - { "rt_27.9e", 0x020000, 0xec6edc0f, BRF_GRA | CPS1_TILES }, - { "rt_20.9c", 0x020000, 0x4fe52659, BRF_GRA | CPS1_TILES }, - { "rt_29.11e", 0x020000, 0x8fa77f9f, BRF_GRA | CPS1_TILES }, - { "rt_22.11c", 0x020000, 0x228a0d4a, BRF_GRA | CPS1_TILES }, - - { "rt_23.13b", 0x010000, 0xabfca165, BRF_PRG | CPS1_Z80_PROGRAM }, -// { "rt_23.13b", 0x010000, 0x7d5a77a7, BRF_PRG | CPS1_Z80_PROGRAM }, // dumped from another board, 1 byte different, pcb verified - - { "rt_30.12c", 0x020000, 0x26b211ab, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "rt_31.13c", 0x020000, 0xdbe64ad0, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "rt22b.1a", 0x000117, 0x89560d6a, BRF_OPT }, // b-board PLDs - { "iob1.12e", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Wonder3) -STD_ROM_FN(Wonder3) - -static struct BurnRomInfo Wonder3hRomDesc[] = { - { "22.bin", 0x020000, 0xe6071884, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "26.bin", 0x020000, 0xa28447b7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "23.bin", 0x020000, 0xfd3d6509, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27.bin", 0x020000, 0x999cba3d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rt_28a.9f", 0x020000, 0x054137c8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rt_33a.9h", 0x020000, 0x7264cb1b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_29a.10f", 0x020000, 0xcddaa919, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "rte_34a.10h", 0x020000, 0xed52e7e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "16.bin", 0x040000, 0xc997bca2, BRF_GRA | CPS1_TILES }, - { "6.bin", 0x040000, 0x3eea321a, BRF_GRA | CPS1_TILES }, - { "18.bin", 0x040000, 0x98acdfd4, BRF_GRA | CPS1_TILES }, - { "8.bin", 0x040000, 0xdc9ca6f9, BRF_GRA | CPS1_TILES }, - { "12.bin", 0x040000, 0x0d8a6007, BRF_GRA | CPS1_TILES }, - { "2.bin", 0x040000, 0xd75563b9, BRF_GRA | CPS1_TILES }, - { "14.bin", 0x040000, 0x84369a28, BRF_GRA | CPS1_TILES }, - { "4.bin", 0x040000, 0xd4831578, BRF_GRA | CPS1_TILES }, - { "17.bin", 0x040000, 0x040edff5, BRF_GRA | CPS1_TILES }, - { "7.bin", 0x040000, 0xc7c0468c, BRF_GRA | CPS1_TILES }, - { "19.bin", 0x040000, 0x9fef114f, BRF_GRA | CPS1_TILES }, - { "9.bin", 0x040000, 0x48cbfba5, BRF_GRA | CPS1_TILES }, - { "13.bin", 0x040000, 0x8fc3d7d1, BRF_GRA | CPS1_TILES }, - { "3.bin", 0x040000, 0xc65e9a86, BRF_GRA | CPS1_TILES }, - { "15.bin", 0x040000, 0xf239341a, BRF_GRA | CPS1_TILES }, - { "5.bin", 0x040000, 0x947ac944, BRF_GRA | CPS1_TILES }, - - { "rt_9.12b", 0x010000, 0xabfca165, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "rt_18.11c", 0x020000, 0x26b211ab, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "rt_19.12c", 0x020000, 0xdbe64ad0, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "rt24b.1a", 0x000117, 0x54b85159, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Wonder3h) -STD_ROM_FN(Wonder3h) - -static struct BurnRomInfo Wonder3haRomDesc[] = { - { "22.bin", 0x040000, 0x8eb6b675, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "26.bin", 0x040000, 0xab2d0699, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "23.bin", 0x040000, 0x74db820f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27.bin", 0x040000, 0xc75e807b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "16.bin", 0x040000, 0xc997bca2, BRF_GRA | CPS1_TILES }, - { "6.bin", 0x040000, 0x3eea321a, BRF_GRA | CPS1_TILES }, - { "18.bin", 0x040000, 0x98acdfd4, BRF_GRA | CPS1_TILES }, - { "8.bin", 0x040000, 0xdc9ca6f9, BRF_GRA | CPS1_TILES }, - { "12.bin", 0x040000, 0x0d8a6007, BRF_GRA | CPS1_TILES }, - { "2.bin", 0x040000, 0xd75563b9, BRF_GRA | CPS1_TILES }, - { "14.bin", 0x040000, 0x84369a28, BRF_GRA | CPS1_TILES }, - { "4.bin", 0x040000, 0xd4831578, BRF_GRA | CPS1_TILES }, - { "17.bin", 0x040000, 0x040edff5, BRF_GRA | CPS1_TILES }, - { "7.bin", 0x040000, 0xc7c0468c, BRF_GRA | CPS1_TILES }, - { "19.bin", 0x040000, 0x9fef114f, BRF_GRA | CPS1_TILES }, - { "9.bin", 0x040000, 0x48cbfba5, BRF_GRA | CPS1_TILES }, - { "13.bin", 0x040000, 0x8fc3d7d1, BRF_GRA | CPS1_TILES }, - { "3.bin", 0x040000, 0xc65e9a86, BRF_GRA | CPS1_TILES }, - { "15.bin", 0x040000, 0xf239341a, BRF_GRA | CPS1_TILES }, - { "5.bin", 0x040000, 0x947ac944, BRF_GRA | CPS1_TILES }, - - { "rt_9.12b", 0x010000, 0xabfca165, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "rt_18.11c", 0x020000, 0x26b211ab, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "rt_19.12c", 0x020000, 0xdbe64ad0, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "rt24b.1a", 0x000117, 0x54b85159, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Wonder3ha) -STD_ROM_FN(Wonder3ha) - -static struct BurnRomInfo Wonder3bRomDesc[] = { - { "274001.4", 0x080000, 0x47887cf3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "274001.3", 0x080000, 0xe79eacb3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "274001.12", 0x080000, 0x47cf8dfb, BRF_GRA | CPS1_TILES }, - { "274001.10", 0x080000, 0xa0d27605, BRF_GRA | CPS1_TILES }, - { "274001.11", 0x080000, 0x8112bbb4, BRF_GRA | CPS1_TILES }, - { "274001.9", 0x080000, 0xcb73759d, BRF_GRA | CPS1_TILES }, - { "274001.8", 0x080000, 0x3bc2ef5e, BRF_GRA | CPS1_TILES }, - { "274001.6", 0x080000, 0x312d790c, BRF_GRA | CPS1_TILES }, - { "274001.7", 0x080000, 0x58307167, BRF_GRA | CPS1_TILES }, - { "274001.5", 0x080000, 0x3f765ae8, BRF_GRA | CPS1_TILES }, - - { "27512.2", 0x010000, 0xabfca165, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "27020.1", 0x040000, 0x3c4348cf, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wonder3b) -STD_ROM_FN(Wonder3b) - -static struct BurnRomInfo CaptcommRomDesc[] = { - { "cce_23f.8f", 0x080000, 0x42c814c5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cc_22f.7f", 0x080000, 0x0fd34195, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cc_24f.9e", 0x020000, 0x3a794f25, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cc_28f.9f", 0x020000, 0xfc3c2906, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "cc-5m.3a", 0x080000, 0x7261d8ba, BRF_GRA | CPS1_TILES }, - { "cc-7m.5a", 0x080000, 0x6a60f949, BRF_GRA | CPS1_TILES }, - { "cc-1m.4a", 0x080000, 0x00637302, BRF_GRA | CPS1_TILES }, - { "cc-3m.6a", 0x080000, 0xcc87cf61, BRF_GRA | CPS1_TILES }, - { "cc-6m.7a", 0x080000, 0x28718bed, BRF_GRA | CPS1_TILES }, - { "cc-8m.9a", 0x080000, 0xd4acc53a, BRF_GRA | CPS1_TILES }, - { "cc-2m.8a", 0x080000, 0x0c69f151, BRF_GRA | CPS1_TILES }, - { "cc-4m.10a", 0x080000, 0x1f9ebb97, BRF_GRA | CPS1_TILES }, - - { "cc_09.11a", 0x010000, 0x698e8b58, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cc_18.11c", 0x020000, 0x6de2c2db, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "cc_19.12c", 0x020000, 0xb99091ae, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cc63b.1a", 0x000117, 0xcae8f0f9, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ccprg1.11d", 0x000117, 0xe1c225c4, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632b.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Captcomm) -STD_ROM_FN(Captcomm) - -static struct BurnRomInfo Captcommr1RomDesc[] = { - { "cce_23d.8f", 0x080000, 0x19c58ece, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cc_22d.7f", 0x080000, 0xa91949b7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cc_24d.9e", 0x020000, 0x680e543f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cc_28d.9f", 0x020000, 0x8820039f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "cc-5m.3a", 0x080000, 0x7261d8ba, BRF_GRA | CPS1_TILES }, - { "cc-7m.5a", 0x080000, 0x6a60f949, BRF_GRA | CPS1_TILES }, - { "cc-1m.4a", 0x080000, 0x00637302, BRF_GRA | CPS1_TILES }, - { "cc-3m.6a", 0x080000, 0xcc87cf61, BRF_GRA | CPS1_TILES }, - { "cc-6m.7a", 0x080000, 0x28718bed, BRF_GRA | CPS1_TILES }, - { "cc-8m.9a", 0x080000, 0xd4acc53a, BRF_GRA | CPS1_TILES }, - { "cc-2m.8a", 0x080000, 0x0c69f151, BRF_GRA | CPS1_TILES }, - { "cc-4m.10a", 0x080000, 0x1f9ebb97, BRF_GRA | CPS1_TILES }, - - { "cc_09.11a", 0x010000, 0x698e8b58, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cc_18.11c", 0x020000, 0x6de2c2db, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "cc_19.12c", 0x020000, 0xb99091ae, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cc63b.1a", 0x000117, 0xcae8f0f9, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ccprg.11d", 0x000117, 0xe1c225c4, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Captcommr1) -STD_ROM_FN(Captcommr1) - -static struct BurnRomInfo CaptcommuRomDesc[] = { - { "ccu_23b.8f", 0x080000, 0x03da44fd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "ccu_22c.7f", 0x080000, 0x9b82a052, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "ccu_24b.9e", 0x020000, 0x84ff99b2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ccu_28b.9f", 0x020000, 0xfbcec223, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "cc-5m.3a", 0x080000, 0x7261d8ba, BRF_GRA | CPS1_TILES }, - { "cc-7m.5a", 0x080000, 0x6a60f949, BRF_GRA | CPS1_TILES }, - { "cc-1m.4a", 0x080000, 0x00637302, BRF_GRA | CPS1_TILES }, - { "cc-3m.6a", 0x080000, 0xcc87cf61, BRF_GRA | CPS1_TILES }, - { "cc-6m.7a", 0x080000, 0x28718bed, BRF_GRA | CPS1_TILES }, - { "cc-8m.9a", 0x080000, 0xd4acc53a, BRF_GRA | CPS1_TILES }, - { "cc-2m.8a", 0x080000, 0x0c69f151, BRF_GRA | CPS1_TILES }, - { "cc-4m.10a", 0x080000, 0x1f9ebb97, BRF_GRA | CPS1_TILES }, - - { "ccu_09.11a", 0x010000, 0x698e8b58, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ccu_18.11c", 0x020000, 0x6de2c2db, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ccu_19.12c", 0x020000, 0xb99091ae, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cc63b.1a", 0x000117, 0xcae8f0f9, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ccprg1.11d", 0x000117, 0xe1c225c4, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Captcommu) -STD_ROM_FN(Captcommu) - -static struct BurnRomInfo CaptcommjRomDesc[] = { - { "ccj_23f.8f", 0x080000, 0x5b482b62, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "ccj_22f.7f", 0x080000, 0x0fd34195, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "ccj_24f.9e", 0x020000, 0x3a794f25, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ccj_28f.9f", 0x020000, 0xfc3c2906, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "cc_01.3a", 0x080000, 0x7261d8ba, BRF_GRA | CPS1_TILES }, - { "cc_02.4a", 0x080000, 0x6a60f949, BRF_GRA | CPS1_TILES }, - { "cc_03.5a", 0x080000, 0x00637302, BRF_GRA | CPS1_TILES }, - { "cc_04.6a", 0x080000, 0xcc87cf61, BRF_GRA | CPS1_TILES }, - { "cc_05.7a", 0x080000, 0x28718bed, BRF_GRA | CPS1_TILES }, - { "cc_06.8a", 0x080000, 0xd4acc53a, BRF_GRA | CPS1_TILES }, - { "cc_07.9a", 0x080000, 0x0c69f151, BRF_GRA | CPS1_TILES }, - { "cc_08.10a", 0x080000, 0x1f9ebb97, BRF_GRA | CPS1_TILES }, - - { "ccj_09.12a", 0x010000, 0x698e8b58, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ccj_18.11c", 0x020000, 0x6de2c2db, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ccj_19.12c", 0x020000, 0xb99091ae, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cc63b.1a", 0x000117, 0xcae8f0f9, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ccprg1.11d", 0x000117, 0xe1c225c4, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632b.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Captcommj) -STD_ROM_FN(Captcommj) - -static struct BurnRomInfo Captcommjr1RomDesc[] = { - { "ccj_23b.8f", 0x080000, 0xe2a2d80e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "ccj_22c.7f", 0x080000, 0x9b82a052, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "ccj_24b.9e", 0x020000, 0x84ff99b2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ccj_28b.9f", 0x020000, 0xfbcec223, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "cc_01.3a", 0x080000, 0x7261d8ba, BRF_GRA | CPS1_TILES }, - { "cc_02.4a", 0x080000, 0x6a60f949, BRF_GRA | CPS1_TILES }, - { "cc_03.5a", 0x080000, 0x00637302, BRF_GRA | CPS1_TILES }, - { "cc_04.6a", 0x080000, 0xcc87cf61, BRF_GRA | CPS1_TILES }, - { "cc_05.7a", 0x080000, 0x28718bed, BRF_GRA | CPS1_TILES }, - { "cc_06.8a", 0x080000, 0xd4acc53a, BRF_GRA | CPS1_TILES }, - { "cc_07.9a", 0x080000, 0x0c69f151, BRF_GRA | CPS1_TILES }, - { "cc_08.10a", 0x080000, 0x1f9ebb97, BRF_GRA | CPS1_TILES }, - - { "ccj_09.12a", 0x010000, 0x698e8b58, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ccj_18.11c", 0x020000, 0x6de2c2db, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ccj_19.12c", 0x020000, 0xb99091ae, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cc63b.1a", 0x000117, 0xcae8f0f9, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ccprg.11d", 0x000117, 0xe1c225c4, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Captcommjr1) -STD_ROM_FN(Captcommjr1) - -static struct BurnRomInfo CaptcommbRomDesc[] = { - { "25.bin", 0x080000, 0xcb71ed7a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27.bin", 0x080000, 0x47cb2e87, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "24.bin", 0x040000, 0x79794279, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "26.bin", 0x040000, 0xb01077ba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "c91e-01.bin", 0x100000, 0xf863071c, BRF_GRA | CPS1_TILES }, - { "c91e-02.bin", 0x100000, 0x4b03c308, BRF_GRA | CPS1_TILES }, - { "c91e-03.bin", 0x100000, 0x3383ea96, BRF_GRA | CPS1_TILES }, - { "c91e-04.bin", 0x100000, 0xb8e1f4cf, BRF_GRA | CPS1_TILES }, - - { "l.bin", 0x010000, 0x698e8b58, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "c91e-05.bin", 0x040000, 0x096115fb, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Captcommb) -STD_ROM_FN(Captcommb) - -static struct BurnRomInfo Captcommb2RomDesc[] = { - { "5.bin", 0x080000, 0xc3a6ed28, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.bin", 0x080000, 0x28729335, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "3.bin", 0x040000, 0x1b526d73, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.bin", 0x040000, 0x73c99709, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "cap.bin", 0x080000, 0x7261d8ba, BRF_GRA | CPS1_TILES }, - { "cbp.bin", 0x080000, 0x6a60f949, BRF_GRA | CPS1_TILES }, - { "ccp.bin", 0x080000, 0x00637302, BRF_GRA | CPS1_TILES }, - { "cdp.bin", 0x080000, 0xcc87cf61, BRF_GRA | CPS1_TILES }, - { "cai.bin", 0x080000, 0x28718bed, BRF_GRA | CPS1_TILES }, - { "cbi.bin", 0x080000, 0xd4acc53a, BRF_GRA | CPS1_TILES }, - { "cci.bin", 0x080000, 0x0c69f151, BRF_GRA | CPS1_TILES }, - { "cdi.bin", 0x080000, 0x1f9ebb97, BRF_GRA | CPS1_TILES }, - - { "1.bin", 0x040000, 0xaed2f4bd, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Captcommb2) -STD_ROM_FN(Captcommb2) - -static struct BurnRomInfo CawingRomDesc[] = { - { "cae_30a.11f", 0x020000, 0x91fceacd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cae_35a.11h", 0x020000, 0x3ef03083, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cae_31a.12f", 0x020000, 0xe5b75caf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cae_36a.12h", 0x020000, 0xc73fd713, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ca-32m.8h", 0x080000, 0x0c4837d4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ca-5m.7a", 0x080000, 0x66d4cc37, BRF_GRA | CPS1_TILES }, - { "ca-7m.9a", 0x080000, 0xb6f896f2, BRF_GRA | CPS1_TILES }, - { "ca-1m.3a", 0x080000, 0x4d0620fd, BRF_GRA | CPS1_TILES }, - { "ca-3m.5a", 0x080000, 0x0b0341c3, BRF_GRA | CPS1_TILES }, - - { "ca_9.12b", 0x010000, 0x96fe7485, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ca_18.11c", 0x020000, 0x4a613a2c, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ca_19.12c", 0x020000, 0x74584493, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ca24b.1a", 0x000117, 0x76ec0b1c, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Cawing) -STD_ROM_FN(Cawing) - -static struct BurnRomInfo Cawingr1RomDesc[] = { - { "cae_30.11f", 0x020000, 0x23305cd5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cae_35.11h", 0x020000, 0x69419113, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cae_31.12f", 0x020000, 0x9008dfb3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cae_36.12h", 0x020000, 0x4dbf6f8e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ca-32m.8h", 0x080000, 0x0c4837d4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ca-5m.7a", 0x080000, 0x66d4cc37, BRF_GRA | CPS1_TILES }, - { "ca-7m.9a", 0x080000, 0xb6f896f2, BRF_GRA | CPS1_TILES }, - { "ca-1m.3a", 0x080000, 0x4d0620fd, BRF_GRA | CPS1_TILES }, - { "ca-3m.5a", 0x080000, 0x0b0341c3, BRF_GRA | CPS1_TILES }, - - { "cae_09.12b", 0x010000, 0x96fe7485, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cae_18.11c", 0x020000, 0x4a613a2c, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "cae_19.12c", 0x020000, 0x74584493, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ca24b.1a", 0x000117, 0x76ec0b1c, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Cawingr1) -STD_ROM_FN(Cawingr1) - -static struct BurnRomInfo CawinguRomDesc[] = { - { "cau_30a.11f", 0x020000, 0x91fceacd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cau_35a.11h", 0x020000, 0xf090d9b2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cau_31a.12f", 0x020000, 0xe5b75caf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cau_36a.12h", 0x020000, 0xc73fd713, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ca-32m.8h", 0x080000, 0x0c4837d4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ca-5m.7a", 0x080000, 0x66d4cc37, BRF_GRA | CPS1_TILES }, - { "ca-7m.9a", 0x080000, 0xb6f896f2, BRF_GRA | CPS1_TILES }, - { "ca-1m.3a", 0x080000, 0x4d0620fd, BRF_GRA | CPS1_TILES }, - { "ca-3m.5a", 0x080000, 0x0b0341c3, BRF_GRA | CPS1_TILES }, - - { "cau_09.12b", 0x010000, 0x96fe7485, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cau_18.11c", 0x020000, 0x4a613a2c, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "cau_19.12c", 0x020000, 0x74584493, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ca24b.1a", 0x000117, 0x76ec0b1c, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Cawingu) -STD_ROM_FN(Cawingu) - -static struct BurnRomInfo CawingjRomDesc[] = { - { "caj_36a.12f", 0x020000, 0x91fceacd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "caj_42a.12h", 0x020000, 0x039f8362, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "caj_37a.13f", 0x020000, 0xe5b75caf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "caj_43a.13h", 0x020000, 0xc73fd713, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "caj_34.10f", 0x020000, 0x51ea57f4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "caj_40.10h", 0x020000, 0x2ab71ae1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "caj_35.11f", 0x020000, 0x01d71973, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "caj_41.11h", 0x020000, 0x3a43b538, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "caj_09.4b", 0x020000, 0x41b0f9a6, BRF_GRA | CPS1_TILES }, - { "caj_01.4a", 0x020000, 0x1002d0b8, BRF_GRA | CPS1_TILES }, - { "caj_13.9b", 0x020000, 0x6f3948b2, BRF_GRA | CPS1_TILES }, - { "caj_05.9a", 0x020000, 0x207373d7, BRF_GRA | CPS1_TILES }, - { "caj_24.5e", 0x020000, 0xe356aad7, BRF_GRA | CPS1_TILES }, - { "caj_17.5c", 0x020000, 0x540f2fd8, BRF_GRA | CPS1_TILES }, - { "caj_38.8h", 0x020000, 0x2464d4ab, BRF_GRA | CPS1_TILES }, - { "caj_32.8f", 0x020000, 0x9b5836b3, BRF_GRA | CPS1_TILES }, - { "caj_10.5b", 0x020000, 0xbf8a5f52, BRF_GRA | CPS1_TILES }, - { "caj_02.5a", 0x020000, 0x125b018d, BRF_GRA | CPS1_TILES }, - { "caj_14.10b", 0x020000, 0x8458e7d7, BRF_GRA | CPS1_TILES }, - { "caj_06.10a", 0x020000, 0xcf80e164, BRF_GRA | CPS1_TILES }, - { "caj_25.7e", 0x020000, 0xcdd0204d, BRF_GRA | CPS1_TILES }, - { "caj_18.7c", 0x020000, 0x29c1d4b1, BRF_GRA | CPS1_TILES }, - { "caj_39.9h", 0x020000, 0xeea23b67, BRF_GRA | CPS1_TILES }, - { "caj_33.9f", 0x020000, 0xdde3891f, BRF_GRA | CPS1_TILES }, - - { "caj_23.13b", 0x010000, 0x96fe7485, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "caj_30.12c", 0x020000, 0x4a613a2c, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "caj_31.13c", 0x020000, 0x74584493, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ca22b.1a", 0x000117, 0x5152e678, BRF_OPT }, // b-board PLDs - { "iob1.12e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Cawingj) -STD_ROM_FN(Cawingj) - -static struct BurnRomInfo CawingblRomDesc[] = { - { "caw2.bin", 0x080000, 0x8125d3f0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // caw2 - { "caw1.bin", 0x080000, 0xb19b10ce, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // caw1 - - { "caw7.bin", 0x080000, 0xa045c689, BRF_GRA | CPS1_TILES }, - { "caw6.bin", 0x080000, 0x61192f7c, BRF_GRA | CPS1_TILES }, - { "caw5.bin", 0x080000, 0x30dd78db, BRF_GRA | CPS1_TILES }, - { "caw4.bin", 0x080000, 0x4937fc41, BRF_GRA | CPS1_TILES }, - - { "caw3.bin", 0x020000, 0xffe16cdc, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Cawingbl) -STD_ROM_FN(Cawingbl) - -static struct BurnRomInfo Cawingb2RomDesc[] = { - { "8.8", 0x020000, 0xf655708c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.4", 0x020000, 0xa02fb5aa, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "7.7", 0x020000, 0x8c6c7430, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // caw2 - { "3.3", 0x020000, 0xf585bf2c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // caw1 - { "6.6", 0x020000, 0x5fda906e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // caw2 - { "2.2", 0x020000, 0x736c1835, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // caw1 - { "5.5", 0x020000, 0x76458083, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // caw2 - { "1.1", 0x020000, 0xd3523f34, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // caw1 - - { "17.17", 0x020000, 0x0b538062, BRF_GRA | CPS1_TILES }, //caw7 - { "19.19", 0x020000, 0x3ad62311, BRF_GRA | CPS1_TILES }, //caw6 - { "21.21", 0x020000, 0x1b872a98, BRF_GRA | CPS1_TILES }, //caw5 - { "23.23", 0x020000, 0xad49eecd, BRF_GRA | CPS1_TILES }, - { "9.9", 0x020000, 0x8cd4df5b, BRF_GRA | CPS1_TILES }, //caw7 - { "11.11", 0x020000, 0xbf14418a, BRF_GRA | CPS1_TILES }, //caw6 - { "13.13", 0x020000, 0xcef1aab8, BRF_GRA | CPS1_TILES }, //caw5 - { "15.15", 0x020000, 0x397725dc, BRF_GRA | CPS1_TILES }, //caw4 - { "18.18", 0x020000, 0x9b14f7ed, BRF_GRA | CPS1_TILES }, //caw7 - { "20.20", 0x020000, 0x59bcc1bb, BRF_GRA | CPS1_TILES }, //caw6 - { "22.22", 0x020000, 0x23dc647a, BRF_GRA | CPS1_TILES }, //caw5 - { "24.24", 0x020000, 0xeda9fa6b, BRF_GRA | CPS1_TILES }, //caw4 - { "10.10", 0x020000, 0x17174249, BRF_GRA | CPS1_TILES }, //caw7 - { "12.12", 0x020000, 0x490440b2, BRF_GRA | CPS1_TILES }, //caw6 - { "14.14", 0x020000, 0x344a8270, BRF_GRA | CPS1_TILES }, //caw5 - { "16.16", 0x020000, 0xb991ad91, BRF_GRA | CPS1_TILES }, //caw4 - - { "5.a", 0x020000, 0xffe16cdc, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Cawingb2) -STD_ROM_FN(Cawingb2) - -static struct BurnRomInfo Cps1demoRomDesc[] = { - { "cd30-36.bin", 0x020000, 0x5eb617d6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cd35-42.bin", 0x020000, 0x1f1c0a62, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cd31-37.bin", 0x020000, 0x7ee8cdcd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // sound rom from cps1frog ? - { "cd36-43.bin", 0x020000, 0x7ee8cdcd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // sound rom from cps1frog ? - { "ff-32m.8h", 0x080000, 0xc747696e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "cd05-05m.bin", 0x080000, 0x35dc6153, BRF_GRA | CPS1_TILES }, - { "cd07-07m.bin", 0x080000, 0xbaf08a38, BRF_GRA | CPS1_TILES }, - { "cd01-01m.bin", 0x080000, 0x3ad8e790, BRF_GRA | CPS1_TILES }, - { "cd03-03m.bin", 0x080000, 0xfb5186f3, BRF_GRA | CPS1_TILES }, - - { "ff_09.12b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_18.11c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_19.12c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Cps1demo) -STD_ROM_FN(Cps1demo) - -static struct BurnRomInfo Cworld2jRomDesc[] = { - { "q5_36.12f", 0x020000, 0x38a08099, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "q5_42.12h", 0x020000, 0x4d29b3a4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "q5_37.13f", 0x020000, 0xeb547ebc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "q5_43.13h", 0x020000, 0x3ef65ea8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "q5_34.10f", 0x020000, 0x7fcc1317, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "q5_40.10h", 0x020000, 0x7f14b7b4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "q5_35.11f", 0x020000, 0xabacee26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, -// { "q5_35.11f", 0x020000, 0x59961612, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // dumped from another board, 1 byte different, pcb verified - { "q5_41.11h", 0x020000, 0xd3654067, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "q5_09.4b", 0x020000, 0x48496d80, BRF_GRA | CPS1_TILES }, - { "q5_01.4a", 0x020000, 0xc5453f56, BRF_GRA | CPS1_TILES }, - { "q5_13.9b", 0x020000, 0xc741ac52, BRF_GRA | CPS1_TILES }, - { "q5_05.9a", 0x020000, 0x143e068f, BRF_GRA | CPS1_TILES }, - { "q5_24.5e", 0x020000, 0xb419d139, BRF_GRA | CPS1_TILES }, - { "q5_17.5c", 0x020000, 0xbd3b4d11, BRF_GRA | CPS1_TILES }, - { "q5_38.8h", 0x020000, 0x9c24670c, BRF_GRA | CPS1_TILES }, - { "q5_32.8f", 0x020000, 0x3ef9c7c2, BRF_GRA | CPS1_TILES }, - { "q5_10.5b", 0x020000, 0x119e5e93, BRF_GRA | CPS1_TILES }, - { "q5_02.5a", 0x020000, 0xa2cadcbe, BRF_GRA | CPS1_TILES }, - { "q5_14.10b", 0x020000, 0xa8755f82, BRF_GRA | CPS1_TILES }, - { "q5_06.10a", 0x020000, 0xc92a91fc, BRF_GRA | CPS1_TILES }, - { "q5_25.7e", 0x020000, 0x979237cb, BRF_GRA | CPS1_TILES }, - { "q5_18.7c", 0x020000, 0xc57da03c, BRF_GRA | CPS1_TILES }, - { "q5_39.9h", 0x020000, 0xa5839b25, BRF_GRA | CPS1_TILES }, - { "q5_33.9f", 0x020000, 0x04d03930, BRF_GRA | CPS1_TILES }, - - { "q5_23.13b", 0x010000, 0xe14dc524, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "q5_30.12c", 0x020000, 0xd10c1b68, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "q5_31.13c", 0x020000, 0x7d17e496, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "q522b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP}, // b-board PLDs - { "lwio.12e", 0x000117, 0xad52b90c, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Cworld2j) -STD_ROM_FN(Cworld2j) - -static struct BurnRomInfo Cworld2jaRomDesc[] = { -/* B-Board 90629B-3 - all roms have 90629B on the labels, no battery, possibly unofficial / desuicided with reproduction stickers */ - { "q5 - 34_90629b.8f", 0x080000, 0xde54487f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "q5 - 33_90629b.6f", 0x080000, 0x93248458, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "q5 - 06_90629b.8a", 0x080000, 0x09d0e7ce, BRF_GRA | CPS1_TILES }, - { "q5 - 08_90629b.10a", 0x080000, 0x22e4ce9a, BRF_GRA | CPS1_TILES }, - { "q5 - 05_90629b.7a", 0x080000, 0xf7b3aed6, BRF_GRA | CPS1_TILES }, - { "q5 - 07_90629b.9a", 0x080000, 0x520c6c88, BRF_GRA | CPS1_TILES }, - - { "q5 - 09_90629b.12a", 0x010000, 0xe14dc524, BRF_PRG | CPS1_Z80_PROGRAM }, // == q5_23.13b - - { "q5 - 18_90629b.11c", 0x020000, 0xd10c1b68, BRF_SND | CPS1_OKIM6295_SAMPLES }, // == q5_30.12c - { "q5 - 19_90629b.12c", 0x020000, 0x7d17e496, BRF_SND | CPS1_OKIM6295_SAMPLES }, // == q5_31.13c - - A_BOARD_PLDS - - { "q529b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP}, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Cworld2ja) -STD_ROM_FN(Cworld2ja) - -static struct BurnRomInfo Cworld2jbRomDesc[] = { -/* B-Board 91634B-2 - all roms have 91634B on the labels */ - { "q5 - 23_91634b.8f", 0x080000, 0x709f577f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "q5 - 22_91634b.7f", 0x080000, 0x93248458, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "q5 - 01_91634b.3a", 0x080000, 0x09d0e7ce, BRF_GRA | CPS1_TILES }, - { "q5 - 02_91634b.4a", 0x080000, 0x22e4ce9a, BRF_GRA | CPS1_TILES }, - { "q5 - 03_91634b.5a", 0x080000, 0xf7b3aed6, BRF_GRA | CPS1_TILES }, - { "q5 - 04_91634b.6a", 0x080000, 0x520c6c88, BRF_GRA | CPS1_TILES }, - - { "q5 - 09_91634b.12a", 0x010000, 0xe14dc524, BRF_PRG | CPS1_Z80_PROGRAM }, // == q5_23.13b - - { "q5 - 18_91634b.11c", 0x020000, 0xd10c1b68, BRF_SND | CPS1_OKIM6295_SAMPLES }, // == q5_30.12c - { "q5 - 19_91634b.12c", 0x020000, 0x7d17e496, BRF_SND | CPS1_OKIM6295_SAMPLES }, // == q5_31.13c - - A_BOARD_PLDS - - { "q563b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP}, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Cworld2jb) -STD_ROM_FN(Cworld2jb) - -static struct BurnRomInfo DinoRomDesc[] = { - { "cde_23a.8f", 0x080000, 0x8f4e585e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cde_22a.7f", 0x080000, 0x9278aa12, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cde_21a.6f", 0x080000, 0x66d23de2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "cd-1m.3a", 0x080000, 0x8da4f917, BRF_GRA | CPS1_TILES }, - { "cd-3m.5a", 0x080000, 0x6c40f603, BRF_GRA | CPS1_TILES }, - { "cd-2m.4a", 0x080000, 0x09c8fc2d, BRF_GRA | CPS1_TILES }, - { "cd-4m.6a", 0x080000, 0x637ff38f, BRF_GRA | CPS1_TILES }, - { "cd-5m.7a", 0x080000, 0x470befee, BRF_GRA | CPS1_TILES }, - { "cd-7m.9a", 0x080000, 0x22bfb7a3, BRF_GRA | CPS1_TILES }, - { "cd-6m.8a", 0x080000, 0xe7599ac4, BRF_GRA | CPS1_TILES }, - { "cd-8m.10a", 0x080000, 0x211b4b15, BRF_GRA | CPS1_TILES }, - - { "cd_q.5k", 0x020000, 0x605fdb0b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cd-q1.1k", 0x080000, 0x60927775, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q2.2k", 0x080000, 0x770f4c47, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q3.3k", 0x080000, 0x2f273ffc, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q4.4k", 0x080000, 0x2c67821d, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "cd63b.1a", 0x000117, 0xef72e902, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Dino) -STD_ROM_FN(Dino) - -static struct BurnRomInfo DinoaRomDesc[] = { - { "23.bin", 0x080000, 0xf477f7a0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "22.bin", 0x080000, 0x1e534ca5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cdj_21a.6f", 0x080000, 0x66d23de2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "cd_01.3a", 0x080000, 0x8da4f917, BRF_GRA | CPS1_TILES }, - { "cd_02.4a", 0x080000, 0x6c40f603, BRF_GRA | CPS1_TILES }, - { "cd_03.5a", 0x080000, 0x09c8fc2d, BRF_GRA | CPS1_TILES }, - { "cd_04.6a", 0x080000, 0x637ff38f, BRF_GRA | CPS1_TILES }, - { "cd_05.7a", 0x080000, 0x470befee, BRF_GRA | CPS1_TILES }, - { "cd_06.8a", 0x080000, 0x22bfb7a3, BRF_GRA | CPS1_TILES }, - { "cd_07.9a", 0x080000, 0xe7599ac4, BRF_GRA | CPS1_TILES }, - { "cd_08.10a", 0x080000, 0x211b4b15, BRF_GRA | CPS1_TILES }, - - { "cd_q.5k", 0x020000, 0x605fdb0b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cd-q1.1k", 0x080000, 0x60927775, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q2.2k", 0x080000, 0x770f4c47, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q3.3k", 0x080000, 0x2f273ffc, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q4.4k", 0x080000, 0x2c67821d, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "cd63b.1a", 0x000117, 0xef72e902, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Dinoa) -STD_ROM_FN(Dinoa) - -static struct BurnRomInfo DinojRomDesc[] = { - { "cdj_23a.8f", 0x080000, 0x5f3ece96, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cdj_22a.7f", 0x080000, 0xa0d8de29, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cdj_21a.6f", 0x080000, 0x66d23de2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "cd_01.3a", 0x080000, 0x8da4f917, BRF_GRA | CPS1_TILES }, - { "cd_02.4a", 0x080000, 0x6c40f603, BRF_GRA | CPS1_TILES }, - { "cd_03.5a", 0x080000, 0x09c8fc2d, BRF_GRA | CPS1_TILES }, - { "cd_04.6a", 0x080000, 0x637ff38f, BRF_GRA | CPS1_TILES }, - { "cd_05.7a", 0x080000, 0x470befee, BRF_GRA | CPS1_TILES }, - { "cd_06.8a", 0x080000, 0x22bfb7a3, BRF_GRA | CPS1_TILES }, - { "cd_07.9a", 0x080000, 0xe7599ac4, BRF_GRA | CPS1_TILES }, - { "cd_08.10a", 0x080000, 0x211b4b15, BRF_GRA | CPS1_TILES }, - - { "cd_q.5k", 0x020000, 0x605fdb0b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cd-q1.1k", 0x080000, 0x60927775, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q2.2k", 0x080000, 0x770f4c47, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q3.3k", 0x080000, 0x2f273ffc, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q4.4k", 0x080000, 0x2c67821d, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "cd63b.1a", 0x000117, 0xef72e902, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Dinoj) -STD_ROM_FN(Dinoj) - -static struct BurnRomInfo DinouRomDesc[] = { - { "cdu_23a.8f", 0x080000, 0x7c2543cd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cdu_22a.7f", 0x080000, 0xd19f981e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cdu_21a.6f", 0x080000, 0x66d23de2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "cd-1m.3a", 0x080000, 0x8da4f917, BRF_GRA | CPS1_TILES }, - { "cd-3m.5a", 0x080000, 0x6c40f603, BRF_GRA | CPS1_TILES }, - { "cd-2m.4a", 0x080000, 0x09c8fc2d, BRF_GRA | CPS1_TILES }, - { "cd-4m.6a", 0x080000, 0x637ff38f, BRF_GRA | CPS1_TILES }, - { "cd-5m.7a", 0x080000, 0x470befee, BRF_GRA | CPS1_TILES }, - { "cd-7m.9a", 0x080000, 0x22bfb7a3, BRF_GRA | CPS1_TILES }, - { "cd-6m.8a", 0x080000, 0xe7599ac4, BRF_GRA | CPS1_TILES }, - { "cd-8m.10a", 0x080000, 0x211b4b15, BRF_GRA | CPS1_TILES }, - - { "cd_q.5k", 0x020000, 0x605fdb0b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cd-q1.1k", 0x080000, 0x60927775, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q2.2k", 0x080000, 0x770f4c47, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q3.3k", 0x080000, 0x2f273ffc, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd-q4.4k", 0x080000, 0x2c67821d, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "cd63b.1a", 0x000117, 0xef72e902, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Dinou) -STD_ROM_FN(Dinou) - -static struct BurnRomInfo DinopicRomDesc[] = { - // This set is also known as dinob - { "5.bin", 0x080000, 0x96dfcbf1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "3.bin", 0x080000, 0x13dfeb08, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "7.bin", 0x080000, 0x6133f349, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.bin", 0x080000, 0x0e4058ba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "4.bin", 0x080000, 0xf3c2c98d, BRF_GRA | CPS1_TILES }, - { "8.bin", 0x080000, 0xd574befc, BRF_GRA | CPS1_TILES }, - { "9.bin", 0x080000, 0x55ef0adc, BRF_GRA | CPS1_TILES }, - { "6.bin", 0x080000, 0xcc0805fc, BRF_GRA | CPS1_TILES }, - { "13.bin", 0x080000, 0x1371f714, BRF_GRA | CPS1_TILES }, - { "12.bin", 0x080000, 0xb284c4a7, BRF_GRA | CPS1_TILES }, - { "11.bin", 0x080000, 0xb7ad3394, BRF_GRA | CPS1_TILES }, - { "10.bin", 0x080000, 0x88847705, BRF_GRA | CPS1_TILES }, - - { "pic16c57-rp", 0x002d4c, 0x5a6d393c, BRF_PRG | CPS1_PIC }, - - { "1.bin", 0x080000, 0x7d921309, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Dinopic) -STD_ROM_FN(Dinopic) - -static struct BurnRomInfo Dinopic2RomDesc[] = { - { "27c4000-m12481.bin", 0x080000, 0x96dfcbf1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27c4000-m12374r-2.bin", 0x080000, 0x13dfeb08, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27c4000-m12374r-3.bin", 0x080000, 0x6133f349, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27c4000-m12374r-1.bin", 0x080000, 0x0e4058ba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "27c4000-m12481-4.bin", 0x080000, 0xf3c2c98d, BRF_GRA | CPS1_TILES }, -#if !defined ROM_VERIFY - { "27c4000-m12481-3.bin", 0x080000, 0xd574befc, BRF_GRA | CPS1_TILES }, -#else - { "27c4000-m12481-3.bin", 0x080000, 0x417a4816, BRF_GRA | CPS1_TILES }, -#endif - { "27c4000-m12481-2.bin", 0x080000, 0x55ef0adc, BRF_GRA | CPS1_TILES }, - { "27c4000-m12481-1.bin", 0x080000, 0xcc0805fc, BRF_GRA | CPS1_TILES }, - { "27c4000-m12481-8.bin", 0x080000, 0x1371f714, BRF_GRA | CPS1_TILES }, - { "27c4000-m12481-7.bin", 0x080000, 0xb284c4a7, BRF_GRA | CPS1_TILES }, - { "27c4000-m12481-6.bin", 0x080000, 0xb7ad3394, BRF_GRA | CPS1_TILES }, - { "27c4000-m12481-5.bin", 0x080000, 0x88847705, BRF_GRA | CPS1_TILES }, - - { "pic16c57-xt.hex", 0x0026cc, 0xa6a5eac4, BRF_PRG | CPS1_PIC }, - - { "27c4000-m12623.bin", 0x080000, 0x7d921309, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "cat93c46p.bin", 0x000080, 0xd49fa351, BRF_OPT }, - { "gal20v8a-1.bin", 0x000157, 0xcd99ca47, BRF_OPT }, - { "gal20v8a-2.bin", 0x000157, 0x60d016b9, BRF_OPT }, - { "gal20v8a-3.bin", 0x000157, 0x049b7f4f, BRF_OPT }, - { "palce16v8h-1.bin", 0x000117, 0x48253c66, BRF_OPT }, - { "palce16v8h-2.bin", 0x000117, 0x9ae375ba, BRF_OPT }, -}; - -STD_ROM_PICK(Dinopic2) -STD_ROM_FN(Dinopic2) - -static struct BurnRomInfo Dinopic3RomDesc[] = { - { "27c4000-m15377-a-5.bin", 0x080000, 0x96dfcbf1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27c4000-m15262-a-3.bin", 0x080000, 0x13dfeb08, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27c4000-m15295-a-4.bin", 0x080000, 0x6133f349, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27c4000-m15263-a-1-2.bin", 0x080000, 0x0e4058ba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "27c4000-m15263-a-1-9.bin", 0x080000, 0xf3c2c98d, BRF_GRA | CPS1_TILES }, - { "27c4000-m15262-a-8.bin", 0x080000, 0xa0e1f6e0, BRF_GRA | CPS1_TILES }, - { "27c4000-m15279-a-7.bin", 0x080000, 0x55ef0adc, BRF_GRA | CPS1_TILES }, - { "27c4000-m15279-a-6.bin", 0x080000, 0xcc0805fc, BRF_GRA | CPS1_TILES }, - { "27c4000-m15013-b-1-13.bin", 0x080000, 0x1371f714, BRF_GRA | CPS1_TILES }, - { "27c4000-m15263-a-1-12.bin", 0x080000, 0xb284c4a7, BRF_GRA | CPS1_TILES }, - { "27c4000-m15377-a-11.bin", 0x080000, 0xb7ad3394, BRF_GRA | CPS1_TILES }, - { "27c4000-m15279-a-10.bin", 0x080000, 0x88847705, BRF_GRA | CPS1_TILES }, - - { "pic16c57-rc.bin", 0x001030, 0x4d262eaa, BRF_PRG | CPS1_PIC }, - - { "27c4000-m15388-a-1.bin", 0x080000, 0x7d921309, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "cat93c46p.bin", 0x000080, 0xd49fa351, BRF_OPT }, - { "gal20v8a-1.bin", 0x000157, 0xcd99ca47, BRF_OPT }, - { "gal20v8a-2.bin", 0x000157, 0x60d016b9, BRF_OPT }, - { "gal20v8a-3.bin", 0x000157, 0x049b7f4f, BRF_OPT }, - { "palce16v8h-1.bin", 0x000117, 0x48253c66, BRF_OPT }, - { "palce16v8h-2.bin", 0x000117, 0x9ae375ba, BRF_OPT }, -}; - -STD_ROM_PICK(Dinopic3) -STD_ROM_FN(Dinopic3) - -static struct BurnRomInfo Dinopic4RomDesc[] = { - { "cad_28.bin", 0x040000, 0x97dc3d86, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cad_32.bin", 0x040000, 0x200a594f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cad_29.bin", 0x040000, 0x302303c4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cad_33.bin", 0x040000, 0x5bf6deda, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cad_31.bin", 0x020000, 0xf0110c8a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cad_35.bin", 0x020000, 0xfbcf4314, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cad_30.bin", 0x020000, 0xbbcafc3b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cad_34.bin", 0x020000, 0x481369b8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "cad_24.bin", 0x040000, 0xe59e0066, BRF_GRA | CPS1_TILES }, - { "cad_20.bin", 0x040000, 0x779bffb2, BRF_GRA | CPS1_TILES }, - { "cad_14.bin", 0x040000, 0x79b60fc5, BRF_GRA | CPS1_TILES }, - { "cad_10.bin", 0x040000, 0x9d5b2ed4, BRF_GRA | CPS1_TILES }, - { "cad_26.bin", 0x040000, 0x2db8cb57, BRF_GRA | CPS1_TILES }, - { "cad_22.bin", 0x040000, 0xb58c4246, BRF_GRA | CPS1_TILES }, - { "cad_16.bin", 0x040000, 0x569e5cf0, BRF_GRA | CPS1_TILES }, - { "cad_12.bin", 0x040000, 0x33ed501d, BRF_GRA | CPS1_TILES }, - { "cad_25.bin", 0x040000, 0x900b82b7, BRF_GRA | CPS1_TILES }, - { "cad_21.bin", 0x040000, 0xd65ee299, BRF_GRA | CPS1_TILES }, - { "cad_15.bin", 0x040000, 0xaa54f07c, BRF_GRA | CPS1_TILES }, - { "cad_11.bin", 0x040000, 0x8594b5e8, BRF_GRA | CPS1_TILES }, - { "cad_27.bin", 0x040000, 0x27492fde, BRF_GRA | CPS1_TILES }, - { "cad_23.bin", 0x040000, 0xf07c16f2, BRF_GRA | CPS1_TILES }, - { "cad_17.bin", 0x040000, 0x920df2fd, BRF_GRA | CPS1_TILES }, - { "cad_13.bin", 0x040000, 0x07a564b4, BRF_GRA | CPS1_TILES }, - - { "cad_09.bin", 0x010000, 0x46546432, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cad_18.bin", 0x020000, 0xbd12c2ce, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "cad_19.bin", 0x020000, 0x9233de5a, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "pic16c57-rp", 0x000000, 0x00000000, BRF_PRG | BRF_NODUMP }, -}; - -STD_ROM_PICK(Dinopic4) -STD_ROM_FN(Dinopic4) - -static struct BurnRomInfo DinohRomDesc[] = { - { "cda_23h.rom", 0x080000, 0x8e2a9cf0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cda_22h.rom", 0x080000, 0xf72cd219, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cda_21h.rom", 0x080000, 0xbc275b76, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cda_20h.rom", 0x080000, 0x8987c975, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "cd_gfx01.rom", 0x080000, 0x8da4f917, BRF_GRA | CPS1_TILES }, - { "cd_gfx03.rom", 0x080000, 0x6c40f603, BRF_GRA | CPS1_TILES }, - { "cd_gfx02.rom", 0x080000, 0x09c8fc2d, BRF_GRA | CPS1_TILES }, - { "cd_gfx04.rom", 0x080000, 0x637ff38f, BRF_GRA | CPS1_TILES }, - { "cd_gfx05.rom", 0x080000, 0x470befee, BRF_GRA | CPS1_TILES }, - { "cd_gfx07.rom", 0x080000, 0x22bfb7a3, BRF_GRA | CPS1_TILES }, - { "cd_gfx06.rom", 0x080000, 0xe7599ac4, BRF_GRA | CPS1_TILES }, - { "cd_gfx08.rom", 0x080000, 0x211b4b15, BRF_GRA | CPS1_TILES }, - - // This doesn't work at all without the Q-Sound data present - does it really use Q-Sound?? - { "cd_q.rom", 0x020000, 0x605fdb0b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cd_q1.rom", 0x080000, 0x60927775, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd_q2.rom", 0x080000, 0x770f4c47, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd_q3.rom", 0x080000, 0x2f273ffc, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd_q4.rom", 0x080000, 0x2c67821d, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Dinoh) -STD_ROM_FN(Dinoh) - -static struct BurnRomInfo DinotRomDesc[] = { - // This set is also known as Kl2d - { "kl2-r1.800", 0x100000, 0x4c70dca7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "kl2-l2.800", 0x100000, 0xc6ae7338, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "cd-a.160", 0x200000, 0x7e4f9fb3, BRF_GRA | CPS1_TILES }, - { "cd-b.160", 0x200000, 0x89532d85, BRF_GRA | CPS1_TILES }, - - { "cd_q.rom", 0x020000, 0x605fdb0b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cd_q1.rom", 0x080000, 0x60927775, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd_q2.rom", 0x080000, 0x770f4c47, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd_q3.rom", 0x080000, 0x2f273ffc, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd_q4.rom", 0x080000, 0x2c67821d, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Dinot) -STD_ROM_FN(Dinot) - -static struct BurnRomInfo DinotpicRomDesc[] = { - { "cd-d.800", 0x100000, 0x2a7b2915, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cd-e.800", 0x100000, 0xe8370226, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "cd-a.160", 0x200000, 0x7e4f9fb3, BRF_GRA | CPS1_TILES }, - { "cd-b.160", 0x200000, 0x89532d85, BRF_GRA | CPS1_TILES }, -}; - -STD_ROM_PICK(Dinotpic) -STD_ROM_FN(Dinotpic) - -static struct BurnRomInfo DinohuntRomDesc[] = { - { "u23", 0x080000, 0x8d5ddc5d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "u22", 0x080000, 0xf72cd219, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "u21", 0x080000, 0xbc275b76, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "u20", 0x080000, 0x8987c975, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "u1", 0x080000, 0xa01a9fb5, BRF_GRA | CPS1_TILES }, - { "u2", 0x080000, 0xbdf02c17, BRF_GRA | CPS1_TILES }, - { "u3", 0x080000, 0x058beefa, BRF_GRA | CPS1_TILES }, - { "u4", 0x080000, 0x5028a9f1, BRF_GRA | CPS1_TILES }, - { "u5", 0x080000, 0xd77f89ea, BRF_GRA | CPS1_TILES }, - { "u6", 0x080000, 0xbfbcb034, BRF_GRA | CPS1_TILES }, - { "u7", 0x080000, 0xa2544d4e, BRF_GRA | CPS1_TILES }, - { "u8", 0x080000, 0x8869bbb1, BRF_GRA | CPS1_TILES }, - - { "u9", 0x010000, 0x2eb16a83, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "u18", 0x020000, 0x8d2899ba, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "u19", 0x020000, 0xb34a4b42, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Dinohunt) -STD_ROM_FN(Dinohunt) - -static struct BurnRomInfo DinoehRomDesc[] = { - { "dinoeh.23", 0x080000, 0xa6b88364, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cde_22a.rom", 0x080000, 0x9278aa12, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "dinoeh.21", 0x080000, 0xb89a0548, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "cd_gfx01.rom", 0x080000, 0x8da4f917, BRF_GRA | CPS1_TILES }, - { "cd_gfx03.rom", 0x080000, 0x6c40f603, BRF_GRA | CPS1_TILES }, - { "cd_gfx02.rom", 0x080000, 0x09c8fc2d, BRF_GRA | CPS1_TILES }, - { "cd_gfx04.rom", 0x080000, 0x637ff38f, BRF_GRA | CPS1_TILES }, - { "cd_gfx05.rom", 0x080000, 0x470befee, BRF_GRA | CPS1_TILES }, - { "cd_gfx07.rom", 0x080000, 0x22bfb7a3, BRF_GRA | CPS1_TILES }, - { "cd_gfx06.rom", 0x080000, 0xe7599ac4, BRF_GRA | CPS1_TILES }, - { "cd_gfx08.rom", 0x080000, 0x211b4b15, BRF_GRA | CPS1_TILES }, - - { "cd_q.rom", 0x020000, 0x605fdb0b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "cd_q1.rom", 0x080000, 0x60927775, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd_q2.rom", 0x080000, 0x770f4c47, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd_q3.rom", 0x080000, 0x2f273ffc, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "cd_q4.rom", 0x080000, 0x2c67821d, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Dinoeh) -STD_ROM_FN(Dinoeh) - -static struct BurnRomInfo DinohcRomDesc[] = { - { "23", 0x080000, 0xcecf4b12, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "22", 0x080000, 0x07eeb238, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "21", 0x080000, 0x3bc3d57a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "1", 0x080000, 0x8da4f917, BRF_GRA | CPS1_TILES }, - { "2", 0x080000, 0x6c40f603, BRF_GRA | CPS1_TILES }, - { "3", 0x080000, 0x09c8fc2d, BRF_GRA | CPS1_TILES }, - { "4", 0x080000, 0x637ff38f, BRF_GRA | CPS1_TILES }, - { "5", 0x080000, 0x470befee, BRF_GRA | CPS1_TILES }, - { "6", 0x080000, 0x22bfb7a3, BRF_GRA | CPS1_TILES }, - { "7", 0x080000, 0xe7599ac4, BRF_GRA | CPS1_TILES }, - { "8", 0x080000, 0x211b4b15, BRF_GRA | CPS1_TILES }, - - { "9", 0x010000, 0x698e8b58, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18", 0x020000, 0x6de2c2db, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19", 0x020000, 0xb99091ae, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Dinohc) -STD_ROM_FN(Dinohc) - -static struct BurnRomInfo DynwarRomDesc[] = { - { "30.11f", 0x020000, 0xf9ec6d68, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "35.11h", 0x020000, 0xe41fff2f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "31.12f", 0x020000, 0xe3de76ff, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "36.12h", 0x020000, 0x7a13cfbf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tkm-9.8h", 0x080000, 0x93654bcf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tkm-5.7a", 0x080000, 0xf64bb6a0, BRF_GRA | CPS1_TILES }, - { "tkm-8.9a", 0x080000, 0x21fe6274, BRF_GRA | CPS1_TILES }, - { "tkm-6.3a", 0x080000, 0x0bf228cb, BRF_GRA | CPS1_TILES }, - { "tkm-7.5a", 0x080000, 0x1255dfb1, BRF_GRA | CPS1_TILES }, - { "tkm-1.8a", 0x080000, 0x44f7661e, BRF_GRA | CPS1_TILES }, - { "tkm-4.10a", 0x080000, 0xa54c515d, BRF_GRA | CPS1_TILES }, - { "tkm-2.4a", 0x080000, 0xca5c687c, BRF_GRA | CPS1_TILES }, - { "tkm-3.6a", 0x080000, 0xf9fe6591, BRF_GRA | CPS1_TILES }, - - { "tke_17.12b", 0x010000, 0xb3b79d4f, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tke_18.11c", 0x020000, 0xac6e307d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "tke_19.12c", 0x020000, 0x068741db, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "tk24b1.1a", 0x000117, 0xae4a7645, BRF_OPT }, // b-board PLDs - { "lwio.11e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Dynwar) -STD_ROM_FN(Dynwar) - -static struct BurnRomInfo DynwaraRomDesc[] = { - { "tke_36.12f", 0x020000, 0x895991d1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tke_42.12h", 0x020000, 0xc898d2e8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tke_37.13f", 0x020000, 0xb228d58c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tke_43.13h", 0x020000, 0x1a14375a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "34.10f", 0x020000, 0x8f663d00, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "40.10h", 0x020000, 0x1586dbf3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "35.11f", 0x020000, 0x9db93d7a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41.11h", 0x020000, 0x1aae69a4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "09.4b", 0x020000, 0xc3e83c69, BRF_GRA | CPS1_TILES }, - { "01.4a", 0x020000, 0x187b2886, BRF_GRA | CPS1_TILES }, - { "13.9b", 0x020000, 0x0273d87d, BRF_GRA | CPS1_TILES }, - { "05.9a", 0x020000, 0x339378b8, BRF_GRA | CPS1_TILES }, - { "24.5e", 0x020000, 0xc6909b6f, BRF_GRA | CPS1_TILES }, - { "17.5c", 0x020000, 0x2e2f8320, BRF_GRA | CPS1_TILES }, - { "38.8h", 0x020000, 0xcd7923ed, BRF_GRA | CPS1_TILES }, - { "32.8f", 0x020000, 0x21a0a453, BRF_GRA | CPS1_TILES }, - { "10.5b", 0x020000, 0xff28f8d0, BRF_GRA | CPS1_TILES }, - { "02.5a", 0x020000, 0xcc83c02f, BRF_GRA | CPS1_TILES }, - { "14.10b", 0x020000, 0x58d9b32f, BRF_GRA | CPS1_TILES }, - { "06.10a", 0x020000, 0x6f9edd75, BRF_GRA | CPS1_TILES }, - { "25.7e", 0x020000, 0x152ea74a, BRF_GRA | CPS1_TILES }, - { "18.7c", 0x020000, 0x1833f932, BRF_GRA | CPS1_TILES }, - { "39.9h", 0x020000, 0xbc09b360, BRF_GRA | CPS1_TILES }, - { "33.9f", 0x020000, 0x89de1533, BRF_GRA | CPS1_TILES }, - { "11.7b", 0x020000, 0x29eaf490, BRF_GRA | CPS1_TILES }, - { "03.7a", 0x020000, 0x7bf51337, BRF_GRA | CPS1_TILES }, - { "15.11b", 0x020000, 0xd36cdb91, BRF_GRA | CPS1_TILES }, - { "07.11a", 0x020000, 0xe04af054, BRF_GRA | CPS1_TILES }, - { "26.8e", 0x020000, 0x07fc714b, BRF_GRA | CPS1_TILES }, - { "19.8c", 0x020000, 0x7114e5c6, BRF_GRA | CPS1_TILES }, - { "28.10e", 0x020000, 0xaf62bf07, BRF_GRA | CPS1_TILES }, - { "21.10c", 0x020000, 0x523f462a, BRF_GRA | CPS1_TILES }, - { "12.8b", 0x020000, 0x38652339, BRF_GRA | CPS1_TILES }, - { "04.8a", 0x020000, 0x4951bc0f, BRF_GRA | CPS1_TILES }, - { "16.12b", 0x020000, 0x381608ae, BRF_GRA | CPS1_TILES }, - { "08.12a", 0x020000, 0xb475d4e9, BRF_GRA | CPS1_TILES }, - { "27.9e", 0x020000, 0xa27e81fa, BRF_GRA | CPS1_TILES }, - { "20.9c", 0x020000, 0x002796dc, BRF_GRA | CPS1_TILES }, - { "29.11e", 0x020000, 0x6b41f82d, BRF_GRA | CPS1_TILES }, - { "22.11c", 0x020000, 0x52145369, BRF_GRA | CPS1_TILES }, - - { "23.13c", 0x010000, 0xb3b79d4f, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tke_30.12e", 0x020000, 0xac6e307d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "tke_31.13e", 0x020000, 0x068741db, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "tk22b.1a", 0x000117, 0x1a1ab6d7, BRF_OPT }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Dynwara) -STD_ROM_FN(Dynwara) - -static struct BurnRomInfo DynwarjRomDesc[] = { - { "36.12f", 0x020000, 0x1a516657, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "42.12h", 0x020000, 0x12a290a0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "37.13f", 0x020000, 0x932fc943, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "43.13h", 0x020000, 0x872ad76d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "34.10f", 0x020000, 0x8f663d00, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "40.10h", 0x020000, 0x1586dbf3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "35.11f", 0x020000, 0x9db93d7a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41.11h", 0x020000, 0x1aae69a4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "09.4b", 0x020000, 0xc3e83c69, BRF_GRA | CPS1_TILES }, - { "01.4a", 0x020000, 0x187b2886, BRF_GRA | CPS1_TILES }, - { "13.9b", 0x020000, 0x0273d87d, BRF_GRA | CPS1_TILES }, - { "05.9a", 0x020000, 0x339378b8, BRF_GRA | CPS1_TILES }, - { "24.5e", 0x020000, 0xc6909b6f, BRF_GRA | CPS1_TILES }, - { "17.5c", 0x020000, 0x2e2f8320, BRF_GRA | CPS1_TILES }, - { "38.8h", 0x020000, 0xcd7923ed, BRF_GRA | CPS1_TILES }, - { "32.8f", 0x020000, 0x21a0a453, BRF_GRA | CPS1_TILES }, - { "10.5b", 0x020000, 0xff28f8d0, BRF_GRA | CPS1_TILES }, - { "02.5a", 0x020000, 0xcc83c02f, BRF_GRA | CPS1_TILES }, - { "14.10b", 0x020000, 0x18fb232c, BRF_GRA | CPS1_TILES }, // 1 byte different from dynwara, pcb verified - { "06.10a", 0x020000, 0x6f9edd75, BRF_GRA | CPS1_TILES }, - { "25.7e", 0x020000, 0x152ea74a, BRF_GRA | CPS1_TILES }, - { "18.7c", 0x020000, 0x1833f932, BRF_GRA | CPS1_TILES }, - { "39.9h", 0x020000, 0xbc09b360, BRF_GRA | CPS1_TILES }, - { "33.9f", 0x020000, 0x89de1533, BRF_GRA | CPS1_TILES }, - { "11.7b", 0x020000, 0x29eaf490, BRF_GRA | CPS1_TILES }, - { "03.7a", 0x020000, 0x7bf51337, BRF_GRA | CPS1_TILES }, - { "15.11b", 0x020000, 0xd36cdb91, BRF_GRA | CPS1_TILES }, - { "07.11a", 0x020000, 0xe04af054, BRF_GRA | CPS1_TILES }, - { "26.8e", 0x020000, 0x07fc714b, BRF_GRA | CPS1_TILES }, - { "19.8c", 0x020000, 0x7114e5c6, BRF_GRA | CPS1_TILES }, - { "28.10e", 0x020000, 0xaf62bf07, BRF_GRA | CPS1_TILES }, - { "21.10c", 0x020000, 0x523f462a, BRF_GRA | CPS1_TILES }, - { "12.8b", 0x020000, 0x38652339, BRF_GRA | CPS1_TILES }, - { "04.8a", 0x020000, 0x4951bc0f, BRF_GRA | CPS1_TILES }, - { "16.12b", 0x020000, 0x381608ae, BRF_GRA | CPS1_TILES }, - { "08.12a", 0x020000, 0xb475d4e9, BRF_GRA | CPS1_TILES }, - { "27.9e", 0x020000, 0xa27e81fa, BRF_GRA | CPS1_TILES }, - { "20.9c", 0x020000, 0x002796dc, BRF_GRA | CPS1_TILES }, - { "29.11e", 0x020000, 0x6b41f82d, BRF_GRA | CPS1_TILES }, - { "22.11c", 0x020000, 0x52145369, BRF_GRA | CPS1_TILES }, - - { "23.13c", 0x010000, 0xb3b79d4f, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "30.12e", 0x020000, 0x7e5f6cb4, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "31.13e", 0x020000, 0x4a30c737, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "tk22b.1a", 0x000117, 0x1a1ab6d7, BRF_OPT }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Dynwarj) -STD_ROM_FN(Dynwarj) - -static struct BurnRomInfo DynwarjrRomDesc[] = { - { "tk1j_23.8f", 0x080000, 0x088a3009, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk1j_22.7f", 0x080000, 0x93654bcf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk1_01.3a", 0x080000, 0xf64bb6a0, BRF_GRA | CPS1_TILES }, - { "tk1_02.4a", 0x080000, 0x21fe6274, BRF_GRA | CPS1_TILES }, - { "tk1_03.5a", 0x080000, 0x0bf228cb, BRF_GRA | CPS1_TILES }, - { "tk1_04.6a", 0x080000, 0x1255dfb1, BRF_GRA | CPS1_TILES }, - { "tk1_05.7a", 0x080000, 0x44f7661e, BRF_GRA | CPS1_TILES }, - { "tk1_06.8a", 0x080000, 0xa54c515d, BRF_GRA | CPS1_TILES }, - { "tk1_07.9a", 0x080000, 0xca5c687c, BRF_GRA | CPS1_TILES }, - { "tk1_08.10a", 0x080000, 0xf9fe6591, BRF_GRA | CPS1_TILES }, - - { "tk1_09.12a", 0x020000, 0xdb77d899, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk1_18.11c", 0x020000, 0x7e5f6cb4, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "tk1_19.12c", 0x020000, 0x4a30c737, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "tk163b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP },// b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Dynwarjr) -STD_ROM_FN(Dynwarjr) - -static struct BurnRomInfo FfightRomDesc[] = { - { "ff_36.11f", 0x020000, 0xf9a5ce83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_42.11h", 0x020000, 0x65f11215, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_37.12f", 0x020000, 0xe1033784, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffe_43.12h", 0x020000, 0x995e968a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff-32m.8h", 0x080000, 0xc747696e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ff-5m.7a", 0x080000, 0x9c284108, BRF_GRA | CPS1_TILES }, - { "ff-7m.9a", 0x080000, 0xa7584dfb, BRF_GRA | CPS1_TILES }, - { "ff-1m.3a", 0x080000, 0x0b605e44, BRF_GRA | CPS1_TILES }, - { "ff-3m.5a", 0x080000, 0x52291cd2, BRF_GRA | CPS1_TILES }, - - { "ff_09.12b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_18.11c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_19.12c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s224b.1a", 0x000117, 0xcdc4413e, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Ffight) -STD_ROM_FN(Ffight) - -static struct BurnRomInfo FfightaRomDesc[] = { - { "ffe_30.11f", 0x020000, 0x2347bf51, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffe_35.11h", 0x020000, 0x5f694ecc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffe_31.12f", 0x020000, 0x6dc6b792, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffe_36.12h", 0x020000, 0xb36a0b99, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff-32m.8h", 0x080000, 0xc747696e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ff-5m.7a", 0x080000, 0x9c284108, BRF_GRA | CPS1_TILES }, - { "ff-7m.9a", 0x080000, 0xa7584dfb, BRF_GRA | CPS1_TILES }, - { "ff-1m.3a", 0x080000, 0x0b605e44, BRF_GRA | CPS1_TILES }, - { "ff-3m.5a", 0x080000, 0x52291cd2, BRF_GRA | CPS1_TILES }, - - { "ffe_23.12b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_18.11c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_19.12c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s224b.1a", 0x000117, 0xcdc4413e, BRF_OPT }, // b-board PLDs - { "lwio.11e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Ffighta) -STD_ROM_FN(Ffighta) - -static struct BurnRomInfo FfightuRomDesc[] = { - { "ff_36.11f", 0x020000, 0xf9a5ce83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_42.11h", 0x020000, 0x65f11215, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_37.12f", 0x020000, 0xe1033784, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_43.12h", 0x020000, 0x4ca65947, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff-32m.8h", 0x080000, 0xc747696e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ff-5m.7a", 0x080000, 0x9c284108, BRF_GRA | CPS1_TILES }, - { "ff-7m.9a", 0x080000, 0xa7584dfb, BRF_GRA | CPS1_TILES }, - { "ff-1m.3a", 0x080000, 0x0b605e44, BRF_GRA | CPS1_TILES }, - { "ff-3m.5a", 0x080000, 0x52291cd2, BRF_GRA | CPS1_TILES }, - - { "ff_09.12b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_18.11c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_19.12c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s224b.1a", 0x000117, 0xcdc4413e, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightu) -STD_ROM_FN(Ffightu) - -static struct BurnRomInfo Ffightu1RomDesc[] = { - { "ff_36.11f", 0x020000, 0xf9a5ce83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_42.11h", 0x020000, 0x65f11215, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_37.12f", 0x020000, 0xe1033784, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_43.12h", 0x020000, 0x4ca65947, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_34.9f", 0x020000, 0x0c8dc3fc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_40.9h", 0x020000, 0x8075bab9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_35.10f", 0x020000, 0x4a934121, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_41.10h", 0x020000, 0x2af68154, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "ff-5m.7a", 0x080000, 0x9c284108, BRF_GRA | CPS1_TILES }, - { "ff-7m.9a", 0x080000, 0xa7584dfb, BRF_GRA | CPS1_TILES }, - { "ff-1m.3a", 0x080000, 0x0b605e44, BRF_GRA | CPS1_TILES }, - { "ff-3m.5a", 0x080000, 0x52291cd2, BRF_GRA | CPS1_TILES }, - - { "ff_09.12b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_18.11c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_19.12c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s224b.1a", 0x000117, 0xcdc4413e, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightu1) -STD_ROM_FN(Ffightu1) - -static struct BurnRomInfo Ffightu2RomDesc[] = { - { "ffu_h0.12f", 0x020000, 0xf9a5ce83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_l0.12h", 0x020000, 0x65f11215, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_h1.13f", 0x020000, 0xe1033784, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_l1.13h", 0x020000, 0x4ca65947, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "34.10f", 0x020000, 0x0c8dc3fc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "40.10h", 0x020000, 0x8075bab9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "35.11f", 0x020000, 0x4a934121, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "41.11h", 0x020000, 0x2af68154, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "09.4b", 0x020000, 0x5b116d0d, BRF_GRA | CPS1_TILES }, - { "01.4a", 0x020000, 0x815b1797, BRF_GRA | CPS1_TILES }, - { "13.9b", 0x020000, 0x8721a7da, BRF_GRA | CPS1_TILES }, - { "05.9a", 0x020000, 0xd0fcd4b5, BRF_GRA | CPS1_TILES }, - { "24.5e", 0x020000, 0xa1ab607a, BRF_GRA | CPS1_TILES }, - { "19.7c", 0x020000, 0x2dc18cf4, BRF_GRA | CPS1_TILES }, - { "38.8h", 0x020000, 0x6535a57f, BRF_GRA | CPS1_TILES }, - { "32.8f", 0x020000, 0xc8bc4a57, BRF_GRA | CPS1_TILES }, - { "10.5b", 0x020000, 0x624a924a, BRF_GRA | CPS1_TILES }, - { "02.5a", 0x020000, 0x5d91f694, BRF_GRA | CPS1_TILES }, - { "14.10b", 0x020000, 0x0a2e9101, BRF_GRA | CPS1_TILES }, - { "06.10a", 0x020000, 0x1c18f042, BRF_GRA | CPS1_TILES }, - { "25.7e", 0x020000, 0x6e8181ea, BRF_GRA | CPS1_TILES }, - { "18.5c", 0x020000, 0xb19ede59, BRF_GRA | CPS1_TILES }, - { "39.9h", 0x020000, 0x9416b477, BRF_GRA | CPS1_TILES }, - { "33.9f", 0x020000, 0x7369fa07, BRF_GRA | CPS1_TILES }, - - { "s.13c", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "30.12e", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "31.13e", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s222b.1a", 0x000117, 0x6d86b45e, BRF_OPT }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightu2) -STD_ROM_FN(Ffightu2) - -static struct BurnRomInfo FfightuaRomDesc[] = { - { "ffu_36.11f", 0x020000, 0xe2a48af9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // in "30" socket - { "ffu_42.11h", 0x020000, 0xf4bb480e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // in "35" socket - { "ffu_37.12f", 0x020000, 0xc371c667, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // in "31" socket - { "ffu_43.12h", 0x020000, 0x2f5771f9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // in "36" socket / different CRC from ffightu, ffightu1, pcb verified - { "ff-32m.8h", 0x080000, 0xc747696e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ff-5m.7a", 0x080000, 0x9c284108, BRF_GRA | CPS1_TILES }, - { "ff-7m.9a", 0x080000, 0xa7584dfb, BRF_GRA | CPS1_TILES }, - { "ff-1m.3a", 0x080000, 0x0b605e44, BRF_GRA | CPS1_TILES }, - { "ff-3m.5a", 0x080000, 0x52291cd2, BRF_GRA | CPS1_TILES }, - - { "ff_09.12b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_18.11c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_19.12c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s224b.1a", 0x000117, 0xcdc4413e, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightua) -STD_ROM_FN(Ffightua) - -static struct BurnRomInfo FfightubRomDesc[] = { - { "ffu_30_3.11f", 0x020000, 0xe619eb30, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_35_3.11h", 0x020000, 0xbca85263, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_31_3.12f", 0x020000, 0x59abd207, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_36_3.12h", 0x020000, 0xdf46ece8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff-32m.8h", 0x080000, 0xc747696e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ff-5m.7a", 0x080000, 0x9c284108, BRF_GRA | CPS1_TILES }, - { "ff-7m.9a", 0x080000, 0xa7584dfb, BRF_GRA | CPS1_TILES }, - { "ff-1m.3a", 0x080000, 0x0b605e44, BRF_GRA | CPS1_TILES }, - { "ff-3m.5a", 0x080000, 0x52291cd2, BRF_GRA | CPS1_TILES }, - - { "ff_09.12b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_18.11c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_19.12c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s224b.1a", 0x000117, 0xcdc4413e, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightub) -STD_ROM_FN(Ffightub) - -static struct BurnRomInfo FfightucRomDesc[] = { - { "ffu_30.11f", 0x020000, 0xed988977, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_35.11h", 0x020000, 0x07bf1c21, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_31.12f", 0x020000, 0xdba5a476, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffu_36.12h", 0x020000, 0x4d89f542, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff-32m.8h", 0x080000, 0xc747696e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ff-5m.7a", 0x080000, 0x9c284108, BRF_GRA | CPS1_TILES }, - { "ff-7m.9a", 0x080000, 0xa7584dfb, BRF_GRA | CPS1_TILES }, - { "ff-1m.3a", 0x080000, 0x0b605e44, BRF_GRA | CPS1_TILES }, - { "ff-3m.5a", 0x080000, 0x52291cd2, BRF_GRA | CPS1_TILES }, - - { "ff_23.12b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, // == ff_09.12b /* label is FF_23, pcb verified */ - - { "ff_18.11c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_19.12c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s224b.1a", 0x000117, 0xcdc4413e, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightuc) -STD_ROM_FN(Ffightuc) - -static struct BurnRomInfo FfightjRomDesc[] = { - { "ff36.bin", 0x020000, 0xf9a5ce83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff42.bin", 0x020000, 0x65f11215, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff37.bin", 0x020000, 0xe1033784, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff43.bin", 0x020000, 0xb6dee1c3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_34.10f", 0x020000, 0x0c8dc3fc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_40.10h", 0x020000, 0x8075bab9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_35.11f", 0x020000, 0x4a934121, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_41.11h", 0x020000, 0x2af68154, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "ffj_09.4b", 0x020000, 0x5b116d0d, BRF_GRA | CPS1_TILES }, - { "ffj_01.4a", 0x020000, 0x815b1797, BRF_GRA | CPS1_TILES }, - { "ffj_13.9b", 0x020000, 0x8721a7da, BRF_GRA | CPS1_TILES }, - { "ffj_05.9a", 0x020000, 0xd0fcd4b5, BRF_GRA | CPS1_TILES }, - { "ffj_24.5e", 0x020000, 0xa1ab607a, BRF_GRA | CPS1_TILES }, - { "ffj_17.5c", 0x020000, 0x2dc18cf4, BRF_GRA | CPS1_TILES }, - { "ffj_38.8h", 0x020000, 0x6535a57f, BRF_GRA | CPS1_TILES }, - { "ffj_32.8f", 0x020000, 0xc8bc4a57, BRF_GRA | CPS1_TILES }, - { "ffj_10.5b", 0x020000, 0x624a924a, BRF_GRA | CPS1_TILES }, - { "ffj_02.5a", 0x020000, 0x5d91f694, BRF_GRA | CPS1_TILES }, - { "ffj_14.10b", 0x020000, 0x0a2e9101, BRF_GRA | CPS1_TILES }, - { "ffj_06.10a", 0x020000, 0x1c18f042, BRF_GRA | CPS1_TILES }, - { "ffj_25.7e", 0x020000, 0x6e8181ea, BRF_GRA | CPS1_TILES }, - { "ffj_18.7c", 0x020000, 0xb19ede59, BRF_GRA | CPS1_TILES }, - { "ffj_39.9h", 0x020000, 0x9416b477, BRF_GRA | CPS1_TILES }, - { "ffj_33.9f", 0x020000, 0x7369fa07, BRF_GRA | CPS1_TILES }, - - { "ff_23.bin", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ffj_30.bin", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ffj_31.bin", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s222b.1a", 0x000117, 0x6d86b45e, BRF_OPT }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightj) -STD_ROM_FN(Ffightj) - -static struct BurnRomInfo Ffightj1RomDesc[] = { - { "ffj_36.12f", 0x020000, 0xe2a48af9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_42.12h", 0x020000, 0xf4bb480e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_37.13f", 0x020000, 0xc371c667, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_43.13h", 0x020000, 0x6f81f194, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_34.10f", 0x020000, 0x0c8dc3fc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_40.10h", 0x020000, 0x8075bab9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_35.11f", 0x020000, 0x4a934121, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_41.11h", 0x020000, 0x2af68154, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "ffj_09.4b", 0x020000, 0x5b116d0d, BRF_GRA | CPS1_TILES }, - { "ffj_01.4a", 0x020000, 0x815b1797, BRF_GRA | CPS1_TILES }, - { "ffj_13.9b", 0x020000, 0x8721a7da, BRF_GRA | CPS1_TILES }, - { "ffj_05.9a", 0x020000, 0xd0fcd4b5, BRF_GRA | CPS1_TILES }, - { "ffj_24.5e", 0x020000, 0xa1ab607a, BRF_GRA | CPS1_TILES }, - { "ffj_17.5c", 0x020000, 0x2dc18cf4, BRF_GRA | CPS1_TILES }, - { "ffj_38.8h", 0x020000, 0x6535a57f, BRF_GRA | CPS1_TILES }, - { "ffj_32.8f", 0x020000, 0xc8bc4a57, BRF_GRA | CPS1_TILES }, - { "ffj_10.5b", 0x020000, 0x624a924a, BRF_GRA | CPS1_TILES }, - { "ffj_02.5a", 0x020000, 0x5d91f694, BRF_GRA | CPS1_TILES }, - { "ffj_14.10b", 0x020000, 0x0a2e9101, BRF_GRA | CPS1_TILES }, - { "ffj_06.10a", 0x020000, 0x1c18f042, BRF_GRA | CPS1_TILES }, - { "ffj_25.7e", 0x020000, 0x6e8181ea, BRF_GRA | CPS1_TILES }, - { "ffj_18.7c", 0x020000, 0xb19ede59, BRF_GRA | CPS1_TILES }, - { "ffj_39.9h", 0x020000, 0x9416b477, BRF_GRA | CPS1_TILES }, - { "ffj_33.9f", 0x020000, 0x7369fa07, BRF_GRA | CPS1_TILES }, - - { "ff_23.13b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ffj_30.12c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ffj_31.13c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s222b.1a", 0x000117, 0x6d86b45e, BRF_OPT }, // b-board PLDs - { "lwio.12e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightj1) -STD_ROM_FN(Ffightj1) - -static struct BurnRomInfo Ffightj2RomDesc[] = { - { "ffj_36a.12f", 0x020000, 0x088ed1c9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_42a.12h", 0x020000, 0xc4c491e6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_37a.13f", 0x020000, 0x708557ff, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_43a.13h", 0x020000, 0xc004004a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_34.10f", 0x020000, 0x0c8dc3fc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_40.10h", 0x020000, 0x8075bab9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_35.11f", 0x020000, 0x4a934121, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_41.11h", 0x020000, 0x2af68154, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "ff_09.4b", 0x020000, 0x5b116d0d, BRF_GRA | CPS1_TILES }, - { "ff_01.4a", 0x020000, 0x815b1797, BRF_GRA | CPS1_TILES }, - { "ff_13.9b", 0x020000, 0x8721a7da, BRF_GRA | CPS1_TILES }, - { "ff_05.9a", 0x020000, 0xd0fcd4b5, BRF_GRA | CPS1_TILES }, - { "ff_24.5e", 0x020000, 0xa1ab607a, BRF_GRA | CPS1_TILES }, - { "ff_17.5c", 0x020000, 0x2dc18cf4, BRF_GRA | CPS1_TILES }, - { "ff_38.8h", 0x020000, 0x6535a57f, BRF_GRA | CPS1_TILES }, - { "ff_32.8f", 0x020000, 0xc8bc4a57, BRF_GRA | CPS1_TILES }, - { "ff_10.5b", 0x020000, 0x624a924a, BRF_GRA | CPS1_TILES }, - { "ff_02.5a", 0x020000, 0x5d91f694, BRF_GRA | CPS1_TILES }, - { "ff_14.10b", 0x020000, 0x0a2e9101, BRF_GRA | CPS1_TILES }, - { "ff_06.10a", 0x020000, 0x1c18f042, BRF_GRA | CPS1_TILES }, - { "ff_25.7e", 0x020000, 0x6e8181ea, BRF_GRA | CPS1_TILES }, - { "ff_18.7c", 0x020000, 0xb19ede59, BRF_GRA | CPS1_TILES }, - { "ff_39.9h", 0x020000, 0x9416b477, BRF_GRA | CPS1_TILES }, - { "ff_33.9f", 0x020000, 0x7369fa07, BRF_GRA | CPS1_TILES }, - - { "ff_23.13c", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_30.12e", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_31.13e", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s222b.1a", 0x000117, 0x6d86b45e, BRF_OPT }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightj2) -STD_ROM_FN(Ffightj2) - -static struct BurnRomInfo Ffightj3RomDesc[] = { - { "ff_36.12f", 0x020000, 0xed988977, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_42.12h", 0x020000, 0x07bf1c21, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_37.13f", 0x020000, 0xdba5a476, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_43.13h", 0x020000, 0xfbeca028, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_34.10f", 0x020000, 0x0c8dc3fc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_40.10h", 0x020000, 0x8075bab9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ff_35.11f", 0x020000, 0x4a934121, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ffj_41.11h", 0x020000, 0x2af68154, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "ff_09.4b", 0x020000, 0x5b116d0d, BRF_GRA | CPS1_TILES }, - { "ff_01.4a", 0x020000, 0x815b1797, BRF_GRA | CPS1_TILES }, - { "ff_13.9b", 0x020000, 0x8721a7da, BRF_GRA | CPS1_TILES }, - { "ff_05.9a", 0x020000, 0xd0fcd4b5, BRF_GRA | CPS1_TILES }, - { "ff_24.5e", 0x020000, 0xa1ab607a, BRF_GRA | CPS1_TILES }, - { "ff_17.5c", 0x020000, 0x2dc18cf4, BRF_GRA | CPS1_TILES }, - { "ffj_38.8h", 0x020000, 0x6535a57f, BRF_GRA | CPS1_TILES }, - { "ff_32.8f", 0x020000, 0xc8bc4a57, BRF_GRA | CPS1_TILES }, - { "ff_10.5b", 0x020000, 0x624a924a, BRF_GRA | CPS1_TILES }, - { "ff_02.5a", 0x020000, 0x5d91f694, BRF_GRA | CPS1_TILES }, - { "ff_14.10b", 0x020000, 0x0a2e9101, BRF_GRA | CPS1_TILES }, - { "ff_06.10a", 0x020000, 0x1c18f042, BRF_GRA | CPS1_TILES }, - { "ff_25.7e", 0x020000, 0x6e8181ea, BRF_GRA | CPS1_TILES }, - { "ff_18.7c", 0x020000, 0xb19ede59, BRF_GRA | CPS1_TILES }, - { "ffj_39.9h", 0x020000, 0x9416b477, BRF_GRA | CPS1_TILES }, - { "ff_33.9f", 0x020000, 0x7369fa07, BRF_GRA | CPS1_TILES }, - - { "ff_23.13b", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_30.12c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_31.13c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s222b.1a", 0x000117, 0x6d86b45e, BRF_OPT }, // b-board PLDs - { "lwio.12e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Ffightj3) -STD_ROM_FN(Ffightj3) - -static struct BurnRomInfo FfightjhRomDesc[] = { - { "ff_23.8f", 0x080000, 0xae3dda7f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "ff_22.7f", 0x080000, 0xb2d5a3aa, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ff_1.3a", 0x080000, 0x969d18e2, BRF_GRA | CPS1_TILES }, - { "ff_2.4a", 0x080000, 0x02b59f99, BRF_GRA | CPS1_TILES }, - { "ff_3.5a", 0x080000, 0x01d507ae, BRF_GRA | CPS1_TILES }, - { "ff_4.6a", 0x080000, 0xf7c4ceb0, BRF_GRA | CPS1_TILES }, - - { "ff_9.12a", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ff_18.11c", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ff_19.12c", 0x020000, 0x1ef137f9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "gal16v8a-15lp.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Ffightjh) -STD_ROM_FN(Ffightjh) - -static struct BurnRomInfo FfightblRomDesc[] = { - { "fg-e.bin", 0x080000, 0xf8ccf27e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "fg-f.bin", 0x080000, 0xd96c76b2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "fg-d.bin", 0x080000, 0x4303f863, BRF_GRA | CPS1_TILES }, - { "fg-c.bin", 0x080000, 0xd1dfcd2d, BRF_GRA | CPS1_TILES }, - { "fg-b.bin", 0x080000, 0x22f2c097, BRF_GRA | CPS1_TILES }, - { "fg-a.bin", 0x080000, 0x16a89b2c, BRF_GRA | CPS1_TILES }, - - { "ff1.bin", 0x020000, 0x5b276c14, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Ffightbl) -STD_ROM_FN(Ffightbl) - -static struct BurnRomInfo FfightblaRomDesc[] = { - // This dump comes from another ffight bootleg. It contains same datas as ffightbl but reordered in smaller roms. - // Almost identical to Final Crash except for ROMs 19, 21, 23 and 25. - { "9.bin", 0x020000, 0xc6854c91, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // fg-e.bin - { "5.bin", 0x020000, 0x77f7c2b3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // fg-f.bin - { "8.bin", 0x020000, 0x1895b3df, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // fg-e.bin - { "4.bin", 0x020000, 0xbbd411ee, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // fg-f.bin - { "7.bin", 0x020000, 0x5b23ebf2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP } ,// fg-e.bin - { "3.bin", 0x020000, 0xaba2aebe, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // fg-f.bin - { "6.bin", 0x020000, 0xd4bf37f6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // fg-e.bin - { "2.bin", 0x020000, 0x07ac8f43, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // fg-f.bin - - { "18.bin", 0x020000, 0xf1eee6d9, BRF_GRA | CPS1_TILES }, // fg-d.bin - { "20.bin", 0x020000, 0x675f4537, BRF_GRA | CPS1_TILES }, // fg-c.bin - { "22.bin", 0x020000, 0xdb8a32ac, BRF_GRA | CPS1_TILES }, // fg-b.bin - { "24.bin", 0x020000, 0xf4113e57, BRF_GRA | CPS1_TILES }, // fg-a.bin - { "10.bin", 0x020000, 0xd478853e, BRF_GRA | CPS1_TILES }, // fg-d.bin - { "12.bin", 0x020000, 0x25055642, BRF_GRA | CPS1_TILES }, // fg-c.bin - { "14.bin", 0x020000, 0xb77d0328, BRF_GRA | CPS1_TILES }, // fg-b.bin - { "16.bin", 0x020000, 0xea111a79, BRF_GRA | CPS1_TILES }, // fg-a.bin - { "ff-19.bin", 0x020000, 0x7bc03747, BRF_GRA | CPS1_TILES }, // fg-d.bin - { "ff-21.bin", 0x020000, 0x0c248e2b, BRF_GRA | CPS1_TILES }, // fg-c.bin - { "ff-23.bin", 0x020000, 0x53949d0e, BRF_GRA | CPS1_TILES }, // fg-b.bin - { "ff-25.bin", 0x020000, 0x8d34a67d, BRF_GRA | CPS1_TILES }, // fg-a.bin - { "11.bin", 0x020000, 0xd4457a60, BRF_GRA | CPS1_TILES }, // fg-d.bin - { "13.bin", 0x020000, 0x3b26a37d, BRF_GRA | CPS1_TILES }, // fg-c.bin - { "15.bin", 0x020000, 0x6d837e09, BRF_GRA | CPS1_TILES }, // fg-b.bin - { "17.bin", 0x020000, 0xc59a4d6c, BRF_GRA | CPS1_TILES }, // fg-a.bin - - { "1.bin", 0x020000, 0x5b276c14, BRF_PRG | CPS1_Z80_PROGRAM }, // ff1.bin -}; - -STD_ROM_PICK(Ffightbla) -STD_ROM_FN(Ffightbla) - -static struct BurnRomInfo FcrashRomDesc[] = { - { "9.bin", 0x020000, 0xc6854c91, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "5.bin", 0x020000, 0x77f7c2b3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "8.bin", 0x020000, 0x1895b3df, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.bin", 0x020000, 0xbbd411ee, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "7.bin", 0x020000, 0x5b23ebf2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "3.bin", 0x020000, 0xaba2aebe, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "6.bin", 0x020000, 0xd4bf37f6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.bin", 0x020000, 0x07ac8f43, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "18.bin", 0x020000, 0xf1eee6d9, BRF_GRA | CPS1_TILES }, - { "20.bin", 0x020000, 0x675f4537, BRF_GRA | CPS1_TILES }, - { "22.bin", 0x020000, 0xdb8a32ac, BRF_GRA | CPS1_TILES }, - { "24.bin", 0x020000, 0xf4113e57, BRF_GRA | CPS1_TILES }, - { "10.bin", 0x020000, 0xd478853e, BRF_GRA | CPS1_TILES }, - { "12.bin", 0x020000, 0x25055642, BRF_GRA | CPS1_TILES }, - { "14.bin", 0x020000, 0xb77d0328, BRF_GRA | CPS1_TILES }, - { "16.bin", 0x020000, 0xea111a79, BRF_GRA | CPS1_TILES }, - { "19.bin", 0x020000, 0xb3aa1f48, BRF_GRA | CPS1_TILES }, - { "21.bin", 0x020000, 0x04d175c9, BRF_GRA | CPS1_TILES }, - { "23.bin", 0x020000, 0xe592ba4f, BRF_GRA | CPS1_TILES }, - { "25.bin", 0x020000, 0xb89a740f, BRF_GRA | CPS1_TILES }, - { "11.bin", 0x020000, 0xd4457a60, BRF_GRA | CPS1_TILES }, - { "13.bin", 0x020000, 0x3b26a37d, BRF_GRA | CPS1_TILES }, - { "15.bin", 0x020000, 0x6d837e09, BRF_GRA | CPS1_TILES }, - { "17.bin", 0x020000, 0xc59a4d6c, BRF_GRA | CPS1_TILES }, - - { "1.bin", 0x020000, 0x5b276c14, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Fcrash) -STD_ROM_FN(Fcrash) - -static struct BurnRomInfo ForgottnRomDesc[] = { - { "lw40.12f", 0x020000, 0x73e920b7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, /* Higher program numbers indicates a later revision */ - { "lw41.12h", 0x020000, 0x58210b9e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, /* 1 byte difference: 0x66D4 == 0x0C versus 0x04 in lw15.12h below */ - { "lw42.13f", 0x020000, 0xbea45994, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw43.13h", 0x020000, 0x539b2339, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw-07.10g", 0x080000, 0xfd252a26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "lw_2.2b", 0x020000, 0x4bd75fee, BRF_GRA | CPS1_TILES }, - { "lw_1.2a", 0x020000, 0x65f41485, BRF_GRA | CPS1_TILES }, - { "lw-08.9b", 0x080000, 0x25a8e43c, BRF_GRA | CPS1_TILES }, - { "lw_18.5e", 0x020000, 0xb4b6241b, BRF_GRA | CPS1_TILES }, - { "lw_17.5c", 0x020000, 0xc5eea115, BRF_GRA | CPS1_TILES }, - { "lw_30.8h", 0x020000, 0xb385954e, BRF_GRA | CPS1_TILES }, - { "lw_29.8f", 0x020000, 0x7bda1ac6, BRF_GRA | CPS1_TILES }, - { "lw_4.3b", 0x020000, 0x50cf757f, BRF_GRA | CPS1_TILES }, - { "lw_3.3a", 0x020000, 0xc03ef278, BRF_GRA | CPS1_TILES }, - { "lw_20.7e", 0x020000, 0xdf1a3665, BRF_GRA | CPS1_TILES }, - { "lw_19.7c", 0x020000, 0x15af8440, BRF_GRA | CPS1_TILES }, - { "lw_32.9h", 0x020000, 0x30967a15, BRF_GRA | CPS1_TILES }, - { "lw_31.9f", 0x020000, 0xc49d37fb, BRF_GRA | CPS1_TILES }, - { "lw-02.6b", 0x080000, 0x43e6c5c8, BRF_GRA | CPS1_TILES }, - { "lw_14.10b", 0x020000, 0x82862cce, BRF_GRA | CPS1_TILES }, - { "lw_13.10a", 0x020000, 0xb81c0e96, BRF_GRA | CPS1_TILES }, - { "lw-06.9d", 0x080000, 0x5b9edffc, BRF_GRA | CPS1_TILES }, - { "lw_26.10e", 0x020000, 0x57bcd032, BRF_GRA | CPS1_TILES }, - { "lw_25.10c", 0x020000, 0xbac91554, BRF_GRA | CPS1_TILES }, - { "lw_16.11b", 0x020000, 0x40b26554, BRF_GRA | CPS1_TILES }, - { "lw_15.11a", 0x020000, 0x1b7d2e07, BRF_GRA | CPS1_TILES }, - { "lw_28.11e", 0x020000, 0xa805ad30, BRF_GRA | CPS1_TILES }, - { "lw_27.11c", 0x020000, 0x103c1bd2, BRF_GRA | CPS1_TILES }, - - { "lw_37.13c", 0x010000, 0x59df2a63, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "lw-03u.12e", 0x020000, 0x807d051f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "lw-04u.13e", 0x020000, 0xe6cd098e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "lw621.1a", 0x000117, 0x5eec6ce9, BRF_OPT }, // b-board PLDs - { "lwio.12b", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Forgottn) -STD_ROM_FN(Forgottn) - -static struct BurnRomInfo ForgottnaRomDesc[] = { - { "lw11.12f", 0x020000, 0x73e920b7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw15.12h", 0x020000, 0x50d7012d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw10.13f", 0x020000, 0xbea45994, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw14.13h", 0x020000, 0x539b2339, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw-07.10g", 0x080000, 0xfd252a26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "lw_2.2b", 0x020000, 0x4bd75fee, BRF_GRA | CPS1_TILES }, - { "lw_1.2a", 0x020000, 0x65f41485, BRF_GRA | CPS1_TILES }, - { "lw-08.9b", 0x080000, 0x25a8e43c, BRF_GRA | CPS1_TILES }, - { "lw-05.6d", 0x080000, 0xe4552fd7, BRF_GRA | CPS1_TILES }, - { "lw_30.8h", 0x020000, 0xb385954e, BRF_GRA | CPS1_TILES }, - { "lw_29.8f", 0x020000, 0x7bda1ac6, BRF_GRA | CPS1_TILES }, - { "lw_4.3b", 0x020000, 0x50cf757f, BRF_GRA | CPS1_TILES }, - { "lw_3.3a", 0x020000, 0xc03ef278, BRF_GRA | CPS1_TILES }, - { "lw_32.9h", 0x020000, 0x30967a15, BRF_GRA | CPS1_TILES }, - { "lw_31.9f", 0x020000, 0xc49d37fb, BRF_GRA | CPS1_TILES }, - { "lw-02.6b", 0x080000, 0x43e6c5c8, BRF_GRA | CPS1_TILES }, - { "lw_14.10b", 0x020000, 0x82862cce, BRF_GRA | CPS1_TILES }, - { "lw_13.10a", 0x020000, 0xb81c0e96, BRF_GRA | CPS1_TILES }, - { "lw-06.9d", 0x080000, 0x5b9edffc, BRF_GRA | CPS1_TILES }, - { "lw_26.10e", 0x020000, 0x57bcd032, BRF_GRA | CPS1_TILES }, - { "lw_25.10c", 0x020000, 0xbac91554, BRF_GRA | CPS1_TILES }, - { "lw_16.11b", 0x020000, 0x40b26554, BRF_GRA | CPS1_TILES }, - { "lw_15.11a", 0x020000, 0x1b7d2e07, BRF_GRA | CPS1_TILES }, - { "lw_28.11e", 0x020000, 0xa805ad30, BRF_GRA | CPS1_TILES }, - { "lw_27.11c", 0x020000, 0x103c1bd2, BRF_GRA | CPS1_TILES }, - - { "lw_00.13c", 0x010000, 0x59df2a63, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "lw-03u.12e", 0x020000, 0x807d051f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "lw-04u.13e", 0x020000, 0xe6cd098e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "lw621.1a", 0x000117, 0x5eec6ce9, BRF_OPT }, // b-board PLDs - { "lwio.12b", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Forgottna) -STD_ROM_FN(Forgottna) - -static struct BurnRomInfo ForgottnuRomDesc[] = { - { "lw11c.12f", 0x020000, 0xe62742b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw15c.12h", 0x020000, 0x1b70f216, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw10c.13f", 0x020000, 0x8f5ea3f5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw14c.13h", 0x020000, 0x708e7472, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw-07.10g", 0x080000, 0xfd252a26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "lw_2.2b", 0x020000, 0x4bd75fee, BRF_GRA | CPS1_TILES }, - { "lw_1.2a", 0x020000, 0x65f41485, BRF_GRA | CPS1_TILES }, - { "lw-08.9b", 0x080000, 0x25a8e43c, BRF_GRA | CPS1_TILES }, - { "lw-05.6d", 0x080000, 0xe4552fd7, BRF_GRA | CPS1_TILES }, - { "lw_30.8h", 0x020000, 0xb385954e, BRF_GRA | CPS1_TILES }, - { "lw_29.8f", 0x020000, 0x7bda1ac6, BRF_GRA | CPS1_TILES }, - { "lw_4.3b", 0x020000, 0x50cf757f, BRF_GRA | CPS1_TILES }, - { "lw_3.3a", 0x020000, 0xc03ef278, BRF_GRA | CPS1_TILES }, - { "lw_32.9h", 0x020000, 0x30967a15, BRF_GRA | CPS1_TILES }, - { "lw_31.9f", 0x020000, 0xc49d37fb, BRF_GRA | CPS1_TILES }, - { "lw-02.6b", 0x080000, 0x43e6c5c8, BRF_GRA | CPS1_TILES }, - { "lw_14.10b", 0x020000, 0x82862cce, BRF_GRA | CPS1_TILES }, - { "lw_13.10a", 0x020000, 0xb81c0e96, BRF_GRA | CPS1_TILES }, - { "lw-06.9d", 0x080000, 0x5b9edffc, BRF_GRA | CPS1_TILES }, - { "lw-13.10d", 0x080000, 0x8e058ef5, BRF_GRA | CPS1_TILES }, - { "lw_16.11b", 0x020000, 0x40b26554, BRF_GRA | CPS1_TILES }, - { "lw_15.11a", 0x020000, 0x1b7d2e07, BRF_GRA | CPS1_TILES }, - - { "lw_00.13c", 0x010000, 0x59df2a63, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "lw-03u.12e", 0x020000, 0x807d051f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "lw-04u.13e", 0x020000, 0xe6cd098e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "lw621.1a", 0x000117, 0x5eec6ce9, BRF_OPT }, // b-board PLDs - { "lwio.12b", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Forgottnu) -STD_ROM_FN(Forgottnu) - -static struct BurnRomInfo ForgottnuaRomDesc[] = { - { "lwu_11a.14f", 0x020000, 0xddf78831, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lwu_15a.14g", 0x020000, 0xf7ce2097, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lwu_10a.13f", 0x020000, 0x8cb38c81, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lwu_14a.13g", 0x020000, 0xd70ef9fd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw-07.13e", 0x080000, 0xfd252a26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "lw-01.9d", 0x080000, 0x0318f298, BRF_GRA | CPS1_TILES }, - { "lw-08.9f", 0x080000, 0x25a8e43c, BRF_GRA | CPS1_TILES }, - { "lw-05.9e", 0x080000, 0xe4552fd7, BRF_GRA | CPS1_TILES }, - { "lw-12.9g", 0x080000, 0x8e6a832b, BRF_GRA | CPS1_TILES }, - { "lw-02.12d", 0x080000, 0x43e6c5c8, BRF_GRA | CPS1_TILES }, - { "lw-09.12f", 0x080000, 0x899cb4ad, BRF_GRA | CPS1_TILES }, - { "lw-06.12e", 0x080000, 0x5b9edffc, BRF_GRA | CPS1_TILES }, - { "lw-13.12g", 0x080000, 0x8e058ef5, BRF_GRA | CPS1_TILES }, - - { "lwu_00.14a", 0x010000, 0x59df2a63, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "lw-03u.14c", 0x020000, 0x807d051f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "lw-04u.13c", 0x020000, 0xe6cd098e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "lwchr.3a", 0x000117, 0x54ed4c39, BRF_OPT }, // b-board PLDs - { "lwio.15e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Forgottnua) -STD_ROM_FN(Forgottnua) - -static struct BurnRomInfo ForgottnuaaRomDesc[] = { - { "lwu_11aa.14f", 0x020000, 0x73e920b7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lwu_15aa.14g", 0x020000, 0xe47524b9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lwu_10aa.13f", 0x020000, 0xbea45994, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lwu_14aa.13g", 0x020000, 0x539b2339, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw-07.13e", 0x080000, 0xfd252a26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "lw-01.9d", 0x080000, 0x0318f298, BRF_GRA | CPS1_TILES }, - { "lw-08.9f", 0x080000, 0x25a8e43c, BRF_GRA | CPS1_TILES }, - { "lw-05.9e", 0x080000, 0xe4552fd7, BRF_GRA | CPS1_TILES }, - { "lw-12.9g", 0x080000, 0x8e6a832b, BRF_GRA | CPS1_TILES }, - { "lw-02.12d", 0x080000, 0x43e6c5c8, BRF_GRA | CPS1_TILES }, - { "lw-09.12f", 0x080000, 0x899cb4ad, BRF_GRA | CPS1_TILES }, - { "lw-06.12e", 0x080000, 0x5b9edffc, BRF_GRA | CPS1_TILES }, - { "lw-13.12g", 0x080000, 0x8e058ef5, BRF_GRA | CPS1_TILES }, - - { "lwu_00.14a", 0x010000, 0x59df2a63, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "lw-03u.14c", 0x020000, 0x807d051f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "lw-04u.13c", 0x020000, 0xe6cd098e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "lwchr.3a", 0x000117, 0x54ed4c39, BRF_OPT }, // b-board PLDs - { "lwio.15e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Forgottnuaa) -STD_ROM_FN(Forgottnuaa) - -static struct BurnRomInfo ForgottnucRomDesc[] = { - { "lw11c.14f", 0x020000, 0xe62742b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw15c.14g", 0x020000, 0x1b70f216, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw10c.13f", 0x020000, 0x8f5ea3f5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw14c.13g", 0x020000, 0x708e7472, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw-07.13e", 0x080000, 0xfd252a26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "lw-01.9d", 0x080000, 0x0318f298, BRF_GRA | CPS1_TILES }, - { "lw-08.9f", 0x080000, 0x25a8e43c, BRF_GRA | CPS1_TILES }, - { "lw-05.9e", 0x080000, 0xe4552fd7, BRF_GRA | CPS1_TILES }, - { "lw-12.9g", 0x080000, 0x8e6a832b, BRF_GRA | CPS1_TILES }, - { "lw-02.12d", 0x080000, 0x43e6c5c8, BRF_GRA | CPS1_TILES }, - { "lw-09.12f", 0x080000, 0x899cb4ad, BRF_GRA | CPS1_TILES }, - { "lw-06.12e", 0x080000, 0x5b9edffc, BRF_GRA | CPS1_TILES }, - { "lw-13.12g", 0x080000, 0x8e058ef5, BRF_GRA | CPS1_TILES }, - - { "lw_00.14a", 0x010000, 0x59df2a63, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "lw-03u.14c", 0x020000, 0x807d051f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "lw-04u.13c", 0x020000, 0xe6cd098e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "lwchr.3a", 0x000117, 0x54ed4c39, BRF_OPT }, // b-board PLDs - { "lwio.15e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Forgottnuc) -STD_ROM_FN(Forgottnuc) - -static struct BurnRomInfo ForgottnueRomDesc[] = { - { "lw11e.14f", 0x020000, 0x82656910, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw15e.14g", 0x020000, 0xfb1e2bd0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw10e.13f", 0x020000, 0x3ce81dbe, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw14e.13g", 0x020000, 0x472eaad1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw-07.13e", 0x080000, 0xfd252a26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "lw-01.9d", 0x080000, 0x0318f298, BRF_GRA | CPS1_TILES }, - { "lw-08.9f", 0x080000, 0x25a8e43c, BRF_GRA | CPS1_TILES }, - { "lw-05.9e", 0x080000, 0xe4552fd7, BRF_GRA | CPS1_TILES }, - { "lw-12.9g", 0x080000, 0x8e6a832b, BRF_GRA | CPS1_TILES }, - { "lw-02.12d", 0x080000, 0x43e6c5c8, BRF_GRA | CPS1_TILES }, - { "lw-09.12f", 0x080000, 0x899cb4ad, BRF_GRA | CPS1_TILES }, - { "lw-06.12e", 0x080000, 0x5b9edffc, BRF_GRA | CPS1_TILES }, - { "lw-13.12g", 0x080000, 0x8e058ef5, BRF_GRA | CPS1_TILES }, - - { "lw_00.14a", 0x010000, 0x59df2a63, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "lw-03u.14c", 0x020000, 0x807d051f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "lw-04u.13c", 0x020000, 0xe6cd098e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "lwchr.3a", 0x000117, 0x54ed4c39, BRF_OPT }, // b-board PLDs - { "lwio.15e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Forgottnue) -STD_ROM_FN(Forgottnue) - -static struct BurnRomInfo LostwrldRomDesc[] = { - { "lw_11c.14f", 0x020000, 0x67e42546, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw_15c.14g", 0x020000, 0x402e2a46, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw_10c.13f", 0x020000, 0xc46479d7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw_14c.13g", 0x020000, 0x97670f4a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw-07.13e", 0x080000, 0xfd252a26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "lw-01.9d", 0x080000, 0x0318f298, BRF_GRA | CPS1_TILES }, - { "lw-08.9f", 0x080000, 0x25a8e43c, BRF_GRA | CPS1_TILES }, - { "lw-05.9e", 0x080000, 0xe4552fd7, BRF_GRA | CPS1_TILES }, - { "lw-12.9g", 0x080000, 0x8e6a832b, BRF_GRA | CPS1_TILES }, - { "lw-02.12d", 0x080000, 0x43e6c5c8, BRF_GRA | CPS1_TILES }, - { "lw-09.12f", 0x080000, 0x899cb4ad, BRF_GRA | CPS1_TILES }, - { "lw-06.12e", 0x080000, 0x5b9edffc, BRF_GRA | CPS1_TILES }, - { "lw-13.12g", 0x080000, 0x8e058ef5, BRF_GRA | CPS1_TILES }, - - { "lw_00b.14a", 0x010000, 0x59df2a63, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "lw-03.14c", 0x020000, 0xce2159e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "lw-04.13c", 0x020000, 0x39305536, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "lwchr.3a", 0x000117, 0x54ed4c39, BRF_OPT }, // b-board PLDs - { "lwio.15e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Lostwrld) -STD_ROM_FN(Lostwrld) - -static struct BurnRomInfo LostwrldoRomDesc[] = { - { "lw_11.14f", 0x020000, 0x61e2cc56, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw_15.14g", 0x020000, 0x8a0c18d3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw_10.13f", 0x020000, 0x23bca4d5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw_14.13g", 0x020000, 0x3a023771, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "lw-07.13e", 0x080000, 0xfd252a26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "lw-01.9d", 0x080000, 0x0318f298, BRF_GRA | CPS1_TILES }, - { "lw-08.9f", 0x080000, 0x25a8e43c, BRF_GRA | CPS1_TILES }, - { "lw-05.9e", 0x080000, 0xe4552fd7, BRF_GRA | CPS1_TILES }, - { "lw-12.9g", 0x080000, 0x8e6a832b, BRF_GRA | CPS1_TILES }, - { "lw-02.12d", 0x080000, 0x43e6c5c8, BRF_GRA | CPS1_TILES }, - { "lw-09.12f", 0x080000, 0x899cb4ad, BRF_GRA | CPS1_TILES }, - { "lw-06.12e", 0x080000, 0x5b9edffc, BRF_GRA | CPS1_TILES }, - { "lw-13.12g", 0x080000, 0x8e058ef5, BRF_GRA | CPS1_TILES }, - - { "lw_00b.14a", 0x010000, 0x59df2a63, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "lw-03.14c", 0x020000, 0xce2159e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "lw-04.13c", 0x020000, 0x39305536, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "lwchr.3a", 0x000117, 0x54ed4c39, BRF_OPT }, // b-board PLDs - { "lwio.15e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Lostwrldo) -STD_ROM_FN(Lostwrldo) - -static struct BurnRomInfo GanbareRomDesc[] = { - { "mrnj_23d.8f", 0x080000, 0xf929be72, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mrnj_01.3a", 0x080000, 0x3f878020, BRF_GRA | CPS1_TILES }, - { "mrnj_02.4a", 0x080000, 0x3e5624d8, BRF_GRA | CPS1_TILES }, - { "mrnj_03.5a", 0x080000, 0xd1e61f96, BRF_GRA | CPS1_TILES }, - { "mrnj_04.6a", 0x080000, 0xd241971b, BRF_GRA | CPS1_TILES }, - { "mrnj_05.7a", 0x080000, 0xc0a14562, BRF_GRA | CPS1_TILES }, - { "mrnj_06.8a", 0x080000, 0xe6a71dfc, BRF_GRA | CPS1_TILES }, - { "mrnj_07.9a", 0x080000, 0x99afb6c7, BRF_GRA | CPS1_TILES }, - { "mrnj_08.10a", 0x080000, 0x52882c20, BRF_GRA | CPS1_TILES }, - - { "mrnj_09.12a", 0x010000, 0x62470d72, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mrnj_18.11c", 0x020000, 0x08e13940, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "mrnj_19.12c", 0x020000, 0x5fa59927, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "m48t35y-70pc1.9n", 0x008000, 0x96107b4a, BRF_OPT }, // timekeeper internal ram - game overwrites it on init anyway - - A_BOARD_PLDS - - { "gbpr2.1a", 0x000117, 0x486e8ca0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Ganbare) -STD_ROM_FN(Ganbare) - -static struct BurnRomInfo GhoulsRomDesc[] = { - { "dme_29.10h", 0x020000, 0x166a58a2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dme_30.10j", 0x020000, 0x7ac8407a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dme_27.9h", 0x020000, 0xf734b2be, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dme_28.9j", 0x020000, 0x03d3e714, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dm-17.7j", 0x080000, 0x3ea1b0f2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "dm-05.3a", 0x080000, 0x0ba9c0b0, BRF_GRA | CPS1_TILES }, - { "dm-07.3f", 0x080000, 0x5d760ab9, BRF_GRA | CPS1_TILES }, - { "dm-06.3c", 0x080000, 0x4ba90b59, BRF_GRA | CPS1_TILES }, - { "dm-08.3g", 0x080000, 0x4bdee9de, BRF_GRA | CPS1_TILES }, - { "09.4a", 0x010000, 0xae24bb19, BRF_GRA | CPS1_TILES }, - { "18.7a", 0x010000, 0xd34e271a, BRF_GRA | CPS1_TILES }, - { "13.4e", 0x010000, 0x3f70dd37, BRF_GRA | CPS1_TILES }, - { "22.7e", 0x010000, 0x7e69e2e6, BRF_GRA | CPS1_TILES }, - { "11.4c", 0x010000, 0x37c9b6c6, BRF_GRA | CPS1_TILES }, - { "20.7c", 0x010000, 0x2f1345b4, BRF_GRA | CPS1_TILES }, - { "15.4g", 0x010000, 0x3c2a212a, BRF_GRA | CPS1_TILES }, - { "24.7g", 0x010000, 0x889aac05, BRF_GRA | CPS1_TILES }, - { "10.4b", 0x010000, 0xbcc0f28c, BRF_GRA | CPS1_TILES }, - { "19.7b", 0x010000, 0x2a40166a, BRF_GRA | CPS1_TILES }, - { "14.4f", 0x010000, 0x20f85c03, BRF_GRA | CPS1_TILES }, - { "23.7f", 0x010000, 0x8426144b, BRF_GRA | CPS1_TILES }, - { "12.4d", 0x010000, 0xda088d61, BRF_GRA | CPS1_TILES }, - { "21.7d", 0x010000, 0x17e11df0, BRF_GRA | CPS1_TILES }, - { "16.4h", 0x010000, 0xf187ba1c, BRF_GRA | CPS1_TILES }, - { "25.7h", 0x010000, 0x29f79c78, BRF_GRA | CPS1_TILES }, - - { "26.10a", 0x010000, 0x3692f6e5, BRF_PRG | CPS1_Z80_PROGRAM }, - - A_BOARD_PLDS - - { "dm620.2a", 0x000117, 0xf6e5f727, BRF_OPT }, // b-board PLDs - { "lwio.8i", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Ghouls) -STD_ROM_FN(Ghouls) - -static struct BurnRomInfo GhoulsuRomDesc[] = { - { "dmu_29.10h", 0x020000, 0x334d85b2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dmu_30.10j", 0x020000, 0xcee8ceb5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dmu_27.9h", 0x020000, 0x4a524140, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dmu_28.9j", 0x020000, 0x94aae205, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dm-17.7j", 0x080000, 0x3ea1b0f2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "dm-05.3a", 0x080000, 0x0ba9c0b0, BRF_GRA | CPS1_TILES }, - { "dm-07.3f", 0x080000, 0x5d760ab9, BRF_GRA | CPS1_TILES }, - { "dm-06.3c", 0x080000, 0x4ba90b59, BRF_GRA | CPS1_TILES }, - { "dm-08.3g", 0x080000, 0x4bdee9de, BRF_GRA | CPS1_TILES }, - { "09.4a", 0x010000, 0xae24bb19, BRF_GRA | CPS1_TILES }, - { "18.7a", 0x010000, 0xd34e271a, BRF_GRA | CPS1_TILES }, - { "13.4e", 0x010000, 0x3f70dd37, BRF_GRA | CPS1_TILES }, - { "22.7e", 0x010000, 0x7e69e2e6, BRF_GRA | CPS1_TILES }, - { "11.4c", 0x010000, 0x37c9b6c6, BRF_GRA | CPS1_TILES }, - { "20.7c", 0x010000, 0x2f1345b4, BRF_GRA | CPS1_TILES }, - { "15.4g", 0x010000, 0x3c2a212a, BRF_GRA | CPS1_TILES }, - { "24.7g", 0x010000, 0x889aac05, BRF_GRA | CPS1_TILES }, - { "10.4b", 0x010000, 0xbcc0f28c, BRF_GRA | CPS1_TILES }, - { "19.7b", 0x010000, 0x2a40166a, BRF_GRA | CPS1_TILES }, - { "14.4f", 0x010000, 0x20f85c03, BRF_GRA | CPS1_TILES }, - { "23.7f", 0x010000, 0x8426144b, BRF_GRA | CPS1_TILES }, - { "12.4d", 0x010000, 0xda088d61, BRF_GRA | CPS1_TILES }, - { "21.7d", 0x010000, 0x17e11df0, BRF_GRA | CPS1_TILES }, - { "16.4h", 0x010000, 0xf187ba1c, BRF_GRA | CPS1_TILES }, - { "25.7h", 0x010000, 0x29f79c78, BRF_GRA | CPS1_TILES }, - - { "26.10a", 0x010000, 0x3692f6e5, BRF_PRG | CPS1_Z80_PROGRAM }, - - A_BOARD_PLDS - - { "dm620.2a", 0x000117, 0xf6e5f727, BRF_OPT }, // b-board PLDs - { "lwio.8i", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Ghoulsu) -STD_ROM_FN(Ghoulsu) - -static struct BurnRomInfo DaimakaiRomDesc[] = { - { "dmj_38.12f", 0x020000, 0x82fd1798, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dmj_39.12h", 0x020000, 0x35366ccc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dmj_40.13f", 0x020000, 0xa17c170a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dmj_41.13h", 0x020000, 0x6af0b391, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dm_33.10f", 0x020000, 0x384d60c4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dm_34.10h", 0x020000, 0x19abe30f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dm_35.11f", 0x020000, 0xc04b85c8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dm_36.11h", 0x020000, 0x89be83de, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "dm_02.4b", 0x020000, 0x8b98dc48, BRF_GRA | CPS1_TILES }, - { "dm_01.4a", 0x020000, 0x80896c33, BRF_GRA | CPS1_TILES }, - { "dm_10.9b", 0x020000, 0xc2e7d9ef, BRF_GRA | CPS1_TILES }, - { "dm_09.9a", 0x020000, 0xc9c4afa5, BRF_GRA | CPS1_TILES }, - { "dm_18.5e", 0x020000, 0x1aa0db99, BRF_GRA | CPS1_TILES }, - { "dm_17.5c", 0x020000, 0xdc6ed8ad, BRF_GRA | CPS1_TILES }, - { "dm_30.8h", 0x020000, 0xd9d3f8bd, BRF_GRA | CPS1_TILES }, - { "dm_29.8f", 0x020000, 0x49a48796, BRF_GRA | CPS1_TILES }, - { "dm_04.5b", 0x020000, 0xa4f4f8f0, BRF_GRA | CPS1_TILES }, - { "dm_03.5a", 0x020000, 0xb1033e62, BRF_GRA | CPS1_TILES }, - { "dm_12.10b", 0x020000, 0x10fdd76a, BRF_GRA | CPS1_TILES }, - { "dm_11.10a", 0x020000, 0x9040cb04, BRF_GRA | CPS1_TILES }, - { "dm_20.7e", 0x020000, 0x281d0b3e, BRF_GRA | CPS1_TILES }, - { "dm_19.7c", 0x020000, 0x2623b52f, BRF_GRA | CPS1_TILES }, - { "dm_32.9h", 0x020000, 0x99692344, BRF_GRA | CPS1_TILES }, - { "dm_31.9f", 0x020000, 0x54acb729, BRF_GRA | CPS1_TILES }, - { "dm_06.7b", 0x010000, 0xae24bb19, BRF_GRA | CPS1_TILES }, - { "dm_05.7a", 0x010000, 0xd34e271a, BRF_GRA | CPS1_TILES }, - { "dm_14.11b", 0x010000, 0x3f70dd37, BRF_GRA | CPS1_TILES }, - { "dm_13.11a", 0x010000, 0x7e69e2e6, BRF_GRA | CPS1_TILES }, - { "dm_22.8e", 0x010000, 0x37c9b6c6, BRF_GRA | CPS1_TILES }, - { "dm_21.8c", 0x010000, 0x2f1345b4, BRF_GRA | CPS1_TILES }, - { "dm_26.10e", 0x010000, 0x3c2a212a, BRF_GRA | CPS1_TILES }, - { "dm_25.10c", 0x010000, 0x889aac05, BRF_GRA | CPS1_TILES }, - { "dm_08.8b", 0x010000, 0xbcc0f28c, BRF_GRA | CPS1_TILES }, - { "dm_07.8a", 0x010000, 0x2a40166a, BRF_GRA | CPS1_TILES }, - { "dm_16.12b", 0x010000, 0x20f85c03, BRF_GRA | CPS1_TILES }, - { "dm_15.12a", 0x010000, 0x8426144b, BRF_GRA | CPS1_TILES }, - { "dm_24.9e", 0x010000, 0xda088d61, BRF_GRA | CPS1_TILES }, - { "dm_23.9c", 0x010000, 0x17e11df0, BRF_GRA | CPS1_TILES }, - { "dm_28.11e", 0x010000, 0xf187ba1c, BRF_GRA | CPS1_TILES }, - { "dm_27.11c", 0x010000, 0x29f79c78, BRF_GRA | CPS1_TILES }, - - { "37.13c", 0x010000, 0x3692f6e5, BRF_PRG | CPS1_Z80_PROGRAM }, - - A_BOARD_PLDS - - { "dm22a.1a", 0x000117, 0xd4776116, BRF_OPT }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Daimakai) -STD_ROM_FN(Daimakai) - -static struct BurnRomInfo DaimakairRomDesc[] = { - { "damj_23.8f", 0x080000, 0xc3b248ec, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "damj_22.7f", 0x080000, 0x595ff2f3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "dam_01.3a", 0x080000, 0x0ba9c0b0, BRF_GRA | CPS1_TILES }, - { "dam_02.4a", 0x080000, 0x5d760ab9, BRF_GRA | CPS1_TILES }, - { "dam_03.5a", 0x080000, 0x4ba90b59, BRF_GRA | CPS1_TILES }, - { "dam_04.6a", 0x080000, 0x4bdee9de, BRF_GRA | CPS1_TILES }, - { "dam_05.7a", 0x080000, 0x7dc61b94, BRF_GRA | CPS1_TILES }, - { "dam_06.8a", 0x080000, 0xfde89758, BRF_GRA | CPS1_TILES }, - { "dam_07.9a", 0x080000, 0xec351d78, BRF_GRA | CPS1_TILES }, - { "dam_08.10a", 0x080000, 0xee2acc1e, BRF_GRA | CPS1_TILES }, - - { "dam_09.12a", 0x020000, 0x0656ff53, BRF_PRG | CPS1_Z80_PROGRAM }, - - A_BOARD_PLDS - - { "dam63b.1a", 0x000117, 0x474b3c8a, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Daimakair) -STD_ROM_FN(Daimakair) - -static struct BurnRomInfo DaimakaibRomDesc[] = { - { "dmjb2.bin", 0x080000, 0x7d5f9f84, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "dmjb1.bin", 0x080000, 0x9b945cc4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "dm_02.4b", 0x020000, 0x8b98dc48, BRF_GRA | CPS1_TILES }, - { "dm_01.4a", 0x020000, 0x80896c33, BRF_GRA | CPS1_TILES }, - { "dm_10.9b", 0x020000, 0xc2e7d9ef, BRF_GRA | CPS1_TILES }, - { "dm_09.9a", 0x020000, 0xc9c4afa5, BRF_GRA | CPS1_TILES }, - { "dm_18.5e", 0x020000, 0x1aa0db99, BRF_GRA | CPS1_TILES }, - { "dm_17.5c", 0x020000, 0xdc6ed8ad, BRF_GRA | CPS1_TILES }, - { "dm_30.8h", 0x020000, 0xd9d3f8bd, BRF_GRA | CPS1_TILES }, - { "dm_29.8f", 0x020000, 0x49a48796, BRF_GRA | CPS1_TILES }, - { "dm_04.5b", 0x020000, 0xa4f4f8f0, BRF_GRA | CPS1_TILES }, - { "dm_03.5a", 0x020000, 0xb1033e62, BRF_GRA | CPS1_TILES }, - { "dm_12.10b", 0x020000, 0x10fdd76a, BRF_GRA | CPS1_TILES }, - { "dm_11.10a", 0x020000, 0x9040cb04, BRF_GRA | CPS1_TILES }, - { "dm_20.7e", 0x020000, 0x281d0b3e, BRF_GRA | CPS1_TILES }, - { "dm_19.7c", 0x020000, 0x2623b52f, BRF_GRA | CPS1_TILES }, - { "dm_32.9h", 0x020000, 0x99692344, BRF_GRA | CPS1_TILES }, - { "dm_31.9f", 0x020000, 0x54acb729, BRF_GRA | CPS1_TILES }, - { "dm_06.7b", 0x010000, 0xae24bb19, BRF_GRA | CPS1_TILES }, - { "dm_05.7a", 0x010000, 0xd34e271a, BRF_GRA | CPS1_TILES }, - { "dm_14.11b", 0x010000, 0x3f70dd37, BRF_GRA | CPS1_TILES }, - { "dm_13.11a", 0x010000, 0x7e69e2e6, BRF_GRA | CPS1_TILES }, - { "dm_22.8e", 0x010000, 0x37c9b6c6, BRF_GRA | CPS1_TILES }, - { "dm_21.8c", 0x010000, 0x2f1345b4, BRF_GRA | CPS1_TILES }, - { "dm_26.10e", 0x010000, 0x3c2a212a, BRF_GRA | CPS1_TILES }, - { "dm_25.10c", 0x010000, 0x889aac05, BRF_GRA | CPS1_TILES }, - { "dm_08.8b", 0x010000, 0xbcc0f28c, BRF_GRA | CPS1_TILES }, - { "dm_07.8a", 0x010000, 0x2a40166a, BRF_GRA | CPS1_TILES }, - { "dm_16.12b", 0x010000, 0x20f85c03, BRF_GRA | CPS1_TILES }, - { "dm_15.12a", 0x010000, 0x8426144b, BRF_GRA | CPS1_TILES }, - { "dm_24.9e", 0x010000, 0xda088d61, BRF_GRA | CPS1_TILES }, - { "dm_23.9c", 0x010000, 0x17e11df0, BRF_GRA | CPS1_TILES }, - { "dm_28.11e", 0x010000, 0xf187ba1c, BRF_GRA | CPS1_TILES }, - { "dm_27.11c", 0x010000, 0x29f79c78, BRF_GRA | CPS1_TILES }, - - { "dm_37.13c", 0x010000, 0x3692f6e5, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Daimakaib) -STD_ROM_FN(Daimakaib) - -static struct BurnRomInfo KnightsRomDesc[] = { - { "kr_23e.8f", 0x080000, 0x1b3997eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "kr_22.7f", 0x080000, 0xd0b671a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "kr-5m.3a", 0x080000, 0x9e36c1a4, BRF_GRA | CPS1_TILES }, - { "kr-7m.5a", 0x080000, 0xc5832cae, BRF_GRA | CPS1_TILES }, - { "kr-1m.4a", 0x080000, 0xf095be2d, BRF_GRA | CPS1_TILES }, - { "kr-3m.6a", 0x080000, 0x179dfd96, BRF_GRA | CPS1_TILES }, - { "kr-6m.7a", 0x080000, 0x1f4298d2, BRF_GRA | CPS1_TILES }, - { "kr-8m.9a", 0x080000, 0x37fa8751, BRF_GRA | CPS1_TILES }, - { "kr-2m.8a", 0x080000, 0x0200bc3d, BRF_GRA | CPS1_TILES }, - { "kr-4m.10a", 0x080000, 0x0bb2b4e7, BRF_GRA | CPS1_TILES }, - - { "kr_09.11a", 0x010000, 0x5e44d9ee, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kr_18.11c", 0x020000, 0xda69d15f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kr_19.12c", 0x020000, 0xbfc654e9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "kr63b.1a", 0x000117, 0xfd5b6522, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Knights) -STD_ROM_FN(Knights) - -static struct BurnRomInfo KnightsuRomDesc[] = { - { "kr_23u.8f", 0x080000, 0x252bc2ba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "kr_22.7f", 0x080000, 0xd0b671a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "kr-5m.3a", 0x080000, 0x9e36c1a4, BRF_GRA | CPS1_TILES }, - { "kr-7m.5a", 0x080000, 0xc5832cae, BRF_GRA | CPS1_TILES }, - { "kr-1m.4a", 0x080000, 0xf095be2d, BRF_GRA | CPS1_TILES }, - { "kr-3m.6a", 0x080000, 0x179dfd96, BRF_GRA | CPS1_TILES }, - { "kr-6m.7a", 0x080000, 0x1f4298d2, BRF_GRA | CPS1_TILES }, - { "kr-8m.9a", 0x080000, 0x37fa8751, BRF_GRA | CPS1_TILES }, - { "kr-2m.8a", 0x080000, 0x0200bc3d, BRF_GRA | CPS1_TILES }, - { "kr-4m.10a", 0x080000, 0x0bb2b4e7, BRF_GRA | CPS1_TILES }, - - { "kr_09.11a", 0x010000, 0x5e44d9ee, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kr_18.11c", 0x020000, 0xda69d15f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kr_19.12c", 0x020000, 0xbfc654e9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "kr63b.1a", 0x000117, 0xfd5b6522, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Knightsu) -STD_ROM_FN(Knightsu) - -static struct BurnRomInfo KnightsjRomDesc[] = { - { "kr_23j.8f", 0x080000, 0xeae7417f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "kr_22.7f", 0x080000, 0xd0b671a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "kr_01.3a", 0x080000, 0x9e36c1a4, BRF_GRA | CPS1_TILES }, - { "kr_02.4a", 0x080000, 0xc5832cae, BRF_GRA | CPS1_TILES }, - { "kr_03.5a", 0x080000, 0xf095be2d, BRF_GRA | CPS1_TILES }, - { "kr_04.6a", 0x080000, 0x179dfd96, BRF_GRA | CPS1_TILES }, - { "kr_05.7a", 0x080000, 0x1f4298d2, BRF_GRA | CPS1_TILES }, - { "kr_06.8a", 0x080000, 0x37fa8751, BRF_GRA | CPS1_TILES }, - { "kr_07.9a", 0x080000, 0x0200bc3d, BRF_GRA | CPS1_TILES }, - { "kr_08.10a", 0x080000, 0x0bb2b4e7, BRF_GRA | CPS1_TILES }, - - { "kr_09.12a", 0x010000, 0x5e44d9ee, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kr_18.11c", 0x020000, 0xda69d15f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kr_19.12c", 0x020000, 0xbfc654e9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "kr63b.1a", 0x000117, 0xfd5b6522, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Knightsj) -STD_ROM_FN(Knightsj) - -static struct BurnRomInfo KnightsjaRomDesc[] = { - { "krj_36.12f", 0x020000, 0xad3d1a8e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "krj_42.12h", 0x020000, 0xe694a491, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "krj_37.13f", 0x020000, 0x85596094, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "krj_43.13h", 0x020000, 0x9198bf8f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kr_34.10f", 0x020000, 0xfe6eb08d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kr_40.10h", 0x020000, 0x1172806d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kr_35.11f", 0x020000, 0xf854b020, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kr_41.11h", 0x020000, 0xeb52e78d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "kr_09.4b", 0x020000, 0x08b76e10, BRF_GRA | CPS1_TILES }, - { "kr_01.4a", 0x020000, 0x40cecf5c, BRF_GRA | CPS1_TILES }, - { "kr_13.9b", 0x020000, 0x435aaa03, BRF_GRA | CPS1_TILES }, - { "kr_05.9a", 0x020000, 0x5b8a615b, BRF_GRA | CPS1_TILES }, - { "kr_24.5e", 0x020000, 0xde65153e, BRF_GRA | CPS1_TILES }, - { "kr_17.5c", 0x020000, 0xb171c968, BRF_GRA | CPS1_TILES }, - { "kr_38.8h", 0x020000, 0xf4466bf4, BRF_GRA | CPS1_TILES }, - { "kr_32.8f", 0x020000, 0x87380ddd, BRF_GRA | CPS1_TILES }, - { "kr_10.5b", 0x020000, 0x37006d66, BRF_GRA | CPS1_TILES }, - { "kr_02.5a", 0x020000, 0xb54612e3, BRF_GRA | CPS1_TILES }, - { "kr_14.10b", 0x020000, 0x0ae88766, BRF_GRA | CPS1_TILES }, - { "kr_06.10a", 0x020000, 0xecb1a09a, BRF_GRA | CPS1_TILES }, - { "kr_25.7e", 0x020000, 0x9aace189, BRF_GRA | CPS1_TILES }, - { "kr_18.7c", 0x020000, 0x09fa14a5, BRF_GRA | CPS1_TILES }, - { "kr_39.9h", 0x020000, 0xfd8a9aeb, BRF_GRA | CPS1_TILES }, - { "kr_33.9f", 0x020000, 0x11803e95, BRF_GRA | CPS1_TILES }, - { "kr_11.7b", 0x020000, 0xa967ceb3, BRF_GRA | CPS1_TILES }, - { "kr_03.7a", 0x020000, 0xea10db07, BRF_GRA | CPS1_TILES }, - { "kr_15.11b", 0x020000, 0x8140b83b, BRF_GRA | CPS1_TILES }, - { "kr_07.11a", 0x020000, 0x6af10648, BRF_GRA | CPS1_TILES }, - { "kr_26.8e", 0x020000, 0x8865d86b, BRF_GRA | CPS1_TILES }, - { "kr_19.8c", 0x020000, 0x029f4abe, BRF_GRA | CPS1_TILES }, - { "kr_28.10e", 0x020000, 0x5f84f92f, BRF_GRA | CPS1_TILES }, - { "kr_21.10c", 0x020000, 0x01b35065, BRF_GRA | CPS1_TILES }, - { "kr_12.8b", 0x020000, 0x03d945b1, BRF_GRA | CPS1_TILES }, - { "kr_04.8a", 0x020000, 0xe30c8388, BRF_GRA | CPS1_TILES }, - { "kr_16.12b", 0x020000, 0x40c39d1b, BRF_GRA | CPS1_TILES }, - { "kr_08.12a", 0x020000, 0xd310c9e8, BRF_GRA | CPS1_TILES }, - { "kr_27.9e", 0x020000, 0x3e041444, BRF_GRA | CPS1_TILES }, - { "kr_20.9c", 0x020000, 0xbd4bffb8, BRF_GRA | CPS1_TILES }, - { "kr_29.11e", 0x020000, 0x1387a076, BRF_GRA | CPS1_TILES }, - { "kr_22.11c", 0x020000, 0xfd351922, BRF_GRA | CPS1_TILES }, - - { "kr_23.13b", 0x010000, 0x5e44d9ee, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kr_30.12c", 0x020000, 0xda69d15f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kr_31.13c", 0x020000, 0xbfc654e9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "kr22b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs - { "lwio.12e", 0x000117, 0xad52b90c, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Knightsja) -STD_ROM_FN(Knightsja) - -static struct BurnRomInfo KnightsbRomDesc[] = { - { "5.ic172", 0x040000, 0x7fd91118, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "3.ic173", 0x040000, 0xc9c6e720, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.ic176", 0x040000, 0xaf352703, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.ic175", 0x040000, 0x1eb91343, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "kr_gfx1.rom", 0x080000, 0x9e36c1a4, BRF_GRA | CPS1_TILES }, - { "kr_gfx3.rom", 0x080000, 0xc5832cae, BRF_GRA | CPS1_TILES }, - { "kr_gfx2.rom", 0x080000, 0xf095be2d, BRF_GRA | CPS1_TILES }, - { "kr_gfx4.rom", 0x080000, 0x179dfd96, BRF_GRA | CPS1_TILES }, - { "kr_gfx5.rom", 0x080000, 0x1f4298d2, BRF_GRA | CPS1_TILES }, - { "kr_gfx7.rom", 0x080000, 0x37fa8751, BRF_GRA | CPS1_TILES }, - { "kr_gfx6.rom", 0x080000, 0x0200bc3d, BRF_GRA | CPS1_TILES }, - { "kr_gfx8.rom", 0x080000, 0x0bb2b4e7, BRF_GRA | CPS1_TILES }, - - { "1.ic26", 0x040000, 0xbd6f9cc1, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Knightsb) -STD_ROM_FN(Knightsb) - -static struct BurnRomInfo Knightsb2RomDesc[] = { - { "040-z.02", 0x080000, 0x95d00a7e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "040-r.02", 0x080000, 0x5a9d0b64, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "kr_gfx1.rom", 0x080000, 0x9e36c1a4, BRF_GRA | CPS1_TILES }, - { "kr_gfx3.rom", 0x080000, 0xc5832cae, BRF_GRA | CPS1_TILES }, - { "kr_gfx2.rom", 0x080000, 0xf095be2d, BRF_GRA | CPS1_TILES }, - { "kr_gfx4.rom", 0x080000, 0x179dfd96, BRF_GRA | CPS1_TILES }, - { "kr_gfx5.rom", 0x080000, 0x1f4298d2, BRF_GRA | CPS1_TILES }, - { "kr_gfx7.rom", 0x080000, 0x37fa8751, BRF_GRA | CPS1_TILES }, - { "kr_gfx6.rom", 0x080000, 0x0200bc3d, BRF_GRA | CPS1_TILES }, - { "kr_gfx8.rom", 0x080000, 0x0bb2b4e7, BRF_GRA | CPS1_TILES }, - - { "kr_09.rom", 0x010000, 0x5e44d9ee, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kr_18.rom", 0x020000, 0xda69d15f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kr_19.rom", 0x020000, 0xbfc654e9, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Knightsb2) -STD_ROM_FN(Knightsb2) - -static struct BurnRomInfo Knightsb3RomDesc[] = { - { "23.096", 0x080000, 0x7733b8a6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "22.096", 0x080000, 0xd0b671a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "1.096", 0x080000, 0x91541596, BRF_GRA | CPS1_TILES }, - { "2.096", 0x080000, 0x5d332114, BRF_GRA | CPS1_TILES }, - { "3.096", 0x080000, 0x60488eba, BRF_GRA | CPS1_TILES }, - { "4.096", 0x080000, 0x394bdd11, BRF_GRA | CPS1_TILES }, - { "5.096", 0x080000, 0xb52af98b, BRF_GRA | CPS1_TILES }, - { "6.096", 0x080000, 0xe44e5eac, BRF_GRA | CPS1_TILES }, - { "7.096", 0x080000, 0x0200bc3d, BRF_GRA | CPS1_TILES }, - { "8.096", 0x080000, 0x0bb2b4e7, BRF_GRA | CPS1_TILES }, - - { "9.512", 0x010000, 0x5e44d9ee, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18.010", 0x020000, 0x9b9be3ab, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19.010", 0x020000, 0xbfc654e9, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Knightsb3) -STD_ROM_FN(Knightsb3) - -static struct BurnRomInfo Knightsb4RomDesc[] = { - { "3.bin", 0x080000, 0xb818272c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.bin", 0x080000, 0xb0b9a4c2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "kr_gfx1.rom", 0x080000, 0x9e36c1a4, BRF_GRA | CPS1_TILES }, - { "kr_gfx3.rom", 0x080000, 0xc5832cae, BRF_GRA | CPS1_TILES }, - { "kr_gfx2.rom", 0x080000, 0xf095be2d, BRF_GRA | CPS1_TILES }, - { "kr_gfx4.rom", 0x080000, 0x179dfd96, BRF_GRA | CPS1_TILES }, - { "kr_gfx5.rom", 0x080000, 0x1f4298d2, BRF_GRA | CPS1_TILES }, - { "kr_gfx7.rom", 0x080000, 0x37fa8751, BRF_GRA | CPS1_TILES }, - { "kr_gfx6.rom", 0x080000, 0x0200bc3d, BRF_GRA | CPS1_TILES }, - { "kr_gfx8.rom", 0x080000, 0x0bb2b4e7, BRF_GRA | CPS1_TILES }, - - { "1.bin", 0x040000, 0xbd6f9cc1, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Knightsb4) -STD_ROM_FN(Knightsb4) - -static struct BurnRomInfo KnightshRomDesc[] = { - { "krh_23.rom", 0x080000, 0xfa2ff63d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "krh_22.rom", 0x080000, 0x1438d070, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "kr_gfx1.rom", 0x080000, 0x9e36c1a4, BRF_GRA | CPS1_TILES }, - { "kr_gfx3.rom", 0x080000, 0xc5832cae, BRF_GRA | CPS1_TILES }, - { "kr_gfx2.rom", 0x080000, 0xf095be2d, BRF_GRA | CPS1_TILES }, - { "kr_gfx4.rom", 0x080000, 0x179dfd96, BRF_GRA | CPS1_TILES }, - { "kr_gfx5.rom", 0x080000, 0x1f4298d2, BRF_GRA | CPS1_TILES }, - { "kr_gfx7.rom", 0x080000, 0x37fa8751, BRF_GRA | CPS1_TILES }, - { "kr_gfx6.rom", 0x080000, 0x0200bc3d, BRF_GRA | CPS1_TILES }, - { "kr_gfx8.rom", 0x080000, 0x0bb2b4e7, BRF_GRA | CPS1_TILES }, - - { "kr_09.rom", 0x010000, 0x5e44d9ee, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kr_18.rom", 0x020000, 0xda69d15f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kr_19.rom", 0x020000, 0xbfc654e9, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Knightsh) -STD_ROM_FN(Knightsh) - -static struct BurnRomInfo Knightsh2RomDesc[] = { - { "krha_23.rom", 0x080000, 0xa7fd309a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "krh_22.rom", 0x080000, 0x1438d070, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "kr_gfx1.rom", 0x080000, 0x9e36c1a4, BRF_GRA | CPS1_TILES }, - { "kr_gfx3.rom", 0x080000, 0xc5832cae, BRF_GRA | CPS1_TILES }, - { "kr_gfx2.rom", 0x080000, 0xf095be2d, BRF_GRA | CPS1_TILES }, - { "kr_gfx4.rom", 0x080000, 0x179dfd96, BRF_GRA | CPS1_TILES }, - { "kr_gfx5.rom", 0x080000, 0x1f4298d2, BRF_GRA | CPS1_TILES }, - { "kr_gfx7.rom", 0x080000, 0x37fa8751, BRF_GRA | CPS1_TILES }, - { "kr_gfx6.rom", 0x080000, 0x0200bc3d, BRF_GRA | CPS1_TILES }, - { "kr_gfx8.rom", 0x080000, 0x0bb2b4e7, BRF_GRA | CPS1_TILES }, - - { "kr_09.rom", 0x010000, 0x5e44d9ee, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kr_18.rom", 0x020000, 0xda69d15f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kr_19.rom", 0x020000, 0xbfc654e9, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Knightsh2) -STD_ROM_FN(Knightsh2) - -static struct BurnRomInfo KodRomDesc[] = { - { "kde_30a.11e", 0x020000, 0xfcb5efe2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_37a.11f", 0x020000, 0xf22e5266, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_31a.12e", 0x020000, 0xc710d722, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_38a.12f", 0x020000, 0x57d6ed3a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kd_28.9e", 0x020000, 0x9367bcd9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kd_35.9f", 0x020000, 0x4ca6a48a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kd_29.10e", 0x020000, 0x0360fa72, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kd_36a.10f", 0x020000, 0x95a3cef8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "kd-5m.4a", 0x080000, 0xe45b8701, BRF_GRA | CPS1_TILES }, - { "kd-7m.6a", 0x080000, 0xa7750322, BRF_GRA | CPS1_TILES }, - { "kd-1m.3a", 0x080000, 0x5f74bf78, BRF_GRA | CPS1_TILES }, - { "kd-3m.5a", 0x080000, 0x5e5303bf, BRF_GRA | CPS1_TILES }, - { "kd-6m.4c", 0x080000, 0x113358f3, BRF_GRA | CPS1_TILES }, - { "kd-8m.6c", 0x080000, 0x38853c44, BRF_GRA | CPS1_TILES }, - { "kd-2m.3c", 0x080000, 0x9ef36604, BRF_GRA | CPS1_TILES }, - { "kd-4m.5c", 0x080000, 0x402b9b4f, BRF_GRA | CPS1_TILES }, - - { "kd_9.12a", 0x010000, 0xbac6ec26, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kd_18.11c", 0x020000, 0x4c63181d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kd_19.12c", 0x020000, 0x92941b80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - -#if !defined (ROM_VERIFY) - { "kd29b.1a", 0x000117, 0xcc4866ff, BRF_OPT }, // b-board PLDs -#else - { "kd29b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs -#endif - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Kod) -STD_ROM_FN(Kod) - -static struct BurnRomInfo Kodr1RomDesc[] = { - { "kde_30.11e", 0x020000, 0xc7414fd4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_37.11f", 0x020000, 0xa5bf40d2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_31.12e", 0x020000, 0x1fffc7bd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_38.12f", 0x020000, 0x89e57a82, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_28.9e", 0x020000, 0x9367bcd9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_35.9f", 0x020000, 0x4ca6a48a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_29.10e", 0x020000, 0x6a0ba878, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kde_36.10f", 0x020000, 0xb509b39d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "kd-5m.4a", 0x080000, 0xe45b8701, BRF_GRA | CPS1_TILES }, - { "kd-7m.6a", 0x080000, 0xa7750322, BRF_GRA | CPS1_TILES }, - { "kd-1m.3a", 0x080000, 0x5f74bf78, BRF_GRA | CPS1_TILES }, - { "kd-3m.5a", 0x080000, 0x5e5303bf, BRF_GRA | CPS1_TILES }, - { "kd-6m.4c", 0x080000, 0x113358f3, BRF_GRA | CPS1_TILES }, - { "kd-8m.6c", 0x080000, 0x38853c44, BRF_GRA | CPS1_TILES }, - { "kd-2m.3c", 0x080000, 0x9ef36604, BRF_GRA | CPS1_TILES }, - { "kd-4m.5c", 0x080000, 0x402b9b4f, BRF_GRA | CPS1_TILES }, - - { "kd_9.12a", 0x010000, 0xf5514510, BRF_PRG | CPS1_Z80_PROGRAM }, // different CRC from kod, pcb verified - - { "kd_18.11c", 0x020000, 0x69ecb2c8, BRF_SND | CPS1_OKIM6295_SAMPLES }, // different CRC from kod, pcb verified - { "kd_19.12c", 0x020000, 0x02d851c1, BRF_SND | CPS1_OKIM6295_SAMPLES }, // different CRC from kod, pcb verified - - A_BOARD_PLDS - -#if !defined (ROM_VERIFY) - { "kd29b.1a", 0x000117, 0xcc4866ff, BRF_OPT }, // b-board PLDs -#else - { "kd29b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs -#endif - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Kodr1) -STD_ROM_FN(Kodr1) - -static struct BurnRomInfo KoduRomDesc[] = { - { "kdu_30b.11e", 0x020000, 0x825817f9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdu_37b.11f", 0x020000, 0xd2422dfb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdu_31b.12e", 0x020000, 0x9af36039, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdu_38b.12f", 0x020000, 0xbe8405a1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdu_28.9e", 0x020000, 0x9367bcd9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdu_35.9f", 0x020000, 0x4ca6a48a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdu_29.10e", 0x020000, 0x0360fa72, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdu_36a.10f", 0x020000, 0x95a3cef8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "kd-5m.4a", 0x080000, 0xe45b8701, BRF_GRA | CPS1_TILES }, - { "kd-7m.6a", 0x080000, 0xa7750322, BRF_GRA | CPS1_TILES }, - { "kd-1m.3a", 0x080000, 0x5f74bf78, BRF_GRA | CPS1_TILES }, - { "kd-3m.5a", 0x080000, 0x5e5303bf, BRF_GRA | CPS1_TILES }, - { "kd-6m.4c", 0x080000, 0x113358f3, BRF_GRA | CPS1_TILES }, - { "kd-8m.6c", 0x080000, 0x38853c44, BRF_GRA | CPS1_TILES }, - { "kd-2m.3c", 0x080000, 0x9ef36604, BRF_GRA | CPS1_TILES }, - { "kd-4m.5c", 0x080000, 0x402b9b4f, BRF_GRA | CPS1_TILES }, - - { "kd_09.12a", 0x010000, 0xbac6ec26, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kd_18.11c", 0x020000, 0x4c63181d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kd_19.12c", 0x020000, 0x92941b80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - -#if !defined (ROM_VERIFY) - { "kd29b.1a", 0x000117, 0xcc4866ff, BRF_OPT }, // b-board PLDs -#else - { "kd29b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs -#endif - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Kodu) -STD_ROM_FN(Kodu) - -static struct BurnRomInfo KodjRomDesc[] = { - { "kdj_30a.11e", 0x020000, 0xebc788ad, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdj_37a.11f", 0x020000, 0xe55c3529, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdj_31a.12e", 0x020000, 0xc710d722, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdj_38a.12f", 0x020000, 0x57d6ed3a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kd_33.6f", 0x080000, 0x9bd7ad4b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "kd_06.8a", 0x080000, 0xe45b8701, BRF_GRA | CPS1_TILES }, - { "kd_08.10a", 0x080000, 0xa7750322, BRF_GRA | CPS1_TILES }, - { "kd_05.7a", 0x080000, 0x5f74bf78, BRF_GRA | CPS1_TILES }, - { "kd_07.9a", 0x080000, 0x5e5303bf, BRF_GRA | CPS1_TILES }, - { "kd_15.8c", 0x080000, 0x113358f3, BRF_GRA | CPS1_TILES }, - { "kd_17.10c", 0x080000, 0x38853c44, BRF_GRA | CPS1_TILES }, - { "kd_14.7c", 0x080000, 0x9ef36604, BRF_GRA | CPS1_TILES }, - { "kd_16.9c", 0x080000, 0x402b9b4f, BRF_GRA | CPS1_TILES }, - - { "kd_09.12a", 0x010000, 0xbac6ec26, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kd_18.11c", 0x020000, 0x4c63181d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kd_19.12c", 0x020000, 0x92941b80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - -#if !defined (ROM_VERIFY) - { "kd29b.1a", 0x000117, 0xcc4866ff, BRF_OPT }, // b-board PLDs -#else - { "kd29b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs -#endif - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Kodj) -STD_ROM_FN(Kodj) - -static struct BurnRomInfo KodjaRomDesc[] = { - { "kdj_36a.12f", 0x020000, 0xebc788ad, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdj_42a.12h", 0x020000, 0xe55c3529, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdj_37a.13f", 0x020000, 0xc710d722, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kdj_43a.13h", 0x020000, 0x57d6ed3a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kd_34.10f", 0x020000, 0x9367bcd9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kd_40.10h", 0x020000, 0x4ca6a48a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kd_35.11f", 0x020000, 0x0360fa72, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "kd_41a.11h", 0x020000, 0x95a3cef8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "kd_9.4b", 0x020000, 0x401a98e3, BRF_GRA | CPS1_TILES }, - { "kd_1.4a", 0x020000, 0x5894399a, BRF_GRA | CPS1_TILES }, - { "kd_13.9b", 0x020000, 0xb6685131, BRF_GRA | CPS1_TILES }, - { "kd_5.9a", 0x020000, 0xc29b9ab3, BRF_GRA | CPS1_TILES }, - { "kd_24.5e", 0x020000, 0x97008fdb, BRF_GRA | CPS1_TILES }, - { "kd_17.5c", 0x020000, 0xdc9a83d3, BRF_GRA | CPS1_TILES }, - { "kd_38.8h", 0x020000, 0x9c3dd2d1, BRF_GRA | CPS1_TILES }, - { "kd_32.8f", 0x020000, 0x1b2a802a, BRF_GRA | CPS1_TILES }, - { "kd_10.5b", 0x020000, 0xe788ae96, BRF_GRA | CPS1_TILES }, - { "kd_2.5a", 0x020000, 0xb022e3e3, BRF_GRA | CPS1_TILES }, - { "kd_14.10b", 0x020000, 0x4840c5ef, BRF_GRA | CPS1_TILES }, - { "kd_6.10a", 0x020000, 0x519faee4, BRF_GRA | CPS1_TILES }, - { "kd_25.7e", 0x020000, 0x5d0fa853, BRF_GRA | CPS1_TILES }, - { "kd_18.7c", 0x020000, 0x6ad3b2bb, BRF_GRA | CPS1_TILES }, - { "kd_39.9h", 0x020000, 0xd7920213, BRF_GRA | CPS1_TILES }, - { "kd_33.9f", 0x020000, 0x65c2bed6, BRF_GRA | CPS1_TILES }, - { "kd_11.7b", 0x020000, 0x147e3310, BRF_GRA | CPS1_TILES }, - { "kd_3.7a", 0x020000, 0x5d18bc83, BRF_GRA | CPS1_TILES }, - { "kd_15.11b", 0x020000, 0x57359746, BRF_GRA | CPS1_TILES }, - { "kd_7.11a", 0x020000, 0x7fe03079, BRF_GRA | CPS1_TILES }, - { "kd_26.8e", 0x020000, 0x57e5fab5, BRF_GRA | CPS1_TILES }, - { "kd_19.8c", 0x020000, 0xb1f30f7c, BRF_GRA | CPS1_TILES }, - { "kd_28.10e", 0x020000, 0x3a424135, BRF_GRA | CPS1_TILES }, - { "kd_21.10c", 0x020000, 0xce10d2c3, BRF_GRA | CPS1_TILES }, - { "kd_12.8b", 0x020000, 0xa6042aa2, BRF_GRA | CPS1_TILES }, - { "kd_4.8a", 0x020000, 0x0ce0ba30, BRF_GRA | CPS1_TILES }, - { "kd_16.12b", 0x020000, 0x63dcb7e0, BRF_GRA | CPS1_TILES }, - { "kd_8.12a", 0x020000, 0xc69b77ae, BRF_GRA | CPS1_TILES }, - { "kd_27.9e", 0x020000, 0x40d7bfed, BRF_GRA | CPS1_TILES }, - { "kd_20.9c", 0x020000, 0x01c1f399, BRF_GRA | CPS1_TILES }, - { "kd_29.11e", 0x020000, 0xa1eeac03, BRF_GRA | CPS1_TILES }, - { "kd_22.11c", 0x020000, 0x5ade98eb, BRF_GRA | CPS1_TILES }, - - { "kd_23.13b", 0x010000, 0xbac6ec26, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kd_30.12c", 0x020000, 0x4c63181d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kd_31.13c", 0x020000, 0x92941b80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "kd22b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs - { "iob1.12e", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Kodja) -STD_ROM_FN(Kodja) - -static struct BurnRomInfo KodbRomDesc[] = { - { "3.ic172", 0x080000, 0x036dd74c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.ic171", 0x080000, 0x3e4b7295, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "cp.ic90", 0x080000, 0xe3b8589e, BRF_GRA | CPS1_TILES }, - { "dp.ic89", 0x080000, 0x3eec9580, BRF_GRA | CPS1_TILES }, - { "ap.ic88", 0x080000, 0xfdf5f163, BRF_GRA | CPS1_TILES }, - { "bp.ic87", 0x080000, 0x4e1c52b7, BRF_GRA | CPS1_TILES }, - { "ci.ic91", 0x080000, 0x22228bc5, BRF_GRA | CPS1_TILES }, - { "di.ic92", 0x080000, 0xab031763, BRF_GRA | CPS1_TILES }, - { "ai.ic93", 0x080000, 0xcffbf4be, BRF_GRA | CPS1_TILES }, - { "bi.ic94", 0x080000, 0x4a1b43fe, BRF_GRA | CPS1_TILES }, - - { "1.ic28", 0x010000, 0x01cae60c, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "2.ic19", 0x040000, 0xa2db1575, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Kodb) -STD_ROM_FN(Kodb) - -static struct BurnRomInfo KodhRomDesc[] = { - { "23.096", 0x080000, 0xdaf89cfb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "22.096", 0x080000, 0xc83e19d8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "1.096", 0x080000, 0x09261881, BRF_GRA | CPS1_TILES }, - { "2.096", 0x080000, 0xbc121ff2, BRF_GRA | CPS1_TILES }, - { "3.096", 0x080000, 0xf463ae22, BRF_GRA | CPS1_TILES }, - { "4.096", 0x080000, 0x01308733, BRF_GRA | CPS1_TILES }, - { "5.096", 0x080000, 0x113358f3, BRF_GRA | CPS1_TILES }, - { "6.096", 0x080000, 0x38853c44, BRF_GRA | CPS1_TILES }, - { "7.096", 0x080000, 0xc7ab4704, BRF_GRA | CPS1_TILES }, - { "8.096", 0x080000, 0x402b9b4f, BRF_GRA | CPS1_TILES }, - - { "9.096", 0x010000, 0xf5514510, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18.096", 0x020000, 0x69ecb2c8, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19.096", 0x020000, 0x02d851c1, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Kodh) -STD_ROM_FN(Kodh) - -// King Of Dragons 910731 ETC Phoenix set - -static struct BurnRomInfo KoddaRomDesc[] = { - { "8f", 0x080000, 0x0a6ab826, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "7f", 0x080000, 0x9bd7ad4b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "kd-5m.4a", 0x080000, 0xe45b8701, BRF_GRA | CPS1_TILES }, - { "kd-7m.6a", 0x080000, 0xa7750322, BRF_GRA | CPS1_TILES }, - { "kd-1m.3a", 0x080000, 0x5f74bf78, BRF_GRA | CPS1_TILES }, - { "kdda-7m.6a", 0x080000, 0x0e2cb76f, BRF_GRA | CPS1_TILES }, - { "kd-6m.4c", 0x080000, 0x113358f3, BRF_GRA | CPS1_TILES }, - { "kd-8m.6c", 0x080000, 0x38853c44, BRF_GRA | CPS1_TILES }, - { "kd-2m.3c", 0x080000, 0x9ef36604, BRF_GRA | CPS1_TILES }, - { "kd-4m.5c", 0x080000, 0x402b9b4f, BRF_GRA | CPS1_TILES }, - - { "kd_9.12a", 0x010000, 0xbac6ec26, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "kd_18.11c", 0x020000, 0x4c63181d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "kd_19.12c", 0x020000, 0x92941b80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - -#if !defined (ROM_VERIFY) - { "kd29b.1a", 0x000117, 0xcc4866ff, BRF_OPT }, // b-board PLDs -#else - { "kd29b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs -#endif - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Kodda) -STD_ROM_FN(Kodda) - -static struct BurnRomInfo MegamanRomDesc[] = { - { "rcmu_23b.8f", 0x080000, 0x1cd33c7a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "rcmu_22b.7f", 0x080000, 0x708268c4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "rcmu_21a.6f", 0x080000, 0x4376ea95, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "rcm_01.3a", 0x080000, 0x6ecdf13f, BRF_GRA | CPS1_TILES }, - { "rcm_02.4a", 0x080000, 0x944d4f0f, BRF_GRA | CPS1_TILES }, - { "rcm_03.5a", 0x080000, 0x36f3073c, BRF_GRA | CPS1_TILES }, - { "rcm_04.6a", 0x080000, 0x54e622ff, BRF_GRA | CPS1_TILES }, - { "rcm_05.7a", 0x080000, 0x5dd131fd, BRF_GRA | CPS1_TILES }, - { "rcm_06.8a", 0x080000, 0xf0faf813, BRF_GRA | CPS1_TILES }, - { "rcm_07.9a", 0x080000, 0x826de013, BRF_GRA | CPS1_TILES }, - { "rcm_08.10a", 0x080000, 0xfbff64cf, BRF_GRA | CPS1_TILES }, - { "rcm_10.3c", 0x080000, 0x4dc8ada9, BRF_GRA | CPS1_TILES }, - { "rcm_11.4c", 0x080000, 0xf2b9ee06, BRF_GRA | CPS1_TILES }, - { "rcm_12.5c", 0x080000, 0xfed5f203, BRF_GRA | CPS1_TILES }, - { "rcm_13.6c", 0x080000, 0x5069d4a9, BRF_GRA | CPS1_TILES }, - { "rcm_14.7c", 0x080000, 0x303be3bd, BRF_GRA | CPS1_TILES }, - { "rcm_15.8c", 0x080000, 0x4f2d372f, BRF_GRA | CPS1_TILES }, - { "rcm_16.9c", 0x080000, 0x93d97fde, BRF_GRA | CPS1_TILES }, - { "rcm_17.10c", 0x080000, 0x92371042, BRF_GRA | CPS1_TILES }, - - { "rcm_09.11a", 0x010000, 0x22ac8f5f, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "rcm_18.11c", 0x020000, 0x80f1f8aa, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "rcm_19.12c", 0x020000, 0xf257dbe1, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "rcm63b.1a", 0x000117, 0x84acd494, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Megaman) -STD_ROM_FN(Megaman) - -static struct BurnRomInfo MegamanaRomDesc[] = { - { "rcma_23b.8f", 0x080000, 0x61e4a397, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "rcma_22b.7f", 0x080000, 0x708268c4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "rcma_21a.6f", 0x080000, 0x4376ea95, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "rcm_01.3a", 0x080000, 0x6ecdf13f, BRF_GRA | CPS1_TILES }, - { "rcm_02.4a", 0x080000, 0x944d4f0f, BRF_GRA | CPS1_TILES }, - { "rcm_03.5a", 0x080000, 0x36f3073c, BRF_GRA | CPS1_TILES }, - { "rcm_04.6a", 0x080000, 0x54e622ff, BRF_GRA | CPS1_TILES }, - { "rcm_05.7a", 0x080000, 0x5dd131fd, BRF_GRA | CPS1_TILES }, - { "rcm_06.8a", 0x080000, 0xf0faf813, BRF_GRA | CPS1_TILES }, - { "rcm_07.9a", 0x080000, 0x826de013, BRF_GRA | CPS1_TILES }, - { "rcm_08.10a", 0x080000, 0xfbff64cf, BRF_GRA | CPS1_TILES }, - { "rcm_10.3c", 0x080000, 0x4dc8ada9, BRF_GRA | CPS1_TILES }, - { "rcm_11.4c", 0x080000, 0xf2b9ee06, BRF_GRA | CPS1_TILES }, - { "rcm_12.5c", 0x080000, 0xfed5f203, BRF_GRA | CPS1_TILES }, - { "rcm_13.6c", 0x080000, 0x5069d4a9, BRF_GRA | CPS1_TILES }, - { "rcm_14.7c", 0x080000, 0x303be3bd, BRF_GRA | CPS1_TILES }, - { "rcm_15.8c", 0x080000, 0x4f2d372f, BRF_GRA | CPS1_TILES }, - { "rcm_16.9c", 0x080000, 0x93d97fde, BRF_GRA | CPS1_TILES }, - { "rcm_17.10c", 0x080000, 0x92371042, BRF_GRA | CPS1_TILES }, - - { "rcm_09.12a", 0x020000, 0x9632d6ef, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "rcm_18.11c", 0x020000, 0x80f1f8aa, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "rcm_19.12c", 0x020000, 0xf257dbe1, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "rcm63b.1a", 0x000117, 0x84acd494, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Megamana) -STD_ROM_FN(Megamana) - -static struct BurnRomInfo RockmanjRomDesc[] = { - { "rcm_23a.8f", 0x080000, 0xefd96cb2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "rcm_22a.7f", 0x080000, 0x8729a689, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "rcm_21a.6f", 0x080000, 0x517ccde2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "rcm_01.3a", 0x080000, 0x6ecdf13f, BRF_GRA | CPS1_TILES }, - { "rcm_02.4a", 0x080000, 0x944d4f0f, BRF_GRA | CPS1_TILES }, - { "rcm_03.5a", 0x080000, 0x36f3073c, BRF_GRA | CPS1_TILES }, - { "rcm_04.6a", 0x080000, 0x54e622ff, BRF_GRA | CPS1_TILES }, - { "rcm_05.7a", 0x080000, 0x5dd131fd, BRF_GRA | CPS1_TILES }, - { "rcm_06.8a", 0x080000, 0xf0faf813, BRF_GRA | CPS1_TILES }, - { "rcm_07.9a", 0x080000, 0x826de013, BRF_GRA | CPS1_TILES }, - { "rcm_08.10a", 0x080000, 0xfbff64cf, BRF_GRA | CPS1_TILES }, - { "rcm_10.3c", 0x080000, 0x4dc8ada9, BRF_GRA | CPS1_TILES }, - { "rcm_11.4c", 0x080000, 0xf2b9ee06, BRF_GRA | CPS1_TILES }, - { "rcm_12.5c", 0x080000, 0xfed5f203, BRF_GRA | CPS1_TILES }, - { "rcm_13.6c", 0x080000, 0x5069d4a9, BRF_GRA | CPS1_TILES }, - { "rcm_14.7c", 0x080000, 0x303be3bd, BRF_GRA | CPS1_TILES }, - { "rcm_15.8c", 0x080000, 0x4f2d372f, BRF_GRA | CPS1_TILES }, - { "rcm_16.9c", 0x080000, 0x93d97fde, BRF_GRA | CPS1_TILES }, - { "rcm_17.10c", 0x080000, 0x92371042, BRF_GRA | CPS1_TILES }, - - { "rcm_09.12a", 0x020000, 0x9632d6ef, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "rcm_18.11c", 0x020000, 0x80f1f8aa, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "rcm_19.12c", 0x020000, 0xf257dbe1, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "rcm63b.1a", 0x000117, 0x84acd494, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Rockmanj) -STD_ROM_FN(Rockmanj) - -static struct BurnRomInfo MercsRomDesc[] = { - { "so2_30e.11f", 0x020000, 0xe17f9bf7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_35e.11h", 0x020000, 0x78e63575, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_31e.12f", 0x020000, 0x51204d36, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_36e.12h", 0x020000, 0x9cfba8b4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2-32m.8h", 0x080000, 0x2eb5cf0c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "so2-6m.8a", 0x080000, 0xaa6102af, BRF_GRA | CPS1_TILES }, - { "so2-8m.10a", 0x080000, 0x839e6869, BRF_GRA | CPS1_TILES }, - { "so2-2m.4a", 0x080000, 0x597c2875, BRF_GRA | CPS1_TILES }, - { "so2-4m.6a", 0x080000, 0x912a9ca0, BRF_GRA | CPS1_TILES }, - { "so2_24.7d", 0x020000, 0x3f254efe, BRF_GRA | CPS1_TILES }, - { "so2_14.7c", 0x020000, 0xf5a8905e, BRF_GRA | CPS1_TILES }, - { "so2_26.9d", 0x020000, 0xf3aa5a4a, BRF_GRA | CPS1_TILES }, - { "so2_16.9c", 0x020000, 0xb43cd1a8, BRF_GRA | CPS1_TILES }, - { "so2_20.3d", 0x020000, 0x8ca751a3, BRF_GRA | CPS1_TILES }, - { "so2_10.3c", 0x020000, 0xe9f569fd, BRF_GRA | CPS1_TILES }, - { "so2_22.5d", 0x020000, 0xfce9a377, BRF_GRA | CPS1_TILES }, - { "so2_12.5c", 0x020000, 0xb7df8a06, BRF_GRA | CPS1_TILES }, - - { "so2_09.12b", 0x010000, 0xd09d7c7a, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "so2_18.11c", 0x020000, 0xbbea1643, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "so2_19.12c", 0x020000, 0xac58aa71, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "o224b.1a", 0x000117, 0xc211c8cd, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, - { "c628", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // c-board PLDs -}; - -STD_ROM_PICK(Mercs) -STD_ROM_FN(Mercs) - -static struct BurnRomInfo MercsuRomDesc[] = { - { "so2_30a.11f", 0x020000, 0xe4e725d7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_35a.11h", 0x020000, 0xe7843445, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_31a.12f", 0x020000, 0xc0b91dea, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_36a.12h", 0x020000, 0x591edf6c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2-32m.8h", 0x080000, 0x2eb5cf0c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "so2-6m.8a", 0x080000, 0xaa6102af, BRF_GRA | CPS1_TILES }, - { "so2-8m.10a", 0x080000, 0x839e6869, BRF_GRA | CPS1_TILES }, - { "so2-2m.4a", 0x080000, 0x597c2875, BRF_GRA | CPS1_TILES }, - { "so2-4m.6a", 0x080000, 0x912a9ca0, BRF_GRA | CPS1_TILES }, - { "so2_24.7d", 0x020000, 0x3f254efe, BRF_GRA | CPS1_TILES }, - { "so2_14.7c", 0x020000, 0xf5a8905e, BRF_GRA | CPS1_TILES }, - { "so2_26.9d", 0x020000, 0xf3aa5a4a, BRF_GRA | CPS1_TILES }, - { "so2_16.9c", 0x020000, 0xb43cd1a8, BRF_GRA | CPS1_TILES }, - { "so2_20.3d", 0x020000, 0x8ca751a3, BRF_GRA | CPS1_TILES }, - { "so2_10.3c", 0x020000, 0xe9f569fd, BRF_GRA | CPS1_TILES }, - { "so2_22.5d", 0x020000, 0xfce9a377, BRF_GRA | CPS1_TILES }, - { "so2_12.5c", 0x020000, 0xb7df8a06, BRF_GRA | CPS1_TILES }, - - { "so2_09.12b", 0x010000, 0xd09d7c7a, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "so2_18.11c", 0x020000, 0xbbea1643, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "so2_19.12c", 0x020000, 0xac58aa71, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "o224b.1a", 0x000117, 0xc211c8cd, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, - { "c628", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // c-board PLDs -}; - -STD_ROM_PICK(Mercsu) -STD_ROM_FN(Mercsu) - -static struct BurnRomInfo Mercsur1RomDesc[] = { - { "so2_30.11f", 0x020000, 0xe17f9bf7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_35.11h", 0x020000, 0x4477df61, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_31.12f", 0x020000, 0x51204d36, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_36.12h", 0x020000, 0x9cfba8b4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2-32m.8h", 0x080000, 0x2eb5cf0c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "so2-6m.8a", 0x080000, 0xaa6102af, BRF_GRA | CPS1_TILES }, - { "so2-8m.10a", 0x080000, 0x839e6869, BRF_GRA | CPS1_TILES }, - { "so2-2m.4a", 0x080000, 0x597c2875, BRF_GRA | CPS1_TILES }, - { "so2-4m.6a", 0x080000, 0x912a9ca0, BRF_GRA | CPS1_TILES }, - { "so2_24.7d", 0x020000, 0x3f254efe, BRF_GRA | CPS1_TILES }, - { "so2_14.7c", 0x020000, 0xf5a8905e, BRF_GRA | CPS1_TILES }, - { "so2_26.9d", 0x020000, 0xf3aa5a4a, BRF_GRA | CPS1_TILES }, - { "so2_16.9c", 0x020000, 0xb43cd1a8, BRF_GRA | CPS1_TILES }, - { "so2_20.3d", 0x020000, 0x8ca751a3, BRF_GRA | CPS1_TILES }, - { "so2_10.3c", 0x020000, 0xe9f569fd, BRF_GRA | CPS1_TILES }, - { "so2_22.5d", 0x020000, 0xfce9a377, BRF_GRA | CPS1_TILES }, - { "so2_12.5c", 0x020000, 0xb7df8a06, BRF_GRA | CPS1_TILES }, - - { "so2_09.12b", 0x010000, 0xd09d7c7a, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "so2_18.11c", 0x020000, 0xbbea1643, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "so2_19.12c", 0x020000, 0xac58aa71, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "o224b.1a", 0x000117, 0xc211c8cd, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, - { "c628", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // c-board PLDs -}; - -STD_ROM_PICK(Mercsur1) -STD_ROM_FN(Mercsur1) - -static struct BurnRomInfo MercsjRomDesc[] = { - { "so2_36.12f", 0x020000, 0xe17f9bf7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_42.12h", 0x020000, 0x2c3884c6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_37.13f", 0x020000, 0x51204d36, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_43.13h", 0x020000, 0x9cfba8b4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_34.10f", 0x020000, 0xb8dae95f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_40.10h", 0x020000, 0xde37771c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_35.11f", 0x020000, 0x7d24394d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "so2_41.11h", 0x020000, 0x914f85e0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "so2_09.4b", 0x020000, 0x690c261d, BRF_GRA | CPS1_TILES }, - { "so2_01.4a", 0x020000, 0x31fd2715, BRF_GRA | CPS1_TILES }, - { "so2_13.9b", 0x020000, 0xb5e48282, BRF_GRA | CPS1_TILES }, - { "so2_05.9a", 0x020000, 0x54bed82c, BRF_GRA | CPS1_TILES }, - { "so2_24.5e", 0x020000, 0x78b6f0cb, BRF_GRA | CPS1_TILES }, - { "so2_17.5c", 0x020000, 0xe78bb308, BRF_GRA | CPS1_TILES }, - { "so2_38.8h", 0x020000, 0x0010a9a2, BRF_GRA | CPS1_TILES }, - { "so2_32.8f", 0x020000, 0x75dffc9a, BRF_GRA | CPS1_TILES }, - { "so2_10.5b", 0x020000, 0x2f871714, BRF_GRA | CPS1_TILES }, - { "so2_02.5a", 0x020000, 0xb4b2a0b7, BRF_GRA | CPS1_TILES }, - { "so2_14.10b", 0x020000, 0x737a744b, BRF_GRA | CPS1_TILES }, - { "so2_06.10a", 0x020000, 0x9d756f51, BRF_GRA | CPS1_TILES }, - { "so2_25.7e", 0x020000, 0x6d0e05d6, BRF_GRA | CPS1_TILES }, - { "so2_18.7c", 0x020000, 0x96f61f4e, BRF_GRA | CPS1_TILES }, - { "so2_39.9h", 0x020000, 0xd52ba336, BRF_GRA | CPS1_TILES }, - { "so2_33.9f", 0x020000, 0x39b90d25, BRF_GRA | CPS1_TILES }, - { "so2_11.7b", 0x020000, 0x3f254efe, BRF_GRA | CPS1_TILES }, - { "so2_03.7a", 0x020000, 0xf5a8905e, BRF_GRA | CPS1_TILES }, - { "so2_15.11b", 0x020000, 0xf3aa5a4a, BRF_GRA | CPS1_TILES }, - { "so2_07.11a", 0x020000, 0xb43cd1a8, BRF_GRA | CPS1_TILES }, - { "so2_26.8e", 0x020000, 0x8ca751a3, BRF_GRA | CPS1_TILES }, - { "so2_19.8c", 0x020000, 0xe9f569fd, BRF_GRA | CPS1_TILES }, - { "so2_28.10e", 0x020000, 0xfce9a377, BRF_GRA | CPS1_TILES }, - { "so2_21.10c", 0x020000, 0xb7df8a06, BRF_GRA | CPS1_TILES }, - - { "so2_23.13b", 0x010000, 0xd09d7c7a, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "so2_30.12c", 0x020000, 0xbbea1643, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "so2_31.13c", 0x020000, 0xac58aa71, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "o222b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs - { "lwio.12e", 0x000117, 0xad52b90c, BRF_OPT }, - { "c628", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // c-board PLDs -}; - -STD_ROM_PICK(Mercsj) -STD_ROM_FN(Mercsj) - -static struct BurnRomInfo MswordRomDesc[] = { - { "mse_30.11f", 0x020000, 0x03fc8dbc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mse_35.11h", 0x020000, 0xd5bf66cd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mse_31.12f", 0x020000, 0x30332bcf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mse_36.12h", 0x020000, 0x8f7d6ce9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms-32m.8h", 0x080000, 0x2475ddfc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ms-5m.7a", 0x080000, 0xc00fe7e2, BRF_GRA | CPS1_TILES }, - { "ms-7m.9a", 0x080000, 0x4ccacac5, BRF_GRA | CPS1_TILES }, - { "ms-1m.3a", 0x080000, 0x0d2bbe00, BRF_GRA | CPS1_TILES }, - { "ms-3m.5a", 0x080000, 0x3a1a5bf4, BRF_GRA | CPS1_TILES }, - - { "ms_09.12b", 0x010000, 0x57b29519, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ms_18.11c", 0x020000, 0xfb64e90d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ms_19.12c", 0x020000, 0x74f892b9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ms24b.1a", 0x000117, 0x636dbe6d, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Msword) -STD_ROM_FN(Msword) - -static struct BurnRomInfo Mswordr1RomDesc[] = { - { "ms_30.11f", 0x020000, 0x21c1f078, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms_35.11h", 0x020000, 0xa540a73a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms_31.12f", 0x020000, 0xd7e762b5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms_36.12h", 0x020000, 0x66f2dcdb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms-32m.8h", 0x080000, 0x2475ddfc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ms-5m.7a", 0x080000, 0xc00fe7e2, BRF_GRA | CPS1_TILES }, - { "ms-7m.9a", 0x080000, 0x4ccacac5, BRF_GRA | CPS1_TILES }, - { "ms-1m.3a", 0x080000, 0x0d2bbe00, BRF_GRA | CPS1_TILES }, - { "ms-3m.5a", 0x080000, 0x3a1a5bf4, BRF_GRA | CPS1_TILES }, - - { "ms_09.12b", 0x010000, 0x57b29519, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ms_18.11c", 0x020000, 0xfb64e90d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ms_19.12c", 0x020000, 0x74f892b9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ms24b.1a", 0x000117, 0x636dbe6d, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Mswordr1) -STD_ROM_FN(Mswordr1) - -static struct BurnRomInfo MswordjRomDesc[] = { - { "msj_36.12f", 0x020000, 0x04f0ef50, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "msj_42.12h", 0x020000, 0x9fcbb9cd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "msj_37.13f", 0x020000, 0x6c060d70, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "msj_43.13h", 0x020000, 0xaec77787, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms_34.10f", 0x020000, 0x0e59a62d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms_40.10h", 0x020000, 0xbabade3a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms_35.11f", 0x020000, 0x03da99d1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms_41.11h", 0x020000, 0xfadf99ea, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "ms_09.4b", 0x020000, 0x4adee6f6, BRF_GRA | CPS1_TILES }, - { "ms_01.4a", 0x020000, 0xf7ab1b88, BRF_GRA | CPS1_TILES }, - { "ms_13.9b", 0x020000, 0xe01adc4b, BRF_GRA | CPS1_TILES }, - { "ms_05.9a", 0x020000, 0xf62c2369, BRF_GRA | CPS1_TILES }, - { "ms_24.5e", 0x020000, 0xbe64a3a1, BRF_GRA | CPS1_TILES }, - { "ms_17.5c", 0x020000, 0x0bc1665f, BRF_GRA | CPS1_TILES }, - { "ms_38.8h", 0x020000, 0x904a2ed5, BRF_GRA | CPS1_TILES }, - { "ms_32.8f", 0x020000, 0x3d89c530, BRF_GRA | CPS1_TILES }, - { "ms_10.5b", 0x020000, 0xf02c0718, BRF_GRA | CPS1_TILES }, - { "ms_02.5a", 0x020000, 0xd071a405, BRF_GRA | CPS1_TILES }, - { "ms_14.10b", 0x020000, 0xdfb2e4df, BRF_GRA | CPS1_TILES }, - { "ms_06.10a", 0x020000, 0xd3ce2a91, BRF_GRA | CPS1_TILES }, - { "ms_25.7e", 0x020000, 0x0f199d56, BRF_GRA | CPS1_TILES }, - { "ms_18.7c", 0x020000, 0x1ba76df2, BRF_GRA | CPS1_TILES }, - { "ms_39.9h", 0x020000, 0x01efce86, BRF_GRA | CPS1_TILES }, - { "ms_33.9f", 0x020000, 0xce25defc, BRF_GRA | CPS1_TILES }, - - { "ms_23.13b", 0x010000, 0x57b29519, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ms_30.12c", 0x020000, 0xfb64e90d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ms_31.13c", 0x020000, 0x74f892b9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ms22b.1a", 0x000117, 0xdde86cb0, BRF_OPT }, // b-board PLDs - { "iob1.12e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Mswordj) -STD_ROM_FN(Mswordj) - -static struct BurnRomInfo MsworduRomDesc[] = { - { "msu_30.11f", 0x020000, 0xd963c816, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "msu_35.11h", 0x020000, 0x72f179b3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "msu_31.12f", 0x020000, 0x20cd7904, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "msu_36.12h", 0x020000, 0xbf88c080, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ms-32m.8h", 0x080000, 0x2475ddfc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ms-5m.7a", 0x080000, 0xc00fe7e2, BRF_GRA | CPS1_TILES }, - { "ms-7m.9a", 0x080000, 0x4ccacac5, BRF_GRA | CPS1_TILES }, - { "ms-1m.3a", 0x080000, 0x0d2bbe00, BRF_GRA | CPS1_TILES }, - { "ms-3m.5a", 0x080000, 0x3a1a5bf4, BRF_GRA | CPS1_TILES }, - - { "ms_09.12b", 0x010000, 0x57b29519, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ms_18.11c", 0x020000, 0xfb64e90d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ms_19.12c", 0x020000, 0x74f892b9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ms24b.1a", 0x000117, 0x636dbe6d, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Mswordu) -STD_ROM_FN(Mswordu) - -static struct BurnRomInfo MtwinsRomDesc[] = { - { "che_30.11f", 0x020000, 0x9a2a2db1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "che_35.11h", 0x020000, 0xa7f96b02, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "che_31.12f", 0x020000, 0xbbff8a99, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "che_36.12h", 0x020000, 0x0fa00c39, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ck-32m.8h", 0x080000, 0x9b70bd41, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ck-5m.7a", 0x080000, 0x4ec75f15, BRF_GRA | CPS1_TILES }, - { "ck-7m.9a", 0x080000, 0xd85d00d6, BRF_GRA | CPS1_TILES }, - { "ck-1m.3a", 0x080000, 0xf33ca9d4, BRF_GRA | CPS1_TILES }, - { "ck-3m.5a", 0x080000, 0x0ba2047f, BRF_GRA | CPS1_TILES }, - - { "ch_09.12b", 0x010000, 0x4d4255b7, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ch_18.11c", 0x020000, 0xf909e8de, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ch_19.12c", 0x020000, 0xfc158cf7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ck24b.1a", 0x000117, 0xbd99c448, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Mtwins) -STD_ROM_FN(Mtwins) - -static struct BurnRomInfo ChikijRomDesc[] = { - { "chj_36a.12f", 0x020000, 0xec1328d8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "chj_42a.12h", 0x020000, 0x4ae13503, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "chj_37a.13f", 0x020000, 0x46d2cf7b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "chj_43a.13h", 0x020000, 0x8d387fe8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ch_34.10f", 0x020000, 0x609ed2f9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ch_40.10h", 0x020000, 0xbe0d8301, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ch_35.11f", 0x020000, 0xb810867f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ch_41.11h", 0x020000, 0x8ad96155, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "ch_09.4b", 0x020000, 0x567ab3ca, BRF_GRA | CPS1_TILES }, - { "ch_01.4a", 0x020000, 0x7f3b7b56, BRF_GRA | CPS1_TILES }, - { "ch_13.9b", 0x020000, 0x12a7a8ba, BRF_GRA | CPS1_TILES }, - { "ch_05.9a", 0x020000, 0x6c1afb9a, BRF_GRA | CPS1_TILES }, - { "ch_24.5e", 0x020000, 0x9cb6e6bc, BRF_GRA | CPS1_TILES }, - { "ch_17.5c", 0x020000, 0xfe490846, BRF_GRA | CPS1_TILES }, - { "ch_38.8h", 0x020000, 0x6e5c8cb6, BRF_GRA | CPS1_TILES }, - { "ch_32.8f", 0x020000, 0x317d27b0, BRF_GRA | CPS1_TILES }, - { "ch_10.5b", 0x020000, 0xe8251a9b, BRF_GRA | CPS1_TILES }, - { "ch_02.5a", 0x020000, 0x7c8c88fb, BRF_GRA | CPS1_TILES }, - { "ch_14.10b", 0x020000, 0x4012ec4b, BRF_GRA | CPS1_TILES }, - { "ch_06.10a", 0x020000, 0x81884b2b, BRF_GRA | CPS1_TILES }, - { "ch_25.7e", 0x020000, 0x1dfcbac5, BRF_GRA | CPS1_TILES }, - { "ch_18.7c", 0x020000, 0x516a34d1, BRF_GRA | CPS1_TILES }, - { "ch_39.9h", 0x020000, 0x872fb2a4, BRF_GRA | CPS1_TILES }, - { "ch_33.9f", 0x020000, 0x30dc5ded, BRF_GRA | CPS1_TILES }, - - { "ch_23.13b", 0x010000, 0x4d4255b7, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ch_30.12c", 0x020000, 0xf909e8de, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "ch_31.13c", 0x020000, 0xfc158cf7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ck22b.1a", 0x000117, 0x24fdfdeb, BRF_OPT }, // b-board PLDs - { "iob1.12e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Chikij) -STD_ROM_FN(Chikij) - -static struct BurnRomInfo NemoRomDesc[] = { - { "nme_30a.11f", 0x020000, 0xd2c03e56, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nme_35a.11h", 0x020000, 0x5fd31661, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nme_31a.12f", 0x020000, 0xb2bd4f6f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nme_36a.12h", 0x020000, 0xee9450e3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nm-32m.8h", 0x080000, 0xd6d1add3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "nm-5m.7a", 0x080000, 0x487b8747, BRF_GRA | CPS1_TILES }, - { "nm-7m.9a", 0x080000, 0x203dc8c6, BRF_GRA | CPS1_TILES }, - { "nm-1m.3a", 0x080000, 0x9e878024, BRF_GRA | CPS1_TILES }, - { "nm-3m.5a", 0x080000, 0xbb01e6b6, BRF_GRA | CPS1_TILES }, - - { "nme_09.12b", 0x010000, 0x0f4b0581, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "nme_18.11c", 0x020000, 0xbab333d4, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "nme_19.12c", 0x020000, 0x2650a0a8, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "nm24b.1a", 0x000117, 0x7b25bac6, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Nemo) -STD_ROM_FN(Nemo) - -static struct BurnRomInfo Nemor1RomDesc[] = { - { "nme_30.11f", 0x020000, 0x71b333db, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nme_35.11h", 0x020000, 0xd153bc18, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nme_31.12f", 0x020000, 0x7e83dbd2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nme_36.12h", 0x020000, 0x6aeeec81, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nm-32m.8h", 0x080000, 0xd6d1add3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "nm-5m.7a", 0x080000, 0x487b8747, BRF_GRA | CPS1_TILES }, - { "nm-7m.9a", 0x080000, 0x203dc8c6, BRF_GRA | CPS1_TILES }, - { "nm-1m.3a", 0x080000, 0x9e878024, BRF_GRA | CPS1_TILES }, - { "nm-3m.5a", 0x080000, 0xbb01e6b6, BRF_GRA | CPS1_TILES }, - - { "nme_09.12b", 0x010000, 0x0f4b0581, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "nme_18.11c", 0x020000, 0xbab333d4, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "nme_19.12c", 0x020000, 0x2650a0a8, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "nm24b.1a", 0x000117, 0x7b25bac6, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Nemor1) -STD_ROM_FN(Nemor1) - -static struct BurnRomInfo NemojRomDesc[] = { - { "nmj_36a.12f", 0x020000, 0xdaeceabb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nmj_42a.12h", 0x020000, 0x55024740, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nmj_37a.13f", 0x020000, 0x619068b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nmj_43a.13h", 0x020000, 0xa948a53b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nm_34.10f", 0x020000, 0x5737feed, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nm_40.10h", 0x020000, 0x8a4099f3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nm_35.11f", 0x020000, 0xbd11a7f8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "nm_41.11h", 0x020000, 0x6309603d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "nm_09.4b", 0x020000, 0x9d60d286, BRF_GRA | CPS1_TILES }, - { "nm_01.4a", 0x020000, 0x8a83f7c4, BRF_GRA | CPS1_TILES }, - { "nm_13.9b", 0x020000, 0xa4909fe0, BRF_GRA | CPS1_TILES }, - { "nm_05.9a", 0x020000, 0x16db1e61, BRF_GRA | CPS1_TILES }, - { "nm_24.5e", 0x020000, 0x3312c648, BRF_GRA | CPS1_TILES }, - { "nm_17.5c", 0x020000, 0xccfc50e2, BRF_GRA | CPS1_TILES }, - { "nm_38.8h", 0x020000, 0xae98a997, BRF_GRA | CPS1_TILES }, - { "nm_32.8f", 0x020000, 0xb3704dde, BRF_GRA | CPS1_TILES }, - { "nm_10.5b", 0x020000, 0x33c1388c, BRF_GRA | CPS1_TILES }, - { "nm_02.5a", 0x020000, 0x84c69469, BRF_GRA | CPS1_TILES }, - { "nm_14.10b", 0x020000, 0x66612270, BRF_GRA | CPS1_TILES }, - { "nm_06.10a", 0x020000, 0x8b9bcf95, BRF_GRA | CPS1_TILES }, - { "nm_25.7e", 0x020000, 0xacfc84d2, BRF_GRA | CPS1_TILES }, - { "nm_18.7c", 0x020000, 0x4347deed, BRF_GRA | CPS1_TILES }, - { "nm_39.9h", 0x020000, 0x6a274ecd, BRF_GRA | CPS1_TILES }, - { "nm_33.9f", 0x020000, 0xc469dc74, BRF_GRA | CPS1_TILES }, - - { "nm_23.13b", 0x010000, 0x8d3c5a42, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "nm_30.12c", 0x020000, 0xbab333d4, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "nm_31.13c", 0x020000, 0x2650a0a8, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "nm22b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs - { "iob1.12e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Nemoj) -STD_ROM_FN(Nemoj) - -static struct BurnRomInfo Pang3RomDesc[] = { - { "pa3e_17a.11l", 0x080000, 0xa213fa80, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "pa3e_16a.10l", 0x080000, 0x7169ea67, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "pa3-01m.2c", 0x200000, 0x068a152c, BRF_GRA | CPS1_TILES }, - { "pa3-07m.2f", 0x200000, 0x3a4a619d, BRF_GRA | CPS1_TILES }, - - { "pa3_11.11f", 0x020000, 0xcb1423a2, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "pa3_05.10d", 0x020000, 0x73a10d5d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "pa3_06.11d", 0x020000, 0xaffa4f82, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cp1b1f.1f", 0x000117, 0x3979b8e3, BRF_OPT }, // b-board PLDs - { "cp1b8k.8k", 0x000117, 0x8a52ea7a, BRF_OPT }, - { "cp1b9ka.9k", 0x000117, 0x238d3ff4, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Pang3) -STD_ROM_FN(Pang3) - -static struct BurnRomInfo Pang3r1RomDesc[] = { - { "pa3e_17.11l", 0x080000, 0xd7041d32, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "pa3e_16.10l", 0x080000, 0x1be9a483, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "pa3-01m.2c", 0x200000, 0x068a152c, BRF_GRA | CPS1_TILES }, - { "pa3-07m.2f", 0x200000, 0x3a4a619d, BRF_GRA | CPS1_TILES }, - - { "pa3_11.11f", 0x020000, 0xcb1423a2, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "pa3_05.10d", 0x020000, 0x73a10d5d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "pa3_06.11d", 0x020000, 0xaffa4f82, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cp1b1f.1f", 0x000117, 0x3979b8e3, BRF_OPT }, // b-board PLDs - { "cp1b8k.8k", 0x000117, 0x8a52ea7a, BRF_OPT }, - { "cp1b9k.9k", 0x000117, 0xa754bdc3, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Pang3r1) -STD_ROM_FN(Pang3r1) - -static struct BurnRomInfo Pang3r1aRomDesc[] = { - { "d.t.11l", 0x080000, 0xd7041d32, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "d.t.10l", 0x080000, 0x1be9a483, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mx27c4100.2c", 0x080000, 0x22c934c4, BRF_GRA | CPS1_TILES }, - { "mx27c4100.3c", 0x080000, 0x07c85e9b, BRF_GRA | CPS1_TILES }, - { "mx27c4100.4c", 0x080000, 0xac119a46, BRF_GRA | CPS1_TILES }, - { "mx27c4100.5c", 0x080000, 0x4ad13297, BRF_GRA | CPS1_TILES }, - { "mx27c4100.2f", 0x080000, 0x51031180, BRF_GRA | CPS1_TILES }, - { "mx27c4100.3f", 0x080000, 0xe9cd657a, BRF_GRA | CPS1_TILES }, - { "mx27c4100.4f", 0x080000, 0x2e1d35f2, BRF_GRA | CPS1_TILES }, - { "mx27c4100.5f", 0x080000, 0x026d0cd2, BRF_GRA | CPS1_TILES }, - - { "d.t.11f", 0x020000, 0xcb1423a2, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "d.t.10d", 0x020000, 0x73a10d5d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "d.t.11d", 0x020000, 0xaffa4f82, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cp1b1f.1f", 0x000117, 0x3979b8e3, BRF_OPT }, // b-board PLDs - { "cp1b8k.8k", 0x000117, 0x8a52ea7a, BRF_OPT }, - { "cp1b9k.9k", 0x000117, 0xa754bdc3, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Pang3r1a) -STD_ROM_FN(Pang3r1a) - -static struct BurnRomInfo Pang3bRomDesc[] = { - { "pa3w_17.11l", 0x080000, 0x12138234, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "pa3w_16.10l", 0x080000, 0xd1ba585c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "pa3-01m.2c", 0x200000, 0x068a152c, BRF_GRA | CPS1_TILES }, - { "pa3-07m.2f", 0x200000, 0x3a4a619d, BRF_GRA | CPS1_TILES }, - - { "pa3_11.11f", 0x008000, 0x90a08c46, BRF_PRG | CPS1_Z80_PROGRAM }, // == pa3_11.11f but different size, resized by bootlegger - - { "pa3_05.10d", 0x020000, 0x73a10d5d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "pa3_06.11d", 0x020000, 0xaffa4f82, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cp1b1f.1f", 0x000117, 0x3979b8e3, BRF_OPT }, // b-board PLDs - { "cp1b8k.8k", 0x000117, 0x8a52ea7a, BRF_OPT }, - { "cp1b9k.9k", 0x000117, 0xa754bdc3, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Pang3b) -STD_ROM_FN(Pang3b) - -static struct BurnRomInfo Pang3b2RomDesc[] = { - { "pa3_17bl.11l", 0x080000, 0x3b5d99de, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "pa3_16bl.10l", 0x080000, 0x1be9a483, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "pa3-01m.2c", 0x200000, 0x068a152c, BRF_GRA | CPS1_TILES }, - { "pa3-07m.2f", 0x200000, 0x3a4a619d, BRF_GRA | CPS1_TILES }, - - { "pa3_11.11f", 0x020000, 0xcb1423a2, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "pa3_05.10d", 0x020000, 0x73a10d5d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "pa3_06.11d", 0x020000, 0xaffa4f82, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cp1b1f.1f", 0x000117, 0x3979b8e3, BRF_OPT }, // b-board PLDs - { "cp1b8k.8k", 0x000117, 0x8a52ea7a, BRF_OPT }, - { "cp1b9k.9k", 0x000117, 0xa754bdc3, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Pang3b2) -STD_ROM_FN(Pang3b2) - -static struct BurnRomInfo Pang3b3RomDesc[] = { - { "17.11l", 0x080000, 0xf62425e9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "16.10l", 0x080000, 0x7169ea67, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "1.2c", 0x200000, 0x068a152c, BRF_GRA | CPS1_TILES }, - { "7.2f", 0x200000, 0x3a4a619d, BRF_GRA | CPS1_TILES }, - - { "11.11f", 0x020000, 0xcb1423a2, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "5.10d", 0x020000, 0x73a10d5d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "06.11d", 0x020000, 0x6266d1df, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cp1b1f.1f", 0x000117, 0x3979b8e3, BRF_OPT }, // b-board PLDs - { "cp1b8k.8k", 0x000117, 0x8a52ea7a, BRF_OPT }, - { "cp1b9k.9k", 0x000117, 0xa754bdc3, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Pang3b3) -STD_ROM_FN(Pang3b3) - -static struct BurnRomInfo Pang3jRomDesc[] = { - { "pa3j_17.11l", 0x080000, 0x21f6e51f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "pa3j_16.10l", 0x080000, 0xca1d7897, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "pa3-01m.2c", 0x200000, 0x068a152c, BRF_GRA | CPS1_TILES }, - { "pa3-07m.2f", 0x200000, 0x3a4a619d, BRF_GRA | CPS1_TILES }, - - { "pa3_11.11f", 0x020000, 0xcb1423a2, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "pa3_05.10d", 0x020000, 0x73a10d5d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "pa3_06.11d", 0x020000, 0xaffa4f82, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "cp1b1f.1f", 0x000117, 0x3979b8e3, BRF_OPT }, // b-board PLDs - { "cp1b8k.8k", 0x000117, 0x8a52ea7a, BRF_OPT }, - { "cp1b9k.9k", 0x000117, 0xa754bdc3, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Pang3j) -STD_ROM_FN(Pang3j) - -static struct BurnRomInfo PnickjRomDesc[] = { - { "pnij_36.12f", 0x020000, 0x2d4ffb2b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "pnij_42.12h", 0x020000, 0xc085dfaf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "pnij_09.4b", 0x020000, 0x48177b0a, BRF_GRA | CPS1_TILES }, - { "pnij_01.4a", 0x020000, 0x01a0f311, BRF_GRA | CPS1_TILES }, - { "pnij_13.9b", 0x020000, 0x406451b0, BRF_GRA | CPS1_TILES }, - { "pnij_05.9a", 0x020000, 0x8c515dc0, BRF_GRA | CPS1_TILES }, - { "pnij_26.5e", 0x020000, 0xe2af981e, BRF_GRA | CPS1_TILES }, - { "pnij_18.5c", 0x020000, 0xf17a0e56, BRF_GRA | CPS1_TILES }, - { "pnij_38.8h", 0x020000, 0xeb75bd8c, BRF_GRA | CPS1_TILES }, - { "pnij_32.8f", 0x020000, 0x84560bef, BRF_GRA | CPS1_TILES }, - { "pnij_10.5b", 0x020000, 0xc2acc171, BRF_GRA | CPS1_TILES }, - { "pnij_02.5a", 0x020000, 0x0e21fc33, BRF_GRA | CPS1_TILES }, - { "pnij_14.10b", 0x020000, 0x7fe59b19, BRF_GRA | CPS1_TILES }, - { "pnij_06.10a", 0x020000, 0x79f4bfe3, BRF_GRA | CPS1_TILES }, - { "pnij_27.7e", 0x020000, 0x83d5cb0e, BRF_GRA | CPS1_TILES }, - { "pnij_19.7c", 0x020000, 0xaf08b230, BRF_GRA | CPS1_TILES }, - { "pnij_39.9h", 0x020000, 0x70fbe579, BRF_GRA | CPS1_TILES }, - { "pnij_33.9f", 0x020000, 0x3ed2c680, BRF_GRA | CPS1_TILES }, - - { "pnij_17.13b", 0x010000, 0xe86f787a, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "pnij_24.12c", 0x020000, 0x5092257d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "pnij_25.13c", 0x020000, 0x22109aaa, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "pkb10b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs - { "iob1.12e", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Pnickj) -STD_ROM_FN(Pnickj) - -static struct BurnRomInfo PokonyanRomDesc[] = { - { "xmqq-12f.bin", 0x020000, 0x196297bf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "xmqq-12h.bin", 0x020000, 0x2d7ee2e9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "xmqq-13f.bin", 0x020000, 0x8f6abf26, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "xmqq-13h.bin", 0x020000, 0x3fefe432, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "xmqq-4b.bin", 0x020000, 0x933ab76d, BRF_GRA | CPS1_TILES }, - { "xmqq-4a.bin", 0x020000, 0xb098e7a9, BRF_GRA | CPS1_TILES }, - { "xmqq-9b.bin", 0x020000, 0xb66d62d4, BRF_GRA | CPS1_TILES }, - { "xmqq-9a.bin", 0x020000, 0x9c23e40b, BRF_GRA | CPS1_TILES }, - { "xmqq-5e.bin", 0x020000, 0x63d06d6f, BRF_GRA | CPS1_TILES }, - { "xmqq-5c.bin", 0x020000, 0xe2169bb5, BRF_GRA | CPS1_TILES }, - { "xmqq-8h.bin", 0x020000, 0x113121f5, BRF_GRA | CPS1_TILES }, - { "xmqq-8f.bin", 0x020000, 0xbeb00e07, BRF_GRA | CPS1_TILES }, - { "xmqq-5b.bin", 0x020000, 0x05354905, BRF_GRA | CPS1_TILES }, - { "xmqq-5a.bin", 0x020000, 0xbd40215e, BRF_GRA | CPS1_TILES }, - { "xmqq-10b.bin", 0x020000, 0x9fa773ef, BRF_GRA | CPS1_TILES }, - { "xmqq-10a.bin", 0x020000, 0x638d4bc7, BRF_GRA | CPS1_TILES }, - { "xmqq-7e.bin", 0x020000, 0x72c45858, BRF_GRA | CPS1_TILES }, - { "xmqq-7c.bin", 0x020000, 0xd91cda18, BRF_GRA | CPS1_TILES }, - { "xmqq-9h.bin", 0x020000, 0x3cd8594b, BRF_GRA | CPS1_TILES }, - { "xmqq-9f.bin", 0x020000, 0x1ec10bed, BRF_GRA | CPS1_TILES }, - - { "xmqq-13b.bin", 0x010000, 0x4e8b81a8, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "xmqq-12c.bin", 0x020000, 0x71ac69ad, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "xmqq-13c.bin", 0x020000, 0x71e29699, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Pokonyan) -STD_ROM_FN(Pokonyan) - -static struct BurnRomInfo PunisherRomDesc[] = { - { "pse_26.11e", 0x020000, 0x389a99d2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "pse_30.11f", 0x020000, 0x68fb06ac, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "pse_27.12e", 0x020000, 0x3eb181c3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "pse_31.12f", 0x020000, 0x37108e7b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "pse_24.9e", 0x020000, 0x0f434414, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "pse_28.9f", 0x020000, 0xb732345d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "pse_25.10e", 0x020000, 0xb77102e2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "pse_29.10f", 0x020000, 0xec037bce, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ps_21.6f", 0x080000, 0x8affa5a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ps-1m.3a", 0x080000, 0x77b7ccab, BRF_GRA | CPS1_TILES }, - { "ps-3m.5a", 0x080000, 0x0122720b, BRF_GRA | CPS1_TILES }, - { "ps-2m.4a", 0x080000, 0x64fa58d4, BRF_GRA | CPS1_TILES }, - { "ps-4m.6a", 0x080000, 0x60da42c8, BRF_GRA | CPS1_TILES }, - { "ps-5m.7a", 0x080000, 0xc54ea839, BRF_GRA | CPS1_TILES }, - { "ps-7m.9a", 0x080000, 0x04c5acbd, BRF_GRA | CPS1_TILES }, - { "ps-6m.8a", 0x080000, 0xa544f4cc, BRF_GRA | CPS1_TILES }, - { "ps-8m.10a", 0x080000, 0x8f02f436, BRF_GRA | CPS1_TILES }, - - { "ps_q.5k", 0x020000, 0x49ff4446, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ps-q1.1k", 0x080000, 0x31fd8726, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q2.2k", 0x080000, 0x980a9eef, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q3.3k", 0x080000, 0x0dd44491, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q4.4k", 0x080000, 0xbed42f03, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - -#if !defined (ROM_VERIFY) - { "ps63b.1a", 0x000117, 0x03a758b0, BRF_OPT }, // b-board PLDs -#else - { "ps63b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs -#endif - - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Punisher) -STD_ROM_FN(Punisher) - -static struct BurnRomInfo PunisheruRomDesc[] = { - { "psu_26.11e", 0x020000, 0x9236d121, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psu_30.11f", 0x020000, 0x8320e501, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psu_27.12e", 0x020000, 0x61c960a1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psu_31.12f", 0x020000, 0x78d4c298, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psu_24.9e", 0x020000, 0x1cfecad7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psu_28.9f", 0x020000, 0xbdf921c1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psu_25.10e", 0x020000, 0xc51acc94, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psu_29.10f", 0x020000, 0x52dce1ca, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ps_21.6f", 0x080000, 0x8affa5a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ps-1m.3a", 0x080000, 0x77b7ccab, BRF_GRA | CPS1_TILES }, - { "ps-3m.5a", 0x080000, 0x0122720b, BRF_GRA | CPS1_TILES }, - { "ps-2m.4a", 0x080000, 0x64fa58d4, BRF_GRA | CPS1_TILES }, - { "ps-4m.6a", 0x080000, 0x60da42c8, BRF_GRA | CPS1_TILES }, - { "ps-5m.7a", 0x080000, 0xc54ea839, BRF_GRA | CPS1_TILES }, - { "ps-7m.9a", 0x080000, 0x04c5acbd, BRF_GRA | CPS1_TILES }, - { "ps-6m.8a", 0x080000, 0xa544f4cc, BRF_GRA | CPS1_TILES }, - { "ps-8m.10a", 0x080000, 0x8f02f436, BRF_GRA | CPS1_TILES }, - - { "ps_q.5k", 0x020000, 0x49ff4446, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ps-q1.1k", 0x080000, 0x31fd8726, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q2.2k", 0x080000, 0x980a9eef, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q3.3k", 0x080000, 0x0dd44491, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q4.4k", 0x080000, 0xbed42f03, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - -#if !defined (ROM_VERIFY) - { "ps63b.1a", 0x000117, 0x03a758b0, BRF_OPT }, // b-board PLDs -#else - { "ps63b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs -#endif - - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Punisheru) -STD_ROM_FN(Punisheru) - -static struct BurnRomInfo PunisherjRomDesc[] = { - { "psj_23.8f", 0x080000, 0x6b2fda52, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "psj_22.7f", 0x080000, 0xe01036bc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "psj_21.6f", 0x080000, 0x8affa5a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ps_01.3a", 0x080000, 0x77b7ccab, BRF_GRA | CPS1_TILES }, - { "ps_02.4a", 0x080000, 0x0122720b, BRF_GRA | CPS1_TILES }, - { "ps_03.5a", 0x080000, 0x64fa58d4, BRF_GRA | CPS1_TILES }, - { "ps_04.6a", 0x080000, 0x60da42c8, BRF_GRA | CPS1_TILES }, - { "ps_05.7a", 0x080000, 0xc54ea839, BRF_GRA | CPS1_TILES }, - { "ps_06.8a", 0x080000, 0x04c5acbd, BRF_GRA | CPS1_TILES }, - { "ps_07.9a", 0x080000, 0xa544f4cc, BRF_GRA | CPS1_TILES }, - { "ps_08.10a", 0x080000, 0x8f02f436, BRF_GRA | CPS1_TILES }, - - { "ps_q.5k", 0x020000, 0x49ff4446, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ps-q1.1k", 0x080000, 0x31fd8726, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q2.2k", 0x080000, 0x980a9eef, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q3.3k", 0x080000, 0x0dd44491, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q4.4k", 0x080000, 0xbed42f03, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - -#if !defined (ROM_VERIFY) - { "ps63b.1a", 0x000117, 0x03a758b0, BRF_OPT }, // b-board PLDs -#else - { "ps63b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs -#endif - - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Punisherj) -STD_ROM_FN(Punisherj) - -static struct BurnRomInfo PunisherhRomDesc[] = { - { "psh_26.11e", 0x020000, 0x6ad2bb83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psh_30.11f", 0x020000, 0x058d3659, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psh_27.12e", 0x020000, 0x579f4fd3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psh_31.12f", 0x020000, 0x2c9f70b5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psh_24.9e", 0x020000, 0xfaa14841, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psh_28.9f", 0x020000, 0x5c5b1f20, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psh_25.10e", 0x020000, 0x724fdfda, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psh_29.10f", 0x020000, 0x779cf901, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ps_21.6f", 0x080000, 0x8affa5a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ps-1m.3a", 0x080000, 0x77b7ccab, BRF_GRA | CPS1_TILES }, - { "ps-3m.5a", 0x080000, 0x0122720b, BRF_GRA | CPS1_TILES }, - { "ps-2m.4a", 0x080000, 0x64fa58d4, BRF_GRA | CPS1_TILES }, - { "ps-4m.6a", 0x080000, 0x60da42c8, BRF_GRA | CPS1_TILES }, - { "ps-5m.7a", 0x080000, 0xc54ea839, BRF_GRA | CPS1_TILES }, - { "ps-7m.9a", 0x080000, 0x04c5acbd, BRF_GRA | CPS1_TILES }, - { "ps-6m.8a", 0x080000, 0xa544f4cc, BRF_GRA | CPS1_TILES }, - { "ps-8m.10a", 0x080000, 0x8f02f436, BRF_GRA | CPS1_TILES }, - - { "ps_q.5k", 0x020000, 0x49ff4446, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ps-q1.1k", 0x080000, 0x31fd8726, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q2.2k", 0x080000, 0x980a9eef, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q3.3k", 0x080000, 0x0dd44491, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "ps-q4.4k", 0x080000, 0xbed42f03, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - -#if !defined (ROM_VERIFY) - { "ps63b.1a", 0x000117, 0x03a758b0, BRF_OPT }, // b-board PLDs -#else - { "ps63b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs -#endif - - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Punisherh) -STD_ROM_FN(Punisherh) - -static struct BurnRomInfo PunipicRomDesc[] = { - { "cpu5.bin", 0x080000, 0xc3151563, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cpu3.bin", 0x080000, 0x8c2593ac, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cpu4.bin", 0x080000, 0x665a5485, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cpu2.bin", 0x080000, 0xd7b13f39, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "gfx9.bin", 0x080000, 0x9b9a887a, BRF_GRA | CPS1_TILES }, - { "gfx8.bin", 0x080000, 0x2b94287a, BRF_GRA | CPS1_TILES }, - { "gfx7.bin", 0x080000, 0xe9bd74f5, BRF_GRA | CPS1_TILES }, - { "gfx6.bin", 0x080000, 0xa5e1c8a4, BRF_GRA | CPS1_TILES }, - { "gfx13.bin", 0x080000, 0x6d75a193, BRF_GRA | CPS1_TILES }, - { "gfx12.bin", 0x080000, 0xa3c205c1, BRF_GRA | CPS1_TILES }, - { "gfx11.bin", 0x080000, 0x22f2ec92, BRF_GRA | CPS1_TILES }, - { "gfx10.bin", 0x080000, 0x763974c9, BRF_GRA | CPS1_TILES }, - - { "pic16c57", 0x004000, 0x00000000, BRF_PRG | BRF_NODUMP | CPS1_PIC }, - - { "sound.bin", 0x080000, 0xaeec9dc6, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Punipic) -STD_ROM_FN(Punipic) - -static struct BurnRomInfo Punipic2RomDesc[] = { - { "prg4.bin", 0x080000, 0xc3151563, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg3.bin", 0x080000, 0x8c2593ac, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg2.bin", 0x080000, 0x665a5485, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg1.bin", 0x080000, 0xd7b13f39, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "pu11256.bin", 0x200000, 0x6581faea, BRF_GRA | CPS1_TILES }, - { "pu13478.bin", 0x200000, 0x61613de4, BRF_GRA | CPS1_TILES }, - - { "pic16c57", 0x004000, 0x00000000, BRF_PRG | BRF_NODUMP | CPS1_PIC }, - - { "sound.bin", 0x080000, 0xaeec9dc6, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "93c46.bin", 0x000080, 0x36ab4e7d, BRF_OPT }, -}; - -STD_ROM_PICK(Punipic2) -STD_ROM_FN(Punipic2) - -static struct BurnRomInfo Punipic3RomDesc[] = { - { "psb5b.rom", 0x080000, 0x58f42c05, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psb3b.rom", 0x080000, 0x90113db4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psb4a.rom", 0x080000, 0x665a5485, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "psb2a.rom", 0x080000, 0xd7b13f39, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "psb-a.rom", 0x200000, 0x57f0f5e3, BRF_GRA | CPS1_TILES }, - { "psb-b.rom", 0x200000, 0xd9eb867e, BRF_GRA | CPS1_TILES }, -}; - -STD_ROM_PICK(Punipic3) -STD_ROM_FN(Punipic3) - -static struct BurnRomInfo PunisherbzRomDesc[] = { - { "23.096", 0x080000, 0xbfa45d23, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "22.096", 0x080000, 0x092578a4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "21.096", 0x080000, 0xd21ccddb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "20.096", 0x080000, 0xf9f334ce, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "1.096", 0x080000, 0xad468e07, BRF_GRA | CPS1_TILES }, - { "2.096", 0x080000, 0xb9fdb6b5, BRF_GRA | CPS1_TILES }, - { "3.096", 0x080000, 0xbe0b1a78, BRF_GRA | CPS1_TILES }, - { "4.096", 0x080000, 0xbba67a43, BRF_GRA | CPS1_TILES }, - { "ps_gfx5.rom", 0x080000, 0xc54ea839, BRF_GRA | CPS1_TILES }, - { "ps_gfx7.rom", 0x080000, 0x04c5acbd, BRF_GRA | CPS1_TILES }, - { "ps_gfx6.rom", 0x080000, 0xa544f4cc, BRF_GRA | CPS1_TILES }, - { "ps_gfx8.rom", 0x080000, 0x8f02f436, BRF_GRA | CPS1_TILES }, - - { "9.512", 0x010000, 0xb8367eb5, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18.010", 0x020000, 0x375c66e7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19.010", 0x020000, 0xeb5ca884, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Punisherbz) -STD_ROM_FN(Punisherbz) - -static struct BurnRomInfo PunisherbRomDesc[] = { - { "18.bin", 0x040000, 0x2565ad20, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "19.bin", 0x040000, 0x84bb4acf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "16.bin", 0x040000, 0x4568520f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "17.bin", 0x040000, 0xfda67fc1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "14.bin", 0x020000, 0x1286d6ad, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "15.bin", 0x020000, 0x092538ac, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "12.bin", 0x020000, 0x019744d4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "13.bin", 0x020000, 0x8b88ae0d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "1.bin", 0x080000, 0x35cb609a, BRF_GRA | CPS1_TILES }, - { "2.bin", 0x080000, 0xdcf61484, BRF_GRA | CPS1_TILES }, - { "3.bin", 0x080000, 0x3a76db83, BRF_GRA | CPS1_TILES }, - { "4.bin", 0x080000, 0xb099b669, BRF_GRA | CPS1_TILES }, - { "5.bin", 0x080000, 0x91365595, BRF_GRA | CPS1_TILES }, - { "6.bin", 0x080000, 0xb3cd4553, BRF_GRA | CPS1_TILES }, - { "7.bin", 0x080000, 0x3b940554, BRF_GRA | CPS1_TILES }, - { "8.bin", 0x080000, 0x43704b5a, BRF_GRA | CPS1_TILES }, - - { "11.bin", 0x010000, 0xd09d7c7a, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "9.bin", 0x020000, 0xbbea1643, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "10.bin", 0x020000, 0xac58aa71, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "pal1.jed", 0x000bd4, 0x22a9ff9e, BRF_OPT }, - { "pal2.jed", 0x000bd4, 0x8c4a97ac, BRF_OPT }, - { "pal3.jed", 0x000bd4, 0x0fdd5375, BRF_OPT }, - { "pal4.jed", 0x000e05, 0xb2d16eac, BRF_OPT }, -}; - -STD_ROM_PICK(Punisherb) -STD_ROM_FN(Punisherb) - -static struct BurnRomInfo QadRomDesc[] = { - { "qdu_36a.12f", 0x020000, 0xde9c24a0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "qdu_42a.12h", 0x020000, 0xcfe36f0c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "qdu_37a.13f", 0x020000, 0x10d22320, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "qdu_43a.13h", 0x020000, 0x15e6beb9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "qd_09.4b", 0x020000, 0x8c3f9f44, BRF_GRA | CPS1_TILES }, - { "qd_01.4a", 0x020000, 0xf688cf8f, BRF_GRA | CPS1_TILES }, - { "qd_13.9b", 0x020000, 0xafbd551b, BRF_GRA | CPS1_TILES }, - { "qd_05.9a", 0x020000, 0xc3db0910, BRF_GRA | CPS1_TILES }, - { "qd_24.5e", 0x020000, 0x2f1bd0ec, BRF_GRA | CPS1_TILES }, - { "qd_17.5c", 0x020000, 0xa812f9e2, BRF_GRA | CPS1_TILES }, - { "qd_38.8h", 0x020000, 0xccdddd1f, BRF_GRA | CPS1_TILES }, - { "qd_32.8f", 0x020000, 0xa8d295d3, BRF_GRA | CPS1_TILES }, - - { "qd_23.13b", 0x010000, 0xcfb5264b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "qdu_30.12c", 0x020000, 0xf190da84, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "qdu_31.13c", 0x020000, 0xb7583f73, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "qd22b.1a", 0x000117, 0x783c53ab, BRF_OPT }, // b-board PLDs - { "iob1.12e", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Qad) -STD_ROM_FN(Qad) - -static struct BurnRomInfo QadjrRomDesc[] = { - { "qad_23a.8f", 0x080000, 0x4d3553de, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "qad_22a.7f", 0x080000, 0x3191ddd0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "qad_01.3a", 0x080000, 0x9d853b57, BRF_GRA | CPS1_TILES }, - { "qad_02.4a", 0x080000, 0xb35976c4, BRF_GRA | CPS1_TILES }, - { "qad_03.5a", 0x080000, 0xcea4ca8c, BRF_GRA | CPS1_TILES }, - { "qad_04.6a", 0x080000, 0x41b74d1b, BRF_GRA | CPS1_TILES }, - - { "qad_09.12a", 0x010000, 0x733161cc, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "qad_18.11c", 0x020000, 0x2bfe6f6a, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "qad_19.12c", 0x020000, 0x13d3236b, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "qad63b.1a", 0x000117, 0xb3312b13, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Qadjr) -STD_ROM_FN(Qadjr) - -static struct BurnRomInfo Qtono2jRomDesc[] = { - { "tn2j_30.11e", 0x020000, 0x9226eb5e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tn2j_37.11f", 0x020000, 0xd1d30da1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tn2j_31.12e", 0x020000, 0x015e6a8a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tn2j_38.12f", 0x020000, 0x1f139bcc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tn2j_28.9e", 0x020000, 0x86d27f71, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tn2j_35.9f", 0x020000, 0x7a1ab87d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tn2j_29.10e", 0x020000, 0x9c384e99, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tn2j_36.10f", 0x020000, 0x4c4b2a0a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "tn2-02m.4a", 0x080000, 0xf2016a34, BRF_GRA | CPS1_TILES }, - { "tn2-04m.6a", 0x080000, 0x094e0fb1, BRF_GRA | CPS1_TILES }, - { "tn2-01m.3a", 0x080000, 0xcb950cf9, BRF_GRA | CPS1_TILES }, - { "tn2-03m.5a", 0x080000, 0x18a5bf59, BRF_GRA | CPS1_TILES }, - { "tn2-11m.4c", 0x080000, 0xd0edd30b, BRF_GRA | CPS1_TILES }, - { "tn2-13m.6c", 0x080000, 0x426621c3, BRF_GRA | CPS1_TILES }, - { "tn2-10m.3c", 0x080000, 0xa34ece70, BRF_GRA | CPS1_TILES }, - { "tn2-12m.5c", 0x080000, 0xe04ff2f4, BRF_GRA | CPS1_TILES }, - - { "tn2j_09.12a", 0x010000, 0xe464b969, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tn2j_18.11c", 0x020000, 0xa40bf9a7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "tn2j_19.12c", 0x020000, 0x5b3b931e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "tn2292.1a", 0x000117, 0x3d899539, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Qtono2j) -STD_ROM_FN(Qtono2j) - -static struct BurnRomInfo Sf2RomDesc[] = { - { "sf2e_30g.11e", 0x020000, 0xfe39ee33, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_37g.11f", 0x020000, 0xfb92cd74, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_31g.12e", 0x020000, 0x69a0a301, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_38g.12f", 0x020000, 0x5e22db70, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_28g.9e", 0x020000, 0x8bf9f1e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_35g.9f", 0x020000, 0x626ef934, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2) -STD_ROM_FN(Sf2) - -static struct BurnRomInfo Sf2ebRomDesc[] = { - { "sf2e_30b.11e", 0x020000, 0x57bd7051, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_37b.11f", 0x020000, 0x62691cdd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_31b.12e", 0x020000, 0xa673143d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_38b.12f", 0x020000, 0x4c2ccef7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_28b.9e", 0x020000, 0x4009955e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_35b.9f", 0x020000, 0x8c1f3994, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2eb) -STD_ROM_FN(Sf2eb) - -static struct BurnRomInfo Sf2edRomDesc[] = { - { "sf2e_30d.11e", 0x020000, 0x4bb2657c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_37d.11f", 0x020000, 0x102f4561, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_31d.12e", 0x020000, 0xd57b67d7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_38d.12f", 0x020000, 0x9c8916ef, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_28d.9e", 0x020000, 0x175819d1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_35d.9f", 0x020000, 0x82060da4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2ed) -STD_ROM_FN(Sf2ed) - -static struct BurnRomInfo Sf2eeRomDesc[] = { - { "sf2e_30e.11e", 0x020000, 0xf37cd088, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_37e.11f", 0x020000, 0xc39468e6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_31e.12e", 0x020000, 0x7c4771b4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_38e.12f", 0x020000, 0xa4bd0cd9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_28e.9e", 0x020000, 0xe3b95625, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_35e.9f", 0x020000, 0x3648769a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob2.11d", 0x000117, 0xd26f0a27, BRF_OPT }, - { "c632b.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2ee) -STD_ROM_FN(Sf2ee) - -static struct BurnRomInfo Sf2emRomDesc[] = { - { "sf2e_30.11e", 0x020000, 0x997bdac4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_37.11f", 0x020000, 0xf11b3d64, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_31.12e", 0x020000, 0x53e54744, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_38.12f", 0x020000, 0x5ff4dc81, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_28.9e", 0x020000, 0x55d88c35, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_35.9f", 0x020000, 0x4b964478, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29.10e", 0x020000, 0xfdd0b5c1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36.10f", 0x020000, 0xdb66b127, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2em) -STD_ROM_FN(Sf2em) - -static struct BurnRomInfo Sf2ebblRomDesc[] = { - { "12.bin", 0x040000, 0xa258b4d5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "09.bin", 0x040000, 0x59ccd474, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "11.bin", 0x040000, 0x82097d63, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "10.bin", 0x040000, 0x0c83844d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "1b_yf082.bin", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "1d_yf028.bin", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "1a_yf087.bin", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "1c_yf088.bin", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "1f_yf085.bin", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "1h_yf115.bin", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "1e_yf111.bin", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "1g_yf002.bin", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "1j_yf117.bin", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "1l_ye040.bin", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "1i_yf038.bin", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "1k_ye039.bin", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "03.bin", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "02.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "01.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "05.bin", 0x020000, 0xa505621e, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "07.bin", 0x020000, 0xde6271fb, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "06.bin", 0x020000, 0x23775344, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "08.bin", 0x020000, 0x81c9550f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - - { "04.bin", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2ebbl) -STD_ROM_FN(Sf2ebbl) - -static struct BurnRomInfo Sf2ebbl2RomDesc[] = { - { "27c020.7", 0x040000, 0xa258b4d5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27c020.5", 0x040000, 0x59ccd474, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27c020.6", 0x040000, 0x82097d63, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27c020.4", 0x040000, 0x0c83844d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "a-se235.bin", 0x100000, 0xa258de13, BRF_GRA | CPS1_TILES }, - { "c-se005.bin", 0x100000, 0xc781bf87, BRF_GRA | CPS1_TILES }, - { "b-se194.bin", 0x100000, 0x5726cab8, BRF_GRA | CPS1_TILES }, - { "d-se064.bin", 0x100000, 0x4dd24197, BRF_GRA | CPS1_TILES }, //sf2-8m.6c 99.999809% - { "e-sf004.bin", 0x100000, 0x187667cc, BRF_GRA | CPS1_TILES }, - { "f-sf001.bin", 0x100000, 0x5b585071, BRF_GRA | CPS1_TILES }, - - { "27c512.3", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "27c010.2", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "27c010.1", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "27c1024.10", 0x020000, 0x84427d1b, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "27c1024.12", 0x020000, 0x55bc790c, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "27c1024.9", 0x020000, 0xf8725add, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "27c1024.11", 0x020000, 0xc2a5373e, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - - { "27c512.8", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2ebbl2) -STD_ROM_FN(Sf2ebbl2) - -static struct BurnRomInfo Sf2ebbl3RomDesc[] = { - { "ce91e-b.bin", 0x080000, 0x963200d2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ce91e-a.bin", 0x080000, 0x02e88ec7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "1-b-yf197.07", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "1-d-yf207.12", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "27020.1", 0x040000, 0x84afb959, BRF_GRA | CPS1_TILES }, - { "27020.3", 0x040000, 0xab21635d, BRF_GRA | CPS1_TILES }, - { "27020.5", 0x040000, 0x2ce56f9f, BRF_GRA | CPS1_TILES }, - { "27020.7", 0x040000, 0x0ad7fb2b, BRF_GRA | CPS1_TILES }, - { "27020.2", 0x040000, 0x031525cc, BRF_GRA | CPS1_TILES }, - { "27020.4", 0x040000, 0xc97046a5, BRF_GRA | CPS1_TILES }, - { "1-h-yg010.10", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "1-e-yg003.02", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "27020.6", 0x040000, 0xdbbfd400, BRF_GRA | CPS1_TILES }, - { "27020.8", 0x040000, 0x37635e97, BRF_GRA | CPS1_TILES }, - { "1-j-yf213.09", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "wm91m-11-yd025.11", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "1-i-yf224.03", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "1-k-yf036.06", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "27512.3", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "27010.2", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "27010.1", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "27010.09hi", 0x020000, 0xa505621e, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "27010.11", 0x020000, 0xde6271fb, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "27010.09lo", 0x020000, 0x23775344, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "27010.06", 0x020000, 0x81c9550f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - - { "27512.8", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2ebbl3) -STD_ROM_FN(Sf2ebbl3) - -static struct BurnRomInfo Sf2sttRomDesc[] = { -#if !defined ROM_VERIFY - // These first two are missing from the PCB - { "prg part 1.stt", 0x040000, 0xa258b4d5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg part 2.stt", 0x040000, 0x59ccd474, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, -#else - { "prg part 1.stt", 0x040000, 0x00000000, BRF_OPT | BRF_PRG | BRF_NODUMP }, - { "prg part 2.stt", 0x040000, 0x00000000, BRF_OPT | BRF_PRG | BRF_NODUMP }, -#endif - { "ce91e-b", 0x040000, 0x0862386e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ce91e-a", 0x040000, 0x0c83844d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "stt-a", 0x100000, 0x10a7036d, BRF_GRA | CPS1_TILES }, - { "stt-d", 0x100000, 0x3580b124, BRF_GRA | CPS1_TILES }, - { "stt-b", 0x100000, 0x7a09224e, BRF_GRA | CPS1_TILES }, - { "stt-e", 0x100000, 0x382a612c, BRF_GRA | CPS1_TILES }, - { "stt-c", 0x100000, 0x11701b8f, BRF_GRA | CPS1_TILES }, - { "stt-f", 0x100000, 0x101a0b72, BRF_GRA | CPS1_TILES }, - - { "3.stt", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "2.stt", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "1.stt", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "5.stt", 0x020000, 0xa505621e, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "7.stt", 0x020000, 0xde6271fb, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "6.stt", 0x020000, 0x23775344, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.stt", 0x020000, 0x81c9550f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - - { "4.stt", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2stt) -STD_ROM_FN(Sf2stt) - -static struct BurnRomInfo Sf2uaRomDesc[] = { - { "sf2u_30a.11e", 0x020000, 0x08beb861, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_37a.11f", 0x020000, 0xb7638d69, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31a.12e", 0x020000, 0x0d5394e0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38a.12f", 0x020000, 0x42d6a79e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28a.9e", 0x020000, 0x387a175c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35a.9f", 0x020000, 0xa1a5adcc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2ua) -STD_ROM_FN(Sf2ua) - -static struct BurnRomInfo Sf2ubRomDesc[] = { - { "sf2u_30b.11e", 0x020000, 0x57bd7051, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_37b.11f", 0x020000, 0x4a54d479, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31b.12e", 0x020000, 0xa673143d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38b.12f", 0x020000, 0x4c2ccef7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28b.9e", 0x020000, 0x4009955e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35b.9f", 0x020000, 0x8c1f3994, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2ub) -STD_ROM_FN(Sf2ub) - -static struct BurnRomInfo Sf2ucRomDesc[] = { - { "sf2u_30c.11e", 0x020000, 0x6cb59385, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_37c.11f", 0x020000, 0x32e2c278, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31c.12e", 0x020000, 0xc4fff4a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38c.12f", 0x020000, 0x8210fc0e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28c.9e", 0x020000, 0x6eddd5e8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35c.9f", 0x020000, 0x6bcb404c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2uc) -STD_ROM_FN(Sf2uc) - -static struct BurnRomInfo Sf2udRomDesc[] = { - { "sf2u_30d.11e", 0x020000, 0x4bb2657c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_37d.11f", 0x020000, 0xb33b42f2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31d.12e", 0x020000, 0xd57b67d7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38d.12f", 0x020000, 0x9c8916ef, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28d.9e", 0x020000, 0x175819d1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35d.9f", 0x020000, 0x82060da4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2ud) -STD_ROM_FN(Sf2ud) - -static struct BurnRomInfo Sf2ueRomDesc[] = { - { "sf2u_30e.11e", 0x020000, 0xf37cd088, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_37e.11f", 0x020000, 0x6c61a513, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31e.12e", 0x020000, 0x7c4771b4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38e.12f", 0x020000, 0xa4bd0cd9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28e.9e", 0x020000, 0xe3b95625, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35e.9f", 0x020000, 0x3648769a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob2.11d", 0x000117, 0xd26f0a27, BRF_OPT }, - { "c632b.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2ue) -STD_ROM_FN(Sf2ue) - -static struct BurnRomInfo Sf2ufRomDesc[] = { - { "sf2u_30f.11e", 0x020000, 0xfe39ee33, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_37f.11f", 0x020000, 0x169e7388, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31f.12e", 0x020000, 0x69a0a301, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38f.12f", 0x020000, 0x1510e4e2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28f.9e", 0x020000, 0xacd8175b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35f.9f", 0x020000, 0xc0a80bd1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2uf) -STD_ROM_FN(Sf2uf) - -static struct BurnRomInfo Sf2ugRomDesc[] = { - { "sf2u_30g.11e", 0x020000, 0xfe39ee33, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_37g.11f", 0x020000, 0x5886cae7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31g.12e", 0x020000, 0x69a0a301, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38g.12f", 0x020000, 0x5e22db70, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28g.9e", 0x020000, 0x8bf9f1e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35g.9f", 0x020000, 0x626ef934, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2ug) -STD_ROM_FN(Sf2ug) - -static struct BurnRomInfo Sf2uiRomDesc[] = { - { "sf2u_30i.11e", 0x020000, 0xfe39ee33, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_37i.11f", 0x020000, 0x9df707dd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31i.12e", 0x020000, 0x69a0a301, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38i.12f", 0x020000, 0x4cb46daf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28i.9e", 0x020000, 0x1580be4c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35i.9f", 0x020000, 0x1468d185, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_9.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2ui) -STD_ROM_FN(Sf2ui) - -static struct BurnRomInfo Sf2ukRomDesc[] = { - { "sf2u_30k.11e", 0x020000, 0x8f66076c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_37k.11f", 0x020000, 0x4e1f6a83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31k.12e", 0x020000, 0xf9f89f60, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38k.12f", 0x020000, 0x6ce0a85a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28k.9e", 0x020000, 0x8e958f31, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35k.9f", 0x020000, 0xfce76fad, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_29a.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_36a.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2-5m.4a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2-7m.6a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2-1m.3a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2-3m.5a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2-6m.4c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2-8m.6c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2-2m.3c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2-4m.5c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2-13m.4d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2-15m.6d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2-9m.3d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2-11m.5d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_09.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2uk) -STD_ROM_FN(Sf2uk) - -static struct BurnRomInfo Sf2jRomDesc[] = { - { "sf2j30.bin", 0x020000, 0x79022b31, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j37.bin", 0x020000, 0x516776ec, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j31.bin", 0x020000, 0xfe15cb39, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j38.bin", 0x020000, 0x38614d70, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j28.bin", 0x020000, 0xd283187a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j35.bin", 0x020000, 0xd28158e4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29a.bin", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36a.bin", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2_06.8a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.10a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.7a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.9a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.8c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.10c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.7c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.9c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.8d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.10d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.7d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.9d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_09.bin", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2j) -STD_ROM_FN(Sf2j) - -static struct BurnRomInfo Sf2j17RomDesc[] = { - { "sf2_30l.11e", 0x020000, 0x79022b31, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_37l.11f", 0x020000, 0x04ba20c7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_31l.12e", 0x020000, 0xfe15cb39, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_38l.12f", 0x020000, 0x65cb1883, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_28l.9e", 0x020000, 0xd283187a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_35l.9f", 0x020000, 0xe3266622, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29l.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_36l.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2_06.8a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.10a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.7a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.9a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.8c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.10c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.7c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.9c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.8d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.10d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.7d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.9d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_09.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2j17) -STD_ROM_FN(Sf2j17) - -static struct BurnRomInfo Sf2jaRomDesc[] = { - { "sf2j_30a.11e", 0x020000, 0x57bd7051, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_37a.11f", 0x020000, 0x1e1f6844, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_31a.12e", 0x020000, 0xa673143d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_38a.12f", 0x020000, 0x4c2ccef7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_28a.9e", 0x020000, 0x4009955e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_35a.9f", 0x020000, 0x8c1f3994, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_29a.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_36a.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2_06.8a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.10a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.7a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.9a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.8c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.10c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.7c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.9c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.8d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.10d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.7d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.9d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2j_09.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2j_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2j_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2ja) -STD_ROM_FN(Sf2ja) - -static struct BurnRomInfo Sf2jcRomDesc[] = { - { "sf2j_30c.11e", 0x020000, 0x8add35ec, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_37c.11f", 0x020000, 0x0d74a256, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_31c.12e", 0x020000, 0xc4fff4a9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_38c.12f", 0x020000, 0x8210fc0e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_28c.9e", 0x020000, 0x6eddd5e8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_35c.9f", 0x020000, 0x6bcb404c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_29a.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_36a.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2_06.8a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.10a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.7a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.9a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.8c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.10c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.7c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.9c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.8d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.10d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.7d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.9d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_09.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2j_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2j_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2jc) -STD_ROM_FN(Sf2jc) - -static struct BurnRomInfo Sf2jfRomDesc[] = { - { "sf2j_30f.11e", 0x020000, 0xfe39ee33, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2e_30g.11e - { "sf2j_37f.11f", 0x020000, 0xc1428cc6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_31f.12e", 0x020000, 0x69a0a301, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2e_31g.12e - { "sf2j_38f.12f", 0x020000, 0x1510e4e2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_28f.9e", 0x020000, 0xacd8175b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_35f.9f", 0x020000, 0xc0a80bd1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_29a.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2_29b.10e - { "sf2j_36a.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2_36b.10f - - { "sf2_06.8a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.10a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.7a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.9a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.8c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.10c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.7c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.9c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.8d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.10d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.7d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.9d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_09.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, // == sf2_9.12a - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2jf) -STD_ROM_FN(Sf2jf) - -static struct BurnRomInfo Sf2jhRomDesc[] = { - { "sf2j_30h.11e", 0x020000, 0xfe39ee33, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2e_30g.11e - { "sf2j_37h.11f", 0x020000, 0x330304b0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_31h.12e", 0x020000, 0x69a0a301, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2e_31g.12e - { "sf2j_38h.12f", 0x020000, 0xa659f678, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_28h.9e", 0x020000, 0x8a5c8ee0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_35h.9f", 0x020000, 0xc828fc4d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_29a.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2_29b.10e - { "sf2j_36a.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2_36b.10f - - { "sf2_06.8a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.10a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.7a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.9a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.8c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.10c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.7c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.9c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.8d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.10d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.7d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.9d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_09.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, // == sf2_9.12a - - { "sf2_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2jh) -STD_ROM_FN(Sf2jh) - -static struct BurnRomInfo Sf2jlRomDesc[] = { - { "sf-2_30l.11e", 0x020000, 0x34a1ce02, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // Verified "SF-2" without "J" for Japan region - { "sf-2_37l.11f", 0x020000, 0x5b630ed2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf-2_31l.12e", 0x020000, 0x64ebc8d2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf-2_38l.12f", 0x020000, 0x73847443, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf-2_28l.9e", 0x020000, 0xeee2b426, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf-2_35l.9f", 0x020000, 0xeca8b452, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2j_29a.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2_29b.10e - { "sf2j_36a.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2_36b.10f - - { "sf2_06.8a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.10a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.7a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.9a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.8c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.10c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.7c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.9c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.8d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.10d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.7d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.9d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2j_09.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, // == sf2_09.12a / sf2_9.12a - - { "sf2j_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, // == sf2_18.11c - { "sf2j_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, // == sf2_19.12c - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2jl) -STD_ROM_FN(Sf2jl) - -static struct BurnRomInfo Sf2jlaRomDesc[] = { - // Not yet added to MAME but dumped from a real official board from Capcom - { "sf-2_30l.bin", 0x020000, 0x79022b31, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // Verified "SF-2" without "J" for Japan region - { "sf-2_37l.bin", 0x020000, 0x04ba20c7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf-2_31l.bin", 0x020000, 0xfe15cb39, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf-2_38l.bin", 0x020000, 0x65cb1883, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf-2_28l.bin", 0x020000, 0xd283187a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf-2_35l.bin", 0x020000, 0xe3266622, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_j_29_a.bin", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2_29b.10e - { "sf2_j_36_a.bin", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // == sf2_36b.10f - - { "sf2_06.8a", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.10a", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.7a", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.9a", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.8c", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.10c", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.7c", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.9c", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.8d", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.10d", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.7d", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.9d", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2j_09.12a", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, // == sf2_09.12a / sf2_9.12a - - { "sf2j_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, // == sf2_18.11c - { "sf2j_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, // == sf2_19.12c - - A_BOARD_PLDS - - { "stf29.1a", 0x000117, 0x043309c5, BRF_OPT }, // b-board PLDs - { "iob1.11d", 0x000117, 0x3abc0700, BRF_OPT }, - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Sf2jla) -STD_ROM_FN(Sf2jla) - -static struct BurnRomInfo Sf2qp1RomDesc[] = { - { "stfii-qkn-cps-17.33", 0x080000, 0x3a9458ee, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "stfii-qkn-cps-17.34", 0x080000, 0x4ed215d8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "sf2_06.bin", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.bin", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.bin", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.bin", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.bin", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.bin", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.bin", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.bin", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.bin", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.bin", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.bin", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.bin", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_09.bin", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS -}; - -STD_ROM_PICK(Sf2qp1) -STD_ROM_FN(Sf2qp1) - -static struct BurnRomInfo Sf2thndrRomDesc[] = { - { "17_30.11e", 0x020000, 0xd3cd6d18, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "17_37.11f", 0x020000, 0xe892716e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_31b.12e", 0x020000, 0xa673143d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_38b.12f", 0x020000, 0x4c2ccef7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_28b.9e", 0x020000, 0x4009955e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2u_35b.9f", 0x020000, 0x8c1f3994, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "17_29.10e", 0x020000, 0x8830b54d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "17_36.10f", 0x020000, 0x3f13ada3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sf2_06.bin", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.bin", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.bin", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.bin", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.bin", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.bin", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.bin", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.bin", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.bin", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.bin", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.bin", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.bin", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "sf2_09.bin", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sf2_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS -}; - -STD_ROM_PICK(Sf2thndr) -STD_ROM_FN(Sf2thndr) - -static struct BurnRomInfo Sf2bRomDesc[] = { - { "pf1-2-sg076.bin", 0x0100000, 0x1d15bc7a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - // the pcb is missing some pals/gals so it cannot be tested - { "pf4-sg072.bin", 0x0100000, 0x16289710, BRF_GRA | CPS1_TILES }, - { "pf7-sg103.bin", 0x0100000, 0xfb78022e, BRF_GRA | CPS1_TILES }, - { "pf5-sg095.bin", 0x0100000, 0x0a6be48b, BRF_GRA | CPS1_TILES }, - { "pf8-sg101.bin", 0x0100000, 0x6258c7cf, BRF_GRA | CPS1_TILES }, - { "pf6-sg068.bin", 0x0100000, 0x9b5b09d7, BRF_GRA | CPS1_TILES }, - { "pf9-sh001.bin", 0x0100000, 0x9f25090e, BRF_GRA | CPS1_TILES }, - - { "3snd.ic28", 0x0020000, 0xd5bee9cc, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Sf2b) -STD_ROM_FN(Sf2b) - -static struct BurnRomInfo Sf2b2RomDesc[] = { - // program roms u195 and u221 were missing from the PCB -// { "prg.u195", 0x080000, 0x00000000, BRF_ESS | BRF_PRG | BRF_NODUMP }, // missing from dump -// { "prg.u221", 0x080000, 0x00000000, BRF_ESS | BRF_PRG | BRF_NODUMP }, // missing from dump -// Instead we use some programs rom from sf2eb - { "sf2e_30b.11e", 0x020000, 0x57bd7051, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_37b.11f", 0x020000, 0x62691cdd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_31b.12e", 0x020000, 0xa673143d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2e_38b.12f", 0x020000, 0x4c2ccef7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prh2.u222", 0x040000, 0x6d0f77b8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prl1.u196", 0x040000, 0x9b96ee64, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "bdst-1.u70", 0x100000, 0xa94a8b19, BRF_GRA | CPS1_TILES }, - { "bdst-4.u68", 0x100000, 0x0405f21f, BRF_GRA | CPS1_TILES }, - { "bdst-2.u69", 0x100000, 0x05dc2043, BRF_GRA | CPS1_TILES }, - { "bdst-5.u64", 0x100000, 0x055b64f1, BRF_GRA | CPS1_TILES }, - { "bdst-3.u19", 0x100000, 0x1a518609, BRF_GRA | CPS1_TILES }, - { "bdst-6.u18", 0x100000, 0x84f9354f, BRF_GRA | CPS1_TILES }, - - { "sound.u191", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "voice.u210", 0x040000, 0x6cfffb11, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "grp1.u31", 0x020000, 0x6de44671, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "grp3.u29", 0x020000, 0xe8f14362, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "grp2.u30", 0x020000, 0xbf0cd819, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "grp4.u28", 0x020000, 0x76f9f91f, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - - { "u133", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2b2) -STD_ROM_FN(Sf2b2) - -static struct BurnRomInfo Sf2b3RomDesc[] = { -/*Street Fighter 2 bootleg - - -This game runs on a single bootleg PCB. -It uses 2 square PLCC custom graphics chips by Altera -On chips are written ... -ALTERA EP1810LC -I have seen a similar ALTERA chip on a Killer Instinct PCB - - -CPU: 68000-10, Z8400 (Z80A) -SND: YM2151, OKI6295, YM3012A -OSC: 16.000Mhz, 10.000Mhz, 3.5795Mhz - -Developers: -This PCB also has some 42 Pin Mask roms which are not dumped -as my reader will only accept up to 40 pin roms. -Hopefully, the existing dumped gfx roms will be the same. - -If you need more info, contact me. - -theguru@emuunlim.com*/ - - { "sf2e_30b.11e", 0x020000, 0x57bd7051, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // missing from dump (u6.bin and u5.bin match this set closest) - { "sf2e_37b.11f", 0x020000, 0x62691cdd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // missing from dump (u6.bin and u5.bin match this set closest) - { "sf2e_31b.12e", 0x020000, 0xa673143d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // missing from dump (u6.bin and u5.bin match this set closest) - { "sf2e_38b.12f", 0x020000, 0x4c2ccef7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // missing from dump (u6.bin and u5.bin match this set closest) - { "u6.bin", 0x020000, 0x5cfc3f39, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u5.bin", 0x020000, 0x47dd24b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2_29b.10e", 0x020000, 0xbb4af315, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // missing from dump (u6.bin and u5.bin match this set closest) - { "sf2_36b.10f", 0x020000, 0xc02a13eb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // missing from dump (u6.bin and u5.bin match this set closest) - - { "sf2_06.bin", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, - { "sf2_08.bin", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, - { "sf2_05.bin", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, - { "sf2_07.bin", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, - { "sf2_15.bin", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, - { "sf2_17.bin", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, - { "sf2_14.bin", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, - { "sf2_16.bin", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, - { "sf2_25.bin", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, - { "sf2_27.bin", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, - { "sf2_24.bin", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, - { "sf2_26.bin", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, - - { "u7.bin", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "u8.bin", 0x040000, 0x6cfffb11, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "sf2-1.bin", 0x020000, 0x6de44671, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "sf2-3.bin", 0x020000, 0xe8f14362, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "sf2-2.bin", 0x020000, 0xbf0cd819, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "sf2-4.bin", 0x020000, 0x76f9f91f, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - - { "sf2-5.bin", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown - - { "u3.bin", 0x020000, 0x2c9ece7c, BRF_OPT }, // seems to have most in common with some extra gfx roms, but also some program roms, maybe bad dump or maybe needing data from Altera chip? - { "u4.bin", 0x020000, 0x4efb4c7a, BRF_OPT }, // seems to have most in common with some extra gfx roms, but also some program roms, maybe bad dump or maybe needing data from Altera chip? -}; - -STD_ROM_PICK(Sf2b3) -STD_ROM_FN(Sf2b3) - -static struct BurnRomInfo Sf2ceRomDesc[] = { - { "s92e_23b.8f", 0x080000, 0x0aaa1a3a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_22b.7f", 0x080000, 0x2bbe15ed, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.6f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2ce) -STD_ROM_FN(Sf2ce) - -static struct BurnRomInfo Sf2ceeaRomDesc[] = { - { "s92e_23a.8f", 0x080000, 0x3f846b74, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_22a.7f", 0x080000, 0x99f1cca4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.6f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2ceea) -STD_ROM_FN(Sf2ceea) - -static struct BurnRomInfo Sf2cejaRomDesc[] = { - { "s92j_23a.8f", 0x080000, 0x4f42bb5a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92j_22a.7f", 0x080000, 0xc4f64bcd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.6f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.4a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.5a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.8a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.9a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.4c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.5c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.12a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2ceja) -STD_ROM_FN(Sf2ceja) - -static struct BurnRomInfo Sf2cejbRomDesc[] = { - { "s92j_23b.8f", 0x080000, 0x140876c5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92j_22b.7f", 0x080000, 0x2fbb3bfe, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.6f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.4a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.5a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.8a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.9a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.4c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.5c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.12a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2cejb) -STD_ROM_FN(Sf2cejb) - -static struct BurnRomInfo Sf2cejcRomDesc[] = { - { "s92j_23c.8f", 0x080000, 0xf0120635, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92j_22c.7f", 0x080000, 0x8c0b2ed6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92j_21a.6f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.4a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.5a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.8a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.9a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.4c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.5c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.12a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2cejc) -STD_ROM_FN(Sf2cejc) - -static struct BurnRomInfo Sf2ceuaRomDesc[] = { - { "s92u_23a.8f", 0x080000, 0xac44415b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_22a.7f", 0x080000, 0x99f1cca4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.6f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2ceua) -STD_ROM_FN(Sf2ceua) - -static struct BurnRomInfo Sf2ceubRomDesc[] = { - { "s92u_23b.8f", 0x080000, 0x996a3015, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_22b.7f", 0x080000, 0x2bbe15ed, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.6f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2ceub) -STD_ROM_FN(Sf2ceub) - -static struct BurnRomInfo Sf2ceucRomDesc[] = { - { "s92u_23c.8f", 0x080000, 0x0a8b6aa2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_22c.7f", 0x080000, 0x5fd8630b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.6f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2ceuc) -STD_ROM_FN(Sf2ceuc) - -static struct BurnRomInfo Sf2accRomDesc[] = { - { "sf2ca_23-c.bin", 0x080000, 0xe7c8c5a6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2ca_22-c.bin", 0x080000, 0x99f1cca4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2ca_21-c.bin", 0x040000, 0xcf7fcc8c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2acc) -STD_ROM_FN(Sf2acc) - -static struct BurnRomInfo Sf2accaRomDesc[] = { - { "23-c.8f", 0x080000, 0x35f9517b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "22-c.7f", 0x080000, 0x99f1cca4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "21-c.6f", 0x080000, 0x2ab2034f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2acca) -STD_ROM_FN(Sf2acca) - -static struct BurnRomInfo Sf2accp2RomDesc[] = { - { "sf2ca-23.bin", 0x080000, 0x36c3ba2f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2ca-22.bin", 0x080000, 0x0550453d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2ca-21.bin", 0x040000, 0x4c1c43ba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2accp2) -STD_ROM_FN(Sf2accp2) - -static struct BurnRomInfo Sf2dkot2RomDesc[] = { - { "turboii.23", 0x080000, 0x9bbfe420, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "turboii.22", 0x080000, 0x3e57ba19, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "turboii.21", 0x080000, 0xed4186bd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2dkot2) -STD_ROM_FN(Sf2dkot2) - -static struct BurnRomInfo Sf2rbRomDesc[] = { - { "sf2d__23.rom", 0x080000, 0x450532b0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2d__22.rom", 0x080000, 0xfe9d9cf5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.bin", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2rb) -STD_ROM_FN(Sf2rb) - -static struct BurnRomInfo Sf2rb2RomDesc[] = { - // Is this really a rainbow set? There is no rainbow logo and little else in common - { "27.bin", 0x020000, 0x40296ecd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "31.bin", 0x020000, 0x87954a41, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "26.bin", 0x020000, 0xa6974195, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "30.bin", 0x020000, 0x8141fe32, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "25.bin", 0x020000, 0x9ef8f772, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "29.bin", 0x020000, 0x7d9c479c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "24.bin", 0x020000, 0x93579684, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "28.bin", 0x020000, 0xff728865, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.bin", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2rb2) -STD_ROM_FN(Sf2rb2) - -static struct BurnRomInfo Sf2rb3RomDesc[] = { - { "sf2_ce_rb.23", 0x080000, 0x202f9e50, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2_ce_rb.22", 0x080000, 0x145e5219, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.bin", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2rb3) -STD_ROM_FN(Sf2rb3) - -static struct BurnRomInfo Sf2rb4RomDesc[] = { - // this set was previously known as sf2m4 - { "u222ne", 0x0080000, 0x7133489e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u196ne", 0x0080000, 0xb07a4f90, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.bin", 0x0080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2rb4) -STD_ROM_FN(Sf2rb4) - -static struct BurnRomInfo Sf2rb5RomDesc[] = { - // this set was previously known as sf2m12 - { "sfu8-1.040", 0x0080000, 0x10ec67fe, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sfu8-3.040", 0x0080000, 0x92eb3a1c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sfu8-2.010", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sfu8-4.010", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2rb5) -STD_ROM_FN(Sf2rb5) - -static struct BurnRomInfo Sf2rb6RomDesc[] = { - { "cebl_23", 0x080000, 0x1439fcad, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cebl_22", 0x080000, 0x27e80cb1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "cebl_21", 0x080000, 0xf21e3046, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2rb6) -STD_ROM_FN(Sf2rb6) - -static struct BurnRomInfo Sf2redRomDesc[] = { - { "sf2red.23", 0x080000, 0x40276abb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2red.22", 0x080000, 0x18daf387, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2red.21", 0x080000, 0x52c486bb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2red) -STD_ROM_FN(Sf2red) - -static struct BurnRomInfo Sf2red2RomDesc[] = { - // this set was previously known as sf2m13 - { "sf3d5-1040", 0x0080000, 0xbcdd2c3a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf3d5-3040", 0x0080000, 0x01965987, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf3d5-2010", 0x0020000, 0xdd2e1d31, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf3d5-4010", 0x0020000, 0xc95e4443, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2red2) -STD_ROM_FN(Sf2red2) - -static struct BurnRomInfo Sf2v004RomDesc[] = { - { "sf2v004.23", 0x080000, 0x52d19f2c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2v004.22", 0x080000, 0x4b26fde7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2red.21", 0x080000, 0x52c486bb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2v004) -STD_ROM_FN(Sf2v004) - -static struct BurnRomInfo Sf2v0042RomDesc[] = { - // this set was previously known as sf2m15 - { "sf3g-1.040", 0x0080000, 0xc90559a5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf3g-3.040", 0x0080000, 0x81f36682, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf3g-2.010", 0x0020000, 0x9eee20a1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf3g-4.010", 0x0020000, 0x6ac3d875, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2v0042) -STD_ROM_FN(Sf2v0042) - -static struct BurnRomInfo Sf2v0043RomDesc[] = { - { "22_08-92.7f", 0x080000, 0x95fbcc3e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "21_08-92.6f", 0x080000, 0x99f1cca4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "23_08-92.8f", 0x080000, 0x52c486bb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2v0043) -STD_ROM_FN(Sf2v0043) - -static struct BurnRomInfo Sf2dongbRomDesc[] = { - { "1.8f", 0x0080000, 0x19fffa37, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "1.7f", 0x0080000, 0x99f1cca4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "1.6f", 0x0080000, 0x65c2c719, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2dongb) -STD_ROM_FN(Sf2dongb) - -static struct BurnRomInfo Sf2bhhRomDesc[] = { - { "23", 0x0080000, 0x5cf63a9e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "22", 0x0080000, 0x3ed72bca, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.6f", 0x0080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2bhh) -STD_ROM_FN(Sf2bhh) - -static struct BurnRomInfo Sf2hfRomDesc[] = { - { "s2te_23.8f", 0x080000, 0x2dd72514, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s2te_22.7f", 0x080000, 0xaea6e035, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s2te_21.6f", 0x080000, 0xfd200288, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2hf) -STD_ROM_FN(Sf2hf) - -static struct BurnRomInfo Sf2hfuRomDesc[] = { - { "s2tu_23.8f", 0x080000, 0x89a1fc38, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s2tu_22.7f", 0x080000, 0xaea6e035, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s2tu_21.6f", 0x080000, 0xfd200288, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92-1m.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92-3m.5a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92-2m.4a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92-4m.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92-5m.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92-7m.9a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92-6m.8a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92-8m.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92-10m.3c", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92-12m.5c", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92-11m.4c", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92-13m.6c", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2hfu) -STD_ROM_FN(Sf2hfu) - -static struct BurnRomInfo Sf2hfjRomDesc[] = { - { "s2tj_23.8f", 0x080000, 0xea73b4dc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s2tj_22.7f", 0x080000, 0xaea6e035, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s2tj_21.6f", 0x080000, 0xfd200288, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.4a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.5a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.8a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.9a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s2t_10.3c", 0x080000, 0x3c042686, BRF_GRA | CPS1_TILES }, - { "s2t_11.4c", 0x080000, 0x8b7e7183, BRF_GRA | CPS1_TILES }, - { "s2t_12.5c", 0x080000, 0x293c888c, BRF_GRA | CPS1_TILES }, - { "s2t_13.6c", 0x080000, 0x842b35a4, BRF_GRA | CPS1_TILES }, - - { "s92_09.12a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2hfj) -STD_ROM_FN(Sf2hfj) - -static struct BurnRomInfo Sf2hfubRomDesc[] = { - { "s2tu-23", 0x080000, 0x71d36456, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s2tu-22", 0x080000, 0x8259426a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s2tu-21", 0x080000, 0x938f44d5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.3a", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.4a", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.5a", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.6a", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.7a", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.8a", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.9a", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.10a", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s2t_10.3c", 0x080000, 0x3c042686, BRF_GRA | CPS1_TILES }, - { "s2t_11.4c", 0x080000, 0x8b7e7183, BRF_GRA | CPS1_TILES }, - { "s2t_12.5c", 0x080000, 0x293c888c, BRF_GRA | CPS1_TILES }, - { "s2t_13.6c", 0x080000, 0x842b35a4, BRF_GRA | CPS1_TILES }, - - { "s92_09.12a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2hfub) -STD_ROM_FN(Sf2hfub) - -static struct BurnRomInfo Sf2hfjbRomDesc[] = { - // This set is also known as sf2ce13 - { "222-040.13", 0x080000, 0xec6f5cb3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "196-040.13", 0x080000, 0x0e9ac52b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "221-010.13", 0x020000, 0x8226c11c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "195-010.13", 0x020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s2t_10.bin", 0x080000, 0x3c042686, BRF_GRA | CPS1_TILES }, - { "s2t_11.bin", 0x080000, 0x8b7e7183, BRF_GRA | CPS1_TILES }, - { "s2t_12.bin", 0x080000, 0x293c888c, BRF_GRA | CPS1_TILES }, - { "s2t_13.bin", 0x080000, 0x842b35a4, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2hfjb) -STD_ROM_FN(Sf2hfjb) - -static struct BurnRomInfo Sf2hfjb2RomDesc[] = { - { "sf12-1.040", 0x080000, 0xec6f5cb3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf12-3.040", 0x080000, 0x0e9ac52b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf12-2.010", 0x020000, 0xd1707134, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf12-4.010", 0x020000, 0xcd1d5666, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s2t_10.bin", 0x080000, 0x3c042686, BRF_GRA | CPS1_TILES }, - { "s2t_11.bin", 0x080000, 0x8b7e7183, BRF_GRA | CPS1_TILES }, - { "s2t_12.bin", 0x080000, 0x293c888c, BRF_GRA | CPS1_TILES }, - { "s2t_13.bin", 0x080000, 0x842b35a4, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2hfjb2) -STD_ROM_FN(Sf2hfjb2) - -static struct BurnRomInfo Sf2yycRomDesc[] = { - { "b12.rom", 0x0080000, 0x8f742fd5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "b14.rom", 0x0080000, 0x8831ec7f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "b11.rom", 0x0020000, 0x94a46525, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "b13.rom", 0x0020000, 0x8fb3dd47, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - -#if !defined ROM_VERIFY - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -#endif -}; - -STD_ROM_PICK(Sf2yyc) -STD_ROM_FN(Sf2yyc) - -static struct BurnRomInfo Sf2yyc2RomDesc[] = { - // This set was previously known as sf2m14 - { "sf6-1.040", 0x0080000, 0xccd74822, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf6-3.040", 0x0080000, 0x2a48b557, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf6-2.010", 0x0020000, 0x64e6e091, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf6-4.010", 0x0020000, 0xc95e4443, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2yyc2) -STD_ROM_FN(Sf2yyc2) - -static struct BurnRomInfo Sf2koryuRomDesc[] = { - { "u222.rom", 0x0080000, 0x9236a79a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u196.rom", 0x0080000, 0xb23a869d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u221.rom", 0x0020000, 0x64e6e091, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u195.rom", 0x0020000, 0xc95e4443, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - -#if !defined ROM_VERIFY - { "u70.rom", 0x0100000, 0xbaa0f81f, BRF_GRA | CPS1_TILES }, - { "u68.rom", 0x0100000, 0x8edff95a, BRF_GRA | CPS1_TILES }, - { "u69.rom", 0x0100000, 0x468962b1, BRF_GRA | CPS1_TILES }, - { "u64.rom", 0x0100000, 0x8165f536, BRF_GRA | CPS1_TILES }, - { "u19.rom", 0x0100000, 0x39d763d3, BRF_GRA | CPS1_TILES }, - { "u18.rom", 0x0100000, 0x93ec42ae, BRF_GRA | CPS1_TILES }, -#else - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, -#endif - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // extra graphics roms are required (see bike's on Chun-Li stage), but using the current dumps we have lead to a corrupt - // Street Fighter II logo -}; - -STD_ROM_PICK(Sf2koryu) -STD_ROM_FN(Sf2koryu) - -static struct BurnRomInfo Sf2koryu2RomDesc[] = { - { "sf10-3040", 0x0080000, 0x9236a79a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf10-1040", 0x0080000, 0xb23a869d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf10-2010", 0x0020000, 0x8226c11c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf10-4010", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // extra graphics roms are required (see bike's on Chun-Li stage), but using the current dumps we have lead to a corrupt - // Street Fighter II logo -}; - -STD_ROM_PICK(Sf2koryu2) -STD_ROM_FN(Sf2koryu2) - -static struct BurnRomInfo Sf2koryu3RomDesc[] = { - // this set was previously known as sf2m6 - { "u222-6b", 0x0080000, 0x0a3692be, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u196-6b", 0x0080000, 0x80454da7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.bin", 0x0080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2koryu3) -STD_ROM_FN(Sf2koryu3) - -static struct BurnRomInfo Sf2amfRomDesc[] = { - { "5.amf", 0x080000, 0x03991fba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.amf", 0x080000, 0x39f15a1e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, -#if !defined ROM_VERIFY - { "4.u221", 0x040000, 0xb0bb6242, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // wasn't in original dump (set seems to be same as sf2amf7 but with different graphics roms) - { "3.u195", 0x040000, 0xf516e578, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // wasn't in original dump (set seems to be same as sf2amf7 but with different graphics roms) -#else - { "prg part 3.amf", 0x040000, 0x00000000, BRF_OPT | BRF_PRG | BRF_NODUMP | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg part 4.amf", 0x040000, 0x00000000, BRF_OPT | BRF_PRG | BRF_NODUMP | CPS1_68K_PROGRAM_BYTESWAP }, -#endif - - { "y.c.e.c m.k.r-001", 0x100000, 0xa258de13, BRF_GRA | CPS1_TILES }, - { "y.c.e.c m.k.r-003", 0x100000, 0xc781bf87, BRF_GRA | CPS1_TILES }, - { "y.c.e.c m.k.r-002", 0x100000, 0x5726cab8, BRF_GRA | CPS1_TILES }, - { "y.c.e.c d.w.c-011", 0x100000, 0xbc90c12f, BRF_GRA | CPS1_TILES }, - { "y.c.e.c d.w.c-012", 0x100000, 0x187667cc, BRF_GRA | CPS1_TILES }, - { "y.c.e.c d.w.c-013", 0x100000, 0x5b585071, BRF_GRA | CPS1_TILES }, - - { "3.amf", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "2.amf", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "1.amf", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - - { "7.amf", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2amf) -STD_ROM_FN(Sf2amf) - -static struct BurnRomInfo Sf2amf2RomDesc[] = { - { "m5m27c401.u222", 0x080000, 0x03991fba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "m5m27c401.u196", 0x080000, 0x39f15a1e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27020.u221", 0x040000, 0xaa4d55a6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27020.u195", 0x040000, 0x2bffa6f9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "fun-u70.bin", 0x100000, 0xa94a8b19, BRF_GRA | CPS1_TILES }, - { "fun-u68.bin", 0x100000, 0x0405f21f, BRF_GRA | CPS1_TILES }, - { "fun-u69.bin", 0x100000, 0x05dc2043, BRF_GRA | CPS1_TILES }, - { "fun-u67.bin", 0x100000, 0x055b64f1, BRF_GRA | CPS1_TILES }, - { "fun-u19.bin", 0x100000, 0x1a518609, BRF_GRA | CPS1_TILES }, - { "fun-u18.bin", 0x100000, 0x84f9354f, BRF_GRA | CPS1_TILES }, - - { "27512.u191", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "fun-u210.bin", 0x040000, 0x6cfffb11, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "grp1.u31", 0x020000, 0x6de44671, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "grp3.u29", 0x020000, 0xe8f14362, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "grp2.u30", 0x020000, 0xbf0cd819, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "grp4.u28", 0x020000, 0x76f9f91f, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - - { "27512.u133", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2amf2) -STD_ROM_FN(Sf2amf2) - -static struct BurnRomInfo Sf2amf3RomDesc[] = { - // this set was previously known as sf2m7 - { "u222-2i", 0x0040000, 0x1ca7adbd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u196-2i", 0x0040000, 0xf758408c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u222-2s", 0x0040000, 0x720cea3e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u196-2s", 0x0040000, 0x9932832c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.bin", 0x0080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2amf3) -STD_ROM_FN(Sf2amf3) - -static struct BurnRomInfo Sf2amf4RomDesc[] = { - // this set was previously known as sf2m10 - { "sfu9-1.040", 0x0080000, 0x95306baf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sfu9-3.040", 0x0080000, 0x21024d5f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sfu9-2.020", 0x0040000, 0x0b3fe5dd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sfu9-4.020", 0x0040000, 0xdbee7b18, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // extra graphics roms are required (see bike's on Chun-Li stage), but using the current dumps we have lead to a corrupt - // Street Fighter II logo (it's the only set that shows the ' after the logo -}; - -STD_ROM_PICK(Sf2amf4) -STD_ROM_FN(Sf2amf4) - -static struct BurnRomInfo Sf2amf5RomDesc[] = { - // this set was previously known as sf2th -// This was the original dump (JacKc found that if you split it into 4 then parts 2, 3 and 4 match u196 from sf2m5) -// The first 128Kb of the original dump appears to be missing data, and we are assuming that the dump is bad and using -// the u196 dump instead -// { "stf2th-5.bin", 0x0080000, 0x3127302c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "stf2th-7.bin", 0x0080000, 0x03991fba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "stf2th-5.bin", 0x0080000, 0x39f15a1e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "stf2th-6.bin", 0x0020000, 0x64e6e091, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "stf2th-4.bin", 0x0020000, 0xc95e4443, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "stf2th-10.bin", 0x020000, 0x84427d1b, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "stf2th-12.bin", 0x020000, 0x55bc790c, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "stf2th-9.bin", 0x020000, 0xf8725add, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "stf2th-11.bin", 0x020000, 0xc2a5373e, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - - { "sf2th-8.bin", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2amf5) -STD_ROM_FN(Sf2amf5) - -static struct BurnRomInfo Sf2amf6RomDesc[] = { - // this set was previously known as sf2tha - { "t-2.u52", 0x0080000, 0x0d305e8b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "t-1.u36", 0x0080000, 0x137d8665, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "t-4.u54", 0x0040000, 0x0b3fe5dd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "t-3.u38", 0x0040000, 0xdbee7b18, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "w03.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "w05.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "w04.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "w06.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "w07.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "w09.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "w08.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "w10.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "w11.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "w13.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "w12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "w14.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "r04.bin", 0x020000, 0x84427d1b, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "r06.bin", 0x020000, 0x55bc790c, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "r03.bin", 0x020000, 0xf8725add, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "r05.bin", 0x020000, 0xc2a5373e, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - - { "g01.bin", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown - - { "palce16v8h-7.u35", 0x006462, 0x4ce28f4a, BRF_OPT }, - { "plhs16l8an-8.u1", 0x001946, 0x50852ce7, BRF_OPT }, - { "palce16v8h-9.u34", 0x003254, 0xfeb26c41, BRF_OPT }, - { "plhs16l8an-x.u19", 0x001946, 0x63d7d7ba, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2amf6) -STD_ROM_FN(Sf2amf6) - -static struct BurnRomInfo Sf2amf7RomDesc[] = { - { "2.u222", 0x080000, 0x3a7a78f8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "1.u196", 0x080000, 0x6a3cb7ac, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.u221", 0x040000, 0xb0bb6242, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "3.u195", 0x040000, 0xf516e578, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "y.c.e.c m.k.r-001.u70", 0x100000, 0xa258de13, BRF_GRA | CPS1_TILES }, - { "y.c.e.c.m.k.r-003.u68", 0x100000, 0xc781bf87, BRF_GRA | CPS1_TILES }, - { "y.c.e.c.m.k.r-002.u69", 0x100000, 0x5726cab8, BRF_GRA | CPS1_TILES }, - { "y.c.e.c.d.w.c-011.u64", 0x100000, 0xbc90c12f, BRF_GRA | CPS1_TILES }, - { "y.c.e.c.d.w.c-012.u19", 0x100000, 0x187667cc, BRF_GRA | CPS1_TILES }, - { "y.c.e.c.d.w.c-013.u18", 0x100000, 0x5b585071, BRF_GRA | CPS1_TILES }, - - { "sound.u191", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "voice.u210", 0x040000, 0x6cfffb11, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "grp1.u31", 0x020000, 0x6de44671, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "grp3.u29", 0x020000, 0xe8f14362, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "grp2.u30", 0x020000, 0xbf0cd819, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - { "grp4.u28", 0x020000, 0x76f9f91f, BRF_GRA | CPS1_EXTRA_TILES_SF2B_400000 }, - - { "conv.u133", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2amf7) -STD_ROM_FN(Sf2amf7) - -static struct BurnRomInfo Sf2amf8RomDesc[] = { - // this set was previously known as sf2m5 - { "u222", 0x0080000, 0x03991fba, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u196", 0x0080000, 0x39f15a1e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.bin", 0x0080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2amf8) -STD_ROM_FN(Sf2amf8) - -static struct BurnRomInfo Sf2megaRomDesc[] = { - // this set was previously known as sf2m2 - { "ch222esp", 0x0080000, 0x9e6d058a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ch196esp", 0x0080000, 0xed2ff437, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.bin", 0x0080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2mega) -STD_ROM_FN(Sf2mega) - -static struct BurnRomInfo Sf2mega2RomDesc[] = { - // this set was previously known as sf2m9 - { "sf3a-1.040", 0x0080000, 0x9e6d058a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf3a-3.040", 0x0080000, 0x518d8404, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf3a-2", 0x0020000, 0xfca4fc1e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf3a-4", 0x0020000, 0xcfdd6f54, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2mega2) -STD_ROM_FN(Sf2mega2) - -static struct BurnRomInfo Sf2mdRomDesc[] = { - { "27040.6", 0x0080000, 0x16c6372e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27040.5", 0x0080000, 0x137d5f2e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27010.4", 0x0020000, 0x8226c11c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "27010.3", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "tat-01.bin", 0x0080000, 0xa887f7d4, BRF_GRA | CPS1_TILES }, - { "tat-03.bin", 0x0080000, 0x79fa8bf0, BRF_GRA | CPS1_TILES }, - { "tat-05.bin", 0x0080000, 0x9390ff23, BRF_GRA | CPS1_TILES }, - { "tat-07.bin", 0x0080000, 0x6a5f153c, BRF_GRA | CPS1_TILES }, - { "tat-02.bin", 0x0080000, 0xafb3b589, BRF_GRA | CPS1_TILES }, - { "tat-04.bin", 0x0080000, 0x32518120, BRF_GRA | CPS1_TILES }, - { "tat-06.bin", 0x0080000, 0x90f2053e, BRF_GRA | CPS1_TILES }, - { "tat-08.bin", 0x0080000, 0xc16579ae, BRF_GRA | CPS1_TILES }, - { "tat-09.bin", 0x0080000, 0x169d85a6, BRF_GRA | CPS1_TILES }, - { "tat-10.bin", 0x0080000, 0x0c638630, BRF_GRA | CPS1_TILES }, - { "tat-11.bin", 0x0080000, 0x32a3a841, BRF_GRA | CPS1_TILES }, - { "tat-12.bin", 0x0080000, 0x6ee19b94, BRF_GRA | CPS1_TILES }, - - { "27512.1", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "27020.2", 0x0040000, 0x6cfffb11, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "gal20v8.68kadd", 0x000157, 0xb7fbcc26, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2md) -STD_ROM_FN(Sf2md) - -static struct BurnRomInfo Sf2mdtRomDesc[] = { - { "3.ic172", 0x0080000, 0x5301b41f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "1.ic171", 0x0080000, 0xc1c803f6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.ic176", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.ic175", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "7.ic90", 0x0080000, 0x896eaf48, BRF_GRA | CPS1_TILES }, - { "13.ic89", 0x0080000, 0x305dd72a, BRF_GRA | CPS1_TILES }, - { "10.ic88", 0x0080000, 0xef3f5be8, BRF_GRA | CPS1_TILES }, - { "16.ic87", 0x0080000, 0xe57f6db9, BRF_GRA | CPS1_TILES }, - { "6.ic91", 0x0080000, 0x054cd5c4, BRF_GRA | CPS1_TILES }, - { "12.ic92", 0x0080000, 0x87e069e8, BRF_GRA | CPS1_TILES }, - { "9.ic93", 0x0080000, 0x818ca33d, BRF_GRA | CPS1_TILES }, - { "15.ic94", 0x0080000, 0x5dfb44d1, BRF_GRA | CPS1_TILES }, - { "8.ic86", 0x0080000, 0x34bbb3fa, BRF_GRA | CPS1_TILES }, - { "14.ic85", 0x0080000, 0x7d9f1a67, BRF_GRA | CPS1_TILES }, - { "11.ic84", 0x0080000, 0xcea6d1d6, BRF_GRA | CPS1_TILES }, - { "17.ic83", 0x0080000, 0x91a9a05d, BRF_GRA | CPS1_TILES }, - - { "5.ic26", 0x0020000, 0x17d5ba8a, BRF_PRG | CPS1_Z80_PROGRAM }, - - // extra graphics roms are required (see bike's on Chun-Li stage), but using the current dumps we have lead to a corrupt - // Street Fighter II logo -}; - -STD_ROM_PICK(Sf2mdt) -STD_ROM_FN(Sf2mdt) - -static struct BurnRomInfo Sf2mdtaRomDesc[] = { - { "3.mdta", 0x0080000, 0x9f544ef4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "5.mdta", 0x0080000, 0xd76d6621, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.mdta", 0x0020000, 0x74844192, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.mdta", 0x0020000, 0xbd98ff15, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - // f205v has redumped pf4 sh058.ic89 with the same result, it reports an error on pin 30, assumed bad. - // Instead we used pf4-sg072.bin from a sf2mdta alt set dump by ANY. -// { "pf4 sh058.ic89", 0x0100000, 0x40fdf624, BRF_GRA | CPS1_TILES }, - { "pf4 sh058.ic89", 0x0100000, 0x16289710, BRF_GRA | CPS1_TILES }, // == pf4-sg072.bin - { "pf7 sh072.ic92", 0x0100000, 0xfb78022e, BRF_GRA | CPS1_TILES }, - { "pf5 sh036.ic90", 0x0100000, 0x0a6be48b, BRF_GRA | CPS1_TILES }, - { "pf8 sh074.ic93", 0x0100000, 0x6258c7cf, BRF_GRA | CPS1_TILES }, - { "pf6 sh070.ic88", 0x0100000, 0x9b5b09d7, BRF_GRA | CPS1_TILES }, - { "pf9 sh001.ic91", 0x0100000, 0x9f25090e, BRF_GRA | CPS1_TILES }, - - { "1.ic28", 0x0020000, 0xd5bee9cc, BRF_PRG | CPS1_Z80_PROGRAM }, - - // extra graphics roms are required (see bike's on Chun-Li stage), but using the current dumps we have lead to a corrupt - // Street Fighter II logo -}; - -STD_ROM_PICK(Sf2mdta) -STD_ROM_FN(Sf2mdta) - -static struct BurnRomInfo Sf2mdtbRomDesc[] = { - { "3.ic172", 0x0080000, 0x0bdb9da2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "1.ic171", 0x0080000, 0xd88abbce, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.ic176", 0x0020000, 0x74844192, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.ic175", 0x0020000, 0xbd98ff15, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "7.ic90", 0x0080000, 0x896eaf48, BRF_GRA | CPS1_TILES }, - { "13.ic89", 0x0080000, 0x305dd72a, BRF_GRA | CPS1_TILES }, - { "10.ic88", 0x0080000, 0xef3f5be8, BRF_GRA | CPS1_TILES }, - { "16.ic87", 0x0080000, 0xe57f6db9, BRF_GRA | CPS1_TILES }, - { "6.ic91", 0x0080000, 0x054cd5c4, BRF_GRA | CPS1_TILES }, - { "12.ic92", 0x0080000, 0x87e069e8, BRF_GRA | CPS1_TILES }, - { "9.ic93", 0x0080000, 0x818ca33d, BRF_GRA | CPS1_TILES }, - { "15.ic94", 0x0080000, 0x5dfb44d1, BRF_GRA | CPS1_TILES }, - { "8.ic86", 0x0080000, 0x34bbb3fa, BRF_GRA | CPS1_TILES }, - { "14.ic85", 0x0080000, 0x7d9f1a67, BRF_GRA | CPS1_TILES }, - { "11.ic84", 0x0080000, 0xcea6d1d6, BRF_GRA | CPS1_TILES }, - { "17.ic83", 0x0080000, 0x91a9a05d, BRF_GRA | CPS1_TILES }, - - { "5.ic28", 0x0020000, 0xd5bee9cc, BRF_PRG | CPS1_Z80_PROGRAM }, - - // extra graphics roms are required (see bike's on Chun-Li stage), but using the current dumps we have lead to a corrupt - // Street Fighter II logo -}; - -STD_ROM_PICK(Sf2mdtb) -STD_ROM_FN(Sf2mdtb) - -static struct BurnRomInfo Sf2mdtcRomDesc[] = { - // f205v id 1396 - // PCB marked: 110-09-91 CH35/1 - { "3.ic171", 0x0080000, 0x9f544ef4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "5.ic171", 0x0080000, 0xd76d6621, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.ic171", 0x0020000, 0x74844192, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.ic171", 0x0020000, 0xbd98ff15, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "pf4-sg072.ic90", 0x0100000, 0x446575c7, BRF_GRA | CPS1_TILES }, - { "pf7-sg088.ic88", 0x0100000, 0xfb78022e, BRF_GRA | CPS1_TILES }, - { "pf5-sg095.ic91", 0x0100000, 0x0a6be48b, BRF_GRA | CPS1_TILES }, - { "pf8-sg101.ic93", 0x0100000, 0x6258c7cf, BRF_GRA | CPS1_TILES }, - { "pf6-sg078.ic86", 0x0100000, 0x9b5b09d7, BRF_GRA | CPS1_TILES }, - { "pf9-sh001.ic84", 0x0100000, 0x9f25090e, BRF_GRA | CPS1_TILES }, - - { "3.ic26", 0x0020000, 0xd5bee9cc, BRF_PRG | CPS1_Z80_PROGRAM }, - - // extra graphics roms are required (see bike's on Chun-Li stage), but using the current dumps we have lead to a corrupt - // Street Fighter II logo -}; - -STD_ROM_PICK(Sf2mdtc) -STD_ROM_FN(Sf2mdtc) - -static struct BurnRomInfo Sf2ceeablRomDesc[] = { - // this set was previously known as sf2m16 - { "joe-922", 0x0080000, 0xe927556c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "joe-921", 0x0080000, 0x8632e786, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2m16_4.bin", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf2m16_3.bin", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "tat-01.bin", 0x0080000, 0xa887f7d4, BRF_GRA | CPS1_TILES }, - { "tat-03.bin", 0x0080000, 0x79fa8bf0, BRF_GRA | CPS1_TILES }, - { "tat-05.bin", 0x0080000, 0x9390ff23, BRF_GRA | CPS1_TILES }, - { "tat-07.bin", 0x0080000, 0x6a5f153c, BRF_GRA | CPS1_TILES }, - { "tat-02.bin", 0x0080000, 0xafb3b589, BRF_GRA | CPS1_TILES }, - { "tat-04.bin", 0x0080000, 0x32518120, BRF_GRA | CPS1_TILES }, - { "tat-06.bin", 0x0080000, 0x90f2053e, BRF_GRA | CPS1_TILES }, - { "tat-08.bin", 0x0080000, 0xc16579ae, BRF_GRA | CPS1_TILES }, - { "tat-09.bin", 0x0080000, 0x169d85a6, BRF_GRA | CPS1_TILES }, - { "tat-10.bin", 0x0080000, 0x0c638630, BRF_GRA | CPS1_TILES }, - { "tat-11.bin", 0x0080000, 0x32a3a841, BRF_GRA | CPS1_TILES }, - { "tat-12.bin", 0x0080000, 0x6ee19b94, BRF_GRA | CPS1_TILES }, - - { "sf2m16_1.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2m16_2.bin", 0x0040000, 0x6cfffb11, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2ceeabl) -STD_ROM_FN(Sf2ceeabl) - -static struct BurnRomInfo Sf2ceeab2RomDesc[] = { - // this set was previously known as sf2m1 - { "222e", 0x0080000, 0x1e20d0a3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "196e", 0x0080000, 0x88cc38a3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.bin", 0x0080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2ceeab2) -STD_ROM_FN(Sf2ceeab2) - -static struct BurnRomInfo Sf2ceeab3RomDesc[] = { - // f205v id 1395 - { "3.ic172", 0x0080000, 0x11b5fe98, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "1.ic171", 0x0080000, 0x6d948623, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.ic176", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.ic175", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "7.ic90", 0x0080000, 0x896eaf48, BRF_GRA | CPS1_TILES }, - { "13.ic89", 0x0080000, 0x305dd72a, BRF_GRA | CPS1_TILES }, - { "10.ic88", 0x0080000, 0xef3f5be8, BRF_GRA | CPS1_TILES }, - { "16.ic87", 0x0080000, 0xe57f6db9, BRF_GRA | CPS1_TILES }, - { "6.ic91", 0x0080000, 0x054cd5c4, BRF_GRA | CPS1_TILES }, - { "12.ic92", 0x0080000, 0x87e069e8, BRF_GRA | CPS1_TILES }, - { "9.ic93", 0x0080000, 0x818ca33d, BRF_GRA | CPS1_TILES }, - { "15.ic94", 0x0080000, 0x5dfb44d1, BRF_GRA | CPS1_TILES }, - { "8.ic86", 0x0080000, 0x34bbb3fa, BRF_GRA | CPS1_TILES }, - { "14.ic85", 0x0080000, 0x7d9f1a67, BRF_GRA | CPS1_TILES }, - { "11.ic84", 0x0080000, 0xcea6d1d6, BRF_GRA | CPS1_TILES }, - { "17.ic83", 0x0080000, 0x91a9a05d, BRF_GRA | CPS1_TILES }, - - { "5.ic26", 0x0020000, 0x17d5ba8a, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Sf2ceeab3) -STD_ROM_FN(Sf2ceeab3) - -static struct BurnRomInfo Sf2ceeab4RomDesc[] = { - // f20v id 1394 - { "3.ic172", 0x0080000, 0x30848e16, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "1.ic171", 0x0080000, 0x6d948623, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.ic176", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.ic175", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "7.ic90", 0x0080000, 0x896eaf48, BRF_GRA | CPS1_TILES }, - { "13.ic89", 0x0080000, 0x305dd72a, BRF_GRA | CPS1_TILES }, - { "10.ic88", 0x0080000, 0xef3f5be8, BRF_GRA | CPS1_TILES }, - { "16.ic87", 0x0080000, 0xe57f6db9, BRF_GRA | CPS1_TILES }, - { "6.ic91", 0x0080000, 0x054cd5c4, BRF_GRA | CPS1_TILES }, - { "12.ic92", 0x0080000, 0x87e069e8, BRF_GRA | CPS1_TILES }, - { "9.ic93", 0x0080000, 0x818ca33d, BRF_GRA | CPS1_TILES }, - { "15.ic94", 0x0080000, 0x5dfb44d1, BRF_GRA | CPS1_TILES }, - { "8.ic86", 0x0080000, 0x34bbb3fa, BRF_GRA | CPS1_TILES }, - { "14.ic85", 0x0080000, 0x7d9f1a67, BRF_GRA | CPS1_TILES }, - { "11.ic84", 0x0080000, 0xcea6d1d6, BRF_GRA | CPS1_TILES }, - { "17.ic83", 0x0080000, 0x91a9a05d, BRF_GRA | CPS1_TILES }, - - { "5.ic26", 0x0020000, 0x17d5ba8a, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Sf2ceeab4) -STD_ROM_FN(Sf2ceeab4) - - -static struct BurnRomInfo Sf2ceeab5RomDesc[] = { - // f205v id 1400 - { "3.ic172", 0x0080000, 0x11b5fe98, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "5.ic171", 0x0080000, 0x43e85f2c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.ic176", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.ic175", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "10.ic90", 0x0080000, 0x896eaf48, BRF_GRA | CPS1_TILES }, - { "16.ic89", 0x0080000, 0x305dd72a, BRF_GRA | CPS1_TILES }, - { "7.ic88", 0x0080000, 0xef3f5be8, BRF_GRA | CPS1_TILES }, - { "13.ic87", 0x0080000, 0xe57f6db9, BRF_GRA | CPS1_TILES }, - { "11.ic91", 0x0080000, 0x054cd5c4, BRF_GRA | CPS1_TILES }, - { "17.ic92", 0x0080000, 0x87e069e8, BRF_GRA | CPS1_TILES }, - { "8.ic93", 0x0080000, 0x818ca33d, BRF_GRA | CPS1_TILES }, - { "14.ic94", 0x0080000, 0x5dfb44d1, BRF_GRA | CPS1_TILES }, - { "9.ic86", 0x0080000, 0x34bbb3fa, BRF_GRA | CPS1_TILES }, - { "15.ic85", 0x0080000, 0x7d9f1a67, BRF_GRA | CPS1_TILES }, - { "6.ic84", 0x0080000, 0xcea6d1d6, BRF_GRA | CPS1_TILES }, - { "12.ic83", 0x0080000, 0x91a9a05d, BRF_GRA | CPS1_TILES }, - - { "1.ic26", 0x0020000, 0x17d5ba8a, BRF_PRG | CPS1_Z80_PROGRAM }, -}; - -STD_ROM_PICK(Sf2ceeab5) -STD_ROM_FN(Sf2ceeab5) - -static struct BurnRomInfo Sf2cejablRomDesc[] = { - // this set was previously known as sf2m11 - { "sfu7-1.040", 0x0080000, 0x866a9b31, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sfu7-3.040", 0x0080000, 0xf3a45593, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sfu7-2.010", 0x0020000, 0xd1707134, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sfu7-4.010", 0x0020000, 0xcd1d5666, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2cejabl) -STD_ROM_FN(Sf2cejabl) - -static struct BurnRomInfo Sf2cejab2RomDesc[] = { - { "u7-1.040", 0x0080000, 0x866a9b31, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u7-3.040", 0x0080000, 0x49b15fcd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.bin", 0x0080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2cejab2) -STD_ROM_FN(Sf2cejab2) - -static struct BurnRomInfo Sf2ceuplRomDesc[] = { - // Only the main program EPROMS were dumped for this set - { "S2.U222", 0x0080000, 0x0804f973, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "S1.U196", 0x0080000, 0x2bc76a02, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "10.U221", 0x0020000, 0xd1707134, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "9.U195", 0x0020000, 0xcd1d5666, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.3a", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.4a", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.5a", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.6a", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.7a", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.8a", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.9a", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.10a", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.3c", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.4c", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.5c", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.6c", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.12a", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.11c", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.12c", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "s9263b.1a", 0x000117, 0x0a7ecfe0, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2ceupl) -STD_ROM_FN(Sf2ceupl) - -static struct BurnRomInfo Sf2ceuablRomDesc[] = { - // this set was previously known as sf2m3 - { "u222chp", 0x0080000, 0xdb567b66, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u196chp", 0x0080000, 0x95ea597e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.bin", 0x0080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2ceuabl) -STD_ROM_FN(Sf2ceuabl) - -static struct BurnRomInfo Sf2ceuab2RomDesc[] = { - // this set was previously known as sf2m8 -// This was the original dump which was bad -// { "u221.epr", 0x0020000, 0xd8276822, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "k4-222", 0x0080000, 0xdb567b66, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "k4-196", 0x0080000, 0x95ea597e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u221.epr", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u195.epr", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2ceuab2) -STD_ROM_FN(Sf2ceuab2) - -static struct BurnRomInfo Sf2ceuab3RomDesc[] = { - // this set was previously known as sf2m8a - { "yyc-2.2", 0x0080000, 0xdb567b66, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // same as sf2m8 - { "yyc-3.4", 0x0080000, 0x95ea597e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // same as sf2m8 - { "yyc-4.1", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // same as sf2m8 - { "yyc-5.3", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // same as sf2m8 - - { "yyc-a", 0x0100000, 0x8242621f, BRF_GRA | CPS1_TILES }, - { "yyc-c", 0x0100000, 0x0793a960, BRF_GRA | CPS1_TILES }, - { "yyc-b", 0x0100000, 0xb0159973, BRF_GRA | CPS1_TILES }, - { "yyc-d", 0x0100000, 0x92a8b572, BRF_GRA | CPS1_TILES }, - { "yyc-e", 0x0100000, 0x61138469, BRF_GRA | CPS1_TILES }, - { "yyc-f", 0x0100000, 0xb800dcdb, BRF_GRA | CPS1_TILES }, - - { "a-15.5", 0x0010000, 0x6f07d2cb, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "b-16.6", 0x0040000, 0x6cfffb11, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "yyc-6.1", 0x0020000, 0x94778332, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "yyc-8.9", 0x0020000, 0xf95bc505, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "yyc-7.10", 0x0020000, 0xd1e452d3, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "yyc-9.8", 0x0020000, 0x155824a9, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - - { "c-27.7", 0x0010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2ceuab3) -STD_ROM_FN(Sf2ceuab3) - -static struct BurnRomInfo Sf2ceuab4RomDesc[] = { - { "6st-u196.u196", 0x0100000, 0x596609d4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "6st-u10.u10", 0x0080000, 0xed4186bd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "6st-u70.u70", 0x0100000, 0xbaa0f81f, BRF_GRA | CPS1_TILES }, - { "6st-u68.u68", 0x0100000, 0x8edff95a, BRF_GRA | CPS1_TILES }, - { "6st-u69.u69", 0x0100000, 0x468962b1, BRF_GRA | CPS1_TILES }, - { "6st-u64.u64", 0x0100000, 0x8165f536, BRF_GRA | CPS1_TILES }, - { "6st-u19.u19", 0x0100000, 0x39d763d3, BRF_GRA | CPS1_TILES }, - { "6st-u18.u18", 0x0100000, 0x2ddfe46e, BRF_GRA | CPS1_TILES }, - - { "u191", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "u210", 0x0040000, 0x6cfffb11, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "6st-u31.u31", 0x0040000, 0x35486f2d, BRF_GRA | CPS1_EXTRA_TILES_SF2KORYU_400000 }, - { "6st-u29.u29", 0x0040000, 0xe4eca601, BRF_GRA | CPS1_EXTRA_TILES_SF2KORYU_400000 }, - - { "u133", 0x0010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2ceuab4) -STD_ROM_FN(Sf2ceuab4) - -static struct BurnRomInfo Sf2ceuab5RomDesc[] = { - { "7.bin", 0x080000, 0xdb567b66, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // same as sf2m8 - { "5.bin", 0x080000, 0x95ea597e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // same as sf2m8 - { "6.bin", 0x020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // same as sf2m8 - { "4.bin", 0x020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // same as sf2m8 - - // not in the original dump (see below) - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, // this was missing from dump, but the pcm data is the same, so assuming the z80 program is too - - { "2.bin", 0x040000, 0x06dec6cd, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "9.bin", 0x020000, 0x94778332, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "17.bin", 0x020000, 0xf95bc505, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.bin", 0x020000, 0xd1e452d3, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "18.bin", 0x020000, 0x155824a9, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - - { "8.bin", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown - - // original gfx files (these are in similar format to the tat-x gfx roms with each half swapped, - // however, only about 60% of the data is the same and each of these compress to approx. 52-55% - // of the others, I believe these are bad dumps - // romcmp also reports BADADDR -xxx-xxxxxxxxxxxxxx for each one - { "11.bin", 0x080000, 0xc5430b62, BRF_OPT }, - { "13.bin", 0x080000, 0xe57f4114, BRF_OPT }, - { "12.bin", 0x080000, 0x9a3672e9, BRF_OPT }, - { "14.bin", 0x080000, 0x36b69ebd, BRF_OPT }, - { "19.bin", 0x080000, 0xadb33f90, BRF_OPT }, - { "21.bin", 0x080000, 0xfacffca9, BRF_OPT }, - { "20.bin", 0x080000, 0x28b4c2d1, BRF_OPT }, - { "22.bin", 0x080000, 0xcb49e6a7, BRF_OPT }, - { "15.bin", 0x080000, 0x8c08c9bd, BRF_OPT }, - { "23.bin", 0x080000, 0xf613febd, BRF_OPT }, - { "16.bin", 0x080000, 0xf23b588b, BRF_OPT }, - { "24(__sf2ceuab5).bin", 0x080000, 0xb4f16226, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2ceuab5) -STD_ROM_FN(Sf2ceuab5) - -static struct BurnRomInfo Sf2ceuab6RomDesc[] = { - { "s92u_23a.8f", 0x0080000, 0xac44415b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // not in original dump - { "s92_22a.7f", 0x0080000, 0x99f1cca4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // not in original dump - { "6", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "7", 0x0020000, 0x8312d055, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // loads over final part of s92u_23a.8f - { "5", 0x0020000, 0xd0580ff2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // loads over final part of s92_22a.7f - - { "11", 0x0080000, 0xa887f7d4, BRF_GRA | CPS1_TILES }, - { "13", 0x0080000, 0x79fa8bf0, BRF_GRA | CPS1_TILES }, - { "12", 0x0080000, 0x9390ff23, BRF_GRA | CPS1_TILES }, - { "14", 0x0080000, 0x6a5f153c, BRF_GRA | CPS1_TILES }, - { "19", 0x0080000, 0xafb3b589, BRF_GRA | CPS1_TILES }, - { "21", 0x0080000, 0x32518120, BRF_GRA | CPS1_TILES }, - { "20", 0x0080000, 0x90f2053e, BRF_GRA | CPS1_TILES }, - { "22", 0x0080000, 0xc16579ae, BRF_GRA | CPS1_TILES }, - { "15", 0x0080000, 0x169d85a6, BRF_GRA | CPS1_TILES }, - { "23", 0x0080000, 0x0c638630, BRF_GRA | CPS1_TILES }, - { "16", 0x0080000, 0x32a3a841, BRF_GRA | CPS1_TILES }, - { "24", 0x0080000, 0x6ee19b94, BRF_GRA | CPS1_TILES }, - - { "3", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "2", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "1", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "9", 0x0020000, 0x94778332, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "17", 0x0020000, 0xf95bc505, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10", 0x0020000, 0xd1e452d3, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "18", 0x0020000, 0x155824a9, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - - { "8", 0x0010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2ceuab6) -STD_ROM_FN(Sf2ceuab6) - -static struct BurnRomInfo Sf2ceuab7RomDesc[] = { - // this set is known as sf2ceblp in MAME 0.153 - { "prg31.bin", 0x0020000, 0xea78f9b4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg36.bin", 0x0020000, 0xd30c263e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg30.bin", 0x0020000, 0x005b54cc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg35.bin", 0x0020000, 0xc184d26d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg29.bin", 0x0020000, 0x524f5c55, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg34.bin", 0x0020000, 0xf06a12f2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg28.bin", 0x0040000, 0xb7ad5214, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "prg33.bin", 0x0040000, 0x6340b914, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "24.bin", 0x0040000, 0xa8b5633a, BRF_GRA | CPS1_TILES }, - { "20.bin", 0x0040000, 0x8d5d0045, BRF_GRA | CPS1_TILES }, - { "25.bin", 0x0040000, 0x72e923df, BRF_GRA | CPS1_TILES }, - { "21.bin", 0x0040000, 0x55c2b455, BRF_GRA | CPS1_TILES }, - { "14.bin", 0x0040000, 0x5db24ca7, BRF_GRA | CPS1_TILES }, - { "10.bin", 0x0040000, 0xeb48f7f2, BRF_GRA | CPS1_TILES }, - { "15.bin", 0x0040000, 0x9a96be48, BRF_GRA | CPS1_TILES }, - { "11.bin", 0x0040000, 0xff36859e, BRF_GRA | CPS1_TILES }, - { "26.bin", 0x0040000, 0x82e8e384, BRF_GRA | CPS1_TILES }, - { "22.bin", 0x0040000, 0x4109d637, BRF_GRA | CPS1_TILES }, - { "27.bin", 0x0040000, 0x4a3a8d09, BRF_GRA | CPS1_TILES }, - { "23.bin", 0x0040000, 0xef9c2d4d, BRF_GRA | CPS1_TILES }, - { "16.bin", 0x0040000, 0x1fd98ad0, BRF_GRA | CPS1_TILES }, - { "12.bin", 0x0040000, 0x5d21d8b3, BRF_GRA | CPS1_TILES }, - { "17.bin", 0x0040000, 0xa917a922, BRF_GRA | CPS1_TILES }, - { "13.bin", 0x0040000, 0xbc937c96, BRF_GRA | CPS1_TILES }, - { "6.bin", 0x0040000, 0x023baa18, BRF_GRA | CPS1_TILES }, - { "1.bin", 0x0040000, 0x877b2b18, BRF_GRA | CPS1_TILES }, - { "8.bin", 0x0040000, 0x26fb340c, BRF_GRA | CPS1_TILES }, - { "4.bin", 0x0040000, 0xf2c400b4, BRF_GRA | CPS1_TILES }, - { "5.bin", 0x0040000, 0xa6ad6ef3, BRF_GRA | CPS1_TILES }, - { "2.bin", 0x0040000, 0x144aa4c9, BRF_GRA | CPS1_TILES }, - { "7.bin", 0x0040000, 0xf56085ba, BRF_GRA | CPS1_TILES }, - { "3.bin", 0x0040000, 0x8053335d, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x0020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "pic16c55", 0x0002000, 0xf22e2311, BRF_OPT }, // PIC -}; - -STD_ROM_PICK(Sf2ceuab7) -STD_ROM_FN(Sf2ceuab7) - -static struct BurnRomInfo Sf2ceuab8RomDesc[] = { - // f205v id 1404 & 1405 - { "7.bin", 0x080000, 0x74803532, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "5.bin", 0x080000, 0x66c91972, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "6.bin", 0x020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.bin", 0x020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "a-se235.bin", 0x100000, 0xa258de13, BRF_GRA | CPS1_TILES }, - { "c-se005.bin", 0x100000, 0xc781bf87, BRF_GRA | CPS1_TILES }, - { "b-se194.bin", 0x100000, 0x5726cab8, BRF_GRA | CPS1_TILES }, - { "d-se064.bin", 0x100000, 0x4dd24197, BRF_GRA | CPS1_TILES }, - { "e-sf004.bin", 0x100000, 0x187667cc, BRF_GRA | CPS1_TILES }, - { "f-sf001.bin", 0x100000, 0x5b585071, BRF_GRA | CPS1_TILES }, - - { "3.bin", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "2.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "1.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "10.bin", 0x020000, 0x84427d1b, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "12.bin", 0x020000, 0x55bc790c, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "9.bin", 0x020000, 0xf8725add, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "11.bin", 0x020000, 0xc2a5373e, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - - { "8.bin", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2ceuab8) -STD_ROM_FN(Sf2ceuab8) - -static struct BurnRomInfo Sf2ceuab9RomDesc[] = { - // f205v id 1403 - { "7.bin", 0x080000, 0x74803532, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "6.bin", 0x080000, 0x66c91972, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "5.bin", 0x020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.bin", 0x020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "wm91m-07_yd034", 0x080000, 0x22c9cc8e, BRF_GRA | CPS1_TILES }, // == sf2-5m.4a - { "wm91m-12_yd021", 0x080000, 0x57213be8, BRF_GRA | CPS1_TILES }, // == sf2-7m.6a - { "wm91m-01_yd403", 0x080000, 0xba529b4f, BRF_GRA | CPS1_TILES }, // == sf2-1m.3a - { "wm91m-04_yd051", 0x080000, 0x4b1b33a8, BRF_GRA | CPS1_TILES }, // == sf2-3m.5a - { "wm91m-08_yd062", 0x080000, 0x2c7e2229, BRF_GRA | CPS1_TILES }, // == sf2-6m.4c - { "wm91m-10_yd032", 0x080000, 0xb5548f17, BRF_GRA | CPS1_TILES }, // == sf2-8m.6c - { "wm91m-02_yd028", 0x080000, 0x14b84312, BRF_GRA | CPS1_TILES }, // == sf2-2m.3c - { "wm91m-05_yd004", 0x080000, 0x5e9cd89a, BRF_GRA | CPS1_TILES }, // == sf2-4m.5c - { "wm91m-09_yd024", 0x080000, 0x994bfa58, BRF_GRA | CPS1_TILES }, // == sf2-13m.4d - { "wm91m-11_yd014", 0x080000, 0x3e66ad9d, BRF_GRA | CPS1_TILES }, // == sf2-15m.6d - { "wm91m-03_yd036", 0x080000, 0xc1befaa8, BRF_GRA | CPS1_TILES }, // == sf2-9m.3d - { "wm91m-06_yd009", 0x080000, 0x0627c831, BRF_GRA | CPS1_TILES }, // == sf2-11m.5d - - { "3.bin", 0x010000, 0xa4823a1b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "2.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "1.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "10.bin", 0x020000, 0x84427d1b, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "12.bin", 0x020000, 0x55bc790c, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "9.bin", 0x020000, 0xf8725add, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - { "11.bin", 0x020000, 0xc2a5373e, BRF_GRA | CPS1_EXTRA_TILES_400000 }, - - { "8.bin", 0x010000, 0x13ea1c44, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Sf2ceuab9) -STD_ROM_FN(Sf2ceuab9) - -static struct BurnRomInfo Sf2ceucblRomDesc[] = { - { "s92u_23c.8f", 0x080000, 0x0a8b6aa2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // not included in dump (matches first half of ym.u23) - { "s92_22c.7f", 0x080000, 0x5fd8630b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // not included in dump (matches first half of ym.u22) - { "s92_21a.6f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // not included in dump (nearly matches first half of ym.u21) - { "ym.u23", 0x040000, 0xd6b39cc3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // this looks half-sized (loading over the top of above roms) - { "ym.u22", 0x040000, 0xefa0a775, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // this looks half-sized (loading over the top of above roms) - { "ym.u21", 0x040000, 0xc812b7b2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // this looks half-sized (loading over the top of above roms) - - // not in the original dump (see below) - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.11a", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, // this was missing from dump, but the pcm data is the same, so assuming the z80 program is too - - { "2.bin", 0x040000, 0x06dec6cd, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't in this dump - but given the presence of the bad graphic rom dumps (from sf2ceuab5), I think these should be here too - { "9.bin", 0x020000, 0x94778332, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "17.bin", 0x020000, 0xf95bc505, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.bin", 0x020000, 0xd1e452d3, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "18.bin", 0x020000, 0x155824a9, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - - // original gfx files (these are in similar format to the tat-x gfx roms with each half swapped, - // however, only about 60% of the data is the same and each of these compress to approx. 52-55% - // of the others, I believe these are bad dumps - // romcmp also reports BADADDR -xxx-xxxxxxxxxxxxxx for each one - { "11.bin", 0x080000, 0xc5430b62, BRF_OPT }, - { "13.bin", 0x080000, 0xe57f4114, BRF_OPT }, - { "12.bin", 0x080000, 0x9a3672e9, BRF_OPT }, - { "14.bin", 0x080000, 0x36b69ebd, BRF_OPT }, - { "19.bin", 0x080000, 0xadb33f90, BRF_OPT }, - { "21.bin", 0x080000, 0xfacffca9, BRF_OPT }, - { "20.bin", 0x080000, 0x28b4c2d1, BRF_OPT }, - { "22.bin", 0x080000, 0xcb49e6a7, BRF_OPT }, - { "15.bin", 0x080000, 0x8c08c9bd, BRF_OPT }, - { "23.bin", 0x080000, 0xf613febd, BRF_OPT }, - { "16.bin", 0x080000, 0xf23b588b, BRF_OPT }, - { "24(__sf2ceucbl).bin", 0x080000, 0xb4f16226, BRF_OPT }, -}; - -STD_ROM_PICK(Sf2ceucbl) -STD_ROM_FN(Sf2ceucbl) - -static struct BurnRomInfo Sf2tlonaRomDesc[] = { - // There is a set known as sf2tlond and sf2turyu which contains the same data, but has double-size program roms - { "tl4mt.1", 0x080000, 0x158635ca, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tl4m.2", 0x080000, 0x882cd1c4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u221t.1m", 0x020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u195t.1m", 0x020000, 0xdb7e1f72, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2tlona) -STD_ROM_FN(Sf2tlona) - -static struct BurnRomInfo Sf2tlonbRomDesc[] = { - // This set is also known as sf2tury2 - { "tl4m.1", 0x080000, 0xafc7bd18, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "tl4m.2", 0x080000, 0x882cd1c4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u221.1m", 0x020000, 0xd1707134, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "u195.1m", 0x020000, 0xcd1d5666, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2tlonb) -STD_ROM_FN(Sf2tlonb) - -static struct BurnRomInfo Sf2tloncRomDesc[] = { - { "sf11-1.040", 0x080000, 0xafc7bd18, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf11-3.040", 0x080000, 0x882cd1c4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf11-2.010", 0x020000, 0xf8a5cd53, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sf11-4.010", 0x020000, 0xdb7e1f72, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - // these weren't present with this set, but extra graphics are required (see bike's on Chun-Li stage) - { "6.amf", 0x020000, 0x3a85a275, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "9.amf", 0x020000, 0x9156472f, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "8.amf", 0x020000, 0xecdb083b, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, - { "10.amf", 0x020000, 0x8fea8384, BRF_GRA | CPS1_EXTRA_TILES_SF2EBBL_400000 }, -}; - -STD_ROM_PICK(Sf2tlonc) -STD_ROM_FN(Sf2tlonc) - -static struct BurnRomInfo Sf2sl73aRomDesc[] = { - // Sheng Long Hack is based off of sf2m5. - // It runs perfectly fine on an real sf2ce capcom cps1 arcade board. - { "sf2ced_23b.8f", 0x080000, 0x190f5419, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2ced_22b.7f", 0x080000, 0x2b329193, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2ced_21a.6f", 0x080000, 0xb4f13bef, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x0080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x0080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x0080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x0080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x0080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x0080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x0080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x0080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x0080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x0080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x0080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x0080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x0010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sf2ced_18.11c", 0x0020000, 0xa446a596, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x0020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2sl73a) -STD_ROM_FN(Sf2sl73a) - -static struct BurnRomInfo Sf2cebltwRomDesc[] = { - { "27.12e", 0x020000, 0x035ee5d9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "31.12f", 0x020000, 0x353dbde1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "24.9e", 0x020000, 0x005b54cc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "28.9f", 0x020000, 0xc184d26d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "25.10e", 0x020000, 0x524f5c55, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "29.10f", 0x020000, 0xf06a12f2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "26.11e", 0x020000, 0x8312d055, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "30.11f", 0x020000, 0xd0580ff2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "s92_21a.5f", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "bruteforce.palce16v8h-25.11d", 0x040000, 0x430f722d, BRF_OPT }, // pal -}; - -STD_ROM_PICK(Sf2cebltw) -STD_ROM_FN(Sf2cebltw) - -static struct BurnRomInfo SfzchRomDesc[] = { - { "sfzch23", 0x080000, 0x1140743f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza22", 0x080000, 0x8d9b2480, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfzch21", 0x080000, 0x5435225d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza20", 0x080000, 0x806e8f38, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "sfz_01.3a", 0x080000, 0x0dd53e62, BRF_GRA | CPS1_TILES }, - { "sfz_02.4a", 0x080000, 0x94c31e3f, BRF_GRA | CPS1_TILES }, - { "sfz_03.5a", 0x080000, 0x9584ac85, BRF_GRA | CPS1_TILES }, - { "sfz_04.6a", 0x080000, 0xb983624c, BRF_GRA | CPS1_TILES }, - { "sfz_05.7a", 0x080000, 0x2b47b645, BRF_GRA | CPS1_TILES }, - { "sfz_06.8a", 0x080000, 0x74fd9fb1, BRF_GRA | CPS1_TILES }, - { "sfz_07.9a", 0x080000, 0xbb2c734d, BRF_GRA | CPS1_TILES }, - { "sfz_08.10a", 0x080000, 0x454f7868, BRF_GRA | CPS1_TILES }, - { "sfz_10.3c", 0x080000, 0x2a7d675e, BRF_GRA | CPS1_TILES }, - { "sfz_11.4c", 0x080000, 0xe35546c8, BRF_GRA | CPS1_TILES }, - { "sfz_12.5c", 0x080000, 0xf122693a, BRF_GRA | CPS1_TILES }, - { "sfz_13.6c", 0x080000, 0x7cf942c8, BRF_GRA | CPS1_TILES }, - { "sfz_14.7c", 0x080000, 0x09038c81, BRF_GRA | CPS1_TILES }, - { "sfz_15.8c", 0x080000, 0x1aa17391, BRF_GRA | CPS1_TILES }, - { "sfz_16.9c", 0x080000, 0x19a5abd6, BRF_GRA | CPS1_TILES }, - { "sfz_17.10c", 0x080000, 0x248b3b73, BRF_GRA | CPS1_TILES }, - - { "sfz_09.12a", 0x010000, 0xc772628b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sfz_18.11c", 0x020000, 0x61022b2d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sfz_19.12c", 0x020000, 0x3b5886d5, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sfzch) -STD_ROM_FN(Sfzch) - -static struct BurnRomInfo SlammastRomDesc[] = { - { "mbe_23e.8f", 0x080000, 0x5394057a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbe_24b.9e", 0x020000, 0x95d5e729, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_28b.9f", 0x020000, 0xb1c7cbcb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_25b.10e", 0x020000, 0xa50d3fd4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_29b.10f", 0x020000, 0x08e32e56, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_21a.6f", 0x080000, 0xd5007b05, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbe_20a.5f", 0x080000, 0xaeb557b0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb-1m.3a", 0x080000, 0x41468e06, BRF_GRA | CPS1_TILES }, - { "mb-3m.5a", 0x080000, 0xf453aa9e, BRF_GRA | CPS1_TILES }, - { "mb-2m.4a", 0x080000, 0x2ffbfea8, BRF_GRA | CPS1_TILES }, - { "mb-4m.6a", 0x080000, 0x1eb9841d, BRF_GRA | CPS1_TILES }, - { "mb-5m.7a", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb-7m.9a", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb-6m.8a", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb-8m.10a", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb-10m.3c", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb-12m.5c", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb-11m.4c", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb-13m.6c", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_qa.5k", 0x020000, 0xe21a03c4, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb-q1.1k", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q2.2k", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q3.3k", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q4.4k", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q5.1m", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q6.2m", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q7.3m", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q8.4m", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "mb63b.1a", 0x000117, 0xb8392f02, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Slammast) -STD_ROM_FN(Slammast) - -static struct BurnRomInfo SlammastuRomDesc[] = { - { "mbu_23e.8f", 0x080000, 0x224f0062, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbu_24b.9e", 0x020000, 0x95d5e729, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbu_28b.9f", 0x020000, 0xb1c7cbcb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbu_25b.10e", 0x020000, 0xa50d3fd4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbu_29b.10f", 0x020000, 0x08e32e56, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbu_21a.6f", 0x080000, 0xd5007b05, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbu_20a.5f", 0x080000, 0xfc848af5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb-1m.3a", 0x080000, 0x41468e06, BRF_GRA | CPS1_TILES }, - { "mb-3m.5a", 0x080000, 0xf453aa9e, BRF_GRA | CPS1_TILES }, - { "mb-2m.4a", 0x080000, 0x2ffbfea8, BRF_GRA | CPS1_TILES }, - { "mb-4m.6a", 0x080000, 0x1eb9841d, BRF_GRA | CPS1_TILES }, - { "mb-5m.7a", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb-7m.9a", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb-6m.8a", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb-8m.10a", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb-10m.3c", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb-12m.5c", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb-11m.4c", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb-13m.6c", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_qa.5k", 0x020000, 0xe21a03c4, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb-q1.1k", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q2.2k", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q3.3k", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q4.4k", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q5.1m", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q6.2m", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q7.3m", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q8.4m", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "mb63b.1a", 0x000117, 0xb8392f02, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Slammastu) -STD_ROM_FN(Slammastu) - -static struct BurnRomInfo MbomberjRomDesc[] = { - { "mbj_23e.8f", 0x080000, 0x0d06036a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbj_22b.7f", 0x080000, 0xacd38478, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbj_21a.6f", 0x080000, 0xd5007b05, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbj_20a.5f", 0x080000, 0xaeb557b0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb_01.3a", 0x080000, 0xa53b1c81, BRF_GRA | CPS1_TILES }, - { "mb_02.4a", 0x080000, 0x23fe10f6, BRF_GRA | CPS1_TILES }, - { "mb_03.5a", 0x080000, 0xcb866c2f, BRF_GRA | CPS1_TILES }, - { "mb_04.6a", 0x080000, 0xc9143e75, BRF_GRA | CPS1_TILES }, - { "mb_05.7a", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb_06.8a", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb_07.9a", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb_08.10a", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb_10.3c", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb_11.4c", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb_12.5c", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb_13.6c", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_qa.5k", 0x020000, 0xe21a03c4, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb-q1.1k", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q2.2k", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q3.3k", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q4.4k", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q5.1m", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q6.2m", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q7.3m", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q8.4m", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "mb63b.1a", 0x000117, 0xb8392f02, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Mbomberj) -STD_ROM_FN(Mbomberj) - -static struct BurnRomInfo MbombrdRomDesc[] = { - { "mbde_26.11e", 0x020000, 0x72b7451c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbde_30.11f", 0x020000, 0xa036dc16, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbde_27.12e", 0x020000, 0x4086f534, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbde_31.12f", 0x020000, 0x085f47f0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbde_24.9e", 0x020000, 0xc20895a5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbde_28.9f", 0x020000, 0x2618d5e1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbde_25.10e", 0x020000, 0x9bdb6b11, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbde_29.10f", 0x020000, 0x3f52d5e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbde_21.6f", 0x080000, 0x690c026a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbde_20.5f", 0x080000, 0xb8b2139b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb-1m.3a", 0x080000, 0x41468e06, BRF_GRA | CPS1_TILES }, - { "mb-3m.5a", 0x080000, 0xf453aa9e, BRF_GRA | CPS1_TILES }, - { "mb-2m.4a", 0x080000, 0x2ffbfea8, BRF_GRA | CPS1_TILES }, - { "mb-4m.6a", 0x080000, 0x1eb9841d, BRF_GRA | CPS1_TILES }, - { "mb-5m.7a", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb-7m.9a", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb-6m.8a", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb-8m.10a", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb-10m.3c", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb-12m.5c", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb-11m.4c", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb-13m.6c", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_q.5k", 0x020000, 0xd6fa76d1, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb-q1.1k", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q2.2k", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q3.3k", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q4.4k", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q5.1m", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q6.2m", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q7.3m", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q8.4m", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "mb63b.1a", 0x000117, 0xb8392f02, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Mbombrd) -STD_ROM_FN(Mbombrd) - -static struct BurnRomInfo MbombrdjRomDesc[] = { - { "mbdj_26.11e", 0x020000, 0x72b7451c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdj_30.11f", 0x020000, 0xbeff31cf, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdj_27.12e", 0x020000, 0x4086f534, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdj_31.12f", 0x020000, 0x085f47f0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdj_24.9e", 0x020000, 0xc20895a5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdj_28.9f", 0x020000, 0x2618d5e1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdj_25.10e", 0x020000, 0x9bdb6b11, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdj_29.10f", 0x020000, 0x3f52d5e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdj_21.6f", 0x080000, 0x690c026a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbdj_20.5f", 0x080000, 0xb8b2139b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb_01.3a", 0x080000, 0xa53b1c81, BRF_GRA | CPS1_TILES }, - { "mb_02.4a", 0x080000, 0x23fe10f6, BRF_GRA | CPS1_TILES }, - { "mb_03.5a", 0x080000, 0xcb866c2f, BRF_GRA | CPS1_TILES }, - { "mb_04.6a", 0x080000, 0xc9143e75, BRF_GRA | CPS1_TILES }, - { "mb_05.7a", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb_06.8a", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb_07.9a", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb_08.10a", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb_10.3c", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb_11.4c", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb_12.5c", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb_13.6c", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_qa.5k", 0x020000, 0xe21a03c4, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb-q1.1k", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q2.2k", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q3.3k", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q4.4k", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q5.1m", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q6.2m", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q7.3m", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb-q8.4m", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "mb63b.1a", 0x000117, 0xb8392f02, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k2.9k", 0x000117, 0xcd85a156, BRF_OPT }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Mbombrdj) -STD_ROM_FN(Mbombrdj) - -static struct BurnRomInfo SlampicRomDesc[] = { - { "5.bin", 0x080000, 0x7dba63cd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "3.bin", 0x080000, 0xd86671f3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4.bin", 0x080000, 0xd14d0e42, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2.bin", 0x080000, 0x38063cd8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "9.bin", 0x080000, 0xdc140351, BRF_GRA | CPS1_TILES }, - { "8.bin", 0x080000, 0x9ae88035, BRF_GRA | CPS1_TILES }, - { "7.bin", 0x080000, 0x5321f759, BRF_GRA | CPS1_TILES }, - { "6.bin", 0x080000, 0xc8eb5f76, BRF_GRA | CPS1_TILES }, - { "17.bin", 0x080000, 0x21652214, BRF_GRA | CPS1_TILES }, - { "16.bin", 0x080000, 0xd49d2eb0, BRF_GRA | CPS1_TILES }, - { "15.bin", 0x080000, 0x0d98bfd6, BRF_GRA | CPS1_TILES }, - { "14.bin", 0x080000, 0x807284f1, BRF_GRA | CPS1_TILES }, - { "13.bin", 0x080000, 0x293579c5, BRF_GRA | CPS1_TILES }, - { "12.bin", 0x080000, 0xc3727ce7, BRF_GRA | CPS1_TILES }, - { "11.bin", 0x080000, 0x2919883b, BRF_GRA | CPS1_TILES }, - { "10.bin", 0x080000, 0xf538e620, BRF_GRA | CPS1_TILES }, - - // not in dump but the game expects to read it as protection, maybe the PIC writes to the same area? - { "mb_qa.5k", 0x020000, 0xe21a03c4, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "pic16c57-xt-p.bin", 0x002000, 0xaeae5ccc, BRF_PRG | CPS1_PIC }, -#if !defined ROM_VERIFY - { "pic16c57-xt-p.hex", 0x005a1e, 0x61f8607e, BRF_OPT }, // hex dump of PIC -#endif - - { "18.bin", 0x080000, 0x73a0c11c, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Slampic) -STD_ROM_FN(Slampic) - -static struct BurnRomInfo StriderRomDesc[] = { - { "30.11f", 0x020000, 0xda997474, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "35.11h", 0x020000, 0x5463aaa3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "31.12f", 0x020000, 0xd20786db, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "36.12h", 0x020000, 0x21aa2863, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "st-14.8h", 0x080000, 0x9b3cfc08, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "st-2.8a", 0x080000, 0x4eee9aea, BRF_GRA | CPS1_TILES }, - { "st-11.10a", 0x080000, 0x2d7f21e4, BRF_GRA | CPS1_TILES }, - { "st-5.4a", 0x080000, 0x7705aa46, BRF_GRA | CPS1_TILES }, - { "st-9.6a", 0x080000, 0x5b18b722, BRF_GRA | CPS1_TILES }, - { "st-1.7a", 0x080000, 0x005f000b, BRF_GRA | CPS1_TILES }, - { "st-10.9a", 0x080000, 0xb9441519, BRF_GRA | CPS1_TILES }, - { "st-4.3a", 0x080000, 0xb7d04e8b, BRF_GRA | CPS1_TILES }, - { "st-8.5a", 0x080000, 0x6b4713b4, BRF_GRA | CPS1_TILES }, - - { "09.12b", 0x010000, 0x2ed403bc, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18.11c", 0x020000, 0x4386bc80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19.12c", 0x020000, 0x444536d7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "st24m1.1a", 0x000117, 0xa80d357e, BRF_OPT }, // b-board PLDs - { "lwio.11e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Strider) -STD_ROM_FN(Strider) - -static struct BurnRomInfo StrideruaRomDesc[] = { - { "30.11f", 0x020000, 0x66aec273, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // different CRC from strider, pcb verified - { "35.11h", 0x020000, 0x50e0e865, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // different CRC from strider, pcb verified - { "31.12f", 0x020000, 0xeae93bd1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // different CRC from strider, pcb verified - { "36.12h", 0x020000, 0xb904a31d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, // different CRC from strider, pcb verified - { "st-14.8h", 0x080000, 0x9b3cfc08, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // in "32" socket - - { "st-2.8a", 0x080000, 0x4eee9aea, BRF_GRA | CPS1_TILES }, - { "st-11.10a", 0x080000, 0x2d7f21e4, BRF_GRA | CPS1_TILES }, - { "st-5.4a", 0x080000, 0x7705aa46, BRF_GRA | CPS1_TILES }, - { "st-9.6a", 0x080000, 0x5b18b722, BRF_GRA | CPS1_TILES }, - { "st-1.7a", 0x080000, 0x005f000b, BRF_GRA | CPS1_TILES }, - { "st-10.9a", 0x080000, 0xb9441519, BRF_GRA | CPS1_TILES }, - { "st-4.3a", 0x080000, 0xb7d04e8b, BRF_GRA | CPS1_TILES }, - { "st-8.5a", 0x080000, 0x6b4713b4, BRF_GRA | CPS1_TILES }, - - { "09.12b", 0x010000, 0x08d63519, BRF_PRG | CPS1_Z80_PROGRAM }, // different CRC from strider, pcb verified - - { "18.11c", 0x020000, 0x4386bc80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19.12c", 0x020000, 0x444536d7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "st24b2.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs - { "lwio.11e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Striderua) -STD_ROM_FN(Striderua) - -static struct BurnRomInfo StriderucRomDesc[] = { - { "34.8f", 0x080000, 0xe0fb5657, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "33.6f", 0x080000, 0x9b3cfc08, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "6.8a", 0x080000, 0x4eee9aea, BRF_GRA | CPS1_TILES }, - { "8.10a", 0x080000, 0x2d7f21e4, BRF_GRA | CPS1_TILES }, - { "5.7a", 0x080000, 0x7705aa46, BRF_GRA | CPS1_TILES }, - { "7.9a", 0x080000, 0x5b18b722, BRF_GRA | CPS1_TILES }, - { "15.8c", 0x080000, 0x005f000b, BRF_GRA | CPS1_TILES }, - { "17.10c", 0x080000, 0xb9441519, BRF_GRA | CPS1_TILES }, - { "14.7c", 0x080000, 0xb7d04e8b, BRF_GRA | CPS1_TILES }, - { "16.9c", 0x080000, 0x6b4713b4, BRF_GRA | CPS1_TILES }, - - { "9.12a", 0x010000, 0x08d63519, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18.11c", 0x020000, 0x4386bc80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19.12c", 0x020000, 0x444536d7, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Strideruc) -STD_ROM_FN(Strideruc) - -static struct BurnRomInfo StriderjrRomDesc[] = { - { "sthj_23.8f", 0x080000, 0x046e7b12, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sthj_22.7f", 0x080000, 0x9b3cfc08, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "sth_01.3a", 0x080000, 0x4eee9aea, BRF_GRA | CPS1_TILES }, - { "sth_02.4a", 0x080000, 0x2d7f21e4, BRF_GRA | CPS1_TILES }, - { "sth_03.5a", 0x080000, 0x7705aa46, BRF_GRA | CPS1_TILES }, - { "sth_04.6a", 0x080000, 0x5b18b722, BRF_GRA | CPS1_TILES }, - { "sth_05.7a", 0x080000, 0x005f000b, BRF_GRA | CPS1_TILES }, - { "sth_06.8a", 0x080000, 0xb9441519, BRF_GRA | CPS1_TILES }, - { "sth_07.9a", 0x080000, 0xb7d04e8b, BRF_GRA | CPS1_TILES }, - { "sth_08.10a", 0x080000, 0x6b4713b4, BRF_GRA | CPS1_TILES }, - - { "sth_09.12a", 0x010000, 0x08d63519, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sth_18.11c", 0x020000, 0x4386bc80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sth_19.12c", 0x020000, 0x444536d7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "sth63b.1a", 0x000117, 0xc706b773, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Striderjr) -STD_ROM_FN(Striderjr) - -static struct BurnRomInfo StriderjRomDesc[] = { - { "sth_36.12f", 0x020000, 0x53c7b006, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sth_42.12h", 0x020000, 0x4037f65f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sth_37.13f", 0x020000, 0x80e8877d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sth_43.13h", 0x020000, 0x6b3fa466, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sth_34.10f", 0x020000, 0xbea770b5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sth_40.10h", 0x020000, 0x43b922dc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sth_35.11f", 0x020000, 0x5cc429da, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sth_41.11h", 0x020000, 0x50af457f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sth_09.4b", 0x020000, 0x1ef6bfbd, BRF_GRA | CPS1_TILES }, - { "sth_01.4a", 0x020000, 0x1e21b0c1, BRF_GRA | CPS1_TILES }, - { "sth_13.9b", 0x020000, 0x063263ae, BRF_GRA | CPS1_TILES }, - { "sth_05.9a", 0x020000, 0xec9f8714, BRF_GRA | CPS1_TILES }, - { "sth_24.5e", 0x020000, 0x6356f4d2, BRF_GRA | CPS1_TILES }, - { "sth_17.5c", 0x020000, 0xb4f73d86, BRF_GRA | CPS1_TILES }, - { "sth_38.8h", 0x020000, 0xee5abfc2, BRF_GRA | CPS1_TILES }, - { "sth_32.8f", 0x020000, 0x44a206a3, BRF_GRA | CPS1_TILES }, - { "sth_10.5b", 0x020000, 0xdf3dd3bc, BRF_GRA | CPS1_TILES }, - { "sth_02.5a", 0x020000, 0xc75f9ea0, BRF_GRA | CPS1_TILES }, - { "sth_14.10b", 0x020000, 0x6c03e19d, BRF_GRA | CPS1_TILES }, - { "sth_06.10a", 0x020000, 0xd84f5478, BRF_GRA | CPS1_TILES }, - { "sth_25.7e", 0x020000, 0x921e506a, BRF_GRA | CPS1_TILES }, - { "sth_18.7c", 0x020000, 0x5b318956, BRF_GRA | CPS1_TILES }, - { "sth_39.9h", 0x020000, 0x9321d6aa, BRF_GRA | CPS1_TILES }, - { "sth_33.9f", 0x020000, 0xb47ddfc7, BRF_GRA | CPS1_TILES }, - { "sth_11.7b", 0x020000, 0x2484f241, BRF_GRA | CPS1_TILES }, - { "sth_03.7a", 0x020000, 0xaaa07245, BRF_GRA | CPS1_TILES }, - { "sth_15.11b", 0x020000, 0xe415d943, BRF_GRA | CPS1_TILES }, - { "sth_07.11a", 0x020000, 0x97d072d2, BRF_GRA | CPS1_TILES }, - { "sth_26.8e", 0x020000, 0x0ebfcb02, BRF_GRA | CPS1_TILES }, - { "sth_19.8c", 0x020000, 0x257ce683, BRF_GRA | CPS1_TILES }, - { "sth_28.10e", 0x020000, 0x98ac8cd1, BRF_GRA | CPS1_TILES }, - { "sth_21.10c", 0x020000, 0x538d9423, BRF_GRA | CPS1_TILES }, - { "sth_12.8b", 0x020000, 0xf670a477, BRF_GRA | CPS1_TILES }, - { "sth_04.8a", 0x020000, 0x853d3e01, BRF_GRA | CPS1_TILES }, - { "sth_16.12b", 0x020000, 0x4092019f, BRF_GRA | CPS1_TILES }, - { "sth_08.12a", 0x020000, 0x2ce9b4c7, BRF_GRA | CPS1_TILES }, - { "sth_27.9e", 0x020000, 0xf82c88d9, BRF_GRA | CPS1_TILES }, - { "sth_20.9c", 0x020000, 0xeb584dd4, BRF_GRA | CPS1_TILES }, - { "sth_29.11e", 0x020000, 0x34ae2997, BRF_GRA | CPS1_TILES }, - { "sth_22.11c", 0x020000, 0x78dd9c48, BRF_GRA | CPS1_TILES }, - - { "sth_23.13c", 0x010000, 0x2ed403bc, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sth_30.12e", 0x020000, 0x4386bc80, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sth_31.13e", 0x020000, 0x444536d7, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "st22b.1a", 0x000117, 0x68fecc55, BRF_OPT }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Striderj) -STD_ROM_FN(Striderj) - -static struct BurnRomInfo UnsquadRomDesc[] = { - { "aru_30.11f", 0x020000, 0x24d8f88d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "aru_35.11h", 0x020000, 0x8b954b59, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "aru_31.12f", 0x020000, 0x33e9694b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "aru_36.12h", 0x020000, 0x7cc8fb9e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ar-32m.8h", 0x080000, 0xae1d7fb0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ar-5m.7a", 0x080000, 0xbf4575d8, BRF_GRA | CPS1_TILES }, - { "ar-7m.9a", 0x080000, 0xa02945f4, BRF_GRA | CPS1_TILES }, - { "ar-1m.3a", 0x080000, 0x5965ca8d, BRF_GRA | CPS1_TILES }, - { "ar-3m.5a", 0x080000, 0xac6db17d, BRF_GRA | CPS1_TILES }, - - { "ar_09.12b", 0x010000, 0xf3dd1367, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "aru_18.11c", 0x020000, 0x584b43a9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ar24b.1a", 0x000117, 0x09a51271, BRF_OPT }, // b-board PLDs - { "lwio.11e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Unsquad) -STD_ROM_FN(Unsquad) - -static struct BurnRomInfo Area88RomDesc[] = { - { "ar_36.12f", 0x020000, 0x65030392, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ar_42.12h", 0x020000, 0xc48170de, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ar_37.13f", 0x020000, 0x33e9694b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ar_43.13h", 0x020000, 0x7cc8fb9e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ar_34.10f", 0x020000, 0xf6e80386, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ar_40.10h", 0x020000, 0xbe36c145, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ar_35.11f", 0x020000, 0x86d98ff3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "ar_41.11h", 0x020000, 0x758893d3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "ar_09.4b", 0x020000, 0xdb9376f8, BRF_GRA | CPS1_TILES }, - { "ar_01.4a", 0x020000, 0x392151b4, BRF_GRA | CPS1_TILES }, - { "ar_13.9b", 0x020000, 0x81436481, BRF_GRA | CPS1_TILES }, - { "ar_05.9a", 0x020000, 0xe246ed9f, BRF_GRA | CPS1_TILES }, - { "ar_24.5e", 0x020000, 0x9cd6e2a3, BRF_GRA | CPS1_TILES }, - { "ar_17.5c", 0x020000, 0x0b8e0df4, BRF_GRA | CPS1_TILES }, - { "ar_38.8h", 0x020000, 0x8b9e75b9, BRF_GRA | CPS1_TILES }, - { "ar_32.8f", 0x020000, 0xdb6acdcf, BRF_GRA | CPS1_TILES }, - { "ar_10.5b", 0x020000, 0x4219b622, BRF_GRA | CPS1_TILES }, - { "ar_02.5a", 0x020000, 0xbac5dec5, BRF_GRA | CPS1_TILES }, - { "ar_14.10b", 0x020000, 0xe6bae179, BRF_GRA | CPS1_TILES }, - { "ar_06.10a", 0x020000, 0xc8f04223, BRF_GRA | CPS1_TILES }, - { "ar_25.7e", 0x020000, 0x15ccf981, BRF_GRA | CPS1_TILES }, - { "ar_18.7c", 0x020000, 0x9336db6a, BRF_GRA | CPS1_TILES }, - { "ar_39.9h", 0x020000, 0x9b8e1363, BRF_GRA | CPS1_TILES }, - { "ar_33.9f", 0x020000, 0x3968f4b5, BRF_GRA | CPS1_TILES }, - - { "ar_23.13c", 0x010000, 0xf3dd1367, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ar_30.12e", 0x020000, 0x584b43a9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ar22b.1a", 0x000117, 0xf1db9030, BRF_OPT }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Area88) -STD_ROM_FN(Area88) - -static struct BurnRomInfo Area88rRomDesc[] = { - { "araj_23.8f", 0x080000, 0x7045d6cb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "araj_22.7f", 0x080000, 0x9913002e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "ara_01.3a", 0x080000, 0xbf4575d8, BRF_GRA | CPS1_TILES }, - { "ara_02.4a", 0x080000, 0xa02945f4, BRF_GRA | CPS1_TILES }, - { "ara_03.5a", 0x080000, 0x5965ca8d, BRF_GRA | CPS1_TILES }, - { "ara_04.6a", 0x080000, 0xac6db17d, BRF_GRA | CPS1_TILES }, - - { "ara_09.12a", 0x020000, 0xaf88359c, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "ara_18.11c", 0x020000, 0x584b43a9, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "ara63b.1a", 0x000117, 0xf5569c93, BRF_OPT },// b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, -}; - -STD_ROM_PICK(Area88r) -STD_ROM_FN(Area88r) - -static struct BurnRomInfo VarthRomDesc[] = { - { "vae_30b.11f", 0x020000, 0xadb8d391, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_35b.11h", 0x020000, 0x44e5548f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_31b.12f", 0x020000, 0x1749a71c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_36b.12h", 0x020000, 0x5f2e2450, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_28b.9f", 0x020000, 0xe524ca50, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_33b.9h", 0x020000, 0xc0bbf8c9, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_29b.10f", 0x020000, 0x6640996a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_34b.10h", 0x020000, 0xfa59be8a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "va-5m.7a", 0x080000, 0xb1fb726e, BRF_GRA | CPS1_TILES }, - { "va-7m.9a", 0x080000, 0x4c6588cd, BRF_GRA | CPS1_TILES }, - { "va-1m.3a", 0x080000, 0x0b1ace37, BRF_GRA | CPS1_TILES }, - { "va-3m.5a", 0x080000, 0x44dfe706, BRF_GRA | CPS1_TILES }, - - { "va_09.12b", 0x010000, 0x7a99446e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "va_18.11c", 0x020000, 0xde30510e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "va_19.12c", 0x020000, 0x0610a4ac, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "va24b.1a", 0x000117, 0xcc476650, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Varth) -STD_ROM_FN(Varth) - -static struct BurnRomInfo Varthr1RomDesc[] = { - { "vae_30a.11f", 0x020000, 0x7fcd0091, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_35a.11h", 0x020000, 0x35cf9509, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_31a.12f", 0x020000, 0x15e5ee81, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_36a.12h", 0x020000, 0x153a201e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_28a.9f", 0x020000, 0x7a0e0d25, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_33a.9h", 0x020000, 0xf2365922, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_29a.10f", 0x020000, 0x5e2cd2c3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vae_34a.10h", 0x020000, 0x3d9bdf83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "va-5m.7a", 0x080000, 0xb1fb726e, BRF_GRA | CPS1_TILES }, - { "va-7m.9a", 0x080000, 0x4c6588cd, BRF_GRA | CPS1_TILES }, - { "va-1m.3a", 0x080000, 0x0b1ace37, BRF_GRA | CPS1_TILES }, - { "va-3m.5a", 0x080000, 0x44dfe706, BRF_GRA | CPS1_TILES }, - - { "va_09.12b", 0x010000, 0x7a99446e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "va_18.11c", 0x020000, 0xde30510e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "va_19.12c", 0x020000, 0x0610a4ac, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "va24b.1a", 0x000117, 0xcc476650, BRF_OPT }, // b-board PLDs - { "iob1.11e", 0x000117, 0x3abc0700, BRF_OPT }, -}; - -STD_ROM_PICK(Varthr1) -STD_ROM_FN(Varthr1) - -static struct BurnRomInfo VarthjRomDesc[] = { - { "vaj_36b.12f", 0x020000, 0x1d798d6a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vaj_42b.12h", 0x020000, 0x0f720233, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vaj_37b.13f", 0x020000, 0x24414b17, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vaj_43b.13h", 0x020000, 0x34b4b06c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vaj_34b.10f", 0x020000, 0x87c79aed, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vaj_40b.10h", 0x020000, 0x210b4bd0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vaj_35b.11f", 0x020000, 0x6b0da69f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "vaj_41b.11h", 0x020000, 0x6542c8a4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "va_09.4b", 0x020000, 0x183dfaa8, BRF_GRA | CPS1_TILES }, - { "va_01.4a", 0x020000, 0xc41312b5, BRF_GRA | CPS1_TILES }, - { "va_13.9b", 0x020000, 0x45537e69, BRF_GRA | CPS1_TILES }, - { "va_05.9a", 0x020000, 0x7065d4e9, BRF_GRA | CPS1_TILES }, - { "va_24.5e", 0x020000, 0x57191ccf, BRF_GRA | CPS1_TILES }, - { "va_17.5c", 0x020000, 0x054f5a5b, BRF_GRA | CPS1_TILES }, - { "va_38.8h", 0x020000, 0xe117a17e, BRF_GRA | CPS1_TILES }, - { "va_32.8f", 0x020000, 0x3b4f40b2, BRF_GRA | CPS1_TILES }, - { "va_10.5b", 0x020000, 0xd62750cd, BRF_GRA | CPS1_TILES }, - { "va_02.5a", 0x020000, 0x11590325, BRF_GRA | CPS1_TILES }, - { "va_14.10b", 0x020000, 0xdc2f4783, BRF_GRA | CPS1_TILES }, - { "va_06.10a", 0x020000, 0x06e833ac, BRF_GRA | CPS1_TILES }, - { "va_25.7e", 0x020000, 0x51d90690, BRF_GRA | CPS1_TILES }, - { "va_18.7c", 0x020000, 0xa17817c0, BRF_GRA | CPS1_TILES }, - { "va_39.9h", 0x020000, 0xb0b12f51, BRF_GRA | CPS1_TILES }, - { "va_33.9f", 0x020000, 0x4b003af7, BRF_GRA | CPS1_TILES }, - - { "va_23.13c", 0x010000, 0x7a99446e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "va_30.12e", 0x020000, 0xde30510e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "va_31.13e", 0x020000, 0x0610a4ac, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "va22b.1a", 0x000117, 0xbd7cd574, BRF_OPT }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Varthj) -STD_ROM_FN(Varthj) - -static struct BurnRomInfo VarthjrRomDesc[] = { - { "vaj_23b.8f", 0x080000, 0xad3d3522, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "vaj_22b.7f", 0x080000, 0x034e3e55, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "va_01.3a", 0x080000, 0xb1fb726e, BRF_GRA | CPS1_TILES }, // == va-5m.7a - { "va_02.4a", 0x080000, 0x4c6588cd, BRF_GRA | CPS1_TILES }, // == va-7m.9a - { "va_03.5a", 0x080000, 0x0b1ace37, BRF_GRA | CPS1_TILES }, // == va-1m.3a - { "va_04.6a", 0x080000, 0x44dfe706, BRF_GRA | CPS1_TILES }, // == va-3m.5a - - { "va_09.12a", 0x010000, 0x7a99446e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "va_18.11c", 0x020000, 0xde30510e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "va_19.12c", 0x020000, 0x0610a4ac, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "va63b.1a", 0x000117, 0x132ab7c5, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs -}; - -STD_ROM_PICK(Varthjr) -STD_ROM_FN(Varthjr) - -static struct BurnRomInfo VarthuRomDesc[] = { - { "vau_23a.8f", 0x080000, 0xfbe68726, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "vau_22a.7f", 0x080000, 0x0ed71bbd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "va-5m.3a", 0x080000, 0xb1fb726e, BRF_GRA | CPS1_TILES }, - { "va-7m.5a", 0x080000, 0x4c6588cd, BRF_GRA | CPS1_TILES }, - { "va-1m.4a", 0x080000, 0x0b1ace37, BRF_GRA | CPS1_TILES }, - { "va-3m.6a", 0x080000, 0x44dfe706, BRF_GRA | CPS1_TILES }, - - { "va_09.11a", 0x010000, 0x7a99446e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "va_18.11c", 0x020000, 0xde30510e, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "va_19.12c", 0x020000, 0x0610a4ac, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "va63b.1a", 0x000117, 0x132ab7c5, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, -}; - -STD_ROM_PICK(Varthu) -STD_ROM_FN(Varthu) - -static struct BurnRomInfo VarthbRomDesc[] = { - { "2", 0x080000, 0x2f010023, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "1", 0x080000, 0x0861dff3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4", 0x010000, 0xaa51e43b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "3", 0x010000, 0xf7e4f2f0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "14", 0x040000, 0x7ca73780, BRF_GRA | CPS1_TILES }, - { "13", 0x040000, 0x9fb11869, BRF_GRA | CPS1_TILES }, - { "12", 0x040000, 0xafeba416, BRF_GRA | CPS1_TILES }, - { "11", 0x040000, 0x9eef3507, BRF_GRA | CPS1_TILES }, - { "10", 0x040000, 0xeeec6183, BRF_GRA | CPS1_TILES }, - { "9", 0x040000, 0x0e94f718, BRF_GRA | CPS1_TILES }, - { "8", 0x040000, 0xc4ddc5b4, BRF_GRA | CPS1_TILES }, - { "7", 0x040000, 0x8941ca12, BRF_GRA | CPS1_TILES }, - - { "6", 0x010000, 0x7a99446e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "5", 0x040000, 0x1547e595, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - { "varth1.bin", 0x000157, 0x4c6a0d99, BRF_OPT }, // unknown - { "varth2.bin", 0x000157, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "varth3.bin", 0x000157, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "varth4.bin", 0x000117, 0x53317bf6, BRF_OPT }, // unknown - { "varth5.bin", 0x000157, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "varth6.bin", 0x000157, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(Varthb) -STD_ROM_FN(Varthb) - -static struct BurnRomInfo WillowRomDesc[] = { - // No "Warning" (c) Capcom U.S.A., genuine export ROM labels - { "wle_30.11f", 0x020000, 0x15372aa2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wle_35.11h", 0x020000, 0x2e64623b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlu_31.12f", 0x020000, 0x0eb48a83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlu_36.12h", 0x020000, 0x36100209, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlm-32.8h", 0x080000, 0xdfd9f643, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "wlm-7.7a", 0x080000, 0xafa74b73, BRF_GRA | CPS1_TILES }, - { "wlm-5.9a", 0x080000, 0x12a0dc0b, BRF_GRA | CPS1_TILES }, - { "wlm-3.3a", 0x080000, 0xc6f2abce, BRF_GRA | CPS1_TILES }, - { "wlm-1.5a", 0x080000, 0x4aa4c6d3, BRF_GRA | CPS1_TILES }, - { "wl_24.7d", 0x020000, 0x6f0adee5, BRF_GRA | CPS1_TILES }, - { "wl_14.7c", 0x020000, 0x9cf3027d, BRF_GRA | CPS1_TILES }, - { "wl_26.9d", 0x020000, 0xf09c8ecf, BRF_GRA | CPS1_TILES }, - { "wl_16.9c", 0x020000, 0xe35407aa, BRF_GRA | CPS1_TILES }, - { "wl_20.3d", 0x020000, 0x84992350, BRF_GRA | CPS1_TILES }, - { "wl_10.3c", 0x020000, 0xb87b5a36, BRF_GRA | CPS1_TILES }, - { "wl_22.5d", 0x020000, 0xfd3f89f0, BRF_GRA | CPS1_TILES }, - { "wl_12.5c", 0x020000, 0x7da49d69, BRF_GRA | CPS1_TILES }, - - { "wl_09.12b", 0x010000, 0xf6b3d060, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "wl_18.11c", 0x020000, 0xbde23d4d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "wl_19.12c", 0x020000, 0x683898f5, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "wl24b.1a", 0x000117, 0x7101cdf1, BRF_OPT }, // b-board PLDs - { "lwio.11e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Willow) -STD_ROM_FN(Willow) - -static struct BurnRomInfo WillowuRomDesc[] = { - { "wlu_30.11f", 0x020000, 0xd604dbb1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "35.11h", 0x020000, 0x7a791e77, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlu_31.12f", 0x020000, 0x0eb48a83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlu_36.12h", 0x020000, 0x36100209, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlm-32.8h", 0x080000, 0xdfd9f643, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "wlm-7.7a", 0x080000, 0xafa74b73, BRF_GRA | CPS1_TILES }, - { "wlm-5.9a", 0x080000, 0x12a0dc0b, BRF_GRA | CPS1_TILES }, - { "wlm-3.3a", 0x080000, 0xc6f2abce, BRF_GRA | CPS1_TILES }, - { "wlm-1.5a", 0x080000, 0x4aa4c6d3, BRF_GRA | CPS1_TILES }, - { "wl_24.7d", 0x020000, 0x6f0adee5, BRF_GRA | CPS1_TILES }, - { "wl_14.7c", 0x020000, 0x9cf3027d, BRF_GRA | CPS1_TILES }, - { "wl_26.9d", 0x020000, 0xf09c8ecf, BRF_GRA | CPS1_TILES }, - { "wl_16.9c", 0x020000, 0xe35407aa, BRF_GRA | CPS1_TILES }, - { "wl_20.3d", 0x020000, 0x84992350, BRF_GRA | CPS1_TILES }, - { "wl_10.3c", 0x020000, 0xb87b5a36, BRF_GRA | CPS1_TILES }, - { "wl_22.5d", 0x020000, 0xfd3f89f0, BRF_GRA | CPS1_TILES }, - { "wl_12.5c", 0x020000, 0x7da49d69, BRF_GRA | CPS1_TILES }, - - { "wl_09.12b", 0x010000, 0xf6b3d060, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "wl_18.11c", 0x020000, 0xbde23d4d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "wl_19.12c", 0x020000, 0x683898f5, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "wl24b.1a", 0x000117, 0x7101cdf1, BRF_OPT }, // b-board PLDs - { "lwio.11e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Willowu) -STD_ROM_FN(Willowu) - -static struct BurnRomInfo WillowuoRomDesc[] = { - { "wlu_30.11f", 0x020000, 0xd604dbb1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlu_35.11h", 0x020000, 0xdaee72fe, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlu_31.12f", 0x020000, 0x0eb48a83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlu_36.12h", 0x020000, 0x36100209, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wlm-32.8h", 0x080000, 0xdfd9f643, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "wlm-7.7a", 0x080000, 0xafa74b73, BRF_GRA | CPS1_TILES }, - { "wlm-5.9a", 0x080000, 0x12a0dc0b, BRF_GRA | CPS1_TILES }, - { "wlm-3.3a", 0x080000, 0xc6f2abce, BRF_GRA | CPS1_TILES }, - { "wlm-1.5a", 0x080000, 0x4aa4c6d3, BRF_GRA | CPS1_TILES }, - { "wl_24.7d", 0x020000, 0x6f0adee5, BRF_GRA | CPS1_TILES }, - { "wl_14.7c", 0x020000, 0x9cf3027d, BRF_GRA | CPS1_TILES }, - { "wl_26.9d", 0x020000, 0xf09c8ecf, BRF_GRA | CPS1_TILES }, - { "wl_16.9c", 0x020000, 0xe35407aa, BRF_GRA | CPS1_TILES }, - { "wl_20.3d", 0x020000, 0x84992350, BRF_GRA | CPS1_TILES }, - { "wl_10.3c", 0x020000, 0xb87b5a36, BRF_GRA | CPS1_TILES }, - { "wl_22.5d", 0x020000, 0xfd3f89f0, BRF_GRA | CPS1_TILES }, - { "wl_12.5c", 0x020000, 0x7da49d69, BRF_GRA | CPS1_TILES }, - - { "wl_09.12b", 0x010000, 0xf6b3d060, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "wl_18.11c", 0x020000, 0xbde23d4d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "wl_19.12c", 0x020000, 0x683898f5, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "wl24b.1a", 0x000117, 0x7101cdf1, BRF_OPT }, // b-board PLDs - { "lwio.11e", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Willowuo) -STD_ROM_FN(Willowuo) - -static struct BurnRomInfo WillowjRomDesc[] = { - // Japan "warning" but (c) Capcom U.S.A. - { "wl_36.12f", 0x020000, 0x2b0d7cbc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wl_42.12h", 0x020000, 0x1ac39615, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wl_37.13f", 0x020000, 0x30a717fa, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wl_43.13h", 0x020000, 0xd0dddc9e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wl_34.10f", 0x020000, 0x23a84f7a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wl_40.10h", 0x020000, 0xc7a0ed21, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wl_35.11f", 0x020000, 0x5eff7951, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "wl_41.11h", 0x020000, 0x8d6477a3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "wl_09.4b", 0x020000, 0x05aa71b4, BRF_GRA | CPS1_TILES }, - { "wl_01.4a", 0x020000, 0x08c2df12, BRF_GRA | CPS1_TILES }, - { "wl_13.9b", 0x020000, 0x1f7c87cd, BRF_GRA | CPS1_TILES }, - { "wl_05.9a", 0x020000, 0xf5254bf2, BRF_GRA | CPS1_TILES }, - { "wl_24.5e", 0x020000, 0xd9d73ba1, BRF_GRA | CPS1_TILES }, - { "wl_17.5c", 0x020000, 0xa652f30c, BRF_GRA | CPS1_TILES }, - { "wl_38.8h", 0x020000, 0xf6f9111b, BRF_GRA | CPS1_TILES }, - { "wl_32.8f", 0x020000, 0x10f64027, BRF_GRA | CPS1_TILES }, - { "wl_10.5b", 0x020000, 0xdbba0a3f, BRF_GRA | CPS1_TILES }, - { "wl_02.5a", 0x020000, 0x86fba7a5, BRF_GRA | CPS1_TILES }, - { "wl_14.10b", 0x020000, 0x7d5798b2, BRF_GRA | CPS1_TILES }, - { "wl_06.10a", 0x020000, 0x1f052948, BRF_GRA | CPS1_TILES }, - { "wl_25.7e", 0x020000, 0x857d17d2, BRF_GRA | CPS1_TILES }, - { "wl_18.7c", 0x020000, 0x316c7fbc, BRF_GRA | CPS1_TILES }, - { "wl_39.9h", 0x020000, 0xe6fce9b0, BRF_GRA | CPS1_TILES }, - { "wl_33.9f", 0x020000, 0xa15d5517, BRF_GRA | CPS1_TILES }, - - { "wl_11.7b", 0x020000, 0x6f0adee5, BRF_GRA | CPS1_TILES }, - { "wl_03.7a", 0x020000, 0x9cf3027d, BRF_GRA | CPS1_TILES }, - { "wl_15.11b", 0x020000, 0xf09c8ecf, BRF_GRA | CPS1_TILES }, - { "wl_07.11a", 0x020000, 0xe35407aa, BRF_GRA | CPS1_TILES }, - { "wl_26.8e", 0x020000, 0x84992350, BRF_GRA | CPS1_TILES }, - { "wl_19.8c", 0x020000, 0xb87b5a36, BRF_GRA | CPS1_TILES }, - { "wl_28.10e", 0x020000, 0xfd3f89f0, BRF_GRA | CPS1_TILES }, - { "wl_21.10c", 0x020000, 0x7da49d69, BRF_GRA | CPS1_TILES }, - - { "wl_23.13c", 0x010000, 0xf6b3d060, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "wl_30.12e", 0x020000, 0xbde23d4d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "wl_31.13e", 0x020000, 0x683898f5, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "wl22b.1a", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, // b-board PLDs - { "lwio.12c", 0x000117, 0xad52b90c, BRF_OPT }, -}; - -STD_ROM_PICK(Willowj) -STD_ROM_FN(Willowj) - -static struct BurnRomInfo WofRomDesc[] = { - { "tk2e_23c.8f", 0x080000, 0x0d708505, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2e_22c.7f", 0x080000, 0x608c17e3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2-1m.3a", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2-3m.5a", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2-2m.4a", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2-4m.6a", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2-5m.7a", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2-7m.9a", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2-6m.8a", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2-8m.10a", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.5k", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2-q1.1k", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q2.2k", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q3.3k", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q4.4k", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "tk263b.1a", 0x000117, 0xc4b0349b, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k1.9k", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Wof) -STD_ROM_FN(Wof) - -static struct BurnRomInfo Wofr1RomDesc[] = { - { "tk2e_23b.8f", 0x080000, 0x11fb2ed1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2e_22b.7f", 0x080000, 0x479b3f24, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2-1m.3a", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2-3m.5a", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2-2m.4a", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2-4m.6a", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2-5m.7a", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2-7m.9a", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2-6m.8a", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2-8m.10a", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.5k", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2-q1.1k", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q2.2k", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q3.3k", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q4.4k", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "tk263b.1a", 0x000117, 0xc4b0349b, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k1.9k", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Wofr1) -STD_ROM_FN(Wofr1) - -static struct BurnRomInfo WofuRomDesc[] = { - { "tk2u_23c.8f", 0x080000, 0x29b89c12, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2u_22c.7f", 0x080000, 0xf5af4774, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2-1m.3a", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2-3m.5a", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2-2m.4a", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2-4m.6a", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2-5m.7a", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2-7m.9a", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2-6m.8a", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2-8m.10a", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.5k", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2-q1.1k", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q2.2k", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q3.3k", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q4.4k", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "tk263b.1a", 0x000117, 0xc4b0349b, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k1.9k", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP}, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Wofu) -STD_ROM_FN(Wofu) - -static struct BurnRomInfo WofjRomDesc[] = { - { "tk2j_23c.8f", 0x080000, 0x9b215a68, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2j_22c.7f", 0x080000, 0xb74b09ac, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2_01.3a", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_02.4a", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_03.5a", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_04.6a", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2_05.7a", 0x080000, 0xe4a44d53, BRF_GRA | CPS1_TILES }, - { "tk2_06.8a", 0x080000, 0x58066ba8, BRF_GRA | CPS1_TILES }, - { "tk2_07.9a", 0x080000, 0xd706568e, BRF_GRA | CPS1_TILES }, - { "tk2_08.10a", 0x080000, 0xd4a19a02, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.5k", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2-q1.1k", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q2.2k", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q3.3k", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q4.4k", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "tk263b.1a", 0x000117, 0xc4b0349b, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k1.9k", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Wofj) -STD_ROM_FN(Wofj) - -static struct BurnRomInfo WofaRomDesc[] = { - { "tk2a_23c.8f", 0x080000, 0x2e024628, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2a_22c.7f", 0x080000, 0x900ad4cd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2-1m.3a", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2-3m.5a", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2-2m.4a", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2-4m.6a", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2-5m.7a", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2-7m.9a", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2-6m.8a", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2-8m.10a", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.5k", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2-q1.1k", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q2.2k", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q3.3k", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q4.4k", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, - - A_BOARD_QSOUND_PLDS - - { "tk263b.1a", 0x000117, 0xc4b0349b, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic1", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k1.9k", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Wofa) -STD_ROM_FN(Wofa) - -static struct BurnRomInfo WofchRomDesc[] = { - { "tk2(ch)_23.8f", 0x080000, 0x4e0b8dee, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2(ch)_22.7f", 0x080000, 0xd0937a8d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2-1m.3a", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2-3m.5a", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2-2m.4a", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2-4m.6a", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2(ch)_05.7a", 0x080000, 0xe4a44d53, BRF_GRA | CPS1_TILES }, - { "tk2(ch)_06.8a", 0x080000, 0x58066ba8, BRF_GRA | CPS1_TILES }, - { "tk2(ch)_07.9a", 0x080000, 0xcc9006c9, BRF_GRA | CPS1_TILES }, // 1 byte different from wofj, pcb verified - { "tk2(ch)_08.10a",0x080000, 0xd4a19a02, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.5k", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2-q1.1k", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q2.2k", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q3.3k", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q4.4k", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, - - { "buf1", 0x000117, 0xeb122de7, BRF_OPT }, // a-board PLDs - { "ioa1", 0x000117, 0x59c7ee3b, BRF_OPT }, - { "prg2", 0x000117, 0x4386879a, BRF_OPT }, - { "rom1", 0x000117, 0x41dc73b9, BRF_OPT }, - { "sou1", 0x000117, 0x84f4b2fe, BRF_OPT }, - - { "tk263b.1a", 0x000117, 0xc4b0349b, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k1.9k", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Wofch) -STD_ROM_FN(Wofch) - -static struct BurnRomInfo WofchdxRomDesc[] = { - { "tk2(ch)dx_23.8f", 0x080000, 0x29389b7d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2(ch)dx_22.7f", 0x080000, 0xa959df0c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2-1m.3a", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2-3m.5a", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2-2m.4a", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2-4m.6a", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2(ch)_05.7a", 0x080000, 0xe4a44d53, BRF_GRA | CPS1_TILES }, - { "tk2(ch)_06.8a", 0x080000, 0x58066ba8, BRF_GRA | CPS1_TILES }, - { "tk2(ch)_07.9a", 0x080000, 0xcc9006c9, BRF_GRA | CPS1_TILES }, // 1 byte different from wofj, pcb verified - { "tk2(ch)_08.10a",0x080000, 0xd4a19a02, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.5k", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2-q1.1k", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q2.2k", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q3.3k", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2-q4.4k", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, - - { "buf1", 0x000117, 0xeb122de7, BRF_OPT }, // a-board PLDs - { "ioa1", 0x000117, 0x59c7ee3b, BRF_OPT }, - { "prg2", 0x000117, 0x4386879a, BRF_OPT }, - { "rom1", 0x000117, 0x41dc73b9, BRF_OPT }, - { "sou1", 0x000117, 0x84f4b2fe, BRF_OPT }, - - { "tk263b.1a", 0x000117, 0xc4b0349b, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, - - { "d7l1.7l", 0x000117, 0x27b7410d, BRF_OPT }, // d-board PLDs - { "d8l1.8l", 0x000117, 0x539fc7da, BRF_OPT }, - { "d9k1.9k", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "d10f1.10f", 0x000117, 0x6619c494, BRF_OPT }, -}; - -STD_ROM_PICK(Wofchdx) -STD_ROM_FN(Wofchdx) - -static struct BurnRomInfo WofhfhRomDesc[] = { - { "23", 0x080000, 0x6ae4b312, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "22", 0x080000, 0x94e8d01a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "1", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "2", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "3", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "4", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "5", 0x080000, 0x34949d7b, BRF_GRA | CPS1_TILES }, - { "6", 0x080000, 0xdfa70971, BRF_GRA | CPS1_TILES }, - { "7", 0x080000, 0x073686a6, BRF_GRA | CPS1_TILES }, - { "8", 0x080000, 0x5300f8db, BRF_GRA | CPS1_TILES }, - - { "9", 0x020000, 0x86fe8a97, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18", 0x020000, 0xc04be720, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19", 0x020000, 0xfbb8d8c1, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wofhfh) -STD_ROM_FN(Wofhfh) - -static struct BurnRomInfo WofhRomDesc[] = { - { "sgyx.800", 0x100000, 0x3703a650, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "sgyx-1.160", 0x200000, 0xa60be9f6, BRF_GRA | CPS1_TILES }, - { "sgyx-2.160", 0x200000, 0x6ad9d048, BRF_GRA | CPS1_TILES }, - - // These sound roms are taken from sgyxz - { "sgyxz_snd2.bin", 0x010000, 0x210c376f, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sgyxz_snd1.bin", 0x040000, 0xc15ac0f2, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wofh) -STD_ROM_FN(Wofh) - -static struct BurnRomInfo WofhaRomDesc[] = { - { "fg-c.040", 0x080000, 0xd046fc86, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "fg-a.040", 0x080000, 0xf176ee8f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sgyx-1.160", 0x200000, 0xa60be9f6, BRF_GRA | CPS1_TILES }, - { "sgyx-2.160", 0x200000, 0x6ad9d048, BRF_GRA | CPS1_TILES }, - - // These sound roms are taken from sgyxz - { "sgyxz_snd2.bin", 0x010000, 0x210c376f, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sgyxz_snd1.bin", 0x040000, 0xc15ac0f2, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wofha) -STD_ROM_FN(Wofha) - -static struct BurnRomInfo SgyxzRomDesc[] = { - { "sgyxz_prg2.bin", 0x080000, 0x95429c83, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "sgyxz_prg1.bin", 0x080000, 0xd8511929, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "sgyxz_gfx1.bin", 0x200000, 0xa60be9f6, BRF_GRA | CPS1_TILES }, - { "sgyxz_gfx2.bin", 0x200000, 0x6ad9d048, BRF_GRA | CPS1_TILES }, - - { "sgyxz_snd2.bin", 0x010000, 0x210c376f, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sgyxz_snd1.bin", 0x040000, 0xc15ac0f2, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sgyxz) -STD_ROM_FN(Sgyxz) - -static struct BurnRomInfo Wof3jsRomDesc[] = { - { "3js_23.rom", 0x080000, 0x1ebb76da, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "3js_22.rom", 0x080000, 0xf41d6153, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, // First and second halves identical - { "3js_24.rom", 0x020000, 0x06ead409, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "3js_28.rom", 0x020000, 0x8ba934e6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "tk2_gfx1.rom", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_gfx3.rom", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_gfx2.rom", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_gfx4.rom", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "3js_gfx5.rom", 0x080000, 0x94b58f82, BRF_GRA | CPS1_TILES }, - { "3js_gfx7.rom", 0x080000, 0xdf4fb386, BRF_GRA | CPS1_TILES }, - { "3js_gfx6.rom", 0x080000, 0xc22c5bd8, BRF_GRA | CPS1_TILES }, - { "3js_gfx8.rom", 0x080000, 0xf9cfd08b, BRF_GRA | CPS1_TILES }, - - { "3js_09.rom", 0x010000, 0x21ce044c, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "3js_18.rom", 0x020000, 0xac6e307d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "3js_19.rom", 0x020000, 0x068741db, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wof3js) -STD_ROM_FN(Wof3js) - -static struct BurnRomInfo Wof3jsaRomDesc[] = { - { "cx2.040", 0x080000, 0xc01a6d2f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "cx1.040", 0x080000, 0xfd95e677, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "tx-a.160", 0x200000, 0xae348da2, BRF_GRA | CPS1_TILES }, - { "tx-b.160", 0x200000, 0x384a6db0, BRF_GRA | CPS1_TILES }, - - // These sound roms are taken from wofhfh, this set looks it uses psound - { "9", 0x020000, 0x86fe8a97, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18", 0x020000, 0xc04be720, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19", 0x020000, 0xfbb8d8c1, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wof3jsa) -STD_ROM_FN(Wof3jsa) - -static struct BurnRomInfo Wof3sjRomDesc[] = { - { "k6b.040", 0x080000, 0x7b365108, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "k6a.040", 0x080000, 0x10488a51, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "k6a.160", 0x200000, 0xa121180d, BRF_GRA | CPS1_TILES }, - { "k6b.160", 0x200000, 0xa4db96c4, BRF_GRA | CPS1_TILES }, - - // These sound roms are taken from wofhfh, this set looks it uses psound - { "9", 0x020000, 0x86fe8a97, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18", 0x020000, 0xc04be720, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19", 0x020000, 0xfbb8d8c1, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wof3sj) -STD_ROM_FN(Wof3sj) - -static struct BurnRomInfo Wof3sjaRomDesc[] = { - { "3js.800", 0x100000, 0x812f9200, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "k6a.160", 0x200000, 0xa121180d, BRF_GRA | CPS1_TILES }, - { "k6b.160", 0x200000, 0xa4db96c4, BRF_GRA | CPS1_TILES }, - - // These sound roms are taken from wofhfh, this set looks it uses psound - { "9", 0x020000, 0x86fe8a97, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18", 0x020000, 0xc04be720, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19", 0x020000, 0xfbb8d8c1, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wof3sja) -STD_ROM_FN(Wof3sja) - -static struct BurnRomInfo WofsjRomDesc[] = { - { "c-c47b.040", 0x080000, 0xb1809761, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "a-2402.040", 0x080000, 0x4fab4232, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "tk2_gfx1.rom", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_gfx3.rom", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_gfx2.rom", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_gfx4.rom", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2_gfx5.rom", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2_gfx7.rom", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2_gfx6.rom", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2_gfx8.rom", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - // These sound roms are taken from wofhfh, this set looks it uses psound - { "9", 0x020000, 0x86fe8a97, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18", 0x020000, 0xc04be720, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19", 0x020000, 0xfbb8d8c1, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wofsj) -STD_ROM_FN(Wofsj) - -static struct BurnRomInfo WofsjaRomDesc[] = { - { "one.800", 0x100000, 0x0507584d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2_gfx1.rom", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_gfx3.rom", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_gfx2.rom", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_gfx4.rom", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2_gfx5.rom", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2_gfx7.rom", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2_gfx6.rom", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2_gfx8.rom", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - // These sound roms are taken from wofhfh, this set looks it uses psound - { "9", 0x020000, 0x86fe8a97, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18", 0x020000, 0xc04be720, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19", 0x020000, 0xfbb8d8c1, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wofsja) -STD_ROM_FN(Wofsja) - -static struct BurnRomInfo WofsjbRomDesc[] = { - { "c-d140.040", 0x080000, 0xe6d933a6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "a-0050.040", 0x080000, 0x403eaead, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "tk2_gfx1.rom", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_gfx3.rom", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_gfx2.rom", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_gfx4.rom", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2_gfx5.rom", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2_gfx7.rom", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2_gfx6.rom", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2_gfx8.rom", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - // using the sound roms from wofhfh or wof3js doesn't give the right result - // it doesn't use Q-Sound either -}; - -STD_ROM_PICK(Wofsjb) -STD_ROM_FN(Wofsjb) - -static struct BurnRomInfo WofsjcRomDesc[] = { - { "2223.bin", 0x100000, 0xcb28807e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "1.bin", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "2.bin", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "3.bin", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "4.bin", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "5.bin", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "6.bin", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "7.bin", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "8.bin", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - { "9.bin", 0x010000, 0x210c376f, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "18.bin", 0x020000, 0xc04be720, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "19.bin", 0x020000, 0xfbb8d8c1, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wofsjc) -STD_ROM_FN(Wofsjc) - -static struct BurnRomInfo WofbRomDesc[] = { - { "3-f2ab.040", 0x080000, 0x61fd0a01, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "1-9207.040", 0x080000, 0x7f59e24c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "4-d4d2.010", 0x020000, 0xfe5eee87, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "2-6c41.010", 0x020000, 0x739379be, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "5-caf3.040", 0x080000, 0xc8dcaa95, BRF_GRA | CPS1_TILES }, - { "6-034f.040", 0x080000, 0x1ab0000c, BRF_GRA | CPS1_TILES }, - { "7-b0fa.040", 0x080000, 0x8425ff6b, BRF_GRA | CPS1_TILES }, - { "8-a6b7.040", 0x080000, 0x24ce197b, BRF_GRA | CPS1_TILES }, - { "9-8a2c.040", 0x080000, 0x9d20ef9b, BRF_GRA | CPS1_TILES }, - { "10-7d24.040", 0x080000, 0x90c93dd2, BRF_GRA | CPS1_TILES }, - { "11-4171.040", 0x080000, 0x219fd7e2, BRF_GRA | CPS1_TILES }, - { "12-f56b.040", 0x080000, 0xefc17c9a, BRF_GRA | CPS1_TILES }, - - // These sound roms are taken from wof3js, this set looks it uses psound - { "3js_09.rom", 0x010000, 0x21ce044c, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "3js_18.rom", 0x020000, 0xac6e307d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "3js_19.rom", 0x020000, 0x068741db, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Wofb) -STD_ROM_FN(Wofb) - -static struct BurnRomInfo WofjhRomDesc[] = { - { "tk2j23h.bin", 0x080000, 0x84d38575, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2j22c.bin", 0x080000, 0xb74b09ac, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2_gfx1.rom", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_gfx3.rom", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_gfx2.rom", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_gfx4.rom", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk205.bin", 0x080000, 0xe4a44d53, BRF_GRA | CPS1_TILES }, - { "tk206.bin", 0x080000, 0x58066ba8, BRF_GRA | CPS1_TILES }, - { "tk207.bin", 0x080000, 0xd706568e, BRF_GRA | CPS1_TILES }, - { "tk208.bin", 0x080000, 0xd4a19a02, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.rom", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2_q1.rom", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q2.rom", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q3.rom", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q4.rom", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Wofjh) -STD_ROM_FN(Wofjh) - -static struct BurnRomInfo WofahRomDesc[] = { - { "htk2a_23b.rom", 0x080000, 0x1b17fc85, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2a_22b.rom", 0x080000, 0x900ad4cd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2_gfx1.rom", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_gfx3.rom", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_gfx2.rom", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_gfx4.rom", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2_gfx5.rom", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2_gfx7.rom", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2_gfx6.rom", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2_gfx8.rom", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.rom", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2_q1.rom", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q2.rom", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q3.rom", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q4.rom", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Wofah) -STD_ROM_FN(Wofah) - -static struct BurnRomInfo WofahaRomDesc[] = { - { "htk2ah_23b.rom",0x080000, 0x6e3ff382, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - // Taken from wofah, possibly not correct, although does match original Asia set as well - { "tk2a_22b.rom", 0x080000, 0x900ad4cd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2_gfx1.rom", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_gfx3.rom", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_gfx2.rom", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_gfx4.rom", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2_gfx5.rom", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2_gfx7.rom", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2_gfx6.rom", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2_gfx8.rom", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.rom", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2_q1.rom", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q2.rom", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q3.rom", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q4.rom", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Wofaha) -STD_ROM_FN(Wofaha) - -static struct BurnRomInfo WofahbRomDesc[] = { - { "tk2ah_23b.rom", 0x080000, 0x48fd83c6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - // Taken from wofah, possibly not correct, although does match original Asia set as well - { "tk2a_22b.rom", 0x080000, 0x900ad4cd, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2_gfx1.rom", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_gfx3.rom", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_gfx2.rom", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_gfx4.rom", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2_gfx5.rom", 0x080000, 0x291f0f0b, BRF_GRA | CPS1_TILES }, - { "tk2_gfx7.rom", 0x080000, 0x3edeb949, BRF_GRA | CPS1_TILES }, - { "tk2_gfx6.rom", 0x080000, 0x1abd14d6, BRF_GRA | CPS1_TILES }, - { "tk2_gfx8.rom", 0x080000, 0xb27948e3, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.rom", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2_q1.rom", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q2.rom", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q3.rom", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q4.rom", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Wofahb) -STD_ROM_FN(Wofahb) - -static struct BurnRomInfo Cps1frogRomDesc[] = { - { "frog30-36.bin", 0x020000, 0x8eb8ddbe, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "frog35-42.bin", 0x020000, 0xacb5a988, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "frog31-37.bin", 0x020000, 0x154803cc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "frog36-43.bin", 0x020000, 0x154803cc, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "frog32-32m.bin",0x080000, 0x75660aac, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "frog05-05m.bin",0x080000, 0x7bbc4b54, BRF_GRA | CPS1_TILES }, - { "frog07-07m.bin",0x080000, 0x0beadd80, BRF_GRA | CPS1_TILES }, - { "frog01-01m.bin",0x080000, 0xf84d02bb, BRF_GRA | CPS1_TILES }, - { "frog03-03m.bin",0x080000, 0xd784a5b0, BRF_GRA | CPS1_TILES }, - - { "frog09-09.bin", 0x010000, 0x3ac7fb5c, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "frog18-18.bin", 0x020000, 0x65d1ef07, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "frog19-19.bin", 0x020000, 0x7ee8cdcd, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Cps1frog) -STD_ROM_FN(Cps1frog) - -// Game config - -typedef void (*KabukiDecode)(); -static KabukiDecode KabukiDecodeFunction; - -static INT32 GameHasStars = 0; - -struct GameConfig { - const char *DriverName; - INT32 CpsBId; - INT32 CpsMapperId; - INT32 CpsStars; - KabukiDecode DecodeFunction; -}; - -static const struct GameConfig ConfigTable[] = -{ - { "1941" , CPS_B_05 , mapper_YI24B , 0, NULL }, - { "1941r1" , CPS_B_05 , mapper_YI24B , 0, NULL }, - { "1941u" , CPS_B_05 , mapper_YI24B , 0, NULL }, - { "1941j" , CPS_B_05 , mapper_YI24B , 0, NULL }, - { "3wonders" , CPS_B_21_BT1, mapper_RT24B , 0, NULL }, - { "3wondersr1" , CPS_B_21_BT1, mapper_RT24B , 0, NULL }, - { "3wondersu" , CPS_B_21_BT1, mapper_RT24B , 0, NULL }, - { "wonder3" , CPS_B_21_BT1, mapper_RT22B , 0, NULL }, - { "3wondersh" , CPS_B_02 , mapper_RT24B , 0, NULL }, - { "3wondersha" , CPS_B_21_BT1, mapper_RT24B , 0, NULL }, - { "3wondersb" , CPS_B_21_BT1, mapper_RT24B , 0, NULL }, - { "captcomm" , CPS_B_21_BT3, mapper_CC63B , 0, NULL }, - { "captcommr1" , CPS_B_21_BT3, mapper_CC63B , 0, NULL }, - { "captcommu" , CPS_B_21_BT3, mapper_CC63B , 0, NULL }, - { "captcommj" , CPS_B_21_BT3, mapper_CC63B , 0, NULL }, - { "captcommjr1" , CPS_B_21_BT3, mapper_CC63B , 0, NULL }, - { "captcommb" , CPS_B_21_BT3, mapper_CC63B , 0, NULL }, - { "captcommb2" , CPS_B_21_BT3, mapper_CC63B , 0, NULL }, - { "cawing" , CPS_B_16 , mapper_CA24B , 0, NULL }, - { "cawingr1" , CPS_B_16 , mapper_CA24B , 0, NULL }, - { "cawingu" , CPS_B_16 , mapper_CA24B , 0, NULL }, - { "cawingj" , CPS_B_16 , mapper_CA22B , 0, NULL }, - { "cawingbl" , CPS_B_16 , mapper_CA24B , 0, NULL }, - { "cawingb2" , CPS_B_16 , mapper_CA24B , 0, NULL }, - { "cworld2j" , CPS_B_21_BT6, mapper_Q522B , 0, NULL }, - { "cworld2ja" , CPS_B_21_DEF, mapper_Q522B , 0, NULL }, // patched set, no battery, could be desuicided - { "cworld2jb" , CPS_B_21_BT6, mapper_Q522B , 0, NULL }, // actually Q563B - { "dino" , CPS_B_21_QS2, mapper_CD63B , 0, dino_decode }, - { "dinoa" , CPS_B_21_QS2, mapper_CD63B , 0, dino_decode }, - { "dinou" , CPS_B_21_QS2, mapper_CD63B , 0, dino_decode }, - { "dinoj" , CPS_B_21_QS2, mapper_CD63B , 0, dino_decode }, - { "dinopic" , CPS_B_21_QS2, mapper_CD63B , 0, NULL }, - { "dinopic2" , CPS_B_21_QS2, mapper_CD63B , 0, NULL }, - { "dinopic3" , CPS_B_21_QS2, mapper_CD63B , 0, NULL }, - { "dinopic4" , CPS_B_21_QS2, mapper_CD63B , 0, NULL }, - { "dinoeh" , CPS_B_21_QS2, mapper_CD63B , 0, dino_decode }, - { "dinoh" , CPS_B_21_DEF, mapper_CD63B , 0, dino_decode }, - { "dinohc" , CPS_B_21_DEF, mapper_CD63B , 0, dino_decode }, // hacked to run on Street Fighter II' Champion Edition C-Board - { "dinot" , CPS_B_21_DEF, mapper_CD63B , 0, dino_decode }, - { "dinotpic" , CPS_B_21_QS2, mapper_CD63B , 0, dino_decode }, - { "dinohunt" , CPS_B_21_DEF, mapper_CD63B , 0, NULL }, - { "dynwar" , CPS_B_02 , mapper_TK22B , 0, NULL }, - { "dynwara" , CPS_B_02 , mapper_TK22B , 0, NULL }, - { "dynwarj" , CPS_B_02 , mapper_TK22B , 0, NULL }, - { "dynwarjr" , CPS_B_21_DEF, mapper_TK22B , 0, NULL }, - { "ffight" , CPS_B_04 , mapper_S224B , 0, NULL }, - { "ffighta" , CPS_B_04 , mapper_S224B , 0, NULL }, - { "ffightu" , CPS_B_04 , mapper_S224B , 0, NULL }, - { "ffightu1" , CPS_B_04 , mapper_S224B , 0, NULL }, - { "ffightu2" , CPS_B_04 , mapper_S224B , 0, NULL }, - { "ffightua" , CPS_B_01 , mapper_S224B , 0, NULL }, - { "ffightub" , CPS_B_03 , mapper_S224B , 0, NULL }, // 04 handwritten on CPS-B chip - { "ffightuc" , CPS_B_05 , mapper_S224B , 0, NULL }, - { "ffightj" , CPS_B_04 , mapper_S224B , 0, NULL }, - { "ffightj1" , CPS_B_01 , mapper_S224B , 0, NULL }, - { "ffightj2" , CPS_B_02 , mapper_S224B , 0, NULL }, - { "ffightj3" , CPS_B_05 , mapper_S224B , 0, NULL }, - { "ffightjh" , CPS_B_01 , mapper_S224B , 0, NULL }, - { "ffightbl" , HACK_B_5 , mapper_S224B , 0, NULL }, - { "ffightbla" , HACK_B_5 , mapper_S224B , 0, NULL }, - { "fcrash" , HACK_B_5 , mapper_S224B , 0, NULL }, // doesn't really have an ID, but this used to give the relevant values to our rendering functions - { "forgottn" , CPS_B_01 , mapper_LW621 , 1, NULL }, - { "forgottna" , CPS_B_01 , mapper_LW621 , 1, NULL }, - { "forgottnu" , CPS_B_01 , mapper_LW621 , 1, NULL }, - { "forgottnua" , CPS_B_01 , mapper_LWCHR , 1, NULL }, - { "forgottnuaa" , CPS_B_01 , mapper_LWCHR , 1, NULL }, - { "forgottnuc" , CPS_B_01 , mapper_LWCHR , 1, NULL }, - { "forgottnue" , CPS_B_01 , mapper_LWCHR , 1, NULL }, - { "lostwrld" , CPS_B_01 , mapper_LWCHR , 1, NULL }, - { "lostwrldo" , CPS_B_01 , mapper_LWCHR , 1, NULL }, - { "ganbare" , CPS_B_21_DEF, mapper_sfzch , 0, NULL }, - { "ghouls" , CPS_B_01 , mapper_DM620 , 0, NULL }, - { "ghoulsu" , CPS_B_01 , mapper_DM620 , 0, NULL }, - { "daimakai" , CPS_B_01 , mapper_DM22A , 0, NULL }, - { "daimakair" , CPS_B_21_DEF, mapper_DAM63B, 0, NULL }, - { "daimakaib" , CPS_B_21_DEF, mapper_DAM63B, 0, NULL }, // game controls layers at 0x98000c - { "knights" , CPS_B_21_BT4, mapper_KR63B , 0, NULL }, - { "knightsu" , CPS_B_21_BT4, mapper_KR63B , 0, NULL }, - { "knightsj" , CPS_B_21_BT4, mapper_KR63B , 0, NULL }, - { "knightsja" , CPS_B_21_BT4, mapper_KR63B , 0, NULL }, - { "knightsb" , CPS_B_21_BT4, mapper_KR63B , 0, NULL }, // game controls layers (and priorities?) at 0x98000c - { "knightsb2" , CPS_B_21_BT4, mapper_KR63B , 0, NULL }, - { "knightsb3" , CPS_B_21_DEF, mapper_KR63B , 0, NULL }, - { "knightsb4" , CPS_B_21_BT4, mapper_KR63B , 0, NULL }, // game controls layers (and priorities?) at 0x98000c - { "knightsh" , CPS_B_21_DEF, mapper_KR63B , 0, NULL }, - { "knightsh2" , CPS_B_21_DEF, mapper_KR63B , 0, NULL }, - { "kod" , CPS_B_21_BT2, mapper_KD29B , 0, NULL }, - { "kodr1" , CPS_B_21_BT2, mapper_KD29B , 0, NULL }, - { "kodu" , CPS_B_21_BT2, mapper_KD29B , 0, NULL }, - { "kodj" , CPS_B_21_BT2, mapper_KD29B , 0, NULL }, - { "kodja" , CPS_B_21_BT2, mapper_KD29B , 0, NULL }, - { "kodb" , CPS_B_21_BT2, mapper_KD29B , 0, NULL }, // game writes priority masks 1&2 at 0x980020-22 range, 0&3 assumed hard-coded at boot - { "kodh" , CPS_B_21_DEF, mapper_KD29B , 0, NULL }, - { "kodda" , CPS_B_21_DEF, mapper_KD29B , 0, NULL }, - { "megaman" , CPS_B_21_DEF, mapper_RCM63B, 0, NULL }, - { "megamana" , CPS_B_21_DEF, mapper_RCM63B, 0, NULL }, - { "rockmanj" , CPS_B_21_DEF, mapper_RCM63B, 0, NULL }, - { "mercs" , CPS_B_12 , mapper_O224B , 0, NULL }, - { "mercsu" , CPS_B_12 , mapper_O224B , 0, NULL }, - { "mercsur1" , CPS_B_12 , mapper_O224B , 0, NULL }, - { "mercsj" , CPS_B_12 , mapper_O224B , 0, NULL }, - { "msword" , CPS_B_13 , mapper_MS24B , 0, NULL }, - { "mswordr1" , CPS_B_13 , mapper_MS24B , 0, NULL }, - { "mswordu" , CPS_B_13 , mapper_MS24B , 0, NULL }, - { "mswordj" , CPS_B_13 , mapper_MS24B , 0, NULL }, - { "mtwins" , CPS_B_14 , mapper_CK24B , 0, NULL }, - { "chikij" , CPS_B_14 , mapper_CK24B , 0, NULL }, - { "nemo" , CPS_B_15 , mapper_NM24B , 0, NULL }, - { "nemor1" , CPS_B_15 , mapper_NM24B , 0, NULL }, - { "nemoj" , CPS_B_15 , mapper_NM24B , 0, NULL }, - { "pang3" , CPS_B_21_DEF, mapper_pang3 , 0, NULL }, - { "pang3r1" , CPS_B_21_DEF, mapper_pang3 , 0, NULL }, - { "pang3r1a" , CPS_B_21_DEF, mapper_pang3 , 0, NULL }, - { "pang3b" , CPS_B_21_DEF, mapper_pang3 , 0, NULL }, - { "pang3b2" , CPS_B_04 , mapper_pang3 , 0, NULL }, // hacked to run on Final Fight C-Board - { "pang3b3" , CPS_B_04 , mapper_pang3 , 0, NULL }, // hacked to run on Final Fight C-Board - { "pang3j" , CPS_B_21_DEF, mapper_pang3 , 0, NULL }, - { "pnickj" , CPS_B_21_DEF, mapper_PKB10B, 0, NULL }, - { "pokonyan" , CPS_B_21_DEF, mapper_pokon , 0, NULL }, - { "punisher" , CPS_B_21_QS3, mapper_PS63B , 0, punisher_decode }, - { "punisheru" , CPS_B_21_QS3, mapper_PS63B , 0, punisher_decode }, - { "punisherj" , CPS_B_21_QS3, mapper_PS63B , 0, punisher_decode }, - { "punisherh" , CPS_B_21_QS3, mapper_PS63B , 0, punisher_decode }, - { "punipic" , CPS_B_21_QS3, mapper_PS63B , 0, NULL }, // game controls layers at 0x98000c - { "punipic2" , CPS_B_21_QS3, mapper_PS63B , 0, NULL }, // game controls layers at 0x98000c - { "punipic3" , CPS_B_21_QS3, mapper_PS63B , 0, NULL }, // game controls layers at 0x98000c - { "punisherbz" , CPS_B_21_DEF, mapper_PS63B , 0, NULL }, - { "punisherb" , CPS_B_21_QS3, mapper_PS63B , 0, NULL }, - { "qad" , CPS_B_21_BT7, mapper_QD22B , 0, NULL }, - { "qadjr" , CPS_B_21_DEF, mapper_QD63B , 0, NULL }, - { "qtono2j" , CPS_B_21_DEF, mapper_TN2292, 0, NULL }, - { "sf2" , CPS_B_11 , mapper_STF29 , 0, NULL }, - { "sf2eb" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2ed" , CPS_B_05 , mapper_STF29 , 0, NULL }, - { "sf2ee" , CPS_B_18 , mapper_STF29 , 0, NULL }, - { "sf2em" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2ebbl" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2ebbl2" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2ebbl3" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2stt" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2ua" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2ub" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2uc" , CPS_B_12 , mapper_STF29 , 0, NULL }, - { "sf2ud" , CPS_B_05 , mapper_STF29 , 0, NULL }, - { "sf2ue" , CPS_B_18 , mapper_STF29 , 0, NULL }, - { "sf2uf" , CPS_B_15 , mapper_STF29 , 0, NULL }, - { "sf2ug" , CPS_B_11 , mapper_STF29 , 0, NULL }, - { "sf2ui" , CPS_B_14 , mapper_STF29 , 0, NULL }, - { "sf2uk" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2j" , CPS_B_13 , mapper_STF29 , 0, NULL }, - { "sf2j17" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2ja" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2jc" , CPS_B_12 , mapper_STF29 , 0, NULL }, - { "sf2jf" , CPS_B_15 , mapper_STF29 , 0, NULL }, - { "sf2jh" , CPS_B_13 , mapper_STF29 , 0, NULL }, - { "sf2jl" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2jla" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2qp1" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2thndr" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2b" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2b2" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2b3" , CPS_B_17 , mapper_STF29 , 0, NULL }, - { "sf2bhh" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ce" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceea" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceua" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceub" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceuc" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceja" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2cejb" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2cejc" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2rb" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2rb2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2rb3" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2rb4" , HACK_B_1 , mapper_S9263B, 0, NULL }, - { "sf2rb5" , HACK_B_1 , mapper_S9263B, 0, NULL }, - { "sf2rb6" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2red" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2red2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2v004" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2v0042" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2v0043" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2dongb" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2acc" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2acca" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2accp2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2dkot2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2md" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, // game controls layers at 0x98000c - { "sf2mdt" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2mdta" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2mdtb" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2mdtc" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2tlona" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2tlonb" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2tlonc" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2yyc" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2yyc2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2koryu" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2koryu2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2koryu3" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2amf" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2amf2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2amf3" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2amf4" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2amf5" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2amf6" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2amf7" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2amf8" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2mega" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2mega2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceeabl" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, // game controls layers at 0x98000c - { "sf2ceeab2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, // game controls layers at 0x98000c - { "sf2ceeab3" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceeab4" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceeab5" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2cejabl" , HACK_B_1 , mapper_S9263B, 0, NULL }, - { "sf2cejab2" , HACK_B_1 , mapper_S9263B, 0, NULL }, - { "sf2ceupl" , HACK_B_1 , mapper_S9263B, 0, NULL }, - { "sf2ceuabl" , HACK_B_2 , mapper_S9263B, 0, NULL }, - { "sf2ceuab2" , HACK_B_2 , mapper_S9263B, 0, NULL }, - { "sf2ceuab3" , HACK_B_2 , mapper_S9263B, 0, NULL }, - { "sf2ceuab4" , HACK_B_2 , mapper_S9263B, 0, NULL }, - { "sf2ceuab5" , HACK_B_2 , mapper_S9263B, 0, NULL }, - { "sf2ceuab6" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceuab7" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2ceuab8" , HACK_B_1 , mapper_S9263B, 0, NULL }, - { "sf2ceuab9" , HACK_B_1 , mapper_S9263B, 0, NULL }, - { "sf2ceucbl" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2cebltw" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2sl73a" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2hf" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2hfu" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2hfj" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2hfub" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, - { "sf2hfjb" , HACK_B_4 , mapper_S9263B, 0, NULL }, - { "sf2hfjb2" , HACK_B_4 , mapper_S9263B, 0, NULL }, - { "slammast" , CPS_B_21_QS4, mapper_MB63B , 0, slammast_decode }, - { "slammastu" , CPS_B_21_QS4, mapper_MB63B , 0, slammast_decode }, - { "mbomberj" , CPS_B_21_QS4, mapper_MB63B , 0, slammast_decode }, - { "mbombrd" , CPS_B_21_QS5, mapper_MB63B , 0, slammast_decode }, - { "mbombrdj" , CPS_B_21_QS5, mapper_MB63B , 0, slammast_decode }, - { "slampic" , CPS_B_21_QS4, mapper_MB63B , 0, NULL }, - { "strider" , CPS_B_01 , mapper_ST24M1, 1, NULL }, - { "striderua" , CPS_B_01 , mapper_ST24M1, 1, NULL }, - { "strideruc" , CPS_B_17 , mapper_ST24M1, 1, NULL }, - { "striderjr" , CPS_B_21_DEF, mapper_ST24M1, 1, NULL }, - { "striderj" , CPS_B_01 , mapper_ST22B , 1, NULL }, - { "unsquad" , CPS_B_11 , mapper_AR24B , 0, NULL }, - { "area88" , CPS_B_11 , mapper_AR22B , 0, NULL }, - { "area88r" , CPS_B_21_DEF, mapper_AR22B , 0, NULL }, - { "varth" , CPS_B_04 , mapper_VA63B , 0, NULL }, - { "varthr1" , CPS_B_04 , mapper_VA63B , 0, NULL }, - { "varthu" , CPS_B_04 , mapper_VA63B , 0, NULL }, - { "varthj" , CPS_B_21_BT5, mapper_VA22B , 0, NULL }, - { "varthjr" , CPS_B_21_BT5, mapper_VA63B , 0, NULL }, // CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */ - { "varthb" , CPS_B_04 , mapper_VA63B , 0, NULL }, - { "willow" , CPS_B_03 , mapper_WL24B , 0, NULL }, - { "willowu" , CPS_B_03 , mapper_WL24B , 0, NULL }, - { "willowuo" , CPS_B_03 , mapper_WL24B , 0, NULL }, - { "willowj" , CPS_B_03 , mapper_WL24B , 0, NULL }, - { "wof" , CPS_B_21_QS1, mapper_TK263B, 0, wof_decode }, - { "wofr1" , CPS_B_21_DEF, mapper_TK263B, 0, wof_decode }, - { "wofu" , CPS_B_21_QS1, mapper_TK263B, 0, wof_decode }, - { "wofj" , CPS_B_21_QS1, mapper_TK263B, 0, wof_decode }, - { "wofa" , CPS_B_21_DEF, mapper_TK263B, 0, wof_decode }, - { "wofhfh" , CPS_B_21_DEF, mapper_TK263B, 0, NULL }, - { "wofh" , HACK_B_6 , mapper_TK263B, 0, NULL }, - { "wofha" , HACK_B_6 , mapper_TK263B, 0, NULL }, - { "sgyxz" , HACK_B_6 , mapper_TK263B, 0, NULL }, - { "wof3js" , CPS_B_21_DEF, mapper_TK263B, 0, NULL }, - { "wof3jsa" , HACK_B_6 , mapper_TK263B, 0, NULL }, - { "wof3sj" , HACK_B_6 , mapper_TK263B, 0, NULL }, - { "wof3sja" , HACK_B_6 , mapper_TK263B, 0, NULL }, - { "wofsj" , HACK_B_6 , mapper_TK263B, 0, NULL }, - { "wofsja" , HACK_B_6 , mapper_TK263B, 0, NULL }, - { "wofsjb" , CPS_B_21_DEF, mapper_TK263B, 0, NULL }, - { "wofsjc" , HACK_B_6 , mapper_TK263B, 0, NULL }, - { "wofb" , CPS_B_21_DEF, mapper_TK263B, 0, NULL }, // game controls layers at 0x98000c - { "wofjh" , CPS_B_21_QS1, mapper_TK263B, 0, wof_decode }, - { "wofah" , CPS_B_21_DEF, mapper_TK263B, 0, wof_decode }, - { "wofaha" , CPS_B_21_DEF, mapper_TK263B, 0, wof_decode }, - { "wofahb" , CPS_B_21_DEF, mapper_TK263B, 0, wof_decode }, - { "sfzch" , CPS_B_21_DEF, mapper_sfzch , 0, NULL }, - { "wofch" , CPS_B_21_DEF, mapper_sfzch , 0, wof_decode }, - { "wofchdx" , CPS_B_21_DEF, mapper_sfzch , 0, wof_decode }, - { "cps1demo" , CPS_B_04 , mapper_sfzch , 0, NULL }, - { "cps1frog" , CPS_B_04 , mapper_frog , 0, NULL }, - { "kenseim" , CPS_B_21_DEF, mapper_KNM10B, 0, NULL }, - - // Not included games - { "pnicku" , CPS_B_21_DEF, mapper_PKB10B, 0, NULL }, // IPS - { "sf2cebr" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, // IPS - { "sf2ceh" , CPS_B_21_DEF, mapper_S9263B, 0, NULL }, // IPS - { "slammasa" , CPS_B_21_QS4, mapper_MB63B , 0, slammast_decode }, // IPS - { "slammash" , CPS_B_21_QS4, mapper_MB63B , 0, slammast_decode }, // IPS - { "mbombdje" , CPS_B_21_QS5, mapper_MB63B , 0, slammast_decode }, // IPS - { "mbombrda" , CPS_B_21_QS5, mapper_MB63B , 0, slammast_decode }, // IPS - { "mbombrdh" , CPS_B_21_QS5, mapper_MB63B , 0, slammast_decode }, // IPS - { "mbombrdu" , CPS_B_21_QS5, mapper_MB63B , 0, slammast_decode }, // IPS - { "woffr" , CPS_B_21_DEF, mapper_TK263B, 0, wof_decode }, // IPS - - // CPS Changer Region Hacks (not included) - { "sfach" , CPS_B_21_DEF, mapper_sfzch , 0, NULL }, - { "sfabch" , CPS_B_21_DEF, mapper_sfzch , 0, NULL }, - { "sfzbch" , CPS_B_21_DEF, mapper_sfzch , 0, NULL }, - { "sfzech" , CPS_B_21_DEF, mapper_sfzch , 0, NULL }, - { "sfzhch" , CPS_B_21_DEF, mapper_sfzch , 0, NULL }, - - { 0 , 0 , 0 , 0, 0 } -}; - -static void SetGameConfig() -{ - const char *GameName = BurnDrvGetTextA(DRV_NAME); - const struct GameConfig *k = &ConfigTable[0]; - - while (k->DriverName) { - if (strcmp(k->DriverName, GameName) == 0) { - break; - } - ++k; - } - - if (k->DriverName) { - GameHasStars = k->CpsStars; - SetCpsBId(k->CpsBId, GameHasStars); - SetGfxMapper(k->CpsMapperId); - KabukiDecodeFunction = k->DecodeFunction; - } else { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_IMPORTANT, _T("Missing Config Data\n")); -#endif - } -} - -// Driver functions - -static UINT32 nCps68KByteswapRomNum = 0; -static UINT32 nCps68KNoByteswapRomNum = 0; -static UINT32 nCpsZ80RomNum = 0; -static UINT32 nCpsTilesRomNum = 0; -static UINT32 nCpsOkim6295RomNum = 0; -static UINT32 nCpsQsoundRomNum = 0; -static UINT32 nCpsPicRomNum = 0; -static UINT32 nCpsExtraTilesRomNum = 0; -static UINT32 nCpsExtraGfxLen = 0; - -static INT32 Cps1LoadRoms(INT32 bLoad) -{ - struct BurnRomInfo ri; - ri.nType = 0; - ri.nLen = 0; - INT32 nOffset = -1; - UINT32 i = 0; - INT32 nRet = 0; - - if (!bLoad) { - do { - ri.nLen = 0; - ri.nType = 0; - BurnDrvGetRomInfo(&ri, ++nOffset); - if ((ri.nType & 0xff) == CPS1_68K_PROGRAM_BYTESWAP) { - nCpsRomLen += ri.nLen; - nCps68KByteswapRomNum++; - } - if ((ri.nType & 0xff) == CPS1_68K_PROGRAM_NO_BYTESWAP) { - nCpsRomLen += ri.nLen; - nCps68KNoByteswapRomNum++; - } - if ((ri.nType & 0xff) == CPS1_Z80_PROGRAM) { - nCpsZRomLen += ri.nLen; - nCpsZ80RomNum++; - } - if ((ri.nType & 0xff) == CPS1_TILES) { - nCpsGfxLen += ri.nLen; - nCpsTilesRomNum++; - } - if ((ri.nType & 0xff) == CPS1_PIC) { - nCpsPicRomNum++; - } - if ((ri.nType & 0xff) == CPS1_OKIM6295_SAMPLES) { - nCpsAdLen += ri.nLen; - nCpsOkim6295RomNum++; - } - if ((ri.nType & 0xff) == CPS1_QSOUND_SAMPLES) { - Cps1Qs = 1; - nCpsQSamLen += ri.nLen; - nCpsQsoundRomNum++; - } - if (((ri.nType & 0xff) == CPS1_EXTRA_TILES_SF2EBBL_400000) || ((ri.nType & 0xff) == CPS1_EXTRA_TILES_400000) || ((ri.nType & 0xff) == CPS1_EXTRA_TILES_SF2KORYU_400000) || ((ri.nType & 0xff) == CPS1_EXTRA_TILES_SF2B_400000)) { - nCpsExtraGfxLen += ri.nLen; - nCpsExtraTilesRomNum++; - } - i++; - - } while (ri.nLen); - - if (Cps1Qs) nCpsZRomLen *= 2; - if (GameHasStars) nCpsGfxLen += 0x2000; - if (PangEEP) nCpsGfxLen *= 2; - if (nCpsPicRomNum) Cps1DisablePSnd = 1; - -#if 1 && defined FBA_DEBUG - if (nCpsRomLen) bprintf(PRINT_IMPORTANT, _T("68K Rom Length %06X, (%i roms byteswapped, %i roms not byteswapped)\n"), nCpsRomLen, nCps68KByteswapRomNum, nCps68KNoByteswapRomNum); - if (nCpsZRomLen) bprintf(PRINT_IMPORTANT, _T("Z80 Rom Length %06X, (%i roms)\n"), nCpsZRomLen, nCpsZ80RomNum); - if (nCpsGfxLen) bprintf(PRINT_IMPORTANT, _T("Tile Rom Length %08X, (%i roms)\n"), nCpsGfxLen, nCpsTilesRomNum); - if (nCpsAdLen) bprintf(PRINT_IMPORTANT, _T("OKIM6295 Rom Length %08X, (%i roms)\n"), nCpsAdLen, nCpsOkim6295RomNum); - if (nCpsQSamLen) bprintf(PRINT_IMPORTANT, _T("QSound Rom Length %08X, (%i roms)\n"), nCpsQSamLen, nCpsQsoundRomNum); - if (nCpsExtraGfxLen) bprintf(PRINT_IMPORTANT, _T("Extra Tile Rom Length %08X, (%i roms)\n"), nCpsExtraGfxLen, nCpsExtraTilesRomNum); -#endif - } - - if (bLoad) { - INT32 Offset = 0; - - i = 0; - while (i < nCps68KByteswapRomNum + nCps68KNoByteswapRomNum) { - BurnDrvGetRomInfo(&ri, i + 0); - if ((ri.nType & 0xff) == CPS1_68K_PROGRAM_BYTESWAP) { - nRet = BurnLoadRom(CpsRom + Offset + 1, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(CpsRom + Offset + 0, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - - i += 2; - } - - if ((ri.nType & 0xff) == CPS1_68K_PROGRAM_NO_BYTESWAP) { - nRet = BurnLoadRom(CpsRom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - } - - // Graphics - if (nCpsGfxLen) { - Offset = 0; - i = nCps68KByteswapRomNum + nCps68KNoByteswapRomNum; - while (i < nCps68KByteswapRomNum + nCps68KNoByteswapRomNum + nCpsTilesRomNum) { - if (Cps1GfxLoadCallbackFunction) { - Cps1GfxLoadCallbackFunction(i); - - i += nCpsTilesRomNum; - } else { - BurnDrvGetRomInfo(&ri, i + 0); - - if (ri.nLen < 0x80000) { - CpsLoadTilesByte(CpsGfx + Offset, i); - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 2); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 3); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 4); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 5); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 6); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 7); - Offset += ri.nLen; - - i += 8; - } else { - if (PangEEP) { - CpsLoadTilesPang(CpsGfx + Offset, i); - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 2); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 3); - Offset += ri.nLen; - - i += 4; - } else { - if (nCpsTilesRomNum < 4) { - // Handle this seperately - i += nCpsTilesRomNum; - } else { - CpsLoadTiles(CpsGfx + Offset, i); - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 2); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 3); - Offset += ri.nLen; - - i += 4; - } - } - } - } - } - } - - // Z80 Program - if (nCpsZRomLen) { - Offset = 0; - for (i = nCps68KByteswapRomNum + nCps68KNoByteswapRomNum + nCpsTilesRomNum; i < nCps68KByteswapRomNum + nCps68KNoByteswapRomNum + nCpsTilesRomNum + nCpsZ80RomNum; i++) { - BurnLoadRom(CpsZRom + Offset, i, 1); - - if (Cps1Qs) BurnLoadRom(CpsEncZRom + Offset, i, 1); - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - } - } - - // Pic (skip for now) - if (nCpsPicRomNum) { - BurnDrvGetRomInfo(&ri, i); - } - - // OKIM6295 Samples - if (nCpsAdLen) { - Offset = 0; - for (i = nCps68KByteswapRomNum + nCps68KNoByteswapRomNum + nCpsTilesRomNum + nCpsZ80RomNum; i < nCps68KByteswapRomNum + nCps68KNoByteswapRomNum + nCpsTilesRomNum + nCpsZ80RomNum + nCpsOkim6295RomNum; i++) { - BurnLoadRom(CpsAd + Offset, i, 1); - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - } - } - - // QSound Samples - if (nCpsQSamLen) { - Offset = 0; - for (i = nCps68KByteswapRomNum + nCps68KNoByteswapRomNum + nCpsTilesRomNum + nCpsZ80RomNum; i < nCps68KByteswapRomNum + nCps68KNoByteswapRomNum + nCpsTilesRomNum + nCpsZ80RomNum + nCpsQsoundRomNum; i++) { - BurnLoadRom((UINT8*)CpsQSam + Offset, i, 1); - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - } - } - - // Extra Tile Roms - if (nCpsExtraGfxLen) { - Offset = 0; - for (i = nCps68KByteswapRomNum + nCps68KNoByteswapRomNum + nCpsTilesRomNum + nCpsZ80RomNum + nCpsQsoundRomNum; i < nCps68KByteswapRomNum + nCps68KNoByteswapRomNum + nCpsTilesRomNum + nCpsZ80RomNum + nCpsQsoundRomNum + nCpsExtraTilesRomNum; i++) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == CPS1_EXTRA_TILES_SF2EBBL_400000) { - memset(CpsGfx + 0x400000, 0, nCpsExtraGfxLen); - CpsLoadTilesSf2ebbl(CpsGfx + 0x400000, i); - - i += 4; - } - - if ((ri.nType & 0xff) == CPS1_EXTRA_TILES_400000) { - memset(CpsGfx + 0x400000, 0, nCpsExtraGfxLen); - CpsLoadTiles(CpsGfx + 0x400000, i); - - i += 4; - } - - if ((ri.nType & 0xff) == CPS1_EXTRA_TILES_SF2KORYU_400000) { - memset(CpsGfx + 0x400000, 0, nCpsExtraGfxLen); - CpsLoadTilesSf2koryuExtra(CpsGfx + 0x400000, i); - - i += 2; - } - - if ((ri.nType & 0xff) == CPS1_EXTRA_TILES_SF2B_400000) { - memset(CpsGfx + 0x400000, 0, nCpsExtraGfxLen); - CpsLoadTilesSf2b(CpsGfx + 0x400000, i); - - i += 4; - } - } - } - } - - return nRet; -} - -typedef void (*AmendProgRom)(); -static AmendProgRom AmendProgRomCallback; - -static INT32 DrvInit() -{ - INT32 nRet = 0; - - SetGameConfig(); - - Cps1LoadRoms(0); - - Cps = 1; - nRet = CpsInit(); if (nRet != 0) return 1; - - if (Cps1LoadRoms(1)) return 1; - - if (AmendProgRomCallback) AmendProgRomCallback(); - - SetGameConfig(); - - if (Cps1Qs) { - KabukiDecodeFunction(); - } - - nRet = CpsRunInit(); if (nRet != 0) return 1; - - Cps1VBlankIRQLine = 2; - - return 0; -} - -static INT32 DrvExit() -{ - CpsRunExit(); - CpsExit(); - - nCpsRomLen = 0; - nCpsZRomLen = 0; - nCpsGfxLen = 0; - nCpsAdLen = 0; - nCpsQSamLen = 0; - nCpsPicRomNum = 0; - nCpsExtraGfxLen = 0; - - nCps68KByteswapRomNum = 0; - nCps68KNoByteswapRomNum = 0; - nCpsZ80RomNum = 0; - nCpsTilesRomNum = 0; - nCpsOkim6295RomNum = 0; - nCpsQsoundRomNum = 0; - nCpsExtraTilesRomNum = 0; - KabukiDecodeFunction = NULL; - GameHasStars = 0; - - AmendProgRomCallback = NULL; - - CpsLayer1XOffs = 0; - CpsLayer2XOffs = 0; - CpsLayer3XOffs = 0; - CpsLayer1YOffs = 0; - CpsLayer2YOffs = 0; - CpsLayer3YOffs = 0; - CpsDrawSpritesInReverse = 0; - Cps1OverrideLayers = 0; - nCps1Layers[0] = -1; - nCps1Layers[1] = -1; - nCps1Layers[2] = -1; - nCps1Layers[3] = -1; - - Cps = 0; - Cps1Qs = 0; - Cps1DisablePSnd = 0; - Forgottn = 0; - Ghouls = 0; - Kodb = 0; - PangEEP = 0; - Cps1LockSpriteList910000 = 0; - Cps1DisableBgHi = 0; - CpsDisableRowScroll = 0; - Dinohunt = 0; - Sf2thndr = 0; - Port6SoundWrite = 0; - - Cps1QsHack = 0; - - Cps1GfxLoadCallbackFunction = NULL; - - BurnFree(CpsBootlegSpriteRam); - - return 0; -} - -static INT32 TwelveMhzInit() -{ - nCPS68KClockspeed = 12000000; - - return DrvInit(); -} - -static INT32 CpsBootlegSpriteRamScanCallback(INT32 nAction, INT32*) -{ - if (nAction & ACB_MEMORY_RAM) { - struct BurnArea ba; - memset(&ba, 0, sizeof(ba)); - - ba.Data = CpsBootlegSpriteRam; - ba.nLen = 0x4000; - ba.szName = "CpsBootlegSpriteRam"; - BurnAcb(&ba); - } - - return 0; -} - -static INT32 Wonder3bInit() -{ - bCpsUpdatePalEveryFrame = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesWonder3b; - - CpsLayer1XOffs = 4; - CpsLayer2XOffs = 6; - CpsLayer3XOffs = 10; - - INT32 nRet = DrvInit(); - - // the game doesn't write these anywhere - does the hardware have them stored somewhere? - *((UINT16*)(CpsReg + 0x04)) = BURN_ENDIAN_SWAP_INT16(0x90c0); // scroll2 address - *((UINT16*)(CpsReg + 0x06)) = BURN_ENDIAN_SWAP_INT16(0x9100); // scroll3 address - *((UINT16*)(CpsReg + 0x0a)) = BURN_ENDIAN_SWAP_INT16(0x9140); // palette address - *((UINT16*)(CpsReg + nCpsPalCtrlReg)) = BURN_ENDIAN_SWAP_INT16(0x003f); // palette control - - return nRet; -} - -static INT32 CaptcommbInit() -{ - CpsLayer1XOffs = -8; - CpsLayer2XOffs = -11; - CpsLayer3XOffs = -12; - CpsDrawSpritesInReverse = 1; - Cps1DetectEndSpriteList8000 = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesCaptcommb; - - return DrvInit(); -} - -static INT32 Captcommb2Init() -{ - Cps1DisablePSnd = 1; - CpsRunInitCallbackFunction = Sf2mdtSoundInit; - CpsRunResetCallbackFunction = Sf2mdtSoundReset; - CpsRunExitCallbackFunction = Sf2mdtSoundExit; - CpsRunFrameStartCallbackFunction = Sf2mdtSoundFrameStart; - CpsRunFrameEndCallbackFunction = Sf2mdtSoundFrameEnd; - CpsRWSoundCommandCallbackFunction = Sf2mdtSoundCommand; - CpsMemScanCallbackFunction = Sf2mdtScanSound; - - return DrvInit(); -} - -UINT8 __fastcall CawingblInputReadByte(UINT32 a) -{ - switch (a) { - case 0x882000: { - return ~Inp000; - } - - case 0x882001: { - return ~Inp001; - } - - case 0x882008: { - return ~Inp018; - } - - case 0x88200a: { - return ~Cpi01A; - } - - case 0x88200c: { - return ~Cpi01C; - } - - case 0x88200e: { - return ~Cpi01E; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Read Byte %x\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall CawingblInputReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Input Read Word %x\n"), a); - } - } - - return 0; -} - -void __fastcall CawingblInputWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x882006: { - FcrashSoundCommand(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Write Byte %x, %x\n"), a, d); - } - } -} - -void __fastcall CawingblInputWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x882006: { - FcrashSoundCommand(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Write Word %x, %x\n"), a, d); - } - } -} - -static INT32 CawingblInit() -{ - INT32 nRet = 0; - - Cps1DisablePSnd = 1; - bCpsUpdatePalEveryFrame = 1; - - CpsLayer1XOffs = -63; - CpsLayer2XOffs = -62; - CpsLayer3XOffs = -65; - - Cps1ObjGetCallbackFunction = WofhObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - Cps1GfxLoadCallbackFunction = CpsLoadTilesCawingbl; - CpsRunInitCallbackFunction = FcrashSoundInit; - CpsRunResetCallbackFunction = FcrashSoundReset; - CpsRunExitCallbackFunction = FcrashSoundExit; - CpsRunFrameStartCallbackFunction = FcrashSoundFrameStart; - CpsRunFrameEndCallbackFunction = FcrashSoundFrameEnd; - CpsMemScanCallbackFunction = FcrashScanSound; - - nRet = DrvInit(); - - SekOpen(0); - SekMapHandler(1, 0x882000, 0x882fff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(1, CawingblInputReadByte); - SekSetReadWordHandler(1, CawingblInputReadWord); - SekSetWriteByteHandler(1, CawingblInputWriteByte); - SekSetWriteWordHandler(1, CawingblInputWriteWord); - SekClose(); - - Cps1VBlankIRQLine = 6; - - return 0; -} - -static INT32 Cawingb2Init() -{ - INT32 nRet = 0; - - Cps1DisablePSnd = 1; - bCpsUpdatePalEveryFrame = 1; - - CpsLayer1XOffs = -63; - CpsLayer2XOffs = -62; - CpsLayer3XOffs = -65; - - Cps1ObjGetCallbackFunction = WofhObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - Cps1GfxLoadCallbackFunction = CpsLoadTilesFcrash; - CpsRunInitCallbackFunction = FcrashSoundInit; - CpsRunResetCallbackFunction = FcrashSoundReset; - CpsRunExitCallbackFunction = FcrashSoundExit; - CpsRunFrameStartCallbackFunction = FcrashSoundFrameStart; - CpsRunFrameEndCallbackFunction = FcrashSoundFrameEnd; - CpsMemScanCallbackFunction = FcrashScanSound; - - nRet = DrvInit(); - - SekOpen(0); - SekMapHandler(1, 0x882000, 0x882fff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(1, CawingblInputReadByte); - SekSetReadWordHandler(1, CawingblInputReadWord); - SekSetWriteByteHandler(1, CawingblInputWriteByte); - SekSetWriteWordHandler(1, CawingblInputWriteWord); - SekClose(); - - Cps1VBlankIRQLine = 6; - - return 0; -} - -static INT32 Cps1demoInit() -{ - bCpsUpdatePalEveryFrame = 1; - - return DrvInit(); -} - -void __fastcall DinopicScrollWrite(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x980000: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980002: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x980004: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980006: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x980008: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x98000a: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write Word %x, %x\n"), a, d); - } - } -} - -void __fastcall DinopicLayerWrite(UINT32 a, UINT16 d) -{ - if (a == 0x800222) { - *((UINT16*)(CpsReg + 0x06)) = d; - return; - } - - // Send anything else through the main handler - SEK_DEF_WRITE_WORD(0, a, d); -} - -static INT32 DinopicInit() -{ - INT32 nRet = 0; - - Cps1DisablePSnd = 1; - CpsBootlegEEPROM = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesDinopic; - Cps1ObjGetCallbackFunction = DinopicObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsMemScanCallbackFunction = CpsBootlegSpriteRamScanCallback; - - nRet = TwelveMhzInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x991fff, MAP_RAM); - SekMapHandler(1, 0x980000, 0x98000f, MAP_WRITE); - SekSetWriteWordHandler(1, DinopicScrollWrite); - SekMapHandler(2, 0x800200, 0x8002ff, MAP_WRITE); - SekSetWriteWordHandler(2, DinopicLayerWrite); - SekClose(); - - return nRet; -} - -UINT8 __fastcall DinohuntQSharedRamRead(UINT32 /*a*/) -{ - return 0xff; -} - -static INT32 DinohInit() -{ - INT32 nRet = 0; - - Cps1QsHack = 1; - - nRet = TwelveMhzInit(); - - SekOpen(0); - SekMapHandler(1, 0xf18000, 0xf19fff, MAP_READ); - SekSetReadByteHandler(1, DinohuntQSharedRamRead); - SekClose(); - - return nRet; -} - -static UINT16 Dinopic4ProtValue = 0; - -UINT16 __fastcall Dinopic4ProtReadWord(UINT32 a) -{ - switch (a) { - case 0x57a2b0: { - if (Dinopic4ProtValue == 0x04) return 0x0404; - return 0xffff; - } - } - - return 0; -} - -void __fastcall Dinopic4ProtWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x5762b0: { - Dinopic4ProtValue = d; - return; - } - } -} - -static INT32 Dinopic4Init() -{ - INT32 nRet = 0; - - CpsBootlegEEPROM = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesDinopic4; - - nRet = TwelveMhzInit(); - - SekOpen(0); - SekMapHandler(1, 0xf18000, 0xf19fff, MAP_READ); - SekSetReadByteHandler(1, DinohuntQSharedRamRead); - SekMapHandler(2, 0x570000, 0x57ffff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(2, Dinopic4ProtReadWord); - SekSetWriteWordHandler(2, Dinopic4ProtWriteWord); - SekClose(); - - return nRet; -} - -static void DinotCallback() -{ - UINT8 *TempRom = (UINT8*)BurnMalloc(0x200000); - if (TempRom) { - memcpy(TempRom, CpsRom, 0x200000); - memset(CpsRom, 0, 0x200000); - memcpy(CpsRom + 0x080000, TempRom + 0x000000, 0x80000); - memcpy(CpsRom + 0x000000, TempRom + 0x080000, 0x80000); - memcpy(CpsRom + 0x180000, TempRom + 0x100000, 0x80000); - memcpy(CpsRom + 0x100000, TempRom + 0x180000, 0x80000); - BurnFree(TempRom); - } -} - -static INT32 DinotInit() -{ - INT32 nRet = 0; - - Cps1QsHack = 1; - AmendProgRomCallback = DinotCallback; - Cps1GfxLoadCallbackFunction = CpsLoadTilesHack160; - - nRet = TwelveMhzInit(); - - SekOpen(0); - SekMapHandler(1, 0xf18000, 0xf19fff, MAP_READ); - SekSetReadByteHandler(1, DinohuntQSharedRamRead); - SekClose(); - - return nRet; -} - -static INT32 DinotpicInit() -{ - INT32 nRet = 0; - - Cps1DisablePSnd = 1; - CpsBootlegEEPROM = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesHack160; - Cps1ObjGetCallbackFunction = DinopicObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsMemScanCallbackFunction = CpsBootlegSpriteRamScanCallback; - - nRet = TwelveMhzInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x991fff, MAP_RAM); - SekMapHandler(1, 0x980000, 0x98000f, MAP_WRITE); - SekSetWriteWordHandler(1, DinopicScrollWrite); - SekMapHandler(2, 0x800200, 0x8002ff, MAP_WRITE); - SekSetWriteWordHandler(2, DinopicLayerWrite); - SekClose(); - - return nRet; -} - -static INT32 DinohuntInit() -{ - INT32 nRet = 0; - - Dinohunt = 1; - CpsBootlegEEPROM = 1; - - nRet = TwelveMhzInit(); - - SekOpen(0); - SekMapHandler(1, 0xf18000, 0xf19fff, MAP_READ); - SekSetReadByteHandler(1, DinohuntQSharedRamRead); - SekClose(); - - return nRet; -} - -UINT8 __fastcall FcrashInputReadByte(UINT32 a) -{ - switch (a) { - case 0x880000: { - return ~Inp000; - } - - case 0x880008: { - return ~Inp018; - } - - case 0x88000a: { - return ~Cpi01A; - } - - case 0x88000c: { - return ~Cpi01C; - } - - case 0x88000e: { - return ~Cpi01E; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Read Byte %x\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall FcrashInputReadWord(UINT32 a) -{ - switch (a) { - case 0x880000: { - return (~Inp000 << 8) | ~Inp001; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Read Word %x\n"), a); - } - } - - return 0; -} - -void __fastcall FcrashInputWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Input Write Byte %x, %x\n"), a, d); - } - } -} - -void __fastcall FcrashInputWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x880006: { - FcrashSoundCommand(d); - return; - } - - case 0x890000: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Write word %x, %x\n"), a, d); - } - } -} - -static INT32 FfightblInit() -{ - Cps1DisablePSnd = 1; - bCpsUpdatePalEveryFrame = 1; - CpsLayer1XOffs = -0x3f; - CpsLayer2XOffs = -0x3c; - CpsLayer3XOffs = 0xffc0; - - Cps1GfxLoadCallbackFunction = CpsLoadTilesCawingbl; - Cps1ObjGetCallbackFunction = FcrashObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsRunInitCallbackFunction = FcrashSoundInit; - CpsRunResetCallbackFunction = FcrashSoundReset; - CpsRunExitCallbackFunction = FcrashSoundExit; - CpsRunFrameStartCallbackFunction = FcrashSoundFrameStart; - CpsRunFrameEndCallbackFunction = FcrashSoundFrameEnd; - CpsMemScanCallbackFunction = FcrashScanSound; - - INT32 nRet = DrvInit(); - - SekOpen(0); - SekMapHandler(1, 0x880000, 0x89ffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(1, FcrashInputReadByte); - SekSetReadWordHandler(1, FcrashInputReadWord); - SekSetWriteByteHandler(1, FcrashInputWriteByte); - SekSetWriteWordHandler(1, FcrashInputWriteWord); - SekClose(); - - return nRet; -} - -static void FcrashPatch() -{ - // This fixes sprite ram clearing - shouldn't be necessary, but used for now pending understanding of the underlying issue - CpsRom[0x2611] = 0x07; -} - -static INT32 FcrashInit() -{ - Cps1DisablePSnd = 1; - bCpsUpdatePalEveryFrame = 1; - CpsLayer1XOffs = -0x3f; - CpsLayer2XOffs = -0x3c; - CpsLayer3XOffs = 0xffc0; - - AmendProgRomCallback = FcrashPatch; - Cps1GfxLoadCallbackFunction = CpsLoadTilesFcrash; - Cps1ObjGetCallbackFunction = FcrashObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsRunInitCallbackFunction = FcrashSoundInit; - CpsRunResetCallbackFunction = FcrashSoundReset; - CpsRunExitCallbackFunction = FcrashSoundExit; - CpsRunFrameStartCallbackFunction = FcrashSoundFrameStart; - CpsRunFrameEndCallbackFunction = FcrashSoundFrameEnd; - CpsMemScanCallbackFunction = FcrashScanSound; - - INT32 nRet = DrvInit(); - - SekOpen(0); - SekMapHandler(1, 0x880000, 0x89ffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(1, FcrashInputReadByte); - SekSetReadWordHandler(1, FcrashInputReadWord); - SekSetWriteByteHandler(1, FcrashInputWriteByte); - SekSetWriteWordHandler(1, FcrashInputWriteWord); - SekClose(); - - return nRet; -} - -static INT32 ForgottnNewerInit() -{ - INT32 nRet = 0; - - Forgottn = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesForgottn; - - nRet = DrvInit(); - - CpsStar = CpsGfx + nCpsGfxLen - 0x2000; - - CpsLoadStarsForgottnAlt(CpsStar, 18); - - return nRet; -} - -static INT32 ForgottnInit() -{ - INT32 nRet = 0; - - Forgottn = 1; - - nRet = DrvInit(); - - CpsStar = CpsGfx + nCpsGfxLen - 0x2000; - - CpsLoadStars(CpsStar, 9); - - return nRet; -} - -static INT32 ForgottnAltGfxInit() -{ - INT32 nRet = 0; - - Forgottn = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesForgottna; - - nRet = DrvInit(); - - CpsStar = CpsGfx + nCpsGfxLen - 0x2000; - - CpsLoadStarsForgottnAlt(CpsStar, 15); - - return nRet; -} - -static INT32 ForgottnAltGfxuInit() -{ - INT32 nRet = 0; - - Forgottn = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesForgottnu; - - nRet = DrvInit(); - - CpsStar = CpsGfx + nCpsGfxLen - 0x2000; - - CpsLoadStarsForgottnAlt(CpsStar, 15); - - return nRet; -} - -UINT8 __fastcall GanbareTimeKeeperReadByte(UINT32 a) -{ - if (a & 1) { - return TimeKeeperRead((a & 0xffff) >> 1); - } else { - return CpsRamFF[(a & 0xffff) >> 1]; - } -} - -UINT16 __fastcall GanbareTimeKeeperReadWord(UINT32 a) -{ - SEK_DEF_READ_WORD(1, a); -} - -void __fastcall GanbareTimeKeeperWriteByte(UINT32 a, UINT8 d) -{ - if (a & 1) { - TimeKeeperWrite((a & 0xffff) >> 1, d); - } else { - CpsRamFF[(a & 0xffff) >> 1] = d; - } -} - -void __fastcall GanbareTimeKeeperWriteWord(UINT32 a, UINT16 d) -{ - SEK_DEF_WRITE_WORD(1, a, d); -} - -static void GanabareTimeKeeperTick() -{ - if ((GetCurrentFrame() % 60) == 0) TimeKeeperTick(); // refresh is 59.61 - - SekOpen(0); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); -} - -static INT32 GanbareScanCallback(INT32 nAction, INT32*) -{ - TimeKeeperScan(nAction); - - return 0; -} - -static INT32 GanbareInit() -{ - CpsRunFrameStartCallbackFunction = GanabareTimeKeeperTick; - CpsMemScanCallbackFunction = GanbareScanCallback; - - INT32 nRet = DrvInit(); - - SekOpen(0); - SekMapHandler(1, 0xff0000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(1, GanbareTimeKeeperReadByte); - SekSetReadWordHandler(1, GanbareTimeKeeperReadWord); - SekSetWriteByteHandler(1, GanbareTimeKeeperWriteByte); - SekSetWriteWordHandler(1, GanbareTimeKeeperWriteWord); - SekClose(); - - TimeKeeperInit(TIMEKEEPER_M48T35, NULL); - - return nRet; -} - -static INT32 GanbareExit() -{ - TimeKeeperExit(); - - return DrvExit(); -} - -static void GhoulsCallback() -{ - BurnByteswap(CpsRom + 0x080000, 0x080000); -} - -static INT32 GhoulsInit() -{ - Ghouls = 1; - AmendProgRomCallback = GhoulsCallback; - - return DrvInit(); -} - -static INT32 DaimakaiInit() -{ - Ghouls = 1; - - return DrvInit(); -} - -void __fastcall Daimakaib88WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x880000: { - *((UINT16*)(CpsReg + nCpsPalCtrlReg)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Write word %x, %x\n"), a, d); -} - -void __fastcall Daimakaib98WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x980000: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980002: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x980004: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980006: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x980008: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x98000a: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x98000c: { - // This seems to control layer order and enable - switch (d) { - case 0: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - break; - } - - case 1: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = -1; - nCps1Layers[3] = 3; - break; - } - - case 2: { - nCps1Layers[0] = 3; - nCps1Layers[1] = -1; - nCps1Layers[2] = -1; - nCps1Layers[3] = 1; - break; - } - - case 6: { - nCps1Layers[0] = -1; - nCps1Layers[1] = -1; - nCps1Layers[2] = -1; - nCps1Layers[3] = -1; - break; - } - - default: { - nCps1Layers[0] = 0; - nCps1Layers[1] = 0; - nCps1Layers[2] = 0; - nCps1Layers[3] = 0; - bprintf(PRINT_IMPORTANT, _T("Unknown value written at 0x98000c %x\n"), d); - } - } - return; - } - } - - bprintf(PRINT_NORMAL, _T("Write word %x, %x\n"), a, d); -} - -void __fastcall DaimakaibFFWriteByte(UINT32 a, UINT8 d) -{ - CpsRamFF[((a & 0xffff) ^ 1)] = d; -} - -void __fastcall DaimakaibFFWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xff0680: { - *((UINT16*)(CpsReg + MaskAddr[1])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff0682: { - *((UINT16*)(CpsReg + MaskAddr[2])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff0684: { - *((UINT16*)(CpsReg + MaskAddr[3])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - } - - UINT16 *RAM = (UINT16*)CpsRamFF; - RAM[((a & 0xffff) >> 1)] = d; -} - -static INT32 DaimakaibInit() -{ - Ghouls = 1; - Port6SoundWrite = 1; - Cps1OverrideLayers = 1; - Cps1ObjGetCallbackFunction = DaimakaibObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsMemScanCallbackFunction = CpsBootlegSpriteRamScanCallback; - - INT32 nRet = DrvInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x991fff, MAP_RAM); - SekMapHandler(1, 0x880000, 0x88ffff, MAP_WRITE); - SekSetWriteWordHandler(1, Daimakaib88WriteWord); - SekMapHandler(2, 0x980000, 0x98ffff, MAP_WRITE); - SekSetWriteWordHandler(2, Daimakaib98WriteWord); - SekMapHandler(3, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(3, DaimakaibFFWriteByte); - SekSetWriteWordHandler(3, DaimakaibFFWriteWord); - SekClose(); - - return nRet; -} - -void __fastcall Knightsb98WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x980000: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980002: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d - 0x3e); - return; - } - - case 0x980004: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980006: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d - 0x3c); - return; - } - - case 0x980008: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x98000a: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x98000c: { - // This seems to control layer order and enable - switch (d) { - case 0x0000: - case 0x001f: - case 0x00ff: - case 0x07ff: - case 0x5800: - case 0x5f00: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - break; - } - - case 0x2000: { - nCps1Layers[0] = 0; - nCps1Layers[1] = 1; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - break; - } - - case 0x80ff: - case 0x87ff: - case 0xd800: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 3; - nCps1Layers[3] = 2; - break; - } - - case 0xa000: { - nCps1Layers[0] = 2; - nCps1Layers[1] = 1; - nCps1Layers[2] = 0; - nCps1Layers[3] = 3; - break; - } - - default: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - bprintf(PRINT_IMPORTANT, _T("Unknown value written at 0x98000c %x\n"), d); - } - } - return; - } - - case 0x980020: { - *((UINT16*)(CpsReg + MaskAddr[1])) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980022: { - *((UINT16*)(CpsReg + MaskAddr[2])) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980024: { - *((UINT16*)(CpsReg + MaskAddr[3])) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write word %x, %x\n"), a, d); - } - } -} - -static INT32 KnightsbScanCallback(INT32 nAction, INT32*pnMin) -{ - CpsBootlegSpriteRamScanCallback(nAction, pnMin); - Sf2mdtScanSound(nAction, pnMin); - - return 0; -} - -static INT32 KnightsbInit() -{ - Cps1DisablePSnd = 1; - bCpsUpdatePalEveryFrame = 1; - Cps1OverrideLayers = 1; - Port6SoundWrite = 1; - - Cps1ObjGetCallbackFunction = DinopicObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsRunInitCallbackFunction = Sf2mdtSoundInit; - CpsRunResetCallbackFunction = Sf2mdtSoundReset; - CpsRunExitCallbackFunction = Sf2mdtSoundExit; - CpsRunFrameStartCallbackFunction = Sf2mdtSoundFrameStart; - CpsRunFrameEndCallbackFunction = Sf2mdtSoundFrameEnd; - CpsRWSoundCommandCallbackFunction = Sf2mdtSoundCommand; - CpsMemScanCallbackFunction = Sf2mdtScanSound; - CpsMemScanCallbackFunction = KnightsbScanCallback; - - INT32 nRet = DrvInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, MAP_RAM); - SekMapHandler(1, 0x980000, 0x98ffff, MAP_WRITE); - SekSetWriteWordHandler(1, Knightsb98WriteWord); - SekClose(); - - return nRet; -} - -static INT32 Knightsb2Init() -{ - CpsDrawSpritesInReverse = 1; - Cps1DetectEndSpriteList8000 = 1; - - return DrvInit(); -} - -UINT8 __fastcall KodbInputReadByte(UINT32 a) -{ - switch (a) { - case 0x992000: { - return ~Inp000; - } - - case 0x992001: { - return ~Inp001; - } - - case 0x992008: { - return ~Inp018; - } - - case 0x992009: { - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Read Byte %x\n"), a); - } - } - - return 0; -} - -void __fastcall Kodb98WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x992007: { - PsndSyncZ80((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles); - PsndCode = d; - return; - } - } - - bprintf(PRINT_IMPORTANT, _T("Unknown byte value written at %x %x\n"), a, d); -} - -void __fastcall Kodb98WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x980000: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980002: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d - 0x3e); - return; - } - - case 0x980004: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980006: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d - 0x3c); - return; - } - - case 0x980008: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x98000a: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x98000c: { - *((UINT16*)(CpsReg + nCpsLcReg)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980020: { - *((UINT16*)(CpsReg + MaskAddr[1])) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980022: { - *((UINT16*)(CpsReg + MaskAddr[2])) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x994000: { - // ??? - return; - } - } - - bprintf(PRINT_IMPORTANT, _T("Unknown value written at %x %x\n"), a, d); -} - -static void KodbPatch() -{ - // This fixes sprite ram clearing - shouldn't be necessary, but used for now pending understanding of the underlying issue - CpsRom[0x953] = 0x07; -} - -static INT32 KodbInit() -{ - INT32 nRet = 0; - - Kodb = 1; - bCpsUpdatePalEveryFrame = 1; - CpsDisableRowScroll = 1; - AmendProgRomCallback = KodbPatch; - Cps1GfxLoadCallbackFunction = CpsLoadTilesKodb; - Cps1ObjGetCallbackFunction = KodbObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - - nRet = DrvInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x900000, 0x903fff, MAP_RAM); - SekMapMemory(CpsBootlegSpriteRam, 0x904000, 0x907fff, MAP_RAM); - SekMapHandler(1, 0x980000, 0x99ffff, MAP_WRITE); - SekSetWriteByteHandler(1, Kodb98WriteByte); - SekSetWriteWordHandler(1, Kodb98WriteWord); - SekMapHandler(2, 0x992000, 0x992009, MAP_READ); - SekSetReadByteHandler(2, KodbInputReadByte); - SekClose(); - - Cps1VBlankIRQLine = 4; - - return nRet; -} - -static INT32 KodhInit() -{ - Kodh = 1; - - return DrvInit(); -} - -static INT32 MercsInit() -{ - Cps1DisableBgHi = 1; - - return DrvInit(); -} - -static INT32 Pang3bInit() -{ - PangEEP = 1; - - return TwelveMhzInit(); -} - -static void Pang3Callback() -{ - for (INT32 i = 0x80000; i < 0x100000; i += 2) { - INT32 src = CpsRom[i]; - INT32 dst = src & 0xff00; - if ( src & 0x01) dst ^= 0x04; - if ( src & 0x02) dst ^= 0x21; - if ( src & 0x04) dst ^= 0x01; - if (~src & 0x08) dst ^= 0x50; - if ( src & 0x10) dst ^= 0x40; - if ( src & 0x20) dst ^= 0x06; - if ( src & 0x40) dst ^= 0x08; - if (~src & 0x80) dst ^= 0x88; - CpsRom[i] = (UINT8)dst; - } -} - -static INT32 Pang3Init() -{ - AmendProgRomCallback = Pang3Callback; - - return Pang3bInit(); -} - -static INT32 Pang3r1aInit() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesPang3r1a; - - return Pang3Init(); -} - -static UINT16 PunipicPriorityValue = 0; - -UINT8 __fastcall PunipicF18Read(UINT32) -{ - return 0xff; -} - -void __fastcall Punipic98WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x980000: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980002: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d - 0x46); - return; - } - - case 0x980004: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980006: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x980008: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x98000a: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d - 0x46); - return; - } - - case 0x98000c: { - PunipicPriorityValue = d; - return; - } - - case 0x98000e: { - // layer enable and order appears to be handled by writes here and at 0x98000c - if (d == 0x0000) { - switch (PunipicPriorityValue) { - case 0x24: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 3; - nCps1Layers[3] = 2; - return; - } - - case 0x54:{ - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - return; - } - - case 0x64: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - return; - } - - case 0x7c: { - nCps1Layers[0] = 0; - nCps1Layers[1] = 1; - nCps1Layers[2] = 3; - nCps1Layers[3] = 2; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Unknown PunipicPriorityValue %x when 0x98000e is %x\n"), PunipicPriorityValue, d); - return; - } - } - } - - if (d == 0xffff) { - switch (PunipicPriorityValue) { - case 0x24: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = -1; - nCps1Layers[3] = 3; - return; - } - - case 0x54: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = -1; - return; - } - - case 0x64: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = -1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Unknown PunipicPriorityValue %x when 0x98000e is %x\n"), PunipicPriorityValue, d); - return; - } - } - } - - bprintf(PRINT_NORMAL, _T("Unknown value written to 0x98000e %x\n"), d); - - return; - } - } - - bprintf(PRINT_NORMAL, _T("Write Word %x, %x\n"), a, d); -} - -void __fastcall PunipicFFWriteByte(UINT32 a, UINT8 d) -{ - CpsRamFF[((a & 0xffff) ^ 1)] = d; -} - -void __fastcall PunipicFFWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xff5b30: { - *((UINT16*)(CpsReg + MaskAddr[1])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff5b32: { - *((UINT16*)(CpsReg + MaskAddr[2])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff5b34: { - *((UINT16*)(CpsReg + MaskAddr[3])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff5b8a: { - // scroll 1 ram offset - *((UINT16*)(CpsReg + 0x02)) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff5b8c: { - // scroll 2 ram offset - *((UINT16*)(CpsReg + 0x04)) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff5b8e: { - // scroll 3 ram offset - *((UINT16*)(CpsReg + 0x06)) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - } - - UINT16 *RAM = (UINT16*)CpsRamFF; - RAM[((a & 0xffff) >> 1)] = d; -} - -static INT32 PunipicScanCallback(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(PunipicPriorityValue); - } - - return CpsBootlegSpriteRamScanCallback(nAction, pnMin); -} - -static INT32 PunipicInit() -{ - Cps1DisablePSnd = 1; - bCpsUpdatePalEveryFrame = 1; - Cps1OverrideLayers = 1; - CpsBootlegEEPROM = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesDinopic; - Cps1ObjGetCallbackFunction = DinopicObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsMemScanCallbackFunction = PunipicScanCallback; - - INT32 nRet = TwelveMhzInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, MAP_RAM); - SekMapHandler(1, 0xf18000, 0xf19fff, MAP_READ); - SekSetReadByteHandler(1, PunipicF18Read); - SekMapHandler(2, 0x980000, 0x980fff, MAP_WRITE); - SekSetWriteWordHandler(2, Punipic98WriteWord); - SekMapHandler(3, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(3, PunipicFFWriteByte); - SekSetWriteWordHandler(3, PunipicFFWriteWord); - SekClose(); - - return nRet; -} - -static INT32 PunipicExit() -{ - PunipicPriorityValue = 0; - - return DrvExit(); -} - -static INT32 Punipic2Init() -{ - Cps1DisablePSnd = 1; - bCpsUpdatePalEveryFrame = 1; - Cps1OverrideLayers = 1; - CpsBootlegEEPROM = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesHack160Alt; - Cps1ObjGetCallbackFunction = DinopicObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsMemScanCallbackFunction = PunipicScanCallback; - - INT32 nRet = TwelveMhzInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, MAP_RAM); - SekMapHandler(1, 0xf18000, 0xf19fff, MAP_READ); - SekSetReadByteHandler(1, PunipicF18Read); - SekMapHandler(2, 0x980000, 0x980fff, MAP_WRITE); - SekSetWriteWordHandler(2, Punipic98WriteWord); - SekMapHandler(3, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(3, PunipicFFWriteByte); - SekSetWriteWordHandler(3, PunipicFFWriteWord); - SekClose(); - - return nRet; -} - -static INT32 Punipic3Init() -{ - Cps1DisablePSnd = 1; - bCpsUpdatePalEveryFrame = 1; - Cps1OverrideLayers = 1; - CpsBootlegEEPROM = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesHack160; - Cps1ObjGetCallbackFunction = DinopicObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsMemScanCallbackFunction = PunipicScanCallback; - - INT32 nRet = TwelveMhzInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, MAP_RAM); - SekMapHandler(1, 0xf18000, 0xf19fff, MAP_READ); - SekSetReadByteHandler(1, PunipicF18Read); - SekMapHandler(2, 0x980000, 0x980fff, MAP_WRITE); - SekSetWriteWordHandler(2, Punipic98WriteWord); - SekMapHandler(3, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(3, PunipicFFWriteByte); - SekSetWriteWordHandler(3, PunipicFFWriteWord); - SekClose(); - - return nRet; -} - -static INT32 PunisherbInit() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesPunisherb; - - return TwelveMhzInit(); -} - -static INT32 QadInit() -{ - Cps1DisableBgHi = 1; - - return TwelveMhzInit(); -} - -static INT32 Sf2ebblInit() -{ - INT32 nRet = DrvInit(); - - Cps1LockSpriteList910000 = 1; - - CpsLayer1XOffs = -12; - CpsLayer1YOffs = 1; - CpsLayer2XOffs = -14; - CpsLayer2YOffs = 1; - CpsLayer3XOffs = -16; - CpsLayer3YOffs = 1; - CpsDrawSpritesInReverse = 1; - - return nRet; -} - -static INT32 Sf2ebbl2Init() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2koryu; - - INT32 nRet = DrvInit(); - - Cps1LockSpriteList910000 = 1; - - CpsLayer1XOffs = -12; - CpsLayer2XOffs = -14; - CpsLayer3XOffs = -16; - CpsDrawSpritesInReverse = 1; - - return nRet; -} - -static INT32 Sf2ebbl3Init() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2ebbl3; - - return Sf2ebblInit(); -} - -static INT32 Sf2sttInit() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2stt; - - INT32 nRet = DrvInit(); - - Cps1LockSpriteList910000 = 1; - - CpsLayer1XOffs = -12; - CpsLayer1YOffs = 1; - CpsLayer2XOffs = -14; - CpsLayer2YOffs = 1; - CpsLayer3XOffs = -16; - CpsLayer3YOffs = 1; - CpsDrawSpritesInReverse = 1; - - return nRet; -} - -static INT32 Sf2jcInit() -{ - Cps1DisableBgHi = 1; - - return DrvInit(); -} - -static void Sf2qp1Callback() -{ - UINT8 *TempRom = (UINT8*)BurnMalloc(0x100000); - if (TempRom) { - memcpy(TempRom, CpsRom, 0x100000); - memset(CpsRom, 0, 0x100000); - memcpy(CpsRom + 0x000000, TempRom + 0x000000, 0x40000); - memcpy(CpsRom + 0x0c0000, TempRom + 0x040000, 0x40000); - memcpy(CpsRom + 0x080000, TempRom + 0x080000, 0x40000); - memcpy(CpsRom + 0x040000, TempRom + 0x0c0000, 0x40000); - BurnFree(TempRom); - } -} - -static INT32 Sf2qp1Init() -{ - AmendProgRomCallback = Sf2qp1Callback; - - return DrvInit(); -} - -static INT32 Sf2thndrInit() -{ - Sf2thndr = 1; - - return DrvInit(); -} - -UINT8 __fastcall Sf2bReadByte(UINT32 a) -{ - switch (a) { - case 0x70c000: { - return ~Inp000; - } - - case 0x70c001: { - return ~Inp001; - } - - case 0x70c008: { - return 0xff; - } - - case 0x70c009: { - return ~Inp177; - } - - case 0x70c018: { - return ~Inp018; - } - - case 0x70c01a: { - return ~Cpi01A; - } - - case 0x70c01c: { - return ~Cpi01C; - } - - case 0x70c01e: { - return ~Cpi01E; - } - - default: { - bprintf(PRINT_NORMAL, _T("Read Byte %x\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall Sf2bReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Read Word %x\n"), a); - } - } - - return 0; -} - -void __fastcall Sf2bWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x70c106: { - Sf2mdtSoundCommand(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write Byte %x, %x\n"), a, d); - } - } -} - -void __fastcall Sf2bWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x70810c: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d + 0xffbe); - return; - } - - case 0x70810e: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x708110: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d + 0xffc0); - return; - } - - case 0x708112: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - // update the row scroll start reg here as well - *((UINT16*)(CpsReg + 0x20)) = BURN_ENDIAN_SWAP_INT16(d); - // get the row scroll table address - //*((UINT16*)(CpsReg + 0x08)) = *((UINT16*)(CpsRamFF + 0x8032)); - return; - } - - case 0x708114: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d + 0xffbe); - return; - } - - case 0x708116: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x70814c: { - *((UINT16*)(CpsReg + nCpsLcReg)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x70d000: { - // nop? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write Word %x, %x\n"), a, d); - } - } -} - -static INT32 Sf2mdtScanCallback(INT32, INT32*); - -static INT32 Sf2bInit() -{ - bCpsUpdatePalEveryFrame = 1; - Cps1DisablePSnd = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2mdta; - Cps1ObjGetCallbackFunction = Sf2mdtObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsRunInitCallbackFunction = Sf2mdtSoundInit; - CpsRunResetCallbackFunction = Sf2mdtSoundReset; - CpsRunExitCallbackFunction = Sf2mdtSoundExit; - CpsRunFrameStartCallbackFunction = Sf2mdtSoundFrameStart; - CpsRunFrameEndCallbackFunction = Sf2mdtSoundFrameEnd; - CpsRWSoundCommandCallbackFunction = Sf2mdtSoundCommand; - CpsMemScanCallbackFunction = Sf2mdtScanCallback; - - INT32 nRet = DrvInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x700000, 0x703fff, MAP_RAM); - SekMapMemory(CpsBootlegSpriteRam, 0x704000, 0x707fff, MAP_RAM); // mirror? - SekMapHandler(1, 0x708000, 0x7fffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(1, Sf2bReadByte); - SekSetReadWordHandler(1, Sf2bReadWord); - SekSetWriteByteHandler(1, Sf2bWriteByte); - SekSetWriteWordHandler(1, Sf2bWriteWord); - SekClose(); - - Cps1VBlankIRQLine = 4; // triggers the sprite ram and layer enable/scroll writes at 0x700000 - - return nRet; -} - -static INT32 Sf2b2Init() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2stt; - - return DrvInit(); -} - -static INT32 Sf2ceInit() -{ - nCPS68KClockspeed = 7000000; - - return DrvInit(); -} - -static void Sf2accp2Callback() -{ - // This causes problems in FBA, but is ignored in MAME?? - // 011756: 66FF dc.w $66ff; ILLEGAL - -// *((UINT16*)(CpsRom + 0x11756)) = 0x4e71; -} - -static INT32 Sf2accp2Init() -{ - AmendProgRomCallback = Sf2accp2Callback; - - return Sf2ceInit(); -} - -static INT32 Sf2dkot2Init() -{ - INT32 nRet; - - nRet = Sf2ceInit(); - - SekOpen(0); - SekMapMemory(CpsRom + 0x000000, 0x280000, 0x2fffff, MAP_ROM); - SekMapMemory(CpsRom + 0x080000, 0x200000, 0x27ffff, MAP_ROM); - SekClose(); - - return nRet; -} - -UINT8 __fastcall Sf2rbProtReadByte(UINT32 a) -{ - switch (a) { - case 0x201201: { - return 0x02; - } - - case 0x281201: { - return 0x40; - } - - default: { - bprintf(PRINT_NORMAL, _T("Prot Read Byte %x\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall Sf2rbProtReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Prot Read Word %x\n"), a); - } - } - - return 0; -} - -static void Sf2rbCallback() -{ - BurnByteswap(CpsRom, 0x100000); -} - -static INT32 Sf2rbInit() -{ - AmendProgRomCallback = Sf2rbCallback; - - INT32 nRet = Sf2ceInit(); - - SekOpen(0); - SekMapHandler(1, 0x200000, 0x2fffff, MAP_READ); - SekSetReadByteHandler(1, Sf2rbProtReadByte); - SekSetReadWordHandler(1, Sf2rbProtReadWord); - SekClose(); - - return nRet; -} - -UINT8 __fastcall Sf2rb2ProtReadByte(UINT32 a) -{ - switch (a) { - case 0x201201: { - return 0x00; - } - - case 0x281201: { - return 0x40; - } - - default: { - bprintf(PRINT_NORMAL, _T("Prot Read Byte %x\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall Sf2rb2ProtReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Prot Read Word %x\n"), a); - } - } - - return 0; -} - -static INT32 Sf2rb2Init() -{ - INT32 nRet = Sf2ceInit(); - - SekOpen(0); - SekMapHandler(1, 0x200000, 0x2fffff, MAP_READ); - SekSetReadByteHandler(1, Sf2rb2ProtReadByte); - SekSetReadWordHandler(1, Sf2rb2ProtReadWord); - SekClose(); - - return nRet; -} - -static void Sf2rb6Callback() -{ - UINT8 *pTemp = (UINT8*)BurnMalloc(0x180000); - - if (pTemp) { - memcpy(pTemp, CpsRom, 0x180000); - memcpy(CpsRom + 0x080000, pTemp + 0x000000, 0x40000); - memcpy(CpsRom + 0x140000, pTemp + 0x040000, 0x40000); - memcpy(CpsRom + 0x100000, pTemp + 0x080000, 0x40000); - memcpy(CpsRom + 0x040000, pTemp + 0x0c0000, 0x40000); - memcpy(CpsRom + 0x000000, pTemp + 0x100000, 0x40000); - memcpy(CpsRom + 0x0c0000, pTemp + 0x140000, 0x40000); - BurnFree(pTemp); - } -} - -static INT32 Sf2rb6Init() -{ - AmendProgRomCallback = Sf2rb6Callback; - - return Sf2ceInit(); -} - -static void Sf2yycCallback() -{ - memcpy(CpsRom + 0x140000, CpsRom + 0x100000, 0x40000); -} - -static INT32 Sf2yycInit() -{ - nCpsRomLen = 0x40000; - - Cps1LockSpriteList910000 = 1; - AmendProgRomCallback = Sf2yycCallback; - - CpsLayer1XOffs = -12; - CpsLayer2XOffs = -14; - CpsLayer3XOffs = -16; - CpsDrawSpritesInReverse = 1; - - return Sf2ceInit(); -} - -static INT32 Sf2koryuInit() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2koryu; - - Cps1LockSpriteList910000 = 1; - - CpsLayer1XOffs = -12; - CpsLayer2XOffs = -14; - CpsLayer3XOffs = -16; - CpsDrawSpritesInReverse = 1; - - return Sf2ceInit(); -} - -static INT32 Sf2koryu2Init() -{ - Cps1LockSpriteList910000 = 1; - - CpsLayer1XOffs = -12; - CpsLayer2XOffs = -14; - CpsLayer3XOffs = -16; - CpsDrawSpritesInReverse = 1; - - return Sf2ceInit(); -} - -static INT32 Sf2amfInit() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2koryu; - - return Sf2koryu2Init(); -} - -static INT32 Sf2amf2Init() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2stt; - - return Sf2koryu2Init(); -} - -UINT8 __fastcall Sf2mdtReadByte(UINT32 a) -{ - switch (a) { - case 0x70c000: { - return ~Inp000; - } - - case 0x70c001: { - return ~Inp001; - } - - case 0x70c008: { - return 0xff; - } - - case 0x70c009: { - return ~Inp177; - } - - case 0x70c018: { - return ~Inp018; - } - - case 0x70c01a: { - return ~Cpi01A; - } - - case 0x70c01c: { - return ~Cpi01C; - } - - case 0x70c01e: { - return ~Cpi01E; - } - - default: { - bprintf(PRINT_NORMAL, _T("Read Byte %x\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall Sf2mdtReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Read Word %x\n"), a); - } - } - - return 0; -} - -void __fastcall Sf2mdtWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x70c106: { - Sf2mdtSoundCommand(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write Byte %x, %x\n"), a, d); - } - } -} - -void __fastcall Sf2mdtWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x70810c: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d + 0xffbe); - return; - } - - case 0x70810e: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x708110: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d + 0xffc0); - return; - } - - case 0x708112: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d + 0xffbe); - return; - } - - case 0x708114: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - // update the row scroll start reg here as well - *((UINT16*)(CpsReg + 0x20)) = BURN_ENDIAN_SWAP_INT16(d); - // get the row scroll table address - *((UINT16*)(CpsReg + 0x08)) = *((UINT16*)(CpsRamFF + 0x802e)); - return; - } - - case 0x708116: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x70814c: { - *((UINT16*)(CpsReg + nCpsLcReg)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x70d000: { - // nop? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write Word %x, %x\n"), a, d); - } - } -} - -void __fastcall Sf2mdtaWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x70810c: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d + 0xffbe); - return; - } - - case 0x70810e: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x708110: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d + 0xffbe); - return; - } - - case 0x708112: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - // update the row scroll start reg here as well - *((UINT16*)(CpsReg + 0x20)) = BURN_ENDIAN_SWAP_INT16(d); - // get the row scroll table address - *((UINT16*)(CpsReg + 0x08)) = *((UINT16*)(CpsRamFF + 0x802e)); - return; - } - - case 0x708114: { - // ??? - return; - } - - case 0x708116: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x70814c: { - *((UINT16*)(CpsReg + nCpsLcReg)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x70d000: { - // nop? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write Word %x, %x\n"), a, d); - } - } -} - -static INT32 Sf2mdtScanCallback(INT32 nAction, INT32*pnMin) -{ - CpsBootlegSpriteRamScanCallback(nAction, pnMin); - Sf2mdtScanSound(nAction, pnMin); - - return 0; -} - -static INT32 Sf2mdtInit() -{ - bCpsUpdatePalEveryFrame = 1; - Cps1DisablePSnd = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2mdt; - Cps1ObjGetCallbackFunction = Sf2mdtObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsRunInitCallbackFunction = Sf2mdtSoundInit; - CpsRunResetCallbackFunction = Sf2mdtSoundReset; - CpsRunExitCallbackFunction = Sf2mdtSoundExit; - CpsRunFrameStartCallbackFunction = Sf2mdtSoundFrameStart; - CpsRunFrameEndCallbackFunction = Sf2mdtSoundFrameEnd; - CpsRWSoundCommandCallbackFunction = Sf2mdtSoundCommand; - CpsMemScanCallbackFunction = Sf2mdtScanCallback; - - INT32 nRet = Sf2ceInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x700000, 0x703fff, MAP_RAM); - SekMapMemory(CpsBootlegSpriteRam, 0x704000, 0x707fff, MAP_RAM); // mirror? can use either of this - seems to make no difference - SekMapHandler(1, 0x708000, 0x7fffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(1, Sf2mdtReadByte); - SekSetReadWordHandler(1, Sf2mdtReadWord); - SekSetWriteByteHandler(1, Sf2mdtWriteByte); - SekSetWriteWordHandler(1, Sf2mdtWriteWord); - SekClose(); - - Cps1VBlankIRQLine = 4; // triggers the sprite ram and layer enable/scroll writes at 0x700000 - - return nRet; -} - -static INT32 Sf2mdtaInit() -{ - bCpsUpdatePalEveryFrame = 1; - Cps1DisablePSnd = 1; - CpsLayer2XOffs = 0xffc0; // layer 2 scrolling seems to be taken care of by row scroll tables - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2mdta; - Cps1ObjGetCallbackFunction = Sf2mdtObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsRunInitCallbackFunction = Sf2mdtSoundInit; - CpsRunResetCallbackFunction = Sf2mdtSoundReset; - CpsRunExitCallbackFunction = Sf2mdtSoundExit; - CpsRunFrameStartCallbackFunction = Sf2mdtSoundFrameStart; - CpsRunFrameEndCallbackFunction = Sf2mdtSoundFrameEnd; - CpsRWSoundCommandCallbackFunction = Sf2mdtSoundCommand; - CpsMemScanCallbackFunction = Sf2mdtScanCallback; - - INT32 nRet = Sf2ceInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x700000, 0x703fff, MAP_RAM); - SekMapMemory(CpsBootlegSpriteRam, 0x704000, 0x707fff, MAP_RAM); // mirror? can use either of this - seems to make no difference - SekMapMemory(CpsRamFF, 0xfc0000, 0xfcffff, MAP_RAM); - SekMapHandler(1, 0x708000, 0x7fffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(1, Sf2mdtReadByte); - SekSetReadWordHandler(1, Sf2mdtReadWord); - SekSetWriteByteHandler(1, Sf2mdtWriteByte); - SekSetWriteWordHandler(1, Sf2mdtaWriteWord); - SekClose(); - - Cps1VBlankIRQLine = 4; // triggers the sprite ram and layer enable/scroll writes at 0x700000 - - return nRet; -} - -static INT32 Sf2mdtbInit() -{ - bCpsUpdatePalEveryFrame = 1; - Cps1DisablePSnd = 1; - CpsLayer2XOffs = 0xffc0; // layer 2 scrolling seems to be taken care of by row scroll tables - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2mdt; - Cps1ObjGetCallbackFunction = Sf2mdtObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsRunInitCallbackFunction = Sf2mdtSoundInit; - CpsRunResetCallbackFunction = Sf2mdtSoundReset; - CpsRunExitCallbackFunction = Sf2mdtSoundExit; - CpsRunFrameStartCallbackFunction = Sf2mdtSoundFrameStart; - CpsRunFrameEndCallbackFunction = Sf2mdtSoundFrameEnd; - CpsRWSoundCommandCallbackFunction = Sf2mdtSoundCommand; - CpsMemScanCallbackFunction = Sf2mdtScanCallback; - - INT32 nRet = Sf2ceInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x700000, 0x703fff, MAP_RAM); - SekMapMemory(CpsBootlegSpriteRam, 0x704000, 0x707fff, MAP_RAM); // mirror? can use either of this - seems to make no difference - SekMapMemory(CpsRamFF, 0xfc0000, 0xfcffff, MAP_RAM); - SekMapHandler(1, 0x708000, 0x7fffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(1, Sf2mdtReadByte); - SekSetReadWordHandler(1, Sf2mdtReadWord); - SekSetWriteByteHandler(1, Sf2mdtWriteByte); - SekSetWriteWordHandler(1, Sf2mdtaWriteWord); - SekClose(); - - Cps1VBlankIRQLine = 4; // triggers the sprite ram and layer enable/scroll writes at 0x700000 - - return nRet; -} - -void __fastcall Sf2ceeablScrollWrite(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x980000: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = d; - return; - } - - case 0x980002: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = d - 0x40; - return; - } - - case 0x980004: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = d; - return; - } - - case 0x980006: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = d - 0x3c; - return; - } - - case 0x980008: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = d; - return; - } - - case 0x98000a: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = d - 0x40; - return; - } - - case 0x98000c: { - // This seems to control layer order and enable - switch (d) { - case 0x00: { - nCps1Layers[0] = 0; - nCps1Layers[1] = 1; - nCps1Layers[2] = 3; - nCps1Layers[3] = 2; - break; - } - - case 0x01: { - nCps1Layers[0] = 0; - nCps1Layers[1] = 3; - nCps1Layers[2] = 2; - nCps1Layers[3] = 1; - break; - } - - case 0x02: { - nCps1Layers[0] = 0; - nCps1Layers[1] = 1; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - break; - } - - case 0x03: { - nCps1Layers[0] = 0; - nCps1Layers[1] = 2; - nCps1Layers[2] = 1; - nCps1Layers[3] = 3; - break; - } - - case 0x04: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - break; - } - - case 0x05: { - nCps1Layers[0] = 0; - nCps1Layers[1] = 2; - nCps1Layers[2] = 3; - nCps1Layers[3] = 1; - break; - } - - default: { - nCps1Layers[0] = 0; - nCps1Layers[1] = 3; - nCps1Layers[2] = 2; - nCps1Layers[3] = 1; - bprintf(PRINT_IMPORTANT, _T("Unknown value written at 0x98000c %x\n"), d); - } - } - return; - } - - case 0x980016: { - // scroll3 ram offset - *((UINT16*)(CpsReg + 0x06)) = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write Word %x, %x\n"), a, d); - } - } -} - -static INT32 Sf2ceeab2Init() -{ - Port6SoundWrite = 1; - bCpsUpdatePalEveryFrame = 1; - Cps1OverrideLayers = 1; - Cps1ObjGetCallbackFunction = DinopicObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - - INT32 nRet = Sf2ceInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, MAP_RAM); - SekMapHandler(1, 0x980000, 0x980fff, MAP_WRITE); - SekSetWriteWordHandler(1, Sf2ceeablScrollWrite); - SekClose(); - - return nRet; -} - -static INT32 Sf2ceeablInit() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2ceeabl; - - return Sf2ceeab2Init(); -} - -static INT32 Sf2cejablInit() -{ - CpsLayer1XOffs = -12; - CpsLayer2XOffs = -14; - CpsLayer3XOffs = -16; - CpsDrawSpritesInReverse = 1; - - return Sf2ceInit(); -} - -UINT8 __fastcall Sf2ceuablReadByte(UINT32 a) -{ - UINT8 d = 0xff; - - switch (a) { - case 0x800010: { - d = (UINT8)~Inp010; - return d; - } - - case 0x800011: { - d = (UINT8)~Inp011; - return d; - } - - case 0x800029: { - d = (UINT8)~Inp029; - return d; - } - - case 0x800186: { - d = (UINT8)~Inp186; - return d; - } - - case 0x80002a: { - d = (UINT8)~Cpi01A; - return d; - } - - case 0x80002c: { - d = (UINT8)~Cpi01C; - return d; - } - - case 0x80002e: { - d = (UINT8)~Cpi01E; - return d; - } - } - -// bprintf(PRINT_NORMAL, _T("Read byte %x\n"), a); - - return 0; -} - -void __fastcall Sf2ceuablWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x800191: { - PsndSyncZ80((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles); - - PsndCode = d; - return; - } - } - -// bprintf(PRINT_NORMAL, _T("Write byte %x, %x\n"), a, d); -} - -void __fastcall Sf2ceuablWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x800100: { - CpsReg[0x00] = d & 0xff; - CpsReg[0x01] = d >> 8; - return; - } - - case 0x800102: { - CpsReg[0x02] = d & 0xff; - CpsReg[0x03] = d >> 8; - return; - } - - case 0x800104: { - CpsReg[0x04] = d & 0xff; - CpsReg[0x05] = d >> 8; - return; - } - - case 0x800106: { - CpsReg[0x06] = d & 0xff; - CpsReg[0x07] = d >> 8; - return; - } - - case 0x80010a: { - CpsReg[0x0a] = d & 0xff; - CpsReg[0x0b] = d >> 8; - - GetPalette(0, 6); - CpsPalUpdate(CpsSavePal); - return; - } - - case 0x800122: { - CpsReg[0x22] = d & 0xff; - CpsReg[0x23] = d >> 8; - return; - } - - case 0x80014a: { - CpsReg[0x4a] = d & 0xff; - CpsReg[0x4b] = d >> 8; - return; - } - - case 0x80014c: { - CpsReg[0x4c] = d & 0xff; - CpsReg[0x4d] = d >> 8; - return; - } - - case 0x80014e: { - CpsReg[0x4e] = d & 0xff; - CpsReg[0x4f] = d >> 8; - return; - } - - case 0x800150: { - CpsReg[0x50] = d & 0xff; - CpsReg[0x51] = d >> 8; - return; - } - - case 0x800152: { - CpsReg[0x52] = d & 0xff; - CpsReg[0x53] = d >> 8; - return; - } - - case 0x8001a8: { - CpsReg[0x08] = d & 0xff; - CpsReg[0x09] = d >> 8; - return; - } - - case 0x8001ac: { - CpsReg[0x0c] = d & 0xff; - CpsReg[0x0d] = d >> 8; - return; - } - - case 0x8001ae: { - CpsReg[0x0e] = d & 0xff; - CpsReg[0x0f] = d >> 8; - return; - } - - case 0x8001b0: { - CpsReg[0x10] = d & 0xff; - CpsReg[0x11] = d >> 8; - return; - } - - case 0x8001b2: { - CpsReg[0x12] = d & 0xff; - CpsReg[0x13] = d >> 8; - return; - } - - case 0x8001b4: { - CpsReg[0x14] = d & 0xff; - CpsReg[0x15] = d >> 8; - return; - } - - case 0x8001b6: { - CpsReg[0x16] = d & 0xff; - CpsReg[0x17] = d >> 8; - return; - } - - case 0x8001c0: { - CpsReg[0x20] = d & 0xff; - CpsReg[0x21] = d >> 8; - return; - } - - case 0x8001c4: { - CpsReg[0xc4] = d & 0xff; - CpsReg[0xc5] = d >> 8; - return; - } - } - -// bprintf(PRINT_NORMAL, _T("Write word %x, %x\n"), a, d); -} - -static INT32 Sf2ceuablInit() -{ - INT32 nRet = 0; - - CpsLayer1XOffs = -16; - CpsLayer2XOffs = -16; - CpsLayer3XOffs = -16; - CpsDrawSpritesInReverse = 1; - - nRet = Sf2ceInit(); - - SekOpen(0); - SekMapHandler(1, 0x800000, 0x800200, MAP_RAM); - SekSetReadByteHandler(1, Sf2ceuablReadByte); - SekSetWriteByteHandler(1, Sf2ceuablWriteByte); - SekSetWriteWordHandler(1, Sf2ceuablWriteWord); - - SekClose(); - - return nRet; -} - -static INT32 Sf2ceuab2Init() -{ - Scroll1TileMask = 0x4fff; - Scroll3TileMask = 0x1fff; - - return Sf2ceuablInit(); -} - -static INT32 Sf2ceuab3Init() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2ceuab3; - - return Sf2ceuablInit(); -} - -static INT32 Sf2ceuab4Init() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2koryu; - - return Sf2ceuablInit(); -} - -static void Sf2ceuab6Callback() -{ - memcpy(CpsRom + 0x0c0000, CpsRom + 0x140000, 0x40000); -} - -static INT32 Sf2ceuab6Init() -{ - AmendProgRomCallback = Sf2ceuab6Callback; - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2ceeabl; - - return Sf2ceInit(); -} - -static UINT16 Sf2ceuab7ProtValue = 0; - -UINT16 __fastcall Sf2ceuab7ProtReadWord(UINT32 a) -{ - switch (a) { - case 0x5762b0: { - return 0; - } - - case 0x57a2b0: { - if (Sf2ceuab7ProtValue == 0x00) return 0x1992; - if (Sf2ceuab7ProtValue == 0x04) return 0x0408; - return 0xffff; - } - } - - return 0; -} - -void __fastcall Sf2ceuab7ProtWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x5762b0: { - Sf2ceuab7ProtValue = d; - return; - } - } -} - -static INT32 Sf2ceuab7Init() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2ceuab7; - - INT32 nRet = Sf2ceInit(); - - SekOpen(0); - SekMapHandler(1, 0x570000, 0x57ffff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(1, Sf2ceuab7ProtReadWord); - SekSetWriteWordHandler(1, Sf2ceuab7ProtWriteWord); - SekClose(); - - return nRet; -} - -static UINT16 Sf2ceuab8E00000Value = 0; -static UINT16 Sf2ceuab8E00004Value = 0; - -UINT16 __fastcall Sf2ceuab8ReadWord(UINT32 a) -{ - if (a == 0xe00000) return Sf2ceuab8E00000Value; - if (a == 0xe00004) return Sf2ceuab8E00004Value; - - return 0; -} - -void __fastcall Sf2ceuab8WriteWord(UINT32 a, UINT16 d) -{ - if (a == 0xe00000) Sf2ceuab8E00000Value = d; - if (a == 0xe00004) Sf2ceuab8E00004Value = d; -} - -static INT32 Sf2ceuab8Init() -{ - Cps1GfxLoadCallbackFunction = CpsLoadTilesSf2koryu; - CpsDrawSpritesInReverse = 1; - CpsLayer1XOffs = -0x10; - CpsLayer2XOffs = 0xffc0; - CpsLayer3XOffs = -0x10; - - INT32 nRet = Sf2ceInit(); - - SekOpen(0); - SekMapHandler(1, 0xe00000, 0xe0ffff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(1, Sf2ceuab8ReadWord); - SekSetWriteWordHandler(1, Sf2ceuab8WriteWord); - SekMapMemory(CpsRamFF, 0xef0000, 0xefffff, MAP_RAM); - SekMapMemory(CpsRamFF, 0xfe0000, 0xfeffff, MAP_RAM); - SekClose(); - - return nRet; -} - -static INT32 Sf2ceuab9Init() -{ - CpsDrawSpritesInReverse = 1; - CpsLayer1XOffs = -0x10; - CpsLayer2XOffs = 0xffc0; - CpsLayer3XOffs = -0x10; - - INT32 nRet = Sf2ceInit(); - - SekOpen(0); - SekMapHandler(1, 0xe00000, 0xe0ffff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(1, Sf2ceuab8ReadWord); - SekSetWriteWordHandler(1, Sf2ceuab8WriteWord); - SekMapMemory(CpsRamFF, 0xef0000, 0xefffff, MAP_RAM); - SekMapMemory(CpsRamFF, 0xfe0000, 0xfeffff, MAP_RAM); - SekClose(); - - return nRet; -} - -static void Sf2ceucblCallback() -{ - memcpy(CpsRom + 0x000000, CpsRom + 0x180000, 0x40000); - memcpy(CpsRom + 0x080000, CpsRom + 0x1c0000, 0x40000); - memcpy(CpsRom + 0x100000, CpsRom + 0x200000, 0x40000); -} - -static INT32 Sf2ceucblInit() -{ - AmendProgRomCallback = Sf2ceucblCallback; - - return Sf2ceInit(); -} - -UINT8 __fastcall Sf2dongbProtReadByte(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Prot Read Byte %x\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall Sf2dongbProtReadWord(UINT32 a) -{ - switch (a) { - case 0x180000: { - return 0x0200; - } - - case 0x1f7040: { - return 0x0210; - } - - default: { - bprintf(PRINT_NORMAL, _T("Prot Read Word %x\n"), a); - } - } - - return 0; -} - -static INT32 Sf2dongbInit() -{ - INT32 nRet = Sf2ceInit(); - - SekOpen(0); - SekMapHandler(1, 0x180000, 0x1fffff, MAP_READ); - SekSetReadByteHandler(1, Sf2dongbProtReadByte); - SekSetReadWordHandler(1, Sf2dongbProtReadWord); - SekClose(); - - return nRet; -} - -static INT32 Sf2bhhInit() -{ - AmendProgRomCallback = Sf2qp1Callback; - - return Sf2ceInit(); -} - -static void Sf2hfubCallback() -{ - UINT8 *pTemp = (UINT8*)BurnMalloc(0x40000); - - if (pTemp) { - memcpy(pTemp, CpsRom + 0xc0000, 0x40000); - memcpy(CpsRom + 0xc0000, CpsRom + 0x140000, 0x40000); - memcpy(CpsRom + 0x140000, pTemp, 0x40000); - BurnFree(pTemp); - } -} - -static INT32 Sf2hfubInit() -{ - AmendProgRomCallback = Sf2hfubCallback; - - return Sf2ceInit(); -} - -void __fastcall Sf2hfjbWriteByte(UINT32 a, UINT8 d) -{ - CpsWritePort(a & 0x1ff, d); -} - -void __fastcall Sf2hfjbWriteWord(UINT32 a, UINT16 d) -{ - if (a == 0x800124) { - // row scroll start register moved in this set - *((UINT16*)(CpsReg + 0x20)) = d; - return; - } - - SEK_DEF_WRITE_WORD(1, a, d); -} - -static INT32 Sf2hfjbInit() -{ - CpsLayer1XOffs = -12; - CpsLayer2XOffs = -14; - CpsLayer3XOffs = -16; - CpsDrawSpritesInReverse = 1; - - INT32 nRet = Sf2ceInit(); - - SekOpen(0); - SekMapHandler(1, 0x800000, 0x807fff, MAP_WRITE); - SekSetWriteByteHandler(1, Sf2hfjbWriteByte); - SekSetWriteWordHandler(1, Sf2hfjbWriteWord); - SekClose(); - - return nRet; -} - -static INT32 SfzchInit() -{ - INT32 nRet = 0; - - nRet = TwelveMhzInit(); - - Cps = 3; - - return nRet; -} - -UINT8 __fastcall SlampicF18Read(UINT32) -{ - return 0xff; -} - -void __fastcall SlampicScrollWrite(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x980000: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980002: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x980004: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980006: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x980008: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x98000a: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x98000c: { - // scroll 2 ram offset - *((UINT16*)(CpsReg + 0x04)) = BURN_ENDIAN_SWAP_INT16(d << 4); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write Word %x, %x\n"), a, d); - } - } -} - -void __fastcall SlampicFFWriteByte(UINT32 a, UINT8 d) -{ - CpsRamFF[((a & 0xffff) ^ 1)] = d; -} - -void __fastcall SlampicFFWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xff8d74: { - *((UINT16*)(CpsReg + MaskAddr[1])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff8d76: { - *((UINT16*)(CpsReg + MaskAddr[2])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff8d78: { - *((UINT16*)(CpsReg + MaskAddr[3])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - } - - UINT16 *RAM = (UINT16*)CpsRamFF; - RAM[((a & 0xffff) >> 1)] = d; -} - -static INT32 SlampicInit() -{ - INT32 nRet = 0; - - Cps1DisablePSnd = 1; - CpsBootlegEEPROM = 1; - bCpsUpdatePalEveryFrame = 1; - Cps1GfxLoadCallbackFunction = CpsLoadTilesSlampic; - Cps1ObjGetCallbackFunction = Sf2mdtObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsMemScanCallbackFunction = CpsBootlegSpriteRamScanCallback; - - nRet = TwelveMhzInit(); - - for (INT32 i = 0x7fff; i >= 0; i--) { - CpsZRom[(i << 1) + 0] = CpsZRom[i]; - CpsZRom[(i << 1) + 1] = 0xff; - } - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsZRom, 0xf00000, 0xf0ffff, MAP_ROM); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, MAP_RAM); - SekMapHandler(1, 0xf18000, 0xf19fff, MAP_READ); - SekSetReadByteHandler(1, SlampicF18Read); - SekMapHandler(2, 0xf1e000, 0xf1ffff, MAP_READ); - SekSetReadByteHandler(2, SlampicF18Read); - SekMapHandler(3, 0x980000, 0x980fff, MAP_WRITE); - SekSetWriteWordHandler(3, SlampicScrollWrite); - SekMapHandler(4, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(4, SlampicFFWriteByte); - SekSetWriteWordHandler(4, SlampicFFWriteWord); - SekClose(); - - return nRet; -} - -static INT32 StriderInit() -{ - INT32 nRet = 0; - - nRet = DrvInit(); - - CpsStar = CpsGfx + nCpsGfxLen - 0x2000; - - CpsLoadStars(CpsStar, 5); - - return nRet; -} - -static INT32 StriderjrInit() -{ - INT32 nRet = 0; - - nRet = TwelveMhzInit(); - - CpsStar = CpsGfx + nCpsGfxLen - 0x2000; - - CpsLoadStars(CpsStar, 2); - - return nRet; -} - -static INT32 StriderjInit() -{ - INT32 nRet = 0; - - nRet = DrvInit(); - - CpsStar = CpsGfx + nCpsGfxLen - 0x2000; - - CpsLoadStarsByte(CpsStar, 8); - - return nRet; -} - -void __fastcall VarthbScrollWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x980000: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980002: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x980004: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980006: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - case 0x980008: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x98000a: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d - 0x40); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write Word %x, %x\n"), a, d); - } - } -} - -void __fastcall VarthbRegWriteByte(UINT32 a, UINT8 d) -{ - CpsWritePort(a & 0x1ff, d); -} - -void __fastcall VarthbRegWriteWord(UINT32 a, UINT16 d) -{ - if (a == 0x800188) { - if (d > 0x9000) { - // scroll 3 ram offset - *((UINT16*)(CpsReg + 0x06)) = d; - return; - } // sound fade command written through CpsWritePort - } - - SEK_DEF_WRITE_WORD(2, a, d); -} - -static INT32 VarthbInit() -{ - INT32 nRet = 0; - - Port6SoundWrite = 1; - Cps1ObjGetCallbackFunction = DinopicObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsMemScanCallbackFunction = CpsBootlegSpriteRamScanCallback; - - nRet = TwelveMhzInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, MAP_RAM); - SekMapHandler(1, 0x980000, 0x980fff, MAP_WRITE); - SekSetWriteWordHandler(1, VarthbScrollWriteWord); - SekMapHandler(2, 0x800000, 0x807fff, MAP_WRITE); - SekSetWriteByteHandler(2, VarthbRegWriteByte); - SekSetWriteWordHandler(2, VarthbRegWriteWord); - SekClose(); - - return nRet; -} - -static INT32 WofchInit() -{ - INT32 nRet = 0; - - Cps1Qs = 1; - - nRet = TwelveMhzInit(); - - Cps = 3; - - return nRet; -} - -static UINT8 WofhProtValue; - -UINT8 __fastcall Wofh135ReadByte(UINT32) -{ - return 0xff; -} - -UINT16 __fastcall Wofh135ReadWord(UINT32) -{ - return 0xffff; -} - -UINT8 __fastcall WofhInputReadByte(UINT32 a) -{ - switch (a) { - case 0x880000: { - return ~Inp000; - } - - case 0x880001: { - return ~Inp001; - } - - case 0x880006: { - return ~Inp018; - } - - case 0x880007: { - return ~Inp177; - } - - case 0x880008: { - return ~Cpi01A; - } - - case 0x88000a: { - return ~Cpi01C; - } - - case 0x88000c: { - return ~Cpi01E; - } - - case 0x880e78: { - return WofhProtValue; // protection - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Read Byte %x\n"), a); - } - } - - return 0x00; -} - -UINT16 __fastcall WofhInputReadWord(UINT32 a) -{ - SEK_DEF_READ_WORD(3, a); -} - -void __fastcall WofhInputWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x88000e: { - PsndSyncZ80((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles); - - PsndCode = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Write Byte %x, %x\n"), a, d); - } - } -} - -void __fastcall WofhInputWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x88000e: { - PsndSyncZ80((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles); - - PsndCode = d & 0xff; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Write word %x, %x\n"), a, d); - } - } -} - -void __fastcall WofbFFWriteByte(UINT32 a, UINT8 d) -{ - CpsRamFF[((a & 0xffff) ^ 1)] = d; -} - -void __fastcall WofbFFWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xff639a: { - *((UINT16*)(CpsReg + MaskAddr[1])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff639c: { - *((UINT16*)(CpsReg + MaskAddr[2])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - - case 0xff639e: { - *((UINT16*)(CpsReg + MaskAddr[3])) = BURN_ENDIAN_SWAP_INT16(d); - break; - } - } - - UINT16 *RAM = (UINT16*)CpsRamFF; - RAM[((a & 0xffff) >> 1)] = d; -} - -static INT32 WofhInit() -{ - INT32 nRet = 0; - - WofhProtValue = 0xD0; - - bCpsUpdatePalEveryFrame = 1; - CpsLayer1XOffs = 0xffc0; - CpsLayer2XOffs = 0xffc0; - CpsLayer3XOffs = 0xffc0; - Cps1GfxLoadCallbackFunction = CpsLoadTilesHack160; - Cps1ObjGetCallbackFunction = WofhObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - - nRet = TwelveMhzInit(); - - SekOpen(0); - SekMapHandler(3, 0x880000, 0x89ffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(3, WofhInputReadByte); - SekSetReadWordHandler(3, WofhInputReadWord); - SekSetWriteByteHandler(3, WofhInputWriteByte); - SekSetWriteWordHandler(3, WofhInputWriteWord); - SekMapHandler(4, 0x135000, 0x135fff, MAP_READ); - SekSetReadByteHandler(4, Wofh135ReadByte); - SekSetReadWordHandler(4, Wofh135ReadWord); - SekMapHandler(5, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(5, WofbFFWriteByte); - SekSetWriteWordHandler(5, WofbFFWriteWord); - SekClose(); - - return nRet; -} - -static void SgyxzPatch() -{ - // This fixes sprite ram clearing - shouldn't be necessary, but used for now pending understanding of the underlying issue - CpsRom[0x2449] = 0x07; -} - -static void SgyxzCallback() -{ - UINT8 *pTemp = (UINT8*)BurnMalloc(0x40000); - - if (pTemp) { - memcpy(pTemp , CpsRom + 0x40000, 0x40000); - memcpy(CpsRom + 0x40000, CpsRom + 0x80000, 0x40000); - memcpy(CpsRom + 0x80000, pTemp , 0x40000); - BurnFree(pTemp); - } - - SgyxzPatch(); -} - -static void __fastcall SgyxzSpriteRamWriteLong(UINT32 a, UINT32 d) -{ - if (d == 0xffffffff) d = 0xefffefff; // Strange protection or glitch??? - - *((UINT32*)(CpsRam90 + (a & 0x3fffc))) = (d << 16) | (d >> 16); -} - -static INT32 SgyxzInit() -{ - INT32 nRet = 0; - - WofhProtValue = 0xD0; - - bCpsUpdatePalEveryFrame = 1; - CpsLayer1XOffs = 0xffc0; - CpsLayer2XOffs = 0xffc0; - CpsLayer3XOffs = 0xffc0; - Cps1GfxLoadCallbackFunction = CpsLoadTilesHack160; - AmendProgRomCallback = SgyxzCallback; - Cps1ObjGetCallbackFunction = WofhObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - - nRet = TwelveMhzInit(); - - SekOpen(0); - SekMapHandler(3, 0x880000, 0x89ffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(3, WofhInputReadByte); - SekSetReadWordHandler(3, WofhInputReadWord); - SekSetWriteByteHandler(3, WofhInputWriteByte); - SekSetWriteWordHandler(3, WofhInputWriteWord); - SekMapHandler(4, 0x135000, 0x135fff, MAP_READ); - SekSetReadByteHandler(4, Wofh135ReadByte); - SekSetReadWordHandler(4, Wofh135ReadWord); - SekMapHandler(5, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(5, WofbFFWriteByte); - SekSetWriteWordHandler(5, WofbFFWriteWord); - SekMapHandler(6, 0x900000, 0x9007FF, MAP_WRITE); - SekSetWriteLongHandler(6, SgyxzSpriteRamWriteLong); - SekClose(); - - return nRet; -} - -static void Wof3jsCallback() -{ - memcpy(CpsRom + 0x0c0000, CpsRom + 0x100000, 0x40000); - memset(CpsRom + 0x100000, 0, 0x40000); -} - -static INT32 Wof3jsInit() -{ - AmendProgRomCallback = Wof3jsCallback; - - return TwelveMhzInit(); -} - -static INT32 Wof3jsaInit() -{ - AmendProgRomCallback = SgyxzCallback; - - WofhProtValue = 0x50; - - bCpsUpdatePalEveryFrame = 1; - CpsLayer1XOffs = 0xffc0; - CpsLayer2XOffs = 0xffc0; - CpsLayer3XOffs = 0xffc0; - Cps1GfxLoadCallbackFunction = CpsLoadTilesHack160; - Cps1ObjGetCallbackFunction = WofhObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - - INT32 nRet = TwelveMhzInit(); - - SekOpen(0); - SekMapHandler(3, 0x880000, 0x89ffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(3, WofhInputReadByte); - SekSetReadWordHandler(3, WofhInputReadWord); - SekSetWriteByteHandler(3, WofhInputWriteByte); - SekSetWriteWordHandler(3, WofhInputWriteWord); - SekMapHandler(4, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(4, WofbFFWriteByte); - SekSetWriteWordHandler(4, WofbFFWriteWord); - SekClose(); - - return nRet; -} - -UINT8 __fastcall Wof3sjInputReadByte(UINT32 a) -{ - switch (a) { - case 0x880000: { - return ~Inp000; - } - - case 0x880001: { - return ~Inp001; - } - - case 0x880008: { - return ~Inp018; - } - - case 0x880009: { - return ~Inp177; - } - - case 0x88000a: { - return ~Cpi01A; - } - - case 0x88000c: { - return ~Cpi01C; - } - - case 0x88000e: { - return ~Cpi01E; - } - - case 0x880c1e: { - return 0xff; - } - - case 0x880e7e: { - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Read Byte %x\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall Wof3sjInputReadWord(UINT32 a) -{ - SEK_DEF_READ_WORD(3, a); -} - -void __fastcall Wof3sjInputWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x880006: { - PsndSyncZ80((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles); - - PsndCode = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Write Byte %x, %x\n"), a, d); - } - } -} - -void __fastcall Wof3sjInputWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x880006: { - PsndSyncZ80((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles); - - PsndCode = d & 0xff; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Input Write word %x, %x\n"), a, d); - } - } -} - -static INT32 Wof3sjInit() -{ - bCpsUpdatePalEveryFrame = 1; - CpsLayer1XOffs = 0xffc0; - CpsLayer2XOffs = 0xffc0; - CpsLayer3XOffs = 0xffc0; - Cps1GfxLoadCallbackFunction = CpsLoadTilesHack160; - Cps1ObjGetCallbackFunction = WofhObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - - INT32 nRet = TwelveMhzInit(); - - SekOpen(0); - SekMapHandler(3, 0x880000, 0x89ffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(3, Wof3sjInputReadByte); - SekSetReadWordHandler(3, Wof3sjInputReadWord); - SekSetWriteByteHandler(3, Wof3sjInputWriteByte); - SekSetWriteWordHandler(3, Wof3sjInputWriteWord); - SekMapHandler(4, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(4, WofbFFWriteByte); - SekSetWriteWordHandler(4, WofbFFWriteWord); - SekClose(); - - return nRet; -} - -static INT32 WofsjInit() -{ - bCpsUpdatePalEveryFrame = 1; - CpsLayer1XOffs = 0xffc0; - CpsLayer2XOffs = 0xffc0; - CpsLayer3XOffs = 0xffc0; - - Cps1ObjGetCallbackFunction = WofhObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - - INT32 nRet = TwelveMhzInit(); - - SekOpen(0); - SekMapHandler(3, 0x880000, 0x89ffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(3, Wof3sjInputReadByte); - SekSetReadWordHandler(3, Wof3sjInputReadWord); - SekSetWriteByteHandler(3, Wof3sjInputWriteByte); - SekSetWriteWordHandler(3, Wof3sjInputWriteWord); - SekMapHandler(4, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(4, WofbFFWriteByte); - SekSetWriteWordHandler(4, WofbFFWriteWord); - SekClose(); - - return nRet; -} - -static INT32 WofsjbInit() -{ - CpsLayer1XOffs = 2; - CpsLayer2XOffs = 4; - CpsLayer3XOffs = 8; - - Cps1DisablePSnd = 1; - - return TwelveMhzInit(); -} - -void __fastcall Wofb98WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x980000: { - // scroll1 y - *((UINT16*)(CpsReg + 0x0e)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980002: { - // scroll1 x - *((UINT16*)(CpsReg + 0x0c)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980004: { - // scroll2 y - *((UINT16*)(CpsReg + 0x12)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980006: { - // scroll2 x - *((UINT16*)(CpsReg + 0x10)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x980008: { - // scroll3 y - *((UINT16*)(CpsReg + 0x16)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x98000a: { - // scroll3 x - *((UINT16*)(CpsReg + 0x14)) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x98000c: { - switch (d) { - case 0x00: - case 0x04: - case 0x06: - case 0x08: - case 0x0a: - case 0x0b: - case 0x0e: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - break; - } - - case 0x01: - case 0x05: - case 0x0f: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 3; - nCps1Layers[3] = 2; - break; - } - - case 0x03: - case 0x07: - case 0x09: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 3; - nCps1Layers[2] = 0; - nCps1Layers[3] = 2; - break; - } - - default: { - nCps1Layers[0] = 1; - nCps1Layers[1] = 0; - nCps1Layers[2] = 2; - nCps1Layers[3] = 3; - bprintf(PRINT_IMPORTANT, _T("Unknown value written at 0x98000c %x\n"), d); - } - } - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write word %x, %x\n"), a, d); - } - } -} - -static INT32 WofbInit() -{ - bCpsUpdatePalEveryFrame = 1; - Cps1OverrideLayers = 1; - Port6SoundWrite = 1; - CpsBootlegEEPROM = 1; - CpsLayer1XOffs = 0xffc0; - CpsLayer2XOffs = 0xffc0; - CpsLayer3XOffs = 0xffc0; - Cps1GfxLoadCallbackFunction = CpsLoadTilesDinopic; - Cps1ObjGetCallbackFunction = DinopicObjGet; - Cps1ObjDrawCallbackFunction = FcrashObjDraw; - CpsMemScanCallbackFunction = CpsBootlegSpriteRamScanCallback; - - INT32 nRet = TwelveMhzInit(); - - CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000); - - SekOpen(0); - SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, MAP_RAM); - SekMapHandler(1, 0x980000, 0x98ffff, MAP_WRITE); - SekSetWriteWordHandler(1, Wofb98WriteWord); - SekMapHandler(2, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(2, WofbFFWriteByte); - SekSetWriteWordHandler(2, WofbFFWriteWord); - SekClose(); - - // scroll3 ram offset - *((UINT16*)(CpsReg + 0x06)) = BURN_ENDIAN_SWAP_INT16(0x9100); - - return nRet; -} - -// Driver Definitions - -struct BurnDriver BurnDrvCps1941 = { - "1941", NULL, NULL, NULL, "1990", - "1941 - Counter Attack (900227 World)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, FBF_19XX, - NULL, NTFODrvRomInfo, NTFODrvRomName, NULL, NULL, NTFOInputInfo, NTFODIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps1941r1 = { - "1941r1", "1941", NULL, NULL, "1990", - "1941 - Counter Attack (World)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, FBF_19XX, - NULL, NTFOR1DrvRomInfo, NTFOR1DrvRomName, NULL, NULL, NTFOInputInfo, NTFODIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps1941u = { - "1941u", "1941", NULL, NULL, "1990", - "1941 - Counter Attack (900227 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, FBF_19XX, - NULL, NTFOUDrvRomInfo, NTFOUDrvRomName, NULL, NULL, NTFOInputInfo, NTFODIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps1941j = { - "1941j", "1941", NULL, NULL, "1990", - "1941 - Counter Attack (Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, FBF_19XX, - NULL, NTFOJDrvRomInfo, NTFOJDrvRomName, NULL, NULL, NTFOInputInfo, NTFODIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps3wonders = { - "3wonders", NULL, NULL, NULL, "1991", - "Three Wonders (wonder 3 910520 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_MINIGAMES, 0, - NULL, ThreeWondersRomInfo, ThreeWondersRomName, NULL, NULL, ThreeWondersInputInfo, ThreeWondersDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCps3wondersr1 = { - "3wondersr1", "3wonders", NULL, NULL, "1991", - "Three Wonders (wonder 3 910513 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_MINIGAMES, 0, - NULL, ThreeWondersr1RomInfo, ThreeWondersr1RomName, NULL, NULL, ThreeWondersInputInfo, ThreeWondersDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCps3wondersu = { - "3wondersu", "3wonders", NULL, NULL, "1991", - "Three Wonders (wonder 3 910520 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_MINIGAMES, 0, - NULL, Wonder3uRomInfo, Wonder3uRomName, NULL, NULL, ThreeWondersInputInfo, ThreeWondersDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWonder3 = { - "wonder3", "3wonders", NULL, NULL, "1991", - "Wonder 3 (910520 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_MINIGAMES, 0, - NULL, Wonder3RomInfo, Wonder3RomName, NULL, NULL, ThreeWondersInputInfo, ThreeWondersDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCps3wondersh = { - "3wondersh", "3wonders", NULL, NULL, "1991", - "Three Wonders (bootleg set 1, wonder 3 910520 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_MINIGAMES, 0, - NULL, Wonder3hRomInfo, Wonder3hRomName, NULL, NULL, ThreeWondersInputInfo, ThreeWondersDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCps3wondersha = { - "3wondersha", "3wonders", NULL, NULL, "1991", - "Three Wonders (bootleg set 3, wonder 3 910520 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_MINIGAMES, 0, - NULL, Wonder3haRomInfo, Wonder3haRomName, NULL, NULL, ThreeWondersInputInfo, ThreeWondersDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCps3wondersb = { - "3wondersb", "3wonders", NULL, NULL, "1991", - "Three Wonders (bootleg set 2, wonder 3 910520 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_MINIGAMES, 0, - NULL, Wonder3bRomInfo, Wonder3bRomName, NULL, NULL, ThreeWondersInputInfo, ThreeWondersDIPInfo, - Wonder3bInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCaptcomm = { - "captcomm", NULL, NULL, NULL, "1991", - "Captain Commando (911202 other country)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, CaptcommRomInfo, CaptcommRomName, NULL, NULL, CaptcommInputInfo, CaptcommDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCaptcommr1 = { - "captcommr1", "captcomm", NULL, NULL, "1991", - "Captain Commando (911014 other country)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Captcommr1RomInfo, Captcommr1RomName, NULL, NULL, CaptcommInputInfo, CaptcommDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCaptcommu = { - "captcommu", "captcomm", NULL, NULL, "1991", - "Captain Commando (910928 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, CaptcommuRomInfo, CaptcommuRomName, NULL, NULL, CaptcommInputInfo, CaptcommDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCaptcommj = { - "captcommj", "captcomm", NULL, NULL, "1991", - "Captain Commando (911202 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, CaptcommjRomInfo, CaptcommjRomName, NULL, NULL, CaptcommInputInfo, CaptcommDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCaptcommjr1 = { - "captcommjr1", "captcomm", NULL, NULL, "1991", - "Captain Commando (910928 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Captcommjr1RomInfo, Captcommjr1RomName, NULL, NULL, CaptcommInputInfo, CaptcommDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCaptcommb = { - "captcommb", "captcomm", NULL, NULL, "1991", - "Captain Commando (bootleg set 1, 911014 other country)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, CaptcommbRomInfo, CaptcommbRomName, NULL, NULL, CaptcommInputInfo, CaptcommDIPInfo, - CaptcommbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCaptcommb2 = { - "captcommb2", "captcomm", NULL, NULL, "1991", - "Captain Commando (bootleg set 2 (with YM2151 + 2xMSM5205), 911014 other country)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Captcommb2RomInfo, Captcommb2RomName, NULL, NULL, CaptcommInputInfo, CaptcommDIPInfo, - Captcommb2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCawing = { - "cawing", NULL, NULL, NULL, "1990", - "Carrier Air Wing (U.S. navy 901012 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_HORSHOOT, 0, - NULL, CawingRomInfo, CawingRomName, NULL, NULL, CawingInputInfo, CawingDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCawingr1 = { - "cawingr1", "cawing", NULL, NULL, "1990", - "Carrier Air Wing (U.S. navy 901009 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_HORSHOOT, 0, - NULL, Cawingr1RomInfo, Cawingr1RomName, NULL, NULL, CawingInputInfo, CawingDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCawingu = { - "cawingu", "cawing", NULL, NULL, "1990", - "Carrier Air Wing (U.S. navy 901012 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_HORSHOOT, 0, - NULL, CawinguRomInfo, CawinguRomName, NULL, NULL, CawingInputInfo, CawingDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCawingj = { - "cawingj", "cawing", NULL, NULL, "1990", - "U.S. Navy (901012 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_HORSHOOT, 0, - NULL, CawingjRomInfo, CawingjRomName, NULL, NULL, CawingInputInfo, CawingDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCawingbl = { - "cawingbl", "cawing", NULL, NULL, "1990", - "Carrier Air Wing (bootleg set 1 (with 2xYM2203 + 2xMSM5205), U.S. navy 901012 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_HORSHOOT, 0, - NULL, CawingblRomInfo, CawingblRomName, NULL, NULL, CawingInputInfo, CawingDIPInfo, - CawingblInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCawingb2 = { - "cawingb2", "cawing", NULL, NULL, "1990", - "Carrier Air Wing (bootleg set 2 (with 2xYM2203 + 2xMSM5205), U.S. navy 901012 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_HORSHOOT, 0, - NULL, Cawingb2RomInfo, Cawingb2RomName, NULL, NULL, CawingInputInfo, CawingDIPInfo, - Cawingb2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCps1demo = { - "cps1demo", NULL, NULL, NULL, "2000", - "Chaos Demo (CPS-1)\0", NULL, "Chaos", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_CAPCOM_CPS1, GBF_MISC, 0, - NULL, Cps1demoRomInfo, Cps1demoRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - Cps1demoInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCworld2j = { - "cworld2j", NULL, NULL, NULL, "1992", - "Adventure Quiz Capcom World 2 (920611 Japan)\0", NULL, "Capcom", "CPS1", - L"Adventure Quiz Capcom World 2 (\u30AF\u30A4\u30BA\uFF15 \u3042\u3069\u3079\u3093\u3061\u3083\u30FC\u304F\u3044\u305A \u304B\u3077\u3053\u3093\u308F\u30FC\u308B\u3069\uFF12 920611 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_PUZZLE, 0, - NULL, Cworld2jRomInfo, Cworld2jRomName, NULL, NULL, Cworld2jInputInfo, Cworld2jDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCworld2ja = { - "cworld2ja", "cworld2j", NULL, NULL, "1992", - "Adventure Quiz Capcom World 2 (Japan 920611, B-Board 90629B-3, no battery)\0", NULL, "Capcom", "CPS1", - L"Adventure Quiz Capcom World 2 (\u30AF\u30A4\u30BA\uFF15 \u3042\u3069\u3079\u3093\u3061\u3083\u30FC\u304F\u3044\u305A \u304B\u3077\u3053\u3093\u308F\u30FC\u308B\u3069\uFF12 Japan 920611, B-Board 90629B-3, no battery)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PUZZLE, 0, - NULL, Cworld2jaRomInfo, Cworld2jaRomName, NULL, NULL, Cworld2jInputInfo, Cworld2jDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCworld2jb = { - "cworld2jb", "cworld2j", NULL, NULL, "1992", - "Adventure Quiz Capcom World 2 (Japan 920611, B-Board 91634B-2)\0", NULL, "Capcom", "CPS1", - L"Adventure Quiz Capcom World 2 (\u30AF\u30A4\u30BA\uFF15 \u3042\u3069\u3079\u3093\u3061\u3083\u30FC\u304F\u3044\u305A \u304B\u3077\u3053\u3093\u308F\u30FC\u308B\u3069\uFF12 Japan 920611, B-Board 91634B-2)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PUZZLE, 0, - NULL, Cworld2jbRomInfo, Cworld2jbRomName, NULL, NULL, Cworld2jInputInfo, Cworld2jDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDino = { - "dino", NULL, NULL, NULL, "1993", - "Cadillacs & Dinosaurs (930201 etc)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, DinoRomInfo, DinoRomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinoa = { - "dinoa", "dino", NULL, NULL, "1993", - "Cadillacs & Dinosaurs (930223 Asia TW)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, DinoaRomInfo, DinoaRomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinoj = { - "dinoj", "dino", NULL, NULL, "1993", - "Cadillacs Kyouryuu-Shinseiki (Cadillacs 930201 Japan)\0", NULL, "Capcom", "CPS1 / QSound", - L"Cadillacs \u6050\u7ADC\u65B0\u4E16\u7D00\0Cadillacs Kyouryuu-Shinseiki (Cadillacs 930201 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, DinojRomInfo, DinojRomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinou = { - "dinou", "dino", NULL, NULL, "1993", - "Cadillacs & Dinosaurs (930201 USA)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, DinouRomInfo, DinouRomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinopic = { - "dinopic", "dino", NULL, NULL, "1993", - "Cadillacs and Dinosaurs (bootleg set 1 (with PIC16c57), 930201 etc)\0", "No sound", "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, DinopicRomInfo, DinopicRomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - DinopicInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinopic2 = { - "dinopic2", "dino", NULL, NULL, "1993", - "Cadillacs and Dinosaurs (bootleg set 2 (with PIC16c57), 930201 etc)\0", "No sound", "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Dinopic2RomInfo, Dinopic2RomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - DinopicInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinopic3 = { - "dinopic3", "dino", NULL, NULL, "1993", - "Cadillacs and Dinosaurs (bootleg set 3 (with PIC16c57), 930201 etc)\0", "No sound", "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Dinopic3RomInfo, Dinopic3RomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - DinopicInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinopic4 = { - "dinopic4", "dino", NULL, NULL, "1993", - "Cadillacs and Dinosaurs (bootleg set 4 (with PIC16c57), 930223 Asia TW)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Dinopic4RomInfo, Dinopic4RomName, NULL, NULL, DinohInputInfo, DinohDIPInfo, - Dinopic4Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinoh = { - "dinoh", "dino", NULL, NULL, "1993", - "Cadillacs and Dinosaurs (bootleg set 3, 930223 Asia TW)\0", NULL, "bootleg", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, DinohRomInfo, DinohRomName, NULL, NULL, DinohInputInfo, DinohDIPInfo, - DinohInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinot = { - "dinot", "dino", NULL, NULL, "1993", - "Cadillacs and Dinosaurs Turbo (bootleg set 1, 930223 Asia TW)\0", NULL, "bootleg", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, DinotRomInfo, DinotRomName, NULL, NULL, DinohInputInfo, DinohDIPInfo, - DinotInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinotpic = { - "dinotpic", "dino", NULL, NULL, "1993", - "Cadillacs and Dinosaurs Turbo (bootleg set 2 (with PIC16c57), 930201 etc)\0", "No sound", "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, DinotpicRomInfo, DinotpicRomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - DinotpicInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinohunt = { - "dinohunt", "dino", NULL, NULL, "1993", - "Dinosaur Hunter (Chinese bootleg, 930223 Asia TW)\0", NULL, "bootleg", "CPS1", - L"Dinosaur Hunter \u6050\u9F8D\u7375\u4EBA (Chinese bootleg, 930223 Asia TW)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, DinohuntRomInfo, DinohuntRomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - DinohuntInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinoeh = { - "dinoeh", "dino", NULL, NULL, "1993", - "Cadillacs and Dinosaurs (hack, 930201 etc)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, DinoehRomInfo, DinoehRomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDinohc = { - "dinohc", "dino", NULL, NULL, "1993", - "Cadillacs and Dinosaurs (Chinese bootleg, 930223 Asia TW)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, DinohcRomInfo, DinohcRomName, NULL, NULL, DinoInputInfo, DinoDIPInfo, - DinohuntInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDynwar = { - "dynwar", NULL, NULL, NULL, "1989", - "Dynasty Wars (US set 1)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, DynwarRomInfo, DynwarRomName, NULL, NULL, DynwarInputInfo, DynwarDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDynwara = { - "dynwara", "dynwar", NULL, NULL, "1989", - "Dynasty Wars (US set 2)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, DynwaraRomInfo, DynwaraRomName, NULL, NULL, DynwarInputInfo, DynwarDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDynwarj = { - "dynwarj", "dynwar", NULL, NULL, "1989", - "Tenchi wo Kurau (Japan)\0", NULL, "Capcom", "CPS1", - L"\u5929\u5730\u3092\u55B0\u3089\u3046\0Tenchi wo Kurau (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, DynwarjRomInfo, DynwarjRomName, NULL, NULL, DynwarInputInfo, DynwarDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDynwarjr = { - "dynwarjr", "dynwar", NULL, NULL, "1989", - "Tenchi wo Kurau (Japan Resale Ver.)\0", NULL, "Capcom", "CPS1", - L"\u5929\u5730\u3092\u55B0\u3089\u3046\0Tenchi wo Kurau (Japan Resale Ver.)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, DynwarjrRomInfo, DynwarjrRomName, NULL, NULL, DynwarInputInfo, DynwarDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfight = { - "ffight", NULL, NULL, NULL, "1989", - "Final Fight (World, set 1)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightRomInfo, FfightRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfighta = { - "ffighta", "ffight", NULL, NULL, "1989", - "Final Fight (World, set 2)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightaRomInfo, FfightaRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightu = { - "ffightu", "ffight", NULL, NULL, "1989", - "Final Fight (USA, set 1)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightuRomInfo, FfightuRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightu1 = { - "ffightu1", "ffight", NULL, NULL, "1989", - "Final Fight (USA, set 2)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Ffightu1RomInfo, Ffightu1RomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightu2 = { - "ffightu2", "ffight", NULL, NULL, "1989", - "Final Fight (USA, set 3)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Ffightu2RomInfo, Ffightu2RomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightua = { - "ffightua", "ffight", NULL, NULL, "1989", - "Final Fight (900112 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightuaRomInfo, FfightuaRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightub = { - "ffightub", "ffight", NULL, NULL, "1989", - "Final Fight (900424 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightubRomInfo, FfightubRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightuc = { - "ffightuc", "ffight", NULL, NULL, "1989", - "Final Fight (900613 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightucRomInfo, FfightucRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightj = { - "ffightj", "ffight", NULL, NULL, "1989", - "Final Fight (Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightjRomInfo, FfightjRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightj1 = { - "ffightj1", "ffight", NULL, NULL, "1989", - "Final Fight (900112 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Ffightj1RomInfo, Ffightj1RomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightj2 = { - "ffightj2", "ffight", NULL, NULL, "1989", - "Final Fight (900305 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Ffightj2RomInfo, Ffightj2RomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightj3 = { - "ffightj3", "ffight", NULL, NULL, "1989", - "Final Fight (900613 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Ffightj3RomInfo, Ffightj3RomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightjh = { - "ffightjh", "ffight", NULL, NULL, "1989", - "Street Smart / Final Fight (Japan, hack)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightjhRomInfo, FfightjhRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightbl = { - "ffightbl", "ffight", NULL, NULL, "1990", - "Final Fight (bootleg set 1 (with 2xYM2203 + 2xMSM5205), World)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightblRomInfo, FfightblRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - FfightblInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFfightbla = { - "ffightbla", "ffight", NULL, NULL, "1990", - "Final Fight (bootleg set 2 (with 2xYM2203 + 2xMSM5205), World))\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FfightblaRomInfo, FfightblaRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - FcrashInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsFcrash = { - "fcrash", "ffight", NULL, NULL, "1990", - "Final Crash (bootleg (with 2xYM2203 + 2xMSM5205))\0", NULL, "Playmark", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, FcrashRomInfo, FcrashRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - FcrashInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsForgottn = { - "forgottn", NULL, NULL, NULL, "1988", - "Forgotten Worlds (World, newer)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, ForgottnRomInfo, ForgottnRomName, NULL, NULL, ForgottnInputInfo, ForgottnDIPInfo, - ForgottnNewerInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsForgottna = { - "forgottna", "forgottn", NULL, NULL, "1988", - "Forgotten Worlds (World)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, ForgottnaRomInfo, ForgottnaRomName, NULL, NULL, ForgottnInputInfo, ForgottnDIPInfo, - ForgottnAltGfxInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsForgottnu = { - "forgottnu", "forgottn", NULL, NULL, "1988", - "Forgotten Worlds (US, B-Board 88621B-2, rev C)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, ForgottnuRomInfo, ForgottnuRomName, NULL, NULL, ForgottnInputInfo, ForgottnDIPInfo, - ForgottnAltGfxuInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsForgottnua = { - "forgottnua", "forgottn", NULL, NULL, "1988", - "Forgotten Worlds (US, B-Board 88618B-2, rev A)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, ForgottnuaRomInfo, ForgottnuaRomName, NULL, NULL, ForgottnInputInfo, ForgottnDIPInfo, - ForgottnInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsForgottnuaa = { - "forgottnuaa", "forgottn", NULL, NULL, "1988", - "Forgotten Worlds (US, B-Board 88618B-2, rev AA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, ForgottnuaaRomInfo, ForgottnuaaRomName, NULL, NULL, ForgottnInputInfo, ForgottnDIPInfo, - ForgottnInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsForgottnuc = { - "forgottnuc", "forgottn", NULL, NULL, "1988", - "Forgotten Worlds (US, B-Board 88618B-2, Rev C)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, ForgottnucRomInfo, ForgottnucRomName, NULL, NULL, ForgottnInputInfo, ForgottnDIPInfo, - ForgottnInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsForgottnue = { - "forgottnue", "forgottn", NULL, NULL, "1988", - "Forgotten Worlds (US, B-Board 88618B-2, Rev E)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, ForgottnueRomInfo, ForgottnueRomName, NULL, NULL, ForgottnInputInfo, ForgottnDIPInfo, - ForgottnInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsLostwrld = { - "lostwrld", "forgottn", NULL, NULL, "1988", - "Lost Worlds (Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, LostwrldRomInfo, LostwrldRomName, NULL, NULL, ForgottnInputInfo, ForgottnDIPInfo, - ForgottnInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsLostwrldo = { - "lostwrldo", "forgottn", NULL, NULL, "1988", - "Lost Worlds (Japan Old ver.)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, LostwrldoRomInfo, LostwrldoRomName, NULL, NULL, ForgottnInputInfo, ForgottnDIPInfo, - ForgottnInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGanbare = { - "ganbare", NULL, NULL, NULL, "2000", - "Ganbare! Marine Kun (Marine 2K0411 JPN)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_HORSHOOT, 0, - NULL, GanbareRomInfo, GanbareRomName, NULL, NULL, GanbareInputInfo, GanbareDIPInfo, - GanbareInit, GanbareExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGhouls = { - "ghouls", NULL, NULL, NULL, "1988", - "Ghouls'n Ghosts (World)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, GhoulsRomInfo, GhoulsRomName, NULL, NULL, GhoulsInputInfo, GhoulsDIPInfo, - GhoulsInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGhoulsu = { - "ghoulsu", "ghouls", NULL, NULL, "1988", - "Ghouls'n Ghosts (US)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, GhoulsuRomInfo, GhoulsuRomName, NULL, NULL, GhoulsInputInfo, GhoulsuDIPInfo, - GhoulsInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDaimakai = { - "daimakai", "ghouls", NULL, NULL, "1988", - "Dai Makai-Mura (Japan)\0", NULL, "Capcom", "CPS1", - L"\u5927\u9B54\u754C\u6751\0Dai Makai-Mura (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, DaimakaiRomInfo, DaimakaiRomName, NULL, NULL, GhoulsInputInfo, DaimakaiDIPInfo, - DaimakaiInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDaimakair = { - "daimakair", "ghouls", NULL, NULL, "1988", - "Dai Makai-Mura (Japan Resale Ver.)\0", NULL, "Capcom", "CPS1", - L"\u5927\u9B54\u754C\u6751\0Dai Makai-Mura (Japan Resale Ver.)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, DaimakairRomInfo, DaimakairRomName, NULL, NULL, GhoulsInputInfo, DaimakaiDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDaimakaib = { - "daimakaib", "ghouls", NULL, NULL, "1988", - "Dai Makai-Mura (bootleg, Japan)\0", NULL, "Capcom", "CPS1", - L"\u5927\u9B54\u754C\u6751\0Dai Makai-Mura (bootleg, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, DaimakaibRomInfo, DaimakaibRomName, NULL, NULL, GhoulsInputInfo, DaimakaiDIPInfo, - DaimakaibInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnights = { - "knights", NULL, NULL, NULL, "1991", - "Knights of the Round (911127 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KnightsRomInfo, KnightsRomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnightsu = { - "knightsu", "knights", NULL, NULL, "1991", - "Knights of the Round (911127 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KnightsuRomInfo, KnightsuRomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnightsj = { - "knightsj", "knights", NULL, NULL, "1991", - "Knights of the Round (911127 Japan, B-Board 91634B-2)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KnightsjRomInfo, KnightsjRomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnightsja = { - "knightsja", "knights", NULL, NULL, "1991", - "Knights of the Round (911127 Japan, B-Board 89625B-1)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KnightsjaRomInfo, KnightsjaRomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnightsb = { - "knightsb", "knights", NULL, NULL, "1991", - "Knights of the Round (bootleg set 1 (with YM2151 + 2xMSM5205), 911127 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KnightsbRomInfo, KnightsbRomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - KnightsbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnightsb2 = { - "knightsb2", "knights", NULL, NULL, "1991", - "Knights of the Round (bootleg set 2, 911127 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Knightsb2RomInfo, Knightsb2RomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - Knightsb2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnightsb3 = { - "knightsb3", "knights", NULL, NULL, "1991", - "Knights of the Round (bootleg set 3, 911127 Japan)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Knightsb3RomInfo, Knightsb3RomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnightsb4 = { - "knightsb4", "knights", NULL, NULL, "1991", - "Knights of the Round (bootleg set 4 (with YM2151 + 2xMSM5205), 911127 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Knightsb4RomInfo, Knightsb4RomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - KnightsbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnightsh = { - "knightsh", "knights", NULL, NULL, "1991", - "Knights of the Round (hack set 1)\0", NULL, "hack", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KnightshRomInfo, KnightshRomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKnightsh2 = { - "knightsh2", "knights", NULL, NULL, "1991", - "Knights of the Round (hack set 2, 911127 etc)\0", NULL, "hack", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Knightsh2RomInfo, Knightsh2RomName, NULL, NULL, KnightsInputInfo, KnightsDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKod = { - "kod", NULL, NULL, NULL, "1991", - "The King of Dragons (910805 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KodRomInfo, KodRomName, NULL, NULL, KodInputInfo, KodDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKodr1 = { - "kodr1", "kod", NULL, NULL, "1991", - "The King of Dragons (910711 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Kodr1RomInfo, Kodr1RomName, NULL, NULL, KodInputInfo, Kodr1DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKodu = { - "kodu", "kod", NULL, NULL, "1991", - "The King of Dragons (US 910910)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KoduRomInfo, KoduRomName, NULL, NULL, KodInputInfo, KodDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKodj = { - "kodj", "kod", NULL, NULL, "1991", - "The King of Dragons (Japan 910805, B-Board 90629B-3)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KodjRomInfo, KodjRomName, NULL, NULL, KodInputInfo, KodDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKodja = { - "kodja", "kod", NULL, NULL, "1991", - "The King of Dragons (Japan 910805, B-Board 89625B-1)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KodjaRomInfo, KodjaRomName, NULL, NULL, KodInputInfo, KodDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKodb = { - "kodb", "kod", NULL, NULL, "1991", - "The King of Dragons (bootleg, 910731 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KodbRomInfo, KodbRomName, NULL, NULL, KodInputInfo, KodDIPInfo, - KodbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKodh = { - "kodh", "kod", NULL, NULL, "2002", - "The King of Dragons (hack)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KodhRomInfo, KodhRomName, NULL, NULL, KodhInputInfo, KodDIPInfo, - KodhInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsKodda = { - "kodda", "kod", NULL, NULL, "1991", - "The King of Dragons (Phoenix bootleg, 910731 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, KoddaRomInfo, KoddaRomName, NULL, NULL, KodInputInfo, KodDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMegaman = { - "megaman", NULL, NULL, NULL, "1995", - "Mega Man - the power battle (951006 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, MegamanRomInfo, MegamanRomName, NULL, NULL, MegamanInputInfo, MegamanDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMegamana = { - "megamana", "megaman", NULL, NULL, "1995", - "Mega Man - the power battle (951006 Asia)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, MegamanaRomInfo, MegamanaRomName, NULL, NULL, MegamanInputInfo, MegamanDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsRockmanj = { - "rockmanj", "megaman", NULL, NULL, "1995", - "Rockman - the power battle (950922 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, RockmanjRomInfo, RockmanjRomName, NULL, NULL, MegamanInputInfo, RockmanjDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMercs = { - "mercs", NULL, NULL, NULL, "1990", - "Mercs (900302 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, MercsRomInfo, MercsRomName, NULL, NULL, MercsInputInfo, MercsDIPInfo, - MercsInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsMercsu = { - "mercsu", "mercs", NULL, NULL, "1990", - "Mercs (900608 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, MercsuRomInfo, MercsuRomName, NULL, NULL, MercsInputInfo, MercsDIPInfo, - MercsInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsMercsur1 = { - "mercsur1", "mercs", NULL, NULL, "1990", - "Mercs (900302 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, Mercsur1RomInfo, Mercsur1RomName, NULL, NULL, MercsInputInfo, MercsDIPInfo, - MercsInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsMercsj = { - "mercsj", "mercs", NULL, NULL, "1990", - "Senjo no Ookami II (Ookami 2 900302 Japan)\0", NULL, "Capcom", "CPS1", - L"\u6226\u5834\u306E\u72FC II\0Senjo no Ookami II (Ookami 2 900302 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, MercsjRomInfo, MercsjRomName, NULL, NULL, MercsInputInfo, MercsDIPInfo, - MercsInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsMsword = { - "msword", NULL, NULL, NULL, "1990", - "Magic Sword - heroic fantasy (25.07.1990 other country)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, MswordRomInfo, MswordRomName, NULL, NULL, MswordInputInfo, MswordDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMswordr1 = { - "mswordr1", "msword", NULL, NULL, "1990", - "Magic Sword - heroic fantasy (23.06.1990 other country)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Mswordr1RomInfo, Mswordr1RomName, NULL, NULL, MswordInputInfo, MswordDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMswordj = { - "mswordj", "msword", NULL, NULL, "1990", - "Magic Sword (23.06.1990 Japan)\0", NULL, "Capcom", "CPS1", - L"Magic Sword (23.06.1990 Japan)\0Magic Sword\u30DE\u30B8\u30C3\u30AF\uFF65\u30BD\u30FC\u30C9\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, MswordjRomInfo, MswordjRomName, NULL, NULL, MswordInputInfo, MswordDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMswordu = { - "mswordu", "msword", NULL, NULL, "1990", - "Magic Sword - heroic fantasy (25.07.1990 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, MsworduRomInfo, MsworduRomName, NULL, NULL, MswordInputInfo, MswordDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMtwins = { - "mtwins", NULL, NULL, NULL, "1990", - "Mega Twins (chiki chiki boys 900619 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, MtwinsRomInfo, MtwinsRomName, NULL, NULL, MtwinsInputInfo, MtwinsDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsChikij = { - "chikij", "mtwins", NULL, NULL, "1990", - "Chiki Chiki Boys (900619 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, ChikijRomInfo, ChikijRomName, NULL, NULL, MtwinsInputInfo, MtwinsDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsNemo = { - "nemo", NULL, NULL, NULL, "1990", - "Nemo (90 11 30 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, NemoRomInfo, NemoRomName, NULL, NULL, NemoInputInfo, NemoDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsNemor1 = { - "nemor1", "nemo", NULL, NULL, "1990", - "Nemo (90 11 09 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, Nemor1RomInfo, Nemor1RomName, NULL, NULL, NemoInputInfo, NemoDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsNemoj = { - "nemoj", "nemo", NULL, NULL, "1990", - "Nemo (90 11 20 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2 ,HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, NemojRomInfo, NemojRomName, NULL, NULL, NemoInputInfo, NemoDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPang3 = { - "pang3", NULL, NULL, NULL, "1995", - "Pang! 3 (950601 Euro)\0", NULL, "Mitchell", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_PUZZLE, 0, - NULL, Pang3RomInfo, Pang3RomName, NULL, NULL, Pang3InputInfo, Pang3DIPInfo, - Pang3Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPang3r1 = { - "pang3r1", "pang3", NULL, NULL, "1995", - "Pang! 3 (950511 Euro)\0", NULL, "Mitchell", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_PUZZLE, 0, - NULL, Pang3r1RomInfo, Pang3r1RomName, NULL, NULL, Pang3InputInfo, Pang3DIPInfo, - Pang3Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPang3r1a = { - "pang3r1a", "pang3", NULL, NULL, "1995", - "Pang! 3 (950511 Euro, alt)\0", NULL, "Mitchell", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_PUZZLE, 0, - NULL, Pang3r1aRomInfo, Pang3r1aRomName, NULL, NULL, Pang3InputInfo, Pang3DIPInfo, - Pang3r1aInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPang3b = { - "pang3b", "pang3", NULL, NULL, "1995", - "Pang! 3 (bootleg set 1, 950511 Euro)\0", NULL, "Mitchell", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_PUZZLE, 0, - NULL, Pang3bRomInfo, Pang3bRomName, NULL, NULL, Pang3InputInfo, Pang3DIPInfo, - Pang3bInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPang3b2 = { - "pang3b2", "pang3", NULL, NULL, "1995", - "Pang! 3 (bootleg set 2, 950511 Euro)\0", NULL, "Mitchell", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_PUZZLE, 0, - NULL, Pang3b2RomInfo, Pang3b2RomName, NULL, NULL, Pang3InputInfo, Pang3DIPInfo, - Pang3Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPang3b3 = { - "pang3b3", "pang3", NULL, NULL, "1995", - "Pang! 3 (bootleg set 3, 950601 Euro)\0", NULL, "Mitchell", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_PUZZLE, 0, - NULL, Pang3b3RomInfo, Pang3b3RomName, NULL, NULL, Pang3InputInfo, Pang3DIPInfo, - Pang3Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPang3j = { - "pang3j", "pang3", NULL, NULL, "1995", - "Pang! 3: Kaitou Tachi no Karei na Gogo (950511 Japan)\0", NULL, "Mitchell", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_GENERIC, GBF_PUZZLE, 0, - NULL, Pang3jRomInfo, Pang3jRomName, NULL, NULL, Pang3InputInfo, Pang3DIPInfo, - Pang3Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPnickj = { - "pnickj", NULL, NULL, NULL, "1994", - "Pnickies (940608 Japan)\0", NULL, "Compile (Capcom license)", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_PUZZLE, 0, - NULL, PnickjRomInfo, PnickjRomName, NULL, NULL, PnickjInputInfo, PnickjDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPokonyan = { - "pokonyan", NULL, NULL, NULL, "1994", - "Pokonyan (Japan 940322)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_MISC, 0, - NULL, PokonyanRomInfo, PokonyanRomName, NULL, NULL, PokonyanInputInfo, PokonyanDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPunisher = { - "punisher", NULL, NULL, NULL, "1993", - "The Punisher (930422 etc)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, PunisherRomInfo, PunisherRomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPunisheru = { - "punisheru", "punisher", NULL, NULL, "1993", - "The Punisher (930422 USA)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, PunisheruRomInfo, PunisheruRomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPunisherj = { - "punisherj", "punisher", NULL, NULL, "1993", - "The Punisher (930422 Japan)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, PunisherjRomInfo, PunisherjRomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPunisherh = { - "punisherh", "punisher", NULL, NULL, "1993", - "The Punisher (930422 Hispanic)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, PunisherhRomInfo, PunisherhRomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPunipic = { - "punipic", "punisher", NULL, NULL, "1993", - "The Punisher (bootleg set 1 (with PIC16c57), 930422 etc)\0", "No sound", "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, PunipicRomInfo, PunipicRomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo, - PunipicInit, PunipicExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPunipic2 = { - "punipic2", "punisher", NULL, NULL, "1993", - "The Punisher (bootleg set 2 (with PIC16c57), 930422 etc)\0", "No sound", "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Punipic2RomInfo, Punipic2RomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo, - Punipic2Init, PunipicExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPunipic3 = { - "punipic3", "punisher", NULL, NULL, "1993", - "The Punisher (bootleg set 3 (with PIC16c57), 930422 etc)\0", "No sound", "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Punipic3RomInfo, Punipic3RomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo, - Punipic3Init, PunipicExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPunisherbz = { - "punisherbz", "punisher", NULL, NULL, "2002", - "Biaofeng Zhanjing (Chinese bootleg)\0", NULL, "bootleg", "CPS1", - L"\uFEFF\u98C6\u98A8\u6230\u8B66\0The Punisher: Biaofeng Zhanjing (Chinese bootleg)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, PunisherbzRomInfo, PunisherbzRomName, NULL, NULL, PunisherbzInputInfo, PunisherbzDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPunisherb = { - "punisherb", "punisher", NULL, NULL, "1993", - "The Punisher (bootleg, 930422 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, PunisherbRomInfo, PunisherbRomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo, - PunisherbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsQad = { - "qad", NULL, NULL, NULL, "1992", - "Quiz & Dragons (capcom quiz game 920701 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_QUIZ, 0, - NULL, QadRomInfo, QadRomName, NULL, NULL, QadInputInfo, QadDIPInfo, - QadInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsQadjr = { - "qadjr", "qad", NULL, NULL, "1992", - "Quiz & Dragons (940921 Japan Resale Ver.)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_QUIZ, 0, - NULL, QadjrRomInfo, QadjrRomName, NULL, NULL, QadInputInfo, QadjrDIPInfo, - QadInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsQtono2j = { - "qtono2j", NULL, NULL, NULL, "1995", - "Quiz Tonosama no Yabou 2 Zenkoku-ban (tonosama 2 950123 Japan)\0", NULL, "Capcom", "CPS1", - L"\u30AF\u30A4\u30BA\u6BBF\u69D8\u306E\u91CE\u671B\uFF12 (\u3068\u306E\u3055\u307E\u306E\u3084\u307C\u3046 2)\0Quiz Tonosama no Yabou 2 Zenkoku-ban (tonosama 2 950123 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_QUIZ, 0, - NULL, Qtono2jRomInfo, Qtono2jRomName, NULL, NULL, Qtono2jInputInfo, Qtono2jDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2 = { - "sf2", NULL, NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910522 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2RomInfo, Sf2RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2eb = { - "sf2eb", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910214 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ebRomInfo, Sf2ebRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ed = { - "sf2ed", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910318 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2edRomInfo, Sf2edRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ee = { - "sf2ee", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910228 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2eeRomInfo, Sf2eeRomName, NULL, NULL, Sf2ueInputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2em = { - "sf2em", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910129 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2emRomInfo, Sf2emRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ebbl = { - "sf2ebbl", "sf2", NULL, NULL, "1992", - "Street Fighter II - The World Warrior (TAB Austria bootleg, 910214 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ebblRomInfo, Sf2ebblRomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2ebblInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ebbl2 = { - "sf2ebbl2", "sf2", NULL, NULL, "1992", - "Street Fighter II - The World Warrior (TAB Austria bootleg set 2, 910214 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ebbl2RomInfo, Sf2ebbl2RomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2ebbl2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ebbl3 = { - "sf2ebbl3", "sf2", NULL, NULL, "1992", - "Street Fighter II - The World Warrior (TAB Austria bootleg set 3, 910214 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ebbl3RomInfo, Sf2ebbl3RomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2ebbl3Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2stt = { - "sf2stt", "sf2", NULL, NULL, "1992", - "Street Fighter II - The World Warrior (STT, TAB Austria bootleg, 910214 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2sttRomInfo, Sf2sttRomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2sttInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ua = { - "sf2ua", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910206 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2uaRomInfo, Sf2uaRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ub = { - "sf2ub", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910214 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ubRomInfo, Sf2ubRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2uc = { - "sf2uc", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910306 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ucRomInfo, Sf2ucRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ud = { - "sf2ud", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910318 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2udRomInfo, Sf2udRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ue = { - "sf2ue", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910228 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ueRomInfo, Sf2ueRomName, NULL, NULL, Sf2ueInputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2uf = { - "sf2uf", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910411 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ufRomInfo, Sf2ufRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ug = { - "sf2ug", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910522 USA, rev G)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ugRomInfo, Sf2ugRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ui = { - "sf2ui", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910522 USA, rev I)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2uiRomInfo, Sf2uiRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2uk = { - "sf2uk", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (911101 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ukRomInfo, Sf2ukRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2j = { - "sf2j", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (911210 Japan, CPS-B-13)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2jRomInfo, Sf2jRomName, NULL, NULL, Sf2InputInfo, Sf2jDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2j17 = { - "sf2j17", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (911210 Japan, CPS-B-17)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2j17RomInfo, Sf2j17RomName, NULL, NULL, Sf2InputInfo, Sf2jDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ja = { - "sf2ja", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910214 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2jaRomInfo, Sf2jaRomName, NULL, NULL, Sf2InputInfo, Sf2jDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2jc = { - "sf2jc", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910306 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2jcRomInfo, Sf2jcRomName, NULL, NULL, Sf2InputInfo, Sf2jDIPInfo, - Sf2jcInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2jf = { - "sf2jf", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910411 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2jfRomInfo, Sf2jfRomName, NULL, NULL, Sf2InputInfo, Sf2jDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2jh = { - "sf2jh", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (910522 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2jhRomInfo, Sf2jhRomName, NULL, NULL, Sf2InputInfo, Sf2jDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2jl = { - "sf2jl", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (920312 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2jlRomInfo, Sf2jlRomName, NULL, NULL, Sf2InputInfo, Sf2jDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2jla = { - "sf2jla", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (911210 Japan, rev L)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2jlaRomInfo, Sf2jlaRomName, NULL, NULL, Sf2InputInfo, Sf2jDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2qp1 = { - "sf2qp1", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (Quicken Pt-I bootleg, 910214 USA)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2qp1RomInfo, Sf2qp1RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2qp1Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2thndr = { - "sf2thndr", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (Thunder Edition bootleg, 910214 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2thndrRomInfo, Sf2thndrRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2thndrInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2b = { - "sf2b", "sf2", NULL, NULL, "1992", - "Street Fighter II - The World Warrior (bootleg, 910214 etc, set 1 (with YM2151 + 2xMSM5205))\0", "row scroll issues", "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2bRomInfo, Sf2bRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2bInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2b2 = { - "sf2b2", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (bootleg, 910214 etc, set 2)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2b2RomInfo, Sf2b2RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2b2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2b3 = { - "sf2b3", "sf2", NULL, NULL, "1991", - "Street Fighter II - The World Warrior (bootleg, 910214 etc, set 3)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2b3RomInfo, Sf2b3RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ce = { - "sf2ce", NULL, NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (street fighter 2' 920513 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceRomInfo, Sf2ceRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceea = { - "sf2ceea", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (street fighter 2' 920313 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceeaRomInfo, Sf2ceeaRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceja = { - "sf2ceja", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (street fighter 2' 920322 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2cejaRomInfo, Sf2cejaRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2cejb = { - "sf2cejb", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (street fighter 2' 920513 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2cejbRomInfo, Sf2cejbRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2cejc = { - "sf2cejc", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (street fighter 2' 920803 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2cejcRomInfo, Sf2cejcRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceua = { - "sf2ceua", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (street fighter 2' 920313 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuaRomInfo, Sf2ceuaRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceub = { - "sf2ceub", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (street fighter 2' 920513 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceubRomInfo, Sf2ceubRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceuc = { - "sf2ceuc", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (street fighter 2' 920803 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceucRomInfo, Sf2ceucRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2acc = { - "sf2acc", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Accelerator! bootleg set 1, 920313 USA)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2accRomInfo, Sf2accRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2acca = { - "sf2acca", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Accelerator! bootleg set 2, 920310 Accelerator!)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2accaRomInfo, Sf2accaRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2accp2 = { - "sf2accp2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Accelerator Pt.II bootleg, 920313 Testron)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2accp2RomInfo, Sf2accp2RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2accp2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2dkot2 = { - "sf2dkot2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Double K.O. Turbo II bootleg, 902140 USA)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2dkot2RomInfo, Sf2dkot2RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2dkot2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2rb = { - "sf2rb", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Rainbow bootleg set 1, 920322 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2rbRomInfo, Sf2rbRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2rbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2rb2 = { - "sf2rb2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Rainbow bootleg set 2, 920322 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2rb2RomInfo, Sf2rb2RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2rb2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2rb3 = { - "sf2rb3", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Rainbow bootleg set 3, 920322 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2rb3RomInfo, Sf2rb3RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2rb4 = { - "sf2rb4", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Rainbow bootleg set 4, 920322 Japan)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2rb4RomInfo, Sf2rb4RomName, NULL, NULL, Sf2yycInputInfo, Sf2jDIPInfo, - Sf2cejablInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2rb5 = { - "sf2rb5", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Rainbow bootleg set 5, 920322 Japan)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2rb5RomInfo, Sf2rb5RomName, NULL, NULL, Sf2yycInputInfo, Sf2jDIPInfo, - Sf2cejablInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2rb6 = { - "sf2rb6", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Rainbow bootleg set 6, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2rb6RomInfo, Sf2rb6RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2rb6Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2red = { - "sf2red", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Red Wave bootleg set 1, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2redRomInfo, Sf2redRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2red2 = { - "sf2red2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Red Wave bootleg set 2, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2red2RomInfo, Sf2red2RomName, NULL, NULL, Sf2yycInputInfo, Sf2jDIPInfo, - Sf2yycInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2v004 = { - "sf2v004", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (V004 bootleg set 1, 102092 USA)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2v004RomInfo, Sf2v004RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2v0042 = { - "sf2v0042", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (V004 bootleg set 2, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2v0042RomInfo, Sf2v0042RomName, NULL, NULL, Sf2yycInputInfo, Sf2jDIPInfo, - Sf2yycInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2v0043 = { - "sf2v0043", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (V004 bootleg set 3, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2v0043RomInfo, Sf2v0043RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2dongb = { - "sf2dongb", "sf2ce", NULL, NULL, "1992", - "Street Fighter II': Champion Edition (Dongfang Bubai protection bootleg, etc 920313)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2dongbRomInfo, Sf2dongbRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2dongbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2bhh = { - "sf2bhh", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Hungh-Hsi bootleg, 920313 Taiwan)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2bhhRomInfo, Sf2bhhRomName, NULL, NULL, Sf2InputInfo, Sf2bhhDIPInfo, - Sf2bhhInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2hf = { - "sf2hf", NULL, NULL, NULL, "1992", - "Street Fighter II' - Hyper Fighting (street fighter 2' T 921209 ETC)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2hfRomInfo, Sf2hfRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2hfu = { - "sf2hfu", "sf2hf", NULL, NULL, "1992", - "Street Fighter II' - Hyper Fighting (street fighter 2' T 921209 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2hfuRomInfo, Sf2hfuRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2hfj = { - "sf2hfj", "sf2hf", NULL, NULL, "1992", - "Street Fighter II' Turbo - Hyper Fighting (street fighter 2' T 921209 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2hfjRomInfo, Sf2hfjRomName, NULL, NULL, Sf2InputInfo, Sf2jDIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvCpsSf2hfub = { - "sf2hfub", "sf2hf", NULL, NULL, "1992", - "Street Fighter II' - Hyper Fighting (bootleg set 3, street fighter 2' T 921209 USA)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2hfubRomInfo, Sf2hfubRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2hfubInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2hfjb = { - "sf2hfjb", "sf2hf", NULL, NULL, "1992", - "Street Fighter II' Turbo - Hyper Fighting (bootleg set 1, 921209 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2hfjbRomInfo, Sf2hfjbRomName, NULL, NULL, Sf2yycInputInfo, Sf2jDIPInfo, - Sf2hfjbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2hfjb2 = { - "sf2hfjb2", "sf2hf", NULL, NULL, "1992", - "Street Fighter II' Turbo - Hyper Fighting (bootleg set 2, 921209 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2hfjb2RomInfo, Sf2hfjb2RomName, NULL, NULL, Sf2yycInputInfo, Sf2jDIPInfo, - Sf2hfjbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2yyc = { - "sf2yyc", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (YYC bootleg set 1, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2yycRomInfo, Sf2yycRomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2yycInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2yyc2 = { - "sf2yyc2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (YYC bootleg set 2, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2yyc2RomInfo, Sf2yyc2RomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2yycInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2koryu = { - "sf2koryu", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Xiang Long (bootleg set 1, 811102 001)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2koryuRomInfo, Sf2koryuRomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2koryuInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2koryu2 = { - "sf2koryu2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Xiang Long (bootleg set 2, 811102 001)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2koryu2RomInfo, Sf2koryu2RomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2koryu3 = { - "sf2koryu3", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Xiang Long (bootleg set 3, 811102 001)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG,2,HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2koryu3RomInfo, Sf2koryu3RomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2amf = { - "sf2amf", "sf2ce", NULL, NULL, "1992", - "Street Fighter II - Champion Edition (Alpha Magic-F bootleg set 1, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2amfRomInfo, Sf2amfRomName, NULL, NULL, Sf2yycInputInfo, Sf2amfDIPInfo, - Sf2amfInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2amf2 = { - "sf2amf2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II - Champion Edition (Alpha Magic-F bootleg set 2, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2amf2RomInfo, Sf2amf2RomName, NULL, NULL, Sf2yycInputInfo, Sf2amfDIPInfo, - Sf2amf2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2amf3 = { - "sf2amf3", "sf2ce", NULL, NULL, "1992", - "Street Fighter II - Champion Edition (Alpha Magic-F bootleg set 3, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2amf3RomInfo, Sf2amf3RomName, NULL, NULL, Sf2yycInputInfo, Sf2amfDIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2amf4 = { - "sf2amf4", "sf2ce", NULL, NULL, "1992", - "Street Fighter II - Champion Edition (Alpha Magic-F bootleg set 4, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2amf4RomInfo, Sf2amf4RomName, NULL, NULL, Sf2yycInputInfo, Sf2amfDIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2amf5 = { - "sf2amf5", "sf2ce", NULL, NULL, "1992", - "Street Fighter II - Champion Edition (Alpha Magic-F bootleg set 5, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2amf5RomInfo, Sf2amf5RomName, NULL, NULL, Sf2yycInputInfo, Sf2amfDIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2amf6 = { - "sf2amf6", "sf2ce", NULL, NULL, "1992", - "Street Fighter II - Champion Edition (Alpha Magic-F bootleg set 6, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2amf6RomInfo, Sf2amf6RomName, NULL, NULL, Sf2yycInputInfo, Sf2amfDIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2amf7 = { - "sf2amf7", "sf2ce", NULL, NULL, "1992", - "Street Fighter II - Champion Edition (Alpha Magic-F bootleg set 7, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2amf7RomInfo, Sf2amf7RomName, NULL, NULL, Sf2yycInputInfo, Sf2amfDIPInfo, - Sf2amfInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2amf8 = { - "sf2amf8", "sf2ce", NULL, NULL, "1992", - "Street Fighter II - Champion Edition (Alpha Magic-F bootleg set 8, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2amf8RomInfo, Sf2amf8RomName, NULL, NULL, Sf2yycInputInfo, Sf2amfDIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2mega = { - "sf2mega", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Mega Co bootleg set 1, 920313 etc)\0", NULL, "Mega Co", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2megaRomInfo, Sf2megaRomName, NULL, NULL, Sf2yycInputInfo, Sf2megaDIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2mega2 = { - "sf2mega2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Mega Co bootleg set 2, 920313 etc)\0", NULL, "Mega Co", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2mega2RomInfo, Sf2mega2RomName, NULL, NULL, Sf2yycInputInfo, Sf2megaDIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2md = { - "sf2md", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Magic Delta, bootleg, 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2mdRomInfo, Sf2mdRomName, NULL, NULL, Sf2ceeablInputInfo, Sf2DIPInfo, - Sf2ceeablInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2mdt = { - "sf2mdt", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Magic Delta Turbo (bootleg set 1 (with YM2151 + 2xMSM5205), 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2mdtRomInfo, Sf2mdtRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2mdtInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2mdta = { - "sf2mdta", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Magic Delta Turbo (bootleg set 2 (with YM2151 + 2xMSM5205), 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2mdtaRomInfo, Sf2mdtaRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2mdtaInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2mdtb = { - "sf2mdtb", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Magic Delta Turbo (bootleg set 3 (with YM2151 + 2xMSM5205), 920313 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2mdtbRomInfo, Sf2mdtbRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2mdtbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2mdtc = { - "sf2mdtc", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Magic Delta Turbo (bootleg set 4 (with YM2151 + 2xMSM5205), 920313 etc)\0", NULL, "Playmark bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2mdtcRomInfo, Sf2mdtcRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2mdtaInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceeabl = { - "sf2ceeabl", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 etc bootleg set 1)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceeablRomInfo, Sf2ceeablRomName, NULL, NULL, Sf2ceeablInputInfo, Sf2DIPInfo, - Sf2ceeablInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceeab2 = { - "sf2ceeab2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 etc bootleg set 2)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceeab2RomInfo, Sf2ceeab2RomName, NULL, NULL, Sf2ceeablInputInfo, Sf2DIPInfo, - Sf2ceeab2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceeab3 = { - "sf2ceeab3", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 etc bootleg set 3)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceeab3RomInfo, Sf2ceeab3RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2mdtbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceeab4 = { - "sf2ceeab4", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 etc bootleg set 4)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceeab4RomInfo, Sf2ceeab4RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2mdtbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceeab5 = { - "sf2ceeab5", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 etc bootleg set 5)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceeab5RomInfo, Sf2ceeab5RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2mdtbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2cejabl = { - "sf2cejabl", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920322 Japan bootleg set 1)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2cejablRomInfo, Sf2cejablRomName, NULL, NULL, Sf2yycInputInfo, Sf2jDIPInfo, - Sf2cejablInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2cejab2 = { - "sf2cejab2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920322 Japan bootleg set 2)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2cejab2RomInfo, Sf2cejab2RomName, NULL, NULL, Sf2yycInputInfo, Sf2jDIPInfo, - Sf2cejablInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceupl = { - "sf2ceupl", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (UPL bootleg)\0", NULL, "bootleg (UPL)", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuplRomInfo, Sf2ceuplRomName, NULL, NULL, Sf2yycInputInfo, Sf2jDIPInfo, - Sf2cejablInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceuabl = { - "sf2ceuabl", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 USA bootleg set 1)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuablRomInfo, Sf2ceuablRomName, NULL, NULL, Sf2ceuablInputInfo, Sf2DIPInfo, - Sf2ceuablInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceuab2 = { - "sf2ceuab2", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 USA bootleg set 2)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuab2RomInfo, Sf2ceuab2RomName, NULL, NULL, Sf2ceuablInputInfo, Sf2DIPInfo, - Sf2ceuab2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceuab3 = { - "sf2ceuab3", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 USA bootleg set 3)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuab3RomInfo, Sf2ceuab3RomName, NULL, NULL, Sf2ceuablInputInfo, Sf2DIPInfo, - Sf2ceuab3Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceuab4 = { - "sf2ceuab4", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 USA bootleg set 4)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuab4RomInfo, Sf2ceuab4RomName, NULL, NULL, Sf2ceuablInputInfo, Sf2DIPInfo, - Sf2ceuab4Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceuab5 = { - "sf2ceuab5", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 USA bootleg set 5)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuab5RomInfo, Sf2ceuab5RomName, NULL, NULL, Sf2ceuablInputInfo, Sf2DIPInfo, - Sf2ceuablInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceuab6 = { - "sf2ceuab6", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 USA bootleg set 6)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuab6RomInfo, Sf2ceuab6RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceuab6Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceuab7 = { - "sf2ceuab7", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 USA bootleg set 7)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuab7RomInfo, Sf2ceuab7RomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceuab7Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvCpsSf2ceuab8 = { - "sf2ceuab8", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 USA bootleg set 8)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuab8RomInfo, Sf2ceuab8RomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2ceuab8Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvCpsSf2ceuab9 = { - "sf2ceuab9", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 USA bootleg set 9)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceuab9RomInfo, Sf2ceuab9RomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2ceuab9Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2ceucbl = { - "sf2ceucbl", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920803 USA bootleg)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2ceucblRomInfo, Sf2ceucblRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceucblInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2tlona = { - "sf2tlona", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Tu Long bootleg set 1, 811102 001)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2tlonaRomInfo, Sf2tlonaRomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2tlonb = { - "sf2tlonb", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Tu Long bootleg set 2, 811102 001)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2tlonbRomInfo, Sf2tlonbRomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2tlonc = { - "sf2tlonc", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (Tu Long bootleg set 3, 811102 001)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2tloncRomInfo, Sf2tloncRomName, NULL, NULL, Sf2yycInputInfo, Sf2DIPInfo, - Sf2koryu2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2cebltw = { - "sf2cebltw", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (920313 'Taiwan' bootleg with PAL)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2cebltwRomInfo, Sf2cebltwRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSf2sl73a = { - "sf2sl73a", "sf2ce", NULL, NULL, "2013", - "Street Fighter II' - Champion Edition (Sheng Long v 7.3a)\0", NULL, "Drakon", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2sl73aRomInfo, Sf2sl73aRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfzch = { - "sfzch", NULL, NULL, NULL, "1995", - "Street Fighter Zero (CPS Changer, 951020 Japan)\0", NULL, "Capcom", "CPS Changer", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPSCHANGER, GBF_VSFIGHT, FBF_SF, - NULL, SfzchRomInfo, SfzchRomName, NULL, NULL, SfzchInputInfo, NULL, - SfzchInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSlammast = { - "slammast", NULL, NULL, NULL, "1993", - "Saturday Night Slam Masters (Slam Masters 930713 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, SlammastRomInfo, SlammastRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSlammastu = { - "slammastu", "slammast", NULL, NULL, "1993", - "Saturday Night Slam Masters (slam masters 930713 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, SlammastuRomInfo, SlammastuRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMbomberj = { - "mbomberj", "slammast", NULL, NULL, "1993", - "Muscle Bomber - the body explosion (930713 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, MbomberjRomInfo, MbomberjRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMbombrd = { - "mbombrd", NULL, NULL, NULL, "1993", - "Muscle Bomber Duo - ultimate team battle (931206 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, MbombrdRomInfo, MbombrdRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMbombrdj = { - "mbombrdj", "mbombrd", NULL, NULL, "1993", - "Muscle Bomber Duo - heat up warriors (931206 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, MbombrdjRomInfo, MbombrdjRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSlampic = { - "slampic", "slammast", NULL, NULL, "1993", - "Saturday Night Slam Masters (bootleg (with PIC16c57), 930713 etc)\0", "No Sound", "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, SlampicRomInfo, SlampicRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - SlampicInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsStrider = { - "strider", NULL, NULL, NULL, "1989", - "Strider (US set 1)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, StriderRomInfo, StriderRomName, NULL, NULL, StriderInputInfo, StriderDIPInfo, - StriderInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsStriderua = { - "striderua", "strider", NULL, NULL, "1989", - "Strider (US set 2)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE,2,HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, StrideruaRomInfo, StrideruaRomName, NULL, NULL, StriderInputInfo, StrideruaDIPInfo, - StriderInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsStrideruc = { - "strideruc", "strider", NULL, NULL, "1989", - "Strider (US, Street Fighter II conversion)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE,2,HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, StriderucRomInfo, StriderucRomName, NULL, NULL, StriderInputInfo, StrideruaDIPInfo, - StriderInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsStriderjr = { - "striderjr", "strider", NULL, NULL, "1989", - "Strider Hiryu (Japan Resale Ver.)\0", NULL, "Capcom", "CPS1", - L"\u30B9\u30C8\u30E9\u30A4\u30C0\u30FC\u98DB\u7ADC\0Strider Hiryu (Japan Resale Ver.)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, StriderjrRomInfo, StriderjrRomName, NULL, NULL, StriderInputInfo, StriderDIPInfo, - StriderjrInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsStriderj = { - "striderj", "strider", NULL, NULL, "1989", - "Strider Hiryu (Japan)\0", NULL, "Capcom", "CPS1", - L"\u30B9\u30C8\u30E9\u30A4\u30C0\u30FC\u98DB\u7ADC\0Strider Hiryu (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, StriderjRomInfo, StriderjRomName, NULL, NULL, StriderInputInfo, StriderDIPInfo, - StriderjInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsUnsquad = { - "unsquad", NULL, NULL, NULL, "1989", - "U.N. Squadron (US)\0", NULL, "Daipro / Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_HORSHOOT, 0, - NULL, UnsquadRomInfo, UnsquadRomName, NULL, NULL, UnsquadInputInfo, UnsquadDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsArea88 = { - "area88", "unsquad", NULL, NULL, "1989", - "Area 88 (Japan)\0", NULL, "Daipro / Capcom", "CPS1", - L"\u30A8\u30EA\u30A2\uFF18\uFF18\0Area 88 (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_HORSHOOT, 0, - NULL, Area88RomInfo, Area88RomName, NULL, NULL, UnsquadInputInfo, UnsquadDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsArea88r = { - "area88r", "unsquad", NULL, NULL, "1989", - "Area 88 (Japan Resale ver.)\0", NULL, "Daipro / Capcom", "CPS1", - L"\u30A8\u30EA\u30A2\uFF18\uFF18\0Area 88 (Japan Resale ver.)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_HORSHOOT, 0, - NULL, Area88rRomInfo, Area88rRomName, NULL, NULL, UnsquadInputInfo, UnsquadDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVarth = { - "varth", NULL, NULL, NULL, "1992", - "Varth - operation thunderstorm (920714 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, VarthRomInfo, VarthRomName, NULL, NULL, VarthInputInfo, VarthDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsVarthr1 = { - "varthr1", "varth", NULL, NULL, "1992", - "Varth - operation thunderstorm (920612 etc)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, Varthr1RomInfo, Varthr1RomName, NULL, NULL, VarthInputInfo, VarthDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsVarthj = { - "varthj", "varth", NULL, NULL, "1992", - "Varth - operation thunderstorm (920714 Japan)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2 ,HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, VarthjRomInfo, VarthjRomName, NULL, NULL, VarthInputInfo, VarthDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsVarthjr = { - "varthjr", "varth", NULL, NULL, "1992", - "Varth - operation thunderstorm (920714 Japan Resale Ver.)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2 ,HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, VarthjrRomInfo, VarthjrRomName, NULL, NULL, VarthInputInfo, VarthDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsVarthu = { - "varthu", "varth", NULL, NULL, "1992", - "Varth - operation thunderstorm (920612 USA)\0", NULL, "Capcom (Romstar license)", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, VarthuRomInfo, VarthuRomName, NULL, NULL, VarthInputInfo, VarthDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsVarthb = { - "varthb", "varth", NULL, NULL, "1992", - "Varth - operation thunderstorm (bootleg, 920612 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VERSHOOT, 0, - NULL, VarthbRomInfo, VarthbRomName, NULL, NULL, VarthInputInfo, VarthDIPInfo, - VarthbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsWillow = { - "willow", NULL, NULL, NULL, "1989", - "Willow (World)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, WillowRomInfo, WillowRomName, NULL, NULL, WillowInputInfo, WillowDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWillowu = { - "willowu", "willow", NULL, NULL, "1989", - "Willow (USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, WillowuRomInfo, WillowuRomName, NULL, NULL, WillowInputInfo, WillowDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWillowuo = { - "willowuo", "willow", NULL, NULL, "1989", - "Willow (USA Old Ver.)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, WillowuoRomInfo, WillowuoRomName, NULL, NULL, WillowInputInfo, WillowDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWillowj = { - "willowj", "willow", NULL, NULL, "1989", - "Willow (Japan, Japanese)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS1, GBF_PLATFORM, 0, - NULL, WillowjRomInfo, WillowjRomName, NULL, NULL, WillowInputInfo, WillowDIPInfo, - DrvInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWof = { - "wof", NULL, NULL, NULL, "1992", - "Warriors of Fate (921031 etc)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, WofRomInfo, WofRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofr1 = { - "wofr1", "wof", NULL, NULL, "1992", - "Warriors of Fate (921002 etc)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, Wofr1RomInfo, Wofr1RomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofu = { - "wofu", "wof", NULL, NULL, "1992", - "Warriors of Fate (921031 USA)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, WofuRomInfo, WofuRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofj = { - "wofj", "wof", NULL, NULL, "1992", - "Tenchi wo Kurau II - Sekiheki no Tatakai (921031 Japan)\0", NULL, "Capcom", "CPS1 / QSound", - L"\u5929\u5730\u3092\u55B0\u3089\u3046 II - \u8D64\u58C1\u306E\u6226\u3044\0Tenchi wo Kurau II - Sekiheki no Tatakai (921031 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, WofjRomInfo, WofjRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofa = { - "wofa", "wof", NULL, NULL, "1992", - "Sangokushi II (921005 Asia)\0", NULL, "Capcom", "CPS1 / QSound", - L"\u4E09\u56FD\u5FD7 II\0Sangokushi II (921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, WofaRomInfo, WofaRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofch = { - "wofch", NULL, NULL, NULL, "1992", - "Tenchi wo Kurau II - Sekiheki no Tatakai (CPS Changer, 921031 Japan)\0", NULL, "Capcom", "CPS Changer", - L"\u5929\u5730\u3092\u55B0\u3089\u3046 II - \u8D64\u58C1\u306E\u6226\u3044\0Tenchi wo Kurau II - Sekiheki no Tatakai (CPS Changer, 921031 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_CAPCOM_CPSCHANGER, GBF_SCRFIGHT, 0, - NULL, WofchRomInfo, WofchRomName, NULL, NULL, WofchInputInfo, NULL, - WofchInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofchdx = { - "wofchdx", "wofch", NULL, NULL, "2010", - "Sangokushi III Gaiden: Kakou-On's Revenge DX (hack)\0", NULL, "Capcom", "CPS Changer", - L"\u4E09\u56FD\u5FD7 III \u5916\u4F20: \u590F\u4FAF\u6069\u7684\u590D\u4EC7\0Sangokushi III Gaiden: Kakou-On's Revenge DX (hack)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPSCHANGER, GBF_SCRFIGHT, 0, - NULL, WofchdxRomInfo, WofchdxRomName, NULL, NULL, WofInputInfo, NULL, - WofchInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofhfh = { - "wofhfh", "wof", NULL, NULL, "1992", - "Sangokushi II: Huo Fenghuang (Chinese bootleg, 921005 Asia)\0", NULL, "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u706B\u9CF3\u51F0\0Sangokushi II: Huo Feng Huang (Chinese bootleg, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, WofhfhRomInfo, WofhfhRomName, NULL, NULL, WofhfhInputInfo, WofhfhDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofh = { - "wofh", "wof", NULL, NULL, "1992", - "Sangokushi II: Sanguo Yingxiong Zhuan (Chinese bootleg set 1, 921005 Asia)\0", NULL, "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u4E09\u570B\u82F1\u96C4\u50B3\0Sangokushi II: Sanguo YingXiongZhuan (Chinese bootleg set 1, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, WofhRomInfo, WofhRomName, NULL, NULL, WofhInputInfo, WofhDIPInfo, - WofhInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofha = { - "wofha", "wof", NULL, NULL, "1992", - "Sangokushi II: Sanguo Yingxiong Zhuan (Chinese bootleg set 2, 921005 Asia)\0", NULL, "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u4E09\u570B\u82F1\u96C4\u50B3\0Sangokushi II: Sanguo YingXiongZhuan (Chinese bootleg set 2, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, WofhaRomInfo, WofhaRomName, NULL, NULL, WofhInputInfo, WofhDIPInfo, - WofhInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSgyxz = { - "sgyxz", "wof", NULL, NULL, "1992", - "Sangokushi II: Sanguo Yingxiong Zhuan (Chinese bootleg set 3, 921005 Asia)\0", NULL, "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u4E09\u570B\u82F1\u96C4\u50B3\0Sangokushi II: Sanguo YingXiongZhuan (Chinese bootleg set 3, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, SgyxzRomInfo, SgyxzRomName, NULL, NULL, WofhInputInfo, WofhDIPInfo, - SgyxzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWof3js = { - "wof3js", "wof", NULL, NULL, "1992", - "Sangokushi II: San Jian Sheng (Chinese bootleg set 1, 921005 Asia)\0", NULL, "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u4E09\u528D\u8056\0Sangokushi II: San Jian Sheng (Chinese bootleg set 1, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Wof3jsRomInfo, Wof3jsRomName, NULL, NULL, Wof3jsInputInfo, Wof3jsDIPInfo, - Wof3jsInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWof3jsa = { - "wof3jsa", "wof", NULL, NULL, "1992", - "Sangokushi II: San Jian Sheng (Chinese bootleg set 2, 921005 Asia)\0", NULL, "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u4E09\u528D\u8056\0Sangokushi II: San Jian Sheng (Chinese bootleg set 2, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Wof3jsaRomInfo, Wof3jsaRomName, NULL, NULL, Wof3jsInputInfo, Wof3jsaDIPInfo, - Wof3jsaInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWof3sj = { - "wof3sj", "wof", NULL, NULL, "1992", - "Sangokushi II: San Sheng Jian (Chinese bootleg set 1, 921005 Asia)\0", NULL, "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u4E09\u5723\u5251\0Sangokushi II: San Sheng Jian (Chinese bootleg set 1, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Wof3sjRomInfo, Wof3sjRomName, NULL, NULL, WofhInputInfo, Wof3sjDIPInfo, - Wof3sjInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWof3sja = { - "wof3sja", "wof", NULL, NULL, "1992", - "Sangokushi II: San Sheng Jian (Chinese bootleg set 2, 921005 Asia)\0", NULL, "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u4E09\u5723\u5251\0Sangokushi II: San Sheng Jian (Chinese bootleg set 2, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, Wof3sjaRomInfo, Wof3sjaRomName, NULL, NULL, WofhInputInfo, Wof3sjDIPInfo, - Wof3sjInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofsj = { - "wofsj", "wof", NULL, NULL, "1992", - "Sangokushi II: Sheng Jian Sanguo (Chinese bootleg set 1, 921005 Asia)\0", "Imperfect Graphics", "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u5723\u5251\u4E09\0Sangokushi II: Sheng Jian Sanguo (Chinese bootleg set 1, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, WofsjRomInfo, WofsjRomName, NULL, NULL, WofhInputInfo, Wof3sjDIPInfo, - WofsjInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofsja = { - "wofsja", "wof", NULL, NULL, "1992", - "Sangokushi II: Sheng Jian Sanguo (Chinese bootleg set 2, 921005 Asia)\0", "Imperfect Graphics", "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u5723\u5251\u4E09\0Sangokushi II: Sheng Jian Sanguo (Chinese bootleg set 2, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, WofsjaRomInfo, WofsjaRomName, NULL, NULL, WofhInputInfo, Wof3sjDIPInfo, - WofsjInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofsjb = { - "wofsjb", "wof", NULL, NULL, "1992", - "Sangokushi II: Sheng Jian Sanguo (Chinese bootleg set 3, 921005 Asia)\0", "No sound", "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u5723\u5251\u4E09\0Sangokushi II: Sheng Jian Sanguo (Chinese bootleg set 3, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, WofsjbRomInfo, WofsjbRomName, NULL, NULL, WofsjbInputInfo, NULL, - WofsjbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofsjc = { - "wofsjc", "wof", NULL, NULL, "1992", - "Sangokushi II: Sheng Jian Sanguo (Chinese bootleg set 4, 921005 Asia)\0", "Imperfect graphics", "bootleg", "CPS1", - L"\u4E09\u56FD\u5FD7 II: \u5723\u5251\u4E09\0Sangokushi II: Sheng Jian Sanguo (Chinese bootleg set 4, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, WofsjcRomInfo, WofsjcRomName, NULL, NULL, WofhInputInfo, Wof3sjDIPInfo, - WofsjInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofb = { - "wofb", "wof", NULL, NULL, "1992", - "Warriors of Fate (bootleg, 921002 etc)\0", NULL, "bootleg", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0, - NULL, WofbRomInfo, WofbRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - WofbInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofjh = { - "wofjh", "wof", NULL, NULL, "1992", - "Tenchi wo Kurau II - Sekiheki no Tatakai (hack, 921031 Japan)\0", NULL, "hack", "CPS1 / QSound", - L"\u5929\u5730\u3092\u55B0\u3089\u3046 II - \u8D64\u58C1\u306E\u6226\u3044\0Tenchi wo Kurau II - Sekiheki no Tatakai (hack, 921031 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, WofjhRomInfo, WofjhRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofah = { - "wofah", "wof", NULL, NULL, "1992", - "Sangokushi II (hack set 1, 921005 Asia)\0", NULL, "hack", "CPS1 / QSound", - L"\u4E09\u56FD\u5FD7 II\0Sangokushi II (hack set 1, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, WofahRomInfo, WofahRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofaha = { - "wofaha", "wof", NULL, NULL, "1992", - "Sangokushi II (hack set 2, 921005 Asia)\0", NULL, "hack", "CPS1 / QSound", - L"\u4E09\u56FD\u5FD7 II\0Sangokushi II (hack set 2, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, WofahaRomInfo, WofahaRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsWofahb = { - "wofahb", "wof", NULL, NULL, "1992", - "Sangokushi II (hack set 3, 921005 Asia)\0", NULL, "hack", "CPS1 / QSound", - L"\u4E09\u56FD\u5FD7 II\0Sangokushi II (hack set 3, 921005 Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, WofahbRomInfo, WofahbRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCps1frog = { - "cps1frog", NULL, NULL, NULL, "2006", - "Frog Feast (CPS-1)\0", NULL, "Rastersoft (Homebrew)", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_CAPCOM_CPS1, GBF_MISC, 0, - NULL, Cps1frogRomInfo, Cps1frogRomName, NULL, NULL, FfightInputInfo, FfightDIPInfo, - Cps1demoInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Not included games - -// Pnickies (USA) -// Seems like a region hack -static struct BurnRomInfo PnickuRomDesc[] = { - { "pnij36.bin", 0x020000, 0x2d4ffb2b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "pniu42.bin", 0x020000, 0x22d20227, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - - { "pnij09.bin", 0x020000, 0x48177b0a, BRF_GRA | CPS1_TILES }, - { "pnij01.bin", 0x020000, 0x01a0f311, BRF_GRA | CPS1_TILES }, - { "pnij13.bin", 0x020000, 0x406451b0, BRF_GRA | CPS1_TILES }, - { "pnij05.bin", 0x020000, 0x8c515dc0, BRF_GRA | CPS1_TILES }, - { "pnij26.bin", 0x020000, 0xe2af981e, BRF_GRA | CPS1_TILES }, - { "pnij18.bin", 0x020000, 0xf17a0e56, BRF_GRA | CPS1_TILES }, - { "pnij38.bin", 0x020000, 0xeb75bd8c, BRF_GRA | CPS1_TILES }, - { "pnij32.bin", 0x020000, 0x84560bef, BRF_GRA | CPS1_TILES }, - { "pnij10.bin", 0x020000, 0xc2acc171, BRF_GRA | CPS1_TILES }, - { "pnij02.bin", 0x020000, 0x0e21fc33, BRF_GRA | CPS1_TILES }, - { "pnij14.bin", 0x020000, 0x7fe59b19, BRF_GRA | CPS1_TILES }, - { "pnij06.bin", 0x020000, 0x79f4bfe3, BRF_GRA | CPS1_TILES }, - { "pnij27.bin", 0x020000, 0x83d5cb0e, BRF_GRA | CPS1_TILES }, - { "pnij19.bin", 0x020000, 0xaf08b230, BRF_GRA | CPS1_TILES }, - { "pnij39.bin", 0x020000, 0x70fbe579, BRF_GRA | CPS1_TILES }, - { "pnij33.bin", 0x020000, 0x3ed2c680, BRF_GRA | CPS1_TILES }, - - { "pnij17.bin", 0x010000, 0xe86f787a, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "pnij24.bin", 0x020000, 0x5092257d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "pnij25.bin", 0x020000, 0x22109aaa, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Pnicku) -STD_ROM_FN(Pnicku) - -struct BurnDriverX BurnDrvCpsPnicku = { - "pnicku", "pnickj", NULL, NULL, "1994", - "Pnickies (940608 USA)\0", NULL, "Compile (Capcom license)", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_CAPCOM_CPS1, GBF_PUZZLE, 0, - NULL, PnickuRomInfo, PnickuRomName, NULL, NULL, PnickjInputInfo, PnickjDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Saturday Night Slam Masters (Asia) -// Seems to be just a region hack - -static struct BurnRomInfo SlammasaRomDesc[] = { - { "mba_23e.rom", 0x080000, 0x027e49db, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbe_24b.rom", 0x020000, 0x95d5e729, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_28b.rom", 0x020000, 0xb1c7cbcb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_25b.rom", 0x020000, 0xa50d3fd4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_29b.rom", 0x020000, 0x08e32e56, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_21a.rom", 0x080000, 0xd5007b05, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbe_20a.rom", 0x080000, 0xaeb557b0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb_gfx01.rom", 0x080000, 0x41468e06, BRF_GRA | CPS1_TILES }, - { "mb_gfx03.rom", 0x080000, 0xf453aa9e, BRF_GRA | CPS1_TILES }, - { "mb_gfx02.rom", 0x080000, 0x2ffbfea8, BRF_GRA | CPS1_TILES }, - { "mb_gfx04.rom", 0x080000, 0x1eb9841d, BRF_GRA | CPS1_TILES }, - { "mb_05.bin", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb_07.bin", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb_06.bin", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb_08.bin", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb_10.bin", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb_12.bin", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb_11.bin", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb_13.bin", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_qa.rom", 0x020000, 0xe21a03c4, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb_q1.bin", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q2.bin", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q3.bin", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q4.bin", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q5.bin", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q6.bin", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q7.bin", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q8.bin", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Slammasa) -STD_ROM_FN(Slammasa) - -struct BurnDriverX BurnDrvCpsSlammasa = { - "slammasa", "slammast", NULL, NULL, "1993", - "Saturday Night Slam Masters (Slam Masters 930301 Asia)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, SlammasaRomInfo, SlammasaRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Saturday Night Slam Masters (Hispanic) -// Seems to be just a region hack -static struct BurnRomInfo SlammashRomDesc[] = { - { "mbh_23e.rom", 0x080000, 0xb0220f4a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbe_24b.rom", 0x020000, 0x95d5e729, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_28b.rom", 0x020000, 0xb1c7cbcb, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_25b.rom", 0x020000, 0xa50d3fd4, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_29b.rom", 0x020000, 0x08e32e56, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbe_21a.rom", 0x080000, 0xd5007b05, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbe_20a.rom", 0x080000, 0xaeb557b0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb_gfx01.rom", 0x080000, 0x41468e06, BRF_GRA | CPS1_TILES }, - { "mb_gfx03.rom", 0x080000, 0xf453aa9e, BRF_GRA | CPS1_TILES }, - { "mb_gfx02.rom", 0x080000, 0x2ffbfea8, BRF_GRA | CPS1_TILES }, - { "mb_gfx04.rom", 0x080000, 0x1eb9841d, BRF_GRA | CPS1_TILES }, - { "mb_05.bin", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb_07.bin", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb_06.bin", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb_08.bin", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb_10.bin", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb_12.bin", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb_11.bin", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb_13.bin", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_qa.rom", 0x020000, 0xe21a03c4, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb_q1.bin", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q2.bin", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q3.bin", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q4.bin", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q5.bin", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q6.bin", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q7.bin", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q8.bin", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Slammash) -STD_ROM_FN(Slammash) - -struct BurnDriverX BurnDrvCpsSlammash = { - "slammash", "slammast", NULL, NULL, "1993", - "Saturday Night Slam Masters (Slam Masters 930713 Hispanic)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, SlammashRomInfo, SlammashRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Muscle Bomber Duo (Japan E) -// Seems to be just a region hack -static struct BurnRomInfo MbombdjeRomDesc[] = { - { "mbd_26.bin", 0x020000, 0x72b7451c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdje_30.rom", 0x020000, 0x61b09fb1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_27.bin", 0x020000, 0x4086f534, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_31.bin", 0x020000, 0x085f47f0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_24.bin", 0x020000, 0xc20895a5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_28.bin", 0x020000, 0x2618d5e1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_25.bin", 0x020000, 0x9bdb6b11, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_29.bin", 0x020000, 0x3f52d5e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_21.bin", 0x080000, 0x690c026a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbd_20.bin", 0x080000, 0xb8b2139b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb_gfx01.rom", 0x080000, 0x41468e06, BRF_GRA | CPS1_TILES }, - { "mb_gfx03.rom", 0x080000, 0xf453aa9e, BRF_GRA | CPS1_TILES }, - { "mb_gfx02.rom", 0x080000, 0x2ffbfea8, BRF_GRA | CPS1_TILES }, - { "mb_gfx04.rom", 0x080000, 0x1eb9841d, BRF_GRA | CPS1_TILES }, - { "mb_05.bin", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb_07.bin", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb_06.bin", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb_08.bin", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb_10.bin", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb_12.bin", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb_11.bin", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb_13.bin", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_q.bin", 0x020000, 0xd6fa76d1, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb_q1.bin", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q2.bin", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q3.bin", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q4.bin", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q5.bin", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q6.bin", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q7.bin", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q8.bin", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Mbombdje) -STD_ROM_FN(Mbombdje) - -struct BurnDriverX BurnDrvCpsMbombdje = { - "mbombdje", "mbombrd", NULL, NULL, "1993", - "Muscle Bomber Duo - heat up warriors (931206 Japan E)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, MbombdjeRomInfo, MbombdjeRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Muscle Bomber Duo (Asia) -// Seems to be just a region hack -static struct BurnRomInfo MbombrdaRomDesc[] = { - { "mbd_26.bin", 0x020000, 0x72b7451c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbda_30.rom", 0x020000, 0x42eaa9da, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_27.bin", 0x020000, 0x4086f534, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_31.bin", 0x020000, 0x085f47f0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_24.bin", 0x020000, 0xc20895a5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_28.bin", 0x020000, 0x2618d5e1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_25.bin", 0x020000, 0x9bdb6b11, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_29.bin", 0x020000, 0x3f52d5e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_21.bin", 0x080000, 0x690c026a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbd_20.bin", 0x080000, 0xb8b2139b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb_gfx01.rom", 0x080000, 0x41468e06, BRF_GRA | CPS1_TILES }, - { "mb_gfx03.rom", 0x080000, 0xf453aa9e, BRF_GRA | CPS1_TILES }, - { "mb_gfx02.rom", 0x080000, 0x2ffbfea8, BRF_GRA | CPS1_TILES }, - { "mb_gfx04.rom", 0x080000, 0x1eb9841d, BRF_GRA | CPS1_TILES }, - { "mb_05.bin", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb_07.bin", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb_06.bin", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb_08.bin", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb_10.bin", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb_12.bin", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb_11.bin", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb_13.bin", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_q.bin", 0x020000, 0xd6fa76d1, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb_q1.bin", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q2.bin", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q3.bin", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q4.bin", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q5.bin", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q6.bin", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q7.bin", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q8.bin", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Mbombrda) -STD_ROM_FN(Mbombrda) - -struct BurnDriverX BurnDrvCpsMbombrda = { - "mbombrda", "mbombrd", NULL, NULL, "1993", - "Muscle Bomber Duo - ultimate team battle (931206 Asia)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, MbombrdaRomInfo, MbombrdaRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Muscle Bomber Duo (Hispanic) -// Seems to be just a region hack -static struct BurnRomInfo MbombrdhRomDesc[] = { - { "mbd_26.bin", 0x020000, 0x72b7451c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdh_30.rom", 0x020000, 0x836cea7d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_27.bin", 0x020000, 0x4086f534, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_31.bin", 0x020000, 0x085f47f0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_24.bin", 0x020000, 0xc20895a5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_28.bin", 0x020000, 0x2618d5e1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_25.bin", 0x020000, 0x9bdb6b11, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_29.bin", 0x020000, 0x3f52d5e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_21.bin", 0x080000, 0x690c026a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbd_20.bin", 0x080000, 0xb8b2139b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb_gfx01.rom", 0x080000, 0x41468e06, BRF_GRA | CPS1_TILES }, - { "mb_gfx03.rom", 0x080000, 0xf453aa9e, BRF_GRA | CPS1_TILES }, - { "mb_gfx02.rom", 0x080000, 0x2ffbfea8, BRF_GRA | CPS1_TILES }, - { "mb_gfx04.rom", 0x080000, 0x1eb9841d, BRF_GRA | CPS1_TILES }, - { "mb_05.bin", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb_07.bin", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb_06.bin", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb_08.bin", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb_10.bin", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb_12.bin", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb_11.bin", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb_13.bin", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_q.bin", 0x020000, 0xd6fa76d1, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb_q1.bin", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q2.bin", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q3.bin", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q4.bin", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q5.bin", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q6.bin", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q7.bin", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q8.bin", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Mbombrdh) -STD_ROM_FN(Mbombrdh) - -struct BurnDriverX BurnDrvCpsMbombrdh = { - "mbombrdh", "mbombrd", NULL, NULL, "1993", - "Muscle Bomber Duo - ultimate team battle (931206 Hispanic)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, MbombrdhRomInfo, MbombrdhRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Muscle Bomber Duo (USA) -// Seems to be just a region hack -static struct BurnRomInfo MbombrduRomDesc[] = { - { "mbd_26.bin", 0x020000, 0x72b7451c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbdu_30.rom", 0x020000, 0x5c234403, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_27.bin", 0x020000, 0x4086f534, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_31.bin", 0x020000, 0x085f47f0, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_24.bin", 0x020000, 0xc20895a5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_28.bin", 0x020000, 0x2618d5e1, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_25.bin", 0x020000, 0x9bdb6b11, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_29.bin", 0x020000, 0x3f52d5e5, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP }, - { "mbd_21.bin", 0x080000, 0x690c026a, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "mbd_20.bin", 0x080000, 0xb8b2139b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "mb_gfx01.rom", 0x080000, 0x41468e06, BRF_GRA | CPS1_TILES }, - { "mb_gfx03.rom", 0x080000, 0xf453aa9e, BRF_GRA | CPS1_TILES }, - { "mb_gfx02.rom", 0x080000, 0x2ffbfea8, BRF_GRA | CPS1_TILES }, - { "mb_gfx04.rom", 0x080000, 0x1eb9841d, BRF_GRA | CPS1_TILES }, - { "mb_05.bin", 0x080000, 0x506b9dc9, BRF_GRA | CPS1_TILES }, - { "mb_07.bin", 0x080000, 0xaff8c2fb, BRF_GRA | CPS1_TILES }, - { "mb_06.bin", 0x080000, 0xb76c70e9, BRF_GRA | CPS1_TILES }, - { "mb_08.bin", 0x080000, 0xe60c9556, BRF_GRA | CPS1_TILES }, - { "mb_10.bin", 0x080000, 0x97976ff5, BRF_GRA | CPS1_TILES }, - { "mb_12.bin", 0x080000, 0xb350a840, BRF_GRA | CPS1_TILES }, - { "mb_11.bin", 0x080000, 0x8fb94743, BRF_GRA | CPS1_TILES }, - { "mb_13.bin", 0x080000, 0xda810d5f, BRF_GRA | CPS1_TILES }, - - { "mb_q.bin", 0x020000, 0xd6fa76d1, BRF_ESS | BRF_PRG | CPS1_Z80_PROGRAM }, - - { "mb_q1.bin", 0x080000, 0x0630c3ce, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q2.bin", 0x080000, 0x354f9c21, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q3.bin", 0x080000, 0x7838487c, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q4.bin", 0x080000, 0xab66e087, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q5.bin", 0x080000, 0xc789fef2, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q6.bin", 0x080000, 0xecb81b61, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q7.bin", 0x080000, 0x041e49ba, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "mb_q8.bin", 0x080000, 0x59fe702a, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Mbombrdu) -STD_ROM_FN(Mbombrdu) - -struct BurnDriverX BurnDrvCpsMbombrdu = { - "mbombrdu", "mbombrd", NULL, NULL, "1993", - "Muscle Bomber Duo - ultimate team battle (931206 USA)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 4, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, 0, - NULL, MbombrduRomInfo, MbombrduRomName, NULL, NULL, SlammastInputInfo, SlammastDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -static struct BurnRomInfo Sf2cebrRomDesc[] = { - { "sf2cebr.23", 0x080000, 0x74e848ee, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2cebr.22", 0x080000, 0xc3c49626, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.bin", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92br_10.bin", 0x080000, 0xb3e1dd5f, BRF_GRA | CPS1_TILES }, - { "s92br_11.bin", 0x080000, 0xf13af812, BRF_GRA | CPS1_TILES }, - { "s92br_12.bin", 0x080000, 0x10ce42af, BRF_GRA | CPS1_TILES }, - { "s92br_13.bin", 0x080000, 0x32cf5af3, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2cebr) -STD_ROM_FN(Sf2cebr) - -struct BurnDriverX BurnDrvCpsSf2cebr = { - "sf2cebr", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (bootleg, Brazil)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2cebrRomInfo, Sf2cebrRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -static struct BurnRomInfo Sf2cehRomDesc[] = { - { "sf2ceh.23", 0x080000, 0x25dc14c8, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sf2ceh.22", 0x080000, 0x1c9dd91c, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "s92_21a.bin", 0x080000, 0x925a7877, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "s92_01.bin", 0x080000, 0x03b0d852, BRF_GRA | CPS1_TILES }, - { "s92_02.bin", 0x080000, 0x840289ec, BRF_GRA | CPS1_TILES }, - { "s92_03.bin", 0x080000, 0xcdb5f027, BRF_GRA | CPS1_TILES }, - { "s92_04.bin", 0x080000, 0xe2799472, BRF_GRA | CPS1_TILES }, - { "s92_05.bin", 0x080000, 0xba8a2761, BRF_GRA | CPS1_TILES }, - { "s92_06.bin", 0x080000, 0xe584bfb5, BRF_GRA | CPS1_TILES }, - { "s92_07.bin", 0x080000, 0x21e3f87d, BRF_GRA | CPS1_TILES }, - { "s92_08.bin", 0x080000, 0xbefc47df, BRF_GRA | CPS1_TILES }, - { "s92_10.bin", 0x080000, 0x960687d5, BRF_GRA | CPS1_TILES }, - { "s92_11.bin", 0x080000, 0x978ecd18, BRF_GRA | CPS1_TILES }, - { "s92_12.bin", 0x080000, 0xd6ec9a0a, BRF_GRA | CPS1_TILES }, - { "s92_13.bin", 0x080000, 0xed2c67f6, BRF_GRA | CPS1_TILES }, - - { "s92_09.bin", 0x010000, 0x08f6b60e, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "s92_18.bin", 0x020000, 0x7f162009, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "s92_19.bin", 0x020000, 0xbeade53f, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sf2ceh) -STD_ROM_FN(Sf2ceh) - -struct BurnDriverX BurnDrvCpsSf2ceh = { - "sf2ceh", "sf2ce", NULL, NULL, "1992", - "Street Fighter II' - Champion Edition (bootleg, Hispanic)\0", NULL, "Capcom", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF, - NULL, Sf2cehRomInfo, Sf2cehRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo, - Sf2ceInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Warriors of Fate (French Translation) -// Very similar to wof -static struct BurnRomInfo WoffrRomDesc[] = { - { "tk2e_23bfr.rom",0x080000, 0xe006e81e, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "tk2e_22b.rom", 0x080000, 0x479b3f24, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "tk2_gfx1.rom", 0x080000, 0x0d9cb9bf, BRF_GRA | CPS1_TILES }, - { "tk2_gfx3.rom", 0x080000, 0x45227027, BRF_GRA | CPS1_TILES }, - { "tk2_gfx2.rom", 0x080000, 0xc5ca2460, BRF_GRA | CPS1_TILES }, - { "tk2_gfx4.rom", 0x080000, 0xe349551c, BRF_GRA | CPS1_TILES }, - { "tk2_gfx5fr.rom",0x080000, 0x1b6bc2b2, BRF_GRA | CPS1_TILES }, - { "tk2_gfx7fr.rom",0x080000, 0x3f1e5334, BRF_GRA | CPS1_TILES }, - { "tk2_gfx6fr.rom",0x080000, 0x28c9d96f, BRF_GRA | CPS1_TILES }, - { "tk2_gfx8fr.rom",0x080000, 0xb3b9a29e, BRF_GRA | CPS1_TILES }, - - { "tk2_qa.rom", 0x020000, 0xc9183a0d, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "tk2_q1.rom", 0x080000, 0x611268cf, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q2.rom", 0x080000, 0x20f55ca9, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q3.rom", 0x080000, 0xbfcf6f52, BRF_SND | CPS1_QSOUND_SAMPLES }, - { "tk2_q4.rom", 0x080000, 0x36642e88, BRF_SND | CPS1_QSOUND_SAMPLES }, -}; - -STD_ROM_PICK(Woffr) -STD_ROM_FN(Woffr) - -struct BurnDriverX BurnDrvCpsWoffr = { - "woffr", "wof", NULL, NULL, "1992", - "Warriors of Fate (French Translation)\0", NULL, "Capcom", "CPS1 / QSound", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 3, HARDWARE_CAPCOM_CPS1_QSOUND, GBF_SCRFIGHT, 0, - NULL, WoffrRomInfo, WoffrRomName, NULL, NULL, WofInputInfo, WofDIPInfo, - TwelveMhzInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// CPS Changer Region Hacks (not included) - -// Street Fighter Alpha (CPS Changer, 950727 Publicity US) -static struct BurnRomInfo SfachRomDesc[] = { - { "sfach23", 0x080000, 0x02a1a853, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza22", 0x080000, 0x8d9b2480, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfzch21", 0x080000, 0x5435225d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza20", 0x080000, 0x806e8f38, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "sfz_01.3a", 0x080000, 0x0dd53e62, BRF_GRA | CPS1_TILES }, - { "sfz_02.4a", 0x080000, 0x94c31e3f, BRF_GRA | CPS1_TILES }, - { "sfz_03.5a", 0x080000, 0x9584ac85, BRF_GRA | CPS1_TILES }, - { "sfz_04.6a", 0x080000, 0xb983624c, BRF_GRA | CPS1_TILES }, - { "sfz_05.7a", 0x080000, 0x2b47b645, BRF_GRA | CPS1_TILES }, - { "sfz_06.8a", 0x080000, 0x74fd9fb1, BRF_GRA | CPS1_TILES }, - { "sfz_07.9a", 0x080000, 0xbb2c734d, BRF_GRA | CPS1_TILES }, - { "sfz_08.10a", 0x080000, 0x454f7868, BRF_GRA | CPS1_TILES }, - { "sfz_10.3c", 0x080000, 0x2a7d675e, BRF_GRA | CPS1_TILES }, - { "sfz_11.4c", 0x080000, 0xe35546c8, BRF_GRA | CPS1_TILES }, - { "sfz_12.5c", 0x080000, 0xf122693a, BRF_GRA | CPS1_TILES }, - { "sfz_13.6c", 0x080000, 0x7cf942c8, BRF_GRA | CPS1_TILES }, - { "sfz_14.7c", 0x080000, 0x09038c81, BRF_GRA | CPS1_TILES }, - { "sfz_15.8c", 0x080000, 0x1aa17391, BRF_GRA | CPS1_TILES }, - { "sfz_16.9c", 0x080000, 0x19a5abd6, BRF_GRA | CPS1_TILES }, - { "sfz_17.10c", 0x080000, 0x248b3b73, BRF_GRA | CPS1_TILES }, - - { "sfz_09.12a", 0x010000, 0xc772628b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sfz_18.11c", 0x020000, 0x61022b2d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sfz_19.12c", 0x020000, 0x3b5886d5, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sfach) -STD_ROM_FN(Sfach) - -struct BurnDriverX BurnDrvCpsSfach = { - "sfach", "sfzch", NULL, NULL, "1995", - "Street Fighter Alpha (CPS Changer, 950727 Publicity US)\0", NULL, "Capcom", "CPS Changer", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPSCHANGER, GBF_VSFIGHT, FBF_SF, - NULL, SfachRomInfo, SfachRomName, NULL, NULL, SfzchInputInfo, NULL, - SfzchInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Street Fighter Zero (CPS Changer, 950925 Asia) -static struct BurnRomInfo SfzachRomDesc[] = { - { "sfzach23", 0x080000, 0x2562108b, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza22", 0x080000, 0x8d9b2480, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfzch21", 0x080000, 0x5435225d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza20", 0x080000, 0x806e8f38, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "sfz_01.3a", 0x080000, 0x0dd53e62, BRF_GRA | CPS1_TILES }, - { "sfz_02.4a", 0x080000, 0x94c31e3f, BRF_GRA | CPS1_TILES }, - { "sfz_03.5a", 0x080000, 0x9584ac85, BRF_GRA | CPS1_TILES }, - { "sfz_04.6a", 0x080000, 0xb983624c, BRF_GRA | CPS1_TILES }, - { "sfz_05.7a", 0x080000, 0x2b47b645, BRF_GRA | CPS1_TILES }, - { "sfz_06.8a", 0x080000, 0x74fd9fb1, BRF_GRA | CPS1_TILES }, - { "sfz_07.9a", 0x080000, 0xbb2c734d, BRF_GRA | CPS1_TILES }, - { "sfz_08.10a", 0x080000, 0x454f7868, BRF_GRA | CPS1_TILES }, - { "sfz_10.3c", 0x080000, 0x2a7d675e, BRF_GRA | CPS1_TILES }, - { "sfz_11.4c", 0x080000, 0xe35546c8, BRF_GRA | CPS1_TILES }, - { "sfz_12.5c", 0x080000, 0xf122693a, BRF_GRA | CPS1_TILES }, - { "sfz_13.6c", 0x080000, 0x7cf942c8, BRF_GRA | CPS1_TILES }, - { "sfz_14.7c", 0x080000, 0x09038c81, BRF_GRA | CPS1_TILES }, - { "sfz_15.8c", 0x080000, 0x1aa17391, BRF_GRA | CPS1_TILES }, - { "sfz_16.9c", 0x080000, 0x19a5abd6, BRF_GRA | CPS1_TILES }, - { "sfz_17.10c", 0x080000, 0x248b3b73, BRF_GRA | CPS1_TILES }, - - { "sfz_09.12a", 0x010000, 0xc772628b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sfz_18.11c", 0x020000, 0x61022b2d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sfz_19.12c", 0x020000, 0x3b5886d5, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sfzach) -STD_ROM_FN(Sfzach) - -struct BurnDriverX BurnDrvCpsSfzach = { - "sfzach", "sfzch", NULL, NULL, "1995", - "Street Fighter Zero (CPS Changer, 950925 Asia)\0", NULL, "Capcom", "CPS Changer", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPSCHANGER, GBF_VSFIGHT, FBF_SF, - NULL, SfzachRomInfo, SfzachRomName, NULL, NULL, SfzchInputInfo, NULL, - SfzchInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Street Fighter Zero (CPS Changer, 950727 Brazil) -static struct BurnRomInfo SfzbchRomDesc[] = { - { "sfbch23", 0x080000, 0x53699f68, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza22", 0x080000, 0x8d9b2480, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfzch21", 0x080000, 0x5435225d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza20", 0x080000, 0x806e8f38, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "sfz_01.3a", 0x080000, 0x0dd53e62, BRF_GRA | CPS1_TILES }, - { "sfz_02.4a", 0x080000, 0x94c31e3f, BRF_GRA | CPS1_TILES }, - { "sfz_03.5a", 0x080000, 0x9584ac85, BRF_GRA | CPS1_TILES }, - { "sfz_04.6a", 0x080000, 0xb983624c, BRF_GRA | CPS1_TILES }, - { "sfz_05.7a", 0x080000, 0x2b47b645, BRF_GRA | CPS1_TILES }, - { "sfz_06.8a", 0x080000, 0x74fd9fb1, BRF_GRA | CPS1_TILES }, - { "sfz_07.9a", 0x080000, 0xbb2c734d, BRF_GRA | CPS1_TILES }, - { "sfz_08.10a", 0x080000, 0x454f7868, BRF_GRA | CPS1_TILES }, - { "sfz_10.3c", 0x080000, 0x2a7d675e, BRF_GRA | CPS1_TILES }, - { "sfz_11.4c", 0x080000, 0xe35546c8, BRF_GRA | CPS1_TILES }, - { "sfz_12.5c", 0x080000, 0xf122693a, BRF_GRA | CPS1_TILES }, - { "sfz_13.6c", 0x080000, 0x7cf942c8, BRF_GRA | CPS1_TILES }, - { "sfz_14.7c", 0x080000, 0x09038c81, BRF_GRA | CPS1_TILES }, - { "sfz_15.8c", 0x080000, 0x1aa17391, BRF_GRA | CPS1_TILES }, - { "sfz_16.9c", 0x080000, 0x19a5abd6, BRF_GRA | CPS1_TILES }, - { "sfz_17.10c", 0x080000, 0x248b3b73, BRF_GRA | CPS1_TILES }, - - { "sfz_09.12a", 0x010000, 0xc772628b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sfz_18.11c", 0x020000, 0x61022b2d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sfz_19.12c", 0x020000, 0x3b5886d5, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sfzbch) -STD_ROM_FN(Sfzbch) - -struct BurnDriverX BurnDrvCpsSfzbch = { - "sfzbch", "sfzch", NULL, NULL, "1995", - "Street Fighter Zero (CPS Changer, 950727 Brazil)\0", NULL, "Capcom", "CPS Changer", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPSCHANGER, GBF_VSFIGHT, FBF_SF, - NULL, SfzbchRomInfo, SfzbchRomName, NULL, NULL, SfzchInputInfo, NULL, - SfzchInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Street Fighter Zero (CPS Changer, 950727 Euro) -static struct BurnRomInfo SfzechRomDesc[] = { - { "sfzech23", 0x080000, 0x5ec7058f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza22", 0x080000, 0x8d9b2480, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfzch21", 0x080000, 0x5435225d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza20", 0x080000, 0x806e8f38, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "sfz_01.3a", 0x080000, 0x0dd53e62, BRF_GRA | CPS1_TILES }, - { "sfz_02.4a", 0x080000, 0x94c31e3f, BRF_GRA | CPS1_TILES }, - { "sfz_03.5a", 0x080000, 0x9584ac85, BRF_GRA | CPS1_TILES }, - { "sfz_04.6a", 0x080000, 0xb983624c, BRF_GRA | CPS1_TILES }, - { "sfz_05.7a", 0x080000, 0x2b47b645, BRF_GRA | CPS1_TILES }, - { "sfz_06.8a", 0x080000, 0x74fd9fb1, BRF_GRA | CPS1_TILES }, - { "sfz_07.9a", 0x080000, 0xbb2c734d, BRF_GRA | CPS1_TILES }, - { "sfz_08.10a", 0x080000, 0x454f7868, BRF_GRA | CPS1_TILES }, - { "sfz_10.3c", 0x080000, 0x2a7d675e, BRF_GRA | CPS1_TILES }, - { "sfz_11.4c", 0x080000, 0xe35546c8, BRF_GRA | CPS1_TILES }, - { "sfz_12.5c", 0x080000, 0xf122693a, BRF_GRA | CPS1_TILES }, - { "sfz_13.6c", 0x080000, 0x7cf942c8, BRF_GRA | CPS1_TILES }, - { "sfz_14.7c", 0x080000, 0x09038c81, BRF_GRA | CPS1_TILES }, - { "sfz_15.8c", 0x080000, 0x1aa17391, BRF_GRA | CPS1_TILES }, - { "sfz_16.9c", 0x080000, 0x19a5abd6, BRF_GRA | CPS1_TILES }, - { "sfz_17.10c", 0x080000, 0x248b3b73, BRF_GRA | CPS1_TILES }, - - { "sfz_09.12a", 0x010000, 0xc772628b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sfz_18.11c", 0x020000, 0x61022b2d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sfz_19.12c", 0x020000, 0x3b5886d5, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sfzech) -STD_ROM_FN(Sfzech) - -struct BurnDriverX BurnDrvCpsSfzech = { - "sfzech", "sfzch", NULL, NULL, "1995", - "Street Fighter Zero (CPS Changer, 950727 Euro)\0", NULL, "Capcom", "CPS Changer", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPSCHANGER, GBF_VSFIGHT, FBF_SF, - NULL, SfzechRomInfo, SfzechRomName, NULL, NULL, SfzchInputInfo, NULL, - SfzchInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Street Fighter Zero (CPS Changer, 950727 Hispanic) -static struct BurnRomInfo SfzhchRomDesc[] = { - { "sfzhch23", 0x080000, 0x3683cce7, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza22", 0x080000, 0x8d9b2480, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfzch21", 0x080000, 0x5435225d, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "sfza20", 0x080000, 0x806e8f38, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "sfz_01.3a", 0x080000, 0x0dd53e62, BRF_GRA | CPS1_TILES }, - { "sfz_02.4a", 0x080000, 0x94c31e3f, BRF_GRA | CPS1_TILES }, - { "sfz_03.5a", 0x080000, 0x9584ac85, BRF_GRA | CPS1_TILES }, - { "sfz_04.6a", 0x080000, 0xb983624c, BRF_GRA | CPS1_TILES }, - { "sfz_05.7a", 0x080000, 0x2b47b645, BRF_GRA | CPS1_TILES }, - { "sfz_06.8a", 0x080000, 0x74fd9fb1, BRF_GRA | CPS1_TILES }, - { "sfz_07.9a", 0x080000, 0xbb2c734d, BRF_GRA | CPS1_TILES }, - { "sfz_08.10a", 0x080000, 0x454f7868, BRF_GRA | CPS1_TILES }, - { "sfz_10.3c", 0x080000, 0x2a7d675e, BRF_GRA | CPS1_TILES }, - { "sfz_11.4c", 0x080000, 0xe35546c8, BRF_GRA | CPS1_TILES }, - { "sfz_12.5c", 0x080000, 0xf122693a, BRF_GRA | CPS1_TILES }, - { "sfz_13.6c", 0x080000, 0x7cf942c8, BRF_GRA | CPS1_TILES }, - { "sfz_14.7c", 0x080000, 0x09038c81, BRF_GRA | CPS1_TILES }, - { "sfz_15.8c", 0x080000, 0x1aa17391, BRF_GRA | CPS1_TILES }, - { "sfz_16.9c", 0x080000, 0x19a5abd6, BRF_GRA | CPS1_TILES }, - { "sfz_17.10c", 0x080000, 0x248b3b73, BRF_GRA | CPS1_TILES }, - - { "sfz_09.12a", 0x010000, 0xc772628b, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "sfz_18.11c", 0x020000, 0x61022b2d, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "sfz_19.12c", 0x020000, 0x3b5886d5, BRF_SND | CPS1_OKIM6295_SAMPLES }, -}; - -STD_ROM_PICK(Sfzhch) -STD_ROM_FN(Sfzhch) - -struct BurnDriverX BurnDrvCpsSfzhch = { - "sfzhch", "sfzch", NULL, NULL, "1995", - "Street Fighter Zero (CPS Changer, 950727 Hispanic)\0", NULL, "Capcom", "CPS Changer", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPSCHANGER, GBF_VSFIGHT, FBF_SF, - NULL, SfzhchRomInfo, SfzhchRomName, NULL, NULL, SfzchInputInfo, NULL, - SfzchInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -#include "d_kenseim.h" - -#undef CPS1_68K_PROGRAM_BYTESWAP -#undef CPS1_68K_PROGRAM_NO_BYTESWAP -#undef CPS1_Z80_PROGRAM -#undef CPS1_TILES -#undef CPS1_OKIM6295_SAMPLES -#undef CPS1_QSOUND_SAMPLES -#undef CPS1_PIC diff --git a/jan/src/burn/drv/capcom/d_cps2.cpp b/jan/src/burn/drv/capcom/d_cps2.cpp deleted file mode 100644 index f1693694a..000000000 --- a/jan/src/burn/drv/capcom/d_cps2.cpp +++ /dev/null @@ -1,13194 +0,0 @@ -#include "cps.h" - -INT32 Cps2Volume = 39; -INT32 Cps2DisableDigitalVolume = 0; -UINT8 Cps2VolUp; -UINT8 Cps2VolDwn; - -UINT16 Cps2VolumeStates[40] = { - 0xf010, 0xf008, 0xf004, 0xf002, 0xf001, 0xe810, 0xe808, 0xe804, 0xe802, 0xe801, - 0xe410, 0xe408, 0xe404, 0xe402, 0xe401, 0xe210, 0xe208, 0xe204, 0xe202, 0xe201, - 0xe110, 0xe108, 0xe104, 0xe102, 0xe101, 0xe090, 0xe088, 0xe084, 0xe082, 0xe081, - 0xe050, 0xe048, 0xe044, 0xe042, 0xe041, 0xe030, 0xe028, 0xe024, 0xe022, 0xe021 -}; - -// Input Definitions - -static struct BurnInputInfo Cps2FightingInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Weak Punch" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Medium Punch" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Strong Punch" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Weak Kick" , BIT_DIGITAL , CpsInp011+0, "p1 fire 4" }, - {"P1 Medium Kick" , BIT_DIGITAL , CpsInp011+1, "p1 fire 5" }, - {"P1 Strong Kick" , BIT_DIGITAL , CpsInp011+2, "p1 fire 6" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Weak Punch" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Medium Punch" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Strong Punch" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Weak Kick" , BIT_DIGITAL , CpsInp011+4, "p2 fire 4" }, - {"P2 Medium Kick" , BIT_DIGITAL , CpsInp011+5, "p2 fire 5" }, - {"P2 Strong Kick" , BIT_DIGITAL , CpsInp020+6, "p2 fire 6" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 7" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 8" }, -}; - -STDINPUTINFO(Cps2Fighting) - -static struct BurnInputInfo NineXXInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Bomb" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Bomb" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" }, -}; - -STDINPUTINFO(NineXX) - -static struct BurnInputInfo Nine44InputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Bomb" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Bomb" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" }, -}; - -STDINPUTINFO(Nine44) - -static struct BurnInputInfo ArmwarInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp020+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp020+2, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp011+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp011+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp011+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp011+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp011+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp011+5, "p3 fire 2" }, - {"P3 Shot" , BIT_DIGITAL , CpsInp011+6, "p3 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Armwar) - -static struct BurnInputInfo AvspInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp020+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp020+2, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp011+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp011+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp011+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp011+0, "p3 right" }, - {"P3 Shot" , BIT_DIGITAL , CpsInp011+4, "p3 fire 1" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp011+5, "p3 fire 2" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp011+6, "p3 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Avsp) - -static struct BurnInputInfo BatcirInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp020+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp020+2, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp011+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp011+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp011+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp011+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp011+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp011+5, "p3 fire 2" }, - - {"P4 Coin" , BIT_DIGITAL , CpsInp020+7, "p4 coin" }, - {"P4 Start" , BIT_DIGITAL , CpsInp020+3, "p4 start" }, - {"P4 Up" , BIT_DIGITAL , CpsInp010+3, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , CpsInp010+2, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , CpsInp010+1, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , CpsInp010+0, "p4 right" }, - {"P4 Attack" , BIT_DIGITAL , CpsInp010+4, "p4 fire 1" }, - {"P4 Jump" , BIT_DIGITAL , CpsInp010+5, "p4 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" }, -}; - -STDINPUTINFO(Batcir) - -static struct BurnInputInfo ChokoInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Shot2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Shot3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Choko) - -static struct BurnInputInfo CsclubInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Button 2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Button 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Button 2" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Button 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Csclub) - -static struct BurnInputInfo CybotsInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Low Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 High Attack" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Boost" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Weapon" , BIT_DIGITAL , CpsInp001+7, "p1 fire 4" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Low Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 High Attack" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Boost" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Weapon" , BIT_DIGITAL , CpsInp000+7, "p2 fire 4" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 5" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 6" }, -}; - -STDINPUTINFO(Cybots) - -static struct BurnInputInfo DdsomInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Select" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Use" , BIT_DIGITAL , CpsInp001+7, "p1 fire 4" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Select" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Use" , BIT_DIGITAL , CpsInp000+7, "p2 fire 4" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp020+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp020+2, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp011+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp011+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp011+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp011+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp011+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp011+5, "p3 fire 2" }, - {"P3 Select" , BIT_DIGITAL , CpsInp011+6, "p3 fire 3" }, - {"P3 Use" , BIT_DIGITAL , CpsInp011+7, "p3 fire 4" }, - - {"P4 Coin" , BIT_DIGITAL , CpsInp020+7, "p4 coin" }, - {"P4 Start" , BIT_DIGITAL , CpsInp020+3, "p4 start" }, - {"P4 Up" , BIT_DIGITAL , CpsInp010+3, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , CpsInp010+2, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , CpsInp010+1, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , CpsInp010+0, "p4 right" }, - {"P4 Attack" , BIT_DIGITAL , CpsInp010+4, "p4 fire 1" }, - {"P4 Jump" , BIT_DIGITAL , CpsInp010+5, "p4 fire 2" }, - {"P4 Select" , BIT_DIGITAL , CpsInp010+6, "p4 fire 3" }, - {"P4 Use" , BIT_DIGITAL , CpsInp010+7, "p4 fire 4" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 5" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 6" }, -}; - -STDINPUTINFO(Ddsom) - -static struct BurnInputInfo DdtodInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Use" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Select" , BIT_DIGITAL , CpsInp001+7, "p1 fire 4" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Use" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Select" , BIT_DIGITAL , CpsInp000+7, "p2 fire 4" }, - - {"P3 Coin" , BIT_DIGITAL , CpsInp020+6, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , CpsInp020+2, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , CpsInp011+3, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , CpsInp011+2, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , CpsInp011+1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , CpsInp011+0, "p3 right" }, - {"P3 Attack" , BIT_DIGITAL , CpsInp011+4, "p3 fire 1" }, - {"P3 Jump" , BIT_DIGITAL , CpsInp011+5, "p3 fire 2" }, - {"P3 Use" , BIT_DIGITAL , CpsInp011+6, "p3 fire 3" }, - {"P3 Select" , BIT_DIGITAL , CpsInp011+7, "p3 fire 4" }, - - {"P4 Coin" , BIT_DIGITAL , CpsInp020+7, "p4 coin" }, - {"P4 Start" , BIT_DIGITAL , CpsInp020+3, "p4 start" }, - {"P4 Up" , BIT_DIGITAL , CpsInp010+3, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , CpsInp010+2, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , CpsInp010+1, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , CpsInp010+0, "p4 right" }, - {"P4 Attack" , BIT_DIGITAL , CpsInp010+4, "p4 fire 1" }, - {"P4 Jump" , BIT_DIGITAL , CpsInp010+5, "p4 fire 2" }, - {"P4 Use" , BIT_DIGITAL , CpsInp010+6, "p4 fire 3" }, - {"P4 Select" , BIT_DIGITAL , CpsInp010+7, "p4 fire 4" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 5" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 6" }, -}; - -STDINPUTINFO(Ddtod) - -static struct BurnInputInfo DimahooInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Bomb" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Shot (auto)" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Bomb" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Shot (auto)" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Dimahoo) - -static struct BurnInputInfo EcofghtrInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Turn 1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Turn 2" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Turn 1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Turn 2" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Ecofghtr) - -static struct BurnInputInfo GigawingInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Bomb" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Bomb" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" }, -}; - -STDINPUTINFO(Gigawing) - -static struct BurnInputInfo JyangokuInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Shot2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" }, -}; - -STDINPUTINFO(Jyangoku) - -static struct BurnInputInfo Megaman2InputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Attack" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Jump" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Select" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Attack" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Jump" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Select" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Megaman2) - -static struct BurnInputInfo Mmancp2uInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Punch" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Kick" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Special" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Punch" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Kick" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Special" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Mmancp2u) - -static struct BurnInputInfo MmatrixInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 2" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 3" }, -}; - -STDINPUTINFO(Mmatrix) - -static struct BurnInputInfo MpangInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Shot2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Shot2" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" }, -}; - -STDINPUTINFO(Mpang) - -static struct BurnInputInfo ProgearInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Bomb" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Auto" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Bomb" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Auto" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Progear) - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo Pzloop2InputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4 , "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0 , "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3 , "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2 , "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1 , "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0 , "p1 right" }, - {"P1 Shot" , BIT_DIGITAL , CpsInp001+4 , "p1 fire 1" }, - A("P1 Paddle" , BIT_ANALOG_REL, &CpsInpPaddle1, "mouse x-axis"), - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5 , "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1 , "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3 , "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2 , "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1 , "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0 , "p2 right" }, - {"P2 Shot" , BIT_DIGITAL , CpsInp000+4 , "p2 fire 1" }, - A("P2 Paddle" , BIT_ANALOG_REL, &CpsInpPaddle2, "p2 z-axis" ), - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1 , "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2 , "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 2" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn , "p1 fire 3" }, -}; - -#undef A - -STDINPUTINFO(Pzloop2) - -static struct BurnInputInfo QndreamInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Answer 1" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Answer 2" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Answer 3" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Answer 4" , BIT_DIGITAL , CpsInp001+7, "p1 fire 4" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Answer 1" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Answer 2" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Answer 3" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Answer 4" , BIT_DIGITAL , CpsInp000+7, "p2 fire 4" }, - - {"Reset" , BIT_DIGITAL , &CpsReset, "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 5" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 6" }, -}; - -STDINPUTINFO(Qndream) - -static struct BurnInputInfo RingdestInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Hold" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Weak punch" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Strong punch" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - {"P1 Button 4" , BIT_DIGITAL , CpsInp011+0, "p1 fire 4" }, - {"P1 Weak kick" , BIT_DIGITAL , CpsInp011+1, "p1 fire 5" }, - {"P1 Strong kick" , BIT_DIGITAL , CpsInp011+2, "p1 fire 6" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Hold" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Weak punch" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Strong punch" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - {"P2 Button 4" , BIT_DIGITAL , CpsInp011+4, "p2 fire 4" }, - {"P2 Weak kick" , BIT_DIGITAL , CpsInp011+5, "p2 fire 5" }, - {"P2 Strong kick" , BIT_DIGITAL , CpsInp020+6, "p2 fire 6" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 7" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 8" }, -}; - -STDINPUTINFO(Ringdest) - -static struct BurnInputInfo SgemfInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Punch" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Kick" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - {"P1 Special" , BIT_DIGITAL , CpsInp001+6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Punch" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Kick" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - {"P2 Special" , BIT_DIGITAL , CpsInp000+6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" }, -}; - -STDINPUTINFO(Sgemf) - -static struct BurnInputInfo Spf2tInputList[] = { - {"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , CpsInp001+3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , CpsInp001+2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , CpsInp001+1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , CpsInp001+0, "p1 right" }, - {"P1 Rotate Left" , BIT_DIGITAL , CpsInp001+4, "p1 fire 1" }, - {"P1 Rotate Right" , BIT_DIGITAL , CpsInp001+5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , CpsInp020+5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , CpsInp020+1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , CpsInp000+3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , CpsInp000+2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , CpsInp000+1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , CpsInp000+0, "p2 right" }, - {"P2 Rotate Left" , BIT_DIGITAL , CpsInp000+4, "p2 fire 1" }, - {"P2 Rotate Right" , BIT_DIGITAL , CpsInp000+5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &CpsReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" }, - {"Service" , BIT_DIGITAL , CpsInp021+2, "service" }, - {"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" }, - {"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" }, -}; - -STDINPUTINFO(Spf2t) - -// Rom Definitions - -static struct BurnRomInfo NinexxRomDesc[] = { - { "19xu.03", 0x080000, 0x05955268, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xu.04", 0x080000, 0x3111ab7f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xu.05", 0x080000, 0x38df4a63, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xu.06", 0x080000, 0x5c7e60d3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19x.07", 0x080000, 0x61c0296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "19x.13m", 0x080000, 0x427aeb18, CPS2_GFX | BRF_GRA }, - { "19x.15m", 0x080000, 0x63bdbf54, CPS2_GFX | BRF_GRA }, - { "19x.17m", 0x080000, 0x2dfe18b5, CPS2_GFX | BRF_GRA }, - { "19x.19m", 0x080000, 0xcbef9579, CPS2_GFX | BRF_GRA }, - { "19x.14m", 0x200000, 0xe916967c, CPS2_GFX | BRF_GRA }, - { "19x.16m", 0x200000, 0x6e75f3db, CPS2_GFX | BRF_GRA }, - { "19x.18m", 0x200000, 0x2213e798, CPS2_GFX | BRF_GRA }, - { "19x.20m", 0x200000, 0xab9d5b96, CPS2_GFX | BRF_GRA }, - - { "19x.01", 0x020000, 0xef55195e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "19x.11m", 0x200000, 0xd38beef3, CPS2_QSND | BRF_SND }, - { "19x.12m", 0x200000, 0xd47c96e2, CPS2_QSND | BRF_SND }, - - { "19xx.key", 0x000014, 0x77e67ba1, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ninexx) -STD_ROM_FN(Ninexx) - -static struct BurnRomInfo NinexxaRomDesc[] = { - { "09xa.03b", 0x080000, 0x2e994897, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, /* Yes it's actually 09xa, that's not a typo */ - { "09xa.04b", 0x080000, 0x6364d001, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, /* Yes it's actually 09xa, that's not a typo */ - { "09xa.05b", 0x080000, 0x00c1949b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, /* Yes it's actually 09xa, that's not a typo */ - { "09xa.06b", 0x080000, 0x363c1f6e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, /* Yes it's actually 09xa, that's not a typo */ - { "19xa.07", 0x080000, 0x61c0296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, /* This one was different, it actually was 19xa */ - - { "19x.13m", 0x080000, 0x427aeb18, CPS2_GFX | BRF_GRA }, - { "19x.15m", 0x080000, 0x63bdbf54, CPS2_GFX | BRF_GRA }, - { "19x.17m", 0x080000, 0x2dfe18b5, CPS2_GFX | BRF_GRA }, - { "19x.19m", 0x080000, 0xcbef9579, CPS2_GFX | BRF_GRA }, - { "19x.14m", 0x200000, 0xe916967c, CPS2_GFX | BRF_GRA }, - { "19x.16m", 0x200000, 0x6e75f3db, CPS2_GFX | BRF_GRA }, - { "19x.18m", 0x200000, 0x2213e798, CPS2_GFX | BRF_GRA }, - { "19x.20m", 0x200000, 0xab9d5b96, CPS2_GFX | BRF_GRA }, - - { "19x.01", 0x020000, 0xef55195e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "19x.11m", 0x200000, 0xd38beef3, CPS2_QSND | BRF_SND }, - { "19x.12m", 0x200000, 0xd47c96e2, CPS2_QSND | BRF_SND }, - - { "19xxa.key", 0x000014, 0x2cd32eb9, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ninexxa) -STD_ROM_FN(Ninexxa) - -static struct BurnRomInfo Ninexxar1RomDesc[] = { - { "19xa.03", 0x080000, 0x0c20fd50, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xa.04", 0x080000, 0x1fc37508, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xa.05", 0x080000, 0x6c9cc4ed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xa.06", 0x080000, 0xca5b9f76, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19x.07", 0x080000, 0x61c0296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "19x.13m", 0x080000, 0x427aeb18, CPS2_GFX | BRF_GRA }, - { "19x.15m", 0x080000, 0x63bdbf54, CPS2_GFX | BRF_GRA }, - { "19x.17m", 0x080000, 0x2dfe18b5, CPS2_GFX | BRF_GRA }, - { "19x.19m", 0x080000, 0xcbef9579, CPS2_GFX | BRF_GRA }, - { "19x.14m", 0x200000, 0xe916967c, CPS2_GFX | BRF_GRA }, - { "19x.16m", 0x200000, 0x6e75f3db, CPS2_GFX | BRF_GRA }, - { "19x.18m", 0x200000, 0x2213e798, CPS2_GFX | BRF_GRA }, - { "19x.20m", 0x200000, 0xab9d5b96, CPS2_GFX | BRF_GRA }, - - { "19x.01", 0x020000, 0xef55195e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "19x.11m", 0x200000, 0xd38beef3, CPS2_QSND | BRF_SND }, - { "19x.12m", 0x200000, 0xd47c96e2, CPS2_QSND | BRF_SND }, - - { "19xxa.key", 0x000014, 0x2cd32eb9, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ninexxar1) -STD_ROM_FN(Ninexxar1) - -static struct BurnRomInfo NinexxbRomDesc[] = { - { "19xb.03a", 0x080000, 0x341bdf4a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xb.04a", 0x080000, 0xdff8069e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xb.05a", 0x080000, 0xa47a92a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xb.06a", 0x080000, 0xc52df10d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19x.07", 0x080000, 0x61c0296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "19x.13m", 0x080000, 0x427aeb18, CPS2_GFX | BRF_GRA }, - { "19x.15m", 0x080000, 0x63bdbf54, CPS2_GFX | BRF_GRA }, - { "19x.17m", 0x080000, 0x2dfe18b5, CPS2_GFX | BRF_GRA }, - { "19x.19m", 0x080000, 0xcbef9579, CPS2_GFX | BRF_GRA }, - { "19x.14m", 0x200000, 0xe916967c, CPS2_GFX | BRF_GRA }, - { "19x.16m", 0x200000, 0x6e75f3db, CPS2_GFX | BRF_GRA }, - { "19x.18m", 0x200000, 0x2213e798, CPS2_GFX | BRF_GRA }, - { "19x.20m", 0x200000, 0xab9d5b96, CPS2_GFX | BRF_GRA }, - - { "19x.01", 0x020000, 0xef55195e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "19x.11m", 0x200000, 0xd38beef3, CPS2_QSND | BRF_SND }, - { "19x.12m", 0x200000, 0xd47c96e2, CPS2_QSND | BRF_SND }, - - { "19xxb.key", 0x000014, 0x4200e334, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ninexxb) -STD_ROM_FN(Ninexxb) - -static struct BurnRomInfo NinexxhRomDesc[] = { - { "19xh.03a", 0x080000, 0x357be2ac, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xh.04a", 0x080000, 0xbb13ea3b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xh.05a", 0x080000, 0xcbd76601, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xh.06a", 0x080000, 0xb362de8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19x.07", 0x080000, 0x61c0296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "19x.13m", 0x080000, 0x427aeb18, CPS2_GFX | BRF_GRA }, - { "19x.15m", 0x080000, 0x63bdbf54, CPS2_GFX | BRF_GRA }, - { "19x.17m", 0x080000, 0x2dfe18b5, CPS2_GFX | BRF_GRA }, - { "19x.19m", 0x080000, 0xcbef9579, CPS2_GFX | BRF_GRA }, - { "19x.14m", 0x200000, 0xe916967c, CPS2_GFX | BRF_GRA }, - { "19x.16m", 0x200000, 0x6e75f3db, CPS2_GFX | BRF_GRA }, - { "19x.18m", 0x200000, 0x2213e798, CPS2_GFX | BRF_GRA }, - { "19x.20m", 0x200000, 0xab9d5b96, CPS2_GFX | BRF_GRA }, - - { "19x.01", 0x020000, 0xef55195e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "19x.11m", 0x200000, 0xd38beef3, CPS2_QSND | BRF_SND }, - { "19x.12m", 0x200000, 0xd47c96e2, CPS2_QSND | BRF_SND }, - - { "19xxh.key", 0x000014, 0x215cf208, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ninexxh) -STD_ROM_FN(Ninexxh) - -static struct BurnRomInfo NinexxjRomDesc[] = { - { "19xj-03b.6a", 0x080000, 0xbcad93dd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj-04b.7a", 0x080000, 0x931882a1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj-05b.8a", 0x080000, 0xe7eeddc4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj-06b.9a", 0x080000, 0xf27cd6b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj-07.6d", 0x080000, 0x61c0296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // 19x.07 - - { "19x-69.4j", 0x080000, 0x427aeb18, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.13m - { "19x-59.4d", 0x080000, 0x63bdbf54, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.15m - { "19x-79.4m", 0x080000, 0x2dfe18b5, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.17m - { "19x-89.4p", 0x080000, 0xcbef9579, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.19m - { "19x-73.8j", 0x080000, 0x8e81f595, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.14m - { "19x-74.9j", 0x080000, 0x6d7ad22e, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.14m - { "19x-75.10j", 0x080000, 0xcb1a1b6a, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.14m - { "19x-76.11j", 0x080000, 0x26fc2b08, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.14m - { "19x-63.8d", 0x080000, 0x6f8b045e, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.16m - { "19x-64.9d", 0x080000, 0xccd5725a, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.16m - { "19x-65.10d", 0x080000, 0x6cf6db35, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.16m - { "19x-66.11d", 0x080000, 0x16115dd3, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.16m - { "19x-83.8m", 0x080000, 0xc11f88c1, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.18m - { "19x-84.9m", 0x080000, 0x68cc9cd8, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.18m - { "19x-85.10m", 0x080000, 0xf213666b, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.18m - { "19x-86.11m", 0x080000, 0x574e0473, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.18m - { "19x-93.8p", 0x080000, 0x9fad3c55, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.20m - { "19x-94.9p", 0x080000, 0xe10e252c, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.20m - { "19x-95.10p", 0x080000, 0x2b86fa67, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.20m - { "19x-96.11p", 0x080000, 0xae6eb692, CPS2_GFX_19XXJ | BRF_GRA }, // 19x.20m - - { "19x-01.1a", 0x020000, 0xef55195e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, // 19x.01 - - { "19x-51.6a", 0x080000, 0xe9cd7780, CPS2_QSND | BRF_SND }, // 19x.11m - { "19x-52.7a", 0x080000, 0xb27b91a8, CPS2_QSND | BRF_SND }, // 19x.11m - { "19x-53.8a", 0x080000, 0x2e563ee2, CPS2_QSND | BRF_SND }, // 19x.11m - { "19x-54.9a", 0x080000, 0xf47c1f24, CPS2_QSND | BRF_SND }, // 19x.11m - { "19x-55.10a", 0x080000, 0x0b1af6e0, CPS2_QSND | BRF_SND }, // 19x.12m - { "19x-56.11a", 0x080000, 0xdfa8819f, CPS2_QSND | BRF_SND }, // 19x.12m - { "19x-57.12a", 0x080000, 0x229ba777, CPS2_QSND | BRF_SND }, // 19x.12m - { "19x-58.13a", 0x080000, 0xc7dceba4, CPS2_QSND | BRF_SND }, // 19x.12m - - { "19xxj.key", 0x000014, 0x9aafa71a, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ninexxj) -STD_ROM_FN(Ninexxj) - -static struct BurnRomInfo Ninexxjr1RomDesc[] = { - { "19xj.03a", 0x080000, 0xed08bdd1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj.04a", 0x080000, 0xfb8e3f29, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj.05a", 0x080000, 0xaa508ac4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj.06a", 0x080000, 0xff2d785b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19x.07", 0x080000, 0x61c0296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "19x.13m", 0x080000, 0x427aeb18, CPS2_GFX | BRF_GRA }, - { "19x.15m", 0x080000, 0x63bdbf54, CPS2_GFX | BRF_GRA }, - { "19x.17m", 0x080000, 0x2dfe18b5, CPS2_GFX | BRF_GRA }, - { "19x.19m", 0x080000, 0xcbef9579, CPS2_GFX | BRF_GRA }, - { "19x.14m", 0x200000, 0xe916967c, CPS2_GFX | BRF_GRA }, - { "19x.16m", 0x200000, 0x6e75f3db, CPS2_GFX | BRF_GRA }, - { "19x.18m", 0x200000, 0x2213e798, CPS2_GFX | BRF_GRA }, - { "19x.20m", 0x200000, 0xab9d5b96, CPS2_GFX | BRF_GRA }, - - { "19x.01", 0x020000, 0xef55195e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "19x.11m", 0x200000, 0xd38beef3, CPS2_QSND | BRF_SND }, - { "19x.12m", 0x200000, 0xd47c96e2, CPS2_QSND | BRF_SND }, - - { "19xxj.key", 0x000014, 0x9aafa71a, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ninexxjr1) -STD_ROM_FN(Ninexxjr1) - -static struct BurnRomInfo Ninexxjr2RomDesc[] = { - { "19xj.03", 0x080000, 0x26a381ed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj.04", 0x080000, 0x30100cca, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj.05", 0x080000, 0xde67e938, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xj.06", 0x080000, 0x39f9a409, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19x.07", 0x080000, 0x61c0296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "19x.13m", 0x080000, 0x427aeb18, CPS2_GFX | BRF_GRA }, - { "19x.15m", 0x080000, 0x63bdbf54, CPS2_GFX | BRF_GRA }, - { "19x.17m", 0x080000, 0x2dfe18b5, CPS2_GFX | BRF_GRA }, - { "19x.19m", 0x080000, 0xcbef9579, CPS2_GFX | BRF_GRA }, - { "19x.14m", 0x200000, 0xe916967c, CPS2_GFX | BRF_GRA }, - { "19x.16m", 0x200000, 0x6e75f3db, CPS2_GFX | BRF_GRA }, - { "19x.18m", 0x200000, 0x2213e798, CPS2_GFX | BRF_GRA }, - { "19x.20m", 0x200000, 0xab9d5b96, CPS2_GFX | BRF_GRA }, - - { "19x.01", 0x020000, 0xef55195e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "19x.11m", 0x200000, 0xd38beef3, CPS2_QSND | BRF_SND }, - { "19x.12m", 0x200000, 0xd47c96e2, CPS2_QSND | BRF_SND }, - - { "19xxj.key", 0x000014, 0x9aafa71a, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ninexxjr2) -STD_ROM_FN(Ninexxjr2) - -static struct BurnRomInfo Nine44RomDesc[] = { - { "nffu.03", 0x080000, 0x9693cf8f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "nff.04", 0x080000, 0xdba1c66e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "nffu.05", 0x080000, 0xea813eb7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "nff.13m", 0x400000, 0xc9fca741, CPS2_GFX | BRF_GRA }, - { "nff.15m", 0x400000, 0xf809d898, CPS2_GFX | BRF_GRA }, - { "nff.17m", 0x400000, 0x15ba4507, CPS2_GFX | BRF_GRA }, - { "nff.19m", 0x400000, 0x3dd41b8c, CPS2_GFX | BRF_GRA }, - { "nff.14m", 0x100000, 0x3fe3a54b, CPS2_GFX | BRF_GRA }, - { "nff.16m", 0x100000, 0x565cd231, CPS2_GFX | BRF_GRA }, - { "nff.18m", 0x100000, 0x63ca5988, CPS2_GFX | BRF_GRA }, - { "nff.20m", 0x100000, 0x21eb8f3b, CPS2_GFX | BRF_GRA }, - - { "nff.01", 0x020000, 0xd2e44318, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "nff.11m", 0x400000, 0x243e4e05, CPS2_QSND | BRF_SND }, - { "nff.12m", 0x400000, 0x4fcf1600, CPS2_QSND | BRF_SND }, - - { "1944.key", 0x000014, 0x61734f5b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nine44) -STD_ROM_FN(Nine44) - -static struct BurnRomInfo Nine44jRomDesc[] = { - { "nffj.03", 0x080000, 0x247521ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "nff.04", 0x080000, 0xdba1c66e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "nffj.05", 0x080000, 0x7f20c2ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "nff.13m", 0x400000, 0xc9fca741, CPS2_GFX | BRF_GRA }, - { "nff.15m", 0x400000, 0xf809d898, CPS2_GFX | BRF_GRA }, - { "nff.17m", 0x400000, 0x15ba4507, CPS2_GFX | BRF_GRA }, - { "nff.19m", 0x400000, 0x3dd41b8c, CPS2_GFX | BRF_GRA }, - { "nff.14m", 0x100000, 0x3fe3a54b, CPS2_GFX | BRF_GRA }, - { "nff.16m", 0x100000, 0x565cd231, CPS2_GFX | BRF_GRA }, - { "nff.18m", 0x100000, 0x63ca5988, CPS2_GFX | BRF_GRA }, - { "nff.20m", 0x100000, 0x21eb8f3b, CPS2_GFX | BRF_GRA }, - - { "nff.01", 0x020000, 0xd2e44318, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "nff.11m", 0x400000, 0x243e4e05, CPS2_QSND | BRF_SND }, - { "nff.12m", 0x400000, 0x4fcf1600, CPS2_QSND | BRF_SND }, - - { "1944j.key", 0x000014, 0x210202aa, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nine44j) -STD_ROM_FN(Nine44j) - -static struct BurnRomInfo ArmwarRomDesc[] = { - { "pwge.03c", 0x080000, 0x31f74931, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwge.04c", 0x080000, 0x16f34f5f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwge.05b", 0x080000, 0x4403ed08, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.06", 0x080000, 0x87a60ce8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.07", 0x080000, 0xf7b148df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.08", 0x080000, 0xcc62823e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.09a", 0x080000, 0x4c26baee, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.10", 0x080000, 0x07c4fb28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pwg.13m", 0x400000, 0xae8fe08e, CPS2_GFX | BRF_GRA }, - { "pwg.15m", 0x400000, 0xdb560f58, CPS2_GFX | BRF_GRA }, - { "pwg.17m", 0x400000, 0xbc475b94, CPS2_GFX | BRF_GRA }, - { "pwg.19m", 0x400000, 0x07439ff7, CPS2_GFX | BRF_GRA }, - { "pwg.14m", 0x100000, 0xc3f9ba63, CPS2_GFX | BRF_GRA }, - { "pwg.16m", 0x100000, 0x815b0e7b, CPS2_GFX | BRF_GRA }, - { "pwg.18m", 0x100000, 0x0109c71b, CPS2_GFX | BRF_GRA }, - { "pwg.20m", 0x100000, 0xeb75ffbe, CPS2_GFX | BRF_GRA }, - - { "pwg.01", 0x020000, 0x18a5c0e4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pwg.02", 0x020000, 0xc9dfffa6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pwg.11m", 0x200000, 0xa78f7433, CPS2_QSND | BRF_SND }, - { "pwg.12m", 0x200000, 0x77438ed0, CPS2_QSND | BRF_SND }, - - { "armwar.key", 0x000014, 0xfe979382, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Armwar) -STD_ROM_FN(Armwar) - -static struct BurnRomInfo Armwarr1RomDesc[] = { - { "pwge.03b", 0x080000, 0xe822e3e9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwge.04b", 0x080000, 0x4f89de39, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwge.05a", 0x080000, 0x83df24e5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.06", 0x080000, 0x87a60ce8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.07", 0x080000, 0xf7b148df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.08", 0x080000, 0xcc62823e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.09", 0x080000, 0xddc85ca6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.10", 0x080000, 0x07c4fb28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pwg.13m", 0x400000, 0xae8fe08e, CPS2_GFX | BRF_GRA }, - { "pwg.15m", 0x400000, 0xdb560f58, CPS2_GFX | BRF_GRA }, - { "pwg.17m", 0x400000, 0xbc475b94, CPS2_GFX | BRF_GRA }, - { "pwg.19m", 0x400000, 0x07439ff7, CPS2_GFX | BRF_GRA }, - { "pwg.14m", 0x100000, 0xc3f9ba63, CPS2_GFX | BRF_GRA }, - { "pwg.16m", 0x100000, 0x815b0e7b, CPS2_GFX | BRF_GRA }, - { "pwg.18m", 0x100000, 0x0109c71b, CPS2_GFX | BRF_GRA }, - { "pwg.20m", 0x100000, 0xeb75ffbe, CPS2_GFX | BRF_GRA }, - - { "pwg.01", 0x020000, 0x18a5c0e4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pwg.02", 0x020000, 0xc9dfffa6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pwg.11m", 0x200000, 0xa78f7433, CPS2_QSND | BRF_SND }, - { "pwg.12m", 0x200000, 0x77438ed0, CPS2_QSND | BRF_SND }, - - { "armwar.key", 0x000014, 0xfe979382, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Armwarr1) -STD_ROM_FN(Armwarr1) - -static struct BurnRomInfo ArmwaruRomDesc[] = { - { "pwgu.03b", 0x080000, 0x8b95497a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwgu.04b", 0x080000, 0x29eb5661, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwgu.05b", 0x080000, 0xa54e9e44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.06", 0x080000, 0x87a60ce8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.07", 0x080000, 0xf7b148df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.08", 0x080000, 0xcc62823e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.09a", 0x080000, 0x4c26baee, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.10", 0x080000, 0x07c4fb28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pwg.13m", 0x400000, 0xae8fe08e, CPS2_GFX | BRF_GRA }, - { "pwg.15m", 0x400000, 0xdb560f58, CPS2_GFX | BRF_GRA }, - { "pwg.17m", 0x400000, 0xbc475b94, CPS2_GFX | BRF_GRA }, - { "pwg.19m", 0x400000, 0x07439ff7, CPS2_GFX | BRF_GRA }, - { "pwg.14m", 0x100000, 0xc3f9ba63, CPS2_GFX | BRF_GRA }, - { "pwg.16m", 0x100000, 0x815b0e7b, CPS2_GFX | BRF_GRA }, - { "pwg.18m", 0x100000, 0x0109c71b, CPS2_GFX | BRF_GRA }, - { "pwg.20m", 0x100000, 0xeb75ffbe, CPS2_GFX | BRF_GRA }, - - { "pwg.01", 0x020000, 0x18a5c0e4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pwg.02", 0x020000, 0xc9dfffa6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pwg.11m", 0x200000, 0xa78f7433, CPS2_QSND | BRF_SND }, - { "pwg.12m", 0x200000, 0x77438ed0, CPS2_QSND | BRF_SND }, - - { "armwaru.key", 0x000014, 0xfb9aada5, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Armwaru) -STD_ROM_FN(Armwaru) - -static struct BurnRomInfo Armwaru1RomDesc[] = { - { "pwgu.03a", 0x080000, 0x73d397b1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwgu.04a", 0x080000, 0x1f1de215, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwgu.05a", 0x080000, 0x835fbe73, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.06", 0x080000, 0x87a60ce8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.07", 0x080000, 0xf7b148df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.08", 0x080000, 0xcc62823e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.09", 0x080000, 0xddc85ca6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.10", 0x080000, 0x07c4fb28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pwg.13m", 0x400000, 0xae8fe08e, CPS2_GFX | BRF_GRA }, - { "pwg.15m", 0x400000, 0xdb560f58, CPS2_GFX | BRF_GRA }, - { "pwg.17m", 0x400000, 0xbc475b94, CPS2_GFX | BRF_GRA }, - { "pwg.19m", 0x400000, 0x07439ff7, CPS2_GFX | BRF_GRA }, - { "pwg.14m", 0x100000, 0xc3f9ba63, CPS2_GFX | BRF_GRA }, - { "pwg.16m", 0x100000, 0x815b0e7b, CPS2_GFX | BRF_GRA }, - { "pwg.18m", 0x100000, 0x0109c71b, CPS2_GFX | BRF_GRA }, - { "pwg.20m", 0x100000, 0xeb75ffbe, CPS2_GFX | BRF_GRA }, - - { "pwg.01", 0x020000, 0x18a5c0e4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pwg.02", 0x020000, 0xc9dfffa6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pwg.11m", 0x200000, 0xa78f7433, CPS2_QSND | BRF_SND }, - { "pwg.12m", 0x200000, 0x77438ed0, CPS2_QSND | BRF_SND }, - - { "armwaru.key", 0x000014, 0xfb9aada5, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Armwaru1) -STD_ROM_FN(Armwaru1) - -static struct BurnRomInfo PgearRomDesc[] = { - { "pwgj.03a", 0x080000, 0xc79c0c02, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwgj.04a", 0x080000, 0x167c6ed8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwgj.05a", 0x080000, 0xa63fb400, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.06", 0x080000, 0x87a60ce8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.07", 0x080000, 0xf7b148df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.08", 0x080000, 0xcc62823e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.09a", 0x080000, 0x4c26baee, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.10", 0x080000, 0x07c4fb28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pwg.13m", 0x400000, 0xae8fe08e, CPS2_GFX | BRF_GRA }, - { "pwg.15m", 0x400000, 0xdb560f58, CPS2_GFX | BRF_GRA }, - { "pwg.17m", 0x400000, 0xbc475b94, CPS2_GFX | BRF_GRA }, - { "pwg.19m", 0x400000, 0x07439ff7, CPS2_GFX | BRF_GRA }, - { "pwg.14m", 0x100000, 0xc3f9ba63, CPS2_GFX | BRF_GRA }, - { "pwg.16m", 0x100000, 0x815b0e7b, CPS2_GFX | BRF_GRA }, - { "pwg.18m", 0x100000, 0x0109c71b, CPS2_GFX | BRF_GRA }, - { "pwg.20m", 0x100000, 0xeb75ffbe, CPS2_GFX | BRF_GRA }, - - { "pwg.01", 0x020000, 0x18a5c0e4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pwg.02", 0x020000, 0xc9dfffa6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pwg.11m", 0x200000, 0xa78f7433, CPS2_QSND | BRF_SND }, - { "pwg.12m", 0x200000, 0x77438ed0, CPS2_QSND | BRF_SND }, - - { "pgear.key", 0x000014, 0xc576d6fd, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Pgear) -STD_ROM_FN(Pgear) - -static struct BurnRomInfo Pgearr1RomDesc[] = { - { "pwgj.03", 0x080000, 0xf264e74b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwgj.04", 0x080000, 0x23a84983, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwgj.05", 0x080000, 0xbef58c62, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.06", 0x080000, 0x87a60ce8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.07", 0x080000, 0xf7b148df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.08", 0x080000, 0xcc62823e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.09", 0x080000, 0xddc85ca6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.10", 0x080000, 0x07c4fb28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pwg.13m", 0x400000, 0xae8fe08e, CPS2_GFX | BRF_GRA }, - { "pwg.15m", 0x400000, 0xdb560f58, CPS2_GFX | BRF_GRA }, - { "pwg.17m", 0x400000, 0xbc475b94, CPS2_GFX | BRF_GRA }, - { "pwg.19m", 0x400000, 0x07439ff7, CPS2_GFX | BRF_GRA }, - { "pwg.14m", 0x100000, 0xc3f9ba63, CPS2_GFX | BRF_GRA }, - { "pwg.16m", 0x100000, 0x815b0e7b, CPS2_GFX | BRF_GRA }, - { "pwg.18m", 0x100000, 0x0109c71b, CPS2_GFX | BRF_GRA }, - { "pwg.20m", 0x100000, 0xeb75ffbe, CPS2_GFX | BRF_GRA }, - - { "pwg.01", 0x020000, 0x18a5c0e4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pwg.02", 0x020000, 0xc9dfffa6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pwg.11m", 0x200000, 0xa78f7433, CPS2_QSND | BRF_SND }, - { "pwg.12m", 0x200000, 0x77438ed0, CPS2_QSND | BRF_SND }, - - { "pgear.key", 0x000014, 0xc576d6fd, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Pgearr1) -STD_ROM_FN(Pgearr1) - -static struct BurnRomInfo ArmwaraRomDesc[] = { - { "pwga.03b", 0x080000, 0x347743e1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwga.04b", 0x080000, 0x42dbfb2e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwga.05b", 0x080000, 0x835fbe73, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.06", 0x080000, 0x87a60ce8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.07", 0x080000, 0xf7b148df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.08", 0x080000, 0xcc62823e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.09a", 0x080000, 0x4c26baee, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.10", 0x080000, 0x07c4fb28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pwg.13m", 0x400000, 0xae8fe08e, CPS2_GFX | BRF_GRA }, - { "pwg.15m", 0x400000, 0xdb560f58, CPS2_GFX | BRF_GRA }, - { "pwg.17m", 0x400000, 0xbc475b94, CPS2_GFX | BRF_GRA }, - { "pwg.19m", 0x400000, 0x07439ff7, CPS2_GFX | BRF_GRA }, - { "pwg.14m", 0x100000, 0xc3f9ba63, CPS2_GFX | BRF_GRA }, - { "pwg.16m", 0x100000, 0x815b0e7b, CPS2_GFX | BRF_GRA }, - { "pwg.18m", 0x100000, 0x0109c71b, CPS2_GFX | BRF_GRA }, - { "pwg.20m", 0x100000, 0xeb75ffbe, CPS2_GFX | BRF_GRA }, - - { "pwg.01", 0x020000, 0x18a5c0e4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pwg.02", 0x020000, 0xc9dfffa6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pwg.11m", 0x200000, 0xa78f7433, CPS2_QSND | BRF_SND }, - { "pwg.12m", 0x200000, 0x77438ed0, CPS2_QSND | BRF_SND }, - - { "armwara.key", 0x000014, 0x525439c0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Armwara) -STD_ROM_FN(Armwara) - -static struct BurnRomInfo Armwarar1RomDesc[] = { - { "pwga.03a", 0x080000, 0x8d474ab1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwga.04a", 0x080000, 0x81b5aec7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwga.05a", 0x080000, 0x2618e819, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.06", 0x080000, 0x87a60ce8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.07", 0x080000, 0xf7b148df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.08", 0x080000, 0xcc62823e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.09", 0x080000, 0xddc85ca6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.10", 0x080000, 0x07c4fb28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pwg.13m", 0x400000, 0xae8fe08e, CPS2_GFX | BRF_GRA }, - { "pwg.15m", 0x400000, 0xdb560f58, CPS2_GFX | BRF_GRA }, - { "pwg.17m", 0x400000, 0xbc475b94, CPS2_GFX | BRF_GRA }, - { "pwg.19m", 0x400000, 0x07439ff7, CPS2_GFX | BRF_GRA }, - { "pwg.14m", 0x100000, 0xc3f9ba63, CPS2_GFX | BRF_GRA }, - { "pwg.16m", 0x100000, 0x815b0e7b, CPS2_GFX | BRF_GRA }, - { "pwg.18m", 0x100000, 0x0109c71b, CPS2_GFX | BRF_GRA }, - { "pwg.20m", 0x100000, 0xeb75ffbe, CPS2_GFX | BRF_GRA }, - - { "pwg.01", 0x020000, 0x18a5c0e4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pwg.02", 0x020000, 0xc9dfffa6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pwg.11m", 0x200000, 0xa78f7433, CPS2_QSND | BRF_SND }, - { "pwg.12m", 0x200000, 0x77438ed0, CPS2_QSND | BRF_SND }, - - { "armwara.key", 0x000014, 0x525439c0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Armwarar1) -STD_ROM_FN(Armwarar1) - -static struct BurnRomInfo AvspRomDesc[] = { - { "avpe.03d", 0x080000, 0x774334a9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avpe.04d", 0x080000, 0x7fa83769, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.05d", 0x080000, 0xfbfb5d7a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.06", 0x080000, 0x190b817f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "avp.13m", 0x200000, 0x8f8b5ae4, CPS2_GFX | BRF_GRA }, - { "avp.15m", 0x200000, 0xb00280df, CPS2_GFX | BRF_GRA }, - { "avp.17m", 0x200000, 0x94403195, CPS2_GFX | BRF_GRA }, - { "avp.19m", 0x200000, 0xe1981245, CPS2_GFX | BRF_GRA }, - { "avp.14m", 0x200000, 0xebba093e, CPS2_GFX | BRF_GRA }, - { "avp.16m", 0x200000, 0xfb228297, CPS2_GFX | BRF_GRA }, - { "avp.18m", 0x200000, 0x34fb7232, CPS2_GFX | BRF_GRA }, - { "avp.20m", 0x200000, 0xf90baa21, CPS2_GFX | BRF_GRA }, - - { "avp.01", 0x020000, 0x2d3b4220, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "avp.11m", 0x200000, 0x83499817, CPS2_QSND | BRF_SND }, - { "avp.12m", 0x200000, 0xf4110d49, CPS2_QSND | BRF_SND }, - - { "avsp.key", 0x000014, 0xe69fa35b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Avsp) -STD_ROM_FN(Avsp) - -static struct BurnRomInfo AvspaRomDesc[] = { - { "avpa.03d", 0x080000, 0x6c1c1858, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avpa.04d", 0x080000, 0x94f50b0c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.05d", 0x080000, 0xfbfb5d7a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.06", 0x080000, 0x190b817f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "avp.13m", 0x200000, 0x8f8b5ae4, CPS2_GFX | BRF_GRA }, - { "avp.15m", 0x200000, 0xb00280df, CPS2_GFX | BRF_GRA }, - { "avp.17m", 0x200000, 0x94403195, CPS2_GFX | BRF_GRA }, - { "avp.19m", 0x200000, 0xe1981245, CPS2_GFX | BRF_GRA }, - { "avp.14m", 0x200000, 0xebba093e, CPS2_GFX | BRF_GRA }, - { "avp.16m", 0x200000, 0xfb228297, CPS2_GFX | BRF_GRA }, - { "avp.18m", 0x200000, 0x34fb7232, CPS2_GFX | BRF_GRA }, - { "avp.20m", 0x200000, 0xf90baa21, CPS2_GFX | BRF_GRA }, - - { "avp.01", 0x020000, 0x2d3b4220, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "avp.11m", 0x200000, 0x83499817, CPS2_QSND | BRF_SND }, - { "avp.12m", 0x200000, 0xf4110d49, CPS2_QSND | BRF_SND }, - - { "avspa.key", 0x000014, 0x728efc00, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Avspa) -STD_ROM_FN(Avspa) - -static struct BurnRomInfo AvsphRomDesc[] = { - { "avph.03d", 0x080000, 0x3e440447, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avph.04d", 0x080000, 0xaf6fc82f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.05d", 0x080000, 0xfbfb5d7a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.06", 0x080000, 0x190b817f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "avp.13m", 0x200000, 0x8f8b5ae4, CPS2_GFX | BRF_GRA }, - { "avp.15m", 0x200000, 0xb00280df, CPS2_GFX | BRF_GRA }, - { "avp.17m", 0x200000, 0x94403195, CPS2_GFX | BRF_GRA }, - { "avp.19m", 0x200000, 0xe1981245, CPS2_GFX | BRF_GRA }, - { "avp.14m", 0x200000, 0xebba093e, CPS2_GFX | BRF_GRA }, - { "avp.16m", 0x200000, 0xfb228297, CPS2_GFX | BRF_GRA }, - { "avp.18m", 0x200000, 0x34fb7232, CPS2_GFX | BRF_GRA }, - { "avp.20m", 0x200000, 0xf90baa21, CPS2_GFX | BRF_GRA }, - - { "avp.01", 0x020000, 0x2d3b4220, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "avp.11m", 0x200000, 0x83499817, CPS2_QSND | BRF_SND }, - { "avp.12m", 0x200000, 0xf4110d49, CPS2_QSND | BRF_SND }, - - { "avsph.key", 0x000014, 0xcae7b680, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Avsph) -STD_ROM_FN(Avsph) - -static struct BurnRomInfo AvspjRomDesc[] = { - { "avpj.03d", 0x080000, 0x49799119, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avpj.04d", 0x080000, 0x8cd2bba8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.05d", 0x080000, 0xfbfb5d7a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.06", 0x080000, 0x190b817f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "avp.13m", 0x200000, 0x8f8b5ae4, CPS2_GFX | BRF_GRA }, - { "avp.15m", 0x200000, 0xb00280df, CPS2_GFX | BRF_GRA }, - { "avp.17m", 0x200000, 0x94403195, CPS2_GFX | BRF_GRA }, - { "avp.19m", 0x200000, 0xe1981245, CPS2_GFX | BRF_GRA }, - { "avp.14m", 0x200000, 0xebba093e, CPS2_GFX | BRF_GRA }, - { "avp.16m", 0x200000, 0xfb228297, CPS2_GFX | BRF_GRA }, - { "avp.18m", 0x200000, 0x34fb7232, CPS2_GFX | BRF_GRA }, - { "avp.20m", 0x200000, 0xf90baa21, CPS2_GFX | BRF_GRA }, - - { "avp.01", 0x020000, 0x2d3b4220, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "avp.11m", 0x200000, 0x83499817, CPS2_QSND | BRF_SND }, - { "avp.12m", 0x200000, 0xf4110d49, CPS2_QSND | BRF_SND }, - - { "avspj.key", 0x000014, 0x3d5ccc08, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Avspj) -STD_ROM_FN(Avspj) - -static struct BurnRomInfo AvspuRomDesc[] = { - { "avpu.03d", 0x080000, 0x42757950, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avpu.04d", 0x080000, 0x5abcdee6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.05d", 0x080000, 0xfbfb5d7a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.06", 0x080000, 0x190b817f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "avp.13m", 0x200000, 0x8f8b5ae4, CPS2_GFX | BRF_GRA }, - { "avp.15m", 0x200000, 0xb00280df, CPS2_GFX | BRF_GRA }, - { "avp.17m", 0x200000, 0x94403195, CPS2_GFX | BRF_GRA }, - { "avp.19m", 0x200000, 0xe1981245, CPS2_GFX | BRF_GRA }, - { "avp.14m", 0x200000, 0xebba093e, CPS2_GFX | BRF_GRA }, - { "avp.16m", 0x200000, 0xfb228297, CPS2_GFX | BRF_GRA }, - { "avp.18m", 0x200000, 0x34fb7232, CPS2_GFX | BRF_GRA }, - { "avp.20m", 0x200000, 0xf90baa21, CPS2_GFX | BRF_GRA }, - - { "avp.01", 0x020000, 0x2d3b4220, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "avp.11m", 0x200000, 0x83499817, CPS2_QSND | BRF_SND }, - { "avp.12m", 0x200000, 0xf4110d49, CPS2_QSND | BRF_SND }, - - { "avspu.key", 0x000014, 0x4e68e346, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Avspu) -STD_ROM_FN(Avspu) - -static struct BurnRomInfo BatcirRomDesc[] = { - { "btce.03", 0x080000, 0xbc60484b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btce.04", 0x080000, 0x457d55f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btce.05", 0x080000, 0xe86560d7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btce.06", 0x080000, 0xf778e61b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.07", 0x080000, 0x7322d5db, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.08", 0x080000, 0x6aac85ab, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.09", 0x080000, 0x1203db08, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "btc.13m", 0x400000, 0xdc705bad, CPS2_GFX | BRF_GRA }, - { "btc.15m", 0x400000, 0xe5779a3c, CPS2_GFX | BRF_GRA }, - { "btc.17m", 0x400000, 0xb33f4112, CPS2_GFX | BRF_GRA }, - { "btc.19m", 0x400000, 0xa6fcdb7e, CPS2_GFX | BRF_GRA }, - - { "btc.01", 0x020000, 0x1e194310, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "btc.02", 0x020000, 0x01aeb8e6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "btc.11m", 0x200000, 0xc27f2229, CPS2_QSND | BRF_SND }, - { "btc.12m", 0x200000, 0x418a2e33, CPS2_QSND | BRF_SND }, - - { "batcir.key", 0x000014, 0xe316ae67, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Batcir) -STD_ROM_FN(Batcir) - -static struct BurnRomInfo BatciraRomDesc[] = { - { "btca.03", 0x080000, 0x1ad20d87, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btca.04", 0x080000, 0x2b3f4dbe, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btca.05", 0x080000, 0x8238a3d9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btca.06", 0x080000, 0x446c7c02, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.07", 0x080000, 0x7322d5db, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.08", 0x080000, 0x6aac85ab, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.09", 0x080000, 0x1203db08, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "btc.13m", 0x400000, 0xdc705bad, CPS2_GFX | BRF_GRA }, - { "btc.15m", 0x400000, 0xe5779a3c, CPS2_GFX | BRF_GRA }, - { "btc.17m", 0x400000, 0xb33f4112, CPS2_GFX | BRF_GRA }, - { "btc.19m", 0x400000, 0xa6fcdb7e, CPS2_GFX | BRF_GRA }, - - { "btc.01", 0x020000, 0x1e194310, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "btc.02", 0x020000, 0x01aeb8e6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "btc.11m", 0x200000, 0xc27f2229, CPS2_QSND | BRF_SND }, - { "btc.12m", 0x200000, 0x418a2e33, CPS2_QSND | BRF_SND }, - - { "batcira.key", 0x000014, 0x384500f3, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Batcira) -STD_ROM_FN(Batcira) - -static struct BurnRomInfo BatcirjRomDesc[] = { - { "btcj.03", 0x080000, 0x6b7e168d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btcj.04", 0x080000, 0x46ba3467, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btcj.05", 0x080000, 0x0e23a859, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btcj.06", 0x080000, 0xa853b59c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.07", 0x080000, 0x7322d5db, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.08", 0x080000, 0x6aac85ab, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.09", 0x080000, 0x1203db08, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "btc.13m", 0x400000, 0xdc705bad, CPS2_GFX | BRF_GRA }, - { "btc.15m", 0x400000, 0xe5779a3c, CPS2_GFX | BRF_GRA }, - { "btc.17m", 0x400000, 0xb33f4112, CPS2_GFX | BRF_GRA }, - { "btc.19m", 0x400000, 0xa6fcdb7e, CPS2_GFX | BRF_GRA }, - - { "btc.01", 0x020000, 0x1e194310, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "btc.02", 0x020000, 0x01aeb8e6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "btc.11m", 0x200000, 0xc27f2229, CPS2_QSND | BRF_SND }, - { "btc.12m", 0x200000, 0x418a2e33, CPS2_QSND | BRF_SND }, - - { "batcirj.key", 0x000014, 0x9f9fb965, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Batcirj) -STD_ROM_FN(Batcirj) - -static struct BurnRomInfo ChokoRomDesc[] = { - { "tkoj.03", 0x080000, 0x11f5452f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "tkoj.04", 0x080000, 0x68655378, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "tkoj1_d.simm1", 0x200000, 0x6933377d, CPS2_GFX_SIMM | BRF_GRA }, - { "tkoj1_c.simm1", 0x200000, 0x7f668950, CPS2_GFX_SIMM | BRF_GRA }, - { "tkoj1_b.simm1", 0x200000, 0xcfb68ca9, CPS2_GFX_SIMM | BRF_GRA }, - { "tkoj1_a.simm1", 0x200000, 0x437e21c5, CPS2_GFX_SIMM | BRF_GRA }, - { "tkoj3_d.simm3", 0x200000, 0xa9e32b57, CPS2_GFX_SIMM | BRF_GRA }, - { "tkoj3_c.simm3", 0x200000, 0xb7ab9338, CPS2_GFX_SIMM | BRF_GRA }, - { "tkoj3_b.simm3", 0x200000, 0x4d3f919a, CPS2_GFX_SIMM | BRF_GRA }, - { "tkoj3_a.simm3", 0x200000, 0xcfef17ab, CPS2_GFX_SIMM | BRF_GRA }, - - { "tko.01", 0x020000, 0x6eda50c2, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "tkoj5_a.simm5", 0x200000, 0xab45d509, CPS2_QSND_SIMM_BYTESWAP | BRF_SND }, - { "tkoj5_b.simm5", 0x200000, 0xfa905c3d, CPS2_QSND_SIMM_BYTESWAP | BRF_SND }, - - { "choko.key", 0x000014, 0x08505e8b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Choko) -STD_ROM_FN(Choko) - -static struct BurnRomInfo CsclubRomDesc[] = { - { "csce.03a", 0x080000, 0x824082be, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce.04a", 0x080000, 0x74e6a4fe, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce.05a", 0x080000, 0x8ae0df19, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce.06a", 0x080000, 0x51f2f0d3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce.07a", 0x080000, 0x003968fd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "csc.73", 0x080000, 0x335f07c3, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.74", 0x080000, 0xab215357, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.75", 0x080000, 0xa2367381, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.76", 0x080000, 0x728aac1f, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.63", 0x080000, 0x3711b8ca, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.64", 0x080000, 0x828a06d8, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.65", 0x080000, 0x86ee4569, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.66", 0x080000, 0xc24f577f, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.83", 0x080000, 0x0750d12a, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.84", 0x080000, 0x90a92f39, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.85", 0x080000, 0xd08ab012, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.86", 0x080000, 0x41652583, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.93", 0x080000, 0xa756c7f7, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.94", 0x080000, 0xfb7ccc73, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.95", 0x080000, 0x4d014297, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.96", 0x080000, 0x6754b1ef, CPS2_GFX_SPLIT4 | BRF_GRA }, - - { "csc.01", 0x020000, 0xee162111, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "csc.51", 0x080000, 0x5a52afd5, CPS2_QSND | BRF_SND }, - { "csc.52", 0x080000, 0x1408a811, CPS2_QSND | BRF_SND }, - { "csc.53", 0x080000, 0x4fb9f57c, CPS2_QSND | BRF_SND }, - { "csc.54", 0x080000, 0x9a8f40ec, CPS2_QSND | BRF_SND }, - { "csc.55", 0x080000, 0x91529a91, CPS2_QSND | BRF_SND }, - { "csc.56", 0x080000, 0x9a345334, CPS2_QSND | BRF_SND }, - { "csc.57", 0x080000, 0xaedc27f2, CPS2_QSND | BRF_SND }, - { "csc.58", 0x080000, 0x2300b7b3, CPS2_QSND | BRF_SND }, - - { "csclub.key", 0x000014, 0x903907d7, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Csclub) -STD_ROM_FN(Csclub) - -static struct BurnRomInfo Csclub1RomDesc[] = { - { "csce.03", 0x080000, 0xf2c852ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce.04", 0x080000, 0x1184530f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce.05", 0x080000, 0x804e2b6b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce.06", 0x080000, 0x09277cb9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csc.07", 0x080000, 0x01b05caa, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "csc.14m", 0x200000, 0xe8904afa, CPS2_GFX | BRF_GRA }, - { "csc.16m", 0x200000, 0xc98c8079, CPS2_GFX | BRF_GRA }, - { "csc.18m", 0x200000, 0xc030df5a, CPS2_GFX | BRF_GRA }, - { "csc.20m", 0x200000, 0xb4e55863, CPS2_GFX | BRF_GRA }, - - { "csc.01", 0x020000, 0xee162111, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "csc.11m", 0x200000, 0xa027b827, CPS2_QSND | BRF_SND }, - { "csc.12m", 0x200000, 0xcb7f6e55, CPS2_QSND | BRF_SND }, - - { "csclub.key", 0x000014, 0x903907d7, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Csclub1) -STD_ROM_FN(Csclub1) - -static struct BurnRomInfo CsclubaRomDesc[] = { - { "csca.03", 0x080000, 0xb6acd708, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csca.04", 0x080000, 0xd44ae35f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csca.05", 0x080000, 0x8da76aec, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csca.06", 0x080000, 0xa1b7b1ee, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csc.07", 0x080000, 0x01b05caa, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "csc.14m", 0x200000, 0xe8904afa, CPS2_GFX | BRF_GRA }, - { "csc.16m", 0x200000, 0xc98c8079, CPS2_GFX | BRF_GRA }, - { "csc.18m", 0x200000, 0xc030df5a, CPS2_GFX | BRF_GRA }, - { "csc.20m", 0x200000, 0xb4e55863, CPS2_GFX | BRF_GRA }, - - { "csc.01", 0x020000, 0xee162111, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "csc.11m", 0x200000, 0xa027b827, CPS2_QSND | BRF_SND }, - { "csc.12m", 0x200000, 0xcb7f6e55, CPS2_QSND | BRF_SND }, - - { "cscluba.key", 0x000014, 0x591908dc, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Cscluba) -STD_ROM_FN(Cscluba) - -static struct BurnRomInfo CsclubhRomDesc[] = { - { "csch.03", 0x080000, 0x0dd7e46d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csch.04", 0x080000, 0x486e8143, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csch.05", 0x080000, 0x9e509dfb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csch.06", 0x080000, 0x817ba313, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csc.07", 0x080000, 0x01b05caa, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "csc.14m", 0x200000, 0xe8904afa, CPS2_GFX | BRF_GRA }, - { "csc.16m", 0x200000, 0xc98c8079, CPS2_GFX | BRF_GRA }, - { "csc.18m", 0x200000, 0xc030df5a, CPS2_GFX | BRF_GRA }, - { "csc.20m", 0x200000, 0xb4e55863, CPS2_GFX | BRF_GRA }, - - { "csc.01", 0x020000, 0xee162111, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "csc.11m", 0x200000, 0xa027b827, CPS2_QSND | BRF_SND }, - { "csc.12m", 0x200000, 0xcb7f6e55, CPS2_QSND | BRF_SND }, - - { "csclubh.key", 0x000014, 0xb0adc39e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Csclubh) -STD_ROM_FN(Csclubh) - -static struct BurnRomInfo CsclubjRomDesc[] = { - { "cscj.03", 0x080000, 0xec4ddaa2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cscj.04", 0x080000, 0x60c632bb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cscj.05", 0x080000, 0xad042003, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cscj.06", 0x080000, 0x169e4d40, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csc.07", 0x080000, 0x01b05caa, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "csc.14m", 0x200000, 0xe8904afa, CPS2_GFX | BRF_GRA }, - { "csc.16m", 0x200000, 0xc98c8079, CPS2_GFX | BRF_GRA }, - { "csc.18m", 0x200000, 0xc030df5a, CPS2_GFX | BRF_GRA }, - { "csc.20m", 0x200000, 0xb4e55863, CPS2_GFX | BRF_GRA }, - - { "csc.01", 0x020000, 0xee162111, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "csc.11m", 0x200000, 0xa027b827, CPS2_QSND | BRF_SND }, - { "csc.12m", 0x200000, 0xcb7f6e55, CPS2_QSND | BRF_SND }, - - { "csclubj.key", 0x000014, 0x519a04db, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Csclubj) -STD_ROM_FN(Csclubj) - -static struct BurnRomInfo CsclubjyRomDesc[] = { -// this is fairly redundant, same code as csclubj, same gfx as csclub (yellow case - all eprom), but it's a valid shipped combination - { "cscj.03", 0x080000, 0xec4ddaa2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cscj.04", 0x080000, 0x60c632bb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cscj.05", 0x080000, 0xad042003, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cscj.06", 0x080000, 0x169e4d40, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csc.07", 0x080000, 0x01b05caa, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "csc.73", 0x080000, 0x335f07c3, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.74", 0x080000, 0xab215357, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.75", 0x080000, 0xa2367381, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.76", 0x080000, 0x728aac1f, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.63", 0x080000, 0x3711b8ca, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.64", 0x080000, 0x828a06d8, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.65", 0x080000, 0x86ee4569, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.66", 0x080000, 0xc24f577f, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.83", 0x080000, 0x0750d12a, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.84", 0x080000, 0x90a92f39, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.85", 0x080000, 0xd08ab012, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.86", 0x080000, 0x41652583, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.93", 0x080000, 0xa756c7f7, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.94", 0x080000, 0xfb7ccc73, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.95", 0x080000, 0x4d014297, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.96", 0x080000, 0x6754b1ef, CPS2_GFX_SPLIT4 | BRF_GRA }, - - { "csc.01", 0x020000, 0xee162111, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "csc.51", 0x080000, 0x5a52afd5, CPS2_QSND | BRF_SND }, - { "csc.52", 0x080000, 0x1408a811, CPS2_QSND | BRF_SND }, - { "csc.53", 0x080000, 0x4fb9f57c, CPS2_QSND | BRF_SND }, - { "csc.54", 0x080000, 0x9a8f40ec, CPS2_QSND | BRF_SND }, - { "csc.55", 0x080000, 0x91529a91, CPS2_QSND | BRF_SND }, - { "csc.56", 0x080000, 0x9a345334, CPS2_QSND | BRF_SND }, - { "csc.57", 0x080000, 0xaedc27f2, CPS2_QSND | BRF_SND }, - { "csc.58", 0x080000, 0x2300b7b3, CPS2_QSND | BRF_SND }, - - { "csclubj.key", 0x000014, 0x519a04db, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Csclubjy) -STD_ROM_FN(Csclubjy) - -static struct BurnRomInfo CybotsRomDesc[] = { - { "cybe.03", 0x080000, 0x234381cd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cybe.04", 0x080000, 0x80691061, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.05", 0x080000, 0xec40408e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.06", 0x080000, 0x1ad0bed2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.07", 0x080000, 0x6245a39a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.08", 0x080000, 0x4b48e223, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.09", 0x080000, 0xe15238f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.10", 0x080000, 0x75f4003b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "cyb.13m", 0x400000, 0xf0dce192, CPS2_GFX | BRF_GRA }, - { "cyb.15m", 0x400000, 0x187aa39c, CPS2_GFX | BRF_GRA }, - { "cyb.17m", 0x400000, 0x8a0e4b12, CPS2_GFX | BRF_GRA }, - { "cyb.19m", 0x400000, 0x34b62612, CPS2_GFX | BRF_GRA }, - { "cyb.14m", 0x400000, 0xc1537957, CPS2_GFX | BRF_GRA }, - { "cyb.16m", 0x400000, 0x15349e86, CPS2_GFX | BRF_GRA }, - { "cyb.18m", 0x400000, 0xd83e977d, CPS2_GFX | BRF_GRA }, - { "cyb.20m", 0x400000, 0x77cdad5c, CPS2_GFX | BRF_GRA }, - - { "cyb.01", 0x020000, 0x9c0fb079, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "cyb.02", 0x020000, 0x51cb0c4e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "cyb.11m", 0x200000, 0x362ccab2, CPS2_QSND | BRF_SND }, - { "cyb.12m", 0x200000, 0x7066e9cc, CPS2_QSND | BRF_SND }, - - { "cybots.key", 0x000014, 0x9bbcbef3, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Cybots) -STD_ROM_FN(Cybots) - -static struct BurnRomInfo CybotsjRomDesc[] = { - { "cybj.03", 0x080000, 0x6096eada, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cybj.04", 0x080000, 0x7b0ffaa9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.05", 0x080000, 0xec40408e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.06", 0x080000, 0x1ad0bed2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.07", 0x080000, 0x6245a39a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.08", 0x080000, 0x4b48e223, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.09", 0x080000, 0xe15238f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.10", 0x080000, 0x75f4003b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "cyb.13m", 0x400000, 0xf0dce192, CPS2_GFX | BRF_GRA }, - { "cyb.15m", 0x400000, 0x187aa39c, CPS2_GFX | BRF_GRA }, - { "cyb.17m", 0x400000, 0x8a0e4b12, CPS2_GFX | BRF_GRA }, - { "cyb.19m", 0x400000, 0x34b62612, CPS2_GFX | BRF_GRA }, - { "cyb.14m", 0x400000, 0xc1537957, CPS2_GFX | BRF_GRA }, - { "cyb.16m", 0x400000, 0x15349e86, CPS2_GFX | BRF_GRA }, - { "cyb.18m", 0x400000, 0xd83e977d, CPS2_GFX | BRF_GRA }, - { "cyb.20m", 0x400000, 0x77cdad5c, CPS2_GFX | BRF_GRA }, - - { "cyb.01", 0x020000, 0x9c0fb079, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "cyb.02", 0x020000, 0x51cb0c4e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "cyb.11m", 0x200000, 0x362ccab2, CPS2_QSND | BRF_SND }, - { "cyb.12m", 0x200000, 0x7066e9cc, CPS2_QSND | BRF_SND }, - - { "cybotsj.key", 0x000014, 0xd4d560b7, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Cybotsj) -STD_ROM_FN(Cybotsj) - -static struct BurnRomInfo CybotsuRomDesc[] = { - { "cybu.03", 0x080000, 0xdb4da8f4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cybu.04", 0x080000, 0x1eec68ac, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.05", 0x080000, 0xec40408e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.06", 0x080000, 0x1ad0bed2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.07", 0x080000, 0x6245a39a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.08", 0x080000, 0x4b48e223, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.09", 0x080000, 0xe15238f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.10", 0x080000, 0x75f4003b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "cyb.13m", 0x400000, 0xf0dce192, CPS2_GFX | BRF_GRA }, - { "cyb.15m", 0x400000, 0x187aa39c, CPS2_GFX | BRF_GRA }, - { "cyb.17m", 0x400000, 0x8a0e4b12, CPS2_GFX | BRF_GRA }, - { "cyb.19m", 0x400000, 0x34b62612, CPS2_GFX | BRF_GRA }, - { "cyb.14m", 0x400000, 0xc1537957, CPS2_GFX | BRF_GRA }, - { "cyb.16m", 0x400000, 0x15349e86, CPS2_GFX | BRF_GRA }, - { "cyb.18m", 0x400000, 0xd83e977d, CPS2_GFX | BRF_GRA }, - { "cyb.20m", 0x400000, 0x77cdad5c, CPS2_GFX | BRF_GRA }, - - { "cyb.01", 0x020000, 0x9c0fb079, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "cyb.02", 0x020000, 0x51cb0c4e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "cyb.11m", 0x200000, 0x362ccab2, CPS2_QSND | BRF_SND }, - { "cyb.12m", 0x200000, 0x7066e9cc, CPS2_QSND | BRF_SND }, - - { "cybotsu.key", 0x000014, 0x7a09403c, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Cybotsu) -STD_ROM_FN(Cybotsu) - -static struct BurnRomInfo DdsomRomDesc[] = { - { "dd2e.03e", 0x080000, 0x449361AF, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.04e", 0x080000, 0x5B7052B6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.05e", 0x080000, 0x788D5F60, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.06e", 0x080000, 0xE0807E1E, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.07", 0x080000, 0xbb777a02, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.08", 0x080000, 0x30970890, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.09", 0x080000, 0x99e2194d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.10", 0x080000, 0xe198805e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsom.key", 0x000014, 0x541e425d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsom) -STD_ROM_FN(Ddsom) - -static struct BurnRomInfo Ddsomr1RomDesc[] = { - { "dd2e.03d", 0x080000, 0x6c084ab5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.04d", 0x080000, 0x9b94a947, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.05d", 0x080000, 0x5d6a63c6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.06d", 0x080000, 0x31bde8ee, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.07", 0x080000, 0xbb777a02, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.08", 0x080000, 0x30970890, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.09", 0x080000, 0x99e2194d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.10", 0x080000, 0xe198805e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsom.key", 0x000014, 0x541e425d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomr1) -STD_ROM_FN(Ddsomr1) - -static struct BurnRomInfo Ddsomr2RomDesc[] = { - { "dd2e.03b", 0x080000, 0xcd2deb66, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.04b", 0x080000, 0xbfee43cc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.05b", 0x080000, 0x049ab19d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.06b", 0x080000, 0x3994fb8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.07", 0x080000, 0xbb777a02, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.08", 0x080000, 0x30970890, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.09", 0x080000, 0x99e2194d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.10", 0x080000, 0xe198805e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsom.key", 0x000014, 0x541e425d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomr2) -STD_ROM_FN(Ddsomr2) - -static struct BurnRomInfo Ddsomr3RomDesc[] = { - { "dd2e.03a", 0x080000, 0x6de67678, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.04a", 0x080000, 0x0e45739a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.05a", 0x080000, 0x3dce8025, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.06a", 0x080000, 0x51bafbef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.07", 0x080000, 0xbb777a02, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.08", 0x080000, 0x30970890, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.09", 0x080000, 0x99e2194d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.10", 0x080000, 0xe198805e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsom.key", 0x000014, 0x541e425d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomr3) -STD_ROM_FN(Ddsomr3) - -static struct BurnRomInfo DdsomaRomDesc[] = { - { "dd2a.03g", 0x080000, 0x0b4fec22, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2a.04g", 0x080000, 0x055b7019, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.05g", 0x080000, 0x5eb1991c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.06g", 0x080000, 0xc26b5e55, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.07", 0x080000, 0x909a0b8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.08", 0x080000, 0xe53c4d01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.09", 0x080000, 0x5f86279f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.10", 0x080000, 0xad954c26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsoma.key", 0x000014, 0x8c3cc560, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsoma) -STD_ROM_FN(Ddsoma) - -static struct BurnRomInfo Ddsomar1RomDesc[] = { - { "dd2a.03c", 0x080000, 0x17162039, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2a.04c", 0x080000, 0x950bec38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2a.05c", 0x080000, 0xfa298eba, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2a.06c", 0x080000, 0x28f75b35, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.07", 0x080000, 0x909a0b8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // dd2a.07 on sticker - { "dd2.08", 0x080000, 0xe53c4d01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // dd2a.08 on sticker - { "dd2.09", 0x080000, 0x5f86279f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // dd2a.09 on sticker - { "dd2.10", 0x080000, 0xad954c26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // dd2a.10 on sticker - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, // dd2a.01 on sticker - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, // dd2a.02 on sticker - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsoma.key", 0x000014, 0x8c3cc560, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomar1) -STD_ROM_FN(Ddsomar1) - -static struct BurnRomInfo DdsombRomDesc[] = { - { "dd2b.03a", 0x080000, 0xe8ce7fbb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2b.04a", 0x080000, 0x6b679664, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2b.05a", 0x080000, 0x9b2534eb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2b.06a", 0x080000, 0x3b21ba59, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2b.07", 0x080000, 0xfce2558d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.08", 0x080000, 0x30970890, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.09", 0x080000, 0x99e2194d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.10", 0x080000, 0xe198805e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsomb.key", 0x000014, 0x00b4cc49, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomb) -STD_ROM_FN(Ddsomb) - -static struct BurnRomInfo DdsomhRomDesc[] = { - { "dd2h.03a", 0x080000, 0xe472c9f3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2h.04a", 0x080000, 0x315a7706, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2h.05a", 0x080000, 0x9b2534eb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2h.06a", 0x080000, 0x3b21ba59, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2h.07a", 0x080000, 0xfce2558d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.08", 0x080000, 0x30970890, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.09", 0x080000, 0x99e2194d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2e.10", 0x080000, 0xe198805e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsomh.key", 0x000014, 0xcaf6b540, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomh) -STD_ROM_FN(Ddsomh) - -static struct BurnRomInfo DdsomjRomDesc[] = { - { "dd2j.03g", 0x080000, 0xe6c8c985, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2j.04g", 0x080000, 0x8386c0bd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.05g", 0x080000, 0x5eb1991c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.06g", 0x080000, 0xc26b5e55, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.07", 0x080000, 0x909a0b8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.08", 0x080000, 0xe53c4d01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.09", 0x080000, 0x5f86279f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.10", 0x080000, 0xad954c26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsomj.key", 0x000014, 0xd8dadb22, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomj) -STD_ROM_FN(Ddsomj) - -static struct BurnRomInfo Ddsomjr1RomDesc[] = { - { "dd2j.03b", 0x080000, 0x965d74e5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2j.04b", 0x080000, 0x958eb8f3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.05b", 0x080000, 0xd38571ca, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.06b", 0x080000, 0x6d5a3bbb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.07", 0x080000, 0x909a0b8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.08", 0x080000, 0xe53c4d01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.09", 0x080000, 0x5f86279f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.10", 0x080000, 0xad954c26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsomj.key", 0x000014, 0xd8dadb22, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomjr1) -STD_ROM_FN(Ddsomjr1) - -static struct BurnRomInfo Ddsomjr2RomDesc[] = { - { "dd2j.03b", 0x080000, 0xb2fd4a24, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2j.04b", 0x080000, 0x3a68c310, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.05b", 0x080000, 0xaa56f42f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.06b", 0x080000, 0x2f8cd040, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.07", 0x080000, 0x909a0b8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.08", 0x080000, 0xe53c4d01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.09", 0x080000, 0x5f86279f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.10", 0x080000, 0xad954c26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsomj.key", 0x000014, 0xd8dadb22, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomjr2) -STD_ROM_FN(Ddsomjr2) - -static struct BurnRomInfo DdsomuRomDesc[] = { - { "dd2u.03g", 0x080000, 0xfb089b39, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2u.04g", 0x080000, 0xcd432b73, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.05g", 0x080000, 0x5eb1991c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.06g", 0x080000, 0xc26b5e55, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.07", 0x080000, 0x909a0b8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.08", 0x080000, 0xe53c4d01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.09", 0x080000, 0x5f86279f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.10", 0x080000, 0xad954c26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsomu.key", 0x000014, 0x09ae0f7c, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomu) -STD_ROM_FN(Ddsomu) - -static struct BurnRomInfo Ddsomur1RomDesc[] = { - { "dd2u.03d", 0x080000, 0x0f700d84, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2u.04d", 0x080000, 0xb99eb254, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.05d", 0x080000, 0xb23061f3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.06d", 0x080000, 0x8bf1d8ce, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.07", 0x080000, 0x909a0b8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.08", 0x080000, 0xe53c4d01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.09", 0x080000, 0x5f86279f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.10", 0x080000, 0xad954c26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "ddsomu.key", 0x000014, 0x09ae0f7c, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomur1) -STD_ROM_FN(Ddsomur1) - -static struct BurnRomInfo DdtodRomDesc[] = { - { "dade.03c", 0x080000, 0x8e73533d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dade.04c", 0x080000, 0x00c2e82e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dade.05c", 0x080000, 0xea996008, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06a", 0x080000, 0x6225495a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07a", 0x080000, 0xb3480ec3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtod.key", 0x000014, 0x41dfca41, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtod) -STD_ROM_FN(Ddtod) - -static struct BurnRomInfo Ddtodr1RomDesc[] = { - { "dade.03a", 0x080000, 0x665a035e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dade.04a", 0x080000, 0x02613207, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dade.05a", 0x080000, 0x36845996, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06", 0x080000, 0x13aa3e56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07", 0x080000, 0x431cb6dd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtod.key", 0x000014, 0x41dfca41, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodr1) -STD_ROM_FN(Ddtodr1) - -static struct BurnRomInfo DdtodaRomDesc[] = { - { "dada.03c", 0x080000, 0xbf243e15, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dada.04c", 0x080000, 0x76551eec, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dada.05c", 0x080000, 0x0a0ad827, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06a", 0x080000, 0x6225495a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07a", 0x080000, 0xb3480ec3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtoda.key", 0x000014, 0xe5e8d1b8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtoda) -STD_ROM_FN(Ddtoda) - -static struct BurnRomInfo Ddtodar1RomDesc[] = { - { "dada.03a", 0x080000, 0xfc6f2dd7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dada.04a", 0x080000, 0xd4be4009, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dada.05a", 0x080000, 0x6712d1cf, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06", 0x080000, 0x13aa3e56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07", 0x080000, 0x431cb6dd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtoda.key", 0x000014, 0xe5e8d1b8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodar1) -STD_ROM_FN(Ddtodar1) - -static struct BurnRomInfo DdtodhRomDesc[] = { - { "dadh.03c", 0x080000, 0x5750a861, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadh.04c", 0x080000, 0xcfbf1b56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadh.05c", 0x080000, 0xa6e562ba, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06a", 0x080000, 0x6225495a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07a", 0x080000, 0xb3480ec3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtodh.key", 0x000014, 0x65f33a1c, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodh) -STD_ROM_FN(Ddtodh) - -static struct BurnRomInfo Ddtodhr1RomDesc[] = { - { "dadh.03b", 0x080000, 0xae0cb98e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadh.04b", 0x080000, 0xb5774363, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadh.05b", 0x080000, 0x6ce2a485, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06", 0x080000, 0x13aa3e56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07", 0x080000, 0x431cb6dd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtodh.key", 0x000014, 0x65f33a1c, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodhr1) -STD_ROM_FN(Ddtodhr1) - -static struct BurnRomInfo Ddtodhr2RomDesc[] = { - { "dadh.03a", 0x080000, 0x43d04aa3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadh.04a", 0x080000, 0x8b8d296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadh.05a", 0x080000, 0xdaae6b14, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06", 0x080000, 0x13aa3e56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07", 0x080000, 0x431cb6dd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtodh.key", 0x000014, 0x65f33a1c, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodhr2) -STD_ROM_FN(Ddtodhr2) - -static struct BurnRomInfo DdtodjRomDesc[] = { - { "dadj.03c", 0x080000, 0x0b1b5798, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadj.04c", 0x080000, 0xc6a2fbc8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadj.05c", 0x080000, 0x189b15fe, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06a", 0x080000, 0x6225495a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07a", 0x080000, 0xb3480ec3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtodj.key", 0x000014, 0x5414dfca, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodj) -STD_ROM_FN(Ddtodj) - -static struct BurnRomInfo Ddtodjr1RomDesc[] = { - { "dadj.03b", 0x080000, 0x87606b85, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadj.04b", 0x080000, 0x24d49575, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadj.05b", 0x080000, 0x56ce51f7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06", 0x080000, 0x13aa3e56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07", 0x080000, 0x431cb6dd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtodj.key", 0x000014, 0x5414dfca, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodjr1) -STD_ROM_FN(Ddtodjr1) - -static struct BurnRomInfo Ddtodjr2RomDesc[] = { - { "dadj.03a", 0x080000, 0x711638dc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadj.04a", 0x080000, 0x4869639c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadj.05a", 0x080000, 0x484c0efa, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06", 0x080000, 0x13aa3e56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07", 0x080000, 0x431cb6dd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtodj.key", 0x000014, 0x5414dfca, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodjr2) -STD_ROM_FN(Ddtodjr2) - -static struct BurnRomInfo DdtoduRomDesc[] = { - { "dadu.03b", 0x080000, 0xa519905f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadu.04b", 0x080000, 0x52562d38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadu.05b", 0x080000, 0xee1cfbfe, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06", 0x080000, 0x13aa3e56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07", 0x080000, 0x431cb6dd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtodu.key", 0x000014, 0x7c03ec9e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodu) -STD_ROM_FN(Ddtodu) - -static struct BurnRomInfo Ddtodur1RomDesc[] = { - { "dadu.03a", 0x080000, 0x4413f177, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadu.04a", 0x080000, 0x168de230, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadu.05a", 0x080000, 0x03d39e91, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06", 0x080000, 0x13aa3e56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.07", 0x080000, 0x431cb6dd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "ddtodu.key", 0x000014, 0x7c03ec9e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodur1) -STD_ROM_FN(Ddtodur1) - -static struct BurnRomInfo DimahooRomDesc[] = { - { "gmde.03", 0x080000, 0x968fcecd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.04", 0x080000, 0x37485567, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.05", 0x080000, 0xda269ffb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.06", 0x080000, 0x55b483c9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "gmd.13m", 0x400000, 0x80dd19f0, CPS2_GFX | BRF_GRA }, - { "gmd.15m", 0x400000, 0xdfd93a78, CPS2_GFX | BRF_GRA }, - { "gmd.17m", 0x400000, 0x16356520, CPS2_GFX | BRF_GRA }, - { "gmd.19m", 0x400000, 0xdfc33031, CPS2_GFX | BRF_GRA }, - - { "gmd.01", 0x020000, 0x3f9bc985, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "gmd.02", 0x020000, 0x3fd39dde, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "gmd.11m", 0x400000, 0x06a65542, CPS2_QSND | BRF_SND }, - { "gmd.12m", 0x400000, 0x50bc7a31, CPS2_QSND | BRF_SND }, - - { "dimahoo.key", 0x000014, 0x7d6d2db9, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Dimahoo) -STD_ROM_FN(Dimahoo) - -static struct BurnRomInfo GmdjRomDesc[] = { - { "gmdj.03", 0x080000, 0xcd6979e3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.04", 0x080000, 0x37485567, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.05", 0x080000, 0xda269ffb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.06", 0x080000, 0x55b483c9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "gmd.13m", 0x400000, 0x80dd19f0, CPS2_GFX | BRF_GRA }, - { "gmd.15m", 0x400000, 0xdfd93a78, CPS2_GFX | BRF_GRA }, - { "gmd.17m", 0x400000, 0x16356520, CPS2_GFX | BRF_GRA }, - { "gmd.19m", 0x400000, 0xdfc33031, CPS2_GFX | BRF_GRA }, - - { "gmd.01", 0x020000, 0x3f9bc985, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "gmd.02", 0x020000, 0x3fd39dde, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "gmd.11m", 0x400000, 0x06a65542, CPS2_QSND | BRF_SND }, - { "gmd.12m", 0x400000, 0x50bc7a31, CPS2_QSND | BRF_SND }, - - { "gmahou.key", 0x000014, 0x76a5e659, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Gmdj) -STD_ROM_FN(Gmdj) - -static struct BurnRomInfo DimahoouRomDesc[] = { - { "gmdu.03", 0x080000, 0x43bcb15f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.04", 0x080000, 0x37485567, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.05", 0x080000, 0xda269ffb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.06", 0x080000, 0x55b483c9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "gmd.13m", 0x400000, 0x80dd19f0, CPS2_GFX | BRF_GRA }, - { "gmd.15m", 0x400000, 0xdfd93a78, CPS2_GFX | BRF_GRA }, - { "gmd.17m", 0x400000, 0x16356520, CPS2_GFX | BRF_GRA }, - { "gmd.19m", 0x400000, 0xdfc33031, CPS2_GFX | BRF_GRA }, - - { "gmd.01", 0x020000, 0x3f9bc985, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "gmd.02", 0x020000, 0x3fd39dde, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "gmd.11m", 0x400000, 0x06a65542, CPS2_QSND | BRF_SND }, - { "gmd.12m", 0x400000, 0x50bc7a31, CPS2_QSND | BRF_SND }, - - { "dimahoou.key", 0x000014, 0x8254d7ab, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Dimahoou) -STD_ROM_FN(Dimahoou) - -static struct BurnRomInfo DstlkRomDesc[] = { - { "vame.03a", 0x080000, 0x004c9cff, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vame.04a", 0x080000, 0xae413ff2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vame.05a", 0x080000, 0x60678756, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vame.06a", 0x080000, 0x912870b3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vame.07a", 0x080000, 0xdabae3e8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vame.08a", 0x080000, 0x2c6e3077, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vame.09a", 0x080000, 0xf16db74b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vame.10a", 0x080000, 0x701e2147, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vam.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vam.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vam.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vam.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vam.14m", 0x100000, 0xbd87243c, CPS2_GFX | BRF_GRA }, - { "vam.16m", 0x100000, 0xafec855f, CPS2_GFX | BRF_GRA }, - { "vam.18m", 0x100000, 0x3a033625, CPS2_GFX | BRF_GRA }, - { "vam.20m", 0x100000, 0x2bff6a89, CPS2_GFX | BRF_GRA }, - - { "vam.01", 0x020000, 0x64b685d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vam.02", 0x020000, 0xcf7c97c7, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vam.11m", 0x200000, 0x4a39deb2, CPS2_QSND | BRF_SND }, - { "vam.12m", 0x200000, 0x1a3e5c03, CPS2_QSND | BRF_SND }, - - { "dstlk.key", 0x000014, 0xcfa46dec, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Dstlk) -STD_ROM_FN(Dstlk) - -static struct BurnRomInfo DstlkaRomDesc[] = { - { "vama.03a", 0x080000, 0x294e0bec, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vama.04a", 0x080000, 0xbc18e128, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vama.05a", 0x080000, 0xe709fa59, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vama.06a", 0x080000, 0x55e4d387, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vama.07a", 0x080000, 0x24e8f981, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vama.08a", 0x080000, 0x743f3a8e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vama.09a", 0x080000, 0x67fa5573, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vama.10a", 0x080000, 0x5e03d747, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vam.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vam.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vam.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vam.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vam.14m", 0x100000, 0xbd87243c, CPS2_GFX | BRF_GRA }, - { "vam.16m", 0x100000, 0xafec855f, CPS2_GFX | BRF_GRA }, - { "vam.18m", 0x100000, 0x3a033625, CPS2_GFX | BRF_GRA }, - { "vam.20m", 0x100000, 0x2bff6a89, CPS2_GFX | BRF_GRA }, - - { "vam.01", 0x020000, 0x64b685d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vam.02", 0x020000, 0xcf7c97c7, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vam.11m", 0x200000, 0x4a39deb2, CPS2_QSND | BRF_SND }, - { "vam.12m", 0x200000, 0x1a3e5c03, CPS2_QSND | BRF_SND }, - - { "dstlka.key", 0x000014, 0xd31d61bc, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Dstlka) -STD_ROM_FN(Dstlka) - -static struct BurnRomInfo DstlkhRomDesc[] = { - { "vamh.03c", 0x080000, 0x4d7b9e8f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamh.04c", 0x080000, 0x2217e9a0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamh.05c", 0x080000, 0x3a05b13c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamh.06c", 0x080000, 0x11d70a1c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamh.07c", 0x080000, 0xdb5a8767, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamh.08c", 0x080000, 0x2a4fd79b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamh.09c", 0x080000, 0x15187632, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamh.10c", 0x080000, 0x192d2d81, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vam.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vam.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vam.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vam.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vam.14m", 0x100000, 0xbd87243c, CPS2_GFX | BRF_GRA }, - { "vam.16m", 0x100000, 0xafec855f, CPS2_GFX | BRF_GRA }, - { "vam.18m", 0x100000, 0x3a033625, CPS2_GFX | BRF_GRA }, - { "vam.20m", 0x100000, 0x2bff6a89, CPS2_GFX | BRF_GRA }, - - { "vam.01", 0x020000, 0x64b685d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vam.02", 0x020000, 0xcf7c97c7, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vam.11m", 0x200000, 0x4a39deb2, CPS2_QSND | BRF_SND }, - { "vam.12m", 0x200000, 0x1a3e5c03, CPS2_QSND | BRF_SND }, - - { "dstlkh.key", 0x000014, 0xd748cb77, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Dstlkh) -STD_ROM_FN(Dstlkh) - -static struct BurnRomInfo DstlkuRomDesc[] = { - { "vamu.03b", 0x080000, 0x68a6343f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.04b", 0x080000, 0x58161453, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.05b", 0x080000, 0xdfc038b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.06b", 0x080000, 0xc3842c89, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.07b", 0x080000, 0x25b60b6e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.08b", 0x080000, 0x2113c596, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.09b", 0x080000, 0x2d1e9ae5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.10b", 0x080000, 0x81145622, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vam.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vam.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vam.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vam.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vam.14m", 0x100000, 0xbd87243c, CPS2_GFX | BRF_GRA }, - { "vam.16m", 0x100000, 0xafec855f, CPS2_GFX | BRF_GRA }, - { "vam.18m", 0x100000, 0x3a033625, CPS2_GFX | BRF_GRA }, - { "vam.20m", 0x100000, 0x2bff6a89, CPS2_GFX | BRF_GRA }, - - { "vam.01", 0x020000, 0x64b685d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vam.02", 0x020000, 0xcf7c97c7, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vam.11m", 0x200000, 0x4a39deb2, CPS2_QSND | BRF_SND }, - { "vam.12m", 0x200000, 0x1a3e5c03, CPS2_QSND | BRF_SND }, - - { "dstlku.key", 0x000014, 0xc76091ba, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Dstlku) -STD_ROM_FN(Dstlku) - -static struct BurnRomInfo Dstlkur1RomDesc[] = { - { "vamu.03a", 0x080000, 0x628899f9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.04a", 0x080000, 0x696d9b25, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.05a", 0x080000, 0x673ed50a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.06a", 0x080000, 0xf2377be7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.07a", 0x080000, 0xd8f498c4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.08a", 0x080000, 0xe6a8a1a0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.09a", 0x080000, 0x8dd55b24, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.10a", 0x080000, 0xc1a3d9be, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vam.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vam.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vam.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vam.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vam.14m", 0x100000, 0xbd87243c, CPS2_GFX | BRF_GRA }, - { "vam.16m", 0x100000, 0xafec855f, CPS2_GFX | BRF_GRA }, - { "vam.18m", 0x100000, 0x3a033625, CPS2_GFX | BRF_GRA }, - { "vam.20m", 0x100000, 0x2bff6a89, CPS2_GFX | BRF_GRA }, - - { "vam.01", 0x020000, 0x64b685d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vam.02", 0x020000, 0xcf7c97c7, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vam.11m", 0x200000, 0x4a39deb2, CPS2_QSND | BRF_SND }, - { "vam.12m", 0x200000, 0x1a3e5c03, CPS2_QSND | BRF_SND }, - - { "dstlku.key", 0x000014, 0xc76091ba, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Dstlkur1) -STD_ROM_FN(Dstlkur1) - -static struct BurnRomInfo VampjRomDesc[] = { - { "vamj.03a", 0x080000, 0xf55d3722, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.04b", 0x080000, 0x4d9c43c4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.05a", 0x080000, 0x6c497e92, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.06a", 0x080000, 0xf1bbecb6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.07a", 0x080000, 0x1067ad84, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.08a", 0x080000, 0x4b89f41f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.09a", 0x080000, 0xfc0a4aac, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.10a", 0x080000, 0x9270c26b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vam.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vam.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vam.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vam.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vam.14m", 0x100000, 0xbd87243c, CPS2_GFX | BRF_GRA }, - { "vam.16m", 0x100000, 0xafec855f, CPS2_GFX | BRF_GRA }, - { "vam.18m", 0x100000, 0x3a033625, CPS2_GFX | BRF_GRA }, - { "vam.20m", 0x100000, 0x2bff6a89, CPS2_GFX | BRF_GRA }, - - { "vam.01", 0x020000, 0x64b685d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vam.02", 0x020000, 0xcf7c97c7, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vam.11m", 0x200000, 0x4a39deb2, CPS2_QSND | BRF_SND }, - { "vam.12m", 0x200000, 0x1a3e5c03, CPS2_QSND | BRF_SND }, - - { "vampj.key", 0x000014, 0x8418cc6f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vampj) -STD_ROM_FN(Vampj) - -static struct BurnRomInfo VampjaRomDesc[] = { - { "vamj.03a", 0x080000, 0xf55d3722, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.04a", 0x080000, 0xfdcbdae3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.05a", 0x080000, 0x6c497e92, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.06a", 0x080000, 0xf1bbecb6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.07a", 0x080000, 0x1067ad84, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.08a", 0x080000, 0x4b89f41f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.09a", 0x080000, 0xfc0a4aac, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.10a", 0x080000, 0x9270c26b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vam.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vam.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vam.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vam.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vam.14m", 0x100000, 0xbd87243c, CPS2_GFX | BRF_GRA }, - { "vam.16m", 0x100000, 0xafec855f, CPS2_GFX | BRF_GRA }, - { "vam.18m", 0x100000, 0x3a033625, CPS2_GFX | BRF_GRA }, - { "vam.20m", 0x100000, 0x2bff6a89, CPS2_GFX | BRF_GRA }, - - { "vam.01", 0x020000, 0x64b685d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vam.02", 0x020000, 0xcf7c97c7, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vam.11m", 0x200000, 0x4a39deb2, CPS2_QSND | BRF_SND }, - { "vam.12m", 0x200000, 0x1a3e5c03, CPS2_QSND | BRF_SND }, - - { "vampj.key", 0x000014, 0x8418cc6f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vampja) -STD_ROM_FN(Vampja) - -static struct BurnRomInfo Vampjr1RomDesc[] = { - { "vamj.03", 0x080000, 0x8895bf77, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.04", 0x080000, 0x5027db3d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.05", 0x080000, 0x97c66fdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.06", 0x080000, 0x9b4c3426, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.07", 0x080000, 0x303bc4fd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.08", 0x080000, 0x3dea3646, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.09", 0x080000, 0xc119a827, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamj.10", 0x080000, 0x46593b79, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vam.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vam.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vam.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vam.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vam.14m", 0x100000, 0xbd87243c, CPS2_GFX | BRF_GRA }, - { "vam.16m", 0x100000, 0xafec855f, CPS2_GFX | BRF_GRA }, - { "vam.18m", 0x100000, 0x3a033625, CPS2_GFX | BRF_GRA }, - { "vam.20m", 0x100000, 0x2bff6a89, CPS2_GFX | BRF_GRA }, - - { "vam.01", 0x020000, 0x64b685d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vam.02", 0x020000, 0xcf7c97c7, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vam.11m", 0x200000, 0x4a39deb2, CPS2_QSND | BRF_SND }, - { "vam.12m", 0x200000, 0x1a3e5c03, CPS2_QSND | BRF_SND }, - - { "vampj.key", 0x000014, 0x8418cc6f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vampjr1) -STD_ROM_FN(Vampjr1) - -static struct BurnRomInfo EcofghtrRomDesc[] = { - { "uece.03", 0x080000, 0xec2c1137, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uece.04", 0x080000, 0xb35f99db, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uece.05", 0x080000, 0xd9d42d31, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uece.06", 0x080000, 0x9d9771cf, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "uec.13m", 0x200000, 0xdcaf1436, CPS2_GFX | BRF_GRA }, - { "uec.15m", 0x200000, 0x2807df41, CPS2_GFX | BRF_GRA }, - { "uec.17m", 0x200000, 0x8a708d02, CPS2_GFX | BRF_GRA }, - { "uec.19m", 0x200000, 0xde7be0ef, CPS2_GFX | BRF_GRA }, - { "uec.14m", 0x100000, 0x1a003558, CPS2_GFX | BRF_GRA }, - { "uec.16m", 0x100000, 0x4ff8a6f9, CPS2_GFX | BRF_GRA }, - { "uec.18m", 0x100000, 0xb167ae12, CPS2_GFX | BRF_GRA }, - { "uec.20m", 0x100000, 0x1064bdc2, CPS2_GFX | BRF_GRA }, - - { "uec.01", 0x020000, 0xc235bd15, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "uec.11m", 0x200000, 0x81b25d39, CPS2_QSND | BRF_SND }, - { "uec.12m", 0x200000, 0x27729e52, CPS2_QSND | BRF_SND }, - - { "ecofghtr.key", 0x000014, 0x2250fd9e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ecofghtr) -STD_ROM_FN(Ecofghtr) - -static struct BurnRomInfo EcofghtraRomDesc[] = { - { "ueca.03", 0x080000, 0xbd4589b1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ueca.04", 0x080000, 0x1d134b7d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ueca.05", 0x080000, 0x9c581fc7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ueca.06", 0x080000, 0xc92a7c50, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "uec.13m", 0x200000, 0xdcaf1436, CPS2_GFX | BRF_GRA }, - { "uec.15m", 0x200000, 0x2807df41, CPS2_GFX | BRF_GRA }, - { "uec.17m", 0x200000, 0x8a708d02, CPS2_GFX | BRF_GRA }, - { "uec.19m", 0x200000, 0xde7be0ef, CPS2_GFX | BRF_GRA }, - { "uec.14m", 0x100000, 0x1a003558, CPS2_GFX | BRF_GRA }, - { "uec.16m", 0x100000, 0x4ff8a6f9, CPS2_GFX | BRF_GRA }, - { "uec.18m", 0x100000, 0xb167ae12, CPS2_GFX | BRF_GRA }, - { "uec.20m", 0x100000, 0x1064bdc2, CPS2_GFX | BRF_GRA }, - - { "uec.01", 0x020000, 0xc235bd15, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "uec.11m", 0x200000, 0x81b25d39, CPS2_QSND | BRF_SND }, - { "uec.12m", 0x200000, 0x27729e52, CPS2_QSND | BRF_SND }, - - { "ecofghtra.key", 0x000014, 0x4f99a9f5, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ecofghtra) -STD_ROM_FN(Ecofghtra) - -static struct BurnRomInfo EcofghtrhRomDesc[] = { - { "uech.03", 0x080000, 0x14c9365e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uech.04", 0x080000, 0x579495dc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uech.05", 0x080000, 0x96807a8e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uech.06", 0x080000, 0x682b9dbc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "uec.13m", 0x200000, 0xdcaf1436, CPS2_GFX | BRF_GRA }, - { "uec.15m", 0x200000, 0x2807df41, CPS2_GFX | BRF_GRA }, - { "uec.17m", 0x200000, 0x8a708d02, CPS2_GFX | BRF_GRA }, - { "uec.19m", 0x200000, 0xde7be0ef, CPS2_GFX | BRF_GRA }, - { "uec.14m", 0x100000, 0x1a003558, CPS2_GFX | BRF_GRA }, - { "uec.16m", 0x100000, 0x4ff8a6f9, CPS2_GFX | BRF_GRA }, - { "uec.18m", 0x100000, 0xb167ae12, CPS2_GFX | BRF_GRA }, - { "uec.20m", 0x100000, 0x1064bdc2, CPS2_GFX | BRF_GRA }, - - { "uec.01", 0x020000, 0xc235bd15, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "uec.11m", 0x200000, 0x81b25d39, CPS2_QSND | BRF_SND }, - { "uec.12m", 0x200000, 0x27729e52, CPS2_QSND | BRF_SND }, - - { "ecofghtrh.key", 0x000014, 0x9a9027c8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ecofghtrh) -STD_ROM_FN(Ecofghtrh) - -static struct BurnRomInfo EcofghtruRomDesc[] = { - { "uecu.03a", 0x080000, 0x22d88a4d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uecu.04a", 0x080000, 0x6436cfcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uecu.05a", 0x080000, 0x336f121b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uecu.06a", 0x080000, 0x6f99d984, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "uec.13m", 0x200000, 0xdcaf1436, CPS2_GFX | BRF_GRA }, - { "uec.15m", 0x200000, 0x2807df41, CPS2_GFX | BRF_GRA }, - { "uec.17m", 0x200000, 0x8a708d02, CPS2_GFX | BRF_GRA }, - { "uec.19m", 0x200000, 0xde7be0ef, CPS2_GFX | BRF_GRA }, - { "uec.14m", 0x100000, 0x1a003558, CPS2_GFX | BRF_GRA }, - { "uec.16m", 0x100000, 0x4ff8a6f9, CPS2_GFX | BRF_GRA }, - { "uec.18m", 0x100000, 0xb167ae12, CPS2_GFX | BRF_GRA }, - { "uec.20m", 0x100000, 0x1064bdc2, CPS2_GFX | BRF_GRA }, - - { "uec.01", 0x020000, 0xc235bd15, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "uec.11m", 0x200000, 0x81b25d39, CPS2_QSND | BRF_SND }, - { "uec.12m", 0x200000, 0x27729e52, CPS2_QSND | BRF_SND }, - - { "ecofghtru.key", 0x000014, 0x611aa137, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ecofghtru) -STD_ROM_FN(Ecofghtru) - -static struct BurnRomInfo Ecofghtru1RomDesc[] = { - { "uecu.03", 0x080000, 0x6792480c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uecu.04", 0x080000, 0x95ce69d5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uecu.05", 0x080000, 0x3a1e78ad, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uecu.06", 0x080000, 0xa3e2f3cc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "uec.13m", 0x200000, 0xdcaf1436, CPS2_GFX | BRF_GRA }, - { "uec.15m", 0x200000, 0x2807df41, CPS2_GFX | BRF_GRA }, - { "uec.17m", 0x200000, 0x8a708d02, CPS2_GFX | BRF_GRA }, - { "uec.19m", 0x200000, 0xde7be0ef, CPS2_GFX | BRF_GRA }, - { "uec.14m", 0x100000, 0x1a003558, CPS2_GFX | BRF_GRA }, - { "uec.16m", 0x100000, 0x4ff8a6f9, CPS2_GFX | BRF_GRA }, - { "uec.18m", 0x100000, 0xb167ae12, CPS2_GFX | BRF_GRA }, - { "uec.20m", 0x100000, 0x1064bdc2, CPS2_GFX | BRF_GRA }, - - { "uec.01", 0x020000, 0xc235bd15, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "uec.11m", 0x200000, 0x81b25d39, CPS2_QSND | BRF_SND }, - { "uec.12m", 0x200000, 0x27729e52, CPS2_QSND | BRF_SND }, - - { "ecofghtru.key", 0x000014, 0x611aa137, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ecofghtru1) -STD_ROM_FN(Ecofghtru1) - -static struct BurnRomInfo UecologyRomDesc[] = { - { "uecj.03", 0x080000, 0x94c40a4c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uecj.04", 0x080000, 0x8d6e3a09, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uecj.05", 0x080000, 0x8604ecd7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "uecj.06", 0x080000, 0xb7e1d31f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "uec.13m", 0x200000, 0xdcaf1436, CPS2_GFX | BRF_GRA }, - { "uec.15m", 0x200000, 0x2807df41, CPS2_GFX | BRF_GRA }, - { "uec.17m", 0x200000, 0x8a708d02, CPS2_GFX | BRF_GRA }, - { "uec.19m", 0x200000, 0xde7be0ef, CPS2_GFX | BRF_GRA }, - { "uec.14m", 0x100000, 0x1a003558, CPS2_GFX | BRF_GRA }, - { "uec.16m", 0x100000, 0x4ff8a6f9, CPS2_GFX | BRF_GRA }, - { "uec.18m", 0x100000, 0xb167ae12, CPS2_GFX | BRF_GRA }, - { "uec.20m", 0x100000, 0x1064bdc2, CPS2_GFX | BRF_GRA }, - - { "uec.01", 0x020000, 0xc235bd15, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "uec.11m", 0x200000, 0x81b25d39, CPS2_QSND | BRF_SND }, - { "uec.12m", 0x200000, 0x27729e52, CPS2_QSND | BRF_SND }, - - { "uecology.key", 0x000014, 0x0bab792d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Uecology) -STD_ROM_FN(Uecology) - -static struct BurnRomInfo GigawingRomDesc[] = { - { "ggwu.03", 0x080000, 0xac725eb2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwu.04", 0x080000, 0x392f4118, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggw.05", 0x080000, 0x3239d642, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ggw.13m", 0x400000, 0x105530a4, CPS2_GFX | BRF_GRA }, - { "ggw.15m", 0x400000, 0x9e774ab9, CPS2_GFX | BRF_GRA }, - { "ggw.17m", 0x400000, 0x466e0ba4, CPS2_GFX | BRF_GRA }, - { "ggw.19m", 0x400000, 0x840c8dea, CPS2_GFX | BRF_GRA }, - - { "ggw.01", 0x020000, 0x4c6351d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ggw.11m", 0x400000, 0xe172acf5, CPS2_QSND | BRF_SND }, - { "ggw.12m", 0x400000, 0x4bee4e8f, CPS2_QSND | BRF_SND }, - - { "gigawing.key", 0x000014, 0x5076c26b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Gigawing) -STD_ROM_FN(Gigawing) - -static struct BurnRomInfo GigawingaRomDesc[] = { - { "ggwa.03a", 0x080000, 0x116f8837, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwa.04a", 0x080000, 0xe6e3f0c4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwa.05a", 0x080000, 0x465e8ac9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ggw.13m", 0x400000, 0x105530a4, CPS2_GFX | BRF_GRA }, - { "ggw.15m", 0x400000, 0x9e774ab9, CPS2_GFX | BRF_GRA }, - { "ggw.17m", 0x400000, 0x466e0ba4, CPS2_GFX | BRF_GRA }, - { "ggw.19m", 0x400000, 0x840c8dea, CPS2_GFX | BRF_GRA }, - - { "ggw.01", 0x020000, 0x4c6351d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ggw.11m", 0x400000, 0xe172acf5, CPS2_QSND | BRF_SND }, - { "ggw.12m", 0x400000, 0x4bee4e8f, CPS2_QSND | BRF_SND }, - - { "gigawinga.key", 0x000014, 0x7401627e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Gigawinga) -STD_ROM_FN(Gigawinga) - -static struct BurnRomInfo GigawingbRomDesc[] = { - { "ggwb.03", 0x080000, 0xa1f8a448, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwb.04", 0x080000, 0x6a423e76, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggw.05", 0x080000, 0x3239d642, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ggw.13m", 0x400000, 0x105530a4, CPS2_GFX | BRF_GRA }, - { "ggw.15m", 0x400000, 0x9e774ab9, CPS2_GFX | BRF_GRA }, - { "ggw.17m", 0x400000, 0x466e0ba4, CPS2_GFX | BRF_GRA }, - { "ggw.19m", 0x400000, 0x840c8dea, CPS2_GFX | BRF_GRA }, - - { "ggw.01", 0x020000, 0x4c6351d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ggw.11m", 0x400000, 0xe172acf5, CPS2_QSND | BRF_SND }, - { "ggw.12m", 0x400000, 0x4bee4e8f, CPS2_QSND | BRF_SND }, - - { "gigawingb.key", 0x000014, 0x5e7805fa, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Gigawingb) -STD_ROM_FN(Gigawingb) - -static struct BurnRomInfo GigawinghRomDesc[] = { - { "ggwh.03a", 0x080000, 0xb9ee36eb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwh.04a", 0x080000, 0x72e548fe, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggw.05", 0x080000, 0x3239d642, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ggw.13m", 0x400000, 0x105530a4, CPS2_GFX | BRF_GRA }, - { "ggw.15m", 0x400000, 0x9e774ab9, CPS2_GFX | BRF_GRA }, - { "ggw.17m", 0x400000, 0x466e0ba4, CPS2_GFX | BRF_GRA }, - { "ggw.19m", 0x400000, 0x840c8dea, CPS2_GFX | BRF_GRA }, - - { "ggw.01", 0x020000, 0x4c6351d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ggw.11m", 0x400000, 0xe172acf5, CPS2_QSND | BRF_SND }, - { "ggw.12m", 0x400000, 0x4bee4e8f, CPS2_QSND | BRF_SND }, - - { "gigawingh.key", 0x000014, 0x43198223, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Gigawingh) -STD_ROM_FN(Gigawingh) - -static struct BurnRomInfo GigawingjRomDesc[] = { - { "ggwj.03a", 0x080000, 0xfdd23b91, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwj.04a", 0x080000, 0x8c6e093c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwj.05a", 0x080000, 0x43811454, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ggw.13m", 0x400000, 0x105530a4, CPS2_GFX | BRF_GRA }, - { "ggw.15m", 0x400000, 0x9e774ab9, CPS2_GFX | BRF_GRA }, - { "ggw.17m", 0x400000, 0x466e0ba4, CPS2_GFX | BRF_GRA }, - { "ggw.19m", 0x400000, 0x840c8dea, CPS2_GFX | BRF_GRA }, - - { "ggw.01", 0x020000, 0x4c6351d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ggw.11m", 0x400000, 0xe172acf5, CPS2_QSND | BRF_SND }, - { "ggw.12m", 0x400000, 0x4bee4e8f, CPS2_QSND | BRF_SND }, - - { "gigawingj.key", 0x000014, 0x8121a25e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Gigawingj) -STD_ROM_FN(Gigawingj) - -static struct BurnRomInfo Hsf2RomDesc[] = { - { "hs2u.03", 0x080000, 0xb308151e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2u.04", 0x080000, 0x327aa49c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.05", 0x080000, 0xdde34a35, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.06", 0x080000, 0xf4e56dda, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.07", 0x080000, 0xee4420fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.08", 0x080000, 0xc9441533, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.09", 0x080000, 0x3fc638a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.10", 0x080000, 0x20d0f9e4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "hs2.13m", 0x800000, 0xa6ecab17, CPS2_GFX | BRF_GRA }, - { "hs2.15m", 0x800000, 0x10a0ae4d, CPS2_GFX | BRF_GRA }, - { "hs2.17m", 0x800000, 0xadfa7726, CPS2_GFX | BRF_GRA }, - { "hs2.19m", 0x800000, 0xbb3ae322, CPS2_GFX | BRF_GRA }, - - { "hs2.01", 0x020000, 0xc1a13786, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "hs2.02", 0x020000, 0x2d8794aa, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "hs2.11m", 0x800000, 0x0e15c359, CPS2_QSND | BRF_SND }, - - { "hsf2.key", 0x000014, 0xfc9b18c9, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Hsf2) -STD_ROM_FN(Hsf2) - -static struct BurnRomInfo Hsf2aRomDesc[] = { - { "hs2a.03", 0x080000, 0xd50a17e0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2a.04", 0x080000, 0xa27f42de, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.05", 0x080000, 0xdde34a35, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.06", 0x080000, 0xf4e56dda, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.07", 0x080000, 0xee4420fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.08", 0x080000, 0xc9441533, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.09", 0x080000, 0x3fc638a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.10", 0x080000, 0x20d0f9e4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "hs2.13m", 0x800000, 0xa6ecab17, CPS2_GFX | BRF_GRA }, - { "hs2.15m", 0x800000, 0x10a0ae4d, CPS2_GFX | BRF_GRA }, - { "hs2.17m", 0x800000, 0xadfa7726, CPS2_GFX | BRF_GRA }, - { "hs2.19m", 0x800000, 0xbb3ae322, CPS2_GFX | BRF_GRA }, - - { "hs2.01", 0x020000, 0xc1a13786, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "hs2.02", 0x020000, 0x2d8794aa, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "hs2.11m", 0x800000, 0x0e15c359, CPS2_QSND | BRF_SND }, - - { "hsf2a.key", 0x000014, 0x2cd9eb99, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Hsf2a) -STD_ROM_FN(Hsf2a) - -static struct BurnRomInfo Hsf2jRomDesc[] = { - { "hs2j.03c", 0x080000, 0x6efe661f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2j.04b", 0x080000, 0x93f2500a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2j.05", 0x080000, 0xdde34a35, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2j.06", 0x080000, 0xf4e56dda, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2j.07", 0x080000, 0xee4420fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2j.08", 0x080000, 0xc9441533, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2j.09", 0x080000, 0x3fc638a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2j.10", 0x080000, 0x20d0f9e4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "hs2.13m" , 0x800000, 0xa6ecab17, CPS2_GFX | BRF_GRA }, - { "hs2.15m", 0x800000, 0x10a0ae4d, CPS2_GFX | BRF_GRA }, - { "hs2.17m", 0x800000, 0xadfa7726, CPS2_GFX | BRF_GRA }, - { "hs2.19m", 0x800000, 0xbb3ae322, CPS2_GFX | BRF_GRA }, - - { "hs2.01", 0x020000, 0xc1a13786, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "hs2.02", 0x020000, 0x2d8794aa, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "hs2.11m", 0x800000, 0x0e15c359, CPS2_QSND | BRF_SND }, - - { "hsf2j.key", 0x000014, 0x19455a93, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Hsf2j) -STD_ROM_FN(Hsf2j) - -static struct BurnRomInfo Hsf2j1RomDesc[] = { - { "hs2j.03", 0x080000, 0x00738f73, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2j.04", 0x080000, 0x40072c4a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.05", 0x080000, 0xdde34a35, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.06", 0x080000, 0xf4e56dda, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.07", 0x080000, 0xee4420fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.08", 0x080000, 0xc9441533, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.09", 0x080000, 0x3fc638a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.10", 0x080000, 0x20d0f9e4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "hs2.13m" , 0x800000, 0xa6ecab17, CPS2_GFX | BRF_GRA }, - { "hs2.15m", 0x800000, 0x10a0ae4d, CPS2_GFX | BRF_GRA }, - { "hs2.17m", 0x800000, 0xadfa7726, CPS2_GFX | BRF_GRA }, - { "hs2.19m", 0x800000, 0xbb3ae322, CPS2_GFX | BRF_GRA }, - - { "hs2.01", 0x020000, 0xc1a13786, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "hs2.02", 0x020000, 0x2d8794aa, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "hs2.11m", 0x800000, 0x0e15c359, CPS2_QSND | BRF_SND }, - - { "hsf2j.key", 0x000014, 0x19455a93, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Hsf2j1) -STD_ROM_FN(Hsf2j1) - -static struct BurnRomInfo JyangokuRomDesc[] = { - { "majj.03", 0x080000, 0x4614a3b2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "maj1_d.simm1", 0x200000, 0xba0fe27b, CPS2_GFX_SIMM | BRF_GRA }, - { "maj1_c.simm1", 0x200000, 0x2cd141bf, CPS2_GFX_SIMM | BRF_GRA }, - { "maj1_b.simm1", 0x200000, 0xe29e4c26, CPS2_GFX_SIMM | BRF_GRA }, - { "maj1_a.simm1", 0x200000, 0x7f68b88a, CPS2_GFX_SIMM | BRF_GRA }, - { "maj3_d.simm3", 0x200000, 0x3aaeb90b, CPS2_GFX_SIMM | BRF_GRA }, - { "maj3_c.simm3", 0x200000, 0x97894cea, CPS2_GFX_SIMM | BRF_GRA }, - { "maj3_b.simm3", 0x200000, 0xec737d9d, CPS2_GFX_SIMM | BRF_GRA }, - { "maj3_a.simm3", 0x200000, 0xc23b6f22, CPS2_GFX_SIMM | BRF_GRA }, - - { "maj.01", 0x020000, 0x1fe8c213, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "maj5_a.simm5", 0x200000, 0x5ad9ee53, CPS2_QSND_SIMM_BYTESWAP | BRF_SND }, - { "maj5_b.simm5", 0x200000, 0xefb3dbfb, CPS2_QSND_SIMM_BYTESWAP | BRF_SND }, - - { "jyangoku.key", 0x000014, 0x95b0a560, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Jyangoku) -STD_ROM_FN(Jyangoku) - -static struct BurnRomInfo Megaman2RomDesc[] = { - { "rm2u.03", 0x080000, 0x8ffc2cd1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2u.04", 0x080000, 0xbb30083a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2.05", 0x080000, 0x02ee9efc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "rm2.14m", 0x200000, 0x9b1f00b4, CPS2_GFX | BRF_GRA }, - { "rm2.16m", 0x200000, 0xc2bb0c24, CPS2_GFX | BRF_GRA }, - { "rm2.18m", 0x200000, 0x12257251, CPS2_GFX | BRF_GRA }, - { "rm2.20m", 0x200000, 0xf9b6e786, CPS2_GFX | BRF_GRA }, - - { "rm2.01a", 0x020000, 0xd18e7859, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "rm2.02", 0x020000, 0xc463ece0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "rm2.11m", 0x200000, 0x2106174d, CPS2_QSND | BRF_SND }, - { "rm2.12m", 0x200000, 0x546c1636, CPS2_QSND | BRF_SND }, - - { "megaman2.key", 0x000014, 0x6828ed6d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Megaman2) -STD_ROM_FN(Megaman2) - -static struct BurnRomInfo Megaman2aRomDesc[] = { - { "rm2a.03", 0x080000, 0x2b330ca7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2a.04", 0x080000, 0x8b47942b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2.05", 0x080000, 0x02ee9efc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "rm2.14m", 0x200000, 0x9b1f00b4, CPS2_GFX | BRF_GRA }, - { "rm2.16m", 0x200000, 0xc2bb0c24, CPS2_GFX | BRF_GRA }, - { "rm2.18m", 0x200000, 0x12257251, CPS2_GFX | BRF_GRA }, - { "rm2.20m", 0x200000, 0xf9b6e786, CPS2_GFX | BRF_GRA }, - - { "rm2.01a", 0x020000, 0xd18e7859, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "rm2.02", 0x020000, 0xc463ece0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "rm2.11m", 0x200000, 0x2106174d, CPS2_QSND | BRF_SND }, - { "rm2.12m", 0x200000, 0x546c1636, CPS2_QSND | BRF_SND }, - - { "megaman2a.key", 0x000014, 0xd6e8dcd7, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Megaman2a) -STD_ROM_FN(Megaman2a) - -static struct BurnRomInfo Megaman2hRomDesc[] = { - { "rm2h.03", 0x080000, 0xbb180378, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2h.04", 0x080000, 0x205ffcd6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2.05", 0x080000, 0x02ee9efc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "rm2.14m", 0x200000, 0x9b1f00b4, CPS2_GFX | BRF_GRA }, - { "rm2.16m", 0x200000, 0xc2bb0c24, CPS2_GFX | BRF_GRA }, - { "rm2.18m", 0x200000, 0x12257251, CPS2_GFX | BRF_GRA }, - { "rm2.20m", 0x200000, 0xf9b6e786, CPS2_GFX | BRF_GRA }, - - { "rm2.01a", 0x020000, 0xd18e7859, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "rm2.02", 0x020000, 0xc463ece0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "rm2.11m", 0x200000, 0x2106174d, CPS2_QSND | BRF_SND }, - { "rm2.12m", 0x200000, 0x546c1636, CPS2_QSND | BRF_SND }, - - { "megaman2h.key", 0x000014, 0x99cb8d19, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Megaman2h) -STD_ROM_FN(Megaman2h) - -static struct BurnRomInfo Rockman2jRomDesc[] = { - { "rm2j.03", 0x080000, 0xdbaa1437, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2j.04", 0x080000, 0xcf5ba612, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2.05", 0x080000, 0x02ee9efc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "rm2.14m", 0x200000, 0x9b1f00b4, CPS2_GFX | BRF_GRA }, - { "rm2.16m", 0x200000, 0xc2bb0c24, CPS2_GFX | BRF_GRA }, - { "rm2.18m", 0x200000, 0x12257251, CPS2_GFX | BRF_GRA }, - { "rm2.20m", 0x200000, 0xf9b6e786, CPS2_GFX | BRF_GRA }, - - { "rm2.01a", 0x020000, 0xd18e7859, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "rm2.02", 0x020000, 0xc463ece0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "rm2.11m", 0x200000, 0x2106174d, CPS2_QSND | BRF_SND }, - { "rm2.12m", 0x200000, 0x546c1636, CPS2_QSND | BRF_SND }, - - { "rockman2j.key", 0x000014, 0xc590187a, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Rockman2j) -STD_ROM_FN(Rockman2j) - -static struct BurnRomInfo Mmancp2uRomDesc[] = { - { "rcmu.03b", 0x080000, 0xc39f037f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rcmu.04b", 0x080000, 0xcd6f5e99, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rcm.05b", 0x080000, 0x4376ea95, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "rcm.73", 0x080000, 0x774c6e04, CPS2_GFX | BRF_GRA }, - { "rcm.63", 0x080000, 0xacad7c62, CPS2_GFX | BRF_GRA }, - { "rcm.83", 0x080000, 0x6af30499, CPS2_GFX | BRF_GRA }, - { "rcm.93", 0x080000, 0x7a5a5166, CPS2_GFX | BRF_GRA }, - { "rcm.74", 0x080000, 0x004ec725, CPS2_GFX | BRF_GRA }, - { "rcm.64", 0x080000, 0x65c0464e, CPS2_GFX | BRF_GRA }, - { "rcm.84", 0x080000, 0xfb3097cc, CPS2_GFX | BRF_GRA }, - { "rcm.94", 0x080000, 0x2e16557a, CPS2_GFX | BRF_GRA }, - { "rcm.75", 0x080000, 0x70a73f99, CPS2_GFX | BRF_GRA }, - { "rcm.65", 0x080000, 0xecedad3d, CPS2_GFX | BRF_GRA }, - { "rcm.85", 0x080000, 0x3d6186d8, CPS2_GFX | BRF_GRA }, - { "rcm.95", 0x080000, 0x8c7700f1, CPS2_GFX | BRF_GRA }, - { "rcm.76", 0x080000, 0x89a889ad, CPS2_GFX | BRF_GRA }, - { "rcm.66", 0x080000, 0x1300eb7b, CPS2_GFX | BRF_GRA }, - { "rcm.86", 0x080000, 0x6d974ebd, CPS2_GFX | BRF_GRA }, - { "rcm.96", 0x080000, 0x7da4cd24, CPS2_GFX | BRF_GRA }, - - { "rcm.01", 0x020000, 0xd60cf8a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "rcm.51", 0x080000, 0xb6d07080, CPS2_QSND | BRF_SND }, - { "rcm.52", 0x080000, 0xdfddc493, CPS2_QSND | BRF_SND }, - { "rcm.53", 0x080000, 0x6062ae3a, CPS2_QSND | BRF_SND }, - { "rcm.54", 0x080000, 0x08c6f3bf, CPS2_QSND | BRF_SND }, - { "rcm.55", 0x080000, 0xf97dfccc, CPS2_QSND | BRF_SND }, - { "rcm.56", 0x080000, 0xade475bc, CPS2_QSND | BRF_SND }, - { "rcm.57", 0x080000, 0x075effb3, CPS2_QSND | BRF_SND }, - { "rcm.58", 0x080000, 0xf6c1f87b, CPS2_QSND | BRF_SND }, - - { "mmancp2u.key", 0x000014, 0x17ca6659, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mmancp2u) -STD_ROM_FN(Mmancp2u) - -static struct BurnRomInfo Mmancp2ur1RomDesc[] = { - { "rcmu.03a", 0x080000, 0xc6b75320, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rcmu.04a", 0x080000, 0x47880111, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rcmu.05a", 0x080000, 0x4376ea95, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "rcm.73", 0x080000, 0x774c6e04, CPS2_GFX | BRF_GRA }, - { "rcm.63", 0x080000, 0xacad7c62, CPS2_GFX | BRF_GRA }, - { "rcm.83", 0x080000, 0x6af30499, CPS2_GFX | BRF_GRA }, - { "rcm.93", 0x080000, 0x7a5a5166, CPS2_GFX | BRF_GRA }, - { "rcm.74", 0x080000, 0x004ec725, CPS2_GFX | BRF_GRA }, - { "rcm.64", 0x080000, 0x65c0464e, CPS2_GFX | BRF_GRA }, - { "rcm.84", 0x080000, 0xfb3097cc, CPS2_GFX | BRF_GRA }, - { "rcm.94", 0x080000, 0x2e16557a, CPS2_GFX | BRF_GRA }, - { "rcm.75", 0x080000, 0x70a73f99, CPS2_GFX | BRF_GRA }, - { "rcm.65", 0x080000, 0xecedad3d, CPS2_GFX | BRF_GRA }, - { "rcm.85", 0x080000, 0x3d6186d8, CPS2_GFX | BRF_GRA }, - { "rcm.95", 0x080000, 0x8c7700f1, CPS2_GFX | BRF_GRA }, - { "rcm.76", 0x080000, 0x89a889ad, CPS2_GFX | BRF_GRA }, - { "rcm.66", 0x080000, 0x1300eb7b, CPS2_GFX | BRF_GRA }, - { "rcm.86", 0x080000, 0x6d974ebd, CPS2_GFX | BRF_GRA }, - { "rcm.96", 0x080000, 0x7da4cd24, CPS2_GFX | BRF_GRA }, - - { "rcm.01", 0x020000, 0xd60cf8a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "rcm.51", 0x080000, 0xb6d07080, CPS2_QSND | BRF_SND }, - { "rcm.52", 0x080000, 0xdfddc493, CPS2_QSND | BRF_SND }, - { "rcm.53", 0x080000, 0x6062ae3a, CPS2_QSND | BRF_SND }, - { "rcm.54", 0x080000, 0x08c6f3bf, CPS2_QSND | BRF_SND }, - { "rcm.55", 0x080000, 0xf97dfccc, CPS2_QSND | BRF_SND }, - { "rcm.56", 0x080000, 0xade475bc, CPS2_QSND | BRF_SND }, - { "rcm.57", 0x080000, 0x075effb3, CPS2_QSND | BRF_SND }, - { "rcm.58", 0x080000, 0xf6c1f87b, CPS2_QSND | BRF_SND }, - - { "mmancp2u.key", 0x000014, 0x17ca6659, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mmancp2ur1) -STD_ROM_FN(Mmancp2ur1) - -static struct BurnRomInfo Rmancp2jRomDesc[] = { - { "rcmj.03a", 0x080000, 0x30559f60, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rcmj.04a", 0x080000, 0x5efc9366, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rcm.05a", 0x080000, 0x517ccde2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "rcm.73", 0x080000, 0x774c6e04, CPS2_GFX | BRF_GRA }, - { "rcm.63", 0x080000, 0xacad7c62, CPS2_GFX | BRF_GRA }, - { "rcm.83", 0x080000, 0x6af30499, CPS2_GFX | BRF_GRA }, - { "rcm.93", 0x080000, 0x7a5a5166, CPS2_GFX | BRF_GRA }, - { "rcm.74", 0x080000, 0x004ec725, CPS2_GFX | BRF_GRA }, - { "rcm.64", 0x080000, 0x65c0464e, CPS2_GFX | BRF_GRA }, - { "rcm.84", 0x080000, 0xfb3097cc, CPS2_GFX | BRF_GRA }, - { "rcm.94", 0x080000, 0x2e16557a, CPS2_GFX | BRF_GRA }, - { "rcm.75", 0x080000, 0x70a73f99, CPS2_GFX | BRF_GRA }, - { "rcm.65", 0x080000, 0xecedad3d, CPS2_GFX | BRF_GRA }, - { "rcm.85", 0x080000, 0x3d6186d8, CPS2_GFX | BRF_GRA }, - { "rcm.95", 0x080000, 0x8c7700f1, CPS2_GFX | BRF_GRA }, - { "rcm.76", 0x080000, 0x89a889ad, CPS2_GFX | BRF_GRA }, - { "rcm.66", 0x080000, 0x1300eb7b, CPS2_GFX | BRF_GRA }, - { "rcm.86", 0x080000, 0x6d974ebd, CPS2_GFX | BRF_GRA }, - { "rcm.96", 0x080000, 0x7da4cd24, CPS2_GFX | BRF_GRA }, - - { "rcm.01", 0x020000, 0xd60cf8a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "rcm.51", 0x080000, 0xb6d07080, CPS2_QSND | BRF_SND }, - { "rcm.52", 0x080000, 0xdfddc493, CPS2_QSND | BRF_SND }, - { "rcm.53", 0x080000, 0x6062ae3a, CPS2_QSND | BRF_SND }, - { "rcm.54", 0x080000, 0x08c6f3bf, CPS2_QSND | BRF_SND }, - { "rcm.55", 0x080000, 0xf97dfccc, CPS2_QSND | BRF_SND }, - { "rcm.56", 0x080000, 0xade475bc, CPS2_QSND | BRF_SND }, - { "rcm.57", 0x080000, 0x075effb3, CPS2_QSND | BRF_SND }, - { "rcm.58", 0x080000, 0xf6c1f87b, CPS2_QSND | BRF_SND }, - - { "rmancp2j.key", 0x000014, 0x17309a70, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Rmancp2j) -STD_ROM_FN(Rmancp2j) - -static struct BurnRomInfo MmatrixRomDesc[] = { - { "mmxu.03", 0x080000, 0xAB65b599, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mmxu.04", 0x080000, 0x0135FC6C, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mmxu.05", 0x080000, 0xF1FD2B84, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mmx.13m", 0x400000, 0x04748718, CPS2_GFX | BRF_GRA }, - { "mmx.15m", 0x400000, 0x38074F44, CPS2_GFX | BRF_GRA }, - { "mmx.17m", 0x400000, 0xE4635E35, CPS2_GFX | BRF_GRA }, - { "mmx.19m", 0x400000, 0x4400A3F2, CPS2_GFX | BRF_GRA }, - { "mmx.14m", 0x400000, 0xD52BF491, CPS2_GFX | BRF_GRA }, - { "mmx.16m", 0x400000, 0x23F70780, CPS2_GFX | BRF_GRA }, - { "mmx.18m", 0x400000, 0x2562C9D5, CPS2_GFX | BRF_GRA }, - { "mmx.20m", 0x400000, 0x583A9687, CPS2_GFX | BRF_GRA }, - - { "mmx.01", 0x020000, 0xC57E8171, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mmx.11m", 0x400000, 0x4180B39F, CPS2_QSND | BRF_SND }, - { "mmx.12m", 0x400000, 0x95E22A59, CPS2_QSND | BRF_SND }, - - { "mmatrix.key", 0x000014, 0x8ed66bc4, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mmatrix) -STD_ROM_FN(Mmatrix) - -static struct BurnRomInfo MmatrixjRomDesc[] = { - { "mmxj.03", 0x080000, 0x1D5DE213, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mmxj.04", 0x080000, 0xD943A339, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mmxj.05", 0x080000, 0x0C8B4ABB, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mmx.13m", 0x400000, 0x04748718, CPS2_GFX | BRF_GRA }, - { "mmx.15m", 0x400000, 0x38074F44, CPS2_GFX | BRF_GRA }, - { "mmx.17m", 0x400000, 0xE4635E35, CPS2_GFX | BRF_GRA }, - { "mmx.19m", 0x400000, 0x4400A3F2, CPS2_GFX | BRF_GRA }, - { "mmx.14m", 0x400000, 0xD52BF491, CPS2_GFX | BRF_GRA }, - { "mmx.16m", 0x400000, 0x23F70780, CPS2_GFX | BRF_GRA }, - { "mmx.18m", 0x400000, 0x2562C9D5, CPS2_GFX | BRF_GRA }, - { "mmx.20m", 0x400000, 0x583A9687, CPS2_GFX | BRF_GRA }, - - { "mmx.01", 0x020000, 0xC57E8171, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mmx.11m", 0x400000, 0x4180B39F, CPS2_QSND | BRF_SND }, - { "mmx.12m", 0x400000, 0x95E22A59, CPS2_QSND | BRF_SND }, - - { "mmatrixj.key", 0x000014, 0x3b50d889, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mmatrixj) -STD_ROM_FN(Mmatrixj) - -static struct BurnRomInfo MpangRomDesc[] = { - { "mpne.03c", 0x080000, 0xfe16fc9f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mpne.04c", 0x080000, 0x2cc5ec22, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mpn-simm.01c", 0x200000, 0x388DB66B, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01d", 0x200000, 0xAFF1B494, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01a", 0x200000, 0xA9C4857B, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01b", 0x200000, 0xF759DF22, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03c", 0x200000, 0xDEC6B720, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03d", 0x200000, 0xF8774C18, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03a", 0x200000, 0xC2AEA4EC, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03b", 0x200000, 0x84D6DC33, CPS2_GFX_SIMM | BRF_GRA }, - - { "mpn.01", 0x020000, 0x90C7ADB6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mpn-simm.05a", 0x200000, 0x318A2E21, CPS2_QSND_SIMM | BRF_SND }, - { "mpn-simm.05b", 0x200000, 0x5462F4E8, CPS2_QSND_SIMM | BRF_SND }, - - { "mpang.key", 0x000014, 0x95354b0f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mpang) -STD_ROM_FN(Mpang) - -static struct BurnRomInfo Mpangr1RomDesc[] = { - { "mpne.03b", 0x080000, 0x6ef0f9b2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mpne.04b", 0x080000, 0x30a468bb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mpn-simm.01c", 0x200000, 0x388DB66B, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01d", 0x200000, 0xAFF1B494, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01a", 0x200000, 0xA9C4857B, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01b", 0x200000, 0xF759DF22, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03c", 0x200000, 0xDEC6B720, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03d", 0x200000, 0xF8774C18, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03a", 0x200000, 0xC2AEA4EC, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03b", 0x200000, 0x84D6DC33, CPS2_GFX_SIMM | BRF_GRA }, - - { "mpn.01", 0x020000, 0x90C7ADB6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mpn-simm.05a", 0x200000, 0x318A2E21, CPS2_QSND_SIMM | BRF_SND }, - { "mpn-simm.05b", 0x200000, 0x5462F4E8, CPS2_QSND_SIMM | BRF_SND }, - - { "mpang.key", 0x000014, 0x95354b0f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mpangr1) -STD_ROM_FN(Mpangr1) - -static struct BurnRomInfo MpanguRomDesc[] = { - { "mpnu.03", 0x080000, 0x6e7ed03c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mpnu.04", 0x080000, 0xde079131, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mpn.13m", 0x200000, 0xc5f123dc, CPS2_GFX | BRF_GRA }, - { "mpn.15m", 0x200000, 0x8e033265, CPS2_GFX | BRF_GRA }, - { "mpn.17m", 0x200000, 0xcfcd73d2, CPS2_GFX | BRF_GRA }, - { "mpn.19m", 0x200000, 0x2db1ffbc, CPS2_GFX | BRF_GRA }, - - { "mpn.01", 0x020000, 0x90C7ADB6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mpn.q1", 0x100000, 0xd21c1f5a, CPS2_QSND | BRF_SND }, - { "mpn.q2", 0x100000, 0xd22090b1, CPS2_QSND | BRF_SND }, - { "mpn.q3", 0x100000, 0x60aa5ef2, CPS2_QSND | BRF_SND }, - { "mpn.q4", 0x100000, 0x3a67d203, CPS2_QSND | BRF_SND }, - - { "mpang.key", 0x000014, 0x95354b0f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mpangu) -STD_ROM_FN(Mpangu) - -static struct BurnRomInfo MpangjRomDesc[] = { - { "mpnj.03a", 0x080000, 0xBF597b1C, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mpnj.04a", 0x080000, 0xF4A3AB0F, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mpn-simm.01c", 0x200000, 0x388DB66B, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01d", 0x200000, 0xAFF1B494, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01a", 0x200000, 0xA9C4857B, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01b", 0x200000, 0xF759DF22, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03c", 0x200000, 0xDEC6B720, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03d", 0x200000, 0xF8774C18, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03a", 0x200000, 0xC2AEA4EC, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03b", 0x200000, 0x84D6DC33, CPS2_GFX_SIMM | BRF_GRA }, - - { "mpn.01", 0x020000, 0x90C7ADB6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mpn-simm.05a", 0x200000, 0x318A2E21, CPS2_QSND_SIMM | BRF_SND }, - { "mpn-simm.05b", 0x200000, 0x5462F4E8, CPS2_QSND_SIMM | BRF_SND }, - - { "mpang.key", 0x000014, 0x95354b0f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mpangj) -STD_ROM_FN(Mpangj) - -static struct BurnRomInfo MshRomDesc[] = { - { "mshe.03e", 0x080000, 0xbd951414, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mshe.04e", 0x080000, 0x19dd42f2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.05", 0x080000, 0x6a091b9e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.06b", 0x080000, 0x803e3fa4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.07a", 0x080000, 0xc45f8e27, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.08a", 0x080000, 0x9ca6f12c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.09a", 0x080000, 0x82ec27af, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.10b", 0x080000, 0x8d931196, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "msh.13m", 0x400000, 0x09d14566, CPS2_GFX | BRF_GRA }, - { "msh.15m", 0x400000, 0xee962057, CPS2_GFX | BRF_GRA }, - { "msh.17m", 0x400000, 0x604ece14, CPS2_GFX | BRF_GRA }, - { "msh.19m", 0x400000, 0x94a731e8, CPS2_GFX | BRF_GRA }, - { "msh.14m", 0x400000, 0x4197973e, CPS2_GFX | BRF_GRA }, - { "msh.16m", 0x400000, 0x438da4a0, CPS2_GFX | BRF_GRA }, - { "msh.18m", 0x400000, 0x4db92d94, CPS2_GFX | BRF_GRA }, - { "msh.20m", 0x400000, 0xa2b0c6c0, CPS2_GFX | BRF_GRA }, - - { "msh.01", 0x020000, 0xc976e6f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "msh.02", 0x020000, 0xce67d0d9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "msh.11m", 0x200000, 0x37ac6d30, CPS2_QSND | BRF_SND }, - { "msh.12m", 0x200000, 0xde092570, CPS2_QSND | BRF_SND }, - - { "msh.key", 0x000014, 0xb494368e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Msh) -STD_ROM_FN(Msh) - -static struct BurnRomInfo MshaRomDesc[] = { - { "msha.03e", 0x080000, 0xec84ec44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msha.04e", 0x080000, 0x098b8503, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.05", 0x080000, 0x6a091b9e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.06b", 0x080000, 0x803e3fa4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.07a", 0x080000, 0xc45f8e27, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.08a", 0x080000, 0x9ca6f12c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.09a", 0x080000, 0x82ec27af, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.10b", 0x080000, 0x8d931196, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "msh.13m", 0x400000, 0x09d14566, CPS2_GFX | BRF_GRA }, - { "msh.15m", 0x400000, 0xee962057, CPS2_GFX | BRF_GRA }, - { "msh.17m", 0x400000, 0x604ece14, CPS2_GFX | BRF_GRA }, - { "msh.19m", 0x400000, 0x94a731e8, CPS2_GFX | BRF_GRA }, - { "msh.14m", 0x400000, 0x4197973e, CPS2_GFX | BRF_GRA }, - { "msh.16m", 0x400000, 0x438da4a0, CPS2_GFX | BRF_GRA }, - { "msh.18m", 0x400000, 0x4db92d94, CPS2_GFX | BRF_GRA }, - { "msh.20m", 0x400000, 0xa2b0c6c0, CPS2_GFX | BRF_GRA }, - - { "msh.01", 0x020000, 0xc976e6f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "msh.02", 0x020000, 0xce67d0d9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "msh.11m", 0x200000, 0x37ac6d30, CPS2_QSND | BRF_SND }, - { "msh.12m", 0x200000, 0xde092570, CPS2_QSND | BRF_SND }, - - { "msha.key", 0x000014, 0x00f3f2ca, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Msha) -STD_ROM_FN(Msha) - -static struct BurnRomInfo MshbRomDesc[] = { - { "mshb.03c", 0x080000, 0x19697f74, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mshb.04c", 0x080000, 0x95317a6f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.05a", 0x080000, 0xf37539e6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.06b", 0x080000, 0x803e3fa4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.07a", 0x080000, 0xc45f8e27, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.08a", 0x080000, 0x9ca6f12c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.09a", 0x080000, 0x82ec27af, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.10b", 0x080000, 0x8d931196, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "msh.13m", 0x400000, 0x09d14566, CPS2_GFX | BRF_GRA }, - { "msh.15m", 0x400000, 0xee962057, CPS2_GFX | BRF_GRA }, - { "msh.17m", 0x400000, 0x604ece14, CPS2_GFX | BRF_GRA }, - { "msh.19m", 0x400000, 0x94a731e8, CPS2_GFX | BRF_GRA }, - { "msh.14m", 0x400000, 0x4197973e, CPS2_GFX | BRF_GRA }, - { "msh.16m", 0x400000, 0x438da4a0, CPS2_GFX | BRF_GRA }, - { "msh.18m", 0x400000, 0x4db92d94, CPS2_GFX | BRF_GRA }, - { "msh.20m", 0x400000, 0xa2b0c6c0, CPS2_GFX | BRF_GRA }, - - - { "msh.01", 0x020000, 0xc976e6f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "msh.02", 0x020000, 0xce67d0d9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "msh.11m", 0x200000, 0x37ac6d30, CPS2_QSND | BRF_SND }, - { "msh.12m", 0x200000, 0xde092570, CPS2_QSND | BRF_SND }, - - { "mshb.key", 0x000014, 0x92196837, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshb) -STD_ROM_FN(Mshb) - -static struct BurnRomInfo MshhRomDesc[] = { - { "mshh.03c", 0x080000, 0x8d84b0fa, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mshh.04c", 0x080000, 0xd638f601, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.05a", 0x080000, 0xf37539e6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.06b", 0x080000, 0x803e3fa4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.07a", 0x080000, 0xc45f8e27, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.08a", 0x080000, 0x9ca6f12c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.09a", 0x080000, 0x82ec27af, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.10b", 0x080000, 0x8d931196, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "msh.13m", 0x400000, 0x09d14566, CPS2_GFX | BRF_GRA }, - { "msh.15m", 0x400000, 0xee962057, CPS2_GFX | BRF_GRA }, - { "msh.17m", 0x400000, 0x604ece14, CPS2_GFX | BRF_GRA }, - { "msh.19m", 0x400000, 0x94a731e8, CPS2_GFX | BRF_GRA }, - { "msh.14m", 0x400000, 0x4197973e, CPS2_GFX | BRF_GRA }, - { "msh.16m", 0x400000, 0x438da4a0, CPS2_GFX | BRF_GRA }, - { "msh.18m", 0x400000, 0x4db92d94, CPS2_GFX | BRF_GRA }, - { "msh.20m", 0x400000, 0xa2b0c6c0, CPS2_GFX | BRF_GRA }, - - { "msh.01", 0x020000, 0xc976e6f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "msh.02", 0x020000, 0xce67d0d9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "msh.11m", 0x200000, 0x37ac6d30, CPS2_QSND | BRF_SND }, - { "msh.12m", 0x200000, 0xde092570, CPS2_QSND | BRF_SND }, - - { "mshh.key", 0x000014, 0x5dddf5e7, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshh) -STD_ROM_FN(Mshh) - -static struct BurnRomInfo MshjRomDesc[] = { - { "mshj.03g", 0x080000, 0x261f4091, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mshj.04g", 0x080000, 0x61d791c6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.05a", 0x080000, 0xf37539e6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.06b", 0x080000, 0x803e3fa4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.07a", 0x080000, 0xc45f8e27, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.08a", 0x080000, 0x9ca6f12c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.09a", 0x080000, 0x82ec27af, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.10b", 0x080000, 0x8d931196, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "msh.13m", 0x400000, 0x09d14566, CPS2_GFX | BRF_GRA }, - { "msh.15m", 0x400000, 0xee962057, CPS2_GFX | BRF_GRA }, - { "msh.17m", 0x400000, 0x604ece14, CPS2_GFX | BRF_GRA }, - { "msh.19m", 0x400000, 0x94a731e8, CPS2_GFX | BRF_GRA }, - { "msh.14m", 0x400000, 0x4197973e, CPS2_GFX | BRF_GRA }, - { "msh.16m", 0x400000, 0x438da4a0, CPS2_GFX | BRF_GRA }, - { "msh.18m", 0x400000, 0x4db92d94, CPS2_GFX | BRF_GRA }, - { "msh.20m", 0x400000, 0xa2b0c6c0, CPS2_GFX | BRF_GRA }, - - { "msh.01", 0x020000, 0xc976e6f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "msh.02", 0x020000, 0xce67d0d9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "msh.11m", 0x200000, 0x37ac6d30, CPS2_QSND | BRF_SND }, - { "msh.12m", 0x200000, 0xde092570, CPS2_QSND | BRF_SND }, - - { "mshj.key", 0x000014, 0x888761ac, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshj) -STD_ROM_FN(Mshj) - -static struct BurnRomInfo Mshjr1RomDesc[] = { - { "mshj.03f", 0x080000, 0xff172fd2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mshj.04f", 0x080000, 0xebbb205a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.05", 0x080000, 0x6a091b9e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.06b", 0x080000, 0x803e3fa4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.07a", 0x080000, 0xc45f8e27, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.08a", 0x080000, 0x9ca6f12c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.09a", 0x080000, 0x82ec27af, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.10b", 0x080000, 0x8d931196, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "msh.13m", 0x400000, 0x09d14566, CPS2_GFX | BRF_GRA }, - { "msh.15m", 0x400000, 0xee962057, CPS2_GFX | BRF_GRA }, - { "msh.17m", 0x400000, 0x604ece14, CPS2_GFX | BRF_GRA }, - { "msh.19m", 0x400000, 0x94a731e8, CPS2_GFX | BRF_GRA }, - { "msh.14m", 0x400000, 0x4197973e, CPS2_GFX | BRF_GRA }, - { "msh.16m", 0x400000, 0x438da4a0, CPS2_GFX | BRF_GRA }, - { "msh.18m", 0x400000, 0x4db92d94, CPS2_GFX | BRF_GRA }, - { "msh.20m", 0x400000, 0xa2b0c6c0, CPS2_GFX | BRF_GRA }, - - { "msh.01", 0x020000, 0xc976e6f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "msh.02", 0x020000, 0xce67d0d9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "msh.11m", 0x200000, 0x37ac6d30, CPS2_QSND | BRF_SND }, - { "msh.12m", 0x200000, 0xde092570, CPS2_QSND | BRF_SND }, - - { "mshj.key", 0x000014, 0x888761ac, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshjr1) -STD_ROM_FN(Mshjr1) - -static struct BurnRomInfo MshuRomDesc[] = { - { "mshu.03", 0x080000, 0xd2805bdd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mshu.04", 0x080000, 0x743f96ff, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.05", 0x080000, 0x6a091b9e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.06b", 0x080000, 0x803e3fa4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.07a", 0x080000, 0xc45f8e27, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.08a", 0x080000, 0x9ca6f12c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.09a", 0x080000, 0x82ec27af, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.10b", 0x080000, 0x8d931196, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "msh.13m", 0x400000, 0x09d14566, CPS2_GFX | BRF_GRA }, - { "msh.15m", 0x400000, 0xee962057, CPS2_GFX | BRF_GRA }, - { "msh.17m", 0x400000, 0x604ece14, CPS2_GFX | BRF_GRA }, - { "msh.19m", 0x400000, 0x94a731e8, CPS2_GFX | BRF_GRA }, - { "msh.14m", 0x400000, 0x4197973e, CPS2_GFX | BRF_GRA }, - { "msh.16m", 0x400000, 0x438da4a0, CPS2_GFX | BRF_GRA }, - { "msh.18m", 0x400000, 0x4db92d94, CPS2_GFX | BRF_GRA }, - { "msh.20m", 0x400000, 0xa2b0c6c0, CPS2_GFX | BRF_GRA }, - - { "msh.01", 0x020000, 0xc976e6f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "msh.02", 0x020000, 0xce67d0d9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "msh.11m", 0x200000, 0x37ac6d30, CPS2_QSND | BRF_SND }, - { "msh.12m", 0x200000, 0xde092570, CPS2_QSND | BRF_SND }, - - { "mshu.key", 0x000014, 0x745c1bee, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshu) -STD_ROM_FN(Mshu) - -static struct BurnRomInfo MshvsfRomDesc[] = { - { "mvse.03f", 0x080000, 0xb72dc199, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvse.04f", 0x080000, 0x6ef799f9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05a", 0x080000, 0x1a5de0cb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsf.key", 0x000014, 0x64660867, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsf) -STD_ROM_FN(Mshvsf) - -static struct BurnRomInfo MshvsfhRomDesc[] = { - { "mvsh.03f", 0x080000, 0x4f60f41e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsh.04f", 0x080000, 0xdc08ec12, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05a", 0x080000, 0x1a5de0cb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfh.key", 0x000014, 0xb93d576f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfh) -STD_ROM_FN(Mshvsfh) - -static struct BurnRomInfo MshvsfaRomDesc[] = { - { "mvsa.03f", 0x080000, 0x5b863716, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsa.04f", 0x080000, 0x4886e65f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05a", 0x080000, 0x1a5de0cb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfa.key", 0x000014, 0x6810a3af, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfa) -STD_ROM_FN(Mshvsfa) - -static struct BurnRomInfo Mshvsfa1RomDesc[] = { - { "mvsa.03", 0x080000, 0x92ef1933, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsa.04", 0x080000, 0x4b24373c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05", 0x080000, 0xac180c1c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfa.key", 0x000014, 0x6810a3af, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfa1) -STD_ROM_FN(Mshvsfa1) - -static struct BurnRomInfo MshvsfbRomDesc[] = { - { "mvsb.03g", 0x080000, 0x143895ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsb.04g", 0x080000, 0xdd8a886c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05d", 0x080000, 0x921fc542, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfb.key", 0x000014, 0x3f5bb6e4, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfb) -STD_ROM_FN(Mshvsfb) - -static struct BurnRomInfo Mshvsfb1RomDesc[] = { - { "mvsb.03f", 0x080000, 0x9c4bb950, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsb.04f", 0x080000, 0xd3320d13, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05a", 0x080000, 0x1a5de0cb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfb.key", 0x000014, 0x3f5bb6e4, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfb1) -STD_ROM_FN(Mshvsfb1) - -static struct BurnRomInfo MshvsfjRomDesc[] = { - { "mvsj.03i", 0x080000, 0xd8cbb691, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsj.04i", 0x080000, 0x32741ace, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05h", 0x080000, 0x77870dc3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfj.key", 0x000014, 0x565eeebb, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfj) -STD_ROM_FN(Mshvsfj) - -static struct BurnRomInfo Mshvsfj1RomDesc[] = { - { "mvsj.03h", 0x080000, 0xfbe2115f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsj.04h", 0x080000, 0xb528a367, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05g", 0x080000, 0x9515a245, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfj.key", 0x000014, 0x565eeebb, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfj1) -STD_ROM_FN(Mshvsfj1) - -static struct BurnRomInfo Mshvsfj2RomDesc[] = { - { "mvsj.03g", 0x080000, 0xfdfa7e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsj.04g", 0x080000, 0xc921825f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05a", 0x080000, 0x1a5de0cb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfj.key", 0x000014, 0x565eeebb, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfj2) -STD_ROM_FN(Mshvsfj2) - -static struct BurnRomInfo MshvsfuRomDesc[] = { - { "mvsu.03g", 0x080000, 0x0664ab15, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsu.04g", 0x080000, 0x97e060ee, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05d", 0x080000, 0x921fc542, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfu.key", 0x000014, 0x4c04797b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfu) -STD_ROM_FN(Mshvsfu) - -static struct BurnRomInfo Mshvsfu1RomDesc[] = { - { "mvsu.03d", 0x080000, 0xae60a66a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsu.04d", 0x080000, 0x91f67d8a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.05a", 0x080000, 0x1a5de0cb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "mshvsfu.key", 0x000014, 0x4c04797b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfu1) -STD_ROM_FN(Mshvsfu1) - -static struct BurnRomInfo MvscRomDesc[] = { - { "mvce.03a", 0x080000, 0x824e4a90, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvce.04a", 0x080000, 0x436c5a4e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05a", 0x080000, 0x2d8c8e86, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06a", 0x080000, 0x8528e1f5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.07", 0x080000, 0xc3baa32b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvsc.key", 0x000014, 0x7e101e09, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvsc) -STD_ROM_FN(Mvsc) - -static struct BurnRomInfo Mvscr1RomDesc[] = { - { "mvce.03", 0x080000, 0xe0633fc0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvce.04", 0x080000, 0xa450a251, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05", 0x080000, 0x7db71ce9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06", 0x080000, 0x4b0b6d3e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.07", 0x080000, 0xc3baa32b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvsc.key", 0x000014, 0x7e101e09, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvscr1) -STD_ROM_FN(Mvscr1) - -static struct BurnRomInfo MvscaRomDesc[] = { - { "mvca.03a", 0x080000, 0x2ff4ae25, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvca.04a", 0x080000, 0xf28427ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05a", 0x080000, 0x2d8c8e86, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06a", 0x080000, 0x8528e1f5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.07", 0x080000, 0xc3baa32b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvsca.key", 0x000014, 0x31edaee8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvsca) -STD_ROM_FN(Mvsca) - -static struct BurnRomInfo Mvscar1RomDesc[] = { - { "mvca.03", 0x080000, 0xfe5fa7b9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvca.04", 0x080000, 0x082b701c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05", 0x080000, 0x7db71ce9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06", 0x080000, 0x4b0b6d3e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.07", 0x080000, 0xc3baa32b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvsca.key", 0x000014, 0x31edaee8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvscar1) -STD_ROM_FN(Mvscar1) - -static struct BurnRomInfo MvscbRomDesc[] = { - { "mvcb.03a", 0x080000, 0x7155953b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcb.04a", 0x080000, 0xfb117d0e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05a", 0x080000, 0x2d8c8e86, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06a", 0x080000, 0x8528e1f5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.07", 0x080000, 0xc3baa32b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvscb.key", 0x000014, 0xd74a7a3d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvscb) -STD_ROM_FN(Mvscb) - -static struct BurnRomInfo MvschRomDesc[] = { - { "mvch.03", 0x080000, 0x6a0ec9f7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvch.04", 0x080000, 0x00f03fa4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05a", 0x080000, 0x2d8c8e86, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06a", 0x080000, 0x8528e1f5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.07", 0x080000, 0xc3baa32b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvsch.key", 0x000014, 0xdd647c0d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvsch) -STD_ROM_FN(Mvsch) - -static struct BurnRomInfo MvscjRomDesc[] = { - { "mvcj.03a", 0x080000, 0x3df18879, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcj.04a", 0x080000, 0x07d212e8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05a", 0x080000, 0x2d8c8e86, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06a", 0x080000, 0x8528e1f5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.07", 0x080000, 0xc3baa32b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvscj.key", 0x000014, 0x9dedbcaf, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvscj) -STD_ROM_FN(Mvscj) - -static struct BurnRomInfo Mvscjr1RomDesc[] = { - { "mvcj.03", 0x080000, 0x2164213f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcj.04", 0x080000, 0xc905c86f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05", 0x080000, 0x7db71ce9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06", 0x080000, 0x4b0b6d3e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.07", 0x080000, 0xc3baa32b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvscj.key", 0x000014, 0x9dedbcaf, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvscjr1) -STD_ROM_FN(Mvscjr1) - -static struct BurnRomInfo MvscuRomDesc[] = { - { "mvcu.03d", 0x080000, 0xc6007557, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcu.04d", 0x080000, 0x724b2b20, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05a", 0x080000, 0x2d8c8e86, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06a", 0x080000, 0x8528e1f5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.07", 0x080000, 0xc3baa32b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvscu.key", 0x000014, 0xa83db333, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvscu) -STD_ROM_FN(Mvscu) - -static struct BurnRomInfo Mvscur1RomDesc[] = { - { "mvcu.03", 0x080000, 0x13f2be57, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcu.04", 0x080000, 0x5e9b380d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcu.05", 0x080000, 0x12f321be, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcu.06", 0x080000, 0x2f1524bc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcu.07", 0x080000, 0x5fdecadb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcu.10", 0x080000, 0x4f36cd63, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "mvscu.key", 0x000014, 0xa83db333, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvscur1) -STD_ROM_FN(Mvscur1) - -static struct BurnRomInfo MvscjsingRomDesc[] = { - { "mvc_ja.simm1", 0x200000, 0x6a2ef7c2, CPS2_PRG_68K_SIMM | BRF_ESS | BRF_PRG }, - { "mvc_ja.simm3", 0x200000, 0x699d09ad, CPS2_PRG_68K_SIMM | BRF_ESS | BRF_PRG }, - - { "mvc64-13m.13", 0x800000, 0x8428ce69, CPS2_GFX | BRF_GRA }, - { "mvc64-15m.15", 0x800000, 0x2e0028f4, CPS2_GFX | BRF_GRA }, - { "mvc64-17m.17", 0x800000, 0x308ca826, CPS2_GFX | BRF_GRA }, - { "mvc64-19m.19", 0x800000, 0x10699fe1, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc64-11m.11", 0x800000, 0x5d8819e0, CPS2_QSND | BRF_SND }, - - { "mvscj.key", 0x000014, 0x9dedbcaf, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvscjsing) -STD_ROM_FN(Mvscjsing) - -static struct BurnRomInfo NwarrRomDesc[] = { - { "vphe.03f", 0x080000, 0xa922c44f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphe.04c", 0x080000, 0x7312d890, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphe.05d", 0x080000, 0xcde8b506, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphe.06c", 0x080000, 0xbe99e7d0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphe.07b", 0x080000, 0x69e0e60c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphe.08b", 0x080000, 0xd95a3849, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphe.09b", 0x080000, 0x9882561c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphe.10b", 0x080000, 0x976fa62f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "nwarr.key", 0x000014, 0x618a13ca, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nwarr) -STD_ROM_FN(Nwarr) - -static struct BurnRomInfo NwarraRomDesc[] = { - { "vpha.03b", 0x080000, 0x0a70cdd6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vpha.04b", 0x080000, 0x70ce62e4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vpha.05b", 0x080000, 0x5692a03f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vpha.06b", 0x080000, 0xb810fe66, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vpha.07b", 0x080000, 0x1be264f3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vpha.08b", 0x080000, 0x86f1ed52, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vpha.09b", 0x080000, 0x7e96bd0a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vpha.10b", 0x080000, 0x58bce2fd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "nwarra.key", 0x000014, 0x9bafff67, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nwarra) -STD_ROM_FN(Nwarra) - -static struct BurnRomInfo NwarrbRomDesc[] = { - { "vphb.03d", 0x080000, 0x3a426d3f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphb.04a", 0x080000, 0x51c4bb2f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphb.05c", 0x080000, 0xac44d997, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphb.06a", 0x080000, 0x5072a5fe, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphb.07", 0x080000, 0x9b355192, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphb.08", 0x080000, 0x42220f84, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphb.09", 0x080000, 0x029e015d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphb.10", 0x080000, 0x37b3ce37, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "nwarrb.key", 0x000014, 0x4ffc0a54, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nwarrb) -STD_ROM_FN(Nwarrb) - -static struct BurnRomInfo NwarrhRomDesc[] = { - { "vphh.03d", 0x080000, 0x6029c7be, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphh.04a", 0x080000, 0xd26625ee, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphh.05c", 0x080000, 0x73ee0b8a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphh.06a", 0x080000, 0xa5b3a50a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphh.07", 0x080000, 0x5fc2bdc1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphh.08", 0x080000, 0xe65588d9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphh.09", 0x080000, 0xa2ce6d63, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphh.10", 0x080000, 0xe2f4f4b9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "nwarrh.key", 0x000014, 0x5fb16b23, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nwarrh) -STD_ROM_FN(Nwarrh) - -static struct BurnRomInfo NwarruRomDesc[] = { - { "vphu.03f", 0x080000, 0x85d6a359, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.04c", 0x080000, 0xcb7fce77, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.05e", 0x080000, 0xe08f2bba, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.06c", 0x080000, 0x08c04cdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.07b", 0x080000, 0xb5a5ab19, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.08b", 0x080000, 0x51bb20fb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.09b", 0x080000, 0x41a64205, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.10b", 0x080000, 0x2b1d43ae, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "nwarru.key", 0x000014, 0x1c593f9b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nwarru) -STD_ROM_FN(Nwarru) - -static struct BurnRomInfo VhuntjRomDesc[] = { - { "vphj.03f", 0x080000, 0x3de2e333, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.04c", 0x080000, 0xc95cf304, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.05d", 0x080000, 0x50de5ddd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.06c", 0x080000, 0xac3bd3d5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.07b", 0x080000, 0x0761309f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.08b", 0x080000, 0x5a5c2bf5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.09b", 0x080000, 0x823d6d99, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.10b", 0x080000, 0x32c7d8f0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "vhuntj.key", 0x000014, 0x72854f68, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vhuntj) -STD_ROM_FN(Vhuntj) - -static struct BurnRomInfo Vhuntjr1sRomDesc[] = { - { "vphjstop.03b", 0x080000, 0x9c4e6191, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.04c", 0x080000, 0xc95cf304, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.05d", 0x080000, 0x50de5ddd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.06c", 0x080000, 0xac3bd3d5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.07b", 0x080000, 0x0761309f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.08b", 0x080000, 0x5a5c2bf5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.09b", 0x080000, 0x823d6d99, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.10b", 0x080000, 0x32c7d8f0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "vhuntj.key", 0x000014, 0x72854f68, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vhuntjr1s) -STD_ROM_FN(Vhuntjr1s) - -static struct BurnRomInfo Vhuntjr1RomDesc[] = { - { "vphj.03c", 0x080000, 0x606b682a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.04b", 0x080000, 0xa3b40393, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.05b", 0x080000, 0xfccd5558, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.06b", 0x080000, 0x07e10a73, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.07b", 0x080000, 0x0761309f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.08b", 0x080000, 0x5a5c2bf5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.09b", 0x080000, 0x823d6d99, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.10b", 0x080000, 0x32c7d8f0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "vhuntj.key", 0x000014, 0x72854f68, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vhuntjr1) -STD_ROM_FN(Vhuntjr1) - -static struct BurnRomInfo Vhuntjr2RomDesc[] = { - { "vphj.03b", 0x080000, 0x679c3fa9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.04a", 0x080000, 0xeb6e71e4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.05a", 0x080000, 0xeaf634ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.06a", 0x080000, 0xb70cc6be, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.07a", 0x080000, 0x46ab907d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.08a", 0x080000, 0x1c00355e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.09a", 0x080000, 0x026e6f82, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphj.10a", 0x080000, 0xaadfb3ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "vhuntj.key", 0x000014, 0x72854f68, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vhuntjr2) -STD_ROM_FN(Vhuntjr2) - -static struct BurnRomInfo ProgearRomDesc[] = { - { "pgau.03", 0x080000, 0x343a783e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pgau.04", 0x080000, 0x16208d79, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pga-simm.01c", 0x200000, 0x452f98b0, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01d", 0x200000, 0x9e672092, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01a", 0x200000, 0xae9ddafe, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01b", 0x200000, 0x94d72D94, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03c", 0x200000, 0x48a1886d, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03d", 0x200000, 0x172d7e37, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03a", 0x200000, 0x9ee33d98, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03b", 0x200000, 0x848dee32, CPS2_GFX_SIMM | BRF_GRA }, - - { "pga.01", 0x020000, 0xbdbfa992, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pga-simm.05a", 0x200000, 0xc0aac80c, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.05b", 0x200000, 0x37a65d86, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06a", 0x200000, 0xd3f1e934, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06b", 0x200000, 0x8b39489a, CPS2_QSND_SIMM | BRF_SND }, - - { "progear.key", 0x000014, 0x46736b17, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Progear) -STD_ROM_FN(Progear) - -static struct BurnRomInfo ProgearaRomDesc[] = { - { "pgaa.03", 0x080000, 0x25e6e2ce, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pgaa.04", 0x080000, 0x8104307e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pga-simm.01c", 0x200000, 0x452f98b0, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01d", 0x200000, 0x9e672092, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01a", 0x200000, 0xae9ddafe, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01b", 0x200000, 0x94d72D94, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03c", 0x200000, 0x48a1886d, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03d", 0x200000, 0x172d7e37, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03a", 0x200000, 0x9ee33d98, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03b", 0x200000, 0x848dee32, CPS2_GFX_SIMM | BRF_GRA }, - - { "pga.01", 0x020000, 0xbdbfa992, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pga-simm.05a", 0x200000, 0xc0aac80c, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.05b", 0x200000, 0x37a65d86, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06a", 0x200000, 0xd3f1e934, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06b", 0x200000, 0x8b39489a, CPS2_QSND_SIMM | BRF_SND }, - - { "progeara.key", 0x000014, 0x30a0fab6, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Progeara) -STD_ROM_FN(Progeara) - -static struct BurnRomInfo ProgearjRomDesc[] = { - { "pgaj.03", 0x080000, 0x06dbba54, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pgaj.04", 0x080000, 0xa1f1f1bc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pga-simm.01c", 0x200000, 0x452f98b0, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01d", 0x200000, 0x9e672092, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01a", 0x200000, 0xae9ddafe, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01b", 0x200000, 0x94d72D94, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03c", 0x200000, 0x48a1886d, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03d", 0x200000, 0x172d7e37, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03a", 0x200000, 0x9ee33d98, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03b", 0x200000, 0x848dee32, CPS2_GFX_SIMM | BRF_GRA }, - - { "pga.01", 0x020000, 0xbdbfa992, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pga-simm.05a", 0x200000, 0xc0aac80c, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.05b", 0x200000, 0x37a65d86, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06a", 0x200000, 0xd3f1e934, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06b", 0x200000, 0x8b39489a, CPS2_QSND_SIMM | BRF_SND }, - - { "progearj.key", 0x000014, 0xd8d515e5, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Progearj) -STD_ROM_FN(Progearj) - -static struct BurnRomInfo Pzloop2RomDesc[] = { - { "pl2e.03", 0x080000, 0x3b1285b2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pl2e.04", 0x080000, 0x40a2d647, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pl2e.05", 0x080000, 0x0f11d818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pl2e.06", 0x080000, 0x86fbbdf4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pl2-simm.01c", 0x200000, 0x137b13a7, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.01d", 0x200000, 0xa2db1507, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.01a", 0x200000, 0x7e80ff8e, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.01b", 0x200000, 0xcd93e6ed, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03c", 0x200000, 0x0f52bbca, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03d", 0x200000, 0xa62712c3, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03a", 0x200000, 0xb60c9f8e, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03b", 0x200000, 0x83fef284, CPS2_GFX_SIMM | BRF_GRA }, - - { "pl2.01", 0x020000, 0x35697569, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pl2-simm.05a", 0x200000, 0x85d8fbe8, CPS2_QSND_SIMM | BRF_SND }, - { "pl2-simm.05b", 0x200000, 0x1ed62584, CPS2_QSND_SIMM | BRF_SND }, - - { "pzloop2.key", 0x000014, 0xae13be78, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Pzloop2) -STD_ROM_FN(Pzloop2) - -static struct BurnRomInfo Pzloop2jRomDesc[] = { - { "pl2j.03c", 0x080000, 0x3b76b806, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pl2j.04c", 0x080000, 0x8878a42a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pl2j.05c", 0x080000, 0x51081ea4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pl2j.06c", 0x080000, 0x51c68494, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pl2-simm.01c", 0x200000, 0x137b13a7, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.01d", 0x200000, 0xa2db1507, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.01a", 0x200000, 0x7e80ff8e, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.01b", 0x200000, 0xcd93e6ed, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03c", 0x200000, 0x0f52bbca, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03d", 0x200000, 0xa62712c3, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03a", 0x200000, 0xb60c9f8e, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03b", 0x200000, 0x83fef284, CPS2_GFX_SIMM | BRF_GRA }, - - { "pl2.01", 0x020000, 0x35697569, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pl2-simm.05a", 0x200000, 0x85d8fbe8, CPS2_QSND_SIMM | BRF_SND }, - { "pl2-simm.05b", 0x200000, 0x1ed62584, CPS2_QSND_SIMM | BRF_SND }, - - { "pzloop2.key", 0x000014, 0xae13be78, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Pzloop2j) -STD_ROM_FN(Pzloop2j) - -static struct BurnRomInfo Pzloop2jr1RomDesc[] = { - { "pl2j.03a", 0x080000, 0x0a751bd0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pl2j.04a", 0x080000, 0xc3f72afe, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pl2j.05a", 0x080000, 0x6ea9dbfc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pl2j.06a", 0x080000, 0x0f14848d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pl2-simm.01c", 0x200000, 0x137b13a7, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.01d", 0x200000, 0xa2db1507, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.01a", 0x200000, 0x7e80ff8e, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.01b", 0x200000, 0xcd93e6ed, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03c", 0x200000, 0x0f52bbca, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03d", 0x200000, 0xa62712c3, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03a", 0x200000, 0xb60c9f8e, CPS2_GFX_SIMM | BRF_GRA }, - { "pl2-simm.03b", 0x200000, 0x83fef284, CPS2_GFX_SIMM | BRF_GRA }, - - { "pl2.01", 0x020000, 0x35697569, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pl2-simm.05a", 0x200000, 0x85d8fbe8, CPS2_QSND_SIMM | BRF_SND }, - { "pl2-simm.05b", 0x200000, 0x1ed62584, CPS2_QSND_SIMM | BRF_SND }, - - { "pzloop2.key", 0x000014, 0xae13be78, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Pzloop2jr1) -STD_ROM_FN(Pzloop2jr1) - -static struct BurnRomInfo QndreamRomDesc[] = { - { "tqzj.03a", 0x080000, 0x7acf3e30, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "tqzj.04", 0x080000, 0xf1044a87, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "tqzj.05", 0x080000, 0x4105ba0e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "tqzj.06", 0x080000, 0xc371e8a5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "tqz.14m", 0x200000, 0x98af88a2, CPS2_GFX | BRF_GRA }, - { "tqz.16m", 0x200000, 0xdf82d491, CPS2_GFX | BRF_GRA }, - { "tqz.18m", 0x200000, 0x42f132ff, CPS2_GFX | BRF_GRA }, - { "tqz.20m", 0x200000, 0xb2e128a3, CPS2_GFX | BRF_GRA }, - - { "tqz.01", 0x020000, 0xe9ce9d0a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "tqz.11m", 0x200000, 0x78e7884f, CPS2_QSND | BRF_SND }, - { "tqz.12m", 0x200000, 0x2e049b13, CPS2_QSND | BRF_SND }, - - { "qndream.key", 0x000014, 0x97eee4ff, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Qndream) -STD_ROM_FN(Qndream) - -static struct BurnRomInfo RingdestRomDesc[] = { - { "smbe.03b", 0x080000, 0xb8016278, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbe.04b", 0x080000, 0x18c4c447, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbe.05b", 0x080000, 0x18ebda7f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbe.06b", 0x080000, 0x89c80007, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.07", 0x080000, 0xb9a11577, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.08", 0x080000, 0xf931b76b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "smb.13m", 0x200000, 0xd9b2d1de, CPS2_GFX | BRF_GRA }, - { "smb.15m", 0x200000, 0x9a766d92, CPS2_GFX | BRF_GRA }, - { "smb.17m", 0x200000, 0x51800f0f, CPS2_GFX | BRF_GRA }, - { "smb.19m", 0x200000, 0x35757e96, CPS2_GFX | BRF_GRA }, - { "smb.14m", 0x200000, 0xe5bfd0e7, CPS2_GFX | BRF_GRA }, - { "smb.16m", 0x200000, 0xc56c0866, CPS2_GFX | BRF_GRA }, - { "smb.18m", 0x200000, 0x4ded3910, CPS2_GFX | BRF_GRA }, - { "smb.20m", 0x200000, 0x26ea1ec5, CPS2_GFX | BRF_GRA }, - { "smb.21m", 0x080000, 0x0a08c5fc, CPS2_GFX | BRF_GRA }, - { "smb.23m", 0x080000, 0x0911b6c4, CPS2_GFX | BRF_GRA }, - { "smb.25m", 0x080000, 0x82d6c4ec, CPS2_GFX | BRF_GRA }, - { "smb.27m", 0x080000, 0x9b48678b, CPS2_GFX | BRF_GRA }, - - { "smb.01", 0x020000, 0x0abc229a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "smb.02", 0x020000, 0xd051679a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "smb.11m", 0x200000, 0xc56935f9, CPS2_QSND | BRF_SND }, - { "smb.12m", 0x200000, 0x955b0782, CPS2_QSND | BRF_SND }, - - { "ringdest.key", 0x000014, 0x17f9269c, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ringdest) -STD_ROM_FN(Ringdest) - -static struct BurnRomInfo RingdestaRomDesc[] = { - { "smba.03a", 0x080000, 0xd3744dfd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smba.04a", 0x080000, 0xf32d5b4f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smba.05a", 0x080000, 0x1016454f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smba.06a", 0x080000, 0x94b420cd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.07", 0x080000, 0xb9a11577, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.08", 0x080000, 0xf931b76b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "smb.13m", 0x200000, 0xd9b2d1de, CPS2_GFX | BRF_GRA }, - { "smb.15m", 0x200000, 0x9a766d92, CPS2_GFX | BRF_GRA }, - { "smb.17m", 0x200000, 0x51800f0f, CPS2_GFX | BRF_GRA }, - { "smb.19m", 0x200000, 0x35757e96, CPS2_GFX | BRF_GRA }, - { "smb.14m", 0x200000, 0xe5bfd0e7, CPS2_GFX | BRF_GRA }, - { "smb.16m", 0x200000, 0xc56c0866, CPS2_GFX | BRF_GRA }, - { "smb.18m", 0x200000, 0x4ded3910, CPS2_GFX | BRF_GRA }, - { "smb.20m", 0x200000, 0x26ea1ec5, CPS2_GFX | BRF_GRA }, - { "smb.21m", 0x080000, 0x0a08c5fc, CPS2_GFX | BRF_GRA }, - { "smb.23m", 0x080000, 0x0911b6c4, CPS2_GFX | BRF_GRA }, - { "smb.25m", 0x080000, 0x82d6c4ec, CPS2_GFX | BRF_GRA }, - { "smb.27m", 0x080000, 0x9b48678b, CPS2_GFX | BRF_GRA }, - - { "smb.01", 0x020000, 0x0abc229a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "smb.02", 0x020000, 0xd051679a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "smb.11m", 0x200000, 0xc56935f9, CPS2_QSND | BRF_SND }, - { "smb.12m", 0x200000, 0x955b0782, CPS2_QSND | BRF_SND }, - - { "ringdesta.key", 0x000014, 0x905c9065, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ringdesta) -STD_ROM_FN(Ringdesta) - -static struct BurnRomInfo RingdesthRomDesc[] = { - { "smbh.03b", 0x080000, 0x2e316584, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbh.04b", 0x080000, 0x9950a23a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbh.05b", 0x080000, 0x41e0b3fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbh.06b", 0x080000, 0x89c80007, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbh.07b", 0x080000, 0xb9a11577, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbh.08b", 0x080000, 0xf931b76b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "smb.13m", 0x200000, 0xd9b2d1de, CPS2_GFX | BRF_GRA }, - { "smb.15m", 0x200000, 0x9a766d92, CPS2_GFX | BRF_GRA }, - { "smb.17m", 0x200000, 0x51800f0f, CPS2_GFX | BRF_GRA }, - { "smb.19m", 0x200000, 0x35757e96, CPS2_GFX | BRF_GRA }, - { "smb.14m", 0x200000, 0xe5bfd0e7, CPS2_GFX | BRF_GRA }, - { "smb.16m", 0x200000, 0xc56c0866, CPS2_GFX | BRF_GRA }, - { "smb.18m", 0x200000, 0x4ded3910, CPS2_GFX | BRF_GRA }, - { "smb.20m", 0x200000, 0x26ea1ec5, CPS2_GFX | BRF_GRA }, - { "smb.21m", 0x080000, 0x0a08c5fc, CPS2_GFX | BRF_GRA }, - { "smb.23m", 0x080000, 0x0911b6c4, CPS2_GFX | BRF_GRA }, - { "smb.25m", 0x080000, 0x82d6c4ec, CPS2_GFX | BRF_GRA }, - { "smb.27m", 0x080000, 0x9b48678b, CPS2_GFX | BRF_GRA }, - - { "smb.01", 0x020000, 0x0abc229a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "smb.02", 0x020000, 0xd051679a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "smb.11m", 0x200000, 0xc56935f9, CPS2_QSND | BRF_SND }, - { "smb.12m", 0x200000, 0x955b0782, CPS2_QSND | BRF_SND }, - - { "ringdesth.key", 0x000014, 0xffb8d049, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ringdesth) -STD_ROM_FN(Ringdesth) - -static struct BurnRomInfo SmbombRomDesc[] = { - { "smbj.03a", 0x080000, 0x1c5613de, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbj.04a", 0x080000, 0x29071ed7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbj.05a", 0x080000, 0xeb20bce4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbj.06a", 0x080000, 0x94b420cd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.07", 0x080000, 0xb9a11577, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.08", 0x080000, 0xf931b76b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "smb.13m", 0x200000, 0xd9b2d1de, CPS2_GFX | BRF_GRA }, - { "smb.15m", 0x200000, 0x9a766d92, CPS2_GFX | BRF_GRA }, - { "smb.17m", 0x200000, 0x51800f0f, CPS2_GFX | BRF_GRA }, - { "smb.19m", 0x200000, 0x35757e96, CPS2_GFX | BRF_GRA }, - { "smb.14m", 0x200000, 0xe5bfd0e7, CPS2_GFX | BRF_GRA }, - { "smb.16m", 0x200000, 0xc56c0866, CPS2_GFX | BRF_GRA }, - { "smb.18m", 0x200000, 0x4ded3910, CPS2_GFX | BRF_GRA }, - { "smb.20m", 0x200000, 0x26ea1ec5, CPS2_GFX | BRF_GRA }, - { "smb.21m", 0x080000, 0x0a08c5fc, CPS2_GFX | BRF_GRA }, - { "smb.23m", 0x080000, 0x0911b6c4, CPS2_GFX | BRF_GRA }, - { "smb.25m", 0x080000, 0x82d6c4ec, CPS2_GFX | BRF_GRA }, - { "smb.27m", 0x080000, 0x9b48678b, CPS2_GFX | BRF_GRA }, - - { "smb.01", 0x020000, 0x0abc229a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "smb.02", 0x020000, 0xd051679a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "smb.11m", 0x200000, 0xc56935f9, CPS2_QSND | BRF_SND }, - { "smb.12m", 0x200000, 0x955b0782, CPS2_QSND | BRF_SND }, - - { "smbomb.key", 0x000014, 0xf690069b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Smbomb) -STD_ROM_FN(Smbomb) - -static struct BurnRomInfo Smbombr1RomDesc[] = { - { "smbj.03", 0x080000, 0x52eafb10, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbj.04", 0x080000, 0xaa6e8078, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbj.05", 0x080000, 0xb69e7d5f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbj.06", 0x080000, 0x8d857b56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.07", 0x080000, 0xb9a11577, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.08", 0x080000, 0xf931b76b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "smb.13m", 0x200000, 0xd9b2d1de, CPS2_GFX | BRF_GRA }, - { "smb.15m", 0x200000, 0x9a766d92, CPS2_GFX | BRF_GRA }, - { "smb.17m", 0x200000, 0x51800f0f, CPS2_GFX | BRF_GRA }, - { "smb.19m", 0x200000, 0x35757e96, CPS2_GFX | BRF_GRA }, - { "smb.14m", 0x200000, 0xe5bfd0e7, CPS2_GFX | BRF_GRA }, - { "smb.16m", 0x200000, 0xc56c0866, CPS2_GFX | BRF_GRA }, - { "smb.18m", 0x200000, 0x4ded3910, CPS2_GFX | BRF_GRA }, - { "smb.20m", 0x200000, 0x26ea1ec5, CPS2_GFX | BRF_GRA }, - { "smb.21m", 0x080000, 0x0a08c5fc, CPS2_GFX | BRF_GRA }, - { "smb.23m", 0x080000, 0x0911b6c4, CPS2_GFX | BRF_GRA }, - { "smb.25m", 0x080000, 0x82d6c4ec, CPS2_GFX | BRF_GRA }, - { "smb.27m", 0x080000, 0x9b48678b, CPS2_GFX | BRF_GRA }, - - { "smb.01", 0x020000, 0x0abc229a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "smb.02", 0x020000, 0xd051679a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "smb.11m", 0x200000, 0xc56935f9, CPS2_QSND | BRF_SND }, - { "smb.12m", 0x200000, 0x955b0782, CPS2_QSND | BRF_SND }, - - { "smbomb.key", 0x000014, 0xf690069b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Smbombr1) -STD_ROM_FN(Smbombr1) - -static struct BurnRomInfo SfaRomDesc[] = { - { "sfze.03d", 0x080000, 0xebf2054d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04b", 0x080000, 0x8b73b0e5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfa.key", 0x000014, 0x7c095631, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa) -STD_ROM_FN(Sfa) - -static struct BurnRomInfo Sfar1RomDesc[] = { - { "sfze.03c", 0x080000, 0xa1b69dd7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfze.04b", 0x080000, 0xbb90acd5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfa.key", 0x000014, 0x7c095631, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfar1) -STD_ROM_FN(Sfar1) - -static struct BurnRomInfo Sfar2RomDesc[] = { - { "sfze.03b", 0x080000, 0x2bf5708e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04a", 0x080000, 0x5f99e9a5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfa.key", 0x000014, 0x7c095631, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfar2) -STD_ROM_FN(Sfar2) - -static struct BurnRomInfo Sfar3RomDesc[] = { - { "sfze.03a", 0x080000, 0xfdbcd434, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04", 0x080000, 0x0c436d30, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05", 0x080000, 0x1f363612, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfa.key", 0x000014, 0x7c095631, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfar3) -STD_ROM_FN(Sfar3) - -static struct BurnRomInfo SfauRomDesc[] = { - { "sfzu.03a", 0x080000, 0x49fc7db9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // If there's a US 950605 then this should be sfzu.03b - { "sfz.04a", 0x080000, 0x5f99e9a5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfau.key", 0x000014, 0x1dd0998d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfau) -STD_ROM_FN(Sfau) - -static struct BurnRomInfo SfzaRomDesc[] = { - { "sfza.03b", 0x080000, 0xca91bed9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04a", 0x080000, 0x5f99e9a5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfza.key", 0x000014, 0x2aa6ac63, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfza) -STD_ROM_FN(Sfza) - -static struct BurnRomInfo Sfzar1RomDesc[] = { - { "sfza.03a", 0x080000, 0xf38d8c8d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04", 0x080000, 0x0c436d30, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05", 0x080000, 0x1f363612, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfza.key", 0x000014, 0x2aa6ac63, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfzar1) -STD_ROM_FN(Sfzar1) - -static struct BurnRomInfo SfzbRomDesc[] = { - { "sfzb.03g", 0x080000, 0x348862d4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfzb.04e", 0x080000, 0x8d9b2480, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfzb.key", 0x000014, 0xb0570359, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfzb) -STD_ROM_FN(Sfzb) - -static struct BurnRomInfo Sfzbr1RomDesc[] = { - { "sfzb.03e", 0x080000, 0xecba89a3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04b", 0x080000, 0x8b73b0e5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfzb.key", 0x000014, 0xb0570359, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfzbr1) -STD_ROM_FN(Sfzbr1) - -static struct BurnRomInfo SfzhRomDesc[] = { - { "sfzh.03d", 0x080000, 0x6e08cbe0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04c", 0x080000, 0xbb90acd5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05c", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfzh.key", 0x000014, 0x4763446f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfzh) -STD_ROM_FN(Sfzh) - -static struct BurnRomInfo Sfzhr1RomDesc[] = { - { "sfzh.03c", 0x080000, 0xbce635aa, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04a", 0x080000, 0x5f99e9a5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfzh.key", 0x000014, 0x4763446f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfzhr1) -STD_ROM_FN(Sfzhr1) - -static struct BurnRomInfo SfzjRomDesc[] = { - { "sfzj.03c", 0x080000, 0xf5444120, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04b", 0x080000, 0x8b73b0e5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfzj.key", 0x000014, 0x355d85b8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfzj) -STD_ROM_FN(Sfzj) - -static struct BurnRomInfo Sfzjr1RomDesc[] = { - { "sfzj.03b", 0x080000, 0x844220c2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04a", 0x080000, 0x5f99e9a5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfzj.key", 0x000014, 0x355d85b8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfzjr1) -STD_ROM_FN(Sfzjr1) - -static struct BurnRomInfo Sfzjr2RomDesc[] = { - { "sfzj.03a", 0x080000, 0x3cfce93c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04", 0x080000, 0x0c436d30, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05", 0x080000, 0x1f363612, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "sfzj.key", 0x000014, 0x355d85b8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfzjr2) -STD_ROM_FN(Sfzjr2) - -static struct BurnRomInfo Sfa2RomDesc[] = { - { "sz2e.03", 0x080000, 0x1061e6bb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2e.04", 0x080000, 0x22d17b26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.05", 0x080000, 0x4b442a7c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.06", 0x080000, 0x5b1d49c0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.07", 0x080000, 0x8e184246, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.08", 0x080000, 0x0fe8585d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfa2.key", 0x000014, 0x1578dcb0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa2) -STD_ROM_FN(Sfa2) - -static struct BurnRomInfo Sfa2uRomDesc[] = { - { "sz2u.03a", 0x080000, 0xd03e504f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.04a", 0x080000, 0xfae0e9c3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.05a", 0x080000, 0xd02dd758, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.06", 0x080000, 0xc5c8eb63, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.07", 0x080000, 0x5de01cc5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.08", 0x080000, 0xbea11d56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfa2u.key", 0x000014, 0x4a8d91ef, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa2u) -STD_ROM_FN(Sfa2u) - -static struct BurnRomInfo Sfa2ur1RomDesc[] = { - { "sz2u.03", 0x080000, 0x84a09006, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.04", 0x080000, 0xac46e5ed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.05", 0x080000, 0x6c0c79d3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.06", 0x080000, 0xc5c8eb63, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.07", 0x080000, 0x5de01cc5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2u.08", 0x080000, 0xbea11d56, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfa2u.key", 0x000014, 0x4a8d91ef, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa2ur1) -STD_ROM_FN(Sfa2ur1) - -static struct BurnRomInfo Sfz2aRomDesc[] = { - { "sz2a.03a", 0x080000, 0x30d2099f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2a.04a", 0x080000, 0x1cc94db1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.05a", 0x080000, 0x98e8e992, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.06", 0x080000, 0x5b1d49c0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2a.07a", 0x080000, 0x0aed2494, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.08", 0x080000, 0x0fe8585d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2a.key", 0x000014, 0x777b7358, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2a) -STD_ROM_FN(Sfz2a) - -static struct BurnRomInfo Sfz2bRomDesc[] = { - { "sz2b.03b", 0x080000, 0x1ac12812, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2b.04b", 0x080000, 0xe4ffaf68, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2b.05a", 0x080000, 0xdd224156, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2b.06a", 0x080000, 0xa45a75a6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2b.07a", 0x080000, 0x7d19d5ec, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2b.08", 0x080000, 0x92b66e01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2b.key", 0x000014, 0x35b1df07, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2b) -STD_ROM_FN(Sfz2b) - -static struct BurnRomInfo Sfz2br1RomDesc[] = { - { "sz2b.03", 0x080000, 0xe6ce530b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2b.04", 0x080000, 0x1605a0cb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.05", 0x080000, 0x4b442a7c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.06", 0x080000, 0x5b1d49c0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2b.07", 0x080000, 0x947e8ac6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2b.08", 0x080000, 0x92b66e01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2b.key", 0x000014, 0x35b1df07, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2br1) -STD_ROM_FN(Sfz2br1) - -static struct BurnRomInfo Sfz2hRomDesc[] = { - { "sz2h.03" , 0x080000, 0xbfeddf5b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2h.04", 0x080000, 0xea5009fb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.05", 0x080000, 0x4b442a7c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.06", 0x080000, 0x5b1d49c0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2h.07", 0x080000, 0x947e8ac6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2h.08", 0x080000, 0x92b66e01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2h.key", 0x000014, 0x2719ea16, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2h) -STD_ROM_FN(Sfz2h) - -static struct BurnRomInfo Sfz2jRomDesc[] = { - { "sz2j.03b", 0x080000, 0x3e1e2e85, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2j.04b", 0x080000, 0xf53d6c45, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2j.05b", 0x080000, 0xdd224156, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2j.06b", 0x080000, 0xa45a75a6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2j.07b", 0x080000, 0x6352f038, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2j.08b", 0x080000, 0x92b66e01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2j.key", 0x000014, 0x455bd098, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2j) -STD_ROM_FN(Sfz2j) - -static struct BurnRomInfo Sfz2jr1RomDesc[] = { - { "sz2j.03a", 0x080000, 0x97461e28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2j.04a", 0x080000, 0xae4851a9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.05a", 0x080000, 0x98e8e992, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.06", 0x080000, 0x5b1d49c0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2j.07a", 0x080000, 0xd910b2a2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.08", 0x080000, 0x0fe8585d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2j.key", 0x000014, 0x455bd098, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2jr1) -STD_ROM_FN(Sfz2jr1) - -static struct BurnRomInfo Sfz2nRomDesc[] = { - { "sz2n.03" , 0x080000, 0x58924741, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2n.04", 0x080000, 0x592a17c5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.05", 0x080000, 0x4b442a7c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.06", 0x080000, 0x5b1d49c0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.07", 0x080000, 0x8e184246, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.08", 0x080000, 0x0fe8585d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2n.key", 0x000014, 0xd1cc49d5, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2n) -STD_ROM_FN(Sfz2n) - -static struct BurnRomInfo Sfz2alRomDesc[] = { - { "szaa.03", 0x080000, 0x88e7023e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaa.04", 0x080000, 0xae8ec36e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaa.05", 0x080000, 0xf053a55e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaa.06", 0x080000, 0xcfc0e7a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaa.07", 0x080000, 0x5feb8b20, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaa.08", 0x080000, 0x6eb6d412, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sza.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sza.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sza.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sza.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sza.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sza.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sza.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sza.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sza.01", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sza.02", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sza.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sza.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2al.key", 0x000014, 0x2904963e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2al) -STD_ROM_FN(Sfz2al) - -static struct BurnRomInfo Sfz2albRomDesc[] = { - { "szab.03", 0x080000, 0xcb436eca, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szab.04", 0x080000, 0x14534bea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szab.05", 0x080000, 0x7fb10658, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sza.06", 0x080000, 0x0abda2fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sza.07", 0x080000, 0xe9430762, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sza.08", 0x080000, 0xb65711a9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sza.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sza.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sza.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sza.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sza.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sza.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sza.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sza.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sza.01", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sza.02", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sza.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sza.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2alb.key", 0x000014, 0xc8b3ac73, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2alb) -STD_ROM_FN(Sfz2alb) - -static struct BurnRomInfo Sfz2alhRomDesc[] = { - { "szah.03", 0x080000, 0x06f93d1d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szah.04", 0x080000, 0xe62ee914, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szah.05", 0x080000, 0x2b7f4b20, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sza.06", 0x080000, 0x0abda2fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sza.07", 0x080000, 0xe9430762, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sza.08", 0x080000, 0xb65711a9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sza.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sza.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sza.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sza.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sza.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sza.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sza.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sza.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sza.01", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sza.02", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sza.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sza.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2alh.key", 0x000014, 0xf320f655, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2alh) -STD_ROM_FN(Sfz2alh) - -static struct BurnRomInfo Sfz2aljRomDesc[] = { - { "szaj.03a", 0x080000, 0xa3802fe3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaj.04a", 0x080000, 0xe7ca87c7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaj.05a", 0x080000, 0xc88ebf88, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaj.06a", 0x080000, 0x35ed5b7a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaj.07a", 0x080000, 0x975dcb3e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaj.08a", 0x080000, 0xdc73f2d7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sza.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sza.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sza.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sza.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sza.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sza.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sza.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sza.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sza.01", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sza.02", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sza.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sza.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "sfz2alj.key", 0x000014, 0x4c42320f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2alj) -STD_ROM_FN(Sfz2alj) - -static struct BurnRomInfo Sfa3RomDesc[] = { - { "sz3e.03c", 0x080000, 0x9762b206, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3e.04c", 0x080000, 0x5ad3f721, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05c", 0x080000, 0x57fd0a40, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06c", 0x080000, 0xf6305f8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07c", 0x080000, 0x6eab0f6f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08c", 0x080000, 0x910c4a3b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09c", 0x080000, 0xb29e5199, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10b", 0x080000, 0xdeb2ff52, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfa3.key", 0x000014, 0x54fa39c6, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa3) -STD_ROM_FN(Sfa3) - -static struct BurnRomInfo Sfa3bRomDesc[] = { - { "sz3b.03", 0x080000, 0x046c9b4d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3b.04", 0x080000, 0xda211919, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05", 0x080000, 0x9b21518a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06", 0x080000, 0xe7a6c3a7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07", 0x080000, 0xec4c0cfd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08", 0x080000, 0x5c7e7240, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09", 0x080000, 0xc5589553, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10", 0x080000, 0xa9717252, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfa3b.key", 0x000014, 0x2d0a1351, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa3b) -STD_ROM_FN(Sfa3b) - -static struct BurnRomInfo Sfa3hRomDesc[] = { - { "sz3h.03c", 0x080000, 0xb3b563a3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3h.04c", 0x080000, 0x47891fec, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05c", 0x080000, 0x57fd0a40, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06c", 0x080000, 0xf6305f8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07c", 0x080000, 0x6eab0f6f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08c", 0x080000, 0x910c4a3b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09c", 0x080000, 0xb29e5199, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10b", 0x080000, 0xdeb2ff52, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfa3h.key", 0x000014, 0x1b34998c, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa3h) -STD_ROM_FN(Sfa3h) - -static struct BurnRomInfo Sfa3hr1RomDesc[] = { - { "sz3h.03", 0x080000, 0x4b16cb3e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3h.04", 0x080000, 0x88ad2e6a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05", 0x080000, 0x9b21518a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06", 0x080000, 0xe7a6c3a7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07", 0x080000, 0xec4c0cfd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08", 0x080000, 0x5c7e7240, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09", 0x080000, 0xc5589553, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10", 0x080000, 0xa9717252, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfa3h.key", 0x000014, 0x1b34998c, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa3hr1) -STD_ROM_FN(Sfa3hr1) - -static struct BurnRomInfo Sfa3uRomDesc[] = { - { "sz3u.03c", 0x080000, 0xe007da2e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3u.04c", 0x080000, 0x5f78f0e7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05c", 0x080000, 0x57fd0a40, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06c", 0x080000, 0xf6305f8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07c", 0x080000, 0x6eab0f6f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08c", 0x080000, 0x910c4a3b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09c", 0x080000, 0xb29e5199, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10b", 0x080000, 0xdeb2ff52, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfa3u.key", 0x000014, 0x4a8f98c1, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa3u) -STD_ROM_FN(Sfa3u) - -static struct BurnRomInfo Sfa3ur1RomDesc[] = { - { "sz3u.03", 0x080000, 0xb5984a19, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3u.04", 0x080000, 0x7e8158ba, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05", 0x080000, 0x9b21518a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06", 0x080000, 0xe7a6c3a7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07", 0x080000, 0xec4c0cfd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08", 0x080000, 0x5c7e7240, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09", 0x080000, 0xc5589553, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10", 0x080000, 0xa9717252, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfa3u.key", 0x000014, 0x4a8f98c1, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa3ur1) -STD_ROM_FN(Sfa3ur1) - -static struct BurnRomInfo Sfa3usRomDesc[] = { - { "sz3-usam_03.6a", 0x080000, 0x14319e29, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3-usam_04.7a", 0x080000, 0x65fbc272, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3-usam_05.8a", 0x080000, 0xe93c47d1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3-usam_06.9a", 0x080000, 0x1bf09de3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3-usam_07.6d", 0x080000, 0xf6296d96, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3-usam_08.7d", 0x080000, 0x1f4008ff, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3-usam_09.8d", 0x080000, 0x822fc451, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3-usam_10.9d", 0x080000, 0x92713468, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3-usam_01.1a", 0x020000, 0xc180947d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3-usam_02.2a", 0x020000, 0x9ebc280f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfa3u.key", 0x000014, 0x4a8f98c1, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa3us) -STD_ROM_FN(Sfa3us) - -static struct BurnRomInfo Sfz3aRomDesc[] = { - { "sz3a.03d", 0x080000, 0xd7e140d6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3a.04d", 0x080000, 0xe06869a2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05c", 0x080000, 0x57fd0a40, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06c", 0x080000, 0xf6305f8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07c", 0x080000, 0x6eab0f6f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08c", 0x080000, 0x910c4a3b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09c", 0x080000, 0xb29e5199, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10b", 0x080000, 0xdeb2ff52, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfz3a.key", 0x000014, 0x09045d61, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz3a) -STD_ROM_FN(Sfz3a) - -static struct BurnRomInfo Sfz3ar1RomDesc[] = { - { "sz3a.03a", 0x080000, 0x29c681fd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3a.04", 0x080000, 0x9ddd1484, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05", 0x080000, 0x9b21518a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06", 0x080000, 0xe7a6c3a7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07", 0x080000, 0xec4c0cfd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08", 0x080000, 0x5c7e7240, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09", 0x080000, 0xc5589553, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10", 0x080000, 0xa9717252, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfz3a.key", 0x000014, 0x09045d61, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz3ar1) -STD_ROM_FN(Sfz3ar1) - -static struct BurnRomInfo Sfz3jRomDesc[] = { - { "sz3j.03c", 0x080000, 0xcadf4a51, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3j.04c", 0x080000, 0xfcb31228, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05c", 0x080000, 0x57fd0a40, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06c", 0x080000, 0xf6305f8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07c", 0x080000, 0x6eab0f6f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08c", 0x080000, 0x910c4a3b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09c", 0x080000, 0xb29e5199, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10b", 0x080000, 0xdeb2ff52, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfz3j.key", 0x000014, 0xd30cca8d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz3j) -STD_ROM_FN(Sfz3j) - -static struct BurnRomInfo Sfz3jr1RomDesc[] = { - { "sz3j.03a", 0x080000, 0x6ee0beae, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3j.04a", 0x080000, 0xa6e2978d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05a", 0x080000, 0x05964b7d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06a", 0x080000, 0x78ce2179, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07a", 0x080000, 0x398bf52f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08a", 0x080000, 0x866d0588, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09a", 0x080000, 0x2180892c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10", 0x080000, 0xa9717252, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfz3j.key", 0x000014, 0xd30cca8d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz3jr1) -STD_ROM_FN(Sfz3jr1) - -static struct BurnRomInfo Sfz3jr2RomDesc[] = { - { "sz3j.03", 0x080000, 0xf7cb4b13, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3j.04", 0x080000, 0x0846c29d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05", 0x080000, 0x9b21518a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06", 0x080000, 0xe7a6c3a7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07", 0x080000, 0xec4c0cfd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08", 0x080000, 0x5c7e7240, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09", 0x080000, 0xc5589553, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10", 0x080000, 0xa9717252, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "sfz3j.key", 0x000014, 0xd30cca8d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz3jr2) -STD_ROM_FN(Sfz3jr2) - -static struct BurnRomInfo SgemfRomDesc[] = { - { "pcfu.03", 0x080000, 0xac2e8566, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.04", 0x080000, 0xf4314c96, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.05", 0x080000, 0x215655f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.06", 0x080000, 0xea6f13ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.07", 0x080000, 0x5ac6d5ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pcf.13m", 0x400000, 0x22d72ab9, CPS2_GFX | BRF_GRA }, - { "pcf.15m", 0x400000, 0x16a4813c, CPS2_GFX | BRF_GRA }, - { "pcf.17m", 0x400000, 0x1097e035, CPS2_GFX | BRF_GRA }, - { "pcf.19m", 0x400000, 0xd362d874, CPS2_GFX | BRF_GRA }, - { "pcf.14m", 0x100000, 0x0383897c, CPS2_GFX | BRF_GRA }, - { "pcf.16m", 0x100000, 0x76f91084, CPS2_GFX | BRF_GRA }, - { "pcf.18m", 0x100000, 0x756c3754, CPS2_GFX | BRF_GRA }, - { "pcf.20m", 0x100000, 0x9ec9277d, CPS2_GFX | BRF_GRA }, - - { "pcf.01", 0x020000, 0x254e5f33, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pcf.02", 0x020000, 0x6902f4f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pcf.11m", 0x400000, 0xa5dea005, CPS2_QSND | BRF_SND }, - { "pcf.12m", 0x400000, 0x4ce235fe, CPS2_QSND | BRF_SND }, - - { "sgemf.key", 0x000014, 0x3d604021, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sgemf) -STD_ROM_FN(Sgemf) - -static struct BurnRomInfo PfghtjRomDesc[] = { - { "pcfj.03", 0x080000, 0x681da43e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.04", 0x080000, 0xf4314c96, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.05", 0x080000, 0x215655f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.06", 0x080000, 0xea6f13ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.07", 0x080000, 0x5ac6d5ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pcf.13m", 0x400000, 0x22d72ab9, CPS2_GFX | BRF_GRA }, - { "pcf.15m", 0x400000, 0x16a4813c, CPS2_GFX | BRF_GRA }, - { "pcf.17m", 0x400000, 0x1097e035, CPS2_GFX | BRF_GRA }, - { "pcf.19m", 0x400000, 0xd362d874, CPS2_GFX | BRF_GRA }, - { "pcf.14m", 0x100000, 0x0383897c, CPS2_GFX | BRF_GRA }, - { "pcf.16m", 0x100000, 0x76f91084, CPS2_GFX | BRF_GRA }, - { "pcf.18m", 0x100000, 0x756c3754, CPS2_GFX | BRF_GRA }, - { "pcf.20m", 0x100000, 0x9ec9277d, CPS2_GFX | BRF_GRA }, - - { "pcf.01", 0x020000, 0x254e5f33, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pcf.02", 0x020000, 0x6902f4f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pcf.11m", 0x400000, 0xa5dea005, CPS2_QSND | BRF_SND }, - { "pcf.12m", 0x400000, 0x4ce235fe, CPS2_QSND | BRF_SND }, - - { "pfghtj.key", 0x000014, 0x62297638, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Pfghtj) -STD_ROM_FN(Pfghtj) - -static struct BurnRomInfo SgemfaRomDesc[] = { - { "pcfa.03", 0x080000, 0xe17c089a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.04", 0x080000, 0xf4314c96, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.05", 0x080000, 0x215655f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.06", 0x080000, 0xea6f13ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.07", 0x080000, 0x5ac6d5ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pcf.13m", 0x400000, 0x22d72ab9, CPS2_GFX | BRF_GRA }, - { "pcf.15m", 0x400000, 0x16a4813c, CPS2_GFX | BRF_GRA }, - { "pcf.17m", 0x400000, 0x1097e035, CPS2_GFX | BRF_GRA }, - { "pcf.19m", 0x400000, 0xd362d874, CPS2_GFX | BRF_GRA }, - { "pcf.14m", 0x100000, 0x0383897c, CPS2_GFX | BRF_GRA }, - { "pcf.16m", 0x100000, 0x76f91084, CPS2_GFX | BRF_GRA }, - { "pcf.18m", 0x100000, 0x756c3754, CPS2_GFX | BRF_GRA }, - { "pcf.20m", 0x100000, 0x9ec9277d, CPS2_GFX | BRF_GRA }, - - { "pcf.01", 0x020000, 0x254e5f33, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pcf.02", 0x020000, 0x6902f4f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pcf.11m", 0x400000, 0xa5dea005, CPS2_QSND | BRF_SND }, - { "pcf.12m", 0x400000, 0x4ce235fe, CPS2_QSND | BRF_SND }, - - { "sgemfa.key", 0x000014, 0xdd513738, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sgemfa) -STD_ROM_FN(Sgemfa) - -static struct BurnRomInfo SgemfhRomDesc[] = { - { "pcfh.03", 0x080000, 0xe9103347, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.04", 0x080000, 0xf4314c96, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.05", 0x080000, 0x215655f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.06", 0x080000, 0xea6f13ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.07", 0x080000, 0x5ac6d5ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pcf.13m", 0x400000, 0x22d72ab9, CPS2_GFX | BRF_GRA }, - { "pcf.15m", 0x400000, 0x16a4813c, CPS2_GFX | BRF_GRA }, - { "pcf.17m", 0x400000, 0x1097e035, CPS2_GFX | BRF_GRA }, - { "pcf.19m", 0x400000, 0xd362d874, CPS2_GFX | BRF_GRA }, - { "pcf.14m", 0x100000, 0x0383897c, CPS2_GFX | BRF_GRA }, - { "pcf.16m", 0x100000, 0x76f91084, CPS2_GFX | BRF_GRA }, - { "pcf.18m", 0x100000, 0x756c3754, CPS2_GFX | BRF_GRA }, - { "pcf.20m", 0x100000, 0x9ec9277d, CPS2_GFX | BRF_GRA }, - - { "pcf.01", 0x020000, 0x254e5f33, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pcf.02", 0x020000, 0x6902f4f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pcf.11m", 0x400000, 0xa5dea005, CPS2_QSND | BRF_SND }, - { "pcf.12m", 0x400000, 0x4ce235fe, CPS2_QSND | BRF_SND }, - - { "sgemfh.key", 0x000014, 0xf97f4b7d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sgemfh) -STD_ROM_FN(Sgemfh) - -static struct BurnRomInfo Spf2tRomDesc[] = { - { "pzfe.03", 0x080000, 0x2af51954, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pzf.04", 0x080000, 0xb80649e2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // marked pzfe.04 but same as pzf.04 - - { "pzf.14m", 0x100000, 0x2d4881cb, CPS2_GFX | BRF_GRA }, - { "pzf.16m", 0x100000, 0x4b0fd1be, CPS2_GFX | BRF_GRA }, - { "pzf.18m", 0x100000, 0xe43aac33, CPS2_GFX | BRF_GRA }, - { "pzf.20m", 0x100000, 0x7f536ff1, CPS2_GFX | BRF_GRA }, - - { "pzf.01", 0x020000, 0x600fb2a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pzf.02", 0x020000, 0x496076e0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pzf.11m", 0x200000, 0x78442743, CPS2_QSND | BRF_SND }, - { "pzf.12m", 0x200000, 0x399d2c7b, CPS2_QSND | BRF_SND }, - - { "spf2t.key", 0x000014, 0x4c4dc7e3, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Spf2t) -STD_ROM_FN(Spf2t) - -static struct BurnRomInfo Spf2tuRomDesc[] = { - { "pzfu.03a", 0x080000, 0x346e62ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pzf.04", 0x080000, 0xb80649e2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pzf.14m", 0x100000, 0x2d4881cb, CPS2_GFX | BRF_GRA }, - { "pzf.16m", 0x100000, 0x4b0fd1be, CPS2_GFX | BRF_GRA }, - { "pzf.18m", 0x100000, 0xe43aac33, CPS2_GFX | BRF_GRA }, - { "pzf.20m", 0x100000, 0x7f536ff1, CPS2_GFX | BRF_GRA }, - - { "pzf.01", 0x020000, 0x600fb2a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pzf.02", 0x020000, 0x496076e0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pzf.11m", 0x200000, 0x78442743, CPS2_QSND | BRF_SND }, - { "pzf.12m", 0x200000, 0x399d2c7b, CPS2_QSND | BRF_SND }, - - { "spf2tu.key", 0x000014, 0x5d7b15e8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Spf2tu) -STD_ROM_FN(Spf2tu) - -static struct BurnRomInfo Spf2taRomDesc[] = { - { "pzfa.03", 0x080000, 0x3cecfa78, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pzf.04", 0x080000, 0xb80649e2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pzf.14m", 0x100000, 0x2d4881cb, CPS2_GFX | BRF_GRA }, - { "pzf.16m", 0x100000, 0x4b0fd1be, CPS2_GFX | BRF_GRA }, - { "pzf.18m", 0x100000, 0xe43aac33, CPS2_GFX | BRF_GRA }, - { "pzf.20m", 0x100000, 0x7f536ff1, CPS2_GFX | BRF_GRA }, - - { "pzf.01", 0x020000, 0x600fb2a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pzf.02", 0x020000, 0x496076e0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pzf.11m", 0x200000, 0x78442743, CPS2_QSND | BRF_SND }, - { "pzf.12m", 0x200000, 0x399d2c7b, CPS2_QSND | BRF_SND }, - - { "spf2ta.key", 0x000014, 0x61e93a18, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Spf2ta) -STD_ROM_FN(Spf2ta) - -static struct BurnRomInfo Spf2thRomDesc[] = { - { "pzfh.03", 0x080000, 0x20510f2d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pzf.04", 0x080000, 0xb80649e2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pzf.14m", 0x100000, 0x2d4881cb, CPS2_GFX | BRF_GRA }, - { "pzf.16m", 0x100000, 0x4b0fd1be, CPS2_GFX | BRF_GRA }, - { "pzf.18m", 0x100000, 0xe43aac33, CPS2_GFX | BRF_GRA }, - { "pzf.20m", 0x100000, 0x7f536ff1, CPS2_GFX | BRF_GRA }, - - { "pzf.01", 0x020000, 0x600fb2a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pzf.02", 0x020000, 0x496076e0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pzf.11m", 0x200000, 0x78442743, CPS2_QSND | BRF_SND }, - { "pzf.12m", 0x200000, 0x399d2c7b, CPS2_QSND | BRF_SND }, - - { "spf2th.key", 0x000014, 0x292db449, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Spf2th) -STD_ROM_FN(Spf2th) - -static struct BurnRomInfo Spf2xjRomDesc[] = { - { "pzfj.03a", 0x080000, 0x2070554a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pzf.04", 0x080000, 0xb80649e2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pzf.14m", 0x100000, 0x2d4881cb, CPS2_GFX | BRF_GRA }, - { "pzf.16m", 0x100000, 0x4b0fd1be, CPS2_GFX | BRF_GRA }, - { "pzf.18m", 0x100000, 0xe43aac33, CPS2_GFX | BRF_GRA }, - { "pzf.20m", 0x100000, 0x7f536ff1, CPS2_GFX | BRF_GRA }, - - { "pzf.01", 0x020000, 0x600fb2a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pzf.02", 0x020000, 0x496076e0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pzf.11m", 0x200000, 0x78442743, CPS2_QSND | BRF_SND }, - { "pzf.12m", 0x200000, 0x399d2c7b, CPS2_QSND | BRF_SND }, - - { "spf2xj.key", 0x000014, 0xdc39fd34, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Spf2xj) -STD_ROM_FN(Spf2xj) - -static struct BurnRomInfo Ssf2RomDesc[] = { - { "ssfe-03b", 0x080000, 0xaf654792, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.04", 0x080000, 0xb082aa67, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.05", 0x080000, 0x02b9c137, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe-06b", 0x080000, 0x1c8e44a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.07", 0x080000, 0x2409001d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf-01a", 0x020000, 0x71fcdfc9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2.key", 0x000014, 0xe469ccbb, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2) -STD_ROM_FN(Ssf2) - -static struct BurnRomInfo Ssf2r1RomDesc[] = { - { "ssfe.03", 0x080000, 0xa597745d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.04", 0x080000, 0xb082aa67, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.05", 0x080000, 0x02b9c137, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.06", 0x080000, 0x70d470c5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.07", 0x080000, 0x2409001d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2.key", 0x000014, 0xe469ccbb, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2r1) -STD_ROM_FN(Ssf2r1) - -static struct BurnRomInfo Ssf2aRomDesc[] = { - { "ssfa.03b", 0x080000, 0x83a059bf, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.04a", 0x080000, 0x5d873642, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.05", 0x080000, 0xf8fb4de2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.06b", 0x080000, 0x3185d19d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.07", 0x080000, 0x36e29217, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2a.key", 0x000014, 0x5fb6013f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2a) -STD_ROM_FN(Ssf2a) - -static struct BurnRomInfo Ssf2ar1RomDesc[] = { - { "ssfa.03a", 0x080000, 0xd2a3c520, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.04a", 0x080000, 0x5d873642, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.05", 0x080000, 0xf8fb4de2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.06", 0x080000, 0xaa8acee7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.07", 0x080000, 0x36e29217, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2a.key", 0x000014, 0x5fb6013f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2ar1) -STD_ROM_FN(Ssf2ar1) - -static struct BurnRomInfo Ssf2hRomDesc[] = { - { "ssfh.03", 0x080000, 0xb086b355, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfh.04", 0x080000, 0x1e629b29, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfh.05", 0x080000, 0xb5997e10, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfh.06", 0x080000, 0x793b8fad, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfh.07", 0x080000, 0xcbb92ac3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2h.key", 0x000014, 0x8331bc8e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2h) -STD_ROM_FN(Ssf2h) - -static struct BurnRomInfo Ssf2jRomDesc[] = { - { "ssfj.03b", 0x080000, 0x5c2e356d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.04a", 0x080000, 0x013bd55c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.05", 0x080000, 0x0918d19a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.06b", 0x080000, 0x014e0c6d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.07", 0x080000, 0xeb6a9b1b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2j.key", 0x000014, 0xbca45cc2, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2j) -STD_ROM_FN(Ssf2j) - -static struct BurnRomInfo Ssf2jr1RomDesc[] = { - { "ssfj.03a", 0x080000, 0x0bbf1304, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.04a", 0x080000, 0x013bd55c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.05", 0x080000, 0x0918d19a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.06", 0x080000, 0xd808a6cd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.07", 0x080000, 0xeb6a9b1b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2j.key", 0x000014, 0xbca45cc2, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2jr1) -STD_ROM_FN(Ssf2jr1) - -static struct BurnRomInfo Ssf2jr2RomDesc[] = { - { "ssfj.03", 0x080000, 0x7eb0efed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.04", 0x080000, 0xd7322164, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.05", 0x080000, 0x0918d19a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.06", 0x080000, 0xd808a6cd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.07", 0x080000, 0xeb6a9b1b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2j.key", 0x000014, 0xbca45cc2, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2jr2) -STD_ROM_FN(Ssf2jr2) - -static struct BurnRomInfo Ssf2uRomDesc[] = { - { "ssfu.03a", 0x080000, 0x72f29c33, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfu.04a", 0x080000, 0x935cea44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfu.05", 0x080000, 0xa0acb28a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfu.06", 0x080000, 0x47413dcf, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfu.07", 0x080000, 0xe6066077, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2u.key", 0x000014, 0x2f4f8e9d, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2u) -STD_ROM_FN(Ssf2u) - -static struct BurnRomInfo Ssf2tbRomDesc[] = { - { "ssfe.03tc", 0x080000, 0x496a8409, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.04tc", 0x080000, 0x4b45c18b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.05t", 0x080000, 0x6a9c6444, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.06tb", 0x080000, 0xe4944fc3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.07t", 0x080000, 0x2c9f4782, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2tb.key", 0x000014, 0x1ecc92b2, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tb) -STD_ROM_FN(Ssf2tb) - -static struct BurnRomInfo Ssf2tbaRomDesc[] = { - { "ssfa.03tb", 0x080000, 0x8de631d2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.04ta", 0x080000, 0xabef3042, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.05t", 0x080000, 0xedfa018f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.06tb", 0x080000, 0x2b9d1dbc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfa.07t", 0x080000, 0xf4a25159, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf-01a", 0x020000, 0x71fcdfc9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2tba.key", 0x000014, 0x8d2740ed, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tba) -STD_ROM_FN(Ssf2tba) - -static struct BurnRomInfo Ssf2tbr1RomDesc[] = { - { "ssfe.03t", 0x080000, 0x1e018e34, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.04t", 0x080000, 0xac92efaf, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.05t", 0x080000, 0x6a9c6444, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.06t", 0x080000, 0xf442562b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfe.07t", 0x080000, 0x2c9f4782, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2tb.key", 0x000014, 0x1ecc92b2, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tbr1) -STD_ROM_FN(Ssf2tbr1) - -static struct BurnRomInfo Ssf2tbjRomDesc[] = { - { "ssftj.03b", 0x080000, 0xe78a3433, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssftj.04t", 0x080000, 0xb4dc1906, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssftj.05", 0x080000, 0xa7e35fbc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.06tb", 0x080000, 0x0737c30d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.07t", 0x080000, 0x1f239515, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2tbj.key", 0x000014, 0xbcc2e017, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tbj) -STD_ROM_FN(Ssf2tbj) - -static struct BurnRomInfo Ssf2tbj1RomDesc[] = { - { "ssfj.03t", 0x080000, 0x980d4450, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.04t", 0x080000, 0xb4dc1906, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.05t", 0x080000, 0xa7e35fbc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.06t", 0x080000, 0xcb592b30, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfj.07t", 0x080000, 0x1f239515, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2tbj.key", 0x000014, 0xbcc2e017, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tbj1) -STD_ROM_FN(Ssf2tbj1) - -static struct BurnRomInfo Ssf2tbhRomDesc[] = { - { "ssfh.03tb", 0x080000, 0x6db7d28b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfh.04t", 0x080000, 0x0fe7d895, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfh.05t", 0x080000, 0x41be4f2d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfh.06tb", 0x080000, 0xd2522eb1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfh.07t", 0x080000, 0xb1c3a3c6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "ssf2tbh.key", 0x000014, 0xfddecf4f, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tbh) -STD_ROM_FN(Ssf2tbh) - -static struct BurnRomInfo Ssf2tRomDesc[] = { - { "sfxe.03c", 0x080000, 0x2fa1f396, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxe.04a", 0x080000, 0xd0bc29c6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxe.05", 0x080000, 0x65222964, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxe.06a", 0x080000, 0x8fe9f531, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxe.07", 0x080000, 0x8a7d0cb6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxe.08", 0x080000, 0x74c24062, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfx.09", 0x080000, 0x642fae3f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "ssf2t.key", 0x000014, 0x524d608e, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2t) -STD_ROM_FN(Ssf2t) - -static struct BurnRomInfo Ssf2taRomDesc[] = { - { "sfxa.03c", 0x080000, 0x04b9ff34, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxa.04a", 0x080000, 0x16ea5f7a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxa.05", 0x080000, 0x53d61f0c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxa.06a", 0x080000, 0x066d09b5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxa.07", 0x080000, 0xa428257b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxa.08", 0x080000, 0x39be596c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfx.09", 0x080000, 0x642fae3f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "ssf2ta.key", 0x000014, 0xc11fa8e9, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2ta) -STD_ROM_FN(Ssf2ta) - -static struct BurnRomInfo Ssf2thRomDesc[] = { - { "sfxh.03c", 0x080000, 0xfbe80dfe, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxh.04a", 0x080000, 0xef9dd4b1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxh.05", 0x080000, 0x09e56ecc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxh.06a", 0x080000, 0xe6f210be, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxh.07", 0x080000, 0x900ba1a4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxh.08", 0x080000, 0xc15f0424, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxh.09", 0x080000, 0x5b92b3f9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "ssf2th.key", 0x000014, 0xf6ce6a35, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2th) -STD_ROM_FN(Ssf2th) - -static struct BurnRomInfo Ssf2tuRomDesc[] = { - { "sfxu.03e", 0x080000, 0xd6ff689e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.04a", 0x080000, 0x532b5ffd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.05", 0x080000, 0xffa3c6de, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.06b", 0x080000, 0x83f9382b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.07a", 0x080000, 0x6ab673e8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.08", 0x080000, 0xb3c71810, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfx.09", 0x080000, 0x642fae3f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "ssf2tu.key", 0x000014, 0xf7d62def, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tu) -STD_ROM_FN(Ssf2tu) - -static struct BurnRomInfo Ssf2tur1RomDesc[] = { - { "sfxu.03c", 0x080000, 0x86e4a335, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.04a", 0x080000, 0x532b5ffd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.05", 0x080000, 0xffa3c6de, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.06a", 0x080000, 0xe4c04c99, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.07", 0x080000, 0xd8199e41, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxu.08", 0x080000, 0xb3c71810, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfx.09", 0x080000, 0x642fae3f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "ssf2tu.key", 0x000014, 0xf7d62def, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tur1) -STD_ROM_FN(Ssf2tur1) - -static struct BurnRomInfo Ssf2xjRomDesc[] = { - { "sfxj.03d", 0x080000, 0x50b52b37, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.04a", 0x080000, 0xaf7767b4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.05", 0x080000, 0xf4ff18f5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.06b", 0x080000, 0x413477c2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.07a", 0x080000, 0xa18b3d83, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.08", 0x080000, 0x2de76f10, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfx.09", 0x080000, 0x642fae3f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "ssf2xj.key", 0x000014, 0x160d1424, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2xj) -STD_ROM_FN(Ssf2xj) - -static struct BurnRomInfo Ssf2xjr1RomDesc[] = { - { "sfxj.03c", 0x080000, 0xa7417b79, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.04a", 0x080000, 0xaf7767b4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.05", 0x080000, 0xf4ff18f5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.06a", 0x080000, 0x260d0370, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.07", 0x080000, 0x1324d02a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxj.08", 0x080000, 0x2de76f10, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfx.09", 0x080000, 0x642fae3f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "ssf2xj.key", 0x000014, 0x160d1424, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2xjr1) -STD_ROM_FN(Ssf2xjr1) - -static struct BurnRomInfo Ssf2xjr1rRomDesc[] = { - { "sfxo.03c", 0x080000, 0x2ba33dc6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxo.04a", 0x080000, 0xba663dd7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxo.05", 0x080000, 0x1321625c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxo.06a", 0x080000, 0x0cc490ed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxo.07", 0x080000, 0x64b9015e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxo.08", 0x080000, 0xb60f4b58, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxo.09", 0x080000, 0x642fae3f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.69", 0x080000, 0xe9123f9f, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.70", 0x080000, 0x2f8201f3, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.71", 0x080000, 0x0fa334b4, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.72", 0x080000, 0xb76740d3, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.73", 0x080000, 0x14f058ec, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.74", 0x080000, 0x800c3ae9, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "sfx.75", 0x080000, 0x06cf540b, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "sfx.76", 0x080000, 0x71084e42, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.59", 0x080000, 0x6eb3ee4d, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.60", 0x080000, 0x2bcf1eda, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.61", 0x080000, 0x3330cc11, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.62", 0x080000, 0x96e2ead3, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.63", 0x080000, 0xe356a275, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.64", 0x080000, 0xfec5698b, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "sfx.65", 0x080000, 0x69da0751, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "sfx.66", 0x080000, 0xcc53ec15, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.79", 0x080000, 0xcf0d44a8, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.80", 0x080000, 0x56a153a4, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.81", 0x080000, 0x5484e5f6, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.82", 0x080000, 0xfce6b7f5, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.83", 0x080000, 0x042d7970, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.84", 0x080000, 0x88c472e6, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "sfx.85", 0x080000, 0xa7d66348, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "sfx.86", 0x080000, 0xcf9119c8, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.89", 0x080000, 0x6d374ad9, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.90", 0x080000, 0x34cf8bcf, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.91", 0x080000, 0xd796ea3f, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.92", 0x080000, 0xc85fb7e3, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.93", 0x080000, 0x6c50c2b5, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "ssf.94", 0x080000, 0x59549f63, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "sfx.95", 0x080000, 0x86c97869, CPS2_GFX_SPLIT8 | BRF_GRA }, - { "sfx.96", 0x080000, 0x1c0e1989, CPS2_GFX_SPLIT8 | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.51a", 0x080000, 0x9eda6954, CPS2_QSND | BRF_SND }, - { "ssf.52a", 0x080000, 0x355f6589, CPS2_QSND | BRF_SND }, - { "ssf.53a", 0x080000, 0xd5d08a05, CPS2_QSND | BRF_SND }, - { "ssf.54a", 0x080000, 0x930725eb, CPS2_QSND | BRF_SND }, - { "ssf.55a", 0x080000, 0x827abf3c, CPS2_QSND | BRF_SND }, - { "ssf.56a", 0x080000, 0x3919c0e5, CPS2_QSND | BRF_SND }, - { "ssf.57a", 0x080000, 0x1ba9bfa6, CPS2_QSND | BRF_SND }, - { "ssf.58a", 0x080000, 0x0c89a272, CPS2_QSND | BRF_SND }, - - { "ssf2xjr1r.key", 0x000014, 0x82c86e63, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2xjr1r) -STD_ROM_FN(Ssf2xjr1r) - -static struct BurnRomInfo Vhunt2RomDesc[] = { - { "vh2j.03a", 0x080000, 0x9ae8f186, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.04a", 0x080000, 0xe2fabf53, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.05", 0x080000, 0xde34f624, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.06", 0x080000, 0x6a3b9897, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.07", 0x080000, 0xb021c029, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.08", 0x080000, 0xac873dff, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.09", 0x080000, 0xeaefce9c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.10", 0x080000, 0x11730952, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vh2.13m", 0x400000, 0x3b02ddaa, CPS2_GFX | BRF_GRA }, - { "vh2.15m", 0x400000, 0x4e40de66, CPS2_GFX | BRF_GRA }, - { "vh2.17m", 0x400000, 0xb31d00c9, CPS2_GFX | BRF_GRA }, - { "vh2.19m", 0x400000, 0x149be3ab, CPS2_GFX | BRF_GRA }, - { "vh2.14m", 0x400000, 0xcd09bd63, CPS2_GFX | BRF_GRA }, - { "vh2.16m", 0x400000, 0xe0182c15, CPS2_GFX | BRF_GRA }, - { "vh2.18m", 0x400000, 0x778dc4f6, CPS2_GFX | BRF_GRA }, - { "vh2.20m", 0x400000, 0x605d9d1d, CPS2_GFX | BRF_GRA }, - - { "vh2.01", 0x020000, 0x67b9f779, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vh2.02", 0x020000, 0xaaf15fcb, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vh2.11m", 0x400000, 0x38922efd, CPS2_QSND | BRF_SND }, - { "vh2.12m", 0x400000, 0x6e2430af, CPS2_QSND | BRF_SND }, - - { "vhunt2.key", 0x000014, 0x61306b20, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vhunt2) -STD_ROM_FN(Vhunt2) - -static struct BurnRomInfo Vhunt2r1RomDesc[] = { - { "vh2j.03", 0x080000, 0x1a5feb13, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.04", 0x080000, 0x434611a5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.05", 0x080000, 0xde34f624, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.06", 0x080000, 0x6a3b9897, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.07", 0x080000, 0xb021c029, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.08", 0x080000, 0xac873dff, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.09", 0x080000, 0xeaefce9c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.10", 0x080000, 0x11730952, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vh2.13m", 0x400000, 0x3b02ddaa, CPS2_GFX | BRF_GRA }, - { "vh2.15m", 0x400000, 0x4e40de66, CPS2_GFX | BRF_GRA }, - { "vh2.17m", 0x400000, 0xb31d00c9, CPS2_GFX | BRF_GRA }, - { "vh2.19m", 0x400000, 0x149be3ab, CPS2_GFX | BRF_GRA }, - { "vh2.14m", 0x400000, 0xcd09bd63, CPS2_GFX | BRF_GRA }, - { "vh2.16m", 0x400000, 0xe0182c15, CPS2_GFX | BRF_GRA }, - { "vh2.18m", 0x400000, 0x778dc4f6, CPS2_GFX | BRF_GRA }, - { "vh2.20m", 0x400000, 0x605d9d1d, CPS2_GFX | BRF_GRA }, - - { "vh2.01", 0x020000, 0x67b9f779, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vh2.02", 0x020000, 0xaaf15fcb, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vh2.11m", 0x400000, 0x38922efd, CPS2_QSND | BRF_SND }, - { "vh2.12m", 0x400000, 0x6e2430af, CPS2_QSND | BRF_SND }, - - { "vhunt2.key", 0x000014, 0x61306b20, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vhunt2r1) -STD_ROM_FN(Vhunt2r1) - -static struct BurnRomInfo VsavRomDesc[] = { - { "vm3e.03d", 0x080000, 0xf5962a8c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3e.04d", 0x080000, 0x21b40ea2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.05a", 0x080000, 0x4118e00f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.06a", 0x080000, 0x2f4fd3a9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.07b", 0x080000, 0xcbda91b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.08a", 0x080000, 0x6ca47259, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.09b", 0x080000, 0xf4a339e3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.10b", 0x080000, 0xfffbb5b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vm3.13m", 0x400000, 0xfd8a11eb, CPS2_GFX | BRF_GRA }, - { "vm3.15m", 0x400000, 0xdd1e7d4e, CPS2_GFX | BRF_GRA }, - { "vm3.17m", 0x400000, 0x6b89445e, CPS2_GFX | BRF_GRA }, - { "vm3.19m", 0x400000, 0x3830fdc7, CPS2_GFX | BRF_GRA }, - { "vm3.14m", 0x400000, 0xc1a28e6c, CPS2_GFX | BRF_GRA }, - { "vm3.16m", 0x400000, 0x194a7304, CPS2_GFX | BRF_GRA }, - { "vm3.18m", 0x400000, 0xdf9a9f47, CPS2_GFX | BRF_GRA }, - { "vm3.20m", 0x400000, 0xc22fc3d9, CPS2_GFX | BRF_GRA }, - - { "vm3.01", 0x020000, 0xf778769b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vm3.02", 0x020000, 0xcc09faa1, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vm3.11m", 0x400000, 0xe80e956e, CPS2_QSND | BRF_SND }, - { "vm3.12m", 0x400000, 0x9cd71557, CPS2_QSND | BRF_SND }, - - { "vsav.key", 0x000014, 0xa6e3b164, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vsav) -STD_ROM_FN(Vsav) - -static struct BurnRomInfo VsavaRomDesc[] = { - { "vm3a.03d", 0x080000, 0x44c1198f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3a.04d", 0x080000, 0x2218b781, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.05a", 0x080000, 0x4118e00f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.06a", 0x080000, 0x2f4fd3a9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.07b", 0x080000, 0xcbda91b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.08a", 0x080000, 0x6ca47259, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.09b", 0x080000, 0xf4a339e3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.10b", 0x080000, 0xfffbb5b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vm3.13m", 0x400000, 0xfd8a11eb, CPS2_GFX | BRF_GRA }, - { "vm3.15m", 0x400000, 0xdd1e7d4e, CPS2_GFX | BRF_GRA }, - { "vm3.17m", 0x400000, 0x6b89445e, CPS2_GFX | BRF_GRA }, - { "vm3.19m", 0x400000, 0x3830fdc7, CPS2_GFX | BRF_GRA }, - { "vm3.14m", 0x400000, 0xc1a28e6c, CPS2_GFX | BRF_GRA }, - { "vm3.16m", 0x400000, 0x194a7304, CPS2_GFX | BRF_GRA }, - { "vm3.18m", 0x400000, 0xdf9a9f47, CPS2_GFX | BRF_GRA }, - { "vm3.20m", 0x400000, 0xc22fc3d9, CPS2_GFX | BRF_GRA }, - - { "vm3.01", 0x020000, 0xf778769b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vm3.02", 0x020000, 0xcc09faa1, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vm3.11m", 0x400000, 0xe80e956e, CPS2_QSND | BRF_SND }, - { "vm3.12m", 0x400000, 0x9cd71557, CPS2_QSND | BRF_SND }, - - { "vsava.key", 0x000014, 0x8a3520f4, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vsava) -STD_ROM_FN(Vsava) - -static struct BurnRomInfo VsavhRomDesc[] = { - { "vm3h.03a", 0x080000, 0x7cc62df8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3h.04d", 0x080000, 0xd716f3b5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.05a", 0x080000, 0x4118e00f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.06a", 0x080000, 0x2f4fd3a9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.07b", 0x080000, 0xcbda91b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.08a", 0x080000, 0x6ca47259, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.09b", 0x080000, 0xf4a339e3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.10b", 0x080000, 0xfffbb5b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vm3.13m", 0x400000, 0xfd8a11eb, CPS2_GFX | BRF_GRA }, - { "vm3.15m", 0x400000, 0xdd1e7d4e, CPS2_GFX | BRF_GRA }, - { "vm3.17m", 0x400000, 0x6b89445e, CPS2_GFX | BRF_GRA }, - { "vm3.19m", 0x400000, 0x3830fdc7, CPS2_GFX | BRF_GRA }, - { "vm3.14m", 0x400000, 0xc1a28e6c, CPS2_GFX | BRF_GRA }, - { "vm3.16m", 0x400000, 0x194a7304, CPS2_GFX | BRF_GRA }, - { "vm3.18m", 0x400000, 0xdf9a9f47, CPS2_GFX | BRF_GRA }, - { "vm3.20m", 0x400000, 0xc22fc3d9, CPS2_GFX | BRF_GRA }, - - { "vm3.01", 0x020000, 0xf778769b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vm3.02", 0x020000, 0xcc09faa1, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vm3.11m", 0x400000, 0xe80e956e, CPS2_QSND | BRF_SND }, - { "vm3.12m", 0x400000, 0x9cd71557, CPS2_QSND | BRF_SND }, - - { "vsavh.key", 0x000014, 0xa7dd6409, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vsavh) -STD_ROM_FN(Vsavh) - -static struct BurnRomInfo VsavjRomDesc[] = { - { "vm3j.03d", 0x080000, 0x2a2e74a4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3j.04d", 0x080000, 0x1c2427bc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3j.05a", 0x080000, 0x95ce88d5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3j.06b", 0x080000, 0x2c4297e0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3j.07b", 0x080000, 0xa38aaae7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3j.08a", 0x080000, 0x5773e5c9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3j.09b", 0x080000, 0xd064f8b9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3j.10b", 0x080000, 0x434518e9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vm3.13m", 0x400000, 0xfd8a11eb, CPS2_GFX | BRF_GRA }, - { "vm3.15m", 0x400000, 0xdd1e7d4e, CPS2_GFX | BRF_GRA }, - { "vm3.17m", 0x400000, 0x6b89445e, CPS2_GFX | BRF_GRA }, - { "vm3.19m", 0x400000, 0x3830fdc7, CPS2_GFX | BRF_GRA }, - { "vm3.14m", 0x400000, 0xc1a28e6c, CPS2_GFX | BRF_GRA }, - { "vm3.16m", 0x400000, 0x194a7304, CPS2_GFX | BRF_GRA }, - { "vm3.18m", 0x400000, 0xdf9a9f47, CPS2_GFX | BRF_GRA }, - { "vm3.20m", 0x400000, 0xc22fc3d9, CPS2_GFX | BRF_GRA }, - - { "vm3.01", 0x020000, 0xf778769b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vm3.02", 0x020000, 0xcc09faa1, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vm3.11m", 0x400000, 0xe80e956e, CPS2_QSND | BRF_SND }, - { "vm3.12m", 0x400000, 0x9cd71557, CPS2_QSND | BRF_SND }, - - { "vsavj.key", 0x000014, 0x36d28ab8, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vsavj) -STD_ROM_FN(Vsavj) - -static struct BurnRomInfo VsavuRomDesc[] = { - { "vm3u.03d", 0x080000, 0x1f295274, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3u.04d", 0x080000, 0xc46adf81, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.05a", 0x080000, 0x4118e00f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.06a", 0x080000, 0x2f4fd3a9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.07b", 0x080000, 0xcbda91b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.08a", 0x080000, 0x6ca47259, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.09b", 0x080000, 0xf4a339e3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.10b", 0x080000, 0xfffbb5b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vm3.13m", 0x400000, 0xfd8a11eb, CPS2_GFX | BRF_GRA }, - { "vm3.15m", 0x400000, 0xdd1e7d4e, CPS2_GFX | BRF_GRA }, - { "vm3.17m", 0x400000, 0x6b89445e, CPS2_GFX | BRF_GRA }, - { "vm3.19m", 0x400000, 0x3830fdc7, CPS2_GFX | BRF_GRA }, - { "vm3.14m", 0x400000, 0xc1a28e6c, CPS2_GFX | BRF_GRA }, - { "vm3.16m", 0x400000, 0x194a7304, CPS2_GFX | BRF_GRA }, - { "vm3.18m", 0x400000, 0xdf9a9f47, CPS2_GFX | BRF_GRA }, - { "vm3.20m", 0x400000, 0xc22fc3d9, CPS2_GFX | BRF_GRA }, - - { "vm3.01", 0x020000, 0xf778769b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vm3.02", 0x020000, 0xcc09faa1, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vm3.11m", 0x400000, 0xe80e956e, CPS2_QSND | BRF_SND }, - { "vm3.12m", 0x400000, 0x9cd71557, CPS2_QSND | BRF_SND }, - - { "vsavu.key", 0x000014, 0xff21b9d7, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vsavu) -STD_ROM_FN(Vsavu) - -static struct BurnRomInfo Vsav2RomDesc[] = { - { "vs2j.03", 0x080000, 0x89fd86b4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.04", 0x080000, 0x107c091b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.05", 0x080000, 0x61979638, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.06", 0x080000, 0xf37c5bc2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.07", 0x080000, 0x8f885809, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.08", 0x080000, 0x2018c120, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.09", 0x080000, 0xfac3c217, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.10", 0x080000, 0xeb490213, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vs2.13m", 0x400000, 0x5c852f52, CPS2_GFX | BRF_GRA }, - { "vs2.15m", 0x400000, 0xa20f58af, CPS2_GFX | BRF_GRA }, - { "vs2.17m", 0x400000, 0x39db59ad, CPS2_GFX | BRF_GRA }, - { "vs2.19m", 0x400000, 0x00c763a7, CPS2_GFX | BRF_GRA }, - { "vs2.14m", 0x400000, 0xcd09bd63, CPS2_GFX | BRF_GRA }, - { "vs2.16m", 0x400000, 0xe0182c15, CPS2_GFX | BRF_GRA }, - { "vs2.18m", 0x400000, 0x778dc4f6, CPS2_GFX | BRF_GRA }, - { "vs2.20m", 0x400000, 0x605d9d1d, CPS2_GFX | BRF_GRA }, - - { "vs2.01", 0x020000, 0x35190139, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vs2.02", 0x020000, 0xc32dba09, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vs2.11m", 0x400000, 0xd67e47b7, CPS2_QSND | BRF_SND }, - { "vs2.12m", 0x400000, 0x6d020a14, CPS2_QSND | BRF_SND }, - - { "vsav2.key", 0x000014, 0x289028ce, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vsav2) -STD_ROM_FN(Vsav2) - -static struct BurnRomInfo XmcotaRomDesc[] = { - { "xmne.03f", 0x080000, 0x5a726d13, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmne.04f", 0x080000, 0x06a83f3a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmne.05b", 0x080000, 0x87b0ed0f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06a", 0x080000, 0x1b86a328, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07a", 0x080000, 0x2c142a44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08a", 0x080000, 0xf712d44f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09a", 0x080000, 0x9241cae8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmne.10b", 0x080000, 0xcb36b0a4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcota.key", 0x000014, 0x6665bbfb, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcota) -STD_ROM_FN(Xmcota) - -static struct BurnRomInfo Xmcotar1RomDesc[] = { - { "xmne.03e", 0x080000, 0xa9a09b09, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmne.04e", 0x080000, 0x52fa2106, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05a", 0x080000, 0xac0d7759, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06a", 0x080000, 0x1b86a328, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07a", 0x080000, 0x2c142a44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08a", 0x080000, 0xf712d44f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09a", 0x080000, 0x9241cae8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10a", 0x080000, 0x53c0eab9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcota.key", 0x000014, 0x6665bbfb, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotar1) -STD_ROM_FN(Xmcotar1) - -static struct BurnRomInfo XmcotaaRomDesc[] = { - { "xmna.03e", 0x080000, 0xf1ade6e7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmna.04e", 0x080000, 0xb5a8843d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05a", 0x080000, 0xac0d7759, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06a", 0x080000, 0x1b86a328, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07a", 0x080000, 0x2c142a44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08a", 0x080000, 0xf712d44f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09a", 0x080000, 0x9241cae8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10a", 0x080000, 0x53c0eab9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotaa.key", 0x000014, 0x3fdd2d42, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotaa) -STD_ROM_FN(Xmcotaa) - -static struct BurnRomInfo Xmcotaar1RomDesc[] = { - { "xmna.03a", 0x080000, 0x7df8b27e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmna.04a", 0x080000, 0xb44e30a7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05", 0x080000, 0xc3ed62a2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06", 0x080000, 0xf03c52e1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07", 0x080000, 0x325626b1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08", 0x080000, 0x7194ea10, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09", 0x080000, 0xae946df3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10", 0x080000, 0x32a6be1d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotaa.key", 0x000014, 0x3fdd2d42, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotaar1) -STD_ROM_FN(Xmcotaar1) - -static struct BurnRomInfo XmcotahRomDesc[] = { - { "xmnh.03f", 0x080000, 0xe4b85a90, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmnh.04f", 0x080000, 0x7dfe1406, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmnh.05b", 0x080000, 0x87b0ed0f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06a", 0x080000, 0x1b86a328, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07a", 0x080000, 0x2c142a44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08a", 0x080000, 0xf712d44f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09a", 0x080000, 0x9241cae8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmnh.10b", 0x080000, 0xcb36b0a4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotah.key", 0x000014, 0xc9a45a5a, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotah) -STD_ROM_FN(Xmcotah) - -static struct BurnRomInfo Xmcotahr1RomDesc[] = { - { "xmnh.03d", 0x080000, 0x63b0a84f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmnh.04d", 0x080000, 0xb1b9b727, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05a", 0x080000, 0xac0d7759, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06a", 0x080000, 0x1b86a328, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07a", 0x080000, 0x2c142a44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08a", 0x080000, 0xf712d44f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09a", 0x080000, 0x9241cae8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10a", 0x080000, 0x53c0eab9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotah.key", 0x000014, 0xc9a45a5a, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotahr1) -STD_ROM_FN(Xmcotahr1) - -static struct BurnRomInfo XmcotajRomDesc[] = { - { "xmnj.03e", 0x080000, 0x0df29f5f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmnj.04e", 0x080000, 0x4a65833b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05a", 0x080000, 0xac0d7759, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06a", 0x080000, 0x1b86a328, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07a", 0x080000, 0x2c142a44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08a", 0x080000, 0xf712d44f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09a", 0x080000, 0x9241cae8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10a", 0x080000, 0x53c0eab9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotaj.key", 0x000014, 0xd278b4ac, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotaj) -STD_ROM_FN(Xmcotaj) - -static struct BurnRomInfo Xmcotaj1RomDesc[] = { - { "xmnj.03d", 0x080000, 0x79086d62, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmnj.04d", 0x080000, 0x38eed613, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05", 0x080000, 0xc3ed62a2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06", 0x080000, 0xf03c52e1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07", 0x080000, 0x325626b1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08", 0x080000, 0x7194ea10, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09", 0x080000, 0xae946df3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10", 0x080000, 0x32a6be1d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotaj.key", 0x000014, 0xd278b4ac, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotaj1) -STD_ROM_FN(Xmcotaj1) - -static struct BurnRomInfo Xmcotaj2RomDesc[] = { - { "xmnj.03b", 0x080000, 0xc8175fb3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmnj.04b", 0x080000, 0x54b3fba3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05", 0x080000, 0xc3ed62a2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06", 0x080000, 0xf03c52e1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07", 0x080000, 0x325626b1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08", 0x080000, 0x7194ea10, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09", 0x080000, 0xae946df3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10", 0x080000, 0x32a6be1d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotaj.key", 0x000014, 0xd278b4ac, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotaj2) -STD_ROM_FN(Xmcotaj2) - -static struct BurnRomInfo Xmcotaj3RomDesc[] = { - { "xmnj.03a", 0x080000, 0x00761611, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmnj.04a", 0x080000, 0x614d3f60, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05", 0x080000, 0xc3ed62a2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06", 0x080000, 0xf03c52e1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07", 0x080000, 0x325626b1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08", 0x080000, 0x7194ea10, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09", 0x080000, 0xae946df3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10", 0x080000, 0x32a6be1d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotaj.key", 0x000014, 0xd278b4ac, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotaj3) -STD_ROM_FN(Xmcotaj3) - -static struct BurnRomInfo XmcotajrRomDesc[] = { - { "xmno.03a", 0x080000, 0x7ab19acf, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmno.04a", 0x080000, 0x7615dd21, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmno.05a", 0x080000, 0x0303d672, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmno.06a", 0x080000, 0x332839a5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmno.07", 0x080000, 0x6255e8d5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmno.08", 0x080000, 0xb8ebe77c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmno.09", 0x080000, 0x5440d950, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmno.10a", 0x080000, 0xb8296966, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01", 0x020000, 0x7178336e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02", 0x020000, 0x0ec58501, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotaj.key", 0x000014, 0xd278b4ac, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotajr) -STD_ROM_FN(Xmcotajr) - -static struct BurnRomInfo XmcotauRomDesc[] = { - { "xmnu.03e", 0x080000, 0x0bafeb0e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmnu.04e", 0x080000, 0xc29bdae3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05a", 0x080000, 0xac0d7759, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06a", 0x080000, 0x1b86a328, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07a", 0x080000, 0x2c142a44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08a", 0x080000, 0xf712d44f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09a", 0x080000, 0x9241cae8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10a", 0x080000, 0x53c0eab9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "xmcotau.key", 0x000014, 0x623d3357, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotau) -STD_ROM_FN(Xmcotau) - -static struct BurnRomInfo XmvsfRomDesc[] = { - { "xvse.03f", 0x080000, 0xdb06413f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvse.04f", 0x080000, 0xef015aef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsf.key", 0x000014, 0xd5c07311, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsf) -STD_ROM_FN(Xmvsf) - -static struct BurnRomInfo Xmvsfr1RomDesc[] = { - { "xvse.03d", 0x080000, 0x5ae5bd3b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvse.04d", 0x080000, 0x5eb9c02e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsf.key", 0x000014, 0xd5c07311, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfr1) -STD_ROM_FN(Xmvsfr1) - -static struct BurnRomInfo XmvsfaRomDesc[] = { - { "xvsa.03k", 0x080000, 0xd0cca7a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsa.04k", 0x080000, 0x8c8e76fd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfa.key", 0x000014, 0x44941468, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfa) -STD_ROM_FN(Xmvsfa) - -static struct BurnRomInfo Xmvsfar1RomDesc[] = { - { "xvsa.03", 0x080000, 0x520054df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // Missing revision letter - { "xvsa.04", 0x080000, 0x13086e55, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // Missing revision letter - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfa.key", 0x000014, 0x44941468, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfar1) -STD_ROM_FN(Xmvsfar1) - -static struct BurnRomInfo Xmvsfar2RomDesc[] = { - { "xvsa.03e", 0x080000, 0x9bdde21c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsa.04e", 0x080000, 0x33300edf, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfa.key", 0x000014, 0x44941468, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfar2) -STD_ROM_FN(Xmvsfar2) - -static struct BurnRomInfo Xmvsfar3RomDesc[] = { - { "xvsa.03d", 0x080000, 0x2b164fd7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsa.04d", 0x080000, 0x2d32f039, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvsa.02", 0x020000, 0x19272e4c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfa.key", 0x000014, 0x44941468, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfar3) -STD_ROM_FN(Xmvsfar3) - -static struct BurnRomInfo XmvsfbRomDesc[] = { - { "xvsb.03h", 0x080000, 0x05baccca, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsb.04h", 0x080000, 0xe350c755, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfb.key", 0x000014, 0xf0384798, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfb) -STD_ROM_FN(Xmvsfb) - -static struct BurnRomInfo XmvsfhRomDesc[] = { - { "xvsh.03a", 0x080000, 0xd4fffb04, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsh.04a", 0x080000, 0x1b4ea638, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfh.key", 0x000014, 0xf632a36b, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfh) -STD_ROM_FN(Xmvsfh) - -static struct BurnRomInfo XmvsfjRomDesc[] = { - { "xvsj.03k", 0x080000, 0x2a167526, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsj.04k", 0x080000, 0xd993436b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfj.key", 0x000014, 0x87576cda, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfj) -STD_ROM_FN(Xmvsfj) - -static struct BurnRomInfo Xmvsfjr1RomDesc[] = { - { "xvsj.03i", 0x080000, 0xef24da96, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsj.04i", 0x080000, 0x70a59b35, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfj.key", 0x000014, 0x87576cda, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfjr1) -STD_ROM_FN(Xmvsfjr1) - -static struct BurnRomInfo Xmvsfjr2RomDesc[] = { - { "xvsj.03d", 0x080000, 0xbeb81de9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsj.04d", 0x080000, 0x23d11271, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfj.key", 0x000014, 0x87576cda, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfjr2) -STD_ROM_FN(Xmvsfjr2) - -static struct BurnRomInfo Xmvsfjr3RomDesc[] = { - { "xvsj.03c", 0x080000, 0x180656a1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsj.04c", 0x080000, 0x5832811c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05", 0x080000, 0x030e0e1e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06", 0x080000, 0x5d04a8ff, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfj.key", 0x000014, 0x87576cda, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfjr3) -STD_ROM_FN(Xmvsfjr3) - -static struct BurnRomInfo XmvsfuRomDesc[] = { - { "xvsu.03k", 0x080000, 0x8739ef61, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsu.04k", 0x080000, 0xe11d35c1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfu.key", 0x000014, 0xeca13458, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfu) -STD_ROM_FN(Xmvsfu) - -static struct BurnRomInfo Xmvsfur1RomDesc[] = { - // US version "I" of Xmen vs Street Fighters has been dumped. - // It is identical to US version "H" but with different labels. -// { "xvsu.03i", 0x080000, 0x5481155a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, -// { "xvsu.04i", 0x080000, 0x1e236388, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, -// { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, -// { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, -// { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, -// { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, -// { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvsu.03h", 0x080000, 0x5481155a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsu.04h", 0x080000, 0x1e236388, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfu.key", 0x000014, 0xeca13458, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfur1) -STD_ROM_FN(Xmvsfur1) - -static struct BurnRomInfo Xmvsfur2RomDesc[] = { - { "xvsu.03d", 0x080000, 0xbd8b152f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsu.04d", 0x080000, 0x7c7d1da3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "xmvsfu.key", 0x000014, 0xeca13458, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfur2) -STD_ROM_FN(Xmvsfur2) - -// Driver functions - -static INT32 MmatrixInit() -{ - Mmatrix = 1; - - return Cps2Init(); -} - -static INT32 MvscjsingInit() -{ - // The case has a volume knob, and the digital switches are missing and the slider is missing from the test screen - Cps2DisableDigitalVolume = 1; - - return Cps2Init(); -} - -static INT32 Pzloop2Init() -{ - Pzloop2 = 1; - - return Cps2Init(); -} - -static INT32 Sfa2Init() -{ - Sfa2ObjHack = 1; - - return Cps2Init(); -} - -static INT32 Ssf2Init() -{ - INT32 nRet = Cps2Init(); - - nCpsGfxScroll[3] = 0; - - return nRet; -} - -static INT32 Ssf2tbInit() -{ - Ssf2tb = 1; - - return Ssf2Init(); -} - -static INT32 Ssf2tInit() -{ - INT32 nRet; - - Ssf2t = 1; - - nRet = Cps2Init(); - - nCpsGfxScroll[3] = 0; - - return nRet; -} - -static INT32 XmcotaInit() -{ - Xmcota = 1; - - return Cps2Init(); -} - -static INT32 DrvExit() -{ - Pzloop2 = 0; - Sfa2ObjHack = 0; - Ssf2t = 0; - Ssf2tb = 0; - Xmcota = 0; - Mmatrix = 0; - - Cps2Volume = 39; - Cps2DisableDigitalVolume = 0; - - CpsLayer1XOffs = 0; - CpsLayer2XOffs = 0; - CpsLayer3XOffs = 0; - CpsLayer1YOffs = 0; - CpsLayer2YOffs = 0; - CpsLayer3YOffs = 0; - - return CpsExit(); -} - -// Driver Definitions - -struct BurnDriver BurnDrvCps19xx = { - "19xx", NULL, NULL, NULL, "1995", - "19XX - the war against destiny (951207 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, NinexxRomInfo, NinexxRomName, NULL, NULL, NineXXInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps19xxa = { - "19xxa", "19xx", NULL, NULL, "1995", - "19XX - the war against destiny (960104 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, NinexxaRomInfo, NinexxaRomName, NULL, NULL, NineXXInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps19xxar1 = { - "19xxar1", "19xx", NULL, NULL, "1995", - "19XX - the war against destiny (951207 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, Ninexxar1RomInfo, Ninexxar1RomName, NULL, NULL, NineXXInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps19xxb = { - "19xxb", "19xx", NULL, NULL, "1995", - "19XX - the war against destiny (951218 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, NinexxbRomInfo, NinexxbRomName, NULL, NULL, NineXXInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps19xxh = { - "19xxh", "19xx", NULL, NULL, "1995", - "19XX - the war against destiny (951218 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, NinexxhRomInfo, NinexxhRomName, NULL, NULL, NineXXInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps19xxj = { - "19xxj", "19xx", NULL, NULL, "1996", - "19XX - the war against destiny (960104 Japan, yellow case)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, NinexxjRomInfo, NinexxjRomName, NULL, NULL, NineXXInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps19xxjr1 = { - "19xxjr1", "19xx", NULL, NULL, "1995", - "19XX - the war against destiny (951225 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, Ninexxjr1RomInfo, Ninexxjr1RomName, NULL, NULL, NineXXInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps19xxjr2 = { - "19xxjr2", "19xx", NULL, NULL, "1995", - "19XX - the war against destiny (951207 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, Ninexxjr2RomInfo, Ninexxjr2RomName, NULL, NULL, NineXXInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps1944 = { - "1944", NULL, NULL, NULL, "2000", - "1944 - the loop master (000620 USA)\0", NULL, "Capcom / 8ing / Raizing", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, Nine44RomInfo, Nine44RomName, NULL, NULL, Nine44InputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCps1944j = { - "1944j", "1944", NULL, NULL, "2000", - "1944 - the loop master (000620 Japan)\0", NULL, "Capcom / 8ing / Raizing", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, Nine44jRomInfo, Nine44jRomName, NULL, NULL, Nine44InputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsArmwar = { - "armwar", NULL, NULL, NULL, "1994", - "Armored Warriors (941024 Europe)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, ArmwarRomInfo, ArmwarRomName, NULL, NULL, ArmwarInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsArmwarr1 = { - "armwarr1", "armwar", NULL, NULL, "1994", - "Armored Warriors (941011 Europe)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Armwarr1RomInfo, Armwarr1RomName, NULL, NULL, ArmwarInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsArmwaru = { - "armwaru", "armwar", NULL, NULL, "1994", - "Armored Warriors (941024 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, ArmwaruRomInfo, ArmwaruRomName, NULL, NULL, ArmwarInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsArmwaru1 = { - "armwaru1", "armwar", NULL, NULL, "1994", - "Armored Warriors (940920 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Armwaru1RomInfo, Armwaru1RomName, NULL, NULL, ArmwarInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPgear = { - "pgear", "armwar", NULL, NULL, "1994", - "Powered Gear - strategic variant armor equipment (941024 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, PgearRomInfo, PgearRomName, NULL, NULL, ArmwarInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPgearr1 = { - "pgearr1", "armwar", NULL, NULL, "1994", - "Powered Gear - strategic variant armor equipment (940916 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Pgearr1RomInfo, Pgearr1RomName, NULL, NULL, ArmwarInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsArmwara = { - "armwara", "armwar", NULL, NULL, "1994", - "Armored Warriors (941024 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, ArmwaraRomInfo, ArmwaraRomName, NULL, NULL, ArmwarInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsArmwarar1 = { - "armwarar1", "armwar", NULL, NULL, "1994", - "Armored Warriors (940920 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Armwarar1RomInfo, Armwarar1RomName, NULL, NULL, ArmwarInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsAvsp = { - "avsp", NULL, NULL, NULL, "1994", - "Alien vs Predator (940520 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, AvspRomInfo, AvspRomName, NULL, NULL, AvspInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsAvspa = { - "avspa", "avsp", NULL, NULL, "1994", - "Alien vs Predator (940520 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, AvspaRomInfo, AvspaRomName, NULL, NULL, AvspInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsAvsph = { - "avsph", "avsp", NULL, NULL, "1994", - "Alien vs Predator (940520 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, AvsphRomInfo, AvsphRomName, NULL, NULL, AvspInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsAvspj = { - "avspj", "avsp", NULL, NULL, "1994", - "Alien vs Predator (940520 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, AvspjRomInfo, AvspjRomName, NULL, NULL, AvspInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsAvspu = { - "avspu", "avsp", NULL, NULL, "1994", - "Alien vs Predator (940520 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, AvspuRomInfo, AvspuRomName, NULL, NULL, AvspInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsBatcir = { - "batcir", NULL, NULL, NULL, "1997", - "Battle Circuit (970319 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, BatcirRomInfo, BatcirRomName, NULL, NULL, BatcirInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsBatcira = { - "batcira", "batcir", NULL, NULL, "1997", - "Battle Circuit (970319 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, BatciraRomInfo, BatciraRomName, NULL, NULL, BatcirInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsBatcirj = { - "batcirj", "batcir", NULL, NULL, "1997", - "Battle Circuit (970319 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, BatcirjRomInfo, BatcirjRomName, NULL, NULL, BatcirInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsChoko = { - "choko", NULL, NULL, NULL, "2001", - "Choko (010820 Japan)\0", NULL, "Mitchell", "CPS2", - L"\u9577\u6C5F (Choko 010820 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_PUZZLE, 0, - NULL, ChokoRomInfo, ChokoRomName, NULL, NULL, ChokoInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCsclub = { - "csclub", NULL, NULL, NULL, "1997", - "Capcom Sports Club (971017 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_SPORTSMISC, 0, - NULL, CsclubRomInfo, CsclubRomName, NULL, NULL, CsclubInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCsclub1 = { - "csclub1", "csclub", NULL, NULL, "1997", - "Capcom Sports Club (970722 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_SPORTSMISC, 0, - NULL, Csclub1RomInfo, Csclub1RomName, NULL, NULL, CsclubInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCscluba = { - "cscluba", "csclub", NULL, NULL, "1997", - "Capcom Sports Club (970722 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_SPORTSMISC, 0, - NULL, CsclubaRomInfo, CsclubaRomName, NULL, NULL, CsclubInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCsclubh = { - "csclubh", "csclub", NULL, NULL, "1997", - "Capcom Sports Club (970722 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_SPORTSMISC, 0, - NULL, CsclubhRomInfo, CsclubhRomName, NULL, NULL, CsclubInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCsclubj = { - "csclubj", "csclub", NULL, NULL, "1997", - "Capcom Sports Club (970722 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_SPORTSMISC, 0, - NULL, CsclubjRomInfo, CsclubjRomName, NULL, NULL, CsclubInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCsclubjy = { - "csclubjy", "csclub", NULL, NULL, "1997", - "Capcom Sports Club (970722 Japan, yellow case)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_SPORTSMISC, 0, - NULL, CsclubjyRomInfo, CsclubjyRomName, NULL, NULL, CsclubInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCybots = { - "cybots", NULL, NULL, NULL, "1995", - "Cyberbots - fullmetal madness (950424 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, CybotsRomInfo, CybotsRomName, NULL, NULL, CybotsInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCybotsj = { - "cybotsj", "cybots", NULL, NULL, "1995", - "Cyberbots - fullmetal madness (950420 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, CybotsjRomInfo, CybotsjRomName, NULL, NULL, CybotsInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCybotsu = { - "cybotsu", "cybots", NULL, NULL, "1995", - "Cyberbots - fullmetal madness (950424 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, CybotsuRomInfo, CybotsuRomName, NULL, NULL, CybotsInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsom = { - "ddsom", NULL, NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960619 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdsomRomInfo, DdsomRomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomr1 = { - "ddsomr1", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960223 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddsomr1RomInfo, Ddsomr1RomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomr2 = { - "ddsomr2", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960209 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddsomr2RomInfo, Ddsomr2RomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomr3 = { - "ddsomr3", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960208 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddsomr3RomInfo, Ddsomr3RomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsoma = { - "ddsoma", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960619 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdsomaRomInfo, DdsomaRomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomar1 = { - "ddsomar1", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960208 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddsomar1RomInfo, Ddsomar1RomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomb = { - "ddsomb", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960223 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdsombRomInfo, DdsombRomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomh = { - "ddsomh", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960223 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdsomhRomInfo, DdsomhRomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomj = { - "ddsomj", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960619 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdsomjRomInfo, DdsomjRomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomjr1 = { - "ddsomjr1", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960206 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddsomjr1RomInfo, Ddsomjr1RomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomjr2 = { - "ddsomjr2", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960223 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddsomjr2RomInfo, Ddsomjr2RomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomu = { - "ddsomu", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960619 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdsomuRomInfo, DdsomuRomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomur1 = { - "ddsomur1", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960209 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddsomur1RomInfo, Ddsomur1RomName, NULL, NULL, DdsomInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtod = { - "ddtod", NULL, NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940412 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdtodRomInfo, DdtodRomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodr1 = { - "ddtodr1", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940113 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddtodr1RomInfo, Ddtodr1RomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtoda = { - "ddtoda", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940412 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdtodaRomInfo, DdtodaRomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodar1 = { - "ddtodar1", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940113 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddtodar1RomInfo, Ddtodar1RomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodh = { - "ddtodh", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940412 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdtodhRomInfo, DdtodhRomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodhr1 = { - "ddtodhr1", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940125 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddtodhr1RomInfo, Ddtodhr1RomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodhr2 = { - "ddtodhr2", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940113 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddtodhr2RomInfo, Ddtodhr2RomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodj = { - "ddtodj", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940412 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdtodjRomInfo, DdtodjRomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodjr1 = { - "ddtodjr1", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940125 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddtodjr1RomInfo, Ddtodjr1RomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodjr2 = { - "ddtodjr2", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940113 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddtodjr2RomInfo, Ddtodjr2RomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodu = { - "ddtodu", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940125 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdtoduRomInfo, DdtoduRomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodur1 = { - "ddtodur1", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940113 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Ddtodur1RomInfo, Ddtodur1RomName, NULL, NULL, DdtodInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDimahoo = { - "dimahoo", NULL, NULL, NULL, "2000", - "Dimahoo (000121 Euro)\0", NULL, "8ing / Raizing / Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, DimahooRomInfo, DimahooRomName, NULL, NULL, DimahooInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsGreatMahouDaiJ = { - "gmahou", "dimahoo", NULL, NULL, "2000", - "Great Mahou Daisakusen (000121 Japan)\0", NULL, "8ing / Raizing / Capcom", "CPS2", - L"\u30B0\u30EC\u30FC\u30C8\u9B54\u6CD5\u5927\u4F5C\u6226 (Great Mahou Daisakusen 000121 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, GmdjRomInfo, GmdjRomName, NULL, NULL, DimahooInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsDimahoou = { - "dimahoou", "dimahoo", NULL, NULL, "2000", - "Dimahoo (000121 USA)\0", NULL, "8ing / Raizing / Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, DimahoouRomInfo, DimahoouRomName, NULL, NULL, DimahooInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsDstlk = { - "dstlk", NULL, NULL, NULL, "1994", - "Darkstalkers - the night warriors (940705 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, DstlkRomInfo, DstlkRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDstlka = { - "dstlka", "dstlk", NULL, NULL, "1994", - "Darkstalkers - the night warriors (940705 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, DstlkaRomInfo, DstlkaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDstlkh = { - "dstlkh", "dstlk", NULL, NULL, "1994", - "Darkstalkers - the night warriors (940818 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, DstlkhRomInfo, DstlkhRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDstlku = { - "dstlku", "dstlk", NULL, NULL, "1994", - "Darkstalkers - the night warriors (940818 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, DstlkuRomInfo, DstlkuRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDstlkur1 = { - "dstlkur1", "dstlk", NULL, NULL, "1994", - "Darkstalkers - the night warriors (940705 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Dstlkur1RomInfo, Dstlkur1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVampj = { - "vampj", "dstlk", NULL, NULL, "1994", - "Vampire - the night warriors (940705 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, VampjRomInfo, VampjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVampja = { - "vampja", "dstlk", NULL, NULL, "1994", - "Vampire - the night warriors (940705 Japan, alt)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, VampjaRomInfo, VampjaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVampjr1 = { - "vampjr1", "dstlk", NULL, NULL, "1994", - "Vampire - the night warriors (940630 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Vampjr1RomInfo, Vampjr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsEcofghtr = { - "ecofghtr", NULL, NULL, NULL, "1993", - "Eco Fighters (931203 etc)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_HORSHOOT, 0, - NULL, EcofghtrRomInfo, EcofghtrRomName, NULL, NULL, EcofghtrInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsEcofghtra = { - "ecofghtra", "ecofghtr", NULL, NULL, "1993", - "Eco Fighters (931203 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_HORSHOOT, 0, - NULL, EcofghtraRomInfo, EcofghtraRomName, NULL, NULL, EcofghtrInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsEcofghtrh = { - "ecofghtrh", "ecofghtr", NULL, NULL, "1993", - "Eco Fighters (931203 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_HORSHOOT, 0, - NULL, EcofghtrhRomInfo, EcofghtrhRomName, NULL, NULL, EcofghtrInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsEcofghtru = { - "ecofghtru", "ecofghtr", NULL, NULL, "1993", - "Eco Fighters (940215 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_HORSHOOT, 0, - NULL, EcofghtruRomInfo, EcofghtruRomName, NULL, NULL, EcofghtrInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsEcofghtru1 = { - "ecofghtru1", "ecofghtr", NULL, NULL, "1993", - "Eco Fighters (931203 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_HORSHOOT, 0, - NULL, Ecofghtru1RomInfo, Ecofghtru1RomName, NULL, NULL, EcofghtrInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsUecology = { - "uecology", "ecofghtr", NULL, NULL, "1993", - "Ultimate Ecology (931203 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_HORSHOOT, 0, - NULL, UecologyRomInfo, UecologyRomName, NULL, NULL, EcofghtrInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGigawing = { - "gigawing", NULL, NULL, NULL, "1999", - "Giga Wing (990222 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, GigawingRomInfo, GigawingRomName, NULL, NULL, GigawingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGigawinga = { - "gigawinga", "gigawing", NULL, NULL, "1999", - "Giga Wing (990222 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, GigawingaRomInfo, GigawingaRomName, NULL, NULL, GigawingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGigawingb = { - "gigawingb", "gigawing", NULL, NULL, "1999", - "Giga Wing (990222 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, GigawingbRomInfo, GigawingbRomName, NULL, NULL, GigawingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGigawingh = { - "gigawingh", "gigawing", NULL, NULL, "1999", - "Giga Wing (990222 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, GigawinghRomInfo, GigawinghRomName, NULL, NULL, GigawingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGigawingj = { - "gigawingj", "gigawing", NULL, NULL, "1999", - "Giga Wing (990223 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, GigawingjRomInfo, GigawingjRomName, NULL, NULL, GigawingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsHsf2 = { - "hsf2", NULL, NULL, NULL, "2004", - "Hyper Street Fighter II: The Anniversary Edition (040202 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Hsf2RomInfo, Hsf2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsHsf2a = { - "hsf2a", "hsf2", NULL, NULL, "2004", - "Hyper Street Fighter II: The Anniversary Edition (040202 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Hsf2aRomInfo, Hsf2aRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsHsf2j = { - "hsf2j", "hsf2", NULL, NULL, "2004", - "Hyper Street Fighter II: The Anniversary Edition (040202 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Hsf2jRomInfo, Hsf2jRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsHsf2j1 = { - "hsf2j1", "hsf2", NULL, NULL, "2004", - "Hyper Street Fighter II: The Anniversary Edition (031222 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Hsf2j1RomInfo, Hsf2j1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsJyangoku = { - "jyangoku", NULL, NULL, NULL, "1999", - "Jyangokushi -Haoh no Saihai- (990527 Japan)\0", NULL, "Mitchell", "CPS2", - L"\u96C0\u570B\u5FD7 -\u8987\u738B\u306E\u91C7\u724C- (Jyangokushi 990527 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_MAHJONG, 0, - NULL, JyangokuRomInfo, JyangokuRomName, NULL, NULL, JyangokuInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMegaman2 = { - "megaman2", NULL, NULL, NULL, "1996", - "Mega Man 2 - the power fighters (960708 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Megaman2RomInfo, Megaman2RomName, NULL, NULL, Megaman2InputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000 ,384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMegaman2a = { - "megaman2a", "megaman2", NULL, NULL, "1996", - "Mega Man 2 - the power fighters (960708 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Megaman2aRomInfo, Megaman2aRomName, NULL, NULL, Megaman2InputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000 ,384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMegaman2h = { - "megaman2h", "megaman2", NULL, NULL, "1996", - "Mega Man 2 - the power fighters (960712 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Megaman2hRomInfo, Megaman2hRomName, NULL, NULL, Megaman2InputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000 ,384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsRockman2j = { - "rockman2j", "megaman2", NULL, NULL, "1996", - "Rockman 2 - the power fighters (960708 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Rockman2jRomInfo, Rockman2jRomName, NULL, NULL, Megaman2InputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMmancp2u = { - "mmancp2u", "megaman", NULL, NULL, "1995", - "Mega Man - The Power Battle (951006 USA, SAMPLE Version)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Mmancp2uRomInfo, Mmancp2uRomName, NULL, NULL, Mmancp2uInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMmancp2ur1 = { - "mmancp2ur1", "megaman", NULL, NULL, "1995", - "Mega Man - The Power Battle (950926 USA, SAMPLE Version)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Mmancp2ur1RomInfo, Mmancp2ur1RomName, NULL, NULL, Mmancp2uInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsRmancp2j = { - "rmancp2j", "megaman", NULL, NULL, "1999", - "Rockman: The Power Battle (950922 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Rmancp2jRomInfo, Rmancp2jRomName, NULL, NULL, Mmancp2uInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMarsMatrix = { - "mmatrix", NULL, NULL, NULL, "2000", - "Mars Matrix (000412 USA)\0", NULL, "Capcom / Takumi", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, MmatrixRomInfo, MmatrixRomName, NULL, NULL, MmatrixInputInfo, NULL, - MmatrixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMarsMatrixJ = { - "mmatrixj", "mmatrix", NULL, NULL, "2000", - "Mars Matrix (000412 Japan)\0", NULL, "Capcom / Takumi", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, MmatrixjRomInfo, MmatrixjRomName, NULL, NULL, MmatrixInputInfo, NULL, - MmatrixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMPang = { - "mpang", NULL, NULL, NULL, "2000", - "Mighty! Pang (001010 Euro)\0", NULL, "Mitchell", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_PUZZLE, 0, - NULL, MpangRomInfo, MpangRomName, NULL, NULL, MpangInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMPangr1 = { - "mpangr1", "mpang", NULL, NULL, "2000", - "Mighty! Pang (000925 Euro)\0", NULL, "Mitchell", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_PUZZLE, 0, - NULL, Mpangr1RomInfo, Mpangr1RomName, NULL, NULL, MpangInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMPangu = { - "mpangu", "mpang", NULL, NULL, "2000", - "Mighty! Pang (001010 USA)\0", NULL, "Mitchell", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_PUZZLE, 0, - NULL, MpanguRomInfo, MpanguRomName, NULL, NULL, MpangInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMPangj = { - "mpangj", "mpang", NULL, NULL, "2000", - "Mighty! Pang (001011 Japan)\0", NULL, "Mitchell", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_PUZZLE, 0, - NULL, MpangjRomInfo, MpangjRomName, NULL, NULL, MpangInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMsh = { - "msh", NULL, NULL, NULL, "1995", - "Marvel Super Heroes (951024 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, MshRomInfo, MshRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMsha = { - "msha", "msh", NULL, NULL, "1995", - "Marvel Super Heroes (951024 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, MshaRomInfo, MshaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshb = { - "mshb", "msh", NULL, NULL, "1995", - "Marvel Super Heroes (951117 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, MshbRomInfo, MshbRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshh = { - "mshh", "msh", NULL, NULL, "1995", - "Marvel Super Heroes (951117 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, MshhRomInfo, MshhRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshj = { - "mshj", "msh", NULL, NULL, "1995", - "Marvel Super Heroes (951117 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, MshjRomInfo, MshjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshjr1 = { - "mshjr1", "msh", NULL, NULL, "1995", - "Marvel Super Heroes (951024 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Mshjr1RomInfo, Mshjr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshu = { - "mshu", "msh", NULL, NULL, "1995", - "Marvel Super Heroes (951024 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, MshuRomInfo, MshuRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsf = { - "mshvsf", NULL, NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970625 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MshvsfRomInfo, MshvsfRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfa = { - "mshvsfa", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970625 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MshvsfaRomInfo, MshvsfaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfa1 = { - "mshvsfa1", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970620 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mshvsfa1RomInfo, Mshvsfa1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfb = { - "mshvsfb", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970827 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MshvsfbRomInfo, MshvsfbRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfb1 = { - "mshvsfb1", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970625 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mshvsfb1RomInfo, Mshvsfb1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfh = { - "mshvsfh", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970625 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MshvsfhRomInfo, MshvsfhRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfj = { - "mshvsfj", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970707 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MshvsfjRomInfo, MshvsfjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfj1 = { - "mshvsfj1", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970702 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mshvsfj1RomInfo, Mshvsfj1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfj2 = { - "mshvsfj2", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970625 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mshvsfj2RomInfo, Mshvsfj2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfu = { - "mshvsfu", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970827 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MshvsfuRomInfo, MshvsfuRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfu1 = { - "mshvsfu1", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970625 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mshvsfu1RomInfo, Mshvsfu1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvsc = { - "mvsc", NULL, NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980123 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MvscRomInfo, MvscRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvscr1 = { - "mvscr1", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980112 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mvscr1RomInfo, Mvscr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvsca = { - "mvsca", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980123 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MvscaRomInfo, MvscaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvscar1 = { - "mvscar1", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980112 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mvscar1RomInfo, Mvscar1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvscb = { - "mvscb", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980123 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MvscbRomInfo, MvscbRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvsch = { - "mvsch", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980123 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MvschRomInfo, MvschRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvscj = { - "mvscj", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980123 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MvscjRomInfo, MvscjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvscjr1 = { - "mvscjr1", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980112 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mvscjr1RomInfo, Mvscjr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvscu = { - "mvscu", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980123 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MvscuRomInfo, MvscuRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvscur1 = { - "mvscur1", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (971222 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mvscur1RomInfo, Mvscur1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvscjsing = { - "mvscjsing", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980123 Japan, single PCB)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MvscjsingRomInfo, MvscjsingRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - MvscjsingInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsNwarr = { - "nwarr", NULL, NULL, NULL, "1995", - "Night Warriors - darkstalkers' revenge (950316 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, NwarrRomInfo, NwarrRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsNwarra = { - "nwarra", "nwarr", NULL, NULL, "1995", - "Night Warriors - darkstalkers' revenge (950302 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, NwarraRomInfo, NwarraRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsNwarrb = { - "nwarrb", "nwarr", NULL, NULL, "1995", - "Night Warriors - darkstalkers' revenge (950403 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, NwarrbRomInfo, NwarrbRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsNwarrh = { - "nwarrh", "nwarr", NULL, NULL, "1995", - "Night Warriors - darkstalkers' revenge (950403 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, NwarrhRomInfo, NwarrhRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsNwarru = { - "nwarru", "nwarr", NULL, NULL, "1995", - "Night Warriors - darkstalkers' revenge (950406 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, NwarruRomInfo, NwarruRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVhuntj = { - "vhuntj", "nwarr", NULL, NULL, "1995", - "Vampire Hunter - darkstalkers' revenge (950316 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, VhuntjRomInfo, VhuntjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVhuntjr1s = { - "vhuntjr1s", "nwarr", NULL, NULL, "1995", - "Vampire Hunter - darkstalkers' revenge (950307 Japan stop version)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Vhuntjr1sRomInfo, Vhuntjr1sRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVhuntjr1 = { - "vhuntjr1", "nwarr", NULL, NULL, "1995", - "Vampire Hunter - darkstalkers' revenge (950307 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Vhuntjr1RomInfo, Vhuntjr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVhuntjr2 = { - "vhuntjr2", "nwarr", NULL, NULL, "1995", - "Vampire Hunter - darkstalkers' revenge (950302 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Vhuntjr2RomInfo, Vhuntjr2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsProgear = { - "progear", NULL, NULL, NULL, "2001", - "Progear (010117 USA)\0", NULL, "Capcom / Cave", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_HORSHOOT, 0, - NULL, ProgearRomInfo, ProgearRomName, NULL, NULL, ProgearInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsProgeara = { - "progeara", "progear", NULL, NULL, "2001", - "Progear (010117 Asia)\0", NULL, "Capcom / Cave", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_HORSHOOT, 0, - NULL, ProgearaRomInfo, ProgearaRomName, NULL, NULL, ProgearInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsProgearj = { - "progearj", "progear", NULL, NULL, "2001", - "Progear No Arashi (010117 Japan)\0", NULL, "Capcom / Cave", "CPS2", - L"\u30D7\u30ED\u30AE\u30A2\u306E\u5D50 (Progear No Arashi 010117 Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_HORSHOOT, 0, - NULL, ProgearjRomInfo, ProgearjRomName, NULL, NULL, ProgearInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPzloop2 = { - "pzloop2", NULL, NULL, NULL, "2001", - "Puzz Loop 2 (010302 Euro)\0", NULL, "Mitchell, distritued by Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_PUZZLE, 0, - NULL, Pzloop2RomInfo, Pzloop2RomName, NULL, NULL, Pzloop2InputInfo, NULL, - Pzloop2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPzloop2j = { - "pzloop2j", "pzloop2", NULL, NULL, "2001", - "Puzz Loop 2 (010226 Japan)\0", NULL, "Mitchell, distritued by Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_PUZZLE, 0, - NULL, Pzloop2jRomInfo, Pzloop2jRomName, NULL, NULL, Pzloop2InputInfo, NULL, - Pzloop2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPzloop2jr1 = { - "pzloop2jr1", "pzloop2", NULL, NULL, "2001", - "Puzz Loop 2 (010205 Japan)\0", NULL, "Mitchell, distritued by Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_PUZZLE, 0, - NULL, Pzloop2jr1RomInfo, Pzloop2jr1RomName, NULL, NULL, Pzloop2InputInfo, NULL, - Pzloop2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsQndream = { - "qndream", NULL, NULL, NULL, "1996", - "Quiz Nanairo Dreams - nijiirochou no kiseki (nanairo dreams 960826 Japan)\0", NULL, "Capcom", "CPS2", - L"Quiz \u306A\u306A\u3044\u308D Dreams - \u8679\u8272\u753A\u306E\u5947\u8DE1 (Nanairo Dreams 960826 Japan)\0Quiz Nanairo Dreams - nijiirochou no kiseki\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_QUIZ, 0, - NULL, QndreamRomInfo, QndreamRomName, NULL, NULL, QndreamInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsRingdest = { - "ringdest", NULL, NULL, NULL, "1994", - "Ring of Destruction - slammasters II (940902 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, RingdestRomInfo, RingdestRomName, NULL, NULL, RingdestInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSmbomb = { - "smbomb", "ringdest", NULL, NULL, "1994", - "Super Muscle Bomber - the international blowout (940831 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, SmbombRomInfo, SmbombRomName, NULL, NULL, RingdestInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSmbombr1 = { - "smbombr1", "ringdest", NULL, NULL, "1994", - "Super Muscle Bomber - the international blowout (940808 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Smbombr1RomInfo, Smbombr1RomName, NULL, NULL, RingdestInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsRingdesta = { - "ringdesta", "ringdest", NULL, NULL, "1994", - "Ring of Destruction - slammasters II (940831 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, RingdestaRomInfo, RingdestaRomName, NULL, NULL, RingdestInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsRingdesth = { - "ringdesth", "ringdest", NULL, NULL, "1994", - "Ring of Destruction - slammasters II (940902 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, RingdesthRomInfo, RingdesthRomName, NULL, NULL, RingdestInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa = { - "sfa", NULL, NULL, NULL, "1995", - "Street Fighter Alpha - warriors' dreams (950727 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SfaRomInfo, SfaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfar1 = { - "sfar1", "sfa", NULL, NULL, "1995", - "Street Fighter Alpha - warriors' dreams (950718 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfar1RomInfo, Sfar1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfar2 = { - "sfar2", "sfa", NULL, NULL, "1995", - "Street Fighter Alpha - warriors' dreams (950627 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfar2RomInfo, Sfar2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfar3 = { - "sfar3", "sfa", NULL, NULL, "1995", - "Street Fighter Alpha - warriors' dreams (950605 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfar3RomInfo, Sfar3RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfau = { - "sfau", "sfa", NULL, NULL, "1995", - "Street Fighter Alpha - warriors' dreams (950627 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SfauRomInfo, SfauRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfza = { - "sfza", "sfa", NULL, NULL, "1995", - "Street Fighter Zero (950627 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SfzaRomInfo, SfzaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfzar1 = { - "sfzar1", "sfa", NULL, NULL, "1995", - "Street Fighter Zero (950605 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfzar1RomInfo, Sfzar1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfzb = { - "sfzb", "sfa", NULL, NULL, "1995", - "Street Fighter Zero (951109 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SfzbRomInfo, SfzbRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfzbr1 = { - "sfzbr1", "sfa", NULL, NULL, "1995", - "Street Fighter Zero (950727 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfzbr1RomInfo, Sfzbr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfzh = { - "sfzh", "sfa", NULL, NULL, "1995", - "Street Fighter Zero (950718 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SfzhRomInfo, SfzhRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfzhr1 = { - "sfzhr1", "sfa", NULL, NULL, "1995", - "Street Fighter Zero (950627 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfzhr1RomInfo, Sfzhr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfzj = { - "sfzj", "sfa", NULL, NULL, "1995", - "Street Fighter Zero (950727 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SfzjRomInfo, SfzjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfzjr1 = { - "sfzjr1", "sfa", NULL, NULL, "1995", - "Street Fighter Zero (950627 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfzjr1RomInfo, Sfzjr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfzjr2 = { - "sfzjr2", "sfa", NULL, NULL, "1995", - "Street Fighter Zero (950605 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfzjr2RomInfo, Sfzjr2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa2 = { - "sfa2", NULL, NULL, NULL, "1996", - "Street Fighter Alpha 2 (960229 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa2RomInfo, Sfa2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa2u = { - "sfa2u", "sfa2", NULL, NULL, "1996", - "Street Fighter Alpha 2 (960430 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa2uRomInfo, Sfa2uRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa2ur1 = { - "sfa2ur1", "sfa2", NULL, NULL, "1996", - "Street Fighter Alpha 2 (960306 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa2ur1RomInfo, Sfa2ur1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2a = { - "sfz2a", "sfa2", NULL, NULL, "1996", - "Street Fighter Zero 2 (960227 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2aRomInfo, Sfz2aRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2b = { - "sfz2b", "sfa2", NULL, NULL, "1996", - "Street Fighter Zero 2 (960531 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2bRomInfo, Sfz2bRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2br1 = { - "sfz2br1", "sfa2", NULL, NULL, "1996", - "Street Fighter Zero 2 (960304 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2br1RomInfo, Sfz2br1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2h = { - "sfz2h", "sfa2", NULL, NULL, "1996", - "Street Fighter Zero 2 (960304 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2hRomInfo, Sfz2hRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2j = { - "sfz2j", "sfa2", NULL, NULL, "1996", - "Street Fighter Zero 2 (960430 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2jRomInfo, Sfz2jRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2jr1 = { - "sfz2jr1", "sfa2", NULL, NULL, "1996", - "Street Fighter Zero 2 (960227 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2jr1RomInfo, Sfz2jr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2n = { - "sfz2n", "sfa2", NULL, NULL, "1996", - "Street Fighter Zero 2 (960229 Oceania)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2nRomInfo, Sfz2nRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2al = { - "sfz2al", NULL, NULL, NULL, "1996", - "Street Fighter Zero 2 Alpha (960826 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2alRomInfo, Sfz2alRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2alb = { - "sfz2alb", "sfz2al", NULL, NULL, "1996", - "Street Fighter Zero 2 Alpha (960813 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2albRomInfo, Sfz2albRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2alh = { - "sfz2alh", "sfz2al", NULL, NULL, "1996", - "Street Fighter Zero 2 Alpha (960813 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2alhRomInfo, Sfz2alhRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2alj = { - "sfz2alj", "sfz2al", NULL, NULL, "1996", - "Street Fighter Zero 2 Alpha (960805 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2aljRomInfo, Sfz2aljRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Sfa2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa3 = { - "sfa3", NULL, NULL, NULL, "1998", - "Street Fighter Alpha 3 (980904 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa3RomInfo, Sfa3RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa3b = { - "sfa3b", "sfa3", NULL, NULL, "1998", - "Street Fighter Alpha 3 (980629 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa3bRomInfo, Sfa3bRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa3h = { - "sfa3h", "sfa3", NULL, NULL, "1998", - "Street Fighter Alpha 3 (980904 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa3hRomInfo, Sfa3hRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa3hr1 = { - "sfa3hr1", "sfa3", NULL, NULL, "1998", - "Street Fighter Alpha 3 (980629 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa3hr1RomInfo, Sfa3hr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa3u = { - "sfa3u", "sfa3", NULL, NULL, "1998", - "Street Fighter Alpha 3 (980904 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa3uRomInfo, Sfa3uRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa3ur1 = { - "sfa3ur1", "sfa3", NULL, NULL, "1998", - "Street Fighter Alpha 3 (980629 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa3ur1RomInfo, Sfa3ur1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa3us = { - "sfa3us", "sfa3", NULL, NULL, "1998", - "Street Fighter Alpha 3 (980616 USA, SAMPLE Version)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa3usRomInfo, Sfa3usRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz3a = { - "sfz3a", "sfa3", NULL, NULL, "1998", - "Street Fighter Zero 3 (980904 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz3aRomInfo, Sfz3aRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz3ar1 = { - "sfz3ar1", "sfa3", NULL, NULL, "1998", - "Street Fighter Zero 3 (980701 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz3ar1RomInfo, Sfz3ar1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz3j = { - "sfz3j", "sfa3", NULL, NULL, "1998", - "Street Fighter Zero 3 (980904 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz3jRomInfo, Sfz3jRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz3jr1 = { - "sfz3jr1", "sfa3", NULL, NULL, "1998", - "Street Fighter Zero 3 (980727 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz3jr1RomInfo, Sfz3jr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz3jr2 = { - "sfz3jr2", "sfa3", NULL, NULL, "1998", - "Street Fighter Zero 3 (980629 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz3jr2RomInfo, Sfz3jr2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSgemf = { - "sgemf", NULL, NULL, NULL, "1997", - "Super Gem Fighter Mini Mix (970904 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SgemfRomInfo, SgemfRomName, NULL, NULL, SgemfInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsPfghtj = { - "pfghtj", "sgemf", NULL, NULL, "1997", - "Pocket Fighter (970904 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, PfghtjRomInfo, PfghtjRomName, NULL, NULL, SgemfInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSgemfa = { - "sgemfa", "sgemf", NULL, NULL, "1997", - "Super Gem Fighter Mini Mix (970904 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SgemfaRomInfo, SgemfaRomName, NULL, NULL, SgemfInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSgemfh = { - "sgemfh", "sgemf", NULL, NULL, "1997", - "Super Gem Fighter Mini Mix (970904 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SgemfhRomInfo, SgemfhRomName, NULL, NULL, SgemfInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSpf2t = { - "spf2t", NULL, NULL, NULL, "1996", - "Super Puzzle Fighter II Turbo (Super Puzzle Fighter 2 Turbo 960529 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_PUZZLE, FBF_SF, - NULL, Spf2tRomInfo, Spf2tRomName, NULL, NULL, Spf2tInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSpf2tu = { - "spf2tu", "spf2t", NULL, NULL, "1996", - "Super Puzzle Fighter II Turbo (Super Puzzle Fighter 2 Turbo 960620 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_PUZZLE, FBF_SF, - NULL, Spf2tuRomInfo, Spf2tuRomName, NULL, NULL, Spf2tInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSpf2xj = { - "spf2xj", "spf2t", NULL, NULL, "1996", - "Super Puzzle Fighter II X (Super Puzzle Fighter 2 X 960531 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_PUZZLE, FBF_SF, - NULL, Spf2xjRomInfo, Spf2xjRomName, NULL, NULL, Spf2tInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSpf2ta = { - "spf2ta", "spf2t", NULL, NULL, "1996", - "Super Puzzle Fighter II Turbo (Super Puzzle Fighter 2 Turbo 960529 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_PUZZLE, FBF_SF, - NULL, Spf2taRomInfo, Spf2taRomName, NULL, NULL, Spf2tInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSpf2th = { - "spf2th", "spf2t", NULL, NULL, "1996", - "Super Puzzle Fighter II Turbo (Super Puzzle Fighter 2 Turbo 960531 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_PUZZLE, FBF_SF, - NULL, Spf2thRomInfo, Spf2thRomName, NULL, NULL, Spf2tInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2 = { - "ssf2", NULL, NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 931005 etc)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2RomInfo, Ssf2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2r1 = { - "ssf2r1", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 930911 etc)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2r1RomInfo, Ssf2r1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2a = { - "ssf2a", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 931005 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE,2,HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2aRomInfo, Ssf2aRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2ar1 = { - "ssf2ar1", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 930914 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2ar1RomInfo, Ssf2ar1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2h = { - "ssf2h", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 930911 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE,2,HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2hRomInfo, Ssf2hRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2j = { - "ssf2j", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 931005 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2jRomInfo, Ssf2jRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2jr1 = { - "ssf2jr1", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 930911 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2jr1RomInfo, Ssf2jr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2jr2 = { - "ssf2jr2", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 930910 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2jr2RomInfo, Ssf2jr2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2u = { - "ssf2u", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 930911 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2uRomInfo, Ssf2uRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tb = { - "ssf2tb", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the tournament battle (931119 etc)\0", "Linkup feature not implemented", "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tbRomInfo, Ssf2tbRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tbInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tba = { - "ssf2tba", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the tournament battle (931005 Asia)\0", "Linkup feature not implemented", "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tbaRomInfo, Ssf2tbaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tbInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tbr1 = { - "ssf2tbr1", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the tournament battle (930911 etc)\0", "Linkup feature not implemented", "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tbr1RomInfo, Ssf2tbr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tbInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tbj = { - "ssf2tbj", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the tournament battle (931005 Japan)\0", "Linkup feature not implemented", "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tbjRomInfo, Ssf2tbjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tbInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tbj1 = { - "ssf2tbj1", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the tournament battle (930911 Japan)\0", "Linkup feature not implemented", "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tbj1RomInfo, Ssf2tbj1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tbInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tbh = { - "ssf2tbh", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the tournament battle (931005 Hispanic)\0", "Linkup feature not implemented", "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tbhRomInfo, Ssf2tbhRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tbInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2t = { - "ssf2t", NULL, NULL, NULL, "1994", - "Super Street Fighter II Turbo (super street fighter 2 X 940223 etc)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tRomInfo, Ssf2tRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2th = { - "ssf2th", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II Turbo (super street fighter 2 X 940223 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2thRomInfo, Ssf2thRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2ta = { - "ssf2ta", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II Turbo (super street fighter 2 X 940223 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2taRomInfo, Ssf2taRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tu = { - "ssf2tu", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II Turbo (super street fighter 2 X 940323 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tuRomInfo, Ssf2tuRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tur1 = { - "ssf2tur1", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II Turbo (super street fighter 2 X 940223 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tur1RomInfo, Ssf2tur1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2xj = { - "ssf2xj", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II X - grand master challenge (super street fighter 2 X 940311 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2xjRomInfo, Ssf2xjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2xjr1 = { - "ssf2xjr1", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II X - grand master challenge (super street fighter 2 X 940223 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2xjr1RomInfo, Ssf2xjr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2xjr1r = { - "ssf2xjr1r", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II X - grand master challenge (super street fighter 2 X 940223 Japan rent version)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2xjr1rRomInfo, Ssf2xjr1rRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVhunt2 = { - "vhunt2", NULL, NULL, NULL, "1997", - "Vampire Hunter 2 - darkstalkers revenge (970929 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Vhunt2RomInfo, Vhunt2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVhunt2r1 = { - "vhunt2r1", "vhunt2", NULL, NULL, "1997", - "Vampire Hunter 2 - darkstalkers revenge (970913 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Vhunt2r1RomInfo, Vhunt2r1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVsav = { - "vsav", NULL, NULL, NULL, "1997", - "Vampire Savior - the lord of vampire (970519 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, VsavRomInfo, VsavRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVsava = { - "vsava", "vsav", NULL, NULL, "1997", - "Vampire Savior - the lord of vampire (970519 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, VsavaRomInfo, VsavaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVsavh = { - "vsavh", "vsav", NULL, NULL, "1997", - "Vampire Savior - the lord of vampire (970519 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, VsavhRomInfo, VsavhRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVsavj = { - "vsavj", "vsav", NULL, NULL, "1997", - "Vampire Savior - the lord of vampire (970519 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, VsavjRomInfo, VsavjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVsavu = { - "vsavu", "vsav", NULL, NULL, "1997", - "Vampire Savior - the lord of vampire (970519 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, VsavuRomInfo, VsavuRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVsav2 = { - "vsav2", NULL, NULL, NULL, "1997", - "Vampire Savior 2 - the lord of vampire (970913 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Vsav2RomInfo, Vsav2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcota = { - "xmcota", NULL, NULL, NULL, "1995", - "X-Men - children of the atom (950331 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, XmcotaRomInfo, XmcotaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotar1 = { - "xmcotar1", "xmcota", NULL, NULL, "1995", - "X-Men - children of the atom (950105 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Xmcotar1RomInfo, Xmcotar1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotaa = { - "xmcotaa", "xmcota", NULL, NULL, "1995", - "X-Men - children of the atom (950105 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, XmcotaaRomInfo, XmcotaaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotaar1 = { - "xmcotaar1", "xmcota", NULL, NULL, "1995", - "X-Men - children of the atom (941217 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Xmcotaar1RomInfo, Xmcotaar1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotah = { - "xmcotah", "xmcota", NULL, NULL, "1995", - "X-Men - children of the atom (950331 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2,HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, XmcotahRomInfo, XmcotahRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotahr1 = { - "xmcotahr1", "xmcota", NULL, NULL, "1995", - "X-Men - children of the atom (950105 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2,HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Xmcotahr1RomInfo, Xmcotahr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotaj = { - "xmcotaj", "xmcota", NULL, NULL, "1994", - "X-Men - children of the atom (950105 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, XmcotajRomInfo, XmcotajRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotaj1 = { - "xmcotaj1", "xmcota", NULL, NULL, "1994", - "X-Men - children of the atom (941222 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Xmcotaj1RomInfo, Xmcotaj1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotaj2 = { - "xmcotaj2", "xmcota", NULL, NULL, "1994", - "X-Men - children of the atom (941219 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Xmcotaj2RomInfo, Xmcotaj2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotaj3 = { - "xmcotaj3", "xmcota", NULL, NULL, "1994", - "X-Men - children of the atom (941217 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Xmcotaj3RomInfo, Xmcotaj3RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotajr = { - "xmcotajr", "xmcota", NULL, NULL, "1994", - "X-Men - children of the atom (941208 Japan, rent version)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, XmcotajrRomInfo, XmcotajrRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotau = { - "xmcotau", "xmcota", NULL, NULL, "1995", - "X-Men - children of the atom (950105 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, XmcotauRomInfo, XmcotauRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - XmcotaInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsf = { - "xmvsf", NULL, NULL, NULL, "1996", - "X-Men vs Street Fighter (961004 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, XmvsfRomInfo, XmvsfRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfr1 = { - "xmvsfr1", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (960910 Euro)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfr1RomInfo, Xmvsfr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfa = { - "xmvsfa", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (961023 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, XmvsfaRomInfo, XmvsfaRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfar1 = { - "xmvsfar1", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (961004 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfar1RomInfo, Xmvsfar1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfar2 = { - "xmvsfar2", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (960919 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfar2RomInfo, Xmvsfar2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfar3 = { - "xmvsfar3", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (960910 Asia)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfar3RomInfo, Xmvsfar3RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfb = { - "xmvsfb", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (961023 Brazil)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, XmvsfbRomInfo, XmvsfbRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfh = { - "xmvsfh", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (961004 Hispanic)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, XmvsfhRomInfo, XmvsfhRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfj = { - "xmvsfj", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (961023 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, XmvsfjRomInfo, XmvsfjRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfjr1 = { - "xmvsfjr1", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (961004 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfjr1RomInfo, Xmvsfjr1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfjr2 = { - "xmvsfjr2", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (960910 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfjr2RomInfo, Xmvsfjr2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfjr3 = { - "xmvsfjr3", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (960909 Japan)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfjr3RomInfo, Xmvsfjr3RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfu = { - "xmvsfu", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (961023 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, XmvsfuRomInfo, XmvsfuRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfur1 = { - "xmvsfur1", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (961004 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfur1RomInfo, Xmvsfur1RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfur2 = { - "xmvsfur2", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (960910 USA)\0", NULL, "Capcom", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfur2RomInfo, Xmvsfur2RomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Phoenix sets - -static struct BurnRomInfo NinexxdRomDesc[] = { - { "19xud.03", 0x080000, 0xf81b60e5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xud.04", 0x080000, 0xcc44638c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xud.05", 0x080000, 0x33a168de, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19xud.06", 0x080000, 0xe0111282, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "19x.07", 0x080000, 0x61c0296c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "19x.13m", 0x080000, 0x427aeb18, CPS2_GFX | BRF_GRA }, - { "19x.15m", 0x080000, 0x63bdbf54, CPS2_GFX | BRF_GRA }, - { "19x.17m", 0x080000, 0x2dfe18b5, CPS2_GFX | BRF_GRA }, - { "19x.19m", 0x080000, 0xcbef9579, CPS2_GFX | BRF_GRA }, - { "19x.14m", 0x200000, 0xe916967c, CPS2_GFX | BRF_GRA }, - { "19x.16m", 0x200000, 0x6e75f3db, CPS2_GFX | BRF_GRA }, - { "19x.18m", 0x200000, 0x2213e798, CPS2_GFX | BRF_GRA }, - { "19x.20m", 0x200000, 0xab9d5b96, CPS2_GFX | BRF_GRA }, - - { "19x.01", 0x020000, 0xef55195e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "19x.11m", 0x200000, 0xd38beef3, CPS2_QSND | BRF_SND }, - { "19x.12m", 0x200000, 0xd47c96e2, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ninexxd) -STD_ROM_FN(Ninexxd) - -static struct BurnRomInfo Nine44dRomDesc[] = { - { "nffud.03", 0x080000, 0x28E8AAE4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "nff.04", 0x080000, 0xdba1C66e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "nffu.05", 0x080000, 0xea813eb7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "nff.13m", 0x400000, 0xC9fca741, CPS2_GFX | BRF_GRA }, - { "nff.15m", 0x400000, 0xf809d898, CPS2_GFX | BRF_GRA }, - { "nff.17m", 0x400000, 0x15ba4507, CPS2_GFX | BRF_GRA }, - { "nff.19m", 0x400000, 0x3dd41b8c, CPS2_GFX | BRF_GRA }, - { "nff.14m", 0x100000, 0x3fe3a54b, CPS2_GFX | BRF_GRA }, - { "nff.16m", 0x100000, 0x565cd231, CPS2_GFX | BRF_GRA }, - { "nff.18m", 0x100000, 0x63ca5988, CPS2_GFX | BRF_GRA }, - { "nff.20m", 0x100000, 0x21eb8f3B, CPS2_GFX | BRF_GRA }, - - { "nff.01", 0x020000, 0xd2e44318, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "nff.11m", 0x400000, 0x243e4e05, CPS2_QSND | BRF_SND }, - { "nff.12m", 0x400000, 0x4fcf1600, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nine44d) -STD_ROM_FN(Nine44d) - -static struct BurnRomInfo Nine44adRomDesc[] = { - { "nffuad.03", 0x080000, 0x78188e42, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "nff.04", 0x080000, 0xdba1C66e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "nffu.05", 0x080000, 0xea813eb7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "nff.13m", 0x400000, 0xC9fca741, CPS2_GFX | BRF_GRA }, - { "nff.15m", 0x400000, 0xf809d898, CPS2_GFX | BRF_GRA }, - { "nff.17m", 0x400000, 0x15ba4507, CPS2_GFX | BRF_GRA }, - { "nff.19m", 0x400000, 0x3dd41b8c, CPS2_GFX | BRF_GRA }, - { "nff.14m", 0x100000, 0x3fe3a54b, CPS2_GFX | BRF_GRA }, - { "nff.16m", 0x100000, 0x565cd231, CPS2_GFX | BRF_GRA }, - { "nff.18m", 0x100000, 0x63ca5988, CPS2_GFX | BRF_GRA }, - { "nff.20m", 0x100000, 0x21eb8f3B, CPS2_GFX | BRF_GRA }, - - { "nff.01", 0x020000, 0xd2e44318, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "nff.11m", 0x400000, 0x243e4e05, CPS2_QSND | BRF_SND }, - { "nff.12m", 0x400000, 0x4fcf1600, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nine44ad) -STD_ROM_FN(Nine44ad) - -static struct BurnRomInfo Armwar1dRomDesc[] = { - { "pwged.03b", 0x080000, 0x496bd483, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwged.04b", 0x080000, 0x9bd6a38f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwged.05a", 0x080000, 0x4c11d30f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.06", 0x080000, 0x87a60ce8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.07", 0x080000, 0xf7b148df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.08", 0x080000, 0xcc62823e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.09", 0x080000, 0xddc85ca6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pwg.10", 0x080000, 0x07c4fb28, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pwg.13m", 0x400000, 0xae8fe08e, CPS2_GFX | BRF_GRA }, - { "pwg.15m", 0x400000, 0xdb560f58, CPS2_GFX | BRF_GRA }, - { "pwg.17m", 0x400000, 0xbc475b94, CPS2_GFX | BRF_GRA }, - { "pwg.19m", 0x400000, 0x07439ff7, CPS2_GFX | BRF_GRA }, - { "pwg.14m", 0x100000, 0xc3f9ba63, CPS2_GFX | BRF_GRA }, - { "pwg.16m", 0x100000, 0x815b0e7b, CPS2_GFX | BRF_GRA }, - { "pwg.18m", 0x100000, 0x0109c71b, CPS2_GFX | BRF_GRA }, - { "pwg.20m", 0x100000, 0xeb75ffbe, CPS2_GFX | BRF_GRA }, - - { "pwg.01", 0x020000, 0x18a5c0e4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pwg.02", 0x020000, 0xc9dfffa6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pwg.11m", 0x200000, 0xa78f7433, CPS2_QSND | BRF_SND }, - { "pwg.12m", 0x200000, 0x77438ed0, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Armwar1d) -STD_ROM_FN(Armwar1d) - -static struct BurnRomInfo AvspdRomDesc[] = { - { "avped.03d", 0x080000, 0x66aa8aad, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avped.04d", 0x080000, 0x579306c2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avp.05d", 0x080000, 0xfbfb5d7a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "avpd.06", 0x080000, 0x63094539, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "avp.13m", 0x200000, 0x8f8b5ae4, CPS2_GFX | BRF_GRA }, - { "avp.15m", 0x200000, 0xb00280df, CPS2_GFX | BRF_GRA }, - { "avp.17m", 0x200000, 0x94403195, CPS2_GFX | BRF_GRA }, - { "avp.19m", 0x200000, 0xe1981245, CPS2_GFX | BRF_GRA }, - { "avp.14m", 0x200000, 0xebba093e, CPS2_GFX | BRF_GRA }, - { "avp.16m", 0x200000, 0xfb228297, CPS2_GFX | BRF_GRA }, - { "avp.18m", 0x200000, 0x34fb7232, CPS2_GFX | BRF_GRA }, - { "avp.20m", 0x200000, 0xf90baa21, CPS2_GFX | BRF_GRA }, - - { "avp.01", 0x020000, 0x2d3b4220, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "avp.11m", 0x200000, 0x83499817, CPS2_QSND | BRF_SND }, - { "avp.12m", 0x200000, 0xf4110d49, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Avspd) -STD_ROM_FN(Avspd) - -static struct BurnRomInfo BatcirdRomDesc[] = { - { "btced.03", 0x080000, 0x0737db6d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btced.04", 0x080000, 0xef1a8823, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btced.05", 0x080000, 0x20bdbb14, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btced.06", 0x080000, 0xb4d8f5bc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.07", 0x080000, 0x7322d5db, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.08", 0x080000, 0x6aac85ab, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "btc.09", 0x080000, 0x1203db08, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "btc.13m", 0x400000, 0xdc705bad, CPS2_GFX | BRF_GRA }, - { "btc.15m", 0x400000, 0xe5779a3c, CPS2_GFX | BRF_GRA }, - { "btc.17m", 0x400000, 0xb33f4112, CPS2_GFX | BRF_GRA }, - { "btc.19m", 0x400000, 0xa6fcdb7e, CPS2_GFX | BRF_GRA }, - - { "btc.01", 0x020000, 0x1e194310, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "btc.02", 0x020000, 0x01aeb8e6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "btc.11m", 0x200000, 0xc27f2229, CPS2_QSND | BRF_SND }, - { "btc.12m", 0x200000, 0x418a2e33, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Batcird) -STD_ROM_FN(Batcird) - -static struct BurnRomInfo Csclub1dRomDesc[] = { - { "csce_d.03", 0x080000, 0x5aedc6e6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce_d.04", 0x080000, 0xa3d9aa25, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce_d.05", 0x080000, 0x0915c9d1, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csce_d.06", 0x080000, 0x09c77d99, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "csc_d.07", 0x080000, 0x77478e25, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "csc.73", 0x080000, 0x335f07c3, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.74", 0x080000, 0xab215357, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.75", 0x080000, 0xa2367381, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.76", 0x080000, 0x728aac1f, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.63", 0x080000, 0x3711b8ca, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.64", 0x080000, 0x828a06d8, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.65", 0x080000, 0x86ee4569, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.66", 0x080000, 0xc24f577f, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.83", 0x080000, 0x0750d12a, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.84", 0x080000, 0x90a92f39, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.85", 0x080000, 0xd08ab012, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.86", 0x080000, 0x41652583, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.93", 0x080000, 0xa756c7f7, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.94", 0x080000, 0xfb7ccc73, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.95", 0x080000, 0x4d014297, CPS2_GFX_SPLIT4 | BRF_GRA }, - { "csc.96", 0x080000, 0x6754b1ef, CPS2_GFX_SPLIT4 | BRF_GRA }, - - { "csc.01", 0x020000, 0xee162111, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "csc.51", 0x080000, 0x5a52afd5, CPS2_QSND | BRF_SND }, - { "csc.52", 0x080000, 0x1408a811, CPS2_QSND | BRF_SND }, - { "csc.53", 0x080000, 0x4fb9f57c, CPS2_QSND | BRF_SND }, - { "csc.54", 0x080000, 0x9a8f40ec, CPS2_QSND | BRF_SND }, - { "csc.55", 0x080000, 0x91529a91, CPS2_QSND | BRF_SND }, - { "csc.56", 0x080000, 0x9a345334, CPS2_QSND | BRF_SND }, - { "csc.57", 0x080000, 0xaedc27f2, CPS2_QSND | BRF_SND }, - { "csc.58", 0x080000, 0x2300b7b3, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Csclub1d) -STD_ROM_FN(Csclub1d) - -static struct BurnRomInfo CybotsudRomDesc[] = { - { "cybu_d.03", 0x080000, 0xee7560fb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cybu_d.04", 0x080000, 0x7e7425a0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.05", 0x080000, 0xec40408e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.06", 0x080000, 0x1ad0bed2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.07", 0x080000, 0x6245a39a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.08", 0x080000, 0x4b48e223, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.09", 0x080000, 0xe15238f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.10", 0x080000, 0x75f4003b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "cyb.13m", 0x400000, 0xf0dce192, CPS2_GFX | BRF_GRA }, - { "cyb.15m", 0x400000, 0x187aa39c, CPS2_GFX | BRF_GRA }, - { "cyb.17m", 0x400000, 0x8a0e4b12, CPS2_GFX | BRF_GRA }, - { "cyb.19m", 0x400000, 0x34b62612, CPS2_GFX | BRF_GRA }, - { "cyb.14m", 0x400000, 0xc1537957, CPS2_GFX | BRF_GRA }, - { "cyb.16m", 0x400000, 0x15349e86, CPS2_GFX | BRF_GRA }, - { "cyb.18m", 0x400000, 0xd83e977d, CPS2_GFX | BRF_GRA }, - { "cyb.20m", 0x400000, 0x77cdad5c, CPS2_GFX | BRF_GRA }, - - { "cyb.01", 0x020000, 0x9c0fb079, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "cyb.02", 0x020000, 0x51cb0c4e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "cyb.11m", 0x200000, 0x362ccab2, CPS2_QSND | BRF_SND }, - { "cyb.12m", 0x200000, 0x7066e9cc, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Cybotsud) -STD_ROM_FN(Cybotsud) - -static struct BurnRomInfo CybotsjdRomDesc[] = { - { "cybj_d.03", 0x080000, 0x9eb34071, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cybj_d.04", 0x080000, 0xcf223cd7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.05", 0x080000, 0xec40408e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.06", 0x080000, 0x1ad0bed2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.07", 0x080000, 0x6245a39a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.08", 0x080000, 0x4b48e223, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.09", 0x080000, 0xe15238f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "cyb.10", 0x080000, 0x75f4003b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "cyb.13m", 0x400000, 0xf0dce192, CPS2_GFX | BRF_GRA }, - { "cyb.15m", 0x400000, 0x187aa39c, CPS2_GFX | BRF_GRA }, - { "cyb.17m", 0x400000, 0x8a0e4b12, CPS2_GFX | BRF_GRA }, - { "cyb.19m", 0x400000, 0x34b62612, CPS2_GFX | BRF_GRA }, - { "cyb.14m", 0x400000, 0xc1537957, CPS2_GFX | BRF_GRA }, - { "cyb.16m", 0x400000, 0x15349e86, CPS2_GFX | BRF_GRA }, - { "cyb.18m", 0x400000, 0xd83e977d, CPS2_GFX | BRF_GRA }, - { "cyb.20m", 0x400000, 0x77cdad5c, CPS2_GFX | BRF_GRA }, - - { "cyb.01", 0x020000, 0x9c0fb079, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "cyb.02", 0x020000, 0x51cb0c4e, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "cyb.11m", 0x200000, 0x362ccab2, CPS2_QSND | BRF_SND }, - { "cyb.12m", 0x200000, 0x7066e9cc, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Cybotsjd) -STD_ROM_FN(Cybotsjd) - -static struct BurnRomInfo DdsomudRomDesc[] = { - { "dd2ud.03g", 0x080000, 0x816f695a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2ud.04g", 0x080000, 0x7cc81c6b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.05g", 0x080000, 0x5eb1991c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.06g", 0x080000, 0xc26b5e55, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.07", 0x080000, 0x909a0b8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.08", 0x080000, 0xe53c4d01, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2.09", 0x080000, 0x5f86279f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dd2d.10", 0x080000, 0x0c172f8f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dd2.13m", 0x400000, 0xa46b4e6e, CPS2_GFX | BRF_GRA }, - { "dd2.15m", 0x400000, 0xd5fc50fc, CPS2_GFX | BRF_GRA }, - { "dd2.17m", 0x400000, 0x837c0867, CPS2_GFX | BRF_GRA }, - { "dd2.19m", 0x400000, 0xbb0ec21c, CPS2_GFX | BRF_GRA }, - { "dd2.14m", 0x200000, 0x6d824ce2, CPS2_GFX | BRF_GRA }, - { "dd2.16m", 0x200000, 0x79682ae5, CPS2_GFX | BRF_GRA }, - { "dd2.18m", 0x200000, 0xacddd149, CPS2_GFX | BRF_GRA }, - { "dd2.20m", 0x200000, 0x117fb0c0, CPS2_GFX | BRF_GRA }, - - { "dd2.01", 0x020000, 0x99d657e5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "dd2.02", 0x020000, 0x117a3824, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dd2.11m", 0x200000, 0x98d0c325, CPS2_QSND | BRF_SND }, - { "dd2.12m", 0x200000, 0x5ea2e7fa, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddsomud) -STD_ROM_FN(Ddsomud) - -static struct BurnRomInfo DdtoddRomDesc[] = { - { "daded.03c", 0x080000, 0x843330f4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "daded.04c", 0x080000, 0x306f14fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "daded.05c", 0x080000, 0x8c6b8328, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dad.06a", 0x080000, 0x6225495a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "dadd.07a", 0x080000, 0x0f0df6cc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "dad.13m", 0x200000, 0xda3cb7d6, CPS2_GFX | BRF_GRA }, - { "dad.15m", 0x200000, 0x92b63172, CPS2_GFX | BRF_GRA }, - { "dad.17m", 0x200000, 0xb98757f5, CPS2_GFX | BRF_GRA }, - { "dad.19m", 0x200000, 0x8121ce46, CPS2_GFX | BRF_GRA }, - { "dad.14m", 0x100000, 0x837e6f3f, CPS2_GFX | BRF_GRA }, - { "dad.16m", 0x100000, 0xf0916bdb, CPS2_GFX | BRF_GRA }, - { "dad.18m", 0x100000, 0xcef393ef, CPS2_GFX | BRF_GRA }, - { "dad.20m", 0x100000, 0x8953fe9e, CPS2_GFX | BRF_GRA }, - - { "dad.01", 0x020000, 0x3f5e2424, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "dad.11m", 0x200000, 0x0c499b67, CPS2_QSND | BRF_SND }, - { "dad.12m", 0x200000, 0x2f0b5a4e, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ddtodd) -STD_ROM_FN(Ddtodd) - -static struct BurnRomInfo DimahoudRomDesc[] = { - { "gmdud.03", 0x080000, 0x12888435, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.04", 0x080000, 0x37485567, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmd.05", 0x080000, 0xda269ffb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "gmdud.06", 0x080000, 0xd825efda, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "gmd.13m", 0x400000, 0x80dd19f0, CPS2_GFX | BRF_GRA }, - { "gmd.15m", 0x400000, 0xdfd93A78, CPS2_GFX | BRF_GRA }, - { "gmd.17m", 0x400000, 0x16356520, CPS2_GFX | BRF_GRA }, - { "gmd.19m", 0x400000, 0xdfc33031, CPS2_GFX | BRF_GRA }, - - { "gmd.01", 0x020000, 0x3f9bc985, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "gmd.02", 0x020000, 0x3fd39dde, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "gmd.11m", 0x400000, 0x06a65542, CPS2_QSND | BRF_SND }, - { "gmd.12m", 0x400000, 0x50bc7a31, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Dimahoud) -STD_ROM_FN(Dimahoud) - -static struct BurnRomInfo Dstlku1dRomDesc[] = { - { "vamud.03a", 0x080000, 0x47b7a680, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamud.04a", 0x080000, 0x3b7a4939, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.05a", 0x080000, 0x673ed50a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.06a", 0x080000, 0xf2377be7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.07a", 0x080000, 0xd8f498c4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.08a", 0x080000, 0xe6a8a1a0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamud.09a", 0x080000, 0x8b333a19, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vamu.10a", 0x080000, 0xc1a3d9be, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vam.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vam.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vam.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vam.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vam.14m", 0x100000, 0xbd87243c, CPS2_GFX | BRF_GRA }, - { "vam.16m", 0x100000, 0xafec855f, CPS2_GFX | BRF_GRA }, - { "vam.18m", 0x100000, 0x3a033625, CPS2_GFX | BRF_GRA }, - { "vam.20m", 0x100000, 0x2bff6a89, CPS2_GFX | BRF_GRA }, - - { "vam.01", 0x020000, 0x64b685d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vam.02", 0x020000, 0xcf7c97c7, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vam.11m", 0x200000, 0x4a39deb2, CPS2_QSND | BRF_SND }, - { "vam.12m", 0x200000, 0x1a3e5c03, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Dstlku1d) -STD_ROM_FN(Dstlku1d) - -static struct BurnRomInfo EcofghtrdRomDesc[] = { - { "ueced.03", 0x080000, 0xac725d2b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ueced.04", 0x080000, 0xf800138d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ueced.05", 0x080000, 0xeb6a12f2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ueced.06", 0x080000, 0x8380ec9a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "uec.13m", 0x200000, 0xdcaf1436, CPS2_GFX | BRF_GRA }, - { "uec.15m", 0x200000, 0x2807df41, CPS2_GFX | BRF_GRA }, - { "uec.17m", 0x200000, 0x8a708d02, CPS2_GFX | BRF_GRA }, - { "uec.19m", 0x200000, 0xde7be0ef, CPS2_GFX | BRF_GRA }, - { "uec.14m", 0x100000, 0x1a003558, CPS2_GFX | BRF_GRA }, - { "uec.16m", 0x100000, 0x4ff8a6f9, CPS2_GFX | BRF_GRA }, - { "uec.18m", 0x100000, 0xb167ae12, CPS2_GFX | BRF_GRA }, - { "uec.20m", 0x100000, 0x1064bdc2, CPS2_GFX | BRF_GRA }, - - { "uec.01", 0x020000, 0xc235bd15, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "uec.11m", 0x200000, 0x81b25d39, CPS2_QSND | BRF_SND }, - { "uec.12m", 0x200000, 0x27729e52, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ecofghtrd) -STD_ROM_FN(Ecofghtrd) - -static struct BurnRomInfo GigawingdRomDesc[] = { - { "ggwu_d.03", 0x080000, 0xdde92dfa, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwu_d.04", 0x080000, 0xe0509ae2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggw_d.05", 0x080000, 0x722d0042, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ggw.13m", 0x400000, 0x105530a4, CPS2_GFX | BRF_GRA }, - { "ggw.15m", 0x400000, 0x9e774ab9, CPS2_GFX | BRF_GRA }, - { "ggw.17m", 0x400000, 0x466e0ba4, CPS2_GFX | BRF_GRA }, - { "ggw.19m", 0x400000, 0x840c8dea, CPS2_GFX | BRF_GRA }, - - { "ggw.01", 0x020000, 0x4c6351d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ggw.11m", 0x400000, 0xe172acf5, CPS2_QSND | BRF_SND }, - { "ggw.12m", 0x400000, 0x4bee4e8f, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Gigawingd) -STD_ROM_FN(Gigawingd) - -static struct BurnRomInfo GigawingjdRomDesc[] = { - { "ggwjd.03a", 0x080000, 0xcb1c756e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwjd.04a", 0x080000, 0xfa158e04, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ggwjd.05a", 0x080000, 0x1c5bc4e7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ggw.13m", 0x400000, 0x105530a4, CPS2_GFX | BRF_GRA }, - { "ggw.15m", 0x400000, 0x9e774ab9, CPS2_GFX | BRF_GRA }, - { "ggw.17m", 0x400000, 0x466e0ba4, CPS2_GFX | BRF_GRA }, - { "ggw.19m", 0x400000, 0x840c8dea, CPS2_GFX | BRF_GRA }, - - { "ggw.01", 0x020000, 0x4c6351d5, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ggw.11m", 0x400000, 0xe172acf5, CPS2_QSND | BRF_SND }, - { "ggw.12m", 0x400000, 0x4bee4e8f, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Gigawingjd) -STD_ROM_FN(Gigawingjd) - -static struct BurnRomInfo Hsf2dRomDesc[] = { - { "hs2ad.03", 0x080000, 0x0153d371, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2ad.04", 0x080000, 0x0276b78a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.05", 0x080000, 0xdde34a35, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.06", 0x080000, 0xf4e56dda, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.07", 0x080000, 0xee4420fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.08", 0x080000, 0xc9441533, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.09", 0x080000, 0x3fc638a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.10", 0x080000, 0x20d0f9e4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "hs2.13m", 0x800000, 0xa6ecab17, CPS2_GFX | BRF_GRA }, - { "hs2.15m", 0x800000, 0x10a0ae4d, CPS2_GFX | BRF_GRA }, - { "hs2.17m", 0x800000, 0xadfa7726, CPS2_GFX | BRF_GRA }, - { "hs2.19m", 0x800000, 0xbb3ae322, CPS2_GFX | BRF_GRA }, - - { "hs2.01", 0x020000, 0xc1a13786, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "hs2.02", 0x020000, 0x2d8794aa, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "hs2.11m", 0x800000, 0x0e15c359, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Hsf2d) -STD_ROM_FN(Hsf2d) - -static struct BurnRomInfo Hsf2daRomDesc[] = { - { "hs2ad.03", 0x080000, 0x0153d371, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2ad.04", 0x080000, 0x0276b78a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.05", 0x080000, 0xdde34a35, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.06", 0x080000, 0xf4e56dda, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.07", 0x080000, 0xee4420fc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.08", 0x080000, 0xc9441533, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.09", 0x080000, 0x3fc638a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "hs2.10", 0x080000, 0x20d0f9e4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "hs2.13", 0x400000, 0x6ff7f5f1, CPS2_GFX | BRF_GRA }, - { "hs2.15", 0x400000, 0x26da2f5d, CPS2_GFX | BRF_GRA }, - { "hs2.17", 0x400000, 0xe769ee8e, CPS2_GFX | BRF_GRA }, - { "hs2.19", 0x400000, 0x7f47fd07, CPS2_GFX | BRF_GRA }, - { "hs2.14", 0x400000, 0xc549e333, CPS2_GFX | BRF_GRA }, - { "hs2.16", 0x400000, 0x0a8541f9, CPS2_GFX | BRF_GRA }, - { "hs2.18", 0x400000, 0xf4c92b27, CPS2_GFX | BRF_GRA }, - { "hs2.20", 0x400000, 0xba355a75, CPS2_GFX | BRF_GRA }, - - { "hs2.01", 0x020000, 0xc1a13786, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "hs2.02", 0x020000, 0x2d8794aa, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "hs2(__hsf2da).11m", 0x400000, 0x5cb00496, CPS2_QSND | BRF_SND }, - { "hs2.12m", 0x400000, 0x8f298007, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Hsf2da) -STD_ROM_FN(Hsf2da) - -static struct BurnRomInfo Megamn2dRomDesc[] = { - { "rm2ud.03", 0x080000, 0xd3635f25, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2ud.04", 0x080000, 0x768a1705, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "rm2.05", 0x080000, 0x02ee9efc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "rm2.14m", 0x200000, 0x9b1f00b4, CPS2_GFX | BRF_GRA }, - { "rm2.16m", 0x200000, 0xc2bb0c24, CPS2_GFX | BRF_GRA }, - { "rm2.18m", 0x200000, 0x12257251, CPS2_GFX | BRF_GRA }, - { "rm2.20m", 0x200000, 0xf9b6e786, CPS2_GFX | BRF_GRA }, - - { "rm2.01a", 0x020000, 0xd18e7859, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "rm2.02", 0x020000, 0xc463ece0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "rm2.11m", 0x200000, 0x2106174d, CPS2_QSND | BRF_SND }, - { "rm2.12m", 0x200000, 0x546c1636, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Megamn2d) -STD_ROM_FN(Megamn2d) - -static struct BurnRomInfo MmatrixdRomDesc[] = { - { "mmxud.03", 0x080000, 0x36711e60, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mmxud.04", 0x080000, 0x4687226f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mmxud.05", 0x080000, 0x52124398, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mmx.13m", 0x400000, 0x04748718, CPS2_GFX | BRF_GRA }, - { "mmx.15m", 0x400000, 0x38074f44, CPS2_GFX | BRF_GRA }, - { "mmx.17m", 0x400000, 0xe4635e35, CPS2_GFX | BRF_GRA }, - { "mmx.19m", 0x400000, 0x4400a3f2, CPS2_GFX | BRF_GRA }, - { "mmx.14m", 0x400000, 0xd52bf491, CPS2_GFX | BRF_GRA }, - { "mmx.16m", 0x400000, 0x23f70780, CPS2_GFX | BRF_GRA }, - { "mmx.18m", 0x400000, 0x2562c9d5, CPS2_GFX | BRF_GRA }, - { "mmx.20m", 0x400000, 0x583a9687, CPS2_GFX | BRF_GRA }, - - { "mmx.01", 0x020000, 0xc57e8171, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mmx.11m", 0x400000, 0x4180b39f, CPS2_QSND | BRF_SND }, - { "mmx.12m", 0x400000, 0x95e22a59, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mmatrixd) -STD_ROM_FN(Mmatrixd) - -static struct BurnRomInfo MpangjdRomDesc[] = { - { "mpnj-pnx.03", 0x080000, 0xdac63128, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mpnj-pnx.04", 0x080000, 0xd0b2592b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mpn-simm.01c", 0x200000, 0x388DB66B, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01d", 0x200000, 0xAFF1B494, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01a", 0x200000, 0xA9C4857B, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.01b", 0x200000, 0xF759DF22, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03c", 0x200000, 0xDEC6B720, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03d", 0x200000, 0xF8774C18, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03a", 0x200000, 0xC2AEA4EC, CPS2_GFX_SIMM | BRF_GRA }, - { "mpn-simm.03b", 0x200000, 0x84D6DC33, CPS2_GFX_SIMM | BRF_GRA }, - - { "mpn.01", 0x020000, 0x90C7ADB6, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mpn-simm.05a", 0x200000, 0x318A2E21, CPS2_QSND_SIMM | BRF_SND }, - { "mpn-simm.05b", 0x200000, 0x5462F4E8, CPS2_QSND_SIMM | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mpangjd) -STD_ROM_FN(Mpangjd) - -static struct BurnRomInfo MshudRomDesc[] = { - { "mshud.03", 0x080000, 0xc1d8c4c6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mshud.04", 0x080000, 0xe73dda16, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mshud.05", 0x080000, 0x3b493e84, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.06b", 0x080000, 0x803e3fa4, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.07a", 0x080000, 0xc45f8e27, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.08a", 0x080000, 0x9ca6f12c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.09a", 0x080000, 0x82ec27af, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "msh.10b", 0x080000, 0x8d931196, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "msh.13m", 0x400000, 0x09d14566, CPS2_GFX | BRF_GRA }, - { "msh.15m", 0x400000, 0xee962057, CPS2_GFX | BRF_GRA }, - { "msh.17m", 0x400000, 0x604ece14, CPS2_GFX | BRF_GRA }, - { "msh.19m", 0x400000, 0x94a731e8, CPS2_GFX | BRF_GRA }, - { "msh.14m", 0x400000, 0x4197973e, CPS2_GFX | BRF_GRA }, - { "msh.16m", 0x400000, 0x438da4a0, CPS2_GFX | BRF_GRA }, - { "msh.18m", 0x400000, 0x4db92d94, CPS2_GFX | BRF_GRA }, - { "msh.20m", 0x400000, 0xa2b0c6c0, CPS2_GFX | BRF_GRA }, - - { "msh.01", 0x020000, 0xc976e6f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "msh.02", 0x020000, 0xce67d0d9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "msh.11m", 0x200000, 0x37ac6d30, CPS2_QSND | BRF_SND }, - { "msh.12m", 0x200000, 0xde092570, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshud) -STD_ROM_FN(Mshud) - -static struct BurnRomInfo Mshvsfu1dRomDesc[] = { - { "mvsu_d.03d", 0x080000, 0x1c88bee3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvsu_d.04d", 0x080000, 0x1e8b2535, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs_d.05a", 0x080000, 0x373856fb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.06a", 0x080000, 0x959f3030, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.07b", 0x080000, 0x7f915bdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.08a", 0x080000, 0xc2813884, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.09b", 0x080000, 0x3ba08818, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvs.10b", 0x080000, 0xcf0dba98, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvs.13m", 0x400000, 0x29b05fd9, CPS2_GFX | BRF_GRA }, - { "mvs.15m", 0x400000, 0xfaddccf1, CPS2_GFX | BRF_GRA }, - { "mvs.17m", 0x400000, 0x97aaf4c7, CPS2_GFX | BRF_GRA }, - { "mvs.19m", 0x400000, 0xcb70e915, CPS2_GFX | BRF_GRA }, - { "mvs.14m", 0x400000, 0xb3b1972d, CPS2_GFX | BRF_GRA }, - { "mvs.16m", 0x400000, 0x08aadb5d, CPS2_GFX | BRF_GRA }, - { "mvs.18m", 0x400000, 0xc1228b35, CPS2_GFX | BRF_GRA }, - { "mvs.20m", 0x400000, 0x366cc6c2, CPS2_GFX | BRF_GRA }, - - { "mvs.01", 0x020000, 0x68252324, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvs.02", 0x020000, 0xb34e773d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvs.11m", 0x400000, 0x86219770, CPS2_QSND | BRF_SND }, - { "mvs.12m", 0x400000, 0xf2fd7f68, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mshvsfu1d) -STD_ROM_FN(Mshvsfu1d) - -static struct BurnRomInfo MvscudRomDesc[] = { - { "mvcud.03d", 0x080000, 0x75cde3e5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcud.04d", 0x080000, 0xb32ea484, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.05a", 0x080000, 0x2d8c8e86, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.06a", 0x080000, 0x8528e1f5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvcd.07", 0x080000, 0x205293e9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.08", 0x080000, 0xbc002fcd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.09", 0x080000, 0xc67b26df, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "mvc.10", 0x080000, 0x0fdd1e26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "mvc.13m", 0x400000, 0xfa5f74bc, CPS2_GFX | BRF_GRA }, - { "mvc.15m", 0x400000, 0x71938a8f, CPS2_GFX | BRF_GRA }, - { "mvc.17m", 0x400000, 0x92741d07, CPS2_GFX | BRF_GRA }, - { "mvc.19m", 0x400000, 0xbcb72fc6, CPS2_GFX | BRF_GRA }, - { "mvc.14m", 0x400000, 0x7f1df4e4, CPS2_GFX | BRF_GRA }, - { "mvc.16m", 0x400000, 0x90bd3203, CPS2_GFX | BRF_GRA }, - { "mvc.18m", 0x400000, 0x67aaf727, CPS2_GFX | BRF_GRA }, - { "mvc.20m", 0x400000, 0x8b0bade8, CPS2_GFX | BRF_GRA }, - - { "mvc.01", 0x020000, 0x41629e95, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "mvc.02", 0x020000, 0x963abf6b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "mvc.11m", 0x400000, 0x850fe663, CPS2_QSND | BRF_SND }, - { "mvc.12m", 0x400000, 0x7ccb1896, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Mvscud) -STD_ROM_FN(Mvscud) - -static struct BurnRomInfo NwarrudRomDesc[] = { - { "vphud.03f", 0x080000, 0x20d4d5a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphud.04c", 0x080000, 0x61be9b42, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphud.05e", 0x080000, 0x1ba906d8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.06c", 0x080000, 0x08c04cdb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.07b", 0x080000, 0xb5a5ab19, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.08b", 0x080000, 0x51bb20fb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphu.09b", 0x080000, 0x41a64205, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vphud.10b", 0x080000, 0x9619adad, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vph.13m", 0x400000, 0xc51baf99, CPS2_GFX | BRF_GRA }, - { "vph.15m", 0x400000, 0x3ce83c77, CPS2_GFX | BRF_GRA }, - { "vph.17m", 0x400000, 0x4f2408e0, CPS2_GFX | BRF_GRA }, - { "vph.19m", 0x400000, 0x9ff60250, CPS2_GFX | BRF_GRA }, - { "vph.14m", 0x400000, 0x7a0e1add, CPS2_GFX | BRF_GRA }, - { "vph.16m", 0x400000, 0x2f41ca75, CPS2_GFX | BRF_GRA }, - { "vph.18m", 0x400000, 0x64498eed, CPS2_GFX | BRF_GRA }, - { "vph.20m", 0x400000, 0x17f2433f, CPS2_GFX | BRF_GRA }, - - { "vph.01", 0x020000, 0x5045dcac, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vph.02", 0x020000, 0x86b60e59, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vph.11m", 0x200000, 0xe1837d33, CPS2_QSND | BRF_SND }, - { "vph.12m", 0x200000, 0xfbd3cd90, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Nwarrud) -STD_ROM_FN(Nwarrud) - -static struct BurnRomInfo ProgearudRomDesc[] = { - { "pgau_d.03", 0x080000, 0xba22b9c5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pgau_d.04", 0x080000, 0xdf3927ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pga-simm.01c", 0x200000, 0x452f98b0, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01d", 0x200000, 0x9e672092, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01a", 0x200000, 0xae9ddafe, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01b", 0x200000, 0x94d72d94, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03c", 0x200000, 0x48a1886d, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03d", 0x200000, 0x172d7e37, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03a", 0x200000, 0x9ee33d98, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03b", 0x200000, 0x848dee32, CPS2_GFX_SIMM | BRF_GRA }, - - { "pga.01", 0x020000, 0xbdbfa992, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pga-simm.05a", 0x200000, 0xc0aac80c, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.05b", 0x200000, 0x37a65d86, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06a", 0x200000, 0xd3f1e934, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06b", 0x200000, 0x8b39489a, CPS2_QSND_SIMM | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Progearud) -STD_ROM_FN(Progearud) - -static struct BurnRomInfo ProgearjdRomDesc[] = { - { "pgaj_d.03", 0x080000, 0x0271f3a3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pgaj_d.04", 0x080000, 0xbe4b7799, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pga-simm.01c", 0x200000, 0x452f98b0, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01d", 0x200000, 0x9e672092, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01a", 0x200000, 0xae9ddafe, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.01b", 0x200000, 0x94d72d94, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03c", 0x200000, 0x48a1886d, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03d", 0x200000, 0x172d7e37, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03a", 0x200000, 0x9ee33d98, CPS2_GFX_SIMM | BRF_GRA }, - { "pga-simm.03b", 0x200000, 0x848dee32, CPS2_GFX_SIMM | BRF_GRA }, - - { "pga.01", 0x020000, 0xbdbfa992, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pga-simm.05a", 0x200000, 0xc0aac80c, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.05b", 0x200000, 0x37a65d86, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06a", 0x200000, 0xd3f1e934, CPS2_QSND_SIMM | BRF_SND }, - { "pga-simm.06b", 0x200000, 0x8b39489a, CPS2_QSND_SIMM | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Progearjd) -STD_ROM_FN(Progearjd) - -static struct BurnRomInfo RingdstdRomDesc[] = { - { "smbed.03b", 0x080000, 0xf6fba4cd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbed.04b", 0x080000, 0x193bc493, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbed.05b", 0x080000, 0x168cccbb, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smbed.06b", 0x080000, 0x04673262, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.07", 0x080000, 0xb9a11577, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "smb.08", 0x080000, 0xf931b76b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "smb.13m", 0x200000, 0xd9b2d1de, CPS2_GFX | BRF_GRA }, - { "smb.15m", 0x200000, 0x9a766d92, CPS2_GFX | BRF_GRA }, - { "smb.17m", 0x200000, 0x51800f0f, CPS2_GFX | BRF_GRA }, - { "smb.19m", 0x200000, 0x35757e96, CPS2_GFX | BRF_GRA }, - { "smb.14m", 0x200000, 0xe5bfd0e7, CPS2_GFX | BRF_GRA }, - { "smb.16m", 0x200000, 0xc56c0866, CPS2_GFX | BRF_GRA }, - { "smb.18m", 0x200000, 0x4ded3910, CPS2_GFX | BRF_GRA }, - { "smb.20m", 0x200000, 0x26ea1ec5, CPS2_GFX | BRF_GRA }, - { "smb.21m", 0x080000, 0x0a08c5fc, CPS2_GFX | BRF_GRA }, - { "smb.23m", 0x080000, 0x0911b6c4, CPS2_GFX | BRF_GRA }, - { "smb.25m", 0x080000, 0x82d6c4ec, CPS2_GFX | BRF_GRA }, - { "smb.27m", 0x080000, 0x9b48678b, CPS2_GFX | BRF_GRA }, - - { "smb.01", 0x020000, 0x0abc229a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "smb.02", 0x020000, 0xd051679a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "smb.11m", 0x200000, 0xc56935f9, CPS2_QSND | BRF_SND }, - { "smb.12m", 0x200000, 0x955b0782, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ringdstd) -STD_ROM_FN(Ringdstd) - -static struct BurnRomInfo SfadRomDesc[] = { - { "sfzed.03d", 0x080000, 0xa1a54827, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04b", 0x080000, 0x8b73b0e5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfad) -STD_ROM_FN(Sfad) - -static struct BurnRomInfo SfaudRomDesc[] = { - // is this a region hack of sfad, no original dump of 950727 USA exists currently - { "sfzud.03a", 0x080000, 0x9f2ff577, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.04b", 0x080000, 0x8b73b0e5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.05a", 0x080000, 0x0810544d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfz.06", 0x080000, 0x806e8f38, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfz.14m", 0x200000, 0x90fefdb3, CPS2_GFX | BRF_GRA }, - { "sfz.16m", 0x200000, 0x5354c948, CPS2_GFX | BRF_GRA }, - { "sfz.18m", 0x200000, 0x41a1e790, CPS2_GFX | BRF_GRA }, - { "sfz.20m", 0x200000, 0xa549df98, CPS2_GFX | BRF_GRA }, - - { "sfz.01", 0x020000, 0xffffec7d, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfz.02", 0x020000, 0x45f46a08, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfz.11m", 0x200000, 0xc4b093cd, CPS2_QSND | BRF_SND }, - { "sfz.12m", 0x200000, 0x8bdbc4b4, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfaud) -STD_ROM_FN(Sfaud) - -static struct BurnRomInfo Sfz2adRomDesc[] = { - { "sz2ad.03a", 0x080000, 0x017f8fab, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2ad.04a", 0x080000, 0xf50e5ea2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.05a", 0x080000, 0x98e8e992, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.06", 0x080000, 0x5b1d49c0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2a.07a", 0x080000, 0x0aed2494, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.08", 0x080000, 0x0fe8585d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2ad) -STD_ROM_FN(Sfz2ad) - -static struct BurnRomInfo Sfz2jdRomDesc[] = { - { "sz2j_d.03a", 0x080000, 0xb7325df8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2j_d.04a", 0x080000, 0xa1022a3e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.05a", 0x080000, 0x98e8e992, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.06", 0x080000, 0x5b1d49c0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2j.07a", 0x080000, 0xd910b2a2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz2.08", 0x080000, 0x0fe8585d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2jd) -STD_ROM_FN(Sfz2jd) - -static struct BurnRomInfo Sfz2aldRomDesc[] = { - { "szaad.03", 0x080000, 0x89f9483b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaad.04", 0x080000, 0xaef27ae5, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaa.05", 0x080000, 0xf053a55e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaa.06", 0x080000, 0xcfc0e7a8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaa.07", 0x080000, 0x5feb8b20, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "szaa.08", 0x080000, 0x6eb6d412, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz2.13m", 0x400000, 0x4d1f1f22, CPS2_GFX | BRF_GRA }, - { "sz2.15m", 0x400000, 0x19cea680, CPS2_GFX | BRF_GRA }, - { "sz2.17m", 0x400000, 0xe01b4588, CPS2_GFX | BRF_GRA }, - { "sz2.19m", 0x400000, 0x0feeda64, CPS2_GFX | BRF_GRA }, - { "sz2.14m", 0x100000, 0x0560c6aa, CPS2_GFX | BRF_GRA }, - { "sz2.16m", 0x100000, 0xae940f87, CPS2_GFX | BRF_GRA }, - { "sz2.18m", 0x100000, 0x4bc3c8bc, CPS2_GFX | BRF_GRA }, - { "sz2.20m", 0x100000, 0x39e674c0, CPS2_GFX | BRF_GRA }, - - { "sz2.01a", 0x020000, 0x1bc323cf, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz2.02a", 0x020000, 0xba6a5013, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz2.11m", 0x200000, 0xaa47a601, CPS2_QSND | BRF_SND }, - { "sz2.12m", 0x200000, 0x2237bc53, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz2ald) -STD_ROM_FN(Sfz2ald) - -static struct BurnRomInfo Sfa3udRomDesc[] = { - { "sz3ud.03c", 0x080000, 0x6db8add7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3ud.04c", 0x080000, 0xd9c65a26, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05c", 0x080000, 0x57fd0a40, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06c", 0x080000, 0xf6305f8b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07c", 0x080000, 0x6eab0f6f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08c", 0x080000, 0x910c4a3b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09c", 0x080000, 0xb29e5199, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10b", 0x080000, 0xdeb2ff52, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfa3ud) -STD_ROM_FN(Sfa3ud) - -static struct BurnRomInfo Sfz3jr2dRomDesc[] = { - { "sz3j_d.03", 0x080000, 0xb0436151, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3j_d.04", 0x080000, 0x642d8170, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.05", 0x080000, 0x9b21518a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.06", 0x080000, 0xe7a6c3a7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.07", 0x080000, 0xec4c0cfd, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.08", 0x080000, 0x5c7e7240, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.09", 0x080000, 0xc5589553, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sz3.10", 0x080000, 0xa9717252, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sz3.13m", 0x400000, 0x0f7a60d9, CPS2_GFX | BRF_GRA }, - { "sz3.15m", 0x400000, 0x8e933741, CPS2_GFX | BRF_GRA }, - { "sz3.17m", 0x400000, 0xd6e98147, CPS2_GFX | BRF_GRA }, - { "sz3.19m", 0x400000, 0xf31a728a, CPS2_GFX | BRF_GRA }, - { "sz3.14m", 0x400000, 0x5ff98297, CPS2_GFX | BRF_GRA }, - { "sz3.16m", 0x400000, 0x52b5bdee, CPS2_GFX | BRF_GRA }, - { "sz3.18m", 0x400000, 0x40631ed5, CPS2_GFX | BRF_GRA }, - { "sz3.20m", 0x400000, 0x763409b4, CPS2_GFX | BRF_GRA }, - - { "sz3.01", 0x020000, 0xde810084, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sz3.02", 0x020000, 0x72445dc4, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sz3.11m", 0x400000, 0x1c89eed1, CPS2_QSND | BRF_SND }, - { "sz3.12m", 0x400000, 0xf392b13a, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sfz3jr2d) -STD_ROM_FN(Sfz3jr2d) - -static struct BurnRomInfo SgemfdRomDesc[] = { - { "pcfud.03", 0x080000, 0x8b83674a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcfd.04", 0x080000, 0xb58f1d03, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.05", 0x080000, 0x215655f6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.06", 0x080000, 0xea6f13ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pcf.07", 0x080000, 0x5ac6d5ea, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pcf.13m", 0x400000, 0x22d72ab9, CPS2_GFX | BRF_GRA }, - { "pcf.15m", 0x400000, 0x16a4813c, CPS2_GFX | BRF_GRA }, - { "pcf.17m", 0x400000, 0x1097e035, CPS2_GFX | BRF_GRA }, - { "pcf.19m", 0x400000, 0xd362d874, CPS2_GFX | BRF_GRA }, - { "pcf.14m", 0x100000, 0x0383897c, CPS2_GFX | BRF_GRA }, - { "pcf.16m", 0x100000, 0x76f91084, CPS2_GFX | BRF_GRA }, - { "pcf.18m", 0x100000, 0x756c3754, CPS2_GFX | BRF_GRA }, - { "pcf.20m", 0x100000, 0x9ec9277d, CPS2_GFX | BRF_GRA }, - - { "pcf.01", 0x020000, 0x254e5f33, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pcf.02", 0x020000, 0x6902f4f9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pcf.11m", 0x400000, 0xa5dea005, CPS2_QSND | BRF_SND }, - { "pcf.12m", 0x400000, 0x4ce235fe, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Sgemfd) -STD_ROM_FN(Sgemfd) - -static struct BurnRomInfo Spf2tdRomDesc[] = { - { "pzfu_d.03a", 0x080000, 0x7836b903, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pzf.04", 0x080000, 0xb80649e2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pzf.14m", 0x100000, 0x2d4881cb, CPS2_GFX | BRF_GRA }, - { "pzf.16m", 0x100000, 0x4b0fd1be, CPS2_GFX | BRF_GRA }, - { "pzf.18m", 0x100000, 0xe43aac33, CPS2_GFX | BRF_GRA }, - { "pzf.20m", 0x100000, 0x7f536ff1, CPS2_GFX | BRF_GRA }, - - { "pzf.01", 0x020000, 0x600fb2a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pzf.02", 0x020000, 0x496076e0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pzf.11m", 0x200000, 0x78442743, CPS2_QSND | BRF_SND }, - { "pzf.12m", 0x200000, 0x399d2c7b, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Spf2td) -STD_ROM_FN(Spf2td) - -static struct BurnRomInfo Spf2xjdRomDesc[] = { - { "pzfjd.03a", 0x080000, 0x5e85ed08, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "pzf.04", 0x080000, 0xb80649e2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "pzf.14m", 0x100000, 0x2d4881cb, CPS2_GFX | BRF_GRA }, - { "pzf.16m", 0x100000, 0x4b0fd1be, CPS2_GFX | BRF_GRA }, - { "pzf.18m", 0x100000, 0xe43aac33, CPS2_GFX | BRF_GRA }, - { "pzf.20m", 0x100000, 0x7f536ff1, CPS2_GFX | BRF_GRA }, - - { "pzf.01", 0x020000, 0x600fb2a3, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "pzf.02", 0x020000, 0x496076e0, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pzf.11m", 0x200000, 0x78442743, CPS2_QSND | BRF_SND }, - { "pzf.12m", 0x200000, 0x399d2c7b, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Spf2xjd) -STD_ROM_FN(Spf2xjd) - -static struct BurnRomInfo Ssf2dRomDesc[] = { - // region hack of ssf2ud? - { "ssfed.03", 0x080000, 0xfad5daf8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfed.04", 0x080000, 0x0d31af65, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfed.05", 0x080000, 0x75c651ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfed.06", 0x080000, 0x85c3ec00, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfed.07", 0x080000, 0x9320e350, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2d) -STD_ROM_FN(Ssf2d) - -static struct BurnRomInfo Ssf2udRomDesc[] = { - { "ssfud.03a", 0x080000, 0xfad5daf8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfud.04a", 0x080000, 0x0d31af65, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfud.05", 0x080000, 0x75c651ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfud.06", 0x080000, 0x85c3ec00, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfud.07", 0x080000, 0x247e2504, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2ud) -STD_ROM_FN(Ssf2ud) - -static struct BurnRomInfo Ssf2tbdRomDesc[] = { - { "ssfed.3tc", 0x080000, 0x5d86caf8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfed.4tc", 0x080000, 0xf6e1f98d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfed.5t", 0x080000, 0x75c651ef, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfed.6tb", 0x080000, 0x9adac7d7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "ssfed.7t", 0x080000, 0x84f54db3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "ssf.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "ssf.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "ssf.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "ssf.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "ssf.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "ssf.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "ssf.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "ssf.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - - { "ssf.01", 0x020000, 0xeb247e8c, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "ssf.q01", 0x080000, 0xa6f9da5c, CPS2_QSND | BRF_SND }, - { "ssf.q02", 0x080000, 0x8c66ae26, CPS2_QSND | BRF_SND }, - { "ssf.q03", 0x080000, 0x695cc2ca, CPS2_QSND | BRF_SND }, - { "ssf.q04", 0x080000, 0x9d9ebe32, CPS2_QSND | BRF_SND }, - { "ssf.q05", 0x080000, 0x4770e7b7, CPS2_QSND | BRF_SND }, - { "ssf.q06", 0x080000, 0x4e79c951, CPS2_QSND | BRF_SND }, - { "ssf.q07", 0x080000, 0xcdd14313, CPS2_QSND | BRF_SND }, - { "ssf.q08", 0x080000, 0x6f5a088c, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tbd) -STD_ROM_FN(Ssf2tbd) - -static struct BurnRomInfo Ssf2tdRomDesc[] = { - { "sfxed.03c", 0x080000, 0xed99d850, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxed.04a", 0x080000, 0x38d9b364, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxed.05", 0x080000, 0xc63358d0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxed.06a", 0x080000, 0xccb29808, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxed.07", 0x080000, 0x61f94982, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxed.08", 0x080000, 0xd399c36c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxed.09", 0x080000, 0x317b5dbc, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2td) -STD_ROM_FN(Ssf2td) - -static struct BurnRomInfo Ssf2tadRomDesc[] = { - { "sfxad.03c", 0x080000, 0xe3c92ece, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxad.04a", 0x080000, 0x9bf3bb2e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxad.05", 0x080000, 0xc63358d0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxad.06a", 0x080000, 0xccb29808, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxad.07", 0x080000, 0x61f94982, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxad.08", 0x080000, 0xd399c36c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxad.09", 0x080000, 0x436784ae, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2tad) -STD_ROM_FN(Ssf2tad) - -static struct BurnRomInfo Ssf2xjr1dRomDesc[] = { - { "sfxjd.03c", 0x080000, 0x316de996, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxjd.04a", 0x080000, 0x9bf3bb2e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxjd.05", 0x080000, 0xc63358d0, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxjd.06a", 0x080000, 0xccb29808, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxjd.07", 0x080000, 0x61f94982, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxjd.08", 0x080000, 0xd399c36c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "sfxd.09", 0x080000, 0x0b3a6196, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "sfx.13m", 0x200000, 0xcf94d275, CPS2_GFX | BRF_GRA }, - { "sfx.15m", 0x200000, 0x5eb703af, CPS2_GFX | BRF_GRA }, - { "sfx.17m", 0x200000, 0xffa60e0f, CPS2_GFX | BRF_GRA }, - { "sfx.19m", 0x200000, 0x34e825c5, CPS2_GFX | BRF_GRA }, - { "sfx.14m", 0x100000, 0xb7cc32e7, CPS2_GFX | BRF_GRA }, - { "sfx.16m", 0x100000, 0x8376ad18, CPS2_GFX | BRF_GRA }, - { "sfx.18m", 0x100000, 0xf5b1b336, CPS2_GFX | BRF_GRA }, - { "sfx.20m", 0x100000, 0x459d5c6b, CPS2_GFX | BRF_GRA }, - { "sfx.21m", 0x100000, 0xe32854af, CPS2_GFX | BRF_GRA }, - { "sfx.23m", 0x100000, 0x760f2927, CPS2_GFX | BRF_GRA }, - { "sfx.25m", 0x100000, 0x1ee90208, CPS2_GFX | BRF_GRA }, - { "sfx.27m", 0x100000, 0xf814400f, CPS2_GFX | BRF_GRA }, - - { "sfx.01", 0x020000, 0xb47b8835, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "sfx.02", 0x020000, 0x0022633f, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "sfx.11m", 0x200000, 0x9bdbd476, CPS2_QSND | BRF_SND }, - { "sfx.12m", 0x200000, 0xa05e3aab, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Ssf2xjr1d) -STD_ROM_FN(Ssf2xjr1d) - -static struct BurnRomInfo VsavdRomDesc[] = { - { "vm3ed.03d", 0x080000, 0x97d805e3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3ed.04d", 0x080000, 0x5e07fdce, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.05a", 0x080000, 0x4118e00f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.06a", 0x080000, 0x2f4fd3a9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.07b", 0x080000, 0xcbda91b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.08a", 0x080000, 0x6ca47259, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.09b", 0x080000, 0xf4a339e3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vm3.10b", 0x080000, 0xfffbb5b8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vm3.13m", 0x400000, 0xfd8a11eb, CPS2_GFX | BRF_GRA }, - { "vm3.15m", 0x400000, 0xdd1e7d4e, CPS2_GFX | BRF_GRA }, - { "vm3.17m", 0x400000, 0x6b89445e, CPS2_GFX | BRF_GRA }, - { "vm3.19m", 0x400000, 0x3830fdc7, CPS2_GFX | BRF_GRA }, - { "vm3.14m", 0x400000, 0xc1a28e6c, CPS2_GFX | BRF_GRA }, - { "vm3.16m", 0x400000, 0x194a7304, CPS2_GFX | BRF_GRA }, - { "vm3.18m", 0x400000, 0xdf9a9f47, CPS2_GFX | BRF_GRA }, - { "vm3.20m", 0x400000, 0xc22fc3d9, CPS2_GFX | BRF_GRA }, - - { "vm3.01", 0x020000, 0xf778769b, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vm3.02", 0x020000, 0xcc09faa1, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vm3.11m", 0x400000, 0xe80e956e, CPS2_QSND | BRF_SND }, - { "vm3.12m", 0x400000, 0x9cd71557, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vsavd) -STD_ROM_FN(Vsavd) - -static struct BurnRomInfo Vhunt2dRomDesc[] = { -// { "vh2j_d.06", 0x080000, 0xf320ea30, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // apparently a bad dump of vh2j.06, originally loaded instead of vh2j.07 which wasn't encrypted, and clearly not correct - - { "vh2j_d.03a", 0x080000, 0x696e0157, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j_d.04a", 0x080000, 0xced9bba3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.05", 0x080000, 0xde34f624, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.06", 0x080000, 0x6a3b9897, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.07", 0x080000, 0xb021c029, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.08", 0x080000, 0xac873dff, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.09", 0x080000, 0xeaefce9c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vh2j.10", 0x080000, 0x11730952, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vh2.13m", 0x400000, 0x3b02ddaa, CPS2_GFX | BRF_GRA }, - { "vh2.15m", 0x400000, 0x4e40de66, CPS2_GFX | BRF_GRA }, - { "vh2.17m", 0x400000, 0xb31d00c9, CPS2_GFX | BRF_GRA }, - { "vh2.19m", 0x400000, 0x149be3ab, CPS2_GFX | BRF_GRA }, - { "vh2.14m", 0x400000, 0xcd09bd63, CPS2_GFX | BRF_GRA }, - { "vh2.16m", 0x400000, 0xe0182c15, CPS2_GFX | BRF_GRA }, - { "vh2.18m", 0x400000, 0x778dc4f6, CPS2_GFX | BRF_GRA }, - { "vh2.20m", 0x400000, 0x605d9d1d, CPS2_GFX | BRF_GRA }, - - { "vh2.01", 0x020000, 0x67b9f779, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vh2.02", 0x020000, 0xaaf15fcb, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vh2.11m", 0x400000, 0x38922efd, CPS2_QSND | BRF_SND }, - { "vh2.12m", 0x400000, 0x6e2430af, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vhunt2d) -STD_ROM_FN(Vhunt2d) - -static struct BurnRomInfo Vsav2dRomDesc[] = { -// { "vs2j_d.03", 0x080000, 0x5ee19aee, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // bad dump? -// { "vs2j_d.04", 0x080000, 0x80116c47, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // bad dump? -// { "vs2j_d.05", 0x080000, 0xdc74a062, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // apparently a bad dump of vs2j.04, originally loaded instead of vs2j.05 which wasn't encrypted, and clearly not correct -// { "vs2j_d.08", 0x080000, 0x97554918, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // apparently a bad dump of vs2j.08, originally loaded instead of vs2j.08 which wasn't encrypted, and clearly not correct - - { "vs2j_d.03", 0x080000, 0x50865f7b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j_d.04", 0x080000, 0xc3bff0e3, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.05", 0x080000, 0x61979638, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.06", 0x080000, 0xf37c5bc2, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.07", 0x080000, 0x8f885809, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.08", 0x080000, 0x2018c120, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.09", 0x080000, 0xfac3c217, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "vs2j.10", 0x080000, 0xeb490213, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "vs2.13m", 0x400000, 0x5c852f52, CPS2_GFX | BRF_GRA }, - { "vs2.15m", 0x400000, 0xa20f58af, CPS2_GFX | BRF_GRA }, - { "vs2.17m", 0x400000, 0x39db59ad, CPS2_GFX | BRF_GRA }, - { "vs2.19m", 0x400000, 0x00c763a7, CPS2_GFX | BRF_GRA }, - { "vs2.14m", 0x400000, 0xcd09bd63, CPS2_GFX | BRF_GRA }, - { "vs2.16m", 0x400000, 0xe0182c15, CPS2_GFX | BRF_GRA }, - { "vs2.18m", 0x400000, 0x778dc4f6, CPS2_GFX | BRF_GRA }, - { "vs2.20m", 0x400000, 0x605d9d1d, CPS2_GFX | BRF_GRA }, - - { "vs2.01", 0x020000, 0x35190139, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "vs2.02", 0x020000, 0xc32dba09, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "vs2.11m", 0x400000, 0xd67e47b7, CPS2_QSND | BRF_SND }, - { "vs2.12m", 0x400000, 0x6d020a14, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Vsav2d) -STD_ROM_FN(Vsav2d) - -static struct BurnRomInfo Xmcotar1dRomDesc[] = { - { "xmned.03e", 0x080000, 0xbef56003, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmned.04e", 0x080000, 0xb1a21fa6, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.05a", 0x080000, 0xac0d7759, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.06a", 0x080000, 0x1b86a328, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.07a", 0x080000, 0x2c142a44, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.08a", 0x080000, 0xf712d44f, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.09a", 0x080000, 0x9241cae8, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xmn.10a", 0x080000, 0x53c0eab9, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xmn.13m", 0x400000, 0xbf4df073, CPS2_GFX | BRF_GRA }, - { "xmn.15m", 0x400000, 0x4d7e4cef, CPS2_GFX | BRF_GRA }, - { "xmn.17m", 0x400000, 0x513eea17, CPS2_GFX | BRF_GRA }, - { "xmn.19m", 0x400000, 0xd23897fc, CPS2_GFX | BRF_GRA }, - { "xmn.14m", 0x400000, 0x778237b7, CPS2_GFX | BRF_GRA }, - { "xmn.16m", 0x400000, 0x67b36948, CPS2_GFX | BRF_GRA }, - { "xmn.18m", 0x400000, 0x015a7c4c, CPS2_GFX | BRF_GRA }, - { "xmn.20m", 0x400000, 0x9dde2758, CPS2_GFX | BRF_GRA }, - - { "xmn.01a", 0x020000, 0x40f479ea, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xmn.02a", 0x020000, 0x39d9b5ad, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xmn.11m", 0x200000, 0xc848a6bc, CPS2_QSND | BRF_SND }, - { "xmn.12m", 0x200000, 0x729c188f, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmcotar1d) -STD_ROM_FN(Xmcotar1d) - -static struct BurnRomInfo Xmvsfu1dRomDesc[] = { -// { "xvsd.05a", 0x080000, 0xde347b11, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // bad dump?, originally loaded in place of xvs.05a -// { "xvsd.07", 0x080000, 0xf761ded7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // bad dump?, originally loaded in place of xvs.07a - - { "xvsud.03h", 0x080000, 0x4e2e76b7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvsud.04h", 0x080000, 0x290c61a7, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.05a", 0x080000, 0x7db6025d, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.06a", 0x080000, 0xe8e2c75c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.07", 0x080000, 0x08f0abed, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.08", 0x080000, 0x81929675, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "xvs.09", 0x080000, 0x9641f36b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "xvs.13m", 0x400000, 0xf6684efd, CPS2_GFX | BRF_GRA }, - { "xvs.15m", 0x400000, 0x29109221, CPS2_GFX | BRF_GRA }, - { "xvs.17m", 0x400000, 0x92db3474, CPS2_GFX | BRF_GRA }, - { "xvs.19m", 0x400000, 0x3733473c, CPS2_GFX | BRF_GRA }, - { "xvs.14m", 0x400000, 0xbcac2e41, CPS2_GFX | BRF_GRA }, - { "xvs.16m", 0x400000, 0xea04a272, CPS2_GFX | BRF_GRA }, - { "xvs.18m", 0x400000, 0xb0def86a, CPS2_GFX | BRF_GRA }, - { "xvs.20m", 0x400000, 0x4b40ff9f, CPS2_GFX | BRF_GRA }, - - { "xvs.01", 0x020000, 0x3999e93a, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - { "xvs.02", 0x020000, 0x101bdee9, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "xvs.11m", 0x200000, 0x9cadcdbc, CPS2_QSND | BRF_SND }, - { "xvs.12m", 0x200000, 0x7b11e460, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Xmvsfu1d) -STD_ROM_FN(Xmvsfu1d) - -void __fastcall PhoenixOutputWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0xfffff0 && a <= 0xfffffb) { - CpsFrg[a & 0x0f] = d; - // should this value also feed through to RAM (CpsRamFF) or should I return here? - } - - CpsRamFF[(a - 0xff0000) ^ 1] = d; -} - -void __fastcall PhoenixOutputWriteWord(UINT32 a, UINT16 d) -{ - SEK_DEF_WRITE_WORD(3, a, d); -} - -void __fastcall PhoenixSpriteWriteByte(UINT32 a, UINT8 d) -{ - // Not seen anything write here but just in case... - INT32 Offset = a - 0x700000; - - CpsRam708[(Offset ^ 1) + 0x0000] = d; - CpsRam708[(Offset ^ 1) + 0x8000] = d; - - bprintf(PRINT_NORMAL, _T("Phoenix Sprite Write Byte %x, %x\n"), a, d); -} - -void __fastcall PhoenixSpriteWriteWord(UINT32 a, UINT16 d) -{ - UINT16 *Ram = (UINT16*)CpsRam708; - INT32 Offset = (a - 0x700000) >> 1; - - Ram[Offset + 0x0000] = d; - Ram[Offset + 0x4000] = d; -} - -static INT32 PhoenixInit() -{ - INT32 nRet = Cps2Init(); - - nCpsNumScanlines = 262; // phoenix sets seem to be sensitive to timing?? - - SekOpen(0); - SekMapHandler(3, 0xff0000, 0xffffff, MAP_WRITE); - SekSetWriteByteHandler(3, PhoenixOutputWriteByte); - SekSetWriteWordHandler(3, PhoenixOutputWriteWord); - SekMapHandler(4, 0x700000, 0x701fff, MAP_WRITE); - SekSetWriteByteHandler(4, PhoenixSpriteWriteByte); - SekSetWriteWordHandler(4, PhoenixSpriteWriteWord); - SekClose(); - - return nRet; -} - -static INT32 MmatrixPhoenixInit() -{ - Mmatrix = 1; - - return PhoenixInit(); -} - -static INT32 Ssf2PhoenixInit() -{ - INT32 nRet = PhoenixInit(); - - nCpsGfxScroll[3] = 0; - - return nRet; -} - -static int Ssf2tbPhoenixInit() -{ - Ssf2tb = 1; - - return Ssf2PhoenixInit(); -} - -static INT32 Ssf2tPhoenixInit() -{ - INT32 nRet; - - Ssf2t = 1; - - nRet = PhoenixInit(); - - nCpsGfxScroll[3] = 0; - - return nRet; -} - -struct BurnDriver BurnDrvCps19xxd = { - "19xxd", "19xx", NULL, NULL, "1995", - "19XX - the war against destiny (951207 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, NinexxdRomInfo, NinexxdRomName, NULL, NULL, NineXXInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCps1944d = { - "1944d", "1944", NULL, NULL, "2000", - "1944 - the loop master (000620 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, Nine44dRomInfo, Nine44dRomName, NULL, NULL, Nine44InputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCps1944ad = { - "1944ad", "1944", NULL, NULL, "2000", - "1944 - the loop master (000620 USA Phoenix Edition, alt)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, FBF_19XX, - NULL, Nine44adRomInfo, Nine44adRomName, NULL, NULL, Nine44InputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsArmwar1d = { - "armwar1d", "armwar", NULL, NULL, "1994", - "Armored Warriors (941011 Europe Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, Armwar1dRomInfo, Armwar1dRomName, NULL, NULL, ArmwarInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsAvspd = { - "avspd", "avsp", NULL, NULL, "1994", - "Alien vs Predator (940520 Euro Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG ,3,HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, AvspdRomInfo, AvspdRomName, NULL, NULL, AvspInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsBatcird = { - "batcird", "batcir", NULL, NULL, "1997", - "Battle Circuit (970319 Euro Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, BatcirdRomInfo, BatcirdRomName, NULL, NULL, BatcirInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCsclub1d = { - "csclub1d", "csclub", NULL, NULL, "1997", - "Capcom Sports Club (970722 Euro Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_SPORTSMISC, 0, - NULL, Csclub1dRomInfo, Csclub1dRomName, NULL, NULL, CsclubInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCybotsud = { - "cybotsud", "cybots", NULL, NULL, "1995", - "Cyberbots - fullmetal madness (950424 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, CybotsudRomInfo, CybotsudRomName, NULL, NULL, CybotsInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsCybotsjd = { - "cybotsjd", "cybots", NULL, NULL, "1995", - "Cyberbots - fullmetal madness (Japan 950424) (decrypted bootleg)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, CybotsjdRomInfo, CybotsjdRomName, NULL, NULL, CybotsInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdsomud = { - "ddsomud", "ddsom", NULL, NULL, "1996", - "Dungeons & Dragons - shadow over mystara (960619 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdsomudRomInfo, DdsomudRomName, NULL, NULL, DdsomInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDdtodd = { - "ddtodd", "ddtod", NULL, NULL, "1994", - "Dungeons & Dragons - tower of doom (940412 Euro Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_CAPCOM_CPS2, GBF_SCRFIGHT, 0, - NULL, DdtoddRomInfo, DdtoddRomName, NULL, NULL, DdtodInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsDimahoud = { - "dimahoud", "dimahoo", NULL, NULL, "2000", - "Dimahoo (000121 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, DimahoudRomInfo, DimahoudRomName, NULL, NULL, DimahooInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvCpsDstlku1d = { - "dstlku1d", "dstlk", NULL, NULL, "1994", - "Darkstalkers - the night warriors (940705 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Dstlku1dRomInfo, Dstlku1dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsEcofghtrd = { - "ecofghtrd", "ecofghtr", NULL, NULL, "1993", - "Eco Fighters (931203 World Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_HORSHOOT, 0, - NULL, EcofghtrdRomInfo, EcofghtrdRomName, NULL, NULL, EcofghtrInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGigawingd = { - "gigawingd", "gigawing", NULL, NULL, "1999", - "Giga Wing (990222 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, GigawingdRomInfo, GigawingdRomName, NULL, NULL, GigawingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsGigawingjd = { - "gigawingjd", "gigawing", NULL, NULL, "1999", - "Giga Wing (990223 Japan Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, GigawingjdRomInfo, GigawingjdRomName, NULL, NULL, GigawingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsHsf2d = { - "hsf2d", "hsf2", NULL, NULL, "2004", - "Hyper Street Fighter II: The Anniversary Edition (040202 Asia Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Hsf2dRomInfo, Hsf2dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tPhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsHsf2da = { - "hsf2da", "hsf2", NULL, NULL, "2004", - "Hyper Street Fighter II: The Anniversary Edition (040202 Asia Phoenix Edition, alt)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Hsf2daRomInfo, Hsf2daRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tPhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMegamn2d = { - "megamn2d", "megaman2", NULL, NULL, "1996", - "Mega Man 2 - the power fighters (960708 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Megamn2dRomInfo, Megamn2dRomName, NULL, NULL, Megaman2InputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000 ,384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMarsMatrixd = { - "mmatrixd", "mmatrix", NULL, NULL, "2000", - "Mars Matrix (000412 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VERSHOOT, 0, - NULL, MmatrixdRomInfo, MmatrixdRomName, NULL, NULL, MmatrixInputInfo, NULL, - MmatrixPhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMPangjd = { - "mpangjd", "mpang", NULL, NULL, "2000", - "Mighty! Pang (001011 Japan Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_PUZZLE, 0, - NULL, MpangjdRomInfo, MpangjdRomName, NULL, NULL, MpangInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshud = { - "mshud", "msh", NULL, NULL, "1995", - "Marvel Super Heroes (951024 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, MshudRomInfo, MshudRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMshvsfu1d = { - "mshvsfu1d", "mshvsf", NULL, NULL, "1997", - "Marvel Super Heroes vs Street Fighter (970625 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Mshvsfu1dRomInfo, Mshvsfu1dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsMvscud = { - "mvscud", "mvsc", NULL, NULL, "1998", - "Marvel vs Capcom - clash of super heroes (980123 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, MvscudRomInfo, MvscudRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsNwarrud = { - "nwarrud", "nwarr", NULL, NULL, "1995", - "Night Warriors - darkstalkers' revenge (950406 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, NwarrudRomInfo, NwarrudRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsProgearud = { - "progearud", "progear", NULL, NULL, "2001", - "Progear(010117 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_HORSHOOT, 0, - NULL, ProgearudRomInfo, ProgearudRomName, NULL, NULL, ProgearInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsProgearjd = { - "progearjd", "progear", NULL, NULL, "2001", - "Progear No Arashi (010117 Japan Phoenix Edition)\0", NULL, "bootleg", "CPS2", - L"\u30D7\u30ED\u30AE\u30A2\u306E\u5D50 (Progear No Arashi 010117 Japan Phoenix Edition)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_HORSHOOT, 0, - NULL, ProgearjdRomInfo, ProgearjdRomName, NULL, NULL, ProgearInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsRingdstd = { - "ringdstd", "ringdest", NULL, NULL, "1994", - "Ring of Destruction - slammasters II (940902 Euro Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, RingdstdRomInfo, RingdstdRomName, NULL, NULL, RingdestInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfad = { - "sfad", "sfa", NULL, NULL, "1995", - "Street Fighter Alpha - warriors' dreams (950727 Euro Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SfadRomInfo, SfadRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfaud = { - "sfaud", "sfa", NULL, NULL, "1995", - "Street Fighter Alpha - warriors' dreams (950727 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SfaudRomInfo, SfaudRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2ad = { - "sfz2ad", "sfa2", NULL, NULL, "1996", - "Street Fighter Zero 2 (960227 Asia Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2adRomInfo, Sfz2adRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2jd = { - "sfz2jd", "sfa2", NULL, NULL, "1996", - "Street Fighter Zero 2 (960227 Japan Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2jdRomInfo, Sfz2jdRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz2ald = { - "sfz2ald", "sfz2al", NULL, NULL, "1996", - "Street Fighter Zero 2 Alpha (960826 Asia Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG,2,HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz2aldRomInfo, Sfz2aldRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfa3ud = { - "sfa3ud", "sfa3", NULL, NULL, "1998", - "Street Fighter Alpha 3 (980904 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfa3udRomInfo, Sfa3udRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSfz3jr2d = { - "sfz3jr2d", "sfa3", NULL, NULL, "1998", - "Street Fighter Zero 3 (980629 Japan Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Sfz3jr2dRomInfo, Sfz3jr2dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSgemfd = { - "sgemfd", "sgemf", NULL, NULL, "1997", - "Super Gem Fighter Mini Mix (970904 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, SgemfdRomInfo, SgemfdRomName, NULL, NULL, SgemfInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSpf2td = { - "spf2td", "spf2t", NULL, NULL, "1996", - "Super Puzzle Fighter II Turbo (Super Puzzle Fighter 2 Turbo 960620 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_PUZZLE, FBF_SF, - NULL, Spf2tdRomInfo, Spf2tdRomName, NULL, NULL, Spf2tInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSpf2xjd = { - "spf2xjd", "spf2t", NULL, NULL, "1996", - "Super Puzzle Fighter II X (Super Puzzle Fighter 2 X 960531 Japan Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_PUZZLE, FBF_SF, - NULL, Spf2xjdRomInfo, Spf2xjdRomName, NULL, NULL, Spf2tInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2d = { - "ssf2d", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 930911 etc Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2dRomInfo, Ssf2dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2ud = { - "ssf2ud", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the new challengers (super street fighter 2 930911 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2udRomInfo, Ssf2udRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tbd = { - "ssf2tbd", "ssf2", NULL, NULL, "1993", - "Super Street Fighter II - the tournament battle (931119 etc Phoenix Edition)\0", "Linkup feature not implemented", "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tbdRomInfo, Ssf2tbdRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tbPhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2td = { - "ssf2td", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II Turbo (super street fighter 2 X 940223 etc Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tdRomInfo, Ssf2tdRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tPhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2tad = { - "ssf2tad", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II Turbo (super street fighter 2 X 940223 Asia Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2tadRomInfo, Ssf2tadRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tPhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsSsf2xjr1d = { - "ssf2xjr1d", "ssf2t", NULL, NULL, "1994", - "Super Street Fighter II X - grand master challenge (super street fighter 2 X 940223 Japan Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Ssf2xjr1dRomInfo, Ssf2xjr1dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - Ssf2tPhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVsavd = { - "vsavd", "vsav", NULL, NULL, "1997", - "Vampire Savior - the lord of vampire (970519 Euro Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, VsavdRomInfo, VsavdRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVhunt2d = { - "vhunt2d", "vhunt2", NULL, NULL, "1997", - "Vampire Hunter 2 - darkstalkers revenge (970913 Japan Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Vhunt2dRomInfo, Vhunt2dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsVsav2d = { - "vsav2d", "vsav2", NULL, NULL, "1997", - "Vampire Savior 2 - the lord of vampire (970913 Japan Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_DSTLK, - NULL, Vsav2dRomInfo, Vsav2dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmcotar1d = { - "xmcotar1d", "xmcota", NULL, NULL, "1995", - "X-Men - children of the atom (950105 Euro Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Xmcotar1dRomInfo, Xmcotar1dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCpsXmvsfu1d = { - "xmvsfu1d", "xmvsf", NULL, NULL, "1996", - "X-Men vs Street Fighter (961004 USA Phoenix Edition)\0", NULL, "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF, - NULL, Xmvsfu1dRomInfo, Xmvsfu1dRomName, NULL, NULL, Cps2FightingInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// other bootlegs - -// Progear No Arashi (010117 Japan, decrypted set) -static struct BurnRomInfo ProgearjblRomDesc[] = { - { "pgaj_bl.03", 0x080000, 0x4fef676c, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // this fails the rom test - bootleggers probably didn't update checksum - { "pgaj_bl.04", 0x080000, 0xa069bd3b, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, // this fails the rom test - bootleggers probably didn't update checksum - - { "pga.13m", 0x400000, 0x5194c198, CPS2_GFX | BRF_GRA }, - { "pga.15m", 0x400000, 0xb794e83f, CPS2_GFX | BRF_GRA }, - { "pga.17m", 0x400000, 0x87f22918, CPS2_GFX | BRF_GRA }, - { "pga.19m", 0x400000, 0x65ffb45b, CPS2_GFX | BRF_GRA }, - - { "pga.01", 0x020000, 0xbdbfa992, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "pga.11m", 0x400000, 0xabdd224e, CPS2_QSND | BRF_SND }, - { "pga.12m", 0x400000, 0xdac53406, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Progearjbl) -STD_ROM_FN(Progearjbl) - -struct BurnDriver BurnDrvCpsProgearjbl = { - "progearjbl", "progear", NULL, NULL, "2001", - "Progear No Arashi (010117 Japan, decrypted set)\0", NULL, "bootleg", "CPS2", - L"\u30D7\u30ED\u30AE\u30A2\u306E\u5D50 (Progear No Arashi 010117 Japan, decrypted set)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_HORSHOOT, 0, - NULL, ProgearjblRomInfo, ProgearjblRomName, NULL, NULL, ProgearInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Halfway To Hell: Progear Red Label (2016-1-17 Red label ver) -static struct BurnRomInfo HalfwayRomDesc[] = { - { "halfway.03", 0x080000, 0x55ce8d4a, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - { "tohell.04", 0x080000, 0x71060b9e, CPS2_PRG_68K | BRF_ESS | BRF_PRG }, - - { "redlabel.13m", 0x400000, 0x5194c198, CPS2_GFX | BRF_GRA }, - { "redlabel.15m", 0x400000, 0xb794e83f, CPS2_GFX | BRF_GRA }, - { "redlabel.17m", 0x400000, 0x87f22918, CPS2_GFX | BRF_GRA }, - { "redlabel.19m", 0x400000, 0x65ffb45b, CPS2_GFX | BRF_GRA }, - - { "pga.01", 0x020000, 0xbdbfa992, CPS2_PRG_Z80 | BRF_ESS | BRF_PRG }, - - { "redlabel.11m", 0x400000, 0x33ebf625, CPS2_QSND | BRF_SND }, - { "redlabel.12m", 0x400000, 0x47f25cf4, CPS2_QSND | BRF_SND }, - - { "phoenix.key", 0x000014, 0x2cf772b0, CPS2_ENCRYPTION_KEY }, -}; - -STD_ROM_PICK(Halfway) -STD_ROM_FN(Halfway) - -struct BurnDriver BurnDrvCpsHalfway = { - "halfway", "progear", NULL, NULL, "2016", - "Halfway To Hell: Progear Red Label (2016-1-17 Red label ver)\0", NULL, "The Halfway House", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2 | HARDWARE_CAPCOM_CPS2_SIMM, GBF_HORSHOOT, 0, - NULL, HalfwayRomInfo, HalfwayRomName, NULL, NULL, ProgearInputInfo, NULL, - PhoenixInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; - -// Gigaman 2: The Power Fighters (bootleg of Megaman 2) -static struct BurnRomInfo Gigaman2RomDesc[] = { - { "sys_rom1.bin", 0x400000, 0x2eaa5e10, BRF_ESS | BRF_PRG }, - - { "cg_rom1.bin", 0x800000, 0xed55a641, BRF_GRA }, - { "cg_rom2.bin", 0x800000, 0x63918c05, BRF_GRA }, - - { "pcm_rom1.bin", 0x800000, 0x41a854ab, BRF_SND }, - - { "89c4051.bin", 0x010000, 0x00000000, BRF_PRG | BRF_NODUMP }, // sound MCU -}; - -STD_ROM_PICK(Gigaman2) -STD_ROM_FN(Gigaman2) - -static UINT8 *Gigaman2DummyQsndRam = NULL; - -static INT32 Gigaman2Init() -{ - Cps = 2; - Cps2DisableQSnd = 1; - - CpsLayer1XOffs = -0x09; - CpsLayer2XOffs = -0x09; - CpsLayer3XOffs = -0x09; - - nCpsGfxLen = 0x800000; - nCpsRomLen = 0x180000; - nCpsCodeLen = 0x180000; - nCpsZRomLen = 0; - nCpsQSamLen = 0; - nCpsAdLen = 0x800000; - - Gigaman2DummyQsndRam = (UINT8*)BurnMalloc(0x20000); - - CpsInit(); - - INT32 nRet = 0; - - // Load program rom (seperate data and code) - UINT8 *pTemp = (UINT8*)BurnMalloc(0x400000); - if (!pTemp) return 1; - nRet = BurnLoadRom(pTemp, 0, 1); if (nRet) return 1; - memcpy(CpsRom , pTemp + 0x000000, 0x180000); - memcpy(CpsCode, pTemp + 0x200000, 0x180000); - BurnFree(pTemp); - - // Load graphic roms, descramble and decode - pTemp = (UINT8*)BurnMalloc(0xc00000); - if (!pTemp) return 1; - // we are only interested in the first 0x400000 of each rom - nRet = BurnLoadRom(pTemp + 0x000000, 1, 1); if (nRet) return 1; - nRet = BurnLoadRom(pTemp + 0x400000, 2, 1); if (nRet) return 1; - - // copy to CpsGfx as a temp buffer and descramble - memcpy(CpsGfx, pTemp, nCpsGfxLen); - memset(pTemp, 0, 0xc00000); - UINT16 *pTemp16 = (UINT16*)pTemp; - UINT16 *CpsGfx16 = (UINT16*)CpsGfx; - for (INT32 i = 0; i < 0x800000 >> 1; i++) { - pTemp16[i] = CpsGfx16[((i & ~7) >> 2) | ((i & 4) << 18) | ((i & 2) >> 1) | ((i & 1) << 21)]; - } - - // copy back to CpsGfx as a temp buffer and put into a format easier to decode - memcpy(CpsGfx, pTemp, nCpsGfxLen); - memset(pTemp, 0, 0xc00000); - for (INT32 i = 0; i < 0x100000; i++) { - pTemp16[i + 0x000000] = CpsGfx16[(i * 4) + 0]; - pTemp16[i + 0x100000] = CpsGfx16[(i * 4) + 1]; - pTemp16[i + 0x200000] = CpsGfx16[(i * 4) + 2]; - pTemp16[i + 0x300000] = CpsGfx16[(i * 4) + 3]; - } - - // clear CpsGfx and finally decode - memset(CpsGfx, 0, nCpsGfxLen); - Cps2LoadTilesGigaman2(CpsGfx, pTemp); - BurnFree(pTemp); - - // Load the MSM6295 Data - nRet = BurnLoadRom(CpsAd, 3, 1); if (nRet) return 1; - - nRet = CpsRunInit(); - - SekOpen(0); - SekMapMemory(Gigaman2DummyQsndRam, 0x618000, 0x619fff, MAP_RAM); - SekClose(); - -// nCpsNumScanlines = 262; // phoenix sets seem to be sensitive to timing?? - - return nRet; -} - -static INT32 Gigaman2Exit() -{ - BurnFree(Gigaman2DummyQsndRam); - - return DrvExit(); -} - -static INT32 Gigaman2Scan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = Gigaman2DummyQsndRam; - ba.nLen = 0x020000; - ba.szName = "Gigaman2DummyQsndRam"; - BurnAcb(&ba); - } - - return CpsAreaScan(nAction, pnMin); -} - -struct BurnDriver BurnDrvCpsGigaman2 = { - "gigaman2", "megaman2", NULL, NULL, "1996", - "Gigaman 2: The Power Fighters (bootleg)\0", "No Sound (MCU not dumped)", "bootleg", "CPS2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, 0, - NULL, Gigaman2RomInfo, Gigaman2RomName, NULL, NULL, Megaman2InputInfo, NULL, - Gigaman2Init, Gigaman2Exit, Cps2Frame, CpsRedraw, Gigaman2Scan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/capcom/d_kenseim.h b/jan/src/burn/drv/capcom/d_kenseim.h deleted file mode 100644 index 13d45a6dc..000000000 --- a/jan/src/burn/drv/capcom/d_kenseim.h +++ /dev/null @@ -1,269 +0,0 @@ -static UINT8 KenseimInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 KenseimInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 KenseimInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 KenseimDip[2] = {0, 0}; -static UINT8 KenseimInput[3] = {0x00, 0x00, 0x00}; -static UINT8 KenseimReset = 0; -static UINT8 *KenseimRom = NULL; -static UINT8 *KenseimRam = NULL; - -static struct BurnInputInfo KenseimInputList[] = -{ - {"Coin" , BIT_DIGITAL , KenseimInputPort0 + 0, "p1 coin" }, - {"Ryu Start" , BIT_DIGITAL , KenseimInputPort0 + 1, "p1 start" }, - {"Chun-Li Start" , BIT_DIGITAL , KenseimInputPort0 + 2, "p2 start" }, - - {"Mole A1" , BIT_DIGITAL , KenseimInputPort1 + 0, "p1 fire 1" }, - {"Mole A2" , BIT_DIGITAL , KenseimInputPort1 + 1, "p1 fire 2" }, - {"Mole A3" , BIT_DIGITAL , KenseimInputPort1 + 2, "p1 fire 3" }, - {"Mole A4" , BIT_DIGITAL , KenseimInputPort1 + 3, "p1 fire 4" }, - {"Mole A5" , BIT_DIGITAL , KenseimInputPort1 + 4, "p1 fire 5" }, - {"Mole A6" , BIT_DIGITAL , KenseimInputPort1 + 5, "p1 fire 6" }, - - {"Mole B1" , BIT_DIGITAL , KenseimInputPort2 + 0, "p2 fire 1" }, - {"Mole B2" , BIT_DIGITAL , KenseimInputPort2 + 1, "p2 fire 2" }, - {"Mole B3" , BIT_DIGITAL , KenseimInputPort2 + 2, "p2 fire 3" }, - {"Mole B4" , BIT_DIGITAL , KenseimInputPort2 + 3, "p2 fire 4" }, - {"Mole B5" , BIT_DIGITAL , KenseimInputPort2 + 4, "p2 fire 5" }, - {"Mole B6" , BIT_DIGITAL , KenseimInputPort2 + 5, "p2 fire 6" }, - - {"Reset" , BIT_DIGITAL , &KenseimReset , "reset" }, - {"Service" , BIT_DIGITAL , KenseimInputPort0 + 3, "service" }, - {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip" }, - {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip" }, - {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip" }, - {"Dip 1" , BIT_DIPSWITCH, KenseimDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, KenseimDip + 1 , "dip" }, -}; - -STDINPUTINFO(Kenseim) - -static struct BurnDIPInfo KenseimDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x20, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // CPS Dip C - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x10, 0x08, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x14, 0x01, 0x03, 0x00, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x03, 0x01, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x03, 0x03, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Head Appear Once Ratio" }, - {0x14, 0x01, 0x0c, 0x00, "0" }, - {0x14, 0x01, 0x0c, 0x04, "1" }, - {0x14, 0x01, 0x0c, 0x08, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - - {0 , 0xfe, 0 , 4 , "Strength of Computer" }, - {0x14, 0x01, 0x30, 0x00, "0" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - - {0 , 0xfe, 0 , 2 , "Game Time" }, - {0x14, 0x01, 0x40, 0x00, "Long (59 seconds)" }, - {0x14, 0x01, 0x40, 0x40, "Short (49 seconds)" }, - - {0 , 0xfe, 0 , 2 , "Winner of 2 Player faces Vega" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Unknown 1 (1-bit)" }, - {0x15, 0x01, 0x01, 0x00, "0" }, - {0x15, 0x01, 0x01, 0x01, "1" }, - - {0 , 0xfe, 0 , 4 , "Unknown 2 (2-bit)" }, - {0x15, 0x01, 0x06, 0x00, "0" }, - {0x15, 0x01, 0x06, 0x02, "1" }, - {0x15, 0x01, 0x06, 0x04, "2" }, - {0x15, 0x01, 0x06, 0x06, "3" }, - - {0 , 0xfe, 0 , 4 , "Unknown 3 (2-bit)" }, - {0x15, 0x01, 0x18, 0x00, "0" }, - {0x15, 0x01, 0x18, 0x08, "1" }, - {0x15, 0x01, 0x18, 0x10, "2" }, - {0x15, 0x01, 0x18, 0x18, "3" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kenseim) - -static struct BurnRomInfo KenseimRomDesc[] = { - { "knm_23.8f", 0x080000, 0xf8368900, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - { "knm_21.6f", 0x080000, 0xa8025e91, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - // repeat to allocate enough memory and load in right place - { "knm_21.6f", 0x080000, 0xa8025e91, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_NO_BYTESWAP }, - - { "knm_01.3a", 0x080000, 0x923f0c0c, BRF_GRA | CPS1_TILES }, - { "knm_02.4a", 0x080000, 0xfa694f67, BRF_GRA | CPS1_TILES }, - { "knm_03.5a", 0x080000, 0xaf7af02c, BRF_GRA | CPS1_TILES }, - { "knm_04.6a", 0x080000, 0x607a9af4, BRF_GRA | CPS1_TILES }, - { "knm_05.7a", 0x080000, 0xd877eee9, BRF_GRA | CPS1_TILES }, - { "knm_06.8a", 0x080000, 0x8821a281, BRF_GRA | CPS1_TILES }, - { "knm_07.9a", 0x080000, 0x00306d09, BRF_GRA | CPS1_TILES }, - { "knm_08.10a", 0x080000, 0x4a329d16, BRF_GRA | CPS1_TILES }, - { "knm_10.3c", 0x080000, 0xca93a942, BRF_GRA | CPS1_TILES }, - { "knm_11.4c", 0x080000, 0xa91f3091, BRF_GRA | CPS1_TILES }, - { "knm_12.5c", 0x080000, 0x5da8303a, BRF_GRA | CPS1_TILES }, - { "knm_13.6c", 0x080000, 0x889bb671, BRF_GRA | CPS1_TILES }, - - { "knm_09.12a", 0x020000, 0x15394dd7, BRF_PRG | CPS1_Z80_PROGRAM }, - - { "knm_18.11c", 0x020000, 0x9e3e4773, BRF_SND | CPS1_OKIM6295_SAMPLES }, - { "knm_19.12c", 0x020000, 0xd6c4047f, BRF_SND | CPS1_OKIM6295_SAMPLES }, - - A_BOARD_PLDS - - { "knm10b.1a", 0x000117, 0xe40131d4, BRF_OPT }, // b-board PLDs - { "iob1.12d", 0x000117, 0x3abc0700, BRF_OPT }, - { "bprg1.11d", 0x000117, 0x31793da7, BRF_OPT }, - { "ioc1.ic7", 0x000117, 0x0d182081, BRF_OPT }, // c-board PLDs - { "c632.ic1", 0x000117, 0x0fbd9270, BRF_OPT }, - - { "kensei_mogura_ver1.0.u2", 0x008000, 0x725cfcfc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(Kenseim) -STD_ROM_FN(Kenseim) - -static inline void KenseimMakeInputs() -{ - // Reset Inputs - KenseimInput[0] = 0x00; - KenseimInput[1] = 0x20; - KenseimInput[2] = 0x20; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - KenseimInput[0] |= (KenseimInputPort0[i] & 1) << i; - } - - for (INT32 i = 0; i < 6; i++) { - KenseimInput[1] -= (KenseimInputPort1[i] & 1) << i; - KenseimInput[2] -= (KenseimInputPort2[i] & 1) << i; - } -} - -static INT32 KenseimDoReset() -{ - CpsReset = 1; - - ZetOpen(1); - ZetReset(); - ZetClose(); - - return 0; -} - -static UINT8 __fastcall KenseimPortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Port Read => %02X\n"), a); - } - } - - return 0; -} - -static void __fastcall KenseimPortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Port Write => %02X, %02X\n"), a, d); - } - } -} - -static INT32 KenseimInit() -{ - KenseimRom = BurnMalloc(0x8000 * sizeof(UINT8)); - KenseimRam = BurnMalloc(0x8000 * sizeof(UINT8)); - - ZetInit(1); - ZetOpen(1); - ZetSetInHandler(KenseimPortRead); - ZetSetOutHandler(KenseimPortWrite); - ZetMapArea(0x0000, 0x7fff, 0, KenseimRom); - ZetMapArea(0x0000, 0x7fff, 2, KenseimRom); - ZetMapArea(0x8000, 0xffff, 0, KenseimRam); - ZetMapArea(0x8000, 0xffff, 1, KenseimRam); - ZetMapArea(0x8000, 0xffff, 2, KenseimRam); - ZetClose(); - - return DrvInit(); -} - -static INT32 KenseimExit() -{ - ZetExit(); - - BurnFree(KenseimRom); - BurnFree(KenseimRam); - - return DrvExit(); -} - -static INT32 KenseimFrame() -{ - INT32 nCyclesTotal = (8000000 / 2) / 60; - - if (KenseimReset) { - KenseimDoReset(); - } - - KenseimMakeInputs(); - - ZetOpen(1); - ZetRun(nCyclesTotal); - ZetClose(); - - return Cps1Frame(); -} - -static INT32 KenseimRedraw() -{ - return CpsRedraw(); -} - -static INT32 KenseimScan(INT32 nAction, INT32 *pnMin) -{ - return CpsAreaScan(nAction, pnMin); -} - -struct BurnDriverD BurnDrvCpsKenseim = { - "kenseim", NULL, NULL, NULL, "1994", - "Ken Sei Mogura: Street Fighter II (Japan 940418, Ver 1.00)\0", NULL, "Capcom / Togo / Sigma", "CPS1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_CAPCOM_CPS1, GBF_MINIGAMES, 0, - NULL, KenseimRomInfo, KenseimRomName, NULL, NULL, KenseimInputInfo, KenseimDIPInfo, - KenseimInit, KenseimExit, KenseimFrame, KenseimRedraw, KenseimScan, - &CpsRecalcPal, 0x1000, 384, 224, 4, 3 -}; \ No newline at end of file diff --git a/jan/src/burn/drv/capcom/fcrash_snd.cpp b/jan/src/burn/drv/capcom/fcrash_snd.cpp deleted file mode 100644 index 3c23b0b8f..000000000 --- a/jan/src/burn/drv/capcom/fcrash_snd.cpp +++ /dev/null @@ -1,279 +0,0 @@ -#include "cps.h" -#include "burn_ym2203.h" -#include "msm5205.h" - -// fcrash_snd.cpp -// Sound support for games using similar sound to Final Crash -// 2 x YM2203 and 2 x MSM5205 - -static UINT8 *FcrashZ80Ram = NULL; -static INT32 FcrashZ80BankAddress = 0; -static INT32 FcrashSoundLatch = 0; -static INT32 FcrashMSM5205Interleave = 0; -static INT32 FcrashSampleBuffer1 = 0; -static INT32 FcrashSampleBuffer2 = 0; -static INT32 FcrashSampleSelect1 = 0; -static INT32 FcrashSampleSelect2 = 0; -static INT32 FcrashSoundPos = 0; -static INT32 FcrashCyclesPerSegment = 0; - -void FcrashSoundCommand(UINT16 d) -{ - INT32 nCyclesToDo = ((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles) - ZetTotalCycles(); - INT32 nEnd = FcrashSoundPos + (INT64)FcrashMSM5205Interleave * nCyclesToDo / nCpsZ80Cycles; - - if (nEnd == FcrashSoundPos) nEnd += 1; - - for (INT32 i = FcrashSoundPos; i < nEnd; i++) { - BurnTimerUpdate((i + 1) * FcrashCyclesPerSegment); - MSM5205Update(); - FcrashSoundPos = i; - } - - FcrashSoundLatch = d & 0xff; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); -} - -UINT8 __fastcall FcrashZ80Read(UINT16 a) -{ - switch (a) { - case 0xd800: { - return BurnYM2203Read(0, 0); - } - - case 0xdc00: { - return BurnYM2203Read(1, 0); - } - - case 0xe400: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return FcrashSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall FcrashZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xd800: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0xd801: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xdc00: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0xdc01: { - BurnYM2203Write(1, 1, d); - return; - } - - case 0xe000: { - MSM5205SetRoute(0, (d & 0x08) ? 0 : 0.25, BURN_SND_ROUTE_BOTH); - MSM5205SetRoute(1, (d & 0x10) ? 0 : 0.25, BURN_SND_ROUTE_BOTH); - - FcrashZ80BankAddress = (d & 0x07) * 0x4000; - ZetMapArea(0x8000, 0xbfff, 0, CpsZRom + FcrashZ80BankAddress); - ZetMapArea(0x8000, 0xbfff, 2, CpsZRom + FcrashZ80BankAddress); - return; - } - - case 0xe800: { - FcrashSampleBuffer1 = d; - return; - } - - case 0xec00: { - FcrashSampleBuffer2 = d; - return; - } - - case 0xf002: - case 0xf004: - case 0xf006: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -inline static INT32 FcrashSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate / (24000000 / 6)); -} - -inline static double FcrashGetTime() -{ - return (double)ZetTotalCycles() / (24000000 / 6); -} - -static void FcrashMSM5205Vck0() -{ - MSM5205DataWrite(0, FcrashSampleBuffer1 & 0x0f); - FcrashSampleBuffer1 >>= 4; - FcrashSampleSelect1 ^= 1; - if (FcrashSampleSelect1 == 0) { - ZetNmi(); - } -} - -static void FcrashMSM5205Vck1() -{ - MSM5205DataWrite(1, FcrashSampleBuffer2 & 0x0f); - FcrashSampleBuffer2 >>= 4; - FcrashSampleSelect2 ^= 1; -} - -INT32 FcrashSoundInit() -{ - FcrashZ80Ram = (UINT8*)BurnMalloc(0x800); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(FcrashZ80Read); - ZetSetWriteHandler(FcrashZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, CpsZRom + 0x00000); - ZetMapArea(0x0000, 0x7fff, 2, CpsZRom + 0x00000); - ZetMapArea(0x8000, 0xbfff, 0, CpsZRom + 0x08000); - ZetMapArea(0x8000, 0xbfff, 2, CpsZRom + 0x08000); - ZetMapArea(0xd000, 0xd7ff, 0, FcrashZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 1, FcrashZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 2, FcrashZ80Ram ); - ZetClose(); - - BurnYM2203Init(2, 24000000 / 6, NULL, FcrashSynchroniseStream, FcrashGetTime, 0); - BurnTimerAttachZet(24000000 / 6); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.07, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.07, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.07, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.07, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.07, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.07, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, FcrashSynchroniseStream, 24000000 / 64, FcrashMSM5205Vck0, MSM5205_S96_4B, 1); - MSM5205Init(1, FcrashSynchroniseStream, 24000000 / 64, FcrashMSM5205Vck1, MSM5205_S96_4B, 1); - MSM5205SetRoute(0, 0.25, BURN_SND_ROUTE_BOTH); - MSM5205SetRoute(1, 0.25, BURN_SND_ROUTE_BOTH); - - nCpsZ80Cycles = (24000000 / 6) * 100 / nBurnFPS; - - return 0; -} - -INT32 FcrashSoundReset() -{ - ZetOpen(0); - ZetReset(); - BurnYM2203Reset(); - MSM5205Reset(); - FcrashZ80BankAddress = 0x8000; - ZetMapArea(0x8000, 0xbfff, 0, CpsZRom + FcrashZ80BankAddress); - ZetMapArea(0x8000, 0xbfff, 2, CpsZRom + FcrashZ80BankAddress); - ZetClose(); - - FcrashSoundLatch = 0; - FcrashSampleBuffer1 = 0; - FcrashSampleBuffer2 = 0; - FcrashSampleSelect1 = 0; - FcrashSampleSelect2 = 0; - - return 0; -} - -INT32 FcrashSoundExit() -{ - ZetExit(); - BurnYM2203Exit(); - MSM5205Exit(); - - BurnFree(FcrashZ80Ram); - - FcrashZ80BankAddress = 0; - FcrashSoundLatch = 0; - FcrashMSM5205Interleave = 0; - FcrashSampleBuffer1 = 0; - FcrashSampleBuffer2 = 0; - FcrashSampleSelect1 = 0; - FcrashSampleSelect2 = 0; - FcrashCyclesPerSegment = 0; - - nCpsZ80Cycles = 0; - - return 0; -} - -void FcrashSoundFrameStart() -{ - FcrashMSM5205Interleave = MSM5205CalcInterleave(0, 24000000 / 6); - FcrashSoundPos = 0; - FcrashCyclesPerSegment = (INT64)nCpsZ80Cycles / FcrashMSM5205Interleave; - - ZetNewFrame(); - ZetOpen(0); -} - -void FcrashSoundFrameEnd() -{ - for (INT32 i = FcrashSoundPos; i < FcrashMSM5205Interleave; i++) { - BurnTimerUpdate((i + 1) * FcrashCyclesPerSegment); - MSM5205Update(); - FcrashSoundPos = i; - } - BurnTimerEndFrame(nCpsZ80Cycles); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - MSM5205Render(1, pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); -} - -INT32 FcrashScanSound(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_MEMORY_RAM) { - struct BurnArea ba; - memset(&ba, 0, sizeof(ba)); - - ba.Data = FcrashZ80Ram; - ba.nLen = 0x00800; - ba.szName = "FcrashZ80Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - - SCAN_VAR(FcrashZ80BankAddress); - SCAN_VAR(FcrashSoundLatch); - SCAN_VAR(FcrashSampleBuffer1); - SCAN_VAR(FcrashSampleBuffer2); - SCAN_VAR(FcrashSampleSelect1); - SCAN_VAR(FcrashSampleSelect2); - SCAN_VAR(FcrashSoundPos); - } - - return 0; -} diff --git a/jan/src/burn/drv/capcom/kabuki.cpp b/jan/src/burn/drv/capcom/kabuki.cpp deleted file mode 100644 index 43850cf49..000000000 --- a/jan/src/burn/drv/capcom/kabuki.cpp +++ /dev/null @@ -1,167 +0,0 @@ -// This file is based on the MAME source code (see http://www.mame.net/) - -/*************************************************************************** - -"Kabuki" Z80 encryption - - -The "Kabuki" is a custom Z80 module which runs encrypted code. The encryption -key is stored in some battery-backed RAM, therefore the chip has the annoying -habit of stopping working every few years, when the battery dies. -Check at the bottom of this text to see a list of all the known games which -use this chip. - - -How it works: -The base operation is a bit swap which affects couples of adjacent bits. -Each of the 4 couples may or may not be swapped, depending on the address of -the byte and on whether it is an opcode or data. -The decryption consists of these steps: -- bitswap -- ROL -- bitswap -- XOR with a key -- ROL -- bitswap -- ROL -- bitswap - -To know how to apply the bit swap, take the address of the byte to decode and: -- if the byte is an opcode, add addr_key to the address -- if the byte is data, XOR the address with 1FC0, add 1, and then add addr_key -You'll get a 16-bit word. The first two bitswaps depend on bits 0-7 of that -word, while the second two on bits 8-15. When a bit in the word is 1, swap the -two bits, oherwise don't. The exact couple of bits affected depends on the -game and is identified in this file with two keys: swap_key1 and swap_key2 -(which are just permutations of the numbers 0-7, not full 32-bit integers). - - -Key space size: -- swap_key1 8! = 40320 -- swap_key2 8! = 40320 -- addr_key 2^16 = 65536 -- xor_key 2^8 = 256 -- total 2.7274 * 10^16 - - -Weaknesses: -- 0x00 and 0xff, having all the bits set to the same value, are not affected - by bit permutations after the XOR. Therefore, their encryption is the same - regardless of the high 8 bits of the address, and of the value of - swap_key2. If there is a long stream of 0x00 or 0xff in the original data, - this can be used to find by brute force all the candidates for swap_key1, - xor_key, and for the low 8 bits of addr_key. This is a serious weakness - which dramatically reduces the security of the encryption. -- A 0x00 is always encrypted as a byte with as many 1s as xor_key; a 0xff is - always encrypted as a byte with as many 0s as xor_key has 1s. So you just - need to know one 0x00 or 0xff in the unencrypted data to know how many 1s - there are in xor_key. -- Once you have restricted the range for swap_key1 and you know the number of - 1s in the xor_key, you can easily use known plaintext attacks and brute - force to find the remaining keys. Long strings like THIS GAME IS FOR USE IN - and ABCDEFGHIJKLMNOPQRSTUVWXYZ can be found by comparing the number of 1s - in the clear and encrypted data, taking xor_key into account. When you have - found where the string is, use brute force to reduce the key space. - - -Known games: - swap_key1 swap_key2 addr_key xor_key -Mahjong Gakuen 2 Gakuen-chou no Fukushuu 76543210 01234567 aa55 a5 -Poker Ladies " " " " "" "" -Dokaben " " " " "" "" -Dokaben 2 unknown -Pang / Buster Bros / Pomping World 01234567 76543210 6548 24 -Capcom Baseball " " " " "" "" -Capcom World 04152637 40516273 5751 43 -Adventure Quiz 2 Hatena ? no Dai-Bouken 45670123 45670123 5751 43 -Super Pang 45670123 45670123 5852 43 -Super Buster Bros 45670123 45670123 2130 12 -Super Marukin-Ban 54321076 54321076 4854 4f -Quiz Tonosama no Yabou 12345670 12345670 1111 11 -Ashita Tenki ni Naare unknown -Quiz Sangokushi 23456701 23456701 1828 18 -Block Block 02461357 64207531 0002 01 - -Warriors of Fate 01234567 54163072 5151 51 -Cadillacs and Dinosaurs 76543210 24601357 4343 43 -Punisher 67452103 75316024 2222 22 -Slam Masters 54321076 65432107 3131 19 - -***************************************************************************/ - -// #include "driver.h" -#include "cps.h" - - -static INT32 bitswap1(INT32 src,INT32 key,INT32 select) -{ - if (select & (1 << ((key >> 0) & 7))) - src = (src & 0xfc) | ((src & 0x01) << 1) | ((src & 0x02) >> 1); - if (select & (1 << ((key >> 4) & 7))) - src = (src & 0xf3) | ((src & 0x04) << 1) | ((src & 0x08) >> 1); - if (select & (1 << ((key >> 8) & 7))) - src = (src & 0xcf) | ((src & 0x10) << 1) | ((src & 0x20) >> 1); - if (select & (1 << ((key >>12) & 7))) - src = (src & 0x3f) | ((src & 0x40) << 1) | ((src & 0x80) >> 1); - - return src; -} - -static INT32 bitswap2(INT32 src,INT32 key,INT32 select) -{ - if (select & (1 << ((key >>12) & 7))) - src = (src & 0xfc) | ((src & 0x01) << 1) | ((src & 0x02) >> 1); - if (select & (1 << ((key >> 8) & 7))) - src = (src & 0xf3) | ((src & 0x04) << 1) | ((src & 0x08) >> 1); - if (select & (1 << ((key >> 4) & 7))) - src = (src & 0xcf) | ((src & 0x10) << 1) | ((src & 0x20) >> 1); - if (select & (1 << ((key >> 0) & 7))) - src = (src & 0x3f) | ((src & 0x40) << 1) | ((src & 0x80) >> 1); - - return src; -} - -static INT32 bytedecode(INT32 src,INT32 swap_key1,INT32 swap_key2,INT32 xor_key,INT32 select) -{ - src = bitswap1(src,swap_key1 & 0xffff,select & 0xff); - src = ((src & 0x7f) << 1) | ((src & 0x80) >> 7); - src = bitswap2(src,swap_key1 >> 16,select & 0xff); - src ^= xor_key; - src = ((src & 0x7f) << 1) | ((src & 0x80) >> 7); - src = bitswap2(src,swap_key2 & 0xffff,select >> 8); - src = ((src & 0x7f) << 1) | ((src & 0x80) >> 7); - src = bitswap1(src,swap_key2 >> 16,select >> 8); - return src; -} - -void kabuki_decode(UINT8 *src,UINT8 *dest_op,UINT8 *dest_data, - INT32 base_addr,INT32 length,INT32 swap_key1,INT32 swap_key2,INT32 addr_key,INT32 xor_key) -{ - INT32 A; - INT32 select; - - for (A = 0;A < length;A++) - { - /* decode opcodes */ - select = (A + base_addr) + addr_key; - dest_op[A] = (UINT8)bytedecode(src[A],swap_key1,swap_key2,xor_key,select); - - /* decode data */ - select = ((A + base_addr) ^ 0x1fc0) + addr_key + 1; - dest_data[A] = (UINT8)bytedecode(src[A],swap_key1,swap_key2,xor_key,select); - } -} - -static void cps1_decode(INT32 swap_key1,INT32 swap_key2,INT32 addr_key,INT32 xor_key) -{ - UINT8 *rom = CpsZRom; - INT32 diff = nCpsZRomLen / 2; - - CpsZRom=rom+diff; - kabuki_decode(rom,rom+diff,rom,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key); -} - -void wof_decode(void) { cps1_decode(0x01234567,0x54163072,0x5151,0x51); } -void dino_decode(void) { cps1_decode(0x76543210,0x24601357,0x4343,0x43); } -void punisher_decode(void) { cps1_decode(0x67452103,0x75316024,0x2222,0x22); } -void slammast_decode(void) { cps1_decode(0x54321076,0x65432107,0x3131,0x19); } diff --git a/jan/src/burn/drv/capcom/ps.cpp b/jan/src/burn/drv/capcom/ps.cpp deleted file mode 100644 index c48eceb10..000000000 --- a/jan/src/burn/drv/capcom/ps.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// PSound (CPS1 sound) -#include "cps.h" -#include "driver.h" -extern "C" { - #include "ym2151.h" -} - -UINT8 PsndCode, PsndFade; // Sound code/fade sent to the z80 program - -static INT32 nSyncPeriod; -static INT32 nSyncNext; - -static INT32 nCyclesDone; - -static void drvYM2151IRQHandler(INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - ZetRun(0x0800); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -INT32 PsndInit() -{ - nCpsZ80Cycles = 4000000 * 100 / nBurnFPS; - nSyncPeriod = nCpsZ80Cycles / 32; - - // Init PSound z80 - if (PsndZInit()!= 0) { - return 1; - } - - // Init PSound mixing (not critical if it fails) - PsmInit(); - - YM2151SetIrqHandler(0, &drvYM2151IRQHandler); - - PsndCode = 0; PsndFade = 0; - - nCyclesDone = 0; - - return 0; -} - -INT32 PsndExit() -{ - PsmExit(); - PsndZExit(); - - return 0; -} - -INT32 PsndScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nCyclesDone); SCAN_VAR(nSyncNext); - PsndZScan(nAction); // Scan Z80 - SCAN_VAR(PsndCode); SCAN_VAR(PsndFade); // Scan sound info - } - return 0; -} - -void PsndNewFrame() -{ - ZetNewFrame(); - PsmNewFrame(); - nSyncNext = nSyncPeriod; - - ZetIdle(nCyclesDone % nCpsZ80Cycles); - nCyclesDone = 0; -} - -INT32 PsndSyncZ80(INT32 nCycles) -{ - while (nSyncNext < nCycles) { - PsmUpdate(nSyncNext * nBurnSoundLen / nCpsZ80Cycles); - ZetRun(nSyncNext - ZetTotalCycles()); - nSyncNext += nSyncPeriod; - } - - nCyclesDone = ZetRun(nCycles - ZetTotalCycles()); - - return 0; -} diff --git a/jan/src/burn/drv/capcom/ps_m.cpp b/jan/src/burn/drv/capcom/ps_m.cpp deleted file mode 100644 index d7601d576..000000000 --- a/jan/src/burn/drv/capcom/ps_m.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "cps.h" -#include "burn_ym2151.h" - -// CPS1 sound Mixing - -INT32 bPsmOkay = 0; // 1 if the module is okay -static INT16* WaveBuf = NULL; - -static INT32 nPos; - -INT32 PsmInit() -{ - INT32 nMemLen, nRate, nRet; - bPsmOkay = 0; // not OK yet - - if (nBurnSoundRate > 0) { - nRate = nBurnSoundRate; - } else { - nRate = 11025; - } - - if (BurnYM2151Init(3579540)) { // Init FM sound chip - return 1; - } - BurnYM2151SetAllRoutes(0.35, BURN_SND_ROUTE_BOTH); - - // Allocate a buffer for the intermediate sound (between YM2151 and pBurnSoundOut) - nMemLen = nBurnSoundLen * 2 * sizeof(INT16); - WaveBuf = (INT16*)BurnMalloc(nMemLen); - if (WaveBuf == NULL) { - PsmExit(); - return 1; - } - memset(WaveBuf, 0, nMemLen); // Init to silence - - // Init ADPCM - MSM6295ROM = CpsAd; - if (Forgottn) { - nRet = MSM6295Init(0, 6061, 1); - } else { - nRet = MSM6295Init(0, 7576, 1); - } - MSM6295SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - - if (nRet!=0) { - PsmExit(); return 1; - } - - bPsmOkay = 1; // OK - - return 0; -} - -INT32 PsmExit() -{ - bPsmOkay = 0; - - MSM6295Exit(0); - - BurnFree(WaveBuf); - - BurnYM2151Exit(); // Exit FM sound chip - return 0; -} - -void PsmNewFrame() -{ - nPos = 0; -} - -INT32 PsmUpdate(INT32 nEnd) -{ - if (bPsmOkay == 0 || pBurnSoundOut == NULL) { - return 1; - } - - if (nEnd <= nPos) { - return 0; - } - if (nEnd > nBurnSoundLen) { - nEnd = nBurnSoundLen; - } - - // Render FM - BurnYM2151Render(pBurnSoundOut + (nPos << 1), nEnd - nPos); - - // Render ADPCM - MSM6295Render(0, pBurnSoundOut + (nPos << 1), nEnd - nPos); - - nPos = nEnd; - - return 0; -} diff --git a/jan/src/burn/drv/capcom/ps_z.cpp b/jan/src/burn/drv/capcom/ps_z.cpp deleted file mode 100644 index 7d0a27466..000000000 --- a/jan/src/burn/drv/capcom/ps_z.cpp +++ /dev/null @@ -1,205 +0,0 @@ -#include "cps.h" -#include "burn_ym2151.h" - -// PSound - Z80 -static INT32 nPsndZBank = 0; -static UINT8 *PsndZRam = NULL; - -INT32 Kodb = 0; - -// Map in the memory for the current 0zx8000-0xc000 bank -static INT32 PsndZBankMap() -{ - UINT8 *Bank; - UINT32 nOff = (nPsndZBank << 14) + 0x8000; - - if (nOff + 0x4000 > nCpsZRomLen) { // End of bank in out of range - nOff = 0; - } - - Bank = CpsZRom + nOff; - - // Read and fetch the bank - ZetMapArea(0x8000, 0xBFFF, 0, Bank); - ZetMapArea(0x8000, 0xBFFF, 2, Bank); - - return 0; -} - -// PSound Z80 memory write -void __fastcall PsndZWrite(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xF000: - BurnYM2151SelectRegister(d); -// bprintf(PRINT_NORMAL, "YM2151 select -> %02X\n", d); - break; - case 0xF001: - BurnYM2151WriteRegister(d); -// bprintf(PRINT_NORMAL, "YM2151 write -> %02X\n", d); - break; - case 0xF002: - MSM6295Command(0, d); - break; - case 0xF004: { - INT32 nNewBank = d & 0x0f; - if (nPsndZBank != nNewBank) { - nPsndZBank = nNewBank; - PsndZBankMap(); - } - break; - } - case 0xF006: // ??? Enable interrupt ??? - break; - -#ifdef FBA_DEBUG -// default: -// bprintf(PRINT_NORMAL, _T("Z80 address %04X -> %02X.\n"), a, d); -#endif - - } - return; -} - -void __fastcall kodbZWrite(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xE000: - BurnYM2151SelectRegister(d); - break; - case 0xE001: - BurnYM2151WriteRegister(d); - break; - case 0xE400: - MSM6295Command(0, d); - break; - -#ifdef FBA_DEBUG -// default: -// bprintf(PRINT_NORMAL, _T("Z80 address %04X -> %02X.\n"), a, d); -#endif - - } - return; -} - -// PSound Z80 memory read -UINT8 __fastcall PsndZRead(UINT16 a) -{ - switch (a) { - case 0xF001: - return BurnYM2151ReadStatus(); - case 0xF002: - return MSM6295ReadStatus(0); - case 0xF008: -// bprintf(PRINT_NORMAL, " -- Sound latch read (%i).\n", PsndCode); - return PsndCode; - case 0xF00A: - return PsndFade; - -#ifdef FBA_DEBUG -// default: -// bprintf(PRINT_NORMAL, _T("Z80 address %04X read.\n"), a); -#endif - - } - return 0; -} - -UINT8 __fastcall kodbZRead(UINT16 a) -{ - switch (a) { - case 0xE001: - return BurnYM2151ReadStatus(); - case 0xE400: - return MSM6295ReadStatus(0); - case 0xE800: - return PsndCode; - -#ifdef FBA_DEBUG -// default: -// bprintf(PRINT_NORMAL, _T("Z80 address %04X read.\n"), a); -#endif - - } - return 0; -} - -INT32 PsndZInit() -{ - if (nCpsZRomLen < 0x8000) { // Not enough Z80 Data - return 1; - } - if (CpsZRom == NULL) { - return 1; - } - - PsndZRam = (UINT8 *)BurnMalloc(0x800); - if (PsndZRam == NULL) { - return 1; - } - - ZetInit(0); - ZetOpen(0); - - if (Kodb) { - ZetSetReadHandler(kodbZRead); - ZetSetWriteHandler(kodbZWrite); - } else { - ZetSetReadHandler(PsndZRead); - ZetSetWriteHandler(PsndZWrite); - } - - // Read and fetch first 0x8000 of Rom - ZetMapArea(0x0000,0x7fff,0,CpsZRom); - ZetMapArea(0x0000,0x7fff,2,CpsZRom); - - // Map first Bank of Rom to 0x8000-0xc000 - nPsndZBank=0; - PsndZBankMap(); - - // Ram - ZetMapArea(0xd000,0xd7ff,0,PsndZRam); - ZetMapArea(0xd000,0xd7ff,1,PsndZRam); - ZetMapArea(0xd000,0xd7ff,2,PsndZRam); - - // Sound chip interfaces - ZetMemCallback(0xf000,0xffff,0); - ZetMemCallback(0xf000,0xffff,1); - - // In case it tries to fetch other areas - ZetMapArea(0xc000,0xcfff,2,CpsZRom); - ZetMapArea(0xd800,0xffff,2,CpsZRom); - ZetClose(); - - return 0; -} - -INT32 PsndZExit() -{ - BurnFree(PsndZRam); - - ZetExit(); - return 0; -} - -// Scan the current PSound z80 state -INT32 PsndZScan(INT32 nAction) -{ - struct BurnArea ba; - ZetScan(nAction); - - MSM6295Scan(0, nAction); - BurnYM2151Scan(nAction); - - SCAN_VAR(nPsndZBank); - - // Scan Ram - memset(&ba, 0, sizeof(ba)); - ba.szName = "Z80 RAM"; - ba.Data = PsndZRam; - ba.nLen = 0x800; - BurnAcb(&ba); - - return 0; -} diff --git a/jan/src/burn/drv/capcom/qs.cpp b/jan/src/burn/drv/capcom/qs.cpp deleted file mode 100644 index 907de46ff..000000000 --- a/jan/src/burn/drv/capcom/qs.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include "cps.h" -// QSound - -static INT32 nQsndCyclesExtra; - -static INT32 qsndTimerOver(INT32, INT32) -{ -// bprintf(PRINT_NORMAL, _T(" - IRQ -> 1.\n")); - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_HOLD); - - return 0; -} - -INT32 QsndInit() -{ - INT32 nRate; - - // Init QSound z80 - if (QsndZInit()) { - return 1; - } - BurnTimerInit(qsndTimerOver, NULL); - - if (Cps1Qs == 1) { - nCpsZ80Cycles = 8000000 * 100 / nBurnFPS; - BurnTimerAttachZet(8000000); - } else { - nCpsZ80Cycles = 8000000 * 100 / nBurnFPS; - BurnTimerAttachZet(8000000); - } - - if (nBurnSoundRate >= 0) { - nRate = nBurnSoundRate; - } else { - nRate = 11025; - } - - QscInit(nRate); // Init QSound chip - - return 0; -} - -void QsndSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ - QscSetRoute(nIndex, nVolume, nRouteDir); -} - -void QsndReset() -{ - ZetOpen(0); - BurnTimerReset(); - BurnTimerSetRetrig(0, 1.0 / 252.0); - ZetClose(); - - nQsndCyclesExtra = 0; -} - -void QsndExit() -{ - QscExit(); // Exit QSound chip - QsndZExit(); -} - -INT32 QsndScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - QsndZScan(nAction); // Scan Z80 - QscScan(nAction); // Scan QSound Chip - } - - return 0; -} - -void QsndNewFrame() -{ - ZetNewFrame(); - - ZetOpen(0); - ZetIdle(nQsndCyclesExtra); - - QscNewFrame(); -} - -void QsndEndFrame() -{ - BurnTimerEndFrame(nCpsZ80Cycles); - if (pBurnSoundOut) QscUpdate(nBurnSoundLen); - - nQsndCyclesExtra = ZetTotalCycles() - nCpsZ80Cycles; - ZetClose(); -} - -void QsndSyncZ80() -{ - int nCycles = (INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles; - - if (nCycles <= ZetTotalCycles()) { - return; - } - - BurnTimerUpdate(nCycles); -} diff --git a/jan/src/burn/drv/capcom/qs_c.cpp b/jan/src/burn/drv/capcom/qs_c.cpp deleted file mode 100644 index f3e28cdf3..000000000 --- a/jan/src/burn/drv/capcom/qs_c.cpp +++ /dev/null @@ -1,480 +0,0 @@ -// QSound - emulator for the QSound Chip - -#include -#include "cps.h" -#include "burn_sound.h" - -static const INT32 nQscClock = 4000000; -static const INT32 nQscClockDivider = 166; - -static INT32 nQscRate = 0; -INT32 Mmatrix; // global - -static INT32 Tams = -1; -static INT32* Qs_s = NULL; - -static INT32 nPos; - -struct QChan { - UINT8 bKey; // 1 if channel is playing - INT8 nBank; // Bank we are currently playing a sample from - - ALIGN_VAR(8) INT8* PlayBank; // Pointer to current bank - - INT32 nPlayStart; // Start of being played - INT32 nStart; // Start of sample 16.12 - INT32 nEnd; // End of sample 16.12 - INT32 nLoop; // Loop offset from end - INT32 nPos; // Current position within the bank 16.12 - INT32 nAdvance; // Sample size - - INT32 nMasterVolume; // Master volume for the channel - INT32 nVolume[2]; // Left & right side volumes (panning) - - INT32 nPitch; // Playback frequency - - INT8 nEndBuffer[8]; // Buffer to enable correct cubic interpolation -}; - -static struct QChan QChan[16]; - -static INT32 PanningVolumes[33]; - -static double QsndGain[2]; -static INT32 QsndOutputDir[2]; - -static void MapBank(struct QChan* pc) -{ - UINT32 nBank; - - nBank = (pc->nBank & 0x7F) << 16; // Banks are 0x10000 samples long - - // Confirm whole bank is in range: - // If bank is out of range use bank 0 instead - if ((nBank + 0x10000) > nCpsQSamLen) { - nBank = 0; - } - pc->PlayBank = (INT8*)CpsQSam + nBank; -} - -static void UpdateEndBuffer(struct QChan* pc) -{ - if (pc->bKey) { - // prepare a buffer to correctly interpolate the last 4 samples - if (nInterpolation >= 3) { - for (INT32 i = 0; i < 4; i++) { - pc->nEndBuffer[i] = pc->PlayBank[(pc->nEnd >> 12) - 4 + i]; - } - - if (pc->nLoop) { - for (INT32 i = 0, j = 0; i < 4; i++, j++) { - if (j >= (pc->nLoop >> 12)) { - j = 0; - } - pc->nEndBuffer[i + 4] = pc->PlayBank[((pc->nEnd - pc->nLoop) >> 12) + j]; - } - } else { - for (INT32 i = 0; i < 4; i++) { - pc->nEndBuffer[i + 4] = pc->nEndBuffer[3]; - } - } - } - } -} - -static void CalcAdvance(struct QChan* pc) -{ - if (nQscRate) { - pc->nAdvance = (INT64)pc->nPitch * nQscClock / nQscClockDivider / nQscRate; - } -} - -void QscReset() -{ - memset(QChan, 0, sizeof(QChan)); - - // Point all to bank 0 - for (INT32 i = 0; i < 16; i++) { - QChan[i].PlayBank = (INT8*)CpsQSam; - } -} - -void QscExit() -{ - nQscRate = 0; - - BurnFree(Qs_s); - Tams = -1; -} - -INT32 QscInit(INT32 nRate) -{ - nQscRate = nRate; - - for (INT32 i = 0; i < 33; i++) { - PanningVolumes[i] = (INT32)((256.0 / sqrt(32.0)) * sqrt((double)i)); - } - - QsndGain[BURN_SND_QSND_OUTPUT_1] = 1.00; - QsndGain[BURN_SND_QSND_OUTPUT_2] = 1.00; - QsndOutputDir[BURN_SND_QSND_OUTPUT_1] = BURN_SND_ROUTE_LEFT; - QsndOutputDir[BURN_SND_QSND_OUTPUT_2] = BURN_SND_ROUTE_RIGHT; - - QscReset(); - - return 0; -} - -void QscSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ - QsndGain[nIndex] = nVolume; - QsndOutputDir[nIndex] = nRouteDir; -} - -INT32 QscScan(INT32 nAction) -{ - SCAN_VAR(QChan); - - if (nAction & ACB_WRITE) { - // Update bank pointers with new banks, and recalc nAdvance - for (INT32 i = 0; i < 16; i++) { - MapBank(QChan + i); - CalcAdvance(QChan + i); - } - } - - return 0; -} - -void QscNewFrame() -{ - nPos = 0; -} - -static inline void QscSyncQsnd() -{ - if (pBurnSoundOut) QscUpdate(ZetTotalCycles() * nBurnSoundLen / nCpsZ80Cycles); -} - -void QscWrite(INT32 a, INT32 d) -{ - struct QChan* pc; - INT32 nChanNum, r; - - // unknown - if (a >= 0x90) { -// bprintf(PRINT_NORMAL, "QSound: reg 0x%02X -> 0x%02X.\n", a, d); - return; - } - - QscSyncQsnd(); - - if (a >= 0x80) { // Set panning for channel - INT32 nPan; - - nChanNum = a & 15; - - pc = QChan + nChanNum; // Find channel - nPan = (d - 0x10) & 0x3F; // nPan = 0x00 to 0x20 now - if (nPan > 0x20) { - nPan = 0x20; - } - - //bprintf(PRINT_NORMAL, _T("QSound: ch#%i pan -> 0x%X\n"), nChanNum, nPan); - - if (Mmatrix && nPan == 0x00) { - nPan = 0x10; // Fixes all sfx that are hard-panned to the right. (Mars Matrix only) - } - - pc->nVolume[0] = PanningVolumes[0x20 - nPan]; - pc->nVolume[1] = PanningVolumes[0x00 + nPan]; - - return; - } - - // Get channel and register number - nChanNum = (a >> 3) & 15; - r = a & 7; - - // Pointer to channel info - pc = QChan + nChanNum; - - switch (r) { - case 0: { // Set bank - // Strange but true - pc = QChan + ((nChanNum + 1) & 15); - pc->nBank = d; - MapBank(pc); - UpdateEndBuffer(pc); - break; - } - case 1: { // Set sample start offset - pc->nStart = d << 12; - break; - } - case 2: { - pc->nPitch = d; - CalcAdvance(pc); - - if (d == 0) { // Key off; stop playing - pc->bKey = 0; - } - - break; - } -#if 0 - case 3: { - break; - } -#endif - case 4: { // Set sample loop offset - pc->nLoop = d << 12; - UpdateEndBuffer(pc); - break; - } - case 5: { // Set sample end offset - pc->nEnd = d << 12; - UpdateEndBuffer(pc); - break; - } - case 6: { // Set volume - pc->nMasterVolume = d; - - if (d == 0) { - pc->bKey = 0; - } else { - if (pc->bKey == 0) { // Key on; play sample - pc->nPlayStart = pc->nStart; - - pc->nPos = 0; - pc->bKey = 3; - UpdateEndBuffer(pc); - } - } - break; - } -#if 0 - case 7: { - break; - } -#endif - - } -} - -INT32 QscUpdate(INT32 nEnd) -{ - INT32 nLen; - - if (nEnd > nBurnSoundLen) { - nEnd = nBurnSoundLen; - } - - nLen = nEnd - nPos; - - if (nLen <= 0) { - return 0; - } - - if (Tams < nLen) { - BurnFree(Qs_s); - Tams = nLen; - Qs_s = (INT32*)BurnMalloc(sizeof(INT32) * 2 * Tams); - } - - memset(Qs_s, 0, nLen * 2 * sizeof(INT32)); - - if (nInterpolation < 3) { - - // Go through all channels - for (INT32 c = 0; c < 16; c++) { - - // If the channel is playing, add the samples to the buffer - if (QChan[c].bKey) { - INT32 VolL = (QChan[c].nMasterVolume * QChan[c].nVolume[0]) >> 8; - INT32 VolR = (QChan[c].nMasterVolume * QChan[c].nVolume[1]) >> 8; - INT32* pTemp = Qs_s; - INT32 i = nLen; - INT32 s, p; - - if (QChan[c].bKey & 2) { - QChan[c].bKey &= ~2; - QChan[c].nPos = QChan[c].nPlayStart; - } - - while (i--) { - - p = (QChan[c].nPos >> 12) & 0xFFFF; - - // Check for end of sample - if (QChan[c].nPos >= (QChan[c].nEnd - 0x01000)) { - if (QChan[c].nLoop) { // Loop sample - if (QChan[c].nPos < QChan[c].nEnd) { - QChan[c].nEndBuffer[0] = QChan[c].PlayBank[(QChan[c].nEnd - QChan[c].nLoop) >> 12]; - } else { - QChan[c].nPos = QChan[c].nEnd - QChan[c].nLoop + (QChan[c].nPos & 0x0FFF); - p = (QChan[c].nPos >> 12) & 0xFFFF; - } - } else { - if (QChan[c].nPos < QChan[c].nEnd) { - QChan[c].nEndBuffer[0] = QChan[c].PlayBank[p]; - } else { - QChan[c].bKey = 0; // Quit playing - break; - } - } - } else { - QChan[c].nEndBuffer[0] = QChan[c].PlayBank[p + 1]; - } - - // Interpolate sample - s = QChan[c].PlayBank[p] * (1 << 6) + ((QChan[c].nPos) & ((1 << 12) - 1)) * (QChan[c].nEndBuffer[0] - QChan[c].PlayBank[p]) / (1 << 6); - - // Add to the sound currently in the buffer - pTemp[0] += (s * VolL) >> 3; - pTemp[1] += (s * VolR) >> 3; - - pTemp += 2; - - QChan[c].nPos += QChan[c].nAdvance; // increment sample position based on pitch - } - } - } - - INT16 *pDest = pBurnSoundOut + (nPos << 1); - INT32 *pSrc = Qs_s; - for (INT32 i = 0; i < nLen; i++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((QsndOutputDir[BURN_SND_QSND_OUTPUT_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((pSrc[(i << 1) + 0] >> 8) * QsndGain[BURN_SND_QSND_OUTPUT_1]); - } - if ((QsndOutputDir[BURN_SND_QSND_OUTPUT_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((pSrc[(i << 1) + 0] >> 8) * QsndGain[BURN_SND_QSND_OUTPUT_1]); - } - - if ((QsndOutputDir[BURN_SND_QSND_OUTPUT_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((pSrc[(i << 1) + 1] >> 8) * QsndGain[BURN_SND_QSND_OUTPUT_2]); - } - if ((QsndOutputDir[BURN_SND_QSND_OUTPUT_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((pSrc[(i << 1) + 1] >> 8) * QsndGain[BURN_SND_QSND_OUTPUT_2]); - } - - pDest[(i << 1) + 0] = BURN_SND_CLIP(nLeftSample); - pDest[(i << 1) + 1] = BURN_SND_CLIP(nRightSample); - } - nPos = nEnd; - - return 0; - } - - // Go through all channels - for (INT32 c = 0; c < 16; c++) { - - // If the channel is playing, add the samples to the buffer - if (QChan[c].bKey) { - INT32 VolL = (QChan[c].nMasterVolume * QChan[c].nVolume[0]) >> 11; - INT32 VolR = (QChan[c].nMasterVolume * QChan[c].nVolume[1]) >> 11; - INT32* pTemp = Qs_s; - INT32 i = nLen; - - // handle 1st sample - if (QChan[c].bKey & 2) { - while (QChan[c].nPos < 0x1000 && i) { - INT32 p = QChan[c].nPlayStart >> 12; - INT32 s = INTERPOLATE4PS_CUSTOM(QChan[c].nPos, - 0, - QChan[c].PlayBank[p + 0], - QChan[c].PlayBank[p + 1], - QChan[c].PlayBank[p + 2], - 256); - - pTemp[0] += s * VolL; - pTemp[1] += s * VolR; - - QChan[c].nPos += QChan[c].nAdvance; // increment sample position based on pitch - - pTemp += 2; - i--; - } - if (i > 0) { - QChan[c].bKey &= ~2; - QChan[c].nPos = (QChan[c].nPos & 0x0FFF) + QChan[c].nPlayStart; - } - } - - while (i > 0) { - INT32 s, p; - - // Check for end of sample - if (QChan[c].nPos >= (QChan[c].nEnd - 0x3000)) { - if (QChan[c].nPos < QChan[c].nEnd) { - INT32 nIndex = 4 - ((QChan[c].nEnd - QChan[c].nPos) >> 12); - s = INTERPOLATE4PS_CUSTOM((QChan[c].nPos) & ((1 << 12) - 1), - QChan[c].nEndBuffer[nIndex + 0], - QChan[c].nEndBuffer[nIndex + 1], - QChan[c].nEndBuffer[nIndex + 2], - QChan[c].nEndBuffer[nIndex + 3], - 256); - } else { - if (QChan[c].nLoop) { // Loop sample - if (QChan[c].nLoop <= 0x1000) { // Don't play, but leave bKey on - QChan[c].nPos = QChan[c].nEnd - 0x1000; - break; - } - QChan[c].nPos -= QChan[c].nLoop; - continue; - } else { - QChan[c].bKey = 0; // Stop playing - break; - } - } - } else { - p = (QChan[c].nPos >> 12) & 0xFFFF; - s = INTERPOLATE4PS_CUSTOM((QChan[c].nPos) & ((1 << 12) - 1), - QChan[c].PlayBank[p + 0], - QChan[c].PlayBank[p + 1], - QChan[c].PlayBank[p + 2], - QChan[c].PlayBank[p + 3], - 256); - } - - // Add to the sound currently in the buffer - pTemp[0] += s * VolL; - pTemp[1] += s * VolR; - - pTemp += 2; - - QChan[c].nPos += QChan[c].nAdvance; // increment sample position based on pitch - - i--; - } - } - } - - INT16 *pDest = pBurnSoundOut + (nPos << 1); - INT32 *pSrc = Qs_s; - for (INT32 i = 0; i < nLen; i++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((QsndOutputDir[BURN_SND_QSND_OUTPUT_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((pSrc[(i << 1) + 0] >> 8) * QsndGain[BURN_SND_QSND_OUTPUT_1]); - } - if ((QsndOutputDir[BURN_SND_QSND_OUTPUT_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((pSrc[(i << 1) + 0] >> 8) * QsndGain[BURN_SND_QSND_OUTPUT_1]); - } - - if ((QsndOutputDir[BURN_SND_QSND_OUTPUT_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((pSrc[(i << 1) + 1] >> 8) * QsndGain[BURN_SND_QSND_OUTPUT_2]); - } - if ((QsndOutputDir[BURN_SND_QSND_OUTPUT_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((pSrc[(i << 1) + 1] >> 8) * QsndGain[BURN_SND_QSND_OUTPUT_2]); - } - - pDest[(i << 1) + 0] = BURN_SND_CLIP(nLeftSample); - pDest[(i << 1) + 1] = BURN_SND_CLIP(nRightSample); - } - nPos = nEnd; - - return 0; -} diff --git a/jan/src/burn/drv/capcom/qs_z.cpp b/jan/src/burn/drv/capcom/qs_z.cpp deleted file mode 100644 index 8429e8965..000000000 --- a/jan/src/burn/drv/capcom/qs_z.cpp +++ /dev/null @@ -1,140 +0,0 @@ -#include "cps.h" -// QSound - Z80 - -static INT32 nQsndZBank = 0; - -// Map in the memory for the current 0x8000-0xc000 music bank -static INT32 QsndZBankMap() -{ - UINT32 nOff; - UINT8* Bank; - nOff = nQsndZBank << 14; - nOff += 0x8000; - - if (Cps1Qs == 0) { - if (nOff + 0x4000 > nCpsZRomLen) { // End of bank is out of range - nOff = 0; - } - Bank = CpsZRom + nOff; - } else { - if (nOff + 0x4000 > (nCpsZRomLen / 2)) { - nOff = 0; - } - Bank = CpsZRom - (nCpsZRomLen / 2) + nOff; - } - - // Read and fetch the bank - ZetMapArea(0x8000, 0xbfff, 0, Bank); - if (Cps1Qs == 0) { - ZetMapArea(0x8000, 0xbfff, 2, Bank, CpsZRom + nOff); - } else { - ZetMapArea(0x8000, 0xbfff, 2, Bank); - } - - return 0; -} - -static UINT8 QscCmd[2] = {0, 0}; - -void __fastcall QsndZWrite(UINT16 a, UINT8 d) -{ - if (a == 0xd000) { - QscCmd[0] = d; - return; - } - if (a == 0xd001) { - QscCmd[1] = d; - return; - } - if (a == 0xd002) { - QscWrite(d, (QscCmd[0] << 8) | QscCmd[1]); -// bprintf(PRINT_NORMAL, _T("QSound command %02X %04X sent.\n"), d, (QscCmd[0] << 8) | QscCmd[1]); - return; - } - if (a == 0xd003) { - INT32 nNewBank = d & 0x0f; - if (nQsndZBank != nNewBank) { - nQsndZBank = nNewBank; - QsndZBankMap(); - } - } -} - -UINT8 __fastcall QsndZRead(UINT16 a) -{ - if (a == 0xd007) { // return ready all the time - return 0x80; - } - return 0; -} - -INT32 QsndZInit() -{ - if (nCpsZRomLen < 0x8000) { // Not enough Z80 Data - return 1; - } - if (CpsZRom == NULL) { - return 1; - } - - ZetInit(0); - ZetOpen(0); - - ZetSetReadHandler(QsndZRead); - ZetSetWriteHandler(QsndZWrite); - - // Read and fetch first 0x8000 of Rom - if (Cps1Qs) { - ZetMapArea(0x0000, 0x7FFF, 0, CpsZRom - (nCpsZRomLen / 2)); - ZetMapArea(0x0000, 0x7FFF, 2, CpsZRom, CpsZRom - (nCpsZRomLen / 2)); // If it tries to fetch this area - } else { - ZetMapArea(0x0000, 0x7FFF, 0 ,CpsZRom); - ZetMapArea(0x0000, 0x7FFF, 2, CpsZRom); - } - - // Map first Bank of Rom - nQsndZBank = 0; - QsndZBankMap(); - - ZetMapArea(0xC000, 0xCFFF, 0, CpsZRamC0); - ZetMapArea(0xC000, 0xCFFF, 1, CpsZRamC0); - ZetMapArea(0xC000, 0xCFFF, 2, CpsZRamC0); - - ZetMemCallback(0xD000, 0xEFFF, 0); - ZetMemCallback(0xD000, 0xEFFF, 1); - - if (Cps1Qs) { - ZetMapArea(0xD000, 0xEFFF, 2, CpsZRom, CpsZRom - (nCpsZRomLen / 2)); // If it tries to fetch this area - } else { - ZetMapArea(0xD000, 0xEFFF, 2, CpsZRom); - } - - ZetMapArea(0xF000, 0xFFFF, 0, CpsZRamF0); - ZetMapArea(0xF000, 0xFFFF, 1, CpsZRamF0); - ZetMapArea(0xF000, 0xFFFF, 2, CpsZRamF0); - - ZetClose(); - - return 0; -} - -INT32 QsndZExit() -{ - ZetExit(); - return 0; -} - -// Scan the current QSound z80 state -INT32 QsndZScan(INT32 nAction) -{ - ZetScan(nAction); // Scan Z80 - SCAN_VAR(nQsndZBank); - - if (nAction & ACB_WRITE) { // If write, bank could have changed - ZetOpen(0); - QsndZBankMap(); - ZetClose(); - } - - return 0; -} diff --git a/jan/src/burn/drv/capcom/sf2mdt_snd.cpp b/jan/src/burn/drv/capcom/sf2mdt_snd.cpp deleted file mode 100644 index 4d6a1f847..000000000 --- a/jan/src/burn/drv/capcom/sf2mdt_snd.cpp +++ /dev/null @@ -1,249 +0,0 @@ -#include "cps.h" -#include "burn_ym2151.h" -#include "msm5205.h" - -// sf2mdt_snd.cpp -// Sound support for games using similar sound to Street Fighter 2: Magic Delta Turbo -// 1 x YM2151 and 2 x MSM5205 - -static UINT8 *Sf2mdtZ80Ram = NULL; -static INT32 Sf2mdtZ80BankAddress = 0; -static INT32 Sf2mdtSoundLatch = 0; -static INT32 Sf2mdtMSM5205Interleave = 0; -static INT32 Sf2mdtSampleBuffer1 = 0; -static INT32 Sf2mdtSampleBuffer2 = 0; -static INT32 Sf2mdtSampleSelect1 = 0; -static INT32 Sf2mdtSampleSelect2 = 0; -static INT32 Sf2mdtSoundPos = 0; -static INT32 Sf2mdtCyclesPerSegment = 0; -static INT32 Sf2mdtNumZ80Banks = 0; - -void Sf2mdtSoundCommand(UINT16 d) -{ - INT32 nCyclesToDo = ((INT64)SekTotalCycles() * nCpsZ80Cycles / nCpsCycles) - ZetTotalCycles(); - INT32 nEnd = Sf2mdtSoundPos + (INT64)Sf2mdtMSM5205Interleave * nCyclesToDo / nCpsZ80Cycles; - - if (nEnd == Sf2mdtSoundPos) nEnd += 1; - - for (INT32 i = Sf2mdtSoundPos; i < nEnd; i++) { - ZetRun(Sf2mdtCyclesPerSegment); - MSM5205Update(); - Sf2mdtSoundPos = i; - } - - Sf2mdtSoundLatch = d & 0xff; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); -} - -UINT8 __fastcall Sf2mdtZ80Read(UINT16 a) -{ - switch (a) { - case 0xd801: { - return BurnYM2151ReadStatus(); - } - - case 0xdc00: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return Sf2mdtSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Sf2mdtZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xd800: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xd801: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xe000: { - MSM5205SetRoute(0, (d & 0x20) ? 0 : 0.25, BURN_SND_ROUTE_BOTH); - MSM5205SetRoute(1, (d & 0x10) ? 0 : 0.25, BURN_SND_ROUTE_BOTH); - - Sf2mdtZ80BankAddress = (d & Sf2mdtNumZ80Banks) * 0x4000; - ZetMapArea(0x8000, 0xbfff, 0, CpsZRom + Sf2mdtZ80BankAddress); - ZetMapArea(0x8000, 0xbfff, 2, CpsZRom + Sf2mdtZ80BankAddress); - return; - } - - case 0xe400: { - Sf2mdtSampleBuffer1 = d; - return; - } - - case 0xe800: { - Sf2mdtSampleBuffer2 = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -inline static INT32 Sf2mdtSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate / 3579540); -} - -static void Sf2mdtMSM5205Vck0() -{ - MSM5205DataWrite(0, Sf2mdtSampleBuffer1 & 0x0f); - Sf2mdtSampleBuffer1 >>= 4; - Sf2mdtSampleSelect1 ^= 1; - if (Sf2mdtSampleSelect1 == 0) { - ZetNmi(); - } -} - -static void Sf2mdtMSM5205Vck1() -{ - MSM5205DataWrite(1, Sf2mdtSampleBuffer2 & 0x0f); - Sf2mdtSampleBuffer2 >>= 4; - Sf2mdtSampleSelect2 ^= 1; -} - -INT32 Sf2mdtSoundInit() -{ - Sf2mdtZ80Ram = (UINT8*)BurnMalloc(0x800); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Sf2mdtZ80Read); - ZetSetWriteHandler(Sf2mdtZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, CpsZRom + 0x00000); - ZetMapArea(0x0000, 0x7fff, 2, CpsZRom + 0x00000); - ZetMapArea(0x8000, 0xbfff, 0, CpsZRom + 0x08000); - ZetMapArea(0x8000, 0xbfff, 2, CpsZRom + 0x08000); - ZetMapArea(0xd000, 0xd7ff, 0, Sf2mdtZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 1, Sf2mdtZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 2, Sf2mdtZ80Ram ); - ZetClose(); - - BurnYM2151Init(3579540); - BurnYM2151SetAllRoutes(0.35, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, Sf2mdtSynchroniseStream, 24000000 / 64, Sf2mdtMSM5205Vck0, MSM5205_S96_4B, 1); - MSM5205Init(1, Sf2mdtSynchroniseStream, 24000000 / 64, Sf2mdtMSM5205Vck1, MSM5205_S96_4B, 1); - MSM5205SetRoute(0, 0.25, BURN_SND_ROUTE_BOTH); - MSM5205SetRoute(1, 0.25, BURN_SND_ROUTE_BOTH); - - nCpsZ80Cycles = 3579540 * 100 / nBurnFPS; - - Sf2mdtNumZ80Banks = (nCpsZRomLen / 0x4000) - 1; - - return 0; -} - -INT32 Sf2mdtSoundReset() -{ - ZetOpen(0); - ZetReset(); - BurnYM2151Reset(); - MSM5205Reset(); - Sf2mdtZ80BankAddress = 0x8000; - ZetMapArea(0x8000, 0xbfff, 0, CpsZRom + Sf2mdtZ80BankAddress); - ZetMapArea(0x8000, 0xbfff, 2, CpsZRom + Sf2mdtZ80BankAddress); - ZetClose(); - - Sf2mdtSoundLatch = 0; - Sf2mdtSampleBuffer1 = 0; - Sf2mdtSampleBuffer2 = 0; - Sf2mdtSampleSelect1 = 0; - Sf2mdtSampleSelect2 = 0; - - return 0; -} - -INT32 Sf2mdtSoundExit() -{ - ZetExit(); - BurnYM2151Exit(); - MSM5205Exit(); - - BurnFree(Sf2mdtZ80Ram); - - Sf2mdtZ80BankAddress = 0; - Sf2mdtSoundLatch = 0; - Sf2mdtMSM5205Interleave = 0; - Sf2mdtSampleBuffer1 = 0; - Sf2mdtSampleBuffer2 = 0; - Sf2mdtSampleSelect1 = 0; - Sf2mdtSampleSelect2 = 0; - Sf2mdtCyclesPerSegment = 0; - Sf2mdtNumZ80Banks = 0; - - nCpsZ80Cycles = 0; - - return 0; -} - -void Sf2mdtSoundFrameStart() -{ - Sf2mdtMSM5205Interleave = MSM5205CalcInterleave(0, 3579540); - Sf2mdtSoundPos = 0; - Sf2mdtCyclesPerSegment = (INT64)nCpsZ80Cycles / Sf2mdtMSM5205Interleave; - - ZetNewFrame(); - ZetOpen(0); -} - -void Sf2mdtSoundFrameEnd() -{ - for (INT32 i = Sf2mdtSoundPos; i < Sf2mdtMSM5205Interleave; i++) { - ZetRun(Sf2mdtCyclesPerSegment); - MSM5205Update(); - Sf2mdtSoundPos = i; - } - ZetRun(nCpsZ80Cycles - ZetTotalCycles()); - - if (pBurnSoundOut) { - BurnYM2151Render(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - MSM5205Render(1, pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); -} - -INT32 Sf2mdtScanSound(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_MEMORY_RAM) { - struct BurnArea ba; - memset(&ba, 0, sizeof(ba)); - - ba.Data = Sf2mdtZ80Ram; - ba.nLen = 0x00800; - ba.szName = "Sf2mdtZ80Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM5205Scan(nAction, pnMin); - - SCAN_VAR(Sf2mdtZ80BankAddress); - SCAN_VAR(Sf2mdtSoundLatch); - SCAN_VAR(Sf2mdtSampleBuffer1); - SCAN_VAR(Sf2mdtSampleBuffer2); - SCAN_VAR(Sf2mdtSampleSelect1); - SCAN_VAR(Sf2mdtSampleSelect2); - SCAN_VAR(Sf2mdtSoundPos); - } - - return 0; -} diff --git a/jan/src/burn/drv/cave/cave.cpp b/jan/src/burn/drv/cave/cave.cpp deleted file mode 100644 index 5419c2611..000000000 --- a/jan/src/burn/drv/cave/cave.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "cave.h" - -INT32 nCaveXSize = 0, nCaveYSize = 0; -INT32 nCaveXOffset = 0, nCaveYOffset = 0; -INT32 nCaveExtraXOffset = 0, nCaveExtraYOffset = 0; -INT32 nCaveRowModeOffset = 0; - -INT32 CaveScanGraphics() -{ - SCAN_VAR(nCaveXOffset); - SCAN_VAR(nCaveYOffset); - - SCAN_VAR(nCaveTileBank); - - SCAN_VAR(nCaveSpriteBank); - SCAN_VAR(nCaveSpriteBankDelay); - - for (INT32 i = 0; i < 4; i++) { - SCAN_VAR(CaveTileReg[i][0]); - SCAN_VAR(CaveTileReg[i][1]); - SCAN_VAR(CaveTileReg[i][2]); - } - - return 0; -} - -// This function fills the screen with the background colour -void CaveClearScreen(UINT32 nColour) -{ - if (nColour) { - UINT32* pClear = (UINT32*)pBurnDraw; - nColour = nColour | (nColour << 16); - for (INT32 i = nCaveXSize * nCaveYSize / 16; i > 0 ; i--) { - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - } - } else { - memset(pBurnDraw, 0, nCaveXSize * nCaveYSize * sizeof(INT16)); - } -} - diff --git a/jan/src/burn/drv/cave/cave.h b/jan/src/burn/drv/cave/cave.h deleted file mode 100644 index 74bd33d1b..000000000 --- a/jan/src/burn/drv/cave/cave.h +++ /dev/null @@ -1,65 +0,0 @@ -#include "burnint.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "eeprom.h" - -#define CAVE_REFRESHRATE (15625.0 / 271.5) - -inline static void CaveClearOpposites(UINT16* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x0003) == 0x0003) { - *nJoystickInputs &= ~0x0003; - } - if ((*nJoystickInputs & 0x000C) == 0x000C) { - *nJoystickInputs &= ~0x000C; - } -} - -// cave.cpp -extern INT32 nCaveXSize, nCaveYSize; -extern INT32 nCaveXOffset, nCaveYOffset; -extern INT32 nCaveExtraXOffset, nCaveExtraYOffset; -extern INT32 nCaveRowModeOffset; - -INT32 CaveScanGraphics(); -void CaveClearScreen(UINT32 nColour); - -// cave_palette.cpp -extern UINT32* CavePalette; - -extern UINT8* CavePalSrc; -extern UINT8 CaveRecalcPalette; - -INT32 CavePalInit(INT32 nPalSize); -INT32 CavePalExit(); -INT32 CavePalUpdate4Bit(INT32 nOffset, INT32 nNumPalettes); -INT32 CavePalUpdate8Bit(INT32 nOffset, INT32 nNumPalettes); - -void CavePalWriteByte(UINT32 nAddress, UINT8 byteValue); -void CavePalWriteWord(UINT32 nAddress, UINT16 wordValue); - -// cave_tiles.cpp -extern UINT8* CaveTileROM[4]; -extern UINT8* CaveTileRAM[4]; - -extern UINT32 CaveTileReg[4][3]; -extern INT32 nCaveTileBank; - -INT32 CaveTileRender(INT32 nMode); -void CaveTileExit(); -INT32 CaveTileInit(); -INT32 CaveTileInitLayer(INT32 nLayer, INT32 nROMSize, INT32 nBitdepth, INT32 nOffset); - -// cave_sprite.cpp -extern INT32 CaveSpriteVisibleXOffset; - -extern UINT8* CaveSpriteROM; -extern UINT8* CaveSpriteRAM; - -extern INT32 nCaveSpriteBank; -extern INT32 nCaveSpriteBankDelay; - -extern INT32 (*CaveSpriteBuffer)(); -extern INT32 CaveSpriteRender(INT32 nLowPriority, INT32 nHighPriority); -void CaveSpriteExit(); -INT32 CaveSpriteInit(INT32 nType, INT32 nROMSize); diff --git a/jan/src/burn/drv/cave/cave_palette.cpp b/jan/src/burn/drv/cave/cave_palette.cpp deleted file mode 100644 index 1da6993be..000000000 --- a/jan/src/burn/drv/cave/cave_palette.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include "cave.h" - -UINT8* CavePalSrc; -UINT8 CaveRecalcPalette; // Set to 1 to force recalculation of the entire palette - -UINT32* CavePalette = NULL; -static UINT16* CavePalCopy = NULL; - -INT32 CavePalInit(INT32 nPalSize) -{ - CavePalette = (UINT32*)BurnMalloc(nPalSize * sizeof(UINT32)); - memset(CavePalette, 0, nPalSize * sizeof(UINT32)); - - CavePalCopy = (UINT16*)BurnMalloc(nPalSize * sizeof(UINT16)); - memset(CavePalCopy, 0, nPalSize * sizeof(UINT16)); - - pBurnDrvPalette = CavePalette; - - return 0; -} - -INT32 CavePalExit() -{ - BurnFree(CavePalette); - BurnFree(CavePalCopy); - - return 0; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x03E0) >> 2; // Red - r |= r >> 5; - g = (nColour & 0x7C00) >> 7; // Green - g |= g >> 5; - b = (nColour & 0x001F) << 3; // Blue - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -INT32 CavePalUpdate4Bit(INT32 nOffset, INT32 nNumPalettes) -{ - INT32 i, j; - - UINT16* ps = (UINT16*)CavePalSrc + nOffset; - UINT16* pc; - UINT32* pd; - - UINT16 c; - - if (CaveRecalcPalette) { - - for (i = 0; i < 0 + nNumPalettes; i++) { - - pc = CavePalCopy + (i << 8); - pd = CavePalette + (i << 8); - - for (j = 0; j < 16; j++, ps++, pc++, pd++) { - - c = *ps; - *pc = c; - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(c)); - - } - } - - CaveRecalcPalette = 0; - return 0; - } - - - for (i = 0; i < 0 + nNumPalettes; i++) { - - pc = CavePalCopy + (i << 8); - pd = CavePalette + (i << 8); - - for (j = 0; j < 16; j++, ps++, pc++, pd++) { - - c = *ps; - if (*pc != c) { - *pc = c; - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(c)); - } - - } - } - - return 0; -} - -INT32 CavePalUpdate8Bit(INT32 nOffset, INT32 nNumPalettes) -{ - if (CaveRecalcPalette) { - INT32 i, j; - - UINT16* ps = (UINT16*)CavePalSrc + nOffset; - UINT16* pc; - UINT32* pd; - - UINT16 c; - - for (i = 0; i < nNumPalettes; i++) { - - pc = CavePalCopy + nOffset + (i << 8); - pd = CavePalette + nOffset + (i << 8); - - for (j = 0; j < 256; j++, ps++, pc++, pd++) { - - c = *ps; - *pc = c; - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(c)); - - } - } - - CaveRecalcPalette = 0; - } - - return 0; -} - -// Update the PC copy of the palette on writes to the palette memory -void CavePalWriteByte(UINT32 nAddress, UINT8 byteValue) -{ - nAddress ^= 1; - CavePalSrc[nAddress] = byteValue; // write byte - - if (*((UINT8*)(CavePalCopy + nAddress)) != byteValue) { - *((UINT8*)(CavePalCopy + nAddress)) = byteValue; - CavePalette[nAddress >> 1] = CalcCol(*(UINT16*)(CavePalSrc + (nAddress & ~0x01))); - } -} - -void CavePalWriteWord(UINT32 nAddress, UINT16 wordValue) -{ - nAddress >>= 1; - - ((UINT16*)CavePalSrc)[nAddress] = BURN_ENDIAN_SWAP_INT16(wordValue); // write word - - if (CavePalCopy[nAddress] != wordValue) { - CavePalCopy[nAddress] = wordValue; - CavePalette[nAddress] = CalcCol(wordValue); - } -} - diff --git a/jan/src/burn/drv/cave/cave_sprite.cpp b/jan/src/burn/drv/cave/cave_sprite.cpp deleted file mode 100644 index 843bdb85e..000000000 --- a/jan/src/burn/drv/cave/cave_sprite.cpp +++ /dev/null @@ -1,735 +0,0 @@ -// Cave hardware sprites -#include "cave.h" - -INT32 CaveSpriteVisibleXOffset; - -UINT8* CaveSpriteROM = NULL; -UINT8* CaveSpriteRAM = NULL; - -INT32 nCaveSpriteBank; -INT32 nCaveSpriteBankDelay; - -static INT32 nSpriteAddressMask; - -struct CaveSprite { - INT8 flip; - INT8 priority; - INT16 palette; - INT32 x; INT32 y; - INT32 xsize; INT32 ysize; - INT32 xzoom; INT32 yzoom; - INT32 address; -}; - -static CaveSprite* pSpriteList = NULL; - -INT32 (*CaveSpriteBuffer)(); - -static UINT8* pRow; -static UINT8* pPixel; -static UINT32* pSpriteData; -static UINT32* pSpritePalette; - -static UINT16* pZBuffer = NULL; -static UINT16* pZRow; -static UINT16* pZPixel; - -static INT32 nSpriteRow, nSpriteRowSize; -static INT32 nXPos, nYPos, nZPos; -static INT32 nXSize, nYSize; -static INT32 nSpriteXZoomSize, nSpriteYZoomSize; -static INT32 nSpriteXOffset, nSpriteYOffset; - -static INT32 nFirstSprite[4], nLastSprite[4]; - -static INT32 nTopSprite; -static INT32 nZOffset; - -typedef void (*RenderSpriteFunction)(); -static RenderSpriteFunction* RenderSprite; - -// Include the sprite rendering functions -#include "cave_sprite_func.h" - -INT32 CaveSpriteRender(INT32 nLowPriority, INT32 nHighPriority) -{ - static INT32 nMaskLeft, nMaskRight, nMaskTop, nMaskBottom; - CaveSprite* pBuffer; - - INT32 nPriorityMask = 0; - INT32 nMaxZPos = -1; - INT32 nCurrentZPos = 0x00010000; - INT32 nUseBuffer = 0x00010000; - INT32 nFunction; - - if (nLowPriority == 0) { - nZPos = -1; - nTopSprite = -1; - - nMaskLeft = nMaskTop = 9999; - nMaskRight = nMaskBottom = -1; - } - - if ((nBurnLayer & 1) == 0) { - return 0; - } - - if (nHighPriority < 3) { - for (INT32 i = nHighPriority + 1; i < 4; i++) { - if (nUseBuffer > nFirstSprite[i]) { - nUseBuffer = nFirstSprite[i]; - } - } - } - - for (INT32 i = nLowPriority; i <= nHighPriority; i++) { - if (nCurrentZPos > nFirstSprite[i]) { - nCurrentZPos = nFirstSprite[i]; - } - if (nMaxZPos < nLastSprite[i]) { - nMaxZPos = nLastSprite[i]; - } - nPriorityMask |= 8 >> i; - } - - nPriorityMask &= nSpriteEnable; - if (nPriorityMask == 0) { - return 0; - } - - for (pBuffer = pSpriteList + nCurrentZPos; nCurrentZPos <= nMaxZPos; pBuffer++, nCurrentZPos++) { - - if ((pBuffer->priority & nPriorityMask) == 0) { - continue; - } - - nXPos = pBuffer->x; - nYPos = pBuffer->y; - - pSpriteData = (UINT32*)(CaveSpriteROM + ((pBuffer->address << 8) & nSpriteAddressMask)); - pSpritePalette = CavePalette + pBuffer->palette; - - nXSize = pBuffer->xsize; - nYSize = pBuffer->ysize; - - if (pBuffer->xzoom == 0x0100 && pBuffer->yzoom == 0x0100) { // This sprite doesn't use zooming - - nSpriteRowSize = pBuffer->xsize >> 2; - - if (pBuffer->flip & 1) { // Y Flip - pSpriteData += nSpriteRowSize * (nYSize - 1); - nSpriteRowSize = -nSpriteRowSize; - } - - if (nYPos >= 0x0200) { - nYPos -= 0x0400; - } - - if (nYPos < 0) { - pSpriteData += nSpriteRowSize * -nYPos; - nYSize += nYPos; - nYPos = 0; - } - - if ((nYPos + nYSize) > nCaveYSize) { - nYSize -= (nYPos + nYSize) - nCaveYSize; - } - - if (nXPos >= 0x0200) { - nXPos -= 0x0400; - } - - if (nXPos < 0) { - if ((pBuffer->flip & 2) == 0) { - pSpriteData += (-nXPos >> 4) << 2; - } - nXSize -= -nXPos & 0xFFF0; - nXPos += -nXPos & 0xFFF0; - } - - if (nXPos + nXSize >= nCaveXSize) { - if (pBuffer->flip & 2) { - pSpriteData += ((nXPos + nXSize - nCaveXSize) >> 4) << 2; - } - nXSize -= (nXPos + nXSize - nCaveXSize) & 0xFFF0; - } - - pRow = pBurnDraw + (nYPos * nBurnPitch) + (nXPos * nBurnBpp); - - nFunction = (pBuffer->flip & 2) << 1; // X Flip - - if (nTopSprite > nCurrentZPos) { // Test ZBuffer - if (nXPos < nMaskRight && (nXPos + nXSize) >= nMaskLeft && nYPos < nMaskBottom && (nYPos + nYSize) >= nMaskTop) { - nFunction |= 1; - } - } - - if (nUseBuffer < nCurrentZPos) { // Write ZBuffer - nFunction |= 2; - - if (nXPos < nMaskLeft) { - nMaskLeft = nXPos; - } - if ((nXPos + nXSize) > nMaskRight) { - nMaskRight = nXPos + nXSize; - } - if (nYPos < nMaskTop) { - nMaskTop = nYPos; - } - if ((nYPos + nYSize) > nMaskBottom) { - nMaskBottom = nYPos + nYSize; - } - } - - if (nFunction & 3) { - pZRow = pZBuffer + (nYPos * 320) + nXPos; - nZPos = nCurrentZPos + nZOffset; - } - - nXSize = nXSize >> 2; - - RenderSprite[nFunction](); - } else { // This sprite uses zooming - nSpriteXZoomSize = 0x01000000; // * zoom factor = size of each screen pixel - - nXSize *= pBuffer->xzoom; - nXSize >>= 8; // Round to multiple of whole pixel - if (nXSize < 1) { // Make sure the sprite is at least one pixel wide - nXSize = 1; - } else { - nSpriteXZoomSize /= pBuffer->xzoom; - } - if (nSpriteXZoomSize > (pBuffer->xsize << 16)) { - nSpriteXZoomSize = pBuffer->xsize << 16; - } - nSpriteXOffset = nSpriteXZoomSize >> 1; // Make certain the pixels displayed are centered - - if (pBuffer->flip & 2) { // X Flip - nXPos += pBuffer->xsize - nXSize; - - nSpriteXOffset = (pBuffer->xsize << 16) - nSpriteXOffset; - nSpriteXZoomSize = -nSpriteXZoomSize; - } - - if (nXPos >= 0x0200) { - nXPos -= 0x0400; - } - - if (nXPos < 0) { - if (nXPos + nXSize <= 0) { - continue; - } - nXPos = -nXPos; - nSpriteXOffset += nXPos * nSpriteXZoomSize; - nXSize -= nXPos; - nXPos = 0; - } - - if (nXPos + nXSize >= nCaveXSize) { - if (nXPos >= nCaveXSize) { - continue; - } - nXSize = nCaveXSize - nXPos; - } - - nSpriteRowSize = pBuffer->xsize; // Size of each sprite row in memory - nSpriteYZoomSize = 0x01000000; // * zoom factor = size of each screen pixel - - nYSize *= pBuffer->yzoom; - nYSize >>= 8; // Round to multiple of whole pixel - if (nYSize < 1) { // Make certain the sprite is at least one pixel high - nYSize = 1; - } else { - nSpriteYZoomSize /= pBuffer->yzoom; - } - if (nSpriteYZoomSize > (pBuffer->ysize << 16)) { - nSpriteYZoomSize = pBuffer->ysize << 16; - } - nSpriteYOffset = nSpriteYZoomSize >> 1; // Make certain the pixels displayed are centered - - if (pBuffer->flip & 1) { // Y Flip - nYPos += pBuffer->ysize - nYSize; - - nSpriteYOffset = (pBuffer->ysize << 16) - nSpriteYOffset; - nSpriteYZoomSize = -nSpriteYZoomSize; - } - - if (nYPos >= 0x0200) { - nYPos -= 0x0400; - } - - if (nYPos < 0) { - if (nYPos + nYSize <= 0) { - continue; - } - nYPos = -nYPos; - nSpriteYOffset += nYPos * nSpriteYZoomSize; - nYSize -= nYPos; - nYPos = 0; - } - - if (nYPos + nYSize >= nCaveYSize) { - if (nYPos >= nCaveYSize) { - continue; - } - nYSize = nCaveYSize - nYPos; - } - - pRow = pBurnDraw + (nYPos * nBurnPitch) + (nXPos * nBurnBpp); - - nFunction = 8; - - if (pBuffer->xzoom > 0x0100 || pBuffer->yzoom > 0x0100) { - nFunction |= 4; - } - - if (nTopSprite > nCurrentZPos) { // Test ZBuffer - if (nXPos < nMaskRight && nXPos + nXSize >= nMaskLeft && nYPos < nMaskBottom && nYPos + nYSize >= nMaskTop) { - nFunction |= 1; - } - } - - if (nUseBuffer < nCurrentZPos) { // Write ZBuffer - nFunction |= 2; - - if (nXPos < nMaskLeft) { - nMaskLeft = nXPos; - } - if (nXPos + nXSize > nMaskRight) { - nMaskRight = nXPos + nXSize; - } - if (nYPos < nMaskTop) { - nMaskTop = nYPos; - } - if (nYPos + nYSize > nMaskBottom) { - nMaskBottom = nYPos + nYSize; - } - } - - if (nFunction & 3) { - pZRow = pZBuffer + (nYPos * nCaveXSize) + nXPos; - nZPos = nCurrentZPos + nZOffset; - } - - nXSize <<= 16; - nYSize <<= 16; - - RenderSprite[nFunction](); - } - } - - if (nMaxZPos > nTopSprite) { - nTopSprite = nMaxZPos; - } - - if (nHighPriority == 3) { - if (nZPos >= 0) { - nZOffset += nTopSprite; - if (nZOffset > 0xFC00) { - memset(pZBuffer, 0, nCaveXSize * nCaveYSize * sizeof(UINT16)); - nZOffset = 0; - } - } - } - - return 0; -} - -// Donpachi/DoDonpachi sprite format (no zooming) -static INT32 CaveSpriteBuffer_NoZoom() -{ - UINT16* pSprite = (UINT16*)(CaveSpriteRAM + (nCaveSpriteBank << 14)); - CaveSprite* pBuffer = pSpriteList; - INT32 nPriority; - - nFirstSprite[0] = 0x00010000; - nFirstSprite[1] = 0x00010000; - nFirstSprite[2] = 0x00010000; - nFirstSprite[3] = 0x00010000; - - nLastSprite[0] = -1; - nLastSprite[1] = -1; - nLastSprite[2] = -1; - nLastSprite[3] = -1; - - INT16 word; - INT32 x, y, xs, ys; - - for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) { - - word = BURN_ENDIAN_SWAP_INT16(pSprite[4]); - - xs = (word >> 4) & 0x01F0; - ys = (word << 4) & 0x01F0; - if (ys == 0 || xs == 0) { - continue; - } - -#if 0 - x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + nCaveExtraXOffset) & 0x03FF; -#else - x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + CaveSpriteVisibleXOffset) & 0x03FF; -#endif - if (x >= 320) { - if (x + xs <= 0x0400) { - continue; - } - } - -#if 0 - y = (BURN_ENDIAN_SWAP_INT16(pSprite[3]) + nCaveExtraYOffset) & 0x03FF; -#else - y = BURN_ENDIAN_SWAP_INT16(pSprite[3]) & 0x03FF; -#endif - if (y >= 240) { - if (y + ys <= 0x0400) { - continue; - } - } - - // Sprite is both active and onscreen, so add it to the buffer - - word = BURN_ENDIAN_SWAP_INT16(pSprite[0]); - - nPriority = (word >> 4) & 0x03; - if (nLastSprite[nPriority] == -1) { - nFirstSprite[nPriority] = z; - } - nLastSprite[nPriority] = z; - - pBuffer->priority = 8 >> nPriority; - - pBuffer->flip = (word >> 2) & 0x03; - pBuffer->palette = word & 0x3F00; - - pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[1]) | ((word & 3) << 16); - - pBuffer->x = x; - pBuffer->y = y; - - pBuffer->xsize = xs; - pBuffer->ysize = ys; - - pBuffer++; - z++; - } - - return 0; -} - -// Normal sprite format (zooming) -static INT32 CaveSpriteBuffer_ZoomA() -{ - UINT16* pSprite = (UINT16*)(CaveSpriteRAM + (nCaveSpriteBank << 14)); - CaveSprite* pBuffer = pSpriteList; - INT32 nPriority; - - nFirstSprite[0] = 0x00010000; - nFirstSprite[1] = 0x00010000; - nFirstSprite[2] = 0x00010000; - nFirstSprite[3] = 0x00010000; - - nLastSprite[0] = -1; - nLastSprite[1] = -1; - nLastSprite[2] = -1; - nLastSprite[3] = -1; - - INT16 word; - INT32 x, y, xs, ys; - - for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) { - - word = BURN_ENDIAN_SWAP_INT16(pSprite[6]); - - xs = (word >> 4) & 0x01F0; - ys = (word << 4) & 0x01F0; - if (ys == 0 || xs == 0) { - continue; - } - - word = BURN_ENDIAN_SWAP_INT16(pSprite[2]); - - nPriority = (word >> 4) & 0x03; - - x = ((BURN_ENDIAN_SWAP_INT16(pSprite[0]) >> 6) + CaveSpriteVisibleXOffset) & 0x03FF; -#if 0 - y = ((BURN_ENDIAN_SWAP_INT16(pSprite[1]) >> 6) + nCaveExtraYOffset) & 0x03FF; -#else - y = (BURN_ENDIAN_SWAP_INT16(pSprite[1]) >> 6) & 0x03FF; -#endif - - if (BURN_ENDIAN_SWAP_INT16(pSprite[4]) <= 0x0100 && BURN_ENDIAN_SWAP_INT16(pSprite[5]) <= 0x0100) { - if (x >= 320) { - if (x + xs <= 0x0400) { - continue; - } - } - if (y >= 240) { - if (y + ys <= 0x0400) { - continue; - } - } - } - - // Sprite is active and most likely on screen, so add it to the buffer - - if (nLastSprite[nPriority] == -1) { - nFirstSprite[nPriority] = z; - } - nLastSprite[nPriority] = z; - - pBuffer->priority = 8 >> nPriority; - - pBuffer->xzoom = BURN_ENDIAN_SWAP_INT16(pSprite[4]); - pBuffer->yzoom = BURN_ENDIAN_SWAP_INT16(pSprite[5]); - - pBuffer->xsize = xs; - pBuffer->ysize = ys; - - pBuffer->x = x; - pBuffer->y = y; - - pBuffer->flip = (word >> 2) & 0x03; - pBuffer->palette = word & 0x3F00; - - pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[3]) | ((word & 3) << 16); - - pBuffer++; - z++; - } - - return 0; -} - -// Normal sprite format (zooming, alternate position handling) -static INT32 CaveSpriteBuffer_ZoomB() -{ - UINT16* pSprite = (UINT16*)(CaveSpriteRAM + (nCaveSpriteBank << 14)); - CaveSprite* pBuffer = pSpriteList; - INT32 nPriority; - - nFirstSprite[0] = 0x00010000; - nFirstSprite[1] = 0x00010000; - nFirstSprite[2] = 0x00010000; - nFirstSprite[3] = 0x00010000; - - nLastSprite[0] = -1; - nLastSprite[1] = -1; - nLastSprite[2] = -1; - nLastSprite[3] = -1; - - INT16 word; - INT32 x, y, xs, ys; - - for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) { - - word = BURN_ENDIAN_SWAP_INT16(pSprite[6]); - - xs = (word >> 4) & 0x01F0; - ys = (word << 4) & 0x01F0; - if (ys == 0 || xs == 0) { - continue; - } - - word = BURN_ENDIAN_SWAP_INT16(pSprite[2]); - - nPriority = (word >> 4) & 0x03; - -#if 0 - x = (BURN_ENDIAN_SWAP_INT16(pSprite[0]) + nCaveExtraXOffset) & 0x03FF; -# else - x = (BURN_ENDIAN_SWAP_INT16(pSprite[0]) + CaveSpriteVisibleXOffset) & 0x03FF; -#endif -#if 0 - y = (BURN_ENDIAN_SWAP_INT16(pSprite[1]) + nCaveExtraYOffset) & 0x03FF; -#else - y = BURN_ENDIAN_SWAP_INT16(pSprite[1]) & 0x03FF; -#endif - - if (BURN_ENDIAN_SWAP_INT16(pSprite[4]) <= 0x0100 && BURN_ENDIAN_SWAP_INT16(pSprite[5]) <= 0x0100) { - if (x >= nCaveXSize) { - if (x + xs <= 0x0400) { - continue; - } - } - if (y >= nCaveYSize) { - if (y + ys <= 0x0400) { - continue; - } - } - } - - // Sprite is active and most likely on screen, so add it to the buffer - - if (nLastSprite[nPriority] == -1) { - nFirstSprite[nPriority] = z; - } - nLastSprite[nPriority] = z; - - pBuffer->priority = 8 >> nPriority; - - pBuffer->xzoom = BURN_ENDIAN_SWAP_INT16(pSprite[4]); - pBuffer->yzoom = BURN_ENDIAN_SWAP_INT16(pSprite[5]); - - pBuffer->xsize = xs; - pBuffer->ysize = ys; - - pBuffer->x = x; - pBuffer->y = y; - - pBuffer->flip = (word >> 2) & 0x03; - pBuffer->palette = word & 0x3F00; - - pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[3]) | ((word & 3) << 16); - - pBuffer++; - z++; - } - - return 0; -} - -// Power Instinct 2 sprite format (no zooming) -static INT32 CaveSpriteBuffer_PowerInstinct() -{ - UINT16* pSprite = (UINT16*)(CaveSpriteRAM + (nCaveSpriteBank << 14)); - CaveSprite* pBuffer = pSpriteList; - INT32 nPriority; - - nFirstSprite[0] = 0x00010000; - nFirstSprite[1] = 0x00010000; - nFirstSprite[2] = 0x00010000; - nFirstSprite[3] = 0x00010000; - - nLastSprite[0] = -1; - nLastSprite[1] = -1; - nLastSprite[2] = -1; - nLastSprite[3] = -1; - - INT16 word; - INT32 x, y, xs, ys; - - for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) { - - word = BURN_ENDIAN_SWAP_INT16(pSprite[4]); - - xs = (word >> 4) & 0x01F0; - ys = (word << 4) & 0x01F0; - if (ys == 0 || xs == 0) { - continue; - } - - x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + nCaveExtraXOffset) & 0x03FF; - if (x >= 320) { - if (x + xs <= 0x0400) { - continue; - } - } - - y = (BURN_ENDIAN_SWAP_INT16(pSprite[3]) + nCaveExtraYOffset) & 0x03FF; - if (y >= 240) { - if (y + ys <= 0x0400) { - continue; - } - } - - // Sprite is both active and onscreen, so add it to the buffer - - word = BURN_ENDIAN_SWAP_INT16(pSprite[0]); - - nPriority = ((word >> 4) & 0x01) | 2; - if (nLastSprite[nPriority] == -1) { - nFirstSprite[nPriority] = z; - } - nLastSprite[nPriority] = z; - - pBuffer->priority = 8 >> nPriority; - - pBuffer->flip = (word >> 2) & 0x03; - pBuffer->palette = ((word >> 4) & 0x03F0) + ((word << 5) & 0xC00); - - pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[1]) | ((word & 3) << 16); - - pBuffer->x = x; - pBuffer->y = y; - - pBuffer->xsize = xs; - pBuffer->ysize = ys; - - pBuffer++; - z++; - } - - return 0; -} - -void CaveSpriteExit() -{ - BurnFree(pSpriteList); - BurnFree(pZBuffer); - - CaveSpriteVisibleXOffset = 0; - - return; -} - -INT32 CaveSpriteInit(INT32 nType, INT32 nROMSize) -{ - if (pSpriteList) { - BurnFree(pSpriteList); - } - pSpriteList = (CaveSprite*)BurnMalloc(0x0401 * sizeof(CaveSprite)); - if (pSpriteList == NULL) { - CaveSpriteExit(); - return 1; - } - - for (INT32 i = 0; i < 0x0400; i++) { - pSpriteList[i].xzoom = 0x0100; - pSpriteList[i].yzoom = 0x0100; - } - for (INT32 i = 0; i < 4; i++) { - nFirstSprite[i] = 0x00010000; - nLastSprite[i] = -1; - } - - if (pZBuffer) { - BurnFree(pZBuffer); - } - pZBuffer = (UINT16*)BurnMalloc(nCaveXSize * nCaveYSize * sizeof(UINT16)); - if (pZBuffer == NULL) { - CaveSpriteExit(); - return 1; - } - - memset(pZBuffer, 0, nCaveXSize * nCaveYSize * sizeof(UINT16)); - nZOffset = 0; - - for (nSpriteAddressMask = 1; nSpriteAddressMask < nROMSize; nSpriteAddressMask <<= 1) {} - nSpriteAddressMask--; - - switch (nType) { - case 0: - CaveSpriteBuffer = &CaveSpriteBuffer_NoZoom; - break; - case 1: - CaveSpriteBuffer = &CaveSpriteBuffer_ZoomA; - break; - case 2: - CaveSpriteBuffer = &CaveSpriteBuffer_ZoomB; - break; - case 3: - CaveSpriteBuffer = &CaveSpriteBuffer_PowerInstinct; - break; - default: - CaveSpriteExit(); - return 1; - } - - nCaveSpriteBank = 0; - nCaveSpriteBankDelay = 0; - - RenderSprite = RenderSprite_ROT0[(nCaveXSize == 320) ? 0 : 1]; - - return 0; -} diff --git a/jan/src/burn/drv/cave/cave_sprite_render.h b/jan/src/burn/drv/cave/cave_sprite_render.h deleted file mode 100644 index 69af8f206..000000000 --- a/jan/src/burn/drv/cave/cave_sprite_render.h +++ /dev/null @@ -1,281 +0,0 @@ -// Create a unique name for each of the functions -#define FN(a,b,c,d,e,f,g) RenderSprite ## a ## _ ## b ## _ROT ## c ## d ## e ## _CLIPX ## f ## g -#define FUNCTIONNAME(a,b,c,d,e,f,g) FN(a,b,c,d,e,f,g) - -#if ROT == 0 - #define ADVANCEWORD pPixel += ((BPP >> 3) * 16) - #define ADVANCEROW pRow += ((BPP >> 3) * XSIZE) -#else - #error unsupported rotation angle specified -#endif - -#if EIGHTBIT == 0 - #define DEPTH _16 -#elif EIGHTBIT == 1 - #define DEPTH _256 -#else - #error illegal eightbit value -#endif - -#define TESTCOLOUR(x) x - -#if ZBUFFER == 0 - #define ZBUF _NOZBUFFER - #define ADVANCEZWORD - #define ADVANCEZROW - #define TESTZBUF(a) 1 - #define WRITEZBUF(a) -#elif ZBUFFER == 1 - #define ZBUF _RZBUFFER - #define ADVANCEZWORD pZPixel += 16 - #define ADVANCEZROW pZRow += XSIZE - #define TESTZBUF(a) (pZPixel[a] <= nZPos) - #define WRITEZBUF(a) -#elif ZBUFFER == 2 - #define ZBUF _WZBUFFER - #define ADVANCEZWORD pZPixel += 16 - #define ADVANCEZROW pZRow += XSIZE - #define TESTZBUF(a) 1 - #define WRITEZBUF(a) pZPixel[a] = nZPos -#elif ZBUFFER == 3 - #define ZBUF _RWZBUFFER - #define ADVANCEZWORD pZPixel += 16 - #define ADVANCEZROW pZRow += XSIZE - #define TESTZBUF(a) (pZPixel[a] <= nZPos) - #define WRITEZBUF(a) pZPixel[a] = nZPos -#else - #error unsupported zbuffer mode specified. -#endif - -#if BPP == 16 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTZBUF(a)) { \ - WRITEZBUF(a); \ - *((UINT16*)(pPixel + a * 2)) = (UINT16)pSpritePalette[b]; \ - } -#elif BPP == 24 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTZBUF(a)) { \ - WRITEZBUF(a); \ - UINT32 nRGB = pSpritePalette[b]; \ - pPixel[a * 3 + 0] = (UINT8)nRGB; \ - pPixel[a * 3 + 1] = (UINT8)(nRGB >> 8); \ - pPixel[a * 3 + 2] = (UINT8)(nRGB >> 16); \ - } -#elif BPP == 32 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTZBUF(a)) { \ - WRITEZBUF(a); \ - *((UINT32*)(pPixel + a * 4)) = (UINT32)pSpritePalette[b]; \ - } -#else - #error unsupported bitdepth specified. -#endif - -#if XFLIP == 0 - #define FLIP _NOFLIP -#elif XFLIP == 1 - #define FLIP _FLIPX -#else - #error illegal XFLIP value -#endif - -#if ZOOM == 0 - #define ZOOMMODE _NOZOOM -#elif ZOOM == 1 - #define ZOOMMODE _ZOOMXY -#else - #error unsupported rowscroll mode specified. -#endif - -#if XFLIP == 0 - #define OFFSET(a) a - #define CLIP(a,b) if (nColumn >= (XSIZE - a)) { continue; } \ - if (nXPos >= (0 - a)) { b } -#else - #define OFFSET(a) (15 - a) - #define CLIP(a,b) if (nColumn >= (0 - a) && nColumn < (XSIZE - a)) { b } -#endif - -#if EIGHTBIT == 0 - #define PLOT8_CLIP(x) \ - CLIP(OFFSET((x + 0)), PLOTPIXEL(OFFSET((x + 0)), nColour & 0x0F)); \ - nColour >>= 4; \ - CLIP(OFFSET((x + 1)), PLOTPIXEL(OFFSET((x + 1)), nColour & 0x0F)); \ - \ - nColour >>= 4; \ - CLIP(OFFSET((x + 2)), PLOTPIXEL(OFFSET((x + 2)), nColour & 0x0F)); \ - nColour >>= 4; \ - CLIP(OFFSET((x + 3)), PLOTPIXEL(OFFSET((x + 3)), nColour & 0x0F)); \ - \ - nColour >>= 4; \ - CLIP(OFFSET((x + 4)), PLOTPIXEL(OFFSET((x + 4)), nColour & 0x0F)); \ - nColour >>= 4; \ - CLIP(OFFSET((x + 5)), PLOTPIXEL(OFFSET((x + 5)), nColour & 0x0F)); \ - \ - nColour >>= 4; \ - CLIP(OFFSET((x + 6)), PLOTPIXEL(OFFSET((x + 6)), nColour & 0x0F)); \ - nColour >>= 4; \ - CLIP(OFFSET((x + 7)), PLOTPIXEL(OFFSET((x + 7)), nColour & 0x0F)); - - #define PLOT8_NOCLIP(x) \ - PLOTPIXEL(OFFSET((x + 0)), nColour & 0x0F); \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET((x + 1)), nColour & 0x0F); \ - \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET((x + 2)), nColour & 0x0F); \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET((x + 3)), nColour & 0x0F); \ - \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET((x + 4)), nColour & 0x0F); \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET((x + 5)), nColour & 0x0F); \ - \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET((x + 6)), nColour & 0x0F); \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET((x + 7)), nColour & 0x0F); -#else - #define PLOT4_CLIP(x) \ - CLIP(OFFSET((x + 0)), PLOTPIXEL(OFFSET((x + 0)), nColour & 0xFF)); \ - nColour >>= 8; \ - CLIP(OFFSET((x + 1)), PLOTPIXEL(OFFSET((x + 1)), nColour & 0xFF)); \ - nColour >>= 8; \ - \ - CLIP(OFFSET((x + 2)), PLOTPIXEL(OFFSET((x + 2)), nColour & 0xFF)); \ - nColour >>= 8; \ - CLIP(OFFSET((x + 3)), PLOTPIXEL(OFFSET((x + 3)), nColour & 0xFF)); - - #define PLOT4_NOCLIP(x) \ - PLOTPIXEL(OFFSET((x + 0)), nColour & 0xFF); \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET((x + 1)), nColour & 0xFF); \ - nColour >>= 8; \ - \ - PLOTPIXEL(OFFSET((x + 2)), nColour & 0xFF); \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET((x + 3)), nColour & 0xFF); -#endif - -static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,ZOOMMODE,ZBUF,DEPTH)() -{ -// Create an empty function if unsupported features are requested -#if ROT == 0 - - INT32 x, nColumn; - INT32 nColour; - - #if ZBUFFER == 0 - for (nSpriteRow = 0; nSpriteRow < nYSize; ADVANCEROW, nSpriteRow++, pSpriteData += nSpriteRowSize) { - #else - for (nSpriteRow = 0; nSpriteRow < nYSize; ADVANCEROW, ADVANCEZROW, nSpriteRow++, pSpriteData += nSpriteRowSize) { - #endif - nColumn = nXPos; - - #if ZBUFFER == 0 - #if XFLIP == 0 - for (x = (0 << EIGHTBIT), pPixel = pRow; x < nXSize; x += (2 << EIGHTBIT), nColumn += 16, ADVANCEWORD) { - #else - for (x = nXSize - (2 << EIGHTBIT), pPixel = pRow; x >= 0; x -= (2 << EIGHTBIT), nColumn += 16, ADVANCEWORD) { - #endif - #else - #if XFLIP == 0 - for (x = 0, pPixel = pRow, pZPixel = pZRow; x < nXSize; x += (2 << EIGHTBIT), nColumn += 16, ADVANCEWORD, ADVANCEZWORD) { - #else - for (x = nXSize - (2 << EIGHTBIT), pPixel = pRow, pZPixel = pZRow; x >= 0; x -= (2 << EIGHTBIT), nColumn += 16, ADVANCEWORD, ADVANCEZWORD) { - #endif - #endif - - #if EIGHTBIT == 0 - if (nColumn >= 0 && nColumn < (XSIZE - 16)) { - #if XFLIP == 0 - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]); - PLOT8_NOCLIP(0); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]); - PLOT8_NOCLIP(8); - #else - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]); - PLOT8_NOCLIP(8); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]); - PLOT8_NOCLIP(0); - #endif - } else { - #if XFLIP == 0 - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]); - PLOT8_CLIP(0); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]); - PLOT8_CLIP(8); - #else - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]); - PLOT8_CLIP(8); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]); - PLOT8_CLIP(0); - #endif - #else - if (nColumn >= 0 && nColumn < (XSIZE - 16)) { - #if XFLIP == 0 - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]); - PLOT4_NOCLIP(0); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]); - PLOT4_NOCLIP(4); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 2]); - PLOT4_NOCLIP(8); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 3]); - PLOT4_NOCLIP(12); - #else - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 3]); - PLOT4_NOCLIP(12); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 2]); - PLOT4_NOCLIP(8); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]); - PLOT4_NOCLIP(4); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]); - PLOT4_NOCLIP(0); - #endif - } else { - #if XFLIP == 0 - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]); - PLOT4_CLIP(0); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]); - PLOT4_CLIP(4); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 2]); - PLOT4_CLIP(8); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 3]); - PLOT4_CLIP(12); - #else - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 3]); - PLOT4_CLIP(12); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 2]); - PLOT4_CLIP(8); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]); - PLOT4_CLIP(4); - nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]); - PLOT4_CLIP(0); - #endif - #endif - } - } - } -#endif -} - -#undef PLOT4_CLIP -#undef PLOT4_NOCLIP -#undef PLOT8_CLIP -#undef PLOT8_NOCLIP -#undef OFFSET -#undef FLIP -#undef PLOTPIXEL -#undef CLIP -#undef TESTCOLOUR -#undef ADVANCEZROW -#undef ADVANCEZWORD -#undef ADVANCEROW -#undef ADVANCEWORD -#undef TESTZBUF -#undef WRITEZBUF -#undef ZBUF -#undef ZOOMMODE -#undef DEPTH -#undef FUNCTIONNAME -#undef FN - diff --git a/jan/src/burn/drv/cave/cave_sprite_render_zoom.h b/jan/src/burn/drv/cave/cave_sprite_render_zoom.h deleted file mode 100644 index 52c3e949a..000000000 --- a/jan/src/burn/drv/cave/cave_sprite_render_zoom.h +++ /dev/null @@ -1,182 +0,0 @@ -// Create a unique name for each of the functions -#define FN(a,b,c,d,e,f,g) RenderSprite ## a ## _ ## b ## _ROT ## c ## d ## e ## _NOCLIP ## f ## g -#define FUNCTIONNAME(a,b,c,d,e,f,g) FN(a,b,c,d,e,f,g) - -#if ROT == 0 - #define ADVANCECOLUMN pPixel += (BPP >> 3) - #define ADVANCEROW pRow += ((BPP >> 3) * XSIZE) -#else - #error unsupported rotation angle specified -#endif - -#if EIGHTBIT == 0 - #define DEPTH _16 -#elif EIGHTBIT == 1 - #define DEPTH _256 -#else - #error illegal eightbit value -#endif - -#define TESTCOLOUR(x) x - -#if ZBUFFER == 0 - #define ZBUF _NOZBUFFER - #define ADVANCEZCOLUMN - #define ADVANCEZROW - #define TESTZBUF(a) 1 - #define WRITEZBUF(a) -#elif ZBUFFER == 1 - #define ZBUF _RZBUFFER - #define ADVANCEZCOLUMN pZPixel += 1 - #define ADVANCEZROW pZRow += XSIZE - #define TESTZBUF(a) (pZPixel[a] <= nZPos) - #define WRITEZBUF(a) -#elif ZBUFFER == 2 - #define ZBUF _WZBUFFER - #define ADVANCEZCOLUMN pZPixel += 1 - #define ADVANCEZROW pZRow += XSIZE - #define TESTZBUF(a) 1 - #define WRITEZBUF(a) pZPixel[a] = nZPos -#elif ZBUFFER == 3 - #define ZBUF _RWZBUFFER - #define ADVANCEZCOLUMN pZPixel += 1 - #define ADVANCEZROW pZRow += XSIZE - #define TESTZBUF(a) (pZPixel[a] <= nZPos) - #define WRITEZBUF(a) pZPixel[a] = nZPos -#else - #error unsupported zbuffer mode specified. -#endif - -#if BPP == 16 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTZBUF(a)) { \ - WRITEZBUF(a); \ - *((UINT16*)(pPixel + a * 2)) = (UINT16)pSpritePalette[b]; \ - } -#elif BPP == 24 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTZBUF(a)) { \ - WRITEZBUF(a); \ - UINT32 nRGB = pSpritePalette[b]; \ - pPixel[a * 3 + 0] = (UINT8)nRGB; \ - pPixel[a * 3 + 1] = (UINT8)(nRGB >> 8); \ - pPixel[a * 3 + 2] = (UINT8)(nRGB >> 16); \ - } -#elif BPP == 32 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTZBUF(a)) { \ - WRITEZBUF(a); \ - *((UINT32*)(pPixel + a * 4)) = (UINT32)pSpritePalette[b]; \ - } -#else - #error unsupported bitdepth specified. -#endif - -#if XFLIP == 0 - #define FLIP _NOFLIP -#elif XFLIP == 1 - #define FLIP _FLIPX -#else - #error illegal XFLIP value -#endif - -#if ZOOM == 0 - #define ZOOMMODE _NOZOOM -#elif ZOOM == 1 - #define ZOOMMODE _ZOOMOUT -#elif ZOOM == 2 - #define ZOOMMODE _ZOOMIN -#else - #error unsupported zoom mode specified. -#endif - -static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,ZOOMMODE,ZBUF,DEPTH)() -{ -// Create an empty function if unsupported features are requested -#if ROT == 0 && XFLIP == 0 && EIGHTBIT == 1 - - INT32 nSpriteColumn; - - INT32 nSpriteXOffset2; - - #if ZOOM == 2 - INT32 nPrevSpriteXOffset; - INT32 nPrevSpriteXOffsetStart = nSpriteXOffset & 0xFFFF0000; - INT32 nPrevSpriteYOffset = nSpriteYOffset & 0xFFFF0000; - - if (nPrevSpriteXOffsetStart == 0) { - nPrevSpriteXOffsetStart = 0xFEDC1234; - } - - if (nPrevSpriteYOffset == 0) { - nPrevSpriteYOffset = 0xFEDC1234; - } - #endif - - UINT8* pSpriteRowData = (UINT8*)pSpriteData; - - for (nSpriteRow = nYSize; nSpriteRow > 0; nSpriteRow -= 0x00010000, nSpriteYOffset += nSpriteYZoomSize) { - - #if ZOOM == 2 - if ((nSpriteYOffset & 0xFFFF0000) == (nPrevSpriteYOffset & 0xFFFF0000)) { - - ADVANCEROW; - #if ZBUFFER != 0 - ADVANCEZROW; - #endif - - continue; - } - nPrevSpriteYOffset = nSpriteYOffset; - nPrevSpriteXOffset = nPrevSpriteXOffsetStart; - #endif - pSpriteRowData = ((UINT8*)pSpriteData) + (nSpriteYOffset >> 16) * nSpriteRowSize; - - nSpriteXOffset2 = nSpriteXOffset; - - #if ZBUFFER != 0 - pZPixel = pZRow; - #endif - - for (nSpriteColumn = nXSize, pPixel = pRow; nSpriteColumn > 0; nSpriteColumn -= 0x00010000, nSpriteXOffset2 += nSpriteXZoomSize) { - - #if ZOOM == 2 - if ((nSpriteXOffset2 & 0xFFFF0000) != (nPrevSpriteXOffset & 0xFFFF0000)) { - - nPrevSpriteXOffset = nSpriteXOffset2; - #endif - PLOTPIXEL(0, pSpriteRowData[nSpriteXOffset2 >> 16]); - - #if ZOOM == 2 - } - #endif - - ADVANCECOLUMN; - #if ZBUFFER != 0 - ADVANCEZCOLUMN; - #endif - - } - - ADVANCEROW; - #if ZBUFFER != 0 - ADVANCEZROW; - #endif - } - -#endif -} - -#undef OFFSET -#undef FLIP -#undef PLOTPIXEL -#undef TESTCOLOUR -#undef ADVANCEZROW -#undef ADVANCEZCOLUMN -#undef ADVANCEROW -#undef ADVANCECOLUMN -#undef TESTZBUF -#undef WRITEZBUF -#undef ZBUF -#undef ZOOMMODE -#undef DEPTH -#undef FUNCTIONNAME -#undef FN - diff --git a/jan/src/burn/drv/cave/cave_tile.cpp b/jan/src/burn/drv/cave/cave_tile.cpp deleted file mode 100644 index 29db48925..000000000 --- a/jan/src/burn/drv/cave/cave_tile.cpp +++ /dev/null @@ -1,966 +0,0 @@ -// Cave hardware tilemaps - -#include "cave.h" - -struct CaveTile { INT16 x; INT16 y; UINT32 tile; }; - -static CaveTile* CaveTileQueueMemory[4] = { NULL, }; -static CaveTile* CaveTileQueue[4][4]; - -UINT32 CaveTileReg[4][3]; - -UINT8* CaveTileROM[4] = { NULL, }; -UINT8* CaveTileRAM[4] = { NULL, }; - -static INT8* CaveTileAttrib[4] = { NULL, }; - -INT32 nCaveTileBank = 0; - -// Used when row-select mode is enabled -static INT32* pRowScroll[4] = { NULL, }; -static INT32* pRowSelect[4] = { NULL, }; - -static INT32 nLayerXOffset[4]; -static INT32 nLayerYOffset; -static INT32 nPaletteOffset[4]; -static INT32 nPaletteSize[4]; - -static INT32 CaveTileCount[4]; -static INT32 CaveTileMax[4]; -static INT32 nTileMask[4]; - -static UINT8* pTile; -static UINT32* pTileData; -static UINT32* pTilePalette; -static INT32* pTileRowInfo; - -typedef void (*RenderTileFunction)(); -static RenderTileFunction* RenderTile; - -static INT32 nTileXPos, nTileYPos, nRowOffset; - -static INT32 nClipX8, nClipX16; -static INT32 nClipY8, nClipY16; - -// Include the tile rendering functions -#include "cave_tile_func.h" - -static void CaveQueue8x8Layer_Normal(INT32 nLayer) -{ - INT32 x, y; - INT32 bx, by, cx, cy, mx; - INT32 nTileColumn, nTileRow; - UINT32 nTileNumber; - - UINT8* pTileRAM = CaveTileRAM[nLayer]; - - UINT32 nTileOffset = 0; - if (nCaveTileBank) { - nTileOffset = 0x040000; - } - - mx = (nCaveXSize >> 3) << 2; - - bx = CaveTileReg[nLayer][0] - 0x0A + nLayerXOffset[nLayer]; - bx &= 0x01FF; - cx = (bx >> 3) << 2; - bx &= 0x0007; - - by = CaveTileReg[nLayer][1] + nLayerYOffset; - by &= 0x01FF; - cy = (by >> 3) << 8; - by &= 0x0007; - - for (y = 0; y < (31 << 8); y += (1 << 8)) { - nTileRow = (cy + y) & (0x3F << 8); - nTileYPos = (y >> 5) - by; - - if (nTileYPos <= -8 || nTileYPos >= nCaveYSize) { - continue; - } - - for (x = mx; x >= 0; x -= (1 << 2)) { - nTileColumn = (cx + x) & (0x3F << 2); - nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x4000 + nTileRow + nTileColumn))) << 16; - nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x4002 + nTileRow + nTileColumn))); - - nTileNumber |= nTileOffset; - - if (CaveTileAttrib[nLayer][nTileNumber & nTileMask[nLayer]]) { - continue; - } - - nTileXPos = (x << 1) - bx; - - if (nTileXPos <= -8 || nTileXPos >= nCaveXSize) { - continue; - } - - CaveTileQueue[nLayer][nTileNumber >> 30]->x = nTileXPos; - CaveTileQueue[nLayer][nTileNumber >> 30]->y = nTileYPos; - CaveTileQueue[nLayer][nTileNumber >> 30]->tile = nTileNumber; - CaveTileQueue[nLayer][nTileNumber >> 30]++; - } - } - - return; -} - -static void Cave8x8Layer_Normal(INT32 nLayer, UINT32 nPriority) -{ - UINT32 nTileNumber; - - UINT32* pPalette = CavePalette + nPaletteOffset[nLayer]; - UINT32 nPaletteMask = 0x3F000000; - if (nPaletteSize[nLayer] == 6) { - nPaletteMask = 0x0F000000; - } - INT32 nPaletteShift = 24 - nPaletteSize[nLayer]; - - CaveTile* TileQueue = CaveTileQueue[nLayer][nPriority]; - - while ((nTileXPos = TileQueue->x) < 9999) { - nTileYPos = TileQueue->y; - nTileNumber = TileQueue->tile; - pTilePalette = pPalette + ((nTileNumber & nPaletteMask) >> nPaletteShift); - nTileNumber &= nTileMask[nLayer]; - - pTile = pBurnDraw + (nTileYPos * nBurnPitch) + (nTileXPos * nBurnBpp); - - pTileData = (UINT32*)(CaveTileROM[nLayer] + (nTileNumber << 6)); - - if (nTileYPos < 0 || nTileYPos > nClipY8 || nTileXPos < 0 || nTileXPos > nClipX8) { - RenderTile[1](); - } else { - RenderTile[0](); - } - - TileQueue++; - } - - return; -} - -static void Cave8x8Layer_RowScroll(INT32 nLayer, UINT32 nPriority) -{ - INT32 x, y; - INT32 bx, by, cy; - INT32 nTileColumn, nTileRow; - UINT32 nTileNumber; - - UINT8* pTileRAM = CaveTileRAM[nLayer]; - UINT32* pPalette = CavePalette + nPaletteOffset[nLayer]; - INT32 nPaletteShift = 24 - nPaletteSize[nLayer]; - - INT32* rowscroll = pRowScroll[nLayer]; - - INT32 count = CaveTileCount[nLayer]; - - if (count >= (64 * 31)) { - return; - } - - UINT32 nTileOffset = 0; - if (nCaveTileBank) { - nTileOffset = 0x040000; - } - - bx = CaveTileReg[nLayer][0] - 0x0A + nLayerXOffset[nLayer]; - bx &= 0x01FF; - - by = CaveTileReg[nLayer][1] + nLayerYOffset; - by &= 0x01FF; - cy = (by >> 3) << 8; - by &= 0x0007; - - if (nPriority == 0) { - INT32 dy = CaveTileReg[nLayer][1] + 0x12 - nCaveRowModeOffset; - - for (y = 0; y < nCaveYSize; y++) { - rowscroll[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1000 + (((dy + y) & 0x01FF) << 2)))) + bx; - } - } - - for (y = 0; y < (31 << 8); y += (1 << 8)) { - nTileYPos = (y >> 5) - by; - - nTileRow = (cy + y) & (0x3F << 8); - pTileRowInfo = rowscroll + nTileYPos; - - for (x = 0; x < (64 << 2); x += (1 << 2)) { - nTileColumn = x & (0x3F << 2); - nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x4000 + nTileRow + nTileColumn))) << 16; - if ((nTileNumber >> 30) != nPriority) { - continue; - } - nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x4002 + nTileRow + nTileColumn))); - pTilePalette = pPalette + ((nTileNumber & 0x3F000000) >> nPaletteShift); - - nTileNumber |= nTileOffset; - nTileNumber &= nTileMask[nLayer]; - - count++; - - if (nTileYPos <= -8 || nTileYPos >= nCaveYSize) { - continue; - } - - if (*((UINT32*)(CaveTileAttrib[nLayer] + nTileNumber))) { - continue; - } - - nTileXPos = (x << 1); - - pTile = pBurnDraw + (nTileYPos * nBurnPitch); - - pTileData = (UINT32*)(CaveTileROM[nLayer] + (nTileNumber << 6)); - - if (nTileYPos < 0 || nTileYPos > nClipY8 || nTileXPos < 0 || nTileXPos > nClipX8) { - RenderTile[3](); - } else { - RenderTile[2](); - } - } - } - - if (count >= (64 * 31)) { - CaveTileMax[0] -= 0x0123; - CaveTileMax[1] -= 0x0123; - CaveTileMax[2] -= 0x0123; - CaveTileMax[3] -= 0x0123; - } - CaveTileCount[nLayer] = count; - - return; -} - -static void CaveQueue16x16Layer_Normal(INT32 nLayer) -{ - INT32 x, y; - INT32 bx, by, cx, cy, mx; - INT32 nTileColumn, nTileRow; - UINT32 nTileNumber; - - UINT8* pTileRAM = CaveTileRAM[nLayer]; - - mx = (nCaveXSize >> 4) << 2; - - bx = CaveTileReg[nLayer][0] - 0x12 + nLayerXOffset[nLayer]; - bx &= 0x01FF; - cx = (bx >> 4) << 2; - bx &= 0x000F; - - by = CaveTileReg[nLayer][1] + nLayerYOffset; - by &= 0x01FF; - cy = (by >> 4) << 7; - by &= 0x000F; - - for (y = 0; y < (16 << 7); y += (1 << 7)) { - nTileRow = (cy + y) & (0x1F << 7); - nTileYPos = (y >> 3) - by; - - if (nTileYPos <= -16 || nTileYPos >= nCaveYSize) { - continue; - } - - for (x = mx; x >= 0; x -= (1 << 2)) { - nTileColumn = (cx + x) & (0x1F << 2); - nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn))) << 16; - nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn))); - - if (*((UINT32*)(CaveTileAttrib[nLayer] + ((nTileNumber << 2) & nTileMask[nLayer]))) == 0x01010101) { - continue; - } - - nTileXPos = (x << 2) - bx; - - if (nTileXPos <= -16 || nTileXPos >= nCaveXSize) { - continue; - } - - CaveTileQueue[nLayer][nTileNumber >> 30]->x = nTileXPos; - CaveTileQueue[nLayer][nTileNumber >> 30]->y = nTileYPos; - CaveTileQueue[nLayer][nTileNumber >> 30]->tile = nTileNumber; - CaveTileQueue[nLayer][nTileNumber >> 30]++; - } - } - - return; -} - -static void Cave16x16Layer_Normal(INT32 nLayer, UINT32 nPriority) -{ - UINT32 nTileNumber, nAttrib; - UINT32* pTileStart; - - UINT32* pPalette = CavePalette + nPaletteOffset[nLayer]; - INT32 nPaletteShift = 24 - nPaletteSize[nLayer]; - UINT32 nPaletteMask = 0x3F000000; - if (nPaletteSize[nLayer] == 6) { - nPaletteMask = 0x0F000000; - } - - CaveTile* TileQueue = CaveTileQueue[nLayer][nPriority]; - - while ((nTileXPos = TileQueue->x) < 9999) { - nTileYPos = TileQueue->y; - nTileNumber = TileQueue->tile; - pTilePalette = pPalette + ((nTileNumber & nPaletteMask) >> nPaletteShift); - nTileNumber <<= 2; - nTileNumber &= nTileMask[nLayer]; - - nAttrib = BURN_ENDIAN_SWAP_INT32(*((UINT32*)(CaveTileAttrib[nLayer] + nTileNumber))); - - pTile = pBurnDraw + (nTileYPos * nBurnPitch) + (nTileXPos * nBurnBpp); - - pTileStart = (UINT32*)(CaveTileROM[nLayer] + (nTileNumber << 6)); - - if (nTileXPos < 0 || nTileXPos > nClipX16 || nTileYPos < 0 || nTileYPos > nClipY16) { - - if ((nAttrib & 0x000000FF) == 0) { - pTileData = pTileStart; - if (nTileXPos > -8 && nTileXPos < nCaveXSize && nTileYPos > -8 && nTileYPos < nCaveYSize) { - if (nTileXPos >= 0 && nTileXPos <= nClipX8 && nTileYPos >= 0 && nTileYPos <= nClipY8) { - RenderTile[0](); - } else { - RenderTile[1](); - } - } - } - - nTileXPos += 8; - pTile += 8 * nBurnBpp; - if ((nAttrib & 0x0000FF00) == 0) { - if (nTileXPos > -8 && nTileXPos < nCaveXSize && nTileYPos > -8 && nTileYPos < nCaveYSize) { - pTileData = pTileStart + 16; - if (nTileXPos >= 0 && nTileXPos <= nClipX8 && nTileYPos >= 0 && nTileYPos <= nClipY8) { - RenderTile[0](); - } else{ - RenderTile[1](); - } - } - } - - nTileXPos -= 8; - nTileYPos += 8; - pTile = pBurnDraw + (nTileYPos * nBurnPitch) + (nTileXPos * nBurnBpp); - if ((nAttrib & 0x00FF0000) == 0) { - if (nTileXPos > -8 && nTileXPos < nCaveXSize && nTileYPos > -8 && nTileYPos < nCaveYSize) { - pTileData = pTileStart + 32; - if (nTileXPos >= 0 && nTileXPos <= nClipX8 && nTileYPos >= 0 && nTileYPos <= nClipY8) { - RenderTile[0](); - } else { - RenderTile[1](); - } - } - } - - nTileXPos += 8; - pTile += 8 * nBurnBpp; - if ((nAttrib & 0xFF000000) == 0) { - if (nTileXPos > -8 && nTileXPos < nCaveXSize && nTileYPos > -8 && nTileYPos < nCaveYSize) { - pTileData = pTileStart + 48; - if (nTileXPos >= 0 && nTileXPos <= nClipX8 && nTileYPos >= 0 && nTileYPos <= nClipY8) { - RenderTile[0](); - } else { - RenderTile[1](); - } - } - } - - } else { - if ((nAttrib & 0x000000FF) == 0) { - pTileData = pTileStart; - RenderTile[0](); - } - nTileXPos += 8; - pTile += 8 * nBurnBpp; - if ((nAttrib & 0x0000FF00) == 0) { - pTileData = pTileStart + 16; - RenderTile[0](); - } - nTileXPos -= 8; - nTileYPos += 8; - pTile = pBurnDraw + (nTileYPos * nBurnPitch) + (nTileXPos * nBurnBpp); - if ((nAttrib & 0x00FF0000) == 0) { - pTileData = pTileStart + 32; - RenderTile[0](); - } - nTileXPos += 8; - pTile += 8 * nBurnBpp; - if ((nAttrib & 0xFF000000) == 0) { - pTileData = pTileStart + 48; - RenderTile[0](); - } - } - - TileQueue++; - } - - return; -} - -static void Cave16x16Layer_RowScroll(INT32 nLayer, UINT32 nPriority) -{ - INT32 x, y; - INT32 bx, by, cy; - INT32 nTileColumn, nTileRow; - UINT32 nTileNumber, nAttrib; - UINT32* pTileStart; - - UINT8* pTileRAM = CaveTileRAM[nLayer]; - UINT32* pPalette = CavePalette + nPaletteOffset[nLayer]; - INT32 nPaletteShift = 24 - nPaletteSize[nLayer]; - UINT32 nPaletteMask = 0x3F000000; - if (nPaletteSize[nLayer] == 6) { - nPaletteMask = 0x0F000000; - } - - INT32* rowscroll = pRowScroll[nLayer]; - - INT32 count = CaveTileCount[nLayer]; - - if (count >= (32 * 16)) { - return; - } - - bx = CaveTileReg[nLayer][0] - 0x12 + nLayerXOffset[nLayer]; - bx &= 0x01FF; - - by = CaveTileReg[nLayer][1] + nLayerYOffset; - by &= 0x01FF; - cy = (by >> 4) << 7; - by &= 0x000F; - - if (nPriority == 0) { - INT32 dy = CaveTileReg[nLayer][1] + 0x12 - nCaveRowModeOffset; - - for (y = 0; y < nCaveYSize; y++) { - rowscroll[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1000 + (((dy + y) & 0x01FF) << 2)))) + bx; - } - } - - for (y = 0; y < (16 << 7); y += (1 << 7)) { - nTileRow = (cy + y) & (0x1F << 7); - nTileYPos = (y >> 3) - by; - - pTileRowInfo = rowscroll + nTileYPos; - - for (x = 0; x < (32 << 2); x += (1 << 2)) { - nTileColumn = x & (0x1F << 2); - nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn))) << 16; - if ((nTileNumber >> 30) != nPriority) { - continue; - } - nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn))); - pTilePalette = pPalette + ((nTileNumber & nPaletteMask) >> nPaletteShift); - nTileNumber <<= 2; - nTileNumber &= nTileMask[nLayer]; - - count++; - - nAttrib = BURN_ENDIAN_SWAP_INT32(*((UINT32*)(CaveTileAttrib[nLayer] + nTileNumber))); - if (nAttrib == 0x01010101) { - continue; - } - - nTileXPos = (x << 2); - - pTile = pBurnDraw + (nTileYPos * nBurnPitch); - - pTileStart = (UINT32*)(CaveTileROM[nLayer] + (nTileNumber << 6)); - - if (nTileYPos < 0 || nTileYPos > nClipY16) { - if ((nAttrib & 0x000000FF) == 0) { - pTileData = pTileStart; - if (nTileYPos > -8 && nTileYPos < nCaveYSize) { - if (nTileYPos >= 0 && nTileYPos <= nClipY8) { - RenderTile[2](); - } else { - RenderTile[3](); - } - } - } - nTileXPos += 8; - if ((nAttrib & 0x0000FF00) == 0) { - if (nTileYPos > -8 && nTileYPos < nCaveYSize) { - pTileData = pTileStart + 16; - if (nTileYPos >= 0 && nTileYPos <= nClipY8) { - RenderTile[2](); - } else { - RenderTile[3](); - } - } - } - nTileXPos -= 8; - nTileYPos += 8; - - pTileRowInfo += 8; - - pTile = pBurnDraw + (nTileYPos * nBurnPitch); - if ((nAttrib & 0x00FF0000) == 0) { - if (nTileYPos > -8 && nTileYPos < nCaveYSize) { - pTileData = pTileStart + 32; - if (nTileYPos >= 0 && nTileYPos <= nClipY8) { - RenderTile[2](); - } else { - RenderTile[3](); - } - } - } - nTileXPos += 8; - if ((nAttrib & 0xFF000000) == 0) { - if (nTileYPos > -8 && nTileYPos < nCaveYSize) { - pTileData = pTileStart + 48; - if (nTileYPos >= 0 && nTileYPos <= nClipY8) { - RenderTile[2](); - } else { - RenderTile[3](); - } - } - } - } else { - if ((nAttrib & 0x000000FF) == 0) { - pTileData = pTileStart; - RenderTile[2](); - } - nTileXPos += 8; - if ((nAttrib & 0x0000FF00) == 0) { - pTileData = pTileStart + 16; - RenderTile[2](); - } - nTileXPos -= 8; - nTileYPos += 8; - - pTileRowInfo += 8; - - pTile = pBurnDraw + (nTileYPos * nBurnPitch); - if ((nAttrib & 0x00FF0000) == 0) { - pTileData = pTileStart + 32; - RenderTile[2](); - } - nTileXPos += 8; - if ((nAttrib & 0xFF000000) == 0) { - pTileData = pTileStart + 48; - RenderTile[2](); - } - } - nTileYPos -= 8; - - pTileRowInfo -= 8; - } - } - - if (count >= (32 * 16)) { - CaveTileMax[0] -= 0x0123; - CaveTileMax[1] -= 0x0123; - CaveTileMax[2] -= 0x0123; - CaveTileMax[3] -= 0x0123; - } - CaveTileCount[nLayer] = count; - - return; -} - -static void Cave16x16Layer_RowSelect(INT32 nLayer, UINT32 nPriority) -{ - INT32 x, y, ry, rx; - INT32 bx, by, mx; - INT32 nTileColumn, nTileRow; - UINT32 nTileNumber; - UINT32* pTileStart; - - UINT8* pTileRAM = CaveTileRAM[nLayer]; - UINT32* pPalette = CavePalette + nPaletteOffset[nLayer]; - INT32 nPaletteShift = 24 - nPaletteSize[nLayer]; - UINT32 nPaletteMask = 0x3F000000; - if (nPaletteSize[nLayer] == 6) { - nPaletteMask = 0x0F000000; - } - - INT32* rowselect = pRowSelect[nLayer]; - INT32* rowscroll = pRowScroll[nLayer]; - - INT32 count = CaveTileCount[nLayer]; - - mx = nCaveXSize >> 4; - - if (count >= nCaveYSize * (mx + 1)) { - return; - } - - bx = CaveTileReg[nLayer][0] - 0x12 + nLayerXOffset[nLayer]; - bx &= 0x01FF; - - by = CaveTileReg[nLayer][1] + nLayerYOffset; - by &= 0x01FF; - - if (nPriority == 0) { - INT32 cy = CaveTileReg[nLayer][1] + 0x12 - nCaveRowModeOffset; - - if (CaveTileReg[nLayer][0] & 0x4000) { // Row-scroll mode - for (y = 0; y < nCaveYSize; y++) { - rowselect[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1002 + (((cy + y) & 0x01FF) << 2)))); - rowscroll[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1000 + (((cy + y) & 0x01FF) << 2)))) + bx; - } - } else { - for (y = 0; y < nCaveYSize; y++) { - rowselect[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1002 + (((cy + y) & 0x01FF) << 2)))); - } - } - } - - for (y = 0; y < nCaveYSize; y++) { - ry = rowselect[y]; - nTileRow = ((ry >> 4) & 0x1F) << 7; - nTileYPos = y; - - if (CaveTileReg[nLayer][0] & 0x4000) { // Row-scroll mode - rx = rowscroll[y]; - ry = (((ry & 8) << 1) + (ry & 7)) << 1; - - for (x = 0; x <= mx; x++) { - - nTileColumn = (((rx >> 4) + x) & 0x1F) << 2; - nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn))) << 16; - if ((nTileNumber >> 30) != nPriority) { - continue; - } - nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn))); - pTilePalette = pPalette + ((nTileNumber & nPaletteMask) >> nPaletteShift); - nTileNumber &= nTileMask[nLayer]; - - count++; - - if (((UINT32*)CaveTileAttrib[nLayer])[nTileNumber] == 0x01010101) { - continue; - } - - nTileXPos = (x << 4) - (rx & 15); - - if (nTileXPos <= -16 || nTileXPos >= nCaveXSize) { - continue; - } - - pTile = pBurnDraw + (nTileYPos * nBurnPitch) + (nTileXPos * nBurnBpp); - - pTileStart = (UINT32*)(CaveTileROM[nLayer] + (nTileNumber << 8)); - pTileStart += ry; - - pTileData = pTileStart; - if (nTileXPos >= 0 && nTileXPos <= nClipX8) { - RenderTile[4](); - } else { - RenderTile[5](); - } - nTileXPos += 8; - pTile += (nBurnBpp << 3); - pTileData = pTileStart + 16; - if (nTileXPos >= 0 && nTileXPos <= nClipX16) { - RenderTile[4](); - } else { - RenderTile[5](); - } - } - } else { - nTileXPos = - (bx & 15); - pTile = pBurnDraw + (nTileYPos * nBurnPitch) - ((bx & 15) * nBurnBpp); - - ry = (((ry & 8) << 1) + (ry & 7)) << 1; - - for (x = 0; x <= mx; x++) { - nTileColumn = (((bx >> 4) + x) & 0x1F) << 2; - nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn))) << 16; - if ((nTileNumber >> 30) != nPriority) { - nTileXPos += 16; - pTile += (nBurnBpp << 4); - continue; - } - nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn))); - pTilePalette = pPalette + ((nTileNumber & nPaletteMask) >> nPaletteShift); - nTileNumber &= nTileMask[nLayer]; - - count++; - - if (((UINT32*)CaveTileAttrib[nLayer])[nTileNumber] == 0x01010101) { - nTileXPos += 16; - pTile += (nBurnBpp << 4); - continue; - } - - pTileStart = (UINT32*)(CaveTileROM[nLayer] + (nTileNumber << 8)); - pTileStart += ry; - - pTileData = pTileStart; - - if (nTileXPos >= 0 && nTileXPos <= nClipX8) { - RenderTile[4](); - } else { - RenderTile[5](); - } - nTileXPos += 8; - pTile += (nBurnBpp << 3); - - pTileData = pTileStart + 16; - if (nTileXPos >= 0 && nTileXPos <= nClipX8) { - RenderTile[4](); - } else { - RenderTile[5](); - } - nTileXPos += 8; - pTile += (nBurnBpp << 3); - } - } - } - - if (count >= nCaveYSize * (mx + 1)) { - CaveTileMax[0] -= 0x0123; - CaveTileMax[1] -= 0x0123; - CaveTileMax[2] -= 0x0123; - CaveTileMax[3] -= 0x0123; - } - CaveTileCount[nLayer] = count; - - return; -} - -static void Cave16x16Layer(INT32 nLayer, UINT32 nPriority) -{ - if (CaveTileReg[nLayer][1] & 0x4000) { // Row-select mode - Cave16x16Layer_RowSelect(nLayer, nPriority); -// bprintf(PRINT_NORMAL, " Layer %d row-select mode enabled (16x16)\n", nLayer); - return; - } - - if (CaveTileReg[nLayer][0] & 0x4000) { // Row-scroll mode - Cave16x16Layer_RowScroll(nLayer, nPriority); -// bprintf(PRINT_NORMAL, " Layer %d row-scroll mode enabled (16x16)\n", nLayer); - return; - } - - Cave16x16Layer_Normal(nLayer, nPriority); - - return; -} - -static void Cave8x8Layer(INT32 nLayer, UINT32 nPriority) -{ -#if 0 - if (CaveTileReg[nLayer][1] & 0x4000) { // Row-select mode - Cave8x8Layer_RowSelect(nLayer, nPriority); -// bprintf(PRINT_NORMAL, " Layer %d row-select mode enabled ( 8x 8)\n", nLayer); - return; - } -#else - if (CaveTileReg[nLayer][1] & 0x4000) { -// bprintf(PRINT_ERROR, " Layer %d row-select mode enabled ( 8x 8, UNSUPPORTED!)\n", nLayer); - } -#endif - - if (CaveTileReg[nLayer][0] & 0x4000) { // Row-scroll mode - Cave8x8Layer_RowScroll(nLayer, nPriority); -// bprintf(PRINT_NORMAL, " Layer %d row-scroll mode enabled ( 8x 8)\n", nLayer); - return; - } - - Cave8x8Layer_Normal(nLayer, nPriority); - - return; -} - -INT32 CaveTileRender(INT32 nMode) -{ - UINT32 nPriority; - INT32 nLowPriority; - INT32 nLayer; - INT32 nOffset = 0; - - CaveTileCount[0] = CaveTileCount[1] = CaveTileCount[2] = CaveTileCount[3] = 0; - CaveTileMax[0] = CaveTileMax[1] = CaveTileMax[2] = CaveTileMax[3] = 0; - - nLayerYOffset = 0x12 - nCaveYOffset - nCaveExtraYOffset; - - for (nLayer = 0; nLayer < 4; nLayer++) { - - nLayerXOffset[nLayer] = nLayer + nOffset - nCaveXOffset - nCaveExtraXOffset; - - if ((CaveTileReg[nLayer][2] & 0x0010) == 0) { - - for (nPriority = 0; nPriority < 4; nPriority++) { - CaveTileQueue[nLayer][nPriority] = &CaveTileQueueMemory[nLayer][nPriority * 1536]; - } - if (nBurnLayer & (8 >> nLayer)) { - if (CaveTileReg[nLayer][1] & 0x2000) { - if (nMode && ((CaveTileReg[nLayer][0] | CaveTileReg[nLayer][1]) & 0x4000)) { - CaveTileMax[0] += 0x0123; - CaveTileMax[1] += 0x0123; - CaveTileMax[2] += 0x0123; - CaveTileMax[3] += 0x0123; - } else { - CaveQueue16x16Layer_Normal(nLayer); - } - } else { - if (nMode && (CaveTileReg[nLayer][0] & 0x4000)) { - CaveTileMax[0] += 0x0123; - CaveTileMax[1] += 0x0123; - CaveTileMax[2] += 0x0123; - CaveTileMax[3] += 0x0123; - } else { - CaveQueue8x8Layer_Normal(nLayer); - } - -// nOffset += 8; - } - } - - for (nPriority = 0; nPriority < 4; nPriority++) { - CaveTileQueue[nLayer][nPriority]->x = 9999; - CaveTileQueue[nLayer][nPriority] = &CaveTileQueueMemory[nLayer][nPriority * 1536]; - if (CaveTileQueue[nLayer][nPriority]->x < 9999) { - CaveTileMax[nPriority] += 0x123; - } - } - } - } - - nLowPriority = 0; - - for (nPriority = 0; nPriority < 4; nPriority++) { - - if (CaveTileMax[nPriority] || nPriority == 3) { - CaveSpriteRender(nLowPriority, nPriority); - nLowPriority = nPriority + 1; - } - - for (UINT32 i = 0; i < 4; i++) { - for (nLayer = 0; nLayer < 4; nLayer++) { - if ((CaveTileReg[nLayer][2] & 0x0003) == i) { - if ((CaveTileReg[nLayer][2] & 0x0010) || (nBurnLayer & (8 >> nLayer)) == 0) { - continue; - } - - if (CaveTileReg[nLayer][1] & 0x2000) { - if (nMode) { - Cave16x16Layer(nLayer, nPriority); - } else { - Cave16x16Layer_Normal(nLayer, nPriority); - } - } else { - if (nMode) { - Cave8x8Layer(nLayer, nPriority); - } else { - Cave8x8Layer_Normal(nLayer, nPriority); - } - } - } - } - } - } - - return 0; -} - -void CaveTileExit() -{ - for (INT32 nLayer = 0; nLayer < 4; nLayer++) { - BurnFree(CaveTileAttrib[nLayer]); - BurnFree(CaveTileQueueMemory[nLayer]); - BurnFree(pRowScroll[nLayer]); - BurnFree(pRowSelect[nLayer]); - } - - nCaveXOffset = nCaveYOffset = 0; - nCaveRowModeOffset = 0; - nCaveExtraXOffset = nCaveExtraYOffset = 0; - - return; -} - -INT32 CaveTileInit() -{ - for (INT32 nLayer = 0; nLayer < 4; nLayer++) { - CaveTileReg[nLayer][0] = 0x0000; - CaveTileReg[nLayer][1] = 0x0000; - CaveTileReg[nLayer][2] = 0x0010; // Disable layer - } - - nCaveTileBank = 0; - - BurnDrvGetFullSize(&nCaveXSize, &nCaveYSize); - - nClipX8 = nCaveXSize - 8; - nClipX16 = nCaveXSize - 16; - nClipY8 = nCaveYSize - 8; - nClipY16 = nCaveYSize - 16; - - RenderTile = RenderTile_ROT0[(nCaveXSize == 320) ? 0 : 1]; - - return 0; -} - -INT32 CaveTileInitLayer(INT32 nLayer, INT32 nROMSize, INT32 nBitdepth, INT32 nOffset) -{ - INT32 nTileSize = (8 << 3); - INT32 nNumTiles = nROMSize / nTileSize; - - for (nTileMask[nLayer] = 1; nTileMask[nLayer] < nNumTiles; nTileMask[nLayer] <<= 1) { } - nTileMask[nLayer]--; - - if (CaveTileAttrib[nLayer]) { - BurnFree(CaveTileAttrib[nLayer]); - } - CaveTileAttrib[nLayer] = (INT8*)BurnMalloc(nTileMask[nLayer] + 1); - if (CaveTileAttrib[nLayer] == NULL) { - return 1; - } - - for (INT32 i = 0; i < nNumTiles; i++) { - bool bTransparent = true; - for (INT32 j = i * nTileSize; j < (i + 1) * nTileSize; j++) { - if (CaveTileROM[nLayer][j]) { - bTransparent = false; - break; - } - } - if (bTransparent) { - CaveTileAttrib[nLayer][i] = 1; - } else { - CaveTileAttrib[nLayer][i] = 0; - } - } - - for (INT32 i = nNumTiles; i <= nTileMask[nLayer]; i++) { - CaveTileAttrib[nLayer][i] = 1; - } - - if (CaveTileQueueMemory[nLayer]) { - BurnFree(CaveTileQueueMemory[nLayer]); - } - CaveTileQueueMemory[nLayer] = (CaveTile*)BurnMalloc(4 * 1536 * sizeof(CaveTile)); - if (CaveTileQueueMemory[nLayer] == NULL) { - return 1; - } - - if (pRowScroll[nLayer]) { - BurnFree(pRowScroll[nLayer]); - } - pRowScroll[nLayer] = (INT32*)BurnMalloc(nCaveYSize * sizeof(INT32)); - if (pRowScroll[nLayer] == NULL) { - return 1; - } - - if (pRowSelect[nLayer]) { - BurnFree(pRowSelect[nLayer]); - } - pRowSelect[nLayer] = (INT32*)BurnMalloc(nCaveYSize * sizeof(INT32)); - if (pRowSelect[nLayer] == NULL) { - return 1; - } - - nPaletteSize[nLayer] = nBitdepth; - nPaletteOffset[nLayer] = nOffset; - - CaveTileReg[nLayer][2] = 0x0000; // Enable layer - - return 0; -} diff --git a/jan/src/burn/drv/cave/cave_tile_render.h b/jan/src/burn/drv/cave/cave_tile_render.h deleted file mode 100644 index 92d16f99c..000000000 --- a/jan/src/burn/drv/cave/cave_tile_render.h +++ /dev/null @@ -1,370 +0,0 @@ -// Graphics format: 8 8 pixel tiles, 4/8 bits/pixel. - -// Create a unique name for each of the functions -#define FN(a,b,c,d,e,f,g,h) RenderTile ## a ## _ ## b ## _ROT ## c ## d ## e ## f ## g ## h -#define FUNCTIONNAME(a,b,c,d,e,f,g,h) FN(a,b,c,d,e,f,g,h) - -#if ROT == 0 - - #if XFLIP == 0 - #define ADVANCECOLUMN pPixel += (BPP >> 3) - #else - #error illegal XFLIP value - #endif - - #if YFLIP == 0 - #define ADVANCEROW pTileRow += ((BPP >> 3) * XSIZE) - #else - #error illegal YFLIP value - #endif - -#else - #error unsupported rotation angle specified -#endif - -#if DOCLIP == 0 - #define CLIP _NOCLIP -#elif DOCLIP == 1 - #define CLIP _CLIP -#else - #error illegal doclip value. -#endif - -#if EIGHTBIT == 0 - #define DEPTH _16 -#elif EIGHTBIT == 1 - #define DEPTH _256 -#else - #error illegal eightbit value -#endif - -#define TESTCOLOUR(x) x - -#if BPP == 16 - #define PLOTPIXEL(a) if (TESTCOLOUR(a)) { \ - *((UINT16*)pPixel) = (UINT16)pTilePalette[a]; \ - } -#elif BPP == 24 - #define PLOTPIXEL(a) if (TESTCOLOUR(a)) { \ - UINT32 nRGB = pTilePalette[a]; \ - pPixel[0] = (UINT8)nRGB; \ - pPixel[1] = (UINT8)(nRGB >> 8); \ - pPixel[2] = (UINT8)(nRGB >> 16); \ - } -#elif BPP == 32 - #define PLOTPIXEL(a) if (TESTCOLOUR(a)) { \ - *((UINT32*)pPixel) = (UINT32)pTilePalette[a]; \ - } -#else - #error unsupported bitdepth specified. -#endif - -// For decorating the function name -#if XFLIP == 1 - #if YFLIP == 1 - #define FLIP _FLIPXY - #else - #define FLIP _FLIPX - #endif -#elif YFLIP == 1 - #define FLIP _FLIPY -#else - #define FLIP _NOFLIP -#endif - -#if ROWSELECT == 0 - #define SELECT _NOROWSELECT -#elif ROWSELECT == 1 - #define SELECT _ROWSELECT -#else - #error unsupported rowselect mode specified. -#endif - -#if ROWSCROLL == 0 - #define SCROLL _NOROWSCROLL -#elif ROWSCROLL == 1 - #define SCROLL _ROWSCROLL -#else - #error unsupported rowscroll mode specified. -#endif - -static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,SCROLL,SELECT,CLIP,DEPTH)() -{ -// Create an empty function if unsupported features are requested -#if ROT == 0 && XFLIP == 0 && YFLIP == 0 && !(ROWSCROLL == 1 && ROWSELECT == 1) && EIGHTBIT == 1 - - UINT8 *pTileRow, *pPixel; - INT32 nColour; - - #if ROWSELECT == 0 - INT32 y; - #endif - - #if ROWSELECT == 0 - for (y = 0, pTileRow = pTile; y < 8; y++, ADVANCEROW) { - - #if DOCLIP == 1 - if (nTileYPos + y < 0) { - - #if EIGHTBIT == 0 - pTileData++; - #else - pTileData += 2; - #endif - - continue; - } - - if (nTileYPos + y >= nCaveYSize) { - return; - } - #endif - - #else - pTileRow = pTile; - #endif - - pPixel = pTileRow; - - #if ROWSCROLL == 1 - nRowOffset = (nTileXPos - pTileRowInfo[y]) & 0x01FF; - if (nRowOffset >= 0x01F8) { - nRowOffset -= 0x0200; - } - if (nRowOffset >= XSIZE) { - #if EIGHTBIT == 0 - pTileData++; - #else - pTileData += 2; - #endif - continue; - } - pPixel += (BPP >> 3) * nRowOffset; - #endif - - #if ROWSCROLL == 1 - #define XPOS nRowOffset - #else - #define XPOS nTileXPos - #endif - - #if EIGHTBIT == 0 - #if DOCLIP == 1 || ROWSCROLL == 1 - nColour = BURN_ENDIAN_SWAP_INT32(*pTileData++); - - if (XPOS <= (XSIZE - 8)) { - if (XPOS < 0) { - nColour >>= -XPOS * 4; - pPixel += -XPOS * (BPP >> 3); - } - - switch (XPOS < 0 ? -XPOS : 0) { - case 0: - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - case 1: - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - case 2: - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - case 3: - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - case 4: - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - case 5: - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - case 6: - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - case 7: - PLOTPIXEL(nColour & 0x0F); - } - } else { - - #define CLIPPIXEL(a,b) if (XPOS < XSIZE - (a)) { b; } - CLIPPIXEL(0, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(1, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(2, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(3, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(4, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(5, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(6, PLOTPIXEL(nColour & 0xFF)); - #undef CLIPPIXEL - - } - #else - nColour = BURN_ENDIAN_SWAP_INT32(*pTileData++); - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - - nColour >>= 4; - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - - nColour >>= 4; - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - - nColour >>= 4; - PLOTPIXEL(nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - PLOTPIXEL(nColour & 0x0F); - #endif - #else - #if DOCLIP == 1 || ROWSCROLL == 1 - nColour = BURN_ENDIAN_SWAP_INT32(pTileData[0]); - - if (XPOS <= (XSIZE - 8)) { - if (XPOS < 0) { - if (XPOS < -3) { - nColour = BURN_ENDIAN_SWAP_INT32(pTileData[1]); - } - nColour >>= (-XPOS & 3) * 8; - pPixel += -XPOS * (BPP >> 3); - } - - switch (XPOS < 0 ? -XPOS : 0) { - case 0: - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - case 1: - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - case 2: - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - case 3: - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour = BURN_ENDIAN_SWAP_INT32(pTileData[1]); - case 4: - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - case 5: - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - case 6: - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - case 7: - PLOTPIXEL(nColour & 0xFF); - } - } else { - - #define CLIPPIXEL(a,b) if (XPOS < XSIZE - (a)) { b; } - CLIPPIXEL(0, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(1, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(2, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(3, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour = BURN_ENDIAN_SWAP_INT32(pTileData[1]); - CLIPPIXEL(4, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(5, PLOTPIXEL(nColour & 0xFF)); - ADVANCECOLUMN; - nColour >>= 8; - CLIPPIXEL(6, PLOTPIXEL(nColour & 0xFF)); - #undef CLIPPIXEL - - } - - pTileData += 2; - - #else - nColour = BURN_ENDIAN_SWAP_INT32(*pTileData++); - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - - nColour >>= 8; - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - - nColour = BURN_ENDIAN_SWAP_INT32(*pTileData++); - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - - nColour >>= 8; - PLOTPIXEL(nColour & 0xFF); - ADVANCECOLUMN; - nColour >>= 8; - PLOTPIXEL(nColour & 0xFF); - #endif - #endif - - #undef XPOS - - #if ROWSELECT == 0 - } - #endif - -#endif -} - -#undef FLIP -#undef CLIP -#undef PLOTPIXEL -#undef TESTCLIP -#undef TESTCOLOUR -#undef ADVANCEROW -#undef ADVANCECOLUMN -#undef SCROLL -#undef SELECT -#undef DEPTH -#undef FUNCTIONNAME -#undef FN - diff --git a/jan/src/burn/drv/cave/d_dodonpachi.cpp b/jan/src/burn/drv/cave/d_dodonpachi.cpp deleted file mode 100644 index 30522db10..000000000 --- a/jan/src/burn/drv/cave/d_dodonpachi.cpp +++ /dev/null @@ -1,688 +0,0 @@ -// DoDonpachi -#include "cave.h" -#include "ymz280b.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01; -static UINT8 *DefaultEEPROM = NULL; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCurrentCPU; -static INT32 nCyclesDone[2]; -static INT32 nCyclesTotal[2]; -static INT32 nCyclesSegment; -static INT32 nCyclesExtra; - -static struct BurnInputInfo ddonpachInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, -}; - -STDINPUTINFO(ddonpach) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall ddonpachReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300002: - case 0x300003: { - return YMZ280BReadStatus(); - } - - case 0x800000: - case 0x800001: { - UINT8 nRet = 6 | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x800002: - case 0x800003: - case 0x800004: - case 0x800005: - case 0x800006: - case 0x800007: { - UINT8 nRet = 6 | nVideoIRQ; - return nRet; - } - - case 0xD00000: - return (DrvInput[0] >> 8) ^ 0xFF; - case 0xD00001: - return (DrvInput[0] & 0xFF) ^ 0xFF; - case 0xD00002: - return ((DrvInput[1] >> 8) ^ 0xF7) | (EEPROMRead() << 3); - case 0xD00003: - return (DrvInput[1] & 0xFF) ^ 0xFF; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -UINT16 __fastcall ddonpachReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300002: { - return YMZ280BReadStatus(); - } - - case 0x800000: { - UINT16 nRet = 6 | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0x800002: - case 0x800004: - case 0x800006: { - UINT16 nRet = 6 | nVideoIRQ; - return nRet; - } - - case 0xD00000: - return DrvInput[0] ^ 0xFFFF; - case 0xD00002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall ddonpachWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x300001: - YMZ280BSelectRegister(byteValue); - return; - case 0x300003: - YMZ280BWriteRegister(byteValue); - return; - - case 0xE00000: - EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08); - return; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall ddonpachWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x300000: - YMZ280BSelectRegister(wordValue); - return; - case 0x300002: - YMZ280BWriteRegister(wordValue); - return; - - case 0x800000: - nCaveXOffset = wordValue; - return; - case 0x800002: - nCaveYOffset = wordValue; - return; - case 0x800008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0x900000: - CaveTileReg[0][0] = wordValue; - return; - case 0x900002: - CaveTileReg[0][1] = wordValue; - return; - case 0x900004: - CaveTileReg[0][2] = wordValue; - return; - - case 0xA00000: - CaveTileReg[1][0] = wordValue; - return; - case 0xA00002: - CaveTileReg[1][1] = wordValue; - return; - case 0xA00004: - CaveTileReg[1][2] = wordValue; - return; - - case 0xB00000: - CaveTileReg[2][0] = wordValue; - return; - case 0xB00002: - CaveTileReg[2][1] = wordValue; - return; - case 0xB00004: - CaveTileReg[2][2] = wordValue; - return; - - case 0xE00000: - wordValue >>= 8; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - return; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } - } -} - -void __fastcall ddonpachWriteBytePalette(UINT32 sekAddress, UINT8 byteValue) -{ - CavePalWriteByte(sekAddress & 0xFFFF, byteValue); -} - -void __fastcall ddonpachWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - CavePalWriteWord(sekAddress & 0xFFFF, wordValue); -} - -static void TriggerSoundIRQ(INT32 nStatus) -{ - nSoundIRQ = nStatus ^ 1; - UpdateIRQStatus(); - - if (nIRQPending && nCurrentCPU != 0) { - nCyclesDone[0] += SekRun(0x0400); - } -} - -static INT32 DrvExit() -{ - YMZ280BExit(); - - EEPROMExit(); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - - // Deallocate all used memory - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - YMZ280BReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - nCyclesExtra = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - CavePalUpdate8Bit(0, 128); // Update the palette - CaveClearScreen(CavePalette[0x7F00]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 10; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesDone[0] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - SekOpen(0); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nNext; - - // Render sound segment - if ((i & 1) == 0) { - if (pBurnSoundOut) { - INT32 nSegmentEnd = nBurnSoundLen * i / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - YMZ280BRender(pSoundBuf, nSegmentEnd - nSoundBufferPos); - nSoundBufferPos = nSegmentEnd; - } - } - - // Run 68000 - nCurrentCPU = 0; - nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment+nCyclesExtra); - nCyclesExtra = 0; - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - nCurrentCPU = -1; - } - - // Make sure the buffer is entirely filled. - { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - YMZ280BRender(pSoundBuf, nSegmentLength); - } - } - } - - nCyclesExtra = SekTotalCycles() - nCyclesTotal[0]; - SekClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // 68K program - CaveSpriteROM = Next; Next += 0x1000000; - CaveTileROM[0] = Next; Next += 0x400000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x400000; // Tile layer 1 - CaveTileROM[2] = Next; Next += 0x200000; // Tile layer 2 - YMZ280BROM = Next; Next += 0x400000; - DefaultEEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveTileRAM[2] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x010000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap2(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[1] = *pOrg & 15; - pDest[0] = *pOrg >> 4; - } - - return; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01 + 0, 1, 2); - BurnLoadRom(Rom01 + 1, 0, 2); - - BurnLoadRom(CaveSpriteROM + 0x000000, 2, 1); - BurnLoadRom(CaveSpriteROM + 0x200000, 3, 1); - BurnLoadRom(CaveSpriteROM + 0x400000, 4, 1); - BurnLoadRom(CaveSpriteROM + 0x600000, 5, 1); - BurnByteswap(CaveSpriteROM, 0x800000); - NibbleSwap2(CaveSpriteROM, 0x800000); - - BurnLoadRom(CaveTileROM[0], 6, 1); - NibbleSwap2(CaveTileROM[0], 0x200000); - BurnLoadRom(CaveTileROM[1], 7, 1); - NibbleSwap2(CaveTileROM[1], 0x200000); - - UINT8* pTemp = (UINT8*)BurnMalloc(0x200000); - BurnLoadRom(pTemp, 8, 1); - for (INT32 i = 0; i < 0x0100000; i++) { - CaveTileROM[2][(i << 1) + 1] = (pTemp[(i << 1) + 0] & 15) | ((pTemp[(i << 1) + 1] & 15) << 4); - CaveTileROM[2][(i << 1) + 0] = (pTemp[(i << 1) + 0] >> 4) | (pTemp[(i << 1) + 1] & 240); - } - BurnFree(pTemp); - - // Load YMZ280B data - BurnLoadRom(YMZ280BROM + 0x000000, 9, 1); - BurnLoadRom(YMZ280BROM + 0x200000, 10, 1); - - BurnLoadRom(DefaultEEPROM, 11, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - YMZ280BScan(); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - } - - if (nAction & ACB_WRITE) { - CaveRecalcPalette = 1; - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - if (!EEPROMAvailable()) EEPROMFill(DefaultEEPROM,0, 0x80); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x400000, 0x40FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x500000, 0x507FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x600000, 0x607FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2] + 0x4000, 0x700000, 0x703FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2] + 0x4000, 0x704000, 0x707FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2] + 0x4000, 0x708000, 0x70BFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2] + 0x4000, 0x70C000, 0x70FFFF, MAP_RAM); - - SekMapMemory(CavePalSrc, 0xC00000, 0xC0FFFF, MAP_ROM); // Palette RAM (write goes through handler) - SekMapHandler(1, 0xC00000, 0xC0FFFF, MAP_WRITE); // - - SekSetReadWordHandler(0, ddonpachReadWord); - SekSetReadByteHandler(0, ddonpachReadByte); - SekSetWriteWordHandler(0, ddonpachWriteWord); - SekSetWriteByteHandler(0, ddonpachWriteByte); - - SekSetWriteWordHandler(1, ddonpachWriteWordPalette); - SekSetWriteByteHandler(1, ddonpachWriteBytePalette); - - SekClose(); - } - - nCaveRowModeOffset = 1; - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(0, 0x1000000); - CaveTileInitLayer(0, 0x400000, 8, 0x4000); - CaveTileInitLayer(1, 0x400000, 8, 0x4000); - CaveTileInitLayer(2, 0x200000, 8, 0x4000); - - YMZ280BInit(16934400, &TriggerSoundIRQ, 0x400000); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo ddonpachRomDesc[] = { - { "b1.u27", 0x080000, 0xb5cdc8d3, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "b2.u26", 0x080000, 0x6bbb063a, BRF_ESS | BRF_PRG }, // 1 - - { "u50.bin", 0x200000, 0x14b260ec, BRF_GRA }, // 2 Sprite data - { "u51.bin", 0x200000, 0xe7ba8cce, BRF_GRA }, // 3 - { "u52.bin", 0x200000, 0x02492ee0, BRF_GRA }, // 4 - { "u53.bin", 0x200000, 0xcb4c10f0, BRF_GRA }, // 5 - - { "u60.bin", 0x200000, 0x903096a7, BRF_GRA }, // 6 Layer 0 Tile data - { "u61.bin", 0x200000, 0xd89b7631, BRF_GRA }, // 7 Layer 1 Tile data - { "u62.bin", 0x200000, 0x292bfb6b, BRF_GRA }, // 8 Layer 2 Tile data - - { "u6.bin", 0x200000, 0x9dfdafaf, BRF_SND }, // 9 YMZ280B (AD)PCM data - { "u7.bin", 0x200000, 0x795b17d5, BRF_SND }, // 10 - - { "eeprom-ddonpach.bin", 0x0080, 0x315fb546, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(ddonpach) -STD_ROM_FN(ddonpach) - - -// Rom information -static struct BurnRomInfo ddonpachjRomDesc[] = { - { "u27.bin", 0x080000, 0x2432ff9b, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "u26.bin", 0x080000, 0x4f3a914a, BRF_ESS | BRF_PRG }, // 1 - - { "u50.bin", 0x200000, 0x14b260ec, BRF_GRA }, // 2 Sprite data - { "u51.bin", 0x200000, 0xe7ba8cce, BRF_GRA }, // 3 - { "u52.bin", 0x200000, 0x02492ee0, BRF_GRA }, // 4 - { "u53.bin", 0x200000, 0xcb4c10f0, BRF_GRA }, // 5 - - { "u60.bin", 0x200000, 0x903096a7, BRF_GRA }, // 6 Layer 0 Tile data - { "u61.bin", 0x200000, 0xd89b7631, BRF_GRA }, // 7 Layer 1 Tile data - { "u62.bin", 0x200000, 0x292bfb6b, BRF_GRA }, // 8 Layer 2 Tile data - - { "u6.bin", 0x200000, 0x9dfdafaf, BRF_SND }, // 9 YMZ280B (AD)PCM data - { "u7.bin", 0x200000, 0x795b17d5, BRF_SND }, // 10 - - { "eeprom-ddonpach.bin", 0x0080, 0x315fb546, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(ddonpachj) -STD_ROM_FN(ddonpachj) - - -static struct BurnRomInfo ddonpachaRomDesc[] = { - { "arrange_u27.bin", 0x080000, 0x44b899ae, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "arrange_u26.bin", 0x080000, 0x727a09a8, BRF_ESS | BRF_PRG }, // 1 - - { "u50.bin", 0x200000, 0x14b260ec, BRF_GRA }, // 2 Sprite data - { "arrange_u51.bin", 0x200000, 0x0f3e5148, BRF_GRA }, // 3 - { "u52.bin", 0x200000, 0x02492ee0, BRF_GRA }, // 4 - { "u53.bin", 0x200000, 0xcb4c10f0, BRF_GRA }, // 5 - - { "u60.bin", 0x200000, 0x903096a7, BRF_GRA }, // 6 Layer 0 Tile data - { "u61.bin", 0x200000, 0xd89b7631, BRF_GRA }, // 7 Layer 1 Tile data - { "arrange_u62.bin", 0x200000, 0x42e4c6c5, BRF_GRA }, // 8 Layer 2 Tile data - - { "u6.bin", 0x200000, 0x9dfdafaf, BRF_SND }, // 9 YMZ280B (AD)PCM data - { "u7.bin", 0x200000, 0x795b17d5, BRF_SND }, // 10 - - { "eeprom-ddonpach.bin", 0x0080, 0x2df16438, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(ddonpacha) -STD_ROM_FN(ddonpacha) - - -struct BurnDriver BurnDrvDoDonpachi = { - "ddonpach", NULL, NULL, NULL, "1997", - "DoDonPachi (International, master ver. 97/02/05)\0", NULL, "Atlus / Cave", "Cave", - L"\u6012\u9996\u9818\u8702 DoDonPachi (International, master ver. 97/02/05)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, ddonpachRomInfo, ddonpachRomName, NULL, NULL, ddonpachInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDoDonpachiJ = { - "ddonpachj", "ddonpach", NULL, NULL, "1997", - "DoDonPachi (Japan, master ver. 97/02/05)\0", NULL, "Atlus / Cave", "Cave", - L"\u6012\u9996\u9818\u8702 DoDonPachi (Japan, master ver. 97/02/05)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, ddonpachjRomInfo, ddonpachjRomName, NULL, NULL, ddonpachInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDoDonpachia = { - "ddonpacha", "ddonpach", NULL, NULL, "2012", - "DoDonPachi (Arrange Mode version 1.1, hack by Trap15)\0", NULL, "hack / Trap15", "Cave", - L"\u6012\u9996\u9818\u8702 DoDonPachi (Arrange Mode version 1.1, hack by Trap15)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, ddonpachaRomInfo, ddonpachaRomName, NULL, NULL, ddonpachInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/cave/d_donpachi.cpp b/jan/src/burn/drv/cave/d_donpachi.cpp deleted file mode 100644 index cfb99f910..000000000 --- a/jan/src/burn/drv/cave/d_donpachi.cpp +++ /dev/null @@ -1,875 +0,0 @@ -// Donpachi -#include "cave.h" -#include "msm6295.h" -#include "nmk112.h" - -#define USE_SAMPLE_HACK // allow use of high quality music samples. - -#define CAVE_VBLANK_LINES 12 - -#ifdef USE_SAMPLE_HACK -#include "samples.h" -#endif - -static UINT8 DrvJoy1[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; -static UINT8 DrvDips[1]; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01; -static UINT8 *DefaultEEPROM = NULL; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static UINT8 bHasSamples = 0; -static UINT8 bLastSampleDIPMode = 0; - -#ifdef USE_SAMPLE_HACK -static UINT8 previous_sound_write[3] = { 0, 0, 0 }; -#endif - -static struct BurnInputInfo donpachiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(donpachi) - -static struct BurnDIPInfo donpachiDIPList[]= -{ - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Enable high-quality music w/samples"}, - {0x15, 0x01, 0x08, 0x08, "On" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, -}; - -STDDIPINFO(donpachi) - -static void DrvSampleReset() -{ - BurnSampleReset(); - // don't autoplay everything @ reset w/ SAMPLE_AUTOLOOP - for (INT32 i = 0;i < 20; i++){ - BurnSampleStop(i); - } -} - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall donpachiReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x900000: - case 0x900001: - case 0x900002: - case 0x900003: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x900004: - case 0x900005: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x900006: - case 0x900007: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xB00001: - return MSM6295ReadStatus(0); - case 0xB00011: - return MSM6295ReadStatus(1); - - case 0xC00000: - return (DrvInput[0] >> 8) ^ 0xFF; - case 0xC00001: - return (DrvInput[0] & 0xFF) ^ 0xFF; - case 0xC00002: - return ((DrvInput[1] >> 8) ^ 0xF7) | (EEPROMRead() << 3); - case 0xC00003: - return (DrvInput[1] & 0xFF) ^ 0xFF; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -UINT16 __fastcall donpachiReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x900000: - case 0x900002: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - - case 0x900004: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x900006: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xB00000: - return MSM6295ReadStatus(0); - case 0xB00010: - return MSM6295ReadStatus(1); - - case 0xC00000: - return DrvInput[0] ^ 0xFFFF; - case 0xC00002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall donpachiWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - case 0xB00000: - case 0xB00001: - case 0xB00002: - case 0xB00003: - MSM6295Command(0, byteValue); - break; - case 0xB00010: - case 0xB00011: - case 0xB00012: - case 0xB00013: - MSM6295Command(1, byteValue); - break; - - case 0xB00020: - case 0xB00021: - case 0xB00022: - case 0xB00023: - case 0xB00024: - case 0xB00025: - case 0xB00026: - case 0xB00027: - case 0xB00028: - case 0xB00029: - case 0xB0002A: - case 0xB0002B: - case 0xB0002C: - case 0xB0002D: - case 0xB0002E: - case 0xB0002F: { - NMK112_okibank_write((sekAddress / 2) & 0x07, byteValue); - break; - } - - case 0xD00000: - EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall donpachiWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x600000: - CaveTileReg[1][0] = wordValue; - break; - case 0x600002: - CaveTileReg[1][1] = wordValue; - break; - case 0x600004: - CaveTileReg[1][2] = wordValue; - break; - - case 0x700000: - CaveTileReg[0][0] = wordValue; - break; - case 0x700002: - CaveTileReg[0][1] = wordValue; - break; - case 0x700004: - CaveTileReg[0][2] = wordValue; - break; - - case 0x800000: - CaveTileReg[2][0] = wordValue; - break; - case 0x800002: - CaveTileReg[2][1] = wordValue; - break; - case 0x800004: - CaveTileReg[2][2] = wordValue; - break; - - case 0x900000: - nCaveXOffset = wordValue; - return; - case 0x900002: - nCaveYOffset = wordValue; - return; - case 0x900008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0xB00000: - case 0xB00002: -#ifdef USE_SAMPLE_HACK - if (wordValue == 0x78) { - memset (previous_sound_write, 0, 3); - DrvSampleReset(); // STOP - } else { - previous_sound_write[0] = previous_sound_write[1]; - previous_sound_write[1] = previous_sound_write[2]; - previous_sound_write[2] = wordValue; - - if (previous_sound_write[0] == 0x08) { - UINT16 select = (previous_sound_write[1]*256) + previous_sound_write[2]; - INT32 sample = 0xff; - switch (select) - { - - // I'm silencing all sounds from the music chip atm, it may be necessary to let some of - // these actually play. Just set use BurnSampleReset, and restore the volume of the music chip. - - case 0xcc12: sample = 0x00; break; - case 0x8112: sample = 0x01; break; - case 0x9814: sample = 0x02; break; - case 0xb113: sample = 0x03; break; - case 0xa112: sample = 0x04; break; - case 0xd812: sample = 0x05; break; - case 0x9313: sample = 0x06; break; - case 0xe813: sample = 0x07; break; - case 0xf013: sample = 0x08; break; - case 0xf111: sample = 0x09; break; - case 0x9a13: sample = 0x0a; break; - case 0xf813: sample = 0x0b; break; - case 0xd013: sample = 0x0c; break; - case 0xc813: sample = 0x0d; break; - } - - if (sample != 0xff && BurnSampleGetStatus(sample) == 0) { - DrvSampleReset(); - BurnSamplePlay(sample); -// bprintf (0, _T("Sample playing: %d\n"), sample); - } - } - } -#endif - MSM6295Command(0, wordValue); - break; - case 0xB00010: - case 0xB00012: - MSM6295Command(1, wordValue); - break; - - case 0xB00020: - case 0xB00021: - case 0xB00022: - case 0xB00023: - case 0xB00024: - case 0xB00025: - case 0xB00026: - case 0xB00027: - case 0xB00028: - case 0xB00029: - case 0xB0002A: - case 0xB0002B: - case 0xB0002C: - case 0xB0002D: - case 0xB0002E: - case 0xB0002F: { - NMK112_okibank_write((sekAddress / 2) & 0x07, wordValue & 0xff); - break; - } - - case 0xD00000: - wordValue >>= 8; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - } - } -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - MSM6295Exit(0); - MSM6295Exit(1); -#ifdef USE_SAMPLE_HACK - BurnSampleExit(); -#endif - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - MSM6295Reset(0); - MSM6295Reset(1); - NMK112Reset(); -#ifdef USE_SAMPLE_HACK - DrvSampleReset(); - memset (previous_sound_write, 0, 3); -#endif - HiscoreReset(); - return 0; -} - -static INT32 DrvDraw() -{ - CavePalUpdate4Bit(0, 128); // Update the palette - CaveClearScreen(CavePalette[0x7F00]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -static void CheckDIP() -{ - if (bHasSamples && bLastSampleDIPMode != DrvDips[0]) { - //bprintf(0, _T("DIP Changed! %X\n"), DrvDips[0]); - bLastSampleDIPMode = DrvDips[0]; - - MSM6295SetRoute(0, (bLastSampleDIPMode == 8) ? 0.00 : 1.60, BURN_SND_ROUTE_BOTH); - BurnSampleSetAllRoutesAllSamples((bLastSampleDIPMode == 8) ? 0.40 : 0.00, BURN_SND_ROUTE_BOTH); - } - -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - - INT32 nCyclesTotal[2]; - INT32 nCyclesDone[2]; - - INT32 nCyclesSegment; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - CheckDIP(); - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 10; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesDone[0] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - SekOpen(0); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nCurrentCPU = 0; - INT32 nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Run 68000 - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - // Make sure the buffer is entirely filled. - { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); -#ifdef USE_SAMPLE_HACK - BurnSampleRender(pSoundBuf, nSegmentLength); -#endif - } - } - } - - SekClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // 68K program - CaveSpriteROM = Next; Next += 0x800000; - CaveTileROM[0] = Next; Next += 0x200000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x200000; // Tile layer 1 - CaveTileROM[2] = Next; Next += 0x080000; // Tile layer 2 - MSM6295ROM = Next; Next += 0x300000; - DefaultEEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveTileRAM[2] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x001000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap2(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[1] = *pOrg & 15; - pDest[0] = *pOrg >> 4; - } - - return; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - BurnLoadRom(CaveSpriteROM + 0x000000, 1, 1); - BurnLoadRom(CaveSpriteROM + 0x200000, 2, 1); - BurnByteswap(CaveSpriteROM, 0x400000); - NibbleSwap2(CaveSpriteROM, 0x400000); - - BurnLoadRom(CaveTileROM[0], 3, 1); - NibbleSwap2(CaveTileROM[0], 0x100000); - BurnLoadRom(CaveTileROM[1], 4, 1); - NibbleSwap2(CaveTileROM[1], 0x100000); - BurnLoadRom(CaveTileROM[2], 5, 1); - NibbleSwap2(CaveTileROM[2], 0x040000); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROM + 0x000000, 6, 1); // OKI #1 ONLY - BurnLoadRom(MSM6295ROM + 0x100000, 7, 1); // OKI #0 & #1 - - BurnLoadRom(DefaultEEPROM, 8, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - NMK112_Scan(nAction); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); -#ifdef USE_SAMPLE_HACK - BurnSampleScan(nAction, pnMin); // Must be at the end to maintain compatibility between sample and non-sample mode. -#endif - } - - if (nAction & ACB_WRITE) { - CaveRecalcPalette = 1; - bLastSampleDIPMode = 0xf7; - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - if (!EEPROMAvailable()) EEPROMFill(DefaultEEPROM,0, 0x80); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x200000, 0x207FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x300000, 0x307FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2] + 0x4000, 0x400000, 0x403FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2] + 0x4000, 0x404000, 0x407FFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x500000, 0x50FFFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0xA08000, 0xA08FFF, MAP_RAM); // Palette RAM - - SekSetReadWordHandler(0, donpachiReadWord); - SekSetReadByteHandler(0, donpachiReadByte); - SekSetWriteWordHandler(0, donpachiWriteWord); - SekSetWriteByteHandler(0, donpachiWriteByte); - - SekClose(); - } - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(0, 0x0800000); - CaveTileInitLayer(0, 0x200000, 8, 0x4000); - CaveTileInitLayer(1, 0x200000, 8, 0x4000); - CaveTileInitLayer(2, 0x080000, 8, 0x4000); - - MSM6295Init(0, 8000, 0); - MSM6295Init(1, 16000, 0); -#ifdef USE_SAMPLE_HACK - MSM6295SetRoute(0, 0.00, BURN_SND_ROUTE_BOTH); -#else - MSM6295SetRoute(0, 1.60, BURN_SND_ROUTE_BOTH); -#endif - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - NMK112_init(1 << 0, MSM6295ROM + 0x100000, MSM6295ROM, 0x200000, 0x300000); - - -#ifdef USE_SAMPLE_HACK - BurnUpdateProgress(0.0, _T("Loading samples..."), 0); - bBurnSampleTrimSampleEnd = 1; - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.40, BURN_SND_ROUTE_BOTH); - bHasSamples = BurnSampleGetStatus(0) != -1; - bLastSampleDIPMode = DrvDips[0]; - - if (!(bLastSampleDIPMode == 8) || !bHasSamples) { // Samples not found, fallback to internal samples. - MSM6295SetRoute(0, 1.60, BURN_SND_ROUTE_BOTH); - BurnSampleSetAllRoutesAllSamples(0.00, BURN_SND_ROUTE_BOTH); - } -#endif - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo donpachiRomDesc[] = { - { "prgu.u29", 0x080000, 0x89C36802, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "atdp.u44", 0x200000, 0x7189E953, BRF_GRA }, // 1 Sprite data - { "atdp.u45", 0x200000, 0x6984173F, BRF_GRA }, // 2 - - { "atdp.u54", 0x100000, 0x6BDA6B66, BRF_GRA }, // 3 Layer 0 Tile data - { "atdp.u57", 0x100000, 0x0A0E72B9, BRF_GRA }, // 4 Layer 1 Tile data - { "text.u58", 0x040000, 0x5DBA06E7, BRF_GRA }, // 5 Layer 2 Tile data - - { "atdp.u32", 0x100000, 0x0D89FCCA, BRF_SND }, // 6 MSM6295 #1 ADPCM data - { "atdp.u33", 0x200000, 0xD749DE00, BRF_SND }, // 7 MSM6295 #0/1 ADPCM data - - { "eeprom-donpachi.u10", 0x0080, 0x315fb546, BRF_ESS | BRF_PRG }, - - { "peel18cv8p-15.u18", 0x0155, 0x3f4787e9, BRF_OPT }, -}; - - -STD_ROM_PICK(donpachi) -STD_ROM_FN(donpachi) - -static struct BurnRomInfo donpachijRomDesc[] = { - { "prg.u29", 0x080000, 0x6BE14AF6, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "atdp.u44", 0x200000, 0x7189E953, BRF_GRA }, // 1 Sprite data - { "atdp.u45", 0x200000, 0x6984173F, BRF_GRA }, // 2 - - { "atdp.u54", 0x100000, 0x6BDA6B66, BRF_GRA }, // 3 Layer 0 Tile data - { "atdp.u57", 0x100000, 0x0A0E72B9, BRF_GRA }, // 4 Layer 1 Tile data - { "u58.bin", 0x040000, 0x285379FF, BRF_GRA }, // 5 Layer 2 Tile data - - { "atdp.u32", 0x100000, 0x0D89FCCA, BRF_SND }, // 6 MSM6295 #1 ADPCM data - { "atdp.u33", 0x200000, 0xD749DE00, BRF_SND }, // 7 MSM6295 #0/1 ADPCM data - - { "eeprom-donpachi.bin", 0x0080, 0x315fb546, BRF_ESS | BRF_PRG }, - - { "peel18cv8p-15.u18", 0x0155, 0x3f4787e9, BRF_OPT }, -}; - - -STD_ROM_PICK(donpachij) -STD_ROM_FN(donpachij) - -static struct BurnRomInfo donpachikrRomDesc[] = { - { "prgk.u26", 0x080000, 0xBBAF4C8B, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "atdp.u44", 0x200000, 0x7189E953, BRF_GRA }, // 1 Sprite data - { "atdp.u45", 0x200000, 0x6984173F, BRF_GRA }, // 2 - - { "atdp.u54", 0x100000, 0x6BDA6B66, BRF_GRA }, // 3 Layer 0 Tile data - { "atdp.u57", 0x100000, 0x0A0E72B9, BRF_GRA }, // 4 Layer 1 Tile data - { "u58.bin", 0x040000, 0x285379FF, BRF_GRA }, // 5 Layer 2 Tile data - - { "atdp.u32", 0x100000, 0x0D89FCCA, BRF_SND }, // 6 MSM6295 #1 ADPCM data - { "atdp.u33", 0x200000, 0xD749DE00, BRF_SND }, // 7 MSM6295 #0/1 ADPCM data - - { "eeprom-donpachi.bin", 0x0080, 0x315fb546, BRF_ESS | BRF_PRG }, - - { "peel18cv8p-15.u18", 0x0155, 0x3f4787e9, BRF_OPT }, -}; - - -STD_ROM_PICK(donpachikr) -STD_ROM_FN(donpachikr) - -static struct BurnRomInfo donpachihkRomDesc[] = { - { "37.u29", 0x080000, 0x71f39f30, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "atdp.u44", 0x200000, 0x7189E953, BRF_GRA }, // 1 Sprite data - { "atdp.u45", 0x200000, 0x6984173F, BRF_GRA }, // 2 - - { "atdp.u54", 0x100000, 0x6BDA6B66, BRF_GRA }, // 3 Layer 0 Tile data - { "atdp.u57", 0x100000, 0x0A0E72B9, BRF_GRA }, // 4 Layer 1 Tile data - { "u58.bin", 0x040000, 0x285379ff, BRF_GRA }, // 5 Layer 2 Tile data - - { "atdp.u32", 0x100000, 0x0D89FCCA, BRF_SND }, // 6 MSM6295 #1 ADPCM data - { "atdp.u33", 0x200000, 0xD749DE00, BRF_SND }, // 7 MSM6295 #0/1 ADPCM data - - { "eeprom-donpachi.bin", 0x0080, 0x315fb546, BRF_ESS | BRF_PRG }, - - { "peel18cv8p-15.u18", 0x0155, 0x3f4787e9, BRF_OPT }, -}; - -STD_ROM_PICK(donpachihk) -STD_ROM_FN(donpachihk) - -static struct BurnSampleInfo DonpachiSampleDesc[] = { -#ifdef USE_SAMPLE_HACK -#if !defined ROM_VERIFY - { "02 - Sortie Instruction", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "03 - Silent Outpost Base", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "04 - Gale Force", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "05 - God of Destruction", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "06 - Advance Through the Sky", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "07 - The Battle Intensifies", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "08 - An Equal Match", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "09 - It's All Up To Me!!", SAMPLE_NOLOOP | SAMPLE_NOSTORE }, - { "10 - Chief's Congratulations", SAMPLE_NOLOOP | SAMPLE_NOSTORE }, - { "11 - Breakthrough", SAMPLE_NOLOOP | SAMPLE_NOSTORE }, - { "12 - Pressure", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "13 - My Duty is Done", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "14 - Eternal Soldier", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, - { "15 - Chase in the Dark", SAMPLE_AUTOLOOP | SAMPLE_NOSTORE }, -#endif -#endif - { "", 0 } -}; - -STD_SAMPLE_PICK(Donpachi) -STD_SAMPLE_FN(Donpachi) - -struct BurnDriver BurnDrvDonpachi = { - "donpachi", NULL, NULL, "donpachi", "1995", - "DonPachi (USA, ver. 1.12, 95/05/2x)\0", NULL, "Atlus / Cave", "Cave", - L"\u9996\u9818\u8702 DonPachi (USA, ver. 1.12, 95/05/2x)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY | HARDWARE_CAVE_M6295, GBF_VERSHOOT, 0, - NULL, donpachiRomInfo, donpachiRomName, DonpachiSampleInfo, DonpachiSampleName, donpachiInputInfo, donpachiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDonpachij = { - "donpachij", "donpachi", NULL, "donpachi", "1995", - "DonPachi (Japan, ver. 1.01, 95/05/11)\0", NULL, "Atlus / Cave", "Cave", - L"\u9996\u9818\u8702 DonPachi (Japan, ver. 1.01, 95/05/11)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY | HARDWARE_CAVE_M6295, GBF_VERSHOOT, 0, - NULL, donpachijRomInfo, donpachijRomName, DonpachiSampleInfo, DonpachiSampleName, donpachiInputInfo, donpachiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDonpachikr = { - "donpachikr", "donpachi", NULL, "donpachi", "1995", - "DonPachi (Korea, ver. 1.12, 95/05/2x)\0", NULL, "Atlus / Cave", "Cave", - L"\u9996\u9818\u8702 DonPachi (Korea, ver. 1.12, 95/05/2x)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY | HARDWARE_CAVE_M6295, GBF_VERSHOOT, 0, - NULL, donpachikrRomInfo, donpachikrRomName, DonpachiSampleInfo, DonpachiSampleName, donpachiInputInfo, donpachiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDonpachihk = { - "donpachihk", "donpachi", NULL, "donpachi", "1995", - "DonPachi (Hong Kong, ver. 1.10, 95/05/17)\0", NULL, "Atlus / Cave", "Cave", - L"\u9996\u9818\u8702 DonPachi (Hong Kong, ver. 1.10, 95/05/17)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY | HARDWARE_CAVE_M6295, GBF_VERSHOOT, 0, - NULL, donpachihkRomInfo, donpachihkRomName, DonpachiSampleInfo, DonpachiSampleName, donpachiInputInfo, donpachiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/cave/d_esprade.cpp b/jan/src/burn/drv/cave/d_esprade.cpp deleted file mode 100644 index baa8f4464..000000000 --- a/jan/src/burn/drv/cave/d_esprade.cpp +++ /dev/null @@ -1,719 +0,0 @@ -// E.S.P. Ra De -#include "cave.h" -#include "ymz280b.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; -static UINT8 DrvDips[1]; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01; -static UINT8 *DefaultEEPROM = NULL; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCurrentCPU; -static INT32 nCyclesDone[2]; -static INT32 nCyclesTotal[2]; -static INT32 nCyclesSegment; -static INT32 nCyclesExtra; - -static struct BurnInputInfo espradeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(esprade) - -static struct BurnDIPInfo espradeDIPList[]= -{ - {0x15, 0xff, 0xff, 0x08, NULL }, - - {0 , 0xfe, 0 , 2, "Virtual Mixer (ymz280b)"}, - {0x15, 0x01, 0x08, 0x08, "On" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, -}; - -STDDIPINFO(esprade) - - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall espradeReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300003: { - return YMZ280BReadStatus(); - } - - case 0x800000: - case 0x800001: - case 0x800002: - case 0x800003: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x800004: - case 0x800005: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x800006: - case 0x800007: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xD00000: - return (DrvInput[0] >> 8) ^ 0xFF; - case 0xD00001: - return (DrvInput[0] & 0xFF) ^ 0xFF; - case 0xD00002: - return ((DrvInput[1] >> 8) ^ 0xF7) | (EEPROMRead() << 3); - case 0xD00003: - return (DrvInput[1] & 0xFF) ^ 0xFF; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -UINT16 __fastcall espradeReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300002: { - return YMZ280BReadStatus(); - } - - case 0x800000: - case 0x800002: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - - case 0x800004: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x800006: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xD00000: - return DrvInput[0] ^ 0xFFFF; - case 0xD00002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall espradeWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x300001: - YMZ280BSelectRegister(byteValue); - break; - case 0x300003: - YMZ280BWriteRegister(byteValue); - break; - - case 0xE00000: - EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall espradeWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x300000: - YMZ280BSelectRegister(wordValue); - break; - case 0x300002: - YMZ280BWriteRegister(wordValue); - break; - - case 0x800000: - nCaveXOffset = wordValue; - return; - case 0x800002: - nCaveYOffset = wordValue; - return; - case 0x800008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0x900000: - CaveTileReg[0][0] = wordValue; - break; - case 0x900002: - CaveTileReg[0][1] = wordValue; - break; - case 0x900004: - CaveTileReg[0][2] = wordValue; - break; - - case 0xA00000: - CaveTileReg[1][0] = wordValue; - break; - case 0xA00002: - CaveTileReg[1][1] = wordValue; - break; - case 0xA00004: - CaveTileReg[1][2] = wordValue; - break; - - case 0xB00000: - CaveTileReg[2][0] = wordValue; - break; - case 0xB00002: - CaveTileReg[2][1] = wordValue; - break; - case 0xB00004: - CaveTileReg[2][2] = wordValue; - break; - - case 0xE00000: - wordValue >>= 8; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - } - } -} - -void __fastcall espradeWriteBytePalette(UINT32 sekAddress, UINT8 byteValue) -{ - CavePalWriteByte(sekAddress & 0xFFFF, byteValue); -} - -void __fastcall espradeWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - CavePalWriteWord(sekAddress & 0xFFFF, wordValue); -} - -static void TriggerSoundIRQ(INT32 nStatus) -{ - nSoundIRQ = nStatus ^ 1; - UpdateIRQStatus(); - - if (nIRQPending && nCurrentCPU != 0) { - nCyclesDone[0] += SekRun(0x0400); - } -} - -static INT32 DrvExit() -{ - YMZ280BExit(); - bESPRaDeMixerKludge = false; - - EEPROMExit(); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - YMZ280BReset(); - - nCyclesExtra = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - CavePalUpdate8Bit(0, 128); // Update the palette - CaveClearScreen(CavePalette[0x0000]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 10; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - bESPRaDeMixerKludge = (DrvDips[0] == 8); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesDone[0] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - SekOpen(0); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nNext; - - // Render sound segment - if ((i & 1) == 0) { - if (pBurnSoundOut) { - INT32 nSegmentEnd = nBurnSoundLen * i / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - YMZ280BRender(pSoundBuf, nSegmentEnd - nSoundBufferPos); - nSoundBufferPos = nSegmentEnd; - } - } - - // Run 68000 - nCurrentCPU = 0; - nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment+nCyclesExtra); - nCyclesExtra = 0; - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - nCurrentCPU = -1; - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - YMZ280BRender(pSoundBuf, nSegmentLength); - } - } - } - - nCyclesExtra = SekTotalCycles() - nCyclesTotal[0]; - SekClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // 68K program - CaveSpriteROM = Next; Next += 0x1000000; - CaveTileROM[0] = Next; Next += 0x800000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x800000; // Tile layer 1 - CaveTileROM[2] = Next; Next += 0x400000; // Tile layer 2 - YMZ280BROM = Next; Next += 0x400000; - DefaultEEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveTileRAM[2] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x010000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap3(UINT8* pData, INT32 nLen) -{ - for (INT32 i = 0; i < nLen; i++, pData += 2) { - UINT8 n1 = pData[0]; - UINT8 n2 = pData[1]; - - pData[0] = (n1 << 4) | (n2 & 0x0F); - pData[1] = (n1 & 0xF0) | (n2 >> 4); - } - - return; -} - -static void NibbleSwap4(UINT8* pData, INT32 nLen) -{ - for (INT32 i = 0; i < nLen; i++, pData += 2) { - UINT8 n1 = pData[0]; - UINT8 n2 = pData[1]; - - pData[1] = (n2 << 4) | (n1 & 0x0F); - pData[0] = (n2 & 0xF0) | (n1 >> 4); - } - - return; -} - - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01 + 0, 1, 2); - BurnLoadRom(Rom01 + 1, 0, 2); - - BurnLoadRom(CaveSpriteROM + 0x000000, 2, 2); - BurnLoadRom(CaveSpriteROM + 0x000001, 3, 2); - BurnLoadRom(CaveSpriteROM + 0x800000, 4, 2); - BurnLoadRom(CaveSpriteROM + 0x800001, 5, 2); - NibbleSwap3(CaveSpriteROM, 0x800000); - - BurnLoadRom(CaveTileROM[0] + 0x000000, 6, 1); - BurnLoadRom(CaveTileROM[0] + 0x400000, 7, 1); - NibbleSwap4(CaveTileROM[0], 0x400000); - BurnLoadRom(CaveTileROM[1] + 0x000000, 8, 1); - BurnLoadRom(CaveTileROM[1] + 0x400000, 9, 1); - NibbleSwap4(CaveTileROM[1], 0x400000); - BurnLoadRom(CaveTileROM[2] + 0x000000, 10, 1); - NibbleSwap4(CaveTileROM[2], 0x200000); - - // Load YMZ280B data - BurnLoadRom(YMZ280BROM, 11, 1); - - BurnLoadRom(DefaultEEPROM, 12, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - YMZ280BScan(); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - } - - if (nAction & ACB_WRITE) { - CaveRecalcPalette = 1; - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - if (!EEPROMAvailable()) EEPROMFill(DefaultEEPROM,0, 0x80); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x400000, 0x40FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x500000, 0x507FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x600000, 0x607FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2], 0x700000, 0x707FFF, MAP_RAM); - - SekMapMemory(CavePalSrc, 0xC00000, 0xC0FFFF, MAP_ROM); // Palette RAM (write goes through handler) - SekMapHandler(1, 0xC00000, 0xC0FFFF, MAP_WRITE); // - - SekSetReadWordHandler(0, espradeReadWord); - SekSetReadByteHandler(0, espradeReadByte); - SekSetWriteWordHandler(0, espradeWriteWord); - SekSetWriteByteHandler(0, espradeWriteByte); - - SekSetWriteWordHandler(1, espradeWriteWordPalette); - SekSetWriteByteHandler(1, espradeWriteBytePalette); - - SekClose(); - } - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(1, 0x1000000); - CaveTileInitLayer(0, 0x800000, 8, 0x4000); - CaveTileInitLayer(1, 0x800000, 8, 0x4000); - CaveTileInitLayer(2, 0x400000, 8, 0x4000); - - YMZ280BInit(16934400, &TriggerSoundIRQ, 0x400000); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - bESPRaDeMixerKludge = true; - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo espradeRomDesc[] = { - { "u42.int", 0x080000, 0x3B510A73, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "u41.int", 0x080000, 0x97C1B649, BRF_ESS | BRF_PRG }, // 1 - - { "esp_u63.u63", 0x400000, 0x2F2FE92C, BRF_GRA }, // 2 Sprite data - { "esp_u64.u64", 0x400000, 0x491A3DA4, BRF_GRA }, // 3 - { "esp_u65.u65", 0x400000, 0x06563EFE, BRF_GRA }, // 4 - { "esp_u66.u66", 0x400000, 0x7BBE4CFC, BRF_GRA }, // 5 - - { "esp_u54.u54", 0x400000, 0xE7CA6936, BRF_GRA }, // 6 Layer 0 Tile data - { "esp_u55.u55", 0x400000, 0xF53BD94F, BRF_GRA }, // 7 - { "esp_u52.u52", 0x400000, 0xE7ABE7B4, BRF_GRA }, // 8 Layer 1 Tile data - { "esp_u53.u53", 0x400000, 0x51A0F391, BRF_GRA }, // 9 - { "esp_u51.u51", 0x400000, 0x0B9B875C, BRF_GRA }, // 10 Layer 2 Tile data - - { "esp_u19.u19", 0x400000, 0xF54B1CAB, BRF_SND }, // 11 YMZ280B (AD)PCM data - - { "eeprom-esprade.bin", 0x0080, 0x315fb546, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(esprade) -STD_ROM_FN(esprade) - -static struct BurnRomInfo espradejRomDesc[] = { - { "u42_ver.2", 0x080000, 0x75D03C42, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "u41_ver.2", 0x080000, 0x734B3EF0, BRF_ESS | BRF_PRG }, // 1 - - { "esp_u63.u63", 0x400000, 0x2F2FE92C, BRF_GRA }, // 2 Sprite data - { "esp_u64.u64", 0x400000, 0x491A3DA4, BRF_GRA }, // 3 - { "esp_u65.u65", 0x400000, 0x06563EFE, BRF_GRA }, // 4 - { "esp_u66.u66", 0x400000, 0x7BBE4CFC, BRF_GRA }, // 5 - - { "esp_u54.u54", 0x400000, 0xE7CA6936, BRF_GRA }, // 6 Layer 0 Tile data - { "esp_u55.u55", 0x400000, 0xF53BD94F, BRF_GRA }, // 7 - { "esp_u52.u52", 0x400000, 0xE7ABE7B4, BRF_GRA }, // 8 Layer 1 Tile data - { "esp_u53.u53", 0x400000, 0x51A0F391, BRF_GRA }, // 9 - { "esp_u51.u51", 0x400000, 0x0B9B875C, BRF_GRA }, // 10 Layer 2 Tile data - - { "esp_u19.u19", 0x400000, 0xF54B1CAB, BRF_SND }, // 11 YMZ280B (AD)PCM data - - { "eeprom-esprade.bin", 0x0080, 0x315fb546, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(espradej) -STD_ROM_FN(espradej) - -static struct BurnRomInfo espradejoRomDesc[] = { - { "u42.bin", 0x080000, 0x0718C7E5, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "u41.bin", 0x080000, 0xDEF30539, BRF_ESS | BRF_PRG }, // 1 - - { "esp_u63.u63", 0x400000, 0x2F2FE92C, BRF_GRA }, // 2 Sprite data - { "esp_u64.u64", 0x400000, 0x491A3DA4, BRF_GRA }, // 3 - { "esp_u65.u65", 0x400000, 0x06563EFE, BRF_GRA }, // 4 - { "esp_u66.u66", 0x400000, 0x7BBE4CFC, BRF_GRA }, // 5 - - { "esp_u54.u54", 0x400000, 0xE7CA6936, BRF_GRA }, // 6 Layer 0 Tile data - { "esp_u55.u55", 0x400000, 0xF53BD94F, BRF_GRA }, // 7 - { "esp_u52.u52", 0x400000, 0xE7ABE7B4, BRF_GRA }, // 8 Layer 1 Tile data - { "esp_u53.u53", 0x400000, 0x51A0F391, BRF_GRA }, // 9 - { "esp_u51.u51", 0x400000, 0x0B9B875C, BRF_GRA }, // 10 Layer 2 Tile data - - { "esp_u19.u19", 0x400000, 0xF54B1CAB, BRF_SND }, // 11 YMZ280B (AD)PCM data - - { "eeprom-esprade.bin", 0x0080, 0x315fb546, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(espradejo) -STD_ROM_FN(espradejo) - -struct BurnDriver BurnDrvEsprade = { - "esprade", NULL, NULL, NULL, "1998", - "ESP Ra.De. - A.D.2018 Tokyo (International, ver. 98/04/22)\0", NULL, "Atlus / Cave", "Cave", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, espradeRomInfo, espradeRomName, NULL, NULL, espradeInputInfo, espradeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvEspradej = { - "espradej", "esprade", NULL, NULL, "1998", - "ESP Ra.De. (Japan, ver. 98/04/21)\0", NULL, "Atlus / Cave", "Cave", - L"ESP Ra.De. \u30A8\u30B9\u30D7\u30EC\u30A4\u30C9 (Japan, ver. 98/04/21)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, espradejRomInfo, espradejRomName, NULL, NULL, espradeInputInfo, espradeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvEspradejo = { - "espradejo", "esprade", NULL, NULL, "1998", - "ESP Ra.De. (Japan, ver. 98/04/14)\0", NULL, "Atlus / Cave", "Cave", - L"ESP Ra.De. \u30A8\u30B9\u30D7\u30EC\u30A4\u30C9 (Japan, ver. 98/04/14)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, espradejoRomInfo, espradejoRomName, NULL, NULL, espradeInputInfo, espradeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - diff --git a/jan/src/burn/drv/cave/d_feversos.cpp b/jan/src/burn/drv/cave/d_feversos.cpp deleted file mode 100644 index 248b6268b..000000000 --- a/jan/src/burn/drv/cave/d_feversos.cpp +++ /dev/null @@ -1,619 +0,0 @@ -// Fever SOS / Dangun Feveron -#include "cave.h" -#include "ymz280b.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *Ram02; -static UINT8 *DefaultEEPROM = NULL; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCurrentCPU; -static INT32 nCyclesDone[2]; -static INT32 nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo feversosInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, -}; - -STDINPUTINFO(feversos) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall feversosReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300003: { - return YMZ280BReadStatus(); - } - - case 0x800000: - case 0x800001: - case 0x800002: - case 0x800003: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x800004: - case 0x800005: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x800006: - case 0x800007: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xB00000: - return (DrvInput[0] >> 8) ^ 0xFF; - case 0xB00001: - return (DrvInput[0] & 0xFF) ^ 0xFF; - case 0xB00002: - return ((DrvInput[1] >> 8) ^ 0xF7) | (EEPROMRead() << 3); - case 0xB00003: - return (DrvInput[1] & 0xFF) ^ 0xFF; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -UINT16 __fastcall feversosReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300002: { - return YMZ280BReadStatus(); - } - - case 0x800000: - case 0x800002: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x800004: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x800006: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xB00000: - return DrvInput[0] ^ 0xFFFF; - case 0xB00002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall feversosWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x300001: - YMZ280BSelectRegister(byteValue); - break; - case 0x300003: - YMZ280BWriteRegister(byteValue); - break; - - case 0xC00000: - EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall feversosWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x300000: - YMZ280BSelectRegister(wordValue); - break; - case 0x300002: - YMZ280BWriteRegister(wordValue); - break; - - case 0x800000: - nCaveXOffset = wordValue; - return; - case 0x800002: - nCaveYOffset = wordValue; - return; - case 0x800008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0x900000: - CaveTileReg[0][0] = wordValue; - break; - case 0x900002: - CaveTileReg[0][1] = wordValue; - break; - case 0x900004: - CaveTileReg[0][2] = wordValue; - break; - - case 0xA00000: - CaveTileReg[1][0] = wordValue; - break; - case 0xA00002: - CaveTileReg[1][1] = wordValue; - break; - case 0xA00004: - CaveTileReg[1][2] = wordValue; - break; - - case 0xC00000: - wordValue >>= 8; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - } - } -} - -static void TriggerSoundIRQ(INT32 nStatus) -{ - nSoundIRQ = nStatus ^ 1; - UpdateIRQStatus(); - - if (nIRQPending && nCurrentCPU != 0) { - nCyclesDone[0] += SekRun(0x0400); - } -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - YMZ280BExit(); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - YMZ280BReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - CavePalUpdate4Bit(0, 128); // Update the palette - CaveClearScreen(CavePalette[0x3F00]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 10; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesDone[0] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - SekOpen(0); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nNext; - - // Render sound segment - if ((i & 1) == 0) { - if (pBurnSoundOut) { - INT32 nSegmentEnd = nBurnSoundLen * i / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - YMZ280BRender(pSoundBuf, nSegmentEnd - nSoundBufferPos); - nSoundBufferPos = nSegmentEnd; - } - } - - // Run 68000 - nCurrentCPU = 0; - nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - nCurrentCPU = -1; - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - YMZ280BRender(pSoundBuf, nSegmentLength); - } - } - } - - SekClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // 68K program - CaveSpriteROM = Next; Next += 0x1000000; - CaveTileROM[0] = Next; Next += 0x400000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x400000; // Tile layer 1 - YMZ280BROM = Next; Next += 0x400000; - DefaultEEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - Ram02 = Next; Next += 0x001000; - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x001000; // palette -// CaveVideoRegisters= Next; Next += 0x000080; - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap1(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void NibbleSwap2(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[1] = *pOrg & 15; - pDest[0] = *pOrg >> 4; - } - - return; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01 + 0, 1, 2); - BurnLoadRom(Rom01 + 1, 0, 2); - - BurnLoadRom(CaveSpriteROM + 0x000000, 2, 1); - BurnLoadRom(CaveSpriteROM + 0x400000, 3, 1); - NibbleSwap1(CaveSpriteROM, 0x800000); - - BurnLoadRom(CaveTileROM[0], 4, 1); - NibbleSwap2(CaveTileROM[0], 0x200000); - BurnLoadRom(CaveTileROM[1], 5, 1); - NibbleSwap2(CaveTileROM[1], 0x200000); - - BurnLoadRom(YMZ280BROM, 6, 1); - - BurnLoadRom(DefaultEEPROM, 7, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - YMZ280BScan(); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - } - - if (nAction & ACB_WRITE) { - CaveRecalcPalette = 1; - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - if (!EEPROMAvailable()) EEPROMFill(DefaultEEPROM,0, 0x80); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x400000, 0x40FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x500000, 0x507FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x600000, 0x607FFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0x708000, 0x708FFF, MAP_RAM); // Palette RAM - SekMapMemory(Ram02, 0x710000, 0x710BFF, MAP_ROM); - SekMapMemory(Ram02, 0x710C00, 0x710FFF, MAP_RAM); - - SekSetReadWordHandler(0, feversosReadWord); - SekSetReadByteHandler(0, feversosReadByte); - SekSetWriteWordHandler(0, feversosWriteWord); - SekSetWriteByteHandler(0, feversosWriteByte); - - SekClose(); - } - - nCaveRowModeOffset = 1; - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(1, 0x1000000); - CaveTileInitLayer(0, 0x400000, 8, 0x4000); - CaveTileInitLayer(1, 0x400000, 8, 0x4000); - - YMZ280BInit(16934400, &TriggerSoundIRQ, 0x400000); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo feversosRomDesc[] = { - { "cv01-u34.sos", 0x080000, 0x24EF3CE6, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "cv01-u33.sos", 0x080000, 0x64FF73FD, BRF_ESS | BRF_PRG }, // 1 - - { "cv01-u25.bin", 0x400000, 0xA6F6A95D, BRF_GRA }, // 2 Sprite data - { "cv01-u26.bin", 0x400000, 0x32EDB62A, BRF_GRA }, // 3 - - { "cv01-u50.bin", 0x200000, 0x7A344417, BRF_GRA }, // 4 Layer 0 Tile data - { "cv01-u49.bin", 0x200000, 0xD21CDDA7, BRF_GRA }, // 5 Layer 1 Tile data - - { "cv01-u19.bin", 0x400000, 0x5F5514DA, BRF_SND }, // 6 YMZ280B (AD)PCM data - - { "eeprom-feversos.bin", 0x0080, 0xd80303aa, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(feversos) -STD_ROM_FN(feversos) - -static struct BurnRomInfo dfeveronRomDesc[] = { - { "cv01-u34.bin", 0x080000, 0xBE87F19D, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "cv01-u33.bin", 0x080000, 0xE53A7DB3, BRF_ESS | BRF_PRG }, // 1 - - { "cv01-u25.bin", 0x400000, 0xA6F6A95D, BRF_GRA }, // 2 Sprite data - { "cv01-u26.bin", 0x400000, 0x32EDB62A, BRF_GRA }, // 3 - - { "cv01-u50.bin", 0x200000, 0x7A344417, BRF_GRA }, // 4 Layer 0 Tile data - { "cv01-u49.bin", 0x200000, 0xD21CDDA7, BRF_GRA }, // 5 Layer 1 Tile data - - { "cv01-u19.bin", 0x400000, 0x5F5514DA, BRF_SND }, // 6 YMZ280B (AD)PCM data - - { "eeprom-dfeveron.bin", 0x0080, 0xc3174959, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(dfeveron) -STD_ROM_FN(dfeveron) - -struct BurnDriver BurnDrvFeverSOS = { - "feversos", NULL, NULL, NULL, "1998", - "Fever SOS (International, ver. 98/09/25)\0", NULL, "Cave / Nihon System inc.", "Cave", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, feversosRomInfo, feversosRomName, NULL, NULL, feversosInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDFeveron = { - "dfeveron", "feversos", NULL, NULL, "1998", - "Dangun Feveron (Japan, ver. 98/09/17)\0", NULL, "Cave / Nihon System inc.", "Cave", - L"\u5F3E\u9283 Feveron \u3060\u3093\u304C\u3093\u30D5\u30A3\u30FC\u30D0\u30ED\u30F3 (Japan, ver. 98/09/17)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, dfeveronRomInfo, dfeveronRomName, NULL, NULL, feversosInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/cave/d_gaia.cpp b/jan/src/burn/drv/cave/d_gaia.cpp deleted file mode 100644 index d41be19a0..000000000 --- a/jan/src/burn/drv/cave/d_gaia.cpp +++ /dev/null @@ -1,885 +0,0 @@ -// Gaia Crusaders -#include "cave.h" -#include "ymz280b.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[16] = {0, }; -static UINT8 DrvJoy2[16] = {0, }; -static UINT16 DrvInput[3] = {0, }; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static INT8 nVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCurrentCPU; -static INT32 nCyclesDone[2]; -static INT32 nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo gaiaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 4, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 5, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy1 + 15, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy2 + 2, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 3, "service"}, - - {"DIP A", BIT_DIPSWITCH, (UINT8*)(DrvInput + 2) + 0, "dip"}, - {"DIP B", BIT_DIPSWITCH, (UINT8*)(DrvInput + 2) + 1, "dip"}, -}; - -STDINPUTINFO(gaia) - -static struct BurnDIPInfo gaiaDIPList[] = { - // Defaults - {0x17, 0xFF, 0xFF, 0x04, NULL}, - {0x18, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "V reverse"}, - {0x17, 0x01, 0x01, 0x00, "Off"}, - {0x17, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x17, 0x01, 0x02, 0x02, "Off"}, - {0x17, 0x01, 0x02, 0x00, "On"}, - {0, 0xFE, 0, 2, "Language"}, - {0x17, 0x01, 0x04, 0x00, "Japanese"}, - {0x17, 0x01, 0x04, 0x04, "English"}, - {0, 0xFE, 0, 9, "Coin"}, - {0x17, 0x01, 0x78, 0x00, "1 coin 1 credit"}, - {0x17, 0x01, 0x78, 0x08, "1 coin 2 credits"}, - {0x17, 0x01, 0x78, 0x10, "1 coin 3 credits"}, - {0x17, 0x01, 0x78, 0x18, "2 coins 1 credit"}, - {0x17, 0x01, 0x78, 0x20, "2 coins 3 credits"}, - {0x17, 0x01, 0x78, 0x28, "3 coins 1 credit"}, - {0x17, 0x01, 0x78, 0x30, "4 coins 1 credit"}, - {0x17, 0x01, 0x78, 0x38, "2 coins 1 credit 1 continue"}, - {0x17, 0x01, 0x78, 0x40, "Free play"}, - {0x17, 0x01, 0x78, 0x48, "Free play"}, - {0x17, 0x01, 0x78, 0x50, "Free play"}, - {0x17, 0x01, 0x78, 0x58, "Free play"}, - {0x17, 0x01, 0x78, 0x60, "Free play"}, - {0x17, 0x01, 0x78, 0x68, "Free play"}, - {0x17, 0x01, 0x78, 0x70, "Free play"}, - {0x17, 0x01, 0x78, 0x78, "Free play"}, - {0, 0xFE, 0, 2, "Continue"}, - {0x17, 0x01, 0x80, 0x80, "Off"}, - {0x17, 0x01, 0x80, 0x00, "On"}, - - // DIP 2 - {0, 0xFE, 0, 8, "Level"}, - {0x18, 0x01, 0xE0, 0x20, "Very easy"}, - {0x18, 0x01, 0xE0, 0x40, "Easy"}, - {0x18, 0x01, 0xE0, 0x00, "Medium"}, - {0x18, 0x01, 0xE0, 0x80, "Medium hard"}, - {0x18, 0x01, 0xE0, 0x60, "Hard 1"}, - {0x18, 0x01, 0xE0, 0xC0, "Hard 2"}, - {0x18, 0x01, 0xE0, 0xA0, "Very hard"}, - {0x18, 0x01, 0xE0, 0xE0, "Hardest"}, - - // Extend condition - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xE0, 0x00, NULL}, - {0x18, 0x02, 0x04, 0x00, "150,000/350,000"}, - {0x18, 0x00, 0xE0, 0x00, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xE0, 0x20, NULL}, - {0x18, 0x02, 0x04, 0x00, "150,000/300,000"}, - {0x18, 0x00, 0xE0, 0x20, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xE0, 0x40, NULL}, - {0x18, 0x02, 0x04, 0x00, "150,000/350,000"}, - {0x18, 0x00, 0xE0, 0x40, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xE0, 0x60, NULL}, - {0x18, 0x02, 0x04, 0x00, "150,000/400,000"}, - {0x18, 0x00, 0xE0, 0x60, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xE0, 0x80, NULL}, - {0x18, 0x02, 0x04, 0x00, "150,000/400,000"}, - {0x18, 0x00, 0xE0, 0x80, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xE0, 0xA0, NULL}, - {0x18, 0x02, 0x04, 0x00, "200,000/500,000"}, - {0x18, 0x00, 0xE0, 0xA0, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xE0, 0xC0, NULL}, - {0x18, 0x02, 0x04, 0x00, "150,000/400,000"}, - {0x18, 0x00, 0xE0, 0xC0, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xE0, 0xE0, NULL}, - {0x18, 0x02, 0x04, 0x00, "200,000/500,000"}, - {0x18, 0x00, 0xE0, 0xE0, NULL}, - - {0, 0xFE, 0, 4, "Life"}, - {0x18, 0x01, 0x03, 0x02, "1 player"}, - {0x18, 0x01, 0x03, 0x03, "2 players"}, - {0x18, 0x01, 0x03, 0x00, "3 players"}, - {0x18, 0x01, 0x03, 0x01, "4 players"}, - {0, 0xFE, 0, 4, "Damage"}, - {0x18, 0x01, 0x18, 0x00, "+0"}, - {0x18, 0x01, 0x18, 0x08, "+1"}, - {0x18, 0x01, 0x18, 0x10, "+2"}, - {0x18, 0x01, 0x18, 0x18, "+3"}, -}; - -STDDIPINFO(gaia) - -static struct BurnDIPInfo theroesDIPList[] = { - // Defaults - {0x17, 0xFF, 0xFF, 0x04, NULL}, - {0x18, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "V reverse"}, - {0x17, 0x01, 0x01, 0x00, "Off"}, - {0x17, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x17, 0x01, 0x02, 0x02, "Off"}, - {0x17, 0x01, 0x02, 0x00, "On"}, - {0, 0xFE, 0, 2, "Language"}, - {0x17, 0x01, 0x04, 0x00, "Chinese"}, - {0x17, 0x01, 0x04, 0x04, "English"}, - {0, 0xFE, 0, 9, "Coin"}, - {0x17, 0x01, 0x78, 0x00, "1 coin 1 credit"}, - {0x17, 0x01, 0x78, 0x08, "1 coin 2 credits"}, - {0x17, 0x01, 0x78, 0x10, "1 coin 3 credits"}, - {0x17, 0x01, 0x78, 0x18, "2 coins 1 credit"}, - {0x17, 0x01, 0x78, 0x20, "2 coins 3 credits"}, - {0x17, 0x01, 0x78, 0x28, "3 coins 1 credit"}, - {0x17, 0x01, 0x78, 0x30, "4 coins 1 credit"}, - {0x17, 0x01, 0x78, 0x38, "2 coins 1 credit 1 continue"}, - {0x17, 0x01, 0x78, 0x40, "Free play"}, - {0x17, 0x01, 0x78, 0x48, "Free play"}, - {0x17, 0x01, 0x78, 0x50, "Free play"}, - {0x17, 0x01, 0x78, 0x58, "Free play"}, - {0x17, 0x01, 0x78, 0x60, "Free play"}, - {0x17, 0x01, 0x78, 0x68, "Free play"}, - {0x17, 0x01, 0x78, 0x70, "Free play"}, - {0x17, 0x01, 0x78, 0x78, "Free play"}, - {0, 0xFE, 0, 2, "Continue"}, - {0x17, 0x01, 0x80, 0x80, "Off"}, - {0x17, 0x01, 0x80, 0x00, "On"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Level"}, - {0x18, 0x01, 0xC0, 0x40, "Very easy"}, - {0x18, 0x01, 0xC0, 0x00, "Medium"}, - {0x18, 0x01, 0xC0, 0x80, "Medium hard"}, - {0x18, 0x01, 0xC0, 0xC0, "Hardest"}, - - // Extend condition - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xC0, 0x00, NULL}, - {0x18, 0x02, 0x04, 0x00, "150,000/350,000"}, - {0x18, 0x00, 0xC0, 0x00, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xC0, 0x40, NULL}, - {0x18, 0x02, 0x04, 0x00, "150,000/300,000"}, - {0x18, 0x00, 0xC0, 0x40, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xC0, 0x80, NULL}, - {0x18, 0x02, 0x04, 0x00, "150,000/400,000"}, - {0x18, 0x00, 0xC0, 0x80, NULL}, - {0, 0xFE, 0, 2, "Extend"}, - {0x18, 0x02, 0x04, 0x04, "Nothing"}, - {0x18, 0x00, 0xC0, 0xC0, NULL}, - {0x18, 0x02, 0x04, 0x00, "200,000/500,000"}, - {0x18, 0x00, 0xC0, 0xC0, NULL}, - - {0, 0xFE, 0, 4, "Life"}, - {0x18, 0x01, 0x03, 0x02, "1 player"}, - {0x18, 0x01, 0x03, 0x03, "2 players"}, - {0x18, 0x01, 0x03, 0x00, "3 players"}, - {0x18, 0x01, 0x03, 0x01, "4 players"}, - {0, 0xFE, 0, 4, "Damage"}, - {0x18, 0x01, 0x18, 0x00, "+0"}, - {0x18, 0x01, 0x18, 0x08, "+1"}, - {0x18, 0x01, 0x18, 0x10, "+2"}, - {0x18, 0x01, 0x18, 0x18, "+3"}, -}; - -STDDIPINFO(theroes) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall gaiaReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300003: { - return YMZ280BReadStatus(); - } - -#if 0 - case 0x800000: - case 0x800001: { - UINT16 nRet = ((nVBlank ^ 1) << 2) | (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } -#else - case 0x800000: - case 0x800001: -#endif - case 0x800002: - case 0x800003: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x800004: - case 0x800005: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x800006: - case 0x800007: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xD00010: - return (DrvInput[0] >> 8) ^ 0xFF; - case 0xD00011: - return (DrvInput[0] & 0xFF) ^ 0xFF; - case 0xD00012: - return (DrvInput[1] >> 8) ^ 0xFF; - case 0xD00013: - return (DrvInput[1] & 0xFF) ^ 0xFF; - case 0xD00014: - return (DrvInput[2] >> 8) ^ 0xFF; - case 0xD00015: - return (DrvInput[2] & 0xFF) ^ 0xFF; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -UINT16 __fastcall gaiaReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300002: { - return YMZ280BReadStatus(); - } - -#if 0 - case 0x800000: { - UINT16 nRet = ((nVBlank ^ 1) << 2) | (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } -#else - case 0x800000: -#endif - case 0x800002: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x800004: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x800006: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xD00010: - return DrvInput[0] ^ 0xFFFF; - case 0xD00012: - return DrvInput[1] ^ 0xFFFF; - case 0xD00014: - return DrvInput[2] ^ 0xFFFF; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall gaiaWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x300001: - YMZ280BSelectRegister(byteValue); - break; - case 0x300003: - YMZ280BWriteRegister(byteValue); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall gaiaWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x300000: - YMZ280BSelectRegister(wordValue); - break; - case 0x300002: - YMZ280BWriteRegister(wordValue); - break; - - case 0x800000: - nCaveXOffset = wordValue; - return; - case 0x800002: - nCaveYOffset = wordValue; - return; - case 0x800008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0x900000: - CaveTileReg[0][0] = wordValue; - break; - case 0x900002: - CaveTileReg[0][1] = wordValue; - break; - case 0x900004: - CaveTileReg[0][2] = wordValue; - break; - - case 0xA00000: - CaveTileReg[1][0] = wordValue; - break; - case 0xA00002: - CaveTileReg[1][1] = wordValue; - break; - case 0xA00004: - CaveTileReg[1][2] = wordValue; - break; - - case 0xB00000: - CaveTileReg[2][0] = wordValue; - break; - case 0xB00002: - CaveTileReg[2][1] = wordValue; - break; - case 0xB00004: - CaveTileReg[2][2] = wordValue; - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - } - } -} - -void __fastcall gaiaWriteBytePalette(UINT32 sekAddress, UINT8 byteValue) -{ - CavePalWriteByte(sekAddress & 0xFFFF, byteValue); -} - -void __fastcall gaiaWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - CavePalWriteWord(sekAddress & 0xFFFF, wordValue); -} - -static void TriggerSoundIRQ(INT32 nStatus) -{ - nSoundIRQ = nStatus ^ 1; - UpdateIRQStatus(); - - if (nIRQPending && nCurrentCPU != 0) { - nCyclesDone[0] += SekRun(0x0400); - } -} - -static INT32 DrvExit() -{ - YMZ280BExit(); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - YMZ280BReset(); - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - CavePalUpdate8Bit(0, 128); // Update the palette - CaveClearScreen(CavePalette[0x0000]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static void gaiaClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0C) == 0x0C) { - *nJoystickInputs &= ~0xC; - } -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 16; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - gaiaClearOpposites(((UINT8*)DrvInput) + 0); - gaiaClearOpposites(((UINT8*)DrvInput) + 1); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 58)); - nCyclesDone[0] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 265.5); - nVBlank = 0; - - INT32 nSoundBufferPos = 0; - - SekOpen(0); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nNext; - - // Render sound segment - if ((i & 1) == 0) { - if (pBurnSoundOut) { - INT32 nSegmentEnd = nBurnSoundLen * i / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - YMZ280BRender(pSoundBuf, nSegmentEnd - nSoundBufferPos); - nSoundBufferPos = nSegmentEnd; - } - } - - // Run 68000 - nCurrentCPU = 0; - nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // See if we need to trigger the VBlank interrupt - if (!nVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - nVBlank = 1; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - nCurrentCPU = -1; - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - YMZ280BRender(pSoundBuf, nSegmentLength); - } - } - } - - SekClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // 68K program - CaveSpriteROM = Next; Next += 0x1000000; - CaveTileROM[0] = Next; Next += 0x400000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x400000; // Tile layer 1 - CaveTileROM[2] = Next; Next += 0x400000; // Tile layer 2 - YMZ280BROM = Next; Next += 0xC00000; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - CaveTileRAM[0] = Next; Next += 0x010000; - CaveTileRAM[1] = Next; Next += 0x010000; - CaveTileRAM[2] = Next; Next += 0x010000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x010000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap1(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void NibbleSwap4(UINT8* pData, INT32 nLen) -{ - for (INT32 i = 0; i < nLen; i++, pData += 2) { - UINT8 n1 = pData[0]; - UINT8 n2 = pData[1]; - - pData[1] = (n2 << 4) | (n1 & 0x0F); - pData[0] = (n2 & 0xF0) | (n1 >> 4); - } - - return; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01 + 0, 1, 2); - BurnLoadRom(Rom01 + 1, 0, 2); - - BurnLoadRom(CaveSpriteROM + 0x000000, 2, 1); - BurnLoadRom(CaveSpriteROM + 0x400000, 3, 1); - NibbleSwap1(CaveSpriteROM, 0x800000); - - BurnLoadRom(CaveTileROM[0] + 0x000000, 4, 1); - NibbleSwap4(CaveTileROM[0], 0x400000); - BurnLoadRom(CaveTileROM[1] + 0x000000, 5, 1); - NibbleSwap4(CaveTileROM[1], 0x400000); - BurnLoadRom(CaveTileROM[2] + 0x000000, 6, 1); - NibbleSwap4(CaveTileROM[2], 0x400000); - - // Load YMZ280B data - BurnLoadRom(YMZ280BROM + 0x000000, 7, 1); - BurnLoadRom(YMZ280BROM + 0x400000, 8, 1); - BurnLoadRom(YMZ280BROM + 0x800000, 9, 1); - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - if (nAction & ACB_MEMORY_ROM) { // Scan all memory, devices & variables - ba.Data = Rom01; - ba.nLen = 0x00100000; - ba.nAddress = 0; - ba.szName = "68K ROM"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { // Scan all memory, devices & variables - ba.Data = Ram01; - ba.nLen = 0x00010000; - ba.nAddress = 0; - ba.szName = "68K RAM"; - BurnAcb(&ba); - - ba.Data = CaveTileRAM[0]; - ba.nLen = 0x00010000; - ba.nAddress = 0; - ba.szName = "Tilemap 0"; - BurnAcb(&ba); - - ba.Data = CaveTileRAM[1]; - ba.nLen = 0x00010000; - ba.nAddress = 0; - ba.szName = "Tilemap 1"; - BurnAcb(&ba); - - ba.Data = CaveTileRAM[2]; - ba.nLen = 0x00010000; - ba.nAddress = 0; - ba.szName = "Tile layer 2"; - BurnAcb(&ba); - - ba.Data = CaveSpriteRAM; - ba.nLen = 0x00010000; - ba.nAddress = 0; - ba.szName = "Sprite tables"; - BurnAcb(&ba); - - ba.Data = CavePalSrc; - ba.nLen = 0x00010000; - ba.nAddress = 0; - ba.szName = "Palette"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); // scan 68000 states - - YMZ280BScan(); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(nVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - - if (nAction & ACB_WRITE) { - CaveRecalcPalette = 1; - } - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(58.0); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x400000, 0x40FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x500000, 0x50FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x600000, 0x60FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2], 0x700000, 0x70FFFF, MAP_RAM); - - SekMapMemory(CavePalSrc, 0xC00000, 0xC0FFFF, MAP_ROM); // Palette RAM (write goes through handler) - SekMapHandler(1, 0xC00000, 0xC0FFFF, MAP_WRITE); // - - SekSetReadWordHandler(0, gaiaReadWord); - SekSetReadByteHandler(0, gaiaReadByte); - SekSetWriteWordHandler(0, gaiaWriteWord); - SekSetWriteByteHandler(0, gaiaWriteByte); - - SekSetWriteWordHandler(1, gaiaWriteWordPalette); - SekSetWriteByteHandler(1, gaiaWriteBytePalette); - - SekClose(); - } - - nCaveRowModeOffset = 0; - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(2, 0x1000000); - CaveTileInitLayer(0, 0x400000, 8, 0x4000); - CaveTileInitLayer(1, 0x400000, 8, 0x4000); - CaveTileInitLayer(2, 0x400000, 8, 0x4000); - - YMZ280BInit(16000000, &TriggerSoundIRQ, 0xC00000); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo gaiaRomDesc[] = { - { "prg1.127", 0x080000, 0x47B904B2, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "prg2.128", 0x080000, 0x469B7794, BRF_ESS | BRF_PRG }, // 1 - - { "obj1.736", 0x400000, 0xF4F84E5D, BRF_GRA }, // 2 Sprite data - { "obj2.738", 0x400000, 0x15C2A9CE, BRF_GRA }, // 3 - - { "bg1.989", 0x400000, 0x013A693D, BRF_GRA }, // 4 Layer 0 Tile data - { "bg2.995", 0x400000, 0x783CC62F, BRF_GRA }, // 5 Layer 1 Tile data - { "bg3.998", 0x400000, 0xbcd61d1c, BRF_GRA }, // 6 Layer 2 Tile data - - { "snd1.447", 0x400000, 0x92770A52, BRF_SND }, // 7 YMZ280B (AD)PCM data - { "snd2.454", 0x400000, 0x329AE1CF, BRF_SND }, // 8 - { "snd3.455", 0x400000, 0x4048D64E, BRF_SND }, // 9 -}; - - -STD_ROM_PICK(gaia) -STD_ROM_FN(gaia) - -struct BurnDriver BurnDrvGaia = { - "gaia", NULL, NULL, NULL, "1999", - "Gaia Crusaders\0", NULL, "Noise Factory", "Cave", - L"Gaia Crusaders \u5F81\u6226\u8005\0Gaia Crusaders \u30AC\u30A4\u30A2\u30AF\u30EB\u30BB\u30A4\u30C0\u30FC\u30BA\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_SCRFIGHT, 0, - NULL, gaiaRomInfo, gaiaRomName, NULL, NULL, gaiaInputInfo, gaiaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 224, 4, 3 -}; - -static struct BurnRomInfo theroesRomDesc[] = { - { "t-hero-epm1.u0127", 0x080000, 0x09db7195, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "t-hero-epm0.u0129", 0x080000, 0x2d4e3310, BRF_ESS | BRF_PRG }, // 1 - - { "t-hero-obj1.u0736", 0x400000, 0x35090f7c, BRF_GRA }, // 2 Sprite data - { "t-hero-obj2.u0738", 0x400000, 0x71605108, BRF_GRA }, // 3 - - { "t-hero-bg1.u0999", 0x400000, 0x47b0fb40, BRF_GRA }, // 4 Layer 0 Tile data - { "t-hero-bg2.u0995", 0x400000, 0xb16237a1, BRF_GRA }, // 5 Layer 1 Tile data - { "t-hero-bg3.u0998", 0x400000, 0x08eb5604, BRF_GRA }, // 6 Layer 2 Tile data - - { "crvsaders-snd1.u0447", 0x400000, 0x92770A52, BRF_SND }, // 7 YMZ280B (AD)PCM data - { "crvsaders-snd2.u0454", 0x400000, 0x329AE1CF, BRF_SND }, // 8 - { "t-hero-snd3.u0455", 0x400000, 0x52b0b2c0, BRF_SND }, // 9 -}; - -STD_ROM_PICK(theroes) -STD_ROM_FN(theroes) - -struct BurnDriver BurnDrvTheroes = { - "theroes", NULL, NULL, NULL, "2001", - "Thunder Heroes\0", NULL, "Primetec Investments", "Cave", - L"\u9739\u96F3\u82F1\u96C4 Thunder Heroes\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_SCRFIGHT, 0, - NULL, theroesRomInfo, theroesRomName, NULL, NULL, gaiaInputInfo, theroesDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/cave/d_guwange.cpp b/jan/src/burn/drv/cave/d_guwange.cpp deleted file mode 100644 index ab2cb4a79..000000000 --- a/jan/src/burn/drv/cave/d_guwange.cpp +++ /dev/null @@ -1,708 +0,0 @@ -// Guwange -#include "cave.h" -#include "ymz280b.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[16] = {0, }; -static UINT8 DrvJoy2[16] = {0, }; -static UINT16 DrvInput[2] = {0, }; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01; -static UINT8 *DefaultEEPROM = NULL; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCurrentCPU; -static INT32 nCyclesDone[2]; -static INT32 nCyclesTotal[2]; -static INT32 nCyclesSegment; -static INT32 nCyclesExtra; - -static struct BurnInputInfo guwangeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 1, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 8, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 9, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 10, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 11, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 12, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 15, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy2 + 2, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 3, "service"}, -}; - -STDINPUTINFO(guwange) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall guwangeReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x800002: - case 0x800003: { - return YMZ280BReadStatus(); - } - - case 0x300000: - case 0x300001: - case 0x300002: - case 0x300003: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x300004: - case 0x300005: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x300006: - case 0x300007: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xD00010: - return (DrvInput[0] >> 8) ^ 0xFF; - case 0xD00011: - return (DrvInput[0] & 0xFF) ^ 0xFF; - case 0xD00012: - return (DrvInput[1] >> 8) ^ 0xFF; - case 0xD00013: - return ((DrvInput[1] & 0x7F) ^ 0x7F) | (EEPROMRead() << 7); - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -UINT16 __fastcall guwangeReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x800002: { - return YMZ280BReadStatus(); - } - - case 0x300000: - case 0x300002: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - - case 0x300004: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x300006: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xD00010: - return DrvInput[0] ^ 0xFFFF; - case 0xD00012: - return (DrvInput[1] ^ 0xFF7F) | (EEPROMRead() << 7); - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall guwangeWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x800000: - case 0x800001: - YMZ280BSelectRegister(byteValue); - break; - case 0x800002: - case 0x800003: - YMZ280BWriteRegister(byteValue); - break; - - case 0xD00011: - EEPROMWrite(byteValue & 0x40, byteValue & 0x20, byteValue & 0x80); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall guwangeWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x300000: - nCaveXOffset = wordValue; - return; - case 0x300002: - nCaveYOffset = wordValue; - return; - case 0x300008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0x800000: - YMZ280BSelectRegister(wordValue & 0xFF); - break; - case 0x800002: - YMZ280BWriteRegister(wordValue & 0xFF); - break; - - case 0x900000: - CaveTileReg[0][0] = wordValue; - break; - case 0x900002: - CaveTileReg[0][1] = wordValue; - break; - case 0x900004: - CaveTileReg[0][2] = wordValue; - break; - - case 0xA00000: - CaveTileReg[1][0] = wordValue; - break; - case 0xA00002: - CaveTileReg[1][1] = wordValue; - break; - case 0xA00004: - CaveTileReg[1][2] = wordValue; - break; - - case 0xB00000: - CaveTileReg[2][0] = wordValue; - break; - case 0xB00002: - CaveTileReg[2][1] = wordValue; - break; - case 0xB00004: - CaveTileReg[2][2] = wordValue; - break; - - case 0xD00010: - EEPROMWrite(wordValue & 0x40, wordValue & 0x20, wordValue & 0x80); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - } - } -} - -void __fastcall guwangeWriteBytePalette(UINT32 sekAddress, UINT8 byteValue) -{ - CavePalWriteByte(sekAddress & 0xFFFF, byteValue); -} - -void __fastcall guwangeWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - CavePalWriteWord(sekAddress & 0xFFFF, wordValue); -} - -static void TriggerSoundIRQ(INT32 nStatus) -{ - nSoundIRQ = nStatus ^ 1; - UpdateIRQStatus(); - - if (nIRQPending && nCurrentCPU != 0) { - nCyclesDone[0] += SekRun(0x0400); - } -} - -static INT32 DrvExit() -{ - YMZ280BExit(); - - EEPROMExit(); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - YMZ280BReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - nCyclesExtra = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - CavePalUpdate8Bit(0, 128); // Update the palette - CaveClearScreen(CavePalette[0x7F00]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static void guwangeClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x06) == 0x06) { - *nJoystickInputs &= ~0x06; - } - if ((*nJoystickInputs & 0x18) == 0x18) { - *nJoystickInputs &= ~0x18; - } -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Joysticks - DrvInput[1] = 0x0000; // Other controls - for (INT32 i = 0; i < 16; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - guwangeClearOpposites(((UINT8*)DrvInput) + 0); - guwangeClearOpposites(((UINT8*)DrvInput) + 1); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesDone[0] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - SekOpen(0); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nNext; - - // Render sound segment - if ((i & 1) == 0) { - if (pBurnSoundOut) { - INT32 nSegmentEnd = nBurnSoundLen * i / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - YMZ280BRender(pSoundBuf, nSegmentEnd - nSoundBufferPos); - nSoundBufferPos = nSegmentEnd; - } - } - - // Run 68000 - nCurrentCPU = 0; - nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment+nCyclesExtra); - nCyclesExtra = 0; - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - nCurrentCPU = -1; - } - - // Make sure the buffer is entirely filled. - { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - YMZ280BRender(pSoundBuf, nSegmentLength); - } - } - } - nCyclesExtra = SekTotalCycles() - nCyclesTotal[0]; - - SekClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // 68K program - CaveSpriteROM = Next; Next += 0x2000000; - CaveTileROM[0] = Next; Next += 0x800000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x400000; // Tile layer 1 - CaveTileROM[2] = Next; Next += 0x400000; // Tile layer 2 - YMZ280BROM = Next; Next += 0x400000; - DefaultEEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveTileRAM[2] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x010000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap3(UINT8* pData, INT32 nLen) -{ - for (INT32 i = 0; i < nLen; i++, pData += 2) { - UINT8 n1 = pData[0]; - UINT8 n2 = pData[1]; - - pData[0] = (n1 << 4) | (n2 & 0x0F); - pData[1] = (n1 & 0xF0) | (n2 >> 4); - } - - return; -} - -static void NibbleSwap4(UINT8* pData, INT32 nLen) -{ - for (INT32 i = 0; i < nLen; i++, pData += 2) { - UINT8 n1 = pData[0]; - UINT8 n2 = pData[1]; - - pData[1] = (n2 << 4) | (n1 & 0x0F); - pData[0] = (n2 & 0xF0) | (n1 >> 4); - } - - return; -} - - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01 + 0, 1, 2); - BurnLoadRom(Rom01 + 1, 0, 2); - - BurnLoadRom(CaveSpriteROM + 0x0000000, 2, 2); - BurnLoadRom(CaveSpriteROM + 0x0000001, 3, 2); - BurnLoadRom(CaveSpriteROM + 0x1000000, 4, 2); - BurnLoadRom(CaveSpriteROM + 0x1000001, 5, 2); - NibbleSwap3(CaveSpriteROM, 0xC00000); - -#if 0 - // I don't think this is needed anymore, dink aug 14 2016. - // note: if enabled-this causes the screen fade-in effect after starting - // a game @ the character selection screen to display garbage sprite data. - for (INT32 i = 0; i < 0x100000; i++) { - UINT16 nValue = rand() & 0x0101; - if (nValue & 0x0001) { - nValue |= 0x00FF; - } - if (nValue & 0x0100) { - nValue |= 0xFF00; - } - ((UINT16*)(CaveSpriteROM + 0x1800000))[i] = nValue; - ((UINT16*)(CaveSpriteROM + 0x1A00000))[i] = nValue; - ((UINT16*)(CaveSpriteROM + 0x1C00000))[i] = nValue; - ((UINT16*)(CaveSpriteROM + 0x1E00000))[i] = nValue; - } -#else - memcpy(CaveSpriteROM + 0x1800000, CaveSpriteROM + 0x1000000, 0x800000); -#endif - - BurnLoadRom(CaveTileROM[0] + 0x000000, 6, 1); - NibbleSwap4(CaveTileROM[0], 0x400000); - BurnLoadRom(CaveTileROM[1] + 0x000000, 7, 1); - NibbleSwap4(CaveTileROM[1], 0x200000); - BurnLoadRom(CaveTileROM[2] + 0x000000, 8, 1); - NibbleSwap4(CaveTileROM[2], 0x200000); - - // Load YMZ280B data - BurnLoadRom(YMZ280BROM, 9, 1); - - BurnLoadRom(DefaultEEPROM, 14, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - YMZ280BScan(); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - } - - if (nAction & ACB_WRITE) { - CaveRecalcPalette = 1; - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - if (!EEPROMAvailable()) EEPROMFill(DefaultEEPROM,0, 0x80); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x200000, 0x20FFFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x400000, 0x40FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x500000, 0x507FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x600000, 0x607FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2], 0x700000, 0x707FFF, MAP_RAM); - - SekMapMemory(CavePalSrc, 0xC00000, 0xC0FFFF, MAP_ROM); // Palette RAM (write goes through handler) - SekMapHandler(1, 0xC00000, 0xC0FFFF, MAP_WRITE); // - - SekSetReadWordHandler(0, guwangeReadWord); - SekSetReadByteHandler(0, guwangeReadByte); - SekSetWriteWordHandler(0, guwangeWriteWord); - SekSetWriteByteHandler(0, guwangeWriteByte); - - SekSetWriteWordHandler(1, guwangeWriteWordPalette); - SekSetWriteByteHandler(1, guwangeWriteBytePalette); - - SekClose(); - } - - nCaveRowModeOffset = 2; - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(1, 0x2000000); - CaveTileInitLayer(0, 0x800000, 8, 0x4000); - CaveTileInitLayer(1, 0x400000, 8, 0x4000); - CaveTileInitLayer(2, 0x400000, 8, 0x4000); - - YMZ280BInit(16934400, &TriggerSoundIRQ, 0x400000); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo guwangeRomDesc[] = { - { "gu-u0127.bin", 0x080000, 0xF86B5293, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "gu-u0129.bin", 0x080000, 0x6C0E3B93, BRF_ESS | BRF_PRG }, // 1 - - { "u083.bin", 0x800000, 0xADC4B9C4, BRF_GRA }, // 2 Sprite data - { "u082.bin", 0x800000, 0x3D75876C, BRF_GRA }, // 3 - { "u086.bin", 0x400000, 0x188E4F81, BRF_GRA }, // 4 - { "u085.bin", 0x400000, 0xA7D5659E, BRF_GRA }, // 5 - - { "u101.bin", 0x800000, 0x0369491F, BRF_GRA }, // 6 Layer 0 Tile data - { "u10102.bin", 0x400000, 0xE28D6855, BRF_GRA }, // 7 Layer 1 Tile data - { "u10103.bin", 0x400000, 0x0FE91B8E, BRF_GRA }, // 8 Layer 2 Tile data - - { "u0462.bin", 0x400000, 0xB3D75691, BRF_SND }, // 9 YMZ280B (AD)PCM data - - { "atc05-1.bin", 0x000001, 0x00000000, BRF_NODUMP }, - { "u0259.bin", 0x000001, 0x00000000, BRF_NODUMP }, - { "u084.bin", 0x000001, 0x00000000, BRF_NODUMP }, - { "u108.bin", 0x000001, 0x00000000, BRF_NODUMP }, - - { "eeprom-guwange.bin", 0x0080, 0xc3174959, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(guwange) -STD_ROM_FN(guwange) - - -struct BurnDriver BurnDrvGuwange = { - "guwange", NULL, NULL, NULL, "1999", - "Guwange (Japan, Master Ver. 99/06/24)\0", NULL, "Atlus / Cave", "Cave", - L"\u3050\u308F\u3093\u3052 (Japan, Master Ver. 99/06/24)\0Guwange\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, guwangeRomInfo, guwangeRomName, NULL, NULL, guwangeInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - - -static struct BurnRomInfo guwangesRomDesc[] = { - { "gu-u0127b.bin",0x080000, 0x64667d2e, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "gu-u0129b.bin",0x080000, 0xa99C6b6c, BRF_ESS | BRF_PRG }, // 1 - - { "u083.bin", 0x800000, 0xADC4B9C4, BRF_GRA }, // 2 Sprite data - { "u082.bin", 0x800000, 0x3D75876C, BRF_GRA }, // 3 - { "u086.bin", 0x400000, 0x188E4F81, BRF_GRA }, // 4 - { "u085.bin", 0x400000, 0xA7D5659E, BRF_GRA }, // 5 - - { "u101.bin", 0x800000, 0x0369491F, BRF_GRA }, // 6 Layer 0 Tile data - { "u10102.bin", 0x400000, 0xE28D6855, BRF_GRA }, // 7 Layer 1 Tile data - { "u10103.bin", 0x400000, 0x0FE91B8E, BRF_GRA }, // 8 Layer 2 Tile data - - { "u0462.bin", 0x400000, 0xB3D75691, BRF_SND }, // 9 YMZ280B (AD)PCM data - - { "atc05-1.bin", 0x000001, 0x00000000, BRF_NODUMP }, - { "u0259.bin", 0x000001, 0x00000000, BRF_NODUMP }, - { "u084.bin", 0x000001, 0x00000000, BRF_NODUMP }, - { "u108.bin", 0x000001, 0x00000000, BRF_NODUMP }, - - { "eeprom-guwange.bin", 0x0080, 0xc3174959, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(guwanges) -STD_ROM_FN(guwanges) - - -struct BurnDriver BurnDrvGuwanges = { - "guwanges", "guwange", NULL, NULL, "1999", - "Guwange (Japan, Special Ver. 00/01/01)\0", NULL, "Atlus / Cave", "Cave", - L"\u3050\u308F\u3093\u3052 (Japan, Special Ver. 00/07/07)\0Guwange\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_ONLY, GBF_VERSHOOT, 0, - NULL, guwangesRomInfo, guwangesRomName, NULL, NULL, guwangeInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/cave/d_hotdogst.cpp b/jan/src/burn/drv/cave/d_hotdogst.cpp deleted file mode 100644 index 5c21ddd23..000000000 --- a/jan/src/burn/drv/cave/d_hotdogst.cpp +++ /dev/null @@ -1,742 +0,0 @@ -// hotdogst -#include "cave.h" -#include "msm6295.h" -#include "burn_ym2203.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01, *RomZ80; -static UINT8 *Ram01, *RamZ80; -static UINT8 *MSM6295ROMSrc; -static UINT8 *DefaultEEPROM = NULL; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCyclesTotal[2]; -static INT32 nCyclesDone[2]; - -static UINT16 DrvSoundLatch; -static UINT8 DrvZ80Bank; -static UINT8 DrvOkiBank1; -static UINT8 DrvOkiBank2; - -static struct BurnInputInfo hotdogstInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, -}; - -STDINPUTINFO(hotdogst) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall hotdogstReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xc80002: - return ((DrvInput[1] >> 8) ^ 0xF7) | (EEPROMRead() << 3); - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall hotdogstWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - if (~byteValue & 0x0100) { - case 0xd00000: - EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08); - break; - } - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - - } - } -} - -UINT16 __fastcall hotdogstReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xa80000: - case 0xa80002: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0xa80004: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0xa80006: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - -// case 0xa8006e: { -// return 0xff; -// } - - case 0xc80000: - return DrvInput[0] ^ 0xFFFF; - case 0xC80002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall hotdogstWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0xa80000: - nCaveXOffset = wordValue; - return; - case 0xa80002: - nCaveYOffset = wordValue; - return; - - case 0xa80008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0xa8006e: { - DrvSoundLatch = wordValue; - ZetNmi(); - return; - } - - case 0xb00000: - CaveTileReg[0][0] = wordValue; - break; - case 0xb00002: - CaveTileReg[0][1] = wordValue; - break; - case 0xb00004: - CaveTileReg[0][2] = wordValue; - break; - - case 0xb80000: - CaveTileReg[1][0] = wordValue; - break; - case 0xb80002: - CaveTileReg[1][1] = wordValue; - break; - case 0xb80004: - CaveTileReg[1][2] = wordValue; - break; - - case 0xc00000: - CaveTileReg[2][0] = wordValue; - break; - case 0xc00002: - CaveTileReg[2][1] = wordValue; - break; - case 0xc00004: - CaveTileReg[2][2] = wordValue; - break; - - case 0xd00000: - if (~wordValue & 0x0100) { - wordValue >>= 8; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - break; - } - case 0xd00002: { - //nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - - } - } -} - -UINT8 __fastcall hotdogstZIn(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x30: { - return DrvSoundLatch & 0xff; - } - - case 0x40: { - return (DrvSoundLatch & 0xff00) >> 8; - } - - case 0x50: { - return BurnYM2203Read(0, 0); - } - - case 0x60: { - return MSM6295ReadStatus(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Read %x\n"), nAddress); - } - } - - return 0; -} - -void __fastcall hotdogstZOut(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x00: { - DrvZ80Bank = nValue & 0x0f; - - ZetMapArea(0x4000, 0x7FFF, 0, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7FFF, 2, RomZ80 + (DrvZ80Bank * 0x4000)); - return; - } - - case 0x50: { - BurnYM2203Write(0, 0, nValue); - return; - } - - case 0x51: { - BurnYM2203Write(0, 1, nValue); - return; - } - - case 0x60: { - MSM6295Command(0, nValue); - return; - } - - case 0x70: { - DrvOkiBank1 = (nValue >> 0) & 0x03; - DrvOkiBank2 = (nValue >> 4) & 0x03; - - memcpy(MSM6295ROM + 0x00000, MSM6295ROMSrc + 0x20000 * DrvOkiBank1, 0x20000); - memcpy(MSM6295ROM + 0x20000, MSM6295ROMSrc + 0x20000 * DrvOkiBank2, 0x20000); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write %x, %x\n"), nAddress, nValue); - } - } -} - -UINT8 __fastcall hotdogstZRead(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall hotdogstZWrite(UINT16 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - MSM6295Exit(0); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - ZetExit(); - - BurnYM2203Exit(); - - DrvSoundLatch = 0; - DrvZ80Bank = 0; - DrvOkiBank1 = 0; - DrvOkiBank2 = 0; - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - MSM6295Reset(0); - - EEPROMReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - DrvSoundLatch = 0; - DrvZ80Bank = 0; - DrvOkiBank1 = 0; - DrvOkiBank2 = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - CavePalUpdate4Bit(0, 128); // Update the palette - CaveClearScreen(CavePalette[0x3F00]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 80; - - INT32 nCyclesSegment; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 10; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesTotal[1] = (INT32)(4000000 / CAVE_REFRESHRATE); - nCyclesDone[0] = nCyclesDone[1] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nCurrentCPU = 0; - INT32 nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Run 68000 - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - CaveSpriteBuffer(); - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - } - - SekClose(); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // 68K program - RomZ80 = Next; Next += 0x040000; - CaveSpriteROM = Next; Next += 0x800000; - CaveTileROM[0] = Next; Next += 0x100000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x100000; // Tile layer 1 - CaveTileROM[2] = Next; Next += 0x100000; // Tile layer 2 - MSM6295ROM = Next; Next += 0x040000; - MSM6295ROMSrc = Next; Next += 0x080000; - DefaultEEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - RamZ80 = Next; Next += 0x002000; - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveTileRAM[2] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x001000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap1(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void NibbleSwap2(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[1] = *pOrg & 15; - pDest[0] = *pOrg >> 4; - } - - return; -} - -static INT32 LoadRoms() -{ - BurnLoadRom(Rom01 + 1, 0, 2); - BurnLoadRom(Rom01 + 0, 1, 2); - - BurnLoadRom(RomZ80, 2, 1); - - BurnLoadRom(CaveSpriteROM + 0x000000, 3, 1); - BurnLoadRom(CaveSpriteROM + 0x200000, 4, 1); - NibbleSwap1(CaveSpriteROM, 0x400000); - - BurnLoadRom(CaveTileROM[0], 5, 1); - NibbleSwap2(CaveTileROM[0], 0x080000); - BurnLoadRom(CaveTileROM[1], 6, 1); - NibbleSwap2(CaveTileROM[1], 0x080000); - BurnLoadRom(CaveTileROM[2], 7, 1); - NibbleSwap2(CaveTileROM[2], 0x080000); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROMSrc, 8, 1); - - BurnLoadRom(DefaultEEPROM, 9, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029719; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvZ80Bank); - SCAN_VAR(DrvOkiBank1); - SCAN_VAR(DrvOkiBank2); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7FFF, 0, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7FFF, 2, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetClose(); - - memcpy(MSM6295ROM + 0x00000, MSM6295ROMSrc + 0x20000 * DrvOkiBank1, 0x20000); - memcpy(MSM6295ROM + 0x20000, MSM6295ROMSrc + 0x20000 * DrvOkiBank2, 0x20000); - - CaveRecalcPalette = 1; - } - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static INT32 drvZInit() -{ - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(hotdogstZIn); - ZetSetOutHandler(hotdogstZOut); - ZetSetReadHandler(hotdogstZRead); - ZetSetWriteHandler(hotdogstZWrite); - - // ROM bank 1 - ZetMapArea (0x0000, 0x3FFF, 0, RomZ80 + 0x0000); // Direct Read from ROM - ZetMapArea (0x0000, 0x3FFF, 2, RomZ80 + 0x0000); // Direct Fetch from ROM - // ROM bank 2 - ZetMapArea (0x4000, 0x7FFF, 0, RomZ80 + 0x4000); // Direct Read from ROM - ZetMapArea (0x4000, 0x7FFF, 2, RomZ80 + 0x4000); // - // RAM - ZetMapArea (0xE000, 0xFFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0xE000, 0xFFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0xE000, 0xFFFF, 2, RamZ80); // - ZetClose(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - if (!EEPROMAvailable()) EEPROMFill(DefaultEEPROM,0, 0x80); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x300000, 0x30FFFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0x408000, 0x408FFF, MAP_RAM); // Palette RAM - SekMapMemory(CaveTileRAM[0], 0x880000, 0x887FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x900000, 0x907FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2], 0x980000, 0x987FFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0xf00000, 0xf0fFFF, MAP_RAM); - - SekSetReadByteHandler(0, hotdogstReadByte); - SekSetWriteByteHandler(0, hotdogstWriteByte); - SekSetReadWordHandler(0, hotdogstReadWord); - SekSetWriteWordHandler(0, hotdogstWriteWord); - SekClose(); - } - - drvZInit(); - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(2, 0x0800000); - CaveTileInitLayer(0, 0x100000, 8, 0); - CaveTileInitLayer(1, 0x100000, 8, 0); - CaveTileInitLayer(2, 0x100000, 8, 0); - - nCaveExtraXOffset = -32; - nCaveExtraYOffset = 32; - - BurnYM2203Init(1, 4000000, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.20, BURN_SND_ROUTE_BOTH); - - memcpy(MSM6295ROM, MSM6295ROMSrc, 0x40000); - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo hotdogstRomDesc[] = { - { "mp3.u29", 0x080000, 0x1f4e5479, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "mp4.u28", 0x080000, 0x6f1c3c4b, BRF_ESS | BRF_PRG }, // 1 - - { "mp2.u19", 0x040000, 0xff979ebe, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "mp9.u55", 0x200000, 0x258d49ec, BRF_GRA }, // 3 Sprite data - { "mp8.u54", 0x200000, 0xbdb4d7b8, BRF_GRA }, // 4 - - { "mp7.u56", 0x080000, 0x87c21c50, BRF_GRA }, // 5 Layer 0 Tile data - { "mp6.u61", 0x080000, 0x4dafb288, BRF_GRA }, // 6 Layer 1 Tile data - { "mp5.u64", 0x080000, 0x9b26458c, BRF_GRA }, // 7 Layer 2 Tile data - - { "mp1.u65", 0x080000, 0x4868be1b, BRF_SND }, // 8 MSM6295 #1 ADPCM data - - { "eeprom-hotdogst.bin", 0x0080, 0x12b4f934, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(hotdogst) -STD_ROM_FN(hotdogst) - -struct BurnDriver BurnDrvhotdogst = { - "hotdogst", NULL, NULL, NULL, "1996", - "Hotdog Storm - The First Supersonics (International)\0", NULL, "Marble / ACE International", "Cave", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, hotdogstRomInfo, hotdogstRomName, NULL, NULL, hotdogstInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 384, 3, 4 -}; diff --git a/jan/src/burn/drv/cave/d_korokoro.cpp b/jan/src/burn/drv/cave/d_korokoro.cpp deleted file mode 100644 index e20839b35..000000000 --- a/jan/src/burn/drv/cave/d_korokoro.cpp +++ /dev/null @@ -1,734 +0,0 @@ -// Koro Koro Quest & Crusher Makochan -#include "cave.h" -#include "ymz280b.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[1]; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT32 korokoro_hopper = 0; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCurrentCPU; -static INT32 nCyclesDone[2]; -static INT32 nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static const eeprom_interface eeprom_interface_93C46_8bit = -{ - 7, // address bits 7 - 8, // data bits 8 - "*110", // read 1 10 aaaaaa - "*101", // write 1 01 aaaaaa dddddddddddddddd - "*111", // erase 1 11 aaaaaa - "*10000xxxx", // lock 1 00 00xxxx - "*10011xxxx", // unlock 1 00 11xxxx - 1, - 0 -}; - -static struct BurnInputInfo KorokoroInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"Coin 3", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 14, "service" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 12, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, -}; - -STDINPUTINFO(Korokoro) - -static struct BurnDIPInfo KorokoroDIPList[]= -{ - {0x08, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x08, 0x01, 0x20, 0x00, "On" }, - {0x08, 0x01, 0x20, 0x20, "Off" }, -}; - -STDDIPINFO(Korokoro) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - - SekSetIRQLine(2, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall korokoroReadByte(UINT32 sekAddress) -{ - switch (sekAddress) - { - case 0x1c0000: - case 0x1c0001: - case 0x300000: - case 0x300001: - return (nUnknownIRQ << 1) | nVideoIRQ | (bVBlank ? 0 : 4); - - case 0x1c0002: - case 0x1c0003: - case 0x300002: - case 0x300003: - return (nUnknownIRQ << 1) | nVideoIRQ; - - case 0x1c0004: - case 0x1c0005: - case 0x300004: - case 0x300005: - nVideoIRQ = 1; - UpdateIRQStatus(); - return (nUnknownIRQ << 1) | nVideoIRQ; - - case 0x1c0006: - case 0x1c0007: - case 0x300006: - case 0x300007: - nUnknownIRQ = 1; - UpdateIRQStatus(); - return (nUnknownIRQ << 1) | nVideoIRQ; - - case 0x280000: - return ((DrvInput[0] >> 8) & 0x5F) | (korokoro_hopper ? 0x00 : 0x80) | (DrvDip[0] & 0x20); - - case 0x280001: - return DrvInput[0] & 0xFF; - - case 0x280002: - return ((DrvInput[1] >> 8) & 0xEF) | (EEPROMRead() ? 0x10 : 0x00); - - case 0x280003: - return DrvInput[1] & 0xFF; - -// default: -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - - return 0; -} - -UINT16 __fastcall korokoroReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x1c0000: - case 0x300000: - return (nUnknownIRQ << 1) | nVideoIRQ | (bVBlank ? 4 : 0); - - case 0x1c0002: - case 0x300002: - return (nUnknownIRQ << 1) | nVideoIRQ; - - case 0x1c0004: - case 0x300004: - nVideoIRQ = 1; - UpdateIRQStatus(); - return (nUnknownIRQ << 1) | nVideoIRQ; - - case 0x1c0006: - case 0x300006: - nUnknownIRQ = 1; - UpdateIRQStatus(); - return (nUnknownIRQ << 1) | nVideoIRQ; - - case 0x280000: - return (DrvInput[0] & 0x5FFF) | (korokoro_hopper ? 0x0000 : 0x8000) | ((DrvDip[0] & 0x20) << 8); - - case 0x280002: - return (DrvInput[1] & 0xEFFF) | ((EEPROMRead() & 1) ? 0x1000 : 0x0000); - -// default: -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - return 0; -} - -void __fastcall korokoroWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x240001: - YMZ280BSelectRegister(byteValue); - break; - - case 0x240003: - YMZ280BWriteRegister(byteValue); - break; - - case 0x280008: - case 0x280009: - // leds - break; - - case 0x28000a: - korokoro_hopper = byteValue & 0x01; - EEPROMWrite(byteValue & 0x20, byteValue & 0x10, byteValue & 0x40); - break; - -// default: -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } -} - -void __fastcall korokoroWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x140000: - CaveTileReg[0][0] = wordValue; - break; - case 0x140002: - CaveTileReg[0][1] = wordValue; - break; - case 0x140004: - CaveTileReg[0][2] = wordValue; - break; - - case 0x1c0000: - case 0x300000: - nCaveXOffset = wordValue; - return; - - case 0x1c0002: - case 0x300002: - nCaveYOffset = wordValue; - return; - - case 0x1c0008: - case 0x300008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0x240000: - YMZ280BSelectRegister(wordValue & 0xff); - break; - - case 0x240002: - YMZ280BWriteRegister(wordValue & 0xff); - break; - - case 0x280008: - return; - - case 0x28000a: { - wordValue >>= 8; - korokoro_hopper = wordValue & 0x01; - EEPROMWrite(wordValue & 0x20, wordValue & 0x10, wordValue & 0x40); - break; - } - -// default: -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -static void TriggerSoundIRQ(INT32 nStatus) -{ - nSoundIRQ = nStatus ^ 1; - UpdateIRQStatus(); - - if (nIRQPending && nCurrentCPU != 0) { - nCyclesDone[0] += SekRun(0x0400); - } -} - -static INT32 DrvExit() -{ - YMZ280BExit(); - - EEPROMExit(); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - YMZ280BReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - return 0; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x03E0) >> 2; // Red - r |= r >> 5; - g = (nColour & 0x7C00) >> 7; // Green - g |= g >> 5; - b = (nColour & 0x001F) << 3; // Blue - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -static void KorokoroPaletteUpdate() -{ - for (INT32 color = 0; color < 0x40; color++) { - for (INT32 pen = 0; pen < 0x10; pen++) { - CavePalette[(color << 8) | pen] = CalcCol(*(UINT16*)(CavePalSrc + ((0x3c00 | (color << 4) | pen)*2))); - } - - for (INT32 pen = 0x10; pen < 0x100; pen++) { - CavePalette[(color << 8) | pen] = CalcCol(*(UINT16*)(CavePalSrc + ((0x0000 | (color << 8) | pen)*2))); - } - } - - for (INT32 color = 0; color < 0x4000; color++) { - CavePalette[color+0x4000] = CalcCol(*(UINT16*)(CavePalSrc + color*2)); - } - - pBurnDrvPalette = CavePalette; -} - -static INT32 DrvDraw() -{ - KorokoroPaletteUpdate(); // Update the palette - CaveClearScreen(CavePalette[0x3F00]); - - CaveSpriteBuffer(); - - if (bDrawScreen) { - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0; // Player 1 - DrvInput[1] = 0; // Player 2 - for (INT32 i = 0; i < 16; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - DrvInput[0] ^= 0xffff; - DrvInput[1] ^= 0xffff; - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesDone[0] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - SekOpen(0); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nNext; - - // Render sound segment - if ((i & 1) == 0) { - if (pBurnSoundOut) { - INT32 nSegmentEnd = nBurnSoundLen * i / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - YMZ280BRender(pSoundBuf, nSegmentEnd - nSoundBufferPos); - nSoundBufferPos = nSegmentEnd; - } - } - - // Run 68000 - nCurrentCPU = 0; - nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - nCurrentCPU = -1; - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - YMZ280BRender(pSoundBuf, nSegmentLength); - } - } - } - - SekClose(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - YMZ280BScan(); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - SCAN_VAR(korokoro_hopper); - - CaveScanGraphics(); - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - - Rom01 = Next; Next += 0x080000; // 68K program - CaveSpriteROM = Next; Next += 0x400000; - CaveTileROM[0] = Next; Next += 0x200000; // Tile layer 0 - YMZ280BROM = Next; Next += 0x200000; - - RamStart = Next; - - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - CaveTileRAM[0] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x010000; // palette - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void NibbleSwap1(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void NibbleSwap2(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[1] = *pOrg & 15; - pDest[0] = *pOrg >> 4; - } - - return; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01 + 0, 0, 1); - - BurnLoadRom(CaveSpriteROM + 0x0000000, 1, 1); - BurnLoadRom(CaveSpriteROM + 0x0100000, 2, 1); - NibbleSwap1(CaveSpriteROM + 0x0000000, 0x180000); - - BurnLoadRom(CaveTileROM[0] + 0x000000, 3, 1); - NibbleSwap2(CaveTileROM[0], 0x100000); - - // Load YMZ280B data - BurnLoadRom(YMZ280BROM, 4, 1); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46_8bit); - - { - - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(CaveTileRAM[0], 0x100000, 0x107FFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x180000, 0x187FFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0x200000, 0x207FFF, MAP_RAM); - SekMapMemory(Ram01, 0x300000, 0x30FFFF, MAP_RAM); - - SekSetReadWordHandler(0, korokoroReadWord); - SekSetReadByteHandler(0, korokoroReadByte); - SekSetWriteWordHandler(0, korokoroWriteWord); - SekSetWriteByteHandler(0, korokoroWriteByte); - - SekClose(); - } - - nCaveRowModeOffset = 1; - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(1, 0x300000); - CaveTileInitLayer(0, 0x200000, 4, 0x4400); - - YMZ280BInit(16934400, &TriggerSoundIRQ, 0x100000); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -static INT32 crushermLoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01 + 0, 0, 1); - - BurnLoadRom(CaveSpriteROM + 0x0000000, 1, 1); - BurnLoadRom(CaveSpriteROM + 0x0100000, 2, 1); - NibbleSwap1(CaveSpriteROM + 0x0000000, 0x200000); - - BurnLoadRom(CaveTileROM[0] + 0x000000, 3, 1); - NibbleSwap2(CaveTileROM[0], 0x100000); - - // Load YMZ280B data - BurnLoadRom(YMZ280BROM + 0x000000, 4, 1); - BurnLoadRom(YMZ280BROM + 0x100000, 5, 1); - - return 0; -} - -static INT32 crushermInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (crushermLoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46_8bit); - - { - - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(CaveTileRAM[0], 0x100000, 0x107FFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x180000, 0x187FFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0x200000, 0x207FFF, MAP_RAM); - SekMapMemory(Ram01, 0x340000, 0x34FFFF, MAP_RAM); - - SekSetReadWordHandler(0, korokoroReadWord); - SekSetReadByteHandler(0, korokoroReadByte); - SekSetWriteWordHandler(0, korokoroWriteWord); - SekSetWriteByteHandler(0, korokoroWriteByte); - - SekClose(); - } - - nCaveRowModeOffset = 1; - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(1, 0x400000); - CaveTileInitLayer(0, 0x200000, 4, 0x4400); - - YMZ280BInit(16934400, &TriggerSoundIRQ, 0x200000); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - - -// Koro Koro Quest (Japan) - -static struct BurnRomInfo korokoroRomDesc[] = { - { "mp-001_ver07.u0130", 0x080000, 0x86c7241f, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "mp-001_ver01.u1066", 0x100000, 0xc5c6af7e, BRF_GRA }, // 1 Sprite data - { "mp-001_ver01.u1051", 0x080000, 0xfe5e28e8, BRF_GRA }, // 2 - - { "mp-001_ver01.u1060", 0x100000, 0xec9cf9d8, BRF_GRA }, // 3 layer 0 Tile data - - { "mp-001_ver01.u1186", 0x100000, 0xd16e7c5d, BRF_SND }, // 4 YMZ280B (AD)PCM data -}; - -STD_ROM_PICK(korokoro) -STD_ROM_FN(korokoro) - -struct BurnDriver BurnDrvKorokoro = { - "korokoro", NULL, NULL, NULL, "1999", - "Koro Koro Quest (Japan)\0", NULL, "Takumi", "Cave", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_ONLY, GBF_MISC, 0, - NULL, korokoroRomInfo, korokoroRomName, NULL, NULL, KorokoroInputInfo, KorokoroDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - - -// Crusher Makochan (Japan) - -static struct BurnRomInfo crushermRomDesc[] = { - { "mp-003ver01.u0130", 0x080000, 0xa4f56e6b, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "mp-003ver01.u1067", 0x100000, 0x268a4921, BRF_GRA }, // 1 Sprite data - { "mp-003ver01.u1066", 0x100000, 0x79e77a6e, BRF_GRA }, // 2 - - { "mp-003ver01.u1060", 0x100000, 0x7661893e, BRF_GRA }, // 3 layer 0 Tile data - - { "mp-003ver01.u1186", 0x100000, 0xc3aeb745, BRF_SND }, // 4 YMZ280B (AD)PCM data - { "mp-003ver01.u1187", 0x100000, 0xd9312497, BRF_SND }, // 5 -}; - -STD_ROM_PICK(crusherm) -STD_ROM_FN(crusherm) - -struct BurnDriver BurnDrvCrusherm = { - "crusherm", NULL, NULL, NULL, "1999", - "Crusher Makochan (Japan)\0", NULL, "Takumi", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_ONLY, GBF_MISC, 0, - NULL, crushermRomInfo, crushermRomName, NULL, NULL, KorokoroInputInfo, KorokoroDIPInfo, - crushermInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/cave/d_mazinger.cpp b/jan/src/burn/drv/cave/d_mazinger.cpp deleted file mode 100644 index e7d16770c..000000000 --- a/jan/src/burn/drv/cave/d_mazinger.cpp +++ /dev/null @@ -1,820 +0,0 @@ -// mazinger -#include "cave.h" -#include "msm6295.h" -#include "burn_ym2203.h" -#include "bitswap.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01, *RomZ80; -static UINT8 *Ram01, *RamZ80; -static UINT8 *MSM6295ROMSrc; -static UINT8 *DefEEPROM = NULL; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCyclesTotal[2]; -static INT32 nCyclesDone[2]; - -static INT32 SoundLatch; -static INT32 SoundLatchReply[48]; -static INT32 SoundLatchStatus; - -static INT32 SoundLatchReplyIndex; -static INT32 SoundLatchReplyMax; - -static UINT8 DrvZ80Bank; -static UINT8 DrvOkiBank1; -static UINT8 DrvOkiBank2; - -static struct BurnInputInfo mazingerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, -}; - -STDINPUTINFO(mazinger) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall mazingerReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x800002: - return (DrvInput[1] ^ 0xF7) | (EEPROMRead() << 3); - case 0x800003: - return (DrvInput[1] & 0xFF) ^ 0xFF; - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall mazingerWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - case 0x900000: - EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08); - break; - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - - } - } -} - -UINT16 __fastcall mazingerReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300000: - case 0x300002: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x300004: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x300006: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0x30006E: - if (SoundLatchReplyIndex > SoundLatchReplyMax) { - SoundLatchReplyIndex = 0; - SoundLatchReplyMax = -1; - return 0; - } - return SoundLatchReply[SoundLatchReplyIndex++]; - - case 0x800000: - return DrvInput[0] ^ 0xFFFF; - case 0x800002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall mazingerWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress >= 0x30000a && sekAddress <= 0x300066) return; - if (sekAddress >= 0x30006a && sekAddress <= 0x30006c) return; - if (sekAddress >= 0x300004 && sekAddress <= 0x300006) return; - - switch (sekAddress) { - case 0x300000: - nCaveXOffset = wordValue; - return; - case 0x300002: - nCaveYOffset = wordValue; - return; - - case 0x300008: -// CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - case 0x300068: - // Watchdog reset(?) - return; - case 0x30006e: - SoundLatch = wordValue; - SoundLatchStatus |= 0x0C; - - ZetNmi(); - nCyclesDone[1] += ZetRun(0x0400); - return; - - case 0x600000: - CaveTileReg[1][0] = wordValue; - break; - case 0x600002: - CaveTileReg[1][1] = wordValue; - break; - case 0x600004: - CaveTileReg[1][2] = wordValue; - break; - - case 0x700000: - CaveTileReg[0][0] = wordValue; - break; - case 0x700002: - CaveTileReg[0][1] = wordValue; - break; - case 0x700004: - CaveTileReg[0][2] = wordValue; - break; - - case 0x900000: - wordValue >>= 8; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - break; - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - - } - } -} - -void __fastcall mazingerWriteBytePalette(UINT32 sekAddress, UINT8 byteValue) -{ - CavePalWriteByte(sekAddress & 0xffff, byteValue); -} - -void __fastcall mazingerWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - CavePalWriteWord(sekAddress & 0xffff, wordValue); -} - -UINT8 __fastcall mazingerZIn(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x30: { - SoundLatchStatus |= 0x04; - return SoundLatch & 0xFF; - } - - case 0x52: { - return BurnYM2203Read(0, 0); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Read %x\n"), nAddress); - } - } - - return 0; -} - -void __fastcall mazingerZOut(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x00: { - DrvZ80Bank = nValue & 0x07; - - ZetMapArea(0x4000, 0x7FFF, 0, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7FFF, 2, RomZ80 + (DrvZ80Bank * 0x4000)); - return; - } - - case 0x10: - if (SoundLatchReplyIndex > SoundLatchReplyMax) { - SoundLatchReplyMax = -1; - SoundLatchReplyIndex = 0; - } - SoundLatchReplyMax++; - SoundLatchReply[SoundLatchReplyMax] = nValue; - break; - - case 0x50: { - BurnYM2203Write(0, 0, nValue); - return; - } - - case 0x51: { - BurnYM2203Write(0, 1, nValue); - return; - } - - case 0x70: { - MSM6295Command(0, nValue); - return; - } - - case 0x74: { - DrvOkiBank1 = (nValue >> 0) & 0x03; - DrvOkiBank2 = (nValue >> 4) & 0x03; - - memcpy(MSM6295ROM + 0x00000, MSM6295ROMSrc + 0x20000 * DrvOkiBank1, 0x20000); - memcpy(MSM6295ROM + 0x20000, MSM6295ROMSrc + 0x20000 * DrvOkiBank2, 0x20000); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write %x, %x\n"), nAddress, nValue); - } - } -} - -UINT8 __fastcall mazingerZRead(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall mazingerZWrite(UINT16 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - MSM6295Exit(0); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - ZetExit(); - - BurnYM2203Exit(); - - SoundLatch = 0; - DrvZ80Bank = 0; - DrvOkiBank1 = 0; - DrvOkiBank2 = 0; - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekRun(10000); // Need to run for a bit and reset to make it start - Watchdog would force reset? - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - MSM6295Reset(0); - - EEPROMReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - SoundLatch = 0; - DrvZ80Bank = 0; - DrvOkiBank1 = 0; - DrvOkiBank2 = 0; - - SoundLatch = 0; - SoundLatchStatus = 0x0C; - - memset(SoundLatchReply, 0, sizeof(SoundLatchReply)); - SoundLatchReplyIndex = 0; - SoundLatchReplyMax = -1; - - return 0; -} - -static INT32 DrvDraw() -{ - if (CaveRecalcPalette) { - CavePalUpdate8Bit(0x4400, 12); - CaveRecalcPalette = 1; - } - CavePalUpdate4Bit(0, 64); - - CaveClearScreen(CavePalette[0x3F00]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - - INT32 nInterleave = 80; - - INT32 nCyclesSegment; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 10; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesTotal[1] = (INT32)(4000000 / CAVE_REFRESHRATE); - nCyclesDone[0] = nCyclesDone[1] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nCurrentCPU = 0; - INT32 nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Run 68000 - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - CaveSpriteBuffer(); - UINT8 Temp = nCaveSpriteBank; - nCaveSpriteBank = nCaveSpriteBankDelay; - nCaveSpriteBankDelay = Temp; - - bVBlank = true; - nVideoIRQ = 0; - nUnknownIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - } - - SekClose(); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // 68K program - RomZ80 = Next; Next += 0x020000; - CaveSpriteROM = Next; Next += 0x800000; - CaveTileROM[0] = Next; Next += 0x400000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x400000; // Tile layer 1 - MSM6295ROM = Next; Next += 0x040000; - MSM6295ROMSrc = Next; Next += 0x080000; - DefEEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - RamZ80 = Next; Next += 0x001000; - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x010000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap1(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void NibbleSwap2(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[1] = *pOrg & 15; - pDest[0] = *pOrg >> 4; - } - - return; -} - -static INT32 LoadRoms() -{ - BurnLoadRom(Rom01 + 0x00000, 0, 1); - BurnLoadRom(Rom01 + 0x80000, 1, 1); - - BurnLoadRom(RomZ80, 2, 1); - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x400000); - BurnLoadRom(pTemp + 0x000000, 3, 1); - BurnLoadRom(pTemp + 0x200000, 4, 1); - for (INT32 i = 0; i < 0x400000; i++) { - CaveSpriteROM[i ^ 0xdf88] = pTemp[BITSWAP24(i,23,22,21,20,19,9,7,3,15,4,17,14,18,2,16,5,11,8,6,13,1,10,12,0)]; - } - BurnFree(pTemp); - NibbleSwap1(CaveSpriteROM, 0x400000); - - BurnLoadRom(CaveTileROM[0], 5, 1); - NibbleSwap2(CaveTileROM[0], 0x200000); - - pTemp = (UINT8*)BurnMalloc(0x200000); - BurnLoadRom(pTemp, 6, 1); - for (INT32 i = 0; i < 0x0100000; i++) { - CaveTileROM[1][(i << 1) + 1] = (pTemp[(i << 1) + 0] & 15) | ((pTemp[(i << 1) + 1] & 15) << 4); - CaveTileROM[1][(i << 1) + 0] = (pTemp[(i << 1) + 0] >> 4) | (pTemp[(i << 1) + 1] & 240); - } - BurnFree(pTemp); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROMSrc, 7, 1); - - BurnLoadRom(DefEEPROM, 8, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - SCAN_VAR(SoundLatch); - SCAN_VAR(DrvZ80Bank); - SCAN_VAR(DrvOkiBank1); - SCAN_VAR(DrvOkiBank2); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7FFF, 0, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7FFF, 2, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetClose(); - - memcpy(MSM6295ROM + 0x00000, MSM6295ROMSrc + 0x20000 * DrvOkiBank1, 0x20000); - memcpy(MSM6295ROM + 0x20000, MSM6295ROMSrc + 0x20000 * DrvOkiBank2, 0x20000); - - CaveRecalcPalette = 1; - } - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static INT32 drvZInit() -{ - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(mazingerZIn); - ZetSetOutHandler(mazingerZOut); - ZetSetReadHandler(mazingerZRead); - ZetSetWriteHandler(mazingerZWrite); - - // ROM bank 1 - ZetMapArea (0x0000, 0x3FFF, 0, RomZ80 + 0x0000); // Direct Read from ROM - ZetMapArea (0x0000, 0x3FFF, 2, RomZ80 + 0x0000); // Direct Fetch from ROM - // ROM bank 2 - ZetMapArea (0x4000, 0x7FFF, 0, RomZ80 + 0x4000); // Direct Read from ROM - ZetMapArea (0x4000, 0x7FFF, 2, RomZ80 + 0x4000); // - // RAM - ZetMapArea (0xc000, 0xc7FF, 0, RamZ80 + 0x0000); // Direct Read from RAM - ZetMapArea (0xc000, 0xc7FF, 1, RamZ80 + 0x0000); // Direct Write to RAM - ZetMapArea (0xc000, 0xc7FF, 2, RamZ80 + 0x0000); // - - ZetMapArea (0xf800, 0xffFF, 0, RamZ80 + 0x0800); // Direct Read from RAM - ZetMapArea (0xf800, 0xffFF, 1, RamZ80 + 0x0800); // Direct Write to RAM - ZetMapArea (0xf800, 0xffFF, 2, RamZ80 + 0x0800); // - ZetClose(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x200000, 0x20FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1] + 0x4000, 0x400000, 0x403FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1] + 0x4000, 0x404000, 0x407FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0] + 0x4000, 0x500000, 0x503FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0] + 0x4000, 0x504000, 0x507FFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0xC08000, 0xc087FF, MAP_RAM); // Palette RAM - SekMapMemory(CavePalSrc + 0x8800, 0xC08800, 0xC0FFFF, MAP_ROM); // Palette RAM (write goes through handler) - SekMapHandler(1, 0xC08800, 0xC0FFFF, MAP_WRITE); // - - SekMapMemory(Rom01 + 0x80000, 0xD00000, 0xD7FFFF, MAP_ROM); // CPU 0 ROM - - SekSetReadByteHandler(0, mazingerReadByte); - SekSetWriteByteHandler(0, mazingerWriteByte); - SekSetReadWordHandler(0, mazingerReadWord); - SekSetWriteWordHandler(0, mazingerWriteWord); - - SekSetWriteWordHandler(1, mazingerWriteWordPalette); - SekSetWriteByteHandler(1, mazingerWriteBytePalette); - SekClose(); - } - - drvZInit(); - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(2, 0x0800000); - CaveTileInitLayer(0, 0x400000, 8, 0x0000); - CaveTileInitLayer(1, 0x400000, 6, 0x4400); - - BurnYM2203Init(1, 4000000, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.60, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.20, BURN_SND_ROUTE_BOTH); - - memcpy(MSM6295ROM, MSM6295ROMSrc, 0x40000); - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 2.00, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&eeprom_interface_93C46); - if (!EEPROMAvailable()) EEPROMFill(DefEEPROM,0, 0x80); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo mazingerRomDesc[] = { - { "mzp-0.u24", 0x080000, 0x43a4279f, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "mzp-1.924", 0x080000, 0xdb40acba, BRF_ESS | BRF_PRG }, // 1 - - { "mzs.u21", 0x020000, 0xc5b4f7ed, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "bp943a-2.u56", 0x200000, 0x97e13959, BRF_GRA }, // 3 Sprite data - { "bp943a-3.u55", 0x080000, 0x9c4957dd, BRF_GRA }, // 4 - - { "bp943a-1.u60", 0x200000, 0x46327415, BRF_GRA }, // 5 Layer 0 Tile data - { "bp943a-0.u63", 0x200000, 0xc1fed98a, BRF_GRA }, // 6 Layer 1 Tile data - - { "bp943a-4.u64", 0x080000, 0x3fc7f29a, BRF_SND }, // 7 MSM6295 #1 ADPCM data - - { "mazinger_world.nv", 0x0080, 0x4f6225c6, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(mazinger) -STD_ROM_FN(mazinger) - -static struct BurnRomInfo mazingerjRomDesc[] = { - { "mzp-0.u24", 0x080000, 0x43a4279f, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "mzp-1.924", 0x080000, 0xdb40acba, BRF_ESS | BRF_PRG }, // 1 - - { "mzs.u21", 0x020000, 0xc5b4f7ed, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "bp943a-2.u56", 0x200000, 0x97e13959, BRF_GRA }, // 3 Sprite data - { "bp943a-3.u55", 0x080000, 0x9c4957dd, BRF_GRA }, // 4 - - { "bp943a-1.u60", 0x200000, 0x46327415, BRF_GRA }, // 5 Layer 0 Tile data - { "bp943a-0.u63", 0x200000, 0xc1fed98a, BRF_GRA }, // 6 Layer 1 Tile data - - { "bp943a-4.u64", 0x080000, 0x3fc7f29a, BRF_SND }, // 7 MSM6295 #1 ADPCM data - - { "mazinger_japan.nv", 0x0080, 0xf84a2a45, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(mazingerj) -STD_ROM_FN(mazingerj) - -struct BurnDriver BurnDrvmazinger = { - "mazinger", NULL, NULL, NULL, "1994", - "Mazinger Z (World, ver. 94/06/27)\0", NULL, "Banpresto / Dynamic Pl. Toei Animation", "Cave", - L"Mazinger Z\0\u30DE\u30B8\u30F3\u30AC\u30FC \uFF3A (World, ver. 94/06/27)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL |BDF_ORIENTATION_FLIPPED | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, mazingerRomInfo, mazingerRomName, NULL, NULL, mazingerInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvmazingerj = { - "mazingerj", "mazinger", NULL, NULL, "1994", - "Mazinger Z (Japan, ver. 94/06/27)\0", NULL, "Banpresto / Dynamic Pl. Toei Animation", "Cave", - L"Mazinger Z\0\u30DE\u30B8\u30F3\u30AC\u30FC \uFF3A (Japan, ver. 94/06/27)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL |BDF_ORIENTATION_FLIPPED | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, mazingerjRomInfo, mazingerjRomName, NULL, NULL, mazingerInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 384, 3, 4 -}; diff --git a/jan/src/burn/drv/cave/d_metmqstr.cpp b/jan/src/burn/drv/cave/d_metmqstr.cpp deleted file mode 100644 index 9410da5e2..000000000 --- a/jan/src/burn/drv/cave/d_metmqstr.cpp +++ /dev/null @@ -1,843 +0,0 @@ -// metmqstr -#include "cave.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01, *RomZ80; -static UINT8 *Ram01, *RamZ80; -static UINT8 *MSM6295ROMSrc1, *MSM6295ROMSrc2; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCyclesTotal[2]; -static INT32 nCyclesDone[2]; - -static INT32 SoundLatch; -static INT32 SoundLatchReply[48]; -static INT32 SoundLatchStatus; - -static INT32 SoundLatchReplyIndex; -static INT32 SoundLatchReplyMax; - -static UINT8 DrvZ80Bank; -static UINT8 DrvOkiBank1_1; -static UINT8 DrvOkiBank1_2; -static UINT8 DrvOkiBank2_1; -static UINT8 DrvOkiBank2_2; - -static struct BurnInputInfo metmqstrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 10, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 10, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, -}; - -STDINPUTINFO(metmqstr) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall metmqstrReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall metmqstrWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - if (~byteValue & 0x0100) { - case 0xd00000: - EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08); - break; - } - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - - } - } -} - -UINT16 __fastcall metmqstrReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xa80000: - case 0xa80002: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0xa80004: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0xa80006: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xa8006C: - if (SoundLatchReplyIndex > SoundLatchReplyMax) { - return 2; - } - return 0; - - case 0xa8006E: - if (SoundLatchReplyIndex > SoundLatchReplyMax) { - SoundLatchReplyIndex = 0; - SoundLatchReplyMax = -1; - return 0; - } - return SoundLatchReply[SoundLatchReplyIndex++]; - - case 0xc80000: - return DrvInput[0] ^ 0xFFFF; - case 0xc80002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall metmqstrWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress >= 0xa8000a && sekAddress <= 0xa80068) return; - if (sekAddress >= 0xa8006a && sekAddress <= 0xa8006c) return; - if (sekAddress >= 0xa80004 && sekAddress <= 0xa80006) return; - - switch (sekAddress) { - case 0xa80000: - nCaveXOffset = wordValue; - return; - case 0xa80002: - nCaveYOffset = wordValue; - return; - - case 0xa80008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0xa8006E: - SoundLatch = wordValue; - SoundLatchStatus |= 0x0C; - - ZetNmi(); - nCyclesDone[1] += ZetRun(0x0400); - return; - - case 0xb00000: - CaveTileReg[2][0] = wordValue; - break; - case 0xb00002: - CaveTileReg[2][1] = wordValue; - break; - case 0xb00004: - CaveTileReg[2][2] = wordValue; - break; - - case 0xb80000: - CaveTileReg[1][0] = wordValue; - break; - case 0xb80002: - CaveTileReg[1][1] = wordValue; - break; - case 0xb80004: - CaveTileReg[1][2] = wordValue; - break; - - case 0xc00000: - CaveTileReg[0][0] = wordValue; - break; - case 0xc00002: - CaveTileReg[0][1] = wordValue; - break; - case 0xc00004: - CaveTileReg[0][2] = wordValue; - break; - - case 0xd00000: - if (~wordValue & 0x0100) { - wordValue >>= 8; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - break; - } - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - - } - } -} - -UINT8 __fastcall metmqstrZIn(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x20: { - return 0; - } - - case 0x30: - SoundLatchStatus |= 0x04; - return SoundLatch & 0xFF; - - case 0x40: - SoundLatchStatus |= 0x08; - return SoundLatch >> 8; - - case 0x51: - return BurnYM2151ReadStatus(); - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Read %x\n"), nAddress); - } - } - - return 0; -} - -void __fastcall metmqstrZOut(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x00: { - DrvZ80Bank = nValue & 0x0f; - - ZetMapArea(0x4000, 0x7FFF, 0, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7FFF, 2, RomZ80 + (DrvZ80Bank * 0x4000)); - return; - } - - case 0x50: - BurnYM2151SelectRegister(nValue); - break; - case 0x51: - BurnYM2151WriteRegister(nValue); - break; - - case 0x60: { - MSM6295Command(0, nValue); - return; - } - - case 0x70: { - DrvOkiBank1_1 = (nValue >> 0) & 0x07; - DrvOkiBank1_2 = (nValue >> 4) & 0x07; - - memcpy(MSM6295ROM + 0x000000, MSM6295ROMSrc1 + 0x20000 * DrvOkiBank1_1, 0x20000); - memcpy(MSM6295ROM + 0x020000, MSM6295ROMSrc1 + 0x20000 * DrvOkiBank1_2, 0x20000); - return; - } - - case 0x80: { - MSM6295Command(1, nValue); - return; - } - - case 0x90: { - DrvOkiBank2_1 = (nValue >> 0) & 0x07; - DrvOkiBank2_2 = (nValue >> 4) & 0x07; - - memcpy(MSM6295ROM + 0x100000, MSM6295ROMSrc2 + 0x20000 * DrvOkiBank2_1, 0x20000); - memcpy(MSM6295ROM + 0x120000, MSM6295ROMSrc2 + 0x20000 * DrvOkiBank2_2, 0x20000); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write %x, %x\n"), nAddress, nValue); - } - } -} - -UINT8 __fastcall metmqstrZRead(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall metmqstrZWrite(UINT16 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - MSM6295Exit(1); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - ZetExit(); - - SoundLatch = 0; - DrvZ80Bank = 0; - DrvOkiBank1_1 = 0; - DrvOkiBank1_2 = 0; - DrvOkiBank2_1 = 0; - DrvOkiBank2_2 = 0; - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekRun(10000); // Need to run for a bit and reset to make it start - Watchdog would force reset? - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - MSM6295Reset(1); - - EEPROMReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - SoundLatch = 0; - DrvZ80Bank = 0; - DrvOkiBank1_1 = 0; - DrvOkiBank1_2 = 0; - DrvOkiBank2_1 = 0; - DrvOkiBank2_2 = 0; - - SoundLatch = 0; - SoundLatchStatus = 0x0C; - - memset(SoundLatchReply, 0, sizeof(SoundLatchReply)); - SoundLatchReplyIndex = 0; - SoundLatchReplyMax = -1; - - return 0; -} - -static INT32 DrvDraw() -{ - CavePalUpdate4Bit(0, 128); - - CaveClearScreen(CavePalette[0x7F00]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - INT32 nSoundBufferPos = 0; - - INT32 nCyclesSegment; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 11; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesTotal[1] = (INT32)(8000000 / CAVE_REFRESHRATE); - nCyclesDone[0] = nCyclesDone[1] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nCurrentCPU = 0; - INT32 nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Run 68000 - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - UINT8 Temp = nCaveSpriteBank; - nCaveSpriteBank = nCaveSpriteBankDelay; - nCaveSpriteBankDelay = Temp; - - bVBlank = true; - nVideoIRQ = 0; - nUnknownIRQ = 0; - UpdateIRQStatus(); - } - - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - - SekClose(); - ZetClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x180000; // 68K program - RomZ80 = Next; Next += 0x040000; - CaveSpriteROM = Next; Next += 0x1000000; - CaveTileROM[0] = Next; Next += 0x400000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x400000; // Tile layer 1 - CaveTileROM[2] = Next; Next += 0x400000; // Tile layer 2 - MSM6295ROM = Next; Next += 0x140000; - MSM6295ROMSrc1 = Next; Next += 0x200000; - MSM6295ROMSrc2 = Next; Next += 0x200000; - RamStart = Next; - Ram01 = Next; Next += 0x018000; // CPU #0 work RAM - RamZ80 = Next; Next += 0x002000; - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveTileRAM[2] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x010000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap1(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void NibbleSwap2(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[1] = *pOrg & 15; - pDest[0] = *pOrg >> 4; - } - - return; -} - -static INT32 LoadRoms() -{ - BurnLoadRom(Rom01 + 0x000000, 0, 1); - BurnLoadRom(Rom01 + 0x080000, 1, 1); - BurnLoadRom(Rom01 + 0x100000, 2, 1); - - BurnLoadRom(RomZ80, 3, 1); - - BurnLoadRom(CaveSpriteROM + 0x000000, 4, 1); - BurnLoadRom(CaveSpriteROM + 0x200000, 5, 1); - BurnLoadRom(CaveSpriteROM + 0x400000, 6, 1); - BurnLoadRom(CaveSpriteROM + 0x600000, 7, 1); - NibbleSwap1(CaveSpriteROM, 0x800000); - - BurnLoadRom(CaveTileROM[0], 8, 1); - NibbleSwap2(CaveTileROM[0], 0x200000); - - BurnLoadRom(CaveTileROM[1], 9, 1); - NibbleSwap2(CaveTileROM[1], 0x200000); - - BurnLoadRom(CaveTileROM[2], 10, 1); - NibbleSwap2(CaveTileROM[2], 0x200000); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROMSrc1, 11, 1); - BurnLoadRom(MSM6295ROMSrc2, 12, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - SCAN_VAR(SoundLatch); - SCAN_VAR(DrvZ80Bank); - SCAN_VAR(DrvOkiBank1_1); - SCAN_VAR(DrvOkiBank1_2); - SCAN_VAR(DrvOkiBank2_1); - SCAN_VAR(DrvOkiBank2_2); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7FFF, 0, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7FFF, 2, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetClose(); - - memcpy(MSM6295ROM + 0x000000, MSM6295ROMSrc1 + 0x20000 * DrvOkiBank1_1, 0x20000); - memcpy(MSM6295ROM + 0x020000, MSM6295ROMSrc1 + 0x20000 * DrvOkiBank1_2, 0x20000); - - memcpy(MSM6295ROM + 0x100000, MSM6295ROMSrc2 + 0x20000 * DrvOkiBank2_1, 0x20000); - memcpy(MSM6295ROM + 0x120000, MSM6295ROMSrc2 + 0x20000 * DrvOkiBank2_2, 0x20000); - - CaveRecalcPalette = 1; - } - } - - return 0; -} - -static INT32 drvZInit() -{ - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(metmqstrZIn); - ZetSetOutHandler(metmqstrZOut); - ZetSetReadHandler(metmqstrZRead); - ZetSetWriteHandler(metmqstrZWrite); - - // ROM bank 1 - ZetMapArea (0x0000, 0x3FFF, 0, RomZ80 + 0x0000); // Direct Read from ROM - ZetMapArea (0x0000, 0x3FFF, 2, RomZ80 + 0x0000); // Direct Fetch from ROM - // ROM bank 2 - ZetMapArea (0x4000, 0x7FFF, 0, RomZ80 + 0x4000); // Direct Read from ROM - ZetMapArea (0x4000, 0x7FFF, 2, RomZ80 + 0x4000); // - // RAM - ZetMapArea (0xe000, 0xFFFF, 0, RamZ80 + 0x0000); // Direct Read from RAM - ZetMapArea (0xe000, 0xFFFF, 1, RamZ80 + 0x0000); // Direct Write to RAM - ZetMapArea (0xe000, 0xFFFF, 2, RamZ80 + 0x0000); // - ZetClose(); - - return 0; -} - -static void DrvYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Rom01 + 0x080000, 0x100000, 0x17FFFF, MAP_ROM); - SekMapMemory(Rom01 + 0x100000, 0x200000, 0x27FFFF, MAP_ROM); - SekMapMemory(CaveTileRAM[2], 0x880000, 0x887FFF, MAP_RAM); - SekMapMemory(Ram01 + 0x00000, 0x888000, 0x88FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x900000, 0x907FFF, MAP_RAM); - SekMapMemory(Ram01 + 0x08000, 0x908000, 0x90FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x980000, 0x987FFF, MAP_RAM); - SekMapMemory(Ram01 + 0x10000, 0x988000, 0x98FFFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0x408000, 0x408FFF, MAP_RAM); // Palette RAM - SekMapMemory(CaveSpriteRAM, 0xF00000, 0xF0FFFF, MAP_RAM); - SekSetReadByteHandler(0, metmqstrReadByte); - SekSetWriteByteHandler(0, metmqstrWriteByte); - SekSetReadWordHandler(0, metmqstrReadWord); - SekSetWriteWordHandler(0, metmqstrWriteWord); - SekClose(); - } - - drvZInit(); - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(2, 0x1000000); - CaveTileInitLayer(0, 0x400000, 8, 0x4000); - CaveTileInitLayer(1, 0x400000, 8, 0x4000); - CaveTileInitLayer(2, 0x400000, 8, 0x4000); - - nCaveExtraXOffset = -126; - CaveSpriteVisibleXOffset = -126; - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.20, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.20, BURN_SND_ROUTE_RIGHT); - - memcpy(MSM6295ROM, MSM6295ROMSrc1, 0x40000); - memcpy(MSM6295ROM + 0x100000, MSM6295ROMSrc2, 0x40000); - MSM6295Init(0, 2000000 / 132, 1); - MSM6295Init(1, 2000000 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo metmqstrRomDesc[] = { - { "bp947a.u25", 0x080000, 0x0a5c3442, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp947a.u28", 0x080000, 0x8c55decf, BRF_ESS | BRF_PRG }, // 1 - { "bp947a.u29", 0x080000, 0xcf0f3f3b, BRF_ESS | BRF_PRG }, // 2 - - { "bp947a.u20", 0x040000, 0xa4a36170, BRF_ESS | BRF_PRG }, // 3 Z80 Code - - { "bp947a.u49", 0x200000, 0x09749531, BRF_GRA }, // 4 Sprite data - { "bp947a.u50", 0x200000, 0x19cea8b2, BRF_GRA }, // 5 - { "bp947a.u51", 0x200000, 0xc19bed67, BRF_GRA }, // 6 - { "bp947a.u52", 0x200000, 0x70c64875, BRF_GRA }, // 7 - - { "bp947a.u48", 0x200000, 0x04ff6a3d, BRF_GRA }, // 8 Layer 0 Tile data - { "bp947a.u47", 0x200000, 0x0de42827, BRF_GRA }, // 9 Layer 2 Tile data - { "bp947a.u46", 0x200000, 0x0f9c906e, BRF_GRA }, // 10 Layer 2 Tile data - - { "bp947a.u42", 0x200000, 0x2ce8ff2a, BRF_SND }, // 11 MSM6295 #1 ADPCM data - { "bp947a.u37", 0x200000, 0xc3077c8f, BRF_SND }, // 12 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(metmqstr) -STD_ROM_FN(metmqstr) - -static struct BurnRomInfo nmasterRomDesc[] = { - { "bp947a_n.u25", 0x080000, 0x748cc514, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp947a.u28", 0x080000, 0x8c55decf, BRF_ESS | BRF_PRG }, // 1 - { "bp947a.u29", 0x080000, 0xcf0f3f3b, BRF_ESS | BRF_PRG }, // 2 - - { "bp947a.u20", 0x040000, 0xa4a36170, BRF_ESS | BRF_PRG }, // 3 Z80 Code - - { "bp947a.u49", 0x200000, 0x09749531, BRF_GRA }, // 4 Sprite data - { "bp947a.u50", 0x200000, 0x19cea8b2, BRF_GRA }, // 5 - { "bp947a.u51", 0x200000, 0xc19bed67, BRF_GRA }, // 6 - { "bp947a.u52", 0x200000, 0x70c64875, BRF_GRA }, // 7 - - { "bp947a.u48", 0x200000, 0x04ff6a3d, BRF_GRA }, // 8 Layer 0 Tile data - { "bp947a.u47", 0x200000, 0x0de42827, BRF_GRA }, // 9 Layer 2 Tile data - { "bp947a.u46", 0x200000, 0x0f9c906e, BRF_GRA }, // 10 Layer 2 Tile data - - { "bp947a.u42", 0x200000, 0x2ce8ff2a, BRF_SND }, // 11 MSM6295 #1 ADPCM data - { "bp947a.u37", 0x200000, 0xc3077c8f, BRF_SND }, // 12 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(nmaster) -STD_ROM_FN(nmaster) - -struct BurnDriver BurnDrvmetmqstr = { - "metmqstr", NULL, NULL, NULL, "1995", - "Metamoqester (International)\0", NULL, "Banpresto / Pandorabox", "Cave", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VSFIGHT, 0, - NULL, metmqstrRomInfo, metmqstrRomName, NULL, NULL, metmqstrInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvnmaster = { - "nmaster", "metmqstr", NULL, NULL, "1995", - "Oni - The Ninja Master (Japan)\0", NULL, "Banpresto / Pandorabox", "Cave", - L"\u7A4F\u5FCD - The Ninja Master (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAVE_68K_Z80, GBF_VSFIGHT, 0, - NULL, nmasterRomInfo, nmasterRomName, NULL, NULL, metmqstrInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 384, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/cave/d_pwrinst2.cpp b/jan/src/burn/drv/cave/d_pwrinst2.cpp deleted file mode 100644 index b15cc1256..000000000 --- a/jan/src/burn/drv/cave/d_pwrinst2.cpp +++ /dev/null @@ -1,1145 +0,0 @@ -// pwrinst2 -#include "cave.h" -#include "msm6295.h" -#include "burn_ym2203.h" -#include "nmk112.h" -#include "bitswap.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01, *RomZ80; -static UINT8 *Ram01, *RamZ80; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCyclesTotal[2]; -static INT32 nCyclesDone[2]; - -static INT32 SoundLatch; -static INT32 SoundLatchReply[48]; -static INT32 SoundLatchStatus; - -static INT32 SoundLatchReplyIndex; -static INT32 SoundLatchReplyMax; - -static UINT8 DrvZ80Bank; - -static struct BurnInputInfo pwrinst2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 10, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 10, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, -}; - -STDINPUTINFO(pwrinst2) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall pwrinst2ReadByte(UINT32 sekAddress) -{ - if (sekAddress >= 0x600000 && sekAddress <= 0x6fffff) return 0; - - switch (sekAddress) { - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall pwrinst2WriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - - } - } -} - -UINT16 __fastcall pwrinst2ReadWord(UINT32 sekAddress) -{ - if (sekAddress >= 0x600000 && sekAddress <= 0x6fffff) return 0; - - switch (sekAddress) { - case 0x500000: - return DrvInput[0] ^ 0xFFFF; - case 0x500002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - case 0xa80000: - case 0xa80002: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - - case 0xa80004: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0xa80006: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xd80000: { - if (SoundLatchReplyIndex > SoundLatchReplyMax) { - SoundLatchReplyIndex = 0; - SoundLatchReplyMax = -1; - return 0; - } - return SoundLatchReply[SoundLatchReplyIndex++]; - } - - case 0xe80000: { - return ~8 + ((EEPROMRead() & 1) ? 8 : 0); - } - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall pwrinst2WriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress >= 0xa8000a && sekAddress <= 0xa8007c) return; - if (sekAddress >= 0xa80004 && sekAddress <= 0xa80006) return; - - switch (sekAddress) { - case 0x700000: - wordValue >>= 8; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - break; - - case 0xa80000: - nCaveXOffset = wordValue; - return; - case 0xa80002: - nCaveYOffset = wordValue; - return; - - case 0xa80008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0xb00000: - CaveTileReg[2][0] = wordValue; - break; - case 0xb00002: - CaveTileReg[2][1] = wordValue; - break; - case 0xb00004: { - switch (wordValue & 0x0f) { - case 1: wordValue = (wordValue & ~0x000f) | 0; break; - case 2: wordValue = (wordValue & ~0x000f) | 1; break; - case 4: wordValue = (wordValue & ~0x000f) | 2; break; - default: - case 8: wordValue = (wordValue & ~0x000f) | 3; break; - } - CaveTileReg[2][2] = wordValue; - break; - } - - case 0xb80000: - CaveTileReg[0][0] = wordValue; - break; - case 0xb80002: - CaveTileReg[0][1] = wordValue; - break; - case 0xb80004: { - switch (wordValue & 0x0f) { - case 1: wordValue = (wordValue & ~0x000f) | 0; break; - case 2: wordValue = (wordValue & ~0x000f) | 1; break; - case 4: wordValue = (wordValue & ~0x000f) | 2; break; - default: - case 8: wordValue = (wordValue & ~0x000f) | 3; break; - } - CaveTileReg[0][2] = wordValue; - break; - } - - case 0xc00000: - CaveTileReg[1][0] = wordValue; - break; - case 0xc00002: - CaveTileReg[1][1] = wordValue; - break; - case 0xc00004: { - switch (wordValue & 0x0f) { - case 1: wordValue = (wordValue & ~0x000f) | 0; break; - case 2: wordValue = (wordValue & ~0x000f) | 1; break; - case 4: wordValue = (wordValue & ~0x000f) | 2; break; - default: - case 8: wordValue = (wordValue & ~0x000f) | 3; break; - } - CaveTileReg[1][2] = wordValue; - break; - } - - case 0xc80000: - CaveTileReg[3][0] = wordValue; - break; - case 0xc80002: - CaveTileReg[3][1] = wordValue; - break; - case 0xc80004: { - switch (wordValue & 0x0f) { - case 1: wordValue = (wordValue & ~0x000f) | 0; break; - case 2: wordValue = (wordValue & ~0x000f) | 1; break; - case 4: wordValue = (wordValue & ~0x000f) | 2; break; - default: - case 8: wordValue = (wordValue & ~0x000f) | 3; break; - } - CaveTileReg[3][2] = wordValue; - break; - } - - case 0xe00000: { - SoundLatch = wordValue; - SoundLatchStatus |= 0x0C; - - ZetNmi(); -// nCyclesDone[1] += ZetRun(0x0400); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - - } - } -} - -UINT8 __fastcall pwrinst2ZIn(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x00: { - return MSM6295ReadStatus(0); - } - - case 0x08: { - return MSM6295ReadStatus(1); - } - - case 0x40: { - return BurnYM2203Read(0, 0); - } - - case 0x41: { - return BurnYM2203Read(0, 1); - } - - case 0x60: { - SoundLatchStatus |= 0x08; - return SoundLatch >> 8; - } - - case 0x70: { - SoundLatchStatus |= 0x04; - return SoundLatch & 0xFF; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Read %x\n"), nAddress); - } - } - - return 0; -} - -void __fastcall pwrinst2ZOut(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x00: { - MSM6295Command(0, nValue); - return; - } - - case 0x08: { - MSM6295Command(1, nValue); - return; - } - - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x15: - case 0x16: - case 0x17: { - NMK112_okibank_write(nAddress & 0x07, nValue); - return; - } - - case 0x40: { - BurnYM2203Write(0, 0, nValue); - return; - } - - case 0x41: { - BurnYM2203Write(0, 1, nValue); - return; - } - - case 0x50: { - if (SoundLatchReplyIndex > SoundLatchReplyMax) { - SoundLatchReplyMax = -1; - SoundLatchReplyIndex = 0; - } - SoundLatchReplyMax++; - SoundLatchReply[SoundLatchReplyMax] = nValue; - return; - } - - case 0x51: { - //??? - return; - } - - case 0x80: { - DrvZ80Bank = nValue & 0x07; - - ZetMapArea(0x8000, 0xbFFF, 0, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x8000, 0xbFFF, 2, RomZ80 + (DrvZ80Bank * 0x4000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write %x, %x\n"), nAddress, nValue); - } - } -} - -UINT8 __fastcall pwrinst2ZRead(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall pwrinst2ZWrite(UINT16 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - MSM6295Exit(0); - MSM6295Exit(1); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - ZetExit(); - - BurnYM2203Exit(); - - SoundLatch = 0; - DrvZ80Bank = 0; - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - MSM6295Reset(0); - MSM6295Reset(1); - - EEPROMReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - SoundLatch = 0; - SoundLatchStatus = 0x0C; - - memset(SoundLatchReply, 0, sizeof(SoundLatchReply)); - SoundLatchReplyIndex = 0; - SoundLatchReplyMax = -1; - - DrvZ80Bank = 0; - NMK112Reset(); - - return 0; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x03E0) >> 2; // Red - r |= r >> 5; - g = (nColour & 0x7C00) >> 7; // Green - g |= g >> 5; - b = (nColour & 0x001F) << 3; // Blue - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)CavePalSrc, pd = CavePalette; i < 0x2800; i++, ps++, pd++) { - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*ps)); - } -} - -static INT32 DrvDraw() -{ - CavePalUpdate4Bit(0, 128); - DrvCalcPalette(); - - CaveClearScreen(CavePalette[0x7f00]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 100; - - INT32 nCyclesSegment; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 11; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesTotal[1] = (INT32)(8000000 / CAVE_REFRESHRATE); - nCyclesDone[0] = nCyclesDone[1] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nCurrentCPU = 0; - INT32 nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Run 68000 - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - -// CaveSpriteBuffer(); - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - } - - SekClose(); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x300000; // 68K program - RomZ80 = Next; Next += 0x040000; - CaveSpriteROM = Next; Next += 0x1000000 * 2; - CaveTileROM[0] = Next; Next += 0x400000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x400000; // Tile layer 1 - CaveTileROM[2] = Next; Next += 0x400000; // Tile layer 2 - CaveTileROM[3] = Next; Next += 0x200000; // Tile layer 3 - MSM6295ROM = Next; Next += 0x800000; - RamStart = Next; - Ram01 = Next; Next += 0x028000; // CPU #0 work RAM - RamZ80 = Next; Next += 0x002000; - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveTileRAM[2] = Next; Next += 0x008000; - CaveTileRAM[3] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x008000; - CavePalSrc = Next; Next += 0x005000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap1(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void NibbleSwap2(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[1] = *pOrg & 15; - pDest[0] = *pOrg >> 4; - } - - return; -} - -static INT32 LoadRoms() -{ - BurnLoadRom(Rom01 + 0x000001, 0, 2); - BurnLoadRom(Rom01 + 0x000000, 1, 2); - BurnLoadRom(Rom01 + 0x100001, 2, 2); - BurnLoadRom(Rom01 + 0x100000, 3, 2); - - BurnLoadRom(RomZ80, 4, 1); - - UINT8 *pTemp = (UINT8*)BurnMalloc(0xe00000); - BurnLoadRom(pTemp + 0x000000, 5, 1); - BurnLoadRom(pTemp + 0x200000, 6, 1); - BurnLoadRom(pTemp + 0x400000, 7, 1); - BurnLoadRom(pTemp + 0x600000, 8, 1); - BurnLoadRom(pTemp + 0x800000, 9, 1); - BurnLoadRom(pTemp + 0xa00000, 10, 1); - BurnLoadRom(pTemp + 0xc00000, 11, 1); - for (INT32 i = 0; i < 0xe00000; i++) { - INT32 j = BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7, 2,4,6,1,5,3, 0); - if (((j & 6) == 0) || ((j & 6) == 6)) j ^= 6; - CaveSpriteROM[j ^ 7] = (pTemp[i] >> 4) | (pTemp[i] << 4); - } - BurnFree(pTemp); - NibbleSwap1(CaveSpriteROM, 0xe00000); - - BurnLoadRom(CaveTileROM[0], 12, 1); - NibbleSwap2(CaveTileROM[0], 0x200000); - BurnLoadRom(CaveTileROM[1], 13, 1); - NibbleSwap2(CaveTileROM[1], 0x100000); - BurnLoadRom(CaveTileROM[2], 14, 1); - NibbleSwap2(CaveTileROM[2], 0x100000); - BurnLoadRom(CaveTileROM[3], 15, 1); - NibbleSwap2(CaveTileROM[3], 0x080000); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROM + 0x000000, 16, 1); - BurnLoadRom(MSM6295ROM + 0x200000, 17, 1); - BurnLoadRom(MSM6295ROM + 0x400000, 18, 1); - BurnLoadRom(MSM6295ROM + 0x600000, 19, 1); - - return 0; -} - -static INT32 PlegendsLoadRoms() -{ - BurnLoadRom(Rom01 + 0x000001, 0, 2); - BurnLoadRom(Rom01 + 0x000000, 1, 2); - BurnLoadRom(Rom01 + 0x100001, 2, 2); - BurnLoadRom(Rom01 + 0x100000, 3, 2); - BurnLoadRom(Rom01 + 0x200001, 4, 2); - BurnLoadRom(Rom01 + 0x200000, 5, 2); - - BurnLoadRom(RomZ80, 6, 1); - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x1000000); - BurnLoadRom(pTemp + 0x000000, 7, 1); - BurnLoadRom(pTemp + 0x200000, 8, 1); - BurnLoadRom(pTemp + 0x400000, 9, 1); - BurnLoadRom(pTemp + 0x600000, 10, 1); - BurnLoadRom(pTemp + 0x800000, 11, 1); - BurnLoadRom(pTemp + 0xa00000, 12, 1); - BurnLoadRom(pTemp + 0xc00000, 13, 1); - BurnLoadRom(pTemp + 0xe00000, 14, 1); - for (INT32 i = 0; i < 0x1000000; i++) { - INT32 j = BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7, 2,4,6,1,5,3, 0); - if (((j & 6) == 0) || ((j & 6) == 6)) j ^= 6; - CaveSpriteROM[j ^ 7] = (pTemp[i] >> 4) | (pTemp[i] << 4); - } - BurnFree(pTemp); - NibbleSwap1(CaveSpriteROM, 0x1000000); - - BurnLoadRom(CaveTileROM[0], 15, 1); - NibbleSwap2(CaveTileROM[0], 0x200000); - BurnLoadRom(CaveTileROM[1], 16, 1); - NibbleSwap2(CaveTileROM[1], 0x200000); - BurnLoadRom(CaveTileROM[2], 17, 1); - NibbleSwap2(CaveTileROM[2], 0x200000); - BurnLoadRom(CaveTileROM[3], 18, 1); - NibbleSwap2(CaveTileROM[3], 0x080000); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROM + 0x000000, 19, 1); - BurnLoadRom(MSM6295ROM + 0x200000, 20, 1); - BurnLoadRom(MSM6295ROM + 0x400000, 21, 1); - BurnLoadRom(MSM6295ROM + 0x600000, 22, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029719; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - NMK112_Scan(nAction); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - SCAN_VAR(SoundLatch); - SCAN_VAR(DrvZ80Bank); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbFFF, 0, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x8000, 0xbFFF, 2, RomZ80 + (DrvZ80Bank * 0x4000)); - ZetClose(); - - CaveRecalcPalette = 1; - } - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 8000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 8000000; -} - -static INT32 drvZInit() -{ - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(pwrinst2ZIn); - ZetSetOutHandler(pwrinst2ZOut); - ZetSetReadHandler(pwrinst2ZRead); - ZetSetWriteHandler(pwrinst2ZWrite); - - // ROM bank 1 - ZetMapArea (0x0000, 0x7FFF, 0, RomZ80 + 0x0000); // Direct Read from ROM - ZetMapArea (0x0000, 0x7FFF, 2, RomZ80 + 0x0000); // Direct Fetch from ROM - // ROM bank 2 - ZetMapArea (0x8000, 0xbFFF, 0, RomZ80 + 0x8000); // Direct Read from ROM - ZetMapArea (0x8000, 0xbFFF, 2, RomZ80 + 0x8000); // - // RAM - ZetMapArea (0xE000, 0xFFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0xE000, 0xFFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0xE000, 0xFFFF, 2, RamZ80); // - ZetClose(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x400000, 0x40FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2], 0x800000, 0x807FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x880000, 0x887FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x900000, 0x907FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[3] + 0x4000, 0x980000, 0x983FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[3] + 0x4000, 0x984000, 0x987FFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0xa00000, 0xa07FFF, MAP_RAM); - SekMapMemory(Ram01 + 0x10000, 0xa08000, 0xa1FFFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0xf00000, 0xf04FFF, MAP_RAM); // Palette RAM - SekSetReadWordHandler(0, pwrinst2ReadWord); - SekSetWriteWordHandler(0, pwrinst2WriteWord); - SekSetReadByteHandler(0, pwrinst2ReadByte); - SekSetWriteByteHandler(0, pwrinst2WriteByte); - SekClose(); - } - - drvZInit(); - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(3, 0x0e00000 * 2); - CaveTileInitLayer(0, 0x400000, 4, 0x0800); - CaveTileInitLayer(1, 0x200000, 4, 0x1000); - CaveTileInitLayer(2, 0x200000, 4, 0x1800); - CaveTileInitLayer(3, 0x100000, 4, 0x2000); - - nCaveExtraXOffset = -112; - nCaveExtraYOffset = 1; - - BurnYM2203Init(1, 4000000, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(8000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 3000000 / 165, 1); - MSM6295Init(1, 3000000 / 165, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - NMK112_init(0, MSM6295ROM, MSM6295ROM + 0x400000, 0x400000, 0x400000); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "pwrinst2")) { - UINT16 *rom = (UINT16 *)Rom01; - rom[0xD46C/2] = 0xD482; // kurara dash fix 0xd400 -> 0xd482 - } - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -static INT32 PlegendsInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (PlegendsLoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x400000, 0x40FFFF, MAP_RAM); - SekMapMemory(Rom01 + 0x200000, 0x600000, 0x6FFFFF, MAP_ROM); - SekMapMemory(CaveTileRAM[2], 0x800000, 0x807FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x880000, 0x887FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x900000, 0x907FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[3] + 0x4000, 0x980000, 0x983FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[3] + 0x4000, 0x984000, 0x987FFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0xa00000, 0xa07FFF, MAP_RAM); - SekMapMemory(Ram01 + 0x10000, 0xa08000, 0xa1FFFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0xf00000, 0xf04FFF, MAP_RAM); // Palette RAM - SekSetReadWordHandler(0, pwrinst2ReadWord); - SekSetWriteWordHandler(0, pwrinst2WriteWord); - SekSetReadByteHandler(0, pwrinst2ReadByte); - SekSetWriteByteHandler(0, pwrinst2WriteByte); - SekClose(); - } - - drvZInit(); - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(3, 0x01000000 * 2); - CaveTileInitLayer(0, 0x400000, 4, 0x0800); - CaveTileInitLayer(1, 0x400000, 4, 0x1000); - CaveTileInitLayer(2, 0x400000, 4, 0x1800); - CaveTileInitLayer(3, 0x100000, 4, 0x2000); - - nCaveExtraXOffset = -112; - nCaveExtraYOffset = 1; - - BurnYM2203Init(1, 4000000, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(8000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 3000000 / 165, 1); - MSM6295Init(1, 3000000 / 165, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo pwrinst2RomDesc[] = { - { "g02.u45", 0x080000, 0x7b33bc43, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "g02.u44", 0x080000, 0x8f6f6637, BRF_ESS | BRF_PRG }, // 1 - { "g02.u43", 0x080000, 0x178e3d24, BRF_ESS | BRF_PRG }, // 2 - { "g02.u42", 0x080000, 0xa0b4ee99, BRF_ESS | BRF_PRG }, // 3 - - { "g02.u3a", 0x020000, 0xebea5e1e, BRF_ESS | BRF_PRG }, // 4 Z80 Code - - { "g02.u61", 0x200000, 0x91e30398, BRF_GRA }, // 5 Sprite data - { "g02.u62", 0x200000, 0xd9455dd7, BRF_GRA }, // 6 - { "g02.u63", 0x200000, 0x4d20560b, BRF_GRA }, // 7 - { "g02.u64", 0x200000, 0xb17b9b6e, BRF_GRA }, // 8 - { "g02.u65", 0x200000, 0x08541878, BRF_GRA }, // 9 - { "g02.u66", 0x200000, 0xbecf2a36, BRF_GRA }, // 10 - { "g02.u67", 0x200000, 0x52fe2b8b, BRF_GRA }, // 11 - - { "g02.u78", 0x200000, 0x1eca63d2, BRF_GRA }, // 12 Layer 0 Tile data - { "g02.u81", 0x100000, 0x8a3ff685, BRF_GRA }, // 13 Layer 1 Tile data - { "g02.u89", 0x100000, 0x373e1f73, BRF_GRA }, // 14 Layer 2 Tile data - { "g02.82a", 0x080000, 0x4b3567d6, BRF_GRA }, // 15 Layer 3 Tile data - - { "g02.u53", 0x200000, 0xc4bdd9e0, BRF_SND }, // 16 MSM6295 #1 ADPCM data - { "g02.u54", 0x200000, 0x1357d50e, BRF_SND }, // 17 - { "g02.u55", 0x200000, 0x2d102898, BRF_SND }, // 18 MSM6295 #2 ADPCM data - { "g02.u56", 0x200000, 0x9ff50dda, BRF_SND }, // 19 -}; - - -STD_ROM_PICK(pwrinst2) -STD_ROM_FN(pwrinst2) - -static struct BurnRomInfo pwrinst2jRomDesc[] = { - { "g02j.u45", 0x080000, 0x42d0abd7, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "g02j.u44", 0x080000, 0x362b7af3, BRF_ESS | BRF_PRG }, // 1 - { "g02j.u43", 0x080000, 0xc94c596b, BRF_ESS | BRF_PRG }, // 2 - { "g02j.u42", 0x080000, 0x4f4c8270, BRF_ESS | BRF_PRG }, // 3 - - { "g02j.u3a", 0x020000, 0xeead01f1, BRF_ESS | BRF_PRG }, // 4 Z80 Code - - { "g02.u61", 0x200000, 0x91e30398, BRF_GRA }, // 5 Sprite data - { "g02.u62", 0x200000, 0xd9455dd7, BRF_GRA }, // 6 - { "g02.u63", 0x200000, 0x4d20560b, BRF_GRA }, // 7 - { "g02.u64", 0x200000, 0xb17b9b6e, BRF_GRA }, // 8 - { "g02.u65", 0x200000, 0x08541878, BRF_GRA }, // 9 - { "g02.u66", 0x200000, 0xbecf2a36, BRF_GRA }, // 10 - { "g02.u67", 0x200000, 0x52fe2b8b, BRF_GRA }, // 11 - - { "g02.u78", 0x200000, 0x1eca63d2, BRF_GRA }, // 12 Layer 0 Tile data - { "g02.u81", 0x100000, 0x8a3ff685, BRF_GRA }, // 13 Layer 1 Tile data - { "g02.u89", 0x100000, 0x373e1f73, BRF_GRA }, // 14 Layer 2 Tile data - { "g02j.82a", 0x080000, 0x3be86fe1, BRF_GRA }, // 15 Layer 3 Tile data - - { "g02.u53", 0x200000, 0xc4bdd9e0, BRF_SND }, // 16 MSM6295 #1 ADPCM data - { "g02.u54", 0x200000, 0x1357d50e, BRF_SND }, // 17 - { "g02.u55", 0x200000, 0x2d102898, BRF_SND }, // 18 MSM6295 #2 ADPCM data - { "g02.u56", 0x200000, 0x9ff50dda, BRF_SND }, // 19 -}; - - -STD_ROM_PICK(pwrinst2j) -STD_ROM_FN(pwrinst2j) - -static struct BurnRomInfo plegendsRomDesc[] = { - { "d12.u45", 0x080000, 0xed8a2e3d, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "d13.u44", 0x080000, 0x25821731, BRF_ESS | BRF_PRG }, // 1 - { "d14.u2", 0x080000, 0xc2cb1402, BRF_ESS | BRF_PRG }, // 2 - { "d16.u3", 0x080000, 0x50a1c63e, BRF_ESS | BRF_PRG }, // 3 - { "d15.u4", 0x080000, 0x6352cec0, BRF_ESS | BRF_PRG }, // 4 - { "d17.u5", 0x080000, 0x7af810d8, BRF_ESS | BRF_PRG }, // 5 - - { "d19.u3", 0x040000, 0x47598459, BRF_ESS | BRF_PRG }, // 6 Z80 Code - - { "g02.u61", 0x200000, 0x91e30398, BRF_GRA }, // 7 Sprite data - { "g02.u62", 0x200000, 0xd9455dd7, BRF_GRA }, // 8 - { "g02.u63", 0x200000, 0x4d20560b, BRF_GRA }, // 9 - { "g02.u64", 0x200000, 0xb17b9b6e, BRF_GRA }, // 10 - { "g02.u65", 0x200000, 0x08541878, BRF_GRA }, // 11 - { "g02.u66", 0x200000, 0xbecf2a36, BRF_GRA }, // 12 - { "atgs.u1", 0x200000, 0xaa6f34a9, BRF_GRA }, // 13 - { "atgs.u2", 0x200000, 0x553eda27, BRF_GRA }, // 14 - - { "atgs.u78", 0x200000, 0x16710ecb, BRF_GRA }, // 15 Layer 0 Tile data - { "atgs.u81", 0x200000, 0xcb2aca91, BRF_GRA }, // 16 Layer 1 Tile data - { "atgs.u89", 0x200000, 0x65f45a0f, BRF_GRA }, // 17 Layer 2 Tile data - { "text.u82", 0x080000, 0xf57333ea, BRF_GRA }, // 18 Layer 3 Tile data - - { "g02.u53", 0x200000, 0xc4bdd9e0, BRF_SND }, // 19 MSM6295 #1 ADPCM data - { "g02.u54", 0x200000, 0x1357d50e, BRF_SND }, // 20 - { "g02.u55", 0x200000, 0x2d102898, BRF_SND }, // 21 MSM6295 #2 ADPCM data - { "g02.u56", 0x200000, 0x9ff50dda, BRF_SND }, // 22 -}; - - -STD_ROM_PICK(plegends) -STD_ROM_FN(plegends) - -static struct BurnRomInfo plegendsjRomDesc[] = { - { "prog.u45", 0x080000, 0x94f53db2, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "prog.u44", 0x080000, 0xdb0ad756, BRF_ESS | BRF_PRG }, // 1 - { "pr12.u2", 0x080000, 0x0e202559, BRF_ESS | BRF_PRG }, // 2 - { "pr12.u3", 0x080000, 0x54742f21, BRF_ESS | BRF_PRG }, // 3 - { "d15.u4", 0x080000, 0x6352cec0, BRF_ESS | BRF_PRG }, // 4 - { "d17.u5", 0x080000, 0x7af810d8, BRF_ESS | BRF_PRG }, // 5 - - { "sound.u3", 0x020000, 0x36f71520, BRF_ESS | BRF_PRG }, // 6 Z80 Code - - { "g02.u61", 0x200000, 0x91e30398, BRF_GRA }, // 7 Sprite data - { "g02.u62", 0x200000, 0xd9455dd7, BRF_GRA }, // 8 - { "g02.u63", 0x200000, 0x4d20560b, BRF_GRA }, // 9 - { "g02.u64", 0x200000, 0xb17b9b6e, BRF_GRA }, // 10 - { "g02.u65", 0x200000, 0x08541878, BRF_GRA }, // 11 - { "g02.u66", 0x200000, 0xbecf2a36, BRF_GRA }, // 12 - { "atgs.u1", 0x200000, 0xaa6f34a9, BRF_GRA }, // 13 - { "atgs.u2", 0x200000, 0x553eda27, BRF_GRA }, // 14 - - { "atgs.u78", 0x200000, 0x16710ecb, BRF_GRA }, // 15 Layer 0 Tile data - { "atgs.u81", 0x200000, 0xcb2aca91, BRF_GRA }, // 16 Layer 1 Tile data - { "atgs.u89", 0x200000, 0x65f45a0f, BRF_GRA }, // 17 Layer 2 Tile data - { "text.u82", 0x080000, 0xf57333ea, BRF_GRA }, // 18 Layer 3 Tile data - - { "g02.u53", 0x200000, 0xc4bdd9e0, BRF_SND }, // 19 MSM6295 #1 ADPCM data - { "g02.u54", 0x200000, 0x1357d50e, BRF_SND }, // 20 - { "g02.u55", 0x200000, 0x2d102898, BRF_SND }, // 21 MSM6295 #2 ADPCM data - { "g02.u56", 0x200000, 0x9ff50dda, BRF_SND }, // 22 -}; - - -STD_ROM_PICK(plegendsj) -STD_ROM_FN(plegendsj) - -struct BurnDriver BurnDrvPwrinst2 = { - "pwrinst2", NULL, NULL, NULL, "1994", - "Power Instinct 2 (USA, ver. 94/04/08)\0", NULL, "Atlus", "Cave", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VSFIGHT, FBF_PWRINST, - NULL, pwrinst2RomInfo, pwrinst2RomName, NULL, NULL, pwrinst2InputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPwrinst2j = { - "pwrinst2j", "pwrinst2", NULL, NULL, "1994", - "Gouketsuji Ichizoku 2 (Japan, ver. 94/04/08)\0", NULL, "Atlus", "Cave", - L"\u8C6A\u8840\u5BFA\u4E00\u65CF \uFF12 (Japan, ver. 94/04/08)\0Gouketsuji Ichizoku 2\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VSFIGHT, FBF_PWRINST, - NULL, pwrinst2jRomInfo, pwrinst2jRomName, NULL, NULL, pwrinst2InputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPlegends = { - "plegends", NULL, NULL, NULL, "1995", - "Gouketsuji Gaiden Legends (USA, ver. 95/06/20)\0", NULL, "Atlus / KM International", "Cave", - L"\u8C6A\u8840\u5BFA\u5916\u4F1D Gogetsuji Legends (USA, ver. 95/06/20)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VSFIGHT, FBF_PWRINST, - NULL, plegendsRomInfo, plegendsRomName, NULL, NULL, pwrinst2InputInfo, NULL, - PlegendsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPlegendsj = { - "plegendsj", "plegends", NULL, NULL, "1995", - "Gouketsuji Gaiden Saikyou Densetsu (Japan, ver. 95/06/20)\0", NULL, "Atlus", "Cave", - L"\u8C6A\u8840\u5BFA\u5916\u4F1D Gogetsuji \u6700\u5F37\u4F1D\u8AAC (Japan, ver. 95/06/20)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VSFIGHT, FBF_PWRINST, - NULL, plegendsjRomInfo, plegendsjRomName, NULL, NULL, pwrinst2InputInfo, NULL, - PlegendsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/cave/d_sailormn.cpp b/jan/src/burn/drv/cave/d_sailormn.cpp deleted file mode 100644 index 2e57aa878..000000000 --- a/jan/src/burn/drv/cave/d_sailormn.cpp +++ /dev/null @@ -1,1883 +0,0 @@ -// Pretty Soldier Sailor Moon & Air Gallet -#include "cave.h" -#include "msm6295.h" -#include "burn_ym2151.h" - -#include "bitswap.h" - -#define CAVE_VBLANK_LINES (271.5 - 240) -// #define CAVE_VBLANK_LINES (12) - -static UINT8 DrvJoy1[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01, *Rom02, *RomZ80; -static UINT8 *Ram01, *Ram02, *Ram03, *RamZ80; -static UINT8 *DefEEPROM; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static INT8 nVBlank; - -static INT32 nCurrentBank; - -static INT32 SoundLatch; -static INT32 SoundLatchReply[48]; -static INT32 SoundLatchStatus; - -static INT32 SoundLatchReplyIndex; -static INT32 SoundLatchReplyMax; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT32 nCaveCyclesDone[2]; - -static INT32 agalletamode = 0; -static INT32 nWhichGame; // 0 - sailormn/sailormno - // 1 - agallet - - -static struct BurnInputInfo sailormnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, -}; - -STDINPUTINFO(sailormn) - -static void UpdateIRQStatus() -{ - INT32 nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void drvZ80Bankswitch(INT32 nBank) -{ - nBank &= 0x1F; - if (nBank != nCurrentBank) { - UINT8* nStartAddress = RomZ80 + (nBank << 14); - ZetMapArea(0x4000, 0x7FFF, 0, nStartAddress); - ZetMapArea(0x4000, 0x7FFF, 2, nStartAddress); - nCurrentBank = nBank; - } -} - -static void drvYM2151IRQHandler(INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static UINT8 __fastcall sailormnZIn(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x20: { -// bprintf(PRINT_NORMAL, "Z80 read thingie.\n"); -// int nStatus = SoundLatchStatus; -// SoundLatchStatus &= ~2; -// return nStatus; - - return 0; - } - - case 0x30: -// bprintf(PRINT_NORMAL, "Z80 read soundlatch(lo)\n"); - SoundLatchStatus |= 0x04; - return SoundLatch & 0xFF; - - case 0x40: -// bprintf(PRINT_NORMAL, "Z80 read soundlatch(hi)\n"); - SoundLatchStatus |= 0x08; - return SoundLatch >> 8; - - case 0x51: -// bprintf(PRINT_NORMAL, "YM2151 status read.\n"); - return BurnYM2151ReadStatus(); - case 0x60: -// bprintf(PRINT_NORMAL, "MSM6295 #0 status read.\n"); - return MSM6295ReadStatus(0); - case 0x80: -// bprintf(PRINT_NORMAL, "MSM6295 #1 status read.\n"); - return MSM6295ReadStatus(1); - } - - return 0; -} - -static void __fastcall sailormnZOut(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - - case 0x00: - drvZ80Bankswitch(nValue); - break; - - case 0x10: -// SoundLatchStatus |= 0x02; -// SoundLatchReply = nValue; - if (SoundLatchReplyIndex > SoundLatchReplyMax) { - SoundLatchReplyMax = -1; - SoundLatchReplyIndex = 0; - } - SoundLatchReplyMax++; - SoundLatchReply[SoundLatchReplyMax] = nValue; - break; - - case 0x50: - BurnYM2151SelectRegister(nValue); - break; - case 0x51: -// bprintf(PRINT_NORMAL, "YM2151 reg %02X -> %02X\n", CaveCurrentYM2151Register, nValue); - BurnYM2151WriteRegister(nValue); - break; - - case 0x60: -// bprintf(PRINT_NORMAL, "MSM6295 #0 command sent.\n"); - MSM6295Command(0, nValue); - break; - case 0x70: - MSM6295SetBank(0, MSM6295ROM + 0x000000 + (nValue & 0x0f) * 0x20000, 0x00000, 0x1ffff); - MSM6295SetBank(0, MSM6295ROM + 0x000000 + (nValue & 0xf0) * 0x02000, 0x20000, 0x3ffff); - break; - case 0x80: -// bprintf(PRINT_NORMAL, "MSM6295 #1 command sent.\n"); - MSM6295Command(1, nValue); - break; - case 0xC0: - MSM6295SetBank(1, MSM6295ROM + 0x200000 + (nValue & 0x0f) * 0x20000, 0x00000, 0x1ffff); - MSM6295SetBank(1, MSM6295ROM + 0x200000 + (nValue & 0xf0) * 0x02000, 0x20000, 0x3ffff); - break; - } -} - -static INT32 drvZInit() -{ - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(sailormnZIn); - ZetSetOutHandler(sailormnZOut); - - // ROM bank 1 - ZetMapArea (0x0000, 0x3FFF, 0, RomZ80 + 0x0000); // Direct Read from ROM - ZetMapArea (0x0000, 0x3FFF, 2, RomZ80 + 0x0000); // Direct Fetch from ROM - // ROM bank 2 - ZetMapArea (0x4000, 0x7FFF, 0, RomZ80 + 0x0000); // Direct Read from ROM - ZetMapArea (0x4000, 0x7FFF, 2, RomZ80 + 0x0000); // - // RAM - ZetMapArea (0xC000, 0xDFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0xC000, 0xDFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0xC000, 0xDFFF, 2, RamZ80); // - // RAM mirror - ZetMapArea (0xE000, 0xFFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0xE000, 0xFFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0xE000, 0xFFFF, 2, RamZ80); // - - ZetClose(); - - return 0; -} - -static UINT8 __fastcall sailormnReadByte(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - - switch (sekAddress) { - case 0xB80000: - case 0xB80001: { - UINT8 nRet = ((nVBlank ^ 1) << 2) | (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0xB80002: - case 0xB80003: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0xB80004: - case 0xB80005: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0xB80006: - case 0xB80007: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0x600000: - return (DrvInput[0] >> 8) ^ 0xFF; - case 0x600001: - return (DrvInput[0] & 0xFF) ^ 0xFF; - case 0x600002: - return ((DrvInput[1] >> 8) ^ 0xF7) | (EEPROMRead() << 3); - case 0x600003: - return (DrvInput[1] & 0xFF) ^ 0xFF; - -#if 0 - case 0xB8006C: - case 0xB8006D: - bprintf(PRINT_NORMAL, "Soundlatch status read (byte).\n"); -// return SoundLatchStatus & 3; - return 0; - case 0xB8006E: - case 0xB8006F: - bprintf(PRINT_NORMAL, "Sound latch read (byte).\n"); -// SoundLatchStatus = 2; -// return SoundLatchReply; - return 0; -#endif - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -static UINT16 __fastcall sailormnReadWord(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - - switch (sekAddress) { - case 0xB80000: { - UINT16 nRet = ((nVBlank ^ 1) << 2) | (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0xB80002: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0xB80004: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0xB80006: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0xB8006C: -// SoundLatchStatus &= ~4; -// return SoundLatchStatus & 3; - - if (SoundLatchReplyIndex > SoundLatchReplyMax) { - return 2; - } - return 0; - - case 0xB8006E: -// bprintf(PRINT_NORMAL, "Sound latch read.\n"); -// SoundLatchStatus = 2; -// return SoundLatchReply; - - if (SoundLatchReplyIndex > SoundLatchReplyMax) { - SoundLatchReplyIndex = 0; - SoundLatchReplyMax = -1; - return 0; - } -// bprintf(PRINT_NORMAL, "Sound latch reply read (%02X).\n", SoundLatchReply[SoundLatchReplyIndex]); - return SoundLatchReply[SoundLatchReplyIndex++]; - - case 0x600000: - return DrvInput[0] ^ 0xFFFF; - case 0x600002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -static void __fastcall sailormnWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - - switch (sekAddress) { -// case 0xB8006E: -// SoundLatch &= 0xFF00; -// SoundLatch |= byteValue << 8; -// break; -// case 0xB8006F: -// SoundLatch &= 0x00FF; -// SoundLatch |= byteValue; -// break; - - case 0x700000: - nCaveTileBank = byteValue & 1; - EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08); - return; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -static void __fastcall sailormnWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - switch (sekAddress) { - case 0xA00000: - CaveTileReg[0][0] = wordValue; - return; - case 0xA00002: - CaveTileReg[0][1] = wordValue; - return; - case 0xA00004: - CaveTileReg[0][2] = wordValue; - return; - - case 0xA80000: - CaveTileReg[1][0] = wordValue; - return; - case 0xA80002: - CaveTileReg[1][1] = wordValue; - return; - case 0xA80004: - CaveTileReg[1][2] = wordValue; - return; - - case 0xB00000: - CaveTileReg[2][0] = wordValue; - return; - case 0xB00002: - CaveTileReg[2][1] = wordValue; - return; - case 0xB00004: - CaveTileReg[2][2] = wordValue; - return; - - case 0xB80000: - nCaveXOffset = wordValue; - return; - case 0xB80002: - nCaveYOffset = wordValue; - return; - case 0xB80008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0xB8006E: -// bprintf(PRINT_NORMAL, "Sound command sent: %04X\n", wordValue); - - SoundLatch = wordValue; - SoundLatchStatus |= 0x0C; - - ZetNmi(); - nCaveCyclesDone[1] += ZetRun(0x0400); - return; - - case 0x700000: - wordValue >>= 8; - nCaveTileBank = wordValue & 1; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - return; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - } - } -} - -static void __fastcall sailormnWriteBytePalette(UINT32 sekAddress, UINT8 byteValue) -{ - CavePalWriteByte(sekAddress & 0xFFFF, byteValue); -} - -static void __fastcall sailormnWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - CavePalWriteWord(sekAddress & 0xFFFF, wordValue); -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - MSM6295Exit(0); - MSM6295Exit(1); - BurnYM2151Exit(); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - ZetExit(); - - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - agalletamode = 0; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - memset (RamStart, 0, RamEnd - RamStart); - - if (agalletamode) - agalletamode = 0x2002; - - nCurrentBank = -1; - - ZetOpen(0); - drvZ80Bankswitch(0); - ZetReset(); - ZetClose(); - - EEPROMReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - SoundLatch = 0; - SoundLatchStatus = 0x0C; - - memset(SoundLatchReply, 0, sizeof(SoundLatchReply)); - SoundLatchReplyIndex = 0; - SoundLatchReplyMax = -1; - - nCaveCyclesDone[0] = nCaveCyclesDone[1] = 0; - - MSM6295Reset(0); - MSM6295Reset(1); - BurnYM2151Reset(); - - return 0; -} - -static INT32 DrvDraw() -{ - if (CaveRecalcPalette) { - CavePalUpdate8Bit(0x4400, 12); - CaveRecalcPalette = 1; - } - CavePalUpdate4Bit(0, 64); - - CaveClearScreen(CavePalette[nWhichGame ? 0x3F00 : 0x5FF0]); - - if (bDrawScreen) { -// CaveGetBitmap(); - -#if 0 - CaveTileRender(1); -#else - if (nWhichGame) { - // Air Gallet always enables row-scroll and row-select for 16x16 layers, but always without effect - // So, force tile drawing routines to ignore row-scroll and row-select - CaveTileRender(0); - } else { - CaveTileRender(1); - } -#endif - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 4; - - INT32 nCyclesTotal[2]; - - INT32 nCyclesSegment; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 10; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCaveCyclesDone[0] = 0; -#if 0 - nCyclesTotal[1] = (INT32)((INT64)8000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); -#else - nCyclesTotal[1] = (INT32)(8000000 / CAVE_REFRESHRATE); -#endif - nCaveCyclesDone[1] -= nCyclesTotal[1]; - if (nCaveCyclesDone[1] < 0) { - nCaveCyclesDone[1] = 0; - } - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - nVBlank = 0; - - INT32 nSoundBufferPos = 0; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (!nVBlank && nNext > nCyclesVBlank) { - if (nCaveCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCaveCyclesDone[nCurrentCPU]; - nCaveCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - -// CaveSpriteBuffer(); - - nVBlank = 1; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCaveCyclesDone[nCurrentCPU]; - if (nVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCaveCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCaveCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCaveCyclesDone[nCurrentCPU]; - nCaveCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - - { - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - } - - if (agalletamode&0xff) { // "agalleta" watchdog boot kludge - agalletamode = 0x2000 | ((agalletamode&0xff) - 1); - if ((agalletamode&0xff) == 0) { - SekReset(); - } - } - - SekClose(); - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - } - - ZetClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // 68K program - Rom02 = Next; Next += 0x200000; - RomZ80 = Next; Next += 0x080000; - CaveSpriteROM = Next; Next += 0x800000; - CaveTileROM[0] = Next; Next += 0x400000; // Tile layer 0 - CaveTileROM[1] = Next; Next += 0x400000; // Tile layer 1 - if (nWhichGame) { - CaveTileROM[2] = Next; Next += 0x400000; // Tile layer 2 (agallet) - } else { - CaveTileROM[2] = Next; Next += 0x01400000; // Tile layer 2 (Sailor Moon) - } - MSM6295ROM = Next; Next += 0x400000; // MSM6295 ADPCM data - DefEEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x010002; // CPU #0 work RAM - Ram02 = Next; Next += 0x008000; // - Ram03 = Next; Next += 0x004002; // - RamZ80 = Next; Next += 0x002000; - CaveTileRAM[0] = Next; Next += 0x008000; - CaveTileRAM[1] = Next; Next += 0x008000; - CaveTileRAM[2] = Next; Next += 0x008002; - CaveSpriteRAM = Next; Next += 0x010002; - CavePalSrc = Next; Next += 0x010000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void sailormnDecodeSprites(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void sailormnDecodeTiles(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[1] = *pOrg & 15; - pDest[0] = *pOrg >> 4; - } - - return; -} - -static INT32 sailormnLoadRoms() -{ - UINT8* pTemp; - - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - BurnLoadRom(Rom02, 1, 1); - - // Load Z80 ROM - BurnLoadRom(RomZ80, 2, 1); - - pTemp = (UINT8*)BurnMalloc(0x400000); - BurnLoadRom(pTemp + 0x000000, 3, 1); - BurnLoadRom(pTemp + 0x200000, 4, 1); - for (INT32 i = 0; i < 0x400000; i++) { - CaveSpriteROM[i ^ 0x950C4] = pTemp[BITSWAP24(i, 23, 22, 21, 20, 15, 10, 12, 6, 11, 1, 13, 3, 16, 17, 2, 5, 14, 7, 18, 8, 4, 19, 9, 0)]; - } - BurnFree(pTemp); - sailormnDecodeSprites(CaveSpriteROM, 0x400000); - - BurnLoadRom(CaveTileROM[0], 5, 1); - sailormnDecodeTiles(CaveTileROM[0], 0x200000); - BurnLoadRom(CaveTileROM[1], 6, 1); - sailormnDecodeTiles(CaveTileROM[1], 0x200000); - BurnLoadRom(CaveTileROM[2] + 0x000000, 7, 1); - BurnLoadRom(CaveTileROM[2] + 0x200000, 8, 1); - BurnLoadRom(CaveTileROM[2] + 0x400000, 9, 1); - BurnLoadRom(CaveTileROM[2] + 0x600000, 10, 1); - BurnLoadRom(CaveTileROM[2] + 0x800000, 11, 1); - sailormnDecodeTiles(CaveTileROM[2], 0xA00000); - - pTemp = (UINT8*)BurnMalloc(0x600000); - BurnLoadRom(pTemp + 0x000000, 12, 1); - BurnLoadRom(pTemp + 0x200000, 13, 1); - BurnLoadRom(pTemp + 0x400000, 14, 1); - for (INT32 i = 0; i < 0x500000; i++) { - CaveTileROM[2][(i << 2) + 0] |= (pTemp[i] & 0x03) << 4; - CaveTileROM[2][(i << 2) + 1] |= (pTemp[i] & 0x0C) << 2; - CaveTileROM[2][(i << 2) + 2] |= (pTemp[i] & 0x30); - CaveTileROM[2][(i << 2) + 3] |= (pTemp[i] & 0xC0) >> 2; - } - BurnFree(pTemp); - - // Load OKIM6295 data - BurnLoadRom(MSM6295ROM + 0x0000000, 15, 1); - BurnLoadRom(MSM6295ROM + 0x0200000, 16, 1); - BurnLoadRom(MSM6295ROM + 0x0280000, 16, 1); - BurnLoadRom(MSM6295ROM + 0x0300000, 16, 1); - BurnLoadRom(MSM6295ROM + 0x0380000, 16, 1); - - BurnLoadRom(DefEEPROM, 17, 1); - - return 0; -} - -static INT32 agalletLoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - // Load Z80 ROM - BurnLoadRom(RomZ80, 1, 1); - - BurnLoadRom(CaveSpriteROM + 0x000000, 2, 1); - BurnLoadRom(CaveSpriteROM + 0x200000, 3, 1); - sailormnDecodeSprites(CaveSpriteROM, 0x400000); - - BurnLoadRom(CaveTileROM[0], 4, 1); - sailormnDecodeTiles(CaveTileROM[0], 0x200000); - BurnLoadRom(CaveTileROM[1], 5, 1); - sailormnDecodeTiles(CaveTileROM[1], 0x200000); - BurnLoadRom(CaveTileROM[2], 6, 1); - sailormnDecodeTiles(CaveTileROM[2], 0x200000); - - UINT8* pTemp = (UINT8*)BurnMalloc(0x200000); - BurnLoadRom(pTemp, 7, 1); - for (INT32 i = 0; i < 0x0100000; i++) { - CaveTileROM[2][(i << 2) + 0] |= (pTemp[i] & 0x03) << 4; - CaveTileROM[2][(i << 2) + 1] |= (pTemp[i] & 0x0C) << 2; - CaveTileROM[2][(i << 2) + 2] |= (pTemp[i] & 0x30); - CaveTileROM[2][(i << 2) + 3] |= (pTemp[i] & 0xC0) >> 2; - } - BurnFree(pTemp); - - // Load OKIM6295 data - BurnLoadRom(MSM6295ROM + 0x0000000, 8, 1); - BurnLoadRom(MSM6295ROM + 0x0200000, 9, 1); - - BurnLoadRom(DefEEPROM, 10, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029719; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 - ZetScan(nAction); // scan Z80 - - SCAN_VAR(SoundLatch); - SCAN_VAR(SoundLatchStatus); - SCAN_VAR(SoundLatchReply); - SCAN_VAR(SoundLatchReplyIndex); - SCAN_VAR(SoundLatchReplyMax); - - SCAN_VAR(nCurrentBank); - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - BurnYM2151Scan(nAction); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(nVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - - if (nAction & ACB_WRITE) { - INT32 nBank = nCurrentBank; - nCurrentBank = -1; - ZetOpen(0); - drvZ80Bankswitch(nBank); - ZetClose(); - - CaveRecalcPalette = 1; - } - } - - return 0; -} - -static INT32 gameInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - if (nWhichGame) { - // Load the roms into memory - if (agalletLoadRoms()) { - return 1; - } - } else { - // Load the roms into memory - if (sailormnLoadRoms()) { - return 1; - } - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x110001, MAP_RAM); // ram (Air Gallet tests too far) - SekMapMemory(Rom02, 0x200000, 0x3FFFFF, MAP_ROM); - SekMapMemory(Ram02, 0x400000, 0x407FFF, MAP_RAM); - SekMapMemory(Ram03, 0x40C000, 0x410001, MAP_RAM); // RAM (Air Gallet tests too far) - SekMapMemory(CaveSpriteRAM, 0x500000, 0x510001, MAP_RAM); // Sprite RAM (Air Gallet tests too far) - SekMapMemory(CaveTileRAM[0], 0x800000, 0x807FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[1], 0x880000, 0x887FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[2], 0x900000, 0x908001, MAP_RAM); // Air Gallet tests too far - - SekMapMemory(CavePalSrc, 0x408000, 0x4087FF, MAP_RAM); // Palette RAM - SekMapMemory(CavePalSrc + 0x8800, 0x408800, 0x40BFFF, MAP_ROM); // Palette RAM (write goes through handler) - SekMapHandler(1, 0x408800, 0x40BFFF, MAP_WRITE); // - - SekSetReadWordHandler(0, sailormnReadWord); - SekSetReadByteHandler(0, sailormnReadByte); - SekSetWriteWordHandler(0, sailormnWriteWord); - SekSetWriteByteHandler(0, sailormnWriteByte); - - SekSetWriteWordHandler(1, sailormnWriteWordPalette); - SekSetWriteByteHandler(1, sailormnWriteBytePalette); - - SekClose(); - } - - drvZInit(); - - nCaveExtraXOffset = -1; - CaveSpriteVisibleXOffset = -1; - nCaveRowModeOffset = 2; - - CavePalInit(0x8000); - CaveTileInit(); - if (nWhichGame) { - CaveSpriteInit(1, 0x0800000); - } else { - CaveSpriteInit(2, 0x0800000); - } - CaveTileInitLayer(0, 0x400000, 4, 0x4400); - CaveTileInitLayer(1, 0x400000, 4, 0x4800); - if (nWhichGame) { - CaveTileInitLayer(2, 0x400000, 6, 0x4C00); - } else { - CaveTileInitLayer(2, 0x01400000, 6, 0x4C00); - } - - BurnYM2151Init(32000000 / 8); - BurnYM2151SetIrqHandler(&drvYM2151IRQHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.30, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.30, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 16000, 1); - MSM6295Init(1, 16000, 1); - MSM6295SetBank(0, MSM6295ROM + 0x000000, 0, 0x3ffff); - MSM6295SetBank(1, MSM6295ROM + 0x200000, 0, 0x3ffff); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&eeprom_interface_93C46); - if (!EEPROMAvailable()) EEPROMFill(DefEEPROM,0, 0x80); - - bDrawScreen = true; - - DrvDoReset(); - - return 0; -} - -static INT32 sailormnInit() -{ - nWhichGame = 0; - return gameInit(); -} - -static INT32 agalletInit() -{ - nWhichGame = 1; - return gameInit(); -} - -static INT32 agalletaInit() -{ - nWhichGame = 1; - agalletamode = 0x2002; - - return gameInit(); -} - -// Rom information - -static struct BurnRomInfo sailormnRomDesc[] = { - { "bpsm945a.u45", 0x080000, 0x898c9515, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_europe.nv", 0x0080, 0x59a7dc50, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormn) -STD_ROM_FN(sailormn) - -static struct BurnRomInfo sailormnuRomDesc[] = { - { "bpsm945a.u45", 0x080000, 0x898c9515, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_usa.nv", 0x0080, 0x3915abe3, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnu) -STD_ROM_FN(sailormnu) - -static struct BurnRomInfo sailormnjRomDesc[] = { - { "bpsm945a.u45", 0x080000, 0x898c9515, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_japan.nv", 0x0080, 0xea03c30a, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnj) -STD_ROM_FN(sailormnj) - -static struct BurnRomInfo sailormnkRomDesc[] = { - { "bpsm945a.u45", 0x080000, 0x898c9515, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_korea.nv", 0x0080, 0x0e7de398, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnk) -STD_ROM_FN(sailormnk) - -static struct BurnRomInfo sailormntRomDesc[] = { - { "bpsm945a.u45", 0x080000, 0x898c9515, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_taiwan.nv", 0x0080, 0x6c7e8c2a, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnt) -STD_ROM_FN(sailormnt) - -static struct BurnRomInfo sailormnhRomDesc[] = { - { "bpsm945a.u45", 0x080000, 0x898c9515, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_hongkong.nv", 0x0080, 0x4d24c874, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnh) -STD_ROM_FN(sailormnh) - -static struct BurnRomInfo sailormnoRomDesc[] = { - { "smprg.u45", 0x080000, 0x234f1152, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_europe.nv", 0x0080, 0x59a7dc50, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormno) -STD_ROM_FN(sailormno) - -static struct BurnRomInfo sailormnouRomDesc[] = { - { "smprg.u45", 0x080000, 0x234f1152, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_usa.nv", 0x0080, 0x3915abe3, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnou) -STD_ROM_FN(sailormnou) - -static struct BurnRomInfo sailormnojRomDesc[] = { - { "smprg.u45", 0x080000, 0x234f1152, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_japan.nv", 0x0080, 0xea03c30a, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnoj) -STD_ROM_FN(sailormnoj) - -static struct BurnRomInfo sailormnokRomDesc[] = { - { "smprg.u45", 0x080000, 0x234f1152, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_korea.nv", 0x0080, 0x0e7de398, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnok) -STD_ROM_FN(sailormnok) - -static struct BurnRomInfo sailormnotRomDesc[] = { - { "smprg.u45", 0x080000, 0x234f1152, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_taiwan.nv", 0x0080, 0x6c7e8c2a, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnot) -STD_ROM_FN(sailormnot) - -static struct BurnRomInfo sailormnohRomDesc[] = { - { "smprg.u45", 0x080000, 0x234f1152, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bpsm.u46", 0x200000, 0x32084e80, BRF_ESS | BRF_PRG }, // 1 - - { "bpsm945a.u9", 0x080000, 0x438de548, BRF_ESS | BRF_PRG }, // 2 Z80 code - - { "bpsm.u76", 0x200000, 0xa243a5ba, BRF_GRA }, // 3 Sprite data - { "bpsm.u77", 0x200000, 0x5179a4ac, BRF_GRA }, // 4 - - { "bpsm.u53", 0x200000, 0xb9b15f83, BRF_GRA }, // 5 Layer 0 Tile data - { "bpsm.u54", 0x200000, 0x8f00679d, BRF_GRA }, // 6 Layer 1 Tile data - - { "bpsm.u57", 0x200000, 0x86be7b63, BRF_GRA }, // 7 Layer 2 Tile data - { "bpsm.u58", 0x200000, 0xe0bba83b, BRF_GRA }, // 8 - { "bpsm.u62", 0x200000, 0xa1e3bfac, BRF_GRA }, // 9 - { "bpsm.u61", 0x200000, 0x6a014b52, BRF_GRA }, // 10 - { "bpsm.u60", 0x200000, 0x992468c0, BRF_GRA }, // 11 - - { "bpsm.u65", 0x200000, 0xf60fb7b5, BRF_GRA }, // 12 - { "bpsm.u64", 0x200000, 0x6559d31c, BRF_GRA }, // 13 - { "bpsm.u63", 0x200000, 0xd57a56b4, BRF_GRA }, // 14 - - { "bpsm.u48", 0x200000, 0x498e4ed1, BRF_SND }, // 15 MSM6295 #0 ADPCM data - { "bpsm.u47", 0x080000, 0x0f2901b9, BRF_SND }, // 16 MSM6295 #1 ADPCM data - - { "sailormn_hongkong.nv", 0x0080, 0x4d24c874, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(sailormnoh) -STD_ROM_FN(sailormnoh) - -static struct BurnRomInfo agalletRomDesc[] = { - // these roms were dumped from a board set to Taiwanese region. - { "bp962a.u45", 0x080000, 0x24815046, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_europe.nv", 0x0080, 0xec38bf65, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agallet) -STD_ROM_FN(agallet) - -static struct BurnRomInfo agalletaRomDesc[] = { - { "u45", 0x080000, 0x2cab18b0, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_europe.nv", 0x0080, 0xec38bf65, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalleta) -STD_ROM_FN(agalleta) - -static struct BurnRomInfo agalletuRomDesc[] = { - { "bp962a.u45", 0x080000, 0x24815046, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_usa.nv", 0x0080, 0x72e65056, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalletu) -STD_ROM_FN(agalletu) - -static struct BurnRomInfo agalletauRomDesc[] = { - { "u45", 0x080000, 0x2cab18b0, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_usa.nv", 0x0080, 0x72e65056, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalletau) -STD_ROM_FN(agalletau) - -static struct BurnRomInfo agalletjRomDesc[] = { - { "bp962a.u45", 0x080000, 0x24815046, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_japan.nv", 0x0080, 0x0753f547, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalletj) -STD_ROM_FN(agalletj) - -static struct BurnRomInfo agalletajRomDesc[] = { - // the dumped board was this region - { "u45", 0x080000, 0x2cab18b0, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_japan.nv", 0x0080, 0x0753f547, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalletaj) -STD_ROM_FN(agalletaj) - -static struct BurnRomInfo agalletkRomDesc[] = { - { "bp962a.u45", 0x080000, 0x24815046, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_korea.nv", 0x0080, 0x7f41c253, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalletk) -STD_ROM_FN(agalletk) - -static struct BurnRomInfo agalletakRomDesc[] = { - { "u45", 0x080000, 0x2cab18b0, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_korea.nv", 0x0080, 0x7f41c253, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalletak) -STD_ROM_FN(agalletak) - -static struct BurnRomInfo agallettRomDesc[] = { - { "bp962a.u45", 0x080000, 0x24815046, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_taiwan.nv", 0x0080, 0x0af46742, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agallett) -STD_ROM_FN(agallett) - -static struct BurnRomInfo agalletatRomDesc[] = { - { "u45", 0x080000, 0x2cab18b0, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_taiwan.nv", 0x0080, 0x0af46742, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalletat) -STD_ROM_FN(agalletat) - -static struct BurnRomInfo agallethRomDesc[] = { - { "bp962a.u45", 0x080000, 0x24815046, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_hongkong.nv", 0x0080, 0x998d1a74, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalleth) -STD_ROM_FN(agalleth) - -static struct BurnRomInfo agalletahRomDesc[] = { - { "u45", 0x080000, 0x2cab18b0, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "bp962a.u9", 0x080000, 0x06caddbe, BRF_ESS | BRF_PRG }, // 1 Z80 code - - { "bp962a.u76", 0x200000, 0x858da439, BRF_GRA }, // 2 Sprite data - { "bp962a.u77", 0x200000, 0xea2ba35e, BRF_GRA }, // 3 - - { "bp962a.u53", 0x200000, 0xfcd9a107, BRF_GRA }, // 4 Layer 0 Tile data - { "bp962a.u54", 0x200000, 0x0cfa3409, BRF_GRA }, // 5 Layer 1 Tile data - { "bp962a.u57", 0x200000, 0x6d608957, BRF_GRA }, // 6 Layer 2 Tile data - { "bp962a.u65", 0x200000, 0x135fcf9a, BRF_GRA }, // 7 - - { "bp962a.u48", 0x200000, 0xae00a1ce, BRF_SND }, // 8 MSM6295 #0 ADPCM data - { "bp962a.u47", 0x200000, 0x6d4e9737, BRF_SND }, // 9 MSM6295 #1 ADPCM data - - { "agallet_hongkong.nv", 0x0080, 0x998d1a74, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(agalletah) -STD_ROM_FN(agalletah) - -struct BurnDriver BurnDrvSailorMoon = { - "sailormn", NULL, NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22B, Europe)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22B, Europe)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnRomInfo, sailormnRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonu = { - "sailormnu", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22B, USA)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22B, USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnuRomInfo, sailormnuRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonj = { - "sailormnj", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22B, Japan)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22B, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnjRomInfo, sailormnjRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonk = { - "sailormnk", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22B, Korea)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22B, Korea)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnkRomInfo, sailormnkRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoont = { - "sailormnt", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22B, Taiwan)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22B, Taiwan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormntRomInfo, sailormntRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonh = { - "sailormnh", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22B, Hong Kong)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22B, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnhRomInfo, sailormnhRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonO = { - "sailormno", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22, Europe)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22, Europe)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnoRomInfo, sailormnoRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonOu = { - "sailormnou", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22, USA)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22, USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnouRomInfo, sailormnouRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonOj = { - "sailormnoj", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22, Japan)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnojRomInfo, sailormnojRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonOk = { - "sailormnok", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22, Korea)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22, Korea)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnokRomInfo, sailormnokRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonOt = { - "sailormnot", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22, Taiwan)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22, Taiwan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnotRomInfo, sailormnotRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSailorMoonOh = { - "sailormnoh", "sailormn", NULL, NULL,"1995", - "Pretty Soldier Sailor Moon (ver. 95/03/22, Hong Kong)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Pretty Soldier Sailor Moon\0\u7F8E\u5C11\u5973\u6226\u58EB \u30BB\u30FC\u30E9\u30FC\u30E0\u30FC\u30F3 (ver. 95/03/22, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_SCRFIGHT, 0, - NULL, sailormnohRomInfo, sailormnohRomName, NULL, NULL, sailormnInputInfo, NULL, - sailormnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvAirGallet = { - "agallet", NULL, NULL, NULL,"1996", - "Air Gallet (Europe)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (Europe)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletRomInfo, agalletRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalleta = { - "agalleta", "agallet", NULL, NULL,"1996", - "Air Gallet (older, Europe)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (older, Europe)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletaRomInfo, agalletaRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalletu = { - "agalletu", "agallet", NULL, NULL,"1996", - "Air Gallet (USA)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletuRomInfo, agalletuRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalletau = { - "agalletau", "agallet", NULL, NULL,"1996", - "Air Gallet (older, USA)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (older, USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletauRomInfo, agalletauRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalletj = { - "agalletj", "agallet", NULL, NULL,"1996", - "Akuu Gallet (Japan)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Akuu Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletjRomInfo, agalletjRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalletaj = { - "agalletaj", "agallet", NULL, NULL,"1996", - "Akuu Gallet (older, Japan)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Akuu Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (older, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletajRomInfo, agalletajRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalletk = { - "agalletk", "agallet", NULL, NULL,"1996", - "Air Gallet (Korea)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (Korea)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletkRomInfo, agalletkRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalletak = { - "agalletak", "agallet", NULL, NULL,"1996", - "Air Gallet (older, Korea)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (older, Korea)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletakRomInfo, agalletakRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGallett = { - "agallett", "agallet", NULL, NULL,"1996", - "Air Gallet (Taiwan)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (Taiwan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agallettRomInfo, agallettRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalletat = { - "agalletat", "agallet", NULL, NULL,"1996", - "Air Gallet (older, Taiwan)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (older, Taiwan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletatRomInfo, agalletatRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalleth = { - "agalleth", "agallet", NULL, NULL,"1996", - "Air Gallet (Hong Kong)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agallethRomInfo, agallethRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAirGalletah = { - "agalletah", "agallet", NULL, NULL,"1996", - "Air Gallet (older, Hong Kong)\0", NULL, "BanPresto / Gazelle", "Cave", - L"Air Gallet\0\u30A2\u30EF\u30A6\u30AE\u30E3\u30EC\u30C3\u30C8 (older, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_Z80, GBF_VERSHOOT, 0, - NULL, agalletahRomInfo, agalletahRomName, NULL, NULL, sailormnInputInfo, NULL, - agalletaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 240, 320, 3, 4 -}; - diff --git a/jan/src/burn/drv/cave/d_tjumpman.cpp b/jan/src/burn/drv/cave/d_tjumpman.cpp deleted file mode 100644 index 340dbce9b..000000000 --- a/jan/src/burn/drv/cave/d_tjumpman.cpp +++ /dev/null @@ -1,584 +0,0 @@ -// Tobikose! Jumpman -#include "cave.h" -#include "msm6295.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0, 0}; -static UINT8 DrvDip[2] = { 0, 0 }; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01; - -static UINT8 DrvReset; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; -static INT8 nIRQPending; - -static INT32 nPrevCoinHack = 0; -static INT32 watchdog; -static INT32 tjumpman_hopper; - -static struct BurnInputInfo TjumpmanInputList[] = { - {"Coin", BIT_DIGITAL, DrvJoy2 + 6, "p1 coin" }, - {"1 Bet", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"3 Bet", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 2" }, - {"No (not)", BIT_DIGITAL, DrvJoy2 + 4, "p1 start" }, - {"Yes (do)", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 4" }, - {"Pay Out", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 5" }, - {"Go", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Tjumpman) - -static struct BurnDIPInfo TjumpmanDIPList[]= -{ - {0x08, 0xff, 0xff, 0x01, NULL }, - {0x09, 0xff, 0xff, 0x08, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x08, 0x01, 0x01, 0x01, "Off" }, - {0x08, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Self Test" }, - {0x09, 0x01, 0x08, 0x08, "Off" }, - {0x09, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Tjumpman) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 tjumpman_hopper_read() -{ - return (tjumpman_hopper && !(nCurrentFrame % 10)) ? 0 : 1; -} - -UINT8 __fastcall tjumpmanReadByte(UINT32 sekAddress) -{ - switch (sekAddress) - { - case 0x600000: - return 0xff; - - case 0x600001: - return ((DrvInput[0] & 0x76) ^ 0x76) | (DrvDip[0] & 1) | ((EEPROMRead() & 1) << 3) | (tjumpman_hopper_read() << 7); - - case 0x600002: - return 0xff; - - case 0x600003: - return ((DrvInput[1] & 0xF7) ^ 0xF7) | (DrvDip[1] & 8); - - case 0x700000: - case 0x700001: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ | (bVBlank ? 4 : 0); - return nRet; - } - - case 0x700002: - case 0x700003: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - - case 0x700004: - case 0x700005: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0x700006: - case 0x700007: { - UINT8 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0x800001: - return MSM6295ReadStatus(0); - - default: { -// bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - } - return 0; -} - -UINT16 __fastcall tjumpmanReadWord(UINT32 sekAddress) -{ - switch (sekAddress) - { - case 0x600000: - return (DrvInput[0] ^ 0xFF76) | (DrvDip[0] & 1) | ((EEPROMRead() & 1) << 3) | (tjumpman_hopper_read() << 7); - - case 0x600002: - return (DrvInput[1] ^ 0xFFF7) | (DrvDip[1] & 8); - - case 0x700000: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ | (bVBlank ? 4 : 0); - return nRet; - } - - case 0x700002: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - - case 0x700004: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0x700006: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0x800000: - return MSM6295ReadStatus(0); - - default: { -// bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall tjumpmanWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) - { - case 0x800001: - MSM6295Command(0, byteValue); - break; - - case 0xc00000: - break; - - case 0xc00001: - tjumpman_hopper = byteValue & 0x40; - break; - - case 0xe00001: - EEPROMWrite(byteValue & 0x10, byteValue & 0x08, byteValue & 0x20); - break; - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } - } -} - -void __fastcall tjumpmanWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) - { - case 0x400000: - CaveTileReg[0][0] = wordValue; - break; - case 0x400002: - CaveTileReg[0][1] = wordValue; - break; - case 0x400004: - CaveTileReg[0][2] = wordValue; - break; - - case 0x700000: - nCaveXOffset = wordValue; - return; - case 0x700002: - nCaveYOffset = wordValue; - return; - case 0x700008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0x700068: - watchdog = 0; - break; - - case 0x800000: - MSM6295Command(0, wordValue); - break; - - case 0xc00000: - tjumpman_hopper = wordValue & 0x40; - break; - - case 0xe00000: - EEPROMWrite(wordValue & 0x10, wordValue & 0x08, wordValue & 0x20); - break; - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - - } - } -} - -void __fastcall tjumpmanWriteBytePalette(UINT32 sekAddress, UINT8 byteValue) -{ - CavePalWriteByte(sekAddress & 0xFFFF, byteValue); -} - -void __fastcall tjumpmanWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - CavePalWriteWord(sekAddress & 0xFFFF, wordValue); -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - MSM6295Exit(0); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); - - BurnFree(Mem); - Mem = NULL; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - MSM6295Reset(0); - - tjumpman_hopper = 0; - watchdog = 0; -// nPrevCoinHack = 0; - - return 0; -} - -static INT32 DrvDraw() -{ - CaveSpriteBuffer(); - CavePalUpdate8Bit(0, 128); - CaveClearScreen(CavePalette[0x7F00]); - - CaveTileRender(1); - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - - INT32 nCyclesTotal[1]; - INT32 nCyclesDone[1]; - - INT32 nCyclesSegment; - - watchdog++; - if (DrvReset || (watchdog > 180)) { - DrvDoReset(); - } - - DrvInput[0] = 0; - DrvInput[1] = 0; - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - - //if ((nPrevCoinHack != (DrvInput[1] & 0x0040)) && (DrvInput[1] & 0x0040)) { - // Ram01[0x24]++; - // if (Ram01[0x24] > 9) Ram01[0x24] = 9; // ? - //} - - nPrevCoinHack = DrvInput[1] & 0x0040; - - nCyclesTotal[0] = (INT32)((INT64)14000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesDone[0] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - SekOpen(0); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nCurrentCPU = 0; - INT32 nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); - } - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // end of vblank - if (i == nInterleave) { - bVBlank = false; - nUnknownIRQ = 1; - UpdateIRQStatus(); - } - } - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8* Next; - - Next = Mem; - - Rom01 = Next; Next += 0x080000; - CaveSpriteROM = Next; Next += 0x200000; - CaveTileROM[0] = Next; Next += 0x100000; - - MSM6295ROM = Next; Next += 0x040000; - - Ram01 = Next; Next += 0x010000; // work RAM (NV!) - - RamStart = Next; - - CaveTileRAM[0] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x010000; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap1(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void NibbleSwap4(UINT8* pData, INT32 nLen) -{ - for (INT32 i = 0; i < nLen; i++, pData += 2) { - UINT8 n1 = pData[0]; - UINT8 n2 = pData[1]; - - pData[1] = (n2 << 4) | (n1 & 0x0F); - pData[0] = (n2 & 0xF0) | (n1 >> 4); - } - - return; -} - -static INT32 LoadRoms() -{ - BurnLoadRom(Rom01, 0, 1); - - BurnLoadRom(CaveSpriteROM + 0x000000, 1, 2); - BurnLoadRom(CaveSpriteROM + 0x000001, 2, 2); - NibbleSwap1(CaveSpriteROM, 0x100000); - - BurnLoadRom(CaveTileROM[0] + 0x00000, 3, 2); - BurnLoadRom(CaveTileROM[0] + 0x00001, 4, 2); - NibbleSwap4(CaveTileROM[0], 0x80000); - - BurnLoadRom(MSM6295ROM, 5, 1); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); - - if (nAction & ACB_VOLATILE) { - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); - - MSM6295Scan(0, nAction); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - - SCAN_VAR(tjumpman_hopper); - - CaveScanGraphics(); - } - - if (nAction & ACB_NVRAM) { - ba.Data = Ram01; - ba.nLen = 0x010000; - ba.nAddress = 0x100000; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); - MemIndex(); - - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x300000, 0x303FFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x304000, 0x307FFF, MAP_RAM); // mirror - SekMapMemory(CaveSpriteRAM, 0x200000, 0x20FFFF, MAP_RAM); - SekMapMemory(CavePalSrc, 0x500000, 0x50FFFF, MAP_ROM); - SekSetReadWordHandler(0, tjumpmanReadWord); - SekSetReadByteHandler(0, tjumpmanReadByte); - SekSetWriteWordHandler(0, tjumpmanWriteWord); - SekSetWriteByteHandler(0, tjumpmanWriteByte); - - SekMapHandler(1, 0x500000, 0x50FFFF, MAP_WRITE); - SekSetWriteWordHandler(1, tjumpmanWriteWordPalette); - SekSetWriteByteHandler(1, tjumpmanWriteBytePalette); - SekClose(); - } - - nCaveExtraXOffset = -128; // bg - CaveSpriteVisibleXOffset = -128; // sprite - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(2, 0x0200000); - CaveTileInitLayer(0, 0x100000, 8, 0x4000); - - MSM6295Init(0, 7575, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - - -// Tobikose! Jumpman - -static struct BurnRomInfo tjumpmanRomDesc[] = { - { "tj1_mpr-0c.u41", 0x80000, 0xde3030b8, BRF_PRG | BRF_PRG }, // 0 CPU #0 code - - { "tj1_obj-0a.u52", 0x80000, 0xb42cf8e8, BRF_GRA }, // 1 Sprite data - { "tj1_obj-1a.u53", 0x80000, 0x5f0124d7, BRF_GRA }, // 2 - - { "tj1_cha-0a.u60", 0x40000, 0x8aa08a38, BRF_GRA }, // 3 Layer 0 Tile data - { "tj1_cha-1a.u61", 0x40000, 0x50072c82, BRF_GRA }, // 4 - - { "tj1_voi-0a.u27", 0x40000, 0xb5693aae, BRF_SND }, // 5 MSM6295 #0 ADPCM data - - { "n44u3b.u3", 0x00117, 0x4cd79750, BRF_OPT }, // 6 PLDs - { "n44u1g.u1", 0x00117, 0xe226ec18, BRF_OPT }, // 7 -}; - -STD_ROM_PICK(tjumpman) -STD_ROM_FN(tjumpman) - -struct BurnDriverD BurnDrvTjumpman = { - "tjumpman", NULL, NULL, NULL, "1999", - "Tobikose! Jumpman\0", "Coin input not working?", "Namco", "Cave", - L"\u30E1\u30B0\u30EB\u3092\u3044\u308C\u3066\u306D!\0Tobikose! Jumpman\0", NULL, NULL, NULL, - BDF_16BIT_ONLY, 1, HARDWARE_CAVE_68K_ONLY | HARDWARE_CAVE_M6295, GBF_MISC, 0, - NULL, tjumpmanRomInfo, tjumpmanRomName, NULL, NULL, TjumpmanInputInfo, TjumpmanDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/cave/d_uopoko.cpp b/jan/src/burn/drv/cave/d_uopoko.cpp deleted file mode 100644 index 361010fd2..000000000 --- a/jan/src/burn/drv/cave/d_uopoko.cpp +++ /dev/null @@ -1,608 +0,0 @@ -// Uo Poko -#include "cave.h" -#include "ymz280b.h" - -#define CAVE_VBLANK_LINES 12 - -static UINT8 DrvJoy1[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT16 DrvInput[2] = {0x0000, 0x0000}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01; -static UINT8 *DefaultEEPROM = NULL; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT8 nVideoIRQ; -static INT8 nSoundIRQ; -static INT8 nUnknownIRQ; - -static INT8 nIRQPending; - -static INT32 nCurrentCPU; -static INT32 nCyclesDone[2]; -static INT32 nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo uopokoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 9, "diag"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service"}, -}; - -STDINPUTINFO(uopoko) - -static void UpdateIRQStatus() -{ - nIRQPending = (nVideoIRQ == 0 || nSoundIRQ == 0 || nUnknownIRQ == 0); - SekSetIRQLine(1, nIRQPending ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -UINT8 __fastcall uopokoReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300003: { - return YMZ280BReadStatus(); - } - - case 0x600000: - case 0x600001: - case 0x600002: - case 0x600003: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x600004: - case 0x600005: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x600006: - case 0x600007: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0x900000: - return (DrvInput[0] >> 8) ^ 0xFF; - case 0x900001: - return (DrvInput[0] & 0xFF) ^ 0xFF; - case 0x900002: - return ((DrvInput[1] >> 8) ^ 0xF7) | (EEPROMRead() << 3); - case 0x900003: - return (DrvInput[1] & 0xFF) ^ 0xFF; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -UINT16 __fastcall uopokoReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x300002: { - return YMZ280BReadStatus(); - } - - case 0x600000: - case 0x600002: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - return nRet; - } - case 0x600004: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nVideoIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - case 0x600006: { - UINT16 nRet = (nUnknownIRQ << 1) | nVideoIRQ; - nUnknownIRQ = 1; - UpdateIRQStatus(); - return nRet; - } - - case 0x900000: - return DrvInput[0] ^ 0xFFFF; - case 0x900002: - return (DrvInput[1] ^ 0xF7FF) | (EEPROMRead() << 11); - - default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall uopokoWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x300001: - YMZ280BSelectRegister(byteValue); - break; - case 0x300003: - YMZ280BWriteRegister(byteValue); - break; - - case 0xA00000: - EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall uopokoWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x300000: - YMZ280BSelectRegister(wordValue); - break; - case 0x300002: - YMZ280BWriteRegister(wordValue); - break; - - case 0x600000: - nCaveXOffset = wordValue; - return; - case 0x600002: - nCaveYOffset = wordValue; - return; - case 0x600008: - CaveSpriteBuffer(); - nCaveSpriteBank = wordValue; - return; - - case 0x700000: - CaveTileReg[0][0] = wordValue; - break; - case 0x700002: - CaveTileReg[0][1] = wordValue; - break; - case 0x700004: - CaveTileReg[0][2] = wordValue; - break; - - case 0xA00000: { - wordValue >>= 8; - EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08); - break; - } - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - } - } -} - -void __fastcall uopokoWriteBytePalette(UINT32 sekAddress, UINT8 byteValue) -{ - CavePalWriteByte(sekAddress & 0xFFFF, byteValue); -} - -void __fastcall uopokoWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - CavePalWriteWord(sekAddress & 0xFFFF, wordValue); -} - -static void TriggerSoundIRQ(INT32 nStatus) -{ - nSoundIRQ = nStatus ^ 1; - UpdateIRQStatus(); - - if (nIRQPending && nCurrentCPU != 0) { - nCyclesDone[0] += SekRun(0x0400); - } -} - -static INT32 DrvExit() -{ - YMZ280BExit(); - - EEPROMExit(); - - CaveTileExit(); - CaveSpriteExit(); - CavePalExit(); - - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - YMZ280BReset(); - - nVideoIRQ = 1; - nSoundIRQ = 1; - nUnknownIRQ = 1; - - nIRQPending = 0; - - return 0; -} - -static INT32 DrvDraw() -{ - CavePalUpdate8Bit(0, 128); // Update the palette - CaveClearScreen(CavePalette[0x7F00]); - - if (bDrawScreen) { -// CaveGetBitmap(); - - CaveTileRender(1); // Render tiles - } - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Player 1 - DrvInput[1] = 0x0000; // Player 2 - for (INT32 i = 0; i < 16; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } - CaveClearOpposites(&DrvInput[0]); - CaveClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * CAVE_REFRESHRATE)); - nCyclesDone[0] = 0; - - nCyclesVBlank = nCyclesTotal[0] - (INT32)((nCyclesTotal[0] * CAVE_VBLANK_LINES) / 271.5); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - SekOpen(0); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nNext; - - // Render sound segment - if ((i & 1) == 0) { - if (pBurnSoundOut) { - INT32 nSegmentEnd = nBurnSoundLen * i / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - YMZ280BRender(pSoundBuf, nSegmentEnd - nSoundBufferPos); - nSoundBufferPos = nSegmentEnd; - } - } - - // Run 68000 - nCurrentCPU = 0; - nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // See if we need to trigger the VBlank interrupt - if (!bVBlank && nNext > nCyclesVBlank) { - if (nCyclesDone[nCurrentCPU] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - bVBlank = true; - nVideoIRQ = 0; - UpdateIRQStatus(); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - nCurrentCPU = -1; - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - YMZ280BRender(pSoundBuf, nSegmentLength); - } - } - } - - SekClose(); - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // 68K program - CaveSpriteROM = Next; Next += 0x800000; - CaveTileROM[0] = Next; Next += 0x400000; // Tile layer 0 - YMZ280BROM = Next; Next += 0x200000; - DefaultEEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - CaveTileRAM[0] = Next; Next += 0x008000; - CaveSpriteRAM = Next; Next += 0x010000; - CavePalSrc = Next; Next += 0x010000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void NibbleSwap1(UINT8* pData, INT32 nLen) -{ - UINT8* pOrg = pData + nLen - 1; - UINT8* pDest = pData + ((nLen - 1) << 1); - - for (INT32 i = 0; i < nLen; i++, pOrg--, pDest -= 2) { - pDest[0] = *pOrg & 15; - pDest[1] = *pOrg >> 4; - } - - return; -} - -static void NibbleSwap4(UINT8* pData, INT32 nLen) -{ - for (INT32 i = 0; i < nLen; i++, pData += 2) { - UINT8 n1 = pData[0]; - UINT8 n2 = pData[1]; - - pData[1] = (n2 << 4) | (n1 & 0x0F); - pData[0] = (n2 & 0xF0) | (n1 >> 4); - } - - return; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01 + 0, 1, 2); - BurnLoadRom(Rom01 + 1, 0, 2); - - BurnLoadRom(CaveSpriteROM + 0x0000000, 2, 1); - NibbleSwap1(CaveSpriteROM, 0x400000); - - BurnLoadRom(CaveTileROM[0] + 0x000000, 3, 1); - NibbleSwap4(CaveTileROM[0], 0x200000); - - // Load YMZ280B data - BurnLoadRom(YMZ280BROM, 4, 1); - - BurnLoadRom(DefaultEEPROM, 5, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020902; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - YMZ280BScan(); - - SCAN_VAR(nVideoIRQ); - SCAN_VAR(nSoundIRQ); - SCAN_VAR(nUnknownIRQ); - SCAN_VAR(bVBlank); - - CaveScanGraphics(); - - SCAN_VAR(DrvInput); - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(CAVE_REFRESHRATE); - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C46); - if (!EEPROMAvailable()) EEPROMFill(DefaultEEPROM,0, 0x80); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(CaveSpriteRAM, 0x400000, 0x40FFFF, MAP_RAM); - SekMapMemory(CaveTileRAM[0], 0x500000, 0x507FFF, MAP_RAM); - - SekMapMemory(CavePalSrc, 0x800000, 0x80FFFF, MAP_ROM); // Palette RAM (write goes through handler) - SekMapHandler(1, 0x800000, 0x80FFFF, MAP_WRITE); // - - SekSetReadWordHandler(0, uopokoReadWord); - SekSetReadByteHandler(0, uopokoReadByte); - SekSetWriteWordHandler(0, uopokoWriteWord); - SekSetWriteByteHandler(0, uopokoWriteByte); - - SekSetWriteWordHandler(1,uopokoWriteWordPalette); - SekSetWriteByteHandler(1, uopokoWriteBytePalette); - - SekClose(); - } - - nCaveRowModeOffset = 1; - - CavePalInit(0x8000); - CaveTileInit(); - CaveSpriteInit(1, 0x800000); - CaveTileInitLayer(0, 0x400000, 8, 0x4000); - - YMZ280BInit(16934400, &TriggerSoundIRQ, 0x200000); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo uopokoRomDesc[] = { - { "u26.int", 0x080000, 0xb445c9ac, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "u25.int", 0x080000, 0xa1258482, BRF_ESS | BRF_PRG }, // 1 - - { "cave_cv-02_u33.u33", 0x400000, 0x5d142ad2, BRF_GRA }, // 2 Sprite data - - { "cave_cv-02_u49.u49", 0x400000, 0x12fb11bb, BRF_GRA }, // 3 Layer 0 Tile data - - { "cave_cv-02_u4.u4", 0x200000, 0xa2d0d755, BRF_SND }, // 4 YMZ280B (AD)PCM data - - { "eeprom-uopoko.bin", 0x0080, 0xf4a24b95, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(uopoko) -STD_ROM_FN(uopoko) - -static struct BurnRomInfo uopokojRomDesc[] = { - { "u26.bin", 0x080000, 0xE7EEC050, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "u25.bin", 0x080000, 0x68CB6211, BRF_ESS | BRF_PRG }, // 1 - - { "cave_cv-02_u33.u33", 0x400000, 0x5d142ad2, BRF_GRA }, // 2 Sprite data - - { "cave_cv-02_u49.u49", 0x400000, 0x12fb11bb, BRF_GRA }, // 3 Layer 0 Tile data - - { "cave_cv-02_u4.u4", 0x200000, 0xa2d0d755, BRF_SND }, // 4 YMZ280B (AD)PCM data - - { "eeprom-uopoko.bin", 0x0080, 0xf4a24b95, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(uopokoj) -STD_ROM_FN(uopokoj) - -struct BurnDriver BurnDrvUoPoko = { - "uopoko", NULL, NULL, NULL, "1999", - "Puzzle Uo Poko (International, ver. 98/02/06)\0", NULL, "Cave / Jaleco", "Cave", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_ONLY, GBF_PUZZLE, 0, - NULL, uopokoRomInfo, uopokoRomName, NULL, NULL, uopokoInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvUoPokoj = { - "uopokoj", "uopoko", NULL, NULL, "1999", - "Puzzle Uo Poko (Japan, ver. 98/02/06)\0", NULL, "Cave / Jaleco", "Cave", - L"\u30D1\u30BA\u30EB \u9B5A\u30DD\u30B3 \u3046\u304A\u307D\u3053 (Japan, ver. 98/02/06)\0Puzzle Uo Poko\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_CAVE_68K_ONLY, GBF_PUZZLE, 0, - NULL, uopokojRomInfo, uopokojRomName, NULL, NULL, uopokoInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &CaveRecalcPalette, 0x8000, 320, 240, 4, 3 -}; - - - diff --git a/jan/src/burn/drv/coleco/d_coleco.cpp b/jan/src/burn/drv/coleco/d_coleco.cpp deleted file mode 100644 index 1d41b7617..000000000 --- a/jan/src/burn/drv/coleco/d_coleco.cpp +++ /dev/null @@ -1,4981 +0,0 @@ -// FB Alpha ColecoVision console driver module -// Code by iq_132, fixups & bring up-to-date by dink Aug 19, 2014 - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -#include "sn76496.h" -#include "tms9928a.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80BIOS; -static UINT8 *DrvCartROM; -static UINT8 *DrvZ80RAM; - -static INT32 joy_mode; -static INT32 joy_status[2]; -static INT32 last_state; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvDips[2] = { 0, 0 }; -static UINT16 DrvInputs[4]; -static UINT8 DrvReset; -static UINT32 MegaCart; -static UINT32 MegaCartBank; - -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; - -static struct BurnInputInfo ColecoInputList[] = { - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Fire 1", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1" }, - {"P1 Fire 2", BIT_DIGITAL, DrvJoy1 + 14, "p1 fire 2" }, - {"P1 0", BIT_DIGITAL, DrvJoy1 + 0, "p1 0" }, - {"P1 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 1" }, - {"P1 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 2" }, - {"P1 3", BIT_DIGITAL, DrvJoy1 + 3, "p1 3" }, - {"P1 4", BIT_DIGITAL, DrvJoy1 + 4, "p1 4" }, - {"P1 5", BIT_DIGITAL, DrvJoy1 + 5, "p1 5" }, - {"P1 6", BIT_DIGITAL, DrvJoy1 + 6, "p1 6" }, - {"P1 7", BIT_DIGITAL, DrvJoy1 + 7, "p1 7" }, - {"P1 8", BIT_DIGITAL, DrvJoy1 + 8, "p1 8" }, - {"P1 9", BIT_DIGITAL, DrvJoy1 + 9, "p1 9" }, - {"P1 #", BIT_DIGITAL, DrvJoy1 + 10, "p1 #" }, - {"P1 *", BIT_DIGITAL, DrvJoy1 + 11, "p1 *" }, - - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 1, "p2 right" }, - {"P2 Fire 1", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 1" }, - {"P2 Fire 2", BIT_DIGITAL, DrvJoy3 + 14, "p2 fire 2" }, - {"P2 0", BIT_DIGITAL, DrvJoy3 + 0, "p2 0" }, - {"P2 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 1" }, - {"P2 2", BIT_DIGITAL, DrvJoy3 + 2, "p2 2" }, - {"P2 3", BIT_DIGITAL, DrvJoy3 + 3, "p2 3" }, - {"P2 4", BIT_DIGITAL, DrvJoy3 + 4, "p2 4" }, - {"P2 5", BIT_DIGITAL, DrvJoy3 + 5, "p2 5" }, - {"P2 6", BIT_DIGITAL, DrvJoy3 + 6, "p2 6" }, - {"P2 7", BIT_DIGITAL, DrvJoy3 + 7, "p2 7" }, - {"P2 8", BIT_DIGITAL, DrvJoy3 + 8, "p2 8" }, - {"P2 9", BIT_DIGITAL, DrvJoy3 + 9, "p2 9" }, - {"P2 #", BIT_DIGITAL, DrvJoy3 + 10, "p2 #" }, - {"P2 *", BIT_DIGITAL, DrvJoy3 + 11, "p2 *" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Controller Select", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Bios Select", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Coleco) - -static struct BurnDIPInfo ColecoDIPList[]= -{ - {0x25, 0xff, 0xff, 0x00, NULL }, - {0x26, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 3, "Port 1 Controller" }, - {0x25, 0x01, 0x07, 0x00, "ColecoVision Controller" }, - {0x25, 0x01, 0x07, 0x01, "Super Action Controller" }, - {0x25, 0x01, 0x07, 0x02, "Driving Controller" }, - - {0 , 0xfe, 0 , 2, "Port 2 Controller" }, - {0x25, 0x01, 0x70, 0x00, "ColecoVision Controller" }, - {0x25, 0x01, 0x70, 0x10, "Super Action Controller" }, - - {0 , 0xfe, 0 , 2, "Extra Controller" }, - {0x25, 0x01, 0x80, 0x00, "None" }, - {0x25, 0x01, 0x80, 0x80, "Roller Controller" }, - - {0 , 0xfe, 0 , 4, "Bios Select" }, - {0x26, 0x01, 0x03, 0x00, "Standard" }, - {0x26, 0x01, 0x03, 0x01, "Thick Characters" }, - {0x26, 0x01, 0x03, 0x02, "SVI-603 Coleco Game Adapter" }, - {0x26, 0x01, 0x03, 0x03, "Chuang Zao Zhe 50" }, - - {0 , 0xfe, 0, 2, "Bypass bios intro (hack)" }, - {0x26, 0x01, 0x10, 0x00, "Off" }, - {0x26, 0x01, 0x10, 0x10, "On" }, -}; - -STDDIPINFO(Coleco) - -static UINT8 paddle_r(INT32 paddle) -{ - INT32 ctrl_select = (DrvDips[0] >> (paddle ? 4 : 0)) & 0x07; - - UINT8 data = 0x0f; - - if (ctrl_select != 0x01) - { - if (joy_mode == 0) - { - UINT16 input = 0x0000; - - if (ctrl_select == 0x00) // colecovision controller - { - input = DrvInputs[(2 * paddle) + 0]; // keypad - } - else if (ctrl_select == 0x02) // super action controller controller - { - input = 0xffff; //input_port_read(space->machine, "SAC_KPD2"); - } - - if (ctrl_select != 0x03) - { - if (!(input & 0x0001)) data &= 0x0a; /* 0 */ - if (!(input & 0x0002)) data &= 0x0d; /* 1 */ - if (!(input & 0x0004)) data &= 0x07; /* 2 */ - if (!(input & 0x0008)) data &= 0x0c; /* 3 */ - if (!(input & 0x0010)) data &= 0x02; /* 4 */ - if (!(input & 0x0020)) data &= 0x03; /* 5 */ - if (!(input & 0x0040)) data &= 0x0e; /* 6 */ - if (!(input & 0x0080)) data &= 0x05; /* 7 */ - if (!(input & 0x0100)) data &= 0x01; /* 8 */ - if (!(input & 0x0200)) data &= 0x0b; /* 9 */ - if (!(input & 0x0400)) data &= 0x06; /* # */ - if (!(input & 0x0800)) data &= 0x09; /* . */ - if (!(input & 0x1000)) data &= 0x04; /* Blue Action Button */ - if (!(input & 0x2000)) data &= 0x08; /* Purple Action Button */ - } - - return ((input & 0x4000) >> 8) | 0x30 | (data); - } - else - { - if (ctrl_select == 0x00) // colecovision controller - { - data = DrvInputs[(2 * paddle) + 1] & 0xcf; // Joy - } - else if (ctrl_select == 0x02) // super action controller controller - { - data = 0xff & 0xcf; //input_port_read(space->machine, "SAC_JOY2") & 0xcf; - } - - if ((DrvDips[0] & 0x80) || (ctrl_select == 0x02) || (ctrl_select == 0x03)) - { - if (joy_status[paddle] == 0) data |= 0x30; - else if (joy_status[paddle] == 1) data |= 0x20; - } - - return data | 0x80; - } - } - - return data; -} - -static void paddle_callback() -{ - UINT8 analog1 = 0x00; - UINT8 analog2 = 0x00; - UINT8 ctrl_sel = DrvDips[0]; - - if ((ctrl_sel & 0x07) == 0x03) // Driving controller - analog1 = 0xff; //input_port_read_safe(machine, "DRIV", 0); - else - { - if ((ctrl_sel & 0x07) == 0x02) // Super Action Controller P1 - analog1 = 0xff; //input_port_read_safe(machine, "SAC_SLIDE1", 0); - - if ((ctrl_sel & 0x70) == 0x20) // Super Action Controller P2 - analog2 = 0xff; //input_port_read_safe(machine, "SAC_SLIDE2", 0); - - if (ctrl_sel & 0x80) // Roller controller - { - analog1 = 0xff; //input_port_read_safe(machine, "ROLLER_X", 0); - analog2 = 0xff; // input_port_read_safe(machine, "ROLLER_Y", 0); - } - } - - if (analog1 == 0) - joy_status[0] = 0; - else if (analog1 & 0x08) - joy_status[0] = -1; - else - joy_status[0] = 1; - - if (analog2 == 0) - joy_status[1] = 0; - else if (analog2 & 0x08) - joy_status[1] = -1; - else - joy_status[1] = 1; - - if (joy_status[0] || joy_status[1]) { - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); // ACK? -- lower when input read? - } -} - -void __fastcall coleco_write_port(UINT16 port, UINT8 data) -{ - switch (port & ~0xff1e) - { - case 0x80: - case 0x81: - joy_mode = 0; - return; - - case 0xa0: - TMS9928AWriteVRAM(data); - return; - - case 0xa1: - TMS9928AWriteRegs(data); - return; - - case 0xc0: - case 0xc1: - joy_mode = 1; - return; - - case 0xe0: - case 0xe1: - SN76496Write(0, data); - return; - } -} - -UINT8 __fastcall coleco_read_port(UINT16 port) -{ - switch (port & ~0xff1e) - { - case 0xa0: - return TMS9928AReadVRAM(); - - case 0xa1: - return TMS9928AReadRegs(); - - case 0xe0: - case 0xe1: - return paddle_r(0); - - case 0xe2: - case 0xe3: - return paddle_r(1); - } - - return 0; -} - -static void coleco_vdp_interrupt(INT32 state) -{ - if (state && !last_state) - ZetNmi(); - - last_state = state; -} - -static void CVFastLoadHack() { - if (DrvDips[1] & 0x10) { - DrvZ80BIOS[0x13f1] = 0x00; - DrvZ80BIOS[0x13f2] = 0x00; - DrvZ80BIOS[0x13f3] = 0x00; - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - BurnLoadRom(DrvZ80BIOS, 0x80 + (DrvDips[1] & 3), 1); - CVFastLoadHack(); - - ZetOpen(0); - ZetReset(); - ZetSetVector(0xff); - ZetClose(); - - TMS9928AReset(); - - memset (DrvZ80RAM, 0xff, 0x400); // ram initialized to 0xff - - last_state = 0; // irq state... - MegaCartBank = 0; - - return 0; -} - -#if 0 -static void __fastcall main_write(UINT16 address, UINT8 data) -{ - // maybe we should support bankswitching on writes too? - //bprintf(0, _T("mw %X,"), address); -} -#endif - -static UINT8 __fastcall main_read(UINT16 address) -{ - if (address >= 0xffc0/* && address <= 0xffff*/) { - UINT32 MegaCartBanks = MegaCart / 0x4000; - - MegaCartBank = (0xffff - address) & (MegaCartBanks - 1); - - MegaCartBank = (MegaCartBanks - MegaCartBank) - 1; - - return 0; - } - - if (address >= 0xc000 && address <= 0xffbf) - return DrvCartROM[(MegaCartBank * 0x4000) + (address - 0xc000)]; - - //bprintf(0, _T("mr %X,"), address); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80BIOS = Next; Next += 0x004000; - DrvCartROM = Next; Next += 0x100000; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000400; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - // refresh rate 59.92hz - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - MegaCart = 0; - - { - char* pRomName; - struct BurnRomInfo ri; - - if (BurnLoadRom(DrvZ80BIOS, 0x80, 1)) return 1; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & BRF_PRG) && (ri.nLen == 0x2000 || ri.nLen == 0x1000) && (i<10)) { - BurnLoadRom(DrvCartROM+(i * 0x2000), i, 1); - bprintf(0, _T("ColecoVision romload #%d\n"), i); - } else if ((ri.nType & BRF_PRG) && (i<10)) { // Load rom thats not in 0x2000 (8k) chunks - bprintf(0, _T("ColecoVision romload (unsegmented) #%d size: %X\n"), i, ri.nLen); - BurnLoadRom(DrvCartROM, i, 1); - if (ri.nLen >= 0x20000) MegaCart = ri.nLen; - } - } - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x1fff, 0, DrvZ80BIOS); - ZetMapArea(0x0000, 0x1fff, 2, DrvZ80BIOS); - - for (INT32 i = 0x6000; i < 0x8000; i+=0x0400) { - ZetMapArea(i + 0x0000, i + 0x03ff, 0, DrvZ80RAM); - ZetMapArea(i + 0x0000, i + 0x03ff, 1, DrvZ80RAM); - ZetMapArea(i + 0x0000, i + 0x03ff, 2, DrvZ80RAM); - } - - if (MegaCart) { - // MegaCart - UINT32 MegaCartBanks = MegaCart / 0x4000; - UINT32 lastbank = (MegaCartBanks - 1) * 0x4000; - bprintf(0, _T("ColecoVision MegaCart: mapping cartrom[%X] to 0x8000 - 0xbfff.\n"), lastbank); - ZetMapArea(0x8000, 0xbfff, 0, DrvCartROM + lastbank); - ZetMapArea(0x8000, 0xbfff, 2, DrvCartROM + lastbank); - ZetSetReadHandler(main_read); - //ZetSetWriteHandler(main_write); - } else { - // Regular CV Cart - ZetMapArea(0x8000, 0xffff, 0, DrvCartROM); - ZetMapArea(0x8000, 0xffff, 2, DrvCartROM); - } - - - ZetSetOutHandler(coleco_write_port); - ZetSetInHandler(coleco_read_port); - ZetClose(); - - TMS9928AInit(TMS99x8A, 0x4000, 0, 0, coleco_vdp_interrupt); - - SN76489AInit(0, 3579545, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - TMS9928AExit(); - ZetExit(); - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 4 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal = 3579545 / 60; - INT32 nCyclesDone = 0; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal / nInterleave; - - nCyclesDone += ZetRun(nSegment); - - TMS9928AScanline(i); - - if ((i%5)==4) paddle_callback(); // 50x / frame (3000x / sec) - } - - ZetClose(); - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - TMS9928ADraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029708; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - - TMS9928AScan(nAction, pnMin); - - SCAN_VAR(joy_mode); - SCAN_VAR(joy_status); - SCAN_VAR(last_state); - } - - return 0; -} - -INT32 CVGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = BurnDrvGetTextA(DRV_NAME); - } else { - if (i == 1 && BurnDrvGetTextA(DRV_BOARDROM)) { - pszGameName = BurnDrvGetTextA(DRV_BOARDROM); - } else { - pszGameName = BurnDrvGetTextA(DRV_PARENT); - } - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - - // remove the "CV_" - for (UINT32 j = 0; j < strlen(pszGameName); j++) { - szFilename[j] = pszGameName[j + 3]; - } - - *pszName = szFilename; - - return 0; -} - -// ColecoVision - -static struct BurnRomInfo cv_colecoRomDesc[] = { - { "coleco.rom", 0x2000, 0x3aa93ef3, BRF_PRG | BRF_BIOS }, // 0x80 - Normal (Coleco, 1982) - { "colecoa.rom", 0x2000, 0x39bb16fc, BRF_PRG | BRF_BIOS | BRF_OPT }, // 0x81 - Thick Characters (Coleco, 1982) - { "svi603.rom", 0x2000, 0x19e91b82, BRF_PRG | BRF_BIOS | BRF_OPT }, // 0x82 - SVI-603 Coleco Game Adapter (Spectravideo, 1983) - { "czz50.rom", 0x4000, 0x4999abc6, BRF_PRG | BRF_BIOS | BRF_OPT }, // 0x83 - Chuang Zao Zhe 50 (Bit Corporation, 1986) -}; - -STD_ROM_PICK(cv_coleco) -STD_ROM_FN(cv_coleco) - -struct BurnDriver BurnDrvcv_Coleco = { - "cv_coleco", NULL, NULL, NULL, "1982", - "ColecoVision System BIOS\0", "BIOS only", "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_BOARDROM, 0, HARDWARE_COLECO, GBF_BIOS, 0, - CVGetZipName, cv_colecoRomInfo, cv_colecoRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - -// Homebrew games - -static struct BurnRomInfo cv_diggerRomDesc[] = { - { "digger_cv.rom", 0x06000, 0x77088cab, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_digger, cv_digger, cv_coleco) -STD_ROM_FN(cv_digger) - -struct BurnDriver BurnDrvcv_digger = { - "cv_digger", NULL, "cv_coleco", NULL, "2012", - "Digger\0", NULL, "Coleco*Windmill Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_diggerRomInfo, cv_diggerRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - -static struct BurnRomInfo cv_questgcRomDesc[] = { - { "quest_golden_chalice_colecovision.rom", 0x08000, 0x6da37da8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_questgc, cv_questgc, cv_coleco) -STD_ROM_FN(cv_questgc) - -struct BurnDriver BurnDrvcv_questgc = { - "cv_questgc", NULL, "cv_coleco", NULL, "2012", - "Quest for the Golden Chalice\0", NULL, "Coleco*Team Pixelboy", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_questgcRomInfo, cv_questgcRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - -static struct BurnRomInfo cv_princessquestRomDesc[] = { - { "princess_quest_colecovision.rom", 0x40000, 0xa59eaa2b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_princessquest, cv_princessquest, cv_coleco) -STD_ROM_FN(cv_princessquest) - -struct BurnDriver BurnDrvcv_princessquest = { - "cv_pquest", NULL, "cv_coleco", NULL, "2012", - "Princess Quest\0", NULL, "Coleco*Nanochess", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_princessquestRomInfo, cv_princessquestRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - -static struct BurnRomInfo cv_danslitherRomDesc[] = { - { "danslither.rom", 0x0402a, 0x92624cff, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_danslither, cv_danslither, cv_coleco) -STD_ROM_FN(cv_danslither) - -struct BurnDriver BurnDrvcv_danslither = { - "cv_danslither", "cv_slither", "cv_coleco", NULL, "1983", - "Slither (Joystick Version)\0", NULL, "Coleco*Daniel Bienvenu", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_danslitherRomInfo, cv_danslitherRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - -// End of driver, the following driver info. has been synthesized from hash/coleco.xml of MESS -// Note: when re-converting coleco.xml, make sure to change "&" to "and"! -// Note2: don't forget to add notice to choplifter: "Corrupted sprites. Use (Alt) version!" -// Castelo - -static struct BurnRomInfo cv_casteloRomDesc[] = { - { "castelo.bin", 0x02000, 0x07a3d3db, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_castelo, cv_castelo, cv_coleco) -STD_ROM_FN(cv_castelo) - -struct BurnDriver BurnDrvcv_castelo = { - "cv_castelo", NULL, "cv_coleco", NULL, "1985", - "Castelo\0", NULL, "Splice Vision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_casteloRomInfo, cv_casteloRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Q*bert - -static struct BurnRomInfo cv_qbertRomDesc[] = { - { "qbert.bin", 0x02000, 0x532f61ba, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_qbert, cv_qbert, cv_coleco) -STD_ROM_FN(cv_qbert) - -struct BurnDriver BurnDrvcv_qbert = { - "cv_qbert", NULL, "cv_coleco", NULL, "1983", - "Q*bert\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_qbertRomInfo, cv_qbertRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Q*bert (Alt) - -static struct BurnRomInfo cv_qbertaRomDesc[] = { - { "qberta.bin", 0x02000, 0x13f06adc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_qberta, cv_qberta, cv_coleco) -STD_ROM_FN(cv_qberta) - -struct BurnDriver BurnDrvcv_qberta = { - "cv_qberta", "cv_qbert", "cv_coleco", NULL, "1983", - "Q*bert (Alt)\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_qbertaRomInfo, cv_qbertaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Cobra - -static struct BurnRomInfo cv_scobraRomDesc[] = { - { "scobra.bin", 0x02000, 0x6cb5cb8f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_scobra, cv_scobra, cv_coleco) -STD_ROM_FN(cv_scobra) - -struct BurnDriver BurnDrvcv_scobra = { - "cv_scobra", NULL, "cv_coleco", NULL, "1983", - "Super Cobra\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_scobraRomInfo, cv_scobraRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Cobra (Alt) - -static struct BurnRomInfo cv_scobraaRomDesc[] = { - { "scobraa.bin", 0x02000, 0xf84622d2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_scobraa, cv_scobraa, cv_coleco) -STD_ROM_FN(cv_scobraa) - -struct BurnDriver BurnDrvcv_scobraa = { - "cv_scobraa", "cv_scobra", "cv_coleco", NULL, "1983", - "Super Cobra (Alt)\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_scobraaRomInfo, cv_scobraaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Sketch - -static struct BurnRomInfo cv_ssketchRomDesc[] = { - { "ssketch.bin", 0x02000, 0x8627300a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_ssketch, cv_ssketch, cv_coleco) -STD_ROM_FN(cv_ssketch) - -struct BurnDriver BurnDrvcv_ssketch = { - "cv_ssketch", NULL, "cv_coleco", NULL, "1984", - "Super Sketch\0", NULL, "Personal Peripherals", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_ssketchRomInfo, cv_ssketchRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Antarctic Adventure - -static struct BurnRomInfo cv_antarctRomDesc[] = { - { "antaradv.1", 0x02000, 0xfbeb5fad, BRF_PRG | BRF_ESS }, - { "antaradv.2", 0x02000, 0x0f4d40dc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_antarct, cv_antarct, cv_coleco) -STD_ROM_FN(cv_antarct) - -struct BurnDriver BurnDrvcv_antarct = { - "cv_antarct", NULL, "cv_coleco", NULL, "1984", - "Antarctic Adventure\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_antarctRomInfo, cv_antarctRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Alphabet Zoo - -static struct BurnRomInfo cv_alphazooRomDesc[] = { - { "alphazoo.1", 0x02000, 0xae42a206, BRF_PRG | BRF_ESS }, - { "alphazoo.2", 0x02000, 0x953ad47c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_alphazoo, cv_alphazoo, cv_coleco) -STD_ROM_FN(cv_alphazoo) - -struct BurnDriver BurnDrvcv_alphazoo = { - "cv_alphazoo", NULL, "cv_coleco", NULL, "1984", - "Alphabet Zoo\0", NULL, "Spinnaker Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_alphazooRomInfo, cv_alphazooRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Amazing Bumpman - -static struct BurnRomInfo cv_amazingRomDesc[] = { - { "amazing.1", 0x02000, 0xd3cae98d, BRF_PRG | BRF_ESS }, - { "amazing.2", 0x02000, 0x36d0e09e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_amazing, cv_amazing, cv_coleco) -STD_ROM_FN(cv_amazing) - -struct BurnDriver BurnDrvcv_amazing = { - "cv_amazing", NULL, "cv_coleco", NULL, "1986", - "Amazing Bumpman\0", NULL, "Telegames", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_amazingRomInfo, cv_amazingRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Number Bumper - -static struct BurnRomInfo cv_numbumpRomDesc[] = { - { "numbump.1", 0x02000, 0x4a2cb66a, BRF_PRG | BRF_ESS }, - { "numbump.2", 0x02000, 0xaf68a52d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_numbump, cv_numbump, cv_coleco) -STD_ROM_FN(cv_numbump) - -struct BurnDriver BurnDrvcv_numbump = { - "cv_numbump", "cv_amazing", "cv_coleco", NULL, "1984", - "Number Bumper\0", NULL, "Sunrise Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_numbumpRomInfo, cv_numbumpRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Aquattack - -static struct BurnRomInfo cv_aquatackRomDesc[] = { - { "aquatack.1", 0x02000, 0x96c60fa2, BRF_PRG | BRF_ESS }, - { "aquatack.2", 0x02000, 0x628dd0cb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_aquatack, cv_aquatack, cv_coleco) -STD_ROM_FN(cv_aquatack) - -struct BurnDriver BurnDrvcv_aquatack = { - "cv_aquatack", NULL, "cv_coleco", NULL, "1984", - "Aquattack\0", NULL, "Interphase", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_aquatackRomInfo, cv_aquatackRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Aquattack (Alt) - -static struct BurnRomInfo cv_aquatackaRomDesc[] = { - { "aquatacka.1", 0x02000, 0x7f33f73a, BRF_PRG | BRF_ESS }, - { "aquatacka.2", 0x02000, 0x8f3553eb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_aquatacka, cv_aquatacka, cv_coleco) -STD_ROM_FN(cv_aquatacka) - -struct BurnDriver BurnDrvcv_aquatacka = { - "cv_aquatacka", "cv_aquatack", "cv_coleco", NULL, "1984", - "Aquattack (Alt)\0", NULL, "Interphase", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_aquatackaRomInfo, cv_aquatackaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Artillery Duel - -static struct BurnRomInfo cv_artduelRomDesc[] = { - { "artduel.1", 0x02000, 0x4e18f196, BRF_PRG | BRF_ESS }, - { "artduel.2", 0x02000, 0x778c5a52, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_artduel, cv_artduel, cv_coleco) -STD_ROM_FN(cv_artduel) - -struct BurnDriver BurnDrvcv_artduel = { - "cv_artduel", NULL, "cv_coleco", NULL, "1983", - "Artillery Duel\0", NULL, "Xonox", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_artduelRomInfo, cv_artduelRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// BC's Quest for Tires - -static struct BurnRomInfo cv_bcquestRomDesc[] = { - { "bcquest.1", 0x02000, 0x1b866fb5, BRF_PRG | BRF_ESS }, - { "bcquest.2", 0x02000, 0xcf56f6fc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_bcquest, cv_bcquest, cv_coleco) -STD_ROM_FN(cv_bcquest) - -struct BurnDriver BurnDrvcv_bcquest = { - "cv_bcquest", NULL, "cv_coleco", NULL, "1983", - "BC's Quest for Tires\0", NULL, "Sierra On-Line", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_bcquestRomInfo, cv_bcquestRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Beamrider - -static struct BurnRomInfo cv_beamridrRomDesc[] = { - { "beamridr.1", 0x02000, 0x7f08b2f4, BRF_PRG | BRF_ESS }, - { "beamridr.2", 0x02000, 0x5cef708a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_beamridr, cv_beamridr, cv_coleco) -STD_ROM_FN(cv_beamridr) - -struct BurnDriver BurnDrvcv_beamridr = { - "cv_beamridr", NULL, "cv_coleco", NULL, "1983", - "Beamrider\0", NULL, "Activision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_beamridrRomInfo, cv_beamridrRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Blockade Runner - -static struct BurnRomInfo cv_blockrunRomDesc[] = { - { "blockrun.1", 0x02000, 0x2f153090, BRF_PRG | BRF_ESS }, - { "blockrun.2", 0x02000, 0x74ebff13, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_blockrun, cv_blockrun, cv_coleco) -STD_ROM_FN(cv_blockrun) - -struct BurnDriver BurnDrvcv_blockrun = { - "cv_blockrun", NULL, "cv_coleco", NULL, "1984", - "Blockade Runner\0", NULL, "Interphase", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_blockrunRomInfo, cv_blockrunRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Boulder Dash - -static struct BurnRomInfo cv_bdashRomDesc[] = { - { "bdash.1", 0x02000, 0xaee6e532, BRF_PRG | BRF_ESS }, - { "bdash.2", 0x02000, 0x1092afb5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_bdash, cv_bdash, cv_coleco) -STD_ROM_FN(cv_bdash) - -struct BurnDriver BurnDrvcv_bdash = { - "cv_bdash", NULL, "cv_coleco", NULL, "1984", - "Boulder Dash\0", NULL, "Telegames", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_bdashRomInfo, cv_bdashRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Brain Strainers - -static struct BurnRomInfo cv_brainstrRomDesc[] = { - { "brainstr.1", 0x02000, 0x5de3b863, BRF_PRG | BRF_ESS }, - { "brainstr.2", 0x02000, 0x690d25eb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_brainstr, cv_brainstr, cv_coleco) -STD_ROM_FN(cv_brainstr) - -struct BurnDriver BurnDrvcv_brainstr = { - "cv_brainstr", NULL, "cv_coleco", NULL, "1984", - "Brain Strainers\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_brainstrRomInfo, cv_brainstrRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Burgertime - -static struct BurnRomInfo cv_btimeRomDesc[] = { - { "btime.1", 0x02000, 0x0440c21e, BRF_PRG | BRF_ESS }, - { "btime.2", 0x02000, 0x55522e34, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_btime, cv_btime, cv_coleco) -STD_ROM_FN(cv_btime) - -struct BurnDriver BurnDrvcv_btime = { - "cv_btime", NULL, "cv_coleco", NULL, "1984", - "Burgertime\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_btimeRomInfo, cv_btimeRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Cabbage Patch Kids: Adventure in the Park - -static struct BurnRomInfo cv_cabbageRomDesc[] = { - { "cabbage.1", 0x02000, 0x6a8fa43b, BRF_PRG | BRF_ESS }, - { "cabbage.2", 0x02000, 0x49b92492, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_cabbage, cv_cabbage, cv_coleco) -STD_ROM_FN(cv_cabbage) - -struct BurnDriver BurnDrvcv_cabbage = { - "cv_cabbage", NULL, "cv_coleco", NULL, "1984", - "Cabbage Patch Kids: Adventure in the Park\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_cabbageRomInfo, cv_cabbageRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Campaign '84 - -static struct BurnRomInfo cv_campaignRomDesc[] = { - { "campaign.1", 0x02000, 0xd657ab6b, BRF_PRG | BRF_ESS }, - { "campaign.2", 0x02000, 0x844aefcf, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_campaign, cv_campaign, cv_coleco) -STD_ROM_FN(cv_campaign) - -struct BurnDriver BurnDrvcv_campaign = { - "cv_campaign", NULL, "cv_coleco", NULL, "1983", - "Campaign '84\0", NULL, "Sunrise Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_campaignRomInfo, cv_campaignRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Carnival - -static struct BurnRomInfo cv_carnivalRomDesc[] = { - { "carnival.1", 0x02000, 0x3cab8c1f, BRF_PRG | BRF_ESS }, - { "carnival.2", 0x02000, 0x4cf856a9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_carnival, cv_carnival, cv_coleco) -STD_ROM_FN(cv_carnival) - -struct BurnDriver BurnDrvcv_carnival = { - "cv_carnival", NULL, "cv_coleco", NULL, "1982", - "Carnival\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_carnivalRomInfo, cv_carnivalRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Cosmic Avenger - -static struct BurnRomInfo cv_cavengerRomDesc[] = { - { "cavenger.1", 0x02000, 0xc852bee7, BRF_PRG | BRF_ESS }, - { "cavenger.2", 0x02000, 0x75da80eb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_cavenger, cv_cavenger, cv_coleco) -STD_ROM_FN(cv_cavenger) - -struct BurnDriver BurnDrvcv_cavenger = { - "cv_cavenger", NULL, "cv_coleco", NULL, "1982", - "Cosmic Avenger\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_cavengerRomInfo, cv_cavengerRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Cosmic Avenger (Alt) - -static struct BurnRomInfo cv_cavengeraRomDesc[] = { - { "cavenger.1", 0x02000, 0xc852bee7, BRF_PRG | BRF_ESS }, - { "cavengera.2", 0x02000, 0x58d86f66, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_cavengera, cv_cavengera, cv_coleco) -STD_ROM_FN(cv_cavengera) - -struct BurnDriver BurnDrvcv_cavengera = { - "cv_cavengera", "cv_cavenger", "cv_coleco", NULL, "1982", - "Cosmic Avenger (Alt)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_cavengeraRomInfo, cv_cavengeraRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Cosmic Crisis - -static struct BurnRomInfo cv_ccrisisRomDesc[] = { - { "ccrisis.1", 0x02000, 0xf8084e5a, BRF_PRG | BRF_ESS }, - { "ccrisis.2", 0x02000, 0x8c841d6a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_ccrisis, cv_ccrisis, cv_coleco) -STD_ROM_FN(cv_ccrisis) - -struct BurnDriver BurnDrvcv_ccrisis = { - "cv_ccrisis", NULL, "cv_coleco", NULL, "1983", - "Cosmic Crisis\0", NULL, "Telegames", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_ccrisisRomInfo, cv_ccrisisRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Centipede - -static struct BurnRomInfo cv_centipedRomDesc[] = { - { "centiped.1", 0x02000, 0x4afc1fea, BRF_PRG | BRF_ESS }, - { "centiped.2", 0x02000, 0x9ca2a63d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_centiped, cv_centiped, cv_coleco) -STD_ROM_FN(cv_centiped) - -struct BurnDriver BurnDrvcv_centiped = { - "cv_centiped", NULL, "cv_coleco", NULL, "1983", - "Centipede\0", NULL, "Atarisoft", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_centipedRomInfo, cv_centipedRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Choplifter! - -static struct BurnRomInfo cv_chopliftRomDesc[] = { - { "choplift.1", 0x02000, 0x78564c16, BRF_PRG | BRF_ESS }, - { "choplift.2", 0x02000, 0xb1abf125, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_choplift, cv_choplift, cv_coleco) -STD_ROM_FN(cv_choplift) - -struct BurnDriver BurnDrvcv_choplift = { - "cv_choplift", NULL, "cv_coleco", NULL, "1984", - "Choplifter!\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_chopliftRomInfo, cv_chopliftRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Chuck Norris Superkicks - -static struct BurnRomInfo cv_chucknorRomDesc[] = { - { "chucknor.1", 0x02000, 0x3c04540f, BRF_PRG | BRF_ESS }, - { "chucknor.2", 0x02000, 0xa5c58202, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_chucknor, cv_chucknor, cv_coleco) -STD_ROM_FN(cv_chucknor) - -struct BurnDriver BurnDrvcv_chucknor = { - "cv_chucknor", NULL, "cv_coleco", NULL, "1983", - "Chuck Norris Superkicks\0", NULL, "Xonox", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_chucknorRomInfo, cv_chucknorRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Decathlon - -static struct BurnRomInfo cv_decathlnRomDesc[] = { - { "decathln.1", 0x02000, 0xaa99fda4, BRF_PRG | BRF_ESS }, - { "decathln.2", 0x02000, 0x42b76bc2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_decathln, cv_decathln, cv_coleco) -STD_ROM_FN(cv_decathln) - -struct BurnDriver BurnDrvcv_decathln = { - "cv_decathln", NULL, "cv_coleco", NULL, "1984", - "Decathlon\0", NULL, "Activision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_decathlnRomInfo, cv_decathlnRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Donkey Kong - -static struct BurnRomInfo cv_dkongRomDesc[] = { - { "dkong.1", 0x02000, 0x1a63176e, BRF_PRG | BRF_ESS }, - { "dkong.2", 0x02000, 0xad6162cd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_dkong, cv_dkong, cv_coleco) -STD_ROM_FN(cv_dkong) - -struct BurnDriver BurnDrvcv_dkong = { - "cv_dkong", NULL, "cv_coleco", NULL, "1982", - "Donkey Kong\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_dkongRomInfo, cv_dkongRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Donkey Kong Junior - -static struct BurnRomInfo cv_dkongjrRomDesc[] = { - { "dkongjr.1", 0x02000, 0x2c3d41bc, BRF_PRG | BRF_ESS }, - { "dkongjr.2", 0x02000, 0xc9be6a65, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_dkongjr, cv_dkongjr, cv_coleco) -STD_ROM_FN(cv_dkongjr) - -struct BurnDriver BurnDrvcv_dkongjr = { - "cv_dkongjr", NULL, "cv_coleco", NULL, "1983", - "Donkey Kong Junior\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_dkongjrRomInfo, cv_dkongjrRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mr. Do!'s Castle - -static struct BurnRomInfo cv_docastleRomDesc[] = { - { "docastle.1", 0x02000, 0x525a7d10, BRF_PRG | BRF_ESS }, - { "docastle.2", 0x02000, 0xe46ce496, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_docastle, cv_docastle, cv_coleco) -STD_ROM_FN(cv_docastle) - -struct BurnDriver BurnDrvcv_docastle = { - "cv_docastle", NULL, "cv_coleco", NULL, "1983", - "Mr. Do!'s Castle\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_docastleRomInfo, cv_docastleRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// DragonFire - -static struct BurnRomInfo cv_drgnfireRomDesc[] = { - { "drgnfire.1", 0x02000, 0x4272d250, BRF_PRG | BRF_ESS }, - { "drgnfire.2", 0x02000, 0xe68e9e70, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_drgnfire, cv_drgnfire, cv_coleco) -STD_ROM_FN(cv_drgnfire) - -struct BurnDriver BurnDrvcv_drgnfire = { - "cv_drgnfire", NULL, "cv_coleco", NULL, "1984", - "DragonFire\0", NULL, "Imagic", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_drgnfireRomInfo, cv_drgnfireRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Dr. Seuss's Fix-Up the Mix-Up Puzzler - -static struct BurnRomInfo cv_drseussRomDesc[] = { - { "drseuss.1", 0x02000, 0x47cf6908, BRF_PRG | BRF_ESS }, - { "drseuss.2", 0x02000, 0xb524f389, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_drseuss, cv_drseuss, cv_coleco) -STD_ROM_FN(cv_drseuss) - -struct BurnDriver BurnDrvcv_drseuss = { - "cv_drseuss", NULL, "cv_coleco", NULL, "1984", - "Dr. Seuss's Fix-Up the Mix-Up Puzzler\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_drseussRomInfo, cv_drseussRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Evolution - -static struct BurnRomInfo cv_evolutioRomDesc[] = { - { "evolutio.1", 0x02000, 0x75a9c817, BRF_PRG | BRF_ESS }, - { "evolutio.2", 0x02000, 0x6e32b9de, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_evolutio, cv_evolutio, cv_coleco) -STD_ROM_FN(cv_evolutio) - -struct BurnDriver BurnDrvcv_evolutio = { - "cv_evolutio", NULL, "cv_coleco", NULL, "1983", - "Evolution\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_evolutioRomInfo, cv_evolutioRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Fathom - -static struct BurnRomInfo cv_fathomRomDesc[] = { - { "fathom.1", 0x02000, 0xbf04e505, BRF_PRG | BRF_ESS }, - { "fathom.2", 0x02000, 0x606061c7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_fathom, cv_fathom, cv_coleco) -STD_ROM_FN(cv_fathom) - -struct BurnDriver BurnDrvcv_fathom = { - "cv_fathom", NULL, "cv_coleco", NULL, "1983", - "Fathom\0", NULL, "Imagic", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_fathomRomInfo, cv_fathomRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Flipper Slipper - -static struct BurnRomInfo cv_flipslipRomDesc[] = { - { "flipslip.1", 0x02000, 0xe26569f3, BRF_PRG | BRF_ESS }, - { "flipslip.2", 0x02000, 0xd4ab0e71, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_flipslip, cv_flipslip, cv_coleco) -STD_ROM_FN(cv_flipslip) - -struct BurnDriver BurnDrvcv_flipslip = { - "cv_flipslip", NULL, "cv_coleco", NULL, "1983", - "Flipper Slipper\0", NULL, "Spectravideo", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_flipslipRomInfo, cv_flipslipRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Frantic Freddy - -static struct BurnRomInfo cv_ffreddyRomDesc[] = { - { "ffreddy.1", 0x02000, 0xe33ccf02, BRF_PRG | BRF_ESS }, - { "ffreddy.2", 0x02000, 0xd3ece1bc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_ffreddy, cv_ffreddy, cv_coleco) -STD_ROM_FN(cv_ffreddy) - -struct BurnDriver BurnDrvcv_ffreddy = { - "cv_ffreddy", NULL, "cv_coleco", NULL, "1983", - "Frantic Freddy\0", NULL, "Spectravideo", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_ffreddyRomInfo, cv_ffreddyRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Frogger - -static struct BurnRomInfo cv_froggerRomDesc[] = { - { "frogger.1", 0x02000, 0xa213cda1, BRF_PRG | BRF_ESS }, - { "frogger.2", 0x02000, 0x1556c226, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_frogger, cv_frogger, cv_coleco) -STD_ROM_FN(cv_frogger) - -struct BurnDriver BurnDrvcv_frogger = { - "cv_frogger", NULL, "cv_coleco", NULL, "1983", - "Frogger\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_froggerRomInfo, cv_froggerRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Frogger II: Threedeep! - -static struct BurnRomInfo cv_frogger2RomDesc[] = { - { "frogger2.1", 0x02000, 0xdd616176, BRF_PRG | BRF_ESS }, - { "frogger2.2", 0x02000, 0x3275dc33, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_frogger2, cv_frogger2, cv_coleco) -STD_ROM_FN(cv_frogger2) - -struct BurnDriver BurnDrvcv_frogger2 = { - "cv_frogger2", NULL, "cv_coleco", NULL, "1984", - "Frogger II: Threedeep!\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_frogger2RomInfo, cv_frogger2RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Gateway to Apshai - -static struct BurnRomInfo cv_apshaiRomDesc[] = { - { "apshai.1", 0x02000, 0xaa3ec181, BRF_PRG | BRF_ESS }, - { "apshai.2", 0x02000, 0x0e440f8f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_apshai, cv_apshai, cv_coleco) -STD_ROM_FN(cv_apshai) - -struct BurnDriver BurnDrvcv_apshai = { - "cv_apshai", NULL, "cv_coleco", NULL, "1984", - "Gateway to Apshai\0", NULL, "Epyx", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_apshaiRomInfo, cv_apshaiRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Gorf - -static struct BurnRomInfo cv_gorfRomDesc[] = { - { "gorf.1", 0x02000, 0xbe7b03b6, BRF_PRG | BRF_ESS }, - { "gorf.2", 0x02000, 0xa75a408a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_gorf, cv_gorf, cv_coleco) -STD_ROM_FN(cv_gorf) - -struct BurnDriver BurnDrvcv_gorf = { - "cv_gorf", NULL, "cv_coleco", NULL, "1983", - "Gorf\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_gorfRomInfo, cv_gorfRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Gust Buster - -static struct BurnRomInfo cv_gustbustRomDesc[] = { - { "gustbust.1", 0x02000, 0x3fb1866e, BRF_PRG | BRF_ESS }, - { "gustbust.2", 0x02000, 0x2dcf1da7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_gustbust, cv_gustbust, cv_coleco) -STD_ROM_FN(cv_gustbust) - -struct BurnDriver BurnDrvcv_gustbust = { - "cv_gustbust", NULL, "cv_coleco", NULL, "1983", - "Gust Buster\0", NULL, "Sunrise Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_gustbustRomInfo, cv_gustbustRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Gyruss - -static struct BurnRomInfo cv_gyrussRomDesc[] = { - { "gyruss.1", 0x02000, 0x05543060, BRF_PRG | BRF_ESS }, - { "gyruss.2", 0x02000, 0x8efb3614, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_gyruss, cv_gyruss, cv_coleco) -STD_ROM_FN(cv_gyruss) - -struct BurnDriver BurnDrvcv_gyruss = { - "cv_gyruss", NULL, "cv_coleco", NULL, "1984", - "Gyruss\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_gyrussRomInfo, cv_gyrussRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// H.E.R.O. - -static struct BurnRomInfo cv_heroRomDesc[] = { - { "hero.1", 0x02000, 0xdcc94c49, BRF_PRG | BRF_ESS }, - { "hero.2", 0x02000, 0xc0012665, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_hero, cv_hero, cv_coleco) -STD_ROM_FN(cv_hero) - -struct BurnDriver BurnDrvcv_hero = { - "cv_hero", NULL, "cv_coleco", NULL, "1984", - "H.E.R.O.\0", NULL, "Activision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_heroRomInfo, cv_heroRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Illusions - -static struct BurnRomInfo cv_illusionRomDesc[] = { - { "illusion.1", 0x02000, 0x2b694536, BRF_PRG | BRF_ESS }, - { "illusion.2", 0x02000, 0x95a5dfa6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_illusion, cv_illusion, cv_coleco) -STD_ROM_FN(cv_illusion) - -struct BurnDriver BurnDrvcv_illusion = { - "cv_illusion", NULL, "cv_coleco", NULL, "1984", - "Illusions\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_illusionRomInfo, cv_illusionRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// James Bond 007 - -static struct BurnRomInfo cv_jbondRomDesc[] = { - { "jbond.1", 0x02000, 0x3e8adbd1, BRF_PRG | BRF_ESS }, - { "jbond.2", 0x02000, 0xd76746a3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_jbond, cv_jbond, cv_coleco) -STD_ROM_FN(cv_jbond) - -struct BurnDriver BurnDrvcv_jbond = { - "cv_jbond", NULL, "cv_coleco", NULL, "1984", - "James Bond 007\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_jbondRomInfo, cv_jbondRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Jumpman Junior - -static struct BurnRomInfo cv_jmpmanjrRomDesc[] = { - { "jmpmanjr.1", 0x02000, 0x18936315, BRF_PRG | BRF_ESS }, - { "jmpmanjr.2", 0x02000, 0x2af8cc37, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_jmpmanjr, cv_jmpmanjr, cv_coleco) -STD_ROM_FN(cv_jmpmanjr) - -struct BurnDriver BurnDrvcv_jmpmanjr = { - "cv_jmpmanjr", NULL, "cv_coleco", NULL, "1984", - "Jumpman Junior\0", NULL, "Epyx", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_jmpmanjrRomInfo, cv_jmpmanjrRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Jumpman Junior (Alt) - -static struct BurnRomInfo cv_jmpmanjraRomDesc[] = { - { "jmpmanjr.1", 0x02000, 0x18936315, BRF_PRG | BRF_ESS }, - { "jmpmanjra.2", 0x02000, 0xb9dc3145, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_jmpmanjra, cv_jmpmanjra, cv_coleco) -STD_ROM_FN(cv_jmpmanjra) - -struct BurnDriver BurnDrvcv_jmpmanjra = { - "cv_jmpmanjra", "cv_jmpmanjr", "cv_coleco", NULL, "1984", - "Jumpman Junior (Alt)\0", NULL, "Epyx", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_jmpmanjraRomInfo, cv_jmpmanjraRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Ken Uston Blackjack-Poker - -static struct BurnRomInfo cv_kubjpokRomDesc[] = { - { "kubjpok.1", 0x02000, 0x5b44f5da, BRF_PRG | BRF_ESS }, - { "kubjpok.2", 0x02000, 0x3bbede0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_kubjpok, cv_kubjpok, cv_coleco) -STD_ROM_FN(cv_kubjpok) - -struct BurnDriver BurnDrvcv_kubjpok = { - "cv_kubjpok", NULL, "cv_coleco", NULL, "1983", - "Ken Uston Blackjack-Poker\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_kubjpokRomInfo, cv_kubjpokRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Keystone Kapers - -static struct BurnRomInfo cv_keykaperRomDesc[] = { - { "keystone.1", 0x02000, 0x35776743, BRF_PRG | BRF_ESS }, - { "keystone.2", 0x02000, 0x4b624fb2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_keykaper, cv_keykaper, cv_coleco) -STD_ROM_FN(cv_keykaper) - -struct BurnDriver BurnDrvcv_keykaper = { - "cv_keykaper", NULL, "cv_coleco", NULL, "1984", - "Keystone Kapers\0", NULL, "Activision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_keykaperRomInfo, cv_keykaperRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Lady Bug - -static struct BurnRomInfo cv_ladybugRomDesc[] = { - { "ladybug.1", 0x02000, 0x6e63f2ed, BRF_PRG | BRF_ESS }, - { "ladybug.2", 0x02000, 0x147b94fe, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_ladybug, cv_ladybug, cv_coleco) -STD_ROM_FN(cv_ladybug) - -struct BurnDriver BurnDrvcv_ladybug = { - "cv_ladybug", NULL, "cv_coleco", NULL, "1982", - "Lady Bug\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_ladybugRomInfo, cv_ladybugRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sir Lancelot - -static struct BurnRomInfo cv_lancelotRomDesc[] = { - { "lancelot.1", 0x02000, 0xe28346ed, BRF_PRG | BRF_ESS }, - { "lancelot.2", 0x02000, 0x1156741b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_lancelot, cv_lancelot, cv_coleco) -STD_ROM_FN(cv_lancelot) - -struct BurnDriver BurnDrvcv_lancelot = { - "cv_lancelot", NULL, "cv_coleco", NULL, "1983", - "Sir Lancelot\0", NULL, "Xonox", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_lancelotRomInfo, cv_lancelotRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Learning with Leeper - -static struct BurnRomInfo cv_leeperRomDesc[] = { - { "leeper.1", 0x02000, 0x55dd8811, BRF_PRG | BRF_ESS }, - { "leeper.2", 0x02000, 0xae0c0c1f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_leeper, cv_leeper, cv_coleco) -STD_ROM_FN(cv_leeper) - -struct BurnDriver BurnDrvcv_leeper = { - "cv_leeper", NULL, "cv_coleco", NULL, "1983", - "Learning with Leeper\0", NULL, "Sierra On-Line", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_leeperRomInfo, cv_leeperRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Logic Levels - -static struct BurnRomInfo cv_logiclvlRomDesc[] = { - { "logiclvl.1", 0x02000, 0xd54c581b, BRF_PRG | BRF_ESS }, - { "logiclvl.2", 0x02000, 0x257aa944, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_logiclvl, cv_logiclvl, cv_coleco) -STD_ROM_FN(cv_logiclvl) - -struct BurnDriver BurnDrvcv_logiclvl = { - "cv_logiclvl", NULL, "cv_coleco", NULL, "1984", - "Logic Levels\0", NULL, "Fisher-Price", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_logiclvlRomInfo, cv_logiclvlRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Linking Logic - -static struct BurnRomInfo cv_linklogcRomDesc[] = { - { "lnklogic.1", 0x02000, 0x918f12c0, BRF_PRG | BRF_ESS }, - { "lnklogic.2", 0x02000, 0xd8f49994, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_linklogc, cv_linklogc, cv_coleco) -STD_ROM_FN(cv_linklogc) - -struct BurnDriver BurnDrvcv_linklogc = { - "cv_linklogc", NULL, "cv_coleco", NULL, "1984", - "Linking Logic\0", NULL, "Fisher-Price", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_linklogcRomInfo, cv_linklogcRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Looping - -static struct BurnRomInfo cv_loopingRomDesc[] = { - { "looping.1", 0x02000, 0x205a9c61, BRF_PRG | BRF_ESS }, - { "looping.2", 0x02000, 0x1b5ef49e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_looping, cv_looping, cv_coleco) -STD_ROM_FN(cv_looping) - -struct BurnDriver BurnDrvcv_looping = { - "cv_looping", NULL, "cv_coleco", NULL, "1983", - "Looping\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_loopingRomInfo, cv_loopingRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Meteoric Shower - -static struct BurnRomInfo cv_meteoshoRomDesc[] = { - { "meteosho.1", 0x02000, 0x6a162c7d, BRF_PRG | BRF_ESS }, - { "meteosho.2", 0x02000, 0x4fd8264f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_meteosho, cv_meteosho, cv_coleco) -STD_ROM_FN(cv_meteosho) - -struct BurnDriver BurnDrvcv_meteosho = { - "cv_meteosho", NULL, "cv_coleco", NULL, "1983", - "Meteoric Shower\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_meteoshoRomInfo, cv_meteoshoRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Montezuma's Revenge - -static struct BurnRomInfo cv_montezumRomDesc[] = { - { "montezum.1", 0x02000, 0xc94a29af, BRF_PRG | BRF_ESS }, - { "montezum.2", 0x02000, 0xc27dcc42, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_montezum, cv_montezum, cv_coleco) -STD_ROM_FN(cv_montezum) - -struct BurnDriver BurnDrvcv_montezum = { - "cv_montezum", NULL, "cv_coleco", NULL, "1984", - "Montezuma's Revenge\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_montezumRomInfo, cv_montezumRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Moonsweeper - -static struct BurnRomInfo cv_moonswprRomDesc[] = { - { "moonswpr.1", 0x02000, 0xcbb291b1, BRF_PRG | BRF_ESS }, - { "moonswpr.2", 0x02000, 0xff1c95e8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_moonswpr, cv_moonswpr, cv_coleco) -STD_ROM_FN(cv_moonswpr) - -struct BurnDriver BurnDrvcv_moonswpr = { - "cv_moonswpr", NULL, "cv_coleco", NULL, "1983", - "Moonsweeper\0", NULL, "Imagic", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_moonswprRomInfo, cv_moonswprRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Moonsweeper (Alt) - -static struct BurnRomInfo cv_moonswpraRomDesc[] = { - { "moonswpr.1", 0x02000, 0xcbb291b1, BRF_PRG | BRF_ESS }, - { "moonswpra.2", 0x02000, 0xb00d161f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_moonswpra, cv_moonswpra, cv_coleco) -STD_ROM_FN(cv_moonswpra) - -struct BurnDriver BurnDrvcv_moonswpra = { - "cv_moonswpra", "cv_moonswpr", "cv_coleco", NULL, "1983", - "Moonsweeper (Alt)\0", NULL, "Imagic", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_moonswpraRomInfo, cv_moonswpraRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mountain King - -static struct BurnRomInfo cv_mkingRomDesc[] = { - { "mking.1", 0x02000, 0xc184c59f, BRF_PRG | BRF_ESS }, - { "mking.2", 0x02000, 0x4004519c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mking, cv_mking, cv_coleco) -STD_ROM_FN(cv_mking) - -struct BurnDriver BurnDrvcv_mking = { - "cv_mking", NULL, "cv_coleco", NULL, "1984", - "Mountain King\0", NULL, "Sunrise Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mkingRomInfo, cv_mkingRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mountain King (Alt) - -static struct BurnRomInfo cv_mkingaRomDesc[] = { - { "mking.1", 0x02000, 0xc184c59f, BRF_PRG | BRF_ESS }, - { "mkinga.2", 0x02000, 0x59a0d836, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mkinga, cv_mkinga, cv_coleco) -STD_ROM_FN(cv_mkinga) - -struct BurnDriver BurnDrvcv_mkinga = { - "cv_mkinga", "cv_mking", "cv_coleco", NULL, "1984", - "Mountain King (Alt)\0", NULL, "Sunrise Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mkingaRomInfo, cv_mkingaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Motocross Racer - -static struct BurnRomInfo cv_mtcracerRomDesc[] = { - { "mtcracer.1", 0x02000, 0x66472edc, BRF_PRG | BRF_ESS }, - { "mtcracer.2", 0x02000, 0x94a06c6f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mtcracer, cv_mtcracer, cv_coleco) -STD_ROM_FN(cv_mtcracer) - -struct BurnDriver BurnDrvcv_mtcracer = { - "cv_mtcracer", NULL, "cv_coleco", NULL, "1984", - "Motocross Racer\0", NULL, "Xonox", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mtcracerRomInfo, cv_mtcracerRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Motocross Racer (Alt) - -static struct BurnRomInfo cv_mtcraceraRomDesc[] = { - { "mtcracera.1", 0x02000, 0x868d6c01, BRF_PRG | BRF_ESS }, - { "mtcracer.2", 0x02000, 0x94a06c6f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mtcracera, cv_mtcracera, cv_coleco) -STD_ROM_FN(cv_mtcracera) - -struct BurnDriver BurnDrvcv_mtcracera = { - "cv_mtcracera", "cv_mtcracer", "cv_coleco", NULL, "1984", - "Motocross Racer (Alt)\0", NULL, "Xonox", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mtcraceraRomInfo, cv_mtcraceraRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mousetrap - -static struct BurnRomInfo cv_mtrapRomDesc[] = { - { "mtrap.1", 0x02000, 0xc99d687f, BRF_PRG | BRF_ESS }, - { "mtrap.2", 0x02000, 0x0dde86c7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mtrap, cv_mtrap, cv_coleco) -STD_ROM_FN(cv_mtrap) - -struct BurnDriver BurnDrvcv_mtrap = { - "cv_mtrap", NULL, "cv_coleco", NULL, "1982", - "Mousetrap\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mtrapRomInfo, cv_mtrapRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mousetrap (Alt) - -static struct BurnRomInfo cv_mtrapaRomDesc[] = { - { "mtrap.1", 0x02000, 0xc99d687f, BRF_PRG | BRF_ESS }, - { "mtrapa.2", 0x02000, 0xf7b51bd5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mtrapa, cv_mtrapa, cv_coleco) -STD_ROM_FN(cv_mtrapa) - -struct BurnDriver BurnDrvcv_mtrapa = { - "cv_mtrapa", "cv_mtrap", "cv_coleco", NULL, "1982", - "Mousetrap (Alt)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mtrapaRomInfo, cv_mtrapaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Nova Blast - -static struct BurnRomInfo cv_novablstRomDesc[] = { - { "novablst.1", 0x02000, 0x790433cf, BRF_PRG | BRF_ESS }, - { "novablst.2", 0x02000, 0x4f4dd2dc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_novablst, cv_novablst, cv_coleco) -STD_ROM_FN(cv_novablst) - -struct BurnDriver BurnDrvcv_novablst = { - "cv_novablst", NULL, "cv_coleco", NULL, "1983", - "Nova Blast\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_novablstRomInfo, cv_novablstRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Oil's Well - -static struct BurnRomInfo cv_oilswellRomDesc[] = { - { "oilswell.1", 0x02000, 0xb8cccf31, BRF_PRG | BRF_ESS }, - { "oilswell.2", 0x02000, 0xcd2da143, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_oilswell, cv_oilswell, cv_coleco) -STD_ROM_FN(cv_oilswell) - -struct BurnDriver BurnDrvcv_oilswell = { - "cv_oilswell", NULL, "cv_coleco", NULL, "1984", - "Oil's Well\0", NULL, "Sierra On-Line", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_oilswellRomInfo, cv_oilswellRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Oil's Well (Alt) - -static struct BurnRomInfo cv_oilswellaRomDesc[] = { - { "oilswell.1", 0x02000, 0xb8cccf31, BRF_PRG | BRF_ESS }, - { "oilswella.2", 0x02000, 0xb2d9c86d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_oilswella, cv_oilswella, cv_coleco) -STD_ROM_FN(cv_oilswella) - -struct BurnDriver BurnDrvcv_oilswella = { - "cv_oilswella", "cv_oilswell", "cv_coleco", NULL, "1984", - "Oil's Well (Alt)\0", NULL, "Sierra On-Line", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_oilswellaRomInfo, cv_oilswellaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Omega Race - -static struct BurnRomInfo cv_omegraceRomDesc[] = { - { "omegrace.1", 0x02000, 0x0abd47e7, BRF_PRG | BRF_ESS }, - { "omegrace.2", 0x02000, 0x8aba596b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_omegrace, cv_omegrace, cv_coleco) -STD_ROM_FN(cv_omegrace) - -struct BurnDriver BurnDrvcv_omegrace = { - "cv_omegrace", NULL, "cv_coleco", NULL, "1983", - "Omega Race\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_omegraceRomInfo, cv_omegraceRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// It's Only Rock 'n' Roll - -static struct BurnRomInfo cv_onlyrockRomDesc[] = { - { "onlyrock.1", 0x02000, 0x93d46b70, BRF_PRG | BRF_ESS }, - { "onlyrock.2", 0x02000, 0x2bfc5325, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_onlyrock, cv_onlyrock, cv_coleco) -STD_ROM_FN(cv_onlyrock) - -struct BurnDriver BurnDrvcv_onlyrock = { - "cv_onlyrock", NULL, "cv_coleco", NULL, "1984", - "It's Only Rock 'n' Roll\0", NULL, "K-Tel", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_onlyrockRomInfo, cv_onlyrockRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Space Panic - -static struct BurnRomInfo cv_panicRomDesc[] = { - { "panic.1", 0x02000, 0xe06fa55b, BRF_PRG | BRF_ESS }, - { "panic.2", 0x02000, 0x66fcda90, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_panic, cv_panic, cv_coleco) -STD_ROM_FN(cv_panic) - -struct BurnDriver BurnDrvcv_panic = { - "cv_panic", NULL, "cv_coleco", NULL, "1983", - "Space Panic\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_panicRomInfo, cv_panicRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pepper II - -static struct BurnRomInfo cv_pepper2RomDesc[] = { - { "pepper2.1", 0x02000, 0x2ea3deb5, BRF_PRG | BRF_ESS }, - { "pepper2.2", 0x02000, 0xcd31ba03, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_pepper2, cv_pepper2, cv_coleco) -STD_ROM_FN(cv_pepper2) - -struct BurnDriver BurnDrvcv_pepper2 = { - "cv_pepper2", NULL, "cv_coleco", NULL, "1983", - "Pepper II\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_pepper2RomInfo, cv_pepper2RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pitfall! - -static struct BurnRomInfo cv_pitfallRomDesc[] = { - { "pitfall.1", 0x02000, 0x27bc4115, BRF_PRG | BRF_ESS }, - { "pitfall.2", 0x02000, 0x24c3fc26, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_pitfall, cv_pitfall, cv_coleco) -STD_ROM_FN(cv_pitfall) - -struct BurnDriver BurnDrvcv_pitfall = { - "cv_pitfall", NULL, "cv_coleco", NULL, "1983", - "Pitfall!\0", NULL, "Activision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_pitfallRomInfo, cv_pitfallRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pitfall II: Lost Caverns - -static struct BurnRomInfo cv_pitfall2RomDesc[] = { - { "pitfall2.1", 0x02000, 0x08ad596e, BRF_PRG | BRF_ESS }, - { "pitfall2.2", 0x02000, 0xe750c172, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_pitfall2, cv_pitfall2, cv_coleco) -STD_ROM_FN(cv_pitfall2) - -struct BurnDriver BurnDrvcv_pitfall2 = { - "cv_pitfall2", NULL, "cv_coleco", NULL, "1984", - "Pitfall II: Lost Caverns\0", NULL, "Activision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_pitfall2RomInfo, cv_pitfall2RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pitstop - -static struct BurnRomInfo cv_pitstopRomDesc[] = { - { "pitstop.1", 0x02000, 0x9480724e, BRF_PRG | BRF_ESS }, - { "pitstop.2", 0x02000, 0xce8e9e7e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_pitstop, cv_pitstop, cv_coleco) -STD_ROM_FN(cv_pitstop) - -struct BurnDriver BurnDrvcv_pitstop = { - "cv_pitstop", NULL, "cv_coleco", NULL, "1983", - "Pitstop\0", NULL, "Epyx", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_pitstopRomInfo, cv_pitstopRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pitstop (Alt) - -static struct BurnRomInfo cv_pitstopaRomDesc[] = { - { "pitstop.1", 0x02000, 0x9480724e, BRF_PRG | BRF_ESS }, - { "pitstopa.2", 0x02000, 0xa9172ddb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_pitstopa, cv_pitstopa, cv_coleco) -STD_ROM_FN(cv_pitstopa) - -struct BurnDriver BurnDrvcv_pitstopa = { - "cv_pitstopa", "cv_pitstop", "cv_coleco", NULL, "1983", - "Pitstop (Alt)\0", NULL, "Epyx", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_pitstopaRomInfo, cv_pitstopaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Popeye - -static struct BurnRomInfo cv_popeyeRomDesc[] = { - { "popeye.1", 0x02000, 0x0cbf4b76, BRF_PRG | BRF_ESS }, - { "popeye.2", 0x02000, 0xf1cf5153, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_popeye, cv_popeye, cv_coleco) -STD_ROM_FN(cv_popeye) - -struct BurnDriver BurnDrvcv_popeye = { - "cv_popeye", NULL, "cv_coleco", NULL, "1983", - "Popeye\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_popeyeRomInfo, cv_popeyeRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Popeye (Alt) - -static struct BurnRomInfo cv_popeyeaRomDesc[] = { - { "popeye.1", 0x02000, 0x0cbf4b76, BRF_PRG | BRF_ESS }, - { "popeyea.2", 0x02000, 0x6fabc4f0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_popeyea, cv_popeyea, cv_coleco) -STD_ROM_FN(cv_popeyea) - -struct BurnDriver BurnDrvcv_popeyea = { - "cv_popeyea", "cv_popeye", "cv_coleco", NULL, "1983", - "Popeye (Alt)\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_popeyeaRomInfo, cv_popeyeaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Q*bert Qubes - -static struct BurnRomInfo cv_qbertqubRomDesc[] = { - { "qbertqub.1", 0x02000, 0xf98f9356, BRF_PRG | BRF_ESS }, - { "qbertqub.2", 0x02000, 0x6c620927, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_qbertqub, cv_qbertqub, cv_coleco) -STD_ROM_FN(cv_qbertqub) - -struct BurnDriver BurnDrvcv_qbertqub = { - "cv_qbertqub", NULL, "cv_coleco", NULL, "1984", - "Q*bert Qubes\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_qbertqubRomInfo, cv_qbertqubRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Quest for Quintana Roo - -static struct BurnRomInfo cv_quintanaRomDesc[] = { - { "quintana.1", 0x02000, 0x4e0c1380, BRF_PRG | BRF_ESS }, - { "quintana.2", 0x02000, 0xb9a51e9d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_quintana, cv_quintana, cv_coleco) -STD_ROM_FN(cv_quintana) - -struct BurnDriver BurnDrvcv_quintana = { - "cv_quintana", NULL, "cv_coleco", NULL, "1983", - "Quest for Quintana Roo\0", NULL, "Sunrise Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_quintanaRomInfo, cv_quintanaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Quest for Quintana Roo (Alt) - -static struct BurnRomInfo cv_quintanaaRomDesc[] = { - { "quintana.1", 0x02000, 0x4e0c1380, BRF_PRG | BRF_ESS }, - { "quintanaa.2", 0x02000, 0x7a5fb32f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_quintanaa, cv_quintanaa, cv_coleco) -STD_ROM_FN(cv_quintanaa) - -struct BurnDriver BurnDrvcv_quintanaa = { - "cv_quintanaa", "cv_quintana", "cv_coleco", NULL, "1983", - "Quest for Quintana Roo (Alt)\0", NULL, "Sunrise Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_quintanaaRomInfo, cv_quintanaaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// River Raid - -static struct BurnRomInfo cv_riveraidRomDesc[] = { - { "riveraid.1", 0x02000, 0x75640b2a, BRF_PRG | BRF_ESS }, - { "riveraid.2", 0x02000, 0x5a3305e6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_riveraid, cv_riveraid, cv_coleco) -STD_ROM_FN(cv_riveraid) - -struct BurnDriver BurnDrvcv_riveraid = { - "cv_riveraid", NULL, "cv_coleco", NULL, "1984", - "River Raid\0", NULL, "Activision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_riveraidRomInfo, cv_riveraidRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Robin Hood - -static struct BurnRomInfo cv_robinhRomDesc[] = { - { "robinh.1", 0x02000, 0x47030356, BRF_PRG | BRF_ESS }, - { "robinh.2", 0x02000, 0x100b753c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_robinh, cv_robinh, cv_coleco) -STD_ROM_FN(cv_robinh) - -struct BurnDriver BurnDrvcv_robinh = { - "cv_robinh", NULL, "cv_coleco", NULL, "1984", - "Robin Hood\0", NULL, "Xonox", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_robinhRomInfo, cv_robinhRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Robin Hood (Alt) - -static struct BurnRomInfo cv_robinhaRomDesc[] = { - { "robinh.1", 0x02000, 0x47030356, BRF_PRG | BRF_ESS }, - { "robinha.2", 0x02000, 0xd307fb9d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_robinha, cv_robinha, cv_coleco) -STD_ROM_FN(cv_robinha) - -struct BurnDriver BurnDrvcv_robinha = { - "cv_robinha", "cv_robinh", "cv_coleco", NULL, "1984", - "Robin Hood (Alt)\0", NULL, "Xonox", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_robinhaRomInfo, cv_robinhaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Rock 'n Bolt - -static struct BurnRomInfo cv_rockboltRomDesc[] = { - { "rockbolt.1", 0x02000, 0xd47a9aa5, BRF_PRG | BRF_ESS }, - { "rockbolt.2", 0x02000, 0x2e1da551, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_rockbolt, cv_rockbolt, cv_coleco) -STD_ROM_FN(cv_rockbolt) - -struct BurnDriver BurnDrvcv_rockbolt = { - "cv_rockbolt", NULL, "cv_coleco", NULL, "1984", - "Rock 'n Bolt\0", NULL, "Telegames", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_rockboltRomInfo, cv_rockboltRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Rock 'n Bolt (Alt) - -static struct BurnRomInfo cv_rockboltaRomDesc[] = { - { "rockbolt.1", 0x02000, 0xd47a9aa5, BRF_PRG | BRF_ESS }, - { "rockbolta.2", 0x02000, 0xd37f5c2b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_rockbolta, cv_rockbolta, cv_coleco) -STD_ROM_FN(cv_rockbolta) - -struct BurnDriver BurnDrvcv_rockbolta = { - "cv_rockbolta", "cv_rockbolt", "cv_coleco", NULL, "1984", - "Rock 'n Bolt (Alt)\0", NULL, "Telegames", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_rockboltaRomInfo, cv_rockboltaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Rolloverture - -static struct BurnRomInfo cv_rolloverRomDesc[] = { - { "rollover.1", 0x02000, 0x668b6bcb, BRF_PRG | BRF_ESS }, - { "rollover.2", 0x02000, 0xb3dc2195, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_rollover, cv_rollover, cv_coleco) -STD_ROM_FN(cv_rollover) - -struct BurnDriver BurnDrvcv_rollover = { - "cv_rollover", NULL, "cv_coleco", NULL, "1983", - "Rolloverture\0", NULL, "Sunrise Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_rolloverRomInfo, cv_rolloverRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sammy Lightfoot - -static struct BurnRomInfo cv_sammylfRomDesc[] = { - { "sammylf.1", 0x02000, 0x2492bac2, BRF_PRG | BRF_ESS }, - { "sammylf.2", 0x02000, 0x7fee3b34, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_sammylf, cv_sammylf, cv_coleco) -STD_ROM_FN(cv_sammylf) - -struct BurnDriver BurnDrvcv_sammylf = { - "cv_sammylf", NULL, "cv_coleco", NULL, "1983", - "Sammy Lightfoot\0", NULL, "Sierra On-Line", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_sammylfRomInfo, cv_sammylfRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sammy Lightfoot (Alt) - -static struct BurnRomInfo cv_sammylfaRomDesc[] = { - { "sammylf.1", 0x02000, 0x2492bac2, BRF_PRG | BRF_ESS }, - { "sammylfa.2", 0x02000, 0x8f7b8944, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_sammylfa, cv_sammylfa, cv_coleco) -STD_ROM_FN(cv_sammylfa) - -struct BurnDriver BurnDrvcv_sammylfa = { - "cv_sammylfa", "cv_sammylf", "cv_coleco", NULL, "1983", - "Sammy Lightfoot (Alt)\0", NULL, "Sierra On-Line", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_sammylfaRomInfo, cv_sammylfaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Slither - -static struct BurnRomInfo cv_slitherRomDesc[] = { - { "slither.1", 0x02000, 0xadc3207c, BRF_PRG | BRF_ESS }, - { "slither.2", 0x02000, 0xe9d2763c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_slither, cv_slither, cv_coleco) -STD_ROM_FN(cv_slither) - -struct BurnDriver BurnDrvcv_slither = { - "cv_slither", NULL, "cv_coleco", NULL, "1983", - "Slither\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_slitherRomInfo, cv_slitherRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Slurpy - -static struct BurnRomInfo cv_slurpyRomDesc[] = { - { "slurpy.1", 0x02000, 0xcb23c846, BRF_PRG | BRF_ESS }, - { "slurpy.2", 0x02000, 0xadcda8e3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_slurpy, cv_slurpy, cv_coleco) -STD_ROM_FN(cv_slurpy) - -struct BurnDriver BurnDrvcv_slurpy = { - "cv_slurpy", NULL, "cv_coleco", NULL, "1984", - "Slurpy\0", NULL, "Xonox", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_slurpyRomInfo, cv_slurpyRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Smurf Rescue in Gargamel's Castle - -static struct BurnRomInfo cv_smurfRomDesc[] = { - { "smurfrgc.1", 0x02000, 0x675bf14d, BRF_PRG | BRF_ESS }, - { "smurfrgc.2", 0x02000, 0x0a1a2b0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_smurf, cv_smurf, cv_coleco) -STD_ROM_FN(cv_smurf) - -struct BurnDriver BurnDrvcv_smurf = { - "cv_smurf", NULL, "cv_coleco", NULL, "1982", - "Smurf Rescue in Gargamel's Castle\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_smurfRomInfo, cv_smurfRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Smurf Rescue in Gargamel's Castle (Alt) - -static struct BurnRomInfo cv_smurfaRomDesc[] = { - { "smurfrgc.1", 0x02000, 0x675bf14d, BRF_PRG | BRF_ESS }, - { "smurfrgca.2", 0x02000, 0x993ed67c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_smurfa, cv_smurfa, cv_coleco) -STD_ROM_FN(cv_smurfa) - -struct BurnDriver BurnDrvcv_smurfa = { - "cv_smurfa", "cv_smurf", "cv_coleco", NULL, "1982", - "Smurf Rescue in Gargamel's Castle (Alt)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_smurfaRomInfo, cv_smurfaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Space Fury - -static struct BurnRomInfo cv_spacfuryRomDesc[] = { - { "spacfury.1", 0x02000, 0x1850548f, BRF_PRG | BRF_ESS }, - { "spacfury.2", 0x02000, 0x4d6866e1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_spacfury, cv_spacfury, cv_coleco) -STD_ROM_FN(cv_spacfury) - -struct BurnDriver BurnDrvcv_spacfury = { - "cv_spacfury", NULL, "cv_coleco", NULL, "1983", - "Space Fury\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_spacfuryRomInfo, cv_spacfuryRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Spectron - -static struct BurnRomInfo cv_spectronRomDesc[] = { - { "spectron.1", 0x02000, 0x23e2afa0, BRF_PRG | BRF_ESS }, - { "spectron.2", 0x02000, 0x01897fc1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_spectron, cv_spectron, cv_coleco) -STD_ROM_FN(cv_spectron) - -struct BurnDriver BurnDrvcv_spectron = { - "cv_spectron", NULL, "cv_coleco", NULL, "1983", - "Spectron\0", NULL, "Spectravideo", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_spectronRomInfo, cv_spectronRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Cross Force - -static struct BurnRomInfo cv_sprcrossRomDesc[] = { - { "sprcross.1", 0x02000, 0xe5a53b79, BRF_PRG | BRF_ESS }, - { "sprcross.2", 0x02000, 0x5185bd94, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_sprcross, cv_sprcross, cv_coleco) -STD_ROM_FN(cv_sprcross) - -struct BurnDriver BurnDrvcv_sprcross = { - "cv_sprcross", NULL, "cv_coleco", NULL, "1983", - "Super Cross Force\0", NULL, "Spectravideo", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_sprcrossRomInfo, cv_sprcrossRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Cross Force (Alt) - -static struct BurnRomInfo cv_sprcrossaRomDesc[] = { - { "sprcross.1", 0x02000, 0xe5a53b79, BRF_PRG | BRF_ESS }, - { "sprcrossa.2", 0x02000, 0xbd58d3e1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_sprcrossa, cv_sprcrossa, cv_coleco) -STD_ROM_FN(cv_sprcrossa) - -struct BurnDriver BurnDrvcv_sprcrossa = { - "cv_sprcrossa", "cv_sprcross", "cv_coleco", NULL, "1983", - "Super Cross Force (Alt)\0", NULL, "Spectravideo", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_sprcrossaRomInfo, cv_sprcrossaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Squish 'em Sam! - -static struct BurnRomInfo cv_squishemRomDesc[] = { - { "squishem.1", 0x02000, 0x2614d406, BRF_PRG | BRF_ESS }, - { "squishem.2", 0x02000, 0xb1ce0286, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_squishem, cv_squishem, cv_coleco) -STD_ROM_FN(cv_squishem) - -struct BurnDriver BurnDrvcv_squishem = { - "cv_squishem", NULL, "cv_coleco", NULL, "1984", - "Squish 'em Sam!\0", NULL, "Interphase", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_squishemRomInfo, cv_squishemRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Star Wars: The Arcade Game - -static struct BurnRomInfo cv_starwarsRomDesc[] = { - { "starwars.1", 0x02000, 0xa0ea5c68, BRF_PRG | BRF_ESS }, - { "starwars.2", 0x02000, 0xe7d55444, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_starwars, cv_starwars, cv_coleco) -STD_ROM_FN(cv_starwars) - -struct BurnDriver BurnDrvcv_starwars = { - "cv_starwars", NULL, "cv_coleco", NULL, "1984", - "Star Wars: The Arcade Game\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_starwarsRomInfo, cv_starwarsRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Strike It! - -static struct BurnRomInfo cv_strikeitRomDesc[] = { - { "strikeit.1", 0x02000, 0x7b26040d, BRF_PRG | BRF_ESS }, - { "strikeit.2", 0x02000, 0x3a2d6226, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_strikeit, cv_strikeit, cv_coleco) -STD_ROM_FN(cv_strikeit) - -struct BurnDriver BurnDrvcv_strikeit = { - "cv_strikeit", NULL, "cv_coleco", NULL, "1983", - "Strike It!\0", NULL, "Telegames", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_strikeitRomInfo, cv_strikeitRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Tank Wars - -static struct BurnRomInfo cv_tankwarsRomDesc[] = { - { "tankwars.1", 0x02000, 0x9ab82448, BRF_PRG | BRF_ESS }, - { "tankwars.2", 0x02000, 0x829cce2b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_tankwars, cv_tankwars, cv_coleco) -STD_ROM_FN(cv_tankwars) - -struct BurnDriver BurnDrvcv_tankwars = { - "cv_tankwars", NULL, "cv_coleco", NULL, "1983", - "Tank Wars\0", NULL, "Telegames", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_tankwarsRomInfo, cv_tankwarsRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Telly Turtle - -static struct BurnRomInfo cv_tellyRomDesc[] = { - { "telly.1", 0x02000, 0x2d18a9f3, BRF_PRG | BRF_ESS }, - { "telly.2", 0x02000, 0xc031f478, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_telly, cv_telly, cv_coleco) -STD_ROM_FN(cv_telly) - -struct BurnDriver BurnDrvcv_telly = { - "cv_telly", NULL, "cv_coleco", NULL, "1984", - "Telly Turtle\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_tellyRomInfo, cv_tellyRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Threshold - -static struct BurnRomInfo cv_threshldRomDesc[] = { - { "threshld.1", 0x02000, 0x5575f9a7, BRF_PRG | BRF_ESS }, - { "threshld.2", 0x02000, 0x502e5505, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_threshld, cv_threshld, cv_coleco) -STD_ROM_FN(cv_threshld) - -struct BurnDriver BurnDrvcv_threshld = { - "cv_threshld", NULL, "cv_coleco", NULL, "1983", - "Threshold\0", NULL, "Sierra On-Line", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_threshldRomInfo, cv_threshldRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Time Pilot - -static struct BurnRomInfo cv_timepltRomDesc[] = { - { "timeplt.1", 0x02000, 0xc7dbf3f4, BRF_PRG | BRF_ESS }, - { "timeplt.2", 0x02000, 0x0103b17c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_timeplt, cv_timeplt, cv_coleco) -STD_ROM_FN(cv_timeplt) - -struct BurnDriver BurnDrvcv_timeplt = { - "cv_timeplt", NULL, "cv_coleco", NULL, "1983", - "Time Pilot\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_timepltRomInfo, cv_timepltRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Tomarc the Barbarian - -static struct BurnRomInfo cv_tomarcRomDesc[] = { - { "tomarc.1", 0x02000, 0x938681c2, BRF_PRG | BRF_ESS }, - { "tomarc.2", 0x02000, 0x58fc365b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_tomarc, cv_tomarc, cv_coleco) -STD_ROM_FN(cv_tomarc) - -struct BurnDriver BurnDrvcv_tomarc = { - "cv_tomarc", NULL, "cv_coleco", NULL, "1984", - "Tomarc the Barbarian\0", NULL, "Xonox", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_tomarcRomInfo, cv_tomarcRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Turbo - -static struct BurnRomInfo cv_turboRomDesc[] = { - { "turbo.1", 0x02000, 0x379db77c, BRF_PRG | BRF_ESS }, - { "turbo.2", 0x02000, 0x8d49046a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_turbo, cv_turbo, cv_coleco) -STD_ROM_FN(cv_turbo) - -struct BurnDriver BurnDrvcv_turbo = { - "cv_turbo", NULL, "cv_coleco", NULL, "1982", - "Turbo\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_turboRomInfo, cv_turboRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Tutankham - -static struct BurnRomInfo cv_tutankhmRomDesc[] = { - { "tutankhm.1", 0x02000, 0x8186ee58, BRF_PRG | BRF_ESS }, - { "tutankhm.2", 0x02000, 0xc84f9171, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_tutankhm, cv_tutankhm, cv_coleco) -STD_ROM_FN(cv_tutankhm) - -struct BurnDriver BurnDrvcv_tutankhm = { - "cv_tutankhm", NULL, "cv_coleco", NULL, "1983", - "Tutankham\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_tutankhmRomInfo, cv_tutankhmRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Tutankham (Alt) - -static struct BurnRomInfo cv_tutankhmaRomDesc[] = { - { "tutankhm.1", 0x02000, 0x8186ee58, BRF_PRG | BRF_ESS }, - { "tutankhma.2", 0x02000, 0x208eb5a2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_tutankhma, cv_tutankhma, cv_coleco) -STD_ROM_FN(cv_tutankhma) - -struct BurnDriver BurnDrvcv_tutankhma = { - "cv_tutankhma", "cv_tutankhm", "cv_coleco", NULL, "1983", - "Tutankham (Alt)\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_tutankhmaRomInfo, cv_tutankhmaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Up'n Down - -static struct BurnRomInfo cv_upndownRomDesc[] = { - { "upndown.1", 0x02000, 0x20020b8c, BRF_PRG | BRF_ESS }, - { "upndown.2", 0x02000, 0xecc346e6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_upndown, cv_upndown, cv_coleco) -STD_ROM_FN(cv_upndown) - -struct BurnDriver BurnDrvcv_upndown = { - "cv_upndown", NULL, "cv_coleco", NULL, "1984", - "Up'n Down\0", NULL, "Sega", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_upndownRomInfo, cv_upndownRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Venture - -static struct BurnRomInfo cv_ventureRomDesc[] = { - { "venture.1", 0x02000, 0xd1975c29, BRF_PRG | BRF_ESS }, - { "venture.2", 0x02000, 0x2fff758e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_venture, cv_venture, cv_coleco) -STD_ROM_FN(cv_venture) - -struct BurnDriver BurnDrvcv_venture = { - "cv_venture", NULL, "cv_coleco", NULL, "1982", - "Venture\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_ventureRomInfo, cv_ventureRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Wing War - -static struct BurnRomInfo cv_wingwarRomDesc[] = { - { "wingwar.1", 0x02000, 0x9aaba834, BRF_PRG | BRF_ESS }, - { "wingwar.2", 0x02000, 0x442000d0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_wingwar, cv_wingwar, cv_coleco) -STD_ROM_FN(cv_wingwar) - -struct BurnDriver BurnDrvcv_wingwar = { - "cv_wingwar", NULL, "cv_coleco", NULL, "1983", - "Wing War\0", NULL, "Imagic", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_wingwarRomInfo, cv_wingwarRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Wizard of Id's Wizmath - -static struct BurnRomInfo cv_wizmathRomDesc[] = { - { "wizmath.1", 0x02000, 0xc0c6bda0, BRF_PRG | BRF_ESS }, - { "wizmath.2", 0x02000, 0x4080c0a4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_wizmath, cv_wizmath, cv_coleco) -STD_ROM_FN(cv_wizmath) - -struct BurnDriver BurnDrvcv_wizmath = { - "cv_wizmath", NULL, "cv_coleco", NULL, "1984", - "Wizard of Id's Wizmath\0", NULL, "Sierra On-Line", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_wizmathRomInfo, cv_wizmathRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Zenji - -static struct BurnRomInfo cv_zenjiRomDesc[] = { - { "zenji.1", 0x02000, 0xc3bde56a, BRF_PRG | BRF_ESS }, - { "zenji.2", 0x02000, 0xd2a19d28, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_zenji, cv_zenji, cv_coleco) -STD_ROM_FN(cv_zenji) - -struct BurnDriver BurnDrvcv_zenji = { - "cv_zenji", NULL, "cv_coleco", NULL, "1984", - "Zenji\0", NULL, "Activision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_zenjiRomInfo, cv_zenjiRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// One on One - -static struct BurnRomInfo cv_1on1RomDesc[] = { - { "1on1.1", 0x02000, 0xbabea7d6, BRF_PRG | BRF_ESS }, - { "1on1.2", 0x02000, 0x568ffb61, BRF_PRG | BRF_ESS }, - { "1on1.3", 0x02000, 0x575c9eae, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_1on1, cv_1on1, cv_coleco) -STD_ROM_FN(cv_1on1) - -struct BurnDriver BurnDrvcv_1on1 = { - "cv_1on1", NULL, "cv_coleco", NULL, "1984", - "One on One\0", NULL, "Micro Lab", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_1on1RomInfo, cv_1on1RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// BC's Quest for Tires II: Grog's Revenge - -static struct BurnRomInfo cv_bcquest2RomDesc[] = { - { "bcquest2.1", 0x02000, 0x6bd84eb0, BRF_PRG | BRF_ESS }, - { "bcquest2.2", 0x02000, 0x2ffa50a8, BRF_PRG | BRF_ESS }, - { "bcquest2.3", 0x02000, 0x4b909485, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_bcquest2, cv_bcquest2, cv_coleco) -STD_ROM_FN(cv_bcquest2) - -struct BurnDriver BurnDrvcv_bcquest2 = { - "cv_bcquest2", NULL, "cv_coleco", NULL, "1984", - "BC's Quest for Tires II: Grog's Revenge\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_bcquest2RomInfo, cv_bcquest2RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// BC's Quest for Tires II: Grog's Revenge (Can) - -static struct BurnRomInfo cv_bcquest2caRomDesc[] = { - { "bcquest2ca.1", 0x02000, 0x8898dfc3, BRF_PRG | BRF_ESS }, - { "bcquest2ca.2", 0x02000, 0xc42f20bd, BRF_PRG | BRF_ESS }, - { "bcquest2ca.3", 0x02000, 0x117dedbe, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_bcquest2ca, cv_bcquest2ca, cv_coleco) -STD_ROM_FN(cv_bcquest2ca) - -struct BurnDriver BurnDrvcv_bcquest2ca = { - "cv_bcquest2ca", "cv_bcquest2", "cv_coleco", NULL, "1984", - "BC's Quest for Tires II: Grog's Revenge (Can)\0", NULL, "Coleco Canada", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_bcquest2caRomInfo, cv_bcquest2caRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Bump 'n' Jump - -static struct BurnRomInfo cv_bnjRomDesc[] = { - { "bnj.1", 0x02000, 0x92b052f8, BRF_PRG | BRF_ESS }, - { "bnj.2", 0x02000, 0x05297263, BRF_PRG | BRF_ESS }, - { "bnj.3", 0x02000, 0xc8f6efc1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_bnj, cv_bnj, cv_coleco) -STD_ROM_FN(cv_bnj) - -struct BurnDriver BurnDrvcv_bnj = { - "cv_bnj", NULL, "cv_coleco", NULL, "1984", - "Bump 'n' Jump\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_bnjRomInfo, cv_bnjRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Buck Rogers: Planet of Zoom - -static struct BurnRomInfo cv_buckrogRomDesc[] = { - { "buckrog.1", 0x02000, 0xceb94075, BRF_PRG | BRF_ESS }, - { "buckrog.2", 0x02000, 0x6fe3a6a0, BRF_PRG | BRF_ESS }, - { "buckrog.3", 0x02000, 0x7f93542b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_buckrog, cv_buckrog, cv_coleco) -STD_ROM_FN(cv_buckrog) - -struct BurnDriver BurnDrvcv_buckrog = { - "cv_buckrog", NULL, "cv_coleco", NULL, "1983", - "Buck Rogers: Planet of Zoom\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_buckrogRomInfo, cv_buckrogRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Congo Bongo - -static struct BurnRomInfo cv_congoRomDesc[] = { - { "congo.1", 0x02000, 0xa92dfd24, BRF_PRG | BRF_ESS }, - { "congo.2", 0x02000, 0x77e922d0, BRF_PRG | BRF_ESS }, - { "congo.3", 0x02000, 0x824a0746, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_congo, cv_congo, cv_coleco) -STD_ROM_FN(cv_congo) - -struct BurnDriver BurnDrvcv_congo = { - "cv_congo", NULL, "cv_coleco", NULL, "1984", - "Congo Bongo\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_congoRomInfo, cv_congoRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Defender - -static struct BurnRomInfo cv_defenderRomDesc[] = { - { "defender.1", 0x02000, 0xbd96e222, BRF_PRG | BRF_ESS }, - { "defender.2", 0x02000, 0x72541551, BRF_PRG | BRF_ESS }, - { "defender.3", 0x02000, 0x400beaa2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_defender, cv_defender, cv_coleco) -STD_ROM_FN(cv_defender) - -struct BurnDriver BurnDrvcv_defender = { - "cv_defender", NULL, "cv_coleco", NULL, "1983", - "Defender\0", NULL, "Atarisoft", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_defenderRomInfo, cv_defenderRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Donkey Kong (Earlier Version) - -static struct BurnRomInfo cv_dkongaRomDesc[] = { - { "dkonga.1", 0x02000, 0xdcaf20d8, BRF_PRG | BRF_ESS }, - { "dkonga.2", 0x02000, 0x6045f75d, BRF_PRG | BRF_ESS }, - { "dkonga.3", 0x02000, 0x00739499, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_dkonga, cv_dkonga, cv_coleco) -STD_ROM_FN(cv_dkonga) - -struct BurnDriver BurnDrvcv_dkonga = { - "cv_dkonga", "cv_dkong", "cv_coleco", NULL, "1982", - "Donkey Kong (Earlier Version)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_dkongaRomInfo, cv_dkongaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Frenzy - -static struct BurnRomInfo cv_frenzyRomDesc[] = { - { "frenzy.1", 0x02000, 0x5111bca0, BRF_PRG | BRF_ESS }, - { "frenzy.2", 0x02000, 0x5453c668, BRF_PRG | BRF_ESS }, - { "frenzy.3", 0x02000, 0x0c7bedf0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_frenzy, cv_frenzy, cv_coleco) -STD_ROM_FN(cv_frenzy) - -struct BurnDriver BurnDrvcv_frenzy = { - "cv_frenzy", NULL, "cv_coleco", NULL, "1983", - "Frenzy\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_frenzyRomInfo, cv_frenzyRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Frenzy (Alt 1) - -static struct BurnRomInfo cv_frenzyaRomDesc[] = { - { "frenzy.1", 0x02000, 0x5111bca0, BRF_PRG | BRF_ESS }, - { "frenzy.2", 0x02000, 0x5453c668, BRF_PRG | BRF_ESS }, - { "frenzya.3", 0x02000, 0x2561345b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_frenzya, cv_frenzya, cv_coleco) -STD_ROM_FN(cv_frenzya) - -struct BurnDriver BurnDrvcv_frenzya = { - "cv_frenzya", "cv_frenzy", "cv_coleco", NULL, "1983", - "Frenzy (Alt 1)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_frenzyaRomInfo, cv_frenzyaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Frenzy (Alt 2) - -static struct BurnRomInfo cv_frenzya2RomDesc[] = { - { "frenzy.1", 0x02000, 0x5111bca0, BRF_PRG | BRF_ESS }, - { "frenzy.2", 0x02000, 0x5453c668, BRF_PRG | BRF_ESS }, - { "frenzya2.3", 0x02000, 0x9f5f1082, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_frenzya2, cv_frenzya2, cv_coleco) -STD_ROM_FN(cv_frenzya2) - -struct BurnDriver BurnDrvcv_frenzya2 = { - "cv_frenzya2", "cv_frenzy", "cv_coleco", NULL, "1983", - "Frenzy (Alt 2)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_frenzya2RomInfo, cv_frenzya2RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Front Line - -static struct BurnRomInfo cv_frontlinRomDesc[] = { - { "frontlin.1", 0x02000, 0x7b46a5b7, BRF_PRG | BRF_ESS }, - { "frontlin.2", 0x02000, 0x3ea9a9bd, BRF_PRG | BRF_ESS }, - { "frontlin.3", 0x02000, 0x91530316, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_frontlin, cv_frontlin, cv_coleco) -STD_ROM_FN(cv_frontlin) - -struct BurnDriver BurnDrvcv_frontlin = { - "cv_frontlin", NULL, "cv_coleco", NULL, "1983", - "Front Line\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_frontlinRomInfo, cv_frontlinRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Front Line (Alt) - -static struct BurnRomInfo cv_frontlinaRomDesc[] = { - { "frontlina.1", 0x02000, 0x715c764b, BRF_PRG | BRF_ESS }, - { "frontlina.2", 0x02000, 0xeee3a3d3, BRF_PRG | BRF_ESS }, - { "frontlina.3", 0x02000, 0x77885ebd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_frontlina, cv_frontlina, cv_coleco) -STD_ROM_FN(cv_frontlina) - -struct BurnDriver BurnDrvcv_frontlina = { - "cv_frontlina", "cv_frontlin", "cv_coleco", NULL, "1983", - "Front Line (Alt)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_frontlinaRomInfo, cv_frontlinaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// The Heist - -static struct BurnRomInfo cv_heistRomDesc[] = { - { "heist.1", 0x02000, 0x34080665, BRF_PRG | BRF_ESS }, - { "heist.2", 0x02000, 0xd5c02ce0, BRF_PRG | BRF_ESS }, - { "heist.3", 0x02000, 0x177a899f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_heist, cv_heist, cv_coleco) -STD_ROM_FN(cv_heist) - -struct BurnDriver BurnDrvcv_heist = { - "cv_heist", NULL, "cv_coleco", NULL, "1983", - "The Heist\0", NULL, "Micro Fun", "ColecoVision", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_heistRomInfo, cv_heistRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// The Heist (Alt) - -static struct BurnRomInfo cv_heistaRomDesc[] = { - { "heist.1", 0x02000, 0x34080665, BRF_PRG | BRF_ESS }, - { "heist.2", 0x02000, 0xd5c02ce0, BRF_PRG | BRF_ESS }, - { "heista.3", 0x02000, 0xb196db89, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_heista, cv_heista, cv_coleco) -STD_ROM_FN(cv_heista) - -struct BurnDriver BurnDrvcv_heista = { - "cv_heista", "cv_heist", "cv_coleco", NULL, "1983", - "The Heist (Alt)\0", NULL, "Micro Fun", "ColecoVision", - NULL, NULL, NULL, NULL, - 0 | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_heistaRomInfo, cv_heistaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Jungle Hunt - -static struct BurnRomInfo cv_junglehRomDesc[] = { - { "jungleh.1", 0x02000, 0x75179eb9, BRF_PRG | BRF_ESS }, - { "jungleh.2", 0x02000, 0xc6f5bbb2, BRF_PRG | BRF_ESS }, - { "jungleh.3", 0x02000, 0x07911cc8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_jungleh, cv_jungleh, cv_coleco) -STD_ROM_FN(cv_jungleh) - -struct BurnDriver BurnDrvcv_jungleh = { - "cv_jungleh", NULL, "cv_coleco", NULL, "1983", - "Jungle Hunt\0", NULL, "Atarisoft", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_junglehRomInfo, cv_junglehRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Miner 2049er - -static struct BurnRomInfo cv_mine2049RomDesc[] = { - { "mine2049.1", 0x02000, 0xe2814592, BRF_PRG | BRF_ESS }, - { "mine2049.2", 0x02000, 0x3bc36ef5, BRF_PRG | BRF_ESS }, - { "mine2049.3", 0x02000, 0x83722d88, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mine2049, cv_mine2049, cv_coleco) -STD_ROM_FN(cv_mine2049) - -struct BurnDriver BurnDrvcv_mine2049 = { - "cv_mine2049", NULL, "cv_coleco", NULL, "1983", - "Miner 2049er\0", NULL, "Micro Fun", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mine2049RomInfo, cv_mine2049RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Miner 2049er (Alt) - -static struct BurnRomInfo cv_mine2049aRomDesc[] = { - { "mine2049a.1", 0x02000, 0x90bd8c1b, BRF_PRG | BRF_ESS }, - { "mine2049a.2", 0x02000, 0xcb0335af, BRF_PRG | BRF_ESS }, - { "mine2049a.3", 0x02000, 0x41ed9918, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mine2049a, cv_mine2049a, cv_coleco) -STD_ROM_FN(cv_mine2049a) - -struct BurnDriver BurnDrvcv_mine2049a = { - "cv_mine2049a", "cv_mine2049", "cv_coleco", NULL, "1983", - "Miner 2049er (Alt)\0", NULL, "Micro Fun", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mine2049aRomInfo, cv_mine2049aRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mr. Do! - -static struct BurnRomInfo cv_mrdoRomDesc[] = { - { "mrdo.1", 0x02000, 0xa32a3f5f, BRF_PRG | BRF_ESS }, - { "mrdo.2", 0x02000, 0xd5196bfc, BRF_PRG | BRF_ESS }, - { "mrdo.3", 0x02000, 0x4be41c67, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mrdo, cv_mrdo, cv_coleco) -STD_ROM_FN(cv_mrdo) - -struct BurnDriver BurnDrvcv_mrdo = { - "cv_mrdo", NULL, "cv_coleco", NULL, "1983", - "Mr. Do!\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mrdoRomInfo, cv_mrdoRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mr. Do! (Alt) - -static struct BurnRomInfo cv_mrdoaRomDesc[] = { - { "mrdo.1", 0x02000, 0xa32a3f5f, BRF_PRG | BRF_ESS }, - { "mrdo.2", 0x02000, 0xd5196bfc, BRF_PRG | BRF_ESS }, - { "mrdoa.3", 0x02000, 0xd8c0e115, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mrdoa, cv_mrdoa, cv_coleco) -STD_ROM_FN(cv_mrdoa) - -struct BurnDriver BurnDrvcv_mrdoa = { - "cv_mrdoa", "cv_mrdo", "cv_coleco", NULL, "1983", - "Mr. Do! (Alt)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mrdoaRomInfo, cv_mrdoaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Roc 'n Rope - -static struct BurnRomInfo cv_rocnropeRomDesc[] = { - { "rocnrope.1", 0x02000, 0x24d5a53c, BRF_PRG | BRF_ESS }, - { "rocnrope.2", 0x02000, 0x3db8ad55, BRF_PRG | BRF_ESS }, - { "rocnrope.3", 0x02000, 0xc6146a6d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_rocnrope, cv_rocnrope, cv_coleco) -STD_ROM_FN(cv_rocnrope) - -struct BurnDriver BurnDrvcv_rocnrope = { - "cv_rocnrope", NULL, "cv_coleco", NULL, "1984", - "Roc 'n Rope\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_rocnropeRomInfo, cv_rocnropeRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Rocky: Super Action Boxing - -static struct BurnRomInfo cv_rockyRomDesc[] = { - { "rocky.1", 0x02000, 0xa51498f5, BRF_PRG | BRF_ESS }, - { "rocky.2", 0x02000, 0x5a8f2336, BRF_PRG | BRF_ESS }, - { "rocky.3", 0x02000, 0x56fc8d0a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_rocky, cv_rocky, cv_coleco) -STD_ROM_FN(cv_rocky) - -struct BurnDriver BurnDrvcv_rocky = { - "cv_rocky", NULL, "cv_coleco", NULL, "1983", - "Rocky: Super Action Boxing\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_rockyRomInfo, cv_rockyRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sector Alpha - -static struct BurnRomInfo cv_secalphaRomDesc[] = { - { "secalpha.1", 0x02000, 0x9299539b, BRF_PRG | BRF_ESS }, - { "secalpha.2", 0x02000, 0xc8d6e83d, BRF_PRG | BRF_ESS }, - { "secalpha.3", 0x01000, 0x354a3b2f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_secalpha, cv_secalpha, cv_coleco) -STD_ROM_FN(cv_secalpha) - -struct BurnDriver BurnDrvcv_secalpha = { - "cv_secalpha", NULL, "cv_coleco", NULL, "1983", - "Sector Alpha\0", NULL, "Spectravideo", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_secalphaRomInfo, cv_secalphaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sewer Sam - -static struct BurnRomInfo cv_sewersamRomDesc[] = { - { "sewersam.1", 0x02000, 0x7906db21, BRF_PRG | BRF_ESS }, - { "sewersam.2", 0x02000, 0x9ae6324e, BRF_PRG | BRF_ESS }, - { "sewersam.3", 0x02000, 0xa17fc15a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_sewersam, cv_sewersam, cv_coleco) -STD_ROM_FN(cv_sewersam) - -struct BurnDriver BurnDrvcv_sewersam = { - "cv_sewersam", NULL, "cv_coleco", NULL, "1984", - "Sewer Sam\0", NULL, "Interphase", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_sewersamRomInfo, cv_sewersamRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Star Trek: Strategic Operations Simulator - -static struct BurnRomInfo cv_startrekRomDesc[] = { - { "startrek.1", 0x02000, 0x600e431e, BRF_PRG | BRF_ESS }, - { "startrek.2", 0x02000, 0x1d1741aa, BRF_PRG | BRF_ESS }, - { "startrek.3", 0x02000, 0x3fa88549, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_startrek, cv_startrek, cv_coleco) -STD_ROM_FN(cv_startrek) - -struct BurnDriver BurnDrvcv_startrek = { - "cv_startrek", NULL, "cv_coleco", NULL, "1984", - "Star Trek: Strategic Operations Simulator \0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_startrekRomInfo, cv_startrekRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Subroc - -static struct BurnRomInfo cv_subrocRomDesc[] = { - { "subroc.1", 0x02000, 0x85a94623, BRF_PRG | BRF_ESS }, - { "subroc.2", 0x02000, 0xb558def8, BRF_PRG | BRF_ESS }, - { "subroc.3", 0x02000, 0x9dbbb193, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_subroc, cv_subroc, cv_coleco) -STD_ROM_FN(cv_subroc) - -struct BurnDriver BurnDrvcv_subroc = { - "cv_subroc", NULL, "cv_coleco", NULL, "1983", - "Subroc\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_subrocRomInfo, cv_subrocRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Tarzan: From out of the Jungle - -static struct BurnRomInfo cv_tarzanRomDesc[] = { - { "tarzan.1", 0x02000, 0xb7054e41, BRF_PRG | BRF_ESS }, - { "tarzan.2", 0x02000, 0xe3d2a4bb, BRF_PRG | BRF_ESS }, - { "tarzan.3", 0x02000, 0xc0238775, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_tarzan, cv_tarzan, cv_coleco) -STD_ROM_FN(cv_tarzan) - -struct BurnDriver BurnDrvcv_tarzan = { - "cv_tarzan", NULL, "cv_coleco", NULL, "1983", - "Tarzan: From out of the Jungle\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_tarzanRomInfo, cv_tarzanRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Victory - -static struct BurnRomInfo cv_victoryRomDesc[] = { - { "victory.1", 0x02000, 0x811389ba, BRF_PRG | BRF_ESS }, - { "victory.2", 0x02000, 0x9a0ffe5c, BRF_PRG | BRF_ESS }, - { "victory.3", 0x02000, 0x0c873fde, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_victory, cv_victory, cv_coleco) -STD_ROM_FN(cv_victory) - -struct BurnDriver BurnDrvcv_victory = { - "cv_victory", NULL, "cv_coleco", NULL, "1983", - "Victory\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_victoryRomInfo, cv_victoryRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// War Games - -static struct BurnRomInfo cv_wargamesRomDesc[] = { - { "wargames.1", 0x02000, 0xda4bb2f5, BRF_PRG | BRF_ESS }, - { "wargames.2", 0x02000, 0x4ef201ef, BRF_PRG | BRF_ESS }, - { "wargames.3", 0x02000, 0xb9b1cae9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_wargames, cv_wargames, cv_coleco) -STD_ROM_FN(cv_wargames) - -struct BurnDriver BurnDrvcv_wargames = { - "cv_wargames", NULL, "cv_coleco", NULL, "1984", - "War Games\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_wargamesRomInfo, cv_wargamesRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Zaxxon - -static struct BurnRomInfo cv_zaxxonRomDesc[] = { - { "zaxxon.1", 0x02000, 0x91ff7961, BRF_PRG | BRF_ESS }, - { "zaxxon.2", 0x02000, 0x36dab466, BRF_PRG | BRF_ESS }, - { "zaxxon.3", 0x02000, 0x9498a0c9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_zaxxon, cv_zaxxon, cv_coleco) -STD_ROM_FN(cv_zaxxon) - -struct BurnDriver BurnDrvcv_zaxxon = { - "cv_zaxxon", NULL, "cv_coleco", NULL, "1982", - "Zaxxon\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_zaxxonRomInfo, cv_zaxxonRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// 2010: The Graphic Action Game - -static struct BurnRomInfo cv_2010RomDesc[] = { - { "2010.1", 0x02000, 0xa8820f34, BRF_PRG | BRF_ESS }, - { "2010.2", 0x02000, 0x66f96289, BRF_PRG | BRF_ESS }, - { "2010.3", 0x02000, 0x3c60f243, BRF_PRG | BRF_ESS }, - { "2010.4", 0x02000, 0xa879523b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_2010, cv_2010, cv_coleco) -STD_ROM_FN(cv_2010) - -struct BurnDriver BurnDrvcv_2010 = { - "cv_2010", NULL, "cv_coleco", NULL, "1984", - "2010: The Graphic Action Game\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_2010RomInfo, cv_2010RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// The Dam Busters - -static struct BurnRomInfo cv_dambustRomDesc[] = { - { "dambust.1", 0x02000, 0x9e82b4ab, BRF_PRG | BRF_ESS }, - { "dambust.2", 0x02000, 0x56a1b71e, BRF_PRG | BRF_ESS }, - { "dambust.3", 0x02000, 0x1b5af735, BRF_PRG | BRF_ESS }, - { "dambust.4", 0x02000, 0x72119879, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_dambust, cv_dambust, cv_coleco) -STD_ROM_FN(cv_dambust) - -struct BurnDriver BurnDrvcv_dambust = { - "cv_dambust", NULL, "cv_coleco", NULL, "1984", - "The Dam Busters\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_dambustRomInfo, cv_dambustRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Destructor - -static struct BurnRomInfo cv_destructRomDesc[] = { - { "destruct.1", 0x02000, 0x7026e237, BRF_PRG | BRF_ESS }, - { "destruct.2", 0x02000, 0xc1c0b46c, BRF_PRG | BRF_ESS }, - { "destruct.3", 0x02000, 0xf7737e17, BRF_PRG | BRF_ESS }, - { "destruct.4", 0x02000, 0x87c11b21, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_destruct, cv_destruct, cv_coleco) -STD_ROM_FN(cv_destruct) - -struct BurnDriver BurnDrvcv_destruct = { - "cv_destruct", NULL, "cv_coleco", NULL, "1984", - "Destructor\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_destructRomInfo, cv_destructRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// The Dukes of Hazzard - -static struct BurnRomInfo cv_hazzardRomDesc[] = { - { "hazzard.1", 0x02000, 0x1971d9a2, BRF_PRG | BRF_ESS }, - { "hazzard.2", 0x02000, 0x9821ea4a, BRF_PRG | BRF_ESS }, - { "hazzard.3", 0x02000, 0xc3970e2e, BRF_PRG | BRF_ESS }, - { "hazzard.4", 0x02000, 0x3433251a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_hazzard, cv_hazzard, cv_coleco) -STD_ROM_FN(cv_hazzard) - -struct BurnDriver BurnDrvcv_hazzard = { - "cv_hazzard", NULL, "cv_coleco", NULL, "1984", - "The Dukes of Hazzard\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_hazzardRomInfo, cv_hazzardRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Fortune Builder - -static struct BurnRomInfo cv_fortuneRomDesc[] = { - { "fortune.1", 0x02000, 0xb55c5448, BRF_PRG | BRF_ESS }, - { "fortune.2", 0x02000, 0x8d7deaff, BRF_PRG | BRF_ESS }, - { "fortune.3", 0x02000, 0x039604ee, BRF_PRG | BRF_ESS }, - { "fortune.4", 0x02000, 0xdfb4469e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_fortune, cv_fortune, cv_coleco) -STD_ROM_FN(cv_fortune) - -struct BurnDriver BurnDrvcv_fortune = { - "cv_fortune", NULL, "cv_coleco", NULL, "1984", - "Fortune Builder\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_fortuneRomInfo, cv_fortuneRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Spy Hunter - -static struct BurnRomInfo cv_spyhuntRomDesc[] = { - { "spyhunt.1", 0x02000, 0x0a830682, BRF_PRG | BRF_ESS }, - { "spyhunt.2", 0x02000, 0x46b6d735, BRF_PRG | BRF_ESS }, - { "spyhunt.3", 0x02000, 0x09474158, BRF_PRG | BRF_ESS }, - { "spyhunt.4", 0x02000, 0xa5b57758, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_spyhunt, cv_spyhunt, cv_coleco) -STD_ROM_FN(cv_spyhunt) - -struct BurnDriver BurnDrvcv_spyhunt = { - "cv_spyhunt", NULL, "cv_coleco", NULL, "1984", - "Spy Hunter\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_spyhuntRomInfo, cv_spyhuntRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Action Football - -static struct BurnRomInfo cv_safootbRomDesc[] = { - { "safootb.1", 0x02000, 0xf1fdec05, BRF_PRG | BRF_ESS }, - { "safootb.2", 0x02000, 0x84104709, BRF_PRG | BRF_ESS }, - { "safootb.3", 0x02000, 0x496d3acb, BRF_PRG | BRF_ESS }, - { "safootb.4", 0x02000, 0xdcc8042d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_safootb, cv_safootb, cv_coleco) -STD_ROM_FN(cv_safootb) - -struct BurnDriver BurnDrvcv_safootb = { - "cv_safootb", NULL, "cv_coleco", NULL, "1984", - "Super Action Football\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_safootbRomInfo, cv_safootbRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Action Football (Super Action Soccer clone) - -static struct BurnRomInfo cv_saftsoccRomDesc[] = { - { "saftsocc.1", 0x02000, 0xfb9f52cb, BRF_PRG | BRF_ESS }, - { "sasoccer.2", 0x02000, 0x014ecf5f, BRF_PRG | BRF_ESS }, - { "sasoccer.3", 0x02000, 0x780e3e49, BRF_PRG | BRF_ESS }, - { "saftsocc.4", 0x02000, 0xb23e1847, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_saftsocc, cv_saftsocc, cv_coleco) -STD_ROM_FN(cv_saftsocc) - -struct BurnDriver BurnDrvcv_saftsocc = { - "cv_saftsocc", "cv_sasoccer", "cv_coleco", NULL, "1984", - "Super Action Football (Super Action Soccer clone)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_saftsoccRomInfo, cv_saftsoccRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Action Soccer - -static struct BurnRomInfo cv_sasoccerRomDesc[] = { - { "sasoccer.1", 0x02000, 0x17447e87, BRF_PRG | BRF_ESS }, - { "sasoccer.2", 0x02000, 0x014ecf5f, BRF_PRG | BRF_ESS }, - { "sasoccer.3", 0x02000, 0x780e3e49, BRF_PRG | BRF_ESS }, - { "sasoccer.4", 0x02000, 0x4f5ce13d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_sasoccer, cv_sasoccer, cv_coleco) -STD_ROM_FN(cv_sasoccer) - -struct BurnDriver BurnDrvcv_sasoccer = { - "cv_sasoccer", NULL, "cv_coleco", NULL, "1984", - "Super Action Soccer\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_sasoccerRomInfo, cv_sasoccerRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Tapper - -static struct BurnRomInfo cv_tapperRomDesc[] = { - { "tapper.1", 0x02000, 0x7f8b5222, BRF_PRG | BRF_ESS }, - { "tapper.2", 0x02000, 0xe2ef863f, BRF_PRG | BRF_ESS }, - { "tapper.3", 0x02000, 0xc14b28fa, BRF_PRG | BRF_ESS }, - { "tapper.4", 0x02000, 0xd6a41476, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_tapper, cv_tapper, cv_coleco) -STD_ROM_FN(cv_tapper) - -struct BurnDriver BurnDrvcv_tapper = { - "cv_tapper", NULL, "cv_coleco", NULL, "1984", - "Tapper\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_tapperRomInfo, cv_tapperRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// 2010: The Graphic Action Game (Prototype v54) - -static struct BurnRomInfo cv_2010pRomDesc[] = { - { "act2010-54-chip1-11-9-cd7e.bin", 0x02000, 0xd8a55441, BRF_PRG | BRF_ESS }, - { "act2010-54-chip2-11-9-e822.bin", 0x02000, 0xcbba190e, BRF_PRG | BRF_ESS }, - { "act2010-54-chip3-11-9-06ca.bin", 0x02000, 0x9e13e0a1, BRF_PRG | BRF_ESS }, - { "act2010-54-chip4-11-9-e758.bin", 0x02000, 0xa3edc192, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_2010p, cv_2010p, cv_coleco) -STD_ROM_FN(cv_2010p) - -struct BurnDriver BurnDrvcv_2010p = { - "cv_2010p", "cv_2010", "cv_coleco", NULL, "1984", - "2010: The Graphic Action Game (Prototype v54)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_2010pRomInfo, cv_2010pRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// 2010: The Graphic Action Game (Prototype v44) - -static struct BurnRomInfo cv_2010p1RomDesc[] = { - { "act2010-rv44-chip1.bin", 0x02000, 0xd9dc972f, BRF_PRG | BRF_ESS }, - { "act2010-rv44-chip2.bin", 0x02000, 0x84288fcb, BRF_PRG | BRF_ESS }, - { "act2010-rv44-chip3.bin", 0x02000, 0x57807547, BRF_PRG | BRF_ESS }, - { "act2010-rv44-chip4.bin", 0x02000, 0x44e900fc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_2010p1, cv_2010p1, cv_coleco) -STD_ROM_FN(cv_2010p1) - -struct BurnDriver BurnDrvcv_2010p1 = { - "cv_2010p1", "cv_2010", "cv_coleco", NULL, "1984", - "2010: The Graphic Action Game (Prototype v44)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_2010p1RomInfo, cv_2010p1RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// The Berenstain Bears (Prototype) - -static struct BurnRomInfo cv_bbearsRomDesc[] = { - { "bbears.bin", 0x02000, 0x18864abc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_bbears, cv_bbears, cv_coleco) -STD_ROM_FN(cv_bbears) - -struct BurnDriver BurnDrvcv_bbears = { - "cv_bbears", NULL, "cv_coleco", NULL, "1984", - "The Berenstain Bears (Prototype)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_bbearsRomInfo, cv_bbearsRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Burgertime (Prototype) - -static struct BurnRomInfo cv_btimemRomDesc[] = { - { "btimem.1", 0x02000, 0x4e943aeb, BRF_PRG | BRF_ESS }, - { "btimem.2", 0x02000, 0xd7e011f2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_btimem, cv_btimem, cv_coleco) -STD_ROM_FN(cv_btimem) - -struct BurnDriver BurnDrvcv_btimem = { - "cv_btimem", "cv_btime", "cv_coleco", NULL, "1983", - "Burgertime (Prototype)\0", NULL, "Mattel", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_btimemRomInfo, cv_btimemRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Cabbage Patch Kids: Adventure in the Park (Prototype) - -static struct BurnRomInfo cv_cabbagep1RomDesc[] = { - { "cabbagep1.1", 0x02000, 0xe7214974, BRF_PRG | BRF_ESS }, - { "cabbagep1.2", 0x02000, 0xbf35f649, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_cabbagep1, cv_cabbagep1, cv_coleco) -STD_ROM_FN(cv_cabbagep1) - -struct BurnDriver BurnDrvcv_cabbagep1 = { - "cv_cabbagep1", "cv_cabbage", "cv_coleco", NULL, "1984", - "Cabbage Patch Kids: Adventure in the Park (Prototype)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_cabbagep1RomInfo, cv_cabbagep1RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Cabbage Patch Kids: Adventure in the Park (Prototype, Alt) - -static struct BurnRomInfo cv_cabbagep2RomDesc[] = { - { "cabbage-patch-chip1-6-30.bin", 0x02000, 0x2b793712, BRF_PRG | BRF_ESS }, - { "cabbage-patch-chip2-6-30.bin", 0x02000, 0xd4ff94a5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_cabbagep2, cv_cabbagep2, cv_coleco) -STD_ROM_FN(cv_cabbagep2) - -struct BurnDriver BurnDrvcv_cabbagep2 = { - "cv_cabbagep2", "cv_cabbage", "cv_coleco", NULL, "1984", - "Cabbage Patch Kids: Adventure in the Park (Prototype, Alt)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_cabbagep2RomInfo, cv_cabbagep2RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Dig Dug (Prototype) - -static struct BurnRomInfo cv_digdugRomDesc[] = { - { "digdug.1", 0x02000, 0xe13a6484, BRF_PRG | BRF_ESS }, - { "digdug.2", 0x02000, 0x82bfa6a0, BRF_PRG | BRF_ESS }, - { "digdug.3", 0x02000, 0x57f347e0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_digdug, cv_digdug, cv_coleco) -STD_ROM_FN(cv_digdug) - -struct BurnDriver BurnDrvcv_digdug = { - "cv_digdug", NULL, "cv_coleco", NULL, "1984", - "Dig Dug (Prototype)\0", NULL, "Atarisoft", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_digdugRomInfo, cv_digdugRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Dragon's Lair (Prototype, 0416) - -static struct BurnRomInfo cv_dlairRomDesc[] = { - { "dragon80-chip1-4-16-ec4a.bin", 0x02000, 0x950950d0, BRF_PRG | BRF_ESS }, - { "dragon80-chip2-4-16-ec4a.bin", 0x02000, 0x8a778f5a, BRF_PRG | BRF_ESS }, - { "dragon80-chip3-4-16-ec4a.bin", 0x02000, 0x8eec1020, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_dlair, cv_dlair, cv_coleco) -STD_ROM_FN(cv_dlair) - -struct BurnDriver BurnDrvcv_dlair = { - "cv_dlair", NULL, "cv_coleco", NULL, "1984", - "Dragon's Lair (Prototype, 0416)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_dlairRomInfo, cv_dlairRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Escape from the Mindmaster (Prototype) - -static struct BurnRomInfo cv_mindmstrRomDesc[] = { - { "mindmstr .1", 0x02000, 0xb8280950, BRF_PRG | BRF_ESS }, - { "mindmstr.2", 0x02000, 0x6cade290, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mindmstr, cv_mindmstr, cv_coleco) -STD_ROM_FN(cv_mindmstr) - -struct BurnDriver BurnDrvcv_mindmstr = { - "cv_mindmstr", NULL, "cv_coleco", NULL, "1983", - "Escape from the Mindmaster (Prototype)\0", NULL, "Epyx", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mindmstrRomInfo, cv_mindmstrRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Fall Guy (Prototype) - -static struct BurnRomInfo cv_fallguyRomDesc[] = { - { "fallguy.1", 0x02000, 0xf77d3ffd, BRF_PRG | BRF_ESS }, - { "fallguy.2", 0x02000, 0xc85c0f58, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_fallguy, cv_fallguy, cv_coleco) -STD_ROM_FN(cv_fallguy) - -struct BurnDriver BurnDrvcv_fallguy = { - "cv_fallguy", NULL, "cv_coleco", NULL, "1983", - "Fall Guy (Prototype)\0", NULL, "Fox Video Games", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_fallguyRomInfo, cv_fallguyRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Joust (Prototype) - -static struct BurnRomInfo cv_joustRomDesc[] = { - { "joust.1", 0x02000, 0x99402515, BRF_PRG | BRF_ESS }, - { "joust.2", 0x02000, 0x11ef44b8, BRF_PRG | BRF_ESS }, - { "joust.3", 0x02000, 0x0754fb6b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_joust, cv_joust, cv_coleco) -STD_ROM_FN(cv_joust) - -struct BurnDriver BurnDrvcv_joust = { - "cv_joust", NULL, "cv_coleco", NULL, "1983", - "Joust (Prototype)\0", NULL, "Atarisoft", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_joustRomInfo, cv_joustRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// M*A*S*H (Prototype) - -static struct BurnRomInfo cv_mashRomDesc[] = { - { "mash.1", 0x02000, 0x1bdfdaa5, BRF_PRG | BRF_ESS }, - { "mash.2", 0x02000, 0x55af024c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_mash, cv_mash, cv_coleco) -STD_ROM_FN(cv_mash) - -struct BurnDriver BurnDrvcv_mash = { - "cv_mash", NULL, "cv_coleco", NULL, "1983", - "M*A*S*H (Prototype)\0", NULL, "Fox Video Games", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_mashRomInfo, cv_mashRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Orbit (Prototype) - -static struct BurnRomInfo cv_orbitRomDesc[] = { - { "orbit.bin", 0x02000, 0x2cc6f4aa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_orbit, cv_orbit, cv_coleco) -STD_ROM_FN(cv_orbit) - -struct BurnDriver BurnDrvcv_orbit = { - "cv_orbit", NULL, "cv_coleco", NULL, "1983", - "Orbit (Prototype)\0", NULL, "Parker Brothers", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_orbitRomInfo, cv_orbitRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pac-Man (Prototype) - -static struct BurnRomInfo cv_pacmanRomDesc[] = { - { "pacman.1", 0x02000, 0xc0b0689d, BRF_PRG | BRF_ESS }, - { "pacman.2", 0x02000, 0xcb94e964, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_pacman, cv_pacman, cv_coleco) -STD_ROM_FN(cv_pacman) - -struct BurnDriver BurnDrvcv_pacman = { - "cv_pacman", NULL, "cv_coleco", NULL, "1983", - "Pac-Man (Prototype)\0", NULL, "Atarisoft", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_pacmanRomInfo, cv_pacmanRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Porky's (Prototype) - -static struct BurnRomInfo cv_porkysRomDesc[] = { - { "porkys.1", 0x02000, 0xf5aa5a81, BRF_PRG | BRF_ESS }, - { "porkys.2", 0x02000, 0x6b1f73a3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_porkys, cv_porkys, cv_coleco) -STD_ROM_FN(cv_porkys) - -struct BurnDriver BurnDrvcv_porkys = { - "cv_porkys", NULL, "cv_coleco", NULL, "1983", - "Porky's (Prototype)\0", NULL, "Fox Video Games", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_porkysRomInfo, cv_porkysRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Power Lords: Quest for Volcan (Prototype) - -static struct BurnRomInfo cv_powerRomDesc[] = { - { "power.1", 0x02000, 0x1137001f, BRF_PRG | BRF_ESS }, - { "power.2", 0x02000, 0x4c872266, BRF_PRG | BRF_ESS }, - { "power.3", 0x02000, 0x5f20b4e1, BRF_PRG | BRF_ESS }, - { "power.4", 0x02000, 0x560207f3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_power, cv_power, cv_coleco) -STD_ROM_FN(cv_power) - -struct BurnDriver BurnDrvcv_power = { - "cv_power", NULL, "cv_coleco", NULL, "1984", - "Power Lords: Quest for Volcan (Prototype)\0", NULL, "Probe 2000", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_powerRomInfo, cv_powerRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Smurf Play and Learn (Prototype) - -static struct BurnRomInfo cv_smurfplyRomDesc[] = { - { "smurfply.1", 0x02000, 0x1397a474, BRF_PRG | BRF_ESS }, - { "smurfply.2", 0x02000, 0xa51e1410, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_smurfply, cv_smurfply, cv_coleco) -STD_ROM_FN(cv_smurfply) - -struct BurnDriver BurnDrvcv_smurfply = { - "cv_smurfply", NULL, "cv_coleco", NULL, "1982", - "Smurf Play and Learn (Prototype)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_smurfplyRomInfo, cv_smurfplyRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Spy Hunter (Prototype, v22) - -static struct BurnRomInfo cv_spyhuntpRomDesc[] = { - { "spyr22-aaad-11-12-chip1.bin", 0x02000, 0xf8fd0e1c, BRF_PRG | BRF_ESS }, - { "spyrv22-7f14-11-12-chip2.bin", 0x02000, 0xff749b25, BRF_PRG | BRF_ESS }, - { "spyrv22-f73b-11-12-chip3.bin", 0x02000, 0xa45ff169, BRF_PRG | BRF_ESS }, - { "spyrv22-b3b4-11-12-chip4.bin", 0x02000, 0xda895d9c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_spyhuntp, cv_spyhuntp, cv_coleco) -STD_ROM_FN(cv_spyhuntp) - -struct BurnDriver BurnDrvcv_spyhuntp = { - "cv_spyhuntp", "cv_spyhunt", "cv_coleco", NULL, "1984", - "Spy Hunter (Prototype, v22)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_spyhuntpRomInfo, cv_spyhuntpRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Spy Hunter (Prototype, v13) - -static struct BurnRomInfo cv_spyhuntp1RomDesc[] = { - { "spy13-chip1.bin", 0x02000, 0x01d34c94, BRF_PRG | BRF_ESS }, - { "spy13-chip2.bin", 0x02000, 0x1aabc54a, BRF_PRG | BRF_ESS }, - { "spy13-chip3.bin", 0x02000, 0xbd730c9f, BRF_PRG | BRF_ESS }, - { "spy13-chip4.bin", 0x02000, 0xc85c6303, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_spyhuntp1, cv_spyhuntp1, cv_coleco) -STD_ROM_FN(cv_spyhuntp1) - -struct BurnDriver BurnDrvcv_spyhuntp1 = { - "cv_spyhuntp1", "cv_spyhunt", "cv_coleco", NULL, "1984", - "Spy Hunter (Prototype, v13)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_spyhuntp1RomInfo, cv_spyhuntp1RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Steamroller (Prototype) - -static struct BurnRomInfo cv_steamRomDesc[] = { - { "steam.1", 0x02000, 0xdd4f0a05, BRF_PRG | BRF_ESS }, - { "steam.2", 0x02000, 0x0bf43529, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_steam, cv_steam, cv_coleco) -STD_ROM_FN(cv_steam) - -struct BurnDriver BurnDrvcv_steam = { - "cv_steam", NULL, "cv_coleco", NULL, "1984", - "Steamroller (Prototype)\0", NULL, "Activision", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_steamRomInfo, cv_steamRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super DK! (Prototype) - -static struct BurnRomInfo cv_superdkRomDesc[] = { - { "superdk.1", 0x02000, 0x36253de5, BRF_PRG | BRF_ESS }, - { "superdk.2", 0x02000, 0x88819fa6, BRF_PRG | BRF_ESS }, - { "superdk.3", 0x02000, 0x7e3889f6, BRF_PRG | BRF_ESS }, - { "superdk.4", 0x02000, 0xcd99ed49, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_superdk, cv_superdk, cv_coleco) -STD_ROM_FN(cv_superdk) - -struct BurnDriver BurnDrvcv_superdk = { - "cv_superdk", NULL, "cv_coleco", NULL, "1982", - "Super DK! (Prototype)\0", NULL, "Nintendo", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_superdkRomInfo, cv_superdkRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sword and Sorcerer (Prototype) - -static struct BurnRomInfo cv_swordRomDesc[] = { - { "sword-chip1-a176.bin", 0x02000, 0xa1548994, BRF_PRG | BRF_ESS }, - { "sword-chip2-d5ba.bin", 0x02000, 0x1d03dfae, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_sword, cv_sword, cv_coleco) -STD_ROM_FN(cv_sword) - -struct BurnDriver BurnDrvcv_sword = { - "cv_sword", NULL, "cv_coleco", NULL, "1983", - "Sword and Sorcerer (Prototype)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_swordRomInfo, cv_swordRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Video Hustler (Prototype) - -static struct BurnRomInfo cv_hustlerRomDesc[] = { - { "video.bin", 0x02000, 0xa9177b20, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_hustler, cv_hustler, cv_coleco) -STD_ROM_FN(cv_hustler) - -struct BurnDriver BurnDrvcv_hustler = { - "cv_hustler", NULL, "cv_coleco", NULL, "1984", - "Video Hustler (Prototype)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_hustlerRomInfo, cv_hustlerRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Video Hustler (Prototype, 19840727) - -static struct BurnRomInfo cv_hustler1RomDesc[] = { - { "hustler-7-27-84-8c61.bin", 0x02000, 0x841d168f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_hustler1, cv_hustler1, cv_coleco) -STD_ROM_FN(cv_hustler1) - -struct BurnDriver BurnDrvcv_hustler1 = { - "cv_hustler1", "cv_hustler", "cv_coleco", NULL, "1984", - "Video Hustler (Prototype, 19840727)\0", NULL, "Konami", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_hustler1RomInfo, cv_hustler1RomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// War Games (Prototype, 0417) - -static struct BurnRomInfo cv_wargamespRomDesc[] = { - { "wargams17-chip1-4-17-c44a.bin", 0x02000, 0xda4bb2f5, BRF_PRG | BRF_ESS }, - { "wargams17-chip2-4-17-c44a.bin", 0x02000, 0x4ef201ef, BRF_PRG | BRF_ESS }, - { "wargams17-chip3-4-17-c44a.bin", 0x02000, 0x2a95379b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_wargamesp, cv_wargamesp, cv_coleco) -STD_ROM_FN(cv_wargamesp) - -struct BurnDriver BurnDrvcv_wargamesp = { - "cv_wargamesp", "cv_wargames", "cv_coleco", NULL, "1984", - "War Games (Prototype, 0417)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_wargamespRomInfo, cv_wargamespRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// The Yolks on You (Prototype) - -static struct BurnRomInfo cv_yolkRomDesc[] = { - { "yolk.1", 0x02000, 0xf7220275, BRF_PRG | BRF_ESS }, - { "yolk.2", 0x02000, 0x06bce2fc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_yolk, cv_yolk, cv_coleco) -STD_ROM_FN(cv_yolk) - -struct BurnDriver BurnDrvcv_yolk = { - "cv_yolk", NULL, "cv_coleco", NULL, "1983", - "The Yolks on You (Prototype)\0", NULL, "Fox Video Games", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_yolkRomInfo, cv_yolkRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// CBS Colecovision Monitor Test - -static struct BurnRomInfo cv_cbsmonRomDesc[] = { - { "cbsmon.1", 0x02000, 0x1cc13594, BRF_PRG | BRF_ESS }, - { "cbsmon.2", 0x02000, 0x3aa93ef3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_cbsmon, cv_cbsmon, cv_coleco) -STD_ROM_FN(cv_cbsmon) - -struct BurnDriver BurnDrvcv_cbsmon = { - "cv_cbsmon", NULL, "cv_coleco", NULL, "1982", - "CBS Colecovision Monitor Test\0", NULL, "CBS", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_cbsmonRomInfo, cv_cbsmonRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Final Test Cartridge (Prototype) - -static struct BurnRomInfo cv_finaltstRomDesc[] = { - { "colecovision final test (1982) (coleco).rom", 0x02000, 0x3ae4b58c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_finaltst, cv_finaltst, cv_coleco) -STD_ROM_FN(cv_finaltst) - -struct BurnDriver BurnDrvcv_finaltst = { - "cv_finaltst", NULL, "cv_coleco", NULL, "1982", - "Final Test Cartridge (Prototype)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_finaltstRomInfo, cv_finaltstRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Controller Test Cartridge - -static struct BurnRomInfo cv_suprtestRomDesc[] = { - { "super action controller tester (1982) (nuvatec).rom", 0x02000, 0xd206fe58, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_suprtest, cv_suprtest, cv_coleco) -STD_ROM_FN(cv_suprtest) - -struct BurnDriver BurnDrvcv_suprtest = { - "cv_suprtest", NULL, "cv_coleco", NULL, "1983", - "Super Controller Test Cartridge\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_suprtestRomInfo, cv_suprtestRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Music Box (Demo) - -static struct BurnRomInfo cv_musicboxRomDesc[] = { - { "musicbox.1", 0x02000, 0x4557ed22, BRF_PRG | BRF_ESS }, - { "musicbox.2", 0x02000, 0x5f40d58b, BRF_PRG | BRF_ESS }, - { "musicbox.3", 0x02000, 0x0ab26aaa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_musicbox, cv_musicbox, cv_coleco) -STD_ROM_FN(cv_musicbox) - -struct BurnDriver BurnDrvcv_musicbox = { - "cv_musicbox", NULL, "cv_coleco", NULL, "1987", - "Music Box (Demo)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_musicboxRomInfo, cv_musicboxRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Dance Fantasy - -static struct BurnRomInfo cv_dncfntsyRomDesc[] = { - { "dncfntsy.1", 0x02000, 0xbff86a98, BRF_PRG | BRF_ESS }, - { "dncfntsy.2", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_dncfntsy, cv_dncfntsy, cv_coleco) -STD_ROM_FN(cv_dncfntsy) - -struct BurnDriver BurnDrvcv_dncfntsy = { - "cv_dncfntsy", NULL, "cv_coleco", NULL, "1984", - "Dance Fantasy\0", NULL, "Fisher-Price", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_dncfntsyRomInfo, cv_dncfntsyRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Facemaker - -static struct BurnRomInfo cv_facemakrRomDesc[] = { - { "facemakr.1", 0x02000, 0xec9dfb07, BRF_PRG | BRF_ESS }, - { "facemakr.2", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_facemakr, cv_facemakr, cv_coleco) -STD_ROM_FN(cv_facemakr) - -struct BurnDriver BurnDrvcv_facemakr = { - "cv_facemakr", NULL, "cv_coleco", NULL, "1983", - "Facemaker\0", NULL, "Spinnaker Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_facemakrRomInfo, cv_facemakrRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Fraction Fever - -static struct BurnRomInfo cv_fracfevrRomDesc[] = { - { "fracfevr.1", 0x02000, 0x964db3bc, BRF_PRG | BRF_ESS }, - { "fracfevr.2", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_fracfevr, cv_fracfevr, cv_coleco) -STD_ROM_FN(cv_fracfevr) - -struct BurnDriver BurnDrvcv_fracfevr = { - "cv_fracfevr", NULL, "cv_coleco", NULL, "1983", - "Fraction Fever\0", NULL, "Spinnaker Software", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_fracfevrRomInfo, cv_fracfevrRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Juke Box - -static struct BurnRomInfo cv_jukeboxRomDesc[] = { - { "jukebox.1", 0x02000, 0xa5511418, BRF_PRG | BRF_ESS }, - { "jukebox.2", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_jukebox, cv_jukebox, cv_coleco) -STD_ROM_FN(cv_jukebox) - -struct BurnDriver BurnDrvcv_jukebox = { - "cv_jukebox", NULL, "cv_coleco", NULL, "1984", - "Juke Box\0", NULL, "Spinnaker Software Corp", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_jukeboxRomInfo, cv_jukeboxRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Memory Manor - -static struct BurnRomInfo cv_memmanorRomDesc[] = { - { "memmanor.1", 0x02000, 0xbab520ea, BRF_PRG | BRF_ESS }, - { "memmanor.2", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_memmanor, cv_memmanor, cv_coleco) -STD_ROM_FN(cv_memmanor) - -struct BurnDriver BurnDrvcv_memmanor = { - "cv_memmanor", NULL, "cv_coleco", NULL, "1984", - "Memory Manor\0", NULL, "Fisher-Price", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_memmanorRomInfo, cv_memmanorRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Skiing - -static struct BurnRomInfo cv_skiingRomDesc[] = { - { "skiing.1", 0x02000, 0x4e1fb1c7, BRF_PRG | BRF_ESS }, - { "skiing.2", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_skiing, cv_skiing, cv_coleco) -STD_ROM_FN(cv_skiing) - -struct BurnDriver BurnDrvcv_skiing = { - "cv_skiing", NULL, "cv_coleco", NULL, "1986", - "Skiing\0", NULL, "Telegames", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_skiingRomInfo, cv_skiingRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Alcazar: The Forgotten Fortress - -static struct BurnRomInfo cv_alcazarRomDesc[] = { - { "alcazar.1", 0x02000, 0xe49113c8, BRF_PRG | BRF_ESS }, - { "alcazar.2", 0x02000, 0x4d89160d, BRF_PRG | BRF_ESS }, - { "alcazar.3", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, - { "alcazar.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_alcazar, cv_alcazar, cv_coleco) -STD_ROM_FN(cv_alcazar) - -struct BurnDriver BurnDrvcv_alcazar = { - "cv_alcazar", NULL, "cv_coleco", NULL, "1985", - "Alcazar: The Forgotten Fortress\0", NULL, "Telegames", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_alcazarRomInfo, cv_alcazarRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Cabbage Patch Kids Picture Show - -static struct BurnRomInfo cv_cabbshowRomDesc[] = { - { "cabbshow.1", 0x02000, 0x5d3c41a7, BRF_PRG | BRF_ESS }, - { "cabbshow.2", 0x02000, 0xfbd2e110, BRF_PRG | BRF_ESS }, - { "cabbshow.3", 0x02000, 0x17295ffa, BRF_PRG | BRF_ESS }, - { "cabbshow.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_cabbshow, cv_cabbshow, cv_coleco) -STD_ROM_FN(cv_cabbshow) - -struct BurnDriver BurnDrvcv_cabbshow = { - "cv_cabbshow", NULL, "cv_coleco", NULL, "1984", - "Cabbage Patch Kids Picture Show\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_cabbshowRomInfo, cv_cabbshowRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Galaxian - -static struct BurnRomInfo cv_galaxianRomDesc[] = { - { "galaxian.1", 0x02000, 0x7d84e0e3, BRF_PRG | BRF_ESS }, - { "galaxian.2", 0x02000, 0x9390df8b, BRF_PRG | BRF_ESS }, - { "galaxian.3", 0x02000, 0xdd5465ce, BRF_PRG | BRF_ESS }, - { "galaxian.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_galaxian, cv_galaxian, cv_coleco) -STD_ROM_FN(cv_galaxian) - -struct BurnDriver BurnDrvcv_galaxian = { - "cv_galaxian", NULL, "cv_coleco", NULL, "1983", - "Galaxian\0", NULL, "Atarisoft", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_galaxianRomInfo, cv_galaxianRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Galaxian (Alt) - -static struct BurnRomInfo cv_galaxianaRomDesc[] = { - { "galaxian.1", 0x02000, 0x7d84e0e3, BRF_PRG | BRF_ESS }, - { "galaxiana.2", 0x02000, 0x4e701bc1, BRF_PRG | BRF_ESS }, - { "galaxiana.3", 0x02000, 0x96acb931, BRF_PRG | BRF_ESS }, - { "galaxian.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_galaxiana, cv_galaxiana, cv_coleco) -STD_ROM_FN(cv_galaxiana) - -struct BurnDriver BurnDrvcv_galaxiana = { - "cv_galaxiana", "cv_galaxian", "cv_coleco", NULL, "1983", - "Galaxian (Alt)\0", NULL, "Atarisoft", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_galaxianaRomInfo, cv_galaxianaRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Monkey Academy - -static struct BurnRomInfo cv_monkeyRomDesc[] = { - { "monkey.1", 0x02000, 0xfcd8e18b, BRF_PRG | BRF_ESS }, - { "monkey.2", 0x02000, 0xc1effcb3, BRF_PRG | BRF_ESS }, - { "monkey.3", 0x02000, 0x5594b4c4, BRF_PRG | BRF_ESS }, - { "monkey.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_monkey, cv_monkey, cv_coleco) -STD_ROM_FN(cv_monkey) - -struct BurnDriver BurnDrvcv_monkey = { - "cv_monkey", NULL, "cv_coleco", NULL, "1984", - "Monkey Academy\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_monkeyRomInfo, cv_monkeyRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Smurf Paint 'n' Play Workshop - -static struct BurnRomInfo cv_smurfpntRomDesc[] = { - { "smurfpnt.1", 0x02000, 0xb5cd2fb4, BRF_PRG | BRF_ESS }, - { "smurfpnt.2", 0x02000, 0xe4197181, BRF_PRG | BRF_ESS }, - { "smurfpnt.3", 0x02000, 0xa0e1ab06, BRF_PRG | BRF_ESS }, - { "smurfpnt.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_smurfpnt, cv_smurfpnt, cv_coleco) -STD_ROM_FN(cv_smurfpnt) - -struct BurnDriver BurnDrvcv_smurfpnt = { - "cv_smurfpnt", NULL, "cv_coleco", NULL, "1983", - "Smurf Paint 'n' Play Workshop\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_smurfpntRomInfo, cv_smurfpntRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Action Baseball - -static struct BurnRomInfo cv_sabasebRomDesc[] = { - { "sabaseb.1", 0x02000, 0x2061515d, BRF_PRG | BRF_ESS }, - { "sabaseb.2", 0x02000, 0xf29c94e3, BRF_PRG | BRF_ESS }, - { "sabaseb.3", 0x02000, 0xa4713651, BRF_PRG | BRF_ESS }, - { "sabaseb.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_sabaseb, cv_sabaseb, cv_coleco) -STD_ROM_FN(cv_sabaseb) - -struct BurnDriver BurnDrvcv_sabaseb = { - "cv_sabaseb", NULL, "cv_coleco", NULL, "1983", - "Super Action Baseball\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_sabasebRomInfo, cv_sabasebRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super DK! Junior (Prototype) - -static struct BurnRomInfo cv_suprdkjrRomDesc[] = { - { "suprdkjr.1", 0x02000, 0x85ecf7e3, BRF_PRG | BRF_ESS }, - { "suprdkjr.2", 0x02000, 0x5f63bc3c, BRF_PRG | BRF_ESS }, - { "suprdkjr.3", 0x02000, 0x6d5676fa, BRF_PRG | BRF_ESS }, - { "suprdkjr.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_suprdkjr, cv_suprdkjr, cv_coleco) -STD_ROM_FN(cv_suprdkjr) - -struct BurnDriver BurnDrvcv_suprdkjr = { - "cv_suprdkjr", NULL, "cv_coleco", NULL, "1983", - "Super DK! Junior (Prototype)\0", NULL, "Nintendo", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_suprdkjrRomInfo, cv_suprdkjrRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Tunnels and Trolls (Demo) - -static struct BurnRomInfo cv_tunnelsRomDesc[] = { - { "tunnels.1", 0x02000, 0x36a12145, BRF_PRG | BRF_ESS }, - { "tunnels.2", 0x02000, 0xb0abdb32, BRF_PRG | BRF_ESS }, - { "tunnels.3", 0x02000, 0x53cc4957, BRF_PRG | BRF_ESS }, - { "tunnels.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_tunnels, cv_tunnels, cv_coleco) -STD_ROM_FN(cv_tunnels) - -struct BurnDriver BurnDrvcv_tunnels = { - "cv_tunnels", NULL, "cv_coleco", NULL, "1983", - "Tunnels and Trolls (Demo)\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_tunnelsRomInfo, cv_tunnelsRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// War Room - -static struct BurnRomInfo cv_warroomRomDesc[] = { - { "warroom.1", 0x02000, 0xfc6def44, BRF_PRG | BRF_ESS }, - { "warroom.2", 0x02000, 0xa166efc7, BRF_PRG | BRF_ESS }, - { "warroom.3", 0x02000, 0x97fa3660, BRF_PRG | BRF_ESS }, - { "warroom.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_warroom, cv_warroom, cv_coleco) -STD_ROM_FN(cv_warroom) - -struct BurnDriver BurnDrvcv_warroom = { - "cv_warroom", NULL, "cv_coleco", NULL, "1983", - "War Room\0", NULL, "Probe 2000", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_warroomRomInfo, cv_warroomRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Word Feud - -static struct BurnRomInfo cv_wordfeudRomDesc[] = { - { "wordfeud.1", 0x02000, 0xf7a29c01, BRF_PRG | BRF_ESS }, - { "wordfeud.2", 0x02000, 0xf7a29c01, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_wordfeud, cv_wordfeud, cv_coleco) -STD_ROM_FN(cv_wordfeud) - -struct BurnDriver BurnDrvcv_wordfeud = { - "cv_wordfeud", NULL, "cv_coleco", NULL, "1984", - "Word Feud\0", NULL, "K-Tel", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_wordfeudRomInfo, cv_wordfeudRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Tournament Tennis - -static struct BurnRomInfo cv_ttennisRomDesc[] = { - { "ttennis.1", 0x02000, 0xdbcde1a9, BRF_PRG | BRF_ESS }, - { "ttennis.2", 0x02000, 0xb72f9ff8, BRF_PRG | BRF_ESS }, - { "ttennis.3", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, - { "ttennis.4", 0x02000, 0xb4293435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(cv_ttennis, cv_ttennis, cv_coleco) -STD_ROM_FN(cv_ttennis) - -struct BurnDriver BurnDrvcv_ttennis = { - "cv_ttennis", NULL, "cv_coleco", NULL, "1984", - "Tournament Tennis\0", NULL, "Coleco", "ColecoVision", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_COLECO, GBF_MISC, 0, - CVGetZipName, cv_ttennisRomInfo, cv_ttennisRomName, NULL, NULL, ColecoInputInfo, ColecoDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - diff --git a/jan/src/burn/drv/cps3/cps3.h b/jan/src/burn/drv/cps3/cps3.h deleted file mode 100644 index 7d7b26b7e..000000000 --- a/jan/src/burn/drv/cps3/cps3.h +++ /dev/null @@ -1,54 +0,0 @@ -#include "burnint.h" - -#ifndef HARDWARE_CAPCOM_CPS3 - #define HARDWARE_CAPCOM_CPS3 HARDWARE_MISC_MISC -#endif - -#ifndef HARDWARE_CAPCOM_CPS3_NO_CD - #define HARDWARE_CAPCOM_CPS3_NO_CD HARDWARE_CAPCOM_CPS3 -#endif - -extern UINT8 cps3_reset; -extern UINT8 cps3_palette_change; - -extern UINT16 *Cps3CurPal; - -extern UINT32 cps3_key1, cps3_key2, cps3_isSpecial; -extern UINT32 cps3_bios_test_hack, cps3_game_test_hack; -extern UINT32 cps3_speedup_ram_address, cps3_speedup_code_address; -extern UINT8 cps3_dip; -extern UINT32 cps3_region_address, cps3_ncd_address; - -extern UINT8 Cps3But1[16]; -extern UINT8 Cps3But2[16]; -extern UINT8 Cps3But3[16]; - -INT32 cps3Init(); -INT32 cps3Exit(); -INT32 cps3Frame(); -INT32 cps3Scan(INT32 nAction,INT32 *pnMin); - -// sound - -UINT8 __fastcall cps3SndReadByte(UINT32 addr); -UINT16 __fastcall cps3SndReadWord(UINT32 addr); -UINT32 __fastcall cps3SndReadLong(UINT32 addr); - -void __fastcall cps3SndWriteByte(UINT32 addr, UINT8 data); -void __fastcall cps3SndWriteWord(UINT32 addr, UINT16 data); -void __fastcall cps3SndWriteLong(UINT32 addr, UINT32 data); - -INT32 cps3SndInit(UINT8 *); -void cps3SndSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void cps3SndReset(); -void cps3SndExit(); -void cps3SndUpdate(); - -INT32 cps3SndScan(INT32); - -#define BURN_SND_CPS3SND_ROUTE_1 0 -#define BURN_SND_CPS3SND_ROUTE_2 1 - -#define cps3SndSetAllRoutes(v, d) \ - cps3SndSetRoute(BURN_SND_CPS3SND_ROUTE_1, v, d); \ - cps3SndSetRoute(BURN_SND_CPS3SND_ROUTE_2, v, d); diff --git a/jan/src/burn/drv/cps3/cps3run.cpp b/jan/src/burn/drv/cps3/cps3run.cpp deleted file mode 100644 index 330d0cdc7..000000000 --- a/jan/src/burn/drv/cps3/cps3run.cpp +++ /dev/null @@ -1,2148 +0,0 @@ -/********************************************************************** - -CPS3 Driver (preliminary) - -Decryption by Andreas Naive - -Driver by David Haywood - with help from Tomasz Slanina and ElSemi - -Sound emulation by Philip Bennett - -SCSI code by ElSemi - -********************************************************************** - -Port to FBA by OopsWare - -**********************************************************************/ - -#include "cps3.h" -#include "sh2_intf.h" - -#define BE_GFX 1 -//#define FAST_BOOT 1 -#define SPEED_HACK 1 // Default should be 1, if not FPS would drop. - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; - -static UINT8 *RomBios; -static UINT8 *RomGame; -static UINT8 *RomGame_D; -static UINT8 *RomUser; - -static UINT8 *RamMain; -static UINT32 *RamSpr; -static UINT16 *RamPal; - -static UINT32 *RamCRam; - -static UINT32 *RamSS; - -static UINT32 *RamVReg; - -static UINT8 *RamC000; -static UINT8 *RamC000_D; - -static UINT16 *EEPROM; - -UINT16 *Cps3CurPal; -static UINT32 *RamScreen; - -UINT8 cps3_reset = 0; -UINT8 cps3_palette_change = 0; - -UINT32 cps3_key1, cps3_key2, cps3_isSpecial; -UINT32 cps3_bios_test_hack, cps3_game_test_hack; -UINT32 cps3_speedup_ram_address, cps3_speedup_code_address; -UINT8 cps3_dip; -UINT32 cps3_region_address, cps3_ncd_address; - -static UINT32 cps3_data_rom_size; - -UINT8 Cps3But1[16]; -UINT8 Cps3But2[16]; -UINT8 Cps3But3[16]; - -static UINT16 Cps3Input[4] = {0, 0, 0, 0}; - -static UINT32 ss_bank_base = 0; -static UINT32 ss_pal_base = 0; - -static UINT32 cram_bank = 0; -static UINT16 cps3_current_eeprom_read = 0; -static UINT32 gfxflash_bank = 0; - -static UINT32 paldma_source = 0; -static UINT32 paldma_dest = 0; -static UINT32 paldma_fade = 0; -static UINT32 paldma_length = 0; - -static UINT32 chardma_source = 0; -static UINT32 chardma_table_address = 0; - -static INT32 cps3_gfx_width, cps3_gfx_height; -static INT32 cps3_gfx_max_x, cps3_gfx_max_y; - - -// -- AMD/Fujitsu 29F016 -------------------------------------------------- - -enum { - FM_NORMAL, // normal read/write - FM_READID, // read ID - FM_READSTATUS, // read status - FM_WRITEPART1, // first half of programming, awaiting second - FM_CLEARPART1, // first half of clear, awaiting second - FM_SETMASTER, // first half of set master lock, awaiting on/off - FM_READAMDID1, // part 1 of alt ID sequence - FM_READAMDID2, // part 2 of alt ID sequence - FM_READAMDID3, // part 3 of alt ID sequence - FM_ERASEAMD1, // part 1 of AMD erase sequence - FM_ERASEAMD2, // part 2 of AMD erase sequence - FM_ERASEAMD3, // part 3 of AMD erase sequence - FM_ERASEAMD4, // part 4 of AMD erase sequence - FM_BYTEPROGRAM -}; - -typedef struct -{ - INT32 status; - INT32 flash_mode; - INT32 flash_master_lock; -} flash_chip; - -static flash_chip main_flash; - -void cps3_flash_init(flash_chip * chip/*, void *data*/) -{ - memset(chip, 0, sizeof(flash_chip)); - chip->status = 0x80; - chip->flash_mode = FM_NORMAL; - chip->flash_master_lock = 0; -} - -UINT32 cps3_flash_read(flash_chip * chip, UINT32 addr) -{ - switch( chip->flash_mode ) { - case FM_READAMDID3: - case FM_READID: - - switch (addr & 0x7fffff) { - case 0: return 0x04040404; //(c->maker_id << 0) | (c->maker_id << 8) | (c->maker_id << 16) | (c->maker_id << 24); - case 4: return 0xadadadad; //(c->device_id << 0) | (c->device_id << 8) | (c->device_id << 16) | (c->device_id << 24); - case 8: return 0x00000000; - //case 12: return (c->flash_master_lock) ? 0x01010101 : 0x00000000 - } - return 0; - - case FM_ERASEAMD4: - chip->status ^= ( 1 << 6 ) | ( 1 << 2 ); - case FM_READSTATUS: - return (chip->status << 0) | (chip->status << 8) | (chip->status << 16) | (chip->status << 24); - - case FM_NORMAL: - default: - // - return 0; - } -} - -void cps3_flash_write(flash_chip * chip, UINT32 addr, UINT32 data) -{ - bprintf(1, _T("FLASH to write long value %8x to location %8x\n"), data, addr); - - switch( chip->flash_mode ) { - case FM_NORMAL: - case FM_READSTATUS: - case FM_READID: - case FM_READAMDID3: - switch( data & 0xff ) { - case 0xf0: - case 0xff: chip->flash_mode = FM_NORMAL; break; - case 0x90: chip->flash_mode = FM_READID; break; - case 0x40: - case 0x10: chip->flash_mode = FM_WRITEPART1;break; - case 0x50: // clear status reg - chip->status = 0x80; - chip->flash_mode = FM_READSTATUS; - break; - case 0x20: chip->flash_mode = FM_CLEARPART1;break; - case 0x60: chip->flash_mode = FM_SETMASTER; break; - case 0x70: chip->flash_mode = FM_READSTATUS;break; - case 0xaa: // AMD ID select part 1 - if ((addr & 0xffff) == (0x555 << 2)) - chip->flash_mode = FM_READAMDID1; - break; - default: - //logerror( "Unknown flash mode byte %x\n", data & 0xff ); - //bprintf(1, _T("FLASH to write long value %8x to location %8x\n"), data, addr); - break; - } - break; - case FM_READAMDID1: - if ((addr & 0xffff) == (0x2aa <<2) && (data & 0xff) == 0x55 ) { - chip->flash_mode = FM_READAMDID2; - } else { - //logerror( "unexpected %08x=%02x in FM_READAMDID1\n", address, data & 0xff ); - chip->flash_mode = FM_NORMAL; - } - break; - case FM_READAMDID2: - if ((addr & 0xffff) == (0x555<<2) && (data & 0xff) == 0x90) { - chip->flash_mode = FM_READAMDID3; - } else if((addr & 0xffff) == (0x555<<2) && (data & 0xff) == 0x80) { - chip->flash_mode = FM_ERASEAMD1; - } else if((addr & 0xffff) == (0x555<<2) && (data & 0xff) == 0xa0) { - chip->flash_mode = FM_BYTEPROGRAM; - } else if((addr & 0xffff) == (0x555<<2) && (data & 0xff) == 0xf0) { - chip->flash_mode = FM_NORMAL; - } else { - // logerror( "unexpected %08x=%02x in FM_READAMDID2\n", address, data & 0xff ); - chip->flash_mode = FM_NORMAL; - } - break; - } -} - -// ------------------------------------------------------------------------ - -inline static void Cps3ClearOpposites(UINT16* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -// ------------------------------------------------------------------------ - -static UINT16 rotate_left(UINT16 value, INT32 n) -{ - INT32 aux = value>>(16-n); - return ((value<> 16) ^ 0xffff; - val = rotxor(val, key2 >> 16); - val ^= (address & 0xffff) ^ (key2 & 0xffff); - return val | (val << 16); -} - -static void cps3_decrypt_bios(void) -{ - UINT32 * coderegion = (UINT32 *)RomBios; - for (INT32 i=0; i<0x20000; i+=4) { - UINT32 xormask = cps3_mask(i, cps3_key1, cps3_key2); - /* a bit of a hack, don't decrypt the FLASH commands which are transfered by SH2 DMA */ - if ( (i<0x1ff00) || (i>0x1ff6b) ) - coderegion[i/4] ^= xormask; - } -} - -static void cps3_decrypt_game(void) -{ - UINT32 * coderegion = (UINT32 *)RomGame; - UINT32 * decrypt_coderegion = (UINT32 *)RomGame_D; - - for (INT32 i=0; i<0x1000000; i+=4) { - UINT32 xormask = cps3_mask(i + 0x06000000, cps3_key1, cps3_key2); - decrypt_coderegion[i/4] = coderegion[i/4] ^ xormask; - } -} - - -static INT32 last_normal_byte = 0; - -static UINT32 process_byte( UINT8 real_byte, UINT32 destination, INT32 max_length ) -{ - UINT8 * dest = (UINT8 *) RamCRam; - //printf("process byte for destination %08x\n", destination); - destination &= 0x7fffff; - - if (real_byte&0x40) { - INT32 tranfercount = 0; - //printf("Set RLE Mode\n"); - INT32 cps3_rle_length = (real_byte&0x3f)+1; - //printf("RLE Operation (length %08x\n", cps3_rle_length ); - while (cps3_rle_length) { -#if BE_GFX - dest[((destination+tranfercount)&0x7fffff)] = (last_normal_byte&0x3f); -#else - dest[((destination+tranfercount)&0x7fffff)^3] = (last_normal_byte&0x3f); -#endif - //cps3_char_ram_dirty[((destination+tranfercount)&0x7fffff)/0x100] = 1; - //cps3_char_ram_is_dirty = 1; - //printf("RLE WRite Byte %08x, %02x\n", destination+tranfercount, real_byte); - - tranfercount++; - cps3_rle_length--; - max_length--; - if ((destination+tranfercount) > 0x7fffff) return max_length; - // if (max_length==0) return max_length; // this is meant to abort the transfer if we exceed dest length,, not working - } - return tranfercount; - } else { - //printf("Write Normal Data\n"); -#if BE_GFX - dest[(destination&0x7fffff)] = real_byte; -#else - dest[(destination&0x7fffff)^3] = real_byte; -#endif - last_normal_byte = real_byte; - //cps3_char_ram_dirty[(destination&0x7fffff)/0x100] = 1; - //cps3_char_ram_is_dirty = 1; - return 1; - } -} - -static void cps3_do_char_dma( UINT32 real_source, UINT32 real_destination, UINT32 real_length ) -{ - UINT8 * sourcedata = RomUser; - INT32 length_remaining = real_length; - last_normal_byte = 0; - while (length_remaining) { - UINT8 current_byte = sourcedata[ real_source ^ 0 ]; - real_source++; - - if (current_byte & 0x80) { - UINT8 real_byte; - UINT32 length_processed; - current_byte &= 0x7f; - - real_byte = sourcedata[ (chardma_table_address+current_byte*2+0) ^ 0 ]; - //if (real_byte&0x80) return; - length_processed = process_byte( real_byte, real_destination, length_remaining ); - length_remaining -= length_processed; // subtract the number of bytes the operation has taken - real_destination += length_processed; // add it onto the destination - if (real_destination>0x7fffff) return; - if (length_remaining<=0) return; // if we've expired, exit - - real_byte = sourcedata[ (chardma_table_address+current_byte*2+1) ^ 0 ]; - //if (real_byte&0x80) return; - length_processed = process_byte( real_byte, real_destination, length_remaining ); - length_remaining -= length_processed; // subtract the number of bytes the operation has taken - real_destination += length_processed; // add it onto the destination - if (real_destination>0x7fffff) return; - if (length_remaining<=0) return; // if we've expired, exit - } else { - UINT32 length_processed; - length_processed = process_byte( current_byte, real_destination, length_remaining ); - length_remaining -= length_processed; // subtract the number of bytes the operation has taken - real_destination += length_processed; // add it onto the destination - if (real_destination>0x7fffff) return; - if (length_remaining<=0) return; // if we've expired, exit - } - } -} - -static UINT16 lastb; -static UINT16 lastb2; - -static UINT32 ProcessByte8(UINT8 b, UINT32 dst_offset) -{ - UINT8 * destRAM = (UINT8 *) RamCRam; - INT32 l=0; - - if(lastb==lastb2) { //rle - INT32 rle=(b+1)&0xff; - - for(INT32 i=0;i=real_length) - return; - } - } -} - -static void cps3_process_character_dma(UINT32 address) -{ - for (INT32 i=0; i<0x1000; i+=3) { - UINT32 dat1 = RamCRam[i+0+(address)]; - UINT32 dat2 = RamCRam[i+1+(address)]; - UINT32 dat3 = RamCRam[i+2+(address)]; - UINT32 real_source = (dat3<<1)-0x400000; - UINT32 real_destination = dat2<<3; - UINT32 real_length = (((dat1&0x001fffff)+1)<<3); - - if (dat1==0x01000000) break; // end of list marker - if (dat1==0x13131313) break; // our default fill - - switch ( dat1 & 0x00e00000 ) { - case 0x00800000: - chardma_table_address = real_source; - Sh2SetIRQLine(10, CPU_IRQSTATUS_ACK); - break; - case 0x00400000: - cps3_do_char_dma( real_source, real_destination, real_length ); - Sh2SetIRQLine(10, CPU_IRQSTATUS_ACK); - break; - case 0x00600000: - //bprintf(PRINT_NORMAL, _T("Character DMA (alt) start %08x to %08x with %d\n"), real_source, real_destination, real_length); - /* 8bpp DMA decompression - - this is used on SFIII NG Sean's Stage ONLY */ - cps3_do_alt_char_dma( real_source, real_destination, real_length ); - Sh2SetIRQLine(10, CPU_IRQSTATUS_ACK); - break; - case 0x00000000: - // Red Earth need this. 8192 byte trans to 0x00003000 (from 0x007ec000???) - // seems some stars(6bit alpha) without compress - //bprintf(PRINT_NORMAL, _T("Character DMA (redearth) start %08x to %08x with %d\n"), real_source, real_destination, real_length); - memcpy( (UINT8 *)RamCRam + real_destination, RomUser + real_source, real_length ); - Sh2SetIRQLine(10, CPU_IRQSTATUS_ACK); - break; - default: - bprintf(PRINT_NORMAL, _T("Character DMA Unknown DMA List Command Type %08x\n"), dat1); - } - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - RomBios = Next; Next += 0x0080000; - - RomUser = Next; Next += cps3_data_rom_size; // 0x5000000; - - RamStart = Next; - - RomGame = Next; Next += 0x1000000; - RomGame_D = Next; Next += 0x1000000; - - RamC000 = Next; Next += 0x0000400; - RamC000_D = Next; Next += 0x0000400; - - RamMain = Next; Next += 0x0080000; - - RamPal = (UINT16 *) Next; Next += 0x0020000 * sizeof(UINT16); - RamSpr = (UINT32 *) Next; Next += 0x0020000 * sizeof(UINT32); - - RamCRam = (UINT32 *) Next; Next += 0x0200000 * sizeof(UINT32); - RamSS = (UINT32 *) Next; Next += 0x0004000 * sizeof(UINT32); - - RamVReg = (UINT32 *) Next; Next += 0x0000040 * sizeof(UINT32); - - EEPROM = (UINT16 *) Next; Next += 0x0000100 * sizeof(UINT16); - - RamEnd = Next; - - Cps3CurPal = (UINT16 *) Next; Next += 0x020002 * sizeof(UINT16); // iq_132 - layer disable, +1 to keep things aligned - RamScreen = (UINT32 *) Next; Next += (512 * 2) * (224 * 2 + 32) * sizeof(UINT32); - - MemEnd = Next; - return 0; -} - -UINT8 __fastcall cps3ReadByte(UINT32 addr) -{ - addr &= 0xc7ffffff; - -// switch (addr) { -// -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %8x\n"), addr); -// } - return 0; -} - -UINT16 __fastcall cps3ReadWord(UINT32 addr) -{ - addr &= 0xc7ffffff; - - switch (addr) { - - // redearth will read this !!! -#if 0 - case 0x040c0000: - return RamVReg[0] >> 16; - case 0x040c0002: - return RamVReg[0] & 0xffff; - case 0x040c0004: - return RamVReg[1] >> 16; - case 0x040c0006: - return RamVReg[1] & 0xffff; -#else - case 0x040c0000: - case 0x040c0002: - case 0x040c0004: - case 0x040c0006: - return 0; -#endif - // cps3_vbl_r - case 0x040c000c: - case 0x040c000e: - return 0; - - case 0x05000000: return ~Cps3Input[1]; - case 0x05000002: return ~Cps3Input[0]; - case 0x05000004: return ~Cps3Input[3]; - case 0x05000006: return ~Cps3Input[2]; - - case 0x05140000: - case 0x05140002: - // cd-rom read - - break; - - default: - if ((addr >= 0x05000a00) && (addr < 0x05000a20)) { - // cps3_unk_io_r - return 0xffff; - } else - if ((addr >= 0x05001000) && (addr < 0x05001204)) { - // EEPROM - addr -= 0x05001000; - if (addr >= 0x100 && addr < 0x180) { -#ifdef LSB_FIRST - cps3_current_eeprom_read = EEPROM[((addr-0x100) >> 1) ^ 1]; -#else - cps3_current_eeprom_read = EEPROM[((addr-0x100) >> 1)]; -#endif - } else - if (addr == 0x202) - return cps3_current_eeprom_read; - } else - bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %8x\n"), addr); - } - return 0; -} - -UINT32 __fastcall cps3ReadLong(UINT32 addr) -{ - addr &= 0xc7ffffff; - - switch (addr) { - case 0x04200000: - bprintf(PRINT_NORMAL, _T("GFX Read Flash ID, cram bank %04x gfx flash bank: %04x\n"), cram_bank, gfxflash_bank); - return 0x0404adad; - - default: - bprintf(PRINT_NORMAL, _T("Attempt to read long value of location %8x\n"), addr); - } - return 0; -} - -void __fastcall cps3WriteByte(UINT32 addr, UINT8 data) -{ - addr &= 0xc7ffffff; - - switch (addr) { - - // cps3_ss_bank_base_w - case 0x05050020: ss_bank_base = ( ss_bank_base & 0x00ffffff ) | (data << 24); break; - case 0x05050021: ss_bank_base = ( ss_bank_base & 0xff00ffff ) | (data << 16); break; - case 0x05050022: ss_bank_base = ( ss_bank_base & 0xffff00ff ) | (data << 8); break; - case 0x05050023: ss_bank_base = ( ss_bank_base & 0xffffff00 ) | (data << 0); break; - - // cps3_ss_pal_base_w - case 0x05050024: ss_pal_base = ( ss_pal_base & 0x00ff ) | (data << 8); break; - case 0x05050025: ss_pal_base = ( ss_pal_base & 0xff00 ) | (data << 0); break; - case 0x05050026: break; - case 0x05050027: break; - - default: - if ((addr >= 0x05050000) && (addr < 0x05060000)) { - // VideoReg - - } else - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %02x to location %8x\n"), data, addr); - } -} - -void __fastcall cps3WriteWord(UINT32 addr, UINT16 data) -{ - addr &= 0xc7ffffff; - - switch (addr) { - - case 0x040c0084: break; - case 0x040c0086: - if (cram_bank != data) { - cram_bank = data & 7; - //bprintf(PRINT_NORMAL, _T("CRAM bank set to %d\n"), data); - Sh2MapMemory(((UINT8 *)RamCRam) + (cram_bank << 20), 0x04100000, 0x041fffff, MAP_RAM); - } - break; - - case 0x040c0088: - //case 0x040c008a: - gfxflash_bank = data - 2; - //bprintf(PRINT_NORMAL, _T("gfxflash bank set to %04x\n"), data); - break; - - // cps3_characterdma_w - //case 0x040c0094: - case 0x040c0096: - chardma_source = data; - break; - case 0x040c0098: - //case 0x040c009a: - if (data & 0x0040) - cps3_process_character_dma( chardma_source | ((data & 0x003f) << 16) ); - break; - - // cps3_palettedma_w - case 0x040c00a0: paldma_source = (paldma_source & 0x0000ffff) | (data << 16); break; - case 0x040c00a2: paldma_source = (paldma_source & 0xffff0000) | (data << 0); break; - case 0x040c00a4: paldma_dest = (paldma_dest & 0x0000ffff) | (data << 16); break; - case 0x040c00a6: paldma_dest = (paldma_dest & 0xffff0000) | (data << 0); break; - case 0x040c00a8: paldma_fade = (paldma_fade & 0x0000ffff) | (data << 16); break; - case 0x040c00aa: paldma_fade = (paldma_fade & 0xffff0000) | (data << 0); break; - case 0x040c00ac: paldma_length = data; break; - case 0x040c00ae: - //bprintf(PRINT_NORMAL, _T("palettedma [%04x] from %08x to %08x fade %08x size %d\n"), data, (paldma_source << 1), paldma_dest, paldma_fade, paldma_length); - if (data & 0x0002) { - for (UINT32 i=0; i> 8); -#endif - - UINT32 r = (coldata & 0x001F) >> 0; - UINT32 g = (coldata & 0x03E0) >> 5; - UINT32 b = (coldata & 0x7C00) >> 10; - if (paldma_fade!=0) { - INT32 fade; - fade = (paldma_fade & 0x3f000000)>>24; r = (r*fade)>>5; if (r>0x1f) r = 0x1f; - fade = (paldma_fade & 0x003f0000)>>16; g = (g*fade)>>5; if (g>0x1f) g = 0x1f; - fade = (paldma_fade & 0x0000003f)>> 0; b = (b*fade)>>5; if (b>0x1f) b = 0x1f; - coldata = (r << 0) | (g << 5) | (b << 10); - } - - r = r << 3; - g = g << 3; - b = b << 3; - -#ifdef LSB_FIRST - RamPal[(paldma_dest + i) ^ 1] = coldata; -#else - RamPal[(paldma_dest + i)] = coldata; -#endif - Cps3CurPal[(paldma_dest + i) ] = BurnHighCol(r, g, b, 0); - } - Sh2SetIRQLine(10, CPU_IRQSTATUS_ACK); - } - break; - - case 0x04200554: - case 0x04200aaa: - // gfx flash command - // "0xaa 0x55 0x90" set flash to get id - // "0xaa 0x55 0xf0" set flash to normal read - break; - - // cps3_ss_bank_base_w - case 0x05050020: ss_bank_base = ( ss_bank_base & 0x0000ffff ) | (data << 16); break; - case 0x05050022: ss_bank_base = ( ss_bank_base & 0xffff0000 ) | (data << 0); break; - - // cps3_ss_pal_base_w - case 0x05050024: ss_pal_base = data; break; - case 0x05050026: break; - - case 0x05100000: - Sh2SetIRQLine(12, CPU_IRQSTATUS_NONE); - break; - case 0x05110000: - Sh2SetIRQLine(10, CPU_IRQSTATUS_NONE); - break; - - case 0x05140000: - case 0x05140002: - // cd-rom read - - break; - - default: - if ((addr >= 0x040c0000) && (addr < 0x040c0100)) { - // 0x040C0000 ~ 0x040C001f : cps3_unk_vidregs - // 0x040C0020 ~ 0x040C002b : tilemap20_regs_base - // 0x040C0030 ~ 0x040C003b : tilemap30_regs_base - // 0x040C0040 ~ 0x040C004b : tilemap40_regs_base - // 0x040C0050 ~ 0x040C005b : tilemap50_regs_base - // 0x040C0060 ~ 0x040C007f : cps3_fullscreenzoom - - addr &= 0xff; -#ifdef LSB_FIRST - ((UINT16 *)RamVReg)[ (addr >> 1) ^ 1 ] = data; -#else - ((UINT16 *)RamVReg)[ (addr >> 1) ] = data; -#endif - - } else - if ((addr >= 0x05000000) && (addr < 0x05001000)) { - - - } else - if ((addr >= 0x05001000) && (addr < 0x05001204)) { - // EEPROM - addr -= 0x05001000; - if ((addr>=0x080) && (addr<0x100)) -#ifdef LSB_FIRST - EEPROM[((addr-0x080) >> 1) ^ 1] = data; -#else - EEPROM[((addr-0x080) >> 1)] = data; -#endif - } else - if ((addr >= 0x05050000) && (addr < 0x05060000)) { - // unknow i/o - - } else - - bprintf(PRINT_NORMAL, _T("Attempt to write word value %04x to location %8x\n"), data, addr); - } -} - -void __fastcall cps3WriteLong(UINT32 addr, UINT32 data) -{ - addr &= 0xc7ffffff; - - switch (addr) { - case 0x07ff000c: - case 0x07ff0048: - // some unknown data write by DMA 0 while bootup - break; - - default: - bprintf(PRINT_NORMAL, _T("Attempt to write long value %8x to location %8x\n"), data, addr); - } -} - -void __fastcall cps3C0WriteByte(UINT32 addr, UINT8 data) -{ - bprintf(PRINT_NORMAL, _T("C0 Attempt to write byte value %2x to location %8x\n"), data, addr); -} - -void __fastcall cps3C0WriteWord(UINT32 addr, UINT16 data) -{ - bprintf(PRINT_NORMAL, _T("C0 Attempt to write word value %4x to location %8x\n"), data, addr); -} - -void __fastcall cps3C0WriteLong(UINT32 addr, UINT32 data) -{ - if (addr < 0xc0000400) { - *(UINT32 *)(RamC000 + (addr & 0x3ff)) = data; - *(UINT32 *)(RamC000_D + (addr & 0x3ff)) = data ^ cps3_mask(addr, cps3_key1, cps3_key2); - return ; - } - bprintf(PRINT_NORMAL, _T("C0 Attempt to write long value %8x to location %8x\n"), data, addr); -} - -// If fastboot != 1 - -UINT8 __fastcall cps3RomReadByte(UINT32 addr) -{ -// bprintf(PRINT_NORMAL, _T("Rom Attempt to read byte value of location %8x\n"), addr); - addr &= 0xc7ffffff; -#ifdef LSB_FIRST - addr ^= 0x03; -#endif - return *(RomGame_D + (addr & 0x00ffffff)); -} - -UINT16 __fastcall cps3RomReadWord(UINT32 addr) -{ -// bprintf(PRINT_NORMAL, _T("Rom Attempt to read word value of location %8x\n"), addr); - addr &= 0xc7ffffff; -#ifdef LSB_FIRST - addr ^= 0x02; -#endif - return *(UINT16 *)(RomGame_D + (addr & 0x00ffffff)); -} - -UINT32 __fastcall cps3RomReadLong(UINT32 addr) -{ -// bprintf(PRINT_NORMAL, _T("Rom Attempt to read long value of location %8x\n"), addr); - addr &= 0xc7ffffff; - - UINT32 retvalue = cps3_flash_read(&main_flash, addr); - if ( main_flash.flash_mode == FM_NORMAL ) - retvalue = *(UINT32 *)(RomGame_D + (addr & 0x00ffffff)); - - UINT32 pc = Sh2GetPC(0); - if (pc == cps3_bios_test_hack || pc == cps3_game_test_hack){ - if ( main_flash.flash_mode == FM_NORMAL ) - retvalue = *(UINT32 *)(RomGame + (addr & 0x00ffffff)); - bprintf(2, _T("CPS3 Hack : read long from %08x [%08x]\n"), addr, retvalue ); - } - return retvalue; -} - -void __fastcall cps3RomWriteByte(UINT32 addr, UINT8 data) -{ - bprintf(PRINT_NORMAL, _T("Rom Attempt to write byte value %2x to location %8x\n"), data, addr); -} - -void __fastcall cps3RomWriteWord(UINT32 addr, UINT16 data) -{ - bprintf(PRINT_NORMAL, _T("Rom Attempt to write word value %4x to location %8x\n"), data, addr); -} - -void __fastcall cps3RomWriteLong(UINT32 addr, UINT32 data) -{ -// bprintf(1, _T("Rom Attempt to write long value %8x to location %8x\n"), data, addr); - addr &= 0x00ffffff; - cps3_flash_write(&main_flash, addr, data); - - if ( main_flash.flash_mode == FM_NORMAL ) { - bprintf(1, _T("Rom Attempt to write long value %8x to location %8x\n"), data, addr); - *(UINT32 *)(RomGame + addr) = data; - *(UINT32 *)(RomGame_D + addr) = data ^ cps3_mask(addr + 0x06000000, cps3_key1, cps3_key2); - } -} - -UINT8 __fastcall cps3RomReadByteSpe(UINT32 addr) -{ -// bprintf(PRINT_NORMAL, _T("Rom Attempt to read byte value of location %8x\n"), addr); - addr &= 0xc7ffffff; -#ifdef LSB_FIRST - addr ^= 0x03; -#endif - return *(RomGame + (addr & 0x00ffffff)); -} - -UINT16 __fastcall cps3RomReadWordSpe(UINT32 addr) -{ -// bprintf(PRINT_NORMAL, _T("Rom Attempt to read word value of location %8x\n"), addr); - addr &= 0xc7ffffff; -#ifdef LSB_FIRST - addr ^= 0x02; -#endif - return *(UINT16 *)(RomGame + (addr & 0x00ffffff)); -} - -UINT32 __fastcall cps3RomReadLongSpe(UINT32 addr) -{ -// bprintf(PRINT_NORMAL, _T("Rom Attempt to read long value of location %8x\n"), addr); - addr &= 0xc7ffffff; - - UINT32 retvalue = cps3_flash_read(&main_flash, addr); - if ( main_flash.flash_mode == FM_NORMAL ) - retvalue = *(UINT32 *)(RomGame + (addr & 0x00ffffff)); - - return retvalue; -} - -//------------------ - -UINT8 __fastcall cps3VidReadByte(UINT32 addr) -{ - bprintf(PRINT_NORMAL, _T("Video Attempt to read byte value of location %8x\n"), addr); -// addr &= 0xc7ffffff; - return 0; -} - -UINT16 __fastcall cps3VidReadWord(UINT32 addr) -{ - bprintf(PRINT_NORMAL, _T("Video Attempt to read word value of location %8x\n"), addr); -// addr &= 0xc7ffffff; - return 0; -} - -UINT32 __fastcall cps3VidReadLong(UINT32 addr) -{ - bprintf(PRINT_NORMAL, _T("Video Attempt to read long value of location %8x\n"), addr); -// addr &= 0xc7ffffff; - return 0; -} - -void __fastcall cps3VidWriteByte(UINT32 addr, UINT8 data) -{ - bprintf(PRINT_NORMAL, _T("Video Attempt to write byte value %2x to location %8x\n"), data, addr); -} - -void __fastcall cps3VidWriteWord(UINT32 addr, UINT16 data) -{ - addr &= 0xc7ffffff; - if ((addr >= 0x04080000) && (addr < 0x040c0000)) { - // Palette - UINT32 palindex = (addr - 0x04080000) >> 1; -#ifdef LSB_FIRST - RamPal[palindex ^ 1] = data; -#else - RamPal[palindex] = data; -#endif - - INT32 r = (data & 0x001F) << 3; // Red - INT32 g = (data & 0x03E0) >> 2; // Green - INT32 b = (data & 0x7C00) >> 7; // Blue - - r |= r >> 5; - g |= g >> 5; - b |= b >> 5; - - Cps3CurPal[palindex] = BurnHighCol(r, g, b, 0); - - } else - bprintf(PRINT_NORMAL, _T("Video Attempt to write word value %4x to location %8x\n"), data, addr); -} - -void __fastcall cps3VidWriteLong(UINT32 addr, UINT32 data) -{ - addr &= 0xc7ffffff; - if ((addr >= 0x04080000) && (addr < 0x040c0000)) { - - if ( data != 0 ) - bprintf(PRINT_NORMAL, _T("Video Attempt to write long value %8x to location %8x\n"), data, addr); - - - } else - bprintf(PRINT_NORMAL, _T("Video Attempt to write long value %8x to location %8x\n"), data, addr); -} - - -UINT8 __fastcall cps3RamReadByte(UINT32 addr) -{ - if (addr == cps3_speedup_ram_address ) - if (Sh2GetPC(0) == cps3_speedup_code_address) - Sh2BurnUntilInt(0); - - addr &= 0x7ffff; -#ifdef LSB_FIRST - return *(RamMain + (addr ^ 0x03)); -#else - return *(RamMain + addr); -#endif -} - -UINT16 __fastcall cps3RamReadWord(UINT32 addr) -{ - //bprintf(PRINT_NORMAL, _T("Ram Attempt to read long value of location %8x\n"), addr); - addr &= 0x7ffff; - - if (addr == cps3_speedup_ram_address ) - if (Sh2GetPC(0) == cps3_speedup_code_address) { - bprintf(PRINT_NORMAL, _T("Ram Attempt to read long value of location %8x\n"), addr); - Sh2BurnUntilInt(0); - } - -#ifdef LSB_FIRST - return *(UINT16 *)(RamMain + (addr ^ 0x02)); -#else - return *(UINT16 *)(RamMain + addr); -#endif -} - - -UINT32 __fastcall cps3RamReadLong(UINT32 addr) -{ - if (addr == cps3_speedup_ram_address ) - if (Sh2GetPC(0) == cps3_speedup_code_address) - Sh2BurnUntilInt(0); - - addr &= 0x7ffff; - return *(UINT32 *)(RamMain + addr); -} - -// CPS3 Region Patch -static void Cps3PatchRegion() -{ - if ( cps3_region_address ) { - - bprintf(0, _T("Region: %02x -> %02x\n"), RomBios[cps3_region_address], (RomBios[cps3_region_address] & 0xf0) | (cps3_dip & 0x0f)); - -#ifdef LSB_FIRST - RomBios[cps3_region_address] = (RomBios[cps3_region_address] & 0xf0) | (cps3_dip & 0x7f); -#else - RomBios[cps3_region_address ^ 0x03] = (RomBios[cps3_region_address ^ 0x03] & 0xf0) | (cps3_dip & 0x7f); -#endif - if ( cps3_ncd_address ) { - if (cps3_dip & 0x10) - RomBios[cps3_ncd_address] |= 0x01; - else - RomBios[cps3_ncd_address] &= 0xfe; - } - } -} - -static INT32 Cps3Reset() -{ - // re-map cram_bank - cram_bank = 0; - Sh2MapMemory((UINT8 *)RamCRam, 0x04100000, 0x041fffff, MAP_RAM); - - Cps3PatchRegion(); - - // [CD-ROM not emulated] All CHD drivers cause a Guru Meditation with the normal bios boot. - if(!BurnDrvGetHardwareCode() & HARDWARE_CAPCOM_CPS3_NO_CD){ - // normal boot - Sh2Reset(); - } else { - // fast boot - if (cps3_isSpecial) { - Sh2Reset( *(UINT32 *)(RomGame + 0), *(UINT32 *)(RomGame + 4) ); - Sh2SetVBR(0x06000000); - } else { - Sh2Reset( *(UINT32 *)(RomGame_D + 0), *(UINT32 *)(RomGame_D + 4) ); - Sh2SetVBR(0x06000000); - } - } - - if (cps3_dip & 0x80) { - EEPROM[0x11] = 0x100 + (EEPROM[0x11] & 0xff); - EEPROM[0x29] = 0x100 + (EEPROM[0x29] & 0xff); - } else { - EEPROM[0x11] = 0x000 + (EEPROM[0x11] & 0xff); - EEPROM[0x29] = 0x000 + (EEPROM[0x29] & 0xff); - } - - cps3_current_eeprom_read = 0; - cps3SndReset(); - cps3_reset = 0; - return 0; -} - -static void be_to_le(UINT8 * p, INT32 size) -{ - UINT8 c; - for(INT32 i=0; i (cps3_gfx_width - 8)) || (y > (cps3_gfx_height - 8))) return; - UINT16 * dst = (UINT16 *) pBurnDraw; - UINT8 * src = (UINT8 *)RamSS; - UINT16 * color = Cps3CurPal + (pal << 4); - dst += (y * cps3_gfx_width + x); - src += code * 64; - - if ( flipy ) { - dst += cps3_gfx_width * 7; -#ifdef LSB_FIRST - if ( flipx ) - for(INT32 i=0; i<8; i++, dst-= cps3_gfx_width, src += 8) { - if ( src[ 2] & 0xf ) dst[7] = color [ src[ 2] & 0xf ]; - if ( src[ 2] >> 4 ) dst[6] = color [ src[ 2] >> 4 ]; - if ( src[ 0] & 0xf ) dst[5] = color [ src[ 0] & 0xf ]; - if ( src[ 0] >> 4 ) dst[4] = color [ src[ 0] >> 4 ]; - if ( src[ 6] & 0xf ) dst[3] = color [ src[ 6] & 0xf ]; - if ( src[ 6] >> 4 ) dst[2] = color [ src[ 6] >> 4 ]; - if ( src[ 4] & 0xf ) dst[1] = color [ src[ 4] & 0xf ]; - if ( src[ 4] >> 4 ) dst[0] = color [ src[ 4] >> 4 ]; - } - else - for(INT32 i=0; i<8; i++, dst-= cps3_gfx_width, src += 8) { - if ( src[ 2] & 0xf ) dst[0] = color [ src[ 2] & 0xf ]; - if ( src[ 2] >> 4 ) dst[1] = color [ src[ 2] >> 4 ]; - if ( src[ 0] & 0xf ) dst[2] = color [ src[ 0] & 0xf ]; - if ( src[ 0] >> 4 ) dst[3] = color [ src[ 0] >> 4 ]; - if ( src[ 6] & 0xf ) dst[4] = color [ src[ 6] & 0xf ]; - if ( src[ 6] >> 4 ) dst[5] = color [ src[ 6] >> 4 ]; - if ( src[ 4] & 0xf ) dst[6] = color [ src[ 4] & 0xf ]; - if ( src[ 4] >> 4 ) dst[7] = color [ src[ 4] >> 4 ]; - } - - } else { - if ( flipx ) - for(INT32 i=0; i<8; i++, dst+= cps3_gfx_width, src += 8) { - if ( src[ 2] & 0xf ) dst[7] = color [ src[ 2] & 0xf ]; - if ( src[ 2] >> 4 ) dst[6] = color [ src[ 2] >> 4 ]; - if ( src[ 0] & 0xf ) dst[5] = color [ src[ 0] & 0xf ]; - if ( src[ 0] >> 4 ) dst[4] = color [ src[ 0] >> 4 ]; - if ( src[ 6] & 0xf ) dst[3] = color [ src[ 6] & 0xf ]; - if ( src[ 6] >> 4 ) dst[2] = color [ src[ 6] >> 4 ]; - if ( src[ 4] & 0xf ) dst[1] = color [ src[ 4] & 0xf ]; - if ( src[ 4] >> 4 ) dst[0] = color [ src[ 4] >> 4 ]; - } - else - for(INT32 i=0; i<8; i++, dst+= cps3_gfx_width, src += 8) { - if ( src[ 2] & 0xf ) dst[0] = color [ src[ 2] & 0xf ]; - if ( src[ 2] >> 4 ) dst[1] = color [ src[ 2] >> 4 ]; - if ( src[ 0] & 0xf ) dst[2] = color [ src[ 0] & 0xf ]; - if ( src[ 0] >> 4 ) dst[3] = color [ src[ 0] >> 4 ]; - if ( src[ 6] & 0xf ) dst[4] = color [ src[ 6] & 0xf ]; - if ( src[ 6] >> 4 ) dst[5] = color [ src[ 6] >> 4 ]; - if ( src[ 4] & 0xf ) dst[6] = color [ src[ 4] & 0xf ]; - if ( src[ 4] >> 4 ) dst[7] = color [ src[ 4] >> 4 ]; - } - } -#else - if ( flipx ) - for(int i=0; i<8; i++, dst-= cps3_gfx_width, src += 8) { - if ( src[ 1] & 0xf ) dst[7] = color [ src[ 1] & 0xf ]; - if ( src[ 1] >> 4 ) dst[6] = color [ src[ 1] >> 4 ]; - if ( src[ 3] & 0xf ) dst[5] = color [ src[ 3] & 0xf ]; - if ( src[ 3] >> 4 ) dst[4] = color [ src[ 3] >> 4 ]; - if ( src[ 5] & 0xf ) dst[3] = color [ src[ 5] & 0xf ]; - if ( src[ 5] >> 4 ) dst[2] = color [ src[ 5] >> 4 ]; - if ( src[ 7] & 0xf ) dst[1] = color [ src[ 7] & 0xf ]; - if ( src[ 7] >> 4 ) dst[0] = color [ src[ 7] >> 4 ]; - } - else - for(int i=0; i<8; i++, dst-= cps3_gfx_width, src += 8) { - if ( src[ 1] & 0xf ) dst[0] = color [ src[ 1] & 0xf ]; - if ( src[ 1] >> 4 ) dst[1] = color [ src[ 1] >> 4 ]; - if ( src[ 3] & 0xf ) dst[2] = color [ src[ 3] & 0xf ]; - if ( src[ 3] >> 4 ) dst[3] = color [ src[ 3] >> 4 ]; - if ( src[ 5] & 0xf ) dst[4] = color [ src[ 5] & 0xf ]; - if ( src[ 5] >> 4 ) dst[5] = color [ src[ 5] >> 4 ]; - if ( src[ 7] & 0xf ) dst[6] = color [ src[ 7] & 0xf ]; - if ( src[ 7] >> 4 ) dst[7] = color [ src[ 7] >> 4 ]; - } - - } else { - if ( flipx ) - for(int i=0; i<8; i++, dst+= cps3_gfx_width, src += 8) { - if ( src[ 1] & 0xf ) dst[7] = color [ src[ 1] & 0xf ]; - if ( src[ 1] >> 4 ) dst[6] = color [ src[ 1] >> 4 ]; - if ( src[ 3] & 0xf ) dst[5] = color [ src[ 3] & 0xf ]; - if ( src[ 3] >> 4 ) dst[4] = color [ src[ 3] >> 4 ]; - if ( src[ 5] & 0xf ) dst[3] = color [ src[ 5] & 0xf ]; - if ( src[ 5] >> 4 ) dst[2] = color [ src[ 5] >> 4 ]; - if ( src[ 7] & 0xf ) dst[1] = color [ src[ 7] & 0xf ]; - if ( src[ 7] >> 4 ) dst[0] = color [ src[ 7] >> 4 ]; - } - else - for(int i=0; i<8; i++, dst+= cps3_gfx_width, src += 8) { - if ( src[ 1 ] & 0xf ) dst[0] = color [ src[ 1 ] & 0xf ]; - if ( src[ 1 ] >> 4 ) dst[1] = color [ src[ 1 ] >> 4 ]; - if ( src[ 3 ] & 0xf ) dst[2] = color [ src[ 3 ] & 0xf ]; - if ( src[ 3 ] >> 4 ) dst[3] = color [ src[ 3 ] >> 4 ]; - if ( src[ 5 ] & 0xf ) dst[4] = color [ src[ 5 ] & 0xf ]; - if ( src[ 5 ] >> 4 ) dst[5] = color [ src[ 5 ] >> 4 ]; - if ( src[ 7 ] & 0xf ) dst[6] = color [ src[ 7 ] & 0xf ]; - if ( src[ 7 ] >> 4 ) dst[7] = color [ src[ 7 ] >> 4 ]; - } - } - -#endif - -} - -static void cps3_drawgfxzoom_1(UINT32 code, UINT32 pal, INT32 flipx, INT32 flipy, INT32 x, INT32 y, INT32 drawline) -{ - UINT32 * dst = RamScreen; - UINT8 * src = (UINT8 *) RamCRam; - dst += (drawline * 1024 + x); - -#if BE_GFX - - if ( flipy ) { - src += code * 256 + 16 * (15 - (drawline - y)); - if ( flipx ) { - if ( src[ 0] ) dst[15] = src[ 0] | pal; - if ( src[ 1] ) dst[14] = src[ 1] | pal; - if ( src[ 2] ) dst[13] = src[ 2] | pal; - if ( src[ 3] ) dst[12] = src[ 3] | pal; - if ( src[ 4] ) dst[11] = src[ 4] | pal; - if ( src[ 5] ) dst[10] = src[ 5] | pal; - if ( src[ 6] ) dst[ 9] = src[ 6] | pal; - if ( src[ 7] ) dst[ 8] = src[ 7] | pal; - if ( src[ 8] ) dst[ 7] = src[ 8] | pal; - if ( src[ 9] ) dst[ 6] = src[ 9] | pal; - if ( src[10] ) dst[ 5] = src[10] | pal; - if ( src[11] ) dst[ 4] = src[11] | pal; - if ( src[12] ) dst[ 3] = src[12] | pal; - if ( src[13] ) dst[ 2] = src[13] | pal; - if ( src[14] ) dst[ 1] = src[14] | pal; - if ( src[15] ) dst[ 0] = src[15] | pal; - } else { - if ( src[ 0] ) dst[ 0] = src[ 0] | pal; - if ( src[ 1] ) dst[ 1] = src[ 1] | pal; - if ( src[ 2] ) dst[ 2] = src[ 2] | pal; - if ( src[ 3] ) dst[ 3] = src[ 3] | pal; - if ( src[ 4] ) dst[ 4] = src[ 4] | pal; - if ( src[ 5] ) dst[ 5] = src[ 5] | pal; - if ( src[ 6] ) dst[ 6] = src[ 6] | pal; - if ( src[ 7] ) dst[ 7] = src[ 7] | pal; - if ( src[ 8] ) dst[ 8] = src[ 8] | pal; - if ( src[ 9] ) dst[ 9] = src[ 9] | pal; - if ( src[10] ) dst[10] = src[10] | pal; - if ( src[11] ) dst[11] = src[11] | pal; - if ( src[12] ) dst[12] = src[12] | pal; - if ( src[13] ) dst[13] = src[13] | pal; - if ( src[14] ) dst[14] = src[14] | pal; - if ( src[15] ) dst[15] = src[15] | pal; - } - } else { - src += code * 256 + 16 * (drawline - y); - if ( flipx ) { - if ( src[ 0] ) dst[15] = src[ 0] | pal; - if ( src[ 1] ) dst[14] = src[ 1] | pal; - if ( src[ 2] ) dst[13] = src[ 2] | pal; - if ( src[ 3] ) dst[12] = src[ 3] | pal; - if ( src[ 4] ) dst[11] = src[ 4] | pal; - if ( src[ 5] ) dst[10] = src[ 5] | pal; - if ( src[ 6] ) dst[ 9] = src[ 6] | pal; - if ( src[ 7] ) dst[ 8] = src[ 7] | pal; - if ( src[ 8] ) dst[ 7] = src[ 8] | pal; - if ( src[ 9] ) dst[ 6] = src[ 9] | pal; - if ( src[10] ) dst[ 5] = src[10] | pal; - if ( src[11] ) dst[ 4] = src[11] | pal; - if ( src[12] ) dst[ 3] = src[12] | pal; - if ( src[13] ) dst[ 2] = src[13] | pal; - if ( src[14] ) dst[ 1] = src[14] | pal; - if ( src[15] ) dst[ 0] = src[15] | pal; - } else { - if ( src[ 0] ) dst[ 0] = src[ 0] | pal; - if ( src[ 1] ) dst[ 1] = src[ 1] | pal; - if ( src[ 2] ) dst[ 2] = src[ 2] | pal; - if ( src[ 3] ) dst[ 3] = src[ 3] | pal; - if ( src[ 4] ) dst[ 4] = src[ 4] | pal; - if ( src[ 5] ) dst[ 5] = src[ 5] | pal; - if ( src[ 6] ) dst[ 6] = src[ 6] | pal; - if ( src[ 7] ) dst[ 7] = src[ 7] | pal; - if ( src[ 8] ) dst[ 8] = src[ 8] | pal; - if ( src[ 9] ) dst[ 9] = src[ 9] | pal; - if ( src[10] ) dst[10] = src[10] | pal; - if ( src[11] ) dst[11] = src[11] | pal; - if ( src[12] ) dst[12] = src[12] | pal; - if ( src[13] ) dst[13] = src[13] | pal; - if ( src[14] ) dst[14] = src[14] | pal; - if ( src[15] ) dst[15] = src[15] | pal; - } - } - -#else - - if ( flipy ) { - src += code * 256 + 16 * (15 - (drawline - y)); - if ( flipx ) { - if ( src[ 3] ) dst[15] = src[ 3] | pal; - if ( src[ 2] ) dst[14] = src[ 2] | pal; - if ( src[ 1] ) dst[13] = src[ 1] | pal; - if ( src[ 0] ) dst[12] = src[ 0] | pal; - if ( src[ 7] ) dst[11] = src[ 7] | pal; - if ( src[ 6] ) dst[10] = src[ 6] | pal; - if ( src[ 5] ) dst[ 9] = src[ 5] | pal; - if ( src[ 4] ) dst[ 8] = src[ 4] | pal; - if ( src[11] ) dst[ 7] = src[11] | pal; - if ( src[10] ) dst[ 6] = src[10] | pal; - if ( src[ 9] ) dst[ 5] = src[ 9] | pal; - if ( src[ 8] ) dst[ 4] = src[ 8] | pal; - if ( src[15] ) dst[ 3] = src[15] | pal; - if ( src[14] ) dst[ 2] = src[14] | pal; - if ( src[13] ) dst[ 1] = src[13] | pal; - if ( src[12] ) dst[ 0] = src[12] | pal; - } else { - if ( src[ 3] ) dst[ 0] = src[ 3] | pal; - if ( src[ 2] ) dst[ 1] = src[ 2] | pal; - if ( src[ 1] ) dst[ 2] = src[ 1] | pal; - if ( src[ 0] ) dst[ 3] = src[ 0] | pal; - if ( src[ 7] ) dst[ 4] = src[ 7] | pal; - if ( src[ 6] ) dst[ 5] = src[ 6] | pal; - if ( src[ 5] ) dst[ 6] = src[ 5] | pal; - if ( src[ 4] ) dst[ 7] = src[ 4] | pal; - if ( src[11] ) dst[ 8] = src[11] | pal; - if ( src[10] ) dst[ 9] = src[10] | pal; - if ( src[ 9] ) dst[10] = src[ 9] | pal; - if ( src[ 8] ) dst[11] = src[ 8] | pal; - if ( src[15] ) dst[12] = src[15] | pal; - if ( src[14] ) dst[13] = src[14] | pal; - if ( src[13] ) dst[14] = src[13] | pal; - if ( src[12] ) dst[15] = src[12] | pal; - } - } else { - src += code * 256 + 16 * (drawline - y); - if ( flipx ) { - if ( src[ 3] ) dst[15] = src[ 3] | pal; - if ( src[ 2] ) dst[14] = src[ 2] | pal; - if ( src[ 1] ) dst[13] = src[ 1] | pal; - if ( src[ 0] ) dst[12] = src[ 0] | pal; - if ( src[ 7] ) dst[11] = src[ 7] | pal; - if ( src[ 6] ) dst[10] = src[ 6] | pal; - if ( src[ 5] ) dst[ 9] = src[ 5] | pal; - if ( src[ 4] ) dst[ 8] = src[ 4] | pal; - if ( src[11] ) dst[ 7] = src[11] | pal; - if ( src[10] ) dst[ 6] = src[10] | pal; - if ( src[ 9] ) dst[ 5] = src[ 9] | pal; - if ( src[ 8] ) dst[ 4] = src[ 8] | pal; - if ( src[15] ) dst[ 3] = src[15] | pal; - if ( src[14] ) dst[ 2] = src[14] | pal; - if ( src[13] ) dst[ 1] = src[13] | pal; - if ( src[12] ) dst[ 0] = src[12] | pal; - } else { - if ( src[ 3] ) dst[ 0] = src[ 3] | pal; - if ( src[ 2] ) dst[ 1] = src[ 2] | pal; - if ( src[ 1] ) dst[ 2] = src[ 1] | pal; - if ( src[ 0] ) dst[ 3] = src[ 0] | pal; - if ( src[ 7] ) dst[ 4] = src[ 7] | pal; - if ( src[ 6] ) dst[ 5] = src[ 6] | pal; - if ( src[ 5] ) dst[ 6] = src[ 5] | pal; - if ( src[ 4] ) dst[ 7] = src[ 4] | pal; - if ( src[11] ) dst[ 8] = src[11] | pal; - if ( src[10] ) dst[ 9] = src[10] | pal; - if ( src[ 9] ) dst[10] = src[ 9] | pal; - if ( src[ 8] ) dst[11] = src[ 8] | pal; - if ( src[15] ) dst[12] = src[15] | pal; - if ( src[14] ) dst[13] = src[14] | pal; - if ( src[13] ) dst[14] = src[13] | pal; - if ( src[12] ) dst[15] = src[12] | pal; - } - } - -#endif -} - -static void cps3_drawgfxzoom_2(UINT32 code, UINT32 pal, INT32 flipx, INT32 flipy, INT32 sx, INT32 sy, INT32 scalex, INT32 scaley, INT32 alpha) -{ - //if (!scalex || !scaley) return; - - UINT8 * source_base = (UINT8 *) RamCRam + code * 256; - - INT32 sprite_screen_height = (scaley * 16 + 0x8000) >> 16; - INT32 sprite_screen_width = (scalex * 16 + 0x8000) >> 16; - if (sprite_screen_width && sprite_screen_height) { - // compute sprite increment per screen pixel - INT32 dx = (16 << 16) / sprite_screen_width; - INT32 dy = (16 << 16) / sprite_screen_height; - - INT32 ex = sx + sprite_screen_width; - INT32 ey = sy + sprite_screen_height; - - INT32 x_index_base; - INT32 y_index; - - if( flipx ) { - x_index_base = (sprite_screen_width - 1) * dx; - dx = -dx; - } else - x_index_base = 0; - - if( flipy ) { - y_index = (sprite_screen_height - 1) * dy; - dy = -dy; - } else - y_index = 0; - - { - if( sx < 0) - { /* clip left */ - INT32 pixels = 0-sx; - sx += pixels; - x_index_base += pixels*dx; - } - if( sy < 0 ) - { /* clip top */ - INT32 pixels = 0-sy; - sy += pixels; - y_index += pixels*dy; - } - if( ex > cps3_gfx_max_x+1 ) - { /* clip right */ - INT32 pixels = ex-cps3_gfx_max_x-1; - ex -= pixels; - } - if( ey > cps3_gfx_max_y+1 ) - { /* clip bottom */ - INT32 pixels = ey-cps3_gfx_max_y-1; - ey -= pixels; - } - } - - if( ex > sx ) { - switch( alpha ) { - case 0: - for( INT32 y=sy; y>16) * 16; - UINT32 * dest = RamScreen + y * 512 * 2; - INT32 x_index = x_index_base; - for(INT32 x=sx; x>16) ]; -#else - UINT8 c = source[ (x_index>>16) ^ 3 ]; -#endif - if( c ) dest[x] = pal | c; - x_index += dx; - } - y_index += dy; - } - break; - case 6: - for( INT32 y=sy; y>16) * 16; - UINT32 * dest = RamScreen + y * 512 * 2; - INT32 x_index = x_index_base; - for(INT32 x=sx; x>16)]; -#else - UINT8 c = source[ (x_index>>16) ^ 3 ]; -#endif - dest[x] |= ((c&0x0000f) << 13); - x_index += dx; - } - y_index += dy; - } - break; - case 8: - for( INT32 y=sy; y>16) * 16; - UINT32 * dest = RamScreen + y * 512 * 2; - INT32 x_index = x_index_base; - for(INT32 x=sx; x>16) ]; -#else - UINT8 c = source[ (x_index>>16) ^ 3 ]; -#endif - - if (c) { - dest[x] |= 0x8000; - if (pal&0x10000) dest[x] |= 0x10000; - } - x_index += dx; - } - y_index += dy; - } - break; - } - } - } -} - -static void cps3_draw_tilemapsprite_line(INT32 drawline, UINT32 * regs ) -{ - INT32 scrolly = ((regs[0]&0x0000ffff)>>0)+4; - INT32 line = drawline + scrolly; - line &= 0x3ff; - - if (!(regs[1]&0x00008000)) return; - - { - UINT32 mapbase = (regs[2]&0x007f0000)>>16; - UINT32 linebase= (regs[2]&0x7f000000)>>24; - INT32 linescroll_enable = (regs[1]&0x00004000); - - INT32 scrollx; - INT32 tileline = (line/16)+1; - INT32 tilesubline = line % 16; - - mapbase = mapbase << 10; - linebase = linebase << 10; - - if (!linescroll_enable) { - scrollx = (regs[0]&0xffff0000)>>16; - } else { - scrollx = (regs[0]&0xffff0000)>>16; - scrollx+= (RamSpr[linebase+((line+16-4)&0x3ff)]>>16)&0x3ff; - } - - if (drawline>cps3_gfx_max_y+4) return; - - for (INT32 x=0;x<(cps3_gfx_max_x/16)+2;x++) { - - UINT32 dat; - INT32 tileno; - INT32 colour; - INT32 bpp; - INT32 xflip,yflip; - - dat = RamSpr[mapbase+((tileline&63)*64)+((x+scrollx/16)&63)]; - tileno = (dat & 0xffff0000)>>17; - colour = (dat & 0x000001ff)>>0; - bpp = (dat & 0x0000200)>>9; - yflip = (dat & 0x00000800)>>11; - xflip = (dat & 0x00001000)>>12; - - if (!bpp) colour <<= 8; - else colour <<= 6; - - cps3_drawgfxzoom_1(tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline, drawline); - } - } -} - -static INT32 WideScreenFrameDelay = 0; - -static void DrvDraw() -{ - INT32 bg_drawn[4] = { 0, 0, 0, 0 }; - - UINT32 fullscreenzoom = RamVReg[ 6 * 4 + 3 ] & 0xff; - UINT32 fullscreenzoomwidecheck = RamVReg[6 * 4 + 1]; - - if (((fullscreenzoomwidecheck & 0xffff0000) >> 16) == 0x0265) { - INT32 Width, Height; - BurnDrvGetVisibleSize(&Width, &Height); - - if (Width != 496) { - BurnDrvSetVisibleSize(496, 224); - BurnDrvSetAspect(16, 9); - Reinitialise(); - WideScreenFrameDelay = GetCurrentFrame() + 1; - } - } else { - INT32 Width, Height; - BurnDrvGetVisibleSize(&Width, &Height); - - if (Width != 384) { - BurnDrvSetVisibleSize(384, 224); - BurnDrvSetAspect(4, 3); - Reinitialise(); - WideScreenFrameDelay = GetCurrentFrame() + 1; - } - } - - if (fullscreenzoom > 0x80) fullscreenzoom = 0x80; - UINT32 fsz = (fullscreenzoom << (16 - 6)); - - cps3_gfx_max_x = ((cps3_gfx_width * fsz) >> 16) - 1; // 384 ( 496 for SFIII2 Only) - cps3_gfx_max_y = ((cps3_gfx_height * fsz) >> 16) - 1; // 224 - - if (nBurnLayer & 1) - { - UINT32 * pscr = RamScreen; - INT32 clrsz = (cps3_gfx_max_x + 1) * sizeof(INT32); - for(INT32 yy = 0; yy<=cps3_gfx_max_y; yy++, pscr += 512*2) - memset(pscr, 0, clrsz); - } - else - { - Cps3CurPal[0x20000] = BurnHighCol(0xff, 0x00, 0xff, 0); - - INT32 i; - for (i = 0; i < 1024 * 448; i++) { - RamScreen[i] = 0x20000; - } - } - - // Draw Sprites - { - for (INT32 i=0x00000/4;i<0x2000/4;i+=4) { - INT32 xpos = (RamSpr[i+1]&0x03ff0000)>>16; - INT32 ypos = (RamSpr[i+1]&0x000003ff)>>0; - - INT32 gscroll = (RamSpr[i+0]&0x70000000)>>28; - INT32 length = (RamSpr[i+0]&0x01ff0000)>>14; // how many entries in the sprite table - UINT32 start = (RamSpr[i+0]&0x00007ff0)>>4; - - INT32 whichbpp = (RamSpr[i+2]&0x40000000)>>30; // not 100% sure if this is right, jojo title / characters - INT32 whichpal = (RamSpr[i+2]&0x20000000)>>29; - INT32 global_xflip = (RamSpr[i+2]&0x10000000)>>28; - INT32 global_yflip = (RamSpr[i+2]&0x08000000)>>27; - INT32 global_alpha = (RamSpr[i+2]&0x04000000)>>26; // alpha / shadow? set on sfiii2 shadows, and big black image in jojo intro - INT32 global_bpp = (RamSpr[i+2]&0x02000000)>>25; - INT32 global_pal = (RamSpr[i+2]&0x01ff0000)>>16; - - INT32 gscrollx = (RamVReg[gscroll]&0x03ff0000)>>16; - INT32 gscrolly = (RamVReg[gscroll]&0x000003ff)>>0; - - start = (start * 0x100) >> 2; - - if ((RamSpr[i+0]&0xf0000000) == 0x80000000) break; - - for (INT32 j=0; j>17; - INT32 count; - INT32 xpos2 = (value2 & 0x03ff0000)>>16; - INT32 ypos2 = (value2 & 0x000003ff)>>0; - INT32 flipx = (value1 & 0x00001000)>>12; - INT32 flipy = (value1 & 0x00000800)>>11; - INT32 alpha = (value1 & 0x00000400)>>10; //? this one is used for alpha effects on warzard - INT32 bpp = (value1 & 0x00000200)>>9; - INT32 pal = (value1 & 0x000001ff); - - INT32 ysizedraw2 = ((value3 & 0x7f000000)>>24); - INT32 xsizedraw2 = ((value3 & 0x007f0000)>>16); - INT32 xx,yy; - - INT32 tilestable[4] = { 8,1,2,4 }; - INT32 ysize2 = ((value3 & 0x0000000c)>>2); - INT32 xsize2 = ((value3 & 0x00000003)>>0); - UINT32 xinc,yinc; - - if (ysize2==0) continue; - - if (xsize2==0) - { - if (nBurnLayer & 1) - { - INT32 tilemapnum = ((value3 & 0x00000030)>>4); - INT32 startline; - INT32 endline; - INT32 height = (value3 & 0x7f000000)>>24; - UINT32 * regs; - - regs = RamVReg + 8 + tilemapnum * 4; - endline = value2; - startline = endline - height; - - startline &=0x3ff; - endline &=0x3ff; - - if (bg_drawn[tilemapnum]==0) - { - UINT32 srcy = 0; - for (INT32 ry = 0; ry < 224; ry++, srcy += fsz) { - cps3_draw_tilemapsprite_line( srcy >> 16, regs ); - } - } - - bg_drawn[tilemapnum] = 1; - } - } else { - if (~nSpriteEnable & 1) continue; - - ysize2 = tilestable[ysize2]; - xsize2 = tilestable[xsize2]; - - xinc = ((xsizedraw2+1)<<16) / ((xsize2*0x10)); - yinc = ((ysizedraw2+1)<<16) / ((ysize2*0x10)); - - xsize2-=1; - ysize2-=1; - - flipx ^= global_xflip; - flipy ^= global_yflip; - - if (!flipx) xpos2+=((xsizedraw2+1)/2); - else xpos2-=((xsizedraw2+1)/2); - - ypos2+=((ysizedraw2+1)/2); - - if (!flipx) xpos2-= (((xsize2+1)*16*xinc)>>16); - else xpos2+= (((xsize2)*16*xinc)>>16); - - if (flipy) ypos2-= ((ysize2*16*yinc)>>16); - - { - count = 0; - for (xx=0;xx>16) ); - else current_xpos = (xpos+xpos2-((xx*16*xinc)>>16)); - - current_xpos += gscrollx; - current_xpos += 1; - current_xpos &=0x3ff; - if (current_xpos&0x200) current_xpos-=0x400; - - for (yy=0;yy>16)); - else current_ypos = (ypos+ypos2-((yy*16*yinc)>>16)); - - current_ypos += gscrolly; - current_ypos = 0x3ff-current_ypos; - current_ypos -= 17; - current_ypos &=0x3ff; - - if (current_ypos&0x200) current_ypos-=0x400; - - /* use the palette value from the main list or the sublists? */ - if (whichpal) actualpal = global_pal; - else actualpal = pal; - - /* use the bpp value from the main list or the sublists? */ - INT32 color_granularity; - if (whichbpp) { - if (!global_bpp) color_granularity = 8; - else color_granularity = 6; - } else { - if (!bpp) color_granularity = 8; - else color_granularity = 6; - } - actualpal <<= color_granularity; - - { - INT32 realtileno = tileno+count; - - if ( realtileno ) { - if (global_alpha || alpha) { - // fix jojo's title in it's intro ??? - if ( global_alpha && (global_pal & 0x100)) - actualpal &= 0x0ffff; - - cps3_drawgfxzoom_2(realtileno,actualpal,flipx,flipy,current_xpos,current_ypos,xinc,yinc, color_granularity); - - } else { - cps3_drawgfxzoom_2(realtileno,actualpal,flipx,flipy,current_xpos,current_ypos,xinc,yinc, 0); - } - } - count++; - } - } - } - } - } - } - } - } - - { - UINT32 srcx, srcy = 0; - UINT32 * srcbitmap; - UINT16 * dstbitmap = (UINT16 * )pBurnDraw; - - for (INT32 rendery=0; rendery<224; rendery++) { - srcbitmap = RamScreen + (srcy >> 16) * 1024; - srcx=0; - for (INT32 renderx=0; renderx>16] ]; - srcx += fsz; - } - srcy += fsz; - } - } - - if (nBurnLayer & 2) - { - // bank select? (sfiii2 intro) - INT32 count = (ss_bank_base & 0x01000000) ? 0x0000 : 0x0800; - for (INT32 y=0; y<32-4; y++) { - for (INT32 x=0; x<64; x++, count++) { - UINT32 data = RamSS[count]; // +0x800 = 2nd bank, used on sfiii2 intro.. - UINT32 tile = (data >> 16) & 0x1ff; - INT32 pal = (data & 0x003f) >> 1; - INT32 flipx = data & 0x0080; - INT32 flipy = data & 0x0040; - pal += ss_pal_base << 5; - - if (tile == 0) continue; // ok? - - tile+=0x200; - cps3_drawgfxzoom_0(tile,pal,flipx,flipy,x*8,y*8); - } - } - } -} - -static INT32 cps_int10_cnt = 0; - -INT32 cps3Frame() -{ - if (cps3_reset) - Cps3Reset(); - - if (cps3_palette_change) { - for(INT32 i=0;i<0x0020000;i++) { -#ifdef LSB_FIRST - INT32 data = RamPal[i ^ 1]; -#else - INT32 data = RamPal[i]; -#endif - INT32 r = (data & 0x001F) << 3; // Red - INT32 g = (data & 0x03E0) >> 2; // Green - INT32 b = (data & 0x7C00) >> 7; // Blue - r |= r >> 5; - g |= g >> 5; - b |= b >> 5; - Cps3CurPal[i] = BurnHighCol(r, g, b, 0); - } - cps3_palette_change = 0; - } - - if (WideScreenFrameDelay == GetCurrentFrame()) { - BurnDrvGetVisibleSize(&cps3_gfx_width, &cps3_gfx_height); - WideScreenFrameDelay = 0; - } - -// EEPROM[0x11] = 0x100 + (EEPROM[0x11] & 0xff); -// EEPROM[0x29] = 0x100 + (EEPROM[0x29] & 0xff); - - Cps3Input[0] = 0; - Cps3Input[1] = 0; - //Cps3Input[2] = 0; - Cps3Input[3] = 0; - for (INT32 i=0; i<16; i++) { - Cps3Input[0] |= (Cps3But1[i] & 1) << i; - Cps3Input[1] |= (Cps3But2[i] & 1) << i; - Cps3Input[3] |= (Cps3But3[i] & 1) << i; - } - - // Clear Opposites - Cps3ClearOpposites(&Cps3Input[0]); - Cps3ClearOpposites(&Cps3Input[1]); - - for (INT32 i=0; i<4; i++) { - - Sh2Run(6250000 * 4 / 60 / 4); - - if (cps_int10_cnt >= 2) { - cps_int10_cnt = 0; - Sh2SetIRQLine(10, CPU_IRQSTATUS_ACK); - } else cps_int10_cnt++; - - } - Sh2SetIRQLine(12, CPU_IRQSTATUS_ACK); - - cps3SndUpdate(); - -// bprintf(0, _T("PC: %08x\n"), Sh2GetPC(0)); - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -INT32 cps3Scan(INT32 nAction, INT32 *pnMin) -{ - if (pnMin) *pnMin = 0x029672; - - struct BurnArea ba; - - if (nAction & ACB_NVRAM) { - // Save EEPROM configuration - ba.Data = EEPROM; - ba.nLen = 0x0000400; - ba.nAddress = 0; - ba.szName = "EEPROM RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { - - ba.Data = RamMain; - ba.nLen = 0x0080000; - ba.nAddress = 0; - ba.szName = "Main RAM"; - BurnAcb(&ba); - - ba.Data = RamSpr; - ba.nLen = 0x0080000; - ba.nAddress = 0; - ba.szName = "Sprite RAM"; - BurnAcb(&ba); - - ba.Data = RamSS; - ba.nLen = 0x0010000; - ba.nAddress = 0; - ba.szName = "Char ROM"; - BurnAcb(&ba); - - ba.Data = RamVReg; - ba.nLen = 0x0000100; - ba.nAddress = 0; - ba.szName = "Video REG"; - BurnAcb(&ba); - - ba.Data = RamC000; - ba.nLen = 0x0000400 * 2; - ba.nAddress = 0; - ba.szName = "RAM C000"; - BurnAcb(&ba); - - ba.Data = RamPal; - ba.nLen = 0x0040000; - ba.nAddress = 0; - ba.szName = "Palette"; - BurnAcb(&ba); - - ba.Data = RamCRam; - ba.nLen = 0x0800000; - ba.nAddress = 0; - ba.szName = "Sprite ROM"; - BurnAcb(&ba); - -/* // so huge. need not backup it while NOCD - // otherwize, need backup gfx also - ba.Data = RomGame; - ba.nLen = 0x1000000; - ba.nAddress = 0; - ba.szName = "Game ROM"; - BurnAcb(&ba); -*/ - } - - if (nAction & ACB_DRIVER_DATA) { - - Sh2Scan(nAction); - cps3SndScan(nAction); - - SCAN_VAR(Cps3Input); - - SCAN_VAR(ss_bank_base); - SCAN_VAR(ss_pal_base); - SCAN_VAR(cram_bank); - SCAN_VAR(cps3_current_eeprom_read); - SCAN_VAR(gfxflash_bank); - - SCAN_VAR(paldma_source); - SCAN_VAR(paldma_dest); - SCAN_VAR(paldma_fade); - SCAN_VAR(paldma_length); - - SCAN_VAR(chardma_source); - SCAN_VAR(chardma_table_address); - - //SCAN_VAR(main_flash); - - //SCAN_VAR(last_normal_byte); - //SCAN_VAR(lastb); - //SCAN_VAR(lastb2); - - SCAN_VAR(cps_int10_cnt); - - if (nAction & ACB_WRITE) { - - // rebuild current palette - cps3_palette_change = 1; - - // remap RamCRam - Sh2MapMemory(((UINT8 *)RamCRam) + (cram_bank << 20), 0x04100000, 0x041fffff, MAP_RAM); - - } - - } - - return 0; -} diff --git a/jan/src/burn/drv/cps3/cps3snd.cpp b/jan/src/burn/drv/cps3/cps3snd.cpp deleted file mode 100644 index b23e1bf1e..000000000 --- a/jan/src/burn/drv/cps3/cps3snd.cpp +++ /dev/null @@ -1,234 +0,0 @@ -#include "cps3.h" - -// CPS-3 sound emulation by Philip Bennett - -#define CPS3_VOICES 16 - -#define CPS3_SND_INT_RATE (nBurnFPS / 100) -#define CPS3_SND_RATE (42954500 / 3 / 384) -#define CPS3_SND_BUFFER_SIZE (CPS3_SND_RATE / CPS3_SND_INT_RATE) -#define CPS3_SND_LINEAR_SHIFT 12 - -typedef struct { - UINT16 regs[16]; - UINT32 pos; - UINT16 frac; -} cps3_voice; - -typedef struct { - cps3_voice voice[CPS3_VOICES]; - UINT16 key; - - UINT8 * rombase; - UINT32 delta; - - double gain[2]; - INT32 output_dir[2]; - -} cps3snd_chip; - -static cps3snd_chip * chip; - -UINT8 __fastcall cps3SndReadByte(UINT32 addr) -{ - addr &= 0x000003ff; - bprintf(PRINT_NORMAL, _T("SND Attempt to read byte value of location %8x\n"), addr); - return 0; -} - -UINT16 __fastcall cps3SndReadWord(UINT32 addr) -{ - addr &= 0x000003ff; - - if (addr < 0x200) { - return chip->voice[addr >> 5].regs[(addr>>1) & 0xf]; - } else - if (addr == 0x200) { - return chip->key; - } else - - bprintf(PRINT_NORMAL, _T("SND Attempt to read word value of location %8x\n"), addr); - return 0; -} - -UINT32 __fastcall cps3SndReadLong(UINT32 addr) -{ - addr &= 0x000003ff; - - bprintf(PRINT_NORMAL, _T("SND Attempt to read long value of location %8x\n"), addr); - return 0; -} - -void __fastcall cps3SndWriteByte(UINT32 addr, UINT8 data) -{ - addr &= 0x000003ff; - bprintf(PRINT_NORMAL, _T("SND Attempt to write byte value %2x to location %8x\n"), data, addr); -} - -void __fastcall cps3SndWriteWord(UINT32 addr, UINT16 data) -{ - addr &= 0x000003ff; - - if (addr < 0x200) { - chip->voice[addr >> 5].regs[(addr>>1) & 0xf] = data; - //bprintf(PRINT_NORMAL, _T("SND Attempt to write word value %4x to Chip[%02d][%02d] %s\n"), data, addr >> 5, (addr>>2) & 7, (addr & 0x02) ? "lo" : "hi" ); - } else - if (addr == 0x200) { - UINT16 key = data; - for (INT32 i = 0; i < CPS3_VOICES; i++) { - // Key off -> Key on - if ((key & (1 << i)) && !(chip->key & (1 << i))) { - chip->voice[i].frac = 0; - chip->voice[i].pos = 0; - } - } - chip->key = key; - } else - bprintf(PRINT_NORMAL, _T("SND Attempt to write word value %4x to location %8x\n"), data, addr); - -} - -void __fastcall cps3SndWriteLong(UINT32 addr, UINT32 data) -{ - //addr &= 0x000003ff; - bprintf(PRINT_NORMAL, _T("SND Attempt to write long value %8x to location %8x\n"), data, addr); -} - -INT32 cps3SndInit(UINT8 * sndrom) -{ - chip = (cps3snd_chip *)BurnMalloc( sizeof(cps3snd_chip) ); - if ( chip ) { - memset( chip, 0, sizeof(cps3snd_chip) ); - chip->rombase = sndrom; - - /* - * CPS-3 Sound chip clock: 42954500 / 3 / 384 = 37286.89 - * Sound interupt 80Hz - */ - - if (nBurnSoundRate) { - //chip->delta = 37286.9 / nBurnSoundRate; - chip->delta = (CPS3_SND_BUFFER_SIZE << CPS3_SND_LINEAR_SHIFT) / nBurnSoundLen; - //bprintf(0, _T("BurnSnd %08x, %d, %d\n"), chip->delta, chip->burnlen, nBurnSoundLen); - } - - chip->gain[BURN_SND_CPS3SND_ROUTE_1] = 1.00; - chip->gain[BURN_SND_CPS3SND_ROUTE_2] = 1.00; - chip->output_dir[BURN_SND_CPS3SND_ROUTE_1] = BURN_SND_ROUTE_LEFT; - chip->output_dir[BURN_SND_CPS3SND_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - - return 0; - } - return 1; -} - -void cps3SndSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ - chip->gain[nIndex] = nVolume; - chip->output_dir[nIndex] = nRouteDir; -} - -void cps3SndReset() -{ -} - -void cps3SndExit() -{ - BurnFree( chip ); -} - -void cps3SndUpdate() -{ - if (!pBurnSoundOut) { - // TODO: ??? - // chip->key = 0; - return; - } - - memset(pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); - INT8 * base = (INT8 *)chip->rombase; - cps3_voice *vptr = &chip->voice[0]; - - for(INT32 i=0; ikey & (1 << i)) { - - UINT32 start = ((vptr->regs[ 3] << 16) | vptr->regs[ 2]) - 0x400000; - UINT32 end = ((vptr->regs[11] << 16) | vptr->regs[10]) - 0x400000; - UINT32 loop = ((vptr->regs[ 9] << 16) | vptr->regs[ 7]) - 0x400000; - UINT32 step = ( vptr->regs[ 6] * chip->delta ) >> CPS3_SND_LINEAR_SHIFT; - - //INT32 vol_l = ((signed short)vptr->regs[15] * 12) >> 4; - //INT32 vol_r = ((signed short)vptr->regs[14] * 12) >> 4; - INT32 vol_l = (INT16)vptr->regs[15]; - INT32 vol_r = (INT16)vptr->regs[14]; - - UINT32 pos = vptr->pos; - UINT32 frac = vptr->frac; - - /* Go through the buffer and add voice contributions */ - INT16 * buffer = (INT16 *)pBurnSoundOut; - - for (INT32 j=0; j> 12); - frac &= 0xfff; - - if (start + pos >= end) { - if (vptr->regs[5]) { - pos = loop - start; - } else { - // chip->key &= ~(1 << i); - // don't force key off [hap 5/31/14] - break; - } - } - - // 8bit sample store with 16bit bigend ??? - sample = base[(start + pos) ^ 1]; - frac += step; - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((chip->output_dir[BURN_SND_CPS3SND_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(((sample * vol_l) >> 8) * chip->gain[BURN_SND_CPS3SND_ROUTE_1]); - } - if ((chip->output_dir[BURN_SND_CPS3SND_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(((sample * vol_l) >> 8) * chip->gain[BURN_SND_CPS3SND_ROUTE_1]); - } - - if ((chip->output_dir[BURN_SND_CPS3SND_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(((sample * vol_r) >> 8) * chip->gain[BURN_SND_CPS3SND_ROUTE_2]); - } - if ((chip->output_dir[BURN_SND_CPS3SND_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(((sample * vol_r) >> 8) * chip->gain[BURN_SND_CPS3SND_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample + buffer[1]); - nRightSample = BURN_SND_CLIP(nRightSample + buffer[0]); - - buffer[0] = nRightSample; - buffer[1] = nLeftSample; - - buffer += 2; - } - - - vptr->pos = pos; - vptr->frac = frac; - } - } - -} - -INT32 cps3SndScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - - SCAN_VAR( chip->voice ); - SCAN_VAR( chip->key ); - - } - return 0; -} - diff --git a/jan/src/burn/drv/cps3/d_cps3.cpp b/jan/src/burn/drv/cps3/d_cps3.cpp deleted file mode 100644 index ba25c95fe..000000000 --- a/jan/src/burn/drv/cps3/d_cps3.cpp +++ /dev/null @@ -1,1563 +0,0 @@ -// ------------------------------------------------------------------------------------ -// Capcom Play System III Drivers for FB Alpha (2007 - 2008). -// ------------------------------------------------------------------------------------ -// Based on MAME driver by David Haywood, Andreas Naive, El Semi, Philip Bennett, -// and Tomasz Slanina -// -// v1 [ OopsWare ] -// - Original drivers release. -// -// v2 [ CaptainCPS-X ] -// - Verified drivers. -// - Updated DIPs. -// - Updated some Inits. -// - Added some Comments. -// -// v3 [ BisonSAS ] -// - Added default game regions DIPs. -// - Added unicode titles for "jojo" and "jojoba". -// - Changed the redeartn BIOS to "warzard_euro.29f400.u2". -// - Added "HARDWARE_CAPCOM_CPS3_NO_CD" flag for NOCD sets. -// -// v4 [ CaptainCPS-X ] -// - Updated comments & organized structures of code. -// - Revised code for compatibility with FB Alpha Enhanced. -// -// More info: http://neosource.1emu.net/forums/index.php -// -// ------------------------------------------------------------------------------------ - -#include "cps3.h" - -static struct BurnInputInfo cps3InputList[] = { - {"P1 Coin", BIT_DIGITAL, Cps3But2 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, Cps3But2 + 12, "p1 start" }, - - {"P1 Up", BIT_DIGITAL, Cps3But1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, Cps3But1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, Cps3But1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, Cps3But1 + 3, "p1 right" }, - {"P1 Weak Punch", BIT_DIGITAL, Cps3But1 + 4, "p1 fire 1" }, - {"P1 Medium Punch", BIT_DIGITAL, Cps3But1 + 5, "p1 fire 2" }, - {"P1 Strong Punch", BIT_DIGITAL, Cps3But1 + 6, "p1 fire 3" }, - {"P1 Weak Kick", BIT_DIGITAL, Cps3But3 + 3, "p1 fire 4" }, - {"P1 Medium Kick", BIT_DIGITAL, Cps3But3 + 2, "p1 fire 5" }, - {"P1 Strong Kick", BIT_DIGITAL, Cps3But3 + 1, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, Cps3But2 + 9, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, Cps3But2 + 13, "p2 start" }, - - {"P2 Up", BIT_DIGITAL, Cps3But1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, Cps3But1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, Cps3But1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, Cps3But1 + 11, "p2 right" }, - {"P2 Weak Punch", BIT_DIGITAL, Cps3But1 + 12, "p2 fire 1" }, - {"P2 Medium Punch", BIT_DIGITAL, Cps3But1 + 13, "p2 fire 2" }, - {"P2 Strong Punch", BIT_DIGITAL, Cps3But1 + 14, "p2 fire 3" }, - {"P2 Weak Kick", BIT_DIGITAL, Cps3But3 + 4, "p2 fire 4" }, - {"P2 Medium Kick", BIT_DIGITAL, Cps3But3 + 5, "p2 fire 5" }, - {"P2 Strong Kick", BIT_DIGITAL, Cps3But2 + 10, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &cps3_reset, "reset" }, - {"Diagnostic", BIT_DIGITAL, Cps3But2 + 1, "diag" }, - {"Service", BIT_DIGITAL, Cps3But2 + 0, "service" }, - {"Region", BIT_DIPSWITCH, &cps3_dip, "dip" }, -}; - -STDINPUTINFO(cps3) - -// ------------------------------------------------------------------------------------ - -static struct BurnDIPInfo regionDIPList[] = { - - // Region - {0, 0xFD, 0, 7, "Region"}, - {0x1B, 0x01, 0xFF, 0x01, "Japan"}, - {0x1B, 0x01, 0xFF, 0x02, "Asia"}, - {0x1B, 0x01, 0xFF, 0x03, "Euro"}, - {0x1B, 0x01, 0xFF, 0x04, "USA"}, - {0x1B, 0x01, 0xFF, 0x05, "Hispanic"}, - {0x1B, 0x01, 0xFF, 0x06, "Brazil"}, - {0x1B, 0x01, 0xFF, 0x07, "Oceania"}, - {0x1B, 0x01, 0xFF, 0x08, "Asia"}, - {0x1B, 0x01, 0xFF, 0x00, "XXXXXX"}, - -// {0, 0xFE, 0, 2, "NO CD"}, -// {0x1B, 0x01, 0x10, 0x00, "No"}, -// {0x1B, 0x01, 0x10, 0x10, "Yes"}, -}; - -static struct BurnDIPInfo jojobaRegionDIPList[] = { - - // Region - {0, 0xFD, 0, 8, "Region"}, - {0x1B, 0x01, 0xFF, 0x01, "Japan"}, - {0x1B, 0x01, 0xFF, 0x02, "Asia"}, - {0x1B, 0x01, 0xFF, 0x03, "Euro"}, - {0x1B, 0x01, 0xFF, 0x04, "USA"}, - {0x1B, 0x01, 0xFF, 0x05, "Hispanic"}, - {0x1B, 0x01, 0xFF, 0x06, "Brazil"}, - {0x1B, 0x01, 0xFF, 0x07, "Oceania"}, - {0x1B, 0x01, 0xFF, 0x08, "Korea"}, // fake region? - {0x1B, 0x01, 0xFF, 0x00, "XXXXXX"}, -}; - -static struct BurnDIPInfo redeartnRegionDIPList[] = { - - // Region - {0, 0xFD, 0, 7, "Region"}, - {0x1B, 0x01, 0xFF, 0x51, "Japan"}, - {0x1B, 0x01, 0xFF, 0x52, "Asia"}, - {0x1B, 0x01, 0xFF, 0x53, "Euro"}, - {0x1B, 0x01, 0xFF, 0x54, "USA"}, - {0x1B, 0x01, 0xFF, 0x55, "Hispanic"}, - {0x1B, 0x01, 0xFF, 0x56, "Brazil"}, - {0x1B, 0x01, 0xFF, 0x57, "Oceania"}, - {0x1B, 0x01, 0xFF, 0x58, "Asia"}, - {0x1B, 0x01, 0xFF, 0x50, "Japan"}, -}; - -static struct BurnDIPInfo sfiiiDIPList[] = { - - // Region - {0, 0xFD, 0, 7, "Region"}, - {0x1B, 0x01, 0x0F, 0x01, "Japan"}, - {0x1B, 0x01, 0x0F, 0x02, "Asia"}, - {0x1B, 0x01, 0x0F, 0x03, "Euro"}, - {0x1B, 0x01, 0x0F, 0x04, "USA"}, - {0x1B, 0x01, 0x0F, 0x05, "Hispanic"}, - {0x1B, 0x01, 0x0F, 0x06, "Brazil"}, - {0x1B, 0x01, 0x0F, 0x07, "Oceania"}, - {0x1B, 0x01, 0x0F, 0x08, "Asia"}, - {0x1B, 0x01, 0x0F, 0x00, "XXXXXX"}, - - {0, 0xFD, 0, 2, "Fake Widescreen DIP"}, - {0x1B, 0x01, 0x80, 0x80, "Widescreen"}, - {0x1B, 0x01, 0x80, 0x00, "Normal"}, - -// {0, 0xFE, 0, 2, "NO CD"}, -// {0x1B, 0x01, 0x10, 0x00, "No"}, -// {0x1B, 0x01, 0x10, 0x10, "Yes"}, -}; - -static struct BurnDIPInfo japanRegionDIPList[] = { - - // Defaults - {0x1B, 0xFF, 0xFF, 0x01, NULL}, -}; - -static struct BurnDIPInfo asiaRegionDIPList[] = { - - // Defaults - {0x1B, 0xFF, 0xFF, 0x02, NULL}, -}; - -static struct BurnDIPInfo euroRegionDIPList[] = { - - // Defaults - {0x1B, 0xFF, 0xFF, 0x03, NULL}, -}; - -static struct BurnDIPInfo usaRegionDIPList[] = { - - // Defaults - {0x1B, 0xFF, 0xFF, 0x04, NULL}, -}; - -static struct BurnDIPInfo hispanicRegionDIPList[] = { - - // Defaults - {0x1B, 0xFF, 0xFF, 0x05, NULL}, -}; - -static struct BurnDIPInfo euroRedeartnDIPList[] = { - - // Defaults - {0x1B, 0xFF, 0xFF, 0x53, NULL}, -}; - -static struct BurnDIPInfo japanwarzardDIPList[] = { - - // Defaults - {0x1B, 0xFF, 0xFF, 0x51, NULL}, -}; - -STDDIPINFOEXT(japan, region, japanRegion) -STDDIPINFOEXT(asia, region, asiaRegion) -STDDIPINFOEXT(euro, region, euroRegion) -STDDIPINFOEXT(usa, region, usaRegion) -STDDIPINFOEXT(jojoba, jojobaRegion, japanRegion) -STDDIPINFOEXT(jojobane, jojobaRegion, euroRegion) -STDDIPINFOEXT(redearth, redeartnRegion, euroRedeartn) -STDDIPINFOEXT(warzard, redeartnRegion, japanwarzard) -STDDIPINFOEXT(sfiiihispanic, sfiii, hispanicRegion) -STDDIPINFOEXT(sfiiijapan, sfiii, japanRegion) -STDDIPINFOEXT(sfiiiasia, sfiii, asiaRegion) -STDDIPINFOEXT(sfiiiusa, sfiii, usaRegion) -STDDIPINFOEXT(sfiiieuro, sfiii, euroRegion) - -// ------------------------------------------- -// Street Fighter III: New Generation (970204) -// ------------------------------------------- - -#define SFIII_970204_FLASH \ - { "sfiii-simm1.0", 0x200000, 0xcfc9e45a, BRF_ESS | BRF_PRG }, \ - { "sfiii-simm1.1", 0x200000, 0x57920546, BRF_ESS | BRF_PRG }, \ - { "sfiii-simm1.2", 0x200000, 0x0d8f2680, BRF_ESS | BRF_PRG }, \ - { "sfiii-simm1.3", 0x200000, 0xea4ca054, BRF_ESS | BRF_PRG }, \ - { "sfiii-simm3.0", 0x200000, 0x080b3bd3, BRF_GRA }, \ - { "sfiii-simm3.1", 0x200000, 0x5c356f2f, BRF_GRA }, \ - { "sfiii-simm3.2", 0x200000, 0xf9c97a45, BRF_GRA }, \ - { "sfiii-simm3.3", 0x200000, 0x09de3ead, BRF_GRA }, \ - { "sfiii-simm3.4", 0x200000, 0x7dd7e1f3, BRF_GRA }, \ - { "sfiii-simm3.5", 0x200000, 0x47a03a3a, BRF_GRA }, \ - { "sfiii-simm3.6", 0x200000, 0xe9eb7a26, BRF_GRA }, \ - { "sfiii-simm3.7", 0x200000, 0x7f44395c, BRF_GRA }, \ - { "sfiii-simm4.0", 0x200000, 0x9ac080fc, BRF_GRA }, \ - { "sfiii-simm4.1", 0x200000, 0x6e2c4c94, BRF_GRA }, \ - { "sfiii-simm4.2", 0x200000, 0x8afc22d4, BRF_GRA }, \ - { "sfiii-simm4.3", 0x200000, 0x9f3873b8, BRF_GRA }, \ - { "sfiii-simm4.4", 0x200000, 0x166b3c97, BRF_GRA }, \ - { "sfiii-simm4.5", 0x200000, 0xe5ea2547, BRF_GRA }, \ - { "sfiii-simm4.6", 0x200000, 0xe85b9fdd, BRF_GRA }, \ - { "sfiii-simm4.7", 0x200000, 0x362c01b7, BRF_GRA }, \ - { "sfiii-simm5.0", 0x200000, 0x9bc108b2, BRF_GRA }, \ - { "sfiii-simm5.1", 0x200000, 0xc6f1c066, BRF_GRA }, - -// ----------------------------------------------- -// Street Fighter III: New Generation (Euro 970204) -// ----------------------------------------------- -static struct BurnRomInfo sfiiiRomDesc[] = { - - { "sfiii_euro.29f400.u2", 0x080000, 0x27699ddc, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII_970204_FLASH -#endif -}; - -STD_ROM_PICK(sfiii) -STD_ROM_FN(sfiii) - -// ----------------------------------------------- -// Street Fighter III: New Generation (USA 970204) -// ----------------------------------------------- -static struct BurnRomInfo sfiiiuRomDesc[] = { - - { "sfiii_usa_region_b1.29f400.u2", 0x080000, 0xfb172a8e, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII_970204_FLASH -#endif -}; - -STD_ROM_PICK(sfiiiu) -STD_ROM_FN(sfiiiu) - -// ----------------------------------------------- -// Street Fighter III: New Generation (Asia 970204) -// ----------------------------------------------- -static struct BurnRomInfo sfiiiaRomDesc[] = { - - { "sfiii_asia_region_bd.29f400.u2", 0x080000, 0xcbd28de7, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII_970204_FLASH -#endif -}; - -STD_ROM_PICK(sfiiia) -STD_ROM_FN(sfiiia) - -// ------------------------------------------------- -// Street Fighter III: New Generation (Japan 970204) -// ------------------------------------------------- -static struct BurnRomInfo sfiiijRomDesc[] = { - - { "sfiii_japan.29f400.u2", 0x080000, 0x74205250, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII_970204_FLASH -#endif -}; - -STD_ROM_PICK(sfiiij) -STD_ROM_FN(sfiiij) - -// ---------------------------------------------------- -// Street Fighter III: New Generation (Hispanic 970204) -// ---------------------------------------------------- -static struct BurnRomInfo sfiiihRomDesc[] = { - - { "sfiii_hispanic.29f400.u2", 0x080000, 0xd2b3cd48, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII_970204_FLASH -#endif -}; - -STD_ROM_PICK(sfiiih) -STD_ROM_FN(sfiiih) - -// ------------------------------------------------------------------- -// Street Fighter III: New Generation (Asia 970204, NO CD, bios set 1) -// ------------------------------------------------------------------- -static struct BurnRomInfo sfiiinRomDesc[] = { - - { "sfiii_asia_nocd.29f400.u2", 0x080000, 0xca2b715f, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - SFIII_970204_FLASH -}; - -STD_ROM_PICK(sfiiin) -STD_ROM_FN(sfiiin) - -// ------------------------------------------------------------------- -// Street Fighter III: New Generation (Asia 970204, NO CD, bios set 2) -// ------------------------------------------------------------------- -static struct BurnRomInfo sfiiinaRomDesc[] = { - - { "sfiii_asia_nocd.29f400.u2", 0x080000, 0x73e32463, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - SFIII_970204_FLASH -}; - -STD_ROM_PICK(sfiiina) -STD_ROM_FN(sfiiina) - -// ---------------------------------------------------- -// Street Fighter III 2nd Impact: Giant Attack (970930) -// ---------------------------------------------------- - -#define SFIII2_970930_FLASH \ - { "sfiii2-simm1.0", 0x200000, 0x2d666f0b, BRF_ESS | BRF_PRG }, \ - { "sfiii2-simm1.1", 0x200000, 0x2a3a8ef6, BRF_ESS | BRF_PRG }, \ - { "sfiii2-simm1.2", 0x200000, 0x161d2206, BRF_ESS | BRF_PRG }, \ - { "sfiii2-simm1.3", 0x200000, 0x87ded8a3, BRF_ESS | BRF_PRG }, \ - { "sfiii2-simm2.0", 0x200000, 0x94a4ce0f, BRF_ESS | BRF_PRG }, \ - { "sfiii2-simm2.1", 0x200000, 0x67585033, BRF_ESS | BRF_PRG }, \ - { "sfiii2-simm2.2", 0x200000, 0xfabffcd5, BRF_ESS | BRF_PRG }, \ - { "sfiii2-simm2.3", 0x200000, 0x623c09ca, BRF_ESS | BRF_PRG }, \ - { "sfiii2-simm3.0", 0x200000, 0xdab2d766, BRF_GRA }, \ - { "sfiii2-simm3.1", 0x200000, 0x1f2aa34b, BRF_GRA }, \ - { "sfiii2-simm3.2", 0x200000, 0x6f1a04eb, BRF_GRA }, \ - { "sfiii2-simm3.3", 0x200000, 0xe05ef205, BRF_GRA }, \ - { "sfiii2-simm3.4", 0x200000, 0xaffb074f, BRF_GRA }, \ - { "sfiii2-simm3.5", 0x200000, 0x6962872e, BRF_GRA }, \ - { "sfiii2-simm3.6", 0x200000, 0x6eed87de, BRF_GRA }, \ - { "sfiii2-simm3.7", 0x200000, 0xe18f479e, BRF_GRA }, \ - { "sfiii2-simm4.0", 0x200000, 0x764c2503, BRF_GRA }, \ - { "sfiii2-simm4.1", 0x200000, 0x3e16af6e, BRF_GRA }, \ - { "sfiii2-simm4.2", 0x200000, 0x215705e6, BRF_GRA }, \ - { "sfiii2-simm4.3", 0x200000, 0xe30cbd9c, BRF_GRA }, \ - { "sfiii2-simm4.4", 0x200000, 0x4185ded9, BRF_GRA }, \ - { "sfiii2-simm4.5", 0x200000, 0x4e8db013, BRF_GRA }, \ - { "sfiii2-simm4.6", 0x200000, 0x08df48ce, BRF_GRA }, \ - { "sfiii2-simm4.7", 0x200000, 0xbb8f80a5, BRF_GRA }, \ - { "sfiii2-simm5.0", 0x200000, 0xebdc4787, BRF_GRA }, \ - { "sfiii2-simm5.1", 0x200000, 0x6b7c550e, BRF_GRA }, \ - { "sfiii2-simm5.2", 0x200000, 0x56ff8c50, BRF_GRA }, \ - { "sfiii2-simm5.3", 0x200000, 0x3f2ac3e9, BRF_GRA }, \ - { "sfiii2-simm5.4", 0x200000, 0x48cda50e, BRF_GRA }, \ - { "sfiii2-simm5.5", 0x200000, 0x520c0af6, BRF_GRA }, \ - { "sfiii2-simm5.6", 0x200000, 0x2edc5986, BRF_GRA }, \ - { "sfiii2-simm5.7", 0x200000, 0x93ffa199, BRF_GRA }, - -// -------------------------------------------------------- -// Street Fighter III 2nd Impact: Giant Attack (USA 970930) -// -------------------------------------------------------- -static struct BurnRomInfo sfiii2RomDesc[] = { - - { "sfiii2_usa.29f400.u2", 0x080000, 0x75dd72e0, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII2_970930_FLASH -#endif -}; - -STD_ROM_PICK(sfiii2) -STD_ROM_FN(sfiii2) - -// ---------------------------------------------------------- -// Street Fighter III 2nd Impact: Giant Attack (Japan 970930) -// ---------------------------------------------------------- -static struct BurnRomInfo sfiii2jRomDesc[] = { - - { "sfiii2_japan.29f400.u2", 0x080000, 0xfaea0a3e, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII2_970930_FLASH -#endif -}; - -STD_ROM_PICK(sfiii2j) -STD_ROM_FN(sfiii2j) - -// ---------------------------------------------------------------- -// Street Fighter III 2nd Impact: Giant Attack (Asia 970930, NO CD) -// ---------------------------------------------------------------- -static struct BurnRomInfo sfiii2nRomDesc[] = { - - { "sfiii2_asia_nocd.29f400.u2", 0x080000, 0xfd297c0d, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - SFIII2_970930_FLASH -}; - -STD_ROM_PICK(sfiii2n) -STD_ROM_FN(sfiii2n) - -// ------------------------------------------------------------ -// Street Fighter III 3rd Strike: Fight for the Future (990608) -// ------------------------------------------------------------ - -#define SFIII3_990608_FLASH \ - { "sfiii3-simm1.0", 0x200000, 0x11dfd3cd, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm1.1", 0x200000, 0xc50585e6, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm1.2", 0x200000, 0x8e011d9b, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm1.3", 0x200000, 0xdca8d92f, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm2.0", 0x200000, 0x06eb969e, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm2.1", 0x200000, 0xe7039f82, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm2.2", 0x200000, 0x645c96f7, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm2.3", 0x200000, 0x610efab1, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm3.0", 0x200000, 0x7baa1f79, BRF_GRA }, \ - { "sfiii3-simm3.1", 0x200000, 0x234bf8fe, BRF_GRA }, \ - { "sfiii3-simm3.2", 0x200000, 0xd9ebc308, BRF_GRA }, \ - { "sfiii3-simm3.3", 0x200000, 0x293cba77, BRF_GRA }, \ - { "sfiii3-simm3.4", 0x200000, 0x6055e747, BRF_GRA }, \ - { "sfiii3-simm3.5", 0x200000, 0x499aa6fc, BRF_GRA }, \ - { "sfiii3-simm3.6", 0x200000, 0x6c13879e, BRF_GRA }, \ - { "sfiii3-simm3.7", 0x200000, 0xcf4f8ede, BRF_GRA }, \ - { "sfiii3-simm4.0", 0x200000, 0x091fd5ba, BRF_GRA }, \ - { "sfiii3-simm4.1", 0x200000, 0x0bca8917, BRF_GRA }, \ - { "sfiii3-simm4.2", 0x200000, 0xa0fd578b, BRF_GRA }, \ - { "sfiii3-simm4.3", 0x200000, 0x4bf8c699, BRF_GRA }, \ - { "sfiii3-simm4.4", 0x200000, 0x137b8785, BRF_GRA }, \ - { "sfiii3-simm4.5", 0x200000, 0x4fb70671, BRF_GRA }, \ - { "sfiii3-simm4.6", 0x200000, 0x832374a4, BRF_GRA }, \ - { "sfiii3-simm4.7", 0x200000, 0x1c88576d, BRF_GRA }, \ - { "sfiii3-simm5.0", 0x200000, 0xc67d9190, BRF_GRA }, \ - { "sfiii3-simm5.1", 0x200000, 0x6cb79868, BRF_GRA }, \ - { "sfiii3-simm5.2", 0x200000, 0xdf69930e, BRF_GRA }, \ - { "sfiii3-simm5.3", 0x200000, 0x333754e0, BRF_GRA }, \ - { "sfiii3-simm5.4", 0x200000, 0x78f6d417, BRF_GRA }, \ - { "sfiii3-simm5.5", 0x200000, 0x8ccad9b1, BRF_GRA }, \ - { "sfiii3-simm5.6", 0x200000, 0x85de59e5, BRF_GRA }, \ - { "sfiii3-simm5.7", 0x200000, 0xee7e29b3, BRF_GRA }, \ - { "sfiii3-simm6.0", 0x200000, 0x8da69042, BRF_GRA }, \ - { "sfiii3-simm6.1", 0x200000, 0x1c8c7ac4, BRF_GRA }, \ - { "sfiii3-simm6.2", 0x200000, 0xa671341d, BRF_GRA }, \ - { "sfiii3-simm6.3", 0x200000, 0x1a990249, BRF_GRA }, \ - { "sfiii3-simm6.4", 0x200000, 0x20cb39ac, BRF_GRA }, \ - { "sfiii3-simm6.5", 0x200000, 0x5f844b2f, BRF_GRA }, \ - { "sfiii3-simm6.6", 0x200000, 0x450e8d28, BRF_GRA }, \ - { "sfiii3-simm6.7", 0x200000, 0xcc5f4187, BRF_GRA }, - -// ----------------------------------------------------------------- -// Street Fighter III 3rd Strike: Fight for the Future (Euro 990608) -// ----------------------------------------------------------------- -static struct BurnRomInfo sfiii3RomDesc[] = { - - { "sfiii3_euro.29f400.u2", 0x080000, 0x30bbf293, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII3_990608_FLASH -#endif -}; - -STD_ROM_PICK(sfiii3) -STD_ROM_FN(sfiii3) - -// ---------------------------------------------------------------- -// Street Fighter III 3rd Strike: Fight for the Future (USA 990608) -// ---------------------------------------------------------------- -static struct BurnRomInfo sfiii3uRomDesc[] = { - - { "sfiii3_usa.29f400.u2", 0x080000, 0xecc545c1, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII3_990608_FLASH -#endif -}; - -STD_ROM_PICK(sfiii3u) -STD_ROM_FN(sfiii3u) - -// ------------------------------------------------------------------------- -// Street Fighter III 3rd Strike: Fight for the Future (Japan 990608, NO CD) -// ------------------------------------------------------------------------- -static struct BurnRomInfo sfiii3nRomDesc[] = { - - { "sfiii3_japan_nocd.29f400.u2", 0x080000, 0x1edc6366, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - SFIII3_990608_FLASH -}; - -STD_ROM_PICK(sfiii3n) -STD_ROM_FN(sfiii3n) - -// ------------------------------------------------------------ -// Street Fighter III 3rd Strike: Fight for the Future (990512) -// ------------------------------------------------------------ - -#define SFIII3_990512_FLASH \ - { "sfiii3-simm1.0", 0x200000, 0x66e66235, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm1.1", 0x200000, 0x186e8c5f, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm1.2", 0x200000, 0xbce18cab, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm1.3", 0x200000, 0x129dc2c9, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm2.0", 0x200000, 0x06eb969e, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm2.1", 0x200000, 0xe7039f82, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm2.2", 0x200000, 0x645c96f7, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm2.3", 0x200000, 0x610efab1, BRF_ESS | BRF_PRG }, \ - { "sfiii3-simm3.0", 0x200000, 0x7baa1f79, BRF_GRA }, \ - { "sfiii3-simm3.1", 0x200000, 0x234bf8fe, BRF_GRA }, \ - { "sfiii3-simm3.2", 0x200000, 0xd9ebc308, BRF_GRA }, \ - { "sfiii3-simm3.3", 0x200000, 0x293cba77, BRF_GRA }, \ - { "sfiii3-simm3.4", 0x200000, 0x6055e747, BRF_GRA }, \ - { "sfiii3-simm3.5", 0x200000, 0x499aa6fc, BRF_GRA }, \ - { "sfiii3-simm3.6", 0x200000, 0x6c13879e, BRF_GRA }, \ - { "sfiii3-simm3.7", 0x200000, 0xcf4f8ede, BRF_GRA }, \ - { "sfiii3-simm4.0", 0x200000, 0x091fd5ba, BRF_GRA }, \ - { "sfiii3-simm4.1", 0x200000, 0x0bca8917, BRF_GRA }, \ - { "sfiii3-simm4.2", 0x200000, 0xa0fd578b, BRF_GRA }, \ - { "sfiii3-simm4.3", 0x200000, 0x4bf8c699, BRF_GRA }, \ - { "sfiii3-simm4.4", 0x200000, 0x137b8785, BRF_GRA }, \ - { "sfiii3-simm4.5", 0x200000, 0x4fb70671, BRF_GRA }, \ - { "sfiii3-simm4.6", 0x200000, 0x832374a4, BRF_GRA }, \ - { "sfiii3-simm4.7", 0x200000, 0x1c88576d, BRF_GRA }, \ - { "sfiii3-simm5.0", 0x200000, 0xc67d9190, BRF_GRA }, \ - { "sfiii3-simm5.1", 0x200000, 0x6cb79868, BRF_GRA }, \ - { "sfiii3-simm5.2", 0x200000, 0xdf69930e, BRF_GRA }, \ - { "sfiii3-simm5.3", 0x200000, 0x333754e0, BRF_GRA }, \ - { "sfiii3-simm5.4", 0x200000, 0x78f6d417, BRF_GRA }, \ - { "sfiii3-simm5.5", 0x200000, 0x8ccad9b1, BRF_GRA }, \ - { "sfiii3-simm5.6", 0x200000, 0x85de59e5, BRF_GRA }, \ - { "sfiii3-simm5.7", 0x200000, 0xee7e29b3, BRF_GRA }, \ - { "sfiii3-simm6.0", 0x200000, 0x8da69042, BRF_GRA }, \ - { "sfiii3-simm6.1", 0x200000, 0x1c8c7ac4, BRF_GRA }, \ - { "sfiii3-simm6.2", 0x200000, 0xa671341d, BRF_GRA }, \ - { "sfiii3-simm6.3", 0x200000, 0x1a990249, BRF_GRA }, \ - { "sfiii3-simm6.4", 0x200000, 0x20cb39ac, BRF_GRA }, \ - { "sfiii3-simm6.5", 0x200000, 0x5f844b2f, BRF_GRA }, \ - { "sfiii3-simm6.6", 0x200000, 0x450e8d28, BRF_GRA }, \ - { "sfiii3-simm6.7", 0x200000, 0xcc5f4187, BRF_GRA }, - -// ----------------------------------------------------------------- -// Street Fighter III 3rd Strike: Fight for the Future (Euro 990512) -// ----------------------------------------------------------------- -static struct BurnRomInfo sfiii3r1RomDesc[] = { - - { "sfiii3_euro.29f400.u2", 0x080000, 0x30bbf293, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII3_990512_FLASH -#endif -}; - -STD_ROM_PICK(sfiii3r1) -STD_ROM_FN(sfiii3r1) - -// ---------------------------------------------------------------- -// Street Fighter III 3rd Strike: Fight for the Future (USA 990512) -// ---------------------------------------------------------------- -static struct BurnRomInfo sfiii3ur1RomDesc[] = { - - { "sfiii3_usa.29f400.u2", 0x080000, 0xecc545c1, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - SFIII3_990512_FLASH -#endif -}; - -STD_ROM_PICK(sfiii3ur1) -STD_ROM_FN(sfiii3ur1) - -// ------------------------------------------------------------------------- -// Street Fighter III 3rd Strike: Fight for the Future (Japan 990512, NO CD) -// ------------------------------------------------------------------------- -static struct BurnRomInfo sfiii3nr1RomDesc[] = { - - { "sfiii3_japan_nocd.29f400.u2", 0x080000, 0x1edc6366, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - SFIII3_990512_FLASH -}; - -STD_ROM_PICK(sfiii3nr1) -STD_ROM_FN(sfiii3nr1) - -// ------------------------------------------------- -// JoJo no Kimyou na Bouken / JoJo's Venture (990128) -// ------------------------------------------------- - -#define JOJO_990128_FLASH \ - { "jojo-simm1.0", 0x200000, 0x9516948b, BRF_ESS | BRF_PRG }, \ - { "jojo-simm1.1", 0x200000, 0xa847848d, BRF_ESS | BRF_PRG }, \ - { "jojo-simm1.2", 0x200000, 0x853e8846, BRF_ESS | BRF_PRG }, \ - { "jojo-simm1.3", 0x200000, 0xc04fe00e, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.0", 0x200000, 0xe1a4b3c8, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.1", 0x200000, 0x189cef95, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.2", 0x200000, 0x47db5ec6, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.3", 0x200000, 0xe3d3a155, BRF_ESS | BRF_PRG }, \ - { "jojo-simm3.0", 0x200000, 0xde7fc9c1, BRF_GRA }, \ - { "jojo-simm3.1", 0x200000, 0x43d053d3, BRF_GRA }, \ - { "jojo-simm3.2", 0x200000, 0x2ffd7fa5, BRF_GRA }, \ - { "jojo-simm3.3", 0x200000, 0x4da4985b, BRF_GRA }, \ - { "jojo-simm3.4", 0x200000, 0xfde98d72, BRF_GRA }, \ - { "jojo-simm3.5", 0x200000, 0xedb2a266, BRF_GRA }, \ - { "jojo-simm3.6", 0x200000, 0xbe7cf319, BRF_GRA }, \ - { "jojo-simm3.7", 0x200000, 0x56fe1a9f, BRF_GRA }, \ - { "jojo-simm4.0", 0x200000, 0xc4e7bf68, BRF_GRA }, \ - { "jojo-simm4.1", 0x200000, 0xb62b2719, BRF_GRA }, \ - { "jojo-simm4.2", 0x200000, 0x18d15809, BRF_GRA }, \ - { "jojo-simm4.3", 0x200000, 0x9af0ad79, BRF_GRA }, \ - { "jojo-simm4.4", 0x200000, 0x4124c1f0, BRF_GRA }, \ - { "jojo-simm4.5", 0x200000, 0x5e001fd1, BRF_GRA }, \ - { "jojo-simm4.6", 0x200000, 0x9affa23b, BRF_GRA }, \ - { "jojo-simm4.7", 0x200000, 0x2511572a, BRF_GRA }, \ - { "jojo-simm5.0", 0x200000, 0x797615fc, BRF_GRA }, \ - { "jojo-simm5.1", 0x200000, 0x734fd162, BRF_GRA }, - -// ----------------------------------------------------- -// JoJo no Kimyou na Bouken / JoJo's Venture (USA 990128) -// ----------------------------------------------------- -static struct BurnRomInfo jojoRomDesc[] = { - - { "jojo_usa.29f400.u2", 0x080000, 0x8d40f7be, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - JOJO_990128_FLASH -#endif -}; - -STD_ROM_PICK(jojo) -STD_ROM_FN(jojo) - -// ------------------------------------------------------- -// JoJo no Kimyou na Bouken / JoJo's Venture (Japan 990128) -// ------------------------------------------------------- -static struct BurnRomInfo jojojRomDesc[] = { - - { "jojo_japan.29f400.u2", 0x080000, 0x02778f60, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - JOJO_990128_FLASH -#endif -}; - -STD_ROM_PICK(jojoj) -STD_ROM_FN(jojoj) - -// ------------------------------------------------------------- -// JoJo's Venture / JoJo no Kimyou na Bouken (Asia 990128, NO CD) -// ------------------------------------------------------------- -static struct BurnRomInfo jojonRomDesc[] = { - - { "jojo_asia_nocd.29f400.u2", 0x080000, 0x05b4f953, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - JOJO_990128_FLASH -}; - -STD_ROM_PICK(jojon) -STD_ROM_FN(jojon) - -// ------------------------------------------------- -// JoJo no Kimyou na Bouken / JoJo's Venture (990108) -// ------------------------------------------------- - -#define JOJO_990108_FLASH \ - { "jojo-simm1.0", 0x200000, 0xcfbc38d6, BRF_ESS | BRF_PRG }, \ - { "jojo-simm1.1", 0x200000, 0x42578d94, BRF_ESS | BRF_PRG }, \ - { "jojo-simm1.2", 0x200000, 0x1b40c566, BRF_ESS | BRF_PRG }, \ - { "jojo-simm1.3", 0x200000, 0xbba709b4, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.0", 0x200000, 0x417e5dc1, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.1", 0x200000, 0xd3b3267d, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.2", 0x200000, 0xc66d96b1, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.3", 0x200000, 0xaa34cc85, BRF_ESS | BRF_PRG }, \ - { "jojo-simm3.0", 0x200000, 0xde7fc9c1, BRF_GRA }, \ - { "jojo-simm3.1", 0x200000, 0x43d053d3, BRF_GRA }, \ - { "jojo-simm3.2", 0x200000, 0x2ffd7fa5, BRF_GRA }, \ - { "jojo-simm3.3", 0x200000, 0x4da4985b, BRF_GRA }, \ - { "jojo-simm3.4", 0x200000, 0xfde98d72, BRF_GRA }, \ - { "jojo-simm3.5", 0x200000, 0xedb2a266, BRF_GRA }, \ - { "jojo-simm3.6", 0x200000, 0xbe7cf319, BRF_GRA }, \ - { "jojo-simm3.7", 0x200000, 0x56fe1a9f, BRF_GRA }, \ - { "jojo-simm4.0", 0x200000, 0xc4e7bf68, BRF_GRA }, \ - { "jojo-simm4.1", 0x200000, 0xb62b2719, BRF_GRA }, \ - { "jojo-simm4.2", 0x200000, 0x18d15809, BRF_GRA }, \ - { "jojo-simm4.3", 0x200000, 0x9af0ad79, BRF_GRA }, \ - { "jojo-simm4.4", 0x200000, 0x4124c1f0, BRF_GRA }, \ - { "jojo-simm4.5", 0x200000, 0x5e001fd1, BRF_GRA }, \ - { "jojo-simm4.6", 0x200000, 0x9affa23b, BRF_GRA }, \ - { "jojo-simm4.7", 0x200000, 0x2511572a, BRF_GRA }, \ - { "jojo-simm5.0", 0x200000, 0x797615fc, BRF_GRA }, \ - { "jojo-simm5.1", 0x200000, 0x734fd162, BRF_GRA }, - -// ----------------------------------------------------- -// JoJo no Kimyou na Bouken / JoJo's Venture (USA 990108) -// ----------------------------------------------------- -static struct BurnRomInfo jojor1RomDesc[] = { - - { "jojo_usa.29f400.u2", 0x080000, 0x8d40f7be, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - JOJO_990108_FLASH -#endif -}; - -STD_ROM_PICK(jojor1) -STD_ROM_FN(jojor1) - -// ------------------------------------------------------- -// JoJo no Kimyou na Bouken / JoJo's Venture (Japan 990108) -// ------------------------------------------------------- -static struct BurnRomInfo jojojr1RomDesc[] = { - - { "jojo_japan.29f400.u2", 0x080000, 0x02778f60, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - JOJO_990108_FLASH -#endif -}; - -STD_ROM_PICK(jojojr1) -STD_ROM_FN(jojojr1) - -// ------------------------------------------------------------- -// JoJo's Venture / JoJo no Kimyou na Bouken (Asia 990108, NO CD) -// ------------------------------------------------------------- -static struct BurnRomInfo jojonr1RomDesc[] = { - - { "jojo_asia_nocd.29f400.u2", 0x080000, 0x05b4f953, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - JOJO_990108_FLASH -}; - -STD_ROM_PICK(jojonr1) -STD_ROM_FN(jojonr1) - -// ------------------------------------------------- -// JoJo no Kimyou na Bouken / JoJo's Venture (981202) -// ------------------------------------------------- - -#define JOJO_981202_FLASH \ - { "jojo-simm1.0", 0x200000, 0xe06ba886, BRF_ESS | BRF_PRG }, \ - { "jojo-simm1.1", 0x200000, 0x6dd177c8, BRF_ESS | BRF_PRG }, \ - { "jojo-simm1.2", 0x200000, 0xd35a15e0, BRF_ESS | BRF_PRG }, \ - { "jojo-simm1.3", 0x200000, 0x66d865ac, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.0", 0x200000, 0x417e5dc1, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.1", 0x200000, 0xc891c887, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.2", 0x200000, 0x1e101f30, BRF_ESS | BRF_PRG }, \ - { "jojo-simm2.3", 0x200000, 0x1fd1d3e4, BRF_ESS | BRF_PRG }, \ - { "jojo-simm3.0", 0x200000, 0xde7fc9c1, BRF_GRA }, \ - { "jojo-simm3.1", 0x200000, 0x43d053d3, BRF_GRA }, \ - { "jojo-simm3.2", 0x200000, 0x2ffd7fa5, BRF_GRA }, \ - { "jojo-simm3.3", 0x200000, 0x4da4985b, BRF_GRA }, \ - { "jojo-simm3.4", 0x200000, 0xfde98d72, BRF_GRA }, \ - { "jojo-simm3.5", 0x200000, 0xedb2a266, BRF_GRA }, \ - { "jojo-simm3.6", 0x200000, 0xbe7cf319, BRF_GRA }, \ - { "jojo-simm3.7", 0x200000, 0x56fe1a9f, BRF_GRA }, \ - { "jojo-simm4.0", 0x200000, 0xc4e7bf68, BRF_GRA }, \ - { "jojo-simm4.1", 0x200000, 0xb62b2719, BRF_GRA }, \ - { "jojo-simm4.2", 0x200000, 0x18d15809, BRF_GRA }, \ - { "jojo-simm4.3", 0x200000, 0x9af0ad79, BRF_GRA }, \ - { "jojo-simm4.4", 0x200000, 0x4124c1f0, BRF_GRA }, \ - { "jojo-simm4.5", 0x200000, 0x5e001fd1, BRF_GRA }, \ - { "jojo-simm4.6", 0x200000, 0x9affa23b, BRF_GRA }, \ - { "jojo-simm4.7", 0x200000, 0x2511572a, BRF_GRA }, \ - { "jojo-simm5.0", 0x200000, 0x797615fc, BRF_GRA }, \ - { "jojo-simm5.1", 0x200000, 0x734fd162, BRF_GRA }, - -// ----------------------------------------------------- -// JoJo no Kimyou na Bouken / JoJo's Venture (USA 981202) -// ----------------------------------------------------- -static struct BurnRomInfo jojor2RomDesc[] = { - - { "jojo_usa.29f400.u2", 0x080000, 0x8d40f7be, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - JOJO_981202_FLASH -#endif -}; - -STD_ROM_PICK(jojor2) -STD_ROM_FN(jojor2) - -// ------------------------------------------------------- -// JoJo no Kimyou na Bouken / JoJo's Venture (Japan 981202) -// ------------------------------------------------------- -static struct BurnRomInfo jojojr2RomDesc[] = { - - { "jojo_japan.29f400.u2", 0x080000, 0x02778f60, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - JOJO_981202_FLASH -#endif -}; - -STD_ROM_PICK(jojojr2) -STD_ROM_FN(jojojr2) - -// ------------------------------------------------------------- -// JoJo's Venture / JoJo no Kimyou na Bouken (Asia 981202, NO CD) -// ------------------------------------------------------------- -static struct BurnRomInfo jojonr2RomDesc[] = { - - { "jojo_asia_nocd.29f400.u2", 0x080000, 0x05b4f953, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - JOJO_981202_FLASH -}; - -STD_ROM_PICK(jojonr2) -STD_ROM_FN(jojonr2) - -// --------------------------------------------------------------------------- -// JoJo no Kimyou na Bouken: Mirai e no Isan / JoJo's Bizarre Adventure (990927) -// --------------------------------------------------------------------------- - -#define JOJOBA_990927_FLASH \ - { "jojoba-simm1.0", 0x200000, 0xadcd8377, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm1.1", 0x200000, 0xd7590b59, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm1.2", 0x200000, 0xe62e240b, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm1.3", 0x200000, 0xc95450c3, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm2.0", 0x200000, 0x535f2eba, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm2.1", 0x200000, 0x01dd3a01, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm2.2", 0x200000, 0x61432672, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm2.3", 0x200000, 0xacdc9aca, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm3.0", 0x200000, 0x4d16e111, BRF_GRA }, \ - { "jojoba-simm3.1", 0x200000, 0x9b3406d3, BRF_GRA }, \ - { "jojoba-simm3.2", 0x200000, 0xf2414997, BRF_GRA }, \ - { "jojoba-simm3.3", 0x200000, 0x954b9c7d, BRF_GRA }, \ - { "jojoba-simm3.4", 0x200000, 0x625adc1d, BRF_GRA }, \ - { "jojoba-simm3.5", 0x200000, 0x20a70bb4, BRF_GRA }, \ - { "jojoba-simm3.6", 0x200000, 0xa10ec5af, BRF_GRA }, \ - { "jojoba-simm3.7", 0x200000, 0x0bd0de7a, BRF_GRA }, \ - { "jojoba-simm4.0", 0x200000, 0x6ea14adc, BRF_GRA }, \ - { "jojoba-simm4.1", 0x200000, 0x8f4c42fb, BRF_GRA }, \ - { "jojoba-simm4.2", 0x200000, 0xef0586d1, BRF_GRA }, \ - { "jojoba-simm4.3", 0x200000, 0x93ccc470, BRF_GRA }, \ - { "jojoba-simm4.4", 0x200000, 0x3d9ec7d2, BRF_GRA }, \ - { "jojoba-simm4.5", 0x200000, 0x03e66850, BRF_GRA }, \ - { "jojoba-simm4.6", 0x200000, 0x01606ac3, BRF_GRA }, \ - { "jojoba-simm4.7", 0x200000, 0x36392b87, BRF_GRA }, \ - { "jojoba-simm5.0", 0x200000, 0x2ef8c60c, BRF_GRA }, \ - { "jojoba-simm5.1", 0x200000, 0xcf7d7ca6, BRF_GRA }, \ - { "jojoba-simm5.2", 0x200000, 0xb7815bfa, BRF_GRA }, \ - { "jojoba-simm5.3", 0x200000, 0x9bfec049, BRF_GRA }, \ - { "jojoba-simm5.4", 0x200000, 0xd167536b, BRF_GRA }, \ - { "jojoba-simm5.5", 0x200000, 0x55e7a042, BRF_GRA }, \ - { "jojoba-simm5.6", 0x200000, 0x4fb32906, BRF_GRA }, \ - { "jojoba-simm5.7", 0x200000, 0x8c8be520, BRF_GRA }, - -// --------------------------------------------------------------------------------- -// JoJo no Kimyou na Bouken: Mirai e no Isan / JoJo's Bizarre Adventure (Japan 990927) -// --------------------------------------------------------------------------------- -static struct BurnRomInfo jojobaRomDesc[] = { - - { "jojoba_japan.29f400.u2", 0x080000, 0x3085478c, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - JOJOBA_990927_FLASH -#endif -}; - -STD_ROM_PICK(jojoba) -STD_ROM_FN(jojoba) - -// ---------------------------------------------------------------------------------------- -// JoJo no Kimyou na Bouken: Mirai e no Isan / JoJo's Bizarre Adventure (Japan 990927, NO CD) -// ---------------------------------------------------------------------------------------- -static struct BurnRomInfo jojobanRomDesc[] = { - - { "jojoba_japan_nocd.29f400.u2", 0x080000, 0x4dab19f5, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - JOJOBA_990927_FLASH -}; - -STD_ROM_PICK(jojoban) -STD_ROM_FN(jojoban) - -// --------------------------------------------------------------------------------------- -// JoJo's Bizarre Adventure / JoJo no Kimyou na Bouken: Mirai e no Isan (Euro 990927, NO CD) -// --------------------------------------------------------------------------------------- -static struct BurnRomInfo jojobaneRomDesc[] = { - - { "jojoba_euro_nocd.29f400.u2", 0x080000, 0x1ee2d679, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - JOJOBA_990927_FLASH -}; - -STD_ROM_PICK(jojobane) -STD_ROM_FN(jojobane) - -// --------------------------------------------------------------------------- -// JoJo no Kimyou na Bouken: Mirai e no Isan / JoJo's Bizarre Adventure (990913) -// --------------------------------------------------------------------------- - -#define JOJOBA_990913_FLASH \ - { "jojoba-simm1.0", 0x200000, 0x76976231, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm1.1", 0x200000, 0xcedd78e7, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm1.2", 0x200000, 0x2955b77f, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm1.3", 0x200000, 0x280139d7, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm2.0", 0x200000, 0x305c4914, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm2.1", 0x200000, 0x18af4f3b, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm2.2", 0x200000, 0x397e5c9e, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm2.3", 0x200000, 0xa9d0a7d7, BRF_ESS | BRF_PRG }, \ - { "jojoba-simm3.0", 0x200000, 0x4d16e111, BRF_GRA }, \ - { "jojoba-simm3.1", 0x200000, 0x9b3406d3, BRF_GRA }, \ - { "jojoba-simm3.2", 0x200000, 0xf2414997, BRF_GRA }, \ - { "jojoba-simm3.3", 0x200000, 0x954b9c7d, BRF_GRA }, \ - { "jojoba-simm3.4", 0x200000, 0x625adc1d, BRF_GRA }, \ - { "jojoba-simm3.5", 0x200000, 0x20a70bb4, BRF_GRA }, \ - { "jojoba-simm3.6", 0x200000, 0xa10ec5af, BRF_GRA }, \ - { "jojoba-simm3.7", 0x200000, 0x0bd0de7a, BRF_GRA }, \ - { "jojoba-simm4.0", 0x200000, 0x6ea14adc, BRF_GRA }, \ - { "jojoba-simm4.1", 0x200000, 0x8f4c42fb, BRF_GRA }, \ - { "jojoba-simm4.2", 0x200000, 0xef0586d1, BRF_GRA }, \ - { "jojoba-simm4.3", 0x200000, 0x93ccc470, BRF_GRA }, \ - { "jojoba-simm4.4", 0x200000, 0x3d9ec7d2, BRF_GRA }, \ - { "jojoba-simm4.5", 0x200000, 0x03e66850, BRF_GRA }, \ - { "jojoba-simm4.6", 0x200000, 0x01606ac3, BRF_GRA }, \ - { "jojoba-simm4.7", 0x200000, 0x36392b87, BRF_GRA }, \ - { "jojoba-simm5.0", 0x200000, 0x2ef8c60c, BRF_GRA }, \ - { "jojoba-simm5.1", 0x200000, 0xcf7d7ca6, BRF_GRA }, \ - { "jojoba-simm5.2", 0x200000, 0xb7815bfa, BRF_GRA }, \ - { "jojoba-simm5.3", 0x200000, 0x9bfec049, BRF_GRA }, \ - { "jojoba-simm5.4", 0x200000, 0xd167536b, BRF_GRA }, \ - { "jojoba-simm5.5", 0x200000, 0x55e7a042, BRF_GRA }, \ - { "jojoba-simm5.6", 0x200000, 0x4fb32906, BRF_GRA }, \ - { "jojoba-simm5.7", 0x200000, 0x8c8be520, BRF_GRA }, - -// --------------------------------------------------------------------------------- -// JoJo no Kimyou na Bouken: Mirai e no Isan / JoJo's Bizarre Adventure (Japan 990913) -// --------------------------------------------------------------------------------- -static struct BurnRomInfo jojobar1RomDesc[] = { - - { "jojoba_japan.29f400.u2", 0x080000, 0x3085478c, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - JOJOBA_990913_FLASH -#endif -}; - -STD_ROM_PICK(jojobar1) -STD_ROM_FN(jojobar1) - -// ---------------------------------------------------------------------------------------- -// JoJo no Kimyou na Bouken: Mirai e no Isan / JoJo's Bizarre Adventure (Japan 990913, NO CD) -// ---------------------------------------------------------------------------------------- -static struct BurnRomInfo jojobanr1RomDesc[] = { - - { "jojoba_japan_nocd.29f400.u2", 0x080000, 0x4dab19f5, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - JOJOBA_990913_FLASH -}; - -STD_ROM_PICK(jojobanr1) -STD_ROM_FN(jojobanr1) - -// --------------------------------------------------------------------------------------- -// JoJo's Bizarre Adventure / JoJo no Kimyou na Bouken: Mirai e no Isan (Euro 990913, NO CD) -// --------------------------------------------------------------------------------------- -static struct BurnRomInfo jojobaner1RomDesc[] = { - - { "jojoba_euro_nocd.29f400.u2", 0x080000, 0x1ee2d679, BRF_ESS | BRF_BIOS }, // SH-2 Bios - - JOJOBA_990913_FLASH -}; - -STD_ROM_PICK(jojobaner1) -STD_ROM_FN(jojobaner1) - -// ----------------------------- -// Red Earth / War-Zard (961121) -// ----------------------------- - -#define REDEARTH_961121_FLASH \ - { "redearth-simm1.0", 0x200000, 0xcad468f8, BRF_ESS | BRF_PRG }, \ - { "redearth-simm1.1", 0x200000, 0xe9721d89, BRF_ESS | BRF_PRG }, \ - { "redearth-simm1.2", 0x200000, 0x2889ec98, BRF_ESS | BRF_PRG }, \ - { "redearth-simm1.3", 0x200000, 0x5a6cd148, BRF_ESS | BRF_PRG }, \ - { "redearth-simm3.0", 0x200000, 0x83350cc5, BRF_GRA }, \ - { "redearth-simm3.1", 0x200000, 0x56734de6, BRF_GRA }, \ - { "redearth-simm3.2", 0x200000, 0x800ea0f1, BRF_GRA }, \ - { "redearth-simm3.3", 0x200000, 0x97e9146c, BRF_GRA }, \ - { "redearth-simm3.4", 0x200000, 0x0cb1d648, BRF_GRA }, \ - { "redearth-simm3.5", 0x200000, 0x7a1099f0, BRF_GRA }, \ - { "redearth-simm3.6", 0x200000, 0xaeff8f54, BRF_GRA }, \ - { "redearth-simm3.7", 0x200000, 0xf770acd0, BRF_GRA }, \ - { "redearth-simm4.0", 0x200000, 0x301e56f2, BRF_GRA }, \ - { "redearth-simm4.1", 0x200000, 0x2048e103, BRF_GRA }, \ - { "redearth-simm4.2", 0x200000, 0xc9433455, BRF_GRA }, \ - { "redearth-simm4.3", 0x200000, 0xc02171a8, BRF_GRA }, \ - { "redearth-simm4.4", 0x200000, 0x2ddbf276, BRF_GRA }, \ - { "redearth-simm4.5", 0x200000, 0xfea820a6, BRF_GRA }, \ - { "redearth-simm4.6", 0x200000, 0xc7528df1, BRF_GRA }, \ - { "redearth-simm4.7", 0x200000, 0x2449cf3b, BRF_GRA }, \ - { "redearth-simm5.0", 0x200000, 0x424451b9, BRF_GRA }, \ - { "redearth-simm5.1", 0x200000, 0x9b8cb56b, BRF_GRA }, - -// ---------------------------------- -// Red Earth / War-Zard (Euro 961121) -// ---------------------------------- -static struct BurnRomInfo redearthRomDesc[] = { - - { "redearth_euro.29f400.u2", 0x080000, 0x02e0f336, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - REDEARTH_961121_FLASH -#endif -}; - -STD_ROM_PICK(redearth) -STD_ROM_FN(redearth) - -// ----------------------------------- -// War-Zard / Red Earth (Japan 961121) -// ----------------------------------- -static struct BurnRomInfo warzardRomDesc[] = { - - { "warzard_japan.29f400.u2", 0x080000, 0xf8e2f0c6, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - REDEARTH_961121_FLASH -#endif -}; - -STD_ROM_PICK(warzard) -STD_ROM_FN(warzard) - -// ----------------------------- -// Red Earth / War-Zard (961023) -// ----------------------------- - -#define REDEARTH_961023_FLASH \ - { "redearth-simm1.0", 0x200000, 0x65bac346, BRF_ESS | BRF_PRG }, \ - { "redearth-simm1.1", 0x200000, 0xa8ec4aae, BRF_ESS | BRF_PRG }, \ - { "redearth-simm1.2", 0x200000, 0x2caf8995, BRF_ESS | BRF_PRG }, \ - { "redearth-simm1.3", 0x200000, 0x13ebc21d, BRF_ESS | BRF_PRG }, \ - { "redearth-simm3.0", 0x200000, 0x83350cc5, BRF_GRA }, \ - { "redearth-simm3.1", 0x200000, 0x56734de6, BRF_GRA }, \ - { "redearth-simm3.2", 0x200000, 0x800ea0f1, BRF_GRA }, \ - { "redearth-simm3.3", 0x200000, 0x97e9146c, BRF_GRA }, \ - { "redearth-simm3.4", 0x200000, 0x0cb1d648, BRF_GRA }, \ - { "redearth-simm3.5", 0x200000, 0x7a1099f0, BRF_GRA }, \ - { "redearth-simm3.6", 0x200000, 0xaeff8f54, BRF_GRA }, \ - { "redearth-simm3.7", 0x200000, 0xf770acd0, BRF_GRA }, \ - { "redearth-simm4.0", 0x200000, 0x301e56f2, BRF_GRA }, \ - { "redearth-simm4.1", 0x200000, 0x2048e103, BRF_GRA }, \ - { "redearth-simm4.2", 0x200000, 0xc9433455, BRF_GRA }, \ - { "redearth-simm4.3", 0x200000, 0xc02171a8, BRF_GRA }, \ - { "redearth-simm4.4", 0x200000, 0x2ddbf276, BRF_GRA }, \ - { "redearth-simm4.5", 0x200000, 0xfea820a6, BRF_GRA }, \ - { "redearth-simm4.6", 0x200000, 0xc7528df1, BRF_GRA }, \ - { "redearth-simm4.7", 0x200000, 0x2449cf3b, BRF_GRA }, \ - { "redearth-simm5.0", 0x200000, 0x424451b9, BRF_GRA }, \ - { "redearth-simm5.1", 0x200000, 0x9b8cb56b, BRF_GRA }, - -// ---------------------------------- -// Red Earth / War-Zard (Euro 961023) -// ---------------------------------- -static struct BurnRomInfo redearthr1RomDesc[] = { - - { "redearth_euro.29f400.u2", 0x080000, 0x02e0f336, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - REDEARTH_961023_FLASH -#endif -}; - -STD_ROM_PICK(redearthr1) -STD_ROM_FN(redearthr1) - -// ----------------------------------- -// War-Zard / Red Earth (Japan 961023) -// ----------------------------------- -static struct BurnRomInfo warzardr1RomDesc[] = { - - { "warzard_japan.29f400.u2", 0x080000, 0xf8e2f0c6, BRF_ESS | BRF_BIOS }, // SH-2 Bios - -#if !defined ROM_VERIFY - REDEARTH_961023_FLASH -#endif -}; - -STD_ROM_PICK(warzardr1) -STD_ROM_FN(warzardr1) - -// ------------------------------------------------------------------------------------ - -static INT32 sfiiiInit() -{ - cps3_key1 = 0xb5fe053e; - cps3_key2 = 0xfc03925a; - cps3_isSpecial = 0; - - cps3_bios_test_hack = 0x000166b4; - cps3_game_test_hack = 0x063cdff4; - - cps3_speedup_ram_address = 0x0200cc6c; - cps3_speedup_code_address = 0x06000884; - - cps3_region_address = 0x0001fec8; - cps3_ncd_address = 0x0001fecf; - - return cps3Init(); -} - -static INT32 sfiii2Init() -{ - cps3_key1 = 0x00000000; - cps3_key2 = 0x00000000; - cps3_isSpecial = 1; - - cps3_bios_test_hack = 0x00000000; - cps3_game_test_hack = 0x00000000; - - cps3_speedup_ram_address = 0x0200dfe4; - cps3_speedup_code_address = 0x06000884; - - cps3_region_address = 0x0001fec8; - cps3_ncd_address = 0x0001fecf; - - return cps3Init(); -} - -static INT32 sfiii3Init() -{ - cps3_key1 = 0xa55432b4; - cps3_key2 = 0x0c129981; - cps3_isSpecial = 0; - - cps3_bios_test_hack = 0x00011c44; - cps3_game_test_hack = 0x0613ab48; - - cps3_speedup_ram_address = 0x0200d794; - cps3_speedup_code_address = 0x06000884; - - cps3_region_address = 0x0001fec8; - cps3_ncd_address = 0x0001fecf; - - return cps3Init(); -} - -static INT32 jojor1Init() -{ - cps3_key1 = 0x02203ee3; - cps3_key2 = 0x01301972; - cps3_isSpecial = 0; - - cps3_bios_test_hack = 0x00011c2c; - cps3_game_test_hack = 0x06172568; - - cps3_speedup_ram_address = 0x020223d8; - cps3_speedup_code_address = 0x0600065c; - - cps3_region_address = 0x0001fec8; - cps3_ncd_address = 0x0001fecf; - - return cps3Init(); -} - -static INT32 jojor2Init() -{ - cps3_key1 = 0x02203ee3; - cps3_key2 = 0x01301972; - cps3_isSpecial = 0; - - cps3_bios_test_hack = 0x00011c2c; - cps3_game_test_hack = 0x06172568; - - cps3_speedup_ram_address = 0x020223c0; - cps3_speedup_code_address = 0x0600065c; - - cps3_region_address = 0x0001fec8; - cps3_ncd_address = 0x0001fecf; - - return cps3Init(); -} - -static INT32 jojobaInit() -{ - cps3_key1 = 0x23323ee3; - cps3_key2 = 0x03021972; - cps3_isSpecial = 0; - - cps3_bios_test_hack = 0x00011c90; - cps3_game_test_hack = 0x061c45bc; - - cps3_speedup_ram_address = 0x020267dc; - cps3_speedup_code_address = 0x0600065c; - - cps3_region_address = 0x0001fec8; - cps3_ncd_address = 0x0001fecf; - - return cps3Init(); -} - -static INT32 redearthInit() -{ - cps3_key1 = 0x9e300ab1; - cps3_key2 = 0xa175b82c; - cps3_isSpecial = 0; - - cps3_bios_test_hack = 0x00016530; - cps3_game_test_hack = 0x060105f0; - - cps3_speedup_ram_address = 0x0202136c; - cps3_speedup_code_address = 0x0600194e; - - cps3_region_address = 0x0001fed8; - cps3_ncd_address = 0x00000000; - - return cps3Init(); -} - - -struct BurnDriver BurnDrvSfiii = { - "sfiii", NULL, NULL, NULL, "1997", - "Street Fighter III: New Generation (Euro 970204)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiiiRomInfo, sfiiiRomName, NULL, NULL, cps3InputInfo, sfiiieuroDIPInfo, - sfiiiInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiiiu = { - "sfiiiu", "sfiii", NULL, NULL, "1997", - "Street Fighter III: New Generation (USA 970204)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiiiuRomInfo, sfiiiuRomName, NULL, NULL, cps3InputInfo, sfiiiusaDIPInfo, - sfiiiInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiiia = { - "sfiiia", "sfiii", NULL, NULL, "1997", - "Street Fighter III: New Generation (Asia 970204)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiiiaRomInfo, sfiiiaRomName, NULL, NULL, cps3InputInfo, sfiiiasiaDIPInfo, - sfiiiInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiiij = { - "sfiiij", "sfiii", NULL, NULL, "1997", - "Street Fighter III: New Generation (Japan 970204)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiiijRomInfo, sfiiijRomName, NULL, NULL, cps3InputInfo, sfiiijapanDIPInfo, - sfiiiInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiiih = { - "sfiiih", "sfiii", NULL, NULL, "1997", - "Street Fighter III: New Generation (Hispanic 970204)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiiihRomInfo, sfiiihRomName, NULL, NULL, cps3InputInfo, sfiiihispanicDIPInfo, - sfiiiInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiiin = { - "sfiiin", "sfiii", NULL, NULL, "1997", - "Street Fighter III: New Generation (Asia 970204, NO CD, bios set 1)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, FBF_SF, - NULL, sfiiinRomInfo, sfiiinRomName, NULL, NULL, cps3InputInfo, sfiiiasiaDIPInfo, - sfiiiInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiiina = { - "sfiiina", "sfiii", NULL, NULL, "1997", - "Street Fighter III: New Generation (Asia 970204, NO CD, bios set 2)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, FBF_SF, - NULL, sfiiinaRomInfo, sfiiinaRomName, NULL, NULL, cps3InputInfo, sfiiiasiaDIPInfo, - sfiiiInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiii2 = { - "sfiii2", NULL, NULL, NULL, "1997", - "Street Fighter III 2nd Impact: Giant Attack (USA 970930)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiii2RomInfo, sfiii2RomName, NULL, NULL, cps3InputInfo, usaDIPInfo, - sfiii2Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiii2j = { - "sfiii2j", "sfiii2", NULL, NULL, "1997", - "Street Fighter III 2nd Impact: Giant Attack (Japan 970930)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiii2jRomInfo, sfiii2jRomName, NULL, NULL, cps3InputInfo, japanDIPInfo, - sfiii2Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiii2n = { - "sfiii2n", "sfiii2", NULL, NULL, "1997", - "Street Fighter III 2nd Impact: Giant Attack (Asia 970930, NO CD)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, FBF_SF, - NULL, sfiii2nRomInfo, sfiii2nRomName, NULL, NULL, cps3InputInfo, asiaDIPInfo, - sfiii2Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiii3 = { - "sfiii3", NULL, NULL, NULL, "1999", - "Street Fighter III 3rd Strike: Fight for the Future (Euro 990608)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiii3RomInfo, sfiii3RomName, NULL, NULL, cps3InputInfo, euroDIPInfo, - sfiii3Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiii3u = { - "sfiii3u", "sfiii3", NULL, NULL, "1999", - "Street Fighter III 3rd Strike: Fight for the Future (USA 990608)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiii3uRomInfo, sfiii3uRomName, NULL, NULL, cps3InputInfo, usaDIPInfo, - sfiii3Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiii3n = { - "sfiii3n", "sfiii3", NULL, NULL, "1999", - "Street Fighter III 3rd Strike: Fight for the Future (Japan 990608, NO CD)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, FBF_SF, - NULL, sfiii3nRomInfo, sfiii3nRomName, NULL, NULL, cps3InputInfo, japanDIPInfo, - sfiii3Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiii3r1 = { - "sfiii3r1", "sfiii3", NULL, NULL, "1999", - "Street Fighter III 3rd Strike: Fight for the Future (Euro 990512)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiii3r1RomInfo, sfiii3r1RomName, NULL, NULL, cps3InputInfo, euroDIPInfo, - sfiii3Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiii3ur1 = { - "sfiii3ur1", "sfiii3", NULL, NULL, "1999", - "Street Fighter III 3rd Strike: Fight for the Future (USA 990512)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, FBF_SF, - NULL, sfiii3ur1RomInfo, sfiii3ur1RomName, NULL, NULL, cps3InputInfo, usaDIPInfo, - sfiii3Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSfiii3nr1 = { - "sfiii3nr1", "sfiii3", NULL, NULL, "1999", - "Street Fighter III 3rd Strike: Fight for the Future (Japan 990512, NO CD)\0", NULL, "Capcom", "CPS-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, FBF_SF, - NULL, sfiii3nr1RomInfo, sfiii3nr1RomName, NULL, NULL, cps3InputInfo, japanDIPInfo, - sfiii3Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojo = { - "jojo", NULL, NULL, NULL, "1998", - "JoJo's Venture / JoJo no Kimyou na Bouken (USA 990128)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A\0JoJo's Venture (USA 990128)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, jojoRomInfo, jojoRomName, NULL, NULL, cps3InputInfo, usaDIPInfo, - jojor1Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojoj = { - "jojoj", "jojo", NULL, NULL, "1998", - "JoJo's Venture / JoJo no Kimyou na Bouken (Japan 990128)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A\0JoJo's Venture (Japan 990128)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, jojojRomInfo, jojojRomName, NULL, NULL, cps3InputInfo, japanDIPInfo, - jojor1Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojon = { - "jojon", "jojo", NULL, NULL, "1998", - "JoJo's Venture / JoJo no Kimyou na Bouken (Asia 990128, NO CD)\0", NULL, "Capcom", "CPS-3", - L"JoJo's Venture\0\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A (Asia 990128, NO CD)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, 0, - NULL, jojonRomInfo, jojonRomName, NULL, NULL, cps3InputInfo, asiaDIPInfo, - jojor1Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojor1 = { - "jojor1", "jojo", NULL, NULL, "1998", - "JoJo's Venture / JoJo no Kimyou na Bouken (USA 990108)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A\0JoJo's Venture (USA 990108)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, jojor1RomInfo, jojor1RomName, NULL, NULL, cps3InputInfo, usaDIPInfo, - jojor1Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojojr1 = { - "jojojr1", "jojo", NULL, NULL, "1998", - "JoJo's Venture / JoJo no Kimyou na Bouken (Japan 990108)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A\0JoJo's Venture (Japan 990108)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, jojojr1RomInfo, jojojr1RomName, NULL, NULL, cps3InputInfo, japanDIPInfo, - jojor1Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojonr1 = { - "jojonr1", "jojo", NULL, NULL, "1998", - "JoJo's Venture / JoJo no Kimyou na Bouken (Asia 990108, NO CD)\0", NULL, "Capcom", "CPS-3", - L"JoJo's Venture\0\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A (Asia 990108, NO CD)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, 0, - NULL, jojonr1RomInfo, jojonr1RomName, NULL, NULL, cps3InputInfo, asiaDIPInfo, - jojor1Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojor2 = { - "jojor2", "jojo", NULL, NULL, "1998", - "JoJo's Venture / JoJo no Kimyou na Bouken (USA 981202)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A\0JoJo's Venture (USA 981202)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, jojor2RomInfo, jojor2RomName, NULL, NULL, cps3InputInfo, usaDIPInfo, - jojor2Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojojr2 = { - "jojojr2", "jojo", NULL, NULL, "1998", - "JoJo's Venture / JoJo no Kimyou na Bouken (Japan 981202)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A\0JoJo's Venture (Japan 981202)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, jojojr2RomInfo, jojojr2RomName, NULL, NULL, cps3InputInfo, japanDIPInfo, - jojor2Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojonr2 = { - "jojonr2", "jojo", NULL, NULL, "1998", - "JoJo's Venture / JoJo no Kimyou na Bouken (Asia 981202, NO CD)\0", NULL, "Capcom", "CPS-3", - L"JoJo's Venture\0\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A (Asia 981202, NO CD)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, 0, - NULL, jojonr2RomInfo, jojonr2RomName, NULL, NULL, cps3InputInfo, asiaDIPInfo, - jojor2Init, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojoba = { - "jojoba", NULL, NULL, NULL, "1999", - "JoJo's Bizarre Adventure: Heritage for the Future / JoJo no Kimyou na Bouken: Mirai e no Isan (Japan 990927)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A: \u672A\u6765\u3078\u306E\u907A\u7523\0JoJo's Bizarre Adventure (Japan 990927)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, jojobaRomInfo, jojobaRomName, NULL, NULL, cps3InputInfo, jojobaDIPInfo, - jojobaInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojoban = { - "jojoban", "jojoba", NULL, NULL, "1999", - "JoJo's Bizarre Adventure: Heritage for the Future / JoJo no Kimyou na Bouken: Mirai e no Isan (Japan 990927, NO CD)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A: \u672A\u6765\u3078\u306E\u907A\u7523\0JoJo's Bizarre Adventure (Japan 990927, NO CD)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, 0, - NULL, jojobanRomInfo, jojobanRomName, NULL, NULL, cps3InputInfo, jojobaDIPInfo, - jojobaInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojobane = { - "jojobane", "jojoba", NULL, NULL, "1999", - "JoJo's Bizarre Adventure: Heritage for the Future / JoJo no Kimyou na Bouken: Mirai e no Isan (Euro 990927, NO CD)\0", NULL, "Capcom", "CPS-3", - L"JoJo's Bizarre Adventure\0\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A: \u672A\u6765\u3078\u306E\u907A\u7523 (Euro 990927, NO CD)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, 0, - NULL, jojobaneRomInfo, jojobaneRomName, NULL, NULL, cps3InputInfo, jojobaneDIPInfo, - jojobaInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojobar1 = { - "jojobar1", "jojoba", NULL, NULL, "1999", - "JoJo's Bizarre Adventure: Heritage for the Future / JoJo no Kimyou na Bouken: Mirai e no Isan (Japan 990913)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A: \u672A\u6765\u3078\u306E\u907A\u7523\0JoJo's Bizarre Adventure (Japan 990913)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, jojobar1RomInfo, jojobar1RomName, NULL, NULL, cps3InputInfo, jojobaDIPInfo, - jojobaInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojobanr1 = { - "jojobanr1", "jojoba", NULL, NULL, "1999", - "JoJo's Bizarre Adventure: Heritage for the Future / JoJo no Kimyou na Bouken: Mirai e no Isan (Japan 990913, NO CD)\0", NULL, "Capcom", "CPS-3", - L"\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A: \u672A\u6765\u3078\u306E\u907A\u7523\0JoJo's Bizarre Adventure (Japan 990913, NO CD)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, 0, - NULL, jojobanr1RomInfo, jojobanr1RomName, NULL, NULL, cps3InputInfo, jojobaDIPInfo, - jojobaInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJojobaner1 = { - "jojobaner1", "jojoba", NULL, NULL, "1999", - "JoJo's Bizarre Adventure: Heritage for the Future / JoJo no Kimyou na Bouken: Mirai e no Isan (Euro 990913, NO CD)\0", NULL, "Capcom", "CPS-3", - L"JoJo's Bizarre Adventure\0\u30B8\u30E7\u30B8\u30E7\u306E \u5947\u5999\u306A\u5192\u967A: \u672A\u6765\u3078\u306E\u907A\u7523 (Euro 990913, NO CD)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3 | HARDWARE_CAPCOM_CPS3_NO_CD, GBF_VSFIGHT, 0, - NULL, jojobaner1RomInfo, jojobaner1RomName, NULL, NULL, cps3InputInfo, jojobaneDIPInfo, - jojobaInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRedearth = { - "redearth", NULL, NULL, NULL, "1996", - "Red Earth / War-Zard (Euro 961121)\0", NULL, "Capcom", "CPS-3", - L"Red Earth\0War-Zard (Euro 961121)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, redearthRomInfo, redearthRomName, NULL, NULL, cps3InputInfo, redearthDIPInfo, - redearthInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWarzard = { - "warzard", "redearth", NULL, NULL, "1996", - "War-Zard / Red Earth (Japan 961121)\0", NULL, "Capcom", "CPS-3", - L"War-Zard\0Red Earth (Japan 961121)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, warzardRomInfo, warzardRomName, NULL, NULL, cps3InputInfo, warzardDIPInfo, - redearthInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRedearthr1 = { - "redearthr1", "redearth", NULL, NULL, "1996", - "Red Earth / War-Zard (Euro 961023)\0", NULL, "Capcom", "CPS-3", - L"Red Earth\0War-Zard (Euro 961023)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, redearthr1RomInfo, redearthr1RomName, NULL, NULL, cps3InputInfo, redearthDIPInfo, - redearthInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWarzardr1 = { - "warzardr1", "redearth", NULL, NULL, "1996", - "War-Zard / Red Earth (Japan 961023)\0", NULL, "Capcom", "CPS-3", - L"War-Zard\0Red Earth (Japan 961023)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS3, GBF_VSFIGHT, 0, - NULL, warzardr1RomInfo, warzardr1RomName, NULL, NULL, cps3InputInfo, warzardDIPInfo, - redearthInit, cps3Exit, cps3Frame, NULL, cps3Scan, &cps3_palette_change, 0x40000, - 384, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/d_parent.cpp b/jan/src/burn/drv/d_parent.cpp deleted file mode 100644 index 2d4f20b6d..000000000 --- a/jan/src/burn/drv/d_parent.cpp +++ /dev/null @@ -1,253 +0,0 @@ -// A module for keeping parents who have no driver in FBA - -#include "burnint.h" - -static UINT8 ParentReset = 0; - -static struct BurnInputInfo ParentInputList[] = { - {"Reset" , BIT_DIGITAL , &ParentReset , "reset" }, -}; - -STDINPUTINFO(Parent) - -static INT32 ParentInit() -{ - return 1; -} - -static INT32 ParentExit() -{ - return 0; -} - -static struct BurnRomInfo BagmanRomDesc[] = { - { "e9_b05.bin", 0x01000, 0xe0156191, BRF_ESS | BRF_PRG }, - { "f9_b06.bin", 0x01000, 0x7b758982, BRF_ESS | BRF_PRG }, - { "f9_b07.bin", 0x01000, 0x302a077b, BRF_ESS | BRF_PRG }, - { "k9_b08.bin", 0x01000, 0xf04293cb, BRF_ESS | BRF_PRG }, - { "m9_b09s.bin", 0x01000, 0x68e83e4f, BRF_ESS | BRF_PRG }, - { "n9_b10.bin", 0x01000, 0x1d6579f7, BRF_ESS | BRF_PRG }, - - { "e1_b02.bin", 0x01000, 0x4a0a6b55, BRF_ESS | BRF_PRG }, - { "j1_b04.bin", 0x01000, 0xc680ef04, BRF_ESS | BRF_PRG }, - - { "c1_b01.bin", 0x01000, 0x705193b2, BRF_ESS | BRF_PRG }, - { "f1_b03s.bin", 0x01000, 0xdba1eda7, BRF_ESS | BRF_PRG }, - - { "p3.bin", 0x00020, 0x2a855523, BRF_GRA }, - { "r3.bin", 0x00020, 0xae6f1019, BRF_GRA }, - { "r6.bin", 0x00020, 0xc58a4f6a, BRF_GRA }, - - { "r9_b11.bin", 0x01000, 0x2e0057ff, BRF_SND }, - { "t9_b12.bin", 0x01000, 0xb2120edd, BRF_SND }, -}; - -STD_ROM_PICK(Bagman) -STD_ROM_FN(Bagman) - -struct BurnDriver BurnDrvBagman = { - "bagman", NULL, NULL, NULL, "1982", - "Bagman\0", "Parent set for working drivers", "Valadon Automation", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, BagmanRomInfo, BagmanRomName, NULL, NULL, ParentInputInfo, NULL, - ParentInit, ParentExit, NULL, NULL, NULL, - NULL, 0, 224, 256, 3, 4 -}; - -static struct BurnRomInfo DockmanRomDesc[] = { - { "pe1.19", 0x01000, 0xeef2ec54, BRF_ESS | BRF_PRG }, - { "pe2.18", 0x01000, 0xbc48d16b, BRF_ESS | BRF_PRG }, - { "pe3.17", 0x01000, 0x1c923057, BRF_ESS | BRF_PRG }, - { "pe4.16", 0x01000, 0x23af1cba, BRF_ESS | BRF_PRG }, - { "pe5.15", 0x01000, 0x39dbe429, BRF_ESS | BRF_PRG }, - - { "pe7.22", 0x00800, 0xd2094e4a, BRF_ESS | BRF_PRG }, - { "pe6.23", 0x00800, 0x1cf447f4, BRF_ESS | BRF_PRG }, - - { "pe8.9", 0x01000, 0x4d8c2974, BRF_GRA }, - { "pe9.8", 0x01000, 0x4e4ea162, BRF_GRA }, - - { "mb7051.3", 0x00020, 0x6440dc61, BRF_GRA }, -}; - -STD_ROM_PICK(Dockman) -STD_ROM_FN(Dockman) - -struct BurnDriver BurnDrvDockman = { - "dockman", NULL, NULL, NULL, "1982", - "Dock Man\0", "Parent set for working drivers", "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, DockmanRomInfo, DockmanRomName, NULL, NULL, ParentInputInfo, NULL, - ParentInit, ParentExit, NULL, NULL, NULL, - NULL, 0, 224, 256, 3, 4 -}; - -static struct BurnRomInfo EightballactRomDesc[] = { - { "8b-dk.5e", 0x01000, 0x166c1c9b, BRF_ESS | BRF_PRG }, - { "8b-dk.5c", 0x01000, 0x9ec87baa, BRF_ESS | BRF_PRG }, - { "8b-dk.5b", 0x01000, 0xf836a962, BRF_ESS | BRF_PRG }, - { "8b-dk.5a", 0x01000, 0xd45866d4, BRF_ESS | BRF_PRG }, - - { "8b-dk.3h", 0x00800, 0xa8752c60, BRF_ESS | BRF_PRG }, - - { "8b-dk.3n", 0x00800, 0x44830867, BRF_GRA }, - { "8b-dk.3p", 0x00800, 0x6148c6f2, BRF_GRA }, - - { "8b-dk.7c", 0x00800, 0xe34409f5, BRF_GRA }, - { "8b-dk.7d", 0x00800, 0xb4dc37ca, BRF_GRA }, - { "8b-dk.7e", 0x00800, 0x655af8a8, BRF_GRA }, - { "8b-dk.7f", 0x00800, 0xa29b2763, BRF_GRA }, - - { "8b.2e", 0x00100, 0xc7379a12, BRF_GRA }, - { "8b.2f", 0x00100, 0x116612b4, BRF_GRA }, - { "8b.2n", 0x00100, 0x30586988, BRF_GRA }, - - { "82s147.prm", 0x00200, 0x46e5bc92, BRF_GRA }, - - { "pls153h.bin", 0x000eb, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(Eightballact) -STD_ROM_FN(Eightballact) - -struct BurnDriver BurnDrvEightballact = { - "8ballact", NULL, NULL, NULL, "1984", - "Eight Ball Action (DK conversion)\0", "Parent set for working drivers", "Seatongrove Ltd (Magic Eletronics USA licence)", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, EightballactRomInfo, EightballactRomName, NULL, NULL, ParentInputInfo, NULL, - ParentInit, ParentExit, NULL, NULL, NULL, - NULL, 0, 256, 224, 4, 3 -}; - -static struct BurnRomInfo HeroRomDesc[] = { - { "hr-gp1.bin", 0x01000, 0x82f39788, BRF_ESS | BRF_PRG }, - { "hr-gp2.bin", 0x01000, 0x79607812, BRF_ESS | BRF_PRG }, - { "hr-gp3.bin", 0x01000, 0x2902715c, BRF_ESS | BRF_PRG }, - { "hr-gp4.bin", 0x01000, 0x696d2f8e, BRF_ESS | BRF_PRG }, - { "hr-gp5.bin", 0x01000, 0x936a4ba6, BRF_ESS | BRF_PRG }, - - { "hr-sdp1.bin", 0x00800, 0xc34ecf79, BRF_ESS | BRF_PRG }, - - { "hr-sp1.bin", 0x00800, 0xa5c33cb1, BRF_SND }, - - { "hr-cp1.bin", 0x00800, 0x2d201496, BRF_GRA }, - { "hr-cp2.bin", 0x00800, 0x21b61fe3, BRF_GRA }, - { "hr-cp3.bin", 0x00800, 0x9c8e3f9e, BRF_GRA }, - - { "5b.bin", 0x00800, 0xf055a624, BRF_SND }, - - { "82s185.10h", 0x00800, 0xc205bca6, BRF_GRA }, - { "82s123.10k", 0x00020, 0xb5221cec, BRF_GRA }, -}; - -STD_ROM_PICK(Hero) -STD_ROM_FN(Hero) - -struct BurnDriver BurnDrvHero = { - "hero", NULL, NULL, NULL, "1984", - "Hero\0", "Parent set for working drivers", "Century Electronics / Seatongrove Ltd", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, HeroRomInfo, HeroRomName, NULL, NULL, ParentInputInfo, NULL, - ParentInit, ParentExit, NULL, NULL, NULL, - NULL, 0, 224, 256, 3, 4 -}; - -static struct BurnRomInfo HunchbakRomDesc[] = { - { "hb-gp1.bin", 0x01000, 0xaf801d54, BRF_ESS | BRF_PRG }, - { "hb-gp2.bin", 0x01000, 0xb448cc8e, BRF_ESS | BRF_PRG }, - { "hb-gp3.bin", 0x01000, 0x57c6ea7b, BRF_ESS | BRF_PRG }, - { "hb-gp4.bin", 0x01000, 0x7f91287b, BRF_ESS | BRF_PRG }, - { "hb-gp5.bin", 0x01000, 0x1dd5755c, BRF_ESS | BRF_PRG }, - - { "6c.sdp1", 0x01000, 0xf9ba2854, BRF_ESS | BRF_PRG }, - - { "8a.sp1", 0x00800, 0xed1cd201, BRF_SND }, - - { "11a.cp1", 0x00800, 0xf256b047, BRF_GRA }, - { "10a.cp2", 0x00800, 0xb870c64f, BRF_GRA }, - { "9a.cp3", 0x00800, 0x9a7dab88, BRF_GRA }, - - { "5b.bin", 0x00800, 0xf055a624, BRF_SND }, - - { "82s185.10h", 0x00800, 0xc205bca6, BRF_GRA }, - { "82s123.10k", 0x00020, 0xb5221cec, BRF_GRA }, -}; - -STD_ROM_PICK(Hunchbak) -STD_ROM_FN(Hunchbak) - -struct BurnDriver BurnDrvHunchbak = { - "hunchbak", NULL, NULL, NULL, "1983", - "Hunchback (set 1)\0", "Parent set for working drivers", "Century Electronics", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, HunchbakRomInfo, HunchbakRomName, NULL, NULL, ParentInputInfo, NULL, - ParentInit, ParentExit, NULL, NULL, NULL, - NULL, 0, 224, 256, 3, 4 -}; - -static struct BurnRomInfo HuncholyRomDesc[] = { - { "ho-gp1.bin", 0x01000, 0x4f17cda7, BRF_ESS | BRF_PRG }, - { "ho-gp2.bin", 0x01000, 0x70fa52c7, BRF_ESS | BRF_PRG }, - { "ho-gp3.bin", 0x01000, 0x931934b1, BRF_ESS | BRF_PRG }, - { "ho-gp4.bin", 0x01000, 0xaf5cd501, BRF_ESS | BRF_PRG }, - { "ho-gp5.bin", 0x01000, 0x658e8974, BRF_ESS | BRF_PRG }, - - { "ho-sdp1.bin", 0x01000, 0x3efb3ffd, BRF_ESS | BRF_PRG }, - - { "ho-sp1.bin", 0x01000, 0x3fd39b1e, BRF_SND }, - - { "ho-cp1.bin", 0x00800, 0xc6c73d46, BRF_GRA }, - { "ho-cp2.bin", 0x00800, 0xe596371c, BRF_GRA }, - { "ho-cp3.bin", 0x00800, 0x11fae1cf, BRF_GRA }, - - { "5b.bin", 0x00800, 0xf055a624, BRF_SND }, - - { "82s185.10h", 0x00800, 0xc205bca6, BRF_GRA }, - { "82s123.10k", 0x00020, 0xb5221cec, BRF_GRA }, -}; - -STD_ROM_PICK(Huncholy) -STD_ROM_FN(Huncholy) - -struct BurnDriver BurnDrvHuncholy = { - "huncholy", NULL, NULL, NULL, "1984", - "Hunchback Olympic\0", "Parent set for working drivers", "Seatongrove Ltd", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, HuncholyRomInfo, HuncholyRomName, NULL, NULL, ParentInputInfo, NULL, - ParentInit, ParentExit, NULL, NULL, NULL, - NULL, 0, 224, 256, 3, 4 -}; - -static struct BurnRomInfo ThepitRomDesc[] = { - { "pit1.bin", 0x01000, 0x71affecc, BRF_ESS | BRF_PRG }, - { "pit2.bin", 0x01000, 0x894063cd, BRF_ESS | BRF_PRG }, - { "pit3.bin", 0x01000, 0x1b488543, BRF_ESS | BRF_PRG }, - { "pit4.bin", 0x01000, 0xe941e848, BRF_ESS | BRF_PRG }, - { "pit5.bin", 0x01000, 0xe0643c95, BRF_ESS | BRF_PRG }, - - { "pit6.bin", 0x00800, 0x1b79dfb6, BRF_ESS | BRF_PRG }, - - { "pit8.bin", 0x00800, 0x69502afc, BRF_GRA }, - { "pit7.bin", 0x00800, 0xd901b353, BRF_GRA }, - - { "82s123.ic4", 0x00020, 0xa758b567, BRF_GRA }, -}; - -STD_ROM_PICK(Thepit) -STD_ROM_FN(Thepit) - -struct BurnDriver BurnDrvThepit = { - "thepit", NULL, NULL, NULL, "1992", - "The Pit\0", "Parent set for working drivers", "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, ThepitRomInfo, ThepitRomName, NULL, NULL, ParentInputInfo, NULL, - ParentInit, ParentExit, NULL, NULL, NULL, - NULL, 0, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_actfancr.cpp b/jan/src/burn/drv/dataeast/d_actfancr.cpp deleted file mode 100644 index 71b2c0b7d..000000000 --- a/jan/src/burn/drv/dataeast/d_actfancr.cpp +++ /dev/null @@ -1,1182 +0,0 @@ -// FB Alpha Act-Fancer & Trio The Punch driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "h6280_intf.h" -#include "burn_ym2203.h" -#include "burn_ym3812.h" -#include "msm6295.h" - -static UINT8 *AllMem = NULL; -static UINT8 *AllRam = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv6280ROM = NULL; -static UINT8 *Drv6502ROM = NULL; -static UINT8 *DrvGfxROM0 = NULL; -static UINT8 *DrvGfxROM1 = NULL; -static UINT8 *DrvGfxROM2 = NULL; -static UINT8 *DrvPf1RAM = NULL; -static UINT8 *DrvPf2RAM = NULL; -static UINT8 *DrvPf1Scr = NULL; -static UINT8 *DrvPf2Scr = NULL; -static UINT8 *DrvSprRAM = NULL; -static UINT8 *DrvPalRAM = NULL; -static UINT8 *Drv6280RAM = NULL; -static UINT8 *Drv6502RAM = NULL; -static UINT8 *DrvSprBuf = NULL; -static UINT8 *DrvPfCtrl[2] = { NULL, NULL }; - -static UINT8 *soundlatch = NULL; -static UINT8 *flipscreen = NULL; - -static UINT32 *DrvPalette = NULL; -static UINT8 DrvRecalc; - -static UINT8 control_select; - -static INT32 vblank; -static UINT16 gfx_config[4]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo ActfancrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Actfancr) - -static struct BurnInputInfo TriothepInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Triothep) - -static struct BurnDIPInfo ActfancrDIPList[]= -{ - {0x12, 0xff, 0xff, 0x7f, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - -#if 0 - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, -#endif - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "100 (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x04, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x08, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x13, 0x01, 0x20, 0x20, "800000" }, - {0x13, 0x01, 0x20, 0x00, "None" }, -}; - -STDDIPINFO(Actfancr) - -static struct BurnDIPInfo TriothepDIPList[]= -{ - {0x14, 0xff, 0xff, 0x7f, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x0c, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - -#if 0 - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x80, 0x00, "Upright" }, - {0x14, 0x01, 0x80, 0x80, "Cocktail" }, -#endif - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x00, "8" }, - {0x15, 0x01, 0x03, 0x01, "10" }, - {0x15, 0x01, 0x03, 0x03, "12" }, - {0x15, 0x01, 0x03, 0x02, "14" }, - - {0 , 0xfe, 0 , 4, "Difficulty (Time)" }, - {0x15, 0x01, 0x0c, 0x08, "Easy (130)" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal (100)" }, - {0x15, 0x01, 0x0c, 0x04, "Hard (70)" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest (60)" }, - - {0 , 0xfe, 0 , 2, "Bonus Lives" }, - {0x15, 0x01, 0x10, 0x00, "2" }, - {0x15, 0x01, 0x10, 0x10, "3" }, -}; - -STDDIPINFO(Triothep) - -static inline void palette_update(INT32 offset) -{ - offset &= 0x7fe; - - INT32 p = (DrvPalRAM[offset+0] << 0) | (DrvPalRAM[offset+1] << 8); - - INT32 r = (p >> 0) & 0x0f; - INT32 g = (p >> 4) & 0x0f; - INT32 b = (p >> 8) & 0x0f; - - DrvPalette[offset/2] = BurnHighCol((r << 4) | r, (g << 4) | g, (b << 4) | b, 0); -} - -void actfan_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xffffe0) == 0x060000) { - DrvPfCtrl[0][address & 0x1f] = data; - return; - } - - if ((address & 0xffffe0) == 0x070000) { - DrvPfCtrl[1][address & 0x1f] = data; - return; - } - - if ((address & 0xfff800) == 0x120000) { - DrvPalRAM[address & 0x7ff] = data; - palette_update(address & 0x7fe); - return; - } - - switch (address) - { - case 0x110000: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x150000: - *soundlatch = data; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - - case 0x160000: - return; // ? - } -} - -UINT8 actfan_main_read(UINT32 address) -{ - switch (address) - { - case 0x130000: - case 0x130001: - return DrvInputs[(address & 1)]; - - case 0x130002: - case 0x130003: - return DrvDips[(address & 1)]; - - case 0x140000: - case 0x140001: - return (DrvInputs[2] & 0x7f) | vblank; - } - - return 0; -} - -void triothep_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xffffe0) == 0x060000) { - DrvPfCtrl[0][address & 0x1f] = data; - return; - } - - if ((address & 0xffffe0) == 0x040000) { - DrvPfCtrl[1][address & 0x1f] = data; - return; - } - - if ((address & 0xfff800) == 0x130000) { - DrvPalRAM[address & 0x7ff] = data; - palette_update(address & 0x7fe); - return; - } - - switch (address) - { - case 0x100000: - *soundlatch = data; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - - case 0x110000: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x1ff000: - case 0x1ff001: - control_select = data; - return; - - case 0x1ff400: - case 0x1ff401: - case 0x1ff402: - case 0x1ff403: - h6280_irq_status_w(address & 3, data); - return; - - case 0x064800: // overflow from rowscroll write? - return; - - case 0x120800: // overflow from spriteram write? - return; - } -} - -UINT8 triothep_main_read(UINT32 address) -{ - switch (address) - { - case 0x140000: - return 0; // nop - - case 0x1ff000: - case 0x1ff001: - { - switch (control_select) - { - case 0: return DrvInputs[0]; - case 1: return DrvInputs[1]; - case 2: return DrvDips[0]; - case 3: return DrvDips[1]; - case 4: return (DrvInputs[2] & 0x7f) | vblank; - default: return 0xff; - } - } - return 0xff; - } - - return 0; -} - -static void Dec0_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0800: - case 0x0801: - BurnYM2203Write(0, address & 1, data); - return; - - case 0x1000: - case 0x1001: - BurnYM3812Write(0, address & 1, data); - return; - - case 0x3800: - MSM6295Command(0, data); - return; - } -} - -static UINT8 Dec0_sound_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0x3800: - return MSM6295ReadStatus(0); - } - - return 0; -} - -inline static INT32 Dec0YM2203SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)h6280TotalCycles() * nSoundRate / 7159066; -} - -inline static double Dec0YM2203GetTime() -{ - return (double)h6280TotalCycles() / 7159066.0; -} - -static void Dec0YM3812IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_ACK); - } else { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_NONE); - } -} - -static INT32 Dec0YM3812SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6502TotalCycles() * nSoundRate / 1500000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - h6280Open(0); - h6280Reset(); - h6280Close(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - MSM6295Reset(0); - BurnYM2203Reset(); - BurnYM3812Reset(); - - control_select = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv6280ROM = Next; Next += 0x040000; - Drv6502ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x0c0000; - DrvGfxROM2 = Next; Next += 0x080000; - - MSM6295ROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(INT32); - - AllRam = Next; - - Drv6280RAM = Next; Next += 0x004000; - Drv6502RAM = Next; Next += 0x000800; - - DrvSprRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - - DrvSprBuf = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - DrvPf1RAM = Next; Next += 0x002000; - DrvPf2RAM = Next; Next += 0x002000; - - DrvPf1Scr = Next; Next += 0x000800; - DrvPf2Scr = Next; Next += 0x000800; - - DrvPfCtrl[0] = Next; Next += 0x000020; - DrvPfCtrl[1] = Next; Next += 0x000020; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x08000*8, 0x18000*8, 0x00000*8, 0x10000*8 }; - INT32 Plane1[4] = { 0x00000*8, 0x18000*8, 0x30000*8, 0x48000*8 }; - INT32 Plane2[4] = { 0x00000*8, 0x10000*8, 0x20000*8, 0x30000*8 }; - INT32 XOffs[16] = { STEP8(16*8, 1), STEP8(0, 1) }; - INT32 YOffs[16] = { STEP16(0, 8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x60000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x20000); - - GfxDecode(0x1000, 4, 8, 8, Plane0, XOffs + 8, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x60000); - - GfxDecode(0x0c00, 4, 16, 16, Plane1, XOffs + 0, YOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane2, XOffs + 0, YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static void Dec0SoundInit() -{ - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Drv6502RAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(Drv6502ROM + 0x4000, 0x4000, 0xffff, MAP_ROM); - M6502SetWriteHandler(Dec0_sound_write); - M6502SetReadHandler(Dec0_sound_read); - M6502Close(); - - BurnYM2203Init(1, 1500000, NULL, Dec0YM2203SynchroniseStream, Dec0YM2203GetTime, 0); - BurnTimerAttachH6280(7159066); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.90, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.90, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.90, BURN_SND_ROUTE_BOTH); - - BurnYM3812Init(1, 3000000, &Dec0YM3812IRQHandler, &Dec0YM3812SynchroniseStream, 1); - BurnTimerAttachM6502YM3812(1500000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.90, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1024188 / 132, 1); - MSM6295SetRoute(0, 0.85, BURN_SND_ROUTE_BOTH); -} - -static INT32 ActfanInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv6280ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(Drv6280ROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(Drv6280ROM + 0x20000, 2, 1)) return 1; - - if (BurnLoadRom(Drv6502ROM + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x28000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x48000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x58000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 17, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x00000, 18, 1)) return 1; - - if (DrvGfxDecode()) return 1; - } - - h6280Init(0); - h6280Open(0); - h6280MapMemory(Drv6280ROM, 0x000000, 0x03ffff, MAP_ROM); - h6280MapMemory(DrvPf1RAM, 0x062000, 0x063fff, MAP_RAM); - h6280MapMemory(DrvPf2RAM, 0x072000, 0x073fff, MAP_RAM); - h6280MapMemory(DrvSprRAM, 0x100000, 0x1007ff, MAP_RAM); - h6280MapMemory(DrvPalRAM, 0x120000, 0x1205ff, MAP_ROM); - h6280MapMemory(Drv6280RAM, 0x1f0000, 0x1f3fff, MAP_RAM); - h6280SetWriteHandler(actfan_main_write); - h6280SetReadHandler(actfan_main_read); - h6280Close(); - - Dec0SoundInit(); - - gfx_config[0] = 0; // character color offset - gfx_config[1] = 0x200; // sprite color offset - gfx_config[2] = 0x100; // bg color offset - gfx_config[3] = 2; // wide 2 - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 TriothepInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv6280ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(Drv6280ROM + 0x20000, 1, 1)) return 1; - if (BurnLoadRom(Drv6280ROM + 0x30000, 2, 1)) return 1; - - if (BurnLoadRom(Drv6502ROM + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x28000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x48000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x58000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 17, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x00000, 18, 1)) return 1; - - if (DrvGfxDecode()) return 1; - } - - h6280Init(0); - h6280Open(0); - h6280MapMemory(Drv6280ROM, 0x000000, 0x03ffff, MAP_ROM); - h6280MapMemory(DrvPf2RAM, 0x044000, 0x045fff, MAP_RAM); - h6280MapMemory(DrvPf2Scr, 0x046000, 0x0467ff, MAP_RAM); - h6280MapMemory(DrvPf1RAM, 0x064000, 0x0647ff, MAP_RAM); - h6280MapMemory(DrvPf1Scr, 0x066000, 0x0667ff, MAP_RAM); - h6280MapMemory(DrvSprRAM, 0x120000, 0x1207ff, MAP_RAM); - h6280MapMemory(DrvPalRAM, 0x130000, 0x1305ff, MAP_ROM); - h6280MapMemory(Drv6280RAM, 0x1f0000, 0x1f3fff, MAP_RAM); - h6280SetWriteHandler(triothep_main_write); - h6280SetReadHandler(triothep_main_read); - h6280Close(); - - Dec0SoundInit(); - - gfx_config[0] = 0; // character color offset - gfx_config[1] = 0x100; // sprite color offset - gfx_config[2] = 0x200; // bg color offset - gfx_config[3] = 0; // wide 0 - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2203Exit(); - BurnYM3812Exit(); - MSM6295Exit(0); - - h6280Exit(); - M6502Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_pf1_layer() -{ - const INT32 config[4][4][2] = { - { { 64, 16 }, { 32, 32 }, { 16, 64 }, { 32, 32 } }, // type 0 - { { 128, 16 }, { 64, 32 }, { 32, 64 }, { 64, 32 } }, // type 1 - { { 256, 16 }, { 128, 32 }, { 64, 64 }, { 128, 32 } }, // type 2 - }; - - INT32 type = gfx_config[3]; - - INT32 wide = DrvPfCtrl[0][6] & 3; - - INT32 width = config[type][wide][0]; - INT32 height = config[type][wide][1]; - - INT32 scrollx = (DrvPfCtrl[0][0x10] + (DrvPfCtrl[0][0x11] << 8)) & ((width * 16) - 1); - INT32 scrolly = (DrvPfCtrl[0][0x12] + (DrvPfCtrl[0][0x13] << 8)) & ((height * 16) - 1); - - INT32 enable_rowscroll = DrvPfCtrl[0][0] & 0x04; - - if (enable_rowscroll == 0) - { - for (INT32 offs = 0; offs < width * height; offs++) - { - INT32 sx = (offs % width); - INT32 sy = (offs / width) % height; - - INT32 ofst = (sx & 0x0f) + (sy * 16) + ((sx & 0x1f0) << (4+wide)); - - sx = (sx * 16) - scrollx; - if (sx < -15) sx += width*16; - - sy = (sy * 16) - (scrolly + 8); - if (sy < -15) sy += height*16; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 code = DrvPf1RAM[ofst * 2 + 0] | (DrvPf1RAM[ofst * 2 + 1] << 8); - - if (sx >= 0 && sx <= (nScreenWidth - 16) && sy >= 0 && sy <= (nScreenHeight - 16)) { - Render16x16Tile(pTransDraw, code & 0xfff, sx, sy, code >> 12, 4, gfx_config[2], DrvGfxROM2); - } else { - Render16x16Tile_Clip(pTransDraw, code & 0xfff, sx, sy, code >> 12, 4, gfx_config[2], DrvGfxROM2); - } - } - } else { - for (INT32 y = 0; y < nScreenHeight; y++) - { - UINT16 *dst = pTransDraw + y * nScreenWidth; - - INT32 sy = (y + scrolly + 8) & ((height * 16) - 1); - - INT32 scrx = ((sy & 0x1ff) >> (DrvPfCtrl[0][0x17] & 0x0f)) + (0x400/2); - - scrx = (scrollx + (DrvPf1Scr[(scrx * 2)+0] << 0) + (DrvPf1Scr[(scrx * 2)+1] << 8)) & ((width * 16) - 1); - - for (INT32 x = 0; x < nScreenWidth + 16; x+=16) - { - INT32 sx = (scrx + x) & ((width * 16) - 1); - - INT32 ofst = ((sx / 16) & 0x0f) + (sy & 0x3f0) + (((sx / 16) & 0x1f0) << (4 + wide)); - - UINT16 code = DrvPf1RAM[ofst * 2 + 0] | (DrvPf1RAM[ofst * 2 + 1] << 8); - - { - UINT8 *gfx = DrvGfxROM2 + ((code & 0x0fff) * 0x100) + ((sy & 0x0f) * 16); - - INT32 color = ((code >> 12) * 16) + gfx_config[2]; - - INT32 xxx = x - (scrx & 0x0f); - - if (xxx >= 0 && xxx <= (nScreenWidth - 16)) { - for (INT32 xx = 0; xx < 16; xx++, xxx++) { - dst[xxx] = gfx[xx] + color; - } - } else { - for (INT32 xx = 0; xx < 16; xx++, xxx++) { - if (xxx >= 0 && xxx < nScreenWidth) { - dst[xxx] = gfx[xx] + color; - } - } - } - } - } - } - } -} - -static void draw_pf2_layer() -{ - for (INT32 offs = 32; offs < 32 * 31; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 code = DrvPf2RAM[offs * 2 + 0] | (DrvPf2RAM[offs * 2 + 1] << 8); - - if (code == 0) continue; // skip transparent tile - - Render8x8Tile_Mask(pTransDraw, code & 0xfff, sx, sy - 8, code >> 12, 4, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - INT32 offs = 0; - while (offs < 0x800) - { - INT32 incy, mult; - - INT32 sy = DrvSprBuf[offs + 0] + (DrvSprBuf[offs + 1] << 8); - INT32 sx = DrvSprBuf[offs + 4] + (DrvSprBuf[offs + 5] << 8); - INT32 enable = sy & 0x8000; - INT32 color = sx >> 12; - INT32 flash = sx & 0x0800; - - INT32 flipx = sy & 0x2000; - INT32 flipy = sy & 0x4000; - INT32 h = (1 << ((sy & 0x1800) >> 11)); - INT32 w = (1 << ((sy & 0x0600) >> 9)); - - sx = sx & 0x01ff; - sy = sy & 0x01ff; - if (sx >= 256) sx -= 512; - if (sy >= 256) sy -= 512; - sx = 240 - sx; - sy = 240 - sy; - - if (0) //flipscreen - { - sy = 240 - sy; - sx = 240 - sx; - if (flipx) flipx = 0; else flipx = 1; - if (flipy) flipy = 0; else flipy = 1; - mult = 16; - } - else - mult = -16; - - for (INT32 x = 0; x < w; x++) - { - if (enable && (!flash || (nCurrentFrame & 1))) - { - INT32 code = DrvSprBuf[offs + 2] + (DrvSprBuf[offs + 3] << 8); - - code &= ~(h-1); - - code %= 0xc00; //&= 0xfff; // right? - - if (flipy) - incy = -1; - else - { - code += h-1; - incy = 1; - } - - for (INT32 y = 0; y < h; y++) - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code - y * incy, sx + (mult * x), sy + (mult * y) - 8, color, 4, 0, gfx_config[1], DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code - y * incy, sx + (mult * x), sy + (mult * y) - 8, color, 4, 0, gfx_config[1], DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code - y * incy, sx + (mult * x), sy + (mult * y) - 8, color, 4, 0, gfx_config[1], DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code - y * incy, sx + (mult * x), sy + (mult * y) - 8, color, 4, 0, gfx_config[1], DrvGfxROM1); - } - } - } - } - - offs += 8; - if (offs >= 0x800) return; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x600; i+=2) { - palette_update(i); - } - DrvRecalc = 0; - } - - if ((nBurnLayer & 1) == 0) { - BurnTransferClear(); - } else { - draw_pf1_layer(); - } - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 4) draw_pf2_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - h6280NewFrame(); - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // clear opposites - if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03; - if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - } - - INT32 nInterleave = 32; - INT32 nCyclesTotal[2] = { 7159066 / 60, 1500000 / 60 }; - - h6280Open(0); - M6502Open(0); - - vblank = 0x80; - - for (INT32 i = 0; i < nInterleave; i++) - { - BurnTimerUpdate(i * (nCyclesTotal[0] / nInterleave)); // h6280 - if (i == 1) vblank = 0; - if (i == 30) { - vblank = 0x80; - h6280SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); // m6502 - } - - BurnTimerEndFrame(nCyclesTotal[0]); // h6280 - BurnTimerEndFrameYM3812(nCyclesTotal[1]); // m6502 - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - M6502Close(); - h6280Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029721; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - h6280CpuScan(nAction); - M6502Scan(nAction); - - BurnYM2203Scan(nAction, pnMin); - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - SCAN_VAR(control_select); - DrvRecalc = 1; // April 3, 2014 - Fix palette problem on state load - dink & iq_132 - } - - return 0; -} - - -// Act-Fancer Cybernetick Hyper Weapon (World revision 2) - -static struct BurnRomInfo actfancrRomDesc[] = { - { "fe08-2.bin", 0x10000, 0x0d36fbfa, 1 | BRF_PRG | BRF_ESS }, // 0 h6280 Code - { "fe09-2.bin", 0x10000, 0x27ce2bb1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "10", 0x10000, 0xcabad137, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "17-1", 0x08000, 0x289ad106, 2 | BRF_PRG | BRF_ESS }, // 3 m6502 Code - - { "15", 0x10000, 0xa1baf21e, 3 | BRF_GRA }, // 4 Characters - { "16", 0x10000, 0x22e64730, 3 | BRF_GRA }, // 5 - - { "02", 0x10000, 0xb1db0efc, 4 | BRF_GRA }, // 6 Sprites - { "03", 0x08000, 0xf313e04f, 4 | BRF_GRA }, // 7 - { "06", 0x10000, 0x8cb6dd87, 4 | BRF_GRA }, // 8 - { "07", 0x08000, 0xdd345def, 4 | BRF_GRA }, // 9 - { "00", 0x10000, 0xd50a9550, 4 | BRF_GRA }, // 10 - { "01", 0x08000, 0x34935e93, 4 | BRF_GRA }, // 11 - { "04", 0x10000, 0xbcf41795, 4 | BRF_GRA }, // 12 - { "05", 0x08000, 0xd38b94aa, 4 | BRF_GRA }, // 13 - - { "14", 0x10000, 0xd6457420, 5 | BRF_GRA }, // 14 Background Layer - { "12", 0x10000, 0x08787b7a, 5 | BRF_GRA }, // 15 - { "13", 0x10000, 0xc30c37dc, 5 | BRF_GRA }, // 16 - { "11", 0x10000, 0x1f006d9f, 5 | BRF_GRA }, // 17 - - { "18", 0x10000, 0x5c55b242, 6 | BRF_SND }, // 18 Samples -}; - -STD_ROM_PICK(actfancr) -STD_ROM_FN(actfancr) - -struct BurnDriver BurnDrvActfancr = { - "actfancr", NULL, NULL, NULL, "1989", - "Act-Fancer Cybernetick Hyper Weapon (World revision 2)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, actfancrRomInfo, actfancrRomName, NULL, NULL, ActfancrInputInfo, ActfancrDIPInfo, - ActfanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 240, 4, 3 -}; - - -// Act-Fancer Cybernetick Hyper Weapon (World revision 1) - -static struct BurnRomInfo actfancr1RomDesc[] = { - { "08-1", 0x10000, 0x3bf214a4, 1 | BRF_PRG | BRF_ESS }, // 0 h6280 Code - { "09-1", 0x10000, 0x13ae78d5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "10", 0x10000, 0xcabad137, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "17-1", 0x08000, 0x289ad106, 2 | BRF_PRG | BRF_ESS }, // 3 m6502 Code - - { "15", 0x10000, 0xa1baf21e, 3 | BRF_GRA }, // 4 Characters - { "16", 0x10000, 0x22e64730, 3 | BRF_GRA }, // 5 - - { "02", 0x10000, 0xb1db0efc, 4 | BRF_GRA }, // 6 Sprites - { "03", 0x08000, 0xf313e04f, 4 | BRF_GRA }, // 7 - { "06", 0x10000, 0x8cb6dd87, 4 | BRF_GRA }, // 8 - { "07", 0x08000, 0xdd345def, 4 | BRF_GRA }, // 9 - { "00", 0x10000, 0xd50a9550, 4 | BRF_GRA }, // 10 - { "01", 0x08000, 0x34935e93, 4 | BRF_GRA }, // 11 - { "04", 0x10000, 0xbcf41795, 4 | BRF_GRA }, // 12 - { "05", 0x08000, 0xd38b94aa, 4 | BRF_GRA }, // 13 - - { "14", 0x10000, 0xd6457420, 5 | BRF_GRA }, // 14 Background Layer - { "12", 0x10000, 0x08787b7a, 5 | BRF_GRA }, // 15 - { "13", 0x10000, 0xc30c37dc, 5 | BRF_GRA }, // 16 - { "11", 0x10000, 0x1f006d9f, 5 | BRF_GRA }, // 17 - - { "18", 0x10000, 0x5c55b242, 6 | BRF_SND }, // 18 Samples -}; - -STD_ROM_PICK(actfancr1) -STD_ROM_FN(actfancr1) - -struct BurnDriver BurnDrvActfancr1 = { - "actfancr1", "actfancr", NULL, NULL, "1989", - "Act-Fancer Cybernetick Hyper Weapon (World revision 1)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, actfancr1RomInfo, actfancr1RomName, NULL, NULL, ActfancrInputInfo, ActfancrDIPInfo, - ActfanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 240, 4, 3 -}; - - -// Act-Fancer Cybernetick Hyper Weapon (Japan revision 1) - -static struct BurnRomInfo actfancrjRomDesc[] = { - { "fd08-1.bin", 0x10000, 0x69004b60, 1 | BRF_PRG | BRF_ESS }, // 0 h6280 Code - { "fd09-1.bin", 0x10000, 0xa455ae3e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "10", 0x10000, 0xcabad137, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "17-1", 0x08000, 0x289ad106, 2 | BRF_PRG | BRF_ESS }, // 3 m6502 Code - - { "15", 0x10000, 0xa1baf21e, 3 | BRF_GRA }, // 4 Characters - { "16", 0x10000, 0x22e64730, 3 | BRF_GRA }, // 5 - - { "02", 0x10000, 0xb1db0efc, 4 | BRF_GRA }, // 6 Sprites - { "03", 0x08000, 0xf313e04f, 4 | BRF_GRA }, // 7 - { "06", 0x10000, 0x8cb6dd87, 4 | BRF_GRA }, // 8 - { "07", 0x08000, 0xdd345def, 4 | BRF_GRA }, // 9 - { "00", 0x10000, 0xd50a9550, 4 | BRF_GRA }, // 10 - { "01", 0x08000, 0x34935e93, 4 | BRF_GRA }, // 11 - { "04", 0x10000, 0xbcf41795, 4 | BRF_GRA }, // 12 - { "05", 0x08000, 0xd38b94aa, 4 | BRF_GRA }, // 13 - - { "14", 0x10000, 0xd6457420, 5 | BRF_GRA }, // 14 Background Layer - { "12", 0x10000, 0x08787b7a, 5 | BRF_GRA }, // 15 - { "13", 0x10000, 0xc30c37dc, 5 | BRF_GRA }, // 16 - { "11", 0x10000, 0x1f006d9f, 5 | BRF_GRA }, // 17 - - { "18", 0x10000, 0x5c55b242, 6 | BRF_SND }, // 18 Samples -}; - -STD_ROM_PICK(actfancrj) -STD_ROM_FN(actfancrj) - -struct BurnDriver BurnDrvActfancrj = { - "actfancrj", "actfancr", NULL, NULL, "1989", - "Act-Fancer Cybernetick Hyper Weapon (Japan revision 1)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, actfancrjRomInfo, actfancrjRomName, NULL, NULL, ActfancrInputInfo, ActfancrDIPInfo, - ActfanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 240, 4, 3 -}; - - -// Trio The Punch - Never Forget Me... (World) - -static struct BurnRomInfo triothepRomDesc[] = { - { "fg-16.bin", 0x20000, 0x7238355a, 1 | BRF_PRG | BRF_ESS }, // 0 h6280 Code - { "fg-15.bin", 0x10000, 0x1c0551ab, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fg-14.bin", 0x10000, 0x4ba7de4a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "fg-18.bin", 0x10000, 0x9de9ee63, 2 | BRF_PRG | BRF_ESS }, // 3 m6502 Code - - { "fg-12.bin", 0x10000, 0x15fb49f2, 3 | BRF_GRA }, // 4 Characters - { "fg-13.bin", 0x10000, 0xe20c9623, 3 | BRF_GRA }, // 5 - - { "fg-11.bin", 0x10000, 0x1143ebd7, 4 | BRF_GRA }, // 6 Sprites - { "fg-10.bin", 0x08000, 0x4b6b477a, 4 | BRF_GRA }, // 7 - { "fg-09.bin", 0x10000, 0x6bf6c803, 4 | BRF_GRA }, // 8 - { "fg-08.bin", 0x08000, 0x1391e445, 4 | BRF_GRA }, // 9 - { "fg-03.bin", 0x10000, 0x3d3ca9ad, 4 | BRF_GRA }, // 10 - { "fg-02.bin", 0x08000, 0x6b9d24ce, 4 | BRF_GRA }, // 11 - { "fg-01.bin", 0x10000, 0x4987f7ac, 4 | BRF_GRA }, // 12 - { "fg-00.bin", 0x08000, 0x41232442, 4 | BRF_GRA }, // 13 - - { "fg-04.bin", 0x10000, 0x7cea3c87, 5 | BRF_GRA }, // 14 Background Layer - { "fg-06.bin", 0x10000, 0x5e7f3e8f, 5 | BRF_GRA }, // 15 - { "fg-05.bin", 0x10000, 0x8bb13f05, 5 | BRF_GRA }, // 16 - { "fg-07.bin", 0x10000, 0x0d7affc3, 5 | BRF_GRA }, // 17 - - { "fg-17.bin", 0x10000, 0xf0ab0d05, 6 | BRF_SND }, // 18 Samples -}; - -STD_ROM_PICK(triothep) -STD_ROM_FN(triothep) - -struct BurnDriver BurnDrvTriothep = { - "triothep", NULL, NULL, NULL, "1989", - "Trio The Punch - Never Forget Me... (World)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, triothepRomInfo, triothepRomName, NULL, NULL, TriothepInputInfo, TriothepDIPInfo, - TriothepInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 240, 4, 3 -}; - - -// Trio The Punch - Never Forget Me... (Japan) - -static struct BurnRomInfo triothepjRomDesc[] = { - { "ff-16.bin", 0x20000, 0x84d7e1b6, 1 | BRF_PRG | BRF_ESS }, // 0 h6280 Code - { "ff-15.bin", 0x10000, 0x6eada47c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ff-14.bin", 0x10000, 0x4ba7de4a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ff-18.bin", 0x10000, 0x9de9ee63, 2 | BRF_PRG | BRF_ESS }, // 3 m6502 Code - - { "ff-12.bin", 0x10000, 0x15fb49f2, 3 | BRF_GRA }, // 4 Characters - { "ff-13.bin", 0x10000, 0xe20c9623, 3 | BRF_GRA }, // 5 - - { "ff-11.bin", 0x10000, 0x19e885c7, 4 | BRF_GRA }, // 6 Sprites - { "ff-10.bin", 0x08000, 0x4b6b477a, 4 | BRF_GRA }, // 7 - { "ff-09.bin", 0x10000, 0x79c6bc0e, 4 | BRF_GRA }, // 8 - { "ff-08.bin", 0x08000, 0x1391e445, 4 | BRF_GRA }, // 9 - { "ff-03.bin", 0x10000, 0xb36ad42d, 4 | BRF_GRA }, // 10 - { "ff-02.bin", 0x08000, 0x6b9d24ce, 4 | BRF_GRA }, // 11 - { "ff-01.bin", 0x10000, 0x68d80a66, 4 | BRF_GRA }, // 12 - { "ff-00.bin", 0x08000, 0x41232442, 4 | BRF_GRA }, // 13 - - { "ff-04.bin", 0x10000, 0x7cea3c87, 5 | BRF_GRA }, // 14 Background Layer - { "ff-06.bin", 0x10000, 0x5e7f3e8f, 5 | BRF_GRA }, // 15 - { "ff-05.bin", 0x10000, 0x8bb13f05, 5 | BRF_GRA }, // 16 - { "ff-07.bin", 0x10000, 0x0d7affc3, 5 | BRF_GRA }, // 17 - - { "ff-17.bin", 0x10000, 0xf0ab0d05, 6 | BRF_SND }, // 18 Samples -}; - -STD_ROM_PICK(triothepj) -STD_ROM_FN(triothepj) - -struct BurnDriver BurnDrvTriothepj = { - "triothepj", "triothep", NULL, NULL, "1989", - "Trio The Punch - Never Forget Me... (Japan)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, triothepjRomInfo, triothepjRomName, NULL, NULL, TriothepInputInfo, TriothepDIPInfo, - TriothepInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_backfire.cpp b/jan/src/burn/drv/dataeast/d_backfire.cpp deleted file mode 100644 index 4cd049532..000000000 --- a/jan/src/burn/drv/dataeast/d_backfire.cpp +++ /dev/null @@ -1,748 +0,0 @@ -// FB Alpha Backfire! driver module -// Based on MAME driver by David Haywood - -// Notes: -// 1 / 2 screen autodetect disabled until it can be made to not crash. - -#include "tiles_generic.h" -#include "arm_intf.h" -#include "ymz280b.h" -#include "eeprom.h" -#include "deco16ic.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvArmROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -//static UINT8 *DrvGfxROM4; -static UINT8 *DrvSndROM; -static UINT8 *DrvArmRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; - -static UINT16 *DrvTmpBitmap0; -static UINT16 *DrvTmpBitmap_p; -static UINT16 *DrvTmpBitmap1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[1]; -static UINT16 DrvInputs[3]; -static UINT8 DrvReset; - -static UINT32 *priority; -static INT32 nPreviousDip; - -static struct BurnInputInfo BackfireInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy3 + 8, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy3 + 9, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvJoy3 + 10, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy3 + 12, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvJoy3 + 13, "p2 fire 5" }, - {"P2 Button 6", BIT_DIGITAL, DrvJoy3 + 14, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Backfire) - -static struct BurnDIPInfo BackfireDIPList[]= -{ - {0x1a, 0xff, 0xff, 0x08, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1a, 0x01, 0x08, 0x08, "Off" }, - {0x1a, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Backfire) - -void backfire_write_byte(UINT32 address, UINT8 data) -{ - Write16Byte(((UINT8*)deco16_pf_control[0]), 0x100000, 0x10001f) // 16-bit - Write16Byte(deco16_pf_ram[0], 0x110000, 0x111fff) // 16-bit - Write16Byte(deco16_pf_ram[1], 0x114000, 0x115fff) // 16-bit - Write16Byte(deco16_pf_rowscroll[0], 0x120000, 0x120fff) // 16-bit - Write16Byte(deco16_pf_rowscroll[1], 0x124000, 0x124fff) // 16-bit - Write16Byte(((UINT8*)deco16_pf_control[1]), 0x130000, 0x13001f) // 16-bit - Write16Byte(deco16_pf_ram[2], 0x140000, 0x141fff) // 16-bit - Write16Byte(deco16_pf_ram[3], 0x144000, 0x145fff) // 16-bit - Write16Byte(deco16_pf_rowscroll[2], 0x150000, 0x150fff) // 16-bit - Write16Byte(deco16_pf_rowscroll[3], 0x154000, 0x154fff) // 16-bit - - switch (address) - { - case 0x1c0000: - YMZ280BWrite(0, data); - return; - - case 0x1c0004: - YMZ280BWrite(1, data); - return; - } -} - -void backfire_write_long(UINT32 address, UINT32 data) -{ - Write16Long(((UINT8*)deco16_pf_control[0]), 0x100000, 0x10001f) // 16-bit - Write16Long(deco16_pf_ram[0], 0x110000, 0x111fff) // 16-bit - Write16Long(deco16_pf_ram[1], 0x114000, 0x115fff) // 16-bit - Write16Long(deco16_pf_rowscroll[0], 0x120000, 0x120fff) // 16-bit - Write16Long(deco16_pf_rowscroll[1], 0x124000, 0x124fff) // 16-bit - Write16Long(((UINT8*)deco16_pf_control[1]), 0x130000, 0x13001f) // 16-bit - Write16Long(deco16_pf_ram[2], 0x140000, 0x141fff) // 16-bit - Write16Long(deco16_pf_ram[3], 0x144000, 0x145fff) // 16-bit - Write16Long(deco16_pf_rowscroll[2], 0x150000, 0x150fff) // 16-bit - Write16Long(deco16_pf_rowscroll[3], 0x154000, 0x154fff) // 16-bit - - switch (address) - { - case 0x1a4000: - EEPROMWrite(data & 0x02, data & 0x04, data & 0x01); - return; - - case 0x1a8000: - priority[0] = data; // left - return; - - case 0x1ac000: - priority[1] = data; // right - return; - - case 0x1c0000: - YMZ280BWrite(0, data); - return; - - case 0x1c0004: - YMZ280BWrite(1, data); - return; - } -} - -UINT8 backfire_read_byte(UINT32 address) -{ - Read16Byte(((UINT8*)deco16_pf_control[0]), 0x100000, 0x10001f) // 16-bit - Read16Byte(deco16_pf_ram[0], 0x110000, 0x111fff) // 16-bit - Read16Byte(deco16_pf_ram[1], 0x114000, 0x115fff) // 16-bit - Read16Byte(deco16_pf_rowscroll[0], 0x120000, 0x120fff) // 16-bit - Read16Byte(deco16_pf_rowscroll[1], 0x124000, 0x124fff) // 16-bit - Read16Byte(((UINT8*)deco16_pf_control[1]), 0x130000, 0x13001f) // 16-bit - Read16Byte(deco16_pf_ram[2], 0x140000, 0x141fff) // 16-bit - Read16Byte(deco16_pf_ram[3], 0x144000, 0x145fff) // 16-bit - Read16Byte(deco16_pf_rowscroll[2], 0x150000, 0x150fff) // 16-bit - Read16Byte(deco16_pf_rowscroll[3], 0x154000, 0x154fff) // 16-bit - - switch (address) - { - case 0x190000: return DrvInputs[0]; - case 0x190002: return DrvInputs[2]; - case 0x194002: return DrvInputs[1]; - - case 0x1c0000: return YMZ280BRead(0); - case 0x1c0004: return YMZ280BRead(1); - } - - return 0; -} - -UINT32 backfire_read_long(UINT32 address) -{ - Read16Long(((UINT8*)deco16_pf_control[0]), 0x100000, 0x10001f) // 16-bit - Read16Long(deco16_pf_ram[0], 0x110000, 0x111fff) // 16-bit - Read16Long(deco16_pf_ram[1], 0x114000, 0x115fff) // 16-bit - Read16Long(deco16_pf_rowscroll[0], 0x120000, 0x120fff) // 16-bit - Read16Long(deco16_pf_rowscroll[1], 0x124000, 0x124fff) // 16-bit - Read16Long(((UINT8*)deco16_pf_control[1]), 0x130000, 0x13001f) // 16-bit - Read16Long(deco16_pf_ram[2], 0x140000, 0x141fff) // 16-bit - Read16Long(deco16_pf_ram[3], 0x144000, 0x145fff) // 16-bit - Read16Long(deco16_pf_rowscroll[2], 0x150000, 0x150fff) // 16-bit - Read16Long(deco16_pf_rowscroll[3], 0x154000, 0x154fff) // 16-bit - - switch (address) - { - case 0x190000: { - UINT32 vblnk=0; - vblnk ^= 1 << 16; - - UINT32 ret = 0; - ret |= EEPROMRead() << 24; - ret |= (DrvInputs[2] & 0xbf) << 16; - ret |= deco16_vblank; - ret |= DrvInputs[0]; - ret |= vblnk; - return ret; - } - - case 0x194000: { - UINT32 ret = 0; - ret |= EEPROMRead() << 24; - ret |= DrvInputs[1] << 16; - ret |= DrvInputs[1] << 0; - return ret; - } - - case 0x1c0000: - return YMZ280BRead(0); - - case 0x1c0004: - return YMZ280BRead(1); - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvArmROM = Next; Next += 0x0100000; - - DrvGfxROM0 = Next; Next += 0x0800000; - DrvGfxROM1 = Next; Next += 0x0800000; - DrvGfxROM2 = Next; Next += 0x0200000; - DrvGfxROM3 = Next; Next += 0x0800000; -// DrvGfxROM4 = Next; Next += 0x0800000; - - YMZ280BROM = Next; - DrvSndROM = Next; Next += 0x0400000; - - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - DrvTmpBitmap_p = (UINT16*)Next; - DrvTmpBitmap0 = (UINT16*)Next; Next += 320 * 240 * sizeof(UINT16); - DrvTmpBitmap1 = (UINT16*)Next; Next += 320 * 240 * sizeof(UINT16); - - AllRam = Next; - - DrvArmRAM = Next; Next += 0x0008000; - DrvPalRAM = Next; Next += 0x0002000; - DrvSprRAM0 = Next; Next += 0x0002000; - DrvSprRAM1 = Next; Next += 0x0002000; - - priority = (UINT32*)Next; Next += 2 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ArmOpen(0); - ArmReset(); - ArmClose(); - - YMZ280BReset(); - - EEPROMReset(); - - deco16Reset(); - - return 0; -} - -static INT32 backfire_bank_callback( INT32 bank ) -{ - bank = bank >> 4; - bank = (bank & 1) | ((bank & 4) >> 1) | ((bank & 2) << 1); - - return bank * 0x1000; -} - -static void decode_samples() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - - for (INT32 i = 0; i < 0x200000; i++) { - tmp[((i & 1) << 20) | (i >> 1) ] = DrvSndROM[i]; - } - - memcpy (DrvSndROM, tmp, 0x200000); - - BurnFree (tmp); -} - -static void pCommonSpeedhackCallback() -{ - ArmIdleCycles(1120); -} - -static INT32 DrvInit(UINT32 speedhack) -{ - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvArmROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(DrvArmROM + 0x000000, 1, 2)) return 1; - - for (INT32 i = 0; i < 0x100000; i+=4) { - BurnByteswap(DrvArmROM + i + 1, 2); - } - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 3, 1)) return 1; - - for (INT32 i = 0; i < 0x400000; i++) { - INT32 j = (i & 0x17ffff) | ((i & 0x80000) << 2) | ((i & 0x200000) >> 2); - DrvGfxROM0[j] = DrvGfxROM1[i]; - } - memset (DrvGfxROM1, 0, 0x400000); - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 6, 2)) return 1; - - // if (BurnLoadRom(DrvGfxROM4 + 0x000000, 7, 2)) return 1; - // if (BurnLoadRom(DrvGfxROM4 + 0x000001, 8, 2)) return 1; - - memset (DrvSndROM, 0xff, 0x400000); - if (BurnLoadRom(DrvSndROM + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 10, 1)) return 1; - - deco156_decrypt(DrvArmROM, 0x100000); - - deco56_decrypt_gfx(DrvGfxROM0, 0x400000); - deco56_decrypt_gfx(DrvGfxROM2, 0x100000); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM1, 0x400000, 0); - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x400000, 1); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x100000, 0); - - deco16_sprite_decode(DrvGfxROM3, 0x400000); - // deco16_sprite_decode(DrvGfxROM4, 0x400000); - - decode_samples(); - } - - ArmInit(0); - ArmOpen(0); - ArmMapMemory(DrvArmROM, 0x000000, 0x0fffff, MAP_ROM); - ArmMapMemory(DrvPalRAM, 0x160000, 0x161fff, MAP_RAM); - ArmMapMemory(DrvArmRAM, 0x170000, 0x177fff, MAP_RAM); - ArmMapMemory(DrvSprRAM0, 0x184000, 0x185fff, MAP_RAM); - ArmMapMemory(DrvSprRAM1, 0x18c000, 0x18dfff, MAP_RAM); - ArmSetWriteByteHandler(backfire_write_byte); - ArmSetWriteLongHandler(backfire_write_long); - ArmSetReadByteHandler(backfire_read_byte); - ArmSetReadLongHandler(backfire_read_long); - ArmClose(); - - ArmSetSpeedHack(speedhack ? speedhack : ~0, pCommonSpeedhackCallback); - - EEPROMInit(&eeprom_interface_93C46); - - YMZ280BInit(14000000, NULL); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - deco16Init(0, 0, 1); - deco16_set_bank_callback(0, backfire_bank_callback); - deco16_set_bank_callback(1, backfire_bank_callback); - deco16_set_bank_callback(2, backfire_bank_callback); - deco16_set_bank_callback(3, backfire_bank_callback); - deco16_set_color_base(1, 0x400); - deco16_set_color_base(2, 0x100); - deco16_set_color_base(3, 0x500); - deco16_set_graphics(DrvGfxROM0, 0x800000, DrvGfxROM1, 0x800000, DrvGfxROM2, 0x200000); - deco16_set_global_offsets(0, 8); - - GenericTilesInit(); - - nPreviousDip = DrvDips[0] & 0x80; - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - ArmExit(); - - YMZ280BExit(); - YMZ280BROM = NULL; - - GenericTilesExit(); - - deco16Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void simpl156_palette_recalc() -{ - UINT32 *p = (UINT32*)DrvPalRAM; - - for (INT32 i = 0; i < 0x2000 / 4; i++) - { - INT32 r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x1f; - INT32 g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 5) & 0x1f; - INT32 b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_sprites(UINT16 *dest, UINT8 *ram, UINT8 *gfx, INT32 coloff) -{ - UINT32 *spriteram = (UINT32*)ram; - - for (INT32 offs = (0x1400 / 4) - 4; offs >= 0; offs -= 4) - { - INT32 x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri; - - sprite = BURN_ENDIAN_SWAP_INT32(spriteram[offs + 1]) & 0xffff; - - y = BURN_ENDIAN_SWAP_INT32(spriteram[offs]) & 0xffff; - flash = y & 0x1000; - if (flash && (nCurrentFrame & 1)) - continue; - - x = BURN_ENDIAN_SWAP_INT32(spriteram[offs + 2]) & 0xffff; - colour = (x >> 9) & 0x1f; - - pri = x & 0xc000; - - switch (pri & 0xc000) - { - case 0x0000: pri = 0; break; - case 0x4000: pri = 0xf0;break; - case 0x8000: pri = 0; break; - case 0xc000: pri = 0xf0;break; - } - - fx = y & 0x2000; - fy = y & 0x4000; - multi = (1 << ((y & 0x0600) >> 9)) - 1; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - y = 240 - y; - x = 304 - x; - - if (x > 320) continue; - - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (1) - { - y = 240 - y; - x = 304 - x; - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - mult = 16; - } - else mult = -16; - - while (multi >= 0) - { - deco16_draw_prio_sprite(dest, gfx, sprite - multi * inc, (colour<<4)+coloff, x, y + mult * multi, fx, fy, pri); - - multi--; - } - } -} - -static INT32 DrvDraw() -{ - /* - if ((ArmReadByte(0x170784) & 0x20) && !nPreviousDip) { // single screen - bprintf(0, _T("single.\n")); - DrvTmpBitmap0 = pTransDraw; - BurnDrvSetVisibleSize(320, 240); - BurnDrvSetAspect(4, 3); - Reinitialise(); - - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - } else if (!(ArmReadByte(0x170784) & 0x20) && nPreviousDip) { // two screens - bprintf(0, _T("double.\n")); - DrvTmpBitmap0 = DrvTmpBitmap_p; - BurnDrvSetVisibleSize(640, 240); - BurnDrvSetAspect(8, 3); - Reinitialise(); - - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - }*/ - nPreviousDip = (ArmReadByte(0x170784) & 0x20); - - simpl156_palette_recalc(); - - deco16_pf12_update(); - deco16_pf34_update(); - - if (nPreviousDip == 0) nScreenWidth = 320; - - // left - { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - DrvTmpBitmap0[i] = 0x100; - } - - deco16_clear_prio_map(); - - if (priority[0] == 0) { - deco16_draw_layer(2, DrvTmpBitmap0, 1); - deco16_draw_layer(0, DrvTmpBitmap0, 2); - } else if (priority[0] == 2) { - deco16_draw_layer(0, DrvTmpBitmap0, 2); - deco16_draw_layer(2, DrvTmpBitmap0, 4); - } - - draw_sprites(DrvTmpBitmap0, DrvSprRAM0, DrvGfxROM3, 0x200); - } - - // right - if (nPreviousDip == 0) { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - DrvTmpBitmap1[i] = 0x500; - } - - deco16_clear_prio_map(); - - if (priority[1] == 0) { - deco16_draw_layer(3, DrvTmpBitmap1, 1); - deco16_draw_layer(1, DrvTmpBitmap1, 2); - } else if (priority[1] == 2) { - deco16_draw_layer(1, DrvTmpBitmap1, 2); - deco16_draw_layer(3, DrvTmpBitmap1, 4); - } - - draw_sprites(DrvTmpBitmap1, DrvSprRAM1, DrvGfxROM3 /*DrvGfxROM4*/, 0x600); - - // combine - - UINT16 *dst0 = pTransDraw; - UINT16 *dst1 = pTransDraw + 320; - UINT16 *src0 = DrvTmpBitmap0; - UINT16 *src1 = DrvTmpBitmap1; - - for (INT32 y = 0; y < nScreenHeight; y++) { - memcpy (dst0, src0, 320 * sizeof(UINT16)); - memcpy (dst1, src1, 320 * sizeof(UINT16)); - - dst0 += 640; - dst1 += 640; - src0 += 320; - src1 += 320; - } - - nScreenWidth = 320 * 2; - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0x00ff; - DrvInputs[1] = 0x00ff; - DrvInputs[2] = 0xffe7; - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[2] |= DrvDips[0] & 0x0008; - - if (DrvDips[0] & 0x80) DrvInputs[1] |= 0x80; - } - - INT32 nTotalCycles = 28000000 / 60; - - ArmOpen(0); - deco16_vblank = 0x10; - ArmRun(nTotalCycles - 2240); - ArmSetIRQLine(ARM_IRQ_LINE, CPU_IRQSTATUS_AUTO); - deco16_vblank = 0x00; - ArmRun(2240); - ArmClose(); - - if (pBurnSoundOut) { - YMZ280BRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ArmScan(nAction); - - YMZ280BScan(); - - deco16Scan(); - } - - return 0; -} - - -// Backfire! (set 1) - -static struct BurnRomInfo backfireRomDesc[] = { - { "ra00-0.2j", 0x080000, 0x790da069, 1 | BRF_PRG | BRF_ESS }, // 0 Arm code (Encrypted) - { "ra01-0.3j", 0x080000, 0x447cb57b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mbz-00.9a", 0x200000, 0x1098d504, 2 | BRF_GRA }, // 2 Characters & tiles - { "mbz-01.10a", 0x200000, 0x19b81e5c, 2 | BRF_GRA }, // 3 - - { "mbz-02.12a", 0x100000, 0x2bd2b0a1, 3 | BRF_GRA }, // 4 Tiles - - { "mbz-03.15a", 0x200000, 0x2e818569, 4 | BRF_GRA }, // 5 Left screen sprites - { "mbz-04.16a", 0x200000, 0x67bdafb1, 4 | BRF_GRA }, // 6 - - { "mbz-03.18a", 0x200000, 0x2e818569, 5 | BRF_GRA }, // 7 Right screen sprites - { "mbz-04.19a", 0x200000, 0x67bdafb1, 5 | BRF_GRA }, // 8 - - { "mbz-05.17l", 0x200000, 0x947c1da6, 6 | BRF_SND }, // 9 YMZ280b Samples - { "mbz-06.19l", 0x080000, 0x4a38c635, 6 | BRF_SND }, // 10 - - { "gal16v8b.6b", 0x000117, 0x00000000, 7 | BRF_NODUMP }, // 11 PLDs - { "gal16v8b.6d", 0x000117, 0x00000000, 7 | BRF_NODUMP }, // 12 - { "gal16v8b.12n", 0x000117, 0x00000000, 7 | BRF_NODUMP }, // 13 -}; - -STD_ROM_PICK(backfire) -STD_ROM_FN(backfire) - -static INT32 backfireInit() -{ - return DrvInit(0xce44); -} - -struct BurnDriver BurnDrvBackfire = { - "backfire", NULL, NULL, NULL, "1995", - "Backfire! (set 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_RACING, 0, - NULL, backfireRomInfo, backfireRomName, NULL, NULL, BackfireInputInfo, BackfireDIPInfo, - backfireInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 640, 240, 8, 3 -}; - - -// Backfire! (set 2) - -static struct BurnRomInfo backfireaRomDesc[] = { - { "rb-00h.h2", 0x080000, 0x60973046, 1 | BRF_PRG | BRF_ESS }, // 0 Arm code (Encrypted) - { "rb-01l.h3", 0x080000, 0x27472f60, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mbz-00.9a", 0x200000, 0x1098d504, 2 | BRF_GRA }, // 2 Characters & tiles - { "mbz-01.10a", 0x200000, 0x19b81e5c, 2 | BRF_GRA }, // 3 - - { "mbz-02.12a", 0x100000, 0x2bd2b0a1, 3 | BRF_GRA }, // 4 Tiles - - { "mbz-03.15a", 0x200000, 0x2e818569, 4 | BRF_GRA }, // 5 Left screen sprites - { "mbz-04.16a", 0x200000, 0x67bdafb1, 4 | BRF_GRA }, // 6 - - { "mbz-03.18a", 0x200000, 0x2e818569, 5 | BRF_GRA }, // 7 Right screen sprites - { "mbz-04.19a", 0x200000, 0x67bdafb1, 5 | BRF_GRA }, // 8 - - { "mbz-05.17l", 0x200000, 0x947c1da6, 6 | BRF_SND }, // 9 YMZ280b Samples - { "mbz-06.19l", 0x080000, 0x4a38c635, 6 | BRF_SND }, // 10 -}; - -STD_ROM_PICK(backfirea) -STD_ROM_FN(backfirea) - -static INT32 backfireaInit() -{ - return DrvInit(0xcee4); -} - -struct BurnDriverD BurnDrvBackfirea = { - "backfirea", "backfire", NULL, NULL, "1995", - "Backfire! (set 2)\0", "Set inputs to \"Joystick\" in test mode", "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_RACING, 0, - NULL, backfireaRomInfo, backfireaRomName, NULL, NULL, BackfireInputInfo, BackfireDIPInfo, - backfireaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 640, 240, 8, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_boogwing.cpp b/jan/src/burn/drv/dataeast/d_boogwing.cpp deleted file mode 100644 index 99c3456d8..000000000 --- a/jan/src/burn/drv/dataeast/d_boogwing.cpp +++ /dev/null @@ -1,1003 +0,0 @@ -// FB Alpha Boogie Wing / Great Ragtime Show driver module -// Based on MAME driver by Bryan McPhail and David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "h6280_intf.h" -#include "deco16ic.h" -#include "deco146.h" -#include "msm6295.h" -#include "burn_ym2151.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KCode; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvGfxROM5; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvHucRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvPalBuf; -static UINT8 *DrvSprBuf; -static UINT8 *DrvSprBuf1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static UINT16 *tempdraw[2]; - -static INT32 DrvOkiBank; - -static struct BurnInputInfo BoogwingInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Boogwing) - -static struct BurnDIPInfo BoogwingDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Continue Coin" }, - {0x14, 0x01, 0x80, 0x80, "Normal Coin Credit" }, - {0x14, 0x01, 0x80, 0x00, "2 Start/1 Continue" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x01, "1" }, - {0x15, 0x01, 0x03, 0x03, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x0c, 0x08, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x04, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x15, 0x01, 0x10, 0x10, "Common" }, - {0x15, 0x01, 0x10, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 2, "Stage Reset" }, - {0x15, 0x01, 0x20, 0x20, "Point of Termination" }, - {0x15, 0x01, 0x20, 0x00, "Beginning of Stage" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Boogwing) - -void __fastcall boogwing_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x220000: - case 0x220001: - deco16_priority = data; - return; - - case 0x240000: - case 0x240001: - memcpy (DrvSprBuf , DrvSprRAM , 0x800); - return; - - case 0x244000: - case 0x244001: - memcpy (DrvSprBuf1, DrvSprRAM1, 0x800); - return; - - case 0x282008: - case 0x282009: - memcpy (DrvPalBuf, DrvPalRAM, 0x2000); - return; - } - - if (address >= 0x24e000 && address <= 0x24efff) { - deco146_104_prot_wb(0, address & 0xfff, data); - } -} - -void __fastcall boogwing_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x260000, data) - deco16_write_control_word(1, address, 0x270000, data) - - switch (address) - { - case 0x220000: - deco16_priority = data; - return; - - case 0x240000: - memcpy (DrvSprBuf , DrvSprRAM , 0x800); - return; - - case 0x244000: - memcpy (DrvSprBuf1, DrvSprRAM1, 0x800); - return; - - case 0x282008: - memcpy (DrvPalBuf, DrvPalRAM, 0x2000); - return; - } - - if (address >= 0x24e000 && address <= 0x24efff) { - deco146_104_prot_ww(0, address & 0xfff, data); - } -} - -UINT8 __fastcall boogwing_main_read_byte(UINT32 address) -{ - if (address >= 0x24e000 && address <= 0x24efff) { - return deco146_104_prot_rb(0, address & 0xfff); - } - - return 0; -} - -UINT16 __fastcall boogwing_main_read_word(UINT32 address) -{ - if (address >= 0x24e000 && address <= 0x24efff) { - return deco146_104_prot_rw(0, address & 0xfff); - } - - return 0; -} - -static INT32 boogwing_bank_callback( const INT32 bank ) -{ - return ((bank >> 4) & 0x7) * 0x1000; -} - -static INT32 boogwing_bank_callback2( const INT32 bank ) -{ - INT32 offset = ((bank >> 4) & 0x7) * 0x1000; - if ((bank & 0xf) == 0xa) offset += 0x800; - - return offset; -} - -static void DrvYM2151WritePort(UINT32, UINT32 data) -{ - MSM6295SetBank(1, DrvSndROM1 + ((data & 0x02) >> 1) * 0x40000, 0, 0x3ffff); - MSM6295SetBank(0, DrvSndROM0 + (data & 1) * 0x40000, 0, 0x3ffff); - DrvOkiBank = data; -} - -static UINT16 inputs_read() -{ - return DrvInputs[0]; -} - -static UINT16 system_read() -{ - return (DrvInputs[1] & 7) | deco16_vblank; -} - -static UINT16 dips_read() -{ - return (DrvDips[1] << 8) | (DrvDips[0] << 0); -} - -static void soundlatch_write(UINT16 data) -{ - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - deco16SoundReset(); - DrvYM2151WritePort(0, 0); - - deco16Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - Drv68KCode = Next; Next += 0x100000; - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROM5 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x400000; - DrvGfxROM3 = Next; Next += 0x800000; - DrvGfxROM4 = Next; Next += 0x800000; - - DrvSndROM0 = Next; Next += 0x080000; - DrvSndROM1 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - tempdraw[0] = (UINT16*)Next; Next += 320 * 240 * sizeof(UINT16); - tempdraw[1] = (UINT16*)Next; Next += 320 * 240 * sizeof(UINT16); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvHucRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x000800; - DrvSprRAM1 = Next; Next += 0x000800; - DrvSprBuf = Next; Next += 0x000800; - DrvSprBuf1 = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x002000; - DrvPalBuf = Next; Next += 0x002000; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - - -static INT32 DrvGfxDecode5bpp() -{ - // actually 5 bits / pixel, but fba doesn't seem to like that... - INT32 Plane[6] = { 0x1800000, 0x1000000, 0x800008, 0x800000, 0x000008, 0x000000 }; - INT32 XOffs[16] = { 32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7, 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp + 0x000000, DrvGfxROM1, 0x200000); - memset (tmp + 0x200000, 0, 0x200000); - memcpy (tmp + 0x200000, DrvGfxROM5, 0x100000); - - GfxDecode(0x4000, 6, 16, 16, Plane, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - for (INT32 i = 0; i < 0x400000; i++) DrvGfxROM1[i] &= 0x1f; - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM5 + 0x000000, 9, 2)) return 1; // skip a byte! - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 13, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000001, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 15, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 16, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 17, 1)) return 1; - - deco56_decrypt_gfx(DrvGfxROM0, 0x020000); - deco56_decrypt_gfx(DrvGfxROM1, 0x300000); - deco56_decrypt_gfx(DrvGfxROM2, 0x200000); - deco56_remap_gfx(DrvGfxROM5, 0x100000); - deco102_decrypt_cpu(Drv68KROM, Drv68KCode, 0x100000, 0x42ba, 0x00, 0x18); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x020000, 1); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x200000, 0); - deco16_sprite_decode(DrvGfxROM3, 0x400000); - deco16_sprite_decode(DrvGfxROM4, 0x400000); - - DrvGfxDecode5bpp(); - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x20000 * 2, DrvGfxROM1, 0x200000 * 2, DrvGfxROM2, 0x200000 * 2); - deco16_set_color_base(1, 0x100); - deco16_set_color_base(2, 0x300); - deco16_set_color_base(3, 0x400); - deco16_set_global_offsets(0, 8); - deco16_set_transparency_mask(1, 0x1f); - deco16_set_color_mask(2, 0x1f); - deco16_set_color_mask(3, 0x1f); - deco16_set_bank_callback(1, boogwing_bank_callback); - deco16_set_bank_callback(2, boogwing_bank_callback2); - deco16_set_bank_callback(3, boogwing_bank_callback2); - - // 146_104 prot - deco_104_init(); - deco_146_104_set_port_a_cb(inputs_read); // inputs - deco_146_104_set_port_b_cb(system_read); // system - deco_146_104_set_port_c_cb(dips_read); // dips - deco_146_104_set_soundlatch_cb(soundlatch_write); - deco_146_104_set_interface_scramble_reverse(); - deco_146_104_set_use_magic_read_address_xor(1); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(Drv68KCode, 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x242000, 0x2427ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0x246000, 0x2467ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x264000, 0x265fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x266000, 0x267fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x268000, 0x268fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x26a000, 0x26afff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x274000, 0x275fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x276000, 0x277fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x278000, 0x278fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x27a000, 0x27afff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x284000, 0x285fff, MAP_RAM); - SekSetWriteWordHandler(0, boogwing_main_write_word); - SekSetWriteByteHandler(0, boogwing_main_write_byte); - SekSetReadWordHandler(0, boogwing_main_read_word); - SekSetReadByteHandler(0, boogwing_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 0, DrvYM2151WritePort, 0.80, 1006875, 1.40, 2013750, 0.30); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.80, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.80, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - deco16SoundExit(); - - SekExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites(UINT8 *ram, UINT8 *gfx, INT32 coloff, INT32 gfx_region, INT32 bpp) -{ - if (bpp != (nBurnBpp & 4)) return; - - UINT16 *spriteram_base = (UINT16*)ram; - - INT32 colmask = (gfx_region == 4) ? 0x0f : 0x1f; - - INT32 sflipscreen = !*flipscreen; - INT32 priority = deco16_priority; - - for (INT32 offs = 0x400 - 4; offs >= 0; offs -= 4) - { - INT32 inc, mult, pri = 0, spri = 0, alpha = 0xff; - - INT32 sprite = BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 1]); - - if (!sprite) continue; - - INT32 y = BURN_ENDIAN_SWAP_INT16(spriteram_base[offs]); - - if ((y & 0x1000) && (nCurrentFrame & 1)) - continue; - - INT32 x = BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]); - INT32 colour = (x >> 9) & colmask; - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi = (1 << ((y & 0x0600) >> 9)) - 1; - - if (gfx_region == 4) - { - if ((BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0xc000) == 0xc000) - spri = 4; - else if ((BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0xc000)) - spri = 16; - else - spri = 64; - - if (BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0x2000) alpha = 0x80; - - if (priority == 0x2) - { - if (BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0x8000) alpha = 0x80; - - if ((BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0xc000) == 0xc000) - pri = 4; - else if ((BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0xc000) == 0x8000) - pri = 16; - else - pri = 64; - } - else - { - if ((BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0x8000) == 0x8000) - pri = 16; - else - pri = 64; - } - } - else - { - if (BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0x8000) - spri = 8; - else - spri = 32; - - if (priority == 0x1) - { - if ((BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0xc000)) - pri = 16; - else - pri = 64; - } - else - { - if ((BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0xc000) == 0xc000) - pri = 4; - else if ((BURN_ENDIAN_SWAP_INT16(spriteram_base[offs + 2]) & 0xc000) == 0x8000) - pri = 16; - else - pri = 64; - } - } - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - y = 240 - y; - x = 304 - x; - - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (sflipscreen) - { - y = 240 - y; - x = 304 - x; - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - mult = 16; - } - else - mult = -16; - - while (multi >= 0) - { - if (!bpp) { - deco16_draw_prio_sprite(pTransDraw, gfx, sprite - multi * inc, (colour << 4) + coloff, x, y + mult * multi, fx, fy, pri, spri); - } else { - deco16_draw_alphaprio_sprite(DrvPalette, gfx, sprite - multi * inc, (colour << 4) + coloff, x, y + mult * multi, fx, fy, pri, spri, alpha); - } - - multi--; - } - } -} - -static void draw_combined_playfield(INT32 color, INT32 priority) // opaque -{ - UINT16 *src0 = tempdraw[0]; - UINT16 *src1 = tempdraw[1]; - UINT16 *dest = pTransDraw; - UINT8 *prio = deco16_prio_map; - - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = 0; x < nScreenWidth; x++) { - dest[x] = color | (src0[x] & 0x0f) | ((src1[x] & 0x0f) << 4); - prio[x] = priority; - } - src0 += nScreenWidth; - src1 += nScreenWidth; - dest += nScreenWidth; - prio += 512; - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalBuf); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x400; - } - - if ((deco16_priority & 0x07) == 0x05) { - UINT8 *tptr = deco16_pf_rowscroll[3]; - deco16_pf_rowscroll[3] = deco16_pf_rowscroll[2]; - - deco16_draw_layer(2, tempdraw[0], 0x10000); - deco16_draw_layer(3, tempdraw[1], 0x10000); - - deco16_pf_rowscroll[3] = tptr; - } - - deco16_clear_prio_map(); - - INT32 bpp0 = (deco16_get_tilemap_size(0) == 1) ? DECO16_LAYER_5BITSPERPIXEL : DECO16_LAYER_4BITSPERPIXEL; - INT32 bpp1 = (deco16_get_tilemap_size(1) == 1) ? DECO16_LAYER_5BITSPERPIXEL : DECO16_LAYER_4BITSPERPIXEL; - - switch (deco16_priority & 0x07) - { - case 0x01: - case 0x02: - if (nSpriteEnable & 4) deco16_draw_layer(3, pTransDraw, DECO16_LAYER_PRIORITY(0x00) | DECO16_LAYER_OPAQUE); - if (nSpriteEnable & 1) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x08) | bpp1); - if (nSpriteEnable & 2) deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x20)); - break; - - case 0x03: - if (nSpriteEnable & 4) deco16_draw_layer(3, pTransDraw, DECO16_LAYER_PRIORITY(0x00) | DECO16_LAYER_OPAQUE); - if (nSpriteEnable & 1) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x08) | bpp1); - // should use pf2 to add shadows... - break; - - case 0x05: - if (nSpriteEnable & 1) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x00) | DECO16_LAYER_OPAQUE); - if (nSpriteEnable &16) draw_combined_playfield(0x300, DECO16_LAYER_PRIORITY(0x20)); - break; - - case 0x00: - case 0x04: - case 0x06: - case 0x07: - if (nSpriteEnable & 4) deco16_draw_layer(3, pTransDraw, DECO16_LAYER_PRIORITY(0x00) | DECO16_LAYER_OPAQUE); - if (nSpriteEnable & 2) deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x08)); - if (nSpriteEnable & 1) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x20) | bpp1); - break; - } - - draw_sprites(DrvSprBuf , DrvGfxROM3, 0x500, 3, 0); - draw_sprites(DrvSprBuf1, DrvGfxROM4, 0x700, 4, 0); - - if (nSpriteEnable & 8) deco16_draw_layer(0, pTransDraw, DECO16_LAYER_PRIORITY(0xff) | bpp0); - - BurnTransferCopy(DrvPalette); - - draw_sprites(DrvSprBuf , DrvGfxROM3, 0x500, 3, 4); - draw_sprites(DrvSprBuf1, DrvGfxROM4, 0x700, 4, 4); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14000000 / 58, 8055000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += h6280Run(nCyclesTotal[1] / nInterleave); - - if (i == 248) { - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - deco16_vblank = 0x08; - } - - if (pBurnSoundOut && i%8 == 7) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - - SCAN_VAR(DrvOkiBank); - - DrvYM2151WritePort(0, DrvOkiBank); - } - - return 0; -} - - -// Boogie Wings (Euro v1.5, 92.12.07) - -static struct BurnRomInfo boogwingRomDesc[] = { - { "kn_00-2.2b", 0x040000, 0xe38892b9, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "kn_02-2.2e", 0x040000, 0x8426efef, 1 | BRF_PRG | BRF_ESS }, // 1 - { "kn_01-2.4b", 0x040000, 0x3ad4b54c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "kn_03-2.4e", 0x040000, 0x10b61f4a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "km06.18p", 0x010000, 0x3e8bc4e1, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "km05.9e", 0x010000, 0xd10aef95, 3 | BRF_GRA }, // 5 Characters - { "km04.8e", 0x010000, 0x329323a8, 3 | BRF_GRA }, // 6 - - { "mbd-01.9b", 0x100000, 0xd7de4f4b, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mbd-00.8b", 0x100000, 0xadb20ba9, 4 | BRF_GRA }, // 8 - { "mbd-02.10e", 0x080000, 0xb25aa721, 8 | BRF_GRA }, // 9 - - { "mbd-03.13b", 0x100000, 0xcf798f2c, 5 | BRF_GRA }, // 10 Background Tiles - { "mbd-04.14b", 0x100000, 0xd9764d0b, 5 | BRF_GRA }, // 11 - - { "mbd-05.16b", 0x200000, 0x1768c66a, 6 | BRF_GRA }, // 12 Sprite Bank A - { "mbd-06.17b", 0x200000, 0x7750847a, 6 | BRF_GRA }, // 13 - - { "mbd-07.18b", 0x200000, 0x241faac1, 7 | BRF_GRA }, // 14 Sprite Bank B - { "mbd-08.19b", 0x200000, 0xf13b1e56, 7 | BRF_GRA }, // 15 - - { "mbd-10.17p", 0x080000, 0xf159f76a, 9 | BRF_SND }, // 16 OKI M6295 Samples 0 - { "mbd-09.16p", 0x080000, 0xf44f2f87, 10 | BRF_SND }, // 17 OKI M6295 Samples 1 - - { "kj-00.15n", 0x000400, 0xadd4d50b, 11 | BRF_OPT }, // 18 Unknown PROMs -}; - -STD_ROM_PICK(boogwing) -STD_ROM_FN(boogwing) - -struct BurnDriver BurnDrvBoogwing = { - "boogwing", NULL, NULL, NULL, "1992", - "Boogie Wings (Euro v1.5, 92.12.07)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, boogwingRomInfo, boogwingRomName, NULL, NULL, BoogwingInputInfo, BoogwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Boogie Wings (USA v1.7, 92.12.14) - -static struct BurnRomInfo boogwinguRomDesc[] = { - { "kl_00.2b", 0x040000, 0x4dc14798, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "kl_02.2e", 0x040000, 0x3bb3b0a0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "kl_01.4b", 0x040000, 0xd109ba13, 1 | BRF_PRG | BRF_ESS }, // 2 - { "kl_03.4e", 0x040000, 0xfef2a176, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "kl06.18p", 0x010000, 0x3e8bc4e1, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "kl05.9e", 0x010000, 0xd10aef95, 3 | BRF_GRA }, // 5 Characters - { "kl04.8e", 0x010000, 0x329323a8, 3 | BRF_GRA }, // 6 - - { "mbd-01.9b", 0x100000, 0xd7de4f4b, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mbd-00.8b", 0x100000, 0xadb20ba9, 4 | BRF_GRA }, // 8 - { "mbd-02.10e", 0x080000, 0xb25aa721, 4 | BRF_GRA }, // 9 - - { "mbd-03.13b", 0x100000, 0xcf798f2c, 5 | BRF_GRA }, // 10 Background Tiles - { "mbd-04.14b", 0x100000, 0xd9764d0b, 5 | BRF_GRA }, // 11 - - { "mbd-05.16b", 0x200000, 0x1768c66a, 6 | BRF_GRA }, // 12 Sprite Bank A - { "mbd-06.17b", 0x200000, 0x7750847a, 6 | BRF_GRA }, // 13 - - { "mbd-07.18b", 0x200000, 0x241faac1, 7 | BRF_GRA }, // 14 Sprite Bank B - { "mbd-08.19b", 0x200000, 0xf13b1e56, 7 | BRF_GRA }, // 15 - - { "mbd-10.17p", 0x080000, 0xf159f76a, 8 | BRF_SND }, // 16 OKI M6295 Samples 0 - { "mbd-09.16p", 0x080000, 0xf44f2f87, 9 | BRF_SND }, // 17 OKI M6295 Samples 1 - - { "kj-00.15n", 0x000400, 0xadd4d50b, 10 | BRF_OPT }, // 18 Unknown PROMs -}; - -STD_ROM_PICK(boogwingu) -STD_ROM_FN(boogwingu) - -struct BurnDriver BurnDrvBoogwingu = { - "boogwingu", "boogwing", NULL, NULL, "1992", - "Boogie Wings (USA v1.7, 92.12.14)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, boogwinguRomInfo, boogwinguRomName, NULL, NULL, BoogwingInputInfo, BoogwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Boogie Wings (Asia v1.5, 92.12.07) - -static struct BurnRomInfo boogwingaRomDesc[] = { - { "km_00-2.2b", 0x040000, 0x71ab71c6, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "km_02-2.2e", 0x040000, 0xe90f07f9, 1 | BRF_PRG | BRF_ESS }, // 1 - { "km_01-2.4b", 0x040000, 0x7fdce2d3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "km_03-2.4e", 0x040000, 0x0b582de3, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "km06.18p", 0x010000, 0x3e8bc4e1, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "km05.9e", 0x010000, 0xd10aef95, 3 | BRF_GRA }, // 5 Characters - { "km04.8e", 0x010000, 0x329323a8, 3 | BRF_GRA }, // 6 - - { "mbd-01.9b", 0x100000, 0xd7de4f4b, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mbd-00.8b", 0x100000, 0xadb20ba9, 4 | BRF_GRA }, // 8 - { "mbd-02.10e", 0x080000, 0xb25aa721, 4 | BRF_GRA }, // 9 - - { "mbd-03.13b", 0x100000, 0xcf798f2c, 5 | BRF_GRA }, // 10 Background Tiles - { "mbd-04.14b", 0x100000, 0xd9764d0b, 5 | BRF_GRA }, // 11 - - { "mbd-05.16b", 0x200000, 0x1768c66a, 6 | BRF_GRA }, // 12 Sprite Bank A - { "mbd-06.17b", 0x200000, 0x7750847a, 6 | BRF_GRA }, // 13 - - { "mbd-07.18b", 0x200000, 0x241faac1, 7 | BRF_GRA }, // 14 Sprite Bank B - { "mbd-08.19b", 0x200000, 0xf13b1e56, 7 | BRF_GRA }, // 15 - - { "mbd-10.17p", 0x080000, 0xf159f76a, 8 | BRF_SND }, // 16 OKI M6295 Samples 0 - { "mbd-09.16p", 0x080000, 0xf44f2f87, 9 | BRF_SND }, // 17 OKI M6295 Samples 1 - - { "kj-00.15n", 0x000400, 0xadd4d50b, 10 | BRF_OPT }, // 18 Unknown PROMs -}; - -STD_ROM_PICK(boogwinga) -STD_ROM_FN(boogwinga) - -struct BurnDriver BurnDrvBoogwinga = { - "boogwinga", "boogwing", NULL, NULL, "1992", - "Boogie Wings (Asia v1.5, 92.12.07)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, boogwingaRomInfo, boogwingaRomName, NULL, NULL, BoogwingInputInfo, BoogwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// The Great Ragtime Show (Japan v1.5, 92.12.07) - -static struct BurnRomInfo ragtimeRomDesc[] = { - { "kh_00-2.2b", 0x040000, 0x553e179f, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "kh_02-2.2e", 0x040000, 0x6c759ec0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "kh_01-2.4b", 0x040000, 0x12dfee70, 1 | BRF_PRG | BRF_ESS }, // 2 - { "kh_03-2.4e", 0x040000, 0x076fea18, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "km06.18p", 0x010000, 0x3e8bc4e1, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "km05.9e", 0x010000, 0xd10aef95, 3 | BRF_GRA }, // 5 Characters - { "km04.8e", 0x010000, 0x329323a8, 3 | BRF_GRA }, // 6 - - { "mbd-01.9b", 0x100000, 0xd7de4f4b, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mbd-00.8b", 0x100000, 0xadb20ba9, 4 | BRF_GRA }, // 8 - { "mbd-02.10e", 0x080000, 0xb25aa721, 8 | BRF_GRA }, // 9 - - { "mbd-03.13b", 0x100000, 0xcf798f2c, 5 | BRF_GRA }, // 10 Background Tiles - { "mbd-04.14b", 0x100000, 0xd9764d0b, 5 | BRF_GRA }, // 11 - - { "mbd-05.16b", 0x200000, 0x1768c66a, 6 | BRF_GRA }, // 12 Sprite Bank A - { "mbd-06.17b", 0x200000, 0x7750847a, 6 | BRF_GRA }, // 13 - - { "mbd-07.18b", 0x200000, 0x241faac1, 7 | BRF_GRA }, // 14 Sprite Bank B - { "mbd-08.19b", 0x200000, 0xf13b1e56, 7 | BRF_GRA }, // 15 - - { "mbd-10.17p", 0x080000, 0xf159f76a, 9 | BRF_SND }, // 16 OKI M6295 Samples 0 - { "mbd-09.16p", 0x080000, 0xf44f2f87, 10 | BRF_SND }, // 17 OKI M6295 Samples 1 - - { "kj-00.15n", 0x000400, 0xadd4d50b, 11 | BRF_OPT }, // 18 Unknown PROMs -}; - -STD_ROM_PICK(ragtime) -STD_ROM_FN(ragtime) - -struct BurnDriver BurnDrvRagtime = { - "ragtime", "boogwing", NULL, NULL, "1992", - "The Great Ragtime Show (Japan v1.5, 92.12.07)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, ragtimeRomInfo, ragtimeRomName, NULL, NULL, BoogwingInputInfo, BoogwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// The Great Ragtime Show (Japan v1.3, 92.11.26) - -static struct BurnRomInfo ragtimeaRomDesc[] = { - { "kh_00-1.2b", 0x040000, 0x88f0155a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "kh_02-1.2e", 0x040000, 0x8811b41b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "kh_01-1.4b", 0x040000, 0x4dab63ad, 1 | BRF_PRG | BRF_ESS }, // 2 - { "kh_03-1.4e", 0x040000, 0x8a4cbb18, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "km06.18p", 0x010000, 0x3e8bc4e1, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "km05.9e", 0x010000, 0xd10aef95, 3 | BRF_GRA }, // 5 Characters - { "km04.8e", 0x010000, 0x329323a8, 3 | BRF_GRA }, // 6 - - { "mbd-01.9b", 0x100000, 0xd7de4f4b, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mbd-00.8b", 0x100000, 0xadb20ba9, 4 | BRF_GRA }, // 8 - { "mbd-02.10e", 0x080000, 0xb25aa721, 8 | BRF_GRA }, // 9 - - { "mbd-03.13b", 0x100000, 0xcf798f2c, 5 | BRF_GRA }, // 10 Background Tiles - { "mbd-04.14b", 0x100000, 0xd9764d0b, 5 | BRF_GRA }, // 11 - - { "mbd-05.16b", 0x200000, 0x1768c66a, 6 | BRF_GRA }, // 12 Sprite Bank A - { "mbd-06.17b", 0x200000, 0x7750847a, 6 | BRF_GRA }, // 13 - - { "mbd-07.18b", 0x200000, 0x241faac1, 7 | BRF_GRA }, // 14 Sprite Bank B - { "mbd-08.19b", 0x200000, 0xf13b1e56, 7 | BRF_GRA }, // 15 - - { "mbd-10.17p", 0x080000, 0xf159f76a, 9 | BRF_SND }, // 16 OKI M6295 Samples 0 - { "mbd-09.16p", 0x080000, 0xf44f2f87, 10 | BRF_SND }, // 17 OKI M6295 Samples 1 - - { "kj-00.15n", 0x000400, 0xadd4d50b, 11 | BRF_OPT }, // 18 Unknown PROMs -}; - -STD_ROM_PICK(ragtimea) -STD_ROM_FN(ragtimea) - -struct BurnDriver BurnDrvRagtimea = { - "ragtimea", "boogwing", NULL, NULL, "1992", - "The Great Ragtime Show (Japan v1.3, 92.11.26)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, ragtimeaRomInfo, ragtimeaRomName, NULL, NULL, BoogwingInputInfo, BoogwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_brkthru.cpp b/jan/src/burn/drv/dataeast/d_brkthru.cpp deleted file mode 100644 index 8b77a8957..000000000 --- a/jan/src/burn/drv/dataeast/d_brkthru.cpp +++ /dev/null @@ -1,931 +0,0 @@ -// FB Alpha Break Thru driver module -// Based on MAME driver by Phil Stroffolino - -// Tofix: -// background layer in Breakthru has the wrong colors. - -// Notes: -// Due to our 6809 core being very cycle-inaccurate, our cpu's need an extra -// 1.5mhz tacked on to match the same performance as MAME running the same -// game. Todo: remove o/c when core is updated. - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "burn_ym2203.h" -#include "burn_ym3526.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvM6809RAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 flipscreen; -static UINT16 bgscroll; -static UINT8 bgbasecolor; -static UINT8 soundlatch; -static INT32 rombank; -static UINT8 nmi_mask; -static UINT8 vblank; -static UINT8 prevcoin; - -static INT32 darwin = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo BrkthruInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Brkthru) - - -static struct BurnDIPInfo BrkthruDIPList[]= -{ - {0x12, 0xff, 0xff, 0x3f, NULL }, - {0x13, 0xff, 0xff, 0x1f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Enemy Vehicles" }, - {0x12, 0x01, 0x10, 0x10, "Slow" }, - {0x12, 0x01, 0x10, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2, "Enemy Bullets" }, - {0x12, 0x01, 0x20, 0x20, "Slow" }, - {0x12, 0x01, 0x20, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2, "Control Panel" }, - {0x12, 0x01, 0x40, 0x40, "1 Player" }, - {0x12, 0x01, 0x40, 0x00, "2 Players" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "99 (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x00, "20000 Points Only" }, - {0x13, 0x01, 0x0c, 0x04, "10000/20000 Points" }, - {0x13, 0x01, 0x0c, 0x0c, "20000/30000 Points" }, - {0x13, 0x01, 0x0c, 0x08, "20000/40000 Points" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x10, 0x00, "No" }, - {0x13, 0x01, 0x10, 0x10, "Yes" }, -}; - -STDDIPINFO(Brkthru) - - -static struct BurnDIPInfo BrkthrujDIPList[]= -{ - {0x12, 0xff, 0xff, 0x3f, NULL }, - {0x13, 0xff, 0xff, 0x1f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Enemy Vehicles" }, - {0x12, 0x01, 0x10, 0x10, "Slow" }, - {0x12, 0x01, 0x10, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2, "Enemy Bullets" }, - {0x12, 0x01, 0x20, 0x20, "Slow" }, - {0x12, 0x01, 0x20, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2, "Control Panel" }, - {0x12, 0x01, 0x40, 0x40, "1 Player" }, - {0x12, 0x01, 0x40, 0x00, "2 Players" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "99 (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x00, "20000 Points Only" }, - {0x13, 0x01, 0x0c, 0x04, "10000/20000 Points" }, - {0x13, 0x01, 0x0c, 0x0c, "20000/30000 Points" }, - {0x13, 0x01, 0x0c, 0x08, "20000/40000 Points" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, -}; - -STDDIPINFO(Brkthruj) - -static struct BurnDIPInfo DarwinDIPList[]= -{ - {0x12, 0xff, 0xff, 0x4f, NULL }, - {0x13, 0xff, 0xff, 0x1f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x20, 0x00, "Upright" }, - {0x12, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x01, 0x01, "3" }, - {0x13, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x13, 0x01, 0x02, 0x02, "20k, 50k and every 50k"}, - {0x13, 0x01, 0x02, 0x00, "30k, 80k and every 80k"}, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x0c, "Easy" }, - {0x13, 0x01, 0x0c, 0x08, "Medium" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x10, 0x00, "No" }, - {0x13, 0x01, 0x10, 0x10, "Yes" }, -}; - -STDDIPINFO(Darwin) - -static void bankswitch(INT32 data) -{ - rombank = data & 7; - INT32 bank = 0x10000 + rombank * 0x2000; - - M6809MapMemory(DrvM6809ROM0 + bank, 0x2000, 0x3fff, MAP_ROM); -} - -static void brkthru_main_write(UINT16 address, UINT8 data) -{ - switch (address & ~0x1000) - { - case 0x0800: - bgscroll = data | (bgscroll & 0x100); - return; - - case 0x0801: - { - bankswitch(data & 7); - bgbasecolor = (data >> 2) & 0x0e; - flipscreen = data & 0x40; - bgscroll = ((data & 0x80) << 1) | (bgscroll & 0xff); - } - return; - - case 0x0802: - soundlatch = data; - M6809Close(); - M6809Open(1); - M6809SetIRQLine(0x20, CPU_IRQSTATUS_ACK); - M6809Close(); - M6809Open(0); - return; - - case 0x0803: - if (data & 0x02) M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - //nmi_mask = (~data & 1) ^ ((address & 0x800) >> 11); grr. - if (address == 0x803) nmi_mask = data & 1; else nmi_mask = ~data & 1; - //bprintf(0, _T("nmi mask %X. address %X\n"), nmi_mask, address); - return; - } -} - -static UINT8 brkthru_main_read(UINT16 address) -{ - switch (address & ~0x1000) - { - case 0x0800: - return DrvInputs[0]; - - case 0x0801: - return (DrvInputs[1] & 0x7f) | (vblank ? 0 : 0x80); - - case 0x0802: - return DrvDips[0]; - - case 0x0803: - return (DrvDips[1] & 0x1f) | (DrvInputs[2] & 0xe0); - } - - return 0; -} - -static void brkthru_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - case 0x2001: - BurnYM3526Write(address & 1, data); - return; - - case 0x6000: - case 0x6001: - BurnYM2203Write(0, address & 1, data); - return; - } -} - -static UINT8 brkthru_sound_read(UINT16 address) -{ - switch (address) - { - case 0x4000: - M6809SetIRQLine(0x20, CPU_IRQSTATUS_NONE); - - return soundlatch; - - case 0x6000: - case 0x6001: - return BurnYM2203Read(0, address & 1); - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - M6809SetIRQLine(M6809_IRQ_LINE, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static double DrvGetTime() -{ - return (double)M6809TotalCycles() / (1500000*2); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / (1500000*2); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - bankswitch(0); - M6809Reset(); - BurnYM3526Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - BurnYM2203Reset(); - M6809Close(); - - DrvInputs[2] = 0xff; - bgscroll = 0; - soundlatch = 0; - flipscreen = 0; - nmi_mask = 0; - bgbasecolor = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x020000; - DrvM6809ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x004000; - DrvGfxROM1 = Next; Next += 0x040000; - DrvGfxROM2 = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x000400; - DrvFgRAM = Next; Next += 0x000c00; - DrvM6809RAM1 = Next; Next += 0x002000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { 0x8004, 0, 4 }; - INT32 XOffs0[8] = { 256*8*8+0, 256*8*8+1, 256*8*8+2, 256*8*8+3, 0, 1, 2, 3 };//STEP4(0x4000, 1), STEP4(0,1) }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 };//STEP16(0,8) }; - - INT32 Plane1[3] = { 0x20004, 0, 4 }; - INT32 Plane2[3] = { 0x18000, 0, 4 }; - INT32 XOffs1[16] = { 0, 1, 2, 3, 1024*8*8+0, 1024*8*8+1, 1024*8*8+2, 1024*8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+1024*8*8+0, 16*8+1024*8*8+1, 16*8+1024*8*8+2, 16*8+1024*8*8+3 };//STEP4(0,1), STEP4(0x10000,1), STEP4(0x80,1), STEP4(0x10080, 1) }; - - INT32 Plane3[3] = { 0x80000, 0x40000, 0 }; - INT32 XOffs3[16] = { 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7, 0, 1, 2, 3, 4, 5, 6, 7 };//STEP8(128,1), STEP8(0,1) }; - - - UINT8 *tmp = (UINT8*)BurnMalloc(0x60000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0100, 3, 8, 8, Plane0, XOffs0, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x20000); - - GfxDecode(0x0080, 3, 16, 16, Plane1, XOffs1, YOffs, 0x100, tmp + 0x00000, DrvGfxROM1 + 0x00000); - GfxDecode(0x0080, 3, 16, 16, Plane2, XOffs1, YOffs, 0x100, tmp + 0x01000, DrvGfxROM1 + 0x08000); - GfxDecode(0x0080, 3, 16, 16, Plane1, XOffs1, YOffs, 0x100, tmp + 0x08000, DrvGfxROM1 + 0x10000); - GfxDecode(0x0080, 3, 16, 16, Plane2, XOffs1, YOffs, 0x100, tmp + 0x09000, DrvGfxROM1 + 0x18000); - GfxDecode(0x0080, 3, 16, 16, Plane1, XOffs1, YOffs, 0x100, tmp + 0x10000, DrvGfxROM1 + 0x20000); - GfxDecode(0x0080, 3, 16, 16, Plane2, XOffs1, YOffs, 0x100, tmp + 0x11000, DrvGfxROM1 + 0x28000); - GfxDecode(0x0080, 3, 16, 16, Plane1, XOffs1, YOffs, 0x100, tmp + 0x18000, DrvGfxROM1 + 0x30000); - GfxDecode(0x0080, 3, 16, 16, Plane2, XOffs1, YOffs, 0x100, tmp + 0x19000, DrvGfxROM1 + 0x38000); - - memcpy (tmp, DrvGfxROM2, 0x18000); - - GfxDecode(0x0400, 3, 16, 16, Plane3, XOffs3, YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x04000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x10000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x18000, 3, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 8, 1)) return 1; - - memcpy (DrvGfxROM1 + 0x00000, DrvGfxROM2 + 0x00000, 0x4000); - memcpy (DrvGfxROM1 + 0x08000, DrvGfxROM2 + 0x04000, 0x4000); - memcpy (DrvGfxROM1 + 0x10000, DrvGfxROM2 + 0x08000, 0x4000); - memcpy (DrvGfxROM1 + 0x18000, DrvGfxROM2 + 0x0c000, 0x4000); - memcpy (DrvGfxROM1 + 0x04000, DrvGfxROM2 + 0x10000, 0x1000); - memcpy (DrvGfxROM1 + 0x06000, DrvGfxROM2 + 0x11000, 0x1000); - memcpy (DrvGfxROM1 + 0x0c000, DrvGfxROM2 + 0x12000, 0x1000); - memcpy (DrvGfxROM1 + 0x0e000, DrvGfxROM2 + 0x13000, 0x1000); - memcpy (DrvGfxROM1 + 0x14000, DrvGfxROM2 + 0x14000, 0x1000); - memcpy (DrvGfxROM1 + 0x16000, DrvGfxROM2 + 0x15000, 0x1000); - memcpy (DrvGfxROM1 + 0x1c000, DrvGfxROM2 + 0x16000, 0x1000); - memcpy (DrvGfxROM1 + 0x1e000, DrvGfxROM2 + 0x17000, 0x1000); - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 13, 1)) return 1; - - DrvGfxDecode(); - } - - M6809Init(2); // this init is only called once with the maximum cpus to init. - M6809Open(0); - if (darwin) { - M6809MapMemory(DrvSprRAM, 0x0000, 0x00ff, MAP_RAM); // 0-ff - M6809MapMemory(DrvFgRAM, 0x1000, 0x1bff, MAP_RAM); // 0-3ff - M6809MapMemory(DrvBgRAM, 0x1c00, 0x1fff, MAP_RAM); - } else { - M6809MapMemory(DrvFgRAM, 0x0000, 0x0bff, MAP_RAM); // 0-3ff - M6809MapMemory(DrvBgRAM, 0x0c00, 0x0fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1000, 0x17ff, MAP_RAM); // 0-ff - } - M6809MapMemory(DrvM6809ROM0 + 0x4000, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(brkthru_main_write); - M6809SetReadHandler(brkthru_main_read); - M6809Close(); - - //M6809Init(1); - M6809Open(1); - M6809MapMemory(DrvM6809RAM1, 0x0000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM1 + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(brkthru_sound_write); - M6809SetReadHandler(brkthru_sound_read); - M6809Close(); - - BurnYM2203Init(1, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachM6809(1500000*2); - BurnYM2203SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 0.10); - - BurnYM3526Init(3000000, &DrvFMIRQHandler, &DrvSynchroniseStream, 1); - BurnTimerAttachM6809YM3526(1500000*2); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - darwin = 0; - GenericTilesExit(); - - M6809Exit(); - BurnYM2203Exit(); - BurnYM3526Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - const UINT8 tab[16] = { - 0x00, 0x0e, 0x1f, 0x2d, 0x43, 0x51, 0x62, 0x70, - 0x8f, 0x9d, 0xae, 0xbc, 0xd2, 0xe0, 0xf1, 0xff - }; - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 r = tab[DrvColPROM[i] & 0xf]; - UINT8 g = tab[DrvColPROM[i] >> 4]; - UINT8 b = tab[DrvColPROM[i+0x100] & 0xf]; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sy -= 8; - sx -= 8; - - INT32 code = DrvFgRAM[offs]; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 3, 0, 0, DrvGfxROM0); - } -} - -static void draw_bg_layer(INT32 opaque) -{ - for (INT32 offs = 0; offs < 32 * 16; offs++) - { - INT32 sy = (offs & 0xf) * 16; - INT32 sx = (offs / 0x10) * 16; - - sx -= bgscroll; - sy -= 8; - sx -= 8; - if (sx < -15) sx += 512; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvBgRAM[offs*2+1]; - INT32 code = DrvBgRAM[offs*2] + ((attr & 3) * 256); - INT32 color = ((attr >> 2) & 1)+bgbasecolor; - - if (opaque) { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0x80, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x80, DrvGfxROM1); - } - } -} - -static inline void draw_single_sprite(INT32 code, INT32 sx, INT32 sy, INT32 color) -{ - if (flipscreen) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } -} - -static void draw_sprites(INT32 prio) -{ - for (INT32 offs = 0;offs < 0x100; offs += 4) - { - if ((DrvSprRAM[offs] & 0x01) == 0) continue; - - if (((DrvSprRAM[offs] & 0x08) >> 3) == prio) - { - INT32 sx = 240 - DrvSprRAM[offs + 3]; - sx -= 8; - if (sx < -15) sx += 256; - - INT32 sy = 240 - DrvSprRAM[offs + 2]; - sy -= 8; - INT32 code = DrvSprRAM[offs + 1] + (128 * (DrvSprRAM[offs] & 0x06)); - INT32 color = (DrvSprRAM[offs] & 0xe0) >> 5; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - } - - if (DrvSprRAM[offs] & 0x10) - { - draw_single_sprite(code & ~1, sx, (flipscreen ? sy + 16 : sy - 16), color); - draw_single_sprite(code | 1, sx, sy, color); - - draw_single_sprite(code & ~1, sx, (flipscreen ? sy + 16 : sy - 16) + 256, color); - draw_single_sprite(code | 1, sx, sy + 256, color); - } - else - { - draw_single_sprite(code, sx, sy, color); - draw_single_sprite(code, sx, sy + 256, color); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - if (nBurnLayer & 1) draw_bg_layer(1); - if (nBurnLayer & 2) draw_sprites(0); - if (nBurnLayer & 1) draw_bg_layer(0); - if (nBurnLayer & 2) draw_sprites(1); - if (nBurnLayer & 4) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - if ((prevcoin == 0xff) && (((DrvInputs[2] & 0x20) == 0) || ((DrvInputs[2] & 0x40) == 0))) { // coin! - M6809Open(0); - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - } - prevcoin = DrvInputs[2]; - } - - INT32 nInterleave = 272; - INT32 nCyclesTotal[2] = { 1500000*2 / 60, 1500000*2 / 60 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - BurnTimerUpdate((i+1) * (nCyclesTotal[0] / nInterleave)); - if (i == 248) vblank = 1; - if (i == 248 && nmi_mask) M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - M6809Close(); - - M6809Open(1); - BurnTimerUpdateYM3526((i+1) * (nCyclesTotal[1] / nInterleave)); - M6809Close(); - } - - M6809Open(0); - BurnTimerEndFrame(nCyclesTotal[0]); - M6809Close(); - - M6809Open(1); - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - M6809Close(); - - if (pBurnSoundOut) { - M6809Open(0); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - M6809Close(); - M6809Open(1); - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - M6809Close(); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029706; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - - M6809Open(0); - BurnYM2203Scan(nAction, pnMin); - M6809Close(); - M6809Open(1); - BurnYM3526Scan(nAction, pnMin); - M6809Close(); - - SCAN_VAR(flipscreen); - SCAN_VAR(bgscroll); - SCAN_VAR(bgbasecolor); - SCAN_VAR(soundlatch); - SCAN_VAR(rombank); - SCAN_VAR(nmi_mask); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(rombank); - M6809Close(); - } - - return 0; -} - - -// Break Thru (US) - -static struct BurnRomInfo brkthruRomDesc[] = { - { "brkthru.1", 0x4000, 0xcfb4265f, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "brkthru.2", 0x8000, 0xfa8246d9, 1 | BRF_PRG | BRF_ESS }, // 1 - { "brkthru.4", 0x8000, 0x8cabf252, 1 | BRF_PRG | BRF_ESS }, // 2 - { "brkthru.3", 0x8000, 0x2f2c40c2, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "brkthru.5", 0x8000, 0xc309435f, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - - { "brkthru.12", 0x2000, 0x58c0b29b, 3 | BRF_GRA }, // 5 Characters - - { "brkthru.7", 0x8000, 0x920cc56a, 4 | BRF_GRA }, // 6 Background Layer - { "brkthru.6", 0x8000, 0xfd3cee40, 4 | BRF_GRA }, // 7 - { "brkthru.8", 0x8000, 0xf67ee64e, 4 | BRF_GRA }, // 8 - - { "brkthru.9", 0x8000, 0xf54e50a7, 5 | BRF_GRA }, // 9 Sprites - { "brkthru.10", 0x8000, 0xfd156945, 5 | BRF_GRA }, // 10 - { "brkthru.11", 0x8000, 0xc152a99b, 5 | BRF_GRA }, // 11 - - { "brkthru.13", 0x0100, 0xaae44269, 6 | BRF_GRA }, // 12 Color data - { "brkthru.14", 0x0100, 0xf2d4822a, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(brkthru) -STD_ROM_FN(brkthru) - -struct BurnDriver BurnDrvBrkthru = { - "brkthru", NULL, NULL, NULL, "1986", - "Break Thru (US)\0", NULL, "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, brkthruRomInfo, brkthruRomName, NULL, NULL, BrkthruInputInfo, BrkthruDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 240, 4, 3 -}; - - -// Kyohkoh-Toppa (Japan) - -static struct BurnRomInfo brkthrujRomDesc[] = { - { "1", 0x4000, 0x09bd60ee, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "2", 0x8000, 0xf2b2cd1c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4", 0x8000, 0xb42b3359, 1 | BRF_PRG | BRF_ESS }, // 2 - { "brkthru.3", 0x8000, 0x2f2c40c2, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "brkthru.5", 0x8000, 0xc309435f, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - - { "12", 0x2000, 0x3d9a7003, 3 | BRF_GRA }, // 5 Characters - - { "brkthru.7", 0x8000, 0x920cc56a, 4 | BRF_GRA }, // 6 Background Layer - { "6", 0x8000, 0xcb47b395, 4 | BRF_GRA }, // 7 - { "8", 0x8000, 0x5e5a2cd7, 4 | BRF_GRA }, // 8 - - { "brkthru.9", 0x8000, 0xf54e50a7, 5 | BRF_GRA }, // 9 Sprites - { "brkthru.10", 0x8000, 0xfd156945, 5 | BRF_GRA }, // 10 - { "brkthru.11", 0x8000, 0xc152a99b, 5 | BRF_GRA }, // 11 - - { "brkthru.13", 0x0100, 0xaae44269, 6 | BRF_GRA }, // 12 Color data - { "brkthru.14", 0x0100, 0xf2d4822a, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(brkthruj) -STD_ROM_FN(brkthruj) - -struct BurnDriver BurnDrvBrkthruj = { - "brkthruj", "brkthru", NULL, NULL, "1986", - "Kyohkoh-Toppa (Japan)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, brkthrujRomInfo, brkthrujRomName, NULL, NULL, BrkthruInputInfo, BrkthrujDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 240, 4, 3 -}; - - -// Force Break (bootleg) - -static struct BurnRomInfo forcebrkRomDesc[] = { - { "1", 0x4000, 0x09bd60ee, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "2", 0x8000, 0xf2b2cd1c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "forcebrk4", 0x8000, 0xb4838c19, 1 | BRF_PRG | BRF_ESS }, // 2 - { "brkthru.3", 0x8000, 0x2f2c40c2, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "brkthru.5", 0x8000, 0xc309435f, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - - { "12", 0x2000, 0x3d9a7003, 3 | BRF_GRA }, // 5 Characters - - { "brkthru.7", 0x8000, 0x920cc56a, 4 | BRF_GRA }, // 6 Background Layer - { "forcebrk6", 0x8000, 0x08bca16a, 4 | BRF_GRA }, // 7 - { "forcebrk8", 0x8000, 0xa3a1131e, 4 | BRF_GRA }, // 8 - - { "brkthru.9", 0x8000, 0xf54e50a7, 5 | BRF_GRA }, // 9 Sprites - { "brkthru.10", 0x8000, 0xfd156945, 5 | BRF_GRA }, // 10 - { "brkthru.11", 0x8000, 0xc152a99b, 5 | BRF_GRA }, // 11 - - { "brkthru.13", 0x0100, 0xaae44269, 6 | BRF_GRA }, // 12 Color data - { "brkthru.14", 0x0100, 0xf2d4822a, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(forcebrk) -STD_ROM_FN(forcebrk) - -struct BurnDriver BurnDrvForcebrk = { - "forcebrk", "brkthru", NULL, NULL, "1986", - "Force Break (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, forcebrkRomInfo, forcebrkRomName, NULL, NULL, BrkthruInputInfo, BrkthruDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 240, 4, 3 -}; - - -// Darwin 4078 (Japan) - -static struct BurnRomInfo darwinRomDesc[] = { - { "darw_04.rom", 0x4000, 0x0eabf21c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "darw_05.rom", 0x8000, 0xe771f864, 1 | BRF_PRG | BRF_ESS }, // 1 - { "darw_07.rom", 0x8000, 0x97ac052c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "darw_06.rom", 0x8000, 0x2a9fb208, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "darw_08.rom", 0x8000, 0x6b580d58, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - - { "darw_09.rom", 0x2000, 0x067b4cf5, 3 | BRF_GRA }, // 5 Characters - - { "darw_03.rom", 0x8000, 0x57d0350d, 4 | BRF_GRA }, // 6 Background Layer - { "darw_02.rom", 0x8000, 0x559a71ab, 4 | BRF_GRA }, // 7 - { "darw_01.rom", 0x8000, 0x15a16973, 4 | BRF_GRA }, // 8 - - { "darw_10.rom", 0x8000, 0x487a014c, 5 | BRF_GRA }, // 9 Sprites - { "darw_11.rom", 0x8000, 0x548ce2d1, 5 | BRF_GRA }, // 10 - { "darw_12.rom", 0x8000, 0xfaba5fef, 5 | BRF_GRA }, // 11 - - { "df.12", 0x0100, 0x89b952ef, 6 | BRF_GRA }, // 12 Color data - { "df.13", 0x0100, 0xd595e91d, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(darwin) -STD_ROM_FN(darwin) - -static INT32 darwinInit() -{ - darwin = 1; - return DrvInit(); -} - -struct BurnDriver BurnDrvDarwin = { - "darwin", NULL, NULL, NULL, "1986", - "Darwin 4078 (Japan)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, darwinRomInfo, darwinRomName, NULL, NULL, BrkthruInputInfo, DarwinDIPInfo, - darwinInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 240, 3, 4 -}; diff --git a/jan/src/burn/drv/dataeast/d_bwing.cpp b/jan/src/burn/drv/dataeast/d_bwing.cpp deleted file mode 100644 index c522071cb..000000000 --- a/jan/src/burn/drv/dataeast/d_bwing.cpp +++ /dev/null @@ -1,994 +0,0 @@ -// FB Alpha B-Wing / Zaviga driver module -// Based on MAME driver by Acho A. Tang and Alex W. Jackson - -// Note dac missing output filtering... - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "m6502_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvM6502ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvM6809RAM0; -static UINT8 *DrvM6809RAM1; -static UINT8 *DrvM6502RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 *scroll; - -static UINT8 soundlatch; -static UINT8 nmimask; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[4]; -static UINT8 DrvReset; - -static INT32 vblank; -static INT32 screen_flipx; - -static struct BurnInputInfo BwingInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy4 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bwing) - -static struct BurnDIPInfo BwingDIPList[]= -{ - {0x13, 0xff, 0xff, 0xdf, NULL }, - {0x14, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Diagnostics" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x20, 0x00, "Upright" }, - {0x13, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Invincibility" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Infinite" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x01, 0x00, "5" }, - {0x14, 0x01, 0x01, 0x01, "3" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x06, 0x00, "40000" }, - {0x14, 0x01, 0x06, 0x02, "20000 80000" }, - {0x14, 0x01, 0x06, 0x04, "20000 60000" }, - {0x14, 0x01, 0x06, 0x06, "20000 40000" }, - - {0 , 0xfe, 0 , 2, "Enemy Crafts" }, - {0x14, 0x01, 0x08, 0x00, "Hard" }, - {0x14, 0x01, 0x08, 0x08, "Normal" }, - - {0 , 0xfe, 0 , 2, "Enemy Missiles" }, - {0x14, 0x01, 0x10, 0x00, "Hard" }, - {0x14, 0x01, 0x10, 0x10, "Normal" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Country" }, - {0x14, 0x01, 0x40, 0x00, "Japan/US" }, - {0x14, 0x01, 0x40, 0x40, "Japan Only" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Bwing) - -static void bankswitch(INT32 data) -{ - INT32 bank = (data >> 6) & 3; - - if (bank == 0) - { - M6809MapMemory(DrvFgRAM, 0x2000, 0x2fff, MAP_RAM); - M6809MapMemory(DrvBgRAM, 0x3000, 0x3fff, MAP_RAM); - } - else - { - bank = (bank - 1) * 0x2000; - - M6809MapMemory(DrvGfxRAM + bank, 0x2000, 0x3fff, MAP_RAM); - } -} - -static void control_write(INT32 cpu, INT32 offset) -{ - const INT32 lines[2][3] ={ - { CPU_IRQLINE_IRQ, CPU_IRQLINE_FIRQ, CPU_IRQLINE_NMI }, - { CPU_IRQLINE_FIRQ, CPU_IRQLINE_IRQ, CPU_IRQLINE_NMI } - }; - - switch (offset & 3) - { - case 0: - M6809Close(); - M6809Open(cpu^1); - M6809SetIRQLine(CPU_IRQLINE_IRQ, CPU_IRQSTATUS_ACK); - M6809Close(); - M6809Open(cpu); - return; - - case 1: - case 2: - case 3: - M6809SetIRQLine(lines[cpu][(offset & 3)-1], CPU_IRQSTATUS_NONE); - return; - } -} - -static void bwing_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff00) == 0x1a00) { - DrvPalRAM[(address & 0xff) * 2 + 0] = data; - DrvPalRAM[(address & 0xff) * 2 + 1] = scroll[6]; - return; - } - - switch (address) - { - case 0x1b00: - case 0x1b01: - case 0x1b02: - case 0x1b03: - case 0x1b04: - case 0x1b05: - case 0x1b06: - scroll[address & 7] = data; - return; - - case 0x1b07: - scroll[7] = data; - bankswitch(data); - return; - - case 0x1c00: - case 0x1c01: - case 0x1c02: - case 0x1c03: - control_write(0, address); - return; - - case 0x1c05: - { - if (data == 0x80) { - M6809Close(); - M6809Open(1); - M6809SetIRQLine(CPU_IRQLINE_NMI, CPU_IRQSTATUS_ACK); - M6809Close(); - M6809Open(0); - } else { - soundlatch = data; - M6502SetIRQLine(DECO16_IRQ_LINE, CPU_IRQSTATUS_AUTO); - } - } - return; - - case 0x1c06: // banksel (not used) - case 0x1c07: // swap? - return; - } -} - -static UINT8 bwing_main_read(UINT16 address) -{ - if ((address & 0xff00) == 0x1a00) { - return DrvPalRAM[(address & 0xff) * 2]; - } - - switch (address) - { - case 0x1b00: - return DrvDips[0]; - - case 0x1b01: - return DrvDips[1]; - - case 0x1b02: - return DrvInputs[0]; - - case 0x1b03: - return DrvInputs[1]; - - case 0x1b04: - return (DrvInputs[2] & 0x7f) | (vblank ? 0x80 : 0); - } - - return 0; -} - -static void bwing_sub_write(UINT16 address, UINT8 ) -{ - switch (address) - { - case 0x1800: - case 0x1801: - case 0x1802: - case 0x1803: - control_write(1, address); - return; - } -} - -static UINT8 bwing_sound_read_port(UINT16 port) -{ - switch (port) - { - case 0x0000: - return (vblank ? 0xff : 0); - } - - return 0; -} - -static void bwing_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0200: - DACWrite(0, data); - return; - - case 0x1000: - M6502SetIRQLine(CPU_IRQLINE_NMI, CPU_IRQSTATUS_NONE); - return; - - case 0x2000: - AY8910Write(0, 1, data); - return; - - case 0x4000: - AY8910Write(0, 0, data); - return; - - case 0x6000: - AY8910Write(1, 1, data); - return; - - case 0x8000: - AY8910Write(1, 0, data); - return; - - case 0xd000: - nmimask = data & 0x80; - return; - } -} - -static UINT8 bwing_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return soundlatch; - } - - return 0; -} - -static tilemap_scan( bwing_scan_cols ) -{ - return (row & 0xf) | ((col & 0xf) << 4) | ((row & 0x30) << 4) | ((col & 0x30) << 6); -} - -static tilemap_callback( bglayer ) -{ - TILE_SET_INFO(2, DrvBgRAM[offs] & 0x7f, DrvBgRAM[offs] >> 7, 0); -} - -static tilemap_callback( fglayer ) -{ - TILE_SET_INFO(1, DrvFgRAM[offs] & 0x7f, DrvFgRAM[offs] >> 7, 0); -} - -static tilemap_callback( txlayer ) -{ - TILE_SET_INFO(0, DrvVidRAM[offs], 0, 0); -} - -static INT32 DrvDACSync() -{ - return (INT32)(float)(nBurnSoundLen * (M6502TotalCycles() / (2000000.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - memset (DrvInputs, 0xff, 4); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - M6809Close(); - - M6502Open(0); - M6502Reset(); - DACReset(); - M6502Close(); - - AY8910Reset(0); - AY8910Reset(1); - - soundlatch = 0; - nmimask = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x00c000; - DrvM6809ROM1 = Next; Next += 0x006000; - DrvM6502ROM = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x004000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x0041 * sizeof(UINT32); - - AllRam = Next; - - DrvFgRAM = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x001000; - DrvGfxRAM = Next; Next += 0x006000; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000200; - DrvPalRAM = Next; Next += 0x000200; - DrvShareRAM = Next; Next += 0x000800; - DrvM6809RAM0 = Next; Next += 0x000800; - DrvM6809RAM1 = Next; Next += 0x000800; - DrvM6502RAM = Next; Next += 0x000200; - - scroll = Next; Next += 0x000008; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0, 0x800*8 }; - INT32 Plane1[3] = { (0x4000*8*2), (0x4000*8*1), 0 }; - INT32 XOffs[16] = { STEP8(7,-1), STEP8(128+7, -1) }; - INT32 YOffs[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x1000); - - GfxDecode(0x0100, 2, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0xc000); - - GfxDecode(0x0200, 3, 16, 16, Plane1, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static void DrvSoundRomDecode() -{ - for (INT32 i = 0; i < 0x2000; i++) { // Swap nibbles - DrvM6502ROM[i] = (DrvM6502ROM[i] << 4) | (DrvM6502ROM[i] >> 4); - } - - // Move vectors to correct position. Weird! - DrvM6502ROM[0x1ff4] = DrvM6502ROM[0x1ffb] = DrvM6502ROM[0x1ff6]; - DrvM6502ROM[0x1ff5] = DrvM6502ROM[0x1ffa] = DrvM6502ROM[0x1ff7]; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x8000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM1 + 0x2000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM1 + 0x4000, 5, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x0000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x8000, 10, 1)) return 1; - - DrvSoundRomDecode(); - DrvGfxDecode(); - } - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvShareRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvM6809RAM0, 0x0800, 0x0fff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x1000, 0x17ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1800, 0x19ff, MAP_RAM); -// M6809MapMemory(DrvPalRAM, 0x1a00, 0x1aff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(bwing_main_write); - M6809SetReadHandler(bwing_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvShareRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvM6809RAM1, 0x0800, 0x0fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM1, 0xa000, 0xffff, MAP_ROM); - M6809SetWriteHandler(bwing_sub_write); - M6809Close(); - - M6502Init(0, TYPE_DECO16); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM, 0xe000, 0xffff, MAP_ROM); - M6502SetWriteHandler(bwing_sound_write); - M6502SetReadHandler(bwing_sound_read); - M6502SetReadPortHandler(bwing_sound_read_port); - M6502Close(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvDACSync); - DACSetRoute(0, 0.10, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - GenericTilemapInit(0, bwing_scan_cols_map_scan, bglayer_map_callback, 16, 16, 64, 64); - GenericTilemapInit(1, bwing_scan_cols_map_scan, fglayer_map_callback, 16, 16, 64, 64); - GenericTilemapInit(2, scan_cols_map_scan, txlayer_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x04000, 0x00, 0); - GenericTilemapSetGfx(1, DrvGfxROM2 + 0x00000, 3, 16, 16, 0x8000, 0x10, 1); - GenericTilemapSetGfx(2, DrvGfxROM2 + 0x08000, 3, 16, 16, 0x8000, 0x30, 1); - GenericTilemapSetOffsets(0, 0, -8); - GenericTilemapSetOffsets(1, 0, -8); - GenericTilemapSetOffsets(2, 0, -8); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetTransparent(2, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - M6502Exit(); - - AY8910Exit(0); - AY8910Exit(1); - DACExit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 1; i < 0x40; i++) - { - UINT8 r = ~DrvPalRAM[i*2] & 7; - UINT8 g =(~DrvPalRAM[i*2] >> 4) & 7; - UINT8 b = ~DrvPalRAM[i*2+1] & 7; - - r = (r << 5) + (r << 2) + (r >> 1); - g = (g << 5) + (g << 2) + (g >> 1); - b = (b << 5) + (b << 2) + (b >> 1); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - - DrvPalette[0x40] = 0; // black (unused entry) -} - -static INT32 DrvGfxRamDecode() -{ - INT32 Plane[3] = { (0x2000*8*2), (0x2000*8*1), 0 }; - INT32 XOffs[16] = { STEP8(7,-1), STEP8(128+7, -1) }; - INT32 YOffs[16] = { STEP16(0,8) }; - - GfxDecode(0x0100, 3, 16, 16, Plane, XOffs, YOffs, 0x100, DrvGfxRAM, DrvGfxROM2); - - return 0; -} - -static void draw_sprites(INT32 pri) -{ - for (INT32 i = 0; i < 0x200; i += 4) - { - INT32 attr = DrvSprRAM[i]; - INT32 code = DrvSprRAM[i + 1]; - INT32 sy = DrvSprRAM[i + 2]; - INT32 sx = DrvSprRAM[i + 3]; - INT32 color = (attr >> 3) & 1; - - if (!(attr & 1) || color != pri) - continue; - - code += (attr << 3) & 0x100; - - sy -= (attr << 1) & 0x100; - sx -= (attr << 2) & 0x100; - - INT32 flipx = attr & 0x04; - INT32 flipy = ~attr & 0x02; - - if (screen_flipx) - { - flipx = !flipx; - flipy = !flipy; - sx = 240 - sx; - sy = 240 - sy; - } - - if (attr & 0x10) { - RenderZoomedTile(pTransDraw, DrvGfxROM1, code, (color<<3)+0x20, 0, sx, sy - 8, flipx, flipy, 16, 16, 1<<16, 2<<16); - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0x20, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0x20, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0x20, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0x20, DrvGfxROM1); - } - } - } - } -} - -static INT32 DrvDraw() -{ - //if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; - //} - - screen_flipx = scroll[7] & 0x20; // flipx = 0x20, flipy = 0 - - INT32 xoffset = (screen_flipx) ? -8 : 8; - - GenericTilemapSetFlip(0, (screen_flipx ? TMAP_FLIPX : TMAP_FLIPY)); - GenericTilemapSetFlip(1, (screen_flipx ? TMAP_FLIPX : TMAP_FLIPY)); - GenericTilemapSetFlip(2, (screen_flipx ? TMAP_FLIPX : TMAP_FLIPY)); - - if ((scroll[7] & 3) == 0) { - DrvGfxRamDecode(); - } - - if ((scroll[7] & 0x01) == 0 && (nSpriteEnable & 1)) { - GenericTilemapSetScrollX(0, (((scroll[1] << 2) & 0x300) + scroll[2] + xoffset) & 0x3ff); - GenericTilemapSetScrollY(0, (((scroll[1] << 4) & 0x300) + scroll[3]) & 0x3ff); - GenericTilemapDraw(0, pTransDraw, 0); - } else { - BurnTransferClear(); // black - } - - if (nSpriteEnable & 2) { - draw_sprites(0); - } - - if ((scroll[7] & 0x02) == 0 && (nSpriteEnable & 4)) { - GenericTilemapSetScrollX(1, (((scroll[1] << 6) & 0x300) + scroll[4] + xoffset) & 0x3ff); - GenericTilemapSetScrollY(1, (((scroll[1] << 8) & 0x300) + scroll[5]) & 0x3ff); - GenericTilemapDraw(1, pTransDraw, 0); - } - - if (nSpriteEnable & 8) { - draw_sprites(1); - } - - if (nSpriteEnable & 0x10) { - GenericTilemapDraw(2, pTransDraw, 0); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6809NewFrame(); - M6502NewFrame(); - - { - UINT8 previous_coin = DrvInputs[2]; - UINT8 previous_tilt = DrvInputs[3]; - - memset (DrvInputs, 0xff, 4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - if ((previous_coin & 3) != (DrvInputs[2] & 0x03)) { - M6809Open(0); - M6809SetIRQLine(CPU_IRQLINE_NMI, ((DrvInputs[2] & 3) == 3) ? CPU_IRQSTATUS_NONE : CPU_IRQSTATUS_ACK); - M6809Close(); - } - - if ((previous_tilt & 1) != (DrvInputs[3] & 0x01)) { - M6809Open(0); - M6809SetIRQLine(CPU_IRQLINE_FIRQ, ((DrvInputs[3] & 1) == 1) ? CPU_IRQSTATUS_NONE : CPU_IRQSTATUS_ACK); - M6809Close(); - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 2000000 / 60, 2000000 / 60, 2000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - INT32 nSoundBufferPos = 0; - - M6502Open(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - M6809Close(); - - M6809Open(1); - nCyclesDone[1] += M6809Run(nCyclesTotal[1] / nInterleave); - M6809Close(); - - nCyclesDone[2] += M6502Run(nCyclesTotal[2] / nInterleave); - if ((i & 0xf)==0xf && nmimask == 0) M6502SetIRQLine(CPU_IRQLINE_NMI, CPU_IRQSTATUS_ACK); - - if (i == 240) vblank = 1; - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - M6502Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - M6502Scan(nAction); - - AY8910Scan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(nmimask); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(scroll[7]); - M6809Close(); - } - - return 0; -} - - -// B-Wings (Japan new Ver.) - -static struct BurnRomInfo bwingsRomDesc[] = { - { "bw_bv-02-.10a", 0x4000, 0x6074a86b, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "bw_bv-01.7a", 0x4000, 0xb960c707, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bw_bv-00-.4a", 0x4000, 0x1f83804c, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "bw_bv-06-.10d", 0x2000, 0xeca00fcb, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "bw_bv-05-.9d", 0x2000, 0x1e393300, 2 | BRF_PRG | BRF_ESS }, // 4 - { "bw_bv-04-.7d", 0x2000, 0x6548c5bb, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "bw_bv-03.13a", 0x2000, 0xe8ac9379, 3 | BRF_PRG | BRF_ESS }, // 6 M6502 Code - - { "bw_bv-10.5c", 0x1000, 0xedca6901, 4 | BRF_GRA }, // 7 Characters - - { "bw_bv-07.1l", 0x4000, 0x3d5ab2be, 5 | BRF_GRA }, // 8 Sprites - { "bw_bv-08.1k", 0x4000, 0x7a585f1e, 5 | BRF_GRA }, // 9 - { "bw_bv-09.1h", 0x4000, 0xa14c0b57, 5 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(bwings) -STD_ROM_FN(bwings) - -struct BurnDriver BurnDrvBwings = { - "bwings", NULL, NULL, NULL, "1984", - "B-Wings (Japan new Ver.)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, bwingsRomInfo, bwingsRomName, NULL, NULL, BwingInputInfo, BwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 240, 256, 3, 4 -}; - - -// B-Wings (Japan old Ver.) - -static struct BurnRomInfo bwingsoRomDesc[] = { - { "bw_bv-02.10a", 0x4000, 0x5ce74ab5, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "bw_bv-01.7a", 0x4000, 0xb960c707, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bw_bv-00.4a", 0x4000, 0x926bef63, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "bw_bv-06.10d", 0x2000, 0x91a21a4c, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "bw_bv-05.9d", 0x2000, 0xf283f39a, 2 | BRF_PRG | BRF_ESS }, // 4 - { "bw_bv-04.7d", 0x2000, 0x29ae75b6, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "bw_bv-03.13a", 0x2000, 0xe8ac9379, 3 | BRF_PRG | BRF_ESS }, // 6 M6502 Code - - { "bw_bv-10.5c", 0x1000, 0xedca6901, 4 | BRF_GRA }, // 7 Characters - - { "bw_bv-07.1l", 0x4000, 0x3d5ab2be, 5 | BRF_GRA }, // 8 Sprites - { "bw_bv-08.1k", 0x4000, 0x7a585f1e, 5 | BRF_GRA }, // 9 - { "bw_bv-09.1h", 0x4000, 0xa14c0b57, 5 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(bwingso) -STD_ROM_FN(bwingso) - -struct BurnDriver BurnDrvBwingso = { - "bwingso", "bwings", NULL, NULL, "1984", - "B-Wings (Japan old Ver.)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, bwingsoRomInfo, bwingsoRomName, NULL, NULL, BwingInputInfo, BwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 240, 256, 3, 4 -}; - - -// B-Wings (Alt Ver.?) - -static struct BurnRomInfo bwingsaRomDesc[] = { - { "bw_bv-02.10a", 0x4000, 0x5ce74ab5, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "bv02.bin", 0x2000, 0x2f84654e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bw_bv-01.7a", 0x4000, 0xb960c707, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bv00.bin", 0x4000, 0x0bbc1222, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bw_bv-06.10d", 0x2000, 0x91a21a4c, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - { "bw_bv-05.9d", 0x2000, 0xf283f39a, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bw_bv-04.7d", 0x2000, 0x29ae75b6, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "bw_bv-03.13a", 0x2000, 0xe8ac9379, 3 | BRF_PRG | BRF_ESS }, // 7 M6502 Code - - { "bw_bv-10.5c", 0x1000, 0xedca6901, 4 | BRF_GRA }, // 8 Characters - - { "bw_bv-07.1l", 0x4000, 0x3d5ab2be, 5 | BRF_GRA }, // 9 Sprites - { "bw_bv-08.1k", 0x4000, 0x7a585f1e, 5 | BRF_GRA }, // 10 - { "bw_bv-09.1h", 0x4000, 0xa14c0b57, 5 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(bwingsa) -STD_ROM_FN(bwingsa) - -struct BurnDriver BurnDrvBwingsa = { - "bwingsa", "bwings", NULL, NULL, "1984", - "B-Wings (Alt Ver.?)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, bwingsaRomInfo, bwingsaRomName, NULL, NULL, BwingInputInfo, BwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 240, 256, 3, 4 -}; - - -// Zaviga - -static struct BurnRomInfo zavigaRomDesc[] = { - { "as04.10a", 0x4000, 0xb79f5da2, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "as02.7a", 0x4000, 0x6addd16a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "as00.4a", 0x4000, 0xc6ae4af0, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "as08.10d", 0x2000, 0xb6187b3a, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "as07.9d", 0x2000, 0xdc1170e3, 2 | BRF_PRG | BRF_ESS }, // 4 - { "as06.7d", 0x2000, 0xba888f84, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "as05.13a", 0x2000, 0xafe9b0ac, 3 | BRF_PRG | BRF_ESS }, // 6 M6502 Code - - { "as14.5c", 0x1000, 0x62132c1d, 4 | BRF_GRA }, // 7 Characters - - { "as11.1l", 0x4000, 0xaa84af24, 5 | BRF_GRA }, // 8 Sprites - { "as12.1k", 0x4000, 0x84af9041, 5 | BRF_GRA }, // 9 - { "as13.1h", 0x4000, 0x15d0922b, 5 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(zaviga) -STD_ROM_FN(zaviga) - -struct BurnDriver BurnDrvZaviga = { - "zaviga", NULL, NULL, NULL, "1984", - "Zaviga\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, zavigaRomInfo, zavigaRomName, NULL, NULL, BwingInputInfo, BwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 240, 256, 3, 4 -}; - - -// Zaviga (Japan) - -static struct BurnRomInfo zavigajRomDesc[] = { - { "as04.10a", 0x4000, 0xb79f5da2, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "as02.7a", 0x4000, 0x6addd16a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "as00.4a", 0x4000, 0xc6ae4af0, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "as08.10d", 0x2000, 0xb6187b3a, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "as07.9d", 0x2000, 0xdc1170e3, 2 | BRF_PRG | BRF_ESS }, // 4 - { "as06-.7d", 0x2000, 0xb02d270c, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "as05.13a", 0x2000, 0xafe9b0ac, 3 | BRF_PRG | BRF_ESS }, // 6 M6502 Code - - { "as14.5c", 0x1000, 0x62132c1d, 4 | BRF_GRA }, // 7 Characters - - { "as11.1l", 0x4000, 0xaa84af24, 5 | BRF_GRA }, // 8 Sprites - { "as12.1k", 0x4000, 0x84af9041, 5 | BRF_GRA }, // 9 - { "as13.1h", 0x4000, 0x15d0922b, 5 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(zavigaj) -STD_ROM_FN(zavigaj) - -struct BurnDriver BurnDrvZavigaj = { - "zavigaj", "zaviga", NULL, NULL, "1984", - "Zaviga (Japan)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, zavigajRomInfo, zavigajRomName, NULL, NULL, BwingInputInfo, BwingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 240, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/dataeast/d_cbuster.cpp b/jan/src/burn/drv/dataeast/d_cbuster.cpp deleted file mode 100644 index cbabcf816..000000000 --- a/jan/src/burn/drv/dataeast/d_cbuster.cpp +++ /dev/null @@ -1,907 +0,0 @@ -// FB Alpha Crude Buster / Two Crude drive module -// Based on MAME driver by by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "h6280_intf.h" -#include "bitswap.h" -#include "deco16ic.h" -#include "msm6295.h" -#include "timer.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *Drv68KRAM; -static UINT8 *DrvHucRAM; -static UINT8 *DrvPalRAM0; -static UINT8 *DrvPalRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *SoundBuffer; - -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static INT32 prot_data = 0; - -static struct BurnInputInfo CbusterInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Cbuster) - -static struct BurnDIPInfo CbusterDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x01, "1" }, - {0x14, 0x01, 0x03, 0x00, "2" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x08, "Easy" }, - {0x14, 0x01, 0x0c, 0x04, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "No" }, - {0x14, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Cbuster) - -void __fastcall cbuster_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0xb5000, data) - deco16_write_control_word(1, address, 0xb6000, data) - - switch (address) - { - case 0xbc000: - case 0xbc001: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0xbc002: - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -void __fastcall cbuster_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xbc000: - case 0xbc001: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0xbc003: - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0xbc004: - if (data == 0x9a) prot_data = 0; - if (data == 0x02) prot_data = 0x63 << 8; - if (data == 0x00) { prot_data = 0x0e; deco16_priority = 0; } - return; - - case 0xbc005: - if (data == 0xaa) prot_data = 0x74; - if (data == 0x9a) prot_data = 0x0e; - if (data == 0x55) prot_data = 0x1e; - if (data == 0x0e) { prot_data = 0x0e; deco16_priority = 0; } - if (data == 0x00) { prot_data = 0x0e; deco16_priority = 0; } - if (data == 0xf1) { prot_data = 0x36; deco16_priority = 1; } - if (data == 0x80) { prot_data = 0x2e; deco16_priority = 1; } - if (data == 0x40) { prot_data = 0x1e; deco16_priority = 1; } - if (data == 0xc0) { prot_data = 0x3e; deco16_priority = 0; } - if (data == 0xff) { prot_data = 0x76; deco16_priority = 1; } - return; - } -} - -UINT16 __fastcall cbuster_main_read_word(UINT32 address) -{ - switch (address) - { - case 0xbc000: - case 0xbc001: - return DrvInputs[0]; - - case 0xbc002: - case 0xbc003: - return (DrvDips[1] << 8) | (DrvDips[0] << 0); - - case 0xbc004: - bprintf (0, _T("%5.5x, rw\n"), address); - return prot_data; - - case 0xbc006: - case 0xbc007: - return (DrvInputs[1] & 0xf7) | (deco16_vblank & 0x08); - } - - return 0; -} - -UINT8 __fastcall cbuster_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xbc000: - return DrvInputs[0] >> 8; - - case 0xbc001: - return DrvInputs[0]; - - case 0xbc002: - return DrvDips[1]; - - case 0xbc003: - return DrvDips[0]; - - case 0xbc004: - bprintf (0, _T("%5.5x, rb\n"), address); - return prot_data >> 8; - case 0xbc005: - bprintf (0, _T("%5.5x, rb\n"), address); - return prot_data; - - case 0xbc006: - case 0xbc007: - return (DrvInputs[1] & 0xf7) | (deco16_vblank & 0x08); - } - - return 0; -} - -static INT32 cbuster_bank_callback(const INT32 bank) -{ - return ((bank >> 4) & 0x7) * 0x1000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - deco16SoundReset(); - - deco16Reset(); - - return 0; -} - -static INT32 DrvGfxDecode(UINT8 *gfx, INT32 len, INT32 type) -{ - INT32 Plane[4] = { 24,16,8,0 }; - INT32 XOffs[16] = { 512,513,514,515,516,517,518,519, 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[16] = { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32,10*32,11*32,12*32,13*32,14*32,15*32}; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, gfx, len); - - if (type == 1) { - GfxDecode((len * 2) / 0x040, 4, 8, 8, Plane, XOffs + 8, YOffs, 0x100, tmp, gfx); - } else { - GfxDecode((len * 2) / 0x100, 4, 16, 16, Plane, XOffs + 0, YOffs, 0x400, tmp, gfx); - } - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROM3 = Next; Next += 0x400000; - - MSM6295ROM = Next; Next += 0x140000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvHucRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x000800; - DrvSprBuf = Next; Next += 0x000800; - DrvPalRAM0 = Next; Next += 0x001000; - DrvPalRAM1 = Next; Next += 0x001000; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - SoundBuffer = (INT16*)Next; Next += nBurnSoundLen * 2 * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvROMRearrange() -{ - UINT8 *RAM = Drv68KROM; - UINT8 *PTR; - - for (INT32 i = 0; i < 0x80000; i += 2) - { - INT32 h = i + 1, l = i + 0; - RAM[h] = BITSWAP08(RAM[h], 4, 6, 7, 5, 3, 2, 1, 0); - RAM[l] = BITSWAP08(RAM[l], 7, 1, 5, 4, 6, 2, 3, 0); - -#if 0 - RAM[h] = (RAM[h] & 0xcf) | ((RAM[h] & 0x10) << 1) | ((RAM[h] & 0x20) >> 1); - RAM[h] = (RAM[h] & 0x5f) | ((RAM[h] & 0x20) << 2) | ((RAM[h] & 0x80) >> 2); - - RAM[l] = (RAM[l] & 0xbd) | ((RAM[l] & 0x2) << 5) | ((RAM[l] & 0x40) >> 5); - RAM[l] = (RAM[l] & 0xf5) | ((RAM[l] & 0x2) << 2) | ((RAM[l] & 0x8) >> 2); -#endif - } - - RAM = DrvGfxROM3 + 0x080000; - PTR = DrvGfxROM3 + 0x140000; - for (INT32 i = 0; i < 0x20000; i += 64) - { - for (INT32 j = 0; j < 16; j++) - { - RAM[i + 0x00000 + j * 2] = PTR[i / 2 + 0x00000 + j]; - RAM[i + 0x00020 + j * 2] = PTR[i / 2 + 0x00010 + j]; - RAM[i + 0x00001 + j * 2] = PTR[i / 2 + 0x10000 + j]; - RAM[i + 0x00021 + j * 2] = PTR[i / 2 + 0x10010 + j]; - RAM[i + 0xa0000 + j * 2] = PTR[i / 2 + 0x20000 + j]; - RAM[i + 0xa0020 + j * 2] = PTR[i / 2 + 0x20010 + j]; - RAM[i + 0xa0001 + j * 2] = PTR[i / 2 + 0x30000 + j]; - RAM[i + 0xa0021 + j * 2] = PTR[i / 2 + 0x30010 + j]; - } - } -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080001, 7, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x0a0000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x140000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x150000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x160000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x170000, 14, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x000000, 15, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x100000, 16, 1)) return 1; - - DrvROMRearrange(); - - memcpy (DrvGfxROM0, DrvGfxROM1, 0x100000); - - DrvGfxDecode(DrvGfxROM0, 0x100000, 1); - DrvGfxDecode(DrvGfxROM1, 0x100000, 0); - DrvGfxDecode(DrvGfxROM2, 0x080000, 0); - - deco16_tile_decode(DrvGfxROM3, DrvGfxROM3, 0x0a0000 * 2, 0); - } - - deco16Init(0, 0, 1); - deco16_set_global_offsets(0, 8); - deco16_set_graphics(DrvGfxROM0, 0x200000, DrvGfxROM1, 0x200000, DrvGfxROM2, 0x100000); - deco16_set_bank_callback(0, cbuster_bank_callback); - deco16_set_bank_callback(1, cbuster_bank_callback); - deco16_set_bank_callback(2, cbuster_bank_callback); - deco16_set_bank_callback(3, cbuster_bank_callback); - deco16_set_color_base(0, 0x000); - deco16_set_color_base(1, 0x200); - deco16_set_color_base(2, 0x300); - deco16_set_color_base(3, 0x400); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x083fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x0a0000, 0x0a1fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x0a2000, 0x0a2fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x0a4000, 0x0a47ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x0a6000, 0x0a67ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x0a8000, 0x0a8fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x0aa000, 0x0abfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x0ac000, 0x0ac7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x0ae000, 0x0ae7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x0b0000, 0x0b07ff, MAP_RAM); - SekMapMemory(DrvPalRAM0, 0x0b8000, 0x0b8fff, MAP_RAM); - SekMapMemory(DrvPalRAM1, 0x0b9000, 0x0b9fff, MAP_RAM); - SekSetWriteWordHandler(0, cbuster_main_write_word); - SekSetWriteByteHandler(0, cbuster_main_write_byte); - SekSetReadWordHandler(0, cbuster_main_read_word); - SekSetReadByteHandler(0, cbuster_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 1, NULL, 0.45, 1006875, 0.75, 2013750, 0.60); - BurnYM2203SetAllRoutes(0, 0.60, BURN_SND_ROUTE_BOTH); - - deco16_music_tempofix = 1; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - SekExit(); - deco16SoundExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *p0 = (UINT16*)DrvPalRAM0; - UINT16 *p1 = (UINT16*)DrvPalRAM1; - - for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++) { - INT32 r = ((BURN_ENDIAN_SWAP_INT16(p0[i]) & 0xff) * 175) / 100; //Seb - INT32 g = ((BURN_ENDIAN_SWAP_INT16(p0[i]) >> 8 ) * 175) / 100; //Seb - INT32 b = ((BURN_ENDIAN_SWAP_INT16(p1[i]) & 0xff) * 175) / 100; //Seb - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_sprites(INT32 pri) -{ - UINT16 *buffered_spriteram = (UINT16*)DrvSprBuf; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 x, y, sprite, colour, multi, fx, fy, inc, flash, mult; - - sprite = BURN_ENDIAN_SWAP_INT16 (buffered_spriteram[offs + 1]) & 0x7fff; //Seb - if (!sprite) - continue; - - y = BURN_ENDIAN_SWAP_INT16 (buffered_spriteram[offs]); //Seb - x = BURN_ENDIAN_SWAP_INT16 (buffered_spriteram[offs + 2]); //Seb - - if ((y & 0x8000) && pri == 1) - continue; - if (!(y & 0x8000) && pri == 0) - continue; - - colour = (x >> 9) & 0xf; - if (x & 0x2000) - colour += 64; - colour += 0x10; - - flash = y & 0x1000; - if (flash && (nCurrentFrame & 1)) - continue; - - fx = y & 0x2000; - fy = y & 0x4000; - multi = (1 << ((y & 0x0600) >> 9)) - 1; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 256) x -= 512; - if (y >= 256) y -= 512; - x = 240 - x; - y = 240 - y; - - if (x > 256) continue; - - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (*flipscreen) - { - y = 240 - y; - x = 240 - x; - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - mult = 16; - } - else mult = -16; - - while (multi >= 0) - { - INT32 sy = (y + mult * multi) - 8; - INT32 c = sprite - multi * inc; - - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, c, x, sy, colour, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, c, x, sy, colour, 4, 0, 0, DrvGfxROM3); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, c, x, sy, colour, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, c, x, sy, colour, 4, 0, 0, DrvGfxROM3); - } - } - - multi--; - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - DrvPaletteRecalc(); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x100; - } - - if (nBurnLayer & 1) deco16_draw_layer(3, pTransDraw, DECO16_LAYER_OPAQUE); - - draw_sprites(0); - - if (deco16_priority) { - if (nBurnLayer & 2) deco16_draw_layer(1, pTransDraw, 0); - if (nBurnLayer & 4) deco16_draw_layer(2, pTransDraw, 0); - } else { - if (nBurnLayer & 2) deco16_draw_layer(2, pTransDraw, 0); - if (nBurnLayer & 4) deco16_draw_layer(1, pTransDraw, 0); - } - - draw_sprites(1); - - if (nBurnLayer & 8) deco16_draw_layer(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 232; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 58, 8055000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - BurnTimerUpdate((i + 1) * nCyclesTotal[1] / nInterleave); - - - if (i == 206) deco16_vblank = 0x08; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[(i << 1) + 0] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 0] + SoundBuffer[(i << 1) + 0]); - pBurnSoundOut[(i << 1) + 1] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 1] + SoundBuffer[(i << 1) + 1]); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - } - - return 0; -} - - -// Crude Buster (World FX version) - -static struct BurnRomInfo cbusterRomDesc[] = { - { "fx01.7l", 0x20000, 0xddae6d83, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fx00.4l", 0x20000, 0x5bc2c0de, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fx03.9l", 0x20000, 0xc3d65bf9, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fx02.6l", 0x20000, 0xb875266b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fu11-.19h", 0x10000, 0x65f20f10, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "mab-00.4c", 0x80000, 0x660eaabd, 3 | BRF_GRA }, // 5 Characters and Foreground Tiles - { "fu05-.6c", 0x10000, 0x8134d412, 3 | BRF_GRA }, // 6 - { "fu06-.7c", 0x10000, 0x2f914a45, 3 | BRF_GRA }, // 7 - - { "mab-01.19a", 0x80000, 0x1080d619, 4 | BRF_GRA }, // 8 Background Tiles - - { "mab-02.10a", 0x80000, 0x58b7231d, 5 | BRF_GRA }, // 9 Sprites - { "mab-03.11a", 0x80000, 0x76053b9d, 5 | BRF_GRA }, // 10 - { "fu07-.4a", 0x10000, 0xca8d0bb3, 5 | BRF_GRA }, // 11 - { "fu08-.5a", 0x10000, 0xc6afc5c8, 5 | BRF_GRA }, // 12 - { "fu09-.7a", 0x10000, 0x526809ca, 5 | BRF_GRA }, // 13 - { "fu10-.8a", 0x10000, 0x6be6d50e, 5 | BRF_GRA }, // 14 - - { "fu12-.16k", 0x20000, 0x2d1d65f2, 6 | BRF_SND }, // 15 OKI M6295 Samples 0 - - { "fu13-.21e", 0x20000, 0xb8525622, 7 | BRF_SND }, // 16 OKI M6295 Samples 1 - - { "mb7114h.18e", 0x00100, 0x3645b70f, 8 | BRF_OPT }, // 17 Unused PROMs -}; - -STD_ROM_PICK(cbuster) -STD_ROM_FN(cbuster) - -struct BurnDriver BurnDrvCbuster = { - "cbuster", NULL, NULL, NULL, "1990", - "Crude Buster (World FX version)\0",NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, cbusterRomInfo, cbusterRomName, NULL, NULL, CbusterInputInfo, CbusterDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Crude Buster (World FU version) - -static struct BurnRomInfo cbusterwRomDesc[] = { - { "fu01-.7l", 0x20000, 0x0203e0f8, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fu00-.4l", 0x20000, 0x9c58626d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fu03-.9l", 0x20000, 0xdef46956, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fu02-.6l", 0x20000, 0x649c3338, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fu11-.19h", 0x10000, 0x65f20f10, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "mab-00.4c", 0x80000, 0x660eaabd, 3 | BRF_GRA }, // 5 Characters and Foreground Tiles - { "fu05-.6c", 0x10000, 0x8134d412, 3 | BRF_GRA }, // 6 - { "fu06-.7c", 0x10000, 0x2f914a45, 3 | BRF_GRA }, // 7 - - { "mab-01.19a", 0x80000, 0x1080d619, 4 | BRF_GRA }, // 8 Background Tiles - - { "mab-02.10a", 0x80000, 0x58b7231d, 5 | BRF_GRA }, // 9 Sprites - { "mab-03.11a", 0x80000, 0x76053b9d, 5 | BRF_GRA }, // 10 - { "fu07-.4a", 0x10000, 0xca8d0bb3, 5 | BRF_GRA }, // 11 - { "fu08-.5a", 0x10000, 0xc6afc5c8, 5 | BRF_GRA }, // 12 - { "fu09-.7a", 0x10000, 0x526809ca, 5 | BRF_GRA }, // 13 - { "fu10-.8a", 0x10000, 0x6be6d50e, 5 | BRF_GRA }, // 14 - - { "fu12-.16k", 0x20000, 0x2d1d65f2, 6 | BRF_SND }, // 15 OKI M6295 Samples 0 - - { "fu13-.21e", 0x20000, 0xb8525622, 7 | BRF_SND }, // 16 OKI M6295 Samples 1 - - { "mb7114h.18e", 0x00100, 0x3645b70f, 8 | BRF_OPT }, // 17 Unused PROMs -}; - -STD_ROM_PICK(cbusterw) -STD_ROM_FN(cbusterw) - -struct BurnDriver BurnDrvCbusterw = { - "cbusterw", "cbuster", NULL, NULL, "1990", - "Crude Buster (World FU version)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, cbusterwRomInfo, cbusterwRomName, NULL, NULL, CbusterInputInfo, CbusterDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Crude Buster (Japan FR revision 1) - -static struct BurnRomInfo cbusterjRomDesc[] = { - { "fr01-1.7l", 0x20000, 0xaf3c014f, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fr00-1.4l", 0x20000, 0xf666ad52, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fr03.9l", 0x20000, 0x02c06118, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fr02.6l", 0x20000, 0xb6c34332, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fu11-.19h", 0x10000, 0x65f20f10, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "mab-00.4c", 0x80000, 0x660eaabd, 3 | BRF_GRA }, // 5 Characters and Foreground Tiles - { "fr05-1.6c", 0x10000, 0xb1f0d910, 3 | BRF_GRA }, // 6 - { "fr06-1.7c", 0x10000, 0x2f914a45, 3 | BRF_GRA }, // 7 - - { "mab-01.19a", 0x80000, 0x1080d619, 4 | BRF_GRA }, // 8 Background Tiles - - { "mab-02.10a", 0x80000, 0x58b7231d, 5 | BRF_GRA }, // 9 Sprites - { "mab-03.11a", 0x80000, 0x76053b9d, 5 | BRF_GRA }, // 10 - { "fr07.4a", 0x10000, 0x52c85318, 5 | BRF_GRA }, // 11 - { "fr08.5a", 0x10000, 0xea25fbac, 5 | BRF_GRA }, // 12 - { "fr09.7a", 0x10000, 0xf8363424, 5 | BRF_GRA }, // 13 - { "fr10.8a", 0x10000, 0x241d5760, 5 | BRF_GRA }, // 14 - - { "fu12-.16k", 0x20000, 0x2d1d65f2, 6 | BRF_SND }, // 15 OKI M6295 Samples 0 - - { "fu13-.21e", 0x20000, 0xb8525622, 7 | BRF_SND }, // 16 OKI M6295 Samples 1 - - { "mb7114h.18e", 0x00100, 0x3645b70f, 8 | BRF_OPT }, // 17 Unused PROMs -}; - -STD_ROM_PICK(cbusterj) -STD_ROM_FN(cbusterj) - -struct BurnDriver BurnDrvCbusterj = { - "cbusterj", "cbuster", NULL, NULL, "1990", - "Crude Buster (Japan FR revision 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, cbusterjRomInfo, cbusterjRomName, NULL, NULL, CbusterInputInfo, CbusterDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Two Crude (US FT revision 1) - -static struct BurnRomInfo twocrudeRomDesc[] = { - { "ft01-1.7l", 0x20000, 0x7342ffc4, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ft00-1.4l", 0x20000, 0x3f5f535f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ft03.9l", 0x20000, 0x28002c99, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ft02.6l", 0x20000, 0x37ea0626, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ft11-.19h", 0x10000, 0x65f20f10, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "mab-00.4c", 0x80000, 0x660eaabd, 3 | BRF_GRA }, // 5 Characters and Foreground Tiles - { "ft05-1.6c", 0x10000, 0xb1f0d910, 3 | BRF_GRA }, // 6 - { "ft06-1.7c", 0x10000, 0x2f914a45, 3 | BRF_GRA }, // 7 - - { "mab-01.19a", 0x80000, 0x1080d619, 4 | BRF_GRA }, // 8 Background Tiles - - { "mab-02.10a", 0x80000, 0x58b7231d, 5 | BRF_GRA }, // 9 Sprites - { "mab-03.11a", 0x80000, 0x76053b9d, 5 | BRF_GRA }, // 10 - { "ft07-.4a", 0x10000, 0xe3465c25, 5 | BRF_GRA }, // 11 - { "ft08-.5a", 0x10000, 0xc7f1d565, 5 | BRF_GRA }, // 12 - { "ft09-.7a", 0x10000, 0x6e3657b9, 5 | BRF_GRA }, // 13 - { "ft10-.8a", 0x10000, 0xcdb83560, 5 | BRF_GRA }, // 14 - - { "ft12-.16k", 0x20000, 0x2d1d65f2, 6 | BRF_SND }, // 15 OKI M6295 Samples 0 - - { "ft13-.21e", 0x20000, 0xb8525622, 7 | BRF_SND }, // 16 OKI M6295 Samples 1 - - { "mb7114h.18e", 0x00100, 0x3645b70f, 8 | BRF_OPT }, // 17 Unused PROMs -}; - -STD_ROM_PICK(twocrude) -STD_ROM_FN(twocrude) - -struct BurnDriver BurnDrvTwocrude = { - "twocrude", "cbuster", NULL, NULL, "1990", - "Two Crude (US FT revision 1)\0", NULL, "Data East USA", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, twocrudeRomInfo, twocrudeRomName, NULL, NULL, CbusterInputInfo, CbusterDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Two Crude (US FT version) - -static struct BurnRomInfo twocrudeaRomDesc[] = { - { "ft01.7l", 0x20000, 0x08e96489, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ft00.4l", 0x20000, 0x6765c445, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ft03.9l", 0x20000, 0x28002c99, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ft02.6l", 0x20000, 0x37ea0626, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ft11-.19h", 0x10000, 0x65f20f10, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "mab-00.4c", 0x80000, 0x660eaabd, 3 | BRF_GRA }, // 5 Characters and Foreground Tiles - { "ft05-.6c", 0x10000, 0x8134d412, 3 | BRF_GRA }, // 6 - { "ft06-.7c", 0x10000, 0x2f914a45, 3 | BRF_GRA }, // 7 - - { "mab-01.19a", 0x80000, 0x1080d619, 4 | BRF_GRA }, // 8 Background Tiles - - { "mab-02.10a", 0x80000, 0x58b7231d, 5 | BRF_GRA }, // 9 Sprites - { "mab-03.11a", 0x80000, 0x76053b9d, 5 | BRF_GRA }, // 10 - { "ft07-.4a", 0x10000, 0xe3465c25, 5 | BRF_GRA }, // 11 - { "ft08-.5a", 0x10000, 0xc7f1d565, 5 | BRF_GRA }, // 12 - { "ft09-.7a", 0x10000, 0x6e3657b9, 5 | BRF_GRA }, // 13 - { "ft10-.8a", 0x10000, 0xcdb83560, 5 | BRF_GRA }, // 14 - - { "ft12-.16k", 0x20000, 0x2d1d65f2, 6 | BRF_SND }, // 15 OKI M6295 Samples 0 - - { "ft13-.21e", 0x20000, 0xb8525622, 7 | BRF_SND }, // 16 OKI M6295 Samples 1 - - { "mb7114h.18e", 0x00100, 0x3645b70f, 8 | BRF_OPT }, // 17 Unused PROMs -}; - -STD_ROM_PICK(twocrudea) -STD_ROM_FN(twocrudea) - -struct BurnDriver BurnDrvTwocrudea = { - "twocrudea", "cbuster", NULL, NULL, "1990", - "Two Crude (US FT version)\0", NULL, "Data East USA", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, twocrudeaRomInfo, twocrudeaRomName, NULL, NULL, CbusterInputInfo, CbusterDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_chanbara.cpp b/jan/src/burn/drv/dataeast/d_chanbara.cpp deleted file mode 100644 index 0fbdfd1c7..000000000 --- a/jan/src/burn/drv/dataeast/d_chanbara.cpp +++ /dev/null @@ -1,576 +0,0 @@ -// FB Alpha Chanbara driver module -// Based on MAME driver by Tomasz Slanina and David Haywood -// Todo: -// 1) Figure out the sprite banking issue (strange blob of broken -// sprites appears sporatically - usually when the floor pattern changes. - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvColPROM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvColRAM0; -static UINT8 *DrvColRAM1; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 scrolly; -static UINT8 flipscreen; -static UINT8 bankdata; - -static INT32 vblank; - -static UINT8 DrvJoy[3][8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy[0] + 4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy[0] + 0, "p1 start" }, - {"P1 Up (left)" , BIT_DIGITAL , DrvJoy[1] + 1, "p1 up" }, - {"P1 Down (left)" , BIT_DIGITAL , DrvJoy[1] + 0, "p1 down" }, - {"P1 Left (left)" , BIT_DIGITAL , DrvJoy[1] + 2, "p1 left" }, - {"P1 Right (left)" , BIT_DIGITAL , DrvJoy[1] + 3, "p1 right" }, - {"P1 Up (right)" , BIT_DIGITAL , DrvJoy[1] + 5, "p3 up" }, - {"P1 Down (right)" , BIT_DIGITAL , DrvJoy[1] + 4, "p3 down" }, - {"P1 Left (right)" , BIT_DIGITAL , DrvJoy[1] + 6, "p3 left" }, - {"P1 Right (right)" , BIT_DIGITAL , DrvJoy[1] + 7, "p3 right" }, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy[0] + 5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy[0] + 1, "p2 start" }, - {"P2 Up (left)" , BIT_DIGITAL , DrvJoy[2] + 1, "p2 up" }, - {"P2 Down (left)" , BIT_DIGITAL , DrvJoy[2] + 0, "p2 down" }, - {"P2 Left (left)" , BIT_DIGITAL , DrvJoy[2] + 2, "p2 left" }, - {"P2 Right (left)" , BIT_DIGITAL , DrvJoy[2] + 3, "p2 right" }, - {"P2 Up (right)" , BIT_DIGITAL , DrvJoy[2] + 5, "p4 up" }, - {"P2 Down (right)" , BIT_DIGITAL , DrvJoy[2] + 4, "p4 down" }, - {"P2 Left (right)" , BIT_DIGITAL , DrvJoy[2] + 6, "p4 left" }, - {"P2 Right (right)" , BIT_DIGITAL , DrvJoy[2] + 7, "p4 right" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvJoy[0] + 6, "Service" }, - {"Dip" , BIT_DIPSWITCH, DrvDips + 0 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x16, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x16, 0x01, 0x03, 0x00, "2 Coins 1 Play" }, - {0x16, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x16, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - {0x16, 0x01, 0x03, 0x01, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x16, 0x01, 0x0c, 0x00, "2 Coins 1 Play" }, - {0x16, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x16, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - {0x16, 0x01, 0x0c, 0x04, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x16, 0x01, 0x10, 0x10, "Easy" }, - {0x16, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x16, 0x01, 0x20, 0x20, "3" }, - {0x16, 0x01, 0x20, 0x00, "1" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x16, 0x01, 0x40, 0x40, "50k and 70k" }, - {0x16, 0x01, 0x40, 0x00, "None" }, - - {0 , 0xfe, 0 , 1 , "Cabinet" }, - {0x16, 0x01, 0x80, 0x80, "Upright" }, -// {0x16, 0x01, 0x80, 0x00, "Cocktail" }, // not supported atm -}; - -STDDIPINFO(Drv) - -static void chanbara_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3800: - case 0x3801: - BurnYM2203Write(0, address & 1, data); - return; - } -} - -static UINT8 chanbara_read(UINT16 address) -{ - switch (address) - { - case 0x2000: - return DrvDips[0]; - - case 0x2001: - return (DrvInputs[0] & 0x7f) | (vblank ? 0x80 : 0); - - case 0x2002: - return DrvInputs[2]; - - case 0x2003: - return DrvInputs[1]; - - case 0x3800: - case 0x3801: - return BurnYM2203Read(0, address & 1); - } - - return 0; -} - -static void bankswitch(INT32 data) -{ - bankdata = data; - - M6809MapMemory(DrvM6809ROM + (data * 0x1000), 0x4000, 0x7fff, MAP_ROM); -} - -static void chanbara_ay_writeA(UINT32, UINT32 data) -{ - scrolly = (scrolly & 0x100) + data; -} - -static void chanbara_ay_writeB(UINT32, UINT32 data) -{ - scrolly = ((data & 0x01) * 0x100) + (scrolly & 0xff); - - flipscreen = data & 0x02; - - bankswitch(data & 0x04); -} - -static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - M6809SetIRQLine(0, nStatus ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / 1500000; -} - -static double DrvGetTime() -{ - return (double)M6809TotalCycles() / 1500000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - BurnYM2203Reset(); // this calls bankswitch() through the ay ports(!) - bankswitch(0); - M6809Reset(); - M6809Close(); - - scrolly = 0; - flipscreen = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x10000; - - DrvGfxROM0 = Next; Next += 0x08000; - DrvGfxROM1 = Next; Next += 0x80000; - DrvGfxROM2 = Next; Next += 0x10000; - DrvGfxROM3 = Next; Next += 0x02000; - - DrvColPROM = Next; Next += 0x00300; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM = Next; Next += 0x00800; - DrvVidRAM0 = Next; Next += 0x00400; - DrvVidRAM1 = Next; Next += 0x00200; - DrvColRAM0 = Next; Next += 0x00400; - DrvColRAM1 = Next; Next += 0x00200; - DrvSprRAM = Next; Next += 0x00100; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Plane0[2] = { 0, 4 }; - INT32 Plane1[3] = { (0x24000/3) * 8 * 2, (0x24000/3) * 8 * 1, (0x24000/3) * 8 * 0 }; - INT32 Plane2[3] = { (0x8000 / 2) * 8, 0, 4 }; - - INT32 XOffs0[8] = { STEP4(((0x2000/2) * 8),1), STEP4(0,1) }; - INT32 XOffs1[16]= { STEP8(128,1), STEP8(0,1) }; - INT32 XOffs2[16]= { STEP4((((0x8000/4)*8) + 128), 1), STEP4(0,1), STEP4(((0x8000/4)*8),1), STEP4(128,1) }; - - INT32 YOffs0[8] = { STEP8(0,8) }; - INT32 YOffs1[16]= { STEP8(0,8), STEP8(64,8) }; - INT32 YOffs2[16]= { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x24000); - - memcpy (tmp, DrvGfxROM0, 0x02000); - - GfxDecode(0x0200, 2, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x24000); - - GfxDecode(0x0600, 3, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x8000); - - GfxDecode(0x0100, 3, 16, 16, Plane2, XOffs2, YOffs2, 0x100, tmp, DrvGfxROM2); - - BurnFree(tmp); -} - -UINT8 *temp4; - -static void DrvGfxExpand() -{ - /*UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - - memcpy (tmp, DrvGfxROM2 + 0x4000, 0x2000); - - for (INT32 i = 0; i < 0x4000; i++) { - DrvGfxROM2[i + 0x4000] = (tmp[i/2] << ((~i&1)<<2)) & 0xf0; - } - - BurnFree(tmp); - */ - // replacing the above with this fixes the "blue lines through everything" issue - // Leaving this here incase iq_132 wants to fix it. - - UINT8 *dst = DrvGfxROM2 + 0x4000; - UINT8 *src = DrvGfxROM3; - - for (INT32 i = 0; i < 0x1000; i++) - { - dst[i + 0x1000] = src[i] & 0xf0; - dst[i + 0x0000] = (src[i] & 0x0f) << 4; - dst[i + 0x3000] = src[i + 0x1000] & 0xf0; - dst[i + 0x2000] = (src[i + 0x1000] & 0x0f) << 4; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x14000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 14, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 17, 1)) return 1; - - DrvGfxExpand(); - DrvGfxDecode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvVidRAM0, 0x0800, 0x0bff, MAP_RAM); - M6809MapMemory(DrvColRAM0, 0x0c00, 0x0fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1000, 0x10ff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x1800, 0x19ff, MAP_RAM); - M6809MapMemory(DrvColRAM1, 0x1a00, 0x1bff, MAP_RAM); - M6809MapMemory(DrvM6809ROM, 0x4000, 0x7fff, MAP_ROM); - M6809MapMemory(DrvM6809ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(chanbara_write); - M6809SetReadHandler(chanbara_read); - M6809Close(); - - BurnYM2203Init(1, 1500000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, NULL, NULL, &chanbara_ay_writeA, &chanbara_ay_writeB); - BurnTimerAttachM6809(1500000); - BurnYM2203SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - M6809Exit(); - - BurnYM2203Exit(); - - GenericTilesExit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 r = (DrvColPROM[i + 0x000] << 1) & 0x0e; - INT32 g = (DrvColPROM[i + 0x100] << 1) & 0x0e; - INT32 b = (DrvColPROM[i + 0x200] << 1) & 0x0e; - - DrvPalette[i] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); - } -} - -static void draw_bg_layer() -{ - INT32 yscroll = (scrolly + 16) & 0x1ff; - - for (INT32 offs = 0; offs < 16 * 32; offs++) - { - INT32 sx = (offs & 0x0f) * 16; - INT32 sy = (offs / 0x10) * 16; - - sy -= yscroll; - if (sy < -15) sy += 512; - - INT32 code = DrvVidRAM1[offs]; - INT32 color =(DrvColRAM1[offs] & 0x3e) >> 1; - - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM2); - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 2 * 32; offs < 32 * 30; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvColRAM0[offs]; - INT32 code = DrvVidRAM0[offs] + ((attr & 0x01) * 0x100); - INT32 color = ((attr & 0x3e) >> 1) + (0x40 >> 2); - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x80; offs += 4) - { - if (DrvSprRAM[offs + 0x80] & 0x80) - { - INT32 attr0 = DrvSprRAM[offs + 0x00]; - INT32 attr1 = DrvSprRAM[offs + 0x80]; - INT32 code = DrvSprRAM[offs + 0x01] | ((attr1 & 0x10) << 5) | ((attr1 & 0x20) << 5) | ((attr1 & 0x40) << 2); - INT32 color = (attr1 & 0x0f) + (0x80>>3); - INT32 flipy = attr0 & 0x2; - INT32 sx = 240 - DrvSprRAM[offs + 0x03]; - INT32 sy = (232 - DrvSprRAM[offs + 0x02]); - - if (attr0 & 0x10) - { - if (flipy) - { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code+0, sx, sy , color, 3, 0, 0, DrvGfxROM1); - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code+1, sx, sy - 16, color, 3, 0, 0, DrvGfxROM1); - } - else - { - Render16x16Tile_Mask_Clip(pTransDraw, code+0, sx, sy - 16, color, 3, 0, 0, DrvGfxROM1); - Render16x16Tile_Mask_Clip(pTransDraw, code+1, sx, sy , color, 3, 0, 0, DrvGfxROM1); - } - } - else - { - if (flipy) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 2) draw_bg_layer(); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - UINT32 JoyInit[3] = { 0x7f, 0xff, 0xff }; - UINT8 *DrvJoys[3] = { DrvJoy[0], DrvJoy[1], DrvJoy[2] }; - - CompileInput(DrvJoys, (void*)DrvInputs, 3, 8, JoyInit); - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal = 1500000 / 60; - - M6809Open(0); - M6809NewFrame(); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - BurnTimerUpdate((i + 1) * (nCyclesTotal / nInterleave)); - - if (i == 240) vblank = 1; - } - - BurnTimerEndFrame(nCyclesTotal); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - - M6809Open(0); - BurnYM2203Scan(nAction, pnMin); - M6809Close(); - - SCAN_VAR(scrolly); - SCAN_VAR(flipscreen); - SCAN_VAR(bankdata); - } - - return 0; -} - - -// Chanbara - -static struct BurnRomInfo ChanbaraRomDesc[] = { - { "cp01.16c", 0x4000, 0xa0c3c24c, 0 | BRF_ESS | BRF_PRG }, // 0 M6809 Code - { "cp00-2.17c", 0x4000, 0xa045e463, 0 | BRF_ESS | BRF_PRG }, // 1 - { "cp02.14c", 0x8000, 0xc2b66cea, 0 | BRF_ESS | BRF_PRG }, // 2 - - { "cp12.17h", 0x2000, 0xb87b96de, 1 | BRF_GRA }, // 3 Characters - - { "cp13.15h", 0x4000, 0x2dc38c3d, 1 | BRF_GRA }, // 4 Background Tiles - { "cp14.13h", 0x2000, 0xd31db368, 1 | BRF_GRA }, // 5 - - { "cp03.12c", 0x4000, 0xdea247fb, 1 | BRF_GRA }, // 6 Sprites - { "cp04.10c", 0x4000, 0xf7dce87b, 1 | BRF_GRA }, // 7 - { "cp05.9c", 0x4000, 0xdf2dc3cb, 1 | BRF_GRA }, // 8 - { "cp06.7c", 0x4000, 0x2f337c08, 1 | BRF_GRA }, // 9 - { "cp07.6c", 0x4000, 0x0e3727f2, 1 | BRF_GRA }, // 10 - { "cp08.5c", 0x4000, 0x4cf35192, 1 | BRF_GRA }, // 11 - { "cp09.4c", 0x4000, 0x3f58b647, 1 | BRF_GRA }, // 12 - { "cp10.2c", 0x4000, 0xbfa324c0, 1 | BRF_GRA }, // 13 - { "cp11.1c", 0x4000, 0x33e6160a, 1 | BRF_GRA }, // 14 - - { "cp17.4k", 0x0100, 0xcf03706e, 1 | BRF_GRA }, // 15 Color Proms - { "cp16.5k", 0x0100, 0x5fedc8ba, 1 | BRF_GRA }, // 16 - { "cp15.6k", 0x0100, 0x655936eb, 1 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(Chanbara) -STD_ROM_FN(Chanbara) - -struct BurnDriver BurnDrvChanbara = { - "chanbara", NULL, NULL, NULL, "1985", - "Chanbara\0", NULL, "Data East", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, ChanbaraRomInfo, ChanbaraRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/dataeast/d_cninja.cpp b/jan/src/burn/drv/dataeast/d_cninja.cpp deleted file mode 100644 index e4111b3f5..000000000 --- a/jan/src/burn/drv/dataeast/d_cninja.cpp +++ /dev/null @@ -1,3640 +0,0 @@ -// FB Alpha Caveman Ninja driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "h6280_intf.h" -#include "deco16ic.h" -#include "deco146.h" -#include "burn_ym2203.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "timer.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvHucRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvSprBuf; -static UINT8 *DrvSprBuf1; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *SoundBuffer; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static INT32 scanline; -static INT32 irq_mask; -static INT32 irq_timer; - -static INT32 DrvOkiBank; - -static INT32 has_z80 = 0; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo Robocop2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Robocop2) - -static struct BurnDIPInfo CninjaDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x01, "1" }, - {0x13, 0x01, 0x03, 0x00, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Restore Life Meter" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Cninja) - -static struct BurnDIPInfo CninjauDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Credit(s) to Start" }, - {0x12, 0x01, 0x80, 0x80, "1" }, - {0x12, 0x01, 0x80, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x01, "1" }, - {0x13, 0x01, 0x03, 0x00, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Restore Life Meter" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Cninjau) - -static struct BurnDIPInfo MutantfDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Credit(s) to Start" }, - {0x12, 0x01, 0x80, 0x80, "1" }, - {0x12, 0x01, 0x80, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Timer Decrement" }, - {0x13, 0x01, 0x03, 0x01, "Slow" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x02, "Fast" }, - {0x13, 0x01, 0x03, 0x00, "Very Fast" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Life Per Stage" }, - {0x13, 0x01, 0x30, 0x00, "Least" }, - {0x13, 0x01, 0x30, 0x10, "Little" }, - {0x13, 0x01, 0x30, 0x20, "Less" }, - {0x13, 0x01, 0x30, 0x30, "Normal" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Mutantf) - -static struct BurnDIPInfo EdrandyDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Credit(s) to Start" }, - {0x12, 0x01, 0x80, 0x80, "1" }, - {0x12, 0x01, 0x80, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Player's Power" }, - {0x13, 0x01, 0x03, 0x01, "Very Low" }, - {0x13, 0x01, 0x03, 0x00, "Low" }, - {0x13, 0x01, 0x03, 0x03, "Medium" }, - {0x13, 0x01, 0x03, 0x02, "High" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Edrandy) - -static struct BurnDIPInfo EdrandcDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Player's Power" }, - {0x13, 0x01, 0x03, 0x01, "Very Low" }, - {0x13, 0x01, 0x03, 0x00, "Low" }, - {0x13, 0x01, 0x03, 0x03, "Medium" }, - {0x13, 0x01, 0x03, 0x02, "High" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Edrandc) - -static struct BurnDIPInfo Robocop2DIPList[]= -{ - {0x14, 0xff, 0xff, 0xbf, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x01, "1" }, - {0x15, 0x01, 0x03, 0x00, "2" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x15, 0x01, 0x0c, 0x08, "400 Seconds" }, - {0x15, 0x01, 0x0c, 0x0c, "300 Seconds" }, - {0x15, 0x01, 0x0c, 0x04, "200 Seconds" }, - {0x15, 0x01, 0x0c, 0x00, "100 Seconds" }, - - {0 , 0xfe, 0 , 4, "Health" }, - {0x15, 0x01, 0x30, 0x00, "17" }, - {0x15, 0x01, 0x30, 0x10, "24" }, - {0x15, 0x01, 0x30, 0x30, "33" }, - {0x15, 0x01, 0x30, 0x20, "40" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bullets" }, - {0x16, 0x01, 0x03, 0x00, "Least" }, - {0x16, 0x01, 0x03, 0x01, "Less" }, - {0x16, 0x01, 0x03, 0x03, "Normal" }, - {0x16, 0x01, 0x03, 0x02, "More" }, - - {0 , 0xfe, 0 , 4, "Enemy Movement" }, - {0x16, 0x01, 0x0c, 0x08, "Slow" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Fast" }, - {0x16, 0x01, 0x0c, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 4, "Enemy Strength" }, - {0x16, 0x01, 0x30, 0x20, "Less" }, - {0x16, 0x01, 0x30, 0x30, "Normal" }, - {0x16, 0x01, 0x30, 0x10, "More" }, - {0x16, 0x01, 0x30, 0x00, "Most" }, - - {0 , 0xfe, 0 , 2, "Enemy Weapon Speed" }, - {0x16, 0x01, 0x40, 0x40, "Normal" }, - {0x16, 0x01, 0x40, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2, "Game Over Message" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Robocop2) - -void __fastcall cninja_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x140000, data) - deco16_write_control_word(1, address, 0x150000, data) - - switch (address) - { - case 0x190000: - case 0x1a4000: - irq_mask = data & 0xff; - return; - - case 0x190002: - case 0x1a4002: - { - scanline = data & 0xff; - - if ((~irq_mask & 0x02) && (scanline > 0) && (scanline < 240)) { - irq_timer = scanline; - } else { - irq_timer = -1; - } - } - return; - - case 0x1ac000: - case 0x1b4000: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x17ff2a: - case 0x198064: - case 0x1bc0a8: - if (has_z80) { - *soundlatch = data & 0xff; - ZetNmi(); - } else { - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - break; - } - - if (address >= 0x198000 && address <= 0x19bfff) { // edrandy - deco146_104_prot_ww(0x198000, address, data); - return; - } - - if (address >= 0x1a0000 && address <= 0x1a3fff) { // edrandy - deco146_104_prot_ww(0x1a0000, address, data); - return; - } - - if (address >= 0x1bc000 && address <= 0x1bffff) { // cninja - deco146_104_prot_ww(0, address, data); - return; - } -} - -void __fastcall cninja_main_write_byte(UINT32 address, UINT8 data) -{ - // need for cliffhanger - deco16_write_control_byte(0, address, 0x140000, data) - deco16_write_control_byte(1, address, 0x150000, data) - - switch (address) - { - // case 0x190000: - case 0x190001: - // case 0x1a4000: - case 0x1a4001: - irq_mask = data & 0xff; - return; - - case 0x190002: - case 0x190003: - case 0x1a4002: - case 0x1a4003: - { - scanline = data & 0xff; - - if ((~irq_mask & 0x02) && (scanline > 0) && (scanline < 240)) { - irq_timer = scanline; - } else { - irq_timer = -1; - } - } - return; - - // case 0x1ac000: - case 0x1ac001: - // case 0x1b4000: - case 0x1b4001: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x198065: - case 0x1bc0a9: - if (has_z80) { - *soundlatch = data; - ZetNmi(); - } else { - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - break; - } - - if (address >= 0x198000 && address <= 0x19bfff) { // edrandy - deco146_104_prot_wb(0x198000, address, data); - return; - } - - if (address >= 0x1a0000 && address <= 0x1a3fff) { // edrandy - deco146_104_prot_wb(0x1a0000, address, data); - return; - } - - if (address >= 0x1bc000 && address <= 0x1bffff) { // cninja - deco146_104_prot_wb(0, address, data); - return; - } - - //bprintf(PRINT_NORMAL, _T("Write Byte %x, %x\n"), address, data); -} - -UINT16 __fastcall cninja_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x17ff22: - return (DrvDips[1] << 8) | (DrvDips[0] << 0); - - case 0x17ff28: - return (DrvInputs[1] & 0x07) | (deco16_vblank & 0x08); - - case 0x17ff2c: - return DrvInputs[0]; - - case 0x1a4002: - case 0x190002: - return scanline; - - case 0x1a4004: - case 0x190004: - SekSetIRQLine(3, CPU_IRQSTATUS_NONE); - SekSetIRQLine(4, CPU_IRQSTATUS_NONE); - return 0; - } - - if (address >= 0x198000 && address <= 0x19bfff) { // edrandy - return deco146_104_prot_rw(0x198000, address); - } - - if (address >= 0x1a0000 && address <= 0x1a3fff) { // edrandy - return deco146_104_prot_rw(0x1a0000, address); - } - - if (address >= 0x1bc000 && address <= 0x1bffff) { // cninja - return deco146_104_prot_rw(0, address); - } - - //bprintf(PRINT_NORMAL, _T("Read Word %x, %x\n"), address); - - return 0; -} - -UINT8 __fastcall cninja_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x17ff22: - return DrvDips[1]; - - case 0x17ff23: - return DrvDips[0]; - - // case 0x17ff28: - case 0x17ff29: - return (DrvInputs[1] & 0x07) | (deco16_vblank & 0x08); - - case 0x17ff2c: - return DrvInputs[0] >> 8; - - case 0x17ff2d: - return DrvInputs[0]; - - // case 0x1a4002: - case 0x1a4003: - // case 0x190002: - case 0x190003: - return scanline; - - // case 0x1a4004: - case 0x1a4005: - // case 0x190004: - case 0x190005: - SekSetIRQLine(3, CPU_IRQSTATUS_NONE); - SekSetIRQLine(4, CPU_IRQSTATUS_NONE); - return 0; - } - - if (address >= 0x198000 && address <= 0x19bfff) { // edrandy - return deco146_104_prot_rb(0x198000, address); - } - - if (address >= 0x1a0000 && address <= 0x1a3fff) { // edrandy - return deco146_104_prot_rb(0x1a0000, address); - } - - if (address >= 0x1bc000 && address <= 0x1bffff) { // cninja - return deco146_104_prot_rb(0, address); - } - - //bprintf(PRINT_NORMAL, _T("Read Byte %x, %x\n"), address); - - return 0; -} - -void __fastcall mutantf_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x300000, data) - deco16_write_control_word(1, address, 0x310000, data) - - switch (address) - { - case 0x180000: - deco16_priority = data; - return; - - case 0x1a0064: - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - break; - - case 0x1c0000: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x1e0000: - memcpy (DrvSprBuf1, DrvSprRAM1, 0x800); - return; - } - - if (address >= 0x1a0000 && address <= 0x1a3fff) { - deco146_104_prot_ww(0, address, data); - } -} - -void __fastcall mutantf_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x180000: - case 0x180001: - deco16_priority = data; - return; - - case 0x1c0000: - case 0x1c0001: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x1e0000: - case 0x1e0001: - memcpy (DrvSprBuf1, DrvSprRAM1, 0x800); - return; - - case 0x1a0065: - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - break; - } - - if (address >= 0x1a0000 && address <= 0x1a3fff) { - deco146_104_prot_wb(0, address, data); - } -} - -UINT16 __fastcall mutantf_main_read_word(UINT32 address) -{ - if (address >= 0x1a0000 && address <= 0x1a3fff) { - return deco146_104_prot_rw(0, address); - } - - return 0; -} - -UINT8 __fastcall mutantf_main_read_byte(UINT32 address) -{ - if (address == 0x1c0001) return deco16ic_71_read() & 0xff; - - if (address >= 0x1a0000 && address <= 0x1a3fff) { - return deco146_104_prot_rb(0, address); - } - - return 0; -} - -void __fastcall robocop2_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x140000, data) - deco16_write_control_word(1, address, 0x150000, data) - - switch (address) - { - case 0x1b0000: - irq_mask = data & 0xff; - return; - - case 0x1b0002: { - scanline = data & 0xff; - - if ((~irq_mask & 0x02) && (scanline > 0) && (scanline < 240)) { - irq_timer = scanline; - } else { - irq_timer = -1; - } - } - return; - - case 0x198000: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x18c064: - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return;; - - case 0x1f0000: - deco16_priority = data; - return; - } - - if (address >= 0x18c000 && address <= 0x18ffff) { - deco146_104_prot_ww(0, address, data); - } - -} - -void __fastcall robocop2_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x1b0000: - case 0x1b0001: - - irq_mask = data & 0xff; - return; - - case 0x1b0002: - case 0x1b0003: { - scanline = data & 0xff; - if ((~irq_mask & 0x02) && (scanline > 0) && (scanline < 240)) { - irq_timer = scanline; - } else { - irq_timer = -1; - } - } - return; - - case 0x198000: - case 0x198001: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x18c065: - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - break; - - case 0x1f0000: - case 0x1f0001: - deco16_priority = data; - return; - } - - if (address >= 0x18c000 && address <= 0x18ffff) { - deco146_104_prot_wb(0, address, data); - } -} - -UINT16 __fastcall robocop2_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x1b0002: - return scanline; - - case 0x1b0004: - SekSetIRQLine(3, CPU_IRQSTATUS_NONE); - SekSetIRQLine(4, CPU_IRQSTATUS_NONE); - return 0; - - case 0x1f8000: - return DrvDips[2]; - } - - if (address >= 0x18c000 && address <= 0x18ffff) { - return deco146_104_prot_rw(0, address); - } - - return 0; -} - -UINT8 __fastcall robocop2_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x1b0002: - case 0x1b0003: - return scanline; - - case 0x1b0004: - case 0x1b0005: - SekSetIRQLine(3, CPU_IRQSTATUS_NONE); - SekSetIRQLine(4, CPU_IRQSTATUS_NONE); - return 0; - - case 0x1f8000: - case 0x1f8001: - return DrvDips[2]; - } - - if (address >= 0x18c000 && address <= 0x18ffff) { - return deco146_104_prot_rb(0, address); - } - - return 0; -} - -void __fastcall stoneage_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8800: - BurnYM2151SelectRegister(data); - return; - - case 0x8801: - BurnYM2151WriteRegister(data); - return; - - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall stoneage_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8800: - case 0x8801: - return BurnYM2151ReadStatus(); - - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void DrvYM2151IrqHandler(INT32 state) -{ - ZetSetIRQLine(0, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void DrvYM2151WritePort(UINT32, UINT32 data) -{ - DrvOkiBank = data & 1; - - memcpy (DrvSndROM1, DrvSndROM1 + 0x40000 + (data & 1) * 0x40000, 0x40000); -} - -static INT32 cninja_bank_callback(const INT32 bank) -{ - if ((bank >> 4) & 0xf) return 0x0000; - return 0x1000; -} - -static INT32 mutantf_1_bank_callback(const INT32 bank) -{ - return ((bank >> 4) & 0x3) << 12; -} - -static INT32 mutantf_2_bank_callback(const INT32 bank) -{ - return ((bank >> 5) & 0x1) << 14; -} - -static INT32 robocop2_bank_callback(const INT32 bank) -{ - return (bank & 0x30) << 8; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - if (has_z80) { - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - MSM6295Reset(1); - BurnYM2151Reset(); - } else { - deco16SoundReset(); - } - - DrvYM2151WritePort(0, 0); // set initial oki bank - - deco16Reset(); - - scanline = 0; - irq_mask = 0; - irq_timer = -1; - - return 0; -} - -static void DrvBootlegCharDecode(UINT8 *gfx, INT32 len) -{ - UINT8 *dst = (UINT8*)BurnMalloc(len); - - memcpy (dst, gfx, len); - - for (INT32 r = 0; r < len; r+=4) { - for (INT32 i = 0; i < 8; i++) { - INT32 t0 = (dst[r + 3] >> (7 - (i & 7))) & 1; - INT32 t1 = (dst[r + 1] >> (7 - (i & 7))) & 1; - INT32 t2 = (dst[r + 2] >> (7 - (i & 7))) & 1; - INT32 t3 = (dst[r + 0] >> (7 - (i & 7))) & 1; - - gfx[(r * 2) + i] = (t0 << 3) | (t1 << 2) | (t2 << 1) | (t3 << 0); - } - } - - BurnFree (dst); -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x300000; - DrvGfxROM3 = Next; Next += 0xa00000; - DrvGfxROM4 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x0c0000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x008000; - DrvHucRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x000800; - DrvSprBuf = Next; Next += 0x000800; - DrvSprRAM1 = Next; Next += 0x000800; - DrvSprBuf1 = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x002000; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - SoundBuffer = (INT16*)Next; Next += nBurnSoundLen * 2 * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static UINT16 deco_104_port_a_cb() -{ - return DrvInputs[0]; -} - -static UINT16 deco_104_port_b_cb() -{ - return (DrvInputs[1] & ~8) | deco16_vblank; -} - -static UINT16 deco_104_port_c_cb() -{ - return DrvInputs[2]; -} - -static void cninja_patch() -{ - UINT16 *rom = (UINT16 *)Drv68KROM; - - for (INT32 i = 0; i < 0x80000 / 2; i++) - { - if (rom[i] == BURN_ENDIAN_SWAP_INT16(0x66ff) || rom[i] == BURN_ENDIAN_SWAP_INT16(0x67ff)) - { - if (rom[i - 4] == BURN_ENDIAN_SWAP_INT16(0x0c39) || rom[i - 4] == BURN_ENDIAN_SWAP_INT16(0x0839)) - { - rom[i - 0] = BURN_ENDIAN_SWAP_INT16(0x4e71); - rom[i - 1] = BURN_ENDIAN_SWAP_INT16(0x4e71); - rom[i - 2] = BURN_ENDIAN_SWAP_INT16(0x4e71); - rom[i - 3] = BURN_ENDIAN_SWAP_INT16(0x4e71); - rom[i - 4] = BURN_ENDIAN_SWAP_INT16(0x4e71); - } - } - } -} - -static INT32 CninjaInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x80001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x80000, 5, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x80000, 11, 1)) return 1; - - for (INT32 i = 0; i < 0x40000; i++) { - INT32 n = DrvGfxROM2[i + 0x40000]; - DrvGfxROM2[i + 0x40000] = DrvGfxROM2[i + 0x80000]; - DrvGfxROM2[i + 0x80000] = n; - } - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100001, 15, 2)) return 1; - - BurnByteswap(DrvGfxROM3, 0x200000); - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 16, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x40000, 17, 1)) return 1; - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x020000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x080000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x100000, 0); - - deco16_sprite_decode(DrvGfxROM3, 0x200000); // 16x16 - - cninja_patch(); - } - - deco16Init(0, 1, 1); - deco16_set_graphics(DrvGfxROM0, 0x20000 * 2, DrvGfxROM1, 0x080000 * 2, DrvGfxROM2, 0x100000 * 2); - deco16_set_global_offsets(0, 8); - - deco16_set_color_base(2, 0x200 + 0x000); - deco16_set_color_base(3, 0x200 + 0x300); - deco16_set_bank_callback(2, cninja_bank_callback); - deco16_set_bank_callback(3, cninja_bank_callback); - - // 146_104 prot - deco_104_init(); - deco_146_104_set_use_magic_read_address_xor(1); - deco_146_104_set_port_a_cb(deco_104_port_a_cb); - deco_146_104_set_port_b_cb(deco_104_port_b_cb); - deco_146_104_set_port_c_cb(deco_104_port_c_cb); - //deco_146_104_set_soundlatch_cb(deco_146_soundlatch_dummy); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[0], 0x144000, 0x144fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x146000, 0x146fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x14c000, 0x14c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x14e000, 0x14e7ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x154000, 0x154fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x156000, 0x156fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x15c000, 0x15c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x15e000, 0x15e7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x184000, 0x187fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x19c000, 0x19dfff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x1a4000, 0x1a47ff, MAP_RAM); - SekSetWriteWordHandler(0, cninja_main_write_word); - SekSetWriteByteHandler(0, cninja_main_write_byte); - SekSetReadWordHandler(0, cninja_main_read_word); - SekSetReadByteHandler(0, cninja_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 1, DrvYM2151WritePort, 0.45, 1006875, 0.75, 2013750, 0.60); - BurnYM2203SetAllRoutes(0, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 EdrandyInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x80001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x80000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0xc0001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0xc0000, 7, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x00000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 10, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x80000, 13, 1)) return 1; - - for (INT32 i = 0; i < 0x40000; i++) { - INT32 n = DrvGfxROM2[i + 0x40000]; - DrvGfxROM2[i + 0x40000] = DrvGfxROM2[i + 0x80000]; - DrvGfxROM2[i + 0x80000] = n; - } - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100001, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200001, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x300000, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x300001, 21, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x400000, 22, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x400001, 23, 2)) return 1; - - BurnByteswap(DrvGfxROM3, 0x500000); - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 24, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x40000, 25, 1)) return 1; - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x020000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x080000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x100000, 0); - - deco16_sprite_decode(DrvGfxROM3, 0x500000); // 16x16 - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x20000 * 2, DrvGfxROM1, 0x080000 * 2, DrvGfxROM2, 0x100000 * 2); - deco16_set_global_offsets(0, 8); - - deco16_set_color_base(2, 0x200 + 0x000); - deco16_set_color_base(3, 0x200 + 0x300); - deco16_set_bank_callback(2, cninja_bank_callback); - deco16_set_bank_callback(3, cninja_bank_callback); - - // 146_104 prot - deco_146_init(); - deco_146_104_set_port_a_cb(deco_104_port_a_cb); - deco_146_104_set_port_b_cb(deco_104_port_b_cb); - deco_146_104_set_port_c_cb(deco_104_port_c_cb); - //deco_146_104_set_soundlatch_cb(deco_146_soundlatch_dummy); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[0], 0x144000, 0x144fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x146000, 0x146fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x14c000, 0x14c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x14e000, 0x14e7ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x154000, 0x154fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x156000, 0x156fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x15c000, 0x15c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x15e000, 0x15e7ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x188000, 0x189fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x194000, 0x197fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x1bc000, 0x1bc7ff, MAP_RAM); - SekSetWriteWordHandler(0, cninja_main_write_word); - SekSetWriteByteHandler(0, cninja_main_write_byte); - SekSetReadWordHandler(0, cninja_main_read_word); - SekSetReadByteHandler(0, cninja_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 1, DrvYM2151WritePort, 0.45, 1006875, 0.75, 2013750, 0.60); - BurnYM2203SetAllRoutes(0, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 MutantfInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 3, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - - memcpy (DrvGfxROM0 + 0x50000, DrvGfxROM0 + 0x10000, 0x10000); - memcpy (DrvGfxROM0 + 0x10000, DrvGfxROM1 + 0x00000, 0x40000); - memcpy (DrvGfxROM0 + 0x60000, DrvGfxROM1 + 0x40000, 0x40000); - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x80000, 9, 1)) return 1; - - for (INT32 i = 0; i < 0x40000; i++) { - INT32 n = DrvGfxROM2[i + 0x40000]; - DrvGfxROM2[i + 0x40000] = DrvGfxROM2[i + 0x80000]; - DrvGfxROM2[i + 0x80000] = n; - } - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200001, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x400000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x400001, 15, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000001, 16, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000003, 17, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 18, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000002, 19, 4)) return 1; - - BurnByteswap(DrvGfxROM3, 0x500000); - BurnByteswap(DrvGfxROM4, 0x040000); - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 20, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x40000, 21, 1)) return 1; - - deco56_decrypt_gfx(DrvGfxROM0, 0xa0000); - deco56_decrypt_gfx(DrvGfxROM1, 0x80000); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x0a0000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x080000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x100000, 0); - - deco16_sprite_decode(DrvGfxROM3, 0x500000); // 16x16 - deco16_sprite_decode(DrvGfxROM4, 0x040000); - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0xa0000 * 2, DrvGfxROM1, 0x080000 * 2, DrvGfxROM2, 0x100000 * 2); - deco16_set_global_offsets(0, 8); - - deco16_set_color_base(0, 0x000); - deco16_set_color_base(1, 0x300); - deco16_set_color_base(2, 0x200); - deco16_set_color_base(3, 0x400); - deco16_set_bank_callback(0, mutantf_1_bank_callback); - deco16_set_bank_callback(1, mutantf_2_bank_callback); - deco16_set_bank_callback(2, mutantf_1_bank_callback); - deco16_set_bank_callback(3, mutantf_1_bank_callback); - - // 146_104 prot - deco_146_init(); - deco_146_104_set_port_a_cb(deco_104_port_a_cb); - deco_146_104_set_port_b_cb(deco_104_port_b_cb); - deco_146_104_set_port_c_cb(deco_104_port_c_cb); - //deco_146_104_set_soundlatch_cb(deco_146_soundlatch_dummy); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x160000, 0x161fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x304000, 0x305fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x306000, 0x307fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x308000, 0x3087ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x30a000, 0x30a7ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x314000, 0x315fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x316000, 0x317fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x318000, 0x3187ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x31a000, 0x31a7ff, MAP_RAM); - SekSetWriteWordHandler(0, mutantf_main_write_word); - SekSetWriteByteHandler(0, mutantf_main_write_byte); - SekSetReadWordHandler(0, mutantf_main_read_word); - SekSetReadByteHandler(0, mutantf_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 0, DrvYM2151WritePort, 0.45, 1006875, 0.75, 2013750, 0.60); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 CninjablInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(Drv68KROM + 0x80000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - - if (BurnLoadRom(tmp + 0x00000, 3, 2)) return 1; - if (BurnLoadRom(tmp + 0x00001, 4, 2)) return 1; - BurnByteswap(tmp, 0x400000); - - for (INT32 i = 0; i < 0x200000; i++) tmp[i] ^= 0xff; - - memcpy (DrvGfxROM0 + 0x000000, tmp + 0x000000, 0x020000); - memcpy (DrvGfxROM1 + 0x000000, tmp + 0x080000, 0x080000); - memcpy (DrvGfxROM2 + 0x000000, tmp + 0x180000, 0x080000); - memcpy (DrvGfxROM2 + 0x080000, tmp + 0x100000, 0x080000); - memcpy (DrvGfxROM3 + 0x000000, tmp + 0x200000, 0x200000); - - BurnFree(tmp); - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 5, 1)) return 1; - - DrvBootlegCharDecode(DrvGfxROM0, 0x020000); - deco16_sprite_decode(DrvGfxROM1, 0x080000); - deco16_sprite_decode(DrvGfxROM2, 0x100000); - deco16_sprite_decode(DrvGfxROM3, 0x200000); - } - - deco16Init(0, 1, 1); - deco16_set_graphics(DrvGfxROM0, 0x20000 * 2, DrvGfxROM1, 0x080000 * 2, DrvGfxROM2, 0x100000 * 2); - deco16_set_global_offsets(0, 8); - deco16_set_scroll_offs(3, 1, 2, 0); - deco16_set_scroll_offs(2, 1, 2, 0); - deco16_set_color_base(2, 0x200 + 0x000); - deco16_set_color_base(3, 0x200 + 0x300); - deco16_set_bank_callback(2, cninja_bank_callback); - deco16_set_bank_callback(3, cninja_bank_callback); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x138000, 0x1387ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x144000, 0x144fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x146000, 0x146fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x14c000, 0x14c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x14e000, 0x14e7ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x154000, 0x154fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x156000, 0x156fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x15c000, 0x15c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x15e000, 0x15e7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x180000, 0x187fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x19c000, 0x19dfff, MAP_RAM); - SekSetWriteWordHandler(0, cninja_main_write_word); - SekSetWriteByteHandler(0, cninja_main_write_byte); - SekSetReadWordHandler(0, cninja_main_read_word); - SekSetReadByteHandler(0, cninja_main_read_byte); - SekClose(); - - has_z80 = 1; - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(stoneage_sound_write); - ZetSetReadHandler(stoneage_sound_read); - ZetClose(); - - BurnYM2151Init(3580000); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetAllRoutes(0.45, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1006875 / 132, 1); - MSM6295Init(1, 2013750 / 132, 1); - MSM6295SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 StoneageInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x80001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x80000, 5, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x80000, 11, 1)) return 1; - - for (INT32 i = 0; i < 0x40000; i++) { - INT32 n = DrvGfxROM2[i + 0x40000]; - DrvGfxROM2[i + 0x40000] = DrvGfxROM2[i + 0x80000]; - DrvGfxROM2[i + 0x80000] = n; - } - - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100001, 15, 2)) return 1; - - BurnByteswap(DrvGfxROM3, 0x200000); - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 16, 1)) return 1; - - memset (DrvSndROM1, 0xff, 0x80000); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x020000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x080000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x100000, 0); - - deco16_sprite_decode(DrvGfxROM3, 0x200000); // 16x16 - } - - deco16Init(0, 1, 1); - deco16_set_graphics(DrvGfxROM0, 0x20000 * 2, DrvGfxROM1, 0x080000 * 2, DrvGfxROM2, 0x100000 * 2); - deco16_set_global_offsets(0, 8); - deco16_set_scroll_offs(3, 1, 10, 0); - deco16_set_scroll_offs(1, 1, 10, 0); - deco16_set_scroll_offs(0, 1, -2, 0); - deco16_set_color_base(2, 0x200 + 0x000); - deco16_set_color_base(3, 0x200 + 0x300); - deco16_set_bank_callback(2, cninja_bank_callback); - deco16_set_bank_callback(3, cninja_bank_callback); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[0], 0x144000, 0x144fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x146000, 0x146fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x14c000, 0x14c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x14e000, 0x14e7ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x154000, 0x154fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x156000, 0x156fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x15c000, 0x15c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x15e000, 0x15e7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x184000, 0x187fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x19c000, 0x19dfff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x1a4000, 0x1a47ff, MAP_RAM); - SekSetWriteWordHandler(0, cninja_main_write_word); - SekSetWriteByteHandler(0, cninja_main_write_byte); - SekSetReadWordHandler(0, cninja_main_read_word); - SekSetReadByteHandler(0, cninja_main_read_byte); - SekClose(); - - has_z80 = 1; - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(stoneage_sound_write); - ZetSetReadHandler(stoneage_sound_read); - ZetClose(); - - MSM6295Init(0, 1006875 / 132, 1); - MSM6295Init(1, 2013750 / 132, 1); - MSM6295SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.60, BURN_SND_ROUTE_BOTH); - - BurnYM2151Init(3580000); - BurnYM2151SetAllRoutes(0.45, BURN_SND_ROUTE_BOTH); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 Robocop2Init() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x80001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x80000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0xc0001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0xc0000, 7, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x00000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 10, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000, 12, 1)) return 1; - - for (INT32 i = 0; i < 0x40000; i++) { - INT32 n = DrvGfxROM1[i + 0x40000]; - DrvGfxROM1[i + 0x40000] = DrvGfxROM1[i + 0x80000]; - DrvGfxROM1[i + 0x80000] = n; - } - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 13, 1)) return 1; - memcpy (DrvGfxROM2 + 0x000000, DrvGfxROM3 + 0x000000, 0x040000); - memcpy (DrvGfxROM2 + 0x0c0000, DrvGfxROM3 + 0x040000, 0x040000); - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 14, 1)) return 1; - memcpy (DrvGfxROM2 + 0x040000, DrvGfxROM3 + 0x000000, 0x040000); - memcpy (DrvGfxROM2 + 0x100000, DrvGfxROM3 + 0x040000, 0x040000); - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 15, 1)) return 1; - memcpy (DrvGfxROM2 + 0x080000, DrvGfxROM3 + 0x000000, 0x040000); - memcpy (DrvGfxROM2 + 0x140000, DrvGfxROM3 + 0x040000, 0x040000); - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100001, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200001, 21, 2)) return 1; - - BurnByteswap(DrvGfxROM3, 0x300000); - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 22, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x40000, 23, 1)) return 1; - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x020000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x100000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM4, 0x180000, 2); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x180000, 0); - - deco16_sprite_decode(DrvGfxROM3, 0x300000); // 16x16 - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x20000 * 2, DrvGfxROM1, 0x100000 * 2, DrvGfxROM2, 0x180000 * 2); - deco16_set_global_offsets(0, 8); - - deco16_set_color_base(2, 0x200 + 0x000); - deco16_set_color_base(3, 0x200 + 0x300); - deco16_set_bank_callback(1, robocop2_bank_callback); - deco16_set_bank_callback(2, robocop2_bank_callback); - deco16_set_bank_callback(3, robocop2_bank_callback); - - // 146_104 prot - deco_146_init(); - deco_146_104_set_use_magic_read_address_xor(1); - deco_146_104_set_port_a_cb(deco_104_port_a_cb); - deco_146_104_set_port_b_cb(deco_104_port_b_cb); - deco_146_104_set_port_c_cb(deco_104_port_c_cb); - //deco_146_104_set_soundlatch_cb(deco_146_soundlatch_dummy); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[0], 0x144000, 0x144fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x146000, 0x146fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x14c000, 0x14c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x14e000, 0x14e7ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x154000, 0x154fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x156000, 0x156fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x15c000, 0x15c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x15e000, 0x15e7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x180000, 0x1807ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x1a8000, 0x1a9fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x1b8000, 0x1bbfff, MAP_RAM); - SekSetWriteWordHandler(0, robocop2_main_write_word); - SekSetWriteByteHandler(0, robocop2_main_write_byte); - SekSetReadWordHandler(0, robocop2_main_read_word); - SekSetReadByteHandler(0, robocop2_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 1, DrvYM2151WritePort, 0.45, 1006875, 0.75, 2013750, 0.60); - BurnYM2203SetAllRoutes(0, 0.60, BURN_SND_ROUTE_BOTH); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - SekExit(); - - if (has_z80) { - ZetExit(); - has_z80 = 0; - MSM6295Exit(0); - MSM6295Exit(1); - BurnYM2151Exit(); - } else { - deco16SoundExit(); - } - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void cninja_draw_sprites(int xoffset) -{ - UINT16 *buffered_spriteram = (UINT16*)DrvSprBuf; - - for (INT32 offs = 0x400 - 4; offs >=0 ; offs -= 4) - { - INT32 x, y, sprite, color, multi, flipx, flipy, inc, flash, mult, pri = 0; - sprite = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs + 1]); - if (!sprite) - continue; - - x = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs + 2]); - - switch (x & 0xc000) - { - case 0x0000: pri = 0; break; - case 0x4000: pri = 0xf0; break; - case 0x8000: pri = 0xf0 | 0xcc; break; - case 0xc000: pri = 0xf0 | 0xcc; break; - } - - y = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs]); - flash = y & 0x1000; - if (flash && (nCurrentFrame & 1)) - continue; - - color = (x >> 9) & 0x1f; - - flipx = y & 0x2000; - flipy = y & 0x4000; - multi = (1 << ((y & 0x0600) >> 9)) - 1; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= nScreenWidth) x -= 512; - if (y >= 256) y -= 512; - x = 240 - x; - y = 240 - y; - - sprite &= ~multi; - if (flipy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (*flipscreen) - { - y = 240 - y; - x = (nScreenWidth - 16) - x; - if (flipx) flipx = 0; else flipx = 1; - if (flipy) flipy = 0; else flipy = 1; - mult = 16; - } - else - mult = -16; - - while (multi >= 0) - { - deco16_draw_prio_sprite(pTransDraw, DrvGfxROM3, sprite - multi * inc, (color << 4) + 0x300, x+xoffset, y + mult * multi, flipx, flipy, pri); - - multi--; - } - } -} - -static void cninjabl_draw_sprites() -{ - UINT16 *buffered_spriteram = (UINT16*)DrvSprBuf; - INT32 offs; - INT32 endoffs; - - endoffs = 0x400 - 4; - for (offs = 0; offs < 0x400 - 4 ; offs += 4) - { - INT32 y = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs + 1]); - - if (y == 0x180) - { - endoffs = offs; - offs = 0x400 - 4; - } - } - - for (offs = endoffs; offs >=0 ; offs -= 4) - { - INT32 x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri = 0; - - sprite = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs + 0]); - y = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs + 1]); - - if (!sprite) - continue; - - x = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs + 2]); - - switch (x & 0xc000) - { - case 0x0000: pri = 0; break; - case 0x4000: pri = 0xf0; break; - case 0x8000: pri = 0xf0 | 0xcc; break; - case 0xc000: pri = 0xf0 | 0xcc; break; - } - - flash = y & 0x1000; - if (flash && (nCurrentFrame & 1)) - continue; - - colour = (x >> 9) & 0x1f; - - fx = y & 0x2000; - fy = y & 0x4000; - - multi = (1 << ((y & 0x0600) >> 9)) - 1; - - y -= multi * 16; - y += 4; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 256) x -= 512; - if (y >= 256) y -= 512; - x = 240 - x; - y = 240 - y; - - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (*flipscreen) - { - y = 240 - y; - x = 240 - x; - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - mult = 16; - } - else - mult = -16; - - while (multi >= 0) - { - deco16_draw_prio_sprite(pTransDraw, DrvGfxROM3, sprite - multi * inc, (colour << 4) + 0x300, x, y + mult * multi, fx, fy, pri); - - multi--; - } - } -} - -static void mutantf_draw_sprites(UINT8 *ram, UINT8 *gfx, INT32 colbank, INT32 gfxbank) -{ - UINT16 *spriteptr = (UINT16*)ram; - - INT32 offs, end, inc; - - if (gfxbank == 4) - { - offs = 0; - end = 0x400; - inc = 4; - } - else - { - offs = 0x3fc; - end = -4; - inc = -4; - } - - while (offs != end) - { - INT32 x, y, sprite, colour, fx, fy, w, h, sx, sy, x_mult, y_mult; - INT32 alpha = 0xff; - - sprite = BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 3]); - if (!sprite) - { - offs += inc; - continue; - } - - sx = BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 1]); - - h = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 2]) & 0xf000) >> 12; - w = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 2]) & 0x0f00) >> 8; - - sy = BURN_ENDIAN_SWAP_INT16(spriteptr[offs]); - if ((sy & 0x2000) && (nCurrentFrame & 1)) - { - offs += inc; - continue; - } - - colour = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 2]) >> 0) & 0x1f; - - if (gfxbank == 4) - { - alpha = 0x80; - colour &= 0xf; - } - - fx = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 0]) & 0x4000); - fy = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 0]) & 0x8000); - - if (*flipscreen) - { - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - - sx = sx & 0x01ff; - sy = sy & 0x01ff; - if (sx > 0x180) sx = -(0x200 - sx); - if (sy > 0x180) sy = -(0x200 - sy); - - if (fx) { x_mult = -16; sx += 16 * w; } else { x_mult = 16; sx -= 16; } - if (fy) { y_mult = -16; sy += 16 * h; } else { y_mult = 16; sy -= 16; } - } - else - { - sx = sx & 0x01ff; - sy = sy & 0x01ff; - if (sx & 0x100) sx = -(0x100 - (sx & 0xff)); - if (sy & 0x100) sy = -(0x100 - (sy & 0xff)); - sx = 304 - sx; - sy = 240 - sy; - if (sx >= 432) sx -= 512; - if (sy >= 384) sy -= 512; - if (fx) { x_mult = -16; sx += 16; } else { x_mult = 16; sx -= 16*w; } - if (fy) { y_mult = -16; sy += 16; } else { y_mult = 16; sy -= 16*h; } - } - - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - // needs alpha blending... - deco16_draw_prio_sprite(pTransDraw, gfx, sprite + y + h * x, (colour << 4) + colbank, sx + x_mult * (w-x), sy + y_mult * (h-y), fx, fy, 0); - } - } - offs += inc; - } -} - -static INT32 CninjaDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x200; - } - - deco16_clear_prio_map(); - - if (nSpriteEnable & 1) deco16_draw_layer(3, pTransDraw, DECO16_LAYER_PRIORITY(0x01) | DECO16_LAYER_OPAQUE); - if (nSpriteEnable & 2) deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - if (nSpriteEnable & 4) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x02) | DECO16_LAYER_TRANSMASK1); - if (nSpriteEnable & 8) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x04) | DECO16_LAYER_TRANSMASK0); - - cninja_draw_sprites(0); - - if (nSpriteEnable & 16) deco16_draw_layer(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 CninjablDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x200; - } - - deco16_clear_prio_map(); - - if (nSpriteEnable & 1) deco16_draw_layer(3, pTransDraw, DECO16_LAYER_PRIORITY(0x01) | DECO16_LAYER_OPAQUE); - if (nSpriteEnable & 2) deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - if (nSpriteEnable & 4) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x02) | DECO16_LAYER_TRANSMASK1); - if (nSpriteEnable & 8) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x04) | DECO16_LAYER_TRANSMASK0); - - cninjabl_draw_sprites(); - - if (nSpriteEnable & 16) deco16_draw_layer(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 EdrandyStartDraw() -{ - deco16_clear_prio_map(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0; - } - - return 0; -} - -static INT32 EdrandyDrawScanline(INT32 line) -{ - deco16_pf12_update(); - deco16_pf34_update(); - - if (nSpriteEnable & 1) deco16_draw_layer_by_line(line, line+1, 3, pTransDraw, DECO16_LAYER_PRIORITY(0x01) | DECO16_LAYER_OPAQUE); - if (nSpriteEnable & 2) deco16_draw_layer_by_line(line, line+1, 2, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - if (nSpriteEnable & 4) deco16_draw_layer_by_line(line, line+1, 1, pTransDraw, DECO16_LAYER_PRIORITY(0x04)); - - return 0; -} - -static INT32 EdrandyDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - if (nBurnLayer & 1) cninja_draw_sprites(0); - - if (nSpriteEnable & 8) deco16_draw_layer(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 Robocop2StartDraw() -{ - deco16_clear_prio_map(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x200; - } - - return 0; -} - -static INT32 Robocop2DrawScanline(INT32 line) -{ - deco16_pf12_update(); - deco16_pf34_update(); - - INT32 layer_8bpp = 0; - - if (deco16_priority & 4) - { - deco16_set_color_mask(2, 0); - deco16_set_color_mask(3, 0); - deco16_set_graphics(2, DrvGfxROM4, 0x100000, 16); - layer_8bpp = DECO16_LAYER_8BITSPERPIXEL; - } - else - { - deco16_set_color_mask(2, 0xf); - deco16_set_color_mask(3, 0xf); - deco16_set_graphics(2, DrvGfxROM2, 0x300000, 16); - - if (nSpriteEnable & 1) deco16_draw_layer_by_line(line, line+1, 3, pTransDraw, DECO16_LAYER_OPAQUE | DECO16_LAYER_PRIORITY(0x01)); - } - - if (deco16_priority & 8) { - if (nSpriteEnable & 2) deco16_draw_layer_by_line(line, line+1, 1, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - if (nSpriteEnable & 4) deco16_draw_layer_by_line(line, line+1, 2, pTransDraw, DECO16_LAYER_PRIORITY(0x04) | layer_8bpp); - } else { - if (nSpriteEnable & 2) deco16_draw_layer_by_line(line, line+1, 2, pTransDraw, DECO16_LAYER_PRIORITY(0x02) | layer_8bpp); - if (nSpriteEnable & 4) deco16_draw_layer_by_line(line, line+1, 1, pTransDraw, DECO16_LAYER_PRIORITY(0x04)); - } - - return 0; -} - -static INT32 Robocop2Draw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - cninja_draw_sprites(64); - - if (nSpriteEnable & 8) deco16_draw_layer(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 MutantfDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x400; - } - - if (nSpriteEnable & 1) deco16_draw_layer(3, pTransDraw, DECO16_LAYER_OPAQUE); - if (nSpriteEnable & 2) deco16_draw_layer(1, pTransDraw, 0); - if (nSpriteEnable & 4) deco16_draw_layer(2, pTransDraw, 0); - - if (deco16_priority & 1) - { - deco16_clear_prio_map(); - mutantf_draw_sprites(DrvSprBuf, DrvGfxROM3, 0x100, 3); - deco16_clear_prio_map(); - mutantf_draw_sprites(DrvSprBuf1, DrvGfxROM4, 0x700, 4); - } - else - { - deco16_clear_prio_map(); - mutantf_draw_sprites(DrvSprBuf1, DrvGfxROM4, 0x700, 4); - deco16_clear_prio_map(); - mutantf_draw_sprites(DrvSprBuf, DrvGfxROM3, 0x100, 3); - } - - if (nSpriteEnable & 8) deco16_draw_layer(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 CninjaFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[2] = (DrvDips[1] << 8) | (DrvDips[0] << 0); - } - - INT32 nInterleave = 232; //58 * 4 - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 58, 8055000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0x00; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - BurnTimerUpdate((i + 1) * nCyclesTotal[1] / nInterleave); - - if (irq_timer == i) { - SekSetIRQLine((irq_mask & 0x10) ? 3 : 4, CPU_IRQSTATUS_ACK); - irq_timer = -1; - } - if (i == 206) deco16_vblank = 0x08; - - if (pBurnSoundOut && i%4 == 3) { // this fixes small tempo fluxuations in cninja - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 4); - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[(i << 1) + 0] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 0] + SoundBuffer[(i << 1) + 0]); - pBurnSoundOut[(i << 1) + 1] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 1] + SoundBuffer[(i << 1) + 1]); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 EdrandyFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[2] = (DrvDips[1] << 8) | (DrvDips[0] << 0); - } - - INT32 nInterleave = 256; // scanlines - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 58, 8055000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0x00; - EdrandyStartDraw(); - - for (INT32 i = 0; i < nInterleave; i++) - { - if (irq_timer == i) { - SekSetIRQLine((irq_mask & 0x10) ? 3 : 4, CPU_IRQSTATUS_ACK); - irq_timer = -1; - } - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += h6280Run(nCyclesTotal[1] / nInterleave); - - if (i >= 8) { - EdrandyDrawScanline(i-8); - } - - if (i == 248) { - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - deco16_vblank = 0x08; - } - - if (pBurnSoundOut && i%4 == 3) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 4); - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[(i << 1) + 0] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 0] + SoundBuffer[(i << 1) + 0]); - pBurnSoundOut[(i << 1) + 1] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 1] + SoundBuffer[(i << 1) + 1]); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 Robocop2Frame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[2] = (DrvDips[1] << 8) | (DrvDips[0] << 0); - } - - INT32 nInterleave = 256; // scanlines - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14000000 / 58, 8055000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0x08; - - Robocop2StartDraw(); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += h6280Run(nCyclesTotal[1] / nInterleave); - - if (irq_timer == i) { - SekSetIRQLine((irq_mask & 0x10) ? 3 : 4, CPU_IRQSTATUS_ACK); - irq_timer = -1; - } - - if (i >= 8 && i < 248) { - deco16_vblank = 0; - Robocop2DrawScanline(i-8); - } - - if (i == 248) { - deco16_vblank = 0x08; - } - - if (pBurnSoundOut && i%8 == 7) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[(i << 1) + 0] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 0] + SoundBuffer[(i << 1) + 0]); - pBurnSoundOut[(i << 1) + 1] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 1] + SoundBuffer[(i << 1) + 1]); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 MutantfFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[2] = (DrvDips[1] << 8) | (DrvDips[0] << 0); - } - - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14000000 / 58, 8055000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += h6280Run(nCyclesTotal[1] / nInterleave); - - if (i == 240) deco16_vblank = 0x08; - - if (pBurnSoundOut && i%4 == 3) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 4); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - MutantfDraw(); - } - - return 0; -} - -static INT32 StoneageFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[2] = (DrvDips[1] << 8) | (DrvDips[0] << 0); - } - - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 58, 3579545 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - if (irq_timer == i) { - SekSetIRQLine((irq_mask & 0x10) ? 3 : 4, CPU_IRQSTATUS_ACK); - irq_timer = -1; - } - if (i == 248) deco16_vblank = 0x08; - - if (pBurnSoundOut && i%4 == 3) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 4); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - - SCAN_VAR(scanline); - SCAN_VAR(irq_mask); - SCAN_VAR(irq_timer); - - SCAN_VAR(DrvOkiBank); - DrvYM2151WritePort(0, DrvOkiBank); - } - - return 0; -} - -static INT32 StoneageScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - deco16Scan(); - - SCAN_VAR(scanline); - SCAN_VAR(irq_mask); - SCAN_VAR(irq_timer); - - SCAN_VAR(DrvOkiBank); - } - - return 0; -} - - -// Caveman Ninja (World ver 4) - -static struct BurnRomInfo cninjaRomDesc[] = { - { "gn-02-3.1k", 0x020000, 0x39aea12a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gn-05-2.3k", 0x020000, 0x0f4360ef, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gn-01-2.1j", 0x020000, 0xf740ef7e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gn-04-2.3j", 0x020000, 0xc98fcb62, 1 | BRF_PRG | BRF_ESS }, // 3 - { "gn-00.1h", 0x020000, 0x0b110b16, 1 | BRF_PRG | BRF_ESS }, // 4 - { "gn-03.1k", 0x020000, 0x1e28e697, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "gl-07.13k", 0x010000, 0xca8bef96, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "gl-08.6y", 0x010000, 0x33a2b400, 3 | BRF_GRA }, // 7 Characters - { "gl-09.6z", 0x010000, 0x5a2d4752, 3 | BRF_GRA }, // 8 - - { "mag-02.4z", 0x080000, 0xde89c69a, 4 | BRF_GRA }, // 9 Foreground Tiles - - { "mag-00.1y", 0x080000, 0xa8f05d33, 5 | BRF_GRA }, // 10 Background Tiles - { "mag-01.1z", 0x080000, 0x5b399eed, 5 | BRF_GRA }, // 11 - - { "mag-03.9y", 0x080000, 0x2220eb9f, 6 | BRF_GRA }, // 12 Sprites - { "mag-05.12y", 0x080000, 0x56a53254, 6 | BRF_GRA }, // 13 - { "mag-04.9z", 0x080000, 0x144b94cc, 6 | BRF_GRA }, // 14 - { "mag-06.12z", 0x080000, 0x82d44749, 6 | BRF_GRA }, // 15 - - { "gl-06.13j", 0x020000, 0xd92e519d, 7 | BRF_SND }, // 16 OKI M6295 Samples 0 - - { "mag-07.13f", 0x080000, 0x08eb5264, 8 | BRF_SND }, // 17 OKI M6295 Samples 1 - - { "mb7122h.7v", 0x000400, 0xa1267336, 0 | BRF_OPT }, // 18 Unused PROMs - - { "tj-00.9j", 0x000117, 0x46defe8f, 0 | BRF_OPT }, // 19 PLDs - { "tj-01.9h", 0x000117, 0x7a86902d, 0 | BRF_OPT }, // 20 - { "tj-02.9h", 0x000117, 0xb476d59c, 0 | BRF_OPT }, // 21 - { "tj-03.9e", 0x000117, 0xcfb6e4aa, 0 | BRF_OPT }, // 22 - { "tj-04.5n", 0x000117, 0xbca07086, 0 | BRF_OPT }, // 23 - { "tj-05.1r", 0x000117, 0x0dfc091b, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(cninja) -STD_ROM_FN(cninja) - -struct BurnDriver BurnDrvCninja = { - "cninja", NULL, NULL, NULL, "1991", - "Caveman Ninja (World ver 4)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, cninjaRomInfo, cninjaRomName, NULL, NULL, DrvInputInfo, CninjaDIPInfo, - CninjaInit, DrvExit, CninjaFrame, CninjaDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Caveman Ninja (World ver 1) - -static struct BurnRomInfo cninja1RomDesc[] = { - { "gn-02.1k", 0x020000, 0xa6c40959, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gn-05.3k", 0x020000, 0xa002cbe4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gn-01.1j", 0x020000, 0x18f0527c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gn-04.3j", 0x020000, 0xea4b6d53, 1 | BRF_PRG | BRF_ESS }, // 3 - { "gn-00.1h", 0x020000, 0x0b110b16, 1 | BRF_PRG | BRF_ESS }, // 4 - { "gn-03.1k", 0x020000, 0x1e28e697, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "gl-07.13k", 0x010000, 0xca8bef96, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "gl-08.6y", 0x010000, 0x33a2b400, 3 | BRF_GRA }, // 7 Characters - { "gl-09.6z", 0x010000, 0x5a2d4752, 3 | BRF_GRA }, // 8 - - { "mag-02.4z", 0x080000, 0xde89c69a, 4 | BRF_GRA }, // 9 Foreground Tiles - - { "mag-00.1y", 0x080000, 0xa8f05d33, 5 | BRF_GRA }, // 10 Background Tiles - { "mag-01.1z", 0x080000, 0x5b399eed, 5 | BRF_GRA }, // 11 - - { "mag-03.9y", 0x080000, 0x2220eb9f, 6 | BRF_GRA }, // 12 Sprites - { "mag-05.12y", 0x080000, 0x56a53254, 6 | BRF_GRA }, // 13 - { "mag-04.9z", 0x080000, 0x144b94cc, 6 | BRF_GRA }, // 14 - { "mag-06.12z", 0x080000, 0x82d44749, 6 | BRF_GRA }, // 15 - - { "gl-06.13j", 0x020000, 0xd92e519d, 7 | BRF_SND }, // 16 OKI M6295 Samples 0 - - { "mag-07.13f", 0x080000, 0x08eb5264, 8 | BRF_SND }, // 17 OKI M6295 Samples 1 - - { "mb7122h.7v", 0x000400, 0xa1267336, 0 | BRF_OPT }, // 18 Unused PROMs - - { "tj-00.9j", 0x000117, 0x46defe8f, 0 | BRF_OPT }, // 19 PLDs - { "tj-01.9h", 0x000117, 0x7a86902d, 0 | BRF_OPT }, // 20 - { "tj-02.9h", 0x000117, 0xb476d59c, 0 | BRF_OPT }, // 21 - { "tj-03.9e", 0x000117, 0xcfb6e4aa, 0 | BRF_OPT }, // 22 - { "tj-04.5n", 0x000117, 0xbca07086, 0 | BRF_OPT }, // 23 - { "tj-05.1r", 0x000117, 0x0dfc091b, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(cninja1) -STD_ROM_FN(cninja1) - -struct BurnDriver BurnDrvCninja1 = { - "cninja1", "cninja", NULL, NULL, "1991", - "Caveman Ninja (World ver 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, cninja1RomInfo, cninja1RomName, NULL, NULL, DrvInputInfo, CninjaDIPInfo, - CninjaInit, DrvExit, CninjaFrame, CninjaDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Caveman Ninja (US ver 4) - -static struct BurnRomInfo cninjauRomDesc[] = { - { "gm-02-3.1k", 0x020000, 0xd931c3b1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gm-05-2.3k", 0x020000, 0x7417d3fb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gm-01-2.1j", 0x020000, 0x72041f7e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gm-04-2.3j", 0x020000, 0x2104d005, 1 | BRF_PRG | BRF_ESS }, // 3 - { "gn-00.1h", 0x020000, 0x0b110b16, 1 | BRF_PRG | BRF_ESS }, // 4 - { "gn-03.1k", 0x020000, 0x1e28e697, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "gl-07.13k", 0x010000, 0xca8bef96, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "gl-08.6y", 0x010000, 0x33a2b400, 3 | BRF_GRA }, // 7 Characters - { "gl-09.6z", 0x010000, 0x5a2d4752, 3 | BRF_GRA }, // 8 - - { "mag-02.4z", 0x080000, 0xde89c69a, 4 | BRF_GRA }, // 9 Foreground Tiles - - { "mag-00.1y", 0x080000, 0xa8f05d33, 5 | BRF_GRA }, // 10 Background Tiles - { "mag-01.1z", 0x080000, 0x5b399eed, 5 | BRF_GRA }, // 11 - - { "mag-03.9y", 0x080000, 0x2220eb9f, 6 | BRF_GRA }, // 12 Sprites - { "mag-05.12y", 0x080000, 0x56a53254, 6 | BRF_GRA }, // 13 - { "mag-04.9z", 0x080000, 0x144b94cc, 6 | BRF_GRA }, // 14 - { "mag-06.12z", 0x080000, 0x82d44749, 6 | BRF_GRA }, // 15 - - { "gl-06.13j", 0x020000, 0xd92e519d, 7 | BRF_SND }, // 16 OKI M6295 Samples 0 - - { "mag-07.13f", 0x080000, 0x08eb5264, 8 | BRF_SND }, // 17 OKI M6295 Samples 1 - - { "mb7122h.7v", 0x000400, 0xa1267336, 0 | BRF_OPT }, // 18 Unused PROMs - - { "tj-00.9j", 0x000117, 0x46defe8f, 0 | BRF_OPT }, // 19 PLDs - { "tj-01.9h", 0x000117, 0x7a86902d, 0 | BRF_OPT }, // 20 - { "tj-02.9h", 0x000117, 0xb476d59c, 0 | BRF_OPT }, // 21 - { "tj-03.9e", 0x000117, 0xcfb6e4aa, 0 | BRF_OPT }, // 22 - { "tj-04.5n", 0x000117, 0xbca07086, 0 | BRF_OPT }, // 23 - { "tj-05.1r", 0x000117, 0x0dfc091b, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(cninjau) -STD_ROM_FN(cninjau) - -struct BurnDriver BurnDrvCninjau = { - "cninjau", "cninja", NULL, NULL, "1991", - "Caveman Ninja (US ver 4)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, cninjauRomInfo, cninjauRomName, NULL, NULL, DrvInputInfo, CninjauDIPInfo, - CninjaInit, DrvExit, CninjaFrame, CninjaDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Tatakae Genshizin Joe & Mac (Japan ver 1) - -static struct BurnRomInfo joemacRomDesc[] = { - { "gl-02-2.1k", 0x020000, 0x80da12e2, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gl-05-2.3k", 0x020000, 0xfe4dbbbb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gl-01-2.1j", 0x020000, 0x0b245307, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gl-04-2.3j", 0x020000, 0x1b331f61, 1 | BRF_PRG | BRF_ESS }, // 3 - { "gn-00.1h", 0x020000, 0x0b110b16, 1 | BRF_PRG | BRF_ESS }, // 4 - { "gn-03.1k", 0x020000, 0x1e28e697, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "gl-07.13k", 0x010000, 0xca8bef96, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "gl-08.6y", 0x010000, 0x33a2b400, 3 | BRF_GRA }, // 7 Characters - { "gl-09.6z", 0x010000, 0x5a2d4752, 3 | BRF_GRA }, // 8 - - { "mag-02.4z", 0x080000, 0xde89c69a, 4 | BRF_GRA }, // 9 Foreground Tiles - - { "mag-00.1y", 0x080000, 0xa8f05d33, 5 | BRF_GRA }, // 10 Background Tiles - { "mag-01.1z", 0x080000, 0x5b399eed, 5 | BRF_GRA }, // 11 - - { "mag-03.9y", 0x080000, 0x2220eb9f, 6 | BRF_GRA }, // 12 Sprites - { "mag-05.12y", 0x080000, 0x56a53254, 6 | BRF_GRA }, // 13 - { "mag-04.9z", 0x080000, 0x144b94cc, 6 | BRF_GRA }, // 14 - { "mag-06.12z", 0x080000, 0x82d44749, 6 | BRF_GRA }, // 15 - - { "gl-06.13j", 0x020000, 0xd92e519d, 7 | BRF_SND }, // 16 OKI M6295 Samples 0 - - { "mag-07.13f", 0x080000, 0x08eb5264, 8 | BRF_SND }, // 17 OKI M6295 Samples 1 - - { "mb7122h.7v", 0x000400, 0xa1267336, 0 | BRF_OPT }, // 18 Unused PROMs - - { "tj-00.9j", 0x000117, 0x46defe8f, 0 | BRF_OPT }, // 19 PLDs - { "tj-01.9h", 0x000117, 0x7a86902d, 0 | BRF_OPT }, // 20 - { "tj-02.9h", 0x000117, 0xb476d59c, 0 | BRF_OPT }, // 21 - { "tj-03.9e", 0x000117, 0xcfb6e4aa, 0 | BRF_OPT }, // 22 - { "tj-04.5n", 0x000117, 0xbca07086, 0 | BRF_OPT }, // 23 - { "tj-05.1r", 0x000117, 0x0dfc091b, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(joemac) -STD_ROM_FN(joemac) - -struct BurnDriver BurnDrvJoemac = { - "joemac", "cninja", NULL, NULL, "1991", - "Tatakae Genshizin Joe & Mac (Japan ver 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, joemacRomInfo, joemacRomName, NULL, NULL, DrvInputInfo, CninjaDIPInfo, - CninjaInit, DrvExit, CninjaFrame, CninjaDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Stoneage (bootleg of Caveman Ninja) - -static struct BurnRomInfo stoneageRomDesc[] = { - { "sa_1_019.bin", 0x020000, 0x7fb8c44f, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sa_1_033.bin", 0x020000, 0x961c752b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sa_1_018.bin", 0x020000, 0xa4043022, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sa_1_032.bin", 0x020000, 0xf52a3286, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sa_1_017.bin", 0x020000, 0x08d6397a, 1 | BRF_PRG | BRF_ESS }, // 4 - { "sa_1_031.bin", 0x020000, 0x103079f5, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "sa_1_012.bin", 0x010000, 0x56058934, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "gl-08.rom", 0x010000, 0x33a2b400, 3 | BRF_GRA }, // 7 Characters - { "gl-09.rom", 0x010000, 0x5a2d4752, 3 | BRF_GRA }, // 8 - - { "mag-02.rom", 0x080000, 0xde89c69a, 4 | BRF_GRA }, // 9 Foreground Tiles - - { "mag-00.rom", 0x080000, 0xa8f05d33, 5 | BRF_GRA }, // 10 Background Tiles - { "mag-01.rom", 0x080000, 0x5b399eed, 5 | BRF_GRA }, // 11 - - { "mag-03.rom", 0x080000, 0x2220eb9f, 6 | BRF_GRA }, // 12 Sprites - { "mag-05.rom", 0x080000, 0x56a53254, 6 | BRF_GRA }, // 13 - { "mag-04.rom", 0x080000, 0x144b94cc, 6 | BRF_GRA }, // 14 - { "mag-06.rom", 0x080000, 0x82d44749, 6 | BRF_GRA }, // 15 - - { "sa_1_069.bin", 0x040000, 0x2188f3ca, 7 | BRF_SND }, // 16 OKI M6295 Samples -}; - -STD_ROM_PICK(stoneage) -STD_ROM_FN(stoneage) - -struct BurnDriver BurnDrvStoneage = { - "stoneage", "cninja", NULL, NULL, "1991", - "Stoneage (bootleg of Caveman Ninja)\0", NULL, "bootleg", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, stoneageRomInfo, stoneageRomName, NULL, NULL, DrvInputInfo, CninjaDIPInfo, - StoneageInit, DrvExit, StoneageFrame, CninjaDraw, StoneageScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Caveman Ninja (bootleg) - -static struct BurnRomInfo cninjablRomDesc[] = { - { "joe mac 3.68k", 0x080000, 0xdc931d80, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "joe mac 4.68k", 0x080000, 0xe8dfe0b5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "joe mac 5.z80", 0x010000, 0xd791b9d7, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "joe mac 1.gfx", 0x200000, 0x17ea5931, 3 | BRF_GRA }, // 3 Graphics (Expanded on init) - { "joe mac 2.gfx", 0x200000, 0xcc95317b, 3 | BRF_GRA }, // 4 - - { "joe mac 6.samples", 0x080000, 0xdbecad83, 4 | BRF_SND }, // 5 OKI M6295 Samples -}; - -STD_ROM_PICK(cninjabl) -STD_ROM_FN(cninjabl) - -struct BurnDriver BurnDrvCninjabl = { - "cninjabl", "cninja", NULL, NULL, "1991", - "Caveman Ninja (bootleg)\0", NULL, "bootleg", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, cninjablRomInfo, cninjablRomName, NULL, NULL, DrvInputInfo, CninjaDIPInfo, - CninjablInit, DrvExit, StoneageFrame, CninjablDraw, StoneageScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Mutant Fighter (World ver EM-5) - -static struct BurnRomInfo mutantfRomDesc[] = { - { "hd-03-4.2c", 0x020000, 0x94859545, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hd-00-4.2a", 0x020000, 0x3cdb648f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "hd-04-1.4c", 0x020000, 0xfd2ea8d7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "hd-01-1.4a", 0x020000, 0x48a247ac, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "hd-12.21j", 0x010000, 0x13d55f11, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "hd-06-1.8d", 0x010000, 0x8b7a558b, 3 | BRF_GRA }, // 5 Characters - { "hd-07-1.9d", 0x010000, 0xd2a3d449, 3 | BRF_GRA }, // 6 - - { "maf-00.8a", 0x080000, 0xe56f528d, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "maf-01.9a", 0x080000, 0xc3d5173d, 5 | BRF_GRA }, // 8 Background Tiles - { "maf-02.11a", 0x080000, 0x0b37d849, 5 | BRF_GRA }, // 9 - - { "maf-03.18a", 0x100000, 0xf4366d2c, 6 | BRF_GRA }, // 10 Sprite Bank A - { "maf-04.20a", 0x100000, 0x0c8f654e, 6 | BRF_GRA }, // 11 - { "maf-05.21a", 0x080000, 0xb0cfeb80, 6 | BRF_GRA }, // 12 - { "maf-06.18d", 0x100000, 0xf5c7a9b5, 6 | BRF_GRA }, // 13 - { "maf-07.20d", 0x100000, 0xfd6008a3, 6 | BRF_GRA }, // 14 - { "maf-08.21d", 0x080000, 0xe41cf1e7, 6 | BRF_GRA }, // 15 - - { "hf-08.15a", 0x010000, 0x93b7279f, 7 | BRF_GRA }, // 16 Sprite Bank B - { "hf-09.17a", 0x010000, 0x05e2c074, 7 | BRF_GRA }, // 17 - { "hf-10.15c", 0x010000, 0x9b06f418, 7 | BRF_GRA }, // 18 - { "hf-11.17c", 0x010000, 0x3859a531, 7 | BRF_GRA }, // 19 - - { "maf-10.20l", 0x040000, 0x7c57f48b, 8 | BRF_SND }, // 20 OKI M6295 Samples 0 - - { "maf-09.18l", 0x080000, 0x28e7ed81, 9 | BRF_SND }, // 21 OKI M6295 Samples 1 -}; - -STD_ROM_PICK(mutantf) -STD_ROM_FN(mutantf) - -struct BurnDriver BurnDrvMutantf = { - "mutantf", NULL, NULL, NULL, "1992", - "Mutant Fighter (World ver EM-5)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, mutantfRomInfo, mutantfRomName, NULL, NULL, DrvInputInfo, MutantfDIPInfo, - MutantfInit, DrvExit, MutantfFrame, MutantfDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Mutant Fighter (World ver EM-4) - -static struct BurnRomInfo mutantf4RomDesc[] = { - { "hd-03-3.2c", 0x020000, 0xe6f53574, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hd-00-3.2a", 0x020000, 0xd3055454, 1 | BRF_PRG | BRF_ESS }, // 1 - { "hd-04-1.4c", 0x020000, 0xfd2ea8d7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "hd-01-1.4a", 0x020000, 0x48a247ac, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "hd-12.21j", 0x010000, 0x13d55f11, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "hd-06-1.8d", 0x010000, 0x8b7a558b, 3 | BRF_GRA }, // 5 Characters - { "hd-07-1.9d", 0x010000, 0xd2a3d449, 3 | BRF_GRA }, // 6 - - { "maf-00.8a", 0x080000, 0xe56f528d, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "maf-01.9a", 0x080000, 0xc3d5173d, 5 | BRF_GRA }, // 8 Background Tiles - { "maf-02.11a", 0x080000, 0x0b37d849, 5 | BRF_GRA }, // 9 - - { "maf-03.18a", 0x100000, 0xf4366d2c, 6 | BRF_GRA }, // 10 Sprite Bank A - { "maf-04.20a", 0x100000, 0x0c8f654e, 6 | BRF_GRA }, // 11 - { "maf-05.21a", 0x080000, 0xb0cfeb80, 6 | BRF_GRA }, // 12 - { "maf-06.18d", 0x100000, 0xf5c7a9b5, 6 | BRF_GRA }, // 13 - { "maf-07.20d", 0x100000, 0xfd6008a3, 6 | BRF_GRA }, // 14 - { "maf-08.21d", 0x080000, 0xe41cf1e7, 6 | BRF_GRA }, // 15 - - { "hf-08.15a", 0x010000, 0x93b7279f, 7 | BRF_GRA }, // 16 Sprite Bank B - { "hf-09.17a", 0x010000, 0x05e2c074, 7 | BRF_GRA }, // 17 - { "hf-10.15c", 0x010000, 0x9b06f418, 7 | BRF_GRA }, // 18 - { "hf-11.17c", 0x010000, 0x3859a531, 7 | BRF_GRA }, // 19 - - { "maf-10.20l", 0x040000, 0x7c57f48b, 8 | BRF_SND }, // 20 OKI M6295 Samples 0 - - { "maf-09.18l", 0x080000, 0x28e7ed81, 9 | BRF_SND }, // 21 OKI M6295 Samples 1 -}; - -STD_ROM_PICK(mutantf4) -STD_ROM_FN(mutantf4) - -struct BurnDriver BurnDrvMutantf4 = { - "mutantf4", "mutantf", NULL, NULL, "1992", - "Mutant Fighter (World ver EM-4)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, mutantf4RomInfo, mutantf4RomName, NULL, NULL, DrvInputInfo, MutantfDIPInfo, - MutantfInit, DrvExit, MutantfFrame, MutantfDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Mutant Fighter (World ver EM-3) - -static struct BurnRomInfo mutantf3RomDesc[] = { - { "hd-03-2.2c", 0x020000, 0x0586c4fa, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hd-00-2.2a", 0x020000, 0x6f8ec48e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "hd-04-1.4c", 0x020000, 0xfd2ea8d7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "hd-01-1.4a", 0x020000, 0x48a247ac, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "hd-12.21j", 0x010000, 0x13d55f11, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "hd-06-1.8d", 0x010000, 0x8b7a558b, 3 | BRF_GRA }, // 5 Characters - { "hd-07-1.9d", 0x010000, 0xd2a3d449, 3 | BRF_GRA }, // 6 - - { "maf-00.8a", 0x080000, 0xe56f528d, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "maf-01.9a", 0x080000, 0xc3d5173d, 5 | BRF_GRA }, // 8 Background Tiles - { "maf-02.11a", 0x080000, 0x0b37d849, 5 | BRF_GRA }, // 9 - - { "maf-03.18a", 0x100000, 0xf4366d2c, 6 | BRF_GRA }, // 10 Sprite Bank A - { "maf-04.20a", 0x100000, 0x0c8f654e, 6 | BRF_GRA }, // 11 - { "maf-05.21a", 0x080000, 0xb0cfeb80, 6 | BRF_GRA }, // 12 - { "maf-06.18d", 0x100000, 0xf5c7a9b5, 6 | BRF_GRA }, // 13 - { "maf-07.20d", 0x100000, 0xfd6008a3, 6 | BRF_GRA }, // 14 - { "maf-08.21d", 0x080000, 0xe41cf1e7, 6 | BRF_GRA }, // 15 - - { "hf-08.15a", 0x010000, 0x93b7279f, 7 | BRF_GRA }, // 16 Sprite Bank B - { "hf-09.17a", 0x010000, 0x05e2c074, 7 | BRF_GRA }, // 17 - { "hf-10.15c", 0x010000, 0x9b06f418, 7 | BRF_GRA }, // 18 - { "hf-11.17c", 0x010000, 0x3859a531, 7 | BRF_GRA }, // 19 - - { "maf-10.20l", 0x040000, 0x7c57f48b, 8 | BRF_SND }, // 20 OKI M6295 Samples 0 - - { "maf-09.18l", 0x080000, 0x28e7ed81, 9 | BRF_SND }, // 21 OKI M6295 Samples 1 -}; - -STD_ROM_PICK(mutantf3) -STD_ROM_FN(mutantf3) - -struct BurnDriver BurnDrvMutantf3 = { - "mutantf3", "mutantf", NULL, NULL, "1992", - "Mutant Fighter (World ver EM-3)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, mutantf3RomInfo, mutantf3RomName, NULL, NULL, DrvInputInfo, MutantfDIPInfo, - MutantfInit, DrvExit, MutantfFrame, MutantfDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Mutant Fighter (World ver EM-2) - -static struct BurnRomInfo mutantf2RomDesc[] = { - { "hd-03-1.2c", 0x020000, 0x7110cefc, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hd-00-1.2a", 0x020000, 0xb279875b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "hd-04-1.4c", 0x020000, 0xfd2ea8d7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "hd-01-1.4a", 0x020000, 0x48a247ac, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "hd-12.21j", 0x010000, 0x13d55f11, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "hd-06-1.8d", 0x010000, 0x8b7a558b, 3 | BRF_GRA }, // 5 Characters - { "hd-07-1.9d", 0x010000, 0xd2a3d449, 3 | BRF_GRA }, // 6 - - { "maf-00.8a", 0x080000, 0xe56f528d, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "maf-01.9a", 0x080000, 0xc3d5173d, 5 | BRF_GRA }, // 8 Background Tiles - { "maf-02.11a", 0x080000, 0x0b37d849, 5 | BRF_GRA }, // 9 - - { "maf-03.18a", 0x100000, 0xf4366d2c, 6 | BRF_GRA }, // 10 Sprite Bank A - { "maf-04.20a", 0x100000, 0x0c8f654e, 6 | BRF_GRA }, // 11 - { "maf-05.21a", 0x080000, 0xb0cfeb80, 6 | BRF_GRA }, // 12 - { "maf-06.18d", 0x100000, 0xf5c7a9b5, 6 | BRF_GRA }, // 13 - { "maf-07.20d", 0x100000, 0xfd6008a3, 6 | BRF_GRA }, // 14 - { "maf-08.21d", 0x080000, 0xe41cf1e7, 6 | BRF_GRA }, // 15 - - { "hf-08.15a", 0x010000, 0x93b7279f, 7 | BRF_GRA }, // 16 Sprite Bank B - { "hf-09.17a", 0x010000, 0x05e2c074, 7 | BRF_GRA }, // 17 - { "hf-10.15c", 0x010000, 0x9b06f418, 7 | BRF_GRA }, // 18 - { "hf-11.17c", 0x010000, 0x3859a531, 7 | BRF_GRA }, // 19 - - { "maf-10.20l", 0x040000, 0x7c57f48b, 8 | BRF_SND }, // 20 OKI M6295 Samples 0 - - { "maf-09.18l", 0x080000, 0x28e7ed81, 9 | BRF_SND }, // 21 OKI M6295 Samples 1 -}; - -STD_ROM_PICK(mutantf2) -STD_ROM_FN(mutantf2) - -struct BurnDriver BurnDrvMutantf2 = { - "mutantf2", "mutantf", NULL, NULL, "1992", - "Mutant Fighter (World ver EM-2)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, mutantf2RomInfo, mutantf2RomName, NULL, NULL, DrvInputInfo, MutantfDIPInfo, - MutantfInit, DrvExit, MutantfFrame, MutantfDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Death Brade (Japan ver JM-3) - -static struct BurnRomInfo deathbrdRomDesc[] = { - { "hf-03-2.2c", 0x020000, 0xfb86fff3, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hf-00-2.2a", 0x020000, 0x099aa422, 1 | BRF_PRG | BRF_ESS }, // 1 - { "hd-04-1.4c", 0x020000, 0xfd2ea8d7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "hd-01-1.4a", 0x020000, 0x48a247ac, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "hd-12.21j", 0x010000, 0x13d55f11, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "hd-06-1.8d", 0x010000, 0x8b7a558b, 3 | BRF_GRA }, // 5 Characters - { "hd-07-1.9d", 0x010000, 0xd2a3d449, 3 | BRF_GRA }, // 6 - - { "maf-00.8a", 0x080000, 0xe56f528d, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "maf-01.9a", 0x080000, 0xc3d5173d, 5 | BRF_GRA }, // 8 Background Tiles - { "maf-02.11a", 0x080000, 0x0b37d849, 5 | BRF_GRA }, // 9 - - { "maf-03.18a", 0x100000, 0xf4366d2c, 6 | BRF_GRA }, // 10 Sprite Bank A - { "maf-04.20a", 0x100000, 0x0c8f654e, 6 | BRF_GRA }, // 11 - { "maf-05.21a", 0x080000, 0xb0cfeb80, 6 | BRF_GRA }, // 12 - { "maf-06.18d", 0x100000, 0xf5c7a9b5, 6 | BRF_GRA }, // 13 - { "maf-07.20d", 0x100000, 0xfd6008a3, 6 | BRF_GRA }, // 14 - { "maf-08.21d", 0x080000, 0xe41cf1e7, 6 | BRF_GRA }, // 15 - - { "hf-08.15a", 0x010000, 0x93b7279f, 7 | BRF_GRA }, // 16 Sprite Bank B - { "hf-09.17a", 0x010000, 0x05e2c074, 7 | BRF_GRA }, // 17 - { "hf-10.15c", 0x010000, 0x9b06f418, 7 | BRF_GRA }, // 18 - { "hf-11.17c", 0x010000, 0x3859a531, 7 | BRF_GRA }, // 19 - - { "maf-10.20l", 0x040000, 0x7c57f48b, 8 | BRF_SND }, // 20 OKI M6295 Samples 0 - - { "maf-09.18l", 0x080000, 0x28e7ed81, 9 | BRF_SND }, // 21 OKI M6295 Samples 1 -}; - -STD_ROM_PICK(deathbrd) -STD_ROM_FN(deathbrd) - -struct BurnDriver BurnDrvDeathbrd = { - "deathbrd", "mutantf", NULL, NULL, "1992", - "Death Brade (Japan ver JM-3)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, deathbrdRomInfo, deathbrdRomName, NULL, NULL, DrvInputInfo, MutantfDIPInfo, - MutantfInit, DrvExit, MutantfFrame, MutantfDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// The Cliffhanger - Edward Randy (World ver 3) - -static struct BurnRomInfo edrandyRomDesc[] = { - { "gg-00-2.k1", 0x020000, 0xce1ba964, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gg-04-2.k3", 0x020000, 0x24caed19, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gg-01-2.j1", 0x020000, 0x33677b80, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gg-05-2.j3", 0x020000, 0x79a68ca6, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ge-02.h1", 0x020000, 0xc2969fbb, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ge-06.h3", 0x020000, 0x5c2e6418, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ge-03.f1", 0x020000, 0x5e7b19a8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ge-07.f3", 0x020000, 0x5eb819a1, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ge-09.k13", 0x010000, 0x9f94c60b, 2 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gg-10.y6", 0x010000, 0xb96c6cbe, 3 | BRF_GRA }, // 9 Characters - { "gg-11.z6", 0x010000, 0xee567448, 3 | BRF_GRA }, // 10 - - { "mad-02", 0x080000, 0x6c76face, 4 | BRF_GRA }, // 11 Foreground Tiles - - { "mad-00", 0x080000, 0x3735b22d, 5 | BRF_GRA }, // 12 Background Tiles - { "mad-01", 0x080000, 0x7bb13e1c, 5 | BRF_GRA }, // 13 - - { "mad-03", 0x080000, 0xc0bff892, 6 | BRF_GRA }, // 14 Sprites - { "mad-05", 0x080000, 0x3f2ccf95, 6 | BRF_GRA }, // 15 - { "mad-04", 0x080000, 0x464f3eb9, 6 | BRF_GRA }, // 16 - { "mad-06", 0x080000, 0x60871f77, 6 | BRF_GRA }, // 17 - { "mad-07", 0x080000, 0xac03466e, 6 | BRF_GRA }, // 18 - { "mad-08", 0x080000, 0x1b420ec8, 6 | BRF_GRA }, // 19 - { "mad-10", 0x080000, 0x42da8ef0, 6 | BRF_GRA }, // 20 - { "mad-11", 0x080000, 0x03c1f982, 6 | BRF_GRA }, // 21 - { "mad-09", 0x080000, 0x930f4900, 6 | BRF_GRA }, // 22 - { "mad-12", 0x080000, 0xa0bd62b6, 6 | BRF_GRA }, // 23 - - { "ge-08.j13", 0x020000, 0xdfe28c7b, 7 | BRF_SND }, // 24 OKI M6295 Samples 0 - - { "mad-13", 0x080000, 0x6ab28eba, 8 | BRF_SND }, // 25 OKI M6295 Samples 1 - - { "ge-12.v7", 0x000400, 0x278f674f, 0 | BRF_OPT }, // 26 Unused PROMs -}; - -STD_ROM_PICK(edrandy) -STD_ROM_FN(edrandy) - -struct BurnDriver BurnDrvEdrandy = { - "edrandy", NULL, NULL, NULL, "1990", - "The Cliffhanger - Edward Randy (World ver 3)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, edrandyRomInfo, edrandyRomName, NULL, NULL, DrvInputInfo, EdrandyDIPInfo, - EdrandyInit, DrvExit, EdrandyFrame, EdrandyDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// The Cliffhanger - Edward Randy (World ver 2) - -static struct BurnRomInfo edrandy2RomDesc[] = { - { "gg00-1.k1", 0x020000, 0xa029cc4a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gg04-1.k3", 0x020000, 0x8b7928a4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gg01-1.j1", 0x020000, 0x84360123, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gg05-1.j3", 0x020000, 0x0bf85d9d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ge-02.h1", 0x020000, 0xc2969fbb, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ge-06.h3", 0x020000, 0x5c2e6418, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ge-03.f1", 0x020000, 0x5e7b19a8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ge-07.f3", 0x020000, 0x5eb819a1, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ge-09.k13", 0x010000, 0x9f94c60b, 2 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gg-10.y6", 0x010000, 0xb96c6cbe, 3 | BRF_GRA }, // 9 Characters - { "gg-11.z6", 0x010000, 0xee567448, 3 | BRF_GRA }, // 10 - - { "mad-02", 0x080000, 0x6c76face, 4 | BRF_GRA }, // 11 Foreground Tiles - - { "mad-00", 0x080000, 0x3735b22d, 5 | BRF_GRA }, // 12 Background Tiles - { "mad-01", 0x080000, 0x7bb13e1c, 5 | BRF_GRA }, // 13 - - { "mad-03", 0x080000, 0xc0bff892, 6 | BRF_GRA }, // 14 Sprites - { "mad-05", 0x080000, 0x3f2ccf95, 6 | BRF_GRA }, // 15 - { "mad-04", 0x080000, 0x464f3eb9, 6 | BRF_GRA }, // 16 - { "mad-06", 0x080000, 0x60871f77, 6 | BRF_GRA }, // 17 - { "mad-07", 0x080000, 0xac03466e, 6 | BRF_GRA }, // 18 - { "mad-08", 0x080000, 0x1b420ec8, 6 | BRF_GRA }, // 19 - { "mad-10", 0x080000, 0x42da8ef0, 6 | BRF_GRA }, // 20 - { "mad-11", 0x080000, 0x03c1f982, 6 | BRF_GRA }, // 21 - { "mad-09", 0x080000, 0x930f4900, 6 | BRF_GRA }, // 22 - { "mad-12", 0x080000, 0xa0bd62b6, 6 | BRF_GRA }, // 23 - - { "ge-08.j13", 0x020000, 0xdfe28c7b, 7 | BRF_SND }, // 24 OKI M6295 Samples 0 - - { "mad-13", 0x080000, 0x6ab28eba, 8 | BRF_SND }, // 25 OKI M6295 Samples 1 - - { "ge-12.v7", 0x000400, 0x278f674f, 0 | BRF_OPT }, // 26 Unused PROMs -}; - -STD_ROM_PICK(edrandy2) -STD_ROM_FN(edrandy2) - -struct BurnDriver BurnDrvEdrandy2 = { - "edrandy2", "edrandy", NULL, NULL, "1990", - "The Cliffhanger - Edward Randy (World ver 2)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, edrandy2RomInfo, edrandy2RomName, NULL, NULL, DrvInputInfo, EdrandcDIPInfo, - EdrandyInit, DrvExit, EdrandyFrame, EdrandyDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// The Cliffhanger - Edward Randy (World ver 1) - -static struct BurnRomInfo edrandy1RomDesc[] = { - { "1.k1", 0x020000, 0xf184cdaa, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "5.k3", 0x020000, 0x7e3a4b81, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2.j1", 0x020000, 0x212cd593, 1 | BRF_PRG | BRF_ESS }, // 2 - { "6.j3", 0x020000, 0x4a96fb07, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ge-02.h1", 0x020000, 0xc2969fbb, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ge-06.h3", 0x020000, 0x5c2e6418, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ge-03.f1", 0x020000, 0x5e7b19a8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ge-07.f3", 0x020000, 0x5eb819a1, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ge-09.k13", 0x010000, 0x9f94c60b, 2 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "ge-10.y6", 0x010000, 0x2528d795, 3 | BRF_GRA }, // 9 Characters - { "ge-11.z6", 0x010000, 0xe34a931e, 3 | BRF_GRA }, // 10 - - { "mad-02", 0x080000, 0x6c76face, 4 | BRF_GRA }, // 11 Foreground Tiles - - { "mad-00", 0x080000, 0x3735b22d, 5 | BRF_GRA }, // 12 Background Tiles - { "mad-01", 0x080000, 0x7bb13e1c, 5 | BRF_GRA }, // 13 - - { "mad-03", 0x080000, 0xc0bff892, 6 | BRF_GRA }, // 14 Sprites - { "mad-05", 0x080000, 0x3f2ccf95, 6 | BRF_GRA }, // 15 - { "mad-04", 0x080000, 0x464f3eb9, 6 | BRF_GRA }, // 16 - { "mad-06", 0x080000, 0x60871f77, 6 | BRF_GRA }, // 17 - { "mad-07", 0x080000, 0xac03466e, 6 | BRF_GRA }, // 18 - { "mad-08", 0x080000, 0x1b420ec8, 6 | BRF_GRA }, // 19 - { "mad-10", 0x080000, 0x42da8ef0, 6 | BRF_GRA }, // 20 - { "mad-11", 0x080000, 0x03c1f982, 6 | BRF_GRA }, // 21 - { "mad-09", 0x080000, 0x930f4900, 6 | BRF_GRA }, // 22 - { "mad-12", 0x080000, 0xa0bd62b6, 6 | BRF_GRA }, // 23 - - { "ge-08.j13", 0x020000, 0xdfe28c7b, 7 | BRF_SND }, // 24 OKI M6295 Samples 0 - - { "mad-13", 0x080000, 0x6ab28eba, 8 | BRF_SND }, // 25 OKI M6295 Samples 1 - - { "ge-12.v7", 0x000400, 0x278f674f, 0 | BRF_OPT }, // 26 Unused PROMs -}; - -STD_ROM_PICK(edrandy1) -STD_ROM_FN(edrandy1) - -struct BurnDriver BurnDrvEdrandy1 = { - "edrandy1", "edrandy", NULL, NULL, "1990", - "The Cliffhanger - Edward Randy (World ver 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, edrandy1RomInfo, edrandy1RomName, NULL, NULL, DrvInputInfo, EdrandcDIPInfo, - EdrandyInit, DrvExit, EdrandyFrame, EdrandyDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// The Cliffhanger - Edward Randy (Japan ver 3) - -static struct BurnRomInfo edrandyjRomDesc[] = { - { "ge-00-2.k1", 0x020000, 0xb3d2403c, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ge-04-2.k3", 0x020000, 0x8a9624d6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ge-01-2.j1", 0x020000, 0x84360123, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ge-05-2.j3", 0x020000, 0x0bf85d9d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ge-02.h1", 0x020000, 0xc2969fbb, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ge-06.h3", 0x020000, 0x5c2e6418, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ge-03.f1", 0x020000, 0x5e7b19a8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ge-07.f3", 0x020000, 0x5eb819a1, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ge-09.k13", 0x010000, 0x9f94c60b, 2 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "ge-10.y6", 0x010000, 0x2528d795, 3 | BRF_GRA }, // 9 Characters - { "ge-11.z6", 0x010000, 0xe34a931e, 3 | BRF_GRA }, // 10 - - { "mad-02", 0x080000, 0x6c76face, 4 | BRF_GRA }, // 11 Foreground Tiles - - { "mad-00", 0x080000, 0x3735b22d, 5 | BRF_GRA }, // 12 Background Tiles - { "mad-01", 0x080000, 0x7bb13e1c, 5 | BRF_GRA }, // 13 - - { "mad-03", 0x080000, 0xc0bff892, 6 | BRF_GRA }, // 14 Sprites - { "mad-05", 0x080000, 0x3f2ccf95, 6 | BRF_GRA }, // 15 - { "mad-04", 0x080000, 0x464f3eb9, 6 | BRF_GRA }, // 16 - { "mad-06", 0x080000, 0x60871f77, 6 | BRF_GRA }, // 17 - { "mad-07", 0x080000, 0xac03466e, 6 | BRF_GRA }, // 18 - { "mad-08", 0x080000, 0x1b420ec8, 6 | BRF_GRA }, // 19 - { "mad-10", 0x080000, 0x42da8ef0, 6 | BRF_GRA }, // 20 - { "mad-11", 0x080000, 0x03c1f982, 6 | BRF_GRA }, // 21 - { "mad-09", 0x080000, 0x930f4900, 6 | BRF_GRA }, // 22 - { "mad-12", 0x080000, 0xa0bd62b6, 6 | BRF_GRA }, // 23 - - { "ge-08.j13", 0x020000, 0xdfe28c7b, 7 | BRF_SND }, // 24 OKI M6295 Samples 0 - - { "mad-13", 0x080000, 0x6ab28eba, 8 | BRF_SND }, // 25 OKI M6295 Samples 1 - - { "ge-12.v7", 0x000400, 0x278f674f, 0 | BRF_OPT }, // 26 Unused PROMs -}; - -STD_ROM_PICK(edrandyj) -STD_ROM_FN(edrandyj) - -struct BurnDriver BurnDrvEdrandyj = { - "edrandyj", "edrandy", NULL, NULL, "1990", - "The Cliffhanger - Edward Randy (Japan ver 3)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, edrandyjRomInfo, edrandyjRomName, NULL, NULL, DrvInputInfo, EdrandcDIPInfo, - EdrandyInit, DrvExit, EdrandyFrame, EdrandyDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Robocop 2 (Euro/Asia v0.10) - -static struct BurnRomInfo robocop2RomDesc[] = { - { "gq-03.k1", 0x020000, 0xa7e90c28, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gq-07.k3", 0x020000, 0xd2287ec1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gq-02.j1", 0x020000, 0x6777b8a0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gq-06.j3", 0x020000, 0xe11e27b5, 1 | BRF_PRG | BRF_ESS }, // 3 - { "go-01-1.h1", 0x020000, 0xab5356c0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "go-05-1.h3", 0x020000, 0xce21bda5, 1 | BRF_PRG | BRF_ESS }, // 5 - { "go-00.f1", 0x020000, 0xa93369ea, 1 | BRF_PRG | BRF_ESS }, // 6 - { "go-04.f3", 0x020000, 0xee2f6ad9, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "gp-09.k13", 0x010000, 0x4a4e0f8d, 2 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gp10-1.y6", 0x010000, 0xd25d719c, 3 | BRF_GRA }, // 9 Characters - { "gp11-1.z6", 0x010000, 0x030ded47, 3 | BRF_GRA }, // 10 - - { "mah-04.z4", 0x080000, 0x9b6ca18c, 4 | BRF_GRA }, // 11 Foreground Tiles - { "mah-03.y4", 0x080000, 0x37894ddc, 4 | BRF_GRA }, // 12 - - { "mah-01.z1", 0x080000, 0x26e0dfff, 5 | BRF_GRA }, // 13 Background Tiles - { "mah-00.y1", 0x080000, 0x7bd69e41, 5 | BRF_GRA }, // 14 - { "mah-02.a1", 0x080000, 0x328a247d, 5 | BRF_GRA }, // 15 - - { "mah-05.y9", 0x080000, 0x6773e613, 6 | BRF_GRA }, // 16 Sprites - { "mah-08.y12", 0x080000, 0x88d310a5, 6 | BRF_GRA }, // 17 - { "mah-06.z9", 0x080000, 0x27a8808a, 6 | BRF_GRA }, // 18 - { "mah-09.z12", 0x080000, 0xa58c43a7, 6 | BRF_GRA }, // 19 - { "mah-07.a9", 0x080000, 0x526f4190, 6 | BRF_GRA }, // 20 - { "mah-10.a12", 0x080000, 0x14b770da, 6 | BRF_GRA }, // 21 - - { "gp-08.j13", 0x020000, 0x365183b1, 7 | BRF_SND }, // 22 OKI M6295 Samples 0 - - { "mah-11.f13", 0x080000, 0x642bc692, 8 | BRF_SND }, // 23 OKI M6295 Samples 1 - - { "go-12.v7", 0x000400, 0x278f674f, 0 | BRF_OPT }, // 24 Unused PROMs -}; - -STD_ROM_PICK(robocop2) -STD_ROM_FN(robocop2) - -struct BurnDriver BurnDrvRobocop2 = { - "robocop2", NULL, NULL, NULL, "1991", - "Robocop 2 (Euro/Asia v0.10)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, robocop2RomInfo, robocop2RomName, NULL, NULL, Robocop2InputInfo, Robocop2DIPInfo, - Robocop2Init, DrvExit, Robocop2Frame, Robocop2Draw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Robocop 2 (US v0.10) - -static struct BurnRomInfo robocop2uRomDesc[] = { - { "gp03-3.k1", 0x020000, 0xc016a84b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gp07-3.k3", 0x020000, 0x54c541ae, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gp02-3.j1", 0x020000, 0x6777b8a0, 1 | BRF_PRG | BRF_ESS }, // 2 // == gq-02.j1 in 'robocop2' - { "gp06-3.j3", 0x020000, 0x73b8cf96, 1 | BRF_PRG | BRF_ESS }, // 3 - { "gp01-.h1", 0x020000, 0xab5356c0, 1 | BRF_PRG | BRF_ESS }, // 4 // no '-1' but matches other '-1' roms we have - { "gp05-.h3", 0x020000, 0xce21bda5, 1 | BRF_PRG | BRF_ESS }, // 5 - { "gp00-.f1", 0x020000, 0xa93369ea, 1 | BRF_PRG | BRF_ESS }, // 6 - { "gp04-.f3", 0x020000, 0xee2f6ad9, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "gp-09.k13", 0x010000, 0x4a4e0f8d, 2 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gp10-1.y6", 0x010000, 0xd25d719c, 3 | BRF_GRA }, // 9 Characters - { "gp11-1.z6", 0x010000, 0x030ded47, 3 | BRF_GRA }, // 10 - - { "mah-04.z4", 0x080000, 0x9b6ca18c, 4 | BRF_GRA }, // 11 Foreground Tiles - { "mah-03.y4", 0x080000, 0x37894ddc, 4 | BRF_GRA }, // 12 - - { "mah-01.z1", 0x080000, 0x26e0dfff, 5 | BRF_GRA }, // 13 Background Tiles - { "mah-00.y1", 0x080000, 0x7bd69e41, 5 | BRF_GRA }, // 14 - { "mah-02.a1", 0x080000, 0x328a247d, 5 | BRF_GRA }, // 15 - - { "mah-05.y9", 0x080000, 0x6773e613, 6 | BRF_GRA }, // 16 Sprites - { "mah-08.y12", 0x080000, 0x88d310a5, 6 | BRF_GRA }, // 17 - { "mah-06.z9", 0x080000, 0x27a8808a, 6 | BRF_GRA }, // 18 - { "mah-09.z12", 0x080000, 0xa58c43a7, 6 | BRF_GRA }, // 19 - { "mah-07.a9", 0x080000, 0x526f4190, 6 | BRF_GRA }, // 20 - { "mah-10.a12", 0x080000, 0x14b770da, 6 | BRF_GRA }, // 21 - - { "gp-08.j13", 0x020000, 0x365183b1, 7 | BRF_SND }, // 22 OKI M6295 Samples 0 - - { "mah-11.f13", 0x080000, 0x642bc692, 8 | BRF_SND }, // 23 OKI M6295 Samples 1 - - { "go-12.v7", 0x000400, 0x278f674f, 0 | BRF_OPT }, // 24 Unused PROMs -}; - -STD_ROM_PICK(robocop2u) -STD_ROM_FN(robocop2u) - -struct BurnDriver BurnDrvRobocop2u = { - "robocop2u", "robocop2", NULL, NULL, "1991", - "Robocop 2 (US v0.10)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, robocop2uRomInfo, robocop2uRomName, NULL, NULL, Robocop2InputInfo, Robocop2DIPInfo, - Robocop2Init, DrvExit, Robocop2Frame, Robocop2Draw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Robocop 2 (US v0.05) - -static struct BurnRomInfo robocop2uaRomDesc[] = { - { "robo03.k1", 0x020000, 0xf4c96cc9, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "robo07.k3", 0x020000, 0x11e53a7c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "robo02.j1", 0x020000, 0xfa086a0d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "robo06.j3", 0x020000, 0x703b49d0, 1 | BRF_PRG | BRF_ESS }, // 3 - { "go-01-1.h1", 0x020000, 0xab5356c0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "go-05-1.h3", 0x020000, 0xce21bda5, 1 | BRF_PRG | BRF_ESS }, // 5 - { "go-00.f1", 0x020000, 0xa93369ea, 1 | BRF_PRG | BRF_ESS }, // 6 - { "go-04.f3", 0x020000, 0xee2f6ad9, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "gp-09.k13", 0x010000, 0x4a4e0f8d, 2 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gp10-1.y6", 0x010000, 0xd25d719c, 3 | BRF_GRA }, // 9 Characters - { "gp11-1.z6", 0x010000, 0x030ded47, 3 | BRF_GRA }, // 10 - - { "mah-04.z4", 0x080000, 0x9b6ca18c, 4 | BRF_GRA }, // 11 Foreground Tiles - { "mah-03.y4", 0x080000, 0x37894ddc, 4 | BRF_GRA }, // 12 - - { "mah-01.z1", 0x080000, 0x26e0dfff, 5 | BRF_GRA }, // 13 Background Tiles - { "mah-00.y1", 0x080000, 0x7bd69e41, 5 | BRF_GRA }, // 14 - { "mah-02.a1", 0x080000, 0x328a247d, 5 | BRF_GRA }, // 15 - - { "mah-05.y9", 0x080000, 0x6773e613, 6 | BRF_GRA }, // 16 Sprites - { "mah-08.y12", 0x080000, 0x88d310a5, 6 | BRF_GRA }, // 17 - { "mah-06.z9", 0x080000, 0x27a8808a, 6 | BRF_GRA }, // 18 - { "mah-09.z12", 0x080000, 0xa58c43a7, 6 | BRF_GRA }, // 19 - { "mah-07.a9", 0x080000, 0x526f4190, 6 | BRF_GRA }, // 20 - { "mah-10.a12", 0x080000, 0x14b770da, 6 | BRF_GRA }, // 21 - - { "gp-08.j13", 0x020000, 0x365183b1, 7 | BRF_SND }, // 22 OKI M6295 Samples 0 - - { "mah-11.f13", 0x080000, 0x642bc692, 8 | BRF_SND }, // 23 OKI M6295 Samples 1 - - { "go-12.v7", 0x000400, 0x278f674f, 0 | BRF_OPT }, // 24 Unused PROMs -}; - -STD_ROM_PICK(robocop2ua) -STD_ROM_FN(robocop2ua) - -struct BurnDriver BurnDrvRobocop2ua = { - "robocop2ua", "robocop2", NULL, NULL, "1991", - "Robocop 2 (US v0.05)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, robocop2uaRomInfo, robocop2uaRomName, NULL, NULL, Robocop2InputInfo, Robocop2DIPInfo, - Robocop2Init, DrvExit, Robocop2Frame, Robocop2Draw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Robocop 2 (Japan v0.11) - -static struct BurnRomInfo robocop2jRomDesc[] = { - { "go-03-1.k1", 0x020000, 0x52506608, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "go-07-1.k3", 0x020000, 0x739cda17, 1 | BRF_PRG | BRF_ESS }, // 1 - { "go-02-1.j1", 0x020000, 0x48c0ace9, 1 | BRF_PRG | BRF_ESS }, // 2 - { "go-06-1.j3", 0x020000, 0x41abec87, 1 | BRF_PRG | BRF_ESS }, // 3 - { "go-01-1.h1", 0x020000, 0xab5356c0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "go-05-1.h3", 0x020000, 0xce21bda5, 1 | BRF_PRG | BRF_ESS }, // 5 - { "go-00.f1", 0x020000, 0xa93369ea, 1 | BRF_PRG | BRF_ESS }, // 6 - { "go-04.f3", 0x020000, 0xee2f6ad9, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "gp-09.k13", 0x010000, 0x4a4e0f8d, 2 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gp10-1.y6", 0x010000, 0xd25d719c, 3 | BRF_GRA }, // 9 Characters - { "gp11-1.z6", 0x010000, 0x030ded47, 3 | BRF_GRA }, // 10 - - { "mah-04.z4", 0x080000, 0x9b6ca18c, 4 | BRF_GRA }, // 11 Foreground Tiles - { "mah-03.y4", 0x080000, 0x37894ddc, 4 | BRF_GRA }, // 12 - - { "mah-01.z1", 0x080000, 0x26e0dfff, 5 | BRF_GRA }, // 13 Background Tiles - { "mah-00.y1", 0x080000, 0x7bd69e41, 5 | BRF_GRA }, // 14 - { "mah-02.a1", 0x080000, 0x328a247d, 5 | BRF_GRA }, // 15 - - { "mah-05.y9", 0x080000, 0x6773e613, 6 | BRF_GRA }, // 16 Sprites - { "mah-08.y12", 0x080000, 0x88d310a5, 6 | BRF_GRA }, // 17 - { "mah-06.z9", 0x080000, 0x27a8808a, 6 | BRF_GRA }, // 18 - { "mah-09.z12", 0x080000, 0xa58c43a7, 6 | BRF_GRA }, // 19 - { "mah-07.a9", 0x080000, 0x526f4190, 6 | BRF_GRA }, // 20 - { "mah-10.a12", 0x080000, 0x14b770da, 6 | BRF_GRA }, // 21 - - { "gp-08.j13", 0x020000, 0x365183b1, 7 | BRF_SND }, // 22 OKI M6295 Samples 0 - - { "mah-11.f13", 0x080000, 0x642bc692, 8 | BRF_SND }, // 23 OKI M6295 Samples 1 - - { "go-12.v7", 0x000400, 0x278f674f, 0 | BRF_OPT }, // 24 Unused PROMs -}; - -STD_ROM_PICK(robocop2j) -STD_ROM_FN(robocop2j) - -struct BurnDriver BurnDrvRobocop2j = { - "robocop2j", "robocop2", NULL, NULL, "1991", - "Robocop 2 (Japan v0.11)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, robocop2jRomInfo, robocop2jRomName, NULL, NULL, Robocop2InputInfo, Robocop2DIPInfo, - Robocop2Init, DrvExit, Robocop2Frame, Robocop2Draw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_darkseal.cpp b/jan/src/burn/drv/dataeast/d_darkseal.cpp deleted file mode 100644 index ff0ecf977..000000000 --- a/jan/src/burn/drv/dataeast/d_darkseal.cpp +++ /dev/null @@ -1,920 +0,0 @@ -// FB Alpha Dark Seal driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "h6280_intf.h" -#include "bitswap.h" -#include "deco16ic.h" -#include "burn_ym2203.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "timer.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *Drv68KRAM; -static UINT8 *DrvHucRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPalRAM; -static UINT8 *DrvPf3RAM; -static UINT8 *DrvPf2RAM; -static UINT8 *DrvPf1RAM; -static UINT8 *DrvPf12RowRAM; -static UINT8 *DrvPf34RowRAM; -static UINT8 *DrvPfCtrlRAM0; -static UINT8 *DrvPfCtrlRAM1; -static UINT32 *DrvPalette; - -static INT16 *SoundBuffer; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDip[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static UINT8 DrvRecalc = 0; -static INT32 vblank = 0; - -static struct BurnInputInfo DarksealInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Darkseal) - -static struct BurnDIPInfo DarksealDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x07, 0x01, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x38, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x38, 0x08, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "1" }, - {0x12, 0x01, 0x03, 0x01, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Energy" }, - {0x12, 0x01, 0x30, 0x00, "2" }, - {0x12, 0x01, 0x30, 0x10, "2.5" }, - {0x12, 0x01, 0x30, 0x30, "3" }, - {0x12, 0x01, 0x30, 0x20, "4" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x40, 0x00, "No" }, - {0x12, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Darkseal) - -static inline void palette_write(INT32 offset) -{ - UINT16 *data = (UINT16*)(DrvPalRAM + offset); - UINT8 r,g,b; - - r = (BURN_ENDIAN_SWAP_INT16(data[0x0000/2]) >> 0) & 0xff; - g = (BURN_ENDIAN_SWAP_INT16(data[0x0000/2]) >> 8) & 0xff; - b = (BURN_ENDIAN_SWAP_INT16(data[0x1000/2]) >> 0) & 0xff; - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -void __fastcall darkseal_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffff0) == 0x180000) { - switch (address & 0x0e) - { - case 0x06: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x08: - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } - - return; - } -} - -void __fastcall darkseal_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff0) == 0x180000) { - switch (address & 0x0f) - { - case 0x06: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x08: - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } - - return; - } - - if ((address & 0xfffff0) == 0x240000) { - *((UINT16*)(DrvPfCtrlRAM0 + (address & 0x0e))) = BURN_ENDIAN_SWAP_INT16(data); - return; - } - - if ((address & 0xfffff0) == 0x2a0000) { - *((UINT16*)(DrvPfCtrlRAM1 + (address & 0x0e))) = BURN_ENDIAN_SWAP_INT16(data); - return; - } -} - -UINT8 __fastcall darkseal_read_byte(UINT32 address) -{ - if ((address & 0xfffff0) == 0x180000) { - switch (address & 0xf) - { - case 0: - return DrvDip[1]; - - case 1: - return DrvDip[0]; - - case 2: - return DrvInputs[0] >> 8; - - case 3: - return DrvInputs[0] & 0xff; - - case 4: - return 0xff; - - case 5: - return (DrvInputs[1] ^ vblank) & 0xff; - } - - return 0xff; - } - - return 0; -} - -UINT16 __fastcall darkseal_read_word(UINT32 address) -{ - if ((address & 0xfffff0) == 0x180000) { - switch (address & 0xe) - { - case 0: - return (DrvDip[0] | (DrvDip[1]<<8)); - - case 2: - return DrvInputs[0]; - - case 4: - return DrvInputs[1] ^ vblank; - } - - return 0xffff; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - deco16SoundReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROM3 = Next; Next += 0x200000; - - MSM6295ROM = Next; Next += 0x140000; - - DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvHucRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x000800; - DrvSprBuf = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x002000; - DrvPf3RAM = Next; Next += 0x002000; - DrvPf12RowRAM = Next; Next += 0x001000; - DrvPf34RowRAM = Next; Next += 0x001000; - DrvPf2RAM = Next; Next += 0x002000; - DrvPf1RAM = Next; Next += 0x002000; - DrvPfCtrlRAM0 = Next; Next += 0x000010; - DrvPfCtrlRAM1 = Next; Next += 0x000010; - - RamEnd = Next; - - SoundBuffer = (INT16*)Next; Next += nBurnSoundLen * 2 * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x00000*8, 0x10000*8, 0x8000*8, 0x18000*8 }; - INT32 Plane1[4] = { 8, 0, 0x40000*8+8, 0x40000*8 }; - INT32 Plane2[4] = { 8, 0, 0x80000*8+8, 0x80000*8 }; - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs0[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }; - INT32 XOffs1[16] = { 32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7, 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs1[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x020000); - - GfxDecode(0x1000, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane2, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static void DrvPrgDecode() -{ - for (INT32 i = 0; i < 0x80000; i++) - Drv68KROM[i] = BITSWAP08(Drv68KROM[i], 7, 1, 5, 4, 3, 2, 6, 0); -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 3, 2)) return 1; - - if (BurnLoadRom(DrvHucROM, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x80000, 10, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(MSM6295ROM + 0x100000, 12, 1)) return 1; - - DrvPrgDecode(); - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x140000, 0x141fff, MAP_RAM); // split ram - SekMapMemory(DrvPf3RAM + 0x001000, 0x200000, 0x200fff, MAP_RAM); // mirror - SekMapMemory(DrvPf3RAM, 0x202000, 0x203fff, MAP_RAM); - SekMapMemory(DrvPf12RowRAM, 0x220000, 0x220fff, MAP_RAM); - SekMapMemory(DrvPf34RowRAM, 0x222000, 0x222fff, MAP_RAM); - SekMapMemory(DrvPf2RAM, 0x260000, 0x261fff, MAP_RAM); - SekMapMemory(DrvPf1RAM, 0x262000, 0x263fff, MAP_RAM); - SekSetWriteWordHandler(0, darkseal_write_word); - SekSetWriteByteHandler(0, darkseal_write_byte); - SekSetReadWordHandler(0, darkseal_read_word); - SekSetReadByteHandler(0, darkseal_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 1, NULL, 0.55, 1006875, 1.00, 2013750, 0.60); - BurnYM2203SetAllRoutes(0, 0.45, BURN_SND_ROUTE_BOTH); - - deco16_music_tempofix = 1; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - - deco16SoundExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - UINT16 *SprRAM = (UINT16*)DrvSprBuf; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 sprite = BURN_ENDIAN_SWAP_INT16(SprRAM[offs+1]) & 0x1fff; - if (!sprite) continue; - - INT32 y = BURN_ENDIAN_SWAP_INT16(SprRAM[offs]); - INT32 x = BURN_ENDIAN_SWAP_INT16(SprRAM[offs+2]); - - INT32 flash = ((y >> 12) & 1) & GetCurrentFrame(); - if (flash) continue; - - INT32 color = ((x >> 9) & 0x1f) + 0x10; - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi = (1 << ((y & 0x0600) >> 9)) - 1; - - x &= 0x01ff; - y &= 0x01ff; - if (x > 255) x -= 512; - if (y > 255) y -= 512; - x = 240 - x; - y = (240 - y) - 8; - - if (x > 256) continue; - - sprite &= ~multi; - - INT32 inc = -1; - - if (!fy) { - sprite += multi; - inc = 1; - } - - while (multi >= 0) - { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sprite - multi * inc, x, y+-16*multi, color, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sprite - multi * inc, x, y+-16*multi, color, 4, 0, 0, DrvGfxROM3); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sprite - multi * inc, x, y+-16*multi, color, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sprite - multi * inc, x, y+-16*multi, color, 4, 0, 0, DrvGfxROM3); - } - } - - multi--; - } - } -} - -static void draw_pf1_layer(INT32 scroll_x, INT32 scroll_y) -{ - UINT16 *vram = (UINT16*)DrvPf1RAM; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= scroll_x; - if (sx < -7) sx += 0x200; - sy -= scroll_y + 8; - if (sy < -7) sy += 0x200; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 color = code >> 12; - - code &= 0xfff; - if (!code) continue; - - if (sy >= 0 && sx >= 0 && sy <= nScreenHeight-8 && sx <= nScreenWidth-8) { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } - } -} - -static void draw_pf23_layer_no_rowscroll(UINT8 *ram, UINT8 *gfx_base, INT32 coloffs, INT32 transp, INT32 scroll_x, INT32 scroll_y) -{ - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f); - INT32 sy = (offs >> 6); - - INT32 ofst = (sx & 0x1f) + ((sy & 0x1f) << 5) + ((sx & 0x20) << 5) + ((sy & 0x20) << 6); - - sx <<= 4, sy <<= 4; - - sx -= scroll_x; - if (sx < -15) sx += 0x400; - sy -= scroll_y + 8; - if (sy < -15) sy += 0x400; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[ofst]); - INT32 color = code >> 12; - - code &= 0xfff; - if (!code && transp) continue; - - if (transp) { - if (sy >= 0 && sx >= 0 && sy <= nScreenHeight-16 && sx <= nScreenWidth-16) { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, coloffs, gfx_base); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, coloffs, gfx_base); - } - } else { - if (sy >= 0 && sx >= 0 && sy <= nScreenHeight-16 && sx <= nScreenWidth-16) { - Render16x16Tile(pTransDraw, code, sx, sy, color, 4, coloffs, gfx_base); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, coloffs, gfx_base); - } - } - } -} - -static void draw_pf23_layer_rowscroll(INT32 scroll_x, INT32 scroll_y) -{ - UINT16 *vram = (UINT16*)DrvPf3RAM; - UINT16 *rows = (UINT16*)DrvPf34RowRAM; - UINT16 *dest; - - for (INT32 y = 8; y < 248; y++) - { - INT32 row = (scroll_y + y) >> 4; - INT32 xscr = scroll_x + (BURN_ENDIAN_SWAP_INT16(rows[0x40+y]) & 0x3ff); - dest = pTransDraw + ((y-8) * nScreenWidth); - - for (INT32 x = 0; x < 256+16; x+=16) - { - INT32 col = ((xscr + x) & 0x3ff) >> 4; - INT32 sx = x - (xscr & 0x0f); - if (sx < -15) sx += 0x400; - if (sx < 0) sx += 16; - - INT32 ofst = (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6); - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[ofst]) & 0xfff; - INT32 color = ((BURN_ENDIAN_SWAP_INT16(vram[ofst]) >> 12) << 4) | 0x400; - - UINT8 *src = DrvGfxROM2 + (code << 8) + (((scroll_y + y) & 0x0f) << 4); - for (INT32 xx = sx; xx < (((sx+16) < nScreenWidth) ? (sx+16) : nScreenWidth); xx++) { - if (xx >= nScreenWidth) break; - dest[xx] = src[xx-sx] | color; - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_write(i); - } - } - - UINT16 *ctrl0 = (UINT16*)DrvPfCtrlRAM0; - UINT16 *ctrl1 = (UINT16*)DrvPfCtrlRAM1; - - INT32 flipscreen = ~BURN_ENDIAN_SWAP_INT16(ctrl0[0]) & 0x80; - - if (ctrl0[6] & 0x4000) { - draw_pf23_layer_rowscroll(BURN_ENDIAN_SWAP_INT16(ctrl0[3]) & 0x3ff, BURN_ENDIAN_SWAP_INT16(ctrl0[4]) & 0x3ff); - } else { - draw_pf23_layer_no_rowscroll(DrvPf3RAM, DrvGfxROM2, 0x400, 0, BURN_ENDIAN_SWAP_INT16(ctrl0[3]) & 0x3ff, BURN_ENDIAN_SWAP_INT16(ctrl0[4]) & 0x3ff); - } - - draw_pf23_layer_no_rowscroll(DrvPf2RAM, DrvGfxROM1, 0x300, 1, BURN_ENDIAN_SWAP_INT16(ctrl1[1]) & 0x3ff, BURN_ENDIAN_SWAP_INT16(ctrl1[2]) & 0x3ff); - - draw_sprites(); - - draw_pf1_layer(BURN_ENDIAN_SWAP_INT16(ctrl1[3]) & 0x1ff, BURN_ENDIAN_SWAP_INT16(ctrl1[4]) & 0x1ff); - - if (flipscreen) { - INT32 full = nScreenWidth * nScreenHeight; - for (INT32 i = 0; i < full / 2; i++) { - INT32 t = pTransDraw[i + 0]; - pTransDraw[i + 0] = pTransDraw[(full-1)-i]; - pTransDraw[(full-1)-i] = t; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 232; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 58, 8055000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - vblank = 8; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - BurnTimerUpdate((i + 1) * nCyclesTotal[1] / nInterleave); - - if (i == 7) vblank = 0; - if (i == 206) vblank = 8; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[(i << 1) + 0] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 0] + SoundBuffer[(i << 1) + 0]); - pBurnSoundOut[(i << 1) + 1] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 1] + SoundBuffer[(i << 1) + 1]); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - - SCAN_VAR(vblank); - } - - return 0; -} - - -// Dark Seal (World revision 3) - -static struct BurnRomInfo darksealRomDesc[] = { - { "ga_04-3.j12", 0x20000, 0xbafad556, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ga_01-3.h14", 0x20000, 0xf409050e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ga_00.h12", 0x20000, 0xfbf3ac63, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ga_05.j14", 0x20000, 0xd5e3ae3f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fz_06-1.j15", 0x10000, 0xc4828a6d, 2 | BRF_PRG | BRF_ESS }, // 4 H6280 Code - - { "fz_02.j1", 0x10000, 0x3c9c3012, 3 | BRF_GRA }, // 5 Text Tiles - { "fz_03.j2", 0x10000, 0x264b90ed, 3 | BRF_GRA }, // 6 - - { "mac-03.h3", 0x80000, 0x9996f3dc, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "mac-02.e20", 0x80000, 0x49504e89, 5 | BRF_GRA }, // 8 Background Tiles - - { "mac-00.b1", 0x80000, 0x52acf1d6, 6 | BRF_GRA }, // 9 Sprite Tiles - { "mac-01.b3", 0x80000, 0xb28f7584, 6 | BRF_GRA }, // 10 - - { "fz_08.l17", 0x20000, 0xc9bf68e1, 7 | BRF_SND }, // 11 Oki6295 #0 Samples - - { "fz_07.k14", 0x20000, 0x588dd3cb, 8 | BRF_SND }, // 12 Oki6295 #1 Samples -}; - -STD_ROM_PICK(darkseal) -STD_ROM_FN(darkseal) - -struct BurnDriver BurnDrvDarkseal = { - "darkseal", NULL, NULL, NULL, "1990", - "Dark Seal (World revision 3)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_MAZE | GBF_SCRFIGHT, 0, - NULL, darksealRomInfo, darksealRomName, NULL, NULL, DarksealInputInfo, DarksealDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Dark Seal (World revision 1) - -static struct BurnRomInfo darksea1RomDesc[] = { - { "FZ_04-4.J12", 0x20000, 0xa1a985a9, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "FZ_01-1.H14", 0x20000, 0x98bd2940, 1 | BRF_PRG | BRF_ESS }, // 1 - { "FZ_00-2.H12", 0x20000, 0xfbf3ac63, 1 | BRF_PRG | BRF_ESS }, // 2 - { "FZ_05-2.J14", 0x20000, 0xd5e3ae3f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "FZ_06-1.J15", 0x10000, 0xc4828a6d, 2 | BRF_PRG | BRF_ESS }, // 4 H6280 Code - - { "FZ_02-1.J1", 0x10000, 0x3c9c3012, 3 | BRF_GRA }, // 5 Text Tiles - { "FZ_03-1.J2", 0x10000, 0x264b90ed, 3 | BRF_GRA }, // 6 - - { "mac-03.h3", 0x80000, 0x9996f3dc, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "mac-02.e20", 0x80000, 0x49504e89, 5 | BRF_GRA }, // 8 Background Tiles - - { "mac-00.b1", 0x80000, 0x52acf1d6, 6 | BRF_GRA }, // 9 Sprite Tiles - { "mac-01.b3", 0x80000, 0xb28f7584, 6 | BRF_GRA }, // 10 - - { "FZ_08-1.K17", 0x20000, 0xc9bf68e1, 7 | BRF_SND }, // 11 Oki6295 #0 Samples - - { "FZ_07-.K14", 0x20000, 0x588dd3cb, 8 | BRF_SND }, // 12 Oki6295 #1 Samples -}; - -STD_ROM_PICK(darksea1) -STD_ROM_FN(darksea1) - -struct BurnDriver BurnDrvDarksea1 = { - "darkseal1", "darkseal", NULL, NULL, "1990", - "Dark Seal (World revision 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_MAZE | GBF_SCRFIGHT, 0, - NULL, darksea1RomInfo, darksea1RomName, NULL, NULL, DarksealInputInfo, DarksealDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Dark Seal (Japan) - -static struct BurnRomInfo darkseajRomDesc[] = { - { "fz_04-4.j12", 0x20000, 0x817faa2c, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fz_01-4.h14", 0x20000, 0x373caeee, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fz_00-2.h12", 0x20000, 0x1ab99aa7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fz_05-2.j14", 0x20000, 0x3374ef8c, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fz_06-1.j15", 0x10000, 0xc4828a6d, 2 | BRF_PRG | BRF_ESS }, // 4 H6280 Code - - { "fz_02.j1", 0x10000, 0x3c9c3012, 3 | BRF_GRA }, // 5 Text Tiles - { "fz_03.j2", 0x10000, 0x264b90ed, 3 | BRF_GRA }, // 6 - - { "mac-03.h3", 0x80000, 0x9996f3dc, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "mac-02.e20", 0x80000, 0x49504e89, 5 | BRF_GRA }, // 8 Background Tiles - - { "mac-00.b1", 0x80000, 0x52acf1d6, 6 | BRF_GRA }, // 9 Sprite Tiles - { "mac-01.b3", 0x80000, 0xb28f7584, 6 | BRF_GRA }, // 10 - - { "fz_08.l17", 0x20000, 0xc9bf68e1, 7 | BRF_SND }, // 11 Oki6295 #0 Samples - - { "fz_07.k14", 0x20000, 0x588dd3cb, 8 | BRF_SND }, // 12 Oki6295 #1 Samples -}; - -STD_ROM_PICK(darkseaj) -STD_ROM_FN(darkseaj) - -struct BurnDriver BurnDrvDarkseaj = { - "darksealj", "darkseal", NULL, NULL, "1990", - "Dark Seal (Japan)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_MAZE | GBF_SCRFIGHT, 0, - NULL, darkseajRomInfo, darkseajRomName, NULL, NULL, DarksealInputInfo, DarksealDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Gate of Doom (US revision 4) - -static struct BurnRomInfo gatedoomRomDesc[] = { - { "gb_04-4.j12", 0x20000, 0x8e3a0bfd, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gb_01-4.h14", 0x20000, 0x8d0fd383, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gb_00.h12", 0x20000, 0xa88c16a1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gb_05.j14", 0x20000, 0x252d7e14, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fz_06-1.j15", 0x10000, 0xc4828a6d, 2 | BRF_PRG | BRF_ESS }, // 4 H6280 Code - - { "fz_02.j1", 0x10000, 0x3c9c3012, 3 | BRF_GRA }, // 5 Text Tiles - { "fz_03.j2", 0x10000, 0x264b90ed, 3 | BRF_GRA }, // 6 - - { "mac-03.h3", 0x80000, 0x9996f3dc, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "mac-02.e20", 0x80000, 0x49504e89, 5 | BRF_GRA }, // 8 Background Tiles - - { "mac-00.b1", 0x80000, 0x52acf1d6, 6 | BRF_GRA }, // 9 Sprite Tiles - { "mac-01.b3", 0x80000, 0xb28f7584, 6 | BRF_GRA }, // 10 - - { "fz_08.l17", 0x20000, 0xc9bf68e1, 7 | BRF_SND }, // 11 Oki6295 #0 Samples - - { "fz_07.k14", 0x20000, 0x588dd3cb, 8 | BRF_SND }, // 12 Oki6295 #1 Samples -}; - -STD_ROM_PICK(gatedoom) -STD_ROM_FN(gatedoom) - -struct BurnDriver BurnDrvGatedoom = { - "gatedoom", "darkseal", NULL, NULL, "1990", - "Gate of Doom (US revision 4)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_MAZE | GBF_SCRFIGHT, 0, - NULL, gatedoomRomInfo, gatedoomRomName, NULL, NULL, DarksealInputInfo, DarksealDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; - - -// Gate of Doom (US revision 1) - -static struct BurnRomInfo gatedom1RomDesc[] = { - { "gb_04.j12", 0x20000, 0x4c3bbd2b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gb_01.h14", 0x20000, 0x59e367f4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gb_00.h12", 0x20000, 0xa88c16a1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gb_05.j14", 0x20000, 0x252d7e14, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fz_06-1.j15", 0x10000, 0xc4828a6d, 2 | BRF_PRG | BRF_ESS }, // 4 H6280 Code - - { "fz_02.j1", 0x10000, 0x3c9c3012, 3 | BRF_GRA }, // 5 Text Tiles - { "fz_03.j2", 0x10000, 0x264b90ed, 3 | BRF_GRA }, // 6 - - { "mac-03.h3", 0x80000, 0x9996f3dc, 4 | BRF_GRA }, // 7 Foreground Tiles - - { "mac-02.e20", 0x80000, 0x49504e89, 5 | BRF_GRA }, // 8 Background Tiles - - { "mac-00.b1", 0x80000, 0x52acf1d6, 6 | BRF_GRA }, // 9 Sprite Tiles - { "mac-01.b3", 0x80000, 0xb28f7584, 6 | BRF_GRA }, // 10 - - { "fz_08.l17", 0x20000, 0xc9bf68e1, 7 | BRF_SND }, // 11 Oki6295 #0 Samples - - { "fz_07.k14", 0x20000, 0x588dd3cb, 8 | BRF_SND }, // 12 Oki6295 #1 Samples -}; - -STD_ROM_PICK(gatedom1) -STD_ROM_FN(gatedom1) - -struct BurnDriver BurnDrvGatedom1 = { - "gatedoom1", "darkseal", NULL, NULL, "1990", - "Gate of Doom (US revision 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_MAZE | GBF_SCRFIGHT, 0, - NULL, gatedom1RomInfo, gatedom1RomName, NULL, NULL, DarksealInputInfo, DarksealDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_dassault.cpp b/jan/src/burn/drv/dataeast/d_dassault.cpp deleted file mode 100644 index 77baddd36..000000000 --- a/jan/src/burn/drv/dataeast/d_dassault.cpp +++ /dev/null @@ -1,1387 +0,0 @@ -// FB Alpha Thunder Zone / Desert Assault driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "h6280_intf.h" -#include "bitswap.h" -#include "deco16ic.h" -#include "burn_ym2203.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "timer.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM0; -static UINT8 *Drv68KROM1; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvHucRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvSprBuf0; -static UINT8 *DrvSprBuf1; -static UINT8 *DrvShareRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *SoundBuffer; - -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static INT32 DrvOkiBank; - -static struct BurnInputInfo ThndzoneInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p3 coin" }, - {"P3 Up", BIT_DIGITAL, DrvJoy2 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy2 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy2 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy2 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy2 + 15, "p4 coin" }, - {"P4 Up", BIT_DIGITAL, DrvJoy2 + 8, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy2 + 9, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy2 + 10, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy2 + 11, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Thndzone) - -static struct BurnDIPInfo ThndzoneDIPList[]= -{ - {0x20, 0xff, 0xff, 0xff, NULL }, - {0x21, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x20, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x20, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x20, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x20, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x20, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x20, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x20, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x20, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x20, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x20, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x20, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x20, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x20, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x20, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x20, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x20, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x20, 0x01, 0x40, 0x40, "Off" }, - {0x20, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x20, 0x01, 0x80, 0x80, "Off" }, - {0x20, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x21, 0x01, 0x0c, 0x08, "Easy" }, - {0x21, 0x01, 0x0c, 0x0c, "Normal" }, - {0x21, 0x01, 0x0c, 0x04, "Hard" }, - {0x21, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Max Players" }, - {0x21, 0x01, 0x20, 0x20, "2" }, - {0x21, 0x01, 0x20, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x21, 0x01, 0x80, 0x80, "Off" }, - {0x21, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Thndzone) - -static struct BurnDIPInfo DassaultDIPList[]= -{ - {0x20, 0xff, 0xff, 0xff, NULL }, - {0x21, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x20, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x20, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x20, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x20, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x20, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x20, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x20, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x20, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x20, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x20, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x20, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x20, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x20, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x20, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x20, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x20, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x20, 0x01, 0x40, 0x40, "Off" }, - {0x20, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x20, 0x01, 0x80, 0x80, "Off" }, - {0x20, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x21, 0x01, 0x0c, 0x08, "Easy" }, - {0x21, 0x01, 0x0c, 0x0c, "Normal" }, - {0x21, 0x01, 0x0c, 0x04, "Hard" }, - {0x21, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 3, "Max Players" }, - {0x21, 0x01, 0x30, 0x30, "2" }, - {0x21, 0x01, 0x30, 0x20, "3" }, - {0x21, 0x01, 0x30, 0x10, "4" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x21, 0x01, 0x80, 0x80, "Off" }, - {0x21, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dassault) - -static struct BurnDIPInfo Dassault4DIPList[]= -{ - {0x1e, 0xff, 0xff, 0xff, NULL }, - {0x1f, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x1e, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x1e, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x1e, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x1e, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x1e, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x1e, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x1e, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x1e, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1e, 0x01, 0x40, 0x40, "Off" }, - {0x1e, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x1e, 0x01, 0x80, 0x80, "Off" }, - {0x1e, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1f, 0x01, 0x0c, 0x08, "Easy" }, - {0x1f, 0x01, 0x0c, 0x0c, "Normal" }, - {0x1f, 0x01, 0x0c, 0x04, "Hard" }, - {0x1f, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1f, 0x01, 0x80, 0x80, "Off" }, - {0x1f, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dassault4) - -void __fastcall dassault_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x220000, data) - deco16_write_control_word(1, address, 0x260000, data) - - switch (address) - { - case 0x180000: - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x1c000c: - case 0x1c000d: - memcpy (DrvSprBuf1, DrvSprRAM1, 0x1000); - return; - - case 0x1c000e: - case 0x1c000f: - // coin counter - return; - } -} - -void __fastcall dassault_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x180001: - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x1c000b: - deco16_priority = data; - return; - - case 0x1c000c: - case 0x1c000d: - memcpy (DrvSprBuf1, DrvSprRAM1, 0x1000); - return; - - case 0x1c000e: - case 0x1c000f: - // coin counter - return; - } -} - -UINT16 __fastcall dassault_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x1c0000: - return DrvInputs[0]; // p1,p2 - - case 0x1c0002: - return DrvInputs[1]; // p3,p4 - - case 0x1c0004: - return DrvDips[0]; - - case 0x1c0006: - return DrvDips[1]; - - case 0x1c0008: - return (DrvInputs[2] & 0xf7) | (deco16_vblank & 0x08); - - case 0x1c000a: - case 0x1c000c: - case 0x1c000e: - return 0xffff; - } - - return 0; -} - -UINT8 __fastcall dassault_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x1c0000: - return DrvInputs[0] >> 8; - - case 0x1c0001: - return DrvInputs[0]; // p1,p2 - - case 0x1c0002: - return DrvInputs[1] >> 8; - - case 0x1c0003: - return DrvInputs[1]; // p3,p4 - - case 0x1c0004: - case 0x1c0005: - return DrvDips[0]; - - case 0x1c0006: - case 0x1c0007: - return DrvDips[1]; - - case 0x1c0008: - case 0x1c0009: - return (DrvInputs[2] & 0xf7) | (deco16_vblank & 0x08); - - case 0x1c000a: - case 0x1c000b: - case 0x1c000c: - case 0x1c000d: - case 0x1c000e: - case 0x1c000f: - return 0xff; - } - - return 0; -} - -UINT16 __fastcall dassault_sub_read_word(UINT32 address) -{ - switch (address) - { - case 0x100004: - case 0x100005: - return (deco16_vblank ? 0xffff : 0); - } - - return 0; -} - -UINT8 __fastcall dassault_sub_read_byte(UINT32 address) -{ - switch (address) - { - case 0x100004: - case 0x100005: - return (deco16_vblank ? 0xff : 0); - } - - return 0; -} - -void __fastcall dassault_sub_write_word(UINT32 address, UINT16 ) -{ - switch (address) - { - case 0x100000: - case 0x100001: - memcpy (DrvSprBuf0, DrvSprRAM0, 0x1000); - return; - } -} - -void __fastcall dassault_sub_write_byte(UINT32 address, UINT8 ) -{ - switch (address) - { - case 0x100000: - case 0x100001: - memcpy (DrvSprBuf0, DrvSprRAM0, 0x1000); - return; - } -} - -static void set_cpuA_irq(INT32 state) -{ - if (SekGetActive() == 0) { // main - SekSetIRQLine(5, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - } else { - SekClose(); - SekOpen(0); - SekSetIRQLine(5, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - SekClose(); - SekOpen(1); - } -} - -static void set_cpuB_irq(INT32 state) -{ - if (SekGetActive() == 1) { // sub - SekSetIRQLine(6, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - } else { - SekClose(); - SekOpen(1); - SekSetIRQLine(6, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - SekClose(); - SekOpen(0); - } -} - -void __fastcall dassault_irq_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffffc) == 0x3feffc) { - if (address & 2) { - set_cpuB_irq(1); - } else { - set_cpuA_irq(1); - } - } - - *((UINT16*)(DrvShareRAM + (address & 0xffe))) = BURN_ENDIAN_SWAP_INT16(data); -} - -void __fastcall dassault_irq_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffffffc) == 0x3feffc) { - if (address & 2) { - set_cpuB_irq(1); - } else { - set_cpuA_irq(1); - } - } - - DrvShareRAM[(address & 0xfff)^1] = data; -} - -UINT16 __fastcall dassault_irq_read_word(UINT32 address) -{ - if ((address & 0xffffffc) == 0x3feffc) { - if (address & 2) { - set_cpuB_irq(0); - } else { - set_cpuA_irq(0); - } - } - - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvShareRAM + (address & 0xffe)))); -} - -UINT8 __fastcall dassault_irq_read_byte(UINT32 address) -{ - if (SekGetPC(0) == 0x114c && (DrvShareRAM[0] & 0x80) && (address & ~1) == 0x3fe000) SekRunEnd(); - - if ((address & 0xffffffc) == 0x3feffc) { - if (address & 2) { - set_cpuB_irq(0); - } else { - set_cpuA_irq(0); - } - } - - return DrvShareRAM[(address & 0xfff)^1]; -} - -static void DrvYM2151WritePort(UINT32, UINT32 data) -{ - DrvOkiBank = data & 1; - - memcpy (DrvSndROM1, DrvSndROM1 + 0x40000 + (data & 1) * 0x40000, 0x40000); -} - -static INT32 dassault_bank_callback( const INT32 bank ) -{ - return ((bank >> 4) & 0xf) << 12; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - SekOpen(1); - SekReset(); - SekClose(); - - deco16SoundReset(); - - DrvYM2151WritePort(0, 0); // Set OKI1 Bank - - deco16Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM0 = Next; Next += 0x080000; - Drv68KROM1 = Next; Next += 0x080000; - - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x300000; - DrvGfxROM1 = Next; Next += 0x300000; - DrvGfxROM2 = Next; Next += 0x400000; - DrvGfxROM3 = Next; Next += 0x800000; - DrvGfxROM4 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x0c0000; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x004000; - Drv68KRAM1 = Next; Next += 0x004000; - DrvHucRAM = Next; Next += 0x002000; - - DrvSprRAM0 = Next; Next += 0x001000; - DrvSprRAM1 = Next; Next += 0x001000; - - DrvSprBuf0 = Next; Next += 0x001000; - DrvSprBuf1 = Next; Next += 0x001000; - - DrvShareRAM = Next; Next += 0x001000; - - DrvPalRAM = Next; Next += 0x004000; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - SoundBuffer = (INT16*)Next; Next += nBurnSoundLen * 2 * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM0 + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(Drv68KROM1 + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x040001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x040000, 7, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 10, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 1)) return 1; - - memcpy (DrvGfxROM3 + 0x000000, DrvGfxROM1 + 0x080000, 0x080000); - memcpy (DrvGfxROM1 + 0x090000, DrvGfxROM3 + 0x000000, 0x080000); - memcpy (DrvGfxROM1 + 0x080000, DrvGfxROM0 + 0x000000, 0x010000); - memcpy (DrvGfxROM1 + 0x110000, DrvGfxROM0 + 0x010000, 0x010000); - memset (DrvGfxROM3, 0, 0x200000); - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x080000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x180000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x280000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x300000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x380000, 21, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 22, 2)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000001, 23, 2)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x040000, 24, 2)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x040001, 25, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 26, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x040000, 27, 1)) return 1; - - deco16_tile_decode(DrvGfxROM1, DrvGfxROM0, 0x120000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x120000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x200000, 0); - deco16_tile_decode(DrvGfxROM3, DrvGfxROM3, 0x400000, 0); - deco16_tile_decode(DrvGfxROM4, DrvGfxROM4, 0x080000, 0); - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x120000 * 2, DrvGfxROM1, 0x120000 * 2, DrvGfxROM2, 0x200000 * 2); - deco16_set_global_offsets(0, 8); - deco16_set_color_base(2, 0x200); - deco16_set_color_base(3, 0x300); - deco16_set_bank_callback(0, dassault_bank_callback); - deco16_set_bank_callback(1, dassault_bank_callback); - deco16_set_bank_callback(2, dassault_bank_callback); - deco16_set_bank_callback(3, dassault_bank_callback); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x202000, 0x203fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x212000, 0x212fff, MAP_WRITE); - SekMapMemory(deco16_pf_ram[2], 0x240000, 0x240fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x242000, 0x242fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x252000, 0x252fff, MAP_WRITE); - SekMapMemory(Drv68KRAM0, 0x3f8000, 0x3fbfff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0x3fc000, 0x3fcfff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x3fe000, 0x3fefff, MAP_FETCH); - - SekSetWriteWordHandler(0, dassault_main_write_word); - SekSetWriteByteHandler(0, dassault_main_write_byte); - SekSetReadWordHandler(0, dassault_main_read_word); - SekSetReadByteHandler(0, dassault_main_read_byte); - - SekMapHandler(1, 0x3fe000, 0x3fefff, MAP_WRITE | MAP_READ); - SekSetWriteWordHandler(1, dassault_irq_write_word); - SekSetWriteByteHandler(1, dassault_irq_write_byte); - SekSetReadWordHandler(1, dassault_irq_read_word); - SekSetReadByteHandler(1, dassault_irq_read_byte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Drv68KROM1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0x3f8000, 0x3fbfff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x3fc000, 0x3fcfff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x3fe000, 0x3fefff, MAP_FETCH); - - SekSetWriteWordHandler(0, dassault_sub_write_word); - SekSetWriteByteHandler(0, dassault_sub_write_byte); - SekSetReadWordHandler(0, dassault_sub_read_word); - SekSetReadByteHandler(0, dassault_sub_read_byte); - - SekMapHandler(1, 0x3fe000, 0x3fefff, MAP_WRITE | MAP_READ); - - SekSetWriteWordHandler(1, dassault_irq_write_word); - SekSetWriteByteHandler(1, dassault_irq_write_byte); - SekSetReadWordHandler(1, dassault_irq_read_word); - SekSetReadByteHandler(1, dassault_irq_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 1, DrvYM2151WritePort, 0.45, 1006875, 0.50, 2013750, 0.25); - BurnYM2203SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - SekExit(); - deco16SoundExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites(INT32 bpp) -{ - if ((nBurnBpp & 4) != bpp) return; - - UINT16 *spritebase; - UINT8 *gfx; - - for (INT32 bank = 0; bank < 2; bank++) - { - for (INT32 offs = 0x800 - 4; offs >= 0; offs -= 4) - { - INT32 alpha = 0xff, pmask = 0, coloff = 0; - - if (bank == 0) - { - spritebase = (UINT16*)DrvSprBuf0; - gfx = DrvGfxROM3; - coloff = 0x400; - } - else - { - spritebase = (UINT16*)DrvSprBuf1; - gfx = DrvGfxROM4; - coloff = 0x800; - } - - INT32 sprite = BURN_ENDIAN_SWAP_INT16(spritebase[offs + 1]) & 0x7fff; - if (!sprite) continue; - - INT32 x = BURN_ENDIAN_SWAP_INT16(spritebase[offs + 2]); - INT32 y = BURN_ENDIAN_SWAP_INT16(spritebase[offs + 0]); - - if ((y & 0x1000) && (nCurrentFrame & 1)) continue; // flash - - INT32 color = ((x >> 9) & 0x1f) | ((y >> 10) & 0x20); - - INT32 flipx = y & 0x2000; - INT32 flipy = y & 0x4000; - INT32 multi = (1 << ((y & 0x0600) >> 9)) - 1; - - if (bank == 0) { - switch (BURN_ENDIAN_SWAP_INT16(spritebase[offs+2]) & 0xc000) - { - case 0xc000: pmask = 0x01; break; - case 0x8000: pmask = 0x08; break; - case 0x4000: pmask = 0x20; break; - case 0x0000: pmask = 0x80; break; - } - } else { - switch (deco16_priority & 0x03) - { - case 0x0001: pmask = 0x10; break; - case 0x0002: - case 0x0003: - case 0x0000: pmask = 0x40; break; - } - - if (x & 0xc000) alpha = 0x80; - } - - x &= 0x01ff; - y &= 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - x = 304 - x; - y = 240 - y; - if (x > 320) continue; - - INT32 inc, mult; - sprite &= ~multi; - if (flipy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (*flipscreen) - { - y = 240 - y; - x = 304 - x; - flipx = !flipx; - flipy = !flipy; - mult = 16; - } - else mult = -16; - - while (multi >= 0) - { - if (!bpp) - { - // hack around lack of alpha blending support for < 32bit color depths - // let's make these flicker rather than disabling them or drawing them solid - if (alpha != 0xff && (nCurrentFrame % 3) == 2) { // only draw every third frame - multi--; - continue; - } - - deco16_draw_prio_sprite(pTransDraw, gfx, sprite - multi * inc, (color << 4) + coloff, x, y + mult * multi, flipx, flipy, pmask, 1 << bank); - } else { - deco16_draw_alphaprio_sprite(DrvPalette, gfx, sprite - multi * inc, (color << 4) + coloff, x, y + mult * multi, flipx, flipy, pmask, 1 << bank, alpha); - } - - multi--; - } - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0xc00; - } - - deco16_clear_prio_map(); - - if (nBurnLayer & 1) deco16_draw_layer(3, pTransDraw, DECO16_LAYER_OPAQUE | DECO16_LAYER_PRIORITY(0)); - - switch (deco16_priority & 3) - { - case 0: - if (nBurnLayer & 4) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - if (nBurnLayer & 2) deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x10)); - break; - - case 1: - if (nBurnLayer & 2) deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - if (nBurnLayer & 4) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x40)); - break; - - case 2: break; - - case 3: - if (nBurnLayer & 2) deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - if (nBurnLayer & 4) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x10)); - break; - } - - if (nBurnLayer & 8) deco16_draw_layer(0, pTransDraw, DECO16_LAYER_PRIORITY(0xff)); - - if (nSpriteEnable & 1) draw_sprites(0); - - BurnTransferCopy(DrvPalette); - - if (nSpriteEnable & 2) draw_sprites(4); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[3] = { 14000000 / 60, 14000000 / 60, 4027500 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - h6280NewFrame(); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - SekOpen(0); - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1)) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - SekOpen(1); - nCyclesDone[1] += SekRun(nCyclesDone[0] - nCyclesDone[1]); - if (i == (nInterleave - 1)) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - BurnTimerUpdate((i + 1) * nCyclesTotal[2] / nInterleave); - - if (i == 248) deco16_vblank = 0x08; - - if (pBurnSoundOut && i%7 == 6) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 7); - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - BurnTimerEndFrame(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[(i << 1) + 0] += SoundBuffer[(i << 1) + 0]; - pBurnSoundOut[(i << 1) + 1] += SoundBuffer[(i << 1) + 1]; - } - } - - h6280Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - - SCAN_VAR(DrvOkiBank); - DrvYM2151WritePort(0, DrvOkiBank); - } - - return 0; -} - - -// Thunder Zone (World, Rev1) - -static struct BurnRomInfo thndzoneRomDesc[] = { - { "gz01-1.a15", 0x020000, 0x20250da6, 1 | BRF_PRG | BRF_ESS }, // 0 68k 'A' Code - { "gz03-1.a17", 0x020000, 0x3595fad0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gt00.a14", 0x020000, 0xb7277175, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gt02.a16", 0x020000, 0xcde31e35, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gz10-1.a12", 0x020000, 0x811d86d7, 2 | BRF_PRG | BRF_ESS }, // 4 68k 'B' Code - { "gz08-1.a9", 0x020000, 0x8f61ab1e, 2 | BRF_PRG | BRF_ESS }, // 5 - { "gt11-1.a14", 0x020000, 0x80cb23de, 2 | BRF_PRG | BRF_ESS }, // 6 - { "gt09-1.a11", 0x020000, 0x0a8fa7e1, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "gt04.f18", 0x010000, 0x81c29ebf, 3 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gt05.h11", 0x010000, 0x0aae996a, 4 | BRF_GRA }, // 9 Characters - { "gt06.h12", 0x010000, 0x4efdf03d, 4 | BRF_GRA }, // 10 - - { "maj-02.h14", 0x100000, 0x383bbc37, 5 | BRF_GRA }, // 11 Foreground Tiles - - { "maj-01.c18", 0x100000, 0x9840a204, 6 | BRF_GRA }, // 12 Background Tiles - { "maj-00.c17", 0x100000, 0x87ea8d16, 6 | BRF_GRA }, // 13 - - { "maj-04.r1", 0x080000, 0x36e49b19, 7 | BRF_GRA }, // 14 Sprite Bank A - { "maj-05.r2", 0x080000, 0x80fc71cc, 7 | BRF_GRA }, // 15 - { "maj-06.r3", 0x080000, 0x2e7a684b, 7 | BRF_GRA }, // 16 - { "maj-07.r5", 0x080000, 0x3acc1f78, 7 | BRF_GRA }, // 17 - { "maj-08.s6", 0x080000, 0x1958a36d, 7 | BRF_GRA }, // 18 - { "maj-09.s8", 0x080000, 0xc21087a1, 7 | BRF_GRA }, // 19 - { "maj-10.s9", 0x080000, 0xa02fa641, 7 | BRF_GRA }, // 20 - { "maj-11.s11", 0x080000, 0xdabe9305, 7 | BRF_GRA }, // 21 - - { "gt12.n1", 0x020000, 0x9a86a015, 8 | BRF_GRA }, // 22 Sprite Bank B - { "gt13.n2", 0x020000, 0xf4709905, 8 | BRF_GRA }, // 23 - { "gt14.n3", 0x020000, 0x750fc523, 8 | BRF_GRA }, // 24 - { "gt15.n5", 0x020000, 0xf14edd3d, 8 | BRF_GRA }, // 25 - - { "gt07.h15", 0x020000, 0x750b7e5d, 9 | BRF_SND }, // 26 MSM6295 Samples 0 - - { "maj-03.h16", 0x080000, 0x31dcfac3, 10 | BRF_SND }, // 27 MSM6295 Samples 1 - - { "mb7128y.10m", 0x000800, 0xbde780a2, 11 | BRF_OPT }, // 28 Unknown Proms - { "mb7128y.16p", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 29 - - { "pal16r8a 1h", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 32 PLDs - { "pal16l8b.7c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 33 - { "pal16l8b.7d", 0x000104, 0x199e83fd, 12 | BRF_OPT }, // 34 - { "pal16l8b.7e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 35 - { "pal16l8b.7l", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 36 - { "pal16l8b.8e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 37 - { "pal16l8b.9d", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 38 - { "pal16l8b.10c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 39 -}; - -STD_ROM_PICK(thndzone) -STD_ROM_FN(thndzone) - -struct BurnDriver BurnDrvThndzone = { - "thndzone", NULL, NULL, NULL, "1991", - "Thunder Zone (World, Rev 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, thndzoneRomInfo, thndzoneRomName, NULL, NULL, ThndzoneInputInfo, ThndzoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 240, 4, 3 -}; - - -// Thunder Zone (World) - -static struct BurnRomInfo thndzoneaRomDesc[] = { - { "gz01.a15", 0x020000, 0x15e8c328, 1 | BRF_PRG | BRF_ESS }, // 0 68k 'A' Code - { "gz03.a17", 0x020000, 0xaab5c86e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gt00.a14", 0x020000, 0xb7277175, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gt02.a16", 0x020000, 0xcde31e35, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gz10.a12", 0x020000, 0x79f919e9, 2 | BRF_PRG | BRF_ESS }, // 4 68k 'B' Code - { "gz08.a9", 0x020000, 0xd47d7836, 2 | BRF_PRG | BRF_ESS }, // 5 - { "gt11-1.a14", 0x020000, 0x80cb23de, 2 | BRF_PRG | BRF_ESS }, // 6 - { "gt09-1.a11", 0x020000, 0x0a8fa7e1, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "gt04.f18", 0x010000, 0x81c29ebf, 3 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gt05.h11", 0x010000, 0x0aae996a, 4 | BRF_GRA }, // 9 Characters - { "gt06.h12", 0x010000, 0x4efdf03d, 4 | BRF_GRA }, // 10 - - { "maj-02.h14", 0x100000, 0x383bbc37, 5 | BRF_GRA }, // 11 Foreground Tiles - - { "maj-01.c18", 0x100000, 0x9840a204, 6 | BRF_GRA }, // 12 Background Tiles - { "maj-00.c17", 0x100000, 0x87ea8d16, 6 | BRF_GRA }, // 13 - - { "maj-04.r1", 0x080000, 0x36e49b19, 7 | BRF_GRA }, // 14 Sprite Bank A - { "maj-05.r2", 0x080000, 0x80fc71cc, 7 | BRF_GRA }, // 15 - { "maj-06.r3", 0x080000, 0x2e7a684b, 7 | BRF_GRA }, // 16 - { "maj-07.r5", 0x080000, 0x3acc1f78, 7 | BRF_GRA }, // 17 - { "maj-08.s6", 0x080000, 0x1958a36d, 7 | BRF_GRA }, // 18 - { "maj-09.s8", 0x080000, 0xc21087a1, 7 | BRF_GRA }, // 19 - { "maj-10.s9", 0x080000, 0xa02fa641, 7 | BRF_GRA }, // 20 - { "maj-11.s11", 0x080000, 0xdabe9305, 7 | BRF_GRA }, // 21 - - { "gt12.n1", 0x020000, 0x9a86a015, 8 | BRF_GRA }, // 22 Sprite Bank B - { "gt13.n2", 0x020000, 0xf4709905, 8 | BRF_GRA }, // 23 - { "gt14.n3", 0x020000, 0x750fc523, 8 | BRF_GRA }, // 24 - { "gt15.n5", 0x020000, 0xf14edd3d, 8 | BRF_GRA }, // 25 - - { "gt07.h15", 0x020000, 0x750b7e5d, 9 | BRF_SND }, // 26 MSM6295 Samples 0 - - { "maj-03.h16", 0x080000, 0x31dcfac3, 10 | BRF_SND }, // 27 MSM6295 Samples 1 - - { "mb7128y.10m", 0x000800, 0xbde780a2, 11 | BRF_OPT }, // 28 Unknown Proms - { "mb7128y.16p", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 29 - { "mb7128y.16s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 30 - { "mb7128y.17s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 31 - - { "pal16r8a 1h", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 32 PLDs - { "pal16l8b.7c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 33 - { "pal16l8b.7d", 0x000104, 0x199e83fd, 12 | BRF_OPT }, // 34 - { "pal16l8b.7e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 35 - { "pal16l8b.7l", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 36 - { "pal16l8b.8e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 37 - { "pal16l8b.9d", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 38 - { "pal16l8b.10c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 39 -}; - -STD_ROM_PICK(thndzonea) -STD_ROM_FN(thndzonea) - -struct BurnDriver BurnDrvThndzonea = { - "thndzonea", "thndzone", NULL, NULL, "1991", - "Thunder Zone (World)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, thndzoneaRomInfo, thndzoneaRomName, NULL, NULL, ThndzoneInputInfo, ThndzoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 240, 4, 3 -}; - - -// Thunder Zone (World 4 Players) - -static struct BurnRomInfo thndzone4RomDesc[] = { - { "27c010.a15", 0x020000, 0x30f21608, 1 | BRF_PRG | BRF_ESS }, // 0 68k 'A' Code - { "27c010.a17", 0x020000, 0x60886a33, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gt00.a14", 0x020000, 0xb7277175, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gt02.a16", 0x020000, 0xcde31e35, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "d27c010.a12", 0x020000, 0x99356cba, 2 | BRF_PRG | BRF_ESS }, // 4 68k 'B' Code - { "d27c010.a9", 0x020000, 0x8bf114e7, 2 | BRF_PRG | BRF_ESS }, // 5 - { "d27c010.a14", 0x020000, 0x3d96d47e, 2 | BRF_PRG | BRF_ESS }, // 6 - { "d27c010.a11", 0x020000, 0x2ab9b63f, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "gu04.f18", 0x010000, 0x81c29ebf, 3 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "27512.j10", 0x010000, 0xab22a078, 4 | BRF_GRA }, // 9 Characters - { "27512.j12", 0x010000, 0x34fc4428, 4 | BRF_GRA }, // 10 - - { "maj-02.h14", 0x100000, 0x383bbc37, 5 | BRF_GRA }, // 11 Foreground Tiles - - { "maj-01.c18", 0x100000, 0x9840a204, 6 | BRF_GRA }, // 12 Background Tiles - { "maj-00.c17", 0x100000, 0x87ea8d16, 6 | BRF_GRA }, // 13 - - { "maj-04.r1", 0x080000, 0x36e49b19, 7 | BRF_GRA }, // 14 Sprite Bank A - { "maj-05.r2", 0x080000, 0x80fc71cc, 7 | BRF_GRA }, // 15 - { "maj-06.r3", 0x080000, 0x2e7a684b, 7 | BRF_GRA }, // 16 - { "maj-07.r5", 0x080000, 0x3acc1f78, 7 | BRF_GRA }, // 17 - { "maj-08.s6", 0x080000, 0x1958a36d, 7 | BRF_GRA }, // 18 - { "maj-09.s8", 0x080000, 0xc21087a1, 7 | BRF_GRA }, // 19 - { "maj-10.s9", 0x080000, 0xa02fa641, 7 | BRF_GRA }, // 20 - { "maj-11.s11", 0x080000, 0xdabe9305, 7 | BRF_GRA }, // 21 - - { "gt12.n1", 0x020000, 0x9a86a015, 8 | BRF_GRA }, // 22 Sprite Bank B - { "gt13.n2", 0x020000, 0xf4709905, 8 | BRF_GRA }, // 23 - { "gt14.n3", 0x020000, 0x750fc523, 8 | BRF_GRA }, // 24 - { "gt15.n5", 0x020000, 0xf14edd3d, 8 | BRF_GRA }, // 25 - - { "gs07.h15", 0x020000, 0x750b7e5d, 9 | BRF_SND }, // 26 MSM6295 Samples 0 - - { "maj-03.h16", 0x080000, 0x31dcfac3, 10 | BRF_SND }, // 27 MSM6295 Samples 1 - - { "mb7128y.10m", 0x000800, 0xbde780a2, 11 | BRF_OPT }, // 28 Unknown Proms - { "mb7128y.16p", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 29 - { "mb7128y.16s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 30 - { "mb7128y.17s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 31 - - { "pal16r8a 1h", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 32 PLDs - { "pal16l8b.7c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 33 - { "pal16l8b.7d", 0x000104, 0x199e83fd, 12 | BRF_OPT }, // 34 - { "pal16l8b.7e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 35 - { "pal16l8b.7l", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 36 - { "pal16l8b.8e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 37 - { "pal16l8b.9d", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 38 - { "pal16l8b.10c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 39 -}; - -STD_ROM_PICK(thndzone4) -STD_ROM_FN(thndzone4) - -struct BurnDriver BurnDrvThndzone4 = { - "thndzone4", "thndzone", NULL, NULL, "1991", - "Thunder Zone (World 4 Players)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, thndzone4RomInfo, thndzone4RomName, NULL, NULL, ThndzoneInputInfo, ThndzoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 240, 4, 3 -}; - - -// Thunder Zone (Japan) - -static struct BurnRomInfo thndzonejRomDesc[] = { - { "gu01.a15", 0x020000, 0xeb28f8e8, 1 | BRF_PRG | BRF_ESS }, // 0 68k 'A' Code - { "gu03.a17", 0x020000, 0x9ad2b431, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gu00.a14", 0x020000, 0xfca9e84f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gu02.a16", 0x020000, 0xb6026bae, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gu10.a12", 0x020000, 0x8042e87d, 2 | BRF_PRG | BRF_ESS }, // 4 68k 'B' Code - { "gu08.a9", 0x020000, 0xc8895bfa, 2 | BRF_PRG | BRF_ESS }, // 5 - { "gu11.a14", 0x020000, 0xc0d6eb82, 2 | BRF_PRG | BRF_ESS }, // 6 - { "gu09.a11", 0x020000, 0x42de13a7, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "gu04.f18", 0x010000, 0x81c29ebf, 3 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gu05.h11", 0x010000, 0x0aae996a, 4 | BRF_GRA }, // 9 Characters - { "gu06.h12", 0x010000, 0x4efdf03d, 4 | BRF_GRA }, // 10 - - { "maj-02.h14", 0x100000, 0x383bbc37, 5 | BRF_GRA }, // 11 Foreground Tiles - - { "maj-01.c18", 0x100000, 0x9840a204, 6 | BRF_GRA }, // 12 Background Tiles - { "maj-00.c17", 0x100000, 0x87ea8d16, 6 | BRF_GRA }, // 13 - - { "maj-04.r1", 0x080000, 0x36e49b19, 7 | BRF_GRA }, // 14 Sprite Bank A - { "maj-05.r2", 0x080000, 0x80fc71cc, 7 | BRF_GRA }, // 15 - { "maj-06.r3", 0x080000, 0x2e7a684b, 7 | BRF_GRA }, // 16 - { "maj-07.r5", 0x080000, 0x3acc1f78, 7 | BRF_GRA }, // 17 - { "maj-08.s6", 0x080000, 0x1958a36d, 7 | BRF_GRA }, // 18 - { "maj-09.s8", 0x080000, 0xc21087a1, 7 | BRF_GRA }, // 19 - { "maj-10.s9", 0x080000, 0xa02fa641, 7 | BRF_GRA }, // 20 - { "maj-11.s11", 0x080000, 0xdabe9305, 7 | BRF_GRA }, // 21 - - { "gt12.n1", 0x020000, 0x9a86a015, 8 | BRF_GRA }, // 22 Sprite Bank B - { "gt13.n2", 0x020000, 0xf4709905, 8 | BRF_GRA }, // 23 - { "gt14.n3", 0x020000, 0x750fc523, 8 | BRF_GRA }, // 24 - { "gt15.n5", 0x020000, 0xf14edd3d, 8 | BRF_GRA }, // 25 - - { "gs07.h15", 0x020000, 0x750b7e5d, 9 | BRF_SND }, // 26 MSM6295 Samples 0 - - { "maj-03.h16", 0x080000, 0x31dcfac3, 10 | BRF_SND }, // 27 MSM6295 Samples 1 - - { "mb7128y.10m", 0x000800, 0xbde780a2, 11 | BRF_OPT }, // 28 Unknown Proms - { "mb7128y.16p", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 29 - { "mb7128y.16s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 30 - { "mb7128y.17s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 31 - - { "pal16r8a 1h", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 32 PLDs - { "pal16l8b.7c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 33 - { "pal16l8b.7d", 0x000104, 0x199e83fd, 12 | BRF_OPT }, // 34 - { "pal16l8b.7e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 35 - { "pal16l8b.7l", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 36 - { "pal16l8b.8e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 37 - { "pal16l8b.9d", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 38 - { "pal16l8b.10c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 39 - - { "mal-12.n1", 0x020000, 0x00000000, 0 | BRF_NODUMP }, // 40 - { "mal-13.n2", 0x020000, 0x00000000, 0 | BRF_NODUMP }, // 41 - { "mal-14.n3", 0x020000, 0x00000000, 0 | BRF_NODUMP }, // 42 - { "mal-15.n5", 0x020000, 0x00000000, 0 | BRF_NODUMP }, // 43 - { "mal-07.h15", 0x020000, 0x00000000, 0 | BRF_NODUMP }, // 44 -}; - -STD_ROM_PICK(thndzonej) -STD_ROM_FN(thndzonej) - -struct BurnDriver BurnDrvThndzonej = { - "thndzonej", "thndzone", NULL, NULL, "1991", - "Thunder Zone (Japan)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, thndzonejRomInfo, thndzonejRomName, NULL, NULL, ThndzoneInputInfo, ThndzoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 240, 4, 3 -}; - - -// Desert Assault (US) - -static struct BurnRomInfo dassaultRomDesc[] = { - { "01.a15", 0x020000, 0x14f17ea7, 1 | BRF_PRG | BRF_ESS }, // 0 68k 'A' Code - { "03.a17", 0x020000, 0xbed1b90c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gs00.a14", 0x020000, 0xb7277175, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gs02.a16", 0x020000, 0xcde31e35, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "hc10-1.a12", 0x020000, 0xac5ac770, 2 | BRF_PRG | BRF_ESS }, // 4 68k 'B' Code - { "hc08-1.a9", 0x020000, 0x864dca56, 2 | BRF_PRG | BRF_ESS }, // 5 - { "gs11.a14", 0x020000, 0x80cb23de, 2 | BRF_PRG | BRF_ESS }, // 6 - { "gs09.a11", 0x020000, 0x0a8fa7e1, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "gs04.f18", 0x010000, 0x81c29ebf, 3 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gs05.h11", 0x010000, 0x0aae996a, 4 | BRF_GRA }, // 9 Characters - { "gs06.h12", 0x010000, 0x4efdf03d, 4 | BRF_GRA }, // 10 - - { "maj-02.h14", 0x100000, 0x383bbc37, 5 | BRF_GRA }, // 11 Foreground Tiles - - { "maj-01.c18", 0x100000, 0x9840a204, 6 | BRF_GRA }, // 12 Background Tiles - { "maj-00.c17", 0x100000, 0x87ea8d16, 6 | BRF_GRA }, // 13 - - { "maj-04.r1", 0x080000, 0x36e49b19, 7 | BRF_GRA }, // 14 Sprite Bank A - { "maj-05.r2", 0x080000, 0x80fc71cc, 7 | BRF_GRA }, // 15 - { "maj-06.r3", 0x080000, 0x2e7a684b, 7 | BRF_GRA }, // 16 - { "maj-07.r5", 0x080000, 0x3acc1f78, 7 | BRF_GRA }, // 17 - { "maj-08.s6", 0x080000, 0x1958a36d, 7 | BRF_GRA }, // 18 - { "maj-09.s8", 0x080000, 0xc21087a1, 7 | BRF_GRA }, // 19 - { "maj-10.s9", 0x080000, 0xa02fa641, 7 | BRF_GRA }, // 20 - { "maj-11.s11", 0x080000, 0xdabe9305, 7 | BRF_GRA }, // 21 - - { "gs12.n1", 0x020000, 0x9a86a015, 8 | BRF_GRA }, // 22 Sprite Bank B - { "gs13.n2", 0x020000, 0xf4709905, 8 | BRF_GRA }, // 23 - { "gs14.n3", 0x020000, 0x750fc523, 8 | BRF_GRA }, // 24 - { "gs15.n5", 0x020000, 0xf14edd3d, 8 | BRF_GRA }, // 25 - - { "gs07.h15", 0x020000, 0x750b7e5d, 9 | BRF_SND }, // 26 MSM6295 Samples 0 - - { "maj-03.h16", 0x080000, 0x31dcfac3, 10 | BRF_SND }, // 27 MSM6295 Samples 1 - - { "mb7128y.10m", 0x000800, 0xbde780a2, 11 | BRF_OPT }, // 28 Unknown Proms - { "mb7128y.16p", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 29 - { "mb7128y.16s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 30 - { "mb7128y.17s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 31 - - { "pal16r8a 1h", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 32 PLDs - { "pal16l8b.7c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 33 - { "pal16l8b.7d", 0x000104, 0x199e83fd, 12 | BRF_OPT }, // 34 - { "pal16l8b.7e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 35 - { "pal16l8b.7l", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 36 - { "pal16l8b.8e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 37 - { "pal16l8b.9d", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 38 - { "pal16l8b.10c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 39 -}; - -STD_ROM_PICK(dassault) -STD_ROM_FN(dassault) - -struct BurnDriver BurnDrvDassault = { - "dassault", "thndzone", NULL, NULL, "1991", - "Desert Assault (US)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, dassaultRomInfo, dassaultRomName, NULL, NULL, ThndzoneInputInfo, DassaultDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 240, 4, 3 -}; - - -// Desert Assault (US 4 Players) - -static struct BurnRomInfo dassault4RomDesc[] = { - { "gs01.a15", 0x020000, 0x8613634d, 1 | BRF_PRG | BRF_ESS }, // 0 68k 'A' Code - { "gs03.a17", 0x020000, 0xea860bd4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gs00.a14", 0x020000, 0xb7277175, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gs02.a16", 0x020000, 0xcde31e35, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gs10.a12", 0x020000, 0x285f72a3, 2 | BRF_PRG | BRF_ESS }, // 4 68k 'B' Code - { "gs08.a9", 0x020000, 0x16691ede, 2 | BRF_PRG | BRF_ESS }, // 5 - { "gs11.a14", 0x020000, 0x80cb23de, 2 | BRF_PRG | BRF_ESS }, // 6 - { "gs09.a11", 0x020000, 0x0a8fa7e1, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "gs04.f18", 0x010000, 0x81c29ebf, 3 | BRF_PRG | BRF_ESS }, // 8 Huc6280 Code - - { "gs05.h11", 0x010000, 0x0aae996a, 4 | BRF_GRA }, // 9 Characters - { "gs06.h12", 0x010000, 0x4efdf03d, 4 | BRF_GRA }, // 10 - - { "maj-02.h14", 0x100000, 0x383bbc37, 5 | BRF_GRA }, // 11 Foreground Tiles - - { "maj-01.c18", 0x100000, 0x9840a204, 6 | BRF_GRA }, // 12 Background Tiles - { "maj-00.c17", 0x100000, 0x87ea8d16, 6 | BRF_GRA }, // 13 - - { "maj-04.r1", 0x080000, 0x36e49b19, 7 | BRF_GRA }, // 14 Sprite Bank A - { "maj-05.r2", 0x080000, 0x80fc71cc, 7 | BRF_GRA }, // 15 - { "maj-06.r3", 0x080000, 0x2e7a684b, 7 | BRF_GRA }, // 16 - { "maj-07.r5", 0x080000, 0x3acc1f78, 7 | BRF_GRA }, // 17 - { "maj-08.s6", 0x080000, 0x1958a36d, 7 | BRF_GRA }, // 18 - { "maj-09.s8", 0x080000, 0xc21087a1, 7 | BRF_GRA }, // 19 - { "maj-10.s9", 0x080000, 0xa02fa641, 7 | BRF_GRA }, // 20 - { "maj-11.s11", 0x080000, 0xdabe9305, 7 | BRF_GRA }, // 21 - - { "gs12.n1", 0x020000, 0x9a86a015, 8 | BRF_GRA }, // 22 Sprite Bank B - { "gs13.n2", 0x020000, 0xf4709905, 8 | BRF_GRA }, // 23 - { "gs14.n3", 0x020000, 0x750fc523, 8 | BRF_GRA }, // 24 - { "gs15.n5", 0x020000, 0xf14edd3d, 8 | BRF_GRA }, // 25 - - { "gs07.h15", 0x020000, 0x750b7e5d, 9 | BRF_SND }, // 26 MSM6295 Samples 0 - - { "maj-03.h16", 0x080000, 0x31dcfac3, 10 | BRF_SND }, // 27 MSM6295 Samples 1 - - { "mb7128y.10m", 0x000800, 0xbde780a2, 11 | BRF_OPT }, // 28 Unknown Proms - { "mb7128y.16p", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 29 - { "mb7128y.16s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 30 - { "mb7128y.17s", 0x000800, 0xc44d2751, 11 | BRF_OPT }, // 31 - - { "pal16r8a 1h", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 32 PLDs - { "pal16l8b.7c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 33 - { "pal16l8b.7d", 0x000104, 0x199e83fd, 12 | BRF_OPT }, // 34 - { "pal16l8b.7e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 35 - { "pal16l8b.7l", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 36 - { "pal16l8b.8e", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 37 - { "pal16l8b.9d", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 38 - { "pal16l8b.10c", 0x000104, 0x00000000, 12 | BRF_NODUMP }, // 39 -}; - -STD_ROM_PICK(dassault4) -STD_ROM_FN(dassault4) - -struct BurnDriver BurnDrvDassault4 = { - "dassault4", "thndzone", NULL, NULL, "1991", - "Desert Assault (US 4 Players)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, dassault4RomInfo, dassault4RomName, NULL, NULL, ThndzoneInputInfo, Dassault4DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_dblewing.cpp b/jan/src/burn/drv/dataeast/d_dblewing.cpp deleted file mode 100644 index 03a049793..000000000 --- a/jan/src/burn/drv/dataeast/d_dblewing.cpp +++ /dev/null @@ -1,696 +0,0 @@ -// FB Alpha Double Wings driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "deco16ic.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "deco146.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KCode; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM0; -static UINT8 *Drv68KRAM; -static UINT8 *DrvUnkRAM0; -static UINT8 *DrvUnkRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 flipscreen; -static UINT8 soundlatch; -static UINT8 sound_irq; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo DblewingInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dblewing) - -static struct BurnDIPInfo DblewingDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - -// not supported -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x40, 0x40, "Off" }, -// {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Region" }, - {0x14, 0x01, 0x80, 0x80, "Japan" }, - {0x14, 0x01, 0x80, 0x00, "Korea" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x02, "1" }, - {0x15, 0x01, 0x03, 0x01, "2" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x0c, 0x08, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x04, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x30, 0x20, "Every 100,000" }, - {0x15, 0x01, 0x30, 0x30, "Every 150,000" }, - {0x15, 0x01, 0x30, 0x10, "Every 300,000" }, - {0x15, 0x01, 0x30, 0x00, "250,000 Only" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dblewing) - -static void __fastcall dblewing_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffc000) == 0x280000) { - deco146_104_prot_ww(0, address, data); - return; - } - - deco16_write_control_word(0, address, 0x28c000, data); -} - -static void __fastcall dblewing_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffc000) == 0x280000) { - deco146_104_prot_wb(0, address, data); - return; - } -} - -static UINT16 __fastcall dblewing_read_word(UINT32 address) -{ - if ((address & 0xffc000) == 0x280000) { - return deco146_104_prot_rw(0, address); - } - - return 0; -} - -static UINT8 __fastcall dblewing_read_byte(UINT32 address) -{ - if ((address & 0xffc000) == 0x280000) { - return deco146_104_prot_rb(0, address); - } - - return 0; -} - -static void __fastcall dblewing_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - BurnYM2151SelectRegister(data); - return; - - case 0xa001: - BurnYM2151WriteRegister(data); - return; - - case 0xb000: - case 0xf000: - MSM6295Command(0, data); - return; - } -} - -static UINT8 __fastcall dblewing_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - case 0xa001: - return BurnYM2151ReadStatus(); - - case 0xb000: - case 0xf000: - return MSM6295ReadStatus(0); - - case 0xc000: - return soundlatch; - - case 0xd000: - sound_irq &= ~0x02; - ZetSetIRQLine(0, (sound_irq) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - return sound_irq; - } - - return 0; -} - -static void sound_callback(UINT16 data) -{ - soundlatch = data & 0xff; - sound_irq |= 0x02; - - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); -} - -static UINT16 input_read() -{ - return DrvInputs[0]; -} - -static UINT16 system_read() -{ - return (DrvInputs[1] & 0x7) | deco16_vblank; -} - -static UINT16 dips_read() -{ - return (DrvDips[1] * 256) + DrvDips[0]; -} - -static UINT8 __fastcall dblewing_sound_read_port(UINT16 port) -{ - return DrvZ80ROM[port]; -} - -static void DrvYM2151IrqHandler(INT32 state) -{ - if (state) - sound_irq |= 0x01; - else - sound_irq &= ~0x01; - - ZetSetIRQLine(0, (sound_irq) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 dblewing_bank_callback( const INT32 bank ) -{ - return ((bank >> 4) & 0x7) * 0x1000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM2151Reset(); - ZetClose(); - - MSM6295Reset(0); - - deco16Reset(); - - flipscreen = 0; - soundlatch = 0; - sound_irq = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - Drv68KCode = Next; Next += 0x080000; - - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x400000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvUnkRAM0 = Next; Next += 0x000400; - DrvUnkRAM1 = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - DrvZ80RAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 5, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 6, 1)) return 1; - memcpy (DrvSndROM0 + 0x20000, DrvSndROM0, 0x20000); - - deco102_decrypt_cpu(Drv68KROM, Drv68KCode, 0x80000, 0x399d, 0x25, 0x3d); - deco56_decrypt_gfx(DrvGfxROM1, 0x100000); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM0, 0x100000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x100000, 0); - deco16_sprite_decode(DrvGfxROM2, 0x200000); - } - - deco16Init(1, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x100000 * 2, DrvGfxROM1, 0x100000 * 2, NULL, 0); - deco16_set_global_offsets(0, 8); - deco16_set_color_base(0, 0); - deco16_set_color_base(1, 0x100); - deco16_set_color_mask(0, 0xf); - deco16_set_color_mask(1, 0xf); - deco16_set_transparency_mask(0, 0xf); - deco16_set_transparency_mask(1, 0xf); - deco16_set_bank_callback(0, dblewing_bank_callback); - deco16_set_bank_callback(1, dblewing_bank_callback); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_READ); - SekMapMemory(Drv68KCode, 0x000000, 0x07ffff, MAP_FETCH); - SekMapMemory(deco16_pf_ram[0], 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x102000, 0x102fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x104000, 0x104fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x106000, 0x106fff, MAP_RAM); - SekMapMemory(DrvUnkRAM0, 0x284000, 0x284400, MAP_RAM); - SekMapMemory(DrvUnkRAM1, 0x288000, 0x288400, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x300000, 0x3007ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x320000, 0x3207ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xff3fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff4000, 0xff7fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff8000, 0xffbfff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xffc000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, dblewing_write_word); - SekSetWriteByteHandler(0, dblewing_write_byte); - SekSetReadWordHandler(0, dblewing_read_word); - SekSetReadByteHandler(0, dblewing_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(dblewing_sound_write); - ZetSetReadHandler(dblewing_sound_read); - ZetSetInHandler(dblewing_sound_read_port); - ZetClose(); - - deco_104_init(); - deco_146_104_set_interface_scramble_interleave(); - deco_146_104_set_use_magic_read_address_xor(1); - deco_146_104_set_port_a_cb(input_read); // inputs - deco_146_104_set_port_b_cb(system_read); // system - deco_146_104_set_port_c_cb(dips_read); // dips - deco_146_104_set_soundlatch_cb(sound_callback); - - BurnYM2151Init(3580000); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - MSM6295Exit(0); - BurnYM2151Exit(); - - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_sprites() -{ - UINT16 *spriteram = (UINT16 *)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 inc, mult; - - INT32 sprite = BURN_ENDIAN_SWAP_INT16(spriteram[offs+1]); - - INT32 y = BURN_ENDIAN_SWAP_INT16(spriteram[offs]); - - if ((y & 0x1000) && (nCurrentFrame & 1)) continue; - - INT32 w = y & 0x0800; - INT32 x = BURN_ENDIAN_SWAP_INT16(spriteram[offs + 2]); - INT32 colour = (x >> 9) & 0x1f; - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi = (1 << ((y & 0x0600) >> 9)) - 1; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - y = 240 - y; - x = 304 - x; - - if (x > 320) continue; - - sprite &= ~multi; - - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (!flipscreen) - { - y = 240 - y; - x = 304 - x; - if (fy) fy = 0; else fy = 1; - if (fx) fx = 0; else fx = 1; - mult = 16; - - } - else mult = -16; - - INT32 mult2 = multi + 1; - - while (multi >= 0) - { - INT32 code = (sprite - multi * inc) & 0x3fff; - - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } - } - - if (w) - { - code = ((sprite - multi * inc)-mult2) & 0x3fff; - - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x-16, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x-16, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x-16, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x-16, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } - } - } - - multi--; - } - } -} - -static void DrvPaletteUpdate() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x800 / 2; i++) - { - UINT8 b = (p[i] >> 8) & 0xf; - UINT8 g = (p[i] >> 4) & 0xf; - UINT8 r = (p[i] >> 0) & 0xf; - - DrvPalette[i] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - - flipscreen = 1; //~deco16_pf_control[0][0] & 0x80; - - //bprintf (0, _T("%4.4x\n"), deco16_pf_control[0][0]); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0; - } - - if (nBurnLayer & 1) deco16_draw_layer(1, pTransDraw, 0); - - if (nBurnLayer & 2) deco16_draw_layer(0, pTransDraw, 0); - - if (nBurnLayer & 4) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 14000000 / 58, 3580000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - SekOpen(0); - ZetOpen(0); - - deco16_vblank = 8; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 29) deco16_vblank = 0; - if (i == 248) { - deco16_vblank = 0x08; - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - if (pBurnSoundOut && i%4==3) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave/4); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029682; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16Scan(); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(sound_irq); - - } - - return 0; -} - - -// Double Wings - -static struct BurnRomInfo dblewingRomDesc[] = { - { "kp_00-.3d", 0x040000, 0x547dc83e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "kp_01-.5d", 0x040000, 0x7a210c33, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "kp_02-.10h", 0x010000, 0xdef035fa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "mbe-02.8h", 0x100000, 0x5a6d3ac5, 3 | BRF_GRA }, // 3 Character and Background Tiles - - { "mbe-00.14a", 0x100000, 0xe33f5c93, 4 | BRF_GRA }, // 4 Sprites - { "mbe-01.16a", 0x100000, 0xef452ad7, 4 | BRF_GRA }, // 5 - - { "kp_03-.16h", 0x020000, 0x5d7f930d, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(dblewing) -STD_ROM_FN(dblewing) - -struct BurnDriver BurnDrvDblewing = { - "dblewing", NULL, NULL, NULL, "1993", - "Double Wings\0", NULL, "Mitchell", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, dblewingRomInfo, dblewingRomName, NULL, NULL, DblewingInputInfo, DblewingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/dataeast/d_dec0.cpp b/jan/src/burn/drv/dataeast/d_dec0.cpp deleted file mode 100644 index 16acf8932..000000000 --- a/jan/src/burn/drv/dataeast/d_dec0.cpp +++ /dev/null @@ -1,5858 +0,0 @@ -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "m6502_intf.h" -#include "msm6295.h" -#include "burn_ym2203.h" -#include "burn_ym3812.h" -#include "h6280_intf.h" -#include "mcs51.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvMCURom = NULL; -static UINT8 *DrvM6502Rom = NULL; -static UINT8 *DrvM6502Ram = NULL; -static UINT8 *DrvH6280Rom = NULL; -static UINT8 *DrvH6280Ram = NULL; -static UINT8 *DrvCharRam = NULL; -static UINT8 *DrvCharCtrl0Ram = NULL; -static UINT8 *DrvCharCtrl1Ram = NULL; -static UINT8 *DrvCharColScrollRam = NULL; -static UINT8 *DrvCharRowScrollRam = NULL; -static UINT8 *DrvVideo1Ram = NULL; -static UINT8 *DrvVideo1Ctrl0Ram = NULL; -static UINT8 *DrvVideo1Ctrl1Ram = NULL; -static UINT8 *DrvVideo1ColScrollRam = NULL; -static UINT8 *DrvVideo1RowScrollRam = NULL; -static UINT8 *DrvVideo2Ram = NULL; -static UINT8 *DrvVideo2Ctrl0Ram = NULL; -static UINT8 *DrvVideo2Ctrl1Ram = NULL; -static UINT8 *DrvVideo2ColScrollRam = NULL; -static UINT8 *DrvVideo2RowScrollRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvPalette2Ram = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvSpriteDMABufferRam = NULL; -static UINT8 *DrvSharedRam = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTiles1 = NULL; -static UINT8 *DrvTiles2 = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; -static UINT16 *pCharLayerDraw = NULL; -static UINT16 *pTile1LayerDraw = NULL; -static UINT16 *pTile2LayerDraw = NULL; - -// i8751 MCU (hbarrel) & MCU Simulation -static INT32 realMCU = 0; -static INT32 i8751RetVal; -static INT32 i8751Command; -static UINT8 i8751PortData[4] = { 0, 0, 0, 0 }; - -static INT32 bTimerNullCPU = 0; - -static UINT8 DrvVBlank; -static UINT8 DrvSoundLatch; -static UINT8 DrvFlipScreen; -static INT32 DrvPriority; -static INT32 DrvCharTilemapWidth; -static INT32 DrvCharTilemapHeight; -static INT32 DrvTile1TilemapWidth; -static INT32 DrvTile1TilemapHeight; -static INT32 DrvTile2TilemapWidth; -static INT32 DrvTile2TilemapHeight; -static UINT8 DrvTileRamBank[3]; -static UINT8 DrvSlyspyProtValue; - -typedef void (*Dec0Render)(); -static Dec0Render Dec0DrawFunction; -static void BaddudesDraw(); -static void BirdtryDraw(); -static void HbarrelDraw(); -static void HippodrmDraw(); -static void MidresDraw(); -static void RobocopDraw(); -static void SlyspyDraw(); - -typedef INT32 (*Dec0LoadRoms)(); -static Dec0LoadRoms LoadRomsFunction; - -static void SlyspySetProtectionMap(UINT8 Type); - -static INT32 DrvCharPalOffset = 0; -static INT32 DrvSpritePalOffset = 256; - -// Rotation stuff! -dink -static UINT8 DrvFakeInput[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 nRotateHoldInput[2] = {0, 0}; -static INT32 nRotate[2] = {0, 0}; -static INT32 nRotateTarget[2] = {0, 0}; -static INT32 nRotateTry[2] = {0, 0}; -static UINT32 nRotateTime[2] = {0, 0}; -static UINT8 game_rotates = 0; - -static INT32 nCyclesDone[3], nCyclesTotal[3]; - -static INT32 Dec0Game = 0; - -#define DEC0_GAME_BADDUDES 1 -#define DEC0_GAME_HBARREL 2 -#define DEC0_GAME_BIRDTRY 3 -#define DEC1_GAME_MIDRES 4 - -static struct BurnInputInfo Dec0InputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort2 + 4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 fire 5" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 start" }, - {"P2 Up (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" }, - {"P2 Fire 4 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 fire 4" }, - {"P2 Fire 5 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 fire 5" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 6, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Dec0) - -static struct BurnInputInfo Dec1InputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - {"P2 Up (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Dec1) - -static struct BurnInputInfo HbarrelInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort2 + 4, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 0, "p1 rotate left" }, - {"P1 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 1, "p1 rotate right" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 start" }, - {"P2 Up (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 2, "p2 rotate left" }, - {"P2 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 3, "p2 rotate right" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 6, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Hbarrel) - -static struct BurnInputInfo MidresInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" }, - {"P1 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 0, "p1 rotate left" }, - {"P1 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 1, "p1 rotate right" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - {"P2 Up (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" }, - {"P2 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 2, "p2 rotate left" }, - {"P2 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 3, "p2 rotate right" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Midres) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[1]); -} - -static struct BurnDIPInfo BaddudesDIPList[]= -{ - // Default Values - {0x18, 0xff, 0xff, 0xff, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x18, 0x01, 0x03, 0x00, "3 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x18, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x18, 0x01, 0x0c, 0x00, "3 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x04, "2 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x18, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x18, 0x01, 0x10, 0x10, "Off" }, - {0x18, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x18, 0x01, 0x20, 0x00, "Off" }, - {0x18, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x18, 0x01, 0x40, 0x40, "Off" }, - {0x18, 0x01, 0x40, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x19, 0x01, 0x03, 0x01, "1" }, - {0x19, 0x01, 0x03, 0x03, "3" }, - {0x19, 0x01, 0x03, 0x02, "5" }, - {0x19, 0x01, 0x03, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x19, 0x01, 0x0c, 0x08, "Easy" }, - {0x19, 0x01, 0x0c, 0x0c, "Normal" }, - {0x19, 0x01, 0x0c, 0x04, "Hard" }, - {0x19, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow continue" }, - {0x19, 0x01, 0x10, 0x10, "Yes" }, - {0x19, 0x01, 0x10, 0x00, "No" }, -}; - -STDDIPINFO(Baddudes) - -static struct BurnDIPInfo BirdtryDIPList[]= -{ - {0x18, 0xff, 0xff, 0xff, NULL }, - {0x19, 0xff, 0xff, 0x3f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x18, 0x01, 0x03, 0x00, "2 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x18, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - {0x18, 0x01, 0x03, 0x01, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x18, 0x01, 0x0c, 0x00, "2 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x18, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - {0x18, 0x01, 0x0c, 0x04, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x18, 0x01, 0x10, 0x10, "Off" }, - {0x18, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x18, 0x01, 0x20, 0x00, "Off" }, - {0x18, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x18, 0x01, 0x40, 0x40, "Off" }, - {0x18, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty (Extend)" }, - {0x19, 0x01, 0x03, 0x02, "Easy" }, - {0x19, 0x01, 0x03, 0x03, "Normal" }, - {0x19, 0x01, 0x03, 0x01, "Hard" }, - {0x19, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Difficulty (Course)" }, - {0x19, 0x01, 0x0c, 0x08, "Easy" }, - {0x19, 0x01, 0x0c, 0x0c, "Normal" }, - {0x19, 0x01, 0x0c, 0x04, "Hard" }, - {0x19, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x19, 0x01, 0x10, 0x00, "Off" }, - {0x19, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Timer" }, - {0x19, 0x01, 0x20, 0x20, "Normal" }, - {0x19, 0x01, 0x20, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 4, "Control Panel Type" }, - {0x19, 0x01, 0xc0, 0xc0, "Type A - Cocktail" }, - {0x19, 0x01, 0xc0, 0x80, "Type B - Cocktail 2" }, - {0x19, 0x01, 0xc0, 0x40, "Unused" }, - {0x19, 0x01, 0xc0, 0x00, "Type C - Upright" }, -}; - -STDDIPINFO(Birdtry) - -static struct BurnDIPInfo BouldashDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0x7f, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Play" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Play" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Plays" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Plays" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Play" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Play" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Plays" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Plays" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Plays" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x80, 0x00, "Upright" }, - {0x14, 0x01, 0x80, 0x80, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x03, 0x00, "2" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x0c, 0x08, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x04, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Game Change Mode" }, - {0x15, 0x01, 0x20, 0x20, "Part 1" }, - {0x15, 0x01, 0x20, 0x00, "Part 2" }, - - {0 , 0xfe, 0 , 2 , "Allow continue" }, - {0x15, 0x01, 0x40, 0x00, "No" }, - {0x15, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x20, 0x80, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Bouldash) - -static struct BurnDIPInfo HbarrelDIPList[]= -{ - // Default Values - {0x18, 0xff, 0xff, 0xff, NULL }, - {0x19, 0xff, 0xff, 0xbf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x18, 0x01, 0x03, 0x00, "2 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x18, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - {0x18, 0x01, 0x03, 0x01, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x18, 0x01, 0x0c, 0x00, "2 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x18, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - {0x18, 0x01, 0x0c, 0x04, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x18, 0x01, 0x10, 0x10, "Off" }, - {0x18, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x18, 0x01, 0x20, 0x00, "Off" }, - {0x18, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x18, 0x01, 0x40, 0x40, "Off" }, - {0x18, 0x01, 0x40, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x19, 0x01, 0x03, 0x01, "1" }, - {0x19, 0x01, 0x03, 0x03, "3" }, - {0x19, 0x01, 0x03, 0x02, "5" }, - {0x19, 0x01, 0x03, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x19, 0x01, 0x0c, 0x08, "Easy" }, - {0x19, 0x01, 0x0c, 0x0c, "Normal" }, - {0x19, 0x01, 0x0c, 0x04, "Hard" }, - {0x19, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x19, 0x01, 0x30, 0x30, "30k 80k 160k" }, - {0x19, 0x01, 0x30, 0x20, "50k 120k 190k" }, - {0x19, 0x01, 0x30, 0x10, "100k 200k 300k" }, - {0x19, 0x01, 0x30, 0x00, "150k 300k 450k" }, - - {0 , 0xfe, 0 , 2 , "Allow continue" }, - {0x19, 0x01, 0x40, 0x40, "No" }, - {0x19, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Hbarrel) - -static struct BurnDIPInfo HippodrmDIPList[]= -{ - // Default Values - {0x18, 0xff, 0xff, 0xff, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x18, 0x01, 0x03, 0x00, "3 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x18, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x18, 0x01, 0x0c, 0x00, "3 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x04, "2 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x18, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x18, 0x01, 0x20, 0x00, "Off" }, - {0x18, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x18, 0x01, 0x40, 0x40, "Off" }, - {0x18, 0x01, 0x40, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x19, 0x01, 0x03, 0x01, "1" }, - {0x19, 0x01, 0x03, 0x03, "2" }, - {0x19, 0x01, 0x03, 0x02, "3" }, - {0x19, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x19, 0x01, 0x0c, 0x08, "Easy" }, - {0x19, 0x01, 0x0c, 0x0c, "Normal" }, - {0x19, 0x01, 0x0c, 0x04, "Hard" }, - {0x19, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Player & Enemy Energy" }, - {0x19, 0x01, 0x30, 0x10, "Very Low" }, - {0x19, 0x01, 0x30, 0x20, "Low" }, - {0x19, 0x01, 0x30, 0x30, "Medium" }, - {0x19, 0x01, 0x30, 0x00, "High" }, - - {0 , 0xfe, 0 , 2 , "Energy Power Decrease on Continue"}, - {0x19, 0x01, 0x40, 0x40, "2 Dots" }, - {0x19, 0x01, 0x40, 0x00, "3 Dots" }, -}; - -STDDIPINFO(Hippodrm) - -static struct BurnDIPInfo FfantasyDIPList[]= -{ - // Default Values - {0x18, 0xff, 0xff, 0xff, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x18, 0x01, 0x03, 0x00, "3 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x18, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x18, 0x01, 0x0c, 0x00, "3 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x04, "2 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x18, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x18, 0x01, 0x20, 0x00, "Off" }, - {0x18, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x18, 0x01, 0x40, 0x40, "Off" }, - {0x18, 0x01, 0x40, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x19, 0x01, 0x03, 0x01, "1" }, - {0x19, 0x01, 0x03, 0x03, "2" }, - {0x19, 0x01, 0x03, 0x02, "3" }, - {0x19, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x19, 0x01, 0x0c, 0x08, "Easy" }, - {0x19, 0x01, 0x0c, 0x0c, "Normal" }, - {0x19, 0x01, 0x0c, 0x04, "Hard" }, - {0x19, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Player & Enemy Energy" }, - {0x19, 0x01, 0x30, 0x10, "Very Low" }, - {0x19, 0x01, 0x30, 0x20, "Low" }, - {0x19, 0x01, 0x30, 0x30, "Medium" }, - {0x19, 0x01, 0x30, 0x00, "High" }, - - {0 , 0xfe, 0 , 2 , "Energy Power Decrease on Continue"}, - {0x19, 0x01, 0x40, 0x40, "2 Dots" }, - {0x19, 0x01, 0x40, 0x00, "None" }, -}; - -STDDIPINFO(Ffantasy) - -static struct BurnDIPInfo MidresDIPList[]= -{ - // Default Values - {0x1a, 0xff, 0xff, 0xff, NULL }, - {0x1b, 0xff, 0xff, 0xbf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x1a, 0x01, 0x03, 0x00, "3 Coins 1 Play" }, - {0x1a, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x1a, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x1a, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x1a, 0x01, 0x0c, 0x00, "3 Coins 1 Play" }, - {0x1a, 0x01, 0x0c, 0x04, "2 Coins 1 Play" }, - {0x1a, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x1a, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x1a, 0x01, 0x10, 0x10, "Off" }, - {0x1a, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1a, 0x01, 0x20, 0x00, "Off" }, - {0x1a, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1a, 0x01, 0x40, 0x40, "Off" }, - {0x1a, 0x01, 0x40, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x1b, 0x01, 0x03, 0x03, "3" }, - {0x1b, 0x01, 0x03, 0x02, "4" }, - {0x1b, 0x01, 0x03, 0x01, "5" }, - {0x1b, 0x01, 0x03, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1b, 0x01, 0x0c, 0x08, "Easy" }, - {0x1b, 0x01, 0x0c, 0x0c, "Normal" }, - {0x1b, 0x01, 0x0c, 0x04, "Hard" }, - {0x1b, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow continue" }, - {0x1b, 0x01, 0x40, 0x40, "No" }, - {0x1b, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Midres) - -static struct BurnDIPInfo MidresuDIPList[]= -{ - // Default Values - {0x1a, 0xff, 0xff, 0xff, NULL }, - {0x1b, 0xff, 0xff, 0xbf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x1a, 0x01, 0x03, 0x00, "3 Coins 1 Play" }, - {0x1a, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x1a, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x1a, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x1a, 0x01, 0x0c, 0x00, "3 Coins 1 Play" }, - {0x1a, 0x01, 0x0c, 0x04, "2 Coins 1 Play" }, - {0x1a, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x1a, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x1a, 0x01, 0x10, 0x10, "Off" }, - {0x1a, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1a, 0x01, 0x20, 0x00, "Off" }, - {0x1a, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1a, 0x01, 0x40, 0x40, "Off" }, - {0x1a, 0x01, 0x40, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x1b, 0x01, 0x03, 0x01, "1" }, - {0x1b, 0x01, 0x03, 0x03, "3" }, - {0x1b, 0x01, 0x03, 0x02, "5" }, - {0x1b, 0x01, 0x03, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1b, 0x01, 0x0c, 0x08, "Easy" }, - {0x1b, 0x01, 0x0c, 0x0c, "Normal" }, - {0x1b, 0x01, 0x0c, 0x04, "Hard" }, - {0x1b, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow continue" }, - {0x1b, 0x01, 0x40, 0x40, "No" }, - {0x1b, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Midresu) - -static struct BurnDIPInfo RobocopDIPList[]= -{ - // Default Values - {0x18, 0xff, 0xff, 0x7f, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x18, 0x01, 0x03, 0x00, "3 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x18, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x18, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x18, 0x01, 0x0c, 0x00, "3 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x04, "2 Coins 1 Play" }, - {0x18, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x18, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x18, 0x01, 0x20, 0x00, "Off" }, - {0x18, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x18, 0x01, 0x40, 0x40, "Off" }, - {0x18, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x18, 0x01, 0x80, 0x80, "Upright" }, - {0x18, 0x01, 0x80, 0x00, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Player Energy" }, - {0x19, 0x01, 0x03, 0x01, "Low" }, - {0x19, 0x01, 0x03, 0x03, "Medium" }, - {0x19, 0x01, 0x03, 0x02, "High" }, - {0x19, 0x01, 0x03, 0x00, "Very High" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x19, 0x01, 0x0c, 0x08, "Easy" }, - {0x19, 0x01, 0x0c, 0x0c, "Normal" }, - {0x19, 0x01, 0x0c, 0x04, "Hard" }, - {0x19, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow continue" }, - {0x19, 0x01, 0x10, 0x10, "No" }, - {0x19, 0x01, 0x10, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Bonus Stage Energy" }, - {0x19, 0x01, 0x20, 0x00, "Low" }, - {0x19, 0x01, 0x20, 0x20, "High" }, - - {0 , 0xfe, 0 , 2 , "Brink Time" }, - {0x19, 0x01, 0x40, 0x40, "Normal" }, - {0x19, 0x01, 0x40, 0x00, "Less" }, -}; - -STDDIPINFO(Robocop) - -static struct BurnDIPInfo SlyspyDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0x7f, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x03, 0x00, "3 Coins 1 Play" }, - {0x14, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0x0c, 0x00, "3 Coins 1 Play" }, - {0x14, 0x01, 0x0c, 0x04, "2 Coins 1 Play" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x80, 0x00, "Upright" }, - {0x14, 0x01, 0x80, 0x80, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Energy" }, - {0x15, 0x01, 0x03, 0x02, "8 bars" }, - {0x15, 0x01, 0x03, 0x03, "10 bars" }, - {0x15, 0x01, 0x03, 0x01, "12 bars" }, - {0x15, 0x01, 0x03, 0x00, "14 bars" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x0c, 0x08, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x04, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow continue" }, - {0x15, 0x01, 0x10, 0x00, "No" }, - {0x15, 0x01, 0x10, 0x10, "Yes" }, -}; - -STDDIPINFO(Slyspy) - -static struct BurnRomInfo BaddudesRomDesc[] = { - { "ei04-1.3c", 0x10000, 0x4bf158a7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ei01-1.3a", 0x10000, 0x74f5110c, BRF_ESS | BRF_PRG }, // 1 - { "ei06.6c", 0x10000, 0x3ff8da57, BRF_ESS | BRF_PRG }, // 2 - { "ei03.6a", 0x10000, 0xf8f2bd94, BRF_ESS | BRF_PRG }, // 3 - - { "ei07.8a", 0x08000, 0x9fb1ef4b, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "ei25.15j", 0x08000, 0xbcf59a69, BRF_GRA }, // 5 Characters - { "ei26.16j", 0x08000, 0x9aff67b8, BRF_GRA }, // 6 - - { "ei18.14d", 0x10000, 0x05cfc3e5, BRF_GRA }, // 7 Tiles 1 - { "ei20.17d", 0x10000, 0xe11e988f, BRF_GRA }, // 8 - { "ei22.14f", 0x10000, 0xb893d880, BRF_GRA }, // 9 - { "ei24.17f", 0x10000, 0x6f226dda, BRF_GRA }, // 10 - - { "ei30.9j", 0x10000, 0x982da0d1, BRF_GRA }, // 11 Tiles 2 - { "ei28.9f", 0x10000, 0xf01ebb3b, BRF_GRA }, // 12 - - { "ei15.16c", 0x10000, 0xa38a7d30, BRF_GRA }, // 13 Sprites - { "ei16.17c", 0x08000, 0x17e42633, BRF_GRA }, // 14 - { "ei11.16a", 0x10000, 0x3a77326c, BRF_GRA }, // 15 - { "ei12.17a", 0x08000, 0xfea2a134, BRF_GRA }, // 16 - { "ei13.13c", 0x10000, 0xe5ae2751, BRF_GRA }, // 17 - { "ei14.14c", 0x08000, 0xe83c760a, BRF_GRA }, // 18 - { "ei09.13a", 0x10000, 0x6901e628, BRF_GRA }, // 19 - { "ei10.14a", 0x08000, 0xeeee8a1a, BRF_GRA }, // 20 - - { "ei08.2c", 0x10000, 0x3c87463e, BRF_SND }, // 21 Samples - - { "ei31.9a", 0x01000, 0x2a8745d2, BRF_OPT }, // 22 I8751 -}; - -STD_ROM_PICK(Baddudes) -STD_ROM_FN(Baddudes) - -// Birdie Try (Japan) - -static struct BurnRomInfo birdtryRomDesc[] = { - { "ek-04.bin", 0x10000, 0x5f0f4686, 1 }, // 0 maincpu - { "ek-01.bin", 0x10000, 0x47f470db, 1 }, // 1 - { "ek-05.bin", 0x10000, 0xb508cffd, 1 }, // 2 - { "ek-02.bin", 0x10000, 0x0195d989, 1 }, // 3 - { "ek-06.bin", 0x10000, 0x301d57d8, 1 }, // 4 - { "ek-03.bin", 0x10000, 0x73b0acc5, 1 }, // 5 - - { "ek-07.bin", 0x08000, 0x236549bc, 2 }, // 6 audiocpu - - { "i8751", 0x01000, 0x00000000, 3 | BRF_NODUMP }, // 7 mcu - - { "ek-25.bin", 0x08000, 0x4df134ad, 4 }, // 8 gfx1 - { "ek-26.bin", 0x08000, 0xa00d3e8e, 4 }, // 9 - - { "ek-18.bin", 0x10000, 0x9886fb70, 5 }, // 10 gfx2 - { "ek-17.bin", 0x10000, 0xbed91bf7, 5 }, // 11 - { "ek-20.bin", 0x10000, 0x45d53965, 5 }, // 12 - { "ek-19.bin", 0x10000, 0xc2949dd2, 5 }, // 13 - { "ek-22.bin", 0x10000, 0x7f2cc80a, 5 }, // 14 - { "ek-21.bin", 0x10000, 0x281bc793, 5 }, // 15 - { "ek-24.bin", 0x10000, 0x2244cc75, 5 }, // 16 - { "ek-23.bin", 0x10000, 0xd0ed0116, 5 }, // 17 - - { "ek-15.bin", 0x10000, 0xa6a041a3, 6 }, // 18 gfx4 - { "ek-16.bin", 0x08000, 0x784f62b0, 6 }, // 19 - { "ek-11.bin", 0x10000, 0x9224a6b9, 6 }, // 20 - { "ek-12.bin", 0x08000, 0x12deecfa, 6 }, // 21 - { "ek-13.bin", 0x10000, 0x1f023459, 6 }, // 22 - { "ek-14.bin", 0x08000, 0x57d54943, 6 }, // 23 - { "ek-09.bin", 0x10000, 0x6d2d488a, 6 }, // 24 - { "ek-10.bin", 0x08000, 0x580ba206, 6 }, // 25 - - { "ek-08.bin", 0x10000, 0xbe3db6cb, 7 }, // 26 oki -}; - -STD_ROM_PICK(birdtry) -STD_ROM_FN(birdtry) - -static struct BurnRomInfo BouldashRomDesc[] = { - { "fw-15-2.17l", 0x10000, 0xca19a967, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fw-12-2.9l", 0x10000, 0x242bdc2a, BRF_ESS | BRF_PRG }, // 1 - { "fw-16-2.19l", 0x10000, 0xb7217265, BRF_ESS | BRF_PRG }, // 2 - { "fw-13-2.11l", 0x10000, 0x19209ef4, BRF_ESS | BRF_PRG }, // 3 - { "fw-17-2.20l", 0x10000, 0x78a632a1, BRF_ESS | BRF_PRG }, // 4 - { "fw-14-2.13l", 0x10000, 0x69b6112d, BRF_ESS | BRF_PRG }, // 5 - - { "fn-10", 0x10000, 0xc74106e7, BRF_ESS | BRF_PRG }, // 6 HuC6280 Program - - { "fn-04", 0x10000, 0x40f5a760, BRF_GRA }, // 7 Characters - { "fn-05", 0x10000, 0x824f2168, BRF_GRA }, // 8 - - { "fn-07", 0x10000, 0xeac6a3b3, BRF_GRA }, // 9 Tiles 1 - { "fn-06", 0x10000, 0x3feee292, BRF_GRA }, // 10 - - { "fn-09", 0x20000, 0xc2b27bd2, BRF_GRA }, // 11 Tiles 2 - { "fn-08", 0x20000, 0x5ac97178, BRF_GRA }, // 12 - - { "fn-01", 0x10000, 0x9333121b, BRF_GRA }, // 13 Sprites - { "fn-03", 0x10000, 0x254ba60f, BRF_GRA }, // 14 - { "fn-00", 0x10000, 0xec18d098, BRF_GRA }, // 15 - { "fn-02", 0x10000, 0x4f060cba, BRF_GRA }, // 16 - - { "fn-11", 0x10000, 0x990fd8d9, BRF_SND }, // 17 Samples - - { "ta-16.21k", 0x00100, 0xad26e8d4, BRF_OPT}, // 18 PROMs -}; - -STD_ROM_PICK(Bouldash) -STD_ROM_FN(Bouldash) - -static struct BurnRomInfo BouldashjRomDesc[] = { - { "fn-15-1.17l", 0x10000, 0xd3ef20f8, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fn-12-1.9l", 0x10000, 0xf4a10b45, BRF_ESS | BRF_PRG }, // 1 - { "fn-16-.19l", 0x10000, 0xfd1806a5, BRF_ESS | BRF_PRG }, // 2 - { "fn-13-.11l", 0x10000, 0xd24d3681, BRF_ESS | BRF_PRG }, // 3 - { "fn-17-.20l", 0x10000, 0x28d48a37, BRF_ESS | BRF_PRG }, // 4 - { "fn-14-.13l", 0x10000, 0x8c61c682, BRF_ESS | BRF_PRG }, // 5 - - { "fn-10", 0x10000, 0xc74106e7, BRF_ESS | BRF_PRG }, // 6 HuC6280 Program - - { "fn-04", 0x10000, 0x40f5a760, BRF_GRA }, // 7 Characters - { "fn-05", 0x10000, 0x824f2168, BRF_GRA }, // 8 - - { "fn-07", 0x10000, 0xeac6a3b3, BRF_GRA }, // 9 Tiles 1 - { "fn-06", 0x10000, 0x3feee292, BRF_GRA }, // 10 - - { "fn-09", 0x20000, 0xc2b27bd2, BRF_GRA }, // 11 Tiles 2 - { "fn-08", 0x20000, 0x5ac97178, BRF_GRA }, // 12 - - { "fn-01", 0x10000, 0x9333121b, BRF_GRA }, // 13 Sprites - { "fn-03", 0x10000, 0x254ba60f, BRF_GRA }, // 14 - { "fn-00", 0x10000, 0xec18d098, BRF_GRA }, // 15 - { "fn-02", 0x10000, 0x4f060cba, BRF_GRA }, // 16 - - { "fn-11", 0x10000, 0x990fd8d9, BRF_SND }, // 17 Samples - - { "ta-16.21k", 0x00100, 0xad26e8d4, BRF_OPT}, // 18 PROMs -}; - -STD_ROM_PICK(Bouldashj) -STD_ROM_FN(Bouldashj) - -static struct BurnRomInfo DrgninjaRomDesc[] = { - { "eg04.3c", 0x10000, 0x41b8b3f8, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "eg01.3a", 0x10000, 0xe08e6885, BRF_ESS | BRF_PRG }, // 1 - { "eg06.6c", 0x10000, 0x2b81faf7, BRF_ESS | BRF_PRG }, // 2 - { "eg03.6a", 0x10000, 0xc52c2e9d, BRF_ESS | BRF_PRG }, // 3 - - { "eg07.8a", 0x08000, 0x001d2f51, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "eg25.15j", 0x08000, 0xdd557b19, BRF_GRA }, // 5 Characters - { "eg26.16j", 0x08000, 0x5d75fc8f, BRF_GRA }, // 6 - - { "eg18.14d", 0x10000, 0x05cfc3e5, BRF_GRA }, // 7 Tiles 1 - { "eg20.17d", 0x10000, 0xe11e988f, BRF_GRA }, // 8 - { "eg22.14f", 0x10000, 0xb893d880, BRF_GRA }, // 9 - { "eg24.17f", 0x10000, 0x6f226dda, BRF_GRA }, // 10 - - { "eg30.9j", 0x10000, 0x2438e67e, BRF_GRA }, // 11 Tiles 2 - { "eg28.9f", 0x10000, 0x5c692ab3, BRF_GRA }, // 12 - - { "eg15.16c", 0x10000, 0x5617d67f, BRF_GRA }, // 13 Sprites - { "eg16.17c", 0x08000, 0x17e42633, BRF_GRA }, // 14 - { "eg11.16a", 0x10000, 0xba83e8d8, BRF_GRA }, // 15 - { "eg12.17a", 0x08000, 0xfea2a134, BRF_GRA }, // 16 - { "eg13.13c", 0x10000, 0xfd91e08e, BRF_GRA }, // 17 - { "eg14.14c", 0x08000, 0xe83c760a, BRF_GRA }, // 18 - { "eg09.13a", 0x10000, 0x601b7b23, BRF_GRA }, // 19 - { "eg10.14a", 0x08000, 0xeeee8a1a, BRF_GRA }, // 20 - - { "eg08.2c", 0x10000, 0x92f2c916, BRF_SND }, // 21 Samples - - { "i8751", 0x01000, 0xc3f6bc70, BRF_OPT }, // 22 I8751 -}; - -STD_ROM_PICK(Drgninja) -STD_ROM_FN(Drgninja) - -static struct BurnRomInfo DrgninjabRomDesc[] = { - { "n-12.d2", 0x10000, 0x5a70eb52, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "n-11.a2", 0x10000, 0x3887eb92, BRF_ESS | BRF_PRG }, // 1 - { "eg06.6c", 0x10000, 0x2b81faf7, BRF_ESS | BRF_PRG }, // 2 - { "eg03.6a", 0x10000, 0xc52c2e9d, BRF_ESS | BRF_PRG }, // 3 - - { "eg07.8a", 0x08000, 0x001d2f51, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "eg25.15j", 0x08000, 0xdd557b19, BRF_GRA }, // 5 Characters - { "eg26.16j", 0x08000, 0x5d75fc8f, BRF_GRA }, // 6 - - { "eg18.14d", 0x10000, 0x05cfc3e5, BRF_GRA }, // 7 Tiles 1 - { "eg20.17d", 0x10000, 0xe11e988f, BRF_GRA }, // 8 - { "eg22.14f", 0x10000, 0xb893d880, BRF_GRA }, // 9 - { "eg24.17f", 0x10000, 0x6f226dda, BRF_GRA }, // 10 - - { "eg30.9j", 0x10000, 0x2438e67e, BRF_GRA }, // 11 Tiles 2 - { "eg28.9f", 0x10000, 0x5c692ab3, BRF_GRA }, // 12 - - { "eg15.16c", 0x10000, 0x5617d67f, BRF_GRA }, // 13 Sprites - { "eg16.17c", 0x08000, 0x17e42633, BRF_GRA }, // 14 - { "eg11.16a", 0x10000, 0xba83e8d8, BRF_GRA }, // 15 - { "eg12.17a", 0x08000, 0xfea2a134, BRF_GRA }, // 16 - { "eg13.13c", 0x10000, 0xfd91e08e, BRF_GRA }, // 17 - { "eg14.14c", 0x08000, 0xe83c760a, BRF_GRA }, // 18 - { "eg09.13a", 0x10000, 0x601b7b23, BRF_GRA }, // 19 - { "eg10.14a", 0x08000, 0xeeee8a1a, BRF_GRA }, // 20 - - { "eg08.2c", 0x10000, 0x92f2c916, BRF_SND }, // 21 Samples - - { "i8751", 0x01000, 0xc3f6bc70, BRF_OPT }, // 22 I8751 -}; - -STD_ROM_PICK(Drgninjab) -STD_ROM_FN(Drgninjab) - -// f205v id 932 -// f205v's page shows that this uses an MSM5205 instead of the MSM6295, the MSM5205 data ROM isn't dumped yet, but the MSM6295 ROM is still -// present on the board? For now I'm using the original M6502 program and MSM6295, pending getting a dump of the MSM5205 data -// this set should also use a M68705 apparently, no dump available though -static struct BurnRomInfo Drgninjab2RomDesc[] = { - { "a14.3e", 0x10000, 0xc4b9f4e7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "a11.3b", 0x10000, 0xe4cc7c60, BRF_ESS | BRF_PRG }, // 1 - { "a12.2e", 0x10000, 0x2b81faf7, BRF_ESS | BRF_PRG }, // 2 - { "a9.2b", 0x10000, 0xc52c2e9d, BRF_ESS | BRF_PRG }, // 3 - - { "a15.7b", 0x08000, 0x82007af2, BRF_ESS | BRF_PRG }, // 4 6502 Program (ADPCM sounds are wrong with this, see above, 1st half identical to orginal, 2nd half 99.225%) - - { "a22.9m", 0x08000, 0x6791bc20, BRF_GRA }, // 5 Characters - { "a23.9n", 0x08000, 0x5d75fc8f, BRF_GRA }, // 6 - - { "a25.10f", 0x10000, 0x05cfc3e5, BRF_GRA }, // 7 Tiles 1 - { "a27.10h", 0x10000, 0xe11e988f, BRF_GRA }, // 8 - { "a24.10e", 0x10000, 0xb893d880, BRF_GRA }, // 9 - { "a26.10g", 0x10000, 0x6f226dda, BRF_GRA }, // 10 - - { "a21.9k", 0x08000, 0xb2e989fc, BRF_GRA }, // 11 Tiles 2 - { "a29.10k", 0x08000, 0x4bf80966, BRF_GRA }, // 12 - { "a20.9j", 0x08000, 0xe71c0793, BRF_GRA }, // 13 - { "a28.10j", 0x08000, 0x2d38032d, BRF_GRA }, // 14 - - { "a6.4g", 0x10000, 0x5617d67f, BRF_GRA }, // 15 Sprites - { "a2.4c", 0x08000, 0x17e42633, BRF_GRA }, // 16 - { "a8.5g", 0x10000, 0xba83e8d8, BRF_GRA }, // 17 - { "a4.5c", 0x08000, 0xfea2a134, BRF_GRA }, // 18 - { "a5.3g", 0x10000, 0xfd91e08e, BRF_GRA }, // 19 - { "a1.3c", 0x08000, 0xe83c760a, BRF_GRA }, // 20 - { "a7.4-5g", 0x10000, 0x601b7b23, BRF_GRA }, // 21 - { "a3.4-5c", 0x08000, 0xeeee8a1a, BRF_GRA }, // 22 - - { "a30.10b", 0x10000, 0xf6806826, BRF_SND }, // 23 Samples - - { "mc68705r3p", 0x01000, 0x00000000, BRF_PRG | BRF_NODUMP }, // 24 I8751 - - { "n82s129an.12c", 0x00100, 0x78994fdb, BRF_OPT }, - { "n82s131n.5q", 0x00200, 0x86e775f8, BRF_OPT }, - { "n82s129an.3p", 0x00100, 0x9f6aa3e5, BRF_OPT }, - { "n82s137n.8u", 0x00400, 0xa5cda23e, BRF_OPT }, - { "n82s129an.2q", 0x00100, 0xaf46d1ee, BRF_OPT }, -}; - -STD_ROM_PICK(Drgninjab2) -STD_ROM_FN(Drgninjab2) - -static struct BurnRomInfo HbarrelRomDesc[] = { - { "hb04.bin", 0x10000, 0x4877b09e, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "hb01.bin", 0x10000, 0x8b41c219, BRF_ESS | BRF_PRG }, // 1 - { "hb05.bin", 0x10000, 0x2087d570, BRF_ESS | BRF_PRG }, // 2 - { "hb02.bin", 0x10000, 0x815536ae, BRF_ESS | BRF_PRG }, // 3 - { "hb06.bin", 0x10000, 0xda4e3fbc, BRF_ESS | BRF_PRG }, // 4 - { "hb03.bin", 0x10000, 0x7fed7c46, BRF_ESS | BRF_PRG }, // 5 - - { "hb07.bin", 0x08000, 0xa127f0f7, BRF_ESS | BRF_PRG }, // 6 6502 Program - - { "hb25.bin", 0x10000, 0x8649762c, BRF_GRA }, // 7 Characters - { "hb26.bin", 0x10000, 0xf8189bbd, BRF_GRA }, // 8 - - { "hb18.bin", 0x10000, 0xef664373, BRF_GRA }, // 9 Tiles 1 - { "hb17.bin", 0x10000, 0xa4f186ac, BRF_GRA }, // 10 - { "hb20.bin", 0x10000, 0x2fc13be0, BRF_GRA }, // 11 - { "hb19.bin", 0x10000, 0xd6b47869, BRF_GRA }, // 12 - { "hb22.bin", 0x10000, 0x50d6a1ad, BRF_GRA }, // 13 - { "hb21.bin", 0x10000, 0xf01d75c5, BRF_GRA }, // 14 - { "hb24.bin", 0x10000, 0xae377361, BRF_GRA }, // 15 - { "hb23.bin", 0x10000, 0xbbdaf771, BRF_GRA }, // 16 - - { "hb29.bin", 0x10000, 0x5514b296, BRF_GRA }, // 17 Tiles 2 - { "hb30.bin", 0x10000, 0x5855e8ef, BRF_GRA }, // 18 - { "hb27.bin", 0x10000, 0x99db7b9c, BRF_GRA }, // 19 - { "hb28.bin", 0x10000, 0x33ce2b1a, BRF_GRA }, // 20 - - { "hb15.bin", 0x10000, 0x21816707, BRF_GRA }, // 21 Sprites - { "hb16.bin", 0x10000, 0xa5684574, BRF_GRA }, // 22 - { "hb11.bin", 0x10000, 0x5c768315, BRF_GRA }, // 23 - { "hb12.bin", 0x10000, 0x8b64d7a4, BRF_GRA }, // 24 - { "hb13.bin", 0x10000, 0x56e3ed65, BRF_GRA }, // 25 - { "hb14.bin", 0x10000, 0xbedfe7f3, BRF_GRA }, // 26 - { "hb09.bin", 0x10000, 0x26240ea0, BRF_GRA }, // 27 - { "hb10.bin", 0x10000, 0x47d95447, BRF_GRA }, // 28 - - { "hb08.bin", 0x10000, 0x645c5b68, BRF_SND }, // 29 Samples - - { "hb31.9a", 0x01000, 0x239d726f, BRF_PRG }, // 30 I8751 -}; - -STD_ROM_PICK(Hbarrel) -STD_ROM_FN(Hbarrel) - -static struct BurnRomInfo HbarrelwRomDesc[] = { - { "hb_ec04.rom", 0x10000, 0xd01bc3db, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "hb_ec01.rom", 0x10000, 0x6756f8ae, BRF_ESS | BRF_PRG }, // 1 - { "hb05.bin", 0x10000, 0x2087d570, BRF_ESS | BRF_PRG }, // 2 - { "hb02.bin", 0x10000, 0x815536ae, BRF_ESS | BRF_PRG }, // 3 - { "hb_ec06.rom", 0x10000, 0x61ec20d8, BRF_ESS | BRF_PRG }, // 4 - { "hb_ec03.rom", 0x10000, 0x720c6b13, BRF_ESS | BRF_PRG }, // 5 - - { "hb_ec07.rom", 0x08000, 0x16a5a1aa, BRF_ESS | BRF_PRG }, // 6 6502 Program - - { "hb_ec25.rom", 0x10000, 0x2e5732a2, BRF_GRA }, // 7 Characters - { "hb_ec26.rom", 0x10000, 0x161a2c4d, BRF_GRA }, // 8 - - { "hb18.bin", 0x10000, 0xef664373, BRF_GRA }, // 9 Tiles 1 - { "hb17.bin", 0x10000, 0xa4f186ac, BRF_GRA }, // 10 - { "hb20.bin", 0x10000, 0x2fc13be0, BRF_GRA }, // 11 - { "hb19.bin", 0x10000, 0xd6b47869, BRF_GRA }, // 12 - { "hb22.bin", 0x10000, 0x50d6a1ad, BRF_GRA }, // 13 - { "hb21.bin", 0x10000, 0xf01d75c5, BRF_GRA }, // 14 - { "hb24.bin", 0x10000, 0xae377361, BRF_GRA }, // 15 - { "hb23.bin", 0x10000, 0xbbdaf771, BRF_GRA }, // 16 - - { "hb29.bin", 0x10000, 0x5514b296, BRF_GRA }, // 17 Tiles 2 - { "hb30.bin", 0x10000, 0x5855e8ef, BRF_GRA }, // 18 - { "hb27.bin", 0x10000, 0x99db7b9c, BRF_GRA }, // 19 - { "hb28.bin", 0x10000, 0x33ce2b1a, BRF_GRA }, // 20 - - { "hb15.bin", 0x10000, 0x21816707, BRF_GRA }, // 21 Sprites - { "hb16.bin", 0x10000, 0xa5684574, BRF_GRA }, // 22 - { "hb11.bin", 0x10000, 0x5c768315, BRF_GRA }, // 23 - { "hb12.bin", 0x10000, 0x8b64d7a4, BRF_GRA }, // 24 - { "hb13.bin", 0x10000, 0x56e3ed65, BRF_GRA }, // 25 - { "hb14.bin", 0x10000, 0xbedfe7f3, BRF_GRA }, // 26 - { "hb09.bin", 0x10000, 0x26240ea0, BRF_GRA }, // 27 - { "hb10.bin", 0x10000, 0x47d95447, BRF_GRA }, // 28 - - { "hb_ec08.rom", 0x10000, 0x2159a609, BRF_SND }, // 29 Samples - - { "ec31.9a", 0x01000, 0xaa14a2ae, BRF_PRG }, // 30 I8751 -}; - -STD_ROM_PICK(Hbarrelw) -STD_ROM_FN(Hbarrelw) - -static struct BurnRomInfo HippodrmRomDesc[] = { - { "ew02", 0x10000, 0xdf0d7dc6, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ew01", 0x10000, 0xd5670aa7, BRF_ESS | BRF_PRG }, // 1 - { "ew05", 0x10000, 0xc76d65ec, BRF_ESS | BRF_PRG }, // 2 - { "ew00", 0x10000, 0xe9b427a6, BRF_ESS | BRF_PRG }, // 3 - - { "ew04", 0x08000, 0x9871b98d, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "ew08", 0x10000, 0x53010534, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ew14", 0x10000, 0x71ca593d, BRF_GRA }, // 6 Characters - { "ew13", 0x10000, 0x86be5fa7, BRF_GRA }, // 7 - - { "ew19", 0x08000, 0x6b80d7a3, BRF_GRA }, // 8 Tiles 1 - { "ew18", 0x08000, 0x78d3d764, BRF_GRA }, // 9 - { "ew20", 0x08000, 0xce9f5de3, BRF_GRA }, // 10 - { "ew21", 0x08000, 0x487a7ba2, BRF_GRA }, // 11 - - { "ew24", 0x08000, 0x4e1bc2a4, BRF_GRA }, // 12 Tiles 2 - { "ew25", 0x08000, 0x9eb47dfb, BRF_GRA }, // 13 - { "ew23", 0x08000, 0x9ecf479e, BRF_GRA }, // 14 - { "ew22", 0x08000, 0xe55669aa, BRF_GRA }, // 15 - - { "ew15", 0x10000, 0x95423914, BRF_GRA }, // 16 Sprites - { "ew16", 0x10000, 0x96233177, BRF_GRA }, // 17 - { "ew10", 0x10000, 0x4c25dfe8, BRF_GRA }, // 18 - { "ew11", 0x10000, 0xf2e007fc, BRF_GRA }, // 19 - { "ew06", 0x10000, 0xe4bb8199, BRF_GRA }, // 20 - { "ew07", 0x10000, 0x470b6989, BRF_GRA }, // 21 - { "ew17", 0x10000, 0x8c97c757, BRF_GRA }, // 22 - { "ew12", 0x10000, 0xa2d244bc, BRF_GRA }, // 23 - - { "ew03", 0x10000, 0xb606924d, BRF_SND }, // 24 Samples -}; - -STD_ROM_PICK(Hippodrm) -STD_ROM_FN(Hippodrm) - -static struct BurnRomInfo FfantasyRomDesc[] = { - { "ex02-3.4b", 0x10000, 0xdf0d7dc6, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ex01-3.3b", 0x10000, 0xc0fb4fe5, BRF_ESS | BRF_PRG }, // 1 - { "ex05-.4c", 0x10000, 0xc76d65ec, BRF_ESS | BRF_PRG }, // 2 - { "ex00-.1b", 0x10000, 0xe9b427a6, BRF_ESS | BRF_PRG }, // 3 - - { "ex04-.1c", 0x08000, 0x9871b98d, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "ew08", 0x10000, 0x53010534, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ev14", 0x10000, 0x686f72c1, BRF_GRA }, // 6 Characters - { "ev13", 0x10000, 0xb787dcc9, BRF_GRA }, // 7 - - { "ew19", 0x08000, 0x6b80d7a3, BRF_GRA }, // 8 Tiles 1 - { "ew18", 0x08000, 0x78d3d764, BRF_GRA }, // 9 - { "ew20", 0x08000, 0xce9f5de3, BRF_GRA }, // 10 - { "ew21", 0x08000, 0x487a7ba2, BRF_GRA }, // 11 - - { "ew24", 0x08000, 0x4e1bc2a4, BRF_GRA }, // 12 Tiles 2 - { "ew25", 0x08000, 0x9eb47dfb, BRF_GRA }, // 13 - { "ew23", 0x08000, 0x9ecf479e, BRF_GRA }, // 14 - { "ew22", 0x08000, 0xe55669aa, BRF_GRA }, // 15 - - { "ev15", 0x10000, 0x1d80f797, BRF_GRA }, // 16 Sprites - { "ew16", 0x10000, 0x96233177, BRF_GRA }, // 17 - { "ev10", 0x10000, 0xc4e7116b, BRF_GRA }, // 18 - { "ew11", 0x10000, 0xf2e007fc, BRF_GRA }, // 19 - { "ev06", 0x10000, 0x6c794f1a, BRF_GRA }, // 20 - { "ew07", 0x10000, 0x470b6989, BRF_GRA }, // 21 - { "ev17", 0x10000, 0x045509d4, BRF_GRA }, // 22 - { "ew12", 0x10000, 0xa2d244bc, BRF_GRA }, // 23 - - { "ew03", 0x10000, 0xb606924d, BRF_SND }, // 24 Samples -}; - -STD_ROM_PICK(Ffantasy) -STD_ROM_FN(Ffantasy) - -static struct BurnRomInfo FfantasyjRomDesc[] = { - { "ff-02-2.bin", 0x10000, 0x29fc22a7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ff-01-2.bin", 0x10000, 0x9f617cb4, BRF_ESS | BRF_PRG }, // 1 - { "ew05", 0x10000, 0xc76d65ec, BRF_ESS | BRF_PRG }, // 2 - { "ew00", 0x10000, 0xe9b427a6, BRF_ESS | BRF_PRG }, // 3 - - { "ew04", 0x08000, 0x9871b98d, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "ew08", 0x10000, 0x53010534, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ev14", 0x10000, 0x686f72c1, BRF_GRA }, // 6 Characters - { "ev13", 0x10000, 0xb787dcc9, BRF_GRA }, // 7 - - { "ew19", 0x08000, 0x6b80d7a3, BRF_GRA }, // 8 Tiles 1 - { "ew18", 0x08000, 0x78d3d764, BRF_GRA }, // 9 - { "ew20", 0x08000, 0xce9f5de3, BRF_GRA }, // 10 - { "ew21", 0x08000, 0x487a7ba2, BRF_GRA }, // 11 - - { "ew24", 0x08000, 0x4e1bc2a4, BRF_GRA }, // 12 Tiles 2 - { "ew25", 0x08000, 0x9eb47dfb, BRF_GRA }, // 13 - { "ew23", 0x08000, 0x9ecf479e, BRF_GRA }, // 14 - { "ew22", 0x08000, 0xe55669aa, BRF_GRA }, // 15 - - { "ev15", 0x10000, 0x1d80f797, BRF_GRA }, // 16 Sprites - { "ew16", 0x10000, 0x96233177, BRF_GRA }, // 17 - { "ev10", 0x10000, 0xc4e7116b, BRF_GRA }, // 18 - { "ew11", 0x10000, 0xf2e007fc, BRF_GRA }, // 19 - { "ev06", 0x10000, 0x6c794f1a, BRF_GRA }, // 20 - { "ew07", 0x10000, 0x470b6989, BRF_GRA }, // 21 - { "ev17", 0x10000, 0x045509d4, BRF_GRA }, // 22 - { "ew12", 0x10000, 0xa2d244bc, BRF_GRA }, // 23 - - { "ew03", 0x10000, 0xb606924d, BRF_SND }, // 24 Samples -}; - -STD_ROM_PICK(Ffantasyj) -STD_ROM_FN(Ffantasyj) - -static struct BurnRomInfo FfantasyaRomDesc[] = { - { "ev02", 0x10000, 0x797a7860, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ev01", 0x10000, 0x0f17184d, BRF_ESS | BRF_PRG }, // 1 - { "ew05", 0x10000, 0xc76d65ec, BRF_ESS | BRF_PRG }, // 2 - { "ew00", 0x10000, 0xe9b427a6, BRF_ESS | BRF_PRG }, // 3 - - { "ew04", 0x08000, 0x9871b98d, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "ew08", 0x10000, 0x53010534, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ev14", 0x10000, 0x686f72c1, BRF_GRA }, // 6 Characters - { "ev13", 0x10000, 0xb787dcc9, BRF_GRA }, // 7 - - { "ew19", 0x08000, 0x6b80d7a3, BRF_GRA }, // 8 Tiles 1 - { "ew18", 0x08000, 0x78d3d764, BRF_GRA }, // 9 - { "ew20", 0x08000, 0xce9f5de3, BRF_GRA }, // 10 - { "ew21", 0x08000, 0x487a7ba2, BRF_GRA }, // 11 - - { "ew24", 0x08000, 0x4e1bc2a4, BRF_GRA }, // 12 Tiles 2 - { "ew25", 0x08000, 0x9eb47dfb, BRF_GRA }, // 13 - { "ew23", 0x08000, 0x9ecf479e, BRF_GRA }, // 14 - { "ew22", 0x08000, 0xe55669aa, BRF_GRA }, // 15 - - { "ev15", 0x10000, 0x1d80f797, BRF_GRA }, // 16 Sprites - { "ew16", 0x10000, 0x96233177, BRF_GRA }, // 17 - { "ev10", 0x10000, 0xc4e7116b, BRF_GRA }, // 18 - { "ew11", 0x10000, 0xf2e007fc, BRF_GRA }, // 19 - { "ev06", 0x10000, 0x6c794f1a, BRF_GRA }, // 20 - { "ew07", 0x10000, 0x470b6989, BRF_GRA }, // 21 - { "ev17", 0x10000, 0x045509d4, BRF_GRA }, // 22 - { "ew12", 0x10000, 0xa2d244bc, BRF_GRA }, // 23 - - { "ew03", 0x10000, 0xb606924d, BRF_SND }, // 24 Samples -}; - -STD_ROM_PICK(Ffantasya) -STD_ROM_FN(Ffantasya) - -static struct BurnRomInfo FfantasybRomDesc[] = { - // DE-0297-3 PCB. All EX labels. - { "ex02-2", 0x10000, 0x4c26cda6, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ex01", 0x10000, 0xd2c4ab91, BRF_ESS | BRF_PRG }, // 1 - { "ex05", 0x10000, 0xc76d65ec, BRF_ESS | BRF_PRG }, // 2 - { "ex00", 0x10000, 0xe9b427a6, BRF_ESS | BRF_PRG }, // 3 - - { "ex04", 0x08000, 0x9871b98d, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "ex08", 0x10000, 0x53010534, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ex14", 0x10000, 0x686f72c1, BRF_GRA }, // 6 Characters - { "ex13", 0x10000, 0xb787dcc9, BRF_GRA }, // 7 - - { "ex19", 0x08000, 0x6b80d7a3, BRF_GRA }, // 8 Tiles 1 - { "ex18", 0x08000, 0x78d3d764, BRF_GRA }, // 9 - { "ex20", 0x08000, 0xce9f5de3, BRF_GRA }, // 10 - { "ex21", 0x08000, 0x487a7ba2, BRF_GRA }, // 11 - - { "ex24", 0x08000, 0x4e1bc2a4, BRF_GRA }, // 12 Tiles 2 - { "ex25", 0x08000, 0x9eb47dfb, BRF_GRA }, // 13 - { "ex23", 0x08000, 0x9ecf479e, BRF_GRA }, // 14 - { "ex22", 0x08000, 0xe55669aa, BRF_GRA }, // 15 - - { "ex15", 0x10000, 0x95423914, BRF_GRA }, // 16 Sprites - { "ex16", 0x10000, 0x96233177, BRF_GRA }, // 17 - { "ex10", 0x10000, 0x4c25dfe8, BRF_GRA }, // 18 - { "ex11", 0x10000, 0xf2e007fc, BRF_GRA }, // 19 - { "ex06", 0x10000, 0xe4bb8199, BRF_GRA }, // 20 - { "ex07", 0x10000, 0x470b6989, BRF_GRA }, // 21 - { "ex17", 0x10000, 0x8c97c757, BRF_GRA }, // 22 - { "ex12", 0x10000, 0xa2d244bc, BRF_GRA }, // 23 - - { "ex03", 0x10000, 0xb606924d, BRF_SND }, // 24 Samples -}; - -STD_ROM_PICK(Ffantasyb) -STD_ROM_FN(Ffantasyb) - -static struct BurnRomInfo MidresRomDesc[] = { - { "fk_14.rom", 0x20000, 0xde7522df, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fk_12.rom", 0x20000, 0x3494b8c9, BRF_ESS | BRF_PRG }, // 1 - { "fl15", 0x20000, 0x1328354e, BRF_ESS | BRF_PRG }, // 2 - { "fl13", 0x20000, 0xe3b3955e, BRF_ESS | BRF_PRG }, // 3 - - { "fl16", 0x10000, 0x66360bdf, BRF_ESS | BRF_PRG }, // 4 HuC6280 Program - - { "fk_05.rom", 0x10000, 0x3cdb7453, BRF_GRA }, // 5 Characters - { "fk_04.rom", 0x10000, 0x325ba20c, BRF_GRA }, // 6 - - { "fl09", 0x20000, 0x907d5910, BRF_GRA }, // 7 Tiles 1 - { "fl08", 0x20000, 0xa936c03c, BRF_GRA }, // 8 - { "fl07", 0x20000, 0x2068c45c, BRF_GRA }, // 9 - { "fl06", 0x20000, 0xb7241ab9, BRF_GRA }, // 10 - - { "fl11", 0x20000, 0xb86b73b4, BRF_GRA }, // 11 Tiles 2 - { "fl10", 0x20000, 0x92245b29, BRF_GRA }, // 12 - - { "fl01", 0x20000, 0x2c8b35a7, BRF_GRA }, // 13 Sprites - { "fl03", 0x20000, 0x1eefed3c, BRF_GRA }, // 14 - { "fl00", 0x20000, 0x756fb801, BRF_GRA }, // 15 - { "fl02", 0x20000, 0x54d2c120, BRF_GRA }, // 16 - - { "fl17", 0x20000, 0x9029965d, BRF_SND }, // 17 Samples - - { "7114.prm", 0x00100, 0xeb539ffb, BRF_OPT}, // 18 PROMs - - { "pal16r4a-1.bin", 0x00104, 0xd28fb8e0, BRF_OPT}, // 19 PLDs - { "pal16l8b-2.bin", 0x00104, 0xbcb591e3, BRF_OPT}, // 20 - { "pal16l8a-3.bin", 0x00104, 0xe12972ac, BRF_OPT}, // 21 - { "pal16l8a-4.bin", 0x00104, 0xc6437e49, BRF_OPT}, // 22 - { "pal16l8b-5.bin", 0x00104, 0xe9ee3a67, BRF_OPT}, // 23 - { "pal16l8a-6.bin", 0x00104, 0x23b17abe, BRF_OPT}, // 24 -}; - -STD_ROM_PICK(Midres) -STD_ROM_FN(Midres) - -static struct BurnRomInfo MidresuRomDesc[] = { - { "fl14", 0x20000, 0x2f9507a2, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fl12", 0x20000, 0x3815ad9f, BRF_ESS | BRF_PRG }, // 1 - { "fl15", 0x20000, 0x1328354e, BRF_ESS | BRF_PRG }, // 2 - { "fl13", 0x20000, 0xe3b3955e, BRF_ESS | BRF_PRG }, // 3 - - { "fl16", 0x10000, 0x66360bdf, BRF_ESS | BRF_PRG }, // 4 HuC6280 Program - - { "fl05", 0x10000, 0xd75aba06, BRF_GRA }, // 5 Characters - { "fl04", 0x10000, 0x8f5bbb79, BRF_GRA }, // 6 - - { "fl09", 0x20000, 0x907d5910, BRF_GRA }, // 7 Tiles 1 - { "fl08", 0x20000, 0xa936c03c, BRF_GRA }, // 8 - { "fl07", 0x20000, 0x2068c45c, BRF_GRA }, // 9 - { "fl06", 0x20000, 0xb7241ab9, BRF_GRA }, // 10 - - { "fl11", 0x20000, 0xb86b73b4, BRF_GRA }, // 11 Tiles 2 - { "fl10", 0x20000, 0x92245b29, BRF_GRA }, // 12 - - { "fl01", 0x20000, 0x2c8b35a7, BRF_GRA }, // 13 Sprites - { "fl03", 0x20000, 0x1eefed3c, BRF_GRA }, // 14 - { "fl00", 0x20000, 0x756fb801, BRF_GRA }, // 15 - { "fl02", 0x20000, 0x54d2c120, BRF_GRA }, // 16 - - { "fl17", 0x20000, 0x9029965d, BRF_SND }, // 17 Samples - - { "7114.prm", 0x00100, 0xeb539ffb, BRF_OPT}, // 18 PROMs - - { "pal16r4a-1.bin", 0x00104, 0xd28fb8e0, BRF_OPT}, // 19 PLDs - { "pal16l8b-2.bin", 0x00104, 0xbcb591e3, BRF_OPT}, // 20 - { "pal16l8a-3.bin", 0x00104, 0xe12972ac, BRF_OPT}, // 21 - { "pal16l8a-4.bin", 0x00104, 0xc6437e49, BRF_OPT}, // 22 - { "pal16l8b-5.bin", 0x00104, 0xe9ee3a67, BRF_OPT}, // 23 - { "pal16l8a-6.bin", 0x00104, 0x23b17abe, BRF_OPT}, // 24 -}; - -STD_ROM_PICK(Midresu) -STD_ROM_FN(Midresu) - -static struct BurnRomInfo MidresjRomDesc[] = { - { "fh14", 0x20000, 0x6d632a51, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fh12", 0x20000, 0x45143384, BRF_ESS | BRF_PRG }, // 1 - { "fl15", 0x20000, 0x1328354e, BRF_ESS | BRF_PRG }, // 2 - { "fl13", 0x20000, 0xe3b3955e, BRF_ESS | BRF_PRG }, // 3 - - { "fh16", 0x10000, 0x00736f32, BRF_ESS | BRF_PRG }, // 4 HuC6280 Program - - { "fk_05.rom", 0x10000, 0x3cdb7453, BRF_GRA }, // 5 Characters - { "fk_04.rom", 0x10000, 0x325ba20c, BRF_GRA }, // 6 - - { "fl09", 0x20000, 0x907d5910, BRF_GRA }, // 7 Tiles 1 - { "fl08", 0x20000, 0xa936c03c, BRF_GRA }, // 8 - { "fl07", 0x20000, 0x2068c45c, BRF_GRA }, // 9 - { "fl06", 0x20000, 0xb7241ab9, BRF_GRA }, // 10 - - { "fl11", 0x20000, 0xb86b73b4, BRF_GRA }, // 11 Tiles 2 - { "fl10", 0x20000, 0x92245b29, BRF_GRA }, // 12 - - { "fl01", 0x20000, 0x2c8b35a7, BRF_GRA }, // 13 Sprites - { "fl03", 0x20000, 0x1eefed3c, BRF_GRA }, // 14 - { "fl00", 0x20000, 0x756fb801, BRF_GRA }, // 15 - { "fl02", 0x20000, 0x54d2c120, BRF_GRA }, // 16 - - { "fh17", 0x20000, 0xc7b0a24e, BRF_SND }, // 17 Samples - - { "7114.prm", 0x00100, 0xeb539ffb, BRF_OPT}, // 18 PROMs - - { "pal16r4a-1.bin", 0x00104, 0xd28fb8e0, BRF_OPT}, // 19 PLDs - { "pal16l8b-2.bin", 0x00104, 0xbcb591e3, BRF_OPT}, // 20 - { "pal16l8a-3.bin", 0x00104, 0xe12972ac, BRF_OPT}, // 21 - { "pal16l8a-4.bin", 0x00104, 0xc6437e49, BRF_OPT}, // 22 - { "pal16l8b-5.bin", 0x00104, 0xe9ee3a67, BRF_OPT}, // 23 - { "pal16l8a-6.bin", 0x00104, 0x23b17abe, BRF_OPT}, // 24 -}; - -STD_ROM_PICK(Midresj) -STD_ROM_FN(Midresj) - -static struct BurnRomInfo RobocopRomDesc[] = { - { "ep05-4.11c", 0x10000, 0x29c35379, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ep01-4.11b", 0x10000, 0x77507c69, BRF_ESS | BRF_PRG }, // 1 - { "ep04-3", 0x10000, 0x39181778, BRF_ESS | BRF_PRG }, // 2 - { "ep00-3", 0x10000, 0xe128541f, BRF_ESS | BRF_PRG }, // 3 - - { "ep03-3", 0x08000, 0x5b164b24, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "en_24_mb7124e.a2", 0x00200, 0xb8e2ca98, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ep23", 0x10000, 0xa77e4ab1, BRF_GRA }, // 6 Characters - { "ep22", 0x10000, 0x9fbd6903, BRF_GRA }, // 7 - - { "ep20", 0x10000, 0x1d8d38b8, BRF_GRA }, // 8 Tiles 1 - { "ep21", 0x10000, 0x187929b2, BRF_GRA }, // 9 - { "ep18", 0x10000, 0xb6580b5e, BRF_GRA }, // 10 - { "ep19", 0x10000, 0x9bad01c7, BRF_GRA }, // 11 - - { "ep14", 0x08000, 0xca56ceda, BRF_GRA }, // 12 Tiles 2 - { "ep15", 0x08000, 0xa945269c, BRF_GRA }, // 13 - { "ep16", 0x08000, 0xe7fa4d58, BRF_GRA }, // 14 - { "ep17", 0x08000, 0x84aae89d, BRF_GRA }, // 15 - - { "ep07", 0x10000, 0x495d75cf, BRF_GRA }, // 16 Sprites - { "ep06", 0x08000, 0xa2ae32e2, BRF_GRA }, // 17 - { "ep11", 0x10000, 0x62fa425a, BRF_GRA }, // 18 - { "ep10", 0x08000, 0xcce3bd95, BRF_GRA }, // 19 - { "ep09", 0x10000, 0x11bed656, BRF_GRA }, // 20 - { "ep08", 0x08000, 0xc45c7b4c, BRF_GRA }, // 21 - { "ep13", 0x10000, 0x8fca9f28, BRF_GRA }, // 22 - { "ep12", 0x08000, 0x3cd1d0c3, BRF_GRA }, // 23 - - { "ep02", 0x10000, 0x711ce46f, BRF_SND }, // 24 Samples - - { "mb7116e.12c", 0x00400, 0xc288a256, BRF_OPT}, // 25 PROMs - { "mb7122e.17e", 0x00800, 0x64764ecf, BRF_OPT}, // 26 -}; - -STD_ROM_PICK(Robocop) -STD_ROM_FN(Robocop) - -static struct BurnRomInfo RobocopwRomDesc[] = { - { "ep05-3", 0x10000, 0xba69bf84, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ep01-3", 0x10000, 0x2a9f6e2c, BRF_ESS | BRF_PRG }, // 1 - { "ep04-3", 0x10000, 0x39181778, BRF_ESS | BRF_PRG }, // 2 - { "ep00-3", 0x10000, 0xe128541f, BRF_ESS | BRF_PRG }, // 3 - - { "ep03-3", 0x08000, 0x5b164b24, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "en_24.a2", 0x00200, 0xb8e2ca98, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ep23", 0x10000, 0xa77e4ab1, BRF_GRA }, // 6 Characters - { "ep22", 0x10000, 0x9fbd6903, BRF_GRA }, // 7 - - { "ep20", 0x10000, 0x1d8d38b8, BRF_GRA }, // 8 Tiles 1 - { "ep21", 0x10000, 0x187929b2, BRF_GRA }, // 9 - { "ep18", 0x10000, 0xb6580b5e, BRF_GRA }, // 10 - { "ep19", 0x10000, 0x9bad01c7, BRF_GRA }, // 11 - - { "ep14", 0x08000, 0xca56ceda, BRF_GRA }, // 12 Tiles 2 - { "ep15", 0x08000, 0xa945269c, BRF_GRA }, // 13 - { "ep16", 0x08000, 0xe7fa4d58, BRF_GRA }, // 14 - { "ep17", 0x08000, 0x84aae89d, BRF_GRA }, // 15 - - { "ep07", 0x10000, 0x495d75cf, BRF_GRA }, // 16 Sprites - { "ep06", 0x08000, 0xa2ae32e2, BRF_GRA }, // 17 - { "ep11", 0x10000, 0x62fa425a, BRF_GRA }, // 18 - { "ep10", 0x08000, 0xcce3bd95, BRF_GRA }, // 19 - { "ep09", 0x10000, 0x11bed656, BRF_GRA }, // 20 - { "ep08", 0x08000, 0xc45c7b4c, BRF_GRA }, // 21 - { "ep13", 0x10000, 0x8fca9f28, BRF_GRA }, // 22 - { "ep12", 0x08000, 0x3cd1d0c3, BRF_GRA }, // 23 - - { "ep02", 0x10000, 0x711ce46f, BRF_SND }, // 24 Samples -}; - -STD_ROM_PICK(Robocopw) -STD_ROM_FN(Robocopw) - -static struct BurnRomInfo RobocopjRomDesc[] = { - { "em05-1.c11", 0x10000, 0x954ea8f4, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "em01-1.b12", 0x10000, 0x1b87b622, BRF_ESS | BRF_PRG }, // 1 - { "ep04-3", 0x10000, 0x39181778, BRF_ESS | BRF_PRG }, // 2 - { "ep00-3", 0x10000, 0xe128541f, BRF_ESS | BRF_PRG }, // 3 - - { "ep03-3", 0x08000, 0x5b164b24, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "en_24.a2", 0x00200, 0xb8e2ca98, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ep23", 0x10000, 0xa77e4ab1, BRF_GRA }, // 6 Characters - { "ep22", 0x10000, 0x9fbd6903, BRF_GRA }, // 7 - - { "ep20", 0x10000, 0x1d8d38b8, BRF_GRA }, // 8 Tiles 1 - { "ep21", 0x10000, 0x187929b2, BRF_GRA }, // 9 - { "ep18", 0x10000, 0xb6580b5e, BRF_GRA }, // 10 - { "ep19", 0x10000, 0x9bad01c7, BRF_GRA }, // 11 - - { "ep14", 0x08000, 0xca56ceda, BRF_GRA }, // 12 Tiles 2 - { "ep15", 0x08000, 0xa945269c, BRF_GRA }, // 13 - { "ep16", 0x08000, 0xe7fa4d58, BRF_GRA }, // 14 - { "ep17", 0x08000, 0x84aae89d, BRF_GRA }, // 15 - - { "ep07", 0x10000, 0x495d75cf, BRF_GRA }, // 16 Sprites - { "ep06", 0x08000, 0xa2ae32e2, BRF_GRA }, // 17 - { "ep11", 0x10000, 0x62fa425a, BRF_GRA }, // 18 - { "ep10", 0x08000, 0xcce3bd95, BRF_GRA }, // 19 - { "ep09", 0x10000, 0x11bed656, BRF_GRA }, // 20 - { "ep08", 0x08000, 0xc45c7b4c, BRF_GRA }, // 21 - { "ep13", 0x10000, 0x8fca9f28, BRF_GRA }, // 22 - { "ep12", 0x08000, 0x3cd1d0c3, BRF_GRA }, // 23 - - { "ep02", 0x10000, 0x711ce46f, BRF_SND }, // 24 Samples -}; - -STD_ROM_PICK(Robocopj) -STD_ROM_FN(Robocopj) - -static struct BurnRomInfo RobocopuRomDesc[] = { - { "ep05-1", 0x10000, 0x8de5cb3d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ep01-1", 0x10000, 0xb3c6bc02, BRF_ESS | BRF_PRG }, // 1 - { "ep04", 0x10000, 0xc38b9d18, BRF_ESS | BRF_PRG }, // 2 - { "ep00", 0x10000, 0x374c91aa, BRF_ESS | BRF_PRG }, // 3 - - { "ep03", 0x08000, 0x1089eab8, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "en_24.a2", 0x00200, 0xb8e2ca98, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ep23", 0x10000, 0xa77e4ab1, BRF_GRA }, // 6 Characters - { "ep22", 0x10000, 0x9fbd6903, BRF_GRA }, // 7 - - { "ep20", 0x10000, 0x1d8d38b8, BRF_GRA }, // 8 Tiles 1 - { "ep21", 0x10000, 0x187929b2, BRF_GRA }, // 9 - { "ep18", 0x10000, 0xb6580b5e, BRF_GRA }, // 10 - { "ep19", 0x10000, 0x9bad01c7, BRF_GRA }, // 11 - - { "ep14", 0x08000, 0xca56ceda, BRF_GRA }, // 12 Tiles 2 - { "ep15", 0x08000, 0xa945269c, BRF_GRA }, // 13 - { "ep16", 0x08000, 0xe7fa4d58, BRF_GRA }, // 14 - { "ep17", 0x08000, 0x84aae89d, BRF_GRA }, // 15 - - { "ep07", 0x10000, 0x495d75cf, BRF_GRA }, // 16 Sprites - { "ep06", 0x08000, 0xa2ae32e2, BRF_GRA }, // 17 - { "ep11", 0x10000, 0x62fa425a, BRF_GRA }, // 18 - { "ep10", 0x08000, 0xcce3bd95, BRF_GRA }, // 19 - { "ep09", 0x10000, 0x11bed656, BRF_GRA }, // 20 - { "ep08", 0x08000, 0xc45c7b4c, BRF_GRA }, // 21 - { "ep13", 0x10000, 0x8fca9f28, BRF_GRA }, // 22 - { "ep12", 0x08000, 0x3cd1d0c3, BRF_GRA }, // 23 - - { "ep02", 0x10000, 0x711ce46f, BRF_SND }, // 24 Samples -}; - -STD_ROM_PICK(Robocopu) -STD_ROM_FN(Robocopu) - -static struct BurnRomInfo Robocopu0RomDesc[] = { - { "ep05", 0x10000, 0xc465bdd8, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ep01", 0x10000, 0x1352d36e, BRF_ESS | BRF_PRG }, // 1 - { "ep04", 0x10000, 0xc38b9d18, BRF_ESS | BRF_PRG }, // 2 - { "ep00", 0x10000, 0x374c91aa, BRF_ESS | BRF_PRG }, // 3 - - { "ep03", 0x08000, 0x1089eab8, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "en_24.a2", 0x00200, 0xb8e2ca98, BRF_ESS | BRF_PRG }, // 5 HuC6280 Program - - { "ep23", 0x10000, 0xa77e4ab1, BRF_GRA }, // 6 Characters - { "ep22", 0x10000, 0x9fbd6903, BRF_GRA }, // 7 - - { "ep20", 0x10000, 0x1d8d38b8, BRF_GRA }, // 8 Tiles 1 - { "ep21", 0x10000, 0x187929b2, BRF_GRA }, // 9 - { "ep18", 0x10000, 0xb6580b5e, BRF_GRA }, // 10 - { "ep19", 0x10000, 0x9bad01c7, BRF_GRA }, // 11 - - { "ep14", 0x08000, 0xca56ceda, BRF_GRA }, // 12 Tiles 2 - { "ep15", 0x08000, 0xa945269c, BRF_GRA }, // 13 - { "ep16", 0x08000, 0xe7fa4d58, BRF_GRA }, // 14 - { "ep17", 0x08000, 0x84aae89d, BRF_GRA }, // 15 - - { "ep07", 0x10000, 0x495d75cf, BRF_GRA }, // 16 Sprites - { "ep06", 0x08000, 0xa2ae32e2, BRF_GRA }, // 17 - { "ep11", 0x10000, 0x62fa425a, BRF_GRA }, // 18 - { "ep10", 0x08000, 0xcce3bd95, BRF_GRA }, // 19 - { "ep09", 0x10000, 0x11bed656, BRF_GRA }, // 20 - { "ep08", 0x08000, 0xc45c7b4c, BRF_GRA }, // 21 - { "ep13", 0x10000, 0x8fca9f28, BRF_GRA }, // 22 - { "ep12", 0x08000, 0x3cd1d0c3, BRF_GRA }, // 23 - - { "ep02", 0x10000, 0x711ce46f, BRF_SND }, // 24 Samples -}; - -STD_ROM_PICK(Robocopu0) -STD_ROM_FN(Robocopu0) - -static struct BurnRomInfo RobocopbRomDesc[] = { - { "robop_05.rom", 0x10000, 0xbcef3e9b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "robop_01.rom", 0x10000, 0xc9803685, BRF_ESS | BRF_PRG }, // 1 - { "robop_04.rom", 0x10000, 0x9d7b79e0, BRF_ESS | BRF_PRG }, // 2 - { "robop_00.rom", 0x10000, 0x80ba64ab, BRF_ESS | BRF_PRG }, // 3 - - { "ep03-3", 0x08000, 0x5b164b24, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "ep23", 0x10000, 0xa77e4ab1, BRF_GRA }, // 5 Characters - { "ep22", 0x10000, 0x9fbd6903, BRF_GRA }, // 6 - - { "ep20", 0x10000, 0x1d8d38b8, BRF_GRA }, // 7 Tiles 1 - { "ep21", 0x10000, 0x187929b2, BRF_GRA }, // 8 - { "ep18", 0x10000, 0xb6580b5e, BRF_GRA }, // 9 - { "ep19", 0x10000, 0x9bad01c7, BRF_GRA }, // 10 - - { "ep14", 0x08000, 0xca56ceda, BRF_GRA }, // 11 Tiles 2 - { "ep15", 0x08000, 0xa945269c, BRF_GRA }, // 12 - { "ep16", 0x08000, 0xe7fa4d58, BRF_GRA }, // 13 - { "ep17", 0x08000, 0x84aae89d, BRF_GRA }, // 14 - - { "ep07", 0x10000, 0x495d75cf, BRF_GRA }, // 15 Sprites - { "ep06", 0x08000, 0xa2ae32e2, BRF_GRA }, // 16 - { "ep11", 0x10000, 0x62fa425a, BRF_GRA }, // 17 - { "ep10", 0x08000, 0xcce3bd95, BRF_GRA }, // 18 - { "ep09", 0x10000, 0x11bed656, BRF_GRA }, // 19 - { "ep08", 0x08000, 0xc45c7b4c, BRF_GRA }, // 20 - { "ep13", 0x10000, 0x8fca9f28, BRF_GRA }, // 21 - { "ep12", 0x08000, 0x3cd1d0c3, BRF_GRA }, // 22 - - { "ep02", 0x10000, 0x711ce46f, BRF_SND }, // 23 Samples -}; - -STD_ROM_PICK(Robocopb) -STD_ROM_FN(Robocopb) - -static struct BurnRomInfo Robocopb2RomDesc[] = { - { "s-9.e3", 0x10000, 0xbcef3e9b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "s-11.c3", 0x10000, 0xc9803685, BRF_ESS | BRF_PRG }, // 1 - { "s-10.e2", 0x10000, 0x9d7b79e0, BRF_ESS | BRF_PRG }, // 2 - { "s-12.c2", 0x10000, 0x631301c1, BRF_ESS | BRF_PRG }, // 3 - - { "ep03-3", 0x08000, 0x5b164b24, BRF_ESS | BRF_PRG }, // 4 6502 Program - - { "ep23", 0x10000, 0xa77e4ab1, BRF_GRA }, // 5 Characters - { "ep22", 0x10000, 0x9fbd6903, BRF_GRA }, // 6 - - { "ep20", 0x10000, 0x1d8d38b8, BRF_GRA }, // 7 Tiles 1 - { "ep21", 0x10000, 0x187929b2, BRF_GRA }, // 8 - { "ep18", 0x10000, 0xb6580b5e, BRF_GRA }, // 9 - { "ep19", 0x10000, 0x9bad01c7, BRF_GRA }, // 10 - - { "ep14", 0x08000, 0xca56ceda, BRF_GRA }, // 11 Tiles 2 - { "ep15", 0x08000, 0xa945269c, BRF_GRA }, // 12 - { "ep16", 0x08000, 0xe7fa4d58, BRF_GRA }, // 13 - { "ep17", 0x08000, 0x84aae89d, BRF_GRA }, // 14 - - { "ep07", 0x10000, 0x495d75cf, BRF_GRA }, // 15 Sprites - { "ep06", 0x08000, 0xa2ae32e2, BRF_GRA }, // 16 - { "ep11", 0x10000, 0x62fa425a, BRF_GRA }, // 17 - { "ep10", 0x08000, 0xcce3bd95, BRF_GRA }, // 18 - { "ep09", 0x10000, 0x11bed656, BRF_GRA }, // 19 - { "ep08", 0x08000, 0xc45c7b4c, BRF_GRA }, // 20 - { "ep13", 0x10000, 0x8fca9f28, BRF_GRA }, // 21 - { "ep12", 0x08000, 0x3cd1d0c3, BRF_GRA }, // 22 - - { "ep02", 0x10000, 0x711ce46f, BRF_SND }, // 23 Samples -}; - -STD_ROM_PICK(Robocopb2) -STD_ROM_FN(Robocopb2) - -static struct BurnRomInfo SecretagRomDesc[] = { - { "fb14-3.17l", 0x10000, 0x9be6ac90, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fb12-3.9l", 0x10000, 0x28904b6b, BRF_ESS | BRF_PRG }, // 1 - { "fb15.19l", 0x10000, 0x106bb26c, BRF_ESS | BRF_PRG }, // 2 - { "fb13.11l", 0x10000, 0x90523413, BRF_ESS | BRF_PRG }, // 3 - - { "fb10.5h", 0x10000, 0xdfd2ff25, BRF_ESS | BRF_PRG }, // 4 HuC6280 Program - - { "fb05.11a", 0x08000, 0x09802924, BRF_GRA }, // 5 Characters - { "fb04.9a", 0x08000, 0xec25b895, BRF_GRA }, // 6 - - { "fb07.17a", 0x10000, 0xe932268b, BRF_GRA }, // 7 Tiles 1 - { "fb06.15a", 0x10000, 0xc4dd38c0, BRF_GRA }, // 8 - - { "fb09.22a", 0x20000, 0x1395e9be, BRF_GRA }, // 9 Tiles 2 - { "fb08.21a", 0x20000, 0x4d7464db, BRF_GRA }, // 10 - - { "fb01.4a", 0x20000, 0x99b0cd92, BRF_GRA }, // 11 Sprites - { "fb03.7a", 0x20000, 0x0e7ea74d, BRF_GRA }, // 12 - { "fb00.2a", 0x20000, 0xf7df3fd7, BRF_GRA }, // 13 - { "fb02.5a", 0x20000, 0x84e8da9d, BRF_GRA }, // 14 - - { "fa11.11k", 0x20000, 0x4e547bad, BRF_SND }, // 15 Samples - - { "mb7114h.21k", 0x00100, 0xad26e8d4, BRF_OPT}, // 16 PROMs - - { "pal16l8b-ta-1.15k", 0x00104, 0x79a87527, BRF_OPT}, // 17 PLDs - { "pal16r4a-ta-2.16k", 0x00104, 0xeca31311, BRF_OPT}, // 18 - { "pal16l8a-ta-3.17k", 0x00104, 0x6c324919, BRF_OPT}, // 19 - { "pal16l8a-ta-4.11m", 0x00104, 0x116177fa, BRF_OPT}, // 20 -}; - -STD_ROM_PICK(Secretag) -STD_ROM_FN(Secretag) - -static struct BurnRomInfo SecretagjRomDesc[] = { - { "fc14-2.17l", 0x10000, 0xe4cc767d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fc12-2.9l", 0x10000, 0x8a589c90, BRF_ESS | BRF_PRG }, // 1 - { "fc15.19l", 0x10000, 0x106bb26c, BRF_ESS | BRF_PRG }, // 2 - { "fc13.11l", 0x10000, 0x90523413, BRF_ESS | BRF_PRG }, // 3 - - { "fc10.5h", 0x10000, 0xdfd2ff25, BRF_ESS | BRF_PRG }, // 4 HuC6280 Program - - { "fc05.11a", 0x08000, 0x09802924, BRF_GRA }, // 5 Characters - { "fc04.9a", 0x08000, 0xec25b895, BRF_GRA }, // 6 - - { "fc07.17a", 0x10000, 0xe932268b, BRF_GRA }, // 7 Tiles 1 - { "fc06.15a", 0x10000, 0xc4dd38c0, BRF_GRA }, // 8 - - { "fc09.22a", 0x20000, 0x1395e9be, BRF_GRA }, // 9 Tiles 2 - { "fc08.21a", 0x20000, 0x4d7464db, BRF_GRA }, // 10 - - { "fc01.4a", 0x20000, 0x99b0cd92, BRF_GRA }, // 11 Sprites - { "fc03.7a", 0x20000, 0x0e7ea74d, BRF_GRA }, // 12 - { "fc00.2a", 0x20000, 0xf7df3fd7, BRF_GRA }, // 13 - { "fc02.5a", 0x20000, 0x84e8da9d, BRF_GRA }, // 14 - - { "fc11.11k", 0x20000, 0x4e547bad, BRF_SND }, // 15 Samples - - { "mb7114h.21k", 0x00100, 0xad26e8d4, BRF_OPT}, // 16 PROMs - - { "pal16l8b-ta-1.15k", 0x00104, 0x79a87527, BRF_OPT}, // 17 PLDs - { "pal16r4a-ta-2.16k", 0x00104, 0xeca31311, BRF_OPT}, // 18 - { "pal16l8a-ta-3.17k", 0x00104, 0x6c324919, BRF_OPT}, // 19 - { "pal16l8a-ta-4.11m", 0x00104, 0x116177fa, BRF_OPT}, // 20 -}; - -STD_ROM_PICK(Secretagj) -STD_ROM_FN(Secretagj) - -static struct BurnRomInfo SlyspyRomDesc[] = { - { "fa14-4.17l", 0x10000, 0x60f16e31, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fa12-4.9l", 0x10000, 0xb9b9fdcf, BRF_ESS | BRF_PRG }, // 1 - { "fa15.19l", 0x10000, 0x04a79266, BRF_ESS | BRF_PRG }, // 2 - { "fa13.11l", 0x10000, 0x641cc4b3, BRF_ESS | BRF_PRG }, // 3 - - { "fa10.5h", 0x10000, 0xdfd2ff25, BRF_ESS | BRF_PRG }, // 4 HuC6280 Program - - { "fa05.11a", 0x08000, 0x09802924, BRF_GRA }, // 5 Characters - { "fa04.9a", 0x08000, 0xec25b895, BRF_GRA }, // 6 - - { "fa07.17a", 0x10000, 0xe932268b, BRF_GRA }, // 7 Tiles 1 - { "fa06.15a", 0x10000, 0xc4dd38c0, BRF_GRA }, // 8 - - { "fa09.22a", 0x20000, 0x1395e9be, BRF_GRA }, // 9 Tiles 2 - { "fa08.21a", 0x20000, 0x4d7464db, BRF_GRA }, // 10 - - { "fa01.4a", 0x20000, 0x99b0cd92, BRF_GRA }, // 11 Sprites - { "fa03.7a", 0x20000, 0x0e7ea74d, BRF_GRA }, // 12 - { "fa00.2a", 0x20000, 0xf7df3fd7, BRF_GRA }, // 13 - { "fa02.5a", 0x20000, 0x84e8da9d, BRF_GRA }, // 14 - - { "fa11.11k", 0x20000, 0x4e547bad, BRF_SND }, // 15 Samples - - { "mb7114h.21k", 0x00100, 0xad26e8d4, BRF_OPT}, // 16 PROMs - - { "pal16l8b-ta-1.15k", 0x00104, 0x79a87527, BRF_OPT}, // 17 PLDs - { "pal16r4a-ta-2.16k", 0x00104, 0xeca31311, BRF_OPT}, // 18 - { "pal16l8a-ta-3.17k", 0x00104, 0x6c324919, BRF_OPT}, // 19 - { "pal16l8a-ta-4.11m", 0x00104, 0x116177fa, BRF_OPT}, // 20 -}; - -STD_ROM_PICK(Slyspy) -STD_ROM_FN(Slyspy) - -static struct BurnRomInfo Slyspy2RomDesc[] = { - { "fa14-2.17l", 0x10000, 0x0e431e39, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fa12-2.9l", 0x10000, 0x1b534294, BRF_ESS | BRF_PRG }, // 1 - { "fa15.19l", 0x10000, 0x04a79266, BRF_ESS | BRF_PRG }, // 2 - { "fa13.11l", 0x10000, 0x641cc4b3, BRF_ESS | BRF_PRG }, // 3 - - { "fa10.5h", 0x10000, 0xdfd2ff25, BRF_ESS | BRF_PRG }, // 4 HuC6280 Program - - { "fa05.11a", 0x08000, 0x09802924, BRF_GRA }, // 5 Characters - { "fa04.9a", 0x08000, 0xec25b895, BRF_GRA }, // 6 - - { "fa07.17a", 0x10000, 0xe932268b, BRF_GRA }, // 7 Tiles 1 - { "fa06.15a", 0x10000, 0xc4dd38c0, BRF_GRA }, // 8 - - { "fa09.22a", 0x20000, 0x1395e9be, BRF_GRA }, // 9 Tiles 2 - { "fa08.21a", 0x20000, 0x4d7464db, BRF_GRA }, // 10 - - { "fa01.4a", 0x20000, 0x99b0cd92, BRF_GRA }, // 11 Sprites - { "fa03.7a", 0x20000, 0x0e7ea74d, BRF_GRA }, // 12 - { "fa00.2a", 0x20000, 0xf7df3fd7, BRF_GRA }, // 13 - { "fa02.5a", 0x20000, 0x84e8da9d, BRF_GRA }, // 14 - - { "fa11.11k", 0x20000, 0x4e547bad, BRF_SND }, // 15 Samples - - { "mb7114h.21k", 0x00100, 0xad26e8d4, BRF_OPT}, // 16 PROMs - - { "pal16l8b-ta-1.15k", 0x00104, 0x79a87527, BRF_OPT}, // 17 PLDs - { "pal16r4a-ta-2.16k", 0x00104, 0xeca31311, BRF_OPT}, // 18 - { "pal16l8a-ta-3.17k", 0x00104, 0x6c324919, BRF_OPT}, // 19 - { "pal16l8a-ta-4.11m", 0x00104, 0x116177fa, BRF_OPT}, // 20 -}; - -STD_ROM_PICK(Slyspy2) -STD_ROM_FN(Slyspy2) - -static struct BurnRomInfo Slyspy3RomDesc[] = { - { "fa14-3.17l", 0x10000, 0x54353a84, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fa12-2.9l", 0x10000, 0x1b534294, BRF_ESS | BRF_PRG }, // 1 - { "fa15.19l", 0x10000, 0x04a79266, BRF_ESS | BRF_PRG }, // 2 - { "fa13.11l", 0x10000, 0x641cc4b3, BRF_ESS | BRF_PRG }, // 3 - - { "fa10.5h", 0x10000, 0xdfd2ff25, BRF_ESS | BRF_PRG }, // 4 HuC6280 Program - - { "fa05.11a", 0x08000, 0x09802924, BRF_GRA }, // 5 Characters - { "fa04.9a", 0x08000, 0xec25b895, BRF_GRA }, // 6 - - { "fa07.17a", 0x10000, 0xe932268b, BRF_GRA }, // 7 Tiles 1 - { "fa06.15a", 0x10000, 0xc4dd38c0, BRF_GRA }, // 8 - - { "fa09.22a", 0x20000, 0x1395e9be, BRF_GRA }, // 9 Tiles 2 - { "fa08.21a", 0x20000, 0x4d7464db, BRF_GRA }, // 10 - - { "fa01.4a", 0x20000, 0x99b0cd92, BRF_GRA }, // 11 Sprites - { "fa03.7a", 0x20000, 0x0e7ea74d, BRF_GRA }, // 12 - { "fa00.2a", 0x20000, 0xf7df3fd7, BRF_GRA }, // 13 - { "fa02.5a", 0x20000, 0x84e8da9d, BRF_GRA }, // 14 - - { "fa11.11k", 0x20000, 0x4e547bad, BRF_SND }, // 15 Samples - - { "mb7114h.21k", 0x00100, 0xad26e8d4, BRF_OPT}, // 16 PROMs - - { "pal16l8b-ta-1.15k", 0x00104, 0x79a87527, BRF_OPT}, // 17 PLDs - { "pal16r4a-ta-2.16k", 0x00104, 0xeca31311, BRF_OPT}, // 18 - { "pal16l8a-ta-3.17k", 0x00104, 0x6c324919, BRF_OPT}, // 19 - { "pal16l8a-ta-4.11m", 0x00104, 0x116177fa, BRF_OPT}, // 20 -}; - -STD_ROM_PICK(Slyspy3) -STD_ROM_FN(Slyspy3) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x80000; - DrvM6502Rom = Next; Next += 0x08000; - DrvH6280Rom = Next; Next += 0x10000; - DrvMCURom = Next; Next += 0x01000; - MSM6295ROM = Next; Next += 0x40000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x05800; - DrvM6502Ram = Next; Next += 0x00600; - DrvH6280Ram = Next; Next += 0x02000; - DrvCharRam = Next; Next += 0x04000; - DrvCharCtrl0Ram = Next; Next += 0x00008; - DrvCharCtrl1Ram = Next; Next += 0x00008; - DrvCharColScrollRam = Next; Next += 0x00100; - DrvCharRowScrollRam = Next; Next += 0x00400; - DrvVideo1Ram = Next; Next += 0x04000; - DrvVideo1Ctrl0Ram = Next; Next += 0x00008; - DrvVideo1Ctrl1Ram = Next; Next += 0x00008; - DrvVideo1ColScrollRam = Next; Next += 0x00100; - DrvVideo1RowScrollRam = Next; Next += 0x00400; - DrvVideo2Ram = Next; Next += 0x04000; - DrvVideo2Ctrl0Ram = Next; Next += 0x00008; - DrvVideo2Ctrl1Ram = Next; Next += 0x00008; - DrvVideo2ColScrollRam = Next; Next += 0x00100; - DrvVideo2RowScrollRam = Next; Next += 0x00400; - DrvPaletteRam = Next; Next += 0x00800; - DrvPalette2Ram = Next; Next += 0x00800; - DrvSpriteRam = Next; Next += 0x00800; - DrvSpriteDMABufferRam = Next; Next += 0x00800; - DrvSharedRam = Next; Next += 0x02000; - - RamEnd = Next; - - DrvChars = Next; Next += 0x1000 * 8 * 8; - DrvTiles1 = Next; Next += 0x1000 * 16 * 16; - DrvTiles2 = Next; Next += 0x0800 * 16 * 16; - DrvSprites = Next; Next += 0x1000 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - pCharLayerDraw = (UINT16*)Next; Next += (1024 * 256 * sizeof(UINT16)); - pTile1LayerDraw = (UINT16*)Next; Next += (1024 * 256 * sizeof(UINT16)); - pTile2LayerDraw = (UINT16*)Next; Next += (1024 * 256 * sizeof(UINT16)); - - MemEnd = Next; - - return 0; -} - -static void RotateReset(); // forward -dink -static void DrvMCUReset(); // forward -static void DrvMCUSync(); // "" - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - BurnYM3812Reset(); - BurnYM2203Reset(); - MSM6295Reset(0); - - i8751RetVal = 0; - DrvVBlank = 0; - DrvSoundLatch = 0; - DrvFlipScreen = 0; - DrvPriority = 0; - memset(DrvTileRamBank, 0, 3); - - RotateReset(); - - HiscoreReset(); - - return 0; -} - -static INT32 BaddudesDoReset() -{ - M6502Open(0); // prevent crash while resetting the sound cores in DrvDoReset(); w/Bird Try - INT32 nRet = DrvDoReset(); - M6502Reset(); - M6502Close(); - - if (realMCU) - DrvMCUReset(); - - return nRet; -} - -static INT32 RobocopDoReset() -{ - INT32 nRet = BaddudesDoReset(); - - h6280Open(0); - h6280Reset(); - h6280Close(); - - return nRet; -} - -static INT32 SlyspyDoReset() -{ - INT32 nRet = DrvDoReset(); - - h6280Open(0); - h6280Reset(); - h6280Close(); - - return nRet; -} - -// I8751 Simulations - -static void BaddudesI8751Write(UINT16 Data) -{ - i8751RetVal = 0; - - switch (Data & 0xffff) { - case 0x714: i8751RetVal = 0x700; break; - case 0x73b: i8751RetVal = 0x701; break; - case 0x72c: i8751RetVal = 0x702; break; - case 0x73f: i8751RetVal = 0x703; break; - case 0x755: i8751RetVal = 0x704; break; - case 0x722: i8751RetVal = 0x705; break; - case 0x72b: i8751RetVal = 0x706; break; - case 0x724: i8751RetVal = 0x707; break; - case 0x728: i8751RetVal = 0x708; break; - case 0x735: i8751RetVal = 0x709; break; - case 0x71d: i8751RetVal = 0x70a; break; - case 0x721: i8751RetVal = 0x70b; break; - case 0x73e: i8751RetVal = 0x70c; break; - case 0x761: i8751RetVal = 0x70d; break; - case 0x753: i8751RetVal = 0x70e; break; - case 0x75b: i8751RetVal = 0x70f; break; - } -} - -static void BirdtryI8751Write(UINT16 Data) -{ - static INT32 pwr, hgt; - - i8751RetVal = 0; - - switch(Data&0xffff) { - /*"Sprite control"*/ - case 0x22a: i8751RetVal = 0x200; break; - - /* Gives an O.B. otherwise (it must be > 0xb0 )*/ - case 0x3c7: i8751RetVal = 0x7ff; break; - - /*Enables shot checks*/ - case 0x33c: i8751RetVal = 0x200; break; - - /*Used on the title screen only(???)*/ - case 0x31e: i8751RetVal = 0x200; break; - -/* 0x100-0x10d values are for club power meters(1W=0x100<<-->>PT=0x10d). * - * Returned value to i8751 doesn't matter,but send the result to 0x481. * - * Lower the value,stronger is the power. */ - case 0x100: pwr = 0x30; break; /*1W*/ - case 0x101: pwr = 0x34; break; /*3W*/ - case 0x102: pwr = 0x38; break; /*4W*/ - case 0x103: pwr = 0x3c; break; /*1I*/ - case 0x104: pwr = 0x40; break; /*3I*/ - case 0x105: pwr = 0x44; break; /*4I*/ - case 0x106: pwr = 0x48; break; /*5I*/ - case 0x107: pwr = 0x4c; break; /*6I*/ - case 0x108: pwr = 0x50; break; /*7I*/ - case 0x109: pwr = 0x54; break; /*8I*/ - case 0x10a: pwr = 0x58; break; /*9I*/ - case 0x10b: pwr = 0x5c; break; /*PW*/ - case 0x10c: pwr = 0x60; break; /*SW*/ - case 0x10d: pwr = 0x80; break; /*PT*/ - case 0x481: i8751RetVal = pwr; break; /*Power meter*/ - -/* 0x200-0x20f values are for shot height(STRONG=0x200<<-->>WEAK=0x20f). * - * Returned value to i8751 doesn't matter,but send the result to 0x534. * - * Higher the value,stronger is the height. */ - case 0x200: hgt = 0x5c0; break; /*H*/ - case 0x201: hgt = 0x580; break; /*|*/ - case 0x202: hgt = 0x540; break; /*|*/ - case 0x203: hgt = 0x500; break; /*|*/ - case 0x204: hgt = 0x4c0; break; /*|*/ - case 0x205: hgt = 0x480; break; /*|*/ - case 0x206: hgt = 0x440; break; /*|*/ - case 0x207: hgt = 0x400; break; /*M*/ - case 0x208: hgt = 0x3c0; break; /*|*/ - case 0x209: hgt = 0x380; break; /*|*/ - case 0x20a: hgt = 0x340; break; /*|*/ - case 0x20b: hgt = 0x300; break; /*|*/ - case 0x20c: hgt = 0x2c0; break; /*|*/ - case 0x20d: hgt = 0x280; break; /*|*/ - case 0x20e: hgt = 0x240; break; /*|*/ - case 0x20f: hgt = 0x200; break; /*L*/ - case 0x534: i8751RetVal = hgt; break; /*Shot height*/ - - /*At the ending screen(???)*/ - //case 0x3b4: i8751_return = 0; break; - - /*These are activated after a shot (???)*/ - case 0x6ca: i8751RetVal = 0xff; break; - case 0x7ff: i8751RetVal = 0x200; break; - //default: logerror("%04x: warning - write unknown command %02x to 8571\n",activecpu_get_pc(),data); - } -} - -// Video write functions - -static void deco_bac06_pf_control_0_w(INT32 Layer, UINT16 *Control0, INT32 Offset, UINT16 Data, UINT16 Mask) -{ - Offset &= 0x03; - - Control0[Offset] &= Mask; - Control0[Offset] += Data; - - if (Offset == 2) { - DrvTileRamBank[Layer] = Control0[Offset] & 0x01; - } -} - -static void deco_bac06_pf_control_1_w(UINT16 *Control1, INT32 Offset, UINT16 Data, UINT16 Mask) -{ - Offset &= 0x07; - - Control1[Offset] &= Mask; - Control1[Offset] += Data; -} - -static UINT16 deco_bac06_pf_data_r(INT32 Layer, UINT16 *RAM, INT32 Offset, UINT16 Mask) -{ - if (DrvTileRamBank[Layer] & 0x01) Offset += 0x1000; - - return RAM[Offset] & Mask; -} - -static void deco_bac06_pf_data_w(INT32 Layer, UINT16 *RAM, INT32 Offset, UINT16 Data, UINT16 Mask) -{ - if (DrvTileRamBank[Layer] & 0x01) Offset += 0x1000; - - RAM[Offset] &= Mask; - RAM[Offset] += Data; -} - -// Rotation-handler code - -static void RotateReset() { - for (INT32 playernum = 0; playernum < 2; playernum++) { - nRotate[playernum] = 0; // start out pointing straight up (0=up) - if (strstr(BurnDrvGetTextA(DRV_NAME), "midres")) - nRotate[0] = nRotate[1] = 2; // start out pointing straight in Midnight Resistance (2=right) - nRotateTarget[playernum] = -1; - nRotateTime[playernum] = 0; - nRotateHoldInput[0] = nRotateHoldInput[1] = 0; - } -} - -static UINT32 RotationTimer(void) { - return nCurrentFrame; -} - -static void RotateRight(INT32 *v) { - (*v)--; - if (*v < 0) *v = 11; -} - -static void RotateLeft(INT32 *v) { - (*v)++; - if (*v > 11) *v = 0; -} - -static UINT8 Joy2Rotate(UINT8 *joy) { // ugly code, but the effect is awesome. -dink - if (joy[0] && joy[2]) return 7; // up left - if (joy[0] && joy[3]) return 1; // up right - - if (joy[1] && joy[2]) return 5; // down left - if (joy[1] && joy[3]) return 3; // down right - - if (joy[0]) return 0; // up - if (joy[1]) return 4; // down - if (joy[2]) return 6; // left - if (joy[3]) return 2; // right - - return 0xff; -} - -static int dialRotation(INT32 playernum) { - // p1 = 0, p2 = 1 - UINT8 player[2] = { 0, 0 }; - static UINT8 lastplayer[2][2] = { { 0, 0 }, { 0, 0 } }; - - if ((playernum != 0) && (playernum != 1)) { - bprintf(PRINT_NORMAL, _T("Strange Rotation address => %06X\n"), playernum); - return 0; - } - if (playernum == 0) { - player[0] = DrvFakeInput[0]; player[1] = DrvFakeInput[1]; - } - if (playernum == 1) { - player[0] = DrvFakeInput[2]; player[1] = DrvFakeInput[3]; - } - - if (player[0] && (player[0] != lastplayer[playernum][0] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateLeft(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Left => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - if (player[1] && (player[1] != lastplayer[playernum][1] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateRight(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Right => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - lastplayer[playernum][0] = player[0]; - lastplayer[playernum][1] = player[1]; - - return ~(1 << nRotate[playernum]); -} - -static UINT8 *rotate_gunpos[2] = {NULL, NULL}; -static UINT8 rotate_gunpos_multiplier = 1; - -// Gun-rotation memory locations - do not remove this tag. - dink :) -// game p1 p2 clockwise value in memory multiplier -// hbarrell 0xff8066 0xff80aa 00 04 08 0c 10 14 18 1c 4 -// midres 0x1021bc 0x102238 SAME - -static void RotateSetGunPosRAM(UINT8 *p1, UINT8 *p2, UINT8 multiplier) { - rotate_gunpos[0] = p1; - rotate_gunpos[1] = p2; - rotate_gunpos_multiplier = multiplier; -} - -static INT32 get_distance(INT32 from, INT32 to) { -// this function finds the easiest way to get from "from" to "to", wrapping at 0 and 7 - INT32 countA = 0; - INT32 countB = 0; - INT32 fromtmp = from / rotate_gunpos_multiplier; - INT32 totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp++; - countA++; - if(fromtmp>7) fromtmp = 0; - if(fromtmp == totmp || countA > 32) break; - } - - fromtmp = from / rotate_gunpos_multiplier; - totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp--; - countB++; - if(fromtmp<0) fromtmp = 7; - if(fromtmp == totmp || countB > 32) break; - } - - if (countA > countB) { - return 1; // go negative - } else { - return 0; // go positive - } -} - -static void RotateDoTick() { - // since the game only allows for 1 rotation every other frame, we have to - // do this. - if (nCurrentFrame&1) return; - - for (INT32 i = 0; i < 2; i++) { - if (rotate_gunpos[i] && (nRotateTarget[i] != -1) && (nRotateTarget[i] != (*rotate_gunpos[i] & 0xff))) { - if (get_distance(nRotateTarget[i], *rotate_gunpos[i] & 0xff)) { - RotateRight(&nRotate[i]); // -- - } else { - RotateLeft(&nRotate[i]); // ++ - } - bprintf(0, _T("p%X target %X mempos %X nRotate %X.\n"), i, nRotateTarget[0], *rotate_gunpos[0] & 0xff, nRotate[0]); - nRotateTry[i]++; - if (nRotateTry[i] > 10) nRotateTarget[i] = -1; // don't get stuck in a loop if something goes horribly wrong here. - } else { - nRotateTarget[i] = -1; - } - } -} - -static void SuperJoy2Rotate() { - for (INT32 i = 0; i < 2; i++) { // p1 = 0, p2 = 1 - if (DrvFakeInput[4 + i]) { // rotate-button had been pressed - UINT8 rot = Joy2Rotate(((!i) ? &DrvInputPort0[0] : &DrvInputPort1[0])); - if (rot != 0xff) { - nRotateTarget[i] = rot * rotate_gunpos_multiplier; - } - //DrvInput[i] &= ~0xf; // cancel out directionals since they are used to rotate here. - DrvInput[i] = (DrvInput[i] & ~0xf) | (nRotateHoldInput[i] & 0xf); // for midnight resistance! be able to duck + change direction of gun. - nRotateTry[i] = 0; - } else { // cache joystick UDLR if the rotate button isn't pressed. - // This feature is for Midnight Resistance, if you are crawling on the - // ground and need to rotate your gun WITHOUT getting up. - nRotateHoldInput[i] = DrvInput[i]; - } - } - - RotateDoTick(); -} - -// end Rotation-handler - -// i8751 MCU, currently only for hbarrel. - -static UINT8 mcu_read_port(INT32 port) -{ - if (!(port >= MCS51_PORT_P0 && port <= MCS51_PORT_P3)) - return 0; - port &= 0x3; - - INT32 latchEnable = i8751PortData[2] >> 4; - - if (port == 0) - { - if ((latchEnable & 1) == 0) - return i8751Command >> 8; - else if ((latchEnable & 2) == 0) - return i8751Command & 0xff; - else if ((latchEnable & 4) == 0) - return i8751RetVal >> 8; - else if ((latchEnable & 8) == 0) - return i8751RetVal & 0xff; - } - - return 0xff; -} - -static void mcu_write_port(INT32 port, UINT8 data) -{ - if (!(port >= MCS51_PORT_P0 && port <= MCS51_PORT_P3)) - return; - - port &= 0x3; - - i8751PortData[port] = data; - - if (port == 2) - { - if ((data & 0x4) == 0) { - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - } - if ((data & 0x8) == 0) - mcs51_set_irq_line(MCS51_INT1_LINE, CPU_IRQSTATUS_NONE); - if ((data & 0x40) == 0) - i8751RetVal = (i8751RetVal & 0xff00) | (i8751PortData[0]); - if ((data & 0x80) == 0) - i8751RetVal = (i8751RetVal & 0xff) | (i8751PortData[0] << 8); - } -} - -static void DrvMCUInit() -{ - mcs51_program_data = DrvMCURom; - mcs51_init (); - mcs51_set_write_handler(mcu_write_port); - mcs51_set_read_handler(mcu_read_port); - - DrvMCUReset(); -} - -static void DrvMCUExit() { - mcs51_exit(); -} - -INT32 DrvMCURun(INT32 cycles) -{ - cycles = mcs51Run(cycles); - - return cycles; -} - -static INT32 DrvMCUScan(INT32 nAction) -{ - mcs51_scan(nAction); - - //SCAN_VAR(i8751RetVal); // in DrvScan (also used by MCU Simulations) - SCAN_VAR(i8751Command); - SCAN_VAR(i8751PortData); - - return 0; -} - -static void DrvMCUSync() -{ - INT32 todo = ((SekTotalCycles() * 8) / 10) - nCyclesDone[2]; - if (todo > 0) nCyclesDone[2] += DrvMCURun(todo); -} - -static void DrvMCUReset() -{ - i8751RetVal = i8751Command = 0; - memset(&i8751PortData, 0, sizeof(i8751PortData)); - mcs51_reset(); -} - -// Normal hardware cpu memory handlers - -static UINT8 __fastcall Dec068KReadByte(UINT32 a) -{ - if (a >= 0x244000 && a <= 0x245fff) { - INT32 Offset = a - 0x244000; - if (DrvTileRamBank[0] & 0x01) Offset += 0x2000; - return DrvCharRam[Offset ^ 1]; - } - - if (a >= 0x24a000 && a <= 0x24a7ff) { - INT32 Offset = a - 0x24a000; - if (DrvTileRamBank[1] & 0x01) Offset += 0x2000; - return DrvVideo1Ram[Offset]; - } - - if (a >= 0x24d000 && a <= 0x24d7ff) { - INT32 Offset = a - 0x24d000; - if (DrvTileRamBank[2] & 0x01) Offset += 0x2000; - return DrvVideo2Ram[Offset]; - } - - if (a >= 0x300000 && a <= 0x30001f) { - dialRotation((a - 0x300000) / 8); - } - - switch (a) { - case 0x30c000: { - return 0xff - DrvInput[1]; - } - - case 0x30c001: { - return 0xff - DrvInput[0]; - } - - case 0x30c003: { - return (0x7f - DrvInput[2]) | ((DrvVBlank) ? 0x80 : 0x00); - } - - case 0x30c004: { - return DrvDip[1]; - } - - case 0x30c005: { - return DrvDip[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Dec068KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x244000 && a <= 0x245fff) { - INT32 Offset = a - 0x244000; - if (DrvTileRamBank[0] & 0x01) Offset += 0x2000; - DrvCharRam[Offset ^ 1] = d; - return; - } - - if (a >= 0x24a000 && a <= 0x24a7ff) { - INT32 Offset = a - 0x24a000; - if (DrvTileRamBank[1] & 0x01) Offset += 0x2000; - DrvVideo1Ram[Offset] = d; - return; - } - - if (a >= 0x24d000 && a <= 0x24d7ff) { - INT32 Offset = a - 0x24d000; - if (DrvTileRamBank[2] & 0x01) Offset += 0x2000; - DrvVideo2Ram[Offset] = d; - return; - } - - switch (a) { - case 0x30c011: { - DrvPriority = d; - return; - } - - case 0x30c015: { - DrvSoundLatch = d; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - } - - case 0x30c01f: { - i8751RetVal = 0; - if (realMCU) - DrvMCUReset(); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -static UINT16 __fastcall Dec068KReadWord(UINT32 a) -{ - if (a >= 0x244000 && a <= 0x245fff) { - UINT16 *RAM = (UINT16*)DrvCharRam; - INT32 Offset = (a - 0x244000) >> 1; - if (DrvTileRamBank[0] & 0x01) Offset += 0x1000; - return BURN_ENDIAN_SWAP_INT16(RAM[Offset]); - } - - if (a >= 0x24a000 && a <= 0x24a7ff) { - UINT16 *RAM = (UINT16*)DrvVideo1Ram; - INT32 Offset = (a - 0x24a000) >> 1; - if (DrvTileRamBank[1] & 0x01) Offset += 0x1000; - return BURN_ENDIAN_SWAP_INT16(RAM[Offset]); - } - - if (a >= 0x24d000 && a <= 0x24d7ff) { - UINT16 *RAM = (UINT16*)DrvVideo2Ram; - INT32 Offset = (a - 0x24d000) >> 1; - if (DrvTileRamBank[2] & 0x01) Offset += 0x1000; - return BURN_ENDIAN_SWAP_INT16(RAM[Offset]); - } - - if (a >= 0x300000 && a <= 0x30001f) { - return dialRotation((a - 0x300000) / 8); - } - - switch (a) { - case 0x30c000: { - return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]); - } - - case 0x30c002: { - return (0xff7f - DrvInput[2]) | ((DrvVBlank) ? 0x80 : 0x00); - } - - case 0x30c004: { - return (DrvDip[1] << 8) | DrvDip[0]; - } - - case 0x30c008: { - if (realMCU) DrvMCUSync(); - return i8751RetVal; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Dec068KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x244000 && a <= 0x245fff) { - UINT16 *RAM = (UINT16*)DrvCharRam; - INT32 Offset = (a - 0x244000) >> 1; - if (DrvTileRamBank[0] & 0x01) Offset += 0x1000; - RAM[Offset] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - if (a >= 0x24a000 && a <= 0x24a7ff) { - UINT16 *RAM = (UINT16*)DrvVideo1Ram; - INT32 Offset = (a - 0x24a000) >> 1; - if (DrvTileRamBank[1] & 0x01) Offset += 0x1000; - RAM[Offset] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - if (a >= 0x24d000 && a <= 0x24d7ff) { - UINT16 *RAM = (UINT16*)DrvVideo2Ram; - INT32 Offset = (a - 0x24d000) >> 1; - if (DrvTileRamBank[2] & 0x01) Offset += 0x1000; - RAM[Offset] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - if (a >= 0x31c000 && a <= 0x31c7ff) { - // ??? - return; - } - - if (a >= 0xffc800 && a <= 0xffc8ff) { - // ??? - return; - } - - switch (a) { - case 0x240000: - case 0x240002: - case 0x240004: - case 0x240006: { - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - Control0[(a - 0x240000) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - if (a == 0x240004) { - DrvTileRamBank[0] = d & 0x01; - if (DrvTileRamBank[0]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 0\n")); - } - return; - } - - case 0x240010: - case 0x240012: - case 0x240014: - case 0x240016: { - UINT16 *Control1 = (UINT16*)DrvCharCtrl1Ram; - Control1[(a - 0x240010) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x246000: - case 0x246002: - case 0x246004: - case 0x246006: { - UINT16 *Control0 = (UINT16*)DrvVideo1Ctrl0Ram; - Control0[(a - 0x246000) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - if (a == 0x246004) { - DrvTileRamBank[1] = d & 0x01; - if (DrvTileRamBank[1]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 1\n")); - } - return; - } - - case 0x246010: - case 0x246012: - case 0x246014: - case 0x246016: { - UINT16 *Control1 = (UINT16*)DrvVideo1Ctrl1Ram; - Control1[(a - 0x246010) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x24c000: - case 0x24c002: - case 0x24c004: - case 0x24c006: { - UINT16 *Control0 = (UINT16*)DrvVideo2Ctrl0Ram; - Control0[(a - 0x24c000) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - if (a == 0x24c004) { - DrvTileRamBank[2] = d & 0x01; - if (DrvTileRamBank[2]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 2\n")); - } - return; - } - - case 0x24c010: - case 0x24c012: - case 0x24c014: - case 0x24c016: { - UINT16 *Control1 = (UINT16*)DrvVideo2Ctrl1Ram; - Control1[(a - 0x24c010) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x30c010: { - DrvPriority = d; - return; - } - - case 0x30c012: { - memcpy(DrvSpriteDMABufferRam, DrvSpriteRam, 0x800); - return; - } - - case 0x30c014: { - DrvSoundLatch = d & 0xff; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - } - - case 0x30c016: { - if (Dec0Game == DEC0_GAME_BADDUDES) BaddudesI8751Write(d); - if (Dec0Game == DEC0_GAME_HBARREL) { - DrvMCUSync(); - i8751Command = d; - mcs51_set_irq_line(MCS51_INT1_LINE, CPU_IRQSTATUS_ACK); - } - if (Dec0Game == DEC0_GAME_BIRDTRY) BirdtryI8751Write(d); - - if (!realMCU) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - return; - } - - case 0x30c018: { - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - return; - } - - case 0x30c01a: { - // NOP - return; - } - - case 0x30c01e: { - if (realMCU) - DrvMCUReset(); - - i8751RetVal = 0; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -static UINT8 Dec0SoundReadByte(UINT16 a) -{ - switch (a) { - case 0x3000: { - return DrvSoundLatch; - } - - case 0x3800: { - return MSM6295ReadStatus(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("M6502 Read Byte %04X\n"), a); - } - } - - return 0; -} - -static void Dec0SoundWriteByte(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x0800: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x0801: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0x1000: { - BurnYM3812Write(0, 0, d); - return; - } - - case 0x1001: { - BurnYM3812Write(0, 1, d); - return; - } - - case 0x3800: { - MSM6295Command(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("M6502 Write Byte %04X, %02X\n"), a, d); - } - } -} - -// Hippodrome hardware cpu memory handlers - -static UINT8 __fastcall HippodrmShared68KReadByte(UINT32 a) -{ - INT32 Offset = (a - 0x180000) >> 1; - return DrvSharedRam[Offset]; -} - -static void __fastcall HippodrmShared68KWriteByte(UINT32 a, UINT8 d) -{ - INT32 Offset = (a - 0x180000) >> 1; - DrvSharedRam[Offset] = d; -} - -static UINT16 __fastcall HippodrmShared68KReadWord(UINT32 a) -{ - INT32 Offset = (a - 0x180000) >> 1; - return DrvSharedRam[Offset]; -} - -static void __fastcall HippodrmShared68KWriteWord(UINT32 a, UINT16 d) -{ - INT32 Offset = (a - 0x180000) >> 1; - DrvSharedRam[Offset] = d & 0xff; -} - -static UINT8 HippodrmH6280ReadProg(UINT32 Address) -{ - if (Address >= 0x1a1000 && Address <= 0x1a17ff) { - INT32 Offset = (Address - 0x1a1000) ^ 1; - if (Offset & 0x01) { - return deco_bac06_pf_data_r(2, (UINT16*)DrvVideo2Ram, Offset >> 1, 0x00ff); - } else { - return deco_bac06_pf_data_r(2, (UINT16*)DrvVideo2Ram, Offset >> 1, 0xff00) >> 8; - } - } - - switch (Address) { - case 0x1ff403: { - return DrvVBlank; - } - } - - bprintf(PRINT_NORMAL, _T("H6280 Read Prog %x\n"), Address); - - return 0; -} - -static void HippodrmH6280WriteProg(UINT32 Address, UINT8 Data) -{ - if (Address >= 0x1a0000 && Address <= 0x1a0007) { - INT32 Offset = Address - 0x1a0000; - if (Offset & 0x01) { - deco_bac06_pf_control_0_w(2, (UINT16*)DrvVideo2Ctrl0Ram, Offset >> 1, Data << 8, 0x00ff); - } else { - deco_bac06_pf_control_0_w(2, (UINT16*)DrvVideo2Ctrl0Ram, Offset >> 1, Data, 0xff00); - } - return; - } - - if (Address >= 0x1a0010 && Address <= 0x1a001f) { - INT32 Offset = (Address - 0x1a0010) ^ 1; - if (Offset < 0x04) { - if (Offset & 0x01) { - deco_bac06_pf_control_1_w((UINT16*)DrvVideo2Ctrl1Ram, Offset >> 1, Data, 0xff00); - } else { - deco_bac06_pf_control_1_w((UINT16*)DrvVideo2Ctrl1Ram, Offset >> 1, Data << 8, 0x00ff); - } - } else { - if (Offset & 0x01) { - deco_bac06_pf_control_1_w((UINT16*)DrvVideo2Ctrl1Ram, Offset >> 1, Data, 0xff00); - } else { - deco_bac06_pf_control_1_w((UINT16*)DrvVideo2Ctrl1Ram, Offset >> 1, Data, 0xff00); - } - } - return; - } - - if (Address >= 0x1a1000 && Address <= 0x1a17ff) { - INT32 Offset = (Address - 0x1a1000) ^ 1; - if (Offset & 0x01) { - deco_bac06_pf_data_w(2, (UINT16*)DrvVideo2Ram, Offset >> 1, Data, 0xff00); - } else { - deco_bac06_pf_data_w(2, (UINT16*)DrvVideo2Ram, Offset >> 1, Data << 8, 0x00ff); - } - return; - - } - - if (Address >= 0x1ff400 && Address <= 0x1ff403) { - h6280_irq_status_w(Address - 0x1ff400, Data); - return; - } - - bprintf(PRINT_NORMAL, _T("H6280 Write Prog %x, %x\n"), Address, Data); -} - -// Robocop hardware cpu memory handlers - -static UINT8 __fastcall RobocopShared68KReadByte(UINT32 a) -{ - INT32 Offset = (a - 0x180000) >> 1; - return DrvSharedRam[Offset]; -} - -static void __fastcall RobocopShared68KWriteByte(UINT32 a, UINT8 d) -{ - INT32 Offset = (a - 0x180000) >> 1; - DrvSharedRam[Offset] = d; - if (Offset == 0x7ff) { - h6280SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } -} - -static UINT16 __fastcall RobocopShared68KReadWord(UINT32 a) -{ - INT32 Offset = (a - 0x180000) >> 1; - return DrvSharedRam[Offset]; -} - -static void __fastcall RobocopShared68KWriteWord(UINT32 a, UINT16 d) -{ - INT32 Offset = (a - 0x180000) >> 1; - DrvSharedRam[Offset] = d & 0xff; - if (Offset == 0x7ff) { - h6280SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } -} - -static UINT8 RobocopH6280ReadProg(UINT32 Address) -{ - bprintf(PRINT_NORMAL, _T("H6280 Read Prog %x\n"), Address); - - return 0; -} - -static void RobocopH6280WriteProg(UINT32 Address, UINT8 Data) -{ - if (Address >= 0x1ff400 && Address <= 0x1ff403) { - h6280_irq_status_w(Address - 0x1ff400, Data); - return; - } - - bprintf(PRINT_NORMAL, _T("H6280 Write Prog %x, %x\n"), Address, Data); -} - -// Sly Spy hardware cpu memory handlers - -static UINT8 __fastcall Slyspy68KReadByte(UINT32 a) -{ - if (a >= 0x31c000 && a <= 0x31c00f) { - INT32 Offset = (a - 0x31c000) >> 1; - - switch (Offset << 1) { - case 0x00: return 0x00; - case 0x02: return 0x13; - case 0x04: return 0x00; - case 0x06: return 0x02; - } - - return 0; - } - - switch (a) { - case 0x314008: { - return DrvDip[1]; - } - - case 0x314009: { - return DrvDip[0]; - } - - case 0x31400a: { - return 0xff - DrvInput[1]; - } - - case 0x31400b: { - return 0xff - DrvInput[0]; - } - - case 0x31400d: { - return (0xf7 - DrvInput[2]) | ((DrvVBlank) ? 0x08 : 0x00); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Slyspy68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x300000: - case 0x300001: - case 0x300002: - case 0x300003: - case 0x300004: - case 0x300005: - case 0x300006: - case 0x300007: { - DrvVideo2Ctrl0Ram[(a - 0x300000) ^ 1] = d; - if (a == 0x300005) { - DrvTileRamBank[2] = d & 0x01; - if (DrvTileRamBank[2]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 2\n")); - } - return; - } - - case 0x300010: - case 0x300011: - case 0x300012: - case 0x300013: - case 0x300014: - case 0x300015: - case 0x300016: - case 0x300017: { - DrvVideo2Ctrl1Ram[(a - 0x300010) ^ 1] = d; - return; - } - - case 0x314001: { - DrvSoundLatch = d; - h6280SetIRQLine(H6280_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - } - - case 0x314003: { - DrvPriority = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -static UINT16 __fastcall Slyspy68KReadWord(UINT32 a) -{ - if (a >= 0x31c000 && a <= 0x31c00f) { - INT32 Offset = (a - 0x31c000) >> 1; - - switch (Offset << 1) { - case 0x00: return 0x00; - case 0x02: return 0x13; - case 0x04: return 0x00; - case 0x06: return 0x02; - } - - return 0; - } - - switch (a) { - case 0x244000: { - DrvSlyspyProtValue++; - DrvSlyspyProtValue = DrvSlyspyProtValue % 4; - SlyspySetProtectionMap(DrvSlyspyProtValue); - return 0; - } - - case 0x314008: { - return (DrvDip[1] << 8) | DrvDip[0]; - } - - case 0x31400a: { - return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]); - } - - case 0x31400c: { - return 0xff00 | ((0xf7 - DrvInput[2]) | ((DrvVBlank) ? 0x08 : 0x00)); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Slyspy68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x31c000 && a <= 0x31c00f) { - // nop - return; - } - - switch (a) { - case 0x24a000: { - DrvSlyspyProtValue = 0; - SlyspySetProtectionMap(DrvSlyspyProtValue); - return; - } - - case 0x300000: - case 0x300002: - case 0x300004: - case 0x300006: { - UINT16 *Control0 = (UINT16*)DrvVideo2Ctrl0Ram; - Control0[(a - 0x300000) >> 1] = d; - if (a == 0x300004) { - DrvTileRamBank[2] = d & 0x01; - if (DrvTileRamBank[2]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 2\n")); - } - return; - } - - case 0x300010: - case 0x300012: - case 0x300014: - case 0x300016: { - UINT16 *Control1 = (UINT16*)DrvVideo2Ctrl1Ram; - Control1[(a - 0x300010) >> 1] = d; - return; - } - - case 0x314000: { - DrvSoundLatch = d & 0xff; - h6280SetIRQLine(H6280_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - } - - case 0x314002: { - DrvPriority = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -static void __fastcall SlyspyProt68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x240000: - case 0x240001: - case 0x240002: - case 0x240003: - case 0x240004: - case 0x240005: - case 0x240006: - case 0x240007: { - DrvVideo1Ctrl0Ram[(a - 0x240000) ^ 1] = d; - if (a == 0x240005) { - DrvTileRamBank[1] = d & 0x01; - if (DrvTileRamBank[1]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 1\n")); - } - return; - } - - case 0x240010: - case 0x240011: - case 0x240012: - case 0x240013: - case 0x240014: - case 0x240015: - case 0x240016: - case 0x240017: { - DrvVideo1Ctrl1Ram[(a - 0x240010) ^ 1] = d; - return; - } - - case 0x248000: - case 0x248001: - case 0x248002: - case 0x248003: - case 0x248004: - case 0x248005: - case 0x248006: - case 0x248007: { - DrvCharCtrl0Ram[(a - 0x248000) ^ 1] = d; - if (a == 0x248005) { - DrvTileRamBank[0] = d & 0x01; - if (DrvTileRamBank[0]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 0\n")); - } - return; - } - - case 0x248010: - case 0x248011: - case 0x248012: - case 0x248013: - case 0x248014: - case 0x248015: - case 0x248016: - case 0x248017: { - DrvCharCtrl1Ram[(a - 0x248010) ^ 1] = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -static void __fastcall SlyspyProt68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x240000: - case 0x240002: - case 0x240004: - case 0x240006: { - UINT16 *Control0 = (UINT16*)DrvVideo1Ctrl0Ram; - Control0[(a - 0x240000) >> 1] = d; - if (a == 0x240004) { - DrvTileRamBank[1] = d & 0x01; - if (DrvTileRamBank[1]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 1\n")); - } - return; - } - - case 0x240010: - case 0x240012: - case 0x240014: - case 0x240016: { - UINT16 *Control1 = (UINT16*)DrvVideo1Ctrl1Ram; - Control1[(a - 0x240010) >> 1] = d; - return; - } - - case 0x244000: { - // ??? - return; - } - - case 0x248000: - case 0x248002: - case 0x248004: - case 0x248006: { - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - Control0[(a - 0x248000) >> 1] = d; - if (a == 0x248004) { - DrvTileRamBank[0] = d & 0x01; - if (DrvTileRamBank[0]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 0\n")); - } - return; - } - - case 0x248010: - case 0x248012: - case 0x248014: - case 0x248016: { - UINT16 *Control1 = (UINT16*)DrvCharCtrl1Ram; - Control1[(a - 0x248010) >> 1] = d; - return; - } - - case 0x248800: { - // ??? - return; - } - - case 0x24a000: { - DrvSlyspyProtValue = 0; - SlyspySetProtectionMap(DrvSlyspyProtValue); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -static void SlyspySetProtectionMap(UINT8 Type) -{ - // I should really set this up to go through handlers, in case a layer's alt RAM bank gets activated, - // so far I've not seen evidence that the game activates the alt RAM banks and this implementation is much - // cleaner and quicker - - SekMapHandler(8, 0x240000, 0x24ffff, MAP_WRITE); - SekSetWriteByteHandler(8, SlyspyProt68KWriteByte); - SekSetWriteWordHandler(8, SlyspyProt68KWriteWord); - - switch (Type) { - case 0: { - SekMapMemory(DrvVideo1ColScrollRam , 0x242000, 0x24207f, MAP_WRITE); - SekMapMemory(DrvVideo1RowScrollRam , 0x242400, 0x2427ff, MAP_WRITE); - SekMapMemory(DrvVideo1Ram , 0x246000, 0x247fff, MAP_WRITE); - SekMapMemory(DrvCharColScrollRam , 0x24c000, 0x24c07f, MAP_WRITE); - SekMapMemory(DrvCharRowScrollRam , 0x24c400, 0x24c7ff, MAP_WRITE); - SekMapMemory(DrvCharRam , 0x24e000, 0x24ffff, MAP_WRITE); - break; - } - - case 1: { - SekMapMemory(DrvCharRam , 0x248000, 0x249fff, MAP_WRITE); - SekMapMemory(DrvVideo1Ram , 0x24c000, 0x24dfff, MAP_WRITE); - break; - } - - case 2: { - SekMapMemory(DrvVideo1Ram , 0x240000, 0x241fff, MAP_WRITE); - SekMapMemory(DrvCharRam , 0x242000, 0x243fff, MAP_WRITE); - SekMapMemory(DrvCharRam , 0x24e000, 0x24ffff, MAP_WRITE); - break; - } - - case 3: { - SekMapMemory(DrvCharRam , 0x240000, 0x241fff, MAP_WRITE); - SekMapMemory(DrvVideo1Ram , 0x248000, 0x249fff, MAP_WRITE); - break; - } - } - -} - -static UINT8 SlyspyH6280ReadProg(UINT32 Address) -{ - switch (Address) { - case 0x0a0000: { - // nop - return 0; - } - - case 0x0e0000: { - return MSM6295ReadStatus(0); - } - - case 0x0f0000: { - return DrvSoundLatch; - } - } - - bprintf(PRINT_NORMAL, _T("H6280 Read Prog %x\n"), Address); - - return 0; -} - -static void SlyspyH6280WriteProg(UINT32 Address, UINT8 Data) -{ - switch (Address) { - case 0x090000: { - BurnYM3812Write(0, 0, Data); - return; - } - - case 0x090001: { - BurnYM3812Write(0, 1, Data); - return; - } - - case 0x0b0000: { - BurnYM2203Write(0, 0, Data); - return; - } - - case 0x0b0001: { - BurnYM2203Write(0, 1, Data); - return; - } - - case 0x0e0000: { - MSM6295Command(0, Data); - return; - } - } - - if (Address >= 0x1ff400 && Address <= 0x1ff403) { - h6280_irq_status_w(Address - 0x1ff400, Data); - return; - } - - bprintf(PRINT_NORMAL, _T("H6280 Write Prog %x, %x\n"), Address, Data); -} - -// Midnight Resistance hardware cpu memory handlers - -static UINT8 __fastcall Midres68KReadByte(UINT32 a) -{ -#if 0 - if (a >= 0x220000 && a <= 0x2207ff) { - INT32 Offset = a - 0x220000; - if (DrvTileRamBank[1] & 0x01) Offset += 0x2000; - return DrvVideo1Ram[Offset ^ 1]; - } - - if (a >= 0x220800 && a <= 0x220fff) { - // mirror - INT32 Offset = a - 0x220800; - if (DrvTileRamBank[1] & 0x01) Offset += 0x2000; - return DrvVideo1Ram[Offset ^ 1]; - } - - if (a >= 0x2a0000 && a <= 0x2a07ff) { - INT32 Offset = a - 0x2a0000; - if (DrvTileRamBank[2] & 0x01) Offset += 0x2000; - return DrvVideo2Ram[Offset ^ 1]; - } - - if (a >= 0x320000 && a <= 0x321fff) { - INT32 Offset = a - 0x320000; - if (DrvTileRamBank[0] & 0x01) Offset += 0x2000; - return DrvCharRam[Offset ^ 1]; - } -#endif - switch (a) { - case 0x180009: { - return (0xf7 - DrvInput[2]) | ((DrvVBlank) ? 0x08 : 0x00); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X PC: %X\n"), a, SekGetPC(-1)); - } - } - - return 0; -} - -static void __fastcall Midres68KWriteByte(UINT32 a, UINT8 d) -{ -#if 0 - if (a >= 0x220000 && a <= 0x2207ff) { - INT32 Offset = a - 0x220000; - if (DrvTileRamBank[1] & 0x01) Offset += 0x2000; - DrvVideo1Ram[Offset ^ 1] = d; - return; - } - - if (a >= 0x220800 && a <= 0x220fff) { - // mirror - INT32 Offset = a - 0x220800; - if (DrvTileRamBank[1] & 0x01) Offset += 0x2000; - DrvVideo1Ram[Offset ^ 1] = d; - return; - } - - if (a >= 0x2a0000 && a <= 0x2a07ff) { - INT32 Offset = a - 0x2a0000; - if (DrvTileRamBank[2] & 0x01) Offset += 0x2000; - DrvVideo2Ram[Offset ^ 1] = d; - return; - } - - if (a >= 0x320000 && a <= 0x321fff) { - INT32 Offset = a - 0x320000; - if (DrvTileRamBank[0] & 0x01) Offset += 0x2000; - DrvCharRam[Offset ^ 1] = d; - return; - } -#endif - switch (a) { - case 0x1a0001: { - DrvSoundLatch = d; - h6280SetIRQLine(H6280_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X PC: %X\n"), a, d, SekGetPC(-1)); - } - } -} - -static UINT16 __fastcall Midres68KReadWord(UINT32 a) -{ -#if 0 - if (a >= 0x220000 && a <= 0x2207ff) { - UINT16 *RAM = (UINT16*)DrvVideo1Ram; - INT32 Offset = (a - 0x220000) >> 1; - if (DrvTileRamBank[1] & 0x01) Offset += 0x1000; - return BURN_ENDIAN_SWAP_INT16(RAM[Offset]); - } - - if (a >= 0x220800 && a <= 0x220fff) { - // mirror - UINT16 *RAM = (UINT16*)DrvVideo1Ram; - INT32 Offset = (a - 0x220800) >> 1; - if (DrvTileRamBank[1] & 0x01) Offset += 0x1000; - return BURN_ENDIAN_SWAP_INT16(RAM[Offset]); - } - - if (a >= 0x2a0000 && a <= 0x2a07ff) { - UINT16 *RAM = (UINT16*)DrvVideo2Ram; - INT32 Offset = (a - 0x2a0000) >> 1; - if (DrvTileRamBank[2] & 0x01) Offset += 0x1000; - return BURN_ENDIAN_SWAP_INT16(RAM[Offset]); - } - - if (a >= 0x320000 && a <= 0x321fff) { - UINT16 *RAM = (UINT16*)DrvCharRam; - INT32 Offset = (a - 0x320000) >> 1; - if (DrvTileRamBank[0] & 0x01) Offset += 0x1000; - return BURN_ENDIAN_SWAP_INT16(RAM[Offset]); - } -#endif - switch (a) { - case 0x180000: { - return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]); - } - - case 0x180002: { - return (DrvDip[1] << 8) | DrvDip[0]; - } - - case 0x180004: { - return dialRotation(0); - } - - case 0x180006: { - return dialRotation(1); - } - - case 0x180008: { - return 0xff00 | ((0xf7 - DrvInput[2]) | ((DrvVBlank) ? 0x08 : 0x00)); - } - - case 0x18000c: { - // watchdog? - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X PC: %X\n"), a, SekGetPC(-1)); - } - } - - return 0; -} - -static void __fastcall Midres68KWriteWord(UINT32 a, UINT16 d) -{ -#if 0 - if (a >= 0x220000 && a <= 0x2207ff) { - UINT16 *RAM = (UINT16*)DrvVideo1Ram; - INT32 Offset = (a - 0x220000) >> 1; - if (DrvTileRamBank[1] & 0x01) Offset += 0x1000; - RAM[Offset] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - if (a >= 0x220800 && a <= 0x220fff) { - // mirror - UINT16 *RAM = (UINT16*)DrvVideo1Ram; - INT32 Offset = (a - 0x220800) >> 1; - if (DrvTileRamBank[1] & 0x01) Offset += 0x1000; - RAM[Offset] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - if (a >= 0x2a0000 && a <= 0x2a07ff) { - UINT16 *RAM = (UINT16*)DrvVideo2Ram; - INT32 Offset = (a - 0x2a0000) >> 1; - if (DrvTileRamBank[2] & 0x01) Offset += 0x1000; - RAM[Offset] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - if (a >= 0x320000 && a <= 0x321fff) { - UINT16 *RAM = (UINT16*)DrvCharRam; - INT32 Offset = (a - 0x320000) >> 1; - if (DrvTileRamBank[0] & 0x01) Offset += 0x1000; - RAM[Offset] = BURN_ENDIAN_SWAP_INT16(d); - return; - } -#endif - switch (a) { - case 0x160000: { - DrvPriority = d; - return; - } - - case 0x18000a: - case 0x18000c: { - // nop? - return; - } - - case 0x1a0000: { // midres ending sequence writes here after the credits, it brings the music volume down quite a bit making the drums quite prominent during hiscore name entry. - DrvSoundLatch = d & 0xff; - h6280SetIRQLine(H6280_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - } - - case 0x200000: - case 0x200002: - case 0x200004: - case 0x200006: { - UINT16 *Control0 = (UINT16*)DrvVideo1Ctrl0Ram; - Control0[(a - 0x200000) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - if (a == 0x200004) { - DrvTileRamBank[1] = d & 0x01; - if (DrvTileRamBank[1]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 1\n")); - } - return; - } - - case 0x200010: - case 0x200012: - case 0x200014: - case 0x200016: { - UINT16 *Control1 = (UINT16*)DrvVideo1Ctrl1Ram; - Control1[(a - 0x200010) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x280000: - case 0x280002: - case 0x280004: - case 0x280006: { - UINT16 *Control0 = (UINT16*)DrvVideo2Ctrl0Ram; - Control0[(a - 0x280000) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - if (a == 0x280004) { - DrvTileRamBank[2] = d & 0x01; - if (DrvTileRamBank[2]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 2\n")); - } - return; - } - - case 0x280010: - case 0x280012: - case 0x280014: - case 0x280016: { - UINT16 *Control1 = (UINT16*)DrvVideo2Ctrl1Ram; - Control1[(a - 0x280010) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x300000: - case 0x300002: - case 0x300004: - case 0x300006: { - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - Control0[(a - 0x300000) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - if (a == 0x300004) { - DrvTileRamBank[0] = d & 0x01; - if (DrvTileRamBank[0]) bprintf(PRINT_IMPORTANT, _T("68K Set Tile RAM Bank 0\n")); - } - return; - } - - case 0x300010: - case 0x300012: - case 0x300014: - case 0x300016: { - UINT16 *Control1 = (UINT16*)DrvCharCtrl1Ram; - Control1[(a - 0x300010) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X PC: %X\n"), a, d, SekGetPC(-1)); - } - } -} - -static UINT8 MidresH6280ReadProg(UINT32 Address) -{ - switch (Address) { - case 0x130000: { - return MSM6295ReadStatus(0); - } - - case 0x138000: { - return DrvSoundLatch; - } - } - - bprintf(PRINT_NORMAL, _T("H6280 Read Prog %x\n"), Address); - - return 0; -} - -static void MidresH6280WriteProg(UINT32 Address, UINT8 Data) -{ - switch (Address) { - case 0x0108000: { - BurnYM3812Write(0, 0, Data); - return; - } - - case 0x108001: { - BurnYM3812Write(0, 1, Data); - return; - } - - case 0x118000: { - BurnYM2203Write(0, 0, Data); - return; - } - - case 0x118001: { - BurnYM2203Write(0, 1, Data); - return; - } - - case 0x130000: { - MSM6295Command(0, Data); - return; - } - } - - if (Address >= 0x1ff400 && Address <= 0x1ff403) { - h6280_irq_status_w(Address - 0x1ff400, Data); - return; - } - - bprintf(PRINT_NORMAL, _T("H6280 Write Prog %x, %x\n"), Address, Data); -} - -static INT32 CharPlaneOffsets[4] = { 0x000000, 0x040000, 0x020000, 0x060000 }; -static INT32 RobocopCharPlaneOffsets[4] = { 0x000000, 0x080000, 0x040000, 0x0c0000 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 Tile1PlaneOffsets[4] = { 0x080000, 0x180000, 0x000000, 0x100000 }; -static INT32 Tile2PlaneOffsets[4] = { 0x040000, 0x0c0000, 0x000000, 0x080000 }; -static INT32 SpritePlaneOffsets[4] = { 0x100000, 0x300000, 0x000000, 0x200000 }; -static INT32 TileXOffsets[16] = { 128, 129, 130, 131, 132, 133, 134, 135, 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 TileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; - -inline static INT32 Dec0YM2203SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)SekTotalCycles() * nSoundRate / 10000000; -} - -inline static double Dec0YM2203GetTime() -{ - return (double)SekTotalCycles() / 10000000; -} - -static void Dec0YM3812IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_ACK); - } else { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_NONE); - } -} - -static INT32 Dec0YM3812SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6502TotalCycles() * nSoundRate / 1500000; -} - -static void Dec1YM3812IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - h6280SetIRQLine(1, CPU_IRQSTATUS_ACK); - } else { - h6280SetIRQLine(1, CPU_IRQSTATUS_NONE); - } -} - -static INT32 Dec1YM3812SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)h6280TotalCycles() * nSoundRate / 2000000; -} - -static INT32 Dec0MachineInit() -{ - INT32 nLen; - - BurnSetRefreshRate(57.41); - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(DrvCharColScrollRam , 0x242000, 0x24207f, MAP_RAM); - SekMapMemory(DrvCharRowScrollRam , 0x242400, 0x2427ff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x4000 , 0x242800, 0x243fff, MAP_RAM); - SekMapMemory(DrvVideo1ColScrollRam , 0x248000, 0x24807f, MAP_RAM); - SekMapMemory(DrvVideo1RowScrollRam , 0x248400, 0x2487ff, MAP_RAM); - SekMapMemory(DrvVideo2ColScrollRam , 0x24c800, 0x24c87f, MAP_RAM); - SekMapMemory(DrvVideo2RowScrollRam , 0x24cc00, 0x24cfff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x310000, 0x3107ff, MAP_RAM); - SekMapMemory(DrvPalette2Ram , 0x314000, 0x3147ff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xff8000, 0xffbfff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0xffc000, 0xffc7ff, MAP_RAM); - SekSetReadByteHandler(0, Dec068KReadByte); - SekSetWriteByteHandler(0, Dec068KWriteByte); - SekSetReadWordHandler(0, Dec068KReadWord); - SekSetWriteWordHandler(0, Dec068KWriteWord); - SekClose(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502Ram , 0x0000, 0x05ff, MAP_RAM); - M6502MapMemory(DrvM6502Rom , 0x8000, 0xffff, MAP_ROM); - M6502SetReadHandler(Dec0SoundReadByte); - M6502SetWriteHandler(Dec0SoundWriteByte); - M6502Close(); - - GenericTilesInit(); - - BurnYM3812Init(1, 3000000, &Dec0YM3812IRQHandler, &Dec0YM3812SynchroniseStream, 1); - BurnTimerAttachM6502YM3812(1500000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 1500000, NULL, Dec0YM2203SynchroniseStream, Dec0YM2203GetTime, 0); - BurnTimerAttachSek(10000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.50, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1023924 / 132, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - return 0; -} - -static INT32 BaddudesInit() -{ - INT32 nRet = 0; - - Dec0MachineInit(); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvM6502Rom, 4, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x20000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 12, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x08000, DrvTempRom + 0x20000, 0x8000); - memcpy(DrvTempRom + 0x00000, DrvTempRom + 0x28000, 0x8000); - memcpy(DrvTempRom + 0x18000, DrvTempRom + 0x30000, 0x8000); - memcpy(DrvTempRom + 0x10000, DrvTempRom + 0x38000, 0x8000); - GfxDecode(0x400, 4, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles2); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 20, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 21, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - Dec0DrawFunction = BaddudesDraw; - Dec0Game = DEC0_GAME_BADDUDES; - - BaddudesDoReset(); - - return 0; -} - -static INT32 BirdtryInit() -{ - INT32 nRet = 0; - - Dec0MachineInit(); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 5, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvM6502Rom, 6, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 9, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 17, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 25, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 26, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - Dec0DrawFunction = BirdtryDraw; - Dec0Game = DEC0_GAME_BIRDTRY; - - BaddudesDoReset(); - - return 0; - -} - -static INT32 Drgninjab2Init() -{ - INT32 nRet = 0; - - Dec0MachineInit(); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvM6502Rom, 4, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x08000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles2); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 22, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 23, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - Dec0DrawFunction = BaddudesDraw; - Dec0Game = DEC0_GAME_BADDUDES; - - BaddudesDoReset(); - - return 0; -} - -static INT32 HbarrelInit() -{ - INT32 nRet = 0; - - Dec0MachineInit(); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 5, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvM6502Rom, 6, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, RobocopCharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 16, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 20, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles2); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 28, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 29, 1); if (nRet != 0) return 1; - - realMCU = 1; - nRet = BurnLoadRom(DrvMCURom + 0x00000, 30, 1); if (nRet != 0) return 1; - DrvMCUInit(); - - BurnTimerAttachNull(10000000); // YM2203 timer, not attached to Sek - bTimerNullCPU = 1; - - BurnFree(DrvTempRom); - - Dec0DrawFunction = HbarrelDraw; - Dec0Game = DEC0_GAME_HBARREL; - - RotateSetGunPosRAM(Drv68KRam + (0x66+1), Drv68KRam + (0xaa+1), 4); - game_rotates = 1; - - BaddudesDoReset(); - - return 0; -} - -static INT32 HippodrmInit() -{ - INT32 nRet = 0; - - Dec0MachineInit(); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvM6502Rom, 4, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvH6280Rom, 5, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, RobocopCharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 11, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 15, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles2); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 23, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 24, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - for (INT32 i = 0x00000; i < 0x10000; i++) { - DrvH6280Rom[i] = (DrvH6280Rom[i] & 0x7e) | ((DrvH6280Rom[i] & 0x1) << 7) | ((DrvH6280Rom[i] & 0x80) >> 7); - } - DrvH6280Rom[0x189] = 0x60; - DrvH6280Rom[0x1af] = 0x60; - DrvH6280Rom[0x1db] = 0x60; - DrvH6280Rom[0x21a] = 0x60; - - Dec0DrawFunction = HippodrmDraw; - - SekOpen(0); - SekMapHandler(1, 0x180000, 0x180fff, MAP_RAM); - SekSetReadByteHandler(1, HippodrmShared68KReadByte); - SekSetWriteByteHandler(1, HippodrmShared68KWriteByte); - SekSetReadWordHandler(1, HippodrmShared68KReadWord); - SekSetWriteWordHandler(1, HippodrmShared68KWriteWord); - SekClose(); - - h6280Init(0); - h6280Open(0); - h6280MapMemory(DrvH6280Rom , 0x000000, 0x00ffff, MAP_ROM); - h6280MapMemory(DrvSharedRam, 0x180000, 0x1800ff, MAP_RAM); - h6280MapMemory(DrvH6280Ram , 0x1f0000, 0x1f1fff, MAP_RAM); - h6280SetReadHandler(HippodrmH6280ReadProg); - h6280SetWriteHandler(HippodrmH6280WriteProg); - h6280Close(); - - RobocopDoReset(); - - return 0; -} - -static INT32 RobocopInit() -{ - INT32 nRet = 0; - - Dec0MachineInit(); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvM6502Rom, 4, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvH6280Rom + 0x01e00, 5, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, RobocopCharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 11, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 15, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles2); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 23, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 24, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - Dec0DrawFunction = RobocopDraw; - - SekOpen(0); - SekMapHandler(1, 0x180000, 0x180fff, MAP_RAM); - SekSetReadByteHandler(1, RobocopShared68KReadByte); - SekSetWriteByteHandler(1, RobocopShared68KWriteByte); - SekSetReadWordHandler(1, RobocopShared68KReadWord); - SekSetWriteWordHandler(1, RobocopShared68KWriteWord); - SekClose(); - - h6280Init(0); - h6280Open(0); - h6280MapMemory(DrvH6280Rom , 0x000000, 0x00ffff, MAP_ROM); - h6280MapMemory(DrvH6280Ram , 0x1f0000, 0x1f1fff, MAP_RAM); - h6280MapMemory(DrvSharedRam, 0x1f2000, 0x1f3fff, MAP_RAM); - h6280SetReadHandler(RobocopH6280ReadProg); - h6280SetWriteHandler(RobocopH6280WriteProg); - h6280Close(); - - RobocopDoReset(); - - return 0; -} - -static INT32 RobocopbInit() -{ - INT32 nRet = 0; - - Dec0MachineInit(); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvM6502Rom, 4, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, RobocopCharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 14, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles2); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 22, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 23, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - Dec0DrawFunction = RobocopDraw; - - BaddudesDoReset(); - - return 0; -} - -static INT32 SlyspyDrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(57.41); - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - if (LoadRomsFunction()) return 1; - - for (INT32 i = 0x00000; i < 0x10000; i++) { - DrvH6280Rom[i] = (DrvH6280Rom[i] & 0x7e) | ((DrvH6280Rom[i] & 0x1) << 7) | ((DrvH6280Rom[i] & 0x80) >> 7); - } - DrvH6280Rom[0xf2d] = 0xea; - DrvH6280Rom[0xf2e] = 0xea; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(DrvVideo2ColScrollRam , 0x300800, 0x30087f, MAP_RAM); - SekMapMemory(DrvVideo2RowScrollRam , 0x300c00, 0x300fff, MAP_RAM); - SekMapMemory(DrvVideo2Ram , 0x301000, 0x3017ff, MAP_RAM); - SekMapMemory(Drv68KRam , 0x304000, 0x307fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x308000, 0x3087ff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x310000, 0x3107ff, MAP_RAM); - SekSetReadByteHandler(0, Slyspy68KReadByte); - SekSetWriteByteHandler(0, Slyspy68KWriteByte); - SekSetReadWordHandler(0, Slyspy68KReadWord); - SekSetWriteWordHandler(0, Slyspy68KWriteWord); - SekClose(); - - h6280Init(0); - h6280Open(0); - h6280MapMemory(DrvH6280Rom , 0x000000, 0x00ffff, MAP_ROM); - h6280MapMemory(DrvH6280Ram , 0x1f0000, 0x1f1fff, MAP_RAM); - h6280SetReadHandler(SlyspyH6280ReadProg); - h6280SetWriteHandler(SlyspyH6280WriteProg); - h6280Close(); - - GenericTilesInit(); - - BurnYM3812Init(1, 3000000, &Dec1YM3812IRQHandler, &Dec1YM3812SynchroniseStream, 1); - BurnTimerAttachH6280YM3812(2000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 1500000, NULL, Dec0YM2203SynchroniseStream, Dec0YM2203GetTime, 0); - BurnTimerAttachSek(10000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.90, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.90, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.90, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - Dec0DrawFunction = SlyspyDraw; - DrvSpriteDMABufferRam = DrvSpriteRam; - - SlyspyDoReset(); - - return 0; -} - -static INT32 SlyspyLoadRoms() -{ - INT32 nRet; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvH6280Rom, 4, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x10000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 6, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x4000, DrvTempRom + 0x10000, 0x4000); - memcpy(DrvTempRom + 0x0000, DrvTempRom + 0x14000, 0x4000); - memcpy(DrvTempRom + 0xc000, DrvTempRom + 0x18000, 0x4000); - memcpy(DrvTempRom + 0x8000, DrvTempRom + 0x1c000, 0x4000); - GfxDecode(0x800, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles2); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 14, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 15, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 SlyspyInit() -{ - LoadRomsFunction = SlyspyLoadRoms; - - return SlyspyDrvInit(); -} - -static INT32 BouldashLoadRoms() -{ - INT32 nRet; - - DrvTempRom = (UINT8 *)BurnMalloc(0x40000); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 5, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvH6280Rom, 6, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x20000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 8, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x08000, DrvTempRom + 0x20000, 0x8000); - memcpy(DrvTempRom + 0x00000, DrvTempRom + 0x28000, 0x8000); - memcpy(DrvTempRom + 0x18000, DrvTempRom + 0x30000, 0x8000); - memcpy(DrvTempRom + 0x10000, DrvTempRom + 0x38000, 0x8000); - GfxDecode(0x1000, 4, 8, 8, RobocopCharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles2); - - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 16, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 17, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 BouldashInit() -{ - LoadRomsFunction = BouldashLoadRoms; - - return SlyspyDrvInit(); -} - -static INT32 MidresInit() -{ - INT32 nRet = 0, nLen; - - BurnSetRefreshRate(57.41); - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvH6280Rom, 4, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x20000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 6, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x08000, DrvTempRom + 0x20000, 0x8000); - memcpy(DrvTempRom + 0x00000, DrvTempRom + 0x28000, 0x8000); - memcpy(DrvTempRom + 0x18000, DrvTempRom + 0x30000, 0x8000); - memcpy(DrvTempRom + 0x10000, DrvTempRom + 0x38000, 0x8000); - GfxDecode(0x1000, 4, 8, 8, RobocopCharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles1); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles2); - - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 16, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 17, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(DrvVideo1ColScrollRam , 0x240000, 0x2400ff, MAP_RAM); - SekMapMemory(DrvVideo1RowScrollRam , 0x240400, 0x2407ff, MAP_RAM); - SekMapMemory(DrvVideo2ColScrollRam , 0x2c0000, 0x2c00ff, MAP_RAM); - SekMapMemory(DrvVideo2RowScrollRam , 0x2c0400, 0x2c07ff, MAP_RAM); - SekMapMemory(DrvCharColScrollRam , 0x340000, 0x3400ff, MAP_RAM); - SekMapMemory(DrvCharRowScrollRam , 0x340400, 0x3407ff, MAP_RAM); - // moved from Midres68KRead/WriteByte/Word - SekMapMemory(DrvVideo1Ram , 0x220000, 0x2207ff, MAP_RAM); - SekMapMemory(DrvVideo1Ram , 0x220800, 0x220fff, MAP_RAM); // mirror - SekMapMemory(DrvVideo2Ram , 0x2a0000, 0x2a07ff, MAP_RAM); - SekMapMemory(DrvCharRam , 0x320000, 0x321fff, MAP_RAM); - // - SekSetReadByteHandler(0, Midres68KReadByte); - SekSetWriteByteHandler(0, Midres68KWriteByte); - SekSetReadWordHandler(0, Midres68KReadWord); - SekSetWriteWordHandler(0, Midres68KWriteWord); - SekClose(); - - h6280Init(0); - h6280Open(0); - h6280MapMemory(DrvH6280Rom , 0x000000, 0x00ffff, MAP_ROM); - h6280MapMemory(DrvH6280Ram , 0x1f0000, 0x1f1fff, MAP_RAM); - h6280SetReadHandler(MidresH6280ReadProg); - h6280SetWriteHandler(MidresH6280WriteProg); - h6280Close(); - - GenericTilesInit(); - - BurnYM3812Init(1, 3000000, &Dec1YM3812IRQHandler, &Dec1YM3812SynchroniseStream, 1); - BurnTimerAttachH6280YM3812(2000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 1500000, NULL, Dec0YM2203SynchroniseStream, Dec0YM2203GetTime, 0); - BurnTimerAttachSek(10000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.75, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.75, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.75, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 1.80, BURN_SND_ROUTE_BOTH); - - Dec0DrawFunction = MidresDraw; - DrvSpriteDMABufferRam = DrvSpriteRam; - - DrvCharPalOffset = 256; - DrvSpritePalOffset = 0; - - RotateSetGunPosRAM(Drv68KRam + (0x21bc+1), Drv68KRam + (0x2238+1), 4); - game_rotates = 1; - - Dec0Game = DEC1_GAME_MIDRES; - - SlyspyDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - - BurnYM2203Exit(); - BurnYM3812Exit(); - MSM6295Exit(0); - - if (realMCU) - DrvMCUExit(); - - GenericTilesExit(); - - i8751RetVal = 0; - DrvVBlank = 0; - DrvSoundLatch = 0; - DrvFlipScreen = 0; - DrvPriority = 0; - - DrvCharTilemapWidth = 0; - DrvCharTilemapHeight = 0; - DrvTile1TilemapWidth = 0; - DrvTile1TilemapHeight = 0; - DrvTile2TilemapWidth = 0; - DrvTile2TilemapHeight = 0; - memset(DrvTileRamBank, 0, 3); - DrvSlyspyProtValue = 0; - - Dec0DrawFunction = NULL; - LoadRomsFunction = NULL; - - Dec0Game = 0; - - DrvCharPalOffset = 0; - DrvSpritePalOffset = 256; - - game_rotates = 0; - realMCU = 0; - - bTimerNullCPU = 0; - - BurnFree(Mem); - - return 0; -} - -static INT32 BaddudesExit() -{ - M6502Exit(); - return DrvExit(); -} - -static INT32 RobocopExit() -{ - h6280Exit(); - return BaddudesExit(); -} - -static INT32 SlyspyExit() -{ - h6280Exit(); - return DrvExit(); -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -static void DrvCalcPalette() -{ - UINT16 *PaletteRam = (UINT16*)DrvPaletteRam; - UINT16 *Palette2Ram = (UINT16*)DrvPalette2Ram; - - INT32 r, g, b; - - for (INT32 i = 0; i < 0x400; i++) { - r = (BURN_ENDIAN_SWAP_INT16(PaletteRam[i]) >> 0) & 0xff; - g = (BURN_ENDIAN_SWAP_INT16(PaletteRam[i]) >> 8) & 0xff; - b = (BURN_ENDIAN_SWAP_INT16(Palette2Ram[i]) >> 0) & 0xff; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void Dec1CalcPalette() -{ - UINT16 *PaletteRam = (UINT16*)DrvPaletteRam; - - INT32 r, g, b; - - for (INT32 i = 0; i < 0x400; i++) { - r = pal4bit(BURN_ENDIAN_SWAP_INT16(PaletteRam[i]) >> 0); - g = pal4bit(BURN_ENDIAN_SWAP_INT16(PaletteRam[i]) >> 4); - b = pal4bit(BURN_ENDIAN_SWAP_INT16(PaletteRam[i]) >> 8); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -#define PLOTPIXEL(x, po) pPixel[x] = nPalette | pTileData[x] | po; -#define PLOTPIXEL_FLIPX(x, a, po) pPixel[x] = nPalette | pTileData[a] | po; -#define PLOTPIXEL_MASK(x, mc, po) if (pTileData[x] != mc) {pPixel[x] = nPalette | pTileData[x] | po;} -#define PLOTPIXEL_MASK_FLIPX(x, a, mc, po) if (pTileData[a] != mc) {pPixel[x] = nPalette | pTileData[a] | po;} -#define CLIPPIXEL(x, sx, mx, a) if ((sx + x) >= 0 && (sx + x) < mx) { a; }; - -static void Dec0Render8x8Tile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile, INT32 TilemapWidth) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * TilemapWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += TilemapWidth, pTileData += 8) { - PLOTPIXEL_MASK( 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 7, nMaskColour, nPaletteOffset); - } -} - -static void Dec0Render8x8Tile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile, INT32 TilemapWidth) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * TilemapWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= TilemapWidth, pTileData += 8) { - PLOTPIXEL_MASK_FLIPX(7, 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(6, 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(5, 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(4, 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(3, 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(2, 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(1, 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(0, 7, nMaskColour, nPaletteOffset); - } -} - -static void Dec0Render16x16Tile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile, INT32 TilemapWidth) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * TilemapWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += TilemapWidth, pTileData += 16) { - PLOTPIXEL( 0, nPaletteOffset); - PLOTPIXEL( 1, nPaletteOffset); - PLOTPIXEL( 2, nPaletteOffset); - PLOTPIXEL( 3, nPaletteOffset); - PLOTPIXEL( 4, nPaletteOffset); - PLOTPIXEL( 5, nPaletteOffset); - PLOTPIXEL( 6, nPaletteOffset); - PLOTPIXEL( 7, nPaletteOffset); - PLOTPIXEL( 8, nPaletteOffset); - PLOTPIXEL( 9, nPaletteOffset); - PLOTPIXEL(10, nPaletteOffset); - PLOTPIXEL(11, nPaletteOffset); - PLOTPIXEL(12, nPaletteOffset); - PLOTPIXEL(13, nPaletteOffset); - PLOTPIXEL(14, nPaletteOffset); - PLOTPIXEL(15, nPaletteOffset); - } -} - -static void Dec0Render16x16Tile_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile, INT32 TilemapWidth) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * TilemapWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= TilemapWidth, pTileData += 16) { - PLOTPIXEL_FLIPX(15, 0, nPaletteOffset); - PLOTPIXEL_FLIPX(14, 1, nPaletteOffset); - PLOTPIXEL_FLIPX(13, 2, nPaletteOffset); - PLOTPIXEL_FLIPX(12, 3, nPaletteOffset); - PLOTPIXEL_FLIPX(11, 4, nPaletteOffset); - PLOTPIXEL_FLIPX(10, 5, nPaletteOffset); - PLOTPIXEL_FLIPX( 9, 6, nPaletteOffset); - PLOTPIXEL_FLIPX( 8, 7, nPaletteOffset); - PLOTPIXEL_FLIPX( 7, 8, nPaletteOffset); - PLOTPIXEL_FLIPX( 6, 9, nPaletteOffset); - PLOTPIXEL_FLIPX( 5, 10, nPaletteOffset); - PLOTPIXEL_FLIPX( 4, 11, nPaletteOffset); - PLOTPIXEL_FLIPX( 3, 12, nPaletteOffset); - PLOTPIXEL_FLIPX( 2, 13, nPaletteOffset); - PLOTPIXEL_FLIPX( 1, 14, nPaletteOffset); - PLOTPIXEL_FLIPX( 0, 15, nPaletteOffset); - } -} - -static void Dec0Render16x16Tile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile, INT32 TilemapWidth) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * TilemapWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += TilemapWidth, pTileData += 16) { - PLOTPIXEL_MASK( 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 7, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 8, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 9, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(10, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(11, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(12, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(13, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(14, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(15, nMaskColour, nPaletteOffset); - } -} - -static void Dec0Render16x16Tile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile, INT32 TilemapWidth) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * TilemapWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= TilemapWidth, pTileData += 16) { - PLOTPIXEL_MASK_FLIPX(15, 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(14, 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(13, 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(12, 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(11, 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(10, 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 9, 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 8, 7, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 7, 8, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 6, 9, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 5, 10, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 4, 11, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 3, 12, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 2, 13, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 1, 14, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 0, 15, nMaskColour, nPaletteOffset); - } -} - -#undef PLOTPIXEL -#undef PLOTPIXEL_FLIPX -#undef PLOTPIXEL_MASK -#undef CLIPPIXEL - -#define TILEMAP_BOTH_LAYERS 2 -#define TILEMAP_LAYER0 1 -#define TILEMAP_LAYER1 0 - -static void DrvRenderCustomTilemap(UINT16 *pSrc, UINT16 *pControl0, UINT16 *pControl1, UINT16 *RowScrollRam, UINT16 *ColScrollRam, INT32 TilemapWidth, INT32 TilemapHeight, INT32 Opaque, INT32 DrawLayer) -{ - INT32 x, y, xSrc, ySrc, ColOffset = 0, pPixel; - UINT32 xScroll = BURN_ENDIAN_SWAP_INT16(pControl1[0]); - UINT32 yScroll = BURN_ENDIAN_SWAP_INT16(pControl1[1]); - INT32 WidthMask = TilemapWidth - 1; - INT32 HeightMask = TilemapHeight - 1; - INT32 RowScrollEnabled = BURN_ENDIAN_SWAP_INT16(pControl0[0]) & 0x04; - INT32 ColScrollEnabled = BURN_ENDIAN_SWAP_INT16(pControl0[0]) & 0x08; - - ySrc = yScroll; - - ySrc += 8; - - for (y = 0; y < nScreenHeight; y++) { - if (RowScrollEnabled) { - xSrc = xScroll + BURN_ENDIAN_SWAP_INT16(RowScrollRam[(ySrc >> (BURN_ENDIAN_SWAP_INT16(pControl1[3]) & 0x0f)) & (0x1ff >> (BURN_ENDIAN_SWAP_INT16(pControl1[3]) & 0x0f))]); - } else { - xSrc = xScroll; - } - - xSrc &= WidthMask; - - if (DrvFlipScreen) xSrc = -xSrc; - - for (x = 0; x < nScreenWidth; x++) { - if (ColScrollEnabled) ColOffset = BURN_ENDIAN_SWAP_INT16(ColScrollRam[((xSrc >> 3) >> (BURN_ENDIAN_SWAP_INT16(pControl1[2]) & 0x0f)) & (0x3f >> (BURN_ENDIAN_SWAP_INT16(pControl1[2]) & 0x0f))]); - - pPixel = pSrc[(((ySrc + ColOffset) & HeightMask) * TilemapWidth) + (xSrc & WidthMask)]; - - xSrc++; - - if (Opaque || (pPixel & 0x0f)) { - if (DrawLayer == TILEMAP_LAYER0) { - if ((pPixel & 0x88) == 0x88) pTransDraw[(y * nScreenWidth) + x] = pPixel; - } else { - pTransDraw[(y * nScreenWidth) + x] = pPixel; - } - } - } - - ySrc++; - } -} - -static void DrvRenderTile1Layer(INT32 Opaque, INT32 DrawLayer) -{ - INT32 mx, my, Code, Attr, Colour, x, y, TileIndex, Layer; - UINT16 *Control0 = (UINT16*)DrvVideo1Ctrl0Ram; - UINT16 *VideoRam = (UINT16*)DrvVideo1Ram; - - INT32 RenderType = BURN_ENDIAN_SWAP_INT16(Control0[3]) & 0x03; - - switch (RenderType) { - case 0x00: { - DrvTile1TilemapWidth = 1024; - DrvTile1TilemapHeight = 256; - break; - } - - case 0x01: { - DrvTile1TilemapWidth = 512; - DrvTile1TilemapHeight = 512; - break; - } - - case 0x02: { - DrvTile1TilemapWidth = 256; - DrvTile1TilemapHeight = 1024; - break; - } - } - - memset(pTile1LayerDraw, 0, DrvTile1TilemapWidth * DrvTile1TilemapHeight * sizeof(UINT16)); - - for (my = 0; my < (DrvTile1TilemapHeight / 16); my++) { - for (mx = 0; mx < (DrvTile1TilemapWidth / 16); mx++) { - TileIndex = (mx & 0x0f) + ((my & 0x0f) << 4) + ((mx & 0x30) << 4); - if (RenderType == 1) TileIndex = (mx & 0x0f) + ((my & 0x0f) << 4) + ((my & 0x10) << 4) + ((mx & 0x10) << 5); - if (RenderType == 2) TileIndex = (mx & 0x0f) + ((my & 0x3f) << 4); - if (DrvTileRamBank[1] & 0x01) TileIndex += 0x1000; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Code = Attr & 0xfff; - Colour = Attr >> 12; - Layer = (Attr >> 12) > 7; - - if (DrawLayer == TILEMAP_BOTH_LAYERS || DrawLayer == Layer) { - x = 16 * mx; - y = 16 * my; - - if (Opaque) { - if (DrvFlipScreen) { - x = 240 - x; - y = 240 - y; - x &= (DrvTile1TilemapWidth - 1); - y &= (DrvTile1TilemapHeight - 1); - Dec0Render16x16Tile_FlipXY(pTile1LayerDraw, Code, x, y, Colour, 4, 512, DrvTiles1, DrvTile1TilemapWidth); - } else { - Dec0Render16x16Tile(pTile1LayerDraw, Code, x, y, Colour, 4, 512, DrvTiles1, DrvTile1TilemapWidth); - } - } else { - if (DrvFlipScreen) { - x = 240 - x; - y = 240 - y; - x &= (DrvTile1TilemapWidth - 1); - y &= (DrvTile1TilemapHeight - 1); - Dec0Render16x16Tile_Mask_FlipXY(pTile1LayerDraw, Code, x, y, Colour, 4, 0, 512, DrvTiles1, DrvTile1TilemapWidth); - } else { - Dec0Render16x16Tile_Mask(pTile1LayerDraw, Code, x, y, Colour, 4, 0, 512, DrvTiles1, DrvTile1TilemapWidth); - } - } - } - } - } - - DrvRenderCustomTilemap(pTile1LayerDraw, (UINT16*)DrvVideo1Ctrl0Ram, (UINT16*)DrvVideo1Ctrl1Ram, (UINT16*)DrvVideo1RowScrollRam, (UINT16*)DrvVideo1ColScrollRam, DrvTile1TilemapWidth, DrvTile1TilemapHeight, Opaque, DrawLayer); -} - -static void DrvRenderTile2Layer(INT32 Opaque, INT32 DrawLayer) -{ - INT32 mx, my, Code, Attr, Colour, x, y, TileIndex, Layer; - UINT16 *Control0 = (UINT16*)DrvVideo2Ctrl0Ram; - UINT16 *VideoRam = (UINT16*)DrvVideo2Ram; - - INT32 RenderType = BURN_ENDIAN_SWAP_INT16(Control0[3]) & 0x03; - - switch (RenderType) { - case 0x00: { - DrvTile2TilemapWidth = 1024; - DrvTile2TilemapHeight = 256; - break; - } - - case 0x01: { - DrvTile2TilemapWidth = 512; - DrvTile2TilemapHeight = 512; - break; - } - - case 0x02: { - DrvTile2TilemapWidth = 256; - DrvTile2TilemapHeight = 1024; - break; - } - } - - memset(pTile2LayerDraw, 0, DrvTile2TilemapWidth * DrvTile2TilemapHeight * sizeof(UINT16)); - - for (my = 0; my < (DrvTile2TilemapHeight / 16); my++) { - for (mx = 0; mx < (DrvTile2TilemapWidth / 16); mx++) { - TileIndex = (mx & 0x0f) + ((my & 0x0f) << 4) + ((mx & 0x30) << 4); - if (RenderType == 1) TileIndex = (mx & 0x0f) + ((my & 0x0f) << 4) + ((my & 0x10) << 4) + ((mx & 0x10) << 5); - if (RenderType == 2) TileIndex = (mx & 0x0f) + ((my & 0x3f) << 4); - if (DrvTileRamBank[2] & 0x01) TileIndex += 0x1000; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Code = Attr & 0xfff; - Colour = Attr >> 12; - Layer = (Attr >> 12) > 7; - - if (DrawLayer == TILEMAP_BOTH_LAYERS || DrawLayer == Layer) { - x = 16 * mx; - y = 16 * my; - - if (Opaque) { - if (DrvFlipScreen) { - x = 240 - x; - y = 240 - y; - x &= (DrvTile2TilemapWidth - 1); - y &= (DrvTile2TilemapHeight - 1); - Dec0Render16x16Tile_FlipXY(pTile2LayerDraw, Code, x, y, Colour, 4, 768, DrvTiles2, DrvTile2TilemapWidth); - } else { - Dec0Render16x16Tile(pTile2LayerDraw, Code, x, y, Colour, 4, 768, DrvTiles2, DrvTile2TilemapWidth); - } - } else { - if (DrvFlipScreen) { - x = 240 - x; - y = 240 - y; - x &= (DrvTile2TilemapWidth - 1); - y &= (DrvTile2TilemapHeight - 1); - Dec0Render16x16Tile_Mask_FlipXY(pTile2LayerDraw, Code, x, y, Colour, 4, 0, 768, DrvTiles2, DrvTile2TilemapWidth); - } else { - Dec0Render16x16Tile_Mask(pTile2LayerDraw, Code, x, y, Colour, 4, 0, 768, DrvTiles2, DrvTile2TilemapWidth); - } - } - } - } - } - - DrvRenderCustomTilemap(pTile2LayerDraw, (UINT16*)DrvVideo2Ctrl0Ram, (UINT16*)DrvVideo2Ctrl1Ram, (UINT16*)DrvVideo2RowScrollRam, (UINT16*)DrvVideo2ColScrollRam, DrvTile2TilemapWidth, DrvTile2TilemapHeight, Opaque, DrawLayer); -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Code, Attr, Colour, x, y, TileIndex; - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - UINT16 *CharRam = (UINT16*)DrvCharRam; - - INT32 RenderType = BURN_ENDIAN_SWAP_INT16(Control0[3]) & 0x03; - - switch (RenderType) { - case 0x00: { - DrvCharTilemapWidth = 1024; - DrvCharTilemapHeight = 256; - break; - } - - case 0x01: { - DrvCharTilemapWidth = 512; - DrvCharTilemapHeight = 512; - break; - } - - case 0x02: { - DrvCharTilemapWidth = 256; - DrvCharTilemapHeight = 1024; - break; - } - } - - memset(pCharLayerDraw, 0, DrvCharTilemapWidth * DrvCharTilemapHeight * sizeof(UINT16)); - - for (my = 0; my < (DrvCharTilemapHeight / 8); my++) { - for (mx = 0; mx < (DrvCharTilemapWidth / 8); mx++) { - TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5); - if (RenderType == 1) TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((my & 0x20) << 5) + ((mx & 0x20) << 6); - if (RenderType == 2) TileIndex = (mx & 0x1f) + ((my & 0x7f) << 5); - if (DrvTileRamBank[0] & 0x01) TileIndex += 0x1000; - - Attr = BURN_ENDIAN_SWAP_INT16(CharRam[TileIndex]); - Code = Attr & 0xfff; - Colour = Attr >> 12; - - x = 8 * mx; - y = 8 * my; - - if (DrvFlipScreen) { - x = 248 - x; - y = 248 - y; - x &= (DrvCharTilemapWidth - 1); - y &= (DrvCharTilemapHeight - 1); - Dec0Render8x8Tile_Mask_FlipXY(pCharLayerDraw, Code, x, y, Colour, 4, 0, DrvCharPalOffset, DrvChars, DrvCharTilemapWidth); - } else { - Dec0Render8x8Tile_Mask(pCharLayerDraw, Code, x, y, Colour, 4, 0, DrvCharPalOffset, DrvChars, DrvCharTilemapWidth); - } - } - } - - DrvRenderCustomTilemap(pCharLayerDraw, (UINT16*)DrvCharCtrl0Ram, (UINT16*)DrvCharCtrl1Ram, (UINT16*)DrvCharRowScrollRam, (UINT16*)DrvCharColScrollRam, DrvCharTilemapWidth, DrvCharTilemapHeight, 0, TILEMAP_BOTH_LAYERS); -} - -static void DrvRenderSprites(INT32 PriorityMask, INT32 PriorityVal) -{ - UINT16 *SpriteRam = (UINT16*)DrvSpriteDMABufferRam; - - INT32 offs = 0; - - while (offs < 0x800 / 2) - { - INT32 sy = BURN_ENDIAN_SWAP_INT16(SpriteRam[offs]); - INT32 sx = BURN_ENDIAN_SWAP_INT16(SpriteRam[offs + 2]); - INT32 color = sx >> 12; - INT32 incy; - INT32 mult; - INT32 flash = sx & 0x0800; - - INT32 flipx = sy & 0x2000; - INT32 flipy = sy & 0x4000; - INT32 h = (1 << ((sy & 0x1800) >> 11)); - INT32 w = (1 << ((sy & 0x0600) >> 9)); - - sx = sx & 0x01ff; - sy = sy & 0x01ff; - if (sx >= 256) sx -= 512; - if (sy >= 256) sy -= 512; - sx = 240 - sx; - sy = 240 - sy; - - if (DrvFlipScreen) - { - sy = 240 - sy; - sx = 240 - sx; - if (flipx) flipx = 0; else flipx = 1; - if (flipy) flipy = 0; else flipy = 1; - mult = 16; - } - else - mult = -16; - - for (INT32 x = 0; x < w; x++) - { - INT32 code = BURN_ENDIAN_SWAP_INT16(SpriteRam[offs + 1]) & 0x1fff; - - code &= ~(h-1); - - if (flipy) - incy = -1; - else - { - code += h-1; - incy = 1; - } - - for (INT32 y = 0; y < h; y++) - { - if (BURN_ENDIAN_SWAP_INT16(SpriteRam[offs]) & 0x8000) - { - INT32 draw = 0; - if (!flash || (GetCurrentFrame() & 1)) - { - if ((color & PriorityMask) == PriorityVal) - { - draw = 1; - } - } - - if (draw) - { - if (flipx) { - if (flipy) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code - y * incy, sx + (mult * x),sy + (mult * y) - 8, color & 0xf, 4, 0, DrvSpritePalOffset, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code - y * incy, sx + (mult * x),sy + (mult * y) - 8, color & 0xf, 4, 0, DrvSpritePalOffset, DrvSprites); - } - } else { - if (flipy) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code - y * incy, sx + (mult * x),sy + (mult * y) - 8, color & 0xf, 4, 0, DrvSpritePalOffset, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code - y * incy, sx + (mult * x),sy + (mult * y) - 8, color & 0xf, 4, 0, DrvSpritePalOffset, DrvSprites); - } - } - } - } - } - - offs += 4; - if (offs >= 0x800 / 2) - return; - } - } -} - -static void BaddudesDraw() -{ - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - DrvFlipScreen = Control0[0] & 0x80; - - BurnTransferClear(); - DrvCalcPalette(); - - if ((DrvPriority & 0x01) == 0x00) { - DrvRenderTile1Layer(1, TILEMAP_BOTH_LAYERS); - DrvRenderTile2Layer(0, TILEMAP_BOTH_LAYERS); - if (DrvPriority & 0x02) DrvRenderTile1Layer(0, TILEMAP_LAYER0); - DrvRenderSprites(0, 0); - if (DrvPriority & 0x04) DrvRenderTile2Layer(0, TILEMAP_LAYER0); - } else { - DrvRenderTile2Layer(1, TILEMAP_BOTH_LAYERS); - DrvRenderTile1Layer(0, TILEMAP_BOTH_LAYERS); - if (DrvPriority & 0x02) DrvRenderTile2Layer(0, TILEMAP_LAYER0); - DrvRenderSprites(0, 0); - if (DrvPriority & 0x04) DrvRenderTile1Layer(0, TILEMAP_LAYER0); - } - - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static void BirdtryDraw() -{ - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - DrvFlipScreen = Control0[0] & 0x80; - - BurnTransferClear(); - DrvCalcPalette(); - - DrvRenderTile2Layer(1, TILEMAP_BOTH_LAYERS); - DrvRenderSprites(0x00, 0x00); - DrvRenderTile1Layer(0, TILEMAP_BOTH_LAYERS); - DrvRenderSprites(0x00, 0x00); - - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static void HbarrelDraw() -{ - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - DrvFlipScreen = Control0[0] & 0x80; - - BurnTransferClear(); - DrvCalcPalette(); - - DrvRenderTile2Layer(1, TILEMAP_BOTH_LAYERS); - DrvRenderSprites(0x08, 0x08); - DrvRenderTile1Layer(0, TILEMAP_BOTH_LAYERS); - DrvRenderSprites(0x08, 0x00); - - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static void HippodrmDraw() -{ - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - DrvFlipScreen = Control0[0] & 0x80; - - BurnTransferClear(); - DrvCalcPalette(); - - if (DrvPriority & 0x01) { - DrvRenderTile1Layer(1, TILEMAP_BOTH_LAYERS); - DrvRenderTile2Layer(0, TILEMAP_BOTH_LAYERS); - } else { - DrvRenderTile2Layer(1, TILEMAP_BOTH_LAYERS); - DrvRenderTile1Layer(0, TILEMAP_BOTH_LAYERS); - } - - DrvRenderSprites(0x00, 0x00); - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static void MidresDraw() -{ - INT32 Trans; - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - DrvFlipScreen = Control0[0] & 0x80; - - if (DrvPriority & 0x04) { - Trans = 0x00; - } else { - Trans = 0x08; - } - - BurnTransferClear(); - Dec1CalcPalette(); - - if (DrvPriority & 0x01) { - DrvRenderTile1Layer(1, TILEMAP_BOTH_LAYERS); - if (DrvPriority & 0x02) DrvRenderSprites(0x08, Trans); - DrvRenderTile2Layer(0, TILEMAP_BOTH_LAYERS); - } else { - DrvRenderTile2Layer(1, TILEMAP_BOTH_LAYERS); - if (DrvPriority & 0x02) DrvRenderSprites(0x08, Trans); - DrvRenderTile1Layer(0, TILEMAP_BOTH_LAYERS); - } - - if (DrvPriority & 0x02) { - DrvRenderSprites(0x08, Trans ^ 0x08); - } else { - DrvRenderSprites(0x00, 0x00); - } - - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static void RobocopDraw() -{ - INT32 Trans; - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - DrvFlipScreen = Control0[0] & 0x80; - - if (DrvPriority & 0x04) { - Trans = 0x08; - } else { - Trans = 0x00; - } - - BurnTransferClear(); - DrvCalcPalette(); - - if (DrvPriority & 0x01) { - DrvRenderTile1Layer(1, TILEMAP_LAYER1); - if (DrvPriority & 0x02) DrvRenderSprites(0x08, Trans); - DrvRenderTile2Layer(0, TILEMAP_BOTH_LAYERS); - } else { - DrvRenderTile2Layer(1, TILEMAP_BOTH_LAYERS); - if (DrvPriority & 0x02) DrvRenderSprites(0x08, Trans); - DrvRenderTile1Layer(0, TILEMAP_BOTH_LAYERS); - } - - if (DrvPriority & 0x02) { - DrvRenderSprites(0x08, Trans ^ 0x08); - } else { - DrvRenderSprites(0x00, 0x00); - } - - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static void SlyspyDraw() -{ - UINT16 *Control0 = (UINT16*)DrvCharCtrl0Ram; - DrvFlipScreen = Control0[0] & 0x80; - - BurnTransferClear(); - Dec1CalcPalette(); - - DrvRenderTile2Layer(1, TILEMAP_BOTH_LAYERS); - DrvRenderTile1Layer(0, TILEMAP_BOTH_LAYERS); - DrvRenderSprites(0x00, 0x00); - if (DrvPriority & 0x80) DrvRenderTile1Layer(0, TILEMAP_LAYER0); - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -#undef TILEMAP_BOTH_LAYERS -#undef TILEMAP_LAYER0 -#undef TILEMAP_LAYER1 - -static INT32 DrvFrame() -{ - INT32 nInterleave = 272*4; - - if (DrvReset) BaddudesDoReset(); - - DrvMakeInputs(); - - if (game_rotates) { - SuperJoy2Rotate(); - } - - nCyclesTotal[0] = (INT32)((double)10000000 / 57.41); - nCyclesTotal[1] = (INT32)((double)1500000 / 57.41); - nCyclesTotal[2] = (INT32)((double)8000000 / 57.41); - nCyclesDone[0] = nCyclesDone[1] = nCyclesDone[2] = 0; - - if (realMCU) { - nCyclesTotal[2] /= 12; // i8751 divider - nCyclesTotal[0] = (INT32)((double)12000000 / 57.41); // tweak for hbarrel - } - - SekNewFrame(); - M6502NewFrame(); - NullNewFrame(); - - SekOpen(0); - M6502Open(0); - - for (INT32 i = 0; i < nInterleave; i++) { - if (i == 8*4) DrvVBlank = 0; - if (i == 248*4) { - DrvVBlank = 1; - SekSetIRQLine(6, CPU_IRQSTATUS_ACK); - } - - BurnTimerUpdate((i + 1) * (nCyclesTotal[0] / nInterleave)); - - if (bTimerNullCPU) - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - if (realMCU) { - INT32 nNext = (i + 1) * nCyclesTotal[2] / nInterleave; - INT32 nSegment = nNext - nCyclesDone[2]; - nCyclesDone[2] += DrvMCURun(nSegment); - } - - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - M6502Close(); - - if (pBurnDraw && Dec0DrawFunction) Dec0DrawFunction(); - - return 0; -} - -static INT32 RobocopFrame() -{ - INT32 nInterleave = 264; - - if (DrvReset) RobocopDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = (INT32)((double)10000000 / 57.41); - nCyclesTotal[1] = (INT32)((double)1500000 / 57.41); - nCyclesTotal[2] = (INT32)((double)1342329 / 57.41); - nCyclesDone[0] = nCyclesDone[1] = nCyclesDone[2] = 0; - - SekNewFrame(); - M6502NewFrame(); - - SekOpen(0); - M6502Open(0); - h6280Open(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - BurnTimerUpdate((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - if (i == 8) DrvVBlank = 0; - if (i == 248) { - DrvVBlank = 1; - SekSetIRQLine(6, CPU_IRQSTATUS_ACK); - } - - nCurrentCPU = 2; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = h6280Run(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - - nCurrentCPU = 1; - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - M6502Close(); - h6280Close(); - - if (pBurnDraw && Dec0DrawFunction) Dec0DrawFunction(); - - return 0; -} - -static INT32 Dec1Frame() -{ - INT32 nInterleave = 272; - - if (DrvReset) SlyspyDoReset(); - - DrvMakeInputs(); - - if (game_rotates) { - SuperJoy2Rotate(); - } - - nCyclesTotal[0] = (INT32)((double)10000000 / 57.41); - if (Dec0Game == DEC1_GAME_MIDRES) - nCyclesTotal[0] = (INT32)((double)14000000 / 57.41); - nCyclesTotal[1] = (INT32)((double)2000000 / 57.41); - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - - nCurrentCPU = 0; - BurnTimerUpdate((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - if (i == 8) DrvVBlank = 0; - if (i == 248) { - DrvVBlank = 1; - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - - nCurrentCPU = 1; - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - h6280Close(); - - if (pBurnDraw && Dec0DrawFunction) Dec0DrawFunction(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - BurnYM2203Scan(nAction, pnMin); - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - if (realMCU) { - DrvMCUScan(nAction); - } - - SCAN_VAR(i8751RetVal); - SCAN_VAR(DrvVBlank); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvFlipScreen); - SCAN_VAR(DrvPriority); - SCAN_VAR(DrvTileRamBank); - SCAN_VAR(DrvSlyspyProtValue); - - SCAN_VAR(nRotate); - SCAN_VAR(nRotateTarget); - SCAN_VAR(nRotateTry); - SCAN_VAR(nRotateHoldInput); - } - - return 0; -} - -static INT32 BaddudesScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - M6502Scan(nAction); - } - - return DrvScan(nAction, pnMin); -} - -static INT32 RobocopScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - h6280CpuScan(nAction); - } - - return BaddudesScan(nAction, pnMin); -} - -static INT32 SlyspyScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - h6280CpuScan(nAction); - } - - return DrvScan(nAction, pnMin); -} - -struct BurnDriver BurnDrvBaddudes = { - "baddudes", NULL, NULL, NULL, "1988", - "Bad Dudes vs. Dragonninja (US)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, BaddudesRomInfo, BaddudesRomName, NULL, NULL, Dec0InputInfo, BaddudesDIPInfo, - BaddudesInit, BaddudesExit, DrvFrame, NULL, BaddudesScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBirdtry = { - "birdtry", NULL, NULL, NULL, "1988", - "Birdie Try (Japan)\0", NULL, "Data East Corporation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, birdtryRomInfo, birdtryRomName, NULL, NULL, HbarrelInputInfo, BirdtryDIPInfo, - BirdtryInit, BaddudesExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 240, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDrgninja = { - "drgninja", "baddudes", NULL, NULL, "1988", - "Dragonninja (Japan)\0", NULL, "Data East Corporation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, DrgninjaRomInfo, DrgninjaRomName, NULL, NULL, Dec0InputInfo, BaddudesDIPInfo, - BaddudesInit, BaddudesExit, DrvFrame, NULL, BaddudesScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDrgninjab = { - "drgninjab", "baddudes", NULL, NULL, "1988", - "Dragonninja (bootleg set 1)\0", NULL, "bootleg", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, DrgninjabRomInfo, DrgninjabRomName, NULL, NULL, Dec0InputInfo, BaddudesDIPInfo, - BaddudesInit, BaddudesExit, DrvFrame, NULL, BaddudesScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDrgninjab2 = { - "drgninjab2", "baddudes", NULL, NULL, "1988", - "Dragonninja (bootleg set 2)\0", NULL, "bootleg", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, Drgninjab2RomInfo, Drgninjab2RomName, NULL, NULL, Dec0InputInfo, BaddudesDIPInfo, - Drgninjab2Init, BaddudesExit, DrvFrame, NULL, BaddudesScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBouldash = { - "bouldash", NULL, NULL, NULL, "1990", - "Boulder Dash / Boulder Dash Part 2 (World)\0", NULL, "Data East Corporation (licensed from First Star)", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_MAZE, 0, - NULL, BouldashRomInfo, BouldashRomName, NULL, NULL, Dec1InputInfo, BouldashDIPInfo, - BouldashInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBouldashj = { - "bouldashj", "bouldash", NULL, NULL, "1990", - "Boulder Dash / Boulder Dash Part 2 (Japan)\0", NULL, "Data East Corporation (licensed from First Star)", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_MAZE, 0, - NULL, BouldashjRomInfo, BouldashjRomName, NULL, NULL, Dec1InputInfo, BouldashDIPInfo, - BouldashInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvHbarrel = { - "hbarrel", NULL, NULL, NULL, "1987", - "Heavy Barrel (US)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, HbarrelRomInfo, HbarrelRomName, NULL, NULL, HbarrelInputInfo, HbarrelDIPInfo, - HbarrelInit, BaddudesExit, DrvFrame, NULL, BaddudesScan, - NULL, 0x400, 240, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHbarrelw = { - "hbarrelw", "hbarrel", NULL, NULL, "1987", - "Heavy Barrel (World)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, HbarrelwRomInfo, HbarrelwRomName, NULL, NULL, HbarrelInputInfo, HbarrelDIPInfo, - HbarrelInit, BaddudesExit, DrvFrame, NULL, BaddudesScan, - NULL, 0x400, 240, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHippodrm = { - "hippodrm", NULL, NULL, NULL, "1989", - "Hippodrome (US)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, HippodrmRomInfo, HippodrmRomName, NULL, NULL, Dec0InputInfo, HippodrmDIPInfo, - HippodrmInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvFfantasy = { - "ffantasy", "hippodrm", NULL, NULL, "1989", - "Fighting Fantasy (Japan revision 3)\0", NULL, "Data East Corpotation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, FfantasyRomInfo, FfantasyRomName, NULL, NULL, Dec0InputInfo, FfantasyDIPInfo, - HippodrmInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvFfantasyj = { - "ffantasyj", "hippodrm", NULL, NULL, "1989", - "Fighting Fantasy (Japan revision 2)\0", NULL, "Data East Corpotation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, FfantasyjRomInfo, FfantasyjRomName, NULL, NULL, Dec0InputInfo, FfantasyDIPInfo, - HippodrmInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvFfantasya = { - "ffantasya", "hippodrm", NULL, NULL, "1989", - "Fighting Fantasy (Japan)\0", NULL, "Data East Corpotation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, FfantasyaRomInfo, FfantasyaRomName, NULL, NULL, Dec0InputInfo, FfantasyDIPInfo, - HippodrmInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvFfantasyb = { - "ffantasyb", "hippodrm", NULL, NULL, "1989", - "Fighting Fantasy (Japan revision ?)\0", NULL, "Data East Corpotation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, FfantasybRomInfo, FfantasybRomName, NULL, NULL, Dec0InputInfo, FfantasyDIPInfo, - HippodrmInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMidres = { - "midres", NULL, NULL, NULL, "1989", - "Midnight Resistance (World)\0", NULL, "Data East Corporation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, MidresRomInfo, MidresRomName, NULL, NULL, MidresInputInfo, MidresDIPInfo, - MidresInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMidresu = { - "midresu", "midres", NULL, NULL, "1989", - "Midnight Resistance (US)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, MidresuRomInfo, MidresuRomName, NULL, NULL, MidresInputInfo, MidresuDIPInfo, - MidresInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMidresj = { - "midresj", "midres", NULL, NULL, "1989", - "Midnight Resistance (Japan)\0", NULL, "Data East Corporation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, MidresjRomInfo, MidresjRomName, NULL, NULL, MidresInputInfo, MidresuDIPInfo, - MidresInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRobocop = { - "robocop", NULL, NULL, NULL, "1988", - "Robocop (World revision 4)\0", NULL, "Data East Corporation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, RobocopRomInfo, RobocopRomName, NULL, NULL, Dec0InputInfo, RobocopDIPInfo, - RobocopInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRobocopw = { - "robocopw", "robocop", NULL, NULL, "1988", - "Robocop (World revision 3)\0", NULL, "Data East Corporation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, RobocopwRomInfo, RobocopwRomName, NULL, NULL, Dec0InputInfo, RobocopDIPInfo, - RobocopInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRobocopj = { - "robocopj", "robocop", NULL, NULL, "1988", - "Robocop (Japan)\0", NULL, "Data East Corporation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, RobocopjRomInfo, RobocopjRomName, NULL, NULL, Dec0InputInfo, RobocopDIPInfo, - RobocopInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRobocopu = { - "robocopu", "robocop", NULL, NULL, "1988", - "Robocop (US revision 1)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, RobocopuRomInfo, RobocopuRomName, NULL, NULL, Dec0InputInfo, RobocopDIPInfo, - RobocopInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRobocopu0 = { - "robocopu0", "robocop", NULL, NULL, "1988", - "Robocop (US revision 0)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, Robocopu0RomInfo, Robocopu0RomName, NULL, NULL, Dec0InputInfo, RobocopDIPInfo, - RobocopInit, RobocopExit, RobocopFrame, NULL, RobocopScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRobocopb = { - "robocopb", "robocop", NULL, NULL, "1988", - "Robocop (World bootleg)\0", NULL, "bootleg", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, RobocopbRomInfo, RobocopbRomName, NULL, NULL, Dec0InputInfo, RobocopDIPInfo, - RobocopbInit, BaddudesExit, DrvFrame, NULL, BaddudesScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRobocopb2 = { - "robocopb2", "robocop", NULL, NULL, "1989", - "Robocop (Red Corporation World bootleg)\0", NULL, "bootleg", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, Robocopb2RomInfo, Robocopb2RomName, NULL, NULL, Dec0InputInfo, RobocopDIPInfo, - RobocopbInit, BaddudesExit, DrvFrame, NULL, BaddudesScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSecretag = { - "secretag", NULL, NULL, NULL, "1989", - "Secret Agent (World revision 3)\0", NULL, "Data East Corporation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, SecretagRomInfo, SecretagRomName, NULL, NULL, Dec1InputInfo, SlyspyDIPInfo, - SlyspyInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSecretagj = { - "secretagj", "secretag", NULL, NULL, "1989", - "Secret Agent (Japan revision 2)\0", NULL, "Data East Corporation", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, SecretagjRomInfo, SecretagjRomName, NULL, NULL, Dec1InputInfo, SlyspyDIPInfo, - SlyspyInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSlyspy = { - "slyspy", "secretag", NULL, NULL, "1989", - "Sly Spy (US revision 4)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, SlyspyRomInfo, SlyspyRomName, NULL, NULL, Dec1InputInfo, SlyspyDIPInfo, - SlyspyInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSlyspy2 = { - "slyspy2", "secretag", NULL, NULL, "1989", - "Sly Spy (US revision 2)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, Slyspy2RomInfo, Slyspy2RomName, NULL, NULL, Dec1InputInfo, SlyspyDIPInfo, - SlyspyInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSlyspy3 = { - "slyspy3", "secretag", NULL, NULL, "1989", - "Sly Spy (US revision 3)\0", NULL, "Data East USA", "DEC0", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, Slyspy3RomInfo, Slyspy3RomName, NULL, NULL, Dec1InputInfo, SlyspyDIPInfo, - SlyspyInit, SlyspyExit, Dec1Frame, NULL, SlyspyScan, - NULL, 0x400, 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_dec8.cpp b/jan/src/burn/drv/dataeast/d_dec8.cpp deleted file mode 100644 index de8db1d64..000000000 --- a/jan/src/burn/drv/dataeast/d_dec8.cpp +++ /dev/null @@ -1,5941 +0,0 @@ -// FB Alpha Data East 8-bit driver module -// Based on MAME driver by Bryan McPhail and Stephane Humbert - -// To do: -// gondo needs rotary inputs hooked up and doesn't read the i8751 value at all - so coins don't work - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "burn_ym2203.h" -#include "hd6309_intf.h" -#include "m6809_intf.h" -#include "mcs51.h" -#include "burn_ym3812.h" -#include "burn_ym3526.h" -#include "msm5205.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvSubROM; -static UINT8 *DrvMCURom; -static UINT8 *DrvM6502ROM; -static UINT8 *DrvM6502OPS; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvColPROM; -static UINT8 *DrvMainRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvPf0RAM; -static UINT8 *DrvPf1RAM; -static UINT8 *DrvPf0Ctrl; -static UINT8 *DrvPf1Ctrl; -static UINT8 *DrvRowRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvM6502RAM; -static UINT8 *DrvPalRAM; - -static UINT32 *Palette; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *nmi_enable; -static UINT8 *interrupt_enable; -static UINT8 *flipscreen; - -static INT32 realMCU = 0; -static INT32 i8751_return; -static INT32 i8751_value; -static INT32 vblank; -static INT32 RomBank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvInputs[5]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 nCyclesDone[3] = { 0, 0, 0 }; // up here, for mcu sync - -static struct BurnInputInfo GhostbInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy4 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Ghostb) - -static struct BurnDIPInfo GhostbDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xf0, NULL }, - {0x12, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x01, "1" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "5" }, - {0x12, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x04, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x08, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Scene Time" }, - {0x12, 0x01, 0x30, 0x00, "4.00" }, - {0x12, 0x01, 0x30, 0x10, "4.30" }, - {0x12, 0x01, 0x30, 0x30, "5.00" }, - {0x12, 0x01, 0x30, 0x20, "6.00" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x40, 0x40, "No" }, - {0x12, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Beam Energy Pickup" }, - {0x12, 0x01, 0x80, 0x00, "Up 1.5%" }, - {0x12, 0x01, 0x80, 0x80, "Normal" }, -}; - -STDDIPINFO(Ghostb) - -static struct BurnInputInfo Ghostb3InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy4 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"P3 Coin", BIT_DIGITAL, DrvJoy5 + 7, "p3 coin"}, - {"P3 Start", BIT_DIGITAL, DrvJoy4 + 2, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 0, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 2, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 3, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Ghostb3) - -static struct BurnDIPInfo Ghostb3DIPList[]= -{ - {0x19, 0xff, 0xff, 0xf0, NULL }, - {0x1a, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x19, 0x01, 0x20, 0x00, "Off" }, - {0x19, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x19, 0x01, 0x40, 0x40, "Off" }, - {0x19, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x1a, 0x01, 0x03, 0x01, "1" }, - {0x1a, 0x01, 0x03, 0x03, "3" }, - {0x1a, 0x01, 0x03, 0x02, "5" }, - {0x1a, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1a, 0x01, 0x0c, 0x04, "Easy" }, - {0x1a, 0x01, 0x0c, 0x0c, "Normal" }, - {0x1a, 0x01, 0x0c, 0x08, "Hard" }, - {0x1a, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Scene Time" }, - {0x1a, 0x01, 0x30, 0x00, "4.00" }, - {0x1a, 0x01, 0x30, 0x10, "4.30" }, - {0x1a, 0x01, 0x30, 0x30, "5.00" }, - {0x1a, 0x01, 0x30, 0x20, "6.00" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x1a, 0x01, 0x40, 0x40, "No" }, - {0x1a, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Beam Energy Pickup" }, - {0x1a, 0x01, 0x80, 0x00, "Up 1.5%" }, - {0x1a, 0x01, 0x80, 0x80, "Normal" }, -}; - -STDDIPINFO(Ghostb3) - -static struct BurnInputInfo CobracomInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Cobracom) - -static struct BurnDIPInfo CobracomDIPList[]= -{ - {0x11, 0xff, 0xff, 0x7f, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x03, 0x00, "3 Coins 1 Credits " }, - {0x11, 0x01, 0x03, 0x01, "2 Coins 1 Credits " }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x0c, 0x00, "3 Coins 1 Credits " }, - {0x11, 0x01, 0x0c, 0x04, "2 Coins 1 Credits " }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits " }, - {0x11, 0x01, 0x0c, 0x08, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x80, 0x00, "Upright" }, - {0x11, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x04, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x08, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x10, 0x00, "No" }, - {0x12, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x20, 0x20, "50k, 150k" }, - {0x12, 0x01, 0x20, 0x00, "100k, 200k" }, -}; - -STDDIPINFO(Cobracom) - -static struct BurnInputInfo SrdarwinInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Srdarwin) - -static struct BurnDIPInfo SrdarwinDIPList[]= -{ - {0x10, 0xff, 0xff, 0x7f, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x10, 0x01, 0x03, 0x00, "3 Coins 1 Credits " }, - {0x10, 0x01, 0x03, 0x01, "2 Coins 1 Credits " }, - {0x10, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0x0c, 0x00, "3 Coins 1 Credits " }, - {0x10, 0x01, 0x0c, 0x04, "2 Coins 1 Credits " }, - {0x10, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits " }, - {0x10, 0x01, 0x0c, 0x08, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x20, 0x00, "Off" }, - {0x10, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x10, 0x01, 0x40, 0x40, "Off" }, - {0x10, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x80, 0x00, "Upright" }, - {0x10, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x01, "1" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x00, "28 (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x0c, 0x04, "Easy" }, - {0x11, 0x01, 0x0c, 0x0c, "Normal" }, - {0x11, 0x01, 0x0c, 0x08, "Hard" }, - {0x11, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Srdarwin) - -static struct BurnInputInfo GondoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy4 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p1 fire 2"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 4"}, // fake - hold space for rotory - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 2, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 2"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 4"}, // fake - hold space for rotory - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Gondo) - -static struct BurnDIPInfo GondoDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x03, 0x00, "3 Coins 1 Credits " }, - {0x13, 0x01, 0x03, 0x01, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x0c, 0x00, "3 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x04, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x0c, 0x08, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x01, "1" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x02, "5" }, - {0x14, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x04, "Easy" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x08, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x10, 0x10, "No" }, - {0x14, 0x01, 0x10, 0x00, "Yes" }, -}; - -STDDIPINFO(Gondo) - -static struct BurnInputInfo GaryoretInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Garyoret) - -static struct BurnDIPInfo GaryoretDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x03, 0x00, "3 Coins 1 Credits " }, - {0x11, 0x01, 0x03, 0x01, "2 Coins 1 Credits " }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x0c, 0x00, "3 Coins 1 Credits " }, - {0x11, 0x01, 0x0c, 0x04, "2 Coins 1 Credits " }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits " }, - {0x11, 0x01, 0x0c, 0x08, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x01, 0x01, "3" }, - {0x12, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x04, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x08, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, -}; - -STDDIPINFO(Garyoret) - -static struct BurnInputInfo OscarInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Oscar) - -static struct BurnDIPInfo OscarDIPList[]= -{ - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x03, 0x00, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - {0x13, 0x01, 0x03, 0x01, "1 Coin 3 Credits " }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x0c, 0x00, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x0c, 0x08, "1 Coin 2 Credits " }, - {0x13, 0x01, 0x0c, 0x04, "1 Coin 3 Credits " }, - - {0 , 0xfe, 0 , 2, "Freeze Mode" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x01, "1" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x02, "5" }, - {0x14, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x04, "Easy" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x08, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "Every 40000" }, - {0x14, 0x01, 0x30, 0x20, "Every 60000" }, - {0x14, 0x01, 0x30, 0x10, "Every 90000" }, - {0x14, 0x01, 0x30, 0x00, "50000 only" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Oscar) - -static struct BurnDIPInfo OscaruDIPList[]= -{ - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 2 Credits " }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 3 Credits " }, - {0x13, 0x01, 0x03, 0x01, "1 Coin 4 Credits " }, - {0x13, 0x01, 0x03, 0x00, "1 Coin 6 Credits " }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x0c, 0x00, "4 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x04, "3 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x08, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits " }, - - {0 , 0xfe, 0 , 2, "Freeze Mode" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x01, "1" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x02, "5" }, - {0x14, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x04, "Easy" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x08, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "Every 40000" }, - {0x14, 0x01, 0x30, 0x20, "Every 60000" }, - {0x14, 0x01, 0x30, 0x10, "Every 90000" }, - {0x14, 0x01, 0x30, 0x00, "50000 only" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Oscaru) - -static struct BurnInputInfo LastmisnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Lastmisn) - -static struct BurnDIPInfo LastmisnDIPList[]= -{ - {0x13, 0xff, 0xff, 0xcf, NULL }, - {0x14, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x03, 0x00, "3 Coins 1 Credits " }, - {0x13, 0x01, 0x03, 0x01, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x0c, 0x00, "3 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x04, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x0c, 0x08, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x20, 0x00, "Upright" }, - {0x13, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Infinite Lives (Cheat" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x01, 0x01, "3" }, - {0x14, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x06, 0x06, "30k, 70k then every 70k" }, - {0x14, 0x01, 0x06, 0x04, "40k, 90k then every 90k" }, - {0x14, 0x01, 0x06, 0x02, "40k and 80k" }, - {0x14, 0x01, 0x06, 0x00, "50k only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x18, 0x08, "Easy" }, - {0x14, 0x01, 0x18, 0x18, "Normal" }, - {0x14, 0x01, 0x18, 0x10, "Hard" }, - {0x14, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "No" }, - {0x14, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Lastmisn) - -static struct BurnDIPInfo LastmsnjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xcf, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x03, 0x00, "3 Coins 1 Credits " }, - {0x13, 0x01, 0x03, 0x01, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x0c, 0x00, "3 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x04, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x0c, 0x08, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x20, 0x00, "Upright" }, - {0x13, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Infinite Lives (Cheat" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x01, 0x01, "3" }, - {0x14, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x06, 0x06, "30k, 50k then every 50k" }, - {0x14, 0x01, 0x06, 0x04, "30k, 70k then every 70k" }, - {0x14, 0x01, 0x06, 0x02, "50k, 100k then every 100k" }, - {0x14, 0x01, 0x06, 0x00, "50k only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x18, 0x08, "Easy" }, - {0x14, 0x01, 0x18, 0x18, "Normal" }, - {0x14, 0x01, 0x18, 0x10, "Hard" }, - {0x14, 0x01, 0x18, 0x00, "Hardest" }, -}; - -STDDIPINFO(Lastmsnj) - -static struct BurnInputInfo ShackledInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Shackled) - -static struct BurnDIPInfo ShackledDIPList[]= -{ - {0x11, 0xff, 0xff, 0xf7, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Leave Off" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Power" }, - {0x12, 0x01, 0x0f, 0x07, "200" }, - {0x12, 0x01, 0x0f, 0x0b, "300" }, - {0x12, 0x01, 0x0f, 0x03, "400" }, - {0x12, 0x01, 0x0f, 0x0d, "500" }, - {0x12, 0x01, 0x0f, 0x05, "600" }, - {0x12, 0x01, 0x0f, 0x09, "700" }, - {0x12, 0x01, 0x0f, 0x01, "800" }, - {0x12, 0x01, 0x0f, 0x0e, "900" }, - {0x12, 0x01, 0x0f, 0x0f, "1000" }, - {0x12, 0x01, 0x0f, 0x06, "2000" }, - {0x12, 0x01, 0x0f, 0x0a, "3000" }, - {0x12, 0x01, 0x0f, 0x02, "4000" }, - {0x12, 0x01, 0x0f, 0x0c, "5000" }, - {0x12, 0x01, 0x0f, 0x04, "6000" }, - {0x12, 0x01, 0x0f, 0x08, "7000" }, - {0x12, 0x01, 0x0f, 0x00, "8000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x10, "Very Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Shackled) - -static struct BurnInputInfo CsilverInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Csilver) - -static struct BurnDIPInfo CsilverDIPList[]= -{ - {0x11, 0xff, 0xff, 0x7f, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 1, "Coin A" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - - {0 , 0xfe, 0 , 1, "Coin B" }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits " }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x80, 0x00, "Upright" }, - {0x11, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x01, "1" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "5" }, - {0x12, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x04, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x08, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x10, 0x00, "No" }, - {0x12, 0x01, 0x10, 0x10, "Yes" }, -}; - -STDDIPINFO(Csilver) - -static void ghostb_i8751_write(INT32 offset, INT32 data) -{ - i8751_return = 0; - - switch (offset) - { - case 0: - i8751_value = (i8751_value & 0x00ff) | (data << 8); - mcs51_set_irq_line(MCS51_INT1_LINE, CPU_IRQSTATUS_ACK); - nCyclesDone[2] += mcs51Run(64); - mcs51_set_irq_line(MCS51_INT1_LINE, CPU_IRQSTATUS_NONE); - break; - - case 1: - i8751_value = (i8751_value & 0xff00) | (data << 0); - break; - } -} - -// i8751 MCU, currently only for ghostb. -static UINT8 i8751_port0 = 0; -static UINT8 i8751_port1 = 0; - -static UINT8 mcu_read_port(INT32 port) -{ - if (!(port >= MCS51_PORT_P0 && port <= MCS51_PORT_P3)) - return 0; - port &= 0x3; - - switch (port) { - case 0: - return i8751_port0; - case 1: - return i8751_port1; - case 2: - return 0xff; - case 3: - return DrvInputs[4] & 0xf0; // coin inputs - } - - return 0xff; -} - -static void mcu_write_port(INT32 port, UINT8 data) -{ - if (!(port >= MCS51_PORT_P0 && port <= MCS51_PORT_P3)) - return; - - port &= 0x3; - - if (port == 0) i8751_port0 = data; - else if (port == 1) i8751_port1 = data; - - if (port == 2 && (data&0x10) == 0) - i8751_port0 = i8751_value>>8; - if (port == 2 && (data&0x20) == 0) - i8751_port1 = i8751_value&0xff; - if (port == 2 && (data&0x40) == 0) - i8751_return = (i8751_return & 0xff) | (i8751_port0 << 8); - if (port == 2 && (data&0x80) == 0) - i8751_return = (i8751_return & 0xff00) | i8751_port1; - - if (port == 2 && (data&4) == 0) { - HD6309SetIRQLine(0, CPU_IRQSTATUS_ACK); - } -} - -static void DrvMCUReset(); // forward - -static void DrvMCUInit() -{ - mcs51_program_data = DrvMCURom; - mcs51_init (); - mcs51_set_write_handler(mcu_write_port); - mcs51_set_read_handler(mcu_read_port); - - DrvMCUReset(); -} - -static void DrvMCUExit() { - mcs51_exit(); -} - -static INT32 DrvMCURun(INT32 cycles) -{ - cycles = mcs51Run(cycles); - - return cycles; -} - -static INT32 DrvMCUScan(INT32 nAction) -{ - mcs51_scan(nAction); - - SCAN_VAR(i8751_port0); - SCAN_VAR(i8751_port1); - SCAN_VAR(i8751_value); - SCAN_VAR(i8751_return); - - return 0; -} - -static void DrvMCUSync() -{ - INT32 todo = (HD6309TotalCycles() / 12) - nCyclesDone[2]; - if (todo > 0) nCyclesDone[2] += DrvMCURun(todo); -} - -static void DrvMCUReset() -{ - i8751_port0 = i8751_port1 = i8751_value = i8751_return = 0; - mcs51_reset(); -} - - -static void bankswitch(INT32 data) -{ - RomBank = (data & 0x0f) * 0x4000; - - HD6309MapMemory(DrvMainROM + 0x10000 + RomBank, 0x4000, 0x7fff, MAP_ROM); // bank -} - -void ghostb_main_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("%4.4x, %2.2x\n"), address, data); - - switch (address) - { - case 0x3800: - *soundlatch = data; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - - case 0x3840: - bankswitch(data >> 4); - - if (!(data&1)) HD6309SetIRQLine(0, CPU_IRQSTATUS_NONE); - *interrupt_enable = data & 1; - *nmi_enable = data & 2; - *flipscreen = data & 8; - return; - - case 0x3860: - case 0x3861: - ghostb_i8751_write(address & 1, data); - return; - } - - if ((address & 0xffe0) == 0x3820) { - DrvPf0Ctrl[address & 0x1f] = data; - return; - } -} - -UINT8 ghostb_main_read(UINT16 address) -{ - switch (address) - { - case 0x3800: - return DrvInputs[0]; - - case 0x3801: - return DrvInputs[1]; - - case 0x3802: - return DrvInputs[2]; - - case 0x3803: - return (DrvDips[0] & 0xf0) | (DrvInputs[3] & 0x07) | vblank; - - case 0x3820: - return DrvDips[1]; - - case 0x3840: - DrvMCUSync(); - return i8751_return >> 8; - - case 0x3860: - DrvMCUSync(); - return i8751_return & 0xff; - } - - return 0; -} - -void ghostb_sound_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("%4.4x, %2.2x\n"), address, data); - - switch (address) - { - case 0x2000: - case 0x2001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0x4000: - case 0x4001: - BurnYM3812Write(0, address & 1, data); - return; - } -} - -UINT8 ghostb_sound_read(UINT16 address) -{ -// bprintf (0, _T("%4.4x, \n"), address); - - switch (address) - { - case 0x3000: - case 0x6000: - return *soundlatch; - } - - return 0; -} - -static INT32 DrvYM3812SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6502TotalCycles() * nSoundRate / 1500000; -} - -static INT32 DrvYM3812SynchroniseStreamCsilver(INT32 nSoundRate) -{ - return (INT64)M6502TotalCycles() * nSoundRate / (1500000); -} - -static INT32 DrvYM2203SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)HD6309TotalCycles() * nSoundRate / 12000000; -} - -static double DrvYM2203GetTime() -{ - return (double)HD6309TotalCycles() / 12000000; -} - -static INT32 DrvYM2203SynchroniseStream6000000(INT32 nSoundRate) -{ - return (INT64)HD6309TotalCycles() * nSoundRate / 6000000; -} - -static double DrvYM2203GetTime6000000() -{ - return (double)HD6309TotalCycles() / 6000000; -} - -static INT32 DrvYM2203M6809SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / 2000000; -} - -static double DrvYM2203M6809GetTime() -{ - return (double)M6809TotalCycles() / 2000000; -} - -static INT32 DrvYM2203M6809SynchroniseStream1500000(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / (1500000); -} - -static double DrvYM2203M6809GetTime1500000() -{ - return (double)M6809TotalCycles() / 1500000; -} - -inline static INT32 CsilverMSM5205SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)M6809TotalCycles() * nSoundRate / (1500000)); -} - -static void DrvYM3812FMIRQHandler(INT32, INT32 nStatus) -{ - if (M6502GetActive() == -1) return; - if (nStatus) { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_ACK); - } else { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - if (realMCU) - DrvMCUReset(); - - BurnYM3812Reset(); - BurnYM2203Reset(); - - i8751_return = 0; - i8751_value = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x060000; - DrvSubROM = Next; Next += 0x030000; - DrvM6502ROM = Next; Next += 0x030000; - DrvM6502OPS = Next; Next += 0x020000; - DrvMCURom = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROM3 = Next; Next += 0x100000; - - DrvColPROM = Next; Next += 0x000800; - - Palette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvMainRAM = Next; Next += 0x008000; - DrvVidRAM = Next; Next += 0x001800; - DrvPf0RAM = Next; Next += 0x002000; - DrvPf1RAM = Next; Next += 0x002000; - DrvPf0Ctrl = Next; Next += 0x000040; - DrvPf1Ctrl = Next; Next += 0x000040; - DrvRowRAM = Next; Next += 0x001400; - DrvSprRAM = Next; Next += 0x000800; - DrvSprBuf = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - - DrvM6502RAM = Next; Next += 0x002800; - - soundlatch = Next; Next += 0x000001; - nmi_enable = Next; Next += 0x000001; - interrupt_enable = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x400; i++) - { - INT32 bit0, bit1, bit2, bit3, r, g, b; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - bit3 = (DrvColPROM[i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (DrvColPROM[i] >> 4) & 0x01; - bit1 = (DrvColPROM[i] >> 5) & 0x01; - bit2 = (DrvColPROM[i] >> 6) & 0x01; - bit3 = (DrvColPROM[i] >> 7) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (DrvColPROM[i + 0x400] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x400] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x400] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x400] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - Palette[i] = (r << 16) | (g << 8) | b; - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { 0x6000*8,0x4000*8,0x2000*8 }; - INT32 Plane1[4] = { 0x60000*8,0x40000*8,0x20000*8,0x00000*8 }; - INT32 Plane2[4] = { 0x20000*8,0x00000*8,0x30000*8,0x10000*8 }; - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 XOffs1[16]= {16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8),0,1,2,3,4,5,6,7 }; - INT32 XOffs2[16]= {7,6,5,4,3,2,1,0,7+(16*8), 6+(16*8), 5+(16*8), 4+(16*8), 3+(16*8), 2+(16*8), 1+(16*8), 0+(16*8) }; - INT32 YOffs0[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 3, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane2, XOffs2, YOffs0, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static void Deco222Decode() -{ - for (INT32 A = 0x8000;A < 0x10000;A++) - DrvM6502OPS[A] = (DrvM6502ROM[A] & 0x9f) | ((DrvM6502ROM[A] & 0x20) << 1) | ((DrvM6502ROM[A] & 0x40) >> 1); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (!strncmp(BurnDrvGetTextA(DRV_NAME), "ghostb", 6)) { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x30000, 3, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x40000, 4, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x70000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 18, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 19, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 20, 1)) return 1; - - if (BurnLoadRom(DrvMCURom + 0x00000, 21, 1)) return 1; - - Deco222Decode(); - - } else { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x30000, 3, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x70000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 17, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 18, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 19, 1)) return 1; - - if (BurnLoadRom(DrvMCURom + 0x00000, 20, 1)) return 1; - - memcpy (DrvM6502OPS + 0x8000, DrvM6502ROM + 0x8000, 0x8000); - } - - memset (DrvColPROM + 0x20, 0, 0xe0); // ok? - DrvPaletteInit(); - DrvGfxDecode(); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvMainRAM, 0x0000, 0x17ff, MAP_RAM); - HD6309MapMemory(DrvVidRAM, 0x1800, 0x1fff, MAP_RAM); - HD6309MapMemory(DrvPf0RAM, 0x2000, 0x2bff, MAP_RAM);// 0 - 27ff - HD6309MapMemory(DrvRowRAM, 0x2c00, 0x2fff, MAP_RAM);// c00-dff - HD6309MapMemory(DrvSprRAM, 0x3000, 0x37ff, MAP_RAM); - HD6309MapMemory(DrvMainROM + 0x10000, 0x4000, 0x7fff, MAP_ROM); // bank - HD6309MapMemory(DrvMainROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(ghostb_main_write); - HD6309SetReadHandler(ghostb_main_read); - HD6309Close(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x05ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM + 0x8000, 0x8000, 0xffff, MAP_READ); - M6502MapMemory(DrvM6502OPS + 0x8000, 0x8000, 0xffff, MAP_FETCH); - M6502SetReadHandler(ghostb_sound_read); - M6502SetWriteHandler(ghostb_sound_write); - M6502Close(); - - realMCU = 1; - DrvMCUInit(); - - BurnSetRefreshRate(58.00); - - BurnYM3812Init(1, 3000000, &DrvYM3812FMIRQHandler, &DrvYM3812SynchroniseStream, 0); - BurnTimerAttachM6502YM3812(1500000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 1500000, NULL, DrvYM2203SynchroniseStream, DrvYM2203GetTime, 1); - BurnTimerAttachHD6309(12000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.23, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - BurnYM2203Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_txt_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 code = DrvVidRAM[offs * 2 + 1] | (DrvVidRAM[offs * 2 + 0] << 8); - INT32 color = (code >> 10) & 3; - - code &= 0x3ff; - if (code == 0) continue; // ok? - - sy -= 8; - if (sy < 0 || sy >= nScreenHeight) continue; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites1(INT32 priority) -{ - for (INT32 offs = 0;offs < 0x800;offs += 8) - { - INT32 y = DrvSprBuf[offs + 1] | (DrvSprBuf[offs + 0] << 8); - if (~y & 0x8000) continue; - - INT32 fx = DrvSprBuf[offs+3]; - if (~fx & 0x0001) continue; - - INT32 x = DrvSprBuf[offs + 5] | (DrvSprBuf[offs + 4] << 8); - - INT32 extra = fx & 0x0010; - INT32 fy = fx & 0x0002; - INT32 colour = DrvSprBuf[offs+6] >> 4; - - INT32 sprite = DrvSprBuf[offs+7]+(DrvSprBuf[offs+6]<<8); - sprite &= 0x0fff; - - if (priority == 1 && colour & 8) continue; - if (priority == 2 && ~colour & 8) continue; - - if (extra) {y=y+16;sprite&=0xffe;} - - x = x & 0x01ff; - y = y & 0x01ff; - x=(x+16)&0x1ff; - y=(y+16)&0x1ff; - x=256 - x; - y=256 - y; - - fx &= 0x0004; - - if (*flipscreen) - { - y=240-y; - x=240-x; - if (fx) fx=0; else fx=1; - if (fy) fy=0; else fy=1; - if (extra) y=y-16; - } - - INT32 sprite2; - /* Y Flip determines order of multi-sprite */ - if (extra && fy) - { - sprite2=sprite; - sprite++; - } - else - sprite2=sprite+1; - - y -= 8; - - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sprite & 0xfff, x, y, colour, 4, 0, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sprite & 0xfff, x, y, colour, 4, 0, 0x100, DrvGfxROM1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sprite & 0xfff, x, y, colour, 4, 0, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sprite & 0xfff, x, y, colour, 4, 0, 0x100, DrvGfxROM1); - } - } - - /* 1 more sprite drawn underneath */ - if (extra) { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sprite2 & 0xfff, x, y+16, colour, 4, 0, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sprite2 & 0xfff, x, y+16, colour, 4, 0, 0x100, DrvGfxROM1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sprite2 & 0xfff, x, y+16, colour, 4, 0, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sprite2 & 0xfff, x, y+16, colour, 4, 0, 0x100, DrvGfxROM1); - } - } - } - } -} - -static void draw_bg_layer(UINT8 *ram, UINT8 *ctrl, UINT8 *gfx, INT32 coff, INT32 cmask, INT32 mask, INT32 t, INT32 priority) -{ - INT32 rowscroll = ctrl[0x00] & 0x04; - INT32 scrolly = ((ctrl[0x12] << 8) + ctrl[0x13] + 8) & 0x1ff; - INT32 scrollx = ((ctrl[0x10] << 8) | ctrl[0x11]) & 0x1ff; - - if (rowscroll || t > 1) - { - INT32 xscroll[256]; - - for (INT32 i = 0; i < 256; i++) { - xscroll[i] = ((DrvRowRAM[i*2]<<8)+DrvRowRAM[i*2+1])&0x1ff; - } - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sy -= scrolly; - if (sy < -15) sy += 512; - sx -= scrollx; - if (sx < -15) sx += 512; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 ofst = (offs & 0x0f) | ((offs >> 1) & 0x1f0) | ((offs & 0x10) << 5); - - INT32 code = (ram[ofst * 2 + 0] << 8) | ram[ofst * 2 + 1]; - INT32 color = (code >> 12) & cmask; - - if (priority && color < 8) continue; - - { - code &= mask; - color <<= 4; - color += coff; - UINT16 *dst = pTransDraw; - UINT8 *src = gfx + (code << 8); - - for (INT32 y = 0; y < 16; y++, sy++, src+=16) - { - if (sy < 0 || sy >= nScreenHeight) continue; - - dst = pTransDraw + sy * nScreenWidth; - - INT32 xx = sx; - if (rowscroll) { - xx -= xscroll[sy]; - if (xx < -15) xx += 512; - if (xx >= nScreenWidth) continue; - } - - if (t) { - for (INT32 x = 0; x < 16; x++, xx++) - { - INT32 pxl = src[x]; - if (t & (1 << pxl)) continue; - if (xx < 0 || xx >= nScreenWidth) continue; - - dst[xx] = pxl | color; - } - } else { - for (INT32 x = 0; x < 16; x++, xx++) - { - if (xx < 0 || xx >= nScreenWidth) continue; - - dst[xx] = src[x] | color; - } - } - } - } - } - } else { - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scrollx; - sy -= scrolly; - if (sx < -15) sx += 512; - if (sy < -15) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 ofst = (offs & 0x0f) | ((offs >> 1) & 0x1f0) | ((offs & 0x10) << 5); - - INT32 code = (ram[ofst * 2 + 0] << 8) | ram[ofst * 2 + 1]; - INT32 color = (code >> 12) & cmask; - - if (priority && color < 8) continue; - - if (t) { - Render16x16Tile_Mask_Clip(pTransDraw, code & mask, sx, sy, color, 4, 0, coff, gfx); - } else { - Render16x16Tile_Clip(pTransDraw, code & mask, sx, sy, color, 4, coff, gfx); - } - } - } -} - - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i++) { - INT32 d = Palette[i]; - DrvPalette[i] = BurnHighCol(d >> 16, (d >> 8) & 0xff, d & 0xff, 0); - } - } - - draw_bg_layer(DrvPf0RAM, DrvPf0Ctrl, DrvGfxROM2, 0x200, 0x0f, 0x7ff, 0, 0); - draw_sprites1(0); - draw_txt_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - HD6309NewFrame(); - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 12000000 / 58, 1500000 / 58, 12000000 / 58 }; - memset(nCyclesDone, 0, sizeof(nCyclesDone)); - - if (realMCU) { - nCyclesTotal[2] /= 12; // i8751 divider - } - - M6502Open(0); - HD6309Open(0); - - vblank = 8; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 8) vblank = 0; - if (i == 254) { - vblank = 8; - if (*nmi_enable) HD6309SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - } - - BurnTimerUpdate((i + 1) * (nCyclesTotal[0] / nInterleave)); - - if (realMCU) { - INT32 nNext = (i + 1) * nCyclesTotal[2] / nInterleave; - INT32 nSegment = nNext - nCyclesDone[2]; - nCyclesDone[2] += DrvMCURun(nSegment); - } - - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - HD6309Close(); - M6502Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6502Scan(nAction); - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(i8751_return); - SCAN_VAR(i8751_value); - SCAN_VAR(vblank); - SCAN_VAR(RomBank); - } - - return 0; -} - -// The Real Ghostbusters (US 2 Players, revision 2) - -static struct BurnRomInfo ghostbRomDesc[] = { - { "dz01-22.1d", 0x08000, 0xfc65fdf2, 1 }, // 0 maincpu - { "dz02.3d", 0x10000, 0x8e117541, 1 }, // 1 - { "dz03.4d", 0x10000, 0x5606a8f4, 1 }, // 2 - { "dz04-21.6d", 0x10000, 0x7d46582f, 1 }, // 3 - { "dz05-21.7d", 0x10000, 0x23e1c758, 1 }, // 4 - - { "dz06.5f", 0x08000, 0x798f56df, 2 }, // 5 audiocpu - - { "dz00.16b", 0x08000, 0x992b4f31, 3 }, // 6 gfx1 - - { "dz15.14f", 0x10000, 0xa01a5fd9, 4 }, // 7 gfx2 - { "dz16.15f", 0x10000, 0x5a9a344a, 4 }, // 8 - { "dz12.9f", 0x10000, 0x817fae99, 4 }, // 9 - { "dz14.12f", 0x10000, 0x0abbf76d, 4 }, // 10 - { "dz11.8f", 0x10000, 0xa5e19c24, 4 }, // 11 - { "dz13.1f", 0x10000, 0x3e7c0405, 4 }, // 12 - { "dz17.17f", 0x10000, 0x40361b8b, 4 }, // 13 - { "dz18.18f", 0x10000, 0x8d219489, 4 }, // 14 - - { "dz07.12f", 0x10000, 0xe7455167, 5 }, // 15 gfx3 - { "dz08.14f", 0x10000, 0x32f9ddfe, 5 }, // 16 - { "dz09.15f", 0x10000, 0xbb6efc02, 5 }, // 17 - { "dz10.17f", 0x10000, 0x6ef9963b, 5 }, // 18 - - { "dz19a.10d", 0x00400, 0x47e1f83b, 6 }, // 19 proms - { "dz20a.11d", 0x00400, 0xd8fe2d99, 6 }, // 20 - - { "dz-1.1b", 0x01000, 0x18b7e1e6, 7 }, // 21 mcu -}; - -STD_ROM_PICK(ghostb) -STD_ROM_FN(ghostb) - -static INT32 GhostbExit() -{ - HD6309Exit(); - BurnYM3812Exit(); - DrvMCUExit(); - - return DrvExit(); -} - -static INT32 GhostbScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - HD6309Scan(nAction); - BurnYM3812Scan(nAction, pnMin); - - DrvMCUScan(nAction); - - SCAN_VAR(RomBank); - - - if (nAction & ACB_WRITE) { - HD6309Open(0); - HD6309MapMemory(DrvMainROM + 0x10000 + RomBank, 0x4000, 0x7fff, MAP_ROM); - HD6309Close(); - } - } - - return DrvScan(nAction, pnMin); -} - -struct BurnDriver BurnDrvGhostb = { - "ghostb", NULL, NULL, NULL, "1987", - "The Real Ghostbusters (US 2 Players, revision 2)\0", NULL, "Data East USA", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, ghostbRomInfo, ghostbRomName, NULL, NULL, GhostbInputInfo, GhostbDIPInfo, - DrvInit, GhostbExit, DrvFrame, DrvDraw, GhostbScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// The Real Ghostbusters (US 2 Players) - -static struct BurnRomInfo ghostb2aRomDesc[] = { - { "dz01.1d", 0x08000, 0x7c5bb4b1, 1 }, // 0 maincpu - { "dz02.3d", 0x10000, 0x8e117541, 1 }, // 1 - { "dz03.4d", 0x10000, 0x5606a8f4, 1 }, // 2 - { "dz04.6d", 0x10000, 0xd09bad99, 1 }, // 3 - { "dz05.7d", 0x10000, 0x0315f691, 1 }, // 4 - - { "dz06.5f", 0x08000, 0x798f56df, 2 }, // 5 audiocpu - - { "dz00.16b", 0x08000, 0x992b4f31, 3 }, // 6 gfx1 - - { "dz15.14f", 0x10000, 0xa01a5fd9, 4 }, // 7 gfx2 - { "dz16.15f", 0x10000, 0x5a9a344a, 4 }, // 8 - { "dz12.9f", 0x10000, 0x817fae99, 4 }, // 9 - { "dz14.12f", 0x10000, 0x0abbf76d, 4 }, // 10 - { "dz11.8f", 0x10000, 0xa5e19c24, 4 }, // 11 - { "dz13.1f", 0x10000, 0x3e7c0405, 4 }, // 12 - { "dz17.17f", 0x10000, 0x40361b8b, 4 }, // 13 - { "dz18.18f", 0x10000, 0x8d219489, 4 }, // 14 - - { "dz07.12f", 0x10000, 0xe7455167, 5 }, // 15 gfx3 - { "dz08.14f", 0x10000, 0x32f9ddfe, 5 }, // 16 - { "dz09.15f", 0x10000, 0xbb6efc02, 5 }, // 17 - { "dz10.17f", 0x10000, 0x6ef9963b, 5 }, // 18 - - { "dz19a.10d", 0x00400, 0x47e1f83b, 6 }, // 19 proms - { "dz20a.11d", 0x00400, 0xd8fe2d99, 6 }, // 20 - - { "dz.1b", 0x01000, 0x18b7e1e6, 7 }, // 21 mcu -}; - -STD_ROM_PICK(ghostb2a) -STD_ROM_FN(ghostb2a) - -struct BurnDriver BurnDrvGhostb2a = { - "ghostb2a", "ghostb", NULL, NULL, "1987", - "The Real Ghostbusters (US 2 Players)\0", NULL, "Data East USA", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, ghostb2aRomInfo, ghostb2aRomName, NULL, NULL, GhostbInputInfo, GhostbDIPInfo, - DrvInit, GhostbExit, DrvFrame, DrvDraw, GhostbScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// The Real Ghostbusters (US 3 Players) - -static struct BurnRomInfo ghostb3RomDesc[] = { - { "dz01-3b.1d", 0x08000, 0xc8cc862a, 1 }, // 0 maincpu - { "dz02.3d", 0x10000, 0x8e117541, 1 }, // 1 - { "dz03.4d", 0x10000, 0x5606a8f4, 1 }, // 2 - { "dz04-1.6d", 0x10000, 0x3c3eb09f, 1 }, // 3 - { "dz05-1.7d", 0x10000, 0xb4971d33, 1 }, // 4 - - { "dz06.5f", 0x08000, 0x798f56df, 2 }, // 5 audiocpu - - { "dz00.16b", 0x08000, 0x992b4f31, 3 }, // 6 gfx1 - - { "dz15.14f", 0x10000, 0xa01a5fd9, 4 }, // 7 gfx2 - { "dz16.15f", 0x10000, 0x5a9a344a, 4 }, // 8 - { "dz12.9f", 0x10000, 0x817fae99, 4 }, // 9 - { "dz14.12f", 0x10000, 0x0abbf76d, 4 }, // 10 - { "dz11.8f", 0x10000, 0xa5e19c24, 4 }, // 11 - { "dz13.1f", 0x10000, 0x3e7c0405, 4 }, // 12 - { "dz17.17f", 0x10000, 0x40361b8b, 4 }, // 13 - { "dz18.18f", 0x10000, 0x8d219489, 4 }, // 14 - - { "dz07.12f", 0x10000, 0xe7455167, 5 }, // 15 gfx3 - { "dz08.14f", 0x10000, 0x32f9ddfe, 5 }, // 16 - { "dz09.15f", 0x10000, 0xbb6efc02, 5 }, // 17 - { "dz10.17f", 0x10000, 0x6ef9963b, 5 }, // 18 - - { "dz19a.10d", 0x00400, 0x47e1f83b, 6 }, // 19 proms - { "dz20a.11d", 0x00400, 0xd8fe2d99, 6 }, // 20 - - { "dz.1b", 0x01000, 0x18b7e1e6, 7 }, // 21 mcu -}; - -STD_ROM_PICK(ghostb3) -STD_ROM_FN(ghostb3) - -struct BurnDriver BurnDrvGhostb3 = { - "ghostb3", "ghostb", NULL, NULL, "1987", - "The Real Ghostbusters (US 3 Players)\0", NULL, "Data East USA", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, ghostb3RomInfo, ghostb3RomName, NULL, NULL, Ghostb3InputInfo, Ghostb3DIPInfo, - DrvInit, GhostbExit, DrvFrame, DrvDraw, GhostbScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - -// The Real Ghostbusters (US 3 Players) from caius - -static struct BurnRomInfo ghostb3aRomDesc[] = { - { "dz01-2.1d", 0x08000, 0x1b16890e, 1 }, // 0 maincpu - { "dz02-.3d", 0x10000, 0x8e117541, 1 }, // 1 - { "dz03-.4d", 0x10000, 0x5606a8f4, 1 }, // 2 - { "dz04-.6d", 0x10000, 0x490b4525, 1 }, // 3 - { "dz05-.7d", 0x10000, 0xb4971d33, 1 }, // 4 - - { "dz06.5f", 0x08000, 0x798f56df, 2 }, // 5 audiocpu - - { "dz00.16b", 0x08000, 0x992b4f31, 3 }, // 6 gfx1 - - { "dz15.14f", 0x10000, 0xa01a5fd9, 4 }, // 7 gfx2 - { "dz16.15f", 0x10000, 0x5a9a344a, 4 }, // 8 - { "dz12.9f", 0x10000, 0x817fae99, 4 }, // 9 - { "dz14.12f", 0x10000, 0x0abbf76d, 4 }, // 10 - { "dz11.8f", 0x10000, 0xa5e19c24, 4 }, // 11 - { "dz13.1f", 0x10000, 0x3e7c0405, 4 }, // 12 - { "dz17.17f", 0x10000, 0x40361b8b, 4 }, // 13 - { "dz18.18f", 0x10000, 0x8d219489, 4 }, // 14 - - { "dz07.12f", 0x10000, 0xe7455167, 5 }, // 15 gfx3 - { "dz08.14f", 0x10000, 0x32f9ddfe, 5 }, // 16 - { "dz09.15f", 0x10000, 0xbb6efc02, 5 }, // 17 - { "dz10.17f", 0x10000, 0x6ef9963b, 5 }, // 18 - - { "dz19a.10d", 0x00400, 0x47e1f83b, 6 }, // 19 proms - { "dz20a.11d", 0x00400, 0xd8fe2d99, 6 }, // 20 - - { "dz.1b", 0x01000, 0x18b7e1e6, 7 }, // 21 mcu -}; - -STD_ROM_PICK(ghostb3a) -STD_ROM_FN(ghostb3a) - -struct BurnDriverD BurnDrvGhostb3a = { - "ghostb3a", "ghostb", NULL, NULL, "1987", - "The Real Ghostbusters (US 3 Players, revision ?)\0", NULL, "Data East USA", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, ghostb3aRomInfo, ghostb3aRomName, NULL, NULL, GhostbInputInfo, GhostbDIPInfo, - DrvInit, GhostbExit, DrvFrame, DrvDraw, GhostbScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Meikyuu Hunter G (Japan, set 1) - -static struct BurnRomInfo meikyuhRomDesc[] = { - { "dw01-5.1d", 0x08000, 0x87610c39, 1 }, // 0 maincpu - { "dw02.3d", 0x10000, 0x40c9b0b8, 1 }, // 1 - { "dw03.4d", 0x10000, 0x5606a8f4, 1 }, // 2 - { "dw04.6d", 0x10000, 0x235c0c36, 1 }, // 3 - - { "dw05.5f", 0x08000, 0xc28c4d82, 2 }, // 4 audiocpu - - { "dw00.16b", 0x08000, 0x3d25f15c, 3 }, // 5 gfx1 - - { "dw14.14f", 0x10000, 0x9b0dbfa9, 4 }, // 6 gfx2 - { "dw15.15f", 0x10000, 0x95683fda, 4 }, // 7 - { "dw11.9f", 0x10000, 0x1b1fcca7, 4 }, // 8 - { "dw13.12f", 0x10000, 0xe7413056, 4 }, // 9 - { "dw10.8f", 0x10000, 0x57667546, 4 }, // 10 - { "dw12.1f", 0x10000, 0x4c548db8, 4 }, // 11 - { "dw16.17f", 0x10000, 0xe5bcf927, 4 }, // 12 - { "dw17.18f", 0x10000, 0x9e10f723, 4 }, // 13 - - { "dw06.12f", 0x10000, 0xb65e029d, 5 }, // 14 gfx3 - { "dw07.14f", 0x10000, 0x668d995d, 5 }, // 15 - { "dw08.15f", 0x10000, 0xbb2cf4a0, 5 }, // 16 - { "dw09.17f", 0x10000, 0x6a528d13, 5 }, // 17 - - { "dw18.9d", 0x00400, 0x75f1945f, 6 }, // 18 proms - { "dw19.10d", 0x00400, 0xcc16f3fa, 6 }, // 19 - - { "dw.1b", 0x01000, 0x28e9ced9, 7 }, // 20 mcu -}; - -STD_ROM_PICK(meikyuh) -STD_ROM_FN(meikyuh) - -struct BurnDriver BurnDrvMeikyuh = { - "meikyuh", "ghostb", NULL, NULL, "1987", - "Meikyuu Hunter G (Japan, set 1)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, meikyuhRomInfo, meikyuhRomName, NULL, NULL, GhostbInputInfo, GhostbDIPInfo, - DrvInit, GhostbExit, DrvFrame, DrvDraw, GhostbScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Meikyuu Hunter G (Japan, set 2) - -static struct BurnRomInfo meikyuhaRomDesc[] = { - { "27256.1d", 0x08000, 0xd5b5e8a2, 1 }, // 0 maincpu - { "24512.3d", 0x10000, 0x40c9b0b8, 1 }, // 1 - { "24512.4d", 0x10000, 0x5606a8f4, 1 }, // 2 - { "27512.6d", 0x10000, 0x8ca6055d, 1 }, // 3 - - { "27256.5f", 0x08000, 0xc28c4d82, 2 }, // 4 audiocpu - - { "27256.16b", 0x08000, 0x3d25f15c, 3 }, // 5 gfx1 - - { "92.6m", 0x10000, 0x9b0dbfa9, 4 }, // 6 gfx2 - { "93.6o", 0x10000, 0x95683fda, 4 }, // 7 - { "89.6i", 0x10000, 0x1b1fcca7, 4 }, // 8 - { "91.6l", 0x10000, 0xe7413056, 4 }, // 9 - { "88.6h", 0x10000, 0x57667546, 4 }, // 10 - { "90.6k", 0x10000, 0x4c548db8, 4 }, // 11 - { "94.6p", 0x10000, 0xe5bcf927, 4 }, // 12 - { "95.6r", 0x10000, 0x9e10f723, 4 }, // 13 - - { "27512.12f", 0x10000, 0xb65e029d, 5 }, // 14 gfx3 - { "27512.14f", 0x10000, 0x668d995d, 5 }, // 15 - { "27512.15f", 0x10000, 0x547fe4e2, 5 }, // 16 - { "27512.17f", 0x10000, 0x6a528d13, 5 }, // 17 - - { "dw18.9d", 0x00400, 0x75f1945f, 6 }, // 18 proms - { "dw19.10d", 0x00400, 0xcc16f3fa, 6 }, // 19 - - { "dw.1b", 0x01000, 0x28e9ced9, 7 }, // 20 mcu -}; - -STD_ROM_PICK(meikyuha) -STD_ROM_FN(meikyuha) - -struct BurnDriver BurnDrvMeikyuha = { - "meikyuha", "ghostb", NULL, NULL, "1987", - "Meikyuu Hunter G (Japan, set 2)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, meikyuhaRomInfo, meikyuhaRomName, NULL, NULL, GhostbInputInfo, GhostbDIPInfo, - DrvInit, GhostbExit, DrvFrame, DrvDraw, GhostbScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - - - - - - -static void m6809_bankswitch(INT32 data) -{ - RomBank = (data & 0x0f) * 0x4000; - - M6809MapMemory(DrvMainROM + 0x10000 + RomBank, 0x4000, 0x7fff, MAP_ROM); // bank -} - - - -void cobra_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3e00: - *soundlatch = data; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - M6502Run(500); - return; - - case 0x3c00: - m6809_bankswitch(data); - return; - - case 0x3c02: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - } - - if ((address & 0xffe0) == 0x3800) { - DrvPf0Ctrl[address & 0x1f] = data; - return; - } - - if ((address & 0xffe0) == 0x3a00) { - DrvPf1Ctrl[address & 0x1f] = data; - return; - } -} - -UINT8 cobra_main_read(UINT16 address) -{ - switch (address) - { - case 0x3800: - return DrvInputs[0]; - - case 0x3801: - return DrvInputs[1]; - - case 0x3802: - return DrvDips[0]; - - case 0x3803: - return DrvDips[1]; - - case 0x3a00: - return (DrvInputs[2] & 0x7f) | vblank; - } - - return 0; -} - -static INT32 CobraDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - BurnYM2203Reset(); - BurnYM3812Reset(); - - i8751_return = 0; - i8751_value = 0; - - return 0; -} - - -static INT32 CobraGfxDecode() -{ - // 0, 0x40, 0x80, 0xc0 for offs - - INT32 Plane0[2] = { 0x4000*8,0x0000*8 }; - INT32 Plane1[4] = { 0x60000*8,0x40000*8,0x20000*8,0x00000*8 }; - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 XOffs1[16]= { 16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8),0,1,2,3,4,5,6,7 }; - INT32 YOffs0[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 2, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 CobraInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "cobracomb")) { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x20000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x40000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x60000, 16, 1)) return 1; - - memcpy (DrvM6502OPS + 0x8000, DrvM6502ROM + 0x8000, 0x8000); - } else if (!strcmp(BurnDrvGetTextA(DRV_NAME), "cobracomjb")) { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x20000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x40000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x60000, 16, 1)) return 1; - - memcpy (DrvM6502OPS + 0x8000, DrvM6502ROM + 0x8000, 0x8000); - } else{ - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x20000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - memcpy (DrvGfxROM2 + 0x40000, DrvGfxROM2 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 10, 1)) return 1; - memcpy (DrvGfxROM2 + 0x60000, DrvGfxROM2 + 0x28000, 0x08000); - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x40000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x60000, 14, 1)) return 1; - - memcpy (DrvM6502OPS + 0x8000, DrvM6502ROM + 0x8000, 0x8000); - } - - CobraGfxDecode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvMainRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvPf0RAM, 0x0800, 0x0fff, MAP_RAM); - M6809MapMemory(DrvPf1RAM, 0x1000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x2000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvPalRAM, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvMainROM + 0x10000, 0x4000, 0x7fff, MAP_ROM); - M6809MapMemory(DrvMainROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(cobra_main_write); - M6809SetReadHandler(cobra_main_read); - M6809Close(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x05ff, MAP_RAM); -// m6502MapMemory(DrvM6502ROM + 0x8000, 0x8000, 0xffff, MAP_READ); -// m6502MapMemory(DrvM6502OPS + 0x8000, 0x8000, 0xffff, MAP_FETCH); - M6502MapMemory(DrvM6502ROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6502SetReadHandler(ghostb_sound_read); - M6502SetWriteHandler(ghostb_sound_write); - M6502Close(); - - BurnSetRefreshRate(58.00); - - BurnYM2203Init(1, 1500000, NULL, DrvYM2203M6809SynchroniseStream, DrvYM2203M6809GetTime, 0); - BurnTimerAttachM6809(2000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.53, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.53, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.53, BURN_SND_ROUTE_BOTH); - - BurnYM3812Init(1, 3000000, &DrvYM3812FMIRQHandler, &DrvYM3812SynchroniseStream, 1); - BurnTimerAttachM6502YM3812(1500000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - CobraDoReset(); - - return 0; -} - -static void draw_cobra_txt_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 code = DrvVidRAM[offs * 2 + 1] | (DrvVidRAM[offs * 2 + 0] << 8); - INT32 color = (code >> 13); - - code &= 0x3ff; - if (code == 0) continue; // ok? - - sy -= 8; - if (sy < 0 || sy >= nScreenHeight) continue; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites2(INT32 colmask, INT32 priority, INT32 color_offset) -{ - for (INT32 offs = 0;offs < 0x800;offs += 8) - { - INT32 y =DrvSprBuf[offs+1]+(DrvSprBuf[offs]<<8); - if ((y&0x8000) == 0) continue; - INT32 x = DrvSprBuf[offs+5]+(DrvSprBuf[offs+4]<<8); - INT32 colour = (x >> 12); - INT32 flash=x&0x800; - if (flash && (GetCurrentFrame() & 1)) continue; - - if (priority==1 && (colour&4)) continue; - if (priority==2 && !(colour&4)) continue; - - colour &= colmask; - colour += color_offset; - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi = (1 << ((y & 0x1800) >> 11)) - 1; - - INT32 sprite = DrvSprBuf[offs+3]+(DrvSprBuf[offs+2]<<8); - sprite &= 0x0fff; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 256) x -= 512; - if (y >= 256) y -= 512; - x = 240 - x; - y = 240 - y; - - INT32 mult, inc; - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (*flipscreen) - { - y=240-y; - x=240-x; - if (fx) fx=0; else fx=1; - if (fy) fy=0; else fy=1; - mult=16; - } - else mult=-16; - - y -= 8; - - while (multi >= 0) - { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, (sprite - multi * inc) & 0xfff, x, y + mult * multi, colour, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, (sprite - multi * inc) & 0xfff, x, y + mult * multi, colour, 4, 0, 0, DrvGfxROM1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, (sprite - multi * inc) & 0xfff, x, y + mult * multi, colour, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, (sprite - multi * inc) & 0xfff, x, y + mult * multi, colour, 4, 0, 0, DrvGfxROM1); - } - } - - multi--; - } - } -} - -static INT32 CobraDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - for (INT32 i = 0; i < 0x200; i+=2) { - INT32 d = (DrvPalRAM[i + 0] << 8) | DrvPalRAM[i + 1]; - r = (d >> 0) & 0x0f; - g = (d >> 4) & 0x0f; - b = (d >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i/2] = BurnHighCol(r, g, b, 0); - } - } - - DrvPf0Ctrl[0] &= ~0x04; // disable line scrolling since this game - DrvPf1Ctrl[1] &= ~0x04; // doesn't have ram for the offsets - - draw_bg_layer(DrvPf0RAM, DrvPf0Ctrl, DrvGfxROM2, 0x80, 0x03, 0xfff, 0, 0); - draw_sprites2(0x03, 1, 0x04); - draw_bg_layer(DrvPf1RAM, DrvPf1Ctrl, DrvGfxROM3, 0xc0, 0x03, 0xfff, 1, 0); - draw_sprites2(0x03, 2, 0x04); - draw_cobra_txt_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 CobraFrame() -{ - if (DrvReset) { - CobraDoReset(); - } - - M6809NewFrame(); - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nInterleave = 32; - INT32 nCyclesTotal[2] = { 2000000 / 58, 1500000 / 58 }; -// INT32 nCyclesDone[2] = { 0, 0 }; - - M6502Open(0); - M6809Open(0); - - vblank = 0x80; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 1) vblank = 0x80; - if (i == 31) { - vblank = 0; - M6809SetIRQLine(0x20 /*NMI*/, CPU_IRQSTATUS_AUTO); - } - - BurnTimerUpdate((i + 1) * (nCyclesTotal[0] / nInterleave)); - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - M6502Close(); - - if (pBurnDraw) { - CobraDraw(); - } - - return 0; -} - -// Cobra-Command (World revision 5) - -static struct BurnRomInfo cobracomRomDesc[] = { - { "el11-5.bin", 0x08000, 0xaf0a8b05, 1 }, // 0 maincpu - { "el12-4.bin", 0x10000, 0x7a44ef38, 1 }, // 1 - { "el13.bin", 0x10000, 0x04505acb, 1 }, // 2 - - { "el10-4.bin", 0x08000, 0xedfad118, 2 }, // 3 audiocpu - - { "el14.bin", 0x08000, 0x47246177, 3 }, // 4 gfx1 - - { "el00-4.bin", 0x10000, 0x122da2a8, 4 }, // 5 gfx2 - { "el01-4.bin", 0x10000, 0x27bf705b, 4 }, // 6 - { "el02-4.bin", 0x10000, 0xc86fede6, 4 }, // 7 - { "el03-4.bin", 0x10000, 0x1d8a855b, 4 }, // 8 - - { "el08.bin", 0x10000, 0xcb0dcf4c, 5 }, // 9 gfx4 - { "el09.bin", 0x10000, 0x1fae5be7, 5 }, // 10 - - { "el05.bin", 0x10000, 0x1c4f6033, 6 }, // 11 gfx3 - { "el06.bin", 0x10000, 0xd24ba794, 6 }, // 12 - { "el04.bin", 0x10000, 0xd80a49ce, 6 }, // 13 - { "el07.bin", 0x10000, 0x6d771fc3, 6 }, // 14 -}; - -STD_ROM_PICK(cobracom) -STD_ROM_FN(cobracom) - -static INT32 CobraExit() -{ - M6809Exit(); - BurnYM3812Exit(); - return DrvExit(); -} - -static INT32 CobraScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - BurnYM3812Scan(nAction, pnMin); - SCAN_VAR(RomBank); - - if (nAction & ACB_WRITE) { - M6809Open(0); - M6809MapMemory(DrvMainROM + 0x10000 + RomBank, 0x4000, 0x7fff, MAP_ROM); - M6809Close(); - } - } - - return DrvScan(nAction, pnMin); -} - -struct BurnDriver BurnDrvCobracom = { - "cobracom", NULL, NULL, NULL, "1988", - "Cobra-Command (World revision 5)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, cobracomRomInfo, cobracomRomName, NULL, NULL, CobracomInputInfo, CobracomDIPInfo, - CobraInit, CobraExit, CobraFrame, CobraDraw, CobraScan, &DrvRecalc, 0x100, - 256, 240, 4, 3 -}; - - -// Cobra-Command (Japan) - -static struct BurnRomInfo cobracmjRomDesc[] = { - { "eh-11.rom", 0x08000, 0x868637e1, 1 }, // 0 maincpu - { "eh-12.rom", 0x10000, 0x7c878a83, 1 }, // 1 - { "el13.bin", 0x10000, 0x04505acb, 1 }, // 2 - - { "eh-10.rom", 0x08000, 0x62ca5e89, 2 }, // 3 audiocpu - - { "el14.bin", 0x08000, 0x47246177, 3 }, // 4 gfx1 - - { "eh-00.rom", 0x10000, 0xd96b6797, 4 }, // 5 gfx2 - { "eh-01.rom", 0x10000, 0x3fef9c02, 4 }, // 6 - { "eh-02.rom", 0x10000, 0xbfae6c34, 4 }, // 7 - { "eh-03.rom", 0x10000, 0xd56790f8, 4 }, // 8 - - { "el08.bin", 0x10000, 0xcb0dcf4c, 5 }, // 9 gfx4 - { "el09.bin", 0x10000, 0x1fae5be7, 5 }, // 10 - - { "el05.bin", 0x10000, 0x1c4f6033, 6 }, // 11 gfx3 - { "el06.bin", 0x10000, 0xd24ba794, 6 }, // 12 - { "el04.bin", 0x10000, 0xd80a49ce, 6 }, // 13 - { "el07.bin", 0x10000, 0x6d771fc3, 6 }, // 14 -}; - -STD_ROM_PICK(cobracmj) -STD_ROM_FN(cobracmj) - -struct BurnDriver BurnDrvCobracmj = { - "cobracomj", "cobracom", NULL, NULL, "1988", - "Cobra-Command (Japan)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, cobracmjRomInfo, cobracmjRomName, NULL, NULL, CobracomInputInfo, CobracomDIPInfo, - CobraInit, CobraExit, CobraFrame, CobraDraw, CobraScan, &DrvRecalc, 0x100, - 256, 240, 4, 3 -}; - - -// Cobra-Command (Japan?, set 2) - -static struct BurnRomInfo cobracmjaRomDesc[] = { - { "el-11.rom", 0x08000, 0xc6a102e3, 1 }, // 0 maincpu - { "el-12.rom", 0x10000, 0x72b2dab4, 1 }, // 1 - { "el-13.rom", 0x10000, 0x04505acb, 1 }, // 2 - - { "el-10.rom", 0x08000, 0x62ca5e89, 2 }, // 3 audiocpu - - { "el-14.rom", 0x08000, 0x47246177, 3 }, // 4 gfx1 - - { "eh-00.rom", 0x10000, 0xd96b6797, 4 }, // 5 gfx2 - { "eh-01.rom", 0x10000, 0x3fef9c02, 4 }, // 6 - { "eh-02.rom", 0x10000, 0xbfae6c34, 4 }, // 7 - { "eh-03.rom", 0x10000, 0xd56790f8, 4 }, // 8 - - { "el-08.rom", 0x10000, 0xcb0dcf4c, 5 }, // 9 gfx4 - { "el-09.rom", 0x10000, 0x1fae5be7, 5 }, // 10 - - { "el-05.rom", 0x10000, 0x1c4f6033, 6 }, // 11 gfx3 - { "el-06.rom", 0x10000, 0xd24ba794, 6 }, // 12 - { "el-04.rom", 0x10000, 0xd80a49ce, 6 }, // 13 - { "el-07.rom", 0x10000, 0x6d771fc3, 6 }, // 14 -}; - -STD_ROM_PICK(cobracmja) -STD_ROM_FN(cobracmja) - -struct BurnDriver BurnDrvCobracmja = { - "cobracomja", "cobracom", NULL, NULL, "1988", - "Cobra-Command (Japan?, set 2)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, cobracmjaRomInfo, cobracmjaRomName, NULL, NULL, CobracomInputInfo, CobracomDIPInfo, - CobraInit, CobraExit, CobraFrame, CobraDraw, CobraScan, &DrvRecalc, 0x100, - 256, 240, 4, 3 -}; - - -// Cobra-Command (Italian bootleg) -// f205v id 835 - -static struct BurnRomInfo cobracombRomDesc[] = { - { "a1.bin", 0x08000, 0xbb38b64c, 1 }, // 0 maincpu - { "a2.bin", 0x10000, 0x7c878a83, 1 }, // 1 - { "a3.bin", 0x10000, 0x04505acb, 1 }, // 2 - - { "a5.bin", 0x08000, 0x62ca5e89, 2 }, // 3 audiocpu - - { "a4.bin", 0x08000, 0x47246177, 3 }, // 4 gfx1 - - { "5.bin", 0x10000, 0xd96b6797, 4 }, // 5 gfx2 - { "6.bin", 0x10000, 0x3fef9c02, 4 }, // 6 - { "7.bin", 0x10000, 0xbfae6c34, 4 }, // 7 - { "8.bin", 0x10000, 0xeaeb700e, 4 }, // 8 - - { "a9.bin", 0x08000, 0xc991298f, 5 }, // 9 gfx4 - { "a8.bin", 0x08000, 0xf5e267e5, 5 }, // 10 - { "a7.bin", 0x08000, 0x6bcc5982, 5 }, // 11 - { "a6.bin", 0x08000, 0xc90443b5, 5 }, // 12 - - { "1.bin", 0x10000, 0x1c4f6033, 6 }, // 13 gfx3 - { "2.bin", 0x10000, 0xd24ba794, 6 }, // 14 - { "3.bin", 0x10000, 0xd80a49ce, 6 }, // 15 - { "4.bin", 0x10000, 0x6d771fc3, 6 }, // 16 -}; - -STD_ROM_PICK(cobracomb) -STD_ROM_FN(cobracomb) - -struct BurnDriver BurnDrvCobracomb = { - "cobracomb", "cobracom", NULL, NULL, "1988", - "Cobra-Command (Italian bootleg)\0", NULL, "bootleg", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, cobracombRomInfo, cobracombRomName, NULL, NULL, CobracomInputInfo, CobracomDIPInfo, - CobraInit, CobraExit, CobraFrame, CobraDraw, CobraScan, &DrvRecalc, 0x100, - 256, 240, 4, 3 -}; - -// Cobra-Command (Japan, bootleg) -// f205v id 375 -// This PCB has been manufactured in Italy, roms are the same as "Cobra-Command (Japan)" already in MAME, but divided into different size eprom chips // - -static struct BurnRomInfo cobracomjbRomDesc[] = { - { "4.bin", 0x08000, 0x868637e1, 1 }, // 0 maincpu - { "3.bin", 0x10000, 0x7c878a83, 1 }, // 1 - { "2.bin", 0x10000, 0x04505acb, 1 }, // 2 - - { "5.bin", 0x08000, 0x62ca5e89, 2 }, // 3 audiocpu - - { "1.bin", 0x08000, 0x47246177, 3 }, // 4 gfx1 - - { "13.bin", 0x10000, 0xd96b6797, 4 }, // 5 gfx2 - { "12.bin", 0x10000, 0x3fef9c02, 4 }, // 6 - { "11.bin", 0x10000, 0xbfae6c34, 4 }, // 7 - { "10.bin", 0x10000, 0xd56790f8, 4 }, // 8 - - { "6.bin", 0x08000, 0xc991298f, 5 }, // 9 gfx4 - { "7.bin", 0x08000, 0xf5e267e5, 5 }, // 10 - { "8.bin", 0x08000, 0x6bcc5982, 5 }, // 11 - { "9.bin", 0x08000, 0xc90443b5, 5 }, // 12 - - { "17.bin", 0x10000, 0x1c4f6033, 6 }, // 13 gfx3 - { "16.bin", 0x10000, 0xd24ba794, 6 }, // 14 - { "15.bin", 0x10000, 0xd80a49ce, 6 }, // 15 - { "14.bin", 0x10000, 0x6d771fc3, 6 }, // 16 -}; - -STD_ROM_PICK(cobracomjb) -STD_ROM_FN(cobracomjb) - -struct BurnDriver BurnDrvCobracomjb = { - "cobracomjb", "cobracom", NULL, NULL, "1988", - "Cobra-Command (Japan, bootleg)\0", NULL, "bootleg", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_HORSHOOT, 0, - NULL, cobracomjbRomInfo, cobracomjbRomName, NULL, NULL, CobracomInputInfo, CobracomDIPInfo, - CobraInit, CobraExit, CobraFrame, CobraDraw, CobraScan, &DrvRecalc, 0x100, - 256, 240, 4, 3 -}; - -static void srdarwin_i8751_w(INT32 offset, INT32 data) -{ - static INT32 coins, latch; - i8751_return = 0; - - switch (offset) - { - case 0: /* High byte */ - i8751_value = (i8751_value & 0xff) | (data << 8); - break; - - case 1: /* Low byte */ - i8751_value = (i8751_value & 0xff00) | data; - break; - } - - if (i8751_value == 0x0000) {i8751_return = 0; coins = 0;} - if (i8751_value == 0x3063) i8751_return = 0x9c; /* Protection - Japanese version */ - if (i8751_value == 0x306b) i8751_return = 0x94; /* Protection - World version */ - if ((i8751_value & 0xff00) == 0x4000) i8751_return = i8751_value; /* Coinage settings */ - if (i8751_value == 0x5000) i8751_return =((coins / 10) << 4) | (coins % 10); /* Coin request */ - if (i8751_value == 0x6000) {i8751_value = -1; coins--; } /* Coin clear */ - - if ((DrvInputs[4] & 1) == 1) latch = 1; - if ((DrvInputs[4] & 1) != 1 && latch) {coins++; latch = 0;} - - if (i8751_value == 0x8000) i8751_return = 0xf580 + 0; /* Boss #1: Snake + Bees */ - if (i8751_value == 0x8001) i8751_return = 0xf580 + 30; /* Boss #2: 4 Corners */ - if (i8751_value == 0x8002) i8751_return = 0xf580 + 26; /* Boss #3: Clock */ - if (i8751_value == 0x8003) i8751_return = 0xf580 + 2; /* Boss #4: Pyramid */ - if (i8751_value == 0x8004) i8751_return = 0xf580 + 6; /* Boss #5: Snake + Head Combo */ - if (i8751_value == 0x8005) i8751_return = 0xf580 + 24; /* Boss #6: LED Panels */ - if (i8751_value == 0x8006) i8751_return = 0xf580 + 28; /* Boss #7: Dragon */ - if (i8751_value == 0x8007) i8751_return = 0xf580 + 32; /* Boss #8: Teleport */ - if (i8751_value == 0x8008) i8751_return = 0xf580 + 38; /* Boss #9: Octopus (Pincer) */ - if (i8751_value == 0x8009) i8751_return = 0xf580 + 40; /* Boss #10: Bird */ - if (i8751_value == 0x800a) i8751_return = 0xf580 + 42; /* End Game(bad address?) */ -} - -void srdarwin_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1800: - case 0x1801: - srdarwin_i8751_w(address & 1, data); - return; - - case 0x1802: - i8751_value = 0; - return; - - case 0x1804: - memcpy (DrvSprBuf, DrvSprRAM, 0x200); - return; - - case 0x1805: - m6809_bankswitch(data >> 5); - DrvPf0Ctrl[0x10] = data & 0x01; - return; - - case 0x1806: - DrvPf0Ctrl[0x11] = data; - return; - - case 0x2000: - *soundlatch = data; -// m6502SetIRQ(M6502_NMI); - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - - case 0x2001: - *flipscreen = data; - return; - } -} - -UINT8 srdarwin_main_read(UINT16 address) -{ - switch (address) - { - case 0x2000: - return i8751_return >> 8; - - case 0x2001: - return i8751_return & 0xff; - - case 0x3800: - return DrvDips[0]; - - case 0x3801: - return DrvInputs[0]; - - case 0x3802: - return (DrvInputs[1] & ~0x40) | vblank; - - case 0x3803: - return DrvDips[1]; - } - - return 0; -} - -static INT32 SrdarwinGfxDecode() -{ - INT32 Plane0[2] = { 0, 4 }; - INT32 Plane1[4] = { 0x10000*8,0x20000*8,0x00000*8 }; - INT32 Plane2[4] = { 0x4000*8, 0x4000*8+4, 0, 4 }; - - INT32 XOffs0[8] = { 0x2000*8+0, 0x2000*8+1, 0x2000*8+2, 0x2000*8+3, 0, 1, 2, 3 }; - INT32 XOffs1[16] = { 16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8),0,1,2,3,4,5,6,7 }; - INT32 XOffs2[16] = { 0, 1, 2, 3, 1024*8*8+0, 1024*8*8+1, 1024*8*8+2, 1024*8*8+3, - 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+1024*8*8+0, 16*8+1024*8*8+1, 16*8+1024*8*8+2, 16*8+1024*8*8+3 }; - - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 2, 8, 8, Plane0, XOffs0, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x0800, 3, 16, 16, Plane1, XOffs1, YOffs, 0x100, tmp, DrvGfxROM1); - - for (INT32 i = 0; i < 4; i++) { - memcpy (tmp, DrvGfxROM2 + i * 0x10000, 0x08000); - GfxDecode(0x0100, 4, 16, 16, Plane2, XOffs2, YOffs, 0x100, tmp, DrvGfxROM2 + i * 0x10000); - } - - BurnFree (tmp); - - return 0; -} - - -static INT32 SrdarwinInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x20000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - memcpy (DrvMainROM + 0x8000, DrvMainROM + 0x28000, 0x08000); - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x28000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 10, 1)) return 1; - memcpy (DrvGfxROM2 + 0x00000, DrvGfxROM3 + 0x00000, 0x04000); - memcpy (DrvGfxROM2 + 0x10000, DrvGfxROM3 + 0x04000, 0x04000); - memcpy (DrvGfxROM2 + 0x20000, DrvGfxROM3 + 0x08000, 0x04000); - memcpy (DrvGfxROM2 + 0x30000, DrvGfxROM3 + 0x0c000, 0x04000); - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 11, 1)) return 1; - memcpy (DrvGfxROM2 + 0x04000, DrvGfxROM3 + 0x00000, 0x04000); - memcpy (DrvGfxROM2 + 0x14000, DrvGfxROM3 + 0x04000, 0x04000); - memcpy (DrvGfxROM2 + 0x24000, DrvGfxROM3 + 0x08000, 0x04000); - memcpy (DrvGfxROM2 + 0x34000, DrvGfxROM3 + 0x0c000, 0x04000); - - memcpy (DrvM6502OPS + 0x8000, DrvM6502ROM + 0x8000, 0x8000); - - Deco222Decode(); - SrdarwinGfxDecode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvMainRAM, 0x0000, 0x05ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x0600, 0x07ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x0800, 0x0fff, MAP_RAM); - M6809MapMemory(DrvMainRAM + 0x1000, 0x1000, 0x13ff, MAP_RAM); - M6809MapMemory(DrvPf0RAM, 0x1400, 0x17ff, MAP_RAM); - M6809MapMemory(DrvPalRAM, 0x2800, 0x28ff, MAP_RAM); - M6809MapMemory(DrvPalRAM + 0x100, 0x3000, 0x30ff, MAP_RAM); - M6809MapMemory(DrvMainROM + 0x10000, 0x4000, 0x7fff, MAP_ROM); - M6809MapMemory(DrvMainROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(srdarwin_main_write); - M6809SetReadHandler(srdarwin_main_read); - M6809Close(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x05ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM + 0x8000, 0x8000, 0xffff, MAP_READ); - M6502MapMemory(DrvM6502OPS + 0x8000, 0x8000, 0xffff, MAP_FETCH); - M6502SetReadHandler(ghostb_sound_read); - M6502SetWriteHandler(ghostb_sound_write); - M6502Close(); - - BurnSetRefreshRate(58.00); - - BurnYM2203Init(1, 1500000, NULL, DrvYM2203M6809SynchroniseStream, DrvYM2203M6809GetTime, 0); - BurnTimerAttachM6809(2000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.23, BURN_SND_ROUTE_BOTH); - - BurnYM3812Init(1, 3000000, &DrvYM3812FMIRQHandler, &DrvYM3812SynchroniseStream, 1); - BurnTimerAttachM6502YM3812(1500000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - CobraDoReset(); - - return 0; -} - -static void Srdarwin_draw_layer(INT32 layer) -{ - INT32 scrollx = (DrvPf0Ctrl[0x10] << 8) | DrvPf0Ctrl[0x11]; - - UINT16 layer0t[4] = { 0x0000, 0xff00, 0xff00, 0xffff }; - UINT16 layer1t[4] = { 0xffff, 0x00ff, 0x00ff, 0x0000 }; - UINT16 *layert = layer ? layer1t : layer0t; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sy -= 8; - if (sy >= nScreenHeight) continue; - sx -= scrollx; - if (sx < -15) sx += 512; - if (sx >= nScreenWidth) continue; - - INT32 code = DrvPf0RAM[offs * 2 + 1] | (DrvPf0RAM[offs * 2 + 0] << 8); - INT32 color = (code >> 12) & 3; - - { - code &= 0x3ff; - color <<= 4; - - INT32 t = layert[color>>4]; - UINT8 *src = DrvGfxROM2 + (code << 8); - UINT16 *dst; - - for (INT32 y = 0; y < 16; y++, sy++, src+=16) - { - if (sy < 0 || sy >= nScreenHeight) continue; - - dst = pTransDraw + sy * nScreenWidth; - - INT32 xx = sx; - - for (INT32 x = 0; x < 16; x++, xx++) - { - INT32 pxl = src[x]; - - if (t & (1 << pxl)) continue; - if (xx < 0 || xx >= nScreenWidth) continue; - - dst[xx] = pxl | color; - } - } - } - } -} - -static void srdarwin_txt_draw() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - sy -= 8; - if (sy < 0 || sy >= nScreenHeight) continue; - - INT32 code = DrvVidRAM[offs]; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy, 0, 2, 0, 0x80, DrvGfxROM0); - } -} - -static void srdarwin_draw_sprites(INT32 pri) -{ - for (INT32 offs = 0;offs < 0x200;offs += 4) - { - INT32 multi,fx,sx,sy,sy2,code,color; - - color = (DrvSprBuf[offs+1] & 0x03) + ((DrvSprBuf[offs+1] & 0x08) >> 1); - if (pri==0 && color!=0) continue; - if (pri==1 && color==0) continue; - - code = DrvSprBuf[offs+3] + ( ( DrvSprBuf[offs+1] & 0xe0 ) << 3 ); - if (!code) continue; - - sy = DrvSprBuf[offs]; - if (sy == 0xf8) continue; - - sx = (241 - DrvSprBuf[offs+2]); - - fx = DrvSprBuf[offs+1] & 0x04; - multi = DrvSprBuf[offs+1] & 0x10; - - if (*flipscreen) - { - sy=240-sy; - sx=240-sx; - if (fx) fx=0; else fx=1; - sy2=sy-16; - } - else sy2=sy+16; - - sy -= 8; - sy2 -= 8; - - if (*flipscreen) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM1); - } - } - - if (multi) { - code++; - if (*flipscreen) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy2, color, 3, 0, 0x40, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy2, color, 3, 0, 0x40, DrvGfxROM1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy2, color, 3, 0, 0x40, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy2, color, 3, 0, 0x40, DrvGfxROM1); - } - } - } - } -} - -static INT32 SrdarwinDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - for (INT32 i = 0; i < 0x100; i++) { - INT32 d = (DrvPalRAM[i + 0]) | (DrvPalRAM[i + 0x100] << 8); - r = (d >> 0) & 0x0f; - g = (d >> 4) & 0x0f; - b = (d >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - } - BurnTransferClear(); - if (nBurnLayer & 1) Srdarwin_draw_layer(0); - if (nSpriteEnable & 1) srdarwin_draw_sprites(0); - if (nBurnLayer & 2) Srdarwin_draw_layer(1); - if (nSpriteEnable & 2) srdarwin_draw_sprites(1); - - if (nBurnLayer & 4) srdarwin_txt_draw(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 SrdarwinFrame() -{ - if (DrvReset) { - CobraDoReset(); - } - - M6809NewFrame(); - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 4); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[4] = DrvJoy5[0] & 1; - } - - INT32 nInterleave = 32; - INT32 nCyclesTotal[2] = { 2000000 / 58, 1500000 / 58 }; -// INT32 nCyclesDone[2] = { 0, 0 }; - - M6502Open(0); - M6809Open(0); - - vblank = 0x40; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 1) vblank = 0x40; - if (i == 31) { - vblank = 0; - M6809SetIRQLine(0x20 /*NMI*/, CPU_IRQSTATUS_AUTO); - } - - BurnTimerUpdate((i + 1) * (nCyclesTotal[0] / nInterleave)); - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - M6502Close(); - - if (pBurnDraw) { - SrdarwinDraw(); - } - - return 0; -} - - -// Super Real Darwin (World) - -static struct BurnRomInfo srdarwinRomDesc[] = { - { "dy01-e.b14", 0x10000, 0x176e9299, 1 }, // 0 maincpu - { "dy00.b16", 0x10000, 0x2bf6b461, 1 }, // 1 - - { "dy04.d7", 0x08000, 0x2ae3591c, 2 }, // 2 audiocpu - - { "dy05.b6", 0x04000, 0x8780e8a3, 3 }, // 3 gfx1 - - { "dy07.h16", 0x08000, 0x97eaba60, 4 }, // 4 gfx2 - { "dy06.h14", 0x08000, 0xc279541b, 4 }, // 5 - { "dy09.k13", 0x08000, 0xd30d1745, 4 }, // 6 - { "dy08.k11", 0x08000, 0x71d645fd, 4 }, // 7 - { "dy11.k16", 0x08000, 0xfd9ccc5b, 4 }, // 8 - { "dy10.k14", 0x08000, 0x88770ab8, 4 }, // 9 - - { "dy03.b4", 0x10000, 0x44f2a4f9, 5 }, // 10 gfx3 - { "dy02.b5", 0x10000, 0x522d9a9e, 5 }, // 11 - - { "id8751h.mcu", 0x01000, 0x11cd6ca4, 6 }, // 12 mcu - - { "dy12.f4", 0x00100, 0xebfaaed9, 7 }, // 13 proms -}; - -STD_ROM_PICK(srdarwin) -STD_ROM_FN(srdarwin) - -struct BurnDriver BurnDrvSrdarwin = { - "srdarwin", NULL, NULL, NULL, "1987", - "Super Real Darwin (World)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, srdarwinRomInfo, srdarwinRomName, NULL, NULL, SrdarwinInputInfo, SrdarwinDIPInfo, - SrdarwinInit, CobraExit, SrdarwinFrame, SrdarwinDraw, CobraScan, &DrvRecalc, 0x100, - 240, 256, 3, 4 -}; - - -// Super Real Darwin (Japan) - -static struct BurnRomInfo srdarwnjRomDesc[] = { - { "dy_01.rom", 0x10000, 0x1eeee4ff, 1 }, // 0 maincpu - { "dy00.b16", 0x10000, 0x2bf6b461, 1 }, // 1 - - { "dy04.d7", 0x08000, 0x2ae3591c, 2 }, // 2 audiocpu - - { "dy05.b6", 0x04000, 0x8780e8a3, 3 }, // 3 gfx1 - - { "dy07.h16", 0x08000, 0x97eaba60, 4 }, // 4 gfx2 - { "dy06.h14", 0x08000, 0xc279541b, 4 }, // 5 - { "dy09.k13", 0x08000, 0xd30d1745, 4 }, // 6 - { "dy08.k11", 0x08000, 0x71d645fd, 4 }, // 7 - { "dy11.k16", 0x08000, 0xfd9ccc5b, 4 }, // 8 - { "dy10.k14", 0x08000, 0x88770ab8, 4 }, // 9 - - { "dy03.b4", 0x10000, 0x44f2a4f9, 5 }, // 10 gfx3 - { "dy02.b5", 0x10000, 0x522d9a9e, 5 }, // 11 - - { "id8751h.mcu", 0x01000, 0x11cd6ca4, 6 }, // 12 mcu - - { "dy12.f4", 0x00100, 0xebfaaed9, 7 }, // 13 proms -}; - -STD_ROM_PICK(srdarwnj) -STD_ROM_FN(srdarwnj) - -struct BurnDriver BurnDrvSrdarwnj = { - "srdarwinj", "srdarwin", NULL, NULL, "1987", - "Super Real Darwin (Japan)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, srdarwnjRomInfo, srdarwnjRomName, NULL, NULL, SrdarwinInputInfo, SrdarwinDIPInfo, - SrdarwinInit, CobraExit, SrdarwinFrame, SrdarwinDraw, CobraScan, &DrvRecalc, 0x100, - 240, 256, 3, 4 -}; - - - - - -static void gondo_i8751_write(INT32 offset, UINT8 data) -{ - static INT32 coin1, coin2, latch,snd; - i8751_return = 0; - - UINT8 coin = ~DrvInputs[4] ^ 3; - - switch (offset) - { - case 0: - i8751_value = (i8751_value & 0xff) | (data << 8); - if (*interrupt_enable) HD6309SetIRQLine(0, CPU_IRQSTATUS_AUTO); - break; - - case 1: - i8751_value = (i8751_value & 0xff00) | data; - break; - } - - /* Coins are controlled by the i8751 */ - if ((coin & 3) == 3) latch = 1; - if ((coin & 1) != 1 && latch) {coin1++; snd = 1; latch = 0; } - if ((coin & 2) != 2 && latch) {coin2++; snd = 1; latch = 0; } - - if (i8751_value == 0x0000) {i8751_return = 0x000; coin1 = coin2 = snd = 0;} - if (i8751_value == 0x038a) i8751_return = 0x375; /* Makyou Senshi ID */ - if (i8751_value == 0x038b) i8751_return = 0x374; /* Gondomania ID */ - if ((i8751_value >> 8) == 0x04) i8751_return = 0x40f; /* Coinage settings (Not supported) */ - if ((i8751_value >> 8) == 0x05) {i8751_return = 0x500 | ((coin1 / 10) << 4) | (coin1 % 10); } /* Coin 1 */ - if ((i8751_value >> 8) == 0x06 && coin1 && !offset) {i8751_return = 0x600; coin1--; } /* Coin 1 clear */ - if ((i8751_value >> 8) == 0x07) {i8751_return = 0x700 | ((coin2 / 10) << 4) | (coin2 % 10); } /* Coin 2 */ - if ((i8751_value >> 8) == 0x08 && coin2 && !offset) {i8751_return = 0x800; coin2--; } /* Coin 2 clear */ - - if ((i8751_value >> 8) == 0x0a) {i8751_return = 0xa00 | snd; if (snd) snd = 0; } -} - -static void garyoret_i8751_write(INT32 offset, UINT8 data) -{ - static INT32 coin1, coin2, latch; - i8751_return = 0; - - UINT8 coin = ~DrvInputs[4] ^ 3; - - switch (offset) - { - case 0: /* High byte */ - i8751_value = (i8751_value & 0xff) | (data << 8); - break; - - case 1: /* Low byte */ - i8751_value = (i8751_value & 0xff00) | data; - break; - } - - /* Coins are controlled by the i8751 */ - if ((coin & 3) == 3) latch=1; - if ((coin & 1) != 1 && latch) {coin1++; latch = 0;} - if ((coin & 2) != 2 && latch) {coin2++; latch = 0;} - - /* Work out return values */ - if ((i8751_value >> 8) == 0x00) {i8751_return = 0; coin1 = coin2 = 0;} - if ((i8751_value >> 8) == 0x01) i8751_return = 0x59a; /* ID */ - if ((i8751_value >> 8) == 0x04) i8751_return = i8751_value; /* Coinage settings (Not supported) */ - if ((i8751_value >> 8) == 0x05) {i8751_return = 0x00 | ((coin1 / 10) << 4) | (coin1 % 10); } /* Coin 1 */ - if ((i8751_value >> 8) == 0x06 && coin1 && !offset) {i8751_return = 0x600; coin1--; } /* Coin 1 clear */ -} - -void gondo_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3810: - *soundlatch = data; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - - case 0x3818: - DrvPf0Ctrl[0x11] = data; - return; - - case 0x3820: - DrvPf0Ctrl[0x13] = data; - return; - - case 0x3828: - DrvPf0Ctrl[0x10] = (data >> 0) & 1; - DrvPf0Ctrl[0x12] = (data >> 1) & 1; - return; - - case 0x3830: - bankswitch(data >> 4); - *interrupt_enable = data & 1; - *nmi_enable = data & 2; - *flipscreen = data & 8; - return; - - case 0x3838: - case 0x3839: - garyoret_i8751_write(address & 1, data); - return; - - case 0x383a: - case 0x383b: - gondo_i8751_write(address & 1, data); - return; - } -} - -UINT8 gondo_main_read(UINT16 address) -{ - switch (address) - { - case 0x3800: - return DrvDips[0]; - - case 0x3801: - return DrvDips[1]; - - case 0x380a: return 0xff; - case 0x380b: return 0x7f; -// return 0xff; // gondo_player_1_r - - case 0x380c: return 0xff; - case 0x380d: return 0x7f; -// return 0xff; // gondo_player_2_r - - case 0x380e: - return (DrvInputs[3] & 0x7f) | vblank; - - case 0x380f: - return DrvInputs[2]; - - case 0x3838: - bprintf(PRINT_NORMAL, _T("3838\n")); // doesn't read these - so coins don't work - return i8751_return >> 8; - - case 0x3839: - bprintf(PRINT_NORMAL, _T("3839\n")); // doesn't read these - so coins don't work - return i8751_return & 0xff; - } - - return 0; -} - -UINT8 garyoret_main_read(UINT16 address) -{ - switch (address) - { - case 0x3800: - return DrvDips[0]; - - case 0x3801: - return DrvDips[1]; - - case 0x380a: - return (DrvInputs[1] & 0x7f) | vblank; - - case 0x380b: - return DrvInputs[0]; - - case 0x383a: - return i8751_return >> 8; - - case 0x383b: - return i8751_return & 0xff; - } - - return 0; -} - -void gondo_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0800: - case 0x0801: - case 0x2000: - case 0x2001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0x1000: - case 0x1001: - case 0x4000: - case 0x4001: - BurnYM3526Write(address & 1, data); - return; - } -} - -static INT32 GondoDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - BurnYM2203Reset(); - BurnYM3526Reset(); - - i8751_return = 0; - i8751_value = 0; - - return 0; -} - - - -static INT32 GondoGfxDecode() -{ - INT32 Plane0[3] = { 0x6000*8,0x4000*8,0x2000*8 }; - INT32 Plane1[4] = { 0x60000*8,0x40000*8,0x20000*8,0x00000*8 }; - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 XOffs1[16]= {16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8),0,1,2,3,4,5,6,7 }; - INT32 YOffs0[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 3, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 GondoInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "garyoret")) { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x30000, 3, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x40000, 4, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x70000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 15, 1)) return 1; - memcpy (DrvGfxROM2 + 0x00000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x10000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 16, 1)) return 1; - memcpy (DrvGfxROM2 + 0x08000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x18000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 17, 1)) return 1; - memcpy (DrvGfxROM2 + 0x20000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x30000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 18, 1)) return 1; - memcpy (DrvGfxROM2 + 0x28000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x38000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 19, 1)) return 1; - memcpy (DrvGfxROM2 + 0x40000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x50000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 20, 1)) return 1; - memcpy (DrvGfxROM2 + 0x48000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x58000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 21, 1)) return 1; - memcpy (DrvGfxROM2 + 0x60000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x70000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 22, 1)) return 1; - memcpy (DrvGfxROM2 + 0x68000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x78000, DrvGfxROM3 + 0x08000, 0x08000); - } else { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x30000, 3, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x70000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 14, 1)) return 1; - memcpy (DrvGfxROM2 + 0x00000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x10000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 16, 1)) return 1; - memcpy (DrvGfxROM2 + 0x20000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x30000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM2 + 0x28000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 18, 1)) return 1; - memcpy (DrvGfxROM2 + 0x40000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x50000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM2 + 0x48000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 20, 1)) return 1; - memcpy (DrvGfxROM2 + 0x60000, DrvGfxROM3 + 0x00000, 0x08000); - memcpy (DrvGfxROM2 + 0x70000, DrvGfxROM3 + 0x08000, 0x08000); - if (BurnLoadRom(DrvGfxROM2 + 0x68000, 21, 1)) return 1; - } - - GondoGfxDecode(); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvMainRAM, 0x0000, 0x17ff, MAP_RAM); - HD6309MapMemory(DrvVidRAM, 0x1800, 0x1fff, MAP_RAM); - HD6309MapMemory(DrvPf0RAM, 0x2000, 0x27ff, MAP_RAM); - HD6309MapMemory(DrvPalRAM, 0x2800, 0x2fff, MAP_RAM);//xxxxBBBBGGGGRRRR_split - HD6309MapMemory(DrvSprRAM, 0x3000, 0x37ff, MAP_RAM); - HD6309MapMemory(DrvMainROM + 0x10000, 0x4000, 0x7fff, MAP_ROM); // bank - HD6309MapMemory(DrvMainROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(gondo_main_write); - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "garyoret")) { - HD6309SetReadHandler(garyoret_main_read); - } else { - HD6309SetReadHandler(gondo_main_read); - } - HD6309Close(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x05ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6502SetReadHandler(ghostb_sound_read); - M6502SetWriteHandler(gondo_sound_write); - M6502Close(); - - BurnSetRefreshRate(58.00); - - BurnYM3526Init(3000000, &DrvYM3812FMIRQHandler, &DrvYM3812SynchroniseStream, 0); - BurnTimerAttachM6502YM3526(1500000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 1500000, NULL, DrvYM2203SynchroniseStream, DrvYM2203GetTime, 1); - BurnTimerAttachHD6309(12000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.23, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - GondoDoReset(); - - return 0; -} - -static INT32 GondoExit() -{ - HD6309Exit(); - BurnYM3526Exit(); - return DrvExit(); -} - -static void gondo_draw_txt_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= 8; - if (sy < 0 || sy >= nScreenWidth) continue; - - INT32 code = DrvVidRAM[offs * 2 + 1] | (DrvVidRAM[offs * 2 + 0] << 8); - INT32 color = (code >> 12) & 7; - - Render8x8Tile_Mask_Clip(pTransDraw, code & 0xfff, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } -} - -static void gondo_draw_layer(INT32 priority, INT32 layer) -{ - INT32 scrolly = ((DrvPf0Ctrl[0x12] << 8) + DrvPf0Ctrl[0x13] + 8) & 0x1ff; - INT32 scrollx = ((DrvPf0Ctrl[0x10] << 8) | DrvPf0Ctrl[0x11]); - - UINT16 trans = layer ? 0x00ff : 0xff00; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scrollx; - if (sx < -15) sx+=512; - sy -= scrolly; - if (sy < -15) sy+=512; - - if (sx >= nScreenWidth || sy >= nScreenWidth) continue; - - INT32 code = DrvPf0RAM[offs * 2 + 1] | (DrvPf0RAM[offs * 2 + 0] << 8); - INT32 color = code >> 12; - - if (priority && color < 8) continue; - - { - code &= 0xfff; - color <<= 4; - color |= 0x300; - - UINT8 *src = DrvGfxROM2 + (code << 8); - UINT16 *dst; - - for (INT32 y = 0; y < 16; y++, src+=16, sy++) - { - if (sy < 0 || sy >= nScreenHeight) continue; - - dst = pTransDraw + sy * nScreenWidth; - - INT32 xx = sx; - for (INT32 x = 0; x < 16; x++, xx++) - { - if (xx < 0 || xx >= nScreenWidth) continue; - - INT32 pxl = src[x]; - - if (trans & (1 << pxl)) continue; - - dst[xx] = pxl | color; - } - } - } - } -} - -static void GondoPaletteRecalc() -{ - UINT8 r,g,b; - for (INT32 i = 0; i < 0x400; i++) { - INT32 d = (DrvPalRAM[i + 0]) | (DrvPalRAM[i + 0x400] << 8); - r = (d >> 0) & 0x0f; - g = (d >> 4) & 0x0f; - b = (d >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 GondoDraw() -{ - if (DrvRecalc) { - GondoPaletteRecalc(); - } - - gondo_draw_layer(0, 1); - draw_sprites1(2); - gondo_draw_layer(0, 0); - draw_sprites1(1); - gondo_draw_txt_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 GaryoretDraw() -{ - if (DrvRecalc) { - GondoPaletteRecalc(); - } - - gondo_draw_layer(0, 1); - gondo_draw_layer(0, 0); - draw_sprites1(0); - gondo_draw_layer(1, 1); - gondo_draw_layer(1, 0); - - gondo_draw_txt_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 GondoFrame() -{ - if (DrvReset) { - GondoDoReset(); - } - - HD6309NewFrame(); - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nInterleave = 272; - INT32 nCyclesTotal[2] = { 12000000 / 58, 1500000 / 58 }; - - M6502Open(0); - HD6309Open(0); - - //vblank = 0x00; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 7) vblank = 0; - - if (i == 270) { - vblank = 0x80; - if (*nmi_enable) HD6309SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - } - - BurnTimerUpdate((i + 1) * (nCyclesTotal[0] / nInterleave)); - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - HD6309Close(); - M6502Close(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - - return 0; -} - -static INT32 GondoScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - HD6309Scan(nAction); - BurnYM3526Scan(nAction, pnMin); - SCAN_VAR(RomBank); - - if (nAction & ACB_WRITE) { - HD6309Open(0); - HD6309MapMemory(DrvMainROM + 0x10000 + RomBank, 0x4000, 0x7fff, MAP_ROM); - HD6309Close(); - } - } - - return DrvScan(nAction, pnMin); -} - - -// Gondomania (US) - -static struct BurnRomInfo gondoRomDesc[] = { - { "dt-00.256", 0x08000, 0xa8cf9118, 1 }, // 0 maincpu - { "dt-01.512", 0x10000, 0xc39bb877, 1 }, // 1 - { "dt-02.512", 0x10000, 0xbb5e674b, 1 }, // 2 - { "dt-03.512", 0x10000, 0x99c32b13, 1 }, // 3 - - { "dt-05.256", 0x08000, 0xec08aa29, 2 }, // 4 audiocpu - - { "dt-14.256", 0x08000, 0x4bef16e1, 3 }, // 5 gfx1 - - { "dt-19.512", 0x10000, 0xda2abe4b, 4 }, // 6 gfx2 - { "dt-20.256", 0x08000, 0x42d01002, 4 }, // 7 - { "dt-16.512", 0x10000, 0xe9955d8f, 4 }, // 8 - { "dt-18.256", 0x08000, 0xc0c5df1c, 4 }, // 9 - { "dt-15.512", 0x10000, 0xa54b2eb6, 4 }, // 10 - { "dt-17.256", 0x08000, 0x3bbcff0d, 4 }, // 11 - { "dt-21.512", 0x10000, 0x1c5f682d, 4 }, // 12 - { "dt-22.256", 0x08000, 0xc1876a5f, 4 }, // 13 - - { "dt-08.512", 0x10000, 0xaec483f5, 5 }, // 14 gfx3 - { "dt-09.256", 0x08000, 0x446f0ce0, 5 }, // 15 - { "dt-06.512", 0x10000, 0x3fe1527f, 5 }, // 16 - { "dt-07.256", 0x08000, 0x61f9bce5, 5 }, // 17 - { "dt-12.512", 0x10000, 0x1a72ca8d, 5 }, // 18 - { "dt-13.256", 0x08000, 0xccb81aec, 5 }, // 19 - { "dt-10.512", 0x10000, 0xcfcfc9ed, 5 }, // 20 - { "dt-11.256", 0x08000, 0x53e9cf17, 5 }, // 21 - - { "dt-a.b1", 0x01000, 0x03abceeb, 6 }, // 22 mcu - - { "ds-23.b10", 0x00400, 0xdcbfec4e, 7 }, // 23 proms -}; - -STD_ROM_PICK(gondo) -STD_ROM_FN(gondo) - -struct BurnDriverD BurnDrvGondo = { - "gondo", NULL, NULL, NULL, "1987", - "Gondomania (US)\0", "Broken inputs", "Data East USA", "DEC8", - NULL, NULL, NULL, NULL, - BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, gondoRomInfo, gondoRomName, NULL, NULL, GondoInputInfo, GondoDIPInfo, - GondoInit, GondoExit, GondoFrame, GondoDraw, GondoScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Makyou Senshi (Japan) - -static struct BurnRomInfo makyosenRomDesc[] = { - { "ds00.f3", 0x08000, 0x33bb16fe, 1 }, // 0 maincpu - { "dt-01.512", 0x10000, 0xc39bb877, 1 }, // 1 - { "ds02.f6", 0x10000, 0x925307a4, 1 }, // 2 - { "ds03.f7", 0x10000, 0x9c0fcbf6, 1 }, // 3 - - { "ds05.h5", 0x08000, 0xe6e28ca9, 2 }, // 4 audiocpu - - { "ds14.b18", 0x08000, 0x00cbe9c8, 3 }, // 5 gfx1 - - { "dt-19.512", 0x10000, 0xda2abe4b, 4 }, // 6 gfx2 - { "ds20.f15", 0x08000, 0x0eef7f56, 4 }, // 7 - { "dt-16.512", 0x10000, 0xe9955d8f, 4 }, // 8 - { "ds18.f12", 0x08000, 0x2b2d1468, 4 }, // 9 - { "dt-15.512", 0x10000, 0xa54b2eb6, 4 }, // 10 - { "ds17.f11", 0x08000, 0x75ae349a, 4 }, // 11 - { "dt-21.512", 0x10000, 0x1c5f682d, 4 }, // 12 - { "ds22.f18", 0x08000, 0xc8ffb148, 4 }, // 13 - - { "dt-08.512", 0x10000, 0xaec483f5, 5 }, // 14 gfx3 - { "dt-09.256", 0x08000, 0x446f0ce0, 5 }, // 15 - { "dt-06.512", 0x10000, 0x3fe1527f, 5 }, // 16 - { "dt-07.256", 0x08000, 0x61f9bce5, 5 }, // 17 - { "dt-12.512", 0x10000, 0x1a72ca8d, 5 }, // 18 - { "dt-13.256", 0x08000, 0xccb81aec, 5 }, // 19 - { "dt-10.512", 0x10000, 0xcfcfc9ed, 5 }, // 20 - { "dt-11.256", 0x08000, 0x53e9cf17, 5 }, // 21 - - { "ds-a.b1", 0x01000, 0xf61b77cf, 6 }, // 22 mcu - - { "ds-23.b10", 0x00400, 0xdcbfec4e, 7 }, // 23 proms - - { "pal16r4nc.u10", 0x00104, 0x00000000, 8 | BRF_NODUMP }, // 24 plds - { "pal16r4nc.g11", 0x00104, 0x00000000, 8 | BRF_NODUMP }, // 25 - { "pal16r4nc.s1", 0x00104, 0x00000000, 8 | BRF_NODUMP }, // 26 -}; - -STD_ROM_PICK(makyosen) -STD_ROM_FN(makyosen) - -struct BurnDriverD BurnDrvMakyosen = { - "makyosen", "gondo", NULL, NULL, "1987", - "Makyou Senshi (Japan)\0", "Broken inputs", "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, makyosenRomInfo, makyosenRomName, NULL, NULL, GondoInputInfo, GondoDIPInfo, - GondoInit, GondoExit, GondoFrame, GondoDraw, GondoScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - - -// Garyo Retsuden (Japan) - -static struct BurnRomInfo garyoretRomDesc[] = { - { "dv00", 0x08000, 0xcceaaf05, 1 }, // 0 maincpu - { "dv01", 0x10000, 0xc33fc18a, 1 }, // 1 - { "dv02", 0x10000, 0xf9e26ce7, 1 }, // 2 - { "dv03", 0x10000, 0x55d8d699, 1 }, // 3 - { "dv04", 0x10000, 0xed3d00ee, 1 }, // 4 - - { "dv05", 0x08000, 0xc97c347f, 2 }, // 5 audiocpu - - { "dv14", 0x08000, 0xfb2bc581, 3 }, // 6 gfx1 - - { "dv22", 0x10000, 0xcef0367e, 4 }, // 7 gfx2 - { "dv21", 0x08000, 0x90042fb7, 4 }, // 8 - { "dv20", 0x10000, 0x451a2d8c, 4 }, // 9 - { "dv19", 0x08000, 0x14e1475b, 4 }, // 10 - { "dv18", 0x10000, 0x7043bead, 4 }, // 11 - { "dv17", 0x08000, 0x28f449d7, 4 }, // 12 - { "dv16", 0x10000, 0x37e4971e, 4 }, // 13 - { "dv15", 0x08000, 0xca41b6ac, 4 }, // 14 - - { "dv08", 0x10000, 0x89c13e15, 5 }, // 15 gfx3 - { "dv09", 0x10000, 0x6a345a23, 5 }, // 16 - { "dv06", 0x10000, 0x1eb52a20, 5 }, // 17 - { "dv07", 0x10000, 0xe7346ef8, 5 }, // 18 - { "dv12", 0x10000, 0x46ba5af4, 5 }, // 19 - { "dv13", 0x10000, 0xa7af6dfd, 5 }, // 20 - { "dv10", 0x10000, 0x68b6d75c, 5 }, // 21 - { "dv11", 0x10000, 0xb5948aee, 5 }, // 22 - - { "dv__.mcu", 0x01000, 0x37cacec6, 6 | BRF_OPT }, // 23 mcu -}; - -STD_ROM_PICK(garyoret) -STD_ROM_FN(garyoret) - -struct BurnDriver BurnDrvGaryoret = { - "garyoret", NULL, NULL, NULL, "1987", - "Garyo Retsuden (Japan)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, garyoretRomInfo, garyoretRomName, NULL, NULL, GaryoretInputInfo, GaryoretDIPInfo, - GondoInit, GondoExit, GondoFrame, GaryoretDraw, GondoScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - - - - - - -UINT8 oscar_main_read(UINT16 address) -{ - switch (address) - { - case 0x3c00: // in0 - return DrvInputs[0]; - - case 0x3c01: - return DrvInputs[1]; - - case 0x3c02: - return (DrvInputs[2] & 0x7f) | vblank; - - case 0x3c03: - return DrvDips[0]; - - case 0x3c04: - return DrvDips[1]; - } - - return 0; -} - -void oscar_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3c80: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x3d00: - bankswitch(data); - return; - - case 0x3d80: - *soundlatch = data; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - - case 0x3e80: - HD6309Close(); - HD6309Open(1); - HD6309SetIRQLine(0, CPU_IRQSTATUS_ACK); - HD6309Close(); - HD6309Open(0); - return; - - case 0x3e81: - HD6309SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0x3e82: - HD6309SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x3e83: - HD6309Close(); - HD6309Open(1); - HD6309SetIRQLine(0, CPU_IRQSTATUS_NONE); - HD6309Close(); - HD6309Open(0); - return; - } - - if ((address & 0xffe0) == 0x3c00) { - DrvPf0Ctrl[address & 0x1f] = data; - return; - } -} - - -void oscar_sub_write(UINT16 address, UINT8 ) -{ - switch (address) - { - case 0x3e80: - HD6309SetIRQLine(0, CPU_IRQSTATUS_ACK); - HD6309Close(); - HD6309Open(0); - return; - - case 0x3e81: - HD6309Close(); - HD6309Open(0); - HD6309SetIRQLine(0, CPU_IRQSTATUS_NONE); - HD6309Close(); - HD6309Open(1); - return; - - case 0x3e82: - HD6309Close(); - HD6309Open(0); - HD6309SetIRQLine(0, CPU_IRQSTATUS_ACK); - HD6309Close(); - HD6309Open(1); - return; - - case 0x3e83: - HD6309SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static INT32 OscarDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - HD6309Open(1); - HD6309Reset(); - HD6309Close(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - BurnYM2203Reset(); - BurnYM3526Reset(); - - i8751_return = 0; - i8751_value = 0; - - return 0; -} - -static INT32 OscarGfxDecode() -{ - INT32 Plane0[3] = { 0x3000*8,0x2000*8,0x1000*8 }; - INT32 Plane1[4] = { 0x60000*8,0x40000*8,0x20000*8,0x00000*8 }; - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 XOffs1[16]= {16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8),0,1,2,3,4,5,6,7 }; - INT32 YOffs0[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 3, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 OscarInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvSubROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 12, 1)) return 1; - - Deco222Decode(); - OscarGfxDecode(); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvMainRAM, 0x0000, 0x1fff, MAP_RAM); // all shared? - HD6309MapMemory(DrvVidRAM, 0x2000, 0x28ff, MAP_RAM); - HD6309MapMemory(DrvPf0RAM, 0x2800, 0x2fff, MAP_RAM); - HD6309MapMemory(DrvSprRAM, 0x3000, 0x37ff, MAP_RAM); - HD6309MapMemory(DrvPalRAM, 0x3800, 0x3bff, MAP_RAM); // xxxxBBBBGGGGRRRR_be_w - HD6309MapMemory(DrvMainROM + 0x10000, 0x4000, 0x7fff, MAP_ROM); // bank - HD6309MapMemory(DrvMainROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(oscar_main_write); - HD6309SetReadHandler(oscar_main_read); - HD6309Close(); - - HD6309Init(1); - HD6309Open(1); - HD6309MapMemory(DrvMainRAM, 0x0000, 0x0eff, MAP_RAM); // all shared? AM_RANGE(0x0f00, 0x0fff) AM_RAM not? - HD6309MapMemory(DrvPalRAM + 0x400, 0x0f00, 0x0fff, MAP_RAM); // not really pal... - HD6309MapMemory(DrvMainRAM + 0x1000, 0x1000, 0x1fff, MAP_RAM); // all shared? AM_RANGE(0x0f00, 0x0fff) AM_RAM not? - HD6309MapMemory(DrvSubROM + 0x04000, 0x4000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(oscar_sub_write); // 0x3e80, 0x3e83 used... - HD6309Close(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x05ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM + 0x8000, 0x8000, 0xffff, MAP_READ); - M6502MapMemory(DrvM6502OPS + 0x8000, 0x8000, 0xffff, MAP_FETCH); - M6502SetReadHandler(ghostb_sound_read); - M6502SetWriteHandler(gondo_sound_write); - M6502Close(); - - BurnSetRefreshRate(58.00); - - BurnYM3526Init(3000000, &DrvYM3812FMIRQHandler, &DrvYM3812SynchroniseStream, 0); - BurnTimerAttachM6502YM3526(1500000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 1500000, NULL, DrvYM2203SynchroniseStream6000000, DrvYM2203GetTime6000000, 1); - BurnTimerAttachHD6309(6000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.23, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - OscarDoReset(); - - return 0; -} - -static void oscar_draw_txt_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= 8; - if (sy < 0 || sy >= nScreenHeight) continue; - - INT32 code = (DrvVidRAM[offs * 2 + 1]) | (DrvVidRAM[offs * 2 + 0] << 8); - INT32 color = code >> 14; - - Render8x8Tile_Mask(pTransDraw, code & 0x3ff, sx, sy, color, 3, 0, 0x100, DrvGfxROM0); - } -} - -static INT32 OscarDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - for (INT32 i = 0; i < 0x400; i+=2) { - INT32 d = (DrvPalRAM[i + 0] << 8) | DrvPalRAM[i + 1]; - r = (d >> 0) & 0x0f; - g = (d >> 4) & 0x0f; - b = (d >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i/2] = BurnHighCol(r, g, b, 0); - } - } - - draw_bg_layer(DrvPf0RAM, DrvPf0Ctrl, DrvGfxROM2, 0x180, 0x07, 0x7ff, 0x0000, 0); - draw_sprites2(0xf, 0, 0); - draw_bg_layer(DrvPf0RAM, DrvPf0Ctrl, DrvGfxROM2, 0x180, 0x07, 0x7ff, 0x00ff, 0x08); - oscar_draw_txt_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 OscarFrame() -{ - if (DrvReset) { - OscarDoReset(); - } - - HD6309NewFrame(); - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 6000000 / 58, 6000000 / 58, 1500000 / 58 }; - //INT32 nCyclesDone[3] = { 0, 0, 0 }; - memset(nCyclesDone, 0, sizeof(nCyclesDone)); - - M6502Open(0); - - vblank = 0x80; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 8) vblank = 0; - - HD6309Open(0); - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - nCyclesDone[0] += HD6309Run(nSegment - nCyclesDone[0]); - - if (i == 247) { - static INT32 latch = 1; - if ((DrvInputs[2] & 7) == 7) latch = 1; - if ((DrvInputs[2] & 7) != 7 && latch) { - latch = 0; - HD6309SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - } - vblank = 0x80; - } - - HD6309Close(); - - HD6309Open(1); - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - HD6309Close(); - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[2] / nInterleave)); - } - - HD6309Open(1); - - BurnTimerEndFrame(nCyclesTotal[1]); - BurnTimerEndFrameYM3526(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - M6502Close(); - HD6309Close(); - - if (pBurnDraw) { - OscarDraw(); - } - - return 0; -} - - -// Psycho-Nics Oscar (World revision 0) - -static struct BurnRomInfo oscarRomDesc[] = { - { "du10", 0x08000, 0x120040d8, 1 }, // 0 maincpu - { "ed09", 0x10000, 0xe2d4bba9, 1 }, // 1 - - { "du11", 0x10000, 0xff45c440, 2 }, // 2 sub - - { "ed12", 0x08000, 0x432031c5, 3 }, // 3 audiocpu - - { "ed08", 0x04000, 0x308ac264, 4 }, // 4 gfx1 - - { "ed04", 0x10000, 0x416a791b, 5 }, // 5 gfx2 - { "ed05", 0x10000, 0xfcdba431, 5 }, // 6 - { "ed06", 0x10000, 0x7d50bebc, 5 }, // 7 - { "ed07", 0x10000, 0x8fdf0fa5, 5 }, // 8 - - { "ed01", 0x10000, 0xd3a58e9e, 6 }, // 9 gfx3 - { "ed03", 0x10000, 0x4fc4fb0f, 6 }, // 10 - { "ed00", 0x10000, 0xac201f2d, 6 }, // 11 - { "ed02", 0x10000, 0x7ddc5651, 6 }, // 12 - - { "id8751h.mcu", 0x01000, 0x00000000, 7 | BRF_NODUMP }, // 13 mcu -}; - -STD_ROM_PICK(oscar) -STD_ROM_FN(oscar) - -struct BurnDriver BurnDrvOscar = { - "oscar", NULL, NULL, NULL, "1988", - "Psycho-Nics Oscar (World revision 0)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, oscarRomInfo, oscarRomName, NULL, NULL, OscarInputInfo, OscarDIPInfo, - OscarInit, GondoExit, OscarFrame, OscarDraw, GondoScan, &DrvRecalc, 0x200, - 256, 240, 4, 3 -}; - - -// Psycho-Nics Oscar (US) - -static struct BurnRomInfo oscaruRomDesc[] = { - { "ed10", 0x08000, 0xf9b0d4d4, 1 }, // 0 maincpu - { "ed09", 0x10000, 0xe2d4bba9, 1 }, // 1 - - { "ed11", 0x10000, 0x10e5d919, 2 }, // 2 sub - - { "ed12", 0x08000, 0x432031c5, 3 }, // 3 audiocpu - - { "ed08", 0x04000, 0x308ac264, 4 }, // 4 gfx1 - - { "ed04", 0x10000, 0x416a791b, 5 }, // 5 gfx2 - { "ed05", 0x10000, 0xfcdba431, 5 }, // 6 - { "ed06", 0x10000, 0x7d50bebc, 5 }, // 7 - { "ed07", 0x10000, 0x8fdf0fa5, 5 }, // 8 - - { "ed01", 0x10000, 0xd3a58e9e, 6 }, // 9 gfx3 - { "ed03", 0x10000, 0x4fc4fb0f, 6 }, // 10 - { "ed00", 0x10000, 0xac201f2d, 6 }, // 11 - { "ed02", 0x10000, 0x7ddc5651, 6 }, // 12 - - { "id8751h.mcu", 0x01000, 0x00000000, 7 | BRF_NODUMP }, // 13 mcu - - { "du-13.bin", 0x00200, 0xbea1f87e, 8 }, // 14 proms -}; - -STD_ROM_PICK(oscaru) -STD_ROM_FN(oscaru) - -struct BurnDriver BurnDrvOscaru = { - "oscaru", "oscar", NULL, NULL, "1987", - "Psycho-Nics Oscar (US)\0", NULL, "Data East USA", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, oscaruRomInfo, oscaruRomName, NULL, NULL, OscarInputInfo, OscaruDIPInfo, - OscarInit, GondoExit, OscarFrame, OscarDraw, GondoScan, &DrvRecalc, 0x200, - 256, 240, 4, 3 -}; - - -// Psycho-Nics Oscar (Japan revision 1) - -static struct BurnRomInfo oscarj1RomDesc[] = { - { "du10-1", 0x08000, 0x4ebc9f7a, 1 }, // 0 maincpu - { "ed09", 0x10000, 0xe2d4bba9, 1 }, // 1 - - { "du11", 0x10000, 0xff45c440, 2 }, // 2 sub - - { "ed12", 0x08000, 0x432031c5, 3 }, // 3 audiocpu - - { "ed08", 0x04000, 0x308ac264, 4 }, // 4 gfx1 - - { "ed04", 0x10000, 0x416a791b, 5 }, // 5 gfx2 - { "ed05", 0x10000, 0xfcdba431, 5 }, // 6 - { "ed06", 0x10000, 0x7d50bebc, 5 }, // 7 - { "ed07", 0x10000, 0x8fdf0fa5, 5 }, // 8 - - { "ed01", 0x10000, 0xd3a58e9e, 6 }, // 9 gfx3 - { "ed03", 0x10000, 0x4fc4fb0f, 6 }, // 10 - { "ed00", 0x10000, 0xac201f2d, 6 }, // 11 - { "ed02", 0x10000, 0x7ddc5651, 6 }, // 12 - - { "id8751h.mcu", 0x01000, 0x00000000, 7 | BRF_NODUMP }, // 13 mcu - - { "du-13.bin", 0x00200, 0xbea1f87e, 8 }, // 14 proms -}; - -STD_ROM_PICK(oscarj1) -STD_ROM_FN(oscarj1) - -struct BurnDriver BurnDrvOscarj1 = { - "oscarj1", "oscar", NULL, NULL, "1987", - "Psycho-Nics Oscar (Japan revision 1)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, oscarj1RomInfo, oscarj1RomName, NULL, NULL, OscarInputInfo, OscaruDIPInfo, - OscarInit, GondoExit, OscarFrame, OscarDraw, GondoScan, &DrvRecalc, 0x200, - 256, 240, 4, 3 -}; - - -// Psycho-Nics Oscar (Japan revision 2) - -static struct BurnRomInfo oscarj2RomDesc[] = { - { "du10-2", 0x08000, 0x114e898d, 1 }, // 0 maincpu - { "ed09", 0x10000, 0xe2d4bba9, 1 }, // 1 - - { "du11", 0x10000, 0xff45c440, 2 }, // 2 sub - - { "ed12", 0x08000, 0x432031c5, 3 }, // 3 audiocpu - - { "ed08", 0x04000, 0x308ac264, 4 }, // 4 gfx1 - - { "ed04", 0x10000, 0x416a791b, 5 }, // 5 gfx2 - { "ed05", 0x10000, 0xfcdba431, 5 }, // 6 - { "ed06", 0x10000, 0x7d50bebc, 5 }, // 7 - { "ed07", 0x10000, 0x8fdf0fa5, 5 }, // 8 - - { "ed01", 0x10000, 0xd3a58e9e, 6 }, // 9 gfx3 - { "ed03", 0x10000, 0x4fc4fb0f, 6 }, // 10 - { "ed00", 0x10000, 0xac201f2d, 6 }, // 11 - { "ed02", 0x10000, 0x7ddc5651, 6 }, // 12 - - { "id8751h.mcu", 0x01000, 0x00000000, 7 | BRF_NODUMP }, // 13 mcu - - { "du-13.bin", 0x00200, 0xbea1f87e, 8 }, // 14 proms -}; - -STD_ROM_PICK(oscarj2) -STD_ROM_FN(oscarj2) - -struct BurnDriver BurnDrvOscarj2 = { - "oscarj2", "oscar", NULL, NULL, "1987", - "Psycho-Nics Oscar (Japan revision 2)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, oscarj2RomInfo, oscarj2RomName, NULL, NULL, OscarInputInfo, OscaruDIPInfo, - OscarInit, GondoExit, OscarFrame, OscarDraw, GondoScan, &DrvRecalc, 0x200, - 256, 240, 4, 3 -}; - - - - - - -static void lastmiss_i8751_write(INT32 offset, INT32 data) -{ - static INT32 coin, latch = 0, snd; - i8751_return = 0; - - INT32 coininp = DrvInputs[2] & 3; //(~DrvInputs[2]) & 3; - - switch (offset) - { - case 0: - i8751_value = (i8751_value & 0xff) | (data << 8); - M6809SetIRQLine(1, CPU_IRQSTATUS_AUTO); /* Signal main cpu */ - break; - - case 1: - i8751_value = (i8751_value & 0xff00) | data; - break; - } - - if (offset == 0) - { - if (coininp == 3 && !latch) latch = 1; - if (coininp != 3 && latch) {coin++; latch = 0; snd = 0x400; i8751_return = 0x400; return;} - if (i8751_value == 0x007a) i8751_return = 0x0185; /* Japan ID code */ - if (i8751_value == 0x007b) i8751_return = 0x0184; /* USA ID code */ - if (i8751_value == 0x0001) {coin = snd = 0;}//??? - if (i8751_value == 0x0000) {i8751_return = 0x0184;}//??? - if (i8751_value == 0x0401) i8751_return = 0x0184; //??? - if ((i8751_value >> 8) == 0x01) i8751_return = 0x0184; /* Coinage setup */ - if ((i8751_value >> 8) == 0x02) {i8751_return = snd | ((coin / 10) << 4) | (coin % 10); snd = 0;} /* Coin return */ - if ((i8751_value >> 8) == 0x03 && coin) {i8751_return = 0; coin--; } /* Coin clear */ - } -} - -static void shackled_i8751_write(INT32 offset, INT32 data) -{ - static INT32 coin1, coin2, latch = 0; - i8751_return = 0; - - INT32 coininp = DrvInputs[2] & 3; - - switch (offset) - { - case 0: /* High byte */ - i8751_value = (i8751_value & 0xff) | (data << 8); - M6809SetIRQLine(1, CPU_IRQSTATUS_AUTO); /* Signal main cpu */ - break; - case 1: /* Low byte */ - i8751_value = (i8751_value & 0xff00) | data; - break; - } - - /* Coins are controlled by the i8751 */ - if (!latch) {latch = 1; coin1 = coin2 = 0;} - if ((coininp & 1) != 1 && latch) {coin1 = 1; latch = 0;} - if ((coininp & 2) != 2 && latch) {coin2 = 1; latch = 0;} - - if (i8751_value == 0x0050) i8751_return = 0; /* Breywood ID */ - if (i8751_value == 0x0051) i8751_return = 0; /* Shackled ID */ - if (i8751_value == 0x0102) i8751_return = 0; /* ?? */ - if (i8751_value == 0x0101) i8751_return = 0; /* ?? */ - if (i8751_value == 0x8101) i8751_return = ((coin2 / 10) << 4) | (coin2 % 10) | - ((((coin1 / 10) << 4) | (coin1 % 10)) << 8); /* Coins */ -} - - -static INT32 stopsubcpu = 0; -static INT32 nLastMiss = 0; - -void lastmiss_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1803: - if (M6809GetActive() == 0) { // main - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } else { - M6809Close(); - M6809Open(0); - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809Close(); - M6809Open(1); - } - return; - - case 0x1804: - if (M6809GetActive() == 0) { // main - M6809Close(); - M6809Open(1); - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809Close(); - M6809Open(0); - } else { - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - return; - - case 0x1805: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x1807: - *flipscreen = data; - return; - - case 0x180c: - *soundlatch = data; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - - // main cpu only! - - case 0x1809: - DrvPf0Ctrl[0x11] = data; - return; - - case 0x180b: - DrvPf0Ctrl[0x13] = data; - return; - - case 0x180d: - if (M6809GetActive() == 0) { - m6809_bankswitch(data & 0x0f); - - if (~data & 0x80 && nLastMiss) { - M6809Close(); - M6809Open(1); - M6809Reset(); - M6809Close(); - M6809Open(0); - stopsubcpu = 1; - } else { - stopsubcpu = 0; - } - } else { - if (nLastMiss == 0) { - // M6809Close(); - // M6809Open(0); - // m6809_bankswitch(data); - // M6809Close(); - // M6809Open(1); - } - } - - DrvPf0Ctrl[0x10] = (data >> 5) & 1; - DrvPf0Ctrl[0x12] = (data >> 6) & 1; - return; - - case 0x180e: - case 0x180f: - if (M6809GetActive() == 0) { - if ( nLastMiss) lastmiss_i8751_write(address & 1, data); - } else { - if (!nLastMiss) shackled_i8751_write(address & 1, data); - } - return; - } -} - -UINT8 lastmiss_main_read(UINT16 address) -{ - switch (address) - { - case 0x1800: - return DrvInputs[0]; - - case 0x1801: - return DrvInputs[1]; - - case 0x1802: - return (DrvInputs[2] & 0x7f) | vblank; - - case 0x1803: - return DrvDips[0]; - - case 0x1804: - return DrvDips[1]; - - case 0x1806: - return i8751_return >> 8; - - case 0x1807: - return i8751_return & 0xff; - } - - return 0; -} - -static INT32 LastmissDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - M6809Close(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - BurnYM2203Reset(); - BurnYM3526Reset(); - - i8751_return = 0; - i8751_value = 0; - - stopsubcpu = 0; - - return 0; -} - -static INT32 LastmissGfxDecode() -{ - INT32 Plane0[3] = { 0x6000*8,0x4000*8,0x2000*8 }; - INT32 Plane1[4] = { 0x60000*8,0x40000*8,0x20000*8,0x00000*8 }; - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 XOffs1[16]= {16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8),0,1,2,3,4,5,6,7 }; - INT32 YOffs0[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 3, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs0, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 LastmissInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (!strncmp(BurnDrvGetTextA(DRV_NAME), "lastm", 5)) { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvSubROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 4, 1)) return 1; - memcpy (DrvGfxROM0 + 0x00000, DrvGfxROM3 + 0x00000, 0x02000); - memcpy (DrvGfxROM0 + 0x06000, DrvGfxROM3 + 0x02000, 0x02000); - memcpy (DrvGfxROM0 + 0x04000, DrvGfxROM3 + 0x04000, 0x02000); - memcpy (DrvGfxROM0 + 0x02000, DrvGfxROM3 + 0x06000, 0x02000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 12, 1)) return 1; - - nLastMiss = 1; - } else { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x30000, 3, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x40000, 4, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x48000, 4, 1)) return 1; // reload - - if (BurnLoadRom(DrvSubROM + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x08000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x70000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 19, 1)) return 1; - } - - LastmissGfxDecode(); - } - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvMainRAM, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvPalRAM, 0x1000, 0x17ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x2000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvMainRAM + 0x1000, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvPf0RAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvMainROM + 0x10000, 0x4000, 0x7fff, MAP_ROM); - M6809MapMemory(DrvMainROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(lastmiss_main_write); - M6809SetReadHandler(lastmiss_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvMainRAM, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvPalRAM, 0x1000, 0x17ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x2000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvMainRAM + 0x1000, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvPf0RAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvSubROM + 0x04000, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(lastmiss_main_write); - M6809SetReadHandler(lastmiss_main_read); - M6809Close(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x05ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6502SetReadHandler(ghostb_sound_read); - M6502SetWriteHandler(gondo_sound_write); - M6502Close(); - - BurnSetRefreshRate(58.00); - - BurnYM3526Init(3000000, &DrvYM3812FMIRQHandler, &DrvYM3812SynchroniseStream, 0); - BurnTimerAttachM6502YM3526(1500000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 1500000, NULL, DrvYM2203M6809SynchroniseStream, DrvYM2203M6809GetTime, 1); - BurnTimerAttachM6809(2000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.23, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - LastmissDoReset(); - - return 0; -} - -static INT32 LastmissExit() -{ - M6809Exit(); - BurnYM3526Exit(); - nLastMiss = 0; - return DrvExit(); -} - -static void lastmiss_draw_bg_layer(INT32 priority, INT32 t) -{ - INT32 scrolly = ((DrvPf0Ctrl[0x12] << 8) + DrvPf0Ctrl[0x13] + 8) & 0x1ff; - INT32 scrollx = ((DrvPf0Ctrl[0x10] << 8) | DrvPf0Ctrl[0x11]) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scrollx; - if (sx < -15) sx += 512; - sy -= scrolly; - if (sy < -15) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 ofst = (offs & 0x0f) | ((offs >> 1) & 0xf0) | ((offs & 0x10) << 4) | (offs & 0x200); - - INT32 code = (DrvPf0RAM[ofst * 2 + 1]) | (DrvPf0RAM[ofst * 2 + 0] << 8); - INT32 color = code >> 12; - - if (priority && color < 8) continue; - - { - color = (color << 4) | 0x300; - UINT8 *src = DrvGfxROM2 + ((code & 0xfff) << 8); - UINT16 *dst; - - for (INT32 y = 0; y < 16; y++, sy++, src+=16) - { - if (sy < 0 || sy >= nScreenHeight) continue; - - dst = pTransDraw + sy * nScreenWidth; - - INT32 xx = sx; - for (INT32 x = 0; x < 16; x++, xx++) - { - INT32 pxl = src[x]; - if (t & (1 << pxl)) continue; - - if (xx >= nScreenWidth || xx < 0) continue; - - dst[xx] = pxl | color; - } - } - } - - // Render16x16Tile_Clip(pTransDraw, code & 0xfff, sx, sy, color, 4, 0x300, DrvGfxROM2); - } -} - -static void lastmiss_draw_txt_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= 8; - if (sy < 0 || sy >= nScreenHeight) continue; - - INT32 code = (DrvVidRAM[offs * 2 + 1]) | (DrvVidRAM[offs * 2 + 0] << 8); - INT32 color = code >> 14; - - Render8x8Tile_Mask(pTransDraw, code & 0xfff, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } -} - -static void DrvRecalcSplit(INT32 len) -{ - UINT8 r,g,b; - for (INT32 i = 0; i < len; i++) { - INT32 d = (DrvPalRAM[i + 0]) | (DrvPalRAM[i + len] << 8); - r = (d >> 0) & 0x0f; - g = (d >> 4) & 0x0f; - b = (d >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 LastmissDraw() -{ - if (DrvRecalc) { - DrvRecalcSplit(0x400); - } - - lastmiss_draw_bg_layer(0,0); - draw_sprites1(0); - lastmiss_draw_txt_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 ShackledDraw() -{ - if (DrvRecalc) { - DrvRecalcSplit(0x400); - } - - if (nBurnLayer & 1) lastmiss_draw_bg_layer(0, 0xfff0); - if (nBurnLayer & 2) lastmiss_draw_bg_layer(0, 0x000f); - if (nBurnLayer & 4) lastmiss_draw_bg_layer(1, 0xfff0); - if (nSpriteEnable & 1) draw_sprites1(0); - if (nBurnLayer & 8) lastmiss_draw_bg_layer(1, 0x000f); - if (nSpriteEnable & 2) lastmiss_draw_txt_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 LastmissFrame() -{ - if (DrvReset) { - LastmissDoReset(); - } - - M6809NewFrame(); - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nInterleave = 256 * 10; // shackled needs very tight sync - INT32 nCyclesTotal[3] = { 2000000 / 58, 2000000 / 58, 1500000 / 58 }; - memset(nCyclesDone, 0, sizeof(nCyclesDone)); - //INT32 nCyclesDone[3] = { 0, 0, 0 }; - - M6502Open(0); - - vblank = 0x80; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 8 * 10) vblank = 0x00; - if (i == 248 * 10) vblank = 0x80; - - M6809Open(0); - BurnTimerUpdate((i + 1) * (nCyclesTotal[0] / nInterleave)); - M6809Close(); - - M6809Open(1); - INT32 nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - if (stopsubcpu) { - nCyclesDone[1] += nSegment - nCyclesDone[1]; - } else { - nCyclesDone[1] += M6809Run(nSegment - nCyclesDone[1]); - } - M6809Close(); - - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[2] / nInterleave)); - } - - M6809Open(0); - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3526(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - M6502Close(); - M6809Close(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 LastmissScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - BurnYM3526Scan(nAction, pnMin); - - SCAN_VAR(stopsubcpu); - SCAN_VAR(RomBank); - - if (nAction & ACB_WRITE) { - M6809Open(0); - M6809MapMemory(DrvMainROM + 0x10000 + RomBank, 0x4000, 0x7fff, MAP_ROM); - M6809Close(); - } - } - - return DrvScan(nAction, pnMin); -} - - -// Last Mission (US revision 6) - -static struct BurnRomInfo lastmisnRomDesc[] = { - { "dl03-6.13h", 0x08000, 0x47751a5e, 1 }, // 0 maincpu - { "lm_dl04.7h", 0x10000, 0x7dea1552, 1 }, // 1 - - { "lm_dl02.18h", 0x10000, 0xec9b5daf, 2 }, // 2 sub - - { "dl05-.5h", 0x08000, 0x1a5df8c0, 3 }, // 3 audiocpu - - { "dl01-.2a", 0x08000, 0xf3787a5d, 4 }, // 4 gfx1 - - { "dl11-.13f", 0x08000, 0x36579d3b, 5 }, // 5 gfx2 - { "dl12-.9f", 0x08000, 0x2ba6737e, 5 }, // 6 - { "dl13-.8f", 0x08000, 0x39a7dc93, 5 }, // 7 - { "dl10-.16f", 0x08000, 0xfe275ea8, 5 }, // 8 - - { "dl09-.12k", 0x10000, 0x6a5a0c5d, 6 }, // 9 gfx3 - { "dl08-.14k", 0x10000, 0x3b38cfce, 6 }, // 10 - { "dl07-.15k", 0x10000, 0x1b60604d, 6 }, // 11 - { "dl06-.17k", 0x10000, 0xc43c26a7, 6 }, // 12 - - { "id8751h.mcu", 0x01000, 0x00000000, 7 | BRF_NODUMP }, // 13 mcu - - { "dl-14.9c", 0x00100, 0x2e55aa12, 8 }, // 14 proms -}; - -STD_ROM_PICK(lastmisn) -STD_ROM_FN(lastmisn) - -struct BurnDriver BurnDrvLastmisn = { - "lastmisn", NULL, NULL, NULL, "1986", - "Last Mission (US revision 6)\0", NULL, "Data East USA", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, lastmisnRomInfo, lastmisnRomName, NULL, NULL, LastmisnInputInfo, LastmisnDIPInfo, - LastmissInit, LastmissExit, LastmissFrame, LastmissDraw, LastmissScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Last Mission (US revision 5) - -static struct BurnRomInfo lastmsnoRomDesc[] = { - { "lm_dl03.13h", 0x08000, 0x357f5f6b, 1 }, // 0 maincpu - { "lm_dl04.7h", 0x10000, 0x7dea1552, 1 }, // 1 - - { "lm_dl02.18h", 0x10000, 0xec9b5daf, 2 }, // 2 sub - - { "dl05-.5h", 0x08000, 0x1a5df8c0, 3 }, // 3 audiocpu - - { "dl01-.2a", 0x08000, 0xf3787a5d, 4 }, // 4 gfx1 - - { "dl11-.13f", 0x08000, 0x36579d3b, 5 }, // 5 gfx2 - { "dl12-.9f", 0x08000, 0x2ba6737e, 5 }, // 6 - { "dl13-.8f", 0x08000, 0x39a7dc93, 5 }, // 7 - { "dl10-.16f", 0x08000, 0xfe275ea8, 5 }, // 8 - - { "dl09-.12k", 0x10000, 0x6a5a0c5d, 6 }, // 9 gfx3 - { "dl08-.14k", 0x10000, 0x3b38cfce, 6 }, // 10 - { "dl07-.15k", 0x10000, 0x1b60604d, 6 }, // 11 - { "dl06-.17k", 0x10000, 0xc43c26a7, 6 }, // 12 - - { "id8751h.mcu", 0x01000, 0x00000000, 7 | BRF_NODUMP }, // 13 mcu - - { "dl-14.9c", 0x00100, 0x2e55aa12, 8 }, // 14 proms -}; - -STD_ROM_PICK(lastmsno) -STD_ROM_FN(lastmsno) - -struct BurnDriver BurnDrvLastmsno = { - "lastmisno", "lastmisn", NULL, NULL, "1986", - "Last Mission (US revision 5)\0", NULL, "Data East USA", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, lastmsnoRomInfo, lastmsnoRomName, NULL, NULL, LastmisnInputInfo, LastmisnDIPInfo, - LastmissInit, LastmissExit, LastmissFrame, LastmissDraw, LastmissScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Last Mission (Japan) - -static struct BurnRomInfo lastmsnjRomDesc[] = { - { "dl03-.13h", 0x08000, 0x4be5e7e1, 1 }, // 0 maincpu - { "dl04-.7h", 0x10000, 0xf026adf9, 1 }, // 1 - - { "dl02-.18h", 0x10000, 0xd0de2b5d, 2 }, // 2 sub - - { "dl05-.5h", 0x08000, 0x1a5df8c0, 3 }, // 3 audiocpu - - { "dl01-.2a", 0x08000, 0xf3787a5d, 4 }, // 4 gfx1 - - { "dl11-.13f", 0x08000, 0x36579d3b, 5 }, // 5 gfx2 - { "dl12-.9f", 0x08000, 0x2ba6737e, 5 }, // 6 - { "dl13-.8f", 0x08000, 0x39a7dc93, 5 }, // 7 - { "dl10-.16f", 0x08000, 0xfe275ea8, 5 }, // 8 - - { "dl09-.12k", 0x10000, 0x6a5a0c5d, 6 }, // 9 gfx3 - { "dl08-.14k", 0x10000, 0x3b38cfce, 6 }, // 10 - { "dl07-.15k", 0x10000, 0x1b60604d, 6 }, // 11 - { "dl06-.17k", 0x10000, 0xc43c26a7, 6 }, // 12 - - { "id8751h.mcu", 0x01000, 0x00000000, 7 | BRF_NODUMP }, // 13 mcu - - { "dl-14.9c", 0x00100, 0x2e55aa12, 8 }, // 14 proms -}; - -STD_ROM_PICK(lastmsnj) -STD_ROM_FN(lastmsnj) - -struct BurnDriver BurnDrvLastmsnj = { - "lastmisnj", "lastmisn", NULL, NULL, "1986", - "Last Mission (Japan)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, lastmsnjRomInfo, lastmsnjRomName, NULL, NULL, LastmisnInputInfo, LastmsnjDIPInfo, - LastmissInit, LastmissExit, LastmissFrame, LastmissDraw, LastmissScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Shackled (US) - -static struct BurnRomInfo shackledRomDesc[] = { - { "dk-02.13h", 0x08000, 0x87f8fa85, 1 }, // 0 maincpu - { "dk-06.7h", 0x10000, 0x69ad62d1, 1 }, // 1 - { "dk-05.8h", 0x10000, 0x598dd128, 1 }, // 2 - { "dk-04.10h", 0x10000, 0x36d305d4, 1 }, // 3 - { "dk-03.11h", 0x08000, 0x6fd90fd1, 1 }, // 4 - - { "dk-01.18h", 0x10000, 0x71fe3bda, 2 }, // 5 sub - - { "dk-07.5h", 0x08000, 0x887e4bcc, 3 }, // 6 audiocpu - - { "dk-00.2a", 0x08000, 0x69b975aa, 5 }, // 8 gfx1 - - { "dk-12.15k", 0x10000, 0x615c2371, 6 }, // 9 gfx2 - { "dk-13.14k", 0x10000, 0x479aa503, 6 }, // 10 - { "dk-14.13k", 0x10000, 0xcdc24246, 6 }, // 11 - { "dk-15.11k", 0x10000, 0x88db811b, 6 }, // 12 - { "dk-16.10k", 0x10000, 0x061a76bd, 6 }, // 13 - { "dk-17.9k", 0x10000, 0xa6c5d8af, 6 }, // 14 - { "dk-18.8k", 0x10000, 0x4d466757, 6 }, // 15 - { "dk-19.6k", 0x10000, 0x1911e83e, 6 }, // 16 - - { "dk-11.12k", 0x10000, 0x5cf5719f, 7 }, // 17 gfx3 - { "dk-10.14k", 0x10000, 0x408e6d08, 7 }, // 18 - { "dk-09.15k", 0x10000, 0xc1557fac, 7 }, // 19 - { "dk-08.17k", 0x10000, 0x5e54e9f5, 7 }, // 20 - - { "dk.18a", 0x01000, 0x00000000, 4 | BRF_NODUMP }, // 7 mcu - - { "dk-20.9c", 0x00100, 0xff3cd588, 0 | BRF_OPT }, // priority PROM -}; - -STD_ROM_PICK(shackled) -STD_ROM_FN(shackled) - -struct BurnDriver BurnDrvShackled = { - "shackled", NULL, NULL, NULL, "1986", - "Shackled (US)\0", NULL, "Data East USA", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, shackledRomInfo, shackledRomName, NULL, NULL, ShackledInputInfo, ShackledDIPInfo, - LastmissInit, LastmissExit, LastmissFrame, ShackledDraw, LastmissScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Breywood (Japan revision 2) - -static struct BurnRomInfo breywoodRomDesc[] = { - { "dj02-2.13h", 0x08000, 0xc19856b9, 1 }, // 0 maincpu - { "dj06-2.7h", 0x10000, 0x2860ea02, 1 }, // 1 - { "dj05-2.8h", 0x10000, 0x0fdd915e, 1 }, // 2 - { "dj04-2.10h", 0x10000, 0x71036579, 1 }, // 3 - { "dj03-2.11h", 0x08000, 0x308f4893, 1 }, // 4 - - { "dj1-2y.18h", 0x10000, 0x3d9fb623, 2 }, // 5 sub - - { "dj07-1.5h", 0x08000, 0x4a471c38, 3 }, // 6 audiocpu - - { "dj-00.2a", 0x08000, 0x815a891a, 5 }, // 8 gfx1 - - { "dj12.15k", 0x10000, 0x2b7634f2, 6 }, // 9 gfx2 - { "dj13.14k", 0x10000, 0x4530a952, 6 }, // 10 - { "dj14.13k", 0x10000, 0x87c28833, 6 }, // 11 - { "dj15.11k", 0x10000, 0xbfb43a4d, 6 }, // 12 - { "dj16.10k", 0x10000, 0xf9848cc4, 6 }, // 13 - { "dj17.9k", 0x10000, 0xbaa3d218, 6 }, // 14 - { "dj18.8k", 0x10000, 0x12afe533, 6 }, // 15 - { "dj19.6k", 0x10000, 0x03373755, 6 }, // 16 - - { "dj11.12k", 0x10000, 0x067e2a43, 7 }, // 17 gfx3 - { "dj10.14k", 0x10000, 0xc19733aa, 7 }, // 18 - { "dj09.15k", 0x10000, 0xe37d5dbe, 7 }, // 19 - { "dj08.17k", 0x10000, 0xbeee880f, 7 }, // 20 - - { "dj.18a", 0x01000, 0x00000000, 4 | BRF_NODUMP }, // 7 mcu - - { "dk-20.9c", 0x00100, 0xff3cd588, 0 | BRF_OPT }, // priority PROM -}; - -STD_ROM_PICK(breywood) -STD_ROM_FN(breywood) - -struct BurnDriver BurnDrvBreywood = { - "breywood", "shackled", NULL, NULL, "1986", - "Breywood (Japan revision 2)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, breywoodRomInfo, breywoodRomName, NULL, NULL, ShackledInputInfo, ShackledDIPInfo, - LastmissInit, LastmissExit, LastmissFrame, ShackledDraw, LastmissScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -static INT32 MSM5205Next = 0; -static UINT8 MSM5205Last = 0; -static INT32 Toggle = 0; -static INT32 SndRomBank = 0; -static INT32 csilver_coin = 0; - -static void csilver_i8751_write(INT32 offset, UINT8 data) -{ - static INT32 latch = 0, snd = 0; - i8751_return = 0; - - UINT8 coininp = DrvInputs[2]; - - //bprintf(0, _T("i8751_w()..\n")); - - switch (offset) - { - case 0: /* High byte */ - i8751_value = (i8751_value & 0xff) | (data << 8); - //bprintf(0, _T("INT!\n")); - M6809SetIRQLine(1, CPU_IRQSTATUS_AUTO); /* Signal main cpu */ - break; - case 1: /* Low byte */ - i8751_value = (i8751_value & 0xff00) | data; - break; - } - - if ((coininp & 3) == 3 && !latch) latch = 1; - if ((coininp & 3) != 3 && latch) { - csilver_coin++; - latch = 0; - snd = 0x1200; - i8751_return = 0x1200; - } - - if (i8751_value == 0x054a) { i8751_return = 0xb5; } /* Captain Silver (Japan) ID */ - if (i8751_value == 0x054c) { i8751_return = 0xb3; } /* Captain Silver (World) ID */ - - if (offset == 0) - { - /* Coins are controlled by the i8751 */ - - if ((i8751_value >> 8) == 0x01) i8751_return = i8751_value; /* Coinage - Not Supported */ - if ((i8751_value >> 8) == 0x02) {i8751_return = snd | csilver_coin; snd = 0; } /* Coin Return */ - if ((i8751_value >> 8) == 0x03 && csilver_coin) {i8751_return = 0; csilver_coin--;} /* Coin Clear */ - } -} - -void csilver_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1803: - if (M6809GetActive() == 0) { // main - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } else { - M6809Close(); - M6809Open(0); - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809Close(); - M6809Open(1); - } - return; - - case 0x1804: - if (M6809GetActive() == 0) { // main - M6809Close(); - M6809Open(1); - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809Close(); - M6809Open(0); - } else { - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - return; - - case 0x1805: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x1807: - *flipscreen = data; - return; - - case 0x180c: - *soundlatch = data; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - M6502Run(500); - return; - - case 0x1808: - case 0x1809: // maincpu - case 0x180a: - case 0x180b: // dec8_scroll2_w - DrvPf0Ctrl[0x10 + (address & 3)] = data; - return; - - - case 0x180d: // main - if (M6809GetActive() == 0) m6809_bankswitch(data); - return; - - case 0x180e: // main - case 0x180f: - if (M6809GetActive() == 0) csilver_i8751_write(address & 1, data); - return; - } -} - -UINT8 csilver_main_read(UINT16 address) -{ - switch (address) - { - case 0x1800: - return DrvInputs[1]; - - case 0x1801: - return DrvInputs[0]; - - case 0x1803: - return (DrvInputs[2] & 0x7f) | vblank; - - case 0x1804: - return DrvDips[1]; - - case 0x1805: - return DrvDips[0]; - - case 0x1c00: - return (i8751_return >> 8) & 0xff; - - case 0x1e00: - return i8751_return & 0xff; - } - - return 0; -} - -static void csilver_sound_bank(INT32 data) -{ - SndRomBank = (data & 8) >> 3; - - M6502MapMemory(DrvM6502ROM + 0x10000 + SndRomBank * 0x4000, 0x4000, 0x7fff, MAP_ROM); -} - -void csilver_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0800: - case 0x0801: - BurnYM2203Write(0, address & 1, data); - return; - - case 0x1000: - case 0x1001: - BurnYM3526Write(address & 1, data); - return; - - case 0x1800: - MSM5205Next = data; - if (MSM5205Last == 0x8 && MSM5205Next == 0x8) { // clears up hissing & clicking noise - MSM5205ResetWrite(0, 1); - } else MSM5205ResetWrite(0, 0); - MSM5205Last = data; - return; - - case 0x2000: - csilver_sound_bank(data); - return; - } -} - -UINT8 csilver_sound_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - return *soundlatch; - - case 0x3400: - MSM5205ResetWrite(0, 0); - return 0; - } - - return 0; -} - -static void CsilverADPCMInt() -{ - Toggle ^= 1; - if (Toggle) M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - MSM5205DataWrite(0, MSM5205Next >> 4); - MSM5205Next <<= 4; -} - -static INT32 CsilverDoReset() -{ - INT32 nRet = LastmissDoReset(); - - MSM5205Reset(); - csilver_coin = 0; - - return nRet; -} - -static INT32 CsilverInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x20000, 2, 1)) return 1; - - if (BurnLoadRom(DrvSubROM + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM + 0x00000, 4, 1)) return 1; - memcpy (DrvM6502ROM + 0x10000, DrvM6502ROM + 0x00000, 0x8000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x50000, 14, 1)) return 1; - - LastmissGfxDecode(); - } - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvMainRAM + 0x00000, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvPalRAM, 0x1000, 0x17ff, MAP_RAM); // xxxxbbbbggggrrrr - M6809MapMemory(DrvVidRAM, 0x2000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvMainRAM + 0x01000, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvPf0RAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvMainROM + 0x10000, 0x4000, 0x7fff, MAP_RAM); - M6809MapMemory(DrvMainROM + 0x08000, 0x8000, 0xffff, MAP_RAM); - M6809SetWriteHandler(csilver_main_write); - M6809SetReadHandler(csilver_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvMainRAM + 0x00000, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvPalRAM, 0x1000, 0x17ff, MAP_RAM); // xxxxbbbbggggrrrr - M6809MapMemory(DrvVidRAM, 0x2000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvMainRAM + 0x01000, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvPf0RAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvSubROM + 0x04000, 0x4000, 0xffff, MAP_RAM); - M6809SetWriteHandler(csilver_main_write); - M6809SetReadHandler(csilver_main_read); - M6809Close(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM + 0x4000, 0x4000, 0x7fff, MAP_ROM); - M6502MapMemory(DrvM6502ROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6502SetReadHandler(csilver_sound_read); - M6502SetWriteHandler(csilver_sound_write); - M6502Close(); - - BurnSetRefreshRate(58.00); - - BurnYM3526Init(3000000, &DrvYM3812FMIRQHandler, &DrvYM3812SynchroniseStreamCsilver, 0); - BurnTimerAttachM6502YM3526(1500000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 1500000, NULL, DrvYM2203M6809SynchroniseStream1500000, DrvYM2203M6809GetTime1500000, 1); - BurnTimerAttachM6809(1500000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.23, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.23, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, CsilverMSM5205SynchroniseStream, 384000, CsilverADPCMInt, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.88, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - CsilverDoReset(); - - return 0; -} - -static INT32 CsilverFrame() -{ - if (DrvReset) { - CsilverDoReset(); - } - - M6809NewFrame(); - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - MSM5205NewFrame(0, 1500000, nInterleave); - INT32 nCyclesTotal[3] = { 1500000 / 58, 1500000 / 58, 1500000 / 58 }; - memset(nCyclesDone, 0, sizeof(nCyclesDone)); - //INT32 nCyclesDone[3] = { 0, 0, 0 }; - - M6502Open(0); - - vblank = 0x80; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 8) vblank = 0x00; - - M6809Open(0); - BurnTimerUpdate((i + 1) * (nCyclesTotal[0] / nInterleave)); - M6809Close(); - - M6809Open(1); - INT32 nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - nCyclesDone[1] += M6809Run(nSegment - nCyclesDone[1]); - if (i == 248) { - vblank = 0x80; - M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - } - MSM5205UpdateScanline(i); - M6809Close(); - - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[2] / nInterleave)); - } - - M6809Open(0); - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3526(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - - M6502Close(); - M6809Close(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 CsilverScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - BurnYM3526Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - - SCAN_VAR(MSM5205Next); - SCAN_VAR(Toggle); - SCAN_VAR(SndRomBank); - SCAN_VAR(RomBank); - SCAN_VAR(csilver_coin); - - if (nAction & ACB_WRITE) { - M6809Open(0); - M6809MapMemory(DrvMainROM + 0x10000 + RomBank, 0x4000, 0x7fff, MAP_ROM); - M6809Close(); - - M6502Open(0); - M6502MapMemory(DrvM6502ROM + 0x10000 + SndRomBank * 0x4000, 0x4000, 0x7fff, MAP_ROM); - M6502Close(); - } - } - - return DrvScan(nAction, pnMin); -} - -// Captain Silver (World) - -static struct BurnRomInfo csilverRomDesc[] = { - { "dx03-12.18d", 0x08000, 0x2d926e7c, 1 }, // 0 maincpu - { "dx01.12d", 0x10000, 0x570fb50c, 1 }, // 1 - { "dx02.13d", 0x10000, 0x58625890, 1 }, // 2 - - { "dx04-1.19d", 0x10000, 0x29432691, 2 }, // 3 sub - - { "dx05.3f", 0x10000, 0xeb32cf25, 3 }, // 4 audiocpu - - { "dx00.3d", 0x08000, 0xf01ef985, 4 }, // 5 gfx1 - - { "dx14.15k", 0x10000, 0x80f07915, 5 }, // 6 gfx2 - { "dx13.13k", 0x10000, 0xd32c02e7, 5 }, // 7 - { "dx12.10k", 0x10000, 0xac78b76b, 5 }, // 8 - - { "dx06.5f", 0x10000, 0xb6fb208c, 6 }, // 9 gfx3 - { "dx07.7f", 0x10000, 0xee3e1817, 6 }, // 10 - { "dx08.8f", 0x10000, 0x705900fe, 6 }, // 11 - { "dx09.10f", 0x10000, 0x3192571d, 6 }, // 12 - { "dx10.12f", 0x10000, 0x3ef77a32, 6 }, // 13 - { "dx11.13f", 0x10000, 0x9cf3d5b8, 6 }, // 14 - - { "id8751h.mcu", 0x01000, 0xca663965, 7 }, // 15 mcu -}; - -STD_ROM_PICK(csilver) -STD_ROM_FN(csilver) - -static INT32 CsilverExit() -{ - MSM5205Exit(); - - MSM5205Next = 0; - Toggle = 0; - - return LastmissExit(); -} - -struct BurnDriver BurnDrvCsilver = { - "csilver", NULL, NULL, NULL, "1987", - "Captain Silver (World)\0", NULL, "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, csilverRomInfo, csilverRomName, NULL, NULL, CsilverInputInfo, CsilverDIPInfo, - CsilverInit, CsilverExit, CsilverFrame, LastmissDraw, CsilverScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Captain Silver (Japan revision 3) - -static struct BurnRomInfo csilverjRomDesc[] = { - { "dx03-3.a4", 0x08000, 0x02dd8cfc, 1 }, // 0 maincpu - { "dx01.a2", 0x10000, 0x570fb50c, 1 }, // 1 - { "dx02.a3", 0x10000, 0x58625890, 1 }, // 2 - - { "dx04-1.a5", 0x10000, 0x29432691, 2 }, // 3 sub - - { "dx05.a6", 0x10000, 0xeb32cf25, 3 }, // 4 audiocpu - - { "dx00.a1", 0x08000, 0xf01ef985, 4 }, // 5 gfx1 - - { "dx14.b5", 0x10000, 0x80f07915, 5 }, // 6 gfx2 - { "dx13.b4", 0x10000, 0xd32c02e7, 5 }, // 7 - { "dx12.b3", 0x10000, 0xac78b76b, 5 }, // 8 - - { "dx06.a7", 0x10000, 0xb6fb208c, 6 }, // 9 gfx3 - { "dx07.a8", 0x10000, 0xee3e1817, 6 }, // 10 - { "dx08.a9", 0x10000, 0x705900fe, 6 }, // 11 - { "dx09.a10", 0x10000, 0x3192571d, 6 }, // 12 - { "dx10.b1", 0x10000, 0x3ef77a32, 6 }, // 13 - { "dx11.b2", 0x10000, 0x9cf3d5b8, 6 }, // 14 - - { "id8751h.mcu", 0x01000, 0xca663965, 7 }, // 15 mcu -}; - -STD_ROM_PICK(csilverj) -STD_ROM_FN(csilverj) - -struct BurnDriver BurnDrvCsilverj = { - "csilverj", "csilver", NULL, NULL, "1987", - "Captain Silver (Japan revision 3)\0", "imperfect sound", "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, csilverjRomInfo, csilverjRomName, NULL, NULL, CsilverInputInfo, CsilverDIPInfo, - CsilverInit, CsilverExit, CsilverFrame, LastmissDraw, CsilverScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Captain Silver (Japan revision 1) -/* Same IC positions to World set */ - -static struct BurnRomInfo csilverjaRomDesc[] = { - { "dx03-1.18d", 0x08000, 0xd42905be, 1 }, // 0 maincpu - { "dx01.12d", 0x10000, 0x570fb50c, 1 }, // 1 - { "dx02.13d", 0x10000, 0x58625890, 1 }, // 2 - - { "dx04-1.19d", 0x10000, 0x29432691, 2 }, // 3 sub - - { "dx05.3f", 0x10000, 0xeb32cf25, 3 }, // 4 audiocpu - - { "dx00.3d", 0x08000, 0xf01ef985, 4 }, // 5 gfx1 - - { "dx14.15k", 0x10000, 0x80f07915, 5 }, // 6 gfx2 - { "dx13.13k", 0x10000, 0xd32c02e7, 5 }, // 7 - { "dx12.10k", 0x10000, 0xac78b76b, 5 }, // 8 - - { "dx06.5f", 0x10000, 0xb6fb208c, 6 }, // 9 gfx3 - { "dx07.7f", 0x10000, 0xee3e1817, 6 }, // 10 - { "dx08.8f", 0x10000, 0x705900fe, 6 }, // 11 - { "dx09.10f", 0x10000, 0x3192571d, 6 }, // 12 - { "dx10.12f", 0x10000, 0x3ef77a32, 6 }, // 13 - { "dx11.13f", 0x10000, 0x9cf3d5b8, 6 }, // 14 - - { "id8751h.mcu", 0x01000, 0xca663965, 7 }, // 15 mcu -}; - -STD_ROM_PICK(csilverja) -STD_ROM_FN(csilverja) - -struct BurnDriver BurnDrvCsilverja = { - "csilverja", "csilver", NULL, NULL, "1987", - "Captain Silver (Japan revision 1)\0", "imperfect sound", "Data East Corporation", "DEC8", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, csilverjaRomInfo, csilverjaRomName, NULL, NULL, CsilverInputInfo, CsilverDIPInfo, - CsilverInit, CsilverExit, CsilverFrame, LastmissDraw, CsilverScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_dietgogo.cpp b/jan/src/burn/drv/dataeast/d_dietgogo.cpp deleted file mode 100644 index f7a421d4f..000000000 --- a/jan/src/burn/drv/dataeast/d_dietgogo.cpp +++ /dev/null @@ -1,636 +0,0 @@ -// FB Alpha Diet Go Go driver module -// Based on MAME driver by Bryan McPhail and David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "deco16ic.h" -#include "deco146.h" -#include "msm6295.h" -#include "h6280_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KCode; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvHucRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo DietgoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dietgo) - -static struct BurnDIPInfo DietgoDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Continue Coin" }, - {0x14, 0x01, 0x80, 0x80, "1 Start/1 Continue" }, - {0x14, 0x01, 0x80, 0x00, "2 Start/1 Continue" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x01, "1" }, - {0x15, 0x01, 0x03, 0x00, "2" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x0c, 0x08, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x04, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, -}; - -STDDIPINFO(Dietgo) - -void __fastcall dietgogo_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x200000, data) - - if (address >= 0x340000 && address <= 0x343fff) { - deco146_104_prot_ww(0, address, data); - } -} - -void __fastcall dietgogo_main_write_byte(UINT32 address, UINT8 data) -{ - if (address >= 0x340000 && address <= 0x343fff) { - deco146_104_prot_wb(0, address, data); - } -} - -UINT16 __fastcall dietgogo_main_read_word(UINT32 address) -{ - if (address >= 0x340000 && address <= 0x343fff) { - return deco146_104_prot_rw(0, address); - } - - return 0; -} - -UINT8 __fastcall dietgogo_main_read_byte(UINT32 address) -{ - if (address >= 0x340000 && address <= 0x343fff) { - return deco146_104_prot_rb(0, address); - } - - return 0; -} - -static INT32 dietgo_bank_callback(const INT32 bank) -{ - return ((bank >> 4) & 0x7) * 0x1000; -} - -static UINT16 inputs_read() -{ - return DrvInputs[0]; -} - -static UINT16 system_read() -{ - return (DrvInputs[1] & 7) | deco16_vblank; -} - -static UINT16 dips_read() -{ - return (DrvDips[1] << 8) | (DrvDips[0] << 0); -} - -static void soundlatch_write(UINT16 data) -{ - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - deco16SoundReset(); - - deco16Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - Drv68KCode = Next; Next += 0x080000; - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x400000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvSprRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000c00; - DrvHucRAM = Next; Next += 0x002000; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00001, 1, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 5, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 6, 1)) return 1; - - deco102_decrypt_cpu(Drv68KROM, Drv68KCode, 0x80000, 0xe9ba, 0x01, 0x19); - - deco56_decrypt_gfx(DrvGfxROM1, 0x100000); - - deco16_tile_decode(DrvGfxROM1, DrvGfxROM0, 0x100000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x100000, 0); - deco16_sprite_decode(DrvGfxROM2, 0x200000); - } - - deco16Init(1, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x100000 * 2, DrvGfxROM1, 0x100000 * 2, NULL, 0); - deco16_set_global_offsets(0, 8); - deco16_set_bank_callback(0, dietgo_bank_callback); - deco16_set_bank_callback(1, dietgo_bank_callback); - - // 146_104 prot - deco_104_init(); - deco_146_104_set_port_a_cb(inputs_read); // inputs - deco_146_104_set_port_b_cb(system_read); // system - deco_146_104_set_port_c_cb(dips_read); // dips - deco_146_104_set_soundlatch_cb(soundlatch_write); - deco_146_104_set_interface_scramble_interleave(); - deco_146_104_set_use_magic_read_address_xor(1); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_READ); - SekMapMemory(Drv68KCode, 0x000000, 0x07ffff, MAP_FETCH); - SekMapMemory(deco16_pf_ram[0], 0x210000, 0x211fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x212000, 0x213fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x220000, 0x2207ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x222000, 0x2227ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x280000, 0x2807ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x300000, 0x300bff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x380000, 0x38ffff, MAP_RAM); - SekSetWriteWordHandler(0, dietgogo_main_write_word); - SekSetWriteByteHandler(0, dietgogo_main_write_byte); - SekSetReadWordHandler(0, dietgogo_main_read_word); - SekSetReadByteHandler(0, dietgogo_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 2685000, 0, NULL, 0.45, 1006875, 0.60, 0, 0); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - deco16Exit(); - deco16SoundExit(); - - SekExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - if (BURN_ENDIAN_SWAP_INT16(ram[offs + 1]) == 0) continue; - - INT32 inc, mult; - - INT32 sy = BURN_ENDIAN_SWAP_INT16(ram[offs + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs + 1]) & 0x3fff; - INT32 sx = BURN_ENDIAN_SWAP_INT16(ram[offs + 2]); - - if ((sy & 0x1000) && (nCurrentFrame & 1)) continue; - - INT32 color = (sx >> 9) & 0x1f; - - INT32 flipx = sy & 0x2000; - INT32 flipy = sy & 0x4000; - INT32 multi = (1 << ((sy & 0x0600) >> 9)) - 1; - - sx &= 0x01ff; - sy &= 0x01ff; - if (sx >= 320) sx -= 512; - if (sy >= 256) sy -= 512; - sy = 240 - sy; - sx = 304 - sx; - - code &= ~multi; - - if (flipy) { - inc = -1; - } else { - code += multi; - inc = 1; - } - - if (*flipscreen) - { - sy = 240 - sy; - sx = 304 - sx; - flipx = !flipx; - flipy = !flipy; - mult = 16; - } - else - mult = -16; - - if (sx >= 320 || sx < -15) continue; - - while (multi >= 0) - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code - multi * inc, sx, (sy + mult * multi) - 8, color, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code - multi * inc, sx, (sy + mult * multi) - 8, color, 4, 0, 0x200, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code - multi * inc, sx, (sy + mult * multi) - 8, color, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code - multi * inc, sx, (sy + mult * multi) - 8, color, 4, 0, 0x200, DrvGfxROM2); - } - } - - multi--; - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x100; - } - - if (nBurnLayer & 1) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_OPAQUE); - - if (nBurnLayer & 2) deco16_draw_layer(0, pTransDraw, 0); - - if (nBurnLayer & 4) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - h6280NewFrame(); - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 232; //256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14000000 / 58, 2685000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += h6280Run(nCyclesTotal[1] / nInterleave); - - if (i == 208) deco16_vblank = 0x08; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - } - - return 0; -} - - -// Diet Go Go (USA v1.1 1992.09.26) - -static struct BurnRomInfo dietgouRomDesc[] = { - { "jx_00-.4h", 0x040000, 0x1a9de04f, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jx_01-.5h", 0x040000, 0x79c097c8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jx_02.14m", 0x010000, 0x4e3492a5, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "may-00.10a", 0x100000, 0x234d1f8d, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "may-01.14a", 0x100000, 0x2da57d04, 4 | BRF_GRA }, // 4 Sprites - { "may-02.16a", 0x100000, 0x3a66a713, 4 | BRF_GRA }, // 5 - - { "may-03.11l", 0x080000, 0xb6e42bae, 5 | BRF_SND }, // 6 OKI M6295 Samples - - { "pal16l8b_vd-00.6h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 7 PLDs - { "pal16l8b_vd-01.7h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 8 - { "pal16r6a_vd-02.11h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 9 -}; - -STD_ROM_PICK(dietgou) -STD_ROM_FN(dietgou) - -struct BurnDriver BurnDrvDietgou = { - "dietgou", "dietgo", NULL, NULL, "1992", - "Diet Go Go (USA v1.1 1992.09.26)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, dietgouRomInfo, dietgouRomName, NULL, NULL, DietgoInputInfo, DietgoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; - - -// Diet Go Go (Euro v1.1 1992.08.04) - -static struct BurnRomInfo dietgoeRomDesc[] = { - { "jy_00-1.4h", 0x040000, 0x8bce137d, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jy_01-1.5h", 0x040000, 0xeca50450, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jy_02.14m", 0x010000, 0x4e3492a5, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "may-00.10a", 0x100000, 0x234d1f8d, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "may-01.14a", 0x100000, 0x2da57d04, 4 | BRF_GRA }, // 4 Sprites - { "may-02.16a", 0x100000, 0x3a66a713, 4 | BRF_GRA }, // 5 - - { "may-03.11l", 0x080000, 0xb6e42bae, 5 | BRF_SND }, // 6 OKI M6295 Samples - - { "pal16l8b_vd-00.6h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 7 PLDs - { "pal16l8b_vd-01.7h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 8 - { "pal16r6a_vd-02.11h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 9 -}; - -STD_ROM_PICK(dietgoe) -STD_ROM_FN(dietgoe) - -struct BurnDriver BurnDrvDietgoe = { - "dietgoe", "dietgo", NULL, NULL, "1992", - "Diet Go Go (Euro v1.1 1992.08.04)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, dietgoeRomInfo, dietgoeRomName, NULL, NULL, DietgoInputInfo, DietgoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; - - -// Diet Go Go (Euro v1.1 1992.09.26) - -static struct BurnRomInfo dietgoRomDesc[] = { - { "jy_00-2.4h", 0x040000, 0x014dcf62, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jy_01-2.5h", 0x040000, 0x793ebd83, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jy_02.14m", 0x010000, 0x4e3492a5, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "may-00.10a", 0x100000, 0x234d1f8d, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "may-01.14a", 0x100000, 0x2da57d04, 4 | BRF_GRA }, // 4 Sprites - { "may-02.16a", 0x100000, 0x3a66a713, 4 | BRF_GRA }, // 5 - - { "may-03.11l", 0x080000, 0xb6e42bae, 5 | BRF_SND }, // 6 OKI M6295 Samples - - { "pal16l8b_vd-00.6h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 7 PLDs - { "pal16l8b_vd-01.7h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 8 - { "pal16r6a_vd-02.11h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 9 -}; - -STD_ROM_PICK(dietgo) -STD_ROM_FN(dietgo) - -struct BurnDriver BurnDrvDietgo = { - "dietgo", NULL, NULL, NULL, "1992", - "Diet Go Go (Euro v1.1 1992.09.26)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, dietgoRomInfo, dietgoRomName, NULL, NULL, DietgoInputInfo, DietgoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; - - -// Diet Go Go (Japan v1.1 1992.09.26) - -static struct BurnRomInfo dietgojRomDesc[] = { - { "jw_00-2.4h", 0x040000, 0xe6ba6c49, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jw_01-2.5h", 0x040000, 0x684a3d57, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jw_02.14m", 0x010000, 0x4e3492a5, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "may-00.10a", 0x100000, 0x234d1f8d, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "may-01.14a", 0x100000, 0x2da57d04, 4 | BRF_GRA }, // 4 Sprites - { "may-02.16a", 0x100000, 0x3a66a713, 4 | BRF_GRA }, // 5 - - { "may-03.11l", 0x080000, 0xb6e42bae, 5 | BRF_SND }, // 6 OKI M6295 Samples - - { "pal16l8b_vd-00.6h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 7 PLDs - { "pal16l8b_vd-01.7h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 8 - { "pal16r6a_vd-02.11h", 0x000104, 0x00000000, 6 | BRF_NODUMP }, // 9 -}; - -STD_ROM_PICK(dietgoj) -STD_ROM_FN(dietgoj) - -struct BurnDriver BurnDrvDietgoj = { - "dietgoj", "dietgo", NULL, NULL, "1992", - "Diet Go Go (Japan v1.1 1992.09.26)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, dietgojRomInfo, dietgojRomName, NULL, NULL, DietgoInputInfo, DietgoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_funkyjet.cpp b/jan/src/burn/drv/dataeast/d_funkyjet.cpp deleted file mode 100644 index 7589a0619..000000000 --- a/jan/src/burn/drv/dataeast/d_funkyjet.cpp +++ /dev/null @@ -1,764 +0,0 @@ -// FB Alpha Funky Jet driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "h6280_intf.h" -#include "deco16ic.h" -#include "msm6295.h" -#include "burn_ym2151.h" -#include "deco146.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvHucRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static struct BurnInputInfo FunkyjetInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Funkyjet) - -static struct BurnDIPInfo FunkyjetDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x1c, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0xe0, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xe0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x01, 0x00, "Off" }, - {0x15, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x02, 0x00, "No" }, - {0x15, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x30, 0x10, "Easy" }, - {0x15, 0x01, 0x30, 0x30, "Normal" }, - {0x15, 0x01, 0x30, 0x20, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0xc0, 0x80, "1" }, - {0x15, 0x01, 0xc0, 0xc0, "2" }, - {0x15, 0x01, 0xc0, 0x40, "3" }, - {0x15, 0x01, 0xc0, 0x00, "4" }, -}; - -STDDIPINFO(Funkyjet) - -static struct BurnDIPInfo FunkyjetjDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x1c, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0xe0, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xe0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x02, 0x00, "No" }, - {0x15, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x30, 0x10, "Easy" }, - {0x15, 0x01, 0x30, 0x30, "Normal" }, - {0x15, 0x01, 0x30, 0x20, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0xc0, 0x80, "1" }, - {0x15, 0x01, 0xc0, 0xc0, "2" }, - {0x15, 0x01, 0xc0, 0x40, "3" }, - {0x15, 0x01, 0xc0, 0x00, "4" }, -}; - -STDDIPINFO(Funkyjetj) - -static struct BurnDIPInfo SotsugyoDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xed, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x1c, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0xe0, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xe0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x0c, 0x04, "1" }, - {0x15, 0x01, 0x0c, 0x08, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x30, 0x30, "Easy" }, - {0x15, 0x01, 0x30, 0x20, "Normal" }, - {0x15, 0x01, 0x30, 0x10, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Sotsugyo) - -static void __fastcall funkyjet_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x300000, data) - - if ((address & 0xffc000) == 0x180000) { - deco146_104_prot_ww(0, address, data); - return; - } -} - -static void __fastcall funkyjet_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffc000) == 0x180000) { - deco146_104_prot_wb(0, address, data); - return; - } -} - -static UINT16 __fastcall funkyjet_main_read_word(UINT32 address) -{ - if ((address & 0xffc000) == 0x180000) { - return deco146_104_prot_rw(0, address); - } - - return 0; -} - -static UINT8 __fastcall funkyjet_main_read_byte(UINT32 address) -{ - if ((address & 0xffc000) == 0x180000) { - return deco146_104_prot_rb(0, address); - } - - return 0; -} - -static UINT16 inputs_read() -{ - return DrvInputs[0]; -} - -static UINT16 system_read() -{ - return (DrvInputs[1] & 7) | deco16_vblank; -} - -static UINT16 dips_read() -{ - return DrvInputs[2]; -} - -static void soundlatch_write(UINT16 data) -{ - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - deco16SoundReset(); - - deco16Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvHucRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x80000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 6, 1)) return 1; - - deco74_decrypt_gfx(DrvGfxROM1, 0x080000); - - deco16_tile_decode(DrvGfxROM1, DrvGfxROM0, 0x080000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x080000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x100000, 0); - } - - deco16Init(1, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x80000 * 2, DrvGfxROM1, 0x80000 * 2, NULL, 0); - deco16_set_color_base(0, 256); - deco16_set_color_base(1, 512); - deco16_set_global_offsets(0, 8); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x140000, 0x143fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x160000, 0x1607ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x320000, 0x321fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x322000, 0x323fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x340000, 0x340bff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x342000, 0x342bff, MAP_RAM); - SekSetWriteWordHandler(0, funkyjet_main_write_word); - SekSetWriteByteHandler(0, funkyjet_main_write_byte); - SekSetReadWordHandler(0, funkyjet_main_read_word); - SekSetReadByteHandler(0, funkyjet_main_read_byte); - SekClose(); - - deco_146_init(); - deco_146_104_set_port_a_cb(inputs_read); // inputs - deco_146_104_set_port_b_cb(system_read); // system - deco_146_104_set_port_c_cb(dips_read); // dips - deco_146_104_set_soundlatch_cb(soundlatch_write); - deco_146_104_set_interface_scramble_interleave(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 0, NULL, 0.45, 1000000, 0.50, 0, 0); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - SekExit(); - deco16SoundExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x800 / 2; i++) { - INT32 b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 8) & 0x0f; - INT32 g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 4) & 0x0f; - INT32 r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 inc, mult; - - INT32 sy = BURN_ENDIAN_SWAP_INT16(ram[offs + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs + 1]) & 0x3fff; - INT32 sx = BURN_ENDIAN_SWAP_INT16(ram[offs + 2]); - - if ((sy & 0x1000) && (nCurrentFrame & 1)) continue; - - INT32 color = (sx >> 9) & 0x1f; - - INT32 flipx = sy & 0x2000; - INT32 flipy = sy & 0x4000; - INT32 multi = (1 << ((sy & 0x0600) >> 9)) - 1; - - sx &= 0x01ff; - sy &= 0x01ff; - if (sx >= 320) sx -= 512; - if (sy >= 256) sy -= 512; - sy = 240 - sy; - sx = 304 - sx; - - code &= ~multi; - - if (flipy) { - inc = -1; - } else { - code += multi; - inc = 1; - } - - if (*flipscreen) - { - sy = 240 - sy; - sx = 304 - sx; - flipx = !flipx; - flipy = !flipy; - mult = 16; - } - else - mult = -16; - - if (sx >= 320 || sx < -15 || sy >= nScreenHeight) continue; - - while (multi >= 0) - { - INT32 y = ((sy + mult * multi) & 0x1ff) - 8; - INT32 c = (code - multi * inc) & 0x3fff; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } - } - - multi--; - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - DrvPaletteRecalc(); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x300; - } - - if (nBurnLayer & 1) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_OPAQUE); - if (nBurnLayer & 2) deco16_draw_layer(0, pTransDraw, 0); - - if (nBurnLayer & 4) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[2] = (DrvDips[1] << 8) | (DrvDips[0] << 0); - } - - INT32 nInterleave = 232; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14000000 / 58, 8055000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += h6280Run(nCyclesTotal[1] / nInterleave); - - if (i == 206) deco16_vblank = 0x08; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - } - - return 0; -} - - -// Funky Jet (World, rev 1) - -static struct BurnRomInfo funkyjetRomDesc[] = { - { "jk00-1.12f", 0x40000, 0xce61579d, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jk01-1.13f", 0x40000, 0x274d04be, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jk02.16f", 0x10000, 0x748c0bd8, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "mat02", 0x80000, 0xe4b94c7e, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "mat01", 0x80000, 0x24093a8d, 4 | BRF_GRA }, // 4 Sprites - { "mat00", 0x80000, 0xfbda0228, 4 | BRF_GRA }, // 5 - - { "jk03.15h", 0x20000, 0x69a0eaf7, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(funkyjet) -STD_ROM_FN(funkyjet) - -struct BurnDriver BurnDrvFunkyjet = { - "funkyjet", NULL, NULL, NULL, "1992", - "Funky Jet (World, rev 1)\0", NULL, "[Data East] (Mitchell license)", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, funkyjetRomInfo, funkyjetRomName, NULL, NULL, FunkyjetInputInfo, FunkyjetDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Funky Jet (World) - -static struct BurnRomInfo funkyjetaRomDesc[] = { - { "jk00.12f", 0x40000, 0x712089c1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jk01.13f", 0x40000, 0xbe3920d7, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jk02.16f", 0x10000, 0x748c0bd8, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "mat02", 0x80000, 0xe4b94c7e, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "mat01", 0x80000, 0x24093a8d, 4 | BRF_GRA }, // 4 Sprites - { "mat00", 0x80000, 0xfbda0228, 4 | BRF_GRA }, // 5 - - { "jk03.15h", 0x20000, 0x69a0eaf7, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(funkyjeta) -STD_ROM_FN(funkyjeta) - -struct BurnDriver BurnDrvFunkyjeta = { - "funkyjeta", "funkyjet", NULL, NULL, "1992", - "Funky Jet (World)\0", NULL, "[Data East] (Mitchell license)", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, funkyjetaRomInfo, funkyjetaRomName, NULL, NULL, FunkyjetInputInfo, FunkyjetDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Funky Jet (Japan, rev 2) - -static struct BurnRomInfo funkyjetjRomDesc[] = { - { "jh00-2.11f", 0x40000, 0x5b98b700, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jh01-2.13f", 0x40000, 0x21280220, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jh02.16f", 0x10000, 0x748c0bd8, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "mat02", 0x80000, 0xe4b94c7e, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "mat01", 0x80000, 0x24093a8d, 4 | BRF_GRA }, // 4 Sprites - { "mat00", 0x80000, 0xfbda0228, 4 | BRF_GRA }, // 5 - - { "jh03.15h", 0x20000, 0x69a0eaf7, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(funkyjetj) -STD_ROM_FN(funkyjetj) - -struct BurnDriver BurnDrvFunkyjetj = { - "funkyjetj", "funkyjet", NULL, NULL, "1992", - "Funky Jet (Japan, rev 2)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, funkyjetjRomInfo, funkyjetjRomName, NULL, NULL, FunkyjetInputInfo, FunkyjetjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Sotsugyo Shousho - -static struct BurnRomInfo sotsugyoRomDesc[] = { - { "03.12f", 0x40000, 0xd175dfd1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "04.13f", 0x40000, 0x2072477c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sb020.16f", 0x10000, 0xbaf5ec93, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "02.2f", 0x80000, 0x337b1451, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "01.4a", 0x80000, 0xfa10dd54, 4 | BRF_GRA }, // 4 Sprites - { "00.2a", 0x80000, 0xd35a14ef, 4 | BRF_GRA }, // 5 - - { "sb030.15h", 0x20000, 0x1ea43f48, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(sotsugyo) -STD_ROM_FN(sotsugyo) - -struct BurnDriver BurnDrvSotsugyo = { - "sotsugyo", NULL, NULL, NULL, "1995", - "Sotsugyo Shousho\0", NULL, "Mitchell (Atlus license)", "DECO IC16", - L"\u5352\u696D\u8A3C\u66F8\0Sotsugyo Shousho\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_MINIGAMES, 0, - NULL, sotsugyoRomInfo, sotsugyoRomName, NULL, NULL, FunkyjetInputInfo, SotsugyoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_karnov.cpp b/jan/src/burn/drv/dataeast/d_karnov.cpp deleted file mode 100644 index 448e2a3cb..000000000 --- a/jan/src/burn/drv/dataeast/d_karnov.cpp +++ /dev/null @@ -1,1602 +0,0 @@ -// FB Alpha Chelnov / Karnov / Wonder Planet driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "m6502_intf.h" -#include "burn_ym2203.h" -#include "burn_ym3526.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv6502ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPfRAM; -static UINT8 *Drv6502RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; - -static UINT32 *Palette; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 *DrvScroll; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; - -static UINT16 i8751_return; -static UINT16 i8751_needs_ack; -static UINT16 i8751_coin_pending; -static UINT16 i8751_command_queue; -static INT32 i8751_level; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT16 DrvInput[3]; -static UINT8 DrvDip[2]; -static UINT8 DrvReset; - -#ifdef BUILD_A68K -static bool bUseAsm68KCoreOldValue = false; -#endif - -enum { KARNOV=0, KARNOVJ, CHELNOV, CHELNOVJ, CHELNOVW, WNDRPLNT }; -static INT32 microcontroller_id; -static INT32 coin_mask; -static INT32 vblank; - -static struct BurnInputInfo KarnovInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Karnov) - -static struct BurnInputInfo ChelnovInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Chelnov) - -static struct BurnDIPInfo KarnovDIPList[]= -{ - {0x14, 0xff, 0xff, 0xaf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x40, 0x00, "Upright" }, - {0x14, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x01, "1" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "5" }, - {0x15, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x0c, "50 K" }, - {0x15, 0x01, 0x0c, 0x08, "70 K" }, - {0x15, 0x01, 0x0c, 0x04, "90 K" }, - {0x15, 0x01, 0x0c, 0x00, "100 K" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x30, 0x30, "Easy" }, - {0x15, 0x01, 0x30, 0x10, "Normal" }, - {0x15, 0x01, 0x30, 0x20, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Timer Speed" }, - {0x15, 0x01, 0x80, 0x80, "Normal" }, - {0x15, 0x01, 0x80, 0x00, "Fast" }, -}; - -STDDIPINFO(Karnov) - -static struct BurnDIPInfo WndrplntDIPList[]= -{ - {0x14, 0xff, 0xff, 0x6f, NULL }, - {0x15, 0xff, 0xff, 0xd3, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x80, 0x00, "Upright" }, - {0x14, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x01, "1" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "5" }, - {0x15, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x10, 0x00, "No" }, - {0x15, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0xc0, 0x80, "Easy" }, - {0x15, 0x01, 0xc0, 0xc0, "Normal" }, - {0x15, 0x01, 0xc0, 0x40, "Hard" }, - {0x15, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Wndrplnt) - -static struct BurnDIPInfo ChelnovDIPList[]= -{ - {0x14, 0xff, 0xff, 0x6f, NULL }, - {0x15, 0xff, 0xff, 0xdf, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x03, 0x01, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x03, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x0c, 0x00, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x04, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x80, 0x00, "Upright" }, - {0x14, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x01, "1" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "5" }, - {0x15, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x0c, 0x04, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x08, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x10, 0x00, "No" }, - {0x15, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Chelnov) - -static struct BurnDIPInfo ChelnovuDIPList[]= -{ - {0x14, 0xff, 0xff, 0x6f, NULL }, - {0x15, 0xff, 0xff, 0xdf, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x80, 0x00, "Upright" }, - {0x14, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x01, "1" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "5" }, - {0x15, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x0c, 0x04, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x08, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x10, 0x00, "No" }, - {0x15, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Chelnovu) - -//------------------------------------------------------------------------------------------------ -// These are pretty much ripped straight from MAME - -static void karnov_i8751_w(INT32 data) -{ - if (i8751_needs_ack) - { - i8751_command_queue=data; - return; - } - - i8751_return=0; - if (data==0x100 && microcontroller_id==KARNOVJ) i8751_return=0x56a; /* Japan version */ - if (data==0x100 && microcontroller_id==KARNOV) i8751_return=0x56b; /* USA version */ - if ((data&0xf00)==0x300) i8751_return=(data&0xff)*0x12; /* Player sprite mapping */ - - if (data==0x400) i8751_return=0x4000; /* Get The Map... */ - if (data==0x402) i8751_return=0x40a6; /* Ancient Ruins */ - if (data==0x403) i8751_return=0x4054; /* Forest... */ - if (data==0x404) i8751_return=0x40de; /* ^Rocky hills */ - if (data==0x405) i8751_return=0x4182; /* Sea */ - if (data==0x406) i8751_return=0x41ca; /* Town */ - if (data==0x407) i8751_return=0x421e; /* Desert */ - if (data==0x401) i8751_return=0x4138; /* ^Whistling wind */ - if (data==0x408) i8751_return=0x4276; /* ^Heavy Gates */ - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); /* Signal main cpu task is complete */ - i8751_needs_ack=1; -} - -static void wndrplnt_i8751_w(INT32 data) -{ - if (i8751_needs_ack) - { - i8751_command_queue=data; - return; - } - - i8751_return=0; - if (data==0x100) i8751_return=0x67a; - if (data==0x200) i8751_return=0x214; - if (data==0x300) i8751_return=0x17; /* Copyright text on title screen */ -// if (data==0x300) i8751_return=0x1; /* (USA) Copyright text on title screen */ - - if ((data&0x600)==0x600) - { - switch (data&0x18) - { - case 0x00: i8751_return=0x4d53; break; - case 0x08: i8751_return=0x4b54; break; - case 0x10: i8751_return=0x5453; break; - case 0x18: i8751_return=0x5341; break; - } - } - - if (data==0x400) i8751_return=0x594; - if (data==0x401) i8751_return=0x5ea; - if (data==0x402) i8751_return=0x628; - if (data==0x403) i8751_return=0x66c; - if (data==0x404) i8751_return=0x6a4; - if (data==0x405) i8751_return=0x6a4; - if (data==0x406) i8751_return=0x6a4; - - if (data==0x50c) i8751_return=0x13fc; - if (data==0x50b) i8751_return=0x00ff; - if (data==0x50a) i8751_return=0x0006; - if (data==0x509) i8751_return=0x0000; - if (data==0x508) i8751_return=0x4a39; - if (data==0x507) i8751_return=0x0006; - if (data==0x506) i8751_return=0x0000; - if (data==0x505) i8751_return=0x66f8; - if (data==0x504) i8751_return=0x4a39; - if (data==0x503) i8751_return=0x000c; - if (data==0x502) i8751_return=0x0003; - if (data==0x501) i8751_return=0x6bf8; - if (data==0x500) i8751_return=0x4e75; - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - i8751_needs_ack=1; -} - -static void chelnov_i8751_w(INT32 data) -{ - if (i8751_needs_ack) - { - i8751_command_queue=data; - return; - } - - i8751_return=0; - if (data==0x200 && microcontroller_id==CHELNOVJ) i8751_return=0x7734; /* Japan version */ - if (data==0x200 && microcontroller_id==CHELNOV) i8751_return=0x783e; /* USA version */ - if (data==0x200 && microcontroller_id==CHELNOVW) i8751_return=0x7736; /* World version */ - if (data==0x100 && microcontroller_id==CHELNOVJ) i8751_return=0x71a; /* Japan version */ - if (data==0x100 && microcontroller_id==CHELNOV) i8751_return=0x71b; /* USA version */ - if (data==0x100 && microcontroller_id==CHELNOVW) i8751_return=0x71c; /* World version */ - - if ((data & 0xe000) == 0x6000) { - if (data & 0x1000) { - i8751_return = ((data & 0x0f) + ((data >> 4) & 0x0f)) * ((data >> 8) & 0x0f); - } else { - i8751_return = (data & 0x0f) * (((data >> 8) & 0x0f) + ((data >> 4) & 0x0f)); - } - } - - if ((data&0xf000)==0x1000) i8751_level=1; /* Level 1 */ - if ((data&0xf000)==0x2000) i8751_level++; /* Level Increment */ - - if ((data&0xf000)==0x3000) - { /* Sprite table mapping */ - INT32 b=data&0xff; - switch (i8751_level) - { - case 1: /* Level 1, Sprite mapping tables */ - if (microcontroller_id==CHELNOV) - { /* USA */ - if (b<2) i8751_return=0; - else if (b<6) i8751_return=1; - else if (b<0xb) i8751_return=2; - else if (b<0xf) i8751_return=3; - else if (b<0x13) i8751_return=4; - else i8751_return=5; - } - else - { /* Japan, World */ - if (b<3) i8751_return=0; - else if (b<8) i8751_return=1; - else if (b<0x0c) i8751_return=2; - else if (b<0x10) i8751_return=3; - else if (b<0x19) i8751_return=4; - else if (b<0x1b) i8751_return=5; - else if (b<0x22) i8751_return=6; - else if (b<0x28) i8751_return=7; - else i8751_return=8; - } - break; - case 2: /* Level 2, Sprite mapping tables, USA & Japan are the same */ - if (b<3) i8751_return=0; - else if (b<9) i8751_return=1; - else if (b<0x11) i8751_return=2; - else if (b<0x1b) i8751_return=3; - else if (b<0x21) i8751_return=4; - else if (b<0x28) i8751_return=5; - else i8751_return=6; - break; - case 3: /* Level 3, Sprite mapping tables, USA & Japan are the same */ - if (b<5) i8751_return=0; - else if (b<9) i8751_return=1; - else if (b<0x0d) i8751_return=2; - else if (b<0x11) i8751_return=3; - else if (b<0x1b) i8751_return=4; - else if (b<0x1c) i8751_return=5; - else if (b<0x22) i8751_return=6; - else if (b<0x27) i8751_return=7; - else i8751_return=8; - break; - case 4: /* Level 4, Sprite mapping tables, USA & Japan are the same */ - if (b<4) i8751_return=0; - else if (b<0x0c) i8751_return=1; - else if (b<0x0f) i8751_return=2; - else if (b<0x19) i8751_return=3; - else if (b<0x1c) i8751_return=4; - else if (b<0x22) i8751_return=5; - else if (b<0x29) i8751_return=6; - else i8751_return=7; - break; - case 5: /* Level 5, Sprite mapping tables */ - if (b<7) i8751_return=0; - else if (b<0x0e) i8751_return=1; - else if (b<0x14) i8751_return=2; - else if (b<0x1a) i8751_return=3; - else if (b<0x23) i8751_return=4; - else if (b<0x27) i8751_return=5; - else i8751_return=6; - break; - case 6: /* Level 6, Sprite mapping tables */ - if (b<3) i8751_return=0; - else if (b<0x0b) i8751_return=1; - else if (b<0x11) i8751_return=2; - else if (b<0x17) i8751_return=3; - else if (b<0x1d) i8751_return=4; - else if (b<0x24) i8751_return=5; - else i8751_return=6; - break; - case 7: /* Level 7, Sprite mapping tables */ - if (b<5) i8751_return=0; - else if (b<0x0b) i8751_return=1; - else if (b<0x11) i8751_return=2; - else if (b<0x1a) i8751_return=3; - else if (b<0x21) i8751_return=4; - else if (b<0x27) i8751_return=5; - else i8751_return=6; - break; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - i8751_needs_ack=1; -} - -static void karnov_control_w(INT32 offset, INT32 data) -{ - switch (offset<<1) - { - case 0: - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - - if (i8751_needs_ack) - { - if (i8751_coin_pending) - { - i8751_return=i8751_coin_pending; - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - i8751_coin_pending=0; - } - else if (i8751_command_queue) - { - i8751_needs_ack=0; - karnov_control_w(3,i8751_command_queue); - i8751_command_queue=0; - } - else - { - i8751_needs_ack=0; - } - } - return; - - case 2: - *soundlatch = data; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - break; - - case 4: - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - break; - - case 6: - if (microcontroller_id==KARNOV || microcontroller_id==KARNOVJ) karnov_i8751_w(data); - if (microcontroller_id==CHELNOV || microcontroller_id==CHELNOVJ || microcontroller_id==CHELNOVW) chelnov_i8751_w(data); - if (microcontroller_id==WNDRPLNT) wndrplnt_i8751_w(data); - break; - - case 8: - DrvScroll[0] = data; - *flipscreen = data >> 15; - break; - - case 0xa: - DrvScroll[1] = data; - break; - - case 0xc: - i8751_needs_ack=0; - i8751_coin_pending=0; - i8751_command_queue=0; - i8751_return=0; - break; - - case 0xe: - SekSetIRQLine(7, CPU_IRQSTATUS_NONE); - break; - } -} - -static UINT16 karnov_control_r(INT32 offset) -{ - switch (offset<<1) - { - case 0: - return DrvInput[0]; - case 2: - return DrvInput[1] ^ vblank; - case 4: - return (DrvDip[1] << 8) | DrvDip[0]; - case 6: - return i8751_return; - } - - return ~0; -} - -//------------------------------------------------------------------------------------------ - -void __fastcall karnov_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff800) == 0x0a1800) { - UINT16 *ptr = (UINT16*)DrvPfRAM; - - INT32 offset = (address >> 1) & 0x3ff; - offset = ((offset & 0x1f) << 5) | ((offset & 0x3e0) >> 5); - - ptr[offset] = BURN_ENDIAN_SWAP_INT16(data); - return; - } - - if ((address & 0xfffff0) == 0x0c0000) { - karnov_control_w((address >> 1) & 0x07, data); - return; - } -} - -void __fastcall karnov_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff800) == 0x0a1800) { - INT32 offset = (address >> 1) & 0x3ff; - offset = ((offset & 0x1f) << 5) | ((offset & 0x3e0) >> 5); - - DrvPfRAM[(offset << 1) | (~address & 1)] = data; - return; - } - - if ((address & 0xfffff0) == 0x0c0000) { - karnov_control_w((address >> 1) & 0x07, data); - - } -} - -UINT16 __fastcall karnov_main_read_word(UINT32 address) -{ - if ((address & 0xfffff0) == 0x0c0000) { - return karnov_control_r((address >> 1) & 7); - } - - return 0; -} - -UINT8 __fastcall karnov_main_read_byte(UINT32 address) -{ - if ((address & 0xfffff0) == 0x0c0000) { - return karnov_control_r((address >> 1) & 7) >> ((~address & 1) << 3); - } - - return 0; -} - -void karnov_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1000: - case 0x1001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0x1800: - case 0x1801: - BurnYM3526Write(address & 1, data); - return; - } -} - -UINT8 karnov_sound_read(UINT16 address) -{ - switch (address) - { - case 0x0800: -// m6502SetIRQ(M6502_CLEAR); - return *soundlatch; - } - - return 0; -} - -static void DrvYM3526FMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_ACK); - } else { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvYM3526SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6502TotalCycles() * nSoundRate / 1500000; -} - -static INT32 DrvYM2203SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)SekTotalCycles() * nSoundRate / 10000000; -} - -static double DrvYM2203GetTime() -{ - return (double)SekTotalCycles() / 10000000; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - M6502Open(0); - - SekReset(); - M6502Reset(); - - BurnYM3526Reset(); - BurnYM2203Reset(); - - M6502Close(); - SekClose(); - - HiscoreReset(); - - i8751_return = 0; - i8751_needs_ack = 0; - i8751_coin_pending = 0; - i8751_command_queue = 0; - i8751_level = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x060000; - Drv6502ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x100000; - - DrvColPROM = Next; Next += 0x000800; - - Palette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvPfRAM = Next; Next += 0x000800; - Drv6502RAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001000; - DrvSprBuf = Next; Next += 0x001000; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - DrvScroll = (UINT16*)Next; Next += 0x0002 * sizeof(UINT16); - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x300; i++) - { - INT32 bit0,bit1,bit2,bit3,r,g,b; - - bit0 = (DrvColPROM[0x000 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[0x000 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[0x000 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[0x000 + i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[0x000 + i] >> 4) & 0x01; - bit1 = (DrvColPROM[0x000 + i] >> 5) & 0x01; - bit2 = (DrvColPROM[0x000 + i] >> 6) & 0x01; - bit3 = (DrvColPROM[0x000 + i] >> 7) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[0x400 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[0x400 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[0x400 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[0x400 + i] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - Palette[i] = (r << 16) | (g << 8) | b; - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { 0x6000*8,0x4000*8,0x2000*8 }; - INT32 Plane1[4] = { 0x60000*8,0x00000*8,0x20000*8,0x40000*8 }; - INT32 XOffs[16] = { 16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8), 0,1,2,3,4,5,6,7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 3, 8, 8, Plane0, XOffs + 8, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs + 0, YOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs + 0, YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 5, 2)) return 1; - - if (BurnLoadRom(Drv6502ROM + 0x08000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 11, 1)) return 1; - - if (microcontroller_id == CHELNOVJ || microcontroller_id == CHELNOVW || microcontroller_id == CHELNOV) { - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 15, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 17, 1)) return 1; - - // hack to bypass infinite loop waiting for mcu response - *((UINT16*)(Drv68KROM + 0x062a)) = BURN_ENDIAN_SWAP_INT16(0x4E71); - } else { - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x50000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x70000, 19, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 21, 1)) return 1; - } - - DrvPaletteInit(); - DrvGfxDecode(); - } - -#ifdef BUILD_A68K - // These games really don't like the ASM core, so disable it for now - // and restore it on exit. - if (bBurnUseASMCPUEmulation) { - bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation; - bBurnUseASMCPUEmulation = false; - } -#endif - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x060000, 0x063fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x0a0000, 0x0a07ff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x0a0800, 0x0a0fff, MAP_RAM); - SekMapMemory(DrvPfRAM, 0x0a1000, 0x0a17ff, MAP_WRITE); - SekSetWriteWordHandler(0, karnov_main_write_word); - SekSetWriteByteHandler(0, karnov_main_write_byte); - SekSetReadWordHandler(0, karnov_main_read_word); - SekSetReadByteHandler(0, karnov_main_read_byte); - SekClose(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Drv6502RAM, 0x0000, 0x05ff, MAP_RAM); - M6502MapMemory(Drv6502ROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6502SetReadHandler(karnov_sound_read); - M6502SetWriteHandler(karnov_sound_write); - M6502Close(); - - BurnYM3526Init(3000000, &DrvYM3526FMIRQHandler, &DrvYM3526SynchroniseStream, 0); - BurnTimerAttachM6502YM3526(1500000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 1500000, NULL, DrvYM2203SynchroniseStream, DrvYM2203GetTime, 1); - BurnTimerAttachSek(10000000); - BurnYM2203SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - M6502Exit(); - - BurnYM3526Exit(); - BurnYM2203Exit(); - - BurnFree (AllMem); - -#ifdef BUILD_A68K - if (bUseAsm68KCoreOldValue) { - bBurnUseASMCPUEmulation = true; - } -#endif - - return 0; -} - -static void draw_txt_layer(INT32 swap) -{ - UINT16 *vram = (UINT16*)DrvVidRAM; - for (INT32 offs = 0x20; offs < 0x3e0; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - if (swap) { - INT32 t = sx; - sx = sy; - sy = t; - } - - if (*flipscreen) { - sy ^= 0xf8; - sx ^= 0xf8; - } - - if (microcontroller_id == WNDRPLNT) { - sy -= 8; - } - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]) & 0x0fff; - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[offs]) >> 14; - - if (code == 0) continue; - - if (*flipscreen) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } - } -} - -static void draw_bg_layer() -{ - INT32 scrollx = DrvScroll[0] & 0x1ff; - INT32 scrolly = DrvScroll[1] & 0x1ff; - - UINT16 *vram = (UINT16*)DrvPfRAM; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sy -= scrolly; - if (sy < -15) sy+=512; - sx -= scrollx; - if (sx < -15) sx+=512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 code = attr & 0x7ff; - INT32 color= attr >> 12; - - if (*flipscreen) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, 240 - sx, (240 - sy) - 8, color, 4, 0x200, DrvGfxROM1); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x200, DrvGfxROM1); - } - } -} - -static inline void sprite_routine(INT32 code, INT32 sx, INT32 sy, INT32 color, INT32 fy, INT32 fx) -{ - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM2); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM2); - } - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprBuf; - - for (INT32 offs = 0; offs < 0x800; offs+=4) - { - INT32 y = BURN_ENDIAN_SWAP_INT16(ram[offs]); - INT32 x = BURN_ENDIAN_SWAP_INT16(ram[offs + 2]) & 0x1ff; - if (~y & 0x8000) continue; - y &= 0x1ff; - - INT32 sprite = BURN_ENDIAN_SWAP_INT16(ram[offs + 3]); - INT32 color = sprite >> 12; - sprite &= 0xfff; - - INT32 flipx = BURN_ENDIAN_SWAP_INT16(ram[offs + 1]); - INT32 flipy = flipx & 0x02; - INT32 extra = flipx & 0x10; - flipx &= 0x04; - - x = (x + 16) & 0x1ff; - y = (y + 16 + extra) & 0x1ff; - x = 256 - x; - y = 256 - y; - - if (*flipscreen) { - y = 240 - y; - x = 240 - x; - flipx ^= 0x04; - flipy ^= 0x02; - if (extra) y -= 16; - y -= 8; - } - - INT32 sprite2 = sprite + 1; - if (extra && flipy) { - sprite2--; - sprite++; - } - - sprite_routine(sprite, x, y, color, flipy, flipx); - - if (extra) sprite_routine(sprite2, x, y + 16, color, flipy, flipx); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - for (INT32 i = 0; i < 0x300; i++) { - INT32 d = Palette[i]; - - r = d >> 16; - g = d >> 8; - b = d >> 0; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - DrvRecalc = 0; - } - - draw_bg_layer(); - draw_sprites(); - draw_txt_layer(microcontroller_id == WNDRPLNT); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvInterrupt() -{ - static INT32 latch = 0; - - if (DrvInput[2] == coin_mask) latch=1; - if (DrvInput[2] != coin_mask && latch) - { - if (i8751_needs_ack) - { - i8751_coin_pending = DrvInput[2] | 0x8000; - } - else - { - i8751_return = DrvInput[2] | 0x8000; - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekRun(100); - i8751_needs_ack=1; - } - latch=0; - } - - SekSetIRQLine(7, CPU_IRQSTATUS_AUTO); -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - M6502NewFrame(); - - { - memset (DrvInput, 0xff, 2 * sizeof(INT16)); - DrvInput[2] = coin_mask; - for (INT32 i = 0; i < 16; i++) { - DrvInput[0] ^= (DrvJoy1[i] & 1) << i; - DrvInput[1] ^= (DrvJoy2[i] & 1) << i; - DrvInput[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 10000000 / 60, 1500000 / 60 }; - - M6502Open(0); - SekOpen(0); - - vblank = 0x80; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 240) { - vblank = 0x00; - DrvInterrupt(); - } - - BurnTimerUpdate((i + 1) * (nCyclesTotal[0] / nInterleave)); - - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - M6502Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - M6502Scan(nAction); - - SekOpen(0); - M6502Open(0); - BurnYM3526Scan(nAction, pnMin); - BurnYM2203Scan(nAction, pnMin); - M6502Close(); - SekClose(); - - if (nAction & ACB_WRITE) { - BurnYM2203Reset(); // Prevent hung sounds on savestate load (weird!) - dink - } - - SCAN_VAR(i8751_return); - SCAN_VAR(i8751_needs_ack); - SCAN_VAR(i8751_coin_pending); - SCAN_VAR(i8751_command_queue); - SCAN_VAR(i8751_level); - } - - return 0; -} - - -// Karnov (US, rev 6) - -static struct BurnRomInfo karnovRomDesc[] = { - { "dn08-6", 0x10000, 0x4c60837f, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "dn11-6", 0x10000, 0xcd4abb99, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dn07-", 0x10000, 0xfc14291b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dn10-", 0x10000, 0xa4a34e37, 1 | BRF_PRG | BRF_ESS }, // 3 - { "dn06-5", 0x10000, 0x29d64e42, 1 | BRF_PRG | BRF_ESS }, // 4 - { "dn09-5", 0x10000, 0x072d7c49, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "dn05-5", 0x08000, 0xfa1a31a8, 2 | BRF_PRG | BRF_ESS }, // 6 m6502 Code - - { "dn00-", 0x08000, 0x0ed77c6d, 3 | BRF_GRA}, // 7 Characters - - { "dn04-", 0x10000, 0xa9121653, 4 | BRF_GRA}, // 8 Tiles - { "dn01-", 0x10000, 0x18697c9e, 4 | BRF_GRA}, // 9 - { "dn03-", 0x10000, 0x90d9dd9c, 4 | BRF_GRA}, // 10 - { "dn02-", 0x10000, 0x1e04d7b9, 4 | BRF_GRA}, // 11 - - { "dn12-", 0x10000, 0x9806772c, 5 | BRF_GRA}, // 12 Sprites - { "dn14-5", 0x08000, 0xac9e6732, 5 | BRF_GRA}, // 13 - { "dn13-", 0x10000, 0xa03308f9, 5 | BRF_GRA}, // 14 - { "dn15-5", 0x08000, 0x8933fcb8, 5 | BRF_GRA}, // 15 - { "dn16-", 0x10000, 0x55e63a11, 5 | BRF_GRA}, // 16 - { "dn17-5", 0x08000, 0xb70ae950, 5 | BRF_GRA}, // 17 - { "dn18-", 0x10000, 0x2ad53213, 5 | BRF_GRA}, // 18 - { "dn19-5", 0x08000, 0x8fd4fa40, 5 | BRF_GRA}, // 19 - - { "karnprom.21", 0x00400, 0xaab0bb93, 6 | BRF_GRA}, // 20 Color Color Proms - { "karnprom.20", 0x00400, 0x02f78ffb, 6 | BRF_GRA}, // 21 - - { "karnov_i8751", 0x01000, 0x00000000, BRF_OPT | BRF_NODUMP}, -}; - -STD_ROM_PICK(karnov) -STD_ROM_FN(karnov) - -static INT32 KarnovInit() -{ - microcontroller_id = KARNOV; - coin_mask = 0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvKarnov = { - "karnov", NULL, NULL, NULL, "1987", - "Karnov (US, rev 6)\0", NULL, "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, karnovRomInfo, karnovRomName, NULL, NULL, KarnovInputInfo, KarnovDIPInfo, - KarnovInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x300, 256, 248, 4, 3 -}; - - -// Karnov (US, rev 5) - -static struct BurnRomInfo karnovaRomDesc[] = { - { "dn08-5", 0x10000, 0xdb92c264, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "dn11-5", 0x10000, 0x05669b4b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dn07-", 0x10000, 0xfc14291b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dn10-", 0x10000, 0xa4a34e37, 1 | BRF_PRG | BRF_ESS }, // 3 - { "dn06-5", 0x10000, 0x29d64e42, 1 | BRF_PRG | BRF_ESS }, // 4 - { "dn09-5", 0x10000, 0x072d7c49, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "dn05-5", 0x08000, 0xfa1a31a8, 2 | BRF_PRG | BRF_ESS }, // 6 m6502 Code - - { "dn00-", 0x08000, 0x0ed77c6d, 3 | BRF_GRA}, // 7 Characters - - { "dn04-", 0x10000, 0xa9121653, 4 | BRF_GRA}, // 8 Tiles - { "dn01-", 0x10000, 0x18697c9e, 4 | BRF_GRA}, // 9 - { "dn03-", 0x10000, 0x90d9dd9c, 4 | BRF_GRA}, // 10 - { "dn02-", 0x10000, 0x1e04d7b9, 4 | BRF_GRA}, // 11 - - { "dn12-", 0x10000, 0x9806772c, 5 | BRF_GRA}, // 12 Sprites - { "dn14-5", 0x08000, 0xac9e6732, 5 | BRF_GRA}, // 13 - { "dn13-", 0x10000, 0xa03308f9, 5 | BRF_GRA}, // 14 - { "dn15-5", 0x08000, 0x8933fcb8, 5 | BRF_GRA}, // 15 - { "dn16-", 0x10000, 0x55e63a11, 5 | BRF_GRA}, // 16 - { "dn17-5", 0x08000, 0xb70ae950, 5 | BRF_GRA}, // 17 - { "dn18-", 0x10000, 0x2ad53213, 5 | BRF_GRA}, // 18 - { "dn19-5", 0x08000, 0x8fd4fa40, 5 | BRF_GRA}, // 19 - - { "karnprom.21", 0x00400, 0xaab0bb93, 6 | BRF_GRA}, // 20 Color Color Proms - { "karnprom.20", 0x00400, 0x02f78ffb, 6 | BRF_GRA}, // 21 - - { "karnov_i8751", 0x01000, 0x00000000, BRF_OPT | BRF_NODUMP}, -}; - -STD_ROM_PICK(karnova) -STD_ROM_FN(karnova) - -struct BurnDriver BurnDrvKarnova = { - "karnova", "karnov", NULL, NULL, "1987", - "Karnov (US, rev 5)\0", NULL, "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, karnovaRomInfo, karnovaRomName, NULL, NULL, KarnovInputInfo, KarnovDIPInfo, - KarnovInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x300, 256, 248, 4, 3 -}; - - -// Karnov (Japan) - -static struct BurnRomInfo karnovjRomDesc[] = { - { "kar8", 0x10000, 0x3e17e268, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "kar11", 0x10000, 0x417c936d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dn07-", 0x10000, 0xfc14291b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dn10-", 0x10000, 0xa4a34e37, 1 | BRF_PRG | BRF_ESS }, // 3 - { "kar6", 0x10000, 0xc641e195, 1 | BRF_PRG | BRF_ESS }, // 4 - { "kar9", 0x10000, 0xd420658d, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "kar5", 0x08000, 0x7c9158f1, 2 | BRF_PRG | BRF_ESS }, // 6 m6502 Code - - { "dn00-", 0x08000, 0x0ed77c6d, 3 | BRF_GRA}, // 7 Characters - - { "dn04-", 0x10000, 0xa9121653, 4 | BRF_GRA}, // 8 Tiles - { "dn01-", 0x10000, 0x18697c9e, 4 | BRF_GRA}, // 9 - { "dn03-", 0x10000, 0x90d9dd9c, 4 | BRF_GRA}, // 10 - { "dn02-", 0x10000, 0x1e04d7b9, 4 | BRF_GRA}, // 11 - - { "dn12-", 0x10000, 0x9806772c, 5 | BRF_GRA}, // 12 Sprites - { "kar14", 0x08000, 0xc6b39595, 5 | BRF_GRA}, // 13 - { "dn13-", 0x10000, 0xa03308f9, 5 | BRF_GRA}, // 14 - { "kar15", 0x08000, 0x2f72cac0, 5 | BRF_GRA}, // 15 - { "dn16-", 0x10000, 0x55e63a11, 5 | BRF_GRA}, // 16 - { "kar17", 0x08000, 0x7851c70f, 5 | BRF_GRA}, // 17 - { "dn18-", 0x10000, 0x2ad53213, 5 | BRF_GRA}, // 18 - { "kar19", 0x08000, 0x7bc174bb, 5 | BRF_GRA}, // 19 - - { "karnprom.21", 0x00400, 0xaab0bb93, 6 | BRF_GRA}, // 20 Color Proms - { "karnprom.20", 0x00400, 0x02f78ffb, 6 | BRF_GRA}, // 21 - - { "karnovj_i8751", 0x01000, 0x00000000, BRF_OPT | BRF_NODUMP}, -}; - -STD_ROM_PICK(karnovj) -STD_ROM_FN(karnovj) - -static INT32 KarnovjInit() -{ - microcontroller_id = KARNOVJ; - coin_mask = 0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvKarnovj = { - "karnovj", "karnov", NULL, NULL, "1987", - "Karnov (Japan)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, karnovjRomInfo, karnovjRomName, NULL, NULL, KarnovInputInfo, KarnovDIPInfo, - KarnovjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x300, 256, 248, 4, 3 -}; - - -// Wonder Planet (Japan) - -static struct BurnRomInfo wndrplntRomDesc[] = { - { "ea08.bin", 0x10000, 0xb0578a14, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ea11.bin", 0x10000, 0x271edc6c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ea07.bin", 0x10000, 0x7095a7d5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ea10.bin", 0x10000, 0x81a96475, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ea06.bin", 0x10000, 0x5951add3, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ea09.bin", 0x10000, 0xc4b3cb1e, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "ea05.bin", 0x08000, 0x8dbb6231, 2 | BRF_PRG | BRF_ESS }, // 6 m6502 Code - - { "ea00.bin", 0x08000, 0x9f3cac4c, 3 | BRF_GRA}, // 7 Characters - - { "ea04.bin", 0x10000, 0x7d701344, 4 | BRF_GRA}, // 8 Tiles - { "ea01.bin", 0x10000, 0x18df55fb, 4 | BRF_GRA}, // 9 - { "ea03.bin", 0x10000, 0x922ef050, 4 | BRF_GRA}, // 10 - { "ea02.bin", 0x10000, 0x700fde70, 4 | BRF_GRA}, // 11 - - { "ea12.bin", 0x10000, 0xa6d4e99d, 5 | BRF_GRA}, // 12 Sprites - { "ea14.bin", 0x10000, 0x915ffdc9, 5 | BRF_GRA}, // 13 - { "ea13.bin", 0x10000, 0xcd839f3a, 5 | BRF_GRA}, // 14 - { "ea15.bin", 0x10000, 0xa1f14f16, 5 | BRF_GRA}, // 15 - { "ea16.bin", 0x10000, 0x7a1d8a9c, 5 | BRF_GRA}, // 16 - { "ea17.bin", 0x10000, 0x21a3223d, 5 | BRF_GRA}, // 17 - { "ea18.bin", 0x10000, 0x3fb2cec7, 5 | BRF_GRA}, // 18 - { "ea19.bin", 0x10000, 0x87cf03b5, 5 | BRF_GRA}, // 19 - - { "ea21.prm", 0x00400, 0xc8beab49, 6 | BRF_GRA}, // 20 Color Proms - { "ea20.prm", 0x00400, 0x619f9d1e, 6 | BRF_GRA}, // 21 - - { "wndrplnt_i8751", 0x01000, 0x00000000, BRF_OPT | BRF_NODUMP}, -}; - -STD_ROM_PICK(wndrplnt) -STD_ROM_FN(wndrplnt) - -static INT32 WndrplntInit() -{ - microcontroller_id = WNDRPLNT; - coin_mask = 0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvWndrplnt = { - "wndrplnt", NULL, NULL, NULL, "1987", - "Wonder Planet (Japan)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, wndrplntRomInfo, wndrplntRomName, NULL, NULL, KarnovInputInfo, WndrplntDIPInfo, - WndrplntInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x300, 248, 256, 3, 4 -}; - - -// Chelnov - Atomic Runner (World) - -static struct BurnRomInfo chelnovRomDesc[] = { - { "ee08-e.j16", 0x10000, 0x8275cc3a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ee11-e.j19", 0x10000, 0x889e40a0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a-j14.bin", 0x10000, 0x51465486, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a-j18.bin", 0x10000, 0xd09dda33, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ee06-e.j13", 0x10000, 0x55acafdb, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ee09-e.j17", 0x10000, 0x303e252c, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "ee05-.f3", 0x08000, 0x6a8936b4, 2 | BRF_PRG | BRF_ESS }, // 6 m6502 Code - - { "ee00-e.c5", 0x08000, 0xe06e5c6b, 3 | BRF_GRA}, // 7 Characters - - { "ee04-.d18", 0x10000, 0x96884f95, 4 | BRF_GRA}, // 8 Tiles - { "ee01-.c15", 0x10000, 0xf4b54057, 4 | BRF_GRA}, // 9 - { "ee03-.d15", 0x10000, 0x7178e182, 4 | BRF_GRA}, // 10 - { "ee02-.c18", 0x10000, 0x9d7c45ae, 4 | BRF_GRA}, // 11 - - { "ee12-.f8", 0x10000, 0x9b1c53a5, 5 | BRF_GRA}, // 12 Sprites - { "ee13-.f9", 0x10000, 0x72b8ae3e, 5 | BRF_GRA}, // 13 - { "ee14-.f13", 0x10000, 0xd8f4bbde, 5 | BRF_GRA}, // 14 - { "ee15-.f15", 0x10000, 0x81e3e68b, 5 | BRF_GRA}, // 15 - - { "ee21.k8", 0x00400, 0xb1db6586, 6 | BRF_GRA}, // 16 Color Proms - { "ee20.l6", 0x00400, 0x41816132, 6 | BRF_GRA}, // 17 - - { "chelnov_i8751", 0x01000, 0x00000000, BRF_OPT | BRF_NODUMP}, -}; - -STD_ROM_PICK(chelnov) -STD_ROM_FN(chelnov) - -static INT32 ChelnovInit() -{ - microcontroller_id = CHELNOVW; - coin_mask = 0xe0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvChelnov = { - "chelnov", NULL, NULL, NULL, "1988", - "Chelnov - Atomic Runner (World)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, chelnovRomInfo, chelnovRomName, NULL, NULL, ChelnovInputInfo, ChelnovDIPInfo, - ChelnovInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x300, 256, 248, 4, 3 -}; - - -// Chelnov - Atomic Runner (US) - -static struct BurnRomInfo chelnovuRomDesc[] = { - { "ee08-a.j15", 0x10000, 0x2f2fb37b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ee11-a.j20", 0x10000, 0xf306d05f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ee07-a.j14", 0x10000, 0x9c69ed56, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ee10-a.j18", 0x10000, 0xd5c5fe4b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ee06-e.j13", 0x10000, 0x55acafdb, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ee09-e.j17", 0x10000, 0x303e252c, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "ee05-.f3", 0x08000, 0x6a8936b4, 2 | BRF_PRG | BRF_ESS }, // 6 m6502 Code - - { "ee00-e.c5", 0x08000, 0xe06e5c6b, 3 | BRF_GRA}, // 7 Characters - - { "ee04-.d18", 0x10000, 0x96884f95, 4 | BRF_GRA}, // 8 Tiles - { "ee01-.c15", 0x10000, 0xf4b54057, 4 | BRF_GRA}, // 9 - { "ee03-.d15", 0x10000, 0x7178e182, 4 | BRF_GRA}, // 10 - { "ee02-.c18", 0x10000, 0x9d7c45ae, 4 | BRF_GRA}, // 11 - - { "ee12-.f8", 0x10000, 0x9b1c53a5, 5 | BRF_GRA}, // 12 Sprites - { "ee13-.f9", 0x10000, 0x72b8ae3e, 5 | BRF_GRA}, // 13 - { "ee14-.f13", 0x10000, 0xd8f4bbde, 5 | BRF_GRA}, // 14 - { "ee15-.f15", 0x10000, 0x81e3e68b, 5 | BRF_GRA}, // 15 - - { "ee21.k8", 0x00400, 0xb1db6586, 6 | BRF_GRA}, // 16 Color Proms - { "ee20.l6", 0x00400, 0x41816132, 6 | BRF_GRA}, // 17 - - { "chelnovu_i8751", 0x01000, 0x00000000, BRF_OPT | BRF_NODUMP}, -}; - -STD_ROM_PICK(chelnovu) -STD_ROM_FN(chelnovu) - -static INT32 ChelnovuInit() -{ - microcontroller_id = CHELNOV; - coin_mask = 0xe0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvChelnovu = { - "chelnovu", "chelnov", NULL, NULL, "1988", - "Chelnov - Atomic Runner (US)\0", NULL, "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, chelnovuRomInfo, chelnovuRomName, NULL, NULL, ChelnovInputInfo, ChelnovuDIPInfo, - ChelnovuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x300, 256, 248, 4, 3 -}; - - -// Chelnov - Atomic Runner (Japan) - -static struct BurnRomInfo chelnovjRomDesc[] = { - { "a-j15.bin", 0x10000, 0x1978cb52, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "a-j20.bin", 0x10000, 0xe0ed3d99, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a-j14.bin", 0x10000, 0x51465486, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a-j18.bin", 0x10000, 0xd09dda33, 1 | BRF_PRG | BRF_ESS }, // 3 - { "a-j13.bin", 0x10000, 0xcd991507, 1 | BRF_PRG | BRF_ESS }, // 4 - { "a-j17.bin", 0x10000, 0x977f601c, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "ee05-.f3", 0x08000, 0x6a8936b4, 2 | BRF_PRG | BRF_ESS }, // 6 m6502 Code - - { "a-c5.bin", 0x08000, 0x1abf2c6d, 3 | BRF_GRA}, // 7 Characters - - { "ee04-.d18", 0x10000, 0x96884f95, 4 | BRF_GRA}, // 8 Tiles - { "ee01-.c15", 0x10000, 0xf4b54057, 4 | BRF_GRA}, // 9 - { "ee03-.d15", 0x10000, 0x7178e182, 4 | BRF_GRA}, // 10 - { "ee02-.c18", 0x10000, 0x9d7c45ae, 4 | BRF_GRA}, // 11 - - { "ee12-.f8", 0x10000, 0x9b1c53a5, 5 | BRF_GRA}, // 12 Sprites - { "ee13-.f9", 0x10000, 0x72b8ae3e, 5 | BRF_GRA}, // 13 - { "ee14-.f13", 0x10000, 0xd8f4bbde, 5 | BRF_GRA}, // 14 - { "ee15-.f15", 0x10000, 0x81e3e68b, 5 | BRF_GRA}, // 15 - - { "a-k7.bin", 0x00400, 0x309c49d8, 6 | BRF_GRA}, // 16 Color Proms - { "ee20.l6", 0x00400, 0x41816132, 6 | BRF_GRA}, // 17 - - { "chelnovj_i8751", 0x01000, 0x00000000, BRF_OPT | BRF_NODUMP}, -}; - -STD_ROM_PICK(chelnovj) -STD_ROM_FN(chelnovj) - -static INT32 ChelnovjInit() -{ - microcontroller_id = CHELNOVJ; - coin_mask = 0xe0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvChelnovj = { - "chelnovj", "chelnov", NULL, NULL, "1988", - "Chelnov - Atomic Runner (Japan)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, chelnovjRomInfo, chelnovjRomName, NULL, NULL, ChelnovInputInfo, ChelnovuDIPInfo, - ChelnovjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x300, 256, 248, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_kchamp.cpp b/jan/src/burn/drv/dataeast/d_kchamp.cpp deleted file mode 100644 index ea48ed4f8..000000000 --- a/jan/src/burn/drv/dataeast/d_kchamp.cpp +++ /dev/null @@ -1,1149 +0,0 @@ -// FB Alpha Karate Champ driver module -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "dac.h" -#include "msm5205.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80Ops; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAMA; -static UINT8 *DrvZ80RAMB; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static UINT8 nmi_enable; -static UINT8 sound_nmi_enable; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 msm_play_lo_nibble; -static UINT8 msm_data; -static UINT8 msmcounter; - -static struct BurnInputInfo KchampInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up (left)", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down (left)", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left (left)", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right (left)", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Up (right)", BIT_DIGITAL, DrvJoy1 + 6, "p3 up" }, - {"P1 Down (right)", BIT_DIGITAL, DrvJoy1 + 7, "p3 down" }, - {"P1 Left (right)", BIT_DIGITAL, DrvJoy1 + 5, "p3 left" }, - {"P1 Right (right)", BIT_DIGITAL, DrvJoy1 + 4, "p3 right" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Up (left)", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down (left)", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left (left)", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right (left)", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Up (right)", BIT_DIGITAL, DrvJoy2 + 6, "p4 up" }, - {"P2 Down (right)", BIT_DIGITAL, DrvJoy2 + 7, "p4 down" }, - {"P2 Left (right)", BIT_DIGITAL, DrvJoy2 + 5, "p4 left" }, - {"P2 Right (right)", BIT_DIGITAL, DrvJoy2 + 4, "p4 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Kchamp) - -static struct BurnDIPInfo KchampDIPList[]= -{ - {0x15, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x0c, 0x00, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x15, 0x01, 0x10, 0x00, "Hard" }, - {0x15, 0x01, 0x10, 0x10, "Normal" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x80, 0x00, "Upright" }, - {0x15, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Kchamp) - -static struct BurnDIPInfo KchampvsDIPList[]= -{ - {0x15, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x0c, 0x00, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x15, 0x01, 0x10, 0x00, "Hard" }, - {0x15, 0x01, 0x10, 0x10, "Normal" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, -}; - -STDDIPINFO(Kchampvs) - -static void __fastcall kchamp_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x80: - flipscreen = data & 1; - return; - - case 0x81: - nmi_enable = data & 1; - return; - - case 0xa8: - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(0); - return; - } -} - -static UINT8 __fastcall kchamp_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x80: - return DrvDips[0]; - - case 0x90: - return DrvInputs[0]; - - case 0x98: - return DrvInputs[1]; - - case 0xa0: - return DrvInputs[2]; - - case 0xa8: - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - return 0; - } - - return 0; -} - -static void __fastcall kchamp_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - AY8910Write((port/2)&1, ~port & 1, data); - return; - - case 0x04: - DACWrite(0, data); - return; - - case 0x05: - sound_nmi_enable = data & 0x80; - return; - } -} - -static UINT8 __fastcall kchamp_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x06: - return soundlatch; - } - - return 0; -} - -static void __fastcall kchampvs_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - flipscreen = data & 1; - return; - - case 0x01: - nmi_enable = data & 1; - return; - - case 0x02: - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - return; - - case 0x40: - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(0); - return; - } -} - -static UINT8 __fastcall kchampvs_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return DrvInputs[0]; - - case 0x40: - return DrvInputs[1]; - - case 0x80: - return DrvInputs[2]; - - case 0xc0: - return DrvDips[0]; - } - - return 0; -} - -static void __fastcall kchampvs_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - AY8910Write((port/2)&1, ~port & 1, data); - return; - - case 0x04: - msm_data = data; - msm_play_lo_nibble = 1; - return; - - case 0x05: - MSM5205ResetWrite(0, ~data & 1); - sound_nmi_enable = data & 0x02; - return; - } -} - -static UINT8 __fastcall kchampvs_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x01: - return soundlatch; - } - - return 0; -} - -static void kchampvs_adpcm_interrupt() -{ - if (msm_play_lo_nibble) - MSM5205DataWrite(0, msm_data & 0x0f); - else - MSM5205DataWrite(0, msm_data >> 4); - - msm_play_lo_nibble = !msm_play_lo_nibble; - - if (!(msmcounter ^= 1) && sound_nmi_enable) { - ZetNmi(); - } -} - -static INT32 SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3000000; -} - -static INT32 DrvDACSync() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3000000.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - DACReset(); - MSM5205Reset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - nmi_enable = 0; - sound_nmi_enable = 0; - soundlatch = 0; - flipscreen = 0; - msm_play_lo_nibble = 1; - msm_data = 0; - msmcounter = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80Ops = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x080000; - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x100 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAMA = Next; Next += 0x002000; - DrvZ80RAMB = Next; Next += 0x002000; - DrvZ80RAM1 = Next; Next += 0x00a000; - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000100; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0x4000*8, 0 }; - INT32 Plane1[2] = { 0xc000*8, 0 }; - INT32 XOffs[16] = { STEP8(0,1), STEP8(0x2000*8,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(8*8,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x18000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x8000); - - GfxDecode(0x0800, 2, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x18000); - - GfxDecode(0x0200, 2, 16, 16, Plane1, XOffs, YOffs, 0x080, tmp + 0x8000, DrvGfxROM1 + 0x40000); - GfxDecode(0x0200, 2, 16, 16, Plane1, XOffs, YOffs, 0x080, tmp + 0x4000, DrvGfxROM1 + 0x20000); - GfxDecode(0x0200, 2, 16, 16, Plane1, XOffs, YOffs, 0x080, tmp + 0x0000, DrvGfxROM1 + 0x00000); - - BurnFree(tmp); - - return 0; -} - -static INT32 KchampInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x0a000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 7, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 8, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x06000, 9, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x08000, 10, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x0a000, 11, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x0c000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0e000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x12000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x14000, 25, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x16000, 26, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 27, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 28, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 29, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAMA, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0xe400, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xea00, 0xeaff, MAP_RAM); - ZetMapMemory(DrvZ80RAMB, 0xeb00, 0xffff, MAP_RAM); - ZetSetOutHandler(kchamp_main_write_port); - ZetSetInHandler(kchamp_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xdfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xe000, 0xe2ff, MAP_RAM); - ZetSetOutHandler(kchamp_sound_write_port); - ZetSetInHandler(kchamp_sound_read_port); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvDACSync); - DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - // not used in this hardware - MSM5205Init(0, SynchroniseStream, 375000, kchampvs_adpcm_interrupt, MSM5205_S96_4B, 1); - MSM5205SetRoute(0, 0.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static void decode() -{ - for (int A = 0; A < 0x10000; A++) - DrvZ80Ops[A] = (DrvZ80ROM0[A] & 0x55) | ((DrvZ80ROM0[A] & 0x88) >> 2) | ((DrvZ80ROM0[A] & 0x22) << 2); -} - -static INT32 KchampvsInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x0a000, 5, 1)) return 1; - memcpy (DrvZ80ROM0 + 0xe000, DrvZ80ROM0 + 0xc000, 0x2000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 7, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x06000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0e000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x12000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x14000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x16000, 24, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 25, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 26, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 27, 1)) return 1; - - DrvGfxDecode(); - decode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAMA, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xd000, 0xd3ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0xd400, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd800, 0xd9ff, MAP_RAM); - ZetMapMemory(DrvZ80RAMB, 0xd900, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80ROM0 + 0xe000, 0xe000, 0xffff, MAP_ROM); -// ZetMapMemory(DrvZ80Ops, 0x0000, 0xffff, MAP_FETCH); - ZetMapArea(0x0000, 0xffff, 2, DrvZ80Ops, DrvZ80ROM0); - ZetSetOutHandler(kchampvs_main_write_port); - ZetSetInHandler(kchampvs_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x6000, 0xffff, MAP_RAM); - ZetSetOutHandler(kchampvs_sound_write_port); - ZetSetInHandler(kchampvs_sound_read_port); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, SynchroniseStream, 375000, kchampvs_adpcm_interrupt, MSM5205_S96_4B, 1); - MSM5205SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - // not used on this hardware - DACInit(0, 0, 1, DrvDACSync); - DACSetRoute(0, 0.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - MSM5205Exit(); - DACExit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 r = DrvColPROM[0x000 + i] & 0xf; - UINT8 g = DrvColPROM[0x100 + i] & 0xf; - UINT8 b = DrvColPROM[0x200 + i] & 0xf; - - r += r * 16; - g += g * 16; - b += b * 16; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_layer() -{ - for (INT32 offs = (2 * 32); offs < (32 * 32) - (2 * 32); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + ((attr & 0x07) * 256); - INT32 color= (attr >> 3) & 0x1f; - - Render8x8Tile(pTransDraw, code, sx, sy - 16, color, 2, 0x80, DrvGfxROM0); - } -} - -static void draw_sprites(INT32 sxoffs, INT32 syoffs) -{ - INT32 banks[4] = { 0x400, 0x200, 0 }; - - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - INT32 attr = DrvSprRAM[offs + 2]; - INT32 code = DrvSprRAM[offs + 1] + ((attr & 0x10) << 4) + banks[(attr >> 5) & 3]; - INT32 color = attr & 0x0f; - INT32 flipx = 0; - INT32 flipy = attr & 0x80; - INT32 sx = DrvSprRAM[offs + 3] - sxoffs; - INT32 sy = syoffs - DrvSprRAM[offs]; - - if ((nBurnLayer & (1 << ((attr>>5)&3))) == 0) continue; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM1); - } - } - } -} - -static INT32 KchampDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(8,247); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 KchampFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 40; - INT32 nCyclesTotal[2] = { 3000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (nmi_enable && i == 39) ZetNmi(); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - if (sound_nmi_enable && (i == 20 || i == 39)) ZetNmi(); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - KchampDraw(); - } - - return 0; -} - -static INT32 KchampvsDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(0,240); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 KchampvsFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = MSM5205CalcInterleave(0, 3000000); - INT32 nCyclesTotal[2] = { 3000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (nmi_enable && i == (nInterleave - 1)) ZetNmi(); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - MSM5205Update(); - - ZetClose(); - } - - ZetOpen(1); - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - KchampvsDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(nmi_enable); - SCAN_VAR(sound_nmi_enable); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(msm_play_lo_nibble); - SCAN_VAR(msm_data); - } - - return 0; -} - - -// Karate Champ (US) - -static struct BurnRomInfo kchampRomDesc[] = { - { "b014.bin", 0x2000, 0x0000d1a0, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code #0 - { "b015.bin", 0x2000, 0x03fae67e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "b016.bin", 0x2000, 0x3b6e1d08, 1 | BRF_PRG | BRF_ESS }, // 2 - { "b017.bin", 0x2000, 0xc1848d1a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "b018.bin", 0x2000, 0xb824abc7, 1 | BRF_PRG | BRF_ESS }, // 4 - { "b019.bin", 0x2000, 0x3b487a46, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "b026.bin", 0x2000, 0x999ed2c7, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code #1 - { "b025.bin", 0x2000, 0x33171e07, 2 | BRF_PRG | BRF_ESS }, // 7 - { "b024.bin", 0x2000, 0x910b48b9, 2 | BRF_PRG | BRF_ESS }, // 8 - { "b023.bin", 0x2000, 0x47f66aac, 2 | BRF_PRG | BRF_ESS }, // 9 - { "b022.bin", 0x2000, 0x5928e749, 2 | BRF_PRG | BRF_ESS }, // 10 - { "b021.bin", 0x2000, 0xca17e3ba, 2 | BRF_PRG | BRF_ESS }, // 11 - { "b020.bin", 0x2000, 0xada4f2cd, 2 | BRF_PRG | BRF_ESS }, // 12 - - { "b000.bin", 0x2000, 0xa4fa98a1, 3 | BRF_GRA }, // 13 Characters - { "b001.bin", 0x2000, 0xfea09f7c, 3 | BRF_GRA }, // 14 - - { "b013.bin", 0x2000, 0xeaad4168, 4 | BRF_GRA }, // 15 Sprites - { "b004.bin", 0x2000, 0x10a47e2d, 4 | BRF_GRA }, // 16 - { "b012.bin", 0x2000, 0xb4842ea9, 4 | BRF_GRA }, // 17 - { "b003.bin", 0x2000, 0x8cd166a5, 4 | BRF_GRA }, // 18 - { "b011.bin", 0x2000, 0x4cbd3aa3, 4 | BRF_GRA }, // 19 - { "b002.bin", 0x2000, 0x6be342a6, 4 | BRF_GRA }, // 20 - { "b007.bin", 0x2000, 0xcb91d16b, 4 | BRF_GRA }, // 21 - { "b010.bin", 0x2000, 0x489c9c04, 4 | BRF_GRA }, // 22 - { "b006.bin", 0x2000, 0x7346db8a, 4 | BRF_GRA }, // 23 - { "b009.bin", 0x2000, 0xb78714fc, 4 | BRF_GRA }, // 24 - { "b005.bin", 0x2000, 0xb2557102, 4 | BRF_GRA }, // 25 - { "b008.bin", 0x2000, 0xc85aba0e, 4 | BRF_GRA }, // 26 - - { "br27", 0x0100, 0xf683c54a, 5 | BRF_GRA }, // 27 Color data - { "br26", 0x0100, 0x3ddbb6c4, 5 | BRF_GRA }, // 28 - { "br25", 0x0100, 0xba4a5651, 5 | BRF_GRA }, // 29 -}; - -STD_ROM_PICK(kchamp) -STD_ROM_FN(kchamp) - -struct BurnDriver BurnDrvKchamp = { - "kchamp", NULL, NULL, NULL, "1984", - "Karate Champ (US)\0", NULL, "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, kchampRomInfo, kchampRomName, NULL, NULL, KchampInputInfo, KchampDIPInfo, - KchampInit, DrvExit, KchampFrame, KchampDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Karate Dou (Japan) - -static struct BurnRomInfo karatedoRomDesc[] = { - { "be14", 0x2000, 0x44e60aa0, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code #0 (Encrypted) - { "be15", 0x2000, 0xa65e3793, 1 | BRF_PRG | BRF_ESS }, // 1 - { "be16", 0x2000, 0x151d8872, 1 | BRF_PRG | BRF_ESS }, // 2 - { "be17", 0x2000, 0x8f393b6a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "be18", 0x2000, 0xa09046ad, 1 | BRF_PRG | BRF_ESS }, // 4 - { "be19", 0x2000, 0x0cdc4da9, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "be26", 0x2000, 0x999ab0a3, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code #1 - { "be25", 0x2000, 0x253bf0da, 2 | BRF_PRG | BRF_ESS }, // 7 - { "be24", 0x2000, 0xe2c188af, 2 | BRF_PRG | BRF_ESS }, // 8 - { "be23", 0x2000, 0x25262de1, 2 | BRF_PRG | BRF_ESS }, // 9 - { "be22", 0x2000, 0x38055c48, 2 | BRF_PRG | BRF_ESS }, // 10 - { "be21", 0x2000, 0x5f0efbe7, 2 | BRF_PRG | BRF_ESS }, // 11 - { "be20", 0x2000, 0xcbe8a533, 2 | BRF_PRG | BRF_ESS }, // 12 - - { "be00", 0x2000, 0xcec020f2, 3 | BRF_GRA }, // 13 Characters - { "be01", 0x2000, 0xcd96271c, 3 | BRF_GRA }, // 14 - - { "be13", 0x2000, 0xfb358707, 4 | BRF_GRA }, // 15 Sprites - { "be04", 0x2000, 0x48372bf8, 4 | BRF_GRA }, // 16 - { "b012.bin", 0x2000, 0xb4842ea9, 4 | BRF_GRA }, // 17 - { "b003.bin", 0x2000, 0x8cd166a5, 4 | BRF_GRA }, // 18 - { "b011.bin", 0x2000, 0x4cbd3aa3, 4 | BRF_GRA }, // 19 - { "b002.bin", 0x2000, 0x6be342a6, 4 | BRF_GRA }, // 20 - { "be07", 0x2000, 0x40f2b6fb, 4 | BRF_GRA }, // 21 - { "be10", 0x2000, 0x325c0a97, 4 | BRF_GRA }, // 22 - { "b006.bin", 0x2000, 0x7346db8a, 4 | BRF_GRA }, // 23 - { "b009.bin", 0x2000, 0xb78714fc, 4 | BRF_GRA }, // 24 - { "b005.bin", 0x2000, 0xb2557102, 4 | BRF_GRA }, // 25 - { "b008.bin", 0x2000, 0xc85aba0e, 4 | BRF_GRA }, // 26 - - { "br27", 0x0100, 0xf683c54a, 5 | BRF_GRA }, // 27 Color data - { "br26", 0x0100, 0x3ddbb6c4, 5 | BRF_GRA }, // 28 - { "br25", 0x0100, 0xba4a5651, 5 | BRF_GRA }, // 29 -}; - -STD_ROM_PICK(karatedo) -STD_ROM_FN(karatedo) - -struct BurnDriver BurnDrvKaratedo = { - "karatedo", "kchamp", NULL, NULL, "1984", - "Karate Dou (Japan)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, karatedoRomInfo, karatedoRomName, NULL, NULL, KchampInputInfo, KchampDIPInfo, - KchampInit, DrvExit, KchampFrame, KchampDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Karate Champ (US VS version, set 1) - -static struct BurnRomInfo kchampvsRomDesc[] = { - { "bs24.d13", 0x2000, 0x829da69b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code #0 (Encrypted) - { "bs23.d11", 0x2000, 0x091f810e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bs22.d10", 0x2000, 0xd4df2a52, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bs21.d8", 0x2000, 0x3d4ef0da, 1 | BRF_PRG | BRF_ESS }, // 3 - { "bs20.d7", 0x2000, 0x623a467b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "bs19.d6", 0x4000, 0x43e196c4, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "bs18.d4", 0x2000, 0xeaa646eb, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code #1 - { "bs17.d2", 0x2000, 0xd71031ad, 2 | BRF_PRG | BRF_ESS }, // 7 - { "bs16.d1", 0x2000, 0x6f811c43, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "bs12.k1", 0x2000, 0x4c574ecd, 3 | BRF_GRA }, // 9 Characters - { "bs13.k3", 0x2000, 0x750b66af, 3 | BRF_GRA }, // 10 - { "bs14.k5", 0x2000, 0x9ad6227c, 3 | BRF_GRA }, // 11 - { "bs15.k6", 0x2000, 0x3b6d5de5, 3 | BRF_GRA }, // 12 - - { "bs00.a1", 0x2000, 0x51eda56c, 4 | BRF_GRA }, // 13 Sprites - { "bs06.c1", 0x2000, 0x593264cf, 4 | BRF_GRA }, // 14 - { "bs01.a3", 0x2000, 0xb4842ea9, 4 | BRF_GRA }, // 15 - { "bs07.c3", 0x2000, 0x8cd166a5, 4 | BRF_GRA }, // 16 - { "bs02.a5", 0x2000, 0x4cbd3aa3, 4 | BRF_GRA }, // 17 - { "bs08.c5", 0x2000, 0x6be342a6, 4 | BRF_GRA }, // 18 - { "bs03.a6", 0x2000, 0x8dcd271a, 4 | BRF_GRA }, // 19 - { "bs09.c6", 0x2000, 0x4ee1dba7, 4 | BRF_GRA }, // 20 - { "bs04.a8", 0x2000, 0x7346db8a, 4 | BRF_GRA }, // 21 - { "bs10.c8", 0x2000, 0xb78714fc, 4 | BRF_GRA }, // 22 - { "bs05.a10", 0x2000, 0xb2557102, 4 | BRF_GRA }, // 23 - { "bs11.c10", 0x2000, 0xc85aba0e, 4 | BRF_GRA }, // 24 - - { "br27.k10", 0x0100, 0xf683c54a, 5 | BRF_GRA }, // 25 Color data - { "br26.k9", 0x0100, 0x3ddbb6c4, 5 | BRF_GRA }, // 26 - { "br25.k8", 0x0100, 0xba4a5651, 5 | BRF_GRA }, // 27 -}; - -STD_ROM_PICK(kchampvs) -STD_ROM_FN(kchampvs) - -static void patch_decode() -{ - UINT8 *rom = DrvZ80ROM0; - - DrvZ80Ops[0] = rom[0]; - INT32 A = rom[1] + 256 * rom[2]; - DrvZ80Ops[A] = rom[A]; - rom[A+1] ^= 0xee; - A = rom[A+1] + 256 * rom[A+2]; - DrvZ80Ops[A] = rom[A]; - A += 2; - DrvZ80Ops[A] = rom[A]; - - ZetOpen(0); - ZetReset(); // catch vectors - ZetClose(); -} - -static INT32 KchampvsInit1() -{ - INT32 nRet = KchampvsInit(); - - if (nRet == 0) { - patch_decode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvKchampvs = { - "kchampvs", "kchamp", NULL, NULL, "1984", - "Karate Champ (US VS version, set 1)\0", NULL, "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, kchampvsRomInfo, kchampvsRomName, NULL, NULL, KchampInputInfo, KchampvsDIPInfo, - KchampvsInit1, DrvExit, KchampvsFrame, KchampvsDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Karate Champ (US VS version, set 2) - -static struct BurnRomInfo kchampvs2RomDesc[] = { - { "lt.d13", 0x2000, 0xeef41aa8, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code #0 (Encrypted) - { "lt.d11", 0x2000, 0x091f810e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lt.d10", 0x2000, 0xd4df2a52, 1 | BRF_PRG | BRF_ESS }, // 2 - { "lt.d8", 0x2000, 0x3d4ef0da, 1 | BRF_PRG | BRF_ESS }, // 3 - { "lt.d7", 0x2000, 0x623a467b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "lt.d6", 0x4000, 0xc3bc6e46, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "lt.d4", 0x2000, 0xeaa646eb, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code #1 - { "lt.d2", 0x2000, 0xd71031ad, 2 | BRF_PRG | BRF_ESS }, // 7 - { "lt.d1", 0x2000, 0x6f811c43, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "lt.k1", 0x2000, 0x4c574ecd, 3 | BRF_GRA }, // 9 Characters - { "lt.k3", 0x2000, 0x750b66af, 3 | BRF_GRA }, // 10 - { "lt.k5", 0x2000, 0x9ad6227c, 3 | BRF_GRA }, // 11 - { "lt.k6", 0x2000, 0x3b6d5de5, 3 | BRF_GRA }, // 12 - - { "lt.a1", 0x2000, 0x51eda56c, 4 | BRF_GRA }, // 13 Sprites - { "lt.c1", 0x2000, 0x593264cf, 4 | BRF_GRA }, // 14 - { "lt.a3", 0x2000, 0xb4842ea9, 4 | BRF_GRA }, // 15 - { "lt.c3", 0x2000, 0x8cd166a5, 4 | BRF_GRA }, // 16 - { "lt.a5", 0x2000, 0x4cbd3aa3, 4 | BRF_GRA }, // 17 - { "lt.c5", 0x2000, 0x6be342a6, 4 | BRF_GRA }, // 18 - { "lt.a6", 0x2000, 0x8dcd271a, 4 | BRF_GRA }, // 19 - { "lt.c6", 0x2000, 0x4ee1dba7, 4 | BRF_GRA }, // 20 - { "lt.a8", 0x2000, 0x7346db8a, 4 | BRF_GRA }, // 21 - { "lt.c8", 0x2000, 0xb78714fc, 4 | BRF_GRA }, // 22 - { "lt.a10", 0x2000, 0xb2557102, 4 | BRF_GRA }, // 23 - { "lt.c10", 0x2000, 0xc85aba0e, 4 | BRF_GRA }, // 24 - - { "lt.k10", 0x0100, 0xf683c54a, 5 | BRF_GRA }, // 25 Color data - { "lt.k9", 0x0100, 0x3ddbb6c4, 5 | BRF_GRA }, // 26 - { "lt.k8", 0x0100, 0xba4a5651, 5 | BRF_GRA }, // 27 -}; - -STD_ROM_PICK(kchampvs2) -STD_ROM_FN(kchampvs2) - -struct BurnDriver BurnDrvKchampvs2 = { - "kchampvs2", "kchamp", NULL, NULL, "1984", - "Karate Champ (US VS version, set 2)\0", NULL, "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, kchampvs2RomInfo, kchampvs2RomName, NULL, NULL, KchampInputInfo, KchampvsDIPInfo, - KchampvsInit, DrvExit, KchampvsFrame, KchampvsDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Taisen Karate Dou (Japan VS version) - -static struct BurnRomInfo karatevsRomDesc[] = { - { "br24.d13", 0x2000, 0xea9cda49, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code #0 (Encrypted) - { "br23.d11", 0x2000, 0x46074489, 1 | BRF_PRG | BRF_ESS }, // 1 - { "br22.d10", 0x2000, 0x294f67ba, 1 | BRF_PRG | BRF_ESS }, // 2 - { "br21.d8", 0x2000, 0x934ea874, 1 | BRF_PRG | BRF_ESS }, // 3 - { "br20.d7", 0x2000, 0x97d7816a, 1 | BRF_PRG | BRF_ESS }, // 4 - { "br19.d6", 0x4000, 0xdd2239d2, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "br18.d4", 0x2000, 0x00ccb8ea, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code #1 - { "bs17.d2", 0x2000, 0xd71031ad, 2 | BRF_PRG | BRF_ESS }, // 7 - { "br16.d1", 0x2000, 0x2512d961, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "br12.k1", 0x2000, 0x9ed6f00d, 3 | BRF_GRA }, // 9 Characters - { "bs13.k3", 0x2000, 0x750b66af, 3 | BRF_GRA }, // 10 - { "br14.k5", 0x2000, 0xfc399229, 3 | BRF_GRA }, // 11 - { "bs15.k6", 0x2000, 0x3b6d5de5, 3 | BRF_GRA }, // 12 - - { "br00.a1", 0x2000, 0xc46a8b88, 4 | BRF_GRA }, // 13 Sprites - { "br06.c1", 0x2000, 0xcf8982ff, 4 | BRF_GRA }, // 14 - { "bs01.a3", 0x2000, 0xb4842ea9, 4 | BRF_GRA }, // 15 - { "bs07.c3", 0x2000, 0x8cd166a5, 4 | BRF_GRA }, // 16 - { "bs02.a5", 0x2000, 0x4cbd3aa3, 4 | BRF_GRA }, // 17 - { "bs08.c5", 0x2000, 0x6be342a6, 4 | BRF_GRA }, // 18 - { "br03.a6", 0x2000, 0xbde8a52b, 4 | BRF_GRA }, // 19 - { "br09.c6", 0x2000, 0xe9a5f945, 4 | BRF_GRA }, // 20 - { "bs04.a8", 0x2000, 0x7346db8a, 4 | BRF_GRA }, // 21 - { "bs10.c8", 0x2000, 0xb78714fc, 4 | BRF_GRA }, // 22 - { "bs05.a10", 0x2000, 0xb2557102, 4 | BRF_GRA }, // 23 - { "bs11.c10", 0x2000, 0xc85aba0e, 4 | BRF_GRA }, // 24 - - { "br27.k10", 0x0100, 0xf683c54a, 5 | BRF_GRA }, // 25 Color data - { "br26.k9", 0x0100, 0x3ddbb6c4, 5 | BRF_GRA }, // 26 - { "br25.k8", 0x0100, 0xba4a5651, 5 | BRF_GRA }, // 27 -}; - -STD_ROM_PICK(karatevs) -STD_ROM_FN(karatevs) - -struct BurnDriver BurnDrvKaratevs = { - "karatevs", "kchamp", NULL, NULL, "1984", - "Taisen Karate Dou (Japan VS version)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, karatevsRomInfo, karatevsRomName, NULL, NULL, KchampInputInfo, KchampvsDIPInfo, - KchampvsInit1, DrvExit, KchampvsFrame, KchampvsDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/dataeast/d_lemmings.cpp b/jan/src/burn/drv/dataeast/d_lemmings.cpp deleted file mode 100644 index ea6def9a8..000000000 --- a/jan/src/burn/drv/dataeast/d_lemmings.cpp +++ /dev/null @@ -1,778 +0,0 @@ -// FB Alpha Lemmings driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "burn_ym2151.h" -#include "m6809_intf.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvPxlRAM0; -static UINT8 *DrvPxlRAM1; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvSprBuf0; -static UINT8 *DrvSprBuf1; -static UINT8 *DrvSprTBuf0; -static UINT8 *DrvSprTBuf1; -static UINT8 *DrvCtrlRAM; - -static UINT8 *soundlatch; - -static UINT16 *pTempDraw; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static UINT8 FakeAnInp[8]; -static UINT8 FakeTrackBallX[2]; -static UINT8 FakeTrackBallY[2]; - -static struct BurnInputInfo LemmingsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, FakeAnInp + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, FakeAnInp + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, FakeAnInp + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, FakeAnInp + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, FakeAnInp + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, FakeAnInp + 5, "p2 down"}, - {"P2 Left", BIT_DIGITAL, FakeAnInp + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, FakeAnInp + 7, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Lemmings) - -static struct BurnDIPInfo LemmingsDIPList[]= -{ - {0x11, 0xff, 0xff, 0x04, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Credits for 1 Player" }, - {0x12, 0x01, 0x03, 0x03, "1" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x01, "3" }, - {0x12, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Credits for 2 Player" }, - {0x12, 0x01, 0x0c, 0x0c, "1" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x04, "3" }, - {0x12, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Credits for Continue" }, - {0x12, 0x01, 0x30, 0x30, "1" }, - {0x12, 0x01, 0x30, 0x20, "2" }, - {0x12, 0x01, 0x30, 0x10, "3" }, - {0x12, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x07, 0x01, "1 Coin 7 Credits" }, - {0x13, 0x01, 0x07, 0x00, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 7 Credits" }, - {0x13, 0x01, 0x38, 0x00, "1 Coin 8 Credits" }, -}; - -STDDIPINFO(Lemmings) - -static inline void palette_update_one(INT32 offset) -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - offset = (offset & 0xffc) / 2; - - DrvPalette[offset/2] = BurnHighCol(BURN_ENDIAN_SWAP_INT16(p[offset+1]), BURN_ENDIAN_SWAP_INT16(p[offset+1]) >> 8, BURN_ENDIAN_SWAP_INT16(p[offset]), 0); -} - -static inline void pixel_layer_update_one(INT32 offset) -{ - UINT16 src = *((UINT16*)(DrvPxlRAM0 + offset)); - - pTempDraw[offset + 0] = ((BURN_ENDIAN_SWAP_INT16(src) >> 8) & 0x0f) + 0x100; - pTempDraw[offset + 1] = ((BURN_ENDIAN_SWAP_INT16(src) >> 0) & 0x0f) + 0x100; -} - -static inline void pixel_layer_update_two(INT32 offset) -{ - UINT16 src = *((UINT16*)(DrvPxlRAM1 + offset)); - - INT32 sy = offset / 0x200; - INT32 sx = offset & 0x1fe; - - INT32 off = ((((sx / 8) * 32) + (sy / 8)) * 64) + ((sy & 7) * 8) + (sx & 6); - - DrvGfxROM2[off + 0] = ((BURN_ENDIAN_SWAP_INT16(src) >> 8) & 0x0f); - DrvGfxROM2[off + 1] = ((BURN_ENDIAN_SWAP_INT16(src) >> 0) & 0x0f); -} - -static void __fastcall lemmings_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x160000) { - *((UINT16*)(DrvPalRAM + (address & 0x000ffe))) = BURN_ENDIAN_SWAP_INT16(data); - palette_update_one(address); - return; - } - - if ((address & 0xfffff0) == 0x170000) { - *((UINT16*)(DrvCtrlRAM + (address & 0x0000e))) = BURN_ENDIAN_SWAP_INT16(data); - return; - } - - if ((address & 0xf80000) == 0x300000) { - *((UINT16*)(DrvPxlRAM0 + (address & 0x7fffe))) = BURN_ENDIAN_SWAP_INT16(data); - pixel_layer_update_one(address & 0x7fffe); - return; - } - - if ((address & 0xfe0000) == 0x380000) { - *((UINT16*)(DrvPxlRAM1 + (address & 0x1fffe))) = BURN_ENDIAN_SWAP_INT16(data); - pixel_layer_update_two(address & 0x1fffe); - return; - } - - switch (address) - { - case 0x1a0064: - *soundlatch = data & 0xff; - M6809SetIRQLine(1, CPU_IRQSTATUS_ACK); - return; - - case 0x1c0000: - memcpy (DrvSprBuf0, DrvSprRAM0, 0x800); - return; - - case 0x1e0000: - memcpy (DrvSprBuf1, DrvSprRAM1, 0x800); - return; - } -} - -static void __fastcall lemmings_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xf80000) == 0x300000) { - DrvPxlRAM0[(address & 0x7ffff)^1] = data; - pixel_layer_update_one(address & 0x7fffe); - return; - } - - if ((address & 0xfe0000) == 0x380000) { - DrvPxlRAM1[(address & 0x1ffff)^1] = data; - pixel_layer_update_two(address & 0x1fffe); - return; - } -} - -static UINT16 __fastcall lemmings_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x190000: - return FakeTrackBallX[0]; - - case 0x190002: - return FakeTrackBallY[0]; - - case 0x190008: - return FakeTrackBallX[1]; - - case 0x19000a: - return FakeTrackBallY[1]; - - case 0x1a0320: - return (DrvInputs[1] & 0xfffb) | (DrvDips[0] & 0x04); - - case 0x1a041a: - return DrvInputs[0]; - } - - return 0; -} - -static UINT8 __fastcall lemmings_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x1a0321: // Flipper seems to work better than proper vblank status - static INT32 vblank; - vblank ^= 8; - return (DrvInputs[1] & 0xf3) | (DrvDips[0] & 0x04) | vblank; - - case 0x1a04e6: - return DrvDips[2]; - - case 0x1a04e7: - return DrvDips[1]; - } - - return 0; -} - -static void lemmings_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0800: - BurnYM2151SelectRegister(data); - return; - - case 0x0801: - BurnYM2151WriteRegister(data); - return; - - case 0x1000: - MSM6295Command(0, data); - return; - - case 0x1800: - M6809SetIRQLine(1, CPU_IRQSTATUS_NONE); - return; - } -} - -static UINT8 lemmings_sound_read(UINT16 address) -{ - switch (address) - { - case 0x0800: - case 0x0801: - return BurnYM2151ReadStatus(); - - case 0x1000: - return MSM6295ReadStatus(0); - - case 0x1800: - return *soundlatch; - } - - return 0; -} - -static void lemmingsYM2151IrqHandler(INT32 irq) -{ - M6809SetIRQLine(0, irq ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - M6809Run(1000); // fix music tempo -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - FakeTrackBallX[0] = FakeTrackBallX[1] = 0xff; - FakeTrackBallY[0] = FakeTrackBallY[1] = 0x00; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvM6809ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x080000; - - MSM6295ROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0401 * sizeof(INT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x001000; - DrvPxlRAM0 = Next; Next += 0x080000; - DrvPxlRAM1 = Next; Next += 0x020000; - DrvVidRAM = Next; Next += 0x003000; - DrvSprRAM0 = Next; Next += 0x000800; - DrvSprRAM1 = Next; Next += 0x000800; - DrvSprBuf0 = Next; Next += 0x000800; - DrvSprBuf1 = Next; Next += 0x000800; - DrvSprTBuf0 = Next; Next += 0x000800; - DrvSprTBuf1 = Next; Next += 0x000800; - - DrvM6809RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - DrvCtrlRAM = Next; Next += 0x000010; - - DrvGfxROM2 = Next; Next += 0x020000; // expanded char tiles - - pTempDraw = (UINT16*)Next; Next += 0x800 * 0x200 * sizeof(INT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[ 3] = { 0x20000*8, 0x10000*8, 0x00000 }; - INT32 XOffs[16] = { 7, 6, 5, 4, 3, 2, 1, 0, 16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0 }; - INT32 YOffs[16] = { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x30000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x30000); - - GfxDecode(0x0800, 3, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x30000); - - GfxDecode(0x0800, 3, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0c0001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0c0000, 7, 2)) return 1; - - if (BurnLoadRom(DrvM6809ROM, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 14, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM, 15, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x160000, 0x160fff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0x200000, 0x202fff, MAP_RAM); - SekMapMemory(DrvPxlRAM0, 0x300000, 0x37ffff, MAP_ROM); - SekMapMemory(DrvPxlRAM1, 0x380000, 0x39ffff, MAP_ROM); - SekSetWriteWordHandler(0, lemmings_main_write_word); - SekSetWriteByteHandler(0, lemmings_main_write_byte); - SekSetReadWordHandler(0, lemmings_main_read_word); - SekSetReadByteHandler(0, lemmings_main_read_byte); - SekClose(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(lemmings_sound_write); - M6809SetReadHandler(lemmings_sound_read); - M6809Close(); - - BurnYM2151Init(3580000); - BurnYM2151SetIrqHandler(&lemmingsYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1023924 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - MSM6295ROM = NULL; - - SekExit(); - M6809Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites(UINT8 *ram, UINT8 *rom, INT32 color_offset, INT32 pri) -{ - UINT16 *sprdata = (UINT16*)ram; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 inc; - - if ((BURN_ENDIAN_SWAP_INT16(sprdata[offs + 2]) & 0x2000) != pri) continue; - - INT32 sy = BURN_ENDIAN_SWAP_INT16(sprdata[offs + 0]); - - if ((sy & 0x1000) && (nCurrentFrame & 1)) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(sprdata[offs + 1]) & 0x3fff; - INT32 sx = BURN_ENDIAN_SWAP_INT16(sprdata[offs + 2]); - INT32 color = (sx >>9) & 0xf; - - INT32 flipx = sy & 0x2000; - INT32 flipy = sy & 0x4000; - INT32 multi = (1 << ((sy & 0x0600) >> 9)) - 1; - - sx = sx & 0x01ff; - sy = (sy & 0x01ff) - 16; - if (sx >= 320) sx -= 512; - if (sy >= 256) sy -= 512; - - if (sx > 320 || sx < -16) continue; - - code &= ~multi; - - if (flipy) { - inc = 1; - } else { - code += multi; - inc = -1; - } - - while (multi >= 0) - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, (code - multi * inc) & 0x7ff, sx, sy + -16 * multi, color, 4, 0, color_offset, rom); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, (code - multi * inc) & 0x7ff, sx, sy + -16 * multi, color, 4, 0, color_offset, rom); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, (code - multi * inc) & 0x7ff, sx, sy + -16 * multi, color, 4, 0, color_offset, rom); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, (code - multi * inc) & 0x7ff, sx, sy + -16 * multi, color, 4, 0, color_offset, rom); - } - } - - multi--; - } - } -} - -static void draw_layer() -{ - UINT16 *ram = (UINT16*)DrvVidRAM; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sy = ((offs & 0x1f) * 8) - 16; - INT32 sx = (offs / 0x20) * 8; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(ram[offs]); - INT32 code = attr & 0x7ff; - INT32 color = attr >> 12; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM2); - } -} - -static void copy_pixel_layer() -{ - UINT16 *ctrl = (UINT16*)DrvCtrlRAM; - INT32 x0 = -BURN_ENDIAN_SWAP_INT16(ctrl[2]); - INT32 x1 = -BURN_ENDIAN_SWAP_INT16(ctrl[0]); - - UINT16 *src = pTempDraw + (16 * 0x800); - UINT16 *dst = pTransDraw; - - if (BURN_ENDIAN_SWAP_INT16(ctrl[6]) & 0x02) // window mode - { - for (INT32 y = 0; y < nScreenHeight; y++, src += 0x800, dst += nScreenWidth) { - for (INT32 x = 0; x < 160; x++) { - INT32 pxl = src[(x - x0) & 0x7ff]; - if (pxl!=0x100) { - dst[x] = pxl; - } - - pxl = src[((x - x1) + 160) & 0x7ff]; - if (pxl!=0x100) { - dst[x + 160] = pxl; - } - } - } - } - else - { - for (INT32 y = 0; y < nScreenHeight; y++, src += 0x800, dst += nScreenWidth) { - for (INT32 x = 0; x < nScreenWidth; x++) { - INT32 pxl = src[(x - x1) & 0x7ff]; - if (pxl!=0x100) { - dst[x] = pxl; - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=4) { - palette_update_one(i); - } - - DrvPalette[0x400] = BurnHighCol(0, 0, 0, 0); // black - - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x400; - } - - if (nSpriteEnable & 1) draw_sprites(DrvSprTBuf1, DrvGfxROM1, 0x300, 0x0000); - - if (nBurnLayer & 1) copy_pixel_layer(); - - if (nSpriteEnable & 2) draw_sprites(DrvSprTBuf0, DrvGfxROM0, 0x200, 0x0000); - if (nSpriteEnable & 4) draw_sprites(DrvSprTBuf1, DrvGfxROM1, 0x300, 0x2000); - - if (nBurnLayer & 2) draw_layer(); - - if (nSpriteEnable & 8) draw_sprites(DrvSprTBuf0, DrvGfxROM0, 0x200, 0x2000); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - if (FakeAnInp[0]) FakeTrackBallY[0] -= 0x04; - if (FakeAnInp[1]) FakeTrackBallY[0] += 0x04; - if (FakeAnInp[2]) FakeTrackBallX[0] += 0x04; - if (FakeAnInp[3]) FakeTrackBallX[0] -= 0x04; - if (FakeAnInp[4]) FakeTrackBallY[1] -= 0x04; - if (FakeAnInp[5]) FakeTrackBallY[1] += 0x04; - if (FakeAnInp[6]) FakeTrackBallX[1] += 0x04; - if (FakeAnInp[7]) FakeTrackBallX[1] -= 0x04; - } - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14000000 / 60, 4027500 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nCyclesTotal[0] - nCyclesDone[0]; - nCyclesDone[0] += SekRun(nSegment); - - nSegment = nCyclesTotal[1] - nCyclesDone[1]; - nCyclesDone[1] += M6809Run(nSegment); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - M6809Close(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprTBuf0, DrvSprBuf0, 0x800); - memcpy (DrvSprTBuf1, DrvSprBuf1, 0x800); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(FakeTrackBallX); - SCAN_VAR(FakeTrackBallY); - } - - return 0; -} - - -// Lemmings (US prototype) - -static struct BurnRomInfo lemmingsRomDesc[] = { - { "lemmings.5", 0x20000, 0xe9a2b439, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "lemmings.1", 0x20000, 0xbf52293b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lemmings.6", 0x20000, 0x0e3dc0ea, 1 | BRF_PRG | BRF_ESS }, // 2 - { "lemmings.2", 0x20000, 0x0cf3d7ce, 1 | BRF_PRG | BRF_ESS }, // 3 - { "lemmings.7", 0x20000, 0xd020219c, 1 | BRF_PRG | BRF_ESS }, // 4 - { "lemmings.3", 0x20000, 0xc635494a, 1 | BRF_PRG | BRF_ESS }, // 5 - { "lemmings.8", 0x20000, 0x9166ce09, 1 | BRF_PRG | BRF_ESS }, // 6 - { "lemmings.4", 0x20000, 0xaa845488, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "lemmings.15", 0x10000, 0xf0b24a35, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "lemmings.9", 0x10000, 0xe06442f5, 3 | BRF_GRA }, // 9 Sprite Bank 0 - { "lemmings.10", 0x10000, 0x36398848, 3 | BRF_GRA }, // 10 - { "lemmings.11", 0x10000, 0xb46a54e5, 3 | BRF_GRA }, // 11 - - { "lemmings.12", 0x10000, 0xdc9047ff, 4 | BRF_GRA }, // 12 Sprite Bank 1 - { "lemmings.13", 0x10000, 0x7cc15491, 4 | BRF_GRA }, // 13 - { "lemmings.14", 0x10000, 0xc162788f, 4 | BRF_GRA }, // 14 - - { "lemmings.16", 0x20000, 0xf747847c, 5 | BRF_SND }, // 15 OKI MSM6295 Samples -}; - -STD_ROM_PICK(lemmings) -STD_ROM_FN(lemmings) - -struct BurnDriver BurnDrvLemmings = { - "lemmings", NULL, NULL, NULL, "1991", - "Lemmings (US prototype)\0", NULL, "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PUZZLE, 0, - NULL, lemmingsRomInfo, lemmingsRomName, NULL, NULL, LemmingsInputInfo, LemmingsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_pktgaldx.cpp b/jan/src/burn/drv/dataeast/d_pktgaldx.cpp deleted file mode 100644 index a0245010d..000000000 --- a/jan/src/burn/drv/dataeast/d_pktgaldx.cpp +++ /dev/null @@ -1,635 +0,0 @@ -// FB Alpha Pocket Gal deluxe driver module -// Based on MAME driver by David Haywood and Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "deco16ic.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KCode; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvProtRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo PktgaldxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3"} , - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pktgaldx) - -static struct BurnDIPInfo PktgaldxDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x00, "2" }, - {0x15, 0x01, 0x03, 0x01, "3" }, - {0x15, 0x01, 0x03, 0x03, "4" }, - {0x15, 0x01, 0x03, 0x02, "5" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x15, 0x01, 0x0c, 0x00, "60" }, - {0x15, 0x01, 0x0c, 0x04, "80" }, - {0x15, 0x01, 0x0c, 0x0c, "100" }, - {0x15, 0x01, 0x0c, 0x08, "120" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Pktgaldx) - -void __fastcall pktgaldx_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff0) == 0x140000) { - MSM6295Command(0, data); - return; - } - - if ((address & 0xfffff0) == 0x150000) { - MSM6295Command(1, data); - return; - } - - deco16_write_control_word(0, address, 0x161800, data); - - if ((address & 0xfffff0) == 0x164800) { - MSM6295SetBank(1, DrvSndROM1 + ((data & 3) * 0x40000), 0x00000, 0x3ffff); - return; - } -} - -void __fastcall pktgaldx_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffff0) == 0x140000) { - MSM6295Command(0, data); - return; - } - - if ((address & 0xfffff0) == 0x150000) { - MSM6295Command(1, data); - return; - } - - deco16_write_control_word(0, address, 0x161800, data); - - if ((address & 0xfffff0) == 0x164800) { - MSM6295SetBank(1, DrvSndROM1 + ((data & 3) * 0x40000), 0x00000, 0x3ffff); - return; - } -} - -UINT16 __fastcall pktgaldx_read_word(UINT32 address) -{ - switch (address) - { - case 0x140006: - return MSM6295ReadStatus(0); - - case 0x150006: - return MSM6295ReadStatus(1); - - case 0x167db2: - return (DrvInputs[0] & 0xfff7) | (deco16_vblank & 0x08); - - case 0x167c4c: - return (DrvDips[1] << 8) | (DrvDips[0] << 0); - - case 0x167842: - return DrvInputs[1]; - - case 0x167d10: - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvProtRAM + 0))); - - case 0x167d1a: - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvProtRAM + 2))); - } - - return 0; -} - -UINT8 __fastcall pktgaldx_read_byte(UINT32 address) -{ - switch (address) - { - case 0x140006: - case 0x140007: - return MSM6295ReadStatus(0); - - case 0x150006: - case 0x150007: - return MSM6295ReadStatus(1); - - case 0x167db2: - case 0x167db3: - return (DrvInputs[0] & 0xf7) | (deco16_vblank & 0x08); - - case 0x167c4c: - return DrvDips[1]; - - case 0x167c4d: - return DrvDips[0]; - - case 0x167842: - return DrvInputs[1] >> 8; - - case 0x167843: - return DrvInputs[1] >> 0; - - case 0x167d10: - case 0x167d11: - return DrvProtRAM[((address & 1) ^ 1) + 0]; - - case 0x167d1a: - case 0x167d1b: - return DrvProtRAM[((address & 1) ^ 1) + 2]; - - } - - return 0; -} - -static INT32 pktgaldx_bank_callback( const INT32 bank ) -{ - return ((bank >> 4) & 0x7) * 0x1000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - MSM6295Reset(1); - - deco16Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - Drv68KCode = Next; Next += 0x080000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x040000; - DrvSndROM1 = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvSprRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x001000; - DrvProtRAM = Next; Next += 0x000800; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 3, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 5, 1)) return 1; - - deco102_decrypt_cpu(Drv68KROM, Drv68KCode, 0x80000, 0x42ba, 0x00, 0x00); - - deco56_decrypt_gfx(DrvGfxROM1, 0x100000); - - deco16_tile_decode(DrvGfxROM1, DrvGfxROM0, 0x100000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x100000, 0); - deco16_sprite_decode(DrvGfxROM2, 0x100000); - } - - deco16Init(1, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x100000 * 2, DrvGfxROM1, 0x100000 * 2, NULL, 0); - deco16_set_global_offsets(0, 8); - deco16_set_bank_callback(1, pktgaldx_bank_callback); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_READ); - SekMapMemory(Drv68KCode, 0x000000, 0x07ffff, MAP_FETCH); - SekMapMemory(deco16_pf_ram[0], 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x102000, 0x102fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x110000, 0x1107ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x112000, 0x1127ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x130000, 0x130fff, MAP_RAM); - SekMapMemory(DrvProtRAM, 0x167800, 0x167fff, MAP_WRITE); - SekMapMemory(Drv68KRAM, 0x170000, 0x17ffff, MAP_RAM); - SekSetWriteWordHandler(0, pktgaldx_write_word); - SekSetWriteByteHandler(0, pktgaldx_write_byte); - SekSetReadWordHandler(0, pktgaldx_read_word); - SekSetReadByteHandler(0, pktgaldx_read_byte); - SekClose(); - - MSM6295Init(0, 1006875 / 132, 0); - MSM6295Init(1, 2013750 / 132, 1); - MSM6295SetBank(0, DrvSndROM0, 0, 0x3ffff); - MSM6295SetBank(1, DrvSndROM1, 0, 0x3ffff); - MSM6295SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - MSM6295Exit(0); - MSM6295Exit(1); - - SekExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_sprites() -{ - UINT16 *spriteram = (UINT16 *)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 inc, mult; - - INT32 sprite = BURN_ENDIAN_SWAP_INT16(spriteram[offs+1]); - if (!sprite) continue; - - INT32 y = BURN_ENDIAN_SWAP_INT16(spriteram[offs]); - - if ((y & 0x1000) && (nCurrentFrame & 1)) continue; // flash - - INT32 x = BURN_ENDIAN_SWAP_INT16(spriteram[offs + 2]); - INT32 colour = (x >> 9) & 0x1f; - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi = (1 << ((y & 0x0600) >> 9)) - 1; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - y = 240 - y; - x = 304 - x; - - if (x > 320) continue; - - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (!*flipscreen) - { - y = 240 - y; - x = 304 - x; - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - mult = 16; - } - else mult = -16; - - while (multi >= 0) - { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sprite - multi * inc, x, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sprite - multi * inc, x, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sprite - multi * inc, x, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sprite - multi * inc, x, (y + mult * multi) - 8, colour, 4, 0, 0x200, DrvGfxROM2); - } - } - - multi--; - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 00; - } - - if (nBurnLayer & 1) deco16_draw_layer(1, pTransDraw, 0); - - if (nBurnLayer & 2) draw_sprites(); - - if (nBurnLayer & 4) deco16_draw_layer(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[1] = { 14000000 / 58 }; - INT32 nCyclesDone[1] = { 0 }; - - SekOpen(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - if (i == 240) deco16_vblank = 0x08; - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - SekClose(); - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029682; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16Scan(); - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - } - - return 0; -} - - -// Pocket Gal Deluxe (Euro v3.00) - -static struct BurnRomInfo pktgaldxRomDesc[] = { - { "ke00-2.12a", 0x080000, 0xb04baf3a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - - { "maz-02.2h", 0x100000, 0xc9d35a59, 2 | BRF_GRA }, // 1 Character and Background Tiles - - { "maz-00.1b", 0x080000, 0xfa3071f4, 3 | BRF_GRA }, // 2 Sprites - { "maz-01.3b", 0x080000, 0x4934fe21, 3 | BRF_GRA }, // 3 - - { "ke01.14f", 0x020000, 0x8a106263, 4 | BRF_SND }, // 4 OKI M6295 Sample 0 - - { "maz-03.13f", 0x100000, 0xa313c964, 5 | BRF_SND }, // 5 OKI M6295 Sample 1 -}; - -STD_ROM_PICK(pktgaldx) -STD_ROM_FN(pktgaldx) - -struct BurnDriver BurnDrvPktgaldx = { - "pktgaldx", NULL, NULL, NULL, "1992", - "Pocket Gal Deluxe (Euro v3.00)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, pktgaldxRomInfo, pktgaldxRomName, NULL, NULL, PktgaldxInputInfo, PktgaldxDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Pocket Gal Deluxe (Japan v3.00) - -static struct BurnRomInfo pktgaldxjRomDesc[] = { - { "kg00-2.12a", 0x080000, 0x62dc4137, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - - { "maz-02.2h", 0x100000, 0xc9d35a59, 2 | BRF_GRA }, // 1 Character and Background Tiles - - { "maz-00.1b", 0x080000, 0xfa3071f4, 3 | BRF_GRA }, // 2 Sprites - { "maz-01.3b", 0x080000, 0x4934fe21, 3 | BRF_GRA }, // 3 - - { "ke01.14f", 0x020000, 0x8a106263, 4 | BRF_SND }, // 4 OKI M6295 Sample 0 - - { "maz-03.13f", 0x100000, 0xa313c964, 5 | BRF_SND }, // 5 OKI M6295 Sample 1 -}; - -STD_ROM_PICK(pktgaldxj) -STD_ROM_FN(pktgaldxj) - -struct BurnDriver BurnDrvPktgaldxj = { - "pktgaldxj", "pktgaldx", NULL, NULL, "1993", - "Pocket Gal Deluxe (Japan v3.00)\0", NULL, "Nihon System", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, pktgaldxjRomInfo, pktgaldxjRomName, NULL, NULL, PktgaldxInputInfo, PktgaldxDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Pocket Gal Deluxe (Euro v3.00, bootleg) - -static struct BurnRomInfo pktgaldxbRomDesc[] = { - { "4.bin", 0x80000, 0x67ce30aa, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "5.bin", 0x80000, 0x64cb4c33, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "11.bin", 0x80000, 0xa8c8f1fd, 2 | BRF_GRA }, // 2 Sprites - { "6.bin", 0x80000, 0x0e3335a1, 2 | BRF_GRA }, // 3 - { "10.bin", 0x80000, 0x9dd743a9, 2 | BRF_GRA }, // 4 - { "7.bin", 0x80000, 0x0ebf12b5, 2 | BRF_GRA }, // 5 - { "9.bin", 0x80000, 0x078f371c, 2 | BRF_GRA }, // 6 - { "8.bin", 0x80000, 0x40f5a032, 2 | BRF_GRA }, // 7 - - { "kg01.14f", 0x20000, 0x8a106263, 3 | BRF_SND }, // 8 OKI M6295 Sample 0 - - { "3.bin", 0x80000, 0x4638747b, 4 | BRF_SND }, // 9 OKI M6295 Sample 1 - { "2.bin", 0x80000, 0xf841d995, 4 | BRF_SND }, // 10 -}; - -STD_ROM_PICK(pktgaldxb) -STD_ROM_FN(pktgaldxb) - -static INT32 pkgaldxbInit() -{ - return 1; -} - -struct BurnDriverD BurnDrvPktgaldxb = { - "pktgaldxb", "pktgaldx", NULL, NULL, "1992", - "Pocket Gal Deluxe (Euro v3.00, bootleg)\0", NULL, "bootleg", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, pktgaldxbRomInfo, pktgaldxbRomName, NULL, NULL, PktgaldxInputInfo, PktgaldxDIPInfo, - pkgaldxbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_rohga.cpp b/jan/src/burn/drv/dataeast/d_rohga.cpp deleted file mode 100644 index ce1939668..000000000 --- a/jan/src/burn/drv/dataeast/d_rohga.cpp +++ /dev/null @@ -1,2557 +0,0 @@ -// FB Alpha Rohga Armor Force / Wizard Fire / Nitro Ball / Schmeiser Robo driver module -// Based on MAME driver by Bryan McPhail - -// tofix: dataeast logo too fast or missing in rohga - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "h6280_intf.h" -#include "deco16ic.h" -#include "deco146.h" -#include "msm6295.h" -#include "burn_ym2151.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvHucRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvPalBuf; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprRAM2; -static UINT8 *DrvSprBuf; -static UINT8 *DrvSprBuf2; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT16 DrvInputs[4]; - -static UINT16 *tempdraw[2]; - -static INT32 DrvOkiBank; - -static INT32 DrvIsWizdfireEnglish = 0; -static INT32 DrvHangzo = 0; - -static struct BurnInputInfo RohgaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Rohga) - -static struct BurnInputInfo WizdfireInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Wizdfire) - -static struct BurnInputInfo NitrobalInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p3 coin" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Nitrobal) - -static struct BurnDIPInfo RohgaDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Credits to Start, 1 to Continue" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Player's Vitality" }, - {0x15, 0x01, 0x30, 0x30, "Normal" }, - {0x15, 0x01, 0x30, 0x20, "Low" }, - {0x15, 0x01, 0x30, 0x10, "Lowest" }, - {0x15, 0x01, 0x30, 0x00, "High" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Stage Clear Bonus" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Enemy's Vitality" }, - {0x16, 0x01, 0x0c, 0x08, "Low" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "High" }, - {0x16, 0x01, 0x0c, 0x00, "Highest" }, - - {0 , 0xfe, 0 , 4, "Enemy Encounter Rate" }, - {0x16, 0x01, 0x30, 0x20, "Low" }, - {0x16, 0x01, 0x30, 0x30, "Normal" }, - {0x16, 0x01, 0x30, 0x10, "High" }, - {0x16, 0x01, 0x30, 0x00, "Highest" }, - - {0 , 0xfe, 0 , 4, "Enemy's Weapon Speed" }, - {0x16, 0x01, 0xc0, 0x80, "Slow" }, - {0x16, 0x01, 0xc0, 0xc0, "Normal" }, - {0x16, 0x01, 0xc0, 0x40, "Fast" }, - {0x16, 0x01, 0xc0, 0x00, "Fastest" }, -}; - -STDDIPINFO(Rohga) - -static struct BurnDIPInfo SchmeisrDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze Screen" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Schmeisr) - -static struct BurnDIPInfo WizdfireDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Credits to Start, 1 to Continue" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "2" }, - {0x13, 0x01, 0x03, 0x01, "3" }, - {0x13, 0x01, 0x03, 0x03, "4" }, - {0x13, 0x01, 0x03, 0x02, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Magic Gauge Speed" }, - {0x13, 0x01, 0x30, 0x00, "Very Slow" }, - {0x13, 0x01, 0x30, 0x10, "Slow" }, - {0x13, 0x01, 0x30, 0x30, "Normal" }, - {0x13, 0x01, 0x30, 0x20, "Fast" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Wizdfire) - -static struct BurnDIPInfo NitrobalDIPList[]= -{ - {0x19, 0xff, 0xff, 0xff, NULL }, - {0x1a, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x19, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x19, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x19, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x19, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x19, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x19, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x19, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x19, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x19, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x19, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x19, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x19, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x19, 0x01, 0x40, 0x40, "Off" }, - {0x19, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Credits to Start, 1 to Continue" }, - {0x19, 0x01, 0x80, 0x80, "Off" }, - {0x19, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x1a, 0x01, 0x03, 0x01, "1" }, - {0x1a, 0x01, 0x03, 0x00, "2" }, - {0x1a, 0x01, 0x03, 0x03, "3" }, - {0x1a, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty?" }, - {0x1a, 0x01, 0x0c, 0x08, "Easy" }, - {0x1a, 0x01, 0x0c, 0x0c, "Normal" }, - {0x1a, 0x01, 0x0c, 0x04, "Hard" }, - {0x1a, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Split Coin Chutes" }, - {0x1a, 0x01, 0x10, 0x10, "Off" }, - {0x1a, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Players" }, - {0x1a, 0x01, 0x20, 0x20, "2" }, - {0x1a, 0x01, 0x20, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Shot Button to Start" }, - {0x1a, 0x01, 0x40, 0x40, "Off" }, - {0x1a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1a, 0x01, 0x80, 0x80, "Off" }, - {0x1a, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Nitrobal) - -static struct BurnDIPInfo HangzoDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Credits to Start, 1 to Continue" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x01, "1" }, - {0x15, 0x01, 0x03, 0x00, "2" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze Player" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze Frame" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze Screen" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Hangzo) - -void __fastcall rohga_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x200000, data) - deco16_write_control_word(1, address, 0x240000, data) - - switch (address) - { - case 0x300000: - memcpy (DrvSprBuf2, DrvSprBuf, 0x800); - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x31000a: - memcpy (DrvPalBuf, DrvPalRAM, 0x2000); - return; - - case 0x321100: // schmeisr - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - return; - - case 0x322000: - deco16_priority = data; - return; - } - - if (address >= 0x280000 && address <= 0x283fff) { - deco146_104_prot_ww(0, address, data); - return; - } -} - -void __fastcall rohga_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x300000: - case 0x300001: - memcpy (DrvSprBuf2, DrvSprBuf, 0x800); - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x31000a: - case 0x31000b: - memcpy (DrvPalBuf, DrvPalRAM, 0x2000); - return; - - case 0x321100: // schmeisr - case 0x321101: - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - return; - - case 0x322000: - case 0x322001: - deco16_priority = data; - return; - } - - if (address >= 0x280000 && address <= 0x283fff) { - deco146_104_prot_wb(0, address, data); - return; - } -} - -UINT16 __fastcall rohga_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x2c0000: - case 0x300000: // schmeisr - return DrvDips[2]; - - case 0x310002: // schmeisr - return (DrvInputs[1] & 0x07) | (deco16_vblank & 0x08); - - case 0x321100: - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - return 0; - } - - if (address >= 0x280000 && address <= 0x283fff) { - return deco146_104_prot_rw(0, address); - } - - return 0; -} - -UINT8 __fastcall rohga_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x2c0000: - case 0x2c0001: - case 0x300000: // schmeisr - case 0x300001: - return DrvDips[2]; - - case 0x310002: // schmeisr - case 0x310003: - return (DrvInputs[1] & 0x07) | (deco16_vblank & 0x08); - - case 0x321100: - case 0x321101: - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - return 0; - } - - if (address >= 0x280000 && address <= 0x283fff) { - return deco146_104_prot_rb(0, address); - } - - return 0; -} - -void __fastcall wizdfire_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x300000, data) - deco16_write_control_word(1, address, 0x310000, data) - - switch (address) - { - case 0x350000: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x370000: - memcpy (DrvSprBuf2, DrvSprRAM2, 0x800); - return; - - case 0x380008: - memcpy (DrvPalBuf, DrvPalRAM, 0x2000); - return; - - case 0x320000: - deco16_priority = data; - return; - - case 0x320004: - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - return; - } - - if ((address >= 0xff4000 && address <= 0xff7fff) || // wizdfire - (address >= 0xfe4000 && address <= 0xfe7fff)) { // nitrobal - deco146_104_prot_ww(0, address, data); - return; - } -} - -void __fastcall wizdfire_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x350000: - case 0x350001: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - - case 0x370000: - case 0x370001: - memcpy (DrvSprBuf2, DrvSprRAM2, 0x800); - return; - - case 0x380008: - case 0x380009: - memcpy (DrvPalBuf, DrvPalRAM, 0x2000); - return; - - case 0x320000: - case 0x320001: - deco16_priority = data; - return; - - - case 0x320004: - case 0x320005: - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - return; - } - - if ((address >= 0xff4000 && address <= 0xff7fff) || // wizdfire - (address >= 0xfe4000 && address <= 0xfe7fff)) { // nitrobal - deco146_104_prot_wb(0, address, data); - return; - } -} - -UINT16 __fastcall wizdfire_main_read_word(UINT32 address) -{ - if (address == 0x320000) return DrvInputs[2]; - - if ((address >= 0xff4000 && address <= 0xff7fff) || // wizdfire - (address >= 0xfe4000 && address <= 0xfe7fff)) { // nitrobal - return deco146_104_prot_rw(0, address); - } - - return 0; -} - -UINT8 __fastcall wizdfire_main_read_byte(UINT32 address) -{ - if (address == 0x320000 || address == 0x320001) return DrvInputs[2] >> ((~address & 1) << 3); - - if ((address >= 0xff4000 && address <= 0xff7fff) || // wizdfire - (address >= 0xfe4000 && address <= 0xfe7fff)) { // nitrobal - return deco146_104_prot_rb(0, address); - } - - return 0; -} - -static void DrvYM2151WritePort(UINT32, UINT32 data) -{ - if ((data & 0x01) != (UINT32)(DrvOkiBank & 0x01)) { - memcpy (DrvSndROM0, DrvSndROM0 + 0x40000 + ((data & 0x01) >> 0) * 0x40000, 0x40000); - } - - if ((data & 0x02) != (UINT32)(DrvOkiBank & 0x02)) { - memcpy (DrvSndROM1, DrvSndROM1 + 0x40000 + ((data & 0x02) >> 1) * 0x40000, 0x40000); - } - - DrvOkiBank = data; -} - -static INT32 rohga_bank_callback( const INT32 bank ) -{ - return ((bank >> 4) & 0x3) << 12; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - deco16SoundReset(); - - deco16Reset(); - - DrvOkiBank = -1; - DrvYM2151WritePort(0, (DrvHangzo) ? 0 : 3); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x200000; - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROM2 = Next; Next += 0x400000; - DrvGfxROM3 = Next; Next += 0x800000; - DrvGfxROM4 = Next; Next += 0x800000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x0c0000; - - tempdraw[0] = (UINT16*)Next; Next += 320 * 240 * sizeof(UINT16); - tempdraw[1] = (UINT16*)Next; Next += 320 * 240 * sizeof(UINT16); - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x024000; - DrvHucRAM = Next; Next += 0x002000; - DrvSprRAM2 = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - DrvSprBuf2 = Next; Next += 0x000800; - DrvSprBuf = Next; Next += 0x000800; - - DrvPalRAM = Next; Next += 0x002000; - DrvPalBuf = Next; Next += 0x002000; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvSpriteDecode() -{ - INT32 Plane[6] = { 0x400000*8+8, 0x400000*8, 0x200000*8+8, 0x200000*8, 8, 0 }; - INT32 XOffs[16] = { 7,6,5,4,3,2,1,0, 32*8+7, 32*8+6, 32*8+5, 32*8+4, 32*8+3, 32*8+2, 32*8+1, 32*8+0 }; - INT32 YOffs[16] = { 15*16, 14*16, 13*16, 12*16, 11*16, 10*16, 9*16, 8*16, 7*16, 6*16, 5*16, 4*16, 3*16, 2*16, 1*16, 0*16}; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x600000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM3, 0x600000); - - GfxDecode(0x8000, 6, 16, 16, Plane, XOffs, YOffs, 0x200, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static UINT16 deco_104_port_a_cb() -{ - return DrvInputs[0]; -} - -static UINT16 deco_104_port_b_cb() -{ - return (DrvInputs[1] & ~8) | deco16_vblank; -} - -static UINT16 deco_104_port_c_cb() -{ - return DrvInputs[2]; -} - -static void soundlatch_write(UINT16 data) -{ - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); -} - -static INT32 RohgaInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 3, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x300000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x400000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x500000, 16, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x040000, 17, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x040000, 18, 1)) return 1; - - deco56_decrypt_gfx(DrvGfxROM0, 0x020000); - deco56_decrypt_gfx(DrvGfxROM1, 0x100000); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x020000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x100000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x200000, 0); - DrvSpriteDecode(); - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x20000 * 2, DrvGfxROM1, 0x100000 * 2, DrvGfxROM2, 0x200000 * 2); - deco16_set_color_base(2, 512); - deco16_set_color_base(3, 768); - deco16_set_global_offsets(0, 8); - deco16_set_bank_callback(0, rohga_bank_callback); - deco16_set_bank_callback(1, rohga_bank_callback); - deco16_set_bank_callback(2, rohga_bank_callback); - deco16_set_bank_callback(3, rohga_bank_callback); - - // 146_104 prot - deco_104_init(); - deco_146_104_set_port_a_cb(deco_104_port_a_cb); - deco_146_104_set_port_b_cb(deco_104_port_b_cb); - deco_146_104_set_port_c_cb(deco_104_port_c_cb); - deco_146_104_set_soundlatch_cb(soundlatch_write); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[0], 0x3c0000, 0x3c1fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x3c2000, 0x3c2fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x3c4000, 0x3c4fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x3c6000, 0x3c6fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x3c8000, 0x3c8fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x3c9000, 0x3c9fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x3ca000, 0x3cafff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x3cb000, 0x3cbfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x3cc000, 0x3ccfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x3cd000, 0x3cdfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x3ce000, 0x3cefff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x3cf000, 0x3cffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x3d0000, 0x3d07ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x3e0000, 0x3e1fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x3f0000, 0x3f3fff, MAP_RAM); - SekSetWriteWordHandler(0, rohga_main_write_word); - SekSetWriteByteHandler(0, rohga_main_write_byte); - SekSetReadWordHandler(0, rohga_main_read_word); - SekSetReadByteHandler(0, rohga_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 2685000, 0, DrvYM2151WritePort, 0.78, 1006875, 1.00, 2013750, 0.40); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.78, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.78, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 WizdfireInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 5, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200001, 16, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000001, 18, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x040000, 19, 1)) return 1; - // DrvSndROM0 leaks into DrvSndROM1 by 0x40000, but that's ok, as DrvSndROM1 loads in below - // DrvSndROM0's size must be 0x100000 for banking to work correctly. (internal to msm6295) - if (DrvIsWizdfireEnglish == 1) { - memcpy(DrvSndROM0 + 0x040000, DrvSndROM0 + 0x0c0000, 0x80000); - } - memset(DrvSndROM0 + 0x0c0000, 0, 0x80000); - - if (BurnLoadRom(DrvSndROM1 + 0x040000, 20, 1)) return 1; - - deco74_decrypt_gfx(DrvGfxROM0, 0x020000); - deco74_decrypt_gfx(DrvGfxROM1, 0x200000); - deco74_decrypt_gfx(DrvGfxROM2, 0x100000); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x020000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x200000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x100000, 0); - deco16_sprite_decode(DrvGfxROM3, 0x400000); - deco16_sprite_decode(DrvGfxROM4, 0x100000); - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x20000 * 2, DrvGfxROM1, 0x200000 * 2, DrvGfxROM2, 0x100000 * 2); - deco16_set_color_base(2, 512); - deco16_set_color_base(3, 768); - deco16_set_global_offsets(0, 8); - deco16_set_bank_callback(0, rohga_bank_callback); - deco16_set_bank_callback(1, rohga_bank_callback); - deco16_set_bank_callback(2, rohga_bank_callback); - deco16_set_bank_callback(3, rohga_bank_callback); - - // 146_104 prot - deco_104_init(); - deco_146_104_set_interface_scramble_reverse(); - deco_146_104_set_port_a_cb(deco_104_port_a_cb); - deco_146_104_set_port_b_cb(deco_104_port_b_cb); - deco_146_104_set_port_c_cb(deco_104_port_c_cb); - deco_146_104_set_soundlatch_cb(soundlatch_write); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[0], 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x202000, 0x202fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x208000, 0x208fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x20a000, 0x20afff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x20c000, 0x20c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x20e000, 0x20e7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x340000, 0x3407ff, MAP_RAM); - SekMapMemory(DrvSprRAM2, 0x360000, 0x3607ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x380000, 0x381fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xfdc000, 0xfe3fff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x8000, 0xfe4800, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, wizdfire_main_write_word); - SekSetWriteByteHandler(0, wizdfire_main_write_byte); - SekSetReadWordHandler(0, wizdfire_main_read_word); - SekSetReadByteHandler(0, wizdfire_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 2685000, 0, DrvYM2151WritePort, 0.80, 1006875, 2.00, 2013750, 0.40); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.80, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.80, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 WizdfireEnglishInit() -{ - DrvIsWizdfireEnglish = 1; - - return WizdfireInit(); -} - -static INT32 SchmeisrInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x300000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x040000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x040000, 12, 1)) return 1; - - deco74_decrypt_gfx(DrvGfxROM1, 0x100000); - - memcpy (DrvGfxROM0 + 0x000000, DrvGfxROM1 + 0x000000, 0x020000); - memcpy (DrvGfxROM0 + 0x020000, DrvGfxROM1 + 0x080000, 0x020000); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x040000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x100000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x200000, 0); - DrvSpriteDecode(); - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x40000 * 2, DrvGfxROM1, 0x100000 * 2, DrvGfxROM2, 0x200000 * 2); - deco16_set_color_base(2, 512); - deco16_set_color_base(3, 768); - deco16_set_global_offsets(0, 8); - deco16_set_bank_callback(0, rohga_bank_callback); - deco16_set_bank_callback(1, rohga_bank_callback); - deco16_set_bank_callback(2, rohga_bank_callback); - deco16_set_bank_callback(3, rohga_bank_callback); - - // 146_104 prot - deco_104_init(); - deco_146_104_set_port_a_cb(deco_104_port_a_cb); - deco_146_104_set_port_b_cb(deco_104_port_b_cb); - deco_146_104_set_port_c_cb(deco_104_port_c_cb); - deco_146_104_set_soundlatch_cb(soundlatch_write); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[0], 0x3c0000, 0x3c1fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x3c2000, 0x3c2fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x3c4000, 0x3c4fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x3c6000, 0x3c6fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x3c8000, 0x3c8fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x3c9000, 0x3c9fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x3ca000, 0x3cafff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x3cb000, 0x3cbfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x3cc000, 0x3ccfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x3cd000, 0x3cdfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x3ce000, 0x3cefff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x3cf000, 0x3cffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x3d0000, 0x3d07ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x3e0000, 0x3e1fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x3e2000, 0x3e3fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xff7fff, MAP_RAM); - SekSetWriteWordHandler(0, rohga_main_write_word); - SekSetWriteByteHandler(0, rohga_main_write_byte); - SekSetReadWordHandler(0, rohga_main_read_word); - SekSetReadByteHandler(0, rohga_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 2685000, 0, DrvYM2151WritePort, 0.80, 1006875, 1.00, 2013750, 0.40); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.80, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.80, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 HangzoInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 5, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x300000, 14, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x040000, 15, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x040000, 16, 1)) return 1; - - memcpy (DrvGfxROM0 + 0x000000, DrvGfxROM1 + 0x000000, 0x020000); - memcpy (DrvGfxROM0 + 0x020000, DrvGfxROM1 + 0x080000, 0x020000); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x040000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x100000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x200000, 0); - DrvSpriteDecode(); - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x40000 * 2, DrvGfxROM1, 0x100000 * 2, DrvGfxROM2, 0x200000 * 2); - deco16_set_color_base(2, 512); - deco16_set_color_base(3, 768); - deco16_set_global_offsets(0, 8); - deco16_set_bank_callback(0, rohga_bank_callback); - deco16_set_bank_callback(1, rohga_bank_callback); - deco16_set_bank_callback(2, rohga_bank_callback); - deco16_set_bank_callback(3, rohga_bank_callback); - - // 146_104 prot - deco_104_init(); - deco_146_104_set_port_a_cb(deco_104_port_a_cb); - deco_146_104_set_port_b_cb(deco_104_port_b_cb); - deco_146_104_set_port_c_cb(deco_104_port_c_cb); - deco_146_104_set_soundlatch_cb(soundlatch_write); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[0], 0x3c0000, 0x3c1fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x3c2000, 0x3c2fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x3c4000, 0x3c4fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x3c6000, 0x3c6fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x3c8000, 0x3c9fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x3ca000, 0x3cafff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x3cb000, 0x3cbfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x3cc000, 0x3ccfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x3cd000, 0x3cdfff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x3ce000, 0x3cefff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x3cf000, 0x3cffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x3d0000, 0x3d07ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x3e0000, 0x3e1fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x3e2000, 0x3e3fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x3f0000, 0x3f3fff, MAP_RAM); - SekSetWriteWordHandler(0, rohga_main_write_word); - SekSetWriteByteHandler(0, rohga_main_write_byte); - SekSetReadWordHandler(0, rohga_main_read_word); - SekSetReadByteHandler(0, rohga_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 2685000, 0, DrvYM2151WritePort, 0.80, 1006875, 1.00, 2013750, 0.40); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.80, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.80, BURN_SND_ROUTE_RIGHT); - - DrvHangzo = 1; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 NitrobalInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 5, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200001, 16, 2)) return 1; - BurnByteswap(DrvGfxROM3, 0x400000); - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000001, 18, 2)) return 1; - BurnByteswap(DrvGfxROM4, 0x080000); - - if (BurnLoadRom(DrvSndROM0 + 0x040000, 19, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x040000, 20, 1)) return 1; - - deco56_decrypt_gfx(DrvGfxROM0, 0x020000); - deco56_decrypt_gfx(DrvGfxROM1, 0x100000); - deco74_decrypt_gfx(DrvGfxROM2, 0x200000); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, 0x020000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x100000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x200000, 0); - deco16_sprite_decode(DrvGfxROM3, 0x400000); - deco16_sprite_decode(DrvGfxROM4, 0x080000); - } - - deco16Init(0, 0, 0); - deco16_set_graphics(DrvGfxROM0, 0x20000 * 2, DrvGfxROM1, 0x100000 * 2, DrvGfxROM2, 0x200000 * 2); - deco16_set_color_base(2, 512); - deco16_set_color_mask(2, 0); - deco16_set_color_base(3, 512); - deco16_set_color_mask(3, 0); - deco16_set_global_offsets(0, 8); - deco16_set_bank_callback(0, rohga_bank_callback); - deco16_set_bank_callback(1, rohga_bank_callback); - deco16_set_bank_callback(2, rohga_bank_callback); - deco16_set_bank_callback(3, rohga_bank_callback); - - // 146_104 prot - deco_146_init(); - deco_146_104_set_interface_scramble_reverse(); - deco_146_104_set_use_magic_read_address_xor(1); - deco_146_104_set_port_a_cb(deco_104_port_a_cb); - deco_146_104_set_port_b_cb(deco_104_port_b_cb); - deco_146_104_set_port_c_cb(deco_104_port_c_cb); - deco_146_104_set_soundlatch_cb(soundlatch_write); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[0], 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x201000, 0x201fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x202000, 0x2027ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x202800, 0x202fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x208000, 0x2087ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[2], 0x208800, 0x208fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x20a000, 0x20a7ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x20a800, 0x20afff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x204000, 0x2047ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x206000, 0x2067ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[2], 0x20c000, 0x20c7ff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[3], 0x20e000, 0x20e7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x340000, 0x3407ff, MAP_RAM); - SekMapMemory(DrvSprRAM2, 0x360000, 0x3607ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x380000, 0x381fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xfec000, 0xff3fff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x8000, 0xff8000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, wizdfire_main_write_word); - SekSetWriteByteHandler(0, wizdfire_main_write_byte); - SekSetReadWordHandler(0, wizdfire_main_read_word); - SekSetReadByteHandler(0, wizdfire_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 2685000, 0, DrvYM2151WritePort, 0.80, 1006875, 1.00, 2013750, 0.40); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.80, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.80, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - SekExit(); - - deco16SoundExit(); - - BurnFree (AllMem); - - DrvIsWizdfireEnglish = 0; - DrvHangzo = 0; - - return 0; -} - -static void rohga_draw_sprites(UINT8 *ram, INT32 is_schmeisr) -{ - UINT16 *spriteptr = (UINT16*)ram; - - for (INT32 offs = 0x400 - 4; offs >= 0; offs -= 4) - { - INT32 inc, mult, pri = 0; - INT32 sprite = BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 1]); - - if (!sprite) continue; - - INT32 x = BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 2]); - - switch (x & 0x6000) - { - case 0x0000: pri = 0; break; - case 0x4000: pri = 0xf0; break; - case 0x6000: pri = 0xf0 | 0xcc; break; - case 0x2000: pri = 0; break; - } - - INT32 y = BURN_ENDIAN_SWAP_INT16(spriteptr[offs]); - - if ((y & 0x1000) && (nCurrentFrame & 1)) continue; // flash - - INT32 colour = (((x >> 9) & 0xf) << 6); - if (is_schmeisr) colour += ((x & 0x8000) >> 15) << 4; - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi = (1 << ((y & 0x0600) >> 9)) - 1; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (*flipscreen) - { - x = 304 - x; - y = 240 - y; - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - mult = -16; - } - else - mult = +16; - - while (multi >= 0) - { - deco16_draw_prio_sprite(pTransDraw, DrvGfxROM3, (sprite - multi * inc) & 0x7fff, colour + 0x400, x, y + mult * multi, fx, fy, pri); - - multi--; - } - } -} - -static void wizdfire_draw_sprites(UINT8 *ram, UINT8 *gfx, INT32 coloff, INT32 mode, INT32 bank) -{ - UINT16 *spriteptr = (UINT16*)ram; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 inc, mult, prio = 0, alpha = 0xff; - - INT32 sprite = BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 1]); - if (!sprite) continue; - - INT32 x = BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 2]); - - switch (mode) - { - case 4: - if ((x & 0xc000) != 0xc000) - continue; - prio = 0x08; - break; - case 3: - if ((x & 0xc000) != 0x8000) - continue; - prio = 0x10; - break; - case 2: - if ((x & 0x8000) != 0x8000) - continue; - prio = 0x20; - break; - case 1: - case 0: - default: - if ((x & 0x8000) != 0) - continue; - prio = 0x40; - break; - } - - INT32 y = BURN_ENDIAN_SWAP_INT16(spriteptr[offs]); - - if ((y & 0x1000) && (nCurrentFrame & 1)) continue; // flash - - INT32 colour = (x >> 9) & 0x1f; - - if (bank == 4 && colour & 0x10) - { - alpha = 0x80; - colour &= 0xf; - } - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi = (1 << ((y & 0x0600) >> 9)) - 1; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (*flipscreen) - { - x = 304 - x; - y = 240 - y; - mult = -16; - } else { - mult = +16; - fx = !fx; - fy = !fy; - } - - if (bank == 3) { - sprite &= 0x7fff; - } else { - sprite &= 0x0fff; - } - - while (multi >= 0) - { - deco16_draw_prio_sprite(pTransDraw, gfx, sprite - multi * inc, (colour << 4) + coloff, x, y + mult * multi, fx, fy, -1); -#if 0 - drawgfx_alpha(bitmap,cliprect,machine->gfx[bank], - sprite - multi * inc, - colour, - fx,fy, - x,y + mult * multi, - 0,alpha); -#endif - multi--; - } - } -} - -static void nitrobal_draw_sprites(UINT8 *ram, INT32 gfxbank, INT32 alpha_on) -{ - UINT16 *spriteptr = (UINT16*)ram; - - INT32 offs = 0x3fc; - INT32 end = -4; - INT32 inc = -4; - UINT8 *gfx; - - while (offs != end) - { - INT32 x, y, sprite, colour, fx, fy, w, h, sx, sy, x_mult, y_mult, tilemap_pri, sprite_pri, coloff; - INT32 alpha = 0xff; - - sprite = BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 3]); - if (!sprite) - { - offs += inc; - continue; - } - - sx = BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 1]); - - h = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 2]) & 0xf000) >> 12; - w = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 2]) & 0x0f00) >> 8; - - sy = BURN_ENDIAN_SWAP_INT16(spriteptr[offs]); - if ((sy & 0x2000) && (nCurrentFrame & 1)) - { - offs += inc; - continue; - } - - colour = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 2]) >> 0) & 0x1f; - - if (gfxbank == 3) - { - switch (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 2]) & 0xe0) - { // deco16_priority == 0x20 in alien world, 0 in ghost town - case 0xc0: tilemap_pri = 8; break; - case 0x80: tilemap_pri = 64; break; // was 32, fixes horseshoe "ring" under bouncers in first level - case 0x20: tilemap_pri = 32; break; - case 0x40: tilemap_pri = 8; break; - case 0xa0: tilemap_pri = (deco16_priority) ? 8 : 32; break; // was 32 - case 0x00: tilemap_pri = 72; break; // was 128, this and above fixes the archways over the player in alien world - default: tilemap_pri = 128; break; - } - - sprite_pri = 1; - - gfx = DrvGfxROM3; - coloff = 0x400; - } - else - { - if (deco16_priority) - tilemap_pri = 8; - else - tilemap_pri = 64; - - sprite_pri = 2; - - gfx = DrvGfxROM4; - coloff = 0x600; - - if (colour & 0x10) { - alpha = 0x80; - colour &= 0x0f; - } - } - - fx = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 0]) & 0x4000); - fy = (BURN_ENDIAN_SWAP_INT16(spriteptr[offs + 0]) & 0x8000); - - if (!*flipscreen) - { - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - - sx = sx & 0x01ff; - sy = sy & 0x01ff; - if (sx > 0x180) sx = -(0x200 - sx); - if (sy > 0x180) sy = -(0x200 - sy); - - if (fx) { x_mult = -16; sx += 16 * w; } else { x_mult = 16; sx -= 16; } - if (fy) { y_mult = -16; sy += 16 * h; } else { y_mult = 16; sy -= 16; } - } - else - { - sx = sx & 0x01ff; - sy = sy & 0x01ff; - if (sx & 0x100) sx = -(0x100 - (sx & 0xff)); - if (sy & 0x100) sy = -(0x100 - (sy & 0xff)); - sx = 304 - sx; - sy = 240 - sy; - if (sx >= 432) sx -= 512; - if (sy >= 384) sy -= 512; - if (fx) { x_mult = -16; sx += 16; } else { x_mult = 16; sx -= 16 * w; } - if (fy) { y_mult = -16; sy += 16; } else { y_mult = 16; sy -= 16 * h; } - } - - if (gfxbank == 3) { - sprite &= 0x7fff; - } else { - sprite &= 0x0fff; - } - - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - if (!alpha_on) { - deco16_draw_prio_sprite_nitrobal(pTransDraw, gfx, sprite + y + h * x, (colour << 4) + coloff, sx + x_mult * (w-x), sy + y_mult * (h-y), fx, fy, tilemap_pri, sprite_pri); - } else { - deco16_draw_alphaprio_sprite(DrvPalette, gfx, sprite + y + h * x, (colour << 4) + coloff, sx + x_mult * (w-x), sy + y_mult * (h-y), fx, fy, tilemap_pri, sprite_pri, alpha); - } - } - } - - offs += inc; - } -} - -static void draw_combined_playfield_step1() -{ - UINT8 *tptr = deco16_pf_rowscroll[3]; - deco16_pf_rowscroll[3] = deco16_pf_rowscroll[2]; - - deco16_draw_layer(2, tempdraw[0], 0x10000); - deco16_draw_layer(3, tempdraw[1], 0x10000); - - deco16_pf_rowscroll[3] = tptr; -} - -static void draw_combined_playfield(INT32 color, INT32 priority) // opaque -{ - UINT16 *src0 = tempdraw[0]; - UINT16 *src1 = tempdraw[1]; - UINT16 *dest = pTransDraw; - UINT8 *prio = deco16_prio_map; - - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = 0; x < nScreenWidth; x++) { - dest[x] = color | (src0[x] & 0x0f) | ((src1[x] & 0x0f) << 4); - prio[x] = priority; - } - src0 += nScreenWidth; - src1 += nScreenWidth; - dest += nScreenWidth; - prio += 512; - } -} - -static void update_rohga(INT32 is_schmeisr) -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x300; - } - - if ((deco16_priority & 0x03) == 0) { - draw_combined_playfield_step1(); - } - - deco16_clear_prio_map(); - - switch (deco16_priority & 3) - { - case 0: - if (deco16_priority & 4) - { - draw_combined_playfield(0x200, DECO16_LAYER_PRIORITY(3)); - } - else - { - deco16_draw_layer(3, pTransDraw, DECO16_LAYER_OPAQUE | DECO16_LAYER_PRIORITY(0x01)); - deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - } - deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x04)); - break; - - case 1: - deco16_draw_layer(3, pTransDraw, DECO16_LAYER_OPAQUE | DECO16_LAYER_PRIORITY(0x01)); - deco16_draw_layer(1, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x04)); - break; - - case 2: - deco16_draw_layer(1, pTransDraw, DECO16_LAYER_OPAQUE | DECO16_LAYER_PRIORITY(0x01)); - deco16_draw_layer(3, pTransDraw, DECO16_LAYER_PRIORITY(0x02)); - deco16_draw_layer(2, pTransDraw, DECO16_LAYER_PRIORITY(0x04)); - break; - } - - if (nSpriteEnable & 1) rohga_draw_sprites(DrvSprBuf2, is_schmeisr); - - deco16_draw_layer(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); -} - -static INT32 RohgaDraw() -{ - update_rohga(0); - - return 0; -} - -static INT32 SchmeisrDraw() -{ - update_rohga(1); - - return 0; -} - -static INT32 WizdfireDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x200; - } - - if (nBurnLayer & 1) deco16_draw_layer(3, pTransDraw, DECO16_LAYER_OPAQUE); - - if (nSpriteEnable & 1) wizdfire_draw_sprites(DrvSprBuf, DrvGfxROM3, 0x400, 4, 3); - - if (nBurnLayer & 2) deco16_draw_layer(1, pTransDraw, 0); - - if (nSpriteEnable & 2) wizdfire_draw_sprites(DrvSprBuf, DrvGfxROM3, 0x400, 3, 3); - - if ((deco16_priority & 0x1f) == 0x1f) { - if (nBurnLayer & 4) deco16_draw_layer(2, pTransDraw, 0); // tilemap draw alpha 0x80... - } else { - if (nBurnLayer & 4) deco16_draw_layer(2, pTransDraw, 0); - } - - if (nSpriteEnable & 4) wizdfire_draw_sprites(DrvSprBuf, DrvGfxROM3, 0x400, 0, 3); - if (nSpriteEnable & 8) wizdfire_draw_sprites(DrvSprBuf2, DrvGfxROM4, 0x600, 2, 4); - if (nSpriteEnable & 16) wizdfire_draw_sprites(DrvSprBuf2, DrvGfxROM4, 0x600, 1, 4); - - if (nBurnLayer & 8) deco16_draw_layer(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 NitrobalDraw() -{ -// if (DrvRecalc) { - deco16_palette_recalculate(DrvPalette, DrvPalRAM); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x200; - } - - deco16_clear_prio_map(); - - draw_combined_playfield_step1(); - - draw_combined_playfield(0x200, 0); - - deco16_draw_layer(1, pTransDraw, 16); - - if (nBurnBpp != 4) { // regular (non-alpha) draw for anything !32bpp - nitrobal_draw_sprites(DrvSprBuf , 3, 0); - nitrobal_draw_sprites(DrvSprBuf2, 4, 0); - } - - deco16_draw_layer(0, pTransDraw, DECO16_LAYER_PRIORITY(0xff)); - - BurnTransferCopy(DrvPalette); - - if (nBurnBpp == 4) { // draw alpha sprites if 32bpp - nitrobal_draw_sprites(DrvSprBuf , 3, 1); - nitrobal_draw_sprites(DrvSprBuf2, 4, 1); - } - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 4 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy3[i] & 1) << i; - } - DrvInputs[2] = (DrvDips[1] << 8) | (DrvDips[0] << 0); - } - - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14000000 / 58, 2685000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += h6280Run(nCyclesTotal[1] / nInterleave); - - if (i == 248) { - SekSetIRQLine(6, CPU_IRQSTATUS_ACK); - deco16_vblank = 0x08; - } - - if (pBurnSoundOut && i%8==7) { // rohga is really picky regarding ym2151 timing. - INT32 nSegmentLength = nBurnSoundLen / (nInterleave/8); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - - SCAN_VAR(DrvOkiBank); - - INT32 bank = DrvOkiBank; - DrvOkiBank = -1; - DrvYM2151WritePort(0, bank); - } - - return 0; -} - - -// Rohga Armor Force (Asia/Europe v5.0) - -static struct BurnRomInfo rohgaRomDesc[] = { - { "ht-00-1.2a", 0x040000, 0x1ed84a67, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ht-03-1.2d", 0x040000, 0x84e7ebf6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mam00.8a", 0x080000, 0x0fa440a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mam07.8d", 0x080000, 0xf8bc7f20, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ha04.18p", 0x010000, 0xeb6608eb, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "ha01.13a", 0x010000, 0xfb8f8519, 3 | BRF_GRA }, // 5 Characters - { "ha02.14a", 0x010000, 0xaa47c17f, 3 | BRF_GRA }, // 6 - - { "mam01.10a", 0x080000, 0xdbf4fbcc, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mam02.11a", 0x080000, 0xb1fac481, 4 | BRF_GRA }, // 8 - - { "mam08.17d", 0x100000, 0xca97a83f, 5 | BRF_GRA }, // 9 Background Tiles - { "mam09.18d", 0x100000, 0x3f57d56f, 5 | BRF_GRA }, // 10 - - { "mam05.19a", 0x100000, 0x307a2cd1, 6 | BRF_GRA }, // 11 Sprites - { "mam06.20a", 0x100000, 0xa1119a2d, 6 | BRF_GRA }, // 12 - { "mam10.19d", 0x100000, 0x99f48f9f, 6 | BRF_GRA }, // 13 - { "mam11.20d", 0x100000, 0xc3f12859, 6 | BRF_GRA }, // 14 - { "mam03.17a", 0x100000, 0xfc4dfd48, 6 | BRF_GRA }, // 15 - { "mam04.18a", 0x100000, 0x7d3b38bf, 6 | BRF_GRA }, // 16 - - { "mam13.15p", 0x080000, 0x525b9461, 8 | BRF_SND }, // 17 OKI M6295 Samples 0 - - { "mam12.14p", 0x080000, 0x6f00b791, 7 | BRF_SND }, // 18 OKI M6295 Samples 1 - - { "hb-00.11p", 0x000200, 0xb7a7baad, 0 | BRF_OPT }, // 19 Unused PROMs -}; - -STD_ROM_PICK(rohga) -STD_ROM_FN(rohga) - -struct BurnDriver BurnDrvRohga = { - "rohga", NULL, NULL, NULL, "1991", - "Rohga Armor Force (Asia/Europe v5.0)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, rohgaRomInfo, rohgaRomName, NULL, NULL, RohgaInputInfo, RohgaDIPInfo, - RohgaInit, DrvExit, DrvFrame, RohgaDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Rohga Armor Force (Asia/Europe v3.0 Set 1) - -static struct BurnRomInfo rohga1RomDesc[] = { - { "jd00.bin", 0x040000, 0xe046c77a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jd03.bin", 0x040000, 0x2c5120b8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mam00.8a", 0x080000, 0x0fa440a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mam07.8d", 0x080000, 0xf8bc7f20, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ha04.18p", 0x010000, 0xeb6608eb, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "ha01.13a", 0x010000, 0xfb8f8519, 3 | BRF_GRA }, // 5 Characters - { "ha02.14a", 0x010000, 0xaa47c17f, 3 | BRF_GRA }, // 6 - - { "mam01.10a", 0x080000, 0xdbf4fbcc, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mam02.11a", 0x080000, 0xb1fac481, 4 | BRF_GRA }, // 8 - - { "mam08.17d", 0x100000, 0xca97a83f, 5 | BRF_GRA }, // 9 Background Tiles - { "mam09.18d", 0x100000, 0x3f57d56f, 5 | BRF_GRA }, // 10 - - { "mam05.19a", 0x100000, 0x307a2cd1, 6 | BRF_GRA }, // 11 Sprites - { "mam06.20a", 0x100000, 0xa1119a2d, 6 | BRF_GRA }, // 12 - { "mam10.19d", 0x100000, 0x99f48f9f, 6 | BRF_GRA }, // 13 - { "mam11.20d", 0x100000, 0xc3f12859, 6 | BRF_GRA }, // 14 - { "mam03.17a", 0x100000, 0xfc4dfd48, 6 | BRF_GRA }, // 15 - { "mam04.18a", 0x100000, 0x7d3b38bf, 6 | BRF_GRA }, // 16 - - { "mam13.15p", 0x080000, 0x525b9461, 8 | BRF_SND }, // 17 OKI M6295 Samples 0 - - { "mam12.14p", 0x080000, 0x6f00b791, 7 | BRF_SND }, // 18 OKI M6295 Samples 1 - - { "hb-00.11p", 0x000200, 0xb7a7baad, 0 | BRF_OPT }, // 19 Unused PROMs -}; - -STD_ROM_PICK(rohga1) -STD_ROM_FN(rohga1) - -struct BurnDriver BurnDrvRohga1 = { - "rohga1", "rohga", NULL, NULL, "1991", - "Rohga Armor Force (Asia/Europe v3.0 Set 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, rohga1RomInfo, rohga1RomName, NULL, NULL, RohgaInputInfo, RohgaDIPInfo, - RohgaInit, DrvExit, DrvFrame, RohgaDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Rohga Armor Force (Asia/Europe v3.0 Set 2) - -static struct BurnRomInfo rohga2RomDesc[] = { - { "hts-00-3.2a", 0x040000, 0x154f02ec, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hts-03-3.2d", 0x040000, 0x5e69d3d8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mam00.8a", 0x080000, 0x0fa440a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mam07.8d", 0x080000, 0xf8bc7f20, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ha04.18p", 0x010000, 0xeb6608eb, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "ha01.13a", 0x010000, 0xfb8f8519, 3 | BRF_GRA }, // 5 Characters - { "ha02.14a", 0x010000, 0xaa47c17f, 3 | BRF_GRA }, // 6 - - { "mam01.10a", 0x080000, 0xdbf4fbcc, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mam02.11a", 0x080000, 0xb1fac481, 4 | BRF_GRA }, // 8 - - { "mam08.17d", 0x100000, 0xca97a83f, 5 | BRF_GRA }, // 9 Background Tiles - { "mam09.18d", 0x100000, 0x3f57d56f, 5 | BRF_GRA }, // 10 - - { "mam05.19a", 0x100000, 0x307a2cd1, 6 | BRF_GRA }, // 11 Sprites - { "mam06.20a", 0x100000, 0xa1119a2d, 6 | BRF_GRA }, // 12 - { "mam10.19d", 0x100000, 0x99f48f9f, 6 | BRF_GRA }, // 13 - { "mam11.20d", 0x100000, 0xc3f12859, 6 | BRF_GRA }, // 14 - { "mam03.17a", 0x100000, 0xfc4dfd48, 6 | BRF_GRA }, // 15 - { "mam04.18a", 0x100000, 0x7d3b38bf, 6 | BRF_GRA }, // 16 - - { "mam13.15p", 0x080000, 0x525b9461, 8 | BRF_SND }, // 17 OKI M6295 Samples 0 - - { "mam12.14p", 0x080000, 0x6f00b791, 7 | BRF_SND }, // 18 OKI M6295 Samples 1 - - { "hb-00.11p", 0x000200, 0xb7a7baad, 0 | BRF_OPT }, // 19 Unused PROMs -}; - -STD_ROM_PICK(rohga2) -STD_ROM_FN(rohga2) - -struct BurnDriver BurnDrvRohga2 = { - "rohga2", "rohga", NULL, NULL, "1991", - "Rohga Armor Force (Asia/Europe v3.0 Set 2)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, rohga2RomInfo, rohga2RomName, NULL, NULL, RohgaInputInfo, RohgaDIPInfo, - RohgaInit, DrvExit, DrvFrame, RohgaDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Rohga Armor Force (Hong Kong v3.0) - -static struct BurnRomInfo rohgahRomDesc[] = { - { "jd00-2.2a", 0x040000, 0xec70646a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jd03-2.2d", 0x040000, 0x11d4c9a2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mam00.8a", 0x080000, 0x0fa440a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mam07.8d", 0x080000, 0xf8bc7f20, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ha04.18p", 0x010000, 0xeb6608eb, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "ha01.13a", 0x010000, 0xfb8f8519, 3 | BRF_GRA }, // 5 Characters - { "ha02.14a", 0x010000, 0xaa47c17f, 3 | BRF_GRA }, // 6 - - { "mam01.10a", 0x080000, 0xdbf4fbcc, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mam02.11a", 0x080000, 0xb1fac481, 4 | BRF_GRA }, // 8 - - { "mam08.17d", 0x100000, 0xca97a83f, 5 | BRF_GRA }, // 9 Background Tiles - { "mam09.18d", 0x100000, 0x3f57d56f, 5 | BRF_GRA }, // 10 - - { "mam05.19a", 0x100000, 0x307a2cd1, 6 | BRF_GRA }, // 11 Sprites - { "mam06.20a", 0x100000, 0xa1119a2d, 6 | BRF_GRA }, // 12 - { "mam10.19d", 0x100000, 0x99f48f9f, 6 | BRF_GRA }, // 13 - { "mam11.20d", 0x100000, 0xc3f12859, 6 | BRF_GRA }, // 14 - { "mam03.17a", 0x100000, 0xfc4dfd48, 6 | BRF_GRA }, // 15 - { "mam04.18a", 0x100000, 0x7d3b38bf, 6 | BRF_GRA }, // 16 - - { "mam13.15p", 0x080000, 0x525b9461, 8 | BRF_SND }, // 17 OKI M6295 Samples 0 - - { "mam12.14p", 0x080000, 0x6f00b791, 7 | BRF_SND }, // 18 OKI M6295 Samples 1 - - { "hb-00.11p", 0x000200, 0xb7a7baad, 0 | BRF_OPT }, // 19 Unused PROMs -}; - -STD_ROM_PICK(rohgah) -STD_ROM_FN(rohgah) - -struct BurnDriver BurnDrvRohgah = { - "rohgah", "rohga", NULL, NULL, "1991", - "Rohga Armor Force (Hong Kong v3.0)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, rohgahRomInfo, rohgahRomName, NULL, NULL, RohgaInputInfo, RohgaDIPInfo, - RohgaInit, DrvExit, DrvFrame, RohgaDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Rohga Armor Force (US v1.0) - -static struct BurnRomInfo rohgauRomDesc[] = { - { "ha00.2a", 0x040000, 0xd8d13052, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ha03.2d", 0x040000, 0x5f683bbf, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mam00.8a", 0x080000, 0x0fa440a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mam07.8d", 0x080000, 0xf8bc7f20, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ha04.18p", 0x010000, 0xeb6608eb, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "ha01.13a", 0x010000, 0xfb8f8519, 3 | BRF_GRA }, // 5 Characters - { "ha02.14a", 0x010000, 0xaa47c17f, 3 | BRF_GRA }, // 6 - - { "mam01.10a", 0x080000, 0xdbf4fbcc, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mam02.11a", 0x080000, 0xb1fac481, 4 | BRF_GRA }, // 8 - - { "mam08.17d", 0x100000, 0xca97a83f, 5 | BRF_GRA }, // 9 Background Tiles - { "mam09.18d", 0x100000, 0x3f57d56f, 5 | BRF_GRA }, // 10 - - { "mam05.19a", 0x100000, 0x307a2cd1, 6 | BRF_GRA }, // 11 Sprites - { "mam06.20a", 0x100000, 0xa1119a2d, 6 | BRF_GRA }, // 12 - { "mam10.19d", 0x100000, 0x99f48f9f, 6 | BRF_GRA }, // 13 - { "mam11.20d", 0x100000, 0xc3f12859, 6 | BRF_GRA }, // 14 - { "mam03.17a", 0x100000, 0xfc4dfd48, 6 | BRF_GRA }, // 15 - { "mam04.18a", 0x100000, 0x7d3b38bf, 6 | BRF_GRA }, // 16 - - { "mam13.15p", 0x080000, 0x525b9461, 8 | BRF_SND }, // 17 OKI M6295 Samples 0 - - { "mam12.14p", 0x080000, 0x6f00b791, 7 | BRF_SND }, // 18 OKI M6295 Samples 1 - - { "hb-00.11p", 0x000200, 0xb7a7baad, 0 | BRF_OPT }, // 19 Unused PROMs -}; - -STD_ROM_PICK(rohgau) -STD_ROM_FN(rohgau) - -struct BurnDriver BurnDrvRohgau = { - "rohgau", "rohga", NULL, NULL, "1991", - "Rohga Armor Force (US v1.0)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, rohgauRomInfo, rohgauRomName, NULL, NULL, RohgaInputInfo, RohgaDIPInfo, - RohgaInit, DrvExit, DrvFrame, RohgaDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Wolf Fang -Kuhga 2001- (Japan) - -static struct BurnRomInfo wolffangRomDesc[] = { - { "hw_00-1.2a", 0x040000, 0x69dc611e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hw_03-1.2d", 0x040000, 0xb66d9680, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mam00.8a", 0x080000, 0x0fa440a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mam07.8d", 0x080000, 0xf8bc7f20, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "hw_04-.18p", 0x010000, 0xeb6608eb, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "hw_01-.13a", 0x010000, 0xd9810ca4, 3 | BRF_GRA }, // 5 Characters - { "hw_02-.14a", 0x010000, 0x2a27ac8e, 3 | BRF_GRA }, // 6 - - { "mam01.10a", 0x080000, 0xdbf4fbcc, 4 | BRF_GRA }, // 7 Foreground Tiles - { "mam02.11a", 0x080000, 0xb1fac481, 4 | BRF_GRA }, // 8 - - { "mam08.17d", 0x100000, 0xca97a83f, 5 | BRF_GRA }, // 9 Background Tiles - { "mam09.18d", 0x100000, 0x3f57d56f, 5 | BRF_GRA }, // 10 - - { "mam05.19a", 0x100000, 0x307a2cd1, 6 | BRF_GRA }, // 11 Sprites - { "mam06.20a", 0x100000, 0xa1119a2d, 6 | BRF_GRA }, // 12 - { "mam10.19d", 0x100000, 0x99f48f9f, 6 | BRF_GRA }, // 13 - { "mam11.20d", 0x100000, 0xc3f12859, 6 | BRF_GRA }, // 14 - { "mam03.17a", 0x100000, 0xfc4dfd48, 6 | BRF_GRA }, // 15 - { "mam04.18a", 0x100000, 0x7d3b38bf, 6 | BRF_GRA }, // 16 - - { "mam13.15p", 0x080000, 0x525b9461, 8 | BRF_SND }, // 17 OKI M6295 Samples 0 - - { "mam12.14p", 0x080000, 0x6f00b791, 7 | BRF_SND }, // 18 OKI M6295 Samples 1 - - { "hb-00.11p", 0x000200, 0xb7a7baad, 0 | BRF_OPT }, // 19 Unused PROMs -}; - -STD_ROM_PICK(wolffang) -STD_ROM_FN(wolffang) - -struct BurnDriver BurnDrvWolffang = { - "wolffang", "rohga", NULL, NULL, "1991", - "Wolf Fang -Kuhga 2001- (Japan)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, wolffangRomInfo, wolffangRomName, NULL, NULL, RohgaInputInfo, RohgaDIPInfo, - RohgaInit, DrvExit, DrvFrame, RohgaDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Wizard Fire (Over Sea v2.1) - -static struct BurnRomInfo wizdfireRomDesc[] = { - { "je-01.3d", 0x020000, 0xb6d62367, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "je-00.3a", 0x020000, 0xf33de278, 1 | BRF_PRG | BRF_ESS }, // 1 - { "je-03.5d", 0x020000, 0x5217d404, 1 | BRF_PRG | BRF_ESS }, // 2 - { "je-02.5a", 0x020000, 0x36a1ce28, 1 | BRF_PRG | BRF_ESS }, // 3 - { "mas13", 0x080000, 0x7e5256ce, 1 | BRF_PRG | BRF_ESS }, // 4 - { "mas12", 0x080000, 0x005bd499, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "je-06.20r", 0x010000, 0x79042546, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "je-04.10d", 0x010000, 0x73cba800, 3 | BRF_GRA }, // 7 Characters - { "je-05.12d", 0x010000, 0x22e2c49d, 3 | BRF_GRA }, // 8 - - { "mas00", 0x100000, 0x3d011034, 4 | BRF_GRA }, // 9 Foreground Tiles - { "mas01", 0x100000, 0x6d0c9d0b, 4 | BRF_GRA }, // 10 - - { "mas02", 0x080000, 0xaf00e620, 5 | BRF_GRA }, // 11 Background Tiles - { "mas03", 0x080000, 0x2fe61ea2, 5 | BRF_GRA }, // 12 - - { "mas04", 0x100000, 0x1e56953b, 6 | BRF_GRA }, // 13 Sprite Bank A - { "mas05", 0x100000, 0x3826b8f8, 6 | BRF_GRA }, // 14 - { "mas06", 0x100000, 0x3b8bbd45, 6 | BRF_GRA }, // 15 - { "mas07", 0x100000, 0x31303769, 6 | BRF_GRA }, // 16 - - { "mas08", 0x080000, 0xe224fb7a, 7 | BRF_GRA }, // 17 Sprite Bank B - { "mas09", 0x080000, 0x5f6deb41, 7 | BRF_GRA }, // 18 - - { "mas10", 0x100000, 0xf4b4c8a1, 8 | BRF_SND }, // 19 OKI M6295 Samples 0 - - { "mas11", 0x080000, 0xc2f0a4f2, 9 | BRF_SND }, // 20 OKI M6295 Samples 1 - - { "mb7122h.16l", 0x000400, 0x2bee57cc, 0 | BRF_OPT }, // 21 Unused PROMs -}; - -STD_ROM_PICK(wizdfire) -STD_ROM_FN(wizdfire) - -struct BurnDriver BurnDrvWizdfire = { - "wizdfire", NULL, NULL, NULL, "1992", - "Wizard Fire (Over Sea v2.1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, wizdfireRomInfo, wizdfireRomName, NULL, NULL, WizdfireInputInfo, WizdfireDIPInfo, - WizdfireEnglishInit, DrvExit, DrvFrame, WizdfireDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Wizard Fire (US v1.1) - -static struct BurnRomInfo wizdfireuRomDesc[] = { - { "jf-01.3d", 0x020000, 0xbde42a41, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jf-00.3a", 0x020000, 0xbca3c995, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jf-03.5d", 0x020000, 0x5217d404, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jf-02.5a", 0x020000, 0x36a1ce28, 1 | BRF_PRG | BRF_ESS }, // 3 - { "mas13", 0x080000, 0x7e5256ce, 1 | BRF_PRG | BRF_ESS }, // 4 - { "mas12", 0x080000, 0x005bd499, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "jf-06.20r", 0x010000, 0x79042546, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "jf-04.10d", 0x010000, 0x73cba800, 3 | BRF_GRA }, // 7 Characters - { "jf-05.12d", 0x010000, 0x22e2c49d, 3 | BRF_GRA }, // 8 - - { "mas00", 0x100000, 0x3d011034, 4 | BRF_GRA }, // 9 Foreground Tiles - { "mas01", 0x100000, 0x6d0c9d0b, 4 | BRF_GRA }, // 10 - - { "mas02", 0x080000, 0xaf00e620, 5 | BRF_GRA }, // 11 Background Tiles - { "mas03", 0x080000, 0x2fe61ea2, 5 | BRF_GRA }, // 12 - - { "mas04", 0x100000, 0x1e56953b, 6 | BRF_GRA }, // 13 Sprite Bank A - { "mas05", 0x100000, 0x3826b8f8, 6 | BRF_GRA }, // 14 - { "mas06", 0x100000, 0x3b8bbd45, 6 | BRF_GRA }, // 15 - { "mas07", 0x100000, 0x31303769, 6 | BRF_GRA }, // 16 - - { "mas08", 0x080000, 0xe224fb7a, 7 | BRF_GRA }, // 17 Sprite Bank B - { "mas09", 0x080000, 0x5f6deb41, 7 | BRF_GRA }, // 18 - - { "mas10", 0x100000, 0xf4b4c8a1, 8 | BRF_SND }, // 19 OKI M6295 Samples 0 - - { "mas11", 0x080000, 0xc2f0a4f2, 9 | BRF_SND }, // 20 OKI M6295 Samples 1 - - { "mb7122h.16l", 0x000400, 0x2bee57cc, 0 | BRF_OPT }, // 21 Unused PROMs -}; - -STD_ROM_PICK(wizdfireu) -STD_ROM_FN(wizdfireu) - -struct BurnDriver BurnDrvWizdfireu = { - "wizdfireu", "wizdfire", NULL, NULL, "1992", - "Wizard Fire (US v1.1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, wizdfireuRomInfo, wizdfireuRomName, NULL, NULL, WizdfireInputInfo, WizdfireDIPInfo, - WizdfireEnglishInit, DrvExit, DrvFrame, WizdfireDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Dark Seal 2 (Japan v2.1) - -static struct BurnRomInfo darkseal2RomDesc[] = { - { "jb-01-3.3d", 0x020000, 0x82308c01, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jb-00-3.3a", 0x020000, 0x1d38113a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jb-03.5d", 0x020000, 0x5217d404, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jb-02.5a", 0x020000, 0x36a1ce28, 1 | BRF_PRG | BRF_ESS }, // 3 - { "mas13", 0x080000, 0x7e5256ce, 1 | BRF_PRG | BRF_ESS }, // 4 - { "mas12", 0x080000, 0x005bd499, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "jb-06.20r", 0x010000, 0x2066a1dd, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "jb-04.10d", 0x010000, 0x73cba800, 3 | BRF_GRA }, // 7 Characters - { "jb-05.12d", 0x010000, 0x22e2c49d, 3 | BRF_GRA }, // 8 - - { "mas00", 0x100000, 0x3d011034, 4 | BRF_GRA }, // 9 Foreground Tiles - { "mas01", 0x100000, 0x6d0c9d0b, 4 | BRF_GRA }, // 10 - - { "mas02", 0x080000, 0xaf00e620, 5 | BRF_GRA }, // 11 Background Tiles - { "mas03", 0x080000, 0x2fe61ea2, 5 | BRF_GRA }, // 12 - - { "mas04", 0x100000, 0x1e56953b, 6 | BRF_GRA }, // 13 Sprite Bank A - { "mas05", 0x100000, 0x3826b8f8, 6 | BRF_GRA }, // 14 - { "mas06", 0x100000, 0x3b8bbd45, 6 | BRF_GRA }, // 15 - { "mas07", 0x100000, 0x31303769, 6 | BRF_GRA }, // 16 - - { "mas08", 0x080000, 0xe224fb7a, 7 | BRF_GRA }, // 17 Sprite Bank B - { "mas09", 0x080000, 0x5f6deb41, 7 | BRF_GRA }, // 18 - - { "mas10", 0x100000, 0xf4b4c8a1, 8 | BRF_SND }, // 19 OKI M6295 Samples 0 - - { "mas11", 0x080000, 0xc2f0a4f2, 9 | BRF_SND }, // 20 OKI M6295 Samples 1 - - { "mb7122h.16l", 0x000400, 0x2bee57cc, 0 | BRF_OPT }, // 21 Unused PROMs -}; - -STD_ROM_PICK(darkseal2) -STD_ROM_FN(darkseal2) - -struct BurnDriver BurnDrvDarkseal2 = { - "darkseal2", "wizdfire", NULL, NULL, "1992", - "Dark Seal 2 (Japan v2.1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, darkseal2RomInfo, darkseal2RomName, NULL, NULL, WizdfireInputInfo, WizdfireDIPInfo, - WizdfireInit, DrvExit, DrvFrame, WizdfireDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Schmeiser Robo (Japan) - -static struct BurnRomInfo schmeisrRomDesc[] = { - { "sr001j.8a", 0x080000, 0xed31f3ff, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sr006j.8d", 0x080000, 0x9e9cfa5d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sr013.18p", 0x010000, 0x4ac00cbb, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "sr002-74.9a", 0x080000, 0x97e15c7b, 3 | BRF_GRA }, // 3 Foreground Tiles - { "sr003-74.11a", 0x080000, 0xea367971, 3 | BRF_GRA }, // 4 - - { "sr007.17d", 0x100000, 0x886f80c7, 4 | BRF_GRA }, // 5 Background Tiles - { "sr008.18d", 0x100000, 0xa74cbc90, 4 | BRF_GRA }, // 6 - - { "sr004.19a", 0x100000, 0xe25434a1, 5 | BRF_GRA }, // 7 Sprites - { "sr005.20a", 0x100000, 0x1630033b, 5 | BRF_GRA }, // 8 - { "sr009.19d", 0x100000, 0x7b9d982f, 5 | BRF_GRA }, // 9 - { "sr010.20d", 0x100000, 0x6e9e5352, 5 | BRF_GRA }, // 10 - - { "sr012.15p", 0x080000, 0x38843d4d, 6 | BRF_SND }, // 12 OKI M6295 Samples 0 - - { "sr011.14p", 0x080000, 0x81805616, 7 | BRF_SND }, // 11 OKI M6295 Samples 1 - - { "hb-00.11p", 0x000200, 0xb7a7baad, 0 | BRF_OPT }, // 13 Unused PROMs -}; - -STD_ROM_PICK(schmeisr) -STD_ROM_FN(schmeisr) - -struct BurnDriver BurnDrvSchmeisr = { - "schmeisr", NULL, NULL, NULL, "1993", - "Schmeiser Robo (Japan)\0",NULL, "Hot-B", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_VSFIGHT, 0, - NULL, schmeisrRomInfo, schmeisrRomName, NULL, NULL, RohgaInputInfo, SchmeisrDIPInfo, - SchmeisrInit, DrvExit, DrvFrame, SchmeisrDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Hangzo (Japan, prototype) -/* Found on a Data East DE-0353-3 PCB */ - -static struct BurnRomInfo hangzoRomDesc[] = { - { "Pro0H 12.18.2A.27C1001", 0x20000, 0xac8087db, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "Pro0H 12.18.2D.27C1001", 0x20000, 0xa6b7f4f4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "Pro1H 12.10.4A.27C010", 0x20000, 0x0d04f43d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "Pro1L 12.10.4D.27C010", 0x20000, 0x2e323918, 1 | BRF_PRG | BRF_ESS }, // 3 - { "Pro2H 12.10.6A.27C010", 0x20000, 0xbb3185a6, 1 | BRF_PRG | BRF_ESS }, // 4 - { "Pro2L 12.10.6D.27C010", 0x20000, 0x11ce97bb, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "SND 12.18.18P.27C512", 0x10000, 0x97c592dc, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "BK1L 12.10.9A.574200", 0x80000, 0x5199729b, 3 | BRF_GRA }, // 7 Foreground Tiles - { "BK1H 12.10.11A.574200", 0x80000, 0x85887bd8, 3 | BRF_GRA }, // 8 - - { "BK23L 12.10.17D.574200", 0x80000, 0xed4e47c6, 4 | BRF_GRA }, // 9 Background Tiles - { "BK23H 12.10.18D.574200", 0x80000, 0x6a725fb2, 4 | BRF_GRA }, // 10 - - { "OBJ01L 12.10.19A.27C4000", 0x80000, 0xc141e310, 5 | BRF_GRA }, // 11 Sprites - { "OBJ01H 12.10.20A.27C4000", 0x80000, 0x6a7b4252, 5 | BRF_GRA }, // 12 - { "OBJ23L 12.10.19D.27C4000", 0x80000, 0x0db6df6c, 5 | BRF_GRA }, // 13 - { "OBJ23H 12.10.20D.27C4000", 0x80000, 0x165031a1, 5 | BRF_GRA }, // 14 - - { "PCM8K 11.5.15P.27C020", 0x40000, 0x02682a9a, 6 | BRF_SND }, // 15 OKI M6295 Samples 0 - - { "PCM16K 11.5.14P.574000", 0x80000, 0x5b95c6c7, 7 | BRF_SND }, // 16 OKI M6295 Samples 1 - - { "hb-00.11p", 0x00200, 0xb7a7baad, 0 | BRF_OPT }, // 17 Unused PROMs -}; - -STD_ROM_PICK(hangzo) -STD_ROM_FN(hangzo) - -struct BurnDriver BurnDrvHangzo = { - "hangzo", NULL, NULL, NULL, "1992", - "Hangzo (Japan, prototype)\0", NULL, "Hot-B", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_DATAEAST, GBF_SCRFIGHT, 0, - NULL, hangzoRomInfo, hangzoRomName, NULL, NULL, RohgaInputInfo, HangzoDIPInfo, - HangzoInit, DrvExit, DrvFrame, SchmeisrDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Nitro Ball (World, set 1) - -static struct BurnRomInfo nitrobalRomDesc[] = { - { "jl01-4.d3", 0x020000, 0x0414e409, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jl00-4.b3", 0x020000, 0xdd9e2bcc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jl03-4.d5", 0x020000, 0xea264ac5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jl02-4.b5", 0x020000, 0x74047997, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jl05-2.d6", 0x040000, 0xb820fa20, 1 | BRF_PRG | BRF_ESS }, // 4 - { "jl04-2.b6", 0x040000, 0x1fd8995b, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "jl08.r20", 0x010000, 0x93d93fe1, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "jl06.d10", 0x010000, 0x91cf668e, 3 | BRF_GRA }, // 7 Characters - { "jl07.d12", 0x010000, 0xe61d0e42, 3 | BRF_GRA }, // 8 - - { "mav00.b10", 0x080000, 0x34785d97, 4 | BRF_GRA }, // 9 Foreground Tiles - { "mav01.b12", 0x080000, 0x8b531b16, 4 | BRF_GRA }, // 10 - - { "mav02.b16", 0x100000, 0x20723bf7, 5 | BRF_GRA }, // 11 Background Tiles - { "mav03.e16", 0x100000, 0xef6195f0, 5 | BRF_GRA }, // 12 - - { "mav05.e19", 0x100000, 0xd92d769c, 6 | BRF_GRA }, // 13 Sprite Bank A - { "mav04.b19", 0x100000, 0x8ba48385, 6 | BRF_GRA }, // 14 - { "mav07.e20", 0x080000, 0x5fc10ccd, 6 | BRF_GRA }, // 15 - { "mav06.b20", 0x080000, 0xae6201a5, 6 | BRF_GRA }, // 16 - - { "mav09.e23", 0x040000, 0x1ce7b51a, 7 | BRF_GRA }, // 17 Sprite Bank B - { "mav08.b23", 0x040000, 0x64966576, 7 | BRF_GRA }, // 18 - - { "mav10.r17", 0x080000, 0x8ad734b0, 8 | BRF_SND }, // 19 OKI M6295 Samples 0 - - { "mav11.r19", 0x080000, 0xef513908, 9 | BRF_SND }, // 20 OKI M6295 Samples 1 - - { "jn-00.17l", 0x000400, 0x6ac77b84, 0 | BRF_OPT }, // 21 Unused PROMs -}; - -STD_ROM_PICK(nitrobal) -STD_ROM_FN(nitrobal) - -struct BurnDriver BurnDrvNitrobal = { - "nitrobal", NULL, NULL, NULL, "1992", - "Nitro Ball (World, set 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, nitrobalRomInfo, nitrobalRomName, NULL, NULL, NitrobalInputInfo, NitrobalDIPInfo, - NitrobalInit, DrvExit, DrvFrame, NitrobalDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Nitro Ball (World, set 2) - -static struct BurnRomInfo nitrobalaRomDesc[] = { - // roms had no labels - { "3d", 0x020000, 0x48f77c19, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "3b", 0x020000, 0xfb1284e9, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5d", 0x020000, 0xac47367a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "5b", 0x020000, 0xa8e9d7dd, 1 | BRF_PRG | BRF_ESS }, // 3 - { "6d", 0x040000, 0x59e620cc, 1 | BRF_PRG | BRF_ESS }, // 4 // 7ee3 - 7f06 are 0xff instead of 0x00 in the nitrobal set, why? - { "6b", 0x040000, 0x1fd8995b, 1 | BRF_PRG | BRF_ESS }, // 5 // this half of the pair matches - /* Two empty rom slots at d7, b7 */ - - { "jl08.r20", 0x010000, 0x93d93fe1, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "jl06.d10", 0x010000, 0x91cf668e, 3 | BRF_GRA }, // 7 Characters - { "jl07.d12", 0x010000, 0xe61d0e42, 3 | BRF_GRA }, // 8 - - { "mav00.b10", 0x080000, 0x34785d97, 4 | BRF_GRA }, // 9 Foreground Tiles - { "mav01.b12", 0x080000, 0x8b531b16, 4 | BRF_GRA }, // 10 - - { "mav02.b16", 0x100000, 0x20723bf7, 5 | BRF_GRA }, // 11 Background Tiles - { "mav03.e16", 0x100000, 0xef6195f0, 5 | BRF_GRA }, // 12 - - { "mav05.e19", 0x100000, 0xd92d769c, 6 | BRF_GRA }, // 13 Sprite Bank A - { "mav04.b19", 0x100000, 0x8ba48385, 6 | BRF_GRA }, // 14 - { "mav07.e20", 0x080000, 0x5fc10ccd, 6 | BRF_GRA }, // 15 - { "mav06.b20", 0x080000, 0xae6201a5, 6 | BRF_GRA }, // 16 - - { "mav09.e23", 0x040000, 0x1ce7b51a, 7 | BRF_GRA }, // 17 Sprite Bank B - { "mav08.b23", 0x040000, 0x64966576, 7 | BRF_GRA }, // 18 - - { "mav10.r17", 0x080000, 0x8ad734b0, 8 | BRF_SND }, // 19 OKI M6295 Samples 0 - - { "mav11.r19", 0x080000, 0xef513908, 9 | BRF_SND }, // 20 OKI M6295 Samples 1 - - { "jn-00.17l", 0x000400, 0x6ac77b84, 0 | BRF_OPT }, // 21 Unused PROMs -}; - -STD_ROM_PICK(nitrobala) -STD_ROM_FN(nitrobala) - -struct BurnDriver BurnDrvNitrobala = { - "nitrobala", "nitrobal", NULL, NULL, "1992", - "Nitro Ball (World, set 2)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, nitrobalaRomInfo, nitrobalaRomName, NULL, NULL, NitrobalInputInfo, NitrobalDIPInfo, - NitrobalInit, DrvExit, DrvFrame, NitrobalDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Gun Ball (Japan) - -static struct BurnRomInfo gunballRomDesc[] = { - { "jc01.3d", 0x020000, 0x61bfa998, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jc00.3b", 0x020000, 0x73ba8f74, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jc03.5d", 0x020000, 0x19231612, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jc02.5b", 0x020000, 0xa254f34c, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jc05-3.6d", 0x040000, 0xf750a709, 1 | BRF_PRG | BRF_ESS }, // 4 - { "jc04-3.6b", 0x040000, 0xad711767, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "jl08.r20", 0x010000, 0x93d93fe1, 2 | BRF_PRG | BRF_ESS }, // 6 Huc6280 Code - - { "jl06.d10", 0x010000, 0x91cf668e, 3 | BRF_GRA }, // 7 Characters - { "jl07.d12", 0x010000, 0xe61d0e42, 3 | BRF_GRA }, // 8 - - { "mav00.b10", 0x080000, 0x34785d97, 4 | BRF_GRA }, // 9 Foreground Tiles - { "mav01.b12", 0x080000, 0x8b531b16, 4 | BRF_GRA }, // 10 - - { "mav02.b16", 0x100000, 0x20723bf7, 5 | BRF_GRA }, // 11 Background Tiles - { "mav03.e16", 0x100000, 0xef6195f0, 5 | BRF_GRA }, // 12 - - { "mav05.e19", 0x100000, 0xd92d769c, 6 | BRF_GRA }, // 13 Sprite Bank A - { "mav04.b19", 0x100000, 0x8ba48385, 6 | BRF_GRA }, // 14 - { "mav07.e20", 0x080000, 0x5fc10ccd, 6 | BRF_GRA }, // 15 - { "mav06.b20", 0x080000, 0xae6201a5, 6 | BRF_GRA }, // 16 - - { "mav09.e23", 0x040000, 0x1ce7b51a, 7 | BRF_GRA }, // 17 Sprite Bank B - { "mav08.b23", 0x040000, 0x64966576, 7 | BRF_GRA }, // 18 - - { "mav10.r17", 0x080000, 0x8ad734b0, 8 | BRF_SND }, // 19 OKI M6295 Samples 0 - - { "mav11.r19", 0x080000, 0xef513908, 9 | BRF_SND }, // 20 OKI M6295 Samples 1 - - { "jn-00.17l", 0x000400, 0x6ac77b84, 0 | BRF_OPT }, // 21 Unused PROMs -}; - -STD_ROM_PICK(gunball) -STD_ROM_FN(gunball) - -struct BurnDriver BurnDrvGunball = { - "gunball", "nitrobal", NULL, NULL, "1992", - "Gun Ball (Japan)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_PREFIX_DATAEAST, GBF_SHOOT, 0, - NULL, gunballRomInfo, gunballRomName, NULL, NULL, NitrobalInputInfo, NitrobalDIPInfo, - NitrobalInit, DrvExit, DrvFrame, NitrobalDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/dataeast/d_shootout.cpp b/jan/src/burn/drv/dataeast/d_shootout.cpp deleted file mode 100644 index 298bb5484..000000000 --- a/jan/src/burn/drv/dataeast/d_shootout.cpp +++ /dev/null @@ -1,948 +0,0 @@ -// FB Alpha Shoot Out driver module -// Based on MAME driver by Ernesto Corvi, Phil Stroffolino, Bryan McPhail - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6502ROM0; -static UINT8 *DrvM6502ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvM6502RAM0A; -static UINT8 *DrvM6502RAM0B; -static UINT8 *DrvM6502RAM1; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; - -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 bankdata; -static INT32 soundcpu_mhz; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 vblank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvInputs[2]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static UINT8 shootoutb = 0; -static UINT8 ym2203portainit; -static UINT8 ym2203portbinit; - -static struct BurnInputInfo ShootoutInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Shootout) - -static struct BurnDIPInfo ShootoutDIPList[]= -{ - {0x11, 0xff, 0xff, 0xbf, NULL }, - {0x12, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 0, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x00, "Upright" }, - {0x11, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x03, 0x01, "1" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "5" }, - {0x12, 0x01, 0x03, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x0c, 0x0c, "20,000 Every 70,000" }, - {0x12, 0x01, 0x0c, 0x08, "30,000 Every 80,000" }, - {0x12, 0x01, 0x0c, 0x04, "40,000 Every 90,000" }, - {0x12, 0x01, 0x0c, 0x00, "70,000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Easy" }, - {0x12, 0x01, 0x30, 0x20, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Very Hard" }, -}; - -STDDIPINFO(Shootout) - -static struct BurnDIPInfo ShootoujDIPList[]= -{ - {0x11, 0xff, 0xff, 0xbf, NULL }, - {0x12, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 0, "Company Copyright" }, - {0x11, 0x01, 0x20, 0x20, "Data East Corp" }, - {0x11, 0x01, 0x20, 0x00, "Data East USA Inc" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x00, "Upright" }, - {0x11, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x03, 0x01, "1" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "5" }, - {0x12, 0x01, 0x03, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x0c, 0x0c, "20,000 Every 50,000" }, - {0x12, 0x01, 0x0c, 0x08, "30,000 Every 60,000" }, - {0x12, 0x01, 0x0c, 0x04, "50,000 Every 70,000" }, - {0x12, 0x01, 0x0c, 0x00, "70,000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Easy" }, - {0x12, 0x01, 0x30, 0x20, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Very Hard" }, -}; - -STDDIPINFO(Shootouj) - -static void bankswitch(INT32 data) -{ - INT32 bank = 0x8000 + (data & 0xf) * 0x4000; - - bankdata = data; - - M6502MapMemory(DrvM6502ROM0 + bank, 0x4000, 0x7fff, MAP_ROM); -} - -static void shootout_main_write(UINT16 address, UINT8 data) -{ - if (address >= 0x1004 && address <= 0x17ff) { - DrvM6502RAM0B[address & 0x7ff] = data; - return; - } - - switch (address) - { - case 0x1000: - bankswitch(data & 0xf); - return; - - case 0x1001: - flipscreen = data & 1; - return; - - case 0x1002: - // coin counter - return; - - case 0x1003: - soundlatch = data; - M6502Close(); - M6502Open(1); - M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - M6502Close(); - M6502Open(0); - return; - - // shootouj - case 0x1800: - // coin counter - return; - - case 0x2800: - case 0x2801: - BurnYM2203Write(0, address & 1, data); - return; - } -} - -static UINT8 shootout_main_read(UINT16 address) -{ - if (address >= 0x1004 && address <= 0x17ff) { - return DrvM6502RAM0B[address & 0x7ff]; - } - - switch (address) - { - case 0x1000: - return DrvDips[0]; - - case 0x1001: - return DrvInputs[0]; - - case 0x1002: - return DrvInputs[1]; - - case 0x1003: - return (DrvDips[1] & 0x3f) | (vblank ? 0 : 0x80); - - case 0x2800: - case 0x2801: - return BurnYM2203Read(0, address & 1); - } - - return 0; -} - -static void shootout_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x4000: - case 0x4001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xd000: - return; //nop - } -} - -static UINT8 shootout_sound_read(UINT16 address) -{ - switch (address) - { - case 0x4000: - case 0x4001: - return BurnYM2203Read(0, address & 1); - - case 0xa000: - return soundlatch; - } - - return 0; -} - -static void ym2203_write_port_A(UINT32, UINT32 data) -{ - if (ym2203portainit == 0) { // first thing written here on YM2203Reset() is 0xff, causes problems. - ym2203portainit = 1; - return; - } - - bankswitch(data); -} - -static void ym2203_write_port_B(UINT32, UINT32 data) -{ - if (ym2203portbinit == 0) { - ym2203portbinit = 1; - return; - } - - flipscreen = data & 1; -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - M6502SetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6502TotalCycles() * nSoundRate / soundcpu_mhz; -} - -inline static double DrvGetTime() -{ - return (double)M6502TotalCycles() / soundcpu_mhz; -} - -static tilemap_callback( background ) -{ - INT32 attr = DrvVidRAM[offs + 0x400]; - INT32 code = DrvVidRAM[offs] + ((attr & 7) << 8); - INT32 color = attr >> 4; - - TILE_SET_INFO(0, code, color, 0); -} - -static tilemap_callback( foreground ) -{ - INT32 attr = DrvTxtRAM[offs + 0x400]; - INT32 code = DrvTxtRAM[offs] + ((attr & 3) << 8); - INT32 color = attr >> 4; - - TILE_SET_INFO(1, code, color, 0); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6502Open(0); - M6502Reset(); - bankswitch(0); - M6502Close(); - - M6502Open(1); - M6502Reset(); - BurnYM2203Reset(); - M6502Close(); - - soundlatch = 0; - flipscreen = 0; - vblank = 1; // 248 on, 8 off - - ym2203portainit = 0; - ym2203portbinit = 0; - - DrvInputs[1] = 0x3f; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6502ROM0 = Next; Next += 0x018000; - - DrvM6502ROM1 = Next; Next += 0x004000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvM6502RAM0A = Next; Next += 0x001000; - DrvM6502RAM0B = Next; Next += 0x000800; - DrvM6502RAM1 = Next; Next += 0x000800; - DrvTxtRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000200; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0, 4 }; - INT32 Plane1[3] = { 0*0x10000*8, 1*0x10000*8, 2*0x10000*8 }; - INT32 XOffs0[8] = { STEP4((0x4000*8), 1), STEP4(0,1) }; - INT32 XOffs1[16]= { STEP8(128,1), STEP8(0,1) }; - INT32 YOffs[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x30000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x8000); // char - - GfxDecode(0x0400, 2, 8, 8, Plane0, XOffs0, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x30000); - - GfxDecode(0x0800, 3, 16, 16, Plane1, XOffs1, YOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x8000); - - GfxDecode(0x0800, 2, 8, 8, Plane0, XOffs0, YOffs, 0x040, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static INT32 ShootoutInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6502ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x10000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - memcpy (DrvGfxROM0 + 0x4000, DrvGfxROM0 + 0x2000, 0x2000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x28000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 11, 1)) return 1; - memcpy (DrvGfxROM2 + 0x00000, DrvGfxROM2 + 0x08000 + 0x00000, 0x02000); - memcpy (DrvGfxROM2 + 0x04000, DrvGfxROM2 + 0x08000 + 0x02000, 0x02000); - memcpy (DrvGfxROM2 + 0x02000, DrvGfxROM2 + 0x08000 + 0x04000, 0x02000); - memcpy (DrvGfxROM2 + 0x06000, DrvGfxROM2 + 0x08000 + 0x06000, 0x02000); - memset (DrvGfxROM2 + 0x08000, 0, 0x08000); - - if (BurnLoadRom(DrvColPROM + 0x00000, 12, 1)) return 1; - - DrvGfxDecode(); - } - - M6502Init(0, TYPE_DECO222); - M6502Open(0); - M6502MapMemory(DrvM6502RAM0A, 0x0000, 0x0fff, MAP_RAM); - //M6502MapMemory(DrvM6502RAM0B, 0x1000, 0x17ff, MAP_RAM); // in handler - M6502MapMemory(DrvSprRAM, 0x1800, 0x19ff, MAP_RAM); - M6502MapMemory(DrvTxtRAM, 0x2000, 0x27ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x2800, 0x2fff, MAP_RAM); - M6502MapMemory(DrvM6502ROM0, 0x8000, 0xffff, MAP_ROM); - M6502SetWriteHandler(shootout_main_write); - M6502SetReadHandler(shootout_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502MapMemory(DrvM6502RAM1, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM1, 0xc000, 0xffff, MAP_ROM); - M6502SetWriteHandler(shootout_sound_write); - M6502SetReadHandler(shootout_sound_read); - M6502Close(); - - BurnYM2203Init(1, 1500000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachM6502(1500000); - soundcpu_mhz = 1500000; - BurnYM2203SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 8, 8, 32, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, foreground_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM2, 2, 8, 8, 0x20000, 0x00, 0xf); - GenericTilemapSetGfx(1, DrvGfxROM0, 2, 8, 8, 0x10000, 0x80, 0xf); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -8); - GenericTilemapSetTransparent(1, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 ShootoujInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6502ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x10000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - memcpy (DrvGfxROM0 + 0x4000, DrvGfxROM0 + 0x2000, 0x2000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 7, 1)) return 1; - memcpy (DrvGfxROM2 + 0x00000, DrvGfxROM2 + 0x08000 + 0x00000, 0x02000); - memcpy (DrvGfxROM2 + 0x04000, DrvGfxROM2 + 0x08000 + 0x02000, 0x02000); - memcpy (DrvGfxROM2 + 0x02000, DrvGfxROM2 + 0x08000 + 0x04000, 0x02000); - memcpy (DrvGfxROM2 + 0x06000, DrvGfxROM2 + 0x08000 + 0x06000, 0x02000); - memset (DrvGfxROM2 + 0x08000, 0, 0x08000); - - if (BurnLoadRom(DrvColPROM + 0x00000, 8, 1)) return 1; - - DrvGfxDecode(); - } - - M6502Init(0, (shootoutb) ? TYPE_DECO222 : TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM0A, 0x0000, 0x0fff, MAP_RAM); - M6502MapMemory(DrvSprRAM, 0x2000, 0x21ff, MAP_RAM); - M6502MapMemory(DrvTxtRAM, 0x3000, 0x37ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x3800, 0x3fff, MAP_RAM); - M6502MapMemory(DrvM6502ROM0, 0x8000, 0xffff, MAP_ROM); - M6502SetWriteHandler(shootout_main_write); - M6502SetReadHandler(shootout_main_read); - M6502Close(); - - // Fake so we can re-use functions - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502MapMemory(DrvM6502ROM0, 0x8000, 0xffff, MAP_ROM); - M6502Close(); - - BurnYM2203Init(1, 1500000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, NULL, NULL, &ym2203_write_port_A, &ym2203_write_port_B); - BurnTimerAttachM6502(2000000); - soundcpu_mhz = 2000000; - BurnYM2203SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 8, 8, 32, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, foreground_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM2, 2, 8, 8, 0x20000, 0x00, 0xf); - GenericTilemapSetGfx(1, DrvGfxROM0, 2, 8, 8, 0x10000, 0x80, 0xf); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -8); - GenericTilemapSetTransparent(1, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 ShootoutbInit() -{ - shootoutb = 1; - return ShootoujInit(); -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - BurnYM2203Exit(); - - BurnFree (AllMem); - - shootoutb = 0; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 256; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_sprites(INT32 bank_bits) -{ - const UINT8 *source = DrvSprRAM+127*4; - - bool m_bFlicker = (nCurrentFrame & 1) != 0; - - for(INT32 count=0; count<128; count++) - { - int attributes = source[1]; - - if ( attributes & 0x01 ){ - if( m_bFlicker || (attributes&0x02)==0 ){ - int priority_mask = (attributes&0x08)?0x2:0; - int sx = (240 - source[2])&0xff; - int sy = (240 - source[0])&0xff; - int vx, vy; - int number = source[3] | ((attributes<> 4) & 0x01; - Bit1 = (DrvProm[i] >> 5) & 0x01; - Bit2 = (DrvProm[i] >> 6) & 0x01; - Bit3 = (DrvProm[i] >> 7) & 0x01; - r = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (DrvProm[i] >> 0) & 0x01; - Bit1 = (DrvProm[i] >> 1) & 0x01; - Bit2 = (DrvProm[i] >> 2) & 0x01; - Bit3 = (DrvProm[i] >> 3) & 0x01; - g = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (DrvProm[i + 0x100] >> 0) & 0x01; - Bit1 = (DrvProm[i + 0x100] >> 1) & 0x01; - Bit2 = (DrvProm[i + 0x100] >> 2) & 0x01; - Bit3 = (DrvProm[i + 0x100] >> 3) & 0x01; - b = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void DrvRenderBgLayer(INT32 RenderCategory) -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, Category; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Attr = DrvColourRam[TileIndex]; - Code = (DrvVideoRam[TileIndex] + ((Attr & 0x07) << 8)) & 0x7ff; - Colour = ((Attr & 0x10) >> 3) | ((Attr & 0x20) >> 5); - Category = (Attr & 0x80) >> 7; - - if (Category == RenderCategory) { - x = 8 * mx; - y = 8 * my; - - y -= 16; - - x = 248 - x; - - if (RenderCategory) { - if (x > 8 && x < 248 && y > 8 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 3, 0, 128, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 3, 0, 128, DrvChars); - } - } else { - if (x > 8 && x < 248 && y > 8 && y < 216) { - Render8x8Tile(pTransDraw, Code, x, y, Colour, 3, 128, DrvChars); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 3, 128, DrvChars); - } - } - } - - TileIndex++; - } - } -} - -static void DrawSprites() -{ - for (INT32 Offs = 0; Offs < 0x100; Offs += 4) { - INT32 sx, sy, Code, Colour, xFlip, yFlip; - - Code = (DrvSpriteRam[Offs + 3] + ((DrvSpriteRam[Offs + 1] & 0x03) << 8)) & 0x3ff; - Colour = (DrvSpriteRam[Offs + 1] & 0xf0) >> 4; - - sx = DrvSpriteRam[Offs + 2] - 2; - sy = DrvSpriteRam[Offs]; - - xFlip = DrvSpriteRam[Offs + 1] & 0x08; - yFlip = DrvSpriteRam[Offs + 1] & 0x04; - - sy -= 16; - - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Colour, 3, 0, 0, DrvSprites); - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx - 256, sy, Colour, 3, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 3, 0, 0, DrvSprites); - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx - 256, sy, Colour, 3, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, sy, Colour, 3, 0, 0, DrvSprites); - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx - 256, sy, Colour, 3, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 3, 0, 0, DrvSprites); - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx - 256, sy, Colour, 3, 0, 0, DrvSprites); - } - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - if (nBurnLayer & 0x01) DrvRenderBgLayer(0); - if (nSpriteEnable & 0x02) DrawSprites(); - if (nBurnLayer & 0x04) DrvRenderBgLayer(1); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nCyclesTotal[2] = { 2000000 / 58, 1500000 / 58 }; - INT32 nInterleave = 100; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - M6809NewFrame(); - M6502NewFrame(); - - M6809Open(0); - M6502Open(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - BurnTimerUpdate(nNext); - if (i == (nInterleave - 1)) M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - BurnTimerUpdateYM3526(nNext); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - M6502Close(); - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - M6502Scan(nAction); - - BurnYM2203Scan(nAction, pnMin); - BurnYM3526Scan(nAction, pnMin); - - SCAN_VAR(I8751Return); - SCAN_VAR(CurrentPtr); - SCAN_VAR(CurrentTable); - SCAN_VAR(InMath); - SCAN_VAR(MathParam); - SCAN_VAR(DrvSoundLatch); - } - - return 0; -} - -struct BurnDriver BurnDrvSidepckt = { - "sidepckt", NULL, NULL, NULL, "1986", - "Side Pocket (World)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_PREFIX_DATAEAST, GBF_SPORTSMISC, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - SidepcktInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSidepcktj = { - "sidepcktj", "sidepckt", NULL, NULL, "1986", - "Side Pocket (Japan)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_PREFIX_DATAEAST, GBF_SPORTSMISC, 0, - NULL, DrvjRomInfo, DrvjRomName, NULL, NULL, DrvInputInfo, DrvjDIPInfo, - SidepcktjInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSidepcktb = { - "sidepcktb", "sidepckt", NULL, NULL, "1986", - "Side Pocket (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_PREFIX_DATAEAST, GBF_SPORTSMISC, 0, - NULL, DrvbRomInfo, DrvbRomName, NULL, NULL, DrvInputInfo, DrvbDIPInfo, - SidepcktbInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSidepcktb2 = { - "sidepcktb2", "sidepckt", NULL, NULL, "1986", - "Side Pocket (bootleg set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_PREFIX_DATAEAST, GBF_SPORTSMISC, 0, - NULL, Drvb2RomInfo, Drvb2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - SidepcktbInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_simpl156.cpp b/jan/src/burn/drv/dataeast/d_simpl156.cpp deleted file mode 100644 index 902c9eed2..000000000 --- a/jan/src/burn/drv/dataeast/d_simpl156.cpp +++ /dev/null @@ -1,1154 +0,0 @@ -// FB Alpha Data East Simple 156 System driver module -// Based on MAME driver by - -#include "tiles_generic.h" -#include "arm_intf.h" -#include "msm6295.h" -#include "eeprom.h" -#include "deco16ic.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvArmROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvEEPROM; -static UINT8 *DrvArmRAM; -static UINT8 *DrvSysRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[1]; -static UINT16 DrvInputs[2]; -static UINT8 DrvReset; - -static INT32 charlienmode = 0; - -static INT32 DrvOkiBank; - -static struct BurnInputInfo Simpl156InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Simpl156) - -static struct BurnDIPInfo Simpl156DIPList[]= -{ - {0x14, 0xff, 0xff, 0x08, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Simpl156) - -//----------------------------------------------------------------------------------------------------------------------------------------------- - -static void oki_set_bank(INT32 bank) -{ - if (DrvOkiBank != (bank & 0x07)) { - DrvOkiBank = bank & 0x07; - memcpy (DrvSndROM0 + 0x100000, DrvSndROM1 + 0x40000 * DrvOkiBank, 0x40000); - } -} - -// use INT type for ADDRESS to kill mingw warnings -static void CommonWrite32(INT32 address, UINT32 data) -{ - Write16Long(DrvArmRAM, 0x000000, 0x007fff) // 16-bit - Write16Long(DrvSprRAM, 0x010000, 0x011fff) // 16-bit - Write16Long(DrvPalRAM, 0x020000, 0x020fff) // 16-bit - Write16Long(((UINT8*)deco16_pf_control[0]), 0x040000, 0x04001f) // 16-bit - Write16Long(deco16_pf_ram[0], 0x050000, 0x051fff) // 16-bit - Write16Long(deco16_pf_ram[0], 0x052000, 0x053fff) // 16-bit mirror - Write16Long(deco16_pf_ram[1], 0x054000, 0x055fff) // 16-bit - Write16Long(deco16_pf_rowscroll[0], 0x060000, 0x061fff) // 16-bit - Write16Long(deco16_pf_rowscroll[1], 0x064000, 0x065fff) // 16-bit - - if (address == 0x030000) { - oki_set_bank(data); - EEPROMWrite(data & 0x20, data & 0x40, data & 0x10); - return; - } -} - -static void CommonWrite8(INT32 address, UINT8 data) -{ - Write16Byte(DrvArmRAM, 0x000000, 0x007fff) // 16-bit - Write16Byte(DrvSprRAM, 0x010000, 0x011fff) // 16-bit - Write16Byte(DrvPalRAM, 0x020000, 0x020fff) // 16-bit - Write16Byte(((UINT8*)deco16_pf_control[0]), 0x040000, 0x04001f) // 16-bit - Write16Byte(deco16_pf_ram[0], 0x050000, 0x051fff) // 16-bit - Write16Byte(deco16_pf_ram[0], 0x052000, 0x053fff) // 16-bit mirror - Write16Byte(deco16_pf_ram[1], 0x054000, 0x055fff) // 16-bit - Write16Byte(deco16_pf_rowscroll[0], 0x060000, 0x061fff) // 16-bit - Write16Byte(deco16_pf_rowscroll[1], 0x064000, 0x065fff) // 16-bit - - if ((address & ~3) == 0x030000) { - oki_set_bank(data); - EEPROMWrite(data & 0x20, data & 0x40, data & 0x10); - return; - } -} - -static UINT32 CommonRead32(INT32 address) -{ - Read16Long(DrvArmRAM, 0x000000, 0x007fff) // 16-bit - Read16Long(DrvSprRAM, 0x010000, 0x011fff) // 16-bit - Read16Long(DrvPalRAM, 0x020000, 0x020fff) // 16-bit - Read16Long(((UINT8*)deco16_pf_control[0]), 0x040000, 0x04001f) // 16-bit - Read16Long(deco16_pf_ram[0], 0x050000, 0x051fff) // 16-bit - Read16Long(deco16_pf_ram[0], 0x052000, 0x053fff) // 16-bit mirror - Read16Long(deco16_pf_ram[1], 0x054000, 0x055fff) // 16-bit - Read16Long(deco16_pf_rowscroll[0], 0x060000, 0x061fff) // 16-bit - Read16Long(deco16_pf_rowscroll[1], 0x064000, 0x065fff) // 16-bit - - if (address == 0x30000) { - return DrvInputs[1]; - } - - return 0; -} - -static UINT8 CommonRead8(INT32 address) -{ - Read16Byte(DrvArmRAM, 0x000000, 0x007fff) // 16-bit - Read16Byte(DrvSprRAM, 0x010000, 0x011fff) // 16-bit - Read16Byte(DrvPalRAM, 0x020000, 0x020fff) // 16-bit - Read16Byte(((UINT8*)deco16_pf_control[0]), 0x040000, 0x04001f) // 16-bit - Read16Byte(deco16_pf_ram[0], 0x050000, 0x051fff) // 16-bit - Read16Byte(deco16_pf_ram[0], 0x052000, 0x053fff) // 16-bit mirror - Read16Byte(deco16_pf_ram[1], 0x054000, 0x055fff) // 16-bit - Read16Byte(deco16_pf_rowscroll[0], 0x060000, 0x061fff) // 16-bit - Read16Byte(deco16_pf_rowscroll[1], 0x064000, 0x065fff) // 16-bit - - switch (address) - { - case 0x030000: - case 0x030001: - case 0x030002: - case 0x030003: - return 0xff; - } - - return 0; -} - -//----------------------------------------------------------------------------------------------------------------------------------------------- - -static UINT32 map_offsets[3]; // memory, msm0, msm1 - -void simpl156_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xf80000) == map_offsets[0]) { - CommonWrite8(address & 0x7ffff, data); - } - - if ((address & ~3) == map_offsets[1]) { - MSM6295Command(0, data); - return; - } - - if ((address & ~3) == map_offsets[2]) { - MSM6295Command(1, data); - return; - } -} - -void simpl156_write_long(UINT32 address, UINT32 data) -{ - if ((address & 0xf80000) == map_offsets[0]) { - CommonWrite32(address & 0x7ffff, data); - } - - if (address == map_offsets[1]) { - MSM6295Command(0, data); - return; - } - - if (address == map_offsets[2]) { - MSM6295Command(1, data); - return; - } -} - -UINT8 simpl156_read_byte(UINT32 address) -{ - if ((address & 0xf80000) == map_offsets[0]) { - return CommonRead8(address & 0x7ffff); - } - - if ((address & ~3) == 0x200000) { - return ~0; // inputs -- only read once on boot - } - - if ((address & ~3) == map_offsets[1]) { - return MSM6295ReadStatus(0); - } - - if ((address & ~3) == map_offsets[2]) { - return MSM6295ReadStatus(1); - } - - return 0; -} - -UINT32 simpl156_read_long(UINT32 address) -{ - if ((address & 0xf80000) == map_offsets[0]) { - return CommonRead32(address & 0x7ffff); - } - - if (address == 0x200000) { - return 0xffff0000 | (EEPROMRead() << 8) | DrvInputs[0] | deco16_vblank; // party time needs proper vblank - } - - if (address == map_offsets[1]) { - return MSM6295ReadStatus(0); - } - - if (address == map_offsets[2]) { - return MSM6295ReadStatus(1); - } - - return 0; -} - -static void common_map(INT32 ram, INT32 sfx, INT32 mus) -{ - map_offsets[0] = ram; // ram regions - map_offsets[1] = sfx; // oki #0 (sfx) - map_offsets[2] = mus; // oki #1 (music) - - ArmInit(0); - ArmOpen(0); - ArmMapMemory(DrvArmROM, 0x000000, 0x07ffff, MAP_ROM); - ArmMapMemory(DrvSysRAM, 0x201000, 0x201fff, MAP_RAM); // 32-bit - // ram regions and oki addresses set in map offsets - ArmSetWriteByteHandler(simpl156_write_byte); - ArmSetWriteLongHandler(simpl156_write_long); - ArmSetReadByteHandler(simpl156_read_byte); - ArmSetReadLongHandler(simpl156_read_long); - ArmClose(); -} - -static void mitchell_map() { common_map(0x180000, 0x100000, 0x140000); } -static void magdrop_map() { common_map(0x380000, 0x400000, 0x340000); } -static void joemacr_map() { common_map(0x100000, 0x180000, 0x1c0000); } -static void chainrec_map() { common_map(0x400000, 0x480000, 0x3c0000); } -static void magdropp_map() { common_map(0x680000, 0x780000, 0x4c0000); } - -static INT32 simpl156_bank_callback(const INT32 bank) -{ - return ((bank >> 4) & 0x7) * 0x1000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ArmOpen(0); - ArmReset(); - ArmClose(); - - MSM6295Reset(0); - MSM6295Reset(1); - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvEEPROM, (charlienmode) ? 0xff : 0x00, 0x80); - } - - deco16Reset(); - - DrvOkiBank = -1; - oki_set_bank(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvArmROM = Next; Next += 0x0080000; - - DrvGfxROM0 = Next; Next += 0x0400000; - DrvGfxROM1 = Next; Next += 0x0400000; - DrvGfxROM2 = Next; Next += 0x1000000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x0180000; - DrvSndROM1 = Next; Next += 0x0200000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - DrvEEPROM = Next; Next += 0x0000080; - - AllRam = Next; - - DrvArmRAM = Next; Next += 0x0004000; - DrvSysRAM = Next; Next += 0x0002000; - DrvPalRAM = Next; Next += 0x0001000; - DrvSprRAM = Next; Next += 0x0001000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void decode_samples() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - - for (INT32 i = 0; i < 0x200000; i++) { - tmp[((i & 1) << 20) | (i >> 1)] = DrvSndROM1[i]; - } - - memcpy (DrvSndROM1, tmp, 0x200000); - - BurnFree (tmp); -} - -static void pCommonSpeedhackCallback() -{ - ArmIdleCycles(1120); // ok? -} - -static INT32 CommonInit(INT32 (*pRomLoad)(INT32 *, INT32 *), void (*pMap)(), INT32 msm, UINT32 speedhack) -{ - BurnSetRefreshRate(58.00); - - INT32 gfx0len, gfx1len; - - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pRomLoad) { - - if (pRomLoad(&gfx0len, &gfx1len)) return 1; - - deco156_decrypt(DrvArmROM, 0x080000); - - deco56_decrypt_gfx(DrvGfxROM0, gfx0len); - - deco16_tile_decode(DrvGfxROM0, DrvGfxROM1, gfx0len, 0); - deco16_tile_decode(DrvGfxROM0, DrvGfxROM0, gfx0len, 1); - - deco16_sprite_decode(DrvGfxROM2, gfx1len); - - decode_samples(); - } - - if (pMap) { - pMap(); - } - - ArmSetSpeedHack(speedhack ? speedhack : ~0, pCommonSpeedhackCallback); - - EEPROMInit(&eeprom_interface_93C46); - - MSM6295Init(0, 1006875 / 132, 1); - MSM6295Init(1, 2013750 / 132 / msm, 1); - MSM6295SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - - deco16Init(1, 0, 1); - deco16_set_bank_callback(0, simpl156_bank_callback); - deco16_set_bank_callback(1, simpl156_bank_callback); - deco16_set_graphics(DrvGfxROM0, gfx0len*2, DrvGfxROM1, gfx0len*2, NULL, 0); - deco16_set_global_offsets(0, 8); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - ArmExit(); - - MSM6295Exit(0); - MSM6295Exit(1); - MSM6295ROM = NULL; - - GenericTilesExit(); - - deco16Exit(); - - BurnFree (AllMem); - - charlienmode = 0; - - return 0; -} - -static void simpl156_palette_recalc() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x1000 / 4; i++) - { - INT32 r = (BURN_ENDIAN_SWAP_INT16 (p[i]) >> 0) & 0x1f; //Seb - INT32 g = (BURN_ENDIAN_SWAP_INT16 (p[i]) >> 5) & 0x1f; //Seb - INT32 b = (BURN_ENDIAN_SWAP_INT16 (p[i]) >> 10) & 0x1f; //Seb - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_sprites() -{ - UINT16 *spriteram = (UINT16*)DrvSprRAM; - - for (INT32 offs = (0x1400 / 4) - 4; offs >= 0; offs -= 4) - { - INT32 mult, inc; - - INT32 sy = BURN_ENDIAN_SWAP_INT16 (spriteram[offs + 0]); //Seb - if ((sy & 0x1000) && (nCurrentFrame & 1)) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16 (spriteram[offs + 1]); //Seb - INT32 sx = BURN_ENDIAN_SWAP_INT16 (spriteram[offs + 2]); //Seb - INT32 color = (sx >> 9) & 0x1f; - INT32 pri = sx & 0xc000; - INT32 flipx = sy & 0x2000; - INT32 flipy = sy & 0x4000; - INT32 multi = (1 << ((sy & 0x0600) >> 9)) - 1; - - switch (pri) - { - case 0x0000: pri = 0x00; break; - case 0x4000: pri = 0xf0; break; - case 0x8000: - case 0xc000: pri = 0xfc; break; - } - - sx = sx & 0x01ff; - sy = sy & 0x01ff; - if (sx >= 320) sx -= 512; - if (sy >= 256) sy -= 512; - sy = 240 - sy; - sx = 304 - sx; - - if (sx > 320) continue; - - code &= ~multi; - - if (flipy) { - inc = -1; - } else { - code += multi; - inc = 1; - } - - if (1)//flipscreen - { - sy = 240 - sy; - sx = 304 - sx; - flipx = !flipx; - flipy = !flipy; - mult = 16; - } - else - mult = -16; - - while (multi >= 0) - { - deco16_draw_prio_sprite(pTransDraw, DrvGfxROM2, code - multi * inc, (color << 4)+0x200, sx, sy + mult * multi, flipx, flipy, pri); - - multi--; - } - } -} - -static INT32 DrvDraw() -{ - simpl156_palette_recalc(); - - deco16_pf12_update(); - deco16_clear_prio_map(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x100; - } - - deco16_draw_layer(1, pTransDraw, 2); - deco16_draw_layer(0, pTransDraw, 4); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0x0007 | (DrvDips[0] & 8); - DrvInputs[1] = 0xffff; - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nTotalCycles = 28000000 / 58; - - ArmOpen(0); - deco16_vblank = 0x00; - ArmRun(nTotalCycles - 12240); - ArmSetIRQLine(ARM_IRQ_LINE, CPU_IRQSTATUS_AUTO); - deco16_vblank = 0xf0; - ArmRun(12240); - ArmClose(); - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * sizeof(INT16) * 2); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ArmScan(nAction); - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - deco16Scan(); - - SCAN_VAR(DrvOkiBank); - - if (nAction & ACB_WRITE) { - INT32 bank = DrvOkiBank; - DrvOkiBank = -1; - oki_set_bank(bank); - } - } - - return 0; -} - - -// Joe & Mac Returns (World, Version 1.1, 1994.05.27) - -static struct BurnRomInfo joemacrRomDesc[] = { - { "05.u29", 0x080000, 0x74e9a158, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "01.u8l", 0x080000, 0x4da4a2c1, 2 | BRF_GRA }, // 1 Characters & Tiles - { "02.u8h", 0x080000, 0x642c08db, 2 | BRF_GRA }, // 2 - - { "mbn01", 0x080000, 0xa3a37353, 3 | BRF_GRA }, // 3 Sprites - { "mbn02", 0x080000, 0xaa2230c5, 3 | BRF_GRA }, // 4 - - { "mbn04", 0x040000, 0xdcbd4771, 4 | BRF_SND }, // 5 OKI SFX Samples - - { "mbn03", 0x200000, 0x70b71a2a, 5 | BRF_SND }, // 6 OKI Music Samples -}; - -STD_ROM_PICK(joemacr) -STD_ROM_FN(joemacr) - -static INT32 joemacrLoadCallback(INT32 *gfxlen0, INT32 *gfxlen1) -{ - if (BurnLoadRom(DrvArmROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 1, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 4, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 6, 1)) return 1; - - *gfxlen0 = 0x100000; - *gfxlen1 = 0x200000; - - return 0; -} - -static INT32 joemacrInit() -{ - return CommonInit(joemacrLoadCallback, joemacr_map, 1, 0x0284); -} - -struct BurnDriver BurnDrvJoemacr = { - "joemacr", NULL, NULL, NULL, "1994", - "Joe & Mac Returns (World, Version 1.1, 1994.05.27)\0", NULL, "Data East", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, joemacrRomInfo, joemacrRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - joemacrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Joe & Mac Returns (World, Version 1.0, 1994.05.19) - -static struct BurnRomInfo joemacraRomDesc[] = { - { "mw00", 0x080000, 0xe1b78f40, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mbn00", 0x100000, 0x11b2dac7, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "mbn01", 0x080000, 0xa3a37353, 3 | BRF_GRA }, // 2 Sprites - { "mbn02", 0x080000, 0xaa2230c5, 3 | BRF_GRA }, // 3 - - { "mbn04", 0x040000, 0xdcbd4771, 4 | BRF_SND }, // 4 OKI SFX Samples - - { "mbn03", 0x200000, 0x70b71a2a, 5 | BRF_SND }, // 5 OKI Music Samples -}; - -STD_ROM_PICK(joemacra) -STD_ROM_FN(joemacra) - -static INT32 joemacraLoadCallback(INT32 *gfxlen0, INT32 *gfxlen1) -{ - if (BurnLoadRom(DrvArmROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 3, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 5, 1)) return 1; - - *gfxlen0 = 0x100000; - *gfxlen1 = 0x200000; - - return 0; -} - -static INT32 joemacraInit() -{ - return CommonInit(joemacraLoadCallback, joemacr_map, 1, 0x0284); -} - -struct BurnDriver BurnDrvJoemacra = { - "joemacra", "joemacr", NULL, NULL, "1994", - "Joe & Mac Returns (World, Version 1.0, 1994.05.19)\0", NULL, "Data East", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, joemacraRomInfo, joemacraRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - joemacraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Joe & Mac Returns (Japan, Version 1.2, 1994.06.06) - -static struct BurnRomInfo joemacrjRomDesc[] = { - { "my00-.e1", 0x080000, 0x2c184981, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mbn00", 0x100000, 0x11b2dac7, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "mbn01", 0x080000, 0xa3a37353, 3 | BRF_GRA }, // 2 Sprites - { "mbn02", 0x080000, 0xaa2230c5, 3 | BRF_GRA }, // 3 - - { "mbn04", 0x040000, 0xdcbd4771, 4 | BRF_SND }, // 4 OKI SFX Samples - - { "mbn03", 0x200000, 0x70b71a2a, 5 | BRF_SND }, // 5 OKI Music Samples - - { "jmrj_ak93c45.h3", 0x000080, 0x31f17522, 6 | BRF_PRG | BRF_ESS }, // 6 Default EEPROM Data -}; - -STD_ROM_PICK(joemacrj) -STD_ROM_FN(joemacrj) - -static INT32 joemacrjLoadCallback(INT32 *gfxlen0, INT32 *gfxlen1) -{ - if (BurnLoadRom(DrvArmROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 3, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvEEPROM + 0x000000, 6, 1)) return 1; - - *gfxlen0 = 0x100000; - *gfxlen1 = 0x200000; - - return 0; -} - -static INT32 joemacrjInit() -{ - return CommonInit(joemacrjLoadCallback, joemacr_map, 1, 0x0284); -} - -struct BurnDriver BurnDrvJoemacrj = { - "joemacrj", "joemacr", NULL, NULL, "1994", - "Joe & Mac Returns (Japan, Version 1.2, 1994.06.06)\0", NULL, "Data East", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, joemacrjRomInfo, joemacrjRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - joemacrjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Chain Reaction (World, Version 2.2, 1995.09.25) - -static struct BurnRomInfo chainrecRomDesc[] = { - { "e1", 0x080000, 0x8a8340ef, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mcc-00", 0x100000, 0x646b03ec, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "u3", 0x080000, 0x92659721, 3 | BRF_GRA }, // 2 Sprites - { "u4", 0x080000, 0xe304eb32, 3 | BRF_GRA }, // 3 - { "u5", 0x080000, 0x1b6f01ea, 3 | BRF_GRA }, // 4 - { "u6", 0x080000, 0x531a56f2, 3 | BRF_GRA }, // 5 - - { "mcc-04", 0x040000, 0x86ee6ade, 4 | BRF_SND }, // 6 OKI SFX Samples - - { "mcc-03", 0x100000, 0xda2ebba0, 5 | BRF_SND }, // 7 OKI Music Samples - - { "eeprom-chainrec.bin", 0x000080, 0xb6da3fbf, 6 | BRF_PRG | BRF_ESS }, // 8 Default EEPROM Data -}; - -STD_ROM_PICK(chainrec) -STD_ROM_FN(chainrec) - -static INT32 chainrecLoadCallback(INT32 *gfxlen0, INT32 *gfxlen1) -{ - if (BurnLoadRom(DrvArmROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000002, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000003, 5, 4)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvEEPROM + 0x000000, 8, 1)) return 1; - - *gfxlen0 = 0x100000; - *gfxlen1 = 0x200000; - - return 0; -} - -static INT32 chainrecInit() -{ - return CommonInit(chainrecLoadCallback, chainrec_map, 1, 0x02d4); -} - -struct BurnDriver BurnDrvChainrec = { - "chainrec", NULL, NULL, NULL, "1995", - "Chain Reaction (World, Version 2.2, 1995.09.25)\0", NULL, "Data East", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PUZZLE, 0, - NULL, chainrecRomInfo, chainrecRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - chainrecInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Magical Drop (Japan, Version 1.1, 1995.06.21) - -static struct BurnRomInfo magdropRomDesc[] = { - { "re00-2.e1", 0x080000, 0x7138f10f, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mcc-00", 0x100000, 0x646b03ec, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "mcc-01.a13", 0x100000, 0x13d88745, 3 | BRF_GRA }, // 2 Sprites - { "mcc-02.a14", 0x100000, 0xd0f97126, 3 | BRF_GRA }, // 3 - - { "mcc-04", 0x040000, 0x86ee6ade, 4 | BRF_SND }, // 4 OKI SFX Samples - - { "mcc-03", 0x100000, 0xda2ebba0, 5 | BRF_SND }, // 5 OKI Music Samples - - { "93c45.2h", 0x000080, 0x16ce8d2d, 6 | BRF_PRG | BRF_ESS }, // 6 Default EEPROM Data -}; - -STD_ROM_PICK(magdrop) -STD_ROM_FN(magdrop) - -static INT32 magdropLoadCallback(INT32 *gfxlen0, INT32 *gfxlen1) -{ - if (BurnLoadRom(DrvArmROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 3, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvEEPROM + 0x000000, 6, 1)) return 1; - - *gfxlen0 = 0x100000; - *gfxlen1 = 0x200000; - - return 0; -} - -static INT32 magdropInit() -{ - return CommonInit(magdropLoadCallback, magdrop_map, 1, 0x02d4); -} - -struct BurnDriver BurnDrvMagdrop = { - "magdrop", "chainrec", NULL, NULL, "1995", - "Magical Drop (Japan, Version 1.1, 1995.06.21)\0", NULL, "Data East", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PUZZLE, 0, - NULL, magdropRomInfo, magdropRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - magdropInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Magical Drop Plus 1 (Japan, Version 2.1, 1995.09.12) - -static struct BurnRomInfo magdroppRomDesc[] = { - { "rz00-1.e1", 0x080000, 0x28caf639, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mcc-00", 0x100000, 0x646b03ec, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "mcc-01.a13", 0x100000, 0x13d88745, 3 | BRF_GRA }, // 2 Sprites - { "mcc-02.a14", 0x100000, 0xd0f97126, 3 | BRF_GRA }, // 3 - - { "mcc-04", 0x040000, 0x86ee6ade, 4 | BRF_SND }, // 4 OKI SFX Samples - - { "mcc-03", 0x100000, 0xda2ebba0, 5 | BRF_SND }, // 5 OKI Music Samples - - { "eeprom.2h", 0x000080, 0xd13d9edd, 6 | BRF_PRG | BRF_ESS }, // 6 Default EEPROM Data -}; - -STD_ROM_PICK(magdropp) -STD_ROM_FN(magdropp) - -static INT32 magdroppInit() -{ - return CommonInit(magdropLoadCallback, magdropp_map, 1, 0x02d4); -} - -struct BurnDriver BurnDrvMagdropp = { - "magdropp", "chainrec", NULL, NULL, "1995", - "Magical Drop Plus 1 (Japan, Version 2.1, 1995.09.12)\0", NULL, "Data East", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PUZZLE, 0, - NULL, magdroppRomInfo, magdroppRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - magdroppInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Charlie Ninja - -static struct BurnRomInfo charlienRomDesc[] = { - { "nd00-1.1e", 0x080000, 0xf18f4b23, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mbr-00.9a", 0x200000, 0xecf2c7f0, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "mbr-01.14a", 0x100000, 0x46c90215, 3 | BRF_GRA }, // 2 Sprites - { "mbr-03.14h", 0x100000, 0xc448a68a, 3 | BRF_GRA }, // 3 - - { "nd01-0.13h", 0x040000, 0x635a100a, 4 | BRF_SND }, // 4 OKI SFX Samples - - { "mbr-02.12f", 0x100000, 0x4f67d333, 5 | BRF_SND }, // 5 OKI Music Samples -}; - -STD_ROM_PICK(charlien) -STD_ROM_FN(charlien) - -static INT32 charlienLoadCallback(INT32 *gfxlen0, INT32 *gfxlen1) -{ - if (BurnLoadRom(DrvArmROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 1, 1)) return 1; - for (INT32 i = 0; i < 0x80000; i++) { - INT32 t = DrvGfxROM0[0x080000 + i]; - DrvGfxROM0[0x080000 + i] = DrvGfxROM0[0x100000 + i]; - DrvGfxROM0[0x100000 + i] = t; - } - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 3, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 5, 1)) return 1; - - *gfxlen0 = 0x200000; - *gfxlen1 = 0x200000; - - return 0; -} - -static INT32 charlienInit() -{ - charlienmode = 1; - return CommonInit(charlienLoadCallback, mitchell_map, 2, 0xc8c8); -} - -struct BurnDriver BurnDrvCharlien = { - "charlien", NULL, NULL, NULL, "1995", - "Charlie Ninja\0", NULL, "Mitchell", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, charlienRomInfo, charlienRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - charlienInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Party Time: Gonta the Diver II / Ganbare! Gonta!! 2 (World Release) - -static struct BurnRomInfo prtytimeRomDesc[] = { - { "pz_00-0.1e", 0x080000, 0xec715c87, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mcb-00.9a", 0x200000, 0xc48a4f2b, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "mcb-02.14a", 0x200000, 0x423cfb38, 3 | BRF_GRA }, // 2 Sprites - { "mcb-05.14h", 0x200000, 0x81540cfb, 3 | BRF_GRA }, // 3 - { "mcb-01.13a", 0x200000, 0x06f40a57, 3 | BRF_GRA }, // 4 - { "mcb-03.14d", 0x200000, 0x0aef73af, 3 | BRF_GRA }, // 5 - - { "pz_01-0.13h", 0x040000, 0x8925bce2, 4 | BRF_SND }, // 6 OKI SFX Samples - - { "mcb-04.12f", 0x200000, 0xe23d3590, 5 | BRF_SND }, // 7 OKI Music Samples - - { "eeprom-prtytime.bin", 0x000080, 0x105700da, 6 | BRF_PRG | BRF_ESS }, // 8 Default EEPROM Data -}; - -STD_ROM_PICK(prtytime) -STD_ROM_FN(prtytime) - -static INT32 prtytimeLoadCallback(INT32 *gfxlen0, INT32 *gfxlen1) -{ - if (BurnLoadRom(DrvArmROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 1, 1)) return 1; - for (INT32 i = 0; i < 0x80000; i++) { - INT32 t = DrvGfxROM0[0x080000 + i]; - DrvGfxROM0[0x080000 + i] = DrvGfxROM0[0x100000 + i]; - DrvGfxROM0[0x100000 + i] = t; - } - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400000, 5, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvEEPROM + 0x000000, 8, 1)) return 1; - - *gfxlen0 = 0x200000; - *gfxlen1 = 0x800000; - - return 0; -} - -static INT32 prtytimeInit() -{ - return CommonInit(prtytimeLoadCallback, mitchell_map, 2, 0x04f0); -} - -struct BurnDriver BurnDrvPrtytime = { - "prtytime", NULL, NULL, NULL, "1995", - "Party Time: Gonta the Diver II / Ganbare! Gonta!! 2 (World Release)\0", NULL, "Mitchell", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, prtytimeRomInfo, prtytimeRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - prtytimeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 320, 3, 4 -}; - - -// Ganbare! Gonta!! 2 / Party Time: Gonta the Diver II (Japan Release) - -static struct BurnRomInfo gangontaRomDesc[] = { - { "rd_00-0.1e", 0x080000, 0xf80f43bb, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mcb-00.9a", 0x200000, 0xc48a4f2b, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "mcb-02.14a", 0x200000, 0x423cfb38, 3 | BRF_GRA }, // 2 Sprites - { "mcb-05.14h", 0x200000, 0x81540cfb, 3 | BRF_GRA }, // 3 - { "mcb-01.13a", 0x200000, 0x06f40a57, 3 | BRF_GRA }, // 4 - { "mcb-03.14d", 0x200000, 0x0aef73af, 3 | BRF_GRA }, // 5 - - { "rd_01-0.13h", 0x040000, 0x70fd18c6, 4 | BRF_SND }, // 6 OKI SFX Samples - - { "mcb-04.12f", 0x200000, 0xe23d3590, 5 | BRF_SND }, // 7 OKI Music Samples - - { "eeprom-gangonta.bin", 0x000080, 0x27ba60a5, 6 | BRF_PRG | BRF_ESS }, // 8 Default EEPROM Data -}; - -STD_ROM_PICK(gangonta) -STD_ROM_FN(gangonta) - -struct BurnDriver BurnDrvGangonta = { - "gangonta", "prtytime", NULL, NULL, "1995", - "Ganbare! Gonta!! 2 / Party Time: Gonta the Diver II (Japan Release)\0", NULL, "Mitchell", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, gangontaRomInfo, gangontaRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - prtytimeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 320, 3, 4 -}; - - -// Osman (World) - -static struct BurnRomInfo osmanRomDesc[] = { - { "sa00-0.1e", 0x080000, 0xec6b3257, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mcf-00.9a", 0x200000, 0x247712dc, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "mcf-02.14a", 0x200000, 0x21251b33, 3 | BRF_GRA }, // 2 Sprites - { "mcf-04.14h", 0x200000, 0x4fa55577, 3 | BRF_GRA }, // 3 - { "mcf-01.13a", 0x200000, 0x83881e25, 3 | BRF_GRA }, // 4 - { "mcf-03.14d", 0x200000, 0xfaf1d51d, 3 | BRF_GRA }, // 5 - - { "sa01-0.13h", 0x040000, 0xcea8368e, 4 | BRF_SND }, // 6 OKI SFX Samples - - { "mcf-05.12f", 0x200000, 0xf007d376, 5 | BRF_SND }, // 7 OKI Music Samples - - { "eeprom-osman.bin", 0x000080, 0x509552b2, 6 | BRF_PRG | BRF_ESS }, // 8 Default EEPROM Data -}; - -STD_ROM_PICK(osman) -STD_ROM_FN(osman) - -static INT32 osmanInit() -{ - return CommonInit(prtytimeLoadCallback, mitchell_map, 2, 0x5974); -} - -struct BurnDriver BurnDrvOsman = { - "osman", NULL, NULL, NULL, "1996", - "Osman (World)\0", NULL, "Mitchell", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, osmanRomInfo, osmanRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - osmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Cannon Dancer (Japan) - -static struct BurnRomInfo candanceRomDesc[] = { - { "sa00-0.1e", 0x080000, 0xec6b3257, 1 | BRF_PRG | BRF_ESS }, // 0 ARM Code - - { "mcf-00.9a", 0x200000, 0x247712dc, 2 | BRF_GRA }, // 1 Characters & Tiles - - { "mcf-02.14a", 0x200000, 0x21251b33, 3 | BRF_GRA }, // 2 Sprites - { "mcf-04.14h", 0x200000, 0x4fa55577, 3 | BRF_GRA }, // 3 - { "mcf-01.13a", 0x200000, 0x83881e25, 3 | BRF_GRA }, // 4 - { "mcf-03.14d", 0x200000, 0xfaf1d51d, 3 | BRF_GRA }, // 5 - - { "sa01-0.13h", 0x040000, 0xcea8368e, 4 | BRF_SND }, // 6 OKI SFX Samples - - { "mcf-05.12f", 0x200000, 0xf007d376, 5 | BRF_SND }, // 7 OKI Music Samples - - { "eeprom-candance.bin", 0x000080, 0x0a0a8f6b, 6 | BRF_PRG | BRF_ESS }, // 8 Default EEPROM Data -}; - -STD_ROM_PICK(candance) -STD_ROM_FN(candance) - -struct BurnDriver BurnDrvCandance = { - "candance", "osman", NULL, NULL, "1996", - "Cannon Dancer (Japan)\0", NULL, "Mitchell (Atlus license)", "Simple 156", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, candanceRomInfo, candanceRomName, NULL, NULL, Simpl156InputInfo, Simpl156DIPInfo, - osmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_supbtime.cpp b/jan/src/burn/drv/dataeast/d_supbtime.cpp deleted file mode 100644 index 6085385ba..000000000 --- a/jan/src/burn/drv/dataeast/d_supbtime.cpp +++ /dev/null @@ -1,689 +0,0 @@ -// FB Alpha Super Burger Time / China Town driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "deco16ic.h" -#include "h6280_intf.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvHucRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo SupbtimeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Supbtime) - -static struct BurnDIPInfo SupbtimeDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x1c, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0xe0, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0x80, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" }, - {0x11, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x02, 0x00, "No" }, - {0x12, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x10, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 3, "Lives" }, - {0x12, 0x01, 0xc0, 0x80, "1" }, - {0x12, 0x01, 0xc0, 0x00, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, -}; - -STDDIPINFO(Supbtime) - -static struct BurnDIPInfo ChinatwnDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x1c, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0xe0, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0x80, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" }, - {0x11, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x10, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x12, 0x01, 0xc0, 0x00, "1500" }, - {0x12, 0x01, 0xc0, 0x80, "2000" }, - {0x12, 0x01, 0xc0, 0xc0, "2500" }, - {0x12, 0x01, 0xc0, 0x40, "3000" }, -}; - -STDDIPINFO(Chinatwn) - -void __fastcall supbtime_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x300000, data) - - switch (address) - { - case 0x100000: - case 0x1a0000: - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -void __fastcall supbtime_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x100001: - case 0x1a0001: - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -UINT16 __fastcall supbtime_main_read_word(UINT32 address) -{ - deco16_read_control_word(0, address, 0x300000) - - switch (address) - { - case 0x180000: - return DrvInputs[0]; - - case 0x180002: - return (DrvDips[1] << 8) | (DrvDips[0] << 0); - - case 0x180008: - return (DrvInputs[1] & ~0x0008) | (deco16_vblank & 0x0008); - - case 0x18000a: - case 0x18000c: - return 0; - } - - return 0; -} - -UINT8 __fastcall supbtime_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x180000: - case 0x180001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x180002: - return DrvDips[0]; - - case 0x180003: - return DrvDips[1]; - - case 0x180008: - case 0x180009: - return (DrvInputs[1] & ~0x0008) | (deco16_vblank & 0x0008); - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - deco16SoundReset(); - - deco16Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvHucRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 game) -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 5, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 6, 1)) return 1; - - deco16_tile_decode(DrvGfxROM1, DrvGfxROM0, 0x080000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x080000, 0); - deco16_sprite_decode(DrvGfxROM2, 0x100000); - } - - deco16Init(1, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x80000 * 2, DrvGfxROM1, 0x80000 * 2, NULL, 0); - deco16_set_color_base(0, 256); - deco16_set_color_base(1, 512); - deco16_set_global_offsets(0, 8); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - if (game) { - SekMapMemory(Drv68KRAM, 0x100000, 0x103fff, MAP_RAM); // super burger time - } else { - SekMapMemory(Drv68KRAM, 0x1a0000, 0x1a3fff, MAP_RAM); // china town - } - SekMapMemory(DrvSprRAM, 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x320000, 0x321fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x322000, 0x323fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x340000, 0x340bff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x342000, 0x342bff, MAP_RAM); - SekSetWriteWordHandler(0, supbtime_main_write_word); - SekSetWriteByteHandler(0, supbtime_main_write_byte); - SekSetReadWordHandler(0, supbtime_main_read_word); - SekSetReadByteHandler(0, supbtime_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 4027500, 0, NULL, 0.45, 1023924, 0.50, 0, 0); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - SekExit(); - - deco16SoundExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x800 / 2; i++) { - INT32 b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 8) & 0x0f; //Seb - INT32 g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 4) & 0x0f; //Seb - INT32 r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x0f; //Seb - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 inc, mult; - - INT32 sy = BURN_ENDIAN_SWAP_INT16(ram[offs + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs + 1]) & 0x3fff; - INT32 sx = BURN_ENDIAN_SWAP_INT16(ram[offs + 2]); - - if ((sy & 0x1000) && (nCurrentFrame & 1)) continue; - - INT32 color = (sx >> 9) & 0x1f; - - INT32 flipx = sy & 0x2000; - INT32 flipy = sy & 0x4000; - INT32 multi = (1 << ((sy & 0x0600) >> 9)) - 1; - - sx &= 0x01ff; - sy &= 0x01ff; - if (sx >= 320) sx -= 512; - if (sy >= 256) sy -= 512; - sy = 240 - sy; - sx = 304 - sx; - - code &= ~multi; - - if (flipy) { - inc = -1; - } else { - code += multi; - inc = 1; - } - - if (*flipscreen) - { - sy = 240 - sy; - sx = 304 - sx; - flipx = !flipx; - flipy = !flipy; - mult = 16; - } - else - mult = -16; - - if (sx >= 320 || sx < -15) continue; - - while (multi >= 0) - { - INT32 y = (sy + mult * multi) - 8; - INT32 c = (code - multi * inc) & 0x3fff; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } - } - - multi--; - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - DrvPaletteRecalc(); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x300; - } - - if (nBurnLayer & 1) deco16_draw_layer(1, pTransDraw, 0x10000 /*opaque*/); - - if (nBurnLayer & 2) draw_sprites(); - - if (nBurnLayer & 4) deco16_draw_layer(0, pTransDraw, 0x00000 /*transparent*/); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 232; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14000000 / 58, 4027500 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += h6280Run(nCyclesTotal[1] / nInterleave); - - if (i == 206) deco16_vblank = 0x08; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - } - - return 0; -} - - - -// Super Burger Time (World, set 1) - -static struct BurnRomInfo supbtimeRomDesc[] = { - { "gk03", 0x20000, 0xaeaeed61, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gk04", 0x20000, 0x2bc5a4eb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gc06.bin", 0x10000, 0xe0e6c0f4, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "mae02.bin", 0x80000, 0xa715cca0, 3 | BRF_GRA }, // 3 Characters and Background Tiles - - { "mae00.bin", 0x80000, 0x30043094, 4 | BRF_GRA }, // 4 Sprites - { "mae01.bin", 0x80000, 0x434af3fb, 4 | BRF_GRA }, // 5 - - { "gc05.bin", 0x20000, 0x2f2246ff, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(supbtime) -STD_ROM_FN(supbtime) - -static INT32 supbtimeInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvSupbtime = { - "supbtime", NULL, NULL, NULL, "1990", - "Super Burger Time (World, set 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, supbtimeRomInfo, supbtimeRomName, NULL, NULL, SupbtimeInputInfo, SupbtimeDIPInfo, - supbtimeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Super Burger Time (World, set 2) - -static struct BurnRomInfo supbtimeaRomDesc[] = { - { "3.11f", 0x20000, 0x98b5f263, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "4.12f", 0x20000, 0x937e68b9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gc06.bin", 0x10000, 0xe0e6c0f4, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "mae02.bin", 0x80000, 0xa715cca0, 3 | BRF_GRA }, // 3 Characters and Background Tiles - - { "mae00.bin", 0x80000, 0x30043094, 4 | BRF_GRA }, // 4 Sprites - { "mae01.bin", 0x80000, 0x434af3fb, 4 | BRF_GRA }, // 5 - - { "gc05.bin", 0x20000, 0x2f2246ff, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(supbtimea) -STD_ROM_FN(supbtimea) - -struct BurnDriver BurnDrvSupbtimea = { - "supbtimea", "supbtime", NULL, NULL, "1990", - "Super Burger Time (World, set 2)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, supbtimeaRomInfo, supbtimeaRomName, NULL, NULL, SupbtimeInputInfo, SupbtimeDIPInfo, - supbtimeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Super Burger Time (Japan) - -static struct BurnRomInfo supbtimejRomDesc[] = { - { "gc03.bin", 0x20000, 0xb5621f6a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gc04.bin", 0x20000, 0x551b2a0c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gc06.bin", 0x10000, 0xe0e6c0f4, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "mae02.bin", 0x80000, 0xa715cca0, 3 | BRF_GRA }, // 3 Characters and Background Tiles - - { "mae00.bin", 0x80000, 0x30043094, 4 | BRF_GRA }, // 4 Sprites - { "mae01.bin", 0x80000, 0x434af3fb, 4 | BRF_GRA }, // 5 - - { "gc05.bin", 0x20000, 0x2f2246ff, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(supbtimej) -STD_ROM_FN(supbtimej) - -struct BurnDriver BurnDrvSupbtimej = { - "supbtimej", "supbtime", NULL, NULL, "1990", - "Super Burger Time (Japan)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, supbtimejRomInfo, supbtimejRomName, NULL, NULL, SupbtimeInputInfo, SupbtimeDIPInfo, - supbtimeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// China Town (Japan) - -static struct BurnRomInfo chinatwnRomDesc[] = { - { "gv_00-.f11", 0x20000, 0x2ea7ea5d, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "gv_01-.f13", 0x20000, 0xbcab03c7, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gv_02-.f16", 0x10000, 0x95151d84, 2 | BRF_PRG | BRF_ESS }, // 2 audiocpu - - { "mak-02.h2", 0x80000, 0x745b2c50, 3 | BRF_GRA }, // 3 gfx1 - - { "mak-00.a2", 0x80000, 0x18e8cc1b, 4 | BRF_GRA }, // 4 gfx2 - { "mak-01.a4", 0x80000, 0xd88ebda8, 4 | BRF_GRA }, // 5 - - { "gv_03-.j14", 0x20000, 0x948faf92, 5 | BRF_SND }, // 6 oki -}; - -STD_ROM_PICK(chinatwn) -STD_ROM_FN(chinatwn) - -static INT32 chinatwnInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvChinatwn = { - "chinatwn", NULL, NULL, NULL, "1991", - "China Town (Japan)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PUZZLE, 0, - NULL, chinatwnRomInfo, chinatwnRomName, NULL, NULL, SupbtimeInputInfo, ChinatwnDIPInfo, - chinatwnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/dataeast/d_tumblep.cpp b/jan/src/burn/drv/dataeast/d_tumblep.cpp deleted file mode 100644 index 6842081e6..000000000 --- a/jan/src/burn/drv/dataeast/d_tumblep.cpp +++ /dev/null @@ -1,578 +0,0 @@ -// FB Alpha Tumble Pop driver module -// Based on MAME driver by Bryan McPhail and David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "h6280_intf.h" -#include "deco16ic.h" -#include "msm6295.h" -#include "burn_ym2151.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvHucRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo TumblepInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tumblep) - -static struct BurnDIPInfo TumblepDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x1c, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0xe0, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x02, 0x00, "No" }, - {0x13, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x10, "Easy" }, - {0x13, 0x01, 0x30, 0x30, "Normal" }, - {0x13, 0x01, 0x30, 0x20, "Hard" }, - {0x13, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0xc0, 0x80, "1" }, - {0x13, 0x01, 0xc0, 0x00, "2" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x40, "4" }, -}; - -STDDIPINFO(Tumblep) - -void __fastcall tumblep_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(0, address, 0x300000, data) - - switch (address) - { - case 0x100000: - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -void __fastcall tumblep_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x100000: - case 0x100001: - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -UINT16 __fastcall tumblep_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x180000: - return DrvInputs[0]; - - case 0x180002: - return (DrvDips[1] << 8) | (DrvDips[0] << 0); - - case 0x180008: - return (DrvInputs[1] & ~0x0008) | (deco16_vblank & 0x0008); - } - - return 0; -} - -UINT8 __fastcall tumblep_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x180000: - case 0x180001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x180002: - return DrvDips[0]; - - case 0x180003: - return DrvDips[1]; - - case 0x180008: - case 0x180009: - return (DrvInputs[1] & ~0x0008) | (deco16_vblank & 0x0008); - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - deco16SoundReset(); - - deco16Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvHucRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvHucROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 5, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 6, 1)) return 1; - - deco56_decrypt_gfx(DrvGfxROM1, 0x080000); - - deco16_tile_decode(DrvGfxROM1, DrvGfxROM0, 0x080000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x080000, 0); - deco16_sprite_decode(DrvGfxROM2, 0x100000); - } - - deco16Init(1, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x80000 * 2, DrvGfxROM1, 0x80000 * 2, NULL, 0); - deco16_set_color_base(0, 256); - deco16_set_color_base(1, 512); - deco16_set_global_offsets(0, 8); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x120000, 0x123fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x1a0000, 0x1a07ff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x320000, 0x321fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x322000, 0x323fff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[0], 0x340000, 0x340bff, MAP_RAM); - SekMapMemory(deco16_pf_rowscroll[1], 0x342000, 0x342bff, MAP_RAM); - SekSetWriteWordHandler(0, tumblep_main_write_word); - SekSetWriteByteHandler(0, tumblep_main_write_byte); - SekSetReadWordHandler(0, tumblep_main_read_word); - SekSetReadByteHandler(0, tumblep_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 4027500, 0, NULL, 0.45, 1023924, 0.50, 0, 0); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - - deco16SoundExit(); - - SekExit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x800 / 2; i++) { - INT32 b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 8) & 0x0f; - INT32 g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 4) & 0x0f; - INT32 r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 inc, mult; - - INT32 sy = BURN_ENDIAN_SWAP_INT16(ram[offs + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs + 1]) & 0x3fff; - INT32 sx = BURN_ENDIAN_SWAP_INT16(ram[offs + 2]); - - if ((sy & 0x1000) && (nCurrentFrame & 1)) continue; - - INT32 color = (sx >> 9) & 0x1f; - - INT32 flipx = sy & 0x2000; - INT32 flipy = sy & 0x4000; - INT32 multi = (1 << ((sy & 0x0600) >> 9)) - 1; - - sx &= 0x01ff; - sy &= 0x01ff; - if (sx >= 320) sx -= 512; - if (sy >= 256) sy -= 512; - sy = 240 - sy; - sx = 304 - sx; - - code &= ~multi; - - if (flipy) { - inc = -1; - } else { - code += multi; - inc = 1; - } - - if (*flipscreen) - { - sy = 240 - sy; - sx = 304 - sx; - flipx = !flipx; - flipy = !flipy; - mult = 16; - } - else - mult = -16; - - if (sx >= 320 || sx < -15) continue; - - while (multi >= 0) - { - INT32 y = (sy + mult * multi) - 8; - INT32 c = (code - multi * inc) & 0x3fff; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, c, sx, y, color, 4, 0, 0, DrvGfxROM2); - } - } - - multi--; - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - DrvPaletteRecalc(); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x100; - } - - if (nBurnLayer & 1) deco16_draw_layer(1, pTransDraw, DECO16_LAYER_OPAQUE); - - if (nBurnLayer & 2) deco16_draw_layer(0, pTransDraw, 0); - - if (nBurnLayer & 4) draw_sprites(); - - // hack! fix ugly line and keep proper aspect ratio. - { - UINT16 *dst = pTransDraw + (nScreenWidth - 2); - for (INT32 y = 0; y < nScreenHeight; y++) { - dst[1] = dst[0]; - dst += nScreenWidth; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 232; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14000000 / 58, 4027500 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += h6280Run(nCyclesTotal[1] / nInterleave); - - if (i == 206) deco16_vblank = 0x08; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - } - - return 0; -} - - -// Tumble Pop (World) - -static struct BurnRomInfo tumblepRomDesc[] = { - { "hl00-1.f12", 0x40000, 0xfd697c1b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hl01-1.f13", 0x40000, 0xd5a62a3f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "hl02-.f16", 0x10000, 0xa5cab888, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "map-02.rom", 0x80000, 0xdfceaa26, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "map-01.rom", 0x80000, 0xe81ffa09, 4 | BRF_GRA }, // 4 Sprites - { "map-00.rom", 0x80000, 0x8c879cfe, 4 | BRF_GRA }, // 5 - - { "hl03-.j15", 0x20000, 0x01b81da0, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(tumblep) -STD_ROM_FN(tumblep) - -struct BurnDriver BurnDrvTumblep = { - "tumblep", NULL, NULL, NULL, "1991", - "Tumble Pop (World)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, tumblepRomInfo, tumblepRomName, NULL, NULL, TumblepInputInfo, TumblepDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Tumble Pop (Japan) - -static struct BurnRomInfo tumblepjRomDesc[] = { - { "hk00-1.f12", 0x40000, 0x2d3e4d3d, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hk01-1.f13", 0x40000, 0x56912a00, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "hl02-.f16", 0x10000, 0xa5cab888, 2 | BRF_PRG | BRF_ESS }, // 2 Huc6280 Code - - { "map-02.rom", 0x80000, 0xdfceaa26, 3 | BRF_GRA }, // 3 Characters & Background Tiles - - { "map-01.rom", 0x80000, 0xe81ffa09, 4 | BRF_GRA }, // 4 Sprites - { "map-00.rom", 0x80000, 0x8c879cfe, 4 | BRF_GRA }, // 5 - - { "hl03-.j15", 0x20000, 0x01b81da0, 5 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(tumblepj) -STD_ROM_FN(tumblepj) - -struct BurnDriver BurnDrvTumblepj = { - "tumblepj", "tumblep", NULL, NULL, "1991", - "Tumble Pop (Japan)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_DATAEAST, GBF_PLATFORM, 0, - NULL, tumblepjRomInfo, tumblepjRomName, NULL, NULL, TumblepInputInfo, TumblepDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - diff --git a/jan/src/burn/drv/dataeast/d_vaportra.cpp b/jan/src/burn/drv/dataeast/d_vaportra.cpp deleted file mode 100644 index 7c00fb565..000000000 --- a/jan/src/burn/drv/dataeast/d_vaportra.cpp +++ /dev/null @@ -1,834 +0,0 @@ -// FB Alpha Vapor Trail driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "h6280_intf.h" -#include "deco16ic.h" -#include "burn_ym2203.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvHucROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvHucRAM; -static UINT8 *DrvPalRAM0; -static UINT8 *DrvPalRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *SoundBuffer; - -static UINT8 *flipscreen; -static UINT16 *priority; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo VaportraInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Vaportra) - -static struct BurnDIPInfo VaportraDIPList[]= -{ - {0x11, 0xff, 0xff, 0x7f, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x00, "2" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x0c, 0x08, "Easy" }, - {0x11, 0x01, 0x0c, 0x0c, "Normal" }, - {0x11, 0x01, 0x0c, 0x04, "Hard" }, - {0x11, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x30, 0x20, "150k, 300k and 600k" }, - {0x11, 0x01, 0x30, 0x30, "200k and 600k" }, - {0x11, 0x01, 0x30, 0x10, "300k only" }, - {0x11, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x40, 0x00, "No" }, - {0x11, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Vaportra) - -void __fastcall vaportra_main_write_word(UINT32 address, UINT16 data) -{ - deco16_write_control_word(1, address, 0x240000, data) - deco16_write_control_word(0, address, 0x2c0000, data) - - if ((address & ~0xce0000) >= 0x318000 && (address & ~0xce0000) <= 0x3187ff) - { - *((UINT16*)(DrvSprRAM + (address & 0x7fe))) = data; - return; - } - - switch (address) - { - case 0x100000: - case 0x100002: - priority[(address & 2)/2] = data; - return; - - case 0x100006: - deco16_soundlatch = data & 0xff; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x30c000: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - } -} - -void __fastcall vaportra_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & ~0xce0000) >= 0x318000 && (address & ~0xce0000) <= 0x3187ff) - { - DrvSprRAM[(address & 0x7ff) ^ 1] = data; - return; - } - - switch (address) - { - case 0x100000: - case 0x100001: - case 0x100002: - case 0x100003: - priority[(address & 2)/2] = data; - return; - - case 0x100007: - deco16_soundlatch = data; - h6280SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x30c000: - case 0x30c001: - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - return; - } -} - -UINT16 __fastcall vaportra_main_read_word(UINT32 address) -{ - if ((address & ~0xce0000) >= 0x318000 && (address & ~0xce0000) <= 0x3187ff) - { - return *((UINT16*)(DrvSprRAM + (address & 0x7fe))); - } - - switch (address) - { - case 0x100000: - return DrvInputs[0]; - - case 0x100002: - return (DrvInputs[1] & 0xfff7) | (deco16_vblank & 0x08); - - case 0x100004: - return (DrvDips[1] << 8) | (DrvDips[0] << 0); - - case 0x100006: - case 0x100008: - case 0x10000a: - case 0x10000c: - case 0x10000e: - return 0xffff; - } - - return 0; -} - -UINT8 __fastcall vaportra_main_read_byte(UINT32 address) -{ - if ((address & ~0xce0000) >= 0x318000 && (address & ~0xce0000) <= 0x3187ff) - { - return DrvSprRAM[(address & 0x7ff) ^ 1]; - } - - switch (address) - { - case 0x100000: - return DrvInputs[0] >> 8; - - case 0x100001: - return DrvInputs[0] >> 0; - - case 0x100002: - case 0x100003: - return (DrvInputs[1] & 0xf7) | (deco16_vblank & 0x08); - - case 0x100004: - return DrvDips[1]; - - case 0x100005: - return DrvDips[0]; - - case 0x100006: - case 0x100007: - case 0x100008: - case 0x100009: - case 0x10000a: - case 0x10000b: - case 0x10000c: - case 0x10000d: - case 0x10000e: - case 0x10000f: - return 0xff; - } - - return 0; -} - -static INT32 vaportra_bank_callback( const INT32 bank ) -{ - return ((bank >> 4) & 0x7) * 0x1000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - deco16SoundReset(); - - deco16Reset(); - deco16_y_skew = 8; // HACK! the background is skewed by 8, causing sprite:layer misalignment (spider mini-boss/level 2, etc.) - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvHucROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x200000; - DrvGfxROM3 = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0500 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvHucRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x000800; - DrvSprBuf = Next; Next += 0x000800; - DrvPalRAM0 = Next; Next += 0x000a00; - DrvPalRAM1 = Next; Next += 0x000a00; - - flipscreen = Next; Next += 0x000001; - priority = (UINT16*)Next; Next += 0x000002 * sizeof(UINT16); - - RamEnd = Next; - - SoundBuffer = (INT16*)Next; Next += nBurnSoundLen * 2 * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void VaportraDecode() -{ - for (INT32 i = 0x00000; i < 0x80000; i++) - Drv68KROM[i] = (Drv68KROM[i] & 0x7e) | ((Drv68KROM[i] & 0x01) << 7) | ((Drv68KROM[i] & 0x80) >> 7); -} - -static INT32 DrvInit(INT32 type) -{ - BurnSetRefreshRate(58.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - VaportraDecode(); - - if (BurnLoadRom(DrvHucROM + 0x000000, 4, 1)) return 1; - - if (type) // world revision 3 - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040001, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x080000, 12, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 14, 1)) return 1; - } else { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x080000, 9, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 11, 1)) return 1; - } - - memcpy (DrvGfxROM1 + 0x040000, DrvGfxROM0 + 0x000000, 0x040000); - memcpy (DrvGfxROM1 + 0x000000, DrvGfxROM0 + 0x040000, 0x040000); - - deco16_tile_decode(DrvGfxROM1, DrvGfxROM0, 0x080000, 1); - deco16_tile_decode(DrvGfxROM1, DrvGfxROM1, 0x080000, 0); - deco16_tile_decode(DrvGfxROM2, DrvGfxROM2, 0x100000, 0); - deco16_tile_decode(DrvGfxROM3, DrvGfxROM3, 0x100000, 0); - } - - deco16Init(0, 0, 1); - deco16_set_graphics(DrvGfxROM0, 0x100000, DrvGfxROM1, 0x100000, DrvGfxROM2, 0x200000); - deco16_set_color_base(0, 0x000); - deco16_set_color_base(1, 0x200); - deco16_set_color_base(2, 0x300); - deco16_set_color_base(3, 0x400); - deco16_set_bank_callback(0, vaportra_bank_callback); - deco16_set_bank_callback(1, vaportra_bank_callback); - deco16_set_bank_callback(2, vaportra_bank_callback); - deco16_set_bank_callback(3, vaportra_bank_callback); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(deco16_pf_ram[2], 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[3], 0x202000, 0x203fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[0], 0x280000, 0x281fff, MAP_RAM); - SekMapMemory(deco16_pf_ram[1], 0x282000, 0x283fff, MAP_RAM); - SekMapMemory(DrvPalRAM0, 0x300000, 0x3009ff, MAP_RAM); - SekMapMemory(DrvPalRAM1, 0x304000, 0x3049ff, MAP_RAM); - //SekMapMemory(DrvSprRAM, 0xff8000, 0xff87ff, MAP_RAM); // in handler w/mirroring (fixes gameover animation) - SekMapMemory(Drv68KRAM, 0xffc000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, vaportra_main_write_word); - SekSetWriteByteHandler(0, vaportra_main_write_byte); - SekSetReadWordHandler(0, vaportra_main_read_word); - SekSetReadByteHandler(0, vaportra_main_read_byte); - SekClose(); - - deco16SoundInit(DrvHucROM, DrvHucRAM, 8055000, 1, NULL, 0.60, 1006875, 0.75, 2013750, 0.60); - BurnYM2203SetAllRoutes(0, 0.60, BURN_SND_ROUTE_BOTH); - - deco16_music_tempofix = 1; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - deco16Exit(); - deco16_y_skew = 0; - - SekExit(); - - deco16SoundExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *p0 = (UINT16*)DrvPalRAM0; - UINT16 *p1 = (UINT16*)DrvPalRAM1; - - for (INT32 i = 0; i < 0xa00 / 2; i++) { - DrvPalette[i] = BurnHighCol(BURN_ENDIAN_SWAP_INT16(p0[i]) & 0xff, BURN_ENDIAN_SWAP_INT16(p0[i]) >> 8, BURN_ENDIAN_SWAP_INT16(p1[i])& 0xff, 0); - } -} - -static void draw_sprites(INT32 pri) -{ - UINT16 *buffered_spriteram = (UINT16*)DrvSprBuf; - - INT32 priority_value = priority[1]; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 inc, mult; - - INT32 y = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs + 0]); - if ((y & 0x8000) == 0) continue; - - INT32 sprite = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs + 1]) & 0x1fff; - - INT32 x = BURN_ENDIAN_SWAP_INT16(buffered_spriteram[offs + 2]); - - INT32 colour = (x >> 12) & 0xf; - - if ( pri && (colour >= priority_value)) continue; - if (!pri && !(colour >= priority_value)) continue; - - if ((x & 0x0800) && (nCurrentFrame & 1)) continue; // flash - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi = (1 << ((y & 0x1800) >> 11)) - 1; - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 256) x -= 512; - if (y >= 256) y -= 512; - x = 240 - x; - y = 240 - y; - - if (x > 256) continue; - - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (*flipscreen) - { - y = 240 - y; - x = 240 - x; - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - mult = 16; - } - else mult = -16; - - while (multi >= 0) - { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sprite - multi * inc, x, (y + mult * multi) - 8, colour, 4, 0, 0x100, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sprite - multi * inc, x, (y + mult * multi) - 8, colour, 4, 0, 0x100, DrvGfxROM3); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sprite - multi * inc, x, (y + mult * multi) - 8, colour, 4, 0, 0x100, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sprite - multi * inc, x, (y + mult * multi) - 8, colour, 4, 0, 0x100, DrvGfxROM3); - } - } - - multi--; - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - DrvPaletteRecalc(); - DrvRecalc = 0; -// } - - deco16_pf12_update(); - deco16_pf34_update(); - - INT32 layer_prio = priority[0] & 0x03; - INT32 layer_order[4][4] = { { 3, 2, 1, 0 }, { 2, 3, 1, 0 }, { 3, 1, 2, 0 }, { 2, 1, 3, 0 } }; - - deco16_draw_layer(layer_order[layer_prio][0], pTransDraw, DECO16_LAYER_OPAQUE); - deco16_draw_layer(layer_order[layer_prio][1], pTransDraw, 0); - draw_sprites(0); - deco16_draw_layer(layer_order[layer_prio][2], pTransDraw, 0); - draw_sprites(1); - deco16_draw_layer(layer_order[layer_prio][3], pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 232; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 58, 8055000 / 58 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - h6280NewFrame(); - - SekOpen(0); - h6280Open(0); - - deco16_vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - BurnTimerUpdate((i + 1) * nCyclesTotal[1] / nInterleave); - - if (i == 206) { - deco16_vblank = 0x08; - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - deco16SoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = SoundBuffer + (nSoundBufferPos << 1); - - if (nSegmentLength) { - deco16SoundUpdate(pSoundBuf, nSegmentLength); - } - - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[(i << 1) + 0] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 0] + SoundBuffer[(i << 1) + 0]); - pBurnSoundOut[(i << 1) + 1] = BURN_SND_CLIP(pBurnSoundOut[(i << 1) + 1] + SoundBuffer[(i << 1) + 1]); - } - } - - h6280Close(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029722; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - deco16SoundScan(nAction, pnMin); - - deco16Scan(); - } - - return 0; -} - - -// Vapor Trail - Hyper Offence Formation (World revision 1) - -static struct BurnRomInfo vaportraRomDesc[] = { - { "fl_02-1.bin", 0x20000, 0x9ae36095, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fl_00-1.bin", 0x20000, 0xc08cc048, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fl_03.bin", 0x20000, 0x80bd2844, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fl_01.bin", 0x20000, 0x9474b085, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fj04", 0x10000, 0xe9aedf9b, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "vtmaa00.bin", 0x80000, 0x0330e13b, 3 | BRF_GRA }, // 5 Characters and Foreground Tiles - - { "vtmaa01.bin", 0x80000, 0xc217a31b, 4 | BRF_GRA }, // 7 - { "vtmaa02.bin", 0x80000, 0x091ff98e, 4 | BRF_GRA }, // 6 Background Tiles - - { "vtmaa04.bin", 0x80000, 0xb713e9cc, 5 | BRF_GRA }, // 9 - { "vtmaa03.bin", 0x80000, 0x1a30bf81, 5 | BRF_GRA }, // 8 Sprites - - { "fj06", 0x20000, 0x6e98a235, 6 | BRF_SND }, // 10 OKI M6295 Samples 0 - - { "fj05", 0x20000, 0x39cda2b5, 7 | BRF_SND }, // 11 OKI M6295 Samples 1 - - { "fj-27.bin", 0x00200, 0x65045742, 8 | BRF_OPT }, // 12 Unknown PROMs - - { "pal16l8a.6l", 0x00104, 0xee748e8f, 9 | BRF_OPT }, // 13 PLDs - { "pal16l8b.13g", 0x00104, 0x6da13bda, 9 | BRF_OPT }, // 14 - { "pal16l8b.13h", 0x00104, 0x62a9e098, 9 | BRF_OPT }, // 15 - { "pal16l8b.14g", 0x00104, 0x036768aa, 9 | BRF_OPT }, // 16 - { "pal16l8b.14h", 0x00104, 0xbf421fce, 9 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(vaportra) -STD_ROM_FN(vaportra) - -static INT32 VaportraInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvVaportra = { - "vaportra", NULL, NULL, NULL, "1989", - "Vapor Trail - Hyper Offence Formation (World revision 1)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, vaportraRomInfo, vaportraRomName, NULL, NULL, VaportraInputInfo, VaportraDIPInfo, - VaportraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x500, - 240, 256, 3, 4 -}; - - -// Vapor Trail - Hyper Offence Formation (World revision 3) - -static struct BurnRomInfo vaportraw3RomDesc[] = { - { "fl02-3.bin", 0x20000, 0x6c59be54, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fl00-3.bin", 0x20000, 0x69f8bef4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fl_03.bin", 0x20000, 0x80bd2844, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fl_01.bin", 0x20000, 0x9474b085, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fj04", 0x10000, 0xe9aedf9b, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "fl23", 0x20000, 0x6089f9e7, 3 | BRF_GRA }, // 5 Characters and Foreground Tiles - { "fl25", 0x20000, 0x3989290a, 3 | BRF_GRA }, // 6 - { "fl24", 0x20000, 0x41551bfa, 3 | BRF_GRA }, // 7 - { "fl26", 0x20000, 0xdc67fa5c, 3 | BRF_GRA }, // 8 - - { "vtmaa01.bin", 0x80000, 0xc217a31b, 4 | BRF_GRA }, // 9 Background Tiles - { "vtmaa02.bin", 0x80000, 0x091ff98e, 4 | BRF_GRA }, // 10 - - { "vtmaa04.bin", 0x80000, 0xb713e9cc, 5 | BRF_GRA }, // 11 Sprites - { "vtmaa03.bin", 0x80000, 0x1a30bf81, 5 | BRF_GRA }, // 12 - - { "fj06", 0x20000, 0x6e98a235, 6 | BRF_SND }, // 13 OKI M6295 Samples 0 - - { "fj05", 0x20000, 0x39cda2b5, 7 | BRF_SND }, // 14 OKI M6295 Samples 1 - - { "fj-27.bin", 0x00200, 0x65045742, 8 | BRF_OPT }, // 15 Unknown PROMs - - { "pal16l8a.6l", 0x00104, 0xee748e8f, 9 | BRF_OPT }, // 13 PLDs - { "pal16l8b.13g", 0x00104, 0x6da13bda, 9 | BRF_OPT }, // 14 - { "pal16l8b.13h", 0x00104, 0x62a9e098, 9 | BRF_OPT }, // 15 - { "pal16l8b.14g", 0x00104, 0x036768aa, 9 | BRF_OPT }, // 16 - { "pal16l8b.14h", 0x00104, 0xbf421fce, 9 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(vaportraw3) -STD_ROM_FN(vaportraw3) - -static INT32 Vaportraw3Init() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvVaportraw3 = { - "vaportra3", "vaportra", NULL, NULL, "1989", - "Vapor Trail - Hyper Offence Formation (World revision 3)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, vaportraw3RomInfo, vaportraw3RomName, NULL, NULL, VaportraInputInfo, VaportraDIPInfo, - Vaportraw3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x500, - 240, 256, 3, 4 -}; - - -// Vapor Trail - Hyper Offence Formation (US) - -static struct BurnRomInfo vaportrauRomDesc[] = { - { "fj02", 0x20000, 0xa2affb73, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fj00", 0x20000, 0xef05e07b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fj03", 0x20000, 0x44893379, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fj01", 0x20000, 0x97fbc107, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fj04", 0x10000, 0xe9aedf9b, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "vtmaa00.bin", 0x80000, 0x0330e13b, 3 | BRF_GRA }, // 5 Characters and Foreground Tiles - - { "vtmaa01.bin", 0x80000, 0xc217a31b, 4 | BRF_GRA }, // 7 - { "vtmaa02.bin", 0x80000, 0x091ff98e, 4 | BRF_GRA }, // 6 Background Tiles - - { "vtmaa04.bin", 0x80000, 0xb713e9cc, 5 | BRF_GRA }, // 9 - { "vtmaa03.bin", 0x80000, 0x1a30bf81, 5 | BRF_GRA }, // 8 Sprites - - { "fj06", 0x20000, 0x6e98a235, 6 | BRF_SND }, // 10 OKI M6295 Samples 0 - - { "fj05", 0x20000, 0x39cda2b5, 7 | BRF_SND }, // 11 OKI M6295 Samples 1 - - { "fj-27.bin", 0x00200, 0x65045742, 8 | BRF_OPT }, // 12 Unknown PROMs - - { "pal16l8a.6l", 0x00104, 0xee748e8f, 9 | BRF_OPT }, // 13 PLDs - { "pal16l8b.13g", 0x00104, 0x6da13bda, 9 | BRF_OPT }, // 14 - { "pal16l8b.13h", 0x00104, 0x62a9e098, 9 | BRF_OPT }, // 15 - { "pal16l8b.14g", 0x00104, 0x036768aa, 9 | BRF_OPT }, // 16 - { "pal16l8b.14h", 0x00104, 0xbf421fce, 9 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(vaportrau) -STD_ROM_FN(vaportrau) - -struct BurnDriver BurnDrvVaportrau = { - "vaportrau", "vaportra", NULL, NULL, "1989", - "Vapor Trail - Hyper Offence Formation (US)\0", NULL, "Data East USA", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, vaportrauRomInfo, vaportrauRomName, NULL, NULL, VaportraInputInfo, VaportraDIPInfo, - VaportraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x500, - 240, 256, 3, 4 -}; - - -// Kuhga - Operation Code 'Vapor Trail' (Japan revision 3) - -static struct BurnRomInfo kuhgaRomDesc[] = { - { "fp02-3.bin", 0x20000, 0xd0705ef4, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fp00-3.bin", 0x20000, 0x1da92e48, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fp03.bin", 0x20000, 0xea0da0f1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fp01.bin", 0x20000, 0xe3ecbe86, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fj04", 0x10000, 0xe9aedf9b, 2 | BRF_PRG | BRF_ESS }, // 4 Huc6280 Code - - { "vtmaa00.bin", 0x80000, 0x0330e13b, 3 | BRF_GRA }, // 5 Characters and Foreground Tiles - - { "vtmaa01.bin", 0x80000, 0xc217a31b, 4 | BRF_GRA }, // 7 - { "vtmaa02.bin", 0x80000, 0x091ff98e, 4 | BRF_GRA }, // 6 Background Tiles - - { "vtmaa04.bin", 0x80000, 0xb713e9cc, 5 | BRF_GRA }, // 9 - { "vtmaa03.bin", 0x80000, 0x1a30bf81, 5 | BRF_GRA }, // 8 Sprites - - { "fj06", 0x20000, 0x6e98a235, 6 | BRF_SND }, // 10 OKI M6295 Samples 0 - - { "fj05", 0x20000, 0x39cda2b5, 7 | BRF_SND }, // 11 OKI M6295 Samples 1 - - { "fj-27.bin", 0x00200, 0x65045742, 8 | BRF_OPT }, // 12 Unknown PROMs -}; - -STD_ROM_PICK(kuhga) -STD_ROM_FN(kuhga) - -struct BurnDriver BurnDrvKuhga = { - "kuhga", "vaportra", NULL, NULL, "1989", - "Kuhga - Operation Code 'Vapor Trail' (Japan revision 3)\0", NULL, "Data East Corporation", "DECO IC16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PREFIX_DATAEAST, GBF_VERSHOOT, 0, - NULL, kuhgaRomInfo, kuhgaRomName, NULL, NULL, VaportraInputInfo, VaportraDIPInfo, - VaportraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x500, - 240, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/dataeast/deco146.cpp b/jan/src/burn/drv/dataeast/deco146.cpp deleted file mode 100644 index 2de100088..000000000 --- a/jan/src/burn/drv/dataeast/deco146.cpp +++ /dev/null @@ -1,2570 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood, Charles MacDonald -/* Data East 146 protection chip / memory-mapper & I/O interface */ - -/* - The 146 emulation was based on the analysis of a 146 chip by - Charles MacDonald http://cgfm2.emuviews.com/new/detech.txt - using a Super Shanghai board and comparisons with the old protection - simulations. - - The Deco 104 emulation is handled through deco104.c - - The Deco 146 and 104 chips act as I/O chips and as protection devices - by using 2 banks of 0x80 words of RAM built into the chips. - - The chip has 0x400 read addresses each of which is mapped to one of - the RAM addresses (scrambled) as well as logic for shifting, xoring - and masking the bits returned. - - In addition there is the aformentioned bankswitch behavior triggered - by causing a read related to a specific write address. - - The chip also provides takes an additional 4 address lines and uses - them to map Chip Select outputs meaning depending on some - configuration registers meaning it can potentially be used as a - memory mapping device similar to the Sega System 16 ones, however - nothing makes proper use of this functionality. - - There seems to be a way to select an alt read mode too, causing - the port read lines to be xored. - - Many games only use the basic I/O functions! - - Data East Customs - 60,66,75 and 146 all appear to have identical functionality - - Custom chip 104 appears to work in the same way but with different - internal tables and different special ports. - - Chip 146 104 - XOR register port 0x2c 0x42 - MASK register port 0x36 0xee - Soundlatch port 0x64 0xa8 - Bankswitch port 0x78 0x66 - Extra addr Xor(if used) 0x44a 0x2a4 - CS config region 0x8 0xc - - Both chips are often connected with the lower 10 address lines - scrambled or reversed. - - Game Chip Address Scramble Extra Read Address Xor? - - --- 146 compatible games --- - - Edward Randy 60 None No - Mutant Fighter 66 None No - Captain America 75 None No - Lemmings 75 None Yes - Robocop 2 75 None Yes - Super Shanghai Dragon's Eye 146 None No - Funky Jet 146 Interleave No - Sotsugyo Shousho (same board / config as Funky Jet) - Nitro Ball 146 Reversed Yes - Fighters History 75 Interleave Yes - Stadium Hero 96 146 None Yes - Dragon Gun 146 Reversed No - Lock 'n' Loaded (same board / config as Dragon Gun) - - --- 104 games --- - - Caveman Ninja 104 None Yes - Wizard Fire 104 Reversed No - Pocket Gal DX 104 Custom* No* - Boogie Wings 104 Reversed Yes - Rohga 104 None No - Diet GoGo 104 Interleave Yes - Tattoo Assassins 104 Interleave No - Dream Ball 104 None No - Night Slashers 104 Interleave No - Double Wings 104 Interleave Yes - Schmeiser Robo 104 None No - - - * not currently hooked up, address scramble not figured out - - */ - -#include "tiles_generic.h" -#include "deco146.h" - -deco146port_xx port_table_146[] = { -/* 0x000 */ { 0x08a, { NIB1__, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x002 */ { 0x0aa, { NIB3__, NIB2__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x004 */ { 0x018, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x006 */ { 0x03c, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x008 */ { 0x0bc, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x00a */ { 0x00e, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x00c */ { 0x09a, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x00e */ { 0x000, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x010 */ { 0x00c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x012 */ { 0x006, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x014 */ { 0x0e6, { NIB2__, NIB3__, NIB1__, NIB0__ }, 0, 0 }, -/* 0x016 */ { 0x09c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x018 */ { 0x05e, { NIB0__, NIB1__, NIB3__, NIB2__ }, 1, 1 }, -/* 0x01a */ { 0x0de, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x01c */ { 0x002, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x01e */ { 0x0f4, { NIB0__, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x020 */ { 0x036, { NIB0__, NIB2__, NIB3__, NIB1__ }, 1, 0 }, -/* 0x022 */ { 0x070, { NIB1__, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x024 */ { INPUT_PORT_C, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 1 }, // // $4024 $FFFF DCBA .N. 2 -/* 0x026 */ { 0x030, { NIB0__, NIB3__, NIB2__, NIB1__ }, 0, 0 }, -/* 0x028 */ { 0x06a, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 0 }, -/* 0x02a */ { 0x0c0, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x02c */ { 0x01c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x02e */ { 0x0ec, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x030 */ { 0x090, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x032 */ { 0x0f0, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x034 */ { 0x020, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x036 */ { 0x082, { NIB1__, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x038 */ { 0x0a0, { NIB2__, NIB1__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x03a */ { 0x078, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x03c */ { 0x0be, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x03e */ { 0x066, { NIB1__, NIB0__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x040 */ { 0x0c8, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x042 */ { 0x0ce, { NIB0__, NIB3__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x044 */ { INPUT_PORT_B, { NIB0R2, BLANK_, BLANK_, BLANK_ }, 0, 1 },// $4044 $000F ---A .N. 2 -/* 0x046 */ { INPUT_PORT_B, { NIB0__, BLANK_, BLANK_, BLANK_ }, 1, 0 }, // $4046 $000F ---A X.. 0 (mutant fighter ) -/* 0x048 */ { 0x0f6, { NIB1__, NIB2__, BLANK_, NIB3__ }, 0, 1 }, -/* 0x04a */ { 0x0f8, { NIB0__, NIB3__, NIB2__, NIB1__ }, 0, 1 }, -/* 0x04c */ { 0x0cc, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x04e */ { 0x014, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x050 */ { INPUT_PORT_A, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, // $4050 $FFFF DCBA ... 0 (standard i/o read shanghai) -/* 0x052 */ { 0x0de, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x054 */ { 0x060, { NIB0__, NIB2__, NIB3__, NIB1__ }, 0, 1 }, -/* 0x056 */ { 0x012, { NIB3__, NIB2__, NIB1__, NIB0__ }, 1, 0 }, -/* 0x058 */ { 0x0a2, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x05a */ { 0x06c, { NIB1__, NIB2__, BLANK_, NIB3__ }, 1, 0 }, -/* 0x05c */ { 0x076, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x05e */ { INPUT_PORT_A, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 1 }, // // $405E $FFFF DCBA .N. 0 -/* 0x060 */ { 0x0dc, { NIB3__, NIB0__, NIB2__, NIB1__ }, 1, 1 }, -/* 0x062 */ { 0x054, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x064 */ { 0x05a, { NIB1__, NIB3__, NIB0__, NIB2__ }, 1, 0 }, -/* 0x066 */ { INPUT_PORT_A, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 0 },// $4066 $FF00 BA-- ..B 0 -/* 0x068 */ { 0x0e0, { NIB2__, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x06a */ { 0x0d4, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x06c */ { 0x054, { NIB1__, NIB3__, NIB0__, NIB2__ }, 1, 1 }, -/* 0x06e */ { 0x0fc, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x070 */ { 0x07e, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x072 */ { 0x03e, { NIB2__, NIB1__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x074 */ { 0x0c6, { BLANK_, NIB3__, BLANK_, NIB2__ }, 1, 1 }, -/* 0x076 */ { 0x078, { NIB3__, NIB2__, NIB1__, NIB0__ }, 1, 1 }, -/* 0x078 */ { 0x07c, { BLANK_, NIB2__, NIB3__, NIB1__ }, 0, 1 }, -/* 0x07a */ { 0x00e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x07c */ { 0x09c, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x07e */ { 0x074, { NIB2__, NIB0__, NIB1__, NIB3__ }, 0, 0 }, -/* 0x080 */ { INPUT_PORT_B, { NIB0__, BLANK_, BLANK_, BLANK_ }, 0, 1 },// $4080 $000F ---A .N. 0 -/* 0x082 */ { 0x044, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x084 */ { 0x0c4, { NIB1__, NIB2__, BLANK_, NIB3__ }, 1, 1 }, -/* 0x086 */ { 0x0be, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x088 */ { 0x04e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x08a */ { 0x0b2, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x08c */ { 0x04e, { NIB3__, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x08e */ { 0x052, { BLANK_, NIB3__, BLANK_, NIB2__ }, 0, 0 }, -/* 0x090 */ { 0x04a, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x092 */ { INPUT_PORT_B, { NIB1__, BLANK_, BLANK_, BLANK_ }, 0, 0 },// $4092 $00F0 --A- ... 0 -/* 0x094 */ { 0x02c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x096 */ { 0x000, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x098 */ { 0x076, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x09a */ { 0x014, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x09c */ { 0x094, { NIB2__, NIB1__, NIB0__, NIB3__ }, 0, 0 }, -/* 0x09e */ { 0x0ac, { NIB3__, NIB1__, NIB2__, NIB0__ }, 0, 1 }, -/* 0x0a0 */ { 0x0a4, { NIB3__, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x0a2 */ { 0x098, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x0a4 */ { 0x02c, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x0a6 */ { 0x0d8, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x0a8 */ { 0x0d2, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x0aa */ { 0x0fe, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0ac */ { INPUT_PORT_C, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, // $40AC $FFFF DCBA ... 0 (standard i/o read shanghai) -/* 0x0ae */ { 0x062, { NIB2__, NIB3__, NIB1__, NIB0__ }, 1, 0 }, -/* 0x0b0 */ { 0x00c, { NIB3__, NIB2__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x0b2 */ { 0x078, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x0b4 */ { 0x046, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x0b6 */ { 0x0c6, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x0b8 */ { 0x03a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0ba */ { 0x0f2, { NIB2__, NIB1__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x0bc */ { 0x0e2, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x0be */ { INPUT_PORT_B, { NIB2__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $40BE $0F00 -A-- ... 0 -/* 0x0c0 */ { 0x096, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x0c2 */ { INPUT_PORT_C, { NIB0__, NIB1__, NIB2__, NIB3__ }, 1, 0 }, // $40C2 $FFFF DCBA X.. 0 (edrandy) // standard port order with a xor.. -/* 0x0c4 */ { 0x056, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x0c6 */ { 0x09e, { NIB2__, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x0c8 */ { 0x05c, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x0ca */ { 0x028, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0cc */ { 0x0da, { NIB1__, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x0ce */ { 0x0b4, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0d0 */ { 0x0a6, { NIB2__, NIB1__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x0d2 */ { 0x0a6, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0d4 */ { 0x06c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0d6 */ { 0x064, { NIB0__, NIB3__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x0d8 */ { INPUT_PORT_C, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 1 }, // // $40D8 $FFFF DCBA .N. 1 -/* 0x0da */ { 0x0e4, { NIB2__, NIB1__, BLANK_, NIB3__ }, 0, 1 }, -/* 0x0dc */ { 0x048, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x0de */ { 0x0ee, { NIB2__, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x0e0 */ { 0x024, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0e2 */ { 0x0aa, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x0e4 */ { 0x004, { NIB1__, NIB2__, NIB0__, NIB3__ }, 0, 0 }, -/* 0x0e6 */ { 0x0c2, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x0e8 */ { 0x0ae, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x0ea */ { 0x02a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0ec */ { 0x05e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0ee */ { 0x078, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x0f0 */ { 0x072, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 1 }, -/* 0x0f2 */ { 0x016, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x0f4 */ { 0x02e, { NIB3__, NIB0__, NIB2__, NIB1__ }, 1, 0 }, -/* 0x0f6 */ { 0x042, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x0f8 */ { 0x068, { NIB2__, NIB1__, BLANK_, NIB3__ }, 1, 0 }, -/* 0x0fa */ { 0x042, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x0fc */ { 0x034, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x0fe */ { INPUT_PORT_A, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 0 },// $40FE $FFFF CBAD ... 0 -/* 0x100 */ { 0x008, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x102 */ { 0x0a2, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x104 */ { 0x0c8, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x106 */ { 0x07a, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x108 */ { 0x050, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x10a */ { 0x01e, { NIB2__, NIB0__, NIB1__, NIB3__ }, 1, 0 }, -/* 0x10c */ { 0x0ca, { BLANK_, BLANK_, BLANK_, NIB3__ }, 0, 0 }, -/* 0x10e */ { 0x05a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x110 */ { 0x090, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x112 */ { 0x052, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x114 */ { 0x0ba, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x116 */ { 0x0c0, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x118 */ { INPUT_PORT_C, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 0 }, // // $4118 $FFFF DCBA X.. 2 -/* 0x11a */ { 0x02a, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x11c */ { 0x032, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x11e */ { 0x026, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x120 */ { 0x0e0, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x122 */ { 0x0d6, { NIB2__, NIB3__, NIB1__, NIB0__ }, 1, 1 }, -/* 0x124 */ { 0x0a8, { NIB0__, NIB3__, NIB2__, NIB1__ }, 1, 0 }, -/* 0x126 */ { 0x0d0, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x128 */ { 0x080, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x12a */ { 0x078, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x12c */ { 0x06e, { NIB2__, NIB1__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x12e */ { 0x092, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x130 */ { 0x040, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x132 */ { 0x0ea, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x134 */ { 0x086, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x136 */ { 0x01c, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x138 */ { 0x010, { NIB1__, NIB3__, NIB0__, NIB2__ }, 0, 0 }, -/* 0x13a */ { 0x038, { NIB1__, NIB2__, BLANK_, NIB3__ }, 0, 0 }, -/* 0x13c */ { 0x08e, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 0 }, -/* 0x13e */ { 0x04c, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x140 */ { 0x084, { NIB3__, NIB0__, NIB2__, NIB1__ }, 0, 0 }, -/* 0x142 */ { 0x028, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x144 */ { 0x0b8, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x146 */ { 0x022, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x148 */ { 0x046, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x14a */ { 0x08c, { NIB1__, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x14c */ { 0x0fa, { NIB1__, NIB2__, NIB0__, NIB3__ }, 1, 0 }, -/* 0x14e */ { 0x0b4, { NIB2__, NIB0__, NIB1__, NIB3__ }, 1, 1 }, -/* 0x150 */ { 0x0f0, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x152 */ { 0x018, { NIB1__, NIB0__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x154 */ { 0x088, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x156 */ { 0x058, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x158 */ { 0x032, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x15a */ { 0x0a0, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x15c */ { 0x0e8, { NIB3__, NIB1__, NIB2__, NIB0__ }, 1, 0 }, -/* 0x15e */ { 0x04c, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x160 */ { 0x03a, { NIB2__, NIB1__, BLANK_, NIB3__ }, 1, 1 }, -/* 0x162 */ { 0x0b2, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x164 */ { 0x086, { NIB2__, NIB1__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x166 */ { 0x078, { NIB1__, NIB2__, NIB0__, NIB3__ }, 0, 1 }, -/* 0x168 */ { 0x0e6, { NIB2__, NIB3__, NIB1__, NIB0__ }, 0, 1 }, -/* 0x16a */ { 0x028, { NIB1__, NIB0__, NIB3__, NIB2__ }, 1, 0 }, -/* 0x16c */ { 0x026, { NIB1__, NIB2__, NIB0__, NIB3__ }, 0, 1 }, -/* 0x16e */ { INPUT_PORT_B, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $416E $F000 A--- ... 0 -/* 0x170 */ { 0x02a, { NIB2__, NIB0__, NIB1__, NIB3__ }, 0, 1 }, -/* 0x172 */ { 0x086, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x174 */ { 0x022, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x176 */ { 0x010, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x178 */ { 0x082, { NIB0__, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x17a */ { 0x02c, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x17c */ { 0x0aa, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x17e */ { 0x056, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x180 */ { 0x0ec, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x182 */ { 0x098, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x184 */ { 0x0e2, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x186 */ { 0x09e, { NIB0__, NIB3__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x188 */ { 0x0da, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x18a */ { 0x0a2, { NIB0__, NIB3__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x18c */ { 0x0c2, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x18e */ { 0x01e, { NIB3__, NIB1__, NIB2__, NIB0__ }, 0, 0 }, -/* 0x190 */ { 0x02e, { NIB1__, NIB2__, NIB0__, NIB3__ }, 1, 1 }, -/* 0x192 */ { 0x062, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x194 */ { 0x002, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x196 */ { 0x072, { NIB2__, NIB1__, NIB0__, NIB3__ }, 0, 1 }, -/* 0x198 */ { 0x076, { NIB2__, NIB1__, NIB0__, NIB3__ }, 1, 0 }, -/* 0x19a */ { 0x0e0, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x19c */ { 0x064, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x19e */ { INPUT_PORT_C, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 1 }, // // $419E $FFFF DCBA .N. 0 -/* 0x1a0 */ { INPUT_PORT_A, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 0 },// $41A0 $FFFF ADCB ... 0 -/* 0x1a2 */ { 0x078, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x1a4 */ { 0x07e, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x1a6 */ { 0x004, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x1a8 */ { 0x0ac, { NIB1__, NIB3__, NIB0__, NIB2__ }, 0, 1 }, -/* 0x1aa */ { 0x0b6, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x1ac */ { 0x09c, { NIB0__, NIB2__, NIB3__, NIB1__ }, 0, 0 }, -/* 0x1ae */ { 0x006, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x1b0 */ { 0x0c4, { NIB3__, NIB2__, NIB1__, NIB0__ }, 0, 0 }, -/* 0x1b2 */ { INPUT_PORT_A, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 0 },// $41B2 $FFFF DCBA ... 2 -/* 0x1b4 */ { 0x0c0, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x1b6 */ { 0x036, { BLANK_, NIB2__, NIB3__, NIB1__ }, 1, 1 }, -/* 0x1b8 */ { 0x03c, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x1ba */ { 0x0b2, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x1bc */ { 0x024, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x1be */ { 0x008, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x1c0 */ { 0x030, { NIB3__, NIB2__, NIB1__, NIB0__ }, 0, 1 }, -/* 0x1c2 */ { 0x09a, { NIB3__, NIB0__, NIB2__, NIB1__ }, 0, 1 }, -/* 0x1c4 */ { 0x016, { BLANK_, NIB2__, NIB3__, NIB1__ }, 1, 0 }, -/* 0x1c6 */ { 0x0ba, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x1c8 */ { 0x06a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x1ca */ { 0x0ce, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x1cc */ { 0x0ec, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x1ce */ { 0x014, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x1d0 */ { INPUT_PORT_B, { NIB1__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $41D0 $00F0 --A- ... 0 -/* 0x1d2 */ { 0x050, { NIB0__, NIB2__, NIB3__, NIB1__ }, 1, 1 }, -/* 0x1d4 */ { 0x0a0, { NIB2__, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x1d6 */ { 0x05e, { NIB3__, NIB2__, NIB1__, NIB0__ }, 1, 1 }, -/* 0x1d8 */ { 0x01a, { NIB1__, NIB0__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x1da */ { 0x0fc, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x1dc */ { 0x03e, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x1de */ { 0x078, { NIB2__, NIB1__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x1e0 */ { 0x022, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x1e2 */ { 0x0c2, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x1e4 */ { 0x0cc, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x1e6 */ { 0x01e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x1e8 */ { 0x002, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x1ea */ { 0x0d2, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x1ec */ { 0x092, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x1ee */ { 0x0f2, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x1f0 */ { 0x0c8, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x1f2 */ { 0x058, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x1f4 */ { 0x0f4, { NIB3__, NIB2__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x1f6 */ { 0x0f0, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x1f8 */ { 0x088, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 1 }, -/* 0x1fa */ { 0x020, { NIB3__, NIB1__, NIB2__, NIB0__ }, 1, 1 }, -/* 0x1fc */ { 0x0ca, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x1fe */ { 0x04c, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x200 */ { INPUT_PORT_C, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 0 }, // // $4200 $FFFF DCBA X.. 1 -/* 0x202 */ { 0x04e, { BLANK_, BLANK_, BLANK_, NIB3__ }, 1, 1 }, -/* 0x204 */ { 0x018, { NIB1__, NIB0__, NIB3__, NIB2__ }, 1, 1 }, -/* 0x206 */ { 0x064, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x208 */ { 0x04a, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x20a */ { 0x080, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x20c */ { 0x034, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x20e */ { 0x094, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x210 */ { 0x08a, { NIB2__, NIB1__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x212 */ { 0x07a, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x214 */ { 0x0f8, { NIB0__, NIB3__, NIB2__, NIB1__ }, 1, 1 }, -/* 0x216 */ { 0x070, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x218 */ { 0x0ca, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x21a */ { 0x078, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x21c */ { 0x0e4, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x21e */ { 0x0fe, { NIB0__, NIB1__, NIB3__, NIB2__ }, 1, 0 }, -/* 0x220 */ { 0x0b0, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x222 */ { 0x07c, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x224 */ { 0x0b4, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x226 */ { 0x05c, { BLANK_, BLANK_, BLANK_, NIB3__ }, 0, 1 }, -/* 0x228 */ { 0x0e2, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x22a */ { INPUT_PORT_C, { NIB1__, NIB2__, NIB3__, BLANK_ }, 0, 0 }, // // $422A $FFF0 CBA- ... 0 -/* 0x22c */ { 0x0ae, { BLANK_, NIB3__, BLANK_, NIB2__ }, 0, 1 }, -/* 0x22e */ { 0x0de, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x230 */ { 0x090, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x232 */ { 0x07c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x234 */ { 0x0a6, { NIB2__, NIB1__, NIB0__, NIB3__ }, 1, 1 }, -/* 0x236 */ { 0x040, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x238 */ { 0x05a, { NIB3__, NIB2__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x23a */ { 0x0a8, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x23c */ { 0x060, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x23e */ { 0x074, { BLANK_, NIB2__, NIB3__, NIB1__ }, 0, 0 }, -/* 0x240 */ { 0x06e, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x242 */ { 0x0d4, { NIB2__, NIB1__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x244 */ { 0x00a, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x246 */ { 0x068, { BLANK_, NIB3__, BLANK_, NIB2__ }, 1, 0 }, -/* 0x248 */ { 0x0d0, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x24a */ { 0x052, { BLANK_, BLANK_, BLANK_, NIB3__ }, 1, 0 }, -/* 0x24c */ { INPUT_PORT_B, { NIB2__, BLANK_, BLANK_, BLANK_ }, 0, 0 },//// $424C $0F00 -A-- ... 0 -/* 0x24e */ { 0x00e, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x250 */ { 0x012, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x252 */ { 0x08c, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x254 */ { 0x0bc, { NIB1__, NIB0__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x256 */ { 0x078, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x258 */ { 0x0fe, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x25a */ { 0x0ee, { NIB2__, NIB1__, BLANK_, NIB3__ }, 0, 0 }, -/* 0x25c */ { 0x096, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x25e */ { 0x0dc, { NIB1__, NIB2__, BLANK_, NIB3__ }, 0, 0 }, -/* 0x260 */ { 0x07e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x262 */ { 0x038, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x264 */ { 0x046, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x266 */ { 0x0b8, { NIB2__, NIB1__, BLANK_, NIB3__ }, 0, 1 }, -/* 0x268 */ { 0x0d0, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x26a */ { 0x0c6, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x26c */ { 0x0ea, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x26e */ { 0x066, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x270 */ { 0x0f8, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x272 */ { 0x068, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x274 */ { 0x03a, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x276 */ { 0x0e8, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x278 */ { 0x032, { NIB1__, NIB0__, NIB3__, NIB2__ }, 1, 1 }, -/* 0x27a */ { 0x08e, { NIB1__, NIB2__, NIB0__, NIB3__ }, 0, 1 }, -/* 0x27c */ { 0x044, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x27e */ { 0x0f6, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x280 */ { INPUT_PORT_B, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $4280 $F000 A--- ... 0 -/* 0x282 */ { 0x0be, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x284 */ { 0x040, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x286 */ { 0x06a, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x288 */ { 0x0a4, { NIB1__, NIB2__, BLANK_, NIB3__ }, 1, 0 }, -/* 0x28a */ { 0x0f0, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x28c */ { 0x0f8, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x28e */ { 0x0d2, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x290 */ { 0x012, { NIB2__, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x292 */ { 0x078, { NIB2__, NIB1__, BLANK_, NIB3__ }, 1, 1 }, -/* 0x294 */ { 0x000, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x296 */ { 0x01c, { NIB0__, NIB3__, NIB2__, NIB1__ }, 0, 1 }, -/* 0x298 */ { 0x048, { NIB1__, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x29a */ { 0x06c, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x29c */ { 0x0d8, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x29e */ { 0x062, { NIB2__, NIB1__, NIB0__, NIB3__ }, 0, 1 }, -/* 0x2a0 */ { 0x0ac, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x2a2 */ { 0x0d6, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x2a4 */ { 0x00c, { NIB2__, NIB1__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x2a6 */ { 0x0e8, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x2a8 */ { 0x084, { NIB0__, NIB3__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x2aa */ { 0x054, { NIB3__, NIB2__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x2ac */ { 0x042, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x2ae */ { 0x07e, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x2b0 */ { 0x002, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x2b2 */ { 0x0d8, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x2b4 */ { 0x0c4, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x2b6 */ { 0x02e, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x2b8 */ { 0x040, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x2ba */ { 0x064, { NIB0__, NIB3__, NIB2__, NIB1__ }, 1, 1 }, -/* 0x2bc */ { 0x072, { NIB2__, NIB3__, NIB1__, NIB0__ }, 1, 1 }, -/* 0x2be */ { 0x016, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x2c0 */ { 0x04e, { NIB2__, NIB1__, NIB0__, NIB3__ }, 1, 0 }, -/* 0x2c2 */ { 0x06e, { NIB2__, NIB1__, BLANK_, NIB3__ }, 1, 0 }, -/* 0x2c4 */ { 0x0de, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x2c6 */ { 0x094, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 0 }, -/* 0x2c8 */ { 0x074, { NIB2__, NIB0__, NIB1__, NIB3__ }, 0, 0 }, -/* 0x2ca */ { 0x07c, { NIB3__, NIB1__, NIB2__, NIB0__ }, 1, 0 }, -/* 0x2cc */ { 0x006, { NIB3__, NIB0__, NIB2__, NIB1__ }, 1, 0 }, -/* 0x2ce */ { 0x078, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x2d0 */ { 0x09e, { NIB2__, NIB1__, BLANK_, NIB3__ }, 0, 0 }, -/* 0x2d2 */ { 0x028, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x2d4 */ { 0x0b2, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x2d6 */ { 0x05a, { NIB3__, NIB2__, NIB1__, NIB0__ }, 1, 0 }, -/* 0x2d8 */ { 0x026, { NIB1__, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x2da */ { 0x08a, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x2dc */ { 0x0ac, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x2de */ { 0x096, { NIB3__, NIB2__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x2e0 */ { 0x098, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x2e2 */ { INPUT_PORT_C, { NIB3__, NIB1__, NIB2__, NIB0__ }, 0, 0 }, // $42E2 $FFFF ACBD ... 0 -/* 0x2e4 */ { 0x02a, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x2e6 */ { 0x0fe, { NIB0__, NIB3__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x2e8 */ { 0x0b4, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x2ea */ { 0x032, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x2ec */ { 0x0f2, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x2ee */ { 0x054, { NIB0__, NIB2__, NIB3__, NIB1__ }, 0, 1 }, -/* 0x2f0 */ { 0x0a2, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x2f2 */ { 0x050, { NIB1__, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x2f4 */ { INPUT_PORT_B, { NIB0R1, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $42F4 $000F ---A ... 1 -/* 0x2f6 */ { 0x000, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x2f8 */ { 0x01e, { NIB1__, NIB2__, NIB0__, NIB3__ }, 1, 0 }, -/* 0x2fa */ { 0x014, { NIB3__, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x2fc */ { 0x0b8, { BLANK_, BLANK_, BLANK_, NIB3__ }, 0, 0 }, -/* 0x2fe */ { 0x0ae, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x300 */ { 0x068, { NIB0__, NIB1__, NIB3__, NIB2__ }, 1, 1 }, -/* 0x302 */ { 0x0f8, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 0 }, -/* 0x304 */ { 0x0d6, { NIB2__, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x306 */ { 0x044, { NIB1__, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x308 */ { 0x038, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x30a */ { 0x078, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x30c */ { 0x04c, { NIB0__, NIB3__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x30e */ { 0x0c6, { NIB0__, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x310 */ { 0x084, { NIB3__, NIB0__, NIB2__, NIB1__ }, 1, 1 }, -/* 0x312 */ { 0x0bc, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x314 */ { 0x058, { NIB0__, NIB2__, NIB3__, NIB1__ }, 1, 1 }, -/* 0x316 */ { INPUT_PORT_B, { NIB0R2, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $4316 $000F ---A ... 2 -/* 0x318 */ { 0x00e, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x31a */ { 0x092, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x31c */ { 0x09a, { NIB0__, NIB2__, NIB3__, NIB1__ }, 0, 0 }, -/* 0x31e */ { 0x0a0, { BLANK_, NIB3__, BLANK_, NIB2__ }, 1, 0 }, -/* 0x320 */ { 0x08c, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x322 */ { 0x08e, { NIB1__, NIB0__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x324 */ { 0x0d2, { BLANK_, NIB2__, NIB3__, NIB1__ }, 1, 1 }, -/* 0x326 */ { 0x024, { NIB2__, NIB1__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x328 */ { 0x006, { BLANK_, NIB2__, NIB3__, NIB1__ }, 0, 0 }, -/* 0x32a */ { 0x080, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x32c */ { 0x0e2, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x32e */ { 0x008, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x330 */ { 0x00c, { NIB0__, NIB2__, NIB3__, NIB1__ }, 1, 0 }, -/* 0x332 */ { 0x048, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x334 */ { 0x05c, { NIB0__, NIB3__, NIB2__, NIB1__ }, 0, 0 }, -/* 0x336 */ { 0x042, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x338 */ { 0x076, { NIB2__, NIB0__, NIB1__, NIB3__ }, 1, 1 }, -/* 0x33a */ { 0x036, { NIB0__, NIB3__, NIB2__, NIB1__ }, 1, 0 }, -/* 0x33c */ { 0x0b0, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x33e */ { 0x056, { NIB1__, NIB0__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x340 */ { 0x01a, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x342 */ { 0x0bc, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x344 */ { 0x0aa, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x346 */ { 0x078, { NIB1__, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x348 */ { 0x0dc, { NIB1__, NIB2__, NIB0__, NIB3__ }, 0, 0 }, -/* 0x34a */ { 0x06a, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x34c */ { INPUT_PORT_B, { NIB0R3, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $434C $000F ---A ... 3 -/* 0x34e */ { 0x03e, { NIB1__, NIB3__, NIB0__, NIB2__ }, 1, 1 }, -/* 0x350 */ { 0x0da, { NIB2__, NIB0__, NIB1__, NIB3__ }, 0, 1 }, -/* 0x352 */ { 0x098, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x354 */ { 0x01c, { NIB3__, NIB2__, NIB1__, NIB0__ }, 1, 1 }, -/* 0x356 */ { 0x034, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x358 */ { 0x0ba, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x35a */ { 0x08a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x35c */ { 0x086, { NIB3__, NIB2__, NIB1__, NIB0__ }, 0, 1 }, -/* 0x35e */ { 0x09c, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x360 */ { 0x02c, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x362 */ { 0x080, { NIB3__, NIB0__, NIB2__, NIB1__ }, 0, 0 }, -/* 0x364 */ { 0x04a, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x366 */ { 0x0c8, { NIB2__, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x368 */ { 0x05e, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x36a */ { 0x0f6, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x36c */ { 0x0fc, { NIB1__, NIB3__, NIB0__, NIB2__ }, 1, 0 }, -/* 0x36e */ { 0x048, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x370 */ { 0x0c4, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x372 */ { 0x020, { NIB0__, NIB1__, NIB3__, NIB2__ }, 1, 0 }, -/* 0x374 */ { 0x030, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x376 */ { 0x038, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x378 */ { INPUT_PORT_A, { NIB1__, NIB0__, NIB2__, NIB3__ }, 0, 0 },// $4378 $FFFF DCAB ... 0 -/* 0x37a */ { 0x08e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x37c */ { 0x010, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x37e */ { 0x0d0, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x380 */ { 0x084, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x382 */ { 0x078, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x384 */ { 0x0ee, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x386 */ { 0x07a, { BLANK_, NIB2__, NIB3__, NIB1__ }, 1, 0 }, -/* 0x388 */ { 0x0b6, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x38a */ { 0x084, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 1 }, -/* 0x38c */ { 0x01a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x38e */ { 0x004, { NIB1__, NIB2__, BLANK_, NIB3__ }, 1, 1 }, -/* 0x390 */ { 0x0fa, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x392 */ { 0x0ae, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x394 */ { 0x0cc, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x396 */ { 0x0e0, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x398 */ { 0x024, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x39a */ { 0x0f6, { NIB2__, NIB3__, NIB1__, NIB0__ }, 0, 0 }, -/* 0x39c */ { 0x0a8, { NIB3__, NIB1__, NIB2__, NIB0__ }, 0, 0 }, -/* 0x39e */ { 0x0ec, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x3a0 */ { 0x070, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x3a2 */ { 0x0a6, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 1 }, -/* 0x3a4 */ { 0x03c, { NIB2__, NIB1__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x3a6 */ { 0x09e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3a8 */ { 0x0c2, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x3aa */ { 0x03a, { BLANK_, NIB3__, BLANK_, NIB2__ }, 0, 1 }, -/* 0x3ac */ { 0x0a4, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x3ae */ { 0x010, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x3b0 */ { 0x0d4, { BLANK_, NIB3__, BLANK_, NIB2__ }, 1, 1 }, -/* 0x3b2 */ { 0x03c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3b4 */ { 0x082, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x3b6 */ { 0x00a, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x3b8 */ { 0x066, { NIB3__, NIB1__, NIB2__, NIB0__ }, 0, 1 }, -/* 0x3ba */ { 0x022, { NIB1__, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x3bc */ { 0x0be, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x3be */ { 0x078, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x3c0 */ { 0x0ca, { NIB2__, NIB0__, NIB1__, NIB3__ }, 1, 0 }, -/* 0x3c2 */ { 0x0ba, { NIB1__, NIB2__, BLANK_, NIB3__ }, 0, 1 }, -/* 0x3c4 */ { 0x0e6, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x3c6 */ { 0x052, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x3c8 */ { 0x026, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3ca */ { 0x0ce, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x3cc */ { 0x0f0, { NIB2__, NIB1__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x3ce */ { 0x0f4, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x3d0 */ { 0x060, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x3d2 */ { 0x0e8, { NIB0__, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x3d4 */ { 0x018, { NIB0__, NIB3__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x3d6 */ { 0x088, { NIB3__, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x3d8 */ { 0x0e4, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x3da */ { 0x0ea, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x3dc */ { 0x0aa, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3de */ { 0x06c, { NIB1__, NIB2__, NIB0__, NIB3__ }, 1, 1 }, -/* 0x3e0 */ { 0x044, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3e2 */ { 0x046, { NIB3__, NIB2__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x3e4 */ { 0x020, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3e6 */ { 0x012, { BLANK_, NIB2__, NIB3__, NIB1__ }, 0, 1 }, -/* 0x3e8 */ { 0x008, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x3ea */ { 0x062, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x3ec */ { 0x0c0, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x3ee */ { 0x008, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3f0 */ { 0x056, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3f2 */ { 0x0d8, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x3f4 */ { 0x0ee, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3f6 */ { 0x07c, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x3f8 */ { 0x086, { NIB2__, NIB3__, NIB1__, NIB0__ }, 0, 1 }, -/* 0x3fa */ { 0x078, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x3fc */ { 0x03a, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x3fe */ { 0x006, { NIB3__, NIB0__, NIB2__, NIB1__ }, 0, 1 }, -/* 0x400 */ { 0x0fc, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x402 */ { 0x01c, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x404 */ { 0x098, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x406 */ { 0x06c, { NIB1__, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x408 */ { 0x0cc, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x40a */ { 0x0d6, { NIB1__, NIB3__, NIB0__, NIB2__ }, 0, 0 }, -/* 0x40c */ { 0x0f0, { NIB2__, NIB1__, NIB0__, NIB3__ }, 0, 0 }, -/* 0x40e */ { 0x07a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x410 */ { 0x09a, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x412 */ { 0x0c4, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x414 */ { INPUT_PORT_C, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 0 }, // $4414 $FF00 BA-- ... 0 -/* 0x416 */ { 0x0ea, { NIB2__, NIB1__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x418 */ { 0x074, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x41a */ { 0x096, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x41c */ { 0x0f2, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x41e */ { 0x08a, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x420 */ { 0x054, { NIB2__, NIB1__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x422 */ { 0x05c, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x424 */ { 0x0c2, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x426 */ { 0x026, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x428 */ { 0x088, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x42a */ { 0x08c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x42c */ { 0x09c, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x42e */ { 0x01a, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x430 */ { INPUT_PORT_B, { NIB1__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $4430 $00F0 --A- ... 0 -/* 0x432 */ { 0x000, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x434 */ { 0x0d4, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x436 */ { 0x078, { NIB1__, NIB0__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x438 */ { 0x070, { NIB3__, NIB2__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x43a */ { 0x05e, { NIB2__, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x43c */ { 0x0f6, { NIB1__, NIB0__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x43e */ { 0x082, { BLANK_, BLANK_, BLANK_, NIB3__ }, 0, 1 }, -/* 0x440 */ { 0x03e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x442 */ { 0x0a6, { NIB3__, NIB2__, NIB1__, NIB0__ }, 0, 0 }, -/* 0x444 */ { 0x0b0, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x446 */ { 0x0de, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x448 */ { 0x0b6, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x44a */ { 0x002, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x44c */ { 0x090, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x44e */ { 0x06e, { NIB3__, NIB1__, NIB2__, NIB0__ }, 1, 1 }, -/* 0x450 */ { 0x0a0, { BLANK_, BLANK_, BLANK_, NIB3__ }, 1, 1 }, -/* 0x452 */ { 0x0c8, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x454 */ { 0x0f8, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x456 */ { 0x024, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x458 */ { 0x0b6, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x45a */ { 0x070, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x45c */ { 0x0ee, { BLANK_, BLANK_, BLANK_, NIB3__ }, 1, 0 }, -/* 0x45e */ { 0x0b4, { NIB2__, NIB3__, NIB1__, NIB0__ }, 1, 0 }, -/* 0x460 */ { 0x0ca, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x462 */ { 0x01e, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x464 */ { 0x052, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x466 */ { 0x048, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x468 */ { 0x02a, { NIB1__, NIB0__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x46a */ { 0x02c, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x46c */ { 0x0a8, { NIB2__, NIB1__, NIB0__, NIB3__ }, 1, 1 }, -/* 0x46e */ { 0x010, { BLANK_, NIB3__, BLANK_, NIB2__ }, 0, 0 }, -/* 0x470 */ { 0x0ce, { NIB1__, NIB3__, NIB0__, NIB2__ }, 0, 1 }, -/* 0x472 */ { 0x078, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x474 */ { 0x066, { NIB2__, NIB1__, BLANK_, NIB3__ }, 1, 1 }, -/* 0x476 */ { 0x05a, { NIB2__, NIB1__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x478 */ { INPUT_PORT_C, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 0 }, // $4478 $FFFF CDAB ... 0 (fghthist) - verify -/* 0x47a */ { 0x014, { NIB1__, NIB0__, NIB3__, NIB2__ }, 1, 0 }, -/* 0x47c */ { 0x0e8, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x47e */ { 0x0b8, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x480 */ { 0x0e0, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x482 */ { 0x012, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x484 */ { 0x058, { NIB2__, NIB1__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x486 */ { 0x036, { NIB0__, NIB3__, NIB2__, NIB1__ }, 0, 1 }, -/* 0x488 */ { INPUT_PORT_A, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 0 },// $4488 $FFFF CDAB ... 0 -/* 0x48a */ { 0x07a, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x48c */ { 0x072, { NIB2__, NIB1__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x48e */ { 0x0c6, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x490 */ { 0x0bc, { NIB2__, NIB1__, NIB0__, NIB3__ }, 1, 0 }, -/* 0x492 */ { 0x0fa, { NIB2__, NIB3__, NIB1__, NIB0__ }, 1, 1 }, -/* 0x494 */ { 0x0f4, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x496 */ { 0x046, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x498 */ { 0x0b2, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x49a */ { 0x004, { NIB3__, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x49c */ { 0x07e, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x49e */ { 0x04e, { NIB1__, NIB2__, NIB0__, NIB3__ }, 1, 1 }, -/* 0x4a0 */ { 0x0e2, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x4a2 */ { 0x094, { NIB2__, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x4a4 */ { 0x0ae, { BLANK_, NIB2__, NIB3__, NIB1__ }, 1, 0 }, -/* 0x4a6 */ { 0x0a8, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x4a8 */ { 0x092, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x4aa */ { 0x0da, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x4ac */ { 0x080, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x4ae */ { 0x078, { NIB2__, NIB1__, BLANK_, NIB3__ }, 0, 0 }, -/* 0x4b0 */ { 0x0be, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x4b2 */ { 0x04c, { NIB2__, NIB0__, NIB1__, NIB3__ }, 1, 0 }, -/* 0x4b4 */ { 0x032, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x4b6 */ { 0x0fe, { NIB2__, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x4b8 */ { 0x030, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x4ba */ { 0x0dc, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x4bc */ { 0x030, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x4be */ { 0x02e, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x4c0 */ { INPUT_PORT_C, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 },// $44C0 $F000 A--- ... 0 -/* 0x4c2 */ { 0x03c, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x4c4 */ { 0x08c, { NIB0__, NIB2__, NIB3__, NIB1__ }, 1, 0 }, -/* 0x4c6 */ { 0x028, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x4c8 */ { 0x03e, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x4ca */ { 0x0d0, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x4cc */ { 0x0d4, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x4ce */ { 0x062, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x4d0 */ { 0x076, { NIB2__, NIB1__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x4d2 */ { 0x00e, { BLANK_, NIB3__, BLANK_, NIB2__ }, 1, 1 }, -/* 0x4d4 */ { 0x038, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x4d6 */ { 0x0dc, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x4d8 */ { 0x0e6, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x4da */ { 0x00c, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x4dc */ { 0x0a4, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x4de */ { 0x0c0, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x4e0 */ { INPUT_PORT_B, { NIB0__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $44E0 $000F ---A ... 0 -/* 0x4e2 */ { 0x0ba, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x4e4 */ { 0x0ea, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x4e6 */ { 0x0ec, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x4e8 */ { 0x022, { NIB3__, NIB2__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x4ea */ { 0x078, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x4ec */ { 0x0a2, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x4ee */ { 0x068, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x4f0 */ { 0x050, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x4f2 */ { INPUT_PORT_B, { NIB1__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $44F2 $00F0 --A- ... 0 -/* 0x4f4 */ { 0x074, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x4f6 */ { 0x060, { BLANK_, NIB2__, NIB3__, NIB1__ }, 0, 1 }, -/* 0x4f8 */ { 0x040, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x4fa */ { 0x0f2, { NIB3__, NIB2__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x4fc */ { 0x064, { NIB2__, NIB1__, BLANK_, NIB3__ }, 0, 1 }, -/* 0x4fe */ { 0x084, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x500 */ { 0x016, { NIB3__, NIB0__, NIB2__, NIB1__ }, 0, 0 }, -/* 0x502 */ { 0x04a, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x504 */ { 0x018, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x506 */ { 0x084, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x508 */ { 0x034, { NIB0__, NIB3__, NIB2__, NIB1__ }, 1, 1 }, -/* 0x50a */ { INPUT_PORT_B, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // // $450A $F000 A--- ... 0 -/* 0x50c */ { 0x08e, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 1 }, -/* 0x50e */ { 0x00a, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x510 */ { 0x0ac, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x512 */ { 0x0d2, { NIB2__, NIB1__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x514 */ { 0x06a, { NIB2__, NIB1__, BLANK_, NIB3__ }, 1, 0 }, -/* 0x516 */ { 0x0b0, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x518 */ { 0x0aa, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x51a */ { 0x09e, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 1 }, -/* 0x51c */ { 0x044, { NIB0__, NIB3__, NIB2__, NIB1__ }, 1, 0 }, -/* 0x51e */ { 0x0e4, { BLANK_, BLANK_, BLANK_, NIB3__ }, 0, 0 }, -/* 0x520 */ { 0x042, { NIB1__, NIB3__, NIB0__, NIB2__ }, 0, 0 }, -/* 0x522 */ { 0x020, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x524 */ { 0x056, { BLANK_, NIB3__, BLANK_, NIB2__ }, 1, 0 }, -/* 0x526 */ { 0x078, { NIB2__, NIB0__, NIB1__, NIB3__ }, 1, 1 }, -/* 0x528 */ { 0x0ea, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x52a */ { 0x004, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x52c */ { INPUT_PORT_A, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 0 },// $452C $FFFF DCBA X.. 1 -/* 0x52e */ { 0x060, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x530 */ { 0x0f0, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x532 */ { 0x052, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x534 */ { 0x09c, { NIB0__, NIB1__, NIB3__, NIB2__ }, 1, 0 }, -/* 0x536 */ { 0x072, { NIB1__, NIB2__, NIB0__, NIB3__ }, 0, 0 }, -/* 0x538 */ { 0x038, { NIB2__, NIB1__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x53a */ { 0x036, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x53c */ { 0x0de, { NIB2__, NIB0__, NIB1__, NIB3__ }, 0, 1 }, -/* 0x53e */ { 0x0de, { NIB1__, NIB3__, NIB0__, NIB2__ }, 1, 1 }, -/* 0x540 */ { 0x01e, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x542 */ { 0x092, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x544 */ { 0x040, { NIB1__, NIB0__, NIB3__, NIB2__ }, 1, 0 }, -/* 0x546 */ { 0x04c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x548 */ { 0x06c, { BLANK_, NIB3__, BLANK_, NIB2__ }, 0, 1 }, -/* 0x54a */ { 0x0fe, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x54c */ { 0x068, { NIB0__, NIB3__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x54e */ { 0x060, { NIB2__, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x550 */ { 0x08e, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x552 */ { 0x008, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x554 */ { 0x006, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x556 */ { 0x0d6, { NIB0__, NIB2__, NIB3__, NIB1__ }, 1, 1 }, -/* 0x558 */ { 0x06a, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x55a */ { 0x0be, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x55c */ { INPUT_PORT_A, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 1 },// $455C $FFFF DCBA .N. 1 -/* 0x55e */ { 0x0fc, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x560 */ { 0x0fc, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x562 */ { 0x078, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x564 */ { INPUT_PORT_C, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 0 }, // // $4564 $FFFF CDBA ... 0 -/* 0x566 */ { 0x0a4, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x568 */ { 0x0c6, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x56a */ { 0x0ca, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 0 }, -/* 0x56c */ { 0x08c, { NIB0__, NIB3__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x56e */ { 0x042, { NIB3__, NIB2__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x570 */ { 0x05c, { NIB1__, NIB2__, BLANK_, NIB3__ }, 1, 1 }, -/* 0x572 */ { 0x0a0, { BLANK_, BLANK_, BLANK_, NIB3__ }, 0, 1 }, -/* 0x574 */ { 0x04c, { NIB3__, NIB1__, NIB2__, NIB0__ }, 0, 0 }, -/* 0x576 */ { 0x04a, { NIB2__, NIB1__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x578 */ { 0x0d8, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x57a */ { 0x094, { NIB2__, NIB1__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x57c */ { 0x002, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x57e */ { 0x020, { NIB0__, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x580 */ { 0x088, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x582 */ { 0x0b6, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x584 */ { 0x054, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x586 */ { 0x0b8, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x588 */ { 0x014, { NIB3__, NIB2__, NIB1__, NIB0__ }, 0, 1 }, -/* 0x58a */ { 0x05a, { NIB3__, NIB1__, NIB2__, NIB0__ }, 1, 0 }, -/* 0x58c */ { 0x0e0, { BLANK_, NIB3__, BLANK_, NIB2__ }, 0, 0 }, -/* 0x58e */ { 0x0c8, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 0 }, -/* 0x590 */ { 0x07a, { NIB1__, NIB2__, NIB0__, NIB3__ }, 1, 0 }, -/* 0x592 */ { 0x062, { NIB1__, NIB0__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x594 */ { 0x0f6, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x596 */ { 0x0bc, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x598 */ { 0x07c, { NIB2__, NIB1__, NIB0__, NIB3__ }, 1, 1 }, -/* 0x59a */ { 0x09a, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x59c */ { 0x0ce, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x59e */ { 0x078, { NIB3__, NIB0__, NIB2__, NIB1__ }, 1, 0 }, -/* 0x5a0 */ { 0x03c, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x5a2 */ { 0x0f2, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x5a4 */ { 0x006, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x5a6 */ { 0x03a, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x5a8 */ { 0x0b0, { NIB3__, NIB2__, NIB1__, NIB0__ }, 0, 0 }, -/* 0x5aa */ { 0x0cc, { NIB3__, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x5ac */ { 0x02a, { NIB1__, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x5ae */ { 0x08a, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x5b0 */ { 0x0f8, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x5b2 */ { 0x024, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x5b4 */ { 0x05e, { NIB1__, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x5b6 */ { 0x0e4, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x5b8 */ { 0x0b4, { NIB1__, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x5ba */ { 0x016, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x5bc */ { 0x06e, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x5be */ { 0x096, { NIB3__, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x5c0 */ { 0x0ee, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x5c2 */ { 0x010, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x5c4 */ { 0x0fa, { NIB1__, NIB2__, BLANK_, NIB3__ }, 0, 0 }, -/* 0x5c6 */ { 0x0c6, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x5c8 */ { INPUT_PORT_B, { NIB0R1, BLANK_, BLANK_, BLANK_ }, 1, 0 },//// $45C8 $000F ---A X.. 1 -/* 0x5ca */ { 0x0c4, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x5cc */ { 0x032, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x5ce */ { 0x00e, { NIB2__, NIB1__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x5d0 */ { 0x036, { NIB0__, NIB1__, NIB3__, NIB2__ }, 1, 1 }, -/* 0x5d2 */ { 0x0ba, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x5d4 */ { 0x034, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x5d6 */ { 0x0e4, { NIB1__, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x5d8 */ { 0x056, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x5da */ { 0x078, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x5dc */ { 0x044, { NIB0__, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x5de */ { 0x016, { NIB1__, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x5e0 */ { 0x084, { NIB0__, NIB3__, NIB2__, NIB1__ }, 0, 0 }, -/* 0x5e2 */ { 0x086, { NIB0__, NIB2__, NIB3__, NIB1__ }, 1, 0 }, -/* 0x5e4 */ { INPUT_PORT_B, { NIB0R2, BLANK_, BLANK_, BLANK_ }, 1, 0 }, // // $45E4 $000F ---A X.. 2 -/* 0x5e6 */ { 0x0d8, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 0 }, -/* 0x5e8 */ { 0x0f6, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x5ea */ { 0x0b8, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x5ec */ { 0x0dc, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x5ee */ { 0x0cc, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x5f0 */ { 0x02c, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x5f2 */ { 0x012, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x5f4 */ { 0x018, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x5f6 */ { 0x07e, { NIB0__, NIB2__, NIB3__, NIB1__ }, 0, 1 }, -/* 0x5f8 */ { 0x066, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x5fa */ { 0x0ea, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x5fc */ { 0x0d0, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x5fe */ { 0x0ac, { NIB3__, NIB2__, NIB1__, NIB0__ }, 1, 0 }, -/* 0x600 */ { 0x0a8, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x602 */ { 0x092, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x604 */ { 0x034, { NIB1__, NIB2__, BLANK_, NIB3__ }, 1, 0 }, -/* 0x606 */ { 0x0e6, { NIB0__, NIB3__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x608 */ { 0x048, { NIB2__, NIB1__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x60a */ { 0x0e2, { NIB0__, NIB3__, NIB2__, NIB1__ }, 0, 1 }, -/* 0x60c */ { 0x0a6, { NIB2__, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x60e */ { 0x0da, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x610 */ { 0x0c0, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x612 */ { 0x0b2, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x614 */ { 0x046, { NIB1__, NIB2__, NIB0__, NIB3__ }, 0, 0 }, -/* 0x616 */ { 0x078, { NIB1__, NIB3__, NIB0__, NIB2__ }, 0, 1 }, -/* 0x618 */ { 0x070, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x61a */ { 0x0d4, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x61c */ { 0x09e, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 1 }, -/* 0x61e */ { 0x028, { NIB2__, NIB3__, NIB1__, NIB0__ }, 1, 1 }, -/* 0x620 */ { INPUT_PORT_C, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 0 },// $4620 $FFFF CBAD ... 0 -/* 0x622 */ { 0x090, { NIB2__, NIB1__, BLANK_, NIB3__ }, 1, 0 }, -/* 0x624 */ { 0x0c2, { NIB3__, NIB0__, NIB2__, NIB1__ }, 1, 0 }, -/* 0x626 */ { 0x0f4, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x628 */ { 0x0a4, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x62a */ { 0x03e, { NIB1__, NIB0__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x62c */ { 0x058, { NIB1__, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x62e */ { 0x064, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x630 */ { 0x01c, { NIB0__, NIB1__, NIB3__, NIB2__ }, 1, 1 }, -/* 0x632 */ { 0x02e, { BLANK_, BLANK_, BLANK_, NIB3__ }, 0, 0 }, -/* 0x634 */ { 0x04e, { NIB2__, NIB0__, NIB1__, NIB3__ }, 1, 0 }, -/* 0x636 */ { 0x018, { NIB2__, NIB3__, NIB1__, NIB0__ }, 0, 0 }, -/* 0x638 */ { 0x0a2, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x63a */ { 0x088, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x63c */ { INPUT_PORT_A, { NIB0__, NIB1__, NIB2__, NIB3__ }, 1, 0 }, // $463C $FFFF DCBA X.. 0 -/* 0x63e */ { 0x0da, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x640 */ { 0x022, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x642 */ { 0x030, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x644 */ { 0x000, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x646 */ { INPUT_PORT_A, { NIB1__, NIB2__, NIB3__, BLANK_ }, 0, 0 },// $4646 $FFF0 CBA- ..B 0 -/* 0x648 */ { 0x00a, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x64a */ { 0x074, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x64c */ { 0x0ae, { NIB1__, NIB2__, BLANK_, NIB3__ }, 0, 1 }, -/* 0x64e */ { 0x05c, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x650 */ { 0x01a, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x652 */ { 0x078, { NIB2__, NIB3__, NIB1__, NIB0__ }, 0, 0 }, -/* 0x654 */ { INPUT_PORT_C, { NIB1__, NIB0__, NIB2__, NIB3__ }, 0, 0 },// $4654 $FFFF DCAB ... 0 -/* 0x656 */ { 0x0c0, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x658 */ { 0x0aa, { NIB0__, NIB3__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x65a */ { INPUT_PORT_C, { NIB2__, NIB3__, NIB0__, NIB1__ }, 0, 0 },// $465A $FFFF BADC ... 0 -/* 0x65c */ { 0x0e8, { NIB2__, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x65e */ { 0x0d2, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x660 */ { 0x0f4, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x662 */ { 0x010, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x664 */ { 0x080, { NIB0__, NIB3__, NIB2__, NIB1__ }, 1, 1 }, -/* 0x666 */ { 0x00c, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x668 */ { 0x050, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x66a */ { 0x04a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x66c */ { 0x09a, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x66e */ { 0x06e, { NIB2__, NIB1__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x670 */ { INPUT_PORT_A, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // $4670 $F000 A--- ..B 0 -/* 0x672 */ { 0x072, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x674 */ { 0x074, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x676 */ { 0x0ba, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x678 */ { 0x0c2, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x67a */ { 0x092, { NIB2__, NIB1__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x67c */ { 0x01e, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x67e */ { 0x082, { NIB2__, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x680 */ { 0x036, { NIB2__, NIB1__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x682 */ { 0x084, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x684 */ { 0x016, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x686 */ { 0x0d8, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x688 */ { 0x086, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x68a */ { 0x028, { BLANK_, NIB3__, BLANK_, NIB2__ }, 0, 0 }, -/* 0x68c */ { 0x040, { NIB3__, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x68e */ { 0x078, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x690 */ { 0x046, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x692 */ { 0x02e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x694 */ { 0x0ea, { NIB1__, NIB0__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x696 */ { 0x09a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x698 */ { 0x068, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x69a */ { 0x0d4, { NIB1__, NIB2__, BLANK_, NIB3__ }, 1, 1 }, -/* 0x69c */ { 0x070, { NIB3__, NIB2__, NIB1__, NIB0__ }, 1, 1 }, -/* 0x69e */ { 0x07c, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x6a0 */ { 0x0f6, { NIB2__, NIB0__, NIB1__, NIB3__ }, 0, 0 }, -/* 0x6a2 */ { 0x0e8, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x6a4 */ { 0x056, { BLANK_, NIB2__, NIB3__, NIB1__ }, 0, 1 }, -/* 0x6a6 */ { 0x0d2, { NIB1__, NIB0__, NIB3__, NIB2__ }, 1, 1 }, -/* 0x6a8 */ { 0x026, { BLANK_, BLANK_, BLANK_, NIB3__ }, 1, 1 }, -/* 0x6aa */ { 0x0a8, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x6ac */ { 0x0c6, { NIB3__, NIB1__, NIB2__, NIB0__ }, 1, 1 }, -/* 0x6ae */ { 0x0be, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x6b0 */ { 0x062, { NIB1__, NIB0__, NIB3__, NIB2__ }, 0, 1 }, -/* 0x6b2 */ { 0x094, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x6b4 */ { 0x0ae, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x6b6 */ { 0x006, { NIB3__, NIB2__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x6b8 */ { 0x0a4, { BLANK_, NIB3__, BLANK_, NIB2__ }, 1, 1 }, -/* 0x6ba */ { 0x050, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x6bc */ { 0x0f2, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x6be */ { 0x07a, { NIB2R1, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x6c0 */ { 0x06c, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x6c2 */ { 0x00e, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x6c4 */ { 0x054, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x6c6 */ { 0x07e, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x6c8 */ { 0x018, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x6ca */ { 0x078, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x6cc */ { 0x01a, { NIB3__, NIB2__, NIB1__, NIB0__ }, 0, 1 }, -/* 0x6ce */ { 0x0de, { NIB2__, NIB1__, BLANK_, NIB3__ }, 0, 0 }, -/* 0x6d0 */ { 0x04a, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x6d2 */ { 0x08c, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x6d4 */ { 0x014, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x6d6 */ { 0x0cc, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x6d8 */ { 0x00a, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x6da */ { 0x002, { NIB0__, NIB3__, NIB2__, NIB1__ }, 1, 0 }, -/* 0x6dc */ { 0x05a, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x6de */ { 0x0aa, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x6e0 */ { 0x090, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x6e2 */ { 0x03c, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x6e4 */ { 0x080, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x6e6 */ { 0x044, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x6e8 */ { 0x072, { BLANK_, NIB2__, NIB3__, NIB1__ }, 1, 1 }, -/* 0x6ea */ { 0x098, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x6ec */ { 0x038, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 0, 0 }, -/* 0x6ee */ { 0x04c, { NIB2__, NIB1__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x6f0 */ { 0x022, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x6f2 */ { 0x000, { NIB0__, NIB2__, NIB3__, NIB1__ }, 0, 0 }, -/* 0x6f4 */ { 0x0fa, { NIB3__, NIB0__, NIB2__, NIB1__ }, 0, 1 }, -/* 0x6f6 */ { 0x00c, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x6f8 */ { INPUT_PORT_A, { NIB2__, NIB3__, NIB0__, NIB1__,}, 0, 0 }, // $46F8 $FFFF BADC ... 0 (edrandy) -/* 0x6fa */ { 0x004, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x6fc */ { 0x066, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x6fe */ { 0x08a, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x700 */ { 0x0b0, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x702 */ { 0x012, { BLANK_, NIB2__, NIB3__, NIB1__ }, 1, 0 }, -/* 0x704 */ { 0x066, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x706 */ { 0x078, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x708 */ { 0x02c, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x70a */ { 0x09c, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x70c */ { 0x0bc, { NIB2__, NIB3__, NIB1__, NIB0__ }, 1, 0 }, -/* 0x70e */ { 0x004, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x710 */ { 0x0ca, { NIB3__, NIB2__, NIB1__, NIB0__ }, 0, 0 }, -/* 0x712 */ { INPUT_PORT_B, { NIB0R1, BLANK_, BLANK_, BLANK_ }, 0, 1 }, // // $4712 $000F ---A .N. 1 -/* 0x714 */ { 0x00a, { NIB1R1, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x716 */ { INPUT_PORT_A, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 0 },// $4716 $FFFF DCBA ... 1 -/* 0x718 */ { 0x0a2, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 1, 1 }, -/* 0x71a */ { 0x0ac, { NIB1__, NIB2__, NIB0__, NIB3__ }, 1, 1 }, -/* 0x71c */ { 0x0ce, { NIB3__, NIB1__, NIB2__, NIB0__ }, 0, 0 }, -/* 0x71e */ { 0x08e, { NIB2__, NIB1__, NIB0__, NIB3__ }, 1, 1 }, -/* 0x720 */ { 0x034, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x722 */ { INPUT_PORT_C, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 0, 0 },// $4722 $FFFF DCBA ... 0 -/* 0x724 */ { 0x0d6, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x726 */ { 0x0fc, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x728 */ { 0x0b6, { NIB1__, NIB3__, NIB0__, NIB2__ }, 1, 0 }, -/* 0x72a */ { 0x0ec, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x72c */ { 0x094, { NIB3__, NIB1__, NIB2__, NIB0__ }, 0, 1 }, -/* 0x72e */ { INPUT_PORT_A, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 0, 0 }, // $472E $FFFF DCBA ... 3 -/* 0x730 */ { 0x02e, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 0, 0 }, -/* 0x732 */ { 0x09e, { NIB3R1, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x734 */ { 0x05c, { NIB1__, NIB0__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x736 */ { 0x042, { NIB3__, NIB0__, NIB2__, NIB1__ }, 1, 1 }, -/* 0x738 */ { 0x0d0, { NIB1__, NIB3__, NIB0__, NIB2__ }, 1, 1 }, -/* 0x73a */ { 0x0f0, { NIB3__, NIB2__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x73c */ { 0x0e4, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x73e */ { 0x04e, { NIB3R2, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x740 */ { 0x0cc, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x742 */ { 0x078, { NIB3R2, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x744 */ { 0x010, { NIB0__, NIB1__, NIB3__, NIB2__ }, 1, 0 }, -/* 0x746 */ { 0x0b8, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x748 */ { 0x0c4, { NIB2__, NIB1__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x74a */ { 0x052, { NIB2R1, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x74c */ { 0x06a, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x74e */ { 0x064, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x750 */ { 0x0da, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x752 */ { 0x076, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x754 */ { 0x03e, { NIB3__, NIB0__, NIB2__, NIB1__ }, 1, 1 }, -/* 0x756 */ { INPUT_PORT_C, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 0 },// $4756 $FFFF ADCB ... 0 -/* 0x758 */ { 0x0fe, { BLANK_, BLANK_, BLANK_, NIB3__ }, 1, 0 }, -/* 0x75a */ { 0x058, { NIB2__, NIB1__, NIB0__, NIB3__ }, 0, 0 }, -/* 0x75c */ { 0x02a, { BLANK_, NIB3__, BLANK_, NIB2__ }, 1, 0 }, -/* 0x75e */ { 0x060, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x760 */ { 0x0f4, { NIB2__, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x762 */ { 0x082, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x764 */ { 0x008, { NIB2R2, NIB3__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x766 */ { INPUT_PORT_A, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 0 }, // $4766 $FFFF CDBA ... 0 -/* 0x768 */ { 0x0c8, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 1, 0 }, -/* 0x76a */ { INPUT_PORT_B, { NIB0__, BLANK_, BLANK_, BLANK_ }, 0, 0 }, // $476A $000F ---A ... 0 (standard i/o read shanghai) -/* 0x76c */ { 0x088, { NIB3__, NIB2__, NIB0__, NIB1__ }, 0, 1 }, -/* 0x76e */ { 0x06e, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x770 */ { 0x01c, { BLANK_, BLANK_, BLANK_, NIB3__ }, 0, 1 }, -/* 0x772 */ { 0x0d6, { NIB2R3, NIB3__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x774 */ { 0x0e0, { BLANK_, NIB3__, BLANK_, NIB2__ }, 0, 1 }, -/* 0x776 */ { 0x020, { NIB1__, NIB2__, BLANK_, NIB3__ }, 0, 0 }, -/* 0x778 */ { 0x0a6, { NIB2__, NIB1__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x77a */ { 0x030, { NIB3R3, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x77c */ { 0x0fa, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x77e */ { 0x078, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x780 */ { 0x0c0, { BLANK_, NIB2__, NIB3__, NIB1__ }, 0, 0 }, -/* 0x782 */ { 0x0b2, { NIB1R1, NIB2__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x784 */ { 0x0e2, { NIB3__, NIB2__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x786 */ { 0x024, { BLANK_, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x788 */ { INPUT_PORT_C, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 0 },// $4788 $FFFF DCBA ... 2 -/* 0x78a */ { 0x05e, { NIB1__, NIB2__, NIB3__, BLANK_ }, 0, 1 }, -/* 0x78c */ { 0x03a, { NIB0__, NIB3__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x78e */ { 0x032, { NIB1R2, NIB2__, NIB3__, NIB0__ }, 1, 1 }, -/* 0x790 */ { INPUT_PORT_A, { NIB3__, NIB1__, NIB2__, NIB0__ }, 0, 0 }, // $4790 $FFFF ACBD ... 0 -/* 0x792 */ { 0x0e6, { NIB0__, NIB1__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x794 */ { 0x096, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x796 */ { 0x0ee, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x798 */ { 0x0f8, { NIB3R3, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x79a */ { 0x0b4, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x79c */ { 0x096, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 0, 0 }, -/* 0x79e */ { 0x0a0, { NIB1__, NIB2__, NIB3__, BLANK_ }, 1, 1 }, -/* 0x7a0 */ { 0x0a0, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 0, 1 }, -/* 0x7a2 */ { 0x048, { NIB2__, NIB1__, BLANK_, NIB3__ }, 0, 1 }, -/* 0x7a4 */ { 0x0f6, { NIB2__, NIB0__, NIB1__, NIB3__ }, 0, 1 }, -/* 0x7a6 */ { 0x006, { NIB2__, NIB1__, NIB0__, NIB3__ }, 1, 0 }, -/* 0x7a8 */ { 0x0de, { NIB2__, NIB1__, NIB0__, NIB3__ }, 0, 1 }, -/* 0x7aa */ { 0x0cc, { NIB3__, NIB0__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x7ac */ { 0x0a4, { NIB1__, NIB3__, NIB0__, NIB2__ }, 0, 1 }, -/* 0x7ae */ { 0x07c, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 1 }, -/* 0x7b0 */ { 0x0ce, { NIB1R3, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x7b2 */ { 0x0ba, { NIB3__, NIB0__, NIB1__, NIB2__ }, 1, 0 }, -/* 0x7b4 */ { 0x01e, { NIB0__, NIB3__, NIB1__, NIB2__ }, 0, 1 }, -/* 0x7b6 */ { 0x0da, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 1 }, -/* 0x7b8 */ { 0x0aa, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 0, 0 }, -/* 0x7ba */ { 0x078, { NIB1R3, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x7bc */ { 0x076, { NIB2__, NIB3__, NIB0__, NIB1__ }, 0, 0 }, -/* 0x7be */ { 0x0b6, { NIB3__, NIB2__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x7c0 */ { 0x058, { NIB1__, NIB3__, NIB0__, NIB2__ }, 0, 0 }, -/* 0x7c2 */ { 0x050, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x7c4 */ { 0x060, { NIB0R3, NIB1__, NIB2__, NIB3__ }, 1, 1 }, -/* 0x7c6 */ { 0x05e, { NIB0__, NIB2__, NIB3__, NIB1__ }, 1, 1 }, -/* 0x7c8 */ { 0x094, { NIB2R2, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x7ca */ { 0x000, { NIB3__, NIB2__, NIB0__, NIB1__ }, 1, 0 }, -/* 0x7cc */ { 0x03e, { BLANK_, NIB3__, BLANK_, BLANK_ }, 1, 0 }, -/* 0x7ce */ { INPUT_PORT_C, { NIB0R1, NIB1__, NIB2__, NIB3__ }, 0, 0 }, // $47CE $FFFF DCBA ... 1 -/* 0x7d0 */ { 0x0d0, { NIB3__, NIB0__, NIB2__, NIB1__ }, 0, 0 }, -/* 0x7d2 */ { 0x0be, { NIB3R1, NIB0__, NIB1__, NIB2__ }, 1, 1 }, -/* 0x7d4 */ { 0x00c, { NIB1R2, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x7d6 */ { INPUT_PORT_A, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 1, 0 },// $47D6 $FFFF DCBA X.. 2 -/* 0x7d8 */ { 0x01a, { NIB2R3, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x7da */ { 0x0e6, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x7dc */ { 0x0d6, { NIB1__, NIB2__, NIB3__, BLANK_ }, 0, 0 }, -/* 0x7de */ { 0x05c, { NIB1__, NIB2__, NIB0__, NIB3__ }, 1, 0 }, -/* 0x7e0 */ { 0x00a, { NIB2__, NIB0__, NIB1__, NIB3__ }, 1, 1 }, -/* 0x7e2 */ { 0x0c4, { NIB1__, NIB0__, NIB2__, NIB3__ }, 1, 0 }, -/* 0x7e4 */ { 0x0e4, { NIB3__, BLANK_, BLANK_, BLANK_ }, 1, 0 }, -/* 0x7e6 */ { 0x0a6, { NIB3__, NIB1__, NIB2__, NIB0__ }, 1, 0 }, -/* 0x7e8 */ { 0x058, { NIB0__, NIB1__, NIB2__, NIB3__ }, 0, 0 }, -/* 0x7ea */ { 0x040, { NIB0__, NIB1__, NIB3__, NIB2__ }, 0, 0 }, -/* 0x7ec */ { 0x046, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x7ee */ { 0x0ea, { NIB2__, NIB3__, BLANK_, BLANK_ }, 1, 1 }, -/* 0x7f0 */ { 0x090, { NIB2__, NIB1__, BLANK_, NIB3__ }, 1, 1 }, -/* 0x7f2 */ { 0x08e, { NIB1__, NIB2__, NIB3__, NIB0__ }, 0, 1 }, -/* 0x7f4 */ { INPUT_PORT_A, { NIB0R2, NIB1__, NIB2__, NIB3__ }, 0, 1 }, // // $47F4 $FFFF DCBA .N. 2 -/* 0x7f6 */ { 0x078, { NIB3__, BLANK_, BLANK_, BLANK_ }, 0, 1 }, -/* 0x7f8 */ { 0x004, { NIB2__, NIB1__, NIB3__, BLANK_ }, 1, 0 }, -/* 0x7fa */ { 0x02e, { NIB2__, NIB3__, NIB1__, NIB0__ }, 0, 1 }, -/* 0x7fc */ { 0x06e, { NIB1__, NIB0__, NIB3__, NIB2__ }, 1, 0 }, -/* 0x7fe */ { 0x04c, { NIB1__, NIB2__, NIB0__, NIB3__ }, 0, 1 } -}; - -deco146port_xx port_table_104[] = { - /* 0x000 */ { 0x04, { NIB3__, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x002 */ { 0x2a, { NIB1__, NIB3__, NIB0__, NIB2__ } , 0, 1 }, - /* 0x004 */ { 0x5e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x006 */ { 0x98, { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x008 */ { 0x94, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x00a */ { 0xbe, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x00c */ { 0xd6, { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x00e */ { 0xe4, { NIB0__, NIB3__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x010 */ { 0x90, { NIB3__, NIB2__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x012 */ { 0xa8, { NIB3__, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x014 */ { 0x24, { NIB2__, NIB1__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x016 */ { 0xfc, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x018 */ { 0x08, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x01a */ { INPUT_PORT_C , { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 0 }, // dc.w $001A ; 0x0010 - /* 0x01c */ { 0x72, { NIB2__, NIB1__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x01e */ { 0xc4, { NIB0__, NIB1__, NIB3__, NIB2__ } , 1, 1 }, - /* 0x020 */ { 0xd0, { NIB2__, NIB1__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x022 */ { 0x66, { NIB1__, NIB2__, NIB0__, NIB3__ } , 1, 1 }, - /* 0x024 */ { 0x8c, { NIB3__, NIB2__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x026 */ { 0xec, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x028 */ { 0x58, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x02a */ { 0x80, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x02c */ { 0x82, { NIB0__, NIB3__, NIB2__, NIB1__ } , 0, 1 }, - /* 0x02e */ { 0x6a, { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x030 */ { 0x00, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x032 */ { 0x60, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x034 */ { INPUT_PORT_B , { NIB0R3, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x036 */ { 0xae, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x038 */ { 0x12, { NIB3__, NIB0__, NIB2__, NIB1__ } , 0, 0 }, - /* 0x03a */ { 0x42, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x03c */ { 0x1e, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x03e */ { 0xf6, { NIB1__, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x040 */ { 0xdc, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x042 */ { 0x34, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x044 */ { 0x2c, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x046 */ { 0x7a, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x048 */ { 0x10, { NIB1__, NIB2__, BLANK_, NIB3__ } , 0, 0 }, - /* 0x04a */ { 0x9e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x04c */ { 0x3e, { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x04e */ { 0x0e, { NIB2__, NIB1__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x050 */ { 0xa4, { BLANK_, NIB3__, BLANK_, NIB2__ } , 0, 1 }, - /* 0x052 */ { 0x0c, { BLANK_, NIB2__, NIB3__, NIB1__ } , 1, 0 }, - /* 0x054 */ { 0x40, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x056 */ { 0x20, { NIB1__, NIB0__, NIB3__, NIB2__ } , 1, 1 }, - /* 0x058 */ { 0x46, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x05a */ { 0x6c, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x05c */ { 0x9a, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x05e */ { 0x18, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x060 */ { 0xe0, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x062 */ { 0x30, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x064 */ { 0xca, { NIB2__, NIB1__, NIB0__, NIB3__ } , 0, 1 }, - /* 0x066 */ { 0xac, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x068 */ { 0xe8, { NIB2__, NIB1__, BLANK_, NIB3__ } , 0, 0 }, - /* 0x06a */ { 0x66, { NIB3__, NIB2__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x06c */ { 0x14, { NIB2__, NIB1__, NIB0__, NIB3__ } , 0, 0 }, - /* 0x06e */ { 0x96, { NIB0__, NIB3__, NIB2__, NIB1__ } , 1, 0 }, - /* 0x070 */ { 0x5c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x072 */ { 0x0a, { NIB0__, NIB2__, NIB3__, NIB1__ } , 0, 1 }, - /* 0x074 */ { INPUT_PORT_B , { NIB0R1, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x076 */ { INPUT_PORT_C , { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, // dc.w $0076 ; 0x1000 dc.w $0076 ; 0x1000 ; nand - /* 0x078 */ { 0x5a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x07a */ { 0x74, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x07c */ { 0xb4, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x07e */ { 0x86, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x080 */ { 0x84, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x082 */ { 0x28, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x084 */ { 0x50, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x086 */ { 0x66, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x088 */ { INPUT_PORT_A , { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, // dc.w $0088 - /* 0x08a */ { 0x1c, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x08c */ { 0x48, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x08e */ { 0xc2, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x090 */ { 0x44, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x092 */ { 0x3c, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x094 */ { 0xfa, { NIB1__, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x096 */ { 0x22, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x098 */ { 0xf0, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x09a */ { 0x2e, { BLANK_, NIB3__, BLANK_, NIB2__ } , 1, 0 }, - /* 0x09c */ { 0x06, { NIB0__, NIB3__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x09e */ { 0x64, { NIB3__, NIB1__, NIB2__, NIB0__ } , 1, 0 }, - /* 0x0a0 */ { 0xcc, { NIB2__, NIB1__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x0a2 */ { 0x7a, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x0a4 */ { 0xb2, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x0a6 */ { 0xbe, { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x0a8 */ { 0xde, { NIB0__, NIB3__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x0aa */ { 0xf8, { NIB2__, NIB1__, NIB0__, NIB3__ } , 1, 0 }, - /* 0x0ac */ { 0xca, { NIB2__, NIB3__, NIB1__, NIB0__ } , 1, 0 }, - /* 0x0ae */ { 0x3e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x0b0 */ { 0xb6, { NIB2__, NIB3__, NIB1__, NIB0__ } , 0, 1 }, - /* 0x0b2 */ { 0xd8, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x0b4 */ { INPUT_PORT_C , { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 0 }, // dc.w $00B4 ; 0x1000 - /* 0x0b6 */ { 0xc0, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x0b8 */ { 0xa2, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x0ba */ { 0xe6, { NIB3__, NIB0__, NIB2__, NIB1__ } , 0, 0 }, - /* 0x0bc */ { 0x1a, { NIB0__, NIB2__, NIB3__, NIB1__ } , 1, 1 }, - /* 0x0be */ { 0xb0, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x0c0 */ { 0x4c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x0c2 */ { 0x56, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x0c4 */ { 0xee, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x0c6 */ { 0xd4, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x0c8 */ { INPUT_PORT_A , { NIB2__, NIB3__, NIB0__, NIB1__ } , 1, 0 }, // dc.w $00C8 ; xor - /* 0x0ca */ { 0xda, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x0cc */ { 0xce, { NIB1__, NIB3__, NIB0__, NIB2__ } , 1, 0 }, - /* 0x0ce */ { 0xf2, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x0d0 */ { 0x8e, { NIB1__, NIB3__, NIB0__, NIB2__ } , 1, 1 }, - /* 0x0d2 */ { 0x3a, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x0d4 */ { 0x6e, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x0d6 */ { 0xa6, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x0d8 */ { 0x78, { BLANK_, NIB3__, BLANK_, NIB2__ } , 0, 0 }, - /* 0x0da */ { 0xbc, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x0dc */ { 0xba, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x0de */ { 0x36, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x0e0 */ { 0x66, { NIB1__, NIB2__, NIB0__, NIB3__ } , 0, 1 }, - /* 0x0e2 */ { 0x92, { NIB3__, NIB2__, NIB1__, NIB0__ } , 0, 1 }, - /* 0x0e4 */ { 0x52, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x0e6 */ { 0xf4, { NIB0__, NIB2__, NIB3__, NIB1__ } , 1, 0 }, - /* 0x0e8 */ { INPUT_PORT_B , { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x0ea */ { 0xc6, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x0ec */ { 0xea, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x0ee */ { 0xfe, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x0f0 */ { 0xb2, { BLANK_, BLANK_, BLANK_, NIB3__ } , 0, 1 }, - /* 0x0f2 */ { 0x32, { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x0f4 */ { 0x76, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x0f6 */ { 0xe2, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x0f8 */ { 0x7c, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x0fa */ { 0xa0, { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 1 }, - /* 0x0fc */ { 0x4a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x0fe */ { 0x70, { NIB1__, NIB2__, BLANK_, NIB3__ } , 1, 1 }, - /* 0x100 */ { 0x64, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x102 */ { 0x04, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x104 */ { 0xe2, { NIB0__, NIB1__, NIB3__, NIB2__ } , 1, 0 }, - /* 0x106 */ { 0xca, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x108 */ { 0xa4, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x10a */ { 0x12, { NIB0__, NIB2__, NIB3__, NIB1__ } , 0, 0 }, - /* 0x10c */ { 0xaa, { BLANK_, BLANK_, BLANK_, NIB3__ } , 0, 0 }, - /* 0x10e */ { 0x7c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x110 */ { 0xf4, { NIB1__, NIB0__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x112 */ { 0xda, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x114 */ { 0x7a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x116 */ { 0x3a, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x118 */ { 0x00, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x11a */ { 0x66, { NIB3__, NIB2__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x11c */ { 0xce, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x11e */ { 0xb6, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x120 */ { 0x1c, { NIB2__, NIB1__, NIB0__, NIB3__ } , 1, 0 }, - /* 0x122 */ { 0x82, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x124 */ { 0x4a, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x126 */ { 0x58, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x128 */ { 0xbe, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x12a */ { 0x36, { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x12c */ { 0x9a, { NIB3__, NIB1__, NIB2__, NIB0__ } , 0, 0 }, - /* 0x12e */ { 0x02, { NIB2__, NIB0__, NIB1__, NIB3__ } , 1, 1 }, - /* 0x130 */ { 0xea, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x132 */ { 0xae, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x134 */ { 0x52, { BLANK_, BLANK_, BLANK_, NIB3__ } , 1, 0 }, - /* 0x136 */ { 0xdc, { NIB3__, NIB2__, NIB1__, NIB0__ } , 0, 0 }, - /* 0x138 */ { 0x9e, { NIB0__, NIB3__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x13a */ { 0xfc, { NIB3__, NIB1__, NIB2__, NIB0__ } , 1, 1 }, - /* 0x13c */ { 0x4c, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x13e */ { 0x76, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x140 */ { 0x8c, { NIB2__, NIB0__, NIB1__, NIB3__ } , 1, 0 }, - /* 0x142 */ { 0xd4, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 1 }, - /* 0x144 */ { 0x3e, { NIB1__, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x146 */ { 0x16, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x148 */ { 0xb8, { NIB3__, NIB2__, NIB1__, NIB0__ } , 1, 0 }, - /* 0x14a */ { 0x50, { NIB2__, NIB1__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x14c */ { 0x42, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 1, 0 }, // xor readback address, affected by xor, funky - /* 0x14e */ { 0xd6, { NIB0__, NIB2__, NIB3__, NIB1__ } , 1, 1 }, - /* 0x150 */ { 0x7e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x152 */ { 0x92, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x154 */ { INPUT_PORT_A , { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x156 */ { 0xde, { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x158 */ { 0x1a, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x15a */ { 0x9c, { NIB2__, NIB0__, NIB1__, NIB3__ } , 0, 1 }, - /* 0x15c */ { 0x14, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x15e */ { 0x98, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x160 */ { 0x40, { BLANK_, NIB2__, NIB3__, NIB1__ } , 0, 0 }, - /* 0x162 */ { 0x6e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x164 */ { 0xc4, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x166 */ { 0xc6, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x168 */ { 0x84, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x16a */ { 0x8e, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x16c */ { 0x96, { NIB3__, NIB0__, NIB2__, NIB1__ } , 1, 1 }, - /* 0x16e */ { 0x6a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x170 */ { 0xf0, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x172 */ { 0x2a, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x174 */ { 0x1e, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x176 */ { 0x62, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x178 */ { 0x88, { NIB2__, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x17a */ { 0xe0, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x17c */ { INPUT_PORT_A , { NIB3R1, NIB0__, NIB1__, NIB2__ } , 1, 1 }, // dc.w $017C ; xor,nand - /* 0x17e */ { 0xcc, { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x180 */ { INPUT_PORT_A , { NIB0R3, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x182 */ { 0x46, { NIB2__, NIB1__, NIB0__, NIB3__ } , 0, 0 }, - /* 0x184 */ { 0x90, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x186 */ { 0x72, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x188 */ { 0xee, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x18a */ { 0x2c, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x18c */ { 0x22, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x18e */ { 0x38, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x190 */ { 0x44, { NIB1__, NIB2__, BLANK_, NIB3__ } , 0, 1 }, - /* 0x192 */ { 0xc0, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x194 */ { 0x54, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x196 */ { 0x6c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x198 */ { 0xfa, { NIB2__, NIB1__, BLANK_, NIB3__ } , 0, 1 }, - /* 0x19a */ { 0x34, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x19c */ { 0xa8, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x19e */ { 0x3c, { NIB2__, NIB1__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x1a0 */ { 0x7e, { BLANK_, BLANK_, BLANK_, NIB3__ } , 1, 1 }, - /* 0x1a2 */ { 0x4e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1a4 */ { 0x9c, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x1a6 */ { 0x16, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x1a8 */ { 0x38, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x1aa */ { 0xc8, { NIB1__, NIB0__, NIB3__, NIB2__ } , 1, 0 }, - /* 0x1ac */ { 0x68, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x1ae */ { 0x54, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1b0 */ { 0xba, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x1b2 */ { 0x78, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1b4 */ { 0xcc, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x1b6 */ { 0xfe, { NIB1__, NIB0__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x1b8 */ { 0x86, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x1ba */ { 0x18, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x1bc */ { 0x0e, { NIB2__, NIB3__, NIB1__, NIB0__ } , 0, 1 }, - /* 0x1be */ { 0xc2, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x1c0 */ { INPUT_PORT_C , { NIB3__, NIB1__, NIB2__, NIB0__ } , 0, 0 }, // dc.w $01C0 ; 0x1000 - /* 0x1c2 */ { 0x0c, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x1c4 */ { INPUT_PORT_A , { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1c6 */ { 0x70, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1c8 */ { INPUT_PORT_A , { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1ca */ { 0x5c, { BLANK_, NIB2__, NIB3__, NIB1__ } , 0, 1 }, - /* 0x1cc */ { 0xac, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x1ce */ { 0x48, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x1d0 */ { 0x0a, { BLANK_, NIB3__, BLANK_, NIB2__ } , 1, 1 }, - /* 0x1d2 */ { 0x94, { NIB2__, NIB3__, NIB1__, NIB0__ } , 1, 0 }, - /* 0x1d4 */ { 0x66, { BLANK_, NIB2__, NIB3__, NIB1__ } , 1, 1 }, - /* 0x1d6 */ { 0xf8, { NIB1__, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x1d8 */ { 0x68, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1da */ { 0x24, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x1dc */ { 0x66, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x1de */ { 0xa6, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x1e0 */ { 0x74, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1e2 */ { 0xd0, { NIB2__, NIB3__, NIB1__, NIB0__ } , 0, 0 }, - /* 0x1e4 */ { 0x5e, { NIB3__, NIB0__, NIB2__, NIB1__ } , 0, 1 }, - /* 0x1e6 */ { 0xe6, { NIB1__, NIB2__, NIB0__, NIB3__ } , 0, 0 }, - /* 0x1e8 */ { 0x66, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1ea */ { INPUT_PORT_B , { NIB1__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x1ec */ { INPUT_PORT_B , { NIB1R2, BLANK_, BLANK_, BLANK_ } , 0, 1 }, // dc.w $01EC ; nand - /* 0x1ee */ { 0xc8, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x1f0 */ { 0xa2, { NIB2__, NIB3__, NIB1__, NIB0__ } , 1, 1 }, - /* 0x1f2 */ { 0x60, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x1f4 */ { 0xbc, { NIB3__, NIB1__, NIB2__, NIB0__ } , 0, 1 }, - /* 0x1f6 */ { 0x06, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x1f8 */ { 0x2e, { NIB1__, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x1fa */ { 0x26, { NIB3__, NIB0__, NIB2__, NIB1__ } , 1, 0 }, - /* 0x1fc */ { 0x56, { NIB1__, NIB2__, BLANK_, NIB3__ } , 1, 0 }, - /* 0x1fe */ { 0xd2, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x200 */ { 0xa0, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x202 */ { 0x34, { NIB2__, NIB1__, BLANK_, NIB3__ } , 1, 0 }, - /* 0x204 */ { 0xf6, { BLANK_, BLANK_, BLANK_, NIB3__ } , 1, 0 }, - /* 0x206 */ { INPUT_PORT_A , { NIB2__, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x208 */ { 0xae, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x20a */ { 0xf4, { BLANK_, NIB2__, NIB3__, NIB1__ } , 1, 0 }, - /* 0x20c */ { INPUT_PORT_C , { BLANK_, BLANK_, BLANK_, NIB3__ } , 1, 1 }, // dc.w $020C ; Bit not present dc.w $020C ; Bit not present ; xor,nand - /* 0x20e */ { 0x4e, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x210 */ { 0x0e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x212 */ { 0x6e, { NIB0__, NIB3__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x214 */ { 0x4a, { NIB3__, NIB0__, NIB2__, NIB1__ } , 0, 1 }, - /* 0x216 */ { 0x0a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x218 */ { 0x82, { NIB1__, NIB2__, NIB0__, NIB3__ } , 1, 1 }, - /* 0x21a */ { 0x66, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x21c */ { 0x6c, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x21e */ { 0xb8, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x220 */ { 0x12, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x222 */ { 0x06, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x224 */ { 0x00, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x226 */ { 0x72, { NIB3__, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x228 */ { 0xe4, { NIB2__, NIB1__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x22a */ { 0x90, { NIB3__, NIB2__, NIB1__, NIB0__ } , 1, 1 }, - /* 0x22c */ { 0xc4, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x22e */ { 0x08, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x230 */ { 0x98, { NIB1__, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x232 */ { 0xda, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x234 */ { 0x3a, { NIB1__, NIB3__, NIB0__, NIB2__ } , 1, 0 }, - /* 0x236 */ { 0xcc, { BLANK_, NIB3__, BLANK_, NIB2__ } , 1, 1 }, - /* 0x238 */ { 0x7c, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x23a */ { 0x86, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x23c */ { 0x56, { NIB3__, NIB1__, NIB2__, NIB0__ } , 0, 1 }, - /* 0x23e */ { 0x8a, { NIB0__, NIB3__, NIB2__, NIB1__ } , 1, 1 }, - /* 0x240 */ { 0xa0, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x242 */ { 0x04, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x244 */ { 0x32, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x246 */ { 0x48, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x248 */ { 0x8c, { NIB3__, NIB2__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x24a */ { 0xa2, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x24c */ { 0xfa, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x24e */ { 0x46, { NIB3__, NIB0__, NIB2__, NIB1__ } , 1, 0 }, - /* 0x250 */ { 0x62, { NIB2__, NIB1__, NIB0__, NIB3__ } , 0, 1 }, - /* 0x252 */ { 0xe0, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x254 */ { 0x7e, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x256 */ { 0xce, { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x258 */ { 0xf8, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x25a */ { 0x6a, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x25c */ { 0x58, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x25e */ { 0xc0, { NIB3__, NIB1__, NIB2__, NIB0__ } , 1, 0 }, - /* 0x260 */ { 0xe2, { NIB1__, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x262 */ { 0x30, { NIB1__, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x264 */ { 0x88, { NIB2__, NIB1__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x266 */ { 0xe8, { NIB0__, NIB2__, NIB3__, NIB1__ } , 1, 0 }, - /* 0x268 */ { 0xac, { BLANK_, NIB3__, BLANK_, NIB2__ } , 0, 1 }, - /* 0x26a */ { 0xe6, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x26c */ { 0xc2, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x26e */ { 0xa8, { NIB3__, NIB2__, NIB1__, NIB0__ } , 0, 0 }, - /* 0x270 */ { INPUT_PORT_C , { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 0 }, // dc.w $0270 ; 0x0010 - /* 0x272 */ { 0x3c, { NIB0__, NIB1__, NIB3__, NIB2__ } , 1, 1 }, - /* 0x274 */ { 0x68, { NIB1__, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x276 */ { 0x2e, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x278 */ { 0x18, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x27a */ { 0x02, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x27c */ { 0x70, { NIB1__, NIB2__, NIB0__, NIB3__ } , 0, 0 }, - /* 0x27e */ { 0x94, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x280 */ { 0x5e, { NIB2__, NIB1__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x282 */ { 0x26, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x284 */ { 0x14, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x286 */ { 0x7a, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x288 */ { 0xd2, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x28a */ { 0xd4, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x28c */ { 0xa6, { NIB1__, NIB3__, NIB0__, NIB2__ } , 0, 0 }, - /* 0x28e */ { 0x36, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x290 */ { 0xee, { NIB2__, NIB1__, BLANK_, NIB3__ } , 0, 0 }, - /* 0x292 */ { INPUT_PORT_C , { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, // dc.w $0292 ; 0x0001 - /* 0x294 */ { 0x66, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x296 */ { 0x5a, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x298 */ { 0x64, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x29a */ { 0x60, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x29c */ { 0xec, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x29e */ { 0x80, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x2a0 */ { 0xd0, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x2a2 */ { 0x44, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x2a4 */ { INPUT_PORT_C , { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 0 }, // dc.w $02A4 ; 0x0001 - /* 0x2a6 */ { 0xbc, { NIB2__, NIB0__, NIB1__, NIB3__ } , 1, 1 }, - /* 0x2a8 */ { 0x22, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x2aa */ { 0xb2, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x2ac */ { 0x1e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x2ae */ { 0x9c, { NIB2__, NIB0__, NIB1__, NIB3__ } , 0, 0 }, - /* 0x2b0 */ { 0x96, { NIB3__, NIB1__, NIB2__, NIB0__ } , 0, 0 }, - /* 0x2b2 */ { 0x8e, { NIB2__, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x2b4 */ { 0xb6, { NIB0__, NIB3__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x2b6 */ { 0xfe, { NIB2__, NIB1__, NIB0__, NIB3__ } , 1, 1 }, - /* 0x2b8 */ { 0x66, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x2ba */ { 0xf0, { BLANK_, NIB2__, NIB3__, NIB1__ } , 0, 0 }, - /* 0x2bc */ { 0x20, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x2be */ { 0x40, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x2c0 */ { 0x4c, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x2c2 */ { 0x76, { BLANK_, NIB3__, BLANK_, NIB2__ } , 1, 1 }, - /* 0x2c4 */ { 0xca, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x2c6 */ { 0x50, { NIB3__, NIB2__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x2c8 */ { 0x1c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x2ca */ { 0x1a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x2cc */ { INPUT_PORT_B , { NIB0__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x2ce */ { 0x92, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x2d0 */ { 0x66, { BLANK_, NIB3__, BLANK_, NIB2__ } , 1, 0 }, - /* 0x2d2 */ { 0x28, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x2d4 */ { 0x74, { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x2d6 */ { 0x16, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x2d8 */ { 0x9e, { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x2da */ { 0xde, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x2dc */ { 0xba, { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x2de */ { 0x78, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x2e0 */ { 0x9a, { NIB1__, NIB2__, BLANK_, NIB3__ } , 0, 0 }, - /* 0x2e2 */ { 0xc6, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x2e4 */ { 0x42, { NIB1__, NIB2__, NIB0__, NIB3__ } , 1, 0 }, - /* 0x2e6 */ { 0xea, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x2e8 */ { 0x0c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x2ea */ { 0xd8, { NIB1__, NIB0__, NIB3__, NIB2__ } , 1, 0 }, - /* 0x2ec */ { 0x5c, { NIB1__, NIB0__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x2ee */ { 0xaa, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x2f0 */ { 0xb4, { NIB0__, NIB3__, NIB2__, NIB1__ } , 1, 0 }, - /* 0x2f2 */ { 0xf2, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x2f4 */ { INPUT_PORT_C , { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 1 }, // dc.w $02F4 ; 0x0001 dc.w $02F4 ; 0x0001 ; nand - /* 0x2f6 */ { 0x84, { NIB1__, NIB2__, NIB0__, NIB3__ } , 0, 1 }, - /* 0x2f8 */ { 0xa4, { BLANK_, NIB2__, NIB3__, NIB1__ } , 0, 1 }, - /* 0x2fa */ { INPUT_PORT_C , { NIB0R3, NIB1__, NIB2__, NIB3__ } , 0, 0 }, // dc.w $02FA ; 0x0008 - /* 0x2fc */ { 0xfc, { BLANK_, NIB3__, BLANK_, NIB2__ } , 0, 0 }, - /* 0x2fe */ { 0x10, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x300 */ { 0xa4, { BLANK_, BLANK_, BLANK_, NIB3__ } , 0, 0 }, - /* 0x302 */ { 0x24, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x304 */ { 0xe2, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x306 */ { 0x32, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x308 */ { 0x2a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x30a */ { 0x66, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x30c */ { 0x86, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x30e */ { 0xaa, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x310 */ { 0x66, { NIB2__, NIB1__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x312 */ { 0x4e, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x314 */ { 0x84, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x316 */ { 0x96, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x318 */ { 0x26, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x31a */ { 0x64, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x31c */ { 0xac, { NIB2__, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x31e */ { 0x78, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x320 */ { 0xfe, { NIB0__, NIB3__, NIB2__, NIB1__ } , 0, 0 }, - /* 0x322 */ { 0x2e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x324 */ { 0x06, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x326 */ { 0x92, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x328 */ { 0x34, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x32a */ { 0xc0, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x32c */ { 0x8a, { NIB2__, NIB1__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x32e */ { 0x46, { NIB1__, NIB2__, BLANK_, NIB3__ } , 0, 1 }, - /* 0x330 */ { 0xd8, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x332 */ { 0xc4, { NIB1__, NIB0__, NIB3__, NIB2__ } , 1, 1 }, - /* 0x334 */ { 0x30, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x336 */ { 0x1a, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x338 */ { 0xd0, { BLANK_, BLANK_, BLANK_, NIB3__ } , 1, 1 }, - /* 0x33a */ { 0x60, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x33c */ { 0xf6, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x33e */ { 0x00, { NIB3__, NIB2__, NIB1__, NIB0__ } , 0, 1 }, - /* 0x340 */ { 0x90, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x342 */ { 0xfc, { NIB2__, NIB1__, NIB0__, NIB3__ } , 0, 0 }, - /* 0x344 */ { 0x08, { NIB3__, NIB2__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x346 */ { 0xa8, { NIB2__, NIB3__, NIB1__, NIB0__ } , 1, 1 }, - /* 0x348 */ { 0x44, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x34a */ { 0x04, { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x34c */ { 0x3c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x34e */ { 0xde, { NIB0__, NIB2__, NIB3__, NIB1__ } , 0, 0 }, - /* 0x350 */ { 0x72, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x352 */ { 0x62, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x354 */ { 0x3a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x356 */ { 0xba, { NIB2__, NIB1__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x358 */ { 0x68, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x35a */ { 0x76, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x35c */ { 0x9e, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x35e */ { 0xc6, { NIB2__, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x360 */ { 0xe4, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x362 */ { 0x02, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x364 */ { 0x6c, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x366 */ { 0xec, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x368 */ { INPUT_PORT_C , { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, // dc.w $0368 ; 0x1000 - /* 0x36a */ { INPUT_PORT_A , { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x36c */ { INPUT_PORT_B , { NIB0__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x36e */ { 0x0c, { NIB2__, NIB0__, NIB1__, NIB3__ } , 0, 1 }, - /* 0x370 */ { 0x80, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x372 */ { 0x82, { NIB3__, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x374 */ { 0xb8, { NIB3__, NIB2__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x376 */ { 0x50, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x378 */ { 0x20, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x37a */ { 0xf4, { NIB0__, NIB2__, NIB3__, NIB1__ } , 0, 1 }, - /* 0x37c */ { 0x8c, { NIB2__, NIB1__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x37e */ { 0xe6, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x380 */ { 0xda, { NIB2__, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x382 */ { 0xf2, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x384 */ { 0xdc, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x386 */ { 0x9c, { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x388 */ { INPUT_PORT_A , { NIB1__, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x38a */ { INPUT_PORT_B , { NIB1__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x38c */ { 0x28, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x38e */ { 0xb6, { NIB2__, NIB1__, BLANK_, NIB3__ } , 1, 1 }, - /* 0x390 */ { 0x2c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x392 */ { 0xce, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x394 */ { 0x0e, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x396 */ { 0x5c, { NIB2__, NIB3__, NIB1__, NIB0__ } , 0, 0 }, - /* 0x398 */ { 0x52, { BLANK_, NIB3__, BLANK_, NIB2__ } , 1, 1 }, - /* 0x39a */ { 0x7e, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x39c */ { 0x6a, { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x39e */ { 0xa0, { NIB0__, NIB1__, NIB3__, NIB2__ } , 1, 0 }, - /* 0x3a0 */ { 0x52, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x3a2 */ { 0x94, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x3a4 */ { 0x2c, { NIB0__, NIB3__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x3a6 */ { 0xc8, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x3a8 */ { 0x18, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x3aa */ { 0x56, { NIB3__, NIB2__, NIB1__, NIB0__ } , 1, 0 }, - /* 0x3ac */ { 0x54, { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 1 }, - /* 0x3ae */ { 0x58, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 1 }, - /* 0x3b0 */ { INPUT_PORT_B , { NIB1__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x3b2 */ { 0x14, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x3b4 */ { 0x38, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x3b6 */ { 0xf8, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x3b8 */ { 0xb4, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x3ba */ { 0xd6, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x3bc */ { 0x5c, { NIB2__, NIB0__, NIB1__, NIB3__ } , 1, 0 }, - /* 0x3be */ { 0x1c, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x3c0 */ { 0x22, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x3c2 */ { 0x66, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x3c4 */ { 0x8e, { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x3c6 */ { 0xf0, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x3c8 */ { 0xae, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x3ca */ { 0x1e, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x3cc */ { 0xee, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x3ce */ { 0xea, { NIB0__, NIB3__, NIB2__, NIB1__ } , 0, 1 }, - /* 0x3d0 */ { 0xe8, { NIB3__, NIB0__, NIB2__, NIB1__ } , 1, 1 }, - /* 0x3d2 */ { 0x88, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x3d4 */ { INPUT_PORT_C , { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, // dc.w $03D4 ; 0x0010 - /* 0x3d6 */ { 0x66, { NIB1__, NIB2__, BLANK_, NIB3__ } , 1, 1 }, - /* 0x3d8 */ { INPUT_PORT_B , { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x3da */ { 0xfa, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x3dc */ { 0x4c, { NIB2__, NIB1__, BLANK_, NIB3__ } , 0, 1 }, - /* 0x3de */ { 0x36, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x3e0 */ { 0xe0, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x3e2 */ { 0xd4, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x3e4 */ { 0xc8, { NIB1__, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x3e6 */ { 0xc2, { NIB1__, NIB2__, BLANK_, NIB3__ } , 1, 0 }, - /* 0x3e8 */ { 0x0a, { BLANK_, NIB2__, NIB3__, NIB1__ } , 1, 1 }, - /* 0x3ea */ { 0x9a, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x3ec */ { 0x7c, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x3ee */ { 0x4a, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x3f0 */ { 0xd2, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x3f2 */ { 0x48, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x3f4 */ { 0x6e, { NIB1__, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x3f6 */ { 0xa6, { NIB1__, NIB3__, NIB0__, NIB2__ } , 0, 1 }, - /* 0x3f8 */ { 0x42, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x3fa */ { 0x5e, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x3fc */ { 0xbc, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x3fe */ { 0x10, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x400 */ { 0x02, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x402 */ { 0x72, { NIB1__, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x404 */ { 0x74, { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x406 */ { 0x96, { NIB0__, NIB3__, NIB2__, NIB1__ } , 1, 1 }, - /* 0x408 */ { 0x54, { BLANK_, NIB2__, NIB3__, NIB1__ } , 1, 0 }, - /* 0x40a */ { 0xda, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x40c */ { 0xd6, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x40e */ { 0x8a, { NIB1__, NIB2__, BLANK_, NIB3__ } , 1, 1 }, - /* 0x410 */ { 0xde, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x412 */ { 0xa4, { NIB1__, NIB2__, NIB0__, NIB3__ } , 1, 0 }, - /* 0x414 */ { 0xa2, { BLANK_, NIB3__, BLANK_, NIB2__ } , 1, 0 }, - /* 0x416 */ { 0xe4, { BLANK_, BLANK_, BLANK_, NIB3__ } , 0, 1 }, - /* 0x418 */ { 0x04, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x41a */ { 0x84, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x41c */ { 0x2a, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x41e */ { 0x4c, { NIB0__, NIB2__, NIB3__, NIB1__ } , 0, 1 }, - /* 0x420 */ { 0x2e, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x422 */ { 0x86, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x424 */ { 0x60, { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x426 */ { 0xba, { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x428 */ { 0x8c, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x42a */ { 0xee, { NIB3__, NIB1__, NIB2__, NIB0__ } , 1, 0 }, - /* 0x42c */ { 0xac, { BLANK_, NIB2__, NIB3__, NIB1__ } , 0, 0 }, - /* 0x42e */ { 0x32, { NIB1__, NIB3__, NIB0__, NIB2__ } , 0, 1 }, - /* 0x430 */ { 0xd2, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x432 */ { 0x0e, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x434 */ { 0x06, { NIB3__, NIB1__, NIB2__, NIB0__ } , 1, 1 }, - /* 0x436 */ { 0x66, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x438 */ { 0xec, { NIB0__, NIB2__, NIB3__, NIB1__ } , 0, 0 }, - /* 0x43a */ { 0xfe, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x43c */ { INPUT_PORT_B , { BLANK_, BLANK_, BLANK_, BLANK_ } , 0, 0 }, // this address always seems to return 0, is it a port with all bits masked out? I'm going to assume it's a 'B' port (4-bit) with mask applied to those 4 bits so they always return 0 due to a design flaw, that would make 21 of each port type. - /* 0x43e */ { 0x7a, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x440 */ { 0xfc, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x442 */ { 0x10, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x444 */ { 0x66, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x446 */ { 0x16, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x448 */ { 0x90, { NIB1__, NIB0__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x44a */ { 0xb4, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x44c */ { INPUT_PORT_B, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 0, 1 }, //dc.w $044C ; nand - /* 0x44e */ { 0x44, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x450 */ { INPUT_PORT_C , { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 0 }, // dc.w $0450 ; 0x0100 dc.w $0450 ; 0x0100 ; xor - /* 0x452 */ { 0x30, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x454 */ { 0x82, { NIB3__, NIB0__, NIB2__, NIB1__ } , 1, 0 }, - /* 0x456 */ { 0x26, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x458 */ { 0x52, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x45a */ { 0xc6, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x45c */ { 0xd8, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x45e */ { 0x18, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x460 */ { 0xc8, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x462 */ { 0x64, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x464 */ { 0xbe, { NIB2__, NIB1__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x466 */ { 0x42, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x468 */ { 0xc0, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x46a */ { 0x38, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x46c */ { 0xd0, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x46e */ { 0x9c, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x470 */ { 0xa8, { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 1 }, - /* 0x472 */ { 0x4a, { NIB1__, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x474 */ { 0x1c, { NIB2__, NIB0__, NIB1__, NIB3__ } , 0, 0 }, - /* 0x476 */ { 0xf0, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x478 */ { 0xb6, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x47a */ { 0xc2, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x47c */ { 0x7e, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x47e */ { INPUT_PORT_B , { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x480 */ { 0x5a, { NIB2__, NIB1__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x482 */ { 0x5c, { NIB1__, NIB2__, BLANK_, NIB3__ } , 0, 0 }, - /* 0x484 */ { 0x5a, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x486 */ { 0x06, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x488 */ { 0x2c, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x48a */ { 0x76, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x48c */ { 0xbc, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x48e */ { 0x46, { NIB3__, NIB2__, NIB1__, NIB0__ } , 0, 0 }, - /* 0x490 */ { 0x66, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x492 */ { 0xea, { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x494 */ { 0x9a, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x496 */ { 0xb8, { NIB1__, NIB3__, NIB0__, NIB2__ } , 1, 1 }, - /* 0x498 */ { 0x36, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x49a */ { 0x56, { NIB0__, NIB1__, NIB3__, NIB2__ } , 1, 0 }, - /* 0x49c */ { 0x6c, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x49e */ { 0x12, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x4a0 */ { 0xa4, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x4a2 */ { 0xa8, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x4a4 */ { 0xce, { NIB3__, NIB1__, NIB2__, NIB0__ } , 1, 1 }, - /* 0x4a6 */ { 0x8c, { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x4a8 */ { 0xb0, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x4aa */ { 0x48, { NIB1__, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x4ac */ { INPUT_PORT_A , { NIB3__, NIB1__, NIB2__, NIB0__ } , 0, 0 }, - /* 0x4ae */ { 0x92, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x4b0 */ { 0x10, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x4b2 */ { 0x74, { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x4b4 */ { 0x08, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x4b6 */ { 0x94, { NIB3__, NIB2__, NIB1__, NIB0__ } , 1, 0 }, - /* 0x4b8 */ { 0x46, { NIB2__, NIB3__, NIB1__, NIB0__ } , 1, 0 }, - /* 0x4ba */ { 0x24, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x4bc */ { 0x42, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x4be */ { 0xa6, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x4c0 */ { 0x08, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 1 }, - /* 0x4c2 */ { 0x80, { NIB1__, NIB2__, NIB0__, NIB3__ } , 0, 1 }, - /* 0x4c4 */ { 0x3c, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x4c6 */ { 0x94, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x4c8 */ { INPUT_PORT_A , { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x4ca */ { 0x20, { NIB2__, NIB1__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x4cc */ { 0xf6, { NIB2__, NIB1__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x4ce */ { 0x66, { NIB2__, NIB3__, NIB1__, NIB0__ } , 1, 1 }, - /* 0x4d0 */ { 0xe2, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x4d2 */ { INPUT_PORT_B , { NIB0R2, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x4d4 */ { 0xd4, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x4d6 */ { 0xa0, { NIB3__, NIB1__, NIB2__, NIB0__ } , 0, 0 }, - /* 0x4d8 */ { 0x48, { NIB0__, NIB3__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x4da */ { 0xca, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x4dc */ { 0x62, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x4de */ { 0x70, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x4e0 */ { 0xfa, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x4e2 */ { 0x9e, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x4e4 */ { 0x40, { NIB1__, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x4e6 */ { 0x68, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x4e8 */ { 0x88, { NIB1__, NIB2__, BLANK_, NIB3__ } , 0, 1 }, - /* 0x4ea */ { 0x3e, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x4ec */ { 0x7c, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x4ee */ { 0xcc, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x4f0 */ { 0x34, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x4f2 */ { INPUT_PORT_A , { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 0 }, // dc.w $04F2 - /* 0x4f4 */ { 0x28, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x4f6 */ { 0xe6, { NIB3__, NIB0__, NIB2__, NIB1__ } , 0, 0 }, - /* 0x4f8 */ { 0x6a, { NIB1__, NIB0__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x4fa */ { 0xaa, { NIB1__, NIB3__, NIB0__, NIB2__ } , 0, 1 }, - /* 0x4fc */ { 0x50, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x4fe */ { 0xa6, { NIB2__, NIB0__, NIB1__, NIB3__ } , 0, 1 }, - /* 0x500 */ { 0xf0, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x502 */ { 0x88, { NIB3__, NIB0__, NIB2__, NIB1__ } , 1, 1 }, - /* 0x504 */ { 0x5c, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x506 */ { INPUT_PORT_C , { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 0 }, // dc.w $0506 ; 0x0004 - /* 0x508 */ { INPUT_PORT_A , { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x50a */ { 0xc0, { BLANK_, NIB3__, BLANK_, NIB2__ } , 0, 1 }, - /* 0x50c */ { 0x26, { NIB1__, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x50e */ { 0x72, { NIB3__, NIB2__, NIB1__, NIB0__ } , 1, 1 }, - /* 0x510 */ { 0x8a, { NIB2__, NIB0__, NIB1__, NIB3__ } , 1, 1 }, - /* 0x512 */ { 0x06, { NIB3__, NIB2__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x514 */ { 0x32, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x516 */ { 0xb6, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x518 */ { 0x02, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x51a */ { 0xb2, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x51c */ { 0x0a, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x51e */ { 0xd6, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x520 */ { 0xaa, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x522 */ { 0xca, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x524 */ { 0x54, { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x526 */ { 0x08, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x528 */ { INPUT_PORT_B , { NIB2__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x52a */ { 0x8e, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x52c */ { 0xe0, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x52e */ { 0xba, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x530 */ { 0x18, { NIB2__, NIB3__, NIB1__, NIB0__ } , 0, 1 }, - /* 0x532 */ { 0xb0, { NIB3__, NIB2__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x534 */ { 0x1a, { NIB1__, NIB0__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x536 */ { 0x7a, { NIB1__, NIB0__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x538 */ { 0x3c, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x53a */ { 0x0c, { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x53c */ { 0xfa, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x53e */ { 0x9e, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x540 */ { 0x3e, { NIB0__, NIB3__, NIB2__, NIB1__ } , 1, 0 }, - /* 0x542 */ { 0x9c, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x544 */ { 0x5a, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x546 */ { 0x62, { NIB2__, NIB1__, BLANK_, NIB3__ } , 0, 1 }, - /* 0x548 */ { 0xf6, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x54a */ { 0xde, { NIB1__, NIB0__, NIB3__, NIB2__ } , 1, 1 }, - /* 0x54c */ { 0x38, { NIB2__, NIB0__, NIB1__, NIB3__ } , 1, 0 }, - /* 0x54e */ { 0xe6, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x550 */ { 0xa2, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x552 */ { 0x4c, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x554 */ { 0xae, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x556 */ { 0xac, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x558 */ { 0x68, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x55a */ { 0xf2, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x55c */ { 0x66, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x55e */ { 0xea, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x560 */ { 0x82, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x562 */ { INPUT_PORT_B , { NIB0__, BLANK_, BLANK_, BLANK_ } , 1, 0 }, // dc.w $0562 ; xor - /* 0x564 */ { 0x80, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x566 */ { 0xf8, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x568 */ { 0x6c, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x56a */ { 0x7c, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x56c */ { INPUT_PORT_A , { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x56e */ { 0x98, { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x570 */ { 0x24, { NIB2__, NIB1__, BLANK_, NIB3__ } , 1, 0 }, - /* 0x572 */ { 0xc2, { NIB1__, NIB3__, NIB0__, NIB2__ } , 1, 1 }, - /* 0x574 */ { 0xdc, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x576 */ { 0x52, { NIB2__, NIB1__, BLANK_, NIB3__ } , 0, 0 }, - /* 0x578 */ { 0x2a, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x57a */ { 0xb8, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x57c */ { 0x28, { NIB1__, NIB2__, BLANK_, NIB3__ } , 0, 0 }, - /* 0x57e */ { 0xd8, { NIB1__, NIB2__, NIB0__, NIB3__ } , 0, 0 }, - /* 0x580 */ { 0x0c, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x582 */ { 0x8e, { NIB3__, NIB2__, NIB1__, NIB0__ } , 0, 0 }, - /* 0x584 */ { 0x22, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x586 */ { 0x00, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x588 */ { 0x04, { NIB0__, NIB3__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x58a */ { 0x22, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x58c */ { 0xe8, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x58e */ { 0x74, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x590 */ { 0x0e, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x592 */ { 0x66, { BLANK_, NIB2__, NIB3__, NIB1__ } , 1, 1 }, - /* 0x594 */ { 0x40, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x596 */ { 0xc8, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x598 */ { 0x70, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x59a */ { 0x16, { NIB0__, NIB1__, NIB3__, NIB2__ } , 1, 0 }, - /* 0x59c */ { 0x12, { NIB0__, NIB3__, NIB2__, NIB1__ } , 0, 0 }, - /* 0x59e */ { 0x36, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x5a0 */ { 0x5e, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x5a2 */ { 0x24, { NIB0__, NIB3__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x5a4 */ { 0xce, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5a6 */ { 0xb0, { NIB3__, NIB2__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x5a8 */ { 0xf2, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x5aa */ { 0x98, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x5ac */ { 0x6e, { NIB0__, NIB2__, NIB3__, NIB1__ } , 1, 1 }, - /* 0x5ae */ { 0xdc, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5b0 */ { 0xc4, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5b2 */ { INPUT_PORT_B , { NIB0__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x5b4 */ { 0xe0, { NIB1__, NIB3__, NIB0__, NIB2__ } , 0, 0 }, - /* 0x5b6 */ { 0x92, { NIB1__, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x5b8 */ { 0x4e, { NIB0__, NIB2__, NIB3__, NIB1__ } , 1, 0 }, - /* 0x5ba */ { 0xf4, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5bc */ { 0x78, { NIB2__, NIB1__, NIB0__, NIB3__ } , 1, 0 }, - /* 0x5be */ { 0x58, { NIB3__, NIB0__, NIB2__, NIB1__ } , 0, 1 }, - /* 0x5c0 */ { 0xfe, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5c2 */ { 0x4a, { NIB1__, NIB3__, NIB0__, NIB2__ } , 1, 0 }, - /* 0x5c4 */ { 0x3a, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x5c6 */ { 0x2c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x5c8 */ { 0x96, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x5ca */ { 0x20, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x5cc */ { 0xc6, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x5ce */ { 0xa8, { NIB3__, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x5d0 */ { 0xe2, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5d2 */ { 0x66, { NIB2__, NIB3__, NIB1__, NIB0__ } , 1, 0 }, - /* 0x5d4 */ { 0xf4, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5d6 */ { 0xec, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5d8 */ { 0xbe, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x5da */ { 0xe8, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5dc */ { 0x6e, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x5de */ { 0x1e, { BLANK_, BLANK_, BLANK_, NIB3__ } , 1, 0 }, - /* 0x5e0 */ { 0x14, { NIB2__, NIB1__, NIB0__, NIB3__ } , 0, 0 }, - /* 0x5e2 */ { 0x84, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x5e4 */ { 0xa0, { NIB0__, NIB3__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x5e6 */ { 0x34, { NIB3__, NIB2__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x5e8 */ { 0xe4, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x5ea */ { 0x58, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x5ec */ { INPUT_PORT_B , { NIB2__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x5ee */ { 0x42, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x5f0 */ { 0x8c, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x5f2 */ { 0x10, { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x5f4 */ { INPUT_PORT_C , { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, // dc.w $05F4 ; 0x0100 - /* 0x5f6 */ { 0x04, { NIB1__, NIB0__, NIB3__, NIB2__ } , 1, 0 }, - /* 0x5f8 */ { 0x4e, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x5fa */ { 0xd2, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x5fc */ { 0x7e, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x5fe */ { 0xcc, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x600 */ { 0xc6, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x602 */ { 0x20, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x604 */ { 0x36, { NIB2__, NIB1__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x606 */ { 0xfc, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x608 */ { 0x1c, { NIB0__, NIB3__, NIB2__, NIB1__ } , 1, 0 }, - /* 0x60a */ { 0xca, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x60c */ { INPUT_PORT_A , { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x60e */ { 0xa0, { BLANK_, NIB2__, NIB3__, NIB1__ } , 0, 0 }, - /* 0x610 */ { 0xa4, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x612 */ { 0x64, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x614 */ { 0x96, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x616 */ { 0x7e, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x618 */ { 0x0c, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x61a */ { 0x38, { NIB3__, NIB0__, NIB2__, NIB1__ } , 1, 1 }, - /* 0x61c */ { 0x66, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x61e */ { 0x22, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x620 */ { 0x1a, { NIB1__, NIB0__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x622 */ { 0xae, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x624 */ { 0x9a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x626 */ { 0x4e, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x628 */ { 0x5a, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x62a */ { 0x8a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x62c */ { INPUT_PORT_A , { NIB1__, NIB2__, BLANK_, NIB3__ } , 0, 1 }, // dc.w $062C ; nand - /* 0x62e */ { 0x58, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x630 */ { INPUT_PORT_B , { NIB0__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, // dc.w $0630 ; nand - /* 0x632 */ { 0x6a, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x634 */ { 0xc2, { NIB2__, NIB0__, NIB1__, NIB3__ } , 1, 0 }, - /* 0x636 */ { 0xc4, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x638 */ { 0x94, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x63a */ { 0x3c, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x63c */ { 0x74, { NIB0__, NIB3__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x63e */ { 0x0a, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x640 */ { 0x30, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x642 */ { 0x68, { NIB1__, NIB0__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x644 */ { 0x40, { NIB2__, NIB3__, NIB1__, NIB0__ } , 0, 1 }, - /* 0x646 */ { 0xda, { NIB2__, NIB3__, NIB1__, NIB0__ } , 0, 0 }, - /* 0x648 */ { 0x60, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x64a */ { 0xde, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x64c */ { 0x04, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x64e */ { 0x86, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x650 */ { 0x78, { BLANK_, NIB2__, NIB3__, NIB1__ } , 1, 0 }, - /* 0x652 */ { 0x4a, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x654 */ { 0x4c, { NIB1__, NIB2__, NIB0__, NIB3__ } , 1, 0 }, - /* 0x656 */ { 0x2e, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x658 */ { 0xbc, { NIB2__, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x65a */ { 0xc0, { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x65c */ { 0x44, { NIB1__, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x65e */ { 0x9c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x660 */ { 0x48, { NIB2__, NIB1__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x662 */ { 0x8c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x664 */ { 0x9e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x666 */ { 0xfe, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x668 */ { 0x5e, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x66a */ { 0x16, { NIB2__, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x66c */ { 0xdc, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x66e */ { 0xec, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x670 */ { 0xf4, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x672 */ { 0x6c, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 1 }, - /* 0x674 */ { INPUT_PORT_C , { NIB1__, NIB2__, NIB3__, BLANK_ } , 0, 0 }, // dc.w $0674 ; 0x0010 - /* 0x676 */ { 0xd2, { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x678 */ { 0x72, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x67a */ { 0x28, { NIB0__, NIB3__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x67c */ { 0x1e, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x67e */ { INPUT_PORT_B , { NIB3R1, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x680 */ { 0x7a, { NIB0__, NIB3__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x682 */ { 0xba, { NIB3__, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x684 */ { 0xd8, { NIB0__, NIB3__, NIB2__, NIB1__ } , 0, 0 }, - /* 0x686 */ { 0x46, { NIB1__, NIB3__, NIB0__, NIB2__ } , 0, 0 }, - /* 0x688 */ { 0xe4, { NIB1__, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x68a */ { 0xd0, { NIB2__, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x68c */ { 0x50, { NIB1R2, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x68e */ { 0x92, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x690 */ { 0x10, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x692 */ { 0x88, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x694 */ { 0xf2, { NIB2__, NIB0__, NIB1__, NIB3__ } , 0, 0 }, - /* 0x696 */ { 0xce, { NIB2__, NIB1__, BLANK_, NIB3__ } , 1, 0 }, - /* 0x698 */ { 0x12, { NIB2__, NIB1__, BLANK_, NIB3__ } , 1, 1 }, - /* 0x69a */ { 0x3e, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x69c */ { 0x06, { NIB2__, NIB1__, NIB0__, NIB3__ } , 1, 1 }, - /* 0x69e */ { 0xe8, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x6a0 */ { 0xb2, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x6a2 */ { 0x28, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x6a4 */ { 0xa0, { NIB2__, NIB1__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x6a6 */ { 0xe4, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x6a8 */ { 0x32, { NIB3__, NIB2__, NIB1__, NIB0__ } , 1, 1 }, - /* 0x6aa */ { 0x20, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x6ac */ { 0xf6, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x6ae */ { 0xf2, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x6b0 */ { 0x10, { NIB2__, NIB1__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x6b2 */ { 0xb4, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x6b4 */ { 0xa0, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x6b6 */ { 0x30, { NIB0__, NIB3__, NIB2__, NIB1__ } , 1, 1 }, - /* 0x6b8 */ { 0xea, { NIB1__, NIB2__, NIB0__, NIB3__ } , 1, 0 }, - /* 0x6ba */ { 0xf6, { NIB2__, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x6bc */ { 0x42, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x6be */ { INPUT_PORT_A , { NIB1__, NIB2__, BLANK_, NIB3__ } , 1, 0 }, // dc.w $06BE ; xor - /* 0x6c0 */ { 0x08, { NIB3__, NIB1__, NIB2__, NIB0__ } , 0, 1 }, - /* 0x6c2 */ { 0x54, { NIB2__, NIB1__, BLANK_, NIB3__ } , 1, 1 }, - /* 0x6c4 */ { 0x66, { NIB2__, NIB1__, BLANK_, NIB3__ } , 0, 1 }, - /* 0x6c6 */ { 0xcc, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x6c8 */ { 0x52, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x6ca */ { 0xd4, { NIB2__, NIB1__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x6cc */ { INPUT_PORT_C , { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 0 }, // dc.w $06CC ; 0x0002 - /* 0x6ce */ { 0x0e, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x6d0 */ { 0xb2, { BLANK_, BLANK_, BLANK_, NIB3__ } , 0, 0 }, - /* 0x6d2 */ { 0xa2, { NIB0__, NIB3__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x6d4 */ { 0xb4, { NIB2__, NIB1__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x6d6 */ { INPUT_PORT_A , { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 0 }, // dc.w $06D6 ; xor - /* 0x6d8 */ { 0xac, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x6da */ { 0x24, { BLANK_, NIB2__, NIB3__, NIB1__ } , 0, 1 }, - /* 0x6dc */ { 0xbe, { NIB1__, NIB0__, NIB3__, NIB2__ } , 1, 0 }, - /* 0x6de */ { 0xa8, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x6e0 */ { 0x2c, { NIB2__, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x6e2 */ { 0x90, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x6e4 */ { 0x98, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x6e6 */ { 0x70, { NIB2__, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x6e8 */ { 0xb6, { BLANK_, NIB3__, BLANK_, NIB2__ } , 0, 1 }, - /* 0x6ea */ { 0xb8, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 1, 1 }, - /* 0x6ec */ { 0x66, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x6ee */ { 0x2a, { NIB0__, NIB2__, NIB3__, NIB1__ } , 1, 0 }, - /* 0x6f0 */ { 0x62, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x6f2 */ { 0xc8, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x6f4 */ { 0x14, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x6f6 */ { 0xa6, { NIB2__, NIB3__, NIB1__, NIB0__ } , 1, 1 }, - /* 0x6f8 */ { 0xe6, { NIB2__, NIB1__, BLANK_, NIB3__ } , 0, 0 }, - /* 0x6fa */ { 0xee, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x6fc */ { 0x82, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x6fe */ { 0x26, { NIB1__, NIB2__, NIB0__, NIB3__ } , 1, 1 }, - /* 0x700 */ { 0x66, { BLANK_, NIB3__, BLANK_, NIB2__ } , 1, 0 }, - /* 0x702 */ { 0x2c, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x704 */ { 0x7c, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x706 */ { 0x18, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x708 */ { 0xda, { BLANK_, NIB3__, BLANK_, NIB2__ } , 0, 0 }, - /* 0x70a */ { 0xde, { NIB2R1, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x70c */ { 0x6e, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x70e */ { 0x26, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x710 */ { 0xca, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x712 */ { 0xf0, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x714 */ { 0x82, { NIB3__, NIB2__, BLANK_, BLANK_ } , 1, 1 }, - /* 0x716 */ { 0xc0, { NIB0__, NIB3__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x718 */ { 0x8e, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x71a */ { 0x20, { NIB3__, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x71c */ { 0x4e, { NIB3__, NIB2__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x71e */ { 0xe0, { BLANK_, BLANK_, BLANK_, NIB3__ } , 1, 1 }, - /* 0x720 */ { 0x66, { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 1 }, - /* 0x722 */ { 0xdc, { NIB1__, NIB2__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x724 */ { 0xb2, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x726 */ { INPUT_PORT_C , { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, // dc.w $0726 ; 0x0001 - /* 0x728 */ { 0xd4, { NIB2__, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x72a */ { 0x86, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x72c */ { 0x78, { NIB0__, NIB2__, NIB3__, NIB1__ } , 0, 0 }, - /* 0x72e */ { 0xe4, { NIB1R2, NIB2__, NIB3__, BLANK_ } , 0, 1 }, - /* 0x730 */ { 0x3e, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x732 */ { 0x72, { NIB1__, NIB3__, NIB0__, NIB2__ } , 0, 0 }, - /* 0x734 */ { 0x64, { NIB2__, NIB1__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x736 */ { 0x68, { BLANK_, BLANK_, BLANK_, NIB3__ } , 0, 1 }, - /* 0x738 */ { 0x54, { NIB3R1, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x73a */ { 0x00, { NIB2R3, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x73c */ { INPUT_PORT_A , { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, // dc.w $073C - /* 0x73e */ { 0xae, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x740 */ { 0x6a, { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 0 }, - /* 0x742 */ { 0x2e, { NIB0__, NIB3__, NIB2__, NIB1__ } , 0, 0 }, - /* 0x744 */ { 0xf6, { NIB2__, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x746 */ { INPUT_PORT_C , { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 0 }, // dc.w $0746 ; 0x0001 dc.w $0746 ; 0x0001 ; xor - /* 0x748 */ { 0x44, { NIB0R3, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x74a */ { 0x14, { NIB2__, NIB1__, NIB0__, NIB3__ } , 0, 1 }, - /* 0x74c */ { 0xd2, { BLANK_, BLANK_, BLANK_, NIB3__ } , 1, 0 }, - /* 0x74e */ { INPUT_PORT_C , { NIB2__, NIB3__, NIB0__, NIB1__ } , 0, 0 }, // dc.w $074E ; 0x0100 - /* 0x750 */ { 0xaa, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x752 */ { 0xbe, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x754 */ { 0x76, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x756 */ { 0x60, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x758 */ { 0x70, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x75a */ { 0x4c, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 1, 1 }, - /* 0x75c */ { 0xbc, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x75e */ { 0x7e, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x760 */ { 0x32, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 0, 1 }, - /* 0x762 */ { 0x88, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x764 */ { 0xe2, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x766 */ { 0x66, { NIB2__, NIB1__, NIB0__, NIB3__ } , 0, 0 }, - /* 0x768 */ { 0x16, { NIB0__, NIB3__, NIB2__, NIB1__ } , 0, 1 }, - /* 0x76a */ { 0xfa, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x76c */ { 0x52, { NIB0R1, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x76e */ { 0xd6, { NIB0__, NIB3__, NIB1__, NIB2__ } , 0, 1 }, - /* 0x770 */ { INPUT_PORT_B , { NIB1__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x772 */ { 0xc4, { NIB1__, NIB3__, NIB0__, NIB2__ } , 1, 0 }, - /* 0x774 */ { 0x38, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x776 */ { 0x6c, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 1 }, - /* 0x778 */ { 0xfc, { NIB2__, NIB1__, NIB3__, BLANK_ } , 1, 1 }, - /* 0x77a */ { 0x84, { NIB0__, NIB2__, NIB3__, NIB1__ } , 0, 1 }, - /* 0x77c */ { 0xb6, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x77e */ { 0x62, { NIB3__, NIB1__, NIB2__, NIB0__ } , 0, 0 }, - /* 0x780 */ { 0xb8, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x782 */ { 0xa2, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x784 */ { 0x8a, { NIB2__, NIB0__, NIB1__, NIB3__ } , 0, 0 }, - /* 0x786 */ { 0x3a, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x788 */ { 0xf4, { NIB2__, NIB1__, NIB0__, NIB3__ } , 1, 1 }, - /* 0x78a */ { 0x40, { NIB1__, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x78c */ { 0x7a, { NIB1__, NIB2__, NIB3__, BLANK_ } , 0, 0 }, - /* 0x78e */ { 0x1c, { NIB2R3, NIB3__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x790 */ { 0x04, { NIB0R2, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x792 */ { 0x1a, { NIB2R1, NIB3__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x794 */ { 0x0e, { NIB1R3, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x796 */ { 0x30, { NIB3__, NIB0__, NIB2__, NIB1__ } , 1, 0 }, - /* 0x798 */ { 0x50, { NIB3__, NIB2__, NIB0__, NIB1__ } , 1, 1 }, - /* 0x79a */ { 0xc8, { NIB3R1, NIB0__, NIB1__, NIB2__ } , 1, 0 }, - /* 0x79c */ { 0xc6, { NIB1__, NIB2__, NIB0__, NIB3__ } , 0, 1 }, - /* 0x79e */ { 0x12, { NIB1__, NIB0__, NIB3__, NIB2__ } , 1, 1 }, - /* 0x7a0 */ { 0x6e, { NIB0__, NIB1__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x7a2 */ { 0x56, { NIB2__, NIB1__, BLANK_, NIB3__ } , 1, 0 }, - /* 0x7a4 */ { 0xe2, { NIB2__, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x7a6 */ { 0x00, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 0, 1 }, - /* 0x7a8 */ { 0xfa, { NIB3__, NIB1__, NIB2__, NIB0__ } , 1, 0 }, - /* 0x7aa */ { 0x76, { NIB1R3, NIB2__, NIB3__, NIB0__ } , 1, 0 }, - /* 0x7ac */ { 0x8e, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x7ae */ { 0xaa, { NIB1__, NIB0__, NIB3__, NIB2__ } , 0, 0 }, - /* 0x7b0 */ { 0x80, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x7b2 */ { 0x3a, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x7b4 */ { 0xf8, { BLANK_, NIB3__, BLANK_, BLANK_ } , 1, 0 }, - /* 0x7b6 */ { 0x02, { NIB0__, NIB2__, NIB3__, NIB1__ } , 1, 1 }, - /* 0x7b8 */ { 0x84, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x7ba */ { 0xd0, { NIB0__, NIB1__, NIB3__, NIB2__ } , 1, 1 }, - /* 0x7bc */ { 0xd6, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x7be */ { 0x66, { NIB2__, NIB1__, NIB0__, NIB3__ } , 1, 0 }, - /* 0x7c0 */ { 0xea, { NIB3R2, NIB0__, NIB1__, NIB2__ } , 0, 0 }, - /* 0x7c2 */ { 0xe8, { NIB3__, NIB2__, NIB0__, NIB1__ } , 0, 0 }, - /* 0x7c4 */ { 0x9c, { NIB2R2, NIB3__, BLANK_, BLANK_ } , 0, 0 }, - /* 0x7c6 */ { 0x02, { NIB3__, BLANK_, BLANK_, BLANK_ } , 1, 0 }, - /* 0x7c8 */ { 0x9a, { BLANK_, NIB2__, NIB3__, NIB1__ } , 1, 1 }, - /* 0x7ca */ { 0xa0, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x7cc */ { 0x0c, { NIB3R3, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x7ce */ { 0x80, { NIB3R3, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x7d0 */ { 0xec, { NIB1__, NIB2__, NIB0__, NIB3__ } , 0, 0 }, - /* 0x7d2 */ { 0x1e, { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x7d4 */ { 0xb4, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x7d6 */ { 0x28, { NIB3__, NIB2__, NIB1__, NIB0__ } , 0, 1 }, - /* 0x7d8 */ { 0xee, { NIB1__, NIB2__, BLANK_, NIB3__ } , 1, 1 }, - /* 0x7da */ { 0x56, { NIB2__, NIB0__, NIB1__, NIB3__ } , 1, 1 }, - /* 0x7dc */ { INPUT_PORT_A , { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 1 }, // dc.w $07DC ; nand - /* 0x7de */ { 0x2a, { NIB3__, NIB2__, NIB1__, NIB0__ } , 1, 1 }, - /* 0x7e0 */ { 0xf8, { NIB3__, NIB0__, NIB1__, NIB2__ } , 1, 1 }, - /* 0x7e2 */ { 0x96, { NIB1__, NIB2__, BLANK_, NIB3__ } , 1, 0 }, - /* 0x7e4 */ { 0x34, { BLANK_, NIB3__, BLANK_, NIB2__ } , 1, 1 }, - /* 0x7e6 */ { 0x36, { NIB1R1, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x7e8 */ { 0x4a, { NIB0__, NIB1__, NIB2__, NIB3__ } , 1, 0 }, - /* 0x7ea */ { 0x0a, { NIB3__, BLANK_, BLANK_, BLANK_ } , 0, 0 }, - /* 0x7ec */ { 0x66, { NIB3__, NIB2__, NIB0__, NIB1__ } , 1, 0 }, - /* 0x7ee */ { 0xc2, { NIB1R1, NIB2__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x7f0 */ { 0xba, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x7f2 */ { 0x5e, { NIB3__, NIB2__, BLANK_, BLANK_ } , 0, 1 }, - /* 0x7f4 */ { 0x5c, { NIB2__, NIB1__, NIB3__, BLANK_ } , 1, 0 }, - /* 0x7f6 */ { 0xac, { NIB0__, NIB1__, NIB2__, NIB3__ } , 0, 0 }, - /* 0x7f8 */ { 0x98, { NIB1__, NIB2__, NIB3__, NIB0__ } , 0, 1 }, - /* 0x7fa */ { 0x80, { NIB3R2, BLANK_, BLANK_, BLANK_ } , 1, 1 }, - /* 0x7fc */ { INPUT_PORT_C , { BLANK_, NIB3__, BLANK_, BLANK_ } , 0, 0 }, // dc.w $07FC ; Bit not present - /* 0x7fe */ { 0xd8, { NIB2R2, NIB3__, NIB0__, NIB1__ } , 1, 1 } -}; - -// callbacks -static UINT16 (*m_port_a_r)(); -static UINT16 (*m_port_b_r)(); -static UINT16 (*m_port_c_r)(); -static void (*m_soundlatch_w)(UINT16 sl); - -// configuration -static UINT8 m_bankswitch_swap_read_address; -static UINT16 m_magic_read_address_xor; -static INT32 m_magic_read_address_xor_enabled; -static UINT8 m_xor_port; -static UINT8 m_mask_port; -static UINT8 m_soundlatch_port; -static UINT8 m_external_addrswap[10]; -static deco146port_xx* m_lookup_table; - -// vars -static UINT16 m_rambank0[0x80]; -static UINT16 m_rambank1[0x80]; -static INT32 m_current_rambank; -static UINT16 m_nand; -static UINT16 m_xor; -static UINT16 m_soundlatch; -static UINT16 m_latchaddr; -static UINT16 m_latchdata; -static UINT8 m_configregion; // which value of upper 4 address lines accesses the config region -static INT32 m_latchflag; -static UINT8 region_selects[6]; - -INT32 deco_146_104_inuse = 0; - -static UINT16 reorder(UINT16 input, UINT8 *weights) -{ - UINT16 temp = 0; - for(INT32 i = 0; i < 16; i++) - { - if(input & (1 << i)) // if input bit is set - { - if(weights[i] != 0xFF) // and weight exists for output bit - { - temp |= 1 << weights[i]; // set that bit - } - } - } - return temp; -} - -static UINT16 read_data_getloc(UINT16 address, int& location) -{ - UINT16 retdata = 0; - - location = m_lookup_table[address>>1].write_offset; - - if (location==INPUT_PORT_A) - { - retdata = m_port_a_r(); - //bprintf(0, _T("port-a %X, "), retdata); - } - else if (location==INPUT_PORT_B) - { - retdata = m_port_b_r(); - //bprintf(0, _T("port-b %X, "), retdata); - } - else if (location==INPUT_PORT_C) - { - retdata = m_port_c_r(); - //bprintf(0, _T("port-c %X, "), retdata); - } - else - { - if (m_current_rambank==0) - retdata = m_rambank0[location>>1]; - else - retdata = m_rambank1[location>>1]; - } - - UINT16 realret = reorder(retdata, &m_lookup_table[address>>1].mapping[0] ); - - if (m_lookup_table[address>>1].use_xor) realret ^= m_xor; - if (m_lookup_table[address>>1].use_nand) realret = (realret & ~m_nand); - - return realret; -} - - -static UINT16 read_protport(UINT16 address, UINT16 mem_mask) -{ - // if we read the last written address immediately after then ignore all other logic and just return what was written unmodified - if ((address==m_latchaddr) && (m_latchflag==1)) - { - //logerror("returning latched data %04x\n", m_latchdata); - m_latchflag = 0; - return m_latchdata; - } - - m_latchflag = 0; - - if (m_magic_read_address_xor_enabled) address ^= m_magic_read_address_xor; - - int location = 0; - UINT16 realret = read_data_getloc(address, location); - - if (location == m_bankswitch_swap_read_address) // this has a special meaning - { - // logerror("(bankswitch) %04x %04x\n", address, mem_mask); - - if (m_current_rambank==0) - m_current_rambank = 1; - else - m_current_rambank = 0; - } - - - return realret; -} - -#define COMBINE_DATA(varptr) if (mem_mask == 0xffff) { *(varptr) = data; } else \ - if (mem_mask == 0xff00) { *(varptr) = (*(varptr) & ~mem_mask) | ((data << 8) & mem_mask); } else \ - { *(varptr) = (*(varptr) & ~mem_mask) | (data & mem_mask); } - -static void write_protport(UINT16 address, UINT16 data, UINT16 mem_mask) -{ - m_latchaddr = address; - m_latchdata = data; - m_latchflag = 1; - - if ((address&0xff) == m_xor_port) - { - //bprintf(0, _T("LOAD XOR REGISTER %04x %04x - "), data, mem_mask); - COMBINE_DATA(&m_xor); - //bprintf(0, _T("after %04x\n"), m_xor); - } - else if ((address&0xff) == m_mask_port) - { - //bprintf(0, _T("LOAD NAND REGISTER %04x %04x - "), data, mem_mask); - COMBINE_DATA(&m_nand); - //bprintf(0, _T("after %04x\n"), m_nand); - } - else if ((address&0xff) == m_soundlatch_port) - { - //bprintf(0, _T("LOAD SOUND LATCH %04x %04x - "), data, mem_mask); - COMBINE_DATA(&m_soundlatch); - //bprintf(0, _T("after %04x\n"), m_soundlatch); - m_soundlatch_w(data); - } - - // always store - if (m_current_rambank==0) { - COMBINE_DATA(&m_rambank0[(address&0xff)>>1]); - } - else - { - COMBINE_DATA(&m_rambank1[(address&0xff)>>1]); - } - -} -#undef COMBINE_DATA - -void deco_146_104_write_data(UINT16 address, UINT16 data, UINT16 mem_mask, UINT8 &csflags) -{ - address = BITSWAP16(address>>1, 15,14,13,12,11,10, m_external_addrswap[9],m_external_addrswap[8] ,m_external_addrswap[7],m_external_addrswap[6],m_external_addrswap[5],m_external_addrswap[4],m_external_addrswap[3],m_external_addrswap[2],m_external_addrswap[1],m_external_addrswap[0]) << 1; - - csflags = 0; - int upper_addr_bits = (address & 0x7800) >> 11; - - if (upper_addr_bits == 0x8) // configuration registers are hardcoded to this area - { - int real_address = address & 0xf; - //bprintf(0, _T("write to config regs %04x %04x %04x\n"), real_address, data, mem_mask); - - if ((real_address>=0x2) && (real_address<=0x0c)) - { - region_selects[(real_address-2)/2] = data &0xf; - return; - } - else - { - // unknown - } - - return; // or fall through? - } - - for (int i=0;i<6;i++) - { - int cs = region_selects[i]; - - if (cs==upper_addr_bits) - { - int real_address = address & 0x7ff; - csflags |= (1 << i); - - if (i==0) // the first cs is our internal protection area - { - //bprintf(0, _T("write matches cs table (protection) %01x %04x %04x %04x\n"), i, real_address, data, mem_mask); - write_protport(real_address, data, mem_mask); - } - else - { -// logerror("write matches cs table (external connection) %01x %04x %04x %04x\n", i, real_address, data, mem_mask); - } - } - } - - if (csflags==0) - { - //logerror("write not in cs table\n"); - } -} - -UINT16 deco_146_104_read_data(UINT16 address, UINT16 mem_mask, UINT8 &csflags) -{ - address = BITSWAP16(address>>1, 15,14,13,12,11,10, m_external_addrswap[9],m_external_addrswap[8] ,m_external_addrswap[7],m_external_addrswap[6],m_external_addrswap[5],m_external_addrswap[4],m_external_addrswap[3],m_external_addrswap[2],m_external_addrswap[1],m_external_addrswap[0]) << 1; - - UINT16 retdata = 0; - csflags = 0; - int upper_addr_bits = (address & 0x7800) >> 11; - - if (upper_addr_bits == 0x8) // configuration registers are hardcoded to this area - { - //int real_address = address & 0xf; - //logerror("read config regs? %04x %04x\n", real_address, mem_mask); - return 0x0000; - } - - // what gets priority? - for (int i=0;i<6;i++) - { - int cs = region_selects[i]; - - if (cs==upper_addr_bits) - { - int real_address = address & 0x7ff; - csflags |= (1 << i); - - if (i==0) // the first cs is our internal protection area - { - //bprintf(0, _T("read matches cs table (protection) %01x %04x %04x\n"), i, real_address, mem_mask); - return read_protport(real_address, mem_mask); - } - else - { - //logerror("read matches cs table (external connection) %01x %04x %04x\n", i, real_address, mem_mask); - } - } - } - - if (csflags==0) - { - //logerror("read not in cs table\n"); - } - - return retdata; -} - -// handy handlers - -static UINT16 deco146_104prot_r(UINT32 region, UINT32 offset, UINT16 mem_mask) -{ - INT32 deco146_addr = BITSWAP32(region + offset, 31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11, 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - return deco_146_104_read_data(deco146_addr, mem_mask, cs); -} - -static void deco146_104prot_w(UINT32 region, UINT32 offset, UINT16 data, UINT16 mem_mask) -{ - INT32 deco146_addr = BITSWAP32(region + offset, 31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11, 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - deco_146_104_write_data(deco146_addr, data, mem_mask, cs); -} - -void deco146_104_prot_wb(UINT32 region, UINT32 address, UINT8 data) -{ - deco146_104prot_w(region, address&0x3fff, data, 0xff00 >> ((address & 1) << 3)); -} - -UINT8 deco146_104_prot_rb(UINT32 region, UINT32 address) -{ - return deco146_104prot_r(region, address&0x3fff, 0xff00 >> ((address & 1) << 3)) >> ((~address & 1) << 3); -} - -void deco146_104_prot_ww(UINT32 region, UINT32 address, UINT16 data) -{ - deco146_104prot_w(region, address&0x3fff, data, 0xffff); -} - -UINT16 deco146_104_prot_rw(UINT32 region, UINT32 address) -{ - return deco146_104prot_r(region, address&0x3fff, 0xffff); -} - - -static UINT16 deco_146_port_dummy_cb() -{ - return 0x00; -} - -static void deco_146_soundlatch_dummy(UINT16 data) -{ -} - -void deco_146_104_set_port_a_cb(UINT16 (*port_cb)()) { m_port_a_r = port_cb; } -void deco_146_104_set_port_b_cb(UINT16 (*port_cb)()) { m_port_b_r = port_cb; } -void deco_146_104_set_port_c_cb(UINT16 (*port_cb)()) { m_port_c_r = port_cb; } -void deco_146_104_set_soundlatch_cb(void (*port_cb)(UINT16 sl)) { m_soundlatch_w = port_cb; } -void deco_146_104_set_interface_scramble(UINT8 a9, UINT8 a8, UINT8 a7, UINT8 a6, UINT8 a5, UINT8 a4, UINT8 a3,UINT8 a2,UINT8 a1,UINT8 a0) -{ - m_external_addrswap[9] = a9; - m_external_addrswap[8] = a8; - m_external_addrswap[7] = a7; - m_external_addrswap[6] = a6; - m_external_addrswap[5] = a5; - m_external_addrswap[4] = a4; - m_external_addrswap[3] = a3; - m_external_addrswap[2] = a2; - m_external_addrswap[1] = a1; - m_external_addrswap[0] = a0; -} - -void deco_146_104_set_use_magic_read_address_xor(INT32 use_xor) -{ - m_magic_read_address_xor_enabled = use_xor; -} - -void deco_146_104_set_interface_scramble_reverse() -{ - deco_146_104_set_interface_scramble(0,1,2,3,4,5,6,7,8,9); -} - -void deco_146_104_set_interface_scramble_interleave() -{ - deco_146_104_set_interface_scramble(4,5,3,6,2,7,1,8,0,9); -} - -static void deco_146_104_base_init() // called internally! -{ - deco_146_104_inuse = 1; - // default addressing - deco_146_104_set_interface_scramble(9, 8, 7, 6, 5, 4, 3, 2, 1, 0); - - // bind our handler - deco_146_104_set_port_a_cb(deco_146_port_dummy_cb); - deco_146_104_set_port_b_cb(deco_146_port_dummy_cb); - deco_146_104_set_port_c_cb(deco_146_port_dummy_cb); - deco_146_104_set_soundlatch_cb(deco_146_soundlatch_dummy); -} - -void deco_146_init() // called from driver -{ - deco_146_104_base_init(); - - m_bankswitch_swap_read_address = 0x78; - m_magic_read_address_xor = 0x44a; - m_magic_read_address_xor_enabled = 0; - m_xor_port = 0x2c; - m_mask_port = 0x36; - m_soundlatch_port = 0x64; - m_lookup_table = port_table_146; - m_configregion = 0x8; -} - -void deco_104_init() // called from driver -{ - deco_146_104_base_init(); - - m_bankswitch_swap_read_address = 0x66; - m_magic_read_address_xor = 0x2a4; - m_magic_read_address_xor_enabled = 0; - m_xor_port = 0x42; - m_mask_port = 0xee; - m_soundlatch_port = 0xa8; - m_lookup_table = port_table_104; - m_configregion = 0xc; -} - -void deco_146_104_exit() -{ - deco_146_104_inuse = 0; -} - -void deco_146_104_scan() -{ - SCAN_VAR(m_xor); - SCAN_VAR(m_nand); - SCAN_VAR(m_soundlatch); - - SCAN_VAR(m_rambank0); - SCAN_VAR(m_rambank1); - SCAN_VAR(m_current_rambank); - - SCAN_VAR(region_selects); - - SCAN_VAR(m_latchaddr); - SCAN_VAR(m_latchdata); - SCAN_VAR(m_latchflag); -} - -void deco_146_104_reset() -{ - for (INT32 i = 0; i < 0x80; i++) - { - // the mutant fighter old sim assumes 0x0000 - m_rambank0[i] = 0xffff; - m_rambank1[i] = 0xffff; - } - - region_selects[0] = 0; - region_selects[1] = 0; - region_selects[2] = 0; - region_selects[3] = 0; - region_selects[4] = 0; - region_selects[5] = 0; - - m_current_rambank = 0; - - m_soundlatch = 0x0000; - - m_latchaddr = 0xffff; - m_latchdata = 0x0000; - m_latchflag = 0; - - m_xor = 0; - m_nand = 0x0; -} - - diff --git a/jan/src/burn/drv/dataeast/deco146.h b/jan/src/burn/drv/dataeast/deco146.h deleted file mode 100644 index 87cb11c95..000000000 --- a/jan/src/burn/drv/dataeast/deco146.h +++ /dev/null @@ -1,69 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood, Charles MacDonald - -#include "bitswap.h" - -// handy handlers -void deco146_104_prot_wb(UINT32 region, UINT32 address, UINT8 data); -void deco146_104_prot_ww(UINT32 region, UINT32 address, UINT16 data); -UINT8 deco146_104_prot_rb(UINT32 region, UINT32 address); -UINT16 deco146_104_prot_rw(UINT32 region, UINT32 address); - -// raw handlers -void deco_146_104_write_data(UINT16 address, UINT16 data, UINT16 mem_mask, UINT8 &csflags); -UINT16 deco_146_104_read_data(UINT16 address, UINT16 mem_mask, UINT8 &csflags); - -// configuration -void deco_146_104_set_port_a_cb(UINT16 (*port_cb)()); // inputs -void deco_146_104_set_port_b_cb(UINT16 (*port_cb)()); // system -void deco_146_104_set_port_c_cb(UINT16 (*port_cb)()); // dips -void deco_146_104_set_soundlatch_cb(void (*port_cb)(UINT16 sl)); -void deco_146_104_set_interface_scramble(UINT8 a9, UINT8 a8, UINT8 a7, UINT8 a6, UINT8 a5, UINT8 a4, UINT8 a3,UINT8 a2,UINT8 a1,UINT8 a0); -void deco_146_104_set_interface_scramble_reverse(); -void deco_146_104_set_interface_scramble_interleave(); -void deco_146_104_set_use_magic_read_address_xor(INT32 use_xor); - -// init, etc. -void deco_146_init(); -void deco_104_init(); -// these 3 autoatically called from deco16Scan(), deco16Reset(), deco16Exit() -void deco_146_104_scan(); -void deco_146_104_reset(); -void deco_146_104_exit(); - -extern INT32 deco_146_104_inuse; - -#define BLK (0xff) -#define INPUT_PORT_A (-1) -#define INPUT_PORT_B (-2) -#define INPUT_PORT_C (-3) - -#define NIB3__ 0xc, 0xd, 0xe, 0xf -#define NIB3R1 0xd, 0xe, 0xf, 0xc -#define NIB3R2 0xe, 0xf, 0xc, 0xd -#define NIB3R3 0xf, 0xc, 0xd, 0xe - -#define NIB2__ 0x8, 0x9, 0xa, 0xb -#define NIB2R1 0x9, 0xa, 0xb, 0x8 -#define NIB2R2 0xa, 0xb, 0x8, 0x9 -#define NIB2R3 0xb, 0x8, 0x9, 0xa - -#define NIB1__ 0x4, 0x5, 0x6, 0x7 -#define NIB1R1 0x5, 0x6, 0x7, 0x4 -#define NIB1R2 0x6, 0x7, 0x4, 0x5 -#define NIB1R3 0x7, 0x4, 0x5, 0x6 - -#define NIB0__ 0x0, 0x1, 0x2, 0x3 -#define NIB0R1 0x1, 0x2, 0x3, 0x0 -#define NIB0R2 0x2, 0x3, 0x0, 0x1 -#define NIB0R3 0x3, 0x0, 0x1, 0x2 - -#define BLANK_ BLK, BLK, BLK, BLK - -struct deco146port_xx -{ - INT32 write_offset; - UINT8 mapping[16]; - INT32 use_xor; - INT32 use_nand; -}; diff --git a/jan/src/burn/drv/dataeast/deco16ic.cpp b/jan/src/burn/drv/dataeast/deco16ic.cpp deleted file mode 100644 index 3a388bc79..000000000 --- a/jan/src/burn/drv/dataeast/deco16ic.cpp +++ /dev/null @@ -1,1827 +0,0 @@ -/* -TO DO! - - DECO32 :) -*/ - - -#include "tiles_generic.h" -#include "bitswap.h" -#include "deco146.h" - -static INT32 deco16_layer_size[4]; -static INT32 deco16_layer_size_select[4]; - -static INT32 (*deco16_bank_callback[4])(const INT32 bank); - -static INT32 deco16_pf_colorbank[4]; -static INT32 deco16_pf_colormask[4]; -static INT32 deco16_pf_transmask[4]; - -static INT32 deco16_pf_bank[4]; - -static INT32 deco16_pf_gfx_bank[4]; // (1/2) 8x8, 16x16, (2/3) 8x8, 16x16 - -static UINT16 deco16_scroll_x[4][ 512]; // 512 (rowscroll) -static UINT16 deco16_scroll_y[4][1024]; // 1024 (colscroll) - -static INT32 deco16_scroll_rows[4]; -static INT32 deco16_scroll_cols[4]; - -static INT32 deco16_enable_rowscroll[4]; -static INT32 deco16_enable_colscroll[4]; - -static INT32 deco16_global_x_offset = 0; -static INT32 deco16_global_y_offset = 0; - -static INT32 deco16_yscroll[4]; // scroll y register -static INT32 deco16_xscroll[4]; // scroll x register - -static INT32 deco16_scroll_offset[4][2][2]; // tmap, size, x, y - -static UINT8 transmask[4][2][0x100]; - -INT32 deco16_graphics_mask[3]; - -UINT8 *deco16_graphics[3]; - -UINT16 *deco16_pf_control[2]; -UINT8 *deco16_pf_ram[4] = { NULL, NULL, NULL, NULL }; -UINT8 *deco16_pf_rowscroll[4];//4 or 2? - -UINT16 deco16_priority; - -UINT8 *deco16_prio_map; -UINT8 *deco16_sprite_prio_map; // boogwing - -INT32 deco16_vblank; - -INT32 deco16_music_tempofix; // set after deco16SoundInit(), fixes tempo issues in darkseal, vaportrail, and cbuster - -void deco16ProtScan(); -void deco16ProtReset(); - -INT32 deco16_get_tilemap_size(INT32 tmap) -{ - return deco16_layer_size_select[tmap]; -} - -// painfully unfast. -void deco16_draw_prio_sprite(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 pri, INT32 spri) -{ - gfx += code * 0x100; - - INT32 flip = 0; - if (flipx) flip |= 0x0f; - if (flipy) flip |= 0xf0; - - sy -= deco16_global_y_offset; - sx -= deco16_global_x_offset; - - for (INT32 yy = 0; yy < 16; yy++, sy++) { - - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 xx = 0; xx < 16; xx++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((yy * 16) + xx) ^ flip]; - - if (!pxl) continue; - - if (pri != -1) { - INT32 bpriority = deco16_prio_map[(sy * 512) + sx]; - - if (spri == -1) { - if ((pri & (1 << (bpriority & 0x1f))) || (bpriority & 0x80)) continue; - deco16_prio_map[sy * 512 + sx] |= 0x80; // right? - } else { - if (pri <= bpriority || spri <= deco16_sprite_prio_map[sy * 512 + sx]) continue; - deco16_sprite_prio_map[sy * 512 + sx] = spri; - deco16_prio_map[sy * 512 + sx] = pri; // right? - } - } - - dest[sy * nScreenWidth + sx] = pxl | color; - - deco16_prio_map[sy * 512 + sx] |= 0x80; // right? - } - - sx -= 16; - } -} - -void deco16_draw_prio_sprite_nitrobal(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 pri, INT32 spri) -{ - gfx += code * 0x100; - - INT32 flip = 0; - if (flipx) flip |= 0x0f; - if (flipy) flip |= 0xf0; - - sy -= deco16_global_y_offset; - sx -= deco16_global_x_offset; - - for (INT32 yy = 0; yy < 16; yy++, sy++) { - - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 xx = 0; xx < 16; xx++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((yy * 16) + xx) ^ flip]; - - if (!pxl) continue; - - if (pri != -1) { - INT32 bpriority = deco16_prio_map[(sy * 512) + sx]; - - if (pri > bpriority && spri > deco16_sprite_prio_map[sy * 512 + sx]) { - dest[sy * nScreenWidth + sx] = pxl | color; - deco16_prio_map[sy * 512 + sx] |= pri; // right? - } - deco16_sprite_prio_map[sy * 512 + sx] |= spri; - } - } - - sx -= 16; - } -} - -void deco16_draw_prio_sprite(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 pri) -{ - deco16_draw_prio_sprite(dest, gfx, code, color, sx, sy, flipx, flipy, pri, -1); -} - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s, UINT32 p) -{ - INT32 a = 256 - p; - - return (((((s & 0xff00ff) * p) + ((d & 0xff00ff) * a)) & 0xff00ff00) + - ((((s & 0x00ff00) * p) + ((d & 0x00ff00) * a)) & 0x00ff0000)) / 256; -} - -void deco16_draw_alphaprio_sprite(UINT32 *palette, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 pri, INT32 spri, INT32 alpha) -{ - if (alpha == 0) return; - - gfx += code * 0x100; - - INT32 flip = 0; - if (flipx) flip |= 0x0f; - if (flipy) flip |= 0xf0; - - sy -= deco16_global_y_offset; - sx -= deco16_global_x_offset; - - UINT32 *dest = (UINT32*)pBurnDraw; - - for (INT32 yy = 0; yy < 16; yy++, sy++) { - - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 xx = 0; xx < 16; xx++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((yy * 16) + xx) ^ flip]; - - if (!pxl) continue; - - INT32 bpriority = deco16_prio_map[(sy * 512) + sx]; - - if (spri == -1) { - if ((pri & (1 << (bpriority & 0x1f))) || (bpriority & 0x80)) continue; - deco16_prio_map[sy * 512 + sx] |= 0x80; // right? - } else { - if (pri <= bpriority || spri <= deco16_sprite_prio_map[sy * 512 + sx]) continue; - deco16_sprite_prio_map[sy * 512 + sx] = spri; - deco16_prio_map[sy * 512 + sx] = pri; // right? - } - - if (alpha == 0xff) { - dest[sy * nScreenWidth + sx] = palette[pxl | color]; - } else { - dest[sy * nScreenWidth + sx] = alpha_blend(dest[sy * nScreenWidth + sx], palette[pxl | color], alpha); - } - } - - sx -= 16; - } -} - -void deco16_palette_recalculate(UINT32 *palette, UINT8 *pal) -{ - UINT16 *p = (UINT16*)pal; - - for (INT32 i = 0; i < BurnDrvGetPaletteEntries() * 2; i+=2) - { - INT32 b = (BURN_ENDIAN_SWAP_INT16(p[i + 0]) >> 0) & 0xff; - INT32 g = (BURN_ENDIAN_SWAP_INT16(p[i + 1]) >> 8) & 0xff; - INT32 r = (BURN_ENDIAN_SWAP_INT16(p[i + 1]) >> 0) & 0xff; - - palette[i/2] = BurnHighCol(r, g, b, 0); - } -} - -void deco16_tile_decode(UINT8 *src, UINT8 *dst, INT32 len, INT32 type) -{ - INT32 Plane[4] = { ((len / 2) * 8) + 8, ((len / 2) * 8) + 0, 0x00008, 0x00000 }; - INT32 XOffs[16] = { 32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7, 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }; - - INT32 Plane1[8] = { 0x100000*8+8, 0x100000*8, 0x40000*8+8, 0x40000*8, 0xc0000*8+8, 0xc0000*8, 8, 0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return; - } - - memcpy (tmp, src, len); - - if (type == 2) { //16x16x8bpp - GfxDecode(4096, 8, 16, 16, Plane1, XOffs + 0, YOffs, 0x200, tmp, dst); - } else if (type == 1) { // 8x8 - GfxDecode((len * 2) / 0x040, 4, 8, 8, Plane, XOffs + 8, YOffs, 0x080, tmp, dst); - } else { - GfxDecode((len * 2) / 0x100, 4, 16, 16, Plane, XOffs + 0, YOffs, 0x200, tmp, dst); - } - - BurnFree (tmp); -} - -void deco16_sprite_decode(UINT8 *gfx, INT32 len) -{ - INT32 Plane[4] = { 24,8,16,0 }; - INT32 XOffs[16] = { 512,513,514,515,516,517,518,519, 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[16] = { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32,10*32,11*32,12*32,13*32,14*32,15*32}; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return; - } - - memcpy (tmp, gfx, len); - - GfxDecode((len * 2) / 0x100, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, gfx); - - BurnFree (tmp); -} - -INT32 deco16_y_skew = 0; - -void deco16_draw_layer_by_line(INT32 draw_start, INT32 draw_end, INT32 tmap, UINT16 *dest, INT32 flags) -{ - INT32 size = deco16_layer_size_select[tmap]; - if (size == -1) return; - if (deco16_y_skew) draw_end += deco16_y_skew; - - INT32 control = deco16_pf_control[tmap / 2][6]; - if (tmap & 1) control >>= 8; - -// INT32 control0 = deco16_pf_control[tmap / 2][5]; -// if (tmap & 1) control0 >>= 8; -// if ((control0 & 0x80) == 0) return; // layer disable bit - - INT32 select = (tmap & 2) + ((tmap < 2) ? size : 0); - - size = size ? 16 : 8; - - INT32 bpp = (flags & 0x100000) ? 8 : 4; - if (flags & 0x200000) bpp = 5; - - UINT8 *gfx = deco16_graphics[select]; - INT32 gfxmask = deco16_graphics_mask[select]; - - UINT16 *vram = (UINT16 *)deco16_pf_ram[tmap]; - - UINT8 *tmask = transmask[tmap][(flags & 0x00100) >> 8]; - UINT8 t_mask = (flags & 0x10000) ? 0 : 1; // enable using transparent pixels - - INT32 priority = flags & 0x000ff; - - INT32 tilebank = deco16_pf_bank[tmap]; - INT32 colmask = deco16_pf_colormask[tmap]; - INT32 colbank = deco16_pf_colorbank[tmap] >> bpp; - - INT32 hmask = (32 * size) - 1; - INT32 wmask = (deco16_layer_size[tmap] * size) - 1; - INT32 shift = (wmask & 0x100) ? 6 : 5; - INT32 smask = size - 1; - - for (INT32 y = draw_start; y < draw_end; y++) - { - INT32 xoff = deco16_scroll_x[tmap][((y + deco16_yscroll[tmap] + deco16_global_y_offset)&0x1ff)/deco16_scroll_rows[tmap]] & wmask; - - for (INT32 x = 0; x < nScreenWidth + size; x+=size) - { - INT32 yoff = deco16_scroll_y[tmap][((x + xoff) & wmask)/deco16_scroll_cols[tmap]] & hmask; - - INT32 yy = (y + yoff) & hmask; - INT32 xx = (x + xoff) & wmask; - - INT32 col = xx / size; - INT32 row = yy / size; - - INT32 ofst; - if (size == 8) { - ofst = (row << shift) | (col); - } else { - ofst = (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6); - } - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[ofst]); - INT32 color = code >> 12; - - INT32 flipx = 0; - INT32 flipy = 0; - - if ((color & 0x0008) && (control & 0x03)) { - flipx = control & 0x01; - flipy = control & 0x02; - color &= 0x07; - } - - code = ((code & 0xfff) | tilebank) & gfxmask; - color = (color & colmask) + colbank; - - { - color <<= bpp; - - INT32 sx = x - (xx & smask); - - INT32 sy = yy & smask; - if (flipy) sy ^= smask; - - UINT8 *src = gfx + (code * size * size) + (sy * size); - - if (flipx) flipx = smask; - - for (INT32 xxx = 0; xxx < size; xxx++) { - if ((xxx + sx) < 0 || (xxx + sx) >= nScreenWidth) continue; - - INT32 pxl = src[xxx^flipx]; - - if (tmask[pxl] && t_mask) continue; - if (y - deco16_y_skew >= 0) - dest[(y - deco16_y_skew) * nScreenWidth + xxx + sx] = pxl | color; - deco16_prio_map[y * 512 + xxx + sx] = priority; - } - } - } - } -} - -void deco16_draw_layer(INT32 tmap, UINT16 *dest, INT32 flags) -{ - deco16_draw_layer_by_line(0, nScreenHeight, tmap, dest, flags); -} - -void deco16_set_bank_callback(INT32 tmap, INT32 (*callback)(const INT32 bank)) -{ - deco16_bank_callback[tmap] = callback; -} - -void deco16_set_color_base(INT32 tmap, INT32 base) -{ - deco16_pf_colorbank[tmap & 3] = base; -} - -void deco16_set_color_mask(INT32 tmap, INT32 mask) -{ - deco16_pf_colormask[tmap & 3] = mask; -} - -void deco16_set_transparency_mask(INT32 tmap, INT32 mask) -{ - deco16_pf_transmask[tmap & 3] = mask; -} - -void deco16_set_gfxbank(INT32 tmap, INT32 small, INT32 big) -{ - deco16_pf_gfx_bank[0 + (tmap & 2)] = small; - deco16_pf_gfx_bank[1 + (tmap & 2)] = big; -} - -void deco16_set_global_offsets(INT32 x, INT32 y) -{ - deco16_global_x_offset = x; - deco16_global_y_offset = y; -} - -static void set_transmask(INT32 tmap, INT32 tmask0, INT32 tmask1) -{ - for (INT32 i = 0; i < 16; i++) { - transmask[tmap][0][i] = (tmask0 & (1 << i)) ? 1 : 0; - transmask[tmap][1][i] = (tmask1 & (1 << i)) ? 1 : 0; - } - - for (INT32 i = 16; i < 0x100; i++) { - transmask[tmap][0][i] = 0; - transmask[tmap][1][i] = 0; - } -} - -static void set_graphics_mask(INT32 gfx, INT32 len) -{ - INT32 b = 1; - - while (b < (len - 1)) { - b <<= 1; - } - - deco16_graphics_mask[gfx] = b - 1; -} - -void deco16_set_graphics(INT32 num, UINT8 *gfx, INT32 len, INT32 size /*tile size*/) -{ - deco16_graphics[num] = gfx; - - set_graphics_mask(num, len / (size * size)); -} - -void deco16_set_graphics(UINT8 *gfx0, INT32 len0, UINT8 *gfx1, INT32 len1, UINT8 *gfx2, INT32 len2) -{ - deco16_graphics[0] = gfx0; - deco16_graphics[1] = gfx1; - deco16_graphics[2] = gfx2; - - set_graphics_mask(0, len0 / (8 * 8)); - set_graphics_mask(1, len1 / (16 * 16)); - set_graphics_mask(2, len2 / (16 * 16)); -} - -void deco16_clear_prio_map() -{ - memset(deco16_prio_map, 0, 512 * 256); - memset(deco16_sprite_prio_map, 0, 512 * 256); -} - -void deco16_set_scroll_offs(INT32 tmap, INT32 size, INT32 offsetx, INT32 offsety) -{ - deco16_scroll_offset[tmap][size][0] = offsetx; - deco16_scroll_offset[tmap][size][1] = offsety; -} - -void deco16Init(INT32 no_pf34, INT32 split, INT32 full_width) -{ - set_transmask(0, 0x0001, 0xffff); - set_transmask(1, 0x0001, 0xffff); - set_transmask(2, 0x0001, 0xffff); - set_transmask(3, 0x0001, 0xffff); - - if (split) { - set_transmask(1, 0xff01, 0x00ff); - } - - memset (deco16_scroll_offset, 0, 4 * 2 * 2 * sizeof(INT32)); - - deco16_pf_ram[0] = (UINT8*)BurnMalloc(0x2000); // ok - deco16_pf_ram[1] = (UINT8*)BurnMalloc(0x2000); - - deco16_pf_rowscroll[0] = (UINT8*)BurnMalloc(0x2000);// plenty - deco16_pf_rowscroll[1] = (UINT8*)BurnMalloc(0x2000); - - deco16_pf_control[0] = (UINT16*)BurnMalloc(0x10); //1/2 - deco16_pf_control[1] = (UINT16*)BurnMalloc(0x10); //3/4 - - if (no_pf34 == 0) { - deco16_pf_ram[2] = (UINT8*)BurnMalloc(0x2000); // right? - deco16_pf_ram[3] = (UINT8*)BurnMalloc(0x2000); - - deco16_pf_rowscroll[2] = (UINT8*)BurnMalloc(0x1000); // right? - deco16_pf_rowscroll[3] = (UINT8*)BurnMalloc(0x1000); - } - - deco16_prio_map = (UINT8*)BurnMalloc(512 * 256); // priority map - deco16_sprite_prio_map = (UINT8*)BurnMalloc(512 * 256); - - deco16_bank_callback[0] = NULL; - deco16_bank_callback[1] = NULL; - deco16_bank_callback[2] = NULL; - deco16_bank_callback[3] = NULL; - - deco16_layer_size[0] = 64; - deco16_layer_size[1] = full_width ? 64 : 32; - deco16_layer_size[2] = (!no_pf34) ? (full_width ? 64 : 32) : 0; - deco16_layer_size[3] = (!no_pf34) ? (full_width ? 64 : 32) : 0; - - deco16_pf_transmask[0] = 15; - deco16_pf_transmask[1] = 15; - deco16_pf_transmask[2] = 15; - deco16_pf_transmask[3] = 15; - - deco16_pf_colormask[0] = 15; - deco16_pf_colormask[1] = 15; - deco16_pf_colormask[2] = 15; - deco16_pf_colormask[3] = 15; - - deco16_pf_bank[0] = 0; - deco16_pf_bank[1] = 0; - deco16_pf_bank[2] = 0; - deco16_pf_bank[3] = 0; - - deco16_pf_colorbank[0] = 0; - deco16_pf_colorbank[1] = 16 << 4; // 2 - deco16_pf_colorbank[2] = 0; - deco16_pf_colorbank[3] = 16 << 4; // 4 - - deco16_pf_gfx_bank[0] = 0; - deco16_pf_gfx_bank[1] = 1; - deco16_pf_gfx_bank[2] = 2; - - deco16_layer_size_select[0] = 1; //16x16 - deco16_layer_size_select[1] = 1; - deco16_layer_size_select[2] = 1; - deco16_layer_size_select[3] = 1; - - deco16_global_x_offset = 0; - deco16_global_y_offset = 0; - - deco16_priority = 0; -} - -void deco16Reset() -{ - memset (deco16_pf_rowscroll[0], 0, 0x1000); - memset (deco16_pf_rowscroll[1], 0, 0x1000); - - if (deco16_pf_rowscroll[2]) { - memset (deco16_pf_rowscroll[2], 0, 0x1000); - memset (deco16_pf_rowscroll[3], 0, 0x1000); - } - - memset (deco16_pf_control[0], 0, 16); - memset (deco16_pf_control[1], 0, 16); - memset (deco16_pf_ram[0], 0, 0x2000); - memset (deco16_pf_ram[1], 0, 0x2000); - - if (deco16_pf_ram[2]) { - memset (deco16_pf_ram[2], 0, 0x2000); - memset (deco16_pf_ram[3], 0, 0x2000); - } - - deco16_priority = 0; - - if (deco_146_104_inuse) - deco_146_104_reset(); -} - -void deco16Exit() -{ - BurnFree (deco16_prio_map); - - BurnFree (deco16_sprite_prio_map); - - for (INT32 i = 0; i < 4; i++) { - BurnFree (deco16_pf_rowscroll[i]); - deco16_pf_rowscroll[i] = NULL; - BurnFree (deco16_pf_ram[i]); - deco16_pf_ram[i] = NULL; - } - - BurnFree (deco16_pf_control[0]); - BurnFree (deco16_pf_control[1]); - - if (deco_146_104_inuse) - deco_146_104_exit(); -} - -static void pf_update(INT32 tmap, INT32 scrollx, INT32 scrolly, UINT16 *rowscroll, INT32 control0, INT32 control1) -{ - if (~tmap & 2) { - if (control1 & 0x80) { - deco16_layer_size_select[tmap] = (control0 & 0x80) ? 0 : -1; // 8x8 - } else { - deco16_layer_size_select[tmap] = (control0 & 0x80) ? 1 : -1; // 16x16 - } - } - - if (deco16_layer_size_select[tmap] == -1) return; // don't bother - - deco16_enable_rowscroll[tmap] = 0; - deco16_enable_colscroll[tmap] = 0; - - deco16_yscroll[tmap] = scrolly; - deco16_xscroll[tmap] = scrollx; - - if ((control1 & 0x40) == 0x40 && rowscroll != NULL) // row scroll - { - INT32 size = deco16_layer_size_select[tmap] ? 16 : 8; - - INT32 rows = 1; - INT32 row_sel = (control0 >> 3) & 0x0f; - if (row_sel < 9) rows = 0x200 >> row_sel; - - INT32 rownum = 512; - - if (size == 8) { - rows /= 2; - rownum /= 2; - if (rows == 0) rows = 1; - } - - if (rows != 1) deco16_enable_colscroll[tmap] = 1; - - INT32 rsize = rownum / rows; - - deco16_scroll_rows[tmap] = rsize; - - INT32 xscroll = scrollx + deco16_global_x_offset + deco16_scroll_offset[tmap][size/16][0]; - - for (INT32 r = 0; r < rows; r++) { - deco16_scroll_x[tmap][r & 0x1ff] = xscroll + BURN_ENDIAN_SWAP_INT16(rowscroll[r]); - } - - if (~control1 & 0x20) { - deco16_scroll_cols[tmap] = 0x8000; - deco16_scroll_y[tmap][0] = (scrolly + deco16_global_y_offset) & 0x1ff; - } - } - - if ((control1 & 0x20) == 0x20 && rowscroll != NULL) // column scroll - { - INT32 size = deco16_layer_size_select[tmap] ? 16 : 8; - - INT32 mask = (0x40 >> (control0 & 0x07)) - 1; - if (mask < 0) mask = 0; - - INT32 cols = 1024 / (8 << (control0 & 0x07)); - - INT32 colnum = 1024; - - if (size == 8) { - cols /= 2; - colnum /= 2; - if (cols == 0) cols = 1; - } - - if (cols != 1) deco16_enable_rowscroll[tmap] = 1; - - INT32 rsize = colnum / cols; - - deco16_scroll_cols[tmap] = rsize; - - for (INT32 r = 0; r < cols; r++) { - deco16_scroll_y[tmap][r] = (scrolly + BURN_ENDIAN_SWAP_INT16(rowscroll[(r & mask) + 0x200]) + deco16_global_y_offset) & 0x1ff; - } - - if (~control1 & 0x40) { - INT32 xscroll = scrollx + deco16_global_x_offset + deco16_scroll_offset[tmap][size/16][0]; - - deco16_scroll_rows[tmap] = 0x8000; - deco16_scroll_x[tmap][0] = xscroll; - } - } - - if ((control1 & 0x60) == 0x00) // normal scroll - { - INT32 size = deco16_layer_size_select[tmap] ? 16 : 8; - - deco16_scroll_rows[tmap] = 0x8000; - deco16_scroll_cols[tmap] = 0x8000; - - deco16_scroll_y[tmap][0] = (scrolly + deco16_global_y_offset) & 0x1ff; - - INT32 xscroll = scrollx + deco16_global_x_offset + deco16_scroll_offset[tmap][size/16][0]; - - deco16_scroll_x[tmap][0] = xscroll; - } -} - -void deco16_pf12_update() -{ - if (deco16_bank_callback[0]) deco16_pf_bank[0] = deco16_bank_callback[0](deco16_pf_control[0][7] & 0xff); - if (deco16_bank_callback[1]) deco16_pf_bank[1] = deco16_bank_callback[1](deco16_pf_control[0][7] >> 8); - - pf_update(0, deco16_pf_control[0][1], deco16_pf_control[0][2], (UINT16 *)deco16_pf_rowscroll[0], deco16_pf_control[0][5] & 0xff, deco16_pf_control[0][6] & 0xff); - pf_update(1, deco16_pf_control[0][3], deco16_pf_control[0][4], (UINT16 *)deco16_pf_rowscroll[1], deco16_pf_control[0][5] >> 8 , deco16_pf_control[0][6] >> 8); -} - -void deco16_pf34_update() -{ - if (deco16_bank_callback[2]) deco16_pf_bank[2] = deco16_bank_callback[2](deco16_pf_control[1][7] & 0xff); - if (deco16_bank_callback[3]) deco16_pf_bank[3] = deco16_bank_callback[3](deco16_pf_control[1][7] >> 8); - - pf_update(2, deco16_pf_control[1][1], deco16_pf_control[1][2], (UINT16 *)deco16_pf_rowscroll[2], deco16_pf_control[1][5] & 0xff, deco16_pf_control[1][6] & 0xff); - pf_update(3, deco16_pf_control[1][3], deco16_pf_control[1][4], (UINT16 *)deco16_pf_rowscroll[3], deco16_pf_control[1][5] >> 8 , deco16_pf_control[1][6] >> 8); -} - -void deco16_pf3_update() -{ - if (deco16_bank_callback[2]) deco16_pf_bank[2] = deco16_bank_callback[2](deco16_pf_control[1][7] & 0xff); - if (deco16_bank_callback[3]) deco16_pf_bank[3] = deco16_bank_callback[3](deco16_pf_control[1][7] >> 8); - - pf_update(2, deco16_pf_control[1][1], deco16_pf_control[1][2], (UINT16 *)deco16_pf_rowscroll[2], deco16_pf_control[1][5] & 0xff, deco16_pf_control[1][6] & 0xff); -} - -void deco16Scan() -{ - struct BurnArea ba; - - { - char name[32]; - - for (INT32 i = 0; i < 4; i++) { - if (deco16_pf_ram[i] == NULL) continue; - - memset(&ba, 0, sizeof(ba)); - ba.Data = deco16_pf_ram[i]; - ba.nLen = 0x2000; - sprintf (name, "Deco16ic RAM %d", i); - ba.szName = name; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = deco16_pf_rowscroll[i]; - ba.nLen = 0x1000; - sprintf (name, "Deco16ic Rowscroll %d", i); - ba.szName = name; - BurnAcb(&ba); - } - - memset(&ba, 0, sizeof(ba)); - ba.Data = (UINT8*)deco16_pf_control[0]; - ba.nLen = 16; - ba.szName = "Deco16ic Control 0"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = (UINT8*)deco16_pf_control[1]; - ba.nLen = 16; - ba.szName = "Deco16ic Control 1"; - BurnAcb(&ba); - - SCAN_VAR(deco16_priority); - SCAN_VAR(deco16_vblank); - - if (deco_146_104_inuse) - deco_146_104_scan(); - } -} - - -//--------------------------------------------------------------------------------------------------------------------------------------------------- -// Data East common sound routines - -#define ENABLE_HUC6280 - -#ifdef ENABLE_HUC6280 -#include "h6280_intf.h" -#endif - -#include "burn_ym2151.h" -#include "burn_ym2203.h" -#include "msm6295.h" - -static INT32 deco16_sound_enable[4]; // ym2203, ym2151, msm6295 0, msm6295 1 -static INT32 deco16_sound_cpuclock = 0; - -INT32 deco16_soundlatch; - -static void deco16YM2151IrqHandler(INT32 state) -{ -#ifdef ENABLE_HUC6280 - h6280SetIRQLine(1, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -#else - state = state; -#endif -} - -static INT32 deco16SynchroniseStream(INT32 nSoundRate) -{ -#ifdef ENABLE_HUC6280 - return (INT64)h6280TotalCycles() * nSoundRate / deco16_sound_cpuclock; -#else - return 0 * nSoundRate; -#endif -} - -static double deco16GetTime() -{ -#ifdef ENABLE_HUC6280 - return (double)h6280TotalCycles() / (deco16_sound_cpuclock * 1.0); -#else - return 0; -#endif -} - -static void deco16_sound_write(UINT32 address, UINT8 data) -{ -//bprintf (0, _T("%5.5x, %2.2x\n"), address, data); - - switch (address) - { - case 0x100000: - case 0x100001: - if (deco16_sound_enable[1]) { - BurnYM2203Write(0, address & 1, data); - } - return; - - case 0x110000: - BurnYM2151SelectRegister(data); - return; - - case 0x110001: - BurnYM2151WriteRegister(data); - return; - - case 0x120000: - case 0x120001: - MSM6295Command(0, data); - return; - - case 0x130000: - case 0x130001: - if (deco16_sound_enable[3]) { - MSM6295Command(1, data); - } - return; - - case 0x1fec00: - case 0x1fec01: -#ifdef ENABLE_HUC6280 - if (deco16_music_tempofix) return; - - h6280_timer_w(address & 1, data); -#endif - return; - - case 0x1ff400: - case 0x1ff401: - case 0x1ff402: - case 0x1ff403: -#ifdef ENABLE_HUC6280 - h6280_irq_status_w(address & 3, data); -#endif - return; - } -} - -static UINT8 deco16_sound_read(UINT32 address) -{ -//bprintf (0, _T("%5.5x, rb\n"), address); - - - switch (address) - { - case 0x100000: - case 0x100001: - if (deco16_sound_enable[1]) { - return BurnYM2203Read(0, address & 1); - } - return 0x00; - - case 0x110000: - return 0xff; - - case 0x110001: - return BurnYM2151ReadStatus(); - - case 0x120000: - case 0x120001: - return MSM6295ReadStatus(0); - - case 0x130000: - case 0x130001: - if (deco16_sound_enable[3]) { - return MSM6295ReadStatus(1); - } - return 0; - - case 0x140000: - case 0x140001: -#ifdef ENABLE_HUC6280 - h6280SetIRQLine(0, CPU_IRQSTATUS_NONE); -#endif - return deco16_soundlatch; - } - - return 0; -} - -void deco16SoundReset() -{ -#ifdef ENABLE_HUC6280 - h6280Open(0); - h6280Reset(); - h6280Close(); -#endif - - if (deco16_sound_enable[0]) BurnYM2151Reset(); - if (deco16_sound_enable[1]) BurnYM2203Reset(); - if (deco16_sound_enable[2]) MSM6295Reset(0); - if (deco16_sound_enable[3]) MSM6295Reset(1); - - deco16_soundlatch = 0; -} - -void deco16SoundInit(UINT8 *rom, UINT8 *ram, INT32 huc_clock, INT32 ym2203, void (ym2151_port)(UINT32,UINT32), double ym2151vol, INT32 msmclk0, double msmvol0, INT32 msmclk1, double msmvol1) -{ -#ifdef ENABLE_HUC6280 - h6280Init(0); - h6280Open(0); - h6280MapMemory(rom, 0x000000, 0x00ffff, MAP_ROM); - h6280MapMemory(ram, 0x1f0000, 0x1f1fff, MAP_RAM); - h6280SetWriteHandler(deco16_sound_write); - h6280SetReadHandler(deco16_sound_read); - h6280Close(); -#else - rom = rom; - ram = ram; -#endif - - deco16_sound_cpuclock = huc_clock; - - deco16_sound_enable[0] = 1; // ym2151 always enabled - deco16_sound_enable[1] = ym2203 ? 1 : 0; - deco16_sound_enable[2] = 1; // msm6295 #0 always enabled - deco16_sound_enable[3] = msmclk1 ? 1 : 0; - - BurnYM2151Init(3580000); - BurnYM2151SetAllRoutes(ym2151vol, BURN_SND_ROUTE_BOTH); - BurnYM2151SetIrqHandler(&deco16YM2151IrqHandler); - if (ym2151_port != NULL) { - BurnYM2151SetPortHandler(ym2151_port); - } - - if (ym2203) { - BurnYM2203Init(1, 4027500, NULL, deco16SynchroniseStream, deco16GetTime, 0); -#ifdef ENABLE_HUC6280 - BurnTimerAttachH6280(deco16_sound_cpuclock); -#endif - } - - MSM6295Init(0, msmclk0 / 132, 1); - MSM6295SetRoute(0, msmvol0, BURN_SND_ROUTE_BOTH); - - if (msmclk1) { - MSM6295Init(1, msmclk1 / 132, 1); - MSM6295SetRoute(1, msmvol1, BURN_SND_ROUTE_BOTH); - } - - deco16_music_tempofix = 0; -} - -void deco16SoundExit() -{ -#ifdef ENABLE_HUC6280 - h6280Exit(); -#endif - - if (deco16_sound_enable[0]) BurnYM2151Exit(); - if (deco16_sound_enable[1]) BurnYM2203Exit(); - if (deco16_sound_enable[2]) MSM6295Exit(0); - if (deco16_sound_enable[3]) MSM6295Exit(1); - - MSM6295ROM = NULL; - - deco16_sound_enable[0] = 0; - deco16_sound_enable[1] = 0; - deco16_sound_enable[2] = 0; - deco16_sound_enable[3] = 0; - - deco16_sound_cpuclock = 0; - deco16_music_tempofix = 0; -} - -void deco16SoundUpdate(INT16 *buf, INT32 len) -{ - if (deco16_sound_enable[0]) BurnYM2151Render(buf, len); -// if (deco16_sound_enable[1]) BurnYM2203Update(buf, len); - if (deco16_sound_enable[2]) MSM6295Render(0, buf, len); - if (deco16_sound_enable[3]) MSM6295Render(1, buf, len); -} - -void deco16SoundScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - h6280CpuScan(nAction); - - SCAN_VAR(deco16_soundlatch); - - if (deco16_sound_enable[0]) BurnYM2151Scan(nAction); - if (deco16_sound_enable[1]) BurnYM2203Scan(nAction, pnMin); - if (deco16_sound_enable[2]) MSM6295Scan(0, nAction); - if (deco16_sound_enable[3]) MSM6295Scan(1, nAction); - } -} - - -//--------------------------------------------------------------------------------------------------------------------------------------------------- -// Data East decryption routines - -static const UINT16 xor_masks[16] = -{ - 0xd556,0x73cb,0x2963,0x4b9a,0xb3bc,0xbc73,0xcbc9,0xaeb5, - 0x1e6d,0xd5b5,0xe676,0x5cc5,0x395a,0xdaae,0x2629,0xe59e, -}; - -static const UINT8 swap_patterns[8][16] = -{ - { 0xf,0x8,0x9,0xc,0xa,0xd,0xb,0xe, 0x2,0x7,0x4,0x3,0x1,0x5,0x6,0x0 }, - { 0xc,0xa,0xb,0x9,0x8,0xf,0xe,0xd, 0x6,0x0,0x3,0x5,0x7,0x4,0x2,0x1 }, - { 0x8,0xc,0xb,0x9,0xd,0xe,0xf,0xa, 0x4,0x6,0x5,0x0,0x3,0x1,0x7,0x2 }, - { 0x8,0x9,0xa,0xd,0xb,0xf,0xe,0xc, 0x5,0x4,0x0,0x7,0x2,0x6,0x1,0x3 }, - { 0xc,0xd,0xe,0xf,0x8,0x9,0xa,0xb, 0x1,0x5,0x0,0x3,0x2,0x7,0x6,0x4 }, - { 0xe,0xf,0xd,0x8,0xc,0xa,0xb,0x9, 0x1,0x2,0x7,0x6,0x4,0x3,0x0,0x5 }, - { 0xd,0xe,0xa,0xb,0x9,0x8,0xc,0xf, 0x3,0x1,0x7,0x4,0x5,0x0,0x2,0x6 }, - { 0x9,0x8,0xe,0xa,0xf,0xb,0xd,0xc, 0x6,0x0,0x5,0x2,0x4,0x1,0x3,0x7 }, -}; - -static const UINT8 deco56_xor_table[0x800] = -{ - 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9,10, 7,11,11, 9,11, 3, 7,10,12,13, 3,14, 0, 0, 9, 0,15, 3, 4,14, - 6, 3,14,14, 3,12, 3,13, 9, 5,13, 3, 8, 2, 7,14, 2, 5, 1, 2, 3, 4,14,11, 8, 0, 6, 7,10, 3, 4, 7, - 15, 1, 2, 7, 7,14,15, 0, 7, 9,15, 3,14,10, 9,12,11,12, 2, 8, 1,10, 9,14, 5, 6,15,10, 4,15, 5, 2, - 3, 2, 4,15, 7, 7,10,13, 1,13, 6, 6, 7, 5,10, 9, 5,15,14, 2, 7,12, 7, 4, 2,15,12,10,11,15, 4, 6, - 9, 3,11,13, 0, 3, 6, 4,15, 8, 3, 8, 0, 3,13, 8, 6, 0,11, 4, 9, 7,11, 1, 8, 1,10, 9, 2, 8,11,15, - 2, 8,10, 5, 3, 8, 0,10, 0,15, 3, 1,15, 3, 8, 6,13,11,10, 4,15, 4, 4, 3, 7, 7,15, 3,11,15,15, 2, - 3, 7,13, 4,10,12, 9, 8,11, 2, 5, 8, 7, 4,14, 0,12, 1,15,10, 3,10, 5,13, 1, 4, 0, 7, 7, 2, 8,15, - 12, 1, 9,14,12, 9,11, 5,13, 1,12,12,14, 8, 8,13, 4,13, 1,12,10, 1,10,15, 7, 5, 1,13,10,10,15, 1, - 3,14,13, 0, 0, 1, 3, 9, 5, 0, 4,13, 6,14, 2, 8, 3, 3, 5, 8, 1,10, 7, 5,13, 4, 2,12, 5, 1, 0, 4, - 4, 6,14,10, 6, 3,11,10, 0,10, 2, 3,11,11,15,13, 3,10, 3, 8, 3, 4, 7, 1, 5, 3, 9, 8,14,13,13, 4, - 1, 0, 1,12,12,12,11,11, 3, 7, 4,10,10, 3,10, 3, 1, 7, 4, 6, 2,12, 3, 3, 0, 0,10, 0, 6, 8, 0, 7, - 2,15,10,14, 1,14, 4,12, 4, 2, 3, 4, 8, 0,10,10,15, 1, 8, 4,11, 2,12, 6,12,12,12, 2, 4, 6, 3,12, - 4, 7,14,11,10, 6,13, 3, 4,14, 7, 5, 7, 5,10, 8, 5, 0, 7,12, 3, 7,14, 3, 3, 8, 0, 7, 6, 9,11,15, - 10,15, 9, 7, 0,13, 7, 3, 7, 4,10, 1, 7, 4, 3,15, 2, 6, 1,14,12,12,10,10, 1,11,15, 0,10, 7,12,15, - 8,10, 2,14,11, 0,10,12,13,15,12,15, 8,11, 5, 3, 0, 7,10, 6, 1, 9,11, 8, 4, 2, 4,12, 6, 3,15, 3, - 2, 1,10, 2, 2, 7,10, 6,11,12, 6, 2,11, 7,15, 1,13, 9,12, 3, 9,12, 2,12, 6, 5,11, 8, 0, 7,14,10, - 7, 8, 6, 5,12, 4, 1,12,12,13, 8, 4, 8,12, 8, 2, 1,15,13,14, 8, 6,11, 2,13, 5, 6,10, 9, 5, 7,11, - 5,11,13, 2, 0, 8, 2,10, 2, 1, 6, 4, 8,14, 0, 4, 8,11, 8,15,12, 0,15, 6, 1,13,15,10, 3,13,14,13, - 4, 5,12, 4, 3, 8, 9,15,13,11, 4, 8,10, 7,12, 7, 7, 9, 7,11,13, 0,15, 5,11, 5, 6, 2, 5, 1, 9, 2, - 9,15, 9, 8,14, 6,11, 7,10, 4,14,12, 3,12, 3, 0, 4, 8,11, 9, 5, 7,14, 1,10, 3, 2,12,12,10,12, 8, - 4, 5,10,13,11, 6,14, 4,13,14, 8, 3,10, 5, 6, 4, 4,10, 6, 5,12,11,10, 5, 9, 6, 7, 6, 4, 6, 3,15, - 5,14,14,13, 7, 6,12,13,15, 5,15,10, 2, 1,15, 3,10,15, 7, 4, 5, 2,10,15,14,15, 1,13,12, 9, 8,14, - 15, 3, 4, 1, 9,13,13, 3,12,15, 8,15, 7, 1,10,12,10, 9,12,10,14, 6, 5, 5, 4, 0,12,14,15, 6, 5, 5, - 2,14, 2, 6,14, 2,12, 7, 5, 1, 2, 3, 2,12,15, 4,10, 5,10,13, 0, 2, 2, 1, 5, 7, 5, 2, 0,13, 0, 4, - 13,13, 9,12, 5, 5,10,15, 6,11, 5, 2,11, 8, 0, 6, 9,13, 2, 6, 1,11, 5, 1,12, 8, 4, 7, 9,13, 4, 4, - 15, 3, 4, 5, 5, 0, 9, 4,10, 8, 1, 0,13, 8, 6,12,15,15,10, 7,10, 2, 6, 1, 4, 0, 2, 8, 3,10, 2,12, - 4, 1,12,15, 0, 1,10, 0,10,11, 6, 1, 0, 3, 2, 3, 4, 4, 9,14, 7, 3,13, 7,13, 9,14,12,10, 5, 4,14, - 0, 5,15, 8,12,12, 0, 5,11,15, 8, 7,15, 5,12, 5, 5, 3, 6,13,15,15, 7, 0, 3, 9, 1, 5, 7, 7,12, 5, - 3,12,10,11, 2,11, 5,10, 1, 3, 6, 2, 7, 1, 3, 0, 6, 8,12,15,14, 6,10,13, 9, 1,15, 4, 6,13,14, 7, - 2,13,12, 9, 4, 7, 9, 9, 6,10, 6,15,15, 2, 0, 4,12,12,10, 2, 7, 4,14,10, 2, 6, 5,12, 0,14, 1,15, - 13, 1, 4,13, 3,13, 6,15,11,15, 0,13,12, 5, 4,11,14,15, 6,13, 6, 7, 2, 2, 7,11, 6, 7,15, 0,13,10, - 6,14, 9,13,12,14, 4, 8, 5,13, 3,14, 6, 6,13, 8, 7, 7, 5, 8,12, 2, 6, 0, 6, 8, 2,13, 9,14, 3,15, - 1, 4,13, 3, 6, 8,15, 4, 8, 7, 4,10, 0, 9, 2,15, 2, 1, 3, 3, 1, 4, 0, 3, 1, 8, 5, 0,10, 0, 1, 6, - 11, 3,12, 0,14,11, 0, 5,15, 9, 1, 7,15,12,12,10, 2, 2, 3,15,13,13, 2,13,14,13,13, 8,11,10, 9, 9, - 9, 7, 7, 4, 9, 1, 9,10, 9, 9, 9,15,13,14,12,13, 6,11, 4, 6, 9,14, 6, 6, 7, 0, 8, 6,10, 7, 9,13, - 4, 8, 1, 8, 9, 9, 3,14,10,14,11, 7,15, 8,13,11, 9, 0, 5, 4, 4, 7, 6, 0,13, 9,13, 7, 9, 3, 2, 0, - 7,11, 5, 8, 8, 0,10, 3, 1, 4, 2,15,12, 5, 2, 6,15, 5,13, 6,12, 8,10, 9,12, 9, 1, 2,15,14, 5,11, - 13, 3, 6, 8,15, 5, 8, 2,10, 2, 8,14,15, 5, 4, 0,10, 2,14,14, 8, 8, 9, 9,11,11,12,11, 5, 4, 2,12, - 15,12, 1,11, 5,13, 0,12, 2, 4, 0, 0,12,12, 4,15, 7, 1, 2,13,10,10, 6, 4, 8, 6, 0,14,13, 1, 8, 3, - 10, 9,11,12, 6, 0,11,14, 1,13, 7, 4,11, 3,10, 0, 2,10,14,13, 7, 8,10, 7, 7,12,10,11, 3, 9,13, 8, - 0,10,10,13, 7,12, 8, 8, 5,15,10,15, 7, 1, 8, 2,12, 1,14,10,10, 4, 5, 7,11, 3, 7, 7, 1,12,12,12, - 1,14, 4, 0,11,15, 8,10, 1,14, 2,11, 5, 5,10,12, 2, 2, 1, 0,10, 0, 6, 2,10,13, 1,11,14, 0,12,11, - 8, 8,12, 4, 5, 5,14,14, 9, 8, 0,10, 1, 9,15,10,13, 5, 2, 7, 1, 2, 6, 5, 5,11, 0,13, 8, 0, 7, 2, - 15,11,15, 0, 5,15, 5, 6, 0, 2, 5, 3, 0,14,14, 4,11, 7, 7, 4,10,11, 1, 8,13, 9, 4,13, 3, 6, 1,10, - 1, 0,15,15,12,10, 6,11, 3, 4, 7, 8, 7,14, 8, 7,12,15, 9, 8, 7,14,14, 9,15, 8, 9, 4,12, 3,12,12, - 7, 8,11, 2, 4, 8, 4, 9, 4,11,15, 2,13, 6, 3,13, 1,13, 5, 0, 2,10, 5, 8, 1,13,14, 0,11,15, 8,12, - 10, 4, 5,10, 4,11,11, 2, 2,13, 2, 6, 0, 7, 4,11, 1,12, 6,13,14, 5, 9, 0, 5,13,14, 6,13, 3,13, 9, - 14,14, 0, 9,12,14, 9,10, 1, 2,12, 3, 3,15, 8, 4, 3, 1,13,13,13,13, 4, 3, 5,15, 8, 2,15,13,11, 7, - 4, 0,15,14, 1,13, 6, 8, 2, 8, 7,14,11, 7, 4, 1, 8,12,13,11, 0, 9, 0, 3,12,11, 2, 3, 9, 1, 3,13, - 4, 5,15,10, 5, 9, 0, 3, 9, 6,13, 7,15,13,11,13,12, 6,14,15, 3, 6,10, 3,11,10, 1, 4,13, 0,15,15, - 11, 0, 7,14, 9,15, 1,14, 2,13, 7,12,11, 7, 9, 6,11, 5,12, 4, 3, 6, 8, 3, 9, 0,15, 7, 1,11, 7,12, - 2,13,13, 3, 0,11, 1,11, 6, 1, 5, 5, 4, 5,12, 3, 3,15, 3,10, 7,12,15, 0,13,10, 0, 2, 6,12, 9, 5, - 3, 0, 0, 6, 3,13, 7,14,11,15, 7, 2, 2,11, 6,11, 9, 3,10,11, 1, 8, 1,13, 0,11, 2,10, 3,12, 4,11, - 0, 0,10,10, 2, 3,15, 0, 0, 9,14, 5,14,10,14, 0,13, 1, 1,12, 3, 3, 1,15, 8, 8,11,13, 8, 4, 8, 5, - 8, 7,13, 2, 1, 1,14,15, 1, 7, 7, 1,14, 1, 4,14, 0, 0, 7, 6, 5,11, 5, 8, 7, 1, 4, 3, 8,14, 5,11, - 13, 8, 1, 9, 6,12, 9, 6, 3, 3,11,12, 5,11, 4, 4, 3,11, 0, 0,10,10, 7,15,15,11, 1,11,13,11, 6, 8, - 2,15,10, 7, 0, 6, 3, 5, 2,14,12, 8,12,10,15, 8, 4,11, 8,13,11, 2, 5,13,10, 5, 9,10,15, 6, 3,12, - 3, 0,11,15, 5,13,12,13,12, 0, 8,12,10, 0, 5, 5, 3, 2,10, 5, 3,10, 7, 2,13,12,15,13, 1,10, 4,10, - 12,14,12, 1, 6,13, 6, 6, 0,13,11, 4, 5, 7, 1, 7, 7, 0, 4,13,13,12,14, 6, 1, 3,13,11, 1, 4, 9, 9, - 2,12, 8, 5,10,15, 2, 0,14, 9, 5, 8,11, 5, 3, 4, 7, 1, 2,13, 3, 8, 1, 3,11,12,11, 5, 1, 5,10,12, - 10, 2,10,13,12, 3, 9, 2,12,14,13, 8, 2, 1, 5, 3,15, 2, 8, 2, 1,15,10, 6,10, 3, 8, 9, 6, 9, 2,10, - 4,12,10,15,14,15, 1,15, 0,13, 6, 0, 5, 6,13,12, 2,14, 0,10, 6,15, 8, 8, 6, 8, 2,12,11, 3, 9, 5, - 9,15,11, 3,11,14,15, 6,14, 6, 7,12, 7,10, 6,14, 6, 6, 3, 5, 9,14, 7, 5, 8, 6, 2,12,15, 1, 2, 4, - 11, 6, 3, 0, 5,11,14,14,14, 4,13, 6,11, 6, 4,12,15, 2, 4, 1, 1, 5, 1,15, 7, 0, 5, 0, 0, 0,12, 1, -}; - -static const UINT16 deco56_address_table[0x800] = -{ - 0x527,0x1a1,0x2f6,0x523,0x297,0x005,0x141,0x3b4,0x539,0x794,0x6dd,0x498,0x59b,0x119,0x5db,0x631, - 0x2f1,0x565,0x409,0x158,0x2d6,0x16e,0x571,0x0b9,0x543,0x52b,0x668,0x0c0,0x5fd,0x216,0x5ea,0x24e, - 0x14b,0x09b,0x6d1,0x2f5,0x591,0x0b4,0x0a8,0x64a,0x39b,0x0d9,0x336,0x2a1,0x460,0x068,0x7b4,0x187, - 0x59a,0x2f0,0x5cd,0x181,0x7f7,0x733,0x223,0x581,0x4c5,0x1d4,0x11b,0x22a,0x688,0x738,0x130,0x202, - 0x12e,0x203,0x33e,0x4d0,0x2bd,0x0c4,0x042,0x614,0x6c2,0x385,0x3ed,0x7e2,0x2bb,0x2ef,0x3e1,0x654, - 0x73f,0x447,0x15f,0x41d,0x320,0x05a,0x2f4,0x116,0x1d6,0x0c2,0x4c1,0x0f3,0x694,0x28f,0x15c,0x125, - 0x343,0x291,0x33b,0x21e,0x031,0x4fa,0x76b,0x133,0x503,0x4e8,0x19c,0x3c6,0x24a,0x0b5,0x1df,0x71e, - 0x5ed,0x564,0x648,0x5d7,0x5c2,0x4a4,0x30e,0x750,0x474,0x11f,0x4a2,0x3bb,0x64c,0x258,0x4c7,0x586, - 0x071,0x362,0x593,0x252,0x2b0,0x5aa,0x053,0x047,0x6ef,0x669,0x6e8,0x011,0x093,0x443,0x33c,0x060, - 0x211,0x7d3,0x4c8,0x426,0x1c1,0x2e8,0x1fb,0x51a,0x402,0x49f,0x519,0x1c7,0x096,0x4e6,0x279,0x455, - 0x7ac,0x3a6,0x4af,0x736,0x1cb,0x45c,0x275,0x18c,0x776,0x6e0,0x5d4,0x59c,0x210,0x358,0x64f,0x2cf, - 0x0f4,0x307,0x577,0x7ba,0x296,0x0f6,0x1a3,0x09d,0x2c5,0x532,0x7bd,0x26c,0x171,0x727,0x5ba,0x2da, - 0x37b,0x707,0x366,0x10e,0x346,0x107,0x20a,0x4b1,0x12d,0x10b,0x603,0x788,0x2f7,0x6da,0x28b,0x08d, - 0x3ff,0x1e6,0x2a4,0x39f,0x454,0x112,0x2ec,0x441,0x0fa,0x054,0x3e5,0x3a2,0x1ec,0x322,0x53e,0x413, - 0x5b5,0x058,0x751,0x27a,0x3a7,0x2d1,0x16d,0x3f3,0x5f5,0x13e,0x122,0x1fe,0x069,0x7dd,0x213,0x424, - 0x36f,0x6f5,0x20e,0x431,0x5b2,0x25e,0x601,0x169,0x1a9,0x1cd,0x2e3,0x39e,0x338,0x7e5,0x5e5,0x7b1, - 0x3dc,0x464,0x065,0x255,0x246,0x71c,0x55c,0x3f7,0x5f6,0x0c8,0x1b4,0x148,0x284,0x69f,0x17f,0x4cd, - 0x6d4,0x63f,0x7ca,0x28a,0x75f,0x2df,0x708,0x442,0x00e,0x140,0x457,0x14f,0x63a,0x420,0x23e,0x672, - 0x440,0x716,0x3ca,0x1bb,0x622,0x367,0x018,0x109,0x3c1,0x206,0x7cb,0x42e,0x44c,0x613,0x61e,0x67c, - 0x396,0x06d,0x01b,0x0c9,0x40f,0x4b6,0x6b8,0x485,0x758,0x4d3,0x61b,0x34d,0x4fe,0x7a6,0x025,0x3eb, - 0x73a,0x79b,0x3db,0x312,0x190,0x35d,0x7b2,0x78b,0x248,0x010,0x075,0x12b,0x345,0x753,0x64b,0x163, - 0x374,0x557,0x4d8,0x25b,0x780,0x479,0x012,0x360,0x51c,0x3a1,0x0d0,0x020,0x137,0x5cf,0x7c5,0x189, - 0x679,0x352,0x7da,0x48a,0x18b,0x5fc,0x1fd,0x344,0x4dd,0x69e,0x761,0x542,0x65d,0x55b,0x755,0x4f9, - 0x427,0x501,0x329,0x6f2,0x2b4,0x1b6,0x319,0x459,0x3fb,0x6df,0x4ab,0x176,0x2fd,0x62f,0x1ca,0x1b3, - 0x1b7,0x2dc,0x674,0x56c,0x3ab,0x428,0x6c0,0x541,0x23d,0x283,0x6aa,0x5cb,0x231,0x713,0x014,0x79c, - 0x1af,0x3f2,0x32b,0x19b,0x0d2,0x25c,0x5be,0x1c5,0x383,0x50d,0x3e4,0x657,0x4bb,0x0e8,0x403,0x26b, - 0x14e,0x3b7,0x08f,0x31b,0x43f,0x375,0x2ca,0x6bc,0x678,0x13d,0x0e3,0x395,0x2ff,0x120,0x7eb,0x630, - 0x52d,0x369,0x36a,0x58c,0x538,0x04a,0x461,0x24f,0x717,0x73c,0x784,0x59f,0x0c3,0x340,0x476,0x207, - 0x6b7,0x31c,0x0da,0x729,0x2c0,0x7f0,0x3d5,0x67a,0x092,0x314,0x34f,0x2bc,0x6ee,0x32a,0x1a7,0x06b, - 0x40b,0x029,0x7fc,0x608,0x316,0x15a,0x113,0x3b8,0x22b,0x445,0x389,0x7a1,0x174,0x218,0x10d,0x29b, - 0x4a5,0x0e5,0x25f,0x250,0x75e,0x4c4,0x721,0x230,0x0d8,0x3c2,0x680,0x65f,0x25d,0x222,0x44d,0x57d, - 0x056,0x37f,0x4a9,0x30d,0x6de,0x7f5,0x423,0x2f9,0x3be,0x097,0x380,0x27c,0x5f1,0x2ba,0x1ea,0x2a5, - 0x162,0x0bd,0x4ff,0x5fa,0x3bf,0x01c,0x3ae,0x682,0x550,0x46a,0x13c,0x193,0x3cb,0x01e,0x6e9,0x03a, - 0x6d6,0x323,0x55a,0x74f,0x508,0x4f1,0x616,0x609,0x2b3,0x32c,0x0b7,0x584,0x77c,0x4c2,0x412,0x20d, - 0x21c,0x5f8,0x26f,0x69a,0x40d,0x50b,0x552,0x000,0x4e9,0x6e2,0x022,0x5d1,0x2f3,0x243,0x22d,0x706, - 0x304,0x76d,0x201,0x1e0,0x7be,0x3a9,0x074,0x1ac,0x57a,0x754,0x244,0x08a,0x425,0x561,0x6d3,0x48f, - 0x298,0x636,0x760,0x507,0x282,0x013,0x091,0x232,0x067,0x1ef,0x691,0x7e8,0x489,0x62e,0x289,0x487, - 0x3df,0x562,0x3e7,0x104,0x040,0x117,0x3d8,0x3f1,0x135,0x1b2,0x3cc,0x0e4,0x5e8,0x75c,0x595,0x2af, - 0x72f,0x361,0x0cf,0x5ca,0x3d1,0x049,0x002,0x347,0x287,0x337,0x799,0x404,0x7bc,0x0f1,0x101,0x467, - 0x1e2,0x544,0x095,0x37c,0x2fa,0x763,0x38f,0x376,0x722,0x035,0x2e1,0x28e,0x09e,0x4fb,0x26d,0x611, - 0x46c,0x5e7,0x563,0x6d2,0x724,0x2a0,0x475,0x24d,0x240,0x437,0x7c8,0x1dc,0x47a,0x356,0x72b,0x06a, - 0x765,0x499,0x1a8,0x7b0,0x73d,0x592,0x149,0x4cb,0x5a9,0x1e1,0x4ba,0x774,0x0b6,0x570,0x469,0x294, - 0x2d0,0x5df,0x5a3,0x16c,0x273,0x2b9,0x6c3,0x68a,0x5c6,0x041,0x768,0x4e3,0x0bc,0x077,0x21a,0x2db, - 0x0be,0x006,0x79a,0x17b,0x6ec,0x689,0x4b5,0x471,0x0f5,0x515,0x683,0x47d,0x576,0x5de,0x3b0,0x705, - 0x676,0x7d4,0x659,0x02c,0x49e,0x05e,0x02d,0x68c,0x3c8,0x4b9,0x5dd,0x390,0x0f0,0x42a,0x663,0x381, - 0x48b,0x06e,0x2be,0x0c7,0x42f,0x62c,0x568,0x5ee,0x212,0x559,0x3ec,0x3b9,0x180,0x4e2,0x1e9,0x303, - 0x446,0x387,0x6c9,0x52a,0x33d,0x7e4,0x325,0x5ff,0x554,0x290,0x675,0x7db,0x22f,0x578,0x5bf,0x3b6, - 0x4b7,0x7dc,0x5e2,0x18f,0x1ba,0x56a,0x78c,0x6af,0x5a2,0x749,0x4d6,0x208,0x400,0x43a,0x35f,0x286, - 0x251,0x332,0x030,0x6f6,0x0d3,0x786,0x3a5,0x214,0x087,0x667,0x378,0x29e,0x015,0x166,0x7ce,0x1f7, - 0x3e8,0x49c,0x787,0x6be,0x16f,0x0ba,0x7d6,0x458,0x488,0x783,0x7cf,0x588,0x5dc,0x6c4,0x70a,0x100, - 0x4fd,0x13a,0x078,0x715,0x1d2,0x633,0x32d,0x72a,0x6d5,0x6fd,0x78f,0x3d2,0x2c3,0x03e,0x17e,0x505, - 0x583,0x326,0x2ea,0x51b,0x44a,0x04d,0x3d7,0x1e4,0x0ab,0x3e6,0x124,0x3b1,0x368,0x2c2,0x6c6,0x68e, - 0x4ee,0x1d5,0x00c,0x430,0x71a,0x651,0x22e,0x20f,0x4ec,0x08e,0x292,0x086,0x589,0x435,0x6db,0x567, - 0x769,0x4f6,0x599,0x038,0x36d,0x448,0x4f7,0x3fa,0x082,0x3c0,0x021,0x4bf,0x5b9,0x277,0x023,0x422, - 0x0c6,0x6ab,0x4e5,0x044,0x00f,0x23a,0x664,0x36b,0x6fb,0x462,0x3d4,0x5ec,0x439,0x604,0x04c,0x546, - 0x0a2,0x14c,0x436,0x128,0x063,0x735,0x7cc,0x410,0x105,0x4d1,0x655,0x1b5,0x3a4,0x6ba,0x04b,0x634, - 0x7c6,0x1ce,0x3ef,0x11a,0x066,0x433,0x767,0x526,0x524,0x37a,0x5ad,0x0ec,0x4dc,0x38d,0x35b,0x4b2, - 0x54d,0x19d,0x172,0x495,0x692,0x545,0x6a8,0x5a0,0x164,0x407,0x742,0x145,0x1ab,0x7c4,0x285,0x299, - 0x1aa,0x66b,0x55d,0x594,0x69b,0x138,0x660,0x463,0x5b8,0x027,0x29d,0x57c,0x77a,0x481,0x797,0x7d9, - 0x732,0x7c1,0x6c1,0x416,0x701,0x78e,0x695,0x4a6,0x7ea,0x44f,0x7e6,0x106,0x5d9,0x57e,0x4f2,0x779, - 0x79f,0x509,0x2b5,0x22c,0x502,0x108,0x0b8,0x228,0x062,0x147,0x4fc,0x417,0x205,0x619,0x60b,0x308, - 0x7d7,0x1ee,0x555,0x0bf,0x398,0x04e,0x02e,0x061,0x4f3,0x699,0x182,0x48c,0x0e9,0x4b8,0x196,0x27e, - 0x1de,0x2b6,0x3d6,0x677,0x0d6,0x579,0x700,0x19a,0x3af,0x68d,0x51d,0x5d2,0x31e,0x4ae,0x617,0x1f8, - 0x47c,0x7b3,0x7e3,0x50f,0x470,0x3a3,0x6dc,0x0c1,0x46e,0x6b2,0x5ae,0x5e1,0x492,0x6b6,0x14d,0x178, - 0x1c9,0x798,0x781,0x0a5,0x23b,0x702,0x540,0x245,0x3d9,0x3b5,0x3ea,0x6ae,0x605,0x3de,0x0aa,0x179, - 0x2c9,0x2ae,0x0ee,0x6a0,0x262,0x4ac,0x0cc,0x60a,0x5b1,0x0cd,0x194,0x0ad,0x76c,0x73e,0x71d,0x5eb, - 0x7c0,0x486,0x0cb,0x200,0x551,0x1c6,0x3bc,0x686,0x696,0x12c,0x242,0x321,0x373,0x60f,0x635,0x56d, - 0x115,0x5e6,0x4da,0x704,0x48d,0x261,0x4f8,0x217,0x49a,0x6fa,0x085,0x56b,0x2ad,0x75a,0x5da,0x720, - 0x790,0x1f9,0x10f,0x55e,0x05d,0x21d,0x748,0x263,0x4d7,0x771,0x3bd,0x26e,0x07e,0x415,0x432,0x6eb, - 0x525,0x2ee,0x703,0x08b,0x274,0x310,0x533,0x1b0,0x21f,0x5f3,0x1b1,0x090,0x5a6,0x35e,0x7ad,0x6e5, - 0x330,0x4b0,0x175,0x4c6,0x70d,0x2d3,0x2b2,0x68b,0x5ef,0x650,0x003,0x081,0x1b9,0x46f,0x01f,0x026, - 0x7cd,0x2cb,0x642,0x0a6,0x764,0x7a3,0x58e,0x45a,0x63b,0x6ed,0x1db,0x5e4,0x78d,0x661,0x2e4,0x051, - 0x719,0x558,0x7fd,0x4d2,0x348,0x220,0x5e9,0x377,0x434,0x5d3,0x4a1,0x07a,0x301,0x7a9,0x33f,0x372, - 0x52e,0x582,0x70f,0x1d9,0x690,0x6f4,0x391,0x084,0x4a0,0x399,0x7af,0x6f0,0x5ac,0x7f6,0x1ae,0x392, - 0x77b,0x52c,0x7f9,0x2e7,0x0a9,0x5a7,0x3a0,0x6a1,0x5bc,0x6fc,0x32f,0x746,0x6bd,0x16b,0x42d,0x036, - 0x233,0x0f7,0x224,0x480,0x055,0x465,0x4aa,0x159,0x5fe,0x478,0x1c3,0x536,0x518,0x7c2,0x143,0x7e1, - 0x331,0x597,0x199,0x5ab,0x4d5,0x2de,0x0ed,0x0dc,0x317,0x229,0x4db,0x76e,0x351,0x5c1,0x618,0x684, - 0x54b,0x1f4,0x103,0x553,0x64e,0x2b1,0x271,0x775,0x1a5,0x239,0x521,0x51f,0x12f,0x418,0x466,0x134, - 0x468,0x0f9,0x15b,0x192,0x548,0x1bc,0x6b9,0x6e1,0x411,0x653,0x2c1,0x5f0,0x6cd,0x511,0x0af,0x7d1, - 0x5d6,0x5bd,0x3ad,0x34e,0x41a,0x0fd,0x4f4,0x33a,0x666,0x146,0x1dd,0x30f,0x5a8,0x254,0x69d,0x44e, - 0x42c,0x1f1,0x5fb,0x37d,0x3b2,0x080,0x7d8,0x2ac,0x221,0x1ad,0x66f,0x0eb,0x0e6,0x649,0x7fe,0x2a2, - 0x673,0x18e,0x535,0x5cc,0x644,0x293,0x65e,0x1f6,0x573,0x150,0x3da,0x237,0x238,0x3c3,0x45b,0x1f2, - 0x4d4,0x43d,0x1d0,0x63d,0x429,0x386,0x64d,0x46d,0x620,0x7ae,0x453,0x2c7,0x57b,0x697,0x6e7,0x2dd, - 0x5e3,0x09f,0x019,0x41b,0x6e3,0x43e,0x363,0x0db,0x62d,0x341,0x215,0x37e,0x3e9,0x1da,0x32e,0x647, - 0x21b,0x406,0x793,0x58f,0x560,0x0b2,0x569,0x607,0x2cd,0x640,0x38e,0x38a,0x388,0x4c9,0x652,0x185, - 0x219,0x7bf,0x7ab,0x1eb,0x472,0x4ad,0x226,0x2fe,0x53f,0x270,0x739,0x313,0x032,0x7f3,0x70c,0x3e0, - 0x2a9,0x259,0x5b7,0x08c,0x3c7,0x6ad,0x15d,0x2fb,0x10a,0x75d,0x66e,0x4e4,0x1fa,0x68f,0x643,0x2b8, - 0x6bf,0x497,0x6ff,0x405,0x490,0x170,0x50e,0x073,0x693,0x1d8,0x59d,0x53c,0x1e8,0x711,0x740,0x637, - 0x624,0x45e,0x483,0x6f3,0x09a,0x513,0x5bb,0x34c,0x414,0x54c,0x007,0x757,0x74a,0x2a3,0x355,0x017, - 0x72e,0x379,0x5a1,0x4a3,0x2c4,0x671,0x731,0x572,0x65c,0x5d0,0x034,0x1be,0x31f,0x300,0x7b8,0x2d2, - 0x0fe,0x57f,0x7fb,0x6a4,0x227,0x260,0x1c2,0x052,0x0ef,0x5ce,0x547,0x510,0x0f2,0x6ce,0x6ac,0x04f, - 0x2d7,0x0d5,0x5a5,0x29a,0x256,0x3ac,0x195,0x048,0x752,0x6d9,0x606,0x2e6,0x7ff,0x05c,0x3f6,0x0d4, - 0x623,0x602,0x5b3,0x58a,0x77e,0x6f8,0x3f5,0x698,0x587,0x78a,0x450,0x7c7,0x2e9,0x66c,0x49d,0x01d, - 0x2ce,0x046,0x1d1,0x357,0x628,0x718,0x0dd,0x13b,0x685,0x600,0x741,0x072,0x4eb,0x646,0x71f,0x165, - 0x05b,0x63e,0x043,0x136,0x66d,0x0fc,0x500,0x0f8,0x23f,0x31a,0x35a,0x7bb,0x45f,0x710,0x264,0x58d, - 0x2f2,0x079,0x656,0x154,0x444,0x03c,0x12a,0x7b9,0x60e,0x315,0x364,0x3f8,0x725,0x575,0x365,0x7aa, - 0x6e6,0x796,0x009,0x008,0x6a3,0x2ab,0x549,0x47b,0x2a7,0x778,0x730,0x627,0x7f2,0x743,0x3a8,0x39c, - 0x598,0x67f,0x1bd,0x65b,0x71b,0x615,0x6d8,0x27f,0x714,0x13f,0x7d0,0x0e0,0x126,0x118,0x2a6,0x7d2, - 0x4cf,0x2aa,0x60d,0x3dd,0x19f,0x24c,0x225,0x6a7,0x60c,0x7ee,0x6e4,0x41f,0x6ea,0x001,0x687,0x6cc, - 0x6f7,0x514,0x40c,0x4de,0x11c,0x39a,0x1e3,0x53d,0x327,0x050,0x276,0x632,0x11d,0x183,0x0c5,0x3fe, - 0x2a8,0x00b,0x30b,0x4f0,0x79d,0x257,0x3f0,0x15e,0x43c,0x6f1,0x110,0x596,0x2c6,0x5c5,0x0bb,0x318, - 0x77d,0x306,0x1cc,0x267,0x5b6,0x161,0x151,0x160,0x638,0x7f4,0x1d3,0x1e7,0x452,0x6b1,0x057,0x197, - 0x324,0x482,0x333,0x712,0x3ba,0x1a2,0x3f9,0x6ca,0x099,0x266,0x25a,0x17a,0x61d,0x1b8,0x556,0x4b3, - 0x6a6,0x0ac,0x67b,0x792,0x66a,0x0ca,0x098,0x74d,0x75b,0x522,0x629,0x512,0x53a,0x73b,0x529,0x156, - 0x65a,0x094,0x48e,0x737,0x123,0x129,0x1c0,0x18a,0x662,0x7ec,0x6cf,0x438,0x6cb,0x14a,0x4d9,0x728, - 0x534,0x658,0x06c,0x70b,0x184,0x3fc,0x46b,0x791,0x665,0x7df,0x744,0x3fd,0x3ee,0x0e1,0x394,0x56e, - 0x496,0x30a,0x7f1,0x55f,0x6a9,0x28d,0x770,0x2fc,0x41e,0x0ff,0x204,0x494,0x186,0x1c8,0x155,0x2eb, - 0x328,0x5d5,0x49b,0x50c,0x0e7,0x76a,0x235,0x47e,0x62a,0x0fb,0x3f4,0x7c9,0x280,0x4c3,0x7a4,0x756, - 0x0e2,0x5c3,0x24b,0x064,0x305,0x3e2,0x38b,0x7a8,0x31d,0x3d3,0x132,0x2ed,0x0b1,0x61f,0x02b,0x342, - 0x18d,0x00a,0x62b,0x4be,0x72c,0x1ff,0x5c7,0x7de,0x295,0x0b3,0x059,0x7d5,0x253,0x20b,0x1f5,0x5f7, - 0x27d,0x0a3,0x45d,0x7f8,0x1a0,0x088,0x43b,0x1ed,0x037,0x6f9,0x153,0x747,0x269,0x612,0x16a,0x265, - 0x370,0x574,0x504,0x354,0x7a7,0x2b7,0x2d9,0x54a,0x7a0,0x745,0x421,0x734,0x528,0x0d1,0x371,0x4cc, - 0x585,0x07b,0x477,0x58b,0x3cd,0x278,0x38c,0x03b,0x349,0x40a,0x7e7,0x6b4,0x6c5,0x19e,0x493,0x4e7, - 0x4a8,0x382,0x610,0x72d,0x566,0x36c,0x5c8,0x766,0x083,0x34b,0x789,0x7ed,0x0b0,0x173,0x139,0x144, - 0x28c,0x4e1,0x20c,0x3b3,0x41c,0x1bf,0x2e0,0x1a4,0x1f0,0x004,0x77f,0x7ef,0x114,0x63c,0x34a,0x27b, - 0x070,0x4e0,0x537,0x4b4,0x127,0x302,0x033,0x47f,0x5f4,0x3cf,0x3c4,0x07f,0x272,0x102,0x6b5,0x121, - 0x516,0x5f9,0x7b6,0x076,0x334,0x5c0,0x2e2,0x339,0x3e3,0x6b0,0x69c,0x0ea,0x56f,0x168,0x5e0,0x167, - 0x3c9,0x639,0x191,0x762,0x7b5,0x795,0x384,0x772,0x3ce,0x76f,0x02f,0x23c,0x773,0x249,0x2c8,0x03d, - 0x74c,0x06f,0x09c,0x0ae,0x6a2,0x131,0x4ea,0x1fc,0x309,0x2d8,0x3d0,0x51e,0x7e0,0x209,0x111,0x234, - 0x01a,0x782,0x2e5,0x506,0x35c,0x7a5,0x2cc,0x517,0x30c,0x0d7,0x759,0x26a,0x4ce,0x401,0x1f3,0x10c, - 0x449,0x29f,0x5b4,0x79e,0x6c7,0x028,0x530,0x681,0x397,0x00d,0x670,0x2d5,0x5af,0x520,0x0a4,0x6a5, - 0x0df,0x723,0x039,0x4a7,0x281,0x70e,0x1e5,0x0de,0x02a,0x5c4,0x777,0x456,0x142,0x451,0x785,0x17d, - 0x393,0x491,0x419,0x6d0,0x645,0x247,0x11e,0x0a1,0x580,0x473,0x3aa,0x709,0x17c,0x6bb,0x177,0x52f, - 0x268,0x0a7,0x4ca,0x626,0x7a2,0x54e,0x484,0x4f5,0x4bd,0x5f2,0x198,0x4df,0x1c4,0x5a4,0x2d4,0x157, - 0x4c0,0x241,0x531,0x40e,0x44b,0x2f8,0x0a0,0x1d7,0x350,0x152,0x67d,0x6b3,0x6c8,0x288,0x36e,0x7c3, - 0x621,0x67e,0x4ef,0x7b7,0x7fa,0x359,0x408,0x6d7,0x29c,0x5c9,0x590,0x045,0x3c5,0x5b0,0x59e,0x0ce, - 0x50a,0x236,0x1a6,0x641,0x54f,0x61c,0x05f,0x61a,0x74e,0x74b,0x016,0x6fe,0x311,0x39d,0x4ed,0x353, - 0x625,0x4bc,0x335,0x42b,0x5d8,0x07d,0x03f,0x089,0x7e9,0x07c,0x1cf,0x024,0x188,0x53b,0x2bf,0x726, -}; - -static const UINT8 deco56_swap_table[0x800] = -{ - 4,0,7,2,0,0,7,2,0,1,6,3,2,2,2,2,0,5,6,3,7,0,0,5,1,1,1,7,1,0,0,0, - 2,5,6,6,2,0,4,1,5,0,1,7,4,7,0,4,6,2,1,5,3,1,2,4,6,4,2,0,4,3,3,7, - 2,7,0,6,0,5,0,2,2,6,4,0,3,5,5,7,0,4,7,5,4,5,6,3,5,5,3,6,2,0,0,4, - 2,3,7,5,6,4,7,4,3,2,0,0,0,1,5,4,0,3,7,3,1,6,4,1,2,6,7,4,1,3,0,7, - 1,7,2,6,5,6,5,1,6,7,0,3,4,6,5,0,6,2,2,6,4,6,7,3,2,3,2,4,0,0,4,5, - 6,5,0,3,0,6,0,6,0,6,7,1,3,5,0,4,5,3,7,4,3,3,5,1,2,1,6,7,1,6,7,6, - 0,5,2,4,5,1,0,6,3,3,4,1,0,1,1,6,3,4,7,0,4,1,6,5,5,2,2,3,5,3,0,6, - 6,7,4,4,7,3,3,2,0,6,3,0,4,7,7,6,1,1,1,7,1,5,3,7,6,4,6,2,2,4,1,5, - 4,6,5,3,5,5,4,2,7,4,7,4,3,3,5,7,4,0,3,0,4,3,2,2,2,5,0,3,5,7,0,7, - 2,7,7,7,2,3,3,6,4,0,3,7,2,5,1,2,1,0,5,4,3,5,5,3,6,3,4,6,2,2,1,4, - 2,5,4,3,0,4,0,3,6,4,7,1,7,2,3,7,6,2,3,3,4,1,5,7,0,0,6,7,5,2,2,7, - 1,5,7,4,6,3,0,4,4,3,6,6,5,1,1,6,6,1,1,5,1,5,1,4,1,6,5,6,2,6,6,0, - 7,7,3,4,0,3,5,7,4,5,1,6,1,7,5,6,4,6,7,0,7,6,5,2,4,6,2,5,5,3,6,6, - 5,6,2,5,1,7,6,1,3,5,1,4,6,6,6,4,6,0,4,2,5,6,5,0,4,5,1,1,2,2,1,3, - 4,7,3,3,2,0,2,7,6,3,3,3,2,6,4,5,6,4,0,0,6,5,2,5,1,6,1,5,0,2,4,0, - 0,5,6,0,5,1,7,1,5,7,6,5,7,3,2,1,2,0,4,5,7,4,3,5,0,6,1,6,1,6,2,6, - 3,5,6,3,1,1,6,6,4,0,0,7,5,3,2,4,4,3,4,3,3,2,3,3,6,0,1,6,0,7,7,7, - 6,7,5,5,7,0,6,7,4,7,3,5,4,5,0,1,1,7,0,4,1,0,0,3,2,6,2,6,4,5,4,6, - 3,3,4,4,7,4,4,5,3,3,0,0,3,5,2,5,3,4,4,0,5,2,6,5,6,3,0,5,2,3,3,2, - 5,7,0,4,1,7,0,5,7,5,3,6,1,5,2,4,3,4,7,7,5,7,7,5,5,2,5,4,7,2,5,5, - 2,0,3,3,6,4,7,1,7,5,5,0,6,3,4,3,7,7,1,0,2,2,3,0,2,0,6,5,4,0,4,5, - 6,0,3,7,5,0,3,4,0,6,7,0,2,3,6,3,5,6,3,4,6,0,1,1,2,2,1,6,6,1,6,1, - 2,6,0,6,5,4,5,5,5,4,7,3,6,6,5,6,5,5,0,6,4,2,2,4,2,7,5,7,7,0,1,5, - 5,3,4,1,6,4,3,0,1,5,0,2,0,7,4,1,6,4,5,3,4,4,4,6,5,4,7,6,5,1,6,3, - 6,6,0,1,2,2,7,6,5,1,0,2,7,4,3,6,5,5,4,5,6,5,5,0,6,7,0,5,3,0,7,0, - 6,0,3,3,4,6,0,3,5,7,4,5,0,1,1,5,3,4,3,5,2,6,6,1,1,2,7,1,2,1,5,7, - 3,2,3,6,7,5,4,7,1,7,2,1,7,0,5,5,1,2,6,5,0,6,5,6,3,0,5,3,0,5,5,1, - 0,3,0,5,1,5,6,3,2,7,4,1,0,5,6,3,7,5,1,3,0,3,1,0,0,1,1,7,4,0,7,4, - 4,5,4,7,3,7,6,6,1,1,2,5,7,6,4,1,1,5,6,7,1,1,2,7,1,3,6,4,1,3,6,3, - 5,3,5,6,2,0,4,5,3,5,1,1,0,4,2,6,6,5,3,2,5,5,1,0,4,3,5,7,6,3,4,4, - 7,1,6,2,2,2,0,3,3,4,5,1,6,2,0,5,3,0,7,3,6,3,6,7,4,0,0,3,7,4,6,1, - 1,1,6,0,0,0,7,1,2,3,5,5,2,3,0,3,7,2,5,1,3,5,4,0,4,6,2,2,0,7,7,7, - 2,5,3,4,7,7,3,2,3,5,4,1,6,7,0,7,3,7,0,6,0,2,7,6,2,6,1,6,5,0,0,0, - 2,2,2,2,5,5,5,6,5,0,4,1,1,2,2,0,3,5,5,5,6,3,5,1,3,0,1,4,1,0,0,3, - 1,5,3,1,0,5,5,6,4,5,3,0,3,3,1,4,4,4,4,2,7,7,7,0,1,6,1,1,1,7,7,5, - 6,4,7,5,3,6,6,1,1,6,7,1,4,4,7,7,6,0,6,4,6,7,6,6,3,3,1,1,3,7,3,1, - 0,4,4,3,4,2,2,4,7,1,5,1,5,0,3,4,7,3,7,4,5,3,5,4,0,2,0,7,6,0,4,0, - 6,0,7,1,3,4,7,0,0,6,7,5,7,7,2,2,0,7,2,4,7,1,6,1,1,5,5,5,2,5,3,5, - 1,1,5,0,5,4,3,2,2,0,3,1,2,2,6,7,2,7,4,1,4,5,6,0,1,0,6,4,2,1,7,2, - 2,2,4,1,3,0,3,5,7,2,1,1,3,6,2,5,5,7,4,2,7,5,5,5,1,4,4,0,7,2,0,6, - 0,6,2,5,4,7,6,2,1,2,4,5,1,2,3,5,1,6,2,3,0,0,7,5,0,1,0,5,7,7,0,7, - 2,6,0,0,3,6,1,0,4,0,5,1,5,7,4,3,1,5,7,7,6,4,7,3,3,4,6,5,0,4,7,6, - 4,1,2,4,0,4,3,1,5,6,3,1,7,0,2,4,0,2,6,0,7,0,3,3,4,5,2,2,0,6,6,0, - 3,7,7,1,5,0,2,1,5,1,1,5,2,4,5,3,1,6,4,7,6,3,4,3,5,3,6,7,7,4,4,3, - 2,4,0,6,7,4,1,6,2,6,0,2,3,5,3,0,2,2,5,5,2,3,1,5,1,0,0,0,6,3,6,3, - 3,5,6,4,0,4,2,6,3,5,1,2,7,1,3,0,3,3,0,2,3,2,7,0,7,7,4,6,2,4,7,0, - 7,5,6,7,2,2,0,2,5,0,0,3,2,7,3,3,5,7,5,4,3,6,2,2,6,4,3,7,2,6,5,7, - 7,7,6,0,2,6,7,2,4,0,1,0,3,5,3,4,3,1,7,7,5,4,0,1,6,3,0,7,6,4,5,4, - 7,3,0,5,3,5,0,6,2,3,5,0,4,2,5,3,1,1,3,7,4,1,2,7,7,4,1,6,3,7,7,7, - 6,6,4,1,1,3,1,3,4,7,5,6,2,7,2,5,1,1,6,7,0,7,6,3,4,1,4,0,1,2,6,0, - 5,2,2,2,7,7,1,7,0,0,4,5,3,3,7,5,0,4,4,4,0,5,7,0,0,6,7,7,4,1,1,6, - 1,1,0,1,4,5,2,6,0,4,4,5,7,0,3,7,4,6,6,2,1,7,6,4,7,1,7,2,5,5,6,6, - 5,5,0,5,2,0,3,4,4,7,3,7,1,2,1,2,4,0,3,3,3,4,2,3,0,1,7,0,0,0,4,0, - 7,2,1,5,6,3,4,6,2,6,6,3,5,4,3,4,0,4,7,4,7,7,0,2,1,6,7,0,6,7,5,7, - 4,0,3,4,5,4,6,7,1,7,5,3,6,7,1,7,1,0,5,5,7,3,2,6,7,4,4,2,6,7,3,4, - 1,7,4,1,5,3,3,5,3,4,6,4,4,6,0,4,2,6,0,4,3,1,7,2,7,7,1,7,1,0,4,6, - 4,7,1,7,6,3,3,3,6,0,3,6,2,3,6,2,6,4,5,3,1,2,1,6,7,5,0,0,4,0,7,0, - 6,1,1,2,2,7,6,2,5,4,4,6,3,5,4,7,3,1,4,0,0,2,4,1,4,6,3,6,0,7,2,3, - 0,7,7,1,7,0,1,2,7,3,7,2,7,5,1,3,6,2,7,2,0,1,3,5,2,3,4,4,2,4,4,3, - 4,4,0,3,7,2,6,6,6,0,0,7,1,0,1,5,0,1,7,1,4,3,7,7,6,1,0,4,3,3,1,2, - 0,5,6,3,1,2,5,6,0,0,0,4,2,0,1,6,2,4,0,1,5,4,7,1,2,2,7,7,5,3,6,3, - 3,5,4,0,5,3,0,1,5,5,4,0,5,0,1,1,3,6,4,2,3,1,5,5,7,4,0,5,7,0,6,6, - 6,6,7,3,2,2,5,4,0,6,1,1,6,0,4,3,2,0,4,0,3,4,7,3,3,5,7,1,3,5,2,3, - 6,5,6,0,1,1,6,0,6,1,7,2,4,5,6,5,0,4,0,3,2,3,7,7,0,3,5,0,4,1,1,1, -}; - -static const UINT8 deco74_xor_table[0x800] = -{ - 13,13, 0,10, 8,15,12, 0,10, 8,13,15,12, 3,15, 2,11, 1, 8,10,13, 4,10,12,11, 2, 0, 3, 0,11, 8,11, - 5,14,11, 2, 5, 3, 8,11, 8,13,14, 4, 3,13,11,10,14, 6, 9,11,11, 8, 0,15, 2, 4, 5, 7,15, 8,13,11, - 7, 0,12, 3,13, 3, 1, 2, 6,14,10, 3,15,11,15, 7,13,14, 4, 6, 1,10,14, 8, 4,15, 2, 8,15, 9, 3,11, - 15,11, 1,14,11, 5, 6,14, 3, 9,12,14,15,12, 6,15,12,13, 3,15, 4, 0, 8, 0, 6, 8, 0, 1, 6,10,14, 9, - 12,15, 3, 5,11, 4, 9, 6, 9,13,12, 0,12,14, 9, 9,13,10,15, 8,15, 4, 9, 3,15,15,14, 8, 9, 0,10,11, - 15,15, 1,15,10, 6,11,15, 7,11, 8,15, 2,12,15,15, 1,14,10,13, 0,14, 4, 3,12,13, 3, 5, 7, 0, 4, 1, - 3, 5,13, 2, 0, 7, 2,13, 3, 7, 9, 2,15, 0, 2, 2, 2, 8, 6, 6,14, 2,15,11, 8, 0, 1,15, 5, 4, 2,15, - 13, 1, 1,13, 4,10,15, 3,14, 2,12, 8, 9, 8,13, 2, 0,14, 2, 9, 0, 2,12, 3, 4,15,13, 8, 4,12, 3,11, - 13,15, 5, 8, 7, 7, 7,15, 5,11,10, 4, 2, 1, 4,11,11,11, 8,10, 1,13, 5, 3, 1, 5, 8,15,10, 3,10, 9, - 4,14, 2, 8, 6,14,14, 9, 7, 2,15, 0,15, 5,10, 3, 5,12,10, 0, 7, 2, 1,11, 4,13,10,14, 3, 1, 1, 1, - 9,10,11, 0,14, 0, 1,11, 1, 2, 4,14, 9, 1,12,15, 0,10,11, 6,10, 4, 9, 1, 1, 5, 4, 3,15, 9,11, 0, - 7,12,10, 9, 3,14, 4,11,11, 3, 2,10, 1,12, 4, 3,11, 1, 9, 1,15, 9, 3,11,12, 7,11, 6,15, 8, 1, 3, - 10,12,10, 4, 2,13,13,11, 3,13, 1, 2, 7,13, 6, 6, 7,14,12,15, 9, 7,15, 7,15, 6, 5,11, 5, 1,15,11, - 11, 7,14,12,12, 4,11, 3, 8, 9, 8,15,12, 8,10, 6, 0,12, 5, 9, 6, 7,10, 6, 1, 6,13, 1, 3,10, 8, 2, - 1,13, 9, 4, 6,11, 2, 6, 2,15, 4,13, 3, 0, 7, 0, 9, 0, 6,14, 2,12,11, 0, 5,12, 7, 2, 6, 0, 2,10, - 10, 5, 1,12, 5,14,12, 1,13, 2, 6,11, 7,10, 0, 0, 7, 1, 8,10, 2, 3, 6, 4,11,10,10,13,15, 0,14,10, - 3, 8,14,10, 0, 7, 2, 4, 4, 4, 0, 9,15, 9,14, 3, 4, 3, 5, 4, 7,15, 6,13, 7,12, 1,12,10, 1, 8,15, - 5,15,12,13,14,14, 0, 4, 0, 0, 5, 0, 6,14, 8,14,14, 1,11, 5, 5,11, 3, 0, 2,15,11, 2, 7, 1,14,10, - 14, 3, 1, 5, 5,10, 1,10,13,13, 9, 9, 2, 1, 6, 7, 6, 7,11,15, 6, 6, 4,12, 8, 4, 3, 0, 0,15, 8, 2, - 2,14, 1, 8,11, 7,11,10, 3,10, 6,10,14,10,14, 6, 1, 3, 5, 2, 2, 5, 5, 5, 8, 3,12,15, 6, 9,12,10, - 4, 8,11, 6, 1, 8, 9,15,15,10, 0, 6,11, 8, 2, 9,15, 2, 2,10, 0, 5, 6, 5,11, 0, 0, 6, 0, 1,13, 6, - 4, 4, 4, 1, 4, 0, 9,12, 2,10,13, 5,10,12,15,10,12, 3, 4, 7,10,13, 3,15,12,11, 6, 8,13, 2, 8,10, - 3,12,13, 9,10, 4, 2,11, 1, 4, 9, 1,11, 2,14, 5, 2, 0,10,12, 0, 6, 7, 0, 2,10,15, 9, 0, 0, 8, 1, - 0, 9, 1,14, 0,13,12,13, 9, 6,10,12,10, 0,13, 3, 7, 4,12, 0,11, 0, 0,11, 5, 0,14,15,11, 8, 2, 5, - 4, 6, 5, 9,13, 5, 4, 4,13, 4, 0,12,10, 3, 2, 2, 0,13,11,12, 4,12, 9, 7,13,14,14, 8, 5, 0,13, 0, - 1, 4,15,15, 9, 8, 5,12,13, 8,12, 8, 8,10, 0,15, 8,11, 5, 6, 9, 8,10,12, 9,12, 5,14, 6, 9, 7,15, - 1, 9,15, 0, 1, 9, 1, 2, 8, 1, 4,12, 1, 4, 9, 7, 2,10, 8, 1,13, 6, 0,12, 0, 6,12,13, 5, 9, 4,12, - 7,14,10, 4, 6, 8,12, 4, 9, 1, 2, 2, 3,13,10, 2,15, 7, 1, 6, 0,12, 5,10, 9, 1, 0,14,15, 3, 7, 6, - 9,12,13, 7, 0,13, 2, 5, 7,13, 1, 3, 8,15, 9,10, 3, 0,15, 2,11, 5, 7, 3,10, 7, 4, 0, 7, 2,10, 2, - 0, 3, 6, 6,13, 0, 5, 9,13, 8,11, 9, 0, 4, 1,11,15, 5,15, 3, 1,15, 1,15,12, 8, 9, 4, 1, 5, 8,11, - 5, 7, 6,11, 5, 7,15,15, 9, 4, 7,12,14,11, 8, 6, 7, 7,12, 3, 9,12, 6, 9, 5, 8,13,14, 6,14, 4, 7, - 12,12, 2,14,10, 2, 1,10, 3, 8,12,11,12, 7,12,15, 7,13, 9,15, 6, 3, 1,14,13,14, 8,11,14, 4, 9, 2, - 13,13, 0, 2, 9,11, 3, 2, 4,11, 6, 8, 2,14, 7,15, 8, 8, 9, 5, 4,15,11, 7,13, 7, 4,15,15, 4, 2, 1, - 6, 4, 3,15, 0,11,14,15, 6,15,11,14,10, 4, 4, 0, 5, 4, 6,15, 8,10,15, 1, 3, 8,13, 3, 3, 0, 7, 7, - 2, 3, 2,11,14, 1,12,13,10, 2, 4,13, 4,13, 9, 3, 2, 1,14, 9, 8,11,15, 4, 8, 9,13, 2,10,14, 2, 4, - 8,13,13,14,12, 1, 5,15,13, 3,12, 8,11,12,12, 1, 0,15, 9, 2, 6, 9, 3,12, 5, 0,10, 8, 5, 6,11,14, - 7, 7, 0,10, 0,14,10, 8, 4,12, 5, 3,11,10, 5,13,15, 9,14,12,12, 0,14, 3, 2,12, 9,14,11,11, 9, 2, - 8, 9,13, 0,10, 3,14,14,13, 6, 4,14, 2,10,10, 9,10, 4, 5, 4, 5, 3, 4, 6,15, 5,14, 2, 6,10, 4, 8, - 6, 9, 9, 7, 3, 3, 9, 5, 9, 8,10, 5, 0,13, 7, 8, 4, 1, 3,13, 4, 1, 8,10, 3,11,13, 3,12, 0, 2, 0, - 3, 1, 3, 3, 1, 6,13, 2, 3,13,11, 5, 9, 0, 4,12, 6,11, 4, 4, 3, 3,12, 7,13, 2,15,12, 1,11,15, 7, - 10, 0, 9, 3, 3,13,12,12, 9,14, 2, 2, 0, 3,12, 2, 0,15, 0,10, 1, 9, 8, 3, 2, 3, 9, 1, 4, 5,12, 9, - 10,11, 0, 2, 2,11, 5,13, 8, 1, 7, 8, 4,12,11, 1, 2,11, 7, 7, 8, 6, 5, 8, 8,14, 2, 6,10, 6, 1, 9, - 3, 4, 2, 9,11, 1, 4, 9, 8,13, 5, 0,15,13, 0, 9, 9,11, 5,11, 6, 4, 6, 9, 5, 1,13, 8, 8, 2,14,14, - 2, 3,14,12, 4, 6,15, 4,11,14, 7, 2, 3,14, 4,15, 4, 1, 8,13, 5, 5, 7, 0, 6,14, 0, 1, 1,13, 5,10, - 10,14,14,10, 2, 9, 1,11, 5, 6, 8,12, 4, 2, 7, 7,11, 6,13,15, 1, 3, 9, 0,14,12, 9, 2, 3, 2, 1, 9, - 12, 7, 4,12,14, 3, 3, 2, 3,14,10, 5, 8, 4, 9, 9,11,14,13,15,14, 7, 3,13, 0, 9, 4, 9,12,12, 1, 2, - 10,11, 7,11, 1, 9, 2, 8, 1, 4, 5,14, 8,15, 9, 3, 8, 9, 6, 3, 7, 3, 1,10, 7, 5,13,14, 8, 7, 4,10, - 14, 4, 6, 9, 6, 2, 5, 3, 8, 0, 9, 7, 2, 7,12, 8,12, 2,15, 4, 5, 0,11, 8,11, 2,14, 8,15, 0, 8, 9, - 14, 5, 4,13,12,11, 2, 6,11, 9, 9, 7,14, 6, 6, 7, 4, 6, 3, 5,12, 5,11, 1,12,14, 0,13,15,13, 2, 2, - 1, 8, 3,11, 3, 1, 6, 9,12,12, 5,10, 7,13,15, 4,12,10, 9,11,12,14,12,11,15, 2, 3, 2, 7, 8,15, 2, - 2, 0,12,12, 9,11,13,14,13, 7, 3,11,11,14,12, 3, 2, 7, 4, 8, 9,11, 8,11, 5,10, 3, 7,15,11,12,15, - 10, 8, 5,13, 8, 3, 9, 8, 5, 7, 1,15,15, 0,13, 7, 8, 6, 8,10, 8, 6, 6, 3, 4,10,13, 1, 6, 6,10, 1, - 2,11, 4,15,15, 3, 1, 1,14,12, 1,15, 1, 6, 8,10,14,14, 9, 4, 7, 8, 6, 5, 3, 1, 0, 5, 3, 8, 6, 1, - 4, 2,13,15,14, 5,13,11,10,13,11,11, 6,10, 7, 2, 1,15, 2,10, 5, 0,11, 5,15, 8, 0,14, 3,12,11, 7, - 10, 1, 4, 0, 3,15, 7,15,12, 8, 9, 0, 1,15,13, 2, 3, 2,15,15,14,14, 7, 8,12,11,15,15,14, 2, 8, 8, - 2, 0,15, 4, 2, 5,14,10, 4,12, 2, 1, 0,13, 7, 5, 4, 3,11, 6, 0, 2, 6,14, 9,14,10,13, 6,10, 5, 8, - 15, 2, 4, 7, 1, 8, 5, 3,11, 5,12, 1, 3, 1,14, 4, 8,12, 6,10,14, 7,14, 7,15,14, 5,10, 6, 9, 3, 6, - 12,15, 1,12, 0, 6, 1, 4,13,13, 7, 1, 7, 1, 9, 1, 8, 6, 9, 9, 8,12, 5, 2, 8,11, 9, 1, 3, 9, 0,11, - 14, 8, 5, 9, 7, 7,14, 4, 6, 1, 6,11, 4, 0,15, 5, 9, 8, 5,13, 2, 6,13,10,12, 3, 4, 3,15, 5, 6,14, - 2,10,14, 1, 5, 9, 6, 1, 9, 2, 7,11,14, 7,14, 5, 8, 9,14,13,14, 8, 3, 8, 4,10, 3,14, 0,13,12,15, - 9, 9, 0, 4, 6, 7,12,13,12, 1,15, 2,13,13, 8,10,13, 5,12, 5, 4, 0, 2, 1,13,12, 2,14, 9,15,13, 9, - 7,13, 7, 0,14, 7,12,15, 3,11, 0, 5, 8, 1, 0,12, 9, 0,11,13, 6, 3, 3, 7, 2, 2, 3, 5,14,14, 0, 9, - 2, 6, 4,12, 2, 6, 3,12, 3,13, 3,14, 7, 1, 8,15,14, 3, 0,10, 2,15,15, 9,14,11,10,12,13,13,13, 9, - 7, 7,12, 5, 3,14, 1, 5, 1,10, 6, 7, 9, 8,15, 7,13,11, 4, 5, 4,10,14,14,12, 1,13,14,15,14,15,10, -}; - -static const UINT16 deco74_address_table[0x800] = -{ - 0x526,0x684,0x15f,0x1ad,0x736,0x341,0x4c3,0x23c,0x3eb,0x01f,0x18e,0x375,0x029,0x227,0x707,0x506, - 0x5ce,0x0dc,0x5dc,0x5fd,0x15c,0x013,0x7b9,0x3c1,0x77d,0x1eb,0x53d,0x4a9,0x66e,0x0a9,0x4e2,0x361, - 0x32d,0x151,0x16a,0x5ed,0x4b0,0x78a,0x0d1,0x01e,0x4be,0x7dd,0x22d,0x125,0x401,0x118,0x051,0x784, - 0x48a,0x083,0x42f,0x56b,0x448,0x679,0x019,0x076,0x44c,0x663,0x3a1,0x740,0x095,0x242,0x4c5,0x13b, - 0x3c4,0x130,0x122,0x047,0x16b,0x162,0x0d9,0x1f4,0x0be,0x018,0x56c,0x494,0x0b0,0x185,0x3b3,0x257, - 0x764,0x05d,0x7d4,0x2bd,0x159,0x2fb,0x07a,0x365,0x4fd,0x451,0x452,0x52d,0x753,0x5c8,0x1a4,0x50e, - 0x5ff,0x536,0x45b,0x281,0x4b8,0x1ff,0x228,0x5f9,0x1ca,0x587,0x0fd,0x02a,0x0da,0x03f,0x6a4,0x671, - 0x2d9,0x377,0x39c,0x534,0x6c5,0x1b2,0x1db,0x263,0x5c3,0x0c7,0x474,0x4db,0x152,0x3de,0x47d,0x64a, - 0x41c,0x66c,0x3d9,0x769,0x0c1,0x4ec,0x46b,0x274,0x6aa,0x623,0x31a,0x2ef,0x270,0x1e7,0x4e5,0x2e3, - 0x1f9,0x203,0x150,0x4a3,0x7d3,0x0af,0x1c8,0x310,0x4cd,0x1a6,0x14e,0x636,0x3f8,0x04d,0x337,0x441, - 0x3c0,0x1d8,0x482,0x399,0x3ef,0x520,0x260,0x352,0x4f8,0x521,0x271,0x6e6,0x5da,0x763,0x595,0x4e0, - 0x2db,0x3c6,0x012,0x09b,0x14f,0x26b,0x512,0x0cb,0x616,0x605,0x63a,0x5e2,0x139,0x7cd,0x7d0,0x00c, - 0x198,0x234,0x4f7,0x37e,0x0a1,0x4bd,0x1a1,0x2f0,0x3b4,0x0a6,0x1c7,0x51e,0x166,0x567,0x719,0x5cb, - 0x3b5,0x31c,0x751,0x6a1,0x065,0x4fa,0x6e1,0x106,0x1a5,0x331,0x3a2,0x16d,0x756,0x090,0x554,0x241, - 0x19a,0x35c,0x0e9,0x388,0x1c9,0x11b,0x5c7,0x56a,0x168,0x5b2,0x47f,0x5a9,0x551,0x3bb,0x3d3,0x428, - 0x132,0x4d7,0x1d1,0x538,0x5d7,0x297,0x6df,0x0ce,0x728,0x2c5,0x6f6,0x60d,0x2a0,0x45f,0x46d,0x4f0, - 0x5ea,0x1e0,0x4d6,0x442,0x32f,0x243,0x30f,0x0c9,0x344,0x42d,0x22f,0x327,0x2b2,0x158,0x7af,0x3d2, - 0x127,0x6d3,0x411,0x7eb,0x632,0x277,0x60b,0x356,0x307,0x1c3,0x0f1,0x762,0x207,0x13e,0x25a,0x6d0, - 0x38e,0x0a7,0x79a,0x2a5,0x771,0x39e,0x325,0x160,0x014,0x115,0x698,0x712,0x2c8,0x3c3,0x1bc,0x696, - 0x0d6,0x692,0x49f,0x4de,0x5b3,0x0cc,0x2f3,0x667,0x318,0x52c,0x3e0,0x181,0x462,0x1f7,0x366,0x4f4, - 0x547,0x44e,0x1be,0x3ed,0x04e,0x490,0x661,0x703,0x320,0x42e,0x406,0x161,0x259,0x702,0x58b,0x619, - 0x51f,0x502,0x391,0x4ce,0x779,0x0f9,0x05b,0x45e,0x14a,0x66a,0x42b,0x35a,0x363,0x1b8,0x373,0x117, - 0x78f,0x34e,0x2e0,0x2d7,0x7ee,0x27b,0x2c6,0x103,0x7dc,0x23d,0x2ad,0x049,0x68a,0x41f,0x582,0x3d5, - 0x631,0x107,0x2be,0x28e,0x5af,0x119,0x694,0x744,0x546,0x19b,0x766,0x5cf,0x2ee,0x0e0,0x4a5,0x313, - 0x6a3,0x3b1,0x28a,0x104,0x415,0x19e,0x01c,0x009,0x167,0x266,0x397,0x056,0x525,0x416,0x64f,0x689, - 0x706,0x413,0x004,0x6c9,0x244,0x2f8,0x78b,0x510,0x02e,0x505,0x5a6,0x612,0x114,0x4d9,0x1cc,0x20f, - 0x7e9,0x13a,0x584,0x495,0x6d2,0x5f4,0x093,0x43f,0x0e3,0x382,0x746,0x71e,0x794,0x72d,0x3ec,0x7c1, - 0x03a,0x33d,0x1ec,0x128,0x27f,0x700,0x149,0x10c,0x553,0x2bc,0x492,0x080,0x5b0,0x015,0x1c4,0x691, - 0x037,0x59f,0x542,0x4cf,0x253,0x5ae,0x74d,0x407,0x6e8,0x354,0x7b4,0x49b,0x300,0x6f2,0x26e,0x3f4, - 0x086,0x37c,0x1ee,0x347,0x6b1,0x26d,0x105,0x55d,0x1ba,0x70b,0x236,0x3e3,0x0b6,0x2c2,0x33b,0x254, - 0x140,0x2e8,0x5c2,0x03b,0x04c,0x5aa,0x480,0x560,0x6ed,0x633,0x7a6,0x29f,0x789,0x0e4,0x08a,0x15b, - 0x57e,0x4fe,0x532,0x25c,0x215,0x709,0x5f7,0x197,0x586,0x2f1,0x5e0,0x477,0x61b,0x608,0x063,0x01b, - 0x212,0x016,0x795,0x205,0x1fa,0x742,0x777,0x40b,0x146,0x73b,0x503,0x792,0x10e,0x545,0x7f6,0x3f7, - 0x4ad,0x38d,0x3b9,0x516,0x2ac,0x3bd,0x31b,0x214,0x170,0x5d6,0x21b,0x1b1,0x3cd,0x213,0x565,0x40a, - 0x113,0x515,0x724,0x03d,0x5c0,0x334,0x3e9,0x2a8,0x1c5,0x089,0x24e,0x7cb,0x4d5,0x280,0x36c,0x2b0, - 0x430,0x0e6,0x0d5,0x3c5,0x662,0x275,0x60f,0x0de,0x248,0x07b,0x22c,0x7b5,0x340,0x739,0x2b8,0x65a, - 0x508,0x116,0x079,0x7a0,0x4c2,0x099,0x4bb,0x52a,0x4d1,0x389,0x3a3,0x1e6,0x2a4,0x10d,0x4ba,0x581, - 0x0b2,0x302,0x0f4,0x760,0x25d,0x4c6,0x39b,0x12b,0x046,0x637,0x38b,0x0f6,0x109,0x51c,0x40d,0x6e9, - 0x6e2,0x7da,0x4a0,0x487,0x67e,0x65f,0x265,0x439,0x189,0x208,0x4b5,0x250,0x4f1,0x16e,0x496,0x3fc, - 0x272,0x20c,0x7ae,0x292,0x5e3,0x472,0x458,0x66d,0x657,0x722,0x438,0x3b8,0x4e4,0x39a,0x598,0x539, - 0x4b4,0x290,0x18b,0x1de,0x65c,0x2ea,0x6ff,0x20a,0x232,0x058,0x2d3,0x0d3,0x1f1,0x61d,0x0d2,0x1d2, - 0x295,0x466,0x038,0x0ac,0x4c7,0x6c7,0x672,0x040,0x6a0,0x699,0x624,0x71f,0x120,0x10b,0x072,0x192, - 0x3ba,0x638,0x58d,0x530,0x00e,0x761,0x6dd,0x1cd,0x18d,0x142,0x2eb,0x55e,0x7b2,0x367,0x5d3,0x71c, - 0x2d2,0x0a0,0x6b2,0x134,0x286,0x12e,0x0cf,0x5dd,0x2e7,0x74b,0x261,0x082,0x726,0x14d,0x1e3,0x4b7, - 0x7e7,0x435,0x294,0x31f,0x154,0x2cf,0x5f5,0x330,0x400,0x13d,0x629,0x7d1,0x4a2,0x3e6,0x3e8,0x1f5, - 0x3f3,0x368,0x410,0x3ca,0x221,0x71b,0x669,0x195,0x7f2,0x70f,0x006,0x504,0x062,0x461,0x053,0x6f7, - 0x0a3,0x6fa,0x1f2,0x745,0x7df,0x12a,0x05a,0x23b,0x4da,0x568,0x665,0x30d,0x5f6,0x328,0x283,0x169, - 0x17c,0x601,0x201,0x6c3,0x6c0,0x491,0x63f,0x6f5,0x2b5,0x2c7,0x628,0x3f9,0x02b,0x38a,0x2e9,0x60c, - 0x2a9,0x102,0x39f,0x0c3,0x42c,0x7cf,0x3df,0x4f9,0x235,0x3a8,0x7e4,0x485,0x21d,0x349,0x0e8,0x0b8, - 0x345,0x683,0x18c,0x317,0x6ca,0x323,0x17d,0x36a,0x7c9,0x1a0,0x3e1,0x6f9,0x0a2,0x353,0x7b6,0x759, - 0x287,0x7d7,0x25e,0x523,0x092,0x427,0x5a7,0x396,0x136,0x75a,0x3d6,0x507,0x385,0x5de,0x55f,0x0ad, - 0x096,0x239,0x5b8,0x6cb,0x574,0x511,0x41e,0x537,0x074,0x148,0x7a4,0x70e,0x2cb,0x284,0x191,0x06e, - 0x2da,0x51a,0x374,0x6ba,0x41b,0x552,0x460,0x371,0x183,0x0b3,0x444,0x748,0x7f4,0x59e,0x5bd,0x381, - 0x0ab,0x6fd,0x4cc,0x3e5,0x5c5,0x09c,0x717,0x22e,0x708,0x1bb,0x70c,0x4a6,0x778,0x034,0x1d5,0x30b, - 0x7f5,0x743,0x6ae,0x2de,0x2a6,0x613,0x5d0,0x40c,0x0bf,0x209,0x1b7,0x4f5,0x72b,0x620,0x647,0x643, - 0x024,0x2ca,0x0bd,0x501,0x0a4,0x453,0x3ff,0x6b5,0x625,0x2f7,0x556,0x469,0x409,0x747,0x031,0x1f6, - 0x47c,0x2ab,0x1fd,0x533,0x74f,0x395,0x754,0x0d0,0x6b0,0x42a,0x635,0x1af,0x6a9,0x49c,0x77b,0x611, - 0x2ae,0x2b4,0x3a5,0x1b5,0x3fe,0x3ab,0x479,0x498,0x3aa,0x5c1,0x27e,0x26a,0x590,0x29d,0x02c,0x121, - 0x404,0x61c,0x650,0x518,0x33a,0x768,0x0f2,0x0b4,0x686,0x67b,0x301,0x04b,0x1c1,0x7d9,0x772,0x0c8, - 0x49a,0x68f,0x59b,0x419,0x73a,0x750,0x360,0x58e,0x264,0x52e,0x00d,0x46e,0x085,0x46f,0x788,0x164, - 0x3d8,0x6db,0x52b,0x473,0x332,0x073,0x440,0x028,0x35b,0x3f1,0x14b,0x7fb,0x03e,0x28c,0x1ea,0x3f5, - 0x6a8,0x53c,0x5b5,0x0fb,0x585,0x478,0x179,0x4ac,0x137,0x173,0x1e5,0x7c6,0x262,0x027,0x6d8,0x144, - 0x3e4,0x673,0x7b7,0x145,0x6b7,0x596,0x1c6,0x54b,0x110,0x155,0x64e,0x4f6,0x44b,0x7fa,0x422,0x5a4, - 0x06c,0x51d,0x023,0x0aa,0x459,0x5fc,0x11a,0x2dd,0x4e1,0x603,0x224,0x497,0x308,0x5c9,0x3dd,0x4e8, - 0x48d,0x4cb,0x548,0x36f,0x094,0x36e,0x58a,0x299,0x797,0x57d,0x7c8,0x75f,0x321,0x431,0x045,0x131, - 0x543,0x486,0x1ce,0x47b,0x57f,0x38f,0x775,0x1dd,0x34a,0x177,0x4d8,0x634,0x48c,0x2e5,0x5ee,0x255, - 0x644,0x456,0x653,0x1e9,0x0ca,0x72e,0x576,0x710,0x6ab,0x4aa,0x4fb,0x569,0x541,0x309,0x1d9,0x714, - 0x35d,0x757,0x278,0x7ef,0x2ec,0x668,0x6d7,0x335,0x62d,0x3b6,0x5b4,0x676,0x46c,0x0e2,0x5bc,0x7bd, - 0x07f,0x267,0x68e,0x649,0x721,0x53f,0x226,0x0cd,0x6c2,0x312,0x1b9,0x11d,0x53e,0x602,0x6bd,0x561, - 0x19c,0x62a,0x135,0x651,0x09e,0x3c8,0x237,0x204,0x610,0x798,0x690,0x5a5,0x5f3,0x0f8,0x540,0x614, - 0x14c,0x5d1,0x00f,0x402,0x4b9,0x583,0x5c6,0x21e,0x457,0x3f6,0x07e,0x216,0x4b1,0x369,0x06b,0x37f, - 0x091,0x580,0x61a,0x1cf,0x4b2,0x2c4,0x1bf,0x38c,0x0ff,0x314,0x7d8,0x26f,0x7a9,0x31e,0x2f2,0x7ca, - 0x12d,0x101,0x54e,0x32e,0x791,0x4a1,0x76d,0x6b9,0x34d,0x061,0x69c,0x6bb,0x41d,0x571,0x711,0x339, - 0x5bb,0x1e1,0x680,0x026,0x032,0x23f,0x524,0x329,0x488,0x2c9,0x7f8,0x043,0x0dd,0x5c4,0x589,0x6f1, - 0x4c8,0x00b,0x782,0x670,0x6b8,0x196,0x1d4,0x43d,0x10f,0x56e,0x030,0x165,0x559,0x6b6,0x4ef,0x67d, - 0x15d,0x56f,0x2ed,0x7a2,0x04a,0x4c1,0x7a3,0x2e4,0x111,0x5f8,0x725,0x685,0x3bc,0x1fb,0x5a3,0x178, - 0x293,0x3a6,0x3a9,0x036,0x7ab,0x07d,0x4c9,0x5a1,0x5b7,0x19d,0x13c,0x519,0x0ee,0x157,0x5a8,0x23e, - 0x2af,0x62e,0x25b,0x785,0x73d,0x172,0x3be,0x7ed,0x4e6,0x15e,0x5e7,0x211,0x44d,0x682,0x7db,0x5b6, - 0x40f,0x020,0x0f5,0x7c0,0x609,0x5f2,0x6cf,0x08b,0x256,0x514,0x799,0x5d2,0x1e2,0x727,0x7e5,0x279, - 0x30c,0x11c,0x30a,0x58f,0x0df,0x03c,0x577,0x5ef,0x7c2,0x55a,0x5b1,0x776,0x65d,0x2aa,0x225,0x3db, - 0x276,0x6a5,0x5ec,0x229,0x5ca,0x513,0x1a8,0x30e,0x783,0x3fd,0x124,0x535,0x13f,0x64c,0x1a3,0x607, - 0x02f,0x0e5,0x701,0x24c,0x45c,0x566,0x6d1,0x035,0x044,0x455,0x042,0x20e,0x7e8,0x767,0x2fa,0x476, - 0x003,0x2bf,0x37a,0x5d4,0x247,0x660,0x1f0,0x2d6,0x36d,0x564,0x3c2,0x37b,0x2f4,0x17a,0x4a7,0x176, - 0x3d4,0x59a,0x383,0x258,0x08e,0x098,0x528,0x62c,0x72f,0x35e,0x0b5,0x56d,0x6f0,0x44a,0x723,0x45d, - 0x4eb,0x055,0x285,0x0ed,0x182,0x429,0x393,0x470,0x555,0x3a4,0x078,0x1a2,0x43a,0x16c,0x65e,0x087, - 0x7f3,0x74e,0x273,0x386,0x6da,0x550,0x25f,0x206,0x039,0x2a3,0x2e6,0x199,0x1cb,0x445,0x4c0,0x06a, - 0x54c,0x316,0x0d8,0x741,0x194,0x05c,0x606,0x43e,0x100,0x21a,0x43c,0x4c4,0x693,0x5e1,0x1d3,0x240, - 0x20d,0x433,0x796,0x238,0x765,0x4af,0x0eb,0x7e1,0x050,0x4ee,0x2d5,0x75e,0x5a2,0x5be,0x70a,0x3cf, - 0x376,0x005,0x61e,0x002,0x5cd,0x069,0x0c6,0x041,0x084,0x64b,0x60e,0x268,0x51b,0x000,0x464,0x34b, - 0x615,0x3d7,0x5cc,0x1b0,0x233,0x7fe,0x641,0x53a,0x24d,0x00a,0x32a,0x18f,0x282,0x749,0x3dc,0x0b7, - 0x5b9,0x336,0x0c4,0x5eb,0x398,0x475,0x2d8,0x5bf,0x646,0x418,0x5a0,0x3cc,0x531,0x187,0x3ea,0x6bc, - 0x1ab,0x1e4,0x69d,0x63c,0x6f8,0x0f3,0x251,0x2dc,0x648,0x6a7,0x219,0x731,0x573,0x7f1,0x070,0x188, - 0x7d5,0x436,0x730,0x6de,0x27d,0x163,0x129,0x403,0x298,0x2b9,0x06d,0x357,0x249,0x4b3,0x296,0x2b6, - 0x6b4,0x697,0x770,0x484,0x303,0x7fc,0x1da,0x2d1,0x7f0,0x379,0x16f,0x222,0x48f,0x394,0x64d,0x68d, - 0x3b2,0x5ab,0x3e2,0x5f1,0x7ff,0x69b,0x50c,0x384,0x655,0x346,0x446,0x7ea,0x4f3,0x2fc,0x2b1,0x562, - 0x387,0x2ff,0x4ed,0x5e5,0x5d9,0x6fe,0x1ef,0x656,0x47e,0x171,0x067,0x600,0x6eb,0x246,0x4d2,0x73c, - 0x305,0x1d0,0x434,0x5d8,0x6e7,0x781,0x32c,0x2bb,0x4d4,0x4b6,0x493,0x0c0,0x3bf,0x4f2,0x7ba,0x774, - 0x6ad,0x378,0x7c4,0x63b,0x733,0x752,0x454,0x184,0x74c,0x3c9,0x618,0x688,0x054,0x414,0x6c4,0x07c, - 0x2b7,0x3c7,0x2fe,0x73e,0x351,0x4a4,0x3fa,0x6e4,0x6d9,0x4a8,0x1fe,0x517,0x010,0x4d3,0x6c8,0x153, - 0x180,0x593,0x7b1,0x7a5,0x24b,0x141,0x424,0x7e0,0x186,0x405,0x2ce,0x604,0x425,0x447,0x677,0x79b, - 0x76f,0x0ec,0x2cd,0x358,0x1fc,0x3b7,0x0f0,0x32b,0x2cc,0x138,0x735,0x09a,0x549,0x704,0x720,0x786, - 0x3f2,0x088,0x639,0x133,0x7b0,0x4ae,0x2f9,0x007,0x54d,0x68c,0x509,0x08d,0x67a,0x443,0x0ba,0x499, - 0x06f,0x71d,0x0bc,0x695,0x3b0,0x63e,0x734,0x057,0x033,0x7a1,0x068,0x355,0x49d,0x5ba,0x76c,0x675, - 0x54a,0x10a,0x417,0x3a0,0x658,0x1df,0x7aa,0x112,0x6c1,0x372,0x420,0x048,0x011,0x2df,0x202,0x622, - 0x483,0x5e6,0x28d,0x0a8,0x324,0x380,0x6ea,0x449,0x23a,0x6a2,0x066,0x021,0x6fb,0x1e8,0x48b,0x0d4, - 0x666,0x33f,0x077,0x50f,0x370,0x338,0x76a,0x2fd,0x1d6,0x2a2,0x77e,0x489,0x3ad,0x73f,0x7c5,0x17b, - 0x471,0x5df,0x1aa,0x2f5,0x0db,0x7d6,0x6e0,0x7cc,0x645,0x729,0x08c,0x097,0x790,0x41a,0x4dc,0x7a8, - 0x1bd,0x21f,0x01a,0x3ac,0x713,0x193,0x55b,0x59d,0x1c0,0x6ce,0x364,0x33c,0x4e9,0x57b,0x426,0x1a7, - 0x21c,0x1ed,0x343,0x69a,0x732,0x6ef,0x55c,0x72a,0x18a,0x7f9,0x432,0x29b,0x7b3,0x468,0x319,0x0fe, - 0x245,0x7ec,0x7be,0x24f,0x008,0x500,0x31d,0x33e,0x217,0x6be,0x50d,0x230,0x02d,0x15a,0x46a,0x1ac, - 0x220,0x0ae,0x1d7,0x50a,0x558,0x718,0x40e,0x621,0x594,0x52f,0x27a,0x758,0x29e,0x4d0,0x642,0x75b, - 0x156,0x20b,0x350,0x39d,0x0bb,0x08f,0x218,0x075,0x652,0x57c,0x6d5,0x0ea,0x678,0x052,0x5db,0x1b4, - 0x423,0x3a7,0x4df,0x50b,0x77f,0x49e,0x0c5,0x5ac,0x79e,0x3fb,0x591,0x5fa,0x0c2,0x0e1,0x755,0x67c, - 0x66b,0x60a,0x66f,0x481,0x467,0x7a7,0x61f,0x57a,0x17e,0x05f,0x5f0,0x7f7,0x0d7,0x773,0x05e,0x7e2, - 0x6e5,0x659,0x4e7,0x738,0x24a,0x12c,0x77c,0x4bf,0x45a,0x69f,0x7fd,0x69e,0x529,0x19f,0x2ba,0x0b1, - 0x627,0x412,0x65b,0x2f6,0x269,0x342,0x2b3,0x291,0x0fc,0x3da,0x12f,0x4e3,0x592,0x0fa,0x463,0x7bc, - 0x780,0x11f,0x4ff,0x7ac,0x28f,0x175,0x0ef,0x6d6,0x4ea,0x527,0x3ee,0x0f7,0x0b9,0x311,0x27c,0x025, - 0x2c3,0x71a,0x6af,0x190,0x11e,0x588,0x78e,0x6c6,0x147,0x3ae,0x578,0x6ac,0x4fc,0x252,0x7c7,0x43b, - 0x557,0x7e3,0x2d0,0x63d,0x79c,0x62b,0x640,0x123,0x6e3,0x306,0x77a,0x4ab,0x787,0x421,0x1dc,0x390, - 0x1ae,0x1f3,0x705,0x7d2,0x081,0x2e1,0x5e9,0x5fe,0x687,0x2a1,0x59c,0x0a5,0x223,0x78d,0x35f,0x7c3, - 0x326,0x575,0x348,0x715,0x6b3,0x793,0x6f4,0x7b8,0x064,0x210,0x2c0,0x579,0x022,0x3af,0x74a,0x200, - 0x1a9,0x75d,0x7ce,0x72c,0x79f,0x75c,0x09d,0x4dd,0x2e2,0x7e6,0x17f,0x716,0x570,0x7de,0x017,0x76e, - 0x54f,0x362,0x29a,0x522,0x1b3,0x22a,0x572,0x3d1,0x408,0x437,0x3cb,0x6dc,0x58c,0x6a6,0x37d,0x53b, - 0x1b6,0x7bf,0x5e8,0x143,0x289,0x392,0x22b,0x5fb,0x5ad,0x01d,0x2c1,0x26c,0x76b,0x70d,0x44f,0x6fc, - 0x79d,0x4ca,0x450,0x34f,0x3e7,0x1c2,0x664,0x3d0,0x001,0x7ad,0x6f3,0x359,0x544,0x67f,0x563,0x6d4, - 0x108,0x48e,0x3f0,0x04f,0x322,0x6cd,0x2d4,0x597,0x09f,0x62f,0x5e4,0x28b,0x681,0x231,0x630,0x315, - 0x68b,0x059,0x3ce,0x36b,0x654,0x47a,0x29c,0x6bf,0x071,0x6cc,0x2a7,0x333,0x304,0x1f8,0x0e7,0x599, - 0x174,0x060,0x674,0x6ec,0x7bb,0x288,0x6ee,0x737,0x34c,0x617,0x4bc,0x5d5,0x78c,0x465,0x126,0x626, -}; - -static const UINT8 deco74_swap_table[0x800] = -{ - 2,7,5,7,1,1,4,4,7,5,6,7,7,3,4,3,0,2,1,3,0,4,7,7,2,5,3,1,4,4,6,7, - 6,7,4,5,1,3,0,3,7,2,5,0,1,5,2,1,4,0,6,1,1,2,4,2,1,0,6,5,2,6,4,6, - 4,4,2,2,0,6,0,4,6,0,1,7,0,6,1,2,5,0,1,5,0,2,6,2,2,7,0,7,2,4,6,3, - 3,5,1,1,2,3,4,1,4,6,1,4,0,6,6,3,5,4,1,1,3,0,5,7,5,4,5,4,3,6,2,0, - 4,5,7,3,1,3,4,7,7,4,2,7,1,6,4,1,1,4,0,4,2,0,4,0,1,5,6,4,7,7,3,7, - 7,0,1,2,6,7,7,0,5,1,2,4,2,0,4,4,7,4,0,3,7,1,7,4,2,5,7,4,3,7,3,6, - 7,3,0,5,1,7,5,3,0,1,6,1,7,4,7,6,5,1,2,7,3,3,1,4,6,2,3,7,0,4,5,6, - 3,2,3,1,7,6,0,1,5,7,4,0,5,1,4,1,2,0,6,4,3,5,7,4,3,0,0,6,5,1,7,6, - 0,2,4,0,0,5,4,7,4,3,3,0,2,3,5,7,0,3,2,3,7,2,0,0,7,6,3,5,0,1,3,2, - 4,7,2,3,4,7,1,5,6,7,3,6,4,1,7,7,4,4,3,4,0,7,5,3,2,5,7,7,0,4,0,7, - 7,2,5,1,2,4,7,6,0,6,7,0,5,0,1,6,5,0,2,4,5,1,6,7,6,0,7,0,6,0,1,4, - 3,2,0,2,4,6,3,2,3,3,0,5,7,2,3,7,1,2,6,3,7,2,0,5,7,1,2,6,4,3,4,6, - 4,0,1,4,2,3,3,2,3,7,0,7,4,3,2,1,0,3,5,2,5,3,0,0,0,4,6,4,4,6,1,0, - 3,1,1,5,7,1,5,2,0,1,5,7,2,4,5,4,2,6,3,1,4,0,3,0,1,7,3,5,1,1,1,2, - 2,3,4,1,2,0,0,7,1,6,1,5,2,2,2,1,6,6,0,5,5,4,2,3,7,4,6,6,6,3,1,3, - 3,0,1,7,4,6,3,7,0,1,4,2,3,3,1,7,6,0,6,4,1,3,6,1,6,2,3,1,6,5,3,4, - 2,1,3,3,1,6,6,3,6,6,5,0,1,7,1,0,4,6,0,6,0,0,3,6,5,6,4,0,4,2,6,5, - 0,4,2,7,6,2,4,6,6,4,6,6,0,5,6,6,5,2,3,0,4,4,6,4,1,6,6,0,7,0,1,6, - 1,2,2,4,6,4,2,5,4,2,2,5,4,1,3,3,4,5,3,4,5,6,3,5,2,3,7,6,1,0,4,4, - 7,6,0,5,2,6,2,2,3,7,1,5,4,2,6,7,0,5,5,2,5,7,5,6,2,3,0,5,4,5,2,1, - 0,5,3,6,7,2,3,4,0,3,5,7,6,6,5,6,7,2,2,2,3,5,0,2,0,1,2,2,4,6,7,2, - 5,4,4,3,5,7,3,4,5,3,4,7,1,2,3,5,3,3,6,0,4,4,2,5,4,1,7,2,7,7,4,5, - 2,1,0,3,4,1,3,6,2,4,3,3,3,0,0,1,2,0,3,3,6,5,6,7,5,2,0,4,2,0,1,6, - 7,1,0,4,1,7,5,2,3,0,2,7,2,2,4,6,7,5,7,5,0,6,5,3,2,7,2,3,3,6,0,4, - 1,5,2,2,5,6,4,1,3,6,2,7,4,3,4,1,6,0,5,6,0,0,3,1,1,2,4,3,4,1,4,2, - 0,3,0,7,6,3,2,0,2,3,6,5,3,3,6,6,2,4,5,4,1,5,1,6,0,7,5,5,4,7,3,7, - 4,3,5,0,7,4,4,3,5,5,7,7,2,4,6,6,7,0,7,6,1,0,2,4,0,2,3,5,4,6,3,5, - 2,4,2,4,2,4,5,2,6,5,2,4,6,2,2,2,4,4,2,1,4,0,1,1,1,4,7,0,3,1,7,5, - 7,5,5,4,1,0,2,3,5,3,3,7,2,6,1,2,7,4,1,5,2,4,2,5,4,0,5,0,5,4,1,3, - 5,1,7,4,2,2,1,3,3,7,6,3,2,1,7,5,3,2,4,6,6,5,6,2,0,2,5,3,4,2,3,4, - 0,2,6,3,4,6,6,7,3,0,3,0,1,0,2,7,4,6,0,3,5,2,5,5,5,3,6,4,7,3,5,3, - 7,1,1,3,1,5,7,3,0,4,6,5,3,3,2,3,0,7,0,5,1,1,7,2,2,0,0,6,7,6,7,6, - 3,4,7,3,7,6,6,0,7,6,3,0,0,6,2,7,1,0,2,7,6,2,2,2,7,1,3,2,3,4,1,3, - 1,7,5,2,0,7,7,0,6,1,6,0,2,2,6,7,0,6,7,0,6,4,0,1,6,6,6,0,1,3,4,4, - 4,1,2,2,7,3,7,2,4,4,3,4,0,3,1,0,0,7,3,3,6,5,0,4,3,5,5,0,1,7,2,3, - 3,0,6,6,5,6,4,0,6,0,1,7,5,4,2,6,3,7,4,4,5,6,7,6,1,7,2,5,5,5,1,4, - 3,0,6,3,2,3,0,2,0,0,0,1,0,6,3,7,7,4,3,2,3,4,6,4,2,0,5,3,3,6,4,3, - 5,1,4,0,0,1,0,5,2,1,6,3,3,1,1,6,2,0,3,0,7,0,2,0,5,3,6,6,0,6,2,4, - 0,3,0,1,2,1,6,4,5,2,3,4,1,2,0,6,7,0,5,5,0,0,3,7,1,4,1,2,7,3,4,7, - 4,4,5,5,7,0,4,2,0,7,4,4,7,2,7,2,1,7,4,5,5,7,7,4,0,5,2,2,7,0,5,3, - 3,2,0,5,2,1,1,7,0,5,4,3,1,3,2,5,3,4,5,3,4,6,2,2,2,5,4,2,1,3,1,4, - 7,5,5,7,3,2,0,4,6,0,4,1,6,5,6,1,3,0,1,1,0,4,5,1,5,0,2,3,7,2,5,6, - 0,6,4,2,6,1,5,6,3,3,5,0,3,2,0,0,1,2,1,0,2,7,5,1,6,4,1,7,6,5,3,2, - 3,4,3,2,7,1,6,2,3,2,4,3,4,7,0,5,2,0,6,7,2,0,3,7,6,7,4,0,4,3,7,7, - 5,2,6,6,7,6,3,6,6,1,6,2,3,1,5,1,0,5,1,0,3,7,4,5,0,3,2,1,3,5,3,1, - 1,7,4,2,1,2,3,0,4,7,1,1,6,3,6,4,0,2,7,1,0,5,4,6,1,2,7,1,3,6,5,2, - 3,0,5,7,3,5,5,2,2,6,1,6,0,4,5,7,3,4,0,7,0,5,4,3,6,5,7,0,1,0,0,7, - 3,3,4,4,1,4,7,1,2,0,0,7,0,5,3,4,6,3,4,6,4,2,5,0,7,5,5,6,6,7,6,7, - 3,4,5,0,5,5,7,5,4,4,1,4,3,1,4,3,3,2,5,7,6,3,0,4,1,2,5,4,4,3,0,2, - 7,5,5,7,3,7,3,3,7,0,0,5,3,1,4,4,6,0,1,3,1,4,7,2,1,1,4,1,0,7,4,5, - 2,7,2,4,5,7,3,3,7,6,4,4,5,3,2,4,0,3,5,5,5,4,3,6,7,7,5,1,3,0,2,6, - 3,2,0,4,6,7,4,6,7,2,0,6,7,2,5,0,1,3,0,2,4,7,5,1,4,7,7,4,2,3,6,4, - 3,2,0,4,0,6,0,0,5,7,0,4,0,4,6,3,6,0,0,3,1,0,1,2,6,2,1,0,5,7,6,4, - 5,4,1,2,3,6,6,1,3,1,1,2,4,3,1,4,1,0,4,2,0,3,2,1,1,1,1,6,2,1,3,0, - 6,6,2,5,5,5,2,6,7,6,1,1,3,1,1,6,0,2,6,0,3,6,0,6,3,4,3,3,0,2,0,1, - 5,6,5,0,5,3,4,2,7,5,6,4,4,1,1,4,7,7,1,2,3,6,1,6,4,5,3,6,5,1,7,1, - 0,6,6,2,6,2,6,0,2,2,6,1,0,2,5,6,6,7,4,4,7,6,1,0,1,4,3,1,2,1,4,1, - 4,6,2,5,1,2,0,2,3,4,3,0,3,7,7,6,5,1,7,3,1,0,6,1,1,3,0,7,4,3,1,3, - 7,6,1,5,4,3,5,4,7,0,2,5,4,5,1,6,3,7,4,5,6,7,3,6,1,2,3,3,6,6,1,5, - 2,0,7,2,5,4,1,7,6,6,0,1,7,5,2,4,1,2,0,2,2,2,7,4,3,0,6,0,7,2,1,7, - 5,1,7,1,2,2,4,3,1,3,6,5,5,0,2,6,2,6,0,1,4,1,1,4,3,2,6,0,6,3,7,5, - 6,0,7,7,7,2,0,4,2,5,6,3,4,3,2,0,3,1,6,2,3,3,6,7,1,5,6,6,4,0,6,1, - 1,6,2,0,7,6,3,2,5,6,0,4,2,4,4,2,5,7,5,4,4,1,6,3,4,6,5,5,6,0,0,4, - 4,7,2,2,1,3,4,4,1,7,0,2,5,4,7,3,7,6,1,5,6,0,7,4,1,1,5,2,2,6,7,2, -}; - -static void deco_decrypt(UINT8 *src, INT32 len, const UINT8 *xor_table,const UINT16 *address_table,const UINT8 *swap_table,INT32 remap_only) -{ - UINT16 *rom = (UINT16*)src; - len/=2; - UINT16 *buffer = (UINT16*)BurnMalloc(len * sizeof(INT16)); - INT32 i; - -#if 0 - /* we work on 16-bit words but data is loaded as 8-bit, so swap bytes on LSB machines */ - if (ENDIANNESS_NATIVE == ENDIANNESS_LITTLE) - for (i = 0;i < len;i++) - rom[i] = BIG_ENDIANIZE_INT16(rom[i]); -#else -#ifdef LSB_FIRST - for (i = 0; i < len; i++) { - rom[i] = (rom[i] << 8) | (rom[i] >> 8); - } -#endif -#endif - - memcpy(buffer,rom,len*2); - - for (i = 0;i < len;i++) - { - INT32 addr = (i & ~0x7ff) | address_table[i & 0x7ff]; - INT32 pat = swap_table[i & 0x7ff]; - - if (remap_only) - rom[i] = buffer[addr]; - else - rom[i] = BITSWAP16(buffer[addr] ^ xor_masks[xor_table[addr & 0x7ff]], - swap_patterns[pat][0], - swap_patterns[pat][1], - swap_patterns[pat][2], - swap_patterns[pat][3], - swap_patterns[pat][4], - swap_patterns[pat][5], - swap_patterns[pat][6], - swap_patterns[pat][7], - swap_patterns[pat][8], - swap_patterns[pat][9], - swap_patterns[pat][10], - swap_patterns[pat][11], - swap_patterns[pat][12], - swap_patterns[pat][13], - swap_patterns[pat][14], - swap_patterns[pat][15]); - } - - BurnFree(buffer); - -#if 0 - /* we work on 16-bit words but data is loaded as 8-bit, so swap bytes on LSB machines */ - if (ENDIANNESS_NATIVE == ENDIANNESS_LITTLE) - for (i = 0;i < len;i++) - rom[i] = BIG_ENDIANIZE_INT16(rom[i]); -#else -#ifdef LSB_FIRST - for (i = 0; i < len; i++) { - rom[i] = (rom[i] << 8) | (rom[i] >> 8); - } -#endif -#endif -} - -void deco56_decrypt_gfx(UINT8 *rom, INT32 len) -{ - deco_decrypt(rom,len,deco56_xor_table,deco56_address_table,deco56_swap_table, 0); -} - -void deco74_decrypt_gfx(UINT8 *rom, INT32 len) -{ - deco_decrypt(rom,len,deco74_xor_table,deco74_address_table,deco74_swap_table, 0); -} - -void deco56_remap_gfx(UINT8 *rom, INT32 len) -{ - // Apply address remap, but not XOR/shift - deco_decrypt(rom,len,deco56_xor_table,deco56_address_table,deco56_swap_table, 1); -} - -static UINT16 decrypt(UINT16 data, INT32 address, INT32 select_xor) -{ - static const UINT16 xors[16] = - { - 0xb52c,0x2458,0x139a,0xc998,0xce8e,0x5144,0x0429,0xaad4,0xa331,0x3645,0x69a3,0xac64,0x1a53,0x5083,0x4dea,0xd237 - }; - static const UINT8 bitswaps[16][16] = - { - { 12,8,13,11,14,10,15,9, 3,2,1,0,4,5,6,7 }, { 10,11,14,12,15,13,8,9, 6,7,5,3,0,4,2,1 }, - { 14,13,15,9,8,12,11,10, 7,4,1,5,6,0,3,2 }, { 15,14,8,9,10,11,13,12, 1,2,7,3,4,6,0,5 }, - { 10,9,13,14,15,8,12,11, 5,2,1,0,3,4,7,6 }, { 8,9,15,14,10,11,13,12, 0,6,5,4,1,2,3,7 }, - { 14,8,15,9,10,11,13,12, 4,5,3,0,2,7,6,1 }, { 13,11,12,10,15,9,14,8, 6,0,7,5,1,4,3,2 }, - { 12,11,13,10,9,8,14,15, 0,2,4,6,7,5,3,1 }, { 15,13,9,8,10,11,12,14, 2,1,0,7,6,5,4,3 }, - { 13,8,9,10,11,12,15,14, 6,0,1,2,3,7,4,5 }, { 12,11,10,8,9,13,14,15, 6,5,4,0,7,1,2,3 }, - { 12,15,8,13,9,11,14,10, 6,5,4,3,2,1,0,7 }, { 11,12,13,14,15,8,9,10, 4,5,7,1,6,3,2,0 }, - { 13,8,12,14,11,15,10,9, 7,6,5,4,3,2,1,0 }, { 15,14,13,12,11,10,9,8, 0,6,7,4,3,2,1,5 } - }; - INT32 j, xorval; - const UINT8 *bs; - - // calculate bitswap to use - j = ((address ^ select_xor) & 0xf0) >> 4; - if (address & 0x20000) j ^= 4; - bs = bitswaps[j]; - - // calculate xor to use - j = (address ^ select_xor) & 0x0f; - if (address & 0x40000) j ^= 2; // boogwing - xorval = xors[j]; - - // decrypt - return xorval ^ BITSWAP16(data, - bs[0],bs[1],bs[2],bs[3],bs[4],bs[5],bs[6],bs[7], - bs[8],bs[9],bs[10],bs[11],bs[12],bs[13],bs[14],bs[15]); -} - -void deco102_decrypt_cpu(UINT8 *data, UINT8 *ops, INT32 size, INT32 address_xor, INT32 data_select_xor, INT32 opcode_select_xor) -{ - UINT16 *rom = (UINT16*)data; - UINT16 *opcodes = (UINT16*)ops; - UINT16 *buf = (UINT16*)BurnMalloc(size); - - memcpy(buf, rom, size); - -// memory_set_decrypted_region(space, 0, size - 1, opcodes); -// m68k_set_encrypted_opcode_range(devtag_get_device(machine, cputag), 0, size); - - for (INT32 i = 0; i < size / 2; i++) - { - INT32 src; - - // calculate address of encrypted word in ROM - src = i & 0xf0000; - if (i & 0x0001) src ^= 0xbe0b; - if (i & 0x0002) src ^= 0x5699; - if (i & 0x0004) src ^= 0x1322; - if (i & 0x0008) src ^= 0x0004; - if (i & 0x0010) src ^= 0x08a0; - if (i & 0x0020) src ^= 0x0089; - if (i & 0x0040) src ^= 0x0408; - if (i & 0x0080) src ^= 0x1212; - if (i & 0x0100) src ^= 0x08e0; - if (i & 0x0200) src ^= 0x5499; - if (i & 0x0400) src ^= 0x9a8b; - if (i & 0x0800) src ^= 0x1222; - if (i & 0x1000) src ^= 0x1200; - if (i & 0x2000) src ^= 0x0008; - if (i & 0x4000) src ^= 0x1210; - if (i & 0x8000) src ^= 0x00e0; - src ^= address_xor; - - rom[i] = BURN_ENDIAN_SWAP_INT16(decrypt(BURN_ENDIAN_SWAP_INT16(buf[src]), i, data_select_xor)); - opcodes[i] = BURN_ENDIAN_SWAP_INT16(decrypt(BURN_ENDIAN_SWAP_INT16(buf[src]), i, opcode_select_xor)); - } - - BurnFree(buf); -} - - -static void decrypt156(UINT32 *src, UINT32 *dst, INT32 length) -{ - INT32 a; - - for (a = 0; a < length/4; a++) - { - INT32 addr, dword; - - addr = (a & 0xff0000) | 0x92c6; - - if (a & 0x0001) addr ^= 0xce4a; - if (a & 0x0002) addr ^= 0x4db2; - if (a & 0x0004) addr ^= 0xef60; - if (a & 0x0008) addr ^= 0x5737; - if (a & 0x0010) addr ^= 0x13dc; - if (a & 0x0020) addr ^= 0x4bd9; - if (a & 0x0040) addr ^= 0xa209; - if (a & 0x0080) addr ^= 0xd996; - if (a & 0x0100) addr ^= 0xa700; - if (a & 0x0200) addr ^= 0xeca0; - if (a & 0x0400) addr ^= 0x7529; - if (a & 0x0800) addr ^= 0x3100; - if (a & 0x1000) addr ^= 0x33b4; - if (a & 0x2000) addr ^= 0x6161; - if (a & 0x4000) addr ^= 0x1eef; - if (a & 0x8000) addr ^= 0xf5a5; - - dword = BURN_ENDIAN_SWAP_INT32(src[addr]); - - // note that each of the following lines affects exactly two bits - - if (a & 0x00004) dword ^= 0x04400000; - if (a & 0x00008) dword ^= 0x40000004; - if (a & 0x00010) dword ^= 0x00048000; - if (a & 0x00020) dword ^= 0x00000280; - if (a & 0x00040) dword ^= 0x00200040; - if (a & 0x00080) dword ^= 0x09000000; - if (a & 0x00100) dword ^= 0x00001100; - if (a & 0x00200) dword ^= 0x20002000; - if (a & 0x00400) dword ^= 0x00000022; - if (a & 0x00800) dword ^= 0x000a0000; - if (a & 0x01000) dword ^= 0x10004000; - if (a & 0x02000) dword ^= 0x00010400; - if (a & 0x04000) dword ^= 0x80000010; - if (a & 0x08000) dword ^= 0x00000009; - if (a & 0x10000) dword ^= 0x02100000; - if (a & 0x20000) dword ^= 0x00800800; - - switch (a & 3) - { - case 0: - dword = BITSWAP32( dword ^ 0xec63197a, - 1, 4, 7, 28, 22, 18, 20, 9, - 16, 10, 30, 2, 31, 24, 19, 29, - 6, 21, 23, 11, 12, 13, 5, 0, - 8, 26, 27, 15, 14, 17, 25, 3 ); - break; - - case 1: - dword = BITSWAP32( dword ^ 0x58a5a55f, - 14, 23, 28, 29, 6, 24, 10, 1, - 5, 16, 7, 2, 30, 8, 18, 3, - 31, 22, 25, 20, 17, 0, 19, 27, - 9, 12, 21, 15, 26, 13, 4, 11 ); - break; - - case 2: - dword = BITSWAP32( dword ^ 0xe3a65f16, - 19, 30, 21, 4, 2, 18, 15, 1, - 12, 25, 8, 0, 24, 20, 17, 23, - 22, 26, 28, 16, 9, 27, 6, 11, - 31, 10, 3, 13, 14, 7, 29, 5 ); - break; - - case 3: - dword = BITSWAP32( dword ^ 0x28d93783, - 30, 6, 15, 0, 31, 18, 26, 22, - 14, 23, 19, 17, 10, 8, 11, 20, - 1, 28, 2, 4, 9, 24, 25, 27, - 7, 21, 13, 29, 5, 3, 16, 12 ); - break; - } - - dst[a] = BURN_ENDIAN_SWAP_INT32(dword); - } -} - -void deco156_decrypt(UINT8 *src, INT32 len) -{ - UINT32 *rom = (UINT32*)src; - UINT32 *buf = (UINT32*)BurnMalloc(len); - - memcpy (buf, rom, len); - - decrypt156(buf, rom, len); - - BurnFree(buf); -} - - diff --git a/jan/src/burn/drv/dataeast/deco16ic.h b/jan/src/burn/drv/dataeast/deco16ic.h deleted file mode 100644 index c477b9aa3..000000000 --- a/jan/src/burn/drv/dataeast/deco16ic.h +++ /dev/null @@ -1,103 +0,0 @@ - -// deco16 tilemap routines - -extern UINT16 *deco16_pf_control[2]; -extern UINT8 *deco16_pf_ram[4]; -extern UINT8 *deco16_pf_rowscroll[4]; - -extern UINT16 deco16_priority; -extern INT32 deco16_vblank; -extern INT32 deco16_y_skew; // used in vaportrail - -void deco16_set_bank_callback(INT32 tmap, INT32 (*callback)(const INT32 bank)); -void deco16_set_color_base(INT32 tmap, INT32 base); -void deco16_set_color_mask(INT32 tmap, INT32 mask); -void deco16_set_transparency_mask(INT32 tmap, INT32 mask); -void deco16_set_gfxbank(INT32 tmap, INT32 small, INT32 big); -void deco16_set_global_offsets(INT32 x, INT32 y); - -void deco16_set_scroll_offs(INT32 tmap, INT32 size, INT32 offsetx, INT32 offsety); - -INT32 deco16_get_tilemap_size(INT32 tmap); - -extern UINT8 *deco16_prio_map; -void deco16_clear_prio_map(); -void deco16_draw_prio_sprite(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 pri); -void deco16_draw_prio_sprite(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 pri, INT32 spri); -void deco16_draw_prio_sprite_nitrobal(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 pri, INT32 spri); -void deco16_draw_alphaprio_sprite(UINT32 *palette, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 pri, INT32 spri, INT32 alpha); - -void deco16_set_graphics(UINT8 *gfx0, INT32 len0, UINT8 *gfx1, INT32 len1, UINT8 *gfx2, INT32 len2); -void deco16_set_graphics(INT32 num, UINT8 *gfx, INT32 len, INT32 size /*tile size*/); // individual bank - -void deco16Init(INT32 no_pf34, INT32 split, INT32 full_width); -void deco16Reset(); -void deco16Exit(); - -void deco16Scan(); - -void deco16_pf12_update(); -void deco16_pf34_update(); -void deco16_pf3_update(); - -#define DECO16_LAYER_OPAQUE 0x010000 -#define DECO16_LAYER_PRIORITY(x) ((x) & 0xff) -#define DECO16_LAYER_8BITSPERPIXEL 0x100000 -#define DECO16_LAYER_5BITSPERPIXEL 0x200000 -#define DECO16_LAYER_4BITSPERPIXEL 0x000000 // just to clarify -#define DECO16_LAYER_TRANSMASK0 0x000100 -#define DECO16_LAYER_TRANSMASK1 0x000000 - -void deco16_draw_layer(INT32 tmap, UINT16 *dest, INT32 flags); -void deco16_draw_layer_by_line(INT32 start, INT32 end, INT32 tmap, UINT16 *dest, INT32 flags); - -void deco16_tile_decode(UINT8 *src, UINT8 *dst, INT32 len, INT32 type); -void deco16_sprite_decode(UINT8 *gfx, INT32 len); - -void deco16_palette_recalculate(UINT32 *palette, UINT8 *pal); - -#define deco16_write_control_word(num, addr, a, d) \ - if ((addr & 0xfffffff0) == a) { \ - deco16_pf_control[num][(addr & 0x0f)/2] = d; \ - return; \ - } - -#define deco16_write_control_byte(num, addr, a, d) \ - if ((addr & 0xfffffff0) == a) { \ - if ((addr) & 1) \ - deco16_pf_control[num][(addr & 0x0f)/2] = (deco16_pf_control[num][(addr & 0x0f)/2] & 0xff00) | d; \ - else \ - deco16_pf_control[num][(addr & 0x0f)/2] = (deco16_pf_control[num][(addr & 0x0f)/2] & 0x00ff) | (d << 8);\ - return; \ - } - -#define deco16_read_control_word(num, addr, a) \ - if ((addr & 0xfffffff0) == a) { \ - return deco16_pf_control[num][(addr & 0x0f)/2]; \ - } - - -#define deco16ic_71_read() (0xffff) - -// common sound hardware... - -extern INT32 deco16_soundlatch; -extern INT32 deco16_music_tempofix; - -void deco16SoundReset(); -void deco16SoundInit(UINT8 *rom, UINT8 *ram, INT32 huc_clock, INT32 ym2203, void (ym2151_port)(UINT32,UINT32), double ym2151vol, INT32 msmclk0, double msmvol0, INT32 msmclk1, double msmvol1); -void deco16SoundExit(); -void deco16SoundUpdate(INT16 *buf, INT32 len); -void deco16SoundScan(INT32 nAction, INT32 *pnMin); - - -// decrypt routines - -void deco56_decrypt_gfx(UINT8 *rom, INT32 len); -void deco74_decrypt_gfx(UINT8 *rom, INT32 len); -void deco56_remap_gfx(UINT8 *rom, INT32 len); - -void deco102_decrypt_cpu(UINT8 *data, UINT8 *ops, INT32 size, INT32 address_xor, INT32 data_select_xor, INT32 opcode_select_xor); - -void deco156_decrypt(UINT8 *src, INT32 len); - diff --git a/jan/src/burn/drv/galaxian/d_galaxian.cpp b/jan/src/burn/drv/galaxian/d_galaxian.cpp deleted file mode 100644 index 6e10aab16..000000000 --- a/jan/src/burn/drv/galaxian/d_galaxian.cpp +++ /dev/null @@ -1,23151 +0,0 @@ -#include "gal.h" - -// FB Alpha Galaxian driver module -// Based on MAME driver by Aaron Giles, Couriersud,Stephane Humbert - -static INT32 ScrambleInit(); - -// Input definitions (alphabetical) -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo Ad2083InputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort1 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort1 + 2, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 0, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort1 + 4, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, -}; - -STDINPUTINFO(Ad2083) - -static struct BurnInputInfo AmidarInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, -}; - -STDINPUTINFO(Amidar) - -static struct BurnInputInfo AnteaterInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort2 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 2, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 3, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 6, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Anteater) - -static struct BurnInputInfo AnteatergInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort2 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort2 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort2 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort2 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort2 + 3, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Anteaterg) - -static struct BurnInputInfo AnteaterukInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Anteateruk) - -static struct BurnInputInfo AtlantisInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Atlantis) - -static struct BurnInputInfo AzurianInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 1, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 0, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 3, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 2, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 5, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , &GalFakeDip , "dip" }, -}; - -STDINPUTINFO(Azurian) - -static struct BurnInputInfo BagmanmcInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort0 + 2, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 0, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 5, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 3, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 6, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Bagmanmc) - -static struct BurnInputInfo Batman2InputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 7, "p1 fire 2" }, - - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Batman2) - -static struct BurnInputInfo BlkholeInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Blkhole) - -static struct BurnInputInfo BongoInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 5, "p1 up" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 up" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, -}; - -STDINPUTINFO(Bongo) - -static struct BurnInputInfo CalipsoInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - - {"P1 Up" , BIT_DIGITAL , GalInputPort0 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , GalInputPort0 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , GalInputPort2 + 0, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , GalInputPort1 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , GalInputPort1 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , GalInputPort0 + 0, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Calipso) - -static struct BurnInputInfo CheckmanjInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort2 + 1, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort2 + 0, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Checkmanj) - -static struct BurnInputInfo CheckmanInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 coin" }, - {"Start 1/P1 Fire 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 0, "p2 coin" }, - {"Start 2/P1 Fire 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 4, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Checkman) - -static struct BurnInputInfo CkonggInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 6, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 1, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Ckongg) - -static struct BurnInputInfo CkongsInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 1, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Ckongs) - -static struct BurnInputInfo DambustrInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 0, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort0 + 2, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort1 + 5, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort1 + 4, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort1 + 3, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort1 + 2, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort1 + 1, "p1 fire 2" }, - {"Fire 3" , BIT_DIGITAL , GalInputPort0 + 7, "p1 fire 3" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Dambustr) - -static struct BurnInputInfo DarkplntInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - - {"Left" , BIT_DIGITAL , GalInputPort3 + 0, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort3 + 1, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 2, "p1 fire 2" }, - {"Fire 3" , BIT_DIGITAL , GalInputPort0 + 0, "p1 fire 3" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Darkplnt) - -static struct BurnInputInfo DevilfsgInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Devilfsg) - -static struct BurnInputInfo DevilfshInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Devilfsh) - -static struct BurnInputInfo DingoInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort2 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 5, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Dingo) - -static struct BurnInputInfo DkongjrmInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 5, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Dkongjrm) - -static struct BurnInputInfo DonightInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort1 + 2, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort1 + 3, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, -}; - -STDINPUTINFO(Donight) - -static struct BurnInputInfo DrivfrcgInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort1 + 1, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, -}; - -STDINPUTINFO(Drivfrcg) - -static struct BurnInputInfo ExplorerInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 0, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, -}; - -STDINPUTINFO(Explorer) - -static struct BurnInputInfo FantastcInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Fantastc) - -static struct BurnInputInfo Fourin1InputList[] = { - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 1, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"GM Dip 1" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, - {"SC Dip 2" , BIT_DIPSWITCH , GalDip + 4 , "dip" }, - {"GX Dip 3" , BIT_DIPSWITCH , GalDip + 5 , "dip" }, - {"GC Dip 4" , BIT_DIPSWITCH , GalDip + 6 , "dip" }, -}; - -STDINPUTINFO(Fourin1) - -static struct BurnInputInfo FroggInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Frogg) - -static struct BurnInputInfo FroggerInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Frogger) - -static struct BurnInputInfo FroggermcInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Froggermc) - -static struct BurnInputInfo GalaxianInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Galaxian) - -static struct BurnInputInfo GmgalaxInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 1, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"GM Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"GM Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"GM Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"GX Dip 1" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, - {"GX Dip 2" , BIT_DIPSWITCH , GalDip + 4 , "dip" }, - {"GX Dip 3" , BIT_DIPSWITCH , GalDip + 5 , "dip" }, - {"Game Select Switch", BIT_DIPSWITCH , &GalFakeDip , "dip" }, -}; - -STDINPUTINFO(Gmgalax) - -static struct BurnInputInfo HotshockInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort1 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort1 + 4, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 0, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort1 + 5, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, -}; - -STDINPUTINFO(Hotshock) - -static struct BurnInputInfo HunchbkgInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 fire 1" }, - - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Hunchbkg) - -static struct BurnInputInfo HunchbksInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Hunchbks) - -static struct BurnInputInfo HustlerInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 1, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Hustler) - -static struct BurnInputInfo JumpbugInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort1 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 1, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 7, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Jumpbug) - -static struct BurnInputInfo KingballInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Fake Dip" , BIT_DIPSWITCH , &GalFakeDip , "dip" }, -}; - -STDINPUTINFO(Kingball) - -static struct BurnInputInfo CkongmcInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 1, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 1, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Ckongmc) - -static struct BurnInputInfo KongInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 coin" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort1 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Kong) - -static struct BurnInputInfo LadybuggInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort2 + 5, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Ladybugg) - -static struct BurnInputInfo LeversInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort1 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - - {"P2 Up" , BIT_DIGITAL , GalInputPort0 + 1, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , GalInputPort1 + 7, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Levers) - -static struct BurnInputInfo LosttombInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort0 + 0, "p2 start" }, - - {"Left Up" , BIT_DIGITAL , GalInputPort0 + 2, "p1 up" }, - {"Left Down" , BIT_DIGITAL , GalInputPort0 + 3, "p1 down" }, - {"left Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Left Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort1 + 6, "p1 fire 1" }, - - {"Right Up" , BIT_DIGITAL , GalInputPort1 + 2, "p2 up" }, - {"Right Down" , BIT_DIGITAL , GalInputPort1 + 3, "p2 down" }, - {"Right Left" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right Right" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Losttomb) - -static struct BurnInputInfo LuctodayInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 7, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Luctoday) - -static struct BurnInputInfo MarsInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"P1 Left Stick Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"P1 Left Stick Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"P1 Left Stick Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"P1 Left Stick Right", BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"P1 Rght Stick Up" , BIT_DIGITAL , GalInputPort2 + 7, "p3 up" }, - {"P1 Rght Stick Down" , BIT_DIGITAL , GalInputPort2 + 5, "p3 down" }, - {"P1 Rght Stick Left" , BIT_DIGITAL , GalInputPort0 + 3, "p3 left" }, - {"P1 Rght Stick Right", BIT_DIGITAL , GalInputPort0 + 2, "p3 right" }, - - {"P2 Left Stick Up" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"P2 Left Stick Down" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"P2 Left Stick Left" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"P2 Left Stick Right", BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"P2 Rght Stick Up" , BIT_DIGITAL , GalInputPort3 + 7, "p4 up" }, - {"P2 Rght Stick Down" , BIT_DIGITAL , GalInputPort3 + 5, "p4 down" }, - {"P2 Rght Stick Left" , BIT_DIGITAL , GalInputPort1 + 3, "p4 left" }, - {"P2 Rght Stick Right", BIT_DIGITAL , GalInputPort1 + 2, "p4 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 1, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , &GalFakeDip , "dip" }, -}; - -STDINPUTINFO(Mars) - -static struct BurnInputInfo MoonwarInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 2, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 3, "p2 start" }, - - {"Hyper Flip / Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 2" }, - - A("Dial" , BIT_ANALOG_REL, &GalAnalogPort0 , "p1 z-axis" ), - {"Fire 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort1 + 6, "p1 fire 2" }, - {"Fire 3" , BIT_DIGITAL , GalInputPort1 + 5, "p1 fire 3" }, - - A("Dial (Cocktail)" , BIT_ANALOG_REL, &GalAnalogPort1 , "p2 z-axis" ), - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 fire 1" }, - {"Fire 3 (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 5, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Moonwar) - -static struct BurnInputInfo MrkougarInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Mrkougar) - -static struct BurnInputInfo MshuttleInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 2, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 3, "p1 down" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 5, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 down" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Mshuttle) - -static struct BurnInputInfo OmegabInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Omegab) - -static struct BurnInputInfo OrbitronInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 7, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Orbitron) - -static struct BurnInputInfo Ozon1InputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"P2 Left" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Ozon1) - -static struct BurnInputInfo PacmanblInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Pacmanbl) - -static struct BurnInputInfo Phoenxp2InputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Phoenxp2) - -static struct BurnInputInfo PicsesInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 0, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Picses) - -static struct BurnInputInfo PorterInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 7, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 1, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Porter) - -static struct BurnInputInfo RacknrolInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 5, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Racknrol) - -static struct BurnInputInfo RescueInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort2 + 6, "p2 start" }, - - {"P1 Left Stick Up" , BIT_DIGITAL , GalInputPort0 + 2, "p1 up" }, - {"P1 Left Stick Down" , BIT_DIGITAL , GalInputPort0 + 3, "p1 down" }, - {"P1 Left Stick Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"P1 Left Stick Right", BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"P1 Rght Stick Up" , BIT_DIGITAL , GalInputPort1 + 2, "p2 up" }, - {"P1 Rght Stick Down" , BIT_DIGITAL , GalInputPort1 + 3, "p2 down" }, - {"P1 Rght Stick Left" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"P1 Rght Stick Right", BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 0, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , &GalFakeDip , "dip" }, -}; - -STDINPUTINFO(Rescue) - -static struct BurnInputInfo RockclimInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"P1 Left Stick Up" , BIT_DIGITAL , GalInputPort1 + 4, "p1 up" }, - {"P1 Left Stick Down" , BIT_DIGITAL , GalInputPort1 + 5, "p1 down" }, - {"P1 Left Stick Left" , BIT_DIGITAL , GalInputPort1 + 2, "p1 left" }, - {"P1 Left Stick Right", BIT_DIGITAL , GalInputPort1 + 3, "p1 right" }, - {"P1 Rght Stick Up" , BIT_DIGITAL , GalInputPort0 + 4, "p2 up" }, - {"P1 Rght Stick Down" , BIT_DIGITAL , GalInputPort0 + 5, "p2 down" }, - {"P1 Rght Stick Left" , BIT_DIGITAL , GalInputPort0 + 2, "p2 left" }, - {"P1 Rght Stick Right", BIT_DIGITAL , GalInputPort0 + 3, "p2 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , &GalFakeDip , "dip" }, -}; - -STDINPUTINFO(Rockclim) - -static struct BurnInputInfo ScorpionmcInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 coin" }, - {"Start 1 / Fire 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2 / Fire 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 5, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 0, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, -}; - -STDINPUTINFO(Scorpionmc) - -static struct BurnInputInfo AracnisInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 6, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 0, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH , GalDip + 3 , "dip" }, -}; - -STDINPUTINFO(Aracnis) - -static struct BurnInputInfo Scramb2InputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 2, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Scramb2) - -static struct BurnInputInfo ScramblbInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 7, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 1, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Scramblb) - -static struct BurnInputInfo ScrambleInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Scramble) - -static struct BurnInputInfo ScramblerInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort1 + 2, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 down" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Scrambler) - -static struct BurnInputInfo SfxInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , GalInputPort1 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Sfx) - -static struct BurnInputInfo SkybaseInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort2 + 6, "p1 fire 2" }, - - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 7, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Skybase) - -static struct BurnInputInfo SmooncrsInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Smooncrs) - -static struct BurnInputInfo SpdcoinInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort0 + 3, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Spdcoin) - -static struct BurnInputInfo StratgyxInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 2" }, - {"Fire 3" , BIT_DIGITAL , GalInputPort2 + 5, "p1 fire 3" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 fire 2" }, - {"Fire 3 (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 7, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Stratgyx) - -static struct BurnInputInfo StreakngInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 1, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Streakng) - -static struct BurnInputInfo SuperbonInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort0 + 0, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 2, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 3, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort1 + 3, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort1 + 6, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Superbon) - -static struct BurnInputInfo TazmaniaInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort2 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 2, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 3, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 0, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 7, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 6, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Tazmania) - -static struct BurnInputInfo TazzmangInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1 / Fire 2" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 7, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Tazzmang) - -static struct BurnInputInfo TdpgalInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Tdpgal) - -static struct BurnInputInfo TheendInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , GalInputPort0 + 1, "p1 fire 2" }, - - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Theend) - -static struct BurnInputInfo ThepitmInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 7, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 5, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Thepitm) - -static struct BurnInputInfo TimefgtrInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 1, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort1 + 5, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Timefgtr) - -static struct BurnInputInfo TurtlesInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort2 + 4, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort2 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 3, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 0, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort2 + 0, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Service" , BIT_DIGITAL , GalInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Turtles) - -static struct BurnInputInfo WarofbugInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , GalInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 1, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Warofbug) - -static struct BurnInputInfo ZigzagInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , GalInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , GalInputPort1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , GalInputPort1 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , GalInputPort0 + 5, "p1 up" }, - {"Down" , BIT_DIGITAL , GalInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , GalInputPort0 + 2, "p1 left" }, - {"Right" , BIT_DIGITAL , GalInputPort0 + 3, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , GalInputPort0 + 4, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 5, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , GalInputPort0 + 7, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 2, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 3, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , GalInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &GalReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , GalDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , GalDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , GalDip + 2 , "dip" }, -}; - -STDINPUTINFO(Zigzag) - -#undef A - -// Dip Switch defintions (alphabetical) -static struct BurnDIPInfo Ad2083DIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x10, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x0d, 0x01, 0x0f, 0x08, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x0f, 0x09, "2 Coins 2 Plays" }, - {0x0d, 0x01, 0x0f, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x0f, 0x0a, "2 Coins 3 Plays" }, - {0x0d, 0x01, 0x0f, 0x0b, "2 Coins 4 Plays" }, - {0x0d, 0x01, 0x0f, 0x01, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x0f, 0x0c, "2 Coins 5 Plays" }, - {0x0d, 0x01, 0x0f, 0x0d, "2 Coins 6 Plays" }, - {0x0d, 0x01, 0x0f, 0x02, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x0f, 0x0e, "2 Coins 7 Plays" }, - {0x0d, 0x01, 0x0f, 0x0f, "2 Coins 8 Plays" }, - {0x0d, 0x01, 0x0f, 0x03, "1 Coin 4 Plays" }, - {0x0d, 0x01, 0x0f, 0x04, "1 Coin 5 Plays" }, - {0x0d, 0x01, 0x0f, 0x05, "1 Coin 6 Plays" }, - {0x0d, 0x01, 0x0f, 0x06, "1 Coin 7 Plays" }, - {0x0d, 0x01, 0x0f, 0x07, "1 Coin 8 Plays" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x0d, 0x01, 0xf0, 0x80, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xf0, 0x90, "2 Coins 2 Plays" }, - {0x0d, 0x01, 0xf0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xf0, 0xa0, "2 Coins 3 Plays" }, - {0x0d, 0x01, 0xf0, 0xb0, "2 Coins 4 Plays" }, - {0x0d, 0x01, 0xf0, 0x10, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xf0, 0xc0, "2 Coins 5 Plays" }, - {0x0d, 0x01, 0xf0, 0xd0, "2 Coins 6 Plays" }, - {0x0d, 0x01, 0xf0, 0x20, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0xf0, 0xe0, "2 Coins 7 Plays" }, - {0x0d, 0x01, 0xf0, 0xf0, "2 Coins 8 Plays" }, - {0x0d, 0x01, 0xf0, 0x30, "1 Coin 4 Plays" }, - {0x0d, 0x01, 0xf0, 0x40, "1 Coin 5 Plays" }, - {0x0d, 0x01, 0xf0, 0x50, "1 Coin 6 Plays" }, - {0x0d, 0x01, 0xf0, 0x60, "1 Coin 7 Plays" }, - {0x0d, 0x01, 0xf0, 0x70, "1 Coin 8 Plays" }, - - // Dip 4 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x03, 0x03, "2" }, - {0x0e, 0x01, 0x03, 0x02, "3" }, - {0x0e, 0x01, 0x03, 0x01, "4" }, - {0x0e, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x0c, 0x0c, "None" }, - {0x0e, 0x01, 0x0c, 0x08, "100000" }, - {0x0e, 0x01, 0x0c, 0x04, "150000" }, - {0x0e, 0x01, 0x0c, 0x00, "200000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x10, 0x10, "Upright" }, - {0x0e, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0e, 0x01, 0x20, 0x20, "Off" }, - {0x0e, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ad2083) - -static struct BurnDIPInfo AmidarDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x06, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x00, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x03, "255" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x12, 0x01, 0x04, 0x04, "30000 50000" }, - {0x12, 0x01, 0x04, 0x00, "50000 50000" }, - - // Dip 4 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x13, 0x01, 0x0f, 0x0b, "4 Coins 1 Play" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 1 Play" }, - {0x13, 0x01, 0x0f, 0x0e, "2 Coins 1 Play" }, - {0x13, 0x01, 0x0f, 0x0d, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x0f, 0x07, "4 Coins 3 Plays" }, - {0x13, 0x01, 0x0f, 0x00, "1 Coin 1 Play" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x0f, 0x01, "2 Coins 3 Plays" }, - {0x13, 0x01, 0x0f, 0x08, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 5 Plays" }, - {0x13, 0x01, 0x0f, 0x04, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x0f, 0x02, "1 Coin 5 Plays" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x0f, 0x06, "1 Coin 7 Plays" }, - {0x13, 0x01, 0x0f, 0x0f, "Free Play" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x13, 0x01, 0xf0, 0xb0, "4 Coins 1 Play" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 1 Play" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Play" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 2 Plays" }, - {0x13, 0x01, 0xf0, 0x70, "4 Coins 3 Plays" }, - {0x13, 0x01, 0xf0, 0x00, "1 Coin 1 Play" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 4 Plays" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins 3 Plays" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 2 Plays" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 5 Plays" }, - {0x13, 0x01, 0xf0, 0x40, "1 Coin 3 Plays" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Plays" }, - {0x13, 0x01, 0xf0, 0x20, "1 Coin 5 Plays" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Plays" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 7 Plays" }, - {0x13, 0x01, 0xf0, 0xf0, "Disable All Coins" }, -}; - -STDDIPINFO(Amidar) - -static struct BurnDIPInfo AmidaroDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x02, NULL }, - {0x12, 0xff, 0xff, 0x06, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x00, "1" }, - {0x11, 0x01, 0x03, 0x01, "2" }, - {0x11, 0x01, 0x03, 0x02, "3" }, - {0x11, 0x01, 0x03, 0x03, "4" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Level Progression" }, - {0x12, 0x01, 0x02, 0x02, "Slow" }, - {0x12, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x12, 0x01, 0x04, 0x04, "30000 70000" }, - {0x12, 0x01, 0x04, 0x00, "50000 80000" }, - - // Dip 4 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x13, 0x01, 0x0f, 0x0b, "4 Coins 1 Play" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 1 Play" }, - {0x13, 0x01, 0x0f, 0x0e, "2 Coins 1 Play" }, - {0x13, 0x01, 0x0f, 0x0d, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x0f, 0x07, "4 Coins 3 Plays" }, - {0x13, 0x01, 0x0f, 0x00, "1 Coin 1 Play" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x0f, 0x01, "2 Coins 3 Plays" }, - {0x13, 0x01, 0x0f, 0x08, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 5 Plays" }, - {0x13, 0x01, 0x0f, 0x04, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x0f, 0x02, "1 Coin 5 Plays" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x0f, 0x06, "1 Coin 7 Plays" }, - {0x13, 0x01, 0x0f, 0x0f, "Free Play" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x13, 0x01, 0xf0, 0xb0, "4 Coins 1 Play" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 1 Play" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Play" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 2 Plays" }, - {0x13, 0x01, 0xf0, 0x70, "4 Coins 3 Plays" }, - {0x13, 0x01, 0xf0, 0x00, "1 Coin 1 Play" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 4 Plays" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins 3 Plays" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 2 Plays" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 5 Plays" }, - {0x13, 0x01, 0xf0, 0x40, "1 Coin 3 Plays" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Plays" }, - {0x13, 0x01, 0xf0, 0x20, "1 Coin 5 Plays" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Plays" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 7 Plays" }, - {0x13, 0x01, 0xf0, 0xf0, "Disable All Coins" }, -}; - -STDDIPINFO(Amidaro) - -static struct BurnDIPInfo AmidarsDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x01, NULL }, - {0x12, 0xff, 0xff, 0x0a, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x00, "2" }, - {0x11, 0x01, 0x03, 0x01, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x03, "256" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x12, 0x01, 0x02, 0x02, "A 1C/1P B 1C/6P" }, - {0x12, 0x01, 0x02, 0x00, "A 2C/1P B 1C/3P" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x08, 0x08, "Upright" }, - {0x12, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Amidars) - -static struct BurnDIPInfo AmidaruDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x06, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x00, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x03, "255" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x12, 0x01, 0x04, 0x04, "30000 70000" }, - {0x12, 0x01, 0x04, 0x00, "50000 80000" }, - - // Dip 4 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x13, 0x01, 0x0f, 0x0b, "4 Coins 1 Play" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 1 Play" }, - {0x13, 0x01, 0x0f, 0x0e, "2 Coins 1 Play" }, - {0x13, 0x01, 0x0f, 0x0d, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x0f, 0x07, "4 Coins 3 Plays" }, - {0x13, 0x01, 0x0f, 0x00, "1 Coin 1 Play" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x0f, 0x01, "2 Coins 3 Plays" }, - {0x13, 0x01, 0x0f, 0x08, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 5 Plays" }, - {0x13, 0x01, 0x0f, 0x04, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x0f, 0x02, "1 Coin 5 Plays" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x0f, 0x06, "1 Coin 7 Plays" }, - {0x13, 0x01, 0x0f, 0x0f, "Free Play" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x13, 0x01, 0xf0, 0xb0, "4 Coins 1 Play" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 1 Play" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Play" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 2 Plays" }, - {0x13, 0x01, 0xf0, 0x70, "4 Coins 3 Plays" }, - {0x13, 0x01, 0xf0, 0x00, "1 Coin 1 Play" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 4 Plays" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins 3 Plays" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 2 Plays" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 5 Plays" }, - {0x13, 0x01, 0xf0, 0x40, "1 Coin 3 Plays" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Plays" }, - {0x13, 0x01, 0xf0, 0x20, "1 Coin 5 Plays" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Plays" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 7 Plays" }, - {0x13, 0x01, 0xf0, 0xf0, "Disable All Coins" }, -}; - -STDDIPINFO(Amidaru) - -static struct BurnDIPInfo AnteaterDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x02, NULL }, - {0x11, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x01, 0x00, "3" }, - {0x10, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x11, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x11, 0x01, 0x06, 0x06, "A 1C/2P B 2C/1P" }, - {0x11, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P" }, - {0x11, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x08, 0x00, "Upright" }, - {0x11, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Anteater) - -static struct BurnDIPInfo AnteatergDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x02, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0f, 0x01, 0x02, 0x00, "A 1C/1P B 1C/5P" }, - {0x0f, 0x01, 0x02, 0x02, "A 2C/1P B 1C/3P" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x0c, 0x00, "3" }, - {0x0f, 0x01, 0x0c, 0x04, "4" }, - {0x0f, 0x01, 0x0c, 0x08, "5" }, - {0x0f, 0x01, 0x0c, 0x0c, "6" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x01, 0x00, "Upright" }, - {0x10, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - // Dip 3 -}; - -STDDIPINFO(Anteaterg) - -static struct BurnDIPInfo AnteaterukDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x02, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x01, 0x00, "Upright" }, - {0x10, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x11, 0x01, 0x02, 0x00, "A 1C/1P B 1C/5P" }, - {0x11, 0x01, 0x02, 0x02, "A 2C/1P B 1C/3P" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x0c, 0x00, "3" }, - {0x11, 0x01, 0x0c, 0x04, "4" }, - {0x11, 0x01, 0x0c, 0x08, "5" }, - {0x11, 0x01, 0x0c, 0x0c, "6" }, -}; - -STDDIPINFO(Anteateruk) - -static struct BurnDIPInfo ArmorcarDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x02, NULL }, - {0x13, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x12, 0x01, 0x01, 0x00, "3" }, - {0x12, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x13, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x13, 0x01, 0x06, 0x06, "A 1C/2P B 2C/1P" }, - {0x13, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P" }, - {0x13, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x08, 0x00, "Upright" }, - {0x13, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Armorcar) - -static struct BurnDIPInfo AtlantisDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x01, NULL }, - {0x13, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x01, 0x01, "Upright" }, - {0x12, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x12, 0x01, 0x02, 0x00, "3" }, - {0x12, 0x01, 0x02, 0x02, "5" }, - - // Dip 3 - {0 , 0xfe, 0 , 3 , "Coinage" }, - {0x13, 0x01, 0x0e, 0x0c, "A 1C/3P B 2C/1P" }, - {0x13, 0x01, 0x0e, 0x0e, "A 1C/6P B 1C/1P" }, - {0x13, 0x01, 0x0e, 0x0a, "A 1C/99P B 1C/99P" }, -}; - -STDDIPINFO(Atlantis) - -static struct BurnDIPInfo AtlantisbDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x80, NULL }, - {0x11, 0xff, 0xff, 0x0c, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x10, 0x01, 0x40, 0x40, "2 Coins 1 Play" }, - {0x10, 0x01, 0x40, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x10, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x11, 0x01, 0x02, 0x00, "Easy" }, - {0x11, 0x01, 0x02, 0x02, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x04, 0x04, "3" }, - {0x11, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x08, 0x08, "Upright" }, - {0x11, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Atlantisb) - -static struct BurnDIPInfo AzurianDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0f, 0x01, 0x80, 0x00, "3" }, - {0x0f, 0x01, 0x80, 0x80, "5" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x10, 0x01, 0x01, 0x01, "2 Coins 1 Play" }, - {0x10, 0x01, 0x01, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x02, 0x00, "5000" }, - {0x10, 0x01, 0x02, 0x02, "7000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x08, 0x00, "Upright" }, - {0x10, 0x01, 0x08, 0x08, "Cocktail" }, - - // Fake Dip - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x03, 0x03, "Easy" }, - {0x11, 0x01, 0x03, 0x01, "Normal" }, - {0x11, 0x01, 0x03, 0x02, "Hard" }, - {0x11, 0x01, 0x03, 0x00, "Very Hard" }, -}; - -STDDIPINFO(Azurian) - -static struct BurnDIPInfo BagmanmcDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x80, NULL }, - {0x11, 0xff, 0xff, 0x7e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x03, "2" }, - {0x11, 0x01, 0x03, 0x02, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x11, 0x01, 0x04, 0x00, "A 2C/1P B 1C/1P" }, - {0x11, 0x01, 0x04, 0x04, "A 1C/1P B 1C/2P" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x18, 0x18, "Easy" }, - {0x11, 0x01, 0x18, 0x10, "Medium" }, - {0x11, 0x01, 0x18, 0x08, "Hard" }, - {0x11, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x11, 0x01, 0x20, 0x20, "English" }, - {0x11, 0x01, 0x20, 0x00, "French" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x11, 0x01, 0x40, 0x40, "30000" }, - {0x11, 0x01, 0x40, 0x00, "40000" }, -}; - -STDDIPINFO(Bagmanmc) - -static struct BurnDIPInfo Batman2DIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0xc0, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0e, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - {0x0e, 0x01, 0x40, 0x00, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0e, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x0e, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0f, 0x01, 0x01, 0x00, "30000" }, - {0x0f, 0x01, 0x01, 0x01, "50000" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0f, 0x01, 0x04, 0x00, "3" }, - {0x0f, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x08, 0x00, "Upright" }, - {0x0f, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Batman2) - -static struct BurnDIPInfo BlkholeDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0x00, NULL }, - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x02, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0b, 0x01, 0xc0, 0xc0, "2 Coins 1 Play" }, - {0x0b, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0b, 0x01, 0xc0, 0x40, "1 Coin 2 Plays" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 3 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0c, 0x01, 0x01, 0x00, "5000" }, - {0x0c, 0x01, 0x01, 0x01, "10000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x02, 0x02, "Upright" }, - {0x0c, 0x01, 0x02, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Blkhole) - -static struct BurnDIPInfo BongoDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0x00, NULL }, - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x40, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - - // Dip 4 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0d, 0x01, 0x06, 0x00, "2" }, - {0x0d, 0x01, 0x06, 0x02, "3" }, - {0x0d, 0x01, 0x06, 0x04, "4" }, - {0x0d, 0x01, 0x06, 0x06, "5" }, - - {0 , 0xfe, 0 , 2 , "Infinite Lives" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0d, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x80, 0x00, "Upright" }, - {0x0d, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Bongo) - -static struct BurnDIPInfo CalipsoDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x02, NULL }, - {0x0f, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x01, 0x00, "3" }, - {0x0e, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x02, 0x00, "Off" }, - {0x0e, 0x01, 0x02, 0x02, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0f, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x0f, 0x01, 0x06, 0x06, "1 Coin 2 Plays" }, - {0x0f, 0x01, 0x06, 0x02, "1 Coin 3 Plays" }, - {0x0f, 0x01, 0x06, 0x00, "1 Coin 4 Plays" }, -}; - -STDDIPINFO(Calipso) - -static struct BurnDIPInfo CatacombDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x40, NULL }, - {0x0d, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0c, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x0c, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0c, 0x01, 0x80, 0x00, "1 Coin 3 Plays" }, - {0x0c, 0x01, 0x80, 0x80, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0d, 0x01, 0x04, 0x04, "3" }, - {0x0d, 0x01, 0x04, 0x00, "5" }, -}; - -STDDIPINFO(Catacomb) - -static struct BurnDIPInfo CavelonDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x02, NULL }, - {0x13, 0xff, 0xff, 0x0c, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x01, 0x00, "Upright" }, - {0x12, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x12, 0x01, 0x02, 0x02, "A 1C/1P B 1C/6P" }, - {0x12, 0x01, 0x02, 0x00, "A 2C/1P B 1C/3P" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x06, 0x00, "2" }, - {0x13, 0x01, 0x06, 0x04, "3" }, - {0x13, 0x01, 0x06, 0x02, "4" }, - {0x13, 0x01, 0x06, 0x06, "5" }, -}; - -STDDIPINFO(Cavelon) - -static struct BurnDIPInfo CheckmanjDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x12, 0x01, 0x40, 0x40, "A 2C/1P B 1C/3P" }, - {0x12, 0x01, 0x40, 0x00, "A 1C/1P B 1C/6P" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x00, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x02, "5" }, - {0x13, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x13, 0x01, 0x04, 0x00, "100000" }, - {0x13, 0x01, 0x04, 0x04, "200000" }, - - {0 , 0xfe, 0 , 2 , "Difficulty increases at level"}, - {0x13, 0x01, 0x08, 0x08, "3" }, - {0x13, 0x01, 0x08, 0x00, "5" }, -}; - -STDDIPINFO(Checkmanj) - -static struct BurnDIPInfo CheckmanDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x10, 0x01, 0x40, 0x40, "A 2C/1P B 1C/3P" }, - {0x10, 0x01, 0x40, 0x00, "A 1C/1P B 1C/6P" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x00, "Upright" }, - {0x10, 0x01, 0x80, 0x80, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x00, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x11, 0x01, 0x04, 0x00, "100000" }, - {0x11, 0x01, 0x04, 0x04, "200000" }, - - {0 , 0xfe, 0 , 2 , "Difficulty increases at level"}, - {0x11, 0x01, 0x08, 0x08, "3" }, - {0x11, 0x01, 0x08, 0x00, "5" }, -}; - -STDDIPINFO(Checkman) - -static struct BurnDIPInfo CkonggDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x80, NULL }, - {0x11, 0xff, 0xff, 0x0a, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x10, 0x01, 0x40, 0x00, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x40, 0x40, "1 Coin 4 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x00, "1" }, - {0x11, 0x01, 0x03, 0x01, "2" }, - {0x11, 0x01, 0x03, 0x02, "3" }, - {0x11, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x11, 0x01, 0x08, 0x08, "500000" }, - {0x11, 0x01, 0x08, 0x00, "750000" }, -}; - -STDDIPINFO(Ckongg) - -static struct BurnDIPInfo CkongsDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x02, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x02, 0x02, "Upright" }, - {0x11, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x04, 0x00, "3" }, - {0x11, 0x01, 0x04, 0x04, "4" }, -}; - -STDDIPINFO(Ckongs) - -static struct BurnDIPInfo DambustrDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Clear Swear Words" }, - {0x0c, 0x01, 0x20, 0x00, "Off" }, - {0x0c, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Second Coin Counter" }, - {0x0d, 0x01, 0x40, 0x00, "Off" }, - {0x0d, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0d, 0x01, 0x80, 0x80, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0x80, 0x00, "1 Coin 2 Credits" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "3" }, - {0x0e, 0x01, 0x03, 0x01, "4" }, - {0x0e, 0x01, 0x03, 0x02, "5" }, - {0x0e, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2 , "Game Test Mode" }, - {0x0e, 0x01, 0x04, 0x00, "Off" }, - {0x0e, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Union Jack" }, - {0x0e, 0x01, 0x08, 0x08, "Off" }, - {0x0e, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Dambustr) - -static struct BurnDIPInfo DarkplntDIPList[]= -{ - // Default Values - {0x08, 0xff, 0xff, 0x00, NULL }, - {0x09, 0xff, 0xff, 0x02, NULL }, - {0x0a, 0xff, 0xff, 0x0c, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Bonus Occurrence" }, - {0x09, 0x01, 0x01, 0x00, "Once" }, - {0x09, 0x01, 0x01, 0x01, "Everytime" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x09, 0x01, 0x02, 0x02, "1" }, - {0x09, 0x01, 0x02, 0x00, "2" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0a, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x0a, 0x01, 0x06, 0x06, "A 1C/2P B 2C/1P" }, - {0x0a, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P" }, - {0x0a, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0a, 0x01, 0x08, 0x08, "100000" }, - {0x0a, 0x01, 0x08, 0x00, "200000" }, -}; - -STDDIPINFO(Darkplnt) - -static struct BurnDIPInfo DevilfsgDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0xc0, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x10, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x10, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x10, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x11, 0x01, 0x01, 0x00, "10000" }, - {0x11, 0x01, 0x01, 0x01, "15000" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x04, 0x00, "4" }, - {0x11, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x08, 0x00, "Upright" }, - {0x11, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Devilfsg) - -static struct BurnDIPInfo DevilfshDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x03, NULL }, - {0x11, 0xff, 0xff, 0x02, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x01, 0x01, "10000" }, - {0x10, 0x01, 0x01, 0x00, "15000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x02, 0x02, "Upright" }, - {0x10, 0x01, 0x02, 0x00, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x02, 0x02, "4" }, - {0x11, 0x01, 0x02, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x11, 0x01, 0x04, 0x04, "2 Coins 1 Play" }, - {0x11, 0x01, 0x04, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x11, 0x01, 0x08, 0x00, "1 Coin 3 Plays" }, - {0x11, 0x01, 0x08, 0x08, "1 Coin 5 Plays" }, -}; - -STDDIPINFO(Devilfsh) - -static struct BurnDIPInfo DingoDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x80, NULL }, - {0x11, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x40, 0x00, "Upright" }, - {0x10, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x10, 0x01, 0x80, 0x40, "A 2C/1P B 1C/3P" }, - {0x10, 0x01, 0x80, 0x80, "A 1C/1P B 1C/5P" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x03, 0x00, "Easy" }, - {0x11, 0x01, 0x03, 0x01, "Medium" }, - {0x11, 0x01, 0x03, 0x02, "Hard" }, - {0x11, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x04, 0x00, "3" }, - {0x11, 0x01, 0x04, 0x04, "4" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x11, 0x01, 0x08, 0x00, "20000" }, - {0x11, 0x01, 0x08, 0x08, "40000" }, -}; - -STDDIPINFO(Dingo) - -static struct BurnDIPInfo DkongjrmDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x08, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0f, 0x01, 0xc0, 0xc0, "3 Coins 1 Play" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0f, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Coin Multiplier" }, - {0x10, 0x01, 0x01, 0x00, "x1" }, - {0x10, 0x01, 0x01, 0x01, "x2" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x06, 0x00, "3" }, - {0x10, 0x01, 0x06, 0x02, "4" }, - {0x10, 0x01, 0x06, 0x04, "5" }, - {0x10, 0x01, 0x06, 0x06, "6" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x08, 0x08, "Upright" }, - {0x10, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Dkongjrm) - -static struct BurnDIPInfo DonightDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x40, 0x00, "Off" }, - {0x0b, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0c, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0c, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0c, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x0c, 0x01, 0xc0, 0xc0, "Freeplay" }, -}; - -STDDIPINFO(Donight) - -static struct BurnDIPInfo DrivfrcgDIPList[]= -{ - // Default Values - {0x07, 0xff, 0xff, 0x00, NULL }, - {0x08, 0xff, 0xff, 0x00, NULL }, - {0x09, 0xff, 0xff, 0x00, NULL }, - {0x0a, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x08, 0x01, 0x40, 0x40, "A 2C/1P B 1C/3P" }, - {0x08, 0x01, 0x40, 0x00, "A 1C/1P B 1C/5P" }, - - // Dip 3 - - // Dip 4 -}; - -STDDIPINFO(Drivfrcg) - -static struct BurnDIPInfo Eagle2DIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x80, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x20, 0x00, "Upright" }, - {0x0b, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0c, 0x01, 0x40, 0x00, "30000" }, - {0x0c, 0x01, 0x40, 0x40, "50000" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0c, 0x01, 0x80, 0x80, "English" }, - {0x0c, 0x01, 0x80, 0x00, "Japanese" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0x03, 0x03, "4 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x02, "3 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x0d, 0x01, 0x0c, 0x00, "Off" }, - {0x0d, 0x01, 0x0c, 0x0c, "On" }, -}; - -STDDIPINFO(Eagle2) - -static struct BurnDIPInfo ExodusDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0xc0, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x40, 0x00, "Off" }, - {0x0b, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0c, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x0c, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0c, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x0c, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0d, 0x01, 0x01, 0x00, "7000" }, - {0x0d, 0x01, 0x01, 0x01, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0d, 0x01, 0x04, 0x00, "3" }, - {0x0d, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x08, 0x00, "Upright" }, - {0x0d, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Exodus) - -static struct BurnDIPInfo ExplorerDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x0d, 0x01, 0x0f, 0x08, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x0f, 0x09, "2 Coins 2 Plays" }, - {0x0d, 0x01, 0x0f, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x0f, 0x0a, "2 Coins 3 Plays" }, - {0x0d, 0x01, 0x0f, 0x0b, "2 Coins 4 Plays" }, - {0x0d, 0x01, 0x0f, 0x01, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x0f, 0x0c, "2 Coins 5 Plays" }, - {0x0d, 0x01, 0x0f, 0x0d, "2 Coins 6 Plays" }, - {0x0d, 0x01, 0x0f, 0x02, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x0f, 0x0e, "2 Coins 7 Plays" }, - {0x0d, 0x01, 0x0f, 0x0f, "2 Coins 8 Plays" }, - {0x0d, 0x01, 0x0f, 0x03, "1 Coin 4 Plays" }, - {0x0d, 0x01, 0x0f, 0x04, "1 Coin 5 Plays" }, - {0x0d, 0x01, 0x0f, 0x05, "1 Coin 6 Plays" }, - {0x0d, 0x01, 0x0f, 0x06, "1 Coin 7 Plays" }, - {0x0d, 0x01, 0x0f, 0x07, "1 Coin 8 Plays" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x0d, 0x01, 0xf0, 0x80, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xf0, 0x90, "2 Coins 2 Plays" }, - {0x0d, 0x01, 0xf0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xf0, 0xa0, "2 Coins 3 Plays" }, - {0x0d, 0x01, 0xf0, 0xb0, "2 Coins 4 Plays" }, - {0x0d, 0x01, 0xf0, 0x10, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xf0, 0xc0, "2 Coins 5 Plays" }, - {0x0d, 0x01, 0xf0, 0xd0, "2 Coins 6 Plays" }, - {0x0d, 0x01, 0xf0, 0x20, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0xf0, 0xe0, "2 Coins 7 Plays" }, - {0x0d, 0x01, 0xf0, 0xf0, "2 Coins 8 Plays" }, - {0x0d, 0x01, 0xf0, 0x30, "1 Coin 4 Plays" }, - {0x0d, 0x01, 0xf0, 0x40, "1 Coin 5 Plays" }, - {0x0d, 0x01, 0xf0, 0x50, "1 Coin 6 Plays" }, - {0x0d, 0x01, 0xf0, 0x60, "1 Coin 7 Plays" }, - {0x0d, 0x01, 0xf0, 0x70, "1 Coin 8 Plays" }, - - // Dip 4 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "2" }, - {0x0e, 0x01, 0x03, 0x01, "3" }, - {0x0e, 0x01, 0x03, 0x02, "4" }, - {0x0e, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x0e, 0x01, 0x1c, 0x04, "10000" }, - {0x0e, 0x01, 0x1c, 0x0c, "15000" }, - {0x0e, 0x01, 0x1c, 0x14, "20000" }, - {0x0e, 0x01, 0x1c, 0x1c, "25000" }, - {0x0e, 0x01, 0x1c, 0x00, "30000" }, - {0x0e, 0x01, 0x1c, 0x08, "50000" }, - {0x0e, 0x01, 0x1c, 0x10, "70000" }, - {0x0e, 0x01, 0x1c, 0x18, "80000" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x80, 0x00, "Off" }, - {0x0e, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Explorer) - -static struct BurnDIPInfo FantastcDIPList[]= -{ - // Default Values - {0x07, 0xff, 0xff, 0x40, NULL }, - {0x08, 0xff, 0xff, 0x00, NULL }, - {0x09, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x07, 0x01, 0x20, 0x00, "Off" }, - {0x07, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Extended Bonus Life" }, - {0x07, 0x01, 0x40, 0x00, "Off" }, - {0x07, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x08, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x08, 0x01, 0xc0, 0x80, "2 Coins 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x08, 0x01, 0x80, 0x00, "3" }, - {0x08, 0x01, 0x80, 0x80, "5" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x09, 0x01, 0x03, 0x00, "Easy" }, - {0x09, 0x01, 0x03, 0x01, "Medium" }, - {0x09, 0x01, 0x03, 0x02, "Hard" }, - {0x09, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x09, 0x01, 0x0c, 0x00, "20000 80000" }, - {0x09, 0x01, 0x0c, 0x04, "30000 80000" }, - {0x09, 0x01, 0x0c, 0x08, "20000 120000" }, - {0x09, 0x01, 0x0c, 0x0c, "30000 120000" }, -}; - -STDDIPINFO(Fantastc) - -static struct BurnDIPInfo FantaziaDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x20, 0x00, "Upright" }, - {0x0b, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0c, 0x01, 0x40, 0x00, "30000" }, - {0x0c, 0x01, 0x40, 0x40, "50000" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0x03, 0x03, "4 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x02, "3 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x0c, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x0c, 0x04, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x0c, 0x08, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x0c, 0x0c, "Freeplay" }, -}; - -STDDIPINFO(Fantazia) - -static struct BurnDIPInfo Fourin1DIPList[]= -{ - // Defaults - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x20, 0x00, "Upright" }, - {0x0e, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x04, 0x00, "3" }, - {0x10, 0x01, 0x04, 0x04, "5" }, - - // Ghost Muncher Pt 3 - {0 , 0xfe, 0 , 4 , "Bonus Life (Ghost Muncher)"}, - {0x11, 0x01, 0x03, 0x01, "10000" }, - {0x11, 0x01, 0x03, 0x02, "15000" }, - {0x11, 0x01, 0x03, 0x03, "20000" }, - {0x11, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Coinage (Ghost Muncher)"}, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x00, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xc0, 0xc0, "Free Play" }, - - // Scramble Pt 2 - {0 , 0xfe, 0 , 2 , "Allow Continue (Scramble)"}, - {0x12, 0x01, 0x08, 0x08, "No" }, - {0x12, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Coinage (Scramble)" }, - {0x12, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xc0, 0x00, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "Free Play" }, - - // Galaxian Pt 5 - {0 , 0xfe, 0 , 4 , "Bonus Life (Galaxian)" }, - {0x13, 0x01, 0x03, 0x01, "4000" }, - {0x13, 0x01, 0x03, 0x02, "5000" }, - {0x13, 0x01, 0x03, 0x03, "7000" }, - {0x13, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 3 , "Coinage (Galaxian)" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "Free Play" }, - - // Galactic Convoy - {0 , 0xfe, 0 , 2 , "Bonus Life (Galactic Convoy)"}, - {0x14, 0x01, 0x01, 0x00, "50000" }, - {0x14, 0x01, 0x01, 0x01, "80000" }, - - {0 , 0xfe, 0 , 3 , "Coinage (Galactic Convoy)"}, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xc0, 0x00, "1 Coin 1 Credit" }, - {0x14, 0x01, 0xc0, 0xc0, "Free Play" }, -}; - -STDDIPINFO(Fourin1) - -static struct BurnDIPInfo FroggDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0xc0, NULL }, - {0x10, 0xff, 0xff, 0x05, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0xc0, 0xc0, "3" }, - {0x0f, 0x01, 0xc0, 0x80, "5" }, - {0x0f, 0x01, 0xc0, 0x40, "7" }, - {0x0f, 0x01, 0xc0, 0x00, "256" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x01, 0x01, "Upright" }, - {0x10, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x10, 0x01, 0x04, 0x00, "2 Coins 1 Credit" }, - {0x10, 0x01, 0x04, 0x04, "1 Coin 1 Credit" }, -}; - -STDDIPINFO(Frogg) - -static struct BurnDIPInfo FroggerDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x03, NULL }, - {0x10, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x03, 0x03, "3" }, - {0x0f, 0x01, 0x03, 0x02, "5" }, - {0x0f, 0x01, 0x03, 0x01, "7" }, - {0x0f, 0x01, 0x03, 0x00, "256" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x06, 0x04, "A 2C/1P B 2C/1P C 2C/1P"}, - {0x10, 0x01, 0x06, 0x02, "A 2C/1P B 1C/3P C 2C/1P"}, - {0x10, 0x01, 0x06, 0x06, "A 1C/1P B 1C/1P C 1C/1P"}, - {0x10, 0x01, 0x06, 0x00, "A 1C/1P B 1C/6P C 1C/1P"}, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x08, 0x08, "Upright" }, - {0x10, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Frogger) - -static struct BurnDIPInfo FroggermcDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0xc0, NULL }, - {0x10, 0xff, 0xff, 0x07, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0xc0, 0xc0, "3" }, - {0x0f, 0x01, 0xc0, 0x80, "5" }, - {0x0f, 0x01, 0xc0, 0x40, "7" }, - {0x0f, 0x01, 0xc0, 0x00, "256" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x01, 0x01, "Upright" }, - {0x10, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x06, 0x02, "A 2C/1P B 2C/1P C 2C/1P"}, - {0x10, 0x01, 0x06, 0x04, "A 2C/1P B 1C/3P C 2C/1P"}, - {0x10, 0x01, 0x06, 0x06, "A 1C/1P B 1C/1P C 1C/1P"}, - {0x10, 0x01, 0x06, 0x00, "A 1C/1P B 1C/6P C 1C/1P"}, -}; - -STDDIPINFO(Froggermc) - -static struct BurnDIPInfo GalaxianDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x00, "7000" }, - {0x0e, 0x01, 0x03, 0x01, "10000" }, - {0x0e, 0x01, 0x03, 0x02, "12000" }, - {0x0e, 0x01, 0x03, 0x03, "20000" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "2" }, - {0x0e, 0x01, 0x04, 0x04, "3" }, -}; - -STDDIPINFO(Galaxian) - -static struct BurnDIPInfo GalaxianblDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x00, "None" }, - {0x0e, 0x01, 0x03, 0x01, "10000" }, - {0x0e, 0x01, 0x03, 0x02, "12000" }, - {0x0e, 0x01, 0x03, 0x03, "20000" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "2" }, - {0x0e, 0x01, 0x04, 0x04, "3" }, -}; - -STDDIPINFO(Galaxianbl) - -static struct BurnDIPInfo GalaxrfDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life / Enemy Bullet Speed" }, - {0x0e, 0x01, 0x03, 0x00, "None, Slow" }, - {0x0e, 0x01, 0x03, 0x01, "12000, Medium" }, - {0x0e, 0x01, 0x03, 0x02, "20000, Fast" }, - {0x0e, 0x01, 0x03, 0x03, "30000, Fastest" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "2" }, - {0x0e, 0x01, 0x04, 0x04, "3" }, - - {0 , 0xfe, 0 , 2 , "Player Bullet Speed" }, - {0x0e, 0x01, 0x08, 0x00, "Slow" }, - {0x0e, 0x01, 0x08, 0x08, "Fast" }, -}; - -STDDIPINFO(Galaxrf) - -static struct BurnDIPInfo GhostmunDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x40, NULL }, - {0x0e, 0xff, 0xff, 0x06, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0d, 0x01, 0xc0, 0x40, "10000" }, - {0x0d, 0x01, 0xc0, 0x80, "15000" }, - {0x0d, 0x01, 0xc0, 0xc0, "20000" }, - {0x0d, 0x01, 0xc0, 0x00, "None" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x00, "2 Coins 1 Play" }, - {0x0e, 0x01, 0x03, 0x02, "1 Coin 1 Play" }, - {0x0e, 0x01, 0x03, 0x01, "1 Coin 2 Plays" }, - {0x0e, 0x01, 0x03, 0x03, "Freeplay" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x0c, "1" }, - {0x0e, 0x01, 0x0c, 0x08, "2" }, - {0x0e, 0x01, 0x0c, 0x04, "3" }, - {0x0e, 0x01, 0x0c, 0x00, "4" }, -}; - -STDDIPINFO(Ghostmun) - -static struct BurnDIPInfo GmgalaxDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x40, NULL }, - {0x10, 0xff, 0xff, 0x06, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - // Ghost Muncher Dip 1 - {0 , 0xfe, 0 , 2 , "GM - Cabinet" }, - {0x0e, 0x01, 0x20, 0x00, "Upright" }, - {0x0e, 0x01, 0x20, 0x20, "Cocktail" }, - - // Ghost Muncher Dip 2 - {0 , 0xfe, 0 , 4 , "GM - Bonus Life" }, - {0x0f, 0x01, 0xc0, 0x40, "10000" }, - {0x0f, 0x01, 0xc0, 0x80, "15000" }, - {0x0f, 0x01, 0xc0, 0xc0, "20000" }, - {0x0f, 0x01, 0xc0, 0x00, "None" }, - - // Ghost Muncher Dip 3 - {0 , 0xfe, 0 , 4 , "GM - Coinage" }, - {0x10, 0x01, 0x03, 0x00, "2 Coins 1 Play" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 1 Play" }, - {0x10, 0x01, 0x03, 0x01, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x03, 0x03, "Freeplay" }, - - {0 , 0xfe, 0 , 4 , "GM - Lives" }, - {0x10, 0x01, 0x0c, 0x0c, "1" }, - {0x10, 0x01, 0x0c, 0x08, "2" }, - {0x10, 0x01, 0x0c, 0x04, "3" }, - {0x10, 0x01, 0x0c, 0x00, "4" }, - - // Galaxian Dip 1 - {0 , 0xfe, 0 , 2 , "GX - Cabinet" }, - {0x11, 0x01, 0x20, 0x00, "Upright" }, - {0x11, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "GX - Service Mode" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - // Galaxian Dip 2 - {0 , 0xfe, 0 , 4 , "GX - Coinage" }, - {0x12, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x12, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x12, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Galaxian Dip 3 - {0 , 0xfe, 0 , 4 , "GX - Bonus Life" }, - {0x13, 0x01, 0x03, 0x01, "4000" }, - {0x13, 0x01, 0x03, 0x02, "5000" }, - {0x13, 0x01, 0x03, 0x03, "7000" }, - {0x13, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "GX - Lives" }, - {0x13, 0x01, 0x04, 0x00, "3" }, - {0x13, 0x01, 0x04, 0x04, "5" }, - - // Select switch - {0 , 0xfe, 0 , 2 , "Game Select" }, - {0x14, 0x01, 0x01, 0x00, "Ghost Muncher" }, - {0x14, 0x01, 0x01, 0x01, "Galaxian" }, -}; - -STDDIPINFO(Gmgalax) - -static struct BurnDIPInfo GteikokubDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0xc0, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0c, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x0c, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0c, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x0c, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0d, 0x01, 0x01, 0x00, "7000" }, - {0x0d, 0x01, 0x01, 0x01, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0d, 0x01, 0x04, 0x00, "3" }, - {0x0d, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x08, 0x00, "Upright" }, - {0x0d, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Gteikokub) - -static struct BurnDIPInfo Gteikokub2DIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0xc0, NULL }, - {0x0d, 0xff, 0xff, 0x08, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0c, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x0c, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0c, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x0c, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0d, 0x01, 0x01, 0x00, "7000" }, - {0x0d, 0x01, 0x01, 0x01, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0d, 0x01, 0x04, 0x00, "3" }, - {0x0d, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x08, 0x08, "Upright" }, - {0x0d, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Gteikokub2) - -static struct BurnDIPInfo AsideralDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x40, NULL }, - {0x0e, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xc0, 0x00, "1C/2C, 1C/1C" }, - {0x0d, 0x01, 0xc0, 0x80, "1C/4C, 1C/2C" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x00, "None" }, - {0x0e, 0x01, 0x03, 0x01, "4000" }, - {0x0e, 0x01, 0x03, 0x02, "5000" }, - {0x0e, 0x01, 0x03, 0x03, "7000" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "4" }, - {0x0e, 0x01, 0x04, 0x04, "5" }, -}; - -STDDIPINFO(Asideral) - -static struct BurnDIPInfo HotshockDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x05, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x0d, 0x01, 0xf0, 0x80, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xf0, 0x90, "2 Coins 2 Plays" }, - {0x0d, 0x01, 0xf0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xf0, 0xa0, "2 Coins 3 Plays" }, - {0x0d, 0x01, 0xf0, 0xb0, "2 Coins 4 Plays" }, - {0x0d, 0x01, 0xf0, 0x10, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xf0, 0xc0, "2 Coins 5 Plays" }, - {0x0d, 0x01, 0xf0, 0xd0, "2 Coins 6 Plays" }, - {0x0d, 0x01, 0xf0, 0x20, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0xf0, 0xe0, "2 Coins 7 Plays" }, - {0x0d, 0x01, 0xf0, 0xf0, "2 Coins 8 Plays" }, - {0x0d, 0x01, 0xf0, 0x30, "1 Coin 4 Plays" }, - {0x0d, 0x01, 0xf0, 0x40, "1 Coin 5 Plays" }, - {0x0d, 0x01, 0xf0, 0x50, "1 Coin 6 Plays" }, - {0x0d, 0x01, 0xf0, 0x60, "1 Coin 7 Plays" }, - {0x0d, 0x01, 0xf0, 0x70, "1 Coin 8 Plays" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x0d, 0x01, 0x0f, 0x08, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x0f, 0x09, "2 Coins 2 Plays" }, - {0x0d, 0x01, 0x0f, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x0f, 0x0a, "2 Coins 3 Plays" }, - {0x0d, 0x01, 0x0f, 0x0b, "2 Coins 4 Plays" }, - {0x0d, 0x01, 0x0f, 0x01, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x0f, 0x0c, "2 Coins 5 Plays" }, - {0x0d, 0x01, 0x0f, 0x0d, "2 Coins 6 Plays" }, - {0x0d, 0x01, 0x0f, 0x02, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x0f, 0x0e, "2 Coins 7 Plays" }, - {0x0d, 0x01, 0x0f, 0x0f, "2 Coins 8 Plays" }, - {0x0d, 0x01, 0x0f, 0x03, "1 Coin 4 Plays" }, - {0x0d, 0x01, 0x0f, 0x04, "1 Coin 5 Plays" }, - {0x0d, 0x01, 0x0f, 0x05, "1 Coin 6 Plays" }, - {0x0d, 0x01, 0x0f, 0x06, "1 Coin 7 Plays" }, - {0x0d, 0x01, 0x0f, 0x07, "1 Coin 8 Plays" }, - - // Dip 4 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "2" }, - {0x0e, 0x01, 0x03, 0x01, "3" }, - {0x0e, 0x01, 0x03, 0x02, "4" }, - {0x0e, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0e, 0x01, 0x04, 0x04, "English" }, - {0x0e, 0x01, 0x04, 0x00, "Italian" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x18, 0x00, "75000" }, - {0x0e, 0x01, 0x18, 0x08, "150000" }, - {0x0e, 0x01, 0x18, 0x10, "200000" }, - {0x0e, 0x01, 0x18, 0x18, "None" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x80, 0x00, "Upright" }, - {0x0e, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Hotshock) - -static struct BurnDIPInfo HunchbkgDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Hunchbkg) - -static struct BurnDIPInfo HunchbksDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x02, NULL }, - {0x13, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x12, 0x01, 0x01, 0x00, "3" }, - {0x12, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x12, 0x01, 0x02, 0x00, "A 2C/1P B 1C/3P" }, - {0x12, 0x01, 0x02, 0x02, "A 1C/1P B 1C/5P" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x06, 0x06, "10000" }, - {0x13, 0x01, 0x06, 0x04, "20000" }, - {0x13, 0x01, 0x06, 0x02, "40000" }, - {0x13, 0x01, 0x06, 0x00, "80000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x08, 0x08, "Upright" }, - {0x14, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Hunchbks) - -static struct BurnDIPInfo HustlerDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x02, NULL }, - {0x12, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x01, 0x01, "1" }, - {0x11, 0x01, 0x01, 0x00, "2" }, - - {0 , 0xfe, 0 , 2 , "Infinite Lives" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x12, 0x01, 0x06, 0x02, "3 Coins 1 Play" }, - {0x12, 0x01, 0x06, 0x04, "2 Coins 1 Play" }, - {0x12, 0x01, 0x06, 0x06, "1 Coin 1 Play" }, - {0x12, 0x01, 0x06, 0x00, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x08, 0x08, "Upright" }, - {0x12, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Hustler) - -static struct BurnDIPInfo JumpbugDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x20, 0x00, "Upright" }, - {0x0f, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x10, 0x01, 0x40, 0x40, "Easy" }, - {0x10, 0x01, 0x40, 0x00, "Hard" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x01, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x03, "5" }, - {0x11, 0x01, 0x03, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x11, 0x01, 0x0c, 0x04, "A 2C/1P B 2C/1P" }, - {0x11, 0x01, 0x0c, 0x08, "A 2C/1P B 1C/3P" }, - {0x11, 0x01, 0x0c, 0x00, "A 1C/1P B 1C/1P" }, - {0x11, 0x01, 0x0c, 0x0c, "A 1C/1P B 1C/6P" }, -}; - -STDDIPINFO(Jumpbug) - -static struct BurnDIPInfo KingballDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x40, NULL }, - {0x0e, 0xff, 0xff, 0x04, NULL }, - {0x0f, 0xff, 0xff, 0x02, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0xc0, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xc0, 0x40, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xc0, 0x00, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x00, "10000" }, - {0x0e, 0x01, 0x03, 0x01, "12000" }, - {0x0e, 0x01, 0x03, 0x02, "15000" }, - {0x0e, 0x01, 0x03, 0x03, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "2" }, - {0x0e, 0x01, 0x04, 0x04, "3" }, - - // Fake dip - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0f, 0x01, 0x01, 0x00, "Off" }, - {0x0f, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Speech" }, - {0x0f, 0x01, 0x02, 0x00, "Off" }, - {0x0f, 0x01, 0x02, 0x02, "On" }, -}; - -STDDIPINFO(Kingball) - -static struct BurnDIPInfo CkongmcDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x0a, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "1" }, - {0x0e, 0x01, 0x03, 0x01, "2" }, - {0x0e, 0x01, 0x03, 0x02, "3" }, - {0x0e, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0e, 0x01, 0x08, 0x08, "500000" }, - {0x0e, 0x01, 0x08, 0x00, "750000" }, -}; - -STDDIPINFO(Ckongmc) - -static struct BurnDIPInfo KongDIPList[]= -{ - // Default Values - {0x08, 0xff, 0xff, 0x00, NULL }, - {0x09, 0xff, 0xff, 0x00, NULL }, - {0x0a, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x08, 0x01, 0x20, 0x00, "Off" }, - {0x08, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "99 Men/Max Timer" }, - {0x08, 0x01, 0x40, 0x00, "Off" }, - {0x08, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x09, 0x01, 0x40, 0x00, "3" }, - {0x09, 0x01, 0x40, 0x40, "5" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x09, 0x01, 0x80, 0x00, "1 Coin 1 Credit" }, - {0x09, 0x01, 0x80, 0x80, "2 Coins 1 Credit" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0a, 0x01, 0x03, 0x00, "10000" }, - {0x0a, 0x01, 0x03, 0x01, "20000" }, - {0x0a, 0x01, 0x03, 0x02, "30000" }, - {0x0a, 0x01, 0x03, 0x03, "None" }, - - {0 , 0xfe, 0 , 2 , "Mode" }, - {0x0a, 0x01, 0x04, 0x04, "Tournament (Harder)" }, - {0x0a, 0x01, 0x04, 0x00, "Normal" }, -}; - -STDDIPINFO(Kong) - -static struct BurnDIPInfo LadybuggDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x40, 0x00, "Upright" }, - {0x10, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x10, 0x01, 0x80, 0x00, "A 1C/1P B 1C/5P" }, - {0x10, 0x01, 0x80, 0x80, "A 2C/1P B 1C/3P" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x03, 0x00, "Easiest" }, - {0x11, 0x01, 0x03, 0x01, "Easy" }, - {0x11, 0x01, 0x03, 0x02, "Hard" }, - {0x11, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x04, 0x00, "3" }, - {0x11, 0x01, 0x04, 0x04, "4" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x11, 0x01, 0x08, 0x00, "20000" }, - {0x11, 0x01, 0x08, 0x08, "40000" }, -}; - -STDDIPINFO(Ladybugg) - -static struct BurnDIPInfo LeversDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, -}; - -STDDIPINFO(Levers) - -static struct BurnDIPInfo LosttombDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x02, NULL }, - {0x10, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x03, 0x02, "3" }, - {0x0f, 0x01, 0x03, 0x01, "5" }, - {0x0f, 0x01, 0x03, 0x00, "Free Play" }, - {0x0f, 0x01, 0x03, 0x03, "Invulnerability" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x10, 0x01, 0x06, 0x06, "A 1C/2P B 2C/1P" }, - {0x10, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P" }, - {0x10, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P" }, -}; - -STDDIPINFO(Losttomb) - -static struct BurnDIPInfo LuctodayDIPList[]= -{ - // Default Values - {0x07, 0xff, 0xff, 0x00, NULL }, - {0x08, 0xff, 0xff, 0x00, NULL }, - {0x09, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 -}; - -STDDIPINFO(Luctoday) - -static struct BurnDIPInfo MarsDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x03, NULL }, - {0x18, 0xff, 0xff, 0x06, NULL }, - {0x19, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x17, 0x01, 0x02, 0x00, "2 Coins 1 Play" }, - {0x17, 0x01, 0x02, 0x02, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x17, 0x01, 0x01, 0x01, "1 Coin 3 Plays" }, - {0x17, 0x01, 0x01, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x18, 0x01, 0x02, 0x02, "Upright" }, - {0x18, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x18, 0x01, 0x08, 0x00, "3" }, - {0x18, 0x01, 0x08, 0x08, "255" }, -}; - -STDDIPINFO(Mars) - -static struct BurnDIPInfo MimonkeyDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x03, NULL }, - {0x13, 0xff, 0xff, 0xae, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "6" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x13, 0x01, 0x06, 0x00, "3 Coins 1 Play" }, - {0x13, 0x01, 0x06, 0x04, "2 Coins 1 Play" }, - {0x13, 0x01, 0x06, 0x06, "1 Coin 1 Play" }, - {0x13, 0x01, 0x06, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x08, 0x08, "Upright" }, - {0x13, 0x01, 0x08, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Infinite Lives" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Mimonkey) - -static struct BurnDIPInfo MimonscoDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x01, NULL }, - {0x13, 0xff, 0xff, 0xae, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "1" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x01, "3" }, - {0x12, 0x01, 0x03, 0x00, "4" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x13, 0x01, 0x06, 0x00, "3 Coins 1 Play" }, - {0x13, 0x01, 0x06, 0x04, "2 Coins 1 Play" }, - {0x13, 0x01, 0x06, 0x06, "1 Coin 1 Play" }, - {0x13, 0x01, 0x06, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x08, 0x08, "Upright" }, - {0x13, 0x01, 0x08, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Infinite Lives" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Mimonsco) - -static struct BurnDIPInfo MinefldDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x02, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Starting Level" }, - {0x0e, 0x01, 0x02, 0x00, "1" }, - {0x0e, 0x01, 0x02, 0x02, "3" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0f, 0x01, 0x01, 0x00, "3" }, - {0x0f, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x02, 0x00, "Off" }, - {0x0f, 0x01, 0x02, 0x02, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x10, 0x01, 0x02, 0x00, "1 Coin 1 Play" }, - {0x10, 0x01, 0x02, 0x02, "A 1C/2P B 2C/1P" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0x0c, 0x00, "Easy" }, - {0x10, 0x01, 0x0c, 0x04, "Medium" }, - {0x10, 0x01, 0x0c, 0x08, "Hard" }, - {0x10, 0x01, 0x0c, 0x0c, "Hardest" }, -}; - -STDDIPINFO(Minefld) - -static struct BurnDIPInfo Moonal2DIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x01, "4000" }, - {0x0e, 0x01, 0x03, 0x02, "5000" }, - {0x0e, 0x01, 0x03, 0x03, "7000" }, - {0x0e, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "3" }, - {0x0e, 0x01, 0x04, 0x04, "5" }, -}; - -STDDIPINFO(Moonal2) - -static struct BurnDIPInfo MooncrgxDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0xc0, NULL }, - {0x0d, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0c, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x0c, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0c, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x0c, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0d, 0x01, 0x01, 0x01, "30000" }, - {0x0d, 0x01, 0x01, 0x00, "50000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x08, 0x00, "Upright" }, - {0x0d, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Mooncrgx) - -static struct BurnDIPInfo MooncrsaDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x80, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x20, 0x00, "Upright" }, - {0x0b, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0c, 0x01, 0x40, 0x00, "30000" }, - {0x0c, 0x01, 0x40, 0x40, "50000" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0c, 0x01, 0x80, 0x80, "English" }, - {0x0c, 0x01, 0x80, 0x00, "Japanese" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0x0c, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x0c, 0x04, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x0c, 0x08, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x0c, 0x0c, "Freeplay" }, -}; - -STDDIPINFO(Mooncrsa) - -static struct BurnDIPInfo MooncrsgDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x20, 0x00, "Upright" }, - {0x0b, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0c, 0x01, 0x40, 0x00, "30000" }, - {0x0c, 0x01, 0x40, 0x40, "50000" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x03, 0x03, "4 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x02, "3 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0x0c, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x0c, 0x04, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x0c, 0x08, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x0c, 0x0c, "Freeplay" }, -}; - -STDDIPINFO(Mooncrsg) - -static struct BurnDIPInfo MooncrstDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x80, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x20, 0x00, "Upright" }, - {0x0b, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0c, 0x01, 0x40, 0x00, "30000" }, - {0x0c, 0x01, 0x40, 0x40, "50000" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0c, 0x01, 0x80, 0x80, "English" }, - {0x0c, 0x01, 0x80, 0x00, "Japanese" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x03, 0x03, "4 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x02, "3 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0x0c, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x0c, 0x04, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x0c, 0x08, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x0c, 0x0c, "Freeplay" }, -}; - -STDDIPINFO(Mooncrst) - -static struct BurnDIPInfo MooncregDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0xc0, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x20, 0x00, "Upright" }, - {0x0b, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0c, 0x01, 0x40, 0x40, "Easy" }, - {0x0c, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Player's Bullet Speed" }, - {0x0c, 0x01, 0x80, 0x00, "Slow" }, - {0x0c, 0x01, 0x80, 0x80, "Fast" }, - - // Dip 3 - {0 , 0xfe, 0 , 13 , "Coinage" }, - {0x0d, 0x01, 0x0f, 0x00, "1C 1P, 1C 2P" }, - {0x0d, 0x01, 0x0f, 0x01, "2C 1P, 2C 3P" }, - {0x0d, 0x01, 0x0f, 0x02, "3C 1P, 3C 4P" }, - {0x0d, 0x01, 0x0f, 0x03, "4C 1P, 4C 5P" }, - {0x0d, 0x01, 0x0f, 0x04, "1C 1P, 1C 3P" }, - {0x0d, 0x01, 0x0f, 0x05, "2C 1P, 2C 5P" }, - {0x0d, 0x01, 0x0f, 0x06, "3C 1P, 3C 7P" }, - {0x0d, 0x01, 0x0f, 0x07, "4C 1P, 4C 9P" }, - {0x0d, 0x01, 0x0f, 0x08, "1C 1P, 1C 4P" }, - {0x0d, 0x01, 0x0f, 0x09, "2C 1P, 2C 7P" }, - {0x0d, 0x01, 0x0f, 0x0a, "3C 1P, 3C 10P" }, - {0x0d, 0x01, 0x0f, 0x0b, "4C 1P, 4C 13P" }, - {0x0d, 0x01, 0x0f, 0x0c, "Free Play" }, -}; - -STDDIPINFO(Mooncreg) - -static struct BurnDIPInfo MooncrslDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0xc0, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x20, 0x00, "Upright" }, - {0x0b, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0c, 0x01, 0x40, 0x40, "Easy" }, - {0x0c, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Player's Bullet Speed" }, - {0x0c, 0x01, 0x80, 0x00, "Slow" }, - {0x0c, 0x01, 0x80, 0x80, "Fast" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x03, 0x03, "4 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x02, "3 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0x0c, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x0c, 0x04, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x0c, 0x08, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x0c, 0x0c, "Freeplay" }, -}; - -STDDIPINFO(Mooncrsl) - -static struct BurnDIPInfo MoonqsrDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x20, 0x00, "Upright" }, - {0x0b, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x00, "Easy" }, - {0x0c, 0x01, 0xc0, 0x40, "Medium" }, - {0x0c, 0x01, 0xc0, 0x80, "Hard" }, - {0x0c, 0x01, 0xc0, 0xc0, "Hardest" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x03, 0x03, "4 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x02, "3 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0x0c, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x0c, 0x04, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x0c, 0x08, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x0c, 0x0c, "Freeplay" }, -}; - -STDDIPINFO(Moonqsr) - -static struct BurnDIPInfo MoonwarDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x03, NULL }, - {0x0f, 0xff, 0xff, 0x0c, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x03, 0x03, "3" }, - {0x0e, 0x01, 0x03, 0x02, "4" }, - {0x0e, 0x01, 0x03, 0x01, "5" }, - {0x0e, 0x01, 0x03, 0x00, "Free Play" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0f, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x0f, 0x01, 0x06, 0x06, "1 Coin 2 Plays" }, - {0x0f, 0x01, 0x06, 0x02, "1 Coin 3 Plays" }, - {0x0f, 0x01, 0x06, 0x00, "1 Coin 4 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x08, 0x08, "Upright" }, - {0x0f, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Moonwar) - -static struct BurnDIPInfo MoonwaraDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x03, NULL }, - {0x0f, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x03, 0x03, "3" }, - {0x0e, 0x01, 0x03, 0x02, "4" }, - {0x0e, 0x01, 0x03, 0x01, "5" }, - {0x0e, 0x01, 0x03, 0x00, "Free Play" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0f, 0x01, 0x06, 0x06, "1 Coin 1 Play" }, - {0x0f, 0x01, 0x06, 0x04, "1 Coin 2 Plays" }, - {0x0f, 0x01, 0x06, 0x02, "1 Coin 3 Plays" }, - {0x0f, 0x01, 0x06, 0x00, "1 Coin 4 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x08, 0x08, "Upright" }, - {0x0f, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Moonwara) - -static struct BurnDIPInfo MrkougarDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x03, NULL }, - {0x0e, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0d, 0x01, 0x02, 0x00, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x02, 0x02, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0d, 0x01, 0x01, 0x01, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x01, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x02, 0x02, "Upright" }, - {0x0e, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x04, "3" }, - {0x0e, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x08, 0x00, "Easy" }, - {0x0e, 0x01, 0x08, 0x08, "Hard" }, -}; - -STDDIPINFO(Mrkougar) - -static struct BurnDIPInfo MshuttleDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x80, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x40, 0x00, "Off" }, - {0x0e, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x80, 0x80, "Upright" }, - {0x0e, 0x01, 0x80, 0x00, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x03, 0x00, "3" }, - {0x0f, 0x01, 0x03, 0x01, "4" }, - {0x0f, 0x01, 0x03, 0x02, "5" }, - {0x0f, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0f, 0x01, 0x04, 0x00, "20000" }, - {0x0f, 0x01, 0x04, 0x04, "30000" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0e, 0x01, 0x18, 0x18, "3 Coins 1 Play" }, - {0x0e, 0x01, 0x18, 0x10, "3 Coins 1 Play" }, - {0x0e, 0x01, 0x18, 0x08, "2 Coins 1 Play" }, - {0x0e, 0x01, 0x18, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0e, 0x01, 0x60, 0x00, "1 Coin 1 Play" }, - {0x0e, 0x01, 0x60, 0x20, "1 Coin 2 Plays" }, - {0x0e, 0x01, 0x60, 0x40, "1 Coin 3 Plays" }, - {0x0e, 0x01, 0x60, 0x60, "1 Coin 4 Plays" }, -}; - -STDDIPINFO(Mshuttle) - -static struct BurnDIPInfo Newsin7DIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x0c, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x03, 0x00, "A 1C/1P B 2C/1P" }, - {0x10, 0x01, 0x03, 0x02, "A 1C/3P B 3C/1P" }, - {0x10, 0x01, 0x03, 0x01, "A 1C/2P B 1C/1P" }, - {0x10, 0x01, 0x03, 0x03, "A 1C/4P B 4C/1P" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x02, 0x00, "Upright" }, - {0x11, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x08, 0x08, "3" }, - {0x11, 0x01, 0x08, 0x00, "5" }, -}; - -STDDIPINFO(Newsin7) - -static struct BurnDIPInfo OmegabDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0xc0, NULL }, - {0x0d, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0c, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x0c, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0c, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x0c, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0d, 0x01, 0x01, 0x00, "10000" }, - {0x0d, 0x01, 0x01, 0x01, "20000" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0d, 0x01, 0x04, 0x00, "3" }, - {0x0d, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x08, 0x00, "Upright" }, - {0x0d, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Omegab) - -static struct BurnDIPInfo OrbitronDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x40, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x10, 0x01, 0x60, 0x00, "A 2C/1P B 1C/3P" }, - {0x10, 0x01, 0x60, 0x40, "A 1C/1P B 1C/6P" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x04, 0x04, "2" }, - {0x11, 0x01, 0x04, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x08, 0x00, "Upright" }, - {0x11, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Orbitron) - -static struct BurnDIPInfo Ozon1DIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x02, NULL }, - {0x0d, 0xff, 0xff, 0x06, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0c, 0x01, 0x03, 0x03, "3" }, - {0x0c, 0x01, 0x03, 0x02, "4" }, - {0x0c, 0x01, 0x03, 0x01, "5" }, - {0x0c, 0x01, 0x03, 0x00, "6" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0x06, 0x06, "A 1C/1P B 2C/1P" }, - {0x0d, 0x01, 0x06, 0x04, "A 1C/2P B 1C/1P" }, - {0x0d, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P" }, - {0x0d, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P" }, -}; - -STDDIPINFO(Ozon1) - -static struct BurnDIPInfo PacmanblDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0xc0, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0e, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x0e, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0e, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x0e, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0f, 0x01, 0x01, 0x00, "15000" }, - {0x0f, 0x01, 0x01, 0x01, "20000" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0f, 0x01, 0x02, 0x00, "Easy" }, - {0x0f, 0x01, 0x02, 0x02, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0f, 0x01, 0x04, 0x00, "3" }, - {0x0f, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x08, 0x00, "Upright" }, - {0x0f, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Pacmanbl) - -static struct BurnDIPInfo Phoenxp2DIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0xc0, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x10, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x10, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x10, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x11, 0x01, 0x02, 0x00, "Easy" }, - {0x11, 0x01, 0x02, 0x02, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x04, 0x00, "3" }, - {0x11, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x08, 0x00, "Upright" }, - {0x11, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Phoenxp2) - -static struct BurnDIPInfo PiscesDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0c, 0x01, 0x40, 0x00, "3" }, - {0x0c, 0x01, 0x40, 0x40, "4" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x80, 0x00, "Upright" }, - {0x0c, 0x01, 0x80, 0x80, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0d, 0x01, 0x01, 0x00, "10000" }, - {0x0d, 0x01, 0x01, 0x01, "20000" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0d, 0x01, 0x02, 0x02, "A 2C/1P B 1C/3P" }, - {0x0d, 0x01, 0x02, 0x00, "A 1C/1P B 1C/6P" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0d, 0x01, 0x04, 0x00, "Easy" }, - {0x0d, 0x01, 0x04, 0x04, "Hard" }, -}; - -STDDIPINFO(Pisces) - -static struct BurnDIPInfo PiscesbDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0c, 0x01, 0x40, 0x00, "3" }, - {0x0c, 0x01, 0x40, 0x40, "4" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x80, 0x00, "Upright" }, - {0x0c, 0x01, 0x80, 0x80, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0d, 0x01, 0x01, 0x00, "10000" }, - {0x0d, 0x01, 0x01, 0x01, "20000" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0d, 0x01, 0x02, 0x02, "A 2C/1P B 1C/2P 2C/5P" }, - {0x0d, 0x01, 0x02, 0x00, "A 1C/1P B 1C/5P" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0d, 0x01, 0x04, 0x00, "Easy" }, - {0x0d, 0x01, 0x04, 0x04, "Hard" }, -}; - -STDDIPINFO(Piscesb) - -static struct BurnDIPInfo PorterDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 -}; - -STDDIPINFO(Porter) - -static struct BurnDIPInfo RacknrolDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0x00, NULL }, - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 -}; - -STDDIPINFO(Racknrol) - -static struct BurnDIPInfo RedufoDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0xc0, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin A" }, - {0x0d, 0x01, 0x40, 0x00, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x40, 0x40, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Coin B" }, - {0x0d, 0x01, 0x80, 0x80, "1 Coin 3 Plays" }, - {0x0d, 0x01, 0x80, 0x00, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0e, 0x01, 0x01, 0x00, "7000" }, - {0x0e, 0x01, 0x01, 0x01, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "3" }, - {0x0e, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x08, 0x00, "Upright" }, - {0x0e, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Redufo) - -static struct BurnDIPInfo RedufobDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "A 2C/1P B 1C/3P" }, - {0x0d, 0x01, 0xc0, 0x00, "A 1C/1P B 1C/6P" }, - {0x0d, 0x01, 0xc0, 0x80, "A 1C/2P B 1C/12P" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x01, "4000" }, - {0x0e, 0x01, 0x03, 0x02, "5000" }, - {0x0e, 0x01, 0x03, 0x03, "7000" }, - {0x0e, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "3" }, - {0x0e, 0x01, 0x04, 0x04, "5" }, -}; - -STDDIPINFO(Redufob) - -static struct BurnDIPInfo RescueDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x02, NULL }, - {0x10, 0xff, 0xff, 0x0c, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Starting Level" }, - {0x0e, 0x01, 0x02, 0x00, "1" }, - {0x0e, 0x01, 0x02, 0x02, "3" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0f, 0x01, 0x01, 0x00, "3" }, - {0x0f, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x02, 0x00, "Off" }, - {0x0f, 0x01, 0x02, 0x02, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x10, 0x01, 0x06, 0x06, "A 1C/2P B 2C/1P" }, - {0x10, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P" }, - {0x10, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x10, 0x01, 0x08, 0x08, "Easy" }, - {0x10, 0x01, 0x08, 0x00, "Hard" }, -}; - -STDDIPINFO(Rescue) - -static struct BurnDIPInfo RockclimDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x40, NULL }, - {0x0e, 0xff, 0xff, 0xc0, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0e, 0x01, 0x40, 0x00, "30000" }, - {0x0e, 0x01, 0x40, 0x40, "50000" }, - - {0 , 0xfe, 0 , 2 , "Coin Slots" }, - {0x0e, 0x01, 0x80, 0x80, "1" }, - {0x0e, 0x01, 0x80, 0x00, "2" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x03, 0x00, "3" }, - {0x0f, 0x01, 0x03, 0x01, "4" }, - {0x0f, 0x01, 0x03, 0x02, "5" }, - {0x0f, 0x01, 0x03, 0x03, "6" }, - - // Dip 4 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x10, 0x01, 0x0f, 0x00, "9 Coins 1 Play" }, - {0x10, 0x01, 0x0f, 0x01, "8 Coins 1 Play" }, - {0x10, 0x01, 0x0f, 0x02, "7 Coins 1 Play" }, - {0x10, 0x01, 0x0f, 0x03, "6 Coins 1 Play" }, - {0x10, 0x01, 0x0f, 0x04, "5 Coins 1 Play" }, - {0x10, 0x01, 0x0f, 0x05, "4 Coins 1 Play" }, - {0x10, 0x01, 0x0f, 0x06, "3 Coins 1 Play" }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 1 Play" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Play" }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Plays" }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Plays" }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Plays" }, - {0x10, 0x01, 0x0f, 0x08, "1 Coin 8 Plays" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x10, 0x01, 0xf0, 0x00, "9 Coins 1 Play" }, - {0x10, 0x01, 0xf0, 0x10, "8 Coins 1 Play" }, - {0x10, 0x01, 0xf0, 0x20, "7 Coins 1 Play" }, - {0x10, 0x01, 0xf0, 0x30, "6 Coins 1 Play" }, - {0x10, 0x01, 0xf0, 0x40, "5 Coins 1 Play" }, - {0x10, 0x01, 0xf0, 0x50, "4 Coins 1 Play" }, - {0x10, 0x01, 0xf0, 0x60, "3 Coins 1 Play" }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 1 Play" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Play" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Plays" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Plays" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Plays" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Plays" }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Plays" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Plays" }, - {0x10, 0x01, 0xf0, 0x80, "1 Coin 8 Plays" }, -}; - -STDDIPINFO(Rockclim) - -static struct BurnDIPInfo ScobraDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x03, NULL }, - {0x14, 0xff, 0xff, 0x0c, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x13, 0x01, 0x02, 0x02, "3" }, - {0x13, 0x01, 0x02, 0x00, "4" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x14, 0x01, 0x06, 0x02, "2 Coins 1 Play" }, - {0x14, 0x01, 0x06, 0x00, "4 Coins 3 Plays" }, - {0x14, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x14, 0x01, 0x06, 0x06, "1 Coin 99 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x08, 0x08, "Upright" }, - {0x14, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Scobra) - -static struct BurnDIPInfo ScobrasDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x03, NULL }, - {0x14, 0xff, 0xff, 0x0c, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x13, 0x01, 0x02, 0x02, "3" }, - {0x13, 0x01, 0x02, 0x00, "5" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x14, 0x01, 0x06, 0x02, "2 Coins 1 Play" }, - {0x14, 0x01, 0x06, 0x00, "4 Coins 3 Plays" }, - {0x14, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x14, 0x01, 0x06, 0x06, "1 Coin 99 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x08, 0x08, "Upright" }, - {0x14, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Scobras) - -static struct BurnDIPInfo ScorpionDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x04, 0x00, "3" }, - {0x12, 0x01, 0x04, 0x01, "4" }, - {0x12, 0x01, 0x04, 0x02, "5" }, - {0x12, 0x01, 0x04, 0x03, "255" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x04, 0x04, "Upright" }, - {0x13, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x13, 0x01, 0x08, 0x00, "A 1C/1P B 1C/1P" }, - {0x13, 0x01, 0x08, 0x08, "A 1C/1P B 1C/3P" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0xa0, 0x00, "Normal" }, - {0x13, 0x01, 0xa0, 0x20, "Medium" }, - {0x13, 0x01, 0xa0, 0x80, "Hard" }, - {0x13, 0x01, 0xa0, 0xa0, "Very Hard" }, -}; - -STDDIPINFO(Scorpion) - -static struct BurnDIPInfo ScorpionmcDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x40, NULL }, - {0x11, 0xff, 0xff, 0x04, NULL }, - {0x12, 0xff, 0xff, 0x02, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0xc0, 0x00, "Easy" }, - {0x10, 0x01, 0xc0, 0x40, "Normal" }, - {0x10, 0x01, 0xc0, 0x80, "Hard" }, - {0x10, 0x01, 0xc0, 0xc0, "Hardest" }, - - // Dip 3 - {0 , 0xfe, 0 , 3 , "Lives" }, - {0x11, 0x01, 0x0c, 0x00, "2" }, - {0x11, 0x01, 0x0c, 0x04, "3" }, - {0x11, 0x01, 0x0c, 0x08, "4" }, - - // Dip 4 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x01, 0x00, "Upright" }, - {0x12, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x12, 0x01, 0x06, 0x00, "2 Coins 1 Play" }, - {0x12, 0x01, 0x06, 0x02, "1 Coin 1 Play" }, - {0x12, 0x01, 0x06, 0x04, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x06, 0x06, "1 Coin 3 Plays" }, -}; - -STDDIPINFO(Scorpionmc) - -static struct BurnDIPInfo AracnisDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x20, NULL }, - {0x0c, 0xff, 0xff, 0xf8, NULL }, - {0x0d, 0xff, 0xff, 0xfd, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0x03, 0x00, "2 Coins 1 Play" }, - {0x0d, 0x01, 0x03, 0x01, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0x03, 0x03, "1 Coin 3 Plays" }, - - // Dip 4 -}; - -STDDIPINFO(Aracnis) - -static struct BurnDIPInfo Scramb2DIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x03, NULL }, - {0x13, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "255" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x13, 0x01, 0x06, 0x06, "1 Coin 1 Play" }, - {0x13, 0x01, 0x06, 0x04, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x06, 0x02, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x06, 0x00, "1 Coin 4 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x08, 0x08, "Upright" }, - {0x13, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Scramb2) - -static struct BurnDIPInfo ScramblbDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x40, 0x00, "Upright" }, - {0x11, 0x01, 0x40, 0x40, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x12, 0x01, 0x03, 0x00, "1 Coin 1 Play" }, - {0x12, 0x01, 0x03, 0x01, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 3 Plays" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 4 Plays" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x00, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x08, "5" }, - {0x12, 0x01, 0x0c, 0x0c, "255" }, -}; - -STDDIPINFO(Scramblb) - -static struct BurnDIPInfo ScrambleDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x03, NULL }, - {0x14, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "255" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x14, 0x01, 0x06, 0x06, "A 1C/1P B 2C/1P C 1C/1P"}, - {0x14, 0x01, 0x06, 0x04, "A 1C/2P B 1C/1P C 1C/2P"}, - {0x14, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P C 1C/3P"}, - {0x14, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P C 1C/4P"}, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x08, 0x08, "Upright" }, - {0x14, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Scramble) - -static struct BurnDIPInfo ScramblerDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0xf8, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0xc0, 0x00, "A 1C/1P B 1C/6P" }, - {0x10, 0x01, 0xc0, 0x40, "A 2C/1P B 1C/3P" }, - {0x10, 0x01, 0xc0, 0x80, "A 1C/2P B 1C/6P" }, - {0x10, 0x01, 0xc0, 0xc0, "A 2C/2P B 1C/3P" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x00, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x03, "255" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x04, 0x00, "Upright" }, - {0x11, 0x01, 0x04, 0x04, "Cocktail" }, -}; - -STDDIPINFO(Scrambler) - -static struct BurnDIPInfo SfxDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x08, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x01, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x03, "5" }, - {0x13, 0x01, 0x03, 0x00, "Invulerability" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x14, 0x01, 0x06, 0x06, "3 Coins 1 Play" }, - {0x14, 0x01, 0x06, 0x04, "2 Coins 1 Play" }, - {0x14, 0x01, 0x06, 0x00, "1 Coin 1 Play" }, - {0x14, 0x01, 0x06, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x08, 0x08, "Upright" }, - {0x14, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Sfx) - -static struct BurnDIPInfo SkybaseDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 1 Play (2 to start)"}, - {0x0d, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xc0, 0x40, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "3" }, - {0x0e, 0x01, 0x03, 0x01, "4" }, - {0x0e, 0x01, 0x03, 0x02, "5" }, - {0x0e, 0x01, 0x03, 0x03, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x0c, 0x00, "10000" }, - {0x0e, 0x01, 0x0c, 0x40, "15000" }, - {0x0e, 0x01, 0x0c, 0x40, "20000" }, - {0x0e, 0x01, 0x0c, 0x40, "None" }, -}; - -STDDIPINFO(Skybase) - -static struct BurnDIPInfo SmooncrsDIPList[]= -{ - // Default Values - {0x08, 0xff, 0xff, 0x00, NULL }, - {0x09, 0xff, 0xff, 0xc0, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x08, 0x01, 0x20, 0x00, "Upright" }, - {0x08, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x09, 0x01, 0x40, 0x40, "Easy" }, - {0x09, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Players Bullet Speed" }, - {0x09, 0x01, 0x80, 0x00, "Slow" }, - {0x09, 0x01, 0x80, 0x80, "Fast" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x10, 0x01, 0x03, 0x03, "4 Coins 1 Play" }, - {0x10, 0x01, 0x03, 0x02, "3 Coins 1 Play" }, - {0x10, 0x01, 0x03, 0x01, "2 Coins 1 Play" }, - {0x10, 0x01, 0x03, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x10, 0x01, 0x0c, 0x00, "1 Coin 1 Play" }, - {0x10, 0x01, 0x0c, 0x04, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x0c, 0x08, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x0c, 0x0c, "Freeplay" }, -}; - -STDDIPINFO(Smooncrs) - -static struct BurnDIPInfo MooncptcDIPList[]= -{ - // Default Values - {0x08, 0xff, 0xff, 0x00, NULL }, - {0x09, 0xff, 0xff, 0xc0, NULL }, - {0x10, 0xff, 0xff, 0x03, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x08, 0x01, 0x20, 0x00, "Upright" }, - {0x08, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x09, 0x01, 0x40, 0x40, "Easy" }, - {0x09, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Players Bullet Speed" }, - {0x09, 0x01, 0x80, 0x00, "Slow" }, - {0x09, 0x01, 0x80, 0x80, "Fast" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x10, 0x01, 0x03, 0x00, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x03, 0x01, "2 Coins 3 Plays" }, - {0x10, 0x01, 0x03, 0x02, "3 Coins 4 Plays" }, - {0x10, 0x01, 0x03, 0x03, "4 Coins 5 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x10, 0x01, 0x0c, 0x00, "1 Coin 1 Play" }, - {0x10, 0x01, 0x0c, 0x04, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x0c, 0x08, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x0c, 0x0c, "Freeplay" }, -}; - -STDDIPINFO(Mooncptc) - -static struct BurnDIPInfo SpacbattDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "A 2C/1P B 1C/3P" }, - {0x0d, 0x01, 0xc0, 0x00, "A 1C/1P B 1C/6P" }, - {0x0d, 0x01, 0xc0, 0x80, "A 1C/2P B 1C/6P" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x01, "4000" }, - {0x0e, 0x01, 0x03, 0x02, "5000" }, - {0x0e, 0x01, 0x03, 0x03, "7000" }, - {0x0e, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "3" }, - {0x0e, 0x01, 0x04, 0x04, "5" }, -}; - -STDDIPINFO(Spacbatt) - -static struct BurnDIPInfo SpdcoinDIPList[]= -{ - // Default Values - {0x07, 0xff, 0xff, 0x00, NULL }, - {0x08, 0xff, 0xff, 0x03, NULL }, - {0x09, 0xff, 0xff, 0x06, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x08, 0x01, 0x01, 0x01, "Off" }, - {0x08, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x08, 0x01, 0x02, 0x02, "Off" }, - {0x08, 0x01, 0x02, 0x00, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x09, 0x01, 0x04, 0x04, "Easy" }, - {0x09, 0x01, 0x04, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x09, 0x01, 0x08, 0x00, "3" }, - {0x09, 0x01, 0x08, 0x08, "5" }, -}; - -STDDIPINFO(Spdcoin) - -static struct BurnDIPInfo StratgyxDIPList[] = -{ - // Default Values - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x03, NULL }, - {0x16, 0xff, 0xff, 0x08, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "255" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x16, 0x01, 0x08, 0x08, "Upright" }, - {0x16, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Stratgyx) - -static struct BurnDIPInfo StreakngDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x40, NULL }, - {0x0e, 0xff, 0xff, 0x06, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0d, 0x01, 0xc0, 0x40, "10000" }, - {0x0d, 0x01, 0xc0, 0x81, "15000" }, - {0x0d, 0x01, 0xc0, 0xc0, "20000" }, - {0x0d, 0x01, 0xc0, 0x00, "None" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x00, "2 Coins 1 Play" }, - {0x0e, 0x01, 0x03, 0x02, "1 Coin 1 Play" }, - {0x0e, 0x01, 0x03, 0x01, "1 Coin 2 Plays" }, - {0x0e, 0x01, 0x03, 0x03, "Freeplay" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x0c, "1" }, - {0x0e, 0x01, 0x0c, 0x08, "2" }, - {0x0e, 0x01, 0x0c, 0x04, "3" }, - {0x0e, 0x01, 0x0c, 0x00, "5" }, -}; - -STDDIPINFO(Streakng) - -static struct BurnDIPInfo StrfbombDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x03, NULL }, - {0x14, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "255" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x14, 0x01, 0x06, 0x06, "A 1C/2P B 4C/1P C 1C/2P"}, - {0x14, 0x01, 0x06, 0x04, "A 1C/3P B 2C/1P C 1C/3P"}, - {0x14, 0x01, 0x06, 0x02, "A 1C/4P B 3C/1P C 1C/4P"}, - {0x14, 0x01, 0x06, 0x00, "A 1C/5P B 1C/1P C 1C/5P"}, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x08, 0x08, "Upright" }, - {0x14, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Strfbomb) - -static struct BurnDIPInfo SuperbonDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x02, NULL }, - {0x0d, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0c, 0x01, 0x03, 0x02, "3" }, - {0x0c, 0x01, 0x03, 0x01, "5" }, - {0x0c, 0x01, 0x03, 0x00, "Free Play" }, - {0x0c, 0x01, 0x03, 0x03, "Invulnerability" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0x06, 0x04, "1 Coin 1 Play" }, - {0x0d, 0x01, 0x06, 0x06, "A 1C/2P B 2C/1P" }, - {0x0d, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P" }, - {0x0d, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P" }, -}; - -STDDIPINFO(Superbon) - -static struct BurnDIPInfo SupergDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x01, "4000" }, - {0x0e, 0x01, 0x03, 0x02, "5000" }, - {0x0e, 0x01, 0x03, 0x03, "7000" }, - {0x0e, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "3" }, - {0x0e, 0x01, 0x04, 0x04, "5" }, -}; - -STDDIPINFO(Superg) - -static struct BurnDIPInfo SwarmDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x00, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0d, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x0d, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x01, "10000" }, - {0x0e, 0x01, 0x03, 0x02, "20000" }, - {0x0e, 0x01, 0x03, 0x03, "40000" }, - {0x0e, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "3" }, - {0x0e, 0x01, 0x04, 0x04, "4" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x08, 0x00, "Easy" }, - {0x0e, 0x01, 0x08, 0x08, "Hard" }, -}; - -STDDIPINFO(Swarm) - -static struct BurnDIPInfo TazzmangDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x04, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, - {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x11, 0x01, 0x06, 0x00, "A 4C/1P B 1C/4P" }, - {0x11, 0x01, 0x06, 0x02, "A 3C/1P B 1C/3P" }, - {0x11, 0x01, 0x06, 0x06, "A 2C/1P B 1C/2P" }, - {0x11, 0x01, 0x06, 0x04, "A 1C/1P B 1C/1P" }, -}; - -STDDIPINFO(Tazzmang) - -static struct BurnDIPInfo TheendDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x03, NULL }, - {0x10, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x03, 0x03, "3" }, - {0x0f, 0x01, 0x03, 0x02, "4" }, - {0x0f, 0x01, 0x03, 0x01, "5" }, - {0x0f, 0x01, 0x03, 0x00, "256" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x06, 0x02, "3 Coins 1 Play" }, - {0x10, 0x01, 0x06, 0x04, "2 Coins 1 Play" }, - {0x10, 0x01, 0x06, 0x06, "1 Coin 1 Play" }, - {0x10, 0x01, 0x06, 0x00, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x08, 0x08, "Upright" }, - {0x10, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Theend) - -static struct BurnDIPInfo ThepitmDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0c, 0x01, 0x04, 0x00, "Off" }, - {0x0c, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x08, 0x00, "Upright" }, - {0x11, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Thepitm) - -static struct BurnDIPInfo TimefgtrDIPList[]= -{ - // Default Values - {0x09, 0xff, 0xff, 0x40, NULL }, - {0x0a, 0xff, 0xff, 0x00, NULL }, - {0x0b, 0xff, 0xff, 0x03, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "255 Lives" }, - {0x09, 0x01, 0x20, 0x00, "Off" }, - {0x09, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Extended Bonus Life" }, - {0x09, 0x01, 0x40, 0x00, "Off" }, - {0x09, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0a, 0x01, 0x40, 0x00, "1 Coin 1 Play" }, - {0x0a, 0x01, 0x40, 0x40, "2 Coins 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0a, 0x01, 0x80, 0x00, "3" }, - {0x0a, 0x01, 0x80, 0x80, "5" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0b, 0x01, 0x0c, 0x00, "10000 50000" }, - {0x0b, 0x01, 0x0c, 0x04, "20000 50000" }, - {0x0b, 0x01, 0x0c, 0x08, "10000 60000" }, - {0x0b, 0x01, 0x0c, 0x0c, "20000 60000" }, -}; - -STDDIPINFO(Timefgtr) - -static struct BurnDIPInfo TriplepDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x03, NULL }, - {0x12, 0xff, 0xff, 0xae, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - {0x11, 0x01, 0x03, 0x00, "256" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x12, 0x01, 0x06, 0x04, "A 1C/2P B 1C/1P C 1C/2C"}, - {0x12, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P C 1C/3C"}, - {0x12, 0x01, 0x06, 0x06, "A 1C/1P B 2C/1P C 1C/1C"}, - {0x12, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P C 1C/4C"}, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x08, 0x08, "Upright" }, - {0x12, 0x01, 0x08, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Rack Test" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Triplep) - -static struct BurnDIPInfo TurpinDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x03, NULL }, - {0x12, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x01, "7" }, - {0x11, 0x01, 0x03, 0x00, "126" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x12, 0x01, 0x06, 0x00, "4 Coins 1 Play" }, - {0x12, 0x01, 0x06, 0x04, "2 Coins 1 Play" }, - {0x12, 0x01, 0x06, 0x06, "1 Coin 1 Play" }, - {0x12, 0x01, 0x06, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x08, 0x08, "Upright" }, - {0x12, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Turpin) - -static struct BurnDIPInfo TurtlesDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x03, NULL }, - {0x12, 0xff, 0xff, 0x0e, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - {0x11, 0x01, 0x03, 0x00, "126" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x12, 0x01, 0x06, 0x06, "A 1C/1P B 2C/1P C 1C/1P"}, - {0x12, 0x01, 0x06, 0x04, "A 1C/2P B 1C/1P C 1C/2P"}, - {0x12, 0x01, 0x06, 0x02, "A 1C/3P B 3C/1P C 1C/3P"}, - {0x12, 0x01, 0x06, 0x00, "A 1C/4P B 4C/1P C 1C/4P"}, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x08, 0x08, "Upright" }, - {0x12, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Turtles) - -static struct BurnDIPInfo VpoolDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x20, NULL }, - {0x0d, 0xff, 0xff, 0xe0, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - - // Dip 3 -}; - -STDDIPINFO(Vpool) - -static struct BurnDIPInfo WarofbugDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x0a, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x20, 0x00, "Upright" }, - {0x0f, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 2 - {0 , 0xfe, 0 , 3 , "Coinage" }, - {0x10, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x10, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x10, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x00, "1" }, - {0x11, 0x01, 0x03, 0x01, "2" }, - {0x11, 0x01, 0x03, 0x02, "3" }, - {0x11, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x11, 0x01, 0x08, 0x08, "500000" }, - {0x11, 0x01, 0x08, 0x00, "700000" }, -}; - -STDDIPINFO(Warofbug) - -static struct BurnDIPInfo ZerotimeDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x00, NULL }, - {0x0d, 0xff, 0xff, 0x40, NULL }, - {0x0e, 0xff, 0xff, 0x03, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x20, 0x00, "Upright" }, - {0x0c, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0x40, "A 1C/1P 2C/3P B 1C/2P" }, - {0x0d, 0x01, 0xc0, 0xc0, "A 1C/1P 2C/3P B 1C/3P" }, - {0x0d, 0x01, 0xc0, 0x00, "A 1C/2P 2C/4P B 1C/4P" }, - {0x0d, 0x01, 0xc0, 0x80, "A 1C/2P 2C/5P B 1C/5P" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x03, 0x03, "6000" }, - {0x0e, 0x01, 0x03, 0x02, "7000" }, - {0x0e, 0x01, 0x03, 0x01, "9000" }, - {0x0e, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "3" }, - {0x0e, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x08, 0x00, "Easy" }, - {0x0e, 0x01, 0x08, 0x08, "Hard" }, -}; - -STDDIPINFO(Zerotime) - -static struct BurnDIPInfo ZigzagDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x02, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0f, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x0f, 0x01, 0xc0, 0xc0, "Freeplay" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x01, 0x00, "3" }, - {0x10, 0x01, 0x01, 0x01, "4" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x02, 0x02, "Upright" }, - {0x10, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x10, 0x01, 0x0c, 0x00, "10000 60000" }, - {0x10, 0x01, 0x0c, 0x04, "20000 60000" }, - {0x10, 0x01, 0x0c, 0x08, "30000 60000" }, - {0x10, 0x01, 0x0c, 0x0c, "40000 60000" }, -}; - -STDDIPINFO(Zigzag) - -// Drivers -// Basic Galaxian Hardware -static struct BurnRomInfo GalaxianRomDesc[] = { - { "galmidw.u", 0x00800, 0x745e2d61, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.v", 0x00800, 0x9c999a40, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.w", 0x00800, 0xb5894925, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.y", 0x00800, 0x6b3ca10b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7l", 0x00800, 0x1b933207, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "1h.bin", 0x00800, 0x39fb43a4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "1k.bin", 0x00800, 0x7e3f56a2, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxian) -STD_ROM_FN(Galaxian) - -static struct BurnRomInfo GalaxianaRomDesc[] = { - { "7f.bin", 0x01000, 0x4335b1de, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7j.bin", 0x01000, 0x4e6f66a1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7l.bin", 0x00800, 0x5341d75a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "1h.bin", 0x00800, 0x39fb43a4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "1k.bin", 0x00800, 0x7e3f56a2, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxiana) -STD_ROM_FN(Galaxiana) - -static struct BurnRomInfo GalaxianmRomDesc[] = { - { "galmidw.u", 0x00800, 0x745e2d61, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.v", 0x00800, 0x9c999a40, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.w", 0x00800, 0xb5894925, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.y", 0x00800, 0x6b3ca10b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.z", 0x00800, 0xcb24f797, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "galaxian.j1", 0x00800, 0x84decf98, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "galaxian.l1", 0x00800, 0xc31ada9e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxianm) -STD_ROM_FN(Galaxianm) - -static struct BurnRomInfo GalaxianmoRomDesc[] = { - { "galaxian.u", 0x00800, 0xfac42d34, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galaxian.v", 0x00800, 0xf58283e3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galaxian.w", 0x00800, 0x4c7031c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galaxian.y", 0x00800, 0x96a7ac94, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7l.bin", 0x00800, 0x5341d75a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "galaxian.j1", 0x00800, 0x84decf98, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "galaxian.l1", 0x00800, 0xc31ada9e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxianmo) -STD_ROM_FN(Galaxianmo) - -static struct BurnRomInfo GalaxiantRomDesc[] = { - { "gl-03.8g", 0x00800, 0xe8f3aa67, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gl-04.8f", 0x00800, 0xf58283e3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gl-05.8e", 0x00800, 0x4c7031c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gl-06.8d", 0x00800, 0x097d92a2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gl-07.8c", 0x00800, 0x5341d75a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "gl-02.1k", 0x00800, 0xd14f7510, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "gl-01.1j", 0x00800, 0x968b6016, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxiant) -STD_ROM_FN(Galaxiant) - -static struct BurnRomInfo GalaxianiRomDesc[] = { - { "cp-1.8g", 0x00800, 0xe8f3aa67, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cp-2.8f", 0x00800, 0xf58283e3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cp-3.8e", 0x00800, 0x4c7031c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cp-4.8d", 0x00800, 0x097d92a2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cp-5.8c", 0x00800, 0x5341d75a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "cp-7.1k", 0x00800, 0x287159b7, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "cp-6.1j", 0x00800, 0x6fb54cb1, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxiani) -STD_ROM_FN(Galaxiani) - -static struct BurnRomInfo DonightRomDesc[] = { - { "galmidw.u", 0x00800, 0x197493a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.v", 0x00800, 0xb8ee84cf, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.w", 0x00800, 0x76879d31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.y", 0x00800, 0xd6d5e47e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7l", 0x00800, 0x34913886, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "1h.bin", 0x00800, 0xf880af4b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "1k.bin", 0x00800, 0x40fd608a, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0x77f95861, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Donight) -STD_ROM_FN(Donight) - -struct BurnDriver BurnDrvGalaxian = { - "galaxian", NULL, NULL, NULL, "1979", - "Galaxian (Namco set 1)\0", NULL, "Namco", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxianRomInfo, GalaxianRomName, NULL, NULL, GalaxianInputInfo, GalaxianDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalaxiana = { - "galaxiana", "galaxian", NULL, NULL, "1979", - "Galaxian (Namco set 2)\0", NULL, "Namco", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxianaRomInfo, GalaxianaRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalaxianm = { - "galaxianm", "galaxian", NULL, NULL, "1979", - "Galaxian (Midway set 1)\0", NULL, "Namco (Midway license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxianmRomInfo, GalaxianmRomName, NULL, NULL, GalaxianInputInfo, GalaxianDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalaxianmo = { - "galaxianmo", "galaxian", NULL, NULL, "1979", - "Galaxian (Midway set 2)\0", NULL, "Namco (Midway license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxianmoRomInfo, GalaxianmoRomName, NULL, NULL, GalaxianInputInfo, GalaxianDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalaxiant = { - "galaxiant", "galaxian", NULL, NULL, "1979", - "Galaxian (Taito)\0", NULL, "Namco (Taito license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxiantRomInfo, GalaxiantRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalaxiani = { - "galaxiani", "galaxian", NULL, NULL, "1979", - "Galaxian (Irem)\0", NULL, "bootleg? (Irem)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxianiRomInfo, GalaxianiRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDonight = { - "donight", NULL, NULL, NULL, "2013", - "Mr.Do's Nightmare (hack by Krazy Ivan)\0", NULL, "Krazy Ivan", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, DonightRomInfo, DonightRomName, NULL, NULL, DonightInputInfo, DonightDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Galaxian Rip-Offs on basic Galaxian Hardware -static struct BurnRomInfo MoonalnRomDesc[] = { - { "galx.u", 0x00800, 0x79e4007d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "prg2.bin", 0x00800, 0x59580b30, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "prg3.bin", 0x00800, 0xb64e9d12, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "superg.y", 0x00800, 0x9463f753, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "prg5.bin", 0x00800, 0x8bb78987, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ca1.bin", 0x00800, 0x074271dd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ca2.bin", 0x00800, 0x84d90397, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Moonaln) -STD_ROM_FN(Moonaln) - -static struct BurnRomInfo SupergRomDesc[] = { - { "7f.bin", 0x01000, 0x4335b1de, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "superg.w", 0x00800, 0xddeabdae, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "superg.y", 0x00800, 0x9463f753, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "superg.z", 0x00800, 0xe6312e35, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "galmidw.1j", 0x00800, 0x84decf98, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "galmidw.1k", 0x00800, 0xc31ada9e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Superg) -STD_ROM_FN(Superg) - -static struct BurnRomInfo GalturboRomDesc[] = { - { "galturbo.u", 0x00800, 0xe8f3aa67, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galx.v", 0x00800, 0xbc16064e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "superg.w", 0x00800, 0xddeabdae, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galturbo.y", 0x00800, 0xa44f450f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galturbo.z", 0x00800, 0x3247f3d4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "galturbo.1h", 0x00800, 0xa713fd1a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "galturbo.1k", 0x00800, 0x28511790, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galturbo) -STD_ROM_FN(Galturbo) - -static struct BurnRomInfo GalapxRomDesc[] = { - { "galx.u", 0x00800, 0x79e4007d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galx.v", 0x00800, 0xbc16064e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galx.w", 0x00800, 0x72d2d3ee, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galx.y", 0x00800, 0xafe397f3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galx.z", 0x00800, 0x778c0d3c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "galx.1h", 0x00800, 0xe8810654, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "galx.1k", 0x00800, 0xcbe84a76, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galapx) -STD_ROM_FN(Galapx) - -static struct BurnRomInfo Galap1RomDesc[] = { - { "7f.bin", 0x01000, 0x4335b1de, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galaxian.w", 0x00800, 0x4c7031c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galx_1_4.rom", 0x00800, 0xe71e1d9e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galx_1_5.rom", 0x00800, 0x6e65a3b2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "galmidw.1j", 0x00800, 0x84decf98, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "galmidw.1k", 0x00800, 0xc31ada9e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galap1) -STD_ROM_FN(Galap1) - -static struct BurnRomInfo Galap4RomDesc[] = { - { "galnamco.u", 0x00800, 0xacfde501, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galnamco.v", 0x00800, 0x65cf3c77, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galnamco.w", 0x00800, 0x9eef9ae6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galnamco.y", 0x00800, 0x56a5ddd1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galnamco.z", 0x00800, 0xf4bc7262, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "galx_4c1.rom", 0x00800, 0xd5e88ab4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "galx_4c2.rom", 0x00800, 0xa57b83e4, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galap4) -STD_ROM_FN(Galap4) - -static struct BurnRomInfo SwarmRomDesc[] = { - { "swarm1.bin", 0x00800, 0x21eba3d0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "swarm2.bin", 0x00800, 0xf3a436cd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "swarm3.bin", 0x00800, 0x2915e38b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "swarm4.bin", 0x00800, 0x8bbbf486, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "swarm5.bin", 0x00800, 0xf1b1987e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "swarma.bin", 0x00800, 0xef8657bb, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "swarmb.bin", 0x00800, 0x60c4bd31, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Swarm) -STD_ROM_FN(Swarm) - -static struct BurnRomInfo AstriansRomDesc[] = { - { "astrians.7h", 0x00800, 0x21eba3d0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "astrians.7j", 0x00800, 0xf3a436cd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "astrians.7k", 0x00800, 0x2915e38b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "astrians.7l", 0x00800, 0x2db56b2f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "astrians.7m", 0x00800, 0x41075efb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "astrians.1h", 0x00800, 0x77c074b4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "astrians.1k", 0x00800, 0xc30fcc46, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Astrians) -STD_ROM_FN(Astrians) - -static struct BurnRomInfo ZerotimeRomDesc[] = { - { "zt-p01c.016", 0x00800, 0x90a2bc61, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zt-2.016", 0x00800, 0xa433067e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zt-3.016", 0x00800, 0xaaf038d4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zt-4.016", 0x00800, 0x786d690a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zt-5.016", 0x00800, 0xaf9260d7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ztc-2.016", 0x00800, 0x1b13ca05, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ztc-1.016", 0x00800, 0x5cd7df03, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Zerotime) -STD_ROM_FN(Zerotime) - -// Late-to-market bootleg with PCB mods to use a single program rom -// Datamat is the old name of Datasat, a technical service and distributor of arcade PCB's from the 80's and 90's. -// A lot of the bootleg PCB's around Spain have Datamat stickers on the roms. It was one of the most important PCB sellers/distributors in the country from the era. -// Datamat still operate today as Datasat http://datasat.info/ -static struct BurnRomInfo ZerotimedRomDesc[] = { - { "zerotime_datamat.bin", 0x04000, 0xbe60834b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ztc-2.016", 0x00800, 0x1b13ca05, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ztc-1.016", 0x00800, 0x5cd7df03, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Zerotimed) -STD_ROM_FN(Zerotimed) - -static struct BurnRomInfo StarfghtRomDesc[] = { - { "ja.1", 0x00400, 0xc6ab558b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb.2", 0x00400, 0x34b99fed, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jc.3", 0x00400, 0x30e28016, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jd.4", 0x00400, 0xde7e7770, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "je.5", 0x00400, 0xa916c919, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jf.6", 0x00400, 0x9175882b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jg.7", 0x00400, 0x707c0f02, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jh.8", 0x00400, 0x5dd26461, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ji.9", 0x00400, 0x6651fe93, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jj.10", 0x00400, 0x12c721b9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "k1.7a", 0x00800, 0x977e37cf, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k2.9a", 0x00800, 0x15e387ce, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.7f", 0x00020, 0x24652bc4, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Starfght) -STD_ROM_FN(Starfght) - -static struct BurnRomInfo GalaxbsfRomDesc[] = { - { "1.bn", 0x00400, 0xcc37b774, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.bn", 0x00400, 0xc6d21f03, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.bn", 0x00400, 0x30e28016, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.bn", 0x00400, 0xde7e7770, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.bn", 0x00400, 0xa916c919, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.bn", 0x00400, 0x9175882b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7.bn", 0x00400, 0x1237b9da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.bn", 0x00400, 0x78c53607, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "9.bn", 0x00400, 0x901894cc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "10.bn", 0x00400, 0x5876f695, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "11.bn", 0x00800, 0x39fb43a4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "12.bn", 0x00800, 0x7e3f56a2, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxbsf) -STD_ROM_FN(Galaxbsf) - -static struct BurnRomInfo GalaxianblRomDesc[] = { - { "gal00eg.ic4", 0x00400, 0x7c44510c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gal01eg.ic5", 0x00400, 0x2a426500, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gal02.ic6", 0x00400, 0x30e28016, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gal03.ic7", 0x00400, 0xde7e7770, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gal04.ic8", 0x00400, 0xa916c919, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gal05.ic9", 0x00400, 0x9175882b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gal06.ic10", 0x00400, 0x1237b9da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gal07eg.ic11", 0x00400, 0x16144658, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gal08.ic12", 0x00400, 0x901894cc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gal09.ic13", 0x00400, 0x5876f695, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "galaxian.1h", 0x00800, 0x39fb43a4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "galaxian.1k", 0x00800, 0x7e3f56a2, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxianbl) -STD_ROM_FN(Galaxianbl) - -static struct BurnRomInfo Kamakazi3RomDesc[] = { - { "f_r_a.bin", 0x00800, 0xe8f3aa67, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f_a.bin", 0x00800, 0xf58283e3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f_b.bin", 0x00800, 0xddeabdae, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f_r_c.bin", 0x00800, 0xc8530a88, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f_r_d.bin", 0x00800, 0xda2d77e0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "r_b.bin", 0x00800, 0x977e37cf, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "r_a.bin", 0x00800, 0xd0ba22c9, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Kamakazi3) -STD_ROM_FN(Kamakazi3) - -static struct BurnRomInfo SupergxRomDesc[] = { - { "sg1", 0x00800, 0xb83f4578, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sg2", 0x00800, 0xd12ca054, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sg3", 0x00800, 0x53714cb1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sg4", 0x00800, 0x2f36fc69, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sg5", 0x00800, 0x1e0ed4fd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sg6", 0x00800, 0x4f3d97a8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "sgg1", 0x00800, 0xa1287bf6, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sgg2", 0x00800, 0x528f1481, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "supergx.prm", 0x00020, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(Supergx) -STD_ROM_FN(Supergx) - -static struct BurnRomInfo TstgalxRomDesc[] = { - { "test.u", 0x00800, 0x0614cd7f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.v", 0x00800, 0x9c999a40, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.w", 0x00800, 0xb5894925, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "galmidw.y", 0x00800, 0x6b3ca10b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7l", 0x00800, 0x1b933207, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "1h.bin", 0x00800, 0x39fb43a4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "1k.bin", 0x00800, 0x7e3f56a2, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Tstgalx) -STD_ROM_FN(Tstgalx) - -static struct BurnRomInfo GalaxrfRomDesc[] = { - { "princip1.u", 0x00800, 0x3d5d9bae, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "princip2.v", 0x00800, 0xa433067e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "princip3.w", 0x00800, 0xaaf038d4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "princip4.y", 0x00800, 0xd74bdd2a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "princip5.z", 0x00800, 0x7eeb9e63, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "graphhj.j1", 0x00800, 0x39fb43a4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "graphkl.l1", 0x00800, 0x7e3f56a2, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxrf) -STD_ROM_FN(Galaxrf) - -static struct BurnRomInfo GalaxrfggRomDesc[] = { - { "gxrf.7f", 0x01000, 0xc06eeb10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gxrf.7j", 0x01000, 0x182ff334, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gxrf.7l", 0x00800, 0xee827e75, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "gxrf.1jh", 0x00800, 0x23e627ff, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "gxrf.1lk", 0x00800, 0x0dbcee5b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "gxrf.6l", 0x00020, 0x992350e5, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galaxrfgg) -STD_ROM_FN(Galaxrfgg) - -static INT32 SupergxInit() -{ - INT32 nRet; - - GalTilesSharedRomSize = 0x1000; - GalPromRomSize = 0x20; - - nRet = GalInit(); - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - nRet = BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x0800, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x1800, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - HardCodeGalaxianPROM(); - - return nRet; -} - -struct BurnDriver BurnDrvMoonaln = { - "moonaln", "galaxian", NULL, NULL, "1979", - "Moon Alien\0", NULL, "Nichibutsu (Karateco license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MoonalnRomInfo, MoonalnRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSuperg = { - "superg", "galaxian", NULL, NULL, "1979", - "Super Galaxians (galaxiaj hack)\0", NULL, "hack", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HACK | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SupergRomInfo, SupergRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalturbo = { - "galturbo", "galaxian", NULL, NULL, "1979", - "Galaxian Turbo (superg hack)\0", NULL, "hack", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HACK | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalturboRomInfo, GalturboRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalapx = { - "galapx", "galaxian", NULL, NULL, "1979", - "Galaxian Part X (moonaln hack)\0", NULL, "hack", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HACK | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalapxRomInfo, GalapxRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalap1 = { - "galap1", "galaxian", NULL, NULL, "1979", - "Space Invaders Galactica (galaxiaj hack)\0", NULL, "hack", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HACK | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Galap1RomInfo, Galap1RomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalap4 = { - "galap4", "galaxian", NULL, NULL, "1979", - "Galaxian Part 4 (hack)\0", NULL, "G.G.I", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HACK | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Galap4RomInfo, Galap4RomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSwarm = { - "swarm", "galaxian", NULL, NULL, "1979", - "Swarm (bootleg?)\0", NULL, "Sebelectro", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SwarmRomInfo, SwarmRomName, NULL, NULL, GalaxianInputInfo, SwarmDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAstrians = { - "astrians", "galaxian", NULL, NULL, "1979", - "Astrians (clone of Swarm)\0", NULL, "BGV Ltd", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, AstriansRomInfo, AstriansRomName, NULL, NULL, GalaxianInputInfo, SwarmDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvZerotime = { - "zerotime", "galaxian", NULL, NULL, "1979", - "Zero Time\0", NULL, "Petaco S.A", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, ZerotimeRomInfo, ZerotimeRomName, NULL, NULL, GalaxianInputInfo, ZerotimeDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvZerotimed = { - "zerotimed", "galaxian", NULL, NULL, "1979", - "Zero Time (Datamat)\0", NULL, "Datamat", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, ZerotimedRomInfo, ZerotimedRomName, NULL, NULL, GalaxianInputInfo, ZerotimeDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvStarfght = { - "starfght", "galaxian", NULL, NULL, "1979", - "Star Fighter\0", NULL, "Juetel", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, StarfghtRomInfo, StarfghtRomName, NULL, NULL, GalaxianInputInfo, SwarmDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalaxbsf = { - "galaxbsf", "galaxian", NULL, NULL, "1979", - "Galaxian (bootleg, set 1)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxbsfRomInfo, GalaxbsfRomName, NULL, NULL, GalaxianInputInfo, GalaxianDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalaxianbl = { - "galaxianbl", "galaxian", NULL, NULL, "1979", - "Galaxian (bootleg, set 2)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxianblRomInfo, GalaxianblRomName, NULL, NULL, GalaxianInputInfo, GalaxianblDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvKamakazi3 = { - "kamakazi3", "galaxian", NULL, NULL, "1979", - "Kamakazi III (superg hack)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Kamakazi3RomInfo, Kamakazi3RomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriverD BurnDrvSupergx = { - "supergx", "galaxian", NULL, NULL, "1980", - "Super GX\0", "Bad Dump", "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SupergxRomInfo, SupergxRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - SupergxInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTstgalx = { - "tst_galx", "galaxian", NULL, NULL, "1979", - "Galaxian Test ROM\0", NULL, "Test ROM", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_PROTOTYPE, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, TstgalxRomInfo, TstgalxRomName, NULL, NULL, GalaxianInputInfo, GalaxianDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalaxrf = { - "galaxrf", "galaxian", NULL, NULL, "1980", - "Galaxian (Recreativos Franco S.A. Spanish bootleg)\0", NULL, "bootleg (Recreativos Franco S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxrfRomInfo, GalaxrfRomName, NULL, NULL, GalaxianInputInfo, GalaxrfDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalaxrfgg = { - "galaxrfgg", "galaxian", NULL, NULL, "1980", - "Galaxian Growing Galaxip / Galaxian Nave Creciente (Recreativos Franco S.A. Spanish bootleg)\0", NULL, "bootleg (Recreativos Franco S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalaxrfggRomInfo, GalaxrfggRomName, NULL, NULL, GalaxianInputInfo, GalaxrfDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Other games on basic Galaxian hardware -static struct BurnRomInfo BlkholeRomDesc[] = { - { "bh1", 0x00800, 0x64998819, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bh2", 0x00800, 0x26f26ce4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bh3", 0x00800, 0x3418bc45, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bh4", 0x00800, 0x735ff481, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bh5", 0x00800, 0x3f657be9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bh6", 0x00800, 0xa057ab35, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "bh7", 0x00800, 0x975ba821, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "bh8", 0x00800, 0x03d11020, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Blkhole) -STD_ROM_FN(Blkhole) - -static struct BurnRomInfo OrbitronRomDesc[] = { - { "orbitron.3", 0x00800, 0x419f9c9b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "orbitron.4", 0x00800, 0x44ad56ac, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "orbitron.1", 0x00800, 0xda3f5168, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "orbitron.2", 0x00800, 0xa3b813fc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "orbitron.5", 0x00800, 0x20cd8bb8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "orbitron.6", 0x00800, 0x2c91b83f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "orbitron.7", 0x00800, 0x46f4cca4, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Orbitron) -STD_ROM_FN(Orbitron) - -static struct BurnRomInfo LuctodayRomDesc[] = { - { "ltprog1.bin", 0x00800, 0x59c389b9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ltprog2.bin", 0x00800, 0xac3893b1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ltchar2.bin", 0x00800, 0x8cd73bdc, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ltchar1.bin", 0x00800, 0xb5ba9946, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "74s288.ch", 0x00020, 0x24652bc4, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Luctoday) -STD_ROM_FN(Luctoday) - -static struct BurnRomInfo ChewingRomDesc[] = { - { "1.bin", 0x01000, 0x7470b347, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7l.bin", 0x00800, 0x78ebed36, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "2.bin", 0x00800, 0x88c605f3, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "3.bin", 0x00800, 0x77ac016a, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "74s288.ch", 0x00020, 0x24652bc4, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Chewing) -STD_ROM_FN(Chewing) - -static struct BurnRomInfo CatacombRomDesc[] = { - { "catacomb.u", 0x00800, 0x35cc28d2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "catacomb.v", 0x00800, 0x1d1ce133, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "catacomb.w", 0x00800, 0x479bbde7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "catacomb.y", 0x00800, 0x5e3da534, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "cat-gfx1", 0x00800, 0xe871e65c, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "cat-gfx2", 0x00800, 0xb14dafaa, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Catacomb) -STD_ROM_FN(Catacomb) - -static struct BurnRomInfo OmegabRomDesc[] = { - { "omega1.bin", 0x00800, 0xfc2a096b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "omega2.bin", 0x00800, 0xad100357, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "omega3.bin", 0x00800, 0xd7e3be79, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "omega4.bin", 0x00800, 0x42068171, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "omega5.bin", 0x00800, 0xd8a93383, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "omega6.bin", 0x00800, 0x32a42f44, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "omega1h.bin", 0x00800, 0x527fd384, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "omega1k.bin", 0x00800, 0x36de42c6, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331-1j.86", 0x00020, 0x6a0c7d87, BRF_OPT | BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Omegab) -STD_ROM_FN(Omegab) - -static struct BurnRomInfo WarofbugRomDesc[] = { - { "warofbug.u", 0x00800, 0xb8dfb7e3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "warofbug.v", 0x00800, 0xfd8854e0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "warofbug.w", 0x00800, 0x4495aa14, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "warofbug.y", 0x00800, 0xc14a541f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "warofbug.z", 0x00800, 0xc167fe55, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "warofbug.1k", 0x00800, 0x8100fa85, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "warofbug.1j", 0x00800, 0xd1220ae9, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "warofbug.clr", 0x00020, 0x8688e64b, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Warofbug) -STD_ROM_FN(Warofbug) - -static struct BurnRomInfo WarofbuggRomDesc[] = { - { "wotbg-u-1.bin", 0x00800, 0xf43ff0a8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "wotbg-v-2.bin", 0x00800, 0xeb7a028b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "wotbg-w-3.bin", 0x00800, 0x693e0e50, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "wotbg-y-4.bin", 0x00800, 0x885d4982, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "wotbg-z-5.bin", 0x00800, 0x60041ef2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "warofbug.1k", 0x00800, 0x8100fa85, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "warofbug.1j", 0x00800, 0xd1220ae9, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "warofbug.clr", 0x00020, 0x8688e64b, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Warofbugg) -STD_ROM_FN(Warofbugg) - -static struct BurnRomInfo WarofbuguRomDesc[] = { - { "wb-prog-1.7d", 0x00800, 0xb8dfb7e3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "wb-prog-2.7e", 0x00800, 0xfd8854e0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "wb-prog-3.7j", 0x00800, 0x4495aa14, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "wb-prog-4.7n", 0x00800, 0xe4bd257c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "wb-prog-5.7p", 0x00800, 0x71257bb4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "warofbug.1k", 0x00800, 0x8100fa85, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "warofbug.1j", 0x00800, 0xd1220ae9, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "warofbug.clr", 0x00020, 0x8688e64b, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Warofbugu) -STD_ROM_FN(Warofbugu) - -static struct BurnRomInfo RedufoRomDesc[] = { - { "redufo.1", 0x00800, 0x6a3b873c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "redufo.2", 0x00800, 0x202eda3b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "redufo.3", 0x00800, 0xbf7030e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "redufo.4", 0x00800, 0x8c1c2ef9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "redufo.5", 0x00800, 0xef965b24, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "redufo.6", 0x00800, 0x58b3e39b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "redufo.7", 0x00800, 0xfd07d811, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "redufo.8", 0x00800, 0xb34c7cb4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "redufo.9", 0x00800, 0x50a2d447, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "tbp18s030n.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Redufo) -STD_ROM_FN(Redufo) - -static struct BurnRomInfo RedufobRomDesc[] = { - { "ru1a", 0x00800, 0x5a8e4f37, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ru2a", 0x00800, 0xc624f52d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ru3a", 0x00800, 0xe1030d1c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ru4a", 0x00800, 0x7692069e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ru5a", 0x00800, 0xcb648ff3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ru6a", 0x00800, 0xe1a9f58e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ruhja", 0x00800, 0x8a422b0d, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rukla", 0x00800, 0x1eb84cb1, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Redufob) -STD_ROM_FN(Redufob) - -static struct BurnRomInfo ExodusRomDesc[] = { - { "exodus1.bin", 0x00800, 0x5dfe65e1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "exodus2.bin", 0x00800, 0x6559222f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "exodus3.bin", 0x00800, 0xbf7030e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "exodus4.bin", 0x00800, 0x3607909e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "exodus9.bin", 0x00800, 0x994a90c4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "exodus10.bin", 0x00800, 0xfbd11187, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "exodus11.bin", 0x00800, 0xfd07d811, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "exodus5.bin", 0x00800, 0xb34c7cb4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "exodus6.bin", 0x00800, 0x50a2d447, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Exodus) -STD_ROM_FN(Exodus) - -static struct BurnRomInfo TdpgalRomDesc[] = { - { "1.bin", 0x00800, 0x7be819fe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.bin", 0x00800, 0x70c83a5e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.bin", 0x00800, 0x475eb5a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.bin", 0x00800, 0x20a71943, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.bin", 0x00800, 0x72c4f2dc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.bin", 0x00800, 0xfa4e2be4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "8.bin", 0x00800, 0xd701b1d4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "7.bin", 0x00800, 0x3113bcfd, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "bprom.bin", 0x00020, 0x2b4cf53f, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Tdpgal) -STD_ROM_FN(Tdpgal) - -static struct BurnRomInfo AzurianRomDesc[] = { - { "pgm.1", 0x01000, 0x17a0fca7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pgm.2", 0x01000, 0x14659848, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pgm.3", 0x01000, 0x8f60fb97, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "gfx.1", 0x00800, 0xf5afb803, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "gfx.2", 0x00800, 0xae96e5d1, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Azurian) -STD_ROM_FN(Azurian) - -static struct BurnRomInfo TazzmangRomDesc[] = { - { "tazzm1.4k", 0x01000, 0xa14480a1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazzm2.5j", 0x01000, 0x5609f5db, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazzm3.6f", 0x01000, 0xfe7f7002, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazzm4.7e", 0x01000, 0xc9ca1d0a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazzm5.7l", 0x01000, 0xf50cd8a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazzm6.7l", 0x01000, 0x5cf2e7d2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "tazm8.1lk", 0x00800, 0x2c5b612b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tazzm7.1jh", 0x00800, 0x3f5ff3ac, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Tazzmang) -STD_ROM_FN(Tazzmang) - -static struct BurnRomInfo Tazzmang2RomDesc[] = { - { "tazmania.1", 0x00800, 0x6ecc84a2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazmania.2", 0x00800, 0xe27b09f6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazmania.3", 0x00800, 0x954868f3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazmania.4", 0x00800, 0x238520e6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazmania.5", 0x00800, 0x0527e513, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazmania.6", 0x00800, 0xaf2b92d8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazmania.7", 0x00800, 0xbbdc41d3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazmania.8", 0x00800, 0xeb35f49c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazmania.a", 0x01000, 0x38f326f8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tazmania.b", 0x01000, 0x2a22a9dc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "tazm8.1lk", 0x00800, 0x2c5b612b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tazzm7.1jh", 0x00800, 0x3f5ff3ac, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Tazzmang2) -STD_ROM_FN(Tazzmang2) - -static struct BurnRomInfo ScramblbRomDesc[] = { - { "scramble.1k", 0x00800, 0x9e025c4a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scramble.2k", 0x00800, 0x306f783e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scramble.3k", 0x00800, 0x0500b701, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scramble.4k", 0x00800, 0xdd380a22, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scramble.5k", 0x00800, 0xdf0b9648, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scramble.1j", 0x00800, 0xb8c07b3c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scramble.2j", 0x00800, 0x88ac07a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scramble.3j", 0x00800, 0xc67d57ca, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5f.k", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h.k", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scramblb) -STD_ROM_FN(Scramblb) - -static struct BurnRomInfo Scramb2RomDesc[] = { - { "r1.7f1", 0x00800, 0x4a43148c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "r1.7f2", 0x00800, 0x215a3b86, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "r2.7h1", 0x00800, 0x28779444, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "r2.7h2", 0x00800, 0x5b4b300b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "r3.7k1", 0x00800, 0xb478aa53, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "r3.7k2", 0x00800, 0xc33f072e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "r4.7l1", 0x00800, 0x88ac07a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "r4.7l2", 0x00800, 0x321fd003, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "r6.1j", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "r5.1l", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scramb2) -STD_ROM_FN(Scramb2) - -static struct BurnRomInfo ScramblerRomDesc[] = { - { "principal 1.bin", 0x00800, 0x926958d2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "principal 2.bin", 0x00800, 0x655c6eca, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "principal 3.bin", 0x00800, 0xcd31749a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "principal 4.bin", 0x00800, 0xf055e1e3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "principal 5.bin", 0x00800, 0x15f10df7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "principal 6.bin", 0x00800, 0x4bd1c703, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "principal 7.bin", 0x00800, 0x0bb49470, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "principal 8.bin", 0x00800, 0x6db9f380, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "graph hj.bin", 0x00800, 0x4c017c9c, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "graph kl.bin", 0x00800, 0x28a66399, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scrambler) -STD_ROM_FN(Scrambler) - -UINT8 __fastcall AzurianZ80Read(UINT16 a) -{ - switch (a) { - case 0x6000: { - return GalInput[0] | GalDip[0]; - } - - case 0x6800: { - return ((GalInput[1] | GalDip[1]) & ~0x40) | ((GalFakeDip & 0x01) << 6); - } - - case 0x7000: { - return ((GalInput[2] | GalDip[2]) & ~0x04) | ((GalFakeDip & 0x02) << 1); - } - - case 0x7800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -UINT8 __fastcall TazzmangZ80Read(UINT16 a) -{ - switch (a) { - case 0x9800: - case 0xb800: { - // watchdog read - return 0xff; - } - - case 0xa000: - case 0xa7ff: { - return GalInput[0] | GalDip[0]; - } - - case 0xa800: { - return GalInput[1] | GalDip[1]; - } - - case 0x7000: - case 0xb000: { - return GalInput[2] | GalDip[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall TazzmangZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x8800 && a <= 0x88ff) { - INT32 Offset = a - 0x8800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: - case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb001: { - GalIrqFire = d & 1; - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall ScramblbZ80Read(UINT16 a) -{ - switch (a) { - case 0x6000: { - return GalInput[0] | GalDip[0]; - } - - case 0x6800: { - return GalInput[1] | GalDip[1]; - } - - case 0x7000: { - return GalInput[2] | GalDip[2]; - } - - case 0x7800: { - // watchdog read - return 0xff; - } - - case 0x8102: { - switch (ZetGetPC(-1)) { - case 0x1da: return 0x80; - case 0x1e4: return 0x00; - } - return 0xff; - } - - case 0x8202: { - switch (ZetGetPC(-1)) { - case 0x1ca: return 0x90; - } - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall ScramblbZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: - case 0x6001: { - // start_lamp_w - return; - } - - case 0x6002: { - // coin_lock_w - return; - } - - case 0x6004: - case 0x6005: - case 0x6006: - case 0x6007: { - GalaxianLfoFreqWrite(a - 0x6004, d); - return; - } - - case 0x6800: - case 0x6801: - case 0x6802: - case 0x6803: - case 0x6804: - case 0x6805: - case 0x6806: - case 0x6807: { - GalaxianSoundWrite(a - 0x6800, d); - return; - } - - case 0x7001: { - GalIrqFire = d & 1; - return; - } - - case 0x7002: { - // coin_count_0_w - return; - } - - case 0x7003: { - GalBackgroundEnable = d & 1; - return; - } - - case 0x7004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x7006: { - GalFlipScreenX = d & 1; - return; - } - - case 0x7007: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Scramb2Z80Read(UINT16 a) -{ - if (a >= 0x5800 && a <= 0x5fff) return 0x25; - - switch (a) { - case 0x6000: - case 0x6001: - case 0x6002: - case 0x6003: - case 0x6004: - case 0x6005: - case 0x6006: - case 0x6007: { - int Offset = a - 0x6000; - return ((0xff - GalInput[0] - GalDip[0]) >> Offset) & 0x01; - } - - case 0x6800: - case 0x6801: - case 0x6802: - case 0x6803: - case 0x6804: - case 0x6805: - case 0x6806: - case 0x6807: { - int Offset = a - 0x6800; - return ((0xff - GalInput[1] - GalDip[1]) >> Offset) & 0x01; - } - - case 0x7000: { - // watchdog read - return 0xff; - } - - case 0x7800: - case 0x7801: - case 0x7802: - case 0x7803: - case 0x7804: - case 0x7805: - case 0x7806: - case 0x7807: { - INT32 Offset = a - 0x7800; - return ((0xff - GalInput[2] - GalDip[2]) >> Offset) & 0x01; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall Scramb2Z80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: - case 0x6001: - case 0x6002: - case 0x6003: - case 0x6004: - case 0x6005: - case 0x6006: - case 0x6007: - case 0x7000: - case 0x7001: - case 0x7002: - case 0x7003: - case 0x7004: - case 0x7005: - case 0x7006: - case 0x7007: { - // Probably PPI writes that the bootleggers didn't use - return; - } - - case 0x6801: { - GalIrqFire = d & 1; - return; - } - - case 0x6802: { - // coin_count_0_w - return; - } - - case 0x6803: { - GalBackgroundEnable = d & 1; - return; - } - - case 0x6804: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x6806: { - GalFlipScreenX = d & 1; - return; - } - - case 0x6807: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall ScramblerZ80Read(UINT16 a) -{ - switch (a) { - case 0x6000: { - return GalInput[0] | GalDip[0]; - } - - case 0x6800: { - return GalInput[1] | GalDip[1]; - } - - case 0x7000: { - return GalInput[2] | GalDip[2]; - } - - case 0x7800: { - // watchdog read - return 0xff; - } - - case 0x8202: { - // protection - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall ScramblerZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5400 && a <= 0x57ff) { - // ??? - return; - } - - if (a >= 0x5800 && a <= 0x58ff) { - INT32 Offset = a - 0x5800; - - GalSpriteRam[Offset] = d; - - if (Offset >= 0x80 && Offset < 0xc0) { - if ((Offset & 0x01) == 0) { - GalScrollVals[(Offset - 0x80) >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: - case 0x6001: { - // start_lamp_w - return; - } - - case 0x6003: { - // coin_lock_w - return; - } - - case 0x6004: - case 0x6005: - case 0x6006: - case 0x6007: { - GalaxianLfoFreqWrite(a - 0x6004, d); - return; - } - - case 0x6800: - case 0x6801: - case 0x6802: - case 0x6803: - case 0x6804: - case 0x6805: - case 0x6806: - case 0x6807: { - GalaxianSoundWrite(a - 0x6800, d); - return; - } - - case 0x7000: { - GalIrqFire = d & 1; - return; - } - - case 0x7002: { - // coin_count_0_w - return; - } - - case 0x7003: { - GalBackgroundEnable = d & 1; - return; - } - - case 0x7004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x7006: { - GalFlipScreenX = d & 1; - return; - } - - case 0x7007: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - GalPitch = d; - return; - } - - case 0x8200: { - // ??? - return; - } - - case 0x8201: { - // ??? - return; - } - - case 0x8202: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static void OrbitronRearrangeRom() -{ - GalTempRom = (UINT8*)BurnMalloc(0x2000); - - memcpy(GalTempRom, GalZ80Rom1, 0x2000); - memcpy(GalZ80Rom1 + 0x0600, GalTempRom + 0x0000, 0x200); - memcpy(GalZ80Rom1 + 0x0400, GalTempRom + 0x0200, 0x200); - memcpy(GalZ80Rom1 + 0x0200, GalTempRom + 0x0400, 0x200); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0600, 0x200); - memcpy(GalZ80Rom1 + 0x0e00, GalTempRom + 0x0800, 0x200); - memcpy(GalZ80Rom1 + 0x0c00, GalTempRom + 0x0a00, 0x200); - memcpy(GalZ80Rom1 + 0x0a00, GalTempRom + 0x0c00, 0x200); - memcpy(GalZ80Rom1 + 0x0800, GalTempRom + 0x0e00, 0x200); - memcpy(GalZ80Rom1 + 0x1600, GalTempRom + 0x1000, 0x200); - memcpy(GalZ80Rom1 + 0x1400, GalTempRom + 0x1200, 0x200); - memcpy(GalZ80Rom1 + 0x1200, GalTempRom + 0x1400, 0x200); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x1600, 0x200); - memcpy(GalZ80Rom1 + 0x1e00, GalTempRom + 0x1800, 0x200); - memcpy(GalZ80Rom1 + 0x1c00, GalTempRom + 0x1a00, 0x200); - memcpy(GalZ80Rom1 + 0x1a00, GalTempRom + 0x1c00, 0x200); - memcpy(GalZ80Rom1 + 0x1800, GalTempRom + 0x1e00, 0x200); - BurnFree(GalTempRom); -} - -static INT32 OrbitronInit() -{ - GalPostLoadCallbackFunction = OrbitronRearrangeRom; - - return GalInit(); -} - -static void LuctodayRearrangeRom() -{ - memcpy(GalZ80Rom1 + 0x2000, GalZ80Rom1 + 0x0800, 0x800); - memset(GalZ80Rom1 + 0x0800, 0, 0x800); -} - -static INT32 LuctodayInit() -{ - GalZ80Rom1Size = 0x1800; - GalPostLoadCallbackFunction = LuctodayRearrangeRom; - - return GalInit(); -} - -static void ChewingRearrangeRom() -{ - memcpy(GalZ80Rom1 + 0x2000, GalZ80Rom1 + 0x1000, 0x800); - memset(GalZ80Rom1 + 0x1000, 0, 0x800); -} - -static INT32 ChewingInit() -{ - GalZ80Rom1Size = 0x1000; - GalPostLoadCallbackFunction = ChewingRearrangeRom; - - return GalInit(); -} - -static void CatacombRearrangeRom() -{ - memcpy(GalZ80Rom1 + 0x2000, GalZ80Rom1 + 0x1800, 0x800); - memset(GalZ80Rom1 + 0x1800, 0, 0x800); -} - -static INT32 CatacombInit() -{ - GalZ80Rom1Size = 0x800; - GalPostLoadCallbackFunction = CatacombRearrangeRom; - - return GalInit(); -} - -static void TdpgalPostLoad() -{ - ZetOpen(0); - ZetMapArea(0x4800, 0x4bff, 0, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 1, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 2, GalVideoRam); - ZetClose(); -} - -static INT32 TdpgalInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = TdpgalPostLoad; - - nRet = GalInit(); - - return nRet; -} - -static void AzurianPostLoad() -{ - ZetOpen(0); - ZetSetReadHandler(AzurianZ80Read); - ZetClose(); -} - -static INT32 AzurianInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = AzurianPostLoad; - - nRet = GalInit(); - - GalDrawBulletsFunction = ScrambleDrawBullets; - - return nRet; -} - -static void TazzmangPostLoad() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(TazzmangZ80Read); - ZetSetWriteHandler(TazzmangZ80Write); - ZetMapArea(0x0000, 0x5fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x5fff, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetMapArea(0x8800, 0x88ff, 0, GalSpriteRam); - ZetMapArea(0x8800, 0x88ff, 2, GalSpriteRam); - ZetMapArea(0x9000, 0x93ff, 0, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 1, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 2, GalVideoRam); - ZetClose(); -} - -static INT32 TazzmangInit() -{ - GalPostLoadCallbackFunction = TazzmangPostLoad; - - return GalInit(); -} - -static void MapScramblb() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(ScramblbZ80Read); - ZetSetWriteHandler(ScramblbZ80Write); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 2, GalZ80Ram1); - ZetMapArea(0x4800, 0x4bff, 0, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 1, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 2, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 0, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 1, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 2, GalVideoRam); - ZetMapArea(0x5000, 0x50ff, 0, GalSpriteRam); - ZetMapArea(0x5000, 0x50ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 ScramblbInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScramblb; - - nRet = GalInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - return nRet; -} - -static void Scramb2PostLoad() -{ - MapScramblb(); - - ZetOpen(0); - ZetSetReadHandler(Scramb2Z80Read); - ZetSetWriteHandler(Scramb2Z80Write); - ZetClose(); -} - -static INT32 Scramb2Init() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = Scramb2PostLoad; - - nRet = GalInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - return nRet; -} - -static void MapScrambler() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(ScramblerZ80Read); - ZetSetWriteHandler(ScramblerZ80Write); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 2, GalZ80Ram1); -// ZetMapArea(0x4800, 0x4bff, 0, GalZ80Ram1 + 0x800); -// ZetMapArea(0x4800, 0x4bff, 1, GalZ80Ram1 + 0x800); -// ZetMapArea(0x4800, 0x4bff, 2, GalZ80Ram1 + 0x800); - ZetMapArea(0x5000, 0x53ff, 0, GalVideoRam); - ZetMapArea(0x5000, 0x53ff, 1, GalVideoRam); - ZetMapArea(0x5000, 0x53ff, 2, GalVideoRam); - ZetMapArea(0x5400, 0x57ff, 0, GalVideoRam); - ZetMapArea(0x5400, 0x57ff, 1, GalVideoRam); - ZetMapArea(0x5400, 0x57ff, 2, GalVideoRam); - ZetMapArea(0x5800, 0x58ff, 0, GalSpriteRam); - ZetMapArea(0x5800, 0x58ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 ScramblerInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScrambler; - - nRet = GalInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalRenderFrameFunction = ScramblerRenderFrame; - - return nRet; -} - -struct BurnDriver BurnDrvBlkhole = { - "blkhole", NULL, NULL, NULL, "1981", - "Black Hole\0", NULL, "TDS", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, BlkholeRomInfo, BlkholeRomName, NULL, NULL, BlkholeInputInfo, BlkholeDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvOrbitron = { - "orbitron", NULL, NULL, NULL, "19??", - "Orbitron\0", NULL, "Signatron USA", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SHOOT, 0, - NULL, OrbitronRomInfo, OrbitronRomName, NULL, NULL, OrbitronInputInfo, OrbitronDIPInfo, - OrbitronInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvLuctoday = { - "luctoday", NULL, NULL, NULL, "1980", - "Lucky Today\0", "Bad colours", "Sigma", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_GALAXIAN, GBF_CASINO, 0, - NULL, LuctodayRomInfo, LuctodayRomName, NULL, NULL, LuctodayInputInfo, LuctodayDIPInfo, - LuctodayInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvChewing = { - "chewing", "luctoday", NULL, NULL, "1980", - "Chewing Gum\0", NULL, "unknown", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_CASINO, 0, - NULL, ChewingRomInfo, ChewingRomName, NULL, NULL, LuctodayInputInfo, LuctodayDIPInfo, - ChewingInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCatacomb = { - "catacomb", NULL, NULL, NULL, "1982", - "Catacomb\0", "Bad Colours", "MTM Games", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, CatacombRomInfo, CatacombRomName, NULL, NULL, OmegabInputInfo, CatacombDIPInfo, - CatacombInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvOmegab = { - "omegab", "theend", NULL, NULL, "19??", - "Omega\0", NULL, "bootleg?", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, OmegabRomInfo, OmegabRomName, NULL, NULL, OmegabInputInfo, OmegabDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvWarofbug = { - "warofbug", NULL, NULL, NULL, "1981", - "War of the Bugs or Monsterous Manouvers in a Mushroom Maze\0", NULL, "Armenia", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, WarofbugRomInfo, WarofbugRomName, NULL, NULL, WarofbugInputInfo, WarofbugDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriverD BurnDrvWarofbugg = { - "warofbugg", "warofbug", NULL, NULL, "1981", - "War of the Bugs or Monsterous Manouvers in a Mushroom Maze (German)\0", NULL, "Armenia", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, WarofbuggRomInfo, WarofbuggRomName, NULL, NULL, WarofbugInputInfo, WarofbugDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvWarofbugu = { - "warofbugu", "warofbug", NULL, NULL, "1981", - "War of the Bugs or Monsterous Manouvers in a Mushroom Maze (US)\0", NULL, "Armenia", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, WarofbuguRomInfo, WarofbuguRomName, NULL, NULL, WarofbugInputInfo, WarofbugDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvRedufo = { - "redufo", NULL, NULL, NULL, "1981", - "Defend the Terra Attack on the Red UFO\0", NULL, "Artic", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, RedufoRomInfo, RedufoRomName, NULL, NULL, GalaxianInputInfo, RedufoDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvRedufob = { - "redufob", "redufo", NULL, NULL, "1981", - "Defend the Terra Attack on the Red UFO (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, RedufobRomInfo, RedufobRomName, NULL, NULL, GalaxianInputInfo, RedufobDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvExodus = { - "exodus", "redufo", NULL, NULL, "19??", - "Exodus (bootleg?)\0", NULL, "Subelectro", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, ExodusRomInfo, ExodusRomName, NULL, NULL, OmegabInputInfo, ExodusDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTdpgal = { - "tdpgal", NULL, NULL, NULL, "1983", - "Triple Draw Poker\0", NULL, "Design Labs / Thomas Automatics", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_CASINO, 0, - NULL, TdpgalRomInfo, TdpgalRomName, NULL, NULL, TdpgalInputInfo, NULL, - TdpgalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAzurian = { - "azurian", NULL, NULL, NULL, "1982", - "Azurian Attack\0", NULL, "Rait Electronics Ltd", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SHOOT, 0, - NULL, AzurianRomInfo, AzurianRomName, NULL, NULL, AzurianInputInfo, AzurianDIPInfo, - AzurianInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTazzmang = { - "tazzmang", "tazmania", NULL, NULL, "1982", - "Tazz-Mania (bootleg on Galaxian hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, TazzmangRomInfo, TazzmangRomName, NULL, NULL, TazzmangInputInfo, TazzmangDIPInfo, - TazzmangInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTazzmang2 = { - "tazzmang2", "tazmania", NULL, NULL, "1982", - "Tazz-Mania (bootleg on Galaxian hardware with Starfield)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, Tazzmang2RomInfo, Tazzmang2RomName, NULL, NULL, TazzmangInputInfo, TazzmangDIPInfo, - TazzmangInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScramblb = { - "scramblb", "scramble", NULL, NULL, "1981", - "Scramble (bootleg on Galaxian hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScramblbRomInfo, ScramblbRomName, NULL, NULL, ScramblbInputInfo, ScramblbDIPInfo, - ScramblbInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScramb2 = { - "scramb2", "scramble", NULL, NULL, "1981", - "Scramble (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, Scramb2RomInfo, Scramb2RomName, NULL, NULL, Scramb2InputInfo, Scramb2DIPInfo, - Scramb2Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScrambler = { - "scrambler", "scramble", NULL, NULL, "1981", - "Scramble (Reben S.A. Spanish bootleg)\0", NULL, "bootleg (Reben S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScramblerRomInfo, ScramblerRomName, NULL, NULL, ScramblerInputInfo, ScramblerDIPInfo, - ScramblerInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Extra chars controlled via bank at 0x6002 -static struct BurnRomInfo PiscesRomDesc[] = { - { "p1.bin", 0x00800, 0x40c5b0e4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p2.bin", 0x00800, 0x055f9762, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p3.bin", 0x00800, 0x3073dd04, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p4.bin", 0x00800, 0x44aaf525, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p5.bin", 0x00800, 0xfade512b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p6.bin", 0x00800, 0x5ab2822f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "g09.bin", 0x00800, 0x9503a23a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g11.bin", 0x00800, 0x0adfc3fe, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g10.bin", 0x00800, 0x3e61f849, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g12.bin", 0x00800, 0x7130e9eb, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "colour.bin", 0x00020, 0x57a45057, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Pisces) -STD_ROM_FN(Pisces) - -static struct BurnRomInfo PiscesbRomDesc[] = { - { "pisces.a1", 0x00800, 0x856b8e1f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p2.bin", 0x00800, 0x055f9762, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pisces.b2", 0x00800, 0x5540f2e4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p4.bin", 0x00800, 0x44aaf525, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p5.bin", 0x00800, 0xfade512b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p6.bin", 0x00800, 0x5ab2822f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "g09.bin", 0x00800, 0x9503a23a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g11.bin", 0x00800, 0x0adfc3fe, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g10.bin", 0x00800, 0x3e61f849, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g12.bin", 0x00800, 0x7130e9eb, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "colour.bin", 0x00020, 0x57a45057, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Piscesb) -STD_ROM_FN(Piscesb) - -static struct BurnRomInfo OmniRomDesc[] = { - { "omni1.7f", 0x01000, 0xa9b7acc6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "omni2.7j", 0x01000, 0x6ade29b7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "omni3.7f", 0x01000, 0x9e37bb24, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "omni5b.l1", 0x00800, 0x9503a23a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "omni6c.j22", 0x00800, 0x0adfc3fe, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "omni4a.j1", 0x00800, 0x3e61f849, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "omni7d.l2", 0x00800, 0x7130e9eb, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "colour.bin", 0x00020, 0x57a45057, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Omni) -STD_ROM_FN(Omni) - -static struct BurnRomInfo UniwarsRomDesc[] = { - { "f07_1a.bin", 0x00800, 0xd975af10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "h07_2a.bin", 0x00800, 0xb2ed14c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "k07_3a.bin", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m07_4a.bin", 0x00800, 0xddc80bc5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "d08p_5a.bin", 0x00800, 0x62354351, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "gg6", 0x00800, 0x270a3f4d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m08p_7a.bin", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "n08p_8a.bin", 0x00800, 0x797d45c7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "egg10", 0x00800, 0x012941e0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "h01_2.bin", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "egg9", 0x00800, 0xfc8b58fd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k01_2.bin", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "uniwars.clr", 0x00020, 0x25c79518, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Uniwars) -STD_ROM_FN(Uniwars) - -static struct BurnRomInfo UniwarsaRomDesc[] = { - { "u1", 0x00800, 0xd975af10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u2", 0x00800, 0xb2ed14c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u3", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u4", 0x00800, 0xddc80bc5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u5", 0x00800, 0xa0847fe4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u6", 0x00800, 0x270a3f4d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u7", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u8", 0x00800, 0x5760b65c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "u10", 0x00800, 0x012941e0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "u12", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "u9", 0x00800, 0xfc8b58fd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "u11", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "kareteco.clr", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Uniwarsa) -STD_ROM_FN(Uniwarsa) - -static struct BurnRomInfo MltiwarsRomDesc[] = { - { "g1.bin", 0x00800, 0xd975af10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g2.bin", 0x00800, 0xb2ed14c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g3.bin", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g4.bin", 0x00800, 0xef28ec00, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g5.bin", 0x00800, 0x855ab0dd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g6.bin", 0x00800, 0xd915a389, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g7.bin", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g8.bin", 0x00800, 0x797d45c7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "g14.bin", 0x01000, 0x227f9e8e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g15.bin", 0x01000, 0x3f8b6a24, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mltiwars) -STD_ROM_FN(Mltiwars) - -static struct BurnRomInfo GteikokuRomDesc[] = { - { "f07_1a.bin", 0x00800, 0xd975af10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "h07_2a.bin", 0x00800, 0xb2ed14c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "k07_3a.bin", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m07_4a.bin", 0x00800, 0xddc80bc5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "d08p_5a.bin", 0x00800, 0x62354351, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e08p_6a.bin", 0x00800, 0xd915a389, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m08p_7a.bin", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "n08p_8a.bin", 0x00800, 0x797d45c7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "h01_1.bin", 0x00800, 0x8313c959, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "h01_2.bin", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k01_1.bin", 0x00800, 0xc9d4537e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k01_2.bin", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Gteikoku) -STD_ROM_FN(Gteikoku) - -static struct BurnRomInfo GteikokubRomDesc[] = { - { "1.bin", 0x00800, 0xbf00252f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.bin", 0x00800, 0xf712b7d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "k07_3a.bin", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.bin", 0x00800, 0x808a39a8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.bin", 0x00800, 0x36fe6e67, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.bin", 0x00800, 0xc5ea67e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m08p_7a.bin", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.bin", 0x00800, 0x28df3229, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "h01_1.bin", 0x00800, 0x8313c959, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "h01_2.bin", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k01_1.bin", 0x00800, 0xc9d4537e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k01_2.bin", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Gteikokub) -STD_ROM_FN(Gteikokub) - -static struct BurnRomInfo Gteikokub2RomDesc[] = { - { "94gnog.bin", 0x00800, 0x67ec3235, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "92gnog.bin", 0x00800, 0x813c41f2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "k07_3a.bin", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "1gnog.bin", 0x00800, 0x49ff9658, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.bin", 0x00800, 0x36fe6e67, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e08p_6a.bin", 0x00800, 0xd915a389, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m08p_7a.bin", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "98gnog.bin", 0x00800, 0xe9d4ad3c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "h01_1.bin", 0x00800, 0x8313c959, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "h01_2.bin", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k01_1.bin", 0x00800, 0xc9d4537e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k01_2.bin", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Gteikokub2) -STD_ROM_FN(Gteikokub2) - -static struct BurnRomInfo SpacbattRomDesc[] = { - { "sb1", 0x00800, 0xd975af10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb2", 0x00800, 0xb2ed14c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb3", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb4", 0x00800, 0x8229835c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb5", 0x00800, 0xf51ef930, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb6", 0x00800, 0xd915a389, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb7", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb8", 0x00800, 0xe59ff1ae, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "sb12", 0x00800, 0x8313c959, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sb14", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sb11", 0x00800, 0xc9d4537e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sb13", 0x00800, 0x92454380, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Spacbatt) -STD_ROM_FN(Spacbatt) - -static struct BurnRomInfo Spacbat2RomDesc[] = { - { "sb1", 0x00800, 0xd975af10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb2", 0x00800, 0xb2ed14c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb.3", 0x00800, 0xc25ce4c1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb4", 0x00800, 0x8229835c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb5", 0x00800, 0xf51ef930, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb6", 0x00800, 0xd915a389, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb7", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sb8", 0x00800, 0xe59ff1ae, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "sb12", 0x00800, 0x8313c959, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sb14", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sb11", 0x00800, 0xc9d4537e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k01_2.bin", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Spacbat2) -STD_ROM_FN(Spacbat2) - -static struct BurnRomInfo SpacemprRomDesc[] = { - { "uw01", 0x00800, 0x7c64fb92, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "uw02", 0x00800, 0xb2ed14c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "uw03", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "uw04", 0x00800, 0x84885060, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "uw05", 0x00800, 0xe342371d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "uw06", 0x00800, 0xd915a389, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "uw07", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "uw08", 0x00800, 0xa237c394, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "uw10", 0x00800, 0xaf069cba, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "uw12", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "uw09", 0x00800, 0xff2c20d5, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "uw11", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Spacempr) -STD_ROM_FN(Spacempr) - -static struct BurnRomInfo SkyraidrRomDesc[] = { - { "f07_1a.bin", 0x00800, 0xd975af10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "h07_2a.bin", 0x00800, 0xb2ed14c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "k07_3a.bin", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sr.04", 0x00800, 0x9f61d1f8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sr.05", 0x00800, 0x4352af0a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sr.06", 0x00800, 0xd915a389, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m08p_7a.bin", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "n08p_8a.bin", 0x00800, 0x797d45c7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "sr.10", 0x00800, 0xaf069cba, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "h01_2.bin", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sr.09", 0x00800, 0xff2c20d5, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k01_2.bin", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "uniwars.clr", 0x00020, 0x25c79518, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Skyraidr) -STD_ROM_FN(Skyraidr) - -static struct BurnRomInfo GalempRomDesc[] = { - { "1", 0x00800, 0xd975af10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2", 0x00800, 0xb2ed14c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3", 0x00800, 0x945f4160, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4", 0x00800, 0xdf7a13ea, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5", 0x00800, 0xff6128a2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6", 0x00800, 0xd915a389, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7", 0x00800, 0xc9245346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8", 0x00800, 0x797d45c7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "10", 0x00800, 0x30177b93, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "12", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "9", 0x00800, 0x7e8dcc13, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "11", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Galemp) -STD_ROM_FN(Galemp) - -static struct BurnRomInfo AsideralRomDesc[] = { - { "1401.7f", 0x00800, 0x82a9da91, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "1302.7h", 0x00800, 0xcc59b49c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "1203.7k", 0x00800, 0x3bc5a165, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "1104.7m", 0x00800, 0xc50149d0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.8f", 0x00800, 0x17720c9e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.8f", 0x00800, 0xf157a8db, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7.8f", 0x00800, 0x75085cb6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.8f", 0x00800, 0x797d45c7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "u10.j2", 0x00800, 0x012941e0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "u12.j2", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "u9.l2", 0x00800, 0xfc8b58fd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "u11.l2", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "uniwars.clr", 0x00020, 0x25c79518, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Asideral) -STD_ROM_FN(Asideral) - -static struct BurnRomInfo PajaroesRomDesc[] = { - { "pea.rom", 0x00800, 0x82a9da91, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "peb.rom", 0x00800, 0xcc59b49c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pec.rom", 0x00800, 0x3bc5a165, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ped.rom", 0x00800, 0xc50149d0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pe05.rom", 0x00800, 0xcb461871, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pe04.rom", 0x00800, 0xf157a8db, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pe03.rom", 0x00800, 0x75085cb6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pe02.rom", 0x00800, 0x797d45c7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "pe07.rom", 0x00800, 0x012941e0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "pe09.rom", 0x00800, 0xc26132af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "pe06.rom", 0x00800, 0xfc8b58fd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "pe08.rom", 0x00800, 0xdcc2b33b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "uniwars.clr", 0x00020, 0x25c79518, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Pajaroes) -STD_ROM_FN(Pajaroes) - -void __fastcall PiscesZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5800 && a <= 0x58ff) { - INT32 Offset = a - 0x5800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: - case 0x6001: { - // start_lamp_w - return; - } - - case 0x6002: { - GalGfxBank[0] = d; - return; - } - - case 0x6003: { - // coin_count_0_w - return; - } - - case 0x6004: - case 0x6005: - case 0x6006: - case 0x6007: { - GalaxianLfoFreqWrite(a - 0x6004, d); - return; - } - - case 0x6800: - case 0x6801: - case 0x6802: - case 0x6803: - case 0x6804: - case 0x6805: - case 0x6806: - case 0x6807: { - GalaxianSoundWrite(a - 0x6800, d); - return; - } - - case 0x7001: { - GalIrqFire = d & 1; - return; - } - - case 0x7004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x7006: { - GalFlipScreenX = d & 1; - return; - } - - case 0x7007: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static void PiscesInstallGfxBankHandler() -{ - ZetOpen(0); - ZetSetWriteHandler(PiscesZ80Write); - ZetClose(); -} - -static INT32 PiscesInit() -{ - GalPostLoadCallbackFunction = PiscesInstallGfxBankHandler; - GalExtendTileInfoFunction = PiscesExtendTileInfo; - GalExtendSpriteInfoFunction = PiscesExtendSpriteInfo; - - return GalInit(); -} - -struct BurnDriver BurnDrvPisces = { - "pisces", NULL, NULL, NULL, "19??", - "Pisces\0", NULL, "Subelectro", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, PiscesRomInfo, PiscesRomName, NULL, NULL, PicsesInputInfo, PiscesDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvPiscesb = { - "piscesb", "pisces", NULL, NULL, "19??", - "Pisces (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, PiscesbRomInfo, PiscesbRomName, NULL, NULL, PicsesInputInfo, PiscesbDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvOmni = { - "omni", "pisces", NULL, NULL, "19??", - "Omni\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, OmniRomInfo, OmniRomName, NULL, NULL, OmegabInputInfo, PiscesbDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvUniwars = { - "uniwars", NULL, NULL, NULL, "1980", - "UniWar S\0", NULL, "Irem", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, UniwarsRomInfo, UniwarsRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvUniwarsa = { - "uniwarsa", "uniwars", NULL, NULL, "1980", - "UniWar S (bootleg)\0", NULL, "bootleg (Karateco)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, UniwarsaRomInfo, UniwarsaRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMltiwars = { - "mltiwars", "uniwars", NULL, NULL, "1980", - "Multi Wars (bootleg of UniWar S)\0", NULL, "bootleg (Gayton Games)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MltiwarsRomInfo, MltiwarsRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGteikoku = { - "gteikoku", "uniwars", NULL, NULL, "1980", - "Gingateikoku No Gyakushu\0", NULL, "Irem", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GteikokuRomInfo, GteikokuRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGteikokub = { - "gteikokub", "uniwars", NULL, NULL, "1980", - "Gingateikoku No Gyakushu (bootleg set 1)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GteikokubRomInfo, GteikokubRomName, NULL, NULL, OmegabInputInfo, GteikokubDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGteikokub2 = { - "gteikokub2", "uniwars", NULL, NULL, "1980", - "Gingateikoku No Gyakushu (bootleg set 2)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Gteikokub2RomInfo, Gteikokub2RomName, NULL, NULL, OmegabInputInfo, Gteikokub2DIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSpacbatt = { - "spacbatt", "uniwars", NULL, NULL, "1980", - "Space Battle (bootleg set 1)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SpacbattRomInfo, SpacbattRomName, NULL, NULL, GalaxianInputInfo, SpacbattDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSpacbat2 = { - "spacbat2", "uniwars", NULL, NULL, "1980", - "Space Battle (bootleg set 2)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Spacbat2RomInfo, Spacbat2RomName, NULL, NULL, GalaxianInputInfo, SpacbattDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSpacempr = { - "spacempr", "uniwars", NULL, NULL, "1980", - "Space Empire (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SpacemprRomInfo, SpacemprRomName, NULL, NULL, GalaxianInputInfo, SpacbattDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSkyraidr = { - "skyraidr", "uniwars", NULL, NULL, "1980", - "Sky Raiders\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SkyraidrRomInfo, SkyraidrRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGalemp = { - "galemp", "uniwars", NULL, NULL, "1980", - "Galaxy Empire (bootleg?)\0", NULL, "bootleg (Taito do Brasil)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, GalempRomInfo, GalempRomName, NULL, NULL, GalaxianInputInfo, SupergDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAsideral = { - "asideral", "uniwars", NULL, NULL, "1980", - "Ataque Sideral (Spanish bootleg of UniWar S)\0", NULL, "bootleg (Electrogame S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, AsideralRomInfo, AsideralRomName, NULL, NULL, GalaxianInputInfo, AsideralDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvPajaroes = { - "pajaroes", "uniwars", NULL, NULL, "1980", - "Pajaro del Espacio (Spanish bootleg of UniWar S)\0", NULL, "bootleg (PSV S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, PajaroesRomInfo, PajaroesRomName, NULL, NULL, GalaxianInputInfo, AsideralDIPInfo, - PiscesInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Extra chars contolled via different banking at 0x6002 -static struct BurnRomInfo Batman2RomDesc[] = { - { "01.bin", 0x00800, 0x150fbca5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "02.bin", 0x00800, 0xb1624fd0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "03.bin", 0x00800, 0x93774188, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "04.bin", 0x00800, 0x8a94ec6c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "05.bin", 0x00800, 0xa3669461, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "06.bin", 0x00800, 0xfa1efbfe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "07.bin", 0x00800, 0x9b77debd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "08.bin", 0x00800, 0x6466177e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "09.bin", 0x00800, 0x1a657b1f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "11.bin", 0x00800, 0x7a2b48e5, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "10.bin", 0x00800, 0x9b570016, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "12.bin", 0x00800, 0x73956244, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Batman2) -STD_ROM_FN(Batman2) - -static struct BurnRomInfo LadybuggRomDesc[] = { - { "lbuggx.1", 0x00800, 0xe67e241d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lbuggx.2", 0x00800, 0x3cb1fb9a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lbuggx.3", 0x00800, 0x0937009e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lbuggx.4", 0x00800, 0x3e773f62, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lbuggx.5", 0x00800, 0x2b0d42e5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lbuggx.6", 0x00800, 0x159f9433, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lbuggx.7", 0x00800, 0xf2be06d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lbuggx.8", 0x00800, 0x646fe79f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "lbuggx.a", 0x01000, 0x7efb9dc5, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "lbuggx.b", 0x01000, 0x351d4ddc, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "lbuggx.clr", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Ladybugg) -STD_ROM_FN(Ladybugg) - -static INT32 Batman2Init() -{ - GalPostLoadCallbackFunction = PiscesInstallGfxBankHandler; - GalExtendTileInfoFunction = Batman2ExtendTileInfo; - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - - return GalInit(); -} - -static INT32 LadybuggInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = PiscesInstallGfxBankHandler; - GalExtendTileInfoFunction = Batman2ExtendTileInfo; - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - - nRet = GalInit(); - - UINT8 *TempRom = (UINT8*)BurnMalloc(0x1000); - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - memcpy(GalTempRom + 0x0800, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x0000, TempRom + 0x0800, 0x800); - BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - memcpy(GalTempRom + 0x1800, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x1000, TempRom + 0x0800, 0x800); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - BurnFree(TempRom); - - return nRet; -} - -struct BurnDriver BurnDrvBatman2 = { - "batman2", "phoenix", NULL, NULL, "1981", - "Batman Part 2\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Batman2RomInfo, Batman2RomName, NULL, NULL, Batman2InputInfo, Batman2DIPInfo, - Batman2Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvLadybugg = { - "ladybugg", "ladybug", NULL, NULL, "1983", - "Lady Bug (bootleg on Galaxian hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, LadybuggRomInfo, LadybuggRomName, NULL, NULL, LadybuggInputInfo, LadybuggDIPInfo, - LadybuggInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Seperate sprite/tile roms -static struct BurnRomInfo StreakngRomDesc[] = { - { "sk1", 0x01000, 0xc8866ccb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sk2", 0x01000, 0x7caea29b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sk3", 0x01000, 0x7b4bfa76, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sk4", 0x01000, 0x056fc921, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "sk5", 0x01000, 0xd27f1e0c, BRF_GRA | GAL_ROM_TILES_CHARS }, - - { "sk6", 0x01000, 0xa7089588, BRF_GRA | GAL_ROM_TILES_SPRITES }, - - { "sk.bpr", 0x00020, 0xbce79607, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Streakng) -STD_ROM_FN(Streakng) - -static struct BurnRomInfo StreakngaRomDesc[] = { - { "st1.bin", 0x00800, 0xc827e124, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "st2.bin", 0x00800, 0xb01d4f8f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "st3.bin", 0x00800, 0xc7a9c493, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "st4.bin", 0x00800, 0x12487c75, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5st.bin", 0x00800, 0xf9f9e2be, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6st.bin", 0x00800, 0xc22fe6c2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7st.bin", 0x00800, 0x9cd7869a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8st.bin", 0x00800, 0x5e750ad3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "11.bin", 0x00800, 0xcddd8924, BRF_GRA | GAL_ROM_TILES_CHARS }, - { "12.bin", 0x00800, 0x10cda095, BRF_GRA | GAL_ROM_TILES_CHARS }, - - { "9.bin", 0x00800, 0x6a2a8a0f, BRF_GRA | GAL_ROM_TILES_SPRITES }, - { "10.bin", 0x00800, 0x3563dfbe, BRF_GRA | GAL_ROM_TILES_SPRITES }, - - { "sk.bpr", 0x00020, 0xbce79607, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Streaknga) -STD_ROM_FN(Streaknga) - -static struct BurnRomInfo PacmanblRomDesc[] = { - { "1", 0x00800, 0x6718df42, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2", 0x00800, 0x33be3648, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3", 0x00800, 0xf98c0ceb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4", 0x00800, 0xa9cd0082, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5", 0x00800, 0x6d475afc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6", 0x00800, 0xcbe863d3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7", 0x00800, 0x7daef758, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "12", 0x00800, 0xb2ed320b, BRF_GRA | GAL_ROM_TILES_CHARS }, - { "11", 0x00800, 0xab88b2c4, BRF_GRA | GAL_ROM_TILES_CHARS }, - - { "10", 0x00800, 0x44a45b72, BRF_GRA | GAL_ROM_TILES_SPRITES }, - { "9", 0x00800, 0xfa84659f, BRF_GRA | GAL_ROM_TILES_SPRITES }, - - { "sn74s288n.6l", 0x00020, 0x24652bc4, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Pacmanbl) -STD_ROM_FN(Pacmanbl) - -static struct BurnRomInfo PacmanblaRomDesc[] = { - { "rom1.bin", 0x01000, 0x75e4f967, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom2.bin", 0x01000, 0x5b2e4293, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom3.bin", 0x01000, 0xc06e30a4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom4.bin", 0x01000, 0x592b4ba8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "rom5.bin", 0x01000, 0xf2d8c01e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom6.bin", 0x01000, 0x346a1720, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "sn74s288n.6l", 0x00020, 0x24652bc4, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Pacmanbla) -STD_ROM_FN(Pacmanbla) - -static struct BurnRomInfo GhostmunRomDesc[] = { - { "pac1.bin", 0x01000, 0x19338c70, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pac2.bin", 0x01000, 0x18db074d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pac3.bin", 0x01000, 0xabb98b1d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pac4.bin", 0x01000, 0x2403c78e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "blpac12b", 0x00800, 0xb2ed320b, BRF_GRA | GAL_ROM_TILES_CHARS }, - { "blpac11b", 0x00800, 0xab88b2c4, BRF_GRA | GAL_ROM_TILES_CHARS }, - - { "blpac10b", 0x00800, 0x44a45b72, BRF_GRA | GAL_ROM_TILES_SPRITES }, - { "blpac9b", 0x00800, 0xfa84659f, BRF_GRA | GAL_ROM_TILES_SPRITES }, - - { "ghostmun.clr", 0x00020, 0x759647e3, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Ghostmun) -STD_ROM_FN(Ghostmun) - -static struct BurnRomInfo Phoenxp2RomDesc[] = { - { "1", 0x00800, 0xf6dcfd51, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2", 0x00800, 0xde951936, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3", 0x00800, 0x7a3af2da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4", 0x00800, 0xc820ad32, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5", 0x00800, 0x08e83233, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6", 0x00800, 0xf31fb9d6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7", 0x00800, 0xd3a480c1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8", 0x00800, 0xedf9779e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "10", 0x00800, 0x9b570016, BRF_GRA | GAL_ROM_TILES_CHARS }, - { "09", 0x00800, 0x1a657b1f, BRF_GRA | GAL_ROM_TILES_CHARS }, - - { "12", 0x00800, 0x73956244, BRF_GRA | GAL_ROM_TILES_SPRITES }, - { "11", 0x00800, 0x7a2b48e5, BRF_GRA | GAL_ROM_TILES_SPRITES }, - - { "sn74s288n.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Phoenxp2) -STD_ROM_FN(Phoenxp2) - -static struct BurnRomInfo AtlantisbRomDesc[] = { - { "1", 0x00800, 0x2b612351, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2", 0x00800, 0xb1c970e9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3", 0x00800, 0x63c3783e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4", 0x00800, 0x45f7cf34, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5", 0x00800, 0xf335b96b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6", 0x00800, 0xa50bf8d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "8", 0x00800, 0x55cd5acd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "7", 0x00800, 0x72e773b8, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "sn74s288n.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Atlantisb) -STD_ROM_FN(Atlantisb) - -UINT8 __fastcall GhostmunZ80Read(UINT16 a) -{ - switch (a) { - case 0x6000: { - return GalInput[0] | GalDip[0]; - } - - case 0x6800: { - return GalInput[1] | GalDip[1]; - } - - case 0x7000: { - return GalInput[2] | GalDip[2]; - } - - case 0x7800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0x00; -} - -static INT32 PacmanblInit() -{ - INT32 nRet = GalInit(); - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void PacmanblaRearrangeRom() -{ - GalTempRom = (UINT8*)BurnMalloc(GalZ80Rom1Size); - memcpy(GalTempRom, GalZ80Rom1, GalZ80Rom1Size); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0000, 0x800); - memcpy(GalZ80Rom1 + 0x2000, GalTempRom + 0x0800, 0x800); - memcpy(GalZ80Rom1 + 0x0800, GalTempRom + 0x1000, 0x800); - memcpy(GalZ80Rom1 + 0x2800, GalTempRom + 0x1800, 0x800); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x2000, 0x800); - memcpy(GalZ80Rom1 + 0x3000, GalTempRom + 0x2800, 0x800); - memcpy(GalZ80Rom1 + 0x1800, GalTempRom + 0x3000, 0x800); - memcpy(GalZ80Rom1 + 0x3800, GalTempRom + 0x3800, 0x800); - BurnFree(GalTempRom); -} - -static INT32 PacmanblaInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = PacmanblaRearrangeRom; - - nRet = PacmanblInit(); - - GalNumChars = 0x100; - GalNumSprites = 0x40; - CharPlaneOffsets[1] = 0x4000; - SpritePlaneOffsets[1] = 0x4000; - - UINT8 *TempRom = (UINT8*)BurnMalloc(0x2000); - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - BurnLoadRom(TempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - memcpy(GalTempRom + 0x0000, TempRom + 0x0800, 0x800); - memcpy(GalTempRom + 0x0800, TempRom + 0x1800, 0x800); - memcpy(GalTempRom + 0x1000, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x1800, TempRom + 0x1000, 0x800); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom + 0x1000, GalSprites); - BurnFree(GalTempRom); - BurnFree(TempRom); - - return nRet; -} - -static void GhostmunInstallHandler() -{ - ZetOpen(0); - ZetSetReadHandler(GhostmunZ80Read); - ZetClose(); -} - -static INT32 GhostmunInit() -{ - GalPostLoadCallbackFunction = GhostmunInstallHandler; - - INT32 nRet = GalInit(); - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void AtlantisbRearrangeRom() -{ - GalTempRom = (UINT8*)BurnMalloc(0x3000); - - memcpy(GalTempRom, GalZ80Rom1, 0x3000); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0000, 0x1000); - memcpy(GalZ80Rom1 + 0x1800, GalTempRom + 0x1000, 0x2000); - BurnFree(GalTempRom); -} - -static INT32 AtlantisbInit() -{ - GalZ80Rom1Size = 0x1000; - - GalPostLoadCallbackFunction = AtlantisbRearrangeRom; - - return GalInit(); -} - -struct BurnDriver BurnDrvStreakng = { - "streakng", NULL, NULL, NULL, "1981", - "Streaking (set 1)\0", "Bad Colours", "Shoei", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, StreakngRomInfo, StreakngRomName, NULL, NULL, StreakngInputInfo, StreakngDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvStreaknga = { - "streaknga", "streakng", NULL, NULL, "1981", - "Streaking (set 2)\0", "Bad Colours", "Shoei", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, StreakngaRomInfo, StreakngaRomName, NULL, NULL, StreakngInputInfo, StreakngDIPInfo, - GalInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvPacmanbl = { - "pacmanbl", "puckman", NULL, NULL, "1981", - "Pac-Man (Galaxian hardware, set 1)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, PacmanblRomInfo, PacmanblRomName, NULL, NULL, PacmanblInputInfo, PacmanblDIPInfo, - PacmanblInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvPacmanbla = { - "pacmanbla", "puckman", NULL, NULL, "1981", - "Pac-Man (Galaxian hardware, set 2)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, PacmanblaRomInfo, PacmanblaRomName, NULL, NULL, PacmanblInputInfo, PacmanblDIPInfo, - PacmanblaInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGhostmun = { - "ghostmun", "puckman", NULL, NULL, "1981", - "Ghost Muncher\0", NULL, "Leisure and Allied", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, GhostmunRomInfo, GhostmunRomName, NULL, NULL, StreakngInputInfo, GhostmunDIPInfo, - GhostmunInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvPhoenxp2 = { - "phoenxp2", "phoenix", NULL, NULL, "1981", - "Phoenix Part 2\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Phoenxp2RomInfo, Phoenxp2RomName, NULL, NULL, Phoenxp2InputInfo, Phoenxp2DIPInfo, - PacmanblInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAtlantisb = { - "atlantisb", "atlantis", NULL, NULL, "1981", - "Battle of Atlantis (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, AtlantisbRomInfo, AtlantisbRomName, NULL, NULL, Phoenxp2InputInfo, AtlantisbDIPInfo, - AtlantisbInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Seperate sprite/tile roms with IRQ0 instead of NMI -static struct BurnRomInfo DevilfsgRomDesc[] = { - { "dfish1.7f", 0x01000, 0x2ab19698, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "dfish2.7h", 0x01000, 0x4e77f097, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "dfish3.7k", 0x01000, 0x3f16a4c6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "dfish4.7m", 0x01000, 0x11fc7e59, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "dfish5.1h", 0x01000, 0xace6e31f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "dfish6.1k", 0x01000, 0xd7a6c4c4, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Devilfsg) -STD_ROM_FN(Devilfsg) - -static void DevilfsgRearrangeRom() -{ - GalTempRom = (UINT8*)BurnMalloc(GalZ80Rom1Size); - memcpy(GalTempRom, GalZ80Rom1, GalZ80Rom1Size); - memcpy(GalZ80Rom1 + 0x2000, GalTempRom + 0x0000, 0x800); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0800, 0x800); - memcpy(GalZ80Rom1 + 0x2800, GalTempRom + 0x1000, 0x800); - memcpy(GalZ80Rom1 + 0x0800, GalTempRom + 0x1800, 0x800); - memcpy(GalZ80Rom1 + 0x3000, GalTempRom + 0x2000, 0x800); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x2800, 0x800); - memcpy(GalZ80Rom1 + 0x3800, GalTempRom + 0x3000, 0x800); - memcpy(GalZ80Rom1 + 0x1800, GalTempRom + 0x3800, 0x800); - BurnFree(GalTempRom); -} - -static INT32 DevilfsgInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = DevilfsgRearrangeRom; - - nRet = GalInit(); - - GalNumChars = 0x100; - GalNumSprites = 0x40; - CharPlaneOffsets[1] = 0x4000; - SpritePlaneOffsets[1] = 0x4000; - - UINT8 *TempRom = (UINT8*)BurnMalloc(0x2000); - GalTempRom = (UINT8*)BurnMalloc(0x1000); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x0000, TempRom + 0x0800, 0x800); - memcpy(GalTempRom + 0x0800, TempRom + 0x1800, 0x800); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - memcpy(GalTempRom + 0x0000, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x0800, TempRom + 0x1000, 0x800); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - BurnFree(TempRom); - - GalIrqType = GAL_IRQ_TYPE_IRQ0; - - return nRet; -} - -struct BurnDriver BurnDrvDevilfsg = { - "devilfsg", "devilfsh", NULL, NULL, "1984", - "Devil Fish (Galaxian hardware, bootleg?)\0", NULL, "Vision / Artic", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, DevilfsgRomInfo, DevilfsgRomName, NULL, NULL, DevilfsgInputInfo, DevilfsgDIPInfo, - DevilfsgInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Sound hardware replaced with AY8910 -static struct BurnRomInfo ZigzagbRomDesc[] = { - { "zz_d1.7l", 0x01000, 0x8cc08d81, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zz_d2.7k", 0x01000, 0x326d8d45, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zz_d4.7f", 0x01000, 0xa94ed92a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zz_d3.7h", 0x01000, 0xce5e7a00, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "zz_6.1h", 0x01000, 0x780c162a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "zz_5.1k", 0x01000, 0xf3cdfec5, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "zzbpr_e9.bin", 0x00020, 0xaa486dd0, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Zigzagb) -STD_ROM_FN(Zigzagb) - -static struct BurnRomInfo Zigzagb2RomDesc[] = { - { "z1.7l", 0x01000, 0x4c28349a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zz_d2.7k", 0x01000, 0x326d8d45, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zz_d4.7f", 0x01000, 0xa94ed92a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "zz_d3.7h", 0x01000, 0xce5e7a00, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "zz_6.1h", 0x01000, 0x780c162a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "zz_5.1k", 0x01000, 0xf3cdfec5, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "zzbpr_e9.bin", 0x00020, 0xaa486dd0, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Zigzagb2) -STD_ROM_FN(Zigzagb2) - -static struct BurnRomInfo Ozon1RomDesc[] = { - { "rom1.bin", 0x01000, 0x54899e8b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom2.bin", 0x01000, 0x3c90fbfc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom3.bin", 0x01000, 0x79fe313b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "rom7.bin", 0x00800, 0x464285e8, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom8.bin", 0x00800, 0x92056dcc, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "ozon1.clr", 0x00020, 0x605ea6e9, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Ozon1) -STD_ROM_FN(Ozon1) - -void __fastcall ZigzagZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x4800 && a <= 0x4fff) { - INT32 Offset = a - 0x4800; - - switch (Offset & 0x300) { - case 0x000: { - if ((Offset & 1) != 0) { - if ((Offset & 2) == 0) { - AY8910Write(0, 1, ZigzagAYLatch); - } else { - AY8910Write(0, 0, ZigzagAYLatch); - } - } - break; - } - - case 0x100: { - ZigzagAYLatch = Offset & 0xff; - break; - } - } - return; - } - - if (a >= 0x5800 && a <= 0x58ff) { - INT32 Offset = a - 0x5800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: - case 0x6001: { - // start_lamp_w - return; - } - - case 0x6002: { - // coin_lock_w - return; - } - - case 0x6003: { - // coin_count_0_w - return; - } - - case 0x7001: { - GalIrqFire = d & 1; - return; - } - - case 0x7002: { - ZetMapArea(0x2000, 0x2fff, 0, GalZ80Rom1 + 0x2000 + (0x1000 * (d & 1))); - ZetMapArea(0x2000, 0x2fff, 2, GalZ80Rom1 + 0x2000 + (0x1000 * (d & 1))); - ZetMapArea(0x3000, 0x3fff, 0, GalZ80Rom1 + 0x2000 + (0x1000 * (~d & 1))); - ZetMapArea(0x3000, 0x3fff, 2, GalZ80Rom1 + 0x2000 + (0x1000 * (~d & 1))); - return; - } - - case 0x7004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x7006: { - GalFlipScreenX = d & 1; - return; - } - - case 0x7007: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - // watchdog write - return; - } - - default: { - if (!(a >= 0x5400 && a <= 0x70ff)) - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Ozon1Z80Read(UINT16 a) -{ - switch (a) { - case 0x8100: { - return 0xff - (GalInput[0] | GalDip[0]); - } - - case 0x8101: { - return 0xff - (GalInput[1] | GalDip[1]); - } - - case 0x8102: { - return 0xff - (GalInput[2] | GalDip[2]); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall Ozon1Z80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6801: { - // ??? - GalIrqFire = d & 1; - return; - } - - case 0x6802: { - // coin_counter_0_w - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall Ozon1Z80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - AY8910Write(0, 1, d); - return; - } - - case 0x01: { - AY8910Write(0, 0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static void ZigzagInstallHandler() -{ - ZetOpen(0); - ZetSetWriteHandler(ZigzagZ80Write); - ZetClose(); -} - -static INT32 ZigzagInit() -{ - INT32 nRet; - - GalSoundType = GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910; - GalPostLoadCallbackFunction = ZigzagInstallHandler; - - nRet = GalInit(); - - GalNumChars = 0x100; - GalNumSprites = 0x40; - CharPlaneOffsets[1] = 0x4000; - SpritePlaneOffsets[1] = 0x4000; - - UINT8 *TempRom = (UINT8*)BurnMalloc(0x2000); - GalTempRom = (UINT8*)BurnMalloc(0x1000); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x0000, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x0800, TempRom + 0x1000, 0x800); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - memcpy(GalTempRom + 0x0000, TempRom + 0x0800, 0x800); - memcpy(GalTempRom + 0x0800, TempRom + 0x1800, 0x800); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - BurnFree(TempRom); - - GalRenderFrameFunction = ZigZagRenderFrame; - GalDrawBulletsFunction = NULL; - - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static void Ozon1PostLoad() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(Ozon1Z80Read); - ZetSetWriteHandler(Ozon1Z80Write); - ZetSetOutHandler(Ozon1Z80PortWrite); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x43ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x43ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x43ff, 2, GalZ80Ram1); - ZetMapArea(0x4800, 0x4bff, 0, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 1, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 2, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 0, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 1, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 2, GalVideoRam); - ZetMapArea(0x5000, 0x50ff, 0, GalSpriteRam); - ZetMapArea(0x5000, 0x50ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 Ozon1Init() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = Ozon1PostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910; - - nRet = GalInit(); - - GalDrawBulletsFunction = NULL; - GalRenderBackgroundFunction = NULL; - - return nRet; -} - -struct BurnDriver BurnDrvZigzagb = { - "zigzagb", NULL, NULL, NULL, "1982", - "Zig Zag (Galaxian hardware, set 1)\0", NULL, "LAX", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, ZigzagbRomInfo, ZigzagbRomName, NULL, NULL, ZigzagInputInfo, ZigzagDIPInfo, - ZigzagInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvZigzagb2 = { - "zigzagb2", "zigzagb", NULL, NULL, "1982", - "Zig Zag (Galaxian hardware, set 2)\0", NULL, "LAX", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, Zigzagb2RomInfo, Zigzagb2RomName, NULL, NULL, ZigzagInputInfo, ZigzagDIPInfo, - ZigzagInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvOzon1 = { - "ozon1", NULL, NULL, NULL, "1983", - "Ozon I\0", NULL, "Proma", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Ozon1RomInfo, Ozon1RomName, NULL, NULL, Ozon1InputInfo, Ozon1DIPInfo, - Ozon1Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Multi-game select via external switch -static struct BurnRomInfo GmgalaxRomDesc[] = { - { "pcb1_pm1.bin", 0x01000, 0x19338c70, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pcb1_pm2.bin", 0x01000, 0x18db074d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pcb1_pm3.bin", 0x01000, 0xabb98b1d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pcb1_pm4.bin", 0x01000, 0x2403c78e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pcb1_gx1.bin", 0x01000, 0x2faa9f53, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pcb1_gx2.bin", 0x01000, 0x121c5f16, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "pcb1_gx3.bin", 0x01000, 0x02d81a21, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "pcb2gfx1.bin", 0x01000, 0x7021bbc0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "pcb2gfx3.bin", 0x01000, 0x089c922b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "pcb2gfx2.bin", 0x01000, 0x51bf58ee, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "pcb2gfx4.bin", 0x01000, 0x908fd0dc, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "gmgalax2.clr", 0x00020, 0x499f4440, BRF_GRA | GAL_ROM_PROM }, - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Gmgalax) -STD_ROM_FN(Gmgalax) - -UINT8 __fastcall GmgalaxZ80Read(UINT16 a) -{ - switch (a) { - case 0x6000: { - return GalInput[0] | ((GmgalaxSelectedGame) ? GalDip[3] : GalDip[0]); - } - - case 0x6800: { - return GalInput[1] | ((GmgalaxSelectedGame) ? GalDip[4] : GalDip[1]); - } - - case 0x7000: { - return GalInput[2] | ((GmgalaxSelectedGame) ? GalDip[5] : GalDip[2]); - } - - case 0x7800: { - // watchdog read - return 0xff; - } - - default: { - //bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0x00; -} - -static void GmgalaxPostLoad() -{ - ZetOpen(0); - ZetSetReadHandler(GmgalaxZ80Read); - ZetClose(); -} - -static INT32 GmgalaxInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = GmgalaxPostLoad; - GalZ80Rom1Size = 0x1000; - - nRet = GalInit(); - - UINT8 *TempRom = (UINT8*)BurnMalloc(0x1000); - GalTempRom = (UINT8*)BurnMalloc(0x4000); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x0000, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x1000, TempRom + 0x0800, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x0800, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x1800, TempRom + 0x0800, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 2, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x2000, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x3000, TempRom + 0x0800, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 3, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x2800, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x3800, TempRom + 0x0800, 0x800); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - BurnFree(TempRom); - - GalExtendTileInfoFunction = GmgalaxExtendTileInfo; - GalExtendSpriteInfoFunction = GmgalaxExtendSpriteInfo; - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - GameIsGmgalax = 1; - - return nRet; -} - -struct BurnDriver BurnDrvGmgalax = { - "gmgalax", NULL, NULL, NULL, "1981", - "Ghostmuncher Galaxian (bootleg)\0", NULL, "LAX", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, GmgalaxRomInfo, GmgalaxRomName, NULL, NULL, GmgalaxInputInfo, GmgalaxDIPInfo, - GmgalaxInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Multi-game select via menu, with different graphic and sprite roms -static struct BurnRomInfo Fourin1RomDesc[] = { - { "rom1a", 0x01000, 0xce1af4d9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom1b", 0x01000, 0x18484f9b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom1c", 0x01000, 0x83248a8b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom1d", 0x01000, 0x053f6da0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom1e", 0x01000, 0x43c546f3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom1f", 0x01000, 0x3a086b46, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom1g", 0x01000, 0xac0e2050, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom1h", 0x01000, 0xdc11a513, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom1i", 0x01000, 0xa5fb6be4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom1j", 0x01000, 0x9054cfbe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom2c", 0x01000, 0x7cd98e11, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom2d", 0x01000, 0x9402f32e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom2e", 0x01000, 0x468e81df, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom2g", 0x01000, 0xb1ce3976, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom2h", 0x01000, 0x7eab5670, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rom2i", 0x01000, 0x44565ac5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "rom4b", 0x01000, 0x7e6495af, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom3b", 0x01000, 0x7475f72f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom4c", 0x00800, 0x3355d46d, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom3c", 0x00800, 0xac755a25, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom4d", 0x01000, 0xbbdddb65, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom3d", 0x01000, 0x91a00204, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom4e", 0x01000, 0x0cb9e297, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom3e", 0x01000, 0xa1fe77f9, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Fourin1) -STD_ROM_FN(Fourin1) - -UINT8 __fastcall Fourin1Z80Read(UINT16 a) -{ - switch (a) { - case 0x6000: { - return GalInput[0] | GalDip[0]; - } - - case 0x6800: { - return ((GalInput[1] | GalDip[1]) & ~0xc0) | (GalDip[3 + Fourin1Bank] & 0xc0); - } - - case 0x7000: { - return ((GalInput[2] | GalDip[2]) & 0x04) | (GalDip[3 + Fourin1Bank] & ~0xc4); - } - - case 0x7800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall Fourin1Z80Write(UINT16 a, UINT8 d) -{ - if (a < 0x4000) return; - - if (a >= 0x5800 && a <= 0x58ff) { - INT32 Offset = a - 0x5800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: - case 0x6001: { - // start_lamp_w - return; - } - - case 0x6002: { - // coin_lock_w - return; - } - - case 0x6003: { - // coin_count_0_w - return; - } - - case 0x6004: - case 0x6005: - case 0x6006: - case 0x6007: { - GalaxianLfoFreqWrite(a - 0x6004, d); - return; - } - - case 0x6800: - case 0x6801: - case 0x6802: - case 0x6803: - case 0x6804: - case 0x6805: - case 0x6806: - case 0x6807: { - GalaxianSoundWrite(a - 0x6800, d); - return; - } - - case 0x7001: { - GalIrqFire = d & 1; - return; - } - - case 0x7004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x7006: { - GalFlipScreenX = d & 1; - return; - } - - case 0x7007: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - GalPitch = d; - return; - } - - case 0x8000: { - Fourin1Bank = d & 0x03; - ZetMapArea(0x0000, 0x3fff, 0, GalZ80Rom1 + 0x2000 + (Fourin1Bank * 0x4000)); - ZetMapArea(0x0000, 0x3fff, 2, GalZ80Rom1 + 0x2000 + (Fourin1Bank * 0x4000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static void Fourin1PostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(0x3000); - memcpy(GalTempRom, GalZ80Rom1 + 0xd000, 0x3000); - memset(GalZ80Rom1 + 0xd000, 0x00, 0x1000); - memcpy(GalZ80Rom1 + 0xe000, GalTempRom, 0x3000); - memset(GalZ80Rom1 + 0x11000, 0x00, 0x1000); - BurnFree(GalTempRom); - - for (UINT32 i = 0; i < GalZ80Rom1Size; i++) { - GalZ80Rom1[i] = GalZ80Rom1[i] ^ (i & 0xff); - } - - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(Fourin1Z80Read); - ZetSetWriteHandler(Fourin1Z80Write); - ZetMapArea(0x0000, 0x3fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x3fff, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x43ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x43ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x43ff, 2, GalZ80Ram1); - ZetMapArea(0x5000, 0x53ff, 0, GalVideoRam); - ZetMapArea(0x5000, 0x53ff, 1, GalVideoRam); - ZetMapArea(0x5000, 0x53ff, 2, GalVideoRam); - ZetMapArea(0x5800, 0x58ff, 0, GalSpriteRam); - ZetMapArea(0x5800, 0x58ff, 2, GalSpriteRam); - ZetMapArea(0xc000, 0xdfff, 0, GalZ80Rom1); - ZetMapArea(0xc000, 0xdfff, 2, GalZ80Rom1); - ZetClose(); -} - -static INT32 Fourin1Init() -{ - INT32 nRet; - - Fourin1Bank = 0; - GalPostLoadCallbackFunction = Fourin1PostLoad; - GalZ80Rom1Size = 0x2000; - GalTilesSharedRomSize = 0x1000; - - nRet = GalInit(); - - GalNumChars = 1024; - GalNumSprites = 256; - CharPlaneOffsets[1] = GalNumChars * 8 * 8; - SpritePlaneOffsets[1] = GalNumSprites * 16 * 16; - - UINT8 *TempRom = (UINT8*)BurnMalloc(0x1000); - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x4000, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x0000, TempRom + 0x0800, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x6000, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x2000, TempRom + 0x0800, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 2, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x4800, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x0800, TempRom + 0x0000, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 3, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x6800, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x2800, TempRom + 0x0000, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 4, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x5000, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x1000, TempRom + 0x0800, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 5, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x7000, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x3000, TempRom + 0x0800, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 6, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x5800, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x1800, TempRom + 0x0800, 0x800); - nRet = BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 7, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x7800, TempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x3800, TempRom + 0x0800, 0x800); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom + 0x4000, GalSprites); - BurnFree(GalTempRom); - BurnFree(TempRom); - - GalExtendTileInfoFunction = Fourin1ExtendTileInfo; - GalExtendSpriteInfoFunction = Fourin1ExtendSpriteInfo; - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -struct BurnDriver BurnDrvFourin1 = { - "4in1", NULL, NULL, NULL, "1981", - "4 Fun in 1\0", NULL, "Armenia / Food and Fun", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, Fourin1RomInfo, Fourin1RomName, NULL, NULL, Fourin1InputInfo, Fourin1DIPInfo, - Fourin1Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Moon Cresta on Galaxian hardware with different memory map -static struct BurnRomInfo MooncrstRomDesc[] = { - { "mc1", 0x00800, 0x7d954a7a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc2", 0x00800, 0x44bb7cfa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc3", 0x00800, 0x9c412104, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc4", 0x00800, 0x7e9b1ab5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc5.7r", 0x00800, 0x16c759af, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc6.8d", 0x00800, 0x69bcafdb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc7.8e", 0x00800, 0xb50dbc46, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc8", 0x00800, 0x18ca312b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mcs_b", 0x00800, 0xfb0f1f81, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_a", 0x00800, 0x631ebb5a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrst) -STD_ROM_FN(Mooncrst) - -static struct BurnRomInfo MooncrstukRomDesc[] = { - { "mc1", 0x00800, 0x7d954a7a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc2", 0x00800, 0x44bb7cfa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc3", 0x00800, 0x9c412104, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc4", 0x00800, 0x7e9b1ab5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc5.7r", 0x00800, 0x16c759af, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc6.8d", 0x00800, 0x69bcafdb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc7.8e", 0x00800, 0xb50dbc46, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8_uk.bin", 0x00800, 0xce727ad4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mcs_b", 0x00800, 0xfb0f1f81, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_a", 0x00800, 0x631ebb5a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrstuk) -STD_ROM_FN(Mooncrstuk) - -static struct BurnRomInfo MooncrstukuRomDesc[] = { - { "smc1f", 0x00800, 0x389ca0d6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc2f", 0x00800, 0x410ab430, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc3f", 0x00800, 0xa6b4144b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc4f", 0x00800, 0x4cc046fe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc5f", 0x00800, 0x06d378a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc6f", 0x00800, 0x6e84a927, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc7f", 0x00800, 0xb45af1e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc8f_uk", 0x00800, 0xb968b2ff, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mcs_b", 0x00800, 0xfb0f1f81, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_a", 0x00800, 0x631ebb5a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrstuku) -STD_ROM_FN(Mooncrstuku) - -static struct BurnRomInfo MooncrstuRomDesc[] = { - { "smc1f", 0x00800, 0x389ca0d6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc2f", 0x00800, 0x410ab430, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc3f", 0x00800, 0xa6b4144b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc4f", 0x00800, 0x4cc046fe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e5", 0x00800, 0x06d378a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bepr199", 0x00800, 0x6e84a927, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e7", 0x00800, 0xb45af1e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "smc8f", 0x00800, 0xf42164c5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mcs_b", 0x00800, 0xfb0f1f81, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_a", 0x00800, 0x631ebb5a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrstu) -STD_ROM_FN(Mooncrstu) - -static struct BurnRomInfo MooncrstoRomDesc[] = { - { "mc1.7d", 0x00800, 0x92a86aac, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc2.7e", 0x00800, 0x438c2b4b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc3.7j", 0x00800, 0x67e3d21d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc4.7p", 0x00800, 0xf4db39f6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc5.7r", 0x00800, 0x16c759af, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc6.8d", 0x00800, 0x69bcafdb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc7.8e", 0x00800, 0xb50dbc46, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc8.8h", 0x00800, 0x7e2b1928, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mcs_b", 0x00800, 0xfb0f1f81, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_a", 0x00800, 0x631ebb5a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrsto) -STD_ROM_FN(Mooncrsto) - -static struct BurnRomInfo MooncrstgRomDesc[] = { - { "epr194", 0x00800, 0x0e5582b1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr195", 0x00800, 0x12cb201b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr196", 0x00800, 0x18255614, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr197", 0x00800, 0x05ac1466, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr198", 0x00800, 0xc28a2e8f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr199", 0x00800, 0x5a4571de, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr200", 0x00800, 0xb7c85bf1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr201", 0x00800, 0x2caba07f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr203", 0x00800, 0xbe26b561, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr202", 0x00800, 0x26c7e800, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrstg) -STD_ROM_FN(Mooncrstg) - -static void MooncrstEncryptedPostLoad() -{ - for (UINT32 Offset = 0; Offset < GalZ80Rom1Size; Offset++) { - UINT8 Data = GalZ80Rom1[Offset]; - UINT8 Res = Data; - if (BIT(Data, 1)) Res ^= 0x40; - if (BIT(Data, 5)) Res ^= 0x04; - if ((Offset & 1) == 0) Res = BITSWAP08(Res, 7, 2, 5, 4, 3, 6, 1, 0); - GalZ80Rom1[Offset] = Res; - } - - MapMooncrst(); -} - -static INT32 MooncrstEncryptedInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MooncrstEncryptedPostLoad; - - nRet = GalInit(); - - GalExtendTileInfoFunction = MooncrstExtendTileInfo; - GalExtendSpriteInfoFunction = MooncrstExtendSpriteInfo; - - return nRet; -} - -static INT32 MooncrstInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapMooncrst; - - nRet = GalInit(); - - GalExtendTileInfoFunction = MooncrstExtendTileInfo; - GalExtendSpriteInfoFunction = MooncrstExtendSpriteInfo; - - return nRet; -} - -struct BurnDriver BurnDrvMooncrst = { - "mooncrst", NULL, NULL, NULL, "1980", - "Moon Cresta (Nichibutsu)\0", NULL, "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrstRomInfo, MooncrstRomName, NULL, NULL, OmegabInputInfo, MooncrstDIPInfo, - MooncrstEncryptedInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrstuk = { - "mooncrstuk", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (Nichibutsu UK)\0", NULL, "Nichibutsu UK", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrstukRomInfo, MooncrstukRomName, NULL, NULL, OmegabInputInfo, MooncrstDIPInfo, - MooncrstEncryptedInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrstuku = { - "mooncrstuku", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (Nichibutsu UK, unencrypted)\0", NULL, "Nichibutsu UK", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrstukuRomInfo, MooncrstukuRomName, NULL, NULL, OmegabInputInfo, MooncrstDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrstu = { - "mooncrstu", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (Nichibutsu USA, unencrypted)\0", NULL, "Nichibutsu USA", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrstuRomInfo, MooncrstuRomName, NULL, NULL, OmegabInputInfo, MooncrstDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrsto = { - "mooncrsto", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (Nichibutsu, old rev)\0", NULL, "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrstoRomInfo, MooncrstoRomName, NULL, NULL, OmegabInputInfo, MooncrsaDIPInfo, - MooncrstEncryptedInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrstg = { - "mooncrstg", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (Gremlin)\0", NULL, "Gremlin", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrstgRomInfo, MooncrstgRomName, NULL, NULL, OmegabInputInfo, MooncrsgDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Straight Moon Cresta Rip-Offs on basic Moon Cresta hardware -static struct BurnRomInfo MooncrsbRomDesc[] = { - { "bepr194", 0x00800, 0x6a23ec6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bepr195", 0x00800, 0xee262ff2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f03.bin", 0x00800, 0x29a2b0ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f04.bin", 0x00800, 0x4c6a5a6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e5", 0x00800, 0x06d378a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bepr199", 0x00800, 0x6e84a927, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e7", 0x00800, 0xb45af1e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bepr201", 0x00800, 0x66da55d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr203", 0x00800, 0xbe26b561, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr202", 0x00800, 0x26c7e800, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrsb) -STD_ROM_FN(Mooncrsb) - -static struct BurnRomInfo Mooncrs2RomDesc[] = { - { "f8.bin", 0x00800, 0xd36003e5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bepr195", 0x00800, 0xee262ff2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f03.bin", 0x00800, 0x29a2b0ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f04.bin", 0x00800, 0x4c6a5a6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e5", 0x00800, 0x06d378a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bepr199", 0x00800, 0x6e84a927, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e7", 0x00800, 0xb45af1e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m7.bin", 0x00800, 0x957ee078, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "1h_1_10.bin", 0x00800, 0x528da705, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "12.chr", 0x00800, 0x5a4b17ea, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "1k_1_11.bin", 0x00800, 0x4e79ff6b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "11.chr", 0x00800, 0xe0edccbd, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrs2) -STD_ROM_FN(Mooncrs2) - -static struct BurnRomInfo Mooncrs3RomDesc[] = { - { "b1.7f", 0x01000, 0x0b28cd8a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b2.7h", 0x01000, 0x74a6f0ca, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b3.7j", 0x01000, 0xeeb34cc9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b4.7k", 0x01000, 0x714330e5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "o.1h", 0x00800, 0x528da705, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "q.1h", 0x00800, 0x5a4b17ea, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "p.1k", 0x00800, 0x4e79ff6b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "r.1k", 0x00800, 0xe0edccbd, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrs3) -STD_ROM_FN(Mooncrs3) - -static struct BurnRomInfo Mooncrs4RomDesc[] = { - { "mooncrs4.7k", 0x01000, 0x5e201041, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mooncrs4.7j", 0x01000, 0x8de07c8e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mooncrs4.7h", 0x01000, 0x888c6d61, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mooncrs4.7f", 0x01000, 0x492f9b01, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mooncrs4.1h", 0x01000, 0xf508a7a5, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mooncrs4.1k", 0x01000, 0x9b549313, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrs4) -STD_ROM_FN(Mooncrs4) - -static struct BurnRomInfo FantaziaRomDesc[] = { - { "f01.bin", 0x00800, 0xd3e23863, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f02.bin", 0x00800, 0x63fa4149, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f03.bin", 0x00800, 0x29a2b0ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f04.bin", 0x00800, 0x4c6a5a6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f09.bin", 0x00800, 0x75fd5ca1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f10.bin", 0x00800, 0xe4da2dd4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f11.bin", 0x00800, 0x42869646, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f12.bin", 0x00800, 0xa48d7fb0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "1h_1_10.bin", 0x00800, 0x528da705, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "1k_1_11.bin", 0x00800, 0x4e79ff6b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "fantazia.clr", 0x00020, 0xa84ff0af, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Fantazia) -STD_ROM_FN(Fantazia) - -static struct BurnRomInfo EagleRomDesc[] = { - { "e1", 0x00800, 0x224c9526, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e2", 0x00800, 0xcc538ebd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f03.bin", 0x00800, 0x29a2b0ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f04.bin", 0x00800, 0x4c6a5a6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e5", 0x00800, 0x06d378a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e6", 0x00800, 0x0dea20d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e7", 0x00800, 0xb45af1e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e8", 0x00800, 0xc437a876, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "e10", 0x00800, 0x40ce58bf, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "e12", 0x00800, 0x628fdeed, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "e9", 0x00800, 0xba664099, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "e11", 0x00800, 0xee4ec5fd, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Eagle) -STD_ROM_FN(Eagle) - -static struct BurnRomInfo Eagle2RomDesc[] = { - { "e1.7f", 0x00800, 0x45aab7a3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e2", 0x00800, 0xcc538ebd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f03.bin", 0x00800, 0x29a2b0ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f04.bin", 0x00800, 0x4c6a5a6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e5", 0x00800, 0x06d378a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e6.6", 0x00800, 0x9f09f8c6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e7", 0x00800, 0xb45af1e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e8", 0x00800, 0xc437a876, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "e10.2", 0x00800, 0x25b38ebd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "e12", 0x00800, 0x628fdeed, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "e9", 0x00800, 0xba664099, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "e11", 0x00800, 0xee4ec5fd, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Eagle2) -STD_ROM_FN(Eagle2) - -static struct BurnRomInfo Eagle3RomDesc[] = { - { "e1", 0x00800, 0x224c9526, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e2", 0x00800, 0xcc538ebd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f03.bin", 0x00800, 0x29a2b0ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f04.bin", 0x00800, 0x4c6a5a6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e5", 0x00800, 0x06d378a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e6", 0x00800, 0x0dea20d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e7", 0x00800, 0xb45af1e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e8", 0x00800, 0xc437a876, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "e10a", 0x00800, 0xe3c63d4c, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "e12", 0x00800, 0x628fdeed, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "e9a", 0x00800, 0x59429e47, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "e11", 0x00800, 0xee4ec5fd, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Eagle3) -STD_ROM_FN(Eagle3) - -static struct BurnRomInfo SpctbirdRomDesc[] = { - { "tssa-7f", 0x00800, 0x45aab7a3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tssa-7h", 0x00800, 0x8b328f48, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tssa-7k", 0x00800, 0x29a2b0ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tssa-7m", 0x00800, 0x99c9166d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tssa-5", 0x00800, 0x797b6261, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tssa-6", 0x00800, 0x4825692c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tssa-7", 0x00800, 0xb45af1e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tssa-8", 0x00800, 0xc9b77b85, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "tssb-2", 0x00800, 0x7d23e1f2, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tssb-4", 0x00800, 0xe4977833, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tssb-1", 0x00800, 0x9b9267c3, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tssb-3", 0x00800, 0x5ca5e233, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Spctbird) -STD_ROM_FN(Spctbird) - -static struct BurnRomInfo SmooncrsRomDesc[] = { - { "927", 0x00800, 0x55c5b994, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "928a", 0x00800, 0x77ae26d3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "929", 0x00800, 0x716eaa10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "930", 0x00800, 0xcea864f2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "931", 0x00800, 0x702c5f51, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "932a", 0x00800, 0xe6a2039f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "933", 0x00800, 0x73783cee, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "934", 0x00800, 0xc1a14aa2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr203", 0x00800, 0xbe26b561, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr202", 0x00800, 0x26c7e800, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Smooncrs) -STD_ROM_FN(Smooncrs) - -static struct BurnRomInfo MooncrstsoRomDesc[] = { - { "1.BIN", 0x00800, 0x0357ab1a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.BIN", 0x00800, 0xcf6e78f5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.BIN", 0x00800, 0x716eaa10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.BIN", 0x00800, 0xcea864f2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.BIN", 0x00800, 0x32cd9adc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.BIN", 0x00800, 0xf0230048, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7.BIN", 0x00800, 0x73783cee, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.BIN", 0x00800, 0x1644965a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - // missing, assuming 'super moon cresta' gfx - { "epr203", 0x00800, 0xbe26b561, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr202", 0x00800, 0x26c7e800, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrstso) -STD_ROM_FN(Mooncrstso) - -static struct BurnRomInfo MooncptcRomDesc[] = { - { "mc1.bin", 0x00800, 0x16f17cd5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc2.bin", 0x00800, 0xe2128805, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc3.bin", 0x00800, 0x716eaa10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc4.bin", 0x00800, 0xbd45cd8f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc5.bin", 0x00800, 0x9a1e0528, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc6.bin", 0x00800, 0xf0230048, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc7.bin", 0x00800, 0xeafd4d02, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mc8.bin", 0x00800, 0xccee32f8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mc12.bin", 0x00800, 0x528da705, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mc14.bin", 0x00800, 0x5a4b17ea, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mc11.bin", 0x00800, 0x4e79ff6b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mc13.bin", 0x00800, 0xe0edccbd, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncptc) -STD_ROM_FN(Mooncptc) - -static struct BurnRomInfo SstarcrsRomDesc[] = { - { "ss1", 0x00800, 0x2ff72897, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ss2", 0x00800, 0x565e7880, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ss3", 0x00800, 0xa1939def, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ss4", 0x00800, 0xa332e012, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ss5", 0x00800, 0xb9e58453, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ss6", 0x00800, 0x7cbb5bc8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ss7", 0x00800, 0x57713b91, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ss8", 0x00800, 0xc857e898, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ss10", 0x00800, 0x2a95b8ea, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ss12", 0x00800, 0xb92c4c30, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ss9", 0x00800, 0x3661e084, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ss11", 0x00800, 0x95613048, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Sstarcrs) -STD_ROM_FN(Sstarcrs) - -static struct BurnRomInfo MooncmwRomDesc[] = { - { "60.1x", 0x00800, 0x322859e6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "61.2x", 0x00800, 0xc249902d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "62.3x", 0x00800, 0x29a2b0ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "63.4x", 0x00800, 0x4c6a5a6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "64.5x", 0x00800, 0x06d378a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "65.6x", 0x00800, 0x6e84a927, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "66.7x", 0x00800, 0xf23cd8ce, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "67.8x", 0x00800, 0x66da55d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "68.1h", 0x01000, 0x78663d86, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "69.1k", 0x01000, 0x162c50d3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom-sn74s288n-71.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncmw) -STD_ROM_FN(Mooncmw) - -static struct BurnRomInfo StarfgmcRomDesc[] = { - { "sei-sf-a2.bin", 0x00800, 0x322859e6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sei-sf-a1.bin", 0x00800, 0x7fed0654, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sei-sf-b2.bin", 0x00800, 0x935f7435, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sei-sf-c1.bin", 0x00800, 0x29d54869, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sei-sf-d1.bin", 0x00800, 0x9126cca6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sei-sf-e2.bin", 0x00800, 0x9d394261, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sei-sf-f2.bin", 0x00800, 0x94f161dd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "sei-sf-f1.bin", 0x00800, 0x6ced7f80, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "sei-sf-jh2.bin", 0x00800, 0x8edba3cd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sei-sf-jh3.bin", 0x00800, 0xf5a871a9, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sei-sf-lk2.bin", 0x00800, 0x44b0f06a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "sei-sf-lk3.bin", 0x00800, 0x773b1ee6, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom-sn74s288n-71.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Starfgmc) -STD_ROM_FN(Starfgmc) - -static struct BurnRomInfo SpcdragRomDesc[] = { - { "a.bin", 0x00800, 0x38cc9839, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b.bin", 0x00800, 0x419fa8d6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "c.bin", 0x00800, 0xa1939def, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "d.bin", 0x00800, 0xcbcf17c5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "em.bin", 0x00800, 0xeb81c19c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "fm.bin", 0x00800, 0x757b7672, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g.bin", 0x00800, 0x57713b91, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "h.bin", 0x00800, 0x159ad847, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "203.bin", 0x00800, 0xa2e82527, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "172.bin", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "202.bin", 0x00800, 0x80c3ad74, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "171.bin", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Spcdrag) -STD_ROM_FN(Spcdrag) - -static struct BurnRomInfo SpcdragaRomDesc[] = { - { "1.7g", 0x00800, 0x38cc9839, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.7g", 0x00800, 0x29e00ae4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.7g", 0x00800, 0xa1939def, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.7g", 0x00800, 0x068f8830, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.10g", 0x00800, 0x32cd9adc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.10g", 0x00800, 0x50db67c5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7.10g", 0x00800, 0x22415271, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.10g", 0x00800, 0x159ad847, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "a2.7a", 0x00800, 0x38b042dd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "a4.7a", 0x00800, 0x5a4b17ea, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "a1.9a", 0x00800, 0x24441ab3, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "a3.9a", 0x00800, 0xe0edccbd, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom_6331.10f", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Spcdraga) -STD_ROM_FN(Spcdraga) - -static struct BurnRomInfo MooncregRomDesc[] = { - { "eg1", 0x00800, 0xa67ca4af, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "eg2", 0x00800, 0xb57b140e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "eg3", 0x00800, 0xa1939def, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "eg4", 0x00800, 0x068f8830, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "eg5", 0x00800, 0x32cd9adc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "eg6", 0x00800, 0x3a4b62d9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "eg7", 0x00800, 0x22415271, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "eg8", 0x00800, 0x7b9cc105, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "eg_2b", 0x00800, 0xfb0f1f81, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "eg_4b", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "eg_1b", 0x00800, 0x631ebb5a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "eg_3b", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom_6331.10f", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncreg) -STD_ROM_FN(Mooncreg) - -static struct BurnRomInfo MooncrslRomDesc[] = { - { "01.bin", 0x00800, 0xa67ca4af, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "02.bin", 0x00800, 0x16edce3e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "03.bin", 0x00800, 0xa1939def, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "04.bin", 0x00800, 0x068f8830, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "05.bin", 0x00800, 0x28ae612d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "06.bin", 0x00800, 0x803da987, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "07.bin", 0x00800, 0x8e9ac0fc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "08.bin", 0x00800, 0x020a8e2f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mcs_b", 0x00800, 0xfb0f1f81, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_d", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_a", 0x00800, 0x631ebb5a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mcs_c", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrsl) -STD_ROM_FN(Mooncrsl) - -static struct BurnRomInfo SteraRomDesc[] = { - { "stera.1", 0x00800, 0xcd04fea8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "stera.2", 0x00800, 0xccd1878e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "stera.3", 0x00800, 0x29a2b0ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "stera.4", 0x00800, 0x4c6a5a6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "stera.5", 0x00800, 0x06d378a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "stera.6", 0x00800, 0x6e84a927, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "stera.7", 0x00800, 0xb45af1e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "stera.8", 0x00800, 0x37f19956, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "stera.10", 0x00800, 0x528da705, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "stera.12", 0x00800, 0x13932a15, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "stera.11", 0x00800, 0x4e79ff6b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "stera.9", 0x00800, 0x24cfd145, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "stera.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Stera) -STD_ROM_FN(Stera) - -static struct BurnRomInfo MooncrgxRomDesc[] = { - { "1", 0x00800, 0x84cf420b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2", 0x00800, 0x4c2a61a1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3", 0x00800, 0x1962523a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4", 0x00800, 0x75dca896, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5", 0x00800, 0x32483039, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6", 0x00800, 0x43f2ab89, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7", 0x00800, 0x1e9c168c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8", 0x00800, 0x5e09da94, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "1h_1_10.bin", 0x00800, 0x528da705, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "12.chr", 0x00800, 0x5a4b17ea, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "9.chr", 0x00800, 0x70df525c, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "11.chr", 0x00800, 0xe0edccbd, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mooncrgx) -STD_ROM_FN(Mooncrgx) - -static struct BurnRomInfo MoonqsrRomDesc[] = { - { "mq1", 0x00800, 0x132c13ec, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mq2", 0x00800, 0xc8eb74f1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mq3", 0x00800, 0x33965a89, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mq4", 0x00800, 0xa3861d17, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mq5", 0x00800, 0x8bcf9c67, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mq6", 0x00800, 0x5750cda9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mq7", 0x00800, 0x78d7fe5b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mq8", 0x00800, 0x4919eed5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mqb", 0x00800, 0xb55ec806, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mqd", 0x00800, 0x9e7d0e13, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mqa", 0x00800, 0x66eee0db, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mqc", 0x00800, 0xa6db5b0d, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "vid_e6.bin", 0x00020, 0x0b878b54, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Moonqsr) -STD_ROM_FN(Moonqsr) - -static struct BurnRomInfo Moonal2RomDesc[] = { - { "ali1", 0x00400, 0x0dcecab4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali2", 0x00400, 0xc6ee75a7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali3", 0x00400, 0xcd1be7e9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali4", 0x00400, 0x83b03f08, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali5", 0x00400, 0x6f3cf61d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali6", 0x00400, 0xe169d432, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali7", 0x00400, 0x41f64b73, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali8", 0x00400, 0xf72ee876, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali9", 0x00400, 0xb7fb763c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali10", 0x00400, 0xb1059179, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali11", 0x00400, 0x9e79a1c6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ali13.1h", 0x00800, 0xa1287bf6, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ali12.1k", 0x00800, 0x528f1481, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bpr", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Moonal2) -STD_ROM_FN(Moonal2) - -static struct BurnRomInfo Moonal2bRomDesc[] = { - { "md-1.a", 0x00800, 0xd41fd873, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "md-2.b", 0x00800, 0x8318b187, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "md-3.d", 0x00800, 0xb2170d3b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "md-4.g", 0x00800, 0xbaa4d0bf, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "md-5.h", 0x00800, 0x61afb53c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "md-6.f", 0x00800, 0x9cc973e0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "md-13.h1", 0x00800, 0xa1287bf6, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "md-12.k1", 0x00800, 0x528f1481, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6331.l6", 0x00020, 0xc3ac9467, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Moonal2b) -STD_ROM_FN(Moonal2b) - -static struct BurnRomInfo ThepitmRomDesc[] = { - { "1.bin", 0x00800, 0x0f78d6ea, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.bin", 0x00800, 0xebacc6eb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.bin", 0x00800, 0x14fd0706, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.bin", 0x00800, 0x613e920f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.bin", 0x00800, 0x5a791f3f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.bin", 0x00800, 0x0bb37f51, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7.bin", 0x00800, 0x4dfdec6f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.bin", 0x00800, 0xa39a9189, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "9.bin", 0x00800, 0x2eb90e07, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "1h.bin", 0x00800, 0x00dce65f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "1k.bin", 0x00800, 0x3ec0056e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6l.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Thepitm) -STD_ROM_FN(Thepitm) - -void __fastcall MooncrgxZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5800 && a <= 0x58ff) { - INT32 Offset = a - 0x5800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: - case 0x6001: - case 0x6002: { - GalGfxBank[a - 0x6000] = d; - return; - } - - case 0x6003: { - // coin_count_0_w - return; - } - - case 0x6004: - case 0x6005: - case 0x6006: - case 0x6007: { - GalaxianLfoFreqWrite(a - 0x6004, d); - return; - } - - case 0x6800: - case 0x6801: - case 0x6802: - case 0x6803: - case 0x6804: - case 0x6805: - case 0x6806: - case 0x6807: { - GalaxianSoundWrite(a - 0x6800, d); - return; - } - - case 0x7001: { - GalIrqFire = d & 1; - return; - } - - case 0x7004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x7006: { - GalFlipScreenX = d & 1; - return; - } - - case 0x7007: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall MoonqsrZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: { - GalGfxBank[a - 0xa000] = d; - return; - } - - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: { - GalaxianLfoFreqWrite(a - 0xa004, d); - return; - } - - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: - case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb000: { - GalIrqFire = d & 1; - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - } - - bprintf(PRINT_NORMAL, _T("Prog Write %x, %x\n"), a, d); -} - -void __fastcall ThepitmZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: { - GalGfxBank[a - 0xa000] = d; - return; - } - - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: { - GalaxianLfoFreqWrite(a - 0xa004, d); - return; - } - - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: - case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb001: { - GalIrqFire = d & 1; - return; - } - - case 0xb004: { - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static void Mooncrs2RearrangeGfx() -{ - UINT8* TempRom = (UINT8*)BurnMalloc(0x800); - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - BurnLoadRom(GalTempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 2, 1); - BurnLoadRom(TempRom, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - memcpy(GalTempRom + 0x0800, TempRom + 0x0000, 0x200); - memcpy(GalTempRom + 0x0c00, TempRom + 0x0200, 0x200); - memcpy(GalTempRom + 0x0a00, TempRom + 0x0400, 0x200); - memcpy(GalTempRom + 0x0e00, TempRom + 0x0600, 0x200); - BurnLoadRom(TempRom, GAL_ROM_OFFSET_TILES_SHARED + 3, 1); - memcpy(GalTempRom + 0x1800, TempRom + 0x0000, 0x200); - memcpy(GalTempRom + 0x1c00, TempRom + 0x0200, 0x200); - memcpy(GalTempRom + 0x1a00, TempRom + 0x0400, 0x200); - memcpy(GalTempRom + 0x1e00, TempRom + 0x0600, 0x200); - BurnFree(TempRom); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); -} - -static INT32 Mooncrs2Init() -{ - GalPostLoadCallbackFunction = MapMooncrst; - - INT32 nRet = GalInit(); - - Mooncrs2RearrangeGfx(); - - GalExtendTileInfoFunction = MooncrstExtendTileInfo; - GalExtendSpriteInfoFunction = MooncrstExtendSpriteInfo; - - return nRet; -} - -static void Mooncrs3PostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(GalZ80Rom1Size); - memcpy(GalTempRom, GalZ80Rom1, GalZ80Rom1Size); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0000, 0x800); - memcpy(GalZ80Rom1 + 0x2000, GalTempRom + 0x0800, 0x800); - memcpy(GalZ80Rom1 + 0x0800, GalTempRom + 0x1000, 0x800); - memcpy(GalZ80Rom1 + 0x2800, GalTempRom + 0x1800, 0x800); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x2000, 0x800); - memcpy(GalZ80Rom1 + 0x3000, GalTempRom + 0x2800, 0x800); - memcpy(GalZ80Rom1 + 0x1800, GalTempRom + 0x3000, 0x800); - memcpy(GalZ80Rom1 + 0x3800, GalTempRom + 0x3800, 0x800); - BurnFree(GalTempRom); - - MapMooncrst(); -} - -static INT32 Mooncrs3Init() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = Mooncrs3PostLoad; - - nRet = GalInit(); - - Mooncrs2RearrangeGfx(); - - GalExtendTileInfoFunction = MooncrstExtendTileInfo; - GalExtendSpriteInfoFunction = MooncrstExtendSpriteInfo; - - return nRet; -} - -static INT32 Mooncrs4Init() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapMooncrst; - - nRet = GalInit(); - - UINT8* TempRom = (UINT8*)BurnMalloc(0x1000); - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(TempRom, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - memcpy(GalTempRom + 0x0800, TempRom + 0x0000, 0x200); - memcpy(GalTempRom + 0x0c00, TempRom + 0x0200, 0x200); - memcpy(GalTempRom + 0x0a00, TempRom + 0x0400, 0x200); - memcpy(GalTempRom + 0x0e00, TempRom + 0x0600, 0x200); - memcpy(GalTempRom + 0x0000, TempRom + 0x0800, 0x800); - BurnLoadRom(TempRom, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - memcpy(GalTempRom + 0x1800, TempRom + 0x0000, 0x200); - memcpy(GalTempRom + 0x1c00, TempRom + 0x0200, 0x200); - memcpy(GalTempRom + 0x1a00, TempRom + 0x0400, 0x200); - memcpy(GalTempRom + 0x1e00, TempRom + 0x0600, 0x200); - memcpy(GalTempRom + 0x1000, TempRom + 0x0800, 0x800); - BurnFree(TempRom); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - GalExtendTileInfoFunction = MooncrstExtendTileInfo; - GalExtendSpriteInfoFunction = MooncrstExtendSpriteInfo; - - return nRet; -} - -static void MooncrgxInstallHandler() -{ - ZetOpen(0); - ZetSetWriteHandler(MooncrgxZ80Write); - ZetClose(); -} - -static INT32 MooncrgxInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MooncrgxInstallHandler; - - nRet = GalInit(); - - GalExtendTileInfoFunction = MooncrstExtendTileInfo; - GalExtendSpriteInfoFunction = MooncrstExtendSpriteInfo; - - return nRet; -} - -static void MoonqsrDecrypt() -{ - for (UINT32 Offset = 0; Offset < GalZ80Rom1Size; Offset++) { - UINT8 Data = GalZ80Rom1[Offset]; - UINT8 Res = Data; - if (BIT(Data, 1)) Res ^= 0x40; - if (BIT(Data, 5)) Res ^= 0x04; - if ((Offset & 1) == 0) Res = BITSWAP08(Res, 7, 2, 5, 4, 3, 6, 1, 0); - GalZ80Rom1Op[Offset] = Res; - } - - MapMooncrst(); - - ZetOpen(0); - ZetSetWriteHandler(MoonqsrZ80Write); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1Op, GalZ80Rom1); - ZetClose(); -} - -static INT32 MoonqsrInit() -{ - INT32 nRet; - - GalZ80Rom1Op = (UINT8*)BurnMalloc(0x4000); - - GalPostLoadCallbackFunction = MoonqsrDecrypt; - - nRet = GalInit(); - - GalExtendTileInfoFunction = MoonqsrExtendTileInfo; - GalExtendSpriteInfoFunction = MoonqsrExtendSpriteInfo; - - return nRet; -} - -static INT32 Moonal2Init() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapMooncrst; - - nRet = GalInit(); - - return nRet; -} - -static void ThepitmPostLoad() -{ - MapMooncrst(); - - ZetOpen(0); - ZetMapArea(0x0000, 0x47ff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x47ff, 2, GalZ80Rom1); - ZetSetWriteHandler(ThepitmZ80Write); - ZetClose(); -} - -static INT32 ThepitmInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = ThepitmPostLoad; - - nRet = GalInit(); - - GalExtendTileInfoFunction = MooncrstExtendTileInfo; - GalExtendSpriteInfoFunction = MooncrstExtendSpriteInfo; - - return nRet; -} - -struct BurnDriver BurnDrvMooncrsb = { - "mooncrsb", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (bootleg set 1)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrsbRomInfo, MooncrsbRomName, NULL, NULL, OmegabInputInfo, MooncrsaDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrs2 = { - "mooncrs2", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (bootleg set 2)\0", NULL, "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Mooncrs2RomInfo, Mooncrs2RomName, NULL, NULL, OmegabInputInfo, MooncrsaDIPInfo, - Mooncrs2Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrs3 = { - "mooncrs3", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (bootleg set 3)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Mooncrs3RomInfo, Mooncrs3RomName, NULL, NULL, OmegabInputInfo, MooncrstDIPInfo, - Mooncrs3Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrs4 = { - "mooncrs4", "mooncrst", NULL, NULL, "1980", - "Moon Crest\0", NULL, "SG-Florence", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Mooncrs4RomInfo, Mooncrs4RomName, NULL, NULL, OmegabInputInfo, MooncrstDIPInfo, - Mooncrs4Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFantazia = { - "fantazia", "mooncrst", NULL, NULL, "1980", - "Fantazia (bootleg?)\0", NULL, "SubElectro", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, FantaziaRomInfo, FantaziaRomName, NULL, NULL, OmegabInputInfo, FantaziaDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvEagle = { - "eagle", "mooncrst", NULL, NULL, "1980", - "Eagle (set 1)\0", NULL, "Centuri", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, EagleRomInfo, EagleRomName, NULL, NULL, OmegabInputInfo, MooncrsaDIPInfo, - Mooncrs2Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvEagle2 = { - "eagle2", "mooncrst", NULL, NULL, "1980", - "Eagle (set 2)\0", NULL, "Centuri", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Eagle2RomInfo, Eagle2RomName, NULL, NULL, OmegabInputInfo, Eagle2DIPInfo, - Mooncrs2Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvEagle3 = { - "eagle3", "mooncrst", NULL, NULL, "1980", - "Eagle (set 3)\0", NULL, "Nichibutsu (Centuri license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Eagle3RomInfo, Eagle3RomName, NULL, NULL, OmegabInputInfo, MooncrsaDIPInfo, - Mooncrs2Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSpctbird = { - "spctbird", "mooncrst", NULL, NULL, "1981?", - "Space Thunderbird\0", NULL, "bootleg? (Fortrek)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SpctbirdRomInfo, SpctbirdRomName, NULL, NULL, OmegabInputInfo, Eagle2DIPInfo, - Mooncrs2Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSmooncrs = { - "smooncrs", "mooncrst", NULL, NULL, "1981?", - "Super Moon Cresta\0", NULL, "Nichibutsu (Gremlin license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SmooncrsRomInfo, SmooncrsRomName, NULL, NULL, SmooncrsInputInfo, SmooncrsDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrstso = { - "mooncrstso", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (SegaSA / Sonic)\0", NULL, "Nichibutsu (Sonic license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrstsoRomInfo, MooncrstsoRomName, NULL, NULL, OmegabInputInfo, MooncptcDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncptc = { - "mooncptc", "mooncrst", NULL, NULL, "1980?", - "Moon Cresta (Petaco S.A. Spanish bootleg)\0", NULL, "bootleg (Petaco S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncptcRomInfo, MooncptcRomName, NULL, NULL, SmooncrsInputInfo, MooncptcDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSstarcrs = { - "sstarcrs", "mooncrst", NULL, NULL, "1980?", - "Super Star Crest\0", NULL, "Nichibutsu (Taito do Brasil license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SstarcrsRomInfo, SstarcrsRomName, NULL, NULL, OmegabInputInfo, MooncrsgDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncmw = { - "mooncmw", "mooncrst", NULL, NULL, "198?", - "Moon War (Moon Cresta bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncmwRomInfo, MooncmwRomName, NULL, NULL, OmegabInputInfo, MooncrsaDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvStarfgmc = { - "starfgmc", "mooncrst", NULL, NULL, "198?", - "Star Fighter (Moon Cresta bootleg)\0", NULL, "bootleg (Samyra Engineering)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, StarfgmcRomInfo, StarfgmcRomName, NULL, NULL, OmegabInputInfo, MooncrsaDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSpcdrag = { - "spcdrag", "mooncrst", NULL, NULL, "1980", - "Space Dragon (Moon Cresta bootleg, set 1)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SpcdragRomInfo, SpcdragRomName, NULL, NULL, SmooncrsInputInfo, SmooncrsDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSpcdraga = { - "spcdraga", "mooncrst", NULL, NULL, "1980", - "Space Dragon (Moon Cresta bootleg, set 2)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SpcdragaRomInfo, SpcdragaRomName, NULL, NULL, SmooncrsInputInfo, SmooncrsDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncreg = { - "mooncreg", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (Electrogame S.A. Spanish bootleg)\0", NULL, "bootleg (Electrogame S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncregRomInfo, MooncregRomName, NULL, NULL, OmegabInputInfo, MooncregDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrsl = { - "mooncrsl", "mooncrst", NULL, NULL, "1980", - "Cresta Mundo (Laguna S.A. Spanish Moon Cresta bootleg)\0", NULL, "bootleg (Laguna S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrslRomInfo, MooncrslRomName, NULL, NULL, OmegabInputInfo, MooncrslDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvStera = { - "stera", "mooncrst", NULL, NULL, "1980", - "Steraranger (Moon Cresta bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SteraRomInfo, SteraRomName, NULL, NULL, SmooncrsInputInfo, SmooncrsDIPInfo, - MooncrstInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMooncrgx = { - "mooncrgx", "mooncrst", NULL, NULL, "1980", - "Moon Cresta (Galaxian hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MooncrgxRomInfo, MooncrgxRomName, NULL, NULL, OmegabInputInfo, MooncrgxDIPInfo, - MooncrgxInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMoonqsr = { - "moonqsr", NULL, NULL, NULL, "1980", - "Moon Quasar\0", NULL, "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MoonqsrRomInfo, MoonqsrRomName, NULL, NULL, OmegabInputInfo, MoonqsrDIPInfo, - MoonqsrInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMoonal2 = { - "moonal2", NULL, NULL, NULL, "1980", - "Moon Alien Part 2\0", NULL, "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Moonal2RomInfo, Moonal2RomName, NULL, NULL, GalaxianInputInfo, Moonal2DIPInfo, - Moonal2Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMoonal2b = { - "moonal2b", "moonal2", NULL, NULL, "1980", - "Moon Alien Part 2 (older version)\0", NULL, "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Moonal2bRomInfo, Moonal2bRomName, NULL, NULL, GalaxianInputInfo, Moonal2DIPInfo, - Moonal2Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvThepitm = { - "thepitm", "thepit", NULL, NULL, "198?", - "The Pit (bootleg on Moon Quasar hardware)\0", NULL, "bootleg (KZH)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, ThepitmRomInfo, ThepitmRomName, NULL, NULL, ThepitmInputInfo, ThepitmDIPInfo, - ThepitmInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Other games on basic Moon Cresta hardware -static struct BurnRomInfo SkybaseRomDesc[] = { - { "skybase.9a", 0x01000, 0x845b87a5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "skybase.8a", 0x01000, 0x096785c2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "skybase.7a", 0x01000, 0xd50c715b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "skybase.6a", 0x01000, 0xf57edb27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "skybase.5a", 0x01000, 0x50365d95, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "skybase.4a", 0x01000, 0xcbd6647f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "skybase.7t", 0x01000, 0x9b471686, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "skybase.8t", 0x01000, 0x1cf723da, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "skybase.10t", 0x01000, 0xfe02e72c, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "skybase.9t", 0x01000, 0x0871291f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.bpr", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Skybase) -STD_ROM_FN(Skybase) - -static struct BurnRomInfo BagmanmcRomDesc[] = { - { "b1.bin", 0x01000, 0xb74c75ee, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b2.bin", 0x01000, 0xa7d99916, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b3.bin", 0x01000, 0xc78f5360, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b4.bin", 0x01000, 0xeebd3bd1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b5.bin", 0x01000, 0x0fe24b8c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b6.bin", 0x01000, 0xf50390e7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "g1-l.bin", 0x00800, 0x2ae6b5ab, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g2-u.bin", 0x01000, 0xa2790089, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g2-l.bin", 0x00800, 0x98b37397, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g1-u.bin", 0x01000, 0xb63cfae4, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "bagmanmc.clr", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Bagmanmc) -STD_ROM_FN(Bagmanmc) - -static struct BurnRomInfo Bagmanm2RomDesc[] = { - { "bagmanm2.1", 0x02000, 0x53769ebe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bagmanm2.2", 0x02000, 0x9435bb87, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bagmanm2.3", 0x02000, 0xf37ba7f6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "bagmanm2.9", 0x02000, 0xf1e70d9e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "bagmanm2.7", 0x02000, 0x777e48c4, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "bagmanmc.clr", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Bagmanm2) -STD_ROM_FN(Bagmanm2) - -static struct BurnRomInfo DkongjrmRomDesc[] = { - { "a1", 0x01000, 0x299486e9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "a2", 0x01000, 0xa74a193b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b2", 0x01000, 0x7bc4f236, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "c1", 0x01000, 0x0f594c21, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "d1", 0x01000, 0xcf7d7296, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "e2", 0x01000, 0xf7528a52, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f1", 0x01000, 0x9b1d4cc5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "v_3pa.bin", 0x01000, 0x4974ffef, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "a2.gfx", 0x01000, 0x51845eaf, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "v_3na.bin", 0x01000, 0xa95c4c63, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "b2.gfx", 0x01000, 0x7b39c3d0, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "hustler.clr", 0x00020, 0xaa1f7f5e, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Dkongjrm) -STD_ROM_FN(Dkongjrm) - -static struct BurnRomInfo VpoolRomDesc[] = { - { "vidpool1.bin", 0x01000, 0x333f4732, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vidpool2.bin", 0x01000, 0xeea6c0f1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vidpool3.bin", 0x01000, 0x309972a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vidpool4.bin", 0x01000, 0xc4f71c1d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "hustler.5f", 0x00800, 0x0bdfad0e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "hustler.5h", 0x00800, 0x8e062177, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "hustler.clr", 0x00020, 0xaa1f7f5e, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Vpool) -STD_ROM_FN(Vpool) - -static struct BurnRomInfo CkonggRomDesc[] = { - { "g_ck1.bin", 0x01000, 0xa4323b94, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ck2.bin", 0x01000, 0x1e532996, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g_ck3.bin", 0x01000, 0x65157cde, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g_ck4.bin", 0x01000, 0x43827bc6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g_ck5.bin", 0x01000, 0xa74ed96e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g_ck7.bin", 0x00800, 0x2c4d8129, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ckvid10.bin", 0x01000, 0x7866d2cb, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ckvid7.bin", 0x01000, 0x7311a101, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "ck_cp.bin", 0x00020, 0x7e0b79cb, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Ckongg) -STD_ROM_FN(Ckongg) - -static struct BurnRomInfo CkongmcRomDesc[] = { - { "kc1.bin", 0x01000, 0xa87fc828, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "kc2.bin", 0x01000, 0x94a13dec, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "kc3.bin", 0x01000, 0x5efc6705, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "kc4.bin", 0x01000, 0xac917d66, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "kc5.bin", 0x00800, 0x5a9ee1ed, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "kc6.bin", 0x00800, 0xf787431e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "kc7.bin", 0x00800, 0x7a185e31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "kc8carat.bin", 0x01000, 0x7866d2cb, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "kc9carat.bin", 0x01000, 0x7311a101, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "ck_cp.bin", 0x00020, 0x7e0b79cb, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Ckongmc) -STD_ROM_FN(Ckongmc) - -static struct BurnRomInfo PorterRomDesc[] = { - { "port1.bin", 0x01000, 0xbabaf7fe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "port2.bin", 0x01000, 0x8f7eb0e3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "port3.bin", 0x01000, 0x683939b5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "port4.bin", 0x01000, 0x6a65d58d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "port5.bin", 0x00800, 0x2978a9aa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "port6.bin", 0x00800, 0x7ecdffb5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "port7.bin", 0x01000, 0x603294f9, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "port8.bin", 0x01000, 0xb66a763d, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.6l", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Porter) -STD_ROM_FN(Porter) - -static struct BurnRomInfo KongRomDesc[] = { - { "1", 0x01000, 0xa206beb5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2", 0x01000, 0xd75597b6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3", 0x01000, 0x54e0b87b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4", 0x01000, 0x356c4ca2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5", 0x01000, 0x2d295976, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6", 0x01000, 0x77131cca, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7", 0x01000, 0x3d5ec3f1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8", 0x01000, 0x015fe5e5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "9", 0x00800, 0xfe42a052, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "11", 0x00800, 0xad2b2cdd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "10", 0x00800, 0x91fa187e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "12", 0x00800, 0xb74724df, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom", 0x00020, 0x00000000, BRF_OPT | BRF_NODUMP }, - - { "13", 0x01000, 0x7d33ca0a, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Kong) -STD_ROM_FN(Kong) - -static struct BurnRomInfo FantastcRomDesc[] = { - { "f1", 0x01000, 0x8019f0b7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f2", 0x01000, 0x988a9bc6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f3", 0x01000, 0xa3c0cc0b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f4", 0x01000, 0xc1361be8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f5", 0x01000, 0x6787e93f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f6", 0x01000, 0x597029ae, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f7", 0x01000, 0x8de08d9a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "f8", 0x01000, 0x489e2fb7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "37", 0x01000, 0x3a54f749, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "38", 0x01000, 0x88b71264, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom-74g138", 0x00020, 0x800f5718, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Fantastc) -STD_ROM_FN(Fantastc) - -static struct BurnRomInfo TimefgtrRomDesc[] = { - { "tp01", 0x01000, 0xba8b3e70, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tp02", 0x01000, 0x796158c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tp03", 0x01000, 0xfe6a1c98, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tp04", 0x01000, 0xeff73185, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tp05", 0x01000, 0x85023e4a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tp06", 0x01000, 0xb6b8aaf9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "tp07", 0x01000, 0x5f57342c, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tp09", 0x01000, 0x636fd772, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tp08", 0x01000, 0x2dc3c48b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tp10", 0x01000, 0xb27b450c, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom", 0x00020, 0x00000000, BRF_GRA | BRF_NODUMP }, -}; - -STD_ROM_PICK(Timefgtr) -STD_ROM_FN(Timefgtr) - -UINT8 __fastcall BagmanmcZ80Read(UINT16 a) -{ - switch (a) { - case 0xa000: { - return GalInput[0] | GalDip[0]; - } - - case 0xa800: { - return GalInput[1] | GalDip[1]; - } - - case 0xb000: { - return GalInput[2] | GalDip[2]; - } - - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall BagmanmcZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: { - // ??? - return; - } - - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: { - GalaxianLfoFreqWrite(a - 0xa004, d); - return; - } - - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: - case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb001: { - GalIrqFire = d & 1; - return; - } - - case 0xb002: { - GalGfxBank[0] = d; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall DkongjrmZ80Read(UINT16 a) -{ - if (a >= 0xa000 && a <= 0xa0ff) { - return GalInput[0] | GalDip[0]; - } - - if (a >= 0xa800 && a <= 0xa8ff) { - return GalInput[1] | GalDip[1]; - } - - if (a >= 0xb000 && a <= 0xb0ff) { - return GalInput[2] | GalDip[2]; - } - - switch (a) { - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall DkongjrmZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: { - GalaxianLfoFreqWrite(a - 0xa004, d); - return; - } - - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: -// case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb000: { - GalGfxBank[0] = d; - return; - } - - case 0xb001: { - GalIrqFire = d & 1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall CkonggZ80Read(UINT16 a) -{ - switch (a) { - case 0xc000: { - return GalInput[0] | GalDip[0]; - } - - case 0xc400: { - return GalInput[1] | GalDip[1]; - } - - case 0xc800: { - return GalInput[2] | GalDip[2]; - } - - case 0xcc00: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall CkonggZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xc400: - case 0xc401: - case 0xc402: - case 0xc403: - case 0xc404: - case 0xc405: - case 0xc406: - case 0xc407: { - GalaxianSoundWrite(a - 0xc400, d); - return; - } - - case 0xc801: { - GalIrqFire = d & 1; - return; - } - - case 0xc804: { - // link apparently cut - return; - } - - case 0xc806: { - GalFlipScreenX = d & 1; - return; - } - - case 0xc807: { - GalFlipScreenY = d & 1; - return; - } - - case 0xcc00: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall CkongmcZ80Read(UINT16 a) -{ - switch (a) { - case 0xa000: { - return GalInput[0] | GalDip[0]; - } - - case 0xa800: { - return GalInput[1] | GalDip[1]; - } - - case 0xb000: { - return GalInput[2] | GalDip[2]; - } - - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall CkongmcZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: - case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb001: { - GalIrqFire = d & 1; - return; - } - - case 0xc806: { - GalFlipScreenX = d & 1; - return; - } - - case 0xc807: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall FantastcZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0x9900 && a <= 0xafff) { - // ??? - return; - } - - if (a >= 0xb001 && a <= 0xd7ff) { - // ??? - return; - } - - switch (a) { - case 0x8803: { - AY8910Write(0, 0, d); - return; - } - - case 0x880b: { - AY8910Write(0, 1, d); - return; - } - - case 0x880c: { - AY8910Write(1, 0, d); - return; - } - - case 0x880e: { - AY8910Write(1, 1, d); - return; - } - - case 0xb000: { - GalIrqFire = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall TimefgtrZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x9bff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0xfff8) { - // ??? - return; - } - - switch (a) { - case 0x8803: { - AY8910Write(0, 0, d); - return; - } - - case 0x880b: { - AY8910Write(0, 1, d); - return; - } - - case 0x880c: { - AY8910Write(1, 0, d); - return; - } - - case 0x880e: { - AY8910Write(1, 1, d); - return; - } - - case 0xb000: { - GalIrqFire = d & 1; - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb800: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static void SkybaseAlterZ80() -{ - MapMooncrst(); - - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x5fff, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetClose(); -} - -static INT32 SkybaseInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = SkybaseAlterZ80; - - nRet = GalInit(); - - GalExtendTileInfoFunction = SkybaseExtendTileInfo; - GalExtendSpriteInfoFunction = SkybaseExtendSpriteInfo; - - return nRet; -} - -static void BagmanmcPostLoad() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(BagmanmcZ80Read); - ZetSetWriteHandler(BagmanmcZ80Write); - ZetMapArea(0x0000, GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x6000, 0x67ff, 0, GalZ80Ram1); - ZetMapArea(0x6000, 0x67ff, 1, GalZ80Ram1); - ZetMapArea(0x6000, 0x67ff, 2, GalZ80Ram1); - ZetMapArea(0x9000, 0x93ff, 0, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 1, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 2, GalVideoRam); - ZetMapArea(0x9800, 0x98ff, 0, GalSpriteRam); - ZetMapArea(0x9800, 0x98ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 BagmanmcInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = BagmanmcPostLoad; - GameIsBagmanmc = 1; - - nRet = GalInit(); - - GalIrqType = GAL_IRQ_TYPE_IRQ0; - GalExtendTileInfoFunction = BagmanmcExtendTileInfo; - GalExtendSpriteInfoFunction = BagmanmcExtendSpriteInfo; - - return nRet; -} - -static void DkongjrmPostLoad() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(DkongjrmZ80Read); - ZetSetWriteHandler(DkongjrmZ80Write); - ZetMapArea(0x0000, 0x5fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x5fff, 2, GalZ80Rom1); - ZetMapArea(0x6000, 0x6fff, 0, GalZ80Ram1); - ZetMapArea(0x6000, 0x6fff, 1, GalZ80Ram1); - ZetMapArea(0x6000, 0x6fff, 2, GalZ80Ram1); - ZetMapArea(0x7000, 0x7fff, 0, GalZ80Rom1 + 0x6000); - ZetMapArea(0x7000, 0x7fff, 2, GalZ80Rom1 + 0x6000); - ZetMapArea(0x9000, 0x93ff, 0, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 1, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 2, GalVideoRam); - ZetMapArea(0x9800, 0x98ff, 0, GalSpriteRam); - ZetMapArea(0x9800, 0x98ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 DkongjrmInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = DkongjrmPostLoad; - - nRet = GalInit(); - - GalRenderBackgroundFunction = NULL; - GalDrawBulletsFunction = NULL; - GalExtendTileInfoFunction = PiscesExtendTileInfo; - GalExtendSpriteInfoFunction = DkongjrmExtendSpriteInfo; - - GalRenderFrameFunction = DkongjrmRenderFrame; - - return nRet; -} - -static void VpoolPostLoad() -{ - MapMooncrst(); - - GalTempRom = (UINT8*)BurnMalloc(GalZ80Rom1Size); - memcpy(GalTempRom, GalZ80Rom1, GalZ80Rom1Size); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0000, 0x800); - memcpy(GalZ80Rom1 + 0x2000, GalTempRom + 0x0800, 0x800); - memcpy(GalZ80Rom1 + 0x0800, GalTempRom + 0x1000, 0x800); - memcpy(GalZ80Rom1 + 0x2800, GalTempRom + 0x1800, 0x800); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x2000, 0x800); - memcpy(GalZ80Rom1 + 0x3000, GalTempRom + 0x2800, 0x800); - memcpy(GalZ80Rom1 + 0x1800, GalTempRom + 0x3000, 0x800); - memcpy(GalZ80Rom1 + 0x3800, GalTempRom + 0x3800, 0x800); - BurnFree(GalTempRom); - - ZetOpen(0); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetClose(); -} - -static INT32 VpoolInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = VpoolPostLoad; - - nRet = GalInit(); - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void CkonggMapZ80() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(CkonggZ80Read); - ZetSetWriteHandler(CkonggZ80Write); - ZetMapArea(0x0000, 0x57ff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x57ff, 2, GalZ80Rom1); - ZetMapArea(0x6000, 0x6fff, 0, GalZ80Ram1); - ZetMapArea(0x6000, 0x6fff, 1, GalZ80Ram1); - ZetMapArea(0x6000, 0x6fff, 2, GalZ80Ram1); - ZetMapArea(0x9000, 0x93ff, 0, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 1, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 2, GalVideoRam); - ZetMapArea(0x9800, 0x98ff, 0, GalSpriteRam); - ZetMapArea(0x9800, 0x98ff, 2, GalSpriteRam); - ZetClose(); -} - -static void CkonggPostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(GalZ80Rom1Size); - memcpy(GalTempRom, GalZ80Rom1, GalZ80Rom1Size); - memcpy(GalZ80Rom1 + 0x2400, GalTempRom + 0x0000, 0x400); - memcpy(GalZ80Rom1 + 0x1c00, GalTempRom + 0x0400, 0x400); - memcpy(GalZ80Rom1 + 0x4800, GalTempRom + 0x0800, 0x400); - memcpy(GalZ80Rom1 + 0x0c00, GalTempRom + 0x0c00, 0x400); - memcpy(GalZ80Rom1 + 0x4400, GalTempRom + 0x1000, 0x400); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x1400, 0x400); - memcpy(GalZ80Rom1 + 0x1800, GalTempRom + 0x1800, 0x400); - memcpy(GalZ80Rom1 + 0x2800, GalTempRom + 0x1c00, 0x400); - memcpy(GalZ80Rom1 + 0x3400, GalTempRom + 0x2000, 0x400); - memcpy(GalZ80Rom1 + 0x4c00, GalTempRom + 0x2400, 0x400); - memcpy(GalZ80Rom1 + 0x5000, GalTempRom + 0x2800, 0x400); - memcpy(GalZ80Rom1 + 0x0400, GalTempRom + 0x2c00, 0x400); - memcpy(GalZ80Rom1 + 0x2000, GalTempRom + 0x3000, 0x400); - memcpy(GalZ80Rom1 + 0x3800, GalTempRom + 0x3400, 0x400); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x3800, 0x400); - memcpy(GalZ80Rom1 + 0x4000, GalTempRom + 0x3c00, 0x400); - memcpy(GalZ80Rom1 + 0x0800, GalTempRom + 0x4000, 0x400); - memcpy(GalZ80Rom1 + 0x5400, GalTempRom + 0x4400, 0x400); - memcpy(GalZ80Rom1 + 0x2c00, GalTempRom + 0x4800, 0x400); - memcpy(GalZ80Rom1 + 0x1400, GalTempRom + 0x4c00, 0x400); - memcpy(GalZ80Rom1 + 0x3000, GalTempRom + 0x5000, 0x400); - memcpy(GalZ80Rom1 + 0x3c00, GalTempRom + 0x5400, 0x400); - BurnFree(GalTempRom); - - CkonggMapZ80(); -} - -static INT32 CkonggInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = CkonggPostLoad; - - nRet = GalInit(); - - GalExtendSpriteInfoFunction = MshuttleExtendSpriteInfo; - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void CkongmcPostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(0x4000); - memcpy(GalTempRom, GalZ80Rom1, 0x4000); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0000, 0x800); - memcpy(GalZ80Rom1 + 0x2000, GalTempRom + 0x0800, 0x800); - memcpy(GalZ80Rom1 + 0x0800, GalTempRom + 0x1000, 0x800); - memcpy(GalZ80Rom1 + 0x2800, GalTempRom + 0x1800, 0x800); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x2000, 0x800); - memcpy(GalZ80Rom1 + 0x3000, GalTempRom + 0x2800, 0x800); - memcpy(GalZ80Rom1 + 0x1800, GalTempRom + 0x3000, 0x800); - memcpy(GalZ80Rom1 + 0x3800, GalTempRom + 0x3800, 0x800); - BurnFree(GalTempRom); - - CkonggMapZ80(); - - ZetOpen(0); - ZetSetReadHandler(CkongmcZ80Read); - ZetSetWriteHandler(CkongmcZ80Write); - ZetClose(); -} - -static INT32 CkongmcInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = CkongmcPostLoad; - - nRet = GalInit(); - - GalExtendSpriteInfoFunction = MshuttleExtendSpriteInfo; - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void PorterPostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(0x4000); - memcpy(GalTempRom, GalZ80Rom1, 0x4000); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0000, 0x800); - memcpy(GalZ80Rom1 + 0x2000, GalTempRom + 0x0800, 0x800); - memcpy(GalZ80Rom1 + 0x0800, GalTempRom + 0x1000, 0x800); - memcpy(GalZ80Rom1 + 0x2800, GalTempRom + 0x1800, 0x800); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x2000, 0x800); - memcpy(GalZ80Rom1 + 0x3000, GalTempRom + 0x2800, 0x800); - memcpy(GalZ80Rom1 + 0x1800, GalTempRom + 0x3000, 0x800); - memcpy(GalZ80Rom1 + 0x3800, GalTempRom + 0x3800, 0x800); - BurnFree(GalTempRom); - - MapMooncrst(); - - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x5fff, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetClose(); -} - -static INT32 PorterInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = PorterPostLoad; - - nRet = GalInit(); - - GalExtendTileInfoFunction = SkybaseExtendTileInfo; - GalExtendSpriteInfoFunction = SkybaseExtendSpriteInfo; - - return nRet; -} - -static void KongAlterZ80() -{ - MapMooncrst(); - - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x7fff, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetClose(); -} - -static INT32 KongInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = KongAlterZ80; - - GalPromRomSize = 0x20; - - nRet = GalInit(); - - GalRenderBackgroundFunction = NULL; - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - - HardCodeMooncrstPROM(); - - return nRet; -} - -static void FantastcPostLoad() -{ - MapMooncrst(); - - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x7fff, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetSetWriteHandler(FantastcZ80Write); - ZetClose(); - - static const UINT16 lut_am_unscramble[32] = { - 0, 2, 4, 6, // ok! - 7, 3, 5, 1, // ok! - 6, 0, 2, 4, // ok! - 1, 5, 3, 0, // ok! - 2, 4, 6, 3, // good, good?, guess, guess - 5, 6, 0, 2, // good, good?, good?, guess - 4, 1, 1, 5, // good, good, guess, good - 3, 7, 7, 7 // ok! - }; - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x8000); - memcpy(pTemp, GalZ80Rom1, 0x8000); - - for (INT32 i = 0; i < 32; i++) { - memcpy(GalZ80Rom1 + i * 0x400, pTemp + lut_am_unscramble[i] * 0x1000 + (i & 3) * 0x400, 0x400); - } - - BurnFree(pTemp); -} - -static INT32 FantastcInit() -{ - INT32 nRet; - - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910; - - GalPostLoadCallbackFunction = FantastcPostLoad; - GalNumSprites = 0x40; - - nRet = GalInit(); - - GalRenderFrameFunction = FantastcRenderFrame; - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - - return nRet; -} - -static void TimefgtrPostLoad() -{ - MapMooncrst(); - - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x7fff, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetSetWriteHandler(TimefgtrZ80Write); - ZetClose(); -} - -static INT32 TimefgtrInit() -{ - INT32 nRet; - - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910; - GalPromRomSize = 0x20; - - GalPostLoadCallbackFunction = TimefgtrPostLoad; - GalNumSprites = 0x40; - - nRet = GalInit(); - - GalRenderFrameFunction = TimefgtrRenderFrame; - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - - HardCodeMooncrstPROM(); - - return nRet; -} - -struct BurnDriver BurnDrvSkybase = { - "skybase", NULL, NULL, NULL, "1982", - "Sky Base\0", NULL, "Omori Electric Co. Ltd", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, SkybaseRomInfo, SkybaseRomName, NULL, NULL, SkybaseInputInfo, SkybaseDIPInfo, - SkybaseInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriverD BurnDrvBagmanmc = { - "bagmanmc", "bagman", NULL, NULL, "1982", - "Bagman (bootleg on Moon Cresta hardware set 1)\0", "Bad Colours", "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, BagmanmcRomInfo, BagmanmcRomName, NULL, NULL, BagmanmcInputInfo, BagmanmcDIPInfo, - BagmanmcInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvBagmanm2 = { - "bagmanm2", "bagman", NULL, NULL, "1982", - "Bagman (bootleg on Moon Cresta hardware set 2)\0", "Bad Colours", "Valadon Automation", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, Bagmanm2RomInfo, Bagmanm2RomName, NULL, NULL, BagmanmcInputInfo, BagmanmcDIPInfo, - BagmanmcInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDkongjrm = { - "dkongjrm", "dkongjr", NULL, NULL, "1982", - "Donkey Kong Jr. (Moon Cresta hardware)\0", "Bad Colours", "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, DkongjrmRomInfo, DkongjrmRomName, NULL, NULL, DkongjrmInputInfo, DkongjrmDIPInfo, - DkongjrmInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvVpool = { - "vpool", "hustler", NULL, NULL, "1980", - "Video Pool (bootleg on Moon Cresta hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_SPORTSMISC, 0, - NULL, VpoolRomInfo, VpoolRomName, NULL, NULL, GalaxianInputInfo, VpoolDIPInfo, - VpoolInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCkongg = { - "ckongg", "ckong", NULL, NULL, "1981", - "Crazy Kong (bootleg on Galaxian hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, CkonggRomInfo, CkonggRomName, NULL, NULL, CkonggInputInfo, CkonggDIPInfo, - CkonggInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCkongmc = { - "ckongmc", "ckong", NULL, NULL, "1981", - "Crazy Kong (bootleg on Moon Cresta hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, CkongmcRomInfo, CkongmcRomName, NULL, NULL, CkongmcInputInfo, CkongmcDIPInfo, - CkongmcInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvPorter = { - "porter", "dockman", NULL, NULL, "19??", - "Port Man (bootleg on Moon Cresta hardware)\0", NULL, "Nova Games Ltd", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, PorterRomInfo, PorterRomName, NULL, NULL, PorterInputInfo, PorterDIPInfo, - PorterInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvKong = { - "kong", NULL, NULL, NULL, "198?", - "Kong (Donkey Kong conversion on Galaxian hardware)\0", "Bad Colours", "Taito do Brasil", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, KongRomInfo, KongRomName, NULL, NULL, KongInputInfo, KongDIPInfo, - KongInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFantastc = { - "fantastc", NULL, NULL, NULL, "198?", - "Fantastic (Galaga conversion on Galaxian hardware)\0", NULL, "Taito do Brasil", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, FantastcRomInfo, FantastcRomName, NULL, NULL, FantastcInputInfo, FantastcDIPInfo, - FantastcInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTimefgtr = { - "timefgtr", NULL, NULL, NULL, "198?", - "Time Fighter (Time Pilot conversion on Galaxian hardware)\0", "Bad Colours", "Taito do Brasil", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, TimefgtrRomInfo, TimefgtrRomName, NULL, NULL, TimefgtrInputInfo, TimefgtrDIPInfo, - TimefgtrInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Custom background -static struct BurnRomInfo RockclimRomDesc[] = { - { "lc01.a1", 0x01000, 0x8601ae8d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lc02.a2", 0x01000, 0x2dde9d4c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lc03.a3", 0x01000, 0x82c48a67, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lc04.a4", 0x01000, 0x7cd3a04a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lc05.a5", 0x01000, 0x5e542149, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lc06.a6", 0x01000, 0xb2bdca64, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "lc08.a9", 0x00800, 0x7f18e1ef, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "lc07.a7", 0x00800, 0xf18b50ac, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "lc10.c9", 0x00800, 0xdec5781b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "lc09.c7", 0x00800, 0x06c0b5de, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "lc11.f4", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, - { "lc12.e9", 0x00020, 0xf6e76547, BRF_GRA | GAL_ROM_PROM }, - - { "lc13.g5", 0x01000, 0x19475f2b, BRF_GRA }, - { "lc14.g7", 0x01000, 0xcc96d1db, BRF_GRA }, -}; - -STD_ROM_PICK(Rockclim) -STD_ROM_FN(Rockclim) - -UINT8 __fastcall RockclimZ80Read(UINT16 a) -{ - switch (a) { - case 0x8800: { - return GalInput[3] | GalDip[3]; - } - - case 0xa000: { - return GalInput[0] | GalDip[0]; - } - - case 0xa800: { - return GalInput[1] | GalDip[1]; - } - - case 0xb000: { - return GalInput[2] | GalDip[2]; - } - - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall RockclimZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x4800: { - RockclimScrollX = (RockclimScrollX & 0xff00) | d; - return; - } - - case 0x4801: { - RockclimScrollX = (RockclimScrollX & 0xff) | (d << 8); - return; - } - - case 0x4802: { - RockclimScrollY = (RockclimScrollY & 0xff00) | d; - return; - } - - case 0x4803: { - RockclimScrollY = (RockclimScrollY & 0xff) | (d << 8); - return; - } - - case 0xa000: - case 0xa001: - case 0xa002: { - GalGfxBank[a - 0xa000] = d; - return; - } - - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: { - GalaxianLfoFreqWrite(a - 0xa004, d); - return; - } - - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: - case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb000: { - GalIrqFire = d & 1; - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static void RockclimPostLoad() -{ - MapMooncrst(); - - GalVideoRam2 = (UINT8*)BurnMalloc(0x800); - - ZetOpen(0); - ZetSetReadHandler(RockclimZ80Read); - ZetSetWriteHandler(RockclimZ80Write); - ZetMapArea(0x4000, 0x47ff, 0, GalVideoRam2); - ZetMapArea(0x4000, 0x47ff, 1, GalVideoRam2); - ZetMapArea(0x4000, 0x47ff, 2, GalVideoRam2); - ZetMapArea(0x5000, 0x53ff, 0, GalZ80Ram1 + 0x400); - ZetMapArea(0x5000, 0x53ff, 1, GalZ80Ram1 + 0x400); - ZetMapArea(0x5000, 0x53ff, 2, GalZ80Ram1 + 0x400); - ZetMapArea(0x6000, 0x7fff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0x6000, 0x7fff, 2, GalZ80Rom1 + 0x4000); - ZetClose(); -} - -static INT32 RockclimInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = RockclimPostLoad; - RockclimTiles = (UINT8*)BurnMalloc(0x100 * 8 * 8); - - nRet = GalInit(); - - INT32 RockclimPlaneOffsets[4] = {4, 0, 0x8004, 0x8000}; - INT32 RockclimCharXOffsets[8] = {3, 2, 1, 0, 11, 10, 9, 8}; - INT32 RockclimCharYOffsets[8] = {0, 16, 32, 48, 64, 80, 96, 112}; - - GalTempRom = (UINT8*)BurnMalloc(0x2000); - nRet = BurnLoadRom(GalTempRom + 0x0000, 12, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x1000, 13, 1); if (nRet) return 1; - GfxDecode(256, 4, 8, 8, RockclimPlaneOffsets, RockclimCharXOffsets, RockclimCharYOffsets, 0x80, GalTempRom, RockclimTiles); - BurnFree(GalTempRom); - - GalCalcPaletteFunction = RockclimCalcPalette; - GalRenderBackgroundFunction = RockclimDrawBackground; - GalExtendTileInfoFunction = MooncrstExtendTileInfo; - GalExtendSpriteInfoFunction = RockclimExtendSpriteInfo; - - return nRet; -} - -struct BurnDriver BurnDrvRockclim = { - "rockclim", NULL, NULL, NULL, "1981", - "Rock Climber\0", NULL, "Taito", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, RockclimRomInfo, RockclimRomName, NULL, NULL, RockclimInputInfo, RockclimDIPInfo, - RockclimInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -// Extra roms and sound hardware replaced with AY8910 -static struct BurnRomInfo JumpbugRomDesc[] = { - { "jb1", 0x01000, 0x415aa1b7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb2", 0x01000, 0xb1c27510, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb3", 0x01000, 0x97c24be2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb4", 0x01000, 0x66751d12, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb5", 0x01000, 0xe2d66faf, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb6", 0x01000, 0x49e0bdfd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb7", 0x00800, 0x83d71302, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "jbl", 0x00800, 0x9a091b0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbm", 0x00800, 0x8a0fc082, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbn", 0x00800, 0x155186e0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbi", 0x00800, 0x7749b111, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbj", 0x00800, 0x06e8d7df, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbk", 0x00800, 0xb8dbddf3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Jumpbug) -STD_ROM_FN(Jumpbug) - -static struct BurnRomInfo JumpbugbRomDesc[] = { - { "jb1", 0x01000, 0x415aa1b7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb2", 0x01000, 0xb1c27510, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb3b", 0x01000, 0xcb8b8a0f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb4", 0x01000, 0x66751d12, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb5b", 0x01000, 0x7553b5e2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb6b", 0x01000, 0x47be9843, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "jb7b", 0x00800, 0x460aed61, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "jbl", 0x00800, 0x9a091b0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbm", 0x00800, 0x8a0fc082, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbn", 0x00800, 0x155186e0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbi", 0x00800, 0x7749b111, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbj", 0x00800, 0x06e8d7df, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "jbk", 0x00800, 0xb8dbddf3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "l06_prom.bin", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Jumpbugb) -STD_ROM_FN(Jumpbugb) - -static struct BurnRomInfo LeversRomDesc[] = { - { "g96059.a8", 0x01000, 0x9550627a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g96060.d8", 0x01000, 0x5ac64646, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g96061.e8", 0x01000, 0x9db8e520, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g96062.h8", 0x01000, 0x7c8e8b3a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g96063.j8", 0x01000, 0xfa61e793, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "g96064.l8", 0x01000, 0xf797f389, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "g95948.n1", 0x00800, 0xd8a0c692, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g95949.s1", 0x00800, 0x3660a552, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g95946.j1", 0x00800, 0x73b61b2d, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g95947.m1", 0x00800, 0x72ff67e2, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "g960lev.clr", 0x00020, 0x01febbbe, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Levers) -STD_ROM_FN(Levers) - -static struct BurnRomInfo BongoRomDesc[] = { - { "bg1.bin", 0x01000, 0xde9a8ec6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bg2.bin", 0x01000, 0xa19da662, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bg3.bin", 0x01000, 0x9f6f2150, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bg4.bin", 0x01000, 0xf80372d2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bg5.bin", 0x01000, 0xfc92eade, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "bg6.bin", 0x01000, 0x561d9e5d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "b-h.bin", 0x01000, 0xfc79d103, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "b-k.bin", 0x01000, 0x94d17bf3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "b-clr.bin", 0x00020, 0xc4761ada, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Bongo) -STD_ROM_FN(Bongo) - -void __fastcall BongoZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xb001: { - GalIrqFire = d & 1; - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - // watchdog write? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall BongoZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x02: { - return AY8910Read(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall BongoZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - AY8910Write(0, 0, d); - return; - } - - case 0x01: { - AY8910Write(0, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static INT32 JumpbugInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapJumpbug; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910; - - nRet = GalInit(); - - GalRenderBackgroundFunction = JumpbugDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = JumpbugExtendTileInfo; - GalExtendSpriteInfoFunction = JumpbugExtendSpriteInfo; - - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static void LeversPostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(GalZ80Rom1Size); - memcpy(GalTempRom, GalZ80Rom1, GalZ80Rom1Size); - memset(GalZ80Rom1, 0, GalZ80Rom1Size); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0000, 0x1000); - memcpy(GalZ80Rom1 + 0x2000, GalTempRom + 0x1000, GalZ80Rom1Size - 0x2000); - BurnFree(GalTempRom); - - MapJumpbug(); -} - -static INT32 LeversInit() -{ - INT32 nRet; - - GalZ80Rom1Size = 0x1000; - GalTilesSharedRomSize = 0x1000; - - GalPostLoadCallbackFunction = LeversPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910; - - nRet = GalInit(); - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - nRet = BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x1800, GAL_ROM_OFFSET_TILES_SHARED + 2, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x2800, GAL_ROM_OFFSET_TILES_SHARED + 3, 1); if (nRet) return 1; - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - GalRenderBackgroundFunction = JumpbugDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = JumpbugExtendTileInfo; - GalExtendSpriteInfoFunction = JumpbugExtendSpriteInfo; - - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static void BongoPostLoad() -{ - MapMooncrst(); - - ZetOpen(0); - ZetSetWriteHandler(BongoZ80Write); - ZetSetInHandler(BongoZ80PortRead); - ZetSetOutHandler(BongoZ80PortWrite); - ZetMapArea(0x0000, 0x5fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x5fff, 2, GalZ80Rom1); - ZetMapArea(0x8400, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8400, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8400, 0x87ff, 2, GalZ80Ram1); - ZetMapArea(0x9400, 0x97ff, 0, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 1, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 2, GalVideoRam); - ZetClose(); -} - -static INT32 BongoInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = BongoPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_BONGOAY8910; - - nRet = GalInit(); - - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - - return nRet; -} - -struct BurnDriver BurnDrvJumpbug = { - "jumpbug", NULL, NULL, NULL, "1981", - "Jump Bug\0", NULL, "Rock-ola", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, JumpbugRomInfo, JumpbugRomName, NULL, NULL, JumpbugInputInfo, JumpbugDIPInfo, - JumpbugInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvJumpbugb = { - "jumpbugb", "jumpbug", NULL, NULL, "1981", - "Jump Bug (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, JumpbugbRomInfo, JumpbugbRomName, NULL, NULL, JumpbugInputInfo, JumpbugDIPInfo, - JumpbugInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvLevers = { - "levers", NULL, NULL, NULL, "1983", - "Levers\0", NULL, "Rock-ola", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, LeversRomInfo, LeversRomName, NULL, NULL, LeversInputInfo, LeversDIPInfo, - LeversInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvBongo = { - "bongo", NULL, NULL, NULL, "1983", - "Bongo\0", NULL, "Jetsoft", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, BongoRomInfo, BongoRomName, NULL, NULL, BongoInputInfo, BongoDIPInfo, - BongoInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Second Z80 driving AY8910 -static struct BurnRomInfo CheckmanRomDesc[] = { - { "cm1", 0x00800, 0xe8cbdd28, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cm2", 0x00800, 0xb8432d4d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cm3", 0x00800, 0x15a97f61, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cm4", 0x00800, 0x8c12ecc0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cm5", 0x00800, 0x2352cfd6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "cm13", 0x00800, 0x0b09a3e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "cm14", 0x00800, 0x47f043be, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "cm11", 0x00800, 0x8d1bcca0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "cm9", 0x00800, 0x3cd5c751, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "checkman.clr", 0x00020, 0x57a45057, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Checkman) -STD_ROM_FN(Checkman) - -static struct BurnRomInfo CheckmanjRomDesc[] = { - { "cm_1.bin", 0x01000, 0x456a118f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cm_2.bin", 0x01000, 0x146b2c44, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cm_3.bin", 0x00800, 0x73e1c945, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "cm_4.bin", 0x01000, 0x923cffa1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "cm_6.bin", 0x00800, 0x476a7cc3, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "cm_5.bin", 0x00800, 0xb3df2b5f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "checkman.clr", 0x00020, 0x57a45057, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Checkmanj) -STD_ROM_FN(Checkmanj) - -static struct BurnRomInfo DingoRomDesc[] = { - { "003.e7", 0x01000, 0xd088550f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "004.h7", 0x01000, 0xa228446a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "005.j7", 0x00800, 0x14d680bb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "6.7l", 0x01000, 0x047092e0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "001.h1", 0x00800, 0x1ab1dd4d, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "002.k1", 0x00800, 0x4be375ee, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "18s030.l6", 0x00020, 0x3061d0f9, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Dingo) -STD_ROM_FN(Dingo) - -static struct BurnRomInfo DingoeRomDesc[] = { - { "unk.2b", 0x01000, 0x0df7ac6d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "unk.2d", 0x01000, 0x0881e204, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "unk.3b", 0x01000, 0x0b6aeab5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "unk.1c", 0x00800, 0x8e354c38, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "unk.1d", 0x00800, 0x092878d6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "unk.4d", 0x00800, 0x76a00a56, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "unk.4b", 0x00800, 0x5acf57aa, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123n.001", 0x00020, 0x02b11865, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Dingoe) -STD_ROM_FN(Dingoe) - -void __fastcall CheckmanZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - GalSoundLatch = d; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - } - } - - bprintf(PRINT_NORMAL, _T("IO Write %x, %x\n"), a, d); -} - -void __fastcall CheckmanZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: { - GalGfxBank[a - 0xa000] = d; - return; - } - - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xb001: { - GalIrqFire = d & 1; - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - } - - bprintf(PRINT_NORMAL, _T("Prog Write %x, %x\n"), a, d); -} - -UINT8 __fastcall CheckmanSoundZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x03: { - return GalSoundLatch; - } - - case 0x06: { - return AY8910Read(0); - } - } - - bprintf(PRINT_NORMAL, _T("Sound IO Read %x\n"), a); - return 0xff; -} - -void __fastcall CheckmanSoundZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x04: { - AY8910Write(0, 0, d); - return; - } - - case 0x05: { - AY8910Write(0, 1, d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Sound IO Write %x, %x\n"), a, d); -} - -UINT8 __fastcall CheckmanjZ80Read(UINT16 a) -{ - switch (a) { - case 0x3800: { - switch (ZetGetPC(-1)) { - case 0x0f15: return 0xf5; - case 0x0f8f: return 0x7c; - case 0x10b3: return 0x7c; - case 0x10e0: return 0x00; - case 0x10f1: return 0xaa; - case 0x1402: return 0xaa; - } - return 0xff; - } - - case 0x6000: { - return GalInput[0] | GalDip[0]; - } - - case 0x6800: { - return GalInput[1] | GalDip[1]; - } - - case 0x7000: { - return GalInput[2] | GalDip[2]; - } - - case 0x7800: { - // watchdog read - return 0xff; - } - } - - bprintf(PRINT_NORMAL, _T("Prog Read %x\n"), a); - return 0xff; -} - -void __fastcall CheckmanjZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5800 && a <= 0x58ff) { - INT32 Offset = a - 0x5800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: - case 0x6001: { - // start_lamp_w - return; - } - - case 0x6002: { - // coin_lock_w - return; - } - - case 0x6003: { - // coin_count_0_w - return; - } - - case 0x7001: { - GalIrqFire = d & 1; - return; - } - - case 0x7004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x7006: { - GalFlipScreenX = d & 1; - return; - } - - case 0x7007: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - GalSoundLatch = d; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Prog Write %x, %x\n"), a, d); -} - -UINT8 __fastcall CheckmanjSoundZ80Read(UINT16 a) -{ - switch (a) { - case 0xa002: { - return AY8910Read(0); - } - } - - bprintf(PRINT_NORMAL, _T("Sound Prog Read %x\n"), a); - return 0xff; -} - -void __fastcall CheckmanjSoundZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xa000: { - AY8910Write(0, 0, d); - return; - } - - case 0xa001: { - AY8910Write(0, 1, d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Sound Prog Write %x, %x\n"), a, d); -} - -UINT8 __fastcall DingoZ80Read(UINT16 a) -{ - switch (a) { - case 0x3000: { - return 0xaa; - } - - case 0x3035: { - return 0x8c; - } - - case 0x6000: { - return GalInput[0] | GalDip[0]; - } - - case 0x6800: { - return GalInput[1] | GalDip[1]; - } - - case 0x7000: { - return GalInput[2] | GalDip[2]; - } - - case 0x7800: { - // watchdog read - return 0xff; - } - } - - bprintf(PRINT_NORMAL, _T("Prog Read %x\n"), a); - return 0xff; -} - -static void CheckmanInitSoundCPU() -{ - ZetOpen(1); - ZetMapArea(0x0000, GalZ80Rom2Size - 1, 0, GalZ80Rom2); - ZetMapArea(0x0000, GalZ80Rom2Size - 1, 2, GalZ80Rom2); - ZetMapArea(0x2000, 0x23ff, 0, GalZ80Ram2); - ZetMapArea(0x2000, 0x23ff, 1, GalZ80Ram2); - ZetMapArea(0x2000, 0x23ff, 2, GalZ80Ram2); - ZetSetInHandler(CheckmanSoundZ80PortRead); - ZetSetOutHandler(CheckmanSoundZ80PortWrite); - ZetClose(); - - nGalCyclesTotal[1] = 1620000 / 60; -} - -static void CheckmanPostLoad() -{ - static const UINT8 XORTable[8][4] = { - { 6, 0, 6, 0 }, - { 5, 1, 5, 1 }, - { 4, 2, 6, 1 }, - { 2, 4, 5, 0 }, - { 4, 6, 1, 5 }, - { 0, 6, 2, 5 }, - { 0, 2, 0, 2 }, - { 1, 4, 1, 4 } - }; - - for (UINT32 Offset = 0; Offset < GalZ80Rom1Size; Offset++) { - UINT8 Data = GalZ80Rom1[Offset]; - UINT32 Line = Offset & 0x07; - - Data ^= (BIT(Data, XORTable[Line][0]) << XORTable[Line][1]) | (BIT(Data, XORTable[Line][2]) << XORTable[Line][3]); - GalZ80Rom1[Offset] = Data; - } - - MapMooncrst(); - ZetOpen(0); - ZetSetWriteHandler(CheckmanZ80Write); - ZetSetOutHandler(CheckmanZ80PortWrite); - ZetClose(); - - CheckmanInitSoundCPU(); -} - -static INT32 CheckmanInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = CheckmanPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910; - GalTilesSharedRomSize = 0x1000; - - nRet = GalInit(); - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - BurnLoadRom(GalTempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - memcpy(GalTempRom + 0x0800, GalTempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x1800, GalTempRom + 0x1000, 0x800); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - GalExtendTileInfoFunction = MooncrstExtendTileInfo; - GalExtendSpriteInfoFunction = MooncrstExtendSpriteInfo; - - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static void CheckmanjInitSoundCPU() -{ - ZetOpen(1); - ZetMapArea(0x0000, GalZ80Rom2Size - 1, 0, GalZ80Rom2); - ZetMapArea(0x0000, GalZ80Rom2Size - 1, 2, GalZ80Rom2); - ZetMapArea(0x8000, 0x83ff, 0, GalZ80Ram2); - ZetMapArea(0x8000, 0x83ff, 1, GalZ80Ram2); - ZetMapArea(0x8000, 0x83ff, 2, GalZ80Ram2); - ZetSetReadHandler(CheckmanjSoundZ80Read); - ZetSetWriteHandler(CheckmanjSoundZ80Write); - ZetClose(); - - nGalCyclesTotal[1] = 1620000 / 60; -} - -static void CheckmanjPostLoad() -{ - ZetOpen(0); - ZetSetReadHandler(CheckmanjZ80Read); - ZetSetWriteHandler(CheckmanjZ80Write); - ZetClose(); - - CheckmanjInitSoundCPU(); -} - -static INT32 CheckmanjInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = CheckmanjPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910; - - nRet = GalInit(); - - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static void DingoPostLoad() -{ - ZetOpen(0); - ZetSetReadHandler(DingoZ80Read); - ZetSetWriteHandler(CheckmanjZ80Write); - ZetMapArea(0x5400, 0x57ff, 0, GalVideoRam); - ZetMapArea(0x5400, 0x57ff, 1, GalVideoRam); - ZetMapArea(0x5400, 0x57ff, 2, GalVideoRam); - ZetClose(); - - CheckmanjInitSoundCPU(); -} - -static INT32 DingoInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = DingoPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910; - Dingo = 1; - nRet = GalInit(); - - AY8910SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static void DingoePostLoad() -{ - for (UINT32 Offset = 0; Offset < GalZ80Rom1Size; Offset++) { - UINT8 Data = GalZ80Rom1[Offset]; - - Data ^= BIT(Data, 2) << 4; - Data ^= BIT(Data, 5) << 0; - Data ^= 0x02; - - if (Offset & 0x02) Data = BITSWAP08(Data, 7, 6, 5, 0, 3, 2, 1, 4); - GalZ80Rom1[Offset] = Data; - } - - MapMooncrst(); - ZetOpen(0); - ZetSetWriteHandler(CheckmanZ80Write); - ZetSetOutHandler(CheckmanZ80PortWrite); - ZetClose(); - - CheckmanInitSoundCPU(); -} - -static INT32 DingoeInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = DingoePostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910; - - nRet = GalInit(); - - AY8910SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -struct BurnDriver BurnDrvCheckman = { - "checkman", NULL, NULL, NULL, "1982", - "Check Man\0", NULL, "Zilex-Zenitone", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, CheckmanRomInfo, CheckmanRomName, NULL, NULL, CheckmanInputInfo, CheckmanDIPInfo, - CheckmanInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCheckmanj = { - "checkmanj", "checkman", NULL, NULL, "1982", - "Check Man (Japan)\0", NULL, "Jaleco", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, CheckmanjRomInfo, CheckmanjRomName, NULL, NULL, CheckmanjInputInfo, CheckmanjDIPInfo, - CheckmanjInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDingo = { - "dingo", NULL, NULL, NULL, "1983", - "Dingo\0", NULL, "Ashby Computers and Graphics LTD. (Jaleco license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, DingoRomInfo, DingoRomName, NULL, NULL, DingoInputInfo, DingoDIPInfo, - DingoInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriverD BurnDrvDingoe = { - "dingoe", "dingo", NULL, NULL, "1983", - "Dingo (encrypted)\0", "Encrypted", "Ashby Computers and Graphics LTD. (Jaleco license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, DingoeRomInfo, DingoeRomName, NULL, NULL, DingoInputInfo, DingoDIPInfo, - DingoeInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Crazy climber sound plus AY8910, and INT instead of NMI -static struct BurnRomInfo MshuttleRomDesc[] = { - { "my05", 0x01000, 0x83574af1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "my04", 0x01000, 0x1cfae2c8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "my03", 0x01000, 0xc8b8a368, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "my02", 0x01000, 0xb6aeee6e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "my01", 0x01000, 0xdef82adc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "my09", 0x01000, 0x3601b380, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my11", 0x00800, 0xb659e932, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my08", 0x01000, 0x992b06cd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my10", 0x00800, 0xd860e6ce, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mscprom1.bin", 0x00020, 0xea0d1af0, BRF_GRA | GAL_ROM_PROM }, - - { "my07", 0x01000, 0x522a2920, BRF_SND | BRF_OPT }, // Samples - { "my06", 0x01000, 0x466415f2, BRF_SND | BRF_OPT }, -}; - -STD_ROM_PICK(Mshuttle) -STD_ROM_FN(Mshuttle) - -static struct BurnRomInfo Mshuttle2RomDesc[] = { - { "my05", 0x01000, 0x83574af1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "my04", 0x01000, 0x1cfae2c8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "my03", 0x01000, 0xc8b8a368, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "my02", 0x01000, 0x9804061c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "my01", 0x01000, 0xca746a61, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "my09", 0x01000, 0x3601b380, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my11", 0x00800, 0xd860e6ce, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my08", 0x01000, 0x992b06cd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my10", 0x00800, 0xd860e6ce, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mscprom1.bin", 0x00020, 0xea0d1af0, BRF_GRA | GAL_ROM_PROM }, - - { "my07", 0x01000, 0x522a2920, BRF_SND | BRF_OPT }, // Samples - { "my06", 0x01000, 0x6d2dd711, BRF_SND | BRF_OPT }, -}; - -STD_ROM_PICK(Mshuttle2) -STD_ROM_FN(Mshuttle2) - -static struct BurnRomInfo MshuttlejRomDesc[] = { - { "mcs.5", 0x01000, 0xa5a292b4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mcs.4", 0x01000, 0xacdc0f9e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mcs.3", 0x01000, 0xc1e3f5d8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mcs.2", 0x01000, 0x14577703, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mcs.1", 0x01000, 0x27d46772, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "my09", 0x01000, 0x3601b380, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my11", 0x00800, 0xb659e932, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my08", 0x01000, 0x992b06cd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my10", 0x00800, 0xd860e6ce, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mscprom1.bin", 0x00020, 0xea0d1af0, BRF_GRA | GAL_ROM_PROM }, - - { "my07", 0x01000, 0x522a2920, BRF_SND | BRF_OPT }, // Samples - { "my06", 0x01000, 0x6d2dd711, BRF_SND | BRF_OPT }, -}; - -STD_ROM_PICK(Mshuttlej) -STD_ROM_FN(Mshuttlej) - -static struct BurnRomInfo Mshuttlej2RomDesc[] = { - { "ali5.bin", 0x01000, 0x320fe630, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mcs.4", 0x01000, 0xacdc0f9e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mcs.3", 0x01000, 0xc1e3f5d8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali2.bin", 0x01000, 0x9ed169e1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ali1.bin", 0x01000, 0x7f8a52d9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "my09", 0x01000, 0x3601b380, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my11", 0x00800, 0xb659e932, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my08", 0x01000, 0x992b06cd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "my10", 0x00800, 0xd860e6ce, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mscprom1.bin", 0x00020, 0xea0d1af0, BRF_GRA | GAL_ROM_PROM }, - - { "my07", 0x01000, 0x522a2920, BRF_SND | BRF_OPT }, // Samples - { "my06.4r", 0x01000, 0x4162be4d, BRF_SND | BRF_OPT }, -}; - -STD_ROM_PICK(Mshuttlej2) -STD_ROM_FN(Mshuttlej2) - -UINT8 __fastcall MshuttleZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x0c: { - if (!MshuttleAY8910CS) return AY8910Read(0); - return 0xff; - } - } - - bprintf(PRINT_NORMAL, _T("IO Read %x\n"), a); - return 0xff; -} - -void __fastcall MshuttleZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x08: { - if (!MshuttleAY8910CS) AY8910Write(0, 0, d); - return; - } - - case 0x09: { - if (!MshuttleAY8910CS) AY8910Write(0, 1, d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("IO Write %x, %x\n"), a, d); -} - -void __fastcall MshuttleZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa000: { - GalIrqFire = d & 1; - return; - } - - case 0xa001: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xa002: { - GalFlipScreenX = d & 1; - GalFlipScreenY = d & 1; - return; - } - - case 0xa004: { - // cclimber_sample_trigger_w - return; - } - - case 0xa007: { - MshuttleAY8910CS = d & 1; - return; - } - - case 0xa800: { - // cclimber_sample_rate_w - return; - } - - case 0xb000: { - // cclimber_sample_volume_w - return; - } - } - bprintf(PRINT_NORMAL, _T("Prog Write %x, %x\n"), a, d); -} - -static void MapMshuttle() -{ - MapMooncrst(); - ZetOpen(0); - ZetMapArea(0x0000, 0x4fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x4fff, 2, GalZ80Rom1Op, GalZ80Rom1); - ZetSetWriteHandler(MshuttleZ80Write); - ZetSetInHandler(MshuttleZ80PortRead); - ZetSetOutHandler(MshuttleZ80PortWrite); - ZetClose(); -} - -static void MshuttleDecrypt() -{ - GalZ80Rom1Op = (UINT8*)BurnMalloc(GalZ80Rom1Size); - - static const UINT8 ConvTable[8][16] = { - { 0x40, 0x41, 0x44, 0x15, 0x05, 0x51, 0x54, 0x55, 0x50, 0x00, 0x01, 0x04, (UINT8)-1, 0x10, 0x11, 0x14 }, - { 0x45, 0x51, 0x55, 0x44, 0x40, 0x11, 0x05, 0x41, 0x10, 0x14, 0x54, 0x50, 0x15, 0x04, 0x00, 0x01 }, - { 0x11, 0x14, 0x10, 0x00, 0x44, 0x05, (UINT8)-1, 0x04, 0x45, 0x15, 0x55, 0x50, (UINT8)-1, 0x01, 0x54, 0x51 }, - { 0x14, 0x01, 0x11, 0x10, 0x50, 0x15, 0x00, 0x40, 0x04, 0x51, 0x45, 0x05, 0x55, 0x54, (UINT8)-1, 0x44 }, - { 0x04, 0x10, (UINT8)-1, 0x40, 0x15, 0x41, 0x50, 0x50, 0x11, (UINT8)-1, 0x14, 0x00, 0x51, 0x45, 0x55, 0x01 }, - { 0x44, 0x45, 0x00, 0x51, (UINT8)-1, (UINT8)-1, 0x15, 0x11, 0x01, 0x10, 0x04, 0x55, 0x05, 0x40, 0x50, 0x41 }, - { 0x51, 0x00, 0x01, 0x05, 0x04, 0x55, 0x54, 0x50, 0x41, (UINT8)-1, 0x11, 0x15, 0x14, 0x10, 0x44, 0x40 }, - { 0x05, 0x04, 0x51, 0x01, (UINT8)-1, (UINT8)-1, 0x55, (UINT8)-1, 0x00, 0x50, 0x15, 0x14, 0x44, 0x41, 0x40, 0x54 }, - }; - - for (UINT32 Offset = 0x0000; Offset < GalZ80Rom1Size; Offset++) { - INT32 i, j; - UINT8 Src; - - Src = GalZ80Rom1[Offset]; - i = (Offset & 1) | (Src & 0x02) | ((Src & 0x80) >> 5); - j = (Src & 0x01) | ((Src & 0x04) >> 1) | ((Src & 0x10) >> 2) | ((Src & 0x40) >> 3); - - GalZ80Rom1Op[Offset] = (Src & 0xaa) | ConvTable[i][j]; - } - - MapMshuttle(); -} - -static void MShuttleCommonInit() -{ - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - BurnLoadRom(GalTempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - BurnLoadRom(GalTempRom + 0x2000, GAL_ROM_OFFSET_TILES_SHARED + 2, 1); - BurnLoadRom(GalTempRom + 0x3000, GAL_ROM_OFFSET_TILES_SHARED + 3, 1); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - GalDrawBulletsFunction = MshuttleDrawBullets; - GalExtendTileInfoFunction = MshuttleExtendTileInfo; - GalExtendSpriteInfoFunction = MshuttleExtendSpriteInfo; - - GalIrqType = GAL_IRQ_TYPE_IRQ0; -} - -static INT32 MshuttleInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MshuttleDecrypt; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910; - GalTilesSharedRomSize = 0x1000; - - nRet = GalInit(); - - MShuttleCommonInit(); - - return nRet; -} - -static void MshuttlejDecrypt() -{ - GalZ80Rom1Op = (UINT8*)BurnMalloc(GalZ80Rom1Size); - - static const UINT8 ConvTable[8][16] = { - { 0x41, 0x54, 0x51, 0x14, 0x05, 0x10, 0x01, 0x55, 0x44, 0x11, 0x00, 0x50, 0x15, 0x40, 0x04, 0x45 }, - { 0x50, 0x11, 0x40, 0x55, 0x51, 0x14, 0x45, 0x04, 0x54, 0x15, 0x10, 0x05, 0x44, 0x01, 0x00, 0x41 }, - { 0x44, 0x11, 0x00, 0x50, 0x41, 0x54, 0x04, 0x14, 0x15, 0x40, 0x51, 0x55, 0x05, 0x10, 0x01, 0x45 }, - { 0x10, 0x50, 0x54, 0x55, 0x01, 0x44, 0x40, 0x04, 0x14, 0x11, 0x00, 0x41, 0x45, 0x15, 0x51, 0x05 }, - { 0x14, 0x41, 0x01, 0x44, 0x04, 0x50, 0x51, 0x45, 0x11, 0x40, 0x54, 0x15, 0x10, 0x00, 0x55, 0x05 }, - { 0x01, 0x05, 0x41, 0x45, 0x54, 0x50, 0x55, 0x10, 0x11, 0x15, 0x51, 0x14, 0x44, 0x40, 0x04, 0x00 }, - { 0x05, 0x55, 0x00, 0x50, 0x11, 0x40, 0x54, 0x14, 0x45, 0x51, 0x10, 0x04, 0x44, 0x01, 0x41, 0x15 }, - { 0x55, 0x50, 0x15, 0x10, 0x01, 0x04, 0x41, 0x44, 0x45, 0x40, 0x05, 0x00, 0x11, 0x14, 0x51, 0x54 }, - }; - - for (UINT32 Offset = 0x0000; Offset < GalZ80Rom1Size; Offset++) { - INT32 i, j; - UINT8 Src; - - Src = GalZ80Rom1[Offset]; - i = (Offset & 1) | (Src & 0x02) | ((Src & 0x80) >> 5); - j = (Src & 0x01) | ((Src & 0x04) >> 1) | ((Src & 0x10) >> 2) | ((Src & 0x40) >> 3); - - GalZ80Rom1Op[Offset] = (Src & 0xaa) | ConvTable[i][j]; - } - - MapMshuttle(); -} - -static INT32 MshuttlejInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MshuttlejDecrypt; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910; - GalTilesSharedRomSize = 0x1000; - - nRet = GalInit(); - - MShuttleCommonInit(); - - return nRet; -} - -struct BurnDriver BurnDrvMshuttle = { - "mshuttle", NULL, NULL, NULL, "1981", - "Moon Shuttle (US?)\0", "Incomplete Sound", "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MshuttleRomInfo, MshuttleRomName, NULL, NULL, MshuttleInputInfo, MshuttleDIPInfo, - MshuttleInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMshuttle2 = { - "mshuttle2", "mshuttle", NULL, NULL, "1981", - "Moon Shuttle (US? set 2)\0", "Incomplete Sound", "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Mshuttle2RomInfo, Mshuttle2RomName, NULL, NULL, MshuttleInputInfo, MshuttleDIPInfo, - MshuttleInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMshuttlej = { - "mshuttlej", "mshuttle", NULL, NULL, "1981", - "Moon Shuttle (Japan)\0", "Incomplete Sound", "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, MshuttlejRomInfo, MshuttlejRomName, NULL, NULL, MshuttleInputInfo, MshuttleDIPInfo, - MshuttlejInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMshuttlej2 = { - "mshuttlej2", "mshuttle", NULL, NULL, "1981", - "Moon Shuttle (Japan set 2)\0", "Incomplete Sound", "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, Mshuttlej2RomInfo, Mshuttlej2RomName, NULL, NULL, MshuttleInputInfo, MshuttleDIPInfo, - MshuttlejInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -// Second Z80 driving DAC -static struct BurnRomInfo KingballRomDesc[] = { - { "prg1.7f", 0x01000, 0x6cb49046, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "prg2.7j", 0x01000, 0xc223b416, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "prg3.7l", 0x00800, 0x453634c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "kbe1.ic4", 0x00800, 0x5be2c80a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "kbe2.ic5", 0x00800, 0xbb59e965, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "kbe3.ic6", 0x00800, 0x1c94dd31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "kbe2.ic7", 0x00800, 0xbb59e965, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "chg1.1h", 0x00800, 0x9cd550e7, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "chg2.1k", 0x00800, 0xa206757d, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "kb2-1", 0x00020, 0x15dd5b16, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Kingball) -STD_ROM_FN(Kingball) - -static struct BurnRomInfo KingballjRomDesc[] = { - { "prg1.7f", 0x01000, 0x6cb49046, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "prg2.7j", 0x01000, 0xc223b416, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "prg3.7l", 0x00800, 0x453634c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "kbj1.ic4", 0x00800, 0xba16beb7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "kbj2.ic5", 0x00800, 0x56686a63, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "kbj3.ic6", 0x00800, 0xfbc570a5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "kbj2.ic7", 0x00800, 0x56686a63, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "chg1.1h", 0x00800, 0x9cd550e7, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "chg2.1k", 0x00800, 0xa206757d, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "kb2-1", 0x00020, 0x15dd5b16, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Kingballj) -STD_ROM_FN(Kingballj) - -UINT8 __fastcall KingballZ80Read(UINT16 a) -{ - switch (a) { - case 0xa000: { - if (KingballSpeechDip) { - return GalInput[0] | GalDip[0] | ((GalFakeDip & 0x02) ? 0x40 : 0x00); - } else { - return GalInput[0] | GalDip[0] | ((GalFakeDip & 0x01) ? 0x40 : 0x00); - } - } - - case 0xa800: { - return ((GalInput[1] | GalDip[1]) & ~0x20) | (rand() & 0x20); - } - - case 0xb000: { - return GalInput[2] | GalDip[2]; - } - - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall KingballZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: { - GalGfxBank[a - 0xa000] = d; - return; - } - - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: { - GalaxianLfoFreqWrite(a - 0xa004, d); - return; - } - - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: - case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb000: { - KingballSound = (KingballSound & ~0x01) | d; - return; - } - - case 0xb001: { - GalIrqFire = d & 1; - return; - } - - case 0xb002: { - KingballSound = (KingballSound & ~0x02) | (d << 1); - GalSoundLatch = KingballSound | 0xf0; - return; - } - - case 0xb003: { - KingballSpeechDip = d; - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KingballSoundZ80Read(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall KingballSoundZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KingballSoundZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return GalSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall KingballSoundZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - DACWrite(0, d ^ 0xff); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static void KingballPostLoad() -{ - MapMooncrst(); - - ZetOpen(0); - ZetSetReadHandler(KingballZ80Read); - ZetSetWriteHandler(KingballZ80Write); - ZetClose(); - - ZetOpen(1); - ZetSetReadHandler(KingballSoundZ80Read); - ZetSetWriteHandler(KingballSoundZ80Write); - ZetSetInHandler(KingballSoundZ80PortRead); - ZetSetOutHandler(KingballSoundZ80PortWrite); - ZetMapArea(0x0000, 0x1fff, 0, GalZ80Rom2); - ZetMapArea(0x0000, 0x1fff, 2, GalZ80Rom2); - ZetClose(); - - nGalCyclesTotal[1] = (5000000 / 2) / 60; -} - -static INT32 KingballInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = KingballPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC; - GalTilesSharedRomSize = 0x1000; - - nRet = GalInit(); - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - BurnLoadRom(GalTempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - memcpy(GalTempRom + 0x0800, GalTempRom + 0x0000, 0x800); - memcpy(GalTempRom + 0x1800, GalTempRom + 0x1000, 0x800); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - return nRet; -} - -struct BurnDriver BurnDrvKingball = { - "kingball", NULL, NULL, NULL, "1980", - "King & Balloon (US)\0", NULL, "Namco", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, KingballRomInfo, KingballRomName, NULL, NULL, KingballInputInfo, KingballDIPInfo, - KingballInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvKingballj = { - "kingballj", "kingball", NULL, NULL, "1980", - "King & Balloon (Japan)\0", NULL, "Namco", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, KingballjRomInfo, KingballjRomName, NULL, NULL, KingballInputInfo, KingballDIPInfo, - KingballInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Frogger based hardware -static struct BurnRomInfo FroggerRomDesc[] = { - { "frogger.26", 0x01000, 0x597696d6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "frogger.27", 0x01000, 0xb6e6fcc3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "frsm3.7", 0x01000, 0xaca22ae0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "frogger.608", 0x00800, 0xe8ab0256, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "frogger.609", 0x00800, 0x7380a48f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "frogger.610", 0x00800, 0x31d7eb27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "frogger.607", 0x00800, 0x05f7d883, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "frogger.606", 0x00800, 0xf524ee30, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr-91.6l", 0x00020, 0x413703bf, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Frogger) -STD_ROM_FN(Frogger) - -static struct BurnRomInfo Froggers1RomDesc[] = { - { "frogger.26", 0x01000, 0x597696d6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "frogger.27", 0x01000, 0xb6e6fcc3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "frogger.34", 0x01000, 0xed866bab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr-608.ic32", 0x00800, 0xe8ab0256, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr-609.ic33", 0x00800, 0x7380a48f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr-610.ic34", 0x00800, 0x31d7eb27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "epr-607.ic101", 0x00800, 0x05f7d883, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr-606.ic102", 0x00800, 0xf524ee30, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr-91.6l", 0x00020, 0x413703bf, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Froggers1) -STD_ROM_FN(Froggers1) - -static struct BurnRomInfo Froggers2RomDesc[] = { - { "epr-1012.ic5", 0x01000, 0xefab0c79, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr-1013a.ic6", 0x01000, 0xaeca9c13, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr-1014.ic7", 0x01000, 0xdd251066, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr-1015.ic8", 0x01000, 0xbf293a02, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr-608.ic32", 0x00800, 0xe8ab0256, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr-609.ic33", 0x00800, 0x7380a48f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr-610.ic34", 0x00800, 0x31d7eb27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "epr-607.ic101", 0x00800, 0x05f7d883, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr-606.ic102", 0x00800, 0xf524ee30, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr-91.6l", 0x00020, 0x413703bf, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Froggers2) -STD_ROM_FN(Froggers2) - -static struct BurnRomInfo Froggers3RomDesc[] = { - { "29", 0x01000, 0xa58e43a7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "30", 0x01000, 0x119bbedb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "31", 0x01000, 0x405595e9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr-608.ic32", 0x00800, 0xe8ab0256, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr-609.ic33", 0x00800, 0x7380a48f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr-610.ic34", 0x00800, 0x31d7eb27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "epr-607.ic101", 0x00800, 0x05f7d883, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr-606.ic102", 0x00800, 0xf524ee30, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr-91.6l", 0x00020, 0x413703bf, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Froggers3) -STD_ROM_FN(Froggers3) - -static struct BurnRomInfo FroggermcRomDesc[] = { - { "epr-1031.15", 0x01000, 0x4b7c8d11, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr-1032.16", 0x01000, 0xac00b9d9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr-1033.33", 0x01000, 0xbc1d6fbc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr-1034.34", 0x01000, 0x9efe7399, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr-1082.42", 0x01000, 0x802843c2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr-1035.43", 0x00800, 0x14e74148, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "epr-1037.1h", 0x00800, 0x05f7d883, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr-1036.1k", 0x00800, 0x658745f8, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr-91.6l", 0x00020, 0x413703bf, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Froggermc) -STD_ROM_FN(Froggermc) - -static struct BurnRomInfo FroggersRomDesc[] = { - { "vid_d2.bin", 0x00800, 0xc103066e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_e2.bin", 0x00800, 0xf08bc094, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_f2.bin", 0x00800, 0x637a2ff8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_h2.bin", 0x00800, 0x04c027a5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_j2.bin", 0x00800, 0xfbdfbe74, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_l2.bin", 0x00800, 0x8a4389e1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "frogger.608", 0x00800, 0xe8ab0256, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "frogger.609", 0x00800, 0x7380a48f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "frogger.610", 0x00800, 0x31d7eb27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "frogger.607", 0x00800, 0x05f7d883, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr-1036.1k", 0x00800, 0x658745f8, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr-91.6l", 0x00020, 0x413703bf, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Froggers) -STD_ROM_FN(Froggers) - -static struct BurnRomInfo FrogfRomDesc[] = { - { "6.bin", 0x01000, 0x8ff0a973, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7.bin", 0x01000, 0x3087bb4b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.bin", 0x01000, 0xc3869d12, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "frogger.608", 0x00800, 0xe8ab0256, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "frogger.609", 0x00800, 0x7380a48f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "frogger.610", 0x00800, 0x31d7eb27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "frogger.607", 0x00800, 0x05f7d883, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr-1036.1k", 0x00800, 0x658745f8, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr-91.6l", 0x00020, 0x413703bf, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Frogf) -STD_ROM_FN(Frogf) - -static struct BurnRomInfo FroggRomDesc[] = { - { "p1.bin", 0x00800, 0x1762b266, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p2.bin", 0x00800, 0x322f3916, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p3.bin", 0x00800, 0x28bd6151, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p4.bin", 0x00800, 0x5a69ab18, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p5.bin", 0x00800, 0xb4f17745, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p6.bin", 0x00800, 0x34be71b5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p7.bin", 0x00800, 0xde3edc8c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "k.bin", 0x00800, 0x05f7d883, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "h.bin", 0x00800, 0x658745f8, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr-91.6l", 0x00020, 0x413703bf, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Frogg) -STD_ROM_FN(Frogg) - -static struct BurnRomInfo FroggrsRomDesc[] = { - { "frog4.bin", 0x01000, 0x4d563992, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "frog5.bin", 0x01000, 0xd8b8c06e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "frog6.bin", 0x01000, 0xb55a1cb5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "frogger.608", 0x00800, 0xe8ab0256, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "frogger.609", 0x00800, 0x7380a48f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "frog3.bin", 0x00800, 0x837c16ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "frogger.607", 0x00800, 0x05f7d883, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "frogger.606", 0x00800, 0xf524ee30, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr-91.6l", 0x00020, 0x413703bf, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Froggrs) -STD_ROM_FN(Froggrs) - -void __fastcall FroggermcZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: { - GalGfxBank[a - 0xa000] = d; - return; - } - - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xa800: { - GalSoundLatch = d; - return; - } - - case 0xb000: { - GalIrqFire = d & 1; - return; - } - - case 0xb001: { - if (!(d & 1)) { - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - } - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall FrogfZ80Read(UINT16 a) -{ - if (a >= 0xc000) { - UINT32 Offset = a - 0xc000; - UINT8 Result = 0xff; - if (Offset & 0x1000) Result &= ppi8255_r(0, (Offset >> 3) & 3); - if (Offset & 0x2000) Result &= ppi8255_r(1, (Offset >> 3) & 3); - return Result; - } - - switch (a) { - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall FrogfZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9000 && a <= 0x90ff) { - INT32 Offset = a - 0x9000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0xc000) { - INT32 Offset = a - 0xc000; - if (Offset & 0x1000) ppi8255_w(0, (Offset >> 3) & 3, d); - if (Offset & 0x2000) ppi8255_w(1, (Offset >> 3) & 3, d); - return; - } - - switch (a) { - case 0xa802: { - GalFlipScreenX = d & 1; - return; - } - - case 0xa804: { - GalIrqFire = d & 1; - return; - } - - case 0xa806: { - GalFlipScreenY = d & 1; - return; - } - - case 0xa809: { - // coin_count_1_w - return; - } - - case 0xa80e: { - // coin_count_0_w - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static void FroggerEncGfxPostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - BurnLoadRom(GalTempRom + 0x0800, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - for (UINT32 Offset = 0x0800; Offset < 0x1000; Offset++) GalTempRom[Offset] = BITSWAP08(GalTempRom[Offset], 7, 6, 5, 4, 3, 2, 0, 1); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - MapFrogger(); -} - -static INT32 FroggerEncGfxInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = FroggerEncGfxPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910; - - nRet = GalInit(); if (nRet) return 1; - FroggerSoundInit(); - - FroggerAdjust = 1; - - GalRenderBackgroundFunction = FroggerDrawBackground; - GalDrawBulletsFunction = NULL; - GalExtendTileInfoFunction = FroggerExtendTileInfo; - GalExtendSpriteInfoFunction = FroggerExtendSpriteInfo; - - KonamiPPIInit(); - - return nRet; -} - -static void FroggermcPostLoad() -{ - MapMooncrst(); - - ZetOpen(0); - ZetSetWriteHandler(FroggermcZ80Write); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetClose(); -} - -static INT32 FroggermcInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = FroggermcPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910; - - nRet = GalInit(); if (nRet) return 1; - FroggerSoundInit(); - - GalRenderBackgroundFunction = FroggerDrawBackground; - GalDrawBulletsFunction = NULL; - GalExtendTileInfoFunction = FroggerExtendTileInfo; - GalExtendSpriteInfoFunction = FroggerExtendSpriteInfo; - - return nRet; -} - -static INT32 FroggersInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapTheend; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910; - - nRet = GalInit(); if (nRet) return 1; - FroggerSoundInit(); - - KonamiPPIInit(); - - GalRenderBackgroundFunction = FroggerDrawBackground; - GalDrawBulletsFunction = NULL; - GalExtendTileInfoFunction = FroggerExtendTileInfo; - GalExtendSpriteInfoFunction = FroggerExtendSpriteInfo; - - return nRet; -} - -static void FrogfPostLoad() -{ - MapFrogger(); - - ZetOpen(0); - ZetSetReadHandler(FrogfZ80Read); - ZetSetWriteHandler(FrogfZ80Write); - ZetMemCallback(0x8800, 0xffff, 0); - ZetMemCallback(0x8800, 0xffff, 1); - ZetMemCallback(0x8800, 0xffff, 2); - ZetMapArea(0x8800, 0x8bff, 0, GalVideoRam); - ZetMapArea(0x8800, 0x8bff, 1, GalVideoRam); - ZetMapArea(0x8800, 0x8bff, 2, GalVideoRam); - ZetMapArea(0x9000, 0x90ff, 0, GalSpriteRam); - ZetMapArea(0x9000, 0x90ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 FrogfInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = FrogfPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910; - - nRet = GalInit(); if (nRet) return 1; - FroggerSoundInit(); - - KonamiPPIInit(); - - GalRenderBackgroundFunction = FroggerDrawBackground; - GalDrawBulletsFunction = NULL; - GalExtendTileInfoFunction = FroggerExtendTileInfo; - GalExtendSpriteInfoFunction = FroggerExtendSpriteInfo; - - return nRet; -} - -static void FroggPostLoad() -{ - ZetOpen(0); - ZetMapArea(0x4000, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 2, GalZ80Ram1); - ZetClose(); -} - -static INT32 FroggInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = FroggPostLoad; - - nRet = GalInit(); - - GalRenderBackgroundFunction = FroggerDrawBackground; - GalExtendTileInfoFunction = FroggerExtendTileInfo; - GalExtendSpriteInfoFunction = FroggerExtendSpriteInfo; - - return nRet; -} - -static void FroggrsPostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - BurnLoadRom(GalTempRom + 0x0800, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - for (UINT32 Offset = 0x0800; Offset < 0x1000; Offset++) GalTempRom[Offset] = BITSWAP08(GalTempRom[Offset], 7, 6, 5, 4, 3, 2, 0, 1); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - MapTheend(); -} - -static INT32 FroggrsInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = FroggrsPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910; - - nRet = GalInit(); if (nRet) return 1; - FroggerSoundInit(); - - KonamiPPIInit(); - - GalRenderBackgroundFunction = FroggerDrawBackground; - GalDrawBulletsFunction = NULL; - GalExtendTileInfoFunction = FroggerExtendTileInfo; - GalExtendSpriteInfoFunction = FroggerExtendSpriteInfo; - - return nRet; -} - -struct BurnDriver BurnDrvFrogger = { - "frogger", NULL, NULL, NULL, "1981", - "Frogger\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, FroggerRomInfo, FroggerRomName, NULL, NULL, FroggerInputInfo, FroggerDIPInfo, - FroggerEncGfxInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFroggers1 = { - "froggers1", "frogger", NULL, NULL, "1981", - "Frogger (Sega set 1)\0", NULL, "Konami (Sega license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, Froggers1RomInfo, Froggers1RomName, NULL, NULL, FroggerInputInfo, FroggerDIPInfo, - FroggerEncGfxInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFroggers2 = { - "froggers2", "frogger", NULL, NULL, "1981", - "Frogger (Sega set 2)\0", NULL, "Konami (Sega license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, Froggers2RomInfo, Froggers2RomName, NULL, NULL, FroggerInputInfo, FroggerDIPInfo, - FroggerEncGfxInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFroggers3 = { - "froggers3", "frogger", NULL, NULL, "1981", - "Frogger (Sega set 3)\0", NULL, "Konami (Sega license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, Froggers3RomInfo, Froggers3RomName, NULL, NULL, FroggerInputInfo, FroggerDIPInfo, - FroggerEncGfxInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFroggermc = { - "froggermc", "frogger", NULL, NULL, "1981", - "Frogger (Moon Cresta hardware)\0", "No Sound", "Konami (Sega license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, FroggermcRomInfo, FroggermcRomName, NULL, NULL, FroggermcInputInfo, FroggermcDIPInfo, - FroggermcInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFroggers = { - "froggers", "frogger", NULL, NULL, "1981", - "Frog\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, FroggersRomInfo, FroggersRomName, NULL, NULL, FroggerInputInfo, FroggerDIPInfo, - FroggersInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFrogf = { - "frogf", "frogger", NULL, NULL, "1981", - "Frog (Falcon bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, FrogfRomInfo, FrogfRomName, NULL, NULL, FroggerInputInfo, FroggerDIPInfo, - FrogfInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFrogg = { - "frogg", "frogger", NULL, NULL, "1981", - "Frog (Galaxian hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, FroggRomInfo, FroggRomName, NULL, NULL, FroggInputInfo, FroggDIPInfo, - FroggInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFroggrs = { - "froggrs", "frogger", NULL, NULL, "1981", - "Frogger (Scramble hardware)\0", NULL, "Coin Music", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, FroggrsRomInfo, FroggrsRomName, NULL, NULL, FroggerInputInfo, FroggerDIPInfo, - FroggrsInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Turtles based hardware -static struct BurnRomInfo TurtlesRomDesc[] = { - { "turt_vid.2c", 0x01000, 0xec5e61fb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "turt_vid.2e", 0x01000, 0xfd10821e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "turt_vid.2f", 0x01000, 0xddcfc5fa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "turt_vid.2h", 0x01000, 0x9e71696c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "turt_vid.2j", 0x01000, 0xfcd49fef, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "turt_snd.5c", 0x01000, 0xf0c30f9a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "turt_snd.5d", 0x01000, 0xaf5fc43c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "turt_vid.5h", 0x00800, 0xe5999d52, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "turt_vid.5f", 0x00800, 0xc3ffd655, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "turtles.clr", 0x00020, 0xf3ef02dd, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Turtles) -STD_ROM_FN(Turtles) - -static struct BurnRomInfo TurpinRomDesc[] = { - { "m1", 0x01000, 0x89177473, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m2", 0x01000, 0x4c6ca5c6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m3", 0x01000, 0x62291652, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "turt_vid.2h", 0x01000, 0x9e71696c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "m5", 0x01000, 0x7d2600f2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "turt_snd.5c", 0x01000, 0xf0c30f9a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "turt_snd.5d", 0x01000, 0xaf5fc43c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "turt_vid.5h", 0x00800, 0xe5999d52, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "turt_vid.5f", 0x00800, 0xc3ffd655, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "turtles.clr", 0x00020, 0xf3ef02dd, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Turpin) -STD_ROM_FN(Turpin) - -static struct BurnRomInfo SixhundredRomDesc[] = { - { "600_vid.2c", 0x01000, 0x8ee090ae, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "600_vid.2e", 0x01000, 0x45bfaff2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "600_vid.2f", 0x01000, 0x9f4c8ed7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "600_vid.2h", 0x01000, 0xa92ef056, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "600_vid.2j", 0x01000, 0x6dadd72d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "600_snd.5c", 0x01000, 0x1773c68e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "600_snd.5d", 0x01000, 0xa311b998, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "600_vid.5h", 0x00800, 0x006c3d56, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "600_vid.5f", 0x00800, 0x7dbc0426, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "turtles.clr", 0x00020, 0xf3ef02dd, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Sixhundred) -STD_ROM_FN(Sixhundred) - -static struct BurnRomInfo TurpinsRomDesc[] = { - { "t1.bin", 0x01000, 0x89dd50cc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "t3.bin", 0x01000, 0x9562dc29, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "t4.bin", 0x01000, 0x62291652, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "t5.bin", 0x01000, 0x804118e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "t2.bin", 0x01000, 0x8024f678, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "8tur.bin", 0x01000, 0xc97ed8ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5tur.bin", 0x01000, 0xaf5fc43c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "tur.4f", 0x00800, 0xe5999d52, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tur.5f", 0x00800, 0xc3ffd655, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "turtles.clr", 0x00020, 0xf3ef02dd, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Turpins) -STD_ROM_FN(Turpins) - -static struct BurnRomInfo AmidarRomDesc[] = { - { "1.2c", 0x01000, 0x621b74de, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.2e", 0x01000, 0x38538b98, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.2f", 0x01000, 0x099ecb24, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.2h", 0x01000, 0xba149a93, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.2j", 0x01000, 0xeecc1abf, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "s1.5c", 0x01000, 0x8ca7b750, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "s2.5d", 0x01000, 0x9b5bdc0a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "c2.5f", 0x00800, 0x2cfe5ede, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "c2.5d", 0x00800, 0x57c4fd0d, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "amidar.clr", 0x00020, 0xf940dcc3, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Amidar) -STD_ROM_FN(Amidar) - -static struct BurnRomInfo Amidar1RomDesc[] = { - { "amidar.2c", 0x01000, 0xc294bf27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "amidar.2e", 0x01000, 0xe6e96826, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "amidar.2f", 0x01000, 0x3656be6f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "amidar.2h", 0x01000, 0x1be170bd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "amidar.5c", 0x01000, 0xc4b66ae4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "amidar.5d", 0x01000, 0x806785af, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "amidar.5f", 0x00800, 0x5e51e84d, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "amidar.5h", 0x00800, 0x2f7f1c30, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "amidar.clr", 0x00020, 0xf940dcc3, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Amidar1) -STD_ROM_FN(Amidar1) - -static struct BurnRomInfo AmidaruRomDesc[] = { - { "amidarus.2c", 0x01000, 0x951e0792, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "amidarus.2e", 0x01000, 0xa1a3a136, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "amidarus.2f", 0x01000, 0xa5121bf5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "amidarus.2h", 0x01000, 0x051d1c7f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "amidarus.2j", 0x01000, 0x351f00d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "amidarus.5c", 0x01000, 0x8ca7b750, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "amidarus.5d", 0x01000, 0x9b5bdc0a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "amidarus.5f", 0x00800, 0x2cfe5ede, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "amidarus.5h", 0x00800, 0x57c4fd0d, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "amidar.clr", 0x00020, 0xf940dcc3, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Amidaru) -STD_ROM_FN(Amidaru) - -static struct BurnRomInfo AmidaroRomDesc[] = { - { "107.2cd", 0x01000, 0xc52536be, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "108.2fg", 0x01000, 0x38538b98, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "109.2fg", 0x01000, 0x69907f0f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "110.2h", 0x01000, 0xba149a93, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "111.2j", 0x01000, 0x20d01c2e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "amidarus.5c", 0x01000, 0x8ca7b750, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "amidarus.5d", 0x01000, 0x9b5bdc0a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "amidarus.5f", 0x00800, 0x2cfe5ede, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "113.5h", 0x00800, 0xbcdce168, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "amidar.clr", 0x00020, 0xf940dcc3, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Amidaro) -STD_ROM_FN(Amidaro) - -static struct BurnRomInfo AmidarbRomDesc[] = { - { "ami2gor.2c", 0x01000, 0x9ad2dcd2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.2f", 0x01000, 0x66282ff5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.2j", 0x01000, 0xb0860e31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.2m", 0x01000, 0x4a4086c9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "8.11d", 0x01000, 0x8ca7b750, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "9.9d", 0x01000, 0x9b5bdc0a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5.5f", 0x00800, 0x2082ad0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "6.5h", 0x00800, 0x3029f94f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "n82s123n.6e", 0x00020, 0x01004d3f, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Amidarb) -STD_ROM_FN(Amidarb) - -static struct BurnRomInfo AmigoRomDesc[] = { - { "2732.a1", 0x01000, 0x930dc856, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2732.a2", 0x01000, 0x66282ff5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2732.a3", 0x01000, 0xe9d3dc76, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2732.a4", 0x01000, 0x4a4086c9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "amidarus.5c", 0x01000, 0x8ca7b750, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "amidarus.5d", 0x01000, 0x9b5bdc0a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "2716.a6", 0x00800, 0x2082ad0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "2716.a5", 0x00800, 0x3029f94f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "amidar.clr", 0x00020, 0xf940dcc3, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Amigo) -STD_ROM_FN(Amigo) - -static struct BurnRomInfo AmidarsRomDesc[] = { - { "am2d", 0x00800, 0x24b79547, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "am2e", 0x00800, 0x4c64161e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "am2f", 0x00800, 0xb3987a72, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "am2h", 0x00800, 0x29873461, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "am2j", 0x00800, 0x0fdd54d8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "am2l", 0x00800, 0x5382f7ed, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "am2m", 0x00800, 0x1d7109e9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "am2p", 0x00800, 0xc9163ac6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "amidarus.5c", 0x01000, 0x8ca7b750, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "amidarus.5d", 0x01000, 0x9b5bdc0a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "2716.a6", 0x00800, 0x2082ad0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "2716.a5", 0x00800, 0x3029f94f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "amidar.clr", 0x00020, 0xf940dcc3, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Amidars) -STD_ROM_FN(Amidars) - -UINT8 __fastcall TurpinsZ80Read(UINT16 a) -{ - switch (a) { - case 0xa000: { - return 0xff - GalInput[0] - GalDip[0]; - } - - case 0xa001: { - return 0xff - GalInput[1] - GalDip[1]; - } - - case 0xa002: { - return 0xff - GalInput[2] - GalDip[2]; - } - - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall TurpinsZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa000: { - GalBackgroundRed = d & 1; - return; - } - - case 0xa020: { - GalBackgroundGreen = d & 1; - return; - } - - case 0xa028: { - GalBackgroundBlue = d & 1; - return; - } - - - case 0xa030: { - // coin_count_0_w - return; - } - - case 0xa038: { - // coin_count_1_w - return; - } - - - case 0xa801: { - GalIrqFire = d & 1; - return; - } - - case 0xa806: { - GalFlipScreenX = d & 1; - return; - } - - case 0xa807: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 TurtlesInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapTurtles; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); - KonamiSoundInit(); - - GalRenderBackgroundFunction = TurtlesDrawBackground; - GalDrawBulletsFunction = NULL; - - KonamiPPIInit(); - - return nRet; -} - -static void TurpinsPostLoad() -{ - MapTurtles(); - - ZetOpen(0); - ZetSetReadHandler(TurpinsZ80Read); - ZetSetWriteHandler(TurpinsZ80Write); - ZetClose(); -} - -static INT32 TurpinsInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = TurpinsPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); - KonamiSoundInit(); - - GalRenderBackgroundFunction = TurtlesDrawBackground; - GalDrawBulletsFunction = NULL; - - return nRet; -} - -struct BurnDriver BurnDrvTurtles = { - "turtles", NULL, NULL, NULL, "1981", - "Turtles\0", NULL, "Konami (Stern license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, TurtlesRomInfo, TurtlesRomName, NULL, NULL, TurtlesInputInfo, TurtlesDIPInfo, - TurtlesInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTurpin = { - "turpin", "turtles", NULL, NULL, "1981", - "Turpin\0", NULL, "Konami (Sega license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, TurpinRomInfo, TurpinRomName, NULL, NULL, TurtlesInputInfo, TurpinDIPInfo, - TurtlesInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSixhundred = { - "600", "turtles", NULL, NULL, "1981", - "600\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, SixhundredRomInfo, SixhundredRomName, NULL, NULL, TurtlesInputInfo, TurtlesDIPInfo, - TurtlesInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTurpins = { - "turpins", "turtles", NULL, NULL, "1981", - "Turpin (bootleg on Scramble hardware)\0", "No Sound", "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, TurpinsRomInfo, TurpinsRomName, NULL, NULL, TurtlesInputInfo, TurtlesDIPInfo, - TurpinsInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAmidar = { - "amidar", NULL, NULL, NULL, "1981", - "Amidar\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, AmidarRomInfo, AmidarRomName, NULL, NULL, AmidarInputInfo, AmidaruDIPInfo, - TurtlesInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAmidar1 = { - "amidar1", "amidar", NULL, NULL, "1981", - "Amidar (older)\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, Amidar1RomInfo, Amidar1RomName, NULL, NULL, AmidarInputInfo, AmidarDIPInfo, - TurtlesInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAmidaru = { - "amidaru", "amidar", NULL, NULL, "1982", - "Amidar (Stern)\0", NULL, "Konami (Stern license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, AmidaruRomInfo, AmidaruRomName, NULL, NULL, AmidarInputInfo, AmidaruDIPInfo, - TurtlesInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAmidaro = { - "amidaro", "amidar", NULL, NULL, "1982", - "Amidar (Olympia)\0", NULL, "Konami (Olympia license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, AmidaroRomInfo, AmidaroRomName, NULL, NULL, AmidarInputInfo, AmidaroDIPInfo, - TurtlesInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAmidarb = { - "amidarb", "amidar", NULL, NULL, "1982", - "Amidar (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, AmidarbRomInfo, AmidarbRomName, NULL, NULL, AmidarInputInfo, AmidaruDIPInfo, - TurtlesInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAmigo = { - "amigo", "amidar", NULL, NULL, "1982", - "Amigo\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, AmigoRomInfo, AmigoRomName, NULL, NULL, AmidarInputInfo, AmidaruDIPInfo, - TurtlesInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAmidars = { - "amidars", "amidar", NULL, NULL, "1982", - "Amidar (Scramble hardware)\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, AmidarsRomInfo, AmidarsRomName, NULL, NULL, AmidarInputInfo, AmidarsDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// The End / Scramble based hardware -static struct BurnRomInfo TheendRomDesc[] = { - { "ic13_1t.bin", 0x00800, 0x93e555ba, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ic14_2t.bin", 0x00800, 0x2de7ad27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ic15_3t.bin", 0x00800, 0x035f750b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ic16_4t.bin", 0x00800, 0x61286b5c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ic17_5t.bin", 0x00800, 0x434a8f68, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ic18_6t.bin", 0x00800, 0xdc4cc786, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ic56_1.bin", 0x00800, 0x7a141f29, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ic55_2.bin", 0x00800, 0x218497c1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "ic30_2c.bin", 0x00800, 0x68ccf7bf, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ic31_1c.bin", 0x00800, 0x4a48c999, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6331-1j.86", 0x00020, 0x24652bc4, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Theend) -STD_ROM_FN(Theend) - -static struct BurnRomInfo TheendsRomDesc[] = { - { "the_end_ra3_13.ic13", 0x00800, 0x90e5ab14, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "the_end_ra3_14.ic14", 0x00800, 0x950f0a07, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "the_end_ra3_15.ic15", 0x00800, 0x6786bcf5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "the_end_ra3_16.ic16", 0x00800, 0x380a0017, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "the_end_ra3_17.ic17", 0x00800, 0xaf067b7f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "the_end_ra3_18.ic18", 0x00800, 0xa0411b93, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "the_end_ra3_56.ic56", 0x00800, 0x3b2c2f70, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "the_end_ra2_55.ic55", 0x00800, 0xe0429e50, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "the_end_ra3_30.ic30", 0x00800, 0x527fd384, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "the_end_ra3_31.ic31", 0x00800, 0xaf6d09b6, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6331-1j.86", 0x00020, 0x24652bc4, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Theends) -STD_ROM_FN(Theends) - -static struct BurnRomInfo ScrambleRomDesc[] = { - { "s1.2d", 0x00800, 0xea35ccaa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "s2.2e", 0x00800, 0xe7bba1b3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "s3.2f", 0x00800, 0x12d7fc3e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "s4.2h", 0x00800, 0xb59360eb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "s5.2j", 0x00800, 0x4919a91c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "s6.2l", 0x00800, 0x26a4547b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "s7.2m", 0x00800, 0x0bb49470, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "s8.2p", 0x00800, 0x6a5740e5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ot1.5c", 0x00800, 0xbcd297f0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot2.5d", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot3.5e", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "c2.5f", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "c1.5h", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scramble) -STD_ROM_FN(Scramble) - -static struct BurnRomInfo ScramblesRomDesc[] = { - { "2d", 0x00800, 0xb89207a1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e", 0x00800, 0xe9b4b9eb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f", 0x00800, 0xa1f14f4c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h", 0x00800, 0x591bc0d9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j", 0x00800, 0x22f11b6b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2l", 0x00800, 0x705ffe49, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2m", 0x00800, 0xea26c35c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2p", 0x00800, 0x94d8f5e3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ot1.5c", 0x00800, 0xbcd297f0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot2.5d", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot3.5e", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f", 0x00800, 0x5f30311a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h", 0x00800, 0x516e029e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scrambles) -STD_ROM_FN(Scrambles) - -static struct BurnRomInfo ScramblebfRomDesc[] = { - { "scf1.2d", 0x00800, 0xb126aa1f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scf2.2e", 0x00800, 0xce25fb77, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scns3.2f", 0x00800, 0xeec265ee, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scns4.2h", 0x00800, 0xdd380a22, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scns5.2j", 0x00800, 0x92980e72, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scns6.2l", 0x00800, 0x9fd96374, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scns7.2m", 0x00800, 0x88ac07a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scns8.2p", 0x00800, 0x75232e09, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ot1ns.5c", 0x00800, 0xbe037cf6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot2.5d", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot3.5e", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "c2.5f", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "c1.5h", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scramblebf) -STD_ROM_FN(Scramblebf) - -static struct BurnRomInfo ScrambpRomDesc[] = { - { "b1-2716.cpu", 0x00800, 0x63420017, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b2-2716.cpu", 0x00800, 0x66ebc070, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b3-2716.cpu", 0x00800, 0x317548fd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b4-2716.cpu", 0x00800, 0xdd380a22, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b5-2716.cpu", 0x00800, 0xfa4f1a70, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b6-2716.cpu", 0x00800, 0x9fd96374, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b7-2716.cpu", 0x00800, 0x88ac07a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b8-2716.cpu", 0x00800, 0xd20088ee, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "b11-2716.cpu", 0x00800, 0xbe037cf6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "b12-2716.cpu", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "b13-2716.cpu", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "b9-2716.cpu", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "b10-2716.cpu", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scrambp) -STD_ROM_FN(Scrambp) - -static struct BurnRomInfo ScramceRomDesc[] = { - { "es1.2c", 0x00800, 0x726fb19e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "es2.2e", 0x00800, 0x66ebc070, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "es3.2f", 0x00800, 0x317548fd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "es4.2h", 0x00800, 0xdd380a22, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "es5.2j", 0x00800, 0xfa4f1a70, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "es6.2l", 0x00800, 0x9fd96374, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "es7.2m", 0x00800, 0x88ac07a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "es8.2p", 0x00800, 0xd20088ee, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "11.5c", 0x00800, 0xbe037cf6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "12.5d", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "13.5e", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "9.5f", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "10.5h", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom7051.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scramce) -STD_ROM_FN(Scramce) - -static struct BurnRomInfo ScramptRomDesc[] = { - { "cx8-2716.cpu", 0x00800, 0x12b97cc6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cx4-2716.cpu", 0x00800, 0x66ebc070, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cx9-2716.cpu", 0x00800, 0x317548fd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cx5-2716.cpu", 0x00800, 0xdd380a22, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cx10-2716.cpu", 0x00800, 0xfa4f1a70, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cx6-2716.cpu", 0x00800, 0x9fd96374, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cx11-2716.cpu", 0x00800, 0x88ac07a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cx7-2716.cpu", 0x00800, 0xc9a6c489, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "cx3-2716.cpu", 0x00800, 0xbe037cf6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "cx2-2716.cpu", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "cx1-2716.cpu", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "cx12-2716.cpu", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "cx13-2716.cpu", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scrampt) -STD_ROM_FN(Scrampt) - -static struct BurnRomInfo ScramrfRomDesc[] = { - { "2c.cpu", 0x01000, 0x85fa7de3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f.cpu", 0x01000, 0x5b500c90, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j.cpu", 0x01000, 0x179e1c1f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2m.cpu", 0x01000, 0x4a4bb870, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5c.cpu", 0x00800, 0xbe037cf6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5d.cpu", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5e.cpu", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f.cpu", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h.cpu", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scramrf) -STD_ROM_FN(Scramrf) - -static struct BurnRomInfo OffensivRomDesc[] = { - { "2716-9C.bin", 0x00800, 0xcc2ee7f5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2716-9E.bin", 0x00800, 0x66ebc070, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2716-9F.bin", 0x00800, 0x317548fd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2716-9H.bin", 0x00800, 0xdd380a22, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2716-9J.bin", 0x00800, 0xfa4f1a70, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2716-9L.bin", 0x00800, 0x9fd96374, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2716-9M.bin", 0x00800, 0x88ac07a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2716-9P.bin", 0x00800, 0xfe2866f5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "2716-5C.bin", 0x00800, 0xbe037cf6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "2716-5D.bin", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "2716-5E.bin", 0x00800, 0xad833f7e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "2716-6F.bin", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "2716-6H.bin", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123-NMI6331-1J-5E.bin", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Offensiv) -STD_ROM_FN(Offensiv) - -static struct BurnRomInfo ScramblebbRomDesc[] = { - { "1", 0x00800, 0x8ba174c4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2", 0x00800, 0x43cb40a4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3", 0x00800, 0xeec265ee, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4", 0x00800, 0xdd380a22, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5", 0x00800, 0x92980e72, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6", 0x00800, 0x9fd96374, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7", 0x00800, 0x88ac07a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8", 0x00800, 0x75232e09, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ot1.5c", 0x00800, 0xbcd297f0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot2.5d", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot3.5e", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "9", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "10", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scramblebb) -STD_ROM_FN(Scramblebb) - -static struct BurnRomInfo StrfbombRomDesc[] = { - { "1.2c", 0x00800, 0xb102aaa0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.2e", 0x00800, 0xd4155703, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.2f", 0x00800, 0xa9568c89, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.2h", 0x00800, 0x663b6c35, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.2j", 0x00800, 0x4919a91c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.2l", 0x00800, 0x4ec66ae3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7.2m", 0x00800, 0x0feb0192, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.2p", 0x00800, 0x280a6142, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ot1.5c", 0x00800, 0xbcd297f0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot2.5d", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot3.5e", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "9.5f", 0x00800, 0x3abeff25, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "10.5h", 0x00800, 0x79ecacbe, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Strfbomb) -STD_ROM_FN(Strfbomb) - -static struct BurnRomInfo ExplorerRomDesc[] = { - { "10l.bin", 0x01000, 0xd5adf626, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "9l.bin", 0x01000, 0x48e32788, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8l.bin", 0x01000, 0xc0dbdbde, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7l.bin", 0x01000, 0x9b30d227, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "3f.bin", 0x01000, 0x9faf18cf, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "4b.bin", 0x00800, 0xe910b5c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "c2.5f", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "c1.5h", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Explorer) -STD_ROM_FN(Explorer) - -static struct BurnRomInfo BomberRomDesc[] = { - { "1.3l", 0x00800, 0x8c30c7c3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.3k", 0x00800, 0x1fca370c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.3h", 0x00800, 0x8a714167, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.3f", 0x00800, 0xdd380a22, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.3e", 0x00800, 0x92980e72, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.3d", 0x00800, 0x9fd96374, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7.3c", 0x00800, 0x88ac07a0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.3a", 0x00800, 0x75232e09, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "11.8k", 0x00800, 0x97ba15e8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "12.8l", 0x00800, 0x6510761d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "c2.5f", 0x00800, 0x4708845b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "c1.5h", 0x00800, 0x11fd2887, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Bomber) -STD_ROM_FN(Bomber) - -static struct BurnRomInfo AtlantisRomDesc[] = { - { "2c", 0x00800, 0x0e485b9a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e", 0x00800, 0xc1640513, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f", 0x00800, 0xeec265ee, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h", 0x00800, 0xa5d2e442, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j", 0x00800, 0x45f7cf34, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2l", 0x00800, 0xf335b96b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ot1.5c", 0x00800, 0xbcd297f0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot2.5d", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ot3.5e", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f", 0x00800, 0x57f9c6b9, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h", 0x00800, 0xe989f325, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Atlantis) -STD_ROM_FN(Atlantis) - -static struct BurnRomInfo Atlantis2RomDesc[] = { - { "boa_1.2c", 0x00800, 0xad348089, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "boa_2.2e", 0x00800, 0xcaa705d1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "boa_3.2f", 0x00800, 0xac5e9ec1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "boa_4.2h", 0x00800, 0x04792d90, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "boa_5.2j", 0x00800, 0x45f7cf34, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "boa_6.2l", 0x00800, 0xb297bd4b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "boa_7.2m", 0x00800, 0xa50bf8d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "boa_8.2p", 0x00800, 0xd2c5c984, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "boa_11.5c", 0x00800, 0xbe037cf6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "boa_12.5d", 0x00800, 0xde7912da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "boa_13.5e", 0x00800, 0xba2fa933, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "boa_9.5f", 0x00800, 0x55cd5acd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "boa_10.5h", 0x00800, 0x72e773b8, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Atlantis2) -STD_ROM_FN(Atlantis2) - -static struct BurnRomInfo CkongsRomDesc[] = { - { "vid_2c.bin", 0x01000, 0x49a8c234, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_2e.bin", 0x01000, 0xf1b667f1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_2f.bin", 0x01000, 0xb194b75d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_2h.bin", 0x01000, 0x2052ba8a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_2j.bin", 0x01000, 0xb377afd0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_2l.bin", 0x01000, 0xfe65e691, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "turt_snd.5c", 0x01000, 0xf0c30f9a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "snd_5d.bin", 0x01000, 0x892c9547, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "vid_5f.bin", 0x01000, 0x7866d2cb, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "vid_5h.bin", 0x01000, 0x7311a101, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "vid_6e.bin", 0x00020, 0x5039af97, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Ckongs) -STD_ROM_FN(Ckongs) - -static struct BurnRomInfo MarsRomDesc[] = { - { "u26.3", 0x00800, 0x2f88892c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u56.4", 0x00800, 0x9e6bcbf7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u69.5", 0x00800, 0xdf496e6e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u98.6", 0x00800, 0x75f274bb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u114.7", 0x00800, 0x497fd8d0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u133.8", 0x00800, 0x3d4cd59f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "u39.9", 0x00800, 0xbb5968b9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "u51.10", 0x00800, 0x75fd7720, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "u78.11", 0x00800, 0x72a492da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "u72.1", 0x00800, 0x279789d0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "u101.2", 0x00800, 0xc5dc627f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mars) -STD_ROM_FN(Mars) - -static struct BurnRomInfo DevilfshRomDesc[] = { - { "u26.1", 0x00800, 0xec047d71, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u56.2", 0x00800, 0x0138ade9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u69.3", 0x00800, 0x5dd0b3fc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u98.4", 0x00800, 0xded0b745, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u114.5", 0x00800, 0x5fd40176, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u133.6", 0x00800, 0x03538336, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u143.7", 0x00800, 0x64676081, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "u163.8", 0x00800, 0xbc3d6770, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "u39.9", 0x00800, 0x09987e2e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "u51.10", 0x00800, 0x1e2b1471, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "u78.11", 0x00800, 0x45279aaa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "u72.12", 0x01000, 0x5406508e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "u101.13", 0x01000, 0x8c4018b6, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Devilfsh) -STD_ROM_FN(Devilfsh) - -static struct BurnRomInfo Newsin7RomDesc[] = { - { "newsin.1", 0x01000, 0xe6c23fe0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "newsin.2", 0x01000, 0x3d477b5f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "newsin.3", 0x01000, 0x7dfa9af0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "newsin.4", 0x01000, 0xd1b0ba19, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "newsin.5", 0x01000, 0x06275d59, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "newsin.13", 0x00800, 0xd88489a2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "newsin.12", 0x00800, 0xb154a7af, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "newsin.11", 0x00800, 0x7ade709b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "newsin.9", 0x01000, 0x6b87adff, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "newsin.8", 0x01000, 0x0c5b895a, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "newsin.7", 0x01000, 0x6bc5d64f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "newsin.6", 0x00020, 0x5cf2cd8d, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Newsin7) -STD_ROM_FN(Newsin7) - -static struct BurnRomInfo MrkougarRomDesc[] = { - { "2732-7.bin", 0x01000, 0xfd060ffb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2732-6.bin", 0x01000, 0x9e05d868, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2732-5.bin", 0x01000, 0xcbc7c536, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "atw-6w-2.bin", 0x01000, 0xaf42a371, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "atw-6y-3.bin", 0x01000, 0x862b8902, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "atw-6z-4.bin", 0x01000, 0xa0396cc8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "2732-1.bin", 0x01000, 0x60ef1d43, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mrkougar) -STD_ROM_FN(Mrkougar) - -static struct BurnRomInfo Mrkougar2RomDesc[] = { - { "atw-7l-7.bin", 0x01000, 0x7b34b198, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "atw-7k-6.bin", 0x01000, 0xfbca23c7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "atw-7h-5.bin", 0x01000, 0x05b257a2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "atw-6w-2.bin", 0x01000, 0xaf42a371, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "atw-6y-3.bin", 0x01000, 0x862b8902, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "atw-6z-4.bin", 0x01000, 0xa0396cc8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "atw-1h-1.bin", 0x01000, 0x38fdfb63, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "atw-prom.bin", 0x00020, 0xc65db188, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mrkougar2) -STD_ROM_FN(Mrkougar2) - -static struct BurnRomInfo MrkougbRomDesc[] = { - { "p01.bin", 0x00800, 0xdea0cde1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p02.bin", 0x00800, 0xc8017751, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p03.bin", 0x00800, 0xb8921984, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p04.bin", 0x00800, 0xb3c9754c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p05.bin", 0x00800, 0x8d94adbc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p06.bin", 0x00800, 0xacc921ff, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "atw-6w-2.bin", 0x01000, 0xaf42a371, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "atw-6y-3.bin", 0x01000, 0x862b8902, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "atw-6z-4.bin", 0x01000, 0xa0396cc8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "g07.bin", 0x00800, 0x0ecfd116, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g08.bin", 0x00800, 0x00bfa3c6, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "atw-prom.bin", 0x00020, 0xc65db188, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mrkougb) -STD_ROM_FN(Mrkougb) - -static struct BurnRomInfo Mrkougb2RomDesc[] = { - { "mrk1.bin", 0x00800, 0xfc93acb9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p02.bin", 0x00800, 0xc8017751, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p03.bin", 0x00800, 0xb8921984, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p04.bin", 0x00800, 0xb3c9754c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p05.bin", 0x00800, 0x8d94adbc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p06.bin", 0x00800, 0xacc921ff, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "atw-6w-2.bin", 0x01000, 0xaf42a371, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "atw-6y-3.bin", 0x01000, 0x862b8902, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "atw-6z-4.bin", 0x01000, 0xa0396cc8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "g07.bin", 0x00800, 0x0ecfd116, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "g08.bin", 0x00800, 0x00bfa3c6, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "atw-prom.bin", 0x00020, 0xc65db188, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mrkougb2) -STD_ROM_FN(Mrkougb2) - -static struct BurnRomInfo HotshockRomDesc[] = { - { "0d.l10", 0x01000, 0x3e8aeaeb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "1d.l9", 0x01000, 0x0eab3246, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2d.l8", 0x01000, 0xe646bde3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3d.l7", 0x01000, 0x5bde9312, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "6d.b3", 0x01000, 0xc5e02651, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "7d.b4", 0x01000, 0x49dc113d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "4d.h3", 0x01000, 0x751c850e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5d.h5", 0x01000, 0xfc74282e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "18s030.1k", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Hotshock) -STD_ROM_FN(Hotshock) - -static struct BurnRomInfo HotshockbRomDesc[] = { - { "hotshock.l10", 0x01000, 0x401078f7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "hotshock.l9", 0x01000, 0xaf76c237, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "hotshock.l8", 0x01000, 0x30486031, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "hotshock.l7", 0x01000, 0x5bde9312, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "hotshock.b3", 0x01000, 0x0092f0e2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "hotshock.b4", 0x01000, 0xc2135a44, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "hotshock.h4", 0x01000, 0x60bdaea9, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "hotshock.h5", 0x01000, 0x4ef17453, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Hotshockb) -STD_ROM_FN(Hotshockb) - -static struct BurnRomInfo ConquerRomDesc[] = { - { "conquer3.l10", 0x01000, 0xa33a824f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "conquer2.l9", 0x01000, 0x3ffa8285, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "conquer1.l8", 0x01000, 0x9ded2dff, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "conquer6.b3", 0x01000, 0xd363b2ea, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "conquer7.b4", 0x01000, 0xe6a63d71, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "conquer4.h3", 0x01000, 0xac533893, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "conquer5.h5", 0x01000, 0xd884fd49, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Conquer) -STD_ROM_FN(Conquer) - -static struct BurnRomInfo CavelonRomDesc[] = { - { "2.bin", 0x02000, 0xa3b353ac, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "1.bin", 0x02000, 0x3f62efd6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.bin", 0x02000, 0x39d74e4e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "1c_snd.bin", 0x00800, 0xf58dcf55, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "h.bin", 0x01000, 0xd44fcd6f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k.bin", 0x01000, 0x59bc7f9e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "cavelon.clr", 0x00020, 0xd133356b, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Cavelon) -STD_ROM_FN(Cavelon) - -static struct BurnRomInfo MimonscrRomDesc[] = { - { "mm1", 0x01000, 0x0399a0c4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm2", 0x01000, 0x2c5e971e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm3", 0x01000, 0x24ce1ce3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm4", 0x01000, 0xc83fb639, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm5", 0x01000, 0xa9f12dfc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm6", 0x01000, 0xe492a40c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm7", 0x01000, 0x5339928d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm8", 0x01000, 0xeee7a12e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mmsound1", 0x01000, 0x2d14c527, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "mmsnd2a", 0x01000, 0x35ed0f96, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "mmgfx1", 0x02000, 0x4af47337, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mmgfx2", 0x02000, 0xdef47da8, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "c01s.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mimonscr) -STD_ROM_FN(Mimonscr) - -static struct BurnRomInfo MimonscraRomDesc[] = { - { "1.c2", 0x01000, 0xcfff26f3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.e2", 0x01000, 0x1fca805f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.f2", 0x01000, 0x24ce1ce3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.h2", 0x01000, 0xc83fb639, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.j2", 0x01000, 0xa9f12dfc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.l2", 0x01000, 0xe492a40c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "7.m2", 0x01000, 0x5339928d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "8.p2", 0x01000, 0x0b9915b8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "2732.c5", 0x01000, 0x5995f24b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "2732.d5", 0x01000, 0x35ed0f96, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "top.g5", 0x01000, 0xf73a8412, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "bottom.g5", 0x01000, 0x3828c9db, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "top.f5", 0x01000, 0x9e0e9289, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "bottom.f5", 0x01000, 0x92085b0c, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mb7051.e6", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mimonscra) -STD_ROM_FN(Mimonscra) - -UINT8 __fastcall ExplorerZ80Read(UINT16 a) -{ - switch (a) { - case 0x7000: { - // watchdog read - return 0xff; - } - - case 0x8000: { - return GalInput[0] | GalDip[0]; - } - - case 0x8001: { - return GalInput[1] | GalDip[1]; - } - - case 0x8002: { - return GalInput[2] | GalDip[2]; - } - - case 0x8003: { - return GalInput[3] | GalDip[3]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall ExplorerZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0x5100 && a <= 0x51ff) { - INT32 Offset = a - 0x5100; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6801: { - GalIrqFire = d & 1; - return; - } - - case 0x6802: { - // coin_count_0_w - return; - } - - case 0x6803: { - GalBackgroundEnable = d & 1; - return; - } - - case 0x6804: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x6806: { - GalFlipScreenX = d & 1; - return; - } - - case 0x6807: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7000: { - // watchdog write - return; - } - - case 0x8000: { - GalSoundLatch = d; - return; - } - - case 0x9000: { - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall CkongsZ80Read(UINT16 a) -{ - switch (a) { - case 0x7000: - case 0x7001: - case 0x7002: - case 0x7003: { - return ppi8255_r(0, a - 0x7000); - } - - case 0x7800: - case 0x7801: - case 0x7802: - case 0x7803: { - return ppi8255_r(1, a - 0x7800); - } - - case 0xb000: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall CkongsZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x7000: - case 0x7001: - case 0x7002: - case 0x7003: { - ppi8255_w(0, a - 0x7000, d); - return; - } - - case 0x7800: - case 0x7801: - case 0x7802: - case 0x7803: { - ppi8255_w(1, a - 0x7800, d); - return; - } - - case 0xa801: { - GalIrqFire = d & 1; - return; - } - - case 0xa806: { - GalFlipScreenX = d & 1; - return; - } - - case 0xa807: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb000: { - // watchdog write - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall MarsZ80Read(UINT16 a) -{ - if (a >= 0x8100 && a <= 0x810f) { - INT32 Offset = a - 0x8100; - return ppi8255_r(0, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01)); - } - - if (a >= 0x8200 && a <= 0x820f) { - INT32 Offset = a - 0x8200; - return ppi8255_r(1, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01)); - } - - switch (a) { - case 0x7000: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall MarsZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0x8100 && a <= 0x810f) { - INT32 Offset = a - 0x8100; - ppi8255_w(0, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01), d); - return; - } - - if (a >= 0x8200 && a <= 0x820f) { - INT32 Offset = a - 0x8200; - ppi8255_w(1, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01), d); - return; - } - - switch (a) { - case 0x6800: { - // coin_count_1_w - return; - } - - case 0x6801: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x6802: { - GalIrqFire = d & 1; - return; - } - - case 0x6808: { - // coin_count_0_w - return; - } - - case 0x6809: { - GalFlipScreenX = d & 1; - return; - } - - case 0x680b: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Newsin7Z80Read(UINT16 a) -{ - if (a >= 0x8200 && a <= 0x820f) { - INT32 Offset = a - 0x8200; - return ppi8255_r(1, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01)); - } - - if (a >= 0xc100 && a <= 0xc10f) { - INT32 Offset = a - 0xc100; - return ppi8255_r(0, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01)); - } - - switch (a) { - case 0x7000: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall Newsin7Z80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0x8200 && a <= 0x820f) { - INT32 Offset = a - 0x8200; - ppi8255_w(1, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01), d); - return; - } - - if (a >= 0xc100 && a <= 0xc10f) { - INT32 Offset = a - 0xc100; - ppi8255_w(0, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01), d); - return; - } - - switch (a) { - case 0x6800: { - // coin_count_1_w - return; - } - - case 0x6801: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x6802: { - GalIrqFire = d & 1; - return; - } - - case 0x6808: { - // coin_count_0_w - return; - } - - case 0x6809: { - GalFlipScreenX = d & 1; - return; - } - - case 0x680b: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall MrkougarZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0x8100 && a <= 0x810f) { - INT32 Offset = a - 0x8100; - ppi8255_w(0, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01), d); - return; - } - - if (a >= 0x8200 && a <= 0x820f) { - INT32 Offset = a - 0x8200; - ppi8255_w(1, ((Offset >> 2) & 0x02) | ((Offset >> 1) & 0x01), d); - return; - } - - switch (a) { - case 0x6800: { - // coin_count_1_w - return; - } - - case 0x6801: { - GalIrqFire = d & 1; - return; - } - - case 0x6808: { - // coin_count_0_w - return; - } - - case 0x6809: { - GalFlipScreenX = d & 1; - return; - } - - case 0x680b: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall HotshockZ80Read(UINT16 a) -{ - switch (a) { - case 0x8000: { - return GalInput[0] | GalDip[0]; - } - - case 0x8001: { - return GalInput[1] | GalDip[1]; - } - - case 0x8002: { - return GalInput[2] | GalDip[2]; - } - - case 0x8003: { - return GalInput[3] | GalDip[3]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall HotshockZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: { - // coin_count_2_w - return; - } - - case 0x6002: { - // coin_count_1_w - return; - } - - case 0x6004: { - GalFlipScreenX = d & 1; - GalFlipScreenY = d & 1; - return; - } - - case 0x6005: { - // coin_count_0_w - return; - } - - case 0x6006: { - GalGfxBank[0] = d & 1; - return; - } - - case 0x6801: { - GalIrqFire = d & 1; - return; - } - - case 0x7000: { - // watchdog write - return; - } - - case 0x8000: { - GalSoundLatch = d; - return; - } - - case 0x9000: { - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall HotshockSoundZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x20: { - return AY8910Read(0); - } - - case 0x40: { - return AY8910Read(1); - } - } - - bprintf(PRINT_NORMAL, _T("Sound Port Read %x\n"), a); - - return 0; -} - -void __fastcall HotshockSoundZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x10: { - AY8910Write(0, 0, d); - return; - } - - case 0x20: { - AY8910Write(0, 1, d); - return; - } - - case 0x40: { - AY8910Write(1, 1, d); - return; - } - - case 0x80: { - AY8910Write(1, 0, d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Sound Port Write %x, %x\n"), a, d); -} - -static void CavelonDoBankSwitch() -{ - CavelonBankSwitch = !CavelonBankSwitch; - ZetMapArea(0x0000, 0x1fff, 0, GalZ80Rom1 + ((CavelonBankSwitch) ? 0x4000 : 0x0000)); - ZetMapArea(0x0000, 0x1fff, 2, GalZ80Rom1 + ((CavelonBankSwitch) ? 0x4000 : 0x0000)); -} - -UINT8 __fastcall CavelonZ80Read(UINT16 a) -{ - if (a >= 0x8000) { - CavelonDoBankSwitch(); - UINT32 Offset = a - 0x8000; - UINT8 Result = 0xff; - if (Offset & 0x0100) Result &= ppi8255_r(0, Offset & 3); - if (Offset & 0x0200) Result &= ppi8255_r(1, Offset & 3); - return Result; - } - - switch (a) { - case 0x7000: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall CavelonZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0x8000) { - CavelonDoBankSwitch(); - INT32 Offset = a - 0x8000; - if (Offset & 0x0100) ppi8255_w(0, Offset & 3, d); - if (Offset & 0x0200) ppi8255_w(1, Offset & 3, d); - return; - } - - switch (a) { - case 0x2000: - case 0x3800: - case 0x3801: { - // write in rom area - return; - } - - case 0x6801: { - GalIrqFire = d & 1; - return; - } - - case 0x6802: { - // coin_count_0_w - return; - } - - case 0x6803: { - GalBackgroundEnable = d & 1; - return; - } - - case 0x6804: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x6806: { - GalFlipScreenX = d & 1; - return; - } - - case 0x6807: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall MimonscrZ80Read(UINT16 a) -{ - switch (a) { - case 0x7000: { - // watchdog read - return 0xff; - } - - case 0x8100: - case 0x8101: - case 0x8102: - case 0x8103: { - return ppi8255_r(0, a - 0x8100); - } - - case 0x8200: - case 0x8201: - case 0x8202: - case 0x8203: { - return ppi8255_r(1, a - 0x8200); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall MimonscrZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6800: { - GalGfxBank[0] = d & 1; - return; - } - - case 0x6801: { - GalIrqFire = d & 1; - return; - } - - case 0x6802: { - GalGfxBank[1] = d & 1; - return; - } - - case 0x6803: { - // ??? - return; - } - - case 0x6804: { - GalBackgroundEnable = d & 1; - return; - } - - case 0x6805: { - // ??? - return; - } - - case 0x6806: { - GalFlipScreenX = d & 1; - return; - } - - case 0x6807: { - GalFlipScreenY = d & 1; - return; - } - - case 0x8100: - case 0x8101: - case 0x8102: - case 0x8103: { - ppi8255_w(0, a - 0x8100, d); - return; - } - - case 0x8200: - case 0x8201: - case 0x8202: - case 0x8203: { - ppi8255_w(1, a - 0x8200, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 TheendInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapTheend; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = GalaxianDrawBackground; - GalDrawBulletsFunction = TheendDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.02); - filter_rc_set_src_gain(1, 0.02); - filter_rc_set_src_gain(2, 0.02); - filter_rc_set_src_gain(3, 0.02); - filter_rc_set_src_gain(4, 0.02); - filter_rc_set_src_gain(5, 0.02); - - return nRet; -} - -static UINT8 ScramblePPIReadIN2() -{ - UINT8 Val = (ScrambleProtectionResult >> 7) & 1; - - if (Val) { - return 0x5f - GalInput[2] - GalDip[2]; - } else { - return 0xff - GalInput[2] - GalDip[2]; - } -} - -static UINT8 ScrambleProtectionRead() -{ - return ScrambleProtectionResult; -} - -static void ScrambleProtectionWrite(UINT8 d) -{ - ScrambleProtectionState = (ScrambleProtectionState << 4) | (d & 0x0f); - - switch (ScrambleProtectionState & 0xfff) { - case 0xf09: ScrambleProtectionResult = 0xff; return; - case 0xa49: ScrambleProtectionResult = 0xbf; return; - case 0x319: ScrambleProtectionResult = 0x4f; return; - case 0x5c9: ScrambleProtectionResult = 0x6f; return; - - // scrambles - case 0x246: ScrambleProtectionResult ^= 0x80; return; - case 0xb5f: ScrambleProtectionResult = 0x6f; return; - } -} - -static INT32 ScrambleInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapTheend; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - PPI0PortReadC = ScramblePPIReadIN2; - PPI1PortReadC = ScrambleProtectionRead; - PPI1PortWriteC = ScrambleProtectionWrite; - - return nRet; -} - -static void ExplorerPostLoad() -{ - MapTheend(); - - ZetOpen(0); - ZetSetReadHandler(ExplorerZ80Read); - ZetSetWriteHandler(ExplorerZ80Write); - ZetMapArea(0x5100, 0x51ff, 0, GalSpriteRam); - ZetMapArea(0x5100, 0x51ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 ExplorerInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = ExplorerPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - return nRet; -} - -static INT32 AtlantisInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapTheend; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.25); - filter_rc_set_src_gain(1, 0.25); - filter_rc_set_src_gain(2, 0.25); - filter_rc_set_src_gain(3, 0.25); - filter_rc_set_src_gain(4, 0.25); - filter_rc_set_src_gain(5, 0.25); - - return nRet; -} - -static void CkongsPostLoad() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(CkongsZ80Read); - ZetSetWriteHandler(CkongsZ80Write); - ZetMapArea(0x0000, 0x5fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x5fff, 2, GalZ80Rom1); - ZetMapArea(0x6000, 0x6fff, 0, GalZ80Ram1); - ZetMapArea(0x6000, 0x6fff, 1, GalZ80Ram1); - ZetMapArea(0x6000, 0x6fff, 2, GalZ80Ram1); - ZetMapArea(0x9000, 0x93ff, 0, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 1, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 2, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 0, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 1, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 2, GalVideoRam); - ZetMapArea(0x9800, 0x98ff, 0, GalSpriteRam); - ZetMapArea(0x9800, 0x98ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 CkongsInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = CkongsPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - KonamiPPIInit(); - - GalExtendSpriteInfoFunction = MshuttleExtendSpriteInfo; - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void MarsDecrypt() -{ - for (UINT32 i = 0; i < GalZ80Rom1Size; i += 16) { - UINT8 SwapBuffer[16]; - - for (UINT32 j = 0; j < 16; j++) { - INT32 NewOffset = BITSWAP08(j, 7, 6, 5, 4, 2, 0, 3, 1); - SwapBuffer[j] = GalZ80Rom1[i + NewOffset]; - } - memcpy(GalZ80Rom1 + i, SwapBuffer, 16); - } -} - -static void MarsPostLoad() -{ - MarsDecrypt(); - - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(MarsZ80Read); - ZetSetWriteHandler(MarsZ80Write); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 2, GalZ80Ram1); - ZetMapArea(0x4800, 0x4bff, 0, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 1, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 2, GalVideoRam); - ZetMapArea(0x5000, 0x50ff, 0, GalSpriteRam); - ZetMapArea(0x5000, 0x50ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 MarsInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MarsPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - return nRet; -} - -static INT32 DevilfshInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MarsPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalNumChars = 0x100; - GalNumSprites = 0x40; - CharPlaneOffsets[1] = 0x8000; - SpritePlaneOffsets[1] = 0x8000; - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - nRet = BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom + 0x800, GalSprites); - BurnFree(GalTempRom); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.75); - filter_rc_set_src_gain(1, 0.75); - filter_rc_set_src_gain(2, 0.75); - filter_rc_set_src_gain(3, 0.75); - filter_rc_set_src_gain(4, 0.75); - filter_rc_set_src_gain(5, 0.75); - - return nRet; -} - -static void Newsin7PostLoad() -{ - MarsDecrypt(); - - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(Newsin7Z80Read); - ZetSetWriteHandler(Newsin7Z80Write); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 2, GalZ80Ram1); - ZetMapArea(0x4800, 0x4bff, 0, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 1, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 2, GalVideoRam); - ZetMapArea(0x5000, 0x50ff, 0, GalSpriteRam); - ZetMapArea(0x5000, 0x50ff, 2, GalSpriteRam); - ZetMapArea(0xa000, 0xafff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0xa000, 0xafff, 2, GalZ80Rom1 + 0x4000); - ZetClose(); -} - -static INT32 Newsin7Init() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = Newsin7PostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalNumChars = 0x100; - GalNumSprites = 0x40; - - INT32 Newsin7PlaneOffsets[3] = {0x10000, 0, 0x8000}; - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - nRet = BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x2000, GAL_ROM_OFFSET_TILES_SHARED + 2, 1); if (nRet) return 1; - GfxDecode(GalNumChars, 3, 8, 8, Newsin7PlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 3, 16, 16, Newsin7PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom + 0x800, GalSprites); - BurnFree(GalTempRom); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalColourDepth = 3; - GalSpriteClipStart = 0; - GalSpriteClipEnd = 246; - - KonamiPPIInit(); - - return nRet; -} - -static void MapMrkougar() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(MarsZ80Read); - ZetSetWriteHandler(MrkougarZ80Write); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 2, GalZ80Ram1); - ZetMapArea(0x4800, 0x4bff, 0, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 1, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 2, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 0, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 1, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 2, GalVideoRam); - ZetMapArea(0x5000, 0x50ff, 0, GalSpriteRam); - ZetMapArea(0x5000, 0x50ff, 2, GalSpriteRam); - ZetClose(); -} - -static void MrkougarPostLoad() -{ - MarsDecrypt(); - - MapMrkougar(); -} - -static INT32 MrkougarInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MrkougarPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - INT32 MrkougarPlaneOffsets[2] = {0, 4}; - INT32 MrkougarCharXOffsets[8] = {64, 65, 66, 67, 0, 1, 2, 3}; - INT32 MrkougarCharYOffsets[8] = {0, 8, 16, 24, 32, 40, 48, 56}; - INT32 MrkougarSpriteXOffsets[16] = {64, 65, 66, 67, 0, 1, 2, 3, 192, 193, 194, 195, 128, 129, 130, 131}; - INT32 MrkougarSpriteYOffsets[16] = {0, 8, 16, 24, 32, 40, 48, 56, 256, 264, 272, 280, 288, 296, 304, 312}; - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - nRet = BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - GfxDecode(GalNumChars, 2, 8, 8, MrkougarPlaneOffsets, MrkougarCharXOffsets, MrkougarCharYOffsets, 0x80, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, MrkougarPlaneOffsets, MrkougarSpriteXOffsets, MrkougarSpriteYOffsets, 0x200, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - return nRet; -} - -static INT32 MrkougbInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapMrkougar; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - return nRet; -} - -static void HotshockPostLoad() -{ - MapMrkougar(); - - ZetOpen(0); - ZetSetReadHandler(HotshockZ80Read); - ZetSetWriteHandler(HotshockZ80Write); - ZetClose(); - - GalZ80Rom1[0x2ef9] = 0xc9; -} - -static INT32 HotshockInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = HotshockPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - ZetOpen(1); - ZetSetInHandler(HotshockSoundZ80PortRead); - ZetSetOutHandler(HotshockSoundZ80PortWrite); - ZetClose(); - - GalExtendTileInfoFunction = PiscesExtendTileInfo; - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void ConquerPostLoad() -{ - MapMrkougar(); - - ZetOpen(0); - ZetSetReadHandler(HotshockZ80Read); - ZetSetWriteHandler(HotshockZ80Write); - ZetClose(); -} - -static INT32 ConquerInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = ConquerPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - ZetOpen(1); - ZetSetInHandler(HotshockSoundZ80PortRead); - ZetSetOutHandler(HotshockSoundZ80PortWrite); - ZetClose(); - - GalExtendTileInfoFunction = PiscesExtendTileInfo; - - return nRet; -} - -static void CavelonPostLoad() -{ - MapTheend(); - - ZetOpen(0); - ZetSetReadHandler(CavelonZ80Read); - ZetSetWriteHandler(CavelonZ80Write); - ZetClose(); -} - -static INT32 CavelonInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = CavelonPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendSpriteInfoFunction = MshuttleExtendSpriteInfo; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static void MimonscrPostLoad() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(MimonscrZ80Read); - ZetSetWriteHandler(MimonscrZ80Write); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x43ff, 0, GalVideoRam); - ZetMapArea(0x4000, 0x43ff, 1, GalVideoRam); - ZetMapArea(0x4000, 0x43ff, 2, GalVideoRam); - ZetMapArea(0x4400, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4400, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4400, 0x47ff, 2, GalZ80Ram1); - ZetMapArea(0x4800, 0x4bff, 0, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 1, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 2, GalVideoRam); - ZetMapArea(0x5000, 0x50ff, 0, GalSpriteRam); - ZetMapArea(0x5000, 0x50ff, 2, GalSpriteRam); - ZetMapArea(0xc000, 0xffff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0xc000, 0xffff, 2, GalZ80Rom1 + 0x4000); - ZetClose(); -} - -static INT32 MimonscrInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MimonscrPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = MimonkeyExtendTileInfo; - GalExtendSpriteInfoFunction = MimonkeyExtendSpriteInfo; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -struct BurnDriver BurnDrvTheend = { - "theend", NULL, NULL, NULL, "1980", - "The End\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, TheendRomInfo, TheendRomName, NULL, NULL, TheendInputInfo, TheendDIPInfo, - TheendInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTheends = { - "theends", "theend", NULL, NULL, "1980", - "The End (Stern)\0", NULL, "Konami (Stern license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, TheendsRomInfo, TheendsRomName, NULL, NULL, TheendInputInfo, TheendDIPInfo, - TheendInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScramble = { - "scramble", NULL, NULL, NULL, "1981", - "Scramble\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScrambleRomInfo, ScrambleRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScrambles = { - "scrambles", "scramble", NULL, NULL, "1981", - "Scramble (Stern)\0", NULL, "Konami (Stern license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScramblesRomInfo, ScramblesRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScramblebf = { - "scramblebf", "scramble", NULL, NULL, "1981", - "Scramble (Karateko, French bootleg)\0", NULL, "Karateko (bootleg)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScramblebfRomInfo, ScramblebfRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScrambp = { - "scrambp", "scramble", NULL, NULL, "1981", - "Impacto (Billport S.A., Spanish bootleg of Scramble)\0", NULL, "bootleg (Billport S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScrambpRomInfo, ScrambpRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScramce = { - "scramce", "scramble", NULL, NULL, "1981", - "Scramble (Centromatic S.A., Spanish bootleg)\0", NULL, "bootleg (Centromatic S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScramceRomInfo, ScramceRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScrampt = { - "scrampt", "scramble", NULL, NULL, "1981", - "Scramble (Petaco S.A., Spanish bootleg)\0", NULL, "bootleg (Petaco S.A.)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScramptRomInfo, ScramptRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScramrf = { - "scramrf", "scramble", NULL, NULL, "1981", - "Scramble (Recreativos Franco, Spanish bootleg)\0", NULL, "bootleg (Recreativos Franco)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScramrfRomInfo, ScramrfRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvOffensiv = { - "offensiv", "scramble", NULL, NULL, "1981", - "Offensive (Spanish bootleg of Scramble)\0", NULL, "bootleg (Video Dens)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, OffensivRomInfo, OffensivRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScramblebb = { - "scramblebb", "scramble", NULL, NULL, "1981", - "Scramble (bootleg?)\0", NULL, "bootleg?", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScramblebbRomInfo, ScramblebbRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvStrfbomb = { - "strfbomb", "scramble", NULL, NULL, "1981", - "Strafe Bomb\0", NULL, "Omni", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, StrfbombRomInfo, StrfbombRomName, NULL, NULL, ScrambleInputInfo, StrfbombDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvExplorer = { - "explorer", "scramble", NULL, NULL, "1981", - "Explorer\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ExplorerRomInfo, ExplorerRomName, NULL, NULL, ExplorerInputInfo, ExplorerDIPInfo, - ExplorerInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvBomber = { - "bomber", "scramble", NULL, NULL, "1981", - "Bomber (bootleg of Scramble)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, BomberRomInfo, BomberRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - ScrambleInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAtlantis = { - "atlantis", NULL, NULL, NULL, "1981", - "Battle of Atlantis (set 1)\0", NULL, "Comsoft", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, AtlantisRomInfo, AtlantisRomName, NULL, NULL, AtlantisInputInfo, AtlantisDIPInfo, - AtlantisInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAtlantis2 = { - "atlantis2", "atlantis", NULL, NULL, "1981", - "Battle of Atlantis (set 2)\0", NULL, "Comsoft", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, Atlantis2RomInfo, Atlantis2RomName, NULL, NULL, AtlantisInputInfo, AtlantisDIPInfo, - AtlantisInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCkongs = { - "ckongs", "ckong", NULL, NULL, "1981", - "Crazy Kong (Scramble hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, CkongsRomInfo, CkongsRomName, NULL, NULL, CkongsInputInfo, CkongsDIPInfo, - CkongsInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMars = { - "mars", NULL, NULL, NULL, "1981", - "Mars\0", NULL, "Artic", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, MarsRomInfo, MarsRomName, NULL, NULL, MarsInputInfo, MarsDIPInfo, - MarsInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDevilfsh = { - "devilfsh", NULL, NULL, NULL, "1982", - "Devil Fish\0", NULL, "Artic", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, DevilfshRomInfo, DevilfshRomName, NULL, NULL, DevilfshInputInfo, DevilfshDIPInfo, - DevilfshInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNewsin7 = { - "newsin7", NULL, NULL, NULL, "1983", - "New Sinbad 7\0", NULL, "ATW USA, Inc.", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, Newsin7RomInfo, Newsin7RomName, NULL, NULL, DevilfshInputInfo, Newsin7DIPInfo, - Newsin7Init, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMrkougar = { - "mrkougar", NULL, NULL, NULL, "1984", - "Mr. Kougar\0", NULL, "ATW", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, MrkougarRomInfo, MrkougarRomName, NULL, NULL, MrkougarInputInfo, MrkougarDIPInfo, - MrkougarInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMrkougar2 = { - "mrkougar2", "mrkougar", NULL, NULL, "1983", - "Mr. Kougar (earlier)\0", NULL, "ATW", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, Mrkougar2RomInfo, Mrkougar2RomName, NULL, NULL, MrkougarInputInfo, MrkougarDIPInfo, - MrkougarInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMrkougb = { - "mrkougb", "mrkougar", NULL, NULL, "1983", - "Mr. Kougar (bootleg set 1)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, MrkougbRomInfo, MrkougbRomName, NULL, NULL, MrkougarInputInfo, MrkougarDIPInfo, - MrkougbInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMrkougb2 = { - "mrkougb2", "mrkougar", NULL, NULL, "1983", - "Mr. Kougar (bootleg set 2)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, Mrkougb2RomInfo, Mrkougb2RomName, NULL, NULL, MrkougarInputInfo, MrkougarDIPInfo, - MrkougbInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHotshock = { - "hotshock", NULL, NULL, NULL, "1982", - "Hot Shocker\0", NULL, "E.G. Felaco (Domino license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, HotshockRomInfo, HotshockRomName, NULL, NULL, HotshockInputInfo, HotshockDIPInfo, - HotshockInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHotshockb = { - "hotshockb", "hotshock", NULL, NULL, "1982", - "Hot Shocker (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, HotshockbRomInfo, HotshockbRomName, NULL, NULL, HotshockInputInfo, HotshockDIPInfo, - HotshockInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriverD BurnDrvConquer = { - "conquer", NULL, NULL, NULL, "1982", - "Conquer\0", "Bad dump", "unknown", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, ConquerRomInfo, ConquerRomName, NULL, NULL, HotshockInputInfo, HotshockDIPInfo, - ConquerInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCavelon = { - "cavelon", NULL, NULL, NULL, "1983", - "Cavelon\0", NULL, "Jetsoft", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, CavelonRomInfo, CavelonRomName, NULL, NULL, AtlantisInputInfo, CavelonDIPInfo, - CavelonInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMimonscr = { - "mimonscr", "mimonkey", NULL, NULL, "198?", - "Mighty Monkey (bootleg on Scramble hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, MimonscrRomInfo, MimonscrRomName, NULL, NULL, AtlantisInputInfo, MimonkeyDIPInfo, - MimonscrInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMimonscra = { - "mimonscra", "mimonkey", NULL, NULL, "198?", - "Mighty Monkey (Kaina Games, bootleg on Scramble hardware)\0", NULL, "bootleg (Kaina Games)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, MimonscraRomInfo, MimonscraRomName, NULL, NULL, AtlantisInputInfo, MimonkeyDIPInfo, - MimonscrInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Scramble based hardware with one CPU and one AY8910 -static struct BurnRomInfo TriplepRomDesc[] = { - { "triplep.2g", 0x01000, 0xc583a93d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "triplep.2h", 0x01000, 0xc03ddc49, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "triplep.2k", 0x01000, 0xe83ca6b5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "triplep.2l", 0x01000, 0x982cc3b9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "triplep.5f", 0x00800, 0xd51cbd6f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "triplep.5h", 0x00800, 0xf21c0059, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "tripprom.6e", 0x00020, 0x624f75df, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Triplep) -STD_ROM_FN(Triplep) - -static struct BurnRomInfo TriplepaRomDesc[] = { - { "td4.2h", 0x01000, 0x15a6d46a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tc3.2k", 0x01000, 0xbc26d2c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "te2.2l", 0x01000, 0x02025c10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "td1.2m", 0x01000, 0xe9abc42b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ta6.5f", 0x00800, 0xd51cbd6f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ta7.5h", 0x00800, 0xf21c0059, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "ta.6e", 0x00020, 0x624f75df, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Triplepa) -STD_ROM_FN(Triplepa) - -static struct BurnRomInfo KnockoutRomDesc[] = { - { "knockout.2h", 0x01000, 0xeaaa848e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "knockout.2k", 0x01000, 0xbc26d2c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "knockout.2l", 0x01000, 0x02025c10, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "knockout.2m", 0x01000, 0xe9abc42b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "triplep.5f", 0x00800, 0xd51cbd6f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "triplep.5h", 0x00800, 0xf21c0059, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "tripprom.6e", 0x00020, 0x624f75df, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Knockout) -STD_ROM_FN(Knockout) - -static struct BurnRomInfo MarinerRomDesc[] = { - { "tp1.2h", 0x01000, 0xdac1dfd0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tm2.2k", 0x01000, 0xefe7ca28, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tm3.2l", 0x01000, 0x027881a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tm4.2m", 0x01000, 0xa0fde7dc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tm5.2p", 0x01000, 0xd7ebcb8e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "tm8.5f", 0x01000, 0x70ae611f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tm9.5h", 0x01000, 0x8e4e999e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "t4.6e", 0x00020, 0xca42b6dd, BRF_GRA | GAL_ROM_PROM }, - { "t6.6p", 0x00100, 0xad208ccc, BRF_GRA | GAL_ROM_PROM }, // Background colour - { "t5.7p", 0x00020, 0x1bd88cff, BRF_GRA | GAL_ROM_PROM }, // Char banking and star placement -}; - -STD_ROM_PICK(Mariner) -STD_ROM_FN(Mariner) - -static struct BurnRomInfo EighthundredfathRomDesc[] = { - { "tu1.2h", 0x01000, 0x5dd3d42f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tm2.2k", 0x01000, 0xefe7ca28, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tm3.2l", 0x01000, 0x027881a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tm4.2m", 0x01000, 0xa0fde7dc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "tu5.2p", 0x01000, 0xf864a8a6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "tm8.5f", 0x01000, 0x70ae611f, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "tm9.5h", 0x01000, 0x8e4e999e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "t4.6e", 0x00020, 0xca42b6dd, BRF_GRA | GAL_ROM_PROM }, - { "t6.6p", 0x00100, 0xad208ccc, BRF_GRA | GAL_ROM_PROM }, // Background colour - { "t5.7p", 0x00020, 0x1bd88cff, BRF_GRA | GAL_ROM_PROM }, // Char banking and star placement -}; - -STD_ROM_PICK(Eighthundredfath) -STD_ROM_FN(Eighthundredfath) - -UINT8 __fastcall TriplepZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - // ??? - return 0; - } - - case 0x01: { - return AY8910Read(0); - } - - case 0x02: { - if (ZetGetPC(-1) == 0x015a) return 0xff; - if (ZetGetPC(-1) == 0x0886) return 0x05; - return 0; - } - - case 0x03: { - if (ZetGetPC(-1) == 0x015d) return 0x04; - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall TriplepZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - AY8910Write(0, 1, d); - return; - } - - case 0x01: { - AY8910Write(0, 0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall MarinerZ80Read(UINT16 a) -{ - if (a >= 0x8000) { - if (a == 0xb401) return 0x07; - if (a == 0x9008) return 0x03; - - UINT32 Offset = a - 0x8000; - UINT8 Result = 0xff; - if (Offset & 0x0100) Result &= ppi8255_r(0, Offset & 3); - if (Offset & 0x0200) Result &= ppi8255_r(1, Offset & 3); - return Result; - } - - switch (a) { - case 0x7000: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -static void TriplepPostLoad() -{ - MapTheend(); - - ZetOpen(0); - ZetSetInHandler(TriplepZ80PortRead); - ZetSetOutHandler(TriplepZ80PortWrite); - ZetClose(); -} - -static INT32 TriplepInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = TriplepPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910; - - nRet = GalInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - PPI1PortWriteA = NULL; - PPI1PortWriteB = NULL; - - return nRet; -} - -static void MarinerPostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(0x1000); - memcpy(GalTempRom, GalZ80Rom1 + 0x4000, 0x1000); - memcpy(GalZ80Rom1 + 0x4800, GalTempRom + 0x0000, 0x800); - memcpy(GalZ80Rom1 + 0x4000, GalTempRom + 0x0800, 0x800); - BurnFree(GalTempRom); - - MapTheend(); - - ZetOpen(0); - ZetSetReadHandler(MarinerZ80Read); - ZetSetInHandler(TriplepZ80PortRead); - ZetSetOutHandler(TriplepZ80PortWrite); - ZetMapArea(0x5800, 0x67ff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0x5800, 0x67ff, 2, GalZ80Rom1 + 0x4000); - ZetClose(); -} - -static INT32 MarinerInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MarinerPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910; - - nRet = GalInit(); - - GalCalcPaletteFunction = MarinerCalcPalette; - GalRenderBackgroundFunction = MarinerDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = MarinerExtendTileInfo; - - KonamiPPIInit(); - PPI1PortWriteA = NULL; - PPI1PortWriteB = NULL; - - return nRet; -} - -struct BurnDriver BurnDrvTriplep = { - "triplep", NULL, NULL, NULL, "1982", - "Triple Punch (set 1)\0", NULL, "KKI", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, TriplepRomInfo, TriplepRomName, NULL, NULL, AmidarInputInfo, TriplepDIPInfo, - TriplepInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTriplepa = { - "triplepa", "triplep", NULL, NULL, "1982", - "Triple Punch (set 2)\0", NULL, "KKK", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, TriplepaRomInfo, TriplepaRomName, NULL, NULL, AmidarInputInfo, TriplepDIPInfo, - TriplepInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvKnockout = { - "knockout", "triplep", NULL, NULL, "1982", - "Knock Out!!\0", NULL, "KKK", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, KnockoutRomInfo, KnockoutRomName, NULL, NULL, AmidarInputInfo, TriplepDIPInfo, - TriplepInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMariner = { - "mariner", NULL, NULL, NULL, "1981", - "Mariner\0", NULL, "Armenip", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, MarinerRomInfo, MarinerRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - MarinerInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvEighthundredfath = { - "800fath", "mariner", NULL, NULL, "1981", - "800 Fathoms\0", NULL, "Amenip (US Billiards Inc. license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE |BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, EighthundredfathRomInfo, EighthundredfathRomName, NULL, NULL, ScrambleInputInfo, ScrambleDIPInfo, - MarinerInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Scorpion hardware - based on Scramble but with a third AY8910 and a speech chip -static struct BurnRomInfo ScorpionRomDesc[] = { - { "1.2d", 0x01000, 0xba1219b4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2.2f", 0x01000, 0xc3909ab6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "3.2g", 0x01000, 0x43261352, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "4.2h", 0x01000, 0xaba2276a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.2k", 0x01000, 0x952f78f2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "igr_scorpion_32_a4.ic12", 0x01000, 0x361b8a36, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "igr_scorpion_32_a5.ic13", 0x01000, 0xaddecdd4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "igr_scorpion_32_f5.ic72", 0x01000, 0x1e5da9d6, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "igr_scorpion_32_h5.ic73", 0x01000, 0xa57adb0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331_6e.ic59", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, - - { "igr_scorpion_32_a3.ic25", 0x01000, 0x04abf178, BRF_OPT | BRF_SND }, // Speech samples? - { "igr_scorpion_32_a2.ic24", 0x01000, 0x90352dd4, BRF_OPT | BRF_SND }, - { "igr_scorpion_32_a1.ic23", 0x01000, 0x3bf2452d, BRF_OPT | BRF_SND }, -}; - -STD_ROM_PICK(Scorpion) -STD_ROM_FN(Scorpion) - -static struct BurnRomInfo ScorpionaRomDesc[] = { - { "igr_scorpion_32_d2.ic109", 0x01000, 0xc5b9daeb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "igr_scorpion_32_e2.ic110", 0x01000, 0x82308d05, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "igr_scorpion_32_g2.ic111", 0x01000, 0x756b09cd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "igr_scorpion_32_h2.ic112", 0x01000, 0x667ad8be, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "igr_scorpion_16_l2.ic114", 0x00800, 0x6623da33, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "igr_scorpion_16_k2.ic113", 0x00800, 0x42ec34d8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "igr_scorpion_32_a4.ic12", 0x01000, 0x361b8a36, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "igr_scorpion_32_a5.ic13", 0x01000, 0xaddecdd4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "igr_scorpion_32_f5.ic72", 0x01000, 0x1e5da9d6, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "igr_scorpion_32_h5.ic73", 0x01000, 0xa57adb0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331_6e.ic59", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, - - { "igr_scorpion_32_a3.ic25", 0x01000, 0x04abf178, BRF_OPT | BRF_SND }, // Speech samples? - { "igr_scorpion_32_a2.ic24", 0x01000, 0x90352dd4, BRF_OPT | BRF_SND }, - { "igr_scorpion_32_a1.ic23", 0x01000, 0x3bf2452d, BRF_OPT | BRF_SND }, -}; - -STD_ROM_PICK(Scorpiona) -STD_ROM_FN(Scorpiona) - -static struct BurnRomInfo ScorpionbRomDesc[] = { - { "ic109.2d", 0x01000, 0xf54688c9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ic110.2e", 0x01000, 0x91aaaa12, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ic111.2g", 0x01000, 0x4c3720da, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ic112.2h", 0x01000, 0x53e2a983, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ic113.2k", 0x01000, 0xe4ad299a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "igr_scorpion_32_a4.ic12", 0x01000, 0x361b8a36, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "igr_scorpion_32_a5.ic13", 0x01000, 0xaddecdd4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "igr_scorpion_32_f5.ic72", 0x01000, 0x1e5da9d6, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "igr_scorpion_32_h5.ic73", 0x01000, 0xa57adb0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331_6e.ic59", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, - - { "igr_scorpion_32_a3.ic25", 0x01000, 0x04abf178, BRF_OPT | BRF_SND }, // Speech samples? - { "igr_scorpion_32_a2.ic24", 0x01000, 0x90352dd4, BRF_OPT | BRF_SND }, - { "igr_scorpion_32_a1.ic23", 0x01000, 0x3bf2452d, BRF_OPT | BRF_SND }, -}; - -STD_ROM_PICK(Scorpionb) -STD_ROM_FN(Scorpionb) - -static struct BurnRomInfo ScorpionmcRomDesc[] = { - { "p1.bin", 0x00800, 0x58818d88, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p2.bin", 0x00800, 0x8bec5f9f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p3.bin", 0x00800, 0x24b7fdff, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p4.bin", 0x00800, 0x9082e2f0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p5.bin", 0x00800, 0x20387fc0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p6.bin", 0x00800, 0xf66c48e1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p7.bin", 0x00800, 0x931e34c7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p8.bin", 0x00800, 0xab5ab61d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p9.bin", 0x01000, 0xb551b974, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "p10.bin", 0x00800, 0xa7bd8d20, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "h.bin", 0x01000, 0x1e5da9d6, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "k.bin", 0x01000, 0xa57adb0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331.bpr", 0x00020, 0x6a0c7d87, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scorpionmc) -STD_ROM_FN(Scorpionmc) - -static struct BurnRomInfo AracnisRomDesc[] = { - { "00sc.bin", 0x01000, 0xc7e0d6b9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "01sc.bin", 0x01000, 0x03eb27dc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "02sc.bin", 0x01000, 0xf3d49d4f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "03sc.bin", 0x01000, 0x0e741984, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "05sc.bin", 0x01000, 0xf27ee3e4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "06sc.bin", 0x00800, 0xfdfc2c82, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "08sc.1h", 0x01000, 0x1e5da9d6, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "07sc.1k", 0x01000, 0xa57adb0a, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mmi6331-1.6l", 0x00020, 0x24652bc4, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Aracnis) -STD_ROM_FN(Aracnis) - -UINT8 __fastcall ScorpionmcZ80Read(UINT16 a) -{ - switch (a) { - case 0xa000: { - return GalInput[0] | GalDip[0]; - } - - case 0xa800: { - return GalInput[1] | GalDip[1]; - } - - case 0xb001: { - return GalInput[2] | GalDip[2]; - } - - case 0xb002: { - return GalInput[3] | GalDip[3]; - } - - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall ScorpionmcZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: { - GalGfxBank[a - 0xa000] = d; - return; - } - - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: { - GalaxianLfoFreqWrite(a - 0xa004, d); - return; - } - - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: - case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb001: { - GalIrqFire = d & 1; - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall ScorpionSoundZ80Read(UINT16 a) -{ - switch (a) { - case 0x3000: { - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0xff; -} - -UINT8 __fastcall ScorpionSoundZ80PortRead(UINT16 a) -{ - a &= 0xff; - - UINT8 Result = 0xff; - if (a & 0x08) Result &= AY8910Read(2); - if (a & 0x20) Result &= AY8910Read(0); - if (a & 0x80) Result &= AY8910Read(1); - return Result; -} - -void __fastcall ScorpionSoundZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a & 0x04) AY8910Write(2, 0, d); - if (a & 0x08) AY8910Write(2, 1, d); - if (a & 0x10) AY8910Write(0, 0, d); - if (a & 0x20) AY8910Write(0, 1, d); - if (a & 0x40) AY8910Write(1, 0, d); - if (a & 0x80) AY8910Write(1, 1, d); -} - -static UINT8 ScorpionProtectionRead() -{ - UINT16 ParityBits; - UINT8 Parity = 0; - - for (ParityBits = ScrambleProtectionState & 0xce29; ParityBits != 0; ParityBits >>= 1) { - if (ParityBits & 1) Parity++; - } - - return Parity; -} - -static void ScorpionProtectionWrite(UINT8 d) -{ - if (!(d & 0x20)) ScrambleProtectionState = 0x0000; - if (!(d & 0x10)) ScrambleProtectionState = (ScrambleProtectionState << 1) | (~ScorpionProtectionRead() & 1); -} - -static void ScorpionPostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(0x1000); - memcpy(GalTempRom, GalZ80Rom1 + 0x4000, 0x1000); - memcpy(GalZ80Rom1 + 0x4800, GalTempRom + 0x0000, 0x800); - memcpy(GalZ80Rom1 + 0x4000, GalTempRom + 0x0800, 0x800); - BurnFree(GalTempRom); - - MapTheend(); - - ZetOpen(0); - ZetMapArea(0x5800, 0x67ff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0x5800, 0x67ff, 2, GalZ80Rom1 + 0x4000); - ZetClose(); -} - -static INT32 ScorpionInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = ScorpionPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - ZetOpen(1); - ZetSetReadHandler(ScorpionSoundZ80Read); - ZetSetInHandler(ScorpionSoundZ80PortRead); - ZetSetOutHandler(ScorpionSoundZ80PortWrite); - ZetClose(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = Batman2ExtendTileInfo; - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - - KonamiPPIInit(); - PPI1PortReadC = ScorpionProtectionRead; - PPI1PortWriteC = ScorpionProtectionWrite; - - return nRet; -} - -static void ScorpionmcPostLoad() -{ - MapMooncrst(); - - ZetOpen(0); - ZetSetReadHandler(ScorpionmcZ80Read); - ZetSetWriteHandler(ScorpionmcZ80Write); - ZetMapArea(0x4000, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 2, GalZ80Ram1); - ZetMapArea(0x5000, 0x67ff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0x5000, 0x67ff, 2, GalZ80Rom1 + 0x4000); - ZetMapArea(0x9400, 0x97ff, 0, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 1, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 2, GalVideoRam); - ZetClose(); -} - -static INT32 ScorpionmcInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = ScorpionmcPostLoad; - - nRet = GalInit(); - - GalExtendTileInfoFunction = Batman2ExtendTileInfo; - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - - return nRet; -} - -struct BurnDriver BurnDrvScorpion = { - "scorpion", NULL, NULL, NULL, "1982", - "Scorpion (set 1)\0", "Incomplete Sound", "Zaccaria", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScorpionRomInfo, ScorpionRomName, NULL, NULL, AtlantisInputInfo, ScorpionDIPInfo, - ScorpionInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScorpiona = { - "scorpiona", "scorpion", NULL, NULL, "1982", - "Scorpion (set 2)\0", "Incomplete Sound", "Zaccaria", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScorpionaRomInfo, ScorpionaRomName, NULL, NULL, AtlantisInputInfo, ScorpionDIPInfo, - ScorpionInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScorpionb = { - "scorpionb", "scorpion", NULL, NULL, "1982", - "Scorpion (set 3)\0", "Incomplete Sound", "Zaccaria", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScorpionbRomInfo, ScorpionbRomName, NULL, NULL, AtlantisInputInfo, ScorpionDIPInfo, - ScorpionInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScorpionmc = { - "scorpionmc", "scorpion", NULL, NULL, "19??", - "Scorpion (Moon Cresta hardware)\0", NULL, "Dorneer", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScorpionmcRomInfo, ScorpionmcRomName, NULL, NULL, ScorpionmcInputInfo, ScorpionmcDIPInfo, - ScorpionmcInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAracnis = { - "aracnis", "scorpion", NULL, NULL, "19??", - "Aracnis (bootleg of Scorpion on Moon Cresta hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, AracnisRomInfo, AracnisRomName, NULL, NULL, AracnisInputInfo, AracnisDIPInfo, - ScorpionmcInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// A.D. 2083 hardware - based on Scramble with TMS5100A for speech -static struct BurnRomInfo Ad2083RomDesc[] = { - { "ad0.10o", 0x02000, 0x4d34325a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ad1.9o", 0x02000, 0x0f37134b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ad2.8o", 0x02000, 0xbcfa655f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ad3.7o", 0x02000, 0x60655225, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ad1s.3d", 0x02000, 0x80f39b0f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ad2s.4d", 0x01000, 0x5177fe2b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "ad4.5k", 0x02000, 0x388cdd21, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ad5.3k", 0x02000, 0xf53f3449, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom-am27s19dc.1m", 0x00020, 0x2759aebd, BRF_GRA | GAL_ROM_PROM }, - - { "ad1v.9a", 0x01000, 0x4cb93fff, BRF_OPT | BRF_SND }, // TMS5110A data - { "ad2v.10a", 0x01000, 0x4b530ea7, BRF_OPT | BRF_SND }, // TMS5110A data - { "prom-sn74s188.8a", 0x00020, 0xc58a4f6a, BRF_OPT | BRF_SND }, // TMS5110A data -}; - -STD_ROM_PICK(Ad2083) -STD_ROM_FN(Ad2083) - -UINT8 __fastcall Ad2083Z80Read(UINT16 a) -{ - switch (a) { - case 0x7000: { - // watchdog read - return 0xff; - } - - case 0x8000: { - return GalInput[0] | GalDip[0]; - } - - case 0x8001: { - return GalInput[1] | GalDip[1]; - } - - case 0x8002: { - return GalInput[2] | GalDip[2]; - } - - case 0x8003: { - return GalInput[3] | GalDip[3]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall Ad2083Z80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6004: { - GalFlipScreenX = d & 1; - GalFlipScreenY = d & 1; - return; - } - - case 0x6800: { - // coin_counter_2_w - return; - } - - case 0x6801: { - GalIrqFire = d & 1; - return; - } - - case 0x6802: { - // coin_counter_0_w - return; - } - - case 0x6803: { - GalBackgroundBlue = d & 1; - return; - } - - case 0x6805: { - // coin_counter_1_w - return; - } - - case 0x6806: { - GalBackgroundRed = d & 1; - return; - } - - case 0x6807: { - GalBackgroundGreen = d & 1; - return; - } - - case 0x8000: { - GalSoundLatch = d; - return; - } - - case 0x9000: { - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static void Ad2083PostLoad() -{ - UINT8 c; - - for (UINT32 i = 0; i < GalZ80Rom1Size; i++) { - c = GalZ80Rom1[i] ^ 0x35; - c = BITSWAP08(c, 6, 2, 5, 1, 7, 3, 4, 0); - GalZ80Rom1[i] = c; - } - - MapTheend(); - - ZetOpen(0); - ZetSetReadHandler(Ad2083Z80Read); - ZetSetWriteHandler(Ad2083Z80Write); - ZetMapArea(0xa000, 0xdfff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0xa000, 0xdfff, 2, GalZ80Rom1 + 0x4000); - ZetMapArea(0xe800, 0xebff, 0, GalZ80Ram1 + 0x800); - ZetMapArea(0xe800, 0xebff, 1, GalZ80Ram1 + 0x800); - ZetMapArea(0xe800, 0xebff, 2, GalZ80Ram1 + 0x800); - ZetClose(); -} - -static INT32 Ad2083Init() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = Ad2083PostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_AD2083AY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - ZetOpen(1); - ZetSetInHandler(HotshockSoundZ80PortRead); - ZetSetOutHandler(HotshockSoundZ80PortWrite); - ZetClose(); - - GalRenderBackgroundFunction = TurtlesDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = Ad2083ExtendTileInfo; - GalExtendSpriteInfoFunction = Ad2083ExtendSpriteInfo; - - return nRet; -} - -struct BurnDriver BurnDrvAd2083 = { - "ad2083", NULL, NULL, NULL, "1983", - "A.D. 2083\0", "Incomplete Sound", "Midcoin", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, Ad2083RomInfo, Ad2083RomName, NULL, NULL, Ad2083InputInfo, Ad2083DIPInfo, - Ad2083Init, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// SF-X hardware - based on Scramble with extra Z80 and 8255 driving a DAC based sample player -static struct BurnRomInfo SfxRomDesc[] = { - { "sfx_b-0.1j", 0x02000, 0xe5bc6952, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "1.1c", 0x01000, 0x1b3c48e7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "22.1d", 0x01000, 0xed44950d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "23.1e", 0x01000, 0xf44a3ca0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "27.1a", 0x01000, 0xed86839f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "24.1g", 0x01000, 0xe6d7dc74, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "5.1h", 0x01000, 0xd1e8d390, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5.5j", 0x01000, 0x59028fb6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "6.6j", 0x01000, 0x5427670f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "1.1j", 0x01000, 0x2f172c58, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "2.2j", 0x01000, 0xa6ad2f6b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "3.3j", 0x01000, 0xfa1274fa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "4.4j", 0x01000, 0x1cd33f3a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "10.3h", 0x01000, 0xb833a15b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "11.4h", 0x01000, 0xcbd76ec2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - - { "28.5a", 0x01000, 0xd73a8252, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "29.5c", 0x01000, 0x1401ccf2, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6331.9g", 0x00020, 0xca1d9ccd, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Sfx) -STD_ROM_FN(Sfx) - -static struct BurnRomInfo SkelagonRomDesc[] = { - { "31.bin", 0x01000, 0xae6f8647, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "32.bin", 0x01000, 0xa28c5838, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "33.bin", 0x01000, 0x32f7e99c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "37.bin", 0x01000, 0x47f68a31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "24.bin", 0x01000, 0xe6d7dc74, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "35.bin", 0x01000, 0x5b2a0158, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "36.bin", 0x01000, 0xf53ead29, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5.5j", 0x01000, 0x59028fb6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "6.6j", 0x01000, 0x5427670f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "1.1j", 0x01000, 0x2f172c58, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "2.2j", 0x01000, 0xa6ad2f6b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "3.3j", 0x01000, 0xfa1274fa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "4.4j", 0x01000, 0x1cd33f3a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "10.bin", 0x01000, 0x2c719de2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "8.bin", 0x01000, 0x350379dd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - - { "38.bin", 0x01000, 0x2fffa8b1, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "39.bin", 0x01000, 0xa854b5de, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6331.9g", 0x00020, 0xca1d9ccd, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Skelagon) -STD_ROM_FN(Skelagon) - -static struct BurnRomInfo MonsterzRomDesc[] = { - { "b-1e.a1", 0x01000, 0x97886542, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b-2e.c1", 0x01000, 0x184ffcb4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b-3e.d1", 0x01000, 0xb7b10ac7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b-4e.e1", 0x01000, 0xfb02c736, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b-5e.g1", 0x01000, 0xb2788ab9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b-6e.h1", 0x01000, 0x77d7aa8d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "a-1e.k1", 0x01000, 0xb88ba44e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "a-2.k2", 0x01000, 0x8913c94e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "a-3e.k3", 0x01000, 0xa8fa5095, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "a-4.k4", 0x01000, 0x93f81317, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "a-5e.k5", 0x01000, 0xb5bcdb4e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "a-6.k6", 0x01000, 0x24832b2e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "a-7e.k7", 0x01000, 0x20ebea81, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "a-8.k8", 0x01000, 0xb833a15b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - { "a-9.k9", 0x01000, 0xcbd76ec2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG3 }, - - { "b-7e.a5", 0x01000, 0xddd4158d, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "b-8e.c5", 0x01000, 0xb1331b4c, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom.g9", 0x00020, 0xb7ea00d7, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Monsterz) -STD_ROM_FN(Monsterz) - -void __fastcall SfxZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0x8000) { - INT32 Offset = a - 0x8000; - if (Offset & 0x0100) ppi8255_w(0, Offset & 3, d); - if (Offset & 0x0200) ppi8255_w(1, Offset & 3, d); - return; - } - - switch (a) { - case 0x6801: { - GalIrqFire = d & 1; - return; - } - - case 0x6802: { - // coin_count_0_w - return; - } - - case 0x6800: { - GalBackgroundRed = d & 1; - return; - } - - case 0x6803: { - GalBackgroundBlue = d & 1; - return; - } - - case 0x6804: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x6805: { - GalBackgroundGreen = d & 1; - return; - } - - case 0x6806: { - GalFlipScreenX = d & 1; - return; - } - - case 0x6807: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall SfxSampleZ80Read(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #3 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall SfxSampleZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #3 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall SfxSampleZ80PortRead(UINT16 a) -{ - a &= 0xff; - - UINT8 Result = 0xff; - if (a & 0x04) Result &= ppi8255_r(2, a & 3); - return Result; -} - -void __fastcall SfxSampleZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a & 0x04) ppi8255_w(2, a & 3, d); - if (a & 0x10) DACSignedWrite(0, d); -} - -static UINT8 SfxSoundLatch2Read() -{ - return GalSoundLatch2; -} - -static void SfxPostLoad() -{ - MapTheend(); - - ZetOpen(0); - ZetSetWriteHandler(SfxZ80Write); - ZetMapArea(0x7000, 0x7fff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0x7000, 0x7fff, 2, GalZ80Rom1 + 0x4000); - ZetMapArea(0xc000, 0xefff, 0, GalZ80Rom1 + 0x5000); - ZetMapArea(0xc000, 0xefff, 2, GalZ80Rom1 + 0x5000); - ZetClose(); - - GalTempRom = (UINT8*)BurnMalloc(GalZ80Rom1Size); - memcpy(GalTempRom, GalZ80Rom1, GalZ80Rom1Size); - memcpy(GalZ80Rom1 + 0x0000, GalTempRom + 0x0000, 0x1000); - memcpy(GalZ80Rom1 + 0x7000, GalTempRom + 0x1000, 0x1000); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x2000, 0x6000); - BurnFree(GalTempRom); - - ZetOpen(2); - ZetSetReadHandler(SfxSampleZ80Read); - ZetSetWriteHandler(SfxSampleZ80Write); - ZetSetInHandler(SfxSampleZ80PortRead); - ZetSetOutHandler(SfxSampleZ80PortWrite); - ZetMapArea(0x0000, GalZ80Rom3Size - 1, 0, GalZ80Rom3); - ZetMapArea(0x0000, GalZ80Rom3Size - 1, 2, GalZ80Rom3); - ZetMapArea(0x8000, 0x83ff, 0, GalZ80Ram3); - ZetMapArea(0x8000, 0x83ff, 1, GalZ80Ram3); - ZetMapArea(0x8000, 0x83ff, 2, GalZ80Ram3); - ZetClose(); - - nGalCyclesTotal[2] = (14318000 / 8) / 60; -} - -static INT32 SfxInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = SfxPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = UpperExtendTileInfo; - - ppi8255_init(3); - PPI0PortReadA = KonamiPPIReadIN0; - PPI0PortReadB = KonamiPPIReadIN1; - PPI0PortReadC = KonamiPPIReadIN2; - PPI1PortReadC = KonamiPPIReadIN3; - PPI1PortWriteA = KonamiSoundLatchWrite; - PPI1PortWriteB = KonamiSoundControlWrite; - PPI2PortReadA = SfxSoundLatch2Read; - - SfxTilemap = 1; - GalOrientationFlipX = 1; - - return nRet; -} - -static void SkelagonPostLoad() -{ - MapTheend(); - - ZetOpen(0); - ZetSetWriteHandler(SfxZ80Write); - ZetMapArea(0x7000, 0x7fff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0x7000, 0x7fff, 2, GalZ80Rom1 + 0x4000); - ZetMapArea(0xc000, 0xefff, 0, GalZ80Rom1 + 0x5000); - ZetMapArea(0xc000, 0xefff, 2, GalZ80Rom1 + 0x5000); - ZetClose(); - - GalTempRom = (UINT8*)BurnMalloc(GalZ80Rom1Size); - memcpy(GalTempRom, GalZ80Rom1, GalZ80Rom1Size); - memset(GalZ80Rom1, 0xff, 0x1000); - memcpy(GalZ80Rom1 + 0x1000, GalTempRom + 0x0000, 0x7000); - BurnFree(GalTempRom); - - ZetOpen(2); - ZetSetReadHandler(SfxSampleZ80Read); - ZetSetWriteHandler(SfxSampleZ80Write); - ZetSetInHandler(SfxSampleZ80PortRead); - ZetSetOutHandler(SfxSampleZ80PortWrite); - ZetMapArea(0x0000, GalZ80Rom3Size - 1, 0, GalZ80Rom3); - ZetMapArea(0x0000, GalZ80Rom3Size - 1, 2, GalZ80Rom3); - ZetMapArea(0x8000, 0x83ff, 0, GalZ80Ram3); - ZetMapArea(0x8000, 0x83ff, 1, GalZ80Ram3); - ZetMapArea(0x8000, 0x83ff, 2, GalZ80Ram3); - ZetClose(); - - nGalCyclesTotal[2] = (14318000 / 8) / 60; -} - -static INT32 SkelagonInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = SkelagonPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC; - GalZ80Rom1Size = 0x1000; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = UpperExtendTileInfo; - - ppi8255_init(3); - PPI0PortReadA = KonamiPPIReadIN0; - PPI0PortReadB = KonamiPPIReadIN1; - PPI0PortReadC = KonamiPPIReadIN2; - PPI1PortReadC = KonamiPPIReadIN3; - PPI1PortWriteA = KonamiSoundLatchWrite; - PPI1PortWriteB = KonamiSoundControlWrite; - PPI2PortReadA = SfxSoundLatch2Read; - - SfxTilemap = 1; - GalOrientationFlipX = 1; - - return nRet; -} - -static void MonsterzPostLoad() -{ - MapTheend(); - - ZetOpen(0); - ZetSetWriteHandler(SfxZ80Write); - ZetMapArea(0xc000, 0xdfff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0xc000, 0xdfff, 2, GalZ80Rom1 + 0x4000); - ZetClose(); - - ZetOpen(2); - ZetSetReadHandler(SfxSampleZ80Read); - ZetSetWriteHandler(SfxSampleZ80Write); - ZetSetInHandler(SfxSampleZ80PortRead); - ZetSetOutHandler(SfxSampleZ80PortWrite); - ZetMapArea(0x0000, GalZ80Rom3Size - 1, 0, GalZ80Rom3); - ZetMapArea(0x0000, GalZ80Rom3Size - 1, 2, GalZ80Rom3); - ZetMapArea(0x8000, 0x83ff, 0, GalZ80Ram3); - ZetMapArea(0x8000, 0x83ff, 1, GalZ80Ram3); - ZetMapArea(0x8000, 0x83ff, 2, GalZ80Ram3); - ZetClose(); - - GalTempRom = (UINT8*)BurnMalloc(GalZ80Rom3Size); - memcpy(GalTempRom, GalZ80Rom3, GalZ80Rom3Size); - memcpy(GalZ80Rom3 + 0x0000, GalTempRom + 0x0000, 0x3000); - memset(GalZ80Rom3 + 0x3000, 0xff, 0x1000); - memcpy(GalZ80Rom3 + 0x4000, GalTempRom + 0x3000, 0x2000); - BurnFree(GalTempRom); - - nGalCyclesTotal[2] = (14318000 / 8) / 60; -} - -static INT32 MonsterzInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MonsterzPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC; - GalZ80Rom3Size = 0x1000; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = UpperExtendTileInfo; - - ppi8255_init(3); - PPI0PortReadA = KonamiPPIReadIN0; - PPI0PortReadB = KonamiPPIReadIN1; - PPI0PortReadC = KonamiPPIReadIN2; - PPI1PortReadC = KonamiPPIReadIN3; - PPI1PortWriteA = KonamiSoundLatchWrite; - PPI1PortWriteB = KonamiSoundControlWrite; - PPI2PortReadA = SfxSoundLatch2Read; - - SfxTilemap = 1; - GalOrientationFlipX = 1; - - return nRet; -} - -struct BurnDriver BurnDrvSfx = { - "sfx", NULL, NULL, NULL, "1983", - "SF-X\0", "Incomplete Sound", "Nichibutsu", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, SfxRomInfo, SfxRomName, NULL, NULL, SfxInputInfo, SfxDIPInfo, - SfxInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvSkelagon = { - "skelagon", "sfx", NULL, NULL, "1983", - "Skelagon\0", "Bad Dump", "Nichibutsu USA", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, SkelagonRomInfo, SkelagonRomName, NULL, NULL, SfxInputInfo, SfxDIPInfo, - SkelagonInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvMonsterz = { - "monsterz", NULL, NULL, NULL, "19??", - "Monster Zero\0", "Protected", "Nihon", "Galaxian", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, MonsterzRomInfo, MonsterzRomName, NULL, NULL, SfxInputInfo, SfxDIPInfo, - MonsterzInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -// Super Cobra based hardware -static struct BurnRomInfo ScobraRomDesc[] = { - { "epr1265.2c", 0x01000, 0xa0744b3f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e", 0x01000, 0x8e7245cd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr1267.2f", 0x01000, 0x47a4e6fb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h", 0x01000, 0x7244f21c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr1269.2j", 0x01000, 0xe1f8a801, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2l", 0x01000, 0xd52affde, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5c", 0x00800, 0xd4346959, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5d", 0x00800, 0xcc025d95, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5e", 0x00800, 0x1628c53f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "epr1274.5h", 0x00800, 0x64d113b4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr1273.5f", 0x00800, 0xa96316d3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x9b87f90d, BRF_GRA | GAL_ROM_PROM },}; - -STD_ROM_PICK(Scobra) -STD_ROM_FN(Scobra) - -static struct BurnRomInfo ScobrasRomDesc[] = { - { "scobra2c.bin", 0x01000, 0xe15ade38, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2e.bin", 0x01000, 0xa270e44d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2f.bin", 0x01000, 0xbdd70346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2h.bin", 0x01000, 0xdca5ec31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2j.bin", 0x01000, 0x0d8f6b6e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2l.bin", 0x01000, 0x6f80f3a9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr1275.5c", 0x00800, 0xdeeb0dd3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr1276.5d", 0x00800, 0x872c1a74, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr1277.5e", 0x00800, 0xccd7a110, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "epr1274.5h", 0x00800, 0x64d113b4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr1273.5f", 0x00800, 0xa96316d3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x9b87f90d, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scobras) -STD_ROM_FN(Scobras) - -static struct BurnRomInfo ScobraseRomDesc[] = { - { "epr1265.2c", 0x01000, 0xa0744b3f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr1266.2e", 0x01000, 0x65306279, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr1267.2f", 0x01000, 0x47a4e6fb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr1268.2h", 0x01000, 0x53eecaf2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr1269.2j", 0x01000, 0xe1f8a801, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "epr1270.2l", 0x01000, 0xf7709710, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr1275.5c", 0x00800, 0xdeeb0dd3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr1276.5d", 0x00800, 0x872c1a74, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr1277.5e", 0x00800, 0xccd7a110, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "epr1274.5h", 0x00800, 0x64d113b4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr1273.5f", 0x00800, 0xa96316d3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "pr1278.6e", 0x00020, 0xfd35c561, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scobrase) -STD_ROM_FN(Scobrase) - -static struct BurnRomInfo ScobrabRomDesc[] = { - { "vid_2c.bin", 0x00800, 0xaeddf391, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "vid_2e.bin", 0x00800, 0x72b57eb7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2e.bin", 0x01000, 0xa270e44d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2f.bin", 0x01000, 0xbdd70346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2h.bin", 0x01000, 0xdca5ec31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2j.bin", 0x01000, 0x0d8f6b6e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2l.bin", 0x01000, 0x6f80f3a9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr1275.5c", 0x00800, 0xdeeb0dd3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr1276.5d", 0x00800, 0x872c1a74, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr1277.5e", 0x00800, 0xccd7a110, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "epr1274.5h", 0x00800, 0x64d113b4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr1273.5f", 0x00800, 0xa96316d3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x9b87f90d, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scobrab) -STD_ROM_FN(Scobrab) - -static struct BurnRomInfo ScobraeRomDesc[] = { - { "super cobra ra1 2c 1981.2c", 0x01000, 0xba9d4152, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "super cobra ra1 2e 1981.2e", 0x01000, 0xf9b77b27, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "super cobra ra1 2f 1981.2f", 0x01000, 0xe6109c2c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "super cobra ra1 2h 1981.2h", 0x01000, 0x8762735b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "super cobra ra1 2j 1981.2j", 0x01000, 0x5648f404, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "super cobra ra1 2l 1981.2l", 0x01000, 0x34476cc3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5c", 0x00800, 0xdeeb0dd3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5d", 0x00800, 0x872c1a74, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5e", 0x00800, 0xccd7a110, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "super cobra ra1 5f 1981.5f", 0x00800, 0x64d113b4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "super cobra ra1 5h 1981.5h", 0x00800, 0xa96316d3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x9b87f90d, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Scobrae) -STD_ROM_FN(Scobrae) - -static struct BurnRomInfo SuprheliRomDesc[] = { - { "1.2c", 0x01000, 0xb25141d8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2e.bin", 0x01000, 0xa270e44d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2f.bin", 0x01000, 0xbdd70346, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2h.bin", 0x01000, 0xdca5ec31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "scobra2j.bin", 0x01000, 0x0d8f6b6e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "6.2l", 0x01000, 0x10a474d9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "epr1275.5c", 0x00800, 0xdeeb0dd3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "epr1276.5d", 0x00800, 0x872c1a74, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "9.9d", 0x00800, 0x2b69b8f3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "epr1274.5h", 0x00800, 0x64d113b4, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "epr1273.5f", 0x00800, 0xa96316d3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "k.6e", 0x00020, 0xfd35c561, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Suprheli) -STD_ROM_FN(Suprheli) - -static struct BurnRomInfo LosttombRomDesc[] = { - { "2c", 0x01000, 0xd6176d2c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e", 0x01000, 0xa5f55f4a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f", 0x01000, 0x0169fa3c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h-easy", 0x01000, 0x054481b6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j", 0x01000, 0x249ee040, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2l", 0x01000, 0xc7d2e608, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2m", 0x01000, 0xbc4bc5b1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5c", 0x00800, 0xb899be2a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5d", 0x00800, 0x6907af31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f", 0x00800, 0x61f137e7, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h", 0x00800, 0x5581de5f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "ltprom", 0x00020, 0x1108b816, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Losttomb) -STD_ROM_FN(Losttomb) - -static struct BurnRomInfo LosttombhRomDesc[] = { - { "2c", 0x01000, 0xd6176d2c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e", 0x01000, 0xa5f55f4a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f", 0x01000, 0x0169fa3c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "lthard", 0x01000, 0xe32cbf0e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j", 0x01000, 0x249ee040, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2l", 0x01000, 0xc7d2e608, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2m", 0x01000, 0xbc4bc5b1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5c", 0x00800, 0xb899be2a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5d", 0x00800, 0x6907af31, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f", 0x00800, 0x61f137e7, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h", 0x00800, 0x5581de5f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "ltprom", 0x00020, 0x1108b816, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Losttombh) -STD_ROM_FN(Losttombh) - -static struct BurnRomInfo ArmorcarRomDesc[] = { - { "cpu.2c", 0x01000, 0x0d7bfdfb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cpu.2e", 0x01000, 0x76463213, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cpu.2f", 0x01000, 0x2cc6d5f0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cpu.2h", 0x01000, 0x61278dbb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "cpu.2j", 0x01000, 0xfb158d8c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "sound.5c", 0x00800, 0x54ee7753, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "sound.5d", 0x00800, 0x5218fec0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "cpu.5f", 0x00800, 0x8a3da4d1, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "cpu.5h", 0x00800, 0x85bdb113, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x9b87f90d, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Armorcar) -STD_ROM_FN(Armorcar) - -static struct BurnRomInfo Armorcar2RomDesc[] = { - { "2c", 0x01000, 0xe393bd2f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e", 0x01000, 0xb7d443af, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2g", 0x01000, 0xe67380a4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h", 0x01000, 0x72af7b37, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j", 0x01000, 0xe6b0dd7f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "sound.5c", 0x00800, 0x54ee7753, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "sound.5d", 0x00800, 0x5218fec0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "cpu.5f", 0x00800, 0x8a3da4d1, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "cpu.5h", 0x00800, 0x85bdb113, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x9b87f90d, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Armorcar2) -STD_ROM_FN(Armorcar2) - -static struct BurnRomInfo TazmaniaRomDesc[] = { - { "2c.cpu", 0x01000, 0x932c5a06, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e.cpu", 0x01000, 0xef17ce65, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f.cpu", 0x01000, 0x43c7c39d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h.cpu", 0x01000, 0xbe829694, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j.cpu", 0x01000, 0x6e197271, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2k.cpu", 0x01000, 0xa1eb453b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "rom0.snd", 0x00800, 0xb8d741f1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f.cpu", 0x00800, 0x2c5b612b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h.cpu", 0x00800, 0x3f5ff3ac, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "colr6f.cpu", 0x00020, 0xfce333c7, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Tazmania) -STD_ROM_FN(Tazmania) - -static struct BurnRomInfo Tazmani2RomDesc[] = { - { "2ck.cpu", 0x01000, 0xbf0492bf, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2ek.cpu", 0x01000, 0x6636c4d0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2fk.cpu", 0x01000, 0xce59a57b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2hk.cpu", 0x01000, 0x8bda3380, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2jk.cpu", 0x01000, 0xa4095e35, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2kk.cpu", 0x01000, 0xf308ca36, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "rom0.snd", 0x00800, 0xb8d741f1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f.cpu", 0x00800, 0x2c5b612b, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h.cpu", 0x00800, 0x3f5ff3ac, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "colr6f.cpu", 0x00020, 0xfce333c7, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Tazmani2) -STD_ROM_FN(Tazmani2) - -static struct BurnRomInfo AnteaterRomDesc[] = { - { "ra1-2c", 0x01000, 0x58bc9393, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ra1-2e", 0x01000, 0x574fc6f6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ra1-2f", 0x01000, 0x2f7c1fe5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ra1-2h", 0x01000, 0xae8a5da3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ra4-5c", 0x00800, 0x87300b4f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ra4-5d", 0x00800, 0xaf4e5ffe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "ra6-5f", 0x00800, 0x4c3f8a08, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ra6-5h", 0x00800, 0xb30c7c9f, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "colr6f.cpu", 0x00020, 0xfce333c7, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Anteater) -STD_ROM_FN(Anteater) - -static struct BurnRomInfo AnteatergRomDesc[] = { - { "prg_2.bin", 0x02000, 0x2ba793a8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "prg_1.bin", 0x02000, 0x7a798af5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ra4-5c", 0x00800, 0x87300b4f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ra4-5d", 0x00800, 0xaf4e5ffe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "gfx_1.bin", 0x00800, 0x1e2824b1, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "gfx_2.bin", 0x00800, 0x784319b3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "colr6f.cpu", 0x00020, 0xfce333c7, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Anteaterg) -STD_ROM_FN(Anteaterg) - -static struct BurnRomInfo AnteaterukRomDesc[] = { - { "ant1.bin", 0x02000, 0x69debc90, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ant2.bin", 0x02000, 0xab352805, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ra4-5c", 0x00800, 0x87300b4f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ra4-5d", 0x00800, 0xaf4e5ffe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "gfx_1.bin", 0x00800, 0x1e2824b1, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "gfx_2.bin", 0x00800, 0x784319b3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "colr6f.cpu", 0x00020, 0xfce333c7, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Anteateruk) -STD_ROM_FN(Anteateruk) - -static struct BurnRomInfo SpdcoinRomDesc[] = { - { "spdcoin.2c", 0x01000, 0x65cf1e49, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "spdcoin.2e", 0x01000, 0x1ee59232, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "spdcoin.5c", 0x00800, 0xb4cf64b7, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "spdcoin.5d", 0x00800, 0x92304df0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "spdcoin.5f", 0x00800, 0xdd5f1dbc, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "spdcoin.5h", 0x00800, 0xab1fe81b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "spdcoin.clr", 0x00020, 0x1a2ccc56, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Spdcoin) -STD_ROM_FN(Spdcoin) - -static struct BurnRomInfo SuperbonRomDesc[] = { - { "2d.cpu", 0x01000, 0x60c0ba18, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e.cpu", 0x01000, 0xddcf44bf, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f.cpu", 0x01000, 0xbb66c2d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h.cpu", 0x01000, 0x74f4f04d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j.cpu", 0x01000, 0x78effb08, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2l.cpu", 0x01000, 0xe9dcecbd, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2m.cpu", 0x01000, 0x3ed0337e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5c", 0x00800, 0xb899be2a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "5d.snd", 0x00800, 0x80640a04, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f.cpu", 0x00800, 0x5b9d4686, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h.cpu", 0x00800, 0x58c29927, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x9b87f90d, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Superbon) -STD_ROM_FN(Superbon) - -static struct BurnRomInfo CalipsoRomDesc[] = { - { "calipso.2c", 0x01000, 0x0fcb703c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "calipso.2e", 0x01000, 0xc6622f14, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "calipso.2f", 0x01000, 0x7bacbaba, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "calipso.2h", 0x01000, 0xa3a8111b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "calipso.2j", 0x01000, 0xfcbd7b9e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "calipso.2l", 0x01000, 0xf7630cab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "calipso.5c", 0x00800, 0x9cbc65ab, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "calipso.5d", 0x00800, 0xa225ee3b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "calipso.5f", 0x02000, 0xfd4252e9, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "calipso.5h", 0x02000, 0x1663a73a, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "calipso.clr", 0x00020, 0x01165832, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Calipso) -STD_ROM_FN(Calipso) - -static struct BurnRomInfo MoonwarRomDesc[] = { - { "mw2.2c", 0x01000, 0x7c11b4d9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mw2.2e", 0x01000, 0x1b6362be, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mw2.2f", 0x01000, 0x4fd8ba4b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mw2.2h", 0x01000, 0x56879f0d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mw2.5c", 0x00800, 0xc26231eb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "mw2.5d", 0x00800, 0xbb48a646, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "mw2.5f", 0x00800, 0xc5fa1aa0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mw2.5h", 0x00800, 0xa6ccc652, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mw2.clr", 0x00020, 0x99614c6c, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Moonwar) -STD_ROM_FN(Moonwar) - -static struct BurnRomInfo MoonwaraRomDesc[] = { - { "2c", 0x01000, 0xbc20b734, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e", 0x01000, 0xdb6ffec2, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f", 0x01000, 0x378931b8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h", 0x01000, 0x031dbc2c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mw2.5c", 0x00800, 0xc26231eb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "mw2.5d", 0x00800, 0xbb48a646, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "mw2.5f", 0x00800, 0xc5fa1aa0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mw2.5h", 0x00800, 0xa6ccc652, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "moonwara.clr", 0x00020, 0xf58d4f58, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Moonwara) -STD_ROM_FN(Moonwara) - -static struct BurnRomInfo StratgyxRomDesc[] = { - { "2c_1.bin", 0x01000, 0xeec01237, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e_2.bin", 0x01000, 0x926cb2d5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f_3.bin", 0x01000, 0x849e2504, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h_4.bin", 0x01000, 0x8a64069b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j_5.bin", 0x01000, 0x78b9b898, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2l_6.bin", 0x01000, 0x20bae414, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "s1.bin", 0x01000, 0x713a5db8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "s2.bin", 0x01000, 0x46079411, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f_c2.bin", 0x00800, 0x7121b679, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h_c1.bin", 0x00800, 0xd105ad91, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "strategy.6e", 0x00020, 0x51a629e1, BRF_GRA | GAL_ROM_PROM }, - { "strategy.10k", 0x00020, 0xd95c0318, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Stratgyx) -STD_ROM_FN(Stratgyx) - -static struct BurnRomInfo StratgysRomDesc[] = { - { "2c.cpu", 0x01000, 0xf2aaaf2b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2e.cpu", 0x01000, 0x5873fdc8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f.cpu", 0x01000, 0x532d604f, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h.cpu", 0x01000, 0x82b1d95e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j.cpu", 0x01000, 0x66e84cde, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2l.cpu", 0x01000, 0x62b032d0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "s1.bin", 0x01000, 0x713a5db8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "s2.bin", 0x01000, 0x46079411, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f.cpu", 0x00800, 0xf4aa5ddd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h.cpu", 0x00800, 0x548e4635, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "strategy.6e", 0x00020, 0x51a629e1, BRF_GRA | GAL_ROM_PROM }, - { "strategy.10k", 0x00020, 0xd95c0318, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Stratgys) -STD_ROM_FN(Stratgys) - -static struct BurnRomInfo StrongxRomDesc[] = { - { "strongx.2d", 0x01000, 0xc2f7268c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "strongx.2e", 0x01000, 0x91059422, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2f_3.bin", 0x01000, 0x849e2504, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2h_4.bin", 0x01000, 0x8a64069b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2j_5.bin", 0x01000, 0x78b9b898, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "2l_6.bin", 0x01000, 0x20bae414, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "s1.bin", 0x01000, 0x713a5db8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "s2.bin", 0x01000, 0x46079411, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "5f_c2.bin", 0x00800, 0x7121b679, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h_c1.bin", 0x00800, 0xd105ad91, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "strategy.6e", 0x00020, 0x51a629e1, BRF_GRA | GAL_ROM_PROM }, - { "strategy.10k", 0x00020, 0xd95c0318, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Strongx) -STD_ROM_FN(Strongx) - -static struct BurnRomInfo DarkplntRomDesc[] = { - { "drkplt2c.dat", 0x01000, 0x5a0ca559, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "drkplt2e.dat", 0x01000, 0x52e2117d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "drkplt2g.dat", 0x01000, 0x4093219c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "drkplt2j.dat", 0x01000, 0xb974c78d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "drkplt2k.dat", 0x01000, 0x71a37385, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "drkplt2l.dat", 0x01000, 0x5ad25154, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "drkplt2m.dat", 0x01000, 0x8d2f0122, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "drkplt2p.dat", 0x01000, 0x2d66253b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5c.snd", 0x01000, 0x672b9454, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "drkplt5f.dat", 0x00800, 0x2af0ee66, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "drkplt5h.dat", 0x00800, 0x66ef3225, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6e.cpu", 0x00020, 0x86b6e124, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Darkplnt) -STD_ROM_FN(Darkplnt) - -static struct BurnRomInfo RescueRomDesc[] = { - { "rb15acpu.bin", 0x01000, 0xd7e654ba, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rb15bcpu.bin", 0x01000, 0xa93ea158, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rb15ccpu.bin", 0x01000, 0x058cd3d0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rb15dcpu.bin", 0x01000, 0xd6505742, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rb15ecpu.bin", 0x01000, 0x604df3a4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "rb15csnd.bin", 0x00800, 0x8b24bf17, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "rb15dsnd.bin", 0x00800, 0xd96e4fb3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "rb15fcpu.bin", 0x00800, 0x4489d20c, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rb15hcpu.bin", 0x00800, 0x5512c547, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "rescue.clr", 0x00020, 0x40c6bcbd, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Rescue) -STD_ROM_FN(Rescue) - -static struct BurnRomInfo AponowRomDesc[] = { - { "aponow01.rom", 0x01000, 0x33011579, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "aponow02.rom", 0x01000, 0xd477573e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "aponow03.rom", 0x01000, 0x46c41898, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rb15dcpu.bin", 0x01000, 0xd6505742, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "rb15ecpu.bin", 0x01000, 0x604df3a4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "rb15csnd.bin", 0x00800, 0x8b24bf17, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "rb15dsnd.bin", 0x00800, 0xd96e4fb3, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "rb15fcpu.bin", 0x00800, 0x4489d20c, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rb15hcpu.bin", 0x00800, 0x5512c547, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "rescue.clr", 0x00020, 0x40c6bcbd, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Aponow) -STD_ROM_FN(Aponow) - -static struct BurnRomInfo MinefldRomDesc[] = { - { "ma22c", 0x01000, 0x1367a035, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ma22e", 0x01000, 0x68946d21, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ma22f", 0x01000, 0x7663aee5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ma22h", 0x01000, 0x9787475d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ma22j", 0x01000, 0x2ceceb54, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "ma22l", 0x01000, 0x85138fc9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "ma15c", 0x00800, 0x8bef736b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "ma15d", 0x00800, 0xf67b3f97, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "ma15f", 0x00800, 0x9f703006, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "ma15h", 0x00800, 0xed0dccb1, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "minefld.clr", 0x00020, 0x1877368e, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Minefld) -STD_ROM_FN(Minefld) - -static struct BurnRomInfo HustlerRomDesc[] = { - { "hustler.1", 0x01000, 0x94479a3e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "hustler.2", 0x01000, 0x3cc67bcc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "hustler.3", 0x01000, 0x9422226a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "hustler.6", 0x00800, 0x7a946544, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "hustler.7", 0x00800, 0x3db57351, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "hustler.5f", 0x00800, 0x0bdfad0e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "hustler.5h", 0x00800, 0x8e062177, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "hustler.clr", 0x00020, 0xaa1f7f5e, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Hustler) -STD_ROM_FN(Hustler) - -static struct BurnRomInfo BilliardRomDesc[] = { - { "a", 0x01000, 0xb7eb50c0, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "b", 0x01000, 0x988fe1c5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "c", 0x01000, 0x7b8de793, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "hustler.6", 0x00800, 0x7a946544, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "hustler.7", 0x00800, 0x3db57351, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "hustler.5f", 0x00800, 0x0bdfad0e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "hustler.5h", 0x00800, 0x8e062177, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "hustler.clr", 0x00020, 0xaa1f7f5e, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Billiard) -STD_ROM_FN(Billiard) - -static struct BurnRomInfo HustlerbRomDesc[] = { - { "hustler.2c", 0x01000, 0x3a1ac6a9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "hustler.2f", 0x01000, 0xdc6752ec, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "hustler.2j", 0x01000, 0x27c1e0f8, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "hustler.11d", 0x00800, 0xb559bfde, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "hustler.10d", 0x00800, 0x6ef96cfb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "hustler.5f", 0x00800, 0x0bdfad0e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "hustler.5h", 0x00800, 0x8e062177, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "hustler.clr", 0x00020, 0xaa1f7f5e, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Hustlerb) -STD_ROM_FN(Hustlerb) - -static struct BurnRomInfo MimonkeyRomDesc[] = { - { "mm1.2e", 0x01000, 0x9019f1b1, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm2.2e", 0x01000, 0x043e97d6, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm3.2f", 0x01000, 0x1052726a, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm4.2h", 0x01000, 0x7b3f35ff, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm5.2j", 0x01000, 0xb4e5c32d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm6.2l", 0x01000, 0x409036c4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm7.2m", 0x01000, 0x119c08fa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "mm8.2p", 0x01000, 0xf7989f04, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mm13.11d", 0x01000, 0x2d14c527, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "mm14.10d", 0x01000, 0x35ed0f96, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "mm12.5h", 0x01000, 0xf73a8412, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mm10.5h", 0x01000, 0x3828c9db, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mm11.5f", 0x01000, 0x9e0e9289, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mm9.5f", 0x01000, 0x92085b0c, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mimonkey) -STD_ROM_FN(Mimonkey) - -static struct BurnRomInfo MimonscoRomDesc[] = { - { "fra_1a", 0x01000, 0x8e7a7379, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "fra_1b", 0x01000, 0xab08cbfe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "fra_2a", 0x01000, 0x2d4da24d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "fra_2b", 0x01000, 0x8d88fc7c, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "fra_3a", 0x01000, 0xb4e5c32d, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "fra_3b", 0x01000, 0x409036c4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "fra_4a", 0x01000, 0x119c08fa, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "fra_4b", 0x01000, 0xd700fd03, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "mmsound1", 0x01000, 0x2d14c527, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - { "mmsnd2a", 0x01000, 0x35ed0f96, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG2 }, - - { "mmgfx1", 0x02000, 0x4af47337, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "mmgfx2", 0x02000, 0xdef47da8, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, -}; - -STD_ROM_PICK(Mimonsco) -STD_ROM_FN(Mimonsco) - -UINT8 __fastcall Tazmani2Z80Read(UINT16 a) -{ - if (a >= 0xa000 && a <= 0xa00f) { - return ppi8255_r(0, (a - 0xa000) >> 2); - } - - if (a >= 0xa800 && a <= 0xa80f) { - return ppi8255_r(1, (a - 0xa800) >> 2); - } - - switch (a) { - case 0x9800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall Tazmani2Z80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x8800 && a <= 0x88ff) { - INT32 Offset = a - 0x8800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0xa000 && a <= 0xa00f) { - ppi8255_w(0, (a - 0xa000) >> 2, d); - return; - } - - if (a >= 0xa800 && a <= 0xa80f) { - ppi8255_w(1, (a - 0xa800) >> 2, d); - return; - } - - switch (a) { - case 0xb000: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb002: { - GalBackgroundEnable = d & 1; - return; - } - - case 0xb004: { - GalIrqFire = d & 1; - return; - } - - case 0xb006: { - // coin_count_0_w - return; - } - - case 0xb00c: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb00e: { - GalFlipScreenX = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall AnteatergZ80Read(UINT16 a) -{ - switch (a) { - case 0xf521: { - // watchdog read - return 0xff; - } - - case 0xf612: { - return ppi8255_r(0, 0); - } - - case 0xf631: { - return ppi8255_r(0, 1); - } - - case 0xf710: { - return ppi8255_r(0, 2); - } - - case 0xf753: { - return ppi8255_r(0, 3); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall AnteatergZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x2000 && a <= 0x20ff) { - INT32 Offset = a - 0x2000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x2423: { - ppi8255_w(1, 3, d); - return; - } - - case 0x2450: { - ppi8255_w(1, 0, d); - return; - } - - case 0x2511: { - ppi8255_w(1, 1, d); - return; - } - - case 0x2621: { - GalIrqFire = d & 1; - return; - } - - case 0x2624: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x2647: { - GalFlipScreenY = d & 1; - return; - } - - case 0x2653: { - GalBackgroundEnable = d & 1; - return; - } - - case 0x2702: { - // coin_count_0_w - return; - } - - case 0x2736: { - GalFlipScreenX = d & 1; - return; - } - - case 0xf612: { - ppi8255_w(0, 0, d); - return; - } - - case 0xf631: { - ppi8255_w(0, 1, d); - return; - } - - case 0xf710: { - ppi8255_w(0, 2, d); - return; - } - - case 0xf753: { - ppi8255_w(0, 3, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall AnteatgbZ80Read(UINT16 a) -{ - switch (a) { - case 0x145b: { - // watchdog read - return 0xff; - } - - case 0xf300: - case 0xf301: - case 0xf302: - case 0xf303: { - return ppi8255_r(0, a - 0xf300); - } - - case 0xfe00: - case 0xfe01: - case 0xfe02: - case 0xfe03: { - return ppi8255_r(1, a - 0xfe00); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall AnteatgbZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x1200 && a <= 0x12ff) { - INT32 Offset = a - 0x1200; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x1171: { - GalIrqFire = d & 1; - return; - } - - case 0x1172: { - // coin_count_0_w - return; - } - - case 0x1173: { - GalBackgroundEnable = d & 1; - return; - } - - case 0x1174: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x1176: { - GalFlipScreenX = d & 1; - return; - } - - case 0x1177: { - GalFlipScreenY = d & 1; - return; - } - - case 0xf300: - case 0xf301: - case 0xf302: - case 0xf303: { - ppi8255_w(0, a - 0xf300, d); - return; - } - - case 0xfe00: - case 0xfe01: - case 0xfe02: - case 0xfe03: { - ppi8255_w(1, a - 0xfe00, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall StratgyxZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x8800 && a <= 0x88ff) { - INT32 Offset = a - 0x8800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0xa000 && a <= 0xa00f) { - ppi8255_w(0, (a - 0xa000) >> 2, d); - return; - } - - if (a >= 0xa800 && a <= 0xa80f) { - ppi8255_w(1, (a - 0xa800) >> 2, d); - return; - } - - switch (a) { - case 0xb000: { - GalBackgroundGreen = d & 1; - return; - } - - case 0xb002: { - GalBackgroundBlue = d & 1; - return; - } - - case 0xb004: { - GalIrqFire = d & 1; - return; - } - - case 0xb006: - case 0xb008: { - // coin_count_0_w - return; - } - - case 0xb00a: { - GalBackgroundRed = d & 1; - return; - } - - case 0xb00c: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb00e: { - GalFlipScreenX = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall DarkplntZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x8800 && a <= 0x88ff) { - INT32 Offset = a - 0x8800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0xa000 && a <= 0xa00f) { - ppi8255_w(0, (a - 0xa000) >> 2, d); - return; - } - - if (a >= 0xa800 && a <= 0xa80f) { - ppi8255_w(1, (a - 0xa800) >> 2, d); - return; - } - - switch (a) { - case 0xb000: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb002: { - GalBackgroundEnable = d & 1; - return; - } - - case 0xb004: { - GalIrqFire = d & 1; - return; - } - - case 0xb006: { - // coin_count_0_w - return; - } - - case 0xb00a: { - DarkplntBulletColour = d & 1; - return; - } - - case 0xb00c: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb00e: { - GalFlipScreenX = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall HustlerZ80Read(UINT16 a) -{ - if (a >= 0xd000 && a <= 0xd01f) { - return ppi8255_r(0, (a - 0xd000) >> 3); - } - - if (a >= 0xe000 && a <= 0xe01f) { - return ppi8255_r(1, (a - 0xe000) >> 3); - } - - switch (a) { - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall HustlerZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9000 && a <= 0x90ff) { - INT32 Offset = a - 0x9000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0xd000 && a <= 0xd01f) { - ppi8255_w(0, (a - 0xd000) >> 3, d); - return; - } - - if (a >= 0xe000 && a <= 0xe01f) { - ppi8255_w(1, (a - 0xe000) >> 3, d); - return; - } - - switch (a) { - case 0xa802: { - GalFlipScreenX = d & 1; - return; - } - - case 0xa804: { - GalIrqFire = d & 1; - return; - } - - case 0xa806: { - GalFlipScreenY = d & 1; - return; - } - - case 0xa80e: { - // coin_count_0_w - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall HustlerbZ80Read(UINT16 a) -{ - switch (a) { - case 0xb000: { - // watchdog read - return 0xff; - } - - case 0xc100: - case 0xc101: - case 0xc102: - case 0xc103: { - return ppi8255_r(0, a - 0xc100); - } - - case 0xc200: - case 0xc201: - case 0xc202: - case 0xc203: { - return ppi8255_r(1, a - 0xc200); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall HustlerbZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9000 && a <= 0x90ff) { - INT32 Offset = a - 0x9000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0xa801: { - GalIrqFire = d & 1; - return; - } - - case 0xa802: { - // coin_count_0_w - return; - } - - case 0xa806: { - GalFlipScreenY = d & 1; - return; - } - - case 0xa807: { - GalFlipScreenX = d & 1; - return; - } - - case 0xc100: - case 0xc101: - case 0xc102: - case 0xc103: { - ppi8255_w(0, a - 0xc100, d); - return; - } - - case 0xc200: - case 0xc201: - case 0xc202: - case 0xc203: { - ppi8255_w(1, a - 0xc200, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall HustlerbSoundZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x80: { - return AY8910Read(0); - } - } - - return 0xff; -} - -void __fastcall HustlerbSoundZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x40: { - AY8910Write(0, 0, d); - return; - } - - case 0x80: { - AY8910Write(0, 1, d); - return; - } - } -} - -void __fastcall MimonkeyZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9000 && a <= 0x90ff) { - INT32 Offset = a - 0x9000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x9800: - case 0x9801: - case 0x9802: - case 0x9803: { - ppi8255_w(0, a - 0x9800, d); - return; - } - - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: { - ppi8255_w(1, a - 0xa000, d); - return; - } - - case 0xa800: { - GalGfxBank[0] = d & 1; - return; - } - - case 0xa801: { - GalIrqFire = d & 1; - return; - } - - case 0xa802: { - GalGfxBank[1] = d & 1; - return; - } - - case 0xa803: { - // ??? - return; - } - - case 0xa804: { - GalBackgroundEnable = d & 1; - return; - } - - case 0xa805: { - // ??? - return; - } - - case 0xa806: { - GalFlipScreenX = d & 1; - return; - } - - case 0xa807: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 ScobraInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScobra; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - return nRet; -} - -static INT32 ScobraeInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScobra; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - for (INT32 Offs = 0; Offs < 0x6000; Offs++) { - INT32 i = Offs & 0x7f; - INT32 x = GalZ80Rom1[Offs]; - - if (Offs & 0x80) i ^= 0x7f; - - if (i & 0x01) x ^= 0x49; - if (i & 0x02) x ^= 0x21; - if (i & 0x04) x ^= 0x18; - if (i & 0x08) x ^= 0x12; - if (i & 0x10) x ^= 0x84; - if (i & 0x20) x ^= 0x24; - if (i & 0x40) x ^= 0x40; - - GalZ80Rom1[Offs] = x ^ 0xff; - } - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - return nRet; -} - -static INT32 LosttombInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScobra; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - UINT8 *TempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - BurnLoadRom(TempRom + 0x0800, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - for (UINT32 Offset = 0; Offset < GalTilesSharedRomSize; Offset++) { - UINT32 SrcOffset = Offset & 0xa7f; - SrcOffset |= ((BIT(Offset, 1) & BIT(Offset, 8)) | ((1 ^ BIT(Offset, 1)) & (BIT(Offset, 10)))) << 7; - SrcOffset |= (BIT(Offset, 7) ^ (BIT(Offset, 1) & (BIT(Offset, 7) ^ BIT(Offset, 10)))) << 8; - SrcOffset |= ((BIT(Offset, 1) & BIT(Offset, 7)) | ((1 ^ BIT(Offset, 1)) & (BIT(Offset, 8)))) << 10; - GalTempRom[Offset] = TempRom[SrcOffset]; - } - BurnFree(TempRom); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static void MapTazmani2() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(Tazmani2Z80Read); - ZetSetWriteHandler(Tazmani2Z80Write); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x8000) ? 0x7fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x8000) ? 0x7fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetMapArea(0x8800, 0x88ff, 0, GalSpriteRam); - ZetMapArea(0x8800, 0x88ff, 2, GalSpriteRam); - ZetMapArea(0x9000, 0x93ff, 0, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 1, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 2, GalVideoRam); - ZetClose(); -} - -static INT32 Tazmani2Init() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapTazmani2; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - return nRet; -} - -static INT32 AnteaterInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScobra; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - UINT8 *TempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - BurnLoadRom(TempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); - BurnLoadRom(TempRom + 0x0800, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); - for (UINT32 Offset = 0; Offset < GalTilesSharedRomSize; Offset++) { - UINT32 SrcOffset = Offset & 0x9bf; - SrcOffset |= (BIT(Offset, 4) ^ BIT(Offset, 9) ^ (BIT(Offset, 2) & BIT(Offset, 10))) << 6; - SrcOffset |= (BIT(Offset, 2) ^ BIT(Offset, 10)) << 9; - SrcOffset |= (BIT(Offset, 0) ^ BIT(Offset, 6) ^ 1) << 10; - GalTempRom[Offset] = TempRom[SrcOffset]; - } - BurnFree(TempRom); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - GalRenderBackgroundFunction = AnteaterDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static void AnteatergPostLoad() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(AnteatergZ80Read); - ZetSetWriteHandler(AnteatergZ80Write); - ZetMapArea(0x0000, 0x03ff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x03ff, 2, GalZ80Rom1); - ZetMapArea(0x0400, 0x0bff, 0, GalZ80Ram1); - ZetMapArea(0x0400, 0x0bff, 1, GalZ80Ram1); - ZetMapArea(0x0400, 0x0bff, 2, GalZ80Ram1); - ZetMapArea(0x0c00, 0x0fff, 0, GalVideoRam); - ZetMapArea(0x0c00, 0x0fff, 1, GalVideoRam); - ZetMapArea(0x0c00, 0x0fff, 2, GalVideoRam); - ZetMapArea(0x2000, 0x20ff, 0, GalSpriteRam); - ZetMapArea(0x2000, 0x20ff, 2, GalSpriteRam); - ZetMapArea(0x4600, 0x4fff, 0, GalZ80Rom1 + 0x0400); - ZetMapArea(0x4600, 0x4fff, 2, GalZ80Rom1 + 0x0400); - ZetMapArea(0x6400, 0x7aff, 0, GalZ80Rom1 + 0x0e00); - ZetMapArea(0x6400, 0x7aff, 2, GalZ80Rom1 + 0x0e00); - ZetMapArea(0x7c00, 0x7fff, 0, GalVideoRam); - ZetMapArea(0x7c00, 0x7fff, 1, GalVideoRam); - ZetMapArea(0x7c00, 0x7fff, 2, GalVideoRam); - ZetMapArea(0x8300, 0x98ff, 0, GalZ80Rom1 + 0x2500); - ZetMapArea(0x8300, 0x98ff, 2, GalZ80Rom1 + 0x2500); - ZetMapArea(0xa300, 0xa7ff, 0, GalZ80Rom1 + 0x3b00); - ZetMapArea(0xa300, 0xa7ff, 2, GalZ80Rom1 + 0x3b00); - ZetClose(); -} - -static INT32 AnteatergInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = AnteatergPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = AnteaterDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static void AnteaterukPostLoad() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(AnteatgbZ80Read); - ZetSetWriteHandler(AnteatgbZ80Write); - ZetMapArea(0x0000, 0x03ff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x03ff, 2, GalZ80Rom1); - ZetMapArea(0x0400, 0x0bff, 0, GalZ80Ram1); - ZetMapArea(0x0400, 0x0bff, 1, GalZ80Ram1); - ZetMapArea(0x0400, 0x0bff, 2, GalZ80Ram1); - ZetMapArea(0x0c00, 0x0fff, 0, GalVideoRam); - ZetMapArea(0x0c00, 0x0fff, 1, GalVideoRam); - ZetMapArea(0x0c00, 0x0fff, 2, GalVideoRam); - ZetMapArea(0x1200, 0x12ff, 0, GalSpriteRam); - ZetMapArea(0x1200, 0x12ff, 2, GalSpriteRam); - ZetMapArea(0x4600, 0x4fff, 0, GalZ80Rom1 + 0x0400); - ZetMapArea(0x4600, 0x4fff, 2, GalZ80Rom1 + 0x0400); - ZetMapArea(0x6400, 0x7aff, 0, GalZ80Rom1 + 0x0e00); - ZetMapArea(0x6400, 0x7aff, 2, GalZ80Rom1 + 0x0e00); - ZetMapArea(0x8300, 0x98ff, 0, GalZ80Rom1 + 0x2500); - ZetMapArea(0x8300, 0x98ff, 2, GalZ80Rom1 + 0x2500); - ZetMapArea(0xa300, 0xa7ff, 0, GalZ80Rom1 + 0x3b00); - ZetMapArea(0xa300, 0xa7ff, 2, GalZ80Rom1 + 0x3b00); - ZetClose(); -} - -static INT32 AnteaterukInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = AnteaterukPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static void SuperbonPostLoad() -{ - MapScobra(); - - for (UINT32 Offset = 0; Offset < 0x1000; Offset++) { - switch (Offset & 0x280) { - case 0x000: GalZ80Rom1[Offset] ^= 0x92; break; - case 0x080: GalZ80Rom1[Offset] ^= 0x82; break; - case 0x200: GalZ80Rom1[Offset] ^= 0x12; break; - case 0x280: GalZ80Rom1[Offset] ^= 0x10; break; - } - } -} - -static INT32 SuperbonInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = SuperbonPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static INT32 CalipsoInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScobra; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendSpriteInfoFunction = CalipsoExtendSpriteInfo; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static UINT8 MoonwarPPIReadIN0() -{ - UINT8 Dial1 = (GalAnalogPort0 >> 8) & 0xff; - UINT8 Dial2 = (GalAnalogPort1 >> 8) & 0xff; - UINT8 Input0 = 0xff - GalInput[0] - GalDip[0]; - UINT8 Sign; - UINT8 Delta; - - if (Dial1 >= 0xfc || (Dial1 >= 0x01 && Dial1 <= 0x04)) Dial1 = 0; - if (Dial1 >= 0xf8) Dial1 = 0xfd; - if (Dial1 >= 0x01 && Dial1 <= 0x07) Dial1 = 0x02; - - if (Dial2 >= 0xfc || (Dial2 >= 0x01 && Dial2 <= 0x04)) Dial2 = 0; - if (Dial2 >= 0xf8) Dial2 = 0xfd; - if (Dial2 >= 0x01 && Dial2 <= 0x07) Dial2 = 0x02; - - Delta = (MoonwarPortSelect ? Dial1 : Dial2); - Sign = (Delta & 0x80) >> 3; - Delta &= 0x0f; - - return (Input0 & 0xe0) | Delta | Sign; -} - -static void MoonwarPortSelectWrite(UINT8 d) -{ - MoonwarPortSelect = d & 0x10; -} - -static INT32 MoonwarInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScobra; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = MoonwarDrawBullets; - - KonamiPPIInit(); - - PPI0PortReadA = MoonwarPPIReadIN0; - PPI0PortWriteC = MoonwarPortSelectWrite; - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static void StratgyxPostLoad() -{ - MapTazmani2(); - - ZetOpen(0); - ZetSetWriteHandler(StratgyxZ80Write); - ZetMapArea(0x9400, 0x97ff, 0, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 1, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 2, GalVideoRam); - ZetClose(); -} - -static INT32 StratgyxInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = StratgyxPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalCalcPaletteFunction = StratgyxCalcPalette; - GalRenderBackgroundFunction = StratgyxDrawBackground; - - KonamiPPIInit(); - - return nRet; -} - -static void DarkplntPostLoad() -{ - MapTazmani2(); - - ZetOpen(0); - ZetSetWriteHandler(DarkplntZ80Write); - ZetClose(); -} - -static INT16 DarkplntDial = 0; -static UINT32 DarkplntDialFrameNumberRead = 0; - -static UINT8 DarkplntPPIReadIN1() -{ - UINT32 CurrentFrame = GetCurrentFrame(); - - if (DarkplntDialFrameNumberRead != CurrentFrame) { - if (GalInputPort3[0]) DarkplntDial -= 0x01; - if (GalInputPort3[1]) DarkplntDial += 0x01; - if (DarkplntDial > 0xfc) DarkplntDial = 0x00; - if (DarkplntDial < 0) DarkplntDial = 0xfc; - DarkplntDialFrameNumberRead = CurrentFrame; - } - - static const UINT8 remap[] = {0x03, 0x02, 0x00, 0x01, 0x21, 0x20, 0x22, 0x23, 0x33, 0x32, 0x30, 0x31, 0x11, 0x10, 0x12, 0x13, 0x17, 0x16, 0x14, 0x15, 0x35, 0x34, 0x36, 0x37, 0x3f, 0x3e, 0x3c, 0x3d, 0x1d, 0x1c, 0x1e, 0x1f, 0x1b, 0x1a, 0x18, 0x19, 0x39, 0x38, 0x3a, 0x3b, 0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b, 0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f, 0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 }; - - return 0xff - GalInput[1] - GalDip[1] - remap[DarkplntDial >> 2]; -} - -static INT32 DarkplntInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = DarkplntPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalCalcPaletteFunction = DarkplntCalcPalette; - GalDrawBulletsFunction = DarkplntDrawBullets; - - KonamiPPIInit(); - PPI0PortReadB = DarkplntPPIReadIN1; - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static INT32 RescueInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScobra; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - UINT8* TempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - nRet = BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x0800, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - memcpy(TempRom, GalTempRom, GalTilesSharedRomSize); - for (UINT32 Offset = 0; Offset < GalTilesSharedRomSize; Offset++) { - UINT32 j = Offset & 0xa7f; - j |= (BIT(Offset, 3) ^ BIT(Offset, 10)) << 7; - j |= (BIT(Offset, 1) ^ BIT(Offset, 7)) << 8; - j |= (BIT(Offset, 0) ^ BIT(Offset, 8)) << 10; - GalTempRom[Offset] = TempRom[j]; - } - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(TempRom); - BurnFree(GalTempRom); - - GalCalcPaletteFunction = RescueCalcPalette; - GalRenderBackgroundFunction = RescueDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static INT32 MinefldInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapScobra; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - UINT8* TempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - nRet = BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x0800, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - memcpy(TempRom, GalTempRom, GalTilesSharedRomSize); - for (UINT32 Offset = 0; Offset < GalTilesSharedRomSize; Offset++) { - UINT32 j = Offset & 0xd5f; - j |= (BIT(Offset, 3) ^ BIT(Offset, 7)) << 5; - j |= (BIT(Offset, 2) ^ BIT(Offset, 9) ^ (BIT(Offset, 0) & BIT(Offset, 5)) ^ (BIT(Offset, 3) & BIT(Offset, 7) & (BIT(Offset, 0) ^ BIT(Offset, 5)))) << 7; - j |= (BIT(Offset, 0) ^ BIT(Offset, 5) ^ (BIT(Offset, 3) & BIT(Offset, 7))) << 9; - GalTempRom[Offset] = TempRom[j]; - } - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(TempRom); - BurnFree(GalTempRom); - - GalCalcPaletteFunction = MinefldCalcPalette; - GalRenderBackgroundFunction = MinefldDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static void HustlerPostLoad() -{ - MapScobra(); - - ZetOpen(0); - ZetSetReadHandler(HustlerZ80Read); - ZetSetWriteHandler(HustlerZ80Write); - ZetClose(); - - for (UINT32 Offset = 0; Offset < GalZ80Rom1Size; Offset++) { - UINT8 XorMask; - INT32 Bits[8]; - - for (UINT32 i = 0; i < 8; i++) Bits[i] = (Offset >> i) & 1; - - XorMask = 0xff; - if (Bits[0] ^ Bits[1]) XorMask ^= 0x01; - if (Bits[3] ^ Bits[6]) XorMask ^= 0x02; - if (Bits[4] ^ Bits[5]) XorMask ^= 0x04; - if (Bits[0] ^ Bits[2]) XorMask ^= 0x08; - if (Bits[2] ^ Bits[3]) XorMask ^= 0x10; - if (Bits[1] ^ Bits[5]) XorMask ^= 0x20; - if (Bits[0] ^ Bits[7]) XorMask ^= 0x40; - if (Bits[4] ^ Bits[6]) XorMask ^= 0x80; - - GalZ80Rom1[Offset] ^= XorMask; - } -} - -static INT32 HustlerInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = HustlerPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910; - - nRet = GalInit(); if (nRet) return 1; - FroggerSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void BilliardPostLoad() -{ - MapScobra(); - - ZetOpen(0); - ZetSetReadHandler(HustlerZ80Read); - ZetSetWriteHandler(HustlerZ80Write); - ZetClose(); - - for (UINT32 Offset = 0; Offset < GalZ80Rom1Size; Offset++) { - UINT8 XorMask; - INT32 Bits[8]; - - for (UINT32 i = 0; i < 8; i++) Bits[i] = (Offset >> i) & 1; - - XorMask = 0x55; - if (Bits[2] ^ ( Bits[3] & Bits[6])) XorMask ^= 0x01; - if (Bits[4] ^ ( Bits[5] & Bits[7])) XorMask ^= 0x02; - if (Bits[0] ^ ( Bits[7] & !Bits[3])) XorMask ^= 0x04; - if (Bits[3] ^ ((!Bits[0]) & Bits[2])) XorMask ^= 0x08; - if (Bits[5] ^ ((!Bits[4]) & Bits[1])) XorMask ^= 0x10; - if (Bits[6] ^ ((!Bits[2]) & !Bits[5])) XorMask ^= 0x20; - if (Bits[1] ^ ((!Bits[6]) & !Bits[4])) XorMask ^= 0x40; - if (Bits[7] ^ ((!Bits[1]) & Bits[0])) XorMask ^= 0x80; - - GalZ80Rom1[Offset] ^= XorMask; - GalZ80Rom1[Offset] = BITSWAP08(GalZ80Rom1[Offset], 6, 1, 2, 5, 4, 3, 0, 7); - } -} - -static INT32 BilliardInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = BilliardPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910; - - nRet = GalInit(); if (nRet) return 1; - FroggerSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void HustlerbPostLoad() -{ - MapScobra(); - - ZetOpen(0); - ZetSetReadHandler(HustlerbZ80Read); - ZetSetWriteHandler(HustlerbZ80Write); - ZetClose(); - - FroggerSoundNoEncryptionInit(); - ZetOpen(1); - ZetSetInHandler(HustlerbSoundZ80PortRead); - ZetSetOutHandler(HustlerbSoundZ80PortWrite); - ZetMapArea(0x8000, 0x83ff, 0, GalZ80Ram2); - ZetMapArea(0x8000, 0x83ff, 1, GalZ80Ram2); - ZetMapArea(0x8000, 0x83ff, 2, GalZ80Ram2); - ZetClose(); -} - -static INT32 HustlerbInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = HustlerbPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910; - - nRet = GalInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - - GalSpriteClipStart = 7; - GalSpriteClipEnd = 246; - - return nRet; -} - -static void MapMimonkey() -{ - MapScobra(); - - ZetOpen(0); - ZetSetWriteHandler(MimonkeyZ80Write); - ZetMemCallback(0x4000, 0x7fff, 0); - ZetMemCallback(0x4000, 0x7fff, 2); - ZetMapArea(0xc000, 0xffff, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0xc000, 0xffff, 2, GalZ80Rom1 + 0x4000); - ZetClose(); -} - -static void MimonkeyPostLoad() -{ - static const UINT8 XorTable[16][16] = { - { 0x03, 0x03, 0x05, 0x07, 0x85, 0x00, 0x85, 0x85, 0x80, 0x80, 0x06, 0x03, 0x03, 0x00, 0x00, 0x81 }, - { 0x83, 0x87, 0x03, 0x87, 0x06, 0x00, 0x06, 0x04, 0x02, 0x00, 0x84, 0x84, 0x04, 0x00, 0x01, 0x83 }, - { 0x82, 0x82, 0x84, 0x02, 0x04, 0x00, 0x00, 0x03, 0x82, 0x00, 0x06, 0x80, 0x03, 0x00, 0x81, 0x07 }, - { 0x06, 0x06, 0x82, 0x81, 0x85, 0x00, 0x04, 0x07, 0x81, 0x05, 0x04, 0x00, 0x03, 0x00, 0x82, 0x84 }, - { 0x07, 0x07, 0x80, 0x07, 0x07, 0x00, 0x85, 0x86, 0x00, 0x07, 0x06, 0x04, 0x85, 0x00, 0x86, 0x85 }, - { 0x81, 0x83, 0x02, 0x02, 0x87, 0x00, 0x86, 0x03, 0x04, 0x06, 0x80, 0x05, 0x87, 0x00, 0x81, 0x81 }, - { 0x01, 0x01, 0x00, 0x07, 0x07, 0x00, 0x01, 0x01, 0x07, 0x07, 0x06, 0x00, 0x06, 0x00, 0x07, 0x07 }, - { 0x80, 0x87, 0x81, 0x87, 0x83, 0x00, 0x84, 0x01, 0x01, 0x86, 0x86, 0x80, 0x86, 0x00, 0x86, 0x86 }, - { 0x03, 0x03, 0x05, 0x07, 0x85, 0x00, 0x85, 0x85, 0x80, 0x80, 0x06, 0x03, 0x03, 0x00, 0x00, 0x81 }, - { 0x83, 0x87, 0x03, 0x87, 0x06, 0x00, 0x06, 0x04, 0x02, 0x00, 0x84, 0x84, 0x04, 0x00, 0x01, 0x83 }, - { 0x82, 0x82, 0x84, 0x02, 0x04, 0x00, 0x00, 0x03, 0x82, 0x00, 0x06, 0x80, 0x03, 0x00, 0x81, 0x07 }, - { 0x06, 0x06, 0x82, 0x81, 0x85, 0x00, 0x04, 0x07, 0x81, 0x05, 0x04, 0x00, 0x03, 0x00, 0x82, 0x84 }, - { 0x07, 0x07, 0x80, 0x07, 0x07, 0x00, 0x85, 0x86, 0x00, 0x07, 0x06, 0x04, 0x85, 0x00, 0x86, 0x85 }, - { 0x81, 0x83, 0x02, 0x02, 0x87, 0x00, 0x86, 0x03, 0x04, 0x06, 0x80, 0x05, 0x87, 0x00, 0x81, 0x81 }, - { 0x01, 0x01, 0x00, 0x07, 0x07, 0x00, 0x01, 0x01, 0x07, 0x07, 0x06, 0x00, 0x06, 0x00, 0x07, 0x07 }, - { 0x80, 0x87, 0x81, 0x87, 0x83, 0x00, 0x84, 0x01, 0x01, 0x86, 0x86, 0x80, 0x86, 0x00, 0x86, 0x86 } - }; - - INT32 Ctr = 0, Line, Col; - - for (INT32 Offset = 0; Offset < 0x4000; Offset++) { - Line = (Ctr & 0x07) | ((Ctr & 0x200) >> 6); - Col = ((GalZ80Rom1[Offset] & 0x80) >> 4) | (GalZ80Rom1[Offset] & 0x07); - GalZ80Rom1[Offset] = GalZ80Rom1[Offset] ^ XorTable[Line][Col]; - Ctr++; - } - - MapMimonkey(); -} - -static INT32 MimonkeyInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MimonkeyPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = MimonkeyExtendTileInfo; - GalExtendSpriteInfoFunction = MimonkeyExtendSpriteInfo; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -static INT32 MimonscoInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = MapMimonkey; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910; - - nRet = GalInit(); if (nRet) return 1; - KonamiSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = MimonkeyExtendTileInfo; - GalExtendSpriteInfoFunction = MimonkeyExtendSpriteInfo; - - KonamiPPIInit(); - - filter_rc_set_src_gain(0, 0.20); - filter_rc_set_src_gain(1, 0.20); - filter_rc_set_src_gain(2, 0.20); - filter_rc_set_src_gain(3, 0.20); - filter_rc_set_src_gain(4, 0.20); - filter_rc_set_src_gain(5, 0.20); - - return nRet; -} - -struct BurnDriver BurnDrvScobra = { - "scobra", NULL, NULL, NULL, "1981", - "Super Cobra\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScobraRomInfo, ScobraRomName, NULL, NULL, SfxInputInfo, ScobraDIPInfo, - ScobraInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScobras = { - "scobras", "scobra", NULL, NULL, "1981", - "Super Cobra (Stern)\0", NULL, "Konami (Stern license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScobrasRomInfo, ScobrasRomName, NULL, NULL, SfxInputInfo, ScobrasDIPInfo, - ScobraInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScobrase = { - "scobrase", "scobra", NULL, NULL, "1981", - "Super Cobra (Sega)\0", NULL, "Konami (Sega license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScobraseRomInfo, ScobraseRomName, NULL, NULL, SfxInputInfo, ScobrasDIPInfo, - ScobraInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScobrab = { - "scobrab", "scobra", NULL, NULL, "1981", - "Super Cobra (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScobrabRomInfo, ScobrabRomName, NULL, NULL, SfxInputInfo, ScobrasDIPInfo, - ScobraInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvScobrae = { - "scobrae", "scobra", NULL, NULL, "1981", - "Super Cobra (Stern) (encrypted, KONATEC XC-103SS CPU)\0", NULL, "Konami (Stern license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, ScobraeRomInfo, ScobraeRomName, NULL, NULL, SfxInputInfo, ScobrasDIPInfo, - ScobraeInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSuprheli = { - "suprheli", "scobra", NULL, NULL, "1981", - "Super Heli (Super Cobra bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, SuprheliRomInfo, SuprheliRomName, NULL, NULL, SfxInputInfo, ScobrasDIPInfo, - ScobraInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvLosttomb = { - "losttomb", NULL, NULL, NULL, "1982", - "Lost Tomb (Easy)\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, LosttombRomInfo, LosttombRomName, NULL, NULL, LosttombInputInfo, LosttombDIPInfo, - LosttombInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvLosttombh = { - "losttombh", "losttomb", NULL, NULL, "1982", - "Lost Tomb (Hard)\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, LosttombhRomInfo, LosttombhRomName, NULL, NULL, LosttombInputInfo, LosttombDIPInfo, - LosttombInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvArmorcar = { - "armorcar", NULL, NULL, NULL, "1981", - "Armored Car (set 1)\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, ArmorcarRomInfo, ArmorcarRomName, NULL, NULL, AtlantisInputInfo, ArmorcarDIPInfo, - ScobraInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvArmorcar2 = { - "armorcar2", "armorcar", NULL, NULL, "1981", - "Armored Car (set 2)\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, Armorcar2RomInfo, Armorcar2RomName, NULL, NULL, AtlantisInputInfo, ArmorcarDIPInfo, - ScobraInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTazmania = { - "tazmania", NULL, NULL, NULL, "1982", - "Tazz-Mania (set 1)\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, TazmaniaRomInfo, TazmaniaRomName, NULL, NULL, TazmaniaInputInfo, ArmorcarDIPInfo, - ScobraInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTazmani2 = { - "tazmani2", "tazmania", NULL, NULL, "1982", - "Tazz-Mania (set 2)\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, Tazmani2RomInfo, Tazmani2RomName, NULL, NULL, TazmaniaInputInfo, ArmorcarDIPInfo, - Tazmani2Init, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAnteater = { - "anteater", NULL, NULL, NULL, "1982", - "Anteater\0", NULL, "Stern (Tago license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, AnteaterRomInfo, AnteaterRomName, NULL, NULL, AnteaterInputInfo, AnteaterDIPInfo, - AnteaterInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAnteaterg = { - "anteaterg", "anteater", NULL, NULL, "1983", - "Ameisenbaer (German)\0", NULL, "TV-Tuning (F.E.G. license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, AnteatergRomInfo, AnteatergRomName, NULL, NULL, AnteatergInputInfo, AnteatergDIPInfo, - AnteatergInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAnteateruk = { - "anteateruk", "anteater", NULL, NULL, "1983", - "The Anteater (UK)\0", NULL, "Free Enterprise Games", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, AnteaterukRomInfo, AnteaterukRomName, NULL, NULL, AnteaterukInputInfo, AnteaterukDIPInfo, - AnteaterukInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSpdcoin = { - "spdcoin", NULL, NULL, NULL, "1984", - "Speed Coin (prototype)\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_PROTOTYPE, 2, HARDWARE_GALAXIAN, GBF_MISC, 0, - NULL, SpdcoinRomInfo, SpdcoinRomName, NULL, NULL, SpdcoinInputInfo, SpdcoinDIPInfo, - ScobraInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSuperbon = { - "superbon", NULL, NULL, NULL, "1985", - "Agent Super Bond (scobra hardware)\0", "Bad Colours", "Signaton USA", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, SuperbonRomInfo, SuperbonRomName, NULL, NULL, SuperbonInputInfo, SuperbonDIPInfo, - SuperbonInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCalipso = { - "calipso", NULL, NULL, NULL, "1982", - "Calipso\0", NULL, "Stern (Tago license)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_MAZE, 0, - NULL, CalipsoRomInfo, CalipsoRomName, NULL, NULL, CalipsoInputInfo, CalipsoDIPInfo, - CalipsoInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMoonwar = { - "moonwar", NULL, NULL, NULL, "1981", - "Moonwar\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SHOOT, 0, - NULL, MoonwarRomInfo, MoonwarRomName, NULL, NULL, MoonwarInputInfo, MoonwarDIPInfo, - MoonwarInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMoonwara = { - "moonwara", "moonwar", NULL, NULL, "1981", - "Moonwar (older)\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SHOOT, 0, - NULL, MoonwaraRomInfo, MoonwaraRomName, NULL, NULL, MoonwarInputInfo, MoonwaraDIPInfo, - MoonwarInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvStratgyx = { - "stratgyx", NULL, NULL, NULL, "1981", - "Strategy X\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, StratgyxRomInfo, StratgyxRomName, NULL, NULL, StratgyxInputInfo, StratgyxDIPInfo, - StratgyxInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvStratgys = { - "stratgys", "stratgyx", NULL, NULL, "1981", - "Strategy X (Stern)\0", NULL, "Konami (Stern License)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, StratgysRomInfo, StratgysRomName, NULL, NULL, StratgyxInputInfo, StratgyxDIPInfo, - StratgyxInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvStrongx = { - "strongx", "stratgyx", NULL, NULL, "1982", - "Strong X\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_VERSHOOT, 0, - NULL, StrongxRomInfo, StrongxRomName, NULL, NULL, StratgyxInputInfo, StratgyxDIPInfo, - StratgyxInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDarkplnt = { - "darkplnt", NULL, NULL, NULL, "1982", - "Dark Planet\0", "Dial doesn't work very well", "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SHOOT, 0, - NULL, DarkplntRomInfo, DarkplntRomName, NULL, NULL, DarkplntInputInfo, DarkplntDIPInfo, - DarkplntInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRescue = { - "rescue", NULL, NULL, NULL, "1982", - "Rescue\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, RescueRomInfo, RescueRomName, NULL, NULL, RescueInputInfo, RescueDIPInfo, - RescueInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAponow = { - "aponow", "rescue", NULL, NULL, "1982", - "Apocaljpse Now\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, AponowRomInfo, AponowRomName, NULL, NULL, RescueInputInfo, RescueDIPInfo, - RescueInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMinefld = { - "minefld", NULL, NULL, NULL, "1983", - "Minefield\0", NULL, "Stern", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, MinefldRomInfo, MinefldRomName, NULL, NULL, RescueInputInfo, MinefldDIPInfo, - MinefldInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHustler = { - "hustler", NULL, NULL, NULL, "1981", - "Video Hustler\0", NULL, "Konami", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SPORTSMISC, 0, - NULL, HustlerRomInfo, HustlerRomName, NULL, NULL, HustlerInputInfo, HustlerDIPInfo, - HustlerInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvBilliard = { - "billiard", "hustler", NULL, NULL, "1981", - "The Billiards\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SPORTSMISC, 0, - NULL, BilliardRomInfo, BilliardRomName, NULL, NULL, HustlerInputInfo, HustlerDIPInfo, - BilliardInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHustlerb = { - "hustlerb", "hustler", NULL, NULL, "1981", - "Video Hustler (bootleg)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SPORTSMISC, 0, - NULL, HustlerbRomInfo, HustlerbRomName, NULL, NULL, HustlerInputInfo, HustlerDIPInfo, - HustlerbInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMimonkey = { - "mimonkey", NULL, NULL, NULL, "198?", - "Mighty Monkey\0", NULL, "Universal Video Games", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, MimonkeyRomInfo, MimonkeyRomName, NULL, NULL, AtlantisInputInfo, MimonkeyDIPInfo, - MimonkeyInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMimonsco = { - "mimonsco", "mimonkey", NULL, NULL, "198?", - "Mighty Monkey (bootleg on Super Cobra hardware)\0", NULL, "bootleg", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, MimonscoRomInfo, MimonscoRomName, NULL, NULL, AtlantisInputInfo, MimonscoDIPInfo, - MimonscoInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// Dambusters based hardware - background can take priority over all graphics except high colour chars -static struct BurnRomInfo DambustrRomDesc[] = { - { "db11a.pr11", 0x01000, 0x427bd3fb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db9a.pr9", 0x01000, 0x57164563, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db10a.pr10", 0x01000, 0x075b9c5e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db12a.pr12", 0x01000, 0xed01a68b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db8a.pr8", 0x01000, 0xfd041ff4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db6a.pr6", 0x01000, 0x448db54b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db7a.pr7", 0x01000, 0x675b1f5e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db5a.pr5", 0x01000, 0x75659ecc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "db3a.pr3", 0x01000, 0x9e9a9710, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "db1a.pr1", 0x01000, 0x4cb964cd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "db4a.pr3", 0x01000, 0xd9d2df33, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "db2a.pr2", 0x01000, 0x0a0a6af5, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mi-7603-5.ic4", 0x00020, 0xf131f92f, BRF_GRA | GAL_ROM_PROM }, - - { "mi-7603-5.ic3", 0x00020, 0xe2a54c47, BRF_OPT }, // timing? -}; - -STD_ROM_PICK(Dambustr) -STD_ROM_FN(Dambustr) - -static struct BurnRomInfo DambustraRomDesc[] = { - { "db11.pr11", 0x01000, 0x427bd3fb, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db9a.pr9", 0x01000, 0x57164563, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db10a.pr10", 0x01000, 0x075b9c5e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db12a.pr12", 0x01000, 0xed01a68b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db8a.pr8", 0x01000, 0xfd041ff4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db6.pr6", 0x01000, 0x56d301a9, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db7a.pr7", 0x01000, 0x675b1f5e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db5a.pr5", 0x01000, 0x75659ecc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "db3a.rom", 0x01000, 0x2347e26e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "db1a.pr1", 0x01000, 0x4cb964cd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "db4a.pr3", 0x01000, 0xd9d2df33, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "db2a.pr2", 0x01000, 0x0a0a6af5, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mi-7603-5.ic4", 0x00020, 0xf131f92f, BRF_GRA | GAL_ROM_PROM }, - - { "mi-7603-5.ic3", 0x00020, 0xe2a54c47, BRF_OPT }, // timing? -}; - -STD_ROM_PICK(Dambustra) -STD_ROM_FN(Dambustra) - -static struct BurnRomInfo DambustrukRomDesc[] = { - { "db11.bin", 0x01000, 0x9e6b34fe, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db9.pr9", 0x01000, 0x57164563, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db10p.bin", 0x01000, 0xc129c57b, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db12.bin", 0x01000, 0xea4c65f5, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db8.pr8", 0x01000, 0xfd041ff4, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db6p.bin", 0x01000, 0x35dcee01, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db7.pr7", 0x01000, 0x675b1f5e, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - { "db5.pr5", 0x01000, 0x75659ecc, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "db3.pr3", 0x01000, 0x9e9a9710, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "db1ap.pr1", 0x01000, 0x4cb964cd, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "db4.pr3", 0x01000, 0xd9d2df33, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "db2.pr2", 0x01000, 0x0a0a6af5, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "mi-7603-5.ic4", 0x00020, 0xf131f92f, BRF_GRA | GAL_ROM_PROM }, - - { "mi-7603-5.ic3", 0x00020, 0xe2a54c47, BRF_OPT }, // timing? -}; - -STD_ROM_PICK(Dambustruk) -STD_ROM_FN(Dambustruk) - -UINT8 __fastcall DambustrZ80Read(UINT16 a) -{ - if (a >= 0xd900 && a <= 0xdbff) { - // ??? - return 0xff; - } - - switch (a) { - case 0xe000: { - return GalInput[0] | GalDip[0]; - } - - case 0xe800: { - return GalInput[1] | GalDip[1]; - } - - case 0xf000: { - return GalInput[2] | GalDip[2]; - } - - case 0xf800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall DambustrZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0xd800 && a <= 0xd8ff) { - INT32 Offset = a - 0xd800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0xd900 && a <= 0xdbff) { - // ??? - return; - } - - switch (a) { - case 0x8000: { - DambustrBgColour1 = (BIT(d, 2) << 2) | (BIT(d, 1) << 1) | BIT(d, 0); - DambustrBgColour2 = (BIT(d, 6) << 2) | (BIT(d, 5) << 1) | BIT(d, 4); - DambustrBgPriority = BIT(d, 3); - GalGfxBank[0] = BIT(d, 7); - return; - } - - case 0x8001: { - DambustrBgSplitLine = d; - return; - } - - case 0xe002: - case 0xe003: { - // coin_count_0_w - return; - } - - case 0xe004: - case 0xe005: - case 0xe006: - case 0xe007: { - GalaxianLfoFreqWrite(a - 0xe004, d); - return; - } - - case 0xe800: - case 0xe801: - case 0xe802: - case 0xe803: - case 0xe804: - case 0xe805: - case 0xe806: - case 0xe807: { - GalaxianSoundWrite(a - 0xe800, d); - return; - } - - case 0xf001: { - GalIrqFire = d & 1; - return; - } - - case 0xf004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xf006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xf007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xf800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall DambustrZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall DambustrZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static void DambustrPostLoad() -{ - UINT8 Temp; - - GalTempRom = (UINT8*)BurnMalloc(0x4000); - memcpy(GalTempRom, GalZ80Rom1, 0x4000); - for (INT32 i = 0; i < 0x4000; i++) { - GalZ80Rom1[i] = GalTempRom[BITSWAP16(i, 15, 14, 13, 12, 4, 10, 9, 8, 7, 6, 5, 3, 11, 2, 1, 0)]; - } - BurnFree(GalTempRom); - - for (INT32 i = 0; i < 0x1000; i++) { - Temp = GalZ80Rom1[0x5000 + i]; - GalZ80Rom1[0x5000 + i] = GalZ80Rom1[0x6000 + i]; - GalZ80Rom1[0x6000 + i] = GalZ80Rom1[0x1000 + i]; - GalZ80Rom1[0x1000 + i] = Temp; - } - - for (INT32 i = 0; i < 0x1000; i++) { - GalZ80Rom1[0x1000 + i] = BITSWAP08(GalZ80Rom1[0x1000 + i], 7, 6, 5, 1, 3, 2, 4, 0); - GalZ80Rom1[0x4000 + i] = BITSWAP08(GalZ80Rom1[0x4000 + i], 7, 6, 5, 1, 3, 2, 4, 0); - GalZ80Rom1[0x5000 + i] = BITSWAP08(GalZ80Rom1[0x5000 + i], 7, 6, 5, 1, 3, 2, 4, 0); - } - - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(DambustrZ80Read); - ZetSetWriteHandler(DambustrZ80Write); - ZetSetInHandler(DambustrZ80PortRead); - ZetSetOutHandler(DambustrZ80PortWrite); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x8000) ? 0x7fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x8000) ? 0x7fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0xc000, 0xc7ff, 0, GalZ80Ram1); - ZetMapArea(0xc000, 0xc7ff, 1, GalZ80Ram1); - ZetMapArea(0xc000, 0xc7ff, 2, GalZ80Ram1); - ZetMapArea(0xd000, 0xd3ff, 0, GalVideoRam); - ZetMapArea(0xd000, 0xd3ff, 1, GalVideoRam); - ZetMapArea(0xd000, 0xd3ff, 2, GalVideoRam); - ZetMapArea(0xd400, 0xd7ff, 0, GalVideoRam); - ZetMapArea(0xd400, 0xd7ff, 1, GalVideoRam); - ZetMapArea(0xd400, 0xd7ff, 2, GalVideoRam); - ZetMapArea(0xd800, 0xd8ff, 0, GalSpriteRam); - ZetMapArea(0xd800, 0xd8ff, 2, GalSpriteRam); - ZetClose(); -} - -static INT32 DambustrInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = DambustrPostLoad; - - nRet = GalInit(); if (nRet) return 1; - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - UINT8 Temp[16]; - nRet = BurnLoadRom(GalTempRom + 0x0000, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x1000, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x2000, GAL_ROM_OFFSET_TILES_SHARED + 2, 1); if (nRet) return 1; - nRet = BurnLoadRom(GalTempRom + 0x3000, GAL_ROM_OFFSET_TILES_SHARED + 3, 1); if (nRet) return 1; - for (UINT32 i = 0; i < GalTilesSharedRomSize; i += 16) { - UINT32 j; - - for (j = 0; j < 16; j++) { - Temp[j] = GalTempRom[i + j]; - } - - for (j = 0; j < 8; j++) { - GalTempRom[i + j + 0] = Temp[(j * 2) + 0]; - GalTempRom[i + j + 8] = Temp[(j * 2) + 1]; - } - } - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - - GalCalcPaletteFunction = DambustrCalcPalette; - GalRenderBackgroundFunction = DambustrDrawBackground; - GalDrawBulletsFunction = DambustrDrawBullets; - GalExtendTileInfoFunction = DambustrExtendTileInfo; - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - GalRenderFrameFunction = DambustrRenderFrame; - - GalSpriteClipStart = 0; - GalSpriteClipEnd = 255; - - GalVideoRam2 = (UINT8*)BurnMalloc(0x400); - - return nRet; -} - -struct BurnDriver BurnDrvDambustr = { - "dambustr", NULL, NULL, NULL, "1981", - "Dambusters (US, set 1)\0", NULL, "South West Research", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, DambustrRomInfo, DambustrRomName, NULL, NULL, DambustrInputInfo, DambustrDIPInfo, - DambustrInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDambustra = { - "dambustra", "dambustr", NULL, NULL, "1981", - "Dambusters (US, set 2)\0", NULL, "South West Research", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, DambustraRomInfo, DambustraRomName, NULL, NULL, DambustrInputInfo, DambustrDIPInfo, - DambustrInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDambustruk = { - "dambustruk", "dambustr", NULL, NULL, "1981", - "Dambusters (UK)\0", NULL, "South West Research", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_GALAXIAN, GBF_HORSHOOT, 0, - NULL, DambustrukRomInfo, DambustrukRomName, NULL, NULL, DambustrInputInfo, DambustrDIPInfo, - DambustrInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -// S2650 Based Games -static struct BurnRomInfo HunchbkgRomDesc[] = { - { "gal_hb_kl", 0x00800, 0x3977650e, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "gal_hb_hj", 0x00800, 0xdb489c3d, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "gal_hb_cp", 0x00020, 0xcbff6762, BRF_GRA | GAL_ROM_PROM }, - - { "gal_hb_1", 0x00800, 0x46590e9b, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "gal_hb_2", 0x00800, 0x4e6e671c, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "gal_hb_3", 0x00800, 0xd29dc242, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "gal_hb_4", 0x00800, 0xd409d292, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "gal_hb_5", 0x00800, 0x29d3a8c4, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "gal_hb_6", 0x00800, 0xb016fd15, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "gal_hb_7", 0x00800, 0xd2731d27, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "gal_hb_8", 0x00800, 0xe4b1a666, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, -}; - -STD_ROM_PICK(Hunchbkg) -STD_ROM_FN(Hunchbkg) - -static struct BurnRomInfo DrivfrcgRomDesc[] = { - { "dfgj2.bin", 0x01000, 0x8e19f1e7, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "dfgj1.bin", 0x01000, 0x86b60ca8, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "dfgl2.bin", 0x01000, 0xea5e9959, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "dfgl1.bin", 0x01000, 0xb7ed195c, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "top.clr", 0x00020, 0x3110ddae, BRF_GRA | GAL_ROM_PROM }, - { "bot.clr", 0x00020, 0x0f0782af, BRF_GRA | GAL_ROM_PROM }, - - { "dfgp1.bin", 0x01000, 0x52d5e77d, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "dfgp2.bin", 0x01000, 0x9cf4dbce, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "dfgp3.bin", 0x01000, 0x79763f62, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "dfgp4.bin", 0x01000, 0xdd95338b, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, -}; - -STD_ROM_PICK(Drivfrcg) -STD_ROM_FN(Drivfrcg) - -static struct BurnRomInfo DrivfrctRomDesc[] = { - { "01.bin", 0x02000, 0x300a6750, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "02.bin", 0x02000, 0xf04e14c4, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "tbp18s030.02", 0x00020, 0x3110ddae, BRF_GRA | GAL_ROM_PROM }, - { "tbp18s030.01", 0x00020, 0x0f0782af, BRF_GRA | GAL_ROM_PROM }, - - { "03.bin", 0x04000, 0x9ab604cb, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - - { "tbp24s10.bin", 0x00100, 0x8c0d886d, BRF_OPT }, - { "tbp28s42.bin", 0x00200, 0x9b8f310a, BRF_OPT }, -}; - -STD_ROM_PICK(Drivfrct) -STD_ROM_FN(Drivfrct) - -static struct BurnRomInfo DrivfrcbRomDesc[] = { - { "df1.bin", 0x02000, 0x8adc3de0, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "df2.bin", 0x02000, 0x6d95ec35, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "top.clr", 0x00020, 0x3110ddae, BRF_GRA | GAL_ROM_PROM }, - { "bot.clr", 0x00020, 0x0f0782af, BRF_GRA | GAL_ROM_PROM }, - - { "dfp.bin", 0x04000, 0xb5b2981d, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, -}; - -STD_ROM_PICK(Drivfrcb) -STD_ROM_FN(Drivfrcb) - -static struct BurnRomInfo RacknrolRomDesc[] = { - { "horz_g.bin", 0x04000, 0x97069ad5, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "horz_r.bin", 0x04000, 0xff64e84b, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.bin", 0x00020, 0x737802bf, BRF_GRA | GAL_ROM_PROM }, - - { "horz_p.bin", 0x04000, 0x32ca5b43, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - - { "82s147.bin", 0x00200, 0xaace7fa5, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Racknrol) -STD_ROM_FN(Racknrol) - -static struct BurnRomInfo HexpoolRomDesc[] = { - { "vert_g.bin", 0x04000, 0x7e257e80, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "vert_r.bin", 0x04000, 0xc5f0851e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.bin", 0x00020, 0x737802bf, BRF_GRA | GAL_ROM_PROM }, - - { "vert_p.bin", 0x04000, 0xbdb078fc, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - - { "82s147.bin", 0x00200, 0xaace7fa5, BRF_OPT }, // unknown -}; - -STD_ROM_PICK(Hexpool) -STD_ROM_FN(Hexpool) - -static struct BurnRomInfo HexpoolaRomDesc[] = { - { "rom.1m", 0x04000, 0x7e257e80, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "rom.1l", 0x04000, 0xc5f0851e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "82s123.11r", 0x00020, 0xdeb2fcf4, BRF_GRA | GAL_ROM_PROM }, - - { "rom.4l", 0x04000, 0x2ca8018d, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - - { "82s147.5pr", 0x00200, 0xcf496b1e, BRF_OPT }, // unknown - - { "82s153.6pr.bin",0x000eb, 0xbc07939a, BRF_OPT }, // PLD -}; - -STD_ROM_PICK(Hexpoola) -STD_ROM_FN(Hexpoola) - -static struct BurnRomInfo HunchbksRomDesc[] = { - { "11d_snd.bin", 0x00800, 0x88226086, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "5f_hb09.bin", 0x00800, 0xdb489c3d, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "5h_hb10.bin", 0x00800, 0x3977650e, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "6e_prom.bin", 0x00020, 0x01004d3f, BRF_GRA | GAL_ROM_PROM }, - - { "2c_hb01.bin", 0x00800, 0x8bebd834, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "2e_hb02.bin", 0x00800, 0x07de4229, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "2f_hb03.bin", 0x00800, 0xb75a0dfc, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "2h_hb04.bin", 0x00800, 0xf3206264, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "2j_hb05.bin", 0x00800, 0x1bb78728, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "2l_hb06.bin", 0x00800, 0xf25ed680, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "2m_hb07.bin", 0x00800, 0xc72e0e17, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "2p_hb08.bin", 0x00800, 0x412087b0, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, -}; - -STD_ROM_PICK(Hunchbks) -STD_ROM_FN(Hunchbks) - -static struct BurnRomInfo HncholmsRomDesc[] = { - { "hncholym.5c", 0x00800, 0xe7758775, BRF_ESS | BRF_PRG | GAL_ROM_Z80_PROG1 }, - - { "hncholym.5f", 0x01000, 0x75ad3542, BRF_GRA | GAL_ROM_TILES_SHARED }, - { "hncholym.5h", 0x01000, 0x6fec9dd3, BRF_GRA | GAL_ROM_TILES_SHARED }, - - { "prom.6e", 0x00020, 0x4e3caeab, BRF_GRA | GAL_ROM_PROM }, - - { "hncholym.2d", 0x00800, 0xfb453f9c, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "hncholym.2e", 0x00800, 0xb1429420, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "hncholym.2f", 0x00800, 0xafc98e28, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "hncholym.2h", 0x00800, 0x6785bf17, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "hncholym.2j", 0x00800, 0x0e1e4133, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "hncholym.2l", 0x00800, 0x6e982609, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "hncholym.2m", 0x00800, 0xb9141914, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - { "hncholym.2p", 0x00800, 0xca37b55b, BRF_ESS | BRF_PRG | GAL_ROM_S2650_PROG1 }, - - { "82s147.1a", 0x00200, 0xd461a48b, BRF_OPT }, -}; - -STD_ROM_PICK(Hncholms) -STD_ROM_FN(Hncholms) - -UINT8 HunchbkgS2650Read(UINT16 Address) -{ - switch (Address) { - case 0x1500: - case 0x3500: - case 0x5500: - case 0x7500: { - return GalInput[0] | GalDip[0]; - } - - case 0x1580: - case 0x3580: - case 0x5580: - case 0x7580: { - return GalInput[1] | GalDip[1]; - } - - case 0x1600: - case 0x3600: - case 0x5600: - case 0x7600: { - return GalInput[2] | GalDip[2]; - } - - case 0x1680: - case 0x3680: - case 0x5680: - case 0x7680: { - // ??? - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Read %04x\n"), Address); - } - } - - return 0; -} - -void HunchbkgS2650Write(UINT16 Address, UINT8 Data) -{ - if ((Address >= 0x1480 && Address <= 0x14ff) || (Address >= 0x3480 && Address <= 0x34ff) || (Address >= 0x5480 && Address <= 0x54ff) || (Address >= 0x7480 && Address <= 0x74ff)) { - INT32 Offset = Address & 0x7f; - - GalSpriteRam[Offset] = Data; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = Data; - } - } - - return; - } - - switch (Address) { - case 0x1503: - case 0x3503: - case 0x5503: - case 0x7503: { - // coin_count_0_w - return; - } - - case 0x1580: - case 0x1581: - case 0x1582:{ - GalaxianSoundWrite(Address - 0x1580, Data); - return; - } - - case 0x3580: - case 0x3581: - case 0x3582:{ - GalaxianSoundWrite(Address - 0x3580, Data); - return; - } - - case 0x5580: - case 0x5581: - case 0x5582:{ - GalaxianSoundWrite(Address - 0x5580, Data); - return; - } - - case 0x7580: - case 0x7581: - case 0x7582:{ - GalaxianSoundWrite(Address - 0x7580, Data); - return; - } - - case 0x1583: - case 0x3583: - case 0x5583: - case 0x7583: { - // nop - return; - } - - case 0x1584: - case 0x1585: - case 0x1586: - case 0x1587: { - GalaxianLfoFreqWrite(Address - 0x1584, Data); - return; - } - - case 0x3584: - case 0x3585: - case 0x3586: - case 0x3587: { - GalaxianLfoFreqWrite(Address - 0x3584, Data); - return; - } - - case 0x5584: - case 0x5585: - case 0x5586: - case 0x5587: { - GalaxianLfoFreqWrite(Address - 0x5584, Data); - return; - } - - case 0x7584: - case 0x7585: - case 0x7586: - case 0x7587: { - GalaxianLfoFreqWrite(Address - 0x7584, Data); - return; - } - - case 0x1600: - case 0x3600: - case 0x5600: - case 0x7600: { - // nop - return; - } - - case 0x1601: - case 0x3601: - case 0x5601: - case 0x7601: { - // nop - return; - } - - case 0x1604: - case 0x3604: - case 0x5604: - case 0x7604: { - // nop - return; - } - - case 0x1606: - case 0x3606: - case 0x5606: - case 0x7606: { - GalFlipScreenX = Data & 1; - return; - } - - case 0x1607: - case 0x3607: - case 0x5607: - case 0x7607: { - GalFlipScreenY = Data & 1; - return; - } - - case 0x1680: - case 0x3680: - case 0x5680: - case 0x7680: { - GalPitch = Data; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Write %04x, %02x\n"), Address, Data); - } - } -} - -UINT8 HunchbkgS2650PortRead(UINT16 Port) -{ - switch (Port) { - case S2650_DATA_PORT: { - // nop - return 0; - } - - case S2650_SENSE_PORT: { - return GalVBlank ? 0x80 : 0x00; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Read %04x\n"), Port); - } - } - - return 0; -} - -void HunchbkgS2650PortWrite(UINT16 Port, UINT8 Data) -{ - switch (Port) { - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Write %04x, %02x\n"), Port, Data); - } - } -} - -UINT8 DrivfrcgS2650Read(UINT16 Address) -{ - switch (Address) { - case 0x1500: - case 0x3500: - case 0x5500: - case 0x7500: { - return GalInput[0] | GalDip[0]; - } - - case 0x1580: - case 0x3580: - case 0x5580: - case 0x7580: { - return GalInput[1] | GalDip[1]; - } - - case 0x1600: - case 0x3600: - case 0x5600: - case 0x7600: { - return GalInput[2] | GalDip[2]; - } - - case 0x1700: - case 0x3700: - case 0x5700: - case 0x7700: { - return GalInput[3] | GalDip[3]; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Read %04x\n"), Address); - } - } - - return 0; -} - -void DrivfrcgS2650Write(UINT16 Address, UINT8 Data) -{ - if ((Address >= 0x1480 && Address <= 0x14ff) || (Address >= 0x3480 && Address <= 0x34ff) || (Address >= 0x5480 && Address <= 0x54ff) || (Address >= 0x7480 && Address <= 0x74ff)) { - INT32 Offset = Address & 0x7f; - - GalSpriteRam[Offset] = Data; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = Data; - } - } - - return; - } - - switch (Address) { - case 0x1503: - case 0x3503: - case 0x5503: - case 0x7503: { - // coin_count_0_w - return; - } - - case 0x1580: - case 0x1581: - case 0x1582:{ - GalaxianSoundWrite(Address - 0x1580, Data); - return; - } - - case 0x3580: - case 0x3581: - case 0x3582:{ - GalaxianSoundWrite(Address - 0x3580, Data); - return; - } - - case 0x5580: - case 0x5581: - case 0x5582:{ - GalaxianSoundWrite(Address - 0x5580, Data); - return; - } - - case 0x7580: - case 0x7581: - case 0x7582:{ - GalaxianSoundWrite(Address - 0x7580, Data); - return; - } - - case 0x1583: - case 0x3583: - case 0x5583: - case 0x7583: { - // nop - return; - } - - case 0x1585: - case 0x3585: - case 0x5585: - case 0x7585: { - // nop - return; - } - - case 0x1586: - case 0x1587: { - GalaxianLfoFreqWrite(Address - 0x1586, Data); - return; - } - - case 0x3586: - case 0x3587: { - GalaxianLfoFreqWrite(Address - 0x3586, Data); - return; - } - - case 0x5586: - case 0x5587: { - GalaxianLfoFreqWrite(Address - 0x5586, Data); - return; - } - - case 0x7586: - case 0x7587: { - GalaxianLfoFreqWrite(Address - 0x7586, Data); - return; - } - - case 0x1600: - case 0x3600: - case 0x5600: - case 0x7600: { - GalPitch = Data; - return; - } - - case 0x1700: - case 0x1701: { - // nop - return; - } - - case 0x1704: - case 0x1705: - case 0x1706: - case 0x1707: - case 0x3704: - case 0x3705: - case 0x3706: - case 0x3707: - case 0x5704: - case 0x5705: - case 0x5706: - case 0x5707: - case 0x7704: - case 0x7705: - case 0x7706: - case 0x7707: { - INT32 Offset = Address & 0x03; - GalVol = (GalVol & ~(1 << Offset)) | ((Data & 1) << Offset); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Write %04x, %02x\n"), Address, Data); - } - } -} - -UINT8 DrivfrcgS2650PortRead(UINT16 Port) -{ - switch (Port) { - case 0x00: { - switch (s2650GetPC(0)) { - case 0x02e: - case 0x297: { - return 0x01; - } - } - bprintf(PRINT_NORMAL, _T("%x\n"), s2650GetPC(0)); - return 0x00; - } - - case S2650_SENSE_PORT: { - return GalVBlank ? 0x80 : 0x00; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Read %04x\n"), Port); - } - } - - return 0; -} - -void DrivfrcgS2650PortWrite(UINT16 Port, UINT8 Data) -{ - switch (Port) { - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Write %04x, %02x\n"), Port, Data); - } - } -} - -UINT8 RacknrolS2650Read(UINT16 Address) -{ - switch (Address) { - case 0x1500: - case 0x3500: - case 0x5500: - case 0x7500: { - return GalInput[0] | GalDip[0]; - } - - case 0x1580: - case 0x3580: - case 0x5580: - case 0x7580: { - return GalInput[1] | GalDip[1]; - } - - case 0x1600: - case 0x3600: - case 0x5600: - case 0x7600: { - return GalInput[2] | GalDip[2]; - } - - case 0x1680: - case 0x3680: - case 0x5680: - case 0x7680: { - // ??? - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Read %04x\n"), Address); - } - } - - return 0; -} - -void RacknrolS2650Write(UINT16 Address, UINT8 Data) -{ - if ((Address >= 0x1400 && Address <= 0x14ff) || (Address >= 0x3400 && Address <= 0x34ff) || (Address >= 0x5400 && Address <= 0x54ff) || (Address >= 0x7400 && Address <= 0x74ff)) { - INT32 Offset = Address & 0xff; - - GalSpriteRam[Offset] = Data; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = Data; - } - } - - return; - } - - switch (Address) { - case 0x1601: - case 0x3601: - case 0x5601: - case 0x7601: { - // nop - return; - } - - case 0x1606: - case 0x3606: - case 0x5606: - case 0x7606: { - GalFlipScreenX = Data & 1; - return; - } - - case 0x1607: - case 0x3607: - case 0x5607: - case 0x7607: { - GalFlipScreenY = Data & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Write %04x, %02x\n"), Address, Data); - } - } -} - -UINT8 RacknrolS2650PortRead(UINT16 Port) -{ - switch (Port) { - case S2650_SENSE_PORT: { - return GalVBlank ? 0x00 : 0x80; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Read %04x\n"), Port); - } - } - - return 0; -} - -void RacknrolS2650PortWrite(UINT16 Port, UINT8 Data) -{ - if (Port >= 0x0020 && Port <= 0x003f) { - GalGfxBank[Port - 0x0020] = Data; - return; - } - - switch (Port) { - case 0x001d: { - SN76496Write(0, Data); - return; - } - - case 0x001e: { - SN76496Write(1, Data); - return; - } - - case 0x001f: { - SN76496Write(2, Data); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Write %04x, %02x\n"), Port, Data); - } - } -} - -UINT8 HexpoolaS2650PortRead(UINT16 Port) -{ - switch (Port) { - case 0x0000: { - // nop - return 0; - } - - case S2650_DATA_PORT: { - switch (s2650GetPC(0)) { - case 0x22: return 0x00; - case 0x31: return 0x01; - } - return 0; - } - - case S2650_SENSE_PORT: { - return GalVBlank ? 0x00 : 0x80; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Read %04x\n"), Port); - } - } - - return 0; -} - -void HexpoolaS2650PortWrite(UINT16 Port, UINT8 Data) -{ - if (Port >= 0x0020 && Port <= 0x003f) { - GalGfxBank[Port - 0x0020] = Data; - return; - } - - switch (Port) { - case S2650_DATA_PORT: { - SN76496Write(0, Data); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Write %04x, %02x\n"), Port, Data); - } - } -} - -UINT8 HunchbksS2650Read(UINT16 Address) -{ - switch (Address) { - case 0x1210: - case 0x1211: - case 0x1212: - case 0x1213: - case 0x3210: - case 0x3211: - case 0x3212: - case 0x3213: - case 0x5210: - case 0x5211: - case 0x5212: - case 0x5213: - case 0x7210: - case 0x7211: - case 0x7212: - case 0x7213: { - return ppi8255_r(0, Address & 0x03); - } - - case 0x1500: - case 0x1501: - case 0x1502: - case 0x1503: - case 0x3500: - case 0x3501: - case 0x3502: - case 0x3503: - case 0x5500: - case 0x5501: - case 0x5502: - case 0x5503: - case 0x7500: - case 0x7501: - case 0x7502: - case 0x7503: { - return ppi8255_r(0, Address & 0x03); - } - - case 0x1680: - case 0x3680: - case 0x5680: - case 0x7680: { - // watchdog read - return 0; - } - - case 0x1780: - case 0x3780: - case 0x5780: - case 0x7780: { - // watchdog read - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Read %04x\n"), Address); - } - } - - return 0; -} - -void HunchbksS2650Write(UINT16 Address, UINT8 Data) -{ - if ((Address >= 0x1400 && Address <= 0x14ff) || (Address >= 0x3400 && Address <= 0x34ff) || (Address >= 0x5400 && Address <= 0x54ff) || (Address >= 0x7400 && Address <= 0x74ff)) { - INT32 Offset = Address & 0xff; - - GalSpriteRam[Offset] = Data; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = Data; - } - } - - return; - } - - switch (Address) { - case 0x1210: - case 0x1211: - case 0x1212: - case 0x1213: - case 0x3210: - case 0x3211: - case 0x3212: - case 0x3213: - case 0x5210: - case 0x5211: - case 0x5212: - case 0x5213: - case 0x7210: - case 0x7211: - case 0x7212: - case 0x7213: { - ppi8255_w(1, Address & 0x03, Data); - return; - } - - case 0x1500: - case 0x1501: - case 0x1502: - case 0x1503: - case 0x3500: - case 0x3501: - case 0x3502: - case 0x3503: - case 0x5500: - case 0x5501: - case 0x5502: - case 0x5503: - case 0x7500: - case 0x7501: - case 0x7502: - case 0x7503: { - ppi8255_w(0, Address & 0x03, Data); - return; - } - - case 0x1600: - case 0x3600: - case 0x5600: - case 0x7600: { - // nop - return; - } - - case 0x1601: - case 0x3601: - case 0x5601: - case 0x7601: { - // nop - return; - } - - case 0x1606: - case 0x3606: - case 0x5606: - case 0x7606: { - GalFlipScreenX = Data & 1; - return; - } - - case 0x1607: - case 0x3607: - case 0x5607: - case 0x7607: { - GalFlipScreenY = Data & 1; - return; - } - - case 0x1700: - case 0x1701: { - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Write %04x, %02x\n"), Address, Data); - } - } -} - -UINT8 HunchbksS2650PortRead(UINT16 Port) -{ - switch (Port) { - case S2650_DATA_PORT: { - // nop - return 0; - } - - case S2650_SENSE_PORT: { - return GalVBlank ? 0x80 : 0x00; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Read %04x\n"), Port); - } - } - - return 0; -} - -void HunchbksS2650PortWrite(UINT16 Port, UINT8 Data) -{ - switch (Port) { - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Write %04x, %02x\n"), Port, Data); - } - } -} - -UINT8 HncholmsS2650PortRead(UINT16 Port) -{ - switch (Port) { - case 0x0000: { - switch (s2650GetPC(0)) { - case 0x02b: return 1; - case 0xa27: return 1; - } - return 0; - } - - case S2650_DATA_PORT: { - // nop - return 0; - } - - case S2650_SENSE_PORT: { - return GalVBlank ? 0x80 : 0x00; - } - - default: { - bprintf(PRINT_NORMAL, _T("S2650 #1 Port Read %04x\n"), Port); - } - } - - return 0; -} - -static INT32 GalS2650ReturnVector(INT32) -{ - return 0x03; -} - -static void S2650PostLoad() -{ - s2650Init(1); - s2650Open(0); - s2650MapMemory(GalS2650Rom1 + 0x0000, 0x0000, 0x0fff, MAP_ROM); - s2650MapMemory(GalSpriteRam, 0x1480, 0x14ff, MAP_READ); - s2650MapMemory(GalVideoRam, 0x1800, 0x1bff, MAP_RAM); - s2650MapMemory(GalZ80Ram1, 0x1c00, 0x1fff, MAP_RAM); - s2650MapMemory(GalS2650Rom1 + 0x1000, 0x2000, 0x2fff, MAP_ROM); - s2650MapMemory(GalSpriteRam, 0x3480, 0x34ff, MAP_READ); - s2650MapMemory(GalVideoRam, 0x3800, 0x3bff, MAP_RAM); - s2650MapMemory(GalZ80Ram1, 0x3c00, 0x3fff, MAP_RAM); - s2650MapMemory(GalS2650Rom1 + 0x2000, 0x4000, 0x4fff, MAP_ROM); - s2650MapMemory(GalSpriteRam, 0x5480, 0x54ff, MAP_READ); - s2650MapMemory(GalVideoRam, 0x5800, 0x5bff, MAP_RAM); - s2650MapMemory(GalZ80Ram1, 0x5c00, 0x5fff, MAP_RAM); - s2650MapMemory(GalS2650Rom1 + 0x3000, 0x6000, 0x6fff, MAP_ROM); - s2650MapMemory(GalSpriteRam, 0x7480, 0x74ff, MAP_READ); - s2650MapMemory(GalVideoRam, 0x7800, 0x7bff, MAP_RAM); - s2650MapMemory(GalZ80Ram1, 0x7c00, 0x7fff, MAP_RAM); - s2650SetReadHandler(HunchbkgS2650Read); - s2650SetWriteHandler(HunchbkgS2650Write); - s2650SetInHandler(HunchbkgS2650PortRead); - s2650SetOutHandler(HunchbkgS2650PortWrite); - s2650SetIrqCallback(GalS2650ReturnVector); - s2650Close(); -} - -static INT32 HunchbkgInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = S2650PostLoad; - - nRet = GalInit(); - - return nRet; -} - -static void DrivfrcgPostLoad() -{ - GalTempRom = (UINT8*)BurnMalloc(GalS2650Rom1Size); - memcpy(GalTempRom, GalS2650Rom1, GalS2650Rom1Size); - memcpy(GalS2650Rom1 + 0x1800, GalTempRom + 0x0000, 0x400); - memcpy(GalS2650Rom1 + 0x1c00, GalTempRom + 0x0400, 0x400); - memcpy(GalS2650Rom1 + 0x0000, GalTempRom + 0x0800, 0x400); - memcpy(GalS2650Rom1 + 0x0400, GalTempRom + 0x0c00, 0x400); - memcpy(GalS2650Rom1 + 0x0800, GalTempRom + 0x1000, 0x400); - memcpy(GalS2650Rom1 + 0x0c00, GalTempRom + 0x1400, 0x400); - memcpy(GalS2650Rom1 + 0x1000, GalTempRom + 0x1800, 0x400); - memcpy(GalS2650Rom1 + 0x1400, GalTempRom + 0x1c00, 0x400); - memcpy(GalS2650Rom1 + 0x3800, GalTempRom + 0x2000, 0x400); - memcpy(GalS2650Rom1 + 0x3c00, GalTempRom + 0x2400, 0x400); - memcpy(GalS2650Rom1 + 0x2000, GalTempRom + 0x2800, 0x400); - memcpy(GalS2650Rom1 + 0x2400, GalTempRom + 0x2c00, 0x400); - memcpy(GalS2650Rom1 + 0x2800, GalTempRom + 0x3000, 0x400); - memcpy(GalS2650Rom1 + 0x2c00, GalTempRom + 0x3400, 0x400); - memcpy(GalS2650Rom1 + 0x3000, GalTempRom + 0x3800, 0x400); - memcpy(GalS2650Rom1 + 0x3400, GalTempRom + 0x3c00, 0x400); - BurnFree(GalTempRom); - - S2650PostLoad(); - s2650Open(0); - s2650SetReadHandler(DrivfrcgS2650Read); - s2650SetWriteHandler(DrivfrcgS2650Write); - s2650SetInHandler(DrivfrcgS2650PortRead); - s2650SetOutHandler(DrivfrcgS2650PortWrite); - s2650Close(); -} - -static INT32 DrivfrcgInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = DrivfrcgPostLoad; - - nRet = GalInit(); - - GalCalcPaletteFunction = RockclimCalcPalette; - GalExtendTileInfoFunction = Ad2083ExtendTileInfo; - GalExtendSpriteInfoFunction = MshuttleExtendSpriteInfo; - - return nRet; -} - -static INT32 DrivfrcbInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = DrivfrcgPostLoad; - - nRet = GalInit(); - - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - UINT8 *TempRom = (UINT8*)BurnMalloc(0x2000); - nRet = BurnLoadRom(TempRom, GAL_ROM_OFFSET_TILES_SHARED + 0, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x1000, TempRom + 0x0000, 0x1000); - memcpy(GalTempRom + 0x0000, TempRom + 0x1000, 0x1000); - nRet = BurnLoadRom(TempRom, GAL_ROM_OFFSET_TILES_SHARED + 1, 1); if (nRet) return 1; - memcpy(GalTempRom + 0x3000, TempRom + 0x0000, 0x1000); - memcpy(GalTempRom + 0x2000, TempRom + 0x1000, 0x1000); - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - BurnFree(TempRom); - - GalCalcPaletteFunction = RockclimCalcPalette; - GalExtendTileInfoFunction = Ad2083ExtendTileInfo; - GalExtendSpriteInfoFunction = MshuttleExtendSpriteInfo; - - return nRet; -} - -static void RacknrolPostLoad() -{ - s2650Init(1); - s2650Open(0); - s2650MapMemory(GalS2650Rom1 + 0x0000, 0x0000, 0x0fff, MAP_ROM); - s2650MapMemory(GalSpriteRam, 0x1400, 0x14ff, MAP_READ); - s2650MapMemory(GalVideoRam, 0x1800, 0x1bff, MAP_RAM); - s2650MapMemory(GalZ80Ram1, 0x1c00, 0x1fff, MAP_RAM); - s2650MapMemory(GalS2650Rom1 + 0x1000, 0x2000, 0x2fff, MAP_ROM); - s2650MapMemory(GalSpriteRam, 0x3400, 0x34ff, MAP_READ); - s2650MapMemory(GalVideoRam, 0x3800, 0x3bff, MAP_RAM); - s2650MapMemory(GalZ80Ram1, 0x3c00, 0x3fff, MAP_RAM); - s2650MapMemory(GalS2650Rom1 + 0x2000, 0x4000, 0x4fff, MAP_ROM); - s2650MapMemory(GalSpriteRam, 0x5400, 0x54ff, MAP_READ); - s2650MapMemory(GalVideoRam, 0x5800, 0x5bff, MAP_RAM); - s2650MapMemory(GalZ80Ram1, 0x5c00, 0x5fff, MAP_RAM); - s2650MapMemory(GalS2650Rom1 + 0x3000, 0x6000, 0x6fff, MAP_ROM); - s2650MapMemory(GalSpriteRam, 0x7400, 0x74ff, MAP_READ); - s2650MapMemory(GalVideoRam, 0x7800, 0x7bff, MAP_RAM); - s2650MapMemory(GalZ80Ram1, 0x7c00, 0x7fff, MAP_RAM); - s2650SetReadHandler(RacknrolS2650Read); - s2650SetWriteHandler(RacknrolS2650Write); - s2650SetInHandler(RacknrolS2650PortRead); - s2650SetOutHandler(RacknrolS2650PortWrite); - s2650SetIrqCallback(GalS2650ReturnVector); - s2650Close(); -} - -static INT32 RacknrolInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = RacknrolPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496; - - nRet = GalInit(); - - GalExtendTileInfoFunction = RacknrolExtendTileInfo; - - return nRet; -} - -static void HexpoolaPostLoad() -{ - RacknrolPostLoad(); - - s2650Open(0); - s2650SetInHandler(HexpoolaS2650PortRead); - s2650SetOutHandler(HexpoolaS2650PortWrite); - s2650Close(); -} - -static INT32 HexpoolaInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = HexpoolaPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_HEXPOOLASN76496; - - nRet = GalInit(); - - GalExtendTileInfoFunction = RacknrolExtendTileInfo; - - return nRet; -} - -static void HunchbksPostLoad() -{ - RacknrolPostLoad(); - s2650Open(0); - s2650SetReadHandler(HunchbksS2650Read); - s2650SetWriteHandler(HunchbksS2650Write); - s2650SetInHandler(HunchbksS2650PortRead); - s2650SetOutHandler(HunchbksS2650PortWrite); - s2650Close(); - - ZetInit(0); -} - -static INT32 HunchbksInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = HunchbksPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910; - - nRet = GalInit(); if (nRet) return 1; - HunchbksSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - - KonamiPPIInit(); - PPI1PortWriteB = HunchbksSoundControlWrite; - - return nRet; -} - -static void HncholmsPostLoad() -{ - RacknrolPostLoad(); - s2650Open(0); - s2650SetReadHandler(HunchbksS2650Read); - s2650SetWriteHandler(HunchbksS2650Write); - s2650SetInHandler(HncholmsS2650PortRead); - s2650SetOutHandler(HunchbksS2650PortWrite); - s2650Close(); - - ZetInit(0); -} - -static INT32 HncholmsInit() -{ - INT32 nRet; - - GalPostLoadCallbackFunction = HncholmsPostLoad; - GalSoundType = GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910; - - nRet = GalInit(); if (nRet) return 1; - HunchbksSoundInit(); - - GalRenderBackgroundFunction = ScrambleDrawBackground; - GalDrawBulletsFunction = ScrambleDrawBullets; - GalExtendTileInfoFunction = Batman2ExtendTileInfo; - GalExtendSpriteInfoFunction = UpperExtendSpriteInfo; - - nGalCyclesTotal[0] = (18432000 / 6 / 2 / 2) / 60; - - KonamiPPIInit(); - PPI1PortWriteB = HunchbksSoundControlWrite; - - return nRet; -} - -struct BurnDriver BurnDrvHunchbkg = { - "hunchbkg", "hunchbak", NULL, NULL, "1981", - "Hunchback (Galaxian hardware)\0", NULL, "Century Electronics", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, HunchbkgRomInfo, HunchbkgRomName, NULL, NULL, HunchbkgInputInfo, HunchbkgDIPInfo, - HunchbkgInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDrivfrcg = { - "drivfrcg", "drivfrcp", NULL, NULL, "1984", - "Driving Force (Galaxian conversion)\0", NULL, "Shinkai Inc. (Magic Eletronics USA licence)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_RACING, 0, - NULL, DrivfrcgRomInfo, DrivfrcgRomName, NULL, NULL, DrivfrcgInputInfo, DrivfrcgDIPInfo, - DrivfrcgInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDrivfrct = { - "drivfrct", "drivfrcp", NULL, NULL, "1985", - "Top Racer (bootleg of Driving Force)\0", NULL, "bootleg (EMT Germany)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_RACING, 0, - NULL, DrivfrctRomInfo, DrivfrctRomName, NULL, NULL, DrivfrcgInputInfo, DrivfrcgDIPInfo, - DrivfrcbInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvDrivfrcb = { - "drivfrcb", "drivfrcp", NULL, NULL, "1985", - "Driving Force (Galaxian conversion bootleg)\0", NULL, "bootleg (Elsys Software)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_RACING, 0, - NULL, DrivfrcbRomInfo, DrivfrcbRomName, NULL, NULL, DrivfrcgInputInfo, DrivfrcgDIPInfo, - DrivfrcbInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvRacknrol = { - "racknrol", NULL, NULL, NULL, "1986", - "Rack + Roll\0", NULL, "Status (Shinkai License)", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SPORTSMISC, 0, - NULL, RacknrolRomInfo, RacknrolRomName, NULL, NULL, RacknrolInputInfo, RacknrolDIPInfo, - RacknrolInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHexpool = { - "hexpool", "racknrol", NULL, NULL, "1986", - "Hex Pool (Shinkai)\0", NULL, "Shinkai", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SPORTSMISC, 0, - NULL, HexpoolRomInfo, HexpoolRomName, NULL, NULL, RacknrolInputInfo, RacknrolDIPInfo, - RacknrolInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHexpoola = { - "hexpoola", "racknrol", NULL, NULL, "1985", - "Hex Pool (Senko)\0", NULL, "Senko", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SPORTSMISC, 0, - NULL, HexpoolaRomInfo, HexpoolaRomName, NULL, NULL, RacknrolInputInfo, RacknrolDIPInfo, - HexpoolaInit, GalExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHunchbks = { - "hunchbks", "hunchbak", NULL, NULL, "1983", - "Hunchback (Scramble hardware)\0", NULL, "Century Electronics", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_PLATFORM, 0, - NULL, HunchbksRomInfo, HunchbksRomName, NULL, NULL, HunchbksInputInfo, HunchbksDIPInfo, - HunchbksInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHncholms = { - "hncholms", "huncholy", NULL, NULL, "1984", - "Hunchback Olympic (Scramble hardware)\0", "Imperfect Sound", "Century Electronics", "Galaxian", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_GALAXIAN, GBF_SPORTSMISC, 0, - NULL, HncholmsRomInfo, HncholmsRomName, NULL, NULL, HunchbksInputInfo, HunchbksDIPInfo, - HncholmsInit, KonamiExit, GalFrame, NULL, GalScan, - NULL, 392, 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/galaxian/gal.h b/jan/src/burn/drv/galaxian/gal.h deleted file mode 100644 index 1c5d8a0b1..000000000 --- a/jan/src/burn/drv/galaxian/gal.h +++ /dev/null @@ -1,331 +0,0 @@ -#include "tiles_generic.h" -#include "z80_intf.h" -#include "dac.h" -#include "8255ppi.h" -#include "bitswap.h" -#include "s2650_intf.h" -#include "sn76496.h" -#include "flt_rc.h" - -#include "driver.h" -extern "C" { - #include "ay8910.h" -} - -// ROM types -#define GAL_ROM_Z80_PROG1 1 -#define GAL_ROM_Z80_PROG2 2 -#define GAL_ROM_Z80_PROG3 3 -#define GAL_ROM_TILES_SHARED 4 -#define GAL_ROM_TILES_CHARS 5 -#define GAL_ROM_TILES_SPRITES 6 -#define GAL_ROM_PROM 7 -#define GAL_ROM_S2650_PROG1 8 - -#define GAL_ROM_OFFSET_Z80_PROG2 GalZ80Rom1Num -#define GAL_ROM_OFFSET_Z80_PROG3 GalZ80Rom1Num + GalZ80Rom2Num -#define GAL_ROM_OFFSET_TILES_SHARED GalZ80Rom1Num + GalZ80Rom2Num + GalZ80Rom3Num -#define GAL_ROM_OFFSET_TILES_CHARS GalZ80Rom1Num + GalZ80Rom2Num + GalZ80Rom3Num + GalTilesSharedRomNum -#define GAL_ROM_OFFSET_TILES_SPRITES GalZ80Rom1Num + GalZ80Rom2Num + GalZ80Rom3Num + GalTilesSharedRomNum + GalTilesCharRomNum -#define GAL_ROM_OFFSET_PROM GalZ80Rom1Num + GalZ80Rom2Num + GalZ80Rom3Num + GalTilesSharedRomNum + GalTilesCharRomNum + GalTilesSpriteRomNum -#define GAL_ROM_OFFSET_S2650_PROG1 GalZ80Rom1Num + GalZ80Rom2Num + GalZ80Rom3Num + GalTilesSharedRomNum + GalTilesCharRomNum + GalTilesSpriteRomNum + GalPromRomNum - -// IRQ types -#define GAL_IRQ_TYPE_NMI 1 -#define GAL_IRQ_TYPE_IRQ0 2 - -// Sound hardware types -#define GAL_SOUND_HARDWARE_TYPE_GALAXIAN 1 -#define GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 2 -#define GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 3 -#define GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 4 -#define GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 5 -#define GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910 6 -#define GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC 7 -#define GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 8 -#define GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 9 -#define GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 10 -#define GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 11 -#define GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC 12 -#define GAL_SOUND_HARDWARE_TYPE_BONGOAY8910 13 -#define GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 14 -#define GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496 15 -#define GAL_SOUND_HARDWARE_TYPE_HEXPOOLASN76496 16 -#define GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 17 -#define GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910 18 - -// Palette Numbers -#define GAL_PALETTE_NUM_COLOURS_PROM 64 -#define GAL_PALETTE_NUM_COLOURS_STARS 64 -#define GAL_PALETTE_NUM_COLOURS_BULLETS 8 -#define GAL_PALETTE_NUM_COLOURS_BACKGROUND 256 -#define GAL_PALETTE_STARS_OFFSET GAL_PALETTE_NUM_COLOURS_PROM -#define GAL_PALETTE_BULLETS_OFFSET GAL_PALETTE_NUM_COLOURS_PROM + GAL_PALETTE_NUM_COLOURS_STARS -#define GAL_PALETTE_BACKGROUND_OFFSET GAL_PALETTE_NUM_COLOURS_PROM + GAL_PALETTE_NUM_COLOURS_STARS + GAL_PALETTE_NUM_COLOURS_BULLETS - -// gal_gfx.cpp -extern UINT8 GalFlipScreenX; -extern UINT8 GalFlipScreenY; -extern UINT8 *GalGfxBank; -extern UINT8 GalPaletteBank; -extern UINT8 GalSpriteClipStart; -extern UINT8 GalSpriteClipEnd; -extern UINT8 FroggerAdjust; -extern UINT8 Dingo; -extern UINT8 GalBackgroundRed; -extern UINT8 GalBackgroundGreen; -extern UINT8 GalBackgroundBlue; -extern UINT8 GalBackgroundEnable; -extern UINT8 SfxTilemap; -extern UINT8 GalOrientationFlipX; -extern UINT8 GalColourDepth; -extern UINT8 DarkplntBulletColour; -extern UINT8 DambustrBgColour1; -extern UINT8 DambustrBgColour2; -extern UINT8 DambustrBgPriority; -extern UINT8 DambustrBgSplitLine; -extern UINT8 *RockclimTiles; -extern UINT16 RockclimScrollX; -extern UINT16 RockclimScrollY; -extern INT32 CharPlaneOffsets[2]; -extern INT32 CharXOffsets[8]; -extern INT32 CharYOffsets[8]; -extern INT32 SpritePlaneOffsets[2]; -extern INT32 SpriteXOffsets[16]; -extern INT32 SpriteYOffsets[16]; - -typedef void (*GalRenderBackground)(); -extern GalRenderBackground GalRenderBackgroundFunction; -typedef void (*GalCalcPalette)(); -extern GalCalcPalette GalCalcPaletteFunction; -typedef void (*GalDrawBullet)(INT32, INT32, INT32); -extern GalDrawBullet GalDrawBulletsFunction; -typedef void (*GalExtendTileInfo)(UINT16*, INT32*, INT32, INT32); -extern GalExtendTileInfo GalExtendTileInfoFunction; -typedef void (*GalExtendSpriteInfo)(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16*, UINT8*); -extern GalExtendSpriteInfo GalExtendSpriteInfoFunction; -typedef void (*GalRenderFrame)(); -extern GalRenderFrame GalRenderFrameFunction; - -void UpperExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void UpperExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void PiscesExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void PiscesExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void Batman2ExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void GmgalaxExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void GmgalaxExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void MooncrstExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void MooncrstExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void MoonqsrExtendTileInfo(UINT16 *Code, INT32*, INT32 Attr, INT32); -void MoonqsrExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void SkybaseExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void SkybaseExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void RockclimExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void JumpbugExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void JumpbugExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void FroggerExtendTileInfo(UINT16*, INT32 *Colour, INT32, INT32); -void FroggerExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16*, UINT8 *Colour); -void CalipsoExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8 *xFlip, UINT8 *yFlip, UINT16 *Code, UINT8*); -void MshuttleExtendTileInfo(UINT16 *Code, INT32*, INT32 Attr, INT32); -void MshuttleExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void Fourin1ExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void Fourin1ExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void DkongjrmExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8 *xFlip, UINT8*, UINT16 *Code, UINT8*); -void MarinerExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32 x); -void MimonkeyExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void MimonkeyExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void DambustrExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32 x); -void Ad2083ExtendTileInfo(UINT16 *Code, INT32 *Colour, INT32 Attr, INT32); -void Ad2083ExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8 *xFlip, UINT8*, UINT16 *Code, UINT8*); -void RacknrolExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32 x); -void BagmanmcExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32); -void BagmanmcExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*); -void HardCodeGalaxianPROM(); -void HardCodeMooncrstPROM(); -void GalaxianCalcPalette(); -void RockclimCalcPalette(); -void MarinerCalcPalette(); -void StratgyxCalcPalette(); -void RescueCalcPalette(); -void MinefldCalcPalette(); -void DarkplntCalcPalette(); -void DambustrCalcPalette(); -void GalaxianDrawBackground(); -void RockclimDrawBackground(); -void JumpbugDrawBackground(); -void FroggerDrawBackground(); -void TurtlesDrawBackground(); -void ScrambleDrawBackground(); -void AnteaterDrawBackground(); -void MarinerDrawBackground(); -void StratgyxDrawBackground(); -void RescueDrawBackground(); -void MinefldDrawBackground(); -void DambustrDrawBackground(); -void GalaxianDrawBullets(INT32 Offs, INT32 x, INT32 y); -void TheendDrawBullets(INT32 Offs, INT32 x, INT32 y); -void ScrambleDrawBullets(INT32, INT32 x, INT32 y); -void MoonwarDrawBullets(INT32, INT32 x, INT32 y); -void MshuttleDrawBullets(INT32, INT32 x, INT32 y); -void DarkplntDrawBullets(INT32, INT32 x, INT32 y); -void DambustrDrawBullets(INT32 Offs, INT32 x, INT32 y); -void GalDraw(); -void DkongjrmRenderFrame(); -void DambustrRenderFrame(); -void FantastcRenderFrame(); -void TimefgtrRenderFrame(); -void ScramblerRenderFrame(); -void ZigZagRenderFrame(); - -// gal_run.cpp -extern UINT8 GalInputPort0[8]; -extern UINT8 GalInputPort1[8]; -extern UINT8 GalInputPort2[8]; -extern UINT8 GalInputPort3[8]; -extern UINT8 GalDip[7]; -extern UINT8 GalInput[4]; -extern UINT8 GalReset; -extern UINT8 GalFakeDip; -extern INT32 GalAnalogPort0; -extern INT32 GalAnalogPort1; - -extern UINT8 *GalMem; -extern UINT8 *GalMemEnd; -extern UINT8 *GalRamStart; -extern UINT8 *GalRamEnd; -extern UINT8 *GalZ80Rom1; -extern UINT8 *GalZ80Rom1Op; -extern UINT8 *GalZ80Rom2; -extern UINT8 *GalZ80Rom3; -extern UINT8 *GalS2650Rom1; -extern UINT8 *GalZ80Ram1; -extern UINT8 *GalZ80Ram2; -extern UINT8 *GalZ80Ram3; -extern UINT8 *GalVideoRam; -extern UINT8 *GalVideoRam2; -extern UINT8 *GalSpriteRam; -extern UINT8 *GalScrollVals; -extern UINT8 *GalProm; -extern UINT8 *GalChars; -extern UINT8 *GalSprites; -extern UINT8 *GalTempRom; -extern UINT32 *GalPalette; -extern UINT32 GalZ80Rom1Size; -extern UINT32 GalZ80Rom1Num; -extern UINT32 GalZ80Rom2Size; -extern UINT32 GalZ80Rom2Num; -extern UINT32 GalZ80Rom3Size; -extern UINT32 GalZ80Rom3Num; -extern UINT32 GalS2650Rom1Size; -extern UINT32 GalS2650Rom1Num; -extern UINT32 GalTilesSharedRomSize; -extern UINT32 GalTilesSharedRomNum; -extern UINT32 GalTilesCharRomSize; -extern UINT32 GalTilesCharRomNum; -extern UINT32 GalNumChars; -extern UINT32 GalTilesSpriteRomSize; -extern UINT32 GalTilesSpriteRomNum; -extern UINT32 GalNumSprites; -extern UINT32 GalPromRomSize; -extern UINT32 GalPromRomNum; - -typedef void (*GalPostLoadCallback)(); -extern GalPostLoadCallback GalPostLoadCallbackFunction; - -extern UINT8 GalIrqType; -extern UINT8 GalIrqFire; -extern INT32 nGalCyclesDone[3], nGalCyclesTotal[3]; - -extern UINT8 ZigzagAYLatch; -extern UINT8 GalSoundLatch; -extern UINT8 GalSoundLatch2; -extern UINT8 KingballSound; -extern UINT8 KonamiSoundControl; -extern UINT8 SfxSampleControl; -extern UINT8 KingballSpeechDip; -extern UINT16 ScrambleProtectionState; -extern UINT8 ScrambleProtectionResult; -extern UINT8 MoonwarPortSelect; -extern UINT8 MshuttleAY8910CS; -extern UINT8 GmgalaxSelectedGame; -extern UINT8 Fourin1Bank; -extern UINT8 GameIsGmgalax; -extern UINT8 GameIsBagmanmc; -extern UINT8 CavelonBankSwitch; -extern UINT8 GalVBlank; - -UINT8 KonamiPPIReadIN0(); -UINT8 KonamiPPIReadIN1(); -UINT8 KonamiPPIReadIN2(); -UINT8 KonamiPPIReadIN3(); -INT32 GalInit(); -void MapMooncrst(); -void MapJumpbug(); -void MapFrogger(); -void KonamiPPIInit(); -void MapTheend(); -void MapTurtles(); -void MapScobra(); -INT32 GalExit(); -INT32 KonamiExit(); -INT32 GalFrame(); -INT32 GalScan(INT32 nAction, INT32 *pnMin); - -// gal_sound.cpp -extern INT16* pFMBuffer; -extern INT16* pAY8910Buffer[9]; -extern UINT8 GalSoundType; -extern UINT8 HunchbksSoundIrqFire; -extern UINT8 GalLastPort2; -extern UINT8 GalShootEnable; -extern UINT8 GalNoiseEnable; -extern INT32 GalNoiseVolume; -extern double GalShootWavePos; -extern double GalNoiseWavePos; -extern INT32 GalPitch; -extern INT32 GalVol; -extern INT32 GalLfoVolume[3]; -extern double GalLfoFreq; -extern double GalLfoFreqFrameVar; -extern INT32 GalLfoBit[4]; - -void GalaxianSoundSetRoute(double nVolume, INT32 nRouteDir); - -void GalSoundReset(); -void GalSoundInit(); -void GalSoundExit(); -void GalSoundScan(INT32 nAction, INT32 *pnMin); -UINT8 CheckmajPortARead(UINT32); -UINT8 BongoDipSwitchRead(UINT32); -UINT8 KonamiSoundLatchRead(UINT32); -UINT8 KonamiSoundTimerRead(UINT32); -UINT8 FroggerSoundTimerRead(UINT32); -UINT8 HunchbksSoundTimerRead(UINT32); -void KonamiSoundLatchWrite(UINT8 d); -void KonamiSoundControlWrite(UINT8 d); -void HunchbksSoundControlWrite(UINT8 d); -void SfxSoundLatch2Write(UINT32, UINT32 d); -void SfxSampleControlWrite(UINT32, UINT32 d); -void FroggerSoundInit(); -void FroggerSoundNoEncryptionInit(); -void KonamiSoundInit(); -void HunchbksSoundInit(); -INT32 KingballSyncDAC(); -INT32 SfxSyncDAC(); -void GalRenderSoundSamples(INT16 *pSoundBuf, INT32 nLength); -void GalaxianSoundWrite(UINT32 Offset, UINT8 d); -void GalaxianLfoFreqWrite(UINT32 Offset, UINT8 d); -void GalaxianSoundUpdateTimers(); - -// gal_stars.cpp -extern INT32 GalStarsEnable; -extern INT32 GalStarsScrollPos; -extern INT32 GalStarsBlinkState; -extern INT32 GalBlinkTimerStartFrame; - -void GalInitStars(); -void GalaxianRenderStarLayer(); -void JumpbugRenderStarLayer(); -void ScrambleRenderStarLayer(); -void MarinerRenderStarLayer(); -void RescueRenderStarLayer(); diff --git a/jan/src/burn/drv/galaxian/gal_gfx.cpp b/jan/src/burn/drv/galaxian/gal_gfx.cpp deleted file mode 100644 index e7a84d6fa..000000000 --- a/jan/src/burn/drv/galaxian/gal_gfx.cpp +++ /dev/null @@ -1,1313 +0,0 @@ -#include "gal.h" - -GalRenderBackground GalRenderBackgroundFunction; -GalCalcPalette GalCalcPaletteFunction; -GalDrawBullet GalDrawBulletsFunction; -GalExtendTileInfo GalExtendTileInfoFunction; -GalExtendSpriteInfo GalExtendSpriteInfoFunction; -GalRenderFrame GalRenderFrameFunction; - -UINT8 GalFlipScreenX; -UINT8 GalFlipScreenY; -UINT8 *GalGfxBank; -UINT8 GalPaletteBank; -UINT8 GalSpriteClipStart; -UINT8 GalSpriteClipEnd; -UINT8 FroggerAdjust; -UINT8 GalBackgroundRed; -UINT8 GalBackgroundGreen; -UINT8 GalBackgroundBlue; -UINT8 GalBackgroundEnable; -UINT8 SfxTilemap; -UINT8 GalOrientationFlipX; -UINT8 GalColourDepth; -UINT8 DarkplntBulletColour; -UINT8 DambustrBgColour1; -UINT8 DambustrBgColour2; -UINT8 DambustrBgPriority; -UINT8 DambustrBgSplitLine; -UINT8 *RockclimTiles; -UINT16 RockclimScrollX; -UINT16 RockclimScrollY; - -// Graphics decode helpers -INT32 CharPlaneOffsets[2] = { 0, 0x4000 }; -INT32 CharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -INT32 SpritePlaneOffsets[2] = { 0, 0x4000 }; -INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71 }; -INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 128, 136, 144, 152, 160, 168, 176, 184 }; - -// Tile extend helpers -void UpperExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - *Code += 0x100; -} - -void PiscesExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - *Code |= GalGfxBank[0] << 8; -} - -void Batman2ExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - if (*Code & 0x80) *Code |= GalGfxBank[0] << 8; -} - -void GmgalaxExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - *Code |= GalGfxBank[0] << 9; -} - -void MooncrstExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - if (GalGfxBank[2] && (*Code & 0xc0) == 0x80) *Code = (*Code & 0x3f) | (GalGfxBank[0] << 6) | (GalGfxBank[1] << 7) | 0x0100; -} - -void MoonqsrExtendTileInfo(UINT16 *Code, INT32*, INT32 Attr, INT32) -{ - *Code |= (Attr & 0x20) << 3; -} - -void SkybaseExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - *Code |= GalGfxBank[2] << 8; -} - -void JumpbugExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - if ((*Code & 0xc0) == 0x80 && (GalGfxBank[2] & 0x01)) *Code += 128 + ((GalGfxBank[0] & 0x01) << 6) + ((GalGfxBank[1] & 0x01) << 7) + ((~GalGfxBank[4] & 0x01) << 8); -} - -void FroggerExtendTileInfo(UINT16*, INT32 *Colour, INT32, INT32) -{ - *Colour = ((*Colour >> 1) & 0x03) | ((*Colour << 2) & 0x04); -} - -void MshuttleExtendTileInfo(UINT16 *Code, INT32*, INT32 Attr, INT32) -{ - *Code |= (Attr & 0x30) << 4; -} - -void Fourin1ExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - *Code |= Fourin1Bank << 8; -} - -void MarinerExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32 x) -{ - UINT8 *Prom = GalProm + 0x120; - - *Code |= (Prom[x] & 0x01) << 8; -} - -void MimonkeyExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - *Code |= (GalGfxBank[0] << 8) | (GalGfxBank[1] << 9); -} - -void DambustrExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32 x) -{ - if (GalGfxBank[0] == 0) { - *Code |= 0x300; - } else { - if (x == 28) { - *Code |= 0x300; - } else { - *Code &= 0xff; - } - } -} - -void Ad2083ExtendTileInfo(UINT16 *Code, INT32 *Colour, INT32 Attr, INT32) -{ - INT32 Bank = Attr & 0x30; - *Code |= (Bank << 4); - *Colour |= ((Attr & 0x40) >> 3); -} - -void RacknrolExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32 x) -{ - UINT8 Bank = GalGfxBank[x] & 7; - *Code |= Bank << 8; -} - -void BagmanmcExtendTileInfo(UINT16 *Code, INT32*, INT32, INT32) -{ - *Code |= GalGfxBank[0] << 9; -} - -// Sprite extend helpers -void UpperExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - *Code += 0x40; -} - -void PiscesExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - *Code |= GalGfxBank[0] << 6; -} - -void GmgalaxExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - *Code |= (GalGfxBank[0] << 7) | 0x40; -} - -void MooncrstExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - if (GalGfxBank[2] && (*Code & 0x30) == 0x20) *Code = (*Code & 0x0f) | (GalGfxBank[0] << 4) | (GalGfxBank[1] << 5) | 0x40; -} - -void MoonqsrExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - *Code |= (Base[2] & 0x20) << 1; -} - -void SkybaseExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - *Code |= GalGfxBank[2] << 6; -} - -void RockclimExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - if (GalGfxBank[2]) *Code |= 0x40; -} - -void JumpbugExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - if ((*Code & 0x30) == 0x20 && (GalGfxBank[2] & 0x01) != 0) *Code += 32 + ((GalGfxBank[0] & 0x01) << 4) + ((GalGfxBank[1] & 0x01) << 5) + ((~GalGfxBank[4] & 0x01) << 6); -} - -void FroggerExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16*, UINT8 *Colour) -{ - *Colour = ((*Colour >> 1) & 0x03) | ((*Colour << 2) & 0x04); -} - -void CalipsoExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8 *xFlip, UINT8 *yFlip, UINT16 *Code, UINT8*) -{ - *Code = Base[1]; - *xFlip = 0; - *yFlip = 0; -} - -void MshuttleExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - *Code |= (Base[2] & 0x30) << 2; -} - -void Fourin1ExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - *Code |= Fourin1Bank << 6; -} - -void DkongjrmExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8 *xFlip, UINT8*, UINT16 *Code, UINT8*) -{ - *Code = (Base[1] & 0x7f) | 0x80; - *xFlip = 0; -} - -void MimonkeyExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - *Code |= (GalGfxBank[0] << 6) | (GalGfxBank[1] << 7); -} - -void Ad2083ExtendSpriteInfo(const UINT8 *Base, INT32*, INT32*, UINT8 *xFlip, UINT8*, UINT16 *Code, UINT8*) -{ - *Code = (Base[1] & 0x7f) | ((Base[2] & 0x30) << 2); - *xFlip = 0; -} - -void BagmanmcExtendSpriteInfo(const UINT8*, INT32*, INT32*, UINT8*, UINT8*, UINT16 *Code, UINT8*) -{ - *Code |= (GalGfxBank[0] << 7) | 0x40; -} - -// Hardcode a Galaxian PROM for any games that are missing a PROM dump -void HardCodeGalaxianPROM() -{ - GalProm[0x00]= 0x00; - GalProm[0x01]= 0x00; - GalProm[0x02]= 0x00; - GalProm[0x03]= 0xf6; - GalProm[0x04]= 0x00; - GalProm[0x05]= 0x16; - GalProm[0x06]= 0xc0; - GalProm[0x07]= 0x3f; - GalProm[0x08]= 0x00; - GalProm[0x09]= 0xd8; - GalProm[0x0a]= 0x07; - GalProm[0x0b]= 0x3f; - GalProm[0x0c]= 0x00; - GalProm[0x0d]= 0xc0; - GalProm[0x0e]= 0xc4; - GalProm[0x0f]= 0x07; - GalProm[0x10]= 0x00; - GalProm[0x11]= 0xc0; - GalProm[0x12]= 0xa0; - GalProm[0x13]= 0x07; - GalProm[0x14]= 0x00; - GalProm[0x15]= 0x00; - GalProm[0x16]= 0x00; - GalProm[0x17]= 0x07; - GalProm[0x18]= 0x00; - GalProm[0x19]= 0xf6; - GalProm[0x1a]= 0x07; - GalProm[0x1b]= 0xf0; - GalProm[0x1c]= 0x00; - GalProm[0x1d]= 0x76; - GalProm[0x1e]= 0x07; - GalProm[0x1f]= 0xc6; -} - -void HardCodeMooncrstPROM() -{ - GalProm[0x00]= 0x00; - GalProm[0x01]= 0x7a; - GalProm[0x02]= 0x36; - GalProm[0x03]= 0x07; - GalProm[0x04]= 0x00; - GalProm[0x05]= 0xf0; - GalProm[0x06]= 0x38; - GalProm[0x07]= 0x1f; - GalProm[0x08]= 0x00; - GalProm[0x09]= 0xc7; - GalProm[0x0a]= 0xf0; - GalProm[0x0b]= 0x3f; - GalProm[0x0c]= 0x00; - GalProm[0x0d]= 0xdb; - GalProm[0x0e]= 0xc6; - GalProm[0x0f]= 0x38; - GalProm[0x10]= 0x00; - GalProm[0x11]= 0x36; - GalProm[0x12]= 0x07; - GalProm[0x13]= 0xf0; - GalProm[0x14]= 0x00; - GalProm[0x15]= 0x33; - GalProm[0x16]= 0x3f; - GalProm[0x17]= 0xdb; - GalProm[0x18]= 0x00; - GalProm[0x19]= 0x3f; - GalProm[0x1a]= 0x57; - GalProm[0x1b]= 0xc6; - GalProm[0x1c]= 0x00; - GalProm[0x1d]= 0xc6; - GalProm[0x1e]= 0x3f; - GalProm[0x1f]= 0xff; -} - -// Pallet generation -#define RGB_MAXIMUM 224 -#define MAX_NETS 3 -#define MAX_RES_PER_NET 18 -#define Combine2Weights(tab,w0,w1) ((INT32)(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5)) -#define Combine3Weights(tab,w0,w1,w2) ((INT32)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5)) - -static double ComputeResistorWeights(INT32 MinVal, INT32 MaxVal, double Scaler, INT32 Count1, const INT32 *Resistances1, double *Weights1, INT32 PullDown1, INT32 PullUp1, INT32 Count2, const INT32 *Resistances2, double *Weights2, INT32 PullDown2, INT32 PullUp2, INT32 Count3, const INT32 *Resistances3, double *Weights3, INT32 PullDown3, INT32 PullUp3) -{ - INT32 NetworksNum; - - INT32 ResCount[MAX_NETS]; - double r[MAX_NETS][MAX_RES_PER_NET]; - double w[MAX_NETS][MAX_RES_PER_NET]; - double ws[MAX_NETS][MAX_RES_PER_NET]; - INT32 r_pd[MAX_NETS]; - INT32 r_pu[MAX_NETS]; - - double MaxOut[MAX_NETS]; - double *Out[MAX_NETS]; - - INT32 i, j, n; - double Scale; - double Max; - - NetworksNum = 0; - for (n = 0; n < MAX_NETS; n++) { - INT32 Count, pd, pu; - const INT32 *Resistances; - double *Weights; - - switch (n) { - case 0: { - Count = Count1; - Resistances = Resistances1; - Weights = Weights1; - pd = PullDown1; - pu = PullUp1; - break; - } - - case 1: { - Count = Count2; - Resistances = Resistances2; - Weights = Weights2; - pd = PullDown2; - pu = PullUp2; - break; - } - - case 2: - default: { - Count = Count3; - Resistances = Resistances3; - Weights = Weights3; - pd = PullDown3; - pu = PullUp3; - break; - } - } - - if (Count > 0) { - ResCount[NetworksNum] = Count; - for (i = 0; i < Count; i++) { - r[NetworksNum][i] = 1.0 * Resistances[i]; - } - Out[NetworksNum] = Weights; - r_pd[NetworksNum] = pd; - r_pu[NetworksNum] = pu; - NetworksNum++; - } - } - - for (i = 0; i < NetworksNum; i++) { - double R0, R1, Vout, Dst; - - for (n = 0; n < ResCount[i]; n++) { - R0 = (r_pd[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pd[i]; - R1 = (r_pu[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pu[i]; - - for (j = 0; j < ResCount[i]; j++) { - if (j == n) { - if (r[i][j] != 0.0) R1 += 1.0 / r[i][j]; - } else { - if (r[i][j] != 0.0) R0 += 1.0 / r[i][j]; - } - } - - R0 = 1.0/R0; - R1 = 1.0/R1; - Vout = (MaxVal - MinVal) * R0 / (R1 + R0) + MinVal; - - Dst = (Vout < MinVal) ? MinVal : (Vout > MaxVal) ? MaxVal : Vout; - - w[i][n] = Dst; - } - } - - j = 0; - Max = 0.0; - for (i = 0; i < NetworksNum; i++) { - double Sum = 0.0; - - for (n = 0; n < ResCount[i]; n++) Sum += w[i][n]; - - MaxOut[i] = Sum; - if (Max < Sum) { - Max = Sum; - j = i; - } - } - - if (Scaler < 0.0) { - Scale = ((double)MaxVal) / MaxOut[j]; - } else { - Scale = Scaler; - } - - for (i = 0; i < NetworksNum; i++) { - for (n = 0; n < ResCount[i]; n++) { - ws[i][n] = w[i][n] * Scale; - (Out[i])[n] = ws[i][n]; - } - } - - return Scale; - -} - -void GalaxianCalcPalette() -{ - static const INT32 RGBResistances[3] = {1000, 470, 220}; - double rWeights[3], gWeights[3], bWeights[2]; - - ComputeResistorWeights(0, RGB_MAXIMUM, -1.0, 3, &RGBResistances[0], rWeights, 470, 0, 3, &RGBResistances[0], gWeights, 470, 0, 2, &RGBResistances[1], bWeights, 470, 0); - - // Colour PROM - for (INT32 i = 0; i < 32; i++) { - UINT8 Bit0, Bit1, Bit2, r, g, b; - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],0); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],1); - Bit2 = BIT(GalProm[i + (GalPaletteBank * 0x20)],2); - r = Combine3Weights(rWeights, Bit0, Bit1, Bit2); - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],3); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],4); - Bit2 = BIT(GalProm[i + (GalPaletteBank * 0x20)],5); - g = Combine3Weights(gWeights, Bit0, Bit1, Bit2); - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],6); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],7); - b = Combine2Weights(bWeights, Bit0, Bit1); - - GalPalette[i] = BurnHighCol(r, g, b, 0); - } - - // Stars - for (INT32 i = 0; i < GAL_PALETTE_NUM_COLOURS_STARS; i++) { - INT32 Bits, r, g, b; - INT32 Map[4] = {0x00, 0x88, 0xcc, 0xff}; - - Bits = (i >> 0) & 0x03; - r = Map[Bits]; - Bits = (i >> 2) & 0x03; - g = Map[Bits]; - Bits = (i >> 4) & 0x03; - b = Map[Bits]; - - GalPalette[i + GAL_PALETTE_STARS_OFFSET] = BurnHighCol(r, g, b, 0); - } - - // Bullets - for (INT32 i = 0; i < GAL_PALETTE_NUM_COLOURS_BULLETS - 1; i++) { - GalPalette[i + GAL_PALETTE_BULLETS_OFFSET] = BurnHighCol(0xff, 0xff, 0xff, 0); - } - GalPalette[GAL_PALETTE_NUM_COLOURS_BULLETS - 1 + GAL_PALETTE_BULLETS_OFFSET] = BurnHighCol(0xff, 0xff, 0x00, 0); -} - -void RockclimCalcPalette() -{ - static const INT32 RGBResistances[3] = {1000, 470, 220}; - double rWeights[3], gWeights[3], bWeights[2]; - - ComputeResistorWeights(0, RGB_MAXIMUM, -1.0, 3, &RGBResistances[0], rWeights, 470, 0, 3, &RGBResistances[0], gWeights, 470, 0, 2, &RGBResistances[1], bWeights, 470, 0); - - // Colour PROM - for (INT32 i = 0; i < 64; i++) { - UINT8 Bit0, Bit1, Bit2, r, g, b; - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],0); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],1); - Bit2 = BIT(GalProm[i + (GalPaletteBank * 0x20)],2); - r = Combine3Weights(rWeights, Bit0, Bit1, Bit2); - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],3); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],4); - Bit2 = BIT(GalProm[i + (GalPaletteBank * 0x20)],5); - g = Combine3Weights(gWeights, Bit0, Bit1, Bit2); - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],6); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],7); - b = Combine2Weights(bWeights, Bit0, Bit1); - - GalPalette[i] = BurnHighCol(r, g, b, 0); - } - - // Stars - for (INT32 i = 0; i < GAL_PALETTE_NUM_COLOURS_STARS; i++) { - INT32 Bits, r, g, b; - INT32 Map[4] = {0x00, 0x88, 0xcc, 0xff}; - - Bits = (i >> 0) & 0x03; - r = Map[Bits]; - Bits = (i >> 2) & 0x03; - g = Map[Bits]; - Bits = (i >> 4) & 0x03; - b = Map[Bits]; - - GalPalette[i + GAL_PALETTE_STARS_OFFSET] = BurnHighCol(r, g, b, 0); - } - - // Bullets - for (INT32 i = 0; i < GAL_PALETTE_NUM_COLOURS_BULLETS - 1; i++) { - GalPalette[i + GAL_PALETTE_BULLETS_OFFSET] = BurnHighCol(0xff, 0xff, 0xff, 0); - } - GalPalette[GAL_PALETTE_NUM_COLOURS_BULLETS - 1 + GAL_PALETTE_BULLETS_OFFSET] = BurnHighCol(0xff, 0xff, 0x00, 0); -} - -void MarinerCalcPalette() -{ - GalaxianCalcPalette(); - - for (INT32 i = 0; i < 16; i++) { - INT32 b = 0x0e * BIT(i, 0) + 0x1f * BIT(i, 1) + 0x43 * BIT(i, 2) + 0x8f * BIT(i, 3); - GalPalette[i + GAL_PALETTE_BACKGROUND_OFFSET] = BurnHighCol(0, 0, b, 0); - } -} - -void StratgyxCalcPalette() -{ - GalaxianCalcPalette(); - - for (INT32 i = 0; i < 8; i++) { - INT32 r = BIT(i, 0) * 0x7c; - INT32 g = BIT(i, 1) * 0x3c; - INT32 b = BIT(i, 2) * 0x47; - GalPalette[i + GAL_PALETTE_BACKGROUND_OFFSET] = BurnHighCol(r, g, b, 0); - } -} - -void RescueCalcPalette() -{ - GalaxianCalcPalette(); - - for (INT32 i = 0; i < 128; i++) { - INT32 b = i * 2; - GalPalette[i + GAL_PALETTE_BACKGROUND_OFFSET] = BurnHighCol(0, 0, b, 0); - } -} - -void MinefldCalcPalette() -{ - RescueCalcPalette(); - - for (INT32 i = 0; i < 128; i++) { - INT32 r = (INT32)(i * 1.5); - INT32 g = (INT32)(i * 0.75); - INT32 b = i / 2; - GalPalette[i + 128 + GAL_PALETTE_BACKGROUND_OFFSET] = BurnHighCol(r, g, b, 0); - } -} - -void DarkplntCalcPalette() -{ - static const INT32 RGBResistances[3] = {1000, 470, 220}; - double rWeights[3], gWeights[3], bWeights[2]; - - ComputeResistorWeights(0, RGB_MAXIMUM, -1.0, 3, &RGBResistances[0], rWeights, 470, 0, 3, &RGBResistances[0], gWeights, 470, 0, 2, &RGBResistances[1], bWeights, 470, 0); - - // Colour PROM - for (INT32 i = 0; i < 32; i++) { - UINT8 Bit0, Bit1, Bit2, r, g, b; - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],0); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],1); - Bit2 = BIT(GalProm[i + (GalPaletteBank * 0x20)],2); - r = Combine3Weights(rWeights, Bit0, Bit1, Bit2); - - g = 0; - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],3); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],4); - Bit2 = BIT(GalProm[i + (GalPaletteBank * 0x20)],5); - b = Combine2Weights(bWeights, Bit0, Bit1); - - GalPalette[i] = BurnHighCol(r, g, b, 0); - } - - // Stars - for (INT32 i = 0; i < GAL_PALETTE_NUM_COLOURS_STARS; i++) { - INT32 Bits, r, g, b; - INT32 Map[4] = {0x00, 0x88, 0xcc, 0xff}; - - Bits = (i >> 0) & 0x03; - r = Map[Bits]; - Bits = (i >> 2) & 0x03; - g = Map[Bits]; - Bits = (i >> 4) & 0x03; - b = Map[Bits]; - - GalPalette[i + GAL_PALETTE_STARS_OFFSET] = BurnHighCol(r, g, b, 0); - } - - // Bullets - GalPalette[0 + GAL_PALETTE_BULLETS_OFFSET] = BurnHighCol(0xef, 0x00, 0x00, 0); - GalPalette[1 + GAL_PALETTE_BULLETS_OFFSET] = BurnHighCol(0x00, 0x00, 0xef, 0); -} - -void DambustrCalcPalette() -{ - static const INT32 RGBResistances[3] = {1000, 470, 220}; - double rWeights[3], gWeights[3], bWeights[2]; - - ComputeResistorWeights(0, RGB_MAXIMUM, -1.0, 3, &RGBResistances[0], rWeights, 470, 0, 3, &RGBResistances[0], gWeights, 470, 0, 2, &RGBResistances[1], bWeights, 470, 0); - - // Colour PROM - for (INT32 i = 0; i < 32; i++) { - UINT8 Bit0, Bit1, Bit2, r, g, b; - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],0); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],1); - Bit2 = BIT(GalProm[i + (GalPaletteBank * 0x20)],2); - b = Combine3Weights(rWeights, Bit0, Bit1, Bit2); - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],3); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],4); - Bit2 = BIT(GalProm[i + (GalPaletteBank * 0x20)],5); - r = Combine3Weights(gWeights, Bit0, Bit1, Bit2); - - Bit0 = BIT(GalProm[i + (GalPaletteBank * 0x20)],6); - Bit1 = BIT(GalProm[i + (GalPaletteBank * 0x20)],7); - g = Combine2Weights(bWeights, Bit0, Bit1); - - GalPalette[i] = BurnHighCol(r, g, b, 0); - } - - // Stars - for (INT32 i = 0; i < GAL_PALETTE_NUM_COLOURS_STARS; i++) { - INT32 Bits, r, g, b; - INT32 Map[4] = {0x00, 0x88, 0xcc, 0xff}; - - Bits = (i >> 0) & 0x03; - r = Map[Bits]; - Bits = (i >> 2) & 0x03; - g = Map[Bits]; - Bits = (i >> 4) & 0x03; - b = Map[Bits]; - - GalPalette[i + GAL_PALETTE_STARS_OFFSET] = BurnHighCol(r, g, b, 0); - } - - // Bullets - for (INT32 i = 0; i < GAL_PALETTE_NUM_COLOURS_BULLETS - 1; i++) { - GalPalette[i + GAL_PALETTE_BULLETS_OFFSET] = BurnHighCol(0xff, 0xff, 0xff, 0); - } - GalPalette[GAL_PALETTE_NUM_COLOURS_BULLETS - 1 + GAL_PALETTE_BULLETS_OFFSET] = BurnHighCol(0xff, 0xff, 0x00, 0); - - for (INT32 i = 0; i < 8; i++) { - INT32 r = BIT(i, 0) * 0x47; - INT32 g = BIT(i, 1) * 0x47; - INT32 b = BIT(i, 2) * 0x4f; - GalPalette[i + GAL_PALETTE_BACKGROUND_OFFSET] = BurnHighCol(r, g, b, 0); - } -} - -#undef RGB_MAXIMUM -#undef MAX_NETS -#undef MAX_RES_PER_NET -#undef Combine_2Weights -#undef Combine_3Weights - -// Background and Stars rendering -void GalaxianDrawBackground() -{ - if (GalStarsEnable) GalaxianRenderStarLayer(); -} - -void RockclimDrawBackground() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = GalVideoRam2[TileIndex]; - Colour = 0; - - x = 8 * mx; - y = 8 * my; - - x -= RockclimScrollX & 0x1ff; - y -= RockclimScrollY & 0xff; - - if (x < -8) x += 512; - if (y < -8) y += 256; - - y -= 16; - - if (x > 8 && x < (nScreenWidth - 8) && y > 8 && y < (nScreenHeight - 8)) { - Render8x8Tile(pTransDraw, Code, x, y, Colour, 4, 32, RockclimTiles); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 32, RockclimTiles); - } - - TileIndex++; - } - } -} - -void JumpbugDrawBackground() -{ - if (GalStarsEnable) JumpbugRenderStarLayer(); -} - -void FroggerDrawBackground() -{ - GalPalette[GAL_PALETTE_BACKGROUND_OFFSET] = BurnHighCol(0, 0, 0x47, 0); - - if (GalFlipScreenX) { - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = nScreenWidth - 1; x > 128 - 8; x--) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET; - } - } - } else { - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = 0; x < 128; x++) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET; - } - } - } -} - -void TurtlesDrawBackground() -{ - GalPalette[GAL_PALETTE_BACKGROUND_OFFSET] = BurnHighCol(GalBackgroundRed * 0x55, GalBackgroundGreen * 0x47, GalBackgroundBlue * 0x55, 0); - - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = 0; x < nScreenWidth; x++) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET; - } - } -} - -void ScrambleDrawBackground() -{ - GalPalette[GAL_PALETTE_BACKGROUND_OFFSET] = BurnHighCol(0, 0, 0x56, 0); - - if (GalBackgroundEnable) { - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = 0; x < nScreenWidth; x++) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET; - } - } - } - - if (GalStarsEnable) ScrambleRenderStarLayer(); -} - -void AnteaterDrawBackground() -{ - GalPalette[GAL_PALETTE_BACKGROUND_OFFSET] = BurnHighCol(0, 0, 0x56, 0); - - if (GalBackgroundEnable) { - if (GalFlipScreenX) { - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = nScreenWidth - 1; x > 256 - 56; x--) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET; - } - } - } else { - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = 0; x < 56; x++) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET; - } - } - } - } -} - -void MarinerDrawBackground() -{ - UINT8 *BgColourProm = GalProm + 0x20; - INT32 x; - - if (GalFlipScreenX) { - for (x = 0; x < 32; x++) { - INT32 Colour; - - if (x == 0) { - Colour = 0; - } else { - Colour = BgColourProm[0x20 + x - 1]; - } - - INT32 xStart = 8 * (31 - x); - for (INT32 sy = 0; sy < nScreenHeight; sy++) { - for (INT32 sx = xStart; sx < xStart + 8; sx++) { - pTransDraw[(sy * nScreenWidth) + sx] = GAL_PALETTE_BACKGROUND_OFFSET + Colour; - } - } - } - } else { - for (x = 0; x < 32; x++) { - INT32 Colour; - - if (x == 31) { - Colour = 0; - } else { - Colour = BgColourProm[x + 1]; - } - - INT32 xStart = x * 8; - for (INT32 sy = 0; sy < nScreenHeight; sy++) { - for (INT32 sx = xStart; sx < xStart + 8; sx++) { - pTransDraw[(sy * nScreenWidth) + sx] = GAL_PALETTE_BACKGROUND_OFFSET + Colour; - } - } - } - } - - if (GalStarsEnable) MarinerRenderStarLayer(); -} - -void StratgyxDrawBackground() -{ - UINT8 *BgColourProm = GalProm + 0x20; - - for (INT32 x = 0; x < 32; x++) { - INT32 xStart, Colour = 0; - - if ((~BgColourProm[x] & 0x02) && GalBackgroundRed) Colour |= 0x01; - if ((~BgColourProm[x] & 0x02) && GalBackgroundGreen) Colour |= 0x02; - if ((~BgColourProm[x] & 0x01) && GalBackgroundBlue) Colour |= 0x04; - - if (GalFlipScreenX) { - xStart = 8 * (31 - x); - } else { - xStart = 8 * x; - } - - for (INT32 sy = 0; sy < nScreenHeight; sy++) { - for (INT32 sx = xStart; sx < xStart + 8; sx++) { - pTransDraw[(sy * nScreenWidth) + sx] = GAL_PALETTE_BACKGROUND_OFFSET + Colour; - } - } - } -} - -void RescueDrawBackground() -{ - if (GalBackgroundEnable) { - INT32 x; - - for (x = 0; x < 128; x++) { - for (INT32 y = 0; y < nScreenHeight; y++) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET + x; - } - } - - for (x = 0; x < 120; x++) { - for (INT32 y = 0; y < nScreenHeight; y++) { - pTransDraw[(y * nScreenWidth) + (x + 128)] = GAL_PALETTE_BACKGROUND_OFFSET + x + 8; - } - } - - for (x = 0; x < 8; x++) { - for (INT32 y = 0; y < nScreenHeight; y++) { - pTransDraw[(y * nScreenWidth) + (x + 248)] = GAL_PALETTE_BACKGROUND_OFFSET; - } - } - } - - if (GalStarsEnable) RescueRenderStarLayer(); -} - -void MinefldDrawBackground() -{ - if (GalBackgroundEnable) { - INT32 x; - - for (x = 0; x < 128; x++) { - for (INT32 y = 0; y < nScreenHeight; y++) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET + x; - } - } - - for (x = 0; x < 120; x++) { - for (INT32 y = 0; y < nScreenHeight; y++) { - pTransDraw[(y * nScreenWidth) + (x + 128)] = GAL_PALETTE_BACKGROUND_OFFSET + x + 128; - } - } - - for (x = 0; x < 8; x++) { - for (INT32 y = 0; y < nScreenHeight; y++) { - pTransDraw[(y * nScreenWidth) + (x + 248)] = GAL_PALETTE_BACKGROUND_OFFSET; - } - } - } - - if (GalStarsEnable) RescueRenderStarLayer(); -} - -void DambustrDrawBackground() -{ - INT32 xClipStart = GalFlipScreenX ? 254 - DambustrBgSplitLine : 0; - INT32 xClipEnd = GalFlipScreenX ? 0 : 254 - DambustrBgSplitLine; - - for (INT32 x = 0; x < 256 - DambustrBgSplitLine; x++) { - if (DambustrBgPriority && (x < xClipStart || x > xClipEnd)) continue; - for (INT32 y = 0; y < nScreenHeight; y++) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET + ((GalFlipScreenX) ? DambustrBgColour2 : DambustrBgColour1); - } - } - - for (INT32 x = 255; x > 256 - DambustrBgSplitLine; x--) { - if (DambustrBgPriority && (x < xClipStart || x > xClipEnd)) continue; - for (INT32 y = 0; y < nScreenHeight; y++) { - pTransDraw[(y * nScreenWidth) + x] = GAL_PALETTE_BACKGROUND_OFFSET + ((GalFlipScreenX) ? DambustrBgColour1 : DambustrBgColour2); - } - } - - if (GalStarsEnable && !DambustrBgPriority) GalaxianRenderStarLayer(); -} - -// Char Layer rendering -static void GalRenderBgLayer(UINT8 *pVideoRam) -{ - INT32 mx, my, Attr, Colour, x, y, TileIndex = 0, RamPos; - UINT16 Code; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - RamPos = TileIndex & 0x1f; - Code = pVideoRam[TileIndex]; - Attr = GalSpriteRam[(RamPos * 2) + 1]; - Colour = Attr & ((GalColourDepth == 3) ? 0x03 : 0x07); - - if (GalExtendTileInfoFunction) GalExtendTileInfoFunction(&Code, &Colour, Attr, RamPos); - - if (SfxTilemap) { - x = 8 * my; - y = 8 * mx; - } else { - x = 8 * mx; - y = 8 * my; - } - - y -= 16; - - if (GalFlipScreenX) x = nScreenWidth - 8 - x; - if (GalFlipScreenY) y = nScreenHeight - 8 - y; - - INT32 px, py; - - UINT32 nPalette = Colour << GalColourDepth; - - for (py = 0; py < 8; py++) { - for (px = 0; px < 8; px++) { - UINT8 c = GalChars[(Code * 64) + (py * 8) + px]; - if (GalFlipScreenX) c = GalChars[(Code * 64) + (py * 8) + (7 - px)]; - if (GalFlipScreenY) c = GalChars[(Code * 64) + ((7 - py) * 8) + px]; - if (GalFlipScreenX && GalFlipScreenY) c = GalChars[(Code * 64) + ((7 - py) * 8) + (7 - px)]; - - if (c) { - INT32 xPos = x + px; - INT32 yPos = y + py; - - if (SfxTilemap) { - if (GalFlipScreenX) { - xPos += GalScrollVals[mx]; - } else { - xPos -= GalScrollVals[mx]; - } - - if (xPos < 0) xPos += 256; - if (xPos > 255) xPos -= 256; - } else { - if (GalFlipScreenY) { - yPos += GalScrollVals[mx]; - } else { - yPos -= GalScrollVals[mx]; - } - - if (yPos < 0) yPos += 256; - if (yPos > 255) yPos -= 256; - } - - if (GalOrientationFlipX) { - xPos = nScreenWidth - 1 - xPos; - } - - if (yPos >= 0 && yPos < nScreenHeight) { - UINT16* pPixel = pTransDraw + (yPos * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette; - } - } - } - } - } - - TileIndex++; - } - } -} - -// Sprite Rendering -static void GalRenderSprites(const UINT8 *SpriteBase) -{ - INT32 SprNum; - INT32 ClipOfs = GalFlipScreenX ? 16 : 0; - INT32 xMin = GalSpriteClipStart - ClipOfs; - INT32 xMax = GalSpriteClipEnd - ClipOfs + 1; - - for (SprNum = 7; SprNum >= 0; SprNum--) { - const UINT8 *Base = &SpriteBase[SprNum * 4]; - UINT8 Base0 = FroggerAdjust ? ((Base[0] >> 4) | (Base[0] << 4)) : Base[0]; - INT32 sy = 240 - (Base0 - (SprNum < 3)); - UINT16 Code = Base[1] & 0x3f; - UINT8 xFlip = Base[1] & 0x40; - UINT8 yFlip = Base[1] & 0x80; - UINT8 Colour = Base[2] & ((GalColourDepth == 3) ? 0x03 : 0x07); - INT32 sx = Base[3]; - - if (GalExtendSpriteInfoFunction) GalExtendSpriteInfoFunction(Base, &sx, &sy, &xFlip, &yFlip, &Code, &Colour); - - if (GalFlipScreenX) { - sx = 242 - sx; - xFlip = !xFlip; - } - - if (sx < xMin || sx > xMax) continue; - - if (GalFlipScreenY) { - sy = 240 - sy; - yFlip = !yFlip; - } - - sy -= 16; - - if (GalOrientationFlipX) { - sx = 242 - 1 - sx; - xFlip = !xFlip; - } - - if (sx > 16 && sx < (nScreenWidth - 16) && sy > 16 && sy < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, sx, sy, Colour, GalColourDepth, 0, 0, GalSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, GalColourDepth, 0, 0, GalSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, sx, sy, Colour, GalColourDepth, 0, 0, GalSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour, GalColourDepth, 0, 0, GalSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Colour, GalColourDepth, 0, 0, GalSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, GalColourDepth, 0, 0, GalSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, sy, Colour, GalColourDepth, 0, 0, GalSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, GalColourDepth, 0, 0, GalSprites); - } - } - } - } -} - -// Bullet rendering -static inline void GalDrawPixel(INT32 x, INT32 y, INT32 Colour) -{ - if (y >= 0 && y < nScreenHeight && x >= 0 && x < nScreenWidth) { - pTransDraw[(y * nScreenWidth) + x] = Colour; - } -} - -void GalaxianDrawBullets(INT32 Offs, INT32 x, INT32 y) -{ - x -= 4; - - GalDrawPixel(x++, y, GAL_PALETTE_BULLETS_OFFSET + Offs); - GalDrawPixel(x++, y, GAL_PALETTE_BULLETS_OFFSET + Offs); - GalDrawPixel(x++, y, GAL_PALETTE_BULLETS_OFFSET + Offs); - GalDrawPixel(x++, y, GAL_PALETTE_BULLETS_OFFSET + Offs); -} - -void TheendDrawBullets(INT32 Offs, INT32 x, INT32 y) -{ - x -= 4; - - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 7] = BurnHighCol(0xff, 0x00, 0xff, 0); - - GalDrawPixel(x++, y, GAL_PALETTE_BULLETS_OFFSET + Offs); - GalDrawPixel(x++, y, GAL_PALETTE_BULLETS_OFFSET + Offs); - GalDrawPixel(x++, y, GAL_PALETTE_BULLETS_OFFSET + Offs); - GalDrawPixel(x++, y, GAL_PALETTE_BULLETS_OFFSET + Offs); -} - -void ScrambleDrawBullets(INT32, INT32 x, INT32 y) -{ - x -= 6; - - GalDrawPixel(x, y, GAL_PALETTE_BULLETS_OFFSET + 7); -} - -void MoonwarDrawBullets(INT32, INT32 x, INT32 y) -{ - x -= 6; - - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 7] = BurnHighCol(0xef, 0xef, 0x97, 0); - - GalDrawPixel(x, y, GAL_PALETTE_BULLETS_OFFSET + 7); -} - -void MshuttleDrawBullets(INT32, INT32 x, INT32 y) -{ - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 0] = BurnHighCol(0xff, 0xff, 0xff, 0); - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 1] = BurnHighCol(0xff, 0xff, 0x00, 0); - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 2] = BurnHighCol(0x00, 0xff, 0xff, 0); - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 3] = BurnHighCol(0x00, 0xff, 0x00, 0); - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 4] = BurnHighCol(0xff, 0x00, 0xff, 0); - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 5] = BurnHighCol(0xff, 0x00, 0x00, 0); - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 6] = BurnHighCol(0x00, 0x00, 0xff, 0); - GalPalette[GAL_PALETTE_BULLETS_OFFSET + 7] = BurnHighCol(0x00, 0x00, 0x00, 0); - - --x; - GalDrawPixel(x, y, ((x & 0x40) == 0) ? GAL_PALETTE_BULLETS_OFFSET + + ((x >> 2) & 7) : GAL_PALETTE_BULLETS_OFFSET + + 4); - --x; - GalDrawPixel(x, y, ((x & 0x40) == 0) ? GAL_PALETTE_BULLETS_OFFSET + + ((x >> 2) & 7) : GAL_PALETTE_BULLETS_OFFSET + + 4); - --x; - GalDrawPixel(x, y, ((x & 0x40) == 0) ? GAL_PALETTE_BULLETS_OFFSET + + ((x >> 2) & 7) : GAL_PALETTE_BULLETS_OFFSET + + 4); - --x; - GalDrawPixel(x, y, ((x & 0x40) == 0) ? GAL_PALETTE_BULLETS_OFFSET + + ((x >> 2) & 7) : GAL_PALETTE_BULLETS_OFFSET + + 4); -} - -void DarkplntDrawBullets(INT32, INT32 x, INT32 y) -{ - if (GalFlipScreenX) x++; - - x -= 6; - - GalDrawPixel(x, y, GAL_PALETTE_BULLETS_OFFSET + DarkplntBulletColour); -} - -void DambustrDrawBullets(INT32 Offs, INT32 x, INT32 y) -{ - INT32 Colour; - - if (GalFlipScreenX) x++; - - x -= 6; - - for (INT32 i = 0; i < 2; i++) { - if (Offs < 16) { - Colour = GAL_PALETTE_BULLETS_OFFSET + 7; - y--; - } else { - Colour = GAL_PALETTE_BULLETS_OFFSET; - x--; - } - } - - GalDrawPixel(x, y, Colour); -} - -static void GalDrawBullets(const UINT8 *Base) -{ - for (INT32 y = 0; y < nScreenHeight; y++) { - UINT8 Shell = 0xff; - UINT8 Missile = 0xff; - UINT8 yEff; - INT32 Which; - - yEff = (GalFlipScreenY) ? (y + 16 - 1) ^ 255 : y + 16 - 1; - - for (Which = 0; Which < 3; Which++) { - if ((UINT8)(Base[Which * 4 + 1] + yEff) == 0xff) Shell = Which; - } - - yEff = (GalFlipScreenY) ? (y + 16) ^ 255 : y + 16; - - for (Which = 3; Which < 8; Which++) { - if ((UINT8)(Base[Which * 4 + 1] + yEff) == 0xff) { - if (Which != 7) { - Shell = Which; - } else { - Missile = Which; - } - } - } - - if (Shell != 0xff) GalDrawBulletsFunction(Shell, (GalOrientationFlipX) ? Base[Shell * 4 + 3] : 255 - Base[Shell * 4 + 3], y); - if (Missile != 0xff) GalDrawBulletsFunction(Missile, (GalOrientationFlipX) ? Base[Missile * 4 + 3] : 255 - Base[Missile * 4 + 3], y); - } -} - -// Render a frame -void GalDraw() -{ - if (GalRenderFrameFunction) { - GalRenderFrameFunction(); - } else { - BurnTransferClear(); - GalCalcPaletteFunction(); - if (GalRenderBackgroundFunction) GalRenderBackgroundFunction(); - GalRenderBgLayer(GalVideoRam); - GalRenderSprites(&GalSpriteRam[0x40]); - if (GalDrawBulletsFunction) GalDrawBullets(&GalSpriteRam[0x60]); - BurnTransferCopy(GalPalette); - } -} - -void ZigZagRenderFrame() -{ - BurnTransferClear(); - GalCalcPaletteFunction(); - if (GalRenderBackgroundFunction) GalRenderBackgroundFunction(); - GalRenderBgLayer(GalVideoRam); - GalRenderSprites(&GalSpriteRam[0x40]); - GalRenderSprites(&GalSpriteRam[0x40 + 0x20]); - //if (GalDrawBulletsFunction) GalDrawBullets(&GalSpriteRam[0x60]); - BurnTransferCopy(GalPalette); -} - -void DkongjrmRenderFrame() -{ - BurnTransferClear(); - GalCalcPaletteFunction(); - if (GalRenderBackgroundFunction) GalRenderBackgroundFunction(); - GalRenderBgLayer(GalVideoRam); - GalRenderSprites(&GalSpriteRam[0x40]); - GalRenderSprites(&GalSpriteRam[0x60]); - GalRenderSprites(&GalSpriteRam[0xc0]); - GalRenderSprites(&GalSpriteRam[0xe0]); - if (GalDrawBulletsFunction) GalDrawBullets(&GalSpriteRam[0x60]); - BurnTransferCopy(GalPalette); -} - -void DambustrRenderFrame() -{ - BurnTransferClear(); - GalCalcPaletteFunction(); - if (GalRenderBackgroundFunction) GalRenderBackgroundFunction(); - GalRenderBgLayer(GalVideoRam); - GalRenderSprites(&GalSpriteRam[0x40]); - if (GalDrawBulletsFunction) GalDrawBullets(&GalSpriteRam[0x60]); - if (DambustrBgPriority) { - if (GalRenderBackgroundFunction) GalRenderBackgroundFunction(); - memset(GalVideoRam2, 0x20, 0x400); - for (INT32 i = 0; i < 32; i++) { - INT32 Colour = GalSpriteRam[(i << 1) | 1] & 7; - if (Colour > 3) { - for (INT32 j = 0; j < 32; j++) GalVideoRam2[(32 * j) + i] = GalVideoRam[(32 * j) + i]; - } - } - GalRenderBgLayer(GalVideoRam2); - } - BurnTransferCopy(GalPalette); -} - -void FantastcRenderFrame() -{ - BurnTransferClear(); - GalCalcPaletteFunction(); - if (GalRenderBackgroundFunction) GalRenderBackgroundFunction(); - GalRenderBgLayer(GalVideoRam); - GalRenderSprites(&GalSpriteRam[0x40]); - if (GalDrawBulletsFunction) GalDrawBullets(&GalSpriteRam[0xc0]); - BurnTransferCopy(GalPalette); -} - -void TimefgtrRenderFrame() -{ - BurnTransferClear(); - GalCalcPaletteFunction(); - if (GalRenderBackgroundFunction) GalRenderBackgroundFunction(); - GalRenderBgLayer(GalVideoRam); - GalRenderSprites(&GalSpriteRam[0x040]); // MAME renders different sprite ram areas depending on screen-area - necessary? - GalRenderSprites(&GalSpriteRam[0x140]); - GalRenderSprites(&GalSpriteRam[0x240]); - GalRenderSprites(&GalSpriteRam[0x340]); - if (GalDrawBulletsFunction) GalDrawBullets(&GalSpriteRam[0xc0]); - BurnTransferCopy(GalPalette); -} - -void ScramblerRenderFrame() -{ - BurnTransferClear(); - GalCalcPaletteFunction(); - if (GalRenderBackgroundFunction) GalRenderBackgroundFunction(); - GalRenderBgLayer(GalVideoRam); - GalRenderSprites(&GalSpriteRam[0xc0]); - if (GalDrawBulletsFunction) GalDrawBullets(&GalSpriteRam[0xe0]); - BurnTransferCopy(GalPalette); -} diff --git a/jan/src/burn/drv/galaxian/gal_run.cpp b/jan/src/burn/drv/galaxian/gal_run.cpp deleted file mode 100644 index 47c4a8b14..000000000 --- a/jan/src/burn/drv/galaxian/gal_run.cpp +++ /dev/null @@ -1,1954 +0,0 @@ -#include "gal.h" - -UINT8 GalInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 GalInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 GalInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 GalInputPort3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 GalDip[7] = {0, 0, 0, 0, 0, 0, 0}; -UINT8 GalInput[4] = {0x00, 0x00, 0x00, 0x00}; -UINT8 GalReset = 0; -UINT8 GalFakeDip = 0; -INT32 GalAnalogPort0 = 0; -INT32 GalAnalogPort1 = 0; - -UINT8 *GalMem = NULL; -UINT8 *GalMemEnd = NULL; -UINT8 *GalRamStart = NULL; -UINT8 *GalRamEnd = NULL; -UINT8 *GalZ80Rom1 = NULL; -UINT8 *GalZ80Rom1Op = NULL; -UINT8 *GalZ80Rom2 = NULL; -UINT8 *GalZ80Rom3 = NULL; -UINT8 *GalS2650Rom1 = NULL; -UINT8 *GalZ80Ram1 = NULL; -UINT8 *GalZ80Ram2 = NULL; -UINT8 *GalZ80Ram3 = NULL; -UINT8 *GalVideoRam = NULL; -UINT8 *GalVideoRam2 = NULL; -UINT8 *GalSpriteRam = NULL; -UINT8 *GalScrollVals = NULL; -UINT8 *GalProm = NULL; -UINT8 *GalChars = NULL; -UINT8 *GalSprites = NULL; -UINT8 *GalTempRom = NULL; -UINT32 *GalPalette = NULL; - -UINT32 GalZ80Rom1Size = 0; -UINT32 GalZ80Rom1Num = 0; -UINT32 GalZ80Rom2Size = 0; -UINT32 GalZ80Rom2Num = 0; -UINT32 GalZ80Rom3Size = 0; -UINT32 GalZ80Rom3Num = 0; -UINT32 GalS2650Rom1Size = 0; -UINT32 GalS2650Rom1Num = 0; -UINT32 GalTilesSharedRomSize = 0; -UINT32 GalTilesSharedRomNum = 0; -UINT32 GalTilesCharRomSize = 0; -UINT32 GalTilesCharRomNum = 0; -UINT32 GalNumChars = 0; -UINT32 GalTilesSpriteRomSize = 0; -UINT32 GalTilesSpriteRomNum = 0; -UINT32 GalNumSprites = 0; -UINT32 GalPromRomSize = 0; -UINT32 GalPromRomNum = 0; - -GalPostLoadCallback GalPostLoadCallbackFunction; - -// CPU Control -UINT8 GalIrqType; -UINT8 GalIrqFire; -INT32 nGalCyclesDone[3], nGalCyclesTotal[3]; -static INT32 nGalCyclesSegment; - -// Misc variables -UINT8 ZigzagAYLatch; -UINT8 GalSoundLatch; -UINT8 GalSoundLatch2; -UINT8 KingballSound; -UINT8 KingballSpeechDip; -UINT8 KonamiSoundControl; -UINT8 SfxSampleControl; -UINT16 ScrambleProtectionState; -UINT8 ScrambleProtectionResult; -UINT8 MoonwarPortSelect; -UINT8 MshuttleAY8910CS; -UINT8 GmgalaxSelectedGame; -UINT8 Fourin1Bank; -UINT8 GameIsGmgalax; -UINT8 GameIsBagmanmc; -UINT8 CavelonBankSwitch; -UINT8 GalVBlank; -UINT8 Dingo; - -static inline void GalMakeInputs() -{ - // Reset Inputs - GalInput[0] = GalInput[1] = GalInput[2] = GalInput[3] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - GalInput[0] |= (GalInputPort0[i] & 1) << i; - GalInput[1] |= (GalInputPort1[i] & 1) << i; - GalInput[2] |= (GalInputPort2[i] & 1) << i; - GalInput[3] |= (GalInputPort3[i] & 1) << i; - } -} - -static INT32 GalMemIndex() -{ - UINT8 *Next; Next = GalMem; - - GalZ80Rom1 = Next; Next += GalZ80Rom1Size; - GalZ80Rom2 = Next; Next += GalZ80Rom2Size; - GalZ80Rom3 = Next; Next += GalZ80Rom3Size; - GalS2650Rom1 = Next; Next += GalS2650Rom1Size; - GalProm = Next; Next += GalPromRomSize; - - GalRamStart = Next; - - GalZ80Ram1 = Next; Next += 0x01000; - GalVideoRam = Next; Next += 0x00400; - GalSpriteRam = Next; Next += 0x00400; - GalScrollVals = Next; Next += 0x00020; - GalGfxBank = Next; Next += 0x00020; - - if (GalZ80Rom2Size) { - GalZ80Ram2 = Next; Next += 0x00400; - } - - if (GalZ80Rom3Size) { - GalZ80Ram3 = Next; Next += 0x00400; - } - - GalRamEnd = Next; - - GalChars = Next; Next += GalNumChars * 8 * 8; - GalSprites = Next; Next += GalNumSprites * 16 * 16; - GalPalette = (UINT32*)Next; Next += (GAL_PALETTE_NUM_COLOURS_PROM + GAL_PALETTE_NUM_COLOURS_STARS + GAL_PALETTE_NUM_COLOURS_BULLETS + GAL_PALETTE_NUM_COLOURS_BACKGROUND) * sizeof(UINT32); - - GalMemEnd = Next; - - return 0; -} - -static INT32 GalDoReset() -{ - if (GalS2650Rom1Size) { - s2650Open(0); - s2650Reset(); - s2650Close(); - } - - if (GalZ80Rom1Size) { - ZetOpen(0); - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "4in1")) { - ZetMapArea(0x0000, 0x3fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x3fff, 2, GalZ80Rom1); - } - ZetReset(); - ZetClose(); - } - - if (GalZ80Rom2Size) { - ZetOpen(1); - ZetReset(); - ZetClose(); - } - - if (GalZ80Rom3Size) { - ZetOpen(2); - ZetReset(); - ZetClose(); - } - - GalSoundReset(); - HiscoreReset(); - - GalIrqFire = 0; - GalFlipScreenX = 0; - GalFlipScreenY = 0; - ZigzagAYLatch = 0; - GalSoundLatch = 0; - GalSoundLatch2 = 0; - KingballSpeechDip = 0; - KingballSound = 0; - GalStarsEnable = 0; - GalStarsScrollPos = 0; - GalBackgroundRed = 0; - GalBackgroundGreen = 0; - GalBackgroundBlue = 0; - GalBackgroundEnable = 0; - ScrambleProtectionState = 0; - ScrambleProtectionResult = 0; - MoonwarPortSelect = 0; - MshuttleAY8910CS = 0; - Fourin1Bank = 0; - CavelonBankSwitch = 0; - GalVBlank = 0; - - return 0; -} - -static INT32 GalLoadRoms(bool bLoad) -{ - struct BurnRomInfo ri; - ri.nType = 0; - ri.nLen = 0; - INT32 nOffset = -1; - UINT32 i; - INT32 nRet = 0; - - if (!bLoad) { - do { - ri.nLen = 0; - ri.nType = 0; - BurnDrvGetRomInfo(&ri, ++nOffset); - if ((ri.nType & 0xff) == GAL_ROM_Z80_PROG1) { - GalZ80Rom1Size += ri.nLen; - GalZ80Rom1Num++; - } - if ((ri.nType & 0xff) == GAL_ROM_Z80_PROG2) { - GalZ80Rom2Size += ri.nLen; - GalZ80Rom2Num++; - } - if ((ri.nType & 0xff) == GAL_ROM_Z80_PROG3) { - GalZ80Rom3Size += ri.nLen; - GalZ80Rom3Num++; - } - if ((ri.nType & 0xff) == GAL_ROM_TILES_SHARED) { - GalTilesSharedRomSize += ri.nLen; - GalTilesSharedRomNum++; - } - if ((ri.nType & 0xff) == GAL_ROM_TILES_CHARS) { - GalTilesCharRomSize += ri.nLen; - GalTilesCharRomNum++; - } - if ((ri.nType & 0xff) == GAL_ROM_TILES_SPRITES) { - GalTilesSpriteRomSize += ri.nLen; - GalTilesSpriteRomNum++; - } - if ((ri.nType & 0xff) == GAL_ROM_PROM) { - GalPromRomSize += ri.nLen; - GalPromRomNum++; - } - if ((ri.nType & 0xff) == GAL_ROM_S2650_PROG1) { - GalS2650Rom1Size += ri.nLen; - GalS2650Rom1Num++; - } - } while (ri.nLen); - - if (GalTilesSharedRomSize) { - GalNumChars = GalTilesSharedRomSize / 16; - GalNumSprites = GalTilesSharedRomSize / 64; - CharPlaneOffsets[1] = GalTilesSharedRomSize * 4; - SpritePlaneOffsets[1] = GalTilesSharedRomSize * 4; - } - - if (GalTilesCharRomSize) { - GalNumChars = GalTilesCharRomSize / 16; - CharPlaneOffsets[1] = GalTilesCharRomSize * 4; - } - - if (GalTilesSpriteRomSize) { - GalNumSprites = GalTilesSpriteRomSize / 64; - SpritePlaneOffsets[1] = GalTilesSpriteRomSize * 4; - } - -#if 1 && defined FBA_DEBUG - if (GalZ80Rom1Size) bprintf(PRINT_NORMAL, _T("Z80 #1 Rom Size: 0x%X (%i roms)\n"), GalZ80Rom1Size, GalZ80Rom1Num); - if (GalZ80Rom2Size) bprintf(PRINT_NORMAL, _T("Z80 #2 Rom Size: 0x%X (%i roms)\n"), GalZ80Rom2Size, GalZ80Rom2Num); - if (GalZ80Rom3Size) bprintf(PRINT_NORMAL, _T("Z80 #3 Rom Size: 0x%X (%i roms)\n"), GalZ80Rom3Size, GalZ80Rom3Num); - if (GalS2650Rom1Size) bprintf(PRINT_NORMAL, _T("S2650 #1 Rom Size: 0x%X (%i roms)\n"), GalS2650Rom1Size, GalS2650Rom1Num); - if (GalTilesSharedRomSize) bprintf(PRINT_NORMAL, _T("Shared Tile Rom Size: 0x%X (%i roms, 0x%X Chars, 0x%X Sprites)\n"), GalTilesSharedRomSize, GalTilesSharedRomNum, GalNumChars, GalNumSprites); - if (GalTilesCharRomSize) bprintf(PRINT_NORMAL, _T("Char Rom Size: 0x%X (%i roms, 0x%X Chars)\n"), GalTilesCharRomSize, GalTilesCharRomNum, GalNumChars); - if (GalTilesSpriteRomSize) bprintf(PRINT_NORMAL, _T("Sprite Rom Size: 0x%X (%i roms, 0x%X Sprites)\n"), GalTilesSpriteRomSize, GalTilesSpriteRomNum, GalNumSprites); - if (GalPromRomSize) bprintf(PRINT_NORMAL, _T("PROM Rom Size: 0x%X (%i roms)\n"), GalPromRomSize, GalPromRomNum); -#endif - } - - if (bLoad) { - INT32 Offset; - - // Z80 #1 Program Roms - Offset = 0; - for (i = 0; i < GalZ80Rom1Num; i++) { - nRet = BurnLoadRom(GalZ80Rom1 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - - // Z80 #2 Program Roms - if (GalZ80Rom2Size) { - Offset = 0; - for (i = GAL_ROM_OFFSET_Z80_PROG2; i < GAL_ROM_OFFSET_Z80_PROG2 + GalZ80Rom2Num; i++) { - nRet = BurnLoadRom(GalZ80Rom2 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // Z80 #3 Program Roms - if (GalZ80Rom3Size) { - Offset = 0; - for (i = GAL_ROM_OFFSET_Z80_PROG3; i < GAL_ROM_OFFSET_Z80_PROG3 + GalZ80Rom3Num; i++) { - nRet = BurnLoadRom(GalZ80Rom3 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // Shared Tile Roms - if (GalTilesSharedRomSize) { - Offset = 0; - GalTempRom = (UINT8*)BurnMalloc(GalTilesSharedRomSize); - for (i = GAL_ROM_OFFSET_TILES_SHARED; i < GAL_ROM_OFFSET_TILES_SHARED + GalTilesSharedRomNum; i++) { - nRet = BurnLoadRom(GalTempRom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - } - - // Char Tile Roms - if (GalTilesCharRomSize) { - Offset = 0; - GalTempRom = (UINT8*)BurnMalloc(GalTilesCharRomSize); - for (i = GAL_ROM_OFFSET_TILES_CHARS; i < GAL_ROM_OFFSET_TILES_CHARS + GalTilesCharRomNum; i++) { - nRet = BurnLoadRom(GalTempRom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - GfxDecode(GalNumChars, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, GalTempRom, GalChars); - BurnFree(GalTempRom); - } - - // Sprite Tile Roms - if (GalTilesSpriteRomSize) { - Offset = 0; - GalTempRom = (UINT8*)BurnMalloc(GalTilesSpriteRomSize); - for (i = GAL_ROM_OFFSET_TILES_SPRITES; i < GAL_ROM_OFFSET_TILES_SPRITES + GalTilesSpriteRomNum; i++) { - nRet = BurnLoadRom(GalTempRom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - GfxDecode(GalNumSprites, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, GalTempRom, GalSprites); - BurnFree(GalTempRom); - } - - // Prom - if (GalPromRomSize) { - Offset = 0; - for (i = GAL_ROM_OFFSET_PROM; i < GAL_ROM_OFFSET_PROM + GalPromRomNum; i++) { - nRet = BurnLoadRom(GalProm + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // S2650 #1 Program Roms - if (GalS2650Rom1Size) { - Offset = 0; - for (i = GAL_ROM_OFFSET_S2650_PROG1; i < GAL_ROM_OFFSET_S2650_PROG1 + GalS2650Rom1Num; i++) { - nRet = BurnLoadRom(GalS2650Rom1 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - } - - return nRet; -} - -// Konami PPI Handlers -UINT8 KonamiPPIReadIN0() -{ - return 0xff - GalInput[0] - GalDip[0]; -} - -UINT8 KonamiPPIReadIN1() -{ - return 0xff - GalInput[1] - GalDip[1]; -} - -UINT8 KonamiPPIReadIN2() -{ - return 0xff - GalInput[2] - GalDip[2]; -} - -UINT8 KonamiPPIReadIN3() -{ - return 0xff - GalInput[3] - GalDip[3]; -} - -void KonamiPPIInit() -{ - ppi8255_init(2); - PPI0PortReadA = KonamiPPIReadIN0; - PPI0PortReadB = KonamiPPIReadIN1; - PPI0PortReadC = KonamiPPIReadIN2; - PPI1PortReadC = KonamiPPIReadIN3; - PPI1PortWriteA = KonamiSoundLatchWrite; - PPI1PortWriteB = KonamiSoundControlWrite; -} - -// Galaxian Memory Map -UINT8 __fastcall GalaxianZ80Read(UINT16 a) -{ - switch (a) { - case 0x6000: { - return GalInput[0] | GalDip[0]; - } - - case 0x6800: { - return GalInput[1] | GalDip[1]; - } - - case 0x7000: { - return GalInput[2] | GalDip[2]; - } - - case 0x7800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall GalaxianZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5800 && a <= 0x58ff) { - int Offset = a - 0x5800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x6000: - case 0x6001: { - // start_lamp_w - return; - } - - case 0x6002: { - // coin_lock_w - return; - } - - case 0x6003: { - // coin_count_0_w - return; - } - - case 0x6004: - case 0x6005: - case 0x6006: - case 0x6007: { - GalaxianLfoFreqWrite(a - 0x6004, d); - return; - } - - case 0x6800: - case 0x6801: - case 0x6802: - case 0x6803: - case 0x6804: - case 0x6805: - case 0x6806: - case 0x6807: { - GalaxianSoundWrite(a - 0x6800, d); - return; - } - - case 0x7001: { - GalIrqFire = d & 1; - return; - } - - case 0x7004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x7006: { - GalFlipScreenX = d & 1; - return; - } - - case 0x7007: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - GalPitch = d; - return; - } - - default: { - //bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall GalaxianZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall GalaxianZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -INT32 GalInit() -{ - INT32 nLen; - - GalLoadRoms(0); - - if (!GalSoundType) GalSoundType = GAL_SOUND_HARDWARE_TYPE_GALAXIAN; - - // Allocate and Blank all required memory - GalMem = NULL; - GalMemIndex(); - nLen = GalMemEnd - (UINT8 *)0; - if ((GalMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(GalMem, 0, nLen); - GalMemIndex(); - - if (GalLoadRoms(1)) return 1; - - // Setup the Z80 emulation - if (GalSoundType != GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910) { - if (GalZ80Rom3Size) { - ZetInit(0); - ZetInit(1); - ZetInit(2); - } else { - if (GalZ80Rom2Size) { - ZetInit(0); - ZetInit(1); - } else { - if (GalZ80Rom1Size) { - ZetInit(0); - } - } - } - if (GalZ80Rom1Size) { - ZetOpen(0); - ZetSetReadHandler(GalaxianZ80Read); - ZetSetWriteHandler(GalaxianZ80Write); - ZetSetInHandler(GalaxianZ80PortRead); - ZetSetOutHandler(GalaxianZ80PortWrite); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x43ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x43ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x43ff, 2, GalZ80Ram1); - ZetMapArea(0x4400, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4400, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4400, 0x47ff, 2, GalZ80Ram1); - ZetMapArea(0x5000, 0x53ff, 0, GalVideoRam); - ZetMapArea(0x5000, 0x53ff, 1, GalVideoRam); - ZetMapArea(0x5000, 0x53ff, 2, GalVideoRam); - ZetMapArea(0x5800, 0x58ff, 0, GalSpriteRam); - ZetMapArea(0x5800, 0x58ff, 2, GalSpriteRam); - ZetClose(); - } - } - - nGalCyclesTotal[0] = (18432000 / 3 / 2) / 60; - - if (GalPostLoadCallbackFunction) GalPostLoadCallbackFunction(); - - GalCalcPaletteFunction = GalaxianCalcPalette; - GalRenderBackgroundFunction = GalaxianDrawBackground; - GalDrawBulletsFunction = GalaxianDrawBullets; - - GalIrqType = GAL_IRQ_TYPE_NMI; - - GalSpriteClipStart = 16; - GalSpriteClipEnd = 255; - - GalSoundInit(); - - GalInitStars(); - - GenericTilesInit(); - - GalColourDepth = 2; - - // Reset the driver - GalDoReset(); - - return 0; -} - -// Moon Cresta Memory Map -UINT8 __fastcall MooncrstZ80Read(UINT16 a) -{ - if (a >= 0x7000 && a <= 0x77ff) { - return 0; // nop / unmapped area constantly read/written to by porter / portman - } - - switch (a) { - case 0xa000: { - return GalInput[0] | GalDip[0]; - } - - case 0xa800: { - return GalInput[1] | GalDip[1]; - } - - case 0xb000: { - return GalInput[2] | GalDip[2]; - } - - case 0xb800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall MooncrstZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - int Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0x7000 && a <= 0x77ff) { - return; // nop / unmapped area constantly written to by porter / portman - } - - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: { - GalGfxBank[a - 0xa000] = d; - return; - } - - case 0xa003: { - // coin_count_0_w - return; - } - - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: { - GalaxianLfoFreqWrite(a - 0xa004, d); - return; - } - - case 0xa800: - case 0xa801: - case 0xa802: - case 0xa803: - case 0xa804: - case 0xa805: - case 0xa806: - case 0xa807: { - GalaxianSoundWrite(a - 0xa800, d); - return; - } - - case 0xb000: { - GalIrqFire = d & 1; - return; - } - - case 0xb004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xb006: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb007: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb800: { - GalPitch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall MooncrstZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall MooncrstZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void MapMooncrst() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(MooncrstZ80Read); - ZetSetWriteHandler(MooncrstZ80Write); - ZetSetInHandler(MooncrstZ80PortRead); - ZetSetOutHandler(MooncrstZ80PortWrite); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size >= 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x83ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x83ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x83ff, 2, GalZ80Ram1); - ZetMapArea(0x9000, 0x93ff, 0, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 1, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 2, GalVideoRam); - ZetMapArea(0x9800, 0x98ff, 0, GalSpriteRam); - ZetMapArea(0x9800, 0x98ff, 2, GalSpriteRam); - ZetClose(); -} - -// Jumpbug Memory Map -UINT8 __fastcall JumpbugZ80Read(UINT16 a) -{ - if (a >= 0xb000 && a <= 0xbfff) { - INT32 Offset = a - 0xb000; - - switch (Offset) { - case 0x114: return 0x4f; - case 0x118: return 0xd3; - case 0x214: return 0xcf; - case 0x235: return 0x02; - case 0x311: return 0xff; - } - } - - switch (a) { - case 0x6000: { - return GalInput[0] | GalDip[0]; - } - - case 0x6800: { - return GalInput[1] | GalDip[1]; - } - - case 0x7000: { - return GalInput[2] | GalDip[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall JumpbugZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x5800: { - AY8910Write(0, 1, d); - return; - } - - case 0x5900: { - AY8910Write(0, 0, d); - return; - } - - case 0x2600: - case 0x6000: - case 0x6001: - case 0x6803: - case 0x6805: - case 0xb000: - case 0xb004: - // ??? unknown writes - return; - - case 0x6002: - case 0x6003: - case 0x6004: - case 0x6005: - case 0x6006: { - GalGfxBank[a - 0x6002] = d; - return; - } - - case 0x7001: { - GalIrqFire = d & 1; - return; - } - - case 0x7002: { - // coin_count_0_w - return; - } - - case 0x7004: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x7006: { - GalFlipScreenX = d & 1; - return; - } - - case 0x7007: { - GalFlipScreenY = d & 1; - return; - } - - case 0x7800: { - // watchdog write - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall JumpbugZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall JumpbugZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void MapJumpbug() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(JumpbugZ80Read); - ZetSetWriteHandler(JumpbugZ80Write); - ZetSetInHandler(JumpbugZ80PortRead); - ZetSetOutHandler(JumpbugZ80PortWrite); - ZetMapArea(0x0000, 0x3fff, 0, GalZ80Rom1); - ZetMapArea(0x0000, 0x3fff, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 2, GalZ80Ram1); - ZetMapArea(0x4800, 0x4bff, 0, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 1, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 2, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 0, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 1, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 2, GalVideoRam); - ZetMapArea(0x5000, 0x50ff, 0, GalSpriteRam); - ZetMapArea(0x5000, 0x50ff, 2, GalSpriteRam); - ZetMapArea(0x8000, GalZ80Rom1Size + 0x4000 - 1, 0, GalZ80Rom1 + 0x4000); - ZetMapArea(0x8000, GalZ80Rom1Size + 0x4000 - 1, 2, GalZ80Rom1 + 0x4000); - ZetClose(); -} - -// Frogger Memory Map -UINT8 __fastcall FroggerZ80Read(UINT16 a) -{ - if (a >= 0xc000) { - UINT32 Offset = a - 0xc000; - UINT8 Result = 0xff; - if (Offset & 0x1000) Result &= ppi8255_r(1, (Offset >> 1) & 3); - if (Offset & 0x2000) Result &= ppi8255_r(0, (Offset >> 1) & 3); - return Result; - } - - switch (a) { - case 0x8800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall FroggerZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0xb000 && a <= 0xb0ff) { - INT32 Offset = a - 0xb000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - d = (d >> 4) | (d << 4); - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0xc000) { - INT32 Offset = a - 0xc000; - if (Offset & 0x1000) ppi8255_w(1, (Offset >> 1) & 3, d); - if (Offset & 0x2000) ppi8255_w(0, (Offset >> 1) & 3, d); - return; - } - - switch (a) { - case 0xb808: { - GalIrqFire = d & 1; - return; - } - - case 0xb80c: { - GalFlipScreenY = d & 1; - return; - } - - case 0xb810: { - GalFlipScreenX = d & 1; - return; - } - - case 0xb818: { - // coin_count_0_w - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall FroggerZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall FroggerZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void MapFrogger() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(FroggerZ80Read); - ZetSetWriteHandler(FroggerZ80Write); - ZetSetInHandler(FroggerZ80PortRead); - ZetSetOutHandler(FroggerZ80PortWrite); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetMapArea(0xa800, 0xabff, 0, GalVideoRam); - ZetMapArea(0xa800, 0xabff, 1, GalVideoRam); - ZetMapArea(0xa800, 0xabff, 2, GalVideoRam); - ZetMapArea(0xb000, 0xb0ff, 0, GalSpriteRam); - ZetMapArea(0xb000, 0xb0ff, 2, GalSpriteRam); - ZetClose(); -} - -// The End Memory Map -UINT8 __fastcall TheendZ80Read(UINT16 a) -{ - if (a >= 0x8000) { - UINT32 Offset = a - 0x8000; - UINT8 Result = 0xff; - if (Offset & 0x0100) Result &= ppi8255_r(0, Offset & 3); - if (Offset & 0x0200) Result &= ppi8255_r(1, Offset & 3); - return Result; - } - - switch (a) { - case 0x7000: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall TheendZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x5000 && a <= 0x50ff) { - INT32 Offset = a - 0x5000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0x8000) { - INT32 Offset = a - 0x8000; - if (Offset & 0x0100) ppi8255_w(0, Offset & 3, d); - if (Offset & 0x0200) ppi8255_w(1, Offset & 3, d); - return; - } - - switch (a) { - case 0x6801: { - GalIrqFire = d & 1; - return; - } - - case 0x6802: { - // coin_count_0_w - return; - } - - case 0x6803: { - GalBackgroundEnable = d & 1; - return; - } - - case 0x6804: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0x6806: { - GalFlipScreenX = d & 1; - return; - } - - case 0x6807: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall TheendZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall TheendZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void MapTheend() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(TheendZ80Read); - ZetSetWriteHandler(TheendZ80Write); - ZetSetInHandler(TheendZ80PortRead); - ZetSetOutHandler(TheendZ80PortWrite); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x4000) ? 0x3fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x4000, 0x47ff, 0, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 1, GalZ80Ram1); - ZetMapArea(0x4000, 0x47ff, 2, GalZ80Ram1); - ZetMapArea(0x4800, 0x4bff, 0, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 1, GalVideoRam); - ZetMapArea(0x4800, 0x4bff, 2, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 0, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 1, GalVideoRam); - ZetMapArea(0x4c00, 0x4fff, 2, GalVideoRam); - ZetMapArea(0x5000, 0x50ff, 0, GalSpriteRam); - ZetMapArea(0x5000, 0x50ff, 2, GalSpriteRam); - ZetClose(); -} - -// Turtles Memory Map -UINT8 __fastcall TurtlesZ80Read(UINT16 a) -{ - if (a >= 0xb000 && a <= 0xb03f) { - UINT32 Offset = a - 0xb000; - return ppi8255_r(0, (Offset >> 4) & 3); - } - - if (a >= 0xb800 && a <= 0xb83f) { - UINT32 Offset = a - 0xb800; - return ppi8255_r(1, (Offset >> 4) & 3); - } - - switch (a) { - case 0xa800: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall TurtlesZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9800 && a <= 0x98ff) { - INT32 Offset = a - 0x9800; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - if (a >= 0xb000 && a <= 0xb03f) { - UINT32 Offset = a - 0xb000; - ppi8255_w(0, (Offset >> 4) & 3, d); - return; - } - - if (a >= 0xb800 && a <= 0xb83f) { - UINT32 Offset = a - 0xb800; - ppi8255_w(1, (Offset >> 4) & 3, d); - return; - } - - switch (a) { - case 0xa000: { - GalBackgroundRed = d & 1; - return; - } - - case 0xa008: { - GalIrqFire = d & 1; - return; - } - - case 0xa010: { - GalFlipScreenY = d & 1; - return; - } - - case 0xa018: { - GalFlipScreenX = d & 1; - return; - } - - case 0xa020: { - GalBackgroundGreen = d & 1; - return; - } - - case 0xa028: { - GalBackgroundBlue = d & 1; - return; - } - - case 0xa030: { - // coin_count_0_w - return; - } - - case 0xa038: { - // coin_count_1_w - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall TurtlesZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall TurtlesZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void MapTurtles() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(TurtlesZ80Read); - ZetSetWriteHandler(TurtlesZ80Write); - ZetSetInHandler(TurtlesZ80PortRead); - ZetSetOutHandler(TurtlesZ80PortWrite); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x8000) ? 0x7fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x8000) ? 0x7fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetMapArea(0x9000, 0x93ff, 0, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 1, GalVideoRam); - ZetMapArea(0x9000, 0x93ff, 2, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 0, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 1, GalVideoRam); - ZetMapArea(0x9400, 0x97ff, 2, GalVideoRam); - ZetMapArea(0x9800, 0x98ff, 0, GalSpriteRam); - ZetMapArea(0x9800, 0x98ff, 2, GalSpriteRam); - ZetClose(); -} - -// Super Cobra Memory Map -UINT8 __fastcall ScobraZ80Read(UINT16 a) -{ - switch (a) { - case 0x9800: - case 0x9801: - case 0x9802: - case 0x9803: { - return ppi8255_r(0, a - 0x9800); - } - - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: { - return ppi8255_r(1, a - 0xa000); - } - - case 0xb000: { - // watchdog read - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall ScobraZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x9000 && a <= 0x90ff) { - INT32 Offset = a - 0x9000; - - GalSpriteRam[Offset] = d; - - if (Offset < 0x40) { - if ((Offset & 0x01) == 0) { - GalScrollVals[Offset >> 1] = d; - } - } - - return; - } - - switch (a) { - case 0x9800: - case 0x9801: - case 0x9802: - case 0x9803: { - return ppi8255_w(0, a - 0x9800, d); - } - - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: { - return ppi8255_w(1, a - 0xa000, d); - } - - case 0xa801: { - GalIrqFire = d & 1; - return; - } - - case 0xa802: { - // coin_count_0_w - return; - } - - case 0xa803: { - GalBackgroundEnable = d & 1; - return; - } - - case 0xa804: { - GalStarsEnable = d & 0x01; - if (!GalStarsEnable) GalStarsScrollPos = -1; - return; - } - - case 0xa806: { - GalFlipScreenX = d & 1; - return; - } - - case 0xa807: { - GalFlipScreenY = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall ScobraZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0xff; -} - -void __fastcall ScobraZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void MapScobra() -{ - ZetOpen(0); - ZetMemCallback(0x0000, 0xffff, 0); - ZetMemCallback(0x0000, 0xffff, 1); - ZetMemCallback(0x0000, 0xffff, 2); - ZetSetReadHandler(ScobraZ80Read); - ZetSetWriteHandler(ScobraZ80Write); - ZetSetInHandler(ScobraZ80PortRead); - ZetSetOutHandler(ScobraZ80PortWrite); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x8000) ? 0x7fff : GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, (GalZ80Rom1Size > 0x8000) ? 0x7fff : GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 1, GalZ80Ram1); - ZetMapArea(0x8000, 0x87ff, 2, GalZ80Ram1); - ZetMapArea(0x8800, 0x8bff, 0, GalVideoRam); - ZetMapArea(0x8800, 0x8bff, 1, GalVideoRam); - ZetMapArea(0x8800, 0x8bff, 2, GalVideoRam); - ZetMapArea(0x8c00, 0x8fff, 0, GalVideoRam); - ZetMapArea(0x8c00, 0x8fff, 1, GalVideoRam); - ZetMapArea(0x8c00, 0x8fff, 2, GalVideoRam); - ZetMapArea(0x9000, 0x90ff, 0, GalSpriteRam); - ZetMapArea(0x9000, 0x90ff, 2, GalSpriteRam); - ZetClose(); -} - -INT32 GalExit() -{ - if (GalZ80Rom1Size) ZetExit(); - if (GalS2650Rom1Size) s2650Exit(); - - GenericTilesExit(); - - BurnFree(GalMem); - BurnFree(GalZ80Rom1Op); - BurnFree(GalVideoRam2); - BurnFree(RockclimTiles); - - GalSoundExit(); - - GalIrqFire = 0; - GalIrqType = 0; - GalSoundType = 0; - GalFlipScreenX = 0; - GalFlipScreenY = 0; - ZigzagAYLatch = 0; - GalSoundLatch = 0; - GalSoundLatch2 = 0; - KingballSpeechDip = 0; - KingballSound = 0; - KonamiSoundControl = 0; - SfxSampleControl = 0; - GmgalaxSelectedGame = 0; - GalPaletteBank = 0; - GalSpriteClipStart = 0; - GalSpriteClipEnd = 0; - FroggerAdjust = 0; - GalBackgroundRed = 0; - GalBackgroundGreen = 0; - GalBackgroundBlue = 0; - GalBackgroundEnable = 0; - ScrambleProtectionState = 0; - ScrambleProtectionResult = 0; - Dingo = 0; - - GalZ80Rom1Size = 0; - GalZ80Rom1Num = 0; - GalZ80Rom2Size = 0; - GalZ80Rom2Num = 0; - GalZ80Rom3Size = 0; - GalZ80Rom3Num = 0; - GalS2650Rom1Size = 0; - GalS2650Rom1Num = 0; - GalTilesSharedRomSize = 0; - GalTilesSharedRomNum = 0; - GalTilesCharRomSize = 0; - GalTilesCharRomNum = 0; - GalNumChars = 0; - GalTilesSpriteRomSize = 0; - GalTilesSpriteRomNum = 0; - GalNumSprites = 0; - GalPromRomSize = 0; - GalPromRomNum = 0; - - GalPostLoadCallbackFunction = NULL; - GalRenderBackgroundFunction = NULL; - GalCalcPaletteFunction = NULL; - GalDrawBulletsFunction = NULL; - GalExtendTileInfoFunction = NULL; - GalExtendSpriteInfoFunction = NULL; - GalRenderFrameFunction = NULL; - - SfxTilemap = 0; - GalOrientationFlipX = 0; - MoonwarPortSelect = 0; - MshuttleAY8910CS = 0; - Fourin1Bank = 0; - GameIsGmgalax = 0; - GameIsBagmanmc = 0; - CavelonBankSwitch = 0; - DarkplntBulletColour = 0; - DambustrBgColour1 = 0; - DambustrBgColour2 = 0; - DambustrBgPriority = 0; - DambustrBgSplitLine = 0; - RockclimScrollX = 0; - RockclimScrollY = 0; - GalVBlank = 0; - - GalColourDepth = 0; - - return 0; -} - -INT32 KonamiExit() -{ - ppi8255_exit(); - - return GalExit(); -} - -INT32 GalFrame() -{ - INT32 nInterleave = 8; - INT32 nSoundBufferPos = 0; - INT32 SoundLenInterlv = (nBurnSoundLen > 0x100) ? 0x100 : nBurnSoundLen; // keep spdcoin from freezing up when the coin breaks @ 48khz - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_GALAXIAN || GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC) { - nInterleave = nBurnSoundLen; - GalaxianSoundUpdateTimers(); - } - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910) nInterleave = SoundLenInterlv / 4; - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) nInterleave = 32; - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910) nInterleave = 32; - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) nInterleave = 32; - - INT32 nIrqInterleaveFire = nInterleave / 4; - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HEXPOOLASN76496) { nInterleave = 8; nIrqInterleaveFire = nInterleave - 1; } - - if (GameIsBagmanmc) nIrqInterleaveFire = 0; - - if (GalReset) GalDoReset(); - - if (GameIsGmgalax && (GmgalaxSelectedGame != GalFakeDip)) { - GmgalaxSelectedGame = GalFakeDip; - INT32 nAddress = 0x0000; - if (GmgalaxSelectedGame == 1) nAddress = 0x4000; - ZetOpen(0); - ZetMapArea(0x0000, 0x3fff, 0, GalZ80Rom1 + nAddress); - ZetMapArea(0x0000, 0x3fff, 2, GalZ80Rom1 + nAddress); - ZetClose(); - - GalGfxBank[0] = 0; - if (GmgalaxSelectedGame == 1) GalGfxBank[0] = 1; - GalPaletteBank = 0; - if (GmgalaxSelectedGame == 1) GalPaletteBank = 1; - - GalDoReset(); - } - - GalMakeInputs(); - GalVBlank = 0; - - if (GalZ80Rom1Size) ZetNewFrame(); - - nGalCyclesDone[0] = nGalCyclesDone[1] = nGalCyclesDone[2] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - if (GalZ80Rom1Size && GalSoundType != GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910) { - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nGalCyclesTotal[nCurrentCPU] / nInterleave; - nGalCyclesSegment = nNext - nGalCyclesDone[nCurrentCPU]; - nGalCyclesDone[nCurrentCPU] += ZetRun(nGalCyclesSegment); - if (i == nIrqInterleaveFire && GalIrqFire) { - if (GalIrqType == GAL_IRQ_TYPE_NMI) ZetNmi(); - if (GalIrqType == GAL_IRQ_TYPE_IRQ0) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - GalIrqFire = 0; - } - ZetClose(); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910) { - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nGalCyclesTotal[nCurrentCPU] / nInterleave; - nGalCyclesSegment = nNext - nGalCyclesDone[nCurrentCPU]; - nGalCyclesDone[nCurrentCPU] += ZetRun(nGalCyclesSegment); - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910) { - if (Dingo && !((i%2) == 0)) continue; // slow down dingo music a bit. - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nGalCyclesTotal[nCurrentCPU] / nInterleave; - nGalCyclesSegment = nNext - nGalCyclesDone[nCurrentCPU]; - nGalCyclesSegment = ZetRun(nGalCyclesSegment); - nGalCyclesDone[nCurrentCPU] += nGalCyclesSegment; - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) { - // Run Z80 #3 - nCurrentCPU = 2; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nGalCyclesTotal[nCurrentCPU] / nInterleave; - nGalCyclesSegment = nNext - nGalCyclesDone[nCurrentCPU]; - nGalCyclesDone[nCurrentCPU] += ZetRun(nGalCyclesSegment); - ZetClose(); - } - - // Run S2650 #1 - if (GalS2650Rom1Size) { - nCurrentCPU = 0; - s2650Open(nCurrentCPU); - nNext = (i + 1) * nGalCyclesTotal[nCurrentCPU] / nInterleave; - nGalCyclesSegment = nNext - nGalCyclesDone[nCurrentCPU]; - nGalCyclesDone[nCurrentCPU] += s2650Run(nGalCyclesSegment); - if (i == nIrqInterleaveFire) { - GalVBlank = 1; - s2650SetIRQLine(0, CPU_IRQSTATUS_ACK); - s2650Run(0); - s2650SetIRQLine(0, CPU_IRQSTATUS_NONE); - s2650Run(0); - } - s2650Close(); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910) { - // Run Z80 #1 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nGalCyclesTotal[nCurrentCPU] / nInterleave; - nGalCyclesSegment = nNext - nGalCyclesDone[nCurrentCPU]; - nGalCyclesDone[nCurrentCPU] += ZetRun(nGalCyclesSegment); - if (HunchbksSoundIrqFire) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_GALAXIAN) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - GalRenderSoundSamples(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910) { - AY8910Update(1, &pAY8910Buffer[3], nSegmentLength); - } - - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910) { - filter_rc_update(3, pAY8910Buffer[3], pSoundBuf, nSegmentLength); - filter_rc_update(4, pAY8910Buffer[4], pSoundBuf, nSegmentLength); - filter_rc_update(5, pAY8910Buffer[5], pSoundBuf, nSegmentLength); - } - - nSoundBufferPos += nSegmentLength; - } - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - GalRenderSoundSamples(pSoundBuf, nSegmentLength); - DACUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HEXPOOLASN76496) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496) { - SN76496Update(1, pSoundBuf, nSegmentLength); - SN76496Update(2, pSoundBuf, nSegmentLength); - } - nSoundBufferPos += nSegmentLength; - } - } - } - - // Make sure the buffer is entirely filled. - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_GALAXIAN) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - GalRenderSoundSamples(pSoundBuf, nSegmentLength); - } - } - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910) { - AY8910Update(1, &pAY8910Buffer[3], nSegmentLength); - } - - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910) { - filter_rc_update(3, pAY8910Buffer[3], pSoundBuf, nSegmentLength); - filter_rc_update(4, pAY8910Buffer[4], pSoundBuf, nSegmentLength); - filter_rc_update(5, pAY8910Buffer[5], pSoundBuf, nSegmentLength); - } - } - } - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - GalRenderSoundSamples(pSoundBuf, nSegmentLength); - DACUpdate(pSoundBuf, nSegmentLength); - } - } - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) { - if (pBurnSoundOut) DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HEXPOOLASN76496) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496) { - SN76496Update(1, pSoundBuf, nSegmentLength); - SN76496Update(2, pSoundBuf, nSegmentLength); - } - } - } - } - - if (pBurnDraw) GalDraw(); - - return 0; -} - -INT32 GalScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029703; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = GalRamStart; - ba.nLen = GalRamEnd - GalRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - if (GalZ80Rom1Size) ZetScan(nAction); - ppi8255_scan(); - if (GalS2650Rom1Size) s2650Scan(nAction); - - GalSoundScan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(GalInput); - SCAN_VAR(GalAnalogPort0); - SCAN_VAR(GalAnalogPort1); - SCAN_VAR(GalIrqFire); - SCAN_VAR(nGalCyclesDone); - SCAN_VAR(nGalCyclesSegment); - SCAN_VAR(ZigzagAYLatch); - SCAN_VAR(GalSoundLatch); - SCAN_VAR(GalSoundLatch2); - SCAN_VAR(KingballSound); - SCAN_VAR(KingballSpeechDip); - SCAN_VAR(KonamiSoundControl); - SCAN_VAR(SfxSampleControl); - SCAN_VAR(ScrambleProtectionResult); - SCAN_VAR(MoonwarPortSelect); - SCAN_VAR(MshuttleAY8910CS); - SCAN_VAR(GmgalaxSelectedGame); - SCAN_VAR(Fourin1Bank); - SCAN_VAR(CavelonBankSwitch); - SCAN_VAR(GalFlipScreenX); - SCAN_VAR(GalFlipScreenY); - SCAN_VAR(GalPaletteBank); - SCAN_VAR(GalBackgroundRed); - SCAN_VAR(GalBackgroundGreen); - SCAN_VAR(GalBackgroundBlue); - SCAN_VAR(GalBackgroundEnable); - SCAN_VAR(DarkplntBulletColour); - SCAN_VAR(DambustrBgColour1); - SCAN_VAR(DambustrBgColour2); - SCAN_VAR(DambustrBgPriority); - SCAN_VAR(DambustrBgSplitLine); - SCAN_VAR(RockclimScrollX); - SCAN_VAR(RockclimScrollY); - SCAN_VAR(GalStarsEnable); - SCAN_VAR(GalStarsScrollPos); - SCAN_VAR(GalStarsBlinkState); - SCAN_VAR(GalVBlank); - } - - return 0; -} diff --git a/jan/src/burn/drv/galaxian/gal_sound.cpp b/jan/src/burn/drv/galaxian/gal_sound.cpp deleted file mode 100644 index 88263bff3..000000000 --- a/jan/src/burn/drv/galaxian/gal_sound.cpp +++ /dev/null @@ -1,1136 +0,0 @@ -#include "gal.h" - -INT16* pFMBuffer; -INT16* pAY8910Buffer[9]; - -UINT8 GalSoundType; -UINT8 HunchbksSoundIrqFire; - -#define XTAL 18432000 -#define RNG_RATE (XTAL / 3) -#define NOISE_RATE (XTAL / 3 / 192 / 2 / 2) -#define NOISE_LENGTH (NOISE_RATE * 4) -#define NOISE_AMPLITUDE (70 * 256) -#define SHOOT_VOLUME 0.50f -#define SHOOT_SEC 2 -#define R41__ 100000 -#define R44__ 10000 -#define R45__ 22000 -#define R46__ 10000 -#define R47__ 2200 -#define R48__ 2200 -#define C25__ 0.000001 -#define C27__ 0.00000001 -#define C28__ 0.000047 -#define C29__ 0.00000001 -#define IC8L3_L 0.2 -#define IC8L3_H 4.5 -#define NOISE_L 0.2 -#define NOISE_H 4.5 -#define SHOOT_KEYON_TIME 0.1 -#define NE555_FM_ADJUST_RATE 0.80 -#define TOOTHSAW_LENGTH 16 -#define TOOTHSAW_VOLUME 0.36f -#define TOOTHSAW_AMPLITUDE (64*256) -#define V(r0,r1) 2 * TOOTHSAW_AMPLITUDE * (r0) / (r0 + r1) - TOOTHSAW_AMPLITUDE -#define STEPS 16 -#define LFO_VOLUME 0.06f -#define MINFREQ (139 - 139 / 3) -#define MAXFREQ (139 + 139 / 3) - -static INT16 *GalNoiseWave; -static INT16 *GalShootWave; -static UINT32 GalShootLength; -static UINT32 GalShootRate; -UINT8 GalLastPort2 = 0; -UINT8 GalShootEnable; -UINT8 GalNoiseEnable; -INT32 GalNoiseVolume; -double GalShootWavePos; -double GalNoiseWavePos; -double GalLfoWavePos[3]; -INT32 GalPitch; -INT32 GalVol; -static double GalCounter; -static INT32 GalCountDown; -INT32 GalLfoVolume[3]; -double GalLfoFreq; -double GalLfoFreqFrameVar; -INT32 GalLfoBit[4]; -static double GalGain; -static INT32 GalOutputDir; - -static INT16 GalToneWave[4][TOOTHSAW_LENGTH]; - -static const INT16 GalBackgroundWave[32] = -{ - 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, - 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, - -0x4000,-0x4000,-0x4000,-0x4000,-0x4000,-0x4000,-0x4000,-0x4000, - -0x4000,-0x4000,-0x4000,-0x4000,-0x4000,-0x4000,-0x4000,-0x4000, -}; - -void GalaxianSoundSetRoute(double nVolume, INT32 nRouteDir) -{ - GalGain = nVolume; - GalOutputDir = nRouteDir; -} - -void GalSoundReset() -{ - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910) { - AY8910Reset(0); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - AY8910Reset(0); - AY8910Reset(1); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910) { - AY8910Reset(0); - AY8910Reset(1); - AY8910Reset(2); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) { - DACReset(); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_GALAXIAN || GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC) { - GalLastPort2 = 0; - GalShootEnable = 0; - GalNoiseEnable = 0; - GalNoiseVolume = 0; - GalShootWavePos = 0; - GalNoiseWavePos = 0; - GalLfoWavePos[0] = GalLfoWavePos[1] = GalLfoWavePos[2] = 0; - GalPitch = 0xff; - GalVol = 0; - GalCounter = 0; - GalCountDown = 0; - GalLfoVolume[0] = GalLfoVolume[1] = GalLfoVolume[2] = 0; - GalLfoFreq = MAXFREQ; - GalLfoFreqFrameVar = 0; - GalLfoBit[0] = GalLfoBit[1] = GalLfoBit[2] = GalLfoBit[3] = 0; - } -} - -void GalSoundInit() -{ - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910) { - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * 3 * sizeof(INT16)); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * 6 * sizeof(INT16)); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910) { - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * 9 * sizeof(INT16)); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910) { - pAY8910Buffer[6] = pFMBuffer + nBurnSoundLen * 6; - pAY8910Buffer[7] = pFMBuffer + nBurnSoundLen * 7; - pAY8910Buffer[8] = pFMBuffer + nBurnSoundLen * 8; - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910) { - AY8910Init(0, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910) { - AY8910Init(0, 1789750, nBurnSoundRate, &BongoDipSwitchRead, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910) { - AY8910Init(0, 1620000, nBurnSoundRate, &CheckmajPortARead, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910) { - // Port A Write - cclimber_sample_select_w - AY8910Init(0, 18432000 / 3 / 4, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &FroggerSoundTimerRead, NULL, NULL); - - filter_rc_init(0, FLT_RC_LOWPASS, 1, 1, 1, 0, 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - - filter_rc_set_src_gain(0, 0.75); - filter_rc_set_src_gain(1, 0.75); - filter_rc_set_src_gain(2, 0.75); - - filter_rc_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 1.00, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &KonamiSoundTimerRead, NULL, NULL); - - filter_rc_init(0, FLT_RC_LOWPASS, 1, 1, 1, 0, 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(3, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - - filter_rc_set_src_gain(0, 0.50); - filter_rc_set_src_gain(1, 0.50); - filter_rc_set_src_gain(2, 0.50); - filter_rc_set_src_gain(3, 0.50); - filter_rc_set_src_gain(4, 0.50); - filter_rc_set_src_gain(5, 0.50); - - filter_rc_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, 1.00, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, &KonamiSoundTimerRead, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &KonamiSoundTimerRead, NULL, NULL); - AY8910Init(2, 14318000 / 8, nBurnSoundRate, NULL, NULL, NULL, NULL); - - filter_rc_init(0, FLT_RC_LOWPASS, 1, 1, 1, 0, 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(3, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - - filter_rc_set_src_gain(0, 0.50); - filter_rc_set_src_gain(1, 0.50); - filter_rc_set_src_gain(2, 0.50); - filter_rc_set_src_gain(3, 0.50); - filter_rc_set_src_gain(4, 0.50); - filter_rc_set_src_gain(5, 0.50); - - filter_rc_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, 1.00, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, &KonamiSoundTimerRead, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 1.00, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - AY8910Init(0, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, NULL, NULL, &SfxSoundLatch2Write, &SfxSampleControlWrite); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &KonamiSoundTimerRead, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); - - filter_rc_init(0, FLT_RC_LOWPASS, 1, 1, 1, 0, 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(3, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - - filter_rc_set_src_gain(0, 0.50); - filter_rc_set_src_gain(1, 0.50); - filter_rc_set_src_gain(2, 0.50); - filter_rc_set_src_gain(3, 0.50); - filter_rc_set_src_gain(4, 0.50); - filter_rc_set_src_gain(5, 0.50); - - filter_rc_set_route(0, 0.10, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 0.10, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 0.10, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, 0.10, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, 0.10, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, 0.10, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, SfxSyncDAC); - DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC) { - DACInit(0, 0, 1, KingballSyncDAC); - DACSetRoute(0, 0.35, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_HEXPOOLASN76496) { - SN76496Init(0, 18432000 / 3 / 2, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496) { - SN76496Init(0, 18432000 / 3 / 2, 0); - SN76496Init(1, 18432000 / 3 / 2, 1); - SN76496Init(2, 18432000 / 3 / 2, 1); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(2, 1.00, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &HunchbksSoundTimerRead, NULL, NULL); - - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_GALAXIAN || GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC) { - GalShootEnable = 0; - GalShootWavePos = 0; - INT32 CountDown, Generator, Bit1, Bit2; - - GalNoiseWave = (INT16*)BurnMalloc(NOISE_LENGTH * sizeof(INT16)); - - GalShootRate = 22050; - GalShootLength = SHOOT_SEC * GalShootRate; - GalShootWave = (INT16*)BurnMalloc(GalShootLength * sizeof(INT16)); - - Generator = 0; - CountDown = NOISE_RATE / 2; - for (INT32 i = 0; i < NOISE_LENGTH; i++) { - CountDown -= RNG_RATE; - while (CountDown < 0) { - Generator <<= 1; - Bit1 = (~Generator >> 17) & 1; - Bit2 = (Generator >> 5) & 1; - if (Bit1 ^ Bit2) Generator |= 1; - CountDown += NOISE_RATE; - } - GalNoiseWave[i] = ((Generator >> 17) & 1) ? NOISE_AMPLITUDE : -NOISE_AMPLITUDE; - } - - double v = 5.0; - double vK = (GalShootRate) ? exp(-1 / (R41__ * C25__) / GalShootRate) : 0; - double IC8L3 = IC8L3_L; - INT32 IC8Lcnt = (INT32)(SHOOT_KEYON_TIME * GalShootRate); - double c28v = IC8L3_H - (IC8L3_H - (NOISE_H + NOISE_L) / 2) / (R46__ + R47__ + R48__) * R47__; - double c28K = (GalShootRate) ? exp(-1 / (22000 * 0.000047 ) / GalShootRate) : 0; - double c29v = IC8L3_H - (IC8L3_H - (NOISE_H + NOISE_L) / 2) / (R46__ + R47__ + R48__) * (R47__ + R48__); - double c29K1 = (GalShootRate) ? exp(-1 / (22000 * 0.00000001 ) / GalShootRate) : 0; - double c29K2 = (GalShootRate) ? exp(-1 / (100000 * 0.00000001 ) / GalShootRate) : 0; - double ne555cnt = 0; - double ne555step = (GalShootRate) ? ((1.44 / ((R44__ + R45__ * 2) * C27__)) / GalShootRate) : 0; - double ne555duty = (double)(R44__ + R45__) / (R44__ + R45__ * 2); - double ne555sr; - double ncnt = 0.0; - double nstep = (GalShootRate) ? ((double)NOISE_RATE / GalShootRate) : 0; - double noise_sh2; - - for (UINT32 i = 0; i < GalShootLength; i++) { - noise_sh2 = GalNoiseWave[(INT32)ncnt % NOISE_LENGTH] == NOISE_AMPLITUDE ? NOISE_H : NOISE_L; - ncnt += nstep; - ne555sr = c29v * NE555_FM_ADJUST_RATE / (5.0 * 2 / 3); - ne555cnt += ne555step; - if (ne555cnt >= ne555sr) ne555cnt -= ne555sr; - if (ne555cnt < ne555sr * ne555duty) { - GalShootWave[i] = (INT16)(v / 5 * 0x7fff); - if(IC8L3 == IC8L3_H) v *= vK; - } else { - GalShootWave[i] = 0; - } - c28v += (IC8L3 - c28v) - (IC8L3 - c28v) * c28K; - c28v += (c29v - c28v) - (c29v - c28v) * c28K; - c29v += (c28v - c29v) - (c28v - c29v) * c29K1; - c29v += (noise_sh2 - c29v) - (noise_sh2 - c29v) * c29K2; - if(IC8L3 == IC8L3_L && --IC8Lcnt == 0) IC8L3 = IC8L3_H; - } - - memset(GalToneWave, 0, sizeof(GalToneWave)); - - for (UINT32 i = 0; i < TOOTHSAW_LENGTH; i++ ) { - double r0a = 1.0 / 1e12, r1a = 1.0 / 1e12; - double r0b = 1.0 / 1e12, r1b = 1.0 / 1e12; - - if (i & 1) { - r1a += 1.0 / 33000; - r1b += 1.0 / 33000; - } else { - r0a += 1.0 / 33000; - r0b += 1.0 / 33000; - } - if (i & 4) { - r1a += 1.0 / 22000; - r1b += 1.0 / 22000; - } else { - r0a += 1.0 / 22000; - r0b += 1.0 / 22000; - } - GalToneWave[0][i] = (INT16)(V(1.0 / r0a, 1.0 / r1a)); - - if (i & 4) { - r1a += 1.0 / 10000; - } else { - r0a += 1.0 / 10000; - } - GalToneWave[1][i] = (INT16)(V(1.0 / r0a, 1.0 / r1a)); - - if (i & 8) { - r1b += 1.0 / 15000; - } else { - r0b += 1.0 / 15000; - } - GalToneWave[2][i] = (INT16)(V(1.0 / r0b, 1.0 / r1b)); - - if (i & 4) { - r0b += 1.0 / 10000; - } else { - r1b += 1.0 / 10000; - } - GalToneWave[3][i] = (INT16)(V(1.0 / r0b, 1.0 / r1b)); - } - - GalPitch = 0xff; - GalVol = 0; - - GalLfoFreq = MAXFREQ; - GalLfoFreqFrameVar = 0; - - GalGain = 4.00; - GalOutputDir = BURN_SND_ROUTE_BOTH; - } -} - -void GalSoundExit() -{ - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910) { - AY8910Exit(0); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - AY8910Exit(0); - AY8910Exit(1); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910) { - AY8910Exit(0); - AY8910Exit(1); - AY8910Exit(2); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) { - DACExit(); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HEXPOOLASN76496) { - SN76496Exit(); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) { - filter_rc_exit(); - } - - BurnFree(pFMBuffer); - for (INT32 i = 0; i < 9; i++) pAY8910Buffer[i] = NULL; - - BurnFree(GalNoiseWave); - BurnFree(GalShootWave); - - HunchbksSoundIrqFire = 0; - GalShootLength = 0; - GalShootRate = 0; - GalLastPort2 = 0; - GalShootEnable = 0; - GalNoiseEnable = 0; - GalNoiseVolume = 0; - GalShootWavePos = 0; - GalNoiseWavePos = 0; - GalLfoWavePos[0] = GalLfoWavePos[1] = GalLfoWavePos[2] = 0; - GalPitch = 0; - GalVol = 0; - GalCounter = 0; - GalCountDown = 0; - GalLfoVolume[0] = GalLfoVolume[1] = GalLfoVolume[2] = 0; - GalLfoFreq = 0; - GalLfoFreqFrameVar = 0; - GalLfoBit[0] = GalLfoBit[1] = GalLfoBit[2] = GalLfoBit[3] = 0; - memset(GalToneWave, 0, sizeof(GalToneWave)); -} - -void GalSoundScan(INT32 nAction, INT32 *pnMin) -{ - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_GALAXIAN || GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC) { - SCAN_VAR(GalLastPort2); - SCAN_VAR(GalShootEnable); - SCAN_VAR(GalNoiseEnable); - SCAN_VAR(GalNoiseVolume); - SCAN_VAR(GalShootWavePos); - SCAN_VAR(GalNoiseWavePos); - SCAN_VAR(GalLfoWavePos); - SCAN_VAR(GalPitch); - SCAN_VAR(GalVol); - SCAN_VAR(GalCounter); - SCAN_VAR(GalCountDown); - SCAN_VAR(GalLfoVolume); - SCAN_VAR(GalLfoFreq); - SCAN_VAR(GalLfoFreqFrameVar); - SCAN_VAR(GalLfoBit); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - AY8910Scan(nAction, pnMin); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KINGBALLDAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) { - DACScan(nAction, pnMin); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_RACKNROLSN76496) { - SN76496Scan(nAction, pnMin); - } -} - -// AY8910 Port Handlers -UINT8 CheckmajPortARead(UINT32) -{ - return GalSoundLatch; -} - -UINT8 BongoDipSwitchRead(UINT32) -{ - return GalInput[3] | GalDip[3]; -} - -UINT8 KonamiSoundLatchRead(UINT32) -{ - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return GalSoundLatch; -} - -UINT8 KonamiSoundTimerRead(UINT32) -{ - INT32 nActiveCPU = ZetGetActive(); - UINT32 Cycles; - - if (nActiveCPU == 1) { - Cycles = (ZetTotalCycles() * 8) % (UINT64)(16 * 16 * 2 * 8 * 5 * 2); - } else { - ZetClose(); - ZetOpen(1); - Cycles = (ZetTotalCycles() * 8) % (UINT64)(16 * 16 * 2 * 8 * 5 * 2); - ZetClose(); - ZetOpen(nActiveCPU); - } - - UINT8 HiBit = 0; - - if (Cycles >= 16 * 16 * 2 * 8 * 5) { - HiBit = 1; - Cycles -= 16 * 16 * 2 * 8 * 5; - } - - return (HiBit << 7) | (BIT(Cycles, 14) << 6) | (BIT(Cycles, 13) << 5) | (BIT(Cycles, 11) << 4) | 0x0e; -} - -UINT8 FroggerSoundTimerRead(UINT32) -{ - UINT8 KonamiValue = KonamiSoundTimerRead(0); - return BITSWAP08(KonamiValue, 7, 6, 3, 4, 5, 2, 1, 0); -} - -UINT8 HunchbksSoundTimerRead(UINT32) -{ - INT32 nActiveCPU = ZetGetActive(); - UINT32 Cycles; - - if (nActiveCPU == 0) { - Cycles = (ZetTotalCycles() * 8) % (UINT64)(16 * 16 * 2 * 8 * 5 * 2); - } else { - ZetOpen(0); - Cycles = (ZetTotalCycles() * 8) % (UINT64)(16 * 16 * 2 * 8 * 5 * 2); - ZetClose(); - } - - UINT8 HiBit = 0; - - if (Cycles >= 16 * 16 * 2 * 8 * 5) { - HiBit = 1; - Cycles -= 16 * 16 * 2 * 8 * 5; - } - - return (HiBit << 7) | (BIT(Cycles, 14) << 6) | (BIT(Cycles, 13) << 5) | (BIT(Cycles, 11) << 4) | 0x0e; -} - -void KonamiSoundLatchWrite(UINT8 d) -{ - GalSoundLatch = d; -} - -void KonamiSoundControlWrite(UINT8 d) -{ - UINT8 Old = KonamiSoundControl; - KonamiSoundControl = d; - - if ((Old & 0x08) && !(d & 0x08)) { - INT32 nActiveCPU = ZetGetActive(); - - if (nActiveCPU == 1) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(nActiveCPU); - } - } - - /* bit 4 is sound disable */ -// sound_global_enable(~data & 0x10); -} - -void HunchbksSoundControlWrite(UINT8 d) -{ - UINT8 Old = KonamiSoundControl; - KonamiSoundControl = d; - - HunchbksSoundIrqFire = 0; - - if ((Old & 0x08) && !(d & 0x08)) { - HunchbksSoundIrqFire = 1; - } - - /* bit 4 is sound disable */ -// sound_global_enable(~data & 0x10); -} - -void SfxSoundLatch2Write(UINT32, UINT32 d) -{ - GalSoundLatch2 = d & 0xff; -} - -void SfxSampleControlWrite(UINT32, UINT32 d) -{ - UINT8 Old = SfxSampleControl; - - d &= 0xff; - SfxSampleControl = d; - - if ((Old & 0x01) && !(d & 0x01)) { - INT32 nActiveCPU = ZetGetActive(); - - if (nActiveCPU == 2) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - nGalCyclesDone[2] += ZetRun(100); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - - } else { - ZetClose(); - ZetOpen(2); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - nGalCyclesDone[2] += ZetRun(100); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - ZetOpen(nActiveCPU); - } - } -} - -// Frogger Sound CPU Memory Map -static void filter_w(INT32 num, UINT8 d) -{ - INT32 C; - - C = 0; - if (d & 1) C += 220000; /* 220000pF = 0.220uF */ - if (d & 2) C += 47000; /* 47000pF = 0.047uF */ - filter_rc_set_RC(num, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(C)); -} - -UINT8 __fastcall FroggerSoundZ80Read(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall FroggerSoundZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0x6000 && a <= 0x6fff) { - INT32 Offset = a & 0xfff; - filter_w(0, (Offset >> 6) & 3); - filter_w(1, (Offset >> 8) & 3); - filter_w(2, (Offset >> 10) & 3); - return; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall FroggerSoundZ80PortRead(UINT16 a) -{ - a &= 0xff; - - UINT8 Result = 0xff; - if (a & 0x40) Result &= AY8910Read(0); - return Result; -} - -void __fastcall FroggerSoundZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a & 0x40) { - AY8910Write(0, 1, d); - } else { - if (a & 0x80) { - AY8910Write(0, 0, d); - } - } -} - -void FroggerSoundNoEncryptionInit() -{ - ZetOpen(1); - ZetSetReadHandler(FroggerSoundZ80Read); - ZetSetWriteHandler(FroggerSoundZ80Write); - ZetSetInHandler(FroggerSoundZ80PortRead); - ZetSetOutHandler(FroggerSoundZ80PortWrite); - ZetMapArea(0x0000, GalZ80Rom2Size - 1, 0, GalZ80Rom2); - ZetMapArea(0x0000, GalZ80Rom2Size - 1, 2, GalZ80Rom2); - ZetMapArea(0x4000, 0x43ff, 0, GalZ80Ram2); - ZetMapArea(0x4000, 0x43ff, 1, GalZ80Ram2); - ZetMapArea(0x4000, 0x43ff, 2, GalZ80Ram2); - ZetClose(); - - nGalCyclesTotal[1] = (14318000 / 8) / 60; -} - -void FroggerSoundInit() -{ - FroggerSoundNoEncryptionInit(); - - for (UINT32 Offset = 0; Offset < 0x0800; Offset++) GalZ80Rom2[Offset] = BITSWAP08(GalZ80Rom2[Offset], 7, 6, 5, 4, 3, 2, 0, 1); -} - -// Konami Sound CPU Memory Map -UINT8 __fastcall KonamiSoundZ80Read(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0xff; -} - -void __fastcall KonamiSoundZ80Write(UINT16 a, UINT8 d) -{ - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) { - if (a >= 0x9000 && a <= 0x9fff) { - INT32 Offset = a & 0xfff; - filter_w(0, (Offset >> 0) & 3); - filter_w(1, (Offset >> 2) & 3); - filter_w(2, (Offset >> 4) & 3); - filter_w(3, (Offset >> 6) & 3); - filter_w(4, (Offset >> 8) & 3); - filter_w(5, (Offset >> 10) & 3); - return; - } - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KonamiSoundZ80PortRead(UINT16 a) -{ - a &= 0xff; - - UINT8 Result = 0xff; - if (a & 0x20) Result &= AY8910Read(0); - if (a & 0x80) Result &= AY8910Read(1); - return Result; -} - -void __fastcall KonamiSoundZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a & 0x10) { - AY8910Write(0, 0, d); - } else { - if (a & 0x20) { - AY8910Write(0, 1, d); - } - } - - if (a & 0x40) { - AY8910Write(1, 0, d); - } else { - if (a & 0x80) { - AY8910Write(1, 1, d); - } - } -} - -void KonamiSoundInit() -{ - ZetOpen(1); - ZetSetReadHandler(KonamiSoundZ80Read); - ZetSetWriteHandler(KonamiSoundZ80Write); - ZetSetInHandler(KonamiSoundZ80PortRead); - ZetSetOutHandler(KonamiSoundZ80PortWrite); - ZetMapArea(0x0000, GalZ80Rom2Size - 1, 0, GalZ80Rom2); - ZetMapArea(0x0000, GalZ80Rom2Size - 1, 2, GalZ80Rom2); - ZetMapArea(0x8000, 0x83ff, 0, GalZ80Ram2); - ZetMapArea(0x8000, 0x83ff, 1, GalZ80Ram2); - ZetMapArea(0x8000, 0x83ff, 2, GalZ80Ram2); - ZetClose(); - - nGalCyclesTotal[1] = (14318000 / 8) / 60; -} - -void HunchbksSoundInit() -{ - ZetOpen(0); - ZetSetReadHandler(KonamiSoundZ80Read); - ZetSetWriteHandler(KonamiSoundZ80Write); - ZetSetInHandler(KonamiSoundZ80PortRead); - ZetSetOutHandler(KonamiSoundZ80PortWrite); - ZetMapArea(0x0000, GalZ80Rom1Size - 1, 0, GalZ80Rom1); - ZetMapArea(0x0000, GalZ80Rom1Size - 1, 2, GalZ80Rom1); - ZetMapArea(0x8000, 0x83ff, 0, GalZ80Ram1 + 0x400); - ZetMapArea(0x8000, 0x83ff, 1, GalZ80Ram1 + 0x400); - ZetMapArea(0x8000, 0x83ff, 2, GalZ80Ram1 + 0x400); - ZetMapArea(0x8400, 0x87ff, 0, GalZ80Ram1 + 0x400); - ZetMapArea(0x8400, 0x87ff, 1, GalZ80Ram1 + 0x400); - ZetMapArea(0x8400, 0x87ff, 2, GalZ80Ram1 + 0x400); - ZetMapArea(0x8800, 0x8bff, 0, GalZ80Ram1 + 0x400); - ZetMapArea(0x8800, 0x8bff, 1, GalZ80Ram1 + 0x400); - ZetMapArea(0x8800, 0x8bff, 2, GalZ80Ram1 + 0x400); - ZetMapArea(0x8c00, 0x8fff, 0, GalZ80Ram1 + 0x400); - ZetMapArea(0x8c00, 0x8fff, 1, GalZ80Ram1 + 0x400); - ZetMapArea(0x8c00, 0x8fff, 2, GalZ80Ram1 + 0x400); - ZetClose(); - - nGalCyclesTotal[1] = (14318000 / 8) / 60; -} - -// DAC handlers -INT32 KingballSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / ((nGalCyclesTotal[1] * 60.0000) / (nBurnFPS / 100.0000)))); -} - -INT32 SfxSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / ((nGalCyclesTotal[2] * 60.0000) / (nBurnFPS / 100.0000)))); -} - -// Galaxian samples -static void GalRenderShootSample(INT16 *pSoundBuf, INT32 nLength) -{ - double Addr = GalShootWavePos; - double Step = (double)GalShootRate / nBurnSoundRate; - - for (INT32 i = 0; i < nLength; i += 2) { - INT16 Sample = (INT16)(GalShootWave[(INT32)Addr] * SHOOT_VOLUME); - Sample >>= 4; - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((GalOutputDir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Sample * GalGain); - } - if ((GalOutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Sample * GalGain); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[i + 0] += nLeftSample; - pSoundBuf[i + 1] += nRightSample; - - Addr += Step; - } - - GalShootWavePos = Addr; - if (GalShootWavePos > GalShootLength) { - GalShootWavePos = 0; - GalShootEnable = 0; - } -} - -static void GalRenderNoiseSample(INT16 *pSoundBuf, INT32 nLength) -{ - double Addr = GalNoiseWavePos; - double Step = (double)NOISE_RATE / nBurnSoundRate; - - for (INT32 i = 0; i < nLength; i += 2) { - INT16 Sample = (INT16)(GalNoiseWave[(INT32)Addr] * (GalNoiseVolume / 100)); - Sample >>= 4; - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((GalOutputDir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Sample * GalGain); - } - if ((GalOutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Sample * GalGain); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[i + 0] += nLeftSample; - pSoundBuf[i + 1] += nRightSample; - - Addr += Step; - } - - GalNoiseWavePos = Addr; - if (GalNoiseWavePos > NOISE_LENGTH) { - GalNoiseWavePos = 0; - } -} - -static void GalRenderToneWave(INT16 *pSoundBuf, INT32 nLength) -{ - INT32 i,j; - INT16 *w = GalToneWave[GalVol]; - - if (GalPitch != 0xff) { - for (i = 0; i < nLength; i += 2) { - INT32 mix = 0; - - for (j = 0; j < STEPS; j++) { - if (GalCountDown >= 256) { - GalCounter = GalCounter + ((double)96000 / nBurnSoundRate); - if (GalCounter > TOOTHSAW_LENGTH) GalCounter = 0; - GalCountDown = GalPitch; - } - GalCountDown++; - - mix += w[(INT32)GalCounter]; - } - - INT16 Sample = mix / STEPS; - Sample >>= 4; - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((GalOutputDir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Sample * GalGain); - } - if ((GalOutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Sample * GalGain); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[i + 0] = nLeftSample; - pSoundBuf[i + 1] = nRightSample; - } - } -} - -static void GalRenderLfoWaveSample(INT32 nLfoWave, INT16 *pSoundBuf, INT32 nLength) -{ - INT32 nshHZ = 0; - - switch (nLfoWave) { - case 0: nshHZ = 470; break; - case 1: nshHZ = 330; break; - case 2: nshHZ = 220; break; - } - double Addr = GalLfoWavePos[nLfoWave]; - double Step = (double)(sizeof(GalBackgroundWave) * GalLfoFreq * (100 + 2 * nshHZ) / (100 + 2 * 470)) / nBurnSoundRate; - - for (INT32 i = 0; i < nLength; i += 2) { - INT16 Sample = (INT16)(GalBackgroundWave[(INT32)Addr] * (GalLfoVolume[nLfoWave] ? LFO_VOLUME : 0)); - Sample >>= 4; - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((GalOutputDir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Sample * GalGain); - } - if ((GalOutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Sample * GalGain); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[i + 0] += nLeftSample; - pSoundBuf[i + 1] += nRightSample; - - Addr += Step; - } - - GalLfoWavePos[nLfoWave] = Addr; - if (GalLfoWavePos[nLfoWave] > 32) { - GalLfoWavePos[nLfoWave] = 0; - } -} - -void GalRenderSoundSamples(INT16 *pSoundBuf, INT32 nLength) -{ - memset(pSoundBuf, 0, nLength * 2 * sizeof(INT16)); - - GalRenderToneWave(pSoundBuf, nLength); - GalRenderNoiseSample(pSoundBuf, nLength); - if (GalShootEnable) GalRenderShootSample(pSoundBuf, nLength); - GalRenderLfoWaveSample(0, pSoundBuf, nLength); - GalRenderLfoWaveSample(1, pSoundBuf, nLength); - GalRenderLfoWaveSample(2, pSoundBuf, nLength); -} - -void GalaxianSoundWrite(UINT32 Offset, UINT8 d) -{ - d &= 0x01; - - switch (Offset & 0x07) { - case 0x00: - case 0x01: - case 0x02: { - GalLfoVolume[Offset] = d; - return; - } - - case 0x03: { - GalNoiseEnable = d & 1; - if (GalNoiseEnable) { - GalNoiseVolume = 100; - GalNoiseWavePos = 0; - } - return; - } - - case 0x04: { - return; - } - - case 0x05: { - if (d & 1 && !(GalLastPort2 & 1) ) { - GalShootEnable = 1; - GalShootWavePos = 0; - } - GalLastPort2 = d; - return; - } - - case 0x06: - case 0x07: { - GalVol = (GalVol & ~(1 << (Offset & 0x01))) | ((d & 1) << (Offset & 0x01)); - return; - } - } -} - -void GalaxianLfoFreqWrite(UINT32 Offset, UINT8 d) -{ - double r0, r1, rx = 100000.0; - - if ((d & 0x01) == GalLfoBit[Offset]) return; - - GalLfoBit[Offset] = d & 0x01; - - r0 = 1.0 / 330000; - r1 = 1.0 / 1e12; - - if (GalLfoBit[0]) { - r1 += 1.0 / 1000000; - } else { - r0 += 1.0 / 1000000; - } - - if (GalLfoBit[1]) { - r1 += 1.0 / 470000; - } else { - r0 += 1.0 / 470000; - } - - if (GalLfoBit[2]) { - r1 += 1.0 / 220000; - } else { - r0 += 1.0 / 220000; - } - - if (GalLfoBit[3]) { - r1 += 1.0 / 100000; - } else { - r0 += 1.0 / 100000; - } - - r0 = 1.0 / r0; - r1 = 1.0 / r1; - - rx = rx + 2000000.0 * r0 / (r0 + r1); - - GalLfoFreqFrameVar = (1000000000 / ((MAXFREQ - MINFREQ) * 639 * rx)) * 100; - - bprintf(PRINT_NORMAL, _T("Offset %x, rx %f, %f\n"), Offset, (MAXFREQ - MINFREQ) * 639 * rx, GalLfoFreqFrameVar); -} - -void GalaxianSoundUpdateTimers() -{ - if (GetCurrentFrame() % 3) { - if (!GalNoiseEnable && GalNoiseVolume > 0) { - GalNoiseVolume -= (GalNoiseVolume / 10) + 1; - } - } - - if (GalLfoFreq > MINFREQ) { - GalLfoFreq -= GalLfoFreqFrameVar; - } else { - GalLfoFreq = MAXFREQ; - } -} diff --git a/jan/src/burn/drv/galaxian/gal_stars.cpp b/jan/src/burn/drv/galaxian/gal_stars.cpp deleted file mode 100644 index a63f0235c..000000000 --- a/jan/src/burn/drv/galaxian/gal_stars.cpp +++ /dev/null @@ -1,241 +0,0 @@ -#include "gal.h" - -// This module is not accurate to the arcade hardware - it is ported from my previous Galaxian driver for FBA, -// which was based on an old version of MAME. It is considered "good enough" for the purpose of giving the impression -// of the star layers without being totally accurate - -struct Star -{ - INT32 x, y, Colour; -}; - -static struct Star Stars[252]; - -INT32 GalStarsEnable = 0; -INT32 GalStarsScrollPos = 0; -INT32 GalStarsBlinkState = 0; -INT32 GalBlinkTimerStartFrame = 0; -static double GalBlinkEveryFrames = (0.693 * (100000 + 2.0 + 10000) * 0.00001) * (16000.0 / 132 / 2); - -void GalInitStars() -{ - INT32 nStars, Generator, x, y; - - GalStarsEnable = 0; - GalStarsScrollPos = -1; - GalStarsBlinkState = 0; - - nStars = 0; - Generator = 0; - - for (y = 255; y >= 0; y--) { - for (x = 511; x >= 0; x--) { - INT32 Bit0; - - Bit0 = ((~Generator >> 16) & 0x01) ^ ((Generator >> 4) & 0x01); - - Generator = (Generator << 1) | Bit0; - - if (((~Generator >> 16) & 0x01) && (Generator & 0xff) == 0xff) { - INT32 Colour; - - Colour = (~(Generator >> 8)) & 0x3f; - - if (Colour) { - Stars[nStars].x = x; - Stars[nStars].y = y; - Stars[nStars].Colour = Colour; - - nStars++; - } - } - } - } -} - -static INT32 GalCheckStarsBlinkState() -{ - INT32 CurrentFrame = GetCurrentFrame(); - - if ((CurrentFrame - GalBlinkTimerStartFrame) >= (INT32)GalBlinkEveryFrames) { - GalBlinkTimerStartFrame = CurrentFrame; - return 1; - } - - return 0; -} - -static inline void GalPlotStar(INT32 x, INT32 y, INT32 Colour) -{ - if (y >= 0 && y < nScreenHeight && x >= 0 && x < nScreenWidth) { - pTransDraw[(y * nScreenWidth) + x] = Colour + GAL_PALETTE_STARS_OFFSET; - } -} - -void GalaxianRenderStarLayer() -{ - GalStarsScrollPos++; - - for (INT32 Offs = 0; Offs < 252; Offs++) { - INT32 x, y; - - x = ((Stars[Offs].x + GalStarsScrollPos) & 0x01ff) >>1; - y = (Stars[Offs].y + ((GalStarsScrollPos + Stars[Offs].x) >> 9)) & 0xff; - - if ((y & 0x01) ^ ((x >> 3) & 0x01)) { - if (GalFlipScreenX) x = 255 - x; - if (GalFlipScreenY) y = 255 - y; - y -= 16; - GalPlotStar(x, y, Stars[Offs].Colour); - } - } -} - -void JumpbugRenderStarLayer() -{ - if (GalCheckStarsBlinkState()) GalStarsBlinkState++; - - for (INT32 Offs = 0; Offs < 252; Offs++) { - INT32 x, y; - - x = Stars[Offs].x >> 1; - y = Stars[Offs].y >> 1; - - if ((y & 0x01) ^ ((x >> 3) & 0x01)) { - switch (GalStarsBlinkState & 0x03) { - case 0: { - if (!(Stars[Offs].Colour & 0x01)) continue; - break; - } - - case 1: { - if (!(Stars[Offs].Colour & 0x04)) continue; - break; - } - - case 2: { - if (!(Stars[Offs].y & 0x02)) continue; - break; - } - - case 3: { - break; - } - } - - x = Stars[Offs].x >> 1; - y = Stars[Offs].y & 0xff; - - if (x >= 240) continue; - - if (GalFlipScreenX) x = 255 - x; - if (GalFlipScreenY) y = 255 - y; - y -= 16; - GalPlotStar(x, y, Stars[Offs].Colour); - } - } -} - -void ScrambleRenderStarLayer() -{ - if (GalCheckStarsBlinkState()) GalStarsBlinkState++; - - for (INT32 Offs = 0; Offs < 252; Offs++) { - INT32 x, y; - - x = Stars[Offs].x >> 1; - y = Stars[Offs].y; - - if ((y & 0x01) ^ ((x >> 3) & 0x01)) { - switch (GalStarsBlinkState & 0x03) { - case 0: { - if (!(Stars[Offs].Colour & 0x01)) continue; - break; - } - - case 1: { - if (!(Stars[Offs].Colour & 0x04)) continue; - break; - } - - case 2: { - if (!(Stars[Offs].y & 0x02)) continue; - break; - } - - case 3: { - break; - } - } - - if (GalFlipScreenX) x = 255 - x; - if (GalFlipScreenY) y = 255 - y; - y -= 16; - GalPlotStar(x, y, Stars[Offs].Colour); - } - } -} - -void MarinerRenderStarLayer() -{ - UINT8 *Prom = GalProm + 0x120; - - GalStarsScrollPos++; - - for (INT32 Offs = 0; Offs < 252; Offs++) { - INT32 x, y; - - x = ((Stars[Offs].x + GalStarsScrollPos) & 0x01ff) >>1; - y = (Stars[Offs].y + ((GalStarsScrollPos + Stars[Offs].x) >> 9)) & 0xff; - - if ((y & 0x01) ^ ((x >> 3) & 0x01)) { - if (GalFlipScreenX) x = 255 - x; - if (GalFlipScreenY) y = 255 - y; - y -= 16; - - if (Prom[((x / 8) + 1) & 0x1f] & 0x04) { - GalPlotStar(x, y, Stars[Offs].Colour); - } - } - } -} - -void RescueRenderStarLayer() -{ - if (GalCheckStarsBlinkState()) GalStarsBlinkState++; - - for (INT32 Offs = 0; Offs < 252; Offs++) { - INT32 x, y; - - x = Stars[Offs].x >> 1; - y = Stars[Offs].y; - - if (x < 128 && ((y & 0x01) ^ ((x >> 3) & 0x01))) { - switch (GalStarsBlinkState & 0x03) { - case 0: { - if (!(Stars[Offs].Colour & 0x01)) continue; - break; - } - - case 1: { - if (!(Stars[Offs].Colour & 0x04)) continue; - break; - } - - case 2: { - if (!(Stars[Offs].y & 0x02)) continue; - break; - } - - case 3: { - break; - } - } - - if (GalFlipScreenX) x = 255 - x; - if (GalFlipScreenY) y = 255 - y; - y -= 16; - GalPlotStar(x, y, Stars[Offs].Colour); - } - } -} diff --git a/jan/src/burn/drv/irem/d_m107.cpp b/jan/src/burn/drv/irem/d_m107.cpp deleted file mode 100644 index d23c12256..000000000 --- a/jan/src/burn/drv/irem/d_m107.cpp +++ /dev/null @@ -1,1573 +0,0 @@ -// FB Alpha Irem M107 system driver -// Based on MAME driver by Bryan McPhail -// Based on port of M92 driver from MAME by OopsWare - -#include "tiles_generic.h" -#include "burn_ym2151.h" -#include "nec_intf.h" -#include "irem_cpu.h" -#include "iremga20.h" - -static UINT8 *Mem; -static UINT8 *MemEnd; -static UINT8 *RamStart; -static UINT8 *RamEnd; -static UINT8 *DrvV33ROM; -static UINT8 *DrvV30ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSprTable; -static UINT8 *DrvSndROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvV33RAM; -static UINT8 *DrvV30RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPalRAM; -static UINT8 *RamPrioBitmap; - -static UINT32 *DrvPalette; -static UINT8 bRecalcPalette; - -static UINT8 *pf_control[4]; -static UINT8 *sound_status; -static UINT8 *sound_latch; - -static INT32 sprite_enable; -static INT32 raster_irq_position; -static INT32 sound_cpu_reset; - -static INT32 nBankswitchData; -static INT32 has_bankswitch = 0; - -static UINT8 DrvButton[8]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvInput[8]; -static UINT8 DrvReset; - -static INT32 config_cpu_speed; -static INT32 spritesystem; -static INT32 vblank; -static INT32 irq_vectorbase; -static INT32 graphics_mask[2]; -static INT32 nPrevScreenPos = 0; - -typedef struct _m107_layer m107_layer; -struct _m107_layer -{ - INT32 enable; - INT32 wide; - INT32 enable_rowscroll; - - UINT16 scrollx; - UINT16 scrolly; - - UINT16 *scroll; - UINT16 *vram; -}; - -static struct _m107_layer *m107_layers[4]; - -enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, V30_ASSERT, V30_CLEAR }; - -static struct BurnInputInfo FirebarrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvButton + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvButton + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 5, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 6, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInput + 7, "dip" }, -}; - -STDINPUTINFO(Firebarr) - -static struct BurnInputInfo Dsoccr94InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvButton + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" } , - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 4, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 3, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 2, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 0, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 7, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy4 + 5, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 4, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 3, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 2, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 0, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 6, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvButton + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 5, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 6, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInput + 7, "dip" }, -}; - -STDINPUTINFO(Dsoccr94) - -static struct BurnDIPInfo FirebarrDIPList[]= -{ - {0x14, 0xff, 0xff, 0xfb, NULL }, - {0x15, 0xff, 0xff, 0xa3, NULL }, - {0x16, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Rapid Fire" }, - {0x14, 0x01, 0x0c, 0x00, "Button 1 Normal, Button 3 Rapid Fire" }, - {0x14, 0x01, 0x0c, 0x04, "Button 1 Rapid Fire, Button 3 No Function" }, - {0x14, 0x01, 0x0c, 0x08, "Off" }, - {0x14, 0x01, 0x0c, 0x0c, "Off" }, - - {0 , 0xfe, 0 , 2, "Continuous Play" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x00, "2" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x20, 0x00, "No" }, - {0x15, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x16, 0x01, 0x04, 0x04, "Common" }, - {0x16, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x16, 0x01, 0x08, 0x08, "1" }, - {0x16, 0x01, 0x08, 0x00, "2" }, - - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x16, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x16, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x16, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x16, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x16, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x16, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -}; - -STDDIPINFO(Firebarr) - -static struct BurnDIPInfo Dsoccr94DIPList[]= -{ - {0x24, 0xff, 0xff, 0xff, NULL }, - {0x25, 0xff, 0xff, 0xbf, NULL }, - {0x26, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x25, 0x01, 0x03, 0x00, "1:30" }, - {0x25, 0x01, 0x03, 0x03, "2:00" }, - {0x25, 0x01, 0x03, 0x02, "2:30" }, - {0x25, 0x01, 0x03, 0x01, "3:00" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x25, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x25, 0x01, 0x0c, 0x08, "Easy" }, - {0x25, 0x01, 0x0c, 0x0c, "Normal" }, - {0x25, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Game Mode" }, - {0x25, 0x01, 0x10, 0x10, "Match Mode" }, - {0x25, 0x01, 0x10, 0x00, "Power Mode" }, - - {0 , 0xfe, 0 , 2, "Starting Button" }, - {0x25, 0x01, 0x20, 0x00, "Button 1" }, - {0x25, 0x01, 0x20, 0x20, "Start Button" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x25, 0x01, 0x40, 0x40, "Off" }, - {0x25, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x25, 0x01, 0x80, 0x80, "Off" }, - {0x25, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x26, 0x01, 0x01, 0x01, "Off" }, - {0x26, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x26, 0x01, 0x04, 0x04, "Common" }, - {0x26, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x26, 0x01, 0x08, 0x08, "1" }, - {0x26, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x26, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x26, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x26, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x26, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x26, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x26, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x26, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x26, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x26, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x26, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x26, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x26, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x26, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x26, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x26, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x26, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x26, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x26, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x26, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x26, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x26, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x26, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x26, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x26, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -}; - -STDDIPINFO(Dsoccr94) - -inline static UINT32 CalcCol(INT32 offs) -{ - INT32 nColour = DrvPalRAM[offs + 0] | (DrvPalRAM[offs + 1] << 8); - INT32 r, g, b; - - r = (nColour & 0x001F) << 3; - r |= r >> 5; - g = (nColour & 0x03E0) >> 2; - g |= g >> 5; - b = (nColour & 0x7C00) >> 7; - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -static void m107Bankswitch(INT32 data) -{ - INT32 bank = 0x80000 + ((data >> 1) & 0x03) * 0x20000; - - nBankswitchData = data; - - VezMapArea(0xa0000, 0xbffff, 0, DrvV33ROM + bank); - VezMapArea(0xa0000, 0xbffff, 2, DrvV33ROM + bank); -} - -static void m107YM2151IRQHandler(INT32 nStatus) -{ - if (VezGetActive() == -1) return; - - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP0, 0xff/*default*/, nStatus ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - VezRun(100); -} - -static UINT8 __fastcall m107ReadByte(UINT32 address) -{ - switch (address) - { - case 0xf0000: - case 0xf0001: - case 0xf0002: - case 0xf0003: - case 0xf0004: - case 0xf0005: - return 0x00; // wpksoc - } - -// bprintf (0, _T("rb: %5.5x\n"), address); - - return 0; -} - -static void __fastcall m107WriteByte(UINT32 address, UINT8 data) -{ - if ((address & 0xff000) == 0xf9000 ) { - DrvPalRAM[ address - 0xf9000] = data; - if (address & 1) { - INT32 offs = (address - 0xf9000) >> 1; - DrvPalette[offs] = CalcCol( offs << 1 ); - } - return; - } - -// bprintf (0, _T("wb: %5.5x, %2.2x\n"), address, data); -} - -static UINT8 __fastcall m107ReadPort(UINT32 port) -{ -// bprintf (0, _T("Rp: %2.2x\n"), port & 0xff); - - switch (port) - { - case 0x00: return DrvInput[0]; - case 0x01: return DrvInput[1]; - case 0x02: return (DrvInput[4] & 0x7f) | vblank; - case 0x03: return DrvInput[7]; - case 0x04: return DrvInput[5]; - case 0x05: return DrvInput[6]; - case 0x06: return DrvInput[2]; - case 0x07: return DrvInput[3]; - - case 0x08: VezSetIRQLineAndVector(0, (irq_vectorbase + 12)/4, CPU_IRQSTATUS_NONE); return sound_status[0]; - case 0x09: VezSetIRQLineAndVector(0, (irq_vectorbase + 12)/4, CPU_IRQSTATUS_NONE); return sound_status[1]; - - case 0x18: return 0; - - case 0xc0: - return 0x02; // wpksoc - required to boot? - - case 0xc1: - return 0x02; // - - case 0xc2: - case 0xc3: - return 0x00; // wpksoc - - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to read byte value of port %x\n"), port); - } - return 0; -} - -static void set_pf_info(INT32 layer) -{ - struct _m107_layer *ptr = m107_layers[layer]; - - INT32 data = (pf_control[layer][5] << 8) + pf_control[layer][4]; - - ptr->enable = (~data >> 7) & 1; - ptr->vram = (UINT16*)(DrvVidRAM + (((data >> 8) & 0x0f) * 0x1000)); - ptr->enable_rowscroll = data & 0x03; -} - -static void set_pf_scroll(INT32 layer) -{ - struct _m107_layer *ptr = m107_layers[layer]; - - ptr->scrollx = (pf_control[layer][2] << 0) | (pf_control[layer][3] << 8); - ptr->scrolly = (pf_control[layer][0] << 0) | (pf_control[layer][1] << 8); -} - -static void __fastcall m107WritePort(UINT32 port, UINT8 data) -{ -// bprintf (0, _T("wp: %2.2x, %2.2x\n"), port & 0xff, data); - - switch (port) - { - case 0x00: - sound_latch[0] = data; - VezClose(); - VezOpen(1); - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP1, 0xff/*default*/, CPU_IRQSTATUS_ACK); - VezRun(10); - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP1, 0xff/*default*/, CPU_IRQSTATUS_NONE); - VezRun(10); - VezClose(); - VezOpen(0); - return; - - case 0x02: - case 0x03: - //m107_coincounter_w - return; - - case 0x06: - if (has_bankswitch) { - m107Bankswitch(data); - } - return; - - case 0x80: pf_control[0][0] = data; set_pf_scroll(0); return; - case 0x81: pf_control[0][1] = data; set_pf_scroll(0); return; - case 0x82: pf_control[0][2] = data; set_pf_scroll(0); return; - case 0x83: pf_control[0][3] = data; set_pf_scroll(0); return; - case 0x84: pf_control[1][0] = data; set_pf_scroll(1); return; - case 0x85: pf_control[1][1] = data; set_pf_scroll(1); return; - case 0x86: pf_control[1][2] = data; set_pf_scroll(1); return; - case 0x87: pf_control[1][3] = data; set_pf_scroll(1); return; - case 0x88: pf_control[2][0] = data; set_pf_scroll(2); return; - case 0x89: pf_control[2][1] = data; set_pf_scroll(2); return; - case 0x8a: pf_control[2][2] = data; set_pf_scroll(2); return; - case 0x8b: pf_control[2][3] = data; set_pf_scroll(2); return; - case 0x8c: pf_control[3][0] = data; set_pf_scroll(3); return; - case 0x8d: pf_control[3][1] = data; set_pf_scroll(3); return; - case 0x8e: pf_control[3][2] = data; set_pf_scroll(3); return; - case 0x8f: pf_control[3][3] = data; set_pf_scroll(3); return; - case 0x90: pf_control[0][4] = data; return; - case 0x91: pf_control[0][5] = data; set_pf_info(0); return; - case 0x92: pf_control[1][4] = data; return; - case 0x93: pf_control[1][5] = data; set_pf_info(1); return; - case 0x94: pf_control[2][4] = data; return; - case 0x95: pf_control[2][5] = data; set_pf_info(2); return; - case 0x96: pf_control[3][4] = data; return; - case 0x97: pf_control[3][5] = data; set_pf_info(3); return; - case 0x98: pf_control[0][6] = data; return; - case 0x99: pf_control[0][7] = data; return; - case 0x9a: pf_control[1][6] = data; return; - case 0x9b: pf_control[1][7] = data; return; - case 0x9c: pf_control[2][6] = data; return; - case 0x9d: pf_control[2][7] = data; return; - case 0x9e: pf_control[3][6] = data; - raster_irq_position = ((pf_control[3][7]<<8) | pf_control[3][6]) - 128; - return; - case 0x9f: pf_control[3][7] = data; - raster_irq_position = ((pf_control[3][7]<<8) | pf_control[3][6]) - 128; - return; - - case 0xb0: - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - return; - - case 0xb1: - sprite_enable = ~data & 0x10; - return; - - case 0xc0: - case 0xc1:// sound reset - VezClose(); - VezOpen(1); - sound_cpu_reset = (data) ? 0 : 1; - if (sound_cpu_reset) { - VezReset(); - } - VezClose(); - VezOpen(0); - return; - - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to port %x\n"), data, port); - } -} - -static UINT8 __fastcall m107SndReadByte(UINT32 address) -{ - if ((address & 0xfffc0) == 0xa8000) { - return iremga20_read( 0, (address & 0x0003f) / 2 ); - } - - switch (address) - { - case 0xa8042: - return BurnYM2151ReadStatus(); - - case 0xa8044: - return sound_latch[0]; - - case 0xa8045: - return 0xff; // soundlatch high bits, always 0xff - - // default: - // bprintf(PRINT_NORMAL, _T("V30 Attempt to read byte value of location %x\n"), address); - } - return 0; -} - -static void __fastcall m107SndWriteByte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffc0) == 0xa8000) { - iremga20_write( 0, (address & 0x0003f) / 2, data ); - return; - } - - switch (address) - { - case 0xa8040: - BurnYM2151SelectRegister(data); - return; - - case 0xa8042: - BurnYM2151WriteRegister(data); - return; - - case 0xa8044: - // VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP1, 0xff/*default*/, CPU_IRQSTATUS_NONE); - return; - - case 0xa8046: - sound_status[0] = data; - VezClose(); - VezOpen(0); - VezSetIRQLineAndVector(0, (irq_vectorbase + 12)/4, CPU_IRQSTATUS_ACK); - VezClose(); - VezOpen(1); - return; - - // default: - // bprintf(PRINT_NORMAL, _T("V30 Attempt to write byte value %x to location %x\n"), data, address); - } -} - -static INT32 DrvDoReset() -{ - memset (RamStart, 0, RamEnd - RamStart); - - VezOpen(0); - VezReset(); - if (has_bankswitch) m107Bankswitch(0); - VezClose(); - - VezOpen(1); - VezReset(); - VezClose(); - - BurnYM2151Reset(); - iremga20_reset(0); - - for (INT32 i = 0; i < 4; i++) - { - set_pf_info(i); - set_pf_scroll(i); - } - - sprite_enable = 0; - raster_irq_position = -1; - sound_cpu_reset = 0; - - return 0; -} - -static INT32 MemIndex(INT32 gfxlen1, INT32 gfxlen2) -{ - UINT8 *Next; Next = Mem; - DrvV33ROM = Next; Next += 0x100000; - DrvV30ROM = Next; Next += 0x020000; - DrvGfxROM0 = Next; Next += gfxlen1 * 2; - DrvGfxROM1 = Next; Next += gfxlen2 * 2; - - if (spritesystem == 1) { - DrvSprTable = Next; Next += 0x040000; - } - - DrvSndROM = Next; Next += 0x100000; - - RamPrioBitmap = Next; Next += 320 * 240; - - RamStart = Next; - - DrvSprRAM = Next; Next += 0x001000; - DrvSprBuf = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x010000; - DrvV33RAM = Next; Next += 0x010000; - DrvV30RAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x001000; - - sound_status = Next; Next += 0x000004; // 2 - sound_latch = Next; Next += 0x000004; // 1 - - pf_control[0] = Next; Next += 0x000008; - pf_control[1] = Next; Next += 0x000008; - pf_control[2] = Next; Next += 0x000008; - pf_control[3] = Next; Next += 0x000008; - - m107_layers[0] = (struct _m107_layer*)Next; Next += sizeof(struct _m107_layer); - m107_layers[1] = (struct _m107_layer*)Next; Next += sizeof(struct _m107_layer); - m107_layers[2] = (struct _m107_layer*)Next; Next += sizeof(struct _m107_layer); - m107_layers[3] = (struct _m107_layer*)Next; Next += sizeof(struct _m107_layer); - - RamEnd = Next; - - DrvPalette = (UINT32 *) Next; Next += 0x0800 * sizeof(UINT32); - - MemEnd = Next; - return 0; -} - -static void DrvGfxExpand(UINT8 *rom, INT32 len, INT32 type) -{ - INT32 Plane0[4] = { 8, 0, 24, 16 }; - INT32 XOffs0[8] = { STEP8(0,1) }; - INT32 YOffs0[8] = { STEP8(0,32) }; - INT32 Plane1[4] = { RGN_FRAC(len, 3,4), RGN_FRAC(len, 2,4), RGN_FRAC(len,1,4), RGN_FRAC(len,0,4) }; - INT32 XOffs1[16] = { STEP8(0,1), STEP8(128,1) }; - INT32 YOffs1[16] = { STEP16(0,8) }; - INT32 XOffs2[16] = { STEP8(8,1), STEP8(0,1) }; - INT32 YOffs2[16] = { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return; - } - - memcpy (tmp, rom, len); - - if (type == 0) GfxDecode((len * 2) / 0x040, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x100, tmp, rom); - if (type == 1) GfxDecode((len * 2) / 0x100, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, rom); - if (type == 2) GfxDecode((len * 2) / 0x100, 4, 16, 16, Plane1, XOffs2, YOffs2, 0x100, tmp, rom); - - BurnFree(tmp); -} - -static INT32 DrvInit(INT32 (*pRomLoadCallback)(), const UINT8 *sound_decrypt_table, INT32 gfxdecode, INT32 vectorbase, INT32 gfxlen1, INT32 gfxlen2) -{ - Mem = NULL; - MemIndex(gfxlen1, gfxlen2); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(gfxlen1, gfxlen2); - - if (pRomLoadCallback) - { - if (pRomLoadCallback()) return 1; - - DrvGfxExpand(DrvGfxROM0, gfxlen1, 0); - DrvGfxExpand(DrvGfxROM1, gfxlen2, gfxdecode); - } - - { - VezInit(0, V33_TYPE); - VezInit(1, V35_TYPE, 14318180 /*before divider*/); - - VezOpen(0); - VezMapArea(0x00000, 0x9ffff, 0, DrvV33ROM); - VezMapArea(0x00000, 0x9ffff, 2, DrvV33ROM); - VezMapArea(0xa0000, 0xbffff, 0, DrvV33ROM + 0xa0000); - VezMapArea(0xa0000, 0xbffff, 2, DrvV33ROM + 0xa0000); - VezMapArea(0xd0000, 0xdffff, 0, DrvVidRAM); - VezMapArea(0xd0000, 0xdffff, 1, DrvVidRAM); - VezMapArea(0xd0000, 0xdffff, 2, DrvVidRAM); - VezMapArea(0xe0000, 0xeffff, 0, DrvV33RAM); - VezMapArea(0xe0000, 0xeffff, 1, DrvV33RAM); - VezMapArea(0xe0000, 0xeffff, 2, DrvV33RAM); - VezMapArea(0xf8000, 0xf8fff, 0, DrvSprRAM); - VezMapArea(0xf8000, 0xf8fff, 1, DrvSprRAM); - VezMapArea(0xf9000, 0xf9fff, 0, DrvPalRAM); - VezMapArea(0xff800, 0xfffff, 0, DrvV33ROM + 0x7f800); - VezMapArea(0xff800, 0xfffff, 2, DrvV33ROM + 0x7f800); - VezSetReadHandler(m107ReadByte); - VezSetWriteHandler(m107WriteByte); - VezSetReadPort(m107ReadPort); - VezSetWritePort(m107WritePort); - VezClose(); - - VezOpen(1); - if (sound_decrypt_table != NULL) { - VezSetDecode((UINT8*)sound_decrypt_table); - } - VezMapArea(0x00000, 0x1ffff, 0, DrvV30ROM); - VezMapArea(0x00000, 0x1ffff, 2, DrvV30ROM); - VezMapArea(0xa0000, 0xa3fff, 0, DrvV30RAM); - VezMapArea(0xa0000, 0xa3fff, 1, DrvV30RAM); - VezMapArea(0xa0000, 0xa3fff, 2, DrvV30RAM); - VezMapArea(0xff800, 0xfffff, 0, DrvV30ROM + 0x1f800); - VezMapArea(0xff800, 0xfffff, 2, DrvV30ROM + 0x1f800); - VezSetReadHandler(m107SndReadByte); - VezSetWriteHandler(m107SndWriteByte); - VezClose(); - } - - graphics_mask[0] = ((gfxlen1 * 2) - 1) / (8 * 8); - graphics_mask[1] = ((gfxlen2 * 2) - 1) / (16 * 16); - - irq_vectorbase = vectorbase; - - BurnYM2151Init(3579545); - YM2151SetIrqHandler(0, &m107YM2151IRQHandler); - BurnYM2151SetAllRoutes(0.40, BURN_SND_ROUTE_BOTH); - - iremga20_init(0, DrvSndROM, 0x100000, 3579545); - itemga20_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2151Exit(); - iremga20_exit(); - - VezExit(); - - BurnFree(Mem); - - nPrevScreenPos = 0; - has_bankswitch = 0; - - return 0; -} - -static void RenderTilePrio(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, UINT8 *pri, INT32 prio) -{ - if (sx <= (0-width) || sx >= nScreenWidth || sy <= (0-height) || sy >= nScreenHeight) return; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - if (pxl == 0) continue; - - if ((prio & (1 << pri[sy * nScreenWidth + sx])) == 0 && pri[sy * nScreenWidth + sx] < 0x80) { - dest[sy * nScreenWidth + sx] = pxl | color; - pri[sy * nScreenWidth + sx] |= 0x80; - } - } - - sx -= width; - } -} - -static void draw_sprites() -{ - if (sprite_enable == 0) return; - - UINT16 *ram = (UINT16*)DrvSprBuf; - int offs; - UINT8 *rom = DrvSprTable; - - for (offs = 0;offs < 0x800;offs += 4) - { - int x,y,sprite,colour,fx,fy,y_multi,i,s_ptr,pri_mask; - - pri_mask = (!(ram[offs+2]&0x80)) ? 2 : 0; - - y=ram[offs+0] + 8; - x=ram[offs+3]; - x&=0x1ff; - y&=0x1ff; - - if (x==0 || y==0) continue; /* offscreen */ - - sprite=ram[offs+1]&0x7fff; - - x = x - 16; - y = 384 - 16 - y; - - colour=ram[offs+2]&0x7f; - fx=(ram[offs+2]>>8)&0x1; - fy=(ram[offs+2]>>8)&0x2; - y_multi=(ram[offs+0]>>11)&0x3; - - if (spritesystem == 0) - { - y_multi=1 << y_multi; /* 1, 2, 4 or 8 */ - - s_ptr = 0; - if (!fy) s_ptr+=y_multi-1; - - for (i=0; i>1)&0x3); - if (fx) xdisp = -xdisp-16; - if (fy) ydisp = -ydisp - (16*y_multi-1); - if (!ffy) sprite+=y_multi-1; - for (i=0; ienable == 0) return; - - INT32 wide = 64; - INT32 scrolly = (ptr->scrolly + 136) & 0x1ff; - INT32 scrollx = ((ptr->scrollx) + 80) + (3 - 2 * layer); - - INT32 transparency = (forcelayer & 2) ? ~0 : 0; - INT32 priority = forcelayer & 1; - - UINT16 *xscroll = (UINT16*)(DrvVidRAM + (0xe000 + 0x200 * layer)); - UINT16 *yscroll = (UINT16*)(DrvVidRAM + (0xe800 + 0x200 * layer)); - - for (INT32 sy = start; sy < finish; sy++) - { - UINT16 *dest = pTransDraw + (sy * nScreenWidth); - UINT8 *pri = RamPrioBitmap + (sy * nScreenWidth); - - INT32 scrolly_1 = (scrolly + sy) & 0x1ff; - if (ptr->enable_rowscroll & 2) scrolly_1 = (scrolly_1 + BURN_ENDIAN_SWAP_INT16(yscroll[sy+8])) & 0x1ff; - - INT32 scrollx_1 = scrollx; - if (ptr->enable_rowscroll & 1) scrollx_1 = (scrollx_1 + BURN_ENDIAN_SWAP_INT16(xscroll[((scrolly_1 + 136 + 0xff80)-(scrolly)) & 0x1ff])) & 0x1ff; - - INT32 romoff_1 = (scrolly_1 & 0x07) << 3; - - for (INT32 sx = 0; sx < nScreenWidth + 8; sx+=8) - { - INT32 sxx = (scrollx_1 + sx) & 0x1ff; - - INT32 offs = ((scrolly_1 / 8) * wide) + (((sxx) / 8) & (wide - 1)); - - INT32 attr = BURN_ENDIAN_SWAP_INT16(ptr->vram[(offs * 2) + 1]); - - INT32 group = (attr >> 9) & 1; - - if (priority == group) - { - INT32 code = BURN_ENDIAN_SWAP_INT16(ptr->vram[(offs * 2) + 0]) | ((attr & 0x1000) << 4); - - if (code == 0 && transparency == 0) continue; // skip blank tiles - - INT32 color = (attr & 0x007f) << 4; - - INT32 x_xor = 0; - INT32 romoff = romoff_1; - if (attr & 0x0800) romoff ^= 0x38; // flipy - if (attr & 0x0400) x_xor = 7; // flipx - - UINT8 *rom = DrvGfxROM0 + ((code & graphics_mask[0]) * 0x40) + romoff; - - INT32 xx = sx - (scrollx_1&0x7); - - for (INT32 x = 0; x < 8; x++, xx++) { - if (xx < 0 || xx >= nScreenWidth) continue; - - INT32 pxl = rom[x ^ x_xor]; - if (pxl == transparency) continue; - - dest[xx] = pxl | color; - pri[xx] = group; - } - } - } - } -} - -static void DrawLayers(INT32 start, INT32 finish) -{ - memset (RamPrioBitmap + (start * nScreenWidth), 0, nScreenWidth * (finish - start)); // clear priority - - if (~pf_control[3][4] & 0x80) { - - if (~nBurnLayer & 8) memset (pTransDraw + (start * nScreenWidth), 0, nScreenWidth * (finish - start) * sizeof(INT16)); - - if (nBurnLayer & 8) draw_layer_byline(start, finish, 3, 0|2); - if (nBurnLayer & 8) draw_layer_byline(start, finish, 3, 1|2); - - if (nBurnLayer & 4) draw_layer_byline(start, finish, 2, 0); - } else { - if (~nBurnLayer & 4) memset (pTransDraw + (start * nScreenWidth), 0, nScreenWidth * (finish - start) * sizeof(INT16)); - - if (nBurnLayer & 4) draw_layer_byline(start, finish, 2, 0 | 2); - } - - if (nBurnLayer & 2) draw_layer_byline(start, finish, 1, 0); - if (nBurnLayer & 1) draw_layer_byline(start, finish, 0, 0); - if (nSpriteEnable & 4) draw_layer_byline(start, finish, 2, 1); - if (nSpriteEnable & 2) draw_layer_byline(start, finish, 1, 1); - if (nSpriteEnable & 1) draw_layer_byline(start, finish, 0, 1); -} - -static INT32 DrvDraw() -{ - if (bRecalcPalette) { - for (INT32 i=0; i<0x800;i++) - DrvPalette[i] = CalcCol(i<<1); - bRecalcPalette = 0; - } -// DrawLayers(0, nScreenHeight); - - if (nBurnLayer & 8) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvReDraw() -{ - if (bRecalcPalette) { - for (INT32 i=0; i<0x800;i++) - DrvPalette[i] = CalcCol(i<<1); - bRecalcPalette = 0; - } - - BurnTransferClear(); - - DrawLayers(0, nScreenHeight); - - if (nBurnLayer & 8) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void scanline_interrupts(INT32 scanline) -{ - if (scanline == raster_irq_position) { - - if (scanline>=8 && scanline < 248 && nPrevScreenPos != (scanline-8)+1) { - if (nPrevScreenPos >= 0 && nPrevScreenPos <= 239) - DrawLayers(nPrevScreenPos, (scanline-8)+1); - nPrevScreenPos = (scanline-8)+1; - } - - VezSetIRQLineAndVector(0, (irq_vectorbase + 8)/4, CPU_IRQSTATUS_ACK); - VezRun(10); - VezSetIRQLineAndVector(0, (irq_vectorbase + 8)/4, CPU_IRQSTATUS_NONE); - - } - else if (scanline == 248) // vblank - { - vblank = 0; - - if (nPrevScreenPos != 240) { - DrawLayers(nPrevScreenPos, 240); - } - nPrevScreenPos = 0; - - if (pBurnDraw) { - DrvDraw(); - // DrvReDraw(); - } - - VezSetIRQLineAndVector(0, (irq_vectorbase + 0)/4, CPU_IRQSTATUS_ACK); - VezRun(10); - VezSetIRQLineAndVector(0, (irq_vectorbase + 0)/4, CPU_IRQSTATUS_NONE); - } else if (scanline == 8) { - vblank = 0x80; - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - VezNewFrame(); - - { - memset (DrvInput, 0xff, 5); - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] ^= (DrvJoy1[i] & 1) << i; - DrvInput[1] ^= (DrvJoy2[i] & 1) << i; - DrvInput[2] ^= (DrvJoy3[i] & 1) << i; - DrvInput[3] ^= (DrvJoy4[i] & 1) << i; - DrvInput[4] ^= (DrvButton[i] & 1) << i; - } - } - - INT32 nInterleave = 256; // scanlines - INT32 nCyclesTotal[2] = { 0, 0 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - INT32 nSoundBufferPos = 0; - nCyclesTotal[0] = (INT32)((INT64)(config_cpu_speed / 60) * nBurnCPUSpeedAdjust / 0x0100); - nCyclesTotal[1] = (INT32)((INT64)(7159090 / 60) * nBurnCPUSpeedAdjust / 0x0100); - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); - } - - nInterleave = 256 * 8; // * 8 for tight sync - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - VezOpen(0); - INT32 segment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += VezRun(segment); - if ((i&7)==7) scanline_interrupts(i/8); // update at hblank? - - segment = (VezTotalCycles() * 7159) / (config_cpu_speed / 1000); - - VezClose(); - - VezOpen(1); - - { - if (sound_cpu_reset) { - VezIdle(segment - VezTotalCycles()); - } else { - nCyclesDone[1] += VezRun(segment - VezTotalCycles()); - } - } - - if (pBurnSoundOut && (i&7)==7) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - BurnYM2151Render(pSoundBuf, nSegmentLength); - iremga20_update(0, pSoundBuf, nSegmentLength); - - nSoundBufferPos += nSegmentLength; - } - - VezClose(); - } - - VezOpen(1); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - iremga20_update(0, pSoundBuf, nSegmentLength); - } - } - - VezClose(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin) - { - *pnMin = 0x029671; - } - - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) - { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) - { - VezScan(nAction); - - iremga20_scan(0, nAction, pnMin); - BurnYM2151Scan(nAction); - - SCAN_VAR(raster_irq_position); - SCAN_VAR(sound_cpu_reset); - SCAN_VAR(sprite_enable); - SCAN_VAR(nBankswitchData); - } - - if (nAction & ACB_WRITE) { - bRecalcPalette = 1; - - for (INT32 i = 0; i < 4; i++) { - set_pf_scroll(i); - set_pf_info(i); - } - - if (has_bankswitch) - { - VezOpen(0); - m107Bankswitch(nBankswitchData); - VezClose(); - } - - VezOpen(1); - m107YM2151IRQHandler(0); - VezClose(); - } - - return 0; -} - - - -// Air Assault (World) - -static struct BurnRomInfo airassRomDesc[] = { - { "f4-a-h0-etc.h0", 0x040000, 0x038f2cbd, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "f4-a-l0-etc.l0", 0x040000, 0xd3eb7842, 1 | BRF_PRG | BRF_ESS }, // 1 - { "f4-a-h1-ss.h1", 0x020000, 0x4cb1c9ae, 1 | BRF_PRG | BRF_ESS }, // 2 - { "f4-a-l1-ss.l1", 0x020000, 0x1ddd192d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "f4-b-sh0-c.sh0", 0x010000, 0x31c05c0d, 2 | BRF_PRG | BRF_ESS }, // 4 V35 Code - { "f4-b-sl0-c.sl0", 0x010000, 0x60a0d33a, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "w45.c00", 0x100000, 0x2aab419e, 3 | BRF_GRA }, // 6 Background Tiles - { "w46.c10", 0x100000, 0xd6e5c910, 3 | BRF_GRA }, // 7 - - { "w47.000", 0x100000, 0x72e1a253, 4 | BRF_GRA }, // 8 Sprite Tiles - { "w48.010", 0x100000, 0x1746b7f6, 4 | BRF_GRA }, // 9 - { "w49.020", 0x100000, 0x17b5caf2, 4 | BRF_GRA }, // 10 - { "w50.030", 0x100000, 0x63e4bec3, 4 | BRF_GRA }, // 11 - - { "f4-b-drh-.drh", 0x020000, 0x12001372, 5 | BRF_GRA }, // 12 Sprite Tables - { "f4-b-drl-.drl", 0x020000, 0x08cb7533, 5 | BRF_GRA }, // 13 - - { "w96.da0", 0x080000, 0x7a493e2e, 6 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(airass) -STD_ROM_FN(airass) - -static INT32 airassRomLoad() -{ - if (BurnLoadRom(DrvV33ROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvV30ROM + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(DrvV30ROM + 0x000000, 5, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 7, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSprTable + 0x00001, 12, 2)) return 1; - if (BurnLoadRom(DrvSprTable + 0x00000, 13, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 14, 1)) return 1; - - return 0; -} - -static INT32 airassInit() -{ - spritesystem = 1; - config_cpu_speed = 14000000; - return DrvInit(airassRomLoad, gunforce_decryption_table, 1, 0x20, 0x200000, 0x400000); -} - -struct BurnDriver BurnDrvAirass = { - "airass", NULL, NULL, NULL, "1993", - "Air Assault (World)\0", NULL, "Irem", "M107", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_MISC, GBF_VERSHOOT, 0, - NULL, airassRomInfo, airassRomName, NULL, NULL, FirebarrInputInfo, FirebarrDIPInfo, - airassInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Fire Barrel (Japan) - -static struct BurnRomInfo firebarrRomDesc[] = { - { "f4-a-h0-c.h0", 0x40000, 0x2aa5676e, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "f4-a-l0-c.l0", 0x40000, 0x42f75d59, 1 | BRF_PRG | BRF_ESS }, // 1 - { "f4-a-h1-c.h1", 0x20000, 0xbb7f6968, 1 | BRF_PRG | BRF_ESS }, // 2 - { "f4-a-l1-c.l1", 0x20000, 0x9d57edd6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "f4-b-sh0-b.sh0", 0x10000, 0x30a8e232, 2 | BRF_PRG | BRF_ESS }, // 4 V35 Code - { "f4-b-sl0-b.sl0", 0x10000, 0x204b5f1f, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "f4-c00.c00", 0x80000, 0x50cab384, 3 | BRF_GRA }, // 6 Background Tiles - { "f4-c10.c10", 0x80000, 0x330c6df2, 3 | BRF_GRA }, // 7 - { "f4-c01.c01", 0x80000, 0x12a698c8, 3 | BRF_GRA }, // 8 - { "f4-c11.c11", 0x80000, 0x3f9add18, 3 | BRF_GRA }, // 9 - - { "f4-000.000", 0x80000, 0x920deee9, 4 | BRF_GRA }, // 10 Sprite Tiles - { "f4-001.001", 0x80000, 0xe5725eaf, 4 | BRF_GRA }, // 11 - { "f4-010.010", 0x80000, 0x3505d185, 4 | BRF_GRA }, // 12 - { "f4-011.011", 0x80000, 0x1912682f, 4 | BRF_GRA }, // 13 - { "f4-020.020", 0x80000, 0xec130b8e, 4 | BRF_GRA }, // 14 - { "f4-021.021", 0x80000, 0x8dd384dc, 4 | BRF_GRA }, // 15 - { "f4-030.030", 0x80000, 0x7e7b30cd, 4 | BRF_GRA }, // 16 - { "f4-031.031", 0x80000, 0x83ac56c5, 4 | BRF_GRA }, // 17 - - { "f4-b-drh-.drh", 0x20000, 0x12001372, 5 | BRF_GRA }, // 18 Sprite Tables - { "f4-b-drl-.drl", 0x20000, 0x08cb7533, 5 | BRF_GRA }, // 19 - - { "f4-b-da0.da0", 0x80000, 0x7a493e2e, 6 | BRF_SND }, // 20 Irem GA20 Samples -}; - -STD_ROM_PICK(firebarr) -STD_ROM_FN(firebarr) - -static INT32 firebarrRomLoad() -{ - if (BurnLoadRom(DrvV33ROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvV30ROM + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(DrvV30ROM + 0x000000, 5, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100001, 9, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300001, 17, 2)) return 1; - - if (BurnLoadRom(DrvSprTable + 0x00001, 18, 2)) return 1; - if (BurnLoadRom(DrvSprTable + 0x00000, 19, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 20, 1)) return 1; - - return 0; -} - -static INT32 firebarrInit() -{ - spritesystem = 1; - config_cpu_speed = 14000000; - return DrvInit(firebarrRomLoad, rtypeleo_decryption_table, 2, 0x20, 0x200000, 0x400000); -} - -struct BurnDriver BurnDrvFirebarr = { - "firebarr", "airass", NULL, NULL, "1993", - "Fire Barrel (Japan)\0", NULL, "Irem", "M107", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_MISC, GBF_VERSHOOT, 0, - NULL, firebarrRomInfo, firebarrRomName, NULL, NULL, FirebarrInputInfo, FirebarrDIPInfo, - firebarrInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Dream Soccer '94 (World, M107 hardware) - -static struct BurnRomInfo dsoccr94RomDesc[] = { - { "a3-4p_h0-c-0.ic59", 0x040000, 0xd01d3fd7, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "a3-4p_l0-c-0.ic61", 0x040000, 0x8af0afe2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a3_h1-c-0.ic60", 0x040000, 0x6109041b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a3_l1-c-0.ic62", 0x040000, 0x97a01f6b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "a3-sh0-c-0.ic31", 0x010000, 0x23fe6ffc, 2 | BRF_PRG | BRF_ESS }, // 4 V35 Code - { "a3-sl0-c-0.ic37", 0x010000, 0x768132e5, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "ds_c00.ic29", 0x100000, 0x2d31d418, 3 | BRF_GRA }, // 6 Background Tiles - { "ds_c10.ic28", 0x100000, 0x57f7bcd3, 3 | BRF_GRA }, // 7 - { "ds_c01.ic21", 0x100000, 0x9d31a464, 3 | BRF_GRA }, // 8 - { "ds_c11.ic20", 0x100000, 0xa372e79f, 3 | BRF_GRA }, // 9 - - { "ds_000.ic11", 0x100000, 0x366b3e29, 4 | BRF_GRA }, // 10 Sprite Tiles - { "ds_010.ic12", 0x100000, 0x28a4cc40, 4 | BRF_GRA }, // 11 - { "ds_020.ic13", 0x100000, 0x5a310f7f, 4 | BRF_GRA }, // 12 - { "ds_030.ic14", 0x100000, 0x328b1f45, 4 | BRF_GRA }, // 13 - - { "ds_da0.ic24", 0x100000, 0x67fc52fd, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(dsoccr94) -STD_ROM_FN(dsoccr94) - -static INT32 dsoccr94RomLoad() -{ - if (BurnLoadRom(DrvV33ROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvV30ROM + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(DrvV30ROM + 0x000000, 5, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200001, 9, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 14, 1)) return 1; - - return 0; -} - -static INT32 dsoccr94Init() -{ - has_bankswitch = 1; - spritesystem = 0; - config_cpu_speed = 10000000; - return DrvInit(dsoccr94RomLoad, dsoccr94_decryption_table, 1, 0x80, 0x400000, 0x400000); -} - -struct BurnDriver BurnDrvDsoccr94 = { - "dsoccr94", NULL, NULL, NULL, "1994", - "Dream Soccer '94 (World, M107 hardware)\0", NULL, "Irem (Data East Corporation license)", "M107", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IREM_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, dsoccr94RomInfo, dsoccr94RomName, NULL, NULL, Dsoccr94InputInfo, Dsoccr94DIPInfo, - dsoccr94Init, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Dream Soccer '94 (Korea, M107 hardware) -// default team selected is Korea, so likely a Korean set - -static struct BurnRomInfo dsoccr94kRomDesc[] = { - { "ic59_h0.bin", 0x040000, 0x7b26d8a3, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "ic61_l0.bin", 0x040000, 0xb13f0ff4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic60_h1.bin", 0x040000, 0x6109041b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic62_l1.bin", 0x040000, 0x97a01f6b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "a3-sh0-c-0.ic31", 0x010000, 0x23fe6ffc, 2 | BRF_PRG | BRF_ESS }, // 4 V35 Code - { "a3-sl0-c-0.ic37", 0x010000, 0x768132e5, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "ds_c00.ic29", 0x100000, 0x2d31d418, 3 | BRF_GRA }, // 6 Background Tiles - { "ds_c10.ic28", 0x100000, 0x57f7bcd3, 3 | BRF_GRA }, // 7 - { "ds_c01.ic21", 0x100000, 0x9d31a464, 3 | BRF_GRA }, // 8 - { "ds_c11.ic20", 0x100000, 0xa372e79f, 3 | BRF_GRA }, // 9 - - { "ds_000.ic11", 0x100000, 0x366b3e29, 4 | BRF_GRA }, // 10 Sprite Tiles - { "ds_010.ic12", 0x100000, 0x28a4cc40, 4 | BRF_GRA }, // 11 - { "ds_020.ic13", 0x100000, 0x5a310f7f, 4 | BRF_GRA }, // 12 - { "ds_030.ic14", 0x100000, 0x328b1f45, 4 | BRF_GRA }, // 13 - - { "ds_da0.ic24", 0x100000, 0x67fc52fd, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(dsoccr94k) -STD_ROM_FN(dsoccr94k) - -struct BurnDriver BurnDrvDsoccr94k = { - "dsoccr94k", "dsoccr94", NULL, NULL, "1994", - "Dream Soccer '94 (Korea, M107 hardware)\0", NULL, "Irem (Data East Corporation license)", "M107", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IREM_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, dsoccr94kRomInfo, dsoccr94kRomName, NULL, NULL, Dsoccr94InputInfo, Dsoccr94DIPInfo, - dsoccr94Init, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// World PK Soccer - -static struct BurnRomInfo wpksocRomDesc[] = { - { "pk-h0-eur-d.h0", 0x40000, 0xb4917788, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "pk-l0-eur-d.l0", 0x40000, 0x03816bae, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pk-sh0.sh0", 0x10000, 0x1145998c, 2 | BRF_PRG | BRF_ESS }, // 2 V35 Code - { "pk-sl0.sl0", 0x10000, 0x542ee1c7, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "pk-c00-os.c00", 0x80000, 0x42ae3d73, 3 | BRF_GRA }, // 4 Background Tiles - { "pk-c10-os.c10", 0x80000, 0x86acf45c, 3 | BRF_GRA }, // 5 - { "pk-c01-os.c01", 0x80000, 0xb0d33f87, 3 | BRF_GRA }, // 6 - { "pk-c11-os.c11", 0x80000, 0x19de7d63, 3 | BRF_GRA }, // 7 - - { "pk-000.000", 0x80000, 0x165ce027, 4 | BRF_GRA }, // 8 Sprite Tiles - { "pk-001.001", 0x80000, 0xe2745147, 4 | BRF_GRA }, // 9 - { "pk-010.010", 0x80000, 0x6c171b73, 4 | BRF_GRA }, // 10 - { "pk-011.011", 0x80000, 0x471c0bf4, 4 | BRF_GRA }, // 11 - { "pk-020.020", 0x80000, 0xc886dad1, 4 | BRF_GRA }, // 12 - { "pk-021.021", 0x80000, 0x91e877ff, 4 | BRF_GRA }, // 13 - { "pk-030.030", 0x80000, 0x3390621c, 4 | BRF_GRA }, // 14 - { "pk-031.031", 0x80000, 0x4d322804, 4 | BRF_GRA }, // 15 - - { "pk-da0.da0", 0x80000, 0x26a34cf4, 6 | BRF_SND }, // 16 Irem GA20 Samples -}; - -STD_ROM_PICK(wpksoc) -STD_ROM_FN(wpksoc) - -static INT32 wpksocRomLoad() -{ - if (BurnLoadRom(DrvV33ROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvV30ROM + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(DrvV30ROM + 0x000000, 3, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100001, 7, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300001, 15, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 16, 1)) return 1; - - return 0; -} - -static INT32 wpksocInit() -{ - has_bankswitch = 0; - spritesystem = 0; - config_cpu_speed = 14000000; - return DrvInit(wpksocRomLoad, leagueman_decryption_table, 1, 0x80, 0x200000, 0x400000); -} - -struct BurnDriverD BurnDrvWpksoc = { - "wpksoc", NULL, NULL, NULL, "1995", - "World PK Soccer\0", NULL, "Jaleco", "M107", - NULL, NULL, NULL, NULL, - 0, 4, HARDWARE_IREM_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, wpksocRomInfo, wpksocRomName, NULL, NULL, Dsoccr94InputInfo, Dsoccr94DIPInfo, - wpksocInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - -// Kick for the Goal - -static struct BurnRomInfo kftgoalRomDesc[] = { - { "pk-h0-usa-d.h0", 0x40000, 0xaed4cde0, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "pk-l0-usa-d.l0", 0x40000, 0x39fe30d2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pk-sh0.sh0", 0x10000, 0x1145998c, 2 | BRF_PRG | BRF_ESS }, // 2 V35 Code - { "pk-sl0.sl0", 0x10000, 0x542ee1c7, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "pk-c00-os.c00", 0x80000, 0x42ae3d73, 3 | BRF_GRA }, // 4 Background Tiles - { "pk-c10-os.c10", 0x80000, 0x86acf45c, 3 | BRF_GRA }, // 5 - { "pk-c01-os.c01", 0x80000, 0xb0d33f87, 3 | BRF_GRA }, // 6 - { "pk-c11-os.c11", 0x80000, 0x19de7d63, 3 | BRF_GRA }, // 7 - - { "pk-000-usa.000", 0x80000, 0x72e905ab, 4 | BRF_GRA }, // 8 Sprite Tiles - { "pk-001-usa.001", 0x80000, 0xeec4f43c, 4 | BRF_GRA }, // 9 - { "pk-010-usa.010", 0x80000, 0xb3339d73, 4 | BRF_GRA }, // 10 - { "pk-011-usa.011", 0x80000, 0xbab2b7cf, 4 | BRF_GRA }, // 11 - { "pk-020-usa.020", 0x80000, 0x740a0bef, 4 | BRF_GRA }, // 12 - { "pk-021-usa.021", 0x80000, 0xf44208a6, 4 | BRF_GRA }, // 13 - { "pk-030-usa.030", 0x80000, 0x8eceef50, 4 | BRF_GRA }, // 14 - { "pk-031-usa.031", 0x80000, 0x8aa7dc04, 4 | BRF_GRA }, // 15 - - { "pk-da0.da0", 0x80000, 0x26a34cf4, 6 | BRF_SND }, // 16 Irem GA20 Samples - - { "st-m28c64c.eeprom", 0x02000, 0x8e0c8b7c, 7 | BRF_PRG | BRF_ESS }, // 17 Eeprom data -}; - -STD_ROM_PICK(kftgoal) -STD_ROM_FN(kftgoal) - -struct BurnDriverD BurnDrvKftgoal = { - "kftgoal", "wpksoc", NULL, NULL, "1995", - "Kick for the Goal\0", NULL, "Jaleco", "M107", - NULL, NULL, NULL, NULL, - BDF_CLONE, 4, HARDWARE_IREM_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, kftgoalRomInfo, kftgoalRomName, NULL, NULL, Dsoccr94InputInfo, Dsoccr94DIPInfo, - wpksocInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/irem/d_m62.cpp b/jan/src/burn/drv/irem/d_m62.cpp deleted file mode 100644 index e1ec4aec4..000000000 --- a/jan/src/burn/drv/irem/d_m62.cpp +++ /dev/null @@ -1,5186 +0,0 @@ -// FB Alpha Irem M62 system driver -// Based on MAME driver by smf and David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6800_intf.h" -#include "msm5205.h" -#define USE_SAMPLE_HACK // allow use of sampled drumkit on Kid Niki, Spelunker 1 & 2, Battle-Road, Horizon - -#ifdef USE_SAMPLE_HACK -#include "samples.h" -#endif - -#include "driver.h" -extern "C" { - #include "ay8910.h" -} - -static UINT8 M62InputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 M62InputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 M62InputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 M62Dip[2] = {0, 0}; -static UINT8 M62Input[3] = {0x00, 0x00, 0x00}; -static UINT8 M62Reset = 0; -static INT32 M62Z80BankAddress = 0; -static INT32 M62Z80BankAddress2 = 0; - -static UINT32 M62Z80RomSize = 0; -static UINT32 M62PromSize = 0; -static UINT32 M62NumTiles = 0; -static UINT32 M62NumSprites = 0; -static UINT32 M62NumChars = 0; -static UINT32 M62SpriteRamSize = 0; -static UINT32 M62CharRamSize = 0; -static UINT32 M62ScrollRamSize = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *M62Z80Rom = NULL; -static UINT8 *M62M6803Rom = NULL; -static UINT8 *M62TileRam = NULL; -static UINT8 *M62SpriteRam = NULL; -static UINT8 *M62CharRam = NULL; -static UINT8 *M62ScrollRam = NULL; -static UINT8 *M62Z80Ram = NULL; -static UINT8 *M62M6803Ram = NULL; -static UINT8 *M62Tiles = NULL; -static UINT8 *M62Sprites = NULL; -static UINT8 *M62Chars = NULL; -static UINT8 *M62PromData = NULL; -static UINT8 *M62TempRom = NULL; -static UINT32 *M62Palette = NULL; -static INT16* pFMBuffer; -static INT16* pAY8910Buffer[6]; - -static INT32 M62BackgroundHScroll; -static INT32 M62BackgroundVScroll; -static INT32 M62CharHScroll; -static INT32 M62CharVScroll; -static INT32 M62FlipScreen; -static INT32 M62SpriteHeightPromOffset; -static UINT8 M62SoundLatch; -static UINT8 M62Port1; -static UINT8 M62Port2; -static UINT8 M62SlaveMSM5205VClckReset; -static UINT32 M62PaletteEntries; -static UINT32 M62Z80Clock; -static UINT32 M62M6803Clock; -static UINT8 M62BankControl[2]; -static UINT8 Ldrun2BankSwap; -static UINT8 Ldrun3TopBottomMask; -static UINT8 KidnikiBackgroundBank; -static UINT8 SpelunkrPaletteBank; -static INT32 M62BgxTileDim = 0; -static INT32 M62BgyTileDim = 0; -static INT32 M62CharxTileDim = 0; -static INT32 M62CharyTileDim = 0; -static UINT32 bHasSamples = 0; - -typedef void (*M62Render)(); -static M62Render M62RenderFunction; -static void KungfumDraw(); -static void BattroadDraw(); -static void LdrunDraw(); -static void Ldrun3Draw(); -static void Ldrun4Draw(); -static void LotlotDraw(); -static void KidnikiDraw(); -static void SpelunkrDraw(); -static void Spelunk2Draw(); -static void YoujyudnDraw(); -static void HorizonDraw(); - -typedef void (*M62ExtendTileInfo)(INT32*, INT32*, INT32*, INT32*); -static M62ExtendTileInfo M62ExtendTileInfoFunction; -static void BattroadExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32* xFlip); -static void LdrunExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32* xFlip); -static void Ldrun2ExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32* xFlip); -static void Ldrun4ExtendTile(INT32* Code, INT32* Colour, INT32*, INT32*); -static void LotlotExtendTile(INT32* Code, INT32* Colour, INT32*, INT32* xFlip); -static void KidnikiExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32*); -static void SpelunkrExtendTile(INT32* Code, INT32* Colour, INT32*, INT32*); -static void Spelunk2ExtendTile(INT32* Code, INT32* Colour, INT32*, INT32*); -static void YoujyudnExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32*); -static void HorizonExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32*); - -typedef void (*M62ExtendCharInfo)(INT32*, INT32*, INT32*, INT32*); -static M62ExtendCharInfo M62ExtendCharInfoFunction; -static void BattroadExtendChar(INT32* Code, INT32* Colour, INT32*, INT32*); -static void LotlotExtendChar(INT32* Code, INT32* Colour, INT32*, INT32*); -static void SpelunkrExtendChar(INT32* Code, INT32* Colour, INT32*, INT32*); -static void YoujyudnExtendChar(INT32* Code, INT32* Colour, INT32*, INT32*); - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo M62InputList[] = -{ - {"Coin 1" , BIT_DIGITAL , M62InputPort0 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , M62InputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , M62InputPort2 + 4, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , M62InputPort0 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , M62InputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , M62InputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , M62InputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , M62InputPort1 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , M62InputPort1 + 7, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , M62InputPort1 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , M62InputPort2 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , M62InputPort2 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , M62InputPort2 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , M62InputPort2 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , M62InputPort2 + 7, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , M62InputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &M62Reset , "reset" }, - {"Service" , BIT_DIGITAL , M62InputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH, M62Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, M62Dip + 1 , "dip" }, -}; - -STDINPUTINFO(M62) - -static inline void M62ClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void M62MakeInputs() -{ - M62Input[0] = M62Input[1] = M62Input[2] = 0x00; - - for (INT32 i = 0; i < 8; i++) { - M62Input[0] |= (M62InputPort0[i] & 1) << i; - M62Input[1] |= (M62InputPort1[i] & 1) << i; - M62Input[2] |= (M62InputPort2[i] & 1) << i; - } - - M62ClearOpposites(&M62Input[0]); - M62ClearOpposites(&M62Input[1]); -} - -#define IREM_Z80_COINAGE_TYPE3 \ - {0 , 0xfe, 0 , 15 , "Coinage" }, \ - {0x12, 0x02, 0xf0, 0x90, "7 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xa0, "6 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xb0, "5 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xc0, "4 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xd0, "3 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xe0, "2 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xf0, "1 Coin 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x70, "1 Coin 2 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x60, "1 Coin 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x50, "1 Coin 4 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x40, "1 Coin 5 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x30, "1 Coin 6 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x20, "1 Coin 7 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x10, "1 Coin 8 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x00, "Freeplay" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - \ - {0 , 0xfe, 0 , 4 , "Coin A" }, \ - {0x12, 0x82, 0x30, 0x10, "3 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0x30, 0x20, "2 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0x30, 0x30, "1 Coin 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0x30, 0x00, "Free Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0 , 0xfe, 0 , 4 , "Coin B" }, \ - {0x12, 0x82, 0xc0, 0xc0, "1 Coin 2 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0xc0, 0x80, "1 Coin 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0xc0, 0x40, "1 Coin 5 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0xc0, 0x00, "1 Coin 6 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - -#define IREM_Z80_COINAGE_TYPE4 \ - {0 , 0xfe, 0 , 16 , "Coinage" }, \ - {0x12, 0x02, 0xf0, 0xa0, "6 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xb0, "5 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xc0, "4 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xd0, "3 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x10, "8 Coins 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xe0, "2 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x20, "5 Coins 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x30, "3 Coins 2 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xf0, "1 Coin 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x40, "2 Coins 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x90, "1 Coin 2 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x80, "1 Coin 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x70, "1 Coin 4 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x60, "1 Coin 5 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x50, "1 Coin 6 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x00, "Freeplay" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - \ - {0 , 0xfe, 0 , 4 , "Coin A" }, \ - {0x12, 0x82, 0x30, 0x00, "5 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0x30, 0x10, "3 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0x30, 0x20, "2 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0x30, 0x30, "1 Coin 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0 , 0xfe, 0 , 4 , "Coin B" }, \ - {0x12, 0x82, 0xc0, 0xc0, "1 Coin 2 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0xc0, 0x80, "1 Coin 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0xc0, 0x40, "1 Coin 5 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0xc0, 0x00, "1 Coin 6 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - -#define IREM_Z80_COINAGE_TYPE5 \ - {0 , 0xfe, 0 , 16 , "Coinage" }, \ - {0x12, 0x02, 0xf0, 0x00, "8 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xa0, "6 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xb0, "5 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xc0, "4 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xd0, "3 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xe0, "2 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x10, "5 Coins 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x20, "3 Coins 5 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x30, "3 Coins 2 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0xf0, "1 Coin 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x40, "2 Coins 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x90, "1 Coin 2 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x80, "1 Coin 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x70, "1 Coin 4 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x60, "1 Coin 5 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x02, 0xf0, 0x50, "1 Coin 6 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - \ - {0 , 0xfe, 0 , 4 , "Coin A" }, \ - {0x12, 0x82, 0x30, 0x00, "5 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0x30, 0x10, "3 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0x30, 0x20, "2 Coins 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0x30, 0x30, "1 Coin 1 Play" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0 , 0xfe, 0 , 4 , "Coin B" }, \ - {0x12, 0x82, 0xc0, 0xc0, "1 Coin 2 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0xc0, 0x80, "1 Coin 3 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0xc0, 0x40, "1 Coin 5 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - {0x12, 0x82, 0xc0, 0x00, "1 Coin 6 Plays" }, \ - {0x13, 0x00, 0x04, 0x04, NULL }, \ - -static struct BurnDIPInfo KungfumDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x12, 0x01, 0x01, 0x01, "Easy" }, - {0x12, 0x01, 0x01, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Energy Loss" }, - {0x12, 0x01, 0x02, 0x02, "Slow" }, - {0x12, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x00, "5" }, - - IREM_Z80_COINAGE_TYPE3 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Slow Motion Mode" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Level Selection Mode" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kungfum) - -static struct BurnDIPInfo BattroadDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Fuel Decrease" }, - {0x12, 0x01, 0x03, 0x03, "Slow" }, - {0x12, 0x01, 0x03, 0x02, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Fast" }, - {0x12, 0x01, 0x03, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x12, 0x01, 0x04, 0x04, "Easy" }, - {0x12, 0x01, 0x04, 0x00, "Hard" }, - - IREM_Z80_COINAGE_TYPE3 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Battroad) - -static struct BurnDIPInfo LdrunDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Timer" }, - {0x12, 0x01, 0x03, 0x03, "Slow" }, - {0x12, 0x01, 0x03, 0x02, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Fast" }, - {0x12, 0x01, 0x03, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x00, "5" }, - - IREM_Z80_COINAGE_TYPE3 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Level Selection Mode" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ldrun) - -static struct BurnDIPInfo Ldrun2DIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Timer" }, - {0x12, 0x01, 0x01, 0x01, "Slow" }, - {0x12, 0x01, 0x01, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Game Speed" }, - {0x12, 0x01, 0x02, 0x00, "Low" }, - {0x12, 0x01, 0x02, 0x02, "High" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x00, "5" }, - - IREM_Z80_COINAGE_TYPE3 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Level Selection Mode" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ldrun2) - -static struct BurnDIPInfo Ldrun4DIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Timer" }, - {0x12, 0x01, 0x01, 0x01, "Slow" }, - {0x12, 0x01, 0x01, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "2 Players Game" }, - {0x12, 0x01, 0x02, 0x00, "1 Credit" }, - {0x12, 0x01, 0x02, 0x02, "2 Credits" }, - - {0 , 0xfe, 0 , 4 , "1 Player Lives" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x00, "5" }, - - IREM_Z80_COINAGE_TYPE3 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "2 Players Lives" }, - {0x13, 0x01, 0x02, 0x02, "5" }, - {0x13, 0x01, 0x02, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Allow 2 Player Game" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Level Selection Mode" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ldrun4) - -static struct BurnDIPInfo LotlotDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xf5, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Speed" }, - {0x12, 0x01, 0x03, 0x03, "Very Slow" }, - {0x12, 0x01, 0x03, 0x02, "Slow" }, - {0x12, 0x01, 0x03, 0x01, "Fast" }, - {0x12, 0x01, 0x03, 0x00, "Very Fast" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "1" }, - {0x12, 0x01, 0x0c, 0x0c, "2" }, - {0x12, 0x01, 0x0c, 0x04, "3" }, - {0x12, 0x01, 0x0c, 0x00, "4" }, - - IREM_Z80_COINAGE_TYPE4 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Lotlot) - -static struct BurnDIPInfo KidnikiDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x12, 0x01, 0x04, 0x04, "Normal" }, - {0x12, 0x01, 0x04, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x12, 0x01, 0x08, 0x08, "50000" }, - {0x12, 0x01, 0x08, 0x00, "80000" }, - - IREM_Z80_COINAGE_TYPE4 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Game Repeats" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kidniki) - -static struct BurnDIPInfo SpelunkrDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xf5, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Energy Decrease" }, - {0x12, 0x01, 0x03, 0x03, "Slow" }, - {0x12, 0x01, 0x03, 0x02, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Fast" }, - {0x12, 0x01, 0x03, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x00, "5" }, - - IREM_Z80_COINAGE_TYPE4 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Teleport" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Spelunkr) - -static struct BurnDIPInfo Spelunk2DIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Energy Decrease" }, - {0x12, 0x01, 0x03, 0x03, "Slow" }, - {0x12, 0x01, 0x03, 0x02, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Fast" }, - {0x12, 0x01, 0x03, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x00, "5" }, - - IREM_Z80_COINAGE_TYPE4 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Spelunk2) - -static struct BurnDIPInfo YoujyudnDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - IREM_Z80_COINAGE_TYPE4 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x13, 0x01, 0x08, 0x08, "20000 60000" }, - {0x13, 0x01, 0x08, 0x00, "40000 80000" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Level Selection Mode" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Youjyudn) - -static struct BurnDIPInfo HorizonDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x00, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x02, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x12, 0x01, 0x0c, 0x00, "100 and 80k" }, - {0x12, 0x01, 0x0c, 0x0c, "40k and every 80k" }, - {0x12, 0x01, 0x0c, 0x08, "60k and every 100k" }, - {0x12, 0x01, 0x0c, 0x04, "80k and every 120k" }, - - IREM_Z80_COINAGE_TYPE5 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Frame Advance" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Horizon) - -static struct BurnRomInfo KungfumRomDesc[] = { - { "a-4e-c.bin", 0x04000, 0xb6e2d083, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "a-4d-c.bin", 0x04000, 0x7532918e, BRF_ESS | BRF_PRG }, // 1 - - { "a-3e-.bin", 0x02000, 0x58e87ab0, BRF_ESS | BRF_PRG }, // 2 M6803 Program Code - { "a-3f-.bin", 0x02000, 0xc81e31ea, BRF_ESS | BRF_PRG }, // 3 - { "a-3h-.bin", 0x02000, 0xd99fb995, BRF_ESS | BRF_PRG }, // 4 - - { "g-4c-a.bin", 0x02000, 0x6b2cc9c8, BRF_GRA }, // 5 Characters - { "g-4d-a.bin", 0x02000, 0xc648f558, BRF_GRA }, // 6 - { "g-4e-a.bin", 0x02000, 0xfbe9276e, BRF_GRA }, // 7 - - { "b-4k-.bin", 0x02000, 0x16fb5150, BRF_GRA }, // 8 Sprites - { "b-4f-.bin", 0x02000, 0x67745a33, BRF_GRA }, // 9 - { "b-4l-.bin", 0x02000, 0xbd1c2261, BRF_GRA }, // 10 - { "b-4h-.bin", 0x02000, 0x8ac5ed3a, BRF_GRA }, // 11 - { "b-3n-.bin", 0x02000, 0x28a213aa, BRF_GRA }, // 12 - { "b-4n-.bin", 0x02000, 0xd5228df3, BRF_GRA }, // 13 - { "b-4m-.bin", 0x02000, 0xb16de4f2, BRF_GRA }, // 14 - { "b-3m-.bin", 0x02000, 0xeba0d66b, BRF_GRA }, // 15 - { "b-4c-.bin", 0x02000, 0x01298885, BRF_GRA }, // 16 - { "b-4e-.bin", 0x02000, 0xc77b87d4, BRF_GRA }, // 17 - { "b-4d-.bin", 0x02000, 0x6a70615f, BRF_GRA }, // 18 - { "b-4a-.bin", 0x02000, 0x6189d626, BRF_GRA }, // 19 - - { "g-1j-.bin", 0x00100, 0x668e6bca, BRF_GRA }, // 20 PROM (Tile Palette Red Component) - { "b-1m-.bin", 0x00100, 0x76c05a9c, BRF_GRA }, // 21 PROM (Sprite Palette Red Component) - { "g-1f-.bin", 0x00100, 0x964b6495, BRF_GRA }, // 22 PROM (Tile Palette Green Component) - { "b-1n-.bin", 0x00100, 0x23f06b99, BRF_GRA }, // 23 PROM (Sprite Palette Green Component) - { "g-1h-.bin", 0x00100, 0x550563e1, BRF_GRA }, // 24 PROM (Tile Palette Blue Component) - { "b-1l-.bin", 0x00100, 0x35e45021, BRF_GRA }, // 25 PROM (Sprite Palette Blue Component) - { "b-5f-.bin", 0x00020, 0x7a601c3d, BRF_GRA }, // 26 PROM (Sprite Height) - { "b-6f-.bin", 0x00100, 0x82c20d12, BRF_GRA }, // 27 PROM (Video Timing) -}; - -STD_ROM_PICK(Kungfum) -STD_ROM_FN(Kungfum) - -static struct BurnRomInfo KungfumdRomDesc[] = { - { "snx_a-4e-d", 0x04000, 0xfc330a46, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "snx_a-4d-d", 0x04000, 0x1b2fd32f, BRF_ESS | BRF_PRG }, // 1 - - { "snx_a-3d-b", 0x04000, 0x85ca7956, BRF_ESS | BRF_PRG }, // 2 M6803 Program Code - { "snx_a-3f-b", 0x04000, 0x3ef1100a, BRF_ESS | BRF_PRG }, // 3 - - { "g-4c-a.bin", 0x02000, 0x6b2cc9c8, BRF_GRA }, // 4 Characters - { "g-4d-a.bin", 0x02000, 0xc648f558, BRF_GRA }, // 5 - { "g-4e-a.bin", 0x02000, 0xfbe9276e, BRF_GRA }, // 6 - - { "snx_b-4k-b", 0x04000, 0x85591db2, BRF_GRA }, // 7 Sprites - { "snx_b-4f-b", 0x04000, 0xed719d7b, BRF_GRA }, // 8 - { "snx_b-3n-b", 0x04000, 0x05fcce8b, BRF_GRA }, // 9 - { "snx_b-4n-b", 0x04000, 0xdc675003, BRF_GRA }, // 10 - { "snx_b-4c-b", 0x04000, 0x1df11d81, BRF_GRA }, // 11 - { "snx_b-4e-b", 0x04000, 0x2d3b69dd, BRF_GRA }, // 12 - - { "g-1j-.bin", 0x00100, 0x668e6bca, BRF_GRA }, // 13 PROM (Tile Palette Red Component) - { "b-1m-.bin", 0x00100, 0x76c05a9c, BRF_GRA }, // 14 PROM (Sprite Palette Red Component) - { "g-1f-.bin", 0x00100, 0x964b6495, BRF_GRA }, // 15 PROM (Tile Palette Green Component) - { "b-1n-.bin", 0x00100, 0x23f06b99, BRF_GRA }, // 16 PROM (Sprite Palette Green Component) - { "g-1h-.bin", 0x00100, 0x550563e1, BRF_GRA }, // 17 PROM (Tile Palette Blue Component) - { "b-1l-.bin", 0x00100, 0x35e45021, BRF_GRA }, // 18 PROM (Sprite Palette Blue Component) - { "b-5f-.bin", 0x00020, 0x7a601c3d, BRF_GRA }, // 19 PROM (Sprite Height) - { "b-6f-.bin", 0x00100, 0x82c20d12, BRF_GRA }, // 20 PROM (Video Timing) -}; - -STD_ROM_PICK(Kungfumd) -STD_ROM_FN(Kungfumd) - -static struct BurnRomInfo SpartanxRomDesc[] = { - { "a-4e-c-j.bin", 0x04000, 0x32a0a9a6, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "a-4d-c-j.bin", 0x04000, 0x3173ea78, BRF_ESS | BRF_PRG }, // 1 - - { "a-3e-.bin", 0x02000, 0x58e87ab0, BRF_ESS | BRF_PRG }, // 2 M6803 Program Code - { "a-3f-.bin", 0x02000, 0xc81e31ea, BRF_ESS | BRF_PRG }, // 3 - { "a-3h-.bin", 0x02000, 0xd99fb995, BRF_ESS | BRF_PRG }, // 4 - - { "g-4c-a-j.bin", 0x02000, 0x8af9c5a6, BRF_GRA }, // 5 Characters - { "g-4d-a-j.bin", 0x02000, 0xb8300c72, BRF_GRA }, // 6 - { "g-4e-a-j.bin", 0x02000, 0xb50429cd, BRF_GRA }, // 7 - - { "b-4k-.bin", 0x02000, 0x16fb5150, BRF_GRA }, // 8 Sprites - { "b-4f-.bin", 0x02000, 0x67745a33, BRF_GRA }, // 9 - { "b-4l-.bin", 0x02000, 0xbd1c2261, BRF_GRA }, // 10 - { "b-4h-.bin", 0x02000, 0x8ac5ed3a, BRF_GRA }, // 11 - { "b-3n-.bin", 0x02000, 0x28a213aa, BRF_GRA }, // 12 - { "b-4n-.bin", 0x02000, 0xd5228df3, BRF_GRA }, // 13 - { "b-4m-.bin", 0x02000, 0xb16de4f2, BRF_GRA }, // 14 - { "b-3m-.bin", 0x02000, 0xeba0d66b, BRF_GRA }, // 15 - { "b-4c-.bin", 0x02000, 0x01298885, BRF_GRA }, // 16 - { "b-4e-.bin", 0x02000, 0xc77b87d4, BRF_GRA }, // 17 - { "b-4d-.bin", 0x02000, 0x6a70615f, BRF_GRA }, // 18 - { "b-4a-.bin", 0x02000, 0x6189d626, BRF_GRA }, // 19 - - { "g-1j-.bin", 0x00100, 0x668e6bca, BRF_GRA }, // 20 PROM (Tile Palette Red Component) - { "b-1m-.bin", 0x00100, 0x76c05a9c, BRF_GRA }, // 21 PROM (Sprite Palette Red Component) - { "g-1f-.bin", 0x00100, 0x964b6495, BRF_GRA }, // 22 PROM (Tile Palette Green Component) - { "b-1n-.bin", 0x00100, 0x23f06b99, BRF_GRA }, // 23 PROM (Sprite Palette Green Component) - { "g-1h-.bin", 0x00100, 0x550563e1, BRF_GRA }, // 24 PROM (Tile Palette Blue Component) - { "b-1l-.bin", 0x00100, 0x35e45021, BRF_GRA }, // 25 PROM (Sprite Palette Blue Component) - { "b-5f-.bin", 0x00020, 0x7a601c3d, BRF_GRA }, // 26 PROM (Sprite Height) - { "b-6f-.bin", 0x00100, 0x82c20d12, BRF_GRA }, // 27 PROM (Video Timing) -}; - -STD_ROM_PICK(Spartanx) -STD_ROM_FN(Spartanx) - -static struct BurnRomInfo KungfubRomDesc[] = { - { "c5.5h", 0x04000, 0x5d8e791d, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "c4.5k", 0x04000, 0x4000e2b8, BRF_ESS | BRF_PRG }, // 1 - - { "a-3e-.bin", 0x02000, 0x58e87ab0, BRF_ESS | BRF_PRG }, // 2 M6803 Program Code - { "a-3f-.bin", 0x02000, 0xc81e31ea, BRF_ESS | BRF_PRG }, // 3 - { "a-3h-.bin", 0x02000, 0xd99fb995, BRF_ESS | BRF_PRG }, // 4 - - { "g-4c-a.bin", 0x02000, 0x6b2cc9c8, BRF_GRA }, // 5 Characters - { "g-4d-a.bin", 0x02000, 0xc648f558, BRF_GRA }, // 6 - { "g-4e-a.bin", 0x02000, 0xfbe9276e, BRF_GRA }, // 7 - - { "b-4k-.bin", 0x02000, 0x16fb5150, BRF_GRA }, // 8 Sprites - { "b-4f-.bin", 0x02000, 0x67745a33, BRF_GRA }, // 9 - { "b-4l-.bin", 0x02000, 0xbd1c2261, BRF_GRA }, // 10 - { "b-4h-.bin", 0x02000, 0x8ac5ed3a, BRF_GRA }, // 11 - { "b-3n-.bin", 0x02000, 0x28a213aa, BRF_GRA }, // 12 - { "b-4n-.bin", 0x02000, 0xd5228df3, BRF_GRA }, // 13 - { "b-4m-.bin", 0x02000, 0xb16de4f2, BRF_GRA }, // 14 - { "b-3m-.bin", 0x02000, 0xeba0d66b, BRF_GRA }, // 15 - { "b-4c-.bin", 0x02000, 0x01298885, BRF_GRA }, // 16 - { "b-4e-.bin", 0x02000, 0xc77b87d4, BRF_GRA }, // 17 - { "b-4d-.bin", 0x02000, 0x6a70615f, BRF_GRA }, // 18 - { "b-4a-.bin", 0x02000, 0x6189d626, BRF_GRA }, // 19 - - { "tbp24s10-main-1c.bin", 0x00100, 0x668e6bca, BRF_GRA }, // 20 PROM (Tile Palette Red Component) - { "tbp24s10-gfx-1r.bin", 0x00100, 0x76c05a9c, BRF_GRA }, // 21 PROM (Sprite Palette Red Component) - { "tbp24s10-main-1a.bin", 0x00100, 0x964b6495, BRF_GRA }, // 22 PROM (Tile Palette Green Component) - { "tbp24s10-gfx-1s.bin", 0x00100, 0x23f06b99, BRF_GRA }, // 23 PROM (Sprite Palette Green Component) - { "tbp24s10-main-1b.bin", 0x00100, 0x550563e1, BRF_GRA }, // 24 PROM (Tile Palette Blue Component) - { "tbp24s10-gfx-1p.bin", 0x00100, 0x35e45021, BRF_GRA }, // 25 PROM (Sprite Palette Blue Component) - { "18s030-gfx-8t.bin", 0x00020, 0x7a601c3d, BRF_GRA }, // 26 PROM (Sprite Height) - { "tbp24s10-gfx-9k.bin", 0x00100, 0x82c20d12, BRF_GRA }, // 27 PROM (Video Timing) - { "18s030-gfx-10a.bin", 0x00020, 0x3858acd0, BRF_OPT }, // 27 - { "18s030-gfx-5d.bin", 0x00020, 0x51304fcd, BRF_OPT }, // 28 - { "18s030-gfx-5e.bin", 0x00020, 0x51304fcd, BRF_OPT }, // 29 - { "18s030-gfx-6l.bin", 0x00020, 0x3858acd0, BRF_OPT }, // 30 - { "tbp24s10-gfx-3b.bin", 0x00100, 0xe6506ef4, BRF_OPT }, // 31 - { "tbp24s10-gfx-4a.bin", 0x00100, 0xe0aa8869, BRF_OPT }, // 32 - { "tbp24s10-gfx-4c.bin", 0x00100, 0xb43d094f, BRF_OPT }, // 33 - { "tbp24s10-gfx-6d.bin", 0x00100, 0x48bb39c9, BRF_OPT }, // 34 - { "tbp24s10-gfx-6e.bin", 0x00100, 0x48bb39c9, BRF_OPT }, // 35 - { "tbp24s10-gfx-6m.bin", 0x00100, 0x9f7a1a4d, BRF_OPT }, // 36 - { "tbp24s10-gfx-6n.bin", 0x00100, 0x35e5b39e, BRF_OPT }, // 37 - { "tbp24s10-gfx-8a.bin", 0x00100, 0x35e5b39e, BRF_OPT }, // 38 - { "tbp24s10-gfx-9a.bin", 0x00100, 0x9f7a1a4d, BRF_OPT }, // 39 - { "tbp24s10-gfx-9k.bin", 0x00100, 0x82c20d12, BRF_OPT }, // 40 - { "tbp24s10-main-8b.bin", 0x00100, 0x180fbc57, BRF_OPT }, // 41 - { "tbp24s10-main-8c.bin", 0x00100, 0x3bb32e5a, BRF_OPT }, // 42 - { "tbp24s10-main-8d.bin", 0x00100, 0x599c319f, BRF_OPT }, // 43 -}; - -STD_ROM_PICK(Kungfub) -STD_ROM_FN(Kungfub) - -static struct BurnRomInfo Kungfub2RomDesc[] = { - { "kf4", 0x04000, 0x3f65313f, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "kf5", 0x04000, 0x9ea325f3, BRF_ESS | BRF_PRG }, // 1 - - { "a-3e-.bin", 0x02000, 0x58e87ab0, BRF_ESS | BRF_PRG }, // 2 M6803 Program Code - { "a-3f-.bin", 0x02000, 0xc81e31ea, BRF_ESS | BRF_PRG }, // 3 - { "a-3h-.bin", 0x02000, 0xd99fb995, BRF_ESS | BRF_PRG }, // 4 - - { "g-4c-a.bin", 0x02000, 0x6b2cc9c8, BRF_GRA }, // 5 Characters - { "g-4d-a.bin", 0x02000, 0xc648f558, BRF_GRA }, // 6 - { "g-4e-a.bin", 0x02000, 0xfbe9276e, BRF_GRA }, // 7 - - { "b-4k-.bin", 0x02000, 0x16fb5150, BRF_GRA }, // 8 Sprites - { "b-4f-.bin", 0x02000, 0x67745a33, BRF_GRA }, // 9 - { "b-4l-.bin", 0x02000, 0xbd1c2261, BRF_GRA }, // 10 - { "b-4h-.bin", 0x02000, 0x8ac5ed3a, BRF_GRA }, // 11 - { "b-3n-.bin", 0x02000, 0x28a213aa, BRF_GRA }, // 12 - { "b-4n-.bin", 0x02000, 0xd5228df3, BRF_GRA }, // 13 - { "b-4m-.bin", 0x02000, 0xb16de4f2, BRF_GRA }, // 14 - { "b-3m-.bin", 0x02000, 0xeba0d66b, BRF_GRA }, // 15 - { "b-4c-.bin", 0x02000, 0x01298885, BRF_GRA }, // 16 - { "b-4e-.bin", 0x02000, 0xc77b87d4, BRF_GRA }, // 17 - { "b-4d-.bin", 0x02000, 0x6a70615f, BRF_GRA }, // 18 - { "b-4a-.bin", 0x02000, 0x6189d626, BRF_GRA }, // 19 - - { "g-1j-.bin", 0x00100, 0x668e6bca, BRF_GRA }, // 20 PROM (Tile Palette Red Component) - { "b-1m-.bin", 0x00100, 0x76c05a9c, BRF_GRA }, // 21 PROM (Sprite Palette Red Component) - { "g-1f-.bin", 0x00100, 0x964b6495, BRF_GRA }, // 22 PROM (Tile Palette Green Component) - { "b-1n-.bin", 0x00100, 0x23f06b99, BRF_GRA }, // 23 PROM (Sprite Palette Green Component) - { "g-1h-.bin", 0x00100, 0x550563e1, BRF_GRA }, // 24 PROM (Tile Palette Blue Component) - { "b-1l-.bin", 0x00100, 0x35e45021, BRF_GRA }, // 25 PROM (Sprite Palette Blue Component) - { "b-5f-.bin", 0x00020, 0x7a601c3d, BRF_GRA }, // 26 PROM (Sprite Height) - { "b-6f-.bin", 0x00100, 0x82c20d12, BRF_GRA }, // 27 PROM (Video Timing) -}; - -STD_ROM_PICK(Kungfub2) -STD_ROM_FN(Kungfub2) - -static struct BurnRomInfo Kungfub3RomDesc[] = { - { "5.bin", 0x04000, 0x5d8e791d, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "4.bin", 0x04000, 0x4000e2b8, BRF_ESS | BRF_PRG }, // 1 - - { "1.bin", 0x02000, 0x58e87ab0, BRF_ESS | BRF_PRG }, // 2 M6803 Program Code - { "2.bin", 0x02000, 0xc81e31ea, BRF_ESS | BRF_PRG }, // 3 - { "3.bin", 0x02000, 0xd99fb995, BRF_ESS | BRF_PRG }, // 4 - - { "6.bin", 0x02000, 0x6b2cc9c8, BRF_GRA }, // 4 Characters - { "7.bin", 0x02000, 0xc648f558, BRF_GRA }, // 5 - { "8.bin", 0x02000, 0xfbe9276e, BRF_GRA }, // 6 - - { "14.bin", 0x04000, 0x85591db2, BRF_GRA }, // 7 Sprites - { "13.bin", 0x04000, 0xed719d7b, BRF_GRA }, // 8 - { "16.bin", 0x04000, 0x05fcce8b, BRF_GRA }, // 9 - { "15.bin", 0x04000, 0xdc675003, BRF_GRA }, // 10 - { "11.bin", 0x04000, 0x1df11d81, BRF_GRA }, // 11 - { "12.bin", 0x04000, 0x2d3b69dd, BRF_GRA }, // 12 - - { "g-1j-.bin", 0x00100, 0x668e6bca, BRF_GRA }, // 13 PROM (Tile Palette Red Component) - { "b-1m-.bin", 0x00100, 0x76c05a9c, BRF_GRA }, // 14 PROM (Sprite Palette Red Component) - { "g-1f-.bin", 0x00100, 0x964b6495, BRF_GRA }, // 15 PROM (Tile Palette Green Component) - { "b-1n-.bin", 0x00100, 0x23f06b99, BRF_GRA }, // 16 PROM (Sprite Palette Green Component) - { "g-1h-.bin", 0x00100, 0x550563e1, BRF_GRA }, // 17 PROM (Tile Palette Blue Component) - { "b-1l-.bin", 0x00100, 0x35e45021, BRF_GRA }, // 18 PROM (Sprite Palette Blue Component) - { "b-5f-.bin", 0x00020, 0x7a601c3d, BRF_GRA }, // 19 PROM (Sprite Height) - { "b-6f-.bin", 0x00100, 0x82c20d12, BRF_GRA }, // 20 PROM (Video Timing) -}; - -STD_ROM_PICK(Kungfub3) -STD_ROM_FN(Kungfub3) - -static struct BurnRomInfo BattroadRomDesc[] = { - { "br-a-4e.b", 0x02000, 0x9bf14768, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "br-a-4d.b", 0x02000, 0x39ca1627, BRF_ESS | BRF_PRG }, // 1 - { "br-a-4b.b", 0x02000, 0x1865bb22, BRF_ESS | BRF_PRG }, // 2 - { "br-a-4a", 0x02000, 0x65b61c21, BRF_ESS | BRF_PRG }, // 3 - { "br-c-7c", 0x02000, 0x2e1eca52, BRF_ESS | BRF_PRG }, // 4 - { "br-c-7l", 0x02000, 0xf2178578, BRF_ESS | BRF_PRG }, // 5 - { "br-c-7d", 0x02000, 0x3aa9fa30, BRF_ESS | BRF_PRG }, // 6 - { "br-c-7b", 0x02000, 0x0b31b90b, BRF_ESS | BRF_PRG }, // 7 - { "br-c-7a", 0x02000, 0xec3b0080, BRF_ESS | BRF_PRG }, // 8 - { "br-c-7k", 0x02000, 0xedc75f7f, BRF_ESS | BRF_PRG }, // 9 - - { "br-a-3e", 0x02000, 0xa7140871, BRF_ESS | BRF_PRG }, // 10 M6803 Program Code - { "br-a-3f", 0x02000, 0x1bb51b30, BRF_ESS | BRF_PRG }, // 11 - { "br-a-3h", 0x02000, 0xafb3e083, BRF_ESS | BRF_PRG }, // 12 - - { "br-c-6h", 0x02000, 0xca50841c, BRF_GRA }, // 13 Tiles - { "br-c-6n", 0x02000, 0x7d53163a, BRF_GRA }, // 14 - { "br-c-6k", 0x02000, 0x5951e12a, BRF_GRA }, // 15 - - { "br-b-4k.a", 0x02000, 0xd3c5e85b, BRF_GRA }, // 16 Sprites - { "br-b-4f.a", 0x02000, 0x4354232a, BRF_GRA }, // 17 - { "br-b-3n.a", 0x02000, 0x2668dbef, BRF_GRA }, // 18 - { "br-b-4n.a", 0x02000, 0xc719a324, BRF_GRA }, // 19 - { "br-b-4c.a", 0x02000, 0x0b3193bf, BRF_GRA }, // 20 - { "br-b-4e.a", 0x02000, 0x3662e8fb, BRF_GRA }, // 21 - - { "br-c-1b", 0x02000, 0x8088911e, BRF_GRA }, // 22 Chars - { "br-c-1c", 0x02000, 0x3d78b653, BRF_GRA }, // 23 - - { "br-c-3j", 0x00100, 0xaceaed79, BRF_GRA }, // 24 PROM (Tile Palette Red Component) - { "br-b-1m", 0x00100, 0x3bd30c7d, BRF_GRA }, // 25 PROM (Sprite Palette Red Component) - { "br-c-3l", 0x00100, 0x7cf6f380, BRF_GRA }, // 26 PROM (Tile Palette Green Component) - { "br-b-1n", 0x00100, 0xb7f3dc3b, BRF_GRA }, // 27 PROM (Sprite Palette Green Component) - { "br-c-3k", 0x00100, 0xd90e4a54, BRF_GRA }, // 28 PROM (Tile Palette Blue Component) - { "br-b-1l", 0x00100, 0x5271c7d8, BRF_GRA }, // 29 PROM (Sprite Palette Blue Component) - { "br-b-5p", 0x00020, 0xce746937, BRF_GRA }, // 30 PROM (Sprite Height) - { "br-b-6f", 0x00100, 0x82c20d12, BRF_GRA }, // 31 PROM (Video Timing) - { "br-c-1j", 0x00020, 0x78eb5d77, BRF_GRA }, // 32 PROM (Char Palette) -}; - -STD_ROM_PICK(Battroad) -STD_ROM_FN(Battroad) - -static struct BurnRomInfo LdrunRomDesc[] = { - { "lr-a-4e", 0x02000, 0x5d7e2a4d, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "lr-a-4d", 0x02000, 0x96f20473, BRF_ESS | BRF_PRG }, // 1 - { "lr-a-4b", 0x02000, 0xb041c4a9, BRF_ESS | BRF_PRG }, // 2 - { "lr-a-4a", 0x02000, 0x645e42aa, BRF_ESS | BRF_PRG }, // 3 - - { "lr-a-3f", 0x02000, 0x7a96accd, BRF_ESS | BRF_PRG }, // 4 M6803 Program Code - { "lr-a-3h", 0x02000, 0x3f7f3939, BRF_ESS | BRF_PRG }, // 5 - - { "lr-e-2d", 0x02000, 0x24f9b58d, BRF_GRA }, // 6 Characters - { "lr-e-2j", 0x02000, 0x43175e08, BRF_GRA }, // 7 - { "lr-e-2f", 0x02000, 0xe0317124, BRF_GRA }, // 8 - - { "lr-b-4k", 0x02000, 0x8141403e, BRF_GRA }, // 9 Sprites - { "lr-b-3n", 0x02000, 0x55154154, BRF_GRA }, // 10 - { "lr-b-4c", 0x02000, 0x924e34d0, BRF_GRA }, // 11 - - { "lr-e-3m", 0x00100, 0x53040416, BRF_GRA }, // 20 PROM (Tile Palette Red Component) - { "lr-b-1m", 0x00100, 0x4bae1c25, BRF_GRA }, // 21 PROM (Sprite Palette Red Component) - { "lr-e-3l", 0x00100, 0x67786037, BRF_GRA }, // 22 PROM (Tile Palette Green Component) - { "lr-b-1n", 0x00100, 0x9cd3db94, BRF_GRA }, // 23 PROM (Sprite Palette Green Component) - { "lr-e-3n", 0x00100, 0x5b716837, BRF_GRA }, // 24 PROM (Tile Palette Blue Component) - { "lr-b-1l", 0x00100, 0x08d8cf9a, BRF_GRA }, // 25 PROM (Sprite Palette Blue Component) - { "lr-b-5p", 0x00020, 0xe01f69e2, BRF_GRA }, // 26 PROM (Sprite Height) - { "lr-b-6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 27 PROM (Video Timing) -}; - -STD_ROM_PICK(Ldrun) -STD_ROM_FN(Ldrun) - -static struct BurnRomInfo LdrunaRomDesc[] = { - { "roma4c", 0x02000, 0x279421e1, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "lr-a-4d", 0x02000, 0x96f20473, BRF_ESS | BRF_PRG }, // 1 - { "roma4b", 0x02000, 0x3c464bad, BRF_ESS | BRF_PRG }, // 2 - { "roma4a", 0x02000, 0x899df8e0, BRF_ESS | BRF_PRG }, // 3 - - { "lr-a-3f", 0x02000, 0x7a96accd, BRF_ESS | BRF_PRG }, // 4 M6803 Program Code - { "lr-a-3h", 0x02000, 0x3f7f3939, BRF_ESS | BRF_PRG }, // 5 - - { "lr-e-2d", 0x02000, 0x24f9b58d, BRF_GRA }, // 6 Characters - { "lr-e-2j", 0x02000, 0x43175e08, BRF_GRA }, // 7 - { "lr-e-2f", 0x02000, 0xe0317124, BRF_GRA }, // 8 - - { "lr-b-4k", 0x02000, 0x8141403e, BRF_GRA }, // 9 Sprites - { "lr-b-3n", 0x02000, 0x55154154, BRF_GRA }, // 10 - { "lr-b-4c", 0x02000, 0x924e34d0, BRF_GRA }, // 11 - - { "lr-e-3m", 0x00100, 0x53040416, BRF_GRA }, // 20 PROM (Tile Palette Red Component) - { "lr-b-1m", 0x00100, 0x4bae1c25, BRF_GRA }, // 21 PROM (Sprite Palette Red Component) - { "lr-e-3l", 0x00100, 0x67786037, BRF_GRA }, // 22 PROM (Tile Palette Green Component) - { "lr-b-1n", 0x00100, 0x9cd3db94, BRF_GRA }, // 23 PROM (Sprite Palette Green Component) - { "lr-e-3n", 0x00100, 0x5b716837, BRF_GRA }, // 24 PROM (Tile Palette Blue Component) - { "lr-b-1l", 0x00100, 0x08d8cf9a, BRF_GRA }, // 25 PROM (Sprite Palette Blue Component) - { "lr-b-5p", 0x00020, 0xe01f69e2, BRF_GRA }, // 26 PROM (Sprite Height) - { "lr-b-6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 27 PROM (Video Timing) -}; - -STD_ROM_PICK(Ldruna) -STD_ROM_FN(Ldruna) - -static struct BurnRomInfo Ldrun2RomDesc[] = { - { "lr2-a-4e.a", 0x02000, 0x22313327, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "lr2-a-4d", 0x02000, 0xef645179, BRF_ESS | BRF_PRG }, // 1 - { "lr2-a-4a.a", 0x02000, 0xb11ddf59, BRF_ESS | BRF_PRG }, // 2 - { "lr2-a-4a", 0x02000, 0x470cc8a1, BRF_ESS | BRF_PRG }, // 3 - { "lr2-h-1c.a", 0x02000, 0x7ebcadbc, BRF_ESS | BRF_PRG }, // 4 - { "lr2-h-1d.a", 0x02000, 0x64cbb7f9, BRF_ESS | BRF_PRG }, // 5 - - { "lr2-a-3e", 0x02000, 0x853f3898, BRF_ESS | BRF_PRG }, // 6 M6803 Program Code - { "lr2-a-3f", 0x02000, 0x7a96accd, BRF_ESS | BRF_PRG }, // 7 - { "lr2-a-3h", 0x02000, 0x2a0e83ca, BRF_ESS | BRF_PRG }, // 8 - - { "lr2-h-1e", 0x02000, 0x9d63a8ff, BRF_GRA }, // 9 Characters - { "lr2-h-1j", 0x02000, 0x40332bbd, BRF_GRA }, // 10 - { "lr2-h-1h", 0x02000, 0x9404727d, BRF_GRA }, // 11 - - { "lr2-b-4k", 0x02000, 0x79909871, BRF_GRA }, // 12 Sprites - { "lr2-b-4f", 0x02000, 0x06ba1ef4, BRF_GRA }, // 13 - { "lr2-b-3n", 0x02000, 0x3cc5893f, BRF_GRA }, // 14 - { "lr2-b-4n", 0x02000, 0x49c12f42, BRF_GRA }, // 15 - { "lr2-b-4c", 0x02000, 0xfbe6d24c, BRF_GRA }, // 16 - { "lr2-b-4e", 0x02000, 0x75172d1f, BRF_GRA }, // 17 - - { "lr2-h-3m", 0x00100, 0x2c5d834b, BRF_GRA }, // 18 PROM (Tile Palette Red Component) - { "lr2-b-1m", 0x00100, 0x4ec9bb3d, BRF_GRA }, // 19 PROM (Sprite Palette Red Component) - { "lr2-h-3l", 0x00100, 0x3ae69aca, BRF_GRA }, // 20 PROM (Tile Palette Green Component) - { "lr2-b-1n", 0x00100, 0x1daf1fa4, BRF_GRA }, // 21 PROM (Sprite Palette Green Component) - { "lr2-h-3n", 0x00100, 0x2b28aec5, BRF_GRA }, // 22 PROM (Tile Palette Blue Component) - { "lr2-b-1l", 0x00100, 0xc8fb708a, BRF_GRA }, // 23 PROM (Sprite Palette Blue Component) - { "lr2-b-5p", 0x00020, 0xe01f69e2, BRF_GRA }, // 24 PROM (Sprite Height) - { "lr2-b-6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 25 PROM (Video Timing) -}; - -STD_ROM_PICK(Ldrun2) -STD_ROM_FN(Ldrun2) - -static struct BurnRomInfo Ldrun3RomDesc[] = { - { "lr3a4eb.bin", 0x04000, 0x09affc47, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "lr3a4db.bin", 0x04000, 0x23a02178, BRF_ESS | BRF_PRG }, // 1 - { "lr3a4bb.bin", 0x04000, 0x3d501a1a, BRF_ESS | BRF_PRG }, // 2 - - { "lr3-a-3d", 0x04000, 0x28be68cd, BRF_ESS | BRF_PRG }, // 3 M6803 Program Code - { "lr3-a-3f", 0x04000, 0xcb7186b7, BRF_ESS | BRF_PRG }, // 4 - - { "lr3-n-2a", 0x04000, 0xf9b74dee, BRF_GRA }, // 5 Characters - { "lr3-n-2c", 0x04000, 0xfef707ba, BRF_GRA }, // 6 - { "lr3-n-2b", 0x04000, 0xaf3d27b9, BRF_GRA }, // 7 - - { "lr3b4kb.bin", 0x04000, 0x21ecd8c5, BRF_GRA }, // 8 Sprites - { "snxb4fb.bin", 0x04000, 0xed719d7b, BRF_GRA }, // 9 - { "lr3b3nb.bin", 0x04000, 0xda8cffab, BRF_GRA }, // 10 - { "snxb4nb.bin", 0x04000, 0xdc675003, BRF_GRA }, // 11 - { "snxb4cb.bin", 0x04000, 0x585aa244, BRF_GRA }, // 12 - { "snxb4eb.bin", 0x04000, 0x2d3b69dd, BRF_GRA }, // 13 - - { "lr3-n-2l", 0x00100, 0xe880b86b, BRF_GRA }, // 14 PROM (Tile Palette Red Component) - { "lr3-b-1m", 0x00100, 0xf02d7167, BRF_GRA }, // 15 PROM (Sprite Palette Red Component) - { "lr3-n-2k", 0x00100, 0x047ee051, BRF_GRA }, // 16 PROM (Tile Palette Green Component) - { "lr3-b-1n", 0x00100, 0x9e37f181, BRF_GRA }, // 17 PROM (Sprite Palette Green Component) - { "lr3-n-2m", 0x00100, 0x69ad8678, BRF_GRA }, // 18 PROM (Tile Palette Blue Component) - { "lr3-b-1l", 0x00100, 0x5b11c41d, BRF_GRA }, // 19 PROM (Sprite Palette Blue Component) - { "lr3-b-5p", 0x00020, 0xe01f69e2, BRF_GRA }, // 20 PROM (Sprite Height) - { "lr3-b-6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 21 PROM (Video Timing) - { "lr3-n-4f", 0x00100, 0xdf674be9, BRF_OPT }, // 22 PROM (Unknown) -}; - -STD_ROM_PICK(Ldrun3) -STD_ROM_FN(Ldrun3) - -static struct BurnRomInfo Ldrun3jRomDesc[] = { - { "lr3-a-4e", 0x04000, 0x5b334e8e, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "lr3-a-4d.a", 0x04000, 0xa84bc931, BRF_ESS | BRF_PRG }, // 1 - { "lr3-a-4b.a", 0x04000, 0xbe09031d, BRF_ESS | BRF_PRG }, // 2 - - { "lr3-a-3d", 0x04000, 0x28be68cd, BRF_ESS | BRF_PRG }, // 3 M6803 Program Code - { "lr3-a-3f", 0x04000, 0xcb7186b7, BRF_ESS | BRF_PRG }, // 4 - - { "lr3-n-2a", 0x04000, 0xf9b74dee, BRF_GRA }, // 5 Characters - { "lr3-n-2c", 0x04000, 0xfef707ba, BRF_GRA }, // 6 - { "lr3-n-2b", 0x04000, 0xaf3d27b9, BRF_GRA }, // 7 - - { "lr3-b-4k", 0x04000, 0x63f070c7, BRF_GRA }, // 8 Sprites - { "lr3-b-3n", 0x04000, 0xeab7ad91, BRF_GRA }, // 9 - { "lr3-b-4c", 0x04000, 0x1a460a46, BRF_GRA }, // 10 - - { "lr3-n-2l", 0x00100, 0xe880b86b, BRF_GRA }, // 11 PROM (Tile Palette Red Component) - { "lr3-b-1m", 0x00100, 0xf02d7167, BRF_GRA }, // 12 PROM (Sprite Palette Red Component) - { "lr3-n-2k", 0x00100, 0x047ee051, BRF_GRA }, // 13 PROM (Tile Palette Green Component) - { "lr3-b-1n", 0x00100, 0x9e37f181, BRF_GRA }, // 14 PROM (Sprite Palette Green Component) - { "lr3-n-2m", 0x00100, 0x69ad8678, BRF_GRA }, // 15 PROM (Tile Palette Blue Component) - { "lr3-b-1l", 0x00100, 0x5b11c41d, BRF_GRA }, // 16 PROM (Sprite Palette Blue Component) - { "lr3-b-5p", 0x00020, 0xe01f69e2, BRF_GRA }, // 17 PROM (Sprite Height) - { "lr3-b-6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 18 PROM (Video Timing) - { "lr3-n-4f", 0x00100, 0xdf674be9, BRF_OPT }, // 19 PROM (Unknown) -}; - -STD_ROM_PICK(Ldrun3j) -STD_ROM_FN(Ldrun3j) - -static struct BurnRomInfo Ldrun4RomDesc[] = { - { "lr4-a-4e", 0x04000, 0x5383e9bf, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "lr4-a-4d.c", 0x04000, 0x298afa36, BRF_ESS | BRF_PRG }, // 1 - { "lr4-v-4k", 0x08000, 0x8b248abd, BRF_ESS | BRF_PRG }, // 2 - - { "lr4-a-3d", 0x04000, 0x86c6d445, BRF_ESS | BRF_PRG }, // 3 M6803 Program Code - { "lr4-a-3f", 0x04000, 0x097c6c0a, BRF_ESS | BRF_PRG }, // 4 - - { "lr4-v-2b", 0x04000, 0x4118e60a, BRF_GRA }, // 5 Characters - { "lr4-v-2d", 0x04000, 0x542bb5b5, BRF_GRA }, // 6 - { "lr4-v-2c", 0x04000, 0xc765266c, BRF_GRA }, // 7 - - { "lr4-b-4k", 0x04000, 0xe7fe620c, BRF_GRA }, // 8 Sprites - { "lr4-b-4f", 0x04000, 0x6f0403db, BRF_GRA }, // 9 - { "lr4-b-3n", 0x04000, 0xad1fba1b, BRF_GRA }, // 10 - { "lr4-b-4n", 0x04000, 0x0e568fab, BRF_GRA }, // 11 - { "lr4-b-4c", 0x04000, 0x82c53669, BRF_GRA }, // 12 - { "lr4-b-4e", 0x04000, 0x767a1352, BRF_GRA }, // 13 - - { "lr4-v-1m", 0x00100, 0xfe51bf1d, BRF_GRA }, // 14 PROM (Tile Palette Red Component) - { "lr4-b-1m", 0x00100, 0x5d8d17d0, BRF_GRA }, // 15 PROM (Sprite Palette Red Component) - { "lr4-v-1n", 0x00100, 0xda0658e5, BRF_GRA }, // 16 PROM (Tile Palette Green Component) - { "lr4-b-1n", 0x00100, 0xda1129d2, BRF_GRA }, // 17 PROM (Sprite Palette Green Component) - { "lr4-v-1p", 0x00100, 0x0df23ebe, BRF_GRA }, // 18 PROM (Tile Palette Blue Component) - { "lr4-b-1l", 0x00100, 0x0d89b692, BRF_GRA }, // 19 PROM (Sprite Palette Blue Component) - { "lr4-b-5p", 0x00020, 0xe01f69e2, BRF_GRA }, // 20 PROM (Sprite Height) - { "lr4-b-6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 21 PROM (Video Timing) - { "lr4-v-4h", 0x00100, 0xdf674be9, BRF_OPT }, // 22 PROM (Unknown) -}; - -STD_ROM_PICK(Ldrun4) -STD_ROM_FN(Ldrun4) - -static struct BurnRomInfo LotlotRomDesc[] = { - { "lot-a-4e", 0x04000, 0x2913d08f, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "lot-a-4d", 0x04000, 0x0443095f, BRF_ESS | BRF_PRG }, // 1 - - { "lot-a-3h", 0x02000, 0x0781cee7, BRF_ESS | BRF_PRG }, // 2 M6803 Program Code - - { "lot-k-4a", 0x02000, 0x1b3695f4, BRF_GRA }, // 3 Tiles - { "lot-k-4c", 0x02000, 0xbd2b0730, BRF_GRA }, // 4 - { "lot-k-4b", 0x02000, 0x930ddd55, BRF_GRA }, // 5 - - { "lot-b-4k", 0x02000, 0xfd27cb90, BRF_GRA }, // 6 Sprites - { "lot-b-3n", 0x02000, 0xbd486fff, BRF_GRA }, // 7 - { "lot-b-4c", 0x02000, 0x3026ee6c, BRF_GRA }, // 8 - - { "lot-k-4p", 0x02000, 0x3b7d95ba, BRF_GRA }, // 9 Characters - { "lot-k-4l", 0x02000, 0xf98dca1f, BRF_GRA }, // 10 - { "lot-k-4n", 0x02000, 0xf0cd76a5, BRF_GRA }, // 11 - - { "lot-k-2f", 0x00100, 0xb820a05e, BRF_GRA }, // 12 PROM (Tile Palette Red Component) - { "lot-b-1m", 0x00100, 0xc146461d, BRF_GRA }, // 13 PROM (Sprite Palette Red Component) - { "lot-k-2l", 0x00100, 0xac3e230d, BRF_GRA }, // 14 PROM (Char Palette Red Component) - { "lot-k-2e", 0x00100, 0x9b1fa005, BRF_GRA }, // 15 PROM (Tile Palette Green Component) - { "lot-b-1n", 0x00100, 0x01e07db6, BRF_GRA }, // 16 PROM (Sprite Palette Green Component) - { "lot-k-2k", 0x00100, 0x1811ad2b, BRF_GRA }, // 17 PROM (Char Palette Green Component) - { "lot-k-2d", 0x00100, 0x315ed9a8, BRF_GRA }, // 18 PROM (Tile Palette Blue Component) - { "lot-b-1l", 0x00100, 0x8b6fcde3, BRF_GRA }, // 19 PROM (Sprite Palette Blue Component) - { "lot-k-2j", 0x00100, 0xe791ef2a, BRF_GRA }, // 20 PROM (Char Palette Blue Component) - { "lot-b-5p", 0x00020, 0x110b21fd, BRF_GRA }, // 21 PROM (Sprite Height) - { "lot-b-6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 22 PROM (Video Timing) - { "lot-k-7e", 0x00200, 0x6cef0fbd, BRF_GRA }, // 23 PROM (Unknown) - { "lot-k-7h", 0x00200, 0x04442bee, BRF_GRA }, // 24 PROM (Unknown) -}; - -STD_ROM_PICK(Lotlot) -STD_ROM_FN(Lotlot) - -static struct BurnRomInfo KidnikiRomDesc[] = { - { "ky_a-4e-g.bin", 0x04000, 0x2edcbcd7, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "dr03.4cd", 0x04000, 0xdba20934, BRF_ESS | BRF_PRG }, // 1 - { "ky_t-8k-g.bin", 0x08000, 0xdbc42f31, BRF_ESS | BRF_PRG }, // 2 - { "dr12.8l", 0x10000, 0xc0b255fd, BRF_ESS | BRF_PRG }, // 3 - - { "dr00.3a", 0x04000, 0x458309f7, BRF_ESS | BRF_PRG }, // 4 M6803 Program Code - { "dr01.3cd", 0x04000, 0xe66897bd, BRF_ESS | BRF_PRG }, // 5 - { "dr02.3f", 0x04000, 0xf9e31e26, BRF_ESS | BRF_PRG }, // 6 - - { "dr06.2b", 0x08000, 0x4d9a970f, BRF_GRA }, // 7 Tiles - { "dr07.2dc", 0x08000, 0xab59a4c4, BRF_GRA }, // 8 - { "dr05.2a", 0x08000, 0x2e6dad0c, BRF_GRA }, // 9 - - { "dr21.4k", 0x04000, 0xa06cea9a, BRF_GRA }, // 10 Sprites - { "dr19.4f", 0x04000, 0xb34605ad, BRF_GRA }, // 11 - { "dr22.4l", 0x04000, 0x41303de8, BRF_GRA }, // 12 - { "dr20.4jh", 0x04000, 0x5fbe6f61, BRF_GRA }, // 13 - { "dr14.3p", 0x04000, 0x76cfbcbc, BRF_GRA }, // 14 - { "dr24.4p", 0x04000, 0xd51c8db5, BRF_GRA }, // 15 - { "dr23.4nm", 0x04000, 0x03469df8, BRF_GRA }, // 16 - { "dr13.3nm", 0x04000, 0xd5c3dfe0, BRF_GRA }, // 17 - { "dr16.4cb", 0x04000, 0xf1d1bb93, BRF_GRA }, // 18 - { "dr18.4e", 0x04000, 0xedb7f25b, BRF_GRA }, // 19 - { "dr17.4dc", 0x04000, 0x4fb87868, BRF_GRA }, // 20 - { "dr15.4a", 0x04000, 0xe0b88de5, BRF_GRA }, // 21 - - { "dr08.4l", 0x04000, 0x32d50643, BRF_GRA }, // 22 Characters - { "dr09.4m", 0x04000, 0x17df6f95, BRF_GRA }, // 23 - { "dr10.4n", 0x04000, 0x820ce252, BRF_GRA }, // 24 - - { "dr25.3f", 0x00100, 0x8e91430b, BRF_GRA }, // 25 PROM (Tile Palette Red Component) - { "dr30.1m", 0x00100, 0x28c73263, BRF_GRA }, // 26 PROM (Sprite Palette Red Component) - { "dr26.3h", 0x00100, 0xb563b93f, BRF_GRA }, // 27 PROM (Tile Palette Green Component) - { "dr31.1n", 0x00100, 0x3529210e, BRF_GRA }, // 28 PROM (Sprite Palette Green Component) - { "dr27.3j", 0x00100, 0x70d668ef, BRF_GRA }, // 29 PROM (Tile Palette Blue Component) - { "dr29.1l", 0x00100, 0x1173a754, BRF_GRA }, // 30 PROM (Sprite Palette Blue Component) - { "dr32.5p", 0x00020, 0x11cd1f2e, BRF_GRA }, // 31 PROM (Sprite Height) - { "dr33.6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 32 PROM (Video Timing) - { "dr28.8f", 0x00200, 0x6cef0fbd, BRF_OPT }, // 33 PROM (Unknown) -}; - -STD_ROM_PICK(Kidniki) -STD_ROM_FN(Kidniki) - -static struct BurnRomInfo KidnikiuRomDesc[] = { - { "dr04.4e", 0x04000, 0x80431858, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "dr03.4cd", 0x04000, 0xdba20934, BRF_ESS | BRF_PRG }, // 1 - { "dr11.8k", 0x08000, 0x04d82d93, BRF_ESS | BRF_PRG }, // 2 - { "dr12.8l", 0x10000, 0xc0b255fd, BRF_ESS | BRF_PRG }, // 3 - - { "dr00.3a", 0x04000, 0x458309f7, BRF_ESS | BRF_PRG }, // 4 M6803 Program Code - { "dr01.3cd", 0x04000, 0xe66897bd, BRF_ESS | BRF_PRG }, // 5 - { "dr02.3f", 0x04000, 0xf9e31e26, BRF_ESS | BRF_PRG }, // 6 - - { "dr06.2b", 0x08000, 0x4d9a970f, BRF_GRA }, // 7 Tiles - { "dr07.2dc", 0x08000, 0xab59a4c4, BRF_GRA }, // 8 - { "dr05.2a", 0x08000, 0x2e6dad0c, BRF_GRA }, // 9 - - { "dr21.4k", 0x04000, 0xa06cea9a, BRF_GRA }, // 10 Sprites - { "dr19.4f", 0x04000, 0xb34605ad, BRF_GRA }, // 11 - { "dr22.4l", 0x04000, 0x41303de8, BRF_GRA }, // 12 - { "dr20.4jh", 0x04000, 0x5fbe6f61, BRF_GRA }, // 13 - { "dr14.3p", 0x04000, 0x76cfbcbc, BRF_GRA }, // 14 - { "dr24.4p", 0x04000, 0xd51c8db5, BRF_GRA }, // 15 - { "dr23.4nm", 0x04000, 0x03469df8, BRF_GRA }, // 16 - { "dr13.3nm", 0x04000, 0xd5c3dfe0, BRF_GRA }, // 17 - { "dr16.4cb", 0x04000, 0xf1d1bb93, BRF_GRA }, // 18 - { "dr18.4e", 0x04000, 0xedb7f25b, BRF_GRA }, // 19 - { "dr17.4dc", 0x04000, 0x4fb87868, BRF_GRA }, // 20 - { "dr15.4a", 0x04000, 0xe0b88de5, BRF_GRA }, // 21 - - { "dr08.4l", 0x04000, 0x32d50643, BRF_GRA }, // 22 Characters - { "dr09.4m", 0x04000, 0x17df6f95, BRF_GRA }, // 23 - { "dr10.4n", 0x04000, 0x820ce252, BRF_GRA }, // 24 - - { "dr25.3f", 0x00100, 0x8e91430b, BRF_GRA }, // 25 PROM (Tile Palette Red Component) - { "dr30.1m", 0x00100, 0x28c73263, BRF_GRA }, // 26 PROM (Sprite Palette Red Component) - { "dr26.3h", 0x00100, 0xb563b93f, BRF_GRA }, // 27 PROM (Tile Palette Green Component) - { "dr31.1n", 0x00100, 0x3529210e, BRF_GRA }, // 28 PROM (Sprite Palette Green Component) - { "dr27.3j", 0x00100, 0x70d668ef, BRF_GRA }, // 29 PROM (Tile Palette Blue Component) - { "dr29.1l", 0x00100, 0x1173a754, BRF_GRA }, // 30 PROM (Sprite Palette Blue Component) - { "dr32.5p", 0x00020, 0x11cd1f2e, BRF_GRA }, // 31 PROM (Sprite Height) - { "dr33.6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 32 PROM (Video Timing) - { "dr28.8f", 0x00200, 0x6cef0fbd, BRF_OPT }, // 33 PROM (Unknown) -}; - -STD_ROM_PICK(Kidnikiu) -STD_ROM_FN(Kidnikiu) - -static struct BurnRomInfo YanchamrRomDesc[] = { - { "ky_a-4e-.bin", 0x04000, 0xc73ad2d6, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "ky_a-4d-.bin", 0x04000, 0x401af828, BRF_ESS | BRF_PRG }, // 1 - { "ky_t-8k-.bin", 0x08000, 0xe967de88, BRF_ESS | BRF_PRG }, // 2 - { "ky_t-8l-.bin", 0x08000, 0xa929110b, BRF_ESS | BRF_PRG }, // 3 - - { "ky_a-3a-.bin", 0x04000, 0xcb365f3b, BRF_ESS | BRF_PRG }, // 4 M6803 Program Code - { "dr01.3cd", 0x04000, 0xe66897bd, BRF_ESS | BRF_PRG }, // 5 - { "dr02.3f", 0x04000, 0xf9e31e26, BRF_ESS | BRF_PRG }, // 6 - - { "ky_t-2c-.bin", 0x08000, 0xcb9761fc, BRF_GRA }, // 7 Tiles - { "ky_t-2d-.bin", 0x08000, 0x59732741, BRF_GRA }, // 8 - { "ky_t-2a-.bin", 0x08000, 0x0370fd82, BRF_GRA }, // 9 - - { "ky_b-4k-.bin", 0x04000, 0x263a9d10, BRF_GRA }, // 10 Sprites - { "ky_b-4f-.bin", 0x04000, 0x86e3d4a8, BRF_GRA }, // 11 - { "ky_b-4l-.bin", 0x04000, 0x19fa7558, BRF_GRA }, // 12 - { "ky_b-4h-.bin", 0x04000, 0x93e6665c, BRF_GRA }, // 13 - { "ky_b-3n-.bin", 0x04000, 0x0287c525, BRF_GRA }, // 14 - { "ky_b-4n-.bin", 0x04000, 0x764946e0, BRF_GRA }, // 15 - { "ky_b-4m-.bin", 0x04000, 0xeced5db9, BRF_GRA }, // 16 - { "ky_b-3m-.bin", 0x04000, 0xbe6cee44, BRF_GRA }, // 17 - { "ky_b-4c-.bin", 0x04000, 0x84d6b65d, BRF_GRA }, // 18 - { "ky_b-4e-.bin", 0x04000, 0xf91f9273, BRF_GRA }, // 19 - { "ky_b-4d-.bin", 0x04000, 0xa2fc15f0, BRF_GRA }, // 20 - { "ky_b-4a-.bin", 0x04000, 0xff2b9c8a, BRF_GRA }, // 21 - - { "ky_t-4l-.bin", 0x04000, 0x1d0a9253, BRF_GRA }, // 22 Characters - { "ky_t-4m-.bin", 0x04000, 0x4075c396, BRF_GRA }, // 23 - { "ky_t-4n-.bin", 0x04000, 0x7564f2ff, BRF_GRA }, // 24 - - { "dr25.3f", 0x00100, 0x8e91430b, BRF_GRA }, // 25 PROM (Tile Palette Red Component) - { "dr30.1m", 0x00100, 0x28c73263, BRF_GRA }, // 26 PROM (Sprite Palette Red Component) - { "dr26.3h", 0x00100, 0xb563b93f, BRF_GRA }, // 27 PROM (Tile Palette Green Component) - { "dr31.1n", 0x00100, 0x3529210e, BRF_GRA }, // 28 PROM (Sprite Palette Green Component) - { "dr27.3j", 0x00100, 0x70d668ef, BRF_GRA }, // 29 PROM (Tile Palette Blue Component) - { "dr29.1l", 0x00100, 0x1173a754, BRF_GRA }, // 30 PROM (Sprite Palette Blue Component) - { "dr32.5p", 0x00020, 0x11cd1f2e, BRF_GRA }, // 31 PROM (Sprite Height) - { "dr33.6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 32 PROM (Video Timing) - { "dr28.8f", 0x00200, 0x6cef0fbd, BRF_OPT }, // 33 PROM (Unknown) -}; - -STD_ROM_PICK(Yanchamr) -STD_ROM_FN(Yanchamr) - -static struct BurnRomInfo LitheroRomDesc[] = { - { "4.bin", 0x08000, 0x80903766, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "11.bin", 0x08000, 0x7a1ef8cb, BRF_ESS | BRF_PRG }, // 1 - { "12.bin", 0x08000, 0xa929110b, BRF_ESS | BRF_PRG }, // 2 - - { "ky_a-3a-.bin", 0x04000, 0xcb365f3b, BRF_ESS | BRF_PRG }, // 3 M6803 Program Code - { "dr01.3cd", 0x04000, 0xe66897bd, BRF_ESS | BRF_PRG }, // 4 - { "dr02.3f", 0x04000, 0xf9e31e26, BRF_ESS | BRF_PRG }, // 5 - - { "7.bin", 0x08000, 0xb55e8d19, BRF_GRA }, // 6 Tiles - { "6.bin", 0x08000, 0x7bbbb209, BRF_GRA }, // 7 - { "5.bin", 0x08000, 0x0370fd82, BRF_GRA }, // 8 - - { "16.bin", 0x08000, 0x5045a507, BRF_GRA }, // 9 Sprites - { "15.bin", 0x08000, 0x946b16a0, BRF_GRA }, // 10 - { "18.bin", 0x08000, 0x901b69ff, BRF_GRA }, // 11 - { "17.bin", 0x08000, 0x504eed93, BRF_GRA }, // 12 - { "14.bin", 0x08000, 0x429d760b, BRF_GRA }, // 13 - { "13.bin", 0x08000, 0x1700cd64, BRF_GRA }, // 14 - - { "8.bin", 0x04000, 0x4f388d63, BRF_GRA }, // 15 Characters - { "9.bin", 0x04000, 0xdaafa2c1, BRF_GRA }, // 16 - { "10.bin", 0x04000, 0x60649d19, BRF_GRA }, // 17 - - { "dr25.3f", 0x00100, 0x8e91430b, BRF_GRA }, // 18 PROM (Tile Palette Red Component) - { "dr30.1m", 0x00100, 0x28c73263, BRF_GRA }, // 19 PROM (Sprite Palette Red Component) - { "dr26.3h", 0x00100, 0xb563b93f, BRF_GRA }, // 20 PROM (Tile Palette Green Component) - { "dr31.1n", 0x00100, 0x3529210e, BRF_GRA }, // 21 PROM (Sprite Palette Green Component) - { "dr27.3j", 0x00100, 0x70d668ef, BRF_GRA }, // 22 PROM (Tile Palette Blue Component) - { "dr29.1l", 0x00100, 0x1173a754, BRF_GRA }, // 23 PROM (Sprite Palette Blue Component) - { "dr32.5p", 0x00020, 0x11cd1f2e, BRF_GRA }, // 24 PROM (Sprite Height) - { "dr33.6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 25 PROM (Video Timing) - { "dr28.8f", 0x00200, 0x6cef0fbd, BRF_OPT }, // 26 PROM (Unknown) -}; - -STD_ROM_PICK(Lithero) -STD_ROM_FN(Lithero) - -static struct BurnRomInfo SpelunkrRomDesc[] = { - { "spra.4e", 0x04000, 0xcf811201, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "spra.4d", 0x04000, 0xbb4faa4f, BRF_ESS | BRF_PRG }, // 1 - { "sprm.7c", 0x04000, 0xfb6197e2, BRF_ESS | BRF_PRG }, // 2 - { "sprm.7b", 0x04000, 0x26bb25a4, BRF_ESS | BRF_PRG }, // 3 - - { "spra.3d", 0x04000, 0x4110363c, BRF_ESS | BRF_PRG }, // 4 M6803 Program Code - { "spra.3f", 0x04000, 0x67a9d2e6, BRF_ESS | BRF_PRG }, // 5 - - { "sprm.1d", 0x04000, 0x4ef7ae89, BRF_GRA }, // 6 Tiles - { "sprm.1e", 0x04000, 0xa3755180, BRF_GRA }, // 7 - { "sprm.3c", 0x04000, 0xb4008e6a, BRF_GRA }, // 8 - { "sprm.3b", 0x04000, 0xf61cf012, BRF_GRA }, // 9 - { "sprm.1c", 0x04000, 0x58b21c76, BRF_GRA }, // 10 - { "sprm.1b", 0x04000, 0xa95cb3e5, BRF_GRA }, // 11 - - { "sprb.4k", 0x04000, 0xe7f0e861, BRF_GRA }, // 12 Sprites - { "sprb.4f", 0x04000, 0x32663097, BRF_GRA }, // 13 - { "sprb.3p", 0x04000, 0x8fbaf373, BRF_GRA }, // 14 - { "sprb.4p", 0x04000, 0x37069b76, BRF_GRA }, // 15 - { "sprb.4c", 0x04000, 0xcfe46a88, BRF_GRA }, // 16 - { "sprb.4e", 0x04000, 0x11c48979, BRF_GRA }, // 17 - - { "sprm.4p", 0x04000, 0x4dfe2e63, BRF_GRA }, // 18 Characters - { "sprm.4l", 0x04000, 0x239f2cd4, BRF_GRA }, // 19 - { "sprm.4m", 0x04000, 0xd6d07d70, BRF_GRA }, // 20 - - { "sprm.2k", 0x00100, 0xfd8fa991, BRF_GRA }, // 21 PROM (Tile Palette Red Component) - { "sprb.1m", 0x00100, 0x8d8cccad, BRF_GRA }, // 22 PROM (Sprite Palette Red Component) - { "sprm.2j", 0x00100, 0x0e3890b4, BRF_GRA }, // 23 PROM (Tile Palette Green Component) - { "sprb.1n", 0x00100, 0xc40e1cb2, BRF_GRA }, // 24 PROM (Sprite Palette Green Component) - { "sprm.2h", 0x00100, 0x0478082b, BRF_GRA }, // 25 PROM (Tile Palette Blue Component) - { "sprb.1l", 0x00100, 0x3ec46248, BRF_GRA }, // 26 PROM (Sprite Palette Blue Component) - { "sprb.5p", 0x00020, 0x746c6238, BRF_GRA }, // 27 PROM (Sprite Height) - { "sprb.6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 28 PROM (Video Timing) - { "sprm.8h", 0x00200, 0x875cc442, BRF_OPT }, // 29 PROM (Unknown) -}; - -STD_ROM_PICK(Spelunkr) -STD_ROM_FN(Spelunkr) - -static struct BurnRomInfo SpelunkrjRomDesc[] = { - { "spr_a4ec.bin", 0x04000, 0x4e94a80c, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "spr_a4dd.bin", 0x04000, 0xe7c0cbce, BRF_ESS | BRF_PRG }, // 1 - { "spr_m7cc.bin", 0x04000, 0x57598a36, BRF_ESS | BRF_PRG }, // 2 - { "spr_m7bd.bin", 0x04000, 0xecf5137f, BRF_ESS | BRF_PRG }, // 3 - - { "spra.3d", 0x04000, 0x4110363c, BRF_ESS | BRF_PRG }, // 4 M6803 Program Code - { "spra.3f", 0x04000, 0x67a9d2e6, BRF_ESS | BRF_PRG }, // 5 - - { "sprm.1d", 0x04000, 0x4ef7ae89, BRF_GRA }, // 6 Tiles - { "sprm.1e", 0x04000, 0xa3755180, BRF_GRA }, // 7 - { "sprm.3c", 0x04000, 0xb4008e6a, BRF_GRA }, // 8 - { "sprm.3b", 0x04000, 0xf61cf012, BRF_GRA }, // 9 - { "sprm.1c", 0x04000, 0x58b21c76, BRF_GRA }, // 10 - { "sprm.1b", 0x04000, 0xa95cb3e5, BRF_GRA }, // 11 - - { "sprb.4k", 0x04000, 0xe7f0e861, BRF_GRA }, // 12 Sprites - { "sprb.4f", 0x04000, 0x32663097, BRF_GRA }, // 13 - { "sprb.3p", 0x04000, 0x8fbaf373, BRF_GRA }, // 14 - { "sprb.4p", 0x04000, 0x37069b76, BRF_GRA }, // 15 - { "sprb.4c", 0x04000, 0xcfe46a88, BRF_GRA }, // 16 - { "sprb.4e", 0x04000, 0x11c48979, BRF_GRA }, // 17 - - { "sprm.4p", 0x04000, 0x4dfe2e63, BRF_GRA }, // 18 Characters - { "sprm.4l", 0x04000, 0x239f2cd4, BRF_GRA }, // 19 - { "sprm.4m", 0x04000, 0xd6d07d70, BRF_GRA }, // 20 - - { "sprm.2k", 0x00100, 0xfd8fa991, BRF_GRA }, // 21 PROM (Tile Palette Red Component) - { "sprb.1m", 0x00100, 0x8d8cccad, BRF_GRA }, // 22 PROM (Sprite Palette Red Component) - { "sprm.2j", 0x00100, 0x0e3890b4, BRF_GRA }, // 23 PROM (Tile Palette Green Component) - { "sprb.1n", 0x00100, 0xc40e1cb2, BRF_GRA }, // 24 PROM (Sprite Palette Green Component) - { "sprm.2h", 0x00100, 0x0478082b, BRF_GRA }, // 25 PROM (Tile Palette Blue Component) - { "sprb.1l", 0x00100, 0x3ec46248, BRF_GRA }, // 26 PROM (Sprite Palette Blue Component) - { "sprb.5p", 0x00020, 0x746c6238, BRF_GRA }, // 27 PROM (Sprite Height) - { "sprb.6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 28 PROM (Video Timing) - { "sprm.8h", 0x00200, 0x875cc442, BRF_OPT }, // 29 PROM (Unknown) -}; - -STD_ROM_PICK(Spelunkrj) -STD_ROM_FN(Spelunkrj) - -static struct BurnRomInfo Spelunk2RomDesc[] = { - { "sp2-a.4e", 0x04000, 0x96c04bbb, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "sp2-a.4d", 0x04000, 0xcb38c2ff, BRF_ESS | BRF_PRG }, // 1 - { "sp2-r.7d", 0x08000, 0x558837ea, BRF_ESS | BRF_PRG }, // 2 - { "sp2-r.7c", 0x08000, 0x4b380162, BRF_ESS | BRF_PRG }, // 3 - { "sp2-r.7b", 0x04000, 0x7709a1fe, BRF_ESS | BRF_PRG }, // 4 - - { "sp2-a.3d", 0x04000, 0x839ec7e2, BRF_ESS | BRF_PRG }, // 5 M6803 Program Code - { "sp2-a.3f", 0x04000, 0xad3ce898, BRF_ESS | BRF_PRG }, // 6 - - { "sp2-r.1d", 0x08000, 0xc19fa4c9, BRF_GRA }, // 7 Tiles - { "sp2-r.3b", 0x08000, 0x366604af, BRF_GRA }, // 8 - { "sp2-r.1b", 0x08000, 0x3a0c4d47, BRF_GRA }, // 9 - - { "sp2-b.4k", 0x04000, 0x6cb67a17, BRF_GRA }, // 10 Sprites - { "sp2-b.4f", 0x04000, 0xe4a1166f, BRF_GRA }, // 11 - { "sp2-b.3n", 0x04000, 0xf59e8b76, BRF_GRA }, // 12 - { "sp2-b.4n", 0x04000, 0xfa65bac9, BRF_GRA }, // 13 - { "sp2-b.4c", 0x04000, 0x1caf7013, BRF_GRA }, // 14 - { "sp2-b.4e", 0x04000, 0x780a463b, BRF_GRA }, // 15 - - { "sp2-r.4l", 0x04000, 0x6a4b2d8b, BRF_GRA }, // 16 Characters - { "sp2-r.4m", 0x04000, 0xe1368b61, BRF_GRA }, // 17 - { "sp2-r.4p", 0x04000, 0xfc138e13, BRF_GRA }, // 18 - - { "sp2-r.1k", 0x00200, 0x31c1bcdc, BRF_GRA }, // 19 PROM (Char Palette Red and Green Component) - { "sp2-r.2k", 0x00100, 0x1cf5987e, BRF_GRA }, // 20 PROM (Char Palette Blue Component) - { "sp2-r.2j", 0x00100, 0x1acbe2a5, BRF_GRA }, // 21 PROM (Char Palette Blue Component) - { "sp2-b.1m", 0x00100, 0x906104c7, BRF_GRA }, // 22 PROM (Sprite Palette Red Component) - { "sp2-b.1n", 0x00100, 0x5a564c06, BRF_GRA }, // 23 PROM (Sprite Palette Green Component) - { "sp2-b.1l", 0x00100, 0x8f4a2e3c, BRF_GRA }, // 24 PROM (Sprite Palette Blue Component) - { "sp2-b.5p", 0x00020, 0xcd126f6a, BRF_GRA }, // 25 PROM (Sprite Height) - { "sp2-b.6f", 0x00100, 0x34d88d3c, BRF_GRA }, // 26 PROM (Video Timing) - { "sp2-r.8j", 0x00200, 0x875cc442, BRF_OPT }, // 27 PROM (Unknown) - - { "ampal16r4a-sp2-r-3h.bin", 0x00104, 0x00000000, BRF_OPT | BRF_NODUMP }, // 28 PAL -}; - -STD_ROM_PICK(Spelunk2) -STD_ROM_FN(Spelunk2) - -static struct BurnRomInfo YoujyudnRomDesc[] = { - { "yju_a4eb.bin", 0x04000, 0x0d356bdc, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "yju_a4db.bin", 0x04000, 0xc169be13, BRF_ESS | BRF_PRG }, // 1 - { "yju_p4cb.0", 0x04000, 0x60baf3b1, BRF_ESS | BRF_PRG }, // 2 - { "yju_p4eb.1", 0x04000, 0x8d0521f8, BRF_ESS | BRF_PRG }, // 3 - - { "yju_a3fb.bin", 0x04000, 0xe15c8030, BRF_ESS | BRF_PRG }, // 4 M6803 Program Code - - { "yju_p3bb.0", 0x08000, 0xc017913c, BRF_GRA }, // 5 Tiles - { "yju_p1bb.1", 0x08000, 0x94627523, BRF_GRA }, // 6 - { "yju_p1cb.2", 0x08000, 0x6a378c56, BRF_GRA }, // 7 - - { "yju_b4ka.00", 0x04000, 0x1bbb864a, BRF_GRA }, // 8 Sprites - { "yju_b4fa.01", 0x04000, 0x14b4dd24, BRF_GRA }, // 9 - { "yju_b3na.10", 0x04000, 0x68879321, BRF_GRA }, // 10 - { "yju_b4na.11", 0x04000, 0x2860a68b, BRF_GRA }, // 11 - { "yju_b4ca.20", 0x04000, 0xab365829, BRF_GRA }, // 12 - { "yju_b4ea.21", 0x04000, 0xb36c31e4, BRF_GRA }, // 13 - - { "yju_p4lb.2", 0x04000, 0x87878d9b, BRF_GRA }, // 14 Characters - { "yju_p4mb.1", 0x04000, 0x1e1a0d09, BRF_GRA }, // 15 - { "yju_p4pb.0", 0x04000, 0xb4ab520b, BRF_GRA }, // 16 - - { "yju_p2jb.bpr", 0x00100, 0xa4483631, BRF_GRA }, // 17 PROM (Tile Palette Red Component) - { "yju_b1ma.r", 0x00100, 0xa8340e13, BRF_GRA }, // 18 PROM (Sprite Palette Red Component) - { "yju_p2kb.bpr", 0x00100, 0x85481103, BRF_GRA }, // 19 PROM (Tile Palette Green Component) - { "yju_b1na.g", 0x00100, 0xf5b4bc41, BRF_GRA }, // 20 PROM (Sprite Palette Green Component) - { "yju_p2hb.bpr", 0x00100, 0xa6fd355c, BRF_GRA }, // 21 PROM (Tile Palette Blue Component) - { "yju_b1la.b", 0x00100, 0x45e10491, BRF_GRA }, // 22 PROM (Sprite Palette Blue Component) - { "yju_b-5p.bpr", 0x00020, 0x2095e6a3, BRF_GRA }, // 23 PROM (Sprite Height) - { "yju_b-6f.bpr", 0x00100, 0x82c20d12, BRF_GRA }, // 24 PROM (Video Timing) - { "yju_p-8d.bpr", 0x00200, 0x6cef0fbd, BRF_OPT }, // 25 PROM (Unknown) - - { "yju_b-pal16r4a-8m.pal", 0x00104, 0x3ece8e61, BRF_OPT }, // 26 PAL -}; - -STD_ROM_PICK(Youjyudn) -STD_ROM_FN(Youjyudn) - -static struct BurnRomInfo HorizonRomDesc[] = { - { "hrza-4e", 0x04000, 0x98b96ba2, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "hrza-4d", 0x04000, 0x06b06ac7, BRF_ESS | BRF_PRG }, // 1 - { "hrza-4b", 0x04000, 0x39c0bd02, BRF_ESS | BRF_PRG }, // 2 - - { "hrza-3f", 0x04000, 0x7412c99f, BRF_ESS | BRF_PRG }, // 3 M6803 Program Code - - { "hrzd-4d", 0x02000, 0xb93ed581, BRF_GRA }, // 4 Tiles - { "hrzd-4c", 0x02000, 0x1cf73b53, BRF_GRA }, // 5 - { "hrzd-4a", 0x02000, 0xeace8d53, BRF_GRA }, // 6 - - { "hrzb-4k.00", 0x04000, 0x11d2f3a1, BRF_GRA }, // 7 Sprites - { "hrzb-4f.01", 0x04000, 0x356902ea, BRF_GRA }, // 8 - { "hrzb-3n.10", 0x04000, 0x87078a02, BRF_GRA }, // 9 - { "hrzb-4n.11", 0x04000, 0x5019cb1f, BRF_GRA }, // 10 - { "hrzb-4c.20", 0x04000, 0x90b385e7, BRF_GRA }, // 11 - { "hrzb-4e.21", 0x04000, 0xd05d77a2, BRF_GRA }, // 12 - - { "hrzd-1d", 0x00100, 0xb33b08f9, BRF_GRA }, // 13 PROM (Tile Palette Red Component) - { "hrzb-1m.r", 0x00100, 0x0871690a, BRF_GRA }, // 14 PROM (Sprite Palette Red Component) - { "hrzd-1c", 0x00100, 0x6e696f3a, BRF_GRA }, // 15 PROM (Tile Palette Green Component) - { "hrzb-1n.g", 0x00100, 0xf247d0a9, BRF_GRA }, // 16 PROM (Sprite Palette Green Component) - { "hrzd-1e", 0x00100, 0x1fa60379, BRF_GRA }, // 17 PROM (Tile Palette Blue Component) - { "hrzb-1l.b", 0x00100, 0x9ad0a0c8, BRF_GRA }, // 18 PROM (Sprite Palette Blue Component) - { "hrzb-5p", 0x00020, 0x208b49e9, BRF_GRA }, // 19 PROM (Sprite Height) - { "hrzb-6f", 0x00100, 0x82c20d12, BRF_GRA }, // 20 PROM (Video Timing) -}; - -STD_ROM_PICK(Horizon) -STD_ROM_FN(Horizon) - -static INT32 M62MemIndex() -{ - UINT8 *Next; Next = Mem; - - if (!M62BgxTileDim) M62BgxTileDim = 8; - if (!M62BgyTileDim) M62BgyTileDim = 8; - if (!M62CharxTileDim) M62CharxTileDim = 8; - if (!M62CharyTileDim) M62CharyTileDim = 8; - if (!M62SpriteRamSize) M62SpriteRamSize = 0x100; - - M62Z80Rom = Next; Next += M62Z80RomSize; - M62M6803Rom = Next; Next += 0x0c000; - - RamStart = Next; - - M62SpriteRam = Next; Next += M62SpriteRamSize; - M62TileRam = Next; Next += 0x12000; - if (M62CharRamSize) { M62CharRam = Next; Next += M62CharRamSize; } - if (M62ScrollRamSize) { M62ScrollRam = Next; Next += M62ScrollRamSize; } - M62Z80Ram = Next; Next += 0x01000; - M62M6803Ram = Next; Next += 0x00080; - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 6 * sizeof(INT16); - - RamEnd = Next; - - M62Tiles = Next; Next += M62NumTiles * M62BgxTileDim * M62BgyTileDim; - M62Sprites = Next; Next += M62NumSprites * 16 * 16; - if (M62NumChars) { M62Chars = Next; Next += M62NumChars * M62CharxTileDim * M62CharyTileDim; } - M62Palette = (UINT32*)Next; Next += M62PaletteEntries * sizeof(UINT32); - M62PromData = Next; Next += M62PromSize; - - MemEnd = Next; - - return 0; -} - -static INT32 M62DoReset() -{ - ZetOpen(0); - ZetReset(); - ZetClose(); - - M6803Reset(); - - AY8910Reset(0); - AY8910Reset(1); - - MSM5205Reset(); -#ifdef USE_SAMPLE_HACK - BurnSampleReset(); -#endif - - M62Z80BankAddress = 0; - M62Z80BankAddress2 = 0; - M62BackgroundHScroll = 0; - M62BackgroundVScroll = 0; - M62CharHScroll = 0; - M62CharVScroll = 0; - M62FlipScreen = 0; - M62SoundLatch = 0; - M62Port1 = 0; - M62Port2 = 0; - M62SlaveMSM5205VClckReset = 0; - M62BankControl[0] = M62BankControl[1] = 0; - Ldrun2BankSwap = 0; - Ldrun3TopBottomMask = 0; - KidnikiBackgroundBank = 0; - SpelunkrPaletteBank = 0; - - return 0; -} - -UINT8 __fastcall M62Z80Read(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall M62Z80Write(UINT16 a, UINT8 d) -{ - if (a <= 0xbfff) return; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KungfumZ80Read(UINT16 a) -{ - switch (a) { - case 0xf000: - case 0xf001: - case 0xf002: - case 0xf003: { - // ??? - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall KungfumZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xa000: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0xff00) | d; - return; - } - - case 0xb000: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0x00ff) | (d << 8); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Ldrun3Z80Read(UINT16 a) -{ - switch (a) { - case 0xc800: { - return 0x05; - } - - case 0xcc00: { - return 0x07; - } - - case 0xcfff: { - return 0x07; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Ldrun4Z80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xc800: { - M62Z80BankAddress = 0x8000 + ((d & 0x01) * 0x4000); - ZetMapArea(0x8000, 0xbfff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0xbfff, 2, M62Z80Rom + M62Z80BankAddress); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall SpelunkrZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xd000: { - M62BackgroundVScroll = (M62BackgroundVScroll & 0xff00) | d; - return; - } - - case 0xd001: { - M62BackgroundVScroll = (M62BackgroundVScroll & 0x00ff) | (d << 8); - return; - } - - case 0xd002: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0xff00) | d; - return; - } - - case 0xd003: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0x00ff) | (d << 8); - return; - } - - case 0xd004: { - M62Z80BankAddress = 0x8000 + ((d & 0x03) * 0x2000); - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + M62Z80BankAddress); - return; - } - - case 0xd005: { - SpelunkrPaletteBank = d & 0x01; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall Spelunk2Z80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xd000: { - M62BackgroundVScroll = (M62BackgroundVScroll & 0xff00) | d; - return; - } - - case 0xd001: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0xff00) | d; - return; - } - - case 0xd002: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0x00ff) | (((d & 0x02) >> 1) << 8); - M62BackgroundVScroll = (M62BackgroundVScroll & 0x00ff) | ((d & 0x01) << 8); - SpelunkrPaletteBank = (d & 0x0c) >> 2; - return; - } - - case 0xd003: { - M62Z80BankAddress = 0x18000 + (((d & 0xc0) >> 6) * 0x1000); - M62Z80BankAddress2 = 0x08000 + (((d & 0x3c) >> 2) * 0x1000); - ZetMapArea(0x8000, 0x8fff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0x8fff, 2, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x9000, 0x9fff, 0, M62Z80Rom + M62Z80BankAddress2); - ZetMapArea(0x9000, 0x9fff, 2, M62Z80Rom + M62Z80BankAddress2); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall M62Z80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return 0xff - M62Input[0]; - } - - case 0x01: { - return 0xff - M62Input[1]; - } - - case 0x02: { - return 0xff - M62Input[2]; - } - - case 0x03: { - return M62Dip[0]; - } - - case 0x04: { - return M62Dip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall M62Z80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - if ((d & 0x80) == 0) { - M62SoundLatch = d & 0x7f; - } else { - M6803SetIRQLine(M6803_IRQ_LINE, CPU_IRQSTATUS_ACK); - } - return; - } - - case 0x01: { - d ^= ~M62Dip[1] & 0x01; - M62FlipScreen = d & 0x01; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall BattroadZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a <= 0x01) { - M62Z80PortWrite(a, d); - return; - } - - switch (a) { - case 0x80: { - M62BackgroundVScroll = (M62BackgroundVScroll & 0xff00) | d; - return; - } - - case 0x81: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0x00ff) | (d << 8); - return; - } - - case 0x82: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0xff00) | d; - return; - } - - case 0x83: { - M62Z80BankAddress = 0x8000 + ((d & 0x0f) * 0x2000); - ZetMapArea(0xa000, 0xbfff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0xa000, 0xbfff, 2, M62Z80Rom + M62Z80BankAddress); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Ldrun2Z80PortRead(UINT16 a) -{ - a &= 0xff; - - if (a <= 0x04) return M62Z80PortRead(a); - - switch (a) { - case 0x80: { - if (Ldrun2BankSwap) { - Ldrun2BankSwap--; - if (Ldrun2BankSwap == 0) { - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + 0xa000); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + 0xa000); - } - } - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall Ldrun2Z80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a <= 0x01) { - M62Z80PortWrite(a, d); - return; - } - - switch (a) { - case 0x80: - case 0x81: { - static const INT32 Banks[30] = { 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 }; - INT32 Offset = a - 0x80; - - M62BankControl[Offset] = d; - - if (Offset == 0x00) { - if (d >= 1 && d <= 30) { - M62Z80BankAddress = 0x8000 + (Banks[d - 1] * 0x2000); - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + M62Z80BankAddress); - } - } else { - if (M62BankControl[0] == 0x01 && d == 0x0d) { - Ldrun2BankSwap = 2; - } else { - Ldrun2BankSwap = 0; - } - } - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall Ldrun3Z80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a <= 0x01) { - M62Z80PortWrite(a, d); - return; - } - - switch (a) { - case 0x80: { - M62BackgroundVScroll = (M62BackgroundVScroll & 0xff00) | d; - return; - } - - case 0x81: { - Ldrun3TopBottomMask = d & 0x01; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall Ldrun4Z80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a <= 0x01) { - M62Z80PortWrite(a, d); - return; - } - - switch (a) { - case 0x80: { - // ??? - return; - } - - case 0x81: { - // ??? - return; - } - - case 0x82: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0x00ff) | (d << 8); - return; - } - - case 0x83: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0xff00) | d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KidnikiZ80PortRead(UINT16 a) -{ - a &= 0xff; - - if (a <= 0x04) return M62Z80PortRead(a); - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall KidnikiZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a <= 0x01) { - M62Z80PortWrite(a, d); - return; - } - - switch (a) { - case 0x80: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0xff00) | d; - return; - } - - case 0x81: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0x00ff) | (d << 8); - return; - } - - case 0x82: { - M62CharVScroll = (M62CharVScroll & 0xff00) | d; - return; - } - - case 0x83: { - M62CharVScroll = (M62CharVScroll & 0x00ff) | (d << 8); - return; - } - - case 0x84: { - KidnikiBackgroundBank = d & 0x01; - return; - } - - case 0x85: { - M62Z80BankAddress = 0x8000 + ((d & 0x0f) * 0x2000); - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + M62Z80BankAddress); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall YoujyudnZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - if (a <= 0x01) { - M62Z80PortWrite(a, d); - return; - } - - switch (a) { - case 0x80: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0x00ff) | (d << 8); - return; - } - - case 0x81: { - M62BackgroundHScroll = (M62BackgroundHScroll & 0xff00) | d; - return; - } - - case 0x83: { - M62Z80BankAddress = 0x8000 + ((d & 0x01) * 0x4000); - ZetMapArea(0x8000, 0xbfff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0xbfff, 2, M62Z80Rom + M62Z80BankAddress); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 M62M6803ReadByte(UINT16 a) -{ - if (a <= 0x001f) { - return m6803_internal_registers_r(a); - } - - if (a >= 0x0080 && a <= 0x00ff) { - return M62M6803Ram[a - 0x0080]; - } - - bprintf(PRINT_NORMAL, _T("M6803 Read Byte -> %04X\n"), a); - - return 0; -} - -void M62M6803WriteByte(UINT16 a, UINT8 d) -{ - if (a <= 0x001f) { - m6803_internal_registers_w(a, d); - return; - } - - if (a >= 0x0080 && a <= 0x00ff) { - M62M6803Ram[a - 0x0080] = d; - return; - } - - switch (a) { - case 0x0800: { - M6803SetIRQLine(M6803_IRQ_LINE, CPU_IRQSTATUS_NONE); - return; - } - - case 0x0801: { - MSM5205DataWrite(0, d); - return; - } - - case 0x0802: { - MSM5205DataWrite(1, d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("M6803 Write Byte -> %04X, %02X\n"), a, d); -} - -UINT8 M62M6803ReadPort(UINT16 a) -{ - switch (a) { - case M6803_PORT1: { - if (M62Port2 & 0x08) return AY8910Read(0); - if (M62Port2 & 0x10) return AY8910Read(1); - return 0xff; - } - - case M6803_PORT2: { - return 0; - } - } - - bprintf(PRINT_NORMAL, _T("M6803 Read Port -> %04X\n"), a); - - return 0; -} - -void M62M6803WritePort(UINT16 a, UINT8 d) -{ - switch (a) { - case M6803_PORT1: { - M62Port1 = d; - return; - } - - case M6803_PORT2: { - if ((M62Port2 & 0x01) && !(d & 0x01)) { - if (M62Port2 & 0x04) { - if (M62Port2 & 0x08) { - AY8910Write(0, 0, M62Port1); - } - if (M62Port2 & 0x10) { - AY8910Write(1, 0, M62Port1); - } - } else { - if (M62Port2 & 0x08) { - AY8910Write(0, 1, M62Port1); - } - if (M62Port2 & 0x10) { - AY8910Write(1, 1, M62Port1); - } - } - } - - M62Port2 = d; - return; - } - } - - bprintf(PRINT_NORMAL, _T("M6803 Write Port -> %04X, %02X\n"), a, d); -} - -static INT32 Tile1024PlaneOffsets[3] = { 0x20000, 0x10000, 0 }; -static INT32 Tile2048PlaneOffsets[3] = { 0x40000, 0x20000, 0 }; -static INT32 Tile4096PlaneOffsets[3] = { 0x80000, 0x40000, 0 }; -static INT32 TileXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 TileYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 KungfumSpritePlaneOffsets[3] = { 0x80000, 0x40000, 0 }; -static INT32 BattroadSpritePlaneOffsets[3] = { 0x40000, 0x20000, 0 }; -static INT32 LdrunSpritePlaneOffsets[3] = { 0x20000, 0x10000, 0 }; -static INT32 KidnikiSpritePlaneOffsets[3] = { 0x100000, 0x80000, 0 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 BattroadCharPlaneOffsets[2] = { 0, 0x10000 }; -static INT32 LotlotPlaneOffsets[3] = { 0, 0x10000, 0x20000 }; -static INT32 LotlotXOffsets[12] = { 0, 1, 2, 3, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 LotlotYOffsets[10] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72 }; -static INT32 KidnikiPlaneOffsets[3] = { 0, 0x20000, 0x40000 }; -static INT32 KidnikiXOffsets[12] = { 0, 1, 2, 3, 64, 65, 66, 67, 68, 69, 70, 71 }; -static INT32 KidnikiYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 Spelunk2PlaneOffsets[3] = { 0, 0x20000, 0x40000 }; -static INT32 Spelunk2XOffsets[12] = { 0, 1, 2, 3, 0x10000, 0x10001, 0x10002, 0x10003, 0x10004, 0x10005, 0x10006, 0x10007 }; -static INT32 Spelunk2YOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 YoujyudnTilePlaneOffsets[3] = { 0x40000, 0x20000, 0 }; -static INT32 YoujyudnTileXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 YoujyudnTileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; - -UINT8 M62SoundLatchRead(UINT32) -{ - return M62SoundLatch; -} - -static void AY8910_0PortBWrite(UINT32, UINT32 d) -{ - MSM5205PlaymodeWrite(0, (d >> 2) & 0x07); - MSM5205PlaymodeWrite(1, ((d >> 2) & 0x04) | 0x03); - - MSM5205ResetWrite(0, d & 0x01); - MSM5205ResetWrite(1, d & 0x02); -} - -static void AY8910_1PortAWrite(UINT32, UINT32 data) -{ - if (data == 0xff) { - //bprintf(0, _T("M62 Analog drumkit init.\n")); - return; - } - - if (data > 0) { - if (data & 0x01) // bass drum - BurnSamplePlay(2); - if (data & 0x02) // snare drum - BurnSamplePlay(1); - if (data & 0x04) // open hat - BurnSamplePlay(3); - if (data & 0x08) // closed hat - BurnSamplePlay(0); - } -} - -inline static INT32 M62SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate / M62Z80Clock); -} - -static void M62MSM5205Vck0() -{ - M6803SetIRQLine(M6803_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - M62SlaveMSM5205VClckReset = 1; -} - -static INT32 M62MemInit() -{ - INT32 nLen; - - M62PaletteEntries = BurnDrvGetPaletteEntries(); - - Mem = NULL; - M62MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - M62MemIndex(); - - return 0; -} - -static INT32 KungfumLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x06000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x0a000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 7, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile1024PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x06000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0a000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0e000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x12000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x16000, 19, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KungfumSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 27, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 KungfumdLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x04000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 6, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile1024PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 12, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KungfumSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 20, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 Kungfub3LoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x06000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x0a000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 7, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile1024PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 13, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KungfumSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 21, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 BattroadLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x0c000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x02000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x06000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x0a000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x0c000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x0e000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x14000, 9, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x06000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x0a000, 12, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x0c000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 15, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile1024PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x0c000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x06000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0a000, 21, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, BattroadSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load and decode the chars - memset(M62TempRom, 0, 0x0c000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 23, 1); if (nRet != 0) return 1; - GfxDecode(M62NumChars, 2, M62CharxTileDim, M62CharyTileDim, BattroadCharPlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Chars); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 28, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 29, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 30, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 31, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00720, 32, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 LdrunLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x06000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x02000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x06000, 3, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x0a000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x06000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 8, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile1024PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x06000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 11, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, LdrunSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 19, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 Ldrun2LoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x0c000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x02000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x06000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x0a000, 5, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x06000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x0a000, 8, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x0c000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 11, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile1024PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x0c000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x06000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0a000, 17, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, BattroadSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 25, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 Ldrun3LoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 2, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x04000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 7, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile2048PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 13, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KungfumSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 21, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 Ldrun3jLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x0c000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 2, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x04000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x0c000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 7, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile2048PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x0c000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, BattroadSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 18, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 LotlotLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x06000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x0a000, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x06000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 5, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, LotlotPlaneOffsets, LotlotXOffsets, LotlotYOffsets, 0x100, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x06000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 8, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, LdrunSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load and decode the chars - memset(M62TempRom, 0, 0x06000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 11, 1); if (nRet != 0) return 1; - GfxDecode(M62NumChars, 3, M62CharxTileDim, M62CharyTileDim, LotlotPlaneOffsets, LotlotXOffsets, LotlotYOffsets, 0x100, M62TempRom, M62Chars); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00700, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00800, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00900, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00920, 22, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 KidnikiLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x30000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x10000, 3, 1); if (nRet != 0) return 1; - memcpy(M62Z80Rom + 0x20000, M62Z80Rom + 0x18000, 0x8000); - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x04000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 6, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x30000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 9, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile4096PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x30000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x18000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x1c000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x20000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x24000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x28000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x2c000, 21, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KidnikiSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load and decode the chars - memset(M62TempRom, 0, 0x30000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 24, 1); if (nRet != 0) return 1; - GfxDecode(M62NumChars, 3, M62CharxTileDim, M62CharyTileDim, KidnikiPlaneOffsets, KidnikiXOffsets, KidnikiYOffsets, 0x80, M62TempRom, M62Chars); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 28, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 29, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 30, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 31, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 32, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 LitheroLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x30000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x10000, 2, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x04000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x30000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile4096PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x30000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x18000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x20000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x28000, 14, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KidnikiSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load and decode the chars - memset(M62TempRom, 0, 0x30000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 17, 1); if (nRet != 0) return 1; - GfxDecode(M62NumChars, 3, M62CharxTileDim, M62CharyTileDim, KidnikiPlaneOffsets, KidnikiXOffsets, KidnikiYOffsets, 0x80, M62TempRom, M62Chars); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 25, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 SpelunkrLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x0c000, 3, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x04000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 11, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile4096PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 17, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KungfumSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load and decode the chars - memset(M62TempRom, 0, 0x18000); - UINT8 *pTemp = (UINT8*)BurnMalloc(0x18000); - nRet = BurnLoadRom(pTemp + 0x00000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x04000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x08000, 20, 1); if (nRet != 0) return 1; - memcpy(M62TempRom + 0x0000, pTemp + 0x0000, 0x800); - memcpy(M62TempRom + 0x2000, pTemp + 0x0800, 0x800); - memcpy(M62TempRom + 0x0800, pTemp + 0x1000, 0x800); - memcpy(M62TempRom + 0x2800, pTemp + 0x1800, 0x800); - memcpy(M62TempRom + 0x1000, pTemp + 0x2000, 0x800); - memcpy(M62TempRom + 0x3000, pTemp + 0x2800, 0x800); - memcpy(M62TempRom + 0x0800, pTemp + 0x3000, 0x800); - memcpy(M62TempRom + 0x3800, pTemp + 0x3800, 0x800); - memcpy(M62TempRom + 0x4000, pTemp + 0x4000, 0x800); - memcpy(M62TempRom + 0x6000, pTemp + 0x4800, 0x800); - memcpy(M62TempRom + 0x4800, pTemp + 0x5000, 0x800); - memcpy(M62TempRom + 0x6800, pTemp + 0x5800, 0x800); - memcpy(M62TempRom + 0x5000, pTemp + 0x6000, 0x800); - memcpy(M62TempRom + 0x7000, pTemp + 0x6800, 0x800); - memcpy(M62TempRom + 0x5800, pTemp + 0x7000, 0x800); - memcpy(M62TempRom + 0x7800, pTemp + 0x7800, 0x800); - memcpy(M62TempRom + 0x8000, pTemp + 0x8000, 0x800); - memcpy(M62TempRom + 0xa000, pTemp + 0x8800, 0x800); - memcpy(M62TempRom + 0x8800, pTemp + 0x9000, 0x800); - memcpy(M62TempRom + 0xa800, pTemp + 0x9800, 0x800); - memcpy(M62TempRom + 0x9000, pTemp + 0xa000, 0x800); - memcpy(M62TempRom + 0xb000, pTemp + 0xa800, 0x800); - memcpy(M62TempRom + 0x9800, pTemp + 0xb000, 0x800); - memcpy(M62TempRom + 0xb800, pTemp + 0xb800, 0x800); - BurnFree(pTemp); - GfxDecode(M62NumChars, 3, M62CharxTileDim, M62CharyTileDim, Spelunk2PlaneOffsets, Spelunk2XOffsets, Spelunk2YOffsets, 0x40, M62TempRom, M62Chars); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 28, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 Spelunk2LoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x10000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x18000, 4, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x04000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 6, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 9, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile4096PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 15, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KungfumSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load and decode the chars - memset(M62TempRom, 0, 0x18000); - UINT8 *pTemp = (UINT8*)BurnMalloc(0x18000); - nRet = BurnLoadRom(pTemp + 0x00000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x04000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x08000, 18, 1); if (nRet != 0) return 1; - memcpy(M62TempRom + 0x0000, pTemp + 0x0000, 0x800); - memcpy(M62TempRom + 0x2000, pTemp + 0x0800, 0x800); - memcpy(M62TempRom + 0x0800, pTemp + 0x1000, 0x800); - memcpy(M62TempRom + 0x2800, pTemp + 0x1800, 0x800); - memcpy(M62TempRom + 0x1000, pTemp + 0x2000, 0x800); - memcpy(M62TempRom + 0x3000, pTemp + 0x2800, 0x800); - memcpy(M62TempRom + 0x0800, pTemp + 0x3000, 0x800); - memcpy(M62TempRom + 0x3800, pTemp + 0x3800, 0x800); - memcpy(M62TempRom + 0x4000, pTemp + 0x4000, 0x800); - memcpy(M62TempRom + 0x6000, pTemp + 0x4800, 0x800); - memcpy(M62TempRom + 0x4800, pTemp + 0x5000, 0x800); - memcpy(M62TempRom + 0x6800, pTemp + 0x5800, 0x800); - memcpy(M62TempRom + 0x5000, pTemp + 0x6000, 0x800); - memcpy(M62TempRom + 0x7000, pTemp + 0x6800, 0x800); - memcpy(M62TempRom + 0x5800, pTemp + 0x7000, 0x800); - memcpy(M62TempRom + 0x7800, pTemp + 0x7800, 0x800); - memcpy(M62TempRom + 0x8000, pTemp + 0x8000, 0x800); - memcpy(M62TempRom + 0xa000, pTemp + 0x8800, 0x800); - memcpy(M62TempRom + 0x8800, pTemp + 0x9000, 0x800); - memcpy(M62TempRom + 0xa800, pTemp + 0x9800, 0x800); - memcpy(M62TempRom + 0x9000, pTemp + 0xa000, 0x800); - memcpy(M62TempRom + 0xb000, pTemp + 0xa800, 0x800); - memcpy(M62TempRom + 0x9800, pTemp + 0xb000, 0x800); - memcpy(M62TempRom + 0xb800, pTemp + 0xb800, 0x800); - BurnFree(pTemp); - GfxDecode(M62NumChars, 3, M62CharxTileDim, M62CharyTileDim, Spelunk2PlaneOffsets, Spelunk2XOffsets, Spelunk2YOffsets, 0x40, M62TempRom, M62Chars); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00700, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00720, 26, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 YoujyudnLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x0c000, 3, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x18000); - UINT8 *pTemp = (UINT8*)BurnMalloc(0x18000); - nRet = BurnLoadRom(pTemp + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x08000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x10000, 7, 1); if (nRet != 0) return 1; - memcpy(M62TempRom + 0x0000, pTemp + 0x04000, 0x4000); - memcpy(M62TempRom + 0x4000, pTemp + 0x0c000, 0x4000); - memcpy(M62TempRom + 0x8000, pTemp + 0x14000, 0x4000); - BurnFree(pTemp); - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, YoujyudnTilePlaneOffsets, YoujyudnTileXOffsets, YoujyudnTileYOffsets, 0x80, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 13, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KungfumSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load and decode the chars - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 16, 1); if (nRet != 0) return 1; - GfxDecode(M62NumChars, 3, M62CharxTileDim, M62CharyTileDim, KidnikiPlaneOffsets, KidnikiXOffsets, KidnikiYOffsets, 0x80, M62TempRom, M62Chars); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 24, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static INT32 HorizonLoadRoms() -{ - INT32 nRet = 0; - - M62TempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(M62Z80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62Z80Rom + 0x08000, 2, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(M62M6803Rom + 0x08000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x02000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 6, 1); if (nRet != 0) return 1; - GfxDecode(M62NumTiles, 3, M62BgxTileDim, M62BgyTileDim, Tile1024PlaneOffsets, TileXOffsets, TileYOffsets, 0x40, M62TempRom, M62Tiles); - - // Load and decode the sprites - memset(M62TempRom, 0, 0x18000); - nRet = BurnLoadRom(M62TempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x04000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x08000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x0c000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x10000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62TempRom + 0x14000, 12, 1); if (nRet != 0) return 1; - GfxDecode(M62NumSprites, 3, 16, 16, KungfumSpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, M62TempRom, M62Sprites); - - // Load the Proms - nRet = BurnLoadRom(M62PromData + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00100, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00200, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00300, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00400, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00500, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00600, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(M62PromData + 0x00620, 20, 1); if (nRet != 0) return 1; - - BurnFree(M62TempRom); - - return 0; -} - -static void M62MachineInit() -{ -// BurnSetRefreshRate(55.0); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(M62Z80Read); - ZetSetWriteHandler(M62Z80Write); - ZetSetInHandler(M62Z80PortRead); - ZetSetOutHandler(M62Z80PortWrite); - ZetMapArea(0x0000, 0x7fff, 0, M62Z80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, M62Z80Rom ); - ZetMapArea(0xc000, 0xc0ff, 0, M62SpriteRam); - ZetMapArea(0xc000, 0xc0ff, 1, M62SpriteRam); - ZetMapArea(0xc000, 0xc0ff, 2, M62SpriteRam); - ZetMapArea(0xd000, 0xdfff, 0, M62TileRam ); - ZetMapArea(0xd000, 0xdfff, 1, M62TileRam ); - ZetMapArea(0xd000, 0xdfff, 2, M62TileRam ); - ZetMapArea(0xe000, 0xefff, 0, M62Z80Ram ); - ZetMapArea(0xe000, 0xefff, 1, M62Z80Ram ); - ZetMapArea(0xe000, 0xefff, 2, M62Z80Ram ); - ZetClose(); - - M6803Init(1); - M6803MapMemory(M62M6803Rom, 0x4000, 0xffff, MAP_ROM); - M6803SetReadHandler(M62M6803ReadByte); - M6803SetWriteHandler(M62M6803WriteByte); - M6803SetReadPortHandler(M62M6803ReadPort); - M6803SetWritePortHandler(M62M6803WritePort); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - MSM5205Init(0, M62SynchroniseStream, 384000, M62MSM5205Vck0, MSM5205_S96_4B, 1); - MSM5205Init(1, M62SynchroniseStream, 384000, NULL, MSM5205_SEX_4B, 1); - MSM5205SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - MSM5205SetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 894886, nBurnSoundRate, &M62SoundLatchRead, NULL, NULL, &AY8910_0PortBWrite); - AY8910Init(1, 894886, nBurnSoundRate, NULL, NULL, &AY8910_1PortAWrite, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); -#ifdef USE_SAMPLE_HACK - BurnUpdateProgress(0.0, _T("Loading samples..."), 0); - bBurnSampleTrimSampleEnd = 1; - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.40, BURN_SND_ROUTE_BOTH); - bHasSamples = BurnSampleGetStatus(0) != -1; - - if (!bHasSamples) { // Samples not found - BurnSampleSetAllRoutesAllSamples(0.00, BURN_SND_ROUTE_BOTH); - } else { - bprintf(0, _T("Using TR606 Drumkit samples!\n")); - // Hat - BurnSampleSetRoute(0, BURN_SND_SAMPLE_ROUTE_1, 0.11, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(0, BURN_SND_SAMPLE_ROUTE_2, 0.11, BURN_SND_ROUTE_BOTH); - // Snare - BurnSampleSetRoute(1, BURN_SND_SAMPLE_ROUTE_1, 0.40, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(1, BURN_SND_SAMPLE_ROUTE_2, 0.40, BURN_SND_ROUTE_BOTH); - // Kick - BurnSampleSetRoute(2, BURN_SND_SAMPLE_ROUTE_1, 0.40, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(2, BURN_SND_SAMPLE_ROUTE_2, 0.40, BURN_SND_ROUTE_BOTH); - // Open Hat - BurnSampleSetRoute(3, BURN_SND_SAMPLE_ROUTE_1, 0.11, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(3, BURN_SND_SAMPLE_ROUTE_2, 0.11, BURN_SND_ROUTE_BOTH); - } -#endif - - GenericTilesInit(); - - M62Z80Clock = 4000000; - M62M6803Clock = 894886; - - M62SpriteHeightPromOffset = (M62PaletteEntries & 0xf00) * 3; -} - -static INT32 KungfumMachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetSetReadHandler(KungfumZ80Read); - ZetSetWriteHandler(KungfumZ80Write); - ZetClose(); - - M62Z80Clock = 3072000; - M62RenderFunction = KungfumDraw; - - M62DoReset(); - - return 0; -} - -static INT32 BattroadMachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetSetOutHandler(BattroadZ80PortWrite); - ZetMapArea(0xa000, 0xbfff, 0, M62Z80Rom + 0x8000); - ZetMapArea(0xa000, 0xbfff, 2, M62Z80Rom + 0x8000); - ZetMapArea(0xc800, 0xcfff, 0, M62CharRam ); - ZetMapArea(0xc800, 0xcfff, 1, M62CharRam ); - ZetMapArea(0xc800, 0xcfff, 2, M62CharRam ); - ZetClose(); - - M62Z80Clock = 3072000; - - M62RenderFunction = BattroadDraw; - M62ExtendTileInfoFunction = BattroadExtendTile; - M62ExtendCharInfoFunction = BattroadExtendChar; - - M62DoReset(); - - return 0; -} - -static INT32 LdrunMachineInit() -{ - M62MachineInit(); - - M62RenderFunction = LdrunDraw; - M62ExtendTileInfoFunction = LdrunExtendTile; - - M62DoReset(); - - return 0; -} - -static INT32 Ldrun2MachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetSetInHandler(Ldrun2Z80PortRead); - ZetSetOutHandler(Ldrun2Z80PortWrite); - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + 0x8000); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + 0x8000); - ZetClose(); - - M62RenderFunction = LdrunDraw; - M62ExtendTileInfoFunction = Ldrun2ExtendTile; - - M62DoReset(); - - return 0; -} - -static INT32 Ldrun3MachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetSetReadHandler(Ldrun3Z80Read); - ZetSetOutHandler(Ldrun3Z80PortWrite); - ZetMapArea(0x8000, 0xbfff, 0, M62Z80Rom + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, M62Z80Rom + 0x8000); - ZetClose(); - - M62RenderFunction = Ldrun3Draw; - M62ExtendTileInfoFunction = Ldrun2ExtendTile; - - M62DoReset(); - - return 0; -} - -static INT32 Ldrun4MachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetSetWriteHandler(Ldrun4Z80Write); - ZetSetOutHandler(Ldrun4Z80PortWrite); - ZetMapArea(0x8000, 0xbfff, 0, M62Z80Rom + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, M62Z80Rom + 0x8000); - ZetClose(); - - M62RenderFunction = Ldrun4Draw; - M62ExtendTileInfoFunction = Ldrun4ExtendTile; - - M62DoReset(); - - return 0; -} - -static INT32 LotlotMachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetMapArea(0xa000, 0xafff, 0, M62CharRam); - ZetMapArea(0xa000, 0xafff, 1, M62CharRam); - ZetMapArea(0xa000, 0xafff, 2, M62CharRam); - ZetClose(); - - M62RenderFunction = LotlotDraw; - M62ExtendTileInfoFunction = LotlotExtendTile; - M62ExtendCharInfoFunction = LotlotExtendChar; - - M62DoReset(); - - return 0; -} - -static INT32 KidnikiMachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetSetInHandler(KidnikiZ80PortRead); - ZetSetOutHandler(KidnikiZ80PortWrite); - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + 0x8000); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + 0x8000); - ZetMapArea(0xa000, 0xafff, 0, M62TileRam ); - ZetMapArea(0xa000, 0xafff, 1, M62TileRam ); - ZetMapArea(0xa000, 0xafff, 2, M62TileRam ); - ZetMapArea(0xd000, 0xdfff, 0, M62CharRam ); - ZetMapArea(0xd000, 0xdfff, 1, M62CharRam ); - ZetMapArea(0xd000, 0xdfff, 2, M62CharRam ); - ZetClose(); - - M62RenderFunction = KidnikiDraw; - M62ExtendTileInfoFunction = KidnikiExtendTile; - M62ExtendCharInfoFunction = LotlotExtendChar; - - M62DoReset(); - - return 0; -} - -static INT32 SpelunkrMachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetSetWriteHandler(SpelunkrZ80Write); - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + 0x8000); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + 0x8000); - ZetMapArea(0xa000, 0xbfff, 0, M62TileRam ); - ZetMapArea(0xa000, 0xbfff, 1, M62TileRam ); - ZetMapArea(0xa000, 0xbfff, 2, M62TileRam ); - ZetMapArea(0xc800, 0xcfff, 0, M62CharRam ); - ZetMapArea(0xc800, 0xcfff, 1, M62CharRam ); - ZetMapArea(0xc800, 0xcfff, 2, M62CharRam ); - ZetMemCallback(0xd000, 0xdfff, 0); - ZetMemCallback(0xd000, 0xdfff, 1); - ZetMemCallback(0xd000, 0xdfff, 2); - ZetClose(); - - M62RenderFunction = SpelunkrDraw; - M62ExtendTileInfoFunction = SpelunkrExtendTile; - M62ExtendCharInfoFunction = SpelunkrExtendChar; - M62Z80Clock = 5000000; // needs a little boost or the top bg tiles don't scroll right. weird. -dink - - M62DoReset(); - - return 0; -} - -static INT32 Spelunk2MachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetSetWriteHandler(Spelunk2Z80Write); - ZetMapArea(0x8000, 0x8fff, 0, M62Z80Rom + 0x18000); - ZetMapArea(0x8000, 0x8fff, 2, M62Z80Rom + 0x18000); - ZetMapArea(0x9000, 0x9fff, 0, M62Z80Rom + 0x08000); - ZetMapArea(0x9000, 0x9fff, 2, M62Z80Rom + 0x08000); - ZetMapArea(0xa000, 0xbfff, 0, M62TileRam ); - ZetMapArea(0xa000, 0xbfff, 1, M62TileRam ); - ZetMapArea(0xa000, 0xbfff, 2, M62TileRam ); - ZetMapArea(0xc800, 0xcfff, 0, M62CharRam ); - ZetMapArea(0xc800, 0xcfff, 1, M62CharRam ); - ZetMapArea(0xc800, 0xcfff, 2, M62CharRam ); - ZetMemCallback(0xd000, 0xdfff, 0); - ZetMemCallback(0xd000, 0xdfff, 1); - ZetMemCallback(0xd000, 0xdfff, 2); - ZetClose(); - - M62RenderFunction = Spelunk2Draw; - M62ExtendTileInfoFunction = Spelunk2ExtendTile; - M62ExtendCharInfoFunction = SpelunkrExtendChar; - - M62SpriteHeightPromOffset = 0x700; - - M62DoReset(); - - return 0; -} - -static INT32 YoujyudnMachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetSetOutHandler(YoujyudnZ80PortWrite); - ZetMapArea(0x8000, 0xbfff, 0, M62Z80Rom + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, M62Z80Rom + 0x8000); - ZetMapArea(0xc800, 0xcfff, 0, M62CharRam ); - ZetMapArea(0xc800, 0xcfff, 1, M62CharRam ); - ZetMapArea(0xc800, 0xcfff, 2, M62CharRam ); - ZetMemCallback(0xd800, 0xdfff, 0); - ZetMemCallback(0xd800, 0xdfff, 1); - ZetMemCallback(0xd800, 0xdfff, 2); - ZetClose(); - - M62RenderFunction = YoujyudnDraw; - M62ExtendTileInfoFunction = YoujyudnExtendTile; - M62ExtendCharInfoFunction = YoujyudnExtendChar; - - M62Z80Clock = 3072000; - - M62DoReset(); - - return 0; -} - -static INT32 HorizonMachineInit() -{ - M62MachineInit(); - - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, M62Z80Rom + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, M62Z80Rom + 0x8000); - ZetMapArea(0xc000, 0xc1ff, 0, M62SpriteRam ); - ZetMapArea(0xc000, 0xc1ff, 1, M62SpriteRam ); - ZetMapArea(0xc000, 0xc1ff, 2, M62SpriteRam ); - ZetMapArea(0xc800, 0xc83f, 0, M62ScrollRam ); - ZetMapArea(0xc800, 0xc83f, 1, M62ScrollRam ); - ZetMapArea(0xc800, 0xc83f, 2, M62ScrollRam ); - ZetClose(); - - M62RenderFunction = HorizonDraw; - M62ExtendTileInfoFunction = HorizonExtendTile; - - M62DoReset(); - - return 0; -} - -static INT32 KungfumInit() -{ - M62Z80RomSize = 0x8000; - M62PromSize = 0x720; - M62NumTiles = 0x400; - M62NumSprites = 0x400; - - if (M62MemInit()) return 1; - if (KungfumLoadRoms()) return 1; - if (KungfumMachineInit()) return 1; - - return 0; -} - -static INT32 KungfumdInit() -{ - M62Z80RomSize = 0x8000; - M62PromSize = 0x720; - M62NumTiles = 0x400; - M62NumSprites = 0x400; - - if (M62MemInit()) return 1; - if (KungfumdLoadRoms()) return 1; - if (KungfumMachineInit()) return 1; - - return 0; -} - -static INT32 Kungfub3Init() -{ - M62Z80RomSize = 0x8000; - M62PromSize = 0x720; - M62NumTiles = 0x400; - M62NumSprites = 0x400; - - if (M62MemInit()) return 1; - if (Kungfub3LoadRoms()) return 1; - if (KungfumMachineInit()) return 1; - - return 0; -} - -static INT32 BattroadInit() -{ - M62Z80RomSize = 0x16000; - M62PromSize = 0x740; - M62NumTiles = 0x400; - M62NumSprites = 0x200; - M62NumChars = 0x400; - M62CharRamSize = 0x800; - - if (M62MemInit()) return 1; - if (BattroadLoadRoms()) return 1; - if (BattroadMachineInit()) return 1; - - return 0; -} - -static INT32 LdrunInit() -{ - M62Z80RomSize = 0x8000; - M62PromSize = 0x720; - M62NumTiles = 0x400; - M62NumSprites = 0x100; - - if (M62MemInit()) return 1; - if (LdrunLoadRoms()) return 1; - if (LdrunMachineInit()) return 1; - - return 0; -} - -static INT32 Ldrun2Init() -{ - M62Z80RomSize = 0xc000; - M62PromSize = 0x720; - M62NumTiles = 0x400; - M62NumSprites = 0x200; - - if (M62MemInit()) return 1; - if (Ldrun2LoadRoms()) return 1; - if (Ldrun2MachineInit()) return 1; - - return 0; -} - -static INT32 Ldrun3Init() -{ - M62Z80RomSize = 0xc000; - M62PromSize = 0x720; - M62NumTiles = 0x800; - M62NumSprites = 0x400; - - if (M62MemInit()) return 1; - if (Ldrun3LoadRoms()) return 1; - if (Ldrun3MachineInit()) return 1; - - return 0; -} - -static INT32 Ldrun3jInit() -{ - M62Z80RomSize = 0xc000; - M62PromSize = 0x720; - M62NumTiles = 0x800; - M62NumSprites = 0x200; - - if (M62MemInit()) return 1; - if (Ldrun3jLoadRoms()) return 1; - if (Ldrun3MachineInit()) return 1; - - return 0; -} - -static INT32 Ldrun4Init() -{ - M62Z80RomSize = 0x10000; - M62PromSize = 0x720; - M62NumTiles = 0x800; - M62NumSprites = 0x400; - - if (M62MemInit()) return 1; - if (Ldrun3LoadRoms()) return 1; - if (Ldrun4MachineInit()) return 1; - - return 0; -} - -static INT32 LotlotInit() -{ - M62Z80RomSize = 0x8000; - M62PromSize = 0xa20; - M62NumTiles = 0x100; - M62NumSprites = 0x100; - M62NumChars = 0x100; - M62CharRamSize = 0x1000; - M62BgxTileDim = 12; - M62BgyTileDim = 10; - M62CharxTileDim = 12; - M62CharyTileDim = 10; - - if (M62MemInit()) return 1; - if (LotlotLoadRoms()) return 1; - if (LotlotMachineInit()) return 1; - - return 0; -} - -static INT32 KidnikiInit() -{ - M62Z80RomSize = 0x28000; - M62PromSize = 0x720; - M62NumTiles = 0x1000; - M62NumSprites = 0x800; - M62NumChars = 0x400; - M62CharRamSize = 0x1000; - M62BgxTileDim = 8; - M62BgyTileDim = 8; - M62CharxTileDim = 12; - M62CharyTileDim = 8; - - if (M62MemInit()) return 1; - if (KidnikiLoadRoms()) return 1; - if (KidnikiMachineInit()) return 1; - - return 0; -} - -static INT32 LitheroInit() -{ - M62Z80RomSize = 0x28000; - M62PromSize = 0x720; - M62NumTiles = 0x1000; - M62NumSprites = 0x800; - M62NumChars = 0x400; - M62CharRamSize = 0x1000; - M62BgxTileDim = 8; - M62BgyTileDim = 8; - M62CharxTileDim = 12; - M62CharyTileDim = 8; - - if (M62MemInit()) return 1; - if (LitheroLoadRoms()) return 1; - if (KidnikiMachineInit()) return 1; - - return 0; -} - -static INT32 SpelunkrInit() -{ - M62Z80RomSize = 0x10000; - M62PromSize = 0x720; - M62NumTiles = 0x1000; - M62NumSprites = 0x400; - M62NumChars = 0x200; - M62CharRamSize = 0x800; - M62BgxTileDim = 8; - M62BgyTileDim = 8; - M62CharxTileDim = 12; - M62CharyTileDim = 8; - - if (M62MemInit()) return 1; - if (SpelunkrLoadRoms()) return 1; - if (SpelunkrMachineInit()) return 1; - - return 0; -} - -static INT32 Spelunk2Init() -{ - M62Z80RomSize = 0x1c000; - M62PromSize = 0x820; - M62NumTiles = 0x1000; - M62NumSprites = 0x400; - M62NumChars = 0x200; - M62CharRamSize = 0x800; - M62BgxTileDim = 8; - M62BgyTileDim = 8; - M62CharxTileDim = 12; - M62CharyTileDim = 8; - - if (M62MemInit()) return 1; - if (Spelunk2LoadRoms()) return 1; - if (Spelunk2MachineInit()) return 1; - - return 0; -} - -static INT32 YoujyudnInit() -{ - M62Z80RomSize = 0x10000; - M62PromSize = 0x720; - M62NumTiles = 0x400; - M62NumSprites = 0x400; - M62NumChars = 0x400; - M62CharRamSize = 0x800; - M62BgxTileDim = 8; - M62BgyTileDim = 16; - M62CharxTileDim = 12; - M62CharyTileDim = 8; - - if (M62MemInit()) return 1; - if (YoujyudnLoadRoms()) return 1; - if (YoujyudnMachineInit()) return 1; - - return 0; -} - -static INT32 HorizonInit() -{ - M62Z80RomSize = 0xc000; - M62PromSize = 0x720; - M62NumTiles = 0x400; - M62NumSprites = 0x400; - M62SpriteRamSize = 0x200; - M62ScrollRamSize = 0x40; - - if (M62MemInit()) return 1; - if (HorizonLoadRoms()) return 1; - if (HorizonMachineInit()) return 1; - - return 0; -} - -static INT32 M62Exit() -{ - ZetExit(); - M6800Exit(); - AY8910Exit(0); - AY8910Exit(1); - MSM5205Exit(); -#ifdef USE_SAMPLE_HACK - BurnSampleExit(); -#endif - - GenericTilesExit(); - - BurnFree(Mem); - - M62Z80RomSize = 0; - M62PromSize = 0; - M62NumTiles = 0; - M62NumSprites = 0; - M62NumChars = 0; - M62SpriteRamSize = 0; - M62CharRamSize = 0; - M62ScrollRamSize = 0; - - M62BackgroundHScroll = 0; - M62BackgroundVScroll = 0; - M62CharHScroll = 0; - M62CharVScroll = 0; - M62FlipScreen = 0; - M62SoundLatch = 0; - M62Port1 = 0; - M62Port2 = 0; - M62SlaveMSM5205VClckReset = 0; - M62PaletteEntries = 0; - M62Z80Clock = 0; - M62M6803Clock = 0; - M62RenderFunction = NULL; - M62ExtendTileInfoFunction = NULL; - M62ExtendCharInfoFunction = NULL; - M62BankControl[0] = M62BankControl[1] = 0; - Ldrun2BankSwap = 0; - Ldrun3TopBottomMask = 0; - KidnikiBackgroundBank = 0; - SpelunkrPaletteBank = 0; - M62BgxTileDim = 0; - M62BgyTileDim = 0; - M62CharxTileDim = 0; - M62CharyTileDim = 0; - M62SpriteHeightPromOffset = 0; - - return 0; -} - -static void M62CalcPalette() -{ - UINT8 *ColourProm = (UINT8*)M62PromData; - - for (UINT32 i = 0; i < M62PaletteEntries; i++) { - INT32 Bit0, Bit1, Bit2, Bit3, r, g, b; - - Bit0 = (ColourProm[M62PaletteEntries * 0] >> 0) & 0x01; - Bit1 = (ColourProm[M62PaletteEntries * 0] >> 1) & 0x01; - Bit2 = (ColourProm[M62PaletteEntries * 0] >> 2) & 0x01; - Bit3 = (ColourProm[M62PaletteEntries * 0] >> 3) & 0x01; - r = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (ColourProm[M62PaletteEntries * 1] >> 0) & 0x01; - Bit1 = (ColourProm[M62PaletteEntries * 1] >> 1) & 0x01; - Bit2 = (ColourProm[M62PaletteEntries * 1] >> 2) & 0x01; - Bit3 = (ColourProm[M62PaletteEntries * 1] >> 3) & 0x01; - g = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (ColourProm[M62PaletteEntries * 2] >> 0) & 0x01; - Bit1 = (ColourProm[M62PaletteEntries * 2] >> 1) & 0x01; - Bit2 = (ColourProm[M62PaletteEntries * 2] >> 2) & 0x01; - Bit3 = (ColourProm[M62PaletteEntries * 2] >> 3) & 0x01; - b = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - M62Palette[i] = BurnHighCol(r, g, b, 0); - - ColourProm++; - } -} - -static void BattroadCalcPalette() -{ - UINT8 *ColourProm = (UINT8*)M62PromData; - - for (UINT32 i = 0; i < 0x200; i++) { - INT32 Bit0, Bit1, Bit2, Bit3, r, g, b; - - Bit0 = (ColourProm[0x000] >> 0) & 0x01; - Bit1 = (ColourProm[0x000] >> 1) & 0x01; - Bit2 = (ColourProm[0x000] >> 2) & 0x01; - Bit3 = (ColourProm[0x000] >> 3) & 0x01; - r = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (ColourProm[0x200] >> 0) & 0x01; - Bit1 = (ColourProm[0x200] >> 1) & 0x01; - Bit2 = (ColourProm[0x200] >> 2) & 0x01; - Bit3 = (ColourProm[0x200] >> 3) & 0x01; - g = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (ColourProm[0x400] >> 0) & 0x01; - Bit1 = (ColourProm[0x400] >> 1) & 0x01; - Bit2 = (ColourProm[0x400] >> 2) & 0x01; - Bit3 = (ColourProm[0x400] >> 3) & 0x01; - b = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - M62Palette[i] = BurnHighCol(r, g, b, 0); - - ColourProm++; - } - - ColourProm = (UINT8*)M62PromData + 0x720; - - for (UINT32 i = 0; i < 0x20; i++) { - INT32 Bit0, Bit1, Bit2, r, g, b; - - Bit0 = (ColourProm[i] >> 0) & 0x01; - Bit1 = (ColourProm[i] >> 1) & 0x01; - Bit2 = (ColourProm[i] >> 2) & 0x01; - r = 0x21 * Bit0 + 0x47 * Bit1 + 0x97 * Bit2; - - Bit0 = (ColourProm[i] >> 3) & 0x01; - Bit1 = (ColourProm[i] >> 4) & 0x01; - Bit2 = (ColourProm[i] >> 5) & 0x01; - g = 0x21 * Bit0 + 0x47 * Bit1 + 0x97 * Bit2; - - Bit0 = 0; - Bit1 = (ColourProm[i] >> 6) & 0x01; - Bit2 = (ColourProm[i] >> 7) & 0x01; - b = 0x21 * Bit0 + 0x47 * Bit1 + 0x97 * Bit2; - - M62Palette[i + 0x200] = BurnHighCol(r, g, b, 0); - } -} - -static void Spelunk2CalcPalette() -{ - UINT8 *ColourProm = (UINT8*)M62PromData; - - for (UINT32 i = 0; i < 0x200; i++) { - INT32 Bit0, Bit1, Bit2, Bit3, r, g, b; - - Bit0 = (ColourProm[0x000] >> 0) & 0x01; - Bit1 = (ColourProm[0x000] >> 1) & 0x01; - Bit2 = (ColourProm[0x000] >> 2) & 0x01; - Bit3 = (ColourProm[0x000] >> 3) & 0x01; - r = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (ColourProm[0x000] >> 4) & 0x01; - Bit1 = (ColourProm[0x000] >> 5) & 0x01; - Bit2 = (ColourProm[0x000] >> 6) & 0x01; - Bit3 = (ColourProm[0x000] >> 7) & 0x01; - g = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (ColourProm[0x200] >> 0) & 0x01; - Bit1 = (ColourProm[0x200] >> 1) & 0x01; - Bit2 = (ColourProm[0x200] >> 2) & 0x01; - Bit3 = (ColourProm[0x200] >> 3) & 0x01; - b = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - M62Palette[i] = BurnHighCol(r, g, b, 0); - - ColourProm++; - } - - ColourProm += 0x200; - - for (UINT32 i = 0; i < 0x100; i++) { - INT32 Bit0, Bit1, Bit2, Bit3, r, g, b; - - Bit0 = (ColourProm[0x000] >> 0) & 0x01; - Bit1 = (ColourProm[0x000] >> 1) & 0x01; - Bit2 = (ColourProm[0x000] >> 2) & 0x01; - Bit3 = (ColourProm[0x000] >> 3) & 0x01; - r = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (ColourProm[0x100] >> 0) & 0x01; - Bit1 = (ColourProm[0x100] >> 1) & 0x01; - Bit2 = (ColourProm[0x100] >> 2) & 0x01; - Bit3 = (ColourProm[0x100] >> 3) & 0x01; - g = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - Bit0 = (ColourProm[0x200] >> 0) & 0x01; - Bit1 = (ColourProm[0x200] >> 1) & 0x01; - Bit2 = (ColourProm[0x200] >> 2) & 0x01; - Bit3 = (ColourProm[0x200] >> 3) & 0x01; - b = 0x0e * Bit0 + 0x1f * Bit1 + 0x43 * Bit2 + 0x8f * Bit3; - - M62Palette[i + 0x200] = BurnHighCol(r, g, b, 0); - - ColourProm++; - } -} - -static void BattroadExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32* xFlip) -{ - *Code |= ((*Colour & 0x40) << 3) | ((*Colour & 0x10) << 4); - - *xFlip = *Colour & 0x20; - - if (((*Colour & 0x1f) >> 1) >= 0x04) { - *Priority = 1; - } else { - *Priority = 0; - } - - *Colour &= 0x0f; -} - -static void LdrunExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32* xFlip) -{ - *Code |= (*Colour & 0xc0) << 2; - - *xFlip = *Colour & 0x20; - - if (((*Colour & 0x1f) >> 1) >= 0x0c) { - *Priority = 1; - } else { - *Priority = 0; - } - - *Colour &= 0x1f; -} - -static void Ldrun2ExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32* xFlip) -{ - *Code |= (*Colour & 0xc0) << 2; - - *xFlip = *Colour & 0x20; - - if (((*Colour & 0x1f) >> 1) >= 0x04) { - *Priority = 1; - } else { - *Priority = 0; - } - - *Colour &= 0x1f; -} - -static void Ldrun4ExtendTile(INT32* Code, INT32* Colour, INT32*, INT32*) -{ - *Code |= ((*Colour & 0xc0) << 2) | ((*Colour & 0x20) << 5); - *Colour &= 0x1f; -} - -static void LotlotExtendTile(INT32* Code, INT32* Colour, INT32*, INT32* xFlip) -{ - *Code |= (*Colour & 0xc0) << 2; - *xFlip = *Colour & 0x20; - *Colour &= 0x1f; -} - -static void KidnikiExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32*) -{ - *Code |= ((*Colour & 0xe0) << 3) | (KidnikiBackgroundBank << 11); - *Priority = ((*Colour & 0xe0) == 0xe0) ? 1 : 0; - *Colour &= 0x1f; -} - -static void SpelunkrExtendTile(INT32* Code, INT32* Colour, INT32*, INT32*) -{ - *Code |= ((*Colour & 0x10) << 4) | ((*Colour & 0x20) << 6) | ((*Colour & 0xc0) << 3); - *Colour &= 0x0f | (SpelunkrPaletteBank << 4); -} - -static void Spelunk2ExtendTile(INT32* Code, INT32* Colour, INT32*, INT32*) -{ - *Code |= ((*Colour & 0xf0) << 4); - *Colour &= 0x0f | (SpelunkrPaletteBank << 4); -} - -static void YoujyudnExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32*) -{ - *Code |= (*Colour & 0x60) << 3; - if (((*Colour & 0x1f) >> 1) >= 0x08) { - *Priority = 1; - } else { - *Priority = 0; - } - *Colour &= 0x1f; -} - -static void HorizonExtendTile(INT32* Code, INT32* Colour, INT32* Priority, INT32*) -{ - *Code |= ((*Colour & 0xc0) << 2) | ((*Colour & 0x20) << 5); - if (((*Colour & 0x1f) >> 1) >= 0x08) { - *Priority = 1; - } else { - *Priority = 0; - } - *Colour &= 0x1f; -} - -static void M62RenderBgLayer(INT32 PriorityToRender, INT32 xOffset, INT32 yOffset, INT32 Cols, INT32 Rows, INT32 Transparent) -{ - INT32 Code, mx, my, Colour, x, y, TileIndex = 0, Priority, xFlip, yFlip; - - for (my = 0; my < Rows; my++) { - for (mx = 0; mx < Cols; mx++) { - Code = M62TileRam[TileIndex << 1]; - Colour = M62TileRam[(TileIndex << 1) | 0x01]; - Priority = 0; - xFlip = 0; - yFlip = 0; - - if (M62ExtendTileInfoFunction) M62ExtendTileInfoFunction(&Code, &Colour, &Priority, &xFlip); - Code &= (M62NumTiles - 1); - - x = M62BgxTileDim * mx; - y = M62BgyTileDim * my; - - if (M62FlipScreen) { - xFlip = !xFlip; - yFlip = !yFlip; - - y = (Rows * M62BgyTileDim) - M62BgyTileDim - y; - x = (Cols * M62BgxTileDim) - M62BgxTileDim - x; - } - - x -= xOffset; - y -= yOffset; - - if (M62FlipScreen) { - x += M62BackgroundHScroll & (Cols * M62BgxTileDim - 1); - } else { - x -= M62BackgroundHScroll & (Cols * M62BgxTileDim - 1); - } - - y -= M62BackgroundVScroll & (Rows * M62BgyTileDim - 1); - - INT32 px, py; - - UINT32 nPalette = Colour << 3; - - if (Priority == PriorityToRender) { - for (py = 0; py < M62BgyTileDim; py++) { - for (px = 0; px < M62BgxTileDim; px++) { - UINT8 c = M62Tiles[(Code * M62BgxTileDim * M62BgyTileDim) + (py * M62BgxTileDim) + px]; - if (xFlip) c = M62Tiles[(Code *M62BgxTileDim * M62BgyTileDim) + (py * M62BgxTileDim) + (M62BgxTileDim - 1 - px)]; - if (yFlip) c = M62Tiles[(Code * M62BgxTileDim * M62BgyTileDim) + ((M62BgyTileDim - 1 - py) * M62BgxTileDim) + px]; - if (xFlip && yFlip) c = M62Tiles[(Code * M62BgxTileDim * M62BgyTileDim) + ((M62BgyTileDim - 1 - py) * M62BgxTileDim) + (M62BgxTileDim - 1 - px)]; - - if (Transparent && c == 0x00) continue; - - INT32 xPos = x + px; - INT32 yPos = y + py; - - if (M62ScrollRamSize) { -// tilemap_set_scrollx(state->bg_tilemap, i, state->scrollram[i << 1] | (state->scrollram[(i << 1) | 1] << 8)); - - xPos -= (M62ScrollRam[my << 1] | (M62ScrollRam[(my << 1) | 0x01] << 8)) & (Cols * M62BgxTileDim - 1); - } - - if (xPos < 0) xPos += Cols * M62BgxTileDim; - if (xPos > (Cols * M62BgxTileDim - 1)) xPos -= Cols * M62BgxTileDim; - - if (yPos < 0) yPos += Rows * M62BgyTileDim; - if (yPos > (Rows * M62BgyTileDim - 1)) yPos -= Rows * M62BgyTileDim; - - if (yPos >= 0 && yPos < nScreenHeight) { - UINT16* pPixel = pTransDraw + (yPos * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette; - } - } - } - } - } - - TileIndex++; - } - } -} - -static void KungfumRenderBgLayer(INT32 PriorityToRender, INT32 Cols, INT32 Rows, INT32 Transparent) -{ - INT32 Code, mx, my, Colour, x, y, TileIndex = 0, Priority, xFlip, yFlip; - - for (my = 0; my < Rows; my++) { - for (mx = 0; mx < Cols; mx++) { - Code = M62TileRam[TileIndex]; - Colour = M62TileRam[TileIndex + 0x800]; - xFlip = Colour & 0x20; - yFlip = 0; - - Code |= (Colour & 0xc0) << 2; - Code &= (M62NumTiles - 1); - - if ((TileIndex / 64) << 6 || ((Colour & 0x1f) >> 1) > 0x0c) { - Priority = 1; - } else { - Priority = 0; - } - - x = M62BgxTileDim * mx; - y = M62BgyTileDim * my; - - if (M62FlipScreen) { - xFlip = !xFlip; - yFlip = !yFlip; - - y = (Rows * M62BgyTileDim - 1) - M62BgyTileDim - y; - x = (Cols * M62BgxTileDim - 1) - M62BgxTileDim - x; - } - - x -= 128; - - INT32 px, py; - - UINT32 nPalette = (Colour & 0x1f) << 3; - - if (Priority == PriorityToRender) { - for (py = 0; py < M62BgyTileDim; py++) { - for (px = 0; px < M62BgxTileDim; px++) { - UINT8 c = M62Tiles[(Code * M62BgxTileDim * M62BgyTileDim) + (py * M62BgxTileDim) + px]; - if (xFlip) c = M62Tiles[(Code *M62BgxTileDim * M62BgyTileDim) + (py * M62BgxTileDim) + (M62BgxTileDim - 1 - px)]; - if (yFlip) c = M62Tiles[(Code * M62BgxTileDim * M62BgyTileDim) + ((M62BgyTileDim - 1 - py) * M62BgxTileDim) + px]; - if (xFlip && yFlip) c = M62Tiles[(Code * M62BgxTileDim * M62BgyTileDim) + ((M62BgyTileDim - 1 - py) * M62BgxTileDim) + (M62BgxTileDim - 1 - px)]; - - if (Transparent && c == 0x00) continue; - - INT32 xPos = x + px; - INT32 yPos = y + py; - - if (my >= 6) { - if (M62FlipScreen) { - xPos += M62BackgroundHScroll & (Cols * M62BgxTileDim - 1); - } else { - xPos -= M62BackgroundHScroll & (Cols * M62BgxTileDim - 1); - } - } - - if (xPos < 0) xPos += Cols * M62BgxTileDim; - if (xPos > (Cols * M62BgxTileDim - 1)) xPos -= Cols * M62BgxTileDim; - - if (yPos < 0) yPos += Rows * M62BgyTileDim; - if (yPos > (Rows * M62BgyTileDim - 1)) yPos -= Rows * M62BgyTileDim; - - if (yPos >= 0 && yPos < nScreenHeight) { - UINT16* pPixel = pTransDraw + (yPos * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette; - } - } - } - } - } - - TileIndex++; - } - } -} - -static void M62RenderSprites(INT32 ColourMask, INT32 PriorityMask, INT32 Priority, INT32 VisibleOffset, INT32 PaletteOffset) -{ - for (UINT32 Offset = 0; Offset < M62SpriteRamSize; Offset += 8) { - INT32 i, Incr, Code, Colour, xFlip, yFlip, sx, sy; - - if ((M62SpriteRam[Offset] & PriorityMask) == Priority) { - Code = M62SpriteRam[Offset + 4] + ((M62SpriteRam[Offset + 5] & 0x07) << 8); - Colour = M62SpriteRam[Offset + 0] & ColourMask; - sx = 256 * (M62SpriteRam[Offset + 7] & 1) + M62SpriteRam[Offset + 6], - sy = 256 + 128 - 15 - (256 * (M62SpriteRam[Offset + 3] & 1) + M62SpriteRam[Offset + 2]), - xFlip = M62SpriteRam[Offset + 5] & 0x40; - yFlip = M62SpriteRam[Offset + 5] & 0x80; - - i = M62PromData[M62SpriteHeightPromOffset + ((Code >> 5) & 0x1f)]; - if (i == 1) { - // double height - Code &= ~1; - sy -= 16; - } else if (i == 2) { - // quadruple height - i = 3; - Code &= ~3; - sy -= 3*16; - } - - if (M62FlipScreen) { - sx = 496 - sx; - sy = 242 - (i * 16) - sy; - xFlip = !xFlip; - yFlip = !yFlip; - } - - if (yFlip) { - Incr = -1; - Code += i; - } else { - Incr = 1; - } - - sx -= VisibleOffset; - - do { - INT32 DrawCode = Code + (i * Incr); - INT32 DrawY = sy + (i * 16); - DrawCode &= (M62NumSprites - 1); - - if (sx > 15 && sx < (nScreenWidth - 16) && DrawY > 15 && DrawY < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, DrawCode, sx, DrawY, Colour, 3, 0, PaletteOffset, M62Sprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, DrawCode, sx, DrawY, Colour, 3, 0, PaletteOffset, M62Sprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, DrawCode, sx, DrawY, Colour, 3, 0, PaletteOffset, M62Sprites); - } else { - Render16x16Tile_Mask(pTransDraw, DrawCode, sx, DrawY, Colour, 3, 0, PaletteOffset, M62Sprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, DrawCode, sx, DrawY, Colour, 3, 0, PaletteOffset, M62Sprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, DrawCode, sx, DrawY, Colour, 3, 0, PaletteOffset, M62Sprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, DrawCode, sx, DrawY, Colour, 3, 0, PaletteOffset, M62Sprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, DrawCode, sx, DrawY, Colour, 3, 0, PaletteOffset, M62Sprites); - } - } - } - - i--; - } while (i >= 0); - } - } -} - -static void BattroadExtendChar(INT32* Code, INT32* Colour, INT32*, INT32*) -{ - *Code |= ((*Colour & 0x40) << 3) | ((*Colour & 0x10) << 4); - *Colour &= 0x0f; -} - -static void LotlotExtendChar(INT32* Code, INT32* Colour, INT32*, INT32*) -{ - *Code |= (*Colour & 0xc0) << 2; - *Colour &= 0x1f; -} - -static void SpelunkrExtendChar(INT32* Code, INT32* Colour, INT32*, INT32*) -{ - *Code |= (*Colour & 0x10) << 4; - *Colour &= 0x0f | (SpelunkrPaletteBank << 4); -} - -static void YoujyudnExtendChar(INT32* Code, INT32* Colour, INT32*, INT32*) -{ - *Code |= (*Colour & 0xc0) << 2; - *Colour &= 0x0f; -} - -static void M62RenderCharLayer(INT32 Cols, INT32 Rows, INT32 ColourDepth, INT32 xOffset, INT32 yOffset, INT32 PaletteOffset) -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0, xFlip, yFlip; - - for (my = 0; my < Rows; my++) { - for (mx = 0; mx < Cols; mx++) { - Code = M62CharRam[TileIndex << 1]; - Colour = M62CharRam[(TileIndex << 1) | 0x01]; - xFlip = 0; - yFlip = 0; - - if (M62ExtendCharInfoFunction) M62ExtendCharInfoFunction(&Code, &Colour, 0, 0); - Code &= (M62NumChars - 1); - - x = M62CharxTileDim * mx; - y = M62CharyTileDim * my; - - x -= xOffset; - y -= yOffset; - - if (M62FlipScreen) { - x += M62CharHScroll & (Cols * M62CharxTileDim - 1); - } else { - x -= M62CharHScroll & (Cols * M62CharxTileDim - 1); - } - - y -= M62CharVScroll & (Rows * M62CharyTileDim - 1); - - INT32 px, py; - - UINT32 nPalette = Colour << ColourDepth; - - for (py = 0; py < M62CharyTileDim; py++) { - for (px = 0; px < M62CharxTileDim; px++) { - UINT8 c = M62Chars[(Code * M62CharxTileDim * M62CharyTileDim) + (py * M62CharxTileDim) + px]; - if (xFlip) c = M62Chars[(Code *M62CharxTileDim * M62CharyTileDim) + (py * M62CharxTileDim) + (M62CharxTileDim - 1 - px)]; - if (yFlip) c = M62Chars[(Code * M62CharxTileDim * M62CharyTileDim) + ((M62CharyTileDim - 1 - py) * M62CharxTileDim) + px]; - if (xFlip && yFlip) c = M62Chars[(Code * M62CharxTileDim * M62CharyTileDim) + ((M62CharyTileDim - 1 - py) * M62CharxTileDim) + (M62CharxTileDim - 1 - px)]; - - if (c != 0) { - INT32 xPos = x + px; - INT32 yPos = y + py; - - if (xPos < 0) xPos += Cols * M62CharxTileDim; - if (xPos > (Cols * M62CharxTileDim - 1)) xPos -= Cols * M62CharxTileDim; - - if (yPos < 0) yPos += Rows * M62CharyTileDim; - if (yPos > (Rows * M62CharyTileDim - 1)) yPos -= Rows * M62CharyTileDim; - - if (yPos >= 0 && yPos < nScreenHeight) { - UINT16* pPixel = pTransDraw + (yPos * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette | PaletteOffset; - } - } - } - } - } - - TileIndex++; - } - } -} - -static void KungfumDraw() -{ - BurnTransferClear(); - M62CalcPalette(); - KungfumRenderBgLayer(0, 64, 32, 0); - KungfumRenderBgLayer(1, 64, 32, 0); - M62RenderSprites(0x1f, 0, 0, 128, 256); - KungfumRenderBgLayer(0, 64, 32, 1); - BurnTransferCopy(M62Palette); -} - -static void BattroadDraw() -{ - BurnTransferClear(); - BattroadCalcPalette(); - M62RenderBgLayer(0, 128, 0, 64, 32, 0); - M62RenderBgLayer(1, 128, 0, 64, 32, 0); - M62RenderSprites(0x0f, 0x10, 0x00, 128, 256); - M62RenderBgLayer(1, 128, 0, 64, 32, 1); - M62RenderSprites(0x0f, 0x10, 0x10, 128, 256); - M62RenderCharLayer(32, 32, 2, 0, 0, 512); - BurnTransferCopy(M62Palette); -} - -static void LdrunDraw() -{ - BurnTransferClear(); - M62CalcPalette(); - M62RenderBgLayer(0, 64, 0, 64, 32, 0); - M62RenderBgLayer(1, 64, 0, 64, 32, 0); - M62RenderSprites(0x0f, 0x10, 0x00, 64, 256); - M62RenderBgLayer(1, 64, 0, 64, 32, 1); - M62RenderSprites(0x0f, 0x10, 0x10, 64, 256); - BurnTransferCopy(M62Palette); -} - -static void Ldrun3Draw() -{ - BurnTransferClear(); - M62CalcPalette(); - M62RenderBgLayer(0, 64, 0, 64, 32, 0); - M62RenderBgLayer(1, 64, 0, 64, 32, 0); - M62RenderSprites(0x0f, 0x10, 0x00, 64, 256); - M62RenderBgLayer(1, 64, 0, 64, 32, 1); - M62RenderSprites(0x0f, 0x10, 0x10, 64, 256); - - if (Ldrun3TopBottomMask) { - INT32 x, y; - - for (x = 0; x < nScreenWidth; x++) { - for (y = 0; y < 8; y++) { - pTransDraw[(y * nScreenWidth) + x] = BurnHighCol(0, 0, 0, 0); - pTransDraw[((y + 248) * nScreenWidth) + x] = BurnHighCol(0, 0, 0, 0); - } - } - } - - BurnTransferCopy(M62Palette); -} - -static void Ldrun4Draw() -{ - BurnTransferClear(); - M62CalcPalette(); - M62RenderBgLayer(0, 64 - 2, 0, 64, 32, 0); - M62RenderSprites(0x0f, 0x00, 0x00, 64, 256); - BurnTransferCopy(M62Palette); -} - -static void LotlotDraw() -{ - M62BackgroundVScroll = 32; - M62BackgroundHScroll = -64; - - BurnTransferClear(); - M62CalcPalette(); - M62RenderBgLayer(0, 64, 0, 32, 64, 0); - M62RenderCharLayer(32, 64, 3, -64 + 64, 32, 512); - M62RenderSprites(0x1f, 0x00, 0x00, 64, 256); - BurnTransferCopy(M62Palette); -} - -static void KidnikiDraw() -{ - BurnTransferClear(); - M62CalcPalette(); - M62RenderBgLayer(0, 64 - 2, 0, 64, 32, 0); - M62RenderBgLayer(1, 64 - 2, 0, 64, 32, 0); - M62RenderSprites(0x1f, 0x00, 0x00, 64, 256); - M62RenderBgLayer(1, 64 - 2, 0, 64, 32, 1); - M62RenderCharLayer(32, 64, 3, 0, 128, 0); - BurnTransferCopy(M62Palette); -} - -static void SpelunkrDraw() -{ - BurnTransferClear(); - M62CalcPalette(); - M62RenderBgLayer(0, 64, 128, 64, 64, 0); - M62RenderSprites(0x1f, 0x00, 0x00, 64, 256); - M62RenderCharLayer(32, 32, 3, 0, 0, 0); - BurnTransferCopy(M62Palette); -} - -static void Spelunk2Draw() -{ - BurnTransferClear(); - Spelunk2CalcPalette(); - M62RenderBgLayer(0, 64 - 1, 128, 64, 64, 0); - M62RenderSprites(0x1f, 0x00, 0x00, 64, 512); - M62RenderCharLayer(32, 32, 3, 64 - 65, 0, 0); - BurnTransferCopy(M62Palette); -} - -static void YoujyudnDraw() -{ - BurnTransferClear(); - M62CalcPalette(); - M62RenderBgLayer(0, 128, 0, 64, 16, 0); - M62RenderBgLayer(1, 128, 0, 64, 16, 0); - M62RenderSprites(0x1f, 0x00, 0x00, 128, 256); - M62RenderBgLayer(1, 128, 0, 64, 16, 1); - M62RenderCharLayer(32, 32, 3, 64, 0, 128); - BurnTransferCopy(M62Palette); -} - -static void HorizonDraw() -{ - BurnTransferClear(); - M62CalcPalette(); - M62RenderBgLayer(0, 128, 0, 64, 32, 0); - M62RenderBgLayer(1, 128, 0, 64, 32, 0); - M62RenderSprites(0x1f, 0x00, 0x00, 128, 256); - M62RenderBgLayer(1, 128, 0, 64, 32, 1); - BurnTransferCopy(M62Palette); -} - -static INT32 M62Frame() -{ - INT32 nInterleave = MSM5205CalcInterleave(0, M62Z80Clock); - INT32 nSoundBufferPos = 0; - - if (M62Reset) M62DoReset(); - - M62MakeInputs(); - - nCyclesTotal[0] = M62Z80Clock / 60; - nCyclesTotal[1] = M62M6803Clock / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetNewFrame(); - M6803NewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = M6803Run(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); -#ifdef USE_SAMPLE_HACK - if(bHasSamples) - BurnSampleRender(pSoundBuf, nSegmentLength); -#endif - nSoundBufferPos += nSegmentLength; - } - - ZetOpen(0); - MSM5205Update(); - if (M62SlaveMSM5205VClckReset) { - MSM5205VCLKWrite(1, 1); - MSM5205VCLKWrite(1, 0); - M62SlaveMSM5205VClckReset = 0; - } - ZetClose(); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); -#ifdef USE_SAMPLE_HACK - if(bHasSamples) - BurnSampleRender(pSoundBuf, nSegmentLength); -#endif - } - - ZetOpen(0); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - MSM5205Render(1, pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - } - - if (pBurnDraw) { - if (M62RenderFunction) M62RenderFunction(); - } - - return 0; -} - -static INT32 M62Scan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029709; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6803Scan(nAction); - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); -#ifdef USE_SAMPLE_HACK - BurnSampleScan(nAction, pnMin); -#endif - SCAN_VAR(M62BackgroundHScroll); - SCAN_VAR(M62BackgroundVScroll); - SCAN_VAR(M62CharHScroll); - SCAN_VAR(M62CharVScroll); - SCAN_VAR(M62FlipScreen); - SCAN_VAR(M62SoundLatch); - SCAN_VAR(M62Port1); - SCAN_VAR(M62Port2); - SCAN_VAR(M62SlaveMSM5205VClckReset); - SCAN_VAR(M62BankControl); - SCAN_VAR(Ldrun2BankSwap); - SCAN_VAR(Ldrun3TopBottomMask); - SCAN_VAR(KidnikiBackgroundBank); - SCAN_VAR(SpelunkrPaletteBank); - } - - if (nAction & ACB_WRITE) { - if (strstr(BurnDrvGetTextA(DRV_NAME), "spelunk")) { - if (strstr(BurnDrvGetTextA(DRV_NAME), "spelunk2")) { - ZetOpen(0); - ZetMapArea(0x8000, 0x8fff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0x8fff, 2, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x9000, 0x9fff, 0, M62Z80Rom + M62Z80BankAddress2); - ZetMapArea(0x9000, 0x9fff, 2, M62Z80Rom + M62Z80BankAddress2); - ZetClose(); - } else { - ZetOpen(0); - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + M62Z80BankAddress); - ZetClose(); - } - } - if (strstr(BurnDrvGetTextA(DRV_NAME), "ldrun4")) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0xbfff, 2, M62Z80Rom + M62Z80BankAddress); - ZetClose(); - } - if (strstr(BurnDrvGetTextA(DRV_NAME), "ldrun2")) { - ZetOpen(0); - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + M62Z80BankAddress); - ZetClose(); - } - if (strstr(BurnDrvGetTextA(DRV_NAME), "battroad")) { - ZetOpen(0); - ZetMapArea(0xa000, 0xbfff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0xa000, 0xbfff, 2, M62Z80Rom + M62Z80BankAddress); - ZetClose(); - } - if (strstr(BurnDrvGetTextA(DRV_NAME), "youj")) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0xbfff, 2, M62Z80Rom + M62Z80BankAddress); - ZetClose(); - } - if (strstr(BurnDrvGetTextA(DRV_NAME), "kidnik") || - strstr(BurnDrvGetTextA(DRV_NAME), "lithero") || - strstr(BurnDrvGetTextA(DRV_NAME), "yanchamr")) { - ZetOpen(0); - ZetMapArea(0x8000, 0x9fff, 0, M62Z80Rom + M62Z80BankAddress); - ZetMapArea(0x8000, 0x9fff, 2, M62Z80Rom + M62Z80BankAddress); - ZetClose(); - } - } - - return 0; -} - -static struct BurnSampleInfo M62SampleDesc[] = { -#ifdef USE_SAMPLE_HACK -#if !defined ROM_VERIFY - { "TR606 - Hat", SAMPLE_NOLOOP }, - { "TR606 - Snare", SAMPLE_NOLOOP }, - { "TR606 - Kick", SAMPLE_NOLOOP }, - { "TR606 - Open Hat", SAMPLE_NOLOOP }, - { "TR606 - High Tom", SAMPLE_NOLOOP }, - { "TR606 - Low Tom", SAMPLE_NOLOOP }, - { "TR606 - Cymbal", SAMPLE_NOLOOP }, -#endif -#endif - { "", 0 } -}; - -STD_SAMPLE_PICK(M62) -STD_SAMPLE_FN(M62) - - -struct BurnDriver BurnDrvKungfum = { - "kungfum", NULL, NULL, NULL, "1984", - "Kung-Fu Master\0", NULL, "Irem", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_SCRFIGHT, 0, - NULL, KungfumRomInfo, KungfumRomName, NULL, NULL, M62InputInfo, KungfumDIPInfo, - KungfumInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvKungfumd = { - "kungfumd", "kungfum", NULL, NULL, "1984", - "Kung-Fu Master (Data East)\0", NULL, "Irem (Data East License)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M62, GBF_SCRFIGHT, 0, - NULL, KungfumdRomInfo, KungfumdRomName, NULL, NULL, M62InputInfo, KungfumDIPInfo, - KungfumdInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvSpartanx = { - "spartanx", "kungfum", NULL, NULL, "1984", - "Spartan X (Japan)\0", NULL, "Irem", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M62, GBF_SCRFIGHT, 0, - NULL, SpartanxRomInfo, SpartanxRomName, NULL, NULL, M62InputInfo, KungfumDIPInfo, - KungfumInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvKungfub = { - "kungfub", "kungfum", NULL, NULL, "1984", - "Kung-Fu Master (bootleg set 1)\0", NULL, "bootleg", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_IREM_M62, GBF_SCRFIGHT, 0, - NULL, KungfubRomInfo, KungfubRomName, NULL, NULL, M62InputInfo, KungfumDIPInfo, - KungfumInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvKungfub2 = { - "kungfub2", "kungfum", NULL, NULL, "1984", - "Kung-Fu Master (bootleg set 2)\0", NULL, "bootleg", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_IREM_M62, GBF_SCRFIGHT, 0, - NULL, Kungfub2RomInfo, Kungfub2RomName, NULL, NULL, M62InputInfo, KungfumDIPInfo, - KungfumInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvKungfub3 = { - "kungfub3", "kungfum", NULL, NULL, "1984", - "Kung-Fu Master (bootleg set 3)\0", NULL, "bootleg", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M62, GBF_SCRFIGHT, 0, - NULL, Kungfub3RomInfo, Kungfub3RomName, NULL, NULL, M62InputInfo, KungfumDIPInfo, - Kungfub3Init, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvBattroad = { - "battroad", NULL, NULL, "tr606drumkit", "1984", - "The Battle-Road\0", NULL, "Irem", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_IREM_M62, GBF_SCRFIGHT, 0, - NULL, BattroadRomInfo, BattroadRomName, M62SampleInfo, M62SampleName, M62InputInfo, BattroadDIPInfo, - BattroadInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x220, 256, 256, 3, 4 -}; - -struct BurnDriver BurnDrvLdrun = { - "ldrun", NULL, NULL, NULL, "1984", - "Lode Runner (set 1)\0", NULL, "Irem (licensed from Broderbund)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, LdrunRomInfo, LdrunRomName, NULL, NULL, M62InputInfo, LdrunDIPInfo, - LdrunInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvLdruna = { - "ldruna", "ldrun", NULL, NULL, "1984", - "Lode Runner (set 2)\0", NULL, "Irem (licensed from Broderbund)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, LdrunaRomInfo, LdrunaRomName, NULL, NULL, M62InputInfo, LdrunDIPInfo, - LdrunInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvLdrun2 = { - "ldrun2", NULL, NULL, NULL, "1984", - "Lode Runner II - The Bungeling Strikes Back\0", NULL, "Irem (licensed from Broderbund)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, Ldrun2RomInfo, Ldrun2RomName, NULL, NULL, M62InputInfo, Ldrun2DIPInfo, - Ldrun2Init, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvLdrun3 = { - "ldrun3", NULL, NULL, NULL, "1985", - "Lode Runner III - The Golden Labyrinth\0", NULL, "Irem (licensed from Broderbund)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, Ldrun3RomInfo, Ldrun3RomName, NULL, NULL, M62InputInfo, Ldrun2DIPInfo, - Ldrun3Init, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvLdrun3j = { - "ldrun3j", "ldrun3", NULL, NULL, "1985", - "Lode Runner III - Majin No Fukkatsu\0", NULL, "Irem (licensed from Broderbund)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, Ldrun3jRomInfo, Ldrun3jRomName, NULL, NULL, M62InputInfo, Ldrun2DIPInfo, - Ldrun3jInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvLdrun4 = { - "ldrun4", NULL, NULL, NULL, "1986", - "Lode Runner IV - Teikoku Karano Dasshutsu\0", NULL, "Irem (licensed from Broderbund)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, Ldrun4RomInfo, Ldrun4RomName, NULL, NULL, M62InputInfo, Ldrun4DIPInfo, - Ldrun4Init, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvLotlot = { - "lotlot", NULL, NULL, NULL, "1985", - "Lot Lot\0", NULL, "Irem (licensed from Tokuma Shoten)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_PUZZLE, 0, - NULL, LotlotRomInfo, LotlotRomName, NULL, NULL, M62InputInfo, LotlotDIPInfo, - LotlotInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x300, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvKidniki = { - "kidniki", NULL, NULL, "tr606drumkit", "1986", - "Kid Niki - Radical Ninja (World)\0", NULL, "Irem", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, KidnikiRomInfo, KidnikiRomName, M62SampleInfo, M62SampleName, M62InputInfo, KidnikiDIPInfo, - KidnikiInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvKidnikiu = { - "kidnikiu", "kidniki", NULL, "tr606drumkit", "1986", - "Kid Niki - Radical Ninja (US)\0", NULL, "Irem (Data East USA license)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, KidnikiuRomInfo, KidnikiuRomName, M62SampleInfo, M62SampleName, M62InputInfo, KidnikiDIPInfo, - KidnikiInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvYanchamr = { - "yanchamr", "kidniki", NULL, "tr606drumkit", "1986", - "Kaiketsu Yanchamaru (Japan)\0", NULL, "Irem", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, YanchamrRomInfo, YanchamrRomName, M62SampleInfo, M62SampleName, M62InputInfo, KidnikiDIPInfo, - KidnikiInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvLithero = { - "lithero", "kidniki", NULL, "tr606drumkit", "1987", - "Little Hero\0", NULL, "bootleg", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, LitheroRomInfo, LitheroRomName, M62SampleInfo, M62SampleName, M62InputInfo, KidnikiDIPInfo, - LitheroInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvSpelunkr = { - "spelunkr", NULL, NULL, "tr606drumkit", "1985", - "Spelunker\0", NULL, "Irem (licensed from Broderbund)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, SpelunkrRomInfo, SpelunkrRomName, M62SampleInfo, M62SampleName, M62InputInfo, SpelunkrDIPInfo, - SpelunkrInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvSpelunkrj = { - "spelunkrj", "spelunkr", NULL, "tr606drumkit", "1985", - "Spelunker (Japan)\0", NULL, "Irem (licensed from Broderbund)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, SpelunkrjRomInfo, SpelunkrjRomName, M62SampleInfo, M62SampleName, M62InputInfo, SpelunkrDIPInfo, - SpelunkrInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvSpelunk2 = { - "spelunk2", NULL, NULL, "tr606drumkit", "1986", - "Spelunker II - 23 no Kagi (Japan)\0", NULL, "Irem (licensed from Broderbund)", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_PLATFORM, 0, - NULL, Spelunk2RomInfo, Spelunk2RomName, M62SampleInfo, M62SampleName, M62InputInfo, Spelunk2DIPInfo, - Spelunk2Init, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x300, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvYoujyudn = { - "youjyudn", NULL, NULL, NULL, "1986", - "Youjyuden (Japan)\0", NULL, "Irem", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_M62, GBF_VERSHOOT, 0, - NULL, YoujyudnRomInfo, YoujyudnRomName, NULL, NULL, M62InputInfo, YoujyudnDIPInfo, - YoujyudnInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 256, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHorizon = { - "horizon", NULL, NULL, "tr606drumkit", "1985", - "Horizon\0", NULL, "Irem", "Irem M62", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M62, GBF_HORSHOOT, 0, - NULL, HorizonRomInfo, HorizonRomName, M62SampleInfo, M62SampleName, M62InputInfo, HorizonDIPInfo, - HorizonInit, M62Exit, M62Frame, NULL, M62Scan, - NULL, 0x200, 256, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/irem/d_m63.cpp b/jan/src/burn/drv/irem/d_m63.cpp deleted file mode 100644 index 48a4f30a2..000000000 --- a/jan/src/burn/drv/irem/d_m63.cpp +++ /dev/null @@ -1,1128 +0,0 @@ -// FB Alpha Irem M63 driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "i8039.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvI8039ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *DrvSampleROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvScrRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *interrupt_enable; -static UINT8 *flipscreen; -static UINT8 *palette_bank; -static UINT8 *sound_status; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 m63_sound_p1; -static UINT8 m63_sound_p2; -static UINT8 sound_irq = 0; -static INT32 sample_pos = 0; -static INT32 sample_sel = -1; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static INT32 sy_offset; -static INT32 char_color_offset; -static INT32 sound_interrupt_count; - -static struct BurnInputInfo WilytowrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Wilytowr) - -static struct BurnInputInfo FghtbsktInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 0, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 1, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 0, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Fghtbskt) - -static struct BurnDIPInfo WilytowrDIPList[]= -{ - {0x10, 0xff, 0xff, 0x01, NULL }, - {0x11, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x00, "2" }, - {0x10, 0x01, 0x03, 0x01, "3" }, - {0x10, 0x01, 0x03, 0x02, "4" }, - {0x10, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Points Rate" }, - {0x10, 0x01, 0x0c, 0x00, "Normal" }, - {0x10, 0x01, 0x0c, 0x04, "x1.2" }, - {0x10, 0x01, 0x0c, 0x08, "x1.4" }, - {0x10, 0x01, 0x0c, 0x0c, "x1.6" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x10, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x30, 0x30, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xc0, 0x80, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x10, 0x01, 0xf0, 0x60, "7 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "6 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x40, "5 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x20, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 7 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 8 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "1 Coin 9 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x01, 0x00, "Off" }, - {0x11, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x02, 0x02, "Upright" }, - {0x11, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x11, 0x01, 0x04, 0x00, "Mode 1" }, - {0x11, 0x01, 0x04, 0x04, "Mode 2" }, - - {0 , 0xfe, 0 , 0, "Stop Mode (Cheat)" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 0, "Service Mode" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Wilytowr) - -static struct BurnDIPInfo FghtbsktDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xc4, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0x03, 0x03, "3 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0f, 0x01, 0x0c, 0x04, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x00, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x0c, 0x08, "1 Coin 4 Credits" }, - {0x0f, 0x01, 0x0c, 0x0c, "99 Credits / Sound Test" }, - - {0 , 0xfe, 0 , 2, "Time Count Down" }, - {0x0f, 0x01, 0x20, 0x00, "Slow" }, - {0x0f, 0x01, 0x20, 0x20, "Too Fast" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x40, 0x40, "Upright" }, - {0x0f, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x80, 0x00, "Off" }, - {0x0f, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Fghtbskt) - -void __fastcall m63_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - *interrupt_enable = data ? 1 : 0; - return; - - case 0xf002: - *flipscreen = ~data & 0x01; - return; - - case 0xf003: - *palette_bank = data & 0x01; - return; - - case 0xf006: - case 0xf007: - // coin counters (offset) - return; - - case 0xf800: - *soundlatch = data; - return; - - case 0xf801: - return; // nop - - case 0xf803: - I8039SetIrqState(1); - return; - } -} - -UINT8 __fastcall m63_main_read(UINT16 address) -{ - switch (address) - { - case 0xf000: // fghtbskt - return *sound_status; - - case 0xf800: - case 0xf001: // fghtbskt - return DrvInputs[0]; - - case 0xf801: - case 0xf002: // fghtbskt - return DrvInputs[1]; - - case 0xf802: - case 0xf003: // fghtbskt - return DrvDips[0]; - - case 0xf806: - return DrvDips[1]; - } - - return 0; -} - -void __fastcall fghtbskt_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - I8039SetIrqState(1); - return; - - case 0xf002: - *soundlatch = data; - return; - - case 0xf801: - *interrupt_enable = data ? 1 : 0; - return; - - case 0xf802: - *flipscreen = data ? 1 : 0; - // if (flipscreen) ? tile_flipx : 0 - return; - - case 0xf807: - if (data & 0x01) { - sample_sel = ((data & 0xf0) << 8); - sample_pos = 0; - } - return; - - case 0xf001: - case 0xf800: - case 0xf803: - case 0xf804: - case 0xf805: - case 0xf806: - return; // nop - } -} - -UINT8 __fastcall m63_sound_read(UINT32 address) -{ - return DrvI8039ROM[address & 0x0fff]; -} - -void __fastcall m63_sound_write_port(UINT32 port, UINT8 data) -{ - if ((port & 0xff00) == 0x0000) { - if ((m63_sound_p2 & 0xf0) == 0xe0) - { - AY8910Write(0, 0, port & 0xff); - } - else if ((m63_sound_p2 & 0xf0) == 0xa0) - { - AY8910Write(0, 1, port & 0xff); - } - else if ((m63_sound_p1 & 0xe0) == 0x60 && sy_offset != 240) - { - AY8910Write(1, 0, port & 0xff); - } - else if ((m63_sound_p1 & 0xe0) == 0x40 && sy_offset != 240) - { - AY8910Write(1, 1, port & 0xff); - } - else if ((m63_sound_p2 & 0xf0) == 0x70) - { - *sound_status = port & 0xff; - } - - return; - } - - switch (port) - { - case 0x101: - m63_sound_p1 = data; - return; - - case 0x102: - m63_sound_p2 = data; - if ((data & 0xf0) == 0x50) I8039SetIrqState(0); - return; - } -} - -UINT8 __fastcall m63_sound_read_port(UINT32 port) -{ - if ((port & 0xff00) == 0x0000) { - if ((m63_sound_p2 & 0xf0) == 0x60) { - return *soundlatch; - } - else if ((m63_sound_p2 & 0xf0) == 0x70) - { - return DrvSndROM[((m63_sound_p1 & 0x1f) << 8) | (port & 0xff)]; - } - - return 0xff; - } - - switch (port) - { - case 0x111: - if (sound_irq) { - sound_irq = 0; - return 1; - } - return 0; - } - - return 0; -} - -static void m63PaletteRecalc() -{ - for (INT32 i = 0; i < 256; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 256] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 256] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 256] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 256] >> 3) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 2*256] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 2*256] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 2*256] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 2*256] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 4; i++) - { - INT32 bit0 = (DrvColPROM[0x300+i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[0x300+i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[0x300+i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[0x300+i] >> 3) & 0x01; - bit1 = (DrvColPROM[0x300+i] >> 4) & 0x01; - bit2 = (DrvColPROM[0x300+i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[0x300+i] >> 6) & 0x01; - bit1 = (DrvColPROM[0x300+i] >> 7) & 0x01; - INT32 b = 0x4f * bit0 + 0xa8 * bit1; - - DrvPalette[0x100+i] = BurnHighCol(r,g,b,0); - } -} - -static void m63_main_map() -{ - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xd000, 0xdfff, 0, DrvZ80RAM0); - ZetMapArea(0xd000, 0xdfff, 1, DrvZ80RAM0); - ZetMapArea(0xd000, 0xdfff, 2, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe1ff, 0, DrvZ80RAM1); - ZetMapArea(0xe000, 0xe1ff, 1, DrvZ80RAM1); - ZetMapArea(0xe000, 0xe1ff, 2, DrvZ80RAM1); - ZetMapArea(0xe200, 0xe2ff, 0, DrvSprRAM); - ZetMapArea(0xe200, 0xe2ff, 1, DrvSprRAM); - ZetMapArea(0xe200, 0xe2ff, 2, DrvSprRAM); - ZetMapArea(0xe300, 0xe3ff, 0, DrvScrRAM); - ZetMapArea(0xe300, 0xe3ff, 1, DrvScrRAM); - ZetMapArea(0xe300, 0xe3ff, 2, DrvScrRAM); - ZetMapArea(0xe400, 0xe7ff, 0, DrvVidRAM1); - ZetMapArea(0xe400, 0xe7ff, 1, DrvVidRAM1); - ZetMapArea(0xe400, 0xe7ff, 2, DrvVidRAM1); - ZetMapArea(0xe800, 0xebff, 0, DrvVidRAM0); - ZetMapArea(0xe800, 0xebff, 1, DrvVidRAM0); - ZetMapArea(0xe800, 0xebff, 2, DrvVidRAM0); - ZetMapArea(0xec00, 0xefff, 0, DrvColRAM); - ZetMapArea(0xec00, 0xefff, 1, DrvColRAM); - ZetMapArea(0xec00, 0xefff, 2, DrvColRAM); - ZetSetWriteHandler(m63_main_write); - ZetSetReadHandler(m63_main_read); - ZetClose(); -} - -static void fghtbskt_main_map() -{ - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM0); - ZetMapArea(0xd000, 0xd1ff, 0, DrvZ80RAM1); - ZetMapArea(0xd000, 0xd1ff, 1, DrvZ80RAM1); - ZetMapArea(0xd000, 0xd1ff, 2, DrvZ80RAM1); - ZetMapArea(0xd200, 0xd2ff, 0, DrvSprRAM); - ZetMapArea(0xd200, 0xd2ff, 1, DrvSprRAM); - ZetMapArea(0xd200, 0xd2ff, 2, DrvSprRAM); - ZetMapArea(0xd300, 0xd3ff, 0, DrvScrRAM); - ZetMapArea(0xd300, 0xd3ff, 1, DrvScrRAM); - ZetMapArea(0xd300, 0xd3ff, 2, DrvScrRAM); - ZetMapArea(0xd400, 0xd7ff, 0, DrvVidRAM1); - ZetMapArea(0xd400, 0xd7ff, 1, DrvVidRAM1); - ZetMapArea(0xd400, 0xd7ff, 2, DrvVidRAM1); - ZetMapArea(0xd800, 0xdbff, 0, DrvVidRAM0); - ZetMapArea(0xd800, 0xdbff, 1, DrvVidRAM0); - ZetMapArea(0xd800, 0xdbff, 2, DrvVidRAM0); - ZetMapArea(0xdc00, 0xdfff, 0, DrvColRAM); - ZetMapArea(0xdc00, 0xdfff, 1, DrvColRAM); - ZetMapArea(0xdc00, 0xdfff, 2, DrvColRAM); - ZetSetWriteHandler(fghtbskt_main_write); - ZetSetReadHandler(m63_main_read); - ZetClose(); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - I8039Reset(); - - AY8910Reset(0); - AY8910Reset(1); - - m63_sound_p1 = 0; - m63_sound_p2 = 0; - sound_irq = 0; - sample_pos = 0; - sample_sel = -1; - - DrvRecalc = 1; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0x8000, 0x0000 }; - INT32 Plane1[3] = { (0x2000*8)*2, (0x2000*8)*1, (0x2000*8)*0 }; - INT32 Plane2[3] = { (0x4000*8)*2, (0x4000*8)*1, (0x4000*8)*0 }; - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, (0x2000*8)+0, (0x2000*8)+1, (0x2000*8)+2, (0x2000*8)+3, (0x2000*8)+4, (0x2000*8)+5, (0x2000*8)+6, (0x2000*8)+7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0100, 2, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x6000); - - GfxDecode(0x0400, 3, 8, 8, Plane1, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0xc000); - - GfxDecode(0x0200, 3, 16, 16, Plane2, XOffs, YOffs, 0x080, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - DrvI8039ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvSampleROM = Next; Next += 0x010000; - - DrvSndROM = Next; Next += 0x002000; - - DrvColPROM = Next; Next += 0x000400; - - DrvPalette = (UINT32*)Next; Next += 0x0104 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000200; - DrvVidRAM0 = Next; Next += 0x000400; - DrvVidRAM1 = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000100; - DrvScrRAM = Next; Next += 0x000100; - - soundlatch = Next; Next += 0x000001; - interrupt_enable = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - palette_bank = Next; Next += 0x000001; - sound_status = Next; Next += 0x000001; - - RamEnd = Next; - - for (INT32 i = 0; i < 6; i++) { - pAY8910Buffer[i] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - } - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(void (*pMapMainCPU)(), INT32 (*pRomLoadCallback)(), INT32 syoffset, INT32 charcoloroff, INT32 sndirqcount) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pRomLoadCallback()) return 1; - - DrvGfxDecode(); - - pMapMainCPU(); - - I8039Init(NULL); - I8039SetProgramReadHandler(m63_sound_read); - I8039SetCPUOpReadHandler(m63_sound_read); - I8039SetCPUOpReadArgHandler(m63_sound_read); - I8039SetIOReadHandler(m63_sound_read_port); - I8039SetIOWriteHandler(m63_sound_write_port); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 1.00, BURN_SND_ROUTE_BOTH); - - sy_offset = syoffset; - char_color_offset = charcoloroff; - sound_interrupt_count = sndirqcount; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - I8039Exit(); - - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - return 0; -} - -static INT32 wilytowerLoadRoms() -{ - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x08000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x0a000, 5, 1)) return 1; - - if (BurnLoadRom(DrvI8039ROM, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x01000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x06000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0a000, 17, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 18, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 19, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 21, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 22, 1)) return 1; - - return 0; -} - -static INT32 fghtbsktLoadRoms() -{ - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x08000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x0a000, 4, 1)) return 1; - - if (BurnLoadRom(DrvI8039ROM, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - memcpy (DrvGfxROM0 + 0x1000, DrvGfxROM0 + 0x0800, 0x0800); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x06000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0a000, 15, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 16, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 18, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 19, 1)) return 1; - - if (BurnLoadRom(DrvSampleROM + 0x00000, 20, 1)) return 1; - if (BurnLoadRom(DrvSampleROM + 0x02000, 21, 1)) return 1; - if (BurnLoadRom(DrvSampleROM + 0x04000, 22, 1)) return 1; - if (BurnLoadRom(DrvSampleROM + 0x06000, 23, 1)) return 1; - if (BurnLoadRom(DrvSampleROM + 0x08000, 24, 1)) return 1; - - return 0; -} - -static INT32 wilytowrInit() -{ - return DrvInit(m63_main_map, wilytowerLoadRoms, 238, 0x100, 60); -} - -static INT32 atomboyInit() -{ - return DrvInit(m63_main_map, wilytowerLoadRoms, 238, 0x100, 60/2); -} - -static INT32 fghtbsktInit() -{ - INT32 nRet = DrvInit(fghtbskt_main_map, fghtbsktLoadRoms, 240, 0x010, 60/2); - - AY8910SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= DrvScrRAM[(offs & 0x1f) * 8] + 16; - if (sy < -7) sy += 256; - if (sy >= nScreenHeight) continue; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM0[offs] | ((attr & 0x30) << 4); - INT32 color = (attr & 0x0f) | (*palette_bank << 4); - - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, 248 - sx, 216 - sy, color, 3, 0, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM1); - } - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = (256/8)*(16/8); offs < (32 * 32) - ((256/8)*(16/8)); offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = ((offs >> 5) << 3) - 16; - - if (*flipscreen) { - Render8x8Tile_Mask_FlipXY(pTransDraw, DrvVidRAM1[offs], 248 - sx, 216 - sy, 0, 2, 0, char_color_offset, DrvGfxROM0); - } else { - Render8x8Tile_Mask(pTransDraw, DrvVidRAM1[offs], sx, sy, 0, 2, 0, char_color_offset, DrvGfxROM0); - } - } -} - -static void draw_sprite_tile(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - INT32 sx = DrvSprRAM[offs + 3]; - INT32 attr = DrvSprRAM[offs + 2]; - INT32 code = (DrvSprRAM[offs + 1]) | ((attr & 0x10) << 4); - INT32 sy = (sy_offset - DrvSprRAM[offs]) - 16; - - INT32 color = (attr & 0x0f) | (*palette_bank << 4); - INT32 flipx = (attr & 0x20); - INT32 flipy = 0; - - if (*flipscreen) - { - sx = 240 - sx; - sy = sy_offset - sy; - flipx = !flipx; - flipy = !flipy; - } - - draw_sprite_tile(code, color, sx, sy, flipx, flipy); - - if (sx > 0xf0) { - draw_sprite_tile(code, color, sx, sy, flipx, flipy); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - m63PaletteRecalc(); - DrvRecalc = 0; - } - - draw_bg_layer(); - draw_sprites(); - draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void sample_render(short *pSoundBuf, INT32 nLength) -{ - if (sample_sel == -1) return; - - double Addr = sample_pos + sample_sel; - double Step = (double)8000 / nBurnSoundRate; - - for (INT32 i = 0; i < nLength && Addr < 0xa000; i += 2, Addr += Step) { - short Sample = (short)((DrvSampleROM[(int)Addr]^0x80) << 8); - - pSoundBuf[i ] += Sample; - pSoundBuf[i + 1] += Sample; - } - - sample_pos = (int)Addr; - if (Addr >= 0xa000) sample_sel = -1; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nCyclesTotal[2] = { 3000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nInterleave = 100; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += I8039Run(nCyclesTotal[1] / nInterleave); - } - - if (sound_interrupt_count == 30) { - if (nCurrentFrame & 1) sound_irq = 1; - } else { - sound_irq = 1; - } - - if (*interrupt_enable) ZetNmi(); - - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - - sample_render(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - I8039Scan(nAction, pnMin); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(m63_sound_p1); - SCAN_VAR(m63_sound_p2); - SCAN_VAR(sound_irq); - SCAN_VAR(sample_pos); - SCAN_VAR(sample_sel); - } - - return 0; -} - - -// Wily Tower - -static struct BurnRomInfo wilytowrRomDesc[] = { - { "wt4e.bin", 0x2000, 0xa38e4b8a, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 code - { "wt4h.bin", 0x2000, 0xc1405ceb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "wt4j.bin", 0x2000, 0x379fb1c3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "wt4k.bin", 0x2000, 0x2dd6f9c7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "wt_a-4m.bin", 0x2000, 0xc1f8a7d5, 1 | BRF_PRG | BRF_ESS }, // 4 - { "wt_a-4n.bin", 0x2000, 0xb212f7d2, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "wt4d.bin", 0x1000, 0x25a171bf, 2 | BRF_PRG | BRF_ESS }, // 6 I8039 code - - { "wt_b-5e.bin", 0x1000, 0xfe45df43, 3 | BRF_GRA }, // 7 Characters - { "wt_b-5f.bin", 0x1000, 0x87a17eff, 3 | BRF_GRA }, // 8 - - { "wtb5a.bin", 0x2000, 0xefc1cbfa, 4 | BRF_GRA }, // 9 Tiles - { "wtb5b.bin", 0x2000, 0xab4bfd07, 4 | BRF_GRA }, // 10 - { "wtb5d.bin", 0x2000, 0x40f23e1d, 4 | BRF_GRA }, // 11 - - { "wt2j.bin", 0x1000, 0xd1bf0670, 5 | BRF_GRA }, // 12 Sprites - { "wt3k.bin", 0x1000, 0x83c39a0e, 5 | BRF_GRA }, // 13 - { "wt_a-3m.bin", 0x1000, 0xe7e468ae, 5 | BRF_GRA }, // 14 - { "wt_a-3n.bin", 0x1000, 0x0741d1a9, 5 | BRF_GRA }, // 15 - { "wt_a-3p.bin", 0x1000, 0x7299f362, 5 | BRF_GRA }, // 16 - { "wt_a-3s.bin", 0x1000, 0x9b37d50d, 5 | BRF_GRA }, // 17 - - { "wt_a-6d.bin", 0x1000, 0xa5dde29b, 6 | BRF_SND }, // 18 Sound data - - { "wt_a-5s-.bpr", 0x0100, 0x041950e7, 7 | BRF_GRA }, // 19 Color PROMs - { "wt_a-5r-.bpr", 0x0100, 0xbc04bf25, 7 | BRF_GRA }, // 20 - { "wt_a-5p-.bpr", 0x0100, 0xed819a19, 7 | BRF_GRA }, // 21 - { "wt_b-9l-.bpr", 0x0020, 0xd2728744, 7 | BRF_GRA }, // 22 -}; - -STD_ROM_PICK(wilytowr) -STD_ROM_FN(wilytowr) - -struct BurnDriver BurnDrvWilytowr = { - "wilytowr", NULL, NULL, NULL, "1984", - "Wily Tower\0", NULL, "Irem", "M63", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_IREM_M63, GBF_PLATFORM, 0, - NULL, wilytowrRomInfo, wilytowrRomName, NULL, NULL, WilytowrInputInfo, WilytowrDIPInfo, - wilytowrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x104, - 256, 224, 4, 3 -}; - - -// Atomic Boy (revision B) - -static struct BurnRomInfo atomboyRomDesc[] = { - { "wt_a-4e.bin", 0x2000, 0xf7978185, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 code - { "wt_a-4h.bin", 0x2000, 0x0ca9950b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "wt_a-4j.bin", 0x2000, 0x1badbc65, 1 | BRF_PRG | BRF_ESS }, // 2 - { "wt_a-4k.bin", 0x2000, 0x5a341f75, 1 | BRF_PRG | BRF_ESS }, // 3 - { "wt_a-4m.bin", 0x2000, 0xc1f8a7d5, 1 | BRF_PRG | BRF_ESS }, // 4 - { "wt_a-4n.bin", 0x2000, 0xb212f7d2, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "wt_a-4d-b.bin", 0x2000, 0x793ea53f, 2 | BRF_PRG | BRF_ESS }, // 6 I8039 code - - { "wt_b-5e.bin", 0x1000, 0xfe45df43, 3 | BRF_GRA }, // 7 Characters - { "wt_b-5f.bin", 0x1000, 0x87a17eff, 3 | BRF_GRA }, // 8 - - { "wt_b-5a.bin", 0x2000, 0xda22c452, 4 | BRF_GRA }, // 9 Tiles - { "wt_b-5b.bin", 0x2000, 0x4fb25a1f, 4 | BRF_GRA }, // 10 - { "wt_b-5d.bin", 0x2000, 0x75be2604, 4 | BRF_GRA }, // 11 - - { "wt_a-3j-b.bin", 0x2000, 0x996470f1, 5 | BRF_GRA }, // 12 Sprites - { "wt_a-3k-b.bin", 0x2000, 0x8f4ec45c, 5 | BRF_GRA }, // 13 - { "wt_a-3m-b.bin", 0x2000, 0x4ac40358, 5 | BRF_GRA }, // 14 - { "wt_a-3n-b.bin", 0x2000, 0x709eef5b, 5 | BRF_GRA }, // 15 - { "wt_a-3p-b.bin", 0x2000, 0x3018b840, 5 | BRF_GRA }, // 16 - { "wt_a-3s-b.bin", 0x2000, 0x05a251d4, 5 | BRF_GRA }, // 17 - - { "wt_a-6d.bin", 0x1000, 0xa5dde29b, 6 | BRF_SND }, // 18 Sound data - - { "wt_a-5s-b.bpr", 0x0100, 0x991e2a04, 7 | BRF_GRA }, // 19 Color PROMs - { "wt_a-5r-b.bpr", 0x0100, 0xfb3822b7, 7 | BRF_GRA }, // 20 - { "wt_a-5p-b.bpr", 0x0100, 0x95849f7d, 7 | BRF_GRA }, // 21 - { "wt_b-9l-.bpr", 0x0020, 0xd2728744, 7 | BRF_GRA }, // 22 -}; - -STD_ROM_PICK(atomboy) -STD_ROM_FN(atomboy) - -struct BurnDriver BurnDrvAtomboy = { - "atomboy", "wilytowr", NULL, NULL, "1985", - "Atomic Boy (revision B)\0", NULL, "Irem (Memetron license)", "M63", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_IREM_M63, GBF_PLATFORM, 0, - NULL, atomboyRomInfo, atomboyRomName, NULL, NULL, WilytowrInputInfo, WilytowrDIPInfo, - atomboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x104, - 256, 224, 4, 3 -}; - - -// Atomic Boy (revision A) - -static struct BurnRomInfo atomboyaRomDesc[] = { - { "wt_a-4e.bin", 0x2000, 0xf7978185, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 code - { "wt_a-4h.bin", 0x2000, 0x0ca9950b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "wt_a-4j.bin", 0x2000, 0x1badbc65, 1 | BRF_PRG | BRF_ESS }, // 2 - { "wt_a-4k.bin", 0x2000, 0x5a341f75, 1 | BRF_PRG | BRF_ESS }, // 3 - { "wt_a-4m.bin", 0x2000, 0xc1f8a7d5, 1 | BRF_PRG | BRF_ESS }, // 4 - { "wt_a-4n.bin", 0x2000, 0xb212f7d2, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "wt_a-4d.bin", 0x1000, 0x3d43361e, 2 | BRF_PRG | BRF_ESS }, // 6 I8039 code - - { "wt_b-5e.bin", 0x1000, 0xfe45df43, 3 | BRF_GRA }, // 7 Characters - { "wt_b-5f.bin", 0x1000, 0x87a17eff, 3 | BRF_GRA }, // 8 - - { "wt_b-5a.bin", 0x2000, 0xda22c452, 4 | BRF_GRA }, // 9 Tiles - { "wt_b-5b.bin", 0x2000, 0x4fb25a1f, 4 | BRF_GRA }, // 10 - { "wt_b-5d.bin", 0x2000, 0x75be2604, 4 | BRF_GRA }, // 11 - - { "wt_a-3j.bin", 0x1000, 0xb30ca38f, 5 | BRF_GRA }, // 12 Sprites - { "wt_a-3k.bin", 0x1000, 0x9a77eb73, 5 | BRF_GRA }, // 13 - { "wt_a-3m.bin", 0x1000, 0xe7e468ae, 5 | BRF_GRA }, // 14 - { "wt_a-3n.bin", 0x1000, 0x0741d1a9, 5 | BRF_GRA }, // 15 - { "wt_a-3p.bin", 0x1000, 0x7299f362, 5 | BRF_GRA }, // 16 - { "wt_a-3s.bin", 0x1000, 0x9b37d50d, 5 | BRF_GRA }, // 17 - - { "wt_a-6d.bin", 0x1000, 0xa5dde29b, 6 | BRF_SND }, // 18 Sound data - - { "wt_a-5s-.bpr", 0x0100, 0x041950e7, 7 | BRF_GRA }, // 19 Color PROMs - { "wt_a-5r-.bpr", 0x0100, 0xbc04bf25, 7 | BRF_GRA }, // 20 - { "wt_a-5p-.bpr", 0x0100, 0xed819a19, 7 | BRF_GRA }, // 21 - { "wt_b-9l-.bpr", 0x0020, 0xd2728744, 7 | BRF_GRA }, // 22 -}; - -STD_ROM_PICK(atomboya) -STD_ROM_FN(atomboya) - -struct BurnDriver BurnDrvAtomboya = { - "atomboya", "wilytowr", NULL, NULL, "1985", - "Atomic Boy (revision A)\0", NULL, "Irem (Memetron license)", "M63", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_IREM_M63, GBF_PLATFORM, 0, - NULL, atomboyaRomInfo, atomboyaRomName, NULL, NULL, WilytowrInputInfo, WilytowrDIPInfo, - atomboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x104, - 256, 224, 4, 3 -}; - - -// Fighting Basketball - -static struct BurnRomInfo fghtbsktRomDesc[] = { - { "fb14.0f", 0x2000, 0x82032853, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 code - { "fb13.2f", 0x2000, 0x5306df0f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fb12.3f", 0x2000, 0xee9210d4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fb10.6f", 0x2000, 0x6b47efba, 1 | BRF_PRG | BRF_ESS }, // 3 - { "fb09.7f", 0x2000, 0xbe69e087, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "fb07.0b", 0x1000, 0x50432dbd, 2 | BRF_PRG | BRF_ESS }, // 5 I8039 code - - { "fb08.12f", 0x1000, 0x271cd7b8, 3 | BRF_GRA }, // 6 Characters - - { "fb21.25e", 0x2000, 0x02843591, 4 | BRF_GRA }, // 7 Tiles - { "fb22.23e", 0x2000, 0xcd51d8e7, 4 | BRF_GRA }, // 8 - { "fb23.22e", 0x2000, 0x62bcac87, 4 | BRF_GRA }, // 9 - - { "fb16.35a", 0x2000, 0xa5df1652, 5 | BRF_GRA }, // 10 Sprites - { "fb15.37a", 0x2000, 0x59c4de06, 5 | BRF_GRA }, // 11 - { "fb18.32a", 0x2000, 0xc23ddcd7, 5 | BRF_GRA }, // 12 - { "fb17.34a", 0x2000, 0x7db28013, 5 | BRF_GRA }, // 13 - { "fb20.29a", 0x2000, 0x1a1b48f8, 5 | BRF_GRA }, // 14 - { "fb19.31a", 0x2000, 0x7ff7e321, 5 | BRF_GRA }, // 15 - - { "fb06.12a", 0x2000, 0xbea3df99, 6 | BRF_SND }, // 16 Sound data - - { "fb_r.9e", 0x0100, 0xc5cdc8ba, 7 | BRF_GRA }, // 17 Color PROMs - { "fb_g.10e", 0x0100, 0x1460c936, 7 | BRF_GRA }, // 18 - { "fb_b.11e", 0x0100, 0xfca5bf0e, 7 | BRF_GRA }, // 19 - - { "fb01.42a", 0x2000, 0x1200b220, 8 | BRF_SND }, // 20 Samples - { "fb02.41a", 0x2000, 0x0b67aa82, 8 | BRF_SND }, // 21 - { "fb03.40a", 0x2000, 0xc71269ed, 8 | BRF_SND }, // 22 - { "fb04.39a", 0x2000, 0x02ddc42d, 8 | BRF_SND }, // 23 - { "fb05.38a", 0x2000, 0x72ea6b49, 8 | BRF_SND }, // 24 -}; - -STD_ROM_PICK(fghtbskt) -STD_ROM_FN(fghtbskt) - -struct BurnDriver BurnDrvFghtbskt = { - "fghtbskt", NULL, NULL, NULL, "1984", - "Fighting Basketball\0", NULL, "Paradise Co. Ltd.", "M63", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M63, GBF_SPORTSMISC, 0, - NULL, fghtbsktRomInfo, fghtbsktRomName, NULL, NULL, FghtbsktInputInfo, FghtbsktDIPInfo, - fghtbsktInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/irem/d_m72.cpp b/jan/src/burn/drv/irem/d_m72.cpp deleted file mode 100644 index a80c88e7d..000000000 --- a/jan/src/burn/drv/irem/d_m72.cpp +++ /dev/null @@ -1,4064 +0,0 @@ -// FB Alpha Irem M72 driver module -// Based on MAME driver by Nicola Salmoria and Nao - -/* - to do: - majtitle rowscrolling issue (start game, hit a ball and watch the bg) - poundfor inputs -*/ - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "nec_intf.h" -#include "irem_cpu.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvV30ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvV30RAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPalRAM; -static UINT8 *DrvProtRAM; -static UINT8 *DrvRowScroll; -static UINT8 *DrvSprRAM2; - -static UINT8 *scroll; - -static UINT8 *RamPrioBitmap; - -static UINT8 *soundlatch; -static UINT8 *video_disable; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; -static INT32 ym2151_previous = 0; -static UINT8 irqvector; -static INT32 sample_address; -static INT32 irq_raster_position; -static INT32 z80_reset = 0; -static INT32 majtitle_rowscroll_enable = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static INT32 nCurrentCycles; -static INT32 nCyclesDone[2]; -static INT32 nCyclesTotal[2]; - -static INT32 Clock_16mhz = 0; -static INT32 Kengo = 0; -static INT32 CosmicCop = 0; -static INT32 m72_video_type = 0; -static INT32 z80_nmi_enable = 0; -static INT32 enable_z80_reset = 0; // only if z80 is not rom-based! -static INT32 m72_irq_base = 0; -static INT32 code_mask[4]; -static INT32 graphics_length[4]; -static INT32 video_offsets[2] = { 0, 0 }; - -enum { Z80_NO_NMI=0, Z80_REAL_NMI, Z80_FAKE_NMI }; -enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, Z80_ASSERT, Z80_CLEAR }; - - -static struct BurnInputInfo CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common) - -static struct BurnInputInfo PoundforInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 2, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 0, "p1 start"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - // save space for analog inputs - {"P2 Button 3", BIT_DIGITAL, DrvJoy5 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy5 + 6, "p2 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 3, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 2"}, - - // save space for analog inputs... - {"P2 Button 5", BIT_DIGITAL, DrvJoy5 + 6, "p2 fire 5"}, - {"P2 Button 6", BIT_DIGITAL, DrvJoy5 + 6, "p2 fire 6"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Poundfor) - -static struct BurnDIPInfo Dip2CoinDIPList[]= -{ - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x17, 0x01, 0x08, 0x08, "Mode 1" }, - {0x17, 0x01, 0x08, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x17, 0x01, 0xf0, 0xa0, "6 Coins 1 Credit" }, - {0x17, 0x01, 0xf0, 0xb0, "5 Coins 1 Credit" }, - {0x17, 0x01, 0xf0, 0xc0, "4 Coins 1 Credit" }, - {0x17, 0x01, 0xf0, 0xd0, "3 Coins 1 Credit" }, - {0x17, 0x01, 0xf0, 0xe0, "2 Coins 1 Credit" }, - {0x17, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Cont." }, - {0x17, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x17, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x17, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x17, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x17, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x17, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x17, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x17, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x17, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x17, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -static struct BurnDIPInfo Dip1CoinDIPList[]= -{ - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x16, 0x01, 0xf0, 0xa0, "6 Coins 1 Credit" }, - {0x16, 0x01, 0xf0, 0xb0, "5 Coins 1 Credit" }, - {0x16, 0x01, 0xf0, 0xc0, "4 Coins 1 Credit" }, - {0x16, 0x01, 0xf0, 0xd0, "3 Coins 1 Credit" }, - {0x16, 0x01, 0xf0, 0x10, "8 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0xe0, "2 Coins 1 Credit" }, - {0x16, 0x01, 0xf0, 0x20, "5 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x16, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x16, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x16, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x17, 0x01, 0x04, 0x04, "Mode 1" }, - {0x17, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2, "Stop Mode" }, - {0x17, 0x01, 0x20, 0x20, "Off" }, - {0x17, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x80, 0x80, "Off" }, - {0x17, 0x01, 0x80, 0x00, "On" }, -}; - -static struct BurnDIPInfo RtypeDIPList[]= -{ - {0x16, 0xff, 0xff, 0xfb, NULL }, - {0x17, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x16, 0x01, 0x08, 0x00, "50K 150K 250K 400K 600K" }, - {0x16, 0x01, 0x08, 0x08, "100K 200K 350K 500K 700K" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x17, 0x01, 0x02, 0x00, "Upright" }, - {0x17, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x17, 0x01, 0x08, 0x08, "Normal" }, - {0x17, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x17, 0x01, 0x10, 0x00, "No" }, - {0x17, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFOEXT(Rtype, Dip1Coin, Rtype ) - -static struct BurnDIPInfo RtypepDIPList[]= -{ - {0x16, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, -}; - -STDDIPINFOEXT(Rtypep, Rtype, Rtypep ) - -static struct BurnDIPInfo XmultiplDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Very Easy" }, - {0x16, 0x01, 0x03, 0x01, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Normal" }, - {0x16, 0x01, 0x03, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x0c, 0x08, "1" }, - {0x16, 0x01, 0x0c, 0x04, "2" }, - {0x16, 0x01, 0x0c, 0x0c, "3" }, - {0x16, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Cabinet" }, - {0x17, 0x01, 0x02, 0x00, "Upright (single)" }, - {0x17, 0x01, 0x02, 0x02, "Cocktail" }, - {0x17, 0x01, 0x02, 0x00, "Upright (double) On" }, - {0x17, 0x01, 0x02, 0x02, "Upright (double) Off" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x08, 0x00, "Off" }, - {0x17, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Upright (double) Mode" }, - {0x17, 0x01, 0x10, 0x10, "Off" }, - {0x17, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x17, 0x01, 0x20, 0x00, "No" }, - {0x17, 0x01, 0x20, 0x20, "Yes" }, -}; - -STDDIPINFOEXT(Xmultipl, Dip1Coin, Xmultipl ) - -static struct BurnDIPInfo DbreedDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xf5, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x17, 0x01, 0x02, 0x00, "Upright" }, - {0x17, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x08, 0x08, "Off" }, - {0x17, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x17, 0x01, 0x10, 0x00, "No" }, - {0x17, 0x01, 0x10, 0x10, "Yes" }, -}; - -STDDIPINFOEXT(Dbreed, Dip1Coin, Dbreed ) - -static struct BurnDIPInfo BchopperDIPList[]= -{ - {0x16, 0xff, 0xff, 0xfb, NULL }, - {0x17, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x00, "1" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x16, 0x01, 0x08, 0x08, "80K 200K 350K" }, - {0x16, 0x01, 0x08, 0x00, "100K 250K 400K" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x17, 0x01, 0x02, 0x00, "Upright" }, - {0x17, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x17, 0x01, 0x08, 0x08, "Normal" }, - {0x17, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x17, 0x01, 0x10, 0x00, "No" }, - {0x17, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFOEXT(Bchopper, Dip1Coin, Bchopper ) - -static struct BurnDIPInfo NspiritDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xf5, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - {0x16, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x17, 0x01, 0x02, 0x00, "Upright" }, - {0x17, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x08, 0x08, "Off" }, - {0x17, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x17, 0x01, 0x10, 0x00, "No" }, - {0x17, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFOEXT(Nspirit, Dip1Coin, Nspirit ) - -static struct BurnDIPInfo ImgfightDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xe5, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x08, "Hard" }, - {0x16, 0x01, 0x0c, 0x04, "Hardest" }, - {0x16, 0x01, 0x0c, 0x00, "Debug Mode 2 lap" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x17, 0x01, 0x02, 0x00, "Upright" }, - {0x17, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x08, 0x08, "Off" }, - {0x17, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFOEXT(Imgfight, Dip1Coin, Imgfight ) - -static struct BurnDIPInfo Rtype2DIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - {0x16, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x02, 0x00, "Off" }, - {0x17, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x17, 0x01, 0x18, 0x10, "Upright" }, - {0x17, 0x01, 0x18, 0x00, "Upright (2P)" }, - {0x17, 0x01, 0x18, 0x18, "Cocktail" }, -}; - -STDDIPINFOEXT(Rtype2, Dip1Coin, Rtype2 ) - -static struct BurnDIPInfo LohtDIPList[]= -{ - {0x16, 0xff, 0xff, 0xfb, NULL }, - {0x17, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x00, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x02, "4" }, - {0x16, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x17, 0x01, 0x02, 0x00, "Upright" }, - {0x17, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x18, 0x00, "Easy" }, - {0x17, 0x01, 0x18, 0x18, "Normal" }, - {0x17, 0x01, 0x18, 0x10, "Hard" }, - {0x17, 0x01, 0x18, 0x08, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFOEXT(Loht, Dip1Coin, Loht ) - -static struct BurnDIPInfo AirduelDIPList[]= -{ - {0x16, 0xff, 0xff, 0xbf, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, -}; - -STDDIPINFOEXT(Airduel, Dip2Coin, Airduel ) - -static struct BurnDIPInfo GallopDIPList[]= -{ - {0x16, 0xff, 0xff, 0xbf, NULL }, - {0x17, 0xff, 0xff, 0xf9, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 0, "Allow Continue" }, - {0x16, 0x01, 0x20, 0x00, "No" }, - {0x16, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x17, 0x01, 0x06, 0x00, "Upright" }, - {0x17, 0x01, 0x06, 0x02, "Upright (2P)" }, - {0x17, 0x01, 0x06, 0x06, "Cocktail" }, -}; - -STDDIPINFOEXT(Gallop, Dip2Coin, Gallop ) - -static struct BurnDIPInfo KengoDIPList[]= -{ - {0x16, 0xff, 0xff, 0xbf, NULL }, - {0x17, 0xff, 0xff, 0xf9, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x20, 0x00, "No" }, - {0x16, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, -}; - -STDDIPINFOEXT(Kengo, Dip2Coin, Kengo ) - -static struct BurnDIPInfo HharryDIPList[]= -{ - {0x16, 0xff, 0xff, 0xbf, NULL }, - {0x17, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Continue Limit" }, - {0x16, 0x01, 0x10, 0x00, "No" }, - {0x16, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x20, 0x00, "No" }, - {0x16, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x17, 0x01, 0x06, 0x04, "Upright" }, - {0x17, 0x01, 0x06, 0x00, "Upright (2P)" }, - {0x17, 0x01, 0x06, 0x06, "Cocktail" }, -}; - -STDDIPINFOEXT(Hharry, Dip2Coin, Hharry ) - -static struct BurnDIPInfo PoundforDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xbf, NULL }, - {0x0f, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Round Time" }, - {0x0e, 0x01, 0x03, 0x02, "60" }, - {0x0e, 0x01, 0x03, 0x03, "90" }, - {0x0e, 0x01, 0x03, 0x01, "120" }, - {0x0e, 0x01, 0x03, 0x00, "150" }, - - {0 , 0xfe, 0 , 2, "Matches/Credit (2P)" }, - {0x0e, 0x01, 0x04, 0x04, "1" }, - {0x0e, 0x01, 0x04, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Rounds/Match" }, - {0x0e, 0x01, 0x08, 0x08, "2" }, - {0x0e, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0e, 0x01, 0x10, 0x10, "Normal" }, - {0x0e, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Trackball Size" }, - {0x0e, 0x01, 0x20, 0x20, "Small" }, - {0x0e, 0x01, 0x20, 0x00, "Large" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0e, 0x01, 0x40, 0x40, "Off" }, - {0x0e, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x01, 0x01, "Off" }, - {0x0f, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x0f, 0x01, 0x06, 0x04, "Upright" }, - {0x0f, 0x01, 0x06, 0x02, "Upright (2P)" }, - {0x0f, 0x01, 0x06, 0x06, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x0f, 0x01, 0x08, 0x08, "Mode 1" }, - {0x0f, 0x01, 0x08, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x0f, 0x01, 0xf0, 0xa0, "6 Coins 1 Credit" }, - {0x0f, 0x01, 0xf0, 0xb0, "5 Coins 1 Credit" }, - {0x0f, 0x01, 0xf0, 0xc0, "4 Coins 1 Credit" }, - {0x0f, 0x01, 0xf0, 0xd0, "3 Coins 1 Credit" }, - {0x0f, 0x01, 0xf0, 0xe0, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x0f, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x0f, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0xf0, 0x10, "1 Coin/1 Credit, 1 Coin/Cont."}, - {0x0f, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x0f, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x0f, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x0f, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Poundfor) - -//-------------------------------------------------------------------------------------------------------------------------------------------------- -// Protection handlers - -static const UINT8 *protection_code = NULL; -static const UINT8 *protection_crc = NULL; -static const INT32 *protection_sample_offsets = NULL; - -static UINT8 protection_read(INT32 address) -{ - if (address == 0xb0ffb) { - if (protection_code != NULL) { - memcpy (DrvProtRAM, protection_code, 96); - } - } - - return DrvProtRAM[address & 0xfff]; -} - -static void protection_write(INT32 address, UINT8 data) -{ - DrvProtRAM[address & 0xfff] = data ^ 0xff; - - if (address == 0xb0fff && data == 0) { - if (protection_crc != NULL) { - memcpy (DrvProtRAM + 0xfe0, protection_crc, 18); - } - } -} - -static void protection_sample_offset_write(UINT8 data) -{ - if (protection_sample_offsets != NULL) { - if (data < protection_sample_offsets[0]) { - sample_address = protection_sample_offsets[data+1]; - } - } -} - -static void m72_install_protection(const UINT8 *code, const UINT8 *crc, const INT32 *offs) -{ - protection_code = code; - protection_crc = crc; - protection_sample_offsets = offs; -} - -#define install_protection(name) m72_install_protection(name##_code, name##_crc, name##_sample_offsets) - -/* Battle Chopper / Mr. Heli */ -static const INT32 bchopper_sample_offsets[7] = { 6, 0x0000, 0x0010, 0x2510, 0x6510, 0x8510, 0x9310 }; - -static const UINT8 bchopper_code[96] = -{ - 0x68,0x00,0xa0, // push 0a000h - 0x1f, // pop ds - 0xc6,0x06,0x38,0x38,0x53, // mov [3838h], byte 053h - 0xc6,0x06,0x3a,0x38,0x41, // mov [383ah], byte 041h - 0xc6,0x06,0x3c,0x38,0x4d, // mov [383ch], byte 04dh - 0xc6,0x06,0x3e,0x38,0x4f, // mov [383eh], byte 04fh - 0xc6,0x06,0x40,0x38,0x54, // mov [3840h], byte 054h - 0xc6,0x06,0x42,0x38,0x4f, // mov [3842h], byte 04fh - 0x68,0x00,0xb0, // push 0b000h - 0x1f, // pop ds - 0xc6,0x06,0x00,0x09,0x49^0xff, // mov [0900h], byte 049h - 0xc6,0x06,0x00,0x0a,0x49^0xff, // mov [0a00h], byte 049h - 0xc6,0x06,0x00,0x0b,0x49^0xff, // mov [0b00h], byte 049h - 0xc6,0x06,0x00,0x00,0xcb^0xff, // mov [0000h], byte 0cbh ; retf : bypass protection check during the game - 0x68,0x00,0xd0, // push 0d000h - 0x1f, // pop ds - // the following is for mrheli only, the game checks for - // "This game can only be played in Japan..." message in the video text buffer - // the message is nowhere to be found in the ROMs, so has to be displayed by the mcu - 0xc6,0x06,0x70,0x16,0x77, // mov [1670h], byte 077h - 0xea,0x68,0x01,0x40,0x00 // jmp 0040:$0168 -}; - -static const UINT8 bchopper_crc[18] = { - 0x1a,0x12,0x5c,0x08,0x84,0xb6,0x73,0xd1,0x54,0x91,0x94,0xeb,0x00,0x00 -}; - -static const UINT8 mrheli_crc[18] = { - 0x24,0x21,0x1f,0x14,0xf9,0x28,0xfb,0x47,0x4c,0x77,0x9e,0xc2,0x00,0x00 -}; - -/* X Multiply */ -static const INT32 xmultiplm72_sample_offsets[4] = { 3, 0x0000, 0x0020, 0x1a40 }; - -static const UINT8 xmultiplm72_code[96] = { - 0xea,0x30,0x02,0x00,0x0e // jmp 0e00:$0230 -}; - -static const UINT8 xmultiplm72_crc[18] = { - 0x73,0x82,0x4e,0x3f, 0xfc,0x56,0x59,0x06,0x05,0x48,0xa8,0xf4,0x00,0x00 -}; - -/* Dragon Breed */ -static const INT32 dbreedm72_sample_offsets[10] = { 9, 0x00000, 0x00020, 0x02c40, 0x08160, 0x0c8c0, 0x0ffe0, 0x13000, 0x15820, 0x15f40 }; - -static const UINT8 dbreedm72_code[96] = { - 0xea,0x6c,0x00,0x00,0x00 // jmp 0000:$006c -}; - -static const UINT8 dbreedm72_crc[18] ={ - 0xa4,0x96,0x5f,0xc0, 0xab,0x49,0x9f,0x19,0x84,0xe6,0xd6,0xca,0x00,0x00 -}; - -/* Ninja Spirit */ -static const INT32 nspirit_sample_offsets[10] = { 9, 0x0000, 0x0020, 0x2020, 0, 0x5720, 0, 0x7b60, 0x9b60, 0xc360 }; - -static const UINT8 nspirit_code[96] = -{ - 0x68,0x00,0xa0, // push 0a000h - 0x1f, // pop ds - 0xc6,0x06,0x38,0x38,0x4e, // mov [3838h], byte 04eh - 0xc6,0x06,0x3a,0x38,0x49, // mov [383ah], byte 049h - 0xc6,0x06,0x3c,0x38,0x4e, // mov [383ch], byte 04eh - 0xc6,0x06,0x3e,0x38,0x44, // mov [383eh], byte 044h - 0xc6,0x06,0x40,0x38,0x4f, // mov [3840h], byte 04fh - 0xc6,0x06,0x42,0x38,0x55, // mov [3842h], byte 055h - 0x68,0x00,0xb0, // push 0b000h - 0x1f, // pop ds - 0xc6,0x06,0x00,0x09,0x49^0xff, // mov [0900h], byte 049h - 0xc6,0x06,0x00,0x0a,0x49^0xff, // mov [0a00h], byte 049h - 0xc6,0x06,0x00,0x0b,0x49^0xff, // mov [0b00h], byte 049h - 0x68,0x00,0xd0, // push 0d000h - 0x1f, // pop ds - // the following is for nspiritj only, the game checks for - // "This game can only be played in Japan..." message in the video text buffer - // the message is nowhere to be found in the ROMs, so has to be displayed by the mcu - 0xc6,0x06,0x70,0x16,0x57, // mov [1670h], byte 057h - 0xc6,0x06,0x71,0x16,0x00, // mov [1671h], byte 000h - 0xea,0x00,0x00,0x40,0x00 // jmp 0040:$0000 -}; - -static const UINT8 nspirit_crc[18] = { - 0xfe,0x94,0x6e,0x4e, 0xc8,0x33,0xa7,0x2d,0xf2,0xa3,0xf9,0xe1, 0xa9,0x6c,0x02,0x95, 0x00,0x00 -}; - -static const UINT8 nspiritj_crc[18] = { - 0x26,0xa3,0xa5,0xe9, 0xc8,0x33,0xa7,0x2d,0xf2,0xa3,0xf9,0xe1, 0xbc,0x6c,0x01,0x95, 0x00,0x00 -}; - -/* Image Fight */ -static const INT32 imgfight_sample_offsets[8] = { 7, 0x0000, 0x0020, 0x44e0, 0x98a0, 0xc820, 0xf7a0, 0x108c0 }; - -static const UINT8 imgfight_code[96] = -{ - 0x68,0x00,0xa0, // push 0a000h - 0x1f, // pop ds - 0xc6,0x06,0x38,0x38,0x50, // mov [3838h], byte 050h - 0xc6,0x06,0x3a,0x38,0x49, // mov [383ah], byte 049h - 0xc6,0x06,0x3c,0x38,0x43, // mov [383ch], byte 043h - 0xc6,0x06,0x3e,0x38,0x4b, // mov [383eh], byte 04bh - 0xc6,0x06,0x40,0x38,0x45, // mov [3840h], byte 045h - 0xc6,0x06,0x42,0x38,0x54, // mov [3842h], byte 054h - 0x68,0x00,0xb0, // push 0b000h - 0x1f, // pop ds - 0xc6,0x06,0x00,0x09,0x49^0xff, // mov [0900h], byte 049h - 0xc6,0x06,0x00,0x0a,0x49^0xff, // mov [0a00h], byte 049h - 0xc6,0x06,0x00,0x0b,0x49^0xff, // mov [0b00h], byte 049h - 0xc6,0x06,0x20,0x09,0x49^0xff, // mov [0920h], byte 049h - 0xc6,0x06,0x21,0x09,0x4d^0xff, // mov [0921h], byte 04dh - 0xc6,0x06,0x22,0x09,0x41^0xff, // mov [0922h], byte 041h - 0xc6,0x06,0x23,0x09,0x47^0xff, // mov [0923h], byte 047h - 0x68,0x00,0xd0, // push 0d000h - 0x1f, // pop ds - // the game checks for - // "This game can only be played in Japan..." message in the video text buffer - // the message is nowhere to be found in the ROMs, so has to be displayed by the mcu - 0xc6,0x06,0xb0,0x1c,0x57, // mov [1cb0h], byte 057h - 0xea,0x00,0x00,0x40,0x00 // jmp 0040:$0000 -}; - -static const UINT8 imgfight_crc[18] = { - 0x7e,0xcc,0xec,0x03, 0x04,0x33,0xb6,0xc5, 0xbf,0x37,0x92,0x94, 0x00,0x00 -}; - -/* Air Duel */ -static const INT32 airduel_sample_offsets[17] = { - 16, - 0x00000, 0x00020, 0x03ec0, 0x05640, 0x06dc0, 0x083a0, 0x0c000, 0x0eb60, - 0x112e0, 0x13dc0, 0x16520, 0x16d60, 0x18ae0, 0x1a5a0, 0x1bf00, 0x1c340 }; - -static const UINT8 airduel_code[96] = -{ - 0x68,0x00,0xd0, // push 0d000h - 0x1f, // pop ds - // the game checks for - // "This game can only be played in Japan..." message in the video text buffer - // the message is nowhere to be found in the ROMs, so has to be displayed by the mcu - 0xc6,0x06,0xc0,0x1c,0x57, // mov [1cc0h], byte 057h - 0xea,0x69,0x0b,0x00,0x00 // jmp 0000:$0b69 -}; - -static const UINT8 airduel_crc[18] = { - 0x72,0x9c,0xca,0x85, 0xc9,0x12,0xcc,0xea, 0x00,0x00 -}; - -/* Daiku no Gensan */ -static const INT32 dkgenm72_sample_offsets[29] = { - 28, - 0x00000, 0x00020, 0x01800, 0x02da0, 0x03be0, 0x05ae0, 0x06100, 0x06de0, - 0x07260, 0x07a60, 0x08720, 0x0a5c0, 0x0c3c0, 0x0c7a0, 0x0e140, 0x0fb00, - 0x10fa0, 0x10fc0, 0x10fe0, 0x11f40, 0x12b20, 0x130a0, 0x13c60, 0x14740, - 0x153c0, 0x197e0, 0x1af40, 0x1c080 }; - -static const UINT8 dkgenm72_code[96] = { - 0xea,0x3d,0x00,0x00,0x10 // jmp 1000:$003d -}; - -static const UINT8 dkgenm72_crc[18] = { - 0xc8,0xb4,0xdc,0xf8, 0xd3,0xba,0x48,0xed,0x79,0x08,0x1c,0xb3, 0x00,0x00 -}; - -/* Legend of Hero Tonma */ -static const INT32 loht_sample_offsets[8] = { 7, 0x0000, 0x0020, 0, 0x2c40, 0x4320, 0x7120, 0xb200 }; - -static const UINT8 loht_code[96] = -{ - 0x68,0x00,0xa0, // push 0a000h - 0x1f, // pop ds - 0xc6,0x06,0x3c,0x38,0x47, // mov [383ch], byte 047h - 0xc6,0x06,0x3d,0x38,0x47, // mov [383dh], byte 047h - 0xc6,0x06,0x42,0x38,0x44, // mov [3842h], byte 044h - 0xc6,0x06,0x43,0x38,0x44, // mov [3843h], byte 044h - 0x68,0x00,0xb0, // push 0b000h - 0x1f, // pop ds - 0xc6,0x06,0x00,0x09,0x49^0xff, // mov [0900h], byte 049h - 0xc6,0x06,0x00,0x0a,0x49^0xff, // mov [0a00h], byte 049h - 0xc6,0x06,0x00,0x0b,0x49^0xff, // mov [0b00h], byte 049h - - 0x68,0x00,0xd0, // push 0d000h // Japan set only - 0x1f, // pop ds // Japan set only - 0xc6,0x06,0x70,0x16,0x57, // mov [1670h], byte 057h // Japan set only - checks this (W) of WARNING - - 0xea,0x5d,0x01,0x40,0x00 // jmp 0040:$015d -}; - -static const UINT8 loht_crc[18] = { - 0x39,0x00,0x82,0xae, 0x2c,0x9d,0x4b,0x73,0xfb,0xac,0xd4,0x6d, 0x6d,0x5b,0x77,0xc0, 0x00,0x00 -}; - -/* Gallop - Armed police Unit */ -static const INT32 gallop_sample_offsets[32] = { - 31, - 0x00000, 0x00020, 0x00040, 0x01360, 0x02580, 0x04f20, 0x06240, 0x076e0, - 0x08660, 0x092a0, 0x09ba0, 0x0a560, 0x0cee0, 0x0de20, 0x0e620, 0x0f1c0, - 0x10200, 0x10220, 0x10240, 0x11380, 0x12760, 0x12780, 0x127a0, 0x13c40, - 0x140a0, 0x16760, 0x17e40, 0x18ee0, 0x19f60, 0x1bbc0, 0x1cee0 }; - -//-------------------------------------------------------------------------------------------------------------------------------------------------- - - -static void setvector_callback(INT32 param) -{ - switch (param) - { - case VECTOR_INIT: irqvector = 0xff; break; - case YM2151_ASSERT: irqvector &= 0xef; break; - case YM2151_CLEAR: irqvector |= 0x10; break; - case Z80_ASSERT: irqvector &= 0xdf; break; - case Z80_CLEAR: irqvector |= 0x20; break; - } - - if (irqvector == 0xff) { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } else { - ZetSetVector(irqvector); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } -} - -static void palette_write(INT32 offset, INT32 offset2) -{ - if (offset & 1) return; - - UINT16 *pal = (UINT16*)DrvPalRAM; - offset = (offset / 2) & 0x00ff; - - INT32 offset3 = offset; - if (offset2) { - offset3 |= 0x0100; - pal += 0x1000 / 2; - } - - INT32 r = BURN_ENDIAN_SWAP_INT16(pal[offset + 0x000]) & 0x1f; - INT32 g = BURN_ENDIAN_SWAP_INT16(pal[offset + 0x200]) & 0x1f; - INT32 b = BURN_ENDIAN_SWAP_INT16(pal[offset + 0x400]) & 0x1f; - - DrvPalette[offset3] = BurnHighCol((r << 3) | (r >> 2), (g << 3) | (g >> 2), (b << 3) | (b >> 2), 0); -} - -UINT8 __fastcall m72_main_read(UINT32 address) -{ - if ((address & 0xff000) == 0xb0000) { - return protection_read(address); - } - - return 0; -} - -void __fastcall m72_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xff000) == 0xb0000) { - protection_write(address, data); - return; - } - - if ((address & 0xff000) == 0xc8000) { - if (address & 1) data = 0xff; - DrvPalRAM[(address & 0xdff) | 0x0000] = DrvPalRAM[(address & 0xdff) | 0x0200] = data | 0xe0; - palette_write(address, 0); - return; - } - - if ((address & 0xff000) == 0xcc000) { - if (address & 1) data = 0xff; - DrvPalRAM[(address & 0xdff) | 0x1000] = DrvPalRAM[(address & 0xdff) | 0x1200] = data | 0xe0; - palette_write(address, 1); - return; - } -} - -void __fastcall rtype2_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xff000) == 0xc8000 || (address & 0xff000) == 0xa0000 || (address & 0xff000) == 0xcc000) { - if (address & 1) data = 0xff; - DrvPalRAM[(address & 0xdff) | 0x0000] = DrvPalRAM[(address & 0xdff) | 0x0200] = data | 0xe0; - palette_write(address, 0); - return; - } - - if ((address & 0xff000) == 0xd8000 || (address & 0xff000) == 0xa8000 || (address & 0xff000) == 0xa4000) { - if (address & 1) data = 0xff; - DrvPalRAM[(address & 0xdff) | 0x1000] = DrvPalRAM[(address & 0xdff) | 0x1200] = data | 0xe0; - palette_write(address, 1); - return; - } - - switch (address) - { - case 0xb0000: - case 0xe0000: // majtitle - irq_raster_position = (irq_raster_position & 0xff00) | (data << 0); - return; - - case 0xb0001: - case 0xe0001: // majtitle - irq_raster_position = (irq_raster_position & 0x00ff) | (data << 8); - return; - - case 0xbc000: - // case 0xbc001: - case 0xec000: // majtitle - // case 0xec001: - memcpy (DrvSprBuf, DrvSprRAM, 0x0400); - return; - } -} - -void __fastcall m72_main_write_port(UINT32 port, UINT8 data) -{ -// bprintf (0, _T("%2.2x, %2.2x wp\n"), port, data); - - switch (port) - { - case 0x00: - *soundlatch = data; - setvector_callback(Z80_ASSERT); - return; - - case 0x01: - return; - - case 0x02: -// case 0x03: - { - // coin counter = data & 3 (&1 = 0, &2 = 1) - // flipscreen = ((data & 0x04) >> 2) ^ ((~input_port_read(space->machine, "DSW") >> 8) & 1); - - video_disable[0] = data & 0x08; - - if (enable_z80_reset) { - if (data & 0x10) { - z80_reset = 0; - } else if (!z80_reset) { // don't reset it if its already resetting - fixes BGM in airduel -dink - ZetReset(); - setvector_callback(VECTOR_INIT); - z80_reset = 1; - } - } - } - return; - - case 0x04: - case 0x05: - memcpy (DrvSprBuf, DrvSprRAM, 0x0400); - return; - - case 0x06: - irq_raster_position = (irq_raster_position & 0xff00) | (data << 0); - return; - - case 0x07: - irq_raster_position = (irq_raster_position & 0x00ff) | (data << 8); - return; - - case 0x40: - case 0x41: - case 0x43: // nop - return; - - case 0x42: - if (m72_irq_base == 0) { - m72_irq_base = data << 2; - //bprintf(0, _T("irq base vector %X.\n"), m72_irq_base); - } - return; - - case 0x80: - case 0x81:// scrolly1 - case 0x82: - case 0x83:// scrollx1 - case 0x84: - case 0x85:// scrolly2 - case 0x86: - case 0x87:// scrollx2 - scroll[port & 0x07] = data; - return; - - // case 0x8e: - case 0x8f: - majtitle_rowscroll_enable = data ? 1 : 0; - return; - - case 0xc0: - protection_sample_offset_write(data); - return; - } -} - -static UINT16 __fastcall poundfor_trackball_r(INT32 offset) -{ - static INT32 prev[4],diff[4]; -// static const char *const axisnames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" }; - -#if 0 - if (offset == 0) - { - INT32 i,curr; - - for (i = 0;i < 4;i++) - { - curr = input_port_read(space->machine, axisnames[i]); - diff[i] = (curr - prev[i]); - prev[i] = curr; - } - } -#endif - prev[0] = 0; - diff[0] = diff[1] = diff[2] = diff[3] = ~0; - INT32 input = DrvInputs[0] | (DrvInputs[3] << 8); - - switch (offset) - { - default: - case 0: - return (diff[0] & 0xff) | ((diff[2] & 0xff) << 8); - case 1: - return ((diff[0] >> 8) & 0x1f) | (diff[2] & 0x1f00) | (~input & 0xe0e0); - case 2: - return (diff[1] & 0xff) | ((diff[3] & 0xff) << 8); - case 3: - return ((diff[1] >> 8) & 0x1f) | (diff[3] & 0x1f00); - } - - return 0; -} - -UINT8 __fastcall m72_main_read_port(UINT32 port) -{ - switch (port) - { - case 0x00: return DrvInputs[0]; - case 0x01: return DrvInputs[1]; - case 0x02: return DrvInputs[2]; - case 0x03: return 0xff; - case 0x04: return DrvDips[0]; - case 0x05: return DrvDips[1]; - } - - if ((port & 0xf8) == 0x08) { - INT32 ret = poundfor_trackball_r((port / 2) & 0x03); - if (port & 1) return ret >> 8; - else return ret; - } - - return 0; -} - -void __fastcall m72_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x40: // poundfor - BurnYM2151SelectRegister(data); - return; - - case 0x01: - case 0x41: // poundfor - BurnYM2151WriteRegister(data); - return; - - case 0x06: - case 0x42: // poundfor - case 0x83: // rtype2 - setvector_callback(Z80_CLEAR); - return; - - case 0x10: // poundfor - case 0x11: - sample_address >>= 4; - sample_address = (sample_address & 0xff00) | (data << 0); - sample_address <<= 4; - return; - - case 0x12: - case 0x13: // poundfor - sample_address >>= 4; - sample_address = (sample_address & 0x00ff) | (data << 8); - sample_address <<= 4; - return; - - case 0x80: // rtype2 - sample_address >>= 5; - sample_address = (sample_address & 0xff00) | (data << 0); - sample_address <<= 5; - return; - - case 0x81: // rtype2 - sample_address >>= 5; - sample_address = (sample_address & 0x00ff) | (data << 8); - sample_address <<= 5; - return; - - case 0x82: - DACSignedWrite(0, data); - sample_address = (sample_address + 1) & 0x3ffff; - if (!DrvSndROM[sample_address]) { - DACWrite(0, 0); // clear dac @ end of sample, fixes distortion in rtype2 level4 after death while also killing an air-tank - } - return; - } -} - -UINT8 __fastcall m72_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x40: // poundfor - case 0x41: // poundfor - return BurnYM2151ReadStatus(); - - case 0x80: // rtype2 - case 0x42: // poundfor - case 0x02: - return *soundlatch; - - case 0x84: - return DrvSndROM[sample_address & 0x3ffff]; - } - - return 0; -} - -static void m72YM2151IRQHandler(INT32 nStatus) -{ - setvector_callback(nStatus ? YM2151_ASSERT : YM2151_CLEAR); -} - -static INT32 m72SyncDAC() -{ // Note: the FPS is 55, but when calculating the sync, we use 4 less FPS - this gets rid of clicks in the sample output. -dink dec. 2, 2014 - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3579545.000 / 51/*(nBurnFPS / 100.000)*/))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - VezOpen(0); - VezReset(); - VezClose(); - - ZetOpen(0); - ZetReset(); - setvector_callback(VECTOR_INIT); - if (enable_z80_reset) { - z80_reset = 1; - } - ZetClose(); - - BurnYM2151Reset(); - DACReset(); - - ym2151_previous = 0; - sample_address = 0; - irq_raster_position = -1; - if (!CosmicCop) m72_irq_base = 0; - - return 0; -} - -static void common_main_cpu_map(INT32 romaddr, INT32 ramaddr) -{ - VezInit(0, V30_TYPE); - - VezOpen(0); - VezMapArea(0x00000, (romaddr-1), 0, DrvV30ROM + 0x000000); - VezMapArea(0x00000, (romaddr-1), 2, DrvV30ROM + 0x000000); - VezMapArea(0x00000+ramaddr, 0x03fff+ramaddr, 0, DrvV30RAM); - VezMapArea(0x00000+ramaddr, 0x03fff+ramaddr, 1, DrvV30RAM); - VezMapArea(0x00000+ramaddr, 0x03fff+ramaddr, 2, DrvV30RAM); -// VezMapArea(0xb0000, 0xb0fff, 2, DrvProtRAM); - VezMapArea(0xc0000, 0xc0fff, 0, DrvSprRAM); - VezMapArea(0xc0000, 0xc0fff, 1, DrvSprRAM); - VezMapArea(0xc0000, 0xc0fff, 2, DrvSprRAM); - VezMapArea(0xc8000, 0xc8fff, 0, DrvPalRAM); -// VezMapArea(0xc8000, 0xc8fff, 1, DrvPalRAM); - VezMapArea(0xc8000, 0xc8fff, 2, DrvPalRAM); - VezMapArea(0xcc000, 0xccfff, 0, DrvPalRAM + 0x1000); -// VezMapArea(0xcc000, 0xccfff, 1, DrvPalRAM + 0x1000); - VezMapArea(0xcc000, 0xccfff, 2, DrvPalRAM + 0x1000); - VezMapArea(0xd0000, 0xd3fff, 0, DrvVidRAM0); - VezMapArea(0xd0000, 0xd3fff, 1, DrvVidRAM0); - VezMapArea(0xd0000, 0xd3fff, 2, DrvVidRAM0); - VezMapArea(0xd8000, 0xdbfff, 0, DrvVidRAM1); - VezMapArea(0xd8000, 0xdbfff, 1, DrvVidRAM1); - VezMapArea(0xd8000, 0xdbfff, 2, DrvVidRAM1); - VezMapArea(0xe0000, 0xeffff, 0, DrvZ80RAM); - VezMapArea(0xe0000, 0xeffff, 1, DrvZ80RAM); - VezMapArea(0xe0000, 0xeffff, 2, DrvZ80RAM); - VezMapArea(0xff800, 0xfffff, 0, DrvV30ROM + 0x0ff800); - VezMapArea(0xff800, 0xfffff, 2, DrvV30ROM + 0x0ff800); - VezSetReadHandler(m72_main_read); - VezSetWriteHandler(m72_main_write); - VezSetReadPort(m72_main_read_port); - VezSetWritePort(m72_main_write_port); - VezClose(); -} - -static void common_040000_040000() { common_main_cpu_map(0x40000, 0x40000); } -static void common_080000_080000() { common_main_cpu_map(0x80000, 0x80000); } -static void common_080000_088000() { common_main_cpu_map(0x80000, 0x88000); } -static void common_080000_090000() { common_main_cpu_map(0x80000, 0x90000); } -static void common_080000_09c000() { common_main_cpu_map(0x80000, 0x9c000); } -static void common_080000_0a0000() { common_main_cpu_map(0x80000, 0xa0000); } - -static void rtype2_main_cpu_map() -{ - VezInit(0, V30_TYPE); - - VezOpen(0); - VezMapArea(0x00000, 0x7ffff, 0, DrvV30ROM + 0x000000); - VezMapArea(0x00000, 0x7ffff, 2, DrvV30ROM + 0x000000); - VezMapArea(0xc0000, 0xc0fff, 0, DrvSprRAM); - VezMapArea(0xc0000, 0xc0fff, 1, DrvSprRAM); - VezMapArea(0xc0000, 0xc0fff, 2, DrvSprRAM); - VezMapArea(0xc8000, 0xc8fff, 0, DrvPalRAM); -// VezMapArea(0xc8000, 0xc8fff, 1, DrvPalRAM); - VezMapArea(0xc8000, 0xc8fff, 2, DrvPalRAM); - VezMapArea(0xd0000, 0xd3fff, 0, DrvVidRAM0); - VezMapArea(0xd0000, 0xd3fff, 1, DrvVidRAM0); - VezMapArea(0xd0000, 0xd3fff, 2, DrvVidRAM0); - VezMapArea(0xd4000, 0xd7fff, 0, DrvVidRAM1); - VezMapArea(0xd4000, 0xd7fff, 1, DrvVidRAM1); - VezMapArea(0xd4000, 0xd7fff, 2, DrvVidRAM1); - VezMapArea(0xd8000, 0xd8fff, 0, DrvPalRAM + 0x1000); -// VezMapArea(0xd8000, 0xd8fff, 1, DrvPalRAM + 0x1000); - VezMapArea(0xd8000, 0xd8fff, 2, DrvPalRAM + 0x1000); - VezMapArea(0xe0000, 0xe3fff, 0, DrvV30RAM); - VezMapArea(0xe0000, 0xe3fff, 1, DrvV30RAM); - VezMapArea(0xe0000, 0xe3fff, 2, DrvV30RAM); - VezMapArea(0xff800, 0xfffff, 0, DrvV30ROM + 0x0ff800); - VezMapArea(0xff800, 0xfffff, 2, DrvV30ROM + 0x0ff800); - VezSetReadHandler(m72_main_read); - VezSetWriteHandler(rtype2_main_write); - VezSetReadPort(m72_main_read_port); - VezSetWritePort(m72_main_write_port); - VezClose(); -} - -static void hharryu_main_cpu_map() -{ - VezInit(0, V35_TYPE); - - VezOpen(0); - VezMapArea(0x00000, 0x7ffff, 0, DrvV30ROM + 0x000000); - VezMapArea(0x00000, 0x7ffff, 2, DrvV30ROM + 0x000000); - VezMapArea(0x80000, 0x83fff, 0, DrvVidRAM0); // kengo - VezMapArea(0x80000, 0x83fff, 1, DrvVidRAM0); - VezMapArea(0x80000, 0x83fff, 2, DrvVidRAM0); - VezMapArea(0x84000, 0x87fff, 0, DrvVidRAM1); // kengo - VezMapArea(0x84000, 0x87fff, 1, DrvVidRAM1); - VezMapArea(0x84000, 0x87fff, 2, DrvVidRAM1); - VezMapArea(0xa0000, 0xa0fff, 0, DrvPalRAM); -// VezMapArea(0xa0000, 0xa0fff, 1, DrvPalRAM); - VezMapArea(0xa0000, 0xa0fff, 2, DrvPalRAM); - VezMapArea(0xa8000, 0xa8fff, 0, DrvPalRAM + 0x1000); -// VezMapArea(0xa8000, 0xa8fff, 1, DrvPalRAM + 0x1000); - VezMapArea(0xa8000, 0xa8fff, 2, DrvPalRAM + 0x1000); - VezMapArea(0xc0000, 0xc0fff, 0, DrvSprRAM); - VezMapArea(0xc0000, 0xc0fff, 1, DrvSprRAM); - VezMapArea(0xc0000, 0xc0fff, 2, DrvSprRAM); - VezMapArea(0xd0000, 0xd3fff, 0, DrvVidRAM0); - VezMapArea(0xd0000, 0xd3fff, 1, DrvVidRAM0); - VezMapArea(0xd0000, 0xd3fff, 2, DrvVidRAM0); - VezMapArea(0xd4000, 0xd7fff, 0, DrvVidRAM1); - VezMapArea(0xd4000, 0xd7fff, 1, DrvVidRAM1); - VezMapArea(0xd4000, 0xd7fff, 2, DrvVidRAM1); - VezMapArea(0xe0000, 0xe3fff, 0, DrvV30RAM); - VezMapArea(0xe0000, 0xe3fff, 1, DrvV30RAM); - VezMapArea(0xe0000, 0xe3fff, 2, DrvV30RAM); - VezMapArea(0xff800, 0xfffff, 0, DrvV30ROM + 0x0ff800); - VezMapArea(0xff800, 0xfffff, 2, DrvV30ROM + 0x0ff800); - VezSetReadHandler(m72_main_read); - VezSetWriteHandler(rtype2_main_write); - VezSetReadPort(m72_main_read_port); - VezSetWritePort(m72_main_write_port); - VezClose(); -} - -static void majtitle_main_cpu_map() -{ - VezInit(0, V30_TYPE); - - VezOpen(0); - VezMapArea(0x00000, 0x7ffff, 0, DrvV30ROM + 0x000000); - VezMapArea(0x00000, 0x7ffff, 2, DrvV30ROM + 0x000000); - VezMapArea(0xa0000, 0xa07ff, 0, DrvRowScroll); - VezMapArea(0xa0000, 0xa07ff, 1, DrvRowScroll); - VezMapArea(0xa0000, 0xa07ff, 2, DrvRowScroll); - VezMapArea(0xa4000, 0xa4fff, 0, DrvPalRAM + 0x1000); -// VezMapArea(0xa4000, 0xa4fff, 1, DrvPalRAM + 0x1000); - VezMapArea(0xa4000, 0xa4fff, 2, DrvPalRAM + 0x1000); - VezMapArea(0xac000, 0xaffff, 0, DrvVidRAM0); - VezMapArea(0xac000, 0xaffff, 1, DrvVidRAM0); - VezMapArea(0xac000, 0xaffff, 2, DrvVidRAM0); - VezMapArea(0xb0000, 0xbffff, 0, DrvVidRAM1); - VezMapArea(0xb0000, 0xbffff, 1, DrvVidRAM1); - VezMapArea(0xb0000, 0xbffff, 2, DrvVidRAM1); - VezMapArea(0xc0000, 0xc07ff, 0, DrvSprRAM); - VezMapArea(0xc0000, 0xc07ff, 1, DrvSprRAM); - VezMapArea(0xc0000, 0xc07ff, 2, DrvSprRAM); - VezMapArea(0xc8000, 0xc87ff, 0, DrvSprRAM2); - VezMapArea(0xc8000, 0xc87ff, 1, DrvSprRAM2); - VezMapArea(0xc8000, 0xc87ff, 2, DrvSprRAM2); - VezMapArea(0xcc000, 0xccfff, 0, DrvPalRAM); -// VezMapArea(0xcc000, 0xccfff, 1, DrvPalRAM); - VezMapArea(0xcc000, 0xccfff, 2, DrvPalRAM); - VezMapArea(0xd0000, 0xd3fff, 0, DrvV30RAM); - VezMapArea(0xd0000, 0xd3fff, 1, DrvV30RAM); - VezMapArea(0xd0000, 0xd3fff, 2, DrvV30RAM); - VezMapArea(0xff800, 0xfffff, 0, DrvV30ROM + 0x0ff800); - VezMapArea(0xff800, 0xfffff, 2, DrvV30ROM + 0x0ff800); - VezSetReadHandler(m72_main_read); - VezSetWriteHandler(rtype2_main_write); - VezSetReadPort(m72_main_read_port); - VezSetWritePort(m72_main_write_port); - VezClose(); -} - -static void sound_ram_map() -{ - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0x0000, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0x0000, 0xffff, 2, DrvZ80RAM); - ZetSetOutHandler(m72_sound_write_port); - ZetSetInHandler(m72_sound_read_port); - ZetClose(); - - enable_z80_reset = 1; -} - -static void sound_rom_map() -{ - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80RAM); - ZetSetOutHandler(m72_sound_write_port); - ZetSetInHandler(m72_sound_read_port); - ZetClose(); - - enable_z80_reset = 0; -} - -static INT32 DrvGfxDecode(UINT8 *gfx, INT32 len, INT32 type) -{ - INT32 Planes[4] = { ((len / 4) * 8) * 3, ((len / 4) * 8) * 2, ((len / 4) * 8) * 1, ((len / 4) * 8) * 0 }; - INT32 XOffs[16] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87 }; - INT32 YOffs[16] = { 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, 0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, gfx, len); - - if (type) { - GfxDecode((len * 2) / ( 8 * 8), 4, 8, 8, Planes, XOffs, YOffs, 0x040, tmp, gfx); - } else { - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Planes, XOffs, YOffs, 0x100, tmp, gfx); - } - - BurnFree (tmp); - - return 0; -} - -static INT32 GetRoms(INT32 bLoad) -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *V30ROM = DrvV30ROM; - UINT8 *Z80ROM = DrvZ80ROM; - UINT8 *GFXROM0 = DrvGfxROM0; - UINT8 *GFXROM1 = DrvGfxROM1; - UINT8 *GFXROM2 = DrvGfxROM2; - UINT8 *GFXROM3 = DrvGfxROM3; - UINT8 *SNDROM = DrvSndROM; - INT32 pglen = 0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 15) == 1) { - if (bLoad) { - if (BurnLoadRom(V30ROM + 1, i + 0, 2)) return 1; - if (BurnLoadRom(V30ROM + 0, i + 1, 2)) return 1; - } - V30ROM += ri.nLen * 2; - i++; - continue; - } - - if ((ri.nType & 15) == 6) { - if (bLoad) if (BurnLoadRom(Z80ROM , i, 1)) return 1; - Z80ROM += ri.nLen; - continue; - } - - if ((ri.nType & 15) == 2) { - if (bLoad) if (BurnLoadRom(GFXROM0, i, 1)) return 1; - GFXROM0 += ri.nLen; - - if (pglen == 0x10000 && ri.nLen == 0x8000) { // rtype fix - if (bLoad) if (BurnLoadRom(GFXROM0, i, 1)) return 1; - GFXROM0 += ri.nLen; - } - pglen = ri.nLen; - continue; - } - - if ((ri.nType & 15) == 3) { - if (bLoad) if (BurnLoadRom(GFXROM1, i, 1)) return 1; - GFXROM1 += ri.nLen; - continue; - } - - if ((ri.nType & 15) == 4) { - if (bLoad) if (BurnLoadRom(GFXROM2, i, 1)) return 1; - GFXROM2 += ri.nLen; - continue; - } - - if ((ri.nType & 15) == 14) { - if (bLoad) if (BurnLoadRom(GFXROM3, i, 1)) return 1; - GFXROM3 += ri.nLen; - continue; - } - - if ((ri.nType & 15) == 5) { - if (bLoad) if (BurnLoadRom(SNDROM , i, 1)) return 1; - SNDROM += ri.nLen; - continue; - } - } - - if (bLoad) { - // copy irq vectors - memcpy (DrvV30ROM + 0xffff0, V30ROM - 0x10, 0x010); - - // mirror sound rom - INT32 sndlen = SNDROM - DrvSndROM; - if (sndlen < 0x40000 && sndlen) { - for (INT32 i = 0; i < 0x40000; i++) { - DrvSndROM[i] = DrvSndROM[i % sndlen]; - } - } - - DrvGfxDecode(DrvGfxROM0, graphics_length[0], 0); - DrvGfxDecode(DrvGfxROM1, graphics_length[1], 1); - - if (graphics_length[2] > 2) { - DrvGfxDecode(DrvGfxROM2, graphics_length[2], 1); - } else { - DrvGfxROM2 = DrvGfxROM1; - code_mask[2] = code_mask[1]; - } - - if (graphics_length[3] > 2) { - DrvGfxDecode(DrvGfxROM3, graphics_length[3], 0); - } else { - code_mask[3] = 0; - } - } else { - graphics_length[0] = GFXROM0 - DrvGfxROM0; - graphics_length[1] = GFXROM1 - DrvGfxROM1; - graphics_length[2] = GFXROM2 - DrvGfxROM2; - graphics_length[3] = GFXROM3 - DrvGfxROM3; - - for (INT32 i = 1, j = 0; j < 4; graphics_length[j] = i, j++, i = 1) { - while (i < graphics_length[j]) i <<= 1; - } - - code_mask[0] = ((graphics_length[0] * 2) - 1) / (16 * 16); - code_mask[1] = ((graphics_length[1] * 2) - 1) / (8 * 8); - code_mask[2] = ((graphics_length[2] * 2) - 1) / (8 * 8); - code_mask[3] = ((graphics_length[3] * 2) - 1) / (16 * 16); - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvV30ROM = Next; Next += 0x200000; - DrvZ80ROM = Next; Next += 0x010000; - DrvGfxROM0 = Next; Next += graphics_length[0] * 2; - DrvGfxROM1 = Next; Next += graphics_length[1] * 2; - DrvGfxROM2 = Next; Next += graphics_length[2] * 2; - DrvGfxROM3 = Next; Next += graphics_length[3] * 2; - DrvSndROM = Next; Next += 0x040000; - - RamPrioBitmap = Next; Next += nScreenWidth * nScreenHeight; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x010000; - DrvSprRAM = Next; Next += 0x001000; - DrvSprRAM2 = Next; Next += 0x000800; - DrvSprBuf = Next; Next += 0x001000; - DrvVidRAM0 = Next; Next += 0x004000; - DrvVidRAM1 = Next; Next += 0x010000; - DrvV30RAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x002000; - DrvProtRAM = Next; Next += 0x001000; - DrvRowScroll = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000004; // 1 - video_disable = Next; Next += 0x000004; // 1 - - scroll = Next; Next += 0x000008; - - RamEnd = Next; - - DrvPalette = (UINT32 *) Next; Next += 0x200 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - - -static INT32 DrvInit(void (*pCPUMapCallback)(), void (*pSNDMapCallback)(), INT32 (*pRomLoadCallback)(), INT32 z80_nmi, INT32 video_type) -{ - BurnSetRefreshRate(55.00); - - GenericTilesInit(); - - GetRoms(0); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (GetRoms(1)) return 1; - - if (pCPUMapCallback) { - pCPUMapCallback(); - } - - if (pSNDMapCallback) { - pSNDMapCallback(); - } - - if (pRomLoadCallback) { - if (pRomLoadCallback()) return 1; - } - - m72_irq_base = 0; // set by port 42. (programmable interrupt controller) - z80_nmi_enable = z80_nmi; - m72_video_type = video_type; - - switch (video_type) - { - case 0: // m72 - video_offsets[0] = video_offsets[1] = 0; - break; - - case 1: // rtype - case 3: // majtitle - video_offsets[0] = video_offsets[1] = -4; - break; - - case 2: // hharry, xmultipl - case 7: // cosmccop (layer offsets of type 2, flipxy of type 1) - video_offsets[0] = -4; - video_offsets[1] = -6; - if (video_type == 7) m72_video_type = 1; // cosmccop: diff flipx/y handling in draw_layer() - break; - - case 4: // poundfor - video_offsets[0] = video_offsets[1] = -6; - m72_video_type = 1; // rtype - break; - - case 5: // kengo - video_offsets[0] = -3; - video_offsets[1] = -6; - m72_video_type = 1; // rtype - break; - - case 6: // airduel m82 - video_offsets[0] = video_offsets[1] = -6; - m72_video_type = 1; // rtype - break; - } - - BurnYM2151Init(3579545); - YM2151SetIrqHandler(0, &m72YM2151IRQHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DACInit(0, 0, 1, m72SyncDAC); - DACSetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2151Exit(); - DACExit(); - - ZetExit(); - VezExit(); - - BurnFree(AllMem); - - m72_video_type = 0; - enable_z80_reset = 0; - z80_nmi_enable = 0; - m72_irq_base = 0; - Kengo = 0; - CosmicCop = 0; - Clock_16mhz = 0; - - m72_install_protection(NULL,NULL,NULL); - - video_offsets[0] = video_offsets[1] = 0; - - return 0; -} - -static void draw_layer(INT32 layer, INT32 forcelayer, INT32 type, INT32 start, INT32 finish) // bg = layer 1, fg = layer 0 -{ - INT32 codeand = code_mask[1+layer]; - UINT16 *vram = (UINT16*)(layer ? DrvVidRAM1 : DrvVidRAM0); - UINT8 *gfx = (layer) ? DrvGfxROM2 : DrvGfxROM1; - - // layer, prio, forcelayer - const UINT16 transmask[2][3][2] = { - { { 0xffff, 0x0001 }, { 0x00ff, 0xff01 }, { 0x0001, 0xffff } }, - { { 0xffff, 0x0000 }, { 0x00ff, 0xff00 }, { (type == 0) ? (const UINT16)0x0007 : (const UINT16)0x0001, (type == 0) ? (const UINT16)0xfff8 : (const UINT16)0xfffe } } - }; - - INT32 scrolly = scroll[layer * 4 + 0] | (scroll[layer * 4 + 1] << 8); - INT32 scrollx = scroll[layer * 4 + 2] | (scroll[layer * 4 + 3] << 8); - - scrolly = (scrolly + 128) & 0x1ff; - scrollx = (scrollx + 64 + video_offsets[layer]) & 0x1ff; - - UINT16 *xscroll = (UINT16*)DrvRowScroll; - - for (INT32 sy = start; sy < finish; sy++) - { - UINT16 *dest = pTransDraw + (sy * nScreenWidth); - UINT8 *pri = RamPrioBitmap + (sy * nScreenWidth); - - INT32 scrolly1 = (scrolly + sy) & 0x1ff; - INT32 romoff1 = (scrolly1 & 0x07) << 3; - - for (INT32 sx = 0; sx < nScreenWidth + 8; sx+=8) - { - INT32 flipy, flipx, prio, scrollx1, offs; - - if (majtitle_rowscroll_enable && type == 3 && layer == 1) { - scrollx1 = 256 + BURN_ENDIAN_SWAP_INT16(xscroll[scrolly1]) + sx + 64 + video_offsets[1]; - } else { - scrollx1 = scrollx + sx; - if (type == 3 && layer == 1) scrollx1 += 256; - } - - if (type == 3 && layer == 1) { - scrollx1 &= 0x3ff; - offs = ((scrolly1 >> 3) << 8) | (scrollx1 >> 3); - } else { - scrollx1 &= 0x1ff; - offs = ((scrolly1 >> 3) << 6) | (scrollx1 >> 3); - } - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 0]); - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 1]); - - if (type == 1 || type == 3) { - flipy = color & 0x0040; - flipx = color & 0x0020; - prio = (color & 0x0100) ? 2 : (color & 0x80) ? 1 : 0; - } else { - flipy = code & 0x8000; - flipx = code & 0x4000; - prio = (color & 0x80) ? 2 : ((color & 0x40) ? 1 : 0); - } - - INT32 mask = transmask[layer][prio][forcelayer]; - - code &= codeand; - color = ((color & 0x000f) << 4) | 0x100; - prio = 1 << prio; - - { - INT32 scrollx0 = scrollx1 & 0x07; - INT32 x_xor = 0; - INT32 romoff = romoff1; - if (flipy) romoff ^= 0x38; - if (flipx) x_xor = 7; - - UINT8 *rom = gfx + (code * 0x40) + romoff; - - INT32 xx = sx - scrollx0; - - for (INT32 x = 0; x < 8; x++, xx++) { - if (xx < 0 || xx >= nScreenWidth) continue; - - INT32 pxl = rom[x ^ x_xor]; - if (mask & (1 << pxl)) continue; - - dest[xx] = pxl | color; - pri[xx] = prio; - } - } - } - } -} - -static void draw_sprites() -{ - UINT16 *sprram = (UINT16*)DrvSprBuf; - - for (INT32 offs = 0; offs < 0x400/2;) - { - INT32 sx = -256+(BURN_ENDIAN_SWAP_INT16(sprram[offs+3]) & 0x3ff); - INT32 attr = BURN_ENDIAN_SWAP_INT16(sprram[offs+2]); - INT32 code = BURN_ENDIAN_SWAP_INT16(sprram[offs+1]); - INT32 sy = 384-(BURN_ENDIAN_SWAP_INT16(sprram[offs+0]) & 0x1ff); - - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x0800; - INT32 flipy = attr & 0x0400; - - INT32 w = 1 << ((attr & 0xc000) >> 14); - INT32 h = 1 << ((attr & 0x3000) >> 12); - sy -= 16 * h; - - sx -= 64; // ? -#if 0 - if (*flipscreen) - { - sx = 512 - 16*w - sx; - sy = 284 - 16*h - sy; - flipx = !flipx; - flipy = !flipy; - } -#endif - - for (INT32 x = 0;x < w;x++) - { - for (INT32 y = 0;y < h;y++) - { - INT32 c = code; - - if (flipx) c += 8*(w-1-x); - else c += 8*x; - if (flipy) c += h-1-y; - else c += y; - - c &= code_mask[0]; - - INT32 xx = sx + 16 * x; - INT32 yy = sy + 16 * y; - - if (xx < -15 || yy < -15 || xx >= nScreenWidth || yy >= nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, c, xx, yy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, c, xx, yy, color, 4, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, c, xx, yy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, c, xx, yy, color, 4, 0, 0, DrvGfxROM0); - } - } - } - } - - offs += w*4; - } -} - -static void majtitle_draw_sprites() -{ - UINT16 *spriteram16_2 = (UINT16*)DrvSprRAM2; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 code,color,sx,sy,flipx,flipy,w,h,x,y; - - code = BURN_ENDIAN_SWAP_INT16(spriteram16_2[offs+1]); - color = BURN_ENDIAN_SWAP_INT16(spriteram16_2[offs+2]) & 0x0f; - sx = -256+(BURN_ENDIAN_SWAP_INT16(spriteram16_2[offs+3]) & 0x3ff); - sy = 384-(BURN_ENDIAN_SWAP_INT16(spriteram16_2[offs+0]) & 0x1ff); - flipx = BURN_ENDIAN_SWAP_INT16(spriteram16_2[offs+2]) & 0x0800; - flipy = BURN_ENDIAN_SWAP_INT16(spriteram16_2[offs+2]) & 0x0400; - - w = 1;// << ((spriteram16_2[offs+2] & 0xc000) >> 14); - h = 1 << ((BURN_ENDIAN_SWAP_INT16(spriteram16_2[offs+2]) & 0x3000) >> 12); - sy -= 16 * h; - - sx -= 64; // ? -#if 0 - if (flip_screen_get(machine)) - { - sx = 512 - 16*w - sx; - sy = 256 - 16*h - sy; - flipx = !flipx; - flipy = !flipy; - } -#endif - - for (x = 0;x < w;x++) - { - for (y = 0;y < h;y++) - { - INT32 c = code; - - if (flipx) c += 8*(w-1-x); - else c += 8*x; - if (flipy) c += h-1-y; - else c += y; - - c &= code_mask[3]; - - INT32 xx = sx + 16 * x; - INT32 yy = sy + 16 * y; - - if (xx < -15 || yy < -15 || xx >= nScreenWidth || yy >= nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, c, xx, yy, color, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, c, xx, yy, color, 4, 0, 0, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, c, xx, yy, color, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, c, xx, yy, color, 4, 0, 0, DrvGfxROM3); - } - } - } - } - } -} - -static void dodrawline(INT32 start, INT32 finish) -{ - if (*video_disable) return; - - if (nBurnLayer & 1) draw_layer(1, 1, m72_video_type, start, finish); - if (nBurnLayer & 2) draw_layer(0, 1, m72_video_type, start, finish); - - GenericTilesSetClip(0, -1, start, finish); - if (nSpriteEnable & 1) { - if (m72_video_type == 3) majtitle_draw_sprites(); - draw_sprites(); - } - GenericTilesClearClip(); - - if (nBurnLayer & 4) draw_layer(1, 0, m72_video_type, start, finish); - if (nBurnLayer & 8) draw_layer(0, 0, m72_video_type, start, finish); -} - -static inline void DrvDrawInitFrame() -{ - BurnTransferClear(); -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x200; i++) { - palette_write((i & 0xff) * 2, i >> 8); - } - DrvRecalc = 0; - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void compile_inputs() -{ - memset (DrvInputs, 0xff, 5); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } -} - -static INT32 nPreviousLine = 0; - -static void scanline_interrupts(INT32 scanline) -{ - if (scanline == (irq_raster_position - 128) && scanline < 256) { - if (nPreviousLine <= scanline && scanline < nScreenHeight) { - dodrawline(nPreviousLine, scanline+1); - nPreviousLine = scanline + 1; - } - if (Kengo) - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP2, 0xff, CPU_IRQSTATUS_AUTO); - else - VezSetIRQLineAndVector(0, (m72_irq_base + 8)/4, CPU_IRQSTATUS_AUTO); - } - else if (scanline == 255) // vblank - { - if (nPreviousLine < nScreenHeight) { - dodrawline(nPreviousLine, nScreenHeight); - nPreviousLine = 0; - } - if (Kengo) - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP0, 0xff, CPU_IRQSTATUS_AUTO); - else - VezSetIRQLineAndVector(0, (m72_irq_base + 0)/4, CPU_IRQSTATUS_AUTO); - } - - if (nPreviousLine >= nScreenHeight) nPreviousLine = 0; -} - -static INT32 DrvFrame() -{ - INT32 nSoundBufferPos = 0; - - if (DrvReset) { - DrvDoReset(); - } - - VezNewFrame(); - ZetNewFrame(); - - compile_inputs(); - - INT32 multiplier = 3; - INT32 nInterleave = 256 * multiplier; - - if (Clock_16mhz) // Ken-go, Cosmic Cop - nCyclesTotal[0] = (INT32)((INT64)(16000000 / 55) * nBurnCPUSpeedAdjust / 0x0100); - else - nCyclesTotal[0] = (INT32)((INT64)(8000000 / 55) * nBurnCPUSpeedAdjust / 0x0100); - nCyclesTotal[1] = (INT32)((INT64)(3579545 / 55) * nBurnCPUSpeedAdjust / 0x0100); - nCyclesDone[0] = nCyclesDone[1] = 0; - - if (pBurnDraw) { - DrvDrawInitFrame(); - } - - VezOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCurrentCycles = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += VezRun(nCurrentCycles); - - if ((i%multiplier)==0) - scanline_interrupts(i/multiplier); - - if (z80_reset == 0) { - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - if (i%multiplier==0 && i/multiplier & 1) { - if (z80_nmi_enable == Z80_FAKE_NMI) { - if (DrvSndROM[sample_address]) { - DACSignedWrite(0, DrvSndROM[sample_address]); - sample_address = (sample_address + 1) & 0x3ffff; - } else { - DACWrite(0, 0); // Clear DAC output buffer at end of sample - fixes distortion in Air Duel & second-to-last level of Mr. Heli - } - - } else if (z80_nmi_enable == Z80_REAL_NMI) { - ZetNmi(); - } - } - } else { - ZetIdle(nCyclesTotal[1] / nInterleave); - } - - if ((i%multiplier)==0) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / multiplier); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - BurnYM2151Render(pSoundBuf, nSegmentLength); - - nSoundBufferPos += nSegmentLength; - } - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - VezClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029705; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = MemEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - BurnYM2151Scan(nAction); - DACScan(nAction, pnMin); - VezScan(nAction); - - SCAN_VAR(irq_raster_position); - SCAN_VAR(m72_irq_base); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); // Kick-start the ym2151 after state load. - m72YM2151IRQHandler(1); - ZetClose(); - } - - return 0; -} - - - -// R-Type (World) - -static struct BurnRomInfo rtypeRomDesc[] = { - { "rt_r-h0-b.1b", 0x10000, 0x591c7754, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rt_r-l0-b.3b", 0x10000, 0xa1928df0, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "rt_r-h1-b.1c", 0x10000, 0xa9d71eca, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "rt_r-l1-b.3c", 0x10000, 0x0df3573d, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "rt_r-00.1h", 0x10000, 0xdad53bc0, 0x02 | BRF_GRA }, // 4 Sprites - { "rt_r-01.1j", 0x08000, 0x5e441e7f, 0x02 | BRF_GRA }, // 5 - { "rt_r-10.1k", 0x10000, 0xd6a66298, 0x02 | BRF_GRA }, // 6 - { "rt_r-11.1l", 0x08000, 0x791df4f8, 0x02 | BRF_GRA }, // 7 - { "rt_r-20.3h", 0x10000, 0xfc247c8a, 0x02 | BRF_GRA }, // 8 - { "rt_r-21.3j", 0x08000, 0xed793841, 0x02 | BRF_GRA }, // 9 - { "rt_r-30.3k", 0x10000, 0xeb02a1cb, 0x02 | BRF_GRA }, // 10 - { "rt_r-31.3l", 0x08000, 0x8558355d, 0x02 | BRF_GRA }, // 11 - - { "rt_b-a0.3c", 0x08000, 0x4e212fb0, 0x03 | BRF_GRA }, // 12 Foreground Tiles - { "rt_b-a1.3d", 0x08000, 0x8a65bdff, 0x03 | BRF_GRA }, // 13 - { "rt_b-a2.3a", 0x08000, 0x5a4ae5b9, 0x03 | BRF_GRA }, // 14 - { "rt_b-a3.3e", 0x08000, 0x73327606, 0x03 | BRF_GRA }, // 15 - - { "rt_b-b0.3j", 0x08000, 0xa7b17491, 0x04 | BRF_GRA }, // 16 Background Tiles - { "rt_b-b1.3k", 0x08000, 0xb9709686, 0x04 | BRF_GRA }, // 17 - { "rt_b-b2.3h", 0x08000, 0x433b229a, 0x04 | BRF_GRA }, // 18 - { "rt_b-b3.3f", 0x08000, 0xad89b072, 0x04 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(rtype) -STD_ROM_FN(rtype) - -static INT32 rtypeInit() -{ - return DrvInit(common_040000_040000, sound_ram_map, NULL, Z80_NO_NMI, 0); -} - -struct BurnDriver BurnDrvRtype = { - "rtype", NULL, NULL, NULL, "1987", - "R-Type (World)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, rtypeRomInfo, rtypeRomName, NULL, NULL, CommonInputInfo, RtypeDIPInfo, - rtypeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// R-Type (Japan) - -static struct BurnRomInfo rtypejRomDesc[] = { - { "rt_r-h0-.1b", 0x10000, 0xc2940df2, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rt_r-l0-.3b", 0x10000, 0x858cc0f6, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "rt_r-h1-.1c", 0x10000, 0x5bcededa, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "rt_r-l1-.3c", 0x10000, 0x4821141c, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "rt_r-00.1h", 0x10000, 0xdad53bc0, 0x02 | BRF_GRA }, // 4 Sprites - { "rt_r-01.1j", 0x08000, 0x5e441e7f, 0x02 | BRF_GRA }, // 5 - { "rt_r-10.1k", 0x10000, 0xd6a66298, 0x02 | BRF_GRA }, // 6 - { "rt_r-11.1l", 0x08000, 0x791df4f8, 0x02 | BRF_GRA }, // 7 - { "rt_r-20.3h", 0x10000, 0xfc247c8a, 0x02 | BRF_GRA }, // 8 - { "rt_r-21.3j", 0x08000, 0xed793841, 0x02 | BRF_GRA }, // 9 - { "rt_r-30.3k", 0x10000, 0xeb02a1cb, 0x02 | BRF_GRA }, // 10 - { "rt_r-31.3l", 0x08000, 0x8558355d, 0x02 | BRF_GRA }, // 11 - - { "rt_b-a0.3c", 0x08000, 0x4e212fb0, 0x03 | BRF_GRA }, // 12 Foreground Tiles - { "rt_b-a1.3d", 0x08000, 0x8a65bdff, 0x03 | BRF_GRA }, // 13 - { "rt_b-a2.3a", 0x08000, 0x5a4ae5b9, 0x03 | BRF_GRA }, // 14 - { "rt_b-a3.3e", 0x08000, 0x73327606, 0x03 | BRF_GRA }, // 15 - - { "rt_b-b0.3j", 0x08000, 0xa7b17491, 0x04 | BRF_GRA }, // 16 Background Tiles - { "rt_b-b1.3k", 0x08000, 0xb9709686, 0x04 | BRF_GRA }, // 17 - { "rt_b-b2.3h", 0x08000, 0x433b229a, 0x04 | BRF_GRA }, // 18 - { "rt_b-b3.3f", 0x08000, 0xad89b072, 0x04 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(rtypej) -STD_ROM_FN(rtypej) - -struct BurnDriver BurnDrvRtypej = { - "rtypej", "rtype", NULL, NULL, "1987", - "R-Type (Japan)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, rtypejRomInfo, rtypejRomName, NULL, NULL, CommonInputInfo, RtypeDIPInfo, - rtypeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// R-Type (Japan prototype) - -static struct BurnRomInfo rtypejpRomDesc[] = { - { "db_b1.bin", 0x10000, 0xc1865141, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "db_a1.bin", 0x10000, 0x5ad2bd90, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "db_b2.bin", 0x10000, 0xb4f6407e, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "db_a2.bin", 0x10000, 0x6098d86f, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "rt_r-00.1h", 0x10000, 0xdad53bc0, 0x02 | BRF_GRA }, // 4 Sprites - { "rt_r-01.1j", 0x08000, 0x5e441e7f, 0x02 | BRF_GRA }, // 5 - { "rt_r-10.1k", 0x10000, 0xd6a66298, 0x02 | BRF_GRA }, // 6 - { "rt_r-11.1l", 0x08000, 0x791df4f8, 0x02 | BRF_GRA }, // 7 - { "rt_r-20.3h", 0x10000, 0xfc247c8a, 0x02 | BRF_GRA }, // 8 - { "rt_r-21.3j", 0x08000, 0xed793841, 0x02 | BRF_GRA }, // 9 - { "rt_r-30.3k", 0x10000, 0xeb02a1cb, 0x02 | BRF_GRA }, // 10 - { "rt_r-31.3l", 0x08000, 0x8558355d, 0x02 | BRF_GRA }, // 11 - - { "rt_b-a0.3c", 0x08000, 0x4e212fb0, 0x03 | BRF_GRA }, // 12 Foreground Tiles - { "rt_b-a1.3d", 0x08000, 0x8a65bdff, 0x03 | BRF_GRA }, // 13 - { "rt_b-a2.3a", 0x08000, 0x5a4ae5b9, 0x03 | BRF_GRA }, // 14 - { "rt_b-a3.3e", 0x08000, 0x73327606, 0x03 | BRF_GRA }, // 15 - - { "rt_b-b0.3j", 0x08000, 0xa7b17491, 0x04 | BRF_GRA }, // 16 Background Tiles - { "rt_b-b1.3k", 0x08000, 0xb9709686, 0x04 | BRF_GRA }, // 17 - { "rt_b-b2.3h", 0x08000, 0x433b229a, 0x04 | BRF_GRA }, // 18 - { "rt_b-b3.3f", 0x08000, 0xad89b072, 0x04 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(rtypejp) -STD_ROM_FN(rtypejp) - -struct BurnDriver BurnDrvRtypejp = { - "rtypejp", "rtype", NULL, NULL, "1987", - "R-Type (Japan prototype)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, rtypejpRomInfo, rtypejpRomName, NULL, NULL, CommonInputInfo, RtypepDIPInfo, - rtypeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// R-Type (US) - -static struct BurnRomInfo rtypeuRomDesc[] = { - { "rt_r-h0-a.1b", 0x10000, 0x36008a4e, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rt_r-l0-a.3b", 0x10000, 0x4aaa668e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "rt_r-h1-a.1c", 0x10000, 0x7ebb2a53, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "rt_r-l1-a.3c", 0x10000, 0xc28b103b, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "rt_r-00.1h", 0x10000, 0xdad53bc0, 0x02 | BRF_GRA }, // 4 Sprites - { "rt_r-01.1j", 0x08000, 0x5e441e7f, 0x02 | BRF_GRA }, // 5 - { "rt_r-10.1k", 0x10000, 0xd6a66298, 0x02 | BRF_GRA }, // 6 - { "rt_r-11.1l", 0x08000, 0x791df4f8, 0x02 | BRF_GRA }, // 7 - { "rt_r-20.3h", 0x10000, 0xfc247c8a, 0x02 | BRF_GRA }, // 8 - { "rt_r-21.3j", 0x08000, 0xed793841, 0x02 | BRF_GRA }, // 9 - { "rt_r-30.3k", 0x10000, 0xeb02a1cb, 0x02 | BRF_GRA }, // 10 - { "rt_r-31.3l", 0x08000, 0x8558355d, 0x02 | BRF_GRA }, // 11 - - { "rt_b-a0.3c", 0x08000, 0x4e212fb0, 0x03 | BRF_GRA }, // 12 Foreground Tiles - { "rt_b-a1.3d", 0x08000, 0x8a65bdff, 0x03 | BRF_GRA }, // 13 - { "rt_b-a2.3a", 0x08000, 0x5a4ae5b9, 0x03 | BRF_GRA }, // 14 - { "rt_b-a3.3e", 0x08000, 0x73327606, 0x03 | BRF_GRA }, // 15 - - { "rt_b-b0.3j", 0x08000, 0xa7b17491, 0x04 | BRF_GRA }, // 16 Background Tiles - { "rt_b-b1.3k", 0x08000, 0xb9709686, 0x04 | BRF_GRA }, // 17 - { "rt_b-b2.3h", 0x08000, 0x433b229a, 0x04 | BRF_GRA }, // 18 - { "rt_b-b3.3f", 0x08000, 0xad89b072, 0x04 | BRF_GRA }, // 19 - - { "m72_a-8l-.ic66", 0x00100, 0xb460c438, 0x00 | BRF_OPT }, // 20 Proms - { "m72_a-9l-.ic75", 0x00100, 0xa4f2c4bc, 0x00 | BRF_OPT }, // 21 - - { "m72_r-3a-.bin", 0x00001, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 22 PLDs - { "m72_a-3d-.bin", 0x00001, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 23 - { "m72_a-4d-.bin", 0x00001, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 24 -}; - -STD_ROM_PICK(rtypeu) -STD_ROM_FN(rtypeu) - -struct BurnDriver BurnDrvRtypeu = { - "rtypeu", "rtype", NULL, NULL, "1987", - "R-Type (US)\0", NULL, "Irem (Nintendo of America license)", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, rtypeuRomInfo, rtypeuRomName, NULL, NULL, CommonInputInfo, RtypeDIPInfo, - rtypeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// R-Type (World bootleg) - -static struct BurnRomInfo rtypebRomDesc[] = { - { "7.512", 0x10000, 0xeacc8024, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "1.512", 0x10000, 0x2e5fe27b, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "8.512", 0x10000, 0x22cc4950, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "2.512", 0x10000, 0xada7b90e, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "rt_r-00.1h", 0x10000, 0xdad53bc0, 0x02 | BRF_GRA }, // 4 Sprites - { "rt_r-01.1j", 0x08000, 0x5e441e7f, 0x02 | BRF_GRA }, // 5 - { "rt_r-10.1k", 0x10000, 0xd6a66298, 0x02 | BRF_GRA }, // 6 - { "rt_r-11.1l", 0x08000, 0x791df4f8, 0x02 | BRF_GRA }, // 7 - { "rt_r-20.3h", 0x10000, 0xfc247c8a, 0x02 | BRF_GRA }, // 8 - { "rt_r-21.3j", 0x08000, 0xed793841, 0x02 | BRF_GRA }, // 9 - { "rt_r-30.3k", 0x10000, 0xeb02a1cb, 0x02 | BRF_GRA }, // 10 - { "rt_r-31.3l", 0x08000, 0x8558355d, 0x02 | BRF_GRA }, // 11 - - { "rt_b-a0.3c", 0x08000, 0x4e212fb0, 0x03 | BRF_GRA }, // 12 Foreground Tiles - { "rt_b-a1.3d", 0x08000, 0x8a65bdff, 0x03 | BRF_GRA }, // 13 - { "rt_b-a2.3a", 0x08000, 0x5a4ae5b9, 0x03 | BRF_GRA }, // 14 - { "rt_b-a3.3e", 0x08000, 0x73327606, 0x03 | BRF_GRA }, // 15 - - { "rt_b-b0.3j", 0x08000, 0xa7b17491, 0x04 | BRF_GRA }, // 16 Background Tiles - { "rt_b-b1.3k", 0x08000, 0xb9709686, 0x04 | BRF_GRA }, // 17 - { "rt_b-b2.3h", 0x08000, 0x433b229a, 0x04 | BRF_GRA }, // 18 - { "rt_b-b3.3f", 0x08000, 0xad89b072, 0x04 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(rtypeb) -STD_ROM_FN(rtypeb) - -struct BurnDriver BurnDrvRtypeb = { - "rtypeb", "rtype", NULL, NULL, "1987", - "R-Type (World bootleg)\0", NULL, "bootleg", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, rtypebRomInfo, rtypebRomName, NULL, NULL, CommonInputInfo, RtypeDIPInfo, - rtypeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// X Multiply (World, M81) - -static struct BurnRomInfo xmultiplRomDesc[] = { - { "xm-a-h1-.ic58", 0x20000, 0x449048cf, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "xm-a-l1-.ic67", 0x20000, 0x26ce39b0, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "xm-a-h0-.ic59", 0x10000, 0x509bc970, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "xm-a-l0-.ic68", 0x10000, 0x490a9ebc, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "xm-a-sp-.ic14", 0x10000, 0x006eef56, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "t44.00", 0x20000, 0xdb45186e, 0x02 | BRF_GRA }, // 5 Sprites - { "t45.01", 0x20000, 0x4d0764d4, 0x02 | BRF_GRA }, // 6 - { "t46.10", 0x20000, 0xf0c465a4, 0x02 | BRF_GRA }, // 7 - { "t47.11", 0x20000, 0x1263b24b, 0x02 | BRF_GRA }, // 8 - { "t48.20", 0x20000, 0x4129944f, 0x02 | BRF_GRA }, // 9 - { "t49.21", 0x20000, 0x2346e6f9, 0x02 | BRF_GRA }, // 10 - { "t50.30", 0x20000, 0xe322543e, 0x02 | BRF_GRA }, // 11 - { "t51.31", 0x20000, 0x229bf7b1, 0x02 | BRF_GRA }, // 12 - - { "t53.a0", 0x20000, 0x1a082494, 0x03 | BRF_GRA }, // 13 Foreground Tiles - { "t54.a1", 0x20000, 0x076c16c5, 0x03 | BRF_GRA }, // 14 - { "t55.a2", 0x20000, 0x25d877a5, 0x03 | BRF_GRA }, // 15 - { "t56.a3", 0x20000, 0x5b1213f5, 0x03 | BRF_GRA }, // 16 - - { "t57.b0", 0x20000, 0x0a84e0c7, 0x04 | BRF_GRA }, // 17 Background Tiles - { "t58.b1", 0x20000, 0xa874121d, 0x04 | BRF_GRA }, // 18 - { "t59.b2", 0x20000, 0x69deb990, 0x04 | BRF_GRA }, // 19 - { "t60.b3", 0x20000, 0x14c69f99, 0x04 | BRF_GRA }, // 20 - - { "t52.v0", 0x20000, 0x2db1bd80, 0x05 | BRF_SND }, // 21 DAC Samples - - { "m81_a-9l-.ic72", 0x00100, 0xb460c438, 0x00 | BRF_OPT }, // 22 Proms - { "m81_a-9p-.ic74", 0x00100, 0xa4f2c4bc, 0x00 | BRF_OPT }, // 23 -}; - -STD_ROM_PICK(xmultipl) -STD_ROM_FN(xmultipl) - -static INT32 xmultiplInit() -{ - return DrvInit(common_080000_09c000, sound_rom_map, NULL, Z80_REAL_NMI, 2); -} - -struct BurnDriver BurnDrvXmultipl = { - "xmultipl", NULL, NULL, NULL, "1989", - "X Multiply (World, M81)\0", NULL, "Irem", "M81", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, xmultiplRomInfo, xmultiplRomName, NULL, NULL, CommonInputInfo, XmultiplDIPInfo, - xmultiplInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// X Multiply (Japan, M72) - -static struct BurnRomInfo xmultiplm72RomDesc[] = { - { "ch3.h3", 0x20000, 0x20685021, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "cl3.l3", 0x20000, 0x93fdd200, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ch0.h0", 0x10000, 0x9438dd8a, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "cl0.l0", 0x10000, 0x06a9e213, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "t44.00", 0x20000, 0xdb45186e, 0x02 | BRF_GRA }, // 4 Sprites - { "t45.01", 0x20000, 0x4d0764d4, 0x02 | BRF_GRA }, // 5 - { "t46.10", 0x20000, 0xf0c465a4, 0x02 | BRF_GRA }, // 6 - { "t47.11", 0x20000, 0x1263b24b, 0x02 | BRF_GRA }, // 7 - { "t48.20", 0x20000, 0x4129944f, 0x02 | BRF_GRA }, // 8 - { "t49.21", 0x20000, 0x2346e6f9, 0x02 | BRF_GRA }, // 9 - { "t50.30", 0x20000, 0xe322543e, 0x02 | BRF_GRA }, // 10 - { "t51.31", 0x20000, 0x229bf7b1, 0x02 | BRF_GRA }, // 11 - - { "t53.a0", 0x20000, 0x1a082494, 0x03 | BRF_GRA }, // 12 Foreground Tiles - { "t54.a1", 0x20000, 0x076c16c5, 0x03 | BRF_GRA }, // 13 - { "t55.a2", 0x20000, 0x25d877a5, 0x03 | BRF_GRA }, // 14 - { "t56.a3", 0x20000, 0x5b1213f5, 0x03 | BRF_GRA }, // 15 - - { "t57.b0", 0x20000, 0x0a84e0c7, 0x04 | BRF_GRA }, // 16 Background Tiles - { "t58.b1", 0x20000, 0xa874121d, 0x04 | BRF_GRA }, // 17 - { "t59.b2", 0x20000, 0x69deb990, 0x04 | BRF_GRA }, // 18 - { "t60.b3", 0x20000, 0x14c69f99, 0x04 | BRF_GRA }, // 19 - - { "t52.v0", 0x20000, 0x2db1bd80, 0x05 | BRF_SND }, // 20 DAC Samples - - { "xmultipl_i8751h.bin",0x01000, 0xc8ceb3cd, 0x00 | BRF_OPT }, // 21 i8751 Code -}; - -STD_ROM_PICK(xmultiplm72) -STD_ROM_FN(xmultiplm72) - -static INT32 xmultiplm72Init() -{ - install_protection(xmultiplm72); - - return DrvInit(common_080000_080000, sound_ram_map, NULL, Z80_REAL_NMI, 0); -} - -struct BurnDriver BurnDrvXmultiplm72 = { - "xmultiplm72", "xmultipl", NULL, NULL, "1989", - "X Multiply (Japan, M72)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, xmultiplm72RomInfo, xmultiplm72RomName, NULL, NULL, CommonInputInfo, XmultiplDIPInfo, - xmultiplm72Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Dragon Breed (M81 PCB version) - -static struct BurnRomInfo dbreedRomDesc[] = { - { "db-a-h0-.59", 0x20000, 0xe1177267, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "db-a-l0-.68", 0x20000, 0xd82b167e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "db-a-sp-.14", 0x10000, 0x54a61560, 0x06 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "db_k800m.00", 0x20000, 0xc027a8cf, 0x02 | BRF_GRA }, // 3 Sprites - { "db_k801m.10", 0x20000, 0x093faf33, 0x02 | BRF_GRA }, // 4 - { "db_k802m.20", 0x20000, 0x055b4c59, 0x02 | BRF_GRA }, // 5 - { "db_k803m.30", 0x20000, 0x8ed63922, 0x02 | BRF_GRA }, // 6 - - { "db_k804m.a0", 0x20000, 0x4c83e92e, 0x03 | BRF_GRA }, // 7 Foreground & Background Tiles - { "db_k805m.a1", 0x20000, 0x835ef268, 0x03 | BRF_GRA }, // 8 - { "db_k806m.a2", 0x20000, 0x5117f114, 0x03 | BRF_GRA }, // 9 - { "db_k807m.a3", 0x20000, 0x8eb0c978, 0x03 | BRF_GRA }, // 10 - - { "db_a-v0.rom", 0x20000, 0x312f7282, 0x05 | BRF_SND }, // 11 DAC Samples -}; - -STD_ROM_PICK(dbreed) -STD_ROM_FN(dbreed) - -static INT32 dbreedRomLoadCallback() -{ - memcpy (DrvV30ROM + 0x60000, DrvV30ROM + 0x20000, 0x20000); - - return 0; -} - -static INT32 dbreedInit() -{ - return DrvInit(common_080000_088000, sound_rom_map, dbreedRomLoadCallback, Z80_REAL_NMI, 2); -} - -struct BurnDriver BurnDrvDbreed = { - "dbreed", NULL, NULL, NULL, "1989", - "Dragon Breed (M81 PCB version)\0", NULL, "Irem", "M81", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, dbreedRomInfo, dbreedRomName, NULL, NULL, CommonInputInfo, DbreedDIPInfo, - dbreedInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Dragon Breed (M72 PCB version) - -static struct BurnRomInfo dbreedm72RomDesc[] = { - { "db_c-h3.rom", 0x20000, 0x4bf3063c, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "db_c-l3.rom", 0x20000, 0xe4b89b79, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "db_c-h0.rom", 0x10000, 0x5aa79fb2, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "db_c-l0.rom", 0x10000, 0xed0f5e06, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "db_k800m.00", 0x20000, 0xc027a8cf, 0x02 | BRF_GRA }, // 4 Sprites - { "db_k801m.10", 0x20000, 0x093faf33, 0x02 | BRF_GRA }, // 5 - { "db_k802m.20", 0x20000, 0x055b4c59, 0x02 | BRF_GRA }, // 6 - { "db_k803m.30", 0x20000, 0x8ed63922, 0x02 | BRF_GRA }, // 7 - - { "db_k804m.a0", 0x20000, 0x4c83e92e, 0x03 | BRF_GRA }, // 8 Foreground Tiles - { "db_k805m.a1", 0x20000, 0x835ef268, 0x03 | BRF_GRA }, // 9 - { "db_k806m.a2", 0x20000, 0x5117f114, 0x03 | BRF_GRA }, // 10 - { "db_k807m.a3", 0x20000, 0x8eb0c978, 0x03 | BRF_GRA }, // 11 - - { "db_k804m.b0", 0x20000, 0x4c83e92e, 0x04 | BRF_GRA }, // 12 Background Tiles - { "db_k805m.b1", 0x20000, 0x835ef268, 0x04 | BRF_GRA }, // 13 - { "db_k806m.b2", 0x20000, 0x5117f114, 0x04 | BRF_GRA }, // 14 - { "db_k807m.b3", 0x20000, 0x8eb0c978, 0x04 | BRF_GRA }, // 15 - - { "db_c-v0.rom", 0x20000, 0x312f7282, 0x05 | BRF_SND }, // 16 DAC Samples - - { "dbreedm72_i8751.mcu",0x10000, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 17 i8751 Code -}; - -STD_ROM_PICK(dbreedm72) -STD_ROM_FN(dbreedm72) - -static INT32 dbreedm72RomLoadCallback() -{ - memmove(DrvV30ROM + 0x60000, DrvV30ROM + 0x40000, 0x20000); - - return 0; -} - -static INT32 dbreedm72Init() -{ - install_protection(dbreedm72); - - return DrvInit(common_080000_090000, sound_ram_map, dbreedm72RomLoadCallback, Z80_REAL_NMI, 0); -} - -struct BurnDriver BurnDrvDbreedm72 = { - "dbreedm72", "dbreed", NULL, NULL, "1989", - "Dragon Breed (M72 PCB version)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, dbreedm72RomInfo, dbreedm72RomName, NULL, NULL, CommonInputInfo, DbreedDIPInfo, - dbreedm72Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Battle Chopper - -static struct BurnRomInfo bchopperRomDesc[] = { - { "c-h0-b.rom", 0x10000, 0xf2feab16, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "c-l0-b.rom", 0x10000, 0x9f887096, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "c-h1-b.rom", 0x10000, 0xa995d64f, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "c-l1-b.rom", 0x10000, 0x41dda999, 0x01 | BRF_PRG | BRF_ESS }, // 3 - { "c-h3-b.rom", 0x10000, 0xab9451ca, 0x01 | BRF_PRG | BRF_ESS }, // 4 - { "c-l3-b.rom", 0x10000, 0x11562221, 0x01 | BRF_PRG | BRF_ESS }, // 5 - - { "c-00-a.rom", 0x10000, 0xf6e6e660, 0x02 | BRF_GRA }, // 6 Sprites - { "c-01-b.rom", 0x10000, 0x708cdd37, 0x02 | BRF_GRA }, // 7 - { "c-10-a.rom", 0x10000, 0x292c8520, 0x02 | BRF_GRA }, // 8 - { "c-11-b.rom", 0x10000, 0x20904cf3, 0x02 | BRF_GRA }, // 9 - { "c-20-a.rom", 0x10000, 0x1ab50c23, 0x02 | BRF_GRA }, // 10 - { "c-21-b.rom", 0x10000, 0xc823d34c, 0x02 | BRF_GRA }, // 11 - { "c-30-a.rom", 0x10000, 0x11f6c56b, 0x02 | BRF_GRA }, // 12 - { "c-31-b.rom", 0x10000, 0x23134ec5, 0x02 | BRF_GRA }, // 13 - - { "b-a0-b.rom", 0x10000, 0xe46ed7bf, 0x03 | BRF_GRA }, // 14 Foreground Tiles - { "b-a1-b.rom", 0x10000, 0x590605ff, 0x03 | BRF_GRA }, // 15 - { "b-a2-b.rom", 0x10000, 0xf8158226, 0x03 | BRF_GRA }, // 16 - { "b-a3-b.rom", 0x10000, 0x0f07b9b7, 0x03 | BRF_GRA }, // 17 - - { "b-b0-.rom", 0x10000, 0xb5b95776, 0x04 | BRF_GRA }, // 18 Background Tiles - { "b-b1-.rom", 0x10000, 0x74ca16ee, 0x04 | BRF_GRA }, // 19 - { "b-b2-.rom", 0x10000, 0xb82cca04, 0x04 | BRF_GRA }, // 20 - { "b-b3-.rom", 0x10000, 0xa7afc920, 0x04 | BRF_GRA }, // 21 - - { "c-v0-b.rom", 0x10000, 0xd0c27e58, 0x05 | BRF_SND }, // 22 DAC Samples - - { "bchopper_i8751.mcu", 0x10000, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 23 i8751 Code -}; - -STD_ROM_PICK(bchopper) -STD_ROM_FN(bchopper) - -static INT32 bchopperInit() -{ - install_protection(bchopper); - - return DrvInit(common_080000_0a0000, sound_ram_map, dbreedm72RomLoadCallback, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvBchopper = { - "bchopper", NULL, NULL, NULL, "1987", - "Battle Chopper\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, bchopperRomInfo, bchopperRomName, NULL, NULL, CommonInputInfo, BchopperDIPInfo, - bchopperInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Mr. HELI no Dai-Bouken - -static struct BurnRomInfo mrheliRomDesc[] = { - { "mh-c-h0.bin", 0x10000, 0xe2ca5646, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "mh-c-l0.bin", 0x10000, 0x643e23cd, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "mh-c-h1.bin", 0x10000, 0x8974e84d, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "mh-c-l1.bin", 0x10000, 0x5f8bda69, 0x01 | BRF_PRG | BRF_ESS }, // 3 - { "mh-c-h3.bin", 0x10000, 0x143f596e, 0x01 | BRF_PRG | BRF_ESS }, // 4 - { "mh-c-l3.bin", 0x10000, 0xc0982536, 0x01 | BRF_PRG | BRF_ESS }, // 5 - - { "mh-c-00.bin", 0x20000, 0xdec4e121, 0x02 | BRF_GRA }, // 6 Sprites - { "mh-c-10.bin", 0x20000, 0x7aaa151e, 0x02 | BRF_GRA }, // 7 - { "mh-c-20.bin", 0x20000, 0xeae0de74, 0x02 | BRF_GRA }, // 8 - { "mh-c-30.bin", 0x20000, 0x01d5052f, 0x02 | BRF_GRA }, // 9 - - { "mh-b-a0.bin", 0x10000, 0x6a0db256, 0x03 | BRF_GRA }, // 10 Foreground Tiles - { "mh-b-a1.bin", 0x10000, 0x14ec9795, 0x03 | BRF_GRA }, // 11 - { "mh-b-a2.bin", 0x10000, 0xdfcb510e, 0x03 | BRF_GRA }, // 12 - { "mh-b-a3.bin", 0x10000, 0x957e329b, 0x03 | BRF_GRA }, // 13 - - { "b-b0-.rom", 0x10000, 0xb5b95776, 0x04 | BRF_GRA }, // 14 Background Tiles - { "b-b1-.rom", 0x10000, 0x74ca16ee, 0x04 | BRF_GRA }, // 15 - { "b-b2-.rom", 0x10000, 0xb82cca04, 0x04 | BRF_GRA }, // 16 - { "b-b3-.rom", 0x10000, 0xa7afc920, 0x04 | BRF_GRA }, // 17 - - { "c-v0-b.rom", 0x10000, 0xd0c27e58, 0x05 | BRF_SND }, // 18 DAC Samples - - { "mh-c-pr.bin", 0x01000, 0x897dc4ee, 0x00 | BRF_OPT }, // 19 i8751 Code -}; - -STD_ROM_PICK(mrheli) -STD_ROM_FN(mrheli) - -static INT32 mrheliInit() -{ - m72_install_protection(bchopper_code, mrheli_crc, bchopper_sample_offsets); - - return DrvInit(common_080000_0a0000, sound_ram_map, dbreedm72RomLoadCallback, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvMrheli = { - "mrheli", "bchopper", NULL, NULL, "1987", - "Mr. HELI no Dai-Bouken\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, mrheliRomInfo, mrheliRomName, NULL, NULL, CommonInputInfo, BchopperDIPInfo, - mrheliInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Ninja Spirit - -static struct BurnRomInfo nspiritRomDesc[] = { - { "nin_c-h0.6h", 0x10000, 0x035692fa, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "nin_c-l0.6d", 0x10000, 0x9a405898, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "nin_c-h1.6j", 0x10000, 0xcbc10586, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "nin_c-l1.6c", 0x10000, 0xb75c9a4d, 0x01 | BRF_PRG | BRF_ESS }, // 3 - { "nin_c-h2.6l", 0x10000, 0x8ad818fa, 0x01 | BRF_PRG | BRF_ESS }, // 4 - { "nin_c-l2.6b", 0x10000, 0xc52ca78c, 0x01 | BRF_PRG | BRF_ESS }, // 5 - { "nin_c-h3.6m", 0x10000, 0x501104ef, 0x01 | BRF_PRG | BRF_ESS }, // 6 - { "nin_c-l3.6a", 0x10000, 0xfd7408b8, 0x01 | BRF_PRG | BRF_ESS }, // 7 - - { "nin-r00.7m", 0x20000, 0x5f61d30b, 0x02 | BRF_GRA }, // 8 Sprites - { "nin-r10.7j", 0x20000, 0x0caad107, 0x02 | BRF_GRA }, // 9 - { "nin-r20.7f", 0x20000, 0xef3617d3, 0x02 | BRF_GRA }, // 10 - { "nin-r30.7d", 0x20000, 0x175d2a24, 0x02 | BRF_GRA }, // 11 - - { "nin_b-a0.4c", 0x10000, 0x63f8f658, 0x03 | BRF_GRA }, // 12 Foreground Tiles - { "nin_b-a1.4d", 0x10000, 0x75eb8306, 0x03 | BRF_GRA }, // 13 - { "nin_b-a2.4b", 0x10000, 0xdf532172, 0x03 | BRF_GRA }, // 14 - { "nin_b-a3.4e", 0x10000, 0x4dedd64c, 0x03 | BRF_GRA }, // 15 - - { "b0.4j", 0x10000, 0x1b0e08a6, 0x04 | BRF_GRA }, // 16 Background Tiles - { "b1.4k", 0x10000, 0x728727f0, 0x04 | BRF_GRA }, // 17 - { "b2.4h", 0x10000, 0xf87efd75, 0x04 | BRF_GRA }, // 18 - { "b3.4f", 0x10000, 0x98856cb4, 0x04 | BRF_GRA }, // 19 - - { "nin-v0.7a", 0x10000, 0xa32e8caf, 0x05 | BRF_SND }, // 20 DAC Samples - - { "nin_c-pr.1c", 0x01000, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 21 i8751 Code - - { "m72_a-8l.8l", 0x00100, 0xb460c438, 0x00 | BRF_OPT }, // 22 Proms - { "m72_a-9l.9l", 0x00100, 0xa4f2c4bc, 0x00 | BRF_OPT }, // 23 - - { "nin_c-3f.3f", 0x00100, 0x5402fc07, 0x00 | BRF_OPT }, // 24 PLDs - { "m72_a-3d.3d", 0x00100, 0xde85dac3, 0x00 | BRF_OPT }, // 25 - { "m72_a-4d.4d", 0x00100, 0x59676de1, 0x00 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(nspirit) -STD_ROM_FN(nspirit) - -static INT32 nspiritInit() -{ - install_protection(nspirit); - - return DrvInit(common_080000_0a0000, sound_ram_map, NULL, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvNspirit = { - "nspirit", NULL, NULL, NULL, "1988", - "Ninja Spirit\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT, 0, - NULL, nspiritRomInfo, nspiritRomName, NULL, NULL, CommonInputInfo, NspiritDIPInfo, - nspiritInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Saigo no Nindou (Japan) - -static struct BurnRomInfo nspiritjRomDesc[] = { - { "c-h0", 0x10000, 0x8603fab2, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "c-l0", 0x10000, 0xe520fa35, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "nin_c-h1.6j", 0x10000, 0xcbc10586, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "nin_c-l1.6c", 0x10000, 0xb75c9a4d, 0x01 | BRF_PRG | BRF_ESS }, // 3 - { "nin_c-h2.6l", 0x10000, 0x8ad818fa, 0x01 | BRF_PRG | BRF_ESS }, // 4 - { "nin_c-l2.6b", 0x10000, 0xc52ca78c, 0x01 | BRF_PRG | BRF_ESS }, // 5 - { "c-h3", 0x10000, 0x95b63a61, 0x01 | BRF_PRG | BRF_ESS }, // 6 - { "c-l3", 0x10000, 0xe754a87a, 0x01 | BRF_PRG | BRF_ESS }, // 7 - - { "nin-r00.7m", 0x20000, 0x5f61d30b, 0x02 | BRF_GRA }, // 8 Sprites - { "nin-r10.7j", 0x20000, 0x0caad107, 0x02 | BRF_GRA }, // 9 - { "nin-r20.7f", 0x20000, 0xef3617d3, 0x02 | BRF_GRA }, // 10 - { "nin-r30.7d", 0x20000, 0x175d2a24, 0x02 | BRF_GRA }, // 11 - - { "nin_b-a0.4c", 0x10000, 0x63f8f658, 0x03 | BRF_GRA }, // 12 Foreground Tiles - { "nin_b-a1.4d", 0x10000, 0x75eb8306, 0x03 | BRF_GRA }, // 13 - { "nin_b-a2.4b", 0x10000, 0xdf532172, 0x03 | BRF_GRA }, // 14 - { "nin_b-a3.4e", 0x10000, 0x4dedd64c, 0x03 | BRF_GRA }, // 15 - - { "b0.4j", 0x10000, 0x1b0e08a6, 0x04 | BRF_GRA }, // 16 Background Tiles - { "b1.4k", 0x10000, 0x728727f0, 0x04 | BRF_GRA }, // 17 - { "b2.4h", 0x10000, 0xf87efd75, 0x04 | BRF_GRA }, // 18 - { "b3.4f", 0x10000, 0x98856cb4, 0x04 | BRF_GRA }, // 19 - - { "nin-v0.7a", 0x10000, 0xa32e8caf, 0x05 | BRF_SND }, // 20 DAC Samples - - { "nin_c-pr.1c", 0x01000, 0x802d440a, 0x00 | BRF_OPT }, // 21 i8751 Code -}; - -STD_ROM_PICK(nspiritj) -STD_ROM_FN(nspiritj) - -static INT32 nspiritjInit() -{ - m72_install_protection(nspirit_code, nspiritj_crc, nspirit_sample_offsets); - - return DrvInit(common_080000_0a0000, sound_ram_map, NULL, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvNspiritj = { - "nspiritj", "nspirit", NULL, NULL, "1988", - "Saigo no Nindou (Japan)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT, 0, - NULL, nspiritjRomInfo, nspiritjRomName, NULL, NULL, CommonInputInfo, NspiritDIPInfo, - nspiritjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Image Fight (Japan, revision A) - -static struct BurnRomInfo imgfightRomDesc[] = { - { "if-c-h0-a.bin", 0x10000, 0xf5c94464, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "if-c-l0-a.bin", 0x10000, 0x87c534fe, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "if-c-h3.bin", 0x20000, 0xea030541, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "if-c-l3.bin", 0x20000, 0xc66ae348, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "if-c-00.bin", 0x20000, 0x745e6638, 0x02 | BRF_GRA }, // 4 Sprites - { "if-c-10.bin", 0x20000, 0xb7108449, 0x02 | BRF_GRA }, // 5 - { "if-c-20.bin", 0x20000, 0xaef33cba, 0x02 | BRF_GRA }, // 6 - { "if-c-30.bin", 0x20000, 0x1f98e695, 0x02 | BRF_GRA }, // 7 - - { "if-a-a0.bin", 0x10000, 0x34ee2d77, 0x03 | BRF_GRA }, // 8 Foreground Tiles - { "if-a-a1.bin", 0x10000, 0x6bd2845b, 0x03 | BRF_GRA }, // 9 - { "if-a-a2.bin", 0x10000, 0x090d50e5, 0x03 | BRF_GRA }, // 10 - { "if-a-a3.bin", 0x10000, 0x3a8e3083, 0x03 | BRF_GRA }, // 11 - - { "if-a-b0.bin", 0x10000, 0xb425c829, 0x04 | BRF_GRA }, // 12 Background Tiles - { "if-a-b1.bin", 0x10000, 0xe9bfe23e, 0x04 | BRF_GRA }, // 13 - { "if-a-b2.bin", 0x10000, 0x256e50f2, 0x04 | BRF_GRA }, // 14 - { "if-a-b3.bin", 0x10000, 0x4c682785, 0x04 | BRF_GRA }, // 15 - - { "if-c-v0.bin", 0x10000, 0xcb64a194, 0x05 | BRF_SND }, // 16 DAC Samples - { "if-c-v1.bin", 0x10000, 0x45b68bf5, 0x05 | BRF_SND }, // 17 - - { "imgfight_i8751h.bin",0x01000, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 18 i8751 Code -}; - -STD_ROM_PICK(imgfight) -STD_ROM_FN(imgfight) - -static INT32 imgfightRomLoadCallback() -{ - memmove(DrvV30ROM + 0x40000, DrvV30ROM + 0x20000, 0x40000); - - return 0; -} - -static INT32 imgfightInit() -{ - install_protection(imgfight); - - return DrvInit(common_080000_0a0000, sound_ram_map, imgfightRomLoadCallback, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvImgfight = { - "imgfight", NULL, NULL, NULL, "1988", - "Image Fight (Japan, revision A)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_M72, GBF_VERSHOOT, 0, - NULL, imgfightRomInfo, imgfightRomName, NULL, NULL, CommonInputInfo, ImgfightDIPInfo, - imgfightInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 384, 3, 4 -}; - - -// Image Fight (Japan) - -static struct BurnRomInfo imgfightjRomDesc[] = { - { "if-c-h0.bin", 0x10000, 0x592d2d80, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "if-c-l0.bin", 0x10000, 0x61f89056, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "if-c-h3.bin", 0x20000, 0xea030541, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "if-c-l3.bin", 0x20000, 0xc66ae348, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "if-c-00.bin", 0x20000, 0x745e6638, 0x02 | BRF_GRA }, // 4 Sprites - { "if-c-10.bin", 0x20000, 0xb7108449, 0x02 | BRF_GRA }, // 5 - { "if-c-20.bin", 0x20000, 0xaef33cba, 0x02 | BRF_GRA }, // 6 - { "if-c-30.bin", 0x20000, 0x1f98e695, 0x02 | BRF_GRA }, // 7 - - { "if-a-a0.bin", 0x10000, 0x34ee2d77, 0x03 | BRF_GRA }, // 8 Foreground Tiles - { "if-a-a1.bin", 0x10000, 0x6bd2845b, 0x03 | BRF_GRA }, // 9 - { "if-a-a2.bin", 0x10000, 0x090d50e5, 0x03 | BRF_GRA }, // 10 - { "if-a-a3.bin", 0x10000, 0x3a8e3083, 0x03 | BRF_GRA }, // 11 - - { "if-a-b0.bin", 0x10000, 0xb425c829, 0x04 | BRF_GRA }, // 12 Background Tiles - { "if-a-b1.bin", 0x10000, 0xe9bfe23e, 0x04 | BRF_GRA }, // 13 - { "if-a-b2.bin", 0x10000, 0x256e50f2, 0x04 | BRF_GRA }, // 14 - { "if-a-b3.bin", 0x10000, 0x4c682785, 0x04 | BRF_GRA }, // 15 - - { "if-c-v0.bin", 0x10000, 0xcb64a194, 0x05 | BRF_SND }, // 16 DAC Samples - { "if-c-v1.bin", 0x10000, 0x45b68bf5, 0x05 | BRF_SND }, // 17 - - { "imgfightj_i8751h.bin",0x01000, 0xef0d5098, 0x00 | BRF_OPT }, // 18 i8751 Code -}; - -STD_ROM_PICK(imgfightj) -STD_ROM_FN(imgfightj) - -struct BurnDriver BurnDrvImgfightj = { - "imgfightj", "imgfight", NULL, NULL, "1988", - "Image Fight (Japan)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_M72, GBF_VERSHOOT, 0, - NULL, imgfightjRomInfo, imgfightjRomName, NULL, NULL, CommonInputInfo, ImgfightDIPInfo, - imgfightInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 384, 3, 4 -}; - - -// Air Duel (World, M82-A-A + M82-B-A) - -static struct BurnRomInfo airduelRomDesc[] = { - { "AD_(M82)_A-H0-D.IC52", 0x20000, 0xdbecc726, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "AD_(M82)_A-L0-D.IC60", 0x20000, 0x6a9fcf59, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "AD_(M82)_A-H1-D.IC51", 0x20000, 0xbafc152a, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "AD_(M82)_A-L1-D.IC59", 0x20000, 0x9e2b1ae7, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "AD_(M82)_A-SP-D.IC15", 0x10000, 0x16a858a3, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "AD_(M82)_B-N0-D.IC44", 0x20000, 0x2f0d599b, 0x02 | BRF_GRA }, // 5 Sprites - { "AD_(M82)_B-N1-D.IC45", 0x20000, 0x9865856b, 0x02 | BRF_GRA }, // 6 - { "AD_(M82)_B-N2-D.IC46", 0x20000, 0xd392aef2, 0x02 | BRF_GRA }, // 7 - { "AD_(M82)_B-N3-D.IC36", 0x20000, 0x923240c3, 0x02 | BRF_GRA }, // 8 - - { "AD_(M82)_A-C0-D.IC49", 0x20000, 0xce134b47, 0x03 | BRF_GRA }, // 9 Foreground Tiles - { "AD_(M82)_A-C1-D.IC48", 0x20000, 0x097fd853, 0x03 | BRF_GRA }, // 10 - { "AD_(M82)_A-C2-D.IC57", 0x20000, 0x6a94c1b9, 0x03 | BRF_GRA }, // 11 - { "AD_(M82)_A-C3-D.IC56", 0x20000, 0x6637c349, 0x03 | BRF_GRA }, // 12 - - { "mt_f0.bin", 0x20000, 0x2d5e05d5, 0x0e | BRF_GRA }, // 17 Sprites 2 - { "mt_f1.bin", 0x20000, 0xc68cd65f, 0x0e | BRF_GRA }, // 18 - { "mt_f2.bin", 0x20000, 0xa71feb2d, 0x0e | BRF_GRA }, // 19 - { "mt_f3.bin", 0x20000, 0x179f7562, 0x0e | BRF_GRA }, // 20 - - { "AD_(M82)_A-V0-D.IC12", 0x20000, 0x339f474d, 0x05 | BRF_SND }, // 21 DAC Samples -}; - -STD_ROM_PICK(airduel) -STD_ROM_FN(airduel) - -static INT32 airduelInit() -{ - return DrvInit(majtitle_main_cpu_map, sound_rom_map, NULL, Z80_REAL_NMI, 6); -} - -struct BurnDriver BurnDrvAirduel = { - "airduel", NULL, NULL, NULL, "1990", - "Air Duel (World, M82-A-A + M82-B-A)\0", NULL, "Irem", "M82", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_M72, GBF_VERSHOOT, 0, - NULL, airduelRomInfo, airduelRomName, NULL, NULL, CommonInputInfo, AirduelDIPInfo, - airduelInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 384, 3, 4 -}; - - -// Air Duel (Japan, M72) - -static struct BurnRomInfo airduelm72RomDesc[] = { - { "ad-c-h0.bin", 0x20000, 0x12140276, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "ad-c-l0.bin", 0x20000, 0x4ac0b91d, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ad-c-h3.bin", 0x20000, 0x9f7cfca3, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ad-c-l3.bin", 0x20000, 0x9dd343f7, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ad-00.bin", 0x20000, 0x2f0d599b, 0x02 | BRF_GRA }, // 4 Sprites - { "ad-10.bin", 0x20000, 0x9865856b, 0x02 | BRF_GRA }, // 5 - { "ad-20.bin", 0x20000, 0xd392aef2, 0x02 | BRF_GRA }, // 6 - { "ad-30.bin", 0x20000, 0x923240c3, 0x02 | BRF_GRA }, // 7 - - { "ad-a0.bin", 0x20000, 0xce134b47, 0x03 | BRF_GRA }, // 8 Foreground Tiles - { "ad-a1.bin", 0x20000, 0x097fd853, 0x03 | BRF_GRA }, // 9 - { "ad-a2.bin", 0x20000, 0x6a94c1b9, 0x03 | BRF_GRA }, // 10 - { "ad-a3.bin", 0x20000, 0x6637c349, 0x03 | BRF_GRA }, // 11 - - { "ad-b0.bin", 0x20000, 0xce134b47, 0x04 | BRF_GRA }, // 12 Background Tiles - { "ad-b1.bin", 0x20000, 0x097fd853, 0x04 | BRF_GRA }, // 13 - { "ad-b2.bin", 0x20000, 0x6a94c1b9, 0x04 | BRF_GRA }, // 14 - { "ad-b3.bin", 0x20000, 0x6637c349, 0x04 | BRF_GRA }, // 15 - - { "ad-v0.bin", 0x20000, 0x339f474d, 0x05 | BRF_SND }, // 16 DAC Samples - - { "airduel_i8751.mcu", 0x10000, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 17 i8751 Code -}; - -STD_ROM_PICK(airduelm72) -STD_ROM_FN(airduelm72) - -static INT32 airduelm72Init() -{ - install_protection(airduel); - - return DrvInit(common_080000_0a0000, sound_ram_map, NULL, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvAirduelm72 = { - "airduelm72", "airduel", NULL, NULL, "1990", - "Air Duel (Japan, M72)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_VERSHOOT, 0, - NULL, airduelm72RomInfo, airduelm72RomName, NULL, NULL, CommonInputInfo, AirduelDIPInfo, - airduelm72Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 384, 3, 4 -}; - - -// R-Type II - -static struct BurnRomInfo rtype2RomDesc[] = { - { "rt2-a-h0-d.54", 0x20000, 0xd8ece6f4, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rt2-a-l0-d.60", 0x20000, 0x32cfb2e4, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "rt2-a-h1-d.53", 0x20000, 0x4f6e9b15, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "rt2-a-l1-d.59", 0x20000, 0x0fd123bf, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ic17.4f", 0x10000, 0x73ffecb4, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ic31.6l", 0x20000, 0x2cd8f913, 0x02 | BRF_GRA }, // 5 Sprites - { "ic21.4l", 0x20000, 0x5033066d, 0x02 | BRF_GRA }, // 6 - { "ic32.6m", 0x20000, 0xec3a0450, 0x02 | BRF_GRA }, // 7 - { "ic22.4m", 0x20000, 0xdb6176fc, 0x02 | BRF_GRA }, // 8 - - { "ic50.7s", 0x20000, 0xf3f8736e, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "ic51.7u", 0x20000, 0xb4c543af, 0x03 | BRF_GRA }, // 10 - { "ic56.8s", 0x20000, 0x4cb80d66, 0x03 | BRF_GRA }, // 11 - { "ic57.8u", 0x20000, 0xbee128e0, 0x03 | BRF_GRA }, // 12 - { "ic65.9r", 0x20000, 0x2dc9c71a, 0x03 | BRF_GRA }, // 13 - { "ic66.9u", 0x20000, 0x7533c428, 0x03 | BRF_GRA }, // 14 - { "ic63.9m", 0x20000, 0xa6ad67f2, 0x03 | BRF_GRA }, // 15 - { "ic64.9p", 0x20000, 0x3686d555, 0x03 | BRF_GRA }, // 16 - - { "ic14.4c", 0x20000, 0x637172d5, 0x05 | BRF_SND }, // 17 DAC Samples -}; - -STD_ROM_PICK(rtype2) -STD_ROM_FN(rtype2) - -static INT32 rtype2Init() -{ - return DrvInit(rtype2_main_cpu_map, sound_rom_map, NULL, Z80_REAL_NMI, 1); -} - -struct BurnDriver BurnDrvRtype2 = { - "rtype2", NULL, NULL, NULL, "1989", - "R-Type II\0", NULL, "Irem", "M82", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, rtype2RomInfo, rtype2RomName, NULL, NULL, CommonInputInfo, Rtype2DIPInfo, - rtype2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// R-Type II (Japan) - -static struct BurnRomInfo rtype2jRomDesc[] = { - { "rt2-a-h0.54", 0x20000, 0x7857ccf6, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rt2-a-l0.60", 0x20000, 0xcb22cd6e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "rt2-a-h1.53", 0x20000, 0x49e75d28, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "rt2-a-l1.59", 0x20000, 0x12ec1676, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ic17.4f", 0x10000, 0x73ffecb4, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ic31.6l", 0x20000, 0x2cd8f913, 0x02 | BRF_GRA }, // 5 Sprites - { "ic21.4l", 0x20000, 0x5033066d, 0x02 | BRF_GRA }, // 6 - { "ic32.6m", 0x20000, 0xec3a0450, 0x02 | BRF_GRA }, // 7 - { "ic22.4m", 0x20000, 0xdb6176fc, 0x02 | BRF_GRA }, // 8 - - { "ic50.7s", 0x20000, 0xf3f8736e, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "ic51.7u", 0x20000, 0xb4c543af, 0x03 | BRF_GRA }, // 10 - { "ic56.8s", 0x20000, 0x4cb80d66, 0x03 | BRF_GRA }, // 11 - { "ic57.8u", 0x20000, 0xbee128e0, 0x03 | BRF_GRA }, // 12 - { "ic65.9r", 0x20000, 0x2dc9c71a, 0x03 | BRF_GRA }, // 13 - { "ic66.9u", 0x20000, 0x7533c428, 0x03 | BRF_GRA }, // 14 - { "ic63.9m", 0x20000, 0xa6ad67f2, 0x03 | BRF_GRA }, // 15 - { "ic64.9p", 0x20000, 0x3686d555, 0x03 | BRF_GRA }, // 16 - - { "ic14.4c", 0x20000, 0x637172d5, 0x05 | BRF_SND }, // 17 DAC Samples - - { "rt2_b-4n-.bin", 0x00100, 0xb460c438, 0x00 | BRF_OPT }, // 18 Proms - { "rt2_b-4p-.bin", 0x00100, 0xa4f2c4bc, 0x00 | BRF_OPT }, // 19 -}; - -STD_ROM_PICK(rtype2j) -STD_ROM_FN(rtype2j) - -struct BurnDriver BurnDrvRtype2j = { - "rtype2j", "rtype2", NULL, NULL, "1989", - "R-Type II (Japan)\0", NULL, "Irem", "M82", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, rtype2jRomInfo, rtype2jRomName, NULL, NULL, CommonInputInfo, Rtype2DIPInfo, - rtype2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// R-Type II (Japan, revision C) - -static struct BurnRomInfo rtype2jcRomDesc[] = { - { "rt2-a-h0-c.54", 0x20000, 0xef9a9990, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rt2-a-l0-c.60", 0x20000, 0xd8b9da64, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "rt2-a-h1-c.53", 0x20000, 0x1b1870f4, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "rt2-a-l1-c.59", 0x20000, 0x60fdff35, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ic17.4f", 0x10000, 0x73ffecb4, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ic31.6l", 0x20000, 0x2cd8f913, 0x02 | BRF_GRA }, // 5 Sprites - { "ic21.4l", 0x20000, 0x5033066d, 0x02 | BRF_GRA }, // 6 - { "ic32.6m", 0x20000, 0xec3a0450, 0x02 | BRF_GRA }, // 7 - { "ic22.4m", 0x20000, 0xdb6176fc, 0x02 | BRF_GRA }, // 8 - - { "ic50.7s", 0x20000, 0xf3f8736e, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "ic51.7u", 0x20000, 0xb4c543af, 0x03 | BRF_GRA }, // 10 - { "ic56.8s", 0x20000, 0x4cb80d66, 0x03 | BRF_GRA }, // 11 - { "ic57.8u", 0x20000, 0xbee128e0, 0x03 | BRF_GRA }, // 12 - { "ic65.9r", 0x20000, 0x2dc9c71a, 0x03 | BRF_GRA }, // 13 - { "ic66.9u", 0x20000, 0x7533c428, 0x03 | BRF_GRA }, // 14 - { "ic63.9m", 0x20000, 0xa6ad67f2, 0x03 | BRF_GRA }, // 15 - { "ic64.9p", 0x20000, 0x3686d555, 0x03 | BRF_GRA }, // 16 - - { "ic14.4c", 0x20000, 0x637172d5, 0x05 | BRF_SND }, // 17 DAC Samples -}; - -STD_ROM_PICK(rtype2jc) -STD_ROM_FN(rtype2jc) - -struct BurnDriver BurnDrvRtype2jc = { - "rtype2jc", "rtype2", NULL, NULL, "1989", - "R-Type II (Japan, revision C)\0", NULL, "Irem", "M82", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, rtype2jcRomInfo, rtype2jcRomName, NULL, NULL, CommonInputInfo, Rtype2DIPInfo, - rtype2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Hammerin' Harry (World) - -static struct BurnRomInfo hharryRomDesc[] = { - { "a-h0-v.rom", 0x20000, 0xc52802a5, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "a-l0-v.rom", 0x20000, 0xf463074c, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "a-h1-0.rom", 0x10000, 0x3ae21335, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "a-l1-0.rom", 0x10000, 0xbc6ac5f9, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "a-sp-0.rom", 0x10000, 0x80e210e7, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "hh_00.rom", 0x20000, 0xec5127ef, 0x02 | BRF_GRA }, // 5 Sprites - { "hh_10.rom", 0x20000, 0xdef65294, 0x02 | BRF_GRA }, // 6 - { "hh_20.rom", 0x20000, 0xbb0d6ad4, 0x02 | BRF_GRA }, // 7 - { "hh_30.rom", 0x20000, 0x4351044e, 0x02 | BRF_GRA }, // 8 - - { "hh_a0.rom", 0x20000, 0xc577ba5f, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "hh_a1.rom", 0x20000, 0x429d12ab, 0x03 | BRF_GRA }, // 10 - { "hh_a2.rom", 0x20000, 0xb5b163b0, 0x03 | BRF_GRA }, // 11 - { "hh_a3.rom", 0x20000, 0x8ef566a1, 0x03 | BRF_GRA }, // 12 - - { "a-v0-0.rom", 0x20000, 0xfaaacaff, 0x05 | BRF_SND }, // 13 DAC Samples -}; - -STD_ROM_PICK(hharry) -STD_ROM_FN(hharry) - -static INT32 hharryInit() -{ - return DrvInit(common_080000_0a0000, sound_rom_map, dbreedm72RomLoadCallback, Z80_REAL_NMI, 2); -} - -struct BurnDriver BurnDrvHharry = { - "hharry", NULL, NULL, NULL, "1990", - "Hammerin' Harry (World)\0", NULL, "Irem", "M82", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, hharryRomInfo, hharryRomName, NULL, NULL, CommonInputInfo, HharryDIPInfo, - hharryInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Hammerin' Harry (US) - -static struct BurnRomInfo hharryuRomDesc[] = { - { "a-ho-u.8d", 0x20000, 0xede7f755, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "a-lo-u.9d", 0x20000, 0xdf0726ae, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "a-h1-f.8b", 0x10000, 0x31b741c5, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "a-l1-f.9b", 0x10000, 0xb23e966c, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "a-sp-0.rom", 0x10000, 0x80e210e7, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "hh_00.rom", 0x20000, 0xec5127ef, 0x02 | BRF_GRA }, // 5 Sprites - { "hh_10.rom", 0x20000, 0xdef65294, 0x02 | BRF_GRA }, // 6 - { "hh_20.rom", 0x20000, 0xbb0d6ad4, 0x02 | BRF_GRA }, // 7 - { "hh_30.rom", 0x20000, 0x4351044e, 0x02 | BRF_GRA }, // 8 - - { "hh_a0.rom", 0x20000, 0xc577ba5f, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "hh_a1.rom", 0x20000, 0x429d12ab, 0x03 | BRF_GRA }, // 10 - { "hh_a2.rom", 0x20000, 0xb5b163b0, 0x03 | BRF_GRA }, // 11 - { "hh_a3.rom", 0x20000, 0x8ef566a1, 0x03 | BRF_GRA }, // 12 - - { "a-v0-0.rom", 0x20000, 0xfaaacaff, 0x05 | BRF_SND }, // 13 DAC Samples -}; - -STD_ROM_PICK(hharryu) -STD_ROM_FN(hharryu) - -static INT32 hharryuInit() -{ - return DrvInit(hharryu_main_cpu_map, sound_rom_map, dbreedm72RomLoadCallback, Z80_REAL_NMI, 1); -} - -struct BurnDriver BurnDrvHharryu = { - "hharryu", "hharry", NULL, NULL, "1990", - "Hammerin' Harry (US)\0", NULL, "Irem America", "M82", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, hharryuRomInfo, hharryuRomName, NULL, NULL, CommonInputInfo, HharryDIPInfo, - hharryuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Daiku no Gensan (Japan, M82) - -static struct BurnRomInfo dkgensanRomDesc[] = { - { "gen-a-h0.bin", 0x20000, 0x07a45f6d, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "gen-a-l0.bin", 0x20000, 0x46478fea, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "gen-a-h1.bin", 0x10000, 0x54e5b73c, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "gen-a-l1.bin", 0x10000, 0x894f8a9f, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "gen-a-sp.bin", 0x10000, 0xe83cfc2c, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "hh_00.rom", 0x20000, 0xec5127ef, 0x02 | BRF_GRA }, // 5 Sprites - { "hh_10.rom", 0x20000, 0xdef65294, 0x02 | BRF_GRA }, // 6 - { "hh_20.rom", 0x20000, 0xbb0d6ad4, 0x02 | BRF_GRA }, // 7 - { "hh_30.rom", 0x20000, 0x4351044e, 0x02 | BRF_GRA }, // 8 - - { "hh_a0.rom", 0x20000, 0xc577ba5f, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "hh_a1.rom", 0x20000, 0x429d12ab, 0x03 | BRF_GRA }, // 10 - { "hh_a2.rom", 0x20000, 0xb5b163b0, 0x03 | BRF_GRA }, // 11 - { "hh_a3.rom", 0x20000, 0x8ef566a1, 0x03 | BRF_GRA }, // 12 - - { "gen-vo.bin", 0x20000, 0xd8595c66, 0x05 | BRF_SND }, // 13 DAC Samples -}; - -STD_ROM_PICK(dkgensan) -STD_ROM_FN(dkgensan) - -struct BurnDriver BurnDrvDkgensan = { - "dkgensan", "hharry", NULL, NULL, "1990", - "Daiku no Gensan (Japan, M82)\0", NULL, "Irem", "M82", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, dkgensanRomInfo, dkgensanRomName, NULL, NULL, CommonInputInfo, HharryDIPInfo, - hharryuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Daiku no Gensan (Japan, M72) - -static struct BurnRomInfo dkgensanm72RomDesc[] = { - { "ge72-h0.bin", 0x20000, 0xa0ad992c, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "ge72-l0.bin", 0x20000, 0x996396f0, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ge72-h3.bin", 0x10000, 0xd8b86005, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ge72-l3.bin", 0x10000, 0x23d303a5, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "hh_00.rom", 0x20000, 0xec5127ef, 0x02 | BRF_GRA }, // 4 Sprites - { "hh_10.rom", 0x20000, 0xdef65294, 0x02 | BRF_GRA }, // 5 - { "hh_20.rom", 0x20000, 0xbb0d6ad4, 0x02 | BRF_GRA }, // 6 - { "hh_30.rom", 0x20000, 0x4351044e, 0x02 | BRF_GRA }, // 7 - - { "ge72b-a0.bin", 0x10000, 0xf5f56b2a, 0x03 | BRF_GRA }, // 8 Foreground Tiles - { "ge72-a1.bin", 0x10000, 0xd194ea08, 0x03 | BRF_GRA }, // 9 - { "ge72-a2.bin", 0x10000, 0x2b06bcc3, 0x03 | BRF_GRA }, // 10 - { "ge72-a3.bin", 0x10000, 0x94b96bfa, 0x03 | BRF_GRA }, // 11 - - { "ge72-b0.bin", 0x10000, 0x208796b3, 0x04 | BRF_GRA }, // 12 Background Tiles - { "ge72-b1.bin", 0x10000, 0xb4a7f490, 0x04 | BRF_GRA }, // 13 - { "ge72b-b2.bin", 0x10000, 0x34fe8f7f, 0x04 | BRF_GRA }, // 14 - { "ge72b-b3.bin", 0x10000, 0x4b0e92f4, 0x04 | BRF_GRA }, // 15 - - { "gen-vo.bin", 0x20000, 0xd8595c66, 0x05 | BRF_SND }, // 16 DAC Samples - - { "dkgenm72_i8751.mcu", 0x10000, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 17 i8751 Code -}; - -STD_ROM_PICK(dkgensanm72) -STD_ROM_FN(dkgensanm72) - -static INT32 dkgensanm72Init() -{ - install_protection(dkgenm72); - - return DrvInit(common_080000_0a0000, sound_ram_map, dbreedm72RomLoadCallback, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvDkgensanm72 = { - "dkgensanm72", "hharry", NULL, NULL, "1990", - "Daiku no Gensan (Japan, M72)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, dkgensanm72RomInfo, dkgensanm72RomName, NULL, NULL, CommonInputInfo, HharryDIPInfo, - dkgensanm72Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Lightning Swords - -static struct BurnRomInfo ltswordsRomDesc[] = { - { "h0.ic55", 0x20000, 0x22f342b2, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "l0.ic61", 0x20000, 0x0210d592, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ken_d-sp.rom", 0x10000, 0x233ca1cf, 0x06 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ken_m31.rom", 0x20000, 0xe00b95a6, 0x02 | BRF_GRA }, // 3 Sprites - { "ken_m21.rom", 0x20000, 0xd7722f87, 0x02 | BRF_GRA }, // 4 - { "ken_m32.rom", 0x20000, 0x30a844c4, 0x02 | BRF_GRA }, // 5 - { "ken_m22.rom", 0x20000, 0xa00dac85, 0x02 | BRF_GRA }, // 6 - - { "ken_m51.rom", 0x20000, 0x1646cf4f, 0x03 | BRF_GRA }, // 7 Foreground & Background Tiles - { "ken_m57.rom", 0x20000, 0xa9f88d90, 0x03 | BRF_GRA }, // 8 - { "ken_m66.rom", 0x20000, 0xe9d17645, 0x03 | BRF_GRA }, // 9 - { "ken_m64.rom", 0x20000, 0xdf46709b, 0x03 | BRF_GRA }, // 10 - - { "ken_m14.rom", 0x20000, 0x6651e9b7, 0x05 | BRF_SND }, // 11 DAC Samples -}; - -STD_ROM_PICK(ltswords) -STD_ROM_FN(ltswords) - -static INT32 kengoInit() -{ - INT32 nRet = DrvInit(hharryu_main_cpu_map, sound_rom_map, NULL, Z80_REAL_NMI, 5); - - if (nRet == 0) { - Kengo = 1; - Clock_16mhz = 1; - VezOpen(0); - VezSetDecode((UINT8 *)&gunforce_decryption_table); - VezClose(); - } - - return nRet; -} - -struct BurnDriver BurnDrvLtswords = { - "ltswords", NULL, NULL, NULL, "1991", - "Lightning Swords\0", NULL, "Irem", "M84?", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT, 0, - NULL, ltswordsRomInfo, ltswordsRomName, NULL, NULL, CommonInputInfo, KengoDIPInfo, - kengoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Ken-Go (set 1) - -static struct BurnRomInfo kengoRomDesc[] = { - { "ken_d-h0.rom", 0x20000, 0xf4ddeea5, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "ken_d-l0.rom", 0x20000, 0x04dc0f81, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ken_d-sp.rom", 0x10000, 0x233ca1cf, 0x06 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ken_m31.rom", 0x20000, 0xe00b95a6, 0x02 | BRF_GRA }, // 3 Sprites - { "ken_m21.rom", 0x20000, 0xd7722f87, 0x02 | BRF_GRA }, // 4 - { "ken_m32.rom", 0x20000, 0x30a844c4, 0x02 | BRF_GRA }, // 5 - { "ken_m22.rom", 0x20000, 0xa00dac85, 0x02 | BRF_GRA }, // 6 - - { "ken_m51.rom", 0x20000, 0x1646cf4f, 0x03 | BRF_GRA }, // 7 Foreground & Background Tiles - { "ken_m57.rom", 0x20000, 0xa9f88d90, 0x03 | BRF_GRA }, // 8 - { "ken_m66.rom", 0x20000, 0xe9d17645, 0x03 | BRF_GRA }, // 9 - { "ken_m64.rom", 0x20000, 0xdf46709b, 0x03 | BRF_GRA }, // 10 - - { "ken_m14.rom", 0x20000, 0x6651e9b7, 0x05 | BRF_SND }, // 11 DAC Samples -}; - -STD_ROM_PICK(kengo) -STD_ROM_FN(kengo) - -struct BurnDriver BurnDrvKengo = { - "kengo", "ltswords", NULL, NULL, "1991", - "Ken-Go (set 1)\0", NULL, "Irem", "M84?", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT, 0, - NULL, kengoRomInfo, kengoRomName, NULL, NULL, CommonInputInfo, KengoDIPInfo, - kengoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Ken-Go (set 2) - -static struct BurnRomInfo kengoaRomDesc[] = { - { "KEN-D-H0-.IC55", 0x20000, 0xed3da88c, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "KEN-D-L0-.IC61", 0x20000, 0x92c57d8e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ken_d-sp.rom", 0x10000, 0x233ca1cf, 0x06 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ken_m31.rom", 0x20000, 0xe00b95a6, 0x02 | BRF_GRA }, // 3 Sprites - { "ken_m21.rom", 0x20000, 0xd7722f87, 0x02 | BRF_GRA }, // 4 - { "ken_m32.rom", 0x20000, 0x30a844c4, 0x02 | BRF_GRA }, // 5 - { "ken_m22.rom", 0x20000, 0xa00dac85, 0x02 | BRF_GRA }, // 6 - - { "ken_m51.rom", 0x20000, 0x1646cf4f, 0x03 | BRF_GRA }, // 7 Foreground & Background Tiles - { "ken_m57.rom", 0x20000, 0xa9f88d90, 0x03 | BRF_GRA }, // 8 - { "ken_m66.rom", 0x20000, 0xe9d17645, 0x03 | BRF_GRA }, // 9 - { "ken_m64.rom", 0x20000, 0xdf46709b, 0x03 | BRF_GRA }, // 10 - - { "ken_m14.rom", 0x20000, 0x6651e9b7, 0x05 | BRF_SND }, // 11 DAC Samples - - { "KEN_B-4N-.IC23", 0x00100, 0xb460c438, 0x00 | BRF_OPT }, // 12 Proms - { "KEN_B-4P-.IC24", 0x00100, 0x526f10ca, 0x00 | BRF_OPT }, // 13 -}; - -STD_ROM_PICK(kengoa) -STD_ROM_FN(kengoa) - -struct BurnDriver BurnDrvKengoa = { - "kengoa", "ltswords", NULL, NULL, "1991", - "Ken-Go (set 2)\0", NULL, "Irem", "M84?", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT, 0, - NULL, kengoaRomInfo, kengoaRomName, NULL, NULL, CommonInputInfo, KengoDIPInfo, - kengoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Cosmic Cop (World) - -static struct BurnRomInfo cosmccopRomDesc[] = { - { "cc-d-h0b.bin", 0x40000, 0x38958b01, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "cc-d-l0b.bin", 0x40000, 0xeff87f70, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "cc-d-sp.bin", 0x10000, 0x3e3ace60, 0x06 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "cc-c-00.bin", 0x20000, 0x9d99deaa, 0x02 | BRF_GRA }, // 3 Sprites - { "cc-c-10.bin", 0x20000, 0x7eb083ed, 0x02 | BRF_GRA }, // 4 - { "cc-c-20.bin", 0x20000, 0x9421489e, 0x02 | BRF_GRA }, // 5 - { "cc-c-30.bin", 0x20000, 0x920ec735, 0x02 | BRF_GRA }, // 6 - - { "cc-d-g00.bin", 0x20000, 0xe7f3d772, 0x03 | BRF_GRA }, // 7 Foreground & Background Tiles - { "cc-d-g10.bin", 0x20000, 0x418b4e4c, 0x03 | BRF_GRA }, // 8 - { "cc-d-g20.bin", 0x20000, 0xa4b558eb, 0x03 | BRF_GRA }, // 9 - { "cc-d-g30.bin", 0x20000, 0xf64a3166, 0x03 | BRF_GRA }, // 10 - - { "cc-c-v0.bin", 0x20000, 0x6247bade, 0x05 | BRF_SND }, // 11 DAC Samples -}; - -STD_ROM_PICK(cosmccop) -STD_ROM_FN(cosmccop) - -static INT32 cosmccopInit() -{ - Clock_16mhz = 1; - - INT32 rc = DrvInit(hharryu_main_cpu_map, sound_rom_map, NULL, Z80_REAL_NMI, 7); - - m72_irq_base = 0x60; // Cosmic Cop doesn't write to port 0x42 (irq config), set it manually. (after DrvInit()!) - CosmicCop = 1; - - return rc; -} - -struct BurnDriver BurnDrvCosmccop = { - "cosmccop", NULL, NULL, NULL, "1991", - "Cosmic Cop (World)\0", NULL, "Irem", "M84", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, cosmccopRomInfo, cosmccopRomName, NULL, NULL, CommonInputInfo, GallopDIPInfo, - cosmccopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Gallop - Armed police Unit (Japan) - -static struct BurnRomInfo gallopRomDesc[] = { - { "cc-c-h0.bin", 0x20000, 0x2217dcd0, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "cc-c-l0.bin", 0x20000, 0xff39d7fb, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "cc-c-h3.bin", 0x20000, 0x9b2bbab9, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "cc-c-l3.bin", 0x20000, 0xacd3278e, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "cc-c-00.bin", 0x20000, 0x9d99deaa, 0x02 | BRF_GRA }, // 4 Sprites - { "cc-c-10.bin", 0x20000, 0x7eb083ed, 0x02 | BRF_GRA }, // 5 - { "cc-c-20.bin", 0x20000, 0x9421489e, 0x02 | BRF_GRA }, // 6 - { "cc-c-30.bin", 0x20000, 0x920ec735, 0x02 | BRF_GRA }, // 7 - - { "cc-b-a0.bin", 0x10000, 0xa33472bd, 0x03 | BRF_GRA }, // 8 Foreground Tiles - { "cc-b-a1.bin", 0x10000, 0x118b1f2d, 0x03 | BRF_GRA }, // 9 - { "cc-b-a2.bin", 0x10000, 0x83cebf48, 0x03 | BRF_GRA }, // 10 - { "cc-b-a3.bin", 0x10000, 0x572903fc, 0x03 | BRF_GRA }, // 11 - - { "cc-b-b0.bin", 0x10000, 0x0df5b439, 0x04 | BRF_GRA }, // 12 Background Tiles - { "cc-b-b1.bin", 0x10000, 0x010b778f, 0x04 | BRF_GRA }, // 13 - { "cc-b-b2.bin", 0x10000, 0xbda9f6fb, 0x04 | BRF_GRA }, // 14 - { "cc-b-b3.bin", 0x10000, 0xd361ba3f, 0x04 | BRF_GRA }, // 15 - - { "cc-c-v0.bin", 0x20000, 0x6247bade, 0x05 | BRF_SND }, // 16 DAC Samples - - { "gallop_i8751.mcu", 0x10000, 0x00000000, BRF_NODUMP | BRF_OPT }, -}; - -STD_ROM_PICK(gallop) -STD_ROM_FN(gallop) - -static INT32 gallopInit() -{ - protection_sample_offsets = gallop_sample_offsets; - Clock_16mhz = 1; - - return DrvInit(common_080000_0a0000, sound_ram_map, NULL, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvGallop = { - "gallop", "cosmccop", NULL, NULL, "1991", - "Gallop - Armed police Unit (Japan)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_HORSHOOT, 0, - NULL, gallopRomInfo, gallopRomName, NULL, NULL, CommonInputInfo, GallopDIPInfo, - gallopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - - -// Legend of Hero Tonma - -static struct BurnRomInfo lohtRomDesc[] = { - { "tom_c-h0.rom", 0x20000, 0xa63204b6, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "tom_c-l0.rom", 0x20000, 0xe788002f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "tom_c-h3-", 0x20000, 0x714778b5, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "tom_c-l3-", 0x20000, 0x2f049b03, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "tom_m53.rom", 0x20000, 0x0b83265f, 0x02 | BRF_GRA }, // 4 Sprites - { "tom_m51.rom", 0x20000, 0x8ec5f6f3, 0x02 | BRF_GRA }, // 5 - { "tom_m49.rom", 0x20000, 0xa41d3bfd, 0x02 | BRF_GRA }, // 6 - { "tom_m47.rom", 0x20000, 0x9d81a25b, 0x02 | BRF_GRA }, // 7 - - { "tom_m21.rom", 0x10000, 0x3ca3e771, 0x03 | BRF_GRA }, // 8 Foreground Tiles - { "tom_m22.rom", 0x10000, 0x7a05ee2f, 0x03 | BRF_GRA }, // 9 - { "tom_m20.rom", 0x10000, 0x79aa2335, 0x03 | BRF_GRA }, // 10 - { "tom_m23.rom", 0x10000, 0x789e8b24, 0x03 | BRF_GRA }, // 11 - - { "tom_m26.rom", 0x10000, 0x44626bf6, 0x04 | BRF_GRA }, // 12 Background Tiles - { "tom_m27.rom", 0x10000, 0x464952cf, 0x04 | BRF_GRA }, // 13 - { "tom_m25.rom", 0x10000, 0x3db9b2c7, 0x04 | BRF_GRA }, // 14 - { "tom_m24.rom", 0x10000, 0xf01fe899, 0x04 | BRF_GRA }, // 15 - - { "tom_m44.rom", 0x10000, 0x3ed51d1f, 0x05 | BRF_SND }, // 16 DAC Samples - - { "loht_i8751.mcu", 0x10000, 0x00000000, 0x00 | BRF_OPT | BRF_NODUMP }, // 17 i8751 Code -}; - -STD_ROM_PICK(loht) -STD_ROM_FN(loht) - -static INT32 lohtInit() -{ - install_protection(loht); - - return DrvInit(common_080000_0a0000, sound_ram_map, NULL, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvLoht = { - "loht", NULL, NULL, NULL, "1989", - "Legend of Hero Tonma\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT, 0, - NULL, lohtRomInfo, lohtRomName, NULL, NULL, CommonInputInfo, LohtDIPInfo, - lohtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Legend of Hero Tonma (Japan) - -static struct BurnRomInfo lohtjRomDesc[] = { - { "tom_c-h0-", 0x20000, 0x2a752998, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "tom_c-l0-", 0x20000, 0xa224d928, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "tom_c-h3-", 0x20000, 0x714778b5, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "tom_c-l3-", 0x20000, 0x2f049b03, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "r200", 0x20000, 0x0b83265f, 0x02 | BRF_GRA }, // 4 Sprites - { "r210", 0x20000, 0x8ec5f6f3, 0x02 | BRF_GRA }, // 5 - { "r220", 0x20000, 0xa41d3bfd, 0x02 | BRF_GRA }, // 6 - { "r230", 0x20000, 0x9d81a25b, 0x02 | BRF_GRA }, // 7 - - { "r2a0.a0", 0x10000, 0x3ca3e771, 0x03 | BRF_GRA }, // 8 Foreground Tiles - { "r2a1.a1", 0x10000, 0x7a05ee2f, 0x03 | BRF_GRA }, // 9 - { "r2a2.a2", 0x10000, 0x79aa2335, 0x03 | BRF_GRA }, // 10 - { "r2a3.a3", 0x10000, 0x789e8b24, 0x03 | BRF_GRA }, // 11 - - { "078.b0", 0x10000, 0x44626bf6, 0x04 | BRF_GRA }, // 12 Background Tiles - { "079.b1", 0x10000, 0x464952cf, 0x04 | BRF_GRA }, // 13 - { "080.b2", 0x10000, 0x3db9b2c7, 0x04 | BRF_GRA }, // 14 - { "081.b3", 0x10000, 0xf01fe899, 0x04 | BRF_GRA }, // 15 - - { "082", 0x10000, 0x3ed51d1f, 0x05 | BRF_SND }, // 16 DAC Samples - - { "tom_c-pr.bin", 0x01000, 0x9fa9b496, 0x00 | BRF_OPT }, // 17 i8751 Code -}; - -STD_ROM_PICK(lohtj) -STD_ROM_FN(lohtj) - -struct BurnDriver BurnDrvLohtj = { - "lohtj", "loht", NULL, NULL, "1989", - "Legend of Hero Tonma (Japan)\0", NULL, "Irem", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT, 0, - NULL, lohtjRomInfo, lohtjRomName, NULL, NULL, CommonInputInfo, LohtDIPInfo, - lohtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - -static INT32 lohtbRomLoadCallback() -{ - // Hack the program rom to work for now - UINT8 _0x400[216] = { - 0xFA, 0xB9, 0xFF, 0xFF, 0xE2, 0xFE, 0xB8, 0x17, 0x00, 0xE7, 0x40, 0xB8, 0x20, 0x00, 0xE7, 0x42, - 0xB8, 0x0F, 0x00, 0xE7, 0x42, 0xB8, 0x00, 0xA0, 0x8E, 0xD0, 0x8E, 0xD8, 0xBE, 0x00, 0x3F, 0xB0, - 0x00, 0x88, 0x04, 0x3A, 0x04, 0x75, 0x08, 0x46, 0xFE, 0xC0, 0x75, 0xF5, 0xE9, 0x18, 0x00, 0x33, - 0xF6, 0xE9, 0x03, 0x00, 0xBE, 0x40, 0x00, 0xB8, 0x00, 0xB0, 0x8E, 0xD8, 0xC7, 0x06, 0xFE, 0x0F, - 0x00, 0x00, 0xEA, 0x62, 0x11, 0x00, 0x00, 0xE5, 0x04, 0x0F, 0x19, 0xC0, 0x0F, 0x74, 0xE0, 0xBC, - 0x00, 0x40, 0x33, 0xDB, 0xB9, 0x00, 0x10, 0xB8, 0x00, 0xB0, 0x8E, 0xD8, 0x8A, 0xC3, 0x02, 0xC7, - 0x88, 0x07, 0x43, 0xE2, 0xF7, 0x33, 0xC9, 0xFE, 0xC9, 0x75, 0xFC, 0xFE, 0xCD, 0x75, 0xF8, 0x33, - 0xDB, 0xB9, 0x00, 0x10, 0x8A, 0xC3, 0x02, 0xC7, 0x34, 0xFF, 0x3A, 0x07, 0x75, 0xB6, 0x43, 0xE2, - 0xF3, 0x33, 0xDB, 0xB9, 0xFC, 0x0F, 0xFE, 0x07, 0x43, 0xE2, 0xFB, 0x90, 0x90, 0x90, 0x9A, 0x00, - 0x00, 0x00, 0xB0, 0x73, 0xF6, 0x90, 0x90, 0x90, 0xB8, 0x00, 0xB0, 0x8E, 0xC0, 0x33, 0xD2, 0x42, - 0x81, 0xE2, 0x01, 0x00, 0xBF, 0xB2, 0x04, 0xE8, 0x7B, 0x00, 0xE8, 0x3E, 0x00, 0xEB, 0xF0, 0x90, - 0x90, 0x90, 0x0B, 0x38, 0x29, 0x43, 0x4F, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31, - 0x39, 0x38, 0x39, 0x20, 0x49, 0x52, 0x45, 0x4D, 0x20, 0x43, 0x4F, 0x52, 0x50, 0x4F, 0x52, 0x41, - 0x54, 0x49, 0x4F, 0x4E, 0x0B, 0x50, 0x2B, 0x41 - }; - - memcpy (DrvV30ROM + 0x00400, _0x400, 216); - - DrvV30ROM[0x3FC] = 0x88; - DrvV30ROM[0x3FD] = 0x05; - DrvV30ROM[0xB42] = 0x1E; - DrvV30ROM[0xB43] = 0x06; - DrvV30ROM[0xB44] = 0xB8; - DrvV30ROM[0x405B] = 0x05; - DrvV30ROM[0x4066] = 0x05; - DrvV30ROM[0x103DA] = 0xB0; - DrvV30ROM[0x103DD] = 0xFE; - DrvV30ROM[0x103DE] = 0x06; - DrvV30ROM[0x103DF] = 0xFE; - DrvV30ROM[0x103E0] = 0x0F; - DrvV30ROM[0x103E1] = 0xE5; - DrvV30ROM[0x103E2] = 0x02; - DrvV30ROM[0x103E3] = 0xA9; - DrvV30ROM[0x103E4] = 0x20; - DrvV30ROM[0x103E5] = 0x00; - DrvV30ROM[0x103E6] = 0x75; - DrvV30ROM[0x103E7] = 0x05; - DrvV30ROM[0x103E8] = 0xEA; - DrvV30ROM[0x103E9] = 0x2F; - DrvV30ROM[0x103EA] = 0x04; - DrvV30ROM[0x103EB] = 0x00; - DrvV30ROM[0x103EC] = 0x00; - DrvV30ROM[0x103ED] = 0xB8; - DrvV30ROM[0x10459] = 0xE7; - DrvV30ROM[0x1045A] = 0x04; - DrvV30ROM[0x1045B] = 0xE5; - DrvV30ROM[0x1045C] = 0x02; - DrvV30ROM[0x1045D] = 0x25; - DrvV30ROM[0x1045E] = 0x80; - DrvV30ROM[0x1045F] = 0x00; - DrvV30ROM[0x10460] = 0x74; - DrvV30ROM[0x10461] = 0xF9; - DrvV30ROM[0x10462] = 0x36; - DrvV30ROM[0x10463] = 0xA1; - DrvV30ROM[0x10464] = 0xB2; - DrvV30ROM[0x10465] = 0x23; - DrvV30ROM[0x10466] = 0xE7; - DrvV30ROM[0x10467] = 0x82; - DrvV30ROM[0x10468] = 0x36; - DrvV30ROM[0x10469] = 0xA1; - DrvV30ROM[0x1046A] = 0xB6; - DrvV30ROM[0x1046B] = 0x23; - DrvV30ROM[0x1046C] = 0xE7; - DrvV30ROM[0x104B4] = 0x32; - DrvV30ROM[0x104B5] = 0xE4; - DrvV30ROM[0x104B6] = 0x3C; - DrvV30ROM[0x104B7] = 0x7F; - DrvV30ROM[0x104B8] = 0x72; - DrvV30ROM[0x10577] = 0x47; - DrvV30ROM[0x10578] = 0xDC; - DrvV30ROM[0x10585] = 0x61; - DrvV30ROM[0x10586] = 0x07; - DrvV30ROM[0x10587] = 0x1F; - DrvV30ROM[0x10599] = 0x00; - DrvV30ROM[0x10793] = 0xE7; - DrvV30ROM[0x10794] = 0x02; - DrvV30ROM[0x1E1C0] = 0xBA; - DrvV30ROM[0x1EA29] = 0xE7; - DrvV30ROM[0x1EA2A] = 0x02; - - // invert graphics roms - for (INT32 i = 0; i < 0x80000; i++) { - DrvGfxROM1[i] ^= 0x0f; - DrvGfxROM2[i] ^= 0x0f; - } - - return 0; -} - -// Legend of Hero Tonma (bootleg, set 1) - -static struct BurnRomInfo lohtbRomDesc[] = { - { "lohtb03.b", 0x20000, 0x8b845a70, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "lohtb05.d", 0x20000, 0xe90f7623, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "lohtb02.a", 0x20000, 0x714778b5, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "lohtb04.c", 0x20000, 0x2f049b03, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "lohtb01.02", 0x10000, 0xe4bd8f03, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "lohtb14.11", 0x10000, 0xdf5ac5ee, 0x02 | BRF_GRA }, // 5 Sprites - { "lohtb18.15", 0x10000, 0xd7ecf849, 0x02 | BRF_GRA }, // 6 - { "lohtb15.12", 0x10000, 0x45220b01, 0x02 | BRF_GRA }, // 7 - { "lohtb19.16", 0x10000, 0x35d1a808, 0x02 | BRF_GRA }, // 8 - { "lohtb16.13", 0x10000, 0x25b85cfc, 0x02 | BRF_GRA }, // 9 - { "lohtb20.17", 0x10000, 0x464d8579, 0x02 | BRF_GRA }, // 10 - { "lohtb17.14", 0x10000, 0x763fa4ec, 0x02 | BRF_GRA }, // 11 - { "lohtb21.18", 0x10000, 0xa73568c7, 0x02 | BRF_GRA }, // 12 - - { "lohtb13.10", 0x10000, 0x359f17d4, 0x03 | BRF_GRA }, // 13 Foreground Tiles - { "lohtb11.08", 0x10000, 0x73391e8a, 0x03 | BRF_GRA }, // 14 - { "lohtb09.06", 0x10000, 0x7096d390, 0x03 | BRF_GRA }, // 15 - { "lohtb07.04", 0x10000, 0x71a27b81, 0x03 | BRF_GRA }, // 16 - - { "lohtb12.09", 0x10000, 0x4d5e9b53, 0x04 | BRF_GRA }, // 17 Background Tiles - { "lohtb10.07", 0x10000, 0x4f75a26a, 0x04 | BRF_GRA }, // 18 - { "lohtb08.05", 0x10000, 0x34854262, 0x04 | BRF_GRA }, // 19 - { "lohtb06.03", 0x10000, 0xf923183c, 0x04 | BRF_GRA }, // 20 -}; - -STD_ROM_PICK(lohtb) -STD_ROM_FN(lohtb) - -static INT32 lohtbInit() -{ - install_protection(loht); - - return DrvInit(common_080000_0a0000, sound_ram_map, lohtbRomLoadCallback, Z80_FAKE_NMI, 0); -} - -struct BurnDriver BurnDrvLohtb = { - "lohtb", "loht", NULL, NULL, "1989", - "Legend of Hero Tonma (bootleg, set 1)\0", NULL, "bootleg", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT, 0, - NULL, lohtbRomInfo, lohtbRomName, NULL, NULL, CommonInputInfo, LohtDIPInfo, - lohtbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Legend of Hero Tonma (bootleg, set 2) - -static struct BurnRomInfo lohtb2RomDesc[] = { - { "loht-a2.bin", 0x10000, 0xccc90e54, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "loht-a10.bin", 0x10000, 0x3aa06730, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "loht-a3.bin", 0x10000, 0xff8a98de, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "loht-a11.bin", 0x10000, 0xeab1d7bc, 0x01 | BRF_PRG | BRF_ESS }, // 3 - { "loht-a5.bin", 0x10000, 0x79e007ec, 0x01 | BRF_PRG | BRF_ESS }, // 4 - { "loht-a13.bin", 0x10000, 0xb951346e, 0x01 | BRF_PRG | BRF_ESS }, // 5 - { "loht-a4.bin", 0x10000, 0x254ea4d5, 0x01 | BRF_PRG | BRF_ESS }, // 6 - { "loht-a12.bin", 0x10000, 0xcfb0390d, 0x01 | BRF_PRG | BRF_ESS }, // 7 - - { "loht-a16.bin", 0x10000, 0xdf5ac5ee, 0x02 | BRF_GRA }, // 8 Sprites - { "loht-a17.bin", 0x10000, 0xd7ecf849, 0x02 | BRF_GRA }, // 9 - { "loht-a8.bin", 0x10000, 0x45220b01, 0x02 | BRF_GRA }, // 10 - { "loht-a9.bin", 0x10000, 0x4af9bb3c, 0x02 | BRF_GRA }, // 11 - { "loht-a14.bin", 0x10000, 0x25b85cfc, 0x02 | BRF_GRA }, // 12 - { "loht-a15.bin", 0x10000, 0x464d8579, 0x02 | BRF_GRA }, // 13 - { "loht-a6.bin", 0x10000, 0x763fa4ec, 0x02 | BRF_GRA }, // 14 - { "loht-a7.bin", 0x10000, 0xa73568c7, 0x02 | BRF_GRA }, // 15 - - { "loht-a19.bin", 0x10000, 0x3ca3e771, 0x03 | BRF_GRA }, // 16 Foreground Tiles - { "loht-a20.bin", 0x10000, 0x7a05ee2f, 0x03 | BRF_GRA }, // 17 - { "loht-a18.bin", 0x10000, 0x79aa2335, 0x03 | BRF_GRA }, // 18 - { "loht-a21.bin", 0x10000, 0x789e8b24, 0x03 | BRF_GRA }, // 19 - - { "loht-a24.bin", 0x10000, 0x44626bf6, 0x04 | BRF_GRA }, // 20 Background Tiles - { "loht-a25.bin", 0x10000, 0x464952cf, 0x04 | BRF_GRA }, // 21 - { "loht-a23.bin", 0x10000, 0x3db9b2c7, 0x04 | BRF_GRA }, // 22 - { "loht-a22.bin", 0x10000, 0xf01fe899, 0x04 | BRF_GRA }, // 23 - - { "loht-a1.bin", 0x10000, 0x3ed51d1f, 0x05 | BRF_SND }, // 24 DAC Samples - - { "loht-a26.bin", 0x02000, 0xac901e17, 0x00 | BRF_OPT }, // 25 i8751 Code -}; - -STD_ROM_PICK(lohtb2) -STD_ROM_FN(lohtb2) - -struct BurnDriver BurnDrvLohtb2 = { - "lohtb2", "loht", NULL, NULL, "1989", - "Legend of Hero Tonma (bootleg, set 2)\0", NULL, "bootleg", "M72", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_IREM_M72, GBF_SCRFIGHT, 0, - NULL, lohtb2RomInfo, lohtb2RomName, NULL, NULL, CommonInputInfo, LohtDIPInfo, - lohtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Pound for Pound (World) - -static struct BurnRomInfo poundforRomDesc[] = { - { "ppa-h0-b.9e", 0x20000, 0x50d4a2d8, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "ppa-l0-b.9d", 0x20000, 0xbd997942, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ppa-h1.9f", 0x20000, 0xf6c82f48, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ppa-l1.9c", 0x20000, 0x5b07b087, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ppa-sp.4j", 0x10000, 0x3f458a5b, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ppb-n0.bin", 0x40000, 0x951a41f8, 0x02 | BRF_GRA }, // 5 Sprites - { "ppb-n1.bin", 0x40000, 0xc609b7f2, 0x02 | BRF_GRA }, // 6 - { "ppb-n2.bin", 0x40000, 0x318c0b5f, 0x02 | BRF_GRA }, // 7 - { "ppb-n3.bin", 0x40000, 0x93dc9490, 0x02 | BRF_GRA }, // 8 - - { "ppa-g00.bin", 0x20000, 0x8a88a174, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "ppa-g10.bin", 0x20000, 0xe48a66ac, 0x03 | BRF_GRA }, // 10 - { "ppa-g20.bin", 0x20000, 0x12b93e79, 0x03 | BRF_GRA }, // 11 - { "ppa-g30.bin", 0x20000, 0xfaa39aee, 0x03 | BRF_GRA }, // 12 - - { "ppa-v0.bin", 0x40000, 0x03321664, 0x05 | BRF_SND }, // 13 DAC Samples -}; - -STD_ROM_PICK(poundfor) -STD_ROM_FN(poundfor) - -static INT32 poundforInit() -{ - return DrvInit(rtype2_main_cpu_map, sound_rom_map, NULL, Z80_FAKE_NMI, 4); -} - -struct BurnDriverD BurnDrvPoundfor = { - "poundfor", NULL, NULL, NULL, "1990", - "Pound for Pound (World)\0", NULL, "Irem", "M85", - NULL, NULL, NULL, NULL, - BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_M72, GBF_SPORTSMISC, 0, - NULL, poundforRomInfo, poundforRomName, NULL, NULL, PoundforInputInfo, PoundforDIPInfo, - poundforInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 384, 3, 4 -}; - - -// Pound for Pound (Japan) - -static struct BurnRomInfo poundforjRomDesc[] = { - { "ppa-h0-.9e", 0x20000, 0xf0165e3b, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "ppa-l0-.9d", 0x20000, 0xf954f99f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ppa-h1.9f", 0x20000, 0xf6c82f48, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ppa-l1.9c", 0x20000, 0x5b07b087, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ppa-sp.4j", 0x10000, 0x3f458a5b, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ppb-n0.bin", 0x40000, 0x951a41f8, 0x02 | BRF_GRA }, // 5 Sprites - { "ppb-n1.bin", 0x40000, 0xc609b7f2, 0x02 | BRF_GRA }, // 6 - { "ppb-n2.bin", 0x40000, 0x318c0b5f, 0x02 | BRF_GRA }, // 7 - { "ppb-n3.bin", 0x40000, 0x93dc9490, 0x02 | BRF_GRA }, // 8 - - { "ppa-g00.bin", 0x20000, 0x8a88a174, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "ppa-g10.bin", 0x20000, 0xe48a66ac, 0x03 | BRF_GRA }, // 10 - { "ppa-g20.bin", 0x20000, 0x12b93e79, 0x03 | BRF_GRA }, // 11 - { "ppa-g30.bin", 0x20000, 0xfaa39aee, 0x03 | BRF_GRA }, // 12 - - { "ppa-v0.bin", 0x40000, 0x03321664, 0x05 | BRF_SND }, // 13 DAC Samples -}; - -STD_ROM_PICK(poundforj) -STD_ROM_FN(poundforj) - -struct BurnDriverD BurnDrvPoundforj = { - "poundforj", "poundfor", NULL, NULL, "1990", - "Pound for Pound (Japan)\0", NULL, "Irem", "M85", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_M72, GBF_SPORTSMISC, 0, - NULL, poundforjRomInfo, poundforjRomName, NULL, NULL, PoundforInputInfo, PoundforDIPInfo, - poundforInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 384, 3, 4 -}; - - -// Pound for Pound (US) - -static struct BurnRomInfo poundforuRomDesc[] = { - { "ppa-ho-a.9e", 0x20000, 0xff4c83a4, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "ppa-lo-a.9d", 0x20000, 0x3374ce8f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ppa-h1.9f", 0x20000, 0xf6c82f48, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ppa-l1.9c", 0x20000, 0x5b07b087, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ppa-sp.4j", 0x10000, 0x3f458a5b, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ppb-n0.bin", 0x40000, 0x951a41f8, 0x02 | BRF_GRA }, // 5 Sprites - { "ppb-n1.bin", 0x40000, 0xc609b7f2, 0x02 | BRF_GRA }, // 6 - { "ppb-n2.bin", 0x40000, 0x318c0b5f, 0x02 | BRF_GRA }, // 7 - { "ppb-n3.bin", 0x40000, 0x93dc9490, 0x02 | BRF_GRA }, // 8 - - { "ppa-g00.bin", 0x20000, 0x8a88a174, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "ppa-g10.bin", 0x20000, 0xe48a66ac, 0x03 | BRF_GRA }, // 10 - { "ppa-g20.bin", 0x20000, 0x12b93e79, 0x03 | BRF_GRA }, // 11 - { "ppa-g30.bin", 0x20000, 0xfaa39aee, 0x03 | BRF_GRA }, // 12 - - { "ppa-v0.bin", 0x40000, 0x03321664, 0x05 | BRF_SND }, // 13 DAC Samples -}; - -STD_ROM_PICK(poundforu) -STD_ROM_FN(poundforu) - -struct BurnDriverD BurnDrvPoundforu = { - "poundforu", "poundfor", NULL, NULL, "1990", - "Pound for Pound (US)\0", NULL, "Irem America", "M85", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_M72, GBF_SPORTSMISC, 0, - NULL, poundforuRomInfo, poundforuRomName, NULL, NULL, PoundforInputInfo, PoundforDIPInfo, - poundforInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 384, 3, 4 -}; - - -// Major Title (World) - -static struct BurnRomInfo majtitleRomDesc[] = { - { "mt_h0-a.bin", 0x20000, 0x36aadb67, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "mt_l0-a.bin", 0x20000, 0x2e1b6242, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "mt_h1-a.bin", 0x20000, 0xe1402a22, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "mt_l1-a.bin", 0x20000, 0x0efa409a, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "mt_sp.bin", 0x10000, 0xe44260a9, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "mt_n0.bin", 0x40000, 0x5618cddc, 0x02 | BRF_GRA }, // 5 Sprites - { "mt_n1.bin", 0x40000, 0x483b873b, 0x02 | BRF_GRA }, // 6 - { "mt_n2.bin", 0x40000, 0x4f5d665b, 0x02 | BRF_GRA }, // 7 - { "mt_n3.bin", 0x40000, 0x83571549, 0x02 | BRF_GRA }, // 8 - - { "mt_c0.bin", 0x20000, 0x780e7a02, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "mt_c1.bin", 0x20000, 0x45ad1381, 0x03 | BRF_GRA }, // 10 - { "mt_c2.bin", 0x20000, 0x5df5856d, 0x03 | BRF_GRA }, // 11 - { "mt_c3.bin", 0x20000, 0xf5316cc8, 0x03 | BRF_GRA }, // 12 - - { "mt_f0.bin", 0x20000, 0x2d5e05d5, 0x0e | BRF_GRA }, // 13 Sprites - { "mt_f1.bin", 0x20000, 0xc68cd65f, 0x0e | BRF_GRA }, // 14 - { "mt_f2.bin", 0x20000, 0xa71feb2d, 0x0e | BRF_GRA }, // 15 - { "mt_f3.bin", 0x20000, 0x179f7562, 0x0e | BRF_GRA }, // 16 - - { "mt_vo.bin", 0x20000, 0xeb24bb2c, 0x05 | BRF_SND }, // 17 DAC Samples -}; - -STD_ROM_PICK(majtitle) -STD_ROM_FN(majtitle) - -static INT32 majtitleInit() -{ - return DrvInit(majtitle_main_cpu_map, sound_rom_map, NULL, Z80_REAL_NMI, 3); -} - -struct BurnDriver BurnDrvMajtitle = { - "majtitle", NULL, NULL, NULL, "1990", - "Major Title (World)\0", "Graphics issues", "Irem", "M84", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M72, GBF_SPORTSMISC, 0, - NULL, majtitleRomInfo, majtitleRomName, NULL, NULL, CommonInputInfo, Rtype2DIPInfo, - majtitleInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; - - -// Major Title (Japan) - -static struct BurnRomInfo majtitlejRomDesc[] = { - { "mt_h0.bin", 0x20000, 0xb9682c70, 0x01 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "mt_l0.bin", 0x20000, 0x702c9fd6, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "mt_h1.bin", 0x20000, 0xd9e97c30, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "mt_l1.bin", 0x20000, 0x8dbd91b5, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "mt_sp.bin", 0x10000, 0xe44260a9, 0x06 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "mt_n0.bin", 0x40000, 0x5618cddc, 0x02 | BRF_GRA }, // 5 Sprites - { "mt_n1.bin", 0x40000, 0x483b873b, 0x02 | BRF_GRA }, // 6 - { "mt_n2.bin", 0x40000, 0x4f5d665b, 0x02 | BRF_GRA }, // 7 - { "mt_n3.bin", 0x40000, 0x83571549, 0x02 | BRF_GRA }, // 8 - - { "mt_c0.bin", 0x20000, 0x780e7a02, 0x03 | BRF_GRA }, // 9 Foreground & Background Tiles - { "mt_c1.bin", 0x20000, 0x45ad1381, 0x03 | BRF_GRA }, // 10 - { "mt_c2.bin", 0x20000, 0x5df5856d, 0x03 | BRF_GRA }, // 11 - { "mt_c3.bin", 0x20000, 0xf5316cc8, 0x03 | BRF_GRA }, // 12 - - { "mt_f0.bin", 0x20000, 0x2d5e05d5, 0x0e | BRF_GRA }, // 13 Sprites - { "mt_f1.bin", 0x20000, 0xc68cd65f, 0x0e | BRF_GRA }, // 14 - { "mt_f2.bin", 0x20000, 0xa71feb2d, 0x0e | BRF_GRA }, // 15 - { "mt_f3.bin", 0x20000, 0x179f7562, 0x0e | BRF_GRA }, // 16 - - { "mt_vo.bin", 0x20000, 0xeb24bb2c, 0x05 | BRF_SND }, // 17 DAC Samples -}; - -STD_ROM_PICK(majtitlej) -STD_ROM_FN(majtitlej) - -struct BurnDriver BurnDrvMajtitlej = { - "majtitlej", "majtitle", NULL, NULL, "1990", - "Major Title (Japan)\0", "Graphics issues", "Irem", "M84", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M72, GBF_SPORTSMISC, 0, - NULL, majtitlejRomInfo, majtitlejRomName, NULL, NULL, CommonInputInfo, Rtype2DIPInfo, - majtitleInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 384, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/irem/d_m90.cpp b/jan/src/burn/drv/irem/d_m90.cpp deleted file mode 100644 index a8d9d4e74..000000000 --- a/jan/src/burn/drv/irem/d_m90.cpp +++ /dev/null @@ -1,1848 +0,0 @@ -// FB Alpha Irem M90 driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "nec_intf.h" -#include "irem_cpu.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvV30ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvV30RAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; - -static UINT8 *m90_video_control; - -static UINT8 *RamPrioBitmap; - -static UINT8 *soundlatch; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 irqvector; -static INT32 sample_address; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static INT32 vblank; -static INT32 code_mask[2]; -static INT32 video_offsets[2] = { 0, 0 }; - -enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, Z80_ASSERT, Z80_CLEAR }; - -static struct BurnInputInfo p4commonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy4 + 5, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy4 + 4, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 3, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 2, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 0, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 7, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 6, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy5 + 5, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy5 + 4, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy5 + 3, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy5 + 2, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy5 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy5 + 0, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 7, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 6, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(p4common) - -static struct BurnInputInfo p2commonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(p2common) - -static struct BurnInputInfo Quizf1InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Quizf1) - -static struct BurnInputInfo Matchit2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Matchit2) - -static struct BurnDIPInfo DynablstDIPList[]= -{ - {0x22, 0xff, 0xff, 0xbf, NULL }, - {0x23, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x22, 0x01, 0x03, 0x02, "2" }, - {0x22, 0x01, 0x03, 0x03, "3" }, - {0x22, 0x01, 0x03, 0x01, "4" }, - {0x22, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x0c, 0x08, "Easy" }, - {0x22, 0x01, 0x0c, 0x0c, "Medium" }, - {0x22, 0x01, 0x0c, 0x04, "Hard" }, - {0x22, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Game Title" }, - {0x22, 0x01, 0x10, 0x10, "Dynablaster" }, - {0x22, 0x01, 0x10, 0x00, "Bomber Man" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x22, 0x01, 0x20, 0x00, "No" }, - {0x22, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x40, 0x40, "Off" }, - {0x22, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Cabinet" }, - {0x23, 0x01, 0x06, 0x04, "2 Player Upright" }, - {0x23, 0x01, 0x06, 0x06, "4 Player Upright A" }, - {0x23, 0x01, 0x06, 0x02, "4 Player Upright B" }, - {0x23, 0x01, 0x06, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x23, 0x01, 0x08, 0x08, "1" }, - {0x23, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x23, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Dynablst) - -static struct BurnDIPInfo AtompunkDIPList[]= -{ - {0x22, 0xff, 0xff, 0xbf, NULL }, - {0x23, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x22, 0x01, 0x03, 0x02, "2" }, - {0x22, 0x01, 0x03, 0x03, "3" }, - {0x22, 0x01, 0x03, 0x01, "4" }, - {0x22, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x0c, 0x08, "Easy" }, - {0x22, 0x01, 0x0c, 0x0c, "Medium" }, - {0x22, 0x01, 0x0c, 0x04, "Hard" }, - {0x22, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x22, 0x01, 0x10, 0x10, "Off" }, - {0x22, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x22, 0x01, 0x20, 0x00, "No" }, - {0x22, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x40, 0x40, "Off" }, - {0x22, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Cabinet" }, - {0x23, 0x01, 0x06, 0x04, "2 Player Upright" }, - {0x23, 0x01, 0x06, 0x06, "4 Player Upright A" }, - {0x23, 0x01, 0x06, 0x02, "4 Player Upright B" }, - {0x23, 0x01, 0x06, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x23, 0x01, 0x08, 0x08, "1" }, - {0x23, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x23, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Atompunk) - -static struct BurnDIPInfo BombrmanDIPList[]= -{ - {0x12, 0xff, 0xff, 0xaf, NULL }, - {0x13, 0xff, 0xff, 0xf9, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Medium" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Bombrman) - -static struct BurnDIPInfo HasamuDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Hasamu) - -static struct BurnDIPInfo RiskchalDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Medium" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x13, 0x01, 0x04, 0x04, "Common" }, - {0x13, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Riskchal) - -static struct BurnDIPInfo BbmanwDIPList[]= -{ - {0x22, 0xff, 0xff, 0xbf, NULL }, - {0x23, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x22, 0x01, 0x03, 0x02, "2" }, - {0x22, 0x01, 0x03, 0x03, "3" }, - {0x22, 0x01, 0x03, 0x01, "4" }, - {0x22, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x0c, 0x08, "Easy" }, - {0x22, 0x01, 0x0c, 0x0c, "Medium" }, - {0x22, 0x01, 0x0c, 0x04, "Hard" }, - {0x22, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Game Title" }, - {0x22, 0x01, 0x10, 0x10, "Bomber Man World" }, - {0x22, 0x01, 0x10, 0x00, "New Dyna Blaster Global Quest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x22, 0x01, 0x20, 0x00, "No" }, - {0x22, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x40, 0x40, "Off" }, - {0x22, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Cabinet" }, - {0x23, 0x01, 0x06, 0x04, "2 Player" }, - {0x23, 0x01, 0x06, 0x06, "4 Player Seprate Coins" }, - {0x23, 0x01, 0x06, 0x02, "4 Player Shared Coins" }, - {0x23, 0x01, 0x06, 0x00, "4 Player 1&2 3&4 Share Coins" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x23, 0x01, 0x08, 0x08, "1" }, - {0x23, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x23, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Bbmanw) - -static struct BurnDIPInfo BbmanwjDIPList[]= -{ - {0x22, 0xff, 0xff, 0xbf, NULL }, - {0x23, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x22, 0x01, 0x03, 0x02, "2" }, - {0x22, 0x01, 0x03, 0x03, "3" }, - {0x22, 0x01, 0x03, 0x01, "4" }, - {0x22, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x0c, 0x08, "Easy" }, - {0x22, 0x01, 0x0c, 0x0c, "Medium" }, - {0x22, 0x01, 0x0c, 0x04, "Hard" }, - {0x22, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x22, 0x01, 0x20, 0x00, "No" }, - {0x22, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x40, 0x40, "Off" }, - {0x22, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Cabinet" }, - {0x23, 0x01, 0x06, 0x04, "2 Player" }, - {0x23, 0x01, 0x06, 0x06, "4 Player Seprate Coins" }, - {0x23, 0x01, 0x06, 0x02, "4 Player Shared Coins" }, - {0x23, 0x01, 0x06, 0x00, "4 Player 1&2 3&4 Share Coins" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x23, 0x01, 0x08, 0x08, "1" }, - {0x23, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x23, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Bbmanwj) - -static struct BurnDIPInfo Quizf1DIPList[]= -{ - {0x16, 0xff, 0xff, 0x9f, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Input Device" }, - {0x16, 0x01, 0x20, 0x20, "Joystick" }, - {0x16, 0x01, 0x20, 0x00, "Buttons" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x17, 0x01, 0x08, 0x08, "1" }, - {0x17, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x17, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x17, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x17, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x17, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x17, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x17, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x17, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x17, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x17, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x17, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x17, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x17, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x17, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x17, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x17, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x17, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Quizf1) - -static struct BurnDIPInfo Matchit2DIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Girls Mode" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "China Tiles" }, - {0x14, 0x01, 0x02, 0x02, "Mahjong" }, - {0x14, 0x01, 0x02, 0x00, "Alpha-Numeric" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x00, "Very Hard" }, - {0x14, 0x01, 0x0c, 0x04, "Hard" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x08, "Easy" }, - - {0 , 0xfe, 0 , 4, "Timer Speed" }, - {0x14, 0x01, 0x30, 0x00, "Very Hard" }, - {0x14, 0x01, 0x30, 0x10, "Hard" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - {0x14, 0x01, 0x30, 0x20, "Easy" }, - - {0 , 0xfe, 0 , 2, "Title Screen" }, - {0x14, 0x01, 0x40, 0x40, "Match It II" }, - {0x14, 0x01, 0x40, 0x00, "Shisensho II" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Language" }, - {0x15, 0x01, 0x06, 0x06, "English" }, - {0x15, 0x01, 0x06, 0x04, "German" }, - {0x15, 0x01, 0x06, 0x02, "Korean" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x15, 0x01, 0x08, 0x08, "1" }, - {0x15, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x15, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Matchit2) - -static struct BurnDIPInfo Shisen2DIPList[]= -{ - {0x14, 0xff, 0xff, 0xbf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Girls Mode" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x00, "Very Hard" }, - {0x14, 0x01, 0x0c, 0x04, "Hard" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x08, "Easy" }, - - {0 , 0xfe, 0 , 4, "Timer Speed" }, - {0x14, 0x01, 0x30, 0x00, "Very Hard" }, - {0x14, 0x01, 0x30, 0x10, "Hard" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - {0x14, 0x01, 0x30, 0x20, "Easy" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x15, 0x01, 0x08, 0x08, "1" }, - {0x15, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x15, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Shisen2) - -static void setvector_callback(INT32 param) -{ - switch (param) - { - case VECTOR_INIT: irqvector = 0xff; break; - case YM2151_ASSERT: irqvector &= 0xef; break; - case YM2151_CLEAR: irqvector |= 0x10; break; - case Z80_ASSERT: irqvector &= 0xdf; break; - case Z80_CLEAR: irqvector |= 0x20; break; - } - - ZetSetVector(irqvector); - ZetSetIRQLine(0, (irqvector == 0xff) ? CPU_IRQSTATUS_NONE : CPU_IRQSTATUS_ACK); -} - -static inline void update_palette_entry(INT32 entry) -{ - UINT16 d = *((UINT16*)(DrvPalRAM + entry)); - -#ifndef LSB_FIRST - d = BURN_ENDIAN_SWAP_INT16(d); -#endif - - UINT8 r = (d >> 0) & 0x1f; - UINT8 g = (d >> 5) & 0x1f; - UINT8 b = (d >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[entry / 2] = BurnHighCol(r, g, b, 0); -} - -void __fastcall m90_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xffc00) == 0xe0000) { - DrvPalRAM[address & 0x3ff] = data; - update_palette_entry(address & 0x3fe); - return; - } -} - -UINT8 __fastcall m90_main_read(UINT32 /*address*/) -{ - return 0; -} - -void __fastcall m90_main_write_port(UINT32 port, UINT8 data) -{ - if ((port & ~0x0f) == 0x80) { - m90_video_control[port & 0x0f] = data; - return; - } - - switch (port) - { - case 0x00: - // case 0x01: - *soundlatch = data; - setvector_callback(Z80_ASSERT); - return; - - case 0x02: - // case 0x03: - // coin counter - return; - - case 0x04: - //case 0x05: - { - INT32 bankaddress = 0x100000 + 0x10000 * (data & 0x0f); - VezMapArea(0x80000, 0x8ffff, 0, DrvV30ROM + bankaddress); - VezMapArea(0x80000, 0x8ffff, 2, DrvV30ROM + bankaddress); - } - return; - - case 0x90: - // case 0x91: // nop dynablsb - return; - - //default: - // bprintf (0, _T("Writing %2.2x to port %2.2x wp\n"), data, port); - // break; - } -} - -UINT8 __fastcall m90_main_read_port(UINT32 port) -{ - switch (port) - { - case 0x00: return DrvInputs[0]; - case 0x01: return DrvInputs[1]; - case 0x02: return (DrvInputs[2] & 0x7f) | vblank; // system - // case 0x03: return 0xff; // ? - case 0x04: return DrvDips[0]; - case 0x05: return DrvDips[1]; - case 0x06: return DrvInputs[3]; - case 0x07: return DrvInputs[4]; - - //default: - // bprintf (0, _T("Reading port: %2.2x\n"), port); - // break; - } - - return 0; -} - -void __fastcall m90_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x40: // bbmanw - BurnYM2151SelectRegister(data); - return; - - case 0x01: - case 0x41: // bbmanw - BurnYM2151WriteRegister(data); - return; - - case 0x80: - sample_address >>= 5; - sample_address = (sample_address & 0x00ff) | (data << 8); - sample_address <<= 5; - return; - - case 0x81: - sample_address >>= 5; - sample_address = (sample_address & 0xff00) | (data << 0); - sample_address <<= 5; - return; - - case 0x82: - DACSignedWrite(0, data); - sample_address = (sample_address + 1) & 0x3ffff; - return; - - case 0x42: // bbmanw - case 0x83: - setvector_callback(Z80_CLEAR); - return; - } -} - -UINT8 __fastcall m90_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x40: // bbmanw - case 0x41: - return BurnYM2151ReadStatus(); - - case 0x42: // bbmanw - case 0x80: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0x84: - return DrvSndROM[sample_address & 0x3fff]; - } - - return 0; -} - -static void m72YM2151IRQHandler(INT32 nStatus) -{ - setvector_callback(nStatus ? YM2151_ASSERT : YM2151_CLEAR); -} - -static INT32 m90SyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3579545.000 / (nBurnFPS / 100.000)))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - VezOpen(0); - VezReset(); - VezClose(); - - ZetOpen(0); - ZetReset(); - setvector_callback(VECTOR_INIT); - ZetClose(); - - BurnYM2151Reset(); - DACReset(); - - sample_address = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvV30ROM = Next; Next += 0x200000; - DrvZ80ROM = Next; Next += 0x010000; - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvSndROM = Next; Next += 0x180000; - - RamPrioBitmap = Next; Next += nScreenWidth * nScreenHeight; - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x010000; - DrvV30RAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x000800; - DrvZ80RAM = Next; Next += 0x001000; - - soundlatch = Next; Next += 0x000004; // 1 - - m90_video_control = Next; Next += 0x000010; - - RamEnd = Next; - - DrvPalette = (UINT32 *) Next; Next += 0x0200 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvLoadRoms(INT32 codesize, INT32 samples, INT32 bank) -{ - if (BurnLoadRom(DrvV30ROM + 1, 0, 2)) return 1; - if (BurnLoadRom(DrvV30ROM + 0, 1, 2)) return 1; - - if (codesize == 0x40000) { - memcpy (DrvV30ROM + 0x7fff0, DrvV30ROM + 0x3fff0, 0x10); - } - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 6, 1)) return 1; - - if (samples) { - if (BurnLoadRom(DrvSndROM, 7, 1)) return 1; - - if (samples < 0x40000) { - memcpy (DrvSndROM + 0x20000, DrvSndROM + 0x00000, 0x20000); - } - } - - if (bank) { - if (BurnLoadRom(DrvV30ROM + 0x100001, 8, 2)) return 1; - if (BurnLoadRom(DrvV30ROM + 0x100000, 9, 2)) return 1; - } - - return 0; -} - -static void map_main_cpu(UINT8 *decrypt_table, INT32 codesize, INT32 spriteram) -{ - VezInit(0, V35_TYPE, 32000000/2); - - VezOpen(0); - if (decrypt_table != NULL) { - VezSetDecode(decrypt_table); - } - - VezMapArea(0x00000, (codesize-1), 0, DrvV30ROM + 0x000000); - VezMapArea(0x00000, (codesize-1), 2, DrvV30ROM + 0x000000); - VezMapArea(0x80000, 0x8ffff, 0, DrvV30ROM + 0x100000); - VezMapArea(0x80000, 0x8ffff, 2, DrvV30ROM + 0x100000); - VezMapArea(0xa0000, 0xa3fff, 0, DrvV30RAM); - VezMapArea(0xa0000, 0xa3fff, 1, DrvV30RAM); - VezMapArea(0xa0000, 0xa3fff, 2, DrvV30RAM); - VezMapArea(0xd0000, 0xdffff, 0, DrvVidRAM); - VezMapArea(0xd0000, 0xdffff, 1, DrvVidRAM); - VezMapArea(0xd0000, 0xdffff, 2, DrvVidRAM); - VezMapArea(0xe0000, 0xe07ff, 0, DrvPalRAM); -// VezMapArea(0xe0000, 0xe07ff, 1, DrvPalRAM); - VezMapArea(0xe0000, 0xe07ff, 2, DrvPalRAM); - VezMapArea(0xff800, 0xfffff, 0, DrvV30ROM + 0x07f800); - VezMapArea(0xff800, 0xfffff, 2, DrvV30ROM + 0x07f800); - - if (spriteram) { - VezMapArea(0x00000 + spriteram, 0x00fff + spriteram, 0, DrvSprRAM); // 00e - fff // ?? - VezMapArea(0x00000 + spriteram, 0x00fff + spriteram, 1, DrvSprRAM); - VezMapArea(0x00000 + spriteram, 0x00fff + spriteram, 2, DrvSprRAM); - } - - VezSetReadHandler(m90_main_read); - VezSetWriteHandler(m90_main_write); - VezSetReadPort(m90_main_read_port); - VezSetWritePort(m90_main_write_port); - VezClose(); -} - -static void DrvGfxDecode() -{ - INT32 Plane[4] = { 0x180000 * 8, 0x100000 * 8, 0x080000 * 8, 0x000000 * 8 }; - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x10000, 4, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - GfxDecode(0x04000, 4, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); -} - -static INT32 DrvInit(INT32 codesize, INT32 gfxlen, INT32 samples, INT32 bank, INT32 spriteram, const UINT8 *decrypt_table) -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvLoadRoms(codesize, samples, bank)) return 1; - - DrvGfxDecode(); - - map_main_cpu((UINT8*)decrypt_table, codesize, spriteram); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80RAM); - ZetSetOutHandler(m90_sound_write_port); - ZetSetInHandler(m90_sound_read_port); - ZetClose(); - - BurnYM2151Init(3579545); - YM2151SetIrqHandler(0, &m72YM2151IRQHandler); - BurnYM2151SetAllRoutes(0.15, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, m90SyncDAC); - DACSetRoute(0, 0.10, BURN_SND_ROUTE_BOTH); - - code_mask[0] = ((gfxlen * 2) - 1) / (8 * 8); - code_mask[1] = ((gfxlen * 2) - 1) / (16 * 16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2151Exit(); - DACExit(); - - ZetExit(); - VezExit(); - - BurnFree(AllMem); - - video_offsets[0] = video_offsets[1] = 0; - - return 0; -} - -static void RenderTilePrio(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, UINT8 *pri, INT32 prio) -{ - if (sx <= (0-width) || sx >= nScreenWidth || sy <= (0-height) || sy >= nScreenHeight) return; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - if (pxl == 0) continue; - - if ((prio & (1 << pri[sy * nScreenWidth + sx])) == 0) { - dest[sy * nScreenWidth + sx] = pxl | color; - pri[sy * nScreenWidth + sx] = 7; - } - } - - sx -= width; - } -} - -static void draw_sprites() -{ - INT32 pri_ctrl = m90_video_control[14] & 0x03; - UINT16 *sram = (UINT16*)(DrvVidRAM + 0xee00); - - for (INT32 offs = 0x1f2/2; offs >= 0; offs -= 3) - { - INT32 sy = BURN_ENDIAN_SWAP_INT16(sram[offs + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(sram[offs + 1]); - INT32 sx = BURN_ENDIAN_SWAP_INT16(sram[offs + 2]); - - INT32 flipy = sy & 0x8000; - INT32 flipx = sx & 0x0200; - INT32 multi = 1 << ((sy & 0x6000) >> 13); - INT32 color = (sy >> 9) & 0x0f; - - sx = ((sx - video_offsets[0]) & 0x1ff) - 16; - sy = (512 - ((sy + video_offsets[1]) & 0x1ff)) - (16 * multi); - - INT32 prio = 0x82; - if (pri_ctrl & 0x01) { - if ((color & 0x08) == 0x08) prio = 0x80; - } else if (pri_ctrl & 0x02) { - if ((color & 0x0c) == 0x0c) prio = 0x80; - } - - for (INT32 i = 0; i < multi; i++) { - RenderTilePrio(pTransDraw, DrvGfxROM1, (code + (flipy ? multi-1 - i : i)) & code_mask[1], (color << 4)|0x100, sx, sy+i*16, flipx, flipy, 16, 16, RamPrioBitmap, prio); - } - } -} - -static void draw_layer(INT32 layer) -{ - INT32 control = m90_video_control[10 + (layer * 2)]; - - if (control & 0x10) return; // disable layer - - INT32 enable_rowscroll = control & 0x20; - INT32 enable_colscroll = control & 0x40; - - INT32 wide = (control & 0x04) ? 128 : 64; - - INT32 trans = layer ? 0xff : 0; - - INT32 pmask = (wide == 128) ? 2 : 3; - UINT16 *vram = (UINT16*)(DrvVidRAM + (control & pmask) * 0x4000); - - UINT16 scrollx = ((m90_video_control[(layer*4)+2] << 0) | (m90_video_control[(layer*4)+3] << 8)) + video_offsets[0]; - UINT16 scrolly = ((m90_video_control[(layer*4)+0] << 0) | (m90_video_control[(layer*4)+1] << 8)) + video_offsets[1]; - - scrollx += layer ? -2 : 2; - scrollx += ((wide & 0x80) * 2); - - UINT16 *xscroll = (UINT16*)(DrvVidRAM + 0xf000 + (layer * 0x400)); - UINT16 *yscroll = (UINT16*)(DrvVidRAM + 0xf800 + (layer * 0x400)); - - for (INT32 sy = 0; sy < nScreenHeight; sy++) - { - INT32 scrollx_1 = scrollx; - INT32 scrolly_1 = 0; - UINT16 *dest = pTransDraw + (sy * nScreenWidth); - UINT8 *pri = RamPrioBitmap + (sy * nScreenWidth); - - if (enable_rowscroll) scrollx_1 += BURN_ENDIAN_SWAP_INT16(xscroll[sy]); - - if (enable_colscroll) { - scrolly_1 += (scrolly + sy + BURN_ENDIAN_SWAP_INT16(yscroll[sy]) + 128) & 0x1ff; - } else { - scrolly_1 += (scrolly + sy) & 0x1ff; - } - - INT32 romoff_1 = (scrolly_1 & 0x07) << 3; - - for (INT32 sx = 0; sx < nScreenWidth + 8; sx+=8) - { - INT32 scrollx_2 = (scrollx_1 + sx) & ((wide * 8) - 1); - - INT32 offs = ((scrolly_1 / 8) * wide) | (scrollx_2 / 8); - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 0]) & code_mask[0]; - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 1]); - - INT32 flipy = color & 0x80; - INT32 flipx = color & 0x40; - INT32 group =(color & 0x30) ? 0 : 1; - color &= 0x0f; - - { - color <<= 4; - INT32 x_xor = 0; - INT32 romoff = romoff_1; - if (flipy) romoff ^= 0x38; - if (flipx) x_xor = 7; - - UINT8 *rom = DrvGfxROM0 + (code * 0x40) + romoff; - - INT32 xx = sx - (scrollx_2&0x7); - - for (INT32 x = 0; x < 8; x++, xx++) { - if (xx < 0 || xx >= nScreenWidth) continue; - - INT32 pxl = rom[x ^ x_xor]; - if (pxl == trans) continue; - - dest[xx] = pxl | color; - pri[xx] = 1 << group; - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i+=2) { - update_palette_entry(i); - } - DrvRecalc = 0; - } - - if ((m90_video_control[14] & 0x04) == 0) { - if (m90_video_control[12] & 0x10) { - memset (RamPrioBitmap, 0, nScreenWidth * nScreenHeight); - BurnTransferClear(); - } else { - if (nBurnLayer & 1) draw_layer(1); - } - - if (nBurnLayer & 2) draw_layer(0); - - if (nBurnLayer & 4) draw_sprites(); - } else { - BurnTransferClear(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void compile_inputs() -{ - memset (DrvInputs, 0xff, 5); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - compile_inputs(); - - INT32 nInterleave = 128; // nmi pulses for sound cpu - INT32 nCyclesTotal[2]; - INT32 nCyclesDone[2]; - - // overclocking... - nCyclesTotal[0] = (INT32)((INT64)(8000000 / 60) * nBurnCPUSpeedAdjust / 0x0100); - nCyclesTotal[1] = (INT32)((INT64)(3579545 / 60) * nBurnCPUSpeedAdjust / 0x0100); - nCyclesDone[0] = nCyclesDone[1] = 0; - - VezNewFrame(); - ZetNewFrame(); - - VezOpen(0); - ZetOpen(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += VezRun(nCyclesTotal[0] / nInterleave); - - if (i == (nInterleave - 1)) - { - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP0, 0xff, CPU_IRQSTATUS_ACK); - VezRun(0); - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP0, 0xff, CPU_IRQSTATUS_NONE); - } - - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - ZetNmi(); - - if (i == 124) vblank = 0x80; - } - - if (pBurnSoundOut) { - BurnYM2151Render(pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - VezClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - - -// Hasamu (Japan) - -static struct BurnRomInfo hasamuRomDesc[] = { - { "hasc-p1.bin", 0x20000, 0x53df9834, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "hasc-p0.bin", 0x20000, 0xdff0ba6e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "hasc-sp.bin", 0x10000, 0x259b1687, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "hasc-c0.bin", 0x20000, 0xdd5a2174, 3 | BRF_GRA }, // 3 Tiles and sprites - { "hasc-c1.bin", 0x20000, 0x76b8217c, 3 | BRF_GRA }, // 4 - { "hasc-c2.bin", 0x20000, 0xd90f9a68, 3 | BRF_GRA }, // 5 - { "hasc-c3.bin", 0x20000, 0x6cfe0d39, 3 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(hasamu) -STD_ROM_FN(hasamu) - -static INT32 hasamuInit() -{ - video_offsets[0] = 48; - video_offsets[1] = 136; - return DrvInit(0x40000, 0x80000, 0x00000, 0, 0, gunforce_decryption_table); -} - -struct BurnDriver BurnDrvHasamu = { - "hasamu", NULL, NULL, NULL, "1991", - "Hasamu (Japan)\0", NULL, "Irem", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, hasamuRomInfo, hasamuRomName, NULL, NULL, p2commonInputInfo, HasamuDIPInfo, - hasamuInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; - - -// Dynablaster / Bomber Man - -static struct BurnRomInfo dynablstRomDesc[] = { - { "bbm-cp1e.62", 0x20000, 0x27667681, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "bbm-cp0e.65", 0x20000, 0x95db7a67, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bbm-sp.23", 0x10000, 0x251090cd, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bbm-c0.66", 0x40000, 0x695d2019, 3 | BRF_GRA }, // 3 Tiles and sprites - { "bbm-c1.67", 0x40000, 0x4c7c8bbc, 3 | BRF_GRA }, // 4 - { "bbm-c2.68", 0x40000, 0x0700d406, 3 | BRF_GRA }, // 5 - { "bbm-c3.69", 0x40000, 0x3c3613af, 3 | BRF_GRA }, // 6 - - { "bbm-v0.20", 0x20000, 0x0fa803fe, 4 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(dynablst) -STD_ROM_FN(dynablst) - -static INT32 dynablstInit() -{ - video_offsets[0] = 80; - video_offsets[1] = 136; - return DrvInit(0x40000, 0x100000, 0x20000, 0, 0, bomberman_decryption_table); -} - -struct BurnDriver BurnDrvDynablst = { - "dynablst", NULL, NULL, NULL, "1991", - "Dynablaster / Bomber Man\0", NULL, "Irem (licensed from Hudson Soft)", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, dynablstRomInfo, dynablstRomName, NULL, NULL, p4commonInputInfo, DynablstDIPInfo, - dynablstInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// Bomber Man (Japan) - -static struct BurnRomInfo bombrmanRomDesc[] = { - { "bbm-p1.62", 0x20000, 0x982bd166, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "bbm-p0.65", 0x20000, 0x0a20afcc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bbm-sp.23", 0x10000, 0x251090cd, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bbm-c0.66", 0x40000, 0x695d2019, 3 | BRF_GRA }, // 3 Tiles and sprites - { "bbm-c1.67", 0x40000, 0x4c7c8bbc, 3 | BRF_GRA }, // 4 - { "bbm-c2.68", 0x40000, 0x0700d406, 3 | BRF_GRA }, // 5 - { "bbm-c3.69", 0x40000, 0x3c3613af, 3 | BRF_GRA }, // 6 - - { "bbm-v0.20", 0x20000, 0x0fa803fe, 4 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(bombrman) -STD_ROM_FN(bombrman) - -struct BurnDriver BurnDrvBombrman = { - "bombrman", "dynablst", NULL, NULL, "1991", - "Bomber Man (Japan)\0", NULL, "Irem (licensed from Hudson Soft)", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, bombrmanRomInfo, bombrmanRomName, NULL, NULL, p2commonInputInfo, BombrmanDIPInfo, - dynablstInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// Atomic Punk (US) - -static struct BurnRomInfo atompunkRomDesc[] = { - { "bbm-cp0d.65", 0x20000, 0x860c0479, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "bbm-cp1d.62", 0x20000, 0xbe57bf74, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bbm-sp.23", 0x10000, 0x251090cd, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bbm-c0.66", 0x40000, 0x695d2019, 3 | BRF_GRA }, // 3 Tiles and sprites - { "bbm-c1.67", 0x40000, 0x4c7c8bbc, 3 | BRF_GRA }, // 4 - { "bbm-c2.68", 0x40000, 0x0700d406, 3 | BRF_GRA }, // 5 - { "bbm-c3.69", 0x40000, 0x3c3613af, 3 | BRF_GRA }, // 6 - - { "bbm-v0.20", 0x20000, 0x0fa803fe, 4 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(atompunk) -STD_ROM_FN(atompunk) - -struct BurnDriver BurnDrvAtompunk = { - "atompunk", "dynablst", NULL, NULL, "1991", - "Atomic Punk (US)\0", NULL, "Irem America (licensed from Hudson Soft)", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, atompunkRomInfo, atompunkRomName, NULL, NULL, p4commonInputInfo, AtompunkDIPInfo, - dynablstInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// Bomber Man World / New Dyna Blaster - Global Quest - -static struct BurnRomInfo bbmanwRomDesc[] = { - { "bbm2-h0-b.77", 0x40000, 0x567d3709, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "bbm2-l0-b.79", 0x40000, 0xe762c22b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bbm2-sp.33", 0x10000, 0x6bc1689e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bbm2-c0.81", 0x40000, 0xe7ce058a, 3 | BRF_GRA }, // 3 Tiles and sprites - { "bbm2-c1.82", 0x40000, 0x636a78a9, 3 | BRF_GRA }, // 4 - { "bbm2-c2.83", 0x40000, 0x9ac2142f, 3 | BRF_GRA }, // 5 - { "bbm2-c3.84", 0x40000, 0x47af1750, 3 | BRF_GRA }, // 6 - - { "bbm2-v0.30", 0x20000, 0x4ad889ed, 4 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(bbmanw) -STD_ROM_FN(bbmanw) - -static INT32 bbmanwInit() -{ - video_offsets[0] = 80; - video_offsets[1] = 136; - return DrvInit(0x80000, 0x100000, 0x20000, 0, 0, dynablaster_decryption_table); -} - -struct BurnDriver BurnDrvBbmanw = { - "bbmanw", NULL, NULL, NULL, "1992", - "Bomber Man World / New Dyna Blaster - Global Quest\0", NULL, "Irem", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, bbmanwRomInfo, bbmanwRomName, NULL, NULL, p4commonInputInfo, BbmanwDIPInfo, - bbmanwInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// Bomber Man World (Japan) - -static struct BurnRomInfo bbmanwjRomDesc[] = { - { "bbm2-h0.77", 0x40000, 0xe1407b91, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "bbm2-l0.79", 0x40000, 0x20873b49, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bbm2-sp-a.33", 0x10000, 0xa4b0a66e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bbm2-c0.81", 0x40000, 0xe7ce058a, 3 | BRF_GRA }, // 3 Tiles and sprites - { "bbm2-c1.82", 0x40000, 0x636a78a9, 3 | BRF_GRA }, // 4 - { "bbm2-c2.83", 0x40000, 0x9ac2142f, 3 | BRF_GRA }, // 5 - { "bbm2-c3.84", 0x40000, 0x47af1750, 3 | BRF_GRA }, // 6 - - { "bbm2-v0-b.30", 0x20000, 0x0ae655ff, 4 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(bbmanwj) -STD_ROM_FN(bbmanwj) - -struct BurnDriver BurnDrvBbmanwj = { - "bbmanwj", "bbmanw", NULL, NULL, "1992", - "Bomber Man World (Japan)\0", NULL, "Irem", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, bbmanwjRomInfo, bbmanwjRomName, NULL, NULL, p4commonInputInfo, BbmanwjDIPInfo, - bbmanwInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// Bomber Man World (Japan, revised sound hardware) - -static struct BurnRomInfo bbmanwjaRomDesc[] = { - { "bbm2-h0.77", 0x40000, 0xe1407b91, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "bbm2-l0.79", 0x40000, 0x20873b49, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bbm2-sp-b.33", 0x10000, 0xb8d8108c, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bbm2-c0.81", 0x40000, 0xe7ce058a, 3 | BRF_GRA }, // 3 Tiles and sprites - { "bbm2-c1.82", 0x40000, 0x636a78a9, 3 | BRF_GRA }, // 4 - { "bbm2-c2.83", 0x40000, 0x9ac2142f, 3 | BRF_GRA }, // 5 - { "bbm2-c3.84", 0x40000, 0x47af1750, 3 | BRF_GRA }, // 6 - - { "bbm2-v0-b.30", 0x20000, 0x0ae655ff, 4 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(bbmanwja) -STD_ROM_FN(bbmanwja) - -struct BurnDriver BurnDrvBbmanwja = { - "bbmanwja", "bbmanw", NULL, NULL, "1992", - "Bomber Man World (Japan, revised sound hardware)\0", NULL, "Irem", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, bbmanwjaRomInfo, bbmanwjaRomName, NULL, NULL, p4commonInputInfo, BbmanwjDIPInfo, - bbmanwInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// New Atomic Punk - Global Quest (US) - -static struct BurnRomInfo newapunkRomDesc[] = { - { "bbm2-h0-a.77", 0x40000, 0x7d858682, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "bbm2-l0-a.79", 0x40000, 0xc7568031, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bbm2-sp.33", 0x10000, 0x6bc1689e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bbm2-c0.81", 0x40000, 0xe7ce058a, 3 | BRF_GRA }, // 3 Tiles and sprites - { "bbm2-c1.82", 0x40000, 0x636a78a9, 3 | BRF_GRA }, // 4 - { "bbm2-c2.83", 0x40000, 0x9ac2142f, 3 | BRF_GRA }, // 5 - { "bbm2-c3.84", 0x40000, 0x47af1750, 3 | BRF_GRA }, // 6 - - { "bbm2-v0.30", 0x20000, 0x4ad889ed, 4 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(newapunk) -STD_ROM_FN(newapunk) - -struct BurnDriver BurnDrvNewapunk = { - "newapunk", "bbmanw", NULL, NULL, "1992", - "New Atomic Punk - Global Quest (US)\0", NULL, "Irem America", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, newapunkRomInfo, newapunkRomName, NULL, NULL, p4commonInputInfo, BbmanwjDIPInfo, - bbmanwInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// Quiz F1 1-2 Finish (Japan) - -static struct BurnRomInfo quizf1RomDesc[] = { - { "qf1-h0-.77", 0x40000, 0x280e3049, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "qf1-l0-.79", 0x40000, 0x94588a6f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "qf1-sp-.33", 0x10000, 0x0664fa9f, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "qf1-c0-.81", 0x80000, 0xc26b521e, 3 | BRF_GRA }, // 3 Tiles and sprites - { "qf1-c1-.82", 0x80000, 0xdb9d7394, 3 | BRF_GRA }, // 4 - { "qf1-c2-.83", 0x80000, 0x0b1460ae, 3 | BRF_GRA }, // 5 - { "qf1-c3-.84", 0x80000, 0x2d32ff37, 3 | BRF_GRA }, // 6 - - { "qf1-v0-.30", 0x40000, 0xb8d16e7c, 4 | BRF_SND }, // 7 Samples - - { "qf1-h1-.78", 0x80000, 0xc6c2eb2b, 5 | BRF_PRG | BRF_ESS }, // 8 V30 banked code - { "qf1-l1-.80", 0x80000, 0x3132c144, 5 | BRF_PRG | BRF_ESS }, // 9 -}; - -STD_ROM_PICK(quizf1) -STD_ROM_FN(quizf1) - -static INT32 quizf1Init() -{ - video_offsets[0] = 48; - video_offsets[1] = 128; - return DrvInit(0x80000, 0x200000, 0x40000, 0x100000, 0, lethalth_decryption_table); -} - -struct BurnDriver BurnDrvQuizf1 = { - "quizf1", NULL, NULL, NULL, "1992", - "Quiz F1 1-2 Finish (Japan)\0", NULL, "Irem", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, quizf1RomInfo, quizf1RomName, NULL, NULL, Quizf1InputInfo, Quizf1DIPInfo, - quizf1Init, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; - - -// Risky Challenge - -static struct BurnRomInfo riskchalRomDesc[] = { - { "rc_h0.ic77", 0x40000, 0x4c9b5344, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rc_l0.ic79", 0x40000, 0x0455895a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "l4_a-sp.ic33", 0x10000, 0xbb80094e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "rc_c0.rom", 0x80000, 0x84d0b907, 3 | BRF_GRA }, // 3 Tiles and sprites - { "rc_c1.rom", 0x80000, 0xcb3784ef, 3 | BRF_GRA }, // 4 - { "rc_c2.rom", 0x80000, 0x687164d7, 3 | BRF_GRA }, // 5 - { "rc_c3.rom", 0x80000, 0xc86be6af, 3 | BRF_GRA }, // 6 - - { "rc_v0.rom", 0x40000, 0xcddac360, 4 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(riskchal) -STD_ROM_FN(riskchal) - -static INT32 riskchalInit() -{ - video_offsets[0] = 80; - video_offsets[1] = 136; - return DrvInit(0x80000, 0x200000, 0x40000, 0, 0, gussun_decryption_table); -} - -struct BurnDriver BurnDrvRiskchal = { - "riskchal", NULL, NULL, NULL, "1993", - "Risky Challenge\0", "Unemulated CPU functions", "Irem", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, riskchalRomInfo, riskchalRomName, NULL, NULL, p2commonInputInfo, RiskchalDIPInfo, - riskchalInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// Gussun Oyoyo (Japan) - -static struct BurnRomInfo gussunRomDesc[] = { - { "l4_a-h0.ic77", 0x40000, 0x9d585e61, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "l4_a-l0.ic79", 0x40000, 0xc7b4c519, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "l4_a-sp.ic33", 0x10000, 0xbb80094e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "rc_c0.rom", 0x80000, 0x84d0b907, 3 | BRF_GRA }, // 3 Tiles and sprites - { "rc_c1.rom", 0x80000, 0xcb3784ef, 3 | BRF_GRA }, // 4 - { "rc_c2.rom", 0x80000, 0x687164d7, 3 | BRF_GRA }, // 5 - { "rc_c3.rom", 0x80000, 0xc86be6af, 3 | BRF_GRA }, // 6 - - { "rc_v0.rom", 0x40000, 0xcddac360, 4 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(gussun) -STD_ROM_FN(gussun) - -struct BurnDriver BurnDrvGussun = { - "gussun", "riskchal", NULL, NULL, "1993", - "Gussun Oyoyo (Japan)\0", "Unemulated CPU functions", "Irem", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, gussunRomInfo, gussunRomName, NULL, NULL, p2commonInputInfo, RiskchalDIPInfo, - riskchalInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// Match It II - -static struct BurnRomInfo matchit2RomDesc[] = { - { "sis2-h0-b.bin", 0x40000, 0x9a2556ac, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "sis2-l0-b.bin", 0x40000, 0xd35d948a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sis2-sp-.rom", 0x10000, 0x6fc0ff3a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ic81.rom", 0x80000, 0x5a7cb88f, 3 | BRF_GRA }, // 3 Tiles and sprites - { "ic82.rom", 0x80000, 0x54a7852c, 3 | BRF_GRA }, // 4 - { "ic83.rom", 0x80000, 0x2bd65dc6, 3 | BRF_GRA }, // 5 - { "ic84.rom", 0x80000, 0x876d5fdb, 3 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(matchit2) -STD_ROM_FN(matchit2) - -static INT32 matchit2Init() -{ - video_offsets[0] = 48; - video_offsets[1] = 128; - return DrvInit(0x80000, 0x200000, 0, 0, 0, matchit2_decryption_table); -} - -struct BurnDriver BurnDrvMatchit2 = { - "matchit2", NULL, NULL, NULL, "1993", - "Match It II\0", NULL, "Tamtex", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, matchit2RomInfo, matchit2RomName, NULL, NULL, Matchit2InputInfo, Matchit2DIPInfo, - matchit2Init, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; - - -// Shisensho II - -static struct BurnRomInfo shisen2RomDesc[] = { - { "sis2-h0-.rom", 0x40000, 0x6fae0aea, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "sis2-l0-.rom", 0x40000, 0x2af25182, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sis2-sp-.rom", 0x10000, 0x6fc0ff3a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ic81.rom", 0x80000, 0x5a7cb88f, 3 | BRF_GRA }, // 3 Tiles and sprites - { "ic82.rom", 0x80000, 0x54a7852c, 3 | BRF_GRA }, // 4 - { "ic83.rom", 0x80000, 0x2bd65dc6, 3 | BRF_GRA }, // 5 - { "ic84.rom", 0x80000, 0x876d5fdb, 3 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(shisen2) -STD_ROM_FN(shisen2) - -struct BurnDriver BurnDrvShisen2 = { - "shisen2", "matchit2", NULL, NULL, "1993", - "Shisensho II\0", NULL, "Tamtex", "M90", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, - NULL, shisen2RomInfo, shisen2RomName, NULL, NULL, Matchit2InputInfo, Shisen2DIPInfo, - matchit2Init, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/irem/d_m92.cpp b/jan/src/burn/drv/irem/d_m92.cpp deleted file mode 100644 index 63c428b5b..000000000 --- a/jan/src/burn/drv/irem/d_m92.cpp +++ /dev/null @@ -1,3942 +0,0 @@ -// FB Alpha Irem M92 system driver -// Based on MAME driver by Bryan McPhail -// Original port from MAME by OopsWare -// Overhauled and tuned up by dink in August 2014, R-Type LEO title intro-effect fixed Dec.2016 - -#include "tiles_generic.h" -#include "burn_ym2151.h" -#include "nec_intf.h" -#include "msm6295.h" // ppan -#include "irem_cpu.h" -#include "iremga20.h" - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart; -static UINT8 *RamEnd; -static UINT8 *DrvV33ROM; -static UINT8 *DrvV30ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvV33RAM; -static UINT8 *DrvV30RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPalRAM; -static UINT8 *DrvEEPROM; - -static UINT8 *pf_control[4]; - -static UINT8 *sound_status; -static UINT8 *sound_latch; - -static UINT8 *RamPrioBitmap; - -static UINT32 *DrvPalette; -static UINT8 bRecalcPalette = 0; - -static UINT32 PalBank; - -static INT32 sprite_extent = 0; -static UINT8 m92_sprite_buffer_busy; -static INT32 m92_sprite_list; -static INT32 m92_sprite_buffer_timer; -static INT32 m92_raster_irq_position = 0; - -static UINT8 DrvButton[8]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvInput[9]; -static UINT8 DrvReset = 0; - -static INT32 m92_irq_vectorbase; -static INT32 graphics_mask[2] = { 0, 0 }; - -static INT32 nInterleave = 256; // 256 scanlines -static INT32 nCyclesDone[2] = { 0, 0 }; -static INT32 nCyclesTotal[2] = { 0, 0 }; - -static INT32 m92_kludge = 0; -static INT32 nPrevScreenPos = 0; -static INT32 nScreenOffsets[2] = { 0, 0 }; // x,y (ppan) - -static INT32 msm6295_bank; - -typedef struct _m92_layer m92_layer; -struct _m92_layer -{ - INT32 enable; - INT32 wide; - INT32 enable_rowscroll; - - UINT16 scrollx; - UINT16 scrolly; - - UINT16 *scroll; - UINT16 *vram; -}; - -static struct _m92_layer *m92_layers[3]; - -enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, V30_ASSERT, V30_CLEAR }; - -static struct BurnInputInfo p2CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvButton + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvButton + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 5, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 6, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInput + 7, "dip" }, -}; - -STDINPUTINFO(p2Common) - -static struct BurnInputInfo p3CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvButton + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 4, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 3, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 2, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 0, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 7, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p3 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvButton + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 5, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 6, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInput + 7, "dip" }, -}; - -STDINPUTINFO(p3Common) - -static struct BurnInputInfo p4CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvButton + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 4, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 3, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 2, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 0, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 7, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy4 + 5, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 4, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 3, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 2, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 0, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 7, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 6, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvButton + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 5, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 6, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInput + 7, "dip" }, -}; - -STDINPUTINFO(p4Common) - -static struct BurnInputInfo nbbatmanInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvButton + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 4, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 3, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 2, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 0, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 7, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy4 + 5, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 4, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 3, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 2, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 0, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 7, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 6, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvButton + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 5, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 6, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInput + 7, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvInput + 8, "dip" }, -}; - -STDINPUTINFO(nbbatman) - -static struct BurnInputInfo PsoldierInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy4 + 2, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvJoy4 + 3, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvButton + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 5" }, - {"P2 Button 6", BIT_DIGITAL, DrvJoy4 + 7, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvButton + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 5, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 6, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInput + 7, "dip" }, -}; - -STDINPUTINFO(Psoldier) - -static struct BurnDIPInfo BmasterDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "1" }, - {0x12, 0x01, 0x03, 0x03, "2" }, - {0x12, 0x01, 0x03, 0x02, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x10, 0x10, "300k only" }, - {0x12, 0x01, 0x10, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x13, 0x01, 0x04, 0x04, "Common" }, - {0x13, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - -#if 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -#else - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -#endif -}; - -STDDIPINFO(Bmaster) - -static struct BurnDIPInfo GunforceDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x10, 0x00, "15000 35000 75000 120000" }, - {0x12, 0x01, 0x10, 0x10, "20000 40000 90000 150000" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x13, 0x01, 0x04, 0x04, "Common" }, - {0x13, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - -#if 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -#else - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -#endif -}; - -STDDIPINFO(Gunforce) - - -static struct BurnDIPInfo MysticriDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x10, 0x00, "15000 35000 60000" }, - {0x12, 0x01, 0x10, 0x10, "20000 50000 90000" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x13, 0x01, 0x04, 0x04, "Common" }, - {0x13, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - -#if 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -#else - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -#endif -}; - -STDDIPINFO(Mysticri) - -static struct BurnDIPInfo Gunforc2DIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "3" }, - {0x12, 0x01, 0x03, 0x03, "2" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "1" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x13, 0x01, 0x04, 0x04, "Common" }, - {0x13, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - -#if 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -#else - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -#endif -}; - -STDDIPINFO(Gunforc2) - -static struct BurnDIPInfo RtypeleoDIPList[]= -{ - {0x12, 0xff, 0xff, 0xaf, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x13, 0x01, 0x04, 0x04, "Common" }, - {0x13, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - -#if 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -#else - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -#endif -}; - -STDDIPINFO(Rtypeleo) - -static struct BurnDIPInfo InthuntDIPList[]= -{ - {0x12, 0xff, 0xff, 0xaf, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Any Button to Start" }, - {0x12, 0x01, 0x20, 0x20, "No" }, - {0x12, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x13, 0x01, 0x04, 0x04, "Common" }, - {0x13, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - -#if 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -#else - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -#endif -}; - -STDDIPINFO(Inthunt) - -static struct BurnDIPInfo LethalthDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Continuous Play" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x13, 0x01, 0x04, 0x04, "Common" }, - {0x13, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "1" }, - {0x13, 0x01, 0x08, 0x00, "2" }, - -#if 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -#else - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -#endif - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x03, 0x02, "500K & 1M" }, - {0x14, 0x01, 0x03, 0x03, "700K & 1.5M" }, - {0x14, 0x01, 0x03, 0x00, "700K, 1.5M, 3M & 4.5M" }, - {0x14, 0x01, 0x03, 0x01, "1M & 2M" }, -}; - -STDDIPINFO(Lethalth) - -static struct BurnDIPInfo UccopsDIPList[]= -{ - {0x1a, 0xff, 0xff, 0xae, NULL }, - {0x1b, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x1a, 0x01, 0x03, 0x00, "1" }, - {0x1a, 0x01, 0x03, 0x03, "2" }, - {0x1a, 0x01, 0x03, 0x02, "3" }, - {0x1a, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1a, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x1a, 0x01, 0x0c, 0x08, "Easy" }, - {0x1a, 0x01, 0x0c, 0x0c, "Normal" }, - {0x1a, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Any Button to Start" }, - {0x1a, 0x01, 0x20, 0x00, "No" }, - {0x1a, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1a, 0x01, 0x40, 0x40, "Off" }, - {0x1a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1a, 0x01, 0x80, 0x80, "Off" }, - {0x1a, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1b, 0x01, 0x01, 0x01, "Off" }, - {0x1b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x1b, 0x01, 0x02, 0x02, "2 Players" }, - {0x1b, 0x01, 0x02, 0x00, "4 Players" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x1b, 0x01, 0x04, 0x04, "Common" }, - {0x1b, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x1b, 0x01, 0x08, 0x08, "1" }, - {0x1b, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x1b, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x1b, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x1b, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x1b, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x1b, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x1b, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x1b, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x1b, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x1b, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Uccops) - -static struct BurnDIPInfo HookDIPList[]= -{ - {0x22, 0xff, 0xff, 0xbf, NULL }, - {0x23, 0xff, 0xff, 0xff, NULL }, - {0x24, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x22, 0x01, 0x03, 0x00, "1" }, - {0x22, 0x01, 0x03, 0x03, "2" }, - {0x22, 0x01, 0x03, 0x02, "3" }, - {0x22, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x22, 0x01, 0x0c, 0x08, "Easy" }, - {0x22, 0x01, 0x0c, 0x0c, "Normal" }, - {0x22, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Any Button to Start" }, - {0x22, 0x01, 0x20, 0x00, "No" }, - {0x22, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x40, 0x40, "Off" }, - {0x22, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x23, 0x01, 0x02, 0x02, "2 Players" }, - {0x23, 0x01, 0x02, 0x00, "4 Players" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x23, 0x01, 0x04, 0x04, "Common" }, - {0x23, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x23, 0x01, 0x08, 0x08, "1" }, - {0x23, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x23, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Hook) - -static struct BurnDIPInfo NbbatmanDIPList[]= -{ - {0x22, 0xff, 0xff, 0x9f, NULL }, - {0x23, 0xff, 0xff, 0xff, NULL }, - {0x24, 0xff, 0xff, 0xff, NULL }, - {0x25, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x22, 0x01, 0x03, 0x00, "1" }, - {0x22, 0x01, 0x03, 0x03, "2" }, - {0x22, 0x01, 0x03, 0x02, "3" }, - {0x22, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x0c, 0x08, "Easy" }, - {0x22, 0x01, 0x0c, 0x0c, "Normal" }, - {0x22, 0x01, 0x0c, 0x04, "Hard" }, - {0x22, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Any Button to Start" }, - {0x22, 0x01, 0x20, 0x20, "No" }, - {0x22, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x40, 0x40, "Off" }, - {0x22, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x23, 0x01, 0x02, 0x02, "2 Players" }, - {0x23, 0x01, 0x02, 0x00, "4 Players" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x23, 0x01, 0x04, 0x04, "Common" }, - {0x23, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x23, 0x01, 0x08, 0x08, "1" }, - {0x23, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x23, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Early SoundCPU emulation mode. (HACK)" }, - {0x25, 0x01, 0x01, 0x00, "Off" }, - {0x25, 0x01, 0x01, 0x01, "On (Reload game after change!)" }, -}; - -STDDIPINFO(Nbbatman) - -static struct BurnDIPInfo Majtitl2DIPList[]= -{ - {0x22, 0xff, 0xff, 0x9f, NULL }, - {0x23, 0xff, 0xff, 0xfd, NULL }, - {0x24, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Given Holes/Stroke Play" }, - {0x22, 0x01, 0x01, 0x00, "1" }, - {0x22, 0x01, 0x01, 0x01, "2" }, - - {0 , 0xfe, 0 , 2, "Given Holes/Match or Skins" }, - {0x22, 0x01, 0x02, 0x00, "1" }, - {0x22, 0x01, 0x02, 0x02, "2" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x22, 0x01, 0x04, 0x04, "Normal" }, - {0x22, 0x01, 0x04, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Joystick Configuration" }, - {0x22, 0x01, 0x08, 0x08, "Upright" }, - {0x22, 0x01, 0x08, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Number of Joysticks" }, - {0x22, 0x01, 0x10, 0x10, "2 Joysticks" }, - {0x22, 0x01, 0x10, 0x00, "4 Joysticks" }, - - {0 , 0xfe, 0 , 2, "Any Button to Start" }, - {0x22, 0x01, 0x20, 0x20, "No" }, - {0x22, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x40, 0x40, "Off" }, - {0x22, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x23, 0x01, 0x02, 0x00, "Upright" }, - {0x23, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x23, 0x01, 0x04, 0x04, "Common" }, - {0x23, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x23, 0x01, 0x08, 0x08, "1" }, - {0x23, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x23, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Ticket Dispenser" }, - {0x24, 0x01, 0x01, 0x01, "Off" }, - {0x24, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Points Per Ticket" }, - {0x24, 0x01, 0x06, 0x06, "1 Point - 1 Ticket" }, - {0x24, 0x01, 0x06, 0x04, "2 Points - 1 Ticket" }, - {0x24, 0x01, 0x06, 0x02, "5 Points - 1 Ticket" }, - {0x24, 0x01, 0x06, 0x00, "10 Points - 1 Ticket" }, - - {0 , 0xfe, 0 , 2, "Deltronics Model" }, - {0x24, 0x01, 0x80, 0x80, "DL 1275" }, - {0x24, 0x01, 0x80, 0x00, "DL 4SS" }, -}; - -STDDIPINFO(Majtitl2) - -static struct BurnDIPInfo Dsoccr94jDIPList[]= -{ - {0x22, 0xff, 0xff, 0xbf, NULL }, - {0x23, 0xff, 0xff, 0xff, NULL }, - {0x24, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x22, 0x01, 0x03, 0x00, "1:30" }, - {0x22, 0x01, 0x03, 0x03, "2:00" }, - {0x22, 0x01, 0x03, 0x02, "2:30" }, - {0x22, 0x01, 0x03, 0x01, "3:00" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x0c, 0x00, "Very Easy" }, - {0x22, 0x01, 0x0c, 0x08, "Easy" }, - {0x22, 0x01, 0x0c, 0x0c, "Normal" }, - {0x22, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Game Mode" }, - {0x22, 0x01, 0x10, 0x10, "Match Mode" }, - {0x22, 0x01, 0x10, 0x00, "Power Mode" }, - - {0 , 0xfe, 0 , 2, "Starting Button" }, - {0x22, 0x01, 0x20, 0x00, "Button 1" }, - {0x22, 0x01, 0x20, 0x20, "Start Button" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x40, 0x40, "Off" }, - {0x22, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x23, 0x01, 0x02, 0x02, "2 Players" }, - {0x23, 0x01, 0x02, 0x00, "4 Players" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x23, 0x01, 0x04, 0x04, "Common" }, - {0x23, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x23, 0x01, 0x08, 0x08, "1" }, - {0x23, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x23, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Player Power" }, - {0x24, 0x01, 0x03, 0x00, "500" }, - {0x24, 0x01, 0x03, 0x03, "1000" }, - {0x24, 0x01, 0x03, 0x01, "1500" }, - {0x24, 0x01, 0x03, 0x02, "2000" }, -}; - -STDDIPINFO(Dsoccr94j) - -static struct BurnDIPInfo PsoldierDIPList[]= -{ - {0x1a, 0xff, 0xff, 0x9f, NULL }, - {0x1b, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 2, "Any Button to Start" }, - {0x1a, 0x01, 0x20, 0x20, "No" }, - {0x1a, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1a, 0x01, 0x40, 0x40, "Off" }, - {0x1a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1a, 0x01, 0x80, 0x80, "Off" }, - {0x1a, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1b, 0x01, 0x01, 0x01, "Off" }, - {0x1b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x1b, 0x01, 0x04, 0x04, "Common" }, - {0x1b, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x1b, 0x01, 0x08, 0x08, "1" }, - {0x1b, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x1b, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, - {0x1b, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x1b, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x1b, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x1b, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x1b, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x1b, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x1b, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x1b, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Psoldier) - -inline static UINT32 CalcCol(INT32 offs) -{ - INT32 nColour = DrvPalRAM[offs + 0] | (DrvPalRAM[offs + 1] << 8); - INT32 r, g, b; - - r = (nColour & 0x001F) << 3; - r |= r >> 5; - g = (nColour & 0x03E0) >> 2; - g |= g >> 5; - b = (nColour & 0x7C00) >> 7; - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -static void m92YM2151IRQHandler(INT32 nStatus) -{ - if (VezGetActive() == -1) return; - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP0, 0xff/*default*/, nStatus ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - VezRun(100); -} - -UINT8 __fastcall m92ReadByte(UINT32 address) -{ - if ((address & 0xff800) == 0xf8800 ) - return DrvPalRAM[ address - 0xf8800 + PalBank ]; - - if ((address & 0xfc000) == 0xf0000 ) { - if (address & 1) { - return 0xff; - } else { - return DrvEEPROM[(address & 0x3fff) / 2]; - } - } - - return 0; -} - -void __fastcall m92WriteByte(UINT32 address, UINT8 data) -{ - if ((address & 0xff800) == 0xf8800 ) { - DrvPalRAM[ address - 0xf8800 + PalBank ] = data; - if (address & 1) { - INT32 offs = (address - 0xf8800 + PalBank) >> 1; - DrvPalette[offs] = CalcCol( offs << 1 ); - } - return; - } - - if ((address & 0xfc001) == 0xf0000 ) { - DrvEEPROM[(address & 0x3fff) / 2] = data; - return; - } - - switch (address) - { - case 0xf9000: - sprite_extent = (sprite_extent & 0xff00) | (data << 0); - return; - - case 0xf9001: - sprite_extent = (sprite_extent & 0x00ff) | (data << 8); - return; - - case 0xf9004: - m92_sprite_list = (data==8) ? (((0x100 - sprite_extent)&0xff)*4) : 0x400; - return; - - case 0xf9008: - m92_sprite_buffer_busy = 0; - m92_sprite_buffer_timer = 1; - VezRunEnd(); - return; - - case 0xf9800: - PalBank = (data & 0x02) ? 0x0800 : 0x0000; - return; - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), data, address); - } -} - -UINT8 __fastcall m92ReadPort(UINT32 port) -{ - switch (port) - { - case 0x00: return ~DrvInput[0]; // player 1 - case 0x01: return ~DrvInput[1]; // player 2 - case 0x02: return (~DrvInput[4] & 0x7F) | m92_sprite_buffer_busy; - case 0x03: return DrvInput[7]; // dip 3 - case 0x04: return DrvInput[5]; // dip 1 - case 0x05: return DrvInput[6]; // dip 2 - case 0x06: return ~DrvInput[2]; // player 3 - case 0x07: return ~DrvInput[3]; // player 4 - - case 0x08: VezSetIRQLineAndVector(0, (m92_irq_vectorbase + 12)/4, CPU_IRQSTATUS_NONE); return sound_status[0]; - case 0x09: VezSetIRQLineAndVector(0, (m92_irq_vectorbase + 12)/4, CPU_IRQSTATUS_NONE); return sound_status[1]; - - case 0x18: return (m92_kludge == 3) ? MSM6295ReadStatus(0) : 0; // ppan - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read byte value of port %x\n"), port); - } - return 0; -} - -static void clear_pf_scroll(INT32 layer) -{ - pf_control[layer][0] = 0; // scrolly - pf_control[layer][1] = 0; // " - pf_control[layer][4] = 0; // scrollx - pf_control[layer][5] = 0; // " -} - -static void set_pf_info(INT32 layer, INT32 data) -{ - struct _m92_layer *ptr = m92_layers[layer]; - - if (data & 0x10) { - ptr->enable = 0; - } else { - ptr->enable = 1; - ptr->wide = (data & 0x04) ? 128 : 64; - } - - int oldrowscroll = ptr->enable_rowscroll; - ptr->enable_rowscroll = data & 0x40; - if (ptr->enable_rowscroll != oldrowscroll) - clear_pf_scroll(layer); //clear scrollx/scrolly on change, fixes skewed background problems (f. ex. inthunt) - - ptr->vram = (UINT16*)(DrvVidRAM + ((data & 0x03) * 0x4000)); -} - -static void set_pf_scroll(INT32 layer) -{ - struct _m92_layer *ptr = m92_layers[layer]; - - ptr->scrollx = (pf_control[layer][4] << 0) | (pf_control[layer][5] << 8); - ptr->scrolly = (pf_control[layer][0] << 0) | (pf_control[layer][1] << 8); -} - -void __fastcall m92WritePort(UINT32 port, UINT8 data) -{ - switch (port) - { - case 0x00: - // case 0x01: - sound_latch[0] = data; - VezClose(); - VezOpen(1); - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP1, 0xff/*default*/, CPU_IRQSTATUS_ACK); - VezRun(10); - VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP1, 0xff/*default*/, CPU_IRQSTATUS_NONE); - VezRun(10); - VezClose(); - VezOpen(0); - return; - - case 0x02: - case 0x03: - //m92_coincounter_w - return; - - case 0x10: // ppan - if (m92_kludge == 3) { - if (msm6295_bank != (data + 1)) { - msm6295_bank = (data & 3) + 1; - memcpy (DrvSndROM + 0x20000, DrvSndROM + 0x100000 + msm6295_bank * 0x20000, 0x20000); - } - } - return; - - case 0x18: // ppan - if (m92_kludge == 3) MSM6295Command(0, data); - return; - - case 0x20: - // case 0x21: - // m92_bankswitch_w - if (m92_kludge != 1) { // lethalth - VezMapArea(0xa0000, 0xbffff, 0, DrvV33ROM + 0x100000 + (data&0x7)*0x10000); - VezMapArea(0xa0000, 0xbffff, 2, DrvV33ROM + 0x100000 + (data&0x7)*0x10000); - } - return; - - case 0x40: - case 0x41: - case 0x43: // IRQ controller init (ignored) - return; - case 0x42: // get vectorbase from IRQ controller init - first write on port 0x42 - if (m92_irq_vectorbase == 0) { - m92_irq_vectorbase = data << 2; - } - return; - - case 0x80: pf_control[0][0] = data; set_pf_scroll(0); return; - case 0x81: pf_control[0][1] = data; set_pf_scroll(0); return; - case 0x82: pf_control[0][2] = data; return; - case 0x83: pf_control[0][3] = data; return; - case 0x84: pf_control[0][4] = data; set_pf_scroll(0); return; - case 0x85: pf_control[0][5] = data; set_pf_scroll(0); return; - case 0x86: pf_control[0][6] = data; return; - case 0x87: pf_control[0][7] = data; return; - case 0x88: pf_control[1][0] = data; set_pf_scroll(1); return; - case 0x89: pf_control[1][1] = data; set_pf_scroll(1); return; - case 0x8a: pf_control[1][2] = data; return; - case 0x8b: pf_control[1][3] = data; return; - case 0x8c: pf_control[1][4] = data; set_pf_scroll(1); return; - case 0x8d: pf_control[1][5] = data; set_pf_scroll(1); return; - case 0x8e: pf_control[1][6] = data; return; - case 0x8f: pf_control[1][7] = data; return; - case 0x90: pf_control[2][0] = data; set_pf_scroll(2); return; - case 0x91: pf_control[2][1] = data; set_pf_scroll(2); return; - case 0x92: pf_control[2][2] = data; return; - case 0x93: pf_control[2][3] = data; return; - case 0x94: pf_control[2][4] = data; set_pf_scroll(2); return; - case 0x95: pf_control[2][5] = data; set_pf_scroll(2); return; - case 0x96: pf_control[2][6] = data; return; - case 0x97: pf_control[2][7] = data; return; - case 0x98: pf_control[3][0] = data; set_pf_info(0, data); return; - case 0x99: pf_control[3][1] = data; return; - case 0x9a: pf_control[3][2] = data; set_pf_info(1, data); return; - case 0x9b: pf_control[3][3] = data; return; - case 0x9c: pf_control[3][4] = data; set_pf_info(2, data); return; - case 0x9d: pf_control[3][5] = data; return; - case 0x9e: pf_control[3][6] = data; - return; - case 0x9f: pf_control[3][7] = data; - m92_raster_irq_position = ((pf_control[3][7]<<8) | pf_control[3][6]) - 128; - return; - - case 0xc0: - case 0xc1:// sound reset - return; - - //default: - // bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to port %x\n"), data, port); - } -} - -UINT8 __fastcall m92SndReadByte(UINT32 address) -{ - if ((address & 0xfffc0) == 0xa8000) { - return iremga20_read( 0, (address & 0x0003f) / 2 ); - } - - switch (address) - { - case 0xa8042: - return BurnYM2151ReadStatus(); - - case 0xa8044: - //VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP1, 0xff/*default*/, CPU_IRQSTATUS_NONE); - return sound_latch[0]; - - case 0xa8045: - return 0xff; // soundlatch high bits, always 0xff - -// default: -// bprintf(PRINT_NORMAL, _T("V30 Attempt to read byte value of location %x\n"), address); - } - return 0; -} - -void __fastcall m92SndWriteByte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffc0) == 0xa8000) { - iremga20_write( 0, (address & 0x0003f) / 2, data ); - return; - } - - if ((address & 0xfff00) == 0x9ff00) { // NOP - return; - } - - switch (address) - { - case 0xa8040: - BurnYM2151SelectRegister(data); - return; - - case 0xa8042: - BurnYM2151WriteRegister(data); - return; - - case 0xa8044: - //VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP1, 0xff/*default*/, CPU_IRQSTATUS_NONE); - return; - - case 0xa8046: - sound_status[0] = data; - VezClose(); - VezOpen(0); - VezSetIRQLineAndVector(0, (m92_irq_vectorbase + 12)/4, CPU_IRQSTATUS_ACK); - VezClose(); - VezOpen(1); - return; - - // default: - // bprintf(PRINT_NORMAL, _T("V30 Attempt to write byte value %x to location %x\n"), data, address); - } -} - -static INT32 DrvDoReset() -{ - memset (RamStart, 0, RamEnd - RamStart); - - VezOpen(0); - VezReset(); - VezClose(); - - VezOpen(1); - VezReset(); - VezClose(); - - BurnYM2151Reset(); - iremga20_reset(0); - if (m92_kludge == 3) { // ppan - MSM6295Reset(0); - msm6295_bank = -1; - m92WritePort(0x10, 0); // set bank - } - - if (m92_kludge == 1) sound_status[0] = 0x80; - - m92_irq_vectorbase = 0; - m92_sprite_buffer_busy = 0x80; - m92_sprite_buffer_timer = 0; - PalBank = 0; - - { - struct _m92_layer *ptr; - for (INT32 i = 0; i < 3; i++) { - ptr = m92_layers[i]; - ptr->scroll = (UINT16*)(DrvVidRAM + (0xf400 + 0x400 * i)); - } - } - - return 0; -} - -static void loadDecodeGfx01(UINT8 *tmp, INT32 rid, INT32 shift, INT32 size) -{ - UINT8 * pgfx = DrvGfxROM0; - - BurnLoadRom(tmp, rid, 1); - - for (INT32 i=0; i<(size/8); i++) { - for( INT32 y=0;y<8;y++, tmp++, pgfx+=8) { - for ( INT32 j=0;j<8;j++) { - pgfx[j] |= ((tmp[0]>>(j^7))&1)<>(~j&7))&1)<> (7-(i&7)))&1)<= nScreenWidth || sy <= (0-height) || sy >= nScreenHeight) return; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - //"m92 is a special case, usually it would need pri |= 1<<31; but not this time! -dink" - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - if (pxl == 0) continue; - - if ((prio & (1 << pri[sy * nScreenWidth + sx])) == 0) { - dest[sy * nScreenWidth + sx] = pxl | color; - } - pri[sy * nScreenWidth + sx] = 7; - } - - sx -= width; - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprBuf; - - for (INT32 k=0; k<8; k++) - { - for (INT32 offs = 0; offs < m92_sprite_list; ) - { - INT32 y = (((384 - 16 - (BURN_ENDIAN_SWAP_INT16(ram[offs+0]) & 0x1ff)) - nScreenOffsets[1]) & 0x1ff) - 8; - INT32 x = (BURN_ENDIAN_SWAP_INT16(ram[offs+3]) & 0x1ff) - 96; - - INT32 pri_s = (BURN_ENDIAN_SWAP_INT16(ram[offs+0]) & 0xe000) >> 13; - INT32 pri_b = (BURN_ENDIAN_SWAP_INT16(ram[offs+2]) & 0x0080) ? 0x80 : 0x82; - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs+1]); - INT32 color = BURN_ENDIAN_SWAP_INT16(ram[offs+2]) & 0x007f; - - INT32 flipx = BURN_ENDIAN_SWAP_INT16(ram[offs+2]) & 0x0100; - INT32 flipy = BURN_ENDIAN_SWAP_INT16(ram[offs+2]) & 0x0200; - INT32 y_multi= 1 << ((BURN_ENDIAN_SWAP_INT16(ram[offs+0]) >> 9) & 3); - INT32 x_multi= 1 << ((BURN_ENDIAN_SWAP_INT16(ram[offs+0]) >> 11) & 3); - - offs += 4 * x_multi; - if (pri_s != k) continue; - - if (flipx) x+=16 * (x_multi - 1); - - for (INT32 j = 0; j < x_multi; j++) - { - INT32 s_ptr = j * 8; - if (!flipy) s_ptr += y_multi-1; - - x &= 0x1ff; - - for (INT32 i=0; i 0x1f0) RenderTilePrio(pTransDraw, DrvGfxROM1, (code + s_ptr) & graphics_mask[1], color << 4, x-512, y-i*16, flipx, flipy, 16, 16, RamPrioBitmap, pri_b); - - if (flipy) s_ptr++; else s_ptr--; - } - - if (flipx) x-=16; else x+=16; - } - } - } -} - -static void draw_layer_byline(INT32 start, INT32 finish, INT32 layer, INT32 forcelayer) -{ - struct _m92_layer *ptr = m92_layers[layer]; - - if (ptr->enable == 0) return; - - INT32 wide = ptr->wide; - INT32 scrolly = (ptr->scrolly + 136 - nScreenOffsets[1]) & 0x1ff; - INT32 scrollx = ((ptr->scrollx - nScreenOffsets[0]) - (2 * layer - ((wide & 0x80)<<1))) + 80; - - const UINT16 transmask[3][3][2] = { // layer, group, value - { { 0xffff, 0x0001 }, { 0x00ff, 0xff01 }, { 0x0001, 0xffff } }, - { { 0xffff, 0x0001 }, { 0x00ff, 0xff01 }, { 0x0001, 0xffff } }, - { { 0xffff, 0x0000 }, { 0x00ff, 0xff00 }, { 0x0001, 0xfffe } } - }; - - INT32 priority = 1 << forcelayer; - - for (INT32 sy = start; sy < finish; sy++) - { - UINT16 *dest = pTransDraw + (sy * nScreenWidth); - UINT8 *pri = RamPrioBitmap + (sy * nScreenWidth); - - INT32 scrollx_1 = scrollx; - if (ptr->enable_rowscroll) scrollx_1 += BURN_ENDIAN_SWAP_INT16(ptr->scroll[(sy+scrolly)&0x1ff]) - ((m92_kludge==4) ? 24 : 0); - INT32 scrolly_1 = (scrolly + sy) & 0x1ff; - INT32 romoff_1 = (scrolly_1 & 0x07) << 3; - - for (INT32 sx = 0; sx < nScreenWidth + 8; sx+=8) - { - INT32 offs = ((scrolly_1 / 8) * wide) + (((scrollx_1 + sx) / 8) & (wide - 1)); - INT32 attr = BURN_ENDIAN_SWAP_INT16(ptr->vram[(offs * 2) + 1]); - INT32 code = BURN_ENDIAN_SWAP_INT16(ptr->vram[(offs * 2) + 0]) | ((attr & 0x8000) << 1); - INT32 color =(attr & 0x007f) << 4; - INT32 flipy = attr & 0x0400; - INT32 flipx = attr & 0x0200; - - INT32 group = 0; - if (attr & 0x0180) group = (attr & 0x0100) ? 2 : 1; - - { - INT32 x_xor = 0; - INT32 romoff = romoff_1; - if (flipy) romoff ^= 0x38; - if (flipx) x_xor = 7; - - UINT8 *rom = DrvGfxROM0 + ((code & graphics_mask[0]) * 0x40) + romoff; - INT32 mask = transmask[layer][group][forcelayer]; - - INT32 xx = sx - (scrollx_1&0x7); - - for (INT32 x = 0; x < 8; x++, xx++) { - if (xx < 0 || xx >= nScreenWidth) continue; - - INT32 pxl = rom[x ^ x_xor]; - if (mask & (1 << pxl)) continue; - - dest[xx] = pxl | color; - pri[xx] = priority; - } - } - } - } -} - -static void DrawLayers(INT32 start, INT32 finish) -{ - memset (RamPrioBitmap + (start * nScreenWidth), 0, nScreenWidth * (finish - start)); // clear priority - - if (~nBurnLayer & 1) memset (pTransDraw + (start * nScreenWidth), 0, nScreenWidth * (finish - start) * sizeof(INT16)); - - if (~pf_control[3][4] & 0x10) { - if (nBurnLayer & 1) draw_layer_byline(start, finish, 2, 1); - if (nBurnLayer & 1) draw_layer_byline(start, finish, 2, 0); - } else { - memset (pTransDraw + (start * nScreenWidth), 0, nScreenWidth * (finish - start) * sizeof(INT16)); - } - - if (nBurnLayer & 2) draw_layer_byline(start, finish, 1, 1); - if (nBurnLayer & 2) draw_layer_byline(start, finish, 1, 0); - if (nBurnLayer & 4) draw_layer_byline(start, finish, 0, 1); - if (nBurnLayer & 4) draw_layer_byline(start, finish, 0, 0); -} - -static INT32 DrvDraw() -{ - if (bRecalcPalette) { - for (INT32 i=0; i<0x800;i++) - DrvPalette[i] = CalcCol(i<<1); - bRecalcPalette = 0; - } - -// DrawLayers(0, nScreenHeight); - - if (nBurnLayer & 8) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvReDraw() -{ - if (bRecalcPalette) { - for (INT32 i=0; i<0x800;i++) - DrvPalette[i] = CalcCol(i<<1); - bRecalcPalette = 0; - } - - DrawLayers(0, nScreenHeight); - - if (nBurnLayer & 8) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static void compile_inputs() -{ - memset (DrvInput, 0, 5); - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvJoy3[i] & 1) << i; - DrvInput[3] |= (DrvJoy4[i] & 1) << i; - DrvInput[4] |= (DrvButton[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[1]); -} - -static void scanline_interrupts(INT32 prev, INT32 segment, INT32 scanline) -{ - if (m92_sprite_buffer_timer) { - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - if (m92_kludge != 4) nCyclesDone[0] += VezRun(347); // nbbatman: fix for random lockups during gameplay - m92_sprite_buffer_busy = 0x80; - VezSetIRQLineAndVector(0, (m92_irq_vectorbase + 4)/4, CPU_IRQSTATUS_ACK); - nCyclesDone[0] += VezRun(10); - VezSetIRQLineAndVector(0, (m92_irq_vectorbase + 4)/4, CPU_IRQSTATUS_NONE); - if (m92_kludge != 4) nCyclesDone[0] += VezRun(segment - (VezTotalCycles() - prev)); - - m92_sprite_buffer_timer = 0; - } - - if (scanline == m92_raster_irq_position) { - - if (scanline>=8 && scanline < 248 && nPrevScreenPos != (scanline-8)+1) { - if (nPrevScreenPos >= 0 && nPrevScreenPos <= 239) - DrawLayers(nPrevScreenPos, (scanline-8)+1); - nPrevScreenPos = (scanline-8)+1; - } - - VezSetIRQLineAndVector(0, (m92_irq_vectorbase + 8)/4, CPU_IRQSTATUS_ACK); - nCyclesDone[0] += VezRun((m92_kludge == 4) ? 20 : 10); // nbbatman: gets rid of flashes in intro sequence - VezSetIRQLineAndVector(0, (m92_irq_vectorbase + 8)/4, CPU_IRQSTATUS_NONE); - - } - else if (scanline == 248) // vblank - { - if (nPrevScreenPos != 240) { - DrawLayers(nPrevScreenPos, 240); - } - nPrevScreenPos = 0; - - if (pBurnDraw) { - DrvDraw(); - } - - if (m92_kludge == 4) nCyclesDone[0] += VezRun(1200); // nbbatman: gets rid of flash after IREM logo fades out - VezSetIRQLineAndVector(0, (m92_irq_vectorbase + 0)/4, CPU_IRQSTATUS_ACK); - nCyclesDone[0] += VezRun(10); - VezSetIRQLineAndVector(0, (m92_irq_vectorbase + 0)/4, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - VezNewFrame(); - - compile_inputs(); - - INT32 multiplier=8; - nInterleave = 256*multiplier; - - // overclocking... - INT32 nSoundBufferPos = 0; - nCyclesTotal[0] = (INT32)((INT64)(9000000 / 60) * nBurnCPUSpeedAdjust / 0x0100); - nCyclesTotal[1] = (INT32)((INT64)(7159090 / 60) * nBurnCPUSpeedAdjust / 0x0100); - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - VezOpen(0); - INT32 segment = nCyclesTotal[0] / nInterleave; - INT32 prev = VezTotalCycles(); - - nCyclesDone[0] += VezRun(segment); - if ((i%multiplier)==(multiplier-1)) - scanline_interrupts(prev, segment, i/multiplier); // update at hblank? - VezClose(); - - VezOpen(1); - segment = nCyclesTotal[1] / nInterleave; - segment += segment * i; - while (VezTotalCycles() < segment) { - nCyclesDone[1] += VezRun(segment - VezTotalCycles()); - } - - if ((i%multiplier)==(multiplier-1)) { - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / multiplier); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - BurnYM2151Render(pSoundBuf, nSegmentLength); - iremga20_update(0, pSoundBuf, nSegmentLength); - - nSoundBufferPos += nSegmentLength; - } - } - - VezClose(); - } - - VezOpen(1); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - iremga20_update(0, pSoundBuf, nSegmentLength); - } - } - - VezClose(); - - return 0; -} - -static INT32 PpanFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - compile_inputs(); - - // overclocking... - nCyclesTotal[0] = (INT32)((INT64)(9000000 / 60) * nBurnCPUSpeedAdjust / 0x0100); - nCyclesDone[0] = 0; - - VezOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += VezRun(nCyclesTotal[0] / nInterleave); - - scanline_interrupts(0,0,i); - } - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - VezClose(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin) - { - *pnMin = 0x029737; - } - - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) - { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - if (nAction & ACB_WRITE) { - bRecalcPalette = 1; - - struct _m92_layer *ptr; - for (INT32 i = 0; i < 3; i++) { - ptr = m92_layers[i]; - ptr->scroll = (UINT16*)(DrvVidRAM + (0xf400 + 0x400 * i)); - } - - set_pf_info(0, pf_control[3][0]); - set_pf_info(1, pf_control[3][2]); - set_pf_info(2, pf_control[3][4]); - } - } - - if (nAction & ACB_DRIVER_DATA) - { - VezScan(nAction); - - iremga20_scan(0, nAction, pnMin); - BurnYM2151Scan(nAction); - - SCAN_VAR(PalBank); - - SCAN_VAR(m92_raster_irq_position); - SCAN_VAR(sprite_extent); - SCAN_VAR(m92_sprite_list); - SCAN_VAR(m92_sprite_buffer_busy); - SCAN_VAR(m92_sprite_buffer_timer); - SCAN_VAR(m92_irq_vectorbase); - - if (nAction & ACB_WRITE) { - VezOpen(1); - m92YM2151IRQHandler(0); // get fm sound going again on state load - VezClose(); - } - - if (m92_kludge == 3) { // ppan - MSM6295Scan(0, nAction); - - SCAN_VAR(msm6295_bank); - - INT32 temp = msm6295_bank; - msm6295_bank = -1; - m92WritePort(0x10, temp); - } - } - - return 0; -} - - -//----------------------------------------------------------------------------------------------------------------------------- - - -// Hook (World) - -static struct BurnRomInfo hookRomDesc[] = { - { "h-h0-d.3h", 0x040000, 0x40189ff6, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "h-l0-d.3h", 0x040000, 0x14567690, 1 | BRF_PRG | BRF_ESS }, // 1 - { "h-h1.rom", 0x020000, 0x264ba1f0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "h-l1.rom", 0x020000, 0xf9913731, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "h-sh0.rom", 0x010000, 0x86a4e56e, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "h-sl0.rom", 0x010000, 0x10fd9676, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "hook-c0.rom", 0x040000, 0xdec63dcf, 3 | BRF_GRA }, // 6 Background Tiles - { "hook-c1.rom", 0x040000, 0xe4eb0b92, 3 | BRF_GRA }, // 7 - { "hook-c2.rom", 0x040000, 0xa52b320b, 3 | BRF_GRA }, // 8 - { "hook-c3.rom", 0x040000, 0x7ef67731, 3 | BRF_GRA }, // 9 - - { "hook-000.rom", 0x100000, 0xccceac30, 4 | BRF_GRA }, // 10 Sprites - { "hook-010.rom", 0x100000, 0x8ac8da67, 4 | BRF_GRA }, // 11 - { "hook-020.rom", 0x100000, 0x8847af9a, 4 | BRF_GRA }, // 12 - { "hook-030.rom", 0x100000, 0x239e877e, 4 | BRF_GRA }, // 13 - - { "hook-da.rom", 0x080000, 0x88cd0212, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(hook) -STD_ROM_FN(hook) - -static INT32 hookRomLoad() -{ - return RomLoad(0x080000, 0x040000, 0x100000, 0, 0); -} - -static INT32 hookInit() -{ - return DrvInit(hookRomLoad, hook_decryption_table, 1, 0x100000, 0x400000); -} - -struct BurnDriver BurnDrvHook = { - "hook", NULL, NULL, NULL, "1992", - "Hook (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, hookRomInfo, hookRomName, NULL, NULL, p4CommonInputInfo, HookDIPInfo, - hookInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Hook (US) - -static struct BurnRomInfo hookuRomDesc[] = { - { "h-h0-c.3h", 0x040000, 0x84cc239e, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "h-l0-c.5h", 0x040000, 0x45e194fe, 1 | BRF_PRG | BRF_ESS }, // 1 - { "h-h1.rom", 0x020000, 0x264ba1f0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "h-l1.rom", 0x020000, 0xf9913731, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "h-sh0.rom", 0x010000, 0x86a4e56e, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "h-sl0.rom", 0x010000, 0x10fd9676, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "hook-c0.rom", 0x040000, 0xdec63dcf, 3 | BRF_GRA }, // 6 Background Tiles - { "hook-c1.rom", 0x040000, 0xe4eb0b92, 3 | BRF_GRA }, // 7 - { "hook-c2.rom", 0x040000, 0xa52b320b, 3 | BRF_GRA }, // 8 - { "hook-c3.rom", 0x040000, 0x7ef67731, 3 | BRF_GRA }, // 9 - - { "hook-000.rom", 0x100000, 0xccceac30, 4 | BRF_GRA }, // 10 Sprites - { "hook-010.rom", 0x100000, 0x8ac8da67, 4 | BRF_GRA }, // 11 - { "hook-020.rom", 0x100000, 0x8847af9a, 4 | BRF_GRA }, // 12 - { "hook-030.rom", 0x100000, 0x239e877e, 4 | BRF_GRA }, // 13 - - { "hook-da.rom", 0x080000, 0x88cd0212, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(hooku) -STD_ROM_FN(hooku) - -struct BurnDriver BurnDrvHooku = { - "hooku", "hook", NULL, NULL, "1992", - "Hook (US)\0", NULL, "Irem America", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, hookuRomInfo, hookuRomName, NULL, NULL, p4CommonInputInfo, HookDIPInfo, - hookInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Hook (Japan) - -static struct BurnRomInfo hookjRomDesc[] = { - { "h-h0-g.3h", 0x040000, 0x5964c886, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "h-l0-g.5h", 0x040000, 0x7f7433f2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "h-h1.rom", 0x020000, 0x264ba1f0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "h-l1.rom", 0x020000, 0xf9913731, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "h-sh0-a.3l", 0x010000, 0xbd3d1f61, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "h-sl0-a.3n", 0x010000, 0x76371def, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "hook-c0.rom", 0x040000, 0xdec63dcf, 3 | BRF_GRA }, // 6 Background Tiles - { "hook-c1.rom", 0x040000, 0xe4eb0b92, 3 | BRF_GRA }, // 7 - { "hook-c2.rom", 0x040000, 0xa52b320b, 3 | BRF_GRA }, // 8 - { "hook-c3.rom", 0x040000, 0x7ef67731, 3 | BRF_GRA }, // 9 - - { "hook-000.rom", 0x100000, 0xccceac30, 4 | BRF_GRA }, // 10 Sprites - { "hook-010.rom", 0x100000, 0x8ac8da67, 4 | BRF_GRA }, // 11 - { "hook-020.rom", 0x100000, 0x8847af9a, 4 | BRF_GRA }, // 12 - { "hook-030.rom", 0x100000, 0x239e877e, 4 | BRF_GRA }, // 13 - - { "hook-da.rom", 0x080000, 0x88cd0212, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(hookj) -STD_ROM_FN(hookj) - -struct BurnDriver BurnDrvHookj = { - "hookj", "hook", NULL, NULL, "1992", - "Hook (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, hookjRomInfo, hookjRomName, NULL, NULL, p4CommonInputInfo, HookDIPInfo, - hookInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Peter Pan (bootleg of Hook) - -static struct BurnRomInfo ppanRomDesc[] = { - { "1.u6", 0x80000, 0xb135dd6e, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "2.u5", 0x80000, 0x7785289c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "7.u114", 0x40000, 0xdec63dcf, 2 | BRF_PRG | BRF_ESS }, // 2 Background Tiles - { "6.u115", 0x40000, 0xe4eb0b92, 2 | BRF_PRG | BRF_ESS }, // 3 - { "5.u116", 0x40000, 0xa52b320b, 2 | BRF_PRG | BRF_ESS }, // 4 - { "4.u117", 0x40000, 0x7ef67731, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "15.u106", 0x80000, 0xcdfc2f78, 3 | BRF_GRA }, // 6 Sprites - { "14.u110", 0x80000, 0x87e767f0, 3 | BRF_GRA }, // 7 - { "13.u107", 0x80000, 0xe07f2abe, 3 | BRF_GRA }, // 8 - { "12.u111", 0x80000, 0xf446150e, 3 | BRF_GRA }, // 9 - { "11.u108", 0x80000, 0x5c114daa, 3 | BRF_GRA }, // 10 - { "10.u112", 0x80000, 0xfa11fa40, 3 | BRF_GRA }, // 11 - { "9.u109", 0x80000, 0x9d466b1a, 3 | BRF_GRA }, // 12 - { "8.u113", 0x80000, 0xd08a5f6b, 3 | BRF_GRA }, // 13 - - { "3.u122", 0x80000, 0xd0d37028, 4 | BRF_GRA }, // 14 OKI M6295 Samples -}; - -STD_ROM_PICK(ppan) -STD_ROM_FN(ppan) - -static INT32 ppanRomLoad() -{ - if (BurnLoadRom(DrvV33ROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(DrvV33ROM + 0x000000, 1, 2)) return 1; - - UINT8 *tmp = (UINT8 *)BurnMalloc(0x080000); - if (tmp == NULL) { - return 1; - } - - loadDecodeGfx01(tmp, 2, 0, 0x40000); - loadDecodeGfx01(tmp, 3, 1, 0x40000); - loadDecodeGfx01(tmp, 4, 2, 0x40000); - loadDecodeGfx01(tmp, 5, 3, 0x40000); - - DrvGfxROM1 += 0x400000; - - loadDecodeGfx02(tmp, 7, 0, 0x80000); - loadDecodeGfx02(tmp, 9, 1, 0x80000); - loadDecodeGfx02(tmp, 11, 2, 0x80000); - loadDecodeGfx02(tmp, 13, 3, 0x80000); - - DrvGfxROM1 -= 0x400000; - - loadDecodeGfx02(tmp, 6, 0, 0x80000); - loadDecodeGfx02(tmp, 8, 1, 0x80000); - loadDecodeGfx02(tmp, 10, 2, 0x80000); - loadDecodeGfx02(tmp, 12, 3, 0x80000); - - if (BurnLoadRom(DrvSndROM + 0x100000, 14, 1)) return 1; - memcpy (DrvSndROM, DrvSndROM + 0x100000, 0x40000); - - BurnFree (tmp); - - DrvSprBuf = DrvSprRAM; // no sprite buffer!! - - return 0; -} - -static INT32 PpanInit() -{ - m92_kludge = 3; - nScreenOffsets[1] = 120; // ? - return DrvInit(ppanRomLoad, NULL, 1, 0x100000, 0x400000); -} - -struct BurnDriver BurnDrvPpan = { - "ppan", "hook", NULL, NULL, "1992", - "Peter Pan (bootleg of Hook)\0", NULL, "bootleg", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, ppanRomInfo, ppanRomName, NULL, NULL, p4CommonInputInfo, HookDIPInfo, - PpanInit, DrvExit, PpanFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// In The Hunt (World) - -static struct BurnRomInfo inthuntRomDesc[] = { - { "ith-h0-d.bin", 0x040000, 0x52f8e7a6, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "ith-l0-d.bin", 0x040000, 0x5db79eb7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ith-h1-b.bin", 0x020000, 0xfc2899df, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ith-l1-b.bin", 0x020000, 0x955a605a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ith-sh0.rom", 0x010000, 0x209c8b7f, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "ith-sl0.rom", 0x010000, 0x18472d65, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "ith_ic26.rom", 0x080000, 0x4c1818cf, 3 | BRF_GRA }, // 6 Background Tiles - { "ith_ic25.rom", 0x080000, 0x91145bae, 3 | BRF_GRA }, // 7 - { "ith_ic24.rom", 0x080000, 0xfc03fe3b, 3 | BRF_GRA }, // 8 - { "ith_ic23.rom", 0x080000, 0xee156a0a, 3 | BRF_GRA }, // 9 - - { "ith_ic34.rom", 0x100000, 0xa019766e, 4 | BRF_GRA }, // 10 Sprites - { "ith_ic35.rom", 0x100000, 0x3fca3073, 4 | BRF_GRA }, // 11 - { "ith_ic36.rom", 0x100000, 0x20d1b28b, 4 | BRF_GRA }, // 12 - { "ith_ic37.rom", 0x100000, 0x90b6fd4b, 4 | BRF_GRA }, // 13 - - { "ith_ic9.rom", 0x080000, 0x318ee71a, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(inthunt) -STD_ROM_FN(inthunt) - -static INT32 inthuntRomLoad() -{ - return RomLoad(0x080000, 0x080000, 0x100000, 0, 0); -} - -static INT32 inthuntInit() -{ - return DrvInit(inthuntRomLoad, inthunt_decryption_table, 1, 0x200000, 0x400000); -} - -struct BurnDriver BurnDrvInthunt = { - "inthunt", NULL, NULL, NULL, "1993", - "In The Hunt (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M92, GBF_HORSHOOT, 0, - NULL, inthuntRomInfo, inthuntRomName, NULL, NULL, p2CommonInputInfo, InthuntDIPInfo, - inthuntInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// In The Hunt (US) - -static struct BurnRomInfo inthuntuRomDesc[] = { - { "ith-h0-c.bin", 0x040000, 0x563dcec0, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "ith-l0-c.bin", 0x040000, 0x1638c705, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ith-h1-a.bin", 0x020000, 0x0253065f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ith-l1-a.bin", 0x020000, 0xa57d688d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ith-sh0.rom", 0x010000, 0x209c8b7f, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "ith-sl0.rom", 0x010000, 0x18472d65, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "ith_ic26.rom", 0x080000, 0x4c1818cf, 3 | BRF_GRA }, // 6 Background Tiles - { "ith_ic25.rom", 0x080000, 0x91145bae, 3 | BRF_GRA }, // 7 - { "ith_ic24.rom", 0x080000, 0xfc03fe3b, 3 | BRF_GRA }, // 8 - { "ith_ic23.rom", 0x080000, 0xee156a0a, 3 | BRF_GRA }, // 9 - - { "ith_ic34.rom", 0x100000, 0xa019766e, 4 | BRF_GRA }, // 10 Sprites - { "ith_ic35.rom", 0x100000, 0x3fca3073, 4 | BRF_GRA }, // 11 - { "ith_ic36.rom", 0x100000, 0x20d1b28b, 4 | BRF_GRA }, // 12 - { "ith_ic37.rom", 0x100000, 0x90b6fd4b, 4 | BRF_GRA }, // 13 - - { "ith_ic9.rom", 0x080000, 0x318ee71a, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(inthuntu) -STD_ROM_FN(inthuntu) - -struct BurnDriver BurnDrvInthuntu = { - "inthuntu", "inthunt", NULL, NULL, "1993", - "In The Hunt (US)\0", NULL, "Irem America", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_HORSHOOT, 0, - NULL, inthuntuRomInfo, inthuntuRomName, NULL, NULL, p2CommonInputInfo, InthuntDIPInfo, - inthuntInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Kaitei Daisensou (Japan) - -static struct BurnRomInfo kaiteidsRomDesc[] = { - { "ith-h0j.bin", 0x040000, 0xdc1dec36, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "ith-l0j.bin", 0x040000, 0x8835d704, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ith-h1j.bin", 0x020000, 0x5a7b212d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ith-l1j.bin", 0x020000, 0x4c084494, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ith-sh0.rom", 0x010000, 0x209c8b7f, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "ith-sl0.rom", 0x010000, 0x18472d65, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "ith_ic26.rom", 0x080000, 0x4c1818cf, 3 | BRF_GRA }, // 6 Background Tiles - { "ith_ic25.rom", 0x080000, 0x91145bae, 3 | BRF_GRA }, // 7 - { "ith_ic24.rom", 0x080000, 0xfc03fe3b, 3 | BRF_GRA }, // 8 - { "ith_ic23.rom", 0x080000, 0xee156a0a, 3 | BRF_GRA }, // 9 - - { "ith_ic34.rom", 0x100000, 0xa019766e, 4 | BRF_GRA }, // 10 Sprites - { "ith_ic35.rom", 0x100000, 0x3fca3073, 4 | BRF_GRA }, // 11 - { "ith_ic36.rom", 0x100000, 0x20d1b28b, 4 | BRF_GRA }, // 12 - { "ith_ic37.rom", 0x100000, 0x90b6fd4b, 4 | BRF_GRA }, // 13 - - { "ith_ic9.rom", 0x080000, 0x318ee71a, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(kaiteids) -STD_ROM_FN(kaiteids) - -struct BurnDriver BurnDrvKaiteids = { - "kaiteids", "inthunt", NULL, NULL, "1993", - "Kaitei Daisensou (Japan)\0", NULL, "Irem", "M92", - L"Kaitei Daisensou (Japan)\0\u776D\u955E\u2759\u2662\u894E\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_HORSHOOT, 0, - NULL, kaiteidsRomInfo, kaiteidsRomName, NULL, NULL, p2CommonInputInfo, InthuntDIPInfo, - inthuntInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// R-Type Leo (World) - -static struct BurnRomInfo rtypeleoRomDesc[] = { - { "rtl-h0-c.bin", 0x040000, 0x5fef7fa1, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "rtl-l0-c.bin", 0x040000, 0x8156456b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rtl-h1-d.bin", 0x020000, 0x352ff444, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rtl-l1-d.bin", 0x020000, 0xfd34ea46, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "rtl-sh0a.bin", 0x010000, 0xe518b4e3, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "rtl-sl0a.bin", 0x010000, 0x896f0d36, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "rtl-c0.bin", 0x080000, 0xfb588d7c, 3 | BRF_GRA }, // 6 Background Tiles - { "rtl-c1.bin", 0x080000, 0xe5541bff, 3 | BRF_GRA }, // 7 - { "rtl-c2.bin", 0x080000, 0xfaa9ae27, 3 | BRF_GRA }, // 8 - { "rtl-c3.bin", 0x080000, 0x3a2343f6, 3 | BRF_GRA }, // 9 - - { "rtl-000.bin", 0x100000, 0x82a06870, 4 | BRF_GRA }, // 10 Sprites - { "rtl-010.bin", 0x100000, 0x417e7a56, 4 | BRF_GRA }, // 11 - { "rtl-020.bin", 0x100000, 0xf9a3f3a1, 4 | BRF_GRA }, // 12 - { "rtl-030.bin", 0x100000, 0x03528d95, 4 | BRF_GRA }, // 13 - - { "rtl-da.bin", 0x080000, 0xdbebd1ff, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(rtypeleo) -STD_ROM_FN(rtypeleo) - -static INT32 rtypeleoRomLoad() -{ - return RomLoad(0x080000, 0x080000, 0x100000, 0, 0); -} - -static INT32 rtypeleoInit() -{ - return DrvInit(rtypeleoRomLoad, rtypeleo_decryption_table, 1, 0x200000, 0x400000); -} - -struct BurnDriver BurnDrvRtypeleo = { - "rtypeleo", NULL, NULL, NULL, "1992", - "R-Type Leo (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M92, GBF_HORSHOOT, 0, - NULL, rtypeleoRomInfo, rtypeleoRomName, NULL, NULL, p2CommonInputInfo, RtypeleoDIPInfo, - rtypeleoInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// R-Type Leo (Japan) - -static struct BurnRomInfo rtypelejRomDesc[] = { - { "rtl-h0-d.bin", 0x040000, 0x3dbac89f, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "rtl-l0-d.bin", 0x040000, 0xf85a2537, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rtl-h1-d.bin", 0x020000, 0x352ff444, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rtl-l1-d.bin", 0x020000, 0xfd34ea46, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "rtl-sh0a.bin", 0x010000, 0xe518b4e3, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "rtl-sl0a.bin", 0x010000, 0x896f0d36, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "rtl-c0.bin", 0x080000, 0xfb588d7c, 3 | BRF_GRA }, // 6 Background Tiles - { "rtl-c1.bin", 0x080000, 0xe5541bff, 3 | BRF_GRA }, // 7 - { "rtl-c2.bin", 0x080000, 0xfaa9ae27, 3 | BRF_GRA }, // 8 - { "rtl-c3.bin", 0x080000, 0x3a2343f6, 3 | BRF_GRA }, // 9 - - { "rtl-000.bin", 0x100000, 0x82a06870, 4 | BRF_GRA }, // 10 Sprites - { "rtl-010.bin", 0x100000, 0x417e7a56, 4 | BRF_GRA }, // 11 - { "rtl-020.bin", 0x100000, 0xf9a3f3a1, 4 | BRF_GRA }, // 12 - { "rtl-030.bin", 0x100000, 0x03528d95, 4 | BRF_GRA }, // 13 - - { "rtl-da.bin", 0x080000, 0xdbebd1ff, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(rtypelej) -STD_ROM_FN(rtypelej) - -struct BurnDriver BurnDrvRtypelej = { - "rtypeleoj", "rtypeleo", NULL, NULL, "1992", - "R-Type Leo (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_HORSHOOT, 0, - NULL, rtypelejRomInfo, rtypelejRomName, NULL, NULL, p2CommonInputInfo, RtypeleoDIPInfo, - rtypeleoInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Blade Master (World) - -static struct BurnRomInfo bmasterRomDesc[] = { - { "bm_d-h0-b.5m", 0x040000, 0x49b257c7, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "bm_d-l0-b.5f", 0x040000, 0xa873523e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bm_d-h1-b.5l", 0x010000, 0x082b7158, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bm_d-l1-b.5j", 0x010000, 0x6ff0c04e, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bm_d-sh0.rom", 0x010000, 0x9f7c075b, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "bm_d-sl0.rom", 0x010000, 0x1fa87c89, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "bm_c0.rom", 0x040000, 0x2cc966b8, 3 | BRF_GRA }, // 6 Background Tiles - { "bm_c1.rom", 0x040000, 0x46df773e, 3 | BRF_GRA }, // 7 - { "bm_c2.rom", 0x040000, 0x05b867bd, 3 | BRF_GRA }, // 8 - { "bm_c3.rom", 0x040000, 0x0a2227a4, 3 | BRF_GRA }, // 9 - - { "bm_000.rom", 0x080000, 0x339fc9f3, 4 | BRF_GRA }, // 10 Sprites - { "bm_010.rom", 0x080000, 0x6a14377d, 4 | BRF_GRA }, // 11 - { "bm_020.rom", 0x080000, 0x31532198, 4 | BRF_GRA }, // 12 - { "bm_030.rom", 0x080000, 0xd1a041d3, 4 | BRF_GRA }, // 13 - - { "bm_da.rom", 0x080000, 0x62ce5798, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(bmaster) -STD_ROM_FN(bmaster) - -static INT32 bmasterRomLoad() -{ - return RomLoad(0x080000, 0x040000, 0x080000, 0, 0); -} - -static INT32 bmasterInit() -{ - return DrvInit(bmasterRomLoad, bomberman_decryption_table, 1, 0x100000, 0x200000); -} - -struct BurnDriver BurnDrvBmaster = { - "bmaster", NULL, NULL, NULL, "1991", - "Blade Master (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, bmasterRomInfo, bmasterRomName, NULL, NULL, p2CommonInputInfo, BmasterDIPInfo, - bmasterInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Cross Blades! (Japan) - -static struct BurnRomInfo crossbldRomDesc[] = { - { "bm_d-h0.3h", 0x040000, 0xa28a5821, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "bm_d-l0.5h", 0x040000, 0xa504f1a0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bm_d-h1.3e", 0x010000, 0x18da6c47, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bm_d-l1.5e", 0x010000, 0xa65c1b42, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bm_d-sh0.rom", 0x010000, 0x9f7c075b, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "bm_d-sl0.rom", 0x010000, 0x1fa87c89, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "bm_c0.rom", 0x040000, 0x2cc966b8, 3 | BRF_GRA }, // 6 Background Tiles - { "bm_c1.rom", 0x040000, 0x46df773e, 3 | BRF_GRA }, // 7 - { "bm_c2.rom", 0x040000, 0x05b867bd, 3 | BRF_GRA }, // 8 - { "bm_c3.rom", 0x040000, 0x0a2227a4, 3 | BRF_GRA }, // 9 - - { "bm_000.rom", 0x080000, 0x339fc9f3, 4 | BRF_GRA }, // 10 Sprites - { "bm_010.rom", 0x080000, 0x6a14377d, 4 | BRF_GRA }, // 11 - { "bm_020.rom", 0x080000, 0x31532198, 4 | BRF_GRA }, // 12 - { "bm_030.rom", 0x080000, 0xd1a041d3, 4 | BRF_GRA }, // 13 - - { "bm_da.rom", 0x080000, 0x62ce5798, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(crossbld) -STD_ROM_FN(crossbld) - -struct BurnDriver BurnDrvCrossbld = { - "crossbld", "bmaster", NULL, NULL, "1991", - "Cross Blades! (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, crossbldRomInfo, crossbldRomName, NULL, NULL, p2CommonInputInfo, BmasterDIPInfo, - bmasterInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Mystic Riders (World) - -static struct BurnRomInfo mysticriRomDesc[] = { - { "mr-h0-b.bin", 0x040000, 0xd529f887, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "mr-l0-b.bin", 0x040000, 0xa457ab44, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mr-h1-b.bin", 0x010000, 0xe17649b9, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mr-l1-b.bin", 0x010000, 0xa87c62b4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mr-sh0.bin", 0x010000, 0x50d335e4, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "mr-sl0.bin", 0x010000, 0x0fa32721, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "mr-c0.bin", 0x040000, 0x872a8fad, 3 | BRF_GRA }, // 6 Background Tiles - { "mr-c1.bin", 0x040000, 0xd2ffb27a, 3 | BRF_GRA }, // 7 - { "mr-c2.bin", 0x040000, 0x62bff287, 3 | BRF_GRA }, // 8 - { "mr-c3.bin", 0x040000, 0xd0da62ab, 3 | BRF_GRA }, // 9 - - { "mr-o00.bin", 0x080000, 0xa0f9ce16, 4 | BRF_GRA }, // 10 Sprites - { "mr-o10.bin", 0x080000, 0x4e70a9e9, 4 | BRF_GRA }, // 11 - { "mr-o20.bin", 0x080000, 0xb9c468fc, 4 | BRF_GRA }, // 12 - { "mr-o30.bin", 0x080000, 0xcc32433a, 4 | BRF_GRA }, // 13 - - { "mr-da.bin", 0x040000, 0x1a11fc59, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(mysticri) -STD_ROM_FN(mysticri) - -static INT32 mysticriInit() -{ - return DrvInit(bmasterRomLoad, mysticri_decryption_table, 1, 0x100000, 0x200000); -} - -struct BurnDriver BurnDrvMysticri = { - "mysticri", NULL, NULL, NULL, "1992", - "Mystic Riders (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M92, GBF_HORSHOOT, 0, - NULL, mysticriRomInfo, mysticriRomName, NULL, NULL, p2CommonInputInfo, MysticriDIPInfo, - mysticriInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Gun Hohki (Japan) - -static struct BurnRomInfo gunhohkiRomDesc[] = { - { "mr-h0.bin", 0x040000, 0x83352270, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "mr-l0.bin", 0x040000, 0x9db308ae, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mr-h1.bin", 0x010000, 0xc9532b60, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mr-l1.bin", 0x010000, 0x6349b520, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mr-sh0.bin", 0x010000, 0x50d335e4, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "mr-sl0.bin", 0x010000, 0x0fa32721, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "mr-c0.bin", 0x040000, 0x872a8fad, 3 | BRF_GRA }, // 6 Background Tiles - { "mr-c1.bin", 0x040000, 0xd2ffb27a, 3 | BRF_GRA }, // 7 - { "mr-c2.bin", 0x040000, 0x62bff287, 3 | BRF_GRA }, // 8 - { "mr-c3.bin", 0x040000, 0xd0da62ab, 3 | BRF_GRA }, // 9 - - { "mr-o00.bin", 0x080000, 0xa0f9ce16, 4 | BRF_GRA }, // 10 Sprites - { "mr-o10.bin", 0x080000, 0x4e70a9e9, 4 | BRF_GRA }, // 11 - { "mr-o20.bin", 0x080000, 0xb9c468fc, 4 | BRF_GRA }, // 12 - { "mr-o30.bin", 0x080000, 0xcc32433a, 4 | BRF_GRA }, // 13 - - { "mr-da.bin", 0x040000, 0x1a11fc59, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(gunhohki) -STD_ROM_FN(gunhohki) - -struct BurnDriver BurnDrvGunhohki = { - "gunhohki", "mysticri", NULL, NULL, "1992", - "Gun Hohki (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_HORSHOOT, 0, - NULL, gunhohkiRomInfo, gunhohkiRomName, NULL, NULL, p2CommonInputInfo, MysticriDIPInfo, - mysticriInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Mystic Riders (bootleg?) - -static struct BurnRomInfo mysticribRomDesc[] = { - { "h0", 0x040000, 0xe38c1f56, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "l0", 0x040000, 0x77846e48, 1 | BRF_PRG | BRF_ESS }, // 1 - { "h1", 0x010000, 0x4dcb085b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "l1", 0x010000, 0x88df4f70, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sh0", 0x010000, 0xfc7221ee, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "sl0", 0x010000, 0x65c809e6, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "mr-c0.bin", 0x040000, 0x872a8fad, 3 | BRF_GRA }, // 6 Background Tiles - { "mr-c1.bin", 0x040000, 0xd2ffb27a, 3 | BRF_GRA }, // 7 - { "mr-c2.bin", 0x040000, 0x62bff287, 3 | BRF_GRA }, // 8 - { "mr-c3.bin", 0x040000, 0xd0da62ab, 3 | BRF_GRA }, // 9 - - { "mr-o00.bin", 0x080000, 0xa0f9ce16, 4 | BRF_GRA }, // 10 Sprites - { "mr-o10.bin", 0x080000, 0x4e70a9e9, 4 | BRF_GRA }, // 11 - { "mr-o20.bin", 0x080000, 0xb9c468fc, 4 | BRF_GRA }, // 12 - { "mr-o30.bin", 0x080000, 0xcc32433a, 4 | BRF_GRA }, // 13 - - { "mr-da.bin", 0x040000, 0x1a11fc59, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(mysticrib) -STD_ROM_FN(mysticrib) - -struct BurnDriver BurnDrvMysticrib = { - "mysticrib", "mysticri", NULL, NULL, "1992", - "Mystic Riders (bootleg?)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_HORSHOOT, 0, - NULL, mysticribRomInfo, mysticribRomName, NULL, NULL, p2CommonInputInfo, MysticriDIPInfo, - mysticriInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Gunforce - Battle Fire Engulfed Terror Island (World) - -static struct BurnRomInfo gunforceRomDesc[] = { - { "gf_h0-c.5m", 0x020000, 0xc09bb634, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "gf_l0-c.5f", 0x020000, 0x1bef6f7d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gf_h1-c.5l", 0x020000, 0xc84188b7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gf_l1-c.5j", 0x020000, 0xb189f72a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gf_sh0.rom", 0x010000, 0x3f8f16e0, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "gf_sl0.rom", 0x010000, 0xdb0b13a3, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gf_c0.rom", 0x040000, 0xb3b74979, 3 | BRF_GRA }, // 6 Background Tiles - { "gf_c1.rom", 0x040000, 0xf5c8590a, 3 | BRF_GRA }, // 7 - { "gf_c2.rom", 0x040000, 0x30f9fb64, 3 | BRF_GRA }, // 8 - { "gf_c3.rom", 0x040000, 0x87b3e621, 3 | BRF_GRA }, // 9 - - { "gf_000.rom", 0x040000, 0x209e8e8d, 4 | BRF_GRA }, // 10 Sprites - { "gf_010.rom", 0x040000, 0x6e6e7808, 4 | BRF_GRA }, // 11 - { "gf_020.rom", 0x040000, 0x6f5c3cb0, 4 | BRF_GRA }, // 12 - { "gf_030.rom", 0x040000, 0x18978a9f, 4 | BRF_GRA }, // 13 - - { "gf-da.rom", 0x020000, 0x933ba935, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(gunforce) -STD_ROM_FN(gunforce) - -static INT32 gunforceRomLoad() -{ - return RomLoad(0x040000, 0x040000, 0x040000, 0, 0); -} - -static INT32 gunforceInit() -{ - return DrvInit(gunforceRomLoad, gunforce_decryption_table, 1, 0x100000, 0x100000); -} - -struct BurnDriver BurnDrvGunforce = { - "gunforce", NULL, NULL, NULL, "1991", - "Gunforce - Battle Fire Engulfed Terror Island (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M92, GBF_PLATFORM, 0, - NULL, gunforceRomInfo, gunforceRomName, NULL, NULL, p2CommonInputInfo, GunforceDIPInfo, - gunforceInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Gunforce - Battle Fire Engulfed Terror Island (Japan) - -static struct BurnRomInfo gunforcejRomDesc[] = { - { "gfb_h0-e.5m", 0x020000, 0x43c36e0f, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "gfb_l0-e.5f", 0x020000, 0x24a558d8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gfb_h1-e.5l", 0x020000, 0xd9744f5d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gfb_l1-e.5j", 0x020000, 0xa0f7b61b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gf_sh0.rom", 0x010000, 0x3f8f16e0, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "gf_sl0.rom", 0x010000, 0xdb0b13a3, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gf_c0.rom", 0x040000, 0xb3b74979, 3 | BRF_GRA }, // 6 Background Tiles - { "gf_c1.rom", 0x040000, 0xf5c8590a, 3 | BRF_GRA }, // 7 - { "gf_c2.rom", 0x040000, 0x30f9fb64, 3 | BRF_GRA }, // 8 - { "gf_c3.rom", 0x040000, 0x87b3e621, 3 | BRF_GRA }, // 9 - - { "gf_000.rom", 0x040000, 0x209e8e8d, 4 | BRF_GRA }, // 10 Sprites - { "gf_010.rom", 0x040000, 0x6e6e7808, 4 | BRF_GRA }, // 11 - { "gf_020.rom", 0x040000, 0x6f5c3cb0, 4 | BRF_GRA }, // 12 - { "gf_030.rom", 0x040000, 0x18978a9f, 4 | BRF_GRA }, // 13 - - { "gf-da.rom", 0x020000, 0x933ba935, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(gunforcej) -STD_ROM_FN(gunforcej) - -struct BurnDriver BurnDrvGunforcej = { - "gunforcej", "gunforce", NULL, NULL, "1991", - "Gunforce - Battle Fire Engulfed Terror Island (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_PLATFORM, 0, - NULL, gunforcejRomInfo, gunforcejRomName, NULL, NULL, p2CommonInputInfo, GunforceDIPInfo, - gunforceInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Gunforce - Battle Fire Engulfed Terror Island (US) - -static struct BurnRomInfo gunforceuRomDesc[] = { - { "gf_h0-d.5m", 0x020000, 0xa6db7b5c, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "gf_l0-d.5f", 0x020000, 0x82cf55f6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gf_h1-d.5l", 0x020000, 0x08a3736c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gf_l1-d.5j", 0x020000, 0x435f524f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gf_sh0.rom", 0x010000, 0x3f8f16e0, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "gf_sl0.rom", 0x010000, 0xdb0b13a3, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gf_c0.rom", 0x040000, 0xb3b74979, 3 | BRF_GRA }, // 6 Background Tiles - { "gf_c1.rom", 0x040000, 0xf5c8590a, 3 | BRF_GRA }, // 7 - { "gf_c2.rom", 0x040000, 0x30f9fb64, 3 | BRF_GRA }, // 8 - { "gf_c3.rom", 0x040000, 0x87b3e621, 3 | BRF_GRA }, // 9 - - { "gf_000.rom", 0x040000, 0x209e8e8d, 4 | BRF_GRA }, // 10 Sprites - { "gf_010.rom", 0x040000, 0x6e6e7808, 4 | BRF_GRA }, // 11 - { "gf_020.rom", 0x040000, 0x6f5c3cb0, 4 | BRF_GRA }, // 12 - { "gf_030.rom", 0x040000, 0x18978a9f, 4 | BRF_GRA }, // 13 - - { "gf-da.rom", 0x020000, 0x933ba935, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(gunforceu) -STD_ROM_FN(gunforceu) - -struct BurnDriver BurnDrvGunforceu = { - "gunforceu", "gunforce", NULL, NULL, "1991", - "Gunforce - Battle Fire Engulfed Terror Island (US)\0", NULL, "Irem America", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_PLATFORM, 0, - NULL, gunforceuRomInfo, gunforceuRomName, NULL, NULL, p2CommonInputInfo, GunforceDIPInfo, - gunforceInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Undercover Cops (World) - -static struct BurnRomInfo uccopsRomDesc[] = { - { "uc_h0.rom", 0x040000, 0x240aa5f7, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "uc_l0.rom", 0x040000, 0xdf9a4826, 1 | BRF_PRG | BRF_ESS }, // 1 - { "uc_h1.rom", 0x020000, 0x8d29bcd6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "uc_l1.rom", 0x020000, 0xa8a402d8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "uc_sh0.rom", 0x010000, 0xdf90b198, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "uc_sl0.rom", 0x010000, 0x96c11aac, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "uc_w38m.rom", 0x080000, 0x130a40e5, 3 | BRF_GRA }, // 6 Background Tiles - { "uc_w39m.rom", 0x080000, 0xe42ca144, 3 | BRF_GRA }, // 7 - { "uc_w40m.rom", 0x080000, 0xc2961648, 3 | BRF_GRA }, // 8 - { "uc_w41m.rom", 0x080000, 0xf5334b80, 3 | BRF_GRA }, // 9 - - { "uc_k16m.rom", 0x100000, 0x4a225f09, 4 | BRF_GRA }, // 10 Sprites - { "uc_k17m.rom", 0x100000, 0xe4ed9a54, 4 | BRF_GRA }, // 11 - { "uc_k18m.rom", 0x100000, 0xa626eb12, 4 | BRF_GRA }, // 12 - { "uc_k19m.rom", 0x100000, 0x5df46549, 4 | BRF_GRA }, // 13 - - { "uc_w42.rom", 0x080000, 0xd17d3fd6, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(uccops) -STD_ROM_FN(uccops) - -static INT32 uccopsRomLoad() -{ - return RomLoad(0x080000, 0x080000, 0x100000, 0, 0); -} - -static INT32 uccopsInit() -{ - return DrvInit(uccopsRomLoad, dynablaster_decryption_table, 1, 0x200000, 0x400000); -} - -struct BurnDriver BurnDrvUccops = { - "uccops", NULL, NULL, NULL, "1992", - "Undercover Cops (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, uccopsRomInfo, uccopsRomName, NULL, NULL, p3CommonInputInfo, UccopsDIPInfo, - uccopsInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Undercover Cops (US) - -static struct BurnRomInfo uccopsuRomDesc[] = { - { "uc_h0.rom", 0x040000, 0x240aa5f7, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "uc_l0.rom", 0x040000, 0xdf9a4826, 1 | BRF_PRG | BRF_ESS }, // 1 - { "uc_h1-g.rom", 0x020000, 0x6b8ca2de, 1 | BRF_PRG | BRF_ESS }, // 2 - { "uc_l1-g.rom", 0x020000, 0x2bdec7dd, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "uc_sh0.rom", 0x010000, 0xdf90b198, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "uc_sl0.rom", 0x010000, 0x96c11aac, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "uc_w38m.rom", 0x080000, 0x130a40e5, 3 | BRF_GRA }, // 6 Background Tiles - { "uc_w39m.rom", 0x080000, 0xe42ca144, 3 | BRF_GRA }, // 7 - { "uc_w40m.rom", 0x080000, 0xc2961648, 3 | BRF_GRA }, // 8 - { "uc_w41m.rom", 0x080000, 0xf5334b80, 3 | BRF_GRA }, // 9 - - { "uc_k16m.rom", 0x100000, 0x4a225f09, 4 | BRF_GRA }, // 10 Sprites - { "uc_k17m.rom", 0x100000, 0xe4ed9a54, 4 | BRF_GRA }, // 11 - { "uc_k18m.rom", 0x100000, 0xa626eb12, 4 | BRF_GRA }, // 12 - { "uc_k19m.rom", 0x100000, 0x5df46549, 4 | BRF_GRA }, // 13 - - { "uc_w42.rom", 0x080000, 0xd17d3fd6, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(uccopsu) -STD_ROM_FN(uccopsu) - -struct BurnDriver BurnDrvUccopsu = { - "uccopsu", "uccops", NULL, NULL, "1992", - "Undercover Cops (US)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, uccopsuRomInfo, uccopsuRomName, NULL, NULL, p3CommonInputInfo, UccopsDIPInfo, - uccopsInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Undercover Cops (Alpha Renewal Version) - -static struct BurnRomInfo uccopsarRomDesc[] = { - { "uc_h0_a.ic28", 0x040000, 0x9e17cada, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "uc_l0_a.ic39", 0x040000, 0x4a4e3208, 1 | BRF_PRG | BRF_ESS }, // 1 - { "uc_h1.ic27", 0x020000, 0x79d79742, 1 | BRF_PRG | BRF_ESS }, // 2 - { "uc_l1.ic38", 0x020000, 0x37211581, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "uc_sh0.ic30", 0x010000, 0xf0ca1b03, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "uc_sl0.ic31", 0x010000, 0xd1661723, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "uc_c0.ic26", 0x080000, 0x6a419a36, 3 | BRF_GRA }, // 6 Background Tiles - { "uc_c1.ic25", 0x080000, 0xd703ecc7, 3 | BRF_GRA }, // 7 - { "uc_c2.ic24", 0x080000, 0x96397ac6, 3 | BRF_GRA }, // 8 - { "uc_c3.ic23", 0x080000, 0x5d07d10d, 3 | BRF_GRA }, // 9 - - { "uc_030.ic37", 0x100000, 0x97f7775e, 4 | BRF_GRA }, // 10 Sprites - { "uc_020.ic36", 0x100000, 0x5e0b1d65, 4 | BRF_GRA }, // 11 - { "uc_010.ic35", 0x100000, 0xbdc224b3, 4 | BRF_GRA }, // 12 - { "uc_000.ic34", 0x100000, 0x7526daec, 4 | BRF_GRA }, // 13 - - { "uc_da.bin", 0x080000, 0x0b2855e9, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(uccopsar) -STD_ROM_FN(uccopsar) - -struct BurnDriver BurnDrvUccopsar = { - "uccopsar", "uccops", NULL, NULL, "1992", - "Undercover Cops (Alpha Renewal Version)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, uccopsarRomInfo, uccopsarRomName, NULL, NULL, p3CommonInputInfo, UccopsDIPInfo, - uccopsInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Undercover Cops (Japan) - -static struct BurnRomInfo uccopsjRomDesc[] = { - { "uc_h0_a.ic28", 0x040000, 0x9e17cada, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "uc_l0_a.ic39", 0x040000, 0x4a4e3208, 1 | BRF_PRG | BRF_ESS }, // 1 - { "uc_h1_a.ic27", 0x020000, 0x83f78dea, 1 | BRF_PRG | BRF_ESS }, // 2 - { "uc_l1_a.ic38", 0x020000, 0x19628280, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "uc_sh0.ic30", 0x010000, 0xf0ca1b03, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "uc_sl0.ic31", 0x010000, 0xd1661723, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "uc_c0.ic26", 0x080000, 0x6a419a36, 3 | BRF_GRA }, // 6 Background Tiles - { "uc_c1.ic25", 0x080000, 0xd703ecc7, 3 | BRF_GRA }, // 7 - { "uc_c2.ic24", 0x080000, 0x96397ac6, 3 | BRF_GRA }, // 8 - { "uc_c3.ic23", 0x080000, 0x5d07d10d, 3 | BRF_GRA }, // 9 - - { "uc_030.ic37", 0x100000, 0x97f7775e, 4 | BRF_GRA }, // 10 Sprites - { "uc_020.ic36", 0x100000, 0x5e0b1d65, 4 | BRF_GRA }, // 11 - { "uc_010.ic35", 0x100000, 0xbdc224b3, 4 | BRF_GRA }, // 12 - { "uc_000.ic34", 0x100000, 0x7526daec, 4 | BRF_GRA }, // 13 - - { "uc_da.bin", 0x080000, 0x0b2855e9, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(uccopsj) -STD_ROM_FN(uccopsj) - -struct BurnDriver BurnDrvUccopsj = { - "uccopsj", "uccops", NULL, NULL, "1992", - "Undercover Cops (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, uccopsjRomInfo, uccopsjRomName, NULL, NULL, p3CommonInputInfo, UccopsDIPInfo, - uccopsInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Gunforce 2 (US) - -static struct BurnRomInfo gunforc2RomDesc[] = { - { "a2-h0-a.6h", 0x040000, 0x49965e22, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "a2-l0-a.8h", 0x040000, 0x8c88b278, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a2-h1-a.6f", 0x040000, 0x34280b88, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a2-l1-a.8f", 0x040000, 0xc8c13f51, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "a2_sh0.3l", 0x010000, 0x2e2d103d, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "a2_sl0.5l", 0x010000, 0x2287e0b3, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "a2_c0.1a", 0x080000, 0x68b8f574, 3 | BRF_GRA }, // 6 Background Tiles - { "a2_c1.1b", 0x080000, 0x0b9efe67, 3 | BRF_GRA }, // 7 - { "a2_c2.3a", 0x080000, 0x7a9e9978, 3 | BRF_GRA }, // 8 - { "a2_c3.3b", 0x080000, 0x1395ee6d, 3 | BRF_GRA }, // 9 - - { "a2_000.8a", 0x100000, 0x38e03147, 4 | BRF_GRA }, // 10 Sprites - { "a2_010.8b", 0x100000, 0x1d5b05f8, 4 | BRF_GRA }, // 11 - { "a2_020.8c", 0x100000, 0xf2f461cc, 4 | BRF_GRA }, // 12 - { "a2_030.8d", 0x100000, 0x97609d9d, 4 | BRF_GRA }, // 13 - - { "a2_da.1l", 0x100000, 0x3c8cdb6a, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(gunforc2) -STD_ROM_FN(gunforc2) - -static INT32 gunforc2RomLoad() -{ - return RomLoad(0x100000, 0x080000, 0x100000, 0, 0); -} - -static INT32 gunforc2Init() -{ - INT32 nRet; - - nRet = DrvInit(gunforc2RomLoad, lethalth_decryption_table, 1, 0x200000, 0x400000); - - if (nRet == 0) { - memcpy (DrvV33ROM + 0x80000, DrvV33ROM + 0x100000, 0x20000); - } - - return nRet; -} - -struct BurnDriver BurnDrvGunforc2 = { - "gunforc2", NULL, NULL, NULL, "1994", - "Gunforce 2 (US)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M92, GBF_PLATFORM, 0, - NULL, gunforc2RomInfo, gunforc2RomName, NULL, NULL, p2CommonInputInfo, Gunforc2DIPInfo, - gunforc2Init, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Geostorm (Japan) - -static struct BurnRomInfo geostormRomDesc[] = { - { "geo-h0.bin", 0x040000, 0x9be58d09, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "geo-l0.bin", 0x040000, 0x59abb75d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a2-h1-a.6f", 0x040000, 0x34280b88, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a2-l1-a.8f", 0x040000, 0xc8c13f51, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "a2_sh0.3l", 0x010000, 0x2e2d103d, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "a2_sl0.5l", 0x010000, 0x2287e0b3, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "a2_c0.1a", 0x080000, 0x68b8f574, 3 | BRF_GRA }, // 6 Background Tiles - { "a2_c1.1b", 0x080000, 0x0b9efe67, 3 | BRF_GRA }, // 7 - { "a2_c2.3a", 0x080000, 0x7a9e9978, 3 | BRF_GRA }, // 8 - { "a2_c3.3b", 0x080000, 0x1395ee6d, 3 | BRF_GRA }, // 9 - - { "a2_000.8a", 0x100000, 0x38e03147, 4 | BRF_GRA }, // 10 Sprites - { "a2_010.8b", 0x100000, 0x1d5b05f8, 4 | BRF_GRA }, // 11 - { "a2_020.8c", 0x100000, 0xf2f461cc, 4 | BRF_GRA }, // 12 - { "a2_030.8d", 0x100000, 0x97609d9d, 4 | BRF_GRA }, // 13 - - { "a2_da.1l", 0x100000, 0x3c8cdb6a, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(geostorm) -STD_ROM_FN(geostorm) - -struct BurnDriver BurnDrvGeostorm = { - "geostorm", "gunforc2", NULL, NULL, "1994", - "Geostorm (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_PLATFORM, 0, - NULL, geostormRomInfo, geostormRomName, NULL, NULL, p2CommonInputInfo, Gunforc2DIPInfo, - gunforc2Init, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Ninja Baseball Batman (World) - -static struct BurnRomInfo nbbatmanRomDesc[] = { - { "6_h0.34", 0x040000, 0x5c4a1e3f, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "3_l0.31", 0x040000, 0x3d6d70ae, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a1-h1-.33", 0x040000, 0x3ce2aab5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a1-l1-.32", 0x040000, 0x116d9bcc, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "a1-sh0-.14", 0x010000, 0xb7fae3e6, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "a1-sl0-.17", 0x010000, 0xb26d54fc, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "lh534k0c.9", 0x080000, 0x314a0c6d, 3 | BRF_GRA }, // 6 Background Tiles - { "lh534k0e.10", 0x080000, 0xdc31675b, 3 | BRF_GRA }, // 7 - { "lh534k0f.11", 0x080000, 0xe15d8bfb, 3 | BRF_GRA }, // 8 - { "lh534k0g.12", 0x080000, 0x888d71a3, 3 | BRF_GRA }, // 9 - - { "lh538393.42", 0x100000, 0x26cdd224, 4 | BRF_GRA }, // 10 Sprites - { "lh538394.43", 0x100000, 0x4bbe94fa, 4 | BRF_GRA }, // 11 - { "lh538395.44", 0x100000, 0x2a533b5e, 4 | BRF_GRA }, // 12 - { "lh538396.45", 0x100000, 0x863a66fa, 4 | BRF_GRA }, // 13 - - { "lh534k0k.8", 0x080000, 0x735e6380, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(nbbatman) -STD_ROM_FN(nbbatman) - -static INT32 nbbatmanInit() -{ - INT32 nRet; - const UINT8 *decrtab = leagueman_decryption_table; - - m92_kludge = 4; - - if (DrvInput[8] & 1) // dip option, use old soundCPU emulation "style", for weirdos! - decrtab = leagueman_OLD_decryption_table; - - nRet = DrvInit(gunforc2RomLoad, decrtab, 1, 0x200000, 0x400000); - - if (nRet == 0) { - memcpy (DrvV33ROM + 0x80000, DrvV33ROM + 0x100000, 0x20000); - } - - return nRet; -} - -struct BurnDriver BurnDrvNbbatman = { - "nbbatman", NULL, NULL, NULL, "1993", - "Ninja Baseball Batman (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, nbbatmanRomInfo, nbbatmanRomName, NULL, NULL, nbbatmanInputInfo, NbbatmanDIPInfo, - nbbatmanInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Ninja Baseball Batman (US) - -static struct BurnRomInfo nbbatmanuRomDesc[] = { - { "a1-h0-a.34", 0x040000, 0x24a9b794, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "a1-l0-a.31", 0x040000, 0x846d7716, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a1-h1-.33", 0x040000, 0x3ce2aab5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a1-l1-.32", 0x040000, 0x116d9bcc, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "a1-sh0-.14", 0x010000, 0xb7fae3e6, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "a1-sl0-.17", 0x010000, 0xb26d54fc, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "lh534k0c.9", 0x080000, 0x314a0c6d, 3 | BRF_GRA }, // 6 Background Tiles - { "lh534k0e.10", 0x080000, 0xdc31675b, 3 | BRF_GRA }, // 7 - { "lh534k0f.11", 0x080000, 0xe15d8bfb, 3 | BRF_GRA }, // 8 - { "lh534k0g.12", 0x080000, 0x888d71a3, 3 | BRF_GRA }, // 9 - - { "lh538393.42", 0x100000, 0x26cdd224, 4 | BRF_GRA }, // 10 Sprites - { "lh538394.43", 0x100000, 0x4bbe94fa, 4 | BRF_GRA }, // 11 - { "lh538395.44", 0x100000, 0x2a533b5e, 4 | BRF_GRA }, // 12 - { "lh538396.45", 0x100000, 0x863a66fa, 4 | BRF_GRA }, // 13 - - { "lh534k0k.8", 0x080000, 0x735e6380, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(nbbatmanu) -STD_ROM_FN(nbbatmanu) - -struct BurnDriver BurnDrvNbbatmanu = { - "nbbatmanu", "nbbatman", NULL, NULL, "1993", - "Ninja Baseball Batman (US)\0", NULL, "Irem America", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, nbbatmanuRomInfo, nbbatmanuRomName, NULL, NULL, p4CommonInputInfo, NbbatmanDIPInfo, - nbbatmanInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Yakyuu Kakutou League-Man (Japan) - -static struct BurnRomInfo leaguemnRomDesc[] = { - { "lma1-h0.34", 0x040000, 0x47c54204, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "lma1-l0.31", 0x040000, 0x1d062c82, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a1-h1-.33", 0x040000, 0x3ce2aab5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a1-l1-.32", 0x040000, 0x116d9bcc, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "a1-sh0-.14", 0x010000, 0xb7fae3e6, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "a1-sl0-.17", 0x010000, 0xb26d54fc, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "lh534k0c.9", 0x080000, 0x314a0c6d, 3 | BRF_GRA }, // 6 Background Tiles - { "lh534k0e.10", 0x080000, 0xdc31675b, 3 | BRF_GRA }, // 7 - { "lh534k0f.11", 0x080000, 0xe15d8bfb, 3 | BRF_GRA }, // 8 - { "lh534k0g.12", 0x080000, 0x888d71a3, 3 | BRF_GRA }, // 9 - - { "lh538393.42", 0x100000, 0x26cdd224, 4 | BRF_GRA }, // 10 Sprites - { "lh538394.43", 0x100000, 0x4bbe94fa, 4 | BRF_GRA }, // 11 - { "lh538395.44", 0x100000, 0x2a533b5e, 4 | BRF_GRA }, // 12 - { "lh538396.45", 0x100000, 0x863a66fa, 4 | BRF_GRA }, // 13 - - { "lh534k0k.8", 0x080000, 0x735e6380, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(leaguemn) -STD_ROM_FN(leaguemn) - -struct BurnDriver BurnDrvLeaguemn = { - "leaguemn", "nbbatman", NULL, NULL, "1993", - "Yakyuu Kakutou League-Man (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IREM_M92, GBF_SCRFIGHT, 0, - NULL, leaguemnRomInfo, leaguemnRomName, NULL, NULL, p4CommonInputInfo, NbbatmanDIPInfo, - nbbatmanInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Lethal Thunder (World) - -static struct BurnRomInfo lethalthRomDesc[] = { - { "lt_d-h0.rom", 0x020000, 0x20c68935, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "lt_d-l0.rom", 0x020000, 0xe1432fb3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lt_d-h1.rom", 0x020000, 0xd7dd3d48, 1 | BRF_PRG | BRF_ESS }, // 2 - { "lt_d-l1.rom", 0x020000, 0xb94b3bd8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "lt_d-sh0.rom", 0x010000, 0xaf5b224f, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "lt_d-sl0.rom", 0x010000, 0xcb3faac3, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "lt_7a.rom", 0x040000, 0xada0fd50, 3 | BRF_GRA }, // 6 Background Tiles - { "lt_7b.rom", 0x040000, 0xd2596883, 3 | BRF_GRA }, // 7 - { "lt_7d.rom", 0x040000, 0x2de637ef, 3 | BRF_GRA }, // 8 - { "lt_7h.rom", 0x040000, 0x9f6585cd, 3 | BRF_GRA }, // 9 - - { "lt_7j.rom", 0x040000, 0xbaf8863e, 4 | BRF_GRA }, // 10 Sprites - { "lt_7l.rom", 0x040000, 0x40fd50af, 4 | BRF_GRA }, // 11 - { "lt_7s.rom", 0x040000, 0xc8e970df, 4 | BRF_GRA }, // 12 - { "lt_7y.rom", 0x040000, 0xf5436708, 4 | BRF_GRA }, // 13 - - { "lt_8a.rom", 0x040000, 0x357762a2, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(lethalth) -STD_ROM_FN(lethalth) - -static INT32 lethalthRomLoad() -{ - m92_kludge = 1; - return RomLoad(0x040000, 0x040000, 0x040000, 0, 0); -} - -static INT32 lethalthInit() -{ - return DrvInit(lethalthRomLoad, lethalth_decryption_table, 0, 0x100000, 0x100000); -} - -struct BurnDriver BurnDrvLethalth = { - "lethalth", NULL, NULL, NULL, "1991", - "Lethal Thunder (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_M92, GBF_VERSHOOT, 0, - NULL, lethalthRomInfo, lethalthRomName, NULL, NULL, p2CommonInputInfo, LethalthDIPInfo, - lethalthInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Thunder Blaster (Japan) - -static struct BurnRomInfo thndblstRomDesc[] = { - { "lt_d-h0j.rom", 0x020000, 0xdc218a18, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "lt_d-l0j.rom", 0x020000, 0xae9a3f81, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lt_d-h1.rom", 0x020000, 0xd7dd3d48, 1 | BRF_PRG | BRF_ESS }, // 2 - { "lt_d-l1.rom", 0x020000, 0xb94b3bd8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "lt_d-sh0.rom", 0x010000, 0xaf5b224f, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "lt_d-sl0.rom", 0x010000, 0xcb3faac3, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "lt_7a.rom", 0x040000, 0xada0fd50, 3 | BRF_GRA }, // 6 Background Tiles - { "lt_7b.rom", 0x040000, 0xd2596883, 3 | BRF_GRA }, // 7 - { "lt_7d.rom", 0x040000, 0x2de637ef, 3 | BRF_GRA }, // 8 - { "lt_7h.rom", 0x040000, 0x9f6585cd, 3 | BRF_GRA }, // 9 - - { "lt_7j.rom", 0x040000, 0xbaf8863e, 4 | BRF_GRA }, // 10 Sprites - { "lt_7l.rom", 0x040000, 0x40fd50af, 4 | BRF_GRA }, // 11 - { "lt_7s.rom", 0x040000, 0xc8e970df, 4 | BRF_GRA }, // 12 - { "lt_7y.rom", 0x040000, 0xf5436708, 4 | BRF_GRA }, // 13 - - { "lt_8a.rom", 0x040000, 0x357762a2, 5 | BRF_SND }, // 14 Irem GA20 Samples -}; - -STD_ROM_PICK(thndblst) -STD_ROM_FN(thndblst) - -struct BurnDriver BurnDrvThndblst = { - "thndblst", "lethalth", NULL, NULL, "1991", - "Thunder Blaster (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_IREM_M92, GBF_VERSHOOT, 0, - NULL, thndblstRomInfo, thndblstRomName, NULL, NULL, p2CommonInputInfo, LethalthDIPInfo, - lethalthInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Dream Soccer '94 (Japan) - -static struct BurnRomInfo dsoccr94jRomDesc[] = { - { "a3_-h0-e.bin", 0x040000, 0x8de1dbcd, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "a3_-l0-e.bin", 0x040000, 0xd3df8bfd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ds_h1-c.rom", 0x040000, 0x6109041b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ds_l1-c.rom", 0x040000, 0x97a01f6b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ds_sh0.rom", 0x010000, 0x23fe6ffc, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "ds_sl0.rom", 0x010000, 0x768132e5, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "c0.bin", 0x100000, 0x83ea8a47, 3 | BRF_GRA }, // 6 Background Tiles - { "c1.bin", 0x100000, 0x64063e6d, 3 | BRF_GRA }, // 7 - { "c2.bin", 0x100000, 0xcc1f621a, 3 | BRF_GRA }, // 8 - { "c3.bin", 0x100000, 0x515829e1, 3 | BRF_GRA }, // 9 - - { "a3-o00-w.bin", 0x080000, 0xb094e5ad, 4 | BRF_GRA }, // 10 Sprites - { "a3-o01-w.bin", 0x080000, 0x91f34018, 4 | BRF_GRA }, // 11 - { "a3-o10-w.bin", 0x080000, 0xedddeef4, 4 | BRF_GRA }, // 12 - { "a3-o11-w.bin", 0x080000, 0x274a9526, 4 | BRF_GRA }, // 13 - { "a3-o20-w.bin", 0x080000, 0x32064393, 4 | BRF_GRA }, // 14 - { "a3-o21-w.bin", 0x080000, 0x57bae3d9, 4 | BRF_GRA }, // 15 - { "a3-o30-w.bin", 0x080000, 0xbe838e2f, 4 | BRF_GRA }, // 16 - { "a3-o31-w.bin", 0x080000, 0xbf899f0d, 4 | BRF_GRA }, // 17 - - { "ds_da0.rom", 0x100000, 0x67fc52fd, 5 | BRF_SND }, // 18 Irem GA20 Samples -}; - -STD_ROM_PICK(dsoccr94j) -STD_ROM_FN(dsoccr94j) - -static INT32 dsoccr94jRomLoad() -{ - return RomLoad(0x100000, 0x100000, 0x100000, 1, 0); -} - -static INT32 dsoccr94jInit() -{ - return DrvInit(dsoccr94jRomLoad, dsoccr94_decryption_table, 1, 0x400000, 0x400000); -} - -struct BurnDriver BurnDrvDsoccr94j = { - "dsoccr94j", "dsoccr94", NULL, NULL, "1994", - "Dream Soccer '94 (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IREM_M92, GBF_SPORTSFOOTBALL, 0, - NULL, dsoccr94jRomInfo, dsoccr94jRomName, NULL, NULL, p4CommonInputInfo, Dsoccr94jDIPInfo, - dsoccr94jInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Superior Soldiers (US) - -static struct BurnRomInfo ssoldierRomDesc[] = { - { "f3-h0-h.bin", 0x040000, 0xb63fb9da, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "f3-l0-h.bin", 0x040000, 0x419361a2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "f3-h1-a.bin", 0x020000, 0xe3d9f619, 1 | BRF_PRG | BRF_ESS }, // 2 - { "f3-l1-a.bin", 0x020000, 0x8cb5c396, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "f3_sh0.sh0", 0x010000, 0x90b55e5e, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "f3_sl0.sl0", 0x010000, 0x77c16d57, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "f3_w50.c0", 0x040000, 0x47e788ee, 3 | BRF_GRA }, // 6 Background Tiles - { "f3_w51.c1", 0x040000, 0x8e535e3f, 3 | BRF_GRA }, // 7 - { "f3_w52.c2", 0x040000, 0xa6eb2e56, 3 | BRF_GRA }, // 8 - { "f3_w53.c3", 0x040000, 0x2f992807, 3 | BRF_GRA }, // 9 - - { "f3_w37.000", 0x100000, 0xfd4cda03, 4 | BRF_GRA }, // 10 Sprites - { "f3_w38.001", 0x100000, 0x755bab10, 4 | BRF_GRA }, // 11 - { "f3_w39.010", 0x100000, 0xb21ced92, 4 | BRF_GRA }, // 12 - { "f3_w40.011", 0x100000, 0x2e906889, 4 | BRF_GRA }, // 13 - { "f3_w41.020", 0x100000, 0x02455d10, 4 | BRF_GRA }, // 14 - { "f3_w42.021", 0x100000, 0x124589b9, 4 | BRF_GRA }, // 15 - { "f3_w43.030", 0x100000, 0xdae7327a, 4 | BRF_GRA }, // 16 - { "f3_w44.031", 0x100000, 0xd0fc84ac, 4 | BRF_GRA }, // 17 - - { "f3_w95.da", 0x080000, 0xf7ca432b, 5 | BRF_SND }, // 18 Irem GA20 Samples -}; - -STD_ROM_PICK(ssoldier) -STD_ROM_FN(ssoldier) - -static INT32 ssoldierRomLoad() -{ - return RomLoad(0x080000, 0x040000, 0x200000, 1, 0); -} - -static INT32 ssoldierInit() -{ - m92_kludge = 1; - - return DrvInit(ssoldierRomLoad, psoldier_decryption_table, 1, 0x100000, 0x800000); -} - -struct BurnDriver BurnDrvSsoldier = { - "ssoldier", NULL, NULL, NULL, "1993", - "Superior Soldiers (US)\0", NULL, "Irem America", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M92, GBF_VSFIGHT, 0, - NULL, ssoldierRomInfo, ssoldierRomName, NULL, NULL, PsoldierInputInfo, PsoldierDIPInfo, - ssoldierInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Perfect Soldiers (Japan) - -static struct BurnRomInfo psoldierRomDesc[] = { - { "f3_h0-d.bin", 0x040000, 0x38f131fd, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "f3_l0-d.bin", 0x040000, 0x1662969c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "f3_h1-.bin", 0x040000, 0xc8d1947c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "f3_l1-.bin", 0x040000, 0x7b9492fc, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "f3_sh0.sh0", 0x010000, 0x90b55e5e, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "f3_sl0.sl0", 0x010000, 0x77c16d57, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "f3_w50.c0", 0x040000, 0x47e788ee, 3 | BRF_GRA }, // 6 Background Tiles - { "f3_w51.c1", 0x040000, 0x8e535e3f, 3 | BRF_GRA }, // 7 - { "f3_w52.c2", 0x040000, 0xa6eb2e56, 3 | BRF_GRA }, // 8 - { "f3_w53.c3", 0x040000, 0x2f992807, 3 | BRF_GRA }, // 9 - - { "f3_w37.000", 0x100000, 0xfd4cda03, 4 | BRF_GRA }, // 10 Sprites - { "f3_w38.001", 0x100000, 0x755bab10, 4 | BRF_GRA }, // 11 - { "f3_w39.010", 0x100000, 0xb21ced92, 4 | BRF_GRA }, // 12 - { "f3_w40.011", 0x100000, 0x2e906889, 4 | BRF_GRA }, // 13 - { "f3_w41.020", 0x100000, 0x02455d10, 4 | BRF_GRA }, // 14 - { "f3_w42.021", 0x100000, 0x124589b9, 4 | BRF_GRA }, // 15 - { "f3_w43.030", 0x100000, 0xdae7327a, 4 | BRF_GRA }, // 16 - { "f3_w44.031", 0x100000, 0xd0fc84ac, 4 | BRF_GRA }, // 17 - - { "f3_w95.da", 0x080000, 0xf7ca432b, 5 | BRF_SND }, // 18 Irem GA20 Samples -}; - -STD_ROM_PICK(psoldier) -STD_ROM_FN(psoldier) - -struct BurnDriver BurnDrvPsoldier = { - "psoldier", "ssoldier", NULL, NULL, "1993", - "Perfect Soldiers (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_VSFIGHT, 0, - NULL, psoldierRomInfo, psoldierRomName, NULL, NULL, PsoldierInputInfo, PsoldierDIPInfo, - ssoldierInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Major Title 2 (World, set 1) - -static struct BurnRomInfo majtitl2RomDesc[] = { - { "mt2-h0-b.5m", 0x040000, 0xb163b12e, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "mt2-l0-b.5f", 0x040000, 0x6f3b5d9d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "is-h1.5l", 0x040000, 0x9ba8e1f2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "is-l1.5j", 0x040000, 0xe4e00626, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mt2-sh0-.ic14", 0x010000, 0x1ecbea43, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "mt2-sl0-.ic17", 0x010000, 0x8fd5b531, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "hr0.ic9", 0x040000, 0x7e61e4b5, 3 | BRF_GRA }, // 6 Background Tiles - { "hr1.ic10", 0x040000, 0x0a667564, 3 | BRF_GRA }, // 7 - { "hr2.ic11", 0x040000, 0x5eb44312, 3 | BRF_GRA }, // 8 - { "hr3.ic12", 0x040000, 0xf2866294, 3 | BRF_GRA }, // 9 - - { "k30.ic42", 0x100000, 0x8c9a2678, 4 | BRF_GRA }, // 10 Sprites - { "k31.ic43", 0x100000, 0x5455df78, 4 | BRF_GRA }, // 11 - { "k32.ic44", 0x100000, 0x3a258c41, 4 | BRF_GRA }, // 12 - { "k33.ic45", 0x100000, 0xc1e91a14, 4 | BRF_GRA }, // 13 - - { "k0d.ic8", 0x080000, 0x713b9e9f, 5 | BRF_SND }, // 14 Irem GA20 Samples - - { "mt2eep", 0x000800, 0x208af971, 6 | BRF_PRG | BRF_ESS }, // 15 EEPROM data - - { "pal16l8-m92-a-3m.ic11", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 16 plds - { "pal16l8-m92-a-7j.ic41", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 17 - { "pal16l8-m92-a-9j.ic51", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 18 - { "pal16l8-m92-b-2l.ic7", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 19 - { "pal16l8-m92-b-7h.ic47", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(majtitl2) -STD_ROM_FN(majtitl2) - -static INT32 majtitl2RomLoad() -{ - return RomLoad(0x100000, 0x040000, 0x100000, 0, 15); -} - -static INT32 majtitl2Init() -{ - m92_kludge = 2; - return DrvInit(majtitl2RomLoad, majtitl2_decryption_table, 1, 0x100000, 0x400000); -} - -struct BurnDriver BurnDrvMajtitl2 = { - "majtitl2", NULL, NULL, NULL, "1992", - "Major Title 2 (World)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_M92, GBF_SPORTSMISC, 0, - NULL, majtitl2RomInfo, majtitl2RomName, NULL, NULL, p4CommonInputInfo, Majtitl2DIPInfo, - majtitl2Init, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Major Title 2 (World, set 2) - -static struct BurnRomInfo majtitl2bRomDesc[] = { - { "mt2-h0-e.ic34", 0x040000, 0xf6c3a28c, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "mt2-l0-e.ic31", 0x040000, 0x0a061384, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mt2-h1-.ic33", 0x040000, 0x9ba8e1f2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mt2-l1-.ic32", 0x040000, 0xe4e00626, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mt2-sh0-.ic14", 0x010000, 0x1ecbea43, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "mt2-sl0-.ic17", 0x010000, 0x8fd5b531, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "hr0.ic9", 0x040000, 0x7e61e4b5, 3 | BRF_GRA }, // 6 Background Tiles - { "hr1.ic10", 0x040000, 0x0a667564, 3 | BRF_GRA }, // 7 - { "hr2.ic11", 0x040000, 0x5eb44312, 3 | BRF_GRA }, // 8 - { "hr3.ic12", 0x040000, 0xf2866294, 3 | BRF_GRA }, // 9 - - { "k30.ic42", 0x100000, 0x8c9a2678, 4 | BRF_GRA }, // 10 Sprites - { "k31.ic43", 0x100000, 0x5455df78, 4 | BRF_GRA }, // 11 - { "k32.ic44", 0x100000, 0x3a258c41, 4 | BRF_GRA }, // 12 - { "k33.ic45", 0x100000, 0xc1e91a14, 4 | BRF_GRA }, // 13 - - { "k0d.ic8", 0x080000, 0x713b9e9f, 5 | BRF_SND }, // 14 Irem GA20 Samples - - { "mt2eep", 0x000800, 0x208af971, 6 | BRF_PRG | BRF_ESS }, // 15 EEPROM data - - { "pal16l8-m92-a-3m.ic11", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 16 plds - { "pal16l8-m92-a-7j.ic41", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 17 - { "pal16l8-m92-a-9j.ic51", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 18 - { "pal16l8-m92-b-2l.ic7", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 19 - { "pal16l8-m92-b-7h.ic47", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(majtitl2b) -STD_ROM_FN(majtitl2b) - -struct BurnDriver BurnDrvMajtitl2b = { - "majtitl2b", "majtitl2", NULL, NULL, "1992", - "Major Title 2 (World, set 2)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_SPORTSMISC, 0, - NULL, majtitl2bRomInfo, majtitl2bRomName, NULL, NULL, p4CommonInputInfo, Majtitl2DIPInfo, - majtitl2Init, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Major Title 2 (World, set 1, alt sound CPU) -// this set matches the 'majtitl2' except for the soundcpu roms, which are for a different CPU - -static struct BurnRomInfo majtitl2aRomDesc[] = { - { "mt2-h0-.5m", 0x040000, 0xb163b12e, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "mt2-l0-.5f", 0x040000, 0x6f3b5d9d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mt2-h1-.5l", 0x040000, 0x9ba8e1f2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mt2-l1-.5j", 0x040000, 0xe4e00626, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mt2sh0-a", 0x010000, 0x50f076e5, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "mt2sl0-a", 0x010000, 0xf4ecd7b5, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "hr0.ic9", 0x040000, 0x7e61e4b5, 3 | BRF_GRA }, // 6 Background Tiles - { "hr1.ic10", 0x040000, 0x0a667564, 3 | BRF_GRA }, // 7 - { "hr2.ic11", 0x040000, 0x5eb44312, 3 | BRF_GRA }, // 8 - { "hr3.ic12", 0x040000, 0xf2866294, 3 | BRF_GRA }, // 9 - - { "k30.ic42", 0x100000, 0x8c9a2678, 4 | BRF_GRA }, // 10 Sprites - { "k31.ic43", 0x100000, 0x5455df78, 4 | BRF_GRA }, // 11 - { "k32.ic44", 0x100000, 0x3a258c41, 4 | BRF_GRA }, // 12 - { "k33.ic45", 0x100000, 0xc1e91a14, 4 | BRF_GRA }, // 13 - - { "k0d.ic8", 0x080000, 0x713b9e9f, 5 | BRF_SND }, // 14 Irem GA20 Samples - - { "mt2eep", 0x000800, 0x208af971, 6 | BRF_PRG | BRF_ESS }, // 15 EEPROM data - - { "pal16l8-m92-a-3m.ic11", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 16 plds - { "pal16l8-m92-a-7j.ic41", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 17 - { "pal16l8-m92-a-9j.ic51", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 18 - { "pal16l8-m92-b-2l.ic7", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 19 - { "pal16l8-m92-b-7h.ic47", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(majtitl2a) -STD_ROM_FN(majtitl2a) - -static INT32 majtitl2aInit() -{ - m92_kludge = 2; - return DrvInit(majtitl2RomLoad, mysticri_decryption_table, 1, 0x100000, 0x400000); -} - -struct BurnDriver BurnDrvMajtitl2a = { - "majtitl2a", "majtitl2", NULL, NULL, "1992", - "Major Title 2 (World, set 1, alt sound CPU)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_SPORTSMISC, 0, - NULL, majtitl2aRomInfo, majtitl2aRomName, NULL, NULL, p4CommonInputInfo, Majtitl2DIPInfo, - majtitl2aInit, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Major Title 2 (Japan) - -static struct BurnRomInfo majtitl2jRomDesc[] = { - { "mt2-h0", 0x040000, 0x8a8d71ad, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "mt2-l1", 0x040000, 0xdd4fff51, 1 | BRF_PRG | BRF_ESS }, // 1 - { "is-h1.5l", 0x040000, 0x9ba8e1f2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "is-l1.5j", 0x040000, 0xe4e00626, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mt2-sh0-.ic14", 0x010000, 0x1ecbea43, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "mt2-sl0-.ic17", 0x010000, 0x8fd5b531, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "hr0.ic9", 0x040000, 0x7e61e4b5, 3 | BRF_GRA }, // 6 Background Tiles - { "hr1.ic10", 0x040000, 0x0a667564, 3 | BRF_GRA }, // 7 - { "hr2.ic11", 0x040000, 0x5eb44312, 3 | BRF_GRA }, // 8 - { "hr3.ic12", 0x040000, 0xf2866294, 3 | BRF_GRA }, // 9 - - { "k30.ic42", 0x100000, 0x8c9a2678, 4 | BRF_GRA }, // 10 Sprites - { "k31.ic43", 0x100000, 0x5455df78, 4 | BRF_GRA }, // 11 - { "k32.ic44", 0x100000, 0x3a258c41, 4 | BRF_GRA }, // 12 - { "k33.ic45", 0x100000, 0xc1e91a14, 4 | BRF_GRA }, // 13 - - { "k0d.ic8", 0x080000, 0x713b9e9f, 5 | BRF_SND }, // 14 Irem GA20 Samples - - { "mt2eep", 0x000800, 0x208af971, 6 | BRF_PRG | BRF_ESS }, // 15 EEPROM data - - { "pal16l8-m92-a-3m.ic11", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 16 plds - { "pal16l8-m92-a-7j.ic41", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 17 - { "pal16l8-m92-a-9j.ic51", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 18 - { "pal16l8-m92-b-2l.ic7", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 19 - { "pal16l8-m92-b-7h.ic47", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(majtitl2j) -STD_ROM_FN(majtitl2j) - -struct BurnDriver BurnDrvMajtitl2j = { - "majtitl2j", "majtitl2", NULL, NULL, "1992", - "Major Title 2 (Japan)\0", NULL, "Irem", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_SPORTSMISC, 0, - NULL, majtitl2jRomInfo, majtitl2jRomName, NULL, NULL, p4CommonInputInfo, Majtitl2DIPInfo, - majtitl2Init, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// The Irem Skins Game (US set 1) - -static struct BurnRomInfo skingameRomDesc[] = { - { "is-h0-d.5m", 0x040000, 0x80940abb, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "is-l0-d.5f", 0x040000, 0xb84beed6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "is-h1.5l", 0x040000, 0x9ba8e1f2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "is-l1.5j", 0x040000, 0xe4e00626, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mt2-sh0-.ic14", 0x010000, 0x1ecbea43, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "mt2-sl0-.ic17", 0x010000, 0x8fd5b531, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "hr0.ic9", 0x040000, 0x7e61e4b5, 3 | BRF_GRA }, // 6 Background Tiles - { "hr1.ic10", 0x040000, 0x0a667564, 3 | BRF_GRA }, // 7 - { "hr2.ic11", 0x040000, 0x5eb44312, 3 | BRF_GRA }, // 8 - { "hr3.ic12", 0x040000, 0xf2866294, 3 | BRF_GRA }, // 9 - - { "k30.ic42", 0x100000, 0x8c9a2678, 4 | BRF_GRA }, // 10 Sprites - { "k31.ic43", 0x100000, 0x5455df78, 4 | BRF_GRA }, // 11 - { "k32.ic44", 0x100000, 0x3a258c41, 4 | BRF_GRA }, // 12 - { "k33.ic45", 0x100000, 0xc1e91a14, 4 | BRF_GRA }, // 13 - - { "k0d.ic8", 0x080000, 0x713b9e9f, 5 | BRF_SND }, // 14 Irem GA20 Samples - - { "mt2eep", 0x000800, 0x208af971, 6 | BRF_PRG | BRF_ESS }, // 15 EEPROM data - - { "pal16l8-m92-a-3m.ic11", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 16 plds - { "pal16l8-m92-a-7j.ic41", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 17 - { "pal16l8-m92-a-9j.ic51", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 18 - { "pal16l8-m92-b-2l.ic7", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 19 - { "pal16l8-m92-b-7h.ic47", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(skingame) -STD_ROM_FN(skingame) - -struct BurnDriver BurnDrvSkingame = { - "skingame", "majtitl2", NULL, NULL, "1992", - "The Irem Skins Game (US set 1)\0", NULL, "Irem America", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_SPORTSMISC, 0, - NULL, skingameRomInfo, skingameRomName, NULL, NULL, p4CommonInputInfo, Majtitl2DIPInfo, - majtitl2Init, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// The Irem Skins Game (US set 2) - -static struct BurnRomInfo skingame2RomDesc[] = { - { "mt2-h0-a.5m", 0x040000, 0x7c6dbbc7, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "mt2-l0-a.5f", 0x040000, 0x9de5f689, 1 | BRF_PRG | BRF_ESS }, // 1 - { "is-h1.5l", 0x040000, 0x9ba8e1f2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "is-l1.5j", 0x040000, 0xe4e00626, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mt2-sh0-.ic14", 0x010000, 0x1ecbea43, 2 | BRF_PRG | BRF_ESS }, // 4 V30 Code - { "mt2-sl0-.ic17", 0x010000, 0x8fd5b531, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "hr0.ic9", 0x040000, 0x7e61e4b5, 3 | BRF_GRA }, // 6 Background Tiles - { "hr1.ic10", 0x040000, 0x0a667564, 3 | BRF_GRA }, // 7 - { "hr2.ic11", 0x040000, 0x5eb44312, 3 | BRF_GRA }, // 8 - { "hr3.ic12", 0x040000, 0xf2866294, 3 | BRF_GRA }, // 9 - - { "k30.ic42", 0x100000, 0x8c9a2678, 4 | BRF_GRA }, // 10 Sprites - { "k31.ic43", 0x100000, 0x5455df78, 4 | BRF_GRA }, // 11 - { "k32.ic44", 0x100000, 0x3a258c41, 4 | BRF_GRA }, // 12 - { "k33.ic45", 0x100000, 0xc1e91a14, 4 | BRF_GRA }, // 13 - - { "k0d.ic8", 0x080000, 0x713b9e9f, 5 | BRF_SND }, // 14 Irem GA20 Samples - - { "mt2eep", 0x000800, 0x208af971, 6 | BRF_PRG | BRF_ESS }, // 15 EEPROM data - - { "pal16l8-m92-a-3m.ic11", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 16 plds - { "pal16l8-m92-a-7j.ic41", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 17 - { "pal16l8-m92-a-9j.ic51", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 18 - { "pal16l8-m92-b-2l.ic7", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 19 - { "pal16l8-m92-b-7h.ic47", 0x000104, 0x00000000, 7 | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(skingame2) -STD_ROM_FN(skingame2) - -struct BurnDriver BurnDrvSkingame2 = { - "skingame2", "majtitl2", NULL, NULL, "1992", - "The Irem Skins Game (US set 2)\0", NULL, "Irem America", "M92", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M92, GBF_SPORTSMISC, 0, - NULL, skingame2RomInfo, skingame2RomName, NULL, NULL, p4CommonInputInfo, Majtitl2DIPInfo, - majtitl2Init, DrvExit, DrvFrame, DrvReDraw, DrvScan, &bRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - diff --git a/jan/src/burn/drv/irem/d_vigilant.cpp b/jan/src/burn/drv/irem/d_vigilant.cpp deleted file mode 100644 index 193605046..000000000 --- a/jan/src/burn/drv/irem/d_vigilant.cpp +++ /dev/null @@ -1,2543 +0,0 @@ -// Based on MAME driver by Mike Balfour - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "burn_ym2203.h" -#include "dac.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[3] = {0, 0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80Rom1 = NULL; -static UINT8 *DrvZ80Rom2 = NULL; -static UINT8 *DrvZ80Ram1 = NULL; -static UINT8 *DrvZ80Ram2 = NULL; -static UINT8 *DrvVideoRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvBackTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvSamples = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvRomBank; -static UINT8 DrvSoundLatch; -static UINT8 DrvIrqVector; - -static INT32 DrvRearColour; -static INT32 DrvRearDisable; -static INT32 DrvHorizScrollLo; -static INT32 DrvHorizScrollHi; -static INT32 DrvRearHorizScrollLo; -static INT32 DrvRearHorizScrollHi; -static INT32 DrvSampleAddress; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static UINT8 DrvHasYM2203 = 0; -static UINT8 DrvKikcubicDraw = 0; - -#define VECTOR_INIT 0 -#define YM2151_ASSERT 1 -#define YM2151_CLEAR 2 -#define Z80_ASSERT 3 -#define Z80_CLEAR 4 - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo BuccanrsInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 6, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Buccanrs) - -static struct BurnInputInfo BuccanrsaInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Buccanrsa) - -static struct BurnInputInfo KikcubicInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Kikcubic) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x12, 0x01, 0x04, 0x04, "Normal" }, - {0x12, 0x01, 0x04, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Energy Decrease Rate" }, - {0x12, 0x01, 0x08, 0x08, "Slow" }, - {0x12, 0x01, 0x08, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 16 , "Coinage" }, - {0x12, 0x01, 0xf0, 0xa0, "6 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0xb0, "5 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0xc0, "4 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0xd0, "3 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x10, "8 Coins 3 Plays" }, - {0x12, 0x01, 0xf0, 0xe0, "2 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x20, "5 Coins 3 Plays" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 2 Plays" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Play" }, - {0x12, 0x01, 0xf0, 0x40, "2 Coins 3 Plays" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 2 Plays" }, - {0x12, 0x01, 0xf0, 0x80, "1 Coin 3 Plays" }, - {0x12, 0x01, 0xf0, 0x70, "1 Coin 4 Plays" }, - {0x12, 0x01, 0xf0, 0x60, "1 Coin 5 Plays" }, - {0x12, 0x01, 0xf0, 0x50, "1 Coin 6 Plays" }, - {0x12, 0x01, 0xf0, 0x00, "Freeplay" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x13, 0x01, 0x04, 0x04, "Mode 1" }, - {0x13, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Stop Mode" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo BuccanrsDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x2f, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 12 , "Coin A" }, - {0x12, 0x01, 0x0f, 0x04, "4 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x07, "3 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x00, "5 Coins 2 Plays" }, - {0x12, 0x01, 0x0f, 0x0a, "2 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x06, "3 Coins 2 Plays" }, - {0x12, 0x01, 0x0f, 0x03, "4 Coins 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Play" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 5 Plays" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 12 , "Coin B" }, - {0x12, 0x01, 0xf0, 0x40, "4 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x70, "3 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x00, "5 Coins 2 Plays" }, - {0x12, 0x01, 0xf0, 0xa0, "2 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x60, "3 Coins 2 Plays" }, - {0x12, 0x01, 0xf0, 0x30, "4 Coins 3 Plays" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Play" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 5 Plays" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Plays" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Plays" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Plays" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x06, 0x06, "2" }, - {0x13, 0x01, 0x06, 0x04, "3" }, - {0x13, 0x01, 0x06, 0x02, "4" }, - {0x13, 0x01, 0x06, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x08, "Medium" }, - {0x13, 0x01, 0x18, 0x10, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Invincibilty" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x20, 0x20, "Upright" }, - {0x13, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Buccanrs) - -static struct BurnDIPInfo BuccanrsaDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xf4, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0xf4, 0xf4, "Off" }, - {0x11, 0x01, 0xf4, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 12 , "Coin A" }, - {0x12, 0x01, 0x0f, 0x04, "4 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x07, "3 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x00, "5 Coins 2 Plays" }, - {0x12, 0x01, 0x0f, 0x0a, "2 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x06, "3 Coins 2 Plays" }, - {0x12, 0x01, 0x0f, 0x03, "4 Coins 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Play" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 5 Plays" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 12 , "Coin B" }, - {0x12, 0x01, 0xf0, 0x40, "4 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x70, "3 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x00, "5 Coins 2 Plays" }, - {0x12, 0x01, 0xf0, 0xa0, "2 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x60, "3 Coins 2 Plays" }, - {0x12, 0x01, 0xf0, 0x30, "4 Coins 3 Plays" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Play" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 5 Plays" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Plays" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Plays" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Plays" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Plays" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x06, 0x06, "2" }, - {0x13, 0x01, 0x06, 0x04, "3" }, - {0x13, 0x01, 0x06, 0x02, "4" }, - {0x13, 0x01, 0x06, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x08, "Medium" }, - {0x13, 0x01, 0x18, 0x10, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Invincibilty" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x20, 0x20, "Upright" }, - {0x13, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Buccanrsa) - -static struct BurnDIPInfo KikcubicDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xd5, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x03, 0x02, "Easy" }, - {0x11, 0x01, 0x03, 0x03, "Medium" }, - {0x11, 0x01, 0x03, 0x01, "Hard" }, - {0x11, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x0c, 0x08, "1" }, - {0x11, 0x01, 0x0c, 0x04, "2" }, - {0x11, 0x01, 0x0c, 0x0c, "3" }, - {0x11, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 12 , "Coinage" }, - {0x11, 0x01, 0xf0, 0xa0, "6 Coins 1 Play" }, - {0x11, 0x01, 0xf0, 0xb0, "5 Coins 1 Play" }, - {0x11, 0x01, 0xf0, 0xc0, "4 Coins 1 Play" }, - {0x11, 0x01, 0xf0, 0xd0, "3 Coins 1 Play" }, - {0x11, 0x01, 0xf0, 0xe0, "2 Coins 1 Play" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin 1 Play" }, - {0x11, 0x01, 0xf0, 0x70, "1 Coin 2 Plays" }, - {0x11, 0x01, 0xf0, 0x60, "1 Coin 3 Plays" }, - {0x11, 0x01, 0xf0, 0x50, "1 Coin 4 Plays" }, - {0x11, 0x01, 0xf0, 0x40, "1 Coin 5 Plays" }, - {0x11, 0x01, 0xf0, 0x30, "1 Coin 6 Plays" }, - {0x11, 0x01, 0xf0, 0x00, "Freeplay" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x02, 0x00, "Upright" }, - {0x12, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x12, 0x01, 0x04, 0x04, "Mode 1" }, - {0x12, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Level Select" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Player Adding" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kikcubic) - -static struct BurnRomInfo DrvRomDesc[] = { - { "VG_A-8H-E.ic55", 0x08000, 0x0d4e6866, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "VG_A-8L-A.ic57", 0x10000, 0x690d812f, BRF_ESS | BRF_PRG }, // 1 - - { "VG_A-5J-.ic37", 0x10000, 0x10582b2d, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "VG_B-4F-.ic34", 0x10000, 0x01579d20, BRF_GRA }, // 3 Characters - { "VG_B-4J-.ic35", 0x10000, 0x4f5872f0, BRF_GRA }, // 4 - - { "VG_B-6L-.ic62", 0x20000, 0xfbe9552d, BRF_GRA }, // 5 Sprites - { "VG_B-6K-.ic61", 0x20000, 0xae09d5c0, BRF_GRA }, // 6 - { "VG_B-6P-.ic64", 0x20000, 0xafb77461, BRF_GRA }, // 7 - { "VG_B-6N-.ic63", 0x20000, 0x5065cd35, BRF_GRA }, // 8 - - { "VG_B-1D-.ic2", 0x10000, 0x81b1ee5c, BRF_GRA }, // 9 Background - { "VG_B-1F-.ic3", 0x10000, 0xd0d33673, BRF_GRA }, // 10 - { "VG_B-1H-.ic4", 0x10000, 0xaae81695, BRF_GRA }, // 11 - - { "VG_A-4D-.ic26", 0x10000, 0x9b85101d, BRF_SND }, // 12 Samples - - { "VG_B-8R.ic90", 0x00117, 0xdf368a7a, BRF_GRA }, // 13 PALs - { "VG_B-4M.ic38", 0x00117, 0xdbca4204, BRF_GRA }, // 14 - { "VG_B-1B.ic1", 0x00117, 0x922e5167, BRF_GRA }, // 15 - - { "tbp24s10_7a.ic52", 0x00100, 0xc324835e, BRF_OPT }, // 16 Video Timing PROM -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo Drv1RomDesc[] = { - { "VG_A-8H-C.ic55", 0x08000, 0xd72682e8, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "VG_A-8L-A.ic57", 0x10000, 0x690d812f, BRF_ESS | BRF_PRG }, // 1 - - { "VG_A-5J-.ic37", 0x10000, 0x10582b2d, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "613.ic34", 0x20000, 0xee7a6c2f, BRF_GRA }, // 3 Characters - { "614.ic35", 0x20000, 0x6422e8ba, BRF_GRA }, // 4 - - { "616.ic62", 0x20000, 0xfbe9552d, BRF_GRA }, // 5 Sprites - { "615.ic61", 0x20000, 0xae09d5c0, BRF_GRA }, // 6 - { "618.ic64", 0x20000, 0xafb77461, BRF_GRA }, // 7 - { "617.ic63", 0x20000, 0x5065cd35, BRF_GRA }, // 8 - - { "619.ic2", 0x20000, 0x9e2f8759, BRF_GRA }, // 9 Background - { "612.ic4", 0x20000, 0x85057c81, BRF_GRA }, // 10 - - { "VG_A-4D-.ic26", 0x10000, 0x9b85101d, BRF_SND }, // 11 Samples - - { "VG_B-8R.ic90", 0x00117, 0xdf368a7a, BRF_GRA }, // 12 PALs - { "VG_B-4M.ic38", 0x00117, 0xdbca4204, BRF_GRA }, // 13 - { "VG_B-1B.ic1", 0x00117, 0x922e5167, BRF_GRA }, // 14 - - { "tbp24s10_7a.ic52", 0x00100, 0xc324835e, BRF_OPT }, // 15 Video Timing PROM -}; - -STD_ROM_PICK(Drv1) -STD_ROM_FN(Drv1) - -static struct BurnRomInfo DrvuRomDesc[] = { - { "VG_A-8H-.ic55", 0x08000, 0x8d15109e, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "VG_A-8L-.ic57", 0x10000, 0x7f95799b, BRF_ESS | BRF_PRG }, // 1 - - { "VG_A-5J-.ic37", 0x10000, 0x10582b2d, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "613.ic34", 0x20000, 0xee7a6c2f, BRF_GRA }, // 3 Characters - { "614.ic35", 0x20000, 0x6422e8ba, BRF_GRA }, // 4 - - { "616.ic62", 0x20000, 0xfbe9552d, BRF_GRA }, // 5 Sprites - { "615.ic61", 0x20000, 0xae09d5c0, BRF_GRA }, // 6 - { "618.ic64", 0x20000, 0xafb77461, BRF_GRA }, // 7 - { "617.ic63", 0x20000, 0x5065cd35, BRF_GRA }, // 8 - - { "619.ic2", 0x20000, 0x9e2f8759, BRF_GRA }, // 9 Background - { "612.ic4", 0x20000, 0x85057c81, BRF_GRA }, // 10 - - { "VG_A-4D-.ic26", 0x10000, 0x9b85101d, BRF_SND }, // 11 Samples - - { "VG_B-8R.ic90", 0x00117, 0xdf368a7a, BRF_GRA }, // 12 PALs - { "VG_B-4M.ic38", 0x00117, 0xdbca4204, BRF_GRA }, // 13 - { "VG_B-1B.ic1", 0x00117, 0x922e5167, BRF_GRA }, // 14 - - { "tbp24s10_7a.ic52", 0x00100, 0xc324835e, BRF_OPT }, // 15 Video Timing PROM -}; - -STD_ROM_PICK(Drvu) -STD_ROM_FN(Drvu) - -static struct BurnRomInfo Drvu2RomDesc[] = { - { "VG_A-8H-G.ic55", 0x08000, 0x9444c04e, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "VG_A-8L-.ic57", 0x10000, 0x7f95799b, BRF_ESS | BRF_PRG }, // 1 - - { "VG_A-5J-.ic37", 0x10000, 0x10582b2d, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "VG_B-4F-.ic34", 0x10000, 0x01579d20, BRF_GRA }, // 3 Characters - { "VG_B-4J-.ic35", 0x10000, 0x4f5872f0, BRF_GRA }, // 4 - - { "VG_B-6L-.ic62", 0x20000, 0xfbe9552d, BRF_GRA }, // 5 Sprites - { "VG_B-6K-.ic61", 0x20000, 0xae09d5c0, BRF_GRA }, // 6 - { "VG_B-6P-.ic64", 0x20000, 0xafb77461, BRF_GRA }, // 7 - { "VG_B-6N-.ic63", 0x20000, 0x5065cd35, BRF_GRA }, // 8 - - { "VG_B-1D-.ic2", 0x10000, 0x81b1ee5c, BRF_GRA }, // 9 Background - { "VG_B-1F-.ic3", 0x10000, 0xd0d33673, BRF_GRA }, // 10 - { "VG_B-1H-.ic4", 0x10000, 0xaae81695, BRF_GRA }, // 11 - - { "VG_A-4D-.ic26", 0x10000, 0x9b85101d, BRF_SND }, // 12 Samples - - { "VG_B-8R.ic90", 0x00117, 0xdf368a7a, BRF_GRA }, // 13 PALs - { "VG_B-4M.ic38", 0x00117, 0xdbca4204, BRF_GRA }, // 14 - { "VG_B-1B.ic1", 0x00117, 0x922e5167, BRF_GRA }, // 15 - - { "tbp24s10_7a.ic52", 0x00100, 0xc324835e, BRF_OPT }, // 16 Video Timing PROM -}; - -STD_ROM_PICK(Drvu2) -STD_ROM_FN(Drvu2) - -static struct BurnRomInfo DrvjRomDesc[] = { - { "VG_A-8H-D.ic55", 0x08000, 0xba848713, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "VG_A-8L-D.ic57", 0x10000, 0x3b12b1d8, BRF_ESS | BRF_PRG }, // 1 - - { "VG_A-5J-D.ic37", 0x10000, 0x10582b2d, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "613.ic34", 0x20000, 0xee7a6c2f, BRF_GRA }, // 3 Characters - { "614.ic35", 0x20000, 0x6422e8ba, BRF_GRA }, // 4 - - { "616.ic62", 0x20000, 0xfbe9552d, BRF_GRA }, // 5 Sprites - { "615.ic61", 0x20000, 0xae09d5c0, BRF_GRA }, // 6 - { "618.ic64", 0x20000, 0xafb77461, BRF_GRA }, // 7 - { "617.ic63", 0x20000, 0x5065cd35, BRF_GRA }, // 8 - - { "619.ic2", 0x20000, 0x9e2f8759, BRF_GRA }, // 9 Background - { "612.ic4", 0x20000, 0x85057c81, BRF_GRA }, // 10 - - { "VG_A-4D-D.ic26", 0x10000, 0x9b85101d, BRF_SND }, // 11 Samples - - { "VG_B-8R.ic90", 0x00117, 0xdf368a7a, BRF_GRA }, // 12 PALs - { "VG_B-4M.ic38", 0x00117, 0xdbca4204, BRF_GRA }, // 13 - { "VG_B-1B.ic1", 0x00117, 0x922e5167, BRF_GRA }, // 14 - - { "tbp24s10_7a.ic52", 0x00100, 0xc324835e, BRF_OPT }, // 15 Video Timing PROM -}; - -STD_ROM_PICK(Drvj) -STD_ROM_FN(Drvj) - -static struct BurnRomInfo DrvbRomDesc[] = { - { "g07_c03.bin", 0x08000, 0x9dcca081, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "j07_c04.bin", 0x10000, 0xe0159105, BRF_ESS | BRF_PRG }, // 1 - - { "g05_c02.bin", 0x10000, 0x10582b2d, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "f05_c08.bin", 0x10000, 0x01579d20, BRF_GRA }, // 3 Characters - { "h05_c09.bin", 0x10000, 0x4f5872f0, BRF_GRA }, // 4 - - { "n07_c12.bin", 0x10000, 0x10af8eb2, BRF_GRA }, // 5 Sprites - { "k07_c10.bin", 0x10000, 0x9576f304, BRF_GRA }, // 6 - { "o07_c13.bin", 0x10000, 0xb1d9d4dc, BRF_GRA }, // 7 - { "l07_c11.bin", 0x10000, 0x4598be4a, BRF_GRA }, // 8 - { "t07_c16.bin", 0x10000, 0xf5425e42, BRF_GRA }, // 9 - { "p07_c14.bin", 0x10000, 0xcb50a17c, BRF_GRA }, // 10 - { "v07_c17.bin", 0x10000, 0x959ba3c7, BRF_GRA }, // 11 - { "s07_c15.bin", 0x10000, 0x7f2e91c5, BRF_GRA }, // 12 - - { "d01_c05.bin", 0x10000, 0x81b1ee5c, BRF_GRA }, // 13 Background - { "e01_c06.bin", 0x10000, 0xd0d33673, BRF_GRA }, // 14 - { "f01_c07.bin", 0x10000, 0xaae81695, BRF_GRA }, // 15 - - { "d04_c01.bin", 0x10000, 0x9b85101d, BRF_SND }, // 16 Samples - - { "VG_B-8R.ic90", 0x00117, 0xdf368a7a, BRF_GRA }, // 17 PALs - { "VG_B-4M.ic38", 0x00117, 0xdbca4204, BRF_GRA }, // 18 - { "VG_B-1B.ic1", 0x00117, 0x922e5167, BRF_GRA }, // 19 -}; - -STD_ROM_PICK(Drvb) -STD_ROM_FN(Drvb) - -static struct BurnRomInfo VigilantaRomDesc[] = { - { "VG_A-8H-A.ic55", 0x08000, 0x97df1454, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "VG_A-8L-A.ic57", 0x10000, 0x690d812f, BRF_ESS | BRF_PRG }, // 1 - - { "VG_A-5J-A.ic37", 0x10000, 0x10582b2d, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "613.ic34", 0x20000, 0xee7a6c2f, BRF_GRA }, // 3 Characters - { "614.ic35", 0x20000, 0x6422e8ba, BRF_GRA }, // 4 - - { "616.ic62", 0x20000, 0xfbe9552d, BRF_GRA }, // 5 Sprites - { "615.ic61", 0x20000, 0xae09d5c0, BRF_GRA }, // 6 - { "618.ic64", 0x20000, 0xafb77461, BRF_GRA }, // 7 - { "617.ic63", 0x20000, 0x5065cd35, BRF_GRA }, // 8 - - { "619.ic2", 0x20000, 0x9e2f8759, BRF_GRA }, // 9 Background - { "612.ic4", 0x20000, 0x85057c81, BRF_GRA }, // 10 - - { "VG_A-4D-A.ic26", 0x10000, 0x9b85101d, BRF_SND }, // 11 Samples - - { "VG_B-8R.ic90", 0x00117, 0xdf368a7a, BRF_GRA }, // 12 PALs - { "VG_B-4M.ic38", 0x00117, 0xdbca4204, BRF_GRA }, // 13 - { "VG_B-1B.ic1", 0x00117, 0x922e5167, BRF_GRA }, // 14 - - { "tbp24s10_7a.ic52", 0x00100, 0xc324835e, BRF_OPT }, // 15 Video Timing PROM -}; - -STD_ROM_PICK(Vigilanta) -STD_ROM_FN(Vigilanta) - -static struct BurnRomInfo VigilantbRomDesc[] = { - { "VG_A-8H-B.ic55", 0x08000, 0x05350c2a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "VG_A-8L-.ic57", 0x10000, 0x7f95799b, BRF_ESS | BRF_PRG }, // 1 - - { "VG_A-5J-.ic37", 0x10000, 0x10582b2d, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "613.ic34", 0x20000, 0xee7a6c2f, BRF_GRA }, // 3 Characters - { "614.ic35", 0x20000, 0x6422e8ba, BRF_GRA }, // 4 - - { "616.ic62", 0x20000, 0xfbe9552d, BRF_GRA }, // 5 Sprites - { "615.ic61", 0x20000, 0xae09d5c0, BRF_GRA }, // 6 - { "618.ic64", 0x20000, 0xafb77461, BRF_GRA }, // 7 - { "617.ic63", 0x20000, 0x5065cd35, BRF_GRA }, // 8 - - { "619.ic2", 0x20000, 0x9e2f8759, BRF_GRA }, // 9 Background - { "612.ic4", 0x20000, 0x85057c81, BRF_GRA }, // 10 - - { "VG_A-4D-.ic26", 0x10000, 0x9b85101d, BRF_SND }, // 11 Samples - - { "VG_B-8R.ic90", 0x00117, 0xdf368a7a, BRF_GRA }, // 12 PALs - { "VG_B-4M.ic38", 0x00117, 0xdbca4204, BRF_GRA }, // 13 - { "VG_B-1B.ic1", 0x00117, 0x922e5167, BRF_GRA }, // 14 - - { "tbp24s10_7a.ic52", 0x00100, 0xc324835e, BRF_OPT }, // 15 Video Timing PROM -}; - -STD_ROM_PICK(Vigilantb) -STD_ROM_FN(Vigilantb) - -static struct BurnRomInfo BuccanrsRomDesc[] = { - { "BC-011_K-163.U58", 0x10000, 0xbf1d7e6f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "BC-012_K-163.U25", 0x10000, 0x87303ba8, BRF_ESS | BRF_PRG }, // 1 - - { "BC-001_K-0161.U128", 0x10000, 0xeb65f8c3, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "BC-003_K-0161.U212", 0x10000, 0x95e3c517, BRF_GRA }, // 3 Characters - { "BC-004_K-0161.U189", 0x10000, 0xfe2377ab, BRF_GRA }, // 4 - - { "BC-005_K-0161.U113", 0x20000, 0x16dc435f, BRF_GRA }, // 5 Sprites - { "BC-006_K-161.U80", 0x10000, 0x4fe3bf97, BRF_GRA }, // 6 - { "BC-008_K-161.U52", 0x20000, 0x078aef7f, BRF_GRA }, // 7 - { "BC-007_K-161.U70", 0x10000, 0xf650fa90, BRF_GRA }, // 8 - - { "BC-009_K-163.U49", 0x20000, 0x0c6188fb, BRF_GRA }, // 9 Background - { "BC-010_K-163.U27", 0x20000, 0x2d383ff8, BRF_GRA }, // 10 - - { "BC-002_K-0161.U74", 0x10000, 0x36ee1dac, BRF_SND }, // 11 Samples - - { "prom1.u54", 0x00100, 0xc324835e, BRF_GRA }, // 12 PROMs - { "prom4.u79", 0x00100, 0xe6506ef4, BRF_GRA }, // 13 - { "prom3.u88", 0x00100, 0xb43d094f, BRF_GRA }, // 14 - { "prom2.u99", 0x00100, 0xe0aa8869, BRF_GRA }, // 15 - - { "pal16l8.u103", 0x00104, 0x00000000, BRF_GRA | BRF_NODUMP }, // 16 PALs - { "pal16l8.u156", 0x00104, 0x00000000, BRF_GRA | BRF_NODUMP }, // 17 - { "pal16l8.u42", 0x00104, 0x00000000, BRF_GRA | BRF_NODUMP }, // 18 -}; - -STD_ROM_PICK(Buccanrs) -STD_ROM_FN(Buccanrs) - -static struct BurnRomInfo BuccanrsaRomDesc[] = { - { "bc-011", 0x08000, 0x6b657ef1, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "BC-012_K-163.U25", 0x10000, 0x87303ba8, BRF_ESS | BRF_PRG }, // 1 - - { "BC-001_K-0161.U128", 0x10000, 0xeb65f8c3, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "BC-003_K-0161.U212", 0x10000, 0x95e3c517, BRF_GRA }, // 3 Characters - { "BC-004_K-0161.U189", 0x10000, 0xfe2377ab, BRF_GRA }, // 4 - - { "BC-005_K-0161.U113", 0x20000, 0x16dc435f, BRF_GRA }, // 5 Sprites - { "BC-006_K-161.U80", 0x10000, 0x4fe3bf97, BRF_GRA }, // 6 - { "BC-008_K-161.U52", 0x20000, 0x078aef7f, BRF_GRA }, // 7 - { "BC-007_K-161.U70", 0x10000, 0xf650fa90, BRF_GRA }, // 8 - - { "BC-009_K-163.U49", 0x20000, 0x0c6188fb, BRF_GRA }, // 9 Background - { "BC-010_K-163.U27", 0x20000, 0x2d383ff8, BRF_GRA }, // 10 - - { "BC-002_K-0161.U74", 0x10000, 0x36ee1dac, BRF_SND }, // 11 Samples - - { "prom1.u54", 0x00100, 0xc324835e, BRF_GRA }, // 12 PROMs - { "prom4.u79", 0x00100, 0xe6506ef4, BRF_GRA }, // 13 - { "prom3.u88", 0x00100, 0xb43d094f, BRF_GRA }, // 14 - { "prom2.u99", 0x00100, 0xe0aa8869, BRF_GRA }, // 15 -}; - -STD_ROM_PICK(Buccanrsa) -STD_ROM_FN(Buccanrsa) - -static struct BurnRomInfo BuccanrsbRomDesc[] = { - { "rr_Du.u58", 0x08000, 0xdcad3a8b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "BC-012_K-163.U25", 0x10000, 0x87303ba8, BRF_ESS | BRF_PRG }, // 1 - - { "BC-001_K-0161.U128", 0x10000, 0xeb65f8c3, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "BC-003_K-0161.U212", 0x10000, 0x95e3c517, BRF_GRA }, // 3 Characters - { "BC-004_K-0161.U189", 0x10000, 0xfe2377ab, BRF_GRA }, // 4 - - { "BC-005_K-0161.U113", 0x20000, 0x16dc435f, BRF_GRA }, // 5 Sprites - { "BC-006_K-161.U80", 0x10000, 0x4fe3bf97, BRF_GRA }, // 6 - { "BC-008_K-161.U52", 0x20000, 0x078aef7f, BRF_GRA }, // 7 - { "BC-007_K-161.U70", 0x10000, 0xf650fa90, BRF_GRA }, // 8 - - { "BC-009_K-163.U49", 0x20000, 0x0c6188fb, BRF_GRA }, // 9 Background - { "BC-010_K-163.U27", 0x20000, 0x2d383ff8, BRF_GRA }, // 10 - - { "BC-002_K-0161.U74", 0x10000, 0x36ee1dac, BRF_SND }, // 11 Samples - - { "prom1.u54", 0x00100, 0xc324835e, BRF_GRA }, // 12 PROMs - { "prom4.u79", 0x00100, 0xe6506ef4, BRF_GRA }, // 13 - { "prom3.u88", 0x00100, 0xb43d094f, BRF_GRA }, // 14 - { "prom2.u99", 0x00100, 0xe0aa8869, BRF_GRA }, // 15 -}; - -STD_ROM_PICK(Buccanrsb) -STD_ROM_FN(Buccanrsb) - -static struct BurnRomInfo KikcubicRomDesc[] = { - { "mqj-p0", 0x08000, 0x9cef394a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "mqj-b0", 0x10000, 0xd9bcf4cd, BRF_ESS | BRF_PRG }, // 1 - { "mqj-b1", 0x10000, 0x54a0abe1, BRF_ESS | BRF_PRG }, // 2 - - { "mqj-sp", 0x10000, 0xbbcf3582, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "mqj-c0", 0x10000, 0x975585c5, BRF_GRA }, // 4 Characters - { "mqj-c1", 0x10000, 0x49d9936d, BRF_GRA }, // 5 - - { "mqj-00", 0x40000, 0x7fb0c58f, BRF_GRA }, // 6 Sprites - { "mqj-10", 0x40000, 0x3a189205, BRF_GRA }, // 7 - - { "mqj-v0", 0x10000, 0x54762956, BRF_SND }, // 8 Samples - - { "8d", 0x00100, 0x7379bb12, BRF_GRA }, // 9 PROMs - { "6h", 0x00020, 0xface0cbb, BRF_GRA }, // 10 - { "7s", 0x00020, 0xface0cbb, BRF_GRA }, // 11 -}; - -STD_ROM_PICK(Kikcubic) -STD_ROM_FN(Kikcubic) - -static struct BurnRomInfo KikcubicbRomDesc[] = { - { "1.bin", 0x08000, 0xd3a589ba, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "4.bin", 0x10000, 0x9ae1e1a6, BRF_ESS | BRF_PRG }, // 1 - { "5.bin", 0x08000, 0xa5a6bffd, BRF_ESS | BRF_PRG }, // 2 - - { "mqj-sp", 0x10000, 0xbbcf3582, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "7.bin", 0x10000, 0x1788d51a, BRF_GRA }, // 4 Characters - { "mqj-c1", 0x10000, 0x49d9936d, BRF_GRA }, // 5 - - { "11.bin", 0x10000, 0x0f0cac92, BRF_GRA }, // 6 Sprites - { "10.bin", 0x10000, 0x7d3822a8, BRF_GRA }, // 7 - { "9.bin", 0x10000, 0x56fb4fa3, BRF_GRA }, // 8 - { "8.bin", 0x10000, 0x947dbd4e, BRF_GRA }, // 9 - - { "mqj-v0", 0x10000, 0x54762956, BRF_SND }, // 10 Samples - - { "8d", 0x00100, 0x7379bb12, BRF_GRA }, // 11 PROMs - { "6h", 0x00020, 0xface0cbb, BRF_GRA }, // 12 - { "7s", 0x00020, 0xface0cbb, BRF_GRA }, // 13 -}; - -STD_ROM_PICK(Kikcubicb) -STD_ROM_FN(Kikcubicb) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom1 = Next; Next += 0x28000; - DrvZ80Rom2 = Next; Next += 0x10000; - DrvSamples = Next; Next += 0x10000; - - RamStart = Next; - - DrvZ80Ram1 = Next; Next += 0x02000; - DrvZ80Ram2 = Next; Next += 0x01000; - DrvSpriteRam = Next; Next += 0x00100; - DrvPaletteRam = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x01000; - DrvPalette = (UINT32*)Next; Next += (512 + 32) * sizeof(UINT32); - - RamEnd = Next; - - DrvChars = Next; Next += 0x1000 * 8 * 8; - DrvSprites = Next; Next += 0x1000 * 16 * 16; - DrvBackTiles = Next; Next += 0x4000 * 32; - - MemEnd = Next; - - return 0; -} - -static void DrvSetVector(INT32 Status) -{ - switch (Status) { - case VECTOR_INIT: { - DrvIrqVector = 0xff; - break; - } - - case YM2151_ASSERT: { - DrvIrqVector &= 0xef; - break; - } - - case YM2151_CLEAR: { - DrvIrqVector |= 0x10; - break; - } - - case Z80_ASSERT: { - DrvIrqVector &= 0xdf; - break; - } - - case Z80_CLEAR: { - DrvIrqVector |= 0x20; - break; - } - } - - if (DrvIrqVector == 0xff) { -// ZetSetVector(DrvIrqVector); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } else { - ZetSetVector(DrvIrqVector); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - nCyclesDone[1] += ZetRun(1000); - } -} - -static INT32 DrvDoReset() -{ - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - if (i == 1) DrvSetVector(VECTOR_INIT); - ZetClose(); - } - - if (DrvHasYM2203) { - BurnYM2203Reset(); - } else { - BurnYM2151Reset(); - } - - DACReset(); - - DrvRomBank = 0; - DrvSoundLatch = 0; - DrvRearColour = 0; - DrvRearDisable = 0; - DrvHorizScrollLo = 0; - DrvHorizScrollHi = 0; - DrvRearHorizScrollLo = 0; - DrvRearHorizScrollHi = 0; - DrvSampleAddress = 0; - - return 0; -} - -UINT8 __fastcall VigilanteZ80Read1(UINT16 a) -{ - switch (a) { - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall VigilanteZ80Write1(UINT16 a, UINT8 d) -{ - if (a >= 0xc020 && a <= 0xc0df) { - DrvSpriteRam[a - 0xc020] = d; - return; - } - - if (a >= 0xc800 && a <= 0xcfff) { - INT32 Offset = a & 0x7ff; - INT32 Bank = Offset & 0x400; - INT32 r, g, b; - - DrvPaletteRam[Offset] = d; - - Offset &= 0xff; - r = (DrvPaletteRam[Bank + Offset + 0x000] << 3) & 0xff; - g = (DrvPaletteRam[Bank + Offset + 0x100] << 3) & 0xff; - b = (DrvPaletteRam[Bank + Offset + 0x200] << 3) & 0xff; - - DrvPalette[(Bank >> 2) + Offset] = BurnHighCol(r, g, b, 0); - return; - } - - switch (a) { - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall VigilanteZ80PortRead1(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return 0xff - DrvInput[0]; - } - - case 0x01: { - return 0xff - DrvInput[1]; - } - - case 0x02: { - return 0xff - DrvInput[2]; - } - - case 0x03: { - return DrvDip[0]; - } - - case 0x04: { - return DrvDip[1]; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall BuccanrsZ80PortRead1(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return (0xd0 - DrvInput[0]) | DrvDip[0]; - } - - case 0x01: { - return 0xff - DrvInput[1]; - } - - case 0x02: { - return 0xff - DrvInput[2]; - } - - case 0x03: { - return DrvDip[1]; - } - - case 0x04: { - return DrvDip[2]; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall BuccanrsaZ80PortRead1(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return (0x0b - DrvInput[0]) | DrvDip[0]; - } - - case 0x01: { - return 0xff - DrvInput[1]; - } - - case 0x02: { - return 0xff - DrvInput[2]; - } - - case 0x03: { - return DrvDip[1]; - } - - case 0x04: { - return DrvDip[2]; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall VigilanteZ80PortWrite1(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - DrvSoundLatch = d; - ZetClose(); - ZetOpen(1); - DrvSetVector(Z80_ASSERT); - ZetClose(); - ZetOpen(0); - return; - } - - case 0x01: { - // output port? - return; - } - - case 0x04: { - DrvRomBank = d & 0x07; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - return; - } - - case 0x80: { - DrvHorizScrollLo = d; - return; - } - - case 0x81: { - DrvHorizScrollHi = (d & 0x01) << 8; - return; - } - - case 0x82: { - DrvRearHorizScrollLo = d; - return; - } - - case 0x83: { - DrvRearHorizScrollHi = (d & 0x07) << 8; - return; - } - - case 0x84: { - DrvRearColour = d & 0x0d; - DrvRearDisable = d & 0x40; - return; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KikcubicZ80Read1(UINT16 a) -{ - switch (a) { - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall KikcubicZ80Write1(UINT16 a, UINT8 d) -{ - if (a >= 0xc800 && a <= 0xcaff) { - INT32 Offset = a & 0x3ff; - INT32 Bank = 0; /*Offset & 0x400;*/ // always bank 0 due to shortened palette ram in kikcubic - INT32 r, g, b; - - DrvPaletteRam[Offset] = d; - - Offset &= 0xff; - r = (DrvPaletteRam[Bank + Offset + 0x000] << 3) & 0xff; - g = (DrvPaletteRam[Bank + Offset + 0x100] << 3) & 0xff; - b = (DrvPaletteRam[Bank + Offset + 0x200] << 3) & 0xff; - - DrvPalette[(Bank >> 2) + Offset] = BurnHighCol(r, g, b, 0); - return; - } - - switch (a) { - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KikcubicZ80PortRead1(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return DrvDip[0]; - } - - case 0x01: { - return DrvDip[1]; - } - - case 0x02: { - return 0xff - DrvInput[1]; - } - - case 0x03: { - return 0xff - DrvInput[0]; - } - - case 0x04: { - return 0xff - DrvInput[2]; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall KikcubicZ80PortWrite1(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - // coin write - return; - } - - case 0x04: { - DrvRomBank = d & 0x07; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - return; - } - - case 0x06: { - if (d == 0x20) return; // ??? - DrvSoundLatch = d; - ZetClose(); - ZetOpen(1); - DrvSetVector(Z80_ASSERT); - ZetClose(); - ZetOpen(0); - return; - } - - case 0x07: { - // nop??? - return; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall VigilanteZ80Read2(UINT16 a) -{ - switch (a) { - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall VigilanteZ80Write2(UINT16 a, UINT8 /*d*/) -{ - switch (a) { - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall VigilanteZ80PortRead2(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x01: { - return BurnYM2151ReadStatus(); - } - - case 0x80: { - return DrvSoundLatch; - } - - case 0x84: { - return DrvSamples[DrvSampleAddress]; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall VigilanteZ80PortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x01: { - BurnYM2151WriteRegister(d); - return; - } - - case 0x80: { - DrvSampleAddress = (DrvSampleAddress & 0xff00) | ((d << 0) & 0x00ff); - return; - } - - case 0x81: { - DrvSampleAddress = (DrvSampleAddress & 0x00ff) | ((d << 8) & 0xff00); - return; - } - - case 0x82: { - DACSignedWrite(0, d); - DrvSampleAddress = (DrvSampleAddress + 1) & 0xffff; - return; - } - - case 0x83: { - DrvSetVector(Z80_CLEAR); - return; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall BuccanrsZ80PortRead2(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return YM2203Read(0, 0); - } - - case 0x02: { - return YM2203Read(1, 0); - } - - case 0x80: { - return DrvSoundLatch; - } - - case 0x84: { - return DrvSamples[DrvSampleAddress]; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall BuccanrsZ80PortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x01: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0x02: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0x03: { - BurnYM2203Write(1, 1, d); - return; - } - - case 0x80: { - DrvSampleAddress = (DrvSampleAddress & 0xff00) | ((d << 0) & 0x00ff); - return; - } - - case 0x81: { - DrvSampleAddress = (DrvSampleAddress & 0x00ff) | ((d << 8) & 0xff00); - return; - } - - case 0x82: { - DACSignedWrite(0, d); - DrvSampleAddress = (DrvSampleAddress + 1) & 0xffff; - return; - } - - case 0x83: { - DrvSetVector(Z80_CLEAR); - return; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static void VigilantYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - DrvSetVector(YM2151_ASSERT); - } else { - DrvSetVector(YM2151_CLEAR); - } -} - -inline static void BuccanrsYM2203IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - DrvSetVector(YM2151_ASSERT); - } else { - DrvSetVector(YM2151_CLEAR); - } -} - -inline static INT32 BuccanrsSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / (18432000 / 6); -} - -inline static double BuccanrsGetTime() -{ - return (double)ZetTotalCycles() / (18432000 / 6); -} - -static INT32 VigilantSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / ((nCyclesTotal[1] * 55.0000) / (nBurnFPS / 100.0000)))); -} - -static INT32 CharPlaneOffsets[4] = { 0x80000, 0x80004, 0, 4 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 64, 65, 66, 67 }; -static INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 SpritePlaneOffsets[4] = { 0x200000, 0x200004, 0, 4 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 128, 129, 130, 131, 256, 257, 258, 259, 384, 385, 386, 387 }; -static INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 BackTilePlaneOffsets[4] = { 0, 2, 4, 6 }; -static INT32 BackTileXOffsets[32] = { 1, 0, 9, 8, 17, 16, 25, 24, 33, 32, 41, 40, 49, 48, 57, 56, 65, 64, 73, 72, 81, 80, 89, 88, 97, 96, 105, 104, 113, 112, 121, 120 }; -static INT32 BackTileYOffsets[1] = { 0 }; -static INT32 BuccSpriteXOffsets[16] = { 3, 2, 1, 0, 131, 130, 129, 128, 259, 258, 257, 256, 387, 386, 385, 384 }; -static INT32 BuccBackTilePlaneOffsets[4] = { 6, 4, 2, 0 }; - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 2, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 4, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the sprites - UINT8 *tmp2 = (UINT8*)BurnMalloc(0x20000); - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(tmp2 + 0x00000, 5, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x00000, tmp2 + 0x00000, 0x10000); - memcpy(DrvTempRom + 0x20000, tmp2 + 0x10000, 0x10000); - nRet = BurnLoadRom(tmp2 + 0x00000, 6, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x10000, tmp2 + 0x00000, 0x10000); - memcpy(DrvTempRom + 0x30000, tmp2 + 0x10000, 0x10000); - nRet = BurnLoadRom(tmp2 + 0x00000, 7, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x40000, tmp2 + 0x00000, 0x10000); - memcpy(DrvTempRom + 0x60000, tmp2 + 0x10000, 0x10000); - nRet = BurnLoadRom(tmp2 + 0x00000, 8, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x50000, tmp2 + 0x00000, 0x10000); - memcpy(DrvTempRom + 0x70000, tmp2 + 0x10000, 0x10000); - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - BurnFree(tmp2); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 11, 1); if (nRet != 0) return 1; - GfxDecode(0x4000, 4, 32, 1, BackTilePlaneOffsets, BackTileXOffsets, BackTileYOffsets, 0x80, DrvTempRom, DrvBackTiles); - - BurnFree(DrvTempRom); - - // Load sample Roms - nRet = BurnLoadRom(DrvSamples + 0x00000, 12, 1); if (nRet != 0) return 1; - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(VigilanteZ80Read1); - ZetSetWriteHandler(VigilanteZ80Write1); - ZetSetInHandler(VigilanteZ80PortRead1); - ZetSetOutHandler(VigilanteZ80PortWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xc800, 0xcfff, 0, DrvPaletteRam ); - ZetMapArea(0xc800, 0xcfff, 2, DrvPaletteRam ); - ZetMapArea(0xd000, 0xdfff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 2, DrvVideoRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram1 ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(VigilanteZ80Read2); - ZetSetWriteHandler(VigilanteZ80Write2); - ZetSetInHandler(VigilanteZ80PortRead2); - ZetSetOutHandler(VigilanteZ80PortWrite2); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom2 ); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnSetRefreshRate(55.0); - nCyclesTotal[0] = 3579645 / 55; - nCyclesTotal[1] = 3579645 / 55; - - GenericTilesInit(); - BurnYM2151Init(3579645); - BurnYM2151SetIrqHandler(&VigilantYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.55, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.55, BURN_SND_ROUTE_RIGHT); - DACInit(0, 0, 1, VigilantSyncDAC); - DACSetRoute(0, 0.45, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvcInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 2, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 4, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the sprites - UINT8 *tmp2 = (UINT8*)BurnMalloc(0x20000); - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(tmp2 + 0x00000, 5, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x00000, tmp2 + 0x00000, 0x10000); - memcpy(DrvTempRom + 0x20000, tmp2 + 0x10000, 0x10000); - nRet = BurnLoadRom(tmp2 + 0x00000, 6, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x10000, tmp2 + 0x00000, 0x10000); - memcpy(DrvTempRom + 0x30000, tmp2 + 0x10000, 0x10000); - nRet = BurnLoadRom(tmp2 + 0x00000, 7, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x40000, tmp2 + 0x00000, 0x10000); - memcpy(DrvTempRom + 0x60000, tmp2 + 0x10000, 0x10000); - nRet = BurnLoadRom(tmp2 + 0x00000, 8, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x50000, tmp2 + 0x00000, 0x10000); - memcpy(DrvTempRom + 0x70000, tmp2 + 0x10000, 0x10000); - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - BurnFree(tmp2); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x4000, 4, 32, 1, BackTilePlaneOffsets, BackTileXOffsets, BackTileYOffsets, 0x80, DrvTempRom, DrvBackTiles); - - BurnFree(DrvTempRom); - - // Load sample Roms - nRet = BurnLoadRom(DrvSamples + 0x00000, 11, 1); if (nRet != 0) return 1; - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(VigilanteZ80Read1); - ZetSetWriteHandler(VigilanteZ80Write1); - ZetSetInHandler(VigilanteZ80PortRead1); - ZetSetOutHandler(VigilanteZ80PortWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xc800, 0xcfff, 0, DrvPaletteRam ); - ZetMapArea(0xc800, 0xcfff, 2, DrvPaletteRam ); - ZetMapArea(0xd000, 0xdfff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 2, DrvVideoRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram1 ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(VigilanteZ80Read2); - ZetSetWriteHandler(VigilanteZ80Write2); - ZetSetInHandler(VigilanteZ80PortRead2); - ZetSetOutHandler(VigilanteZ80PortWrite2); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom2 ); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnSetRefreshRate(55.0); - nCyclesTotal[0] = 3579645 / 55; - nCyclesTotal[1] = 3579645 / 55; - - GenericTilesInit(); - BurnYM2151Init(3579645); - BurnYM2151SetIrqHandler(&VigilantYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.55, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.55, BURN_SND_ROUTE_RIGHT); - DACInit(0, 0, 1, VigilantSyncDAC); - DACSetRoute(0, 0.45, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvbInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 2, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 4, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 15, 1); if (nRet != 0) return 1; - GfxDecode(0x4000, 4, 32, 1, BackTilePlaneOffsets, BackTileXOffsets, BackTileYOffsets, 0x80, DrvTempRom, DrvBackTiles); - - BurnFree(DrvTempRom); - - // Load sample Roms - nRet = BurnLoadRom(DrvSamples + 0x00000, 16, 1); if (nRet != 0) return 1; - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(VigilanteZ80Read1); - ZetSetWriteHandler(VigilanteZ80Write1); - ZetSetInHandler(VigilanteZ80PortRead1); - ZetSetOutHandler(VigilanteZ80PortWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xc800, 0xcfff, 0, DrvPaletteRam ); - ZetMapArea(0xc800, 0xcfff, 2, DrvPaletteRam ); - ZetMapArea(0xd000, 0xdfff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 2, DrvVideoRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram1 ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(VigilanteZ80Read2); - ZetSetWriteHandler(VigilanteZ80Write2); - ZetSetInHandler(VigilanteZ80PortRead2); - ZetSetOutHandler(VigilanteZ80PortWrite2); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom2 ); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnSetRefreshRate(55.0); - nCyclesTotal[0] = 3579645 / 55; - nCyclesTotal[1] = 3579645 / 55; - - GenericTilesInit(); - BurnYM2151Init(3579645); - BurnYM2151SetIrqHandler(&VigilantYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.55, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.55, BURN_SND_ROUTE_RIGHT); - DACInit(0, 0, 1, VigilantSyncDAC); - DACSetRoute(0, 0.45, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 BuccanrsInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 2, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 4, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x20000, DrvTempRom + 0x10000, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x10000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 7, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x60000, DrvTempRom + 0x50000, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x50000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, BuccSpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x4000, 4, 32, 1, BuccBackTilePlaneOffsets, BackTileXOffsets, BackTileYOffsets, 0x80, DrvTempRom, DrvBackTiles); - - BurnFree(DrvTempRom); - - // Load sample Roms - nRet = BurnLoadRom(DrvSamples + 0x00000, 11, 1); if (nRet != 0) return 1; - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(VigilanteZ80Read1); - ZetSetWriteHandler(VigilanteZ80Write1); - ZetSetInHandler(BuccanrsZ80PortRead1); - ZetSetOutHandler(VigilanteZ80PortWrite1); - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "buccanrsa")) ZetSetInHandler(BuccanrsaZ80PortRead1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xc800, 0xcfff, 0, DrvPaletteRam ); - ZetMapArea(0xc800, 0xcfff, 2, DrvPaletteRam ); - ZetMapArea(0xd000, 0xdfff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 2, DrvVideoRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram1 ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(VigilanteZ80Read2); - ZetSetWriteHandler(VigilanteZ80Write2); - ZetSetInHandler(BuccanrsZ80PortRead2); - ZetSetOutHandler(BuccanrsZ80PortWrite2); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom2 ); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnSetRefreshRate(55.0); - nCyclesTotal[0] = 5688800 / 55; - nCyclesTotal[1] = (18432000 / 6) / 55; - - GenericTilesInit(); - - DrvHasYM2203 = 1; - BurnYM2203Init(2, 18432000 / 6, &BuccanrsYM2203IRQHandler, BuccanrsSynchroniseStream, BuccanrsGetTime, 0); - BurnTimerAttachZet(18432000 / 6); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.35, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, VigilantSyncDAC); - DACSetRoute(0, 0.35, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 KikcubicInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "kikcubicb")) { - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x20000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x28000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 9, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load sample Roms - nRet = BurnLoadRom(DrvSamples + 0x00000, 10, 1); if (nRet != 0) return 1; - } else { - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x20000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load sample Roms - nRet = BurnLoadRom(DrvSamples + 0x00000, 8, 1); if (nRet != 0) return 1; - } - - BurnFree(DrvTempRom); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(KikcubicZ80Read1); - ZetSetWriteHandler(KikcubicZ80Write1); - ZetSetInHandler(KikcubicZ80PortRead1); - ZetSetOutHandler(KikcubicZ80PortWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xc000, 0xc0ff, 0, DrvSpriteRam ); - ZetMapArea(0xc000, 0xc0ff, 1, DrvSpriteRam ); - ZetMapArea(0xc000, 0xc0ff, 2, DrvSpriteRam ); - ZetMapArea(0xc800, 0xcaff, 0, DrvPaletteRam ); - ZetMapArea(0xc800, 0xcaff, 2, DrvPaletteRam ); - ZetMapArea(0xd000, 0xdfff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 2, DrvVideoRam ); - ZetMapArea(0xe000, 0xffff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xffff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xffff, 2, DrvZ80Ram1 ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(VigilanteZ80Read2); - ZetSetWriteHandler(VigilanteZ80Write2); - ZetSetInHandler(VigilanteZ80PortRead2); - ZetSetOutHandler(VigilanteZ80PortWrite2); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom2 ); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80Ram2 ); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnSetRefreshRate(55.0); - nCyclesTotal[0] = 3579645 / 55; - nCyclesTotal[1] = 3579645 / 55; - - GenericTilesInit(); - BurnYM2151Init(3579645); - BurnYM2151SetIrqHandler(&VigilantYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.55, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.55, BURN_SND_ROUTE_RIGHT); - DACInit(0, 0, 1, VigilantSyncDAC); - DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - DrvKikcubicDraw = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - if (DrvHasYM2203) { - BurnYM2203Exit(); - } else { - BurnYM2151Exit(); - } - DACExit(); - - GenericTilesExit(); - - BurnFree(Mem); - - DrvRomBank = 0; - DrvSoundLatch = 0; - DrvIrqVector = 0; - DrvRearColour = 0; - DrvRearDisable = 0; - DrvHorizScrollLo = 0; - DrvHorizScrollHi = 0; - DrvRearHorizScrollLo = 0; - DrvRearHorizScrollHi = 0; - DrvSampleAddress = 0; - - DrvHasYM2203 = 0; - DrvKikcubicDraw = 0; - - return 0; -} - -static void DrvRenderBackground() -{ - INT32 CharCode = 0; - INT32 Scroll = 0x17a - (DrvRearHorizScrollLo + DrvRearHorizScrollHi); - if (Scroll > 0) Scroll -= 2048; - - for (INT32 i = 0; i < 16; i++) { - INT32 r, g, b; - - r = (DrvPaletteRam[0x400 + 16 * DrvRearColour + i] << 3) & 0xff; - g = (DrvPaletteRam[0x500 + 16 * DrvRearColour + i] << 3) & 0xff; - b = (DrvPaletteRam[0x600 + 16 * DrvRearColour + i] << 3) & 0xff; - - DrvPalette[512 + i] = BurnHighCol(r, g, b, 0); - - r = (DrvPaletteRam[0x400 + 16 * DrvRearColour + 32 + i] << 3) & 0xff; - g = (DrvPaletteRam[0x500 + 16 * DrvRearColour + 32 + i] << 3) & 0xff; - b = (DrvPaletteRam[0x600 + 16 * DrvRearColour + 32 + i] << 3) & 0xff; - - DrvPalette[512 + 16 + i] = BurnHighCol(r, g, b, 0); - } - - for (INT32 Page = 0; Page < 4; Page++) { - for (INT32 Row = 0; Row < 256; Row++) { - for (INT32 Col = 0; Col < 512; Col += 32) { - INT32 Colour = (Row < 128) ? 0 : 1; - UINT32 nPalette = 512 | (Colour << 4); - - for (INT32 px = 0; px < 32; px++) { - UINT8 c = DrvBackTiles[(CharCode * 32) + px]; - INT32 xPos = (512 * Page) + Col + px + Scroll; - - if (Row >= 0 && Row < nScreenHeight) { - UINT16* pPixel = pTransDraw + (Row * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette; - } - } - } - - CharCode++; - } - } - } -} - -static void DrvDrawForeground(INT32 Priority, INT32 Opaque) -{ - INT32 Scroll = -(DrvHorizScrollLo + DrvHorizScrollHi); - - for (INT32 Offset = 0; Offset < 0x1000; Offset += 2) { - INT32 sy = 8 * ((Offset / 2) / 64); - INT32 sx = 8 * ((Offset / 2) % 64); - INT32 Attr = DrvVideoRam[Offset + 1]; - INT32 Colour = Attr & 0x0f; - INT32 Tile = DrvVideoRam[Offset + 0] | ((Attr & 0xf0) << 4); - - if (Priority) { - // Sprite masking - if ((Colour & 0x0c) == 0x0c) { - if (sy >= 48) { - sx = (sx + Scroll) & 0x1ff; - - sx -= 128; - - INT32 px, py; - UINT32 nPalette = 256 | (Colour << 4); - - for (py = 0; py < 8; py++) { - for (px = 0; px < 8; px++) { - UINT8 c = DrvChars[(Tile * 64) + (py * 8) + px]; - - if (((0xff >> c) & 0x01) == 0) { - INT32 xPos = sx + px; - INT32 yPos = sy + py; - - if (yPos >= 0 && yPos < nScreenHeight) { - UINT16* pPixel = pTransDraw + (yPos * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette; - } - } - } - } - } - } - } - } else { - if (sy >= 48) sx = (sx + Scroll) & 0x1ff; - - sx -= 128; - - if (sx >= 0 && sx < (nScreenWidth - 8) && sy >= 0 && sy < (nScreenHeight - 8)) { - if (Opaque || Colour >= 4) { - Render8x8Tile(pTransDraw, Tile, sx, sy, Colour, 4, 256, DrvChars); - } else { - Render8x8Tile_Mask(pTransDraw, Tile, sx, sy, Colour, 4, 0, 256, DrvChars); - } - } else { - if (Opaque || Colour >= 4) { - Render8x8Tile_Clip(pTransDraw, Tile, sx, sy, Colour, 4, 256, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Tile, sx, sy, Colour, 4, 0, 256, DrvChars); - } - } - } - } -} - -static void DrvDrawSprites() -{ - INT32 DrvSpriteRamSize = 0xc0; - if (DrvKikcubicDraw) DrvSpriteRamSize = 0x100; - - for (INT32 Offset = 0; Offset < DrvSpriteRamSize; Offset += 8) { - INT32 Code, Colour, sx, sy, xFlip, yFlip, h; - - Code = DrvSpriteRam[Offset + 4] | ((DrvSpriteRam[Offset + 5] & 0x0f) << 8); - Colour = DrvSpriteRam[Offset + 0] & 0x0f; - sx = (DrvSpriteRam[Offset + 6] | ((DrvSpriteRam[Offset + 7] & 0x01) << 8)); - sy = 256 + 128 - (DrvSpriteRam[Offset + 2] | ((DrvSpriteRam[Offset + 3] & 0x01) << 8)); - xFlip = DrvSpriteRam[Offset + 5] & 0x40; - yFlip = DrvSpriteRam[Offset + 5] & 0x80; - h = 1 << ((DrvSpriteRam[Offset + 5] & 0x30) >> 4); - sy -= 16 * h; - - Code &= ~(h - 1); - - if (DrvKikcubicDraw) { - sx -= 64; - } else { - sx -= 128; - } - - for (INT32 y = 0; y < h; y++) { - INT32 c = Code; - - if (yFlip) { - c += h - 1 - y; - } else { - c += y; - } - - if (sx > 16 && sx < (nScreenWidth - 16) && (sy + (16 * y)) > 16 && (sy + (16 * y)) < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, c, sx, sy + (16 * y), Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, c, sx, sy + (16 * y), Colour, 4, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, c, sx, sy + (16 * y), Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, c, sx, sy + (16 * y), Colour, 4, 0, 0, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, c, sx, sy + (16 * y), Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, c, sx, sy + (16 * y), Colour, 4, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, c, sx, sy + (16 * y), Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, c, sx, sy + (16 * y), Colour, 4, 0, 0, DrvSprites); - } - } - } - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - - if (DrvRearDisable) { - DrvDrawForeground(0, 1); - DrvDrawSprites(); - DrvDrawForeground(1, 0); - } else { - DrvRenderBackground(); - DrvDrawForeground(0, 0); - DrvDrawSprites(); - DrvDrawForeground(1, 0); - } - - BurnTransferCopy(DrvPalette); -} - -static void KikcubicDraw() -{ - BurnTransferClear(); - - for (INT32 Offset = 0; Offset < 0x1000; Offset += 2) { - INT32 sy = 8 * ((Offset / 2) / 64); - INT32 sx = 8 * ((Offset / 2) % 64); - INT32 Attr = DrvVideoRam[Offset + 1]; - INT32 Colour = (Attr & 0xf0) >> 4; - INT32 Code = DrvVideoRam[Offset] | ((Attr & 0x0f) << 8); - - sx -= 64; - if (sx >= 0 && sx < (nScreenWidth - 8) && sy >= 0 && sy < (nScreenHeight - 8)) { - Render8x8Tile(pTransDraw, Code, sx, sy, Colour, 4, 0, DrvChars); - } else { - Render8x8Tile_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, DrvChars); - } - } - - DrvDrawSprites(); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 256; // dac needs 128 NMIs - INT32 nSoundBufferPos = 0; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - if (!DrvHasYM2203) { - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - } else { - BurnTimerUpdate(i * (nCyclesTotal[nCurrentCPU] / nInterleave)); - } - if (i & 1) { - ZetNmi(); - } - ZetClose(); - - if (pBurnSoundOut && !DrvHasYM2203) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - ZetOpen(1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - nSoundBufferPos += nSegmentLength; - } - } - - if (DrvHasYM2203) { - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - ZetClose(); - } - - if (pBurnSoundOut && !DrvHasYM2203) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - ZetOpen(1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (DrvHasYM2203 && pBurnSoundOut) { - ZetOpen(1); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - if (DrvKikcubicDraw) { - KikcubicDraw(); - } else { - DrvDraw(); - } - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029705; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - if (DrvHasYM2203) { - BurnYM2203Scan(nAction, pnMin); - } else { - BurnYM2151Scan(nAction); - } - DACScan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(DrvRomBank); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvDip); - SCAN_VAR(DrvInput); - SCAN_VAR(DrvIrqVector); - SCAN_VAR(DrvRearColour); - SCAN_VAR(DrvRearDisable); - SCAN_VAR(DrvHorizScrollLo); - SCAN_VAR(DrvHorizScrollHi); - SCAN_VAR(DrvRearHorizScrollLo); - SCAN_VAR(DrvRearHorizScrollHi); - SCAN_VAR(DrvSampleAddress); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - ZetClose(); - } - - return 0; -} - -#undef VECTOR_INIT -#undef YM2151_ASSERT -#undef YM2151_CLEAR -#undef Z80_ASSERT -#undef Z80_CLEAR - -struct BurnDriver BurnDrvVigilant = { - "vigilant", NULL, NULL, NULL, "1988", - "Vigilante (World, Rev E)\0", NULL, "Irem", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvVigilanta = { - "vigilanta", "vigilant", NULL, NULL, "1988", - "Vigilante (World, Rev A)\0", NULL, "Irem", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, VigilantaRomInfo, VigilantaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvcInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvVigilantb = { - "vigilantb", "vigilant", NULL, NULL, "1988", - "Vigilante (US, Rev B)\0", NULL, "Irem (Data East License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, VigilantbRomInfo, VigilantbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvcInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvVigilantc = { - "vigilantc", "vigilant", NULL, NULL, "1988", - "Vigilante (World, Rev C)\0", NULL, "Irem", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, Drv1RomInfo, Drv1RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvcInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvVigilanto = { - "vigilanto", "vigilant", NULL, NULL, "1988", - "Vigilante (US)\0", NULL, "Irem (Data East USA License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, DrvuRomInfo, DrvuRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvcInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvVigilantg = { - "vigilantg", "vigilant", NULL, NULL, "1988", - "Vigilante (US, Rev G)\0", NULL, "Irem (Data East USA License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, Drvu2RomInfo, Drvu2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvVigilantd = { - "vigilantd", "vigilant", NULL, NULL, "1988", - "Vigilante (Japan, Rev D)\0", NULL, "Irem", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, DrvjRomInfo, DrvjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvcInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvVigilantbl = { - "vigilantbl", "vigilant", NULL, NULL, "1988", - "Vigilante (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, DrvbRomInfo, DrvbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvbInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvKikcubic = { - "kikcubic", NULL, NULL, NULL, "1988", - "Meikyu Jima (Japan)\0", NULL, "Irem", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_MISC, GBF_MAZE, 0, - NULL, KikcubicRomInfo, KikcubicRomName, NULL, NULL, KikcubicInputInfo, KikcubicDIPInfo, - KikcubicInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvKikcubicb = { - "kikcubicb", "kikcubic", NULL, NULL, "1988", - "Kickle Cubele\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_IREM_MISC, GBF_MAZE, 0, - NULL, KikcubicbRomInfo, KikcubicbRomName, NULL, NULL, KikcubicInputInfo, KikcubicDIPInfo, - KikcubicInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvBuccanrs = { - "buccanrs", NULL, NULL, NULL, "1989", - "Buccaneers (set 1)\0", NULL, "Duintronic", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, BuccanrsRomInfo, BuccanrsRomName, NULL, NULL, BuccanrsInputInfo, BuccanrsDIPInfo, - BuccanrsInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvBuccanrsa = { - "buccanrsa", "buccanrs", NULL, NULL, "1989", - "Buccaneers (set 2)\0", NULL, "Duintronic", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, BuccanrsaRomInfo, BuccanrsaRomName, NULL, NULL, BuccanrsaInputInfo, BuccanrsaDIPInfo, - BuccanrsInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; - -struct BurnDriver BurnDrvBuccanrsb = { - "buccanrsb", "buccanrs", NULL, NULL, "1989", - "Buccaneers (set 3, harder)\0", NULL, "Duintronic", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_MISC, GBF_SCRFIGHT, 0, - NULL, BuccanrsbRomInfo, BuccanrsbRomName, NULL, NULL, BuccanrsInputInfo, BuccanrsDIPInfo, - BuccanrsInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 544, 256, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/irem/irem_cpu.cpp b/jan/src/burn/drv/irem/irem_cpu.cpp deleted file mode 100644 index fb2c96ded..000000000 --- a/jan/src/burn/drv/irem/irem_cpu.cpp +++ /dev/null @@ -1,678 +0,0 @@ -/***************************************************************************** - - Irem Custom V35+ CPU - -- has internal 256 byte lookup table, handled in realtime. Bomberman - World runs encrypted code from RAM, Risky Challenge expects to be able - to run code in emulation (non-encrypted) mode for some subroutines.. - - Hasamu Nanao 08J27261A1 011 9102KK700 - Gunforce Nanao 08J27261A1 011 9106KK701 - Ken-Go Nanao 08J27261A1 011 9102KK701 - Bomberman Nanao 08J27261A1 012 9123KK200 - Atomic Punk Nanao 08J27291A1 012 9128KK440 - Blade Master / Cross Blades! Nanao 08J27291A1 012 9123KK740 - Quiz F-1 1,2 Finish Nanao 08J27291A4 014 9147KK700 - Gunforce 2 Nanao 08J27291A4 014 9247KK700 - Lethal Thunder Nanao 08J27291A4 014 9147KK700 - Bomberman World / New Atomic Punk Nanao 08J27291A5 015 9219KK700 - Undercover Cops Nanao 08J27291A5 015 9219KK700 - Mystic Riders / Gun Hohki Nanao 08J27291A6 016 9217NK700 - The IREM Skins Game/Major Title 2 Nanao 08J27291A7 017 - or (some Major Title 2) Nanao 08J27291A6 016 9217NK700 (same as Mystic Riders) - Hook Nanao 08J27291A8 018 9237NK700 - - R-Type Leo Irem D8000021A1 019 9242NK700 - Fire Barrel Irem D8000010A1 019 9243NK700 - Air Assault same as Gun Force - In The Hunt Irem D8000011A1 020 - Risky Challenge/Gussun Oyoyo Irem D8000019A1 022 9331NK700 - Match It II/Shisensho II Irem D8000020A1 023 9320NK700 - World PK Soccer/Kick for the Goal Irem D8000021A1 024 9335NK701 - Ninja Baseball Batman Irem D8000021A1 024 9335NK700 - Perfect Soldiers Irem D8000022A1 - Dream Soccer '94 Irem D8000023A1 026 - - Please let me know if you can fill in any of the blanks. - - Emulation by Bryan McPhail, mish@tendril.co.uk, thanks to Chris Hardy too! - -*****************************************************************************/ - - - -#include "burnint.h" -#include "irem_cpu.h" - - -// CAVEATS: -// 0x80 and 0x82 pre- opcodes can easily be confused. They perform exactly the same -// function when operating on memory, but when working with registers one affects -// byte registers and the other word registers. Gunforce, Blade Master and -// Lethal Thunder had this error. - -//double check 0x00 0x22 0x28 0x4a 0x34 in these tables - -#define xxxx 0x90/* Unknown */ - -const UINT8 gunforce_decryption_table[256] = { - 0xff,xxxx,xxxx,0x2c,xxxx,xxxx,0x43,0x88, xxxx,0x13,0x0a,0xbd,0xba,0x60,0xea,xxxx, /* 00 */ - xxxx,xxxx,0xf2,0x29,0xb3,0x22,xxxx,0x0c, 0xa9,0x5f,0x9d,0x07,xxxx,xxxx,0x0b,0xbb, /* 10 */ - 0x8a,xxxx,xxxx,xxxx,0x3a,0x3c,0x5a,0x38, 0x99,xxxx,0xf8,0x89,xxxx,0x91,xxxx,0x55, /* 20 */ - 0xac,0x40,0x73,xxxx,0x59,xxxx,0xfc,xxxx, 0x50,0xfa,xxxx,0x25,xxxx,0x34,0x47,0xb7, /* 30 */ - xxxx,xxxx,xxxx,0x49,xxxx,0x0f,0x8b,0x05, 0xc3,0xa5,0xbf,0x83,0x86,0xc5,xxxx,xxxx, /* 40 */ - 0x08,0x77,0x24,0xb4,xxxx,0x92,xxxx,0x3b, 0x5e,0xb6,0x80,0x0d,0x2e,0xab,0xe7,xxxx, /* 50 */ - 0x48,xxxx,0xad,0xc0,xxxx,0x1b,0xc6,0xa3, 0x04,xxxx,xxxx,xxxx,0x16,0xb0,0x7d,0x98, /* 60 */ - 0x87,0x46,0x8c,xxxx,xxxx,0xfe,xxxx,0xcf, xxxx,0x68,0x84,xxxx,0xd2,xxxx,0x18,0x51, /* 70 */ - 0x76,0xa4,0x36,0x52,0xfb,xxxx,0xb9,xxxx, xxxx,0xb1,0x1c,0x21,0xe6,0xb5,0x17,0x27, /* 80 */ - 0x3d,0x45,0xbe,0xae,xxxx,0x4a,0x0e,0xe5, xxxx,0x58,0x1f,0x61,0xf3,0x02,xxxx,0xe8, /* 90 */ - xxxx,xxxx,xxxx,0xf7,0x56,0x96,0xaa,0xbc, 0x4f,xxxx,xxxx,0x79,0xd0,xxxx,0x2a,0x12, /* A0 */ - 0x4e,0xb8,xxxx,0x41,xxxx,0x90,0xd3,xxxx, 0x2d,0x33,0xf6,xxxx,xxxx,0x14,xxxx,0x32, /* B0 */ - 0x5d,0xa8,0x53,0x26,0x2b,0x20,0x81,0x75, 0x7f,0x3e,xxxx,xxxx,0x00,0x93,xxxx,0xb2, /* C0 */ - 0x57,xxxx,0xa0,xxxx,0x39,xxxx,xxxx,0x72, xxxx,0x01,0x42,0x74,0x9c,0x1e,xxxx,0x5b, /* D0 */ - xxxx,0xf9,xxxx,0x2f,0x85,xxxx,0xeb,0xa2, xxxx,0xe2,0x11,xxxx,0x4b,0x7e,xxxx,0x78, /* E0 */ - xxxx,xxxx,0x09,0xa1,0x03,xxxx,0x23,0xc1, 0x8e,0xe9,0xd1,0x7c,xxxx,xxxx,0xc7,0x06, /* F0 */ -}; -// 0x13 (0x29) guess -// 0x18 (0xa9) guess -// 0x50 (0x28) guess -// 0x63 (0xc0) guess -// 0x7e (0x18) opcode is right but arguments could be swapped -// 0xcc (0x00) guess -// 0xea (0x11) guess -// 0x51 (0x77) guess (kengo) -// 0x96 (0x0e) complete guess (kengo), maybe wrong but I don't see what it could be - - -//double check 22 (boot bomb at 2a000) -//47a7 (46e0 in boot) - hmm - -// 0x00 is NOT 0x20 (no context in bomberman) - -const UINT8 bomberman_decryption_table[256] = { - xxxx,xxxx,0x79,xxxx,0x9d,0x48,xxxx,xxxx, xxxx,xxxx,0x2e,xxxx,xxxx,0xa5,0x72,xxxx, /* 00 */ - 0x46,0x5b,0xb1,0x3a,0xc3,xxxx,0x35,xxxx, xxxx,0x23,xxxx,0x99,xxxx,0x05,xxxx,0x3c, /* 10 */ - 0x3b,0x76,0x11,xxxx,xxxx,0x4b,xxxx,0x92, xxxx,0x32,0x5d,xxxx,0xf7,0x5a,0x9c,xxxx, /* 20 */ - 0x26,0x40,0x89,xxxx,xxxx,xxxx,xxxx,0x57, xxxx,xxxx,xxxx,xxxx,xxxx,0xba,0x53,0xbb, /* 30 */ - 0x42,0x59,0x2f,xxxx,0x77,xxxx,xxxx,0x4f, 0xbf,0x4a,0xcb,0x86,0x62,0x7d,xxxx,0xb8, /* 40 */ - xxxx,0x34,xxxx,0x5f,xxxx,0x7f,0xf8,0x80, 0xa0,0x84,0x12,0x52,xxxx,xxxx,xxxx,0x47, /* 50 */ - xxxx,0x2b,0x88,0xf9,xxxx,0xa3,0x83,xxxx, 0x75,0x87,xxxx,0xab,0xeb,xxxx,0xfe,xxxx, /* 60 */ - xxxx,0xaf,0xd0,0x2c,0xd1,0xe6,0x90,0x43, 0xa2,0xe7,0x85,0xe2,0x49,0x22,0x29,xxxx, /* 70 */ - 0x7c,xxxx,xxxx,0x9a,xxxx,xxxx,0xb9,xxxx, 0x14,0xcf,0x33,0x02,xxxx,xxxx,xxxx,0x73, /* 80 */ - xxxx,0xc5,xxxx,xxxx,xxxx,0xf3,0xf6,0x24, xxxx,0x56,0xd3,xxxx,0x09,0x01,xxxx,xxxx, /* 90 */ - 0x03,0x2d,0x1b,xxxx,0xf5,0xbe,xxxx,xxxx, 0xfb,0x8e,0x21,0x8d,0x0b,xxxx,xxxx,0xb2, /* A0 */ - 0xfc,0xfa,0xc6,xxxx,0xe8,0xd2,xxxx,0x08, 0x0a,0xa8,0x78,0xff,xxxx,0xb5,xxxx,xxxx, /* B0 */ - 0xc7,0x06,0x18,xxxx,xxxx,0x1e,0x7e,0xb0, 0x0e,0x0f,xxxx,xxxx,0x0c,0xaa,0x55,xxxx, /* C0 */ - xxxx,0x74,0x3d,xxxx,xxxx,0x38,0x27,0x50, xxxx,0xb6,0x5e,0x8b,0x07,0xe5,0x39,0xea, /* D0 */ - 0xbd,xxxx,0x81,0xb7,xxxx,0x8a,0x0d,xxxx, 0x58,0xa1,0xa9,0x36,xxxx,0xc4,xxxx,0x8f, /* E0 */ - 0x8c,0x1f,0x51,0x04,0xf2,xxxx,0xb3,0xb4, 0xe9,0x2a,xxxx,xxxx,xxxx,0x25,xxxx,0xbc, /* F0 */ -}; -// 49 -> 4a (verified in a bombrman PCB) - -const UINT8 lethalth_decryption_table[256] = { - 0x7f,0x26,0x5d,xxxx,0xba,xxxx,0x1e,0x5e, 0xb8,xxxx,0xbc,0xe8,0x01,xxxx,0x4a,0x25, /* 00 */ -// ssss !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! - xxxx,0xbd,xxxx,0x22,0x10,xxxx,0x02,0x57, 0x70,xxxx,0x7e,xxxx,0xe7,0x52,xxxx,0xa9, /* 10 */ -// !!!! !!!! !!!! ???? !!!! !!!! gggg - xxxx,xxxx,0xc6,0x06,0xa0,0xfe,0xcf,0x8e, 0x43,0x8f,0x2d,xxxx,0xd4,0x85,0x75,0xa2, /* 20 */ -// !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! - 0x3d,xxxx,xxxx,0x38,0x7c,0x89,0xd1,0x80, 0x3b,0x72,0x07,xxxx,0x42,0x37,0x0a,0x18, /* 30 */ -// gggg !!!! ???? !!!! !!!! !!!! !!!! !!!! !!!! ssss !!!! - 0x88,0xb4,0x98,0x8b,0xb9,0x9c,0xad,0x0e, 0x2b,xxxx,0xbf,xxxx,0x55,xxxx,0x56,0xb0, /* 40 */ -// !!!! pppp !!!! !!!! !!!! !!!! gggg !!!! !!!! !!!! !!!! - 0x93,0x91,xxxx,0xeb,xxxx,0x50,0x41,0x29, 0x47,xxxx,xxxx,0x60,xxxx,0xab,xxxx,xxxx, /* 50 */ -// pppp !!!! !!!! !!!! !!!! !!!! !!!! !!!! - 0xc3,0xe2,0xd0,0xb2,0x11,0x79,xxxx,0x08, xxxx,0xfb,xxxx,0x2c,0x23,xxxx,0x28,0x0d, /* 60 */ -// !!!! !!!! !!!! !!!! ???? !!!! !!!! - xxxx,xxxx,xxxx,0x83,0x3c,xxxx,0x1b,0x34, 0x5b,xxxx,0x40,xxxx,xxxx,0x04,0xfc,0xcd, /* 70 */ -// !!!! !!!! !!!! !!!! !!!! ssss - 0xb1,0xf3,0x8a,xxxx,xxxx,0x87,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0xbe,0x84,0x1f,0xe6, /* 80 */ -// !!!! !!!! !!!! !!!! !!!! - 0xff,xxxx,0x12,xxxx,0xb5,0x36,xxxx,0xb3, xxxx,xxxx,xxxx,0xd2,0x4e,xxxx,xxxx,xxxx, /* 90 */ -// !!!! !!!! !!!! - 0xa5,xxxx,xxxx,0xc7,xxxx,0x27,0x0b,xxxx, 0x20,xxxx,xxxx,xxxx,xxxx,xxxx,0x61,0x7d, /* A0 */ -// !!!! !!!! !!!! !!!! ???? - xxxx,xxxx,0x86,0x0f,xxxx,0xb7,xxxx,0x4f, xxxx,xxxx,0xc0,0xfd,xxxx,0x39,xxxx,0x77, /* B0 */ -// !!!! !!!! !!!! !!!! !!!! - 0x05,0x3a,xxxx,0x48,0x92,0x76,0x3e,0x03, xxxx,0xf8,xxxx,0x59,0xa8,0x5f,0xf9,0xbb, /* C0 */ -// !!!! !!!! pppp !!!! !!!! !!!! !!!! !!!! - 0x81,0xfa,0x9d,0xe9,0x2e,0xa1,0xc1,0x33, xxxx,0x78,xxxx,0x0c,xxxx,0x24,0xaa,0xac, /* D0 */ -// !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! ???? !!!! !!!! - xxxx,0xb6,xxxx,0xea,xxxx,0x73,0xe5,0x58, 0x00,0xf7,xxxx,0x74,xxxx,0x76,xxxx,0xa3, /* E0 */ -// !!!! gggg !!!! !!!! !!!! !!!! ???? !!!! - xxxx,0x5a,0xf6,0x32,0x46,0x2a,xxxx,xxxx, 0x53,0x4b,0x90,0x0d,0x51,0x68,0x99,0x13, /* F0 */ -// !!!! !!!! !!!! !!!! !!!! !!!! !!!! ???? !!!! !!!! -}; -/* -missing opcode: - -"!!!!" -> checked against gussun -"gggg" -> very probably -"pppp" -> probably -"ssss" -> sure -"????" -> missing - - -1a -> (78,7c,7e) -> -34 -> (78,7c,7e) -> 78 - -65 -> (79, -af -> (79,7d) (strange 71) -> -d9 -> (11e07 from 11de6) (70,78 -> to handle a01ce=000-7d0 -> 0x78 -ed -> (p76,78,7c,7e) -> -fb -> - -probably: -42 -> 0x98 (083a3) -50 -> 0x93 (083a7) -c5 -> (18d56 - from 1844f) (71,73,76,79,7a,7d,7e) -> to handle level number (a008d=00-0f) -> 0x76 - -very probably: -48 -> 0x2b -e5 -> 0x73 - -sure: -00 -> 0x7f -3d -> 0x37 -7f -> 0xcd (little machine in the game - 16058) - -*/ -// 0x2c (0xd4) complete guess -// 0x2d (0x85) complete guess -// 0xc4 (0x92) guess -// 0xbb (0xfd) guess -// 0x46 (0xad) guess - risky challenge use same code -// 0x6e (0x28) guess -// 0x76 (0x1b) guess -// 0x8d (0x84) guess -// 0xa6 (0x0b) guess - risky challenge use same code -// 0xa8 (0x20) guess -// 0xbd (0x39) guess - risky challenge use same code -// 0xc3 (0x48) guess -// and our collection of conditional branches: -// 0xbf (0x7d) >= (monitor test) -// 0x34 (0x7c) < or <= (seems more like <) | these two are used toghether -// 0xaf (0x7f) > or >= (seems more like >) | -// 0xed (0x7e) <= or < (seems more like <=) -// 0x00 (0x7f) > ? | these two are used toghether -// 0x1a (0x7c) < ? | (rowscroll on pink screen on startup) -// 0xc5 (0x7a) completely in the dark (game start after car seelction) - - -const UINT8 dynablaster_decryption_table[256] = { - 0x1f,0x51,0x84,xxxx,0x3d,0x09,0x0d,xxxx, xxxx,0x57,xxxx,xxxx,xxxx,0x32,0x11,xxxx, /* 00 */ - xxxx,0x9c,xxxx,xxxx,0x4b,xxxx,xxxx,0x03, xxxx,xxxx,xxxx,0x89,0xb0,xxxx,xxxx,xxxx, /* 10 */ - xxxx,0xbb,0x18,0xbe,0x53,0x21,0x55,0x7c, xxxx,xxxx,0x47,0x58,0xf6,xxxx,xxxx,0xb2, /* 20 */ - 0x06,xxxx,0x2b,xxxx,0x2f,0x0b,0xfc, 0x91 , xxxx,xxxx,0xfa,0x81,0x83,0x40,0x38,xxxx, /* 30 */ - xxxx,xxxx,0x49,0x85,0xd1,0xf5,0x07,0xe2, 0x5e,0x1e,xxxx,0x04,xxxx,xxxx,xxxx,0xb1, /* 40 */ - 0xc7,xxxx,0x96, 0xf2 /*0xaf*/, 0xb6,0xd2,0xc3,xxxx, 0x87,0xba,0xcb,0x88,xxxx,0xb9,0xd0,0xb5, /* 50 */ - 0x9a,0x80,0xa2,0x72,xxxx,0xb4,xxxx,0xaa, 0x26,0x7d,0x52,0x33,0x2e,0xbc,0x08,0x79, /* 60 */ - 0x48,xxxx,0x76,0x36,0x02,xxxx,0x5b,0x12, 0x8b,0xe7,xxxx,xxxx,xxxx,0xab,xxxx,0x4f, /* 70 */ - xxxx,xxxx,0xa8,0xe5,0x39,0x0e,0xa9,xxxx, xxxx,0x14,xxxx,0xff, 0x7f/*0x75*/ ,xxxx,xxxx,0x27, /* 80 */ - xxxx,0x01,xxxx,xxxx,0xe6,0x8a,0xd3,xxxx, xxxx,0x8e,0x56,0xa5,0x92,xxxx,xxxx,0xf9, /* 90 */ - 0x22,xxxx,0x5f,xxxx,xxxx,0xa1,xxxx,0x74, 0xb8,xxxx,0x46,0x05,0xeb,0xcf,0xbf,0x5d, /* a0 */ - 0x24,xxxx,0x9d,xxxx,xxxx,xxxx,xxxx,xxxx, 0x59,0x8d,0x3c,0xf8,0xc5,xxxx,0xf3,0x4e, /* b0 */ - xxxx,xxxx,0x50,0xc6,0xe9,0xfe,0x0a,xxxx, 0x99,0x86,xxxx,xxxx,0xaf ,0x8c/*0x8e*/,0x42,0xf7, /* c0 */ - xxxx,0x41,xxxx,0xa3,xxxx,0x3a,0x2a,0x43, xxxx,0xb3,0xe8,xxxx,0xc4,0x35,0x78,0x25, /* d0 */ - 0x75,xxxx,0xb7,xxxx,0x23,xxxx, xxxx/*0xe2*/,0x8f, xxxx,xxxx,0x2c,xxxx,0x77,0x7e,xxxx,0x0f, /* e0 */ - 0x0c,0xa0,0xbd,xxxx,xxxx,0x2d,0x29,0xea, xxxx,0x3b,0x73,xxxx,0xfb,0x20,xxxx,0x5a /* f0 */ -}; -//double check 0x00/0xa0 AND. -//double check 0x8c (0x7d jg) -//double check 0xfd (0x20 AND) - 9d2 in code -//double check 0xd1 (0x41 INC cw) used in uccops and dynablaster (LOOKS GOOD) - -//AND fd (0x20) -//0x37 (91) guess from dynablaster title screen - -// BM - 0x61 NOT 82, but instead 0x80 verified in both Atomic Punk and UCCops -// 0x22 is 0x18 (SBB) verified from Gunforce -// 0x5b seems confirmed (previous commented out as 0x36) -// NS I expected 0x32 to be 0x1b (SBB) like in gunforce, but startup tests fail in bbmanw. -// therefore it seems to be 0x2b (SUB) -// NS010718 0xa0 was 0x00 (ADDB), verified to be 0x22 (ANDB) - - -const UINT8 mysticri_decryption_table[256] = { - xxxx,0x57,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0xbf,0x43,xxxx,xxxx,xxxx,xxxx,0xfc,xxxx, /* 00 */ - xxxx,xxxx,xxxx,xxxx,xxxx,0x52,0xa3,0x26, xxxx,0xc7,xxxx,0x0f,xxxx,0x0c,xxxx,xxxx, /* 10 */ - xxxx,xxxx,0xff,xxxx,xxxx,0x02,xxxx,xxxx, 0x2e,xxxx,0x5f,xxxx,xxxx,xxxx,0x73,0x50, /* 20 */ - 0xb2,0x3a,xxxx,xxxx,0xbb,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 30 */ - xxxx,xxxx,0x8e,0x3c,0x42,xxxx,xxxx,0xb9, xxxx,xxxx,0x2a,xxxx,0x47,0xa0,0x2b,0x03, /* 40 */ - 0xb5,0x1f,xxxx,0xaa,xxxx,0xfb,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0x38,xxxx,xxxx,xxxx, /* 50 */ - 0x2c,xxxx,xxxx,0xc6,xxxx,xxxx,0xb1,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xa2,xxxx, /* 60 */ - 0xe9,0xe8,xxxx,xxxx,0x86,xxxx,0x8b,xxxx, xxxx,xxxx,xxxx,xxxx,0x5b,0x72,xxxx,xxxx, /* 70 */ - xxxx,xxxx,0x5d,0x0a,xxxx,xxxx,0x89,xxxx, 0xb0,0x88,xxxx,xxxx,xxxx,0x87,0x75,0xbd, /* 80 */ - xxxx,0x51,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,0x5a,0x58,xxxx,xxxx,0x56, /* 90 */ - xxxx,0x8a,xxxx,0x55,xxxx,xxxx,xxxx,0xb4, 0x08,xxxx,0xf6,xxxx,xxxx,0x9d,xxxx,0xbc, /* A0 */ - 0x0b,xxxx,xxxx,0x5e,xxxx,xxxx,xxxx,0x22, 0x36,xxxx,0x1e,xxxx,0xb6,0xba,0x23,xxxx, /* B0 */ - 0x20,xxxx,xxxx,xxxx,0x59,0x53,xxxx,0x04, 0x81,xxxx,xxxx,0xf3,xxxx,xxxx,0x3b,0x06, /* C0 */ - xxxx,0x79,0x83,0x9c,xxxx,0x18,0x80,xxxx, 0xc3,xxxx,xxxx,xxxx,0x32,xxxx,0xcf,xxxx, /* D0 */ - 0xeb,xxxx,xxxx,0x33,xxxx,0xfa,xxxx,xxxx, 0xd2,xxxx,0x24,xxxx,0x74,0x41,0xb8,xxxx, /* E0 */ - xxxx,xxxx,0xd0,0x07,xxxx,xxxx,xxxx,xxxx, xxxx,0x46,xxxx,0xea,0xfe,0x78,xxxx,xxxx, /* F0 */ -}; -// 0xd5 (0x18) opcode is right but arguments could be swapped -// 0x4e (0x2b) not sure, could be 0x1b - - -const UINT8 majtitl2_decryption_table[256] = { - 0x87,xxxx,0x78,0xaa,xxxx,xxxx,xxxx,0x2c, 0x32,0x0a,0x0f,xxxx,0x5e,xxxx,0xc6,0x8a, /* 00 */ - 0x33,xxxx,xxxx,xxxx,xxxx,0xea,xxxx,0x72, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x24,0x55, /* 10 */ - xxxx,xxxx,xxxx,0x89,0xfb,xxxx,0x59,0x02, xxxx,xxxx,0x5d,xxxx,xxxx,xxxx,0x36,xxxx, /* 20 */ - xxxx,0x06,0x79,xxxx,xxxx,0x1e,0x07,xxxx, xxxx,xxxx,0x83,xxxx,xxxx,xxxx,xxxx,xxxx, /* 30 */ - 0x9d,xxxx,xxxx,0x74,xxxx,xxxx,xxxx,0x0c, 0x58,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 40 */ - 0x3c,xxxx,0x03,xxxx,xxxx,0xfa,0x43,xxxx, 0xbf,xxxx,xxxx,0x75,xxxx,0x88,xxxx,0x80, /* 50 */ - xxxx,0xa3,xxxx,0xfe,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0x3a,xxxx,xxxx,xxxx, /* 60 */ - 0x2b,xxxx,xxxx,xxxx,xxxx,0xe9,0x5f,xxxx, 0x46,xxxx,0x41,xxxx,0x18,0xb8,xxxx,xxxx, /* 70 */ - 0xb4,0x5a,0xb1,xxxx,xxxx,0x50,0xe8,0x20, xxxx,0xb2,xxxx,xxxx,xxxx,xxxx,xxxx,0x51, /* 80 */ - xxxx,xxxx,xxxx,0x56,xxxx,xxxx,xxxx,xxxx, xxxx,0xcf,xxxx,xxxx,xxxx,0xc3,xxxx,xxxx, /* 90 */ - xxxx,xxxx,xxxx,xxxx,0x0b,xxxx,xxxx,0xb5, 0x57,xxxx,xxxx,0xc7,0x3b,xxxx,xxxx,xxxx, /* A0 */ - xxxx,xxxx,xxxx,xxxx,0xb6,xxxx,0xeb,xxxx, 0x38,xxxx,0xa0,0x08,xxxx,0x86,0xb0,xxxx, /* B0 */ - 0x42,0x1f,0x73,xxxx,0xf6,xxxx,xxxx,xxxx, 0x53,xxxx,0x52,xxxx,0x04,0xbd,xxxx,xxxx, /* C0 */ - 0x26,0xff,0x2e,xxxx,0x81,xxxx,0x47,xxxx, xxxx,xxxx,xxxx,0xd0,0x22,xxxx,xxxx,0xb9, /* D0 */ - 0x23,xxxx,0xf3,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,0xd2,0x8b,0xba,xxxx,xxxx,xxxx,0x5b, /* E0 */ - xxxx,xxxx,0x9c,xxxx,xxxx,xxxx,xxxx,0xfc, 0xbc,0xa2,0x2a,xxxx,xxxx,0x8e,0xbb,xxxx, /* F0 */ -}; -// 0x7c (0x18) opcode is right but arguments could be swapped -// 0x70 (0x2b) not sure, could be 0x1b - - -const UINT8 hook_decryption_table[256] = { - 0xb6,0x20,0x22,xxxx,0x0f,0x57,0x59,0xc6, 0xeb,xxxx,0xb0,0xbb,0x3b,xxxx,xxxx,xxxx, /* 00 */ - 0x36,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,0xfe,xxxx,xxxx,xxxx,xxxx,xxxx,0xa0, /* 10 */ - 0x2e,xxxx,0x0b,xxxx,xxxx,0x58,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,0x80,xxxx,xxxx, /* 20 */ - 0x33,xxxx,xxxx,0xbf,0x55,xxxx,xxxx,xxxx, 0x53,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 30 */ - 0x47,0x74,xxxx,0xb1,0xb4,xxxx,xxxx,0x88, xxxx,xxxx,0x38,0xcf,xxxx,0x8e,xxxx,xxxx, /* 40 */ - xxxx,0xc7,xxxx,0x32,xxxx,0x52,0x3c,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x83,0x72, /* 50 */ - xxxx,0x73,xxxx,0x5a,xxxx,0x43,xxxx,xxxx, xxxx,xxxx,0x41,0xe9,0xbd,xxxx,0xb2,0xd2, /* 60 */ - xxxx,0xaa,0xa2,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,0x26,xxxx,xxxx,0x8a,xxxx, /* 70 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x18, xxxx,0x9d,xxxx,xxxx,xxxx,0x5d,xxxx,0x46, /* 80 */ - xxxx,xxxx,xxxx,0xf6,0xc3,0xa3,0x1e,0x07, 0x5f,0x81,xxxx,0x0c,xxxx,0xb8,xxxx,0x75, /* 90 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x79, /* A0 */ - xxxx,0x5e,xxxx,xxxx,0x06,xxxx,0xff,xxxx, 0x5b,0x24,xxxx,0x2b,xxxx,xxxx,xxxx,0x02, /* B0 */ - 0x86,xxxx,xxxx,0xfb,xxxx,xxxx,0x50,0xfc, 0x08,xxxx,xxxx,xxxx,0x03,xxxx,0xb9,xxxx, /* C0 */ - xxxx,0xbc,0xe8,0x1f,0xfa,0x42,xxxx,xxxx, 0x89,xxxx,0x23,0x87,xxxx,0x2a,xxxx,xxxx, /* D0 */ - 0x8b,xxxx,0xf3,0xea,0x04,0x2c,0xb5,xxxx, 0x0a,xxxx,0x51,xxxx,xxxx,0x3a,xxxx,0x9c, /* E0 */ - xxxx,xxxx,0x78,xxxx,0xba,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0xd0,0x56,xxxx,xxxx, /* F0 */ -}; -// 0x87 (0x18) opcode is right but arguments could be swapped -// 0xbb (0x2b) not sure, could be 0x1b - - -const UINT8 rtypeleo_decryption_table[256] = { - 0x5d,xxxx,0xc6,xxxx,xxxx,xxxx,0x2a,0x3a,xxxx,xxxx,xxxx,0x86,xxxx,0x22,xxxx,0xf3, /* 00 */ - xxxx,xxxx,xxxx,xxxx,xxxx,0x38,0xf7,0x42,0x04,xxxx,xxxx,0x1f,0x4b,xxxx,xxxx,0x58, /* 10 */ - 0x57,0x2e,xxxx,xxxx,0x53,xxxx,0xb9,xxxx,xxxx,xxxx,xxxx,xxxx,0x20,0x55,xxxx,0x3d, /* 20 */ - 0xa0,xxxx,xxxx,0x0c,0x03,xxxx,0x83,xxxx,xxxx,xxxx,0x8a,0x00,xxxx,0xaa,xxxx,xxxx, /* 30 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x41,0x0a,0x26,0x8b,0x56,0x5e,xxxx, /* 40 */ - xxxx,0x74,xxxx,xxxx,xxxx,xxxx,0x06,xxxx,xxxx,0x89,0x5b,0xc7,0x43,xxxx,xxxx,xxxx, /* 50 */ - xxxx,0xb6,xxxx,0x3b,xxxx,xxxx,xxxx,xxxx,xxxx,0x36,0xea,0x80,xxxx,xxxx,xxxx,0x5f, /* 60 */ - xxxx,0x0f,xxxx,xxxx,xxxx,0x46,xxxx,xxxx,0x3c,0x8e,xxxx,0xa3,0x87,xxxx,xxxx,xxxx, /* 70 */ - 0x2b,0xfb,0x47,0x0b,xxxx,0xfc,0x02,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x72,0x2c, /* 80 */ - 0x33,xxxx,xxxx,xxxx,xxxx,xxxx,0x9d,0xbd,xxxx,0xb2,xxxx,0x78,0x75,0xb8,xxxx,xxxx, /* 90 */ - xxxx,xxxx,xxxx,xxxx,0xcf,0x5a,0x88,xxxx,xxxx,xxxx,0xc3,xxxx,0xeb,0xfa,xxxx,0x32, /* A0 */ - xxxx,xxxx,xxxx,0x52,0xb4,xxxx,xxxx,xxxx,xxxx,0xbc,xxxx,xxxx,xxxx,0xb1,0x59,0x50, /* B0 */ - xxxx,xxxx,0xb5,xxxx,0x08,0xa2,0xbf,0xbb,0x1e,0x9c,xxxx,0x73,xxxx,0xd0,xxxx,xxxx, /* C0 */ - xxxx,xxxx,xxxx,xxxx,0x81,xxxx,0x79,xxxx,xxxx,0x24,0x23,xxxx,xxxx,0xb0,0x07,0xff, /* D0 */ - xxxx,0xba,0xf6,0x51,xxxx,xxxx,xxxx,0xfe,xxxx,0x92,xxxx,xxxx,xxxx,xxxx,0xe9,xxxx, /* E0 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xe8,0xd2,xxxx,0x18,xxxx,xxxx,xxxx,0xd1,xxxx,xxxx, /* F0 */ -// ^^^^ -}; -// 0xf9 (0x18) opcode is right but arguments could be swapped -// 0x80 (0x2b) not sure, could be 0x1b -// 0x16 (0x01) guess (wrong?) -// fixed 0x16 = 0xf7 mapping -// 3d = correct - -const UINT8 inthunt_decryption_table[256] = { - 0x1f,xxxx,0xbb,0x50,xxxx,0x58,0x42,0x57, xxxx,xxxx,0xe9,xxxx,xxxx,xxxx,xxxx,0x0b, /* 00 */ - xxxx,xxxx,0x9d,0x9c,xxxx,xxxx,0x1e,xxxx, xxxx,0xb4,0x5b,xxxx,xxxx,xxxx,xxxx,xxxx, /* 10 */ - xxxx,xxxx,0x78,0xc7,xxxx,xxxx,0x83,xxxx, xxxx,0x0c,0xb0,0x04,xxxx,xxxx,xxxx,xxxx, /* 20 */ - xxxx,xxxx,xxxx,xxxx,0x3b,0xc3,0xb5,0x47, xxxx,xxxx,xxxx,xxxx,0x59,xxxx,xxxx,xxxx, /* 30 */ - xxxx,xxxx,xxxx,0x38,xxxx,xxxx,xxxx,xxxx, 0x5f,0xa3,0xfa,xxxx,0xe8,0x36,0x75,xxxx, /* 40 */ - 0x88,0x33,xxxx,xxxx,xxxx,xxxx,0x43,xxxx, xxxx,0x87,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 50 */ - xxxx,xxxx,xxxx,xxxx,0x8e,0xf3,0x56,xxxx, xxxx,xxxx,xxxx,0x26,0xff,xxxx,xxxx,xxxx, /* 60 */ - xxxx,xxxx,xxxx,0x2a,xxxx,0x8a,xxxx,0x18, xxxx,xxxx,0x03,0x89,0x24,xxxx,xxxx,xxxx, /* 70 */ - 0x0a,xxxx,0xeb,xxxx,0x86,xxxx,xxxx,xxxx, 0x79,0x3a,xxxx,xxxx,xxxx,xxxx,0xa0,xxxx, /* 80 */ - 0xea,xxxx,xxxx,xxxx,xxxx,xxxx,0x2c,xxxx, 0xc6,xxxx,xxxx,0x46,xxxx,0xaa,0xb6,0x5e, /* 90 */ - xxxx,xxxx,xxxx,xxxx,0x8b,xxxx,xxxx,xxxx, xxxx,xxxx,0xba,xxxx,0xb9,0x53,0xa2,xxxx, /* A0 */ - xxxx,0x07,xxxx,xxxx,xxxx,0x3c,0x32,xxxx, 0x2b,xxxx,0xb8,xxxx,xxxx,xxxx,xxxx,xxxx, /* B0 */ - 0xbd,xxxx,xxxx,xxxx,xxxx,0x81,xxxx,0xd0, 0x08,xxxx,0x55,0x06,0xcf,xxxx,xxxx,0xfc, /* C0 */ - xxxx,xxxx,xxxx,0xb1,0xbf,xxxx,xxxx,0x51, 0x52,xxxx,0x5d,xxxx,0x5a,xxxx,0xb2,xxxx, /* D0 */ - 0xfe,xxxx,xxxx,0x22,0x20,0x72,0xf6,0x80, 0x02,0x2e,xxxx,0x74,0x0f,xxxx,xxxx,xxxx, /* E0 */ - xxxx,xxxx,xxxx,xxxx,0xbc,0x41,xxxx,0xfb, 0x73,xxxx,xxxx,xxxx,0x23,0xd2,xxxx,xxxx, /* F0 */ -}; -// 0x77 (0x18) opcode is right but arguments could be swapped -// 0xb8 (0x2b) not sure, could be 0x1b - -const UINT8 gussun_decryption_table[256] = { - 0x63,xxxx,xxxx,0x36,xxxx,0x52,0xb1,0x5b, 0x68,0xcd,xxxx,xxxx,xxxx,0xa8,xxxx,xxxx, /* 00 */ -// gggg gggg gggg gggg - xxxx,xxxx,0x75,0x24,0x08,0x83,0x32,0xe9, xxxx,0x79,xxxx,0x8f,0x22,xxxx,0xac,xxxx, /* 10 */ -// pppp pppp gggg - 0x5d,0xa5,0x11,0x51,0x0a,0x29,xxxx,xxxx ,0xf8,0x98,0x91,0x40,0x28,0x00,0x03,0x5f, /* 20 */ -// gggg gggg gggg gggg gggg gggg pppp - 0x26,xxxx,xxxx,0x8b,0x2f,0x02,xxxx,xxxx, 0x8e,0xab,xxxx,xxxx,0xbc,0x90,0xb3,xxxx, /* 30 */ -// gggg - 0x09,xxxx,0xc6,xxxx,xxxx,0x3a,xxxx,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,xxxx,xxxx, /* 40 */ -// gggg - xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x2c,0x7c,0x2b,xxxx,0x4f,0xba,0x2a, /* 50 */ -// gggg gggg gggg pppp gggg gggg - 0xb0,xxxx,0x21,0x7d,xxxx,xxxx,0xb5,0x07, 0xb9,xxxx,0x27,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */ -// pppp pppp gggg gggg - xxxx,0xea,0x72,0x73,0xad,0xd1,0x3b,0x5e, 0xe5,0x57,xxxx,0x0d,0xfd,xxxx,0x92,0x3c, /* 70 */ -// gggg pppp gggg gggg - xxxx,0x86,0x78,0x7f,0x30,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */ -// pppp gggg gggg pppp gggg - xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,xxxx, /* 90 */ -// gggg gggg - xxxx,0xa3,xxxx,xxxx,0x12,xxxx,0xfa,0xb4, xxxx,0x81,0xe6,0x48,0x80,0x8c,0xd4,xxxx, /* a0 */ -// gggg gggg pppp gggg gggg - 0x42,xxxx,0x84,0xb6,0x77,0x3d,0x3e,xxxx, xxxx,0x0c,0x4b,xxxx,0xa4,xxxx,xxxx,xxxx, /* b0 */ -// gggg gggg pppp gggg gggg pppp pppp gggg - xxxx,0xff,0x47,xxxx,0x55,0x1e,xxxx,0x59, 0x93,xxxx,xxxx,xxxx,0x88,0xc1,0x01,0xb2, /* c0 */ -// gggg - 0x85,0x2e,0x06,0xc7,0x05,xxxx,0x8a,0x5a, 0x58,0xbe,xxxx,0x4e,xxxx,0x1f,0x23,xxxx, /* d0 */ -// gggg gggg - 0xe8,xxxx,0x89,0xa1,0xd0,xxxx,xxxx,0xe2, 0x38,0xfe,0x50,0x9c,xxxx,xxxx,xxxx,0x49, /* e0 */ -// gggg gggg - 0xfb,0x20,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,0x76,0xf7,0xbd,0x39,0x7e,0xbf,xxxx, /* f0 */ -// pppp gggg gggg gggg -}; - - -/* -missing opcode: - -" " -> checked against hasamu (i.e. you can compare gussun from 2002a and hasamu from 54a0) -"gggg" -> very probably -"pppp" -> probably -"????" -> missing - -rz probably: -14 -> 08 (2097b 20980 - routine from 2097a) (08 30) to handle the player number -> 08 -19 -> 79 (1df45 routine from 1df27 / 2282f - routine from 2281f to 22871) no 70,78,7a,7b,7c,7e,7f(ok) ok 79,7d -5a -> 7c (195eb - (222fc - routine from 222ed to ) (7x j...) no 70,71,79,7a,7b ok (78,7c) -> 7c -63 -> 7d (1df7f, 1df8c, 1df95, 21f08 - routine from 1df27 to ) no 70,78,7a,7b,7c,7e,7f(ok) ok 79,7d -7b -> 0d -82 -> 78 (78,7c) -> 78 -86 -> 2d -ab -> 48 (1956f - routine from 194e1 to 19619 - bp 19567) (when the water go up) -> 48 -b3 -> b6 (216b6 - 216cf - 16663 (when you rotate a piece) - 175f1 - 17d2a - 17d36) -> b6 -b9 -> 0c (21210 - routine from 2117e to ) 2 bytes -> to handle messages in level 0 (learning level) -ba -> 4b (1094d, 10b28 - routine from 10948 to 10b73) one byte -> probably 4b -f1 -> 20 to handle the player number - -rz guess: -06 -> b1 (22872 - routine from 22872 to 2289d) -09 -> cd (22a17 - routine from 229ed to 22a1a) -0d -> a8 ( -1b -> 8f (1d8f9 - routine from 1d8c7 to 1d8fc) - three bytes (pop instruction for the push in 1d8e6) -22 -> 11 (1deff - routine from 1dee8 to 1df26) -> 11 - to handle sprite animation -25 -> 29 (195a0 - routine from 194e1 to ) (19,29) -28 -> f8 ( -29 -> 98 (1df22 - routine from 1dee8 to 1df26) -> 98 - to handle sprite animation -2b -> 40 (1d4d2 1db81 1dba9 - routine from 1d4b2 to 1d4de) -> 40 -2c -> 28 (20333 - routine from 2032a to 20366) (18,28) -2d -> 00 (1df1d - routine from 1dee8 to 1df26) -> 00 - to handle sprite animation -34 -> 2f (20381 - routine from 2037b to 20391) - used to handle number of lives and game over -40 -> 09 -52 -> a0 -55 -> 41 -59 -> 2c (220cf - 2037f - routine from 2202f to ) 2bytes (2c, -5b -> 2b (used in "Service Mode" / "CHARACTER menu") -5d -> 4f -62 -> 21 (1cf86 1cfa3 - routine from 1cf61 to 1cff4) (water in level 1) (01 11 19 29) -66 -> b5 (1daaf - routine from 1da61 to 1daca) - two bytes (colors effect) -6a -> 27 (20368 - routine from 20368 to 2037a) - used to limit the max lives number -73 -> 73 (1d4f7 - routine from 1d4df to 1d539) -> (no 70,71,72,74,75,76,77,78,79,7a,7b,7c,7d,7e,7f) - ok 73 -7c -> fd -7e -> 92 (1e095 - routine from 1e073 to 1e0cf) -83 -> 7f (194cd - routine from) no 70,78,79,7a,7b,7c,7d,7e ok 77(no) ok 7f -84 -> 08 (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (ok 30) (sprite animation) -> 30 -88 -> 9a -92 -> 9d -97 -> cb -a4 -> 12 (02,12) - routine from 1d392 -> 12 -a7 -> b4 (2029a - routine from 20290 to -ad -> 8c (1d559, 1d8d4 - routine from 1d547 - ; routine from 1d8b8 to 1d8fc) .............................. -ae -> d4 (20215 - ) used when you insert a coin to handle the "coin number" in decimal -b0 -> 42 (routine from 128db) -b2 -> 84 (20a8b - 20acc) 20,21,84,85 (scroll down the object) - to handle the player number -b4 -> 77 (1d03a, 1d57a - routine from 1d4df ) no 70,71,76,78,79,7a,7b,7c,7d,7e,7f ok 77 -b6 -> 3e -bc -> a4 -c2 -> 47 (22881, 220ff - routine from 22872 to 22885) -d0 -> 85 (routine from 16a3e) (when you rotate a piece) -db -> 4e (18b1a) -eb -> 9c -ef -> 49 (dec CW) (used in "Service Mode" / "CHARACTER menu") -f9 -> 76 (16d02(f 16cfa)-16598-165a1-18de7(f 18dc4) no 71(no),77(no),(icons? 70,76,78,7a,7c,7e),79,7d,7f(no) maybe 76 -fb -> bd -fd -> 7e (1d659 - routine from 1d63c to 1d65e) no 70,76,77,78,79,7a,7b, 7c,7d,7e,7f ok 7e - -missing V35+ core: -0f 92 -> of 92 not supported (1011d before STI instruction) (for now no effects) - -------------------------------------------------------------------------------------------------------------- - -AS notes: -0x1e is lodsb not lds,noted from 2344f -0x16 is xor r8,r8 not xor r16,r16 -0xc8 not inc aw but xch bw,aw -0xcd is 0xc1 not 0xbd(palette at startup) -0x97 guess,but seems right(228c1),known to *not* be ret %Iw. -0x00 wrong(for sure it needs a one byte operand due to push es called at one point...) -0x19 guess (0x82 PRE) -0xc2 guess,it could be dec iy... - -above - c8 (inc aw) guess from stos code -0xc5 -> 1e (push ds) guess (pop ds soon after) right? -0xa9 -> 81 (not 0x82 PRE) guess from 237df -0xcd -> c1 total guess (wrong but 3 bytes) -*/ - -/* -e0100 palette sub-routine: -12485: 23 push es -12486: 27 C2 mov es,dw -12488: D7 C0 xor aw,aw -1248A: D7 FF xor iy,iy -1248C: 44 00 01 mov cw,$0100 -1248F: 81 5D repe stosw -12491: 95 22 06 97 39 mov byte ss:[$3997],$FF -12497: 3A pop es -12498: 60 ret - -d1a86 - -unk -add bw,bw [d8] -add ix,sp [e6] -add iy,sp [e7] -clc -ret -*/ - -const UINT8 leagueman_decryption_table[256] = { - xxxx,xxxx,xxxx,0x55,0xbb,xxxx,0x23,0x79, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x38,xxxx, /* 00 */ - 0xf7,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0x3d,xxxx,xxxx,xxxx,0xba,xxxx,0x1e,xxxx, /* 10 */ - 0x2c,0x46,xxxx,0xb5,xxxx,0x4b,xxxx,0xfe, xxxx,xxxx,0xfb,0x2e,xxxx,xxxx,0x36,0x04, /* 20 */ - 0xcf,xxxx,0xf3,0x5a,0x8a,0x0c,0x9c,xxxx, xxxx,xxxx,0xb2,0x50,xxxx,xxxx,xxxx,0x5f, /* 30 */ - xxxx,xxxx,0x24,xxxx,xxxx,0x41,0x2b,xxxx, 0xe9,xxxx,0x08,0x3b,xxxx,xxxx,xxxx,xxxx, /* 40 */ - xxxx,0xd2,0x51,xxxx,xxxx,xxxx,0x22,xxxx, 0xeb,0x3a,0x5b,0xa2,0xb1,0x80,xxxx,xxxx, /* 50 */ - xxxx,xxxx,xxxx,xxxx,0x59,0xb4,0x88,xxxx, xxxx,0xbf,0xd1,xxxx,0xb9,0x57,xxxx,xxxx, /* 60 */ - 0x72,xxxx,0x73,xxxx,xxxx,xxxx,xxxx,0x0f, xxxx,xxxx,xxxx,xxxx,0x56,xxxx,xxxx,0xc6, /* 70 */ - xxxx,xxxx,xxxx,xxxx,xxxx,0x2a,0x8e,xxxx, 0x81,0xa3,0x58,xxxx,0xaa,0x78,0x89,xxxx, /* 80 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xbd,xxxx, xxxx,xxxx,0xff,xxxx,xxxx,xxxx,0x07,0x53, /* 90 */ - 0xa0,xxxx,xxxx,0x5e,0xb0,xxxx,0x83,0xf6, xxxx,0x26,0x32,xxxx,xxxx,xxxx,0x74,0x0a, /* A0 */ - 0x18,xxxx,xxxx,xxxx,0x75,0x03,xxxx,xxxx, 0xb6,0x02,xxxx,xxxx,0x43,xxxx,0xb8,xxxx, /* B0 */ - 0xe8,xxxx,0xfc,xxxx,0x20,0xc3,xxxx,0x06, xxxx,0x1f,0x86,0x00,xxxx,xxxx,xxxx,0xd0, /* C0 */ - 0x47,xxxx,0x87,xxxx,xxxx,0x9d,0x3c,0xc7, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* D0 */ - xxxx,xxxx,xxxx,0x8b,xxxx,xxxx,0x33,xxxx, xxxx,xxxx,xxxx,xxxx,0xfa,0x42,xxxx,xxxx, /* E0 */ - xxxx,xxxx,xxxx,0xea,xxxx,0x52,xxxx,0x5d, xxxx,xxxx,xxxx,xxxx,0xbc,xxxx,xxxx,xxxx, /* F0 */ -}; -// 0x25 (0x4b) guess -// fixed 0x10 = 0xf7 mapping - -const UINT8 leagueman_OLD_decryption_table[256] = { - xxxx,xxxx,xxxx,0x55,0xbb,xxxx,0x23,0x79, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x38,xxxx, /* 00 */ - 0x01,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0x3d,xxxx,xxxx,xxxx,0xba,xxxx,0x1e,xxxx, /* 10 */ - 0x2c,0x46,xxxx,0xb5,xxxx,0x4b,xxxx,0xfe, xxxx,xxxx,0xfb,0x2e,xxxx,xxxx,0x36,0x04, /* 20 */ - 0xcf,xxxx,0xf3,0x5a,0x8a,0x0c,0x9c,xxxx, xxxx,xxxx,0xb2,0x50,xxxx,xxxx,xxxx,0x5f, /* 30 */ - xxxx,xxxx,0x24,xxxx,xxxx,0x41,0x2b,xxxx, 0xe9,xxxx,0x08,0x3b,xxxx,xxxx,xxxx,xxxx, /* 40 */ - xxxx,0xd2,0x51,xxxx,xxxx,xxxx,0x22,xxxx, 0xeb,0x3a,0x5b,0xa2,0xb1,0x80,xxxx,xxxx, /* 50 */ - xxxx,xxxx,xxxx,xxxx,0x59,0xb4,0x88,xxxx, xxxx,0xbf,0xd1,xxxx,0xb9,0x57,xxxx,xxxx, /* 60 */ - 0x72,xxxx,0x73,xxxx,xxxx,xxxx,xxxx,0x0f, xxxx,xxxx,xxxx,xxxx,0x56,xxxx,xxxx,0xc6, /* 70 */ - xxxx,xxxx,xxxx,xxxx,xxxx,0x2a,0x8e,xxxx, 0x81,0xa3,0x58,xxxx,0xaa,0x78,0x89,xxxx, /* 80 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xbd,xxxx, xxxx,xxxx,0xff,xxxx,xxxx,xxxx,0x07,0x53, /* 90 */ - 0xa0,xxxx,xxxx,0x5e,0xb0,xxxx,0x83,0xf6, xxxx,0x26,0x32,xxxx,xxxx,xxxx,0x74,0x0a, /* A0 */ - 0x18,xxxx,xxxx,xxxx,0x75,0x03,xxxx,xxxx, 0xb6,0x02,xxxx,xxxx,0x43,xxxx,0xb8,xxxx, /* B0 */ - 0xe8,xxxx,0xfc,xxxx,0x20,0xc3,xxxx,0x06, xxxx,0x1f,0x86,0x00,xxxx,xxxx,xxxx,0xd0, /* C0 */ - 0x47,xxxx,0x87,xxxx,xxxx,0x9d,0x3c,0xc7, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* D0 */ - xxxx,xxxx,xxxx,0x8b,xxxx,xxxx,0x33,xxxx, xxxx,xxxx,xxxx,xxxx,0xfa,0x42,xxxx,xxxx, /* E0 */ - xxxx,xxxx,xxxx,0xea,xxxx,0x52,xxxx,0x5d, xxxx,xxxx,xxxx,xxxx,0xbc,xxxx,xxxx,xxxx, /* F0 */ -}; - - -const UINT8 psoldier_decryption_table[256] = { - xxxx,xxxx,xxxx,0x8a,xxxx,0xaa,xxxx,xxxx, xxxx,0x20,0x23,0x55,xxxx,0xb5,0x0a,xxxx, /* 00 */ - xxxx,0x46,xxxx,0xb6,xxxx,0x74,0x8b,xxxx, xxxx,0xba,0x01,xxxx,xxxx,0x5a,0x86,0xfb, /* 10 */ - 0xb2,xxxx,0xb0,xxxx,0x42,0x06,0x1e,0x08, 0x22,0x9d,xxxx,xxxx,xxxx,xxxx,xxxx,0x73, /* 20 */ - xxxx,xxxx,0x5f,xxxx,xxxx,0xd0,xxxx,0xff, xxxx,xxxx,0xbd,xxxx,0x03,xxxx,0xb9,xxxx, /* 30 */ - xxxx,xxxx,xxxx,0x51,0x5e,0x24,xxxx,xxxx, xxxx,xxxx,xxxx,0x58,0x59,xxxx,xxxx,xxxx, /* 40 */ - 0x52,xxxx,xxxx,xxxx,0xa0,xxxx,xxxx,0x02, 0xd2,xxxx,0x79,0x26,0x3a,0x0f,0xcf,0xb4, /* 50 */ - 0xf3,xxxx,xxxx,0x50,xxxx,0x75,0xb1,xxxx, 0xd1,0x47,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 60 */ - 0xc6,xxxx,xxxx,xxxx,xxxx,xxxx,0xbc,xxxx, xxxx,xxxx,xxxx,xxxx,0x53,0x41,xxxx,xxxx, /* 70 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x04,xxxx, xxxx,xxxx,xxxx,0x2c,xxxx,0xbf,xxxx,xxxx, /* 80 */ - xxxx,xxxx,0xe8,xxxx,xxxx,0x78,xxxx,0xbb, xxxx,xxxx,0x1f,0x2b,0x87,xxxx,0x4b,0x56, /* 90 */ - 0x36,0x33,xxxx,xxxx,xxxx,0x9c,0xc3,xxxx, xxxx,0x81,xxxx,0xe9,xxxx,0xfa,xxxx,xxxx, /* A0 */ - xxxx,0x72,xxxx,0xa2,xxxx,xxxx,0xc7,xxxx, xxxx,0x92,xxxx,xxxx,0x88,xxxx,xxxx,xxxx, /* B0 */ - 0x3b,xxxx,0x0c,xxxx,0x80,xxxx,xxxx,xxxx, xxxx,0x2e,xxxx,xxxx,xxxx,0x57,xxxx,0x8e, /* C0 */ - 0x07,xxxx,0xa3,xxxx,xxxx,xxxx,0x3d,xxxx, 0xfe,xxxx,xxxx,0xfc,0xea,xxxx,0x38,xxxx, /* D0 */ - 0x3c,0xf6,xxxx,xxxx,xxxx,0x18,xxxx,xxxx, 0xb8,xxxx,xxxx,xxxx,0x2a,0x5d,0x5b,xxxx, /* E0 */ - xxxx,0x43,0x32,xxxx,xxxx,xxxx,0xeb,xxxx, xxxx,xxxx,xxxx,xxxx,0x83,0x89,xxxx,xxxx, /* F0 */ -}; -// 0x9e (0x4b) guess -// 0x1a (0x01) guess (wrong?) - - -const UINT8 dsoccr94_decryption_table[256] = { - xxxx,0xd1,xxxx,xxxx,xxxx,0x79,0x2e,xxxx, xxxx,xxxx,0x5a,0x0f,xxxx,xxxx,0x43,xxxx, /* 00 */ - xxxx,xxxx,0xe8,0x50,xxxx,xxxx,xxxx,0xa0, 0x5d,0x22,xxxx,xxxx,0xb2,0x3a,xxxx,xxxx, /* 10 */ - 0xf6,0x8a,0x41,xxxx,xxxx,0x81,xxxx,xxxx, xxxx,xxxx,0x2b,0x58,xxxx,xxxx,xxxx,0xc6, /* 20 */ - xxxx,xxxx,0xb9,xxxx,xxxx,0x2a,xxxx,0x3c, xxxx,0x80,0x26,xxxx,0xb0,xxxx,0x47,xxxx, /* 30 */ - xxxx,xxxx,0x0a,0x55,xxxx,xxxx,xxxx,0x88, xxxx,xxxx,0x87,xxxx,xxxx,0xb4,0x0c,xxxx, /* 40 */ - 0x73,0x53,xxxx,xxxx,0x3b,0x1f,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 50 */ - 0x01,xxxx,xxxx,xxxx,xxxx,0x1e,xxxx,xxxx, 0xc3,xxxx,0xa3,0x74,xxxx,0x32,0x42,0x75, /* 60 */ - 0xfc,xxxx,0xb8,xxxx,0x33,xxxx,0x5e,xxxx, xxxx,0xaa,xxxx,xxxx,0x04,xxxx,0x9c,0xba, /* 70 */ - xxxx,xxxx,0x24,0x89,xxxx,xxxx,0xea,xxxx, 0x23,xxxx,xxxx,xxxx,0xbb,xxxx,xxxx,0xc7, /* 80 */ - xxxx,0x8e,xxxx,0x52,xxxx,0x18,xxxx,0x72, xxxx,xxxx,xxxx,xxxx,0xb6,xxxx,xxxx,xxxx, /* 90 */ - 0xfa,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0xb1,xxxx,xxxx,xxxx,xxxx,0x57,0x78,0xa2, /* A0 */ - xxxx,0x3d,0x51,xxxx,xxxx,0xbf,0x46,0x2c, xxxx,xxxx,0xfb,xxxx,xxxx,xxxx,xxxx,0x38, /* B0 */ - 0x56,xxxx,0xcf,xxxx,0x08,xxxx,xxxx,xxxx, 0x5b,0x07,xxxx,xxxx,xxxx,0x20,0x9d,xxxx, /* C0 */ - 0x03,xxxx,xxxx,xxxx,xxxx,xxxx,0xbc,0x86, 0x59,xxxx,0x02,xxxx,0xff,0xd2,0x8b,xxxx, /* D0 */ - xxxx,0xd0,xxxx,xxxx,xxxx,xxxx,xxxx,0xe9, 0x06,xxxx,0x5f,0xf3,xxxx,0xb5,xxxx,xxxx, /* E0 */ - 0xeb,xxxx,xxxx,xxxx,xxxx,xxxx,0x83,xxxx, 0x36,xxxx,xxxx,xxxx,xxxx,0xbd,0xfe,xxxx, /* F0 */ -}; - -// 0x95 (0x18) opcode is right but arguments could be swapped -// 0x2a (0x2b) not sure, could be 0x1b -// 0x60 (0x01) guess (wrong?) - - -/* preliminary table by Pierpaolo Prazzoli */ -const UINT8 matchit2_decryption_table[256] = { - xxxx,0x86,0x0a,xxxx,0x32,0x01,0x81,0xbe, 0xea,xxxx,0xbb,xxxx,xxxx,xxxx,0xa5,0xf6, /* 00 */ -// new new new new new new new new new - 0x5d,0x8c,0xf3,0xc4,0x42,0x5a,0x22,0x26, xxxx,0x58,xxxx,0xfd,0x59,0x53,0x80,0x09, /* 10 */ -// new new new new !!!! new !!!! new !!!! new new new !!!! - xxxx,0x1e,0x48,0xe2,0x50,xxxx,0xc3,0x23, xxxx,xxxx,0xe9,xxxx,0x40,0x83,0xa3,0x46, /* 20 */ -// new new new new new new new new new new - 0x49,0xb4,0xa9,xxxx,0xd3,0x8b,0xe8,0xb8, 0xa0,xxxx,xxxx,xxxx,0x84,xxxx,xxxx,xxxx, /* 30 */ -// !!!! ???? new !!!! new new new new - xxxx,xxxx,xxxx,xxxx,0x14,xxxx,0x25,xxxx, xxxx,0x5e,xxxx,0x87,0x56,0xb9,0x4a,0x39, /* 40 */ -// new new new new new new new new - 0x89,xxxx,xxxx,xxxx,xxxx,0x1f,0xa4,xxxx, 0xf8,0x5f,0x21,0xb3,0x5b,xxxx,0x8d,xxxx, /* 50 */ -// new new !!!! new new !!!! new new - xxxx,0xc5,0x7c,0x07,xxxx,0x88,0xba,0x47, 0x35,0xfb,xxxx,0x7f,xxxx,xxxx,0xc6,0xeb, /* 60 */ -// new !!!! new new new new new new !!!! new - xxxx,0xc7,xxxx,xxxx,0xd2,0xa1,0x72,0x79, 0xfe,0x24,0xab,0x2a,0xbc,0x0d,0x8f,0x7e, /* 70 */ -// !!!! new new new new new new new new new !!!! - xxxx,0x7d,xxxx,0xe7,0x2d,xxxx,xxxx,0x57, 0x0b,0xa2,xxxx,0x9d,xxxx,xxxx,0x74,0x85, /* 80 */ -// !!!! new new new new new new new new - 0xaf,0x2f,0x8a,0xe6,0x08,xxxx,0xff,xxxx, xxxx,0x1c,xxxx,xxxx,0x02,xxxx,xxxx,xxxx, /* 90 */ -// new !!!! new new new new !!!! new - 0x43,0x04,xxxx,xxxx,0xbf,0x3b,0x93,0x38, xxxx,xxxx,xxxx,0x77,xxxx,0xb0,xxxx,0x3a, /* A0 */ -// new new new new new new new new new - 0xfc,xxxx,0xb5,xxxx,xxxx,xxxx,xxxx,0x05, 0x52,0x76,0x2b,0xe5,0xbd,xxxx,0x0e,0xb1, /* B0 */ -// new new new new new new new new new !!!! - 0x73,xxxx,xxxx,0x45,0x92,0x99,xxxx,0xf7, 0x3d,0xd0,0xb6,0x36,0xf9,0xfa,0x0f,xxxx, /* C0 */ -// new new new new new new new !!!! new new - 0x75,xxxx,0xaa,0x9c,xxxx,0x11,xxxx,xxxx, 0x27,0x4b,xxxx,0x2c,0x51,0x2e,0x4d,xxxx, /* D0 */ -// new !!!! new new new new new new new !!!! - 0x55,0x3c,xxxx,0xb7,xxxx,0xd1,0x8e,xxxx, 0xb2,xxxx,0x78,xxxx,0x12,xxxx,0x29,0x0c, /* E0 */ -// new new new ???? new new new new new new new - 0x33,xxxx,0xf2,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,0x03,0x06,0xa8,xxxx,xxxx,0xcf,xxxx, /* F0 */ -// new new new new new new -}; -/* -Unknown (marked "????") - -from shisen 2: -E4 -> pc: b08; f458, 1920 (99% 1 byte at boot and sometimes when a piece is selected) - b65c (after one match is finished with the girl on the background or when you finish some levels in the other modes) - -Found (marked "!!!!") -14 -> pc: 8b2a -> 42 -16 -> pc: 1714, 1804, 1a70, 1cc3 (00 10 13 1C 20 21 22 34 D4 D5 after a match) -> 22 -1B -> pc: 630e (it's used to update the high score) -> FD -1F -> pc: f30, f35, af74, 153a, 6dd8, 674f -> 09 -30 -> pc: 19af, 1986 -> 49 -31 -> pc: c804, c813, c822, 1358, c303, c312, c321, 1315, 1338 (2 bytes opcode) -> B4 -34 -> pc: 42cd -> D3 -4E -> pc: 7ac3, 7ae8 (after a 2 players match and in a 2 players match in "stalemate") -> 4a -56 -> pc: 6587 (can be 6C, 6D, 6E, 6F, A4, A6, A7, AA, AC, AD, AE at boot) -> A4 -5A -> pc: ae83 (after an item is selected) (00 10 13 15 1B -1C already used- 1D 21 28) -> 21 (it's used to evidence tiles similar to the one selected) -62 -> pc: 5b3f (jump 71, 7C) -> 7C -6B -> pc: 1810, 1936 (jump) -> 7F -74 -> pc: ca75 -> D2 -7F -> pc: 6b7e, 51d7, 5a8c, 5a9a, 5996 (jump: 7C, 7E) -> 7E -81 -> pc: 599d (jump: 7D, 7F) -> 7D -91 -> pc: 6e0c, 96ef, 96d0 (1 byte opcode) -> 2F -99 -> pc: 96f7, 9702 (after undo button is pressed) -> 1C (it's used to update the score when the you undo the moves) -BF -> pc: 6af3, 6b01, ca73, ab39 (2 bytes opcode) -> B1 -C4 -> pc: deb4 -> 92 from bbmanw -EC -> pc: 966e, 9679 -> 12 from bbmanw -D2 -> pc: 631c (it's used to update the high score) (6C, 6E, A6, AA, AE) -> AA - -the ones marked with "new" are checked against dynablst and bomberman tables -*/ - - -const UINT8 test_decryption_table[256] = { - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 00 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 10 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 20 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 30 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 40 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 50 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 60 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 70 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 80 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 90 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* A0 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* B0 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* C0 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* D0 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* E0 */ - xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* F0 */ -}; - - -void irem_cpu_decrypt(INT32 /*cpu*/,const UINT8 *decryption_table, UINT8 *src, UINT8 *dest, INT32 size) -{ - for (INT32 A = 0;A < size;A++) - { - dest[A] = decryption_table[src[A]]; - } -} diff --git a/jan/src/burn/drv/irem/irem_cpu.h b/jan/src/burn/drv/irem/irem_cpu.h deleted file mode 100644 index cd080d000..000000000 --- a/jan/src/burn/drv/irem/irem_cpu.h +++ /dev/null @@ -1,19 +0,0 @@ -extern const UINT8 gunforce_decryption_table[]; -extern const UINT8 bomberman_decryption_table[]; -extern const UINT8 lethalth_decryption_table[]; -extern const UINT8 dynablaster_decryption_table[]; -extern const UINT8 mysticri_decryption_table[]; -extern const UINT8 majtitl2_decryption_table[]; -extern const UINT8 hook_decryption_table[]; -extern const UINT8 rtypeleo_decryption_table[]; -extern const UINT8 inthunt_decryption_table[]; -extern const UINT8 gussun_decryption_table[]; -extern const UINT8 leagueman_decryption_table[]; -extern const UINT8 leagueman_OLD_decryption_table[]; -extern const UINT8 psoldier_decryption_table[]; -extern const UINT8 dsoccr94_decryption_table[]; -extern const UINT8 matchit2_decryption_table[]; - -extern const UINT8 test_decryption_table[]; - -extern void irem_cpu_decrypt(INT32 cpu,const UINT8 *decryption_table, UINT8 *src,UINT8 *dest, INT32 size); diff --git a/jan/src/burn/drv/konami/d_88games.cpp b/jan/src/burn/drv/konami/d_88games.cpp deleted file mode 100644 index dccfb47d4..000000000 --- a/jan/src/burn/drv/konami/d_88games.cpp +++ /dev/null @@ -1,826 +0,0 @@ -// FB Alpha '88 Games driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "upd7759.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvGfxROMExp2; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvBankRAM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvNVRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *nDrvBank; - -static INT32 videobank; -static INT32 zoomreadroms; -static INT32 k88games_priority; -static INT32 UPD7759Device; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo games88InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 3, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 3, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 2, "p3 fire 3" }, - - {"P4 Start", BIT_DIGITAL, DrvJoy3 + 7, "p4 start" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(games88) - -static struct BurnDIPInfo games88DIPList[]= -{ - {0x14, 0xff, 0xff, 0xf0, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x7b, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x10, 0x10, "Off" }, -// {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "World Records" }, - {0x14, 0x01, 0x20, 0x20, "Don't Erase" }, - {0x14, 0x01, 0x20, 0x00, "Erase on Reset" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x15, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "No Coin B" }, - -// {0 , 0xfe, 0 , 4, "Cabinet" }, -// {0x16, 0x01, 0x06, 0x06, "Cocktail" }, -// {0x16, 0x01, 0x06, 0x04, "Cocktail (A)" }, -// {0x16, 0x01, 0x06, 0x02, "Upright" }, -// {0x16, 0x01, 0x06, 0x00, "Upright (D)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x60, 0x60, "Easy" }, - {0x16, 0x01, 0x60, 0x40, "Normal" }, - {0x16, 0x01, 0x60, 0x20, "Hard" }, - {0x16, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(games88) - -void games88_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x5f84: - zoomreadroms = data & 0x04; - return; - - case 0x5f88: - // watchdog - return; - - case 0x5f8c: - *soundlatch = data; - return; - - case 0x5f90: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } - - if ((address & 0xf800) == 0x3800) - { - if (videobank) - DrvBankRAM[address & 0x7ff] = data; - else - K051316Write(0, address & 0x7ff, data); - - return; - } - - if ((address & 0xfff0) == 0x5fc0) { - K051316WriteCtrl(0, address & 0x0f, data); - return; - } - - if ((address & 0xc000) == 0x4000) { - K052109_051960_w(address & 0x3fff, data); - return; - } -} - -UINT8 games88_main_read(UINT16 address) -{ - switch (address) - { - case 0x5f94: - return (DrvInputs[0] & 0x0f) | (DrvDips[0] & 0xf0); - - case 0x5f95: - return DrvInputs[1]; - - case 0x5f96: - return DrvInputs[2]; - - case 0x5f97: - return DrvDips[1]; - - case 0x5f9b: - return DrvDips[2]; - } - - if ((address & 0xf800) == 0x3800) - { - if (videobank) { - return DrvBankRAM[address & 0x7ff]; - } else { - if (zoomreadroms) { - return K051316ReadRom(0, address & 0x7ff); // k051316_rom_0 - } else { - return K051316Read(0, address & 0x7ff); // k051316_0 - } - } - } - - if ((address & 0xc000) == 0x4000) { - return K052109_051960_r(address & 0x3fff); - } - - return 0; -} - -void __fastcall games88_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - UPD7759PortWrite(UPD7759Device, data); - return; - - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xe000: - UPD7759Device = (data & 4) >> 2; - UPD7759ResetWrite(UPD7759Device, data & 2); - UPD7759StartWrite(UPD7759Device, data & 1); - return; - } -} - -UINT8 __fastcall games88_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xc000: - case 0xc001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void games88_set_lines(INT32 lines) -{ - nDrvBank[0] = lines; - - INT32 nBank = 0x10000 + (lines & 0x07) * 0x2000; - - konamiMapMemory(DrvKonROM + nBank, 0x0000, 0x0fff, MAP_ROM); - - if (lines & 8) { - konamiMapMemory(DrvPalRAM, 0x1000, 0x1fff, MAP_RAM); - } else { - konamiMapMemory(DrvKonROM + nBank + 0x1000, 0x1000, 0x1fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x0000, 0x1000, 0x1fff, MAP_WRITE); // unmap writes - } - - videobank = lines & 0x10; - K052109RMRDLine = lines & 0x20; - k88games_priority = lines & 0x80; -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - INT32 layer_colorbase[3] = { 64, 0, 16 }; - - *code |= ((*color & 0x0f) << 8) | (bank << 12); - *color = layer_colorbase[layer] + ((*color & 0xf0) >> 4); -} - -static void K051960Callback(INT32 *, INT32 *color, INT32 *priority, INT32 *) -{ - *priority = (*color & 0x20) >> 5; - *color = 32 + (*color & 0x0f); -} - -static void K051316Callback(INT32 *code,INT32 *color,INT32 *flags) -{ - *flags = *color & 0x40; - *code |= ((*color & 0x07) << 8); - *color = 48 + ((*color & 0x38) >> 3) + ((*color & 0x80) >> 4); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - UPD7759Reset(); - - videobank = 0; - zoomreadroms = 0; - k88games_priority = 0; - UPD7759Device = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x020000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x040000; - DrvGfxROMExp0 = Next; Next += 0x100000; - DrvGfxROMExp1 = Next; Next += 0x200000; - DrvGfxROMExp2 = Next; Next += 0x080000; - - DrvSndROM0 = Next; Next += 0x020000; - DrvSndROM1 = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - DrvBankRAM = Next; Next += 0x000800; - DrvKonRAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x001000; - DrvNVRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - nDrvBank = Next; Next += 0x000002; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x008000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x010000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 5, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 6, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040001, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040002, 9, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040003, 10, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 12, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000002, 13, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000003, 14, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 15, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 16, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040002, 17, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040003, 18, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 19, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080001, 20, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080002, 21, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080003, 22, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 23, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0001, 24, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0002, 25, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0003, 26, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 27, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 28, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020000, 29, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x030000, 30, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 31, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x010000, 32, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 33, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x010000, 34, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x080000); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x100000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvPalRAM + 0x0000, 0x1000, 0x1fff, MAP_RAM); - konamiMapMemory(DrvKonRAM, 0x2000, 0x2fff, MAP_RAM); - konamiMapMemory(DrvNVRAM, 0x3000, 0x37ff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(games88_main_write); - konamiSetReadHandler(games88_main_read); - konamiSetlinesCallback(games88_set_lines); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(games88_sound_write); - ZetSetReadHandler(games88_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(0.75, BURN_SND_ROUTE_BOTH); - - UPD7759Init(0, UPD7759_STANDARD_CLOCK, DrvSndROM0); - UPD7759Init(1, UPD7759_STANDARD_CLOCK, DrvSndROM1); - UPD7759SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - UPD7759SetRoute(1, 0.30, BURN_SND_ROUTE_BOTH); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x7ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(0, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0xfffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(0, 0); - - K051316Init(0, DrvGfxROM2, DrvGfxROMExp2, 0x3ffff, K051316Callback, 4, 0); - K051316SetOffset(0, -104, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - BurnYM2151Exit(); - UPD7759Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x1000); - - K052109UpdateScroll(); - - if (k88games_priority) - { - if (nBurnLayer & 1) K052109RenderLayer(0, K052109_OPAQUE, 0); - if (nSpriteEnable & 1) K051960SpritesRender(1, 1); - if (nBurnLayer & 2) K052109RenderLayer(2, 0, 0); - if (nBurnLayer & 4) K052109RenderLayer(1, 0, 0); - if (nSpriteEnable & 2) K051960SpritesRender(0, 0); - if (nBurnLayer & 8) K051316_zoom_draw(0, 0); - } - else - { - if (nBurnLayer & 1) K052109RenderLayer(2, K052109_OPAQUE, 0); - if (nBurnLayer & 2) K051316_zoom_draw(0, 4); - if (nSpriteEnable & 1) K051960SpritesRender(0, 0); - if (nBurnLayer & 4) K052109RenderLayer(1, 0, 0); - if (nSpriteEnable & 2) K051960SpritesRender(1, 1); - if (nBurnLayer & 8) K052109RenderLayer(0, 0, 0); - } - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - konamiNewFrame(); - ZetNewFrame(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { (((3000000 / 60) * 133) / 100) /* 33% overclock */, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - - nCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - UPD7759Update(0, pSoundBuf, nSegmentLength); - UPD7759Update(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K052109_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - UPD7759Update(0, pSoundBuf, nSegmentLength); - UPD7759Update(1, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - UPD7759Scan(0, nAction, pnMin); - UPD7759Scan(0, nAction, pnMin); - - KonamiICScan(nAction); - - SCAN_VAR(videobank); - SCAN_VAR(zoomreadroms); - SCAN_VAR(k88games_priority); - SCAN_VAR(UPD7759Device); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - games88_set_lines(nDrvBank[0]); - konamiClose(); - } - - return 0; -} - - -// '88 Games - -static struct BurnRomInfo games88RomDesc[] = { - { "861m01.k18", 0x08000, 0x4a4e2959, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Cpu - { "861m02.k16", 0x10000, 0xe19f15f6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "861d01.d9", 0x08000, 0x0ff1dec0, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "861a08.a", 0x10000, 0x77a00dd6, 3 | BRF_GRA }, // 3 K052109 Tiles - { "861a08.c", 0x10000, 0xb422edfc, 3 | BRF_GRA }, // 4 - { "861a09.a", 0x10000, 0xdf8917b6, 3 | BRF_GRA }, // 5 - { "861a09.c", 0x10000, 0xf577b88f, 3 | BRF_GRA }, // 6 - { "861a08.b", 0x10000, 0x28a8304f, 3 | BRF_GRA }, // 7 - { "861a08.d", 0x10000, 0xe01a3802, 3 | BRF_GRA }, // 8 - { "861a09.b", 0x10000, 0x4917158d, 3 | BRF_GRA }, // 9 - { "861a09.d", 0x10000, 0x2bb3282c, 3 | BRF_GRA }, // 10 - - { "861a05.a", 0x10000, 0xcedc19d0, 4 | BRF_GRA }, // 11 K051960 Tiles - { "861a05.e", 0x10000, 0x725af3fc, 4 | BRF_GRA }, // 12 - { "861a06.a", 0x10000, 0x85e2e30e, 4 | BRF_GRA }, // 13 - { "861a06.e", 0x10000, 0x6f96651c, 4 | BRF_GRA }, // 14 - { "861a05.b", 0x10000, 0xdb2a8808, 4 | BRF_GRA }, // 15 - { "861a05.f", 0x10000, 0x32d830ca, 4 | BRF_GRA }, // 16 - { "861a06.b", 0x10000, 0xce17eaf0, 4 | BRF_GRA }, // 17 - { "861a06.f", 0x10000, 0x88310bf3, 4 | BRF_GRA }, // 18 - { "861a05.c", 0x10000, 0xcf03c449, 4 | BRF_GRA }, // 19 - { "861a05.g", 0x10000, 0xfd51c4ea, 4 | BRF_GRA }, // 20 - { "861a06.c", 0x10000, 0xa568b34e, 4 | BRF_GRA }, // 21 - { "861a06.g", 0x10000, 0x4a55beb3, 4 | BRF_GRA }, // 22 - { "861a05.d", 0x10000, 0x97d78c77, 4 | BRF_GRA }, // 23 - { "861a05.h", 0x10000, 0x60d0c8a5, 4 | BRF_GRA }, // 24 - { "861a06.d", 0x10000, 0xbc70ab39, 4 | BRF_GRA }, // 25 - { "861a06.h", 0x10000, 0xd906b79b, 4 | BRF_GRA }, // 26 - - { "861a04.a", 0x10000, 0x092a8b15, 5 | BRF_GRA }, // 27 K051316 Tiles - { "861a04.b", 0x10000, 0x75744b56, 5 | BRF_GRA }, // 28 - { "861a04.c", 0x10000, 0xa00021c5, 5 | BRF_GRA }, // 29 - { "861a04.d", 0x10000, 0xd208304c, 5 | BRF_GRA }, // 30 - - { "861a07.a", 0x10000, 0x5d035d69, 6 | BRF_SND }, // 31 UPD7759 #0 Samples - { "861a07.b", 0x10000, 0x6337dd91, 6 | BRF_SND }, // 32 - - { "861a07.c", 0x10000, 0x5067a38b, 7 | BRF_SND }, // 33 UPD7759 #1 Samples - { "861a07.d", 0x10000, 0x86731451, 7 | BRF_SND }, // 34 - - { "861.g3", 0x00100, 0x429785db, 0 | BRF_OPT }, // 31 Priority Prom -}; - -STD_ROM_PICK(games88) -STD_ROM_FN(games88) - -struct BurnDriver BurnDrvgames88 = { - "88games", NULL, NULL, NULL, "1988", - "'88 Games\0", NULL, "Konami", "GX861", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, games88RomInfo, games88RomName, NULL, NULL, games88InputInfo, games88DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Konami '88 - -static struct BurnRomInfo konami88RomDesc[] = { - { "861.e03", 0x08000, 0x55979bd9, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Cpu - { "861.e02", 0x10000, 0x5b7e98a6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "861d01.d9", 0x08000, 0x0ff1dec0, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "861a08.a", 0x10000, 0x77a00dd6, 3 | BRF_GRA }, // 3 K052109 Tiles - { "861a08.c", 0x10000, 0xb422edfc, 3 | BRF_GRA }, // 4 - { "861a09.a", 0x10000, 0xdf8917b6, 3 | BRF_GRA }, // 5 - { "861a09.c", 0x10000, 0xf577b88f, 3 | BRF_GRA }, // 6 - { "861a08.b", 0x10000, 0x28a8304f, 3 | BRF_GRA }, // 7 - { "861a08.d", 0x10000, 0xe01a3802, 3 | BRF_GRA }, // 8 - { "861a09.b", 0x10000, 0x4917158d, 3 | BRF_GRA }, // 9 - { "861a09.d", 0x10000, 0x2bb3282c, 3 | BRF_GRA }, // 10 - - { "861a05.a", 0x10000, 0xcedc19d0, 4 | BRF_GRA }, // 11 K051960 Tiles - { "861a05.e", 0x10000, 0x725af3fc, 4 | BRF_GRA }, // 12 - { "861a06.a", 0x10000, 0x85e2e30e, 4 | BRF_GRA }, // 13 - { "861a06.e", 0x10000, 0x6f96651c, 4 | BRF_GRA }, // 14 - { "861a05.b", 0x10000, 0xdb2a8808, 4 | BRF_GRA }, // 15 - { "861a05.f", 0x10000, 0x32d830ca, 4 | BRF_GRA }, // 16 - { "861a06.b", 0x10000, 0xce17eaf0, 4 | BRF_GRA }, // 17 - { "861a06.f", 0x10000, 0x88310bf3, 4 | BRF_GRA }, // 18 - { "861a05.c", 0x10000, 0xcf03c449, 4 | BRF_GRA }, // 19 - { "861a05.g", 0x10000, 0xfd51c4ea, 4 | BRF_GRA }, // 20 - { "861a06.c", 0x10000, 0xa568b34e, 4 | BRF_GRA }, // 21 - { "861a06.g", 0x10000, 0x4a55beb3, 4 | BRF_GRA }, // 22 - { "861a05.d", 0x10000, 0x97d78c77, 4 | BRF_GRA }, // 23 - { "861a05.h", 0x10000, 0x60d0c8a5, 4 | BRF_GRA }, // 24 - { "861a06.d", 0x10000, 0xbc70ab39, 4 | BRF_GRA }, // 25 - { "861a06.h", 0x10000, 0xd906b79b, 4 | BRF_GRA }, // 26 - - { "861a04.a", 0x10000, 0x092a8b15, 5 | BRF_GRA }, // 27 K051316 Tiles - { "861a04.b", 0x10000, 0x75744b56, 5 | BRF_GRA }, // 28 - { "861a04.c", 0x10000, 0xa00021c5, 5 | BRF_GRA }, // 29 - { "861a04.d", 0x10000, 0xd208304c, 5 | BRF_GRA }, // 30 - - { "861a07.a", 0x10000, 0x5d035d69, 6 | BRF_SND }, // 31 UPD7759 #0 Samples - { "861a07.b", 0x10000, 0x6337dd91, 6 | BRF_SND }, // 32 - - { "861a07.c", 0x10000, 0x5067a38b, 7 | BRF_SND }, // 33 UPD7759 #1 Samples - { "861a07.d", 0x10000, 0x86731451, 7 | BRF_SND }, // 34 - - { "861.g3", 0x00100, 0x429785db, 0 | BRF_OPT }, // 31 Priority Prom -}; - -STD_ROM_PICK(konami88) -STD_ROM_FN(konami88) - -struct BurnDriver BurnDrvKonami88 = { - "konami88", "88games", NULL, NULL, "1988", - "Konami '88\0", NULL, "Konami", "GX861", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, konami88RomInfo, konami88RomName, NULL, NULL, games88InputInfo, games88DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Hyper Sports Special (Japan) - -static struct BurnRomInfo hypsptspRomDesc[] = { - { "861f03.k18", 0x08000, 0x8c61aebd, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Cpu - { "861f02.k16", 0x10000, 0xd2460c28, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "861d01.d9", 0x08000, 0x0ff1dec0, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "861a08.a", 0x10000, 0x77a00dd6, 3 | BRF_GRA }, // 3 K052109 Tiles - { "861a08.c", 0x10000, 0xb422edfc, 3 | BRF_GRA }, // 4 - { "861a09.a", 0x10000, 0xdf8917b6, 3 | BRF_GRA }, // 5 - { "861a09.c", 0x10000, 0xf577b88f, 3 | BRF_GRA }, // 6 - { "861a08.b", 0x10000, 0x28a8304f, 3 | BRF_GRA }, // 7 - { "861a08.d", 0x10000, 0xe01a3802, 3 | BRF_GRA }, // 8 - { "861a09.b", 0x10000, 0x4917158d, 3 | BRF_GRA }, // 9 - { "861a09.d", 0x10000, 0x2bb3282c, 3 | BRF_GRA }, // 10 - - { "861a05.a", 0x10000, 0xcedc19d0, 4 | BRF_GRA }, // 11 K051960 Tiles - { "861a05.e", 0x10000, 0x725af3fc, 4 | BRF_GRA }, // 12 - { "861a06.a", 0x10000, 0x85e2e30e, 4 | BRF_GRA }, // 13 - { "861a06.e", 0x10000, 0x6f96651c, 4 | BRF_GRA }, // 14 - { "861a05.b", 0x10000, 0xdb2a8808, 4 | BRF_GRA }, // 15 - { "861a05.f", 0x10000, 0x32d830ca, 4 | BRF_GRA }, // 16 - { "861a06.b", 0x10000, 0xce17eaf0, 4 | BRF_GRA }, // 17 - { "861a06.f", 0x10000, 0x88310bf3, 4 | BRF_GRA }, // 18 - { "861a05.c", 0x10000, 0xcf03c449, 4 | BRF_GRA }, // 19 - { "861a05.g", 0x10000, 0xfd51c4ea, 4 | BRF_GRA }, // 20 - { "861a06.c", 0x10000, 0xa568b34e, 4 | BRF_GRA }, // 21 - { "861a06.g", 0x10000, 0x4a55beb3, 4 | BRF_GRA }, // 22 - { "861a05.d", 0x10000, 0x97d78c77, 4 | BRF_GRA }, // 23 - { "861a05.h", 0x10000, 0x60d0c8a5, 4 | BRF_GRA }, // 24 - { "861a06.d", 0x10000, 0xbc70ab39, 4 | BRF_GRA }, // 25 - { "861a06.h", 0x10000, 0xd906b79b, 4 | BRF_GRA }, // 26 - - { "861a04.a", 0x10000, 0x092a8b15, 5 | BRF_GRA }, // 27 K051316 Tiles - { "861a04.b", 0x10000, 0x75744b56, 5 | BRF_GRA }, // 28 - { "861a04.c", 0x10000, 0xa00021c5, 5 | BRF_GRA }, // 29 - { "861a04.d", 0x10000, 0xd208304c, 5 | BRF_GRA }, // 30 - - { "861a07.a", 0x10000, 0x5d035d69, 6 | BRF_SND }, // 31 UPD7759 #0 Samples - { "861a07.b", 0x10000, 0x6337dd91, 6 | BRF_SND }, // 32 - - { "861a07.c", 0x10000, 0x5067a38b, 7 | BRF_SND }, // 33 UPD7759 #1 Samples - { "861a07.d", 0x10000, 0x86731451, 7 | BRF_SND }, // 34 - - { "861.g3", 0x00100, 0x429785db, 8 | BRF_OPT }, // 31 Priority Prom -}; - -STD_ROM_PICK(hypsptsp) -STD_ROM_FN(hypsptsp) - -struct BurnDriver BurnDrvHypsptsp = { - "hypsptsp", "88games", NULL, NULL, "1988", - "Hyper Sports Special (Japan)\0", NULL, "Konami", "GX861", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, hypsptspRomInfo, hypsptspRomName, NULL, NULL, games88InputInfo, games88DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_ajax.cpp b/jan/src/burn/drv/konami/d_ajax.cpp deleted file mode 100644 index 40aeb6260..000000000 --- a/jan/src/burn/drv/konami/d_ajax.cpp +++ /dev/null @@ -1,931 +0,0 @@ -// FB Alpha Ajax driver module -// Based on MAME driver by Manuel Abadia - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k007232.h" -#include "m6809_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvShareRAM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *nDrvBankRom; - -static UINT8 DrvInputs[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static INT32 firq_enable; -static INT32 ajax_priority; - -static struct BurnInputInfo AjaxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Ajax) - -static struct BurnDIPInfo AjaxDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x52, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x15, 0x01, 0x04, 0x00, "Upright" }, -// {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "30000 150000" }, - {0x15, 0x01, 0x18, 0x10, "50000 200000" }, - {0x15, 0x01, 0x18, 0x08, "30000" }, - {0x15, 0x01, 0x18, 0x00, "50000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Difficult" }, - {0x15, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x01, 0x01, "Off" }, -// {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Control in 3D Stages" }, - {0x16, 0x01, 0x08, 0x08, "Normal" }, - {0x16, 0x01, 0x08, 0x00, "Inverted" }, -}; - -STDDIPINFO(Ajax) - -static void ajax_main_bankswitch(INT32 data) -{ - nDrvBankRom[0] = data; - - INT32 nBank = 0x10000 + ((data & 0x80) << 9) + ((data & 7) << 13); - - ajax_priority = data & 0x08; - - konamiMapMemory(DrvKonROM + nBank, 0x6000, 0x7fff, MAP_ROM); -} - -void ajax_main_write(UINT16 address, UINT8 data) -{ - if (address <= 0x1c0) - { - switch ((address & 0x01c0) >> 6) - { - case 0x0000: - if (address == 0 && firq_enable) { - M6809SetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - break; - - case 0x0001: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - break; - - case 0x0002: - *soundlatch = data; - break; - - case 0x0003: - ajax_main_bankswitch(data); - break; - } - } - - if ((address & 0xfff8) == 0x0800) { - K051937Write(address & 7, data); - return; - } - - if ((address & 0xfc00) == 0x0c00) { - K051960Write(address & 0x3ff, data); - return; - } -} - -UINT8 ajax_main_read(UINT16 address) -{ - if (address <= 0x01c0) { - switch ((address & 0x1c0) >> 6) - { - case 0x0000: - return konamiTotalCycles() & 0xff; // rand - - case 0x0004: - return DrvInputs[2]; - - case 0x0006: - switch (address & 3) { - case 0: - return DrvInputs[0]; - - case 1: - return DrvInputs[1]; - - case 2: - return DrvDips[0]; - - case 3: - return DrvDips[1]; - } - return 0; - - case 0x0007: - return DrvDips[2]; - } - } - - if ((address & 0xfff8) == 0x0800) { - return K051937Read(address & 7); - } - - if ((address & 0xfc00) == 0x0c00) { - return K051960Read(address & 0x3ff); - } - - return 0; -} - -static void ajax_sub_bankswitch(UINT8 data) -{ - nDrvBankRom[1] = data; - - K052109RMRDLine = data & 0x40; - - K051316WrapEnable(0, data & 0x20); - - firq_enable = data & 0x10; - - INT32 nBank = ((data & 0x0f) << 13) + 0x10000; - M6809MapMemory(DrvM6809ROM + nBank, 0x8000, 0x9fff, MAP_ROM); -} - -void ajax_sub_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0x0000) { - K051316Write(0, address & 0x7ff, data); - return; - } - - if ((address & 0xfff0) == 0x0800) { - K051316WriteCtrl(0, address & 0x0f, data); - return; - } - - if (address == 0x1800) { - ajax_sub_bankswitch(data); - return; - } - - if ((address & 0xc000) == 0x4000) { - K052109Write(address & 0x3fff, data); - return; - } -} - -UINT8 ajax_sub_read(UINT16 address) -{ - if ((address & 0xf800) == 0x0000) { - return K051316Read(0, address & 0x7ff); - } - - if ((address & 0xf800) == 0x1000) { - return K051316ReadRom(0, address & 0x7ff); - } - - if ((address & 0xc000) == 0x4000) { - return K052109Read(address & 0x3fff); - } - - return 0; -} - -void __fastcall ajax_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xa000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(1, address & 0x0f, data); - return; - } - - switch (address) - { - case 0x9000: - k007232_set_bank(0, (data >> 1) & 1, (data >> 0) & 1 ); - k007232_set_bank(1, (data >> 4) & 3, (data >> 2) & 3 ); - return; - - case 0xb80c: - K007232SetVolume(1, 0, (data & 0x0f) * 0x11/2, (data & 0x0f) * 0x11/2); - return; - - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - } -} - -UINT8 __fastcall ajax_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xa000) { - return K007232ReadReg(0, address & 0x0f); - } - - if ((address & 0xfff0) == 0xb000) { - return K007232ReadReg(1, address & 0x0f); - } - - switch (address) - { - case 0xc000: - case 0xc001: - return BurnYM2151ReadStatus(); - - case 0xe000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - INT32 layer_colorbase[3] = { 64, 0, 32 }; - - *code |= ((*color & 0x0f) << 8) | (bank << 12); - *code &= 0x3fff; - *color = layer_colorbase[layer] + ((*color & 0xf0) >> 4); -} - -static void K051960Callback(INT32 *code, INT32 *color,INT32 *priority, INT32 *) -{ - *priority = 0xff00; - if ( *color & 0x10) *priority |= 0xf0f0; - if (~*color & 0x40) *priority |= 0xcccc; - if ( *color & 0x20) *priority |= 0xaaaa; - *color = 16 + (*color & 0x0f); - *code &= 0x1fff; -} - -static void K051316Callback(INT32 *code,INT32 *color,INT32 *) -{ - *code |= ((*color & 0x07) << 8); - *code &= 0x7ff; - *color = 6 + ((*color & 0x08) >> 3); -} - -static void DrvK007232VolCallback0(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -static void DrvK007232VolCallback1(INT32 v) -{ - K007232SetVolume(1, 1, (v & 0x0f) * 0x11/2, (v & 0x0f) * 0x11/2); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - firq_enable = 0; - ajax_priority = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x030000; - DrvM6809ROM = Next; Next += 0x030000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROMExp0 = Next; Next += 0x100000; - DrvGfxROMExp1 = Next; Next += 0x200000; - - DrvSndROM0 = Next; Next += 0x040000; - DrvSndROM1 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x801 * sizeof(UINT32); - - AllRam = Next; - - DrvShareRAM = Next; Next += 0x002000; - DrvKonRAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x001000 + 0x1000; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - nDrvBankRom = Next; Next += 0x000002; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 type) -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x020000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x010000, 1, 1)) return 1; - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x28000, 0x8000); - - if (BurnLoadRom(DrvM6809ROM + 0x20000, 2, 1)) return 1; - memcpy (DrvM6809ROM + 0xa000, DrvM6809ROM + 0x22000, 0x6000); - if (BurnLoadRom(DrvM6809ROM + 0x10000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (type) { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 6, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 9, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040001, 10, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040002, 11, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040003, 12, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 13, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 14, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000002, 15, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000003, 16, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 17, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 18, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040002, 19, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040003, 20, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 21, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080001, 22, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080002, 23, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080003, 24, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 25, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0001, 26, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0002, 27, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0003, 28, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 29, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 30, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 31, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x010000, 32, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x020000, 33, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x030000, 34, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 35, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x010000, 36, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x020000, 37, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x030000, 38, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x040000, 39, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x050000, 40, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x060000, 41, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x070000, 42, 1)) return 1; - } else { - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x000000, 12, 1)) return 1; - } - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x080000); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x100000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvPalRAM, 0x1000, 0x1fff, MAP_RAM); - konamiMapMemory(DrvShareRAM, 0x2000, 0x3fff, MAP_RAM); - konamiMapMemory(DrvKonRAM, 0x4000, 0x5fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(ajax_main_write); - konamiSetReadHandler(ajax_main_read); - konamiClose(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvShareRAM, 0x2000, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x10000, 0x8000, 0x9fff, MAP_ROM); - M6809MapMemory(DrvM6809ROM + 0x0a000, 0xa000, 0xffff, MAP_ROM); - M6809SetWriteHandler(ajax_sub_write); - M6809SetReadHandler(ajax_sub_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(ajax_sound_write); - ZetSetReadHandler(ajax_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K007232Init(0, 3579545, DrvSndROM0, 0x40000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback0); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - K007232Init(1, 3579545, DrvSndROM1, 0x80000); - K007232SetPortWriteHandler(1, DrvK007232VolCallback1); - K007232SetRoute(1, BURN_SND_K007232_ROUTE_1, 0.40, BURN_SND_ROUTE_BOTH); - K007232SetRoute(1, BURN_SND_K007232_ROUTE_2, 0.30, BURN_SND_ROUTE_BOTH); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x7ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(4, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0xfffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(4, 0); - - K051316Init(0, DrvGfxROM2, DrvGfxROM2, 0x7ffff, K051316Callback, 7, 0); - K051316SetOffset(0, -112 + 4, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - M6809Exit(); - konamiExit(); - ZetExit(); - - K007232Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x1000); - - K052109UpdateScroll(); - - KonamiClearBitmaps(0); - - if (nBurnLayer & 1) K052109RenderLayer(2, 0, 1); - - if (ajax_priority) - { - if (nBurnLayer & 2) K051316_zoom_draw(0, 4); - if (nBurnLayer & 4) K052109RenderLayer(1, 0, 2); - } - else - { - if (nBurnLayer & 4) K052109RenderLayer(1, 0, 2); - if (nBurnLayer & 2) K051316_zoom_draw(0, 4); - } - - if (nBurnLayer & 8) K052109RenderLayer(0, 0, 8); - - if (nSpriteEnable & 8) K051960SpritesRender(-1, -1); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 100; - INT32 nCyclesTotal[3] = { (((3000000 / 60) * 133) / 100) /* 33% overclock */, 3000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - ZetOpen(0); - M6809Open(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - nCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]); - - nCyclesDone[1] += M6809Run(nSegment - nCyclesDone[1]); - nSegment = (nCyclesTotal[2] / nInterleave) * (i + 1); - - nCyclesDone[2] += ZetRun(nSegment - nCyclesDone[2]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - K007232Update(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K051960_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - K007232Update(1, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - M6809Close(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - M6809Scan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - ajax_main_bankswitch(nDrvBankRom[0]); - konamiClose(); - - M6809Open(0); - ajax_sub_bankswitch(nDrvBankRom[1]); - M6809Close(); - } - - return 0; -} - - -// Ajax - -static struct BurnRomInfo ajaxRomDesc[] = { - { "770_m01.n11", 0x10000, 0x4a64e53a, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "770_l02.n12", 0x10000, 0xad7d592b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "770_l05.i16", 0x08000, 0xed64fbb2, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 Code - { "770_f04.g16", 0x10000, 0xe0e4ec9c, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "770_h03.f16", 0x08000, 0x2ffd2afc, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "770c13-a.f3", 0x10000, 0x4ef6fff2, 4 | BRF_GRA }, // 5 K052109 Tiles - { "770c13-c.f4", 0x10000, 0x97ffbab6, 4 | BRF_GRA }, // 6 - { "770c12-a.f5", 0x10000, 0x6c0ade68, 4 | BRF_GRA }, // 7 - { "770c12-c.f6", 0x10000, 0x61fc39cc, 4 | BRF_GRA }, // 8 - { "770c13-b.e3", 0x10000, 0x86fdd706, 4 | BRF_GRA }, // 9 - { "770c13-d.e4", 0x10000, 0x7d7acb2d, 4 | BRF_GRA }, // 10 - { "770c12-b.e5", 0x10000, 0x5f221cc6, 4 | BRF_GRA }, // 11 - { "770c12-d.e6", 0x10000, 0xf1edb2f4, 4 | BRF_GRA }, // 12 - - { "770c09-a.f8", 0x10000, 0x76690fb8, 5 | BRF_GRA }, // 13 K051960 Tiles - { "770c09-e.f9", 0x10000, 0x17b482c9, 5 | BRF_GRA }, // 14 - { "770c08-a.f10", 0x10000, 0xefd29a56, 5 | BRF_GRA }, // 15 - { "770c08-e.f11", 0x10000, 0x6d43afde, 5 | BRF_GRA }, // 16 - { "770c09-b.e8", 0x10000, 0xcd1709d1, 5 | BRF_GRA }, // 17 - { "770c09-f.e9", 0x10000, 0xcba4b47e, 5 | BRF_GRA }, // 18 - { "770c08-b.e10", 0x10000, 0xf3374014, 5 | BRF_GRA }, // 19 - { "770c08-f.e11", 0x10000, 0xf5ba59aa, 5 | BRF_GRA }, // 20 - { "770c09-c.d8", 0x10000, 0xbfd080b8, 5 | BRF_GRA }, // 21 - { "770c09-g.d9", 0x10000, 0x77d58ea0, 5 | BRF_GRA }, // 22 - { "770c08-c.d10", 0x10000, 0x28e7088f, 5 | BRF_GRA }, // 23 - { "770c08-g.d11", 0x10000, 0x17da8f6d, 5 | BRF_GRA }, // 24 - { "770c09-d.c8", 0x10000, 0x6f955600, 5 | BRF_GRA }, // 25 - { "770c09-h.c9", 0x10000, 0x494a9090, 5 | BRF_GRA }, // 26 - { "770c08-d.c10", 0x10000, 0x91591777, 5 | BRF_GRA }, // 27 - { "770c08-h.c11", 0x10000, 0xd97d4b15, 5 | BRF_GRA }, // 28 - - { "770c06.f4", 0x40000, 0xd0c592ee, 6 | BRF_GRA }, // 29 K051960 Tiles - { "770c07.h4", 0x40000, 0x0b399fb1, 6 | BRF_GRA }, // 30 - - { "770c10-a.a7", 0x10000, 0xe45ec094, 7 | BRF_SND }, // 31 K007232 #0 Samples - { "770c10-b.a6", 0x10000, 0x349db7d3, 7 | BRF_SND }, // 32 - { "770c10-c.a5", 0x10000, 0x71cb1f05, 7 | BRF_SND }, // 33 - { "770c10-d.a4", 0x10000, 0xe8ab1844, 7 | BRF_SND }, // 34 - - { "770c11-a.c6", 0x10000, 0x8cccd9e0, 8 | BRF_SND }, // 35 K007232 #1 Samples - { "770c11-b.c5", 0x10000, 0x0af2fedd, 8 | BRF_SND }, // 36 - { "770c11-c.c4", 0x10000, 0x7471f24a, 8 | BRF_SND }, // 37 - { "770c11-d.c3", 0x10000, 0xa58be323, 8 | BRF_SND }, // 38 - { "770c11-e.b7", 0x10000, 0xdd553541, 8 | BRF_SND }, // 39 - { "770c11-f.b6", 0x10000, 0x3f78bd0f, 8 | BRF_SND }, // 40 - { "770c11-g.b5", 0x10000, 0x078c51b2, 8 | BRF_SND }, // 41 - { "770c11-h.b4", 0x10000, 0x7300c2e1, 8 | BRF_SND }, // 42 - - { "63s241.j11", 0x00200, 0x9bdd719f, 9 | BRF_OPT }, // 43 Timing Prom (unused) -}; - -STD_ROM_PICK(ajax) -STD_ROM_FN(ajax) - -static INT32 ajaxInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvAjax = { - "ajax", NULL, NULL, NULL, "1987", - "Ajax\0", NULL, "Konami", "GX770", - L"Ajax\0\u30A8\u30FC\u30B8\u30E3\u30C3\u30AF\u30B9\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, ajaxRomInfo, ajaxRomName, NULL, NULL, AjaxInputInfo, AjaxDIPInfo, - ajaxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 304, 3, 4 -}; - - -// Typhoon - -static struct BurnRomInfo typhoonRomDesc[] = { - { "770_k01.n11", 0x10000, 0x5ba74a22, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "770_k02.n12", 0x10000, 0x3bcf782a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "770_k05.i16", 0x08000, 0x0f1bebbb, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 Code - { "770_f04.g16", 0x10000, 0xe0e4ec9c, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "770_h03.f16", 0x08000, 0x2ffd2afc, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "770c13.n22", 0x40000, 0xb859ca4e, 4 | BRF_GRA }, // 5 K052109 Tiles - { "770c12.k22", 0x40000, 0x50d14b72, 4 | BRF_GRA }, // 6 - - { "770c09.n4", 0x80000, 0x1ab4a7ff, 5 | BRF_GRA }, // 7 K051960 Tiles - { "770c08.k4", 0x80000, 0xa8e80586, 5 | BRF_GRA }, // 8 - - { "770c06.f4", 0x40000, 0xd0c592ee, 6 | BRF_GRA }, // 9 K051960 Tiles - { "770c07.h4", 0x40000, 0x0b399fb1, 6 | BRF_GRA }, // 10 - - { "770c10", 0x40000, 0x7fac825f, 7 | BRF_SND }, // 11 K007232 #0 Samples - - { "770c11", 0x80000, 0x299a615a, 8 | BRF_SND }, // 12 K007232 #1 Samples - - { "63s241.j11", 0x00200, 0x9bdd719f, 9 | BRF_OPT }, // 13 Timing Prom (unused) -}; - -STD_ROM_PICK(typhoon) -STD_ROM_FN(typhoon) - -static INT32 typhoonInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvTyphoon = { - "typhoon", "ajax", NULL, NULL, "1987", - "Typhoon\0", NULL, "Konami", "GX770", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, typhoonRomInfo, typhoonRomName, NULL, NULL, AjaxInputInfo, AjaxDIPInfo, - typhoonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 304, 3, 4 -}; - - -// Ajax (Japan) - -static struct BurnRomInfo ajaxjRomDesc[] = { - { "770_l01.n11", 0x10000, 0x7cea5274, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "770_l02.n12", 0x10000, 0xad7d592b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "770_l05.i16", 0x08000, 0xed64fbb2, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 code - { "770_f04.g16", 0x10000, 0xe0e4ec9c, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "770_f03.f16", 0x08000, 0x3fe914fd, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "770c13.n22", 0x40000, 0xb859ca4e, 4 | BRF_GRA }, // 5 K052109 Tiles - { "770c12.k22", 0x40000, 0x50d14b72, 4 | BRF_GRA }, // 6 - - { "770c09.n4", 0x80000, 0x1ab4a7ff, 5 | BRF_GRA }, // 7 K051960 Tiles - { "770c08.k4", 0x80000, 0xa8e80586, 5 | BRF_GRA }, // 8 - - { "770c06.f4", 0x40000, 0xd0c592ee, 6 | BRF_GRA }, // 9 K051960 Tiles - { "770c07.h4", 0x40000, 0x0b399fb1, 6 | BRF_GRA }, // 10 - - { "770c10", 0x40000, 0x7fac825f, 7 | BRF_SND }, // 11 K007232 #0 Samples - - { "770c11", 0x80000, 0x299a615a, 8 | BRF_SND }, // 12 K007232 #1 Samples - - { "63s241.j11", 0x00200, 0x9bdd719f, 9 | BRF_OPT }, // 13 Timing Prom (unused) -}; - -STD_ROM_PICK(ajaxj) -STD_ROM_FN(ajaxj) - -struct BurnDriver BurnDrvAjaxj = { - "ajaxj", "ajax", NULL, NULL, "1987", - "Ajax (Japan)\0", NULL, "Konami", "GX770", - L"Ajax\0\u30A8\u30FC\u30B8\u30E3\u30C3\u30AF\u30B9 (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, ajaxjRomInfo, ajaxjRomName, NULL, NULL, AjaxInputInfo, AjaxDIPInfo, - typhoonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 304, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_aliens.cpp b/jan/src/burn/drv/konami/d_aliens.cpp deleted file mode 100644 index 339574e40..000000000 --- a/jan/src/burn/drv/konami/d_aliens.cpp +++ /dev/null @@ -1,825 +0,0 @@ -// FB Alpha Aliens driver module -// Based on MAME driver by Manuel Abadia - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k007232.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvBankRAM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *nDrvRamBank; -static UINT8 *nDrvKonamiBank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo AliensInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Aliens) - -static struct BurnDIPInfo AliensDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x5e, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x01, "3" }, - {0x13, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x01, 0x01, "Off" }, -// {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Aliens) - -static void set_ram_bank(INT32 data) -{ - nDrvRamBank[0] = data; - - if (data & 0x20) { - konamiMapMemory(DrvPalRAM, 0x0000, 0x03ff, MAP_RAM); - } else { - konamiMapMemory(DrvBankRAM, 0x0000, 0x03ff, MAP_RAM); - } -} - -void aliens_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x5f88: - set_ram_bank(data & 0x20); - K052109RMRDLine = data & 0x40; - return; - - case 0x5f8c: - *soundlatch = data; - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } - - if ((address & 0xc000) == 0x4000) { - K052109_051960_w(address & 0x3fff, data); - return; - } -} - -UINT8 aliens_main_read(UINT16 address) -{ - switch (address) - { - case 0x5f80: - return DrvDips[2]; - - case 0x5f81: - return DrvInputs[0]; - - case 0x5f82: - return DrvInputs[1]; - - case 0x5f83: - return DrvDips[1]; - - case 0x5f84: - return DrvDips[0]; - - case 0x5f88: - // watchdog reset - return 0; - } - - if ((address & 0xc000) == 0x4000) { - return K052109_051960_r(address & 0x3fff); - } - - return 0; -} - -void __fastcall aliens_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xe000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - switch (address) - { - case 0xa000: - BurnYM2151SelectRegister(data); - return; - - case 0xa001: - BurnYM2151WriteRegister(data); - return; - } -} - -UINT8 __fastcall aliens_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xe000) { - return K007232ReadReg(0, address & 0x0f); - } - - switch (address) - { - case 0xa000: - case 0xa001: - return BurnYM2151ReadStatus(); - - case 0xc000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void DrvYM2151WritePort(UINT32, UINT32 data) -{ - INT32 bank_A = ((data >> 1) & 0x01); - INT32 bank_B = ((data) & 0x01); - - k007232_set_bank(0, bank_A, bank_B ); -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -static void aliens_set_lines(INT32 lines) -{ - nDrvKonamiBank[0] = lines; - - INT32 nBank = (lines & 0x1f) * 0x2000; - - konamiMapMemory(DrvKonROM + 0x10000 + nBank, 0x2000, 0x3fff, MAP_ROM); -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - *code |= ((*color & 0x3f) << 8) | (bank << 14); - *code &= 0xffff; - *color = (layer << 2) + ((*color & 0xc0) >> 6); -} - -static void K051960Callback(INT32 *code, INT32 *color,INT32 *priority, INT32 *shadow) -{ - switch (*color & 0x70) - { - case 0x10: *priority = 0x00; break; - case 0x00: *priority = 0xf0; break; - case 0x40: *priority = 0xfc; break; - case 0x20: - case 0x60: *priority = 0xfe; break; - case 0x50: *priority = 0xcc; break; - case 0x30: - case 0x70: *priority = 0xee; break; - } - - *code |= (*color & 0x80) << 6; - *code &= 0x3fff; - *color = 16 + (*color & 0x0f); - *shadow = 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROMExp0 = Next; Next += 0x400000; - DrvGfxROMExp1 = Next; Next += 0x400000; - - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x200 * sizeof(UINT32); - - AllRam = Next; - - DrvBankRAM = Next; Next += 0x000400; - DrvKonRAM = Next; Next += 0x001c00; - DrvPalRAM = Next; Next += 0x000400; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - nDrvRamBank = Next; Next += 0x000001; - nDrvKonamiBank = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x030000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x010000, 1, 1)) return 1; - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x38000, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 4, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x100000, 5, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x100002, 6, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x100000, 9, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x100002, 10, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 11, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x200000); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x200000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvBankRAM, 0x0000, 0x03ff, MAP_RAM); - konamiMapMemory(DrvKonRAM, 0x0400, 0x1fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x2000, 0x3fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(aliens_main_write); - konamiSetReadHandler(aliens_main_read); - konamiSetlinesCallback(aliens_set_lines); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(aliens_sound_write); - ZetSetReadHandler(aliens_sound_read); - ZetClose(); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x1fffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(8, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0x1fffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(8, 0); - - BurnYM2151Init(3579545); - BurnYM2151SetPortHandler(&DrvYM2151WritePort); - BurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH); - - K007232Init(0, 3579545, DrvSndROM, 0x40000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - K007232Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x400); - - K052109UpdateScroll(); - - KonamiClearBitmaps(DrvPalette[0x0040]); - - if (nBurnLayer & 1) K052109RenderLayer(1, 0, 1); - if (nBurnLayer & 2) K052109RenderLayer(2, 0, 2); - if (nBurnLayer & 4) K052109RenderLayer(0, 0, 4); - - if (nSpriteEnable & 1) K051960SpritesRender(-1, -1); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, sizeof ( DrvInputs )); - - for (INT32 i = 0; i < 8; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvDips[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03; - if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - } - - konamiNewFrame(); - ZetNewFrame(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = nBurnSoundLen; - INT32 nCyclesTotal[2] = { 6000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - - nCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K051960_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - set_ram_bank(nDrvRamBank[0]); - aliens_set_lines(nDrvKonamiBank[0]); - konamiClose(); - } - - return 0; -} - - -// Aliens (World set 1) - -static struct BurnRomInfo aliensRomDesc[] = { - { "875_j02.e24", 0x10000, 0x56c20971, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - { "875_j01.c24", 0x20000, 0x6a529cd6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "875_b03.g04", 0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "875b11.k13", 0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles - { "875b12.k19", 0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4 - { "875b07.j13", 0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5 - { "875b08.j19", 0x40000, 0xf9387966, 3 | BRF_GRA }, // 6 - - { "875b10.k08", 0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites - { "875b09.k02", 0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8 - { "875b06.j08", 0x40000, 0x081a0566, 4 | BRF_GRA }, // 9 - { "875b05.j02", 0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10 - - { "875b04.e05", 0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples - - { "821a08.h14", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms -}; - -STD_ROM_PICK(aliens) -STD_ROM_FN(aliens) - -struct BurnDriver BurnDrvAliens = { - "aliens", NULL, NULL, NULL, "1990", - "Aliens (World set 1)\0", NULL, "Konami", "GX875", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, aliensRomInfo, aliensRomName, NULL, NULL, AliensInputInfo, AliensDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; - - -// Aliens (World set 2) - -static struct BurnRomInfo aliens2RomDesc[] = { - { "875_p02.e24", 0x10000, 0x4edd707d, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - { "875_n01.c24", 0x20000, 0x106cf59c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "875_b03.g04", 0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "875b11.k13", 0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles - { "875b12.k19", 0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4 - { "875b07.j13", 0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5 - { "875b08.j19", 0x40000, 0xf9387966, 3 | BRF_GRA }, // 6 - - { "875b10.k08", 0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites - { "875b09.k02", 0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8 - { "875b06.j08", 0x40000, 0x081a0566, 4 | BRF_GRA }, // 9 - { "875b05.j02", 0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10 - - { "875b04.e05", 0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples - - { "821a08.h14", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms -}; - -STD_ROM_PICK(aliens2) -STD_ROM_FN(aliens2) - -struct BurnDriver BurnDrvAliens2 = { - "aliens2", "aliens", NULL, NULL, "1990", - "Aliens (World set 2)\0", NULL, "Konami", "GX875", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, aliens2RomInfo, aliens2RomName, NULL, NULL, AliensInputInfo, AliensDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; - - -// Aliens (World set 3) - -static struct BurnRomInfo aliens3RomDesc[] = { - { "875_w3_2.e24", 0x10000, 0xf917f7b5, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - { "875_w3_1.c24", 0x20000, 0x3c0006fb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "875_b03.g04", 0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "875b11.k13", 0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles - { "875b12.k19", 0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4 - { "875b07.j13", 0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5 - { "875b08.j19", 0x40000, 0xf9387966, 3 | BRF_GRA }, // 6 - - { "875b10.k08", 0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites - { "875b09.k02", 0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8 - { "875b06.j08", 0x40000, 0x081a0566, 4 | BRF_GRA }, // 9 - { "875b05.j02", 0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10 - - { "875b04.e05", 0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples - - { "821a08.h14", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms -}; - -STD_ROM_PICK(aliens3) -STD_ROM_FN(aliens3) - -struct BurnDriver BurnDrvAliens3 = { - "aliens3", "aliens", NULL, NULL, "1990", - "Aliens (World set 3)\0", NULL, "Konami", "GX875", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, aliens3RomInfo, aliens3RomName, NULL, NULL, AliensInputInfo, AliensDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; - - -// Aliens (US) - -static struct BurnRomInfo aliensuRomDesc[] = { - { "875_n02.e24", 0x10000, 0x24dd612e, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - { "875_n01.c24", 0x20000, 0x106cf59c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "875_b03.g04", 0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "875b11.k13", 0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles - { "875b12.k19", 0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4 - { "875b07.j13", 0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5 - { "875b08.j19", 0x40000, 0xf9387966, 3 | BRF_GRA }, // 6 - - { "875b10.k08", 0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites - { "875b09.k02", 0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8 - { "875b06.j08", 0x40000, 0x081a0566, 4 | BRF_GRA }, // 9 - { "875b05.j02", 0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10 - - { "875b04.e05", 0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples - - { "821a08.h14", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms -}; - -STD_ROM_PICK(aliensu) -STD_ROM_FN(aliensu) - -struct BurnDriver BurnDrvAliensu = { - "aliensu", "aliens", NULL, NULL, "1990", - "Aliens (US)\0", NULL, "Konami", "GX875", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, aliensuRomInfo, aliensuRomName, NULL, NULL, AliensInputInfo, AliensDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; - - -// Aliens (Japan set 1) - -static struct BurnRomInfo aliensjRomDesc[] = { - { "875_m02.e24", 0x10000, 0x54a774e5, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - { "875_m01.c24", 0x20000, 0x1663d3dc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "875_k03.g04", 0x08000, 0xbd86264d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "875b11.k13", 0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles - { "875b12.k19", 0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4 - { "875b07.j13", 0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5 - { "875b08.j19", 0x40000, 0xf9387966, 3 | BRF_GRA }, // 6 - - { "875b10.k08", 0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites - { "875b09.k02", 0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8 - { "875b06.j08", 0x40000, 0x081a0566, 4 | BRF_GRA }, // 9 - { "875b05.j02", 0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10 - - { "875b04.e05", 0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples - - { "821a08.h14", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms -}; - -STD_ROM_PICK(aliensj) -STD_ROM_FN(aliensj) - -struct BurnDriver BurnDrvAliensj = { - "aliensj", "aliens", NULL, NULL, "1990", - "Aliens (Japan set 1)\0", NULL, "Konami", "GX875", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, aliensjRomInfo, aliensjRomName, NULL, NULL, AliensInputInfo, AliensDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; - - -// Aliens (Japan set 2) - -static struct BurnRomInfo aliensj2RomDesc[] = { - { "875_j2_2.e24", 0x10000, 0x4bb84952, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - { "875_m01.c24", 0x20000, 0x1663d3dc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "875_k03.g04", 0x08000, 0xbd86264d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "875b11.k13", 0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles - { "875b12.k19", 0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4 - { "875b07.j13", 0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5 - { "875b08.j19", 0x40000, 0xf9387966, 3 | BRF_GRA }, // 6 - - { "875b10.k08", 0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites - { "875b09.k02", 0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8 - { "875b06.j08", 0x40000, 0x081a0566, 4 | BRF_GRA }, // 9 - { "875b05.j02", 0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10 - - { "875b04.e05", 0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples - - { "821a08.h14", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms -}; - -STD_ROM_PICK(aliensj2) -STD_ROM_FN(aliensj2) - -struct BurnDriver BurnDrvAliensj2 = { - "aliensj2", "aliens", NULL, NULL, "1990", - "Aliens (Japan set 2)\0", NULL, "Konami", "GX875", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, aliensj2RomInfo, aliensj2RomName, NULL, NULL, AliensInputInfo, AliensDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; - - -// Aliens (Asia) - -static struct BurnRomInfo aliensaRomDesc[] = { - { "875_r02.e24", 0x10000, 0x973e4f11, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - { "875_m01.c24", 0x20000, 0x1663d3dc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "875_k03.g04", 0x08000, 0xbd86264d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "875b11.k13", 0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles - { "875b12.k19", 0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4 - { "875b07.j13", 0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5 - { "875b08.j19", 0x40000, 0xf9387966, 3 | BRF_GRA }, // 6 - - { "875b10.k08", 0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites - { "875b09.k02", 0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8 - { "875b06.j08", 0x40000, 0x081a0566, 4 | BRF_GRA }, // 9 - { "875b05.j02", 0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10 - - { "875b04.e05", 0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples - - { "821a08.h14", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms -}; - -STD_ROM_PICK(aliensa) -STD_ROM_FN(aliensa) - -struct BurnDriver BurnDrvAliensa = { - "aliensa", "aliens", NULL, NULL, "1990", - "Aliens (Asia)\0", NULL, "Konami", "GX875", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0, - NULL, aliensaRomInfo, aliensaRomName, NULL, NULL, AliensInputInfo, AliensDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_asterix.cpp b/jan/src/burn/drv/konami/d_asterix.cpp deleted file mode 100644 index a0f282b04..000000000 --- a/jan/src/burn/drv/konami/d_asterix.cpp +++ /dev/null @@ -1,905 +0,0 @@ -// FB Alpha Asterix driver module -// Based on MAME driver by Olivier Galibert - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "konamiic.h" -#include "k053260.h" -#include "eeprom.h" - -static UINT8 *AllMem; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvEeprom; -static UINT8 *AllRam; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 spritebank; - -static INT32 layerpri[3]; -static INT32 layer_colorbase[4]; -static INT32 spritebanks[4]; -static INT32 sprite_colorbase; -static UINT32 tilebanks[4]; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; -static UINT8 DrvDips[1]; - -static INT32 nCyclesDone[2]; - -static UINT16 prot[2]; - -static struct BurnInputInfo AsterixInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 9, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 10, "service" }, - {"Dip", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Asterix) - -static struct BurnDIPInfo AsterixDIPList[]= -{ - {0x12, 0xff, 0xff, 0x04, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Asterix) - -static void protection_write(UINT8 offset, UINT16 data) -{ - offset = (offset / 2) & 1; - - prot[offset] = data; - - if (offset == 1) - { - UINT32 cmd = (prot[0] << 16) | prot[1]; - - switch (cmd >> 24) - { - case 0x64: - { - UINT32 param1 = (SekReadWord((cmd & 0xffffff) + 0) << 16) | SekReadWord((cmd & 0xffffff) + 2); - UINT32 param2 = (SekReadWord((cmd & 0xffffff) + 4) << 16) | SekReadWord((cmd & 0xffffff) + 6); - - switch (param1 >> 24) - { - case 0x22: - { - int size = param2 >> 24; - param1 &= 0xffffff; - param2 &= 0xffffff; - while(size >= 0) - { - SekWriteWord(param2, SekReadWord(param1)); - param1 += 2; - param2 += 2; - size--; - } - break; - } - } - break; - } - } - } -} - -static void reset_spritebank() -{ - K053244BankSelect(0, spritebank & 7); - - spritebanks[0] = (spritebank << 12) & 0x7000; - spritebanks[1] = (spritebank << 9) & 0x7000; - spritebanks[2] = (spritebank << 6) & 0x7000; - spritebanks[3] = (spritebank << 3) & 0x7000; -} - -static void __fastcall asterix_main_write_word(UINT32 address, UINT16 data) -{ -//bprintf (0, _T("WW %5.5x, %4.4x\n"), address, data); - - if ((address & 0xfff000) == 0x400000) { - K056832HalfRamWriteWord(address & 0xfff, data); - return; - } - - if ((address & 0xfffff0) == 0x200000) { - K053244Write(0, (address & 0xe) + 0, data >> 8); - K053244Write(0, (address & 0xe) + 1, data & 0xff); - return; - } - - if ((address & 0xffffe0) == 0x300000) { - K053244Write(0, (address & 0xe) / 2, data & 0xff); - return; - } - - if ((address & 0xfffff8) == 0x380700) { - return; // regsb - } - - if ((address & 0xffffc0) == 0x440000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - switch (address) - { - case 0x380100: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - K056832SetTileBank((data & 0x20) >> 5); - return; - - case 0x380400: - spritebank = data; - reset_spritebank(); - return; - - case 0x380600: - case 0x380601: - return; // nop - - case 0x380800: - case 0x380802: - protection_write(address, data); - return; - } -} - -static void __fastcall asterix_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0x400000) { - K056832HalfRamWriteByte(address & 0xfff, data); - return; - } - - if ((address & 0xfffff0) == 0x200000) { - K053244Write(0, address & 0xf, data); - return; - } - - if ((address & 0xffffe1) == 0x300001) { - K053244Write(0, (address & 0xe) / 2, data); - return; - } - - if ((address & 0xffffe1) == 0x380501) { - K053251Write((address / 2) & 0xf, data); - return; - } - - if ((address & 0xfffff8) == 0x380700) { - return; // regsb - } - - if ((address & 0xffffc0) == 0x440000) { - K056832ByteWrite(address & 0x3f, data); - return; - } - - switch (address) - { - case 0x380101: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - K056832SetTileBank((data & 0x20) >> 5); - return; - - case 0x380201: - case 0x380203: - K053260Write(0, (address / 2) & 1, data); - return; - - case 0x380301: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x380601: - return; // nop - } -} - -static UINT16 __fastcall asterix_main_read_word(UINT32 address) -{ - if ((address & 0xfffff0) == 0x200000) { - return (K053244Read(0, address & 0xe) << 8) | K053244Read(0, (address & 0xe) + 1); - } - - if ((address & 0xffffe0) == 0x300000) { - return K053244Read(0, (address & 0xe)/2); - } - - if ((address & 0xfff000) == 0x400000) { - return K056832HalfRamReadWord(address & 0xfff); - } - - if ((address & 0xffe000) == 0x420000) { - return K056832RomWordRead(address); - } - - switch (address) - { - case 0x380000: - return DrvInputs[0]; - - case 0x380002: - return (DrvInputs[1] & ~0xf900) | (EEPROMRead() ? 0x100 : 0); - } - - return 0; -} - -static UINT8 __fastcall asterix_main_read_byte(UINT32 address) -{ - if ((address & 0xfffff0) == 0x200000) { - return K053244Read(0, address & 0xf); - } - - if ((address & 0xffffe0) == 0x300000) { - return K053244Read(0, (address & 0xe)/2); - } - - if ((address & 0xfff000) == 0x400000) { - return K056832HalfRamReadByte(address & 0xfff); - } - - if ((address & 0xffe000) == 0x420000) { - return K056832RomWordRead(address) >> ((~address & 1) * 8); - } - - switch (address) - { - case 0x380000: - return DrvInputs[0] >> 8; - - case 0x380001: - return DrvInputs[0]; - - case 0x380002: - return ((DrvInputs[1] >> 8) & 0x06) | (EEPROMRead() ? 0x01 : 0); - - case 0x380003: - return DrvInputs[1]; - - case 0x380201: - case 0x380203: - return K053260Read(0, ((address / 2) & 1) + 2); - - case 0x380600: - case 0x380601: - return 0; // nop - } - - return 0; -} - -static void __fastcall asterix_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf801: - BurnYM2151WriteRegister(data); - return; - - case 0xfc00: - nCyclesDone[1] += ZetRun(100); - ZetNmi(); - return; - - case 0xfe00: - BurnYM2151SelectRegister(data); - return; - } - - if (address >= 0xfa00 && address <= 0xfa2f) { - K053260Write(0, address & 0x3f, data); - } -} - -static UINT8 __fastcall asterix_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf801: - return BurnYM2151ReadStatus(); - } - - if (address >= 0xfa00 && address <= 0xfa2f) { - if ((address & 0x3e) == 0x00) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - - return K053260Read(0, address & 0x3f); - } - - return 0; -} -static void asterix_sprite_callback(INT32 *code, INT32 *color, INT32 *priority) -{ - INT32 pri = (*color & 0x00e0) >> 2; - if (pri <= layerpri[2]) *priority = 0; - else if (pri > layerpri[2] && pri <= layerpri[1]) *priority = 0xf0; - else if (pri > layerpri[1] && pri <= layerpri[0]) *priority = 0xfc; - else *priority = 0xfe; - *color = sprite_colorbase | (*color & 0x001f); - *code = (*code & 0xfff) | spritebanks[(*code >> 12) & 3]; -} - -static void asterix_tile_callback(INT32 layer, INT32 *code, INT32 *color, INT32 *flags) -{ - *flags = (*code & 0x1000) ? 1 : 0; - - *color = (layer_colorbase[layer] + ((*code & 0xe000) >> 13)) & 0x7f; - *code = (*code & 0x03ff) | tilebanks[(*code >> 10) & 3]; -} - -static const eeprom_interface asterix_eeprom_interface = -{ - 7, - 8, - "111000", - "111100", - "1100100000000", - "1100000000000", - "1100110000000", - 0, - 0 -}; - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvEeprom, 0, 128); - } - - KonamiICReset(); - - BurnYM2151Reset(); - K053260Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROMExp0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROMExp1 = Next; Next += 0x800000; - - DrvSndROM = Next; Next += 0x200000; - - DrvEeprom = Next; Next += 0x000080; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x008000; - Drv68KRAM1 = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - DrvPalRAM = Next; Next += 0x001000; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane1[4] = { STEP4(24, -8) }; - INT32 XOffs1[16] = { STEP8(0,1), STEP8(256,1) }; - INT32 YOffs1[16] = { STEP8(0,32), STEP8(512,32) }; - - K053247GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x100000); - - GfxDecode(0x8000, 4, 16, 16, Plane1, XOffs1, YOffs1, 128*8, DrvGfxROM1, DrvGfxROMExp1); - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 4, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 10, 1)) return 1; - - DrvGfxDecode(); - } - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x100000, asterix_tile_callback); - K056832SetGlobalOffsets(112, 16); - - K053245Init(0, DrvGfxROM1, DrvGfxROMExp1, 0x3fffff, asterix_sprite_callback); - K053245SetSpriteOffset(0, -115, 15); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x100000, 0x107fff, MAP_RAM); - SekMapMemory(K053245Ram[0], 0x180000, 0x1807ff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x180800, 0x180fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x280000, 0x280fff, MAP_RAM); - SekSetWriteWordHandler(0, asterix_main_write_word); - SekSetWriteByteHandler(0, asterix_main_write_byte); - SekSetReadWordHandler(0, asterix_main_read_word); - SekSetReadByteHandler(0, asterix_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xefff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(asterix_sound_write); - ZetSetReadHandler(asterix_sound_read); - ZetClose(); - - EEPROMInit(&asterix_eeprom_interface); - - BurnYM2151Init(4000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K053260Init(0, 4000000, DrvSndROM, 0x200000); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - SekExit(); - ZetExit(); - - EEPROMExit(); - - BurnYM2151Exit(); - K053260Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x1000/2; i++) - { - INT32 r = (pal[i] & 0x1f); - INT32 g = (pal[i] >> 5) & 0x1f; - INT32 b = (pal[i] >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = (r << 16) + (g << 8) + b; - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - INT32 layer[3]; - - tilebanks[0] = (K056832GetLookup(0) << 10); - tilebanks[1] = (K056832GetLookup(1) << 10); - tilebanks[2] = (K056832GetLookup(2) << 10); - tilebanks[3] = (K056832GetLookup(3) << 10); - - layer_colorbase[0] = K053251GetPaletteIndex(0); - layer_colorbase[1] = K053251GetPaletteIndex(2); - layer_colorbase[2] = K053251GetPaletteIndex(3); - layer_colorbase[3] = K053251GetPaletteIndex(4); - - sprite_colorbase = K053251GetPaletteIndex(1); - - KonamiClearBitmaps(DrvPalette[0]); - - if (K056832ReadRegister(0) & 0x10) - { - K056832SetLayerOffsets(0, 89 - 176, 0); - K056832SetLayerOffsets(1, 91 - 176, 0); - K056832SetLayerOffsets(2, 89 - 176, 0); - K056832SetLayerOffsets(3, 95 - 176, 0); - } - else - { - K056832SetLayerOffsets(0, 89, 0); - K056832SetLayerOffsets(1, 91, 0); - K056832SetLayerOffsets(2, 89, 0); - K056832SetLayerOffsets(3, 95, 0); - } - - layer[0] = 0; - layerpri[0] = K053251GetPriority(0); - layer[1] = 1; - layerpri[1] = K053251GetPriority(2); - layer[2] = 3; - layerpri[2] = K053251GetPriority(4); - - konami_sortlayers3(layer, layerpri); - - if (nBurnLayer & 1) K056832Draw(layer[0], K056832_DRAW_FLAG_MIRROR, 1); - if (nBurnLayer & 2) K056832Draw(layer[1], K056832_DRAW_FLAG_MIRROR, 2); - if (nBurnLayer & 4) K056832Draw(layer[2], K056832_DRAW_FLAG_MIRROR, 4); - - if (nSpriteEnable & 1) K053245SpritesRender(0); - - if (nBurnLayer & 8) K056832Draw(2, K056832_DRAW_FLAG_MIRROR, 0); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0x07ff; - DrvInputs[1] = ((DrvDips[0] & 0x04) << 8) | 0x02ff; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = nBurnSoundLen; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 60, 8000000 / 60 }; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = SekRun(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K056832IsIrqEnabled()) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029732; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K053260Scan(nAction); - - KonamiICScan(nAction); - - SCAN_VAR(prot[0]); - SCAN_VAR(prot[1]); - - SCAN_VAR(spritebank); - } - - if (nAction & ACB_WRITE) { - reset_spritebank(); - } - - EEPROMScan(nAction, pnMin); - - return 0; -} - - -// Asterix (ver EAD) - -static struct BurnRomInfo asterixRomDesc[] = { - { "068_ea_d01.8c", 0x020000, 0x61d6621d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "068_ea_d02.8d", 0x020000, 0x53aac057, 1 | BRF_PRG | BRF_ESS }, // 1 - { "068a03.7c", 0x020000, 0x8223ebdc, 1 | BRF_PRG | BRF_ESS }, // 2 - { "068a04.7d", 0x020000, 0x9f351828, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "068_a05.5f", 0x010000, 0xd3d0d77b, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "068a12.16k", 0x080000, 0xb9da8e9c, 3 | BRF_GRA }, // 5 K056832 Characters - { "068a11.12k", 0x080000, 0x7eb07a81, 3 | BRF_GRA }, // 6 - - { "068a08.7k", 0x200000, 0xc41278fe, 4 | BRF_GRA }, // 7 K053245 Sprites - { "068a07.3k", 0x200000, 0x32efdbc4, 4 | BRF_GRA }, // 8 - - { "068a06.1e", 0x200000, 0x6df9ec0e, 5 | BRF_SND }, // 9 K053260 Samples - - { "asterix.nv", 0x000080, 0x490085c8, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(asterix) -STD_ROM_FN(asterix) - -struct BurnDriver BurnDrvAsterix = { - "asterix", NULL, NULL, NULL, "1992", - "Asterix (ver EAD)\0", NULL, "Konami", "GX068", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, asterixRomInfo, asterixRomName, NULL, NULL, AsterixInputInfo, AsterixDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Asterix (ver EAC) - -static struct BurnRomInfo asterixeacRomDesc[] = { - { "068_ea_c01.8c", 0x020000, 0x0ccd1feb, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "068_ea_c02.8d", 0x020000, 0xb0805f47, 1 | BRF_PRG | BRF_ESS }, // 1 - { "068a03.7c", 0x020000, 0x8223ebdc, 1 | BRF_PRG | BRF_ESS }, // 2 - { "068a04.7d", 0x020000, 0x9f351828, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "068_a05.5f", 0x010000, 0xd3d0d77b, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "068a12.16k", 0x080000, 0xb9da8e9c, 3 | BRF_GRA }, // 5 K056832 Characters - { "068a11.12k", 0x080000, 0x7eb07a81, 3 | BRF_GRA }, // 6 - - { "068a08.7k", 0x200000, 0xc41278fe, 4 | BRF_GRA }, // 7 K053245 Sprites - { "068a07.3k", 0x200000, 0x32efdbc4, 4 | BRF_GRA }, // 8 - - { "068a06.1e", 0x200000, 0x6df9ec0e, 5 | BRF_SND }, // 9 K053260 Samples - - { "asterixeac.nv", 0x000080, 0x490085c8, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(asterixeac) -STD_ROM_FN(asterixeac) - -struct BurnDriver BurnDrvAsterixeac = { - "asterixeac", "asterix", NULL, NULL, "1992", - "Asterix (ver EAC)\0", NULL, "Konami", "GX068", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, asterixeacRomInfo, asterixeacRomName, NULL, NULL, AsterixInputInfo, AsterixDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Asterix (ver EAA) - -static struct BurnRomInfo asterixeaaRomDesc[] = { - { "068_ea_a01.8c", 0x020000, 0x85b41d8e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "068_ea_a02.8d", 0x020000, 0x8e886305, 1 | BRF_PRG | BRF_ESS }, // 1 - { "068a03.7c", 0x020000, 0x8223ebdc, 1 | BRF_PRG | BRF_ESS }, // 2 - { "068a04.7d", 0x020000, 0x9f351828, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "068_a05.5f", 0x010000, 0xd3d0d77b, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "068a12.16k", 0x080000, 0xb9da8e9c, 3 | BRF_GRA }, // 5 K056832 Characters - { "068a11.12k", 0x080000, 0x7eb07a81, 3 | BRF_GRA }, // 6 - - { "068a08.7k", 0x200000, 0xc41278fe, 4 | BRF_GRA }, // 7 K053245 Sprites - { "068a07.3k", 0x200000, 0x32efdbc4, 4 | BRF_GRA }, // 8 - - { "068a06.1e", 0x200000, 0x6df9ec0e, 5 | BRF_SND }, // 9 K053260 Samples - - { "asterixeaa.nv", 0x000080, 0x30275de0, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(asterixeaa) -STD_ROM_FN(asterixeaa) - -struct BurnDriver BurnDrvAsterixeaa = { - "asterixeaa", "asterix", NULL, NULL, "1992", - "Asterix (ver EAA)\0", NULL, "Konami", "GX068", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, asterixeaaRomInfo, asterixeaaRomName, NULL, NULL, AsterixInputInfo, AsterixDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Asterix (ver AAD) - -static struct BurnRomInfo asterixaadRomDesc[] = { - { "068_aa_d01.8c", 0x020000, 0x3fae5f1f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "068_aa_d02.8d", 0x020000, 0x171f0ba0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "068a03.7c", 0x020000, 0x8223ebdc, 1 | BRF_PRG | BRF_ESS }, // 2 - { "068a04.7d", 0x020000, 0x9f351828, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "068_a05.5f", 0x010000, 0xd3d0d77b, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "068a12.16k", 0x080000, 0xb9da8e9c, 3 | BRF_GRA }, // 5 K056832 Characters - { "068a11.12k", 0x080000, 0x7eb07a81, 3 | BRF_GRA }, // 6 - - { "068a08.7k", 0x200000, 0xc41278fe, 4 | BRF_GRA }, // 7 K053245 Sprites - { "068a07.3k", 0x200000, 0x32efdbc4, 4 | BRF_GRA }, // 8 - - { "068a06.1e", 0x200000, 0x6df9ec0e, 5 | BRF_SND }, // 9 K053260 Samples - - { "asterixaad.nv", 0x000080, 0xbcca86a7, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(asterixaad) -STD_ROM_FN(asterixaad) - -struct BurnDriver BurnDrvAsterixaad = { - "asterixaad", "asterix", NULL, NULL, "1992", - "Asterix (ver AAD)\0", NULL, "Konami", "GX068", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, asterixaadRomInfo, asterixaadRomName, NULL, NULL, AsterixInputInfo, AsterixDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Asterix (ver JAD) - -static struct BurnRomInfo asterixjRomDesc[] = { - { "068_ja_d01.8c", 0x020000, 0x2bc10940, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "068_ja_d02.8d", 0x020000, 0xde438300, 1 | BRF_PRG | BRF_ESS }, // 1 - { "068a03.7c", 0x020000, 0x8223ebdc, 1 | BRF_PRG | BRF_ESS }, // 2 - { "068a04.7d", 0x020000, 0x9f351828, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "068_a05.5f", 0x010000, 0xd3d0d77b, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "068a12.16k", 0x080000, 0xb9da8e9c, 3 | BRF_GRA }, // 5 K056832 Characters - { "068a11.12k", 0x080000, 0x7eb07a81, 3 | BRF_GRA }, // 6 - - { "068a08.7k", 0x200000, 0xc41278fe, 4 | BRF_GRA }, // 7 K053245 Sprites - { "068a07.3k", 0x200000, 0x32efdbc4, 4 | BRF_GRA }, // 8 - - { "068a06.1e", 0x200000, 0x6df9ec0e, 5 | BRF_SND }, // 9 K053260 Samples - - { "asterixj.nv", 0x000080, 0x84229f2c, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(asterixj) -STD_ROM_FN(asterixj) - -struct BurnDriver BurnDrvAsterixj = { - "asterixj", "asterix", NULL, NULL, "1992", - "Asterix (ver JAD)\0", NULL, "Konami", "GX068", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, asterixjRomInfo, asterixjRomName, NULL, NULL, AsterixInputInfo, AsterixDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_battlnts.cpp b/jan/src/burn/drv/konami/d_battlnts.cpp deleted file mode 100644 index 45673a0ae..000000000 --- a/jan/src/burn/drv/konami/d_battlnts.cpp +++ /dev/null @@ -1,775 +0,0 @@ -// FB Alpha Battlantis driver module -// Based on MAME driver by Manuel Abadia - -#include "tiles_generic.h" -#include "hd6309_intf.h" -#include "z80_intf.h" -#include "k007342_k007420.h" -#include "burn_ym3812.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvHD6309ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; - -static UINT8 HD6309Bank; -static UINT8 soundlatch; -static INT32 spritebank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[4]; -static UINT8 DrvReset; - -static UINT8 DrvInputs[3]; - -static INT32 watchdog; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo BattlntsDIPList[]= -{ - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0xe0, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x5a, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x10, 0x01, 0x80, 0x80, "3 Times" }, - {0x10, 0x01, 0x80, 0x00, "5 Times" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x11, 0x01, 0x40, 0x40, "Single" }, - {0x11, 0x01, 0x40, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Free Play" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, ":1,2,3,4" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "30k And Every 70k" }, - {0x13, 0x01, 0x18, 0x10, "40k And Every 80k" }, - {0x13, 0x01, 0x18, 0x08, "40k" }, - {0x13, 0x01, 0x18, 0x00, "50k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Battlnts) - -static struct BurnDIPInfo RackemupDIPList[]= -{ - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0xe0, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x52, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x10, 0x01, 0x80, 0x80, "3 Times" }, - {0x10, 0x01, 0x80, 0x00, "5 Times" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x11, 0x01, 0x40, 0x40, "Single" }, - {0x11, 0x01, 0x40, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Free Play" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, ":1,2,3,4" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Balls" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Time To Aim" }, - {0x13, 0x01, 0x18, 0x18, "25s (Stage 1: 30s)" }, - {0x13, 0x01, 0x18, 0x10, "20s (Stage 1: 25s)" }, - {0x13, 0x01, 0x18, 0x08, "17s (Stage 1: 22s)" }, - {0x13, 0x01, 0x18, 0x00, "15s (Stage 1: 20s)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Rackemup) - -static void bankswitch(INT32 bank) -{ - HD6309Bank = bank; - HD6309MapMemory(DrvHD6309ROM + 0x10000 + ((bank >> 6) * 0x4000), 0x4000, 0x7fff, MAP_ROM); -} - -static void battlnts_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff8) == 0x2600) { - K007342Regs[0][address & 7] = data; - return; - } - - switch (address) - { - case 0x2e08: - bankswitch(data); - return; - - case 0x2e0c: - spritebank = (data & 0x01) * 0x400; - return; - - case 0x2e10: - watchdog = 0; - return; - - case 0x2e14: - soundlatch = data; - return; - - case 0x2e18: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -static UINT8 battlnts_main_read(UINT16 address) -{ - switch (address) - { - case 0x2e00: - return DrvDips[2]; - - case 0x2e01: - return DrvInputs[1]; - - case 0x2e02: - return (DrvInputs[0] & 0x7f) | (DrvDips[0] & 0x80); - - case 0x2e03: - return (DrvInputs[2] & 0x1f) | (DrvDips[1] & 0xe0); - - case 0x2e04: - return DrvDips[3]; - } - - return 0; -} - -static void __fastcall battlnts_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - BurnYM3812Write(0, address & 1, data); - return; - - case 0xc000: - case 0xc001: - BurnYM3812Write(1, address & 1, data); - return; - } -} - -static UINT8 __fastcall battlnts_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - case 0xa001: - return BurnYM3812Read(0, address & 1); - - case 0xc000: - case 0xc001: - return BurnYM3812Read(1, address & 1); - - case 0xe000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static void battlnts_tile_callback(INT32 /*layer*/, INT32 /*bank*/, INT32 *code, INT32 *color, INT32 */*flags*/) -{ - *code |= ((*color & 0x0f) << 9) | ((*color & 0x40) << 2); - *color = 0; -} - -static void battlnts_sprite_callback(INT32 *code, INT32 *color) -{ - *code |= ((*color & 0xc0) << 2) | spritebank; - *code = (*code << 2) | ((*color & 0x30) >> 4); - *color = 4; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - ZetOpen(0); - ZetReset(); - BurnYM3812Reset(); - ZetClose(); - - HD6309Bank = 0; - soundlatch = 0; - spritebank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvHD6309ROM = Next; Next += 0x020000; - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x80 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000100; - - K007342VidRAM[0] = Next; Next += 0x002000; - K007342ScrRAM[0] = Next; Next += 0x000200; - - K007420RAM[0] = Next; Next += 0x000200; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *src, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i-=2) { - src[i+0] = src[i/2] >> 4; - src[i+1] = src[i/2] & 0xf; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvHD6309ROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvHD6309ROM + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - BurnByteswap(DrvGfxROM0, 0x40000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - - DrvGfxExpand(DrvGfxROM0, 0x40000); - DrvGfxExpand(DrvGfxROM1, 0x40000); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(K007342VidRAM[0], 0x0000, 0x1fff, MAP_RAM); - HD6309MapMemory(K007420RAM[0], 0x2000, 0x21ff, MAP_RAM); - HD6309MapMemory(K007342ScrRAM[0], 0x2200, 0x23ff, MAP_RAM); - HD6309MapMemory(DrvPalRAM, 0x2400, 0x24ff, MAP_RAM); - HD6309MapMemory(DrvHD6309ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(battlnts_main_write); - HD6309SetReadHandler(battlnts_main_read); - HD6309Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(battlnts_sound_write); - ZetSetReadHandler(battlnts_sound_read); - ZetClose(); - - K007342Init(DrvGfxROM0, battlnts_tile_callback); - K007342SetOffsets(0, 16); - - K007420Init(0x3ff, battlnts_sprite_callback); - K007420SetOffsets(0, 16); - - BurnYM3812Init(2, 3000000, NULL, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM3812SetRoute(1, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - HD6309Exit(); - - BurnYM3812Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x100 / 2; i++) { - UINT16 p = (pal[i] << 8) | (pal[i] >> 8); - INT32 r = (p & 0x1f); - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 1; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) K007342DrawLayer(0, 0 | K007342_OPAQUE, 0); - if (nSpriteEnable & 1) K007420DrawSprites(DrvGfxROM1); - if (nBurnLayer & 2) K007342DrawLayer(0, 1 | K007342_OPAQUE, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (DrvReset) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 12000000 / 4 / 60, 4000000 / 60 }; // hd6309 has internal divider - - HD6309Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - - HD6309Run(nCyclesTotal[0] / nInterleave); - - if (i == 248 && K007342_irq_enabled()) HD6309SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - HD6309Close(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - HD6309Scan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - SCAN_VAR(HD6309Bank); - SCAN_VAR(soundlatch); - SCAN_VAR(spritebank); - } - - if (nAction & ACB_WRITE) { - HD6309Open(0); - bankswitch(HD6309Bank); - HD6309Close(); - } - - return 0; -} - - -// Battlantis (program code G) - -static struct BurnRomInfo battlntsRomDesc[] = { - { "777_g02.7e", 0x08000, 0xdbd8e17e, 1 }, // 0 HD6309 Code - { "777_g03.8e", 0x10000, 0x7bd44fef, 1 }, // 1 - - { "777_c01.10a", 0x08000, 0xc21206e9, 2 }, // 2 Z80 Code - - { "777c04.13a", 0x40000, 0x45d92347, 3 }, // 3 Tiles - - { "777c05.13e", 0x40000, 0xaeee778c, 4 }, // 4 Sprites -}; - -STD_ROM_PICK(battlnts) -STD_ROM_FN(battlnts) - -struct BurnDriver BurnDrvBattlnts = { - "battlnts", NULL, NULL, NULL, "1987", - "Battlantis (program code G)\0", NULL, "Konami", "GX777", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, battlntsRomInfo, battlntsRomName, NULL, NULL, DrvInputInfo, BattlntsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 224, 256, 3, 4 -}; - - -// Battlantis (program code F) - -static struct BurnRomInfo battlntsaRomDesc[] = { - { "777_f02.7e", 0x08000, 0x9f1dc5c1, 1 }, // 0 HD6309 Code - { "777_f03.8e", 0x10000, 0x040d00bf, 1 }, // 1 - - { "777_c01.10a", 0x08000, 0xc21206e9, 2 }, // 2 Z80 Code - - { "777c04.13a", 0x40000, 0x45d92347, 3 }, // 3 Tiles - - { "777c05.13e", 0x40000, 0xaeee778c, 4 }, // 4 Sprites -}; - -STD_ROM_PICK(battlntsa) -STD_ROM_FN(battlntsa) - -struct BurnDriver BurnDrvBattlntsa = { - "battlntsa", "battlnts", NULL, NULL, "1987", - "Battlantis (program code F)\0", NULL, "Konami", "GX777", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, battlntsaRomInfo, battlntsaRomName, NULL, NULL, DrvInputInfo, BattlntsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 224, 256, 3, 4 -}; - - -// Battlantis (Japan, program code E) - -static struct BurnRomInfo battlntsjRomDesc[] = { - { "777_e02.7e", 0x08000, 0xd631cfcb, 1 }, // 0 HD6309 Code - { "777_e03.8e", 0x10000, 0x5ef1f4ef, 1 }, // 1 - - { "777_c01.10a", 0x08000, 0xc21206e9, 2 }, // 2 Z80 Code - - { "777c04.13a", 0x40000, 0x45d92347, 3 }, // 3 Tiles - - { "777c05.13e", 0x40000, 0xaeee778c, 4 }, // 4 Sprites -}; - -STD_ROM_PICK(battlntsj) -STD_ROM_FN(battlntsj) - -struct BurnDriver BurnDrvBattlntsj = { - "battlntsj", "battlnts", NULL, NULL, "1987", - "Battlantis (Japan, program code E)\0", NULL, "Konami", "GX777", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, battlntsjRomInfo, battlntsjRomName, NULL, NULL, DrvInputInfo, BattlntsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 224, 256, 3, 4 -}; - - -// Rack 'em Up (program code L) - -static struct BurnRomInfo rackemupRomDesc[] = { - { "765_l02.7e", 0x08000, 0x3dfc48bd, 1 }, // 0 HD6309 Code - { "765_j03.8e", 0x10000, 0xa13fd751, 1 }, // 1 - - { "765_j01.10a", 0x08000, 0x77ae753e, 2 }, // 2 Z80 Code - - { "765_l04.13a", 0x40000, 0xd8fb9c64, 3 }, // 3 Tiles - - { "765_l05.13e", 0x40000, 0x1bb6855f, 4 }, // 4 Sprites -}; - -STD_ROM_PICK(rackemup) -STD_ROM_FN(rackemup) - -struct BurnDriver BurnDrvRackemup = { - "rackemup", NULL, NULL, NULL, "1987", - "Rack 'em Up (program code L)\0", NULL, "Konami", "GX765", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, rackemupRomInfo, rackemupRomName, NULL, NULL, DrvInputInfo, RackemupDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 224, 256, 3, 4 -}; - - -// The Hustler (Japan, program code M) - -static struct BurnRomInfo thehustlRomDesc[] = { - { "765_m02.7e", 0x08000, 0x934807b9, 1 }, // 0 HD6309 Code - { "765_j03.8e", 0x10000, 0xa13fd751, 1 }, // 1 - - { "765_j01.10a", 0x08000, 0x77ae753e, 2 }, // 2 Z80 Code - - { "765_e04.13a", 0x40000, 0x08c2b72e, 3 }, // 3 Tiles - - { "765_e05.13e", 0x40000, 0xef044655, 4 }, // 4 Sprites -}; - -STD_ROM_PICK(thehustl) -STD_ROM_FN(thehustl) - -struct BurnDriver BurnDrvThehustl = { - "thehustl", "rackemup", NULL, NULL, "1987", - "The Hustler (Japan, program code M)\0", NULL, "Konami", "GX765", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, thehustlRomInfo, thehustlRomName, NULL, NULL, DrvInputInfo, RackemupDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 224, 256, 3, 4 -}; - - -// The Hustler (Japan, program code J) - -static struct BurnRomInfo thehustljRomDesc[] = { - { "765_j02.7e", 0x08000, 0x2ac14c75, 1 }, // 0 HD6309 Code - { "765_j03.8e", 0x10000, 0xa13fd751, 1 }, // 1 - - { "765_j01.10a", 0x08000, 0x77ae753e, 2 }, // 2 Z80 Code - - { "765_e04.13a", 0x40000, 0x08c2b72e, 3 }, // 3 gfx1 - - { "765_e05.13e", 0x40000, 0xef044655, 4 }, // 4 gfx2 -}; - -STD_ROM_PICK(thehustlj) -STD_ROM_FN(thehustlj) - -struct BurnDriver BurnDrvThehustlj = { - "thehustlj", "rackemup", NULL, NULL, "1987", - "The Hustler (Japan, program code J)\0", NULL, "Konami", "GX765", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, thehustljRomInfo, thehustljRomName, NULL, NULL, DrvInputInfo, RackemupDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_bishi.cpp b/jan/src/burn/drv/konami/d_bishi.cpp deleted file mode 100644 index c0d0f7647..000000000 --- a/jan/src/burn/drv/konami/d_bishi.cpp +++ /dev/null @@ -1,771 +0,0 @@ -// FB Alpha Bishi Bashi driver module -// Based on MAME driver by R. Belmont - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "konamiic.h" -#include "ymz280b.h" - -static UINT8 *AllMem; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvGfxROMExp; -static UINT8 *AllRam; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 layerpri[4]; -static INT32 layer_colorbase[4]; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; -static UINT8 DrvDips[3]; - -static UINT16 control_data = 0; -static UINT16 control_data2 = 0; - -static struct BurnInputInfo BishiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 11, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 8, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 9, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 10, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 15, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3" }, - - {"P3 Start", BIT_DIGITAL, DrvJoy2 + 3, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy2 + 2, "p3 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Bishi) - -static struct BurnInputInfo Bishi2pInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 11, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 8, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 9, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 10, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 3, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Bishi2p) - -static struct BurnDIPInfo BishiDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x40, NULL }, - {0x10, 0xff, 0xff, 0xec, NULL }, - {0x11, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x10, 0x01, 0x07, 0x07, "Easiest" }, - {0x10, 0x01, 0x07, 0x06, "Very Easy" }, - {0x10, 0x01, 0x07, 0x05, "Easy" }, - {0x10, 0x01, 0x07, 0x04, "Medium" }, - {0x10, 0x01, 0x07, 0x03, "Medium Hard" }, - {0x10, 0x01, 0x07, 0x02, "Hard" }, - {0x10, 0x01, 0x07, 0x01, "Very Hard" }, - {0x10, 0x01, 0x07, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Lives" }, - {0x10, 0x01, 0x38, 0x38, "1" }, - {0x10, 0x01, 0x38, 0x30, "2" }, - {0x10, 0x01, 0x38, 0x28, "3" }, - {0x10, 0x01, 0x38, 0x20, "4" }, - {0x10, 0x01, 0x38, 0x18, "5" }, - {0x10, 0x01, 0x38, 0x10, "6" }, - {0x10, 0x01, 0x38, 0x08, "7" }, - {0x10, 0x01, 0x38, 0x00, "8" }, - - {0 , 0xfe, 0 , 4, "Demo Sounds" }, - {0x10, 0x01, 0xc0, 0xc0, "All The Time" }, - {0x10, 0x01, 0xc0, 0x80, "Loop At 2 Times" }, - {0x10, 0x01, 0xc0, 0x40, "Loop At 4 Times" }, - {0x10, 0x01, 0xc0, 0x00, "No Sounds" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x11, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x11, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0f, 0x00, "4 Coins 5 Credits" }, - {0x11, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x11, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x10, 0x10, "No" }, - {0x11, 0x01, 0x10, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Slack Difficulty" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Title Demo" }, - {0x11, 0x01, 0x40, 0x40, "At 1 Loop" }, - {0x11, 0x01, 0x40, 0x00, "At Every Gamedemo" }, - - {0 , 0xfe, 0 , 2, "Gamedemo" }, - {0x11, 0x01, 0x80, 0x80, "4 Kinds" }, - {0x11, 0x01, 0x80, 0x00, "7 Kinds" }, -}; - -STDDIPINFO(Bishi) - -static struct BurnDIPInfo Bishi2pDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x40, NULL }, - {0x0c, 0xff, 0xff, 0xec, NULL }, - {0x0d, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x40, 0x40, "Off" }, - {0x0b, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x0c, 0x01, 0x07, 0x07, "Easiest" }, - {0x0c, 0x01, 0x07, 0x06, "Very Easy" }, - {0x0c, 0x01, 0x07, 0x05, "Easy" }, - {0x0c, 0x01, 0x07, 0x04, "Medium" }, - {0x0c, 0x01, 0x07, 0x03, "Medium Hard" }, - {0x0c, 0x01, 0x07, 0x02, "Hard" }, - {0x0c, 0x01, 0x07, 0x01, "Very Hard" }, - {0x0c, 0x01, 0x07, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Lives" }, - {0x0c, 0x01, 0x38, 0x38, "1" }, - {0x0c, 0x01, 0x38, 0x30, "2" }, - {0x0c, 0x01, 0x38, 0x28, "3" }, - {0x0c, 0x01, 0x38, 0x20, "4" }, - {0x0c, 0x01, 0x38, 0x18, "5" }, - {0x0c, 0x01, 0x38, 0x10, "6" }, - {0x0c, 0x01, 0x38, 0x08, "7" }, - {0x0c, 0x01, 0x38, 0x00, "8" }, - - {0 , 0xfe, 0 , 4, "Demo Sounds" }, - {0x0c, 0x01, 0xc0, 0xc0, "All The Time" }, - {0x0c, 0x01, 0xc0, 0x80, "Loop At 2 Times" }, - {0x0c, 0x01, 0xc0, 0x40, "Loop At 4 Times" }, - {0x0c, 0x01, 0xc0, 0x00, "No Sounds" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x0d, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x0d, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x0d, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x0d, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x0d, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x0f, 0x00, "4 Coins 5 Credits" }, - {0x0d, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x0d, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x0d, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x0d, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x0d, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x0d, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0d, 0x01, 0x10, 0x10, "No" }, - {0x0d, 0x01, 0x10, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Slack Difficulty" }, - {0x0d, 0x01, 0x20, 0x20, "Off" }, - {0x0d, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Title Demo" }, - {0x0d, 0x01, 0x40, 0x40, "At 1 Loop" }, - {0x0d, 0x01, 0x40, 0x00, "At Every Gamedemo" }, - - {0 , 0xfe, 0 , 2, "Gamedemo" }, - {0x0d, 0x01, 0x80, 0x80, "4 Kinds" }, - {0x0d, 0x01, 0x80, 0x00, "7 Kinds" }, -}; - -STDDIPINFO(Bishi2p) - -static void __fastcall bishi_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffc0) == 0x830000) { - K056832WordWrite(address, data); - return; - } - - if ((address & 0xfffff8) == 0x840000) { - return; // regb - } - - if ((address & 0xffffe0) == 0x850000) { - K054338WriteWord(address, data); - return; - } - - if ((address & 0xffff00) == 0x870000) { - K055555WordWrite(address, data); - return; - } - - if ((address & 0xffe000) == 0xa00000) { - K056832RamWriteWord(address & 0x1fff, data); - return; - } - - switch (address) - { - case 0x800000: - control_data = data; - return; - - case 0x810000: - control_data2 = data; - return; - - case 0x880000: - case 0x880002: - YMZ280BWrite((address/2)&1, data); - return; - } -} - -static void __fastcall bishi_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffffc0) == 0x830000) { - K056832ByteWrite(address, data); - return; - } - - if ((address & 0xfffff8) == 0x840000) { - return; // regb - } - - if ((address & 0xffffe0) == 0x850000) { - K054338WriteByte(address, data); - return; - } - - if ((address & 0xffff00) == 0x870000) { - K055555ByteWrite(address, data); - return; - } - - if ((address & 0xffe000) == 0xa00000) { - K056832RamWriteByte(address & 0x1fff, data); - return; - } - - switch (address) - { - case 0x800000: - control_data = (control_data & 0x00ff) | (data << 8); - return; - - case 0x800001: - control_data = (control_data & 0xff00) | (data << 0); - return; - - case 0x810000: - case 0x810001: - control_data2 = data; - return; - - case 0x880000: - case 0x880002: - YMZ280BWrite((address/2)&1, data); - return; - } -} - -static UINT16 __fastcall bishi_read_word(UINT32 address) -{ - if ((address & 0xffe000) == 0xa00000) { - return K056832RamReadWord(address & 0x1fff); - } - - switch (address) - { - case 0x800000: - case 0x800001: - return control_data; - - case 0x800004: - case 0x800005: - return (DrvDips[2] << 8) + DrvDips[1]; - - case 0x800006: - case 0x800007: - return DrvInputs[0]; - - case 0x800008: - case 0x800009: - return DrvInputs[1]; - - case 0x880000: - case 0x880002: - return YMZ280BRead((address/2)&1); - } - - return 0; -} - -static UINT8 __fastcall bishi_read_byte(UINT32 address) -{ - if ((address & 0xffe000) == 0xa00000) { - return K056832RamReadByte(address & 0x1fff); - } - - switch (address) - { - case 0x800000: - case 0x800001: - return control_data >> ((~address & 1) * 8); - - case 0x800004: - case 0x800005: - return DrvDips[(address & 1)+1]; - - case 0x800006: - return DrvInputs[0] >> 8; - - case 0x800007: - return DrvInputs[0]; - - case 0x800008: - return DrvInputs[1] >> 8; - - case 0x800009: - return DrvInputs[1]; - - case 0x880000: - case 0x880001: - case 0x880002: - case 0x880003: - return YMZ280BRead((address/2)&1); - } - - return 0; -} - -static void bishi_tile_callback(INT32 layer, INT32 *code, INT32 *color, INT32 */*flags*/) -{ - *color = layer_colorbase[layer] + ((*color & 0xf0)); - *code &= 0x7fff; -} - -static void bishi_sound_irq(INT32 status) -{ - SekSetIRQLine(1, (status) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - KonamiICReset(); - - YMZ280BReset(); - - for (INT32 i = 0; i < 4; i++) - layer_colorbase[i] = i << 6; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - - DrvGfxROM = Next; Next += 0x200000; - DrvGfxROMExp = Next; Next += 0x200000; - - YMZ280BROM = Next; Next += 0x200000; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x008000; - DrvPalRAM = Next; Next += 0x004000; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[8] = { 8*7,8*3,8*5,8*1,8*6,8*2,8*4,8*0 }; - INT32 XOffs[8] = { STEP8(0,1) }; - INT32 YOffs[8] = { STEP8(0,64) }; - - GfxDecode(0x8000, 8, 8, 8, Plane, XOffs, YOffs, 8*8*8, DrvGfxROM, DrvGfxROMExp); - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 1)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x000001, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100001, 5, 2)) return 1; - - if (BurnLoadRom(YMZ280BROM + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(YMZ280BROM + 0x080000, 7, 1)) return 1; - if (BurnLoadRom(YMZ280BROM + 0x100000, 8, 1)) return 1; - if (BurnLoadRom(YMZ280BROM + 0x180000, 9, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x400000, 0x407fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xb00000, 0xb03fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xb04000, 0xb047ff, MAP_ROM); - SekSetWriteWordHandler(0, bishi_write_word); - SekSetWriteByteHandler(0, bishi_write_byte); - SekSetReadWordHandler(0, bishi_read_word); - SekSetReadByteHandler(0, bishi_read_byte); - SekClose(); - - K055555Init(); - K054338Init(); - - K056832Init(DrvGfxROM, DrvGfxROMExp, 0x200000, bishi_tile_callback); - K056832SetGlobalOffsets(29, 16); - K056832SetLayerOffsets(0, -2, 0); - K056832SetLayerOffsets(1, 2, 0); - K056832SetLayerOffsets(2, 4, 0); - K056832SetLayerOffsets(3, 6, 0); - K056832SetLayerAssociation(0); - - YMZ280BInit(16934400, bishi_sound_irq); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - SekExit(); - - YMZ280BExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x4000/2; i+=2) { - UINT32 p = (pal[i] << 16) | (pal[i+1]); - - UINT8 r = p & 0xff; - UINT8 g = p >> 8; - UINT8 b = p >> 16; - - DrvPalette[i/2] = (r << 16) | (g << 8) | b; - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - INT32 layers[4]; - static const INT32 pris[4] = { K55_PRIINP_0, K55_PRIINP_3, K55_PRIINP_6, K55_PRIINP_7 }; - static const INT32 enables[4] = { K55_INP_VRAM_A, K55_INP_VRAM_B, K55_INP_VRAM_C, K55_INP_VRAM_D }; - - KonamiClearBitmaps(0); - - K054338_fill_solid_bg(); - - for (INT32 i = 0; i < 4; i++) - { - layers[i] = i; - layerpri[i] = K055555ReadRegister(pris[i]); - } - - konami_sortlayers4(layers, layerpri); - - for (INT32 i = 0; i < 4; i++) - { - if (K055555ReadRegister(K55_INPUT_ENABLES) & enables[layers[i]]) - { - if (nBurnLayer & (1 << i)) K056832Draw(layers[i], 0, 1 << i); - } - } - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[1] = { 12000000 / 60 }; - INT32 nCyclesDone[1] = { 0 }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - if (control_data & 0x800) { - if (i == 0) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 240) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - - } - } - - if (pBurnSoundOut) { - YMZ280BRender(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029732; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - - YMZ280BScan(); - - KonamiICScan(nAction); - - SCAN_VAR(control_data); - SCAN_VAR(control_data2); - } - - return 0; -} - - -// Bishi Bashi Championship Mini Game Senshuken (ver JAA, 3 Players) - -static struct BurnRomInfo bishiRomDesc[] = { - { "575jaa05.12e", 0x80000, 0x7d354567, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "575jaa06.15e", 0x80000, 0x9b2f7fbb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "575jaa07.14n", 0x80000, 0x37bbf387, 2 | BRF_GRA }, // 2 K056832 Characters - { "575jaa08.17n", 0x80000, 0x47ecd559, 2 | BRF_GRA }, // 3 - { "575jaa09.19n", 0x80000, 0xc1db6e68, 2 | BRF_GRA }, // 4 - { "575jaa10.22n", 0x80000, 0xc8b145d6, 2 | BRF_GRA }, // 5 - - { "575jaa01.2f", 0x80000, 0xe1e9f7b2, 3 | BRF_SND }, // 6 YMZ280b Samples - { "575jaa02.4f", 0x80000, 0xd228eb06, 3 | BRF_SND }, // 7 - { "575jaa03.6f", 0x80000, 0x9ec0321f, 3 | BRF_SND }, // 8 - { "575jaa04.8f", 0x80000, 0x0120967f, 3 | BRF_SND }, // 9 -}; - -STD_ROM_PICK(bishi) -STD_ROM_FN(bishi) - -struct BurnDriver BurnDrvBishi = { - "bishi", NULL, NULL, NULL, "1996", - "Bishi Bashi Championship Mini Game Senshuken (ver JAA, 3 Players)\0", "Imperfect gfx (one gfx rom bad, bad priorities)", "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, bishiRomInfo, bishiRomName, NULL, NULL, BishiInputInfo, BishiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Super Bishi Bashi Championship (ver JAA, 2 Players) - -static struct BurnRomInfo sbishiRomDesc[] = { - { "675jaa05.12e", 0x80000, 0x28a09c01, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "675jaa06.15e", 0x80000, 0xe4998b33, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "675jaa07.14n", 0x80000, 0x6fe7c658, 2 | BRF_GRA }, // 2 K056832 Characters - { "675jaa08.17n", 0x80000, 0xc230afc9, 2 | BRF_GRA }, // 3 - { "675jaa09.19n", 0x80000, 0x63fe85a5, 2 | BRF_GRA }, // 4 - { "675jaa10.22n", 0x80000, 0x703ac462, 2 | BRF_GRA }, // 5 - - { "675jaa01.2f", 0x80000, 0x67910b15, 3 | BRF_SND }, // 6 YMZ280b Samples - { "675jaa02.4f", 0x80000, 0x3313a7ae, 3 | BRF_SND }, // 7 - { "675jaa03.6f", 0x80000, 0xec977e6a, 3 | BRF_SND }, // 8 - { "675jaa04.8f", 0x80000, 0x1d1de34e, 3 | BRF_SND }, // 9 -}; - -STD_ROM_PICK(sbishi) -STD_ROM_FN(sbishi) - -struct BurnDriver BurnDrvSbishi = { - "sbishi", NULL, NULL, NULL, "1998", - "Super Bishi Bashi Championship (ver JAA, 2 Players)\0", "Imperfect gfx (bad priorities)", "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, sbishiRomInfo, sbishiRomName, NULL, NULL, Bishi2pInputInfo, Bishi2pDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Super Bishi Bashi Championship (ver KAB, 3 Players) - -static struct BurnRomInfo sbishikRomDesc[] = { - { "kab05.12e", 0x80000, 0x749063ca, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "kab06.15e", 0x80000, 0x089e0f37, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "675kaa07.14n", 0x80000, 0x1177c1f8, 2 | BRF_GRA }, // 2 K056832 Characters - { "675kaa08.17n", 0x80000, 0x7117e9cd, 2 | BRF_GRA }, // 3 - { "675kaa09.19n", 0x80000, 0x8d49c765, 2 | BRF_GRA }, // 4 - { "675kaa10.22n", 0x80000, 0xc16acf32, 2 | BRF_GRA }, // 5 - - { "675kaa01.2f", 0x80000, 0x73ac6ae6, 3 | BRF_SND }, // 6 YMZ280b Samples - { "675kaa02.4f", 0x80000, 0x4c341e7c, 3 | BRF_SND }, // 7 - { "675kaa03.6f", 0x80000, 0x83f91beb, 3 | BRF_SND }, // 8 - { "675kaa04.8f", 0x80000, 0xebcbd813, 3 | BRF_SND }, // 9 -}; - -STD_ROM_PICK(sbishik) -STD_ROM_FN(sbishik) - -struct BurnDriver BurnDrvSbishik = { - "sbishik", "sbishi", NULL, NULL, "1998", - "Super Bishi Bashi Championship (ver KAB, 3 Players)\0", "Imperfect gfx (bad priorities)", "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, sbishikRomInfo, sbishikRomName, NULL, NULL, BishiInputInfo, BishiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Super Bishi Bashi Championship (ver KAA, 3 Players) - -static struct BurnRomInfo sbishikaRomDesc[] = { - { "675kaa05.12e", 0x80000, 0x23600e1d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "675kaa06.15e", 0x80000, 0xbd1091f5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "675kaa07.14n", 0x80000, 0x1177c1f8, 2 | BRF_GRA }, // 2 K056832 Characters - { "675kaa08.17n", 0x80000, 0x7117e9cd, 2 | BRF_GRA }, // 3 - { "675kaa09.19n", 0x80000, 0x8d49c765, 2 | BRF_GRA }, // 4 - { "675kaa10.22n", 0x80000, 0xc16acf32, 2 | BRF_GRA }, // 5 - - { "675kaa01.2f", 0x80000, 0x73ac6ae6, 3 | BRF_SND }, // 6 YMZ280b Samples - { "675kaa02.4f", 0x80000, 0x4c341e7c, 3 | BRF_SND }, // 7 - { "675kaa03.6f", 0x80000, 0x83f91beb, 3 | BRF_SND }, // 8 - { "675kaa04.8f", 0x80000, 0xebcbd813, 3 | BRF_SND }, // 9 -}; - -STD_ROM_PICK(sbishika) -STD_ROM_FN(sbishika) - -struct BurnDriver BurnDrvSbishika = { - "sbishika", "sbishi", NULL, NULL, "1998", - "Super Bishi Bashi Championship (ver KAA, 3 Players)\0", "Imperfect gfx (bad priorities)", "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, sbishikaRomInfo, sbishikaRomName, NULL, NULL, BishiInputInfo, BishiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_bladestl.cpp b/jan/src/burn/drv/konami/d_bladestl.cpp deleted file mode 100644 index c49997dff..000000000 --- a/jan/src/burn/drv/konami/d_bladestl.cpp +++ /dev/null @@ -1,718 +0,0 @@ -// FB Alpha Blades of Steel driver module -// Based on MAME driver by Manuel Abadia - -// Needs trackball hooked up - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "hd6309_intf.h" -#include "burn_ym2203.h" -#include "upd7759.h" -#include "k007342_k007420.h" -#include "konamiic.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvHD6309ROM; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvUpdROM; -static UINT8 *DrvLutPROM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *DrvHD6309RAM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvPalRAM; - -static UINT8 HD6309Bank; -static UINT8 soundlatch; -static INT32 spritebank; -static UINT8 soundbank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[9]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[4]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; -static INT32 DrvAnalog0 = 0; -static INT32 DrvAnalog1 = 0; -static INT32 DrvAnalog2 = 0; -static INT32 DrvAnalog3 = 0; - -static INT32 watchdog; - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo BladestlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - A("P1 Trackball X", BIT_ANALOG_REL, &DrvAnalog0, "mouse x-axis" ), - A("P1 Trackball Y", BIT_ANALOG_REL, &DrvAnalog1, "mouse y-axis" ), - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - A("P2 Trackball X", BIT_ANALOG_REL, &DrvAnalog2, "mouse x-axis" ), - A("P2 Trackball Y", BIT_ANALOG_REL, &DrvAnalog3, "mouse y-axis" ), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Bladestl) - -static struct BurnDIPInfo BladestlDIPList[]= -{ - {0x17, 0xff, 0xff, 0xe0, NULL }, - {0x18, 0xff, 0xff, 0xc0, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - {0x1a, 0xff, 0xff, 0x5b, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x20, 0x20, "Off" }, - {0x17, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x80, 0x80, "Off" }, - {0x17, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Period time set" }, - {0x18, 0x01, 0x80, 0x80, "4" }, - {0x18, 0x01, 0x80, 0x00, "7" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x19, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x19, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x19, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x19, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x19, 0x01, 0x0f, 0x00, "4 Coins 5 Credits" }, - {0x19, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x19, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x19, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x19, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x19, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x19, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x19, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x19, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x19, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x19, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x19, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x19, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x19, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x19, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x19, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x19, 0x01, 0xf0, 0x00, "4 Coins 5 Credits" }, - {0x19, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x19, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x19, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x19, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x19, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x19, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x19, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x19, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x19, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x1a, 0x01, 0x04, 0x00, "Upright" }, - {0x1a, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus time set" }, - {0x1a, 0x01, 0x18, 0x18, "30 secs" }, - {0x1a, 0x01, 0x18, 0x10, "20 secs" }, - {0x1a, 0x01, 0x18, 0x08, "15 secs" }, - {0x1a, 0x01, 0x18, 0x00, "10 secs" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1a, 0x01, 0x60, 0x60, "Easy" }, - {0x1a, 0x01, 0x60, 0x40, "Normal" }, - {0x1a, 0x01, 0x60, 0x20, "Difficult" }, - {0x1a, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1a, 0x01, 0x80, 0x80, "Off" }, - {0x1a, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Bladestl) - -static void bankswitch(INT32 bank) -{ - HD6309Bank = bank; - HD6309MapMemory(DrvHD6309ROM + (((bank & 0x60) >> 5) * 0x2000), 0x6000, 0x7fff, MAP_ROM); -} - -static void bladestl_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff8) == 0x2600) { - K007342Regs[0][address & 7] = data; - return; - } - - if ((address & 0xffe0) == 0x2f80) { - K051733Write(address & 0x1f, data); - return; - } - - switch (address) - { - case 0x2e80: - soundlatch = data; - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x2ec0: - watchdog = 0; - return; - - case 0x2f40: - // coin counters = data & 0x03; - // leds data & 0x0c; - spritebank = (data & 0x80) << 3; - bankswitch(data); - return; - - case 0x2fc0: - return; // nop - } -} - -static UINT8 trackball_read(INT32 /*offset*/) -{ -/* - int curr = m_trackball[offset]->read(); - int delta = (curr - m_last_track[offset]) & 0xff; - m_last_track[offset] = curr; - - return (delta & 0x80) | (curr >> 1); -*/ - return 0; -} - -static UINT8 bladestl_main_read(UINT16 address) -{ - if ((address & 0xffe0) == 0x2f80) { - return K051733Read(address & 0x1f); - } - - switch (address) - { - case 0x2e00: - return (DrvInputs[0] & 0x1f) | (DrvDips[0] & 0xe0); - - case 0x2e01: - return (DrvInputs[1] & 0x7f) | (DrvDips[1] & 0x80); - - case 0x2e02: - return DrvInputs[2]; - - case 0x2e03: - return DrvDips[3]; - - case 0x2e40: - return DrvDips[2]; - - case 0x2f00: - case 0x2f01: - case 0x2f02: - case 0x2f03: - return trackball_read(address & 3); - } - - return 0; -} - -static void bladestl_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1000: - case 0x1001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0x3000: - UPD7759ResetWrite(0, data & 1); - UPD7759StartWrite(0, data & 2); - return; - - case 0x5000: - return; - } -} - -static UINT8 bladestl_sound_read(UINT16 address) -{ - switch (address) - { - case 0x1000: - case 0x1001: - return BurnYM2203Read(0, address & 1); - - case 0x4000: - return (UPD7759BusyRead(0) ? 1 : 0); - - case 0x6000: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static void bladestl_tile_callback(INT32 layer, INT32 /*bank*/, INT32 *code, INT32 *color, INT32 */*flags*/) -{ - *code |= ((*color & 0x0f) << 8) | ((*color & 0x40) << 6); - *color = 0x10 + layer; -} - -static void bladestl_sprite_callback(INT32 *code, INT32 *color) -{ - *code |= ((*color & 0xc0) << 2) + spritebank; - *code = (*code << 2) | ((*color & 0x30) >> 4); - *color = (*color & 0x0f); -} - -static void bladestl_ym2203_write_portA(UINT32, UINT32 data) -{ - UPD7759PortWrite(0, data); -} - -static void bladestl_ym2203_write_portB(UINT32, UINT32 data) -{ - soundbank = data; - memcpy (DrvUpdROM, DrvUpdROM + 0x20000 + (((data & 0x38) >> 3) * 0x20000), 0x20000); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / 2000000; -} - -inline static double DrvGetTime() -{ - return (double)M6809TotalCycles() / 2000000.0; -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - M6809Open(0); - M6809Reset(); - UPD7759Reset(); - BurnYM2203Reset(); - M6809Close(); - - K007342Reset(); - - bladestl_ym2203_write_portB(0,0); - - HiscoreReset(); - - HD6309Bank = 0; - soundlatch = 0; - spritebank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvHD6309ROM = Next; Next += 0x010000; - DrvM6809ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x080000; - - DrvUpdROM = Next; Next += 0x120000; - - DrvLutPROM = Next; Next += 0x000100; -; - DrvPalette = (UINT32*)Next; Next += 0x120 * sizeof(UINT32); - - AllRam = Next; - - DrvHD6309RAM = Next; Next += 0x002000; - DrvM6809RAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000100; - - K007342VidRAM[0] = Next; Next += 0x002000; - K007342ScrRAM[0] = Next; Next += 0x000200; - - K007420RAM[0] = Next; Next += 0x000200; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *src, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i-=2) { - src[i+0] = src[i/2] >> 4; - src[i+1] = src[i/2] & 0xf; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvHD6309ROM + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM + 0x08000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 2, 1)) return 1; - BurnByteswap(DrvGfxROM0, 0x40000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvLutPROM + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvUpdROM + 0x20000, 5, 1)) return 1; - if (BurnLoadRom(DrvUpdROM + 0xa0000, 6, 1)) return 1; - - DrvGfxExpand(DrvGfxROM0, 0x40000); - DrvGfxExpand(DrvGfxROM1, 0x40000); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(K007342VidRAM[0], 0x0000, 0x1fff, MAP_RAM); - HD6309MapMemory(K007420RAM[0], 0x2000, 0x21ff, MAP_RAM); - HD6309MapMemory(K007342ScrRAM[0], 0x2200, 0x23ff, MAP_RAM); - HD6309MapMemory(DrvPalRAM, 0x2400, 0x24ff, MAP_RAM); - HD6309MapMemory(DrvHD6309RAM, 0x4000, 0x5fff, MAP_RAM); - HD6309MapMemory(DrvHD6309ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(bladestl_main_write); - HD6309SetReadHandler(bladestl_main_read); - HD6309Close(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(bladestl_sound_write); - M6809SetReadHandler(bladestl_sound_read); - M6809Close(); - - K007342Init(DrvGfxROM0, bladestl_tile_callback); - K007342SetOffsets(0, 16); - - K007420Init(0x3ff, bladestl_sprite_callback); - K007420SetOffsets(0, 16); - - UPD7759Init(0, UPD7759_STANDARD_CLOCK, DrvUpdROM); - UPD7759SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 3579545, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, NULL, NULL, &bladestl_ym2203_write_portA, &bladestl_ym2203_write_portB); - BurnTimerAttachM6809(2000000); - BurnYM2203SetAllRoutes(0, 0.45, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 0.35); // when filters get hooked up, remove this line. - - // needs filters hooked up - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - HD6309Exit(); - - BurnYM2203Exit(); - UPD7759Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pens[0x60]; - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x60 / 2; i++) { - UINT16 p = (pal[i] << 8) | (pal[i] >> 8); - INT32 r = (p & 0x1f); - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x100; i++) { - DrvPalette[i] = pens[(DrvLutPROM[i] & 0xf)|0x20]; - } - - for (INT32 i = 0; i < 0x020; i++) { - DrvPalette[i + 0x100] = pens[i]; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 1; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) K007342DrawLayer(1, 0 | K007342_OPAQUE, 0); - if (nSpriteEnable & 1) K007420DrawSprites(DrvGfxROM1); - if (nBurnLayer & 2) K007342DrawLayer(1, 1 | K007342_OPAQUE, 0); - if (nBurnLayer & 4) K007342DrawLayer(0, 0, 0); - if (nBurnLayer & 8) K007342DrawLayer(0, 1, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (DrvReset) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 6000000 / 60, 2000000 / 60 }; - - HD6309Open(0); - M6809Open(0); - - HD6309SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // nmi - - for (INT32 i = 0; i < nInterleave; i++) { - - HD6309Run(nCyclesTotal[0] / nInterleave); - - if (i == 240 && K007342_irq_enabled()) HD6309SetIRQLine(1, CPU_IRQSTATUS_AUTO); // firq - - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - UPD7759Update(0, pBurnSoundOut, nBurnSoundLen); - } - - HD6309Close(); - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - HD6309Scan(nAction); - M6809Scan(nAction); - - K051733Scan(nAction); - BurnYM2203Scan(nAction, pnMin); - UPD7759Scan(0, nAction, pnMin); - - K007342Scan(nAction); - - SCAN_VAR(HD6309Bank); - SCAN_VAR(soundlatch); - SCAN_VAR(spritebank); - SCAN_VAR(soundbank); - } - - if (nAction & ACB_WRITE) { - HD6309Open(0); - bankswitch(HD6309Bank); - HD6309Close(); - - bladestl_ym2203_write_portB(0,soundbank); - } - - return 0; -} - - -// Blades of Steel (version T) - -static struct BurnRomInfo bladestlRomDesc[] = { - { "797-t01.19c", 0x10000, 0x89d7185d, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "797-c02.12d", 0x08000, 0x65a331ea, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 Code - - { "797a05.19h", 0x40000, 0x5491ba28, 3 | BRF_GRA }, // 2 Tiles - - { "797a06.13h", 0x40000, 0xd055f5cc, 4 | BRF_GRA }, // 3 Sprites - - { "797a07.16i", 0x00100, 0x7aecad4e, 5 | BRF_GRA }, // 4 Sprite Color Lookup Tables - - { "797a03.11a", 0x80000, 0x9ee1a542, 6 | BRF_GRA }, // 5 UPD7759 Samples - { "797a04.9a", 0x40000, 0x9ac8ea4e, 6 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(bladestl) -STD_ROM_FN(bladestl) - -struct BurnDriver BurnDrvBladestl = { - "bladestl", NULL, NULL, NULL, "1987", - "Blades of Steel (version T)\0", NULL, "Konami", "GX797", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, bladestlRomInfo, bladestlRomName, NULL, NULL, BladestlInputInfo, BladestlDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x120, - 224, 256, 3, 4 -}; - - -// Blades of Steel (version L) - -static struct BurnRomInfo bladestllRomDesc[] = { - { "797-l01.19c", 0x10000, 0x1ab14c40, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "797-c02.12d", 0x08000, 0x65a331ea, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 Code - - { "797a05.19h", 0x40000, 0x5491ba28, 3 | BRF_GRA }, // 2 Tiles - - { "797a06.13h", 0x40000, 0xd055f5cc, 4 | BRF_GRA }, // 3 Sprites - - { "797a07.16i", 0x00100, 0x7aecad4e, 5 | BRF_GRA }, // 4 Sprite Color Lookup Tables - - { "797a03.11a", 0x80000, 0x9ee1a542, 6 | BRF_GRA }, // 5 UPD7759 Samples - { "797a04.9a", 0x40000, 0x9ac8ea4e, 6 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(bladestll) -STD_ROM_FN(bladestll) - -struct BurnDriver BurnDrvBladestll = { - "bladestll", "bladestl", NULL, NULL, "1987", - "Blades of Steel (version L)\0", NULL, "Konami", "GX797", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, bladestllRomInfo, bladestllRomName, NULL, NULL, BladestlInputInfo, BladestlDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x120, - 224, 256, 3, 4 -}; - - -// Blades of Steel (version E) - -static struct BurnRomInfo bladestleRomDesc[] = { - { "797-e01.19c", 0x10000, 0xf8472e95, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "797-c02.12d", 0x08000, 0x65a331ea, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 Code - - { "797a05.19h", 0x40000, 0x5491ba28, 3 | BRF_GRA }, // 2 Tiles - - { "797a06.13h", 0x40000, 0xd055f5cc, 4 | BRF_GRA }, // 3 Sprites - - { "797a07.16i", 0x00100, 0x7aecad4e, 5 | BRF_GRA }, // 4 Sprite Color Lookup Tables - - { "797a03.11a", 0x80000, 0x9ee1a542, 6 | BRF_GRA }, // 5 UPD7759 Samples - { "797a04.9a", 0x40000, 0x9ac8ea4e, 6 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(bladestle) -STD_ROM_FN(bladestle) - -struct BurnDriver BurnDrvBladestle = { - "bladestle", "bladestl", NULL, NULL, "1987", - "Blades of Steel (version E)\0", NULL, "Konami", "GX797", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, bladestleRomInfo, bladestleRomName, NULL, NULL, BladestlInputInfo, BladestlDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x120, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_blockhl.cpp b/jan/src/burn/drv/konami/d_blockhl.cpp deleted file mode 100644 index 011417d20..000000000 --- a/jan/src/burn/drv/konami/d_blockhl.cpp +++ /dev/null @@ -1,568 +0,0 @@ -// FB Alpha Block Hole driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvBankRAM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *nDrvKonamiBank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo BlockhlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Blockhl) - -static struct BurnDIPInfo BlockhlDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x5f, NULL }, - {0x16, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x15, 0x01, 0x01, 0x01, "1" }, - {0x15, 0x01, 0x01, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Difficult" }, - {0x15, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x10, 0x10, "Off" }, -// {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Blockhl) - -void blockhl_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1f84: - *soundlatch = data; - return; - - case 0x1f88: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x1f8c: - // watchdog - return; - } - - if ((address & 0xc000) == 0x0000) { - K052109_051960_w(address & 0x3fff, data); - return; - } -} - -UINT8 blockhl_main_read(UINT16 address) -{ - switch (address) - { - case 0x1f94: - return DrvDips[2] | (DrvInputs[2] & 0x0f); - - case 0x1f95: - return DrvInputs[0]; - - case 0x1f96: - return DrvInputs[1]; - - case 0x1f97: - return DrvDips[0]; - - case 0x1f98: - return DrvDips[1]; - } - - if ((address & 0xc000) == 0x0000) { - return K052109_051960_r(address & 0x3fff); - } - - return 0; -} - -void __fastcall blockhl_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - } -} - -UINT8 __fastcall blockhl_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xc001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void blockhl_set_lines(INT32 lines) -{ - INT32 nBank = (lines & 0x03) * 0x2000; - - konamiMapMemory(DrvKonROM + nBank, 0x6000, 0x7fff, MAP_ROM); - - if (~lines & 0x20) { - konamiMapMemory(DrvPalRAM, 0x5800, 0x5fff, MAP_RAM); - } else { - konamiMapMemory(DrvBankRAM, 0x5800, 0x5fff, MAP_RAM); - } - - K052109RMRDLine = lines & 0x40; - - nDrvKonamiBank[0] = lines; -} - -static void K052109Callback(INT32 layer, INT32, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - *code |= ((*color & 0x0f) << 8); - *code &= 0xfff; - *color = (layer << 4) + ((*color & 0xe0) >> 5); -} - -static void K051960Callback(INT32 *code, INT32 *color, INT32 *priority, INT32 *) -{ - *priority = ((*color & 0x10) >> 3) | 0xfc; - - *code &= 0x3ff; - *color = 0x30 + (*color & 0x0f); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x010000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROMExp0 = Next; Next += 0x040000; - DrvGfxROMExp1 = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - AllRam = Next; - - DrvBankRAM = Next; Next += 0x000800; - DrvKonRAM = Next; Next += 0x001800; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - nDrvKonamiBank = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 5, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000002, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000003, 9, 4)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x020000); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x020000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonRAM, 0x4000, 0x57ff, MAP_RAM); - konamiMapMemory(DrvBankRAM, 0x5800, 0x5fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x00000, 0x6000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(blockhl_main_write); - konamiSetReadHandler(blockhl_main_read); - konamiSetlinesCallback(blockhl_set_lines); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(blockhl_sound_write); - ZetSetReadHandler(blockhl_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x1ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(8, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0x1ffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(8, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x800); - - K052109UpdateScroll(); - - K052109RenderLayer(2, K052109_OPAQUE, 0); - K052109RenderLayer(1, 0, 1); - K052109RenderLayer(0, 0, 2); - - K051960SpritesRender(0, -1); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03; - if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - } - - konamiNewFrame(); - ZetNewFrame(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { (((3000000 / 60) * 133) / 100) /* 33% overclock */, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - - nCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K052109_irq_enabled && (nDrvKonamiBank[0] & 0x03) == 0) - konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - KonamiICScan(nAction); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - blockhl_set_lines(nDrvKonamiBank[0]); - konamiClose(); - } - - return 0; -} - - -// Block Hole - -static struct BurnRomInfo blockhlRomDesc[] = { - { "973l02.e21", 0x10000, 0xe14f849a, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "973d01.g6", 0x08000, 0xeeee9d92, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "973f07.k15", 0x08000, 0x1a8cd9b4, 3 | BRF_GRA }, // 2 Background Tiles - { "973f08.k18", 0x08000, 0x952b51a6, 3 | BRF_GRA }, // 3 - { "973f09.k20", 0x08000, 0x77841594, 3 | BRF_GRA }, // 4 - { "973f10.k23", 0x08000, 0x09039fab, 3 | BRF_GRA }, // 5 - - { "973f06.k12", 0x08000, 0x51acfdb6, 4 | BRF_GRA }, // 6 Sprites - { "973f05.k9", 0x08000, 0x4cfea298, 4 | BRF_GRA }, // 7 - { "973f04.k7", 0x08000, 0x69ca41bd, 4 | BRF_GRA }, // 8 - { "973f03.k4", 0x08000, 0x21e98472, 4 | BRF_GRA }, // 9 - - { "973a11.h10", 0x00100, 0x46d28fe9, 5 | BRF_OPT }, // 10 Proms -}; - -STD_ROM_PICK(blockhl) -STD_ROM_FN(blockhl) - -struct BurnDriver BurnDrvBlockhl = { - "blockhl", NULL, NULL, NULL, "1989", - "Block Hole\0", NULL, "Konami", "GX973", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_PUZZLE, 0, - NULL, blockhlRomInfo, blockhlRomName, NULL, NULL, BlockhlInputInfo, BlockhlDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; - - -// Quarth (Japan) - -static struct BurnRomInfo quarthRomDesc[] = { - { "973j02.e21", 0x10000, 0x27a90118, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "973d01.g6", 0x08000, 0xeeee9d92, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "973e07.k15", 0x08000, 0x0bd6b0f8, 3 | BRF_GRA }, // 2 Background Tiles - { "973e08.k18", 0x08000, 0x104d0d5f, 3 | BRF_GRA }, // 3 - { "973e09.k20", 0x08000, 0xbd3a6f24, 3 | BRF_GRA }, // 4 - { "973e10.k23", 0x08000, 0xcf5e4b86, 3 | BRF_GRA }, // 5 - - { "973e06.k12", 0x08000, 0x0d58af85, 4 | BRF_GRA }, // 6 Sprites - { "973e05.k9", 0x08000, 0x15d822cb, 4 | BRF_GRA }, // 7 - { "973e04.k7", 0x08000, 0xd70f4a2c, 4 | BRF_GRA }, // 8 - { "973e03.k4", 0x08000, 0x2c5a4b4b, 4 | BRF_GRA }, // 9 - - { "973a11.h10", 0x00100, 0x46d28fe9, 5 | BRF_OPT }, // 10 Proms -}; - -STD_ROM_PICK(quarth) -STD_ROM_FN(quarth) - -struct BurnDriver BurnDrvQuarth = { - "quarth", "blockhl", NULL, NULL, "1989", - "Quarth (Japan)\0", NULL, "Konami", "GX973", - L"Quarth\0\u30AF\u30A9\u30FC\u30B9 (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PUZZLE, 0, - NULL, quarthRomInfo, quarthRomName, NULL, NULL, BlockhlInputInfo, BlockhlDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_bottom9.cpp b/jan/src/burn/drv/konami/d_bottom9.cpp deleted file mode 100644 index 12b0b2e8d..000000000 --- a/jan/src/burn/drv/konami/d_bottom9.cpp +++ /dev/null @@ -1,908 +0,0 @@ -// FB Alpha Bottom of the Nineth driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konamiic.h" -#include "k007232.h" -#include "m6809_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvGfxROMExp2; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *nmi_enable; -static UINT8 *nDrvBank; - -static INT32 bottom9_video_enable; -static INT32 zoomreadroms; -static INT32 K052109_selected; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo Bottom9InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 1, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Bottom9) - -static struct BurnDIPInfo Bottom9DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x4c, NULL }, - {0x14, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x00, "4 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x00, "4 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 8, "Play Time" }, - {0x13, 0x01, 0x07, 0x07, "1'00" }, - {0x13, 0x01, 0x07, 0x06, "1'10" }, - {0x13, 0x01, 0x07, 0x05, "1'20" }, - {0x13, 0x01, 0x07, 0x04, "1'30" }, - {0x13, 0x01, 0x07, 0x03, "1'40" }, - {0x13, 0x01, 0x07, 0x02, "1'50" }, - {0x13, 0x01, 0x07, 0x01, "2'00" }, - {0x13, 0x01, 0x07, 0x00, "2'10" }, - - {0 , 0xfe, 0 , 4, "Bonus Time" }, - {0x13, 0x01, 0x18, 0x18, "00" }, - {0x13, 0x01, 0x18, 0x10, "20" }, - {0x13, 0x01, 0x18, 0x08, "30" }, - {0x13, 0x01, 0x18, 0x00, "40" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x10, 0x10, "Off" }, -// {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Fielder Control" }, - {0x14, 0x01, 0x80, 0x80, "Normal" }, - {0x14, 0x01, 0x80, 0x00, "Auto" }, -}; - -STDDIPINFO(Bottom9) - -static struct BurnDIPInfo MstadiumDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x49, NULL }, - {0x14, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x00, "4 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x00, "4 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Play Inning" }, - {0x13, 0x01, 0x03, 0x03, "1 Inning" }, - {0x13, 0x01, 0x03, 0x02, "2 Inning" }, - {0x13, 0x01, 0x03, 0x01, "3 Inning" }, - {0x13, 0x01, 0x03, 0x00, "4 Inning" }, - - {0 , 0xfe, 0 , 4, "Play Inning Time" }, - {0x13, 0x01, 0x0c, 0x0c, "06 Min" }, - {0x13, 0x01, 0x0c, 0x08, "08 Min" }, - {0x13, 0x01, 0x0c, 0x04, "10 Min" }, - {0x13, 0x01, 0x0c, 0x00, "12 Min" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x10, 0x10, "Off" }, -// {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Fielder Control" }, - {0x14, 0x01, 0x80, 0x80, "Normal" }, - {0x14, 0x01, 0x80, 0x00, "Auto" }, -}; - -STDDIPINFO(Mstadium) - -static void bankswitch(INT32 data) -{ - nDrvBank[0] = data; - - INT32 offs = 0x10000 + (data & 0x1e) * 0x1000; - - M6809MapMemory(DrvM6809ROM + offs, 0x6000, 0x7fff, MAP_ROM); -} - -void bottom9_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1f80: - bankswitch(data); - return; - - case 0x1f90: - { - K052109RMRDLine = data & 0x04; - bottom9_video_enable = ~data & 0x08; - zoomreadroms = data & 0x10; - K052109_selected = data & 0x20; - } - return; - - case 0x1fa0: - // watchdog - return; - - case 0x1fb0: - *soundlatch = data; - return; - - case 0x1fc0: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } - - if ((address & 0xfff0) == 0x1ff0) { - K051316WriteCtrl(0, address & 0x0f, data); - return; - } - - if (K052109_selected == 0) { - if ((address & 0xf800) == 0x0000) { - K051316Write(0, address & 0x7ff, data); - return; - } - - if ((address & 0xf800) == 0x2000) { - DrvPalRAM[address & 0x7ff] = data; - return; - } - } - - if ((address & 0xc000) == 0x0000) { - K052109_051960_w(address & 0x3fff, data); - return; - } -} - -UINT8 bottom9_main_read(UINT16 address) -{ - switch (address) - { - case 0x1fd0: - return (DrvInputs[2] & 0x0f) | (DrvDips[2] & 0xf0); - - case 0x1fd1: - return DrvInputs[0]; - - case 0x1fd2: - return DrvInputs[1]; - - case 0x1fd3: - return DrvDips[0]; - - case 0x1fe0: - return DrvDips[1]; - } - - - if (K052109_selected == 0) { - if ((address & 0xf800) == 0x0000) { - if (zoomreadroms) - return K051316ReadRom(0, address & 0x7ff); - else - return K051316Read(0, address & 0x7ff); - } - - if ((address & 0xf800) == 0x2000) { - return DrvPalRAM[address & 0x7ff]; - } - } - - if ((address & 0xc000) == 0x0000) { - return K052109_051960_r(address & 0x3fff); - } - - return 0; -} - -static void sound_bank_w(INT32 data) -{ - k007232_set_bank(0, (data >> 0) & 0x03, (data >> 2) & 0x03); - k007232_set_bank(1, (data >> 4) & 0x03, (data >> 6) & 0x03); -} - -void __fastcall bottom9_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xa000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(1, address & 0x0f, data); - return; - } - - switch (address) - { - case 0x9000: - sound_bank_w(data); - return; - - case 0xf000: - *nmi_enable = data; - return; - } -} - -UINT8 __fastcall bottom9_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xa000) { - return K007232ReadReg(0, address & 0x0f); - } - - if ((address & 0xfff0) == 0xb000) { - return K007232ReadReg(1, address & 0x0f); - } - - switch (address) - { - case 0xd000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void K052109Callback(INT32 layer, INT32, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - *code |= (*color & 0x3f) << 8; - *color = ((layer & 2) << 3) | ((*color & 0xc0) >> 6); -} - -static void K051960Callback(INT32 *code, INT32 *color, INT32 *priority, INT32 *) -{ - *priority = (*color & 0x30) >> 4; - *color = 0x20 + (*color & 0x0f); - *code &= 0x1fff; -} - -static void K051316Callback(INT32 *code,INT32 *color,INT32 *flags) -{ - *flags = (*color & 0x40) >> 6; - *code |= ((*color & 0x03) << 8); - *color = 0x30 | ((*color & 0x3c) >> 2); -} - -static void DrvK007232VolCallback0(int v) -{ - K007232SetVolume(0,0,(v >> 4) * 0x11,0); - K007232SetVolume(0,1,0,(v & 0x0f) * 0x11); -} - -static void DrvK007232VolCallback1(INT32 v) -{ - K007232SetVolume(1,0,(v >> 4) * 0x11,0); - K007232SetVolume(1,1,0,(v & 0x0f) * 0x11); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - KonamiICReset(); - - bottom9_video_enable = 0; - zoomreadroms = 0; - K052109_selected = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x030000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x020000; - DrvGfxROMExp0 = Next; Next += 0x100000; - DrvGfxROMExp1 = Next; Next += 0x200000; - DrvGfxROMExp2 = Next; Next += 0x040000; - - DrvSndROM0 = Next; Next += 0x040000; - DrvSndROM1 = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - nmi_enable = Next; Next += 0x000001; - nDrvBank = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x010000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x000000, 1, 1)) return 1; - memcpy (DrvM6809ROM + 0x20000, DrvM6809ROM + 0x00000, 0x8000); - memcpy (DrvM6809ROM + 0x28000, DrvM6809ROM + 0x00000, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 5, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 6, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040001, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040002, 9, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040003, 10, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 12, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000002, 13, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000003, 14, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 15, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 16, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040002, 17, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040003, 18, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 19, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080001, 20, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080002, 21, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080003, 22, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 23, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0001, 24, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0002, 25, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0003, 26, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 27, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 28, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 29, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x010000, 30, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x020000, 31, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x030000, 32, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 33, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x010000, 34, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x020000, 35, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x030000, 36, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x080000); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x100000); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x4000, 0x5fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - M6809MapMemory(DrvM6809ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(bottom9_main_write); - M6809SetReadHandler(bottom9_main_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(bottom9_sound_write); - ZetSetReadHandler(bottom9_sound_read); - ZetClose(); - - K007232Init(0, 3579545, DrvSndROM0, 0x40000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback0); - K007232PCMSetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - - K007232Init(1, 3579545, DrvSndROM1, 0x40000); - K007232SetPortWriteHandler(1, DrvK007232VolCallback1); - K007232PCMSetAllRoutes(1, 0.40, BURN_SND_ROUTE_BOTH); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x7ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(8, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0xfffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(8, 0); - - K051316Init(0, DrvGfxROM2, DrvGfxROMExp2, 0x1ffff, K051316Callback, 4, 0); - K051316SetOffset(0, -112, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - M6809Exit(); - ZetExit(); - - K007232Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x800); - - K052109UpdateScroll(); - - KonamiClearBitmaps(0); - - K051960SpritesRender(1, 1); - K051316_zoom_draw(0, 0); - K051960SpritesRender(0, 0); - K052109RenderLayer(2, 0, 0); - K051960SpritesRender(2, 3); - K052109RenderLayer(1, 0, 0); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[0] & 0x06) == 0) DrvInputs[0] |= 0x06; - if ((DrvInputs[0] & 0x18) == 0) DrvInputs[0] |= 0x18; - if ((DrvInputs[1] & 0x06) == 0) DrvInputs[1] |= 0x06; - if ((DrvInputs[1] & 0x18) == 0) DrvInputs[1] |= 0x18; - } - - INT32 nInterleave = 8; - INT32 nCyclesTotal[2] = { 2000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - - nCyclesDone[0] += M6809Run(nSegment - nCyclesDone[0]); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - if (*nmi_enable) ZetNmi(); - } - - if (K052109_irq_enabled) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - memset(pBurnSoundOut, 0, nBurnSoundLen * sizeof(INT16) * 2); - K007232Update(0, pBurnSoundOut, nBurnSoundLen); - K007232Update(1, pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - ZetScan(nAction); - - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - - SCAN_VAR(bottom9_video_enable); - SCAN_VAR(zoomreadroms); - SCAN_VAR(K052109_selected); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(nDrvBank[0]); - M6809Close(); - } - - return 0; -} - - -// Bottom of the Ninth (ver. T) - -static struct BurnRomInfo bottom9RomDesc[] = { - { "891n03.k17", 0x10000, 0x8b083ff3, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "891-t02.k15", 0x10000, 0x2c10ced2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "891j01.g8", 0x08000, 0x31b0a0a8, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "891e10c", 0x10000, 0x209b0431, 3 | BRF_GRA }, // 3 K052109 Tiles - { "891e10a", 0x10000, 0x8020a9e8, 3 | BRF_GRA }, // 4 - { "891e09c", 0x10000, 0x9dcaefbf, 3 | BRF_GRA }, // 5 - { "891e09a", 0x10000, 0x56b0ead9, 3 | BRF_GRA }, // 6 - { "891e10d", 0x10000, 0x16d5fd7a, 3 | BRF_GRA }, // 7 - { "891e10b", 0x10000, 0x30121cc0, 3 | BRF_GRA }, // 8 - { "891e09d", 0x10000, 0x4e1335e6, 3 | BRF_GRA }, // 9 - { "891e09b", 0x10000, 0xb6f914fb, 3 | BRF_GRA }, // 10 - - { "891e06e", 0x10000, 0x0b04db1c, 4 | BRF_GRA }, // 11 K051960 Tiles - { "891e06a", 0x10000, 0x5ee37327, 4 | BRF_GRA }, // 12 - { "891e05e", 0x10000, 0xb356e729, 4 | BRF_GRA }, // 13 - { "891e05a", 0x10000, 0xbfd5487e, 4 | BRF_GRA }, // 14 - { "891e06f", 0x10000, 0xf9ada524, 4 | BRF_GRA }, // 15 - { "891e06b", 0x10000, 0x2295dfaa, 4 | BRF_GRA }, // 16 - { "891e05f", 0x10000, 0xecdd11c5, 4 | BRF_GRA }, // 17 - { "891e05b", 0x10000, 0xaba18d24, 4 | BRF_GRA }, // 18 - { "891e06g", 0x10000, 0x04abf78f, 4 | BRF_GRA }, // 19 - { "891e06c", 0x10000, 0xdbdb0d55, 4 | BRF_GRA }, // 20 - { "891e05g", 0x10000, 0xc315f9ae, 4 | BRF_GRA }, // 21 - { "891e05c", 0x10000, 0x21fcbc6f, 4 | BRF_GRA }, // 22 - { "891e06h", 0x10000, 0x5d5ded8c, 4 | BRF_GRA }, // 23 - { "891e06d", 0x10000, 0xf9ecbd71, 4 | BRF_GRA }, // 24 - { "891e05h", 0x10000, 0xb0aba53b, 4 | BRF_GRA }, // 25 - { "891e05d", 0x10000, 0xf6d3f886, 4 | BRF_GRA }, // 26 - - { "891e07a", 0x10000, 0xb8d8b939, 5 | BRF_GRA }, // 27 K051316 Tiles - { "891e07b", 0x10000, 0x83b2f92d, 5 | BRF_GRA }, // 28 - - { "891e08a", 0x10000, 0xcef667bf, 6 | BRF_GRA }, // 29 K007232 #0 Samples - { "891e08b", 0x10000, 0xf7c14a7a, 6 | BRF_GRA }, // 30 - { "891e08c", 0x10000, 0x756b7f3c, 6 | BRF_GRA }, // 31 - { "891e08d", 0x10000, 0xcd0d7305, 6 | BRF_GRA }, // 32 - - { "891e04a", 0x10000, 0xdaebbc74, 7 | BRF_GRA }, // 33 K007232 #1 Samples - { "891e04b", 0x10000, 0x5ffb9ad1, 7 | BRF_GRA }, // 34 - { "891e04c", 0x10000, 0x2dbbf16b, 7 | BRF_GRA }, // 35 - { "891e04d", 0x10000, 0x8b0cd2cc, 7 | BRF_GRA }, // 36 - - { "891b11.f23", 0x00100, 0xecb854aa, 8 | BRF_OPT }, // 37 Priority Proms -}; - -STD_ROM_PICK(bottom9) -STD_ROM_FN(bottom9) - -struct BurnDriver BurnDrvBottom9 = { - "bottom9", NULL, NULL, NULL, "1989", - "Bottom of the Ninth (ver. T)\0", NULL, "Konami", "GX891", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, bottom9RomInfo, bottom9RomName, NULL, NULL, Bottom9InputInfo, Bottom9DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; - - -// Bottom of the Ninth (ver. N) - -static struct BurnRomInfo bottom9nRomDesc[] = { - { "891n03.k17", 0x10000, 0x8b083ff3, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "891n02.k15", 0x10000, 0xd44d9ed4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "891j01.g8", 0x08000, 0x31b0a0a8, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "891e10c", 0x10000, 0x209b0431, 3 | BRF_GRA }, // 3 K052109 Tiles - { "891e10a", 0x10000, 0x8020a9e8, 3 | BRF_GRA }, // 4 - { "891e09c", 0x10000, 0x9dcaefbf, 3 | BRF_GRA }, // 5 - { "891e09a", 0x10000, 0x56b0ead9, 3 | BRF_GRA }, // 6 - { "891e10d", 0x10000, 0x16d5fd7a, 3 | BRF_GRA }, // 7 - { "891e10b", 0x10000, 0x30121cc0, 3 | BRF_GRA }, // 8 - { "891e09d", 0x10000, 0x4e1335e6, 3 | BRF_GRA }, // 9 - { "891e09b", 0x10000, 0xb6f914fb, 3 | BRF_GRA }, // 10 - - { "891e06e", 0x10000, 0x0b04db1c, 4 | BRF_GRA }, // 11 K051960 Tiles - { "891e06a", 0x10000, 0x5ee37327, 4 | BRF_GRA }, // 12 - { "891e05e", 0x10000, 0xb356e729, 4 | BRF_GRA }, // 13 - { "891e05a", 0x10000, 0xbfd5487e, 4 | BRF_GRA }, // 14 - { "891e06f", 0x10000, 0xf9ada524, 4 | BRF_GRA }, // 15 - { "891e06b", 0x10000, 0x2295dfaa, 4 | BRF_GRA }, // 16 - { "891e05f", 0x10000, 0xecdd11c5, 4 | BRF_GRA }, // 17 - { "891e05b", 0x10000, 0xaba18d24, 4 | BRF_GRA }, // 18 - { "891e06g", 0x10000, 0x04abf78f, 4 | BRF_GRA }, // 19 - { "891e06c", 0x10000, 0xdbdb0d55, 4 | BRF_GRA }, // 20 - { "891e05g", 0x10000, 0xc315f9ae, 4 | BRF_GRA }, // 21 - { "891e05c", 0x10000, 0x21fcbc6f, 4 | BRF_GRA }, // 22 - { "891e06h", 0x10000, 0x5d5ded8c, 4 | BRF_GRA }, // 23 - { "891e06d", 0x10000, 0xf9ecbd71, 4 | BRF_GRA }, // 24 - { "891e05h", 0x10000, 0xb0aba53b, 4 | BRF_GRA }, // 25 - { "891e05d", 0x10000, 0xf6d3f886, 4 | BRF_GRA }, // 26 - - { "891e07a", 0x10000, 0xb8d8b939, 5 | BRF_GRA }, // 27 K051316 Tiles - { "891e07b", 0x10000, 0x83b2f92d, 5 | BRF_GRA }, // 28 - - { "891e08a", 0x10000, 0xcef667bf, 6 | BRF_GRA }, // 29 K007232 #0 Samples - { "891e08b", 0x10000, 0xf7c14a7a, 6 | BRF_GRA }, // 30 - { "891e08c", 0x10000, 0x756b7f3c, 6 | BRF_GRA }, // 31 - { "891e08d", 0x10000, 0xcd0d7305, 6 | BRF_GRA }, // 32 - - { "891e04a", 0x10000, 0xdaebbc74, 7 | BRF_GRA }, // 33 K007232 #1 Samples - { "891e04b", 0x10000, 0x5ffb9ad1, 7 | BRF_GRA }, // 34 - { "891e04c", 0x10000, 0x2dbbf16b, 7 | BRF_GRA }, // 35 - { "891e04d", 0x10000, 0x8b0cd2cc, 7 | BRF_GRA }, // 36 - - { "891b11.f23", 0x00100, 0xecb854aa, 8 | BRF_OPT }, // 37 Priority Proms -}; - -STD_ROM_PICK(bottom9n) -STD_ROM_FN(bottom9n) - -struct BurnDriver BurnDrvBottom9n = { - "bottom9n", "bottom9", NULL, NULL, "1989", - "Bottom of the Ninth (ver. N)\0", NULL, "Konami", "GX891", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, bottom9nRomInfo, bottom9nRomName, NULL, NULL, Bottom9InputInfo, Bottom9DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; - - -// Main Stadium (Japan ver. 4) - -static struct BurnRomInfo mstadiumRomDesc[] = { - { "891-403.k17", 0x10000, 0x1c00c4e8, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "891-402.k15", 0x10000, 0xb850bbce, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "891w01.g8", 0x08000, 0xedec565a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "891e10c", 0x10000, 0x209b0431, 3 | BRF_GRA }, // 3 K052109 Tiles - { "891e10a", 0x10000, 0x8020a9e8, 3 | BRF_GRA }, // 4 - { "891e09c", 0x10000, 0x9dcaefbf, 3 | BRF_GRA }, // 5 - { "891e09a", 0x10000, 0x56b0ead9, 3 | BRF_GRA }, // 6 - { "891e10d", 0x10000, 0x16d5fd7a, 3 | BRF_GRA }, // 7 - { "891e10b", 0x10000, 0x30121cc0, 3 | BRF_GRA }, // 8 - { "891e09d", 0x10000, 0x4e1335e6, 3 | BRF_GRA }, // 9 - { "891e09b", 0x10000, 0xb6f914fb, 3 | BRF_GRA }, // 10 - - { "891e06e", 0x10000, 0x0b04db1c, 4 | BRF_GRA }, // 11 K051960 Tiles - { "891e06a", 0x10000, 0x5ee37327, 4 | BRF_GRA }, // 12 - { "891e05e", 0x10000, 0xb356e729, 4 | BRF_GRA }, // 13 - { "891e05a", 0x10000, 0xbfd5487e, 4 | BRF_GRA }, // 14 - { "891e06f", 0x10000, 0xf9ada524, 4 | BRF_GRA }, // 15 - { "891e06b", 0x10000, 0x2295dfaa, 4 | BRF_GRA }, // 16 - { "891e05f", 0x10000, 0xecdd11c5, 4 | BRF_GRA }, // 17 - { "891e05b", 0x10000, 0xaba18d24, 4 | BRF_GRA }, // 18 - { "891e06g", 0x10000, 0x04abf78f, 4 | BRF_GRA }, // 19 - { "891e06c", 0x10000, 0xdbdb0d55, 4 | BRF_GRA }, // 20 - { "891e05g", 0x10000, 0xc315f9ae, 4 | BRF_GRA }, // 21 - { "891e05c", 0x10000, 0x21fcbc6f, 4 | BRF_GRA }, // 22 - { "891e06h", 0x10000, 0x5d5ded8c, 4 | BRF_GRA }, // 23 - { "891e06d", 0x10000, 0xf9ecbd71, 4 | BRF_GRA }, // 24 - { "891e05h", 0x10000, 0xb0aba53b, 4 | BRF_GRA }, // 25 - { "891e05d", 0x10000, 0xf6d3f886, 4 | BRF_GRA }, // 26 - - { "891e07a", 0x10000, 0xb8d8b939, 5 | BRF_GRA }, // 27 K051316 Tiles - { "891e07b", 0x10000, 0x83b2f92d, 5 | BRF_GRA }, // 28 - - { "891e08a", 0x10000, 0xcef667bf, 6 | BRF_GRA }, // 29 K007232 #0 Samples - { "891e08b", 0x10000, 0xf7c14a7a, 6 | BRF_GRA }, // 30 - { "891e08c", 0x10000, 0x756b7f3c, 6 | BRF_GRA }, // 31 - { "891e08d", 0x10000, 0xcd0d7305, 6 | BRF_GRA }, // 32 - - { "891e04a", 0x10000, 0xdaebbc74, 7 | BRF_GRA }, // 33 K007232 #1 Samples - { "891e04b", 0x10000, 0x5ffb9ad1, 7 | BRF_GRA }, // 34 - { "891e04c", 0x10000, 0x2dbbf16b, 7 | BRF_GRA }, // 35 - { "891e04d", 0x10000, 0x8b0cd2cc, 7 | BRF_GRA }, // 36 - - { "891b11.f23", 0x00100, 0xecb854aa, 8 | BRF_OPT }, // 37 Priority Proms -}; - -STD_ROM_PICK(mstadium) -STD_ROM_FN(mstadium) - -struct BurnDriver BurnDrvMstadium = { - "mstadium", "bottom9", NULL, NULL, "1989", - "Main Stadium (Japan ver. 4)\0", NULL, "Konami", "GX891", - L"Main Stadium\0\u30E1\u30A4\u30F3\u30B9\u30BF\u30B8\u30A2\u30E0 (Japan ver. 4)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, mstadiumRomInfo, mstadiumRomName, NULL, NULL, Bottom9InputInfo, MstadiumDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_chqflag.cpp b/jan/src/burn/drv/konami/d_chqflag.cpp deleted file mode 100644 index 86a8690e5..000000000 --- a/jan/src/burn/drv/konami/d_chqflag.cpp +++ /dev/null @@ -1,829 +0,0 @@ -// FB Alpha Chequered Flag driver module -// Based on MAME driver by Nicola Salmoria and Manuel Abadia - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k007232.h" -#include "burn_shift.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *soundlatch1; - -static UINT8 DrvInputs[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static INT32 nNmiEnable; -static INT32 nDrvRomBank; -static INT32 nDrvRamBank; -static INT32 nBackgroundBrightness; -static INT32 k051316_readroms; -static INT32 analog_ctrl; -static INT32 DrvAnalogPort0 = 0; -static INT32 DrvAnalogPort1 = 0; -static UINT8 accelerator; -static UINT8 steeringwheel; - -static INT32 watchdog; - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo ChqflagInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - - A("Wheel", BIT_ANALOG_REL, &DrvAnalogPort0 , "mouse x-axis"), - A("Accelerator", BIT_ANALOG_REL, &DrvAnalogPort1 , "p1 fire 1"), - - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Chqflag) -#undef A - -static struct BurnDIPInfo ChqflagDIPList[]= -{ - {0x08, 0xff, 0xff, 0xff, NULL }, - {0x09, 0xff, 0xff, 0x5f, NULL }, - {0x0a, 0xff, 0xff, 0xe0, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x08, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x08, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x08, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x08, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x08, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x08, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x08, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x08, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x08, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x08, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x08, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x08, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x08, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x08, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x08, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x08, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x08, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x08, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x08, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x08, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x08, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x08, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x08, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x08, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x08, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x08, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x08, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x08, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x08, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x08, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x08, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x08, 0x01, 0xf0, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x09, 0x01, 0x60, 0x60, "Easy" }, - {0x09, 0x01, 0x60, 0x40, "Normal" }, - {0x09, 0x01, 0x60, 0x20, "Difficult" }, - {0x09, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x09, 0x01, 0x80, 0x80, "Off" }, - {0x09, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Title" }, - {0x0a, 0x01, 0x40, 0x40, "Chequered Flag" }, - {0x0a, 0x01, 0x40, 0x00, "Checkered Flag" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0a, 0x01, 0x80, 0x80, "Off" }, - {0x0a, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Chqflag) - -static void bankswitch(INT32 data) -{ - nDrvRomBank = data & 0x1f; - - if (nDrvRomBank < (0x50000 / 0x4000)) - konamiMapMemory(DrvKonROM + (nDrvRomBank * 0x4000), 0x4000, 0x7fff, MAP_ROM); -} - -static void chqflag_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0x1000) { - if (nDrvRamBank) { - if (address & 0x800) { - DrvPalRAM[address & 0x7ff] = data; - return; - } else { - K051316Write(0, address & 0x7ff, data); - return; - } - } else { - DrvKonRAM[address] = data; - return; - } - } - - if ((address & 0xfff8) == 0x2000) { - if (address == 0x2000) { - if (data & 0x01) konamiSetIrqLine(0, CPU_IRQSTATUS_NONE); - if (data & 0x04) konamiSetIrqLine(0x20, CPU_IRQSTATUS_NONE); - nNmiEnable = data & 0x04; - } - - K051937Write(address & 7, data); - return; - } - - if ((address & 0xfc00) == 0x2400) { - K051960Write(address & 0x3ff, data); - return; - } - - if ((address & 0xf800) == 0x2800) { - K051316Write(1, address & 0x7ff, data); - return; - } - - if ((address & 0xffe0) == 0x3400) { - K051733Write(address & 0x1f, data); - return; - } - - if ((address & 0xfff0) == 0x3500) { - K051316WriteCtrl(0, address & 0x0f, data); - return; - } - - if ((address & 0xfff0) == 0x3600) { - K051316WriteCtrl(1, address & 0x0f, data); - return; - } - - switch (address) - { - case 0x3000: - *soundlatch = data; - return; - - case 0x3001: - *soundlatch1 = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x3002: - nDrvRamBank = data & 0x20; - bankswitch(data); - return; - - case 0x3003: - { - nBackgroundBrightness = (data & 0x80) ? 60 : 100; - - konami_set_highlight_mode((data & 0x08) ? 1 : 0); - - k051316_readroms = data & 0x10; - } - return; - - case 0x3300: - watchdog = 0; - return; - - case 0x3700: - case 0x3702: - analog_ctrl = data & 3; - return; - } -} - -static inline UINT8 analog_port_read() -{ - switch (analog_ctrl) - { - case 0x00: { - accelerator = DrvAnalogPort1; - return accelerator; - } - case 0x01: { - steeringwheel = 0x7f + (DrvAnalogPort0 >> 4); - return steeringwheel; - } - case 0x02: return accelerator; // 0x02,0x03: previous reads - case 0x03: return steeringwheel; - } - - return 0xff; -} - -static UINT8 chqflag_main_read(UINT16 address) -{ - if ((address & 0xf000) == 0x1000) { - if (nDrvRamBank) { - if (address & 0x800) { - return DrvPalRAM[address & 0x7ff]; - } else { - if (k051316_readroms) { - return K051316ReadRom(0, address & 0x7ff); - } else { - return K051316Read(0, address & 0x7ff); - } - } - } else { - return DrvKonRAM[address]; - } - } - - if ((address & 0xffe0) == 0x3400) { - return K051733Read(address & 0x1f); - } - - if ((address & 0xfff8) == 0x2000) { - return K051937Read(address & 7); - } - - if ((address & 0xfc00) == 0x2400) { - return K051960Read(address & 0x3ff); - } - - if ((address & 0xf800) == 0x2800) { - if (k051316_readroms) { - return K051316ReadRom(1, address & 0x7ff); - } else { - return K051316Read(1, address & 0x7ff); - } - } - - switch (address) - { - case 0x3100: - return DrvDips[0]; - - case 0x3200: - return (DrvInputs[0] & 0x1f) | (DrvDips[2] & 0xe0); - - case 0x3201: - return 0xff; - - case 0x3203: - return DrvDips[1]; - - case 0x3701: - return DrvInputs[1] & 0x0f; - - case 0x3702: - return analog_port_read(); - } - - return 0; -} - -static void __fastcall chqflag_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xa000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(1, address & 0x0f, data); - return; - } - - switch (address) - { - case 0x9000: - k007232_set_bank(0, (data >> 4) & 3, (data >> 6) & 3 ); - k007232_set_bank(1, (data >> 0) & 3, (data >> 2) & 3 ); - return; - - case 0xa01c: - K007232SetVolume(0, 1, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2); - return; - - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xf000: - return; // nop - } -} - -static UINT8 __fastcall chqflag_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xa000) { - return K007232ReadReg(0, address & 0x0f); - } - - if ((address & 0xfff0) == 0xb000) { - return K007232ReadReg(1, address & 0x0f); - } - - switch (address) - { - case 0xc000: - case 0xc001: - return BurnYM2151ReadStatus(); - - case 0xd000: - return *soundlatch; - - case 0xe000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch1; - } - - return 0; -} - -static void DrvYM2151IrqHandler(INT32 state) -{ - if (state) ZetNmi(); -} - -static void DrvK007232VolCallback0(INT32 v) -{ - K007232SetVolume(0, 0, (v & 0x0f) * 0x11/2, (v & 0x0f) * 0x11/2); -} - -static void DrvK007232VolCallback1(INT32 v) -{ - K007232SetVolume(1, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(1, 1, 0, (v & 0x0f) * 0x11); -} - -static void K051316Callback0(INT32 *code,INT32 *color,INT32 *) -{ - *code |= ((*color & 0x03) << 8); - *color = (256 / 16) + ((*color & 0x3c) >> 2); -} - -static void K051316Callback1(INT32 *code,INT32 *color,INT32 *flags) -{ - *flags = (*color & 0xc0) >> 6; - *code |= ((*color & 0x0f) << 8); - *color = (512 / 256) + ((*color & 0x10) >> 4); -} - -static void K051960Callback(INT32 *, INT32 *color, INT32 *priority, INT32 *) -{ - *priority = (*color & 0x10) ? 0 : 0xaaaa; - *color = (*color & 0x0f); -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - konamiOpen(0); - konamiReset(); - bankswitch(0); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - K051316WrapEnable(1, 1); - - nDrvRamBank = 0; - k051316_readroms = 0; - analog_ctrl = 0; - nNmiEnable = 0; - - watchdog = 0; - BurnShiftReset(); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x050000; - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROMExp0 = Next; Next += 0x200000; - DrvGfxROMExp1 = Next; Next += 0x040000; - - DrvSndROM0 = Next; Next += 0x080000; - DrvSndROM1 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x401 * sizeof(UINT32); - - AllRam = Next; - - DrvKonRAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - soundlatch1 = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x000000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x040000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 4, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c0000, 9, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 11, 1)) return 1; - - K051960GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x100000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonRAM, 0x0000, 0x0fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x00000, 0x4000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x48000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(chqflag_main_write); - konamiSetReadHandler(chqflag_main_read); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(chqflag_sound_write); - ZetSetReadHandler(chqflag_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K007232Init(0, 3579545, DrvSndROM0, 0x80000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback0); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - K007232Init(1, 3579545, DrvSndROM1, 0x80000); - K007232SetPortWriteHandler(1, DrvK007232VolCallback1); - K007232PCMSetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - K051960Init(DrvGfxROM0, DrvGfxROMExp0, 0xfffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(-8, 0); - - K051316Init(0, DrvGfxROM1, DrvGfxROMExp1, 0x1ffff, K051316Callback0, 4, 0); - K051316SetOffset(0, -89, -16); - - K051316Init(1, DrvGfxROM2, DrvGfxROM2, 0xfffff, K051316Callback1, 8, 0xc0 | 0x200); - K051316SetOffset(1, -96, -16); - - konami_set_highlight_over_sprites_mode(1); - - BurnShiftInit(SHIFT_POSITION_BOTTOM_RIGHT, SHIFT_COLOR_GREEN, 80); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - K007232Exit(); - BurnYM2151Exit(); - - BurnShiftExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - konami_palette32 = DrvPalette; - - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x800 / 2; i++) { - UINT16 d = BURN_ENDIAN_SWAP_INT16((p[i] << 8) | (p[i] >> 8)); - - r = (d >> 0) & 0x1f; - g = (d >> 5) & 0x1f; - b = (d >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - if (i >= 0x200) { - r = (r * nBackgroundBrightness) / 100; - g = (g * nBackgroundBrightness) / 100; - b = (b * nBackgroundBrightness) / 100; - } - - DrvPalette[i] = (r << 16) | (g << 8) | b; // 32-bit colors - } -} - -static INT32 DrvDraw() -{ - DrvPaletteInit(); - - BurnTransferClear(); - KonamiClearBitmaps(0); - - if (nBurnLayer & 1) K051316_zoom_draw(1, 0 | 0x200); - - if (nBurnLayer & 2) K051316_zoom_draw(1, 1); - - if (nSpriteEnable & 1) K051960SpritesRender(-1, -1); - - if (nBurnLayer & 4) K051316_zoom_draw(0, 0); - - KonamiBlendCopy(DrvPalette); - - BurnShiftRender(); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - { // gear shifter stuff - BurnShiftInputCheckToggle(DrvJoy2[0]); - - DrvInputs[1] &= ~1; - DrvInputs[1] |= !bBurnShiftStatus; - } - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 256/2; - INT32 nCyclesTotal[2] = { 3000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - nCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if ((i&0xf)==0 && nNmiEnable) konamiSetIrqLine(0x20, CPU_IRQSTATUS_ACK); // iq_132 fix me! - if (i == 120 && K051960_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_ACK); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - K007232Update(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - K007232Update(1, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - - BurnShiftScan(nAction); - - SCAN_VAR(nDrvRomBank); - SCAN_VAR(nDrvRamBank); - SCAN_VAR(k051316_readroms); - SCAN_VAR(analog_ctrl); - SCAN_VAR(nNmiEnable); - SCAN_VAR(nBackgroundBrightness); - SCAN_VAR(accelerator); - SCAN_VAR(steeringwheel); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - bankswitch(nDrvRomBank); - konamiClose(); - - } - - return 0; -} - - -// Chequered Flag - -static struct BurnRomInfo chqflagRomDesc[] = { - { "717e10", 0x40000, 0x72fc56f6, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "717h02", 0x10000, 0xf5bd4e78, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "717e01", 0x08000, 0x966b8ba8, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "717e04", 0x80000, 0x1a50a1cc, 3 | BRF_GRA }, // 3 k051960 Sprites - { "717e05", 0x80000, 0x46ccb506, 3 | BRF_GRA }, // 4 - - { "717e06.n16", 0x20000, 0x1ec26c7a, 4 | BRF_GRA }, // 5 k051316 #0 Zoom Tiles - - { "717e07.l20", 0x40000, 0xb9a565a8, 5 | BRF_GRA }, // 6 k051316 #1 Zoom Tiles - { "717e08.l22", 0x40000, 0xb68a212e, 5 | BRF_GRA }, // 7 - { "717e11.n20", 0x40000, 0xebb171ec, 5 | BRF_GRA }, // 8 - { "717e12.n22", 0x40000, 0x9269335d, 5 | BRF_GRA }, // 9 - - { "717e03", 0x80000, 0xebe73c22, 6 | BRF_GRA }, // 10 k007232 #0 Samples - - { "717e09", 0x80000, 0xd74e857d, 7 | BRF_GRA }, // 11 k007232 #1 Samples -}; - -STD_ROM_PICK(chqflag) -STD_ROM_FN(chqflag) - -struct BurnDriver BurnDrvChqflag = { - "chqflag", NULL, NULL, NULL, "1988", - "Chequered Flag\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_PREFIX_KONAMI, GBF_RACING, 0, - NULL, chqflagRomInfo, chqflagRomName, NULL, NULL, ChqflagInputInfo, ChqflagDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 304, 3, 4 -}; - - -// Chequered Flag (Japan) - -static struct BurnRomInfo chqflagjRomDesc[] = { - { "717e10", 0x40000, 0x72fc56f6, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "717j02.bin", 0x10000, 0x05355daa, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "717e01", 0x08000, 0x966b8ba8, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "717e04", 0x80000, 0x1a50a1cc, 3 | BRF_GRA }, // 3 k051960 Sprites - { "717e05", 0x80000, 0x46ccb506, 3 | BRF_GRA }, // 4 - - { "717e06.n16", 0x20000, 0x1ec26c7a, 4 | BRF_GRA }, // 5 k051316 #0 Zoom Tiles - - { "717e07.l20", 0x40000, 0xb9a565a8, 5 | BRF_GRA }, // 6 k051316 #1 Zoom Tiles - { "717e08.l22", 0x40000, 0xb68a212e, 5 | BRF_GRA }, // 7 - { "717e11.n20", 0x40000, 0xebb171ec, 5 | BRF_GRA }, // 8 - { "717e12.n22", 0x40000, 0x9269335d, 5 | BRF_GRA }, // 9 - - { "717e03", 0x80000, 0xebe73c22, 6 | BRF_GRA }, // 10 k007232 #0 Samples - - { "717e09", 0x80000, 0xd74e857d, 7 | BRF_GRA }, // 11 k007232 #1 Samples -}; - -STD_ROM_PICK(chqflagj) -STD_ROM_FN(chqflagj) - -struct BurnDriver BurnDrvChqflagj = { - "chqflagj", "chqflag", NULL, NULL, "1988", - "Chequered Flag (Japan)\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_PREFIX_KONAMI, GBF_RACING, 0, - NULL, chqflagjRomInfo, chqflagjRomName, NULL, NULL, ChqflagInputInfo, ChqflagDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 304, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_circusc.cpp b/jan/src/burn/drv/konami/d_circusc.cpp deleted file mode 100644 index 3d4bb8db5..000000000 --- a/jan/src/burn/drv/konami/d_circusc.cpp +++ /dev/null @@ -1,864 +0,0 @@ -// FB Alpha Circus Charlie driver module -// Based on MAME driver by Chris Hardy - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809ROMDec; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvTransTable; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 snlatch; -static UINT8 soundlatch; -static UINT8 irqmask; -static UINT8 spritebank; -static UINT8 scrolldata; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 watchdog; - -static struct BurnInputInfo CircuscInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Circusc) - -static struct BurnDIPInfo CircuscDIPList[]= -{ - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0x4b, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x0c, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x0c, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x0c, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x0c, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x0c, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x0c, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x0c, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x0c, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x0c, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x0c, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x0c, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x0c, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x0c, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x0c, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x0c, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x0c, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x0c, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x0c, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x0c, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x0c, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x0c, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x0c, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x0c, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x0c, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x0c, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x0c, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0d, 0x01, 0x03, 0x03, "3" }, - {0x0d, 0x01, 0x03, 0x02, "4" }, - {0x0d, 0x01, 0x03, 0x01, "5" }, - {0x0d, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0d, 0x01, 0x04, 0x00, "Upright" }, - {0x0d, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x0d, 0x01, 0x08, 0x08, "20k 90k 70k+" }, - {0x0d, 0x01, 0x08, 0x00, "30k 110k 80k+" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0d, 0x01, 0x60, 0x60, "Easy" }, - {0x0d, 0x01, 0x60, 0x40, "Normal" }, - {0x0d, 0x01, 0x60, 0x20, "Hard" }, - {0x0d, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0d, 0x01, 0x80, 0x80, "Off" }, - {0x0d, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Circusc) - -static void circusc_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0000: - // flipscreen = data & 0x01; - return; - - case 0x0001: - irqmask = data & 0x01; - return; - - case 0x0003: - case 0x0004: - // coin counter - return; - - case 0x0005: - spritebank = data & 0x01; - return; - - case 0x0400: - watchdog = 0; - return; - - case 0x0800: - soundlatch = data; - return; - - case 0x0c00: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x1c00: - scrolldata = data; - return; - } -} - -static UINT8 circusc_main_read(UINT16 address) -{ - switch (address) - { - case 0x1000: - return DrvInputs[0]; - - case 0x1001: - return DrvInputs[1]; - - case 0x1002: - return DrvInputs[2]; - - case 0x1003: - return 0; - - case 0x1400: - return DrvDips[0]; - - case 0x1800: - return DrvDips[1]; - } - - return 0; -} - -static void __fastcall circusc_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - snlatch = data; - return; - - case 0xa001: - SN76496Write(0, snlatch); - return; - - case 0xa002: - SN76496Write(1, snlatch); - return; - - case 0xa003: - DACWrite(0, data); - return; - - case 0xa004: - case 0xa07c: - // discrete - return; - } -} - -static UINT8 __fastcall circusc_sound_read(UINT16 address) -{ - switch (address) - { - case 0x6000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - - case 0x8000: - return (ZetTotalCycles() / 0x200) & 0x1e; - } - - return 0; -} - -static INT32 DrvDACSync() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3579545.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - DACReset(); - - watchdog = 0; - soundlatch = 0; - irqmask = 0; - spritebank = 0; - scrolldata = 0; - snlatch = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x00a000; - DrvM6809ROMDec = Next; Next += 0x00a000; - DrvZ80ROM = Next; Next += 0x004000; - - DrvGfxROM0 = Next; Next += 0x018000; - DrvGfxROM1 = Next; Next += 0x028000; - - DrvColPROM = Next; Next += 0x000220; - - DrvTransTable = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x200 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM = Next; Next += 0x02000; - DrvColRAM = Next; Next += 0x00400; - DrvVidRAM = Next; Next += 0x00400; - DrvSprRAM = Next; Next += 0x00200; - - DrvZ80RAM = Next; Next += 0x00400; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void M6809Decode() -{ - for (INT32 i = 0; i < 0xa000; i++) { - DrvM6809ROMDec[i] = DrvM6809ROM[i] ^ (((i&2)?0x80:0x20)|((i&8)?0x08:0x02)); - } -} - -static void DrvGfxExpand(UINT8 *src, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i-=2) { - src[i+0] = src[i/2] >> 4; - src[i+1] = src[i/2] & 0xf; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - - if (BurnLoadRom(DrvM6809ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x02000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a000, 14, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00120, 17, 1)) return 1; - - M6809Decode(); - DrvGfxExpand(DrvGfxROM0, 0x4000); - DrvGfxExpand(DrvGfxROM1, 0xc000); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x2000, 0x2fff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x3000, 0x33ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x3400, 0x37ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x3800, 0x39ff, MAP_RAM); - M6809MapMemory(DrvM6809RAM + 0x1a00, 0x3a00, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM, 0x6000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809ROMDec, 0x6000, 0xffff, MAP_FETCH); - M6809SetWriteHandler(circusc_main_write); - M6809SetReadHandler(circusc_main_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - for (INT32 i = 0; i < 0x2000; i+=0x400) { - ZetMapMemory(DrvZ80RAM, 0x4000+i, 0x43ff+i, MAP_RAM); - } - ZetSetWriteHandler(circusc_sound_write); - ZetSetReadHandler(circusc_sound_read); - ZetClose(); - - SN76496Init(0, 1789772, 0); - SN76496Init(1, 1789772, 1); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvDACSync); - DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - ZetExit(); - - SN76496Exit(); - DACExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pens[32]; - - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = bit2 * 151 + bit1 * 71 + bit0 * 33; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = bit2 * 151 + bit1 * 71 + bit0 * 33; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = bit1 * 174 + bit0 * 81; - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) { - DrvPalette[i] = pens[(DrvColPROM[i+0x20] & 0xf) + ((~i & 0x100)>>4)]; - DrvTransTable[i] = (DrvPalette[i] ? 0xff : 0); - } -} - -static void draw_layer(INT32 priority) -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - if (sx >= 80) sy -= scrolldata; - if (sy < -7) sy += 256; - - sy -= 16; - if (sy < -7 || sy >= nScreenHeight) continue; - - INT32 attr = DrvColRAM[offs]; - INT32 prio = attr & 0x10; - if (priority != prio) continue; - - INT32 code = DrvVidRAM[offs] + ((attr & 0x20) * 8); - INT32 color = attr & 0x0f; - INT32 flipy = attr & 0x80; - INT32 flipx = attr & 0x40; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - UINT8 *spriteram = DrvSprRAM + (spritebank * 0x100); - - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - INT32 attr = spriteram[offs + 1]; - INT32 code = spriteram[offs + 0] + ((attr & 0x20) * 8); - INT32 sx = spriteram[offs + 2]; - INT32 sy = spriteram[offs + 3]; - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - - RenderTileTranstab(pTransDraw, DrvGfxROM1, code, color*16+0x100, 0, sx, sy - 16, flipx, flipy, 16, 16, DrvTransTable); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(0x10); - draw_sprites(); - draw_layer(0x00); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - } - - INT32 nInterleave = 32; - INT32 nCyclesTotal[2] = { 2048000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (irqmask) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - ZetScan(nAction); - - DACScan(nAction, pnMin); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(snlatch); - SCAN_VAR(soundlatch); - SCAN_VAR(irqmask); - SCAN_VAR(spritebank); - SCAN_VAR(scrolldata); - } - - return 0; -} - - -// Circus Charlie (level select, set 1) - -static struct BurnRomInfo circuscRomDesc[] = { - { "380_s05.3h", 0x2000, 0x48feafcf, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code (Encrypted) - { "380_q04.4h", 0x2000, 0xc283b887, 1 | BRF_PRG | BRF_ESS }, // 1 - { "380_q03.5h", 0x2000, 0xe90c0e86, 1 | BRF_PRG | BRF_ESS }, // 2 - { "380_q02.6h", 0x2000, 0x4d847dc6, 1 | BRF_PRG | BRF_ESS }, // 3 - { "380_q01.7h", 0x2000, 0x18c20adf, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "380_l14.5c", 0x2000, 0x607df0fb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "380_l15.7c", 0x2000, 0xa6ad30e1, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "380_j12.4a", 0x2000, 0x56e5b408, 3 | BRF_GRA }, // 7 Tiles - { "380_j13.5a", 0x2000, 0x5aca0193, 3 | BRF_GRA }, // 8 - - { "380_j06.11e", 0x2000, 0xdf0405c6, 4 | BRF_GRA }, // 9 Sprites - { "380_j07.12e", 0x2000, 0x23dfe3a6, 4 | BRF_GRA }, // 10 - { "380_j08.13e", 0x2000, 0x3ba95390, 4 | BRF_GRA }, // 11 - { "380_j09.14e", 0x2000, 0xa9fba85a, 4 | BRF_GRA }, // 12 - { "380_j10.15e", 0x2000, 0x0532347e, 4 | BRF_GRA }, // 13 - { "380_j11.16e", 0x2000, 0xe1725d24, 4 | BRF_GRA }, // 14 - - { "380_j18.2a", 0x0020, 0x10dd4eaa, 5 | BRF_GRA }, // 15 Color PROMs - { "380_j17.7b", 0x0100, 0x13989357, 5 | BRF_GRA }, // 16 - { "380_j16.10c", 0x0100, 0xc244f2aa, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(circusc) -STD_ROM_FN(circusc) - -struct BurnDriver BurnDrvCircusc = { - "circusc", NULL, NULL, NULL, "1984", - "Circus Charlie (level select, set 1)\0", NULL, "Konami", "GX380", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, circuscRomInfo, circuscRomName, NULL, NULL, CircuscInputInfo, CircuscDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Circus Charlie (level select, set 2) - -static struct BurnRomInfo circusc2RomDesc[] = { - { "380_w05.3h", 0x2000, 0x87df9f5e, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code (Encrypted) - { "380_q04.4h", 0x2000, 0xc283b887, 1 | BRF_PRG | BRF_ESS }, // 1 - { "380_q03.5h", 0x2000, 0xe90c0e86, 1 | BRF_PRG | BRF_ESS }, // 2 - { "380_q02.6h", 0x2000, 0x4d847dc6, 1 | BRF_PRG | BRF_ESS }, // 3 - { "380_q01.7h", 0x2000, 0x18c20adf, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "380_l14.5c", 0x2000, 0x607df0fb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "380_l15.7c", 0x2000, 0xa6ad30e1, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "380_j12.4a", 0x2000, 0x56e5b408, 3 | BRF_GRA }, // 7 Tiles - { "380_k13.5a", 0x2000, 0x5aca0193, 3 | BRF_GRA }, // 8 - - { "380_j06.11e", 0x2000, 0xdf0405c6, 4 | BRF_GRA }, // 9 Sprites - { "380_j07.12e", 0x2000, 0x23dfe3a6, 4 | BRF_GRA }, // 10 - { "380_j08.13e", 0x2000, 0x3ba95390, 4 | BRF_GRA }, // 11 - { "380_j09.14e", 0x2000, 0xa9fba85a, 4 | BRF_GRA }, // 12 - { "380_j10.15e", 0x2000, 0x0532347e, 4 | BRF_GRA }, // 13 - { "380_j11.16e", 0x2000, 0xe1725d24, 4 | BRF_GRA }, // 14 - - { "380_j18.2a", 0x0020, 0x10dd4eaa, 5 | BRF_GRA }, // 15 Color PROMs - { "380_j17.7b", 0x0100, 0x13989357, 5 | BRF_GRA }, // 16 - { "380_j16.10c", 0x0100, 0xc244f2aa, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(circusc2) -STD_ROM_FN(circusc2) - -struct BurnDriver BurnDrvCircusc2 = { - "circusc2", "circusc", NULL, NULL, "1984", - "Circus Charlie (level select, set 2)\0", NULL, "Konami", "GX380", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, circusc2RomInfo, circusc2RomName, NULL, NULL, CircuscInputInfo, CircuscDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Circus Charlie (level select, set 3) - -static struct BurnRomInfo circusc3RomDesc[] = { - { "380_w05.3h", 0x2000, 0x87df9f5e, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code (Encrypted) - { "380_r04.4h", 0x2000, 0xc283b887, 1 | BRF_PRG | BRF_ESS }, // 1 - { "380_r03.5h", 0x2000, 0xe90c0e86, 1 | BRF_PRG | BRF_ESS }, // 2 - { "380_r02.6h", 0x2000, 0x2d434c6f, 1 | BRF_PRG | BRF_ESS }, // 3 - { "380_q01.7h", 0x2000, 0x18c20adf, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "380_l14.5c", 0x2000, 0x607df0fb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "380_l15.7c", 0x2000, 0xa6ad30e1, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "380_j12.4a", 0x2000, 0x56e5b408, 3 | BRF_GRA }, // 7 Tiles - { "380_j13.5a", 0x2000, 0x5aca0193, 3 | BRF_GRA }, // 8 - - { "380_j06.11e", 0x2000, 0xdf0405c6, 4 | BRF_GRA }, // 9 Sprites - { "380_j07.12e", 0x2000, 0x23dfe3a6, 4 | BRF_GRA }, // 10 - { "380_j08.13e", 0x2000, 0x3ba95390, 4 | BRF_GRA }, // 11 - { "380_j09.14e", 0x2000, 0xa9fba85a, 4 | BRF_GRA }, // 12 - { "380_j10.15e", 0x2000, 0x0532347e, 4 | BRF_GRA }, // 13 - { "380_j11.16e", 0x2000, 0xe1725d24, 4 | BRF_GRA }, // 14 - - { "380_j18.2a", 0x0020, 0x10dd4eaa, 5 | BRF_GRA }, // 15 Color PROMs - { "380_j17.7b", 0x0100, 0x13989357, 5 | BRF_GRA }, // 16 - { "380_j16.10c", 0x0100, 0xc244f2aa, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(circusc3) -STD_ROM_FN(circusc3) - -struct BurnDriver BurnDrvCircusc3 = { - "circusc3", "circusc", NULL, NULL, "1984", - "Circus Charlie (level select, set 3)\0", NULL, "Konami", "GX380", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, circusc3RomInfo, circusc3RomName, NULL, NULL, CircuscInputInfo, CircuscDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Circus Charlie (no level select) - -static struct BurnRomInfo circusc4RomDesc[] = { - { "380_r05.3h", 0x2000, 0xed52c60f, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code (Encrypted) - { "380_n04.4h", 0x2000, 0xfcc99e33, 1 | BRF_PRG | BRF_ESS }, // 1 - { "380_n03.5h", 0x2000, 0x5ef5b3b5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "380_n02.6h", 0x2000, 0xa5a5e796, 1 | BRF_PRG | BRF_ESS }, // 3 - { "380_n01.7h", 0x2000, 0x70d26721, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "380_l14.5c", 0x2000, 0x607df0fb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "380_l15.7c", 0x2000, 0xa6ad30e1, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "380_j12.4a", 0x2000, 0x56e5b408, 3 | BRF_GRA }, // 7 Tiles - { "380_j13.5a", 0x2000, 0x5aca0193, 3 | BRF_GRA }, // 8 - - { "380_j06.11e", 0x2000, 0xdf0405c6, 4 | BRF_GRA }, // 9 Sprites - { "380_j07.12e", 0x2000, 0x23dfe3a6, 4 | BRF_GRA }, // 10 - { "380_j08.13e", 0x2000, 0x3ba95390, 4 | BRF_GRA }, // 11 - { "380_j09.14e", 0x2000, 0xa9fba85a, 4 | BRF_GRA }, // 12 - { "380_j10.15e", 0x2000, 0x0532347e, 4 | BRF_GRA }, // 13 - { "380_j11.16e", 0x2000, 0xe1725d24, 4 | BRF_GRA }, // 14 - - { "380_j18.2a", 0x0020, 0x10dd4eaa, 5 | BRF_GRA }, // 15 Color PROMs - { "380_j17.7b", 0x0100, 0x13989357, 5 | BRF_GRA }, // 16 - { "380_j16.10c", 0x0100, 0xc244f2aa, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(circusc4) -STD_ROM_FN(circusc4) - -struct BurnDriver BurnDrvCircusc4 = { - "circusc4", "circusc", NULL, NULL, "1984", - "Circus Charlie (no level select)\0", NULL, "Konami", "GX380", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, circusc4RomInfo, circusc4RomName, NULL, NULL, CircuscInputInfo, CircuscDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Circus Charlie (Centuri) - -static struct BurnRomInfo circusccRomDesc[] = { - { "380_u05.3h", 0x2000, 0x964c035a, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code (Encrypted) - { "380_p04.4h", 0x2000, 0xdd0c0ee7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "380_p03.5h", 0x2000, 0x190247af, 1 | BRF_PRG | BRF_ESS }, // 2 - { "380_p02.6h", 0x2000, 0x7e63725e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "380_p01.7h", 0x2000, 0xeedaa5b2, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "380_l14.5c", 0x2000, 0x607df0fb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "380_l15.7c", 0x2000, 0xa6ad30e1, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "380_j12.4a", 0x2000, 0x56e5b408, 3 | BRF_GRA }, // 7 Tiles - { "380_j13.5a", 0x2000, 0x5aca0193, 3 | BRF_GRA }, // 8 - - { "380_j06.11e", 0x2000, 0xdf0405c6, 4 | BRF_GRA }, // 9 Sprites - { "380_j07.12e", 0x2000, 0x23dfe3a6, 4 | BRF_GRA }, // 10 - { "380_j08.13e", 0x2000, 0x3ba95390, 4 | BRF_GRA }, // 11 - { "380_j09.14e", 0x2000, 0xa9fba85a, 4 | BRF_GRA }, // 12 - { "380_j10.15e", 0x2000, 0x0532347e, 4 | BRF_GRA }, // 13 - { "380_j11.16e", 0x2000, 0xe1725d24, 4 | BRF_GRA }, // 14 - - { "380_j18.2a", 0x0020, 0x10dd4eaa, 5 | BRF_GRA }, // 15 Color PROMs - { "380_j17.7b", 0x0100, 0x13989357, 5 | BRF_GRA }, // 16 - { "380_j16.10c", 0x0100, 0xc244f2aa, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(circuscc) -STD_ROM_FN(circuscc) - -struct BurnDriver BurnDrvCircuscc = { - "circuscc", "circusc", NULL, NULL, "1984", - "Circus Charlie (Centuri)\0", NULL, "Konami (Centuri license)", "GX380", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, circusccRomInfo, circusccRomName, NULL, NULL, CircuscInputInfo, CircuscDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Circus Charlie (Centuri, earlier) - -static struct BurnRomInfo circusceRomDesc[] = { - { "380_p05.3h", 0x2000, 0x7ca74494, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code (Encrypted) - { "380_p04.4h", 0x2000, 0xdd0c0ee7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "380_p03.5h", 0x2000, 0x190247af, 1 | BRF_PRG | BRF_ESS }, // 2 - { "380_p02.6h", 0x2000, 0x7e63725e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "380_p01.7h", 0x2000, 0xeedaa5b2, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "380_l14.5c", 0x2000, 0x607df0fb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "380_l15.7c", 0x2000, 0xa6ad30e1, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "380_j12.4a", 0x2000, 0x56e5b408, 3 | BRF_GRA }, // 7 Tiles - { "380_j13.5a", 0x2000, 0x5aca0193, 3 | BRF_GRA }, // 8 - - { "380_j06.11e", 0x2000, 0xdf0405c6, 4 | BRF_GRA }, // 9 Sprites - { "380_j07.12e", 0x2000, 0x23dfe3a6, 4 | BRF_GRA }, // 10 - { "380_j08.13e", 0x2000, 0x3ba95390, 4 | BRF_GRA }, // 11 - { "380_j09.14e", 0x2000, 0xa9fba85a, 4 | BRF_GRA }, // 12 - { "380_j10.15e", 0x2000, 0x0532347e, 4 | BRF_GRA }, // 13 - { "380_j11.16e", 0x2000, 0xe1725d24, 4 | BRF_GRA }, // 14 - - { "380_j18.2a", 0x0020, 0x10dd4eaa, 5 | BRF_GRA }, // 15 Color PROMs - { "380_j17.7b", 0x0100, 0x13989357, 5 | BRF_GRA }, // 16 - { "380_j16.10c", 0x0100, 0xc244f2aa, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(circusce) -STD_ROM_FN(circusce) - -struct BurnDriver BurnDrvCircusce = { - "circusce", "circusc", NULL, NULL, "1984", - "Circus Charlie (Centuri, earlier)\0", NULL, "Konami (Centuri license)", "GX380", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, circusceRomInfo, circusceRomName, NULL, NULL, CircuscInputInfo, CircuscDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_contra.cpp b/jan/src/burn/drv/konami/d_contra.cpp deleted file mode 100644 index 538c18b98..000000000 --- a/jan/src/burn/drv/konami/d_contra.cpp +++ /dev/null @@ -1,1406 +0,0 @@ -// FB Alpha Contra driver module -// Based on MAME driver by Carlos A. Lozano, Phil Stroffolino, Jose T. Gomez, and Eric Hustvedt - -#include "tiles_generic.h" -#include "burn_ym2151.h" -#include "m6809_intf.h" -#include "hd6309_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvHD6309ROM0; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvHD6309RAM0; -static UINT8 *DrvHD6309RAM1; -static UINT8 *DrvM6809RAM0; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvPROMs; -static UINT8 *DrvColTable; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgCRAM; -static UINT8 *DrvFgVRAM; -static UINT8 *DrvTxCRAM; -static UINT8 *DrvTxVRAM; -static UINT8 *DrvBgCRAM; -static UINT8 *DrvBgVRAM; -static UINT8 *DrvSprRAM; -static UINT32 *DrvPalette; -static UINT32 *Palette; -static UINT8 DrvRecalc; -static UINT8 *pDrvSprRAM0; -static UINT8 *pDrvSprRAM1; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDip[3]; -static UINT8 DrvReset; - -static UINT8 soundlatch; -static UINT8 nBankData; - -static UINT8 K007121_ctrlram[2][8]; -static INT32 K007121_flipscreen[2]; - -static struct BurnInputInfo DrvInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 3, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 1, "p1 right" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy2 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy2 + 3, "p1 down" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy1 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 4, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 1, "p2 right" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 3, "p2 down" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset, "reset" }, - {"Service" , BIT_DIGITAL , DrvJoy1 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1, "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x5a, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0x12, 0xfe, 0, 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0x12, 0xfe, 0, 15, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0x13, 0xfe, 0, 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, // 4 in test mode - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0x13, 0xfe, 0, 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "30000 70000" }, - {0x13, 0x01, 0x18, 0x10, "40000 80000" }, - {0x13, 0x01, 0x18, 0x08, "40000" }, - {0x13, 0x01, 0x18, 0x00, "50000" }, - - {0x13, 0xfe, 0, 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0x13, 0xfe, 0, 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0x14, 0xfe, 0, 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0x14, 0xfe, 0, 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0x14, 0xfe, 0, 2, "Sound" }, - {0x14, 0x01, 0x08, 0x00, "Mono" }, - {0x14, 0x01, 0x08, 0x08, "Stereo" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo CabinetDIPList[]= -{ - - {0x13, 0xfe, 0, 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0x14, 0xfe, 0, 2, "Upright Controls" }, - {0x14, 0x02, 0x02, 0x02, "Single" }, - {0x13, 0x00, 0x04, 0x00, NULL}, - {0x14, 0x02, 0x02, 0x00, "Dual" }, - {0x13, 0x00, 0x04, 0x00, NULL}, -}; - -STDDIPINFOEXT(Gryzor, Drv, Cabinet) - -static void K007121_ctrl_w(INT32 chip, INT32 offset, INT32 data) -{ - if (offset == 7) K007121_flipscreen[chip] = data & 0x08; - - K007121_ctrlram[chip][offset] = data; -} - -static void contra_K007121_ctrl_0_w(INT32 offset, INT32 data) -{ - if (offset == 3) - { - if (data & 0x08) - memcpy (pDrvSprRAM0, DrvSprRAM + 0x000, 0x800); - else - memcpy (pDrvSprRAM0, DrvSprRAM + 0x800, 0x800); - } - - K007121_ctrl_w(0,offset,data); -} - -static void contra_K007121_ctrl_1_w(INT32 offset, INT32 data) -{ - if (offset == 3) - { - if (data&0x8) - memcpy(pDrvSprRAM1, DrvHD6309RAM1 + 0x0800, 0x800); - else - memcpy(pDrvSprRAM1, DrvHD6309RAM1 + 0x1000, 0x800); - } - - K007121_ctrl_w(1,offset,data); -} - -void contra_bankswitch_w(INT32 data) -{ - nBankData = data & 0x0f; - INT32 bankaddress = 0x10000 + nBankData * 0x2000; - - if (bankaddress < 0x28000) - HD6309MapMemory(DrvHD6309ROM0 + bankaddress, 0x6000, 0x7fff, MAP_ROM); -} - -UINT8 DrvContraHD6309ReadByte(UINT16 address) -{ - switch (address) - { - case 0x0010: - case 0x0011: - case 0x0012: - return DrvInputs[address & 3]; - - case 0x0014: - case 0x0015: - case 0x0016: - return DrvDip[address & 3]; - } - - return 0; -} - -void DrvContraHD6309WriteByte(UINT16 address, UINT8 data) -{ - if ((address & 0xff00) == 0x0c00) { - INT32 offset = address & 0xff; - - DrvPalRAM[offset] = data; - - UINT16 col = DrvPalRAM[offset & ~1] | (DrvPalRAM[offset | 1] << 8); - - UINT8 r, g, b; - - r = (col >> 0) & 0x1f; - r = (r << 3) | (r >> 2); - - g = (col >> 5) & 0x1f; - g = (g << 3) | (g >> 2); - - b = (col >> 10) & 0x1f; - b = (b << 3) | (b >> 2); - - UINT32 color = (r << 16) | (g << 8) | b; - - DrvRecalc = 1; - Palette[offset >> 1] = color; - - return; - } - - switch (address) - { - case 0x0000: - case 0x0001: - case 0x0002: - case 0x0003: - case 0x0004: - case 0x0005: - case 0x0006: - case 0x0007: - contra_K007121_ctrl_0_w(address & 7, data); - return; - - case 0x0018: - // coin counter - return; - - case 0x001a: - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - return; - - case 0x001c: - soundlatch = data; - return; - - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - contra_K007121_ctrl_1_w(address & 7, data); - return; - - case 0x7000: - contra_bankswitch_w(data); - return; - } -} - -UINT8 DrvContraM6809SoundReadByte(UINT16 address) -{ - switch (address) - { - case 0x0000: - return soundlatch; - - case 0x2001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -void DrvContraM6809SoundWriteByte(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - BurnYM2151SelectRegister(data); - return; - - case 0x2001: - BurnYM2151WriteRegister(data); - return; - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvHD6309ROM0 = Next; Next += 0x030000; - DrvM6809ROM0 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x100000; - - DrvPROMs = Next; Next += 0x000400; - - DrvColTable = Next; Next += 0x001000; - - DrvPalette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - - AllRam = Next; - - DrvHD6309RAM0 = Next; Next += 0x001000; - DrvHD6309RAM1 = Next; Next += 0x001800; - DrvM6809RAM0 = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000100; - DrvFgCRAM = Next; Next += 0x000400; - DrvFgVRAM = Next; Next += 0x000400; - DrvTxCRAM = Next; Next += 0x000400; - DrvTxVRAM = Next; Next += 0x000400; - DrvBgCRAM = Next; Next += 0x000400; - DrvBgVRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x001000; - - pDrvSprRAM0 = Next; Next += 0x000800; - pDrvSprRAM1 = Next; Next += 0x000800; - - Palette = (UINT32*)Next; Next += 0x00080 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxExpand(UINT8 *src) -{ - for (INT32 i = 0x80000-1; i>=0; i--) { - src[i*2+1] = src[i] & 0xf; - src[i*2+0] = src[i] >> 4; - } - - return 0; -} - -static INT32 DrvColorTableInit() -{ - for (INT32 chip = 0; chip < 2; chip++) - { - for (INT32 pal = 0; pal < 8; pal++) - { - INT32 clut = ((chip << 1) | (pal & 1)) << 8; - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 ctabentry; - - if (((pal & 0x01) == 0) && (DrvPROMs[clut | i] == 0)) - ctabentry = 0; - else - ctabentry = (pal << 4) | (DrvPROMs[clut | i] & 0x0f); - - DrvColTable[(chip << 11) | (pal << 8) | i] = ctabentry; - } - } - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - memset (K007121_ctrlram, 0, sizeof(K007121_ctrlram)); - memset (K007121_flipscreen, 0, sizeof(K007121_flipscreen)); - - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - M6809Open(0); - M6809Reset(); - BurnYM2151Reset(); - M6809Close(); - - soundlatch = 0; - nBankData = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 CommonInit(INT32 (*pRomLoad)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (pRomLoad) { - if (pRomLoad()) return 1; - } - - DrvGfxExpand(DrvGfxROM0); - DrvGfxExpand(DrvGfxROM1); - - DrvColorTableInit(); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvPalRAM, 0x0c00, 0x0cff, MAP_ROM); - HD6309MapMemory(DrvHD6309RAM0, 0x1000, 0x1fff, MAP_RAM); - HD6309MapMemory(DrvFgCRAM, 0x2000, 0x23ff, MAP_RAM); - HD6309MapMemory(DrvFgVRAM, 0x2400, 0x27ff, MAP_RAM); - HD6309MapMemory(DrvTxCRAM, 0x2800, 0x2bff, MAP_RAM); - HD6309MapMemory(DrvTxVRAM, 0x2c00, 0x2fff, MAP_RAM); - HD6309MapMemory(DrvSprRAM, 0x3000, 0x3fff, MAP_RAM); - HD6309MapMemory(DrvBgCRAM, 0x4000, 0x43ff, MAP_RAM); - HD6309MapMemory(DrvBgVRAM, 0x4400, 0x47ff, MAP_RAM); - HD6309MapMemory(DrvHD6309RAM1, 0x4800, 0x5fff, MAP_RAM); -// HD6309MapMemory(DrvHD6309ROM0 + 0x10000, 0x6000, 0x7fff, MAP_ROM); - HD6309MapMemory(DrvHD6309ROM0 + 0x08000, 0x8000, 0xffff, MAP_ROM); - HD6309SetReadHandler(DrvContraHD6309ReadByte); - HD6309SetWriteHandler(DrvContraHD6309WriteByte); - HD6309Close(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM0, 0x6000, 0x67ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0 + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetReadHandler(DrvContraM6809SoundReadByte); - M6809SetWriteHandler(DrvContraM6809SoundWriteByte); - M6809Close(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.60, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.60, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 CommonRomLoad() -{ - if (BurnLoadRom(DrvHD6309ROM0 + 0x20000, 0, 1)) return 1; - memcpy (DrvHD6309ROM0 + 0x08000, DrvHD6309ROM0 + 0x28000, 0x08000); - if (BurnLoadRom(DrvHD6309ROM0 + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 6, 2)) return 1; - - if (BurnLoadRom(DrvPROMs + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvPROMs + 0x000100, 8, 1)) return 1; - if (BurnLoadRom(DrvPROMs + 0x000200, 9, 1)) return 1; - if (BurnLoadRom(DrvPROMs + 0x000300, 10, 1)) return 1; - - return 0; -} - -static INT32 BootlegRomLoad() -{ - if (BurnLoadRom(DrvHD6309ROM0 + 0x20000, 0, 1)) return 1; - memcpy (DrvHD6309ROM0 + 0x08000, DrvHD6309ROM0 + 0x28000, 0x08000); - if (BurnLoadRom(DrvHD6309ROM0 + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x30000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x50000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x60000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x70000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 17, 1)) return 1; -// 70000-7ffff empty - - if (BurnLoadRom(DrvPROMs + 0x000000, 18, 1)) return 1; - if (BurnLoadRom(DrvPROMs + 0x000100, 19, 1)) return 1; - if (BurnLoadRom(DrvPROMs + 0x000200, 20, 1)) return 1; - if (BurnLoadRom(DrvPROMs + 0x000300, 21, 1)) return 1; - - return 0; -} - -static INT32 ContraeRomLoad() -{ - if (BurnLoadRom(DrvHD6309ROM0 + 0x20000, 0, 1)) return 1; - memcpy (DrvHD6309ROM0 + 0x08000, DrvHD6309ROM0 + 0x28000, 0x08000); - if (BurnLoadRom(DrvHD6309ROM0 + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x060000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x060001, 10, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020001, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060001, 18, 2)) return 1; - - if (BurnLoadRom(DrvPROMs + 0x000000, 19, 1)) return 1; - if (BurnLoadRom(DrvPROMs + 0x000100, 20, 1)) return 1; - if (BurnLoadRom(DrvPROMs + 0x000200, 21, 1)) return 1; - if (BurnLoadRom(DrvPROMs + 0x000300, 22, 1)) return 1; - - return 0; -} - -static INT32 DrvInit() { return CommonInit(CommonRomLoad); } -static INT32 BootInit() { return CommonInit(BootlegRomLoad); } -static INT32 ContraeInit() { return CommonInit(ContraeRomLoad); } - -static INT32 DrvExit() -{ - GenericTilesExit(); - - HD6309Exit(); - M6809Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_bg() -{ - INT32 bit0 = (K007121_ctrlram[1][0x05] >> 0) & 0x03; - INT32 bit1 = (K007121_ctrlram[1][0x05] >> 2) & 0x03; - INT32 bit2 = (K007121_ctrlram[1][0x05] >> 4) & 0x03; - INT32 bit3 = (K007121_ctrlram[1][0x05] >> 6) & 0x03; - INT32 mask = (K007121_ctrlram[1][0x04] & 0xf0) >> 4; - INT32 scrollx = K007121_ctrlram[1][0x00] & 0xff; - INT32 scrolly = K007121_ctrlram[1][0x02] & 0xff; - INT32 flipscreen = K007121_flipscreen[1]; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sx -= scrollx; - sy -= scrolly; - if (sx < -7) sx += 256; - if (sy < -7) sy += 256; - sx += 40; - sy -= 16; - - INT32 attr = DrvBgCRAM[offs]; - - INT32 bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0+2)) & 0x02) | - ((attr >> (bit1+1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3-1)) & 0x10) | - ((K007121_ctrlram[1][0x03] & 0x01) << 5); - - bank = (bank & ~(mask << 1)) | ((K007121_ctrlram[0][0x04] & mask) << 1); - - INT32 color = ((K007121_ctrlram[1][6]&0x30)*2+16)+(attr&7); - - INT32 code = DrvBgVRAM[offs] | (bank << 8); - - if (flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, (280 - sx)-8, 224 - sy, color, 4, 0x800, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x800, DrvGfxROM1); - } - } -} - -static void draw_fg() -{ - INT32 bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03; - INT32 bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03; - INT32 bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03; - INT32 bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03; - INT32 mask = (K007121_ctrlram[0][0x04] & 0xf0) >> 4; - INT32 scrollx = K007121_ctrlram[0][0x00] & 0xff; - INT32 scrolly = K007121_ctrlram[0][0x02] & 0xff; - INT32 flipscreen = K007121_flipscreen[0]; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sx -= scrollx; - sy -= scrolly; - if (sx < -7) sx += 256; - if (sy < -7) sy += 256; - sx += 40; - sy -= 16; - - INT32 attr = DrvFgCRAM[offs]; - - INT32 bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0+2)) & 0x02) | - ((attr >> (bit1+1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3-1)) & 0x10) | - ((K007121_ctrlram[0][0x03] & 0x01) << 5); - - bank = (bank & ~(mask << 1)) | ((K007121_ctrlram[0][0x04] & mask) << 1); - - INT32 color = ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7); - - INT32 code = DrvFgVRAM[offs] | (bank << 8); - - if (flipscreen) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, (280 - sx)-8, 224 - sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } - } -} - -static void draw_tx() -{ - INT32 bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03; - INT32 bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03; - INT32 bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03; - INT32 bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03; - INT32 flipscreen = K007121_flipscreen[0]; - - for (INT32 offs = 0x40; offs < 0x3c0; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - if (sx > 39) continue; - INT32 sy = (offs >> 5) << 3; - - INT32 attr = DrvTxCRAM[offs]; - - INT32 bank = ((attr & 0x80) >> 7) | - ((attr >> (bit0+2)) & 0x02) | - ((attr >> (bit1+1)) & 0x04) | - ((attr >> (bit2 )) & 0x08) | - ((attr >> (bit3-1)) & 0x10); - - INT32 color = ((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7); - - INT32 code = DrvTxVRAM[offs] | (bank << 8); - - if (flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, (sx ^ 0xf8) + 24, (sy ^ 0xf8) - 16, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM0); - } - } -} - - -static void K007121_sprites_draw(INT32 chip, UINT8 *gfx_base, UINT8 *ctable, - const UINT8 *source, INT32 base_color, - INT32 global_x_offset, INT32 global_y_offset, - INT32 bank_base, INT32 pri_mask, INT32 color_offset) -{ - INT32 flipscreen = K007121_flipscreen[chip]; - INT32 i,num,inc,offs[5],trans; - INT32 is_flakatck = (ctable == NULL); - - if (is_flakatck) - { - num = 0x40; - inc = -0x20; - source += 0x3f << 5; - offs[0] = 0x0e; - offs[1] = 0x0f; - offs[2] = 0x06; - offs[3] = 0x04; - offs[4] = 0x08; - trans = 0; - } - else - { - num = 0x40; - - inc = 5; - offs[0] = 0x00; - offs[1] = 0x01; - offs[2] = 0x02; - offs[3] = 0x03; - offs[4] = 0x04; - trans = 0; - - if (pri_mask != -1) - { - source += (num-1)*inc; - inc = -inc; - } - } - - for (i = 0;i < num;i++) - { - INT32 number = source[offs[0]]; - INT32 sprite_bank = source[offs[1]] & 0x0f; - INT32 sx = source[offs[3]]; - INT32 sy = source[offs[2]]; - INT32 attr = source[offs[4]]; - INT32 color = base_color + ((source[offs[1]] & 0xf0) >> 4); - INT32 xflip = attr & 0x10; - INT32 yflip = attr & 0x20; - INT32 width,height; - INT32 transparent_color = 0; - static const INT32 x_offset[4] = {0x0,0x1,0x4,0x5}; - static const INT32 y_offset[4] = {0x0,0x2,0x8,0xa}; - INT32 x,y, ex, ey; - - if (attr & 0x01) sx -= 256; - if (sy >= 240) sy -= 256; - - number += ((sprite_bank & 0x3) << 8) + ((attr & 0xc0) << 4); - number = number << 2; - number += (sprite_bank >> 2) & 3; - - if (!is_flakatck || source[0x00]) - { - number += bank_base; - - switch (attr & 0x0e) - { - case 0x06: width = height = 1; break; - case 0x04: width = 1; height = 2; number &= (~2); break; - case 0x02: width = 2; height = 1; number &= (~1); break; - case 0x00: width = height = 2; number &= (~3); break; - case 0x08: width = height = 4; number &= (~3); break; - default: width = 1; height = 1; - } - - for (y = 0; y < height; y++) - { - for (x = 0;x < width;x++) - { - ex = xflip ? (width-1-x) : x; - ey = yflip ? (height-1-y) : y; - - if (flipscreen) - { - if (pri_mask != -1) - ;// not implemented - else - if (yflip) { - if (xflip) { - Render8x8Tile_Mask_Clip(pTransDraw, number + x_offset[ex] + y_offset[ey], 248-(sx+x*8)-global_x_offset+24, 248-(sy+y*8)+global_y_offset, color, 4, transparent_color, color_offset, gfx_base); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, number + x_offset[ex] + y_offset[ey], 248-(sx+x*8)-global_x_offset+24, 248-(sy+y*8)+global_y_offset, color, 4, transparent_color, color_offset, gfx_base); - } - } else { - if (xflip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, number + x_offset[ex] + y_offset[ey], 248-(sx+x*8)-global_x_offset+24, 248-(sy+y*8)+global_y_offset, color, 4, transparent_color, color_offset, gfx_base); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, number + x_offset[ex] + y_offset[ey], 248-(sx+x*8)-global_x_offset+24, 248-(sy+y*8)+global_y_offset, color, 4, transparent_color, color_offset, gfx_base); - } - } - } - else - { - if (pri_mask != -1) - ;// not implemented - else - if (yflip) { - if (xflip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, number + x_offset[ex] + y_offset[ey], global_x_offset+sx+x*8, (sy+y*8)+global_y_offset, color, 4, transparent_color, color_offset, gfx_base); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, number + x_offset[ex] + y_offset[ey], global_x_offset+sx+x*8, (sy+y*8)+global_y_offset, color, 4, transparent_color, color_offset, gfx_base); - } - } else { - if (xflip) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, number + x_offset[ex] + y_offset[ey], global_x_offset+sx+x*8, (sy+y*8)+global_y_offset, color, 4, transparent_color, color_offset, gfx_base); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, number + x_offset[ex] + y_offset[ey], global_x_offset+sx+x*8, (sy+y*8)+global_y_offset, color, 4, transparent_color, color_offset, gfx_base); - } - } - } - } - } - } - - source += inc; - } -} - -static void draw_sprites(INT32 bank, UINT8 *gfx_base, INT32 color_offset) -{ - INT32 base_color = (K007121_ctrlram[bank][6]&0x30)<<1; - const UINT8 *source = bank ? pDrvSprRAM1 : pDrvSprRAM0; - - K007121_sprites_draw(bank, gfx_base, DrvColTable, source, base_color, 40, -16, 0, -1, color_offset); -} - - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i++) { - INT32 rgb = Palette[DrvColTable[i]]; - DrvPalette[i] = BurnHighCol((rgb >> 16)&0xff, (rgb >> 8)&0xff, rgb&0xff, 0); - } - DrvRecalc = 0; - } - - draw_bg(); - draw_fg(); - - draw_sprites(0, DrvGfxROM0, 0x000); - draw_sprites(1, DrvGfxROM1, 0x800); - - draw_tx(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - INT32 nInterleave = 256; - - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = DrvInputs[1] = DrvInputs[2] = 0xff; - - for (INT32 i = 0 ; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - } - - INT32 nCyclesSegment = 0; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - HD6309Open(0); - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += HD6309Run(nCyclesSegment); - if (i == 240 && (K007121_ctrlram[0][7] & 0x02)) { - HD6309SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += M6809Run(nCyclesSegment); - - if (pBurnSoundOut && i%16 == 15) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 16); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - M6809Close(); - HD6309Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - M6809Open(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - M6809Close(); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029696; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = K007121_ctrlram; - ba.nLen = sizeof(K007121_ctrlram); - ba.szName = "K007121 Control RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - HD6309Scan(nAction); - M6809Scan(nAction); - - BurnYM2151Scan(nAction); - - SCAN_VAR(K007121_flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(nBankData); - - if (nAction & ACB_WRITE) { - HD6309Open(0); - contra_bankswitch_w(nBankData); - HD6309Close(); - DrvRecalc = 1; - } - } - - return 0; -} - - -// Contra (US / Asia, set 1) - -static struct BurnRomInfo contraRomDesc[] = { - { "633m03.18a", 0x10000, 0xd045e1da, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "633i02.17a", 0x10000, 0xb2f7bd9a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "633e01.12a", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "633e04.7d", 0x40000, 0x14ddc542, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "633e05.7f", 0x40000, 0x42185044, 3 | BRF_GRA }, // 4 - - { "633e06.16d", 0x40000, 0x9cf6faae, 4 | BRF_GRA }, // 5 Chip 1 Tiles - { "633e07.16f", 0x40000, 0xf2d06638, 4 | BRF_GRA }, // 6 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 7 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 8 - { "633f10.18g", 0x00100, 0x2b244d84, 5 | BRF_GRA }, // 9 - { "633f11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 10 - - { "007766.20d.bin", 0x1, 0x00000000, 0 | BRF_NODUMP }, /* PAL16L/A-2CN */ -}; - -STD_ROM_PICK(contra) -STD_ROM_FN(contra) - -struct BurnDriver BurnDrvContra = { - "contra", NULL, NULL, NULL, "1987", - "Contra (US / Asia, set 1)\0", NULL, "Konami", "GX633", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, contraRomInfo, contraRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - - -// Contra (US / Asia, set 2) - -static struct BurnRomInfo contra1RomDesc[] = { - { "633i03.18a", 0x10000, 0x7fc0d8cf, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "633i02.17a", 0x10000, 0xb2f7bd9a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "633e01.12a", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "633e04.7d", 0x40000, 0x14ddc542, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "633e05.7f", 0x40000, 0x42185044, 3 | BRF_GRA }, // 4 - - { "633e06.16d", 0x40000, 0x9cf6faae, 4 | BRF_GRA }, // 5 Chip 1 Tiles - { "633e07.16f", 0x40000, 0xf2d06638, 4 | BRF_GRA }, // 6 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 7 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 8 - { "633f10.18g", 0x00100, 0x2b244d84, 5 | BRF_GRA }, // 9 - { "633f11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 10 - - { "007766.20d.bin", 0x1, 0x00000000, 0 | BRF_NODUMP }, /* PAL16L/A-2CN */ -}; - -STD_ROM_PICK(contra1) -STD_ROM_FN(contra1) - -struct BurnDriver BurnDrvContra1 = { - "contra1", "contra", NULL, NULL, "1987", - "Contra (US / Asia, set 2)\0", NULL, "Konami", "GX633", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, contra1RomInfo, contra1RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - - -// Contra (US / Asia, set 3) - -static struct BurnRomInfo contraeRomDesc[] = { - { "633_e03.18a", 0x10000, 0x7ebdb314, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "633_e02.17a", 0x10000, 0x9d5ebe66, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "633e01.12a", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - // this PCB used official Konami riser-boards in place of the mask roms - { "633_e04_a.7d", 0x10000, 0xe027f330, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "633_e04_b.7d", 0x10000, 0xa71230f5, 3 | BRF_GRA }, // 4 - { "633_e04_c.7d", 0x10000, 0x0b103d01, 3 | BRF_GRA }, // 5 - { "633_e04_d.7d", 0x10000, 0xab3faa60, 3 | BRF_GRA }, // 6 - { "633_e05_a.7f", 0x10000, 0x81a70a77, 3 | BRF_GRA }, // 7 - { "633_e05_b.7f", 0x10000, 0x55556f29, 3 | BRF_GRA }, // 8 - { "633_e05_c.7f", 0x10000, 0xacba86bf, 3 | BRF_GRA }, // 9 - { "633_e05_d.7f", 0x10000, 0x59cf234d, 3 | BRF_GRA }, // 10 - - { "633_e06_a.16d", 0x10000, 0x030079c5, 4 | BRF_GRA }, // 11 Chip 1 Tiles - { "633_e06_b.16d", 0x10000, 0xe17d5807, 4 | BRF_GRA }, // 12 - { "633_e06_c.16d", 0x10000, 0x7d6a28cd, 4 | BRF_GRA }, // 13 - { "633_e06_d.16d", 0x10000, 0x83db378f, 4 | BRF_GRA }, // 14 - { "633_e07_a.16f", 0x10000, 0x8fcd40e5, 4 | BRF_GRA }, // 15 - { "633_e07_b.16f", 0x10000, 0x694e306e, 4 | BRF_GRA }, // 16 - { "633_e07_c.16f", 0x10000, 0xfb33f3ff, 4 | BRF_GRA }, // 17 - { "633_e07_d.16f", 0x10000, 0xcfab0988, 4 | BRF_GRA }, // 18 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 19 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 20 - { "633e10.18g", 0x00100, 0xe782c494, 5 | BRF_GRA }, // 21 - { "633e11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 22 - - { "007766.20d.bin", 0x1, 0x00000000, 0 | BRF_NODUMP }, /* PAL16L/A-2CN */ -}; - -STD_ROM_PICK(contrae) -STD_ROM_FN(contrae) - -struct BurnDriver BurnDrvContrae = { - "contrae", "contra", NULL, NULL, "1987", - "Contra (US / Asia, set 3)\0", NULL, "Konami", "GX633", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, contraeRomInfo, contraeRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - ContraeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - - -// Contra (Japan, set 1) - -static struct BurnRomInfo contrajRomDesc[] = { - { "633n03.18a", 0x10000, 0xfedab568, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "633k02.17a", 0x10000, 0x5d5f7438, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "633e01.12a", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "633e04.7d", 0x40000, 0x14ddc542, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "633e05.7f", 0x40000, 0x42185044, 3 | BRF_GRA }, // 4 - - { "633e06.16d", 0x40000, 0x9cf6faae, 4 | BRF_GRA }, // 5 Chip 1 Tiles - { "633e07.16f", 0x40000, 0xf2d06638, 4 | BRF_GRA }, // 6 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 7 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 8 - { "633f10.18g", 0x00100, 0x2b244d84, 5 | BRF_GRA }, // 9 - { "633f11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 10 - - { "007766.20d.bin", 0x1, 0x00000000, 0 | BRF_NODUMP }, /* PAL16L/A-2CN */ -}; - -STD_ROM_PICK(contraj) -STD_ROM_FN(contraj) - -struct BurnDriver BurnDrvContraj = { - "contraj", "contra", NULL, NULL, "1987", - "Contra (Japan, set 1)\0", NULL, "Konami", "GX633", - L"\u9B42\u6597\u7F85 \u30B3\u30F3\u30C8\u30E9 (Japan, set 1)\0Contra\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, contrajRomInfo, contrajRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - - -// Contra (Japan, set 2) - -static struct BurnRomInfo contraj1RomDesc[] = { - { "633k03.18a", 0x10000, 0xbdb9196d, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "633k02.17a", 0x10000, 0x5d5f7438, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "633e01.12a", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "633e04.7d", 0x40000, 0x14ddc542, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "633e05.7f", 0x40000, 0x42185044, 3 | BRF_GRA }, // 4 - - { "633e06.16d", 0x40000, 0x9cf6faae, 4 | BRF_GRA }, // 5 Chip 1 Tiles - { "633e07.16f", 0x40000, 0xf2d06638, 4 | BRF_GRA }, // 6 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 7 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 8 - { "633f10.18g", 0x00100, 0x2b244d84, 5 | BRF_GRA }, // 9 - { "633f11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 10 - - { "007766.20d.bin", 0x1, 0x00000000, 0 | BRF_NODUMP }, /* PAL16L/A-2CN */ -}; - -STD_ROM_PICK(contraj1) -STD_ROM_FN(contraj1) - -struct BurnDriver BurnDrvContraj1 = { - "contraj1", "contra", NULL, NULL, "1987", - "Contra (Japan, set 2)\0", NULL, "Konami", "GX633", - L"\u9B42\u6597\u7F85 \u30B3\u30F3\u30C8\u30E9 (Japan, set 2)\0Contra\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, contraj1RomInfo, contraj1RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - - -// Gryzor (Set 1) - -static struct BurnRomInfo gryzorRomDesc[] = { - { "633j03.18a", 0x10000, 0x20919162, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "633j02.17a", 0x10000, 0xb5922f9a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "633e01.12a", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "633e04.7d", 0x40000, 0x14ddc542, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "633e05.7f", 0x40000, 0x42185044, 3 | BRF_GRA }, // 4 - - { "633e06.16d", 0x40000, 0x9cf6faae, 4 | BRF_GRA }, // 5 Chip 1 Tiles - { "633e07.16f", 0x40000, 0xf2d06638, 4 | BRF_GRA }, // 6 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 7 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 8 - { "633f10.18g", 0x00100, 0x2b244d84, 5 | BRF_GRA }, // 9 - { "633f11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 10 - - { "007766.20d.bin", 0x1, 0x00000000, 0 | BRF_NODUMP }, /* PAL16L/A-2CN */ -}; - -STD_ROM_PICK(gryzor) -STD_ROM_FN(gryzor) - -struct BurnDriver BurnDrvGryzor = { - "gryzor", "contra", NULL, NULL, "1987", - "Gryzor (Set 1)\0", NULL, "Konami", "GX633", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gryzorRomInfo, gryzorRomName, NULL, NULL, DrvInputInfo, GryzorDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - - -// Gryzor (Set 2) - -static struct BurnRomInfo gryzor1RomDesc[] = { - { "633g2.18a", 0x10000, 0x92ca77bd, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "633g3.17a", 0x10000, 0xbbd9e95e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "633e01.12a", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "633e04.7d", 0x40000, 0x14ddc542, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "633e05.7f", 0x40000, 0x42185044, 3 | BRF_GRA }, // 4 - - { "633e06.16d", 0x40000, 0x9cf6faae, 4 | BRF_GRA }, // 5 Chip 1 Tiles - { "633e07.16f", 0x40000, 0xf2d06638, 4 | BRF_GRA }, // 6 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 7 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 8 - { "633f10.18g", 0x00100, 0x2b244d84, 5 | BRF_GRA }, // 9 - { "633f11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 10 - - { "007766.20d.bin", 0x1, 0x00000000, 0 | BRF_NODUMP }, -}; - -STD_ROM_PICK(gryzor1) -STD_ROM_FN(gryzor1) - -struct BurnDriver BurnDrvGryzor1 = { - "gryzor1", "contra", NULL, NULL, "1987", - "Gryzor (Set 2)\0", NULL, "Konami", "GX633", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gryzor1RomInfo, gryzor1RomName, NULL, NULL, DrvInputInfo, GryzorDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - - -// Contra (bootleg) - -static struct BurnRomInfo contrabRomDesc[] = { - { "3.ic20", 0x10000, 0xd045e1da, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "1.ic19", 0x10000, 0xb2f7bd9a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "3.ic63", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "7.rom", 0x10000, 0x57f467d2, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "10.rom", 0x10000, 0xe6db9685, 3 | BRF_GRA }, // 4 - { "9.rom", 0x10000, 0x875c61de, 3 | BRF_GRA }, // 5 - { "8.rom", 0x10000, 0x642765d6, 3 | BRF_GRA }, // 6 - { "15.rom", 0x10000, 0xdaa2324b, 3 | BRF_GRA }, // 7 - { "16.rom", 0x10000, 0xe27cc835, 3 | BRF_GRA }, // 8 - { "17.rom", 0x10000, 0xce4330b9, 3 | BRF_GRA }, // 9 - { "18.rom", 0x10000, 0x1571ce42, 3 | BRF_GRA }, // 10 - - { "4.rom", 0x10000, 0x2cc7e52c, 4 | BRF_GRA }, // 11 Chip 1 Tiles - { "5.rom", 0x10000, 0xe01a5b9c, 4 | BRF_GRA }, // 12 - { "6.rom", 0x10000, 0xaeea6744, 4 | BRF_GRA }, // 13 - { "14.rom", 0x10000, 0x765afdc7, 4 | BRF_GRA }, // 14 - { "11.rom", 0x10000, 0xbd9ba92c, 4 | BRF_GRA }, // 15 - { "12.rom", 0x10000, 0xd0be7ec2, 4 | BRF_GRA }, // 16 - { "13.rom", 0x10000, 0x2b513d12, 4 | BRF_GRA }, // 17 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 18 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 19 - { "633f10.18g", 0x00100, 0x2b244d84, 5 | BRF_GRA }, // 20 - { "633f11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 21 - - { "conprom.53", 0x00100, 0x05a1da7e, 0 | BRF_OPT }, // 22 -}; - -STD_ROM_PICK(contrab) -STD_ROM_FN(contrab) - -struct BurnDriver BurnDrvContrab = { - "contrab", "contra", NULL, NULL, "1987", - "Contra (bootleg)\0", NULL, "Konami", "GX633", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, contrabRomInfo, contrabRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - BootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - - -// Contra (Japan bootleg, set 1) - -static struct BurnRomInfo contrabjRomDesc[] = { - { "2.2k", 0x10000, 0xfedab568, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "1.2h", 0x10000, 0x5d5f7438, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a3.4p", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "a7.14f", 0x10000, 0x57f467d2, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "a10.14l", 0x10000, 0xe6db9685, 3 | BRF_GRA }, // 4 - { "a9.14k", 0x10000, 0x875c61de, 3 | BRF_GRA }, // 5 - { "a8.14h", 0x10000, 0x642765d6, 3 | BRF_GRA }, // 6 - { "a15.14r", 0x10000, 0xdaa2324b, 3 | BRF_GRA }, // 7 - { "a16.14t", 0x10000, 0xe27cc835, 3 | BRF_GRA }, // 8 - { "a17.14v", 0x10000, 0xce4330b9, 3 | BRF_GRA }, // 9 - { "a18.14w", 0x10000, 0x1571ce42, 3 | BRF_GRA }, // 10 - - { "a4.14a", 0x10000, 0x2cc7e52c, 4 | BRF_GRA }, // 11 Chip 1 Tiles - { "a5.14c", 0x10000, 0xe01a5b9c, 4 | BRF_GRA }, // 12 - { "e6.14d", 0x10000, 0xaeea6744, 4 | BRF_GRA }, // 13 - { "a14.14q", 0x10000, 0x765afdc7, 4 | BRF_GRA }, // 14 - { "a11.14m", 0x10000, 0xbd9ba92c, 4 | BRF_GRA }, // 15 - { "a12.14n", 0x10000, 0xd0be7ec2, 4 | BRF_GRA }, // 16 - { "a13.14p", 0x10000, 0x2b513d12, 4 | BRF_GRA }, // 17 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 18 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 19 - { "633f10.18g", 0x00100, 0x2b244d84, 5 | BRF_GRA }, // 20 - { "633f11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(contrabj) -STD_ROM_FN(contrabj) - -struct BurnDriver BurnDrvContrabj = { - "contrabj", "contra", NULL, NULL, "1987", - "Contra (Japan bootleg, set 1)\0", NULL, "Konami", "GX633", - L"\u9B42\u6597\u7F85 \u30B3\u30F3\u30C8\u30E9 (Japan bootleg, set 1)\0Contra\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, contrabjRomInfo, contrabjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - BootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - - -// Contra (Japan bootleg, set 2) - -static struct BurnRomInfo contrabj1RomDesc[] = { - { "2__(contrabtj2).2k", 0x10000, 0xbdb9196d, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "1.2h", 0x10000, 0x5d5f7438, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a3.4p", 0x08000, 0xd1549255, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "a7.14f", 0x10000, 0x57f467d2, 3 | BRF_GRA }, // 3 Chip 0 Tiles - { "a10.14l", 0x10000, 0xe6db9685, 3 | BRF_GRA }, // 4 - { "a9.14k", 0x10000, 0x875c61de, 3 | BRF_GRA }, // 5 - { "a8.14h", 0x10000, 0x642765d6, 3 | BRF_GRA }, // 6 - { "a15.14r", 0x10000, 0xdaa2324b, 3 | BRF_GRA }, // 7 - { "a16.14t", 0x10000, 0xe27cc835, 3 | BRF_GRA }, // 8 - { "a17.14v", 0x10000, 0xce4330b9, 3 | BRF_GRA }, // 9 - { "a18.14w", 0x10000, 0x1571ce42, 3 | BRF_GRA }, // 10 - - { "a4.14a", 0x10000, 0x2cc7e52c, 4 | BRF_GRA }, // 11 Chip 1 Tiles - { "a5.14c", 0x10000, 0xe01a5b9c, 4 | BRF_GRA }, // 12 - { "e6.14d", 0x10000, 0xaeea6744, 4 | BRF_GRA }, // 13 - { "a14.14q", 0x10000, 0x765afdc7, 4 | BRF_GRA }, // 14 - { "a11.14m", 0x10000, 0xbd9ba92c, 4 | BRF_GRA }, // 15 - { "a12.14n", 0x10000, 0xd0be7ec2, 4 | BRF_GRA }, // 16 - { "a13.14p", 0x10000, 0x2b513d12, 4 | BRF_GRA }, // 17 - - { "633e08.10g", 0x00100, 0x9f0949fa, 5 | BRF_GRA }, // 18 Color Proms - { "633e09.12g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 19 - { "633f10.18g", 0x00100, 0x2b244d84, 5 | BRF_GRA }, // 20 - { "633f11.20g", 0x00100, 0x14ca5e19, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(contrabj1) -STD_ROM_FN(contrabj1) - -struct BurnDriver BurnDrvContrabj1 = { - "contrabj1", "contra", NULL, NULL, "1987", - "Contra (Japan bootleg, set 2)\0", NULL, "Konami", "GX633", - L"\u9B42\u6597\u7F85 \u30B3\u30F3\u30C8\u30E9 (Japan bootleg, set 2)\0Contra\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, contrabj1RomInfo, contrabj1RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - BootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 280, 3, 4 -}; - diff --git a/jan/src/burn/drv/konami/d_crimfght.cpp b/jan/src/burn/drv/konami/d_crimfght.cpp deleted file mode 100644 index e70f56658..000000000 --- a/jan/src/burn/drv/konami/d_crimfght.cpp +++ /dev/null @@ -1,779 +0,0 @@ -// FB Alpha Crime Fighters driver module -// Based on MAME driver by Manuel Abadia - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k007232.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvBankRAM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *nDrvRamBank; -static UINT8 *nDrvKonamiBank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static struct BurnInputInfo CrimfghtInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service 1", BIT_DIGITAL, DrvJoy5 + 4, "service"}, - {"Service 2", BIT_DIGITAL, DrvJoy5 + 5, "service2"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Crimfght) - -static struct BurnInputInfo CrimfghtuInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 0, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 1, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy5 + 2, "p3 coin" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 2, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 3, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 0, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 1, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy5 + 3, "p4 coin" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 2, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 3, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 0, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 1, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy5 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy5 + 5, "service2"}, - {"Service 3", BIT_DIGITAL, DrvJoy5 + 6, "service3"}, - {"Service 4", BIT_DIGITAL, DrvJoy5 + 7, "service4"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Crimfghtu) - -static struct BurnDIPInfo CrimfghtDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x5f, NULL }, - {0x17, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x15, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Not Use" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x03, "1" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x01, "3" }, - {0x16, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x60, 0x60, "Easy" }, - {0x16, 0x01, 0x60, 0x40, "Normal" }, - {0x16, 0x01, 0x60, 0x20, "Difficult" }, - {0x16, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x17, 0x01, 0x01, 0x01, "Off" }, -// {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x04, 0x00, "Off" }, - {0x17, 0x01, 0x04, 0x04, "On" }, -}; - -STDDIPINFO(Crimfght) - -static struct BurnDIPInfo CrimfghtuDIPList[]= -{ - {0x21, 0xff, 0xff, 0xff, NULL }, - {0x22, 0xff, 0xff, 0x5f, NULL }, - {0x23, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x21, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x21, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x21, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x21, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x21, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x21, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x21, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x21, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x21, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x21, 0x01, 0x0f, 0x00, "1 Coin 99 Credits" }, - -/* {0 , 0xfe, 0 , 16, "Coin B" }, - {0x21, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x21, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x21, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x21, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x21, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x21, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x21, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x21, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x21, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x21, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x21, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x21, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x21, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x21, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x21, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x21, 0x01, 0xf0, 0x00, "No Coin B" },*/ - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x60, 0x60, "Easy" }, - {0x22, 0x01, 0x60, 0x40, "Normal" }, - {0x22, 0x01, 0x60, 0x20, "Difficult" }, - {0x22, 0x01, 0x60, 0x00, "Very difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x23, 0x01, 0x01, 0x01, "Off" }, -// {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x23, 0x01, 0x04, 0x00, "Off" }, - {0x23, 0x01, 0x04, 0x04, "On" }, -}; - -STDDIPINFO(Crimfghtu) - -static void set_ram_bank(INT32 data) -{ - nDrvRamBank[0] = data; - - if (data & 0x20) { - konamiMapMemory(DrvPalRAM, 0x0000, 0x03ff, MAP_RAM); - } else { - konamiMapMemory(DrvBankRAM, 0x0000, 0x03ff, MAP_RAM); - } -} - -void crimfght_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3f8c: - *soundlatch = data; - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - break; - } - - if (address >= 0x2000 && address <= 0x5fff) { - K052109_051960_w(address - 0x2000, data); - return; - } -} - -UINT8 crimfght_main_read(UINT16 address) -{ - switch (address) - { - case 0x3f80: - return DrvInputs[4]; - - case 0x3f81: - return DrvInputs[0]; - - case 0x3f82: - return DrvInputs[1]; - - case 0x3f83: - return DrvDips[1]; - - case 0x3f84: - return DrvDips[2]; - - case 0x3f85: - return DrvInputs[2]; - - case 0x3f86: - return DrvInputs[3]; - - case 0x3f87: - return DrvDips[0]; - - case 0x3f88: - // watchdog reset - return 0; - } - - if (address >= 0x2000 && address <= 0x5fff) { - return K052109_051960_r(address - 0x2000); - } - - return 0; -} - -void __fastcall crimfght_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xe000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - switch (address) - { - case 0xa000: - BurnYM2151SelectRegister(data); - return; - - case 0xa001: - BurnYM2151WriteRegister(data); - return; - } -} - -UINT8 __fastcall crimfght_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xe000) { - return K007232ReadReg(0, address & 0x0f); - } - - switch (address) - { - case 0xa000: - case 0xa001: - return BurnYM2151ReadStatus(); - - case 0xc000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -static void DrvYM2151WritePort(UINT32, UINT32 data) -{ - INT32 bank_A = ((data >> 1) & 0x01); - INT32 bank_B = ((data) & 0x01); - - k007232_set_bank(0, bank_A, bank_B); -} - -static void crimfght_set_lines(INT32 lines) -{ - nDrvKonamiBank[0] = lines; - - set_ram_bank(lines & 0x20); - K052109RMRDLine = lines & 0x40; - - INT32 nBank = 0x10000 + ((lines & 0x0f) * 0x2000); - - konamiMapMemory(DrvKonROM + nBank, 0x6000, 0x7fff, MAP_ROM); -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *flipx, INT32 *) -{ - *flipx = *color & 0x20; - *code |= ((*color & 0x1f) << 8) | (bank << 13); - *code &= 0x3fff; - *color = (layer << 2) + ((*color & 0xc0) >> 6); -} - -static void K051960Callback(INT32 *code, INT32 *color,INT32 *priority, INT32 *shadow) -{ - switch (*color & 0x70) - { - case 0x10: *priority = 0; break; - case 0x00: *priority = 1; break; - case 0x40: *priority = 2; break; - case 0x20: *priority = 3; break; - } - - *code |= (*color & 0x80) << 6; - *code &= 0x1fff; - *color = 16 + (*color & 0x0f); - *shadow = 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROMExp0 = Next; Next += 0x100000; - DrvGfxROMExp1 = Next; Next += 0x200000; - - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x200 * sizeof(UINT32); - - AllRam = Next; - - DrvBankRAM = Next; Next += 0x000400; - DrvKonRAM = Next; Next += 0x001c00; - DrvPalRAM = Next; Next += 0x000400; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - nDrvRamBank = Next; Next += 0x000001; - nDrvKonamiBank = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x010000, 0, 1)) return 1; - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x28000, 0x8000); - memset (DrvKonROM + 0x28000, 0, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 2, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 3, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 4, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 5, 4, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 6, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x080000); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x100000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvBankRAM, 0x0000, 0x03ff, MAP_RAM); - konamiMapMemory(DrvKonRAM, 0x0400, 0x1fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(crimfght_main_write); - konamiSetReadHandler(crimfght_main_read); - konamiSetlinesCallback(crimfght_set_lines); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(crimfght_sound_write); - ZetSetReadHandler(crimfght_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetPortHandler(&DrvYM2151WritePort); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K007232Init(0, 3579545, DrvSndROM, 0x40000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x7ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(-2, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0xfffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(-2, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - K007232Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x400); - - K052109UpdateScroll(); - - if (nBurnLayer & 1) K052109RenderLayer(1, K052109_OPAQUE, 0); - if (nSpriteEnable & 1) K051960SpritesRender(2, 2); - if (nBurnLayer & 2) K052109RenderLayer(2, 0, 0); - if (nSpriteEnable & 2) K051960SpritesRender(1, 1); - if (nBurnLayer & 4) K052109RenderLayer(0, 0, 0); - if (nSpriteEnable & 4) K051960SpritesRender(0, 0); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - - // Clear Opposites - if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c; - if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[3] & 0x0c) == 0) DrvInputs[3] |= 0x0c; - if ((DrvInputs[3] & 0x03) == 0) DrvInputs[3] |= 0x03; - } - - konamiNewFrame(); - ZetNewFrame(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { (((3000000 / 60) * 133) / 100) /* 33% overclock */, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - - nCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - set_ram_bank(nDrvRamBank[0]); - crimfght_set_lines(nDrvKonamiBank[0]); - konamiClose(); - } - - return 0; -} - - -// Crime Fighters (US 4 players) - -static struct BurnRomInfo crimfghtRomDesc[] = { - { "821r02.f24", 0x20000, 0x4ecdd923, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - - { "821l01.h4", 0x08000, 0x0faca89e, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "821k06.k13", 0x40000, 0xa1eadb24, 3 | BRF_GRA }, // 2 Background Tiles - { "821k07.k19", 0x40000, 0x060019fa, 3 | BRF_GRA }, // 3 - - { "821k04.k2", 0x80000, 0x00e0291b, 4 | BRF_GRA }, // 4 Sprites - { "821k05.k8", 0x80000, 0xe09ea05d, 4 | BRF_GRA }, // 5 - - { "821k03.e5", 0x40000, 0xfef8505a, 5 | BRF_SND }, // 6 K007232 Samples - - { "821a08.i15", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 7 Proms -}; - -STD_ROM_PICK(crimfght) -STD_ROM_FN(crimfght) - -struct BurnDriver BurnDrvCrimfght = { - "crimfght", NULL, NULL, NULL, "1989", - "Crime Fighters (World 2 players)\0", NULL, "Konami", "GX821", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, crimfghtRomInfo, crimfghtRomName, NULL, NULL, CrimfghtInputInfo, CrimfghtDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 320, 224, 4, 3 -}; - - -// Crime Fighters (Japan 2 Players) - -static struct BurnRomInfo crimfghtjRomDesc[] = { - { "821p02.f24", 0x20000, 0xf33fa2e1, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - - { "821l01.h4", 0x08000, 0x0faca89e, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "821k06.k13", 0x40000, 0xa1eadb24, 3 | BRF_GRA }, // 2 Background Tiles - { "821k07.k19", 0x40000, 0x060019fa, 3 | BRF_GRA }, // 3 - - { "821k04.k2", 0x80000, 0x00e0291b, 4 | BRF_GRA }, // 4 Sprites - { "821k05.k8", 0x80000, 0xe09ea05d, 4 | BRF_GRA }, // 5 - - { "821k03.e5", 0x40000, 0xfef8505a, 5 | BRF_SND }, // 6 K007232 Samples - - { "821a08.i15", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 7 Proms -}; - -STD_ROM_PICK(crimfghtj) -STD_ROM_FN(crimfghtj) - -struct BurnDriver BurnDrvCrimfghtj = { - "crimfghtj", "crimfght", NULL, NULL, "1989", - "Crime Fighters (Japan 2 Players)\0", NULL, "Konami", "GX821", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, crimfghtjRomInfo, crimfghtjRomName, NULL, NULL, CrimfghtInputInfo, CrimfghtDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 320, 224, 4, 3 -}; - - -// Crime Fighters (US 4 Players) - -static struct BurnRomInfo crimfghtuRomDesc[] = { - { "821l02.f24", 0x20000, 0x588e7da6, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code - - { "821l01.h4", 0x08000, 0x0faca89e, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "821k06.k13", 0x40000, 0xa1eadb24, 3 | BRF_GRA }, // 2 Background Tiles - { "821k07.k19", 0x40000, 0x060019fa, 3 | BRF_GRA }, // 3 - - { "821k04.k2", 0x80000, 0x00e0291b, 4 | BRF_GRA }, // 4 Sprites - { "821k05.k8", 0x80000, 0xe09ea05d, 4 | BRF_GRA }, // 5 - - { "821k03.e5", 0x40000, 0xfef8505a, 5 | BRF_SND }, // 6 K007232 Samples - - { "821a08.i15", 0x00100, 0x7da55800, 6 | BRF_OPT }, // 7 Proms -}; - -STD_ROM_PICK(crimfghtu) -STD_ROM_FN(crimfghtu) - -struct BurnDriver BurnDrvCrimfghtu = { - "crimfghtu", "crimfght", NULL, NULL, "1989", - "Crime Fighters (US 4 Players)\0", NULL, "Konami", "GX821", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, crimfghtuRomInfo, crimfghtuRomName, NULL, NULL, CrimfghtuInputInfo, CrimfghtuDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_dbz.cpp b/jan/src/burn/drv/konami/d_dbz.cpp deleted file mode 100644 index e9a52536e..000000000 --- a/jan/src/burn/drv/konami/d_dbz.cpp +++ /dev/null @@ -1,1103 +0,0 @@ -// FB Alpa Dragon Ball Z driver module -// Based on MAME driver by David Haywood, R. Belmont and Pierpaolo Prazzoli - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROMExp2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROMExp3; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvBg2RAM; -static UINT8 *DrvBg1RAM; -static UINT8 *Drvk053936RAM1; -static UINT8 *Drvk053936RAM2; -static UINT8 *DrvK053936Ctrl1; -static UINT8 *DrvK053936Ctrl2; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 layerpri[8]; -static INT32 layer_colorbase[8]; -static INT32 sprite_colorbase; - -static UINT8 *soundlatch; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; -static UINT8 DrvDips[3]; - -static UINT16 control_data; - -static struct BurnInputInfo DbzInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 6, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 12, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 11, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 14, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 13, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 10, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 9, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 8, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Dbz) - -static struct BurnDIPInfo DbzDIPList[]= -{ - {0x16, 0xff, 0xff, 0x08, NULL }, - {0x17, 0xff, 0xff, 0x3f, NULL }, - {0x18, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x03, 0x01, "Easy" }, - {0x17, 0x01, 0x03, 0x03, "Normal" }, - {0x17, 0x01, 0x03, 0x02, "Hard" }, - {0x17, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x08, 0x08, "Off" }, - {0x17, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x20, 0x20, "Off" }, - {0x17, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x17, 0x01, 0x40, 0x00, "English" }, - {0x17, 0x01, 0x40, 0x40, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Mask ROM Test" }, - {0x17, 0x01, 0x80, 0x00, "Off" }, - {0x17, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x18, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x18, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x18, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x18, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x18, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x18, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x18, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x18, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x18, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x18, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x18, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x18, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x18, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x18, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x18, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x18, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x18, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x18, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x18, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x18, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x18, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x18, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x18, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x18, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x18, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x18, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x18, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x18, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x18, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x18, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x18, 0x01, 0xf0, 0x00, "No Coin B" }, -}; - -STDDIPINFO(Dbz) - -static struct BurnDIPInfo Dbz2DIPList[]= -{ - {0x16, 0xff, 0xff, 0x08, NULL }, - {0x17, 0xff, 0xff, 0x3f, NULL }, - {0x18, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x03, 0x01, "Easy" }, - {0x17, 0x01, 0x03, 0x03, "Normal" }, - {0x17, 0x01, 0x03, 0x02, "Hard" }, - {0x17, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x04, 0x04, "Off" }, - {0x17, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x08, 0x08, "Off" }, - {0x17, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x17, 0x01, 0x10, 0x10, "Off" }, - {0x17, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x20, 0x20, "Off" }, - {0x17, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x17, 0x01, 0x40, 0x00, "English" }, - {0x17, 0x01, 0x40, 0x40, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Mask ROM Test" }, - {0x17, 0x01, 0x80, 0x00, "Off" }, - {0x17, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x18, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x18, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x18, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x18, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x18, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x18, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x18, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x18, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x18, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x18, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x18, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x18, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x18, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x18, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x18, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x18, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x18, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x18, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x18, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x18, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x18, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x18, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x18, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x18, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x18, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x18, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x18, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x18, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x18, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x18, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x18, 0x01, 0xf0, 0x00, "No Coin B" }, -}; - -STDDIPINFO(Dbz2) - -static void __fastcall dbz_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffc000) == 0x490000) { - K056832RamWriteWord(address & 0x1fff, data); - return; - } - - if ((address & 0xffbff8) == 0x4c0000) { - K053246Write((address & 0x06) + 0, data >> 8); - K053246Write((address & 0x06) + 1, data&0xff); - return; - } - - if ((address & 0xfffff8) == 0x4c8000) { - return; // regsb - } - - if ((address & 0xffffc0) == 0x4cc000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - if ((address & 0xffffe0) == 0x4f8000) { - // k053252 - return; - } - - switch (address) - { - case 0x4ec000: - control_data = data; - K053246_set_OBJCHA_line(data & 0x0400); - return; - - case 0x4f0000: - *soundlatch = data; - return; - - case 0x4f4000: - ZetNmi(); - return; - } - -// bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall dbz_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffc000) == 0x490000) { - K056832RamWriteByte(address & 0x1fff, data); - return; - } - - if ((address & 0xffbff8) == 0x4c0000) { - K053246Write((address & 0x07) ^ 0, data); - return; - } - - if ((address & 0xfffff8) == 0x4c8000) { - return; // regsb - } - - if ((address & 0xffffc0) == 0x4cc000) { - K056832ByteWrite(address & 0x3f, data); - return; - } - - if ((address & 0xffffe1) == 0x4fc001) { - K053251Write((address / 2) & 0xf, data); - return; - } - - if ((address & 0xffffe0) == 0x4f8000) { - // k053252Write - return; - } - - switch (address) - { - case 0x4e8000: - return; // nop - - case 0x4ec000: - control_data = (control_data & 0x00ff) + (data << 8); - K053246_set_OBJCHA_line(data & 0x04); - return; - - case 0x4ec001: - control_data = (control_data & 0xff00) + data; - return; - - case 0x4f0000: - case 0x4f0001: - *soundlatch = data; - return; - - case 0x4f4000: - case 0x4f4001: - ZetNmi(); - return; - } - -// bprintf (0, _T("WB: %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall dbz_main_read_word(UINT32 address) -{ - if ((address & 0xffc000) == 0x490000) { - return K056832RamReadWord(address & 0x1fff); - } - - if ((address & 0xff8000) == 0x498000) { - return K056832RomWord8000Read(address); - } - - if ((address & 0xffffe0) == 0x4f8000) { - return 0; // k053252 - } - - switch (address) - { - case 0x4c0000: - return K053246Read(1) + (K053246Read(0) << 8); - - case 0x4e0000: - return DrvInputs[0]; - - case 0x4e0002: - return DrvInputs[1]; - - case 0x4e4000: - return DrvInputs[2]; - } - -// bprintf (0, _T("RW: %5.5x\n"), address); - - return 0; -} - -static UINT8 __fastcall dbz_main_read_byte(UINT32 address) -{ - if ((address & 0xffc000) == 0x490000) { - return K056832RamReadByte(address & 0x1fff); - } - - if ((address & 0xff8000) == 0x498000) { - return K056832RomWord8000Read(address) >> ((~address & 1) * 8); - } - - if ((address & 0xffffe0) == 0x4f8000) { - return 0; // k053252 - } - - switch (address) - { - case 0x4c0000: - case 0x4c0001: - return K053246Read(address & 1); - - case 0x4e0000: - return DrvInputs[0] >> 8; - - case 0x4e0001: - return DrvInputs[0]; - - case 0x4e0002: - return DrvInputs[1] >> 8; - - case 0x4e0003: - return DrvInputs[1]; - - case 0x4e4000: - return DrvInputs[2] >> 8; - - case 0x4e4001: - return DrvInputs[2]; - } - -// bprintf (0, _T("RB: %5.5x\n"), address); - - return 0; -} - -static void __fastcall dbz_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xd000: - case 0xd002: - case 0xd001: - MSM6295Command(0, data); - return; - } -} - -static UINT8 __fastcall dbz_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - return BurnYM2151ReadStatus(); - - case 0xd000: - case 0xd002: - case 0xd001: - return MSM6295ReadStatus(0); - - case 0xe000: - case 0xe001: - return *soundlatch; - } - - return 0; -} - -static void dbz_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority) -{ - INT32 pri = (*color & 0x3c0) >> 5; - - if (pri <= layerpri[3]) *priority = 0xff00; - else if (pri > layerpri[3] && pri <= layerpri[2]) *priority = 0xfff0; - else if (pri > layerpri[2] && pri <= layerpri[1]) *priority = 0xfffc; - else *priority = 0xfffe; - - *color = (sprite_colorbase << 1) + (*color & 0x1f); -} - -static void dbz_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/) -{ - *color = (layer_colorbase[layer] << 1) + ((*color & 0x3c) >> 2); -} - -static void dbz_K053936_callback1(INT32 offset, UINT16 *ram, INT32 *code, INT32 *color, INT32 *, INT32 *, INT32 *flipx, INT32 *) -{ - *code = ram[(offset * 2) + 1] & 0x7fff; - *color = ((ram[(offset * 2) + 0] & 0x000f) + (layer_colorbase[4] << 1)) << 4; - *color &= 0x1ff0; - *flipx = ram[(offset * 2) + 0] & 0x0080; -} - -static void dbz_K053936_callback2(INT32 offset, UINT16 *ram, INT32 *code, INT32 *color, INT32 *, INT32 *, INT32 *flipx, INT32 *) -{ - *code = ram[(offset * 2) + 1] & 0x7fff; - *color = ((ram[(offset * 2) + 0] & 0x000f) + (layer_colorbase[5] << 1)) << 4; - *color &= 0x1ff0; - *flipx = ram[(offset * 2) + 0] & 0x0080; -} - -static void dbzYM2151IrqHandler(INT32 status) -{ - ZetSetIRQLine(0, (status) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - KonamiICReset(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - control_data = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROMExp0 = Next; Next += 0x800000; - DrvGfxROM1 = Next; Next += 0x800000; - DrvGfxROMExp1 = Next; Next += 0x1000000; - DrvGfxROM2 = Next; Next += 0x400000; - DrvGfxROMExp2 = Next; Next += 0x800000; - DrvGfxROM3 = Next; Next += 0x400000; - DrvGfxROMExp3 = Next; Next += 0x800000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x010000; - Drv68KRAM1 = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x004000; - - DrvBg2RAM = Next; Next += 0x002000; - DrvBg1RAM = Next; Next += 0x002000; - - DrvK053936Ctrl1 = Next; Next += 0x000400; - DrvK053936Ctrl2 = Next; Next += 0x000400; - - Drvk053936RAM1 = Next; Next += 0x004000; - Drvk053936RAM2 = Next; Next += 0x004000; - - DrvZ80RAM = Next; Next += 0x004000; - - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvExpandGfx(UINT8 *dst, UINT8 *src, INT32 len, INT32 bs) -{ - for (INT32 i = (len - 1); i >= 0; i--) { - dst[i*2+0] = src[i^bs] >> 4; - dst[i*2+1] = src[i^bs] & 0xf; - } -} - -static void dbz_patch() -{ - UINT16 *ROM = (UINT16 *)Drv68KROM; - - // to avoid crash during loop at 0x00076e after D4 > 0x80 (reading tiles region out of bounds) - ROM[0x76c/2] = 0x007f; /* 0x00ff */ - // nop out dbz1's mask rom test - // tile ROM test - ROM[0x7b0/2] = 0x4e71; /* 0x0c43 - cmpi.w #-$1e0d, D3 */ - ROM[0x7b2/2] = 0x4e71; /* 0xe1f3 */ - ROM[0x7b4/2] = 0x4e71; /* 0x6600 - bne $7d6 */ - ROM[0x7b6/2] = 0x4e71; /* 0x0020 */ - ROM[0x7c0/2] = 0x4e71; /* 0x0c45 - cmpi.w #-$7aad, D5 */ - ROM[0x7c2/2] = 0x4e71; /* 0x8553 */ - ROM[0x7c4/2] = 0x4e71; /* 0x6600 - bne $7d6 */ - ROM[0x7c6/2] = 0x4e71; /* 0x0010 */ - // PSAC2 ROM test (A and B) - ROM[0x9a8/2] = 0x4e71; /* 0x0c43 - cmpi.w #$43c0, D3 */ - ROM[0x9aa/2] = 0x4e71; /* 0x43c0 */ - ROM[0x9ac/2] = 0x4e71; /* 0x6600 - bne $a00 */ - ROM[0x9ae/2] = 0x4e71; /* 0x0052 */ - ROM[0x9ea/2] = 0x4e71; /* 0x0c44 - cmpi.w #-$13de, D4 */ - ROM[0x9ec/2] = 0x4e71; /* 0xec22 */ - ROM[0x9ee/2] = 0x4e71; /* 0x6600 - bne $a00 */ - ROM[0x9f0/2] = 0x4e71; /* 0x0010 */ - // prog ROM test - ROM[0x80c/2] = 0x4e71; /* 0xb650 - cmp.w (A0), D3 */ - ROM[0x80e/2] = 0x4e71; /* 0x6600 - bne $820 */ - ROM[0x810/2] = 0x4e71; /* 0x005e */ -} - -static void dbza_patch() -{ - UINT16 *ROM = (UINT16 *)Drv68KROM; - - // nop out dbz1's mask rom test - // tile ROM test - ROM[0x78c/2] = 0x4e71; /* 0x0c43 - cmpi.w #-$1236, D3 */ - ROM[0x78e/2] = 0x4e71; /* 0x0010 */ - ROM[0x790/2] = 0x4e71; /* 0x6600 - bne $7a2 */ - ROM[0x792/2] = 0x4e71; /* 0x0010 */ - // PSAC2 ROM test - ROM[0x982/2] = 0x4e71; /* 0x0c43 - cmpi.w #$437e, D3 */ - ROM[0x984/2] = 0x4e71; /* 0x437e */ - ROM[0x986/2] = 0x4e71; /* 0x6600 - bne $9a0 */ - ROM[0x988/2] = 0x4e71; /* 0x0018 */ - ROM[0x98a/2] = 0x4e71; /* 0x0c44 - cmpi.w #$65e8, D4 */ - ROM[0x98c/2] = 0x4e71; /* 0x65e8 */ - ROM[0x98e/2] = 0x4e71; /* 0x6600 - bne $9a0 */ - ROM[0x990/2] = 0x4e71; /* 0x0010 */ -} - -static void dbz2_patch() -{ - UINT16 *ROM = (UINT16 *)Drv68KROM; - - // to avoid crash during loop at 0x000a4a after D4 > 0x80 (reading tiles region out of bounds) - ROM[0xa48/2] = 0x007f; /* 0x00ff */ - // nop out dbz1's mask rom test - // tile ROM test - ROM[0xa88/2] = 0x4e71; /* 0x0c43 - cmpi.w #$e58, D3 */ - ROM[0xa8a/2] = 0x4e71; /* 0x0e58 */ - ROM[0xa8c/2] = 0x4e71; /* 0x6600 - bne $aae */ - ROM[0xa8e/2] = 0x4e71; /* 0x0020 */ - ROM[0xa98/2] = 0x4e71; /* 0x0c45 - cmpi.w #-$3d20, D5 */ - ROM[0xa9a/2] = 0x4e71; /* 0xc2e0 */ - ROM[0xa9c/2] = 0x4e71; /* 0x6600 - bne $aae */ - ROM[0xa9e/2] = 0x4e71; /* 0x0010 */ - // PSAC2 ROM test (0 to 3) - ROM[0xc66/2] = 0x4e71; /* 0xb549 - cmpm.w (A1)+, (A2)+ */ - ROM[0xc68/2] = 0x4e71; /* 0x6600 - bne $cc8 */ - ROM[0xc6a/2] = 0x4e71; /* 0x005e */ - ROM[0xc7c/2] = 0x4e71; /* 0xb549 - cmpm.w (A1)+, (A2)+ */ - ROM[0xc7e/2] = 0x4e71; /* 0x6600 - bne $cc8 */ - ROM[0xc80/2] = 0x4e71; /* 0x0048 */ - ROM[0xc9e/2] = 0x4e71; /* 0xb549 - cmpm.w (A1)+, (A2)+ */ - ROM[0xca0/2] = 0x4e71; /* 0x6600 - bne $cc8 */ - ROM[0xca2/2] = 0x4e71; /* 0x0026 */ - ROM[0xcb4/2] = 0x4e71; /* 0xb549 - cmpm.w (A1)+, (A2)+ */ - ROM[0xcb6/2] = 0x4e71; /* 0x6600 - bne $cc8 */ - ROM[0xcb8/2] = 0x4e71; /* 0x0010 */ - // prog ROM test - ROM[0xae4/2] = 0x4e71; /* 0xb650 - cmp.w (A0), D3 */ - ROM[0xae6/2] = 0x4e71; /* 0x6600 - bne $af8 */ - ROM[0xae8/2] = 0x4e71; /* 0x005e */ -} - -static INT32 DrvInit(INT32 nGame) -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 4, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 5, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 6, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 8, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 1)) return 1; - - if (nGame != 2) // dbz, dbza - { - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 11, 1)) return 1; - } - else // dbz2 - { - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 12, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 13, 1)) return 1; - } - - DrvExpandGfx(DrvGfxROMExp0, DrvGfxROM0, 0x400000, 1); - DrvExpandGfx(DrvGfxROMExp1, DrvGfxROM1, 0x800000, 1); - DrvExpandGfx(DrvGfxROMExp2, DrvGfxROM2, 0x400000, 0); - DrvExpandGfx(DrvGfxROMExp3, DrvGfxROM3, 0x400000, 0); - - if (nGame == 0) dbz_patch(); - if (nGame == 1) dbza_patch(); - if (nGame == 2) dbz2_patch(); - } - - K053936Init(0, DrvBg1RAM, 0x4000, 1024, 512, dbz_K053936_callback1); - K053936Init(1, DrvBg2RAM, 0x4000, 1024, 512, dbz_K053936_callback2); - K053936EnableWrap(0,1); - K053936EnableWrap(1,1); - K053936SetOffset(0, -46, -16); - K053936SetOffset(1, -46, -16); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x400000, dbz_tile_callback); - K056832SetGlobalOffsets(0, 0); - K056832SetLayerOffsets(0, (nGame == 2) ? -34 : -35, -16); - K056832SetLayerOffsets(1, -31, -16); - K056832SetLayerOffsets(2, 0, 0); - K056832SetLayerOffsets(3, -31, -16); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x7fffff, dbz_sprite_callback, 1); - K053247SetSpriteOffset(-87, -32); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x480000, 0x48ffff, MAP_RAM); - SekMapMemory(K053247Ram, 0x4a0000, 0x4a0fff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x4a1000, 0x4a3fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x4a8000, 0x4abfff, MAP_RAM); - SekMapMemory(DrvK053936Ctrl1, 0x4d0000, 0x4d03ff, MAP_RAM); - SekMapMemory(DrvK053936Ctrl2, 0x4d4000, 0x4d43ff, MAP_RAM); - SekMapMemory(DrvBg2RAM, 0x500000, 0x501fff, MAP_RAM); - SekMapMemory(DrvBg1RAM, 0x508000, 0x509fff, MAP_RAM); - SekMapMemory(Drvk053936RAM1, 0x510000, 0x513fff, MAP_RAM); - SekMapMemory(Drvk053936RAM2, 0x518000, 0x51bfff, MAP_RAM); - SekSetWriteWordHandler(0, dbz_main_write_word); - SekSetWriteByteHandler(0, dbz_main_write_byte); - SekSetReadWordHandler(0, dbz_main_read_word); - SekSetReadByteHandler(0, dbz_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0xbfff, MAP_RAM); - ZetSetWriteHandler(dbz_sound_write); - ZetSetReadHandler(dbz_sound_read); - ZetClose(); - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&dbzYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 dbzInit() -{ - return DrvInit(0); -} - -static INT32 dbzaInit() -{ - return DrvInit(1); -} - -static INT32 dbz2Init() -{ - return DrvInit(2); -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x4000/2; i++) - { - INT32 r = (pal[i] >> 10 & 0x1f); - INT32 g = (pal[i] >> 5) & 0x1f; - INT32 b = (pal[i]) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = (r << 16) + (g << 8) + b; - } -} - -static INT32 DrvDraw() -{ - static const INT32 K053251_CI[6] = { 3, 4, 4, 4, 2, 1 }; - DrvPaletteRecalc(); - KonamiClearBitmaps(0); - - INT32 layer[5], plane; - - sprite_colorbase = K053251GetPaletteIndex(0); - - for (plane = 0; plane < 6; plane++) - { - layer_colorbase[plane] = K053251GetPaletteIndex(K053251_CI[plane]); - } - - K053936PredrawTiles2(0, DrvGfxROMExp3); - K053936PredrawTiles2(1, DrvGfxROMExp2); - - layer[0] = 0; - layerpri[0] = K053251GetPriority(3); - layer[1] = 1; - layerpri[1] = K053251GetPriority(4); - layer[2] = 3; - layerpri[2] = K053251GetPriority(0); - layer[3] = 4; - layerpri[3] = K053251GetPriority(2); - layer[4] = 5; - layerpri[4] = K053251GetPriority(1); - - konami_sortlayers5(layer, layerpri); - - for (plane = 0; plane < 5; plane++) - { - INT32 flag, pri; - - if (plane == 0) - { - flag = 0; - pri = 0; - } - else - { - flag = 1; - pri = 1 << (plane - 1); - } - - if (layer[plane] == 4) { - if (nBurnLayer & 1) K053936Draw(0, (UINT16*)DrvK053936Ctrl2, (UINT16*)Drvk053936RAM2, flag | (pri<<8)); - } else if(layer[plane] == 5) { - if (nBurnLayer & 2) K053936Draw(1, (UINT16*)DrvK053936Ctrl1, (UINT16*)Drvk053936RAM1, flag | (pri<<8)); - } else { - if (nSpriteEnable & 2) K056832Draw(layer[plane], flag ? 0 : K056832_LAYER_OPAQUE, pri); - } - } - - if (nSpriteEnable & 1) K053247SpritesRender(); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - DrvInputs[1] = (DrvInputs[1] & ~0xff08) | (DrvDips[0] & 0x08) | (DrvDips[1] << 8); - DrvInputs[2] = (DrvDips[2] << 8) | (DrvDips[2] << 0); - } - - SekNewFrame(); - - INT32 nInterleave = nBurnSoundLen; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 16000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = SekRun(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - if (i == 0 && K053246_is_IRQ_enabled()) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - if (i == (nInterleave - 20)) { - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); //CK); - } - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029732; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0,nAction); - - KonamiICScan(nAction); - - SCAN_VAR(control_data); - } - - return 0; -} - - -// Dragonball Z (rev B) - -static struct BurnRomInfo dbzRomDesc[] = { - { "222b11.9e", 0x080000, 0x4c6b75e9, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "222b12.9f", 0x080000, 0x48637fce, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "222a10.5e", 0x008000, 0x1c93e30a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "222a01.27c", 0x200000, 0x9fce4ed4, 3 | BRF_GRA }, // 3 Background Tiles - { "222a02.27e", 0x200000, 0x651acaa5, 3 | BRF_GRA }, // 4 - - { "222a04.3j", 0x200000, 0x2533b95a, 4 | BRF_GRA }, // 5 Sprites - { "222a05.1j", 0x200000, 0x731b7f93, 4 | BRF_GRA }, // 6 - { "222a06.3l", 0x200000, 0x97b767d3, 4 | BRF_GRA }, // 7 - { "222a07.1l", 0x200000, 0x430bc873, 4 | BRF_GRA }, // 8 - - { "222a08.25k", 0x200000, 0x6410ee1b, 5 | BRF_GRA }, // 9 Zoom Layer Tiles #1 - - { "222a09.25l", 0x200000, 0xf7b3f070, 6 | BRF_GRA }, // 10 Zoom Layer Tiles #0 - - { "222a03.7c", 0x040000, 0x1924467b, 7 | BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(dbz) -STD_ROM_FN(dbz) - -struct BurnDriver BurnDrvDbz = { - "dbz", NULL, NULL, NULL, "1993", - "Dragonball Z (rev B)\0", NULL, "Banpresto", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, dbzRomInfo, dbzRomName, NULL, NULL, DbzInputInfo, DbzDIPInfo, - dbzInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 384, 256, 4, 3 -}; - -// Dragonball Z (rev A) - -static struct BurnRomInfo dbzaRomDesc[] = { - { "222a11.9e", 0x080000, 0x60c7d9b2, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "222a12.9f", 0x080000, 0x6ebc6853, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "222a10.5e", 0x008000, 0x1c93e30a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "222a01.27c", 0x200000, 0x9fce4ed4, 3 | BRF_GRA }, // 3 Background Tiles - { "222a02.27e", 0x200000, 0x651acaa5, 3 | BRF_GRA }, // 4 - - { "222a04.3j", 0x200000, 0x2533b95a, 4 | BRF_GRA }, // 5 Sprites - { "222a05.1j", 0x200000, 0x731b7f93, 4 | BRF_GRA }, // 6 - { "222a06.3l", 0x200000, 0x97b767d3, 4 | BRF_GRA }, // 7 - { "222a07.1l", 0x200000, 0x430bc873, 4 | BRF_GRA }, // 8 - - { "222a08.25k", 0x200000, 0x6410ee1b, 5 | BRF_GRA }, // 9 Zoom Layer Tiles #1 - - { "222a09.25l", 0x200000, 0xf7b3f070, 6 | BRF_GRA }, // 10 Zoom Layer Tiles #0 - - { "222a03.7c", 0x040000, 0x1924467b, 7 | BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(dbza) -STD_ROM_FN(dbza) - -struct BurnDriver BurnDrvDbza = { - "dbza", "dbz", NULL, NULL, "1993", - "Dragonball Z (rev A)\0", NULL, "Banpresto", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, dbzaRomInfo, dbzaRomName, NULL, NULL, DbzInputInfo, DbzDIPInfo, - dbzaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 384, 256, 4, 3 -}; - - -// Dragonball Z 2 - Super Battle - -static struct BurnRomInfo dbz2RomDesc[] = { - { "a9e.9e", 0x080000, 0xe6a142c9, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "a9f.9f", 0x080000, 0x76cac399, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "s-001.5e", 0x008000, 0x154e6d03, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ds-b01.27c", 0x200000, 0x8dc39972, 3 | BRF_GRA }, // 3 Background Tiles - { "ds-b02.27e", 0x200000, 0x7552f8cd, 3 | BRF_GRA }, // 4 - - { "ds-o01.3j", 0x200000, 0xd018531f, 4 | BRF_GRA }, // 5 Sprites - { "ds-o02.1j", 0x200000, 0x5a0f1ebe, 4 | BRF_GRA }, // 6 - { "ds-o03.3l", 0x200000, 0xddc3bef1, 4 | BRF_GRA }, // 7 - { "ds-o04.1l", 0x200000, 0xb5df6676, 4 | BRF_GRA }, // 8 - - { "ds-p01.25k", 0x200000, 0x1c7aad68, 5 | BRF_GRA }, // 9 Zoom Layer Tiles #1 - { "ds-p02.27k", 0x200000, 0xe4c3a43b, 5 | BRF_GRA }, // 10 - - { "ds-p03.25l", 0x200000, 0x1eaa671b, 6 | BRF_GRA }, // 11 Zoom Layer Tiles #0 - { "ds-p04.27l", 0x200000, 0x5845ff98, 6 | BRF_GRA }, // 12 - - { "pcm.7c", 0x040000, 0xb58c884a, 7 | BRF_SND }, // 13 Samples -}; - -STD_ROM_PICK(dbz2) -STD_ROM_FN(dbz2) - -struct BurnDriver BurnDrvDbz2 = { - "dbz2", NULL, NULL, NULL, "1994", - "Dragonball Z 2 - Super Battle\0", NULL, "Banpresto", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, dbz2RomInfo, dbz2RomName, NULL, NULL, DbzInputInfo, Dbz2DIPInfo, - dbz2Init,DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 384, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_finalzr.cpp b/jan/src/burn/drv/konami/d_finalzr.cpp deleted file mode 100644 index 966eea1e6..000000000 --- a/jan/src/burn/drv/konami/d_finalzr.cpp +++ /dev/null @@ -1,872 +0,0 @@ -// FB Alpha Finalizer driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "i8039.h" -#include "sn76496.h" -#include "dac.h" -#include "resnet.h" - -static UINT8 *AllMem; -static UINT8 *RamEnd; -static UINT8 *AllRam; -static UINT8 *MemEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809DecROM; -static UINT8 *DrvI8039ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvColPROM; -static UINT8 *DrvColRAM0; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvColRAM1; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvInputs[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static UINT8 scroll; -static UINT8 nmi_enable; -static UINT8 irq_enable; -static UINT8 charbank; -static UINT8 spriterambank; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 i8039_t1; - -static INT32 watchdog = 0; -static INT32 vblank; - -static struct BurnInputInfo FinalizrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Finalizr) - -static struct BurnDIPInfo FinalizrDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x5a, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "30000 150000" }, - {0x13, 0x01, 0x18, 0x10, "50000 300000" }, - {0x13, 0x01, 0x18, 0x08, "30000" }, - {0x13, 0x01, 0x18, 0x00, "50000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x14, 0x01, 0x02, 0x02, "Single" }, - {0x14, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Finalizr) - -static UINT8 finalizr_main_read(UINT16 address) -{ - switch (address) - { - case 0x0800: - return DrvDips[2]; - - case 0x0808: - return DrvDips[1]; - - case 0x0810: - return (DrvInputs[0] & 0x7f) | (vblank ? 0x80 : 0); - case 0x0811: - case 0x0812: - return (DrvInputs[address & 3] & 0x7f); - - case 0x0813: - return DrvDips[0]; - } - - return 0; -} - -static void finalizr_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0001: - scroll = data; - return; - - case 0x0003: - charbank = data & 0x03; - spriterambank = data & 0x08; - return; - - case 0x0004: - nmi_enable = data & 0x01; - irq_enable = data & 0x02; - flipscreen =~data & 0x08; - return; - - case 0x0818: - watchdog = 0; - return; - - case 0x0819: - // coin counters - return; - - case 0x081a: - SN76496Write(0, data); - return; - - case 0x081b: // nop - return; - - case 0x081c: - I8039SetIrqState(1); - return; - - case 0x081d: - soundlatch = data; - return; - } -} - -static UINT8 __fastcall finalizr_sound_read(UINT32 address) -{ - return DrvI8039ROM[address & 0x0fff]; -} - -static void __fastcall finalizr_sound_write_port(UINT32 port, UINT8 data) -{ - port &= 0x1ff; - - switch (port) - { - case I8039_p1: - DACWrite(0, data); - return; - - case I8039_p2: - if (~data & 0x80) I8039SetIrqState(0); - return; - - case I8039_t0: - // clock? - return; - } -} - -static UINT8 __fastcall finalizr_sound_read_port(UINT32 port) -{ - port &= 0x1ff; - - if (port < 0x100) { - return soundlatch; - } - - switch (port) - { - case I8039_t1: - i8039_t1 = (i8039_t1 + 1) & 0xf; - return (!(i8039_t1 % 3) && (i8039_t1 > 0)); - } - - return 0; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (I8039TotalCycles() / (614400.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - I8039Reset(); - DACReset(); - - scroll = 0; - nmi_enable = 0; - irq_enable = 0; - charbank = 0; - spriterambank = 0; - soundlatch = 0; - i8039_t1 = 0; - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x00c000; - DrvM6809DecROM = Next; Next += 0x00c000; - - DrvI8039ROM = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000240; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvColRAM0 = Next; Next += 0x000400; - DrvVidRAM0 = Next; Next += 0x000400; - DrvColRAM1 = Next; Next += 0x000400; - DrvVidRAM1 = Next; Next += 0x000400; - - DrvSprRAM0 = Next; Next += 0x000800; - DrvSprRAM1 = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void FinalizrDecode() -{ - for (INT32 i = 0; i < 0xc000; i++) { - DrvM6809DecROM[i] = DrvM6809ROM[i] ^ (((i&2)?0x80:0x20)|((i&8)?0x08:0x02)); - } -} - -static void DrvGfxExpand() -{ - for (INT32 i = 0x20000-1; i >= 0; i--) { - DrvGfxROM0[i*2+0] = DrvGfxROM0[i] >> 4; - DrvGfxROM0[i*2+1] = DrvGfxROM0[i] & 0xf; - } -} - -static void DrvPaletteInit() -{ - UINT32 palette[0x20]; - - static const int resistances[4] = { 2200, 1000, 470, 220 }; - double rweights[4], gweights[4], bweights[4]; - - compute_resistor_weights(0, 0xff, -1.0, - 4, &resistances[0], rweights, 470, 0, - 4, &resistances[0], gweights, 470, 0, - 4, &resistances[0], bweights, 470, 0); - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i] >> 3) & 0x01; - - INT32 r = combine_4_weights(rweights, bit0, bit1, bit2, bit3); - - bit0 = (DrvColPROM[i] >> 4) & 0x01; - bit1 = (DrvColPROM[i] >> 5) & 0x01; - bit2 = (DrvColPROM[i] >> 6) & 0x01; - bit3 = (DrvColPROM[i] >> 7) & 0x01; - - INT32 g = combine_4_weights(rweights, bit0, bit1, bit2, bit3); - - bit0 = (DrvColPROM[i + 0x20] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x20] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x20] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x20] >> 3) & 0x01; - - INT32 b = combine_4_weights(rweights, bit0, bit1, bit2, bit3); - - palette[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) { - DrvPalette[i] = palette[(DrvColPROM[i+0x40]&0xf)+((~i&0x100)/16)]; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if ((BurnDrvGetFlags() & BDF_BOOTLEG) == 0) - { - if (BurnLoadRom(DrvM6809ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvI8039ROM + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10001, 9, 2)) return 1; - memset (DrvGfxROM0 + 0x18000, 0xff, 0x08000); - - if (BurnLoadRom(DrvColPROM + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00040, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00140, 13, 1)) return 1; - } - else - { - if (BurnLoadRom(DrvM6809ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 1, 1)) return 1; - - if (BurnLoadRom(DrvI8039ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10001, 8, 2)) return 1; - memset (DrvGfxROM0 + 0x18000, 0xff, 0x08000); - - if (BurnLoadRom(DrvColPROM + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00040, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00140, 12, 1)) return 1; - } - - FinalizrDecode(); - DrvGfxExpand(); - DrvPaletteInit(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvColRAM0, 0x2000, 0x23ff, MAP_RAM); - M6809MapMemory(DrvVidRAM0, 0x2400, 0x27ff, MAP_RAM); - M6809MapMemory(DrvColRAM1, 0x2800, 0x2bff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x2c00, 0x2fff, MAP_RAM); - M6809MapMemory(DrvSprRAM0, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvSprRAM1, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM, 0x4000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809DecROM, 0x4000, 0xffff, MAP_FETCH); - M6809SetWriteHandler(finalizr_main_write); - M6809SetReadHandler(finalizr_main_read); - M6809Close(); - - I8039Init(NULL); - I8039SetProgramReadHandler(finalizr_sound_read); - I8039SetCPUOpReadHandler(finalizr_sound_read); - I8039SetCPUOpReadArgHandler(finalizr_sound_read); - I8039SetIOReadHandler(finalizr_sound_read_port); - I8039SetIOWriteHandler(finalizr_sound_write_port); - - SN76489AInit(0, 1536000, 0); - SN76496SetRoute(0, 0.45, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - I8039Exit(); - - SN76496Exit(); - DACExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_bg_layer() -{ - INT32 scrollx = scroll - 32; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = ((offs & 0x1f) * 8); - INT32 sy = ((offs / 0x20) * 8) - 16; - if (sy < 0 || sy >= nScreenHeight) continue; - - sx -= scrollx; - - if (sx < 25) sx += 256; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvColRAM0[offs]; - INT32 code = DrvVidRAM0[offs] | ((attr & 0xc0) << 2) | (charbank << 10); - INT32 color = attr & 0x0f; - INT32 flipy = attr & 0x20; - INT32 flipx = attr & 0x10; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - if (sx >= 32) continue; - INT32 sy = ((offs / 0x20) * 8) - 16; - if (sy < 0 || sy >= nScreenHeight) continue; - - INT32 attr = DrvColRAM1[offs]; - INT32 code = DrvVidRAM1[offs] | ((attr & 0xc0) << 2); - INT32 color = attr & 0x0f; - INT32 flipy = attr & 0x20; - INT32 flipx = attr & 0x10; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } - } -} - -static void draw_16x16(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - code &= 0xfff; - sy -= 16; - - INT32 flip = ((flipx)?1:0)|((flipy)?2:0); - - for (INT32 i = 0; i < 4; i++) - { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code + (flip^i), sx + (i & 1) * 8, sy + (i & 2) * 4, color, 4, 0, 0x100, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code + (flip^i), sx + (i & 1) * 8, sy + (i & 2) * 4, color, 4, 0, 0x100, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code + (flip^i), sx + (i & 1) * 8, sy + (i & 2) * 4, color, 4, 0, 0x100, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code + (flip^i), sx + (i & 1) * 8, sy + (i & 2) * 4, color, 4, 0, 0x100, DrvGfxROM0); - } - } - } -} - -static void draw_8x8(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - code &= 0xfff; - sy -= 16; - - for (INT32 i = 0; i < 4; i++) - { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - UINT8 *sr = spriterambank ? DrvSprRAM1 : DrvSprRAM0; - - for (INT32 offs = 0; offs <= 0x200 - 5; offs += 5) - { - INT32 sx = 32 + 1 + sr[offs + 3] - ((sr[offs + 4] & 0x01) << 8); - INT32 sy = sr[offs + 2]; - INT32 flipx = sr[offs + 4] & 0x20; - INT32 flipy = sr[offs + 4] & 0x40; - INT32 code = sr[offs] + ((sr[offs + 1] & 0x0f) << 8); - INT32 color = ((sr[offs + 1] & 0xf0) >> 4); - INT32 size = sr[offs + 4] & 0x1c; - - if (size >= 0x10) - { - if (flipscreen) - { - sx = 256 - sx; - sy = 224 - sy; - flipx = !flipx; - flipy = !flipy; - } - - draw_16x16(code*4+0, color, flipx ? sx + 16 : sx, flipy ? sy + 16 : sy, flipx, flipy); - draw_16x16(code*4+4, color, flipx ? sx : sx + 16, flipy ? sy + 16 : sy, flipx, flipy); - draw_16x16(code*4+8, color, flipx ? sx + 16: sx , flipy ? sy : sy + 16, flipx, flipy); - draw_16x16(code*4+12, color, flipx ? sx : sx + 16, flipy ? sy : sy + 16, flipx, flipy); - } - else - { - if (flipscreen) - { - sx = ((size & 0x08) ? 280: 272) - sx; - sy = ((size & 0x04) ? 248: 240) - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (size == 0x00) - { - draw_16x16(code*4, color, sx, sy, flipx, flipy); - } - else - { - code = ((code & 0x3ff) << 2) | ((code & 0xc00) >> 10); - - if (size == 0x04) - { - draw_8x8(code &~1, color, flipx ? sx + 8 : sx, sy, flipx, flipy); - draw_8x8(code | 1, color, flipx ? sx : sx + 8, sy, flipx, flipy); - } - else if (size == 0x08) - { - draw_8x8(code &~2, color, sx, flipy ? sy + 8 : sy, flipx, flipy); - draw_8x8(code | 2, color, sx, flipy ? sy : sy + 8, flipx, flipy); - } - else if (size == 0x0c) - { - draw_8x8(code, color, sx, sy, flipx, flipy); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_bg_layer(); - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 4) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - M6809NewFrame(); - I8039NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 1536000 / 60, 9216000 / 15 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - M6809Open(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - if (i == 240 && irq_enable) { - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Run(100); - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - } - - if ((i % 32) == 31 && nmi_enable) M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - - if (i == 240) vblank = 1; // ? - - INT32 nSegment = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += I8039Run(nSegment - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - M6809Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - I8039Scan(nAction,pnMin); - - DACScan(nAction,pnMin); - SN76496Scan(nAction,pnMin); - - SCAN_VAR(scroll); - SCAN_VAR(nmi_enable); - SCAN_VAR(irq_enable); - SCAN_VAR(charbank); - SCAN_VAR(spriterambank); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(i8039_t1); - } - - return 0; -} - - -// Finalizer - Super Transformation - -static struct BurnRomInfo finalizrRomDesc[] = { - { "523k01.9c", 0x4000, 0x716633cb, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "523k02.12c", 0x4000, 0x1bccc696, 1 | BRF_PRG | BRF_ESS }, // 1 - { "523k03.13c", 0x4000, 0xc48927c6, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "d8749hd.bin", 0x0800, 0x978dfc33, 2 | BRF_PRG | BRF_ESS }, // 3 I8039 Code - - { "523h04.5e", 0x4000, 0xc056d710, 3 | BRF_GRA }, // 4 Sprites & tiles - { "523h07.5f", 0x4000, 0x50e512ba, 3 | BRF_GRA }, // 5 - { "523h05.6e", 0x4000, 0xae0d0f76, 3 | BRF_GRA }, // 6 - { "523h08.6f", 0x4000, 0x79f44e17, 3 | BRF_GRA }, // 7 - { "523h06.7e", 0x4000, 0xd2db9689, 3 | BRF_GRA }, // 8 - { "523h09.7f", 0x4000, 0x8896dc85, 3 | BRF_GRA }, // 9 - - { "523h10.2f", 0x0020, 0xec15dd15, 4 | BRF_GRA }, // 10 Color Proms - { "523h11.3f", 0x0020, 0x54be2e83, 4 | BRF_GRA }, // 11 - { "523h13.11f", 0x0100, 0x4e0647a0, 4 | BRF_GRA }, // 12 - { "523h12.10f", 0x0100, 0x53166a2a, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(finalizr) -STD_ROM_FN(finalizr) - -struct BurnDriver BurnDrvFinalizr = { - "finalizr", NULL, NULL, NULL, "1985", - "Finalizer - Super Transformation\0", NULL, "Konami", "GX523", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, finalizrRomInfo, finalizrRomName, NULL, NULL, FinalizrInputInfo, FinalizrDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 272, 3, 4 -}; - - -// Finalizer - Super Transformation (bootleg) - -static struct BurnRomInfo finalizrbRomDesc[] = { - { "finalizr.5", 0x8000, 0xa55e3f14, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "finalizr.6", 0x4000, 0xce177f6e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "d8749hd.bin", 0x0800, 0x978dfc33, 2 | BRF_PRG | BRF_ESS }, // 2 I8039 Code - - { "523h04.5e", 0x4000, 0xc056d710, 3 | BRF_GRA }, // 3 Sprites & tiles - { "523h07.5f", 0x4000, 0x50e512ba, 3 | BRF_GRA }, // 4 - { "523h05.6e", 0x4000, 0xae0d0f76, 3 | BRF_GRA }, // 5 - { "523h08.6f", 0x4000, 0x79f44e17, 3 | BRF_GRA }, // 6 - { "523h06.7e", 0x4000, 0xd2db9689, 3 | BRF_GRA }, // 7 - { "523h09.7f", 0x4000, 0x8896dc85, 3 | BRF_GRA }, // 8 - - { "523h10.2f", 0x0020, 0xec15dd15, 4 | BRF_GRA }, // 9 Color Proms - { "523h11.3f", 0x0020, 0x54be2e83, 4 | BRF_GRA }, // 10 - { "523h13.11f", 0x0100, 0x4e0647a0, 4 | BRF_GRA }, // 11 - { "523h12.10f", 0x0100, 0x53166a2a, 4 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(finalizrb) -STD_ROM_FN(finalizrb) - -struct BurnDriver BurnDrvFinalizrb = { - "finalizrb", "finalizr", NULL, NULL, "1985", - "Finalizer - Super Transformation (bootleg)\0", NULL, "bootleg", "GX523", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, finalizrbRomInfo, finalizrbRomName, NULL, NULL, FinalizrInputInfo, FinalizrDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 272, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_gberet.cpp b/jan/src/burn/drv/konami/d_gberet.cpp deleted file mode 100644 index a8bfc2086..000000000 --- a/jan/src/burn/drv/konami/d_gberet.cpp +++ /dev/null @@ -1,1131 +0,0 @@ -// FB Alpha Green Beret driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" - -static UINT8 *Mem, *MemEnd, *Rom, *Gfx0, *Gfx1, *Prom; -static UINT32 *Palette, *DrvPalette; -static UINT8 DrvRecalcPal; - -static UINT8 DrvJoy1[8], DrvJoy2[8], DrvJoy3[8], DrvDips[4], DrvReset; - -static UINT8 nmi_enable, irq_enable; -static UINT16 gberetb_scroll; -static UINT8 flipscreen; -static UINT8 gberet_spritebank; -static INT32 mrgoemon_bank; -static UINT8 soundlatch; - -static INT32 game_type = 0; // 0 gberet / rushatck, 1 gberetb, 2 mrgoemon - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy3 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy3 + 3, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 1, "p1 right" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy3 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy3 + 4, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 1, "p2 right" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy2 + 3, "p2 down" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p2 fire 2" }, - - {"Service" , BIT_DIGITAL , DrvJoy3 + 2, "service" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDips + 2, "dip" }, - -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo gberetbInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy3 + 7, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy3 + 5, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 1, "p1 right" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy3 + 6, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy3 + 4, "p2 start" }, - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDips + 3, "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(gberetb) - -static struct BurnDIPInfo gberetDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15 , "Coin B" }, - {0x12, 0x82, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - - {0x13, 0xff, 0xff, 0x4a, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "30K 70K 70K+" }, - {0x13, 0x01, 0x18, 0x10, "40K 80K 80K+" }, - {0x13, 0x01, 0x18, 0x08, "50K 100K 100K+" }, - {0x13, 0x01, 0x18, 0x00, "50K 200K 200K+" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0x14, 0xff, 0xff, 0x0f, NULL }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x14, 0x01, 0x02, 0x02, "Single" }, - {0x14, 0x01, 0x02, 0x00, "Dual" }, -}; - -STDDIPINFO(gberet) - -static struct BurnDIPInfo gberetbDIPList[]= -{ - {0x0b, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x0b, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x0b, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x0b, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x0b, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x0b, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x0b, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x0b, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x0b, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x0b, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x0b, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x0b, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x0b, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15 , "Coin B" }, - {0x0b, 0x82, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - {0x0b, 0x82, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x0b, 0x00, 0x0f, 0x00, NULL }, - - {0x0c, 0xff, 0xff, 0x4a, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0c, 0x01, 0x03, 0x03, "2" }, - {0x0c, 0x01, 0x03, 0x02, "3" }, - {0x0c, 0x01, 0x03, 0x01, "5" }, - {0x0c, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x04, 0x00, "Upright" }, - {0x0c, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0c, 0x01, 0x18, 0x18, "30K 70K 70K+" }, - {0x0c, 0x01, 0x18, 0x10, "40K 80K 80K+" }, - {0x0c, 0x01, 0x18, 0x08, "50K 100K 100K+" }, - {0x0c, 0x01, 0x18, 0x00, "50K 200K 200K+" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x60, 0x60, "Easy" }, - {0x0c, 0x01, 0x60, 0x40, "Normal" }, - {0x0c, 0x01, 0x60, 0x20, "Difficult" }, - {0x0c, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x80, 0x80, "Off" }, - {0x0c, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(gberetb) - -static struct BurnDIPInfo mrgoemonDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15 , "Coin B" }, - {0x12, 0x82, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - {0x12, 0x82, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x00, 0x0f, 0x00, NULL }, - - {0x13, 0xff, 0xff, 0x4a, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "20K 60K+" }, - {0x13, 0x01, 0x18, 0x10, "30K 70K+" }, - {0x13, 0x01, 0x18, 0x08, "40K 80K+" }, - {0x13, 0x01, 0x18, 0x00, "50K 90K+" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0x14, 0xff, 0xff, 0x0f, NULL }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x14, 0x01, 0x02, 0x02, "Single" }, - {0x14, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(mrgoemon) - -static void mrgoemon_bankswitch(INT32 nBank) -{ - mrgoemon_bank = nBank; - ZetMapArea(0xf800, 0xffff, 0, Rom + 0x10000 + mrgoemon_bank); - ZetMapArea(0xf800, 0xffff, 2, Rom + 0x10000 + mrgoemon_bank); -} - -void __fastcall gberet_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe040: - case 0xe041: - case 0xe042: - return; - - case 0xe043: - gberet_spritebank = data; - return; - - case 0xe044: - { - nmi_enable = data & 0x01; - irq_enable = data & ((game_type & 2) ? 0x02 : 0x04); - - flipscreen = data & 0x08; - } - return; - - case 0xf000: - { - // Coin counters - - if (game_type == 2) { - mrgoemon_bankswitch((data >> 5) << 11); - } - } - return; - case 0xf200: - soundlatch = data; - return; - case 0xf400: - if (game_type == 1) {// gberetb - SN76496Write(0, data); - } else { // gberet - SN76496Write(0, soundlatch); - } - return; - case 0xf600: // watchdog - return; - - case 0xf900: - case 0xf901: - gberetb_scroll = (((address & 1) << 8) | data) + 0x38; - return; - } - - if (address >= 0xe000 && address <= 0xe03f) { - Rom[address] = data; - return; - } - - if (game_type != 1) return; - - if (address >= 0xe900 && address <= 0xe9ff) { - Rom[address] = data; - return; - } -} - -UINT8 __fastcall gberet_read(UINT16 address) -{ - UINT8 nRet = 0xff; - - switch (address) - { - case 0xf200: - return DrvDips[1]; - - case 0xf400: - return DrvDips[2]; - - case 0xf600: - return DrvDips[0]; - - case 0xf601: - { - if (game_type & 1) return DrvDips[3]; - - for (INT32 i = 0; i < 8; i++) nRet ^= DrvJoy2[i] << i; - - return nRet; - } - - - case 0xf602: - { - for (INT32 i = 0; i < 8; i++) nRet ^= DrvJoy1[i] << i; - - return nRet; - } - - - case 0xf603: - { - for (INT32 i = 0; i < 8; i++) nRet ^= DrvJoy3[i] << i; - - return nRet; - } - } - - if (address >= 0xe000 && address <= 0xe03f) { - return Rom[address]; - } - - if (game_type != 1) return 0; - - if (address >= 0xe900 && address <= 0xe9ff) { - return Rom[address]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - flipscreen = 0; - nmi_enable = 0; - irq_enable = 0; - mrgoemon_bank = 0; - gberetb_scroll = 0; - gberet_spritebank = 0; - - ZetOpen(0); - ZetReset(); - - if (game_type & 2) { - mrgoemon_bankswitch(0); - } - - ZetClose(); - - HiscoreReset(); - - return 0; -} - - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Rom = Next; Next += 0x14000; - - Gfx0 = Next; Next += 0x08000; - Gfx1 = Next; Next += 0x20000; - - Prom = Next; Next += 0x00220; - - Palette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - DrvPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static void DrvCreatePalette() -{ - UINT32 tmp[0x20]; - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0, bit1, bit2; - INT32 r, g, b; - - bit0 = (Prom[i] >> 0) & 0x01; - bit1 = (Prom[i] >> 1) & 0x01; - bit2 = (Prom[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (Prom[i] >> 3) & 0x01; - bit1 = (Prom[i] >> 4) & 0x01; - bit2 = (Prom[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (Prom[i] >> 6) & 0x01; - bit2 = (Prom[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - tmp[i] = (r << 16) | (g << 8) | b; - } - - Prom += 0x20; - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 ctabentry; - - ctabentry = (Prom[0x000 + i] & 0x0f) | 0x10; - Palette[0x000 + i] = tmp[ctabentry]; - - ctabentry = (Prom[0x100 + i] & 0x0f); - Palette[0x100 + i] = tmp[ctabentry]; - } -} - -static void Graphics_Decode(INT32 *CharPlanes, INT32 *CharXOffs, INT32 *CharYOffs, INT32 *SprPlanes, INT32 *SprXOffs, INT32 *SprYOffs, INT32 SprMod) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, Gfx0, 0x4000); - - GfxDecode(0x200, 4, 8, 8, CharPlanes, CharXOffs, CharYOffs, 0x100, tmp, Gfx0); - - memcpy (tmp, Gfx1, 0x10000); - - GfxDecode(0x200, 4, 16, 16, SprPlanes, SprXOffs, SprYOffs, SprMod, tmp, Gfx1); - - BurnFree (tmp); -} - -static void DrvGfxDecode() -{ - static INT32 Planes[4] = { STEP4(0,1) }; - static INT32 XOffs[16] = { STEP8(0,4), STEP8(256,4) }; - static INT32 YOffs[16] = { STEP8(0,32), STEP8(512,32) }; - - Graphics_Decode(Planes, XOffs, YOffs, Planes, XOffs, YOffs, 0x400); -} - -static void BootGfxDecode() -{ - static INT32 CharPlanes[4] = { STEP4(0,1) }; - static INT32 CharXOffs[8] = { 24, 28, 0, 4, 8, 12, 16, 20 }; - static INT32 CharYOffs[8] = { STEP8(0, 32) }; - static INT32 SpriPlanes[4] = { 0, 0x20000, 0x40000, 0x60000 }; - static INT32 SpriXOffs[16] = { STEP8(0, 1), STEP8(128, 1) }; - static INT32 SpriYOffs[16] = { STEP16(0, 8) }; - - Graphics_Decode(CharPlanes, CharXOffs, CharYOffs, SpriPlanes, SpriXOffs, SpriYOffs, 0x100); -} - -static INT32 GetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *Load0 = Rom; - UINT8 *Load1 = Gfx0; - UINT8 *Load2 = Gfx1; - UINT8 *Load3 = Prom; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(Load0, i, 1)) return 1; - Load0 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(Load1, i, 1)) return 1; - Load1 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(Load2, i, 1)) return 1; - Load2 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(Load3, i, 1)) return 1; - Load3 += ri.nLen; - - continue; - } - } - - if (game_type == 2) { - memcpy (Rom + 0x10000, Rom + 0x0c000, 0x04000); - memset (Rom + 0x0c000, 0, 0x04000); - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - if (GetRoms()) return 1; - - if (game_type == 1) { - BootGfxDecode(); - } else { - DrvGfxDecode(); - } - DrvCreatePalette(); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(gberet_read); - ZetSetWriteHandler(gberet_write); - ZetMapArea(0x0000, 0xbfff, 0, Rom + 0x0000); - ZetMapArea(0x0000, 0xbfff, 2, Rom + 0x0000); - ZetMapArea(0xc000, 0xcfff, 0, Rom + 0xc000); - ZetMapArea(0xc000, 0xcfff, 1, Rom + 0xc000); - ZetMapArea(0xd000, 0xd0ff, 0, Rom + 0xd000); - ZetMapArea(0xd000, 0xd0ff, 1, Rom + 0xd000); - ZetMapArea(0xd100, 0xd1ff, 0, Rom + 0xd100); - ZetMapArea(0xd100, 0xd1ff, 1, Rom + 0xd100); - ZetMapArea(0xd200, 0xdfff, 0, Rom + 0xd200); - ZetMapArea(0xd200, 0xdfff, 1, Rom + 0xd200); - ZetMapArea(0xd200, 0xdfff, 2, Rom + 0xd200); - if (game_type == 2) { - ZetMapArea(0xe800, 0xe8ff, 0, Rom + 0xe800); - ZetMapArea(0xe800, 0xe8ff, 1, Rom + 0xe800); - ZetMapArea(0xe800, 0xe8ff, 2, Rom + 0xe800); - } - ZetClose(); - - SN76489AInit(0, 18432000 / 12, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - if (game_type == 0) { - BurnSetRefreshRate(30.0); - } - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - SN76496Exit(); - - BurnFree (Rom); - - game_type = 0; - - - return 0; -} - -static inline void put_pixel(INT32 x, INT32 y, INT32 src, INT32 color) -{ - INT32 pxl = color | src; - - if (y < 0 || x < 0 || x >= nScreenWidth || y >= nScreenHeight || !Prom[pxl]) return; - - pTransDraw[(y * nScreenWidth) + x] = pxl; -} - -static void gberet_draw_16x16(INT32 num, INT32 sx, INT32 sy, INT32 color, INT32 flipx, INT32 flipy) -{ - color |= 0x100; - UINT8 *src = Gfx1 + (num << 8); - - if (flipy) { - if (flipx) { - for (INT32 y = sy + 15; y >= sy; y--) { - for (INT32 x = sx + 15; x >= sx; x--, src++) { - put_pixel(x, y, *src, color); - } - } - } else { - for (INT32 y = sy + 15; y >= sy; y--) { - for (INT32 x = sx; x < sx + 16; x++, src++) { - put_pixel(x, y, *src, color); - } - } - } - } else { - if (flipx) { - for (INT32 y = sy; y < sy + 16; y++) { - for (INT32 x = sx + 15; x >= sx; x--, src++) { - put_pixel(x, y, *src, color); - } - } - } else { - for (INT32 y = sy; y < sy + 16; y++) { - for (INT32 x = sx; x < sx + 16; x++, src++) { - put_pixel(x, y, *src, color); - } - } - } - } -} - -static void gberet_draw_sprites() -{ - UINT8 *sr = Rom + 0xd000 + ((~gberet_spritebank & 8) << 5); - - for (INT32 offs = 0; offs < 0xc0; offs += 4) - { - if (sr[offs + 3]) - { - INT32 attr = sr[offs + 1]; - INT32 code = sr[offs + 0] + ((attr & 0x40) << 2); - INT32 sx = sr[offs + 2] - 2 * (attr & 0x80); - INT32 sy = sr[offs + 3]; - INT32 color = (attr & 0x0f) << 4; - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 16; - sx -= 8; - - gberet_draw_16x16(code, sx, sy, color, flipx, flipy); - } - } -} - -static void gberetb_draw_sprites() -{ - for (INT32 offs = 0x100 - 4; offs >= 0; offs -= 4) - { - if (Rom[0xe901 + offs]) - { - INT32 attr = Rom[0xe903 + offs]; - INT32 code = Rom[0xe900 + offs] + ((attr & 0x40) << 2); - INT32 sx = Rom[0xe902 + offs] - 2 * (attr & 0x80); - INT32 sy = 240 - Rom[0xe901 + offs]; - INT32 color = (attr & 0x0f) << 4; - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 16; - sx -= 8; - - gberet_draw_16x16(code, sx, sy, color, flipx, flipy); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalcPal) { - for (INT32 i = 0; i < 0x200; i++) { - DrvPalette[i] = BurnHighCol(Palette[i] >> 16, Palette[i] >> 8, Palette[i], 0); - } - } - - for (INT32 offs = 0x40; offs < 0x7c0; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 3) & 0xf8; - INT32 attr = Rom[0xc000 + offs]; - INT32 code = Rom[0xc800 + offs] + ((attr & 0x40) << 2); - INT32 color = attr & 0x0f; - INT32 flipy = attr & 0x20; - INT32 flipx = attr & 0x10; - - INT32 scroll = 0; - - if (game_type & 1) { - if (sy > 0x2f && sy < 0xe8) { - scroll = gberetb_scroll; - } - } else { - scroll = Rom[0xe000 | (sy >> 3)] | (Rom[0xe020 | (sy >> 3)] << 8); - } - - sx -= scroll; - sx += (sx >> 21) & 0x200; - - if (flipscreen) { - sx = 248 - sx; - sy = 248 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 16; - sx -= 8; - - if (sx < -7 || sx >= 0x100 || sy < 0 || sy > 223) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, Gfx0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, Gfx0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, Gfx0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, Gfx0); - - } - } - } - - if (game_type & 1) { - gberetb_draw_sprites(); - } else { - gberet_draw_sprites(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = game_type ? 16 : 32; - INT32 nSoundBufferPos = 0; - - if (DrvReset) { - DrvDoReset(); - } - - ZetOpen(0); - - INT32 nCyclesDone, nCyclesTotal; - - nCyclesDone = 0; - nCyclesTotal = 3072000 / (nBurnFPS / 256); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nCyclesSegment = (nCyclesTotal - nCyclesDone) / (nInterleave - i); - - nCyclesDone = ZetRun(nCyclesSegment); - - if (irq_enable && i == (nInterleave - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - if (nmi_enable && (i & 1)) { - ZetNmi(); - } - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - ZetClose(); - -// Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029675; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = Rom + 0xc000; - ba.nLen = 0x4000; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - SCAN_VAR(nmi_enable); - SCAN_VAR(irq_enable); - SCAN_VAR(flipscreen); - SCAN_VAR(mrgoemon_bank); - SCAN_VAR(gberetb_scroll); - SCAN_VAR(gberet_spritebank); - SCAN_VAR(soundlatch); - SN76496Scan(nAction, pnMin); - - ZetOpen(0); - mrgoemon_bankswitch(mrgoemon_bank); - ZetClose(); - } - - return 0; -} - -// Green Beret - -static struct BurnRomInfo gberetRomDesc[] = { - { "577l03.10c", 0x4000, 0xae29e4ff, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "577l02.8c", 0x4000, 0x240836a5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "577l01.7c", 0x4000, 0x41fa3e1f, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "577l07.3f", 0x4000, 0x4da7bd1b, 2 | BRF_GRA }, // 3 Characters - - { "577l06.5e", 0x4000, 0x0f1cb0ca, 3 | BRF_GRA }, // 4 Sprites - { "577l05.4e", 0x4000, 0x523a8b66, 3 | BRF_GRA }, // 5 - { "577l08.4f", 0x4000, 0x883933a4, 3 | BRF_GRA }, // 6 - { "577l04.3e", 0x4000, 0xccecda4c, 3 | BRF_GRA }, // 7 - - { "577h09.2f", 0x0020, 0xc15e7c80, 4 | BRF_GRA }, // 8 Color Proms - { "577h11.6f", 0x0100, 0x2a1a992b, 4 | BRF_GRA }, // 9 - { "577h10.5f", 0x0100, 0xe9de1e53, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(gberet) -STD_ROM_FN(gberet) - -struct BurnDriver BurnDrvGberet = { - "gberet", NULL, NULL, NULL, "1985", - "Green Beret\0", NULL, "Konami", "GX577", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, gberetRomInfo, gberetRomName, NULL, NULL, DrvInputInfo, gberetDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalcPal, 0x200, - 240, 224, 4, 3 -}; - - -// Rush'n Attack (US) - -static struct BurnRomInfo rushatckRomDesc[] = { - { "577h03.10c", 0x4000, 0x4d276b52, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "577h02.8c", 0x4000, 0xb5802806, 1 | BRF_PRG | BRF_ESS }, // 1 - { "577h01.7c", 0x4000, 0xda7c8f3d, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "577h07.3f", 0x4000, 0x03f9815f, 2 | BRF_GRA }, // 3 Characters - - { "577l06.5e", 0x4000, 0x0f1cb0ca, 3 | BRF_GRA }, // 4 Sprites - { "577h05.4e", 0x4000, 0x9d028e8f, 3 | BRF_GRA }, // 5 - { "577l08.4f", 0x4000, 0x883933a4, 3 | BRF_GRA }, // 6 - { "577l04.3e", 0x4000, 0xccecda4c, 3 | BRF_GRA }, // 7 - - { "577h09.2f", 0x0020, 0xc15e7c80, 4 | BRF_GRA }, // 8 Color Proms - { "577h11.6f", 0x0100, 0x2a1a992b, 4 | BRF_GRA }, // 9 - { "577h10.5f", 0x0100, 0xe9de1e53, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(rushatck) -STD_ROM_FN(rushatck) - -struct BurnDriver BurnDrvRushatck = { - "rushatck", "gberet", NULL, NULL, "1985", - "Rush'n Attack (US)\0", NULL, "Konami", "GX577", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, rushatckRomInfo, rushatckRomName, NULL, NULL, DrvInputInfo, gberetDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalcPal, 0x200, - 240, 224, 4, 3 -}; - - -// Green Beret (bootleg) - -static struct BurnRomInfo gberetbRomDesc[] = { - { "2-ic82.10g", 0x8000, 0x6d6fb494, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "3-ic81.10f", 0x4000, 0xf1520a0a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1-ic92.12c", 0x4000, 0xb0189c87, 2 | BRF_GRA }, // 2 Characters - - { "7-1c8.2b", 0x4000, 0x86334522, 3 | BRF_GRA }, // 3 Sprites - { "6-ic9.2c", 0x4000, 0xbda50d3e, 3 | BRF_GRA }, // 4 - { "5-ic10.2d", 0x4000, 0x6a7b3881, 3 | BRF_GRA }, // 5 - { "4-ic11.2e", 0x4000, 0x3fb186c9, 3 | BRF_GRA }, // 6 - - { "577h09", 0x0020, 0xc15e7c80, 4 | BRF_GRA }, // 7 Color Proms - { "577h11.6f", 0x0100, 0x2a1a992b, 4 | BRF_GRA }, // 8 - { "577h10.5f", 0x0100, 0xe9de1e53, 4 | BRF_GRA }, // 9 - - { "pal16r6_ic35.5h", 0x0104, 0xbd76fb53, BRF_GRA }, -}; - -STD_ROM_PICK(gberetb) -STD_ROM_FN(gberetb) - -static INT32 gberetbInit() -{ - game_type = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvGberetb = { - "gberetb", "gberet", NULL, NULL, "1985", - "Green Beret (bootleg)\0", NULL, "bootleg", "GX577", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, gberetbRomInfo, gberetbRomName, NULL, NULL, gberetbInputInfo, gberetbDIPInfo, - gberetbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalcPal, 0x200, - 240, 224, 4, 3 -}; - - -// Mr. Goemon (Japan) - -static struct BurnRomInfo mrgoemonRomDesc[] = { - { "621d01.10c", 0x8000, 0xb2219c56, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "621d02.12c", 0x8000, 0xc3337a97, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "621a05.6d", 0x4000, 0xf0a6dfc5, 2 | BRF_GRA }, // 2 Characters - - { "621d03.4d", 0x8000, 0x66f2b973, 3 | BRF_GRA }, // 3 Sprites - { "621d04.5d", 0x8000, 0x47df6301, 3 | BRF_GRA }, // 4 - - { "621a06.5f", 0x0020, 0x7c90de5f, 4 | BRF_GRA }, // 5 Color Proms - { "621a08.7f", 0x0100, 0x2fb244dd, 4 | BRF_GRA }, // 6 - { "621a07.6f", 0x0100, 0x3980acdc, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(mrgoemon) -STD_ROM_FN(mrgoemon) - -static INT32 mrgoemonInit() -{ - game_type = 2; - - return DrvInit(); -} - -struct BurnDriver BurnDrvMrgoemon = { - "mrgoemon", NULL, NULL, NULL, "1986", - "Mr. Goemon (Japan)\0", NULL, "Konami", "Miscellaneous", - L"Mr. Goemon \u4E94\u53F3\u885B\u9580 (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, mrgoemonRomInfo, mrgoemonRomName, NULL, NULL, DrvInputInfo, mrgoemonDIPInfo, - mrgoemonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalcPal, 0x200, - 240, 224, 4, 3 -}; - diff --git a/jan/src/burn/drv/konami/d_gbusters.cpp b/jan/src/burn/drv/konami/d_gbusters.cpp deleted file mode 100644 index 6cbd4dee9..000000000 --- a/jan/src/burn/drv/konami/d_gbusters.cpp +++ /dev/null @@ -1,680 +0,0 @@ -// FB Alpha Gang Busters driver module -// Based on MAME by Manuel Abadia - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k007232.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvBankRAM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *nDrvRamBank; -static UINT8 *nDrvKonamiBank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo GbustersInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Gbusters) - -static struct BurnDIPInfo GbustersDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x56, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Bullets" }, - {0x13, 0x01, 0x04, 0x04, "50" }, - {0x13, 0x01, 0x04, 0x00, "60" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "50k, 200k & 400k" }, - {0x13, 0x01, 0x18, 0x10, "70k, 250k & 500k" }, - {0x13, 0x01, 0x18, 0x08, "50k" }, - {0x13, 0x01, 0x18, 0x00, "70k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x01, 0x01, "Off" }, -// {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Gbusters) - -static void set_ram_bank(INT32 data) -{ - nDrvRamBank[0] = data; - - if (~data & 0x01) { - konamiMapMemory(DrvPalRAM, 0x5800, 0x5fff, MAP_RAM); - } else { - konamiMapMemory(DrvBankRAM, 0x5800, 0x5fff, MAP_RAM); - } -} - -void gbusters_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1f80: - set_ram_bank(data); - return; - - case 0x1f84: - *soundlatch = data; - return; - - case 0x1f88: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - - return; - - case 0x1f8c: - // watchdog - return; - - case 0x1f98: - K052109RMRDLine = data & 0x01; - return; - } - - if ((address & 0xc000) == 0x0000) { - K052109_051960_w(address & 0x3fff, data); - return; - } -} - -UINT8 gbusters_main_read(UINT16 address) -{ - switch (address) - { - case 0x1f90: - return DrvInputs[0]; - - case 0x1f91: - return DrvInputs[1]; - - case 0x1f92: - return DrvInputs[2]; - - case 0x1f93: - return DrvDips[2]; - - case 0x1f94: - return DrvDips[0]; - - case 0x1f95: - return DrvDips[1]; - } - - if ((address & 0xc000) == 0x0000) { - return K052109_051960_r(address & 0x3fff); - } - - return 0; -} - -static void gbusters_snd_bankswitch_w(INT32 data) -{ - INT32 bank_B = ((data >> 2) & 0x01); - INT32 bank_A = ((data) & 0x01); - k007232_set_bank(0, bank_A, bank_B ); -} - -void __fastcall gbusters_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - switch (address) - { - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xf000: - gbusters_snd_bankswitch_w(data); - return; - } -} - -UINT8 __fastcall gbusters_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xb000) { - return K007232ReadReg(0, address & 0x0f); - } - - switch (address) - { - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xc001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void gbusters_set_lines(INT32 lines) -{ - INT32 nBank = 0x10000 + (lines & 0x0f) * 0x2000; - - nDrvKonamiBank[1] = lines; - - konamiMapMemory(DrvKonROM + nBank, 0x6000, 0x7fff, MAP_ROM); -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - INT32 layer_colorbase[3] = { 0x30, 0x00, 0x10 }; - - *code |= ((*color & 0x0d) << 8) | ((*color & 0x10) << 5) | (bank << 12); - *code &= 0x3fff; - *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5); -} - -static void K051960Callback(INT32 *code, INT32 *color, INT32 *priority, INT32 *) -{ - *priority = (*color & 0x30) >> 4; - *color = 0x20 + (*color & 0x0f); - *code &= 0x0fff; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x030000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROMExp0 = Next; Next += 0x100000; - DrvGfxROMExp1 = Next; Next += 0x100000; - - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - AllRam = Next; - - DrvBankRAM = Next; Next += 0x000800; - DrvKonRAM = Next; Next += 0x001800; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - nDrvRamBank = Next; Next += 0x000001; - nDrvKonamiBank = Next; Next += 0x000002; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x000000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x020000, 1, 1)) return 1; - memcpy (DrvKonROM + 0x10000, DrvKonROM + 0x00000, 0x08000); - memcpy (DrvKonROM + 0x18000, DrvKonROM + 0x00000, 0x08000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 4, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 7, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x080000); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x080000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonRAM, 0x4000, 0x57ff, MAP_RAM); - konamiMapMemory(DrvBankRAM, 0x5800, 0x5fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(gbusters_main_write); - konamiSetReadHandler(gbusters_main_read); - konamiSetlinesCallback(gbusters_set_lines); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(gbusters_sound_write); - ZetSetReadHandler(gbusters_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH); - - K007232Init(0, 3579545, DrvSndROM, 0x40000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x7ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(8, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0x7ffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(8, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - K007232Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x800); - - K052109UpdateScroll(); - - if (nDrvRamBank[0] & 0x08) - { - - if (nBurnLayer & 1) K052109RenderLayer(2, K052109_OPAQUE, 0); - if (nSpriteEnable & 1) K051960SpritesRender(2, 2); - if (nBurnLayer & 2) K052109RenderLayer(1, 0, 0); - if (nSpriteEnable & 2) K051960SpritesRender(0, 0); - if (nBurnLayer & 4) K052109RenderLayer(0, 0, 0); - - } - else - { - if (nBurnLayer & 1) K052109RenderLayer(1, K052109_OPAQUE, 0); - if (nSpriteEnable & 1) K051960SpritesRender(2, 2); - if (nBurnLayer & 2) K052109RenderLayer(2, 0, 0); - if (nSpriteEnable & 2) K051960SpritesRender(0, 0); - if (nBurnLayer & 4) K052109RenderLayer(0, 0, 0); - } - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - } - - konamiNewFrame(); - ZetNewFrame(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = nBurnSoundLen; - INT32 nCyclesTotal[2] = { 3000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - - nCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K052109_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - set_ram_bank(nDrvRamBank[0]); - gbusters_set_lines(nDrvKonamiBank[1]); - konamiClose(); - } - - return 0; -} - - -// Gang Busters (set 1) - -static struct BurnRomInfo gbustersRomDesc[] = { - { "878n02.k13", 0x10000, 0x51697aaa, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "878j03.k15", 0x10000, 0x3943a065, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "878h01.f8", 0x08000, 0x96feafaa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "878c07.h27", 0x40000, 0xeeed912c, 3 | BRF_GRA }, // 3 Background Tiles - { "878c08.k27", 0x40000, 0x4d14626d, 3 | BRF_GRA }, // 4 - - { "878c05.h5", 0x40000, 0x01f4aea5, 4 | BRF_GRA }, // 5 Sprites - { "878c06.k5", 0x40000, 0xedfaaaaf, 4 | BRF_GRA }, // 6 - - { "878c04.d5", 0x40000, 0x9e982d1c, 5 | BRF_SND }, // 7 K007232 Samples - - { "878a09.f20", 0x00100, 0xe2d09a1b, 6 | BRF_OPT }, // 8 Proms -}; - -STD_ROM_PICK(gbusters) -STD_ROM_FN(gbusters) - -struct BurnDriver BurnDrvGbusters = { - "gbusters", NULL, NULL, NULL, "1988", - "Gang Busters (set 1)\0", NULL, "Konami", "GX878", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gbustersRomInfo, gbustersRomName, NULL, NULL, GbustersInputInfo, GbustersDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 288, 3, 4 -}; - - -// Gang Busters (set 2) - -static struct BurnRomInfo gbusteraRomDesc[] = { - { "878_02.k13", 0x10000, 0x57178414, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "878_03.k15", 0x10000, 0x6c59e660, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "878h01.f8", 0x08000, 0x96feafaa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "878c07.h27", 0x40000, 0xeeed912c, 3 | BRF_GRA }, // 3 Background Tiles - { "878c08.k27", 0x40000, 0x4d14626d, 3 | BRF_GRA }, // 4 - - { "878c05.h5", 0x40000, 0x01f4aea5, 4 | BRF_GRA }, // 5 Sprites - { "878c06.k5", 0x40000, 0xedfaaaaf, 4 | BRF_GRA }, // 6 - - { "878c04.d5", 0x40000, 0x9e982d1c, 5 | BRF_SND }, // 7 K007232 Samples - - { "878a09.f20", 0x00100, 0xe2d09a1b, 6 | BRF_OPT }, // 8 Proms -}; - -STD_ROM_PICK(gbustera) -STD_ROM_FN(gbustera) - -struct BurnDriver BurnDrvGbustera = { - "gbustersa", "gbusters", NULL, NULL, "1988", - "Gang Busters (set 2)\0", NULL, "Konami", "GX878", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gbusteraRomInfo, gbusteraRomName, NULL, NULL, GbustersInputInfo, GbustersDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 288, 3, 4 -}; - - -// Crazy Cop (Japan) - -static struct BurnRomInfo crazycopRomDesc[] = { - { "878m02.k13", 0x10000, 0x9c1c9f52, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "878j03.k15", 0x10000, 0x3943a065, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "878h01.f8", 0x08000, 0x96feafaa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "878c07.h27", 0x40000, 0xeeed912c, 3 | BRF_GRA }, // 3 Background Tiles - { "878c08.k27", 0x40000, 0x4d14626d, 3 | BRF_GRA }, // 4 - - { "878c05.h5", 0x40000, 0x01f4aea5, 4 | BRF_GRA }, // 5 Sprites - { "878c06.k5", 0x40000, 0xedfaaaaf, 4 | BRF_GRA }, // 6 - - { "878c04.d5", 0x40000, 0x9e982d1c, 5 | BRF_SND }, // 7 K007232 Samples - - { "878a09.f20", 0x00100, 0xe2d09a1b, 6 | BRF_OPT }, // 8 Proms -}; - -STD_ROM_PICK(crazycop) -STD_ROM_FN(crazycop) - -struct BurnDriver BurnDrvCrazycop = { - "crazycop", "gbusters", NULL, NULL, "1988", - "Crazy Cop (Japan)\0", NULL, "Konami", "GX878", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, crazycopRomInfo, crazycopRomName, NULL, NULL, GbustersInputInfo, GbustersDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 288, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_gijoe.cpp b/jan/src/burn/drv/konami/d_gijoe.cpp deleted file mode 100644 index 196737d56..000000000 --- a/jan/src/burn/drv/konami/d_gijoe.cpp +++ /dev/null @@ -1,928 +0,0 @@ -// FB Alpha GI Joe driver module -// Based on MAME driver by Olivier Galibert - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k054539.h" -#include "eeprom.h" - -static UINT8 *AllMem; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvEeprom; -static UINT8 *AllRam; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 layerpri[4]; -static INT32 layer_colorbase[4]; -static INT32 sprite_colorbase; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvReset; -static UINT16 DrvInputs[4]; -static UINT8 DrvDips[4]; - -static INT32 avac_bits[4]; -static INT32 avac_occupancy[4]; -static INT32 avac_vrc; - -static INT32 sound_nmi_enable; -static INT32 irq6_timer; -static UINT16 control_data; - -static struct BurnInputInfo GijoeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 10, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 11, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 8, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 9, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 12, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 13, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 14, "p2 fire 3"}, - - {"P3 Coin", BIT_DIGITAL, DrvJoy2 + 2, "p3 coin"}, - {"P3 Start", BIT_DIGITAL, DrvJoy1 + 2, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 2, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 3, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 0, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 1, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p3 fire 3"}, - - {"P4 Coin", BIT_DIGITAL, DrvJoy2 + 3, "p4 coin"}, - {"P4 Start", BIT_DIGITAL, DrvJoy1 + 3, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 10, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 11, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 8, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 9, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 12, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 13, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, DrvJoy4 + 14, "p4 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service 1", BIT_DIGITAL, DrvJoy2 + 8, "service"}, - {"Service 2", BIT_DIGITAL, DrvJoy2 + 9, "service"}, - {"Service 3", BIT_DIGITAL, DrvJoy2 + 10, "service"}, - {"Service 4", BIT_DIGITAL, DrvJoy2 + 11, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip"}, -}; - -STDINPUTINFO(Gijoe) - -static struct BurnDIPInfo GijoeDIPList[]= -{ - {0x29, 0xff, 0xff, 0x08, NULL }, - {0x2a, 0xff, 0xff, 0x80, NULL }, - {0x2b, 0xff, 0xff, 0x80, NULL }, - {0x2c, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x29, 0x01, 0x08, 0x08, "Off" }, - {0x29, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound" }, - {0x2a, 0x01, 0x80, 0x80, "Mono" }, - {0x2a, 0x01, 0x80, 0x00, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Coin mechanism" }, - {0x2b, 0x01, 0x80, 0x80, "Common" }, - {0x2b, 0x01, 0x80, 0x00, "Independent" }, - - {0 , 0xfe, 0 , 2, "Players" }, - {0x2c, 0x01, 0x80, 0x80, "2" }, - {0x2c, 0x01, 0x80, 0x00, "4" }, -}; - -STDDIPINFO(Gijoe) - -static void gijoe_objdma() -{ - UINT16 *src_head, *src_tail, *dst_head, *dst_tail; - - src_head = (UINT16*)DrvSprRAM; - src_tail = src_head + 255 * 8; - dst_head = (UINT16*)K053247Ram; - dst_tail = dst_head + 255 * 8; - - for (; src_head <= src_tail; src_head += 8) - { - if (*src_head & 0x8000) - { - memcpy(dst_head, src_head, 0x10); - dst_head += 8; - } - else - { - *dst_tail = 0; - dst_tail -= 8; - } - } -} - -static void __fastcall gijoe_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff8) == 0x110000) { - K053246Write((address & 0x06) + 0, data >> 8); - K053246Write((address & 0x06) + 1, data&0xff); - return; - } - - if ((address & 0xffc000) == 0x120000) { - K056832RamWriteWord(address & 0x1fff, data); - return; - } - - if ((address & 0xfffff8) == 0x160000) { - return; // regsb - } - - if ((address & 0xffffc0) == 0x1b0000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - switch (address) - { - case 0x1c000c: - *soundlatch = data; - break; - - case 0x1d0000: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } - //bprintf(0, _T("%X %X\n"), address, data); -} - -static void __fastcall gijoe_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffff8) == 0x110000) { - K053246Write((address & 0x07) ^ 0, data); - return; - } - - if ((address & 0xffc000) == 0x120000) { - K056832RamWriteByte(address & 0x1fff, data); - return; - } - - if ((address & 0xfffff8) == 0x160000) { - return; // regsb - } - - if ((address & 0xffffe1) == 0x1a0001) { - K053251Write((address / 2) & 0xf, data); - return; - } - - if ((address & 0xffffc0) == 0x1b0000) { - K056832ByteWrite(address & 0x3f, data); - return; - } - - switch (address) - { - case 0x170000: - return; // watchdog - - case 0x1e8001: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - K053246_set_OBJCHA_line((data & 0x40) >> 6); - control_data = data; - return; - - case 0x1c000c: - case 0x1c000d: - *soundlatch = data; - break; - - case 0x1d0000: - case 0x1d0001: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - } -} - -static UINT16 __fastcall gijoe_main_read_word(UINT32 address) -{ - if ((address & 0xffc000) == 0x120000) { - return K056832RamReadWord(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x130000) { - return K056832RomWordRead(address); - } - - switch (address) - { - case 0x1e0000: - return DrvInputs[2]; - - case 0x1e0002: - return DrvInputs[3]; - - case 0x1e4000: - return DrvInputs[1]; - - case 0x1e4002: - return (DrvInputs[0] & 0xfeff) | (EEPROMRead() ? 0x0100 : 0); - - case 0x1c0014: - return *soundlatch2; - - case 0x1f0000: - return K053246Read(1) + (K053246Read(0) << 8); // ? - } - - return 0; -} - -static UINT8 __fastcall gijoe_main_read_byte(UINT32 address) -{ - if ((address & 0xffc000) == 0x120000) { - return K056832RamReadByte(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x130000) { - return K056832RomWordRead(address) >> ((~address & 1) * 8); - } - - switch (address) - { - case 0x1e0000: - return DrvInputs[2] >> 8; - - case 0x1e0001: - return DrvInputs[2]; - - case 0x1e0002: - return DrvInputs[3] >> 8; - - case 0x1e0003: - return DrvInputs[3]; - - case 0x1e4000: - return DrvInputs[1] >> 8; - - case 0x1e4001: - return DrvInputs[1]; - - case 0x1e4002: - return ((DrvInputs[0] >> 8) & 0xfe) | (EEPROMRead() ? 0x01 : 0); - - case 0x1e4003: - return DrvInputs[0]; - - case 0x1c0014: - case 0x1c0015: - return *soundlatch2; - - case 0x1f0000: - case 0x1f0001: - return K053246Read((address & 1)); // ^ 1? ?? - } - - return 0; -} - -static void __fastcall gijoe_sound_write(UINT16 address, UINT8 data) -{ - if (address >= 0xf800 && address <= 0xfa2f) { - if (address == 0xfa2f) sound_nmi_enable = data & 0x20; - K054539Write(0, address & 0x3ff, data); - return; - } - - switch (address) - { - case 0xfc00: - *soundlatch2 = data; - return; - } -} - -static UINT8 __fastcall gijoe_sound_read(UINT16 address) -{ - if (address >= 0xf800 && address <= 0xfa2f) { - return K054539Read(0, address & 0x3ff); - } - - switch (address) - { - case 0xfc02: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void gijoe_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority) -{ - INT32 pri = (*color & 0x03e0) >> 4; - - if (pri <= layerpri[3]) *priority = 0x0000; - else if (pri > layerpri[3] && pri <= layerpri[2]) *priority = 0xff00; - else if (pri > layerpri[2] && pri <= layerpri[1]) *priority = 0xfff0; - else if (pri > layerpri[1] && pri <= layerpri[0]) *priority = 0xfffc; - else *priority = 0xfffe; - - *color = sprite_colorbase | (*color & 0x001f); -} - -static void gijoe_tile_callback(int layer, int *code, int *color, int */*flags*/) -{ - INT32 tile = *code; - - if (tile >= 0xf000 && tile <= 0xf4ff) - { - tile &= 0x0fff; - if (tile < 0x0310) - { - avac_occupancy[layer] |= 0x0f00; - tile |= avac_bits[0]; - } - else if (tile < 0x0470) - { - avac_occupancy[layer] |= 0xf000; - tile |= avac_bits[1]; - } - else - { - avac_occupancy[layer] |= 0x00f0; - tile |= avac_bits[2]; - } - *code = tile; - } - - *color = (*color >> 2 & 0x0f) | layer_colorbase[layer]; -} - -static const eeprom_interface gijoe_eeprom_interface = -{ - 7, - 8, - "011000", - "011100", - "0100100000000", - "0100000000000", - "0100110000000", - 0, - 0 -}; - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - KonamiICReset(); - - K054539Reset(0); - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvEeprom, 0, 128); - } - - control_data = 0; - - for (INT32 i = 0; i < 4; i++) - { - avac_occupancy[i] = 0; - avac_bits[i] = 0; - layer_colorbase[i] = 0; - layerpri[i] = 0; - } - - avac_vrc = 0xffff; - sound_nmi_enable = 0; - - irq6_timer = -1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROMExp0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROMExp1 = Next; Next += 0x800000; - - DrvSndROM = Next; Next += 0x200000; - - DrvEeprom = Next; Next += 0x000080; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvSprRAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x001000; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 10, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 11, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 12, 1)) return 1; - - K053247GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x200000); - K053247GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x400000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x180000, 0x18ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x190000, 0x190fff, MAP_RAM); - SekSetWriteWordHandler(0, gijoe_main_write_word); - SekSetWriteByteHandler(0, gijoe_main_write_byte); - SekSetReadWordHandler(0, gijoe_main_read_word); - SekSetReadByteHandler(0, gijoe_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xefff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(gijoe_sound_write); - ZetSetReadHandler(gijoe_sound_read); - ZetClose(); - - EEPROMInit(&gijoe_eeprom_interface); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x200000, gijoe_tile_callback); - K056832SetGlobalOffsets(24, 16); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x3fffff, gijoe_sprite_callback, 1); - K053247SetSpriteOffset(-61, -46+10); - - K054539Init(0, 48000, DrvSndROM, 0x200000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - SekExit(); - ZetExit(); - - EEPROMExit(); - - K054539Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x1000/2; i++) - { - INT32 r = (pal[i] & 0x1f); - INT32 g = (pal[i] >> 5) & 0x1f; - INT32 b = (pal[i] >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = (r << 16) + (g << 8) + b; - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - INT32 layers[4], dirty, mask = 0, vrc_mode, vrc_new; - - K056832ReadAvac(&vrc_mode, &vrc_new); - - if (vrc_mode) - { - for (dirty = 0xf000; dirty; dirty >>= 4) - if ((avac_vrc & dirty) != (vrc_new & dirty)) - mask |= dirty; - - avac_vrc = vrc_new; - avac_bits[0] = vrc_new << 4 & 0xf000; - avac_bits[1] = vrc_new & 0xf000; - avac_bits[2] = vrc_new << 8 & 0xf000; - avac_bits[3] = vrc_new << 12 & 0xf000; - } - else - avac_bits[3] = avac_bits[2] = avac_bits[1] = avac_bits[0] = 0xf000; - - sprite_colorbase = K053251GetPaletteIndex(0); - - for (INT32 i = 0; i < 4; i++) { - layer_colorbase[i] = K053251GetPaletteIndex(i+1); - } - - if (K056832ReadRegister(0x14) == 2) - { - K056832SetLayerOffsets(0, 2, 0); - K056832SetLayerOffsets(1, 4, 0); - K056832SetLayerOffsets(2, 6, 0); - K056832SetLayerOffsets(3, 8, 0); - } - else - { - K056832SetLayerOffsets(0, 0, 0); - K056832SetLayerOffsets(1, 8, 0); - K056832SetLayerOffsets(2, 14, 0); - K056832SetLayerOffsets(3, 16, 0); - } - - KonamiClearBitmaps(0); - - layers[0] = 0; - layerpri[0] = 0; // not sure - layers[1] = 1; - layerpri[1] = K053251GetPriority(2); - layers[2] = 2; - layerpri[2] = K053251GetPriority(3); - layers[3] = 3; - layerpri[3] = K053251GetPriority(4); - - konami_sortlayers4(layers, layerpri); - - if (nBurnLayer & 1) K056832Draw(layers[0], K056832_DRAW_FLAG_MIRROR, 1); - if (nBurnLayer & 2) K056832Draw(layers[1], K056832_DRAW_FLAG_MIRROR, 2); - if (nBurnLayer & 4) K056832Draw(layers[2], K056832_DRAW_FLAG_MIRROR, 4); - if (nBurnLayer & 8) K056832Draw(layers[3], K056832_DRAW_FLAG_MIRROR, 8); - - if (nSpriteEnable & 1) K053247SpritesRender(); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 4 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - DrvInputs[0] = (DrvInputs[0] & 0xf7ff) | ((DrvDips[0] & 0x08) << 8); - DrvInputs[2] = (DrvInputs[2] & 0x7f7f) | (DrvDips[1] & 0x80) | ((DrvDips[2] & 0x80) << 8); - DrvInputs[3] = (DrvInputs[3] & 0xff7f) | (DrvDips[3] & 0x80); - DrvInputs[0] &= 0x0fff; - DrvInputs[1] &= 0x0fff; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 16000000 / 60, 8000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = SekRun(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - if (control_data & 0x20 && irq6_timer == 0) { - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - irq6_timer = -1; - } else if (irq6_timer != -1) irq6_timer--; - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - if ((i % (nInterleave / 8)) == ((nInterleave / 8) - 1) && sound_nmi_enable) { - ZetNmi(); - } - - if (i == 240) { - if (K056832IsIrqEnabled()) { - if (K053246_is_IRQ_enabled()) { - gijoe_objdma(); - irq6_timer = 1; // guess - } - - if (control_data & 0x80) { - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - } - } - } - } - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * 2); - K054539Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029732; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - K054539Scan(nAction); - - KonamiICScan(nAction); - - SCAN_VAR(avac_vrc); - SCAN_VAR(avac_bits); - SCAN_VAR(avac_occupancy); - SCAN_VAR(sound_nmi_enable); - SCAN_VAR(control_data); - SCAN_VAR(irq6_timer); - - SCAN_VAR(layerpri); - SCAN_VAR(layer_colorbase); - SCAN_VAR(sprite_colorbase); - } - - return 0; -} - - -// G.I. Joe (World, EAB, set 1) - -static struct BurnRomInfo gijoeRomDesc[] = { - { "069eab03.14e", 0x040000, 0xdd2d533f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "069eab02.18e", 0x040000, 0x6bb11c87, 1 | BRF_PRG | BRF_ESS }, // 1 - { "069a12.13e", 0x040000, 0x75a7585c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "069a11.16e", 0x040000, 0x3153e788, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "069a01.7c", 0x010000, 0x74172b99, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "069a10.18j", 0x100000, 0x4c6743ee, 3 | BRF_GRA }, // 5 K056832 Characters - { "069a09.16j", 0x100000, 0xe6e36b05, 3 | BRF_GRA }, // 6 - - { "069a08.6h", 0x100000, 0x325477d4, 4 | BRF_GRA }, // 7 K053247 Sprites - { "069a05.1h", 0x100000, 0xc4ab07ed, 4 | BRF_GRA }, // 8 - { "069a07.4h", 0x100000, 0xccaa3971, 4 | BRF_GRA }, // 9 - { "069a06.2h", 0x100000, 0x63eba8e1, 4 | BRF_GRA }, // 10 - - { "069a04.1e", 0x200000, 0x11d6dcd6, 5 | BRF_SND }, // 11 k054539 - - { "er5911.7d", 0x000080, 0xa0d50a79, 6 | BRF_OPT }, // 12 eeprom data -}; - -STD_ROM_PICK(gijoe) -STD_ROM_FN(gijoe) - -struct BurnDriver BurnDrvGijoe = { - "gijoe", NULL, NULL, NULL, "1992", - "G.I. Joe (World, EAB, set 1)\0", NULL, "Konami", "GX069", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, gijoeRomInfo, gijoeRomName, NULL, NULL, GijoeInputInfo, GijoeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// G.I. Joe (World, EB8, prototype?) - -static struct BurnRomInfo gijoeaRomDesc[] = { - { "rom3.14e", 0x040000, 0x0a11f63a, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "rom2.18e", 0x040000, 0x8313c559, 1 | BRF_PRG | BRF_ESS }, // 1 - { "069a12.13e", 0x040000, 0x75a7585c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "069a11.16e", 0x040000, 0x3153e788, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "069a01.7c", 0x010000, 0x74172b99, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "069a10.18j", 0x100000, 0x4c6743ee, 3 | BRF_GRA }, // 5 K056832 Characters - { "069a09.16j", 0x100000, 0xe6e36b05, 3 | BRF_GRA }, // 6 - - { "069a08.6h", 0x100000, 0x325477d4, 4 | BRF_GRA }, // 7 K053247 Sprites - { "069a05.1h", 0x100000, 0xc4ab07ed, 4 | BRF_GRA }, // 8 - { "069a07.4h", 0x100000, 0xccaa3971, 4 | BRF_GRA }, // 9 - { "069a06.2h", 0x100000, 0x63eba8e1, 4 | BRF_GRA }, // 10 - - { "069a04.1e", 0x200000, 0x11d6dcd6, 5 | BRF_SND }, // 11 k054539 - - { "er5911.7d", 0x000080, 0x64f5c87b, 6 | BRF_OPT }, // 12 eeprom data -}; - -STD_ROM_PICK(gijoea) -STD_ROM_FN(gijoea) - -struct BurnDriver BurnDrvGijoea = { - "gijoea", "gijoe", NULL, NULL, "1992", - "G.I. Joe (World, EB8, prototype?)\0", NULL, "Konami", "GX069", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gijoeaRomInfo, gijoeaRomName, NULL, NULL, GijoeInputInfo, GijoeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// G.I. Joe (US, UAB) - -static struct BurnRomInfo gijoeuRomDesc[] = { - { "069uab03.14e", 0x040000, 0x25ff77d2, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "069uab02.18e", 0x040000, 0x31cced1c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "069a12.13e", 0x040000, 0x75a7585c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "069a11.16e", 0x040000, 0x3153e788, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "069a01.7c", 0x010000, 0x74172b99, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "069a10.18j", 0x100000, 0x4c6743ee, 3 | BRF_GRA }, // 5 K056832 Characters - { "069a09.16j", 0x100000, 0xe6e36b05, 3 | BRF_GRA }, // 6 - - { "069a08.6h", 0x100000, 0x325477d4, 4 | BRF_GRA }, // 7 K053247 Sprites - { "069a05.1h", 0x100000, 0xc4ab07ed, 4 | BRF_GRA }, // 8 - { "069a07.4h", 0x100000, 0xccaa3971, 4 | BRF_GRA }, // 9 - { "069a06.2h", 0x100000, 0x63eba8e1, 4 | BRF_GRA }, // 10 - - { "069a04.1e", 0x200000, 0x11d6dcd6, 5 | BRF_SND }, // 11 k054539 - - { "er5911.7d", 0x000080, 0xca966023, 6 | BRF_OPT }, // 12 eeprom data -}; - -STD_ROM_PICK(gijoeu) -STD_ROM_FN(gijoeu) - -struct BurnDriver BurnDrvGijoeu = { - "gijoeu", "gijoe", NULL, NULL, "1992", - "G.I. Joe (US, UAB)\0", NULL, "Konami", "GX069", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gijoeuRomInfo, gijoeuRomName, NULL, NULL, GijoeInputInfo, GijoeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// G.I. Joe (Japan, JAA) - -static struct BurnRomInfo gijoejRomDesc[] = { - { "069jaa03.14e", 0x040000, 0x4b398901, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "069jaa02.18e", 0x040000, 0x8bb22392, 1 | BRF_PRG | BRF_ESS }, // 1 - { "069a12.13e", 0x040000, 0x75a7585c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "069a11.16e", 0x040000, 0x3153e788, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "069a01.7c", 0x010000, 0x74172b99, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "069a10.18j", 0x100000, 0x4c6743ee, 3 | BRF_GRA }, // 5 K056832 Characters - { "069a09.16j", 0x100000, 0xe6e36b05, 3 | BRF_GRA }, // 6 - - { "069a08.6h", 0x100000, 0x325477d4, 4 | BRF_GRA }, // 7 K053247 Sprites - { "069a05.1h", 0x100000, 0xc4ab07ed, 4 | BRF_GRA }, // 8 - { "069a07.4h", 0x100000, 0xccaa3971, 4 | BRF_GRA }, // 9 - { "069a06.2h", 0x100000, 0x63eba8e1, 4 | BRF_GRA }, // 10 - - { "069a04.1e", 0x200000, 0x11d6dcd6, 5 | BRF_SND }, // 11 k054539 - - { "er5911.7d", 0x000080, 0xc914fcf2, 6 | BRF_OPT }, // 12 eeprom data -}; - -STD_ROM_PICK(gijoej) -STD_ROM_FN(gijoej) - -struct BurnDriver BurnDrvGijoej = { - "gijoej", "gijoe", NULL, NULL, "1992", - "G.I. Joe (Japan, JAA)\0", NULL, "Konami", "GX069", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gijoejRomInfo, gijoejRomName, NULL, NULL, GijoeInputInfo, GijoeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_gradius3.cpp b/jan/src/burn/drv/konami/d_gradius3.cpp deleted file mode 100644 index 993618157..000000000 --- a/jan/src/burn/drv/konami/d_gradius3.cpp +++ /dev/null @@ -1,1161 +0,0 @@ -// FB Alpha Gradius 3 driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k007232.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM0; -static UINT8 *Drv68KROM1; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvShareRAM; -static UINT8 *DrvShareRAM2; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; - -static INT32 gradius3_priority; -static INT32 gradius3_cpub_enable; -static INT32 irqA_enable; -static INT32 irqB_mask; - -static INT32 interrupt_triggered = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT16 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo Gradius3InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Gradius3) - -static struct BurnDIPInfo Gradius3DIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x5a, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x15, 0x01, 0x04, 0x00, "Upright" }, -// {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "20000 and every 70000" }, - {0x15, 0x01, 0x18, 0x10, "100000 and every 100000" }, - {0x15, 0x01, 0x18, 0x08, "50000" }, - {0x15, 0x01, 0x18, 0x00, "100000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x01, 0x01, "Off" }, -// {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Gradius3) - -static void expand_graphics_single(INT32 offset) -{ - offset &= 0x1fffe; - - INT32 t = DrvShareRAM2[offset+0]; - - DrvGfxROMExp0[offset * 2 + 2] = t >> 4; - DrvGfxROMExp0[offset * 2 + 3] = t & 0x0f; - - t = DrvShareRAM2[offset+1]; - - DrvGfxROMExp0[offset * 2 + 0] = t >> 4; - DrvGfxROMExp0[offset * 2 + 1] = t & 0x0f; -} - -static void __fastcall gradius3_main_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0x14c000 && address <= 0x153fff) { - address -= 0x14c000; - K052109Write(address / 2, data); - return; - } - - if ((address & 0xfe0000) == 0x180000) { - *((UINT16*)(DrvShareRAM2 + (address & 0x1fffe))) = data; - expand_graphics_single(address); - return; - } -} - -static void __fastcall gradius3_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfe0000) == 0x180000) { - DrvShareRAM2[(address & 0x1ffff)^1] = data; - expand_graphics_single(address); - return; - } - - switch (address) - { - case 0x0c0000: - case 0x0c0001: - { - // if enabling CPU B, burn off some cycles to keep things sync'd. - if (gradius3_cpub_enable & 8 && ~data & 8) { - INT32 cycles_to_burn = SekTotalCycles(); - SekClose(); - SekOpen(1); - SekIdle(cycles_to_burn - SekTotalCycles()); - SekClose(); - SekOpen(0); - } - - gradius3_priority =(data & 0x04)>>2; - gradius3_cpub_enable = data & 0x08; - irqA_enable = data & 0x20; - } - return; - - case 0x0d8000: - case 0x0d8001: - interrupt_triggered = irqB_mask & 0x04; - return; - - case 0x0e0000: - case 0x0e0001: - // watchdog - return; - - case 0x0e8000: - *soundlatch = data; - return; - - case 0x0f0000: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - - return; - } - - if (address >= 0x14c000 && address <= 0x153fff) { - address -= 0x14c000; - K052109Write(address / 2, data); - return; - } -} - -static UINT16 __fastcall gradius3_main_read_word(UINT32 address) -{ - if (address >= 0x14c000 && address <= 0x153fff) { - address -= 0x14c000; - return K052109Read(address / 2); - } - - return 0; -} - -static UINT8 __fastcall gradius3_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0c8000: - case 0x0c8001: - return DrvInputs[0]; - - case 0x0c8002: - case 0x0c8003: - return DrvInputs[1]; - - case 0x0c8004: - case 0x0c8005: - return DrvInputs[2]; - - case 0x0c8006: - case 0x0c8007: - return DrvDips[2]; - - case 0x0d0000: - case 0x0d0001: - return DrvDips[0]; - - case 0x0d0002: - case 0x0d0003: - return DrvDips[1]; - } - - if (address >= 0x14c000 && address <= 0x153fff) { - address -= 0x14c000; - return K052109Read(address / 2); - } - - return 0; -} - -static void __fastcall gradius3_sub_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffffe) == 0x140000) { - irqB_mask = (data >> 8) & 0x07; - return; - } - - if (address >= 0x24c000 && address <= 0x253fff) { - address -= 0x24c000; - K052109Write(address / 2, data); - return; - } - - if ((address & 0xfe0000) == 0x280000) { - *((UINT16*)(DrvShareRAM2 + (address & 0x1fffe))) = data; - expand_graphics_single(address); - return; - } - - if ((address & 0xffffff0) == 0x2c0000) { - address -= 0x2c0000; - K051937Write(address / 2, data); - return; - } - - if ((address & 0xffff800) == 0x2c0800) { - address -= 0x2c0800; - K051960Write(address /2, data); - return; - } -} - -static void __fastcall gradius3_sub_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffffe) == 0x140000) { - irqB_mask = data & 0x07; - return; - } - - if (address >= 0x24c000 && address <= 0x253fff) { - address -= 0x24c000; - K052109Write(address / 2, data); - return; - } - - if ((address & 0xfe0000) == 0x280000) { - DrvShareRAM2[(address & 0x1ffff)^1] = data; - expand_graphics_single(address); - return; - } - - if ((address & 0xffffff0) == 0x2c0000) { - address -= 0x2c0000; - K051937Write(address / 2, data); - return; - } - - if ((address & 0xffff800) == 0x2c0800) { - address -= 0x2c0800; - K051960Write(address /2, data); - return; - } -} - -static UINT16 __fastcall gradius3_sub_read_word(UINT32 address) -{ - if (address >= 0x24c000 && address <= 0x253fff) { - address -= 0x24c000; - return K052109Read(address / 2); - } - - if ((address & 0xffffff0) == 0x2c0000) { - address -= 0x2c0000; - return K051937Read(address / 2); - } - - if ((address & 0xffff800) == 0x2c0800) { - address -= 0x2c0800; - return K051960Read(address / 2); - } - - return 0; -} - -static UINT8 __fastcall gradius3_sub_read_byte(UINT32 address) -{ - if (address >= 0x24c000 && address <= 0x253fff) { - address -= 0x24c000; - return K052109Read(address / 2); - } - - if ((address & 0xffffff0) == 0x2c0000) { - address -= 0x2c0000; - return K051937Read(address / 2); - } - - if ((address & 0xffff800) == 0x2c0800) { - address -= 0x2c0800; - return K051960Read(address / 2); - } - - return 0; -} - -static void k007232_bank(INT32 , INT32 data) -{ - INT32 bank_A = (data >> 0) & 0x03; - INT32 bank_B = (data >> 2) & 0x03; - - k007232_set_bank(0, bank_A, bank_B); -} - -static void __fastcall gradius3_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xf020) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - switch (address) - { - case 0xf000: - k007232_bank(0, data); - return; - - case 0xf030: - BurnYM2151SelectRegister(data); - return; - - case 0xf031: - BurnYM2151WriteRegister(data); - return; - } -} - -static UINT8 __fastcall gradius3_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xf020) { - return K007232ReadReg(0, address & 0x0f); - } - - switch (address) - { - case 0xf010: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xf031: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolumeF(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolumeF(0, 1, 0, (v & 0x0f) * 0x11); -} - -static void K052109Callback(INT32 layer, INT32, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - INT32 layer_colorbase[3] = { 0, 32, 48 }; - - *code |= ((*color & 0x01) << 8) | ((*color & 0x1c) << 7); - *code &= 0xfff; - *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5); -} - -static void K051960Callback(INT32 *code, INT32 *color, INT32 *priority, INT32 *) -{ - static INT32 primask[2][4] = { { 0xfa, 0xaa, 0xfa, 0xfe }, { 0xfc, 0xf0, 0x00, 0xfe } }; - - *priority = primask[gradius3_priority][((*color & 0x60) >> 5)]; - - *code |= (*color & 0x01) << 13; - *code &= 0x3fff; - *color = 0x10 + ((*color & 0x1e) >> 1); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - SekOpen(1); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - gradius3_priority = 0; - gradius3_cpub_enable = 0; - irqA_enable = 0; - irqB_mask = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM0 = Next; Next += 0x100000; - Drv68KROM1 = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROMExp0 = Next; Next += 0x040000; - DrvGfxROMExp1 = Next; Next += 0x400000; - - DrvSndROM = Next; Next += 0x080000; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - Drv68KRAM0 = Next; Next += 0x004000; - Drv68KRAM1 = Next; Next += 0x004000; - DrvShareRAM = Next; Next += 0x004000; - DrvShareRAM2 = Next; Next += 0x020000; - DrvPalRAM = Next; Next += 0x001000; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0x000, 0x01, 0x002, 0x003 }; - INT32 XOffs[16] = { 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4, - 32*8+2*4, 32*8+3*4, 32*8+0*4, 32*8+1*4, 32*8+6*4, 32*8+7*4, 32*8+4*4, 32*8+5*4 }; - INT32 YOffs[16] = { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, - 64*8+0*32, 64*8+1*32, 64*8+2*32, 64*8+3*32, 64*8+4*32, 64*8+5*32, 64*8+6*32, 64*8+7*32 }; - - GfxDecode(0x04000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, DrvGfxROM1, DrvGfxROMExp1); - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM0 + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(Drv68KROM1 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x040001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x040000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x080001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x080000, 7, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x0c0001, 8, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x0c0000, 9, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 10, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 11, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 12, 4, LD_GROUP(2))) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 13, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 14, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100002, 15, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100003, 16, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 17, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180001, 18, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180002, 19, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180003, 20, 4)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 21, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x040000, 22, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x060000, 23, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x040000, 0x043fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvShareRAM2, 0x180000, 0x19ffff, MAP_ROM); - SekSetWriteWordHandler(0, gradius3_main_write_word); - SekSetWriteByteHandler(0, gradius3_main_write_byte); - SekSetReadWordHandler(0, gradius3_main_read_word); - SekSetReadByteHandler(0, gradius3_main_read_byte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Drv68KROM1, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x200000, 0x203fff, MAP_RAM); - SekMapMemory(DrvShareRAM2, 0x280000, 0x29ffff, MAP_ROM); - SekMapMemory(DrvGfxROM1, 0x400000, 0x5fffff, MAP_ROM); - SekSetWriteWordHandler(0, gradius3_sub_write_word); - SekSetWriteByteHandler(0, gradius3_sub_write_byte); - SekSetReadWordHandler(0, gradius3_sub_read_word); - SekSetReadByteHandler(0, gradius3_sub_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM); - ZetSetWriteHandler(gradius3_sound_write); - ZetSetReadHandler(gradius3_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K007232Init(0, 3579545, DrvSndROM, 0x80000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - K052109Init(DrvShareRAM2, DrvGfxROMExp0, 0x1ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(-8, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0x1fffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(-8, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvbInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM0 + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(Drv68KROM1 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x040001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x040000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x080001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x080000, 7, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x0c0001, 8, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x0c0000, 9, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 12, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000002, 13, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000003, 14, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 15, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080001, 16, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080002, 17, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080003, 18, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 19, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 20, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100002, 21, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100003, 22, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 23, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180001, 24, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180002, 25, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180003, 26, 4)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 27, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x020000, 28, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x040000, 29, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x060000, 30, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x040000, 0x043fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvShareRAM2, 0x180000, 0x19ffff, MAP_ROM); - SekSetWriteWordHandler(0, gradius3_main_write_word); - SekSetWriteByteHandler(0, gradius3_main_write_byte); - SekSetReadWordHandler(0, gradius3_main_read_word); - SekSetReadByteHandler(0, gradius3_main_read_byte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Drv68KROM1, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x200000, 0x203fff, MAP_RAM); - SekMapMemory(DrvShareRAM2, 0x280000, 0x29ffff, MAP_ROM); - SekMapMemory(DrvGfxROM1, 0x400000, 0x5fffff, MAP_ROM); - SekSetWriteWordHandler(0, gradius3_sub_write_word); - SekSetWriteByteHandler(0, gradius3_sub_write_byte); - SekSetReadWordHandler(0, gradius3_sub_read_word); - SekSetReadByteHandler(0, gradius3_sub_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM); - ZetSetWriteHandler(gradius3_sound_write); - ZetSetReadHandler(gradius3_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K007232Init(0, 3579545, DrvSndROM, 0x80000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - K052109Init(DrvShareRAM2, DrvGfxROMExp0, 0x1ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(-8, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0x1fffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(-8, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - SekExit(); - ZetExit(); - - K007232Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static inline void character_ram_decode() -{ - for (INT32 i = 0; i < 0x20000; i++) { - - INT32 t = DrvShareRAM2[i ^ 1]; - - DrvGfxROMExp0[i * 2 + 0] = t >> 4; - DrvGfxROMExp0[i * 2 + 1] = t & 0x0f; - } -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x1000 / 2; i++) { - r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 10) & 0x1f; - g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 5) & 0x1f; - b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = (r<<16)+(g<<8)+b; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - K052109Write(0x1d80,0x10); - K052109Write(0x1f00,0x32); - - K052109UpdateScroll(); - - if (gradius3_priority == 0) - { - if (nSpriteEnable & 1) K052109RenderLayer(1, K052109_OPAQUE, 2); - if (nSpriteEnable & 2) K052109RenderLayer(2, 0, 4); - if (nSpriteEnable & 4) K052109RenderLayer(0, 0, 1); - } - else - { - if (nSpriteEnable & 1) K052109RenderLayer(0, K052109_OPAQUE, 1); - if (nSpriteEnable & 2) K052109RenderLayer(1, 0, 2); - if (nSpriteEnable & 4) K052109RenderLayer(2, 0, 4); - } - - if (nBurnLayer & 8) K051960SpritesRender(-1, -1); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3 * sizeof(INT16)); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - } - - SekNewFrame(); - - INT32 nCycleSegment; - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 10000000 / 60, 10000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekOpen(0); - nCycleSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - nCyclesDone[0] += SekRun(nCycleSegment - nCyclesDone[0]); - if (i == 240 && irqA_enable) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (gradius3_cpub_enable) { - SekOpen(1); - nCycleSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - nCyclesDone[1] += SekRun(nCycleSegment - SekTotalCycles()); - if (interrupt_triggered) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 240 && (irqB_mask & 1)) - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - if (i == 16 && (irqB_mask & 2)) - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - nCycleSegment = (nCyclesTotal[2] / nInterleave) * (i + 1); - nCyclesDone[2] += ZetRun(nCycleSegment - nCyclesDone[2]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - interrupt_triggered = 0; - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - K007232Update(0, pBurnSoundOut, nBurnSoundLen); // only update K007232 once per frame - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - - SCAN_VAR(gradius3_priority); - SCAN_VAR(gradius3_cpub_enable); - SCAN_VAR(irqA_enable); - SCAN_VAR(irqB_mask); - } - - if (nAction & ACB_WRITE) { - character_ram_decode(); - } - - return 0; -} - - -// Gradius III (World, program code R) - -static struct BurnRomInfo grdius3RomDesc[] = { - { "945_r13.f15", 0x20000, 0xcffd103f, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "945_r12.e15", 0x20000, 0x0b968ef6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "945_m09.r17", 0x20000, 0xb4a6df25, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "945_m08.n17", 0x20000, 0x74e981d2, 2 | BRF_PRG | BRF_ESS }, // 3 - { "945_l06b.r11", 0x20000, 0x83772304, 2 | BRF_PRG | BRF_ESS }, // 4 - { "945_l06a.n11", 0x20000, 0xe1fd75b6, 2 | BRF_PRG | BRF_ESS }, // 5 - { "945_l07c.r15", 0x20000, 0xc1e399b6, 2 | BRF_PRG | BRF_ESS }, // 6 - { "945_l07a.n15", 0x20000, 0x96222d04, 2 | BRF_PRG | BRF_ESS }, // 7 - { "945_l07d.r13", 0x20000, 0x4c16d4bd, 2 | BRF_PRG | BRF_ESS }, // 8 - { "945_l07b.n13", 0x20000, 0x5e209d01, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "945_r05.d9", 0x10000, 0xc8c45365, 3 | BRF_PRG | BRF_ESS }, // 10 Z80 Code - - { "945_a02.l3", 0x80000, 0x4dfffd74, 4 | BRF_GRA }, // 11 Sprites - { "945_a01.h3", 0x80000, 0x339d6dd2, 4 | BRF_GRA }, // 12 - { "945_l04a.k6", 0x20000, 0x884e21ee, 4 | BRF_GRA }, // 13 - { "945_l04c.m6", 0x20000, 0x45bcd921, 4 | BRF_GRA }, // 14 - { "945_l03a.e6", 0x20000, 0xa67ef087, 4 | BRF_GRA }, // 15 - { "945_l03c.h6", 0x20000, 0xa56be17a, 4 | BRF_GRA }, // 16 - { "945_l04b.k8", 0x20000, 0x843bc67d, 4 | BRF_GRA }, // 17 - { "945_l04d.m8", 0x20000, 0x0a98d08e, 4 | BRF_GRA }, // 18 - { "945_l03b.e8", 0x20000, 0x933e68b9, 4 | BRF_GRA }, // 19 - { "945_l03d.h8", 0x20000, 0xf375e87b, 4 | BRF_GRA }, // 20 - - { "945_a10.b15", 0x40000, 0x1d083e10, 5 | BRF_SND }, // 21 K007232 - { "945_l11a.c18", 0x20000, 0x6043f4eb, 5 | BRF_SND }, // 22 - { "945_l11b.c20", 0x20000, 0x89ea3baf, 5 | BRF_SND }, // 23 - - { "945l14.j28", 0x00100, 0xc778c189, 6 | BRF_OPT }, // 24 Prom -}; - -STD_ROM_PICK(grdius3) -STD_ROM_FN(grdius3) - -struct BurnDriver BurnDrvGrdius3 = { - "gradius3", NULL, NULL, NULL, "1989", - "Gradius III (World, program code R)\0", NULL, "Konami", "GX945", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, grdius3RomInfo, grdius3RomName, NULL, NULL, Gradius3InputInfo, Gradius3DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; - - -// Gradius III (Japan, program code S) - -static struct BurnRomInfo gradius3jRomDesc[] = { - { "945_s13.f15", 0x20000, 0x70c240a2, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "945_s12.e15", 0x20000, 0xbbc300d4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "945_m09.r17", 0x20000, 0xb4a6df25, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "945_m08.n17", 0x20000, 0x74e981d2, 2 | BRF_PRG | BRF_ESS }, // 3 - { "945_l06b.r11", 0x20000, 0x83772304, 2 | BRF_PRG | BRF_ESS }, // 4 - { "945_l06a.n11", 0x20000, 0xe1fd75b6, 2 | BRF_PRG | BRF_ESS }, // 5 - { "945_l07c.r15", 0x20000, 0xc1e399b6, 2 | BRF_PRG | BRF_ESS }, // 6 - { "945_l07a.n15", 0x20000, 0x96222d04, 2 | BRF_PRG | BRF_ESS }, // 7 - { "945_l07d.r13", 0x20000, 0x4c16d4bd, 2 | BRF_PRG | BRF_ESS }, // 8 - { "945_l07b.n13", 0x20000, 0x5e209d01, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "945_m05.d9", 0x10000, 0xc8c45365, 3 | BRF_PRG | BRF_ESS }, // 10 Z80 Code - - { "945_a02.l3", 0x80000, 0x4dfffd74, 4 | BRF_GRA }, // 11 Sprites - { "945_a01.h3", 0x80000, 0x339d6dd2, 4 | BRF_GRA }, // 12 - { "945_l04a.k6", 0x20000, 0x884e21ee, 4 | BRF_GRA }, // 13 - { "945_l04c.m6", 0x20000, 0x45bcd921, 4 | BRF_GRA }, // 14 - { "945_l03a.e6", 0x20000, 0xa67ef087, 4 | BRF_GRA }, // 15 - { "945_l03c.h6", 0x20000, 0xa56be17a, 4 | BRF_GRA }, // 16 - { "945_l04b.k8", 0x20000, 0x843bc67d, 4 | BRF_GRA }, // 17 - { "945_l04d.m8", 0x20000, 0x0a98d08e, 4 | BRF_GRA }, // 18 - { "945_l03b.e8", 0x20000, 0x933e68b9, 4 | BRF_GRA }, // 19 - { "945_l03d.h8", 0x20000, 0xf375e87b, 4 | BRF_GRA }, // 20 - - { "945_a10.b15", 0x40000, 0x1d083e10, 5 | BRF_SND }, // 21 K007232 - { "945_l11a.c18", 0x20000, 0x6043f4eb, 5 | BRF_SND }, // 22 - { "945_l11b.c20", 0x20000, 0x89ea3baf, 5 | BRF_SND }, // 23 - - { "945l14.j28", 0x00100, 0xc778c189, 6 | BRF_OPT }, // 24 Prom -}; - -STD_ROM_PICK(gradius3j) -STD_ROM_FN(gradius3j) - -struct BurnDriver BurnDrvGradius3j = { - "gradius3j", "gradius3", NULL, NULL, "1989", - "Gradius III (Japan, program code S)\0", NULL, "Konami", "GX945", - L"Gradius III \u4F1D\u8AAC\u304B\u3089\u795E\u8A71\u3078 (Japan, program code S)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, gradius3jRomInfo, gradius3jRomName, NULL, NULL, Gradius3InputInfo, Gradius3DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; - - -// Gradius III (Japan, program code S, split) -// same as normal gradius3j set in content but with some ROMs split and populated differently. - -static struct BurnRomInfo gradius3jsRomDesc[] = { - { "945_s13.f15", 0x20000, 0x70c240a2, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "945_s12.e15", 0x20000, 0xbbc300d4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "945_m09.r17", 0x20000, 0xb4a6df25, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "945_m08.n17", 0x20000, 0x74e981d2, 2 | BRF_PRG | BRF_ESS }, // 3 - { "945_l06b.r11", 0x20000, 0x83772304, 2 | BRF_PRG | BRF_ESS }, // 4 - { "945_l06a.n11", 0x20000, 0xe1fd75b6, 2 | BRF_PRG | BRF_ESS }, // 5 - { "945_l07c.r15", 0x20000, 0xc1e399b6, 2 | BRF_PRG | BRF_ESS }, // 6 - { "945_l07a.n15", 0x20000, 0x96222d04, 2 | BRF_PRG | BRF_ESS }, // 7 - { "945_l07d.r13", 0x20000, 0x4c16d4bd, 2 | BRF_PRG | BRF_ESS }, // 8 - { "945_l07b.n13", 0x20000, 0x5e209d01, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "945_m05.d9", 0x10000, 0xc8c45365, 3 | BRF_PRG | BRF_ESS }, // 10 Z80 Code - - { "945_A02A.K2", 0x20000, 0xfbb81511, 4 | BRF_GRA }, // 11 Sprites - { "945_A02C.M2", 0x20000, 0x031b55e8, 4 | BRF_GRA }, // 12 - { "945_A01A.E2", 0x20000, 0xbace5abb, 4 | BRF_GRA }, // 13 - { "945_A01C.H2", 0x20000, 0xd91b29a6, 4 | BRF_GRA }, // 14 - { "945_A02B.K4", 0x20000, 0xc0fed4ab, 4 | BRF_GRA }, // 15 - { "945_A02D.M4", 0x20000, 0xd462817c, 4 | BRF_GRA }, // 16 - { "945_A01B.E4", 0x20000, 0xb426090e, 4 | BRF_GRA }, // 17 - { "945_A01D.H4", 0x20000, 0x3990c09a, 4 | BRF_GRA }, // 18 - { "945_l04a.k6", 0x20000, 0x884e21ee, 4 | BRF_GRA }, // 19 - { "945_l04c.m6", 0x20000, 0x45bcd921, 4 | BRF_GRA }, // 20 - { "945_l03a.e6", 0x20000, 0xa67ef087, 4 | BRF_GRA }, // 21 - { "945_l03c.h6", 0x20000, 0xa56be17a, 4 | BRF_GRA }, // 22 - { "945_l04b.k8", 0x20000, 0x843bc67d, 4 | BRF_GRA }, // 23 - { "945_l04d.m8", 0x20000, 0x0a98d08e, 4 | BRF_GRA }, // 24 - { "945_l03b.e8", 0x20000, 0x933e68b9, 4 | BRF_GRA }, // 25 - { "945_l03d.h8", 0x20000, 0xf375e87b, 4 | BRF_GRA }, // 26 - - { "945_A10A.C14", 0x20000, 0xec717414, 5 | BRF_SND }, // 27 K007232 - { "945_A10B.C16", 0x20000, 0x709e30e4, 5 | BRF_SND }, // 28 - { "945_l11a.c18", 0x20000, 0x6043f4eb, 5 | BRF_SND }, // 29 - { "945_l11b.c20", 0x20000, 0x89ea3baf, 5 | BRF_SND }, // 30 - - { "945l14.j28", 0x00100, 0xc778c189, 6 | BRF_OPT }, // 31 Prom -}; - -STD_ROM_PICK(gradius3js) -STD_ROM_FN(gradius3js) - -struct BurnDriver BurnDrvGradius3js = { - "gradius3js", "gradius3", NULL, NULL, "1989", - "Gradius III (Japan, program code S, split)\0", NULL, "Konami", "GX945", - L"Gradius III \u4F1D\u8AAC\u304B\u3089\u795E\u8A71\u3078 (Japan, program code S, split)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, gradius3jsRomInfo, gradius3jsRomName, NULL, NULL, Gradius3InputInfo, Gradius3DIPInfo, - DrvbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; - - -// Gradius III (Asia) - -static struct BurnRomInfo grdius3aRomDesc[] = { - { "945_13.f15", 0x20000, 0x9974fe6b, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "945_12.e15", 0x20000, 0xe9771b91, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "945_m09.r17", 0x20000, 0xb4a6df25, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "945_m08.n17", 0x20000, 0x74e981d2, 2 | BRF_PRG | BRF_ESS }, // 3 - { "945_l06b.r11", 0x20000, 0x83772304, 2 | BRF_PRG | BRF_ESS }, // 4 - { "945_l06a.n11", 0x20000, 0xe1fd75b6, 2 | BRF_PRG | BRF_ESS }, // 5 - { "945_l07c.r15", 0x20000, 0xc1e399b6, 2 | BRF_PRG | BRF_ESS }, // 6 - { "945_l07a.n15", 0x20000, 0x96222d04, 2 | BRF_PRG | BRF_ESS }, // 7 - { "945_l07d.r13", 0x20000, 0x4c16d4bd, 2 | BRF_PRG | BRF_ESS }, // 8 - { "945_l07b.n13", 0x20000, 0x5e209d01, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "945_m05.d9", 0x10000, 0xc8c45365, 3 | BRF_PRG | BRF_ESS }, // 10 Z80 Code - - { "945_a02.l3", 0x80000, 0x4dfffd74, 4 | BRF_GRA }, // 11 Sprites - { "945_a01.h3", 0x80000, 0x339d6dd2, 4 | BRF_GRA }, // 12 - { "945_l04a.k6", 0x20000, 0x884e21ee, 4 | BRF_GRA }, // 13 - { "945_l04c.m6", 0x20000, 0x45bcd921, 4 | BRF_GRA }, // 14 - { "945_l03a.e6", 0x20000, 0xa67ef087, 4 | BRF_GRA }, // 15 - { "945_l03c.h6", 0x20000, 0xa56be17a, 4 | BRF_GRA }, // 16 - { "945_l04b.k8", 0x20000, 0x843bc67d, 4 | BRF_GRA }, // 17 - { "945_l04d.m8", 0x20000, 0x0a98d08e, 4 | BRF_GRA }, // 18 - { "945_l03b.e8", 0x20000, 0x933e68b9, 4 | BRF_GRA }, // 19 - { "945_l03d.h8", 0x20000, 0xf375e87b, 4 | BRF_GRA }, // 20 - - { "945_a10.b15", 0x40000, 0x1d083e10, 5 | BRF_SND }, // 21 K007232 - { "945_l11a.c18", 0x20000, 0x6043f4eb, 5 | BRF_SND }, // 22 - { "945_l11b.c20", 0x20000, 0x89ea3baf, 5 | BRF_SND }, // 23 - - { "945l14.j28", 0x00100, 0xc778c189, 6 | BRF_OPT }, // 24 Prom -}; - -STD_ROM_PICK(grdius3a) -STD_ROM_FN(grdius3a) - -struct BurnDriver BurnDrvGrdius3a = { - "gradius3a", "gradius3", NULL, NULL, "1989", - "Gradius III (Asia)\0", NULL, "Konami", "GX945", - L"Gradius III \u4F1D\u8AAC\u304B\u3089\u795E\u8A71\u3078 (Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, grdius3aRomInfo, grdius3aRomName, NULL, NULL, Gradius3InputInfo, Gradius3DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_gyruss.cpp b/jan/src/burn/drv/konami/d_gyruss.cpp deleted file mode 100644 index bacc2ed00..000000000 --- a/jan/src/burn/drv/konami/d_gyruss.cpp +++ /dev/null @@ -1,1229 +0,0 @@ -// FB Alpha Gyruss driver module -// Based on MAME driver by Mirko Buffoni, Michael Cuddy, and Nicola Salmoria -// -// Massive overhaul by dink on Feb. 9, 2015 - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "i8039.h" -#include "driver.h" -#include "flt_rc.h" -#include "dac.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809DecROM; -static UINT8 *DrvI8039ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvShareRAM; -static UINT8 *DrvM6809RAM; -static UINT32 *DrvPalette; -static UINT32 *Palette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[15]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; -static UINT8 *flipscreen; -static UINT8 *interrupt_enable0; -static UINT8 *interrupt_enable1; - -static INT32 scanline; - -static struct BurnInputInfo GyrussInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Gyruss) - -static struct BurnDIPInfo GyrussDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x3b, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits " }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits " }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits " }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits " }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits " }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits " }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits " }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits " }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits " }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits " }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits " }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits " }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits " }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits " }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits " }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits " }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits " }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits " }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits " }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits " }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits " }, - {0x10, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - {0x11, 0x01, 0x03, 0x00, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x00, "Upright" }, - {0x11, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x08, 0x08, "30k 90k 60k+" }, - {0x11, 0x01, 0x08, 0x00, "40k 110k 70k+" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x11, 0x01, 0x70, 0x70, "1 (Easiest)" }, - {0x11, 0x01, 0x70, 0x60, "2" }, - {0x11, 0x01, 0x70, 0x50, "3" }, - {0x11, 0x01, 0x70, 0x40, "4" }, - {0x11, 0x01, 0x70, 0x30, "5 (Average)" }, - {0x11, 0x01, 0x70, 0x20, "6" }, - {0x11, 0x01, 0x70, 0x10, "7" }, - {0x11, 0x01, 0x70, 0x00, "8 (Hardest)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Music" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, -}; - -STDDIPINFO(Gyruss) - -static struct BurnDIPInfo GyrussceDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x3b, NULL }, - {0x12, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits " }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits " }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits " }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits " }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits " }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits " }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits " }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits " }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits " }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits " }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits " }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits " }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits " }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits " }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits " }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits " }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits " }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits " }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits " }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits " }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits " }, - {0x10, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - {0x11, 0x01, 0x03, 0x00, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x00, "Upright" }, - {0x11, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 0, "Bonus Life" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x08, 0x08, "50k 120k 70k+" }, - {0x11, 0x01, 0x08, 0x00, "60k 140k 80k+" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x11, 0x01, 0x70, 0x70, "1 (Easiest)" }, - {0x11, 0x01, 0x70, 0x60, "2" }, - {0x11, 0x01, 0x70, 0x50, "3" }, - {0x11, 0x01, 0x70, 0x40, "4" }, - {0x11, 0x01, 0x70, 0x30, "5 (Average)" }, - {0x11, 0x01, 0x70, 0x20, "6" }, - {0x11, 0x01, 0x70, 0x10, "7" }, - {0x11, 0x01, 0x70, 0x00, "8 (Hardest)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Music" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, -}; - -STDDIPINFO(Gyrussce) - -static void __fastcall gyruss_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: // watchdog - return; - - case 0xc080: - ZetClose(); - ZetOpen(1); - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0xc100: - *soundlatch = data; - return; - - case 0xc180: - *interrupt_enable0 = data & 1; - if (!*interrupt_enable0) { - ZetSetIRQLine(Z80_INPUT_LINE_NMI, CPU_IRQSTATUS_NONE); - } - return; - - case 0xc185: - *flipscreen = data & 1; - return; - } -} - -static UINT8 __fastcall gyruss_main_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return DrvDips[1]; - - case 0xc080: - return DrvInputs[0]; - - case 0xc0a0: - return DrvInputs[1]; - - case 0xc0c0: - return DrvInputs[2]; - - case 0xc0e0: - return DrvDips[0]; - - case 0xc100: - return DrvDips[2]; - } - - return 0; -} - -static void gyruss_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - *interrupt_enable1 = data & 1; - if (!*interrupt_enable1) { - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - } - return; - } -} - -static UINT8 gyruss_sub_read(UINT16 address) -{ - switch (address) - { - case 0x0000: - return (scanline/* & 0x7f*/); - } - - return 0; -} - -static UINT8 __fastcall gyruss_sound0_read(UINT16 address) -{ - switch (address) - { - case 0x8000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void filter_write(INT32 num, UINT8 d) -{ - INT32 C = 0; - if (d & 2) C += 220000; /* 220000pF = 0.220uF */ - if (d & 1) C += 47000; /* 47000pF = 0.047uF */ - - filter_rc_set_RC(num, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(C)); -} - -static void AY8910_0_portBwrite(UINT32 /*port*/, UINT32 data) -{ - if (ZetGetActive() == -1) return; - - for (INT32 i = 0; i < 3; i++) - { - /* low bit: 47000pF = 0.047uF */ - /* high bit: 220000pF = 0.22uF */ - - filter_write(i, data & 3); - data >>= 2; - } -} - -static void AY8910_1_portBwrite(UINT32 /*port*/, UINT32 data) -{ - if (ZetGetActive() == -1) return; - - for (INT32 i = 0; i < 3; i++) - { - /* low bit: 47000pF = 0.047uF */ - /* high bit: 220000pF = 0.22uF */ - - filter_write(i + 3, data & 3); - data >>= 2; - } -} - -static UINT8 __fastcall gyruss_sound0_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x01: - return AY8910Read(0); - - case 0x05: - return AY8910Read(1); - - case 0x09: - return AY8910Read(2); - - case 0x0d: - return AY8910Read(3); - - case 0x11: - return AY8910Read(4); - } - - return 0; -} - -static void __fastcall gyruss_sound0_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - AY8910Write(0, 0, data); - return; - - case 0x02: - AY8910Write(0, 1, data); - return; - - case 0x04: - AY8910Write(1, 0, data); - return; - - case 0x06: - AY8910Write(1, 1, data); - return; - - case 0x08: - AY8910Write(2, 0, data); - return; - - case 0x0a: - AY8910Write(2, 1, data); - return; - - case 0x0c: - AY8910Write(3, 0, data); - return; - - case 0x0e: - AY8910Write(3, 1, data); - return; - - case 0x10: - AY8910Write(4, 0, data); - return; - - case 0x12: - AY8910Write(4, 1, data); - return; - - case 0x14: - I8039SetIrqState(1); - return; - - case 0x18: - *soundlatch2 = data; - return; - } -} - -static UINT8 AY8910_3_portA(UINT32) -{ - static const INT32 gyruss_timer[10] = - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x0a, 0x0b, 0x0a, 0x0d - }; - - return gyruss_timer[(ZetTotalCycles() / 1024) % 10]; -} - -static UINT8 __fastcall gyruss_i8039_read(UINT32 address) -{ - return DrvI8039ROM[address & 0x0fff]; -} - -static void __fastcall gyruss_i8039_write_port(UINT32 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case I8039_p1: - DACWrite(0, data); - return; - - case I8039_p2: - I8039SetIrqState(0); - return; - } -} - -static UINT8 __fastcall gyruss_i8039_read_port(UINT32 port) -{ - if ((port & 0x1ff) < 0x100) { - return *soundlatch2; - } - - return 0; -} - - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3579545.0000 / (nBurnFPS / 100.0000)))); -} - - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvM6809ROM = Next; Next += 0x010000; - DrvM6809DecROM = Next; Next += 0x010000; - - DrvI8039ROM = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000300; - - Palette = (UINT32*)Next; Next += 0x0140 * sizeof(UINT32); - DrvPalette = (UINT32*)Next; Next += 0x0140 * sizeof(UINT32); - - pAY8910Buffer[ 0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 6] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 7] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 8] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 9] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[10] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[11] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[12] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[13] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[14] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - AllRam = Next; - - flipscreen = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - - interrupt_enable0 = Next; Next += 0x000001; - interrupt_enable1 = Next; Next += 0x000001; - - DrvShareRAM = Next; Next += 0x000800; - DrvColRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000400; - - DrvM6809RAM = Next; Next += 0x000800; - - DrvSprRAM = DrvM6809RAM + 0x000040; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0x20004, 0x20000, 4, 0 }; - INT32 XOffs[8] = { STEP4(0,1), STEP4(64, 1) }; - INT32 YOffs[16] = { STEP8(0, 8), STEP8(256, 8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x8000); - - GfxDecode(0x0200, 4, 8, 16, Plane , XOffs, YOffs, 0x200, tmp , DrvGfxROM0); - GfxDecode(0x0200, 4, 8, 16, Plane , XOffs, YOffs, 0x200, tmp + 0x10, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Plane + 2, XOffs, YOffs, 0x080, tmp , DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvPaletteInit() -{ - UINT8 *color_prom = DrvColPROM; - UINT32 *tmp = (UINT32*)BurnMalloc(32 * sizeof(UINT32)); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0, bit1, bit2; - UINT8 r, g, b; - - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - r = (INT32)(double((bit0 * 33 + bit1 * 70 + bit2 * 151)+0.5)); - - bit0 = (color_prom[i] >> 3) & 0x01; - bit1 = (color_prom[i] >> 4) & 0x01; - bit2 = (color_prom[i] >> 5) & 0x01; - g = (INT32)(double((bit0 * 33 + bit1 * 70 + bit2 * 151)+0.5)); - - bit0 = (color_prom[i] >> 6) & 0x01; - bit1 = (color_prom[i] >> 7) & 0x01; - b = (INT32)(double((bit0 * 78 + bit1 * 151)+0.5)); - - tmp[i] = (r << 16) | (g << 8) | b; - } - - color_prom += 32; - - for (INT32 i = 0; i < 0x140; i++) { - UINT8 ctabentry = color_prom[i] & 0x0f; - Palette[i] = tmp[ctabentry | ((i >> 4) & 0x10)]; - } - - BurnFree (tmp); - return 0; -} - -static void gyrussDecode() -{ - for (INT32 i = 0xe000; i < 0x10000; i++) - { - UINT8 xor1 = 0; - - if ( i & 0x02) xor1 |= 0x80; - else xor1 |= 0x20; - if ( i & 0x08) xor1 |= 0x08; - else xor1 |= 0x02; - - DrvM6809DecROM[i] = DrvM6809ROM[i] ^ xor1; - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - I8039Reset(); - - DACReset(); - - AY8910Reset(0); - AY8910Reset(1); - AY8910Reset(2); - AY8910Reset(3); - AY8910Reset(4); - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x4000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM + 0xe000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x2000, 5, 1)) return 1; - - if (BurnLoadRom(DrvI8039ROM + 0x0000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x6000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 14, 1)) return 1; - - gyrussDecode(); - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvColRAM, 0x8000, 0x83ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x8400, 0x87ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0x9000, 0x9fff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xa000, 0xa7ff, MAP_RAM); - - ZetSetReadHandler(gyruss_main_read); - ZetSetWriteHandler(gyruss_main_write); - ZetClose(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x4000, 0x47ff, MAP_RAM); - M6809MapMemory(DrvShareRAM, 0x6000, 0x67ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0xe000, 0xe000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809DecROM + 0xe000, 0xe000, 0xffff, MAP_FETCH); - M6809SetReadHandler(gyruss_sub_read); - M6809SetWriteHandler(gyruss_sub_write); - M6809Close(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x6000, 0x63ff, MAP_RAM); - ZetSetReadHandler(gyruss_sound0_read); - ZetSetOutHandler(gyruss_sound0_out); - ZetSetInHandler(gyruss_sound0_in); - ZetClose(); - - I8039Init(NULL); - I8039SetProgramReadHandler(gyruss_i8039_read); - I8039SetCPUOpReadHandler(gyruss_i8039_read); - I8039SetCPUOpReadArgHandler(gyruss_i8039_read); - I8039SetIOReadHandler(gyruss_i8039_read_port); - I8039SetIOWriteHandler(gyruss_i8039_write_port); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.15, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 1789750, nBurnSoundRate, NULL, NULL, NULL, &AY8910_0_portBwrite); - AY8910Init(1, 1789750, nBurnSoundRate, NULL, NULL, NULL, &AY8910_1_portBwrite); - AY8910Init(2, 1789750, nBurnSoundRate, AY8910_3_portA, NULL, NULL, NULL); - AY8910Init(3, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(4, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(2, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(3, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(4, 0.25, BURN_SND_ROUTE_BOTH); - - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(3, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(6, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); // master out l - filter_rc_init(7, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); // master out r - - filter_rc_set_src_gain(0, 0.70); - filter_rc_set_src_gain(1, 0.60); - filter_rc_set_src_gain(2, 0.45); - filter_rc_set_src_gain(3, 0.70); - filter_rc_set_src_gain(4, 0.60); - filter_rc_set_src_gain(5, 0.45); - filter_rc_set_src_gain(6, 1.00); - filter_rc_set_src_gain(7, 1.00); - - filter_rc_set_route(0, 0.25, FLT_RC_PANNEDLEFT); - filter_rc_set_route(1, 0.25, FLT_RC_PANNEDLEFT); - filter_rc_set_route(2, 0.25, FLT_RC_PANNEDLEFT); - filter_rc_set_route(3, 0.25, FLT_RC_PANNEDRIGHT); - filter_rc_set_route(4, 0.25, FLT_RC_PANNEDRIGHT); - filter_rc_set_route(5, 0.25, FLT_RC_PANNEDRIGHT); - filter_rc_set_route(6, 0.25, BURN_SND_ROUTE_LEFT ); // master out l - filter_rc_set_route(7, 0.25, BURN_SND_ROUTE_RIGHT); // master out r - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - M6809Exit(); - - I8039Exit(); - - DACExit(); - - AY8910Exit(0); - AY8910Exit(1); - AY8910Exit(2); - AY8910Exit(3); - AY8910Exit(4); - filter_rc_exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_background(INT32 transp) -{ - for (INT32 offs = 0x40; offs < 0x3c0; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 attr = DrvColRAM[offs]; - INT32 code = ((attr & 0x20) << 3) | DrvVidRAM[offs]; - INT32 color = attr & 0x0f; - INT32 flipx = (attr >> 6) & 1; - INT32 flipy = attr >> 7; - - INT32 group = ((~DrvColRAM[offs] >> 4) & 1); - if (transp && group == 0) continue; - - if (*flipscreen) { - flipx ^= 1; - flipy ^= 1; - sx ^= 0xf8; - sy ^= 0xf8; - } - - sy -= 16; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 2, transp, 0x100, DrvGfxROM2); - } else { - Render8x8Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 2, transp, 0x100, DrvGfxROM2); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 2, transp, 0x100, DrvGfxROM2); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 2, transp, 0x100, DrvGfxROM2); - } - } - } -} - -static void draw_8x16_tile_line(INT32 sx, INT32 sy, INT32 color, UINT8 *gfx_base, INT32 code, INT32 flipx, INT32 flipy, INT32 line) -{ - line -= 16; - - if (line < 0 || line >= nScreenHeight) return; - - INT32 y = line - sy; // right? - if (y < 0 || y >= 16) return; - - if (flipy) flipy = 0x78; - - UINT8 *src = gfx_base + (code * 0x80) + ((y << 3) ^ flipy); - color <<= 4; - - if (flipx) flipx = 0x07; - - for (INT32 x = 0; x < 8; x++, sx++) - { - INT32 pxl = src[x ^ flipx]; - - if (sx < 8 || sx >= (nScreenWidth - 8) || !pxl) continue; - - pTransDraw[(line * nScreenWidth) + sx] = pxl | color; - } -} - -static void draw_sprites(INT32 line) -{ - for (INT32 offs = 0xbc; offs >= 0; offs -= 4) - { - INT32 sx = DrvSprRAM[offs]; - INT32 sy = (241 - DrvSprRAM[offs + 3]); - - if (sy <= (line-16) || sy >= (line+16)) continue; - - INT32 bank = DrvSprRAM[offs + 1] & 0x01; - INT32 code = ((DrvSprRAM[offs + 2] & 0x20) << 2) | (DrvSprRAM[offs + 1] >> 1); - INT32 color = DrvSprRAM[offs + 2] & 0x0f; - INT32 flipx = ~DrvSprRAM[offs + 2] & 0x40; - INT32 flipy = DrvSprRAM[offs + 2] & 0x80; - - UINT8 *gfx_base = bank ? DrvGfxROM1 : DrvGfxROM0; - - draw_8x16_tile_line(sx, sy-16, color, gfx_base, code, flipx, flipy, line); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x140; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - draw_background(0); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 5; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - ZetNewFrame(); - I8039NewFrame(); - - INT32 nCyclesSegment; - INT32 nInterleave = 256; - INT32 nCyclesTotal[4] = { 3072000 / 60, 2000000 / 60, 3579545 / 60, 8000000 / 15 / 60 }; - INT32 nCyclesDone[4] = { 0, 0, 0, 0 }; - INT32 nSoundBufferPos = 0; - - DrvDraw(); - memset (pBurnSoundOut,0,nBurnSoundLen*4); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nNext; - scanline = i + 6; - - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesDone[0] += ZetRun(nCyclesSegment); - if (i == (nInterleave - 248) && *interrupt_enable0) { - ZetSetIRQLine(Z80_INPUT_LINE_NMI, CPU_IRQSTATUS_ACK); - } - ZetClose(); - - M6809Open(0); - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesDone[1] += M6809Run(nCyclesSegment); - if (i == (nInterleave - 248) && *interrupt_enable1) { - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - M6809Close(); - - ZetOpen(1); - nNext = (i + 1) * nCyclesTotal[2] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[2]; - nCyclesDone[2] += ZetRun(nCyclesSegment); - - nNext = (nCyclesTotal[3] * (i + 1)) / nInterleave; - nCyclesDone[3] += I8039Run(nNext - nCyclesDone[3]); - ZetClose(); // after I8039Run() for DrvSyncDAC()! - - if (scanline >= 16 && scanline < 240) { - draw_sprites(scanline); - } - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - filter_rc_update(3, pAY8910Buffer[3], pSoundBuf, nSegmentLength); - filter_rc_update(4, pAY8910Buffer[4], pSoundBuf, nSegmentLength); - filter_rc_update(5, pAY8910Buffer[5], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[6], pSoundBuf, nSegmentLength); - filter_rc_update(7, pAY8910Buffer[7], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[8], pSoundBuf, nSegmentLength); - filter_rc_update(7, pAY8910Buffer[9], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[10], pSoundBuf, nSegmentLength); - filter_rc_update(7, pAY8910Buffer[11], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[12], pSoundBuf, nSegmentLength); - filter_rc_update(7, pAY8910Buffer[13], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[14], pSoundBuf, nSegmentLength); - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - filter_rc_update(3, pAY8910Buffer[3], pSoundBuf, nSegmentLength); - filter_rc_update(4, pAY8910Buffer[4], pSoundBuf, nSegmentLength); - filter_rc_update(5, pAY8910Buffer[5], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[6], pSoundBuf, nSegmentLength); - filter_rc_update(7, pAY8910Buffer[7], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[8], pSoundBuf, nSegmentLength); - filter_rc_update(7, pAY8910Buffer[9], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[10], pSoundBuf, nSegmentLength); - filter_rc_update(7, pAY8910Buffer[11], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[12], pSoundBuf, nSegmentLength); - filter_rc_update(7, pAY8910Buffer[13], pSoundBuf, nSegmentLength); - filter_rc_update(6, pAY8910Buffer[14], pSoundBuf, nSegmentLength); - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnTransferCopy(DrvPalette); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - M6809Scan(nAction); - I8039Scan(nAction,pnMin); - - AY8910Scan(nAction, pnMin); - DACScan(nAction, pnMin); - } - - return 0; -} - - -// Gyruss (Konami) - -static struct BurnRomInfo gyrussRomDesc[] = { - { "gyrussk.1", 0x2000, 0xc673b43d, 1 | BRF_PRG | BRF_ESS }, // 0 Main Z80 Code - { "gyrussk.2", 0x2000, 0xa4ec03e4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gyrussk.3", 0x2000, 0x27454a98, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gyrussk.9", 0x2000, 0x822bf27e, 2 | BRF_PRG | BRF_ESS }, // 3 Sub M6809 Code - - { "gyrussk.1a", 0x2000, 0xf4ae1c17, 3 | BRF_PRG | BRF_ESS }, // 4 Audio Z80 Code - { "gyrussk.2a", 0x2000, 0xba498115, 3 | BRF_PRG | BRF_ESS }, // 5 - - { "gyrussk.3a", 0x1000, 0x3f9b5dea, 4 | BRF_PRG | BRF_ESS }, // 6 Audio i8039 - - { "gyrussk.6", 0x2000, 0xc949db10, 5 | BRF_GRA }, // 7 Sprites - { "gyrussk.5", 0x2000, 0x4f22411a, 5 | BRF_GRA }, // 8 - { "gyrussk.8", 0x2000, 0x47cd1fbc, 5 | BRF_GRA }, // 9 - { "gyrussk.7", 0x2000, 0x8e8d388c, 5 | BRF_GRA }, // 10 - - { "gyrussk.4", 0x2000, 0x27d8329b, 6 | BRF_GRA }, // 11 Background Tiles - - { "gyrussk.pr3", 0x0020, 0x98782db3, 7 | BRF_GRA }, // 12 Color Proms - { "gyrussk.pr1", 0x0100, 0x7ed057de, 7 | BRF_GRA }, // 13 - { "gyrussk.pr2", 0x0100, 0xde823a81, 7 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(gyruss) -STD_ROM_FN(gyruss) - -struct BurnDriver BurnDrvGyruss = { - "gyruss", NULL, NULL, NULL, "1983", - "Gyruss (Konami)\0", NULL, "Konami", "GX347", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gyrussRomInfo, gyrussRomName, NULL, NULL, GyrussInputInfo, GyrussDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 224, 256, 3, 4 -}; - - -// Gyruss (Centuri) - -static struct BurnRomInfo gyrussceRomDesc[] = { - { "gya-1.bin", 0x2000, 0x85f8b7c2, 1 | BRF_PRG | BRF_ESS }, // 0 Main Z80 Code - { "gya-2.bin", 0x2000, 0x1e1a970f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gya-3.bin", 0x2000, 0xf6dbb33b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gyrussk.9", 0x2000, 0x822bf27e, 2 | BRF_PRG | BRF_ESS }, // 3 Sub M6809 Code - - { "gyrussk.1a", 0x2000, 0xf4ae1c17, 3 | BRF_PRG | BRF_ESS }, // 4 Audio Z80 Code - { "gyrussk.2a", 0x2000, 0xba498115, 3 | BRF_PRG | BRF_ESS }, // 5 - - { "gyrussk.3a", 0x1000, 0x3f9b5dea, 4 | BRF_PRG | BRF_ESS }, // 6 Audio i8039 - - { "gyrussk.6", 0x2000, 0xc949db10, 5 | BRF_GRA }, // 7 Sprites - { "gyrussk.5", 0x2000, 0x4f22411a, 5 | BRF_GRA }, // 8 - { "gyrussk.8", 0x2000, 0x47cd1fbc, 5 | BRF_GRA }, // 9 - { "gyrussk.7", 0x2000, 0x8e8d388c, 5 | BRF_GRA }, // 10 - - { "gyrussk.4", 0x2000, 0x27d8329b, 6 | BRF_GRA }, // 11 Background Tiles - - { "gyrussk.pr3", 0x0020, 0x98782db3, 7 | BRF_GRA }, // 12 Color Proms - { "gyrussk.pr1", 0x0100, 0x7ed057de, 7 | BRF_GRA }, // 13 - { "gyrussk.pr2", 0x0100, 0xde823a81, 7 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(gyrussce) -STD_ROM_FN(gyrussce) - -struct BurnDriver BurnDrvGyrussce = { - "gyrussce", "gyruss", NULL, NULL, "1983", - "Gyruss (Centuri)\0", NULL, "Konami (Centuri license)", "GX347", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gyrussceRomInfo, gyrussceRomName, NULL, NULL, GyrussInputInfo, GyrussceDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 224, 256, 3, 4 -}; - - -// Gyruss (bootleg) - -static struct BurnRomInfo gyrussbRomDesc[] = { - { "1.bin", 0x2000, 0x6bc21c10, 1 | BRF_PRG | BRF_ESS }, // 0 Main Z80 Code - { "gyrussk.2", 0x2000, 0xa4ec03e4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gyrussk.3", 0x2000, 0x27454a98, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gyrussk.9", 0x2000, 0x822bf27e, 2 | BRF_PRG | BRF_ESS }, // 3 Sub M6809 Code - - { "gyrussk.1a", 0x2000, 0xf4ae1c17, 3 | BRF_PRG | BRF_ESS }, // 4 Audio Z80 Code - { "gyrussk.2a", 0x2000, 0xba498115, 3 | BRF_PRG | BRF_ESS }, // 5 - - { "gyrussk.3a", 0x1000, 0x3f9b5dea, 4 | BRF_PRG | BRF_ESS }, // 6 Audio i8039 - - { "gyrussk.6", 0x2000, 0xc949db10, 5 | BRF_GRA }, // 7 Sprites - { "gyrussk.5", 0x2000, 0x4f22411a, 5 | BRF_GRA }, // 8 - { "gyrussk.8", 0x2000, 0x47cd1fbc, 5 | BRF_GRA }, // 9 - { "gyrussk.7", 0x2000, 0x8e8d388c, 5 | BRF_GRA }, // 10 - - { "gyrussk.4", 0x2000, 0x27d8329b, 6 | BRF_GRA }, // 11 Background Tiles - - { "gyrussk.pr3", 0x0020, 0x98782db3, 7 | BRF_GRA }, // 12 Color Proms - { "gyrussk.pr1", 0x0100, 0x7ed057de, 7 | BRF_GRA }, // 13 - { "gyrussk.pr2", 0x0100, 0xde823a81, 7 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(gyrussb) -STD_ROM_FN(gyrussb) - -struct BurnDriver BurnDrvGyrussb = { - "gyrussb", "gyruss", NULL, NULL, "1983", - "Gyruss (bootleg)\0", NULL, "bootleg", "GX347", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, gyrussbRomInfo, gyrussbRomName, NULL, NULL, GyrussInputInfo, GyrussDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 224, 256, 3, 4 -}; - - -// Venus - -static struct BurnRomInfo venusRomDesc[] = { - { "r1", 0x2000, 0xd030abb1, 1 | BRF_PRG | BRF_ESS }, // 0 Main Z80 Code - { "r2", 0x2000, 0xdbf65d4d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "r3", 0x2000, 0xdb246fcd, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gyrussk.9", 0x2000, 0x822bf27e, 2 | BRF_PRG | BRF_ESS }, // 3 Sub M6809 Code - - { "gyrussk.1a", 0x2000, 0xf4ae1c17, 3 | BRF_PRG | BRF_ESS }, // 4 Audio Z80 Code - { "gyrussk.2a", 0x2000, 0xba498115, 3 | BRF_PRG | BRF_ESS }, // 5 - - { "gyrussk.3a", 0x1000, 0x3f9b5dea, 4 | BRF_PRG | BRF_ESS }, // 6 Audio i8039 - - { "gyrussk.6", 0x2000, 0xc949db10, 5 | BRF_GRA }, // 7 Sprites - { "gyrussk.5", 0x2000, 0x4f22411a, 5 | BRF_GRA }, // 8 - { "gyrussk.8", 0x2000, 0x47cd1fbc, 5 | BRF_GRA }, // 9 - { "gyrussk.7", 0x2000, 0x8e8d388c, 5 | BRF_GRA }, // 10 - - { "gyrussk.4", 0x2000, 0x27d8329b, 6 | BRF_GRA }, // 11 Background Tiles - - { "gyrussk.pr3", 0x0020, 0x98782db3, 7 | BRF_GRA }, // 12 Color Proms - { "gyrussk.pr1", 0x0100, 0x7ed057de, 7 | BRF_GRA }, // 13 - { "gyrussk.pr2", 0x0100, 0xde823a81, 7 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(venus) -STD_ROM_FN(venus) - -struct BurnDriver BurnDrvVenus = { - "venus", "gyruss", NULL, NULL, "1983", - "Venus\0", NULL, "bootleg", "GX347", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, venusRomInfo, venusRomName, NULL, NULL, GyrussInputInfo, GyrussDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 224, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/konami/d_hcastle.cpp b/jan/src/burn/drv/konami/d_hcastle.cpp deleted file mode 100644 index 399ea480f..000000000 --- a/jan/src/burn/drv/konami/d_hcastle.cpp +++ /dev/null @@ -1,1017 +0,0 @@ -// FB Alpha Haunted Castle / Akuma-Jou Dracula driver module -// Based on MAME driver by Bryan McPhail -// -// Todo: figure out crash on game-exit when refresh rate is set @ 59 in DrvInit() - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "burn_ym3812.h" -#include "k051649.h" -#include "k007232.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *nDrvKonBank; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvPalROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvKonRAM0; -static UINT8 *DrvKonRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvPf1RAM; -static UINT8 *DrvPf2RAM; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvSprRAM2; -static UINT8 *DrvSprBuf1; -static UINT8 *DrvSprBuf2; -static UINT8 *DrvPf1Ctrl; -static UINT8 *DrvPf2Ctrl; -static UINT8 *DrvZ80RAM; -static UINT8 *Palette; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static UINT8 *soundlatch; -static UINT8 *gfxbank; - -static INT32 watchdog; - -static struct BurnInputInfo HcastleInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Hcastle) - -static struct BurnDIPInfo HcastleDIPList[]= -{ - {0x12, 0xff, 0xff, 0x53, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x04, 0x00, "Upright" }, - {0x12, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x18, 0x18, "Easy" }, - {0x12, 0x01, 0x18, 0x10, "Normal" }, - {0x12, 0x01, 0x18, 0x08, "Hard" }, - {0x12, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Strength of Player" }, - {0x12, 0x01, 0x60, 0x00, "Very Weak" }, - {0x12, 0x01, 0x60, 0x20, "Weak" }, - {0x12, 0x01, 0x60, 0x40, "Normal" }, - {0x12, 0x01, 0x60, 0x60, "Strong" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x14, 0x01, 0x02, 0x02, "Single" }, - {0x14, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x08, 0x08, "Yes" }, - {0x14, 0x01, 0x08, 0x00, "No" }, -}; - -STDDIPINFO(Hcastle) - -static void bankswitch(INT32 data) -{ - *nDrvKonBank = data & 0x0f; - INT32 bankaddress = *nDrvKonBank * 0x2000; - - konamiMapMemory(DrvKonROM + 0x10000 + bankaddress, 0x6000, 0x7fff, MAP_ROM); -} - -static void playfield_write(INT32 address, INT32 data, UINT8 *ctrl, UINT8 *spr, UINT8 *buf) -{ - address &= 7; - - if (address == 3) { // buffer sprites - memcpy (buf, spr + ((data & 8) << 8), 0x800); - } - - ctrl[address & 7] = data; -} - -void hcastle_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff8) == 0x0000) { - playfield_write(address, data, DrvPf1Ctrl, DrvSprRAM1, DrvSprBuf1); - return; - } - - if ((address & 0xfff8) == 0x0200) { - playfield_write(address, data, DrvPf2Ctrl, DrvSprRAM2, DrvSprBuf2); - return; - } - - if ((address & 0xff00) == 0x0000) { - DrvKonRAM0[address & 0xff] = data; - return; - } - - if ((address & 0xff00) == 0x0200) { - DrvKonRAM1[address & 0xff] = data; - return; - } - - switch (address) - { - case 0x0400: - bankswitch(data); - return; - - case 0x0404: - *soundlatch = data; - return; - - case 0x0408: - { -// float t = konamiTotalCycles() * 1.19318167; -// t -= ZetTotalCycles(); -// if (t > 1) ZetRun((INT32)t); - - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - return; - - case 0x040c: - watchdog = 0; - return; - - case 0x0410: - - return; - - case 0x0418: - *gfxbank = data; - return; - } -} - -UINT8 hcastle_read(UINT16 address) -{ - switch (address) - { - case 0x0410: - case 0x0411: - case 0x0412: - return DrvInputs[address & 3]; - - case 0x0413: - return DrvDips[2]; - - case 0x0414: - return DrvDips[1]; - - case 0x0415: - return DrvDips[0]; - - case 0x0418: - return *gfxbank; - } - - return 0; -} - -static void sound_bankswitch(INT32 data) -{ - INT32 bank_A=(data&0x3); - INT32 bank_B=((data>>2)&0x3); - - k007232_set_bank(0, bank_A, bank_B ); -} - -void __fastcall hcastle_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff80) == 0x9800) { - K051649WaveformWrite(address & 0x7f, data); - return; - } - - if ((address & 0xfff0) == 0x9880) { - address &= 0x000f; - - if (address <= 0x09) { - K051649FrequencyWrite(address & 0x0f, data); - return; - } - - if (address == 0x0f) { - K051649KeyonoffWrite(data); - return; - } - - if (address >= 0x0a) { - K051649VolumeWrite(address - 0x988a, data); - } - - return; - } - - if (address >= 0xb000 && address <= 0xb00d) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - switch (address) - { - case 0xa000: - case 0xa001: - BurnYM3812Write(0, address & 1, data); - return; - - case 0xc000: - sound_bankswitch(data); - return; - } -} - -UINT8 __fastcall hcastle_sound_read(UINT16 address) -{ - if (address >= 0xb000 && address <= 0xb00d) { - return K007232ReadReg(0, address & 0x0f); - } - - switch (address) - { - case 0xa000: - case 0xa001: - return BurnYM3812Read(0, address & 1); - - case 0xd000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - K051649Reset(); - BurnYM3812Reset(); - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x030000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - - DrvPalROM = Next; Next += 0x000400; - - DrvSndROM = Next; Next += 0x080000; - - Palette = Next; Next += 0x001000; - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - DrvKonRAM0 = Next; Next += 0x000100; - DrvKonRAM1 = Next; Next += 0x000100; - DrvPalRAM = Next; Next += 0x002000; - DrvPf1RAM = Next; Next += 0x001000; - DrvPf2RAM = Next; Next += 0x001000; - DrvSprRAM1 = Next; Next += 0x001000; - DrvSprRAM2 = Next; Next += 0x001000; - DrvSprBuf1 = Next; Next += 0x000800; - DrvSprBuf2 = Next; Next += 0x000800; - - DrvPf1Ctrl = Next; Next += 0x000008; - DrvPf2Ctrl = Next; Next += 0x000008; - - DrvZ80RAM = Next; Next += 0x000800; - - nDrvKonBank = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - gfxbank = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *src, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i-=2) { - src[i+0] = src[i/2] >> 4; - src[i+1] = src[i/2] & 0xf; - } -} - -static void DrvPaletteInit() -{ - for (INT32 chip = 0; chip < 2; chip++) - { - for (INT32 pal = 0; pal < 8; pal++) - { - INT32 clut = (chip << 1) | (pal & 1); - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 ctabentry; - - if (((pal & 0x01) == 0) && (DrvPalROM[(clut << 8) | i] == 0)) - ctabentry = 0; - else - ctabentry = (pal << 4) | (DrvPalROM[(clut << 8) | i] & 0x0f); - - Palette[(chip << 11) | (pal << 8) | i] = ctabentry; - } - } - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 4, 1)) return 1; - BurnByteswap(DrvGfxROM0, 0x100000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000, 6, 1)) return 1; - BurnByteswap(DrvGfxROM1, 0x100000); - - if (BurnLoadRom(DrvSndROM + 0x00000, 7, 1)) return 1; - - if (BurnLoadRom(DrvPalROM + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvPalROM + 0x00100, 9, 1)) return 1; - if (BurnLoadRom(DrvPalROM + 0x00200, 10, 1)) return 1; - if (BurnLoadRom(DrvPalROM + 0x00300, 11, 1)) return 1; - - DrvPaletteInit(); - DrvGfxExpand(DrvGfxROM0, 0x100000); - DrvGfxExpand(DrvGfxROM1, 0x100000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonRAM0, 0x0000, 0x00ff, MAP_ROM); //020-03f - konamiMapMemory(DrvKonRAM1, 0x0200, 0x02ff, MAP_ROM); //220-23f - konamiMapMemory(DrvPalRAM, 0x0600, 0x1fff, MAP_RAM); - konamiMapMemory(DrvPf1RAM, 0x2000, 0x2fff, MAP_RAM); - konamiMapMemory(DrvSprRAM1, 0x3000, 0x3fff, MAP_RAM); - konamiMapMemory(DrvPf2RAM, 0x4000, 0x4fff, MAP_RAM); - konamiMapMemory(DrvSprRAM2, 0x5000, 0x5fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(hcastle_write); - konamiSetReadHandler(hcastle_read); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(hcastle_sound_write); - ZetSetReadHandler(hcastle_sound_read); - ZetClose(); - - BurnYM3812Init(1, 3579545, NULL, DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3579545); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - - K007232Init(0, 3579545, DrvSndROM, 0x80000); // no idea... - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232SetRoute(0, BURN_SND_K007232_ROUTE_1, 0.44, BURN_SND_ROUTE_BOTH); - K007232SetRoute(0, BURN_SND_K007232_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - - K051649Init(3579545/2); - K051649SetRoute(0.45, BURN_SND_ROUTE_BOTH); - - //BurnSetRefreshRate(59); Causes crash-on-exit. weird? hmm. - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - konamiExit(); - ZetExit(); - - K007232Exit(); - K051649Exit(); - BurnYM3812Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(UINT8 *ram, UINT8 *ctrl, UINT8 *gfx, INT32 colbase, INT32 base, INT32 t) -{ - INT32 bit0 = ((ctrl[0x05] >> 0) & 0x03) + 2; - INT32 bit1 = ((ctrl[0x05] >> 2) & 0x03) + 1; - INT32 bit2 = ((ctrl[0x05] >> 4) & 0x03) + 0; - INT32 bit3 = ((ctrl[0x05] >> 6) & 0x03) - 1; - INT32 col = ((ctrl[0x06] << 1) & 0x60) | colbase; - - if (ctrl[0x03] & 0x01) base += 0x2000; - - INT32 scrollx = ((ctrl[0x01] << 8) | ctrl[0x00]) & 0x1ff; - INT32 scrolly = ctrl[0x02] & 0xff; - - INT32 tilemap_flip = ctrl[0x07] & 0x08; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= scrollx; - if (sx < -7) sx += 0x200; - sy -= scrolly; - if (sy < -7) sy += 0x100; - - // if (sx >= nScreenWidth || sy < 9 || sy > 240) continue; - - INT32 ofst = (offs & 0x1f) + ((offs >> 1) & 0x3e0) + ((offs & 0x20) << 6); - - INT32 attr = ram[ofst]; - INT32 code = ram[ofst + 0x400]; - INT32 color = (attr & 0x07) | col; - INT32 bank = ((attr & 0x80) >> 7) | ((attr >> bit0) & 0x02) | ((attr >> bit1) & 0x04) | ((attr >> bit2) & 0x08) | ((attr >> bit3) & 0x10); - - code += (bank << 8) + base; - sy -= 16; //offset - - if (tilemap_flip) { - sx = 0xf8 - sx; - sy = 0xf8 - sy; - - if (sx < -7 || sx >= nScreenWidth) continue; - if (sy < -7 || sy >= nScreenHeight) continue; - - if (t) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, gfx); - } else { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, gfx); - } - } else { - if (sx < -7 || sx >= nScreenWidth) continue; - if (sy < -7 || sy >= nScreenHeight) continue; - - if (t) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, gfx); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, gfx); - } - } - } -} - -static void draw_sprites(INT32 bank, UINT8 *source, UINT8 *ctrl, UINT8 *gfx, INT32 col) -{ - INT32 bank_base = (bank == 0) ? 0x4000 * (*gfxbank & 1) : 0; - - INT32 base_color = ((ctrl[6] & 0x30) << 1) + col; - INT32 flipscreen = ctrl[7] & 0x08; - - static const INT32 x_offset[4] = { 0x00, 0x01, 0x04, 0x05 }; - static const INT32 y_offset[4] = { 0x00, 0x02, 0x08, 0x0a }; - - for (INT32 i = 0; i < 0x40; i++) - { - INT32 number = source[0]; - INT32 sbank = source[1] & 0x0f; - INT32 sy = source[2]; - INT32 sx = source[3]; - INT32 attr = source[4]; - INT32 xflip = source[4] & 0x10; - INT32 yflip = source[4] & 0x20; - INT32 color = base_color + ((source[1] & 0xf0) >> 4); - INT32 width, height; - - if (attr & 0x01) sx -= 256; - if (sy >= 240) sy -= 256; - - number += ((sbank & 3) << 8) + ((attr & 0xc0) << 4); - number = (number << 2) | ((sbank >> 2) & 3); - number += bank_base; - - switch (attr & 0x0e) - { - case 0x06: width = 1; height = 1; break; - case 0x04: width = 1; height = 2; number &= (~2); break; - case 0x02: width = 2; height = 1; number &= (~1); break; - case 0x00: width = 2; height = 2; number &= (~3); break; - case 0x08: width = 4; height = 4; number &= (~3); break; - default: width = 1; height = 1; - } - - for (INT32 y = 0; y < height; y++) - { - INT32 yy = sy + y * 8; - INT32 ey = yflip ? (height-1-y) : y; - yy -= 16; //offset - - for (INT32 x = 0; x < width; x++) - { - INT32 ex = xflip ? (width-1-x) : x; - INT32 xx = sx + x * 8; - - INT32 code = number + x_offset[ex] + y_offset[ey]; - if (xx < -7 || xx >= nScreenWidth) continue; - if (yy < -7 || yy >= nScreenHeight) continue; - - if (flipscreen) { - if (yflip ^ 0x20) { - if (xflip ^ 0x10) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, 248-xx, (248-yy), color, 4, 0, 0, gfx); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, 248-xx, (248-yy), color, 4, 0, 0, gfx); - } - } else { - if (xflip ^ 0x10) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, 248-xx, (248-yy), color, 4, 0, 0, gfx); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, 248-xx, (248-yy), color, 4, 0, 0, gfx); - } - } - } else { - if (yflip) { - if (xflip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, xx, yy, color, 4, 0, 0, gfx); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, xx, yy, color, 4, 0, 0, gfx); - } - } else { - if (xflip) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, xx, yy, color, 4, 0, 0, gfx); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, xx, yy, color, 4, 0, 0, gfx); - } - } - } - } - } - - source += 5; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - UINT32 tmp[0x80]; - - for (INT32 i = 0; i < 0x100; i+=2) { - UINT16 d = DrvPalRAM[i + 1] | (DrvPalRAM[i] << 8); - r = (d >> 0) & 0x1f; - g = (d >> 5) & 0x1f; - b = (d >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - tmp[i/2] = BurnHighCol(r, g, b, 0); - } - - for (INT32 i = 0; i < 0x1000; i++) { - DrvPalette[i] = tmp[Palette[i]]; - } - } - - BurnTransferClear(); - - if ((*gfxbank & 0x04) == 0) - { - if (nBurnLayer & 1) draw_layer(DrvPf2RAM, DrvPf2Ctrl, DrvGfxROM1, 0x90, ((*gfxbank & 2) >> 1) * 0x4000, 0); - if (nSpriteEnable & 1) draw_sprites(0, DrvSprBuf1, DrvPf1Ctrl, DrvGfxROM0, 0x00); - if (nSpriteEnable & 2) draw_sprites(1, DrvSprBuf2, DrvPf2Ctrl, DrvGfxROM1, 0x80); - if (nBurnLayer & 2) draw_layer(DrvPf1RAM, DrvPf1Ctrl, DrvGfxROM0, 0x10, 0x0000, 1); - } - else - { - if (nBurnLayer & 1) draw_layer(DrvPf2RAM, DrvPf2Ctrl, DrvGfxROM1, 0x90, ((*gfxbank & 2) >> 1) * 0x4000, 0); - if (nBurnLayer & 2) draw_layer(DrvPf1RAM, DrvPf1Ctrl, DrvGfxROM0, 0x10, 0x0000, 1); - if (nSpriteEnable & 1) draw_sprites(0, DrvSprBuf1, DrvPf1Ctrl, DrvGfxROM0, 0x00); - if (nSpriteEnable & 2) draw_sprites(1, DrvSprBuf2, DrvPf2Ctrl, DrvGfxROM1, 0x80); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - if (watchdog++ == 60) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - } - - konamiNewFrame(); - ZetNewFrame(); - - INT32 nCyclesTotal[2] = { 3000000 / 60, 3579545 / 60 }; - INT32 nInterleave = 30; - - ZetOpen(0); - konamiOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - konamiRun(nCyclesTotal[0] / nInterleave); - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - K007232Update(0, pBurnSoundOut, nBurnSoundLen); - K051649Update(pBurnSoundOut, nBurnSoundLen); - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - K007232Scan(nAction, pnMin); - K051649Scan(nAction, pnMin); - - SCAN_VAR(watchdog); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - bankswitch(*nDrvKonBank); - konamiClose(); - } - - return 0; -} - - -// Haunted Castle (ver. M) - -static struct BurnRomInfo hcastleRomDesc[] = { - { "m03.k12", 0x08000, 0xd85e743d, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "b06.k8", 0x20000, 0xabd07866, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "768e01.e4", 0x08000, 0xb9fff184, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "768c09.g21", 0x80000, 0xe3be3fdd, 3 | BRF_GRA }, // 3 Bank #0 Tiles - { "768c08.g19", 0x80000, 0x9633db8b, 3 | BRF_GRA }, // 4 - - { "768c04.j5", 0x80000, 0x2960680e, 4 | BRF_GRA }, // 5 Bank #1 Tiles - { "768c05.j6", 0x80000, 0x65a2f227, 4 | BRF_GRA }, // 6 - - { "768c07.e17", 0x80000, 0x01f9889c, 5 | BRF_SND }, // 7 K007232 Samples - - { "768c13.j21", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 8 Color Proms - { "768c14.j22", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 9 - { "768c11.i4", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 10 - { "768c10.i3", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 11 - - { "768b12.d20", 0x00100, 0x362544b8, 0 | BRF_GRA | BRF_OPT }, // 12 Priority Prom -}; - -STD_ROM_PICK(hcastle) -STD_ROM_FN(hcastle) - -struct BurnDriver BurnDrvHcastle = { - "hcastle", NULL, NULL, NULL, "1988", - "Haunted Castle (ver. M)\0", NULL, "Konami", "GX768", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, hcastleRomInfo, hcastleRomName, NULL, NULL, HcastleInputInfo, HcastleDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Haunted Castle (ver. K) - -static struct BurnRomInfo hcastlekRomDesc[] = { - { "768k03.k12", 0x08000, 0x40ce4f38, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "768g06.k8", 0x20000, 0xcdade920, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "768e01.e4", 0x08000, 0xb9fff184, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "768c09.g21", 0x80000, 0xe3be3fdd, 3 | BRF_GRA }, // 3 Bank #0 Tiles - { "768c08.g19", 0x80000, 0x9633db8b, 3 | BRF_GRA }, // 4 - - { "768c04.j5", 0x80000, 0x2960680e, 4 | BRF_GRA }, // 5 Bank #1 Tiles - { "768c05.j6", 0x80000, 0x65a2f227, 4 | BRF_GRA }, // 6 - - { "768c07.e17", 0x80000, 0x01f9889c, 5 | BRF_SND }, // 7 K007232 Samples - - { "768c13.j21", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 8 Color Proms - { "768c14.j22", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 9 - { "768c11.i4", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 10 - { "768c10.i3", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 11 - - { "768b12.d20", 0x00100, 0x362544b8, 0 | BRF_GRA | BRF_OPT }, // 12 Priority Prom -}; - -STD_ROM_PICK(hcastlek) -STD_ROM_FN(hcastlek) - -struct BurnDriver BurnDrvHcastlek = { - "hcastlek", "hcastle", NULL, NULL, "1988", - "Haunted Castle (ver. K)\0", NULL, "Konami", "GX768", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, hcastlekRomInfo, hcastlekRomName, NULL, NULL, HcastleInputInfo, HcastleDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Haunted Castle (ver. E) - -static struct BurnRomInfo hcastleeRomDesc[] = { - { "768e03.k12", 0x08000, 0x0b32619c, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "768e06.k8", 0x20000, 0x0431b8c0, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "768e01.e4", 0x08000, 0xb9fff184, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "768c09.g21", 0x80000, 0xe3be3fdd, 3 | BRF_GRA }, // 3 Bank #0 Tiles - { "768c08.g19", 0x80000, 0x9633db8b, 3 | BRF_GRA }, // 4 - - { "768c04.j5", 0x80000, 0x2960680e, 4 | BRF_GRA }, // 5 Bank #1 Tiles - { "768c05.j6", 0x80000, 0x65a2f227, 4 | BRF_GRA }, // 6 - - { "768c07.e17", 0x80000, 0x01f9889c, 5 | BRF_SND }, // 7 K007232 Samples - - { "768c13.j21", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 8 Color Proms - { "768c14.j22", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 9 - { "768c11.i4", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 10 - { "768c10.i3", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 11 - - { "768b12.d20", 0x00100, 0x362544b8, 0 | BRF_GRA | BRF_OPT }, // 12 Priority Prom -}; - -STD_ROM_PICK(hcastlee) -STD_ROM_FN(hcastlee) - -struct BurnDriver BurnDrvHcastlee = { - "hcastlee", "hcastle", NULL, NULL, "1988", - "Haunted Castle (ver. E)\0", NULL, "Konami", "GX768", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, hcastleeRomInfo, hcastleeRomName, NULL, NULL, HcastleInputInfo, HcastleDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Akuma-Jou Dracula (Japan ver. P) - -static struct BurnRomInfo akumajouRomDesc[] = { - { "768p03.k12", 0x08000, 0xd509e340, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "768j06.k8", 0x20000, 0x42283c3e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "768e01.e4", 0x08000, 0xb9fff184, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "768c09.g21", 0x80000, 0xe3be3fdd, 3 | BRF_GRA }, // 3 Bank #0 Tiles - { "768c08.g19", 0x80000, 0x9633db8b, 3 | BRF_GRA }, // 4 - - { "768c04.j5", 0x80000, 0x2960680e, 4 | BRF_GRA }, // 5 Bank #1 Tiles - { "768c05.j6", 0x80000, 0x65a2f227, 4 | BRF_GRA }, // 6 - - { "768c07.e17", 0x80000, 0x01f9889c, 5 | BRF_SND }, // 7 K007232 Samples - - { "768c13.j21", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 8 Color Proms - { "768c14.j22", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 9 - { "768c11.i4", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 10 - { "768c10.i3", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 11 - - { "768b12.d20", 0x00100, 0x362544b8, 0 | BRF_GRA | BRF_OPT }, // 12 Priority Prom -}; - -STD_ROM_PICK(akumajou) -STD_ROM_FN(akumajou) - -struct BurnDriver BurnDrvAkumajou = { - "akumajou", "hcastle", NULL, NULL, "1988", - "Akuma-Jou Dracula (Japan ver. P)\0", NULL, "Konami", "GX768", - L"\u60AA\u9B54\u57CE \u30C9\u30E9\u30AD\u30E5\u30E9 (Japan ver. P)\0Akuma-Jou Dracula\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, akumajouRomInfo, akumajouRomName, NULL, NULL, HcastleInputInfo, HcastleDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Akuma-Jou Dracula (Japan ver. N) - -static struct BurnRomInfo akumajounRomDesc[] = { - { "768n03.k12", 0x08000, 0x3e4dca2a, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "768j06.k8", 0x20000, 0x42283c3e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "768e01.e4", 0x08000, 0xb9fff184, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "768c09.g21", 0x80000, 0xe3be3fdd, 3 | BRF_GRA }, // 3 Bank #0 Tiles - { "768c08.g19", 0x80000, 0x9633db8b, 3 | BRF_GRA }, // 4 - - { "768c04.j5", 0x80000, 0x2960680e, 4 | BRF_GRA }, // 5 Bank #1 Tiles - { "768c05.j6", 0x80000, 0x65a2f227, 4 | BRF_GRA }, // 6 - - { "768c07.e17", 0x80000, 0x01f9889c, 5 | BRF_SND }, // 7 K007232 Samples - - { "768c13.j21", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 8 Color Proms - { "768c14.j22", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 9 - { "768c11.i4", 0x00100, 0xf5de80cb, 6 | BRF_GRA }, // 10 - { "768c10.i3", 0x00100, 0xb32071b7, 6 | BRF_GRA }, // 11 - - { "768b12.d20", 0x00100, 0x362544b8, 0 | BRF_GRA | BRF_OPT }, // 12 Priority Prom -}; - -STD_ROM_PICK(akumajoun) -STD_ROM_FN(akumajoun) - -struct BurnDriver BurnDrvAkumajoun = { - "akumajoun", "hcastle", NULL, NULL, "1988", - "Akuma-Jou Dracula (Japan ver. N)\0", NULL, "Konami", "GX768", - L"\u60AA\u9B54\u57CE \u30C9\u30E9\u30AD\u30E5\u30E9 (Japan ver. N)\0Akuma-Jou Dracula\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, akumajounRomInfo, akumajounRomName, NULL, NULL, HcastleInputInfo, HcastleDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_hexion.cpp b/jan/src/burn/drv/konami/d_hexion.cpp deleted file mode 100644 index 28693ba34..000000000 --- a/jan/src/burn/drv/konami/d_hexion.cpp +++ /dev/null @@ -1,677 +0,0 @@ -// FB Alpha Hexion driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "k051649.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *MemEnd; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvGfxROMExp; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvUnkRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *flipscreen; - -static UINT32 *DrvPalette; -static UINT32 *Palette; -static UINT8 DrvRecalc; - -static INT32 cpubank; -static INT32 bankctrl; -static INT32 rambank; -static INT32 pmcbank; -static INT32 gfxrom_select; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 is_bootleg = 0; - -static struct BurnInputInfo HexionInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Hexion) - -static struct BurnDIPInfo HexionDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x4f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x13, 0x01, 0x70, 0x70, "Easiest" }, - {0x13, 0x01, 0x70, 0x60, "Very Easy" }, - {0x13, 0x01, 0x70, 0x50, "Easy" }, - {0x13, 0x01, 0x70, 0x40, "Medium" }, - {0x13, 0x01, 0x70, 0x30, "Medium Hard" }, - {0x13, 0x01, 0x70, 0x20, "Hard" }, - {0x13, 0x01, 0x70, 0x10, "Very Hard" }, - {0x13, 0x01, 0x70, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Hexion) - -static void bankswitch(INT32 data) -{ - cpubank = data & 0x0f; - - ZetMapMemory(DrvZ80ROM + (cpubank << 13), 0x8000, 0x9fff, MAP_ROM); -} - -void __fastcall hexion_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xdfff: - bankctrl = data; - return; - - case 0xf200: - MSM6295Command(0, data); - return; - - case 0xf480: - { - if (data & 0x40) { - memset (DrvVidRAM + ((DrvUnkRAM[0] & 1) << 13), DrvUnkRAM[1], 0x2000); - } - - pmcbank = data & 0x80; - - bankswitch(data); - } - return; - - case 0xf4c0: - *flipscreen = data & 0x20; - return; - - case 0xf500: - gfxrom_select = data; - return; - - case 0xf5c0: - if (is_bootleg) { - MSM6295Command(1, data); - } - return; - } - - if ((address & 0xe000) == 0xc000) { - if (bankctrl == 3 && address == 0xc000 && (data & 0xfe) == 0) { - rambank = data & 1; - return; - } - if (pmcbank) { - if (bankctrl == 0) { - DrvVidRAM[(rambank << 13) + (address & 0x1fff)] = data; - return; - } - if (bankctrl == 2 && address < 0xc800) { - DrvUnkRAM[address & 0x7ff] = data; - return; - } - } - return; - } - - if ((address & 0xff80) == 0xe800) { - K051649WaveformWrite(address & 0x7f, data); - return; - } - - if ((address & 0xfff0) == 0xe880) { - if (address <= 0xe889) { - K051649FrequencyWrite(address & 0x0f, data); - return; - } - - if (address == 0xe88f) { - K051649KeyonoffWrite(data); - return; - } - - if (address >= 0xe88a) { - K051649VolumeWrite(address - 0xe88a, data); - return; - } - - return; - } -} - -UINT8 __fastcall hexion_read(UINT16 address) -{ - switch (address) - { - case 0xf400: - return DrvDips[0]; - - case 0xf401: - return DrvDips[1]; - - case 0xf402: - return DrvInputs[0]; - - case 0xf403: - return DrvInputs[1]; - - case 0xf440: - return DrvDips[2]; - - case 0xf441: - return DrvInputs[2] & 0xf7; - - case 0xf540: - return 0; // watchdog - } - - if ((address & 0xe000) == 0xc000) { - if (gfxrom_select && address < 0xd000) - return DrvGfxROM[((gfxrom_select & 0x7f) << 12) + (address & 0xfff)]; - - if (bankctrl == 0) - return DrvVidRAM[(rambank << 13) + (address & 0x1fff)]; - - if (bankctrl == 2 && address < 0xd800) - return DrvUnkRAM[address & 0x7ff]; - - return 0; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - bankswitch(4); - ZetClose(); - - K051649Reset(); - - MSM6295Reset(0); - MSM6295Reset(1); - - cpubank = 0; - bankctrl = 0; - rambank = 0; - pmcbank = 0; - gfxrom_select = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM = Next; Next += 0x080000; - DrvGfxROMExp = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - Palette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvUnkRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x006000; - DrvZ80RAM = Next; Next += 0x002000; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { STEP4(0,1) }; - INT32 XOffs[8] = { 0x200000, 0x200004, 0x000000, 0x000004, 0x200008, 0x20000c, 0x000008, 0x00000c }; - INT32 YOffs[8] = { STEP8(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM, 0x80000); - - GfxDecode(0x4000, 4, 8, 8, Plane, XOffs, YOffs, 0x080, tmp, DrvGfxROMExp); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0,bit1,bit2,bit3,r,g,b; - - bit0 = (DrvColPROM[i + 0x000] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x000] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x000] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x000] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x200] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x200] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x200] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x200] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - Palette[i] = (r << 16) | (g << 8) | b; - } -} - -static INT32 DrvInit() -{ - is_bootleg = (BurnDrvGetFlags() & BDF_BOOTLEG) ? 1 : 0; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM, 1, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x40000, 2, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0, 3, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x000, 4, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x100, 5, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x200, 6, 1)) return 1; - - // bootleg - if (BurnLoadRom(DrvSndROM1, 7, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xa000, 0xbfff, MAP_RAM); - ZetSetWriteHandler(hexion_write); - ZetSetReadHandler(hexion_read); - ZetClose(); - - MSM6295Init(0, 1056000 / 132, 0); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - MSM6295Init(1, 1056000 / 132, 1); - MSM6295SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - - K051649Init(1500000); - K051649SetRoute(0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - MSM6295Exit(1); - K051649Exit(); - - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_layer(INT32 offset, INT32 transparent, INT32 pos) -{ - UINT8 *vram = DrvVidRAM + offset; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - INT32 code = vram[0] | ((vram[1] & 0x3f) << 8); - INT32 color = vram[2] & 0x0f; - vram += 4; - - if (*flipscreen) { - sx ^= 0x1f8; - sy ^= 0x0f8; - - if (transparent) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx-pos, sy+pos, color, 4, 0, 0, DrvGfxROMExp); - } else { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx-pos, sy+pos, color, 4, 0, DrvGfxROMExp); - } - - // wrap - if (pos == 0) continue; - if (sx == 0) Render8x8Tile_Clip(pTransDraw, code, sx + 508, sy, color, 4, 0, DrvGfxROMExp); - if (sy == 252) Render8x8Tile_Clip(pTransDraw, code, sx, sy - 256, color, 4, 0, DrvGfxROMExp); - } else { - if (transparent) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx+pos, sy-pos, color, 4, 0, 0, DrvGfxROMExp); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx+pos, sy-pos, color, 4, 0, DrvGfxROMExp); - } - - // wrap - if (pos == 0) continue; - if (sy == 0) Render8x8Tile_Clip(pTransDraw, code, sx, sy + 252, color, 4, 0, DrvGfxROMExp); - if (sx == 504) Render8x8Tile_Clip(pTransDraw, code, sx - 508, sy, color, 4, 0, DrvGfxROMExp); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x100; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - } - - draw_layer(0x2000, 0, 4); - draw_layer(0x0000, 1, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = nBurnSoundLen; - INT32 nSoundBufferPos = 0; - - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03; - if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - } - - ZetNewFrame(); - - INT32 nCyclesTotal[1] = { 6000000 / 60 }; - INT32 nCyclesDone[1] = { 0 }; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = ZetRun(nCyclesSegment); - if (i == (nInterleave / 3)) ZetNmi(); - if (i == ((nInterleave / 3) * 2)) ZetNmi(); - if (i == nInterleave - 1) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - nCyclesDone[0] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - memset (pSoundBuf, 0, nSegmentLength * 2 * 2); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - if (is_bootleg == 0) { - K051649Update(pSoundBuf, nSegmentLength); - } - nSoundBufferPos += nSegmentLength; - } - } - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - memset (pSoundBuf, 0, nSegmentLength * 2 * 2); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - if (is_bootleg == 0) { - K051649Update(pSoundBuf, nSegmentLength); - } - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029705; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - K051649Scan(nAction, pnMin); - - SCAN_VAR(cpubank); - SCAN_VAR(bankctrl); - SCAN_VAR(rambank); - SCAN_VAR(pmcbank); - SCAN_VAR(gfxrom_select); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(cpubank); - ZetClose(); - } - - return 0; -} - - -// Hexion (Japan ver. JAB) - -static struct BurnRomInfo hexionRomDesc[] = { - { "122__j_a__b01.16f", 0x20000, 0xeabc6dd1, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - - { "122a07.1h", 0x40000, 0x22ae55e3, 2 | BRF_GRA }, // 1 Tiles - { "122a06.1g", 0x40000, 0x438f4388, 2 | BRF_GRA }, // 2 - - { "122a05.2f", 0x40000, 0xbcc831bf, 3 | BRF_SND }, // 3 M6296 #0 Samples - - { "122a04.10b", 0x00100, 0x506eb8c6, 4 | BRF_GRA }, // 4 Color PROMs - { "122a03.11b", 0x00100, 0x590c4f64, 4 | BRF_GRA }, // 5 - { "122a02.13b", 0x00100, 0x5734305c, 4 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(hexion) -STD_ROM_FN(hexion) - -struct BurnDriver BurnDrvHexion = { - "hexion", NULL, NULL, NULL, "1992", - "Hexion (Japan ver. JAB)\0", NULL, "Konami", "GX122", - L"Hexion (Japan ver. JAB)\0\u30D8\u30AF\u30B7\u30AA\u30F3 (Japan ver. JAB)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_PUZZLE, 0, - NULL, hexionRomInfo, hexionRomName, NULL, NULL, HexionInputInfo, HexionDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 512, 256, 4, 3 -}; - - -// Hexion (Bootleg, Asia ver. AAA) - -static struct BurnRomInfo hexionbRomDesc[] = { - { "hexionb.u2", 0x20000, 0x93edc5d4, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - - { "hexionb.u30", 0x40000, 0x22ae55e3, 2 | BRF_GRA }, // 1 Tiles - { "hexionb.u29", 0x40000, 0x438f4388, 2 | BRF_GRA }, // 2 - - { "hexionb.u16", 0x40000, 0xbcc831bf, 3 | BRF_SND }, // 3 M6295 #0 Samples - - { "82s129.u36", 0x00100, 0x506eb8c6, 4 | BRF_GRA }, // 4 Color PROMs - { "82s129.u37", 0x00100, 0x590c4f64, 4 | BRF_GRA }, // 5 - { "82s129.u38", 0x00100, 0x5734305c, 4 | BRF_GRA }, // 6 - - { "hexionb.u18", 0x40000, 0xC179D315, 5 | BRF_SND }, // 7 M6295 #1 Samples -}; - -STD_ROM_PICK(hexionb) -STD_ROM_FN(hexionb) - -struct BurnDriver BurnDrvHexionb = { - "hexionb", "hexion", NULL, NULL, "1992", - "Hexion (Bootleg, Asia ver. AAA)\0", NULL, "Bootleg", "GX122", - L"Hexion (Bootleg, Asia ver. AAA)\0\u30D8\u30AF\u30B7\u30AA\u30F3 (Bootleg, Asia ver. AAA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_KONAMI, GBF_PUZZLE, 0, - NULL, hexionbRomInfo, hexionbRomName, NULL, NULL, HexionInputInfo, HexionDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 512, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_hyperspt.cpp b/jan/src/burn/drv/konami/d_hyperspt.cpp deleted file mode 100644 index dbb635d7d..000000000 --- a/jan/src/burn/drv/konami/d_hyperspt.cpp +++ /dev/null @@ -1,1139 +0,0 @@ -// FB Alpha Hyper Sports driver module -// Based on MAME driver by Chris Hardy - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "z80_intf.h" -#include "vlm5030.h" -#include "sn76496.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809DecROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvTransTable; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 previous_sound_irq; -static UINT8 flipscreen; -static UINT8 irq_enable; -static UINT8 soundlatch; -static UINT16 last_sound_addr; -static UINT8 sn76496_latch; -static INT32 watchdog; -static INT32 game_select = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[9]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo HypersptInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy2 + 3, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 2, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 0, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy3 + 3, "p4 start" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy3 + 6, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy3 + 4, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Hyperspt) - -static struct BurnInputInfo RoadfInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Roadf) - -static struct BurnDIPInfo HypersptDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x49, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x15, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 2, "After Last Event" }, - {0x16, 0x01, 0x01, 0x01, "Game Over" }, - {0x16, 0x01, 0x01, 0x00, "Game Continues" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x16, 0x01, 0x02, 0x00, "Upright" }, - {0x16, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "World Records" }, - {0x16, 0x01, 0x08, 0x08, "Don't Erase" }, - {0x16, 0x01, 0x08, 0x00, "Erase on Reset" }, - - {0 , 0xfe, 0 , 16, "Difficulty" }, - {0x16, 0x01, 0xf0, 0xf0, "Easy 1" }, - {0x16, 0x01, 0xf0, 0xe0, "Easy 2" }, - {0x16, 0x01, 0xf0, 0xd0, "Easy 3" }, - {0x16, 0x01, 0xf0, 0xc0, "Easy 4" }, - {0x16, 0x01, 0xf0, 0xb0, "Normal 1" }, - {0x16, 0x01, 0xf0, 0xa0, "Normal 2" }, - {0x16, 0x01, 0xf0, 0x90, "Normal 3" }, - {0x16, 0x01, 0xf0, 0x80, "Normal 4" }, - {0x16, 0x01, 0xf0, 0x70, "Normal 5" }, - {0x16, 0x01, 0xf0, 0x60, "Normal 6" }, - {0x16, 0x01, 0xf0, 0x50, "Normal 7" }, - {0x16, 0x01, 0xf0, 0x40, "Normal 8" }, - {0x16, 0x01, 0xf0, 0x30, "Difficult 1" }, - {0x16, 0x01, 0xf0, 0x20, "Difficult 2" }, - {0x16, 0x01, 0xf0, 0x10, "Difficult 3" }, - {0x16, 0x01, 0xf0, 0x00, "Difficult 4" }, -}; - -STDDIPINFO(Hyperspt) - -static struct BurnDIPInfo RoadfDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x2d, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x01, 0x01, "No" }, - {0x13, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4, "Number of Opponents" }, - {0x13, 0x01, 0x06, 0x06, "Few" }, - {0x13, 0x01, 0x06, 0x04, "Normal" }, - {0x13, 0x01, 0x06, 0x02, "Many" }, - {0x13, 0x01, 0x06, 0x00, "Great Many" }, - - {0 , 0xfe, 0 , 2, "Speed of Opponents" }, - {0x13, 0x01, 0x08, 0x08, "Fast" }, - {0x13, 0x01, 0x08, 0x00, "Slow" }, - - {0 , 0xfe, 0 , 4, "Fuel Consumption" }, - {0x13, 0x01, 0x30, 0x30, "Slow" }, - {0x13, 0x01, 0x30, 0x20, "Normal" }, - {0x13, 0x01, 0x30, 0x10, "Fast" }, - {0x13, 0x01, 0x30, 0x00, "Very Fast" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x40, 0x00, "Upright" }, - {0x13, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Roadf) - -static void hyperspt_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1400: - watchdog = 0; - return; - - case 0x1480: - flipscreen = data & 1; - return; - - case 0x1481: - if (previous_sound_irq == 0 && data != 0) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - previous_sound_irq = data; - return; - - case 0x1483: - // coin counter - return; - - case 0x1487: - irq_enable = data & 1; - return; - - case 0x1500: - soundlatch = data; - return; - } -} - -static UINT8 hyperspt_main_read(UINT16 address) -{ - switch (address) - { - case 0x1600: - return DrvDips[1]; - - case 0x1680: - return DrvInputs[0]; - - case 0x1681: - return DrvInputs[1]; - - case 0x1682: - return DrvInputs[2] ^ ((game_select > 1) ? 0x40 : 0); // roadf needs this - - case 0x1683: - return DrvDips[0]; - } - - return 0; -} - -static void __fastcall hyperspt_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xe000) == 0xc000) { - INT32 offset = address & 0x1fff; - INT32 changes = offset ^ last_sound_addr; - if (changes & 0x10) vlm5030_st(0, offset & 0x10); - if (changes & 0x20) vlm5030_rst(0, offset & 0x20); - last_sound_addr = offset; - return; - } - - switch (address) - { - case 0xa000: - vlm5030_data_write(0, data); - return; - - case 0xe000: - DACWrite(0, data); - return; - - case 0xe001: - sn76496_latch = data; - return; - - case 0xe002: - SN76496Write(0, sn76496_latch); - return; - } -} - -static UINT8 __fastcall hyperspt_sound_read(UINT16 address) -{ - switch (address) - { - case 0x6000: - return soundlatch; - - case 0x8000: - return ((ZetTotalCycles() / 1024) & 0x3) | (vlm5030_bsy(0) ? 4 : 0); - } - - return 0; -} - -static tilemap_callback( hyperspt ) -{ - UINT8 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + (((attr & 0x80) << 1) | ((attr & 0x40) << 3)); - - TILE_SET_INFO(0, code, attr, TILE_FLIPXY(attr >> 4)); -} - -static tilemap_callback( roadf ) -{ - UINT8 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + (((attr & 0x80) << 1) | ((attr & 0x60) << 4)); - - TILE_SET_INFO(0, code, attr, (attr & 0x10) ? TILE_FLIPX : 0); -} - -static INT32 DrvDACSync() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3579545.000 / (nBurnFPS / 100.000)))); -} - -static UINT32 DrvVLMSync(INT32 samples_rate) -{ - return (samples_rate * ZetTotalCycles()) / 59659; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - - previous_sound_irq = 0; - flipscreen = 0; - irq_enable = 0; - soundlatch = 0; - last_sound_addr = 0; - sn76496_latch = 0; - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - vlm5030Reset(0); - DACReset(); - ZetReset(); - ZetClose(); - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x010000; - DrvM6809DecROM = Next; Next += 0x010000; - DrvZ80ROM = Next; Next += 0x004000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvSndROM = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000220; - - DrvNVRAM = Next; Next += 0x000800; - - DrvTransTable = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x200 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000100; - - DrvVidRAM = Next; Next += 0x000800; - DrvColRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x001000; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Plane[4] = { 0x8000*8+4, 0x8000*8+0, 4, 0 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - - memcpy (tmp, DrvGfxROM1, 0x10000); - - GfxDecode(0x800, 4, 8, 8, Plane, XOffs, YOffs, 0x080, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM0, 0x10000); - - GfxDecode(0x200, 4, 16, 16, Plane, XOffs, YOffs, 0x200, tmp, DrvGfxROM0); - - BurnFree(tmp); -} - -static void Konami1Decode() -{ - for (INT32 i = 0; i < 0x10000; i++) - { - UINT8 xor1 = 0; - - if ( i & 0x02) xor1 |= 0x80; - else xor1 |= 0x20; - if ( i & 0x08) xor1 |= 0x08; - else xor1 |= 0x02; - - DrvM6809DecROM[i] = DrvM6809ROM[i] ^ xor1; - } -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - game_select = select; - - if (select == 0) // hyperspt, hpolym84, - { - if (BurnLoadRom(DrvM6809ROM + 0x04000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x06000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0a000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0e000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x02000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x06000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0a000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0e000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a000, 19, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 21, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00120, 22, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 23, 1)) return 1; - } - else if (select == 1) // hypersptb - { - if (BurnLoadRom(DrvM6809ROM + 0x06000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0a000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0e000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x02000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0c000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x06000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0a000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 16, 1)) return 1; - memcpy (DrvGfxROM1, DrvGfxROM1 + 0x4000, 0x4000); - memset (DrvGfxROM1 + 0x4000, 0, 0x4000); - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a000, 19, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 21, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00120, 22, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x08000, 23, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x0a000, 24, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x0c000, 25, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x0e000, 26, 1)) return 1; - } - else if (select == 2) // roadf, roadf2 - { - if (BurnLoadRom(DrvM6809ROM + 0x04000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x06000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0a000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0e000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00120, 15, 1)) return 1; - } - else if (select == 3) // roadf3 - { - if (BurnLoadRom(DrvM6809ROM + 0x04000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0A000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c000, 13, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00120, 16, 1)) return 1; - } - - Konami1Decode(); - DrvGfxDecode(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvSprRAM, 0x1000, 0x10ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x2000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvM6809RAM, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvNVRAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x4000, 0x4000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809DecROM + 0x4000, 0x4000, 0xffff, MAP_FETCH); - M6809SetWriteHandler(hyperspt_main_write); - M6809SetReadHandler(hyperspt_main_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x4000, 0x4fff, MAP_RAM); - ZetSetWriteHandler(hyperspt_sound_write); - ZetSetReadHandler(hyperspt_sound_read); - ZetClose(); - - SN76489AInit(0, 1789772, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - vlm5030Init(0, 3579545, DrvVLMSync, DrvSndROM, 0x2000, 1); - vlm5030SetAllRoutes(0, (select != 0) ? 0 : 1.00, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvDACSync); - DACSetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, (select > 1) ? roadf_map_callback : hyperspt_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(0, DrvGfxROM1, 4, 8, 8, 0x20000, 0x100, 0xf); - GenericTilemapSetScrollRows(0, 32); - GenericTilemapSetOffsets(0, 0, -16); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - ZetExit(); - vlm5030Exit(); - SN76496Exit(); - DACExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pal[0x20]; - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = bit0 * 33 + bit1 * 71 + bit2 * 151; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = bit0 * 33 + bit1 * 71 + bit2 * 151; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = bit0 * 81 + bit1 * 174; - - pal[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) { - DrvPalette[i] = pal[(DrvColPROM[0x020 + i] & 0xf) + ((i&0x100)>>4)]; - - DrvTransTable[i] = (DrvColPROM[0x20 + i] == 0) ? 0 : 1; - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0xc0 - 4;offs >= 0;offs -= 4) - { - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = 240 - DrvSprRAM[offs + 1]; - INT32 code = DrvSprRAM[offs + 2] + 8 * (DrvSprRAM[offs] & 0x20); - INT32 color = DrvSprRAM[offs] & 0x0f; - INT32 flipx = ~DrvSprRAM[offs] & 0x40; - INT32 flipy = DrvSprRAM[offs] & 0x80; - - if (flipscreen) - { - sy = 240 - sy; - flipy = !flipy; - } - - sy += 1 - 16; - - RenderTileTranstab(pTransDraw, DrvGfxROM0, code, color*16, 0, sx, sy, flipx, flipy, 16, 16, DrvTransTable); - RenderTileTranstab(pTransDraw, DrvGfxROM0, code, color*16, 0, sx - 256, sy, flipx, flipy, 16, 16, DrvTransTable); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - UINT8 *scroll = DrvSprRAM + 0xc0; - - GenericTilemapSetFlip(0, (flipscreen) ? TMAP_FLIPXY : 0); - - for (INT32 row = 0; row < 32; row++) - { - INT32 scrollx = scroll[row * 2] + (scroll[(row * 2) + 1] & 0x01) * 256; - if (flipscreen) scrollx = -scrollx; - GenericTilemapSetScrollRow(0, row, scrollx); - } - - if (~nBurnLayer & 1) BurnTransferClear(); - if ( nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, 0); - if ( nBurnLayer & 2) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - ZetNewFrame(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 1536000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0, nSegment = 0; - - ZetOpen(0); - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - - if (i == 255 && irq_enable) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - nSegment = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - } - // vlm5030 won't interlace, so just run it at the end of the frame.. - if (game_select == 0) vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - ZetScan(nAction); - - vlm5030Scan(nAction); - SN76496Scan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(sn76496_latch); - SCAN_VAR(previous_sound_irq); - SCAN_VAR(flipscreen); - SCAN_VAR(irq_enable); - SCAN_VAR(soundlatch); - SCAN_VAR(last_sound_addr); - } - - return 0; -} - - -// Hyper Sports - -static struct BurnRomInfo hypersptRomDesc[] = { - { "c01", 0x2000, 0x0c720eeb, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "c02", 0x2000, 0x560258e0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "c03", 0x2000, 0x9b01c7e6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "c04", 0x2000, 0x10d7e9a2, 1 | BRF_PRG | BRF_ESS }, // 3 - { "c05", 0x2000, 0xb105a8cd, 1 | BRF_PRG | BRF_ESS }, // 4 - { "c06", 0x2000, 0x1a34a849, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "c10", 0x2000, 0x3dc1a6ff, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - { "c09", 0x2000, 0x9b525c3e, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "c14", 0x2000, 0xc72d63be, 3 | BRF_GRA }, // 8 Background Tiles - { "c13", 0x2000, 0x76565608, 3 | BRF_GRA }, // 9 - { "c12", 0x2000, 0x74d2cc69, 3 | BRF_GRA }, // 10 - { "c11", 0x2000, 0x66cbcb4d, 3 | BRF_GRA }, // 11 - { "c18", 0x2000, 0xed25e669, 3 | BRF_GRA }, // 12 - { "c17", 0x2000, 0xb145b39f, 3 | BRF_GRA }, // 13 - { "c16", 0x2000, 0xd7ff9f2b, 3 | BRF_GRA }, // 14 - { "c15", 0x2000, 0xf3d454e6, 3 | BRF_GRA }, // 15 - - { "c26", 0x2000, 0xa6897eac, 4 | BRF_GRA }, // 16 Sprites - { "c24", 0x2000, 0x5fb230c0, 4 | BRF_GRA }, // 17 - { "c22", 0x2000, 0xed9271a0, 4 | BRF_GRA }, // 18 - { "c20", 0x2000, 0x183f4324, 4 | BRF_GRA }, // 19 - - { "c03_c27.bin", 0x0020, 0xbc8a5956, 5 | BRF_GRA }, // 20 Color Proms - { "j12_c28.bin", 0x0100, 0x2c891d59, 5 | BRF_GRA }, // 21 - { "a09_c29.bin", 0x0100, 0x811a3f3f, 5 | BRF_GRA }, // 22 - - { "c08", 0x2000, 0xe8f8ea78, 6 | BRF_GRA }, // 23 VLM Samples -}; - -STD_ROM_PICK(hyperspt) -STD_ROM_FN(hyperspt) - -static INT32 HypersptInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvHyperspt = { - "hyperspt", NULL, NULL, NULL, "1984", - "Hyper Sports\0", NULL, "Konami (Centuri license)", "GX330", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, hypersptRomInfo, hypersptRomName, NULL, NULL, HypersptInputInfo, HypersptDIPInfo, - HypersptInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Hyper Sports (bootleg) - -static struct BurnRomInfo hypersptbRomDesc[] = { - { "1.5g", 0x2000, 0x0cfc68a7, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "2.7g", 0x2000, 0x560258e0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.8g", 0x2000, 0x9b01c7e6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.11g", 0x2000, 0x4ed32240, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.13g", 0x2000, 0xb105a8cd, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6.15g", 0x2000, 0x1a34a849, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "12.17a", 0x2000, 0x3dc1a6ff, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - { "11.15a", 0x2000, 0x9b525c3e, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "20.15g", 0x8000, 0x551d222f, 3 | BRF_GRA }, // 8 Background Tiles - { "16.19j", 0x2000, 0xc72d63be, 3 | BRF_GRA }, // 9 - { "15.18j", 0x2000, 0x76565608, 3 | BRF_GRA }, // 10 - { "14.17j", 0x2000, 0x74d2cc69, 3 | BRF_GRA }, // 11 - { "13.15j", 0x2000, 0x66cbcb4d, 3 | BRF_GRA }, // 12 - { "17.19g", 0x2000, 0xed25e669, 3 | BRF_GRA }, // 13 - { "18.18g", 0x2000, 0xb145b39f, 3 | BRF_GRA }, // 14 - { "19.17g", 0x2000, 0xd7ff9f2b, 3 | BRF_GRA }, // 15 - - { "b.14a", 0x8000, 0x8fd90bd2, 4 | BRF_GRA }, // 16 Sprites - { "a.12a", 0x2000, 0xa3d422c6, 4 | BRF_GRA }, // 17 - { "d.14c", 0x2000, 0xed9271a0, 4 | BRF_GRA }, // 18 - { "c.12c", 0x2000, 0x0c8ed053, 4 | BRF_GRA }, // 19 - - { "mmi6331-1.3c", 0x0020, 0xbc8a5956, 5 | BRF_GRA }, // 20 Color Proms - { "j12_c28.bin", 0x0100, 0x2c891d59, 5 | BRF_GRA }, // 21 - { "a09_c29.bin", 0x0100, 0x811a3f3f, 5 | BRF_GRA }, // 22 - - { "10.20c", 0x2000, 0xa4cddeb8, 6 | BRF_SND }, // 23 M6502 Code / Adpcm - { "9.20cd", 0x2000, 0xe9919365, 6 | BRF_SND }, // 24 - { "8.20d", 0x2000, 0x49a06454, 6 | BRF_SND }, // 25 - { "7.20b", 0x2000, 0x607a36df, 6 | BRF_SND }, // 26 -}; - -STD_ROM_PICK(hypersptb) -STD_ROM_FN(hypersptb) - -static INT32 HypersptbInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvHypersptb = { - "hypersptb", "hyperspt", NULL, NULL, "1984", - "Hyper Sports (bootleg)\0", "imcomplete sound", "bootleg", "GX330", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, hypersptbRomInfo, hypersptbRomName, NULL, NULL, HypersptInputInfo, HypersptDIPInfo, - HypersptbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Hyper Olympic '84 - -static struct BurnRomInfo hpolym84RomDesc[] = { - { "c01", 0x2000, 0x0c720eeb, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "c02", 0x2000, 0x560258e0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "c03", 0x2000, 0x9b01c7e6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "330e04.bin", 0x2000, 0x9c5e2934, 1 | BRF_PRG | BRF_ESS }, // 3 - { "c05", 0x2000, 0xb105a8cd, 1 | BRF_PRG | BRF_ESS }, // 4 - { "c06", 0x2000, 0x1a34a849, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "c10", 0x2000, 0x3dc1a6ff, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - { "c09", 0x2000, 0x9b525c3e, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "c14", 0x2000, 0xc72d63be, 3 | BRF_GRA }, // 8 Background Tiles - { "c13", 0x2000, 0x76565608, 3 | BRF_GRA }, // 9 - { "c12", 0x2000, 0x74d2cc69, 3 | BRF_GRA }, // 10 - { "c11", 0x2000, 0x66cbcb4d, 3 | BRF_GRA }, // 11 - { "c18", 0x2000, 0xed25e669, 3 | BRF_GRA }, // 12 - { "c17", 0x2000, 0xb145b39f, 3 | BRF_GRA }, // 13 - { "c16", 0x2000, 0xd7ff9f2b, 3 | BRF_GRA }, // 14 - { "c15", 0x2000, 0xf3d454e6, 3 | BRF_GRA }, // 15 - - { "c26", 0x2000, 0xa6897eac, 4 | BRF_GRA }, // 16 Sprites - { "330e24.bin", 0x2000, 0xf9bbfe1d, 4 | BRF_GRA }, // 17 - { "c22", 0x2000, 0xed9271a0, 4 | BRF_GRA }, // 18 - { "330e20.bin", 0x2000, 0x29969b92, 4 | BRF_GRA }, // 19 - - { "c03_c27.bin", 0x0020, 0xbc8a5956, 5 | BRF_GRA }, // 20 Color Proms - { "j12_c28.bin", 0x0100, 0x2c891d59, 5 | BRF_GRA }, // 21 - { "a09_c29.bin", 0x0100, 0x811a3f3f, 5 | BRF_GRA }, // 22 - - { "c08", 0x2000, 0xe8f8ea78, 6 | BRF_GRA }, // 23 VLM Samples -}; - -STD_ROM_PICK(hpolym84) -STD_ROM_FN(hpolym84) - -struct BurnDriver BurnDrvHpolym84 = { - "hpolym84", "hyperspt", NULL, NULL, "1984", - "Hyper Olympic '84\0", NULL, "Konami", "GX330", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, hpolym84RomInfo, hpolym84RomName, NULL, NULL, HypersptInputInfo, HypersptDIPInfo, - HypersptInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Road Fighter (set 1) - -static struct BurnRomInfo roadfRomDesc[] = { - { "g05_g01.bin", 0x2000, 0xe2492a06, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "g07_f02.bin", 0x2000, 0x0bf75165, 1 | BRF_PRG | BRF_ESS }, // 1 - { "g09_g03.bin", 0x2000, 0xdde401f8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "g11_f04.bin", 0x2000, 0xb1283c77, 1 | BRF_PRG | BRF_ESS }, // 3 - { "g13_f05.bin", 0x2000, 0x0ad4d796, 1 | BRF_PRG | BRF_ESS }, // 4 - { "g15_f06.bin", 0x2000, 0xfa42e0ed, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "a17_d10.bin", 0x2000, 0xc33c927e, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "j19_e14.bin", 0x4000, 0x16d2bcff, 3 | BRF_GRA }, // 7 Background Tiles - { "g19_e18.bin", 0x4000, 0x490685ff, 3 | BRF_GRA }, // 8 - - { "a14_e26.bin", 0x4000, 0xf5c738e2, 4 | BRF_GRA }, // 9 Sprites - { "a12_d24.bin", 0x2000, 0x2d82c930, 4 | BRF_GRA }, // 10 - { "c14_e22.bin", 0x4000, 0xfbcfbeb9, 4 | BRF_GRA }, // 11 - { "c12_d20.bin", 0x2000, 0x5e0cf994, 4 | BRF_GRA }, // 12 - - { "c03_c27.bin", 0x0020, 0x45d5e352, 5 | BRF_GRA }, // 13 Color Proms - { "j12_c28.bin", 0x0100, 0x2955e01f, 5 | BRF_GRA }, // 14 - { "a09_c29.bin", 0x0100, 0x5b3b5f2a, 5 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(roadf) -STD_ROM_FN(roadf) - -static INT32 RoadfInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvRoadf = { - "roadf", NULL, NULL, NULL, "1984", - "Road Fighter (set 1)\0", NULL, "Konami", "GX461", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_RACING, 0, - NULL, roadfRomInfo, roadfRomName, NULL, NULL, RoadfInputInfo, RoadfDIPInfo, - RoadfInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Road Fighter (set 2) - -static struct BurnRomInfo roadf2RomDesc[] = { - { "5g", 0x2000, 0xd8070d30, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "6g", 0x2000, 0x8b661672, 1 | BRF_PRG | BRF_ESS }, // 1 - { "8g", 0x2000, 0x714929e8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "11g", 0x2000, 0x0f2c6b94, 1 | BRF_PRG | BRF_ESS }, // 3 - { "g13_f05.bin", 0x2000, 0x0ad4d796, 1 | BRF_PRG | BRF_ESS }, // 4 - { "g15_f06.bin", 0x2000, 0xfa42e0ed, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "a17_d10.bin", 0x2000, 0xc33c927e, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "j19_e14.bin", 0x4000, 0x16d2bcff, 3 | BRF_GRA }, // 7 Background Tiles - { "g19_e18.bin", 0x4000, 0x490685ff, 3 | BRF_GRA }, // 8 - - { "a14_e26.bin", 0x4000, 0xf5c738e2, 4 | BRF_GRA }, // 9 Sprites - { "a12_d24.bin", 0x2000, 0x2d82c930, 4 | BRF_GRA }, // 10 - { "c14_e22.bin", 0x4000, 0xfbcfbeb9, 4 | BRF_GRA }, // 11 - { "c12_d20.bin", 0x2000, 0x5e0cf994, 4 | BRF_GRA }, // 12 - - { "c03_c27.bin", 0x0020, 0x45d5e352, 5 | BRF_GRA }, // 13 Color Proms - { "j12_c28.bin", 0x0100, 0x2955e01f, 5 | BRF_GRA }, // 14 - { "a09_c29.bin", 0x0100, 0x5b3b5f2a, 5 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(roadf2) -STD_ROM_FN(roadf2) - -struct BurnDriver BurnDrvRoadf2 = { - "roadf2", "roadf", NULL, NULL, "1984", - "Road Fighter (set 2)\0", NULL, "Konami", "GX461", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_RACING, 0, - NULL, roadf2RomInfo, roadf2RomName, NULL, NULL, RoadfInputInfo, RoadfDIPInfo, - RoadfInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Road Fighter (set 3, conversion hack on Hyper Sports PCB) - -static struct BurnRomInfo roadf3RomDesc[] = { - { "1-2.g7", 0x4000, 0x93b168f2, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "3-4.g11", 0x4000, 0xb9ba77f0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5-6.g15", 0x4000, 0x91c1788b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "sound7.a9", 0x2000, 0xc33c927e, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "j19.bin", 0x2000, 0x5eeb0283, 3 | BRF_GRA }, // 4 Background Tiles - { "j18.bin", 0x2000, 0x43c1590d, 3 | BRF_GRA }, // 5 - { "g19.bin", 0x2000, 0xf2819ef3, 3 | BRF_GRA }, // 6 - { "g18.bin", 0x2000, 0xdbd1d844, 3 | BRF_GRA }, // 7 - - { "a14.bin", 0x2000, 0x0b595c1e, 4 | BRF_GRA }, // 8 Sprites - { "a13.bin", 0x2000, 0x4f0acc76, 4 | BRF_GRA }, // 9 - { "a12.bin", 0x2000, 0x2d82c930, 4 | BRF_GRA }, // 10 - { "c14.bin", 0x2000, 0x412a9dda, 4 | BRF_GRA }, // 11 - { "c13.bin", 0x2000, 0x0c2d50ae, 4 | BRF_GRA }, // 12 - { "c12.bin", 0x2000, 0x5e0cf994, 4 | BRF_GRA }, // 13 - - { "6331.c3", 0x0020, 0x45d5e352, 5 | BRF_GRA }, // 14 Color Proms - { "82s129.j12", 0x0100, 0x2955e01f, 5 | BRF_GRA }, // 15 - { "82s129.a9", 0x0100, 0x5b3b5f2a, 5 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(roadf3) -STD_ROM_FN(roadf3) - -static INT32 Roadf3Init() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvRoadf3 = { - "roadf3", "roadf", NULL, NULL, "1984", - "Road Fighter (set 3, conversion hack on Hyper Sports PCB)\0", NULL, "hack", "GX330", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_RACING, 0, - NULL, roadf3RomInfo, roadf3RomName, NULL, NULL, RoadfInputInfo, RoadfDIPInfo, - Roadf3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_ironhors.cpp b/jan/src/burn/drv/konami/d_ironhors.cpp deleted file mode 100644 index cdd215de9..000000000 --- a/jan/src/burn/drv/konami/d_ironhors.cpp +++ /dev/null @@ -1,766 +0,0 @@ -// FB Alpha IronHorse driver module -// Based on MAME driver by Mirko Buffoni - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "konamiic.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvM6809RAM0; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvM6809RAM1; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvCharBank; -static UINT8 *DrvIRQEnable; -static UINT8 *DrvScrollRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 soundlatch; -static UINT8 palettebank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DairesyaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Dairesya) - - -static struct BurnInputInfo IronhorsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Ironhors) - -static struct BurnDIPInfo IronhorsDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x5a, NULL }, - {0x16, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 16, "Free Play" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, ":1,2,3,4" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x15, 0x01, 0x04, 0x00, "Upright" }, -// {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "30K 70K+" }, - {0x15, 0x01, 0x18, 0x10, "40K 80K+" }, - {0x15, 0x01, 0x18, 0x08, "40K" }, - {0x15, 0x01, 0x18, 0x00, "50K" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x01, 0x00, "Off" }, -// {0x16, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Button Layout" }, - {0x16, 0x01, 0x04, 0x04, "Power Attack Squat" }, - {0x16, 0x01, 0x04, 0x00, "Squat Attack Power" }, -}; - -STDDIPINFO(Ironhors) - -static void ironhors_main_write(UINT16 address, UINT8 data) -{ - if (address & 0xf000) { - return; // nop - } - - switch (address) - { - case 0x0800: - soundlatch = data; - return; - - case 0x0900: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x0a00: - palettebank = data & 0x07; - return; - - case 0x0b00: - // flipscreen = data & 0x08; - return; - } -} - -static UINT8 ironhors_main_read(UINT16 address) -{ - switch (address) - { - case 0x0900: - return DrvDips[2]; - - case 0x0a00: - return DrvDips[1]; - - case 0x0b00: - return DrvDips[0]; - - case 0x0b01: - return DrvInputs[2]; - - case 0x0b02: - return DrvInputs[1]; - - case 0x0b03: - return DrvInputs[0]; - } - - return 0; -} - -static UINT8 __fastcall ironhors_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static void __fastcall ironhors_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - BurnYM2203Write(0, port & 1, data); - return; - } -} - -static UINT8 __fastcall ironhors_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM2203Read(0, port & 1); - } - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3072000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3072000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - BurnYM2203Reset(); - ZetClose(); - - soundlatch = 0; - palettebank = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x00c000; - - DrvZ80ROM = Next; Next += 0x004000; - - DrvGfxROM = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000500; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM0 = Next; Next += 0x000100; - DrvColRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvM6809RAM1 = Next; Next += 0x000800; - DrvSprRAM0 = Next; Next += 0x000800; - DrvSprRAM1 = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000400; - - RamEnd = Next; - - DrvCharBank = DrvM6809RAM0 + 0x00003; - DrvIRQEnable = DrvM6809RAM0 + 0x00004; - DrvScrollRAM = DrvM6809RAM0 + 0x00020; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *src, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i-=2) { - src[i+0] = src[i/2] >> 4; - src[i+1] = src[i/2] & 0xf; - } -} - -static void DrvPaletteInit() -{ - UINT32 pens[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[i + 0x000] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i + 0x000] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i + 0x000] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i + 0x000] >> 3) & 0x01; - INT32 r = (bit3 * 138) + (bit2 * 69) + (bit1 * 33) + (bit0 * 15); - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - INT32 g = (bit3 * 138) + (bit2 * 69) + (bit1 * 33) + (bit0 * 15); - - bit0 = (DrvColPROM[i + 0x200] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x200] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x200] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x200] >> 3) & 0x01; - INT32 b = (bit3 * 138) + (bit2 * 69) + (bit1 * 33) + (bit0 * 15); - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) - { - for (INT32 j = 0; j < 8; j++) - { - UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (DrvColPROM[i+0x300] & 0x0f); - DrvPalette[((i & 0x100) << 3) | (j << 8) | (i & 0xff)] = pens[ctabentry]; - } - } -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(30.0); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x00000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x00001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x10000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x10001, 6, 2)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 11, 1)) return 1; - - DrvGfxExpand(DrvGfxROM, 0x20000); - DrvPaletteInit(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM0, 0x0000, 0x00ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x2000, 0x23ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x2400, 0x27ff, MAP_RAM); - M6809MapMemory(DrvM6809RAM1, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvSprRAM1, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvSprRAM0, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM, 0x4000, 0xffff, MAP_RAM); - M6809SetWriteHandler(ironhors_main_write); - M6809SetReadHandler(ironhors_main_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x4000, 0x43ff, MAP_RAM); - ZetSetReadHandler(ironhors_sound_read); - ZetSetOutHandler(ironhors_sound_write_port); - ZetSetInHandler(ironhors_sound_read_port); - ZetClose(); - - BurnYM2203Init(1, 3072000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3072000); - BurnYM2203SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 1.00); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2203Exit(); - - M6809Exit(); - ZetExit(); - - GenericTilesExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - INT32 bank = DrvCharBank[0] & 3; - - for (INT32 offs = 32*2; offs < (32 * 32) - (32 * 2); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sx -= (DrvScrollRAM[(sy/8)] + 8) & 0xff; - if (sx < -7) sx += 256; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + ((attr & 0x40) << 2) + ((attr & 0x20) << 4) + (bank << 10); - INT32 color = (attr & 0x0f) + (palettebank << 4); - INT32 flipx = (attr & 0x10); - INT32 flipy = (attr & 0x20); - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM); - } - } - } -} - -static inline void draw_single_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - sy -= 16; - sx -= 8; - - if (sx < -7 || sy < -7 || sx >= nScreenWidth || sy >= nScreenHeight) return; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x800, DrvGfxROM); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x800, DrvGfxROM); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x800, DrvGfxROM); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x800, DrvGfxROM); - } - } -} - -static void draw_sprites() -{ - UINT8 *spriteram = ((DrvCharBank[0] & 8) ? DrvSprRAM0 : DrvSprRAM1); - - for (INT32 offs = 0; offs < 0x100; offs += 5) - { - INT32 sx = spriteram[offs + 3]; - INT32 sy = spriteram[offs + 2]; - INT32 code = (spriteram[offs + 0] << 2) + ((spriteram[offs + 1] & 0x03) << 10) + ((spriteram[offs + 1] & 0x0c) >> 2); - INT32 color = ((spriteram[offs + 1] & 0xf0) >> 4) + (palettebank << 4); - INT32 flipx = spriteram[offs + 4] & 0x20; - INT32 flipy = spriteram[offs + 4] & 0x40; - - switch (spriteram[offs + 4] & 0x0c) - { - case 0x00: // 16x16 - draw_single_sprite((code & ~3)|0, color, (flipx ? (sx + 8) : sx), (flipy ? (sy + 8) : sy), flipx, flipy); - draw_single_sprite((code & ~3)|1, color, (flipx ? sx : (sx + 8)), (flipy ? (sy + 8) : sy), flipx, flipy); - draw_single_sprite((code & ~3)|2, color, (flipx ? (sx + 8) : sx), (flipy ? sy : (sy + 8)), flipx, flipy); - draw_single_sprite((code & ~3)|3, color, (flipx ? sx : (sx + 8)), (flipy ? sy : (sy + 8)), flipx, flipy); - break; - - case 0x04: // 16x8 - draw_single_sprite(code & ~1, color, (flipx ? (sx + 8) : sx), sy, flipx, flipy); - draw_single_sprite(code | 1, color, (flipx ? sx : (sx + 8)), sy, flipx, flipy); - break; - - case 0x08: // 8x16 - draw_single_sprite(code & ~2, color, sx, (flipy ? (sy + 8) : sy), flipx, flipy); - draw_single_sprite(code | 2, color, sx, (flipy ? sy : (sy + 8)), flipx, flipy); - break; - - case 0x0c: // 8x8 - draw_single_sprite(code, color, sx, sy, flipx, flipy); - break; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 3072000 / 30, 3072000 / 30 }; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Run(nCyclesTotal[0] / nInterleave); - - if (i == 240 && (DrvIRQEnable[0] & 0x04)) M6809SetIRQLine(1, CPU_IRQSTATUS_AUTO); // firq - if ((i&0x3f)==0 && (DrvIRQEnable[0] & 0x01)) M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // nmi - - BurnTimerUpdate((i+1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - ZetScan(nAction); - - ZetOpen(0); - BurnYM2203Scan(nAction, pnMin); - ZetClose(); - - SCAN_VAR(soundlatch); - SCAN_VAR(palettebank); - } - - return 0; -} - - -// Iron Horse - -static struct BurnRomInfo ironhorsRomDesc[] = { - { "13c_h03.bin", 0x8000, 0x24539af1, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "12c_h02.bin", 0x4000, 0xfab07f86, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "10c_h01.bin", 0x4000, 0x2b17930f, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "08f_h06.bin", 0x8000, 0xf21d8c93, 3 | BRF_GRA }, // 3 Graphics Tiles - { "07f_h05.bin", 0x8000, 0x60107859, 3 | BRF_GRA }, // 4 - { "09f_h07.bin", 0x8000, 0xc761ec73, 3 | BRF_GRA }, // 5 - { "06f_h04.bin", 0x8000, 0xc1486f61, 3 | BRF_GRA }, // 6 - - { "03f_h08.bin", 0x0100, 0x9f6ddf83, 4 | BRF_GRA }, // 7 Color PROMs - { "04f_h09.bin", 0x0100, 0xe6773825, 4 | BRF_GRA }, // 8 - { "05f_h10.bin", 0x0100, 0x30a57860, 4 | BRF_GRA }, // 9 - { "10f_h12.bin", 0x0100, 0x5eb33e73, 4 | BRF_GRA }, // 10 - { "10f_h11.bin", 0x0100, 0xa63e37d8, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(ironhors) -STD_ROM_FN(ironhors) - -struct BurnDriver BurnDrvIronhors = { - "ironhors", NULL, NULL, NULL, "1986", - "Iron Horse\0", NULL, "Konami", "GX560", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, ironhorsRomInfo, ironhorsRomName, NULL, NULL, IronhorsInputInfo, IronhorsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 240, 224, 4, 3 -}; - - -// Dai Ressya Goutou (Japan) - -static struct BurnRomInfo dairesyaRomDesc[] = { - { "560-k03.13c", 0x8000, 0x2ac6103b, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "560-k02.12c", 0x4000, 0x07bc13a9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "560-j01.10c", 0x4000, 0xa203b223, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "560-j06.8f", 0x8000, 0xa6e8248d, 3 | BRF_GRA }, // 3 Graphics Tiles - { "560-j05.7f", 0x8000, 0xf75893d4, 3 | BRF_GRA }, // 4 - { "560-k07.9f", 0x8000, 0xc8a1b840, 3 | BRF_GRA }, // 5 - { "560-k04.6f", 0x8000, 0xc883d856, 3 | BRF_GRA }, // 6 - - { "03f_h08.bin", 0x0100, 0x9f6ddf83, 4 | BRF_GRA }, // 7 Color PROMs - { "04f_h09.bin", 0x0100, 0xe6773825, 4 | BRF_GRA }, // 8 - { "05f_h10.bin", 0x0100, 0x30a57860, 4 | BRF_GRA }, // 9 - { "10f_h12.bin", 0x0100, 0x5eb33e73, 4 | BRF_GRA }, // 10 - { "10f_h11.bin", 0x0100, 0xa63e37d8, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(dairesya) -STD_ROM_FN(dairesya) - -struct BurnDriver BurnDrvDairesya = { - "dairesya", "ironhors", NULL, NULL, "1986", - "Dai Ressya Goutou (Japan)\0", NULL, "Konami (Kawakusu license)", "GX560", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, dairesyaRomInfo, dairesyaRomName, NULL, NULL, DairesyaInputInfo, IronhorsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 240, 224, 4, 3 -}; - - -// Far West - -static struct BurnRomInfo farwestRomDesc[] = { - { "ironhors.008", 0x4000, 0xb1c8246c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "ironhors.009", 0x8000, 0xea34ecfc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ironhors.007", 0x2000, 0x471182b7, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ironhors.010", 0x4000, 0xa28231a6, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "ironhors.005", 0x8000, 0xf77e5b83, 3 | BRF_GRA }, // 4 Background Tiles - { "ironhors.006", 0x8000, 0x7bbc0b51, 3 | BRF_GRA }, // 5 - - { "ironhors.001", 0x4000, 0xa8fc21d3, 4 | BRF_GRA }, // 6 Sprites - { "ironhors.002", 0x4000, 0x9c1e5593, 4 | BRF_GRA }, // 7 - { "ironhors.003", 0x4000, 0x3a0bf799, 4 | BRF_GRA }, // 8 - { "ironhors.004", 0x4000, 0x1fab18a3, 4 | BRF_GRA }, // 9 - - { "ironcol.003", 0x0100, 0x3e3fca11, 5 | BRF_GRA }, // 10 Color PROMs - { "ironcol.001", 0x0100, 0xdfb13014, 5 | BRF_GRA }, // 11 - { "ironcol.002", 0x0100, 0x77c88430, 5 | BRF_GRA }, // 12 - { "10f_h12.bin", 0x0100, 0x5eb33e73, 5 | BRF_GRA }, // 13 - { "ironcol.005", 0x0100, 0x15077b9c, 5 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(farwest) -STD_ROM_FN(farwest) - -struct BurnDriverD BurnDrvFarwest = { - "farwest", "ironhors", NULL, NULL, "1986", - "Far West\0", NULL, "bootleg?", "GX560", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, farwestRomInfo, farwestRomName, NULL, NULL, IronhorsInputInfo, IronhorsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 240, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_jackal.cpp b/jan/src/burn/drv/konami/d_jackal.cpp deleted file mode 100644 index 96361fde6..000000000 --- a/jan/src/burn/drv/konami/d_jackal.cpp +++ /dev/null @@ -1,1312 +0,0 @@ -// FB Alpha Jackal driver module -// Based on MAME driver by Kenneth Lin - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "burn_ym2151.h" - -static UINT8 *AllMem; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvPalRAM; -static UINT32 *DrvPaletteTab; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; -static UINT8 *AllRam; -static UINT8 *DrvShareRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZRAM; -static UINT8 *DrvVORAM; -static UINT8 *DrvVidControl; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static INT32 DrvZRAMBank; -static INT32 DrvVORAMBank; -static INT32 DrvSprRAMBank; -static INT32 DrvROMBank; -static INT32 DrvIRQEnable; -static INT32 flipscreen; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static INT32 watchdog; -static INT32 layer_offset_x = 8; -static INT32 layer_offset_y = 16; - -static INT32 bootleg = 0; - -//static INT32 nRotate[2] = { 0, 0 }; -//static UINT32 nRotateTime[2] = { 0, 0 }; -//static UINT8 DrvFakeInput[4] = { 0, 0, 0, 0 }; -// Rotation stuff! -dink -static UINT8 DrvFakeInput[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 nRotateHoldInput[2] = {0, 0}; -static INT32 nRotate[2] = {0, 0}; -static INT32 nRotateTarget[2] = {0, 0}; -static INT32 nRotateTry[2] = {0, 0}; -static UINT32 nRotateTime[2] = {0, 0}; -static UINT8 game_rotates = 0; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo DrvrotateInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Rotate Left", BIT_DIGITAL, DrvFakeInput + 0, "p1 rotate left" }, - {"P1 Rotate Right", BIT_DIGITAL, DrvFakeInput + 1, "p1 rotate right" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Rotate Left", BIT_DIGITAL, DrvFakeInput + 2, "p2 rotate left" }, - {"P2 Rotate Right", BIT_DIGITAL, DrvFakeInput + 3, "p2 rotate right" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Drvrotate) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "30k 150k" }, - {0x13, 0x01, 0x18, 0x10, "50k 200k" }, - {0x13, 0x01, 0x18, 0x08, "30k" }, - {0x13, 0x01, 0x18, 0x00, "50k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound Adjustment" }, - {0x14, 0x01, 0x40, 0x00, "Upright" }, - {0x14, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Sound Mode" }, - {0x14, 0x01, 0x80, 0x00, "Stereo" }, - {0x14, 0x01, 0x80, 0x80, "Mono" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo DrvrotateDIPList[]= -{ - {0x18, 0xff, 0xff, 0xff, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - {0x1a, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x18, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x18, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x18, 0x01, 0x0f, 0x06, "2 Coins 1 Credit" }, - {0x18, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x18, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x18, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x18, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x18, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x18, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x18, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x18, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x18, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x18, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x18, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x18, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x18, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x18, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x18, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x18, 0x01, 0xf0, 0x60, "2 Coins 1 Credit" }, - {0x18, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x18, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x18, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x18, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x18, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x18, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x18, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x18, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x18, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x18, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x18, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x18, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x18, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x19, 0x01, 0x03, 0x03, "2" }, - {0x19, 0x01, 0x03, 0x02, "3" }, - {0x19, 0x01, 0x03, 0x01, "4" }, - {0x19, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x19, 0x01, 0x18, 0x18, "30k 150k" }, - {0x19, 0x01, 0x18, 0x10, "50k 200k" }, - {0x19, 0x01, 0x18, 0x08, "30k" }, - {0x19, 0x01, 0x18, 0x00, "50k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x19, 0x01, 0x60, 0x60, "Easy" }, - {0x19, 0x01, 0x60, 0x40, "Normal" }, - {0x19, 0x01, 0x60, 0x20, "Difficult" }, - {0x19, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x19, 0x01, 0x80, 0x80, "Off" }, - {0x19, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1a, 0x01, 0x20, 0x20, "Off" }, - {0x1a, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound Adjustment" }, - {0x1a, 0x01, 0x40, 0x00, "Upright" }, - {0x1a, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Sound Mode" }, - {0x1a, 0x01, 0x80, 0x00, "Stereo" }, - {0x1a, 0x01, 0x80, 0x80, "Mono" }, -}; - -STDDIPINFO(Drvrotate) - -// Rotation-handler code - -static void RotateReset() { - for (INT32 playernum = 0; playernum < 2; playernum++) { - nRotate[playernum] = 0; // start out pointing straight up (0=up) - nRotateTarget[playernum] = -1; - nRotateTime[playernum] = 0; - nRotateHoldInput[0] = nRotateHoldInput[1] = 0; - } -} - -static UINT32 RotationTimer(void) { - return nCurrentFrame; -} - -static void RotateRight(INT32 *v) { - (*v)++; - if (*v > 7) *v = 0; -} - -static void RotateLeft(INT32 *v) { - (*v)--; - if (*v < 0) *v = 7; -} - -static UINT8 Joy2Rotate(UINT8 *joy) { // ugly code, but the effect is awesome. -dink - if (joy[2] && joy[0]) return 7; // up left - if (joy[2] && joy[1]) return 1; // up right - - if (joy[3] && joy[0]) return 5; // down left - if (joy[3] && joy[1]) return 3; // down right - - if (joy[2]) return 0; // up - if (joy[3]) return 4; // down - if (joy[0]) return 6; // left - if (joy[1]) return 2; // right - - return 0xff; -} - -static int dialRotation(INT32 playernum) { - // p1 = 0, p2 = 1 - UINT8 player[2] = { 0, 0 }; - static UINT8 lastplayer[2][2] = { { 0, 0 }, { 0, 0 } }; - - if ((playernum != 0) && (playernum != 1)) { - bprintf(PRINT_NORMAL, _T("Strange Rotation address => %06X\n"), playernum); - return 0; - } - if (playernum == 0) { - player[0] = DrvFakeInput[0]; player[1] = DrvFakeInput[1]; - } - if (playernum == 1) { - player[0] = DrvFakeInput[2]; player[1] = DrvFakeInput[3]; - } - - if (player[0] && (player[0] != lastplayer[playernum][0] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateLeft(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Left => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - if (player[1] && (player[1] != lastplayer[playernum][1] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateRight(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Right => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - lastplayer[playernum][0] = player[0]; - lastplayer[playernum][1] = player[1]; - - return ~(1 << nRotate[playernum]); -} - -static UINT8 *rotate_gunpos[2] = {NULL, NULL}; -static UINT8 rotate_gunpos_multiplier = 1; - -// Gun-rotation memory locations - do not remove this tag. - dink :) -// game p1 p2 clockwise value in memory multiplier -// jackal 0xbd8 0xc00 0 1 2 3 4 5 6 7 1 -// topgunbl SAME - -static void RotateSetGunPosRAM(UINT8 *p1, UINT8 *p2, UINT8 multiplier) { - rotate_gunpos[0] = p1; - rotate_gunpos[1] = p2; - rotate_gunpos_multiplier = multiplier; -} - -static INT32 get_distance(INT32 from, INT32 to) { -// this function finds the easiest way to get from "from" to "to", wrapping at 0 and 7 - INT32 countA = 0; - INT32 countB = 0; - INT32 fromtmp = from / rotate_gunpos_multiplier; - INT32 totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp++; - countA++; - if(fromtmp>7) fromtmp = 0; - if(fromtmp == totmp || countA > 32) break; - } - - fromtmp = from / rotate_gunpos_multiplier; - totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp--; - countB++; - if(fromtmp<0) fromtmp = 7; - if(fromtmp == totmp || countB > 32) break; - } - - if (countA > countB) { - return 1; // go negative - } else { - return 0; // go positive - } -} - -static void RotateDoTick() { - // since the game only allows for 1 rotation every other frame, we have to - // do this. - if (nCurrentFrame&1) return; - - for (INT32 i = 0; i < 2; i++) { - if (rotate_gunpos[i] && (nRotateTarget[i] != -1) && (nRotateTarget[i] != (*rotate_gunpos[i] & 0xff))) { - if (get_distance(nRotateTarget[i], *rotate_gunpos[i] & 0xff)) { - RotateRight(&nRotate[i]); // -- - } else { - RotateLeft(&nRotate[i]); // ++ - } - bprintf(0, _T("p%X target %X mempos %X nRotate %X.\n"), i, nRotateTarget[i], *rotate_gunpos[i] & 0xff, nRotate[i]); - nRotateTry[i]++; - if (nRotateTry[i] > 10) nRotateTarget[i] = -1; // don't get stuck in a loop if something goes horribly wrong here. - } else { - nRotateTarget[i] = -1; - } - } -} - -static void SuperJoy2Rotate() { - for (INT32 i = 0; i < 2; i++) { // p1 = 0, p2 = 1 - if (DrvFakeInput[4 + i]) { // rotate-button had been pressed - UINT8 rot = Joy2Rotate(((!i) ? &DrvJoy1[0] : &DrvJoy2[0])); - if (rot != 0xff) { - nRotateTarget[i] = rot * rotate_gunpos_multiplier; - } - //DrvInput[i] &= ~0xf; // cancel out directionals since they are used to rotate here. - DrvInputs[i] = (DrvInputs[i] & ~0xf) | (nRotateHoldInput[i] & 0xf); // for midnight resistance! be able to duck + change direction of gun. - nRotateTry[i] = 0; - } else { // cache joystick UDLR if the rotate button isn't pressed. - // This feature is for Midnight Resistance, if you are crawling on the - // ground and need to rotate your gun WITHOUT getting up. - nRotateHoldInput[i] = DrvInputs[i]; - } - } - - RotateDoTick(); -} - -// end Rotation-handler - -static void bankswitch() -{ - INT32 banks[3] = { DrvVORAMBank * 0x1000, DrvSprRAMBank * 0x1000, DrvROMBank * 0x8000 }; - - M6809MapMemory(DrvVORAM + banks[0], 0x2000, 0x2fff, MAP_RAM); - M6809MapMemory(DrvSprRAM + banks[1], 0x3000, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0 + 0x10000 + banks[2], 0x4000, 0xbfff, MAP_ROM); -} - -static void jackal_main_write(UINT16 address, UINT8 data) -{ - if (address >= 0x0020 && address <= 0x005f) { - DrvZRAM[(address - 0x20) + DrvZRAMBank] = data; - return; - } - - if (address >= 0x0060 && address <= 0x1fff) { - DrvShareRAM[address] = data; - return; - } - - switch (address) - { - case 0x0000: - case 0x0001: - case 0x0002: - case 0x0003: - DrvVidControl[address] = data; - return; - - case 0x0004: - flipscreen = data & 0x08; - DrvIRQEnable = data & 0x02; - return; - - case 0x0019: - watchdog = 0; - return; - - case 0x001c: - DrvSprRAMBank = (data & 0x08) >> 3; - DrvZRAMBank = (data & 0x10) << 2; // 0x40 - DrvROMBank = (data & 0x20) >> 5; - DrvVORAMBank = (data & 0x10) >> 4; - bankswitch(); - return; - } -} - -static UINT8 jackal_main_read(UINT16 address) -{ - if (address >= 0x0020 && address <= 0x005f) { - return DrvZRAM[(address - 0x20) + DrvZRAMBank]; - } - - if (address >= 0x0060 && address <= 0x1fff) { - return DrvShareRAM[address]; - } - - switch (address) - { - case 0x0000: // actually read? - case 0x0001: - case 0x0002: - case 0x0003: - return DrvVidControl[address]; - - case 0x0010: - return DrvDips[0]; - - case 0x0011: - return DrvInputs[0]; - - case 0x0012: - return DrvInputs[1]; - - case 0x0013: - return (DrvInputs[2] & 0x1f) | (DrvDips[2] & 0xe0); - - case 0x0014: - case 0x0015: - return dialRotation(address - 0x14); // rotary - - case 0x0018: - return DrvDips[1]; - } - - return 0; -} - -static void jackal_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - BurnYM2151SelectRegister(data); - return; - - case 0x2001: - BurnYM2151WriteRegister(data); - return; - } -} - -static UINT8 jackal_sub_read(UINT16 address) -{ - switch (address) - { - case 0x2000: - case 0x2001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - DrvZRAMBank = 0; - DrvVORAMBank = 0; - DrvSprRAMBank = 0; - DrvROMBank = 0; - DrvIRQEnable = 0; - flipscreen = 0; - - M6809Open(0); - bankswitch(); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - M6809Close(); - - BurnYM2151Reset(); - - RotateReset(); - - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x020000; - DrvM6809ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x140000; - DrvGfxROM1 = Next; Next += 0x180000; - DrvGfxROM2 = Next; Next += 0x180000; - - DrvColPROM = Next; Next += 0x000200; - - DrvPaletteTab = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - AllRam = Next; - - DrvShareRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x004000; - DrvZRAM = Next; Next += 0x000080; - DrvVORAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x000400; - - DrvVidControl = Next; Next += 0x000004; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Planes[8] = { STEP4(0,1), STEP4(0x40000*8, 1) }; - INT32 XOffs[16] = { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, 32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4 }; - //STEP8(0,4), STEP8(32*8, ??) - INT32 YOffs[16] = { STEP8(0,32), STEP8(16*32,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x1000, 8, 8, 8, Planes, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp + 0x00000, tmp + 0x20000, 0x20000); - memcpy (tmp + 0x20000, tmp + 0x60000, 0x20000); - - GfxDecode(0x0800, 4, 16, 16, Planes, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - GfxDecode(0x2000, 4, 8, 8, Planes, XOffs, YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) { - DrvPaletteTab[0x000 + i] = i + 0x100; - DrvPaletteTab[0x100 + i] = DrvColPROM[0x000 + i] & 0xf; - DrvPaletteTab[0x200 + i] = (DrvColPROM[0x100 + i] & 0xf) + 0x10; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (!bootleg) { - // Jackal - if (BurnLoadRom(DrvM6809ROM0 + 0x10000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x0c000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40001, 6, 2)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 8, 1)) return 1; - } else { - // Bootleg - if (BurnLoadRom(DrvM6809ROM0 + 0x10000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x18000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x0c000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x28000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x38000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x48000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x50000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x58000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x68000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x70000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x78000, 19, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 21, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x80000); - } - - DrvGfxDecode(); - DrvPaletteInit(); - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvShareRAM + 0x100, 0x0100, 0x1fff, MAP_RAM); - M6809MapMemory(DrvVORAM, 0x2000, 0x2fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x3000, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0 + 0x0c000, 0xc000, 0xffff, MAP_ROM); - M6809SetWriteHandler(jackal_main_write); - M6809SetReadHandler(jackal_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvPalRAM, 0x4000, 0x43ff, MAP_RAM); - M6809MapMemory(DrvShareRAM, 0x6000, 0x7fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM1 + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(jackal_sub_write); - M6809SetReadHandler(jackal_sub_read); - M6809Close(); - - BurnYM2151Init(3580000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - if (game_rotates) - RotateSetGunPosRAM(DrvShareRAM + 0xbd8, DrvShareRAM + 0xc00, 1); - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - M6809Exit(); - - BurnYM2151Exit(); - - GenericTilesExit(); - - BurnFree(AllMem); - - bootleg = 0; - game_rotates = 1; - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT32 pens[0x200]; - - for (INT32 i = 0; i < 0x200; i++) { - if (i >= 0x20 && i < 0x100) continue; // not used, save cycles - - UINT16 p = (DrvPalRAM[(i * 2)] | (DrvPalRAM[(i * 2) + 1] << 8)); - - UINT8 r = (p >> 0) & 0x1f; - UINT8 g = (p >> 5) & 0x1f; - UINT8 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x300; i++) { - DrvPalette[i] = pens[DrvPaletteTab[i]]; - } -} - -static void draw_layer() -{ - INT32 layer_control = DrvVidControl[2]; - - INT32 xscroll = DrvVidControl[1]; - INT32 yscroll = DrvVidControl[0]; - - UINT8 *scrollram = DrvZRAM; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 attr = DrvVORAM[0x0000 + offs]; - INT32 code = DrvVORAM[0x0400 + offs] + ((attr & 0xc0) << 2) + ((attr & 0x30) << 6); - - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - - INT32 sy = (((offs / 0x20) & 0x1f) * 8) - layer_offset_y; - INT32 sx = ((offs & 0x1f) * 8) - layer_offset_x; - - if (layer_control & 0x02) { - if (layer_control & 0x08) { - sx -= scrollram[(sy + layer_offset_y)/8]; // maybe apply the offset here? I guess we'll know for sure after playtesting. -dink - sy -= yscroll; - } - else if (layer_control & 0x04) { - sy -= scrollram[(sx + layer_offset_x)/8]; // offset applied here fixes the konami logo on the titlescreen. -dink - sx -= xscroll; - } - } else { - sy -= yscroll; - sx -= xscroll; - } - if (sy < -7) sy += 256; - if (sx < -7) sx += 256; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprite(INT32 bank, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - sx -= layer_offset_x; - sy -= layer_offset_y; - color += (bank & 2) ? 0x20 : 0x10; - - if (bank & 8) // 8x8 - { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM2); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM2); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM2); - } - } - } - else // 16x16 - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } - } - } -} - -static void draw_sprites(INT32 rambase, INT32 length, INT32 bank) -{ - const UINT8 *sram = DrvSprRAM + rambase + ((DrvVidControl[3] & 0x08) ? 0x0800 : 0); - - for (INT32 offs = 0; offs < length; offs += 5) - { - INT32 attr = sram[offs + 4]; - INT32 sn1 = sram[offs]; - INT32 sn2 = sram[offs + 1]; - INT32 sy = sram[offs + 2]; - INT32 sx = sram[offs + 3] - ((attr & 1) << 8); - INT32 flipx = attr & 0x20; - INT32 flipy = attr & 0x40; - INT32 color = sn2 >> 4; - - if (sy > 0xf0) sy -= 256; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (attr & 0x0c) - { - INT32 spritenum = sn1 * 4 + ((sn2 & 0x0c) >> 2) + ((sn2 & 3) << 10) + ((bank & 2) << 11); // was << 12 -dink - - INT32 mod = -8; - - if (flipscreen) - { - sx += 8; - sy -= 8; - mod = 8; - } - - if ((attr & 0x0c) == 0x0C) // 1x1 - { - if (flipscreen) sy += 16; - draw_sprite(bank+8, spritenum, color, sx, sy, flipx, flipy); - } - - if ((attr & 0x0c) == 0x08) // 1x2 - { - sy += 8; - draw_sprite(bank+8, spritenum, color, sx, sy, flipx, flipy); - draw_sprite(bank+8, spritenum - 2, color, sx, sy + mod, flipx, flipy); - } - - if ((attr & 0x0c) == 0x04) // 2x1 - { - draw_sprite(bank+8, spritenum, color, sx, sy, flipx, flipy); - draw_sprite(bank+8, spritenum + 1, color, sx + mod, sy, flipx, flipy); - } - } - else - { - INT32 spritenum = sn1 + (((sn2 & 0x03) << 8) + ((bank & 2) << 9)); - - if (attr & 0x10) // 2x2 - { - if (flipscreen) - { - sx -= 16; - sy -= 16; - } - - draw_sprite(bank, spritenum, color, flipx ? sx+16 : sx, flipy ? sy+16 : sy, flipx, flipy); - draw_sprite(bank, spritenum + 1, color, flipx ? sx : sx+16, flipy ? sy+16 : sy, flipx, flipy); - draw_sprite(bank, spritenum + 2, color, flipx ? sx+16 : sx, flipy ? sy : sy+16, flipx, flipy); - draw_sprite(bank, spritenum + 3, color, flipx ? sx : sx+16, flipy ? sy : sy+16, flipx, flipy); - } - else // 1x1 - { - draw_sprite(bank, spritenum, color, sx, sy, flipx, flipy); - } - } - } -} - -static INT32 DrvDraw() -{ - //if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; - //} - BurnTransferClear(); - if (nBurnLayer & 2) draw_layer(); - - if (nBurnLayer & 4) draw_sprites(0x1000, 0x0f5, 2); - if (nBurnLayer & 8) draw_sprites(0x0000, 0x500, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - if (game_rotates) { - SuperJoy2Rotate(); - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 1536000 / 60, ((1536000 * 12) / 10) / 60 }; - INT32 nSoundBufferPos = 0; - - M6809NewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - M6809Run(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1) && DrvIRQEnable) - M6809SetIRQLine(0x00, CPU_IRQSTATUS_AUTO); - M6809Close(); - - M6809Open(1); - M6809Run(nCyclesTotal[1] / nInterleave); - if (i == (nInterleave - 1) && DrvIRQEnable) - M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // nmi - M6809Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029737; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - - BurnYM2151Scan(nAction); - - SCAN_VAR(DrvZRAMBank); - SCAN_VAR(DrvVORAMBank); - SCAN_VAR(DrvSprRAMBank); - SCAN_VAR(DrvROMBank); - SCAN_VAR(DrvIRQEnable); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(); - M6809Close(); - } - - return 0; -} - -// Jackal (World, 8-way Joystick) - -static struct BurnRomInfo jackalRomDesc[] = { - { "631_v02.15d", 0x10000, 0x0b7e0584, 0 | BRF_PRG | BRF_ESS }, // 0 - M6809 #0 Code - { "631_v03.16d", 0x04000, 0x3e0dfb83, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "631_t01.11d", 0x08000, 0xb189af6a, 1 | BRF_PRG | BRF_ESS }, // 2 - M6809 #1 Code - - { "631t04.7h", 0x20000, 0x457f42f0, 2 | BRF_GRA }, // 3 - Graphics Tiles - { "631t05.8h", 0x20000, 0x732b3fc1, 2 | BRF_GRA }, // 4 - { "631t06.12h", 0x20000, 0x2d10e56e, 2 | BRF_GRA }, // 5 - { "631t07.13h", 0x20000, 0x4961c397, 2 | BRF_GRA }, // 6 - - { "631r08.9h", 0x00100, 0x7553a172, 3 | BRF_GRA }, // 7 - Color PROMs - { "631r09.14h", 0x00100, 0xa74dd86c, 3 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(jackal) -STD_ROM_FN(jackal) - -// Jackal (World, Rotary Joystick) - -static struct BurnRomInfo jackalrRomDesc[] = { - { "631_q02.15d", 0x10000, 0xed2a7d66, 0 | BRF_PRG | BRF_ESS }, // 0 - M6809 #0 Code - { "631_q03.16d", 0x04000, 0xb9d34836, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "631_q01.11d", 0x08000, 0x54aa2d29, 1 | BRF_PRG | BRF_ESS }, // 2 - M6809 #1 Code - - { "631t04.7h", 0x20000, 0x457f42f0, 2 | BRF_GRA }, // 3 - Graphics Tiles - { "631t05.8h", 0x20000, 0x732b3fc1, 2 | BRF_GRA }, // 4 - { "631t06.12h", 0x20000, 0x2d10e56e, 2 | BRF_GRA }, // 5 - { "631t07.13h", 0x20000, 0x4961c397, 2 | BRF_GRA }, // 6 - - { "631r08.9h", 0x00100, 0x7553a172, 3 | BRF_GRA }, // 7 - Color PROMs - { "631r09.14h", 0x00100, 0xa74dd86c, 3 | BRF_GRA }, // 7 - Color PROMs -}; - -STD_ROM_PICK(jackalr) -STD_ROM_FN(jackalr) - -// Tokushu Butai Jackal (Japan, 8-way Joystick) - -static struct BurnRomInfo jackaljRomDesc[] = { - { "631_t02.15d", 0x10000, 0x14db6b1a, 0 | BRF_PRG | BRF_ESS }, // 0 - M6809 #0 Code - { "631_t03.16d", 0x04000, 0xfd5f9624, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "631_t01.11d", 0x08000, 0xb189af6a, 1 | BRF_PRG | BRF_ESS }, // 2 - M6809 #1 Code - - { "631t04.7h", 0x20000, 0x457f42f0, 2 | BRF_GRA }, // 3 - Graphics Tiles - { "631t05.8h", 0x20000, 0x732b3fc1, 2 | BRF_GRA }, // 4 - { "631t06.12h", 0x20000, 0x2d10e56e, 2 | BRF_GRA }, // 5 - { "631t07.13h", 0x20000, 0x4961c397, 2 | BRF_GRA }, // 6 - - { "631r08.9h", 0x00100, 0x7553a172, 3 | BRF_GRA }, // 7 - Color PROMs - { "631r09.14h", 0x00100, 0xa74dd86c, 3 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(jackalj) -STD_ROM_FN(jackalj) - -// Jackal (bootleg, Rotary Joystick) -// This is based on jackalr. Was dumped from 2 different PCBs. - -static struct BurnRomInfo jackalblRomDesc[] = { - { "EPR-A-3.BIN", 0x8000, 0x5fffee27, 0 | BRF_PRG | BRF_ESS }, // 0 - M6809 #0 Code - { "EPR-A-4.BIN", 0x8000, 0x976c8431, 0 | BRF_PRG | BRF_ESS }, // 1 - { "EPR-A-2.BIN", 0x4000, 0xae2a290a, 0 | BRF_PRG | BRF_ESS }, // 2 - - { "EPR-A-1.BIN", 0x8000, 0x54aa2d29, 1 | BRF_PRG | BRF_ESS }, // 3 - M6809 #1 Code - - { "EPR-A-17.BIN", 0x8000, 0xa96720b6, 2 | BRF_GRA }, // 4 - Graphics Tiles - { "EPR-A-18.BIN", 0x8000, 0x932d0ecb, 2 | BRF_GRA }, // 5 - { "EPR-A-19.BIN", 0x8000, 0x1e3412e7, 2 | BRF_GRA }, // 6 - { "EPR-A-20.BIN", 0x8000, 0x4b0d15be, 2 | BRF_GRA }, // 7 - { "EPR-A-6.BIN", 0x8000, 0xec7141ad, 2 | BRF_GRA }, // 8 - { "EPR-A-5.BIN", 0x8000, 0xc6375c74, 2 | BRF_GRA }, // 9 - { "EPR-A-7.BIN", 0x8000, 0x03e1de04, 2 | BRF_GRA }, // 10 - { "EPR-A-8.BIN", 0x8000, 0xf946ada7, 2 | BRF_GRA }, // 11 - { "EPR-A-13.BIN", 0x8000, 0x7c29c59e, 2 | BRF_GRA }, // 12 - { "EPR-A-14.BIN", 0x8000, 0xf2bbff39, 2 | BRF_GRA }, // 13 - { "EPR-A-15.BIN", 0x8000, 0x594dbaaf, 2 | BRF_GRA }, // 14 - { "EPR-A-16.BIN", 0x8000, 0x069bf945, 2 | BRF_GRA }, // 15 - { "EPR-A-9.BIN", 0x8000, 0xc00cef79, 2 | BRF_GRA }, // 16 - { "EPR-A-10.BIN", 0x8000, 0x0aed6cd7, 2 | BRF_GRA }, // 17 - { "EPR-A-11.BIN", 0x8000, 0xa48e9f60, 2 | BRF_GRA }, // 18 - { "EPR-A-12.BIN", 0x8000, 0x79b7c71c, 2 | BRF_GRA }, // 19 - - { "n82s129n.prom2", 0x0100, 0x7553a172, 3 | BRF_GRA }, // 20 - Color PROMs - { "n82s129n.prom1", 0x0100, 0xa74dd86c, 3 | BRF_GRA }, // 21 - - /* currently not used by the emulation */ - { "pal16r6cn.pal1", 0x0104, 0x9bba948f, 4 | BRF_OPT }, // 22 - Pals - { "ampal16l8pc.pal2", 0x0104, 0x17c9de2f, 4 | BRF_OPT }, // 23 - { "ampal16r4pc.pal3", 0x0104, 0xe54cd288, 4 | BRF_OPT }, // 24 - { "pal16r8acn.pal4", 0x0104, 0x5cc45e00, 4 | BRF_OPT }, // 25 - { "pal20l8a-2cns.pal5", 0x0144, 0x00000000, 4 | BRF_OPT | BRF_NODUMP }, // 26 - { "pal20l8acns.pal6", 0x0144, 0x00000000, 4 | BRF_OPT | BRF_NODUMP }, // 27 - { "pal16l8pc.pal7", 0x0104, 0xe8cdc259, 4 | BRF_OPT }, // 28 - { "d5c121.ep1200", 0x0200, 0x00000000, 4 | BRF_OPT | BRF_NODUMP }, // 29 -}; - -STD_ROM_PICK(jackalbl) -STD_ROM_FN(jackalbl) - -// Top Gunner (US, 8-way Joystick) - -static struct BurnRomInfo topgunrRomDesc[] = { - { "631_u02.15d", 0x10000, 0xf7e28426, 0 | BRF_PRG | BRF_ESS }, // 0 - M6809 #0 Code - { "631_u03.16d", 0x04000, 0xc086844e, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "631_t01.11d", 0x08000, 0xb189af6a, 1 | BRF_PRG | BRF_ESS }, // 2 - M6809 #1 Code - - { "631u04.7h", 0x20000, 0x50122a12, 2 | BRF_GRA }, // 3 - Graphics Tiles - { "631u05.8h", 0x20000, 0x6943b1a4, 2 | BRF_GRA }, // 4 - { "631u06.12h", 0x20000, 0x37dbbdb0, 2 | BRF_GRA }, // 5 - { "631u07.13h", 0x20000, 0x22effcc8, 2 | BRF_GRA }, // 6 - - { "631r08.9h", 0x00100, 0x7553a172, 3 | BRF_GRA }, // 7 - Color PROMs - { "631r09.14h", 0x00100, 0xa74dd86c, 3 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(topgunr) -STD_ROM_FN(topgunr) - -// Top Gunner (bootleg, Rotary Joystick) - -static struct BurnRomInfo topgunblRomDesc[] = { - { "t-3.c5", 0x8000, 0x7826ad38, 0 | BRF_PRG | BRF_ESS }, // 0 - M6809 #0 Code - { "t-4.c4", 0x8000, 0x976c8431, 0 | BRF_PRG | BRF_ESS }, // 1 - { "t-2.c6", 0x4000, 0xd53172e5, 0 | BRF_PRG | BRF_ESS }, // 2 - - { "t-1.c14", 0x8000, 0x54aa2d29, 1 | BRF_PRG | BRF_ESS }, // 3 - M6809 #1 Code - - { "t-17.n12", 0x8000, 0xe8875110, 2 | BRF_GRA }, // 4 - Graphics Tiles - { "t-18.n13", 0x8000, 0xcf14471d, 2 | BRF_GRA }, // 5 - { "t-19.n14", 0x8000, 0x46ee5dd2, 2 | BRF_GRA }, // 6 - { "t-20.n15", 0x8000, 0x3f472344, 2 | BRF_GRA }, // 7 - { "t-6.n1", 0x8000, 0x539cc48c, 2 | BRF_GRA }, // 8 - { "t-5.m1", 0x8000, 0xdbc26afe, 2 | BRF_GRA }, // 9 - { "t-7.n2", 0x8000, 0x0ecd31b1, 2 | BRF_GRA }, // 10 - { "t-8.n3", 0x8000, 0xf946ada7, 2 | BRF_GRA }, // 11 - { "t-13.n8", 0x8000, 0x5d669abb, 2 | BRF_GRA }, // 12 - { "t-14.n9", 0x8000, 0xf349369b, 2 | BRF_GRA }, // 13 - { "t-15.n10", 0x8000, 0x7c5a91dd, 2 | BRF_GRA }, // 14 - { "t-16.n11", 0x8000, 0x5ec46d8e, 2 | BRF_GRA }, // 15 - { "t-9.n4", 0x8000, 0x8269caca, 2 | BRF_GRA }, // 16 - { "t-10.n5", 0x8000, 0x25393e4f, 2 | BRF_GRA }, // 17 - { "t-11.n6", 0x8000, 0x7895c22d, 2 | BRF_GRA }, // 18 - { "t-12.n7", 0x8000, 0x15606dfc, 2 | BRF_GRA }, // 19 - - { "631r08.bpr", 0x0100, 0x7553a172, 3 | BRF_GRA }, // 20 - Color PROMs - { "631r09.bpr", 0x0100, 0xa74dd86c, 3 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(topgunbl) -STD_ROM_FN(topgunbl) - -INT32 DrvInitbl() -{ - bootleg = 1; - game_rotates = 1; - - return DrvInit(); -} - -INT32 DrvInitRo() -{ - game_rotates = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvJackal = { - "jackal", NULL, NULL, NULL, "1986", - "Jackal (World, 8-way Joystick)\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, jackalRomInfo, jackalRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvJackalr = { - "jackalr", "jackal", NULL, NULL, "1986", - "Jackal (World, Rotary Joystick)\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, jackalrRomInfo, jackalrRomName, NULL, NULL, DrvrotateInputInfo, DrvrotateDIPInfo, - DrvInitRo, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvJackalj = { - "jackalj", "jackal", NULL, NULL, "1986", - "Tokushu Butai Jackal (Japan, 8-way Joystick)\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, jackaljRomInfo, jackaljRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvJackalbl = { - "jackalbl", "jackal", NULL, NULL, "1986", - "Jackal (bootleg, Rotary Joystick)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, jackalblRomInfo, jackalblRomName, NULL, NULL, DrvrotateInputInfo, DrvrotateDIPInfo, - DrvInitbl, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvTopgunr = { - "topgunr", "jackal", NULL, NULL, "1986", - "Top Gunner (US, 8-way Joystick)\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, topgunrRomInfo, topgunrRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvTopgunbl = { - "topgunbl", "jackal", NULL, NULL, "1986", - "Top Gunner (bootleg, Rotary Joystick)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, topgunblRomInfo, topgunblRomName, NULL, NULL, DrvrotateInputInfo, DrvrotateDIPInfo, - DrvInitbl, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 240, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_jailbrek.cpp b/jan/src/burn/drv/konami/d_jailbrek.cpp deleted file mode 100644 index 639013785..000000000 --- a/jan/src/burn/drv/konami/d_jailbrek.cpp +++ /dev/null @@ -1,721 +0,0 @@ -// FB Alpha Jailbreak driver module -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "vlm5030.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809DecROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvVLMROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvM6809RAM0; -static UINT8 *DrvM6809RAM1; -static UINT8 *DrvScrxRAM; -static UINT8 *DrvTransLut; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 scrolldirection; -static UINT8 nmi_enable; -static UINT8 irq_enable; -static UINT8 flipscreen; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 watchdog; - -static struct BurnInputInfo JailbrekInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Jailbrek) - -static struct BurnDIPInfo JailbrekDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x59, NULL }, - {0x16, 0xff, 0xff, 0x0f, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "1" }, - {0x15, 0x01, 0x03, 0x02, "2" }, - {0x15, 0x01, 0x03, 0x01, "3" }, - {0x15, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x04, 0x00, "Upright" }, - {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x15, 0x01, 0x08, 0x08, "30K 70K+" }, - {0x15, 0x01, 0x08, 0x00, "40K 80K+" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x30, 0x30, "Easy" }, - {0x15, 0x01, 0x30, 0x20, "Normal" }, - {0x15, 0x01, 0x30, 0x10, "Difficult" }, - {0x15, 0x01, 0x30, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 0, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, -}; - -STDDIPINFO(Jailbrek) - -static void jailbrek_write(UINT16 address, UINT8 data) -{ - if ((address & 0xffc0) == 0x2000) { - DrvScrxRAM[address & 0x3f] = data; - return; - } - - switch (address) - { - case 0x2040: - case 0x2041: // nop - return; - - case 0x2042: - scrolldirection = data & 4; - return; - - case 0x2043: // nop - return; - - case 0x2044: - nmi_enable = data & 0x01; - irq_enable = data & 0x02; - // flipscreen = data & 0x08; - return; - - case 0x3100: - SN76496Write(0, data); - return; - - case 0x3200: - return; // nop - - case 0x3300: - watchdog = 0; - return; - - case 0x4000: - vlm5030_st(0, (data >> 1) & 1); - vlm5030_rst(0, (data >> 2) & 1); - return; - - case 0x5000: - vlm5030_data_write(0, data); - return; - } -} - -static UINT8 jailbrek_read(UINT16 address) -{ - if ((address & 0xffc0) == 0x2000) { - return DrvScrxRAM[address & 0x3f]; - } - - switch (address) - { - case 0x3100: - return DrvDips[1]; - - case 0x3200: - return DrvDips[2]; - - case 0x3300: - case 0x3301: - case 0x3302: - return DrvInputs[address & 3]; - - case 0x3303: - return DrvDips[0]; - - case 0x6000: - return (vlm5030_bsy(0) ? 1 : 0); - } - - return 0; -} - -static UINT32 DrvVLM5030Sync(INT32 samples_rate) -{ - return (samples_rate * M6809TotalCycles()) / 25600; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - vlm5030Reset(0); - - watchdog = 0; - irq_enable = 0; - nmi_enable = 0; - flipscreen = 0; - scrolldirection = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x008000; - DrvM6809DecROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvVLMROM = Next; Next += 0x004000; - - DrvColPROM = Next; Next += 0x000240; - - DrvTransLut = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x200 * sizeof(UINT32); - - AllRam = Next; - - DrvColRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000100; - - DrvM6809RAM0 = Next; Next += 0x000f00; - DrvM6809RAM1 = Next; Next += 0x000100; - - DrvScrxRAM = Next; Next += 0x000040; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *src, INT32 len) // 64, 32 -{ - for (INT32 i = (len - 1) * 2; i >= 0; i-=2) { - src[i+0] = src[i/2] >> 4; - src[i+1] = src[i/2] & 0xf; - } -} - -static void DrvPaletteInit() -{ - UINT32 pens[32]; - - for (INT32 i = 0; i < 32; i++) - { - INT32 r = DrvColPROM[i + 0x00] & 0xf; - INT32 g = DrvColPROM[i + 0x00] >> 4; - INT32 b = DrvColPROM[i + 0x20] & 0xf; - - pens[i] = BurnHighCol(r+(r*16), g+(g*16), b+(b*16), 0); - } - - for (INT32 i = 0; i < 0x200; i++) { - DrvPalette[i] = pens[(DrvColPROM[i+0x40] & 0xf) | ((~i & 0x100) >> 4)]; - } -} - -static void M6809Decode() -{ - for (INT32 i = 0; i < 0x8000; i++) { - DrvM6809DecROM[i] = DrvM6809ROM[i] ^ (((i&2)?0x80:0x20)|((i&8)?0x08:0x02)); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnDrvGetFlags() & BDF_BOOTLEG) - { - if (BurnLoadRom(DrvM6809ROM + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 5, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00040, 6, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00140, 7, 1)) return 1; - - if (BurnLoadRom(DrvVLMROM + 0x00000, 8, 1)) return 1; - } - else - { - if (BurnLoadRom(DrvM6809ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x04000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c000, 7, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00040, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00140, 11, 1)) return 1; - - if (BurnLoadRom(DrvVLMROM + 0x00000, 12, 1)) return 1; - memcpy (DrvVLMROM, DrvVLMROM + 0x2000, 0x2000); - } - - M6809Decode(); - DrvGfxExpand(DrvGfxROM0, 0x08000); - DrvGfxExpand(DrvGfxROM1, 0x10000); - DrvPaletteInit(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvColRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x0800, 0x0fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1000, 0x10ff, MAP_RAM); - M6809MapMemory(DrvM6809RAM0, 0x1100, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809RAM1, 0x3000, 0x30ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM, 0x8000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809DecROM, 0x8000, 0xffff, MAP_FETCH); - M6809SetWriteHandler(jailbrek_write); - M6809SetReadHandler(jailbrek_read); - M6809Close(); - - SN76489AInit(0, 1536000, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - vlm5030Init(0, 3579545, DrvVLM5030Sync, DrvVLMROM, 0x2000, 1); - vlm5030SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - - vlm5030Exit(); - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - for (INT32 y = 0; y < 32; y ++) - { - for (INT32 x = 0; x < 32; x++) - { - INT32 sy, sx; - - if (scrolldirection) { // column scroll - sy = (y * 8) + DrvScrxRAM[x]; - sx = (x * 8); - } else { // row scroll - sy = (y * 8); - sx = (x * 8) + (DrvScrxRAM[y] + ((DrvScrxRAM[y+0x20]&1)*256)); - } - - INT32 offs = ((sx/8)&0x3f)+(((sy/8)&0x1f)*0x40); - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + ((attr & 0xc0) << 2); - INT32 color = attr & 0x0f; - - INT32 syy = ((y*8)-(sy&7))-16; - if (syy < -7 || syy >= nScreenHeight) continue; - INT32 sxx = ((x*8)-(sx&7))-8; - if (sxx < -7 || sxx >= nScreenWidth) continue; - - Render8x8Tile_Clip(pTransDraw, code, sxx, syy, color, 4, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - for (INT32 i = 0; i < 0xc0; i += 4) - { - INT32 attr = DrvSprRAM[i + 1]; - INT32 code = DrvSprRAM[i] + ((attr & 0x40) << 2); - INT32 color =((attr & 0x0f) * 16) | 0x100; - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - INT32 sx = DrvSprRAM[i + 2] - ((attr & 0x80) << 1); - INT32 sy = DrvSprRAM[i + 3]; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 16; - sx -= 8; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (flipy) { - if (flipx) { - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 3, color, 0, sx + 0, sy + 0, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 2, color, 0, sx + 8, sy + 0, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 1, color, 0, sx + 0, sy + 8, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 0, color, 0, sx + 8, sy + 8, flipx, flipy, 8, 8, DrvColPROM + 0x40); - } else { - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 2, color, 0, sx + 0, sy + 0, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 3, color, 0, sx + 8, sy + 0, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 0, color, 0, sx + 0, sy + 8, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 1, color, 0, sx + 8, sy + 8, flipx, flipy, 8, 8, DrvColPROM + 0x40); - } - } else { - if (flipx) { - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 1, color, 0, sx + 0, sy + 0, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 0, color, 0, sx + 8, sy + 0, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 3, color, 0, sx + 0, sy + 8, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 2, color, 0, sx + 8, sy + 8, flipx, flipy, 8, 8, DrvColPROM + 0x40); - } else { - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 0, color, 0, sx + 0, sy + 0, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 1, color, 0, sx + 8, sy + 0, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 2, color, 0, sx + 0, sy + 8, flipx, flipy, 8, 8, DrvColPROM + 0x40); - RenderTileTranstab(pTransDraw, DrvGfxROM1, code * 4 + 3, color, 0, sx + 8, sy + 8, flipx, flipy, 8, 8, DrvColPROM + 0x40); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(); - if (nSpriteEnable & 1) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 9; - INT32 nCyclesTotal[1] = { 1536000 / 60 }; - INT32 nCyclesDone[1] = { 0 }; - INT32 nSoundBufferPos = 0; - - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - - if (i < 8 && nmi_enable) M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - - if (i == 8 && irq_enable) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - } - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - - vlm5030Scan(nAction); - SN76496Scan(nAction,pnMin); - - SCAN_VAR(scrolldirection); - SCAN_VAR(nmi_enable); - SCAN_VAR(irq_enable); - SCAN_VAR(flipscreen); - } - - return 0; -} - - -// Jail Break - -static struct BurnRomInfo jailbrekRomDesc[] = { - { "507p03.11d", 0x4000, 0xa0b88dfd, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "507p02.9d", 0x4000, 0x444b7d8e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "507l08.4f", 0x4000, 0xe3b7a226, 2 | BRF_GRA }, // 2 Tiles - { "507j09.5f", 0x4000, 0x504f0912, 2 | BRF_GRA }, // 3 - - { "507j04.3e", 0x4000, 0x0d269524, 3 | BRF_GRA }, // 4 Sprites - { "507j05.4e", 0x4000, 0x27d4f6f4, 3 | BRF_GRA }, // 5 - { "507j06.5e", 0x4000, 0x717485cb, 3 | BRF_GRA }, // 6 - { "507j07.3f", 0x4000, 0xe933086f, 3 | BRF_GRA }, // 7 - - { "507j10.1f", 0x0020, 0xf1909605, 4 | BRF_GRA }, // 8 Color Proms - { "507j11.2f", 0x0020, 0xf70bb122, 4 | BRF_GRA }, // 9 - { "507j13.7f", 0x0100, 0xd4fe5c97, 4 | BRF_GRA }, // 10 - { "507j12.6f", 0x0100, 0x0266c7db, 4 | BRF_GRA }, // 11 - - { "507l01.8c", 0x4000, 0x0c8a3605, 5 | BRF_SND }, // 12 VLM5030 Samples -}; - -STD_ROM_PICK(jailbrek) -STD_ROM_FN(jailbrek) - -struct BurnDriver BurnDrvJailbrek = { - "jailbrek", NULL, NULL, NULL, "1986", - "Jail Break\0", NULL, "Konami", "GX507", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, jailbrekRomInfo, jailbrekRomName, NULL, NULL, JailbrekInputInfo, JailbrekDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 240, 224, 4, 3 -}; - - -// Manhattan 24 Bunsyo (Japan) - -static struct BurnRomInfo manhatanRomDesc[] = { - { "507n03.11d", 0x4000, 0xe5039f7e, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "507n02.9d", 0x4000, 0x143cc62c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "507j08.4f", 0x4000, 0x175e1b49, 2 | BRF_GRA }, // 2 Tiles - { "507j09.5f", 0x4000, 0x504f0912, 2 | BRF_GRA }, // 3 - - { "507j04.3e", 0x4000, 0x0d269524, 3 | BRF_GRA }, // 4 Sprites - { "507j05.4e", 0x4000, 0x27d4f6f4, 3 | BRF_GRA }, // 5 - { "507j06.5e", 0x4000, 0x717485cb, 3 | BRF_GRA }, // 6 - { "507j07.3f", 0x4000, 0xe933086f, 3 | BRF_GRA }, // 7 - - { "507j10.1f", 0x0020, 0xf1909605, 4 | BRF_GRA }, // 8 Color Proms - { "507j11.2f", 0x0020, 0xf70bb122, 4 | BRF_GRA }, // 9 - { "507j13.7f", 0x0100, 0xd4fe5c97, 4 | BRF_GRA }, // 10 - { "507j12.6f", 0x0100, 0x0266c7db, 4 | BRF_GRA }, // 11 - - { "507p01.8c", 0x4000, 0x973fa351, 5 | BRF_SND }, // 12 VLM5030 Samples -}; - -STD_ROM_PICK(manhatan) -STD_ROM_FN(manhatan) - -struct BurnDriver BurnDrvManhatan = { - "manhatan", "jailbrek", NULL, NULL, "1986", - "Manhattan 24 Bunsyo (Japan)\0", NULL, "Konami", "GX507", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, manhatanRomInfo, manhatanRomName, NULL, NULL, JailbrekInputInfo, JailbrekDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 240, 224, 4, 3 -}; - - -// Jail Break (bootleg) - -static struct BurnRomInfo jailbrekbRomDesc[] = { - { "1.k6", 0x8000, 0xdf0e8fc7, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - - { "3.h6", 0x8000, 0xbf67a8ff, 2 | BRF_GRA }, // 1 Tiles - - { "5.f6", 0x8000, 0x081d2eea, 3 | BRF_GRA }, // 2 Sprites - { "4.g6", 0x8000, 0xe34b93b8, 3 | BRF_GRA }, // 3 - - { "prom.j2", 0x0020, 0xf1909605, 4 | BRF_GRA }, // 4 Color Proms - { "prom.i2", 0x0020, 0xf70bb122, 4 | BRF_GRA }, // 5 - { "prom.d6", 0x0100, 0xd4fe5c97, 4 | BRF_GRA }, // 6 - { "prom.e6", 0x0100, 0x0266c7db, 4 | BRF_GRA }, // 7 - - { "2.i6", 0x2000, 0xd91d15e3, 5 | BRF_SND }, // 8 VLM5030 Samples - - { "k4.bin", 0x0001, 0x00000000, 6 | BRF_NODUMP }, // 9 plds - { "a7.bin", 0x0001, 0x00000000, 6 | BRF_NODUMP }, // 10 - { "g9.bin", 0x0001, 0x00000000, 6 | BRF_NODUMP }, // 11 - { "k8.bin", 0x0001, 0x00000000, 6 | BRF_NODUMP }, // 12 -}; - -STD_ROM_PICK(jailbrekb) -STD_ROM_FN(jailbrekb) - -struct BurnDriver BurnDrvJailbrekb = { - "jailbrekb", "jailbrek", NULL, NULL, "1986", - "Jail Break (bootleg)\0", NULL, "bootleg", "GX507", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, jailbrekbRomInfo, jailbrekbRomName, NULL, NULL, JailbrekInputInfo, JailbrekDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 240, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_junofrst.cpp b/jan/src/burn/drv/konami/d_junofrst.cpp deleted file mode 100644 index 04ab2a282..000000000 --- a/jan/src/burn/drv/konami/d_junofrst.cpp +++ /dev/null @@ -1,793 +0,0 @@ -// FB Alpha Juno First driver module -// Based on MAME driver by Chris Hardy - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "i8039.h" -#include "driver.h" -#include "flt_rc.h" -#include "dac.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *RamEnd; -static UINT8 *AllRam; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809Dec; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvI8039ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvPalRAM; - -static UINT8 *blitterdata; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 soundlatch; -static UINT8 soundlatch2; -static UINT8 i8039_status; -static UINT8 irq_enable; -static UINT8 irq_toggle; -static UINT8 scroll; -static UINT8 flipscreen; -static UINT8 previous_sound_irq; -static UINT8 bankdata; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; -static INT32 watchdog; - -static struct BurnInputInfo JunofrstInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Junofrst) - -static struct BurnDIPInfo JunofrstDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7b, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "256 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x04, 0x00, "Upright" }, - {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x15, 0x01, 0x70, 0x70, "1 (Easiest)" }, - {0x15, 0x01, 0x70, 0x60, "2" }, - {0x15, 0x01, 0x70, 0x50, "3" }, - {0x15, 0x01, 0x70, 0x40, "4" }, - {0x15, 0x01, 0x70, 0x30, "5" }, - {0x15, 0x01, 0x70, 0x20, "6" }, - {0x15, 0x01, 0x70, 0x10, "7" }, - {0x15, 0x01, 0x70, 0x00, "8 (Hardest)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" } -}; - -STDDIPINFO(Junofrst) - -static void blitter_write(INT32 offset, UINT8 data) -{ - blitterdata[offset] = data; - - if (offset == 3) - { - UINT8 *gfx_rom = DrvGfxROM0; - - UINT16 src = ((blitterdata[2] << 8) | blitterdata[3]) & 0xfffc; - UINT16 dest = (blitterdata[0] << 8) | blitterdata[1]; - - INT32 copy = blitterdata[3] & 0x01; - - for (INT32 i = 0; i < 16; i++) - { - for (INT32 j = 0; j < 16; j++) - { - UINT8 gfxdata = (gfx_rom[src / 2] >> ((~src & 1) * 4)) & 0xf; - - src += 1; - - if (gfxdata) - { - if (copy == 0) gfxdata = 0; - - if (dest & 1) - DrvVidRAM[dest / 2] = (DrvVidRAM[dest / 2] & 0x0f) + (gfxdata << 4); - else - DrvVidRAM[dest / 2] = (DrvVidRAM[dest / 2] & 0xf0) + (gfxdata); - } - - dest += 1; - } - - dest += 240; - } - } -} - -static void bankswitch(INT32 data) -{ - bankdata = data; - - M6809MapMemory(DrvM6809ROM + 0x10000 + ((data & 0xf) * 0x1000), 0x9000, 0x9fff, MAP_READ); - M6809MapMemory(DrvM6809Dec + 0x10000 + ((data & 0xf) * 0x1000), 0x9000, 0x9fff, MAP_FETCH); -} - -static void junofrst_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0x8000) { - DrvPalRAM[address & 0xf] = data; - return; - } - - switch (address) - { - case 0x8030: - irq_enable = data & 1; - if (irq_enable == 0) M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0x8031: - case 0x8032: - // coin counter - return; - - case 0x8033: - scroll = data; - return; - - case 0x8034: - case 0x8035: - flipscreen = data & 1; - return; - - case 0x8040: - if (previous_sound_irq == 0 && data == 1) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - previous_sound_irq = data; - return; - - case 0x8050: - soundlatch = data; - return; - - case 0x8060: - bankswitch(data); - return; - - case 0x8070: - case 0x8071: - case 0x8072: - case 0x8073: - blitter_write(address & 3, data); - return; - } -} - -static UINT8 junofrst_main_read(UINT16 address) -{ - switch (address) - { - case 0x8010: - return DrvDips[1]; - - case 0x801c: - watchdog = 0; - return 0; - - case 0x8020: - return DrvInputs[0]; - - case 0x8024: - return DrvInputs[1]; - - case 0x8028: - return DrvInputs[2]; - - case 0x802c: - return DrvDips[0]; - } - - return 0; -} - -static void __fastcall junofrst_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x4000: - AY8910Write(0, 0, data); - return; - - case 0x4002: - AY8910Write(0, 1, data); - return; - - case 0x5000: - soundlatch2 = data; - return; - - case 0x6000: - I8039SetIrqState(1); - return; - } -} - -static UINT8 __fastcall junofrst_sound_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - return soundlatch; - - case 0x4001: - return AY8910Read(0); - } - - return 0; -} - -static UINT8 __fastcall junofrst_i8039_read(UINT32 address) -{ - return DrvI8039ROM[address & 0x0fff]; -} - -static void __fastcall junofrst_i8039_write_port(UINT32 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case I8039_p1: - DACWrite(0, data); - return; - - case I8039_p2: - if ((data & 0x80) == 0) - I8039SetIrqState(0); - i8039_status = (data & 0x70) >> 4; - return; - } -} - -static UINT8 __fastcall junofrst_i8039_read_port(UINT32 port) -{ - if ((port & 0x1ff) < 0x100) { - return soundlatch2; - } - - return 0; -} - -static UINT8 AY8910_0_portA(UINT32) -{ - return (((ZetTotalCycles() / 512) & 0xf) * 0x10) + i8039_status; -} - -static void filter_write(INT32 num, UINT8 d) -{ - INT32 C = 0; - if (d & 2) C += 220000; - if (d & 1) C += 47000; - - filter_rc_set_RC(num, FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(C)); -} - -static void AY8910_0_portBwrite(UINT32 /*port*/, UINT32 data) -{ - if (ZetGetActive() == -1) return; - - filter_write(0, (data >> 0) & 3); - filter_write(1, (data >> 2) & 3); - filter_write(2, (data >> 4) & 3); -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (1789750.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - - soundlatch = 0; - soundlatch2 = 0; - i8039_status = 0; - irq_enable = 0; - irq_toggle = 0; - scroll = 0; - flipscreen = 0; - previous_sound_irq = 0; - } - - M6809Open(0); - bankswitch(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - I8039Reset(); - - DACReset(); - - AY8910Reset(0); - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x020000; - DrvM6809Dec = Next; Next += 0x020000; - - DrvZ80ROM = Next; Next += 0x001000; - - DrvI8039ROM = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x008000; - - DrvPalette = (UINT32*)Next; Next += 0x0010 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x008000; - DrvZ80RAM = Next; Next += 0x000400; - DrvPalRAM = Next; Next += 0x000010; - - DrvM6809RAM = Next; Next += 0x000f00; - - blitterdata = Next; Next += 0x000004; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void M6809Decode() -{ - for (INT32 i = 0; i < 0x20000; i++) - { - DrvM6809Dec[i] = DrvM6809ROM[i] ^ ((i & 2) ? 0x80 : 0x20) ^ ((i & 8) ? 0x08 : 0x02); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x0a000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0e000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x10000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x12000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x14000, 5, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x16000, 6, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x18000, 7, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x1a000, 8, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 9, 1)) return 1; - - if (BurnLoadRom(DrvI8039ROM + 0x00000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 13, 1)) return 1; - - M6809Decode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x7fff, MAP_RAM); - M6809MapMemory(DrvM6809RAM, 0x8100, 0x8fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0xa000, 0xa000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809Dec + 0xa000, 0xa000, 0xffff, MAP_FETCH); - M6809SetWriteHandler(junofrst_main_write); - M6809SetReadHandler(junofrst_main_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x0fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x2000, 0x23ff, MAP_RAM); - ZetSetWriteHandler(junofrst_sound_write); - ZetSetReadHandler(junofrst_sound_read); - ZetClose(); - - I8039Init(NULL); - I8039SetProgramReadHandler(junofrst_i8039_read); - I8039SetCPUOpReadHandler(junofrst_i8039_read); - I8039SetCPUOpReadArgHandler(junofrst_i8039_read); - I8039SetIOReadHandler(junofrst_i8039_read_port); - I8039SetIOWriteHandler(junofrst_i8039_write_port); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 1789750, nBurnSoundRate, AY8910_0_portA, NULL, NULL, &AY8910_0_portBwrite); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(0), 1); - filter_rc_set_src_gain(0, 1.00); - filter_rc_set_src_gain(1, 1.00); - filter_rc_set_src_gain(2, 1.00); - filter_rc_set_route(0, 0.30, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 0.30, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - ZetExit(); - I8039Exit(); - - DACExit(); - - AY8910Exit(0); - filter_rc_exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 16; i++) // BBGGGRRR - { - INT32 r = (DrvPalRAM[i] & 0x07); - INT32 g = (DrvPalRAM[i] & 0x38) >> 3; - INT32 b = (DrvPalRAM[i] & 0xc0) >> 6; - - r = (r << 5) + (r << 2) + (r >> 1); - g = (g << 5) + (g << 2) + (g >> 1); - b += (b << 2) + (b << 4) + (b << 6); - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_bitmap() -{ - int xorx = flipscreen ? 255 : 0; - int xory = flipscreen ? 255 : 0; - - for (int y = 16; y < 240; y++) - { - UINT16 *dst = pTransDraw + ((y - 16) * nScreenWidth); - - for (int x = 0; x < 256; x++) - { - UINT8 effx = x ^ xorx; - UINT8 effy = (y ^ xory) + ((effx < 192) ? scroll : 0); - - dst[x] = (DrvVidRAM[effy * 128 + effx / 2] >> (4 * (effx % 2))) & 0xf; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; - } - - draw_bitmap(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - ZetNewFrame(); - I8039NewFrame(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 1536000 / 60, 1789750 / 60, 8000000 / 15 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - INT32 nSoundBufferPos = 0; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nNext; - - nNext = (nCyclesTotal[0] * (i + 1)) / nInterleave; - nCyclesDone[0] += M6809Run(nNext - nCyclesDone[0]); - if (i == 240-1 && (irq_toggle ^= 1) && irq_enable) { - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - - nNext = (nCyclesTotal[1] * (i + 1)) / nInterleave; - nCyclesDone[1] += ZetRun(nNext - nCyclesDone[1]); - - nNext = (nCyclesTotal[2] * (i + 1)) / nInterleave; - nCyclesDone[2] += I8039Run(nNext - nCyclesDone[2]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - M6809Scan(nAction); - I8039Scan(nAction,pnMin); - - AY8910Scan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(soundlatch2); - SCAN_VAR(i8039_status); - SCAN_VAR(irq_enable); - SCAN_VAR(irq_toggle); - SCAN_VAR(scroll); - SCAN_VAR(flipscreen); - SCAN_VAR(previous_sound_irq); - SCAN_VAR(bankdata); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(bankdata); - M6809Close(); - } - - return 0; -} - - -// Juno First - -static struct BurnRomInfo junofrstRomDesc[] = { - { "jfa_b9.bin", 0x2000, 0xf5a7ab9d, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "jfb_b10.bin", 0x2000, 0xf20626e0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jfc_a10.bin", 0x2000, 0x1e7744a7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jfc1_a4.bin", 0x2000, 0x03ccbf1d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jfc2_a5.bin", 0x2000, 0xcb372372, 1 | BRF_PRG | BRF_ESS }, // 4 - { "jfc3_a6.bin", 0x2000, 0x879d194b, 1 | BRF_PRG | BRF_ESS }, // 5 - { "jfc4_a7.bin", 0x2000, 0xf28af80b, 1 | BRF_PRG | BRF_ESS }, // 6 - { "jfc5_a8.bin", 0x2000, 0x0539f328, 1 | BRF_PRG | BRF_ESS }, // 7 - { "jfc6_a9.bin", 0x2000, 0x1da2ad6e, 1 | BRF_PRG | BRF_ESS }, // 8 - - { "jfs1_j3.bin", 0x1000, 0x235a2893, 2 | BRF_PRG | BRF_ESS }, // 9 Z80 Code - - { "jfs2_p4.bin", 0x1000, 0xd0fa5d5f, 3 | BRF_PRG | BRF_ESS }, // 10 I8039 Code - - { "jfs3_c7.bin", 0x2000, 0xaeacf6db, 4 | BRF_GRA }, // 11 Blitter data - { "jfs4_d7.bin", 0x2000, 0x206d954c, 4 | BRF_GRA }, // 12 - { "jfs5_e7.bin", 0x2000, 0x1eb87a6e, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(junofrst) -STD_ROM_FN(junofrst) - -struct BurnDriver BurnDrvJunofrst = { - "junofrst", NULL, NULL, NULL, "1983", - "Juno First\0", NULL, "Konami", "GX310", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, junofrstRomInfo, junofrstRomName, NULL, NULL, JunofrstInputInfo, JunofrstDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 224, 256, 3, 4 -}; - - -// Juno First (Gottlieb) - -static struct BurnRomInfo junofrstgRomDesc[] = { - { "jfg_a.9b", 0x2000, 0x8f77d1c5, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "jfg_b.10b", 0x2000, 0xcd645673, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jfg_c.10a", 0x2000, 0x47852761, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jfgc1.4a", 0x2000, 0x90a05ae6, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jfc2_a5.bin", 0x2000, 0xcb372372, 1 | BRF_PRG | BRF_ESS }, // 4 - { "jfc3_a6.bin", 0x2000, 0x879d194b, 1 | BRF_PRG | BRF_ESS }, // 5 - { "jfgc4.7a", 0x2000, 0xe8864a43, 1 | BRF_PRG | BRF_ESS }, // 6 - { "jfc5_a8.bin", 0x2000, 0x0539f328, 1 | BRF_PRG | BRF_ESS }, // 7 - { "jfc6_a9.bin", 0x2000, 0x1da2ad6e, 1 | BRF_PRG | BRF_ESS }, // 8 - - { "jfs1_j3.bin", 0x1000, 0x235a2893, 2 | BRF_PRG | BRF_ESS }, // 9 Z80 Code - - { "jfs2_p4.bin", 0x1000, 0xd0fa5d5f, 3 | BRF_PRG | BRF_ESS }, // 10 I8039 Code - - { "jfs3_c7.bin", 0x2000, 0xaeacf6db, 4 | BRF_GRA }, // 11 Blitter data - { "jfs4_d7.bin", 0x2000, 0x206d954c, 4 | BRF_GRA }, // 12 - { "jfs5_e7.bin", 0x2000, 0x1eb87a6e, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(junofrstg) -STD_ROM_FN(junofrstg) - -struct BurnDriver BurnDrvJunofrstg = { - "junofrstg", "junofrst", NULL, NULL, "1983", - "Juno First (Gottlieb)\0", NULL, "Konami (Gottlieb license)", "GX310", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, junofrstgRomInfo, junofrstgRomName, NULL, NULL, JunofrstInputInfo, JunofrstDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 224, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/konami/d_kontest.cpp b/jan/src/burn/drv/konami/d_kontest.cpp deleted file mode 100644 index 0793eb2e9..000000000 --- a/jan/src/burn/drv/konami/d_kontest.cpp +++ /dev/null @@ -1,360 +0,0 @@ -// FB Alpha Konami Test Board (GX800) driver module -// Based on MAME driver by Angelo Salese - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvTileRAM; -static UINT8 *DrvTileRAMExp; - -static UINT8 *irq_enable; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvInputs[4]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 2, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy4 + 2, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy3 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x14, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Orientation" }, - {0x14, 0x01, 0x80, 0x80, "Horizontal" }, - {0x14, 0x01, 0x80, 0x00, "Vertical" }, -}; - -STDDIPINFO(Drv) - -static inline void DrvExpandTile(INT32 offset, UINT8 data) -{ - DrvTileRAMExp[offset * 4 + 0] = ((data >> 3) & 0x01) | ((data >> 6) & 0x02); - DrvTileRAMExp[offset * 4 + 1] = ((data >> 2) & 0x01) | ((data >> 5) & 0x02); - DrvTileRAMExp[offset * 4 + 2] = ((data >> 1) & 0x01) | ((data >> 4) & 0x02); - DrvTileRAMExp[offset * 4 + 3] = ((data >> 0) & 0x01) | ((data >> 3) & 0x02); -} - -static void __fastcall kontest_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xf000) { - DrvTileRAM[address & 0x0fff] = data; - DrvExpandTile(address & 0x0fff, data); - return; - } -} - -static void __fastcall kontest_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - SN76496Write(0, data); - return; - - case 0x04: - SN76496Write(1, data); - return; - - case 0x08: - *irq_enable = data & 0x08; - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static UINT8 __fastcall kontest_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x0c: - case 0x0d: - case 0x0e: - case 0x0f: - return DrvInputs[port & 0x03]; - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32); - - DrvTileRAMExp = Next; Next += 0x004000; - - AllRam = Next; - - DrvColRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - DrvTileRAM = Next; Next += 0x001000; - - irq_enable = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0 = 0; - INT32 bit1 = (DrvColPROM[i] >> 6) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM , 0, 1)) return 1; - - if (BurnLoadRom(DrvColPROM, 1, 1)) return 1; - - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xe000, 0xe7ff, 0, DrvColRAM); - ZetMapArea(0xe000, 0xe7ff, 1, DrvColRAM); - ZetMapArea(0xe000, 0xe7ff, 2, DrvColRAM); - ZetMapArea(0xe800, 0xefff, 0, DrvVidRAM); - ZetMapArea(0xe800, 0xefff, 1, DrvVidRAM); - ZetMapArea(0xe800, 0xefff, 2, DrvVidRAM); - ZetMapArea(0xf000, 0xffff, 0, DrvTileRAM); -// ZetMapArea(0xf000, 0xffff, 1, DrvTileRAM); - ZetMapArea(0xf000, 0xffff, 2, DrvTileRAM); - ZetSetWriteHandler(kontest_write); - ZetSetOutHandler(kontest_write_port); - ZetSetInHandler(kontest_read_port); - ZetClose(); - - SN76489AInit(0, 1500000, 0); - SN76489AInit(1, 1500000, 1); - - SN76496SetRoute(0, 0.60, BURN_SND_ROUTE_RIGHT); - SN76496SetRoute(1, 0.50, BURN_SND_ROUTE_LEFT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - SN76496Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrawLayer() -{ - for (INT32 offs = 0; offs < 32 * 64; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - INT32 code = DrvVidRAM[offs]; - INT32 color = DrvColRAM[(offs & 0x3f) + ((offs & 0x780) / 2)] & 0x07; - - if (sx < 256 || sy < 16 || sy >= 240) continue; - - Render8x8Tile(pTransDraw, code, sx - 256, sy - 16, color, 2, 0, DrvTileRAMExp); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - DrawLayer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 4 * sizeof(UINT8)); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - DrvInputs[2] = (DrvInputs[2] & 0x7f) | (DrvDips[0] & 0x80); - } - - ZetOpen(0); - ZetRun(3000000 / 60); - - if (*irq_enable) - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - - ZetClose(); - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - for (INT32 i = 0; i < 0x1000; i++) { - DrvExpandTile(i, DrvTileRAM[i]); - } - } - - return 0; -} - - -// Konami Test Board (GX800, Japan) - -static struct BurnRomInfo kontestRomDesc[] = { - { "800b01.10d", 0x8000, 0x520f83dc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - - { "800a02.4f", 0x0020, 0x6d604171, 2 | BRF_GRA }, // 1 Color PROM -}; - -STD_ROM_PICK(kontest) -STD_ROM_FN(kontest) - -struct BurnDriver BurnDrvKontest = { - "kontest", NULL, NULL, NULL, "1987?", - "Konami Test Board (GX800, Japan)\0", NULL, "Konami", "GX800", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, kontestRomInfo, kontestRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_labyrunr.cpp b/jan/src/burn/drv/konami/d_labyrunr.cpp deleted file mode 100644 index 2aee3399c..000000000 --- a/jan/src/burn/drv/konami/d_labyrunr.cpp +++ /dev/null @@ -1,885 +0,0 @@ -// FB Alpha Labyrinth Runner driver module -// Based on MAME driver by Nicola Salmoria - -/* - To do: - Timing seems a bit off (can hear some gaps in sound due to this) - Some graphics modes may be incomplete. Need save states to fix these. -*/ - -#include "tiles_generic.h" -#include "hd6309_intf.h" -#include "burn_ym2203.h" -#include "konamiic.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvHD6309ROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvLutPROM; -static UINT8 *DrvLookUpTable; -static UINT8 *DrvSprTranspLut; -static UINT8 *DrvHD6309RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvScrollRAM; -static UINT8 *K007121CtrlRAM; -static UINT8 *DrvTransTab; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 HD6309Bank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 DrvPalWritten = 0; -static INT32 watchdog = 0; - -static struct BurnInputInfo LabyrunrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Labyrunr) - -static struct BurnDIPInfo LabyrunrDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x5a, NULL }, - {0x15, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "2" }, - {0x14, 0x01, 0x03, 0x02, "3" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x04, 0x00, "Upright" }, - {0x14, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x18, 0x18, "30000 70000" }, - {0x14, 0x01, 0x18, 0x10, "40000 80000" }, - {0x14, 0x01, 0x18, 0x08, "40000" }, - {0x14, 0x01, 0x18, 0x00, "50000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x60, 0x60, "Easy" }, - {0x14, 0x01, 0x60, 0x40, "Normal" }, - {0x14, 0x01, 0x60, 0x20, "Hard" }, - {0x14, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x15, 0x01, 0x02, 0x02, "Single" }, - {0x15, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x08, 0x08, "3 Times" }, - {0x15, 0x01, 0x08, 0x00, "5 Times" }, -}; - -STDDIPINFO(Labyrunr) - -static void bankswitch(INT32 data) -{ - if (data != HD6309Bank) { - HD6309Bank = data; - HD6309MapMemory(DrvHD6309ROM + 0x10000 + ((HD6309Bank & 7) * 0x4000), 0x4000, 0x7fff, MAP_ROM); - } -} - -static void labyrunr_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff8) == 0x0000) { - K007121CtrlRAM[address & 7] = data; - return; - } - - if (address >= 0x0020 && address <= 0x005f) { - DrvScrollRAM[address - 0x0020] = data; - return; - } - - if ((address & 0xffe0) == 0x0d00) { - K051733Write(address & 0x1f, data); - return; - } - - if ((address & 0xff00) == 0x1000) { // Speed-up - if (data != DrvPalRAM[address & 0xff]) { - DrvPalRAM[address & 0xff] = data; - DrvPalWritten = 1; - } - return; - } - - switch (address) - { - case 0x0800: - BurnYM2203Write(0, 1, data); - return; - - case 0x0801: - BurnYM2203Write(0, 0, data); - return; - - case 0x0900: - BurnYM2203Write(1, 1, data); - return; - - case 0x0901: - BurnYM2203Write(1, 0, data); - return; - - case 0x0c00: - bankswitch(data); - return; - - case 0x0e00: - watchdog = 0; - return; - } -} - -static UINT8 labyrunr_read(UINT16 address) -{ - if ((address & 0xfff8) == 0x0000) { - return K007121CtrlRAM[address & 7]; - } - - if (address >= 0x0020 && address <= 0x005f) { - return DrvScrollRAM[address - 0x0020]; - } - - if ((address & 0xffe0) == 0x0d00) { - return K051733Read(address & 0x1f); - } - - switch (address) - { - case 0x0800: - return BurnYM2203Read(0, 1); - - case 0x0801: - return BurnYM2203Read(0, 0); - - case 0x0900: - return BurnYM2203Read(1, 1); - - case 0x0901: - return BurnYM2203Read(1, 0); - - case 0x0a00: - return DrvInputs[1]; - - case 0x0a01: - return DrvInputs[0]; - - case 0x0b00: - return DrvInputs[2]; - } - - return 0; -} - -static UINT8 ym2203_0_read_portA(UINT32 ) -{ - return DrvDips[0]; -} - -static UINT8 ym2203_0_read_portB(UINT32 ) -{ - return DrvDips[1]; -} - -static UINT8 ym2203_1_read_portB(UINT32 ) -{ - return DrvDips[2]; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)HD6309TotalCycles() * nSoundRate / 3000000; -} - -static double DrvGetTime() -{ - return (double)HD6309TotalCycles() / 3000000; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - HD6309Open(0); - HD6309Reset(); - HD6309Bank = -1; - bankswitch(0); - BurnYM2203Reset(); - HD6309Close(); - - K051733Reset(); - - DrvPalWritten = 1; - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvHD6309ROM = Next; Next += 0x028000; - - DrvGfxROM = Next; Next += 0x080000; - - DrvLutPROM = Next; Next += 0x000100; - - DrvLookUpTable = Next; Next += 0x000800; - DrvSprTranspLut = Next; Next += 0x000800; - DrvTransTab = Next; Next += 0x002000; - - DrvPalette = (UINT32*)Next; Next += 0x801 * sizeof(UINT32); - - AllRam = Next; - - DrvHD6309RAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000100; - - DrvSprRAM = Next; Next += 0x001000; - DrvVidRAM1 = Next; Next += 0x000800; - DrvVidRAM0 = Next; Next += 0x000800; - DrvScrollRAM = Next; Next += 0x000040; - - K007121CtrlRAM = Next; Next += 0x000008; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *src, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i-=2) { - src[i+0] = src[i/2] >> 4; - src[i+1] = src[i/2] & 0xf; - } - - for (INT32 i = 0; i < len * 2; i+=0x40) { - DrvTransTab[i/0x40] = 1; - for (INT32 j = 0; j < 0x40; j++) { - if (src[i+j]) { - DrvTransTab[i/0x40] = 0; - break; - } - } - } -} - -static void DrvExpandLookupTable() -{ - // Calculate color lookup tables - for (INT32 pal = 0; pal < 8; pal+=2) - { - for (INT32 i = 0; i < 0x100; i++) - { - DrvLookUpTable[((pal+1) << 8) | i] = ((pal+1) << 4) | (i & 0xf); - DrvLookUpTable[((pal+0) << 8) | i] = ((DrvLutPROM[i] == 0) ? 0 : ((pal << 4) | (DrvLutPROM[i] & 0x0f))); - } - } - - // Calculate sprite transparency lookups - for (INT32 i = 0; i < 0x800; i++) { - DrvSprTranspLut[i] = DrvLookUpTable[i] & 0xf; - } -} - -static INT32 CommonInit(INT32 nLoadType) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvHD6309ROM + 0x10000, 0, 1)) return 1; - memcpy (DrvHD6309ROM, DrvHD6309ROM + 0x18000, 0x08000); - if (BurnLoadRom(DrvHD6309ROM + 0x18000, 1, 1)) return 1; - - if (nLoadType == 0) { - if (BurnLoadRom(DrvGfxROM + 0x00001, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x00000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x20001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x20000, 5, 2)) return 1; - - if (BurnLoadRom(DrvLutPROM, 6, 1)) return 1; - } else { - if (BurnLoadRom(DrvGfxROM + 0x00000, 2, 1)) return 1; - BurnByteswap(DrvGfxROM, 0x40000); - - if (BurnLoadRom(DrvLutPROM, 3, 1)) return 1; - } - - DrvGfxExpand(DrvGfxROM, 0x40000); - DrvExpandLookupTable(); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvPalRAM, 0x1000, 0x10ff, MAP_ROM); - HD6309MapMemory(DrvHD6309RAM, 0x1800, 0x1fff, MAP_RAM); - HD6309MapMemory(DrvSprRAM, 0x2000, 0x2fff, MAP_RAM); - HD6309MapMemory(DrvVidRAM0, 0x3000, 0x37ff, MAP_RAM); - HD6309MapMemory(DrvVidRAM1, 0x3800, 0x3fff, MAP_RAM); - HD6309MapMemory(DrvHD6309ROM, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(labyrunr_write); - HD6309SetReadHandler(labyrunr_read); - HD6309Close(); - - BurnYM2203Init(2, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, &ym2203_0_read_portA, &ym2203_0_read_portB, NULL, NULL); - BurnYM2203SetPorts(1, NULL, &ym2203_1_read_portB, NULL, NULL); - BurnTimerAttachHD6309(3000000); - BurnYM2203SetAllRoutes(0, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 0.80); - BurnYM2203SetPSGVolume(1, 0.80); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvInit() { return CommonInit(0); } -static INT32 DrvInit2() { return CommonInit(1); } - -static INT32 DrvExit() -{ - BurnYM2203Exit(); - - HD6309Exit(); - - GenericTilesExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(INT32 layer) -{ - UINT8 *vidram; - - INT32 c1 = K007121CtrlRAM[1]; - INT32 c3 = K007121CtrlRAM[3]; - INT32 c4 = K007121CtrlRAM[4]; - INT32 c5 = K007121CtrlRAM[5]; - INT32 c6 = K007121CtrlRAM[6]; - - INT32 b0 = ((c5 >> 0) & 3) + 2; - INT32 b1 = ((c5 >> 2) & 3) + 1; - INT32 b2 = ((c5 >> 4) & 3) + 0; - INT32 b3 = ((c5 >> 6) & 3) - 1; - - INT32 xscroll_enable = 1; - INT32 yscroll_enable = ~c3 & 0x20; - - INT32 scrollx = K007121CtrlRAM[0]; - INT32 scrolly = K007121CtrlRAM[2]; - - INT32 mask = c4 >> 4; - - INT32 opaque = 0; - INT32 min_x = 0; - INT32 max_x = nScreenWidth; - INT32 x_offset = 0; - - if (layer == 1) - { - vidram = DrvVidRAM1; - - if (yscroll_enable) - { - opaque = 1; - yscroll_enable = xscroll_enable = 0; - max_x = 40; - } - else - { - scrollx -= 40; - - if (c1 & 0x01) - { - if (scrollx < 40) min_x = (40 - scrollx) - 1; - max_x = nScreenWidth - scrollx + 8; - } - else - { - min_x = nScreenWidth - scrollx + 8; - max_x = nScreenWidth; - } - } - } - else - { - x_offset = 40; - min_x = 40; - vidram = DrvVidRAM0; - - if (yscroll_enable) { - opaque = 1; - max_x = 264; // ?? why? - } - else - { - if (c1 & 0x01) - { - min_x = (nScreenWidth - scrollx + 8) - 1; - max_x = nScreenWidth; - - } - else - { - if (scrollx < 40) min_x = (40 - scrollx) - 1; - max_x = nScreenWidth - scrollx + 8; - } - } - } - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - if (yscroll_enable) { - sy -= scrolly; - if (sy < -7) sy += 256; - } - - if (xscroll_enable) { - sx -= scrollx; - if (sx < -7) sx += 256; - } - - sx += x_offset; - sy -= 16; - - if (sx <= (min_x-8) || sx >= max_x) continue; - - INT32 attr = vidram[offs]; - INT32 code = vidram[offs + 0x400]; - - INT32 bank = ((attr >> 7) & 1) | ((attr >> b0) & 2) | ((attr >> b1) & 4) | ((attr >> b2) & 8) | ((attr >> b3) & 0x10) | ((c3 & 1) << 5); - - code += ((bank & ~(mask << 1)) | ((c4 & mask) << 1)) << 8; - - INT32 color = ((c6 & 0x30) << 1) | (attr & 7) | 0x10; - - { - if (DrvTransTab[code&0x1fff] && !opaque) continue; - - UINT8 *gfx = DrvGfxROM + (code & 0x1fff) * 0x40; - color<<=4; - - for (INT32 y = 0; y < 8; y++) { - for (INT32 x = 0; x < 8; x++) { - if ((sy+y) < 0 || (sy+y) >= nScreenHeight || (sx+x) < min_x || (sx+x) >= max_x) continue; - - INT32 pxl = gfx[(y*8)+x]; - - if (pxl || opaque) { - pTransDraw[(sy+y)*nScreenWidth+(sx+x)] = pxl+color; - } - } - } - } - } -} - -static void k007121_sprites_draw(UINT8 *gfx, UINT32 */*palette*/, UINT8 *source, int base_color, int global_x_offset, int bank_base, UINT32 /*pri_mask*/) -{ - INT32 flipscreen = K007121CtrlRAM[7] & 0x08; - - for (INT32 i = 0; i < 0x40; i++) - { - int number = source[0]; - int sprite_bank = source[1] & 0x0f; - int sx = source[3]; - int sy = source[2]; - int attr = source[4]; - int xflip = source[4] & 0x10; - int yflip = source[4] & 0x20; - int color = base_color + ((source[1] & 0xf0) >> 4); - int width, height; - static const int x_offset[4] = {0x0,0x1,0x4,0x5}; - static const int y_offset[4] = {0x0,0x2,0x8,0xa}; - int x,y, ex, ey, flipx, flipy, destx, desty; - - if (attr & 0x01) sx -= 256; - if (sy >= 240) sy -= 256; - - number += ((sprite_bank & 0x3) << 8) + ((attr & 0xc0) << 4); - number = number << 2; - number += (sprite_bank >> 2) & 3; - - { - number += bank_base; - - switch (attr & 0xe) - { - case 0x06: width = height = 1; break; - case 0x04: width = 1; height = 2; number &= (~2); break; - case 0x02: width = 2; height = 1; number &= (~1); break; - case 0x00: width = height = 2; number &= (~3); break; - case 0x08: width = height = 4; number &= (~3); break; - default: width = 1; height = 1; - } - - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - ex = xflip ? (width - 1 - x) : x; - ey = yflip ? (height - 1 - y) : y; - - if (flipscreen) - { - flipx = !xflip; - flipy = !yflip; - destx = 248 - (sx + x * 8); - desty = 248 - (sy + y * 8); - } - else - { - flipx = xflip; - flipy = yflip; - destx = global_x_offset + sx + x * 8; - desty = sy + y * 8; - } - - if (!DrvTransTab[(number + x_offset[ex] + y_offset[ey])&0x1fff]) - RenderTileTranstab(pTransDraw, gfx, (number + x_offset[ex] + y_offset[ey])&0x1fff, color<<4, 0, destx, desty - 16, flipx, flipy, 8, 8, DrvSprTranspLut); - } - } - } - - source += 5; - } -} - -static void DrvPaletteInit() -{ - UINT32 pens[0x80]; - - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x100/2; i++) { - UINT16 p = (pal[i] << 8) | (pal[i] >> 8); - - INT32 b = (p >> 10) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 r = (p >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x800; i++) { - DrvPalette[i] = pens[DrvLookUpTable[i]]; - } - - DrvPalette[0x800] = BurnHighCol(0,0,0,0); // black -} - -static INT32 DrvDraw() -{ - if (DrvPalWritten || DrvRecalc) { - DrvRecalc = 0; - DrvPalWritten = 0; - DrvPaletteInit(); - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x800; - } - - INT32 c3 = K007121CtrlRAM[3] & 0x40; - - if (nBurnLayer & 1) draw_layer(0); - if (nSpriteEnable & 1 && c3) k007121_sprites_draw(DrvGfxROM, DrvPalette, DrvSprRAM, (K007121CtrlRAM[6] & 0x30) * 2, 40,0, (K007121CtrlRAM[3] & 0x40) >> 5); - if (nBurnLayer & 2) draw_layer(1); - if (nSpriteEnable & 1 && !c3) k007121_sprites_draw(DrvGfxROM, DrvPalette, DrvSprRAM, (K007121CtrlRAM[6] & 0x30) * 2, 40,0, (K007121CtrlRAM[3] & 0x40) >> 5); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - HD6309NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c; - if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal = 3000000 / 60; - - HD6309Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - BurnTimerUpdate((i+1) * (nCyclesTotal / nInterleave)); - - // the timings of these is extremely important.. and currently wrong. - if ((i & 0x3f) == 0x3f && (K007121CtrlRAM[7] & 0x01)) HD6309SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - - if (i == 253 && (K007121CtrlRAM[7] & 0x02)) HD6309SetIRQLine(0x00, CPU_IRQSTATUS_AUTO); - } - - BurnTimerEndFrame(nCyclesTotal); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - HD6309Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - HD6309Scan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(HD6309Bank); - } - - if (nAction & ACB_WRITE) { - INT32 bank = HD6309Bank; - HD6309Bank = -1; - - HD6309Open(0); - bankswitch(bank); - HD6309Close(); - } - - return 0; -} - - -// Trick Trap (World?) - -static struct BurnRomInfo tricktrpRomDesc[] = { - { "771e04", 0x10000, 0xba2c7e20, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - { "771e03", 0x10000, 0xd0d68036, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "771e01a", 0x10000, 0x103ffa0d, 2 | BRF_GRA }, // 2 Graphics Tiles - { "771e01c", 0x10000, 0xcfec5be9, 2 | BRF_GRA }, // 3 - { "771d01b", 0x10000, 0x07f2a71c, 2 | BRF_GRA }, // 4 - { "771d01d", 0x10000, 0xf6810a49, 2 | BRF_GRA }, // 5 - - { "771d02.08d", 0x00100, 0x3d34bb5a, 3 | BRF_GRA }, /// 6 Sprite Color Lookup Tables -}; - -STD_ROM_PICK(tricktrp) -STD_ROM_FN(tricktrp) - -struct BurnDriver BurnDrvTricktrp = { - "tricktrp", NULL, NULL, NULL, "1987", - "Trick Trap (World?)\0", "Graphics issues in the ending credits.", "Konami", "GX771", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, tricktrpRomInfo, tricktrpRomName, NULL, NULL, LabyrunrInputInfo, LabyrunrDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 280, 3, 4 -}; - - -// Labyrinth Runner (Japan) - -static struct BurnRomInfo labyrunrRomDesc[] = { - { "771j04.10f", 0x10000, 0x354a41d0, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - { "771j03.08f", 0x10000, 0x12b49044, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "771d01.14a", 0x40000, 0x15c8f5f9, 2 | BRF_GRA }, // 2 Graphics Tiles - - { "771d02.08d", 0x00100, 0x3d34bb5a, 3 | BRF_GRA }, // 3 Sprite Color Lookup Tables -}; - -STD_ROM_PICK(labyrunr) -STD_ROM_FN(labyrunr) - -struct BurnDriver BurnDrvLabyrunr = { - "labyrunr", "tricktrp", NULL, NULL, "1987", - "Labyrinth Runner (Japan)\0", "Graphics issues in the ending credits.", "Konami", "GX771", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, labyrunrRomInfo, labyrunrRomName, NULL, NULL, LabyrunrInputInfo, LabyrunrDIPInfo, - DrvInit2, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 280, 3, 4 -}; - - -// Labyrinth Runner (World Ver. K) - -static struct BurnRomInfo labyrunrkRomDesc[] = { - { "771k04.10f", 0x10000, 0x9816ab35, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - { "771k03.8f", 0x10000, 0x48d732ae, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "771d01a.13a", 0x10000, 0x0cd1ed1a, 2 | BRF_GRA }, // 2 Graphics Tiles - { "771d01c.13a", 0x10000, 0xd75521fe, 2 | BRF_GRA }, // 3 - { "771d01b", 0x10000, 0x07f2a71c, 2 | BRF_GRA }, // 4 - { "771d01d", 0x10000, 0xf6810a49, 2 | BRF_GRA }, // 5 - - { "771d02.08d", 0x00100, 0x3d34bb5a, 3 | BRF_GRA }, // 6 Sprite Color Lookup Tables -}; - -STD_ROM_PICK(labyrunrk) -STD_ROM_FN(labyrunrk) - -struct BurnDriver BurnDrvLabyrunrk = { - "labyrunrk", "tricktrp", NULL, NULL, "1987", - "Labyrinth Runner (World Ver. K)\0", "Graphics issues in the ending credits.", "Konami", "GX771", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, labyrunrkRomInfo, labyrunrkRomName, NULL, NULL, LabyrunrInputInfo, LabyrunrDIPInfo, - DrvInit, DrvExit, DrvFrame,DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 280, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_lethal.cpp b/jan/src/burn/drv/konami/d_lethal.cpp deleted file mode 100644 index fa89479d8..000000000 --- a/jan/src/burn/drv/konami/d_lethal.cpp +++ /dev/null @@ -1,1041 +0,0 @@ -// FB Alpha Lethal Enforcers driver module -// Based on MAME driver by R. Belmont and Nicola Salmoria -// Notes: -// japan version needs sprites fixed (x flipped not y flipped) -// - -#include "tiles_generic.h" -#include "hd6309_intf.h" -#include "z80_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k054539.h" -#include "eeprom.h" -#include "burn_gun.h" - -static UINT8 *AllMem; -static UINT8 *DrvMainROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvEeprom; -static UINT8 *AllRam; -static UINT8 *DrvMainRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 current_4800_bank = 0; -static INT32 layer_colorbase[4]; -static INT32 sprite_colorbase = 0; -static INT32 sound_nmi_enable = 0; -static INT32 screen_flip = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvReset; -static UINT8 DrvInputs[1]; -static UINT8 DrvDips[1]; - -static INT32 LethalGun0 = 0; -static INT32 LethalGun1 = 0; -static INT32 LethalGun2 = 0; -static INT32 LethalGun3 = 0; -static UINT8 ReloadGun0 = 0; -static UINT8 ReloadGun1 = 0; - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo LethalenInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "mouse button 1" }, - {"P1 Button 2", BIT_DIGITAL, &ReloadGun0 , "mouse button 2" }, - A("P1 Gun X", BIT_ANALOG_REL, &LethalGun0 , "mouse x-axis" ), - A("P1 Gun Y", BIT_ANALOG_REL, &LethalGun1 , "mouse y-axis" ), - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, &ReloadGun1 , "p2 fire 2" }, - A("P2 Gun X", BIT_ANALOG_REL, &LethalGun2 , "p2 x-axis" ), - A("P2 Gun Y", BIT_ANALOG_REL, &LethalGun3 , "p2 y-axis" ), - - {"Reset", BIT_DIGITAL, &DrvReset , "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dips", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Lethalen) - -static struct BurnDIPInfo LethalenDIPList[]= -{ - {0x0c, 0xff, 0xff, 0xd8, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0c, 0x01, 0x08, 0x08, "Off" }, - {0x0c, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x0c, 0x01, 0x10, 0x10, "English" }, - {0x0c, 0x01, 0x10, 0x00, "Spanish" }, - - {0 , 0xfe, 0 , 2, "Game Type" }, - {0x0c, 0x01, 0x20, 0x20, "Street" }, - {0x0c, 0x01, 0x20, 0x00, "Arcade" }, - - {0 , 0xfe, 0 , 2, "Coin Mechanism" }, - {0x0c, 0x01, 0x40, 0x40, "Common" }, - {0x0c, 0x01, 0x40, 0x00, "Independent" }, - - {0 , 0xfe, 0 , 2, "Sound Output" }, - {0x0c, 0x01, 0x80, 0x00, "Mono" }, - {0x0c, 0x01, 0x80, 0x80, "Stereo" }, -}; - -STDDIPINFO(Lethalen) - -#define GUNX(a) (( ( BurnGunReturnX(a - 1) * 287 ) / 0xff ) + 16) -#define GUNY(a) (( ( BurnGunReturnY(a - 1) * 223 ) / 0xff ) + 10) - -static UINT8 guns_r(UINT16 address) -{ - switch (address) - { - case 0: - return (ReloadGun0) ? 16 >> 1: GUNX(1) >> 1; - case 1: - if ((GUNY(1)<=0x0b) || (GUNY(1)>=0xe8)) - return 0; - else - return (ReloadGun0) ? 0 : (232 - GUNY(1)); - case 2: - return (ReloadGun1) ? 16 >> 1: GUNX(2) >> 1; - case 3: - if ((GUNY(2)<=0x0b) || (GUNY(2)>=0xe8)) - return 0; - else - return (ReloadGun1) ? 0 : (232 - GUNY(2)); - } - - return 0; -} - -static UINT8 gunsaux_r() -{ - int res = 0; - - if (ReloadGun0) return 0; - - if (GUNX(1) & 1) res |= 0x80; - if (GUNX(2) & 1) res |= 0x40; - - return res; -} - -#undef GUNX -#undef GUNY - -static void bankswitch(INT32 bank) -{ - bank = (bank & 0x1f) * 0x2000; - - HD6309MapMemory(DrvMainROM + bank, 0x0000, 0x1fff, MAP_ROM); -} - -static void lethal_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xffc0) == 0x4000) { - K056832ByteWrite(address, data); - return; - } - - if ((address & 0xfff0) == 0x4040) { - // K056832_regb - return; - } - - switch (address) - { - case 0x40c4: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - current_4800_bank = (data >> 4) & 1; - return; - - case 0x40c5: - case 0x40c6: - case 0x40c7: - return; - - case 0x40c8: - layer_colorbase[0] = ((data & 0x7) - 1) * 0x40; - layer_colorbase[1] = (((data >> 4) & 0x7) - 1) * 0x40; - break; - - case 0x40c9: - case 0x40ca: - case 0x40cb: - return; - - case 0x40cc: - layer_colorbase[2] = ((data & 0x7) - 1) * 0x40; - layer_colorbase[3] = (((data >> 4) & 0x7) - 1) * 0x40; - return; - - case 0x40cd: - case 0x40ce: - case 0x40cf: - break; - - case 0x40d0: - sprite_colorbase = ((data & 0x7) - 1) * 0x40; - return; - - case 0x40dc: - bankswitch(data); - return; - - case 0x47fe: - case 0x47ff: - DrvPalRAM[0x3800 + (address & 1)] = data; - return; - } - - if (address < 0x4800 || address >= 0x8000) return; - - address = (address - 0x4800) + (0x3800 * current_4800_bank); - - if (address >= 0x3800 && address < 0x8000) { - DrvPalRAM[(address - 0x3800)] = data; - return; - } - - if ((address & 0xfff0) == 0x0040) { - K053244Write(0, (address & 0x0f), data); - return; - } - - if ((address & 0xffe0) == 0x0080) { - K054000Write(address, data); - return; - } - - if (address >= 0x0800 && address <= 0x17ff) { - K053245Write(0, address & 0x7ff, data); - return; - } - - if (address >= 0x1800 && address < 0x3800) { - address -= 0x1800; - INT32 offset = (((address & 0x1800) ^ 0x1000) >> 11) | ((address & 0x07ff) << 2); - K056832RamWriteByte(offset^1, data); - return; - } - - switch (address) - { - case 0x00c6: - *soundlatch = data; - return; - - case 0x00c7: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -static UINT8 lethal_main_read(UINT16 address) -{ - switch (address) - { - case 0x40d4: - case 0x40d5: - case 0x40d6: - case 0x40d7: - return guns_r(address-0x40d4); - - case 0x40d8: - return (DrvDips[0] & 0xfc) | 2 | (EEPROMRead() ? 0x01 : 0); - - case 0x40d9: - return DrvInputs[0]; - - case 0x40db: - case 0x40dc: - case 0x40de: - case 0x40dd: - return gunsaux_r(); - } - - if (address < 0x4800 || address >= 0x8000) return 0; - - address = (address - 0x4800) + (0x3800 * current_4800_bank); - - if (address >= 0x3800 && address < 0x8000) { - return DrvPalRAM[(address - 0x3800)]; - } - - if ((address & 0xfff0) == 0x0040) { - return K053244Read(0, address & 0xf); - } - - if ((address & 0xffe0) == 0x0080) { - return K054000Read(address); - } - - if (address >= 0x0800 && address <= 0x17ff) { - return K053245Read(0, address & 0x7ff); - } - - if (address >= 0x1800 && address < 0x3800) { - address -= 0x1800; - - INT32 offset = (((address & 0x1800) ^ 0x1000) >> 11) | ((address & 0x07ff) << 2); - return K056832RamReadByte(offset^1); - } - - switch (address) - { - case 0x00ca: - return 0x0f; - } - - return 0; -} - -static void __fastcall lethal_sound_write(UINT16 address, UINT8 data) -{ - if (address >= 0xf800 && address <= 0xfa2f) { - if (address == 0xfa2f) sound_nmi_enable = data & 0x20; - K054539Write(0, address & 0x3ff, data); - return; - } - - switch (address) - { - case 0xfc00: - *soundlatch2 = data; - return; - } -} - -static UINT8 __fastcall lethal_sound_read(UINT16 address) -{ - if (address >= 0xf800 && address <= 0xfa2f) { - return K054539Read(0, address & 0x3ff); - } - - switch (address) - { - case 0xfc02: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xfc03: - return 0; // soundlatch2? - } - - return 0; -} - -static const eeprom_interface lethalen_eeprom_interface = -{ - 7, - 8, - "011000", - "011100", - "0100100000000", - "0100000000000", - "0100110000000", - 0, - 0 -}; - -static void lethal_sprite_callback(INT32 *code, INT32 *color, INT32 *priority) -{ - INT32 pri = (*color & 0xfff0); - *color = *color & 0x000f; - *color += 0x400 / 64; - - if (pri == 0x10) *priority = 0xf0; - else if (pri == 0x90) *priority = 0xf0; - else if (pri == 0x20) *priority = 0xfc; - else if (pri == 0xa0) *priority = 0xfc; - else if (pri == 0x40) *priority = 0; - else if (pri == 0x00) *priority = 0; - else if (pri == 0x30) *priority = 0xfe; - else *priority = 0; - - *code = (*code & 0x3fff); -} - -static void lethal_tile_callback(INT32 layer, INT32 *code, INT32 *color, INT32 */*flags*/) -{ - *color = layer_colorbase[layer] + ((*color & 0x3c) << 2); - *code &= 0xffff; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - KonamiICReset(); - - K054539Reset(0); - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvEeprom, 0, 128); - } - - layer_colorbase[0] = 0x00; - layer_colorbase[1] = 0x40; - layer_colorbase[2] = 0x80; - layer_colorbase[3] = 0xc0; - - sound_nmi_enable = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROMExp0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROMExp1 = Next; Next += 0x800000; - - DrvSndROM = Next; Next += 0x200000; - - DrvEeprom = Next; Next += 0x000080; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - AllRam = Next; - - DrvMainRAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x004000; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ -#if 0 - INT32 Plane0[8] = { STEP4((0x200000*8), 1), STEP4(0,1) }; - INT32 XOffs0[8] = { STEP8(0,4) }; - INT32 YOffs0[8] = { STEP8(0,32) }; - - INT32 Plane1[6] = { (0x200000*8)+8, (0x200000*8)+0, STEP4(24, -8) }; - INT32 XOffs1[16] = { STEP8(0,7), STEP8(256, 1) }; - INT32 YOffs1[16] = { STEP8(0,32), STEP8(512,32) }; -#endif - INT32 Plane0[8] = { 0+(0x200000*8), 1+(0x200000*8), 2+(0x200000*8), 3+(0x200000*8), 0, 1, 2, 3 }; - INT32 XOffs0[8] = { 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4 }; - INT32 YOffs0[8] = { 0*8*4, 1*8*4, 2*8*4, 3*8*4, 4*8*4, 5*8*4, 6*8*4, 7*8*4 }; - - INT32 Plane1[6] = { (0x200000*8)+8, (0x200000*8)+0, 24, 16, 8, 0 }; - INT32 XOffs1[16] = { 0, 1, 2, 3, 4, 5, 6, 7,8*32+0, 8*32+1, 8*32+2, 8*32+3, 8*32+4, 8*32+5, 8*32+6, 8*32+7 }; - INT32 YOffs1[16] = { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 }; - - GfxDecode(0x10000, 8, 8, 8, Plane0, XOffs0, YOffs0, 8*8*4, DrvGfxROM0, DrvGfxROMExp0); - GfxDecode(0x04000, 6, 16, 16, Plane1, XOffs1, YOffs1, 128*8, DrvGfxROM1, DrvGfxROMExp1); - - return 0; -} - -static INT32 DrvInit(INT32 flipy) -{ - screen_flip = (flipy) ? 0 : 1; - - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 2, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x200002, 4, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x200000, 5, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 6, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 7, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x200000, 8, 4, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 10, 1)) return 1; - - DrvGfxDecode(); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvMainROM + 0x00000, 0x0000, 0x1fff, MAP_ROM); - HD6309MapMemory(DrvMainRAM, 0x2000, 0x3fff, MAP_RAM); - HD6309MapMemory(DrvMainROM + 0x38000, 0x8000, 0xffff, MAP_ROM); - HD6309SetReadHandler(lethal_main_read); - HD6309SetWriteHandler(lethal_main_write); - HD6309Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xefff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(lethal_sound_write); - ZetSetReadHandler(lethal_sound_read); - ZetClose(); - - EEPROMInit(&lethalen_eeprom_interface); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x400000, lethal_tile_callback); - K056832SetGlobalOffsets((flipy) ? 216 : 224, 16); - K056832SetExtLinescroll(); - - K053245Init(0, DrvGfxROM1, DrvGfxROMExp1, 0x3fffff, lethal_sprite_callback); - K053245SetSpriteOffset(0, (flipy) ? (-216+96) : (-224-105), -15); - K053245SetBpp(0, 6); - - K054539Init(0, 48000, DrvSndROM, 0x200000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - BurnGunInit(2, true); - - return 0; -} - -static INT32 LethalenInit() -{ - return DrvInit(1); -} - -static INT32 LethalenjInit() -{ - return DrvInit(0); -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - HD6309Exit(); - ZetExit(); - - EEPROMExit(); - - K054539Exit(); - - BurnGunExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x3802/2; i++) - { - UINT16 p = (pal[i] >> 8) | (pal[i] << 8); - - INT32 r = (p & 0x1f); - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = (r << 16) + (g << 8) + b; - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - if (screen_flip) { // x - K056832SetLayerOffsets(0, -195, 0); - K056832SetLayerOffsets(1, -193, 0); - K056832SetLayerOffsets(2, -191, 0); - K056832SetLayerOffsets(3, -189, 0); - } else { - K056832SetLayerOffsets(0, 188, 0); - K056832SetLayerOffsets(1, 190, 0); - K056832SetLayerOffsets(2, 192, 0); - K056832SetLayerOffsets(3, 194, 0); - } - - KonamiClearBitmaps(DrvPalette[0x1c00]); - - if (nBurnLayer & 1) K056832Draw(3, K056832_DRAW_FLAG_MIRROR, 1); - if (nBurnLayer & 2) K056832Draw(2, K056832_DRAW_FLAG_MIRROR, 2); - if (nBurnLayer & 4) K056832Draw(1, K056832_DRAW_FLAG_MIRROR, 4); - - if (nSpriteEnable & 1) K053245SpritesRender(0); - - if (nBurnLayer & 8) K056832Draw(0, K056832_DRAW_FLAG_MIRROR, 0); - -#if 1 - if (screen_flip) // flip horizontally - { - UINT32 tmp; - for (INT32 y = 0; y < nScreenHeight; y++) { - UINT32 *src = konami_bitmap32 + (y * nScreenWidth); - for (INT32 x = 0; x < (nScreenWidth / 2); x++) { - tmp = src[x]; - src[x] = src[((nScreenWidth - 1) - x)]; - src[((nScreenWidth - 1) - x)] = tmp; - } - } - } - else // flip vertically.. - { - UINT32 tmp[512]; - for (INT32 y = 0; y < (nScreenHeight / 2); y++) { - UINT32 *src = konami_bitmap32 + (y * nScreenWidth); - UINT32 *dst = konami_bitmap32 + ((nScreenHeight - 1) - y) * nScreenWidth; - memcpy (tmp, src, nScreenWidth * 4); - memcpy (src, dst, nScreenWidth * 4); - memcpy (dst, tmp, nScreenWidth * 4); - } - } -#endif - KonamiBlendCopy(DrvPalette); - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0xff; - - if (ReloadGun0) { // for simulated reload-gun button - DrvJoy1[4] = 1; - } - if (ReloadGun1) { - DrvJoy1[5] = 1; - } - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - - if (!ReloadGun0) - BurnGunMakeInputs(0, (INT16)LethalGun0, (INT16)LethalGun1); - if (!ReloadGun1) - BurnGunMakeInputs(1, (INT16)LethalGun2, (INT16)LethalGun3); - } - - INT32 nInterleave = nBurnSoundLen; - INT32 nCyclesTotal[2] = { 3000000 / 60, 6000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - HD6309Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = HD6309Run(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - if ((i % (nInterleave / 8)) == ((nInterleave / 8) - 1) && sound_nmi_enable) { - ZetNmi(); - } - } - - if (K056832IsIrqEnabled()) { - HD6309SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * 2); - K054539Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - HD6309Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029732; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - HD6309Scan(nAction); - ZetScan(nAction); - - K054539Scan(nAction); - - KonamiICScan(nAction); - BurnGunScan(); - - SCAN_VAR(current_4800_bank); - SCAN_VAR(sound_nmi_enable); - SCAN_VAR(layer_colorbase); - SCAN_VAR(sprite_colorbase); - } - - return 0; -} - - -// Lethal Enforcers (ver UAE, 11/19/92 15:04) - -static struct BurnRomInfo lethalenRomDesc[] = { - { "191uae01.u4", 0x040000, 0xdca340e3, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "191a02.f4", 0x010000, 0x72b843cc, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "191a08", 0x100000, 0x555bd4db, 3 | BRF_GRA }, // 2 K056832 Characters - { "191a10", 0x100000, 0x2fa9bf51, 3 | BRF_GRA }, // 3 - { "191a07", 0x100000, 0x1dad184c, 3 | BRF_GRA }, // 4 - { "191a09", 0x100000, 0xe2028531, 3 | BRF_GRA }, // 5 - - { "191a05", 0x100000, 0xf2e3b58b, 4 | BRF_GRA }, // 6 K053244 Sprites - { "191a04", 0x100000, 0x5c3eeb2b, 4 | BRF_GRA }, // 7 - { "191a06", 0x100000, 0xee11fc08, 4 | BRF_GRA }, // 8 - - { "191a03", 0x200000, 0x9b13fbe8, 5 | BRF_SND }, // 9 K054539 Samples - - { "lethalenue.nv", 0x000080, 0x6e7224e6, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(lethalen) -STD_ROM_FN(lethalen) - -struct BurnDriver BurnDrvLethalen = { - "lethalen", NULL, NULL, NULL, "1992", - "Lethal Enforcers (ver UAE, 11/19/92 15:04)\0", NULL, "Konami", "GX191", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, lethalenRomInfo, lethalenRomName, NULL, NULL, LethalenInputInfo, LethalenDIPInfo, - LethalenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Lethal Enforcers (ver UAB, 09/01/92 11:12) - -static struct BurnRomInfo lethalenubRomDesc[] = { - { "191uab01.u4", 0x040000, 0x2afd7528, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "191a02.f4", 0x010000, 0x72b843cc, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "191a08", 0x100000, 0x555bd4db, 3 | BRF_GRA }, // 2 K056832 Characters - { "191a10", 0x100000, 0x2fa9bf51, 3 | BRF_GRA }, // 3 - { "191a07", 0x100000, 0x1dad184c, 3 | BRF_GRA }, // 4 - { "191a09", 0x100000, 0xe2028531, 3 | BRF_GRA }, // 5 - - { "191a05", 0x100000, 0xf2e3b58b, 4 | BRF_GRA }, // 6 K053244 Sprites - { "191a04", 0x100000, 0x5c3eeb2b, 4 | BRF_GRA }, // 7 - { "191a06", 0x100000, 0xee11fc08, 4 | BRF_GRA }, // 8 - - { "191a03", 0x200000, 0x9b13fbe8, 5 | BRF_SND }, // 9 K054539 Samples - - { "lethalenub.nv", 0x000080, 0x14c6c6e5, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(lethalenub) -STD_ROM_FN(lethalenub) - -struct BurnDriver BurnDrvLethalenub = { - "lethalenub", "lethalen", NULL, NULL, "1992", - "Lethal Enforcers (ver UAB, 09/01/92 11:12)\0", NULL, "Konami", "GX191", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, lethalenubRomInfo, lethalenubRomName, NULL, NULL, LethalenInputInfo, LethalenDIPInfo, - LethalenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Lethal Enforcers (ver UAA, 08/17/92 21:38) - -static struct BurnRomInfo lethalenuaRomDesc[] = { - { "191uaa01.u4", 0x040000, 0xab6b8f16, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "191a02.f4", 0x010000, 0x72b843cc, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "191a08", 0x100000, 0x555bd4db, 3 | BRF_GRA }, // 2 K056832 Characters - { "191a10", 0x100000, 0x2fa9bf51, 3 | BRF_GRA }, // 3 - { "191a07", 0x100000, 0x1dad184c, 3 | BRF_GRA }, // 4 - { "191a09", 0x100000, 0xe2028531, 3 | BRF_GRA }, // 5 - - { "191a05", 0x100000, 0xf2e3b58b, 4 | BRF_GRA }, // 6 K053244 Sprites - { "191a04", 0x100000, 0x5c3eeb2b, 4 | BRF_GRA }, // 7 - { "191a06", 0x100000, 0xee11fc08, 4 | BRF_GRA }, // 8 - - { "191a03", 0x200000, 0x9b13fbe8, 5 | BRF_SND }, // 9 K054539 Samples - - { "lethalenua.nv", 0x000080, 0xf71ad1c3, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(lethalenua) -STD_ROM_FN(lethalenua) - -struct BurnDriver BurnDrvLethalenua = { - "lethalenua", "lethalen", NULL, NULL, "1992", - "Lethal Enforcers (ver UAA, 08/17/92 21:38)\0", NULL, "Konami", "GX191", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, lethalenuaRomInfo, lethalenuaRomName, NULL, NULL, LethalenInputInfo, LethalenDIPInfo, - LethalenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Lethal Enforcers (ver unknown, US, 08/06/92 15:11, hacked/proto?) - -static struct BurnRomInfo lethalenuxRomDesc[] = { - { "191xxx01.u4", 0x040000, 0xa3b9e790, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "191a02.f4", 0x010000, 0x72b843cc, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "191a08", 0x100000, 0x555bd4db, 3 | BRF_GRA }, // 2 K056832 Characters - { "191a10", 0x100000, 0x2fa9bf51, 3 | BRF_GRA }, // 3 - { "191a07", 0x100000, 0x1dad184c, 3 | BRF_GRA }, // 4 - { "191a09", 0x100000, 0xe2028531, 3 | BRF_GRA }, // 5 - - { "191a05", 0x100000, 0xf2e3b58b, 4 | BRF_GRA }, // 6 K053244 Sprites - { "191a04", 0x100000, 0x5c3eeb2b, 4 | BRF_GRA }, // 7 - { "191a06", 0x100000, 0xee11fc08, 4 | BRF_GRA }, // 8 - - { "191a03", 0x200000, 0x9b13fbe8, 5 | BRF_SND }, // 9 K054539 Samples - - { "lethalenux.nv", 0x000080, 0x5d69c39d, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(lethalenux) -STD_ROM_FN(lethalenux) - -struct BurnDriver BurnDrvLethalenux = { - "lethalenux", "lethalen", NULL, NULL, "1992", - "Lethal Enforcers (ver unknown, US, 08/06/92 15:11, hacked/proto?)\0", NULL, "Konami", "GX191", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, lethalenuxRomInfo, lethalenuxRomName, NULL, NULL, LethalenInputInfo, LethalenDIPInfo, - LethalenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Lethal Enforcers (ver EAA, 09/09/92 09:44) - -static struct BurnRomInfo lethaleneaaRomDesc[] = { - { "191_a01.u4", 0x040000, 0xc6f4d712, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "191a02.f4", 0x010000, 0x72b843cc, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "191a08", 0x100000, 0x555bd4db, 3 | BRF_GRA }, // 2 K056832 Characters - { "191a10", 0x100000, 0x2fa9bf51, 3 | BRF_GRA }, // 3 - { "191a07", 0x100000, 0x1dad184c, 3 | BRF_GRA }, // 4 - { "191a09", 0x100000, 0xe2028531, 3 | BRF_GRA }, // 5 - - { "191a05", 0x100000, 0xf2e3b58b, 4 | BRF_GRA }, // 6 K053244 Sprites - { "191a04", 0x100000, 0x5c3eeb2b, 4 | BRF_GRA }, // 7 - { "191a06", 0x100000, 0xee11fc08, 4 | BRF_GRA }, // 8 - - { "191a03", 0x200000, 0x9b13fbe8, 5 | BRF_SND }, // 9 K054539 Samples - - { "lethaleneaa.nv", 0x000080, 0xa85d64ee, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(lethaleneaa) -STD_ROM_FN(lethaleneaa) - -struct BurnDriver BurnDrvLethaleneaa = { - "lethaleneaa", "lethalen", NULL, NULL, "1992", - "Lethal Enforcers (ver EAA, 09/09/92 09:44)\0", NULL, "Konami", "GX191", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, lethaleneaaRomInfo, lethaleneaaRomName, NULL, NULL, LethalenInputInfo, LethalenDIPInfo, - LethalenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Lethal Enforcers (ver EAB, 10/14/92 19:53) - -static struct BurnRomInfo lethaleneabRomDesc[] = { - { "191eab01.u4", 0x040000, 0xd7ce111e, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "191a02.f4", 0x010000, 0x72b843cc, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "191a08", 0x100000, 0x555bd4db, 3 | BRF_GRA }, // 2 K056832 Characters - { "191a10", 0x100000, 0x2fa9bf51, 3 | BRF_GRA }, // 3 - { "191a07", 0x100000, 0x1dad184c, 3 | BRF_GRA }, // 4 - { "191a09", 0x100000, 0xe2028531, 3 | BRF_GRA }, // 5 - - { "191a05", 0x100000, 0xf2e3b58b, 4 | BRF_GRA }, // 6 K053244 Sprites - { "191a04", 0x100000, 0x5c3eeb2b, 4 | BRF_GRA }, // 7 - { "191a06", 0x100000, 0xee11fc08, 4 | BRF_GRA }, // 8 - - { "191a03", 0x200000, 0x9b13fbe8, 5 | BRF_SND }, // 9 K054539 Samples - - { "lethaleneab.nv", 0x000080, 0x4e9bb34d, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(lethaleneab) -STD_ROM_FN(lethaleneab) - -struct BurnDriver BurnDrvLethaleneab = { - "lethaleneab", "lethalen", NULL, NULL, "1992", - "Lethal Enforcers (ver EAB, 10/14/92 19:53)\0", NULL, "Konami", "GX191", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, lethaleneabRomInfo, lethaleneabRomName, NULL, NULL, LethalenInputInfo, LethalenDIPInfo, - LethalenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Lethal Enforcers (ver EAE, 11/19/92 16:24) - -static struct BurnRomInfo lethaleneaeRomDesc[] = { - { "191eae01.u4", 0x040000, 0xc6a3c6ac, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "191a02.f4", 0x010000, 0x72b843cc, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "191a08", 0x100000, 0x555bd4db, 3 | BRF_GRA }, // 2 K056832 Characters - { "191a10", 0x100000, 0x2fa9bf51, 3 | BRF_GRA }, // 3 - { "191a07", 0x100000, 0x1dad184c, 3 | BRF_GRA }, // 4 - { "191a09", 0x100000, 0xe2028531, 3 | BRF_GRA }, // 5 - - { "191a05", 0x100000, 0xf2e3b58b, 4 | BRF_GRA }, // 6 K053244 Sprites - { "191a04", 0x100000, 0x5c3eeb2b, 4 | BRF_GRA }, // 7 - { "191a06", 0x100000, 0xee11fc08, 4 | BRF_GRA }, // 8 - - { "191a03", 0x200000, 0x9b13fbe8, 5 | BRF_SND }, // 9 K054539 Samples - - { "lethaleneae.nv", 0x000080, 0xeb369a67, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(lethaleneae) -STD_ROM_FN(lethaleneae) - -struct BurnDriver BurnDrvLethaleneae = { - "lethaleneae", "lethalen", NULL, NULL, "1992", - "Lethal Enforcers (ver EAE, 11/19/92 16:24)\0", NULL, "Konami", "GX191", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, lethaleneaeRomInfo, lethaleneaeRomName, NULL, NULL, LethalenInputInfo, LethalenDIPInfo, - LethalenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Lethal Enforcers (ver JAD, 12/04/92 17:16) - -static struct BurnRomInfo lethalenjRomDesc[] = { - { "191jad01.u4", 0x040000, 0x160a25c0, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "191a02.f4", 0x010000, 0x72b843cc, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "191a08", 0x100000, 0x555bd4db, 3 | BRF_GRA }, // 2 K056832 Characters - { "191a10", 0x100000, 0x2fa9bf51, 3 | BRF_GRA }, // 3 - { "191a07", 0x100000, 0x1dad184c, 3 | BRF_GRA }, // 4 - { "191a09", 0x100000, 0xe2028531, 3 | BRF_GRA }, // 5 - - { "191a05", 0x100000, 0xf2e3b58b, 4 | BRF_GRA }, // 6 K053244 Sprites - { "191a04", 0x100000, 0x5c3eeb2b, 4 | BRF_GRA }, // 7 - { "191a06", 0x100000, 0xee11fc08, 4 | BRF_GRA }, // 8 - - { "191a03", 0x200000, 0x9b13fbe8, 5 | BRF_SND }, // 9 K054539 Samples - - { "lethalenj.nv", 0x000080, 0x20b28f2f, 6 | BRF_OPT }, // 10 eeprom data -}; - -STD_ROM_PICK(lethalenj) -STD_ROM_FN(lethalenj) - -struct BurnDriverD BurnDrvLethalenj = { - "lethalenj", "lethalen", NULL, NULL, "1992", - "Lethal Enforcers (ver JAD, 12/04/92 17:16)\0", "no sprites!", "Konami", "GX191", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, lethalenjRomInfo, lethalenjRomName, NULL, NULL, LethalenInputInfo, LethalenDIPInfo, - LethalenjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_mainevt.cpp b/jan/src/burn/drv/konami/d_mainevt.cpp deleted file mode 100644 index 28b1729b1..000000000 --- a/jan/src/burn/drv/konami/d_mainevt.cpp +++ /dev/null @@ -1,1220 +0,0 @@ -// FB Alpha The Main Event / Devastators driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "hd6309_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "upd7759.h" -#include "k007232.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *DrvHD6309ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvHD6309RAM; -static UINT8 *DrvZ80RAM; -static UINT8 *soundlatch; -static UINT8 *irq_enable; -static UINT8 *nmi_enable; - -static UINT8 *nDrvBank; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static INT32 nGame; - -static struct BurnInputInfo MainevtInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 2, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 3, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 0, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 1, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p4 coin" }, - {"P4 Up", BIT_DIGITAL, DrvJoy5 + 2, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy5 + 3, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy5 + 0, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy5 + 1, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 5, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 4, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service2" }, - {"Service 3", BIT_DIGITAL, DrvJoy1 + 6, "service3" }, - {"Service 4", BIT_DIGITAL, DrvJoy1 + 7, "service4" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Mainevt) - -static struct BurnInputInfo Mainevt2pInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service2" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Mainevt2p) - -static struct BurnInputInfo DevstorsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Devstors) - -static struct BurnDIPInfo MainevtDIPList[]= -{ - {0x21, 0xff, 0xff, 0xff, NULL }, - {0x22, 0xff, 0xff, 0x57, NULL }, - {0x23, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x21, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x21, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x21, 0x01, 0x0f, 0x00, "4 Coins 5 Credits" }, - {0x21, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x21, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x21, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x21, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x21, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x21, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x21, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Energy" }, - {0x22, 0x01, 0x18, 0x00, "60" }, - {0x22, 0x01, 0x18, 0x08, "70" }, - {0x22, 0x01, 0x18, 0x10, "80" }, - {0x22, 0x01, 0x18, 0x18, "90" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x60, 0x60, "Easy" }, - {0x22, 0x01, 0x60, 0x40, "Normal" }, - {0x22, 0x01, 0x60, 0x20, "Hard" }, - {0x22, 0x01, 0x60, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x23, 0x01, 0x04, 0x04, "Off" }, - {0x23, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Mainevt) - -static struct BurnDIPInfo Mainevt2pDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x57, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x15, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0f, 0x00, "4 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xf0, 0x00, "4 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Energy" }, - {0x16, 0x01, 0x18, 0x00, "60" }, - {0x16, 0x01, 0x18, 0x08, "70" }, - {0x16, 0x01, 0x18, 0x10, "80" }, - {0x16, 0x01, 0x18, 0x18, "90" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x60, 0x60, "Easy" }, - {0x16, 0x01, 0x60, 0x40, "Normal" }, - {0x16, 0x01, 0x60, 0x20, "Hard" }, - {0x16, 0x01, 0x60, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x04, 0x04, "Off" }, - {0x17, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Mainevt2p) - -static struct BurnDIPInfo DevstorsDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x5e, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "150 and every 200" }, - {0x13, 0x01, 0x18, 0x10, "150 and every 250" }, - {0x13, 0x01, 0x18, 0x08, "150 Only" }, - {0x13, 0x01, 0x18, 0x00, "200 Only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Devstors) - -static struct BurnDIPInfo Devstors2DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x52, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "150 and every 200" }, - {0x13, 0x01, 0x18, 0x10, "150 and every 250" }, - {0x13, 0x01, 0x18, 0x08, "150 Only" }, - {0x13, 0x01, 0x18, 0x00, "200 Only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Devstors2) - -static void bankswitch(INT32 data) -{ - nDrvBank[0] = data & 3; - - INT32 nBank = 0x10000 + nDrvBank[0] * 0x2000; - - HD6309MapMemory(DrvHD6309ROM + nBank, 0x6000, 0x7fff, MAP_ROM); - - K052109RMRDLine = data & 0x40; -} - -UINT8 mainevt_main_read(UINT16 address) -{ - switch (address) - { - case 0x1f94: - return DrvInputs[0]; - - case 0x1f95: - return DrvInputs[1]; - - case 0x1f96: - return DrvInputs[2]; - - case 0x1f97: - return DrvDips[0]; - - case 0x1f98: - return DrvDips[2]; - - case 0x1f99: - return DrvInputs[3]; - - case 0x1f9a: - return DrvInputs[4]; - - case 0x1f9b: - return DrvDips[1]; - } - - if ((address & 0xffe0) == 0x1fa0 && nGame) { - return K051733Read(address); - } - - if ((address & 0xc000) == 0x0000) { - return K052109_051960_r(address & 0x3fff); - } - - return 0; -} - -void mainevt_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1f80: - bankswitch(data); - return; - - case 0x1f84: - *soundlatch = data; - return; - - case 0x1f88: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x1f90: - return; - - case 0x1fb2: - *nmi_enable = data; - return; - } - - if ((address & 0xffe0) == 0x1fa0 && nGame) { - K051733Write(address, data); - return; - } - - if ((address & 0xc000) == 0x0000) { - K052109_051960_w(address & 0x3fff, data); - return; - } -} - -static void soundbankswitch(INT32 data) -{ - INT32 bank_A,bank_B,bank_C; - - nDrvBank[1] = data; - - bank_A = data & 3; - bank_B = (data >> 2) & 3; - bank_C = 0x20000 + ((data >> 4) & 0x03) * 0x20000; - - k007232_set_bank(0, bank_A, bank_B ); - - memcpy (DrvSndROM1, DrvSndROM1 + bank_C, 0x20000); -} - -void __fastcall mainevt_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - UPD7759PortWrite(0, data); - return; - - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xe000: - UPD7759ResetWrite(0, data & 2); - UPD7759StartWrite(0, data & 1); - - *irq_enable = data & 4; - return; - - case 0xf000: - soundbankswitch(data); - return; - } - - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } -} - -UINT8 __fastcall mainevt_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xc000: - case 0xc001: - return BurnYM2151ReadStatus(); - - case 0xd000: - return UPD7759BusyRead(0); - - } - - if ((address & 0xfff0) == 0xb000) { - return K007232ReadReg(0, address & 0x0f); - } - - return 0; -} - -static void K052109Callback(INT32 layer, INT32 /*bank*/, INT32 *code, INT32 *color, INT32 *flipx, INT32 *priority) -{ - INT32 colorbase[3] = { 0, 8, 4 }; - - *flipx = *color & 0x02; - - *priority = ((layer == 2) ? ((*color & 0x20) >> 5) : 0); - - *code |= ((*color & 0x01) << 8) | ((*color & 0x1c) << 7); - *color = colorbase[layer] + ((*color & 0xc0) >> 6); -} - -static void DvK052109Callback(INT32 layer, INT32, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - *code |= ((*color & 0x01) << 8) | ((*color & 0x3c) << 7); - *color = ((layer & 2) << 1) + ((*color & 0xc0) >> 6); -} - -static void K051960Callback(INT32 *, INT32 *color, INT32 *priority, INT32 *) -{ - if (*color & 0x20) *priority = 0xff00; - else if (*color & 0x40) *priority = 0xfff0; - else *priority = 0xfffc; - - *color = 0x0c + (*color & 0x03); -} - -static void DvK051960Callback(INT32 *, INT32 *color, INT32 *, INT32 *) -{ - *color = 0x08 + (*color & 0x07); -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - HD6309Open(0); - HD6309Reset(); - bankswitch(0); - HD6309Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - UPD7759Reset(); - - KonamiICReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvHD6309ROM = Next; Next += 0x020000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROMExp0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROMExp1 = Next; Next += 0x200000; - - DrvSndROM0 = Next; Next += 0x080000; - DrvSndROM1 = Next; Next += 0x0a0000; - - DrvPalette = (UINT32*)Next; Next += 0x100 * sizeof(UINT32); - - AllRam = Next; - - DrvHD6309RAM = Next; Next += 0x002000; - DrvZ80RAM = Next; Next += 0x000400; - - soundlatch = Next; Next += 0x000001; - - irq_enable = Next; Next += 0x000001; - nmi_enable = Next; Next += 0x000001; - - nDrvBank = Next; Next += 0x000002; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 type) -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - nGame = type; - - { - if (BurnLoadRom(DrvHD6309ROM + 0x010000, 0, 1)) return 1; - memcpy (DrvHD6309ROM + 0x08000, DrvHD6309ROM + 0x18000, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 5, 4)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 6, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 7, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x020000, 9, 1)) return 1; - memcpy (DrvSndROM1, DrvSndROM1 + 0x20000, 0x20000); - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x020000 << nGame); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x100000); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvHD6309RAM, 0x4000, 0x5fff, MAP_RAM); - HD6309MapMemory(DrvHD6309ROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - HD6309MapMemory(DrvHD6309ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(mainevt_main_write); - HD6309SetReadHandler(mainevt_main_read); - HD6309Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x83ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x83ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x83ff, 2, DrvZ80RAM); - ZetSetWriteHandler(mainevt_sound_write); - ZetSetReadHandler(mainevt_sound_read); - ZetClose(); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, (0x40000 << type) - 1); - K052109SetCallback(nGame ? DvK052109Callback : K052109Callback); - K052109AdjustScroll(nGame ? 0 : 8, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0xfffff); - K051960SetCallback(nGame ? DvK051960Callback : K051960Callback); - K051960SetSpriteOffset(nGame ? 0 : 8, 0); - - K007232Init(0, 3579545, DrvSndROM0, 0x80000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(0.30, BURN_SND_ROUTE_BOTH); - - UPD7759Init(0, UPD7759_STANDARD_CLOCK, DrvSndROM1); - UPD7759SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - HD6309Exit(); - ZetExit(); - - K007232Exit(); - UPD7759Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvHD6309RAM + 0x1e00, DrvPalette, 0x200); - - K052109UpdateScroll(); - KonamiClearBitmaps(0); - - if (nGame) - { - if (nBurnLayer & 1) K052109RenderLayer(1, K052109_OPAQUE, 0); - if (nBurnLayer & 2) K052109RenderLayer(2, 0, 0); - if (nSpriteEnable & 1) K051960SpritesRender(0, 0); - if (nBurnLayer & 4) K052109RenderLayer(0, 0, 0); - } - else - { - if (nBurnLayer & 1) K052109RenderLayer(1, K052109_OPAQUE, 1); - if (nBurnLayer & 4) K052109RenderLayer(2, K052109_CATEGORY(1), 2); - if (nBurnLayer & 2) K052109RenderLayer(2, K052109_CATEGORY(0), 4); - if (nBurnLayer & 8) K052109RenderLayer(0, 0, 8); - - if (nSpriteEnable & 1) K051960SpritesRender(-1, -1); - } - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - - // Clear Opposites - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[3] & 0x0c) == 0) DrvInputs[3] |= 0x0c; - if ((DrvInputs[3] & 0x03) == 0) DrvInputs[3] |= 0x03; - if ((DrvInputs[4] & 0x0c) == 0) DrvInputs[4] |= 0x0c; - if ((DrvInputs[4] & 0x03) == 0) DrvInputs[4] |= 0x03; - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = nBurnSoundLen; - INT32 nCyclesTotal[2] = { 12000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - HD6309Open(0); - - INT32 nCyclesSoundIrq = nInterleave / (8 >> nGame); - INT32 nCyclesSoundIrqTrigger = nCyclesSoundIrq; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - - nCyclesDone[0] += HD6309Run(nSegment - nCyclesDone[0]); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if (i == nCyclesSoundIrqTrigger-1) { - nCyclesSoundIrqTrigger+=nCyclesSoundIrq; - if (*irq_enable) { - if (nGame) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - else ZetNmi(); - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - UPD7759Update(0, pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (nGame) { - if (nmi_enable[0]) HD6309SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // nmi - } else { - if (K052109_irq_enabled) HD6309SetIRQLine(HD6309_IRQ_LINE, CPU_IRQSTATUS_AUTO); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - UPD7759Update(0, pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - } - } - - HD6309Close(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - HD6309Scan(nAction); - ZetScan(nAction); - - UPD7759Scan(0, nAction, pnMin); - BurnYM2151Scan(nAction); - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - } - - if (nAction & ACB_WRITE) { - HD6309Open(0); - bankswitch(nDrvBank[0]); - HD6309Close(); - - soundbankswitch(nDrvBank[1]); - } - - return 0; -} - - -// The Main Event (4 Players ver. Y) - -static struct BurnRomInfo mainevtRomDesc[] = { - { "799y02.k11", 0x10000, 0xe2e7dbd5, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "799c01.f7", 0x08000, 0x447c4c5c, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "799c06.f22", 0x08000, 0xf839cb58, 3 | BRF_GRA }, // 2 K052109 Tiles - { "799c07.h22", 0x08000, 0x176df538, 3 | BRF_GRA }, // 3 - { "799c08.j22", 0x08000, 0xd01e0078, 3 | BRF_GRA }, // 4 - { "799c09.k22", 0x08000, 0x9baec75e, 3 | BRF_GRA }, // 5 - - { "799b04.h4", 0x80000, 0x323e0c2b, 4 | BRF_GRA }, // 6 K051960 Tiles - { "799b05.k4", 0x80000, 0x571c5831, 4 | BRF_GRA }, // 7 - - { "799b03.d4", 0x80000, 0xf1cfd342, 5 | BRF_SND }, // 8 K007232 Samples - - { "799b06.c22", 0x80000, 0x2c8c47d7, 6 | BRF_GRA }, // 9 UPD7759 - - { "63s141n.k14", 0x00100, 0x61f6c8d1, 7 | BRF_OPT }, // 10 Priority Prom -}; - -STD_ROM_PICK(mainevt) -STD_ROM_FN(mainevt) - -static INT32 mainevtInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvMainevt = { - "mainevt", NULL, NULL, NULL, "1988", - "The Main Event (4 Players ver. Y)\0", NULL, "Konami", "GX799", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, mainevtRomInfo, mainevtRomName, NULL, NULL, MainevtInputInfo, MainevtDIPInfo, - mainevtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 288, 224, 4, 3 -}; - - -// The Main Event (4 Players ver. F) - -static struct BurnRomInfo mainevtoRomDesc[] = { - { "799f02.k11", 0x10000, 0xc143596b, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "799c01.f7", 0x08000, 0x447c4c5c, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "799c06.f22", 0x08000, 0xf839cb58, 3 | BRF_GRA }, // 2 K052109 Tiles - { "799c07.h22", 0x08000, 0x176df538, 3 | BRF_GRA }, // 3 - { "799c08.j22", 0x08000, 0xd01e0078, 3 | BRF_GRA }, // 4 - { "799c09.k22", 0x08000, 0x9baec75e, 3 | BRF_GRA }, // 5 - - { "799b04.h4", 0x80000, 0x323e0c2b, 4 | BRF_GRA }, // 6 K051960 Tiles - { "799b05.k4", 0x80000, 0x571c5831, 4 | BRF_GRA }, // 7 - - { "799b03.d4", 0x80000, 0xf1cfd342, 5 | BRF_SND }, // 8 K007232 Samples - - { "799b06.c22", 0x80000, 0x2c8c47d7, 6 | BRF_GRA }, // 9 UPD7759 - - { "63s141n.k14", 0x00100, 0x61f6c8d1, 7 | BRF_OPT }, // 10 Priority Prom -}; - -STD_ROM_PICK(mainevto) -STD_ROM_FN(mainevto) - -struct BurnDriver BurnDrvMainevto = { - "mainevto", "mainevt", NULL, NULL, "1988", - "The Main Event (4 Players ver. F)\0", NULL, "Konami", "GX799", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, mainevtoRomInfo, mainevtoRomName, NULL, NULL, MainevtInputInfo, MainevtDIPInfo, - mainevtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 288, 224, 4, 3 -}; - - -// The Main Event (2 Players ver. X) - -static struct BurnRomInfo mainevt2pRomDesc[] = { - { "799x02.k11", 0x10000, 0x42cfc650, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "799c01.f7", 0x08000, 0x447c4c5c, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "799c06.f22", 0x08000, 0xf839cb58, 3 | BRF_GRA }, // 2 K052109 Tiles - { "799c07.h22", 0x08000, 0x176df538, 3 | BRF_GRA }, // 3 - { "799c08.j22", 0x08000, 0xd01e0078, 3 | BRF_GRA }, // 4 - { "799c09.k22", 0x08000, 0x9baec75e, 3 | BRF_GRA }, // 5 - - { "799b04.h4", 0x80000, 0x323e0c2b, 4 | BRF_GRA }, // 6 K051960 Tiles - { "799b05.k4", 0x80000, 0x571c5831, 4 | BRF_GRA }, // 7 - - { "799b03.d4", 0x80000, 0xf1cfd342, 5 | BRF_SND }, // 8 K007232 Samples - - { "799b06.c22", 0x80000, 0x2c8c47d7, 6 | BRF_GRA }, // 9 UPD7759 - - { "63s141n.k14", 0x00100, 0x61f6c8d1, 7 | BRF_OPT }, // 10 Priority Prom -}; - -STD_ROM_PICK(mainevt2p) -STD_ROM_FN(mainevt2p) - -struct BurnDriver BurnDrvMainevt2p = { - "mainevt2p", "mainevt", NULL, NULL, "1988", - "The Main Event (2 Players ver. X)\0", NULL, "Konami", "GX799", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, mainevt2pRomInfo, mainevt2pRomName, NULL, NULL, Mainevt2pInputInfo, Mainevt2pDIPInfo, - mainevtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 288, 224, 4, 3 -}; - - -// Ring no Ohja (Japan 2 Players ver. N) - -static struct BurnRomInfo ringohjaRomDesc[] = { - { "799n02.k11", 0x10000, 0xf9305dd0, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "799c01.f7", 0x08000, 0x447c4c5c, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "799c06.f22", 0x08000, 0xf839cb58, 3 | BRF_GRA }, // 2 K052109 Tiles - { "799c07.h22", 0x08000, 0x176df538, 3 | BRF_GRA }, // 3 - { "799c08.j22", 0x08000, 0xd01e0078, 3 | BRF_GRA }, // 4 - { "799c09.k22", 0x08000, 0x9baec75e, 3 | BRF_GRA }, // 5 - - { "799b04.h4", 0x80000, 0x323e0c2b, 4 | BRF_GRA }, // 6 K051960 Tiles - { "799b05.k4", 0x80000, 0x571c5831, 4 | BRF_GRA }, // 7 - - { "799b03.d4", 0x80000, 0xf1cfd342, 5 | BRF_SND }, // 8 K007232 Samples - - { "799b06.c22", 0x80000, 0x2c8c47d7, 6 | BRF_GRA }, // 9 UPD7759 - - { "63s141n.k14", 0x00100, 0x61f6c8d1, 7 | BRF_OPT }, // 10 Priority Prom -}; - -STD_ROM_PICK(ringohja) -STD_ROM_FN(ringohja) - -struct BurnDriver BurnDrvRingohja = { - "ringohja", "mainevt", NULL, NULL, "1988", - "Ring no Ohja (Japan 2 Players ver. N)\0", NULL, "Konami", "GX799", - L"\u30EA\u30F3\u30B0\u306E \u738B\u8005 (Japan 2 Players ver. N)\0Ring no Ohja\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, ringohjaRomInfo, ringohjaRomName, NULL, NULL, Mainevt2pInputInfo, Mainevt2pDIPInfo, - mainevtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 288, 224, 4, 3 -}; - - -// Devastators (ver. Z) - -static struct BurnRomInfo devstorsRomDesc[] = { - { "890z02.k11", 0x10000, 0xebeb306f, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "890k01.f7", 0x08000, 0xd44b3eb0, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "890f06.f22", 0x10000, 0x26592155, 3 | BRF_GRA }, // 2 K052109 Tiles - { "890f07.h22", 0x10000, 0x6c74fa2e, 3 | BRF_GRA }, // 3 - { "890f08.j22", 0x10000, 0x29e12e80, 3 | BRF_GRA }, // 4 - { "890f09.k22", 0x10000, 0x67ca40d5, 3 | BRF_GRA }, // 5 - - { "890f04.h4", 0x80000, 0xf16cd1fa, 4 | BRF_GRA }, // 6 K051960 Tiles - { "890f05.k4", 0x80000, 0xda37db05, 4 | BRF_GRA }, // 7 - - { "890f03.d4", 0x80000, 0x19065031, 6 | BRF_GRA }, // 8 K007232 Samples - - { "63s141n.k14", 0x00100, 0xd3620106, 5 | BRF_OPT }, // 9 Priority Prom -}; - -STD_ROM_PICK(devstors) -STD_ROM_FN(devstors) - -static INT32 devstorsInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvDevstors = { - "devstors", NULL, NULL, NULL, "1988", - "Devastators (ver. Z)\0", "Minor Video glitches in level 2.", "Konami", "GX890", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, devstorsRomInfo, devstorsRomName, NULL, NULL, DevstorsInputInfo, DevstorsDIPInfo, - devstorsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 304, 3, 4 -}; - - -// Devastators (ver. X) - -static struct BurnRomInfo devstors2RomDesc[] = { - { "890x02.k11", 0x10000, 0xe58ebb35, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "890k01.f7", 0x08000, 0xd44b3eb0, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "890f06.f22", 0x10000, 0x26592155, 3 | BRF_GRA }, // 2 K052109 Tiles - { "890f07.h22", 0x10000, 0x6c74fa2e, 3 | BRF_GRA }, // 3 - { "890f08.j22", 0x10000, 0x29e12e80, 3 | BRF_GRA }, // 4 - { "890f09.k22", 0x10000, 0x67ca40d5, 3 | BRF_GRA }, // 5 - - { "890f04.h4", 0x80000, 0xf16cd1fa, 4 | BRF_GRA }, // 6 K051960 Tiles - { "890f05.k4", 0x80000, 0xda37db05, 4 | BRF_GRA }, // 7 - - { "890f03.d4", 0x80000, 0x19065031, 6 | BRF_GRA }, // 8 K007232 Samples - - { "63s141n.k14", 0x00100, 0xd3620106, 5 | BRF_OPT }, // 9 Priority Prom -}; - -STD_ROM_PICK(devstors2) -STD_ROM_FN(devstors2) - -struct BurnDriver BurnDrvDevstors2 = { - "devstors2", "devstors", NULL, NULL, "1988", - "Devastators (ver. X)\0", "Minor Video glitches in level 2.", "Konami", "GX890", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, devstors2RomInfo, devstors2RomName, NULL, NULL, DevstorsInputInfo, Devstors2DIPInfo, - devstorsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 304, 3, 4 -}; - - -// Devastators (ver. V) - -static struct BurnRomInfo devstors3RomDesc[] = { - { "890v02.k11", 0x10000, 0x52f4ccdd, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "890k01.f7", 0x08000, 0xd44b3eb0, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "890f06.f22", 0x10000, 0x26592155, 3 | BRF_GRA }, // 2 K052109 Tiles - { "890f07.h22", 0x10000, 0x6c74fa2e, 3 | BRF_GRA }, // 3 - { "890f08.j22", 0x10000, 0x29e12e80, 3 | BRF_GRA }, // 4 - { "890f09.k22", 0x10000, 0x67ca40d5, 3 | BRF_GRA }, // 5 - - { "890f04.h4", 0x80000, 0xf16cd1fa, 4 | BRF_GRA }, // 6 K051960 Tiles - { "890f05.k4", 0x80000, 0xda37db05, 4 | BRF_GRA }, // 7 - - { "890f03.d4", 0x80000, 0x19065031, 6 | BRF_GRA }, // 8 K007232 Samples - - { "63s141n.k14", 0x00100, 0xd3620106, 5 | BRF_OPT }, // 9 Priority Prom -}; - -STD_ROM_PICK(devstors3) -STD_ROM_FN(devstors3) - -struct BurnDriver BurnDrvDevstors3 = { - "devstors3", "devstors", NULL, NULL, "1988", - "Devastators (ver. V)\0", "Minor Video glitches in level 2.", "Konami", "GX890", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, devstors3RomInfo, devstors3RomName, NULL, NULL, DevstorsInputInfo, DevstorsDIPInfo, - devstorsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 304, 3, 4 -}; - - -// Garuka (Japan ver. W) - -static struct BurnRomInfo garukaRomDesc[] = { - { "890w02.k11", 0x10000, 0xb2f6f538, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - - { "890k01.f7", 0x08000, 0xd44b3eb0, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "890f06.f22", 0x10000, 0x26592155, 3 | BRF_GRA }, // 2 K052109 Tiles - { "890f07.h22", 0x10000, 0x6c74fa2e, 3 | BRF_GRA }, // 3 - { "890f08.j22", 0x10000, 0x29e12e80, 3 | BRF_GRA }, // 4 - { "890f09.k22", 0x10000, 0x67ca40d5, 3 | BRF_GRA }, // 5 - - { "890f04.h4", 0x80000, 0xf16cd1fa, 4 | BRF_GRA }, // 6 K051960 Tiles - { "890f05.k4", 0x80000, 0xda37db05, 4 | BRF_GRA }, // 7 - - { "890f03.d4", 0x80000, 0x19065031, 6 | BRF_GRA }, // 8 K007232 Samples - - { "63s141n.k14", 0x00100, 0xd3620106, 5 | BRF_OPT }, // 9 Priority Prom -}; - -STD_ROM_PICK(garuka) -STD_ROM_FN(garuka) - -struct BurnDriver BurnDrvGaruka = { - "garuka", "devstors", NULL, NULL, "1988", - "Garuka (Japan ver. W)\0", "Minor Video glitches in level 2.", "Konami", "GX890", - L"\u9913\u6D41\u798D (Japan ver. W)\0Garuka\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, garukaRomInfo, garukaRomName, NULL, NULL, DevstorsInputInfo, Devstors2DIPInfo, - devstorsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 304, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_megazone.cpp b/jan/src/burn/drv/konami/d_megazone.cpp deleted file mode 100644 index 27e02dc16..000000000 --- a/jan/src/burn/drv/konami/d_megazone.cpp +++ /dev/null @@ -1,1031 +0,0 @@ -// FB Alpha Mega Zone driver module -// Based on MAME driver by Chris Hardy - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "z80_intf.h" -#include "i8039.h" -#include "flt_rc.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809DecROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvI8039ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvColRAM0; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvColRAM1; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvShareRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[15]; - -static UINT8 scrollx; -static UINT8 scrolly; -static UINT8 irq_enable; -static UINT8 soundlatch; -static UINT8 i8039_status; - -static INT32 watchdog; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo MegazoneInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Megazone) - -static struct BurnDIPInfo MegazoneDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x5b, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - {0x11, 0x01, 0x03, 0x00, "7" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x11, 0x01, 0x04, 0x00, "Upright" }, -// {0x11, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x18, 0x18, "20k 70k 70k+" }, - {0x11, 0x01, 0x18, 0x10, "20k 80k 80k+" }, - {0x11, 0x01, 0x18, 0x08, "30k 90k 90k+" }, - {0x11, 0x01, 0x18, 0x00, "30k 100k 100k+" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x60, 0x60, "Easy" }, - {0x11, 0x01, 0x60, 0x40, "Normal" }, - {0x11, 0x01, 0x60, 0x20, "Hard" }, - {0x11, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Megazone) - -static struct BurnDIPInfo MegazonaDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x5b, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "2" }, - {0x11, 0x01, 0x03, 0x02, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x00, "7" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x11, 0x01, 0x04, 0x00, "Upright" }, -// {0x11, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x18, 0x18, "20k 70k 70k+" }, - {0x11, 0x01, 0x18, 0x10, "20k 80k 80k+" }, - {0x11, 0x01, 0x18, 0x08, "30k 90k 90k+" }, - {0x11, 0x01, 0x18, 0x00, "30k 100k 100k+" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x60, 0x60, "Easy" }, - {0x11, 0x01, 0x60, 0x40, "Normal" }, - {0x11, 0x01, 0x60, 0x20, "Hard" }, - {0x11, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Megazona) - -static void megazone_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0000: - case 0x0001: // coin counter - return; - - case 0x0005: // flipscreen - return; - - case 0x0007: - irq_enable = data & 0x01; - return; - - case 0x0800: - watchdog = 0; - return; - - case 0x1000: - scrollx = data; - return; - - case 0x1800: - scrolly = data; - return; - } -} - -static void __fastcall megazone_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - I8039SetIrqState(1); - return; - - case 0x4000: - soundlatch = data; - return; - - case 0xa000: - case 0xc000: - return; - - case 0xc001: - watchdog = 0; - return; - } -} - -static UINT8 __fastcall megazone_sound_read(UINT16 address) -{ - switch (address) - { - case 0x6000: - return DrvInputs[0]; - - case 0x6001: - return DrvInputs[1]; - - case 0x6002: - return DrvInputs[2]; - - case 0x8000: - return DrvDips[1]; - - case 0x8001: - return DrvDips[0]; - } - - return 0; -} - -static void __fastcall megazone_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - AY8910Write(0, 0, data); - return; - - case 0x02: - AY8910Write(0, 1, data); - return; - } -} - -static UINT8 __fastcall megazone_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - return AY8910Read(0); - } - - return 0; -} - -static UINT8 __fastcall megazone_i8039_read(UINT32 address) -{ - return DrvI8039ROM[address & 0x0fff]; -} - -static void __fastcall megazone_i8039_write_port(UINT32 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case I8039_p1: - DACWrite(0, data); - return; - - case I8039_p2: - if ((data & 0x80) == 0) { - I8039SetIrqState(0); - } - i8039_status = (data >> 4) & 0x07; - return; - } -} - -static UINT8 __fastcall megazone_i8039_read_port(UINT32 port) -{ - if ((port & 0x1ff) < 0x100) { - return soundlatch; - } - - return 0; -} - -static UINT8 AY8910_0_port_A_Read(UINT32) -{ - if (ZetGetActive() == -1) return i8039_status; - - UINT8 timer = (((ZetTotalCycles() * 7159) / 12288) / 512) & 0x0f; - - return (timer << 4) | i8039_status; -} - -static void AY8910_0_port_A_Write(UINT32, UINT32 data) -{ - if (ZetGetActive() == -1) return; - - for (INT32 i = 0; i < 3; i++, data>>=2) - { - INT32 C = 0; - if (data & 1) C += 10000; // 10000pF = 0.01uF - if (data & 2) C += 220000; // 220000pF = 0.22uF - - filter_rc_set_RC(i, FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(C)); - } -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3072000.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - AY8910Reset(0); - ZetClose(); - - I8039Reset(); - - DACReset(); - - scrollx = 0; - scrolly = 0; - irq_enable = 0; - soundlatch = 0; - i8039_status = 0; - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x010000; - DrvM6809DecROM = Next; Next += 0x010000; - - DrvZ80ROM = Next; Next += 0x002000; - - DrvI8039ROM = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000260; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvColRAM0 = Next; Next += 0x000400; - DrvVidRAM0 = Next; Next += 0x000400; - DrvColRAM1 = Next; Next += 0x000400; - DrvVidRAM1 = Next; Next += 0x000400; - - DrvSprRAM = Next; Next += 0x000800; - DrvShareRAM = Next; Next += 0x000800; - - RamEnd = Next; - - pAY8910Buffer[ 0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvProgramDecode() -{ - for (INT32 i = 0x4000; i < 0x10000; i++) { - DrvM6809DecROM[i] = DrvM6809ROM[i] ^ (((i&2)?0x80:0x20)|((i&8)?0x08:0x02)); - } -} - -static INT32 DrvGfxDecode() // 0, 100 -{ - INT32 Plane0[4] = { STEP4(0,1) }; - INT32 Plane1[4] = { 0x4000*8+4, 0x4000*8+0, 4, 0 }; - INT32 XOffs0[8] = { STEP8(0,4) }; - INT32 YOffs0[8] = { STEP8(0,32) }; - INT32 XOffs1[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs1[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x8000); - - GfxDecode(0x0100, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x4000); - - GfxDecode(0x0200, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x06000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0a000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0e000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvI8039ROM + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x06000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00120, 15, 1)) return 1; - - DrvProgramDecode(); - DrvGfxDecode(); - - for (INT32 i = 0; i < 0x200; i++) { - DrvColPROM[i+0x20] &= 0xf; - } - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvVidRAM0, 0x2000, 0x23ff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x2400, 0x27ff, MAP_RAM); - M6809MapMemory(DrvColRAM0, 0x2800, 0x2bff, MAP_RAM); - M6809MapMemory(DrvColRAM1, 0x2c00, 0x2fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvShareRAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x4000, 0x4000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809DecROM + 0x4000, 0x4000, 0xffff, MAP_FETCH); - M6809SetWriteHandler(megazone_main_write); -// M6809SetReadHandler(megazone_main_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetSetWriteHandler(megazone_sound_write); - ZetSetReadHandler(megazone_sound_read); - ZetSetOutHandler(megazone_sound_write_port); - ZetSetInHandler(megazone_sound_read_port); - ZetClose(); - - I8039Init(NULL); - I8039SetProgramReadHandler(megazone_i8039_read); - I8039SetCPUOpReadHandler(megazone_i8039_read); - I8039SetCPUOpReadArgHandler(megazone_i8039_read); - I8039SetIOReadHandler(megazone_i8039_read_port); - I8039SetIOWriteHandler(megazone_i8039_write_port); - - AY8910Init(0, 1789750, nBurnSoundRate, &AY8910_0_port_A_Read, NULL, &AY8910_0_port_A_Write, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(0), 1); - filter_rc_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - ZetExit(); - I8039Exit(); - - AY8910Exit(0); - DACExit(); - filter_rc_exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pens[32]; - - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = bit2 * 151 + bit1 * 71 + bit0 * 33; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = bit2 * 151 + bit1 * 71 + bit0 * 33; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = bit1 * 174 + bit0 * 81; - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) { - DrvPalette[i] = pens[DrvColPROM[i+0x20] | ((i >> 4) & 0x10)]; - } -} - -static void draw_layer(UINT8 *cram, UINT8 *vram, INT32 xscroll, UINT8 yscroll, INT32 limit, INT32 offset) -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - if ((offs & 0x1f) > limit && limit != 0) continue; - - sx -= xscroll; - if (sx < -7) sx += 256; - sx += offset; - - sy -= yscroll; - if (sy < -7) sy += 256; - - INT32 attr = cram[offs]; - INT32 code = vram[offs] + ((attr & 0x80) << 1); - INT32 color =(attr & 0x0f) + 0x10; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x20; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM1); - } - } - - if (sx >= 32 || limit) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx+256, sy, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx+256, sy, color, 4, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx+256, sy, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx+256, sy, color, 4, 0x100, DrvGfxROM1); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x800 - 4; offs >= 0; offs -= 4) - { - INT32 sx = DrvSprRAM[offs + 3] + 32; - INT32 sy = 255 - ((DrvSprRAM[offs + 1] + 16) & 0xff); - INT32 code = DrvSprRAM[offs + 2]; - INT32 color = DrvSprRAM[offs + 0] & 0x0f; - INT32 flipx = ~DrvSprRAM[offs + 0] & 0x40; - INT32 flipy = DrvSprRAM[offs + 0] & 0x80; - - RenderTileTranstab(pTransDraw, DrvGfxROM0, code, color * 16, 0, sx, sy - 16, flipx, flipy, 16, 16, DrvColPROM + 0x20); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(DrvColRAM0, DrvVidRAM0, scrollx, scrolly+16, 0, 32); - draw_sprites(); - draw_layer(DrvColRAM1, DrvVidRAM1, 0, 16, 5, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - bprintf (0, _T("Watchdog triggered!\n")); - } - - if (DrvReset) { - DrvDoReset(1); - } - - M6809NewFrame(); - ZetNewFrame(); - I8039NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 5; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 200; - INT32 nCyclesTotal[3] = { 2048000 / 60, 3072000 / 60, 477266 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] * (i + 1)) / nInterleave; - nCyclesDone[0] += M6809Run(nSegment - nCyclesDone[0]); - if (i == (nInterleave - 1) && irq_enable) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - nSegment = (nCyclesTotal[1] * (i + 1)) / nInterleave; - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - if (i == (nInterleave - 2)) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - - nSegment = (nCyclesTotal[2] * (i + 1)) / nInterleave; - nCyclesDone[2] += I8039Run(nSegment - nCyclesDone[2]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - } - - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - M6809Scan(nAction); - I8039Scan(nAction,pnMin); - - ZetOpen(0); - AY8910Scan(nAction, pnMin); - ZetClose(); - - DACScan(nAction, pnMin); - - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - SCAN_VAR(irq_enable); - SCAN_VAR(soundlatch); - SCAN_VAR(i8039_status); - } - - return 0; -} - - -// Mega Zone (Konami set 1) - -static struct BurnRomInfo megazoneRomDesc[] = { - { "319i07.bin", 0x2000, 0x94b22ea8, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "319i06.bin", 0x2000, 0x0468b619, 1 | BRF_PRG | BRF_ESS }, // 1 - { "319i05.bin", 0x2000, 0xac59000c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "319i04.bin", 0x2000, 0x1e968603, 1 | BRF_PRG | BRF_ESS }, // 3 - { "319i03.bin", 0x2000, 0x0888b803, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "319e02.bin", 0x2000, 0xd5d45edb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "319e01.bin", 0x1000, 0xed5725a0, 3 | BRF_PRG | BRF_ESS }, // 6 I8039 Code - - { "319e11.bin", 0x2000, 0x965a7ff6, 4 | BRF_GRA }, // 7 Sprites - { "319e09.bin", 0x2000, 0x5eaa7f3e, 4 | BRF_GRA }, // 8 - { "319e10.bin", 0x2000, 0x7bb1aeee, 4 | BRF_GRA }, // 9 - { "319e08.bin", 0x2000, 0x6add71b1, 4 | BRF_GRA }, // 10 - - { "319e12.bin", 0x2000, 0xe0fb7835, 5 | BRF_GRA }, // 11 Characters - { "319e13.bin", 0x2000, 0x3d8f3743, 5 | BRF_GRA }, // 12 - - { "319b18.a16", 0x0020, 0x23cb02af, 6 | BRF_GRA }, // 13 Color PROMs - { "319b16.c6", 0x0100, 0x5748e933, 6 | BRF_GRA }, // 14 - { "319b17.a11", 0x0100, 0x1fbfce73, 6 | BRF_GRA }, // 15 - { "319b14.e7", 0x0020, 0x55044268, 6 | BRF_OPT }, // 16 - { "319b15.e8", 0x0020, 0x31fd7ab9, 6 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(megazone) -STD_ROM_FN(megazone) - -struct BurnDriver BurnDrvMegazone = { - "megazone", NULL, NULL, NULL, "1983", - "Mega Zone (Konami set 1)\0", NULL, "Konami", "GX319", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, megazoneRomInfo, megazoneRomName, NULL, NULL, MegazoneInputInfo, MegazoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Mega Zone (Interlogic) - -static struct BurnRomInfo megazoneiRomDesc[] = { - { "ic59_cpu.bin", 0x2000, 0xf41922a0, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "ic58_cpu.bin", 0x2000, 0x7fd7277b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic57_cpu.bin", 0x2000, 0xa4b33b51, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic56_cpu.bin", 0x2000, 0x2aabcfbf, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ic55_cpu.bin", 0x2000, 0xb33a3c37, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "319e02.bin", 0x2000, 0xd5d45edb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "319e01.bin", 0x1000, 0xed5725a0, 3 | BRF_PRG | BRF_ESS }, // 6 I8039 Code - - { "319e11.bin", 0x2000, 0x965a7ff6, 4 | BRF_GRA }, // 7 Sprites - { "319e09.bin", 0x2000, 0x5eaa7f3e, 4 | BRF_GRA }, // 8 - { "319e10.bin", 0x2000, 0x7bb1aeee, 4 | BRF_GRA }, // 9 - { "319e08.bin", 0x2000, 0x6add71b1, 4 | BRF_GRA }, // 10 - - { "ic40_vid.bin", 0x2000, 0x07b8b24b, 5 | BRF_GRA }, // 11 Characters - { "319e13.bin", 0x2000, 0x3d8f3743, 5 | BRF_GRA }, // 12 - - { "319b18.a16", 0x0020, 0x23cb02af, 6 | BRF_GRA }, // 13 Color PROMs - { "319b16.c6", 0x0100, 0x5748e933, 6 | BRF_GRA }, // 14 - { "319b17.a11", 0x0100, 0x1fbfce73, 6 | BRF_GRA }, // 15 - { "319b14.e7", 0x0020, 0x55044268, 6 | BRF_OPT }, // 16 - { "319b15.e8", 0x0020, 0x31fd7ab9, 6 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(megazonei) -STD_ROM_FN(megazonei) - -struct BurnDriver BurnDrvMegazonei = { - "megazonei", "megazone", NULL, NULL, "1983", - "Mega Zone (Interlogic)\0", NULL, "Konami (Interlogic license)", "GX319", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, megazoneiRomInfo, megazoneiRomName, NULL, NULL, MegazoneInputInfo, MegazoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Mega Zone (Konami set 2) - -static struct BurnRomInfo megazoneaRomDesc[] = { - { "7.12g", 0x2000, 0xd42d67bf, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "6.10g", 0x2000, 0x692398eb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5.9g", 0x2000, 0x620ffec3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.8g", 0x2000, 0x28650971, 1 | BRF_PRG | BRF_ESS }, // 3 - { "3.6g", 0x2000, 0xf264018f, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "319-h02", 0x2000, 0xd5d45edb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "319-h01", 0x1000, 0xed5725a0, 3 | BRF_PRG | BRF_ESS }, // 6 I8039 Code - - { "319e11.bin", 0x2000, 0x965a7ff6, 4 | BRF_GRA }, // 7 Sprites - { "319e09.bin", 0x2000, 0x5eaa7f3e, 4 | BRF_GRA }, // 8 - { "319e10.bin", 0x2000, 0x7bb1aeee, 4 | BRF_GRA }, // 9 - { "319e08.bin", 0x2000, 0x6add71b1, 4 | BRF_GRA }, // 10 - - { "319e12.bin", 0x2000, 0xe0fb7835, 5 | BRF_GRA }, // 11 Characters - { "319-g13", 0x2000, 0x3d8f3743, 5 | BRF_GRA }, // 12 - - { "319b18.a16", 0x0020, 0x23cb02af, 6 | BRF_GRA }, // 13 Color PROMs - { "319b16.c6", 0x0100, 0x5748e933, 6 | BRF_GRA }, // 14 - { "319b17.a11", 0x0100, 0x1fbfce73, 6 | BRF_GRA }, // 15 - { "319b14.e7", 0x0020, 0x55044268, 6 | BRF_OPT }, // 16 - { "319b15.e8", 0x0020, 0x31fd7ab9, 6 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(megazonea) -STD_ROM_FN(megazonea) - -struct BurnDriver BurnDrvMegazonea = { - "megazonea", "megazone", NULL, NULL, "1983", - "Mega Zone (Konami set 2)\0", NULL, "Konami", "GX319", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, megazoneaRomInfo, megazoneaRomName, NULL, NULL, MegazoneInputInfo, MegazonaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Mega Zone (Kosuka set 1) - -static struct BurnRomInfo megazonebRomDesc[] = { - { "319-j07", 0x2000, 0x5161a523, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "319-j06", 0x2000, 0x7344c3de, 1 | BRF_PRG | BRF_ESS }, // 1 - { "319-j05", 0x2000, 0xaffa492b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "319-j04", 0x2000, 0x03544ab3, 1 | BRF_PRG | BRF_ESS }, // 3 - { "319-j03", 0x2000, 0x0d95cc0a, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "319-h02", 0x2000, 0xd5d45edb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "319-h01", 0x1000, 0xed5725a0, 3 | BRF_PRG | BRF_ESS }, // 6 I8039 Code - - { "319e11.bin", 0x2000, 0x965a7ff6, 4 | BRF_GRA }, // 7 Sprites - { "319e09.bin", 0x2000, 0x5eaa7f3e, 4 | BRF_GRA }, // 8 - { "319e10.bin", 0x2000, 0x7bb1aeee, 4 | BRF_GRA }, // 9 - { "319e08.bin", 0x2000, 0x6add71b1, 4 | BRF_GRA }, // 10 - - { "319e12.bin", 0x2000, 0xe0fb7835, 5 | BRF_GRA }, // 11 Characters - { "319-g13", 0x2000, 0x3d8f3743, 5 | BRF_GRA }, // 12 - - { "319b18.a16", 0x0020, 0x23cb02af, 6 | BRF_GRA }, // 13 Color PROMs - { "319b16.c6", 0x0100, 0x5748e933, 6 | BRF_GRA }, // 14 - { "319b17.a11", 0x0100, 0x1fbfce73, 6 | BRF_GRA }, // 15 - { "319b14.e7", 0x0020, 0x55044268, 6 | BRF_OPT }, // 16 - { "319b15.e8", 0x0020, 0x31fd7ab9, 6 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(megazoneb) -STD_ROM_FN(megazoneb) - -struct BurnDriver BurnDrvMegazoneb = { - "megazoneb", "megazone", NULL, NULL, "1983", - "Mega Zone (Kosuka set 1)\0", NULL, "Konami (Kosuka license)", "GX319", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, megazonebRomInfo, megazonebRomName, NULL, NULL, MegazoneInputInfo, MegazoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Mega Zone (Kosuka set 2) - -static struct BurnRomInfo megazonecRomDesc[] = { - { "319-h07", 0x2000, 0x8ca47f64, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "319-h06", 0x2000, 0xed35b12e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "319-h05", 0x2000, 0xc3655ccd, 1 | BRF_PRG | BRF_ESS }, // 2 - { "319-h04", 0x2000, 0x9e221177, 1 | BRF_PRG | BRF_ESS }, // 3 - { "319-h03", 0x2000, 0x9048955b, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "319-h02", 0x2000, 0xd5d45edb, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "319-h01", 0x1000, 0xed5725a0, 3 | BRF_PRG | BRF_ESS }, // 6 I8039 Code - - { "319e11.bin", 0x2000, 0x965a7ff6, 4 | BRF_GRA }, // 7 Sprites - { "319e09.bin", 0x2000, 0x5eaa7f3e, 4 | BRF_GRA }, // 8 - { "319e10.bin", 0x2000, 0x7bb1aeee, 4 | BRF_GRA }, // 9 - { "319e08.bin", 0x2000, 0x6add71b1, 4 | BRF_GRA }, // 10 - - { "319e12.bin", 0x2000, 0xe0fb7835, 5 | BRF_GRA }, // 11 Characters - { "319-g13", 0x2000, 0x3d8f3743, 5 | BRF_GRA }, // 12 - - { "319b18.a16", 0x0020, 0x23cb02af, 6 | BRF_GRA }, // 13 Color PROMs - { "319b16.c6", 0x0100, 0x5748e933, 6 | BRF_GRA }, // 14 - { "319b17.a11", 0x0100, 0x1fbfce73, 6 | BRF_GRA }, // 15 - { "319b14.e7", 0x0020, 0x55044268, 6 | BRF_OPT }, // 16 - { "prom.48", 0x0020, 0x796dea94, 6 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(megazonec) -STD_ROM_FN(megazonec) - -struct BurnDriver BurnDrvMegazonec = { - "megazonec", "megazone", NULL, NULL, "1983", - "Mega Zone (Kosuka set 2)\0", NULL, "Konami (Kosuka license)", "GX319", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, megazonecRomInfo, megazonecRomName, NULL, NULL, MegazoneInputInfo, MegazoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_mikie.cpp b/jan/src/burn/drv/konami/d_mikie.cpp deleted file mode 100644 index efd15973d..000000000 --- a/jan/src/burn/drv/konami/d_mikie.cpp +++ /dev/null @@ -1,723 +0,0 @@ -// FB Alpha Mikie driver module -// Based on MAME driver by Allard Van Der Bas - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *palette_bank; -static UINT8 *irq_mask; -static UINT8 *sound_irq; - -static int watchdog; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo MikieInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Mikie) - -static struct BurnDIPInfo MikieDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7b, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - -// flipscreen not implimented -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x13, 0x01, 0x04, 0x00, "Upright" }, -// {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "20k 70k 50k+" }, - {0x13, 0x01, 0x18, 0x10, "30K 90k 60k+" }, - {0x13, 0x01, 0x18, 0x08, "30k only" }, - {0x13, 0x01, 0x18, 0x00, "40K only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Medium" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x14, 0x01, 0x02, 0x02, "Single" }, - {0x14, 0x01, 0x02, 0x00, "Dual" }, -}; - -STDDIPINFO(Mikie) - -static void mikie_main_write(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0x2000: - case 0x2001: - // coin_counter - return; - - case 0x2002: - if (*sound_irq == 0 && d == 1) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - *sound_irq = d; - return; - - case 0x2006: - *flipscreen = d & 1; - return; - - case 0x2007: - *irq_mask = d & 1; - return; - - case 0x2100: - watchdog = 0; - return; - - case 0x2200: - *palette_bank = (d & 0x07) << 4; - return; - - case 0x2300: - return; // nop - - case 0x2400: - *soundlatch = d; - return; - } -} - -static UINT8 mikie_main_read(UINT16 a) -{ - switch (a) - { - case 0x2400: - case 0x2401: - case 0x2402: - return DrvInputs[a & 3]; - - case 0x2403: - return DrvDips[2]; - - case 0x2500: - case 0x2501: - return DrvDips[a & 1]; - } - - return 0; -} - -static void __fastcall mikie_sound_write(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0x8000: - case 0x8001: - return; // nop - - case 0x8002: - case 0x8004: - SN76496Write((a / 4) & 1, d); - return; - - case 0x8079: - case 0xa003: - return; // nop - } -} - -static UINT8 __fastcall mikie_sound_read(UINT16 a) -{ - switch (a) - { - case 0x8003: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0x8005: - return ZetTotalCycles() / 512; - } - - return 0; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pal[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[i + 0x000] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i + 0x000] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i + 0x000] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i + 0x000] >> 3) & 0x01; - INT32 r = bit0 * 14 + bit1 * 31 + bit2 * 66 + bit3 * 144; - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - INT32 g = bit0 * 14 + bit1 * 31 + bit2 * 66 + bit3 * 144; - - bit0 = (DrvColPROM[i + 0x200] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x200] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x200] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x200] >> 3) & 0x01; - INT32 b = bit0 * 14 + bit1 * 31 + bit2 * 66 + bit3 * 144; - - pal[i] = BurnHighCol(r,g,b, 0); - } - - for (INT32 i = 0; i < 0x200; i++) - { - for (INT32 j = 0; j < 8; j++) - { - UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (DrvColPROM[0x300+i] & 0x0f); - DrvPalette[((i & 0x100) << 3) | (j << 8) | (i & 0xff)] = pal[ctabentry]; - } - } - - DrvRecalc = 1; -} -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { STEP4(0,1) }; - INT32 Plane1[4] = { STEP2(0,4), STEP2(256*128*8, 4) }; - INT32 XOffs0[8] = { STEP8(0,4) }; - INT32 YOffs0[8] = { STEP8(0,32) }; - INT32 XOffs1[16] = { STEP4(256, 1), STEP4(128, 1), STEP4(0, 1), STEP4(384,1) }; - INT32 YOffs1[16] = { STEP8(0,16), STEP8(512, 16) }; - - UINT8 *buf = (UINT8*)BurnMalloc(0x10000); - - memcpy (buf, DrvGfxROM0, 0x4000); - - GfxDecode(0x00200, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x100, buf, DrvGfxROM0); - - memcpy (buf, DrvGfxROM1, 0x10000); - - GfxDecode(0x00100, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, buf+0, DrvGfxROM1); - GfxDecode(0x00100, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, buf+1, DrvGfxROM1 + 0x10000); - - BurnFree(buf); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x010000; - DrvZ80ROM = Next; Next += 0x004000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000500; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM = Next; Next += 0x000100; - DrvSprRAM = Next; Next += 0x001000; - DrvColRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - - DrvZ80RAM = Next; Next += 0x000400; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - palette_bank = Next; Next += 0x000001; - irq_mask = Next; Next += 0x000001; - sound_irq = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - // Refresh Rate 60.59 - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x6000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x8000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xc000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0300, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0400, 13, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x0000, 0x00ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2800, 0x37ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x3800, 0x3bff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x3c00, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM, 0x6000, 0xffff, MAP_ROM); - M6809SetWriteHandler(mikie_main_write); - M6809SetReadHandler(mikie_main_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x4000, 0x43ff, MAP_RAM); - ZetSetWriteHandler(mikie_sound_write); - ZetSetReadHandler(mikie_sound_read); - ZetClose(); - - SN76489AInit(0, 14318180 / 8, 0); - SN76489AInit(1, 14318180 / 4, 1); - SN76496SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - ZetExit(); - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(INT32 prio) -{ - for (INT32 offs = 2 * 32; offs < (32 * 32) - (2 * 32); offs++) - { - if ((DrvColRAM[offs] & 0x10) != prio) continue; - - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + ((attr & 0x20) << 3); - INT32 color = (attr & 0x0f) + *palette_bank; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x90; offs += 4) - { - int attr = DrvSprRAM[offs]; - int code = (DrvSprRAM[offs + 2] & 0x3f) + ((DrvSprRAM[offs + 2] & 0x80) >> 1) + ((DrvSprRAM[offs + 2] & 0x40) << 2) + ((attr & 0x40) << 1); - int color = (attr & 0x0f) + *palette_bank; - int sx = DrvSprRAM[offs + 3]; - int sy = 244 - DrvSprRAM[offs + 1]; - int flipx = ~attr & 0x10; - int flipy = attr & 0x20; - - if (*flipscreen) - { - sy = 242 - sy; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x800, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x800, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x800, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x800, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(0x00); - draw_sprites(); - draw_layer(0x10); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog == 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 18432000 / 12 / 60, 14318180 / 4 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - if (i == 240 && *irq_mask) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - } - - ZetClose(); - M6809Close(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - ZetScan(nAction); - - SN76496Scan(nAction, pnMin); - } - - return 0; -} - -// Mikie - -static struct BurnRomInfo mikieRomDesc[] = { - { "n14.11c", 0x2000, 0xf698e6dd, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "o13.12a", 0x4000, 0x826e7035, 1 | BRF_PRG | BRF_ESS }, // 1 - { "o17.12d", 0x4000, 0x161c25c8, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "n10.6e", 0x2000, 0x2cf9d670, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "o11.8i", 0x4000, 0x3c82aaf3, 3 | BRF_GRA }, // 4 Characters - - { "001.f1", 0x4000, 0xa2ba0df5, 4 | BRF_GRA }, // 5 Sprites - { "003.f3", 0x4000, 0x9775ab32, 4 | BRF_GRA }, // 6 - { "005.h1", 0x4000, 0xba44aeef, 4 | BRF_GRA }, // 7 - { "007.h3", 0x4000, 0x31afc153, 4 | BRF_GRA }, // 8 - - { "d19.1i", 0x0100, 0x8b83e7cf, 5 | BRF_GRA }, // 9 Color Proms - { "d21.3i", 0x0100, 0x3556304a, 5 | BRF_GRA }, // 10 - { "d20.2i", 0x0100, 0x676a0669, 5 | BRF_GRA }, // 11 - { "d22.12h", 0x0100, 0x872be05c, 5 | BRF_GRA }, // 12 - { "d18.f9", 0x0100, 0x7396b374, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(mikie) -STD_ROM_FN(mikie) - -struct BurnDriver BurnDrvMikie = { - "mikie", NULL, NULL, NULL, "1984", - "Mikie\0", NULL, "Konami", "GX469", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, mikieRomInfo, mikieRomName, NULL, NULL, MikieInputInfo, MikieDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; - - -// Shinnyuushain Tooru-kun - -static struct BurnRomInfo mikiejRomDesc[] = { - { "n14.11c", 0x2000, 0xf698e6dd, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "o13.12a", 0x4000, 0x826e7035, 1 | BRF_PRG | BRF_ESS }, // 1 - { "o17.12d", 0x4000, 0x161c25c8, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "n10.6e", 0x2000, 0x2cf9d670, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "q11.8i", 0x4000, 0xc48b269b, 3 | BRF_GRA }, // 4 Characters - - { "q01.f1", 0x4000, 0x31551987, 4 | BRF_GRA }, // 5 Sprites - { "q03.f3", 0x4000, 0x34414df0, 4 | BRF_GRA }, // 6 - { "q05.h1", 0x4000, 0xf9e1ebb1, 4 | BRF_GRA }, // 7 - { "q07.h3", 0x4000, 0x15dc093b, 4 | BRF_GRA }, // 8 - - { "d19.1i", 0x0100, 0x8b83e7cf, 5 | BRF_GRA }, // 9 Color Proms - { "d21.3i", 0x0100, 0x3556304a, 5 | BRF_GRA }, // 10 - { "d20.2i", 0x0100, 0x676a0669, 5 | BRF_GRA }, // 11 - { "d22.12h", 0x0100, 0x872be05c, 5 | BRF_GRA }, // 12 - { "d18.f9", 0x0100, 0x7396b374, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(mikiej) -STD_ROM_FN(mikiej) - -struct BurnDriver BurnDrvMikiej = { - "mikiej", "mikie", NULL, NULL, "1984", - "Shinnyuushain Tooru-kun\0", NULL, "Konami", "GX469", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, mikiejRomInfo, mikiejRomName, NULL, NULL, MikieInputInfo, MikieDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; - - -// Mikie (High School Graffiti) - -static struct BurnRomInfo mikiehsRomDesc[] = { - { "l14.11c", 0x2000, 0x633f3a6d, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "m13.12a", 0x4000, 0x9c42d715, 1 | BRF_PRG | BRF_ESS }, // 1 - { "m17.12d", 0x4000, 0xcb5c03c9, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "h10.6e", 0x2000, 0x4ed887d2, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "l11.8i", 0x4000, 0x5ba9d86b, 3 | BRF_GRA }, // 4 Characters - - { "i01.f1", 0x4000, 0x0c0cab5f, 4 | BRF_GRA }, // 5 Sprites - { "i03.f3", 0x4000, 0x694da32f, 4 | BRF_GRA }, // 6 - { "i05.h1", 0x4000, 0x00e357e1, 4 | BRF_GRA }, // 7 - { "i07.h3", 0x4000, 0xceeba6ac, 4 | BRF_GRA }, // 8 - - { "d19.1i", 0x0100, 0x8b83e7cf, 5 | BRF_GRA }, // 9 Color Proms - { "d21.3i", 0x0100, 0x3556304a, 5 | BRF_GRA }, // 10 - { "d20.2i", 0x0100, 0x676a0669, 5 | BRF_GRA }, // 11 - { "d22.12h", 0x0100, 0x872be05c, 5 | BRF_GRA }, // 12 - { "d18.f9", 0x0100, 0x7396b374, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(mikiehs) -STD_ROM_FN(mikiehs) - -struct BurnDriver BurnDrvMikiehs = { - "mikiehs", "mikie", NULL, NULL, "1984", - "Mikie (High School Graffiti)\0", NULL, "Konami", "GX469", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, mikiehsRomInfo, mikiehsRomName, NULL, NULL, MikieInputInfo, MikieDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_mogura.cpp b/jan/src/burn/drv/konami/d_mogura.cpp deleted file mode 100644 index 223939f75..000000000 --- a/jan/src/burn/drv/konami/d_mogura.cpp +++ /dev/null @@ -1,398 +0,0 @@ -// FB Alpha Mogura Desse driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvGfxRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvGfxROM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8] = {0, }; -static UINT8 DrvJoy2[8] = {0, }; -static UINT8 DrvJoy3[8] = {0, }; -static UINT8 DrvJoy4[8] = {0, }; -static UINT8 DrvJoy5[8] = {0, }; -static UINT8 DrvDiag[1] = { 0 }; -static UINT8 DrvReset; -static UINT8 DrvInputs[6] = {0, }; - -static struct BurnInputInfo MoguraInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy4 + 7, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 2, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 3, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 0, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 1, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy5 + 7, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy5 + 2, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy5 + 3, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy5 + 0, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy5 + 1, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 5, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy5 + 6, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Diagnostics", BIT_DIGITAL, DrvDiag + 0, "diag" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service2" }, - {"Service 3", BIT_DIGITAL, DrvJoy1 + 6, "service3" }, - {"Service 4", BIT_DIGITAL, DrvJoy1 + 7, "service4" }, -}; - -STDINPUTINFO(Mogura) - -inline void MoguraClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvTileDecode(INT32 offset, INT32 data) -{ - UINT8 *tile = DrvGfxROM + (offset << 2); - - tile[0] = (data >> 6) & 3; - tile[1] = (data >> 4) & 3; - tile[2] = (data >> 2) & 3; - tile[3] = (data >> 0) & 3; -} - -void __fastcall mogura_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xe000) { - DrvGfxRAM[address & 0xfff] = data; - DrvTileDecode(address & 0xfff, data); - return; - } -} - -void __fastcall mogura_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x14: - DACWrite(0, (data & 0xf0)); - DACWrite(1, (data & 0x0f) << 4); - return; - } -} - -UINT8 __fastcall mogura_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x08: - return DrvInputs[0]; - - case 0x0c: - return ~DrvInputs[1]; - - case 0x0d: - return ~DrvInputs[2]; - - case 0x0e: - return ~DrvInputs[3]; - - case 0x0f: - return ~DrvInputs[4]; - - case 0x10: - return ~DrvInputs[5]; - } - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0,bit1,bit2,r,g,b; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[((i & 7) << 2) | ((i >> 3) & 3)] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 moguraDACSync() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3000000.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - DACReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x008000; - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32); - - AllRam = Next; - - DrvGfxROM = Next; Next += 0x004000; - DrvGfxRAM = Next; Next += 0x001000; - - DrvVidRAM = Next; Next += 0x001000; - - DrvZ80RAM = Next; Next += 0x002000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM, 0, 1)) return 1; - - if (BurnLoadRom(DrvColPROM, 1, 1)) return 1; - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xdfff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xdfff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xdfff, 2, DrvZ80RAM); - ZetMapArea(0xe000, 0xefff, 0, DrvGfxRAM); -// ZetMapArea(0xe000, 0xefff, 1, DrvGfxRAM); - ZetMapArea(0xe000, 0xefff, 2, DrvGfxRAM); - ZetMapArea(0xf000, 0xffff, 0, DrvVidRAM); - ZetMapArea(0xf000, 0xffff, 1, DrvVidRAM); - ZetMapArea(0xf000, 0xffff, 2, DrvVidRAM); - ZetSetWriteHandler(mogura_write); - ZetSetOutHandler(mogura_write_port); - ZetSetInHandler(mogura_read_port); - ZetClose(); - - DACInit(0, 0, 0, moguraDACSync); - DACInit(1, 0, 0, moguraDACSync); - DACSetRoute(0, 0.50, BURN_SND_ROUTE_LEFT); - DACSetRoute(1, 0.50, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - DACExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_background() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = ((offs ^ 0x20) & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - if (sx >= 256) sx ^= 128; - if (sx >= 320) continue; - - INT32 code = DrvVidRAM[offs]; - INT32 color = (DrvVidRAM[offs + 0x800] >> 1) & 7; - - Render8x8Tile(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_background(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - DrvInputs[0] = 0xff; - DrvInputs[1] = 0x00; - DrvInputs[2] = 0x00; - DrvInputs[3] = 0x00; - DrvInputs[4] = 0x00; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] |= (DrvJoy2[i] & 1) << i; - DrvInputs[2] |= (DrvJoy3[i] & 1) << i; - DrvInputs[3] |= (DrvJoy4[i] & 1) << i; - DrvInputs[4] |= (DrvJoy5[i] & 1) << i; - } - - DrvInputs[5] = DrvDiag[0] & 1; - } - - // Clear Opposites - MoguraClearOpposites(&DrvInputs[1]); - MoguraClearOpposites(&DrvInputs[2]); - MoguraClearOpposites(&DrvInputs[3]); - MoguraClearOpposites(&DrvInputs[4]); - - ZetOpen(0); - ZetRun(3000000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - DACScan(nAction, pnMin); - } - - return 0; -} - - -// Mogura Desse - -static struct BurnRomInfo moguraRomDesc[] = { - { "gx141.5n", 0x8000, 0x98e6120d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - - { "gx141.7j", 0x0020, 0xb21c5d5f, 2 | BRF_GRA }, // 1 Color Prom -}; - -STD_ROM_PICK(mogura) -STD_ROM_FN(mogura) - -struct BurnDriver BurnDrvMogura = { - "mogura", NULL, NULL, NULL, "1991", - "Mogura Desse\0", "Konami test board", "Konami", "Miscellaneous", - L"\u30E2\u30B0\u30E9\u30C7\u30C3\u30BB\0Mogura Desse\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, moguraRomInfo, moguraRomName, NULL, NULL, MoguraInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 320, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_moo.cpp b/jan/src/burn/drv/konami/d_moo.cpp deleted file mode 100644 index 2bea2b9a5..000000000 --- a/jan/src/burn/drv/konami/d_moo.cpp +++ /dev/null @@ -1,1603 +0,0 @@ -// FB Alpha Wild West C.O.W.-Boys of Moo Mesa / Bucky O'Hare driver module -// Based on MAME driver by R. Belmont, Acho A. Tang - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k054539.h" -#include "eeprom.h" - -static UINT8 *AllMem; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvEeprom; -static UINT8 *AllRam; -static UINT8 *Drv68KRAM; -static UINT8 *Drv68KRAM2; -static UINT8 *Drv68KRAM3; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvProtRAM; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; -static UINT8 *soundlatch3; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 layerpri[4]; -static INT32 layer_colorbase[4]; -static INT32 sprite_colorbase = 0; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvJoy5[16]; -static UINT8 DrvReset; -static UINT16 DrvInputs[4]; -static UINT8 DrvDips[1]; - -static INT32 sound_nmi_enable = 0; -static INT32 irq5_timer = 0; -static UINT16 control_data = 0; -static INT32 enable_alpha = 0; -static UINT8 z80_bank; - -static UINT16 zmask; - -static struct BurnInputInfo MooInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 15, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 10, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 11, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 8, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 9, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 12, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 13, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 15, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 10, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 11, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 8, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 9, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 12, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 13, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Service 3", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Service 4", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Service Mode", BIT_DIGITAL, DrvJoy5 + 3, "diagnostics" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Moo) - -static struct BurnInputInfo BuckyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 15, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 10, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 11, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 8, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 9, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 12, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 13, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 14, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 15, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 10, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 11, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 8, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 9, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 12, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 13, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy4 + 14, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Service 3", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Service 4", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Service Mode", BIT_DIGITAL, DrvJoy5 + 3, "diagnostics" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Bucky) - -static struct BurnDIPInfo MooDIPList[]= -{ - {0x26, 0xff, 0xff, 0x60, NULL }, - - {0 , 0xfe, 0 , 2, "Sound Output" }, - {0x26, 0x01, 0x10, 0x10, "Mono" }, - {0x26, 0x01, 0x10, 0x00, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Coin Mechanism" }, - {0x26, 0x01, 0x20, 0x20, "Common" }, - {0x26, 0x01, 0x20, 0x00, "Independent" }, - - {0 , 0xfe, 0 , 3, "Number of Players" }, - {0x26, 0x01, 0xc0, 0xc0, "2" }, - {0x26, 0x01, 0xc0, 0x40, "3" }, - {0x26, 0x01, 0xc0, 0x80, "4" }, -}; - -STDDIPINFO(Moo) - -static struct BurnDIPInfo BuckyDIPList[]= -{ - {0x2a, 0xff, 0xff, 0x60, NULL }, - - {0 , 0xfe, 0 , 2, "Sound Output" }, - {0x2a, 0x01, 0x10, 0x10, "Mono" }, - {0x2a, 0x01, 0x10, 0x00, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Coin Mechanism" }, - {0x2a, 0x01, 0x20, 0x20, "Common" }, - {0x2a, 0x01, 0x20, 0x00, "Independent" }, - - {0 , 0xfe, 0 , 3, "Number of Players" }, - {0x2a, 0x01, 0xc0, 0xc0, "2" }, - {0x2a, 0x01, 0xc0, 0x40, "3" }, - {0x2a, 0x01, 0xc0, 0x80, "4" }, -}; - -STDDIPINFO(Bucky) - -static void moo_objdma() -{ - INT32 num_inactive; - UINT16 *dst = (UINT16*)K053247Ram; - UINT16 *src = (UINT16*)DrvSprRAM; - - INT32 counter = 23; - - num_inactive = counter = 256; - - do - { - if ((*src & 0x8000) && (*src & zmask)) - { - memcpy(dst, src, 0x10); - dst += 8; - num_inactive--; - } - src += 0x80; - } - while (--counter); - - if (num_inactive) - { - do - { - *dst = 0; - dst += 8; - } - while (--num_inactive); - } -} - -static void moo_prot_write(INT32 offset) -{ - UINT16 *m_protram = (UINT16*)DrvProtRAM; - - if ((offset & 0x1e) == 0x18) // trigger operation - { - UINT32 src1 = (m_protram[1] & 0xff) << 16 | m_protram[0]; - UINT32 src2 = (m_protram[3] & 0xff) << 16 | m_protram[2]; - UINT32 dst = (m_protram[5] & 0xff) << 16 | m_protram[4]; - UINT32 length = m_protram[0xf]; - - while (length) - { - UINT32 a = SekReadWord(src1); - UINT32 b = SekReadWord(src2); - - SekWriteWord(dst, a + 2 * b); - - src1 += 2; - src2 += 2; - dst += 2; - length--; - } - } -} - -static inline void sync_sound() -{ - INT32 cycles = (SekTotalCycles() / 2) - ZetTotalCycles(); - if (cycles > 0) { - ZetRun(cycles); - } -} - -static void __fastcall moo_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffc000) == 0x1a0000) { - K056832RamWriteWord(address & 0x1fff, data); - return; - } - - if ((address & 0xfffff8) == 0x0c2000) { - K053246Write((address & 0x06) + 0, data >> 8); - K053246Write((address & 0x06) + 1, data&0xff); - return; - } - - if ((address & 0xffffc0) == 0x0c0000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - if ((address & 0xffffe0) == 0x0ca000) { - K054338WriteWord(address, data); - return; - } - - if ((address & 0xffffe0) == 0x0ce000) { - *((UINT16*)(DrvProtRAM + (address & 0x1e))) = data; - moo_prot_write(address); - return; - } - - if ((address & 0xfffff8) == 0x0d8000) { - return; // regb - } - switch (address) - { - case 0x0de000: - control_data = data; - K053246_set_OBJCHA_line((data & 0x100) >> 8); - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - return; - } -} - -static void __fastcall moo_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffc000) == 0x1a0000) { - K056832RamWriteByte(address & 0x1fff, data); - return; - } - - if ((address & 0xffffc0) == 0x0c0000) { - K056832ByteWrite(address, data); - return; - } - - if ((address & 0xfffff8) == 0x0c2000) { - K053246Write((address & 0x07) ^ 0, data); - return; - } - - if ((address & 0xffffe1) == 0x0cc001) { - K053251Write((address / 2) & 0xf, data); - return; - } - - if ((address & 0xffffe0) == 0x0d0000) { - // k053252 unimplemented - return; - } - - if ((address & 0xfffff8) == 0x0d8000) { - return; // regb - } - - switch (address) - { - case 0x0d4000: - case 0x0d4001: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x0d600c: - case 0x0d600d: - sync_sound(); - *soundlatch = data; - return; - - case 0x0d600e: - case 0x0d600f: - sync_sound(); - *soundlatch2 = data; - return; - - case 0x0de000: - control_data = (control_data & 0x00ff) + (data << 8); - return; - - case 0x0de001: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - control_data = (control_data & 0xff00) + data; - return; - } -} - -static UINT16 __fastcall moo_main_read_word(UINT32 address) -{ -//bprintf (0, _T("MRW: %5.5x\n"), address); - - if ((address & 0xffc000) == 0x1a0000) { - return K056832RamReadWord(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x1b0000) { - return K056832RomWordRead(address); - } - - switch (address) - { - case 0x0c4000: - sync_sound(); - return K053246Read(1) + (K053246Read(0) << 8); - - case 0x0da000: - return DrvInputs[2]; - - case 0x0da002: - return DrvInputs[3]; - - case 0x0dc000: - return DrvInputs[0] & 0xff; - - case 0x0dc002: - return (DrvInputs[1] & 0xf8) | 2 | (EEPROMRead() ? 0x01 : 0); - - case 0x0de000: - return control_data; - } - - return 0; -} - -static UINT8 __fastcall moo_main_read_byte(UINT32 address) -{ -//bprintf (0, _T("MRB: %5.5x\n"), address); - - if ((address & 0xffc000) == 0x1a0000) { - return K056832RamReadByte(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x1b0000) { - return K056832RomWordRead(address) >> ((~address & 1) * 8); - } - - switch (address) - { - case 0x0c4000: - case 0x0c4001: - sync_sound(); - return K053246Read(address & 1); - - case 0x0da000: - return DrvInputs[2] >> 8; - - case 0x0da001: - return DrvInputs[2]; - - case 0x0da002: - return DrvInputs[3] >> 8; - - case 0x0da003: - return DrvInputs[3]; - - case 0x0dc000: - return DrvInputs[0] >> 8; - - case 0x0dc001: - return DrvInputs[0]; - - case 0x0dc002: - return 0; - - case 0x0dc003: - return ((DrvInputs[1]) & 0xf8) | 2 | (EEPROMRead() ? 0x01 : 0); - - case 0x0d6015: - return *soundlatch3; - - case 0x0de000: - case 0x0de001: - return control_data >> ((~address & 1) * 8); - } - - return 0; -} - -static void __fastcall bucky_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffc000) == 0x180000) { - K056832RamWriteWord(address & 0x1fff, data); - return; - } - - if ((address & 0xfffff8) == 0x0c2000) { - K053246Write((address & 0x06) + 0, data >> 8); - K053246Write((address & 0x06) + 1, data&0xff); - return; - } - - if ((address & 0xffffc0) == 0x0c0000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - if ((address & 0xffffe0) == 0x0ca000) { - K054338WriteWord(address, data); - return; - } - - if ((address & 0xffffe0) == 0x0ce000) { - *((UINT16*)(DrvProtRAM + (address & 0x1e))) = data; - moo_prot_write(address); - return; - } - - if ((address & 0xffff00) == 0x0d2000) { - K054000Write((address/2)&0xff, data); - return; - } - - if ((address & 0xfffff8) == 0x0d8000) { - return; // regb - } - - switch (address) - { - case 0x0de000: - control_data = data; - K053246_set_OBJCHA_line((data & 0x100) >> 8); - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - return; - - } -} - -static void __fastcall bucky_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffc000) == 0x180000) { - K056832RamWriteByte(address & 0x1fff, data); - return; - } - - if ((address & 0xffffc0) == 0x0c0000) { - K056832ByteWrite(address, data); - return; - } - - if ((address & 0xfffff8) == 0x0c2000) { - K053246Write((address & 0x07) ^ 0, data); - return; - } - - if ((address & 0xffffe1) == 0x0cc001) { - K053251Write((address / 2) & 0xf, data); - return; - } - - if ((address & 0xffffe0) == 0x0d0000) { - // k053252 unimplemented - return; - } - - if ((address & 0xffff00) == 0x0d2000) { - K054000Write((address/2)&0xff, data); - return; - } - - if ((address & 0xfffff8) == 0x0d8000) { - return; // regb - } - - switch (address) - { - case 0x0d4000: - case 0x0d4001: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x0d600c: - case 0x0d600d: - sync_sound(); - *soundlatch = data; - return; - - case 0x0d600e: - case 0x0d600f: - sync_sound(); - *soundlatch2 = data; - return; - - case 0x0de000: - control_data = (control_data & 0x00ff) + (data << 8); - return; - - case 0x0de001: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - control_data = (control_data & 0xff00) + data; - return; - } -} - -static UINT16 __fastcall bucky_main_read_word(UINT32 address) -{ -//bprintf (0, _T("MRW: %5.5x\n"), address); - - if ((address & 0xffff00) == 0x0d2000) { - return K054000Read((address/2)&0xff); - } - - if ((address & 0xffc000) == 0x180000) { - return K056832RamReadWord(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x190000) { - return K056832RomWordRead(address); - } - - switch (address) - { - case 0x0c4000: - sync_sound(); - return K053246Read(1) + (K053246Read(0) << 8); - - case 0x0da000: - return DrvInputs[2]; - - case 0x0da002: - return DrvInputs[3]; - - case 0x0dc000: - return DrvInputs[0] & 0xff; - - case 0x0dc002: - return (DrvInputs[1] & 0xf8) | 2 | (EEPROMRead() ? 0x01 : 0); - - case 0x0de000: - return control_data; - } - - return 0; -} - -static UINT8 __fastcall bucky_main_read_byte(UINT32 address) -{ -//bprintf (0, _T("MRB: %5.5x\n"), address); - - if ((address & 0xffff00) == 0x0d2000) { - return K054000Read((address/2)&0xff); - } - - if ((address & 0xffc000) == 0x180000) { - return K056832RamReadByte(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x190000) { - return K056832RomWordRead(address) >> ((~address & 1) * 8); - } - - switch (address) - { - case 0x0c4000: - case 0x0c4001: - sync_sound(); - return K053246Read(address & 1); - - case 0x0da000: - return DrvInputs[2] >> 8; - - case 0x0da001: - return DrvInputs[2]; - - case 0x0da002: - return DrvInputs[3] >> 8; - - case 0x0da003: - return DrvInputs[3]; - - case 0x0dc000: - return DrvInputs[0] >> 8; - - case 0x0dc001: - return DrvInputs[0]; - - case 0x0dc002: - return 0; - - case 0x0dc003: - return ((DrvInputs[1]) & 0xf8) | 2 | (EEPROMRead() ? 0x01 : 0); - - case 0x0d6015: - return *soundlatch3; - - case 0x0de000: - case 0x0de001: - return control_data >> ((~address & 1) * 8); - } - - return 0; -} - -static void bankswitch(INT32 data) -{ - z80_bank = data; - ZetMapMemory(DrvZ80ROM + ((data & 0x0f) * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall moo_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xec00: - BurnYM2151SelectRegister(data); - return; - - case 0xec01: - BurnYM2151WriteRegister(data); - return; - - case 0xf000: - *soundlatch3 = data; - return; - - case 0xf800: - bankswitch(data); - return; - } - - if (address >= 0xe000 && address <= 0xe22f) { - return K054539Write(0, address & 0x3ff, data); - } -} - -static UINT8 __fastcall moo_sound_read(UINT16 address) -{ - if (address >= 0xe000 && address <= 0xe22f) { - return K054539Read(0, address & 0x3ff); - } - - switch (address) - { - case 0xec00: - case 0xec01: - return BurnYM2151ReadStatus(); - - case 0xf002: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xf003: - return *soundlatch2; - } - - return 0; -} - -static const eeprom_interface moo_eeprom_interface = -{ - 7, /* address bits */ - 8, /* data bits */ - "011000", /* read command */ - "011100", /* write command */ - "0100100000000", /* erase command */ - "0100000000000", /* lock command */ - "0100110000000", /* unlock command */ - 0, - 0 -}; - -static void moo_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority) -{ - INT32 pri = (*color & 0x03e0) >> 4; - - if (pri <= layerpri[2]) *priority = 0x00; - else if (pri <= layerpri[1]) *priority = 0xf0; - else if (pri <= layerpri[0]) *priority = 0xfc; - else *priority = 0xfe; - - *color = sprite_colorbase | (*color & 0x001f); -} - -static void moo_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/) -{ - *color = layer_colorbase[layer] | (*color >> 2 & 0x0f); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - bankswitch(2); - ZetClose(); - - KonamiICReset(); - - BurnYM2151Reset(); - K054539Reset(0); - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvEeprom, 0, 128); - } - - control_data = 0; - irq5_timer = 0; - - for (INT32 i = 0; i < 4; i++) - { - layer_colorbase[i] = 0; - layerpri[i] = 0; - } - - sound_nmi_enable = 0; - z80_bank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x040000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROMExp0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x800000; - DrvGfxROMExp1 = Next; Next += 0x1000000; - - DrvSndROM = Next; Next += 0x400000; - - DrvEeprom = Next; Next += 0x000080; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - Drv68KRAM2 = Next; Next += 0x010000; - Drv68KRAM3 = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x005000; - - DrvZ80RAM = Next; Next += 0x002000; - - DrvProtRAM = Next; Next += 0x000020; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - soundlatch3 = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 MooInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 10, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 11, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 12, 1)) return 1; - - K053247GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x200000); - K053247GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x800000); - } - - K054338Init(); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x200000, moo_tile_callback); - K056832SetGlobalOffsets(40, 16); - K056832SetLayerOffsets(0, -1, 0); - K056832SetLayerOffsets(1, 3, 0); - K056832SetLayerOffsets(2, 5, 0); - K056832SetLayerOffsets(3, 7, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x7fffff, moo_sprite_callback, 1); - K053247SetSpriteOffset(-88, -39); - - zmask = 0xffff; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KROM + 0x080000, 0x100000, 0x17ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x180000, 0x18ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x190000, 0x19ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x1c0000, 0x1c1fff, MAP_RAM); - SekSetWriteWordHandler(0, moo_main_write_word); - SekSetWriteByteHandler(0, moo_main_write_byte); - SekSetReadWordHandler(0, moo_main_read_word); - SekSetReadByteHandler(0, moo_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(moo_sound_write); - ZetSetReadHandler(moo_sound_read); - ZetClose(); - - EEPROMInit(&moo_eeprom_interface); - - BurnYM2151Init(4000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - K054539Init(0, 48000, DrvSndROM, 0x200000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static INT32 BuckyInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 10, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 12, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 13, 1)) return 1; - - K053247GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x200000); - K053247GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x800000); - } - - K054338Init(); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x200000, moo_tile_callback); - K056832SetGlobalOffsets(40, 16); - K056832SetLayerOffsets(0, -2, 0); - K056832SetLayerOffsets(1, 2, 0); - K056832SetLayerOffsets(2, 4, 0); - K056832SetLayerOffsets(3, 6, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x7fffff, moo_sprite_callback, 1); - K053247SetSpriteOffset(-88, -39); - - zmask = 0x00ff; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KROM + 0x080000, 0x200000, 0x23ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x08ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x090000, 0x09ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x0a0000, 0x0affff, MAP_RAM); - SekMapMemory(Drv68KRAM3, 0x184000, 0x187fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x1b0000, 0x1b3fff, MAP_RAM); - SekSetWriteWordHandler(0, bucky_main_write_word); - SekSetWriteByteHandler(0, bucky_main_write_byte); - SekSetReadWordHandler(0, bucky_main_read_word); - SekSetReadByteHandler(0, bucky_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(moo_sound_write); - ZetSetReadHandler(moo_sound_read); - ZetClose(); - - EEPROMInit(&moo_eeprom_interface); - - BurnYM2151Init(4000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - K054539Init(0, 48000, DrvSndROM, 0x400000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - SekExit(); - ZetExit(); - - EEPROMExit(); - - BurnYM2151Exit(); - K054539Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x2000/2; i+=2) - { - INT32 r = pal[i+0] & 0xff; - INT32 g = pal[i+1] >> 8; - INT32 b = pal[i+1] & 0xff; - - DrvPalette[i/2] = (r << 16) + (g << 8) + b; - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - KonamiClearBitmaps(0); - - static const INT32 K053251_CI[4] = { 1, 2, 3, 4 }; - INT32 layers[3]; - INT32 plane, alpha = 0xff; - - sprite_colorbase = K053251GetPaletteIndex(0); - layer_colorbase[0] = 0x70; - - for (plane = 1; plane < 4; plane++) - { - layer_colorbase[plane] = K053251GetPaletteIndex(K053251_CI[plane]); - } - - layers[0] = 1; - layerpri[0] = K053251GetPriority(2); - layers[1] = 2; - layerpri[1] = K053251GetPriority(3); - layers[2] = 3; - layerpri[2] = K053251GetPriority(4); - - konami_sortlayers3(layers, layerpri); - - if (layerpri[0] < K053251GetPriority(1)) - if (nBurnLayer & (1< 0) - if (nBurnLayer & (1< 0) { - irq5_timer--; - if (control_data & 0x800 && (irq5_timer == 0)) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - } - - nCyclesSegment = (SekTotalCycles() / 2) - ZetTotalCycles(); - if (nCyclesSegment > 0) nCyclesDone[1] += ZetRun(nCyclesSegment); // sync sound cpu to main cpu - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - K054539Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029732; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K054539Scan(nAction); - - KonamiICScan(nAction); - - SCAN_VAR(z80_bank); - SCAN_VAR(sound_nmi_enable); - - SCAN_VAR(irq5_timer); - - SCAN_VAR(control_data); - SCAN_VAR(enable_alpha); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(z80_bank); - ZetClose(); - } - - EEPROMScan(nAction, pnMin); - - return 0; -} - - - -// Wild West C.O.W.-Boys of Moo Mesa (ver EAB) - -static struct BurnRomInfo moomesaRomDesc[] = { - { "151b01.q5", 0x040000, 0xfb2fa298, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "151eab02.q6", 0x040000, 0x37b30c01, 1 | BRF_PRG | BRF_ESS }, // 1 - { "151a03.t5", 0x040000, 0xc896d3ea, 1 | BRF_PRG | BRF_ESS }, // 2 - { "151a04.t6", 0x040000, 0x3b24706a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "151a07.f5", 0x040000, 0xcde247fc, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "151a05.t8", 0x100000, 0xbc616249, 3 | BRF_GRA }, // 5 K056832 Characters - { "151a06.t10", 0x100000, 0x38dbcac1, 3 | BRF_GRA }, // 6 - - { "151a10.b8", 0x200000, 0x376c64f1, 4 | BRF_GRA }, // 7 K053247 Sprites - { "151a11.a8", 0x200000, 0xe7f49225, 4 | BRF_GRA }, // 8 - { "151a12.b10", 0x200000, 0x4978555f, 4 | BRF_GRA }, // 9 - { "151a13.a10", 0x200000, 0x4771f525, 4 | BRF_GRA }, // 10 - - { "151a08.b6", 0x200000, 0x962251d7, 5 | BRF_SND }, // 11 K054539 Samples - - { "moomesa.nv", 0x000080, 0x7bd904a8, 6 | BRF_OPT }, // 12 eeprom data -}; - -STD_ROM_PICK(moomesa) -STD_ROM_FN(moomesa) - -struct BurnDriver BurnDrvMoomesa = { - "moomesa", NULL, NULL, NULL, "1992", - "Wild West C.O.W.-Boys of Moo Mesa (ver EAB)\0", NULL, "Konami", "GX151", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, moomesaRomInfo, moomesaRomName, NULL, NULL, MooInputInfo, MooDIPInfo, - MooInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Wild West C.O.W.-Boys of Moo Mesa (ver UAC) - -static struct BurnRomInfo moomesauacRomDesc[] = { - { "151c01.q5", 0x040000, 0x10555732, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "151uac02.q6", 0x040000, 0x52ae87b0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "151a03.t5", 0x040000, 0xc896d3ea, 1 | BRF_PRG | BRF_ESS }, // 2 - { "151a04.t6", 0x040000, 0x3b24706a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "151a07.f5", 0x040000, 0xcde247fc, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "151a05.t8", 0x100000, 0xbc616249, 3 | BRF_GRA }, // 5 K056832 Characters - { "151a06.t10", 0x100000, 0x38dbcac1, 3 | BRF_GRA }, // 6 - - { "151a10.b8", 0x200000, 0x376c64f1, 4 | BRF_GRA }, // 7 K053247 Sprites - { "151a11.a8", 0x200000, 0xe7f49225, 4 | BRF_GRA }, // 8 - { "151a12.b10", 0x200000, 0x4978555f, 4 | BRF_GRA }, // 9 - { "151a13.a10", 0x200000, 0x4771f525, 4 | BRF_GRA }, // 10 - - { "151a08.b6", 0x200000, 0x962251d7, 5 | BRF_SND }, // 11 K054539 Samples - - { "moomesauac.nv", 0x000080, 0xa5cb137a, 6 | BRF_OPT }, // 12 eeprom data -}; - -STD_ROM_PICK(moomesauac) -STD_ROM_FN(moomesauac) - -struct BurnDriver BurnDrvMoomesauac = { - "moomesauac", "moomesa", NULL, NULL, "1992", - "Wild West C.O.W.-Boys of Moo Mesa (ver UAC)\0", NULL, "Konami", "GX151", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, moomesauacRomInfo, moomesauacRomName, NULL, NULL, MooInputInfo, MooDIPInfo, - MooInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Wild West C.O.W.-Boys of Moo Mesa (ver UAB) - -static struct BurnRomInfo moomesauabRomDesc[] = { - { "151b01.q5", 0x040000, 0xfb2fa298, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "151uab02.q6", 0x040000, 0x3d9f4d59, 1 | BRF_PRG | BRF_ESS }, // 1 - { "151a03.t5", 0x040000, 0xc896d3ea, 1 | BRF_PRG | BRF_ESS }, // 2 - { "151a04.t6", 0x040000, 0x3b24706a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "151a07.f5", 0x040000, 0xcde247fc, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "151a05.t8", 0x100000, 0xbc616249, 3 | BRF_GRA }, // 5 K056832 Characters - { "151a06.t10", 0x100000, 0x38dbcac1, 3 | BRF_GRA }, // 6 - - { "151a10.b8", 0x200000, 0x376c64f1, 4 | BRF_GRA }, // 7 K053247 Sprites - { "151a11.a8", 0x200000, 0xe7f49225, 4 | BRF_GRA }, // 8 - { "151a12.b10", 0x200000, 0x4978555f, 4 | BRF_GRA }, // 9 - { "151a13.a10", 0x200000, 0x4771f525, 4 | BRF_GRA }, // 10 - - { "151a08.b6", 0x200000, 0x962251d7, 5 | BRF_SND }, // 11 K054539 Samples - - { "moomesauab.nv", 0x000080, 0xa5cb137a, 6 | BRF_OPT }, // 12 eeprom data -}; - -STD_ROM_PICK(moomesauab) -STD_ROM_FN(moomesauab) - -struct BurnDriver BurnDrvMoomesauab = { - "moomesauab", "moomesa", NULL, NULL, "1992", - "Wild West C.O.W.-Boys of Moo Mesa (ver UAB)\0", NULL, "Konami", "GX151", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, moomesauabRomInfo, moomesauabRomName, NULL, NULL, MooInputInfo, MooDIPInfo, - MooInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Wild West C.O.W.-Boys of Moo Mesa (ver AAB) - -static struct BurnRomInfo moomesaaabRomDesc[] = { - { "151b01.q5", 0x040000, 0xfb2fa298, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "151aab02.q6", 0x040000, 0x2162d593, 1 | BRF_PRG | BRF_ESS }, // 1 - { "151a03.t5", 0x040000, 0xc896d3ea, 1 | BRF_PRG | BRF_ESS }, // 2 - { "151a04.t6", 0x040000, 0x3b24706a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "151a07.f5", 0x040000, 0xcde247fc, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "151a05.t8", 0x100000, 0xbc616249, 3 | BRF_GRA }, // 5 K056832 Characters - { "151a06.t10", 0x100000, 0x38dbcac1, 3 | BRF_GRA }, // 6 - - { "151a10.b8", 0x200000, 0x376c64f1, 4 | BRF_GRA }, // 7 K053247 Sprites - { "151a11.a8", 0x200000, 0xe7f49225, 4 | BRF_GRA }, // 8 - { "151a12.b10", 0x200000, 0x4978555f, 4 | BRF_GRA }, // 9 - { "151a13.a10", 0x200000, 0x4771f525, 4 | BRF_GRA }, // 10 - - { "151a08.b6", 0x200000, 0x962251d7, 5 | BRF_SND }, // 11 K054539 Samples - - { "moomesaaab.nv", 0x000080, 0x7bd904a8, 6 | BRF_OPT }, // 12 eeprom data -}; - -STD_ROM_PICK(moomesaaab) -STD_ROM_FN(moomesaaab) - -struct BurnDriver BurnDrvMoomesaaab = { - "moomesaaab", "moomesa", NULL, NULL, "1992", - "Wild West C.O.W.-Boys of Moo Mesa (ver AAB)\0", NULL, "Konami", "GX151", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, moomesaaabRomInfo, moomesaaabRomName, NULL, NULL, MooInputInfo, MooDIPInfo, - MooInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Wild West C.O.W.-Boys of Moo Mesa (bootleg) - -static struct BurnRomInfo moomesablRomDesc[] = { - { "moo03.rom", 0x080000, 0xfed6a1cb, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "moo04.rom", 0x080000, 0xec45892a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "moo03.rom", 0x080000, 0xfed6a1cb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "moo04.rom", 0x080000, 0xec45892a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "moo05.rom", 0x080000, 0x8c045f9c, 3 | BRF_GRA }, // 4 K056832 Characters - { "moo07.rom", 0x080000, 0xb9e29f50, 3 | BRF_GRA }, // 5 - { "moo06.rom", 0x080000, 0x1261aa89, 3 | BRF_GRA }, // 6 - { "moo08.rom", 0x080000, 0xe6937229, 3 | BRF_GRA }, // 7 - - { "151a10", 0x200000, 0x376c64f1, 4 | BRF_GRA }, // 8 K053247 Sprites - { "151a11", 0x200000, 0xe7f49225, 4 | BRF_GRA }, // 9 - { "151a12", 0x200000, 0x4978555f, 4 | BRF_GRA }, // 10 - { "151a13", 0x200000, 0x4771f525, 4 | BRF_GRA }, // 11 - - { "moo01.rom", 0x080000, 0x3311338a, 5 | BRF_SND }, // 12 MSM6295 Samples - { "moo02.rom", 0x080000, 0x2cf3a7c6, 5 | BRF_SND }, // 13 - - { "moo.nv", 0x000080, 0x7bd904a8, 6 | BRF_OPT }, // 14 eeprom data -}; - -STD_ROM_PICK(moomesabl) -STD_ROM_FN(moomesabl) - -static INT32 moomesablInit() -{ - return 1; -} - -struct BurnDriverD BurnDrvMoomesabl = { - "moomesabl", "moomesa", NULL, NULL, "1992", - "Wild West C.O.W.-Boys of Moo Mesa (bootleg)\0", NULL, "bootleg", "GX151", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, moomesablRomInfo, moomesablRomName, NULL, NULL, MooInputInfo, MooDIPInfo, - moomesablInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Bucky O'Hare (ver EAB) - -static struct BurnRomInfo buckyRomDesc[] = { - { "173eab01.q5", 0x040000, 0x7785ac8a, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "173eab02.q6", 0x040000, 0x9b45f122, 1 | BRF_PRG | BRF_ESS }, // 1 - { "173a03.t5", 0x020000, 0xcd724026, 1 | BRF_PRG | BRF_ESS }, // 2 - { "173a04.t6", 0x020000, 0x7dd54d6f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "173a07.f5", 0x040000, 0x4cdaee71, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "173a05.t8", 0x100000, 0xd14333b4, 3 | BRF_GRA }, // 5 K056832 Characters - { "173a06.t10", 0x100000, 0x6541a34f, 3 | BRF_GRA }, // 6 - - { "173a10.b8", 0x200000, 0x42fb0a0c, 4 | BRF_GRA }, // 7 K053247 Sprites - { "173a11.a8", 0x200000, 0xb0d747c4, 4 | BRF_GRA }, // 8 - { "173a12.b10", 0x200000, 0x0fc2ad24, 4 | BRF_GRA }, // 9 - { "173a13.a10", 0x200000, 0x4cf85439, 4 | BRF_GRA }, // 10 - - { "173a08.b6", 0x200000, 0xdcdded95, 5 | BRF_SND }, // 11 K054539 Samples - { "173a09.a6", 0x200000, 0xc93697c4, 5 | BRF_SND }, // 12 - - { "bucky.nv", 0x000080, 0x6a5986f3, 6 | BRF_OPT }, // 13 eeprom data -}; - -STD_ROM_PICK(bucky) -STD_ROM_FN(bucky) - -struct BurnDriver BurnDrvBucky = { - "bucky", NULL, NULL, NULL, "1992", - "Bucky O'Hare (ver EAB)\0", NULL, "Konami", "GX173", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, buckyRomInfo, buckyRomName, NULL, NULL, BuckyInputInfo, BuckyDIPInfo, - BuckyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 384, 224, 4, 3 -}; - - -// Bucky O'Hare (ver EA) - -static struct BurnRomInfo buckyeaRomDesc[] = { - { "2.d5", 0x040000, 0xe18518a6, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "3.d6", 0x040000, 0x45ef9545, 1 | BRF_PRG | BRF_ESS }, // 1 - { "173a03.t5", 0x020000, 0xcd724026, 1 | BRF_PRG | BRF_ESS }, // 2 - { "173a04.t6", 0x020000, 0x7dd54d6f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "173a07.f5", 0x040000, 0x4cdaee71, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "173a05.t8", 0x100000, 0xd14333b4, 3 | BRF_GRA }, // 5 K056832 Characters - { "173a06.t10", 0x100000, 0x6541a34f, 3 | BRF_GRA }, // 6 - - { "173a10.b8", 0x200000, 0x42fb0a0c, 4 | BRF_GRA }, // 7 K053247 Sprites - { "173a11.a8", 0x200000, 0xb0d747c4, 4 | BRF_GRA }, // 8 - { "173a12.b10", 0x200000, 0x0fc2ad24, 4 | BRF_GRA }, // 9 - { "173a13.a10", 0x200000, 0x4cf85439, 4 | BRF_GRA }, // 10 - - { "173a08.b6", 0x200000, 0xdcdded95, 5 | BRF_SND }, // 11 K054539 Samples - { "173a09.a6", 0x200000, 0xc93697c4, 5 | BRF_SND }, // 12 - - { "bucky.nv", 0x000080, 0x6a5986f3, 6 | BRF_OPT }, // 13 eeprom data -}; - -STD_ROM_PICK(buckyea) -STD_ROM_FN(buckyea) - -struct BurnDriver BurnDrvBuckyea = { - "buckyea", "bucky", NULL, NULL, "1992", - "Bucky O'Hare (ver EA)\0", NULL, "Konami", "GX173", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, buckyeaRomInfo, buckyeaRomName, NULL, NULL, BuckyInputInfo, BuckyDIPInfo, - BuckyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 384, 224, 4, 3 -}; - - -// Bucky O'Hare (ver JAA) - -static struct BurnRomInfo buckyjaaRomDesc[] = { - { "173_ja_a01.05", 0x040000, 0x0a32bde7, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "173_ja_a02.06", 0x040000, 0x3e6f3955, 1 | BRF_PRG | BRF_ESS }, // 1 - { "173a03.t5", 0x020000, 0xcd724026, 1 | BRF_PRG | BRF_ESS }, // 2 - { "173a04.t6", 0x020000, 0x7dd54d6f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "173a07.f5", 0x040000, 0x4cdaee71, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "173a05.t8", 0x100000, 0xd14333b4, 3 | BRF_GRA }, // 5 K056832 Characters - { "173a06.t10", 0x100000, 0x6541a34f, 3 | BRF_GRA }, // 6 - - { "173a10.b8", 0x200000, 0x42fb0a0c, 4 | BRF_GRA }, // 7 K053247 Sprites - { "173a11.a8", 0x200000, 0xb0d747c4, 4 | BRF_GRA }, // 8 - { "173a12.b10", 0x200000, 0x0fc2ad24, 4 | BRF_GRA }, // 9 - { "173a13.a10", 0x200000, 0x4cf85439, 4 | BRF_GRA }, // 10 - - { "173a08.b6", 0x200000, 0xdcdded95, 5 | BRF_SND }, // 11 K054539 Samples - { "173a09.a6", 0x200000, 0xc93697c4, 5 | BRF_SND }, // 12 - - { "buckyja.nv", 0x000080, 0x2f280a74, 6 | BRF_OPT }, // 13 eeprom data -}; - -STD_ROM_PICK(buckyjaa) -STD_ROM_FN(buckyjaa) - -struct BurnDriver BurnDrvBuckyjaa = { - "buckyjaa", "bucky", NULL, NULL, "1992", - "Bucky O'Hare (ver JAA)\0", NULL, "Konami", "GX173", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, buckyjaaRomInfo, buckyjaaRomName, NULL, NULL, BuckyInputInfo, BuckyDIPInfo, - BuckyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 384, 224, 4, 3 -}; - - -// Bucky O'Hare (ver UAB) - -static struct BurnRomInfo buckyuabRomDesc[] = { - { "173uab01.q5", 0x040000, 0xdcaecca0, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "173uab02.q6", 0x040000, 0xe3c856a6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "173a03.t5", 0x020000, 0xcd724026, 1 | BRF_PRG | BRF_ESS }, // 2 - { "173a04.t6", 0x020000, 0x7dd54d6f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "173a07.f5", 0x040000, 0x4cdaee71, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "173a05.t8", 0x100000, 0xd14333b4, 3 | BRF_GRA }, // 5 K056832 Characters - { "173a06.t10", 0x100000, 0x6541a34f, 3 | BRF_GRA }, // 6 - - { "173a10.b8", 0x200000, 0x42fb0a0c, 4 | BRF_GRA }, // 7 K053247 Sprites - { "173a11.a8", 0x200000, 0xb0d747c4, 4 | BRF_GRA }, // 8 - { "173a12.b10", 0x200000, 0x0fc2ad24, 4 | BRF_GRA }, // 9 - { "173a13.a10", 0x200000, 0x4cf85439, 4 | BRF_GRA }, // 10 - - { "173a08.b6", 0x200000, 0xdcdded95, 5 | BRF_SND }, // 11 K054539 Samples - { "173a09.a6", 0x200000, 0xc93697c4, 5 | BRF_SND }, // 12 - - { "buckyuab.nv", 0x000080, 0xa5cb137a, 6 | BRF_OPT }, // 13 eeprom data -}; - -STD_ROM_PICK(buckyuab) -STD_ROM_FN(buckyuab) - -struct BurnDriver BurnDrvBuckyuab = { - "buckyuab", "bucky", NULL, NULL, "1992", - "Bucky O'Hare (ver UAB)\0", NULL, "Konami", "GX173", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, buckyuabRomInfo, buckyuabRomName, NULL, NULL, BuckyInputInfo, BuckyDIPInfo, - BuckyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 384, 224, 4, 3 -}; - - -// Bucky O'Hare (ver AAB) - -static struct BurnRomInfo buckyaabRomDesc[] = { - { "173aab01.q5", 0x040000, 0x9193e89f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "173aab02.q6", 0x040000, 0x2567f3eb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "173a03.t5", 0x020000, 0xcd724026, 1 | BRF_PRG | BRF_ESS }, // 2 - { "173a04.t6", 0x020000, 0x7dd54d6f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "173a07.f5", 0x040000, 0x4cdaee71, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "173a05.t8", 0x100000, 0xd14333b4, 3 | BRF_GRA }, // 5 K056832 Characters - { "173a06.t10", 0x100000, 0x6541a34f, 3 | BRF_GRA }, // 6 - - { "173a10.b8", 0x200000, 0x42fb0a0c, 4 | BRF_GRA }, // 7 K053247 Sprites - { "173a11.a8", 0x200000, 0xb0d747c4, 4 | BRF_GRA }, // 8 - { "173a12.b10", 0x200000, 0x0fc2ad24, 4 | BRF_GRA }, // 9 - { "173a13.a10", 0x200000, 0x4cf85439, 4 | BRF_GRA }, // 10 - - { "173a08.b6", 0x200000, 0xdcdded95, 5 | BRF_SND }, // 11 K054539 Samples - { "173a09.a6", 0x200000, 0xc93697c4, 5 | BRF_SND }, // 12 - - { "buckyaab.nv", 0x000080, 0x6a5986f3, 6 | BRF_OPT }, // 13 eeprom data -}; - -STD_ROM_PICK(buckyaab) -STD_ROM_FN(buckyaab) - -struct BurnDriver BurnDrvBuckyaab = { - "buckyaab", "bucky", NULL, NULL, "1992", - "Bucky O'Hare (ver AAB)\0", NULL, "Konami", "GX173", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, buckyaabRomInfo, buckyaabRomName, NULL, NULL, BuckyInputInfo, BuckyDIPInfo, - BuckyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 384, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_mystwarr.cpp b/jan/src/burn/drv/konami/d_mystwarr.cpp deleted file mode 100644 index ec0904ed9..000000000 --- a/jan/src/burn/drv/konami/d_mystwarr.cpp +++ /dev/null @@ -1,4067 +0,0 @@ -// FB Alpha Pre-Gx driver module -// based on MAME driver by R. Belmont, Phil Stroffolino, Acho A. Tang, Nicola Salmoria - -/* - known bugs: - violent storm: - background layer #2 on intro (bad guy on motorcycle), bottom clipped?? - - metamorphic force - background in lava level is too fast. (irq?) - - martial champ - 1: missing graphics in intro & title screens. On blank screens - disable layer#2 to see what it should look like. - 2: missing some sounds. (watch the first attract mode) - - unkown bugs. - probably a lot! go ahead and fix it! - - to do: - fix bugs - clean up - optimize -*/ - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k054539.h" -#include "eeprom.h" - -#if defined _MSC_VER - #define _USE_MATH_DEFINES - #include -#endif - -static UINT8 *AllMem; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvGfxROMExp2; -static UINT8 *DrvSndROM; -static UINT8 *DrvEeprom; -static UINT8 *AllRam; -static UINT8 *Drv68KRAM; -static UINT8 *DrvSpriteRam; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvK053936Ctrl; -static UINT8 *DrvK053936RAM; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT16 *pMystwarrRozBitmap = NULL; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; -static UINT8 *soundlatch3; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 layer_colorbase[4]; -static INT32 sprite_colorbase = 0; -static INT32 sub1_colorbase; -static INT32 cbparam; -static INT32 oinprion; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvJoy5[16]; -static UINT8 DrvReset; -static UINT16 DrvInputs[6]; -static UINT8 DrvDips[1]; - -static INT32 sound_nmi_enable = 0; -static UINT8 sound_control = 0; -static UINT16 control_data = 0; -static UINT8 mw_irq_control = 0; -static INT32 z80_bank; - -static INT32 nGame = 0; - -static struct BurnInputInfo MystwarrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 15, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 10, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 11, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 8, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 9, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 12, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 13, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 14, "p2 fire 3"}, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p3 coin"}, - {"P3 Start", BIT_DIGITAL, DrvJoy4 + 7, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 2, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 3, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 0, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 1, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p3 fire 3"}, - - {"P4 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p4 coin"}, - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 15, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 10, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 11, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 8, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 9, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 12, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 13, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, DrvJoy4 + 14, "p4 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Mystwarr) - -static struct BurnInputInfo MetamrphInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 3"}, - - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 15, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 10, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 11, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 8, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 9, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 12, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 13, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 14, "p3 fire 3"}, - - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 15, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 10, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 11, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 8, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 9, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 12, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 13, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, DrvJoy4 + 14, "p4 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service"}, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Metamrph) - -static struct BurnInputInfo ViostormInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 3"}, - - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 15, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 10, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 11, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 8, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 9, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 12, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 13, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 14, "p3 fire 3"}, - - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 15, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 10, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 11, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 8, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 9, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 12, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 13, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, DrvJoy4 + 14, "p4 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service"}, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Viostorm) - -static struct BurnInputInfo DadandrnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 9, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3"}, - - {"P3 Start", BIT_DIGITAL, DrvJoy4 + 7, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 2, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 3, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 0, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 1, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p3 fire 3"}, - - {"P4 Start", BIT_DIGITAL, DrvJoy5 + 7, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy5 + 2, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy5 + 3, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy5 + 0, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy5 + 1, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 4, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 5, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, DrvJoy5 + 6, "p4 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 12, "service"}, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 13, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Dadandrn) - -static struct BurnInputInfo MartchmpInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 3"}, - - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 15, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 10, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 11, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 8, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 9, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 12, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 13, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 14, "p3 fire 3"}, - - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 15, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 10, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 11, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 8, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 9, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 12, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 13, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, DrvJoy4 + 14, "p4 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service"}, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Martchmp) - -static struct BurnDIPInfo MystwarrDIPList[]= -{ - {0x25, 0xff, 0xff, 0xe4, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x25, 0x01, 0x04, 0x04, "Off" }, - {0x25, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound Output" }, - {0x25, 0x01, 0x10, 0x10, "Mono" }, - {0x25, 0x01, 0x10, 0x00, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Coin Mechanism" }, - {0x25, 0x01, 0x20, 0x20, "Common" }, - {0x25, 0x01, 0x20, 0x00, "Independent" }, - - {0 , 0xfe, 0 , 2, "Number of Players" }, - {0x25, 0x01, 0x40, 0x00, "4" }, - {0x25, 0x01, 0x40, 0x40, "2" }, -}; - -STDDIPINFO(Mystwarr) - -static struct BurnDIPInfo MetamrphDIPList[]= -{ - {0x25, 0xff, 0xff, 0xe8, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x25, 0x01, 0x08, 0x08, "Off" }, - {0x25, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound Output" }, - {0x25, 0x01, 0x10, 0x10, "Mono" }, - {0x25, 0x01, 0x10, 0x00, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Coin Mechanism" }, - {0x25, 0x01, 0x20, 0x20, "Common" }, - {0x25, 0x01, 0x20, 0x00, "Independent" }, - - {0 , 0xfe, 0 , 2, "Number of Players" }, - {0x25, 0x01, 0x40, 0x00, "4" }, - {0x25, 0x01, 0x40, 0x40, "2" }, - - {0 , 0xfe, 0 , 2, "Continuous Energy Increment" }, - {0x25, 0x01, 0x80, 0x80, "No" }, - {0x25, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Metamrph) - - -static struct BurnDIPInfo ViostormDIPList[]= -{ - {0x25, 0xff, 0xff, 0xe8, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x25, 0x01, 0x08, 0x08, "Off" }, - {0x25, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound Output" }, - {0x25, 0x01, 0x10, 0x10, "Mono" }, - {0x25, 0x01, 0x10, 0x00, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x25, 0x01, 0x20, 0x20, "Off" }, - {0x25, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mechanism" }, - {0x25, 0x01, 0x40, 0x40, "Common" }, - {0x25, 0x01, 0x40, 0x00, "Independent" }, - - {0 , 0xfe, 0 , 2, "Number of Players" }, - {0x25, 0x01, 0x80, 0x00, "3" }, - {0x25, 0x01, 0x80, 0x80, "2" }, -}; - -STDDIPINFO(Viostorm) - -static struct BurnDIPInfo DadandrnDIPList[]= -{ - {0x25, 0xff, 0xff, 0xe8, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x25, 0x01, 0x08, 0x08, "Off" }, - {0x25, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound Output" }, - {0x25, 0x01, 0x10, 0x10, "Mono" }, - {0x25, 0x01, 0x10, 0x00, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x25, 0x01, 0x20, 0x20, "Off" }, - {0x25, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Dadandrn) - -static struct BurnDIPInfo MartchmpDIPList[]= -{ - {0x25, 0xff, 0xff, 0xe4, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x25, 0x01, 0x04, 0x04, "Off" }, - {0x25, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound Output" }, - {0x25, 0x01, 0x10, 0x10, "Mono" }, - {0x25, 0x01, 0x10, 0x00, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x25, 0x01, 0x20, 0x20, "Off" }, - {0x25, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Martchmp) - -static void __fastcall mystwarr_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xff0000) == 0x400000) { - if ((address & 0xf0) == 0) - K053247WriteWord(((address & 0x000e) | ((address & 0xff00) >> 4)), data); - - *((UINT16*)(DrvSpriteRam + (address & 0xfffe))) = data; - return; - } - - if ((address & 0xffff00) == 0x480000) { - K055555WordWrite(address, data >> 8); - return; - } - - if ((address & 0xfffff0) == 0x482010) { - K053247WriteRegsWord(address, data); - return; - } - - if ((address & 0xfffff8) == 0x484000) { - K053246Write((address & 0x06) + 0, data >> 8); - K053246Write((address & 0x06) + 1, data&0xff); - return; - } - - if ((address & 0xffffe0) == 0x48a000) { - K054338WriteWord(address, data); - return; - } - - if ((address & 0xffffc0) == 0x48c000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - if ((address & 0xffff00) == 0x49c000) { - // k053252 - return; - } - - if ((address & 0xffc000) == 0x600000) { - K056832RamWriteWord(address, data); - return; - } - - switch (address) - { - case 0x49e004: // rom read enable - K056832WritebRegsWord(address & 0x0f, data); - break; - } -} - -static void __fastcall mystwarr_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xff0000) == 0x400000) { - if ((address & 0xf0) == 0) - K053247Write(((address & 0x000e) | ((address & 0xff00) >> 4) | (address & 1))^1, data); - - DrvSpriteRam[(address & 0xffff)^1] = data; - return; - } - - if ((address & 0xffff00) == 0x480000) { - K055555ByteWrite(address, data); - return; - } - - if ((address & 0xfffff0) == 0x482010) { - K053247WriteRegsByte(address, data); - return; - } - - if ((address & 0xfffff8) == 0x484000) { - K053246Write((address & 0x7)^0, data); - return; - } - - if ((address & 0xffffe0) == 0x48a000) { - K054338WriteByte(address, data); - return; - } - - if ((address & 0xffffc0) == 0x48c000) { - K056832ByteWrite(address, data); - return; - } - - if ((address & 0xffff00) == 0x49c000) { - // k053252 - return; - } - - if ((address & 0xffc000) == 0x600000) { - K056832RamWriteByte(address, data); - return; - } - - switch (address) - { - case 0x490000: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - return; - - case 0x492000: - return; // watchdog - - case 0x49800c: - case 0x49800d: - *soundlatch = data; - return; - - case 0x49800e: - case 0x49800f: - *soundlatch2 = data; - return; - - case 0x49a000: - case 0x49a001: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x49e004: - case 0x49e005: // rom read enable - K056832WritebRegsByte(address & 0x0f, data); - break; - - case 0x49e007: - mw_irq_control = data; // correct! - return; - } -} - -static UINT16 __fastcall mystwarr_main_read_word(UINT32 address) -{ - if ((address & 0xffc000) == 0x600000) { - return K056832RamReadWord(address); - } - - switch (address) - { - case 0x494000: - return DrvInputs[2]; - - case 0x494002: - return DrvInputs[3]; - - case 0x496000: - return DrvInputs[0] & 0xff; - - case 0x496002: - return (DrvInputs[1] & 0xf4) | 2 | (EEPROMRead() ? 0x01 : 0); - } - - return 0; -} - - -static UINT8 __fastcall mystwarr_main_read_byte(UINT32 address) -{ - if ((address & 0xffc000) == 0x600000) { - return K056832RamReadByte(address); - } - - switch (address) - { - case 0x494000: - return DrvInputs[2] >> 8; - - case 0x494001: - return DrvInputs[2]; - - case 0x494002: - return DrvInputs[3] >> 8; - - case 0x494003: - return DrvInputs[3]; - - case 0x496000: - return DrvInputs[0] >> 8; - - case 0x496001: - return DrvInputs[0]; - - case 0x496002: - return DrvInputs[1] >> 8; - - case 0x496003: - return ((DrvInputs[1]) & 0xf4) | 2 | (EEPROMRead() ? 0x01 : 0); - - case 0x498015: - if ((*soundlatch3 & 0xf) == 0xe) return *soundlatch3 | 1; - return *soundlatch3; - } - - return 0; -} - - -//-------------------------------------------------------------------------------------------------------------- - - -static UINT16 prot_data[0x20]; - -static UINT16 K055550_word_read(INT32 offset) -{ - return prot_data[(offset/2)&0x1f]; -} - -static void K055550_word_write(INT32 offset, UINT16 data, UINT16 mask) -{ - offset = (offset & 0x3e) / 2; - - UINT32 adr, bsize, count, i, lim; - INT32 src, tgt, srcend, tgtend, skip, cx1, sx1, wx1, cy1, sy1, wy1, cz1, sz1, wz1, c2, s2, w2; - INT32 dx, dy, angle; - - if (offset == 0 && (mask & 0x00ff)) - { - if (mask == 0xffff) data >>= 8; - - switch (data) - { - case 0x97: // memset() (Dadandarn at 0x639dc) - case 0x9f: // memset() (Violent Storm at 0x989c) - adr = (prot_data[7] << 16) | prot_data[8]; - bsize = (prot_data[10] << 16) | prot_data[11]; - count = (prot_data[0] & 0xff) + 1; - - lim = adr+bsize*count; - - for(i=adr; i>(8-1); // words to skip in each entry to reach the "hit list" - adr = prot_data[2]<<16 | prot_data[3]; // where the table is located - bsize = prot_data[5]<<16 | prot_data[6]; // object entry size in bytes - - srcend = adr + bsize * count; - tgtend = srcend + bsize; - - // let's hope GCC will inline the mem24bew calls - for (src=adr; src=wx1+w2) continue; // X rejection - - c2 = (INT16)SekReadWord(tgt + 6); - s2 = (INT16)SekReadWord(tgt + 8); - w2 = (INT16)SekReadWord(tgt +10); - if (abs((cy1+sy1)-(c2+s2))>=wy1+w2) continue; // Y rejection - - c2 = (INT16)SekReadWord(tgt +12); - s2 = (INT16)SekReadWord(tgt +14); - w2 = (INT16)SekReadWord(tgt +16); - if (abs((cz1+sz1)-(c2+s2))>=wz1+w2) continue; // Z rejection - - SekWriteByte(i, 0x80); // collision confirmed - } - } - break; - - case 0xc0: // calculate object "homes-in" vector (Violent Storm at 0x03da9e) - dx = (INT16)prot_data[0xc]; - dy = (INT16)prot_data[0xd]; - - // it's not necessary to use lookup tables because Violent Storm - // only calls the service once per enemy per frame. - if (dx) - { - if (dy) - { - angle = (INT32)((atan((double)dy / dx) * 128.0) / M_PI); - if (dx < 0) angle += 128; - i = (angle - 0x40) & 0xff; - } - else - i = (dx > 0) ? 0xc0 : 0x40; - } - else - if (dy > 0) i = 0; - else - if (dy < 0) i = 0x80; - else - i = BurnRandom() & 0xff; // vector direction indeterminate - - prot_data[0x10] = i; - break; - } - } -} - -static void __fastcall metamrph_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x210000) { - K053247Write(address & 0xffe, data | (1<<16)); - return; - } - - if ((address & 0xfffff8) == 0x240000) { - K053246Write((address & 0x06) + 0, data >> 8); - K053246Write((address & 0x06) + 1, data&0xff); - return; - } - - if ((address & 0xfffff0) == 0x244010) { - K053247WriteRegsWord(address, data); - return; - } - - if ((address & 0xfffff0) == 0x250000) { - K053250RegWrite(0, address, data); - return; - } - - if ((address & 0xffffe0) == 0x254000) { - K054338WriteWord(address, data); - return; - } - - if ((address & 0xffff00) == 0x258000) { - // bprintf (0, _T("WW %5.5x, %2.2x\n"), address, data); - K055555WordWrite(address, data >> 8); - return; - } - - if ((address & 0xffffe0) == 0x260000) { - // bprintf (0, _T("k053252 word wo: %5.5x, %4.4x\n"), address, data); - return; - } - - if ((address & 0xfffff8) == 0x26c000) { - // AM_RANGE(0x26c000, 0x26c007) AM_DEVWRITE("k056832", k056832_device,b_word_w) - return; - } - - if ((address & 0xffffc0) == 0x270000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - if ((address & 0xffc000) == 0x300000) { - K056832RamWriteWord(address & 0x1fff, data); - return; - } - - if ((address & 0xffffc0) == 0x25c000) { - prot_data[(address & 0x3f)/2] = data; - K055550_word_write(address, data, 0xffff); - return; - } - - switch (address) - { - case 0x264000: - case 0x264001: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x26800c: - case 0x26800d: - *soundlatch = data; - return; - - case 0x26800e: - case 0x26800f: - *soundlatch2 = data; - return; - - case 0x27c000: - case 0x27c001: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - return; - } -} - -static void __fastcall metamrph_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0x210000) { - K053247Write((address & 0xfff) ^ 1, data); - return; - } - - if ((address & 0xfffff8) == 0x240000) { - K053246Write((address & 0x07) ^ 0, data); - return; - } - - if ((address & 0xfffff0) == 0x244010) { - K053247WriteRegsByte(address, data); - return; - } - - if ((address & 0xfffff0) == 0x250000) { - K053250RegWrite(0, address, data); - return; - } - - if ((address & 0xffffe0) == 0x254000) { - K054338WriteByte(address, data); - return; - } - - if ((address & 0xffff00) == 0x258000) { - K055555ByteWrite(address, data); - return; - } - - if ((address & 0xffffe0) == 0x260000) { - //bprintf (0, _T("k053252 byte wo: %5.5x, %4.4x\n"), address, data); - return; - } - - if ((address & 0xfffff8) == 0x26c000) { - // AM_RANGE(0x26c000, 0x26c007) AM_DEVWRITE("k056832", k056832_device,b_word_w) - return; - } - - if ((address & 0xffffc0) == 0x270000) { - K056832ByteWrite(address & 0x3f, data); - return; - } - - if ((address & 0xffc000) == 0x300000) { - K056832RamWriteByte(address & 0x1fff, data); - return; - } - - if ((address & 0xffffc0) == 0x25c000) { - UINT8 *prot = (UINT8*)&prot_data; - prot[(address & 0x3f) ^ 1] = data; - K055550_word_write(address, data, 0xff << ((address & 1) * 8)); - return; - } - - switch (address) - { - case 0x264000: - case 0x264001: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x26800c: - case 0x26800d: - *soundlatch = data; - return; - - case 0x26800e: - case 0x26800f: - *soundlatch2 = data; - return; - - case 0x27c001: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - return; - } -} - -static UINT16 __fastcall metamrph_main_read_word(UINT32 address) -{ - if ((address & 0xfff000) == 0x210000) { - return K053247Read((address & 0xffe)|1)*256+K053247Read((address & 0xffe)|0); - } - - if ((address & 0xfffff0) == 0x250000) { - return K053250RegRead(0, address); - } - - if ((address & 0xffffe0) == 0x260000) { - // bprintf (0, _T("k053252 word ro: %5.5x\n"), address); - return 0; - } - - if ((address & 0xffc000) == 0x300000) { - return K056832RamReadWord(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x310000) { - return 0; // mw_rom_word_r - } - - if ((address & 0xffe000) == 0x320000) { - return K053250RomRead(0, address); - } - - if ((address & 0xffffc0) == 0x25c000) { - return K055550_word_read(address); - } - - switch (address) - { - case 0x274000: - case 0x274001: - return DrvInputs[2]; - - case 0x274002: - case 0x274003: - return DrvInputs[3]; - - case 0x278000: - case 0x278001: - return DrvInputs[0]; - - case 0x278002: - case 0x278003: - return (DrvInputs[1] & 0xfff8) | 2 | (EEPROMRead() ? 0x0001 : 0); - } - - return 0; -} - -static UINT8 __fastcall metamrph_main_read_byte(UINT32 address) -{ - if ((address & 0xfff000) == 0x210000) { - return K053247Read((address & 0xfff)^1); - } - - if ((address & 0xfffff0) == 0x250000) { - return K053250RegRead(0, address) >> ((~address & 1) * 8); - } - - if ((address & 0xffffe0) == 0x260000) { - bprintf (0, _T("k053252 word ro: %5.5x\n"), address); - return 0; - } - - if ((address & 0xffc000) == 0x300000) { - return K056832RamReadByte(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x310000) { - return 0; // mw_rom_word_r - } - - if ((address & 0xffe000) == 0x320000) { - return K053250RomRead(0, address) >> ((~address & 1) * 8); - } - - if ((address & 0xffffc0) == 0x25c000) { - return K055550_word_read(address) >> ((~address & 1) * 8); - } - - switch (address) - { - case 0x268014: - case 0x268015: - if ((*soundlatch3 & 0xf)==0xe) return *soundlatch3|1; - return *soundlatch3; - - case 0x274000: - return DrvInputs[2] >> 8; - - case 0x274001: - return DrvInputs[2]; - - case 0x274002: - return DrvInputs[3] >> 8; - - case 0x274003: - return DrvInputs[3]; - - case 0x278000: - return DrvInputs[0] >> 8; - - case 0x278001: - return DrvInputs[0]; - - case 0x278002: - return DrvInputs[1] >> 8; - - case 0x278003: - return (DrvInputs[1] & 0xfff8) | 2 | (EEPROMRead() ? 0x01 : 0); - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- - -static void K053990_word_write(INT32 offset, UINT16 /*data*/, UINT16 mask) -{ - offset = (offset & 0x3e) / 2; - - INT32 src_addr, src_count, src_skip; - INT32 dst_addr, /*dst_count,*/ dst_skip; - INT32 mod_addr, mod_count, mod_skip, mod_offs; - INT32 mode, i, element_size = 1; - UINT16 mod_val, mod_data; - - if (offset == 0x0c && (mask & 0x00ff)) - { - mode = ((prot_data[0x0d]<<8) & 0xff00) | (prot_data[0x0f] & 0xff); - - switch (mode) - { - case 0xffff: // word copy - element_size = 2; - case 0xff00: // byte copy - src_addr = prot_data[0x0]; - src_addr |= prot_data[0x1]<<16 & 0xff0000; - dst_addr = prot_data[0x2]; - dst_addr |= prot_data[0x3]<<16 & 0xff0000; - src_count = prot_data[0x8]>>8; - //dst_count = prot_data[0x9]>>8; - src_skip = prot_data[0xa] & 0xff; - dst_skip = prot_data[0xb] & 0xff; - - if ((prot_data[0x8] & 0xff) == 2) src_count <<= 1; - src_skip += element_size; - dst_skip += element_size; - - if (element_size == 1) - for (i=src_count; i; i--) - { - SekWriteByte(dst_addr, SekReadByte(src_addr)); - src_addr += src_skip; - dst_addr += dst_skip; - } - else for (i=src_count; i; i--) - { - SekWriteWord(dst_addr, SekReadWord(src_addr)); - src_addr += src_skip; - dst_addr += dst_skip; - } - break; - - case 0x00ff: // sprite list modifier - src_addr = prot_data[0x0]; - src_addr |= prot_data[0x1]<<16 & 0xff0000; - src_skip = prot_data[0x1]>>8; - dst_addr = prot_data[0x2]; - dst_addr |= prot_data[0x3]<<16 & 0xff0000; - dst_skip = prot_data[0x3]>>8; - mod_addr = prot_data[0x4]; - mod_addr |= prot_data[0x5]<<16 & 0xff0000; - mod_skip = prot_data[0x5]>>8; - mod_offs = prot_data[0x8] & 0xff; - mod_offs<<= 1; - mod_count = 0x100; - - src_addr += mod_offs; - dst_addr += mod_offs; - - for (i=mod_count; i; i--) - { - mod_val = SekReadWord(mod_addr); - mod_addr += mod_skip; - - mod_data = SekReadWord(src_addr); - src_addr += src_skip; - - mod_data += mod_val; - - SekWriteWord(dst_addr, mod_data); - dst_addr += dst_skip; - } - break; - } - } -} - -//-------------------------------------------------------------------------------------------------------------- - -static void __fastcall martchmp_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffff00) == 0x400000) { - K055555WordWrite(address, data >> 8); - return; - } - - if ((address & 0xfffff0) == 0x402010) { - K053247WriteRegsWord(address&0xf, data); - return; - } - - if ((address & 0xfffff8) == 0x404000) { - K053246Write((address & 0x06) + 0, data >> 8); - K053246Write((address & 0x06) + 1, data&0xff); - return; - } - - if ((address & 0xffffe0) == 0x40a000) { - K054338WriteWord(address, data); - return; - } - - if ((address & 0xffffc0) == 0x40c000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - if ((address & 0xffffc0) == 0x40e000) { - prot_data[(address & 0x3e)/2] = data; - K053990_word_write(address, data, 0xffff); - return; - } - - if ((address & 0xffffe0) == 0x41c000) { - // k053252 - return; - } - - if ((address & 0xfffff8) == 0x41e000) { - // k056832 b_word_w - return; - } - - if ((address & 0xffc000) == 0x480000) { - if ((address & 0x30) == 0) - K053247WriteWord(((address & 0x000e) | ((address & 0x3FC0) >> 2)), data); - - *((UINT16*)(DrvSpriteRam + (address & 0x3ffe))) = data; - return; - } - - if ((address & 0xffc000) == 0x680000) { - K056832RamWriteWord(address & 0x1fff, data); - return; - } -} - -static void __fastcall martchmp_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffff00) == 0x400000) { - K055555ByteWrite(address, data); - return; - } - - if ((address & 0xfffff0) == 0x402010) { - K053247WriteRegsByte(address&0xf, data); - return; - } - - if ((address & 0xfffff8) == 0x404000) { - K053246Write((address & 0x07) ^ 0, data); - return; - } - - if ((address & 0xffffe0) == 0x40a000) { - K054338WriteByte(address, data); - return; - } - - if ((address & 0xffffc0) == 0x40c000) { - K056832ByteWrite(address & 0x3f, data); - return; - } - - if ((address & 0xffffc0) == 0x40e000) { - UINT8 *prot = (UINT8*)&prot_data; - prot[(address & 0x3f) ^ 1] = data; - K053990_word_write(address, data, 0xff << ((address & 1) * 8)); - return; - } - - if ((address & 0xffffe0) == 0x41c000) { - // k053252 - return; - } - - if ((address & 0xfffff8) == 0x41e000) { - // k056832 b_word_w - return; - } - - if ((address & 0xffc000) == 0x480000) { - if ((address & 0x30) == 0) - K053247Write(((address & 0x000e) | ((address & 0x3FC0) >> 2) | (address & 1))^1, data); - - DrvSpriteRam[(address & 0x3fff)^1] = data; - return; - } - - if ((address & 0xffc000) == 0x680000) { - K056832RamWriteByte(address & 0x1fff, data); - return; - } - - switch (address) - { - case 0x410000: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - return; - - case 0x412000: - mw_irq_control = data; - return; - - case 0x412001: - K053246_set_OBJCHA_line(data & 0x04); - return; - - case 0x41800c: - case 0x41800d: - *soundlatch = data; - return; - - case 0x41800e: - case 0x41800f: - *soundlatch2 = data; - return; - - case 0x41a000: - case 0x41a001: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -static UINT16 __fastcall martchmp_main_read_word(UINT32 address) -{ - if ((address & 0xffc000) == 0x680000) { - return K056832RamReadWord(address); - } - - switch (address) - { - case 0x414000: - return DrvInputs[2]; - - case 0x414002: - return DrvInputs[3]; - - case 0x416000: - return DrvInputs[0] & 0xff; - - case 0x416002: - return (DrvInputs[1] & 0xf4) | 2 | (EEPROMRead() ? 0x01 : 0); - } - - return 0; -} - -static UINT8 __fastcall martchmp_main_read_byte(UINT32 address) -{ - if ((address & 0xffc000) == 0x680000) { - return K056832RamReadByte(address); - } - - switch (address) - { - case 0x412000: - return mw_irq_control; - - case 0x414000: - return DrvInputs[2] >> 8; - - case 0x414001: - return DrvInputs[2]; - - case 0x414002: - return DrvInputs[3] >> 8; - - case 0x414003: - return DrvInputs[3]; - - case 0x416000: - return DrvInputs[0] >> 8; - - case 0x416001: - return DrvInputs[0]; - - case 0x416002: - return DrvInputs[1] >> 8; - - case 0x416003: - return ((DrvInputs[1]) & 0xf4) | 2 | (EEPROMRead() ? 0x01 : 0); - - case 0x418015: - if ((*soundlatch3 & 0xf) == 0xe) return *soundlatch3 | 1; - return *soundlatch3; - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- - -static void __fastcall dadandrn_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xff0000) == 0x400000) { - if ((address & 0xf0) == 0) - K053247WriteWord(((address & 0x000e) | ((address & 0xff00) >> 4)), data); - - *((UINT16*)(DrvSpriteRam + (address & 0xfffe))) = data; - return; - } - - if ((address & 0xffc000) == 0x410000) { - K056832RamWriteWord(address, data); - return; - } - - if ((address & 0xfffff8) == 0x430000) { - K053246Write((address & 0x06) + 0, data >> 8); - K053246Write((address & 0x06) + 1, data&0xff); - return; - } - - if ((address & 0xfffff0) == 0x450010) { - K053247WriteRegsWord(address, data); - return; - } - - if ((address & 0xffffc0) == 0x480000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - if ((address & 0xfffff8) == 0x482000) { - // k056832 b regs - return; - } - - if ((address & 0xfffffe) == 0x484000) { - INT32 sizetab[4] = { 4, 4, 2, 1 }; - INT32 clip[4] = { 0, 0, 0, 0 }; - - clip[0] = (data >> 0) & 0x3f; // min (clip) x - clip[1] = (data >> 6) & 0x3f; // min (clip) y - clip[2] = sizetab[(data >> 12) & 0x03]; // size x - clip[3] = sizetab[(data >> 14) & 0x03]; // size y - - clip[2] = ((clip[0] + clip[2]) << 7) - 1; - clip[3] = ((clip[1] + clip[3]) << 7) - 1; - clip[0] <<= 7; - clip[1] <<= 7; - - K053936GP_set_cliprect(0, clip[0], clip[2], clip[1], clip[3]); - return; - } - - if ((address & 0xfffffe) == 0x484002) { - K053936GP_clip_enable(0, (data >> 8) & 1); - return; - } - - if ((address & 0xffffe0) == 0x486000) { - // k053252 - return; - } - - if ((address & 0xffff00) == 0x488000) { - K055555WordWrite(address, data >> 8); - return; - } - - if ((address & 0xffffe0) == 0x48c000) { - K054338WriteWord(address, data); - return; - } - - if ((address & 0xffffc0) == 0x660000) { - K054000Write((address/2)&0x1f, data); - return; - } - - if ((address & 0xffffc0) == 0x680000) { - prot_data[(address & 0x3f)/2] = data; - K055550_word_write(address, data, 0xffff); - return; - } -} - -static void __fastcall dadandrn_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xff0000) == 0x400000) { - if ((address & 0xf0) == 0) - K053247Write(((address & 0x000e) | ((address & 0xff00) >> 4) | (address & 1))^1, data); - - DrvSpriteRam[(address & 0xffff)^1] = data; - return; - } - - if ((address & 0xffc000) == 0x410000) { - K056832RamWriteByte(address, data); - return; - } - - if ((address & 0xfffff8) == 0x430000) { - K053246Write((address & 0x7)^0, data); - return; - } - - if ((address & 0xfffff0) == 0x450010) { - K053247WriteRegsByte(address, data); - return; - } - - if ((address & 0xffffc0) == 0x480000) { - K056832ByteWrite(address, data); - return; - } - - if ((address & 0xfffff8) == 0x482000) { - // k056832 b regs - return; - } - - //if ((address & 0xfffffc) == 0x484000) { - // bprintf (0, _T("ClipB: %2.2x, %4.4x\n"), address & 3, data); - // return; - //} - - if ((address & 0xffffe0) == 0x486000) { - // k053252 - return; - } - - if ((address & 0xffff00) == 0x488000) { - K055555ByteWrite(address, data); - return; - } - - if ((address & 0xffffe0) == 0x48c000) { - K054338WriteByte(address, data); - return; - } - - if ((address & 0xffffc0) == 0x660000) { - K054000Write((address/2)&0x1f, data); - return; - } - - if ((address & 0xffffc0) == 0x680000) { - UINT8 *prot = (UINT8*)&prot_data; - prot[(address & 0x3f) ^ 1] = data; - K055550_word_write(address, data, 0xff << ((address & 1) * 8)); - return; - } - - switch (address) - { - case 0x484002: - //bprintf (0, _T("clipb enable %2.2x\n"), data); - K053936GP_clip_enable(0, data & 0x01); - return; - - case 0x48a00c: - *soundlatch = data; - return; - - case 0x48a00e: - *soundlatch2 = data; - return; - - case 0x6a0001: - EEPROMWrite((data & 0x04), (data & 0x02), (data & 0x01)); - return; - - case 0x6c0000: - case 0x6c0001: - K053936GP_enable(0, data & 0x01); - // 053936_enable - // bprintf (0, _T("'936b enable %2.2x\n"), data); - return; - - case 0x6e0000: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0xe00000: - return; // watchdog - } -} - -static UINT16 __fastcall dadandrn_main_read_word(UINT32 address) -{ - if ((address & 0xffc000) == 0x410000) { - return K056832RamReadWord(address & 0x1fff); - } - - if ((address & 0xffffc0) == 0x680000) { - return K055550_word_read(address); - } - - if ((address & 0xffff00) == 0x660000) { - return K054000Read((address / 2) & 0x1f); - } - - switch (address) - { - case 0x480a14: - if ((*soundlatch3 & 0xf)==0xe) return *soundlatch3|1; - return *soundlatch3; - - case 0x48e000: - return DrvInputs[0]; - - case 0x48e020: - return (DrvInputs[1] << 8) | (DrvInputs[2] & 0xff); // ???? - } - - return 0; -} - -static UINT8 __fastcall dadandrn_main_read_byte(UINT32 address) -{ - if ((address & 0xffc000) == 0x410000) { - return K056832RamReadByte(address & 0x1fff); - } - - if ((address & 0xffffc0) == 0x680000) { - return K055550_word_read(address) >> ((~address & 1) * 8); - } - - if ((address & 0xffffc0) == 0x660000) { - return K054000Read((address / 2) & 0x1f); - } - - switch (address) - { - case 0x480a14: - case 0x48a014: - if ((*soundlatch3 & 0xf)==0xe) return *soundlatch3|1; - return *soundlatch3; - - case 0x48e000: - return DrvInputs[0] >> 8; - - case 0x48e001: - return DrvInputs[0]; - - case 0x48e020: - return (DrvInputs[1] & 0xf8) | 2 | (EEPROMRead() ? 0x0001 : 0); - - case 0x48e021: - return (DrvInputs[2] >> 8); - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- - -static void bankswitch(INT32 data) -{ - z80_bank = data; - ZetMapMemory(DrvZ80ROM + ((data & 0x0f) * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall mystwarr_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - *soundlatch3 = data; - return; - - case 0xf800: - sound_control = data & 0x10; - bankswitch(data); - // if (!sound_control) ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); // CLEAR NMI LINE! - return; - } - - if (address >= 0xe000 && address <= 0xe22f) { - K054539Write(0, address - 0xe000, data); - } - - if (address >= 0xe400 && address <= 0xe62f) { - K054539Write(1, address - 0xe400, data); - } - - if (address >= 0xe000 && address <= 0xe7ff) { - DrvZ80RAM[0x2000 + (address & 0x7ff)] = data; - } - -} - -static UINT8 __fastcall mystwarr_sound_read(UINT16 address) -{ - if (address >= 0xe000 && address <= 0xe22f) { - return K054539Read(0, address - 0xe000); - } - - if (address >= 0xe400 && address <= 0xe62f) { - return K054539Read(1, address - 0xe400); - } - - if (address >= 0xe000 && address <= 0xe7ff) { - return DrvZ80RAM[0x2000 + (address & 0x7ff)]; - } - - switch (address) - { - case 0xf002: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xf003: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch2; - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- - -static void mystwarr_tile_callback(INT32 layer, INT32 *code, INT32 *color, INT32 *flags) -{ - if (layer == 1 && (*code & 0xff00) + (*color) == 0x4101) *flags = (*flags)|(0x808000); //* water hack - - *color = layer_colorbase[layer] | ((*color >> 1) & 0x1e); -} - -static void metamrph_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/) -{ - *color = layer_colorbase[layer] | (*color >> 2 & 0x0f); -} - -static void game5bpp_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/) -{ - *color = layer_colorbase[layer] | ((*color >> 1) & 0x1e); -} -static void mystwarr_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority) -{ - INT32 c = *color; - *color = sprite_colorbase | (c & 0x001f); - *priority = c & 0x00f0; -} - -static void metamrph_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority) -{ - INT32 c = *color; - INT32 attr = c; - - c = (c & 0x1f) | sprite_colorbase; - - if ((attr & 0x300) != 0x300) - { - *color = c; - *priority = (attr & 0xe0) >> 2; - } - else - { - *color = c | 3<>4 & 0x20) | (c & 0x001f); - *priority = c & 0x00e0; -} - -static const eeprom_interface mystwarr_eeprom_interface = -{ - 7, /* address bits */ - 8, /* data bits */ - "011000", /* read command */ - "011100", /* write command */ - "0100100000000",/* erase command */ - "0100000000000",/* lock command */ - "0100110000000", /* unlock command */ - 0, - 0 -}; - -static const eeprom_interface gaiapolis_eeprom_interface = -{ - 7, /* address bits */ - 8, /* data bits */ - "011000", /* read command */ - "010100", /* write command */ - "0100100000000",/* erase command */ - "0100000000000",/* lock command */ - "0100110000000",/* unlock command */ - 0, - 0 -}; - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - bankswitch(2); - ZetClose(); - - KonamiICReset(); - - K054539Reset(0); - K054539Reset(1); - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvEeprom, 0, 128); - } - - control_data = 0; - - for (INT32 i = 0; i < 4; i++) - { - layer_colorbase[i] = 0; - } - - sprite_colorbase = 0; - cbparam = 0; - oinprion = 0; - sound_nmi_enable = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x300000; - DrvZ80ROM = Next; Next += 0x040000; - - DrvGfxROM0 = Next; Next += 0x600000; - DrvGfxROM1 = Next; Next += 0xa00000; - DrvGfxROM2 = Next; Next += 0x500000; - DrvGfxROM3 = Next; Next += 0x100000; - - DrvGfxROMExp0 = Next; Next += 0xc00000; - DrvGfxROMExp1 = Next; Next += 0x1000000; - DrvGfxROMExp2 = Next; Next += 0x800000; - - DrvSndROM = Next; Next += 0x400000; - - DrvEeprom = Next; Next += 0x000080; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvSpriteRam = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x002000; - - DrvK053936Ctrl = Next; Next += 0x000400; - DrvK053936RAM = Next; Next += 0x001000; - - DrvZ80RAM = Next; Next += 0x002800; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - soundlatch3 = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void decode_gfx1(UINT8 *src, UINT8 *d, INT32 len) -{ - UINT8 *s = src; - UINT8 *pFinish = s+len-3; - - while (s < pFinish) - { - INT32 d0 = ((s[0]&0x80)<<0)|((s[0]&0x08)<<3)|((s[1]&0x80)>>2)|((s[1]&0x08)<<1)|((s[2]&0x80)>>4)|((s[2]&0x08)>>1)|((s[3]&0x80)>>6)|((s[3]&0x08)>>3); - INT32 d1 = ((s[0]&0x40)<<1)|((s[0]&0x04)<<4)|((s[1]&0x40)>>1)|((s[1]&0x04)<<2)|((s[2]&0x40)>>3)|((s[2]&0x04)>>0)|((s[3]&0x40)>>5)|((s[3]&0x04)>>2); - INT32 d2 = ((s[0]&0x20)<<2)|((s[0]&0x02)<<5)|((s[1]&0x20)<<0)|((s[1]&0x02)<<3)|((s[2]&0x20)>>2)|((s[2]&0x02)<<1)|((s[3]&0x20)>>4)|((s[3]&0x02)>>1); - INT32 d3 = ((s[0]&0x10)<<3)|((s[0]&0x01)<<6)|((s[1]&0x10)<<1)|((s[1]&0x01)<<4)|((s[2]&0x10)>>1)|((s[2]&0x01)<<2)|((s[3]&0x10)>>3)|((s[3]&0x01)>>0); - - d[0] = d3; - d[1] = d1; - d[2] = d2; - d[3] = d0; - d[4] = s[4]; - - s += 5; - d += 5; - } - - INT32 nLen = len; - INT32 Plane[5] = { 32, 24, 8, 16, 0 }; - INT32 XOffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[8] = { 0, 5*8, 5*8*2, 5*8*3, 5*8*4, 5*8*5, 5*8*6, 5*8*7 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(nLen); - - memcpy (tmp, DrvGfxROMExp0, nLen); - - GfxDecode(((nLen * 8) / 5) / 0x40, 5, 8, 8, Plane, XOffs, YOffs, 8*8*5, tmp, DrvGfxROMExp0); - - BurnFree (tmp); -} - -static void DecodeSprites(UINT8 *rom, UINT8 *exprom, INT32 len) -{ - INT32 Plane[5] = { 32, 24, 16, 8, 0 }; - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 40, 41, 42, 43, 44, 45, 46, 47 }; - INT32 YOffs[16] = { 0, 10*8, 10*8*2, 10*8*3, 10*8*4, 10*8*5, 10*8*6, 10*8*7, 10*8*8, - 10*8*9, 10*8*10, 10*8*11, 10*8*12, 10*8*13, 10*8*14, 10*8*15 }; - - INT32 size4 = (len/(1024*1024))/5; - size4 *= 4*1024*1024; - - UINT8 *tmp = (UINT8*)BurnMalloc(size4 * 5); - - UINT8 *d = tmp; - UINT8 *s1 = rom; - UINT8 *s2 = rom + (size4); - - for (INT32 i = 0; i < size4; i+=4) - { - *d++ = *s1++; - *d++ = *s1++; - *d++ = *s1++; - *d++ = *s1++; - *d++ = *s2++; - } - - GfxDecode(size4 / 128, 5, 16, 16, Plane, XOffs, YOffs, 16*16*5, tmp, exprom); - - BurnFree (tmp); -} - -static void Metamrph_sprite_decode() -{ - INT32 Plane[4] = { 24, 16, 8, 0 }; - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39 }; - INT32 YOffs[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; - - GfxDecode(0x10000, 4, 16, 16, Plane, XOffs, YOffs, 16*16*4, DrvGfxROM1, DrvGfxROMExp1); -} - -static INT32 MystwarrInit() -{ - nGame = 1; - - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000004, 7, 5)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 10, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 11, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x400000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x400001, 13, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 15, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 16, 1)) return 1; - - decode_gfx1(DrvGfxROM0, DrvGfxROMExp0, 0x500000); - DecodeSprites(DrvGfxROM1, DrvGfxROMExp1, 0x500000); - } - - K055555Init(); - K054338Init(); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x400000, mystwarr_tile_callback); - K056832SetGlobalOffsets(24, 16); - K056832SetLayerOffsets(0, -2-4, 0); - K056832SetLayerOffsets(1, 0-4, 0); - K056832SetLayerOffsets(2, 2-4, 0); - K056832SetLayerOffsets(3, 3-4, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x7fffff, mystwarr_sprite_callback, 3); - K053247SetSpriteOffset(-24-48, -16-24); - K053247SetBpp(5); - - konamigx_mixer_init(0); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvSpriteRam, 0x400000, 0x40ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x700000, 0x701fff, MAP_RAM); - SekSetWriteWordHandler(0, mystwarr_main_write_word); - SekSetWriteByteHandler(0, mystwarr_main_write_byte); - SekSetReadWordHandler(0, mystwarr_main_read_word); - SekSetReadByteHandler(0, mystwarr_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(mystwarr_sound_write); - ZetSetReadHandler(mystwarr_sound_read); - ZetClose(); - - EEPROMInit(&mystwarr_eeprom_interface); - - K054539Init(0, 48000, DrvSndROM, 0x400000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(0, 0, 0.80); - K054539_set_gain(0, 1, 0.80); - K054539_set_gain(0, 2, 0.80); - K054539_set_gain(0, 3, 0.80); - K054539_set_gain(0, 4, 2.00); - K054539_set_gain(0, 5, 2.00); - K054539_set_gain(0, 6, 2.00); - K054539_set_gain(0, 7, 2.00); - - K054539Init(1, 48000, DrvSndROM, 0x400000); - K054539SetRoute(1, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(1, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(1, 0, 0.50); - K054539_set_gain(1, 1, 0.50); - K054539_set_gain(1, 2, 0.50); - K054539_set_gain(1, 3, 0.50); - K054539_set_gain(1, 4, 0.50); - K054539_set_gain(1, 5, 0.50); - K054539_set_gain(1, 6, 0.50); - K054539_set_gain(1, 7, 0.50); - - DrvDoReset(); - - return 0; -} - -static INT32 MetamrphInit() -{ - nGame = 2; - - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100001, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 10, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 12, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 13, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 14, 1)) return 1; - - decode_gfx1(DrvGfxROM0, DrvGfxROMExp0, 0x500000); - - Metamrph_sprite_decode(); - } - - K055555Init(); - K054338Init(); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x200000, metamrph_tile_callback); - K056832SetGlobalOffsets(24, 15); - K056832SetLayerOffsets(0, -2+4, 2); - K056832SetLayerOffsets(1, 0+4, 2); - K056832SetLayerOffsets(2, 2+4, 2); - K056832SetLayerOffsets(3, 3+4, 2); - K056832Metamorphic_Fixup(); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x7fffff, metamrph_sprite_callback, 1); - K053247SetSpriteOffset(-51-24, -24-15+0); - - K053250Init(0, DrvGfxROM2, DrvGfxROMExp2, 0x40000); - K053250SetOffsets(0, -60+29, -16); // verify - - konamigx_mixer_init(0); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvSpriteRam, 0x211000, 0x21ffff, MAP_RAM); - SekMapMemory((UINT8*)K053250Ram, 0x24c000, 0x24ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x330000, 0x331fff, MAP_RAM); - SekSetWriteWordHandler(0, metamrph_main_write_word); - SekSetWriteByteHandler(0, metamrph_main_write_byte); - SekSetReadWordHandler(0, metamrph_main_read_word); - SekSetReadByteHandler(0, metamrph_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(mystwarr_sound_write); - ZetSetReadHandler(mystwarr_sound_read); - ZetClose(); - - EEPROMInit(&mystwarr_eeprom_interface); - - K054539Init(0, 48000, DrvSndROM, 0x400000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(0, 0, 0.80); - K054539_set_gain(0, 1, 0.80); - K054539_set_gain(0, 2, 0.80); - K054539_set_gain(0, 3, 0.80); - K054539_set_gain(0, 4, 1.80); - K054539_set_gain(0, 5, 1.80); - K054539_set_gain(0, 6, 1.80); - K054539_set_gain(0, 7, 1.80); - - K054539Init(1, 48000, DrvSndROM, 0x400000); - K054539SetRoute(1, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(1, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(1, 0, 0.80); - K054539_set_gain(1, 1, 0.80); - K054539_set_gain(1, 2, 0.80); - K054539_set_gain(1, 3, 0.80); - K054539_set_gain(1, 4, 0.80); - K054539_set_gain(1, 5, 0.80); - K054539_set_gain(1, 6, 0.80); - K054539_set_gain(1, 7, 0.80); - - DrvDoReset(); - - return 0; -} - -static INT32 ViostormInit() -{ - nGame = 3; - - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 4, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 5, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 6, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 8, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 10, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 11, 1)) return 1; - - decode_gfx1(DrvGfxROM0, DrvGfxROMExp0, 0x600000); - - Metamrph_sprite_decode(); - } - - K055555Init(); - K054338Init(); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x200000, metamrph_tile_callback); - K056832SetGlobalOffsets(40, 16); - K056832SetLayerOffsets(0, -2+1, 0); - K056832SetLayerOffsets(1, 0+1, 0); - K056832SetLayerOffsets(2, 2+1, 0); - K056832SetLayerOffsets(3, 3+1, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x7fffff, metamrph_sprite_callback, 3); - K053247SetSpriteOffset(-62-40, -23-16); - - K053250Init(0, DrvGfxROM2, DrvGfxROMExp2, 1); // doesn't exist on this hardware - - konamigx_mixer_init(0); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvSpriteRam, 0x211000, 0x21ffff, MAP_RAM); - SekMapMemory((UINT8*)K053250Ram, 0x24c000, 0x24ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x330000, 0x331fff, MAP_RAM); - SekSetWriteWordHandler(0, metamrph_main_write_word); - SekSetWriteByteHandler(0, metamrph_main_write_byte); - SekSetReadWordHandler(0, metamrph_main_read_word); - SekSetReadByteHandler(0, metamrph_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(mystwarr_sound_write); - ZetSetReadHandler(mystwarr_sound_read); - ZetClose(); - - EEPROMInit(&mystwarr_eeprom_interface); - - K054539Init(0, 48000, DrvSndROM, 0x400000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(0, 0, 2.00); - K054539_set_gain(0, 1, 2.00); - K054539_set_gain(0, 2, 2.00); - K054539_set_gain(0, 3, 2.00); - K054539_set_gain(0, 4, 2.00); - K054539_set_gain(0, 5, 2.00); - K054539_set_gain(0, 6, 2.00); - K054539_set_gain(0, 7, 2.00); - - K054539Init(1, 48000, DrvSndROM, 0x400000); - K054539SetRoute(1, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(1, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static INT32 MartchmpInit() -{ - nGame = 4; - - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000004, 7, 5)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 10, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 11, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x800000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x800001, 13, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 15, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 16, 1)) return 1; - - decode_gfx1(DrvGfxROM0, DrvGfxROMExp0, 0x500000); - - DecodeSprites(DrvGfxROM1, DrvGfxROMExp1, 0xa00000); - } - - K055555Init(); - K054338Init(); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x400000, game5bpp_tile_callback); - K056832SetGlobalOffsets(32, 16); - K056832SetLayerOffsets(0, -2-4, 0); - K056832SetLayerOffsets(1, 0-4, 0); - K056832SetLayerOffsets(2, 2-4, 0); - K056832SetLayerOffsets(3, 3-4, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x7fffff, martchmp_sprite_callback, 3); - K053247SetSpriteOffset((-23-58-9), (-16-23-14)); - K053247SetBpp(5); - - konamigx_mixer_init(0); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM + 0x000000, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(Drv68KROM + 0x100000, 0x300000, 0x3fffff, MAP_ROM); - SekMapMemory(DrvSpriteRam, 0x480000, 0x483fff, MAP_ROM); // should be written through handler - SekMapMemory(DrvPalRAM, 0x600000, 0x601fff, MAP_RAM); - SekSetWriteWordHandler(0, martchmp_main_write_word); - SekSetWriteByteHandler(0, martchmp_main_write_byte); - SekSetReadWordHandler(0, martchmp_main_read_word); - SekSetReadByteHandler(0, martchmp_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(mystwarr_sound_write); - ZetSetReadHandler(mystwarr_sound_read); - ZetClose(); - - EEPROMInit(&mystwarr_eeprom_interface); - - K054539Init(0, 48000, DrvSndROM, 0x400000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(0, 0, 1.40); - K054539_set_gain(0, 1, 1.40); - K054539_set_gain(0, 2, 1.40); - K054539_set_gain(0, 3, 1.40); - K054539_set_gain(0, 4, 1.40); - K054539_set_gain(0, 5, 1.40); - K054539_set_gain(0, 6, 1.40); - K054539_set_gain(0, 7, 1.40); - - K054539Init(1, 48000, DrvSndROM, 0x400000); - K054539SetRoute(1, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(1, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static void DrvGfxExpand(UINT8 *src, INT32 nLen) -{ - for (INT32 i = (nLen - 1) * 2; i >= 0; i-=2) { - src[i+0] = src[(i/2)] >> 4; - src[i+1] = src[(i/2)] & 0xf; - } -} - -// pre-draw the whole roz tilemap... needs a ton of ram! -static void GaiapolisRozTilemapdraw() -{ - UINT8 *dat1 = DrvGfxROM3; - UINT8 *dat2 = DrvGfxROM3 + 0x20000; - UINT8 *dat3 = DrvGfxROM3 + 0x60000; - - K053936_external_bitmap = pMystwarrRozBitmap; - - for (INT32 offs = 0; offs < 512 * 512; offs++) - { - INT32 sx = (offs & 0x1ff) * 16; - INT32 sy = (offs / 0x200) * 16; - - INT32 code = dat3[offs] | ((dat2[offs]&0x3f)<<8); - INT32 color = 0; - - if (offs & 1) - color = dat1[offs>>1]&0xf; - else - color = dat1[offs>>1]>>4; - - if (dat2[offs] & 0x80) color |= 0x10; - - UINT8 *gfx = DrvGfxROM2 + (code * 0x100); - color <<= 4; - - UINT16 *dst = pMystwarrRozBitmap + sy * 0x2000 + sx; - - for (INT32 y = 0; y < 16; y++) { - for (INT32 x = 0; x < 16; x++, gfx++) { - dst[x] = gfx[0] + color; - } - dst += 0x2000; - } - } -} - -static INT32 GaiapolisInit() -{ - nGame = 5; - - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x200001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x200000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 10, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x060000, 16, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 17, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 18, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 19, 1)) return 1; - - decode_gfx1(DrvGfxROM0, DrvGfxROMExp0, 0x500000); - - Metamrph_sprite_decode(); - } - - K055555Init(); - K054338Init(); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x400000, metamrph_tile_callback); - K056832SetGlobalOffsets(32, 16); - K056832SetLayerOffsets(0, -2, 0); - K056832SetLayerOffsets(1, 0, 0); - K056832SetLayerOffsets(2, 2, 0); - K056832SetLayerOffsets(3, 2, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x7fffff, gaiapolis_sprite_callback, 1); - K053247SetSpriteOffset(7+(-24-79), -16-24); - - konamigx_mixer_init(0); -// K054338_invert_alpha(0); // otherwise alpha blended roz is too light - sept.2.2016 - this breaks the "elevator/going down" level - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x2fffff, MAP_ROM); - SekMapMemory(DrvSpriteRam, 0x400000, 0x40ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x420000, 0x421fff, MAP_RAM); - SekMapMemory(DrvK053936Ctrl, 0x460000, 0x46001f, MAP_RAM); - SekMapMemory(DrvK053936RAM, 0x470000, 0x470fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x600000, 0x60ffff, MAP_RAM); - SekSetWriteWordHandler(0, dadandrn_main_write_word); - SekSetWriteByteHandler(0, dadandrn_main_write_byte); - SekSetReadWordHandler(0, dadandrn_main_read_word); - SekSetReadByteHandler(0, dadandrn_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(mystwarr_sound_write); - ZetSetReadHandler(mystwarr_sound_read); - ZetClose(); - - EEPROMInit(&gaiapolis_eeprom_interface); - - { - DrvGfxExpand(DrvGfxROM2 , 0x180000); - pMystwarrRozBitmap = (UINT16*)BurnMalloc(((512 * 16) * 2) * (512 * 16) * 2); - GaiapolisRozTilemapdraw(); - - m_k053936_0_ctrl = (UINT16*)DrvK053936Ctrl; - m_k053936_0_linectrl = (UINT16*)DrvK053936RAM; - K053936GP_set_offset(0, -44, -17); - } - - K054539Init(0, 48000, DrvSndROM, 0x400000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(0, 0, 0.80); - K054539_set_gain(0, 1, 0.80); - K054539_set_gain(0, 2, 0.80); - K054539_set_gain(0, 3, 0.80); - K054539_set_gain(0, 4, 2.00); - K054539_set_gain(0, 5, 2.00); - K054539_set_gain(0, 6, 2.00); - K054539_set_gain(0, 7, 2.00); - - K054539Init(1, 48000, DrvSndROM, 0x400000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(1, 0, 0.50); - K054539_set_gain(1, 1, 0.50); - K054539_set_gain(1, 2, 0.50); - K054539_set_gain(1, 3, 0.50); - K054539_set_gain(1, 4, 0.50); - K054539_set_gain(1, 5, 0.50); - K054539_set_gain(1, 6, 0.50); - K054539_set_gain(1, 7, 0.50); - - DrvDoReset(); - - return 0; -} - -// pre-draw the whole roz tilemap... needs a ton of ram! -static void DadandrnRozTilemapdraw() -{ - UINT8 *dat1 = DrvGfxROM3; - UINT8 *dat2 = DrvGfxROM3 + 0x40000; - - K053936_external_bitmap = pMystwarrRozBitmap; - - for (INT32 offs = 0; offs < 512 * 512; offs++) - { - INT32 sx = (offs & 0x1ff) * 16; - INT32 sy = (offs / 0x200) * 16; - - INT32 code = dat2[offs] | ((dat1[offs]&0x1f)<<8); - INT32 flipx = (dat1[offs] & 0x40) ? 0x0f : 0; - - UINT8 *gfx = DrvGfxROM2 + (code * 0x100); - - UINT16 *dst = pMystwarrRozBitmap + sy * 0x2000 + sx; - - for (INT32 y = 0; y < 16; y++) { - for (INT32 x = 0; x < 16; x++, gfx++) { - dst[x^flipx] = gfx[0]; - } - dst += 0x2000; - } - } -} - -static INT32 DadandrnInit() -{ - nGame = 6; - - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 5, LD_GROUP(2) | LD_REVERSE)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000004, 7, 5)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 10, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 11, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x800000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x800001, 13, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 16, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x040000, 18, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 19, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 20, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 21, 1)) return 1; - - decode_gfx1(DrvGfxROM0, DrvGfxROMExp0, 0x500000); - - DecodeSprites(DrvGfxROM1, DrvGfxROMExp1, 0xa00000); - } - - K055555Init(); - K054338Init(); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x400000, game5bpp_tile_callback); - K056832SetGlobalOffsets(24, 17); - K056832SetLayerOffsets(0, -2+4, 0); - K056832SetLayerOffsets(1, 0+4, 0); - K056832SetLayerOffsets(2, 2+4, 0); - K056832SetLayerOffsets(3, 3+4, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x7fffff, gaiapolis_sprite_callback, 1); - K053247SetSpriteOffset(-24-42, -17-22); - K053247SetBpp(5); - - konamigx_mixer_init(0); - konamigx_mixer_primode(1); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(DrvSpriteRam, 0x400000, 0x40ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x420000, 0x421fff, MAP_RAM); - SekMapMemory(DrvK053936Ctrl, 0x460000, 0x46001f, MAP_RAM); - SekMapMemory(DrvK053936RAM, 0x470000, 0x470fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x600000, 0x60ffff, MAP_RAM); - SekSetWriteWordHandler(0, dadandrn_main_write_word); - SekSetWriteByteHandler(0, dadandrn_main_write_byte); - SekSetReadWordHandler(0, dadandrn_main_read_word); - SekSetReadByteHandler(0, dadandrn_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(mystwarr_sound_write); - ZetSetReadHandler(mystwarr_sound_read); - ZetClose(); - - EEPROMInit(&mystwarr_eeprom_interface); - - { - pMystwarrRozBitmap = (UINT16*)BurnMalloc(((512 * 16) * 2) * (512 * 16) * 2); - DadandrnRozTilemapdraw(); - - m_k053936_0_ctrl = (UINT16*)DrvK053936Ctrl; - m_k053936_0_linectrl = (UINT16*)DrvK053936RAM; - K053936GP_set_offset(0, -24-8, -17); - } - - K054539Init(0, 48000, DrvSndROM, 0x400000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(0, 0, 1.00); - K054539_set_gain(0, 1, 1.00); - K054539_set_gain(0, 2, 1.00); - K054539_set_gain(0, 3, 1.00); - K054539_set_gain(0, 4, 2.00); - K054539_set_gain(0, 5, 2.00); - K054539_set_gain(0, 6, 2.00); - K054539_set_gain(0, 7, 2.00); - - K054539Init(1, 48000, DrvSndROM, 0x400000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - K054539_set_gain(1, 0, 1.00); - K054539_set_gain(1, 1, 1.00); - K054539_set_gain(1, 2, 1.00); - K054539_set_gain(1, 3, 1.00); - K054539_set_gain(1, 4, 1.00); - K054539_set_gain(1, 5, 1.00); - K054539_set_gain(1, 6, 1.00); - K054539_set_gain(1, 7, 1.00); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamigx_mixer_exit(); - - SekExit(); - ZetExit(); - - EEPROMExit(); - - K054539Exit(); - - BurnFree (AllMem); - if (pMystwarrRozBitmap) { - BurnFree (pMystwarrRozBitmap); - pMystwarrRozBitmap = NULL; - } - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x2000/2; i+=2) - { - INT32 r = pal[i+0] & 0xff; - INT32 g = pal[i+1] >> 8; - INT32 b = pal[i+1] & 0xff; - - DrvPalette[i/2] = (r << 16) + (g << 8) + b; - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - KonamiClearBitmaps(0); - - for (INT32 i = 0; i < 4; i++) { - layer_colorbase[i] = K055555GetPaletteIndex(i)<<4; - } - - INT32 blendmode = 0, enable_sub = 0; - - if (nGame == 1) { // mystwarr - blendmode = 0; - cbparam = 0; // ? - sprite_colorbase = K055555GetPaletteIndex(4)<<5; - } - - if (nGame == 2 || nGame == 3) { // viostorm / metamrph - blendmode = GXSUB_K053250 | GXSUB_4BPP; - sprite_colorbase = K055555GetPaletteIndex(4)<<4; - } - - if (nGame == 4) { // mtlchamp - cbparam = K055555ReadRegister(K55_PRIINP_8); - oinprion = K055555ReadRegister(K55_OINPRI_ON); - - blendmode = (oinprion==0xef && K054338_read_register(K338_REG_PBLEND)) ? ((1<<16|GXMIX_BLEND_FORCE)<<2) : 0; - sprite_colorbase = K055555GetPaletteIndex(4)<<5; - } - - if (nGame == 5) // gaiapolis - { - sprite_colorbase = (K055555GetPaletteIndex(4)<<4)&0x7f; - sub1_colorbase = (K055555GetPaletteIndex(5)<<8)&0x700; - blendmode = GXSUB_4BPP; - K053936GP_set_colorbase(0, sub1_colorbase); - enable_sub = 1; - } - - if (nGame == 6) // dadandrn - { - sprite_colorbase = (K055555GetPaletteIndex(4)<<3)&0x7f; - sub1_colorbase = (K055555GetPaletteIndex(5)<<8)&0x700; - blendmode = GXSUB_8BPP; - K053936GP_set_colorbase(0, sub1_colorbase); - enable_sub = 1; - } - - konamigx_mixer(enable_sub, blendmode, 0, 0, 0, 0, 0); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 5 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - - DrvInputs[1] = DrvDips[0] | (DrvInputs[1] & 0xff00) | 2; - } - - SekNewFrame(); - ZetNewFrame(); - - INT32 nInterleave = 60; - INT32 nCyclesTotal[2] = { 16000000 / 60, 8000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - if (nGame == 1) - { - if (mw_irq_control & 1) - { - if (i == 0) - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - if (i == ((nInterleave * (240+10))/256)) // +10 otherwise flickers on char.selection screen (mystwarr) - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - } - - if (nGame == 2 || nGame == 3) - { - if (i == 0) // otherwise service mode doesn't work! - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - if (i == ((nInterleave * 24) / 256)) - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (i == ((nInterleave * 248) / 256) && K053246_is_IRQ_enabled()) - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - } - - if (nGame == 4) // martchmp - { - if (mw_irq_control & 2) - { - if (i == ((nInterleave * 23) / 256)) - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - if (i == ((nInterleave * 47) / 256) && K053246_is_IRQ_enabled()) - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - } - - if (nGame == 5 || nGame == 6) - { - if (i == (nInterleave - 1)) - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - } - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = SekRun(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - - if ((i % (nInterleave / 8)) == ((nInterleave / 8) - 1)) {// && sound_nmi_enable && sound_control) { // iq_132 - ZetNmi(); - } - } - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * 2); - K054539Update(0, pBurnSoundOut, nBurnSoundLen); - K054539Update(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029732; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - K054539Scan(nAction); - KonamiICScan(nAction); - - SCAN_VAR(sound_nmi_enable); - SCAN_VAR(sound_control); - SCAN_VAR(control_data); - SCAN_VAR(mw_irq_control); - SCAN_VAR(prot_data); - SCAN_VAR(layer_colorbase); - SCAN_VAR(sprite_colorbase); - SCAN_VAR(sub1_colorbase); - SCAN_VAR(cbparam); - SCAN_VAR(oinprion); - SCAN_VAR(z80_bank); - - BurnRandomScan(nAction); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(z80_bank); - ZetClose(); - } - - EEPROMScan(nAction, pnMin); - - return 0; -} - - -// Mystic Warriors (ver EAA) - -static struct BurnRomInfo mystwarrRomDesc[] = { - { "128eaa01.20f", 0x040000, 0x508f249c, 1 }, // 0 maincpu - { "128eaa02.20g", 0x040000, 0xf8ffa352, 1 }, // 1 - { "128a03.19f", 0x080000, 0xe98094f3, 1 }, // 2 - { "128a04.19g", 0x080000, 0x88c6a3e4, 1 }, // 3 - - { "128a05.6b", 0x020000, 0x0e5194e0, 2 }, // 4 soundcpu - - { "128a08.1h", 0x100000, 0x63d6cfa0, 3 }, // 5 gfx1 - { "128a09.1k", 0x100000, 0x573a7725, 3 }, // 6 - { "128a10.3h", 0x080000, 0x558e545a, 3 }, // 7 - - { "128a16.22k", 0x100000, 0x459b6407, 4 }, // 8 gfx2 - { "128a15.20k", 0x100000, 0x6bbfedf4, 4 }, // 9 - { "128a14.19k", 0x100000, 0xf7bd89dd, 4 }, // 10 - { "128a13.17k", 0x100000, 0xe89b66a2, 4 }, // 11 - { "128a12.12k", 0x080000, 0x63de93e2, 4 }, // 12 - { "128a11.10k", 0x080000, 0x4eac941a, 4 }, // 13 - - { "128a06.2d", 0x200000, 0x88ed598c, 5 }, // 14 shared - { "128a07.1d", 0x200000, 0xdb79a66e, 5 }, // 15 - - { "mystwarr.nv", 0x000080, 0x28df2269, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mystwarr) -STD_ROM_FN(mystwarr) - -struct BurnDriver BurnDrvMystwarr = { - "mystwarr", NULL, NULL, NULL, "1993", - "Mystic Warriors (ver EAA)\0", NULL, "Konami", "GX128", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, mystwarrRomInfo, mystwarrRomName, NULL, NULL, MystwarrInputInfo, MystwarrDIPInfo, - MystwarrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Mystic Warriors (ver UAA) - -static struct BurnRomInfo mystwarruRomDesc[] = { - { "128uaa01.20f", 0x040000, 0x3a89aafd, 1 }, // 0 maincpu - { "128uaa02.20g", 0x040000, 0xde07410f, 1 }, // 1 - { "128a03.19f", 0x080000, 0xe98094f3, 1 }, // 2 - { "128a04.19g", 0x080000, 0x88c6a3e4, 1 }, // 3 - - { "128a05.6b", 0x020000, 0x0e5194e0, 2 }, // 4 soundcpu - - { "128a08.1h", 0x100000, 0x63d6cfa0, 3 }, // 5 gfx1 - { "128a09.1k", 0x100000, 0x573a7725, 3 }, // 6 - { "128a10.3h", 0x080000, 0x558e545a, 3 }, // 7 - - { "128a16.22k", 0x100000, 0x459b6407, 4 }, // 8 gfx2 - { "128a15.20k", 0x100000, 0x6bbfedf4, 4 }, // 9 - { "128a14.19k", 0x100000, 0xf7bd89dd, 4 }, // 10 - { "128a13.17k", 0x100000, 0xe89b66a2, 4 }, // 11 - { "128a12.12k", 0x080000, 0x63de93e2, 4 }, // 12 - { "128a11.10k", 0x080000, 0x4eac941a, 4 }, // 13 - - { "128a06.2d", 0x200000, 0x88ed598c, 5 }, // 14 shared - { "128a07.1d", 0x200000, 0xdb79a66e, 5 }, // 15 - - { "mystwarru.nv", 0x000080, 0x1a2597c7, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mystwarru) -STD_ROM_FN(mystwarru) - -struct BurnDriver BurnDrvMystwarru = { - "mystwarru", "mystwarr", NULL, NULL, "1993", - "Mystic Warriors (ver UAA)\0", NULL, "Konami", "GX128", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, mystwarruRomInfo, mystwarruRomName, NULL, NULL, MystwarrInputInfo, MystwarrDIPInfo, - MystwarrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Mystic Warriors (ver JAA) - -static struct BurnRomInfo mystwarrjRomDesc[] = { - { "128jaa01.20f", 0x040000, 0x49c37bfe, 1 }, // 0 maincpu - { "128jaa02.20g", 0x040000, 0xe39fb3bb, 1 }, // 1 - { "128a03.19f", 0x080000, 0xe98094f3, 1 }, // 2 - { "128a04.19g", 0x080000, 0x88c6a3e4, 1 }, // 3 - - { "128a05.6b", 0x020000, 0x0e5194e0, 2 }, // 4 soundcpu - - { "128a08.1h", 0x100000, 0x63d6cfa0, 3 }, // 5 gfx1 - { "128a09.1k", 0x100000, 0x573a7725, 3 }, // 6 - { "128a10.3h", 0x080000, 0x558e545a, 3 }, // 7 - - { "128a16.22k", 0x100000, 0x459b6407, 4 }, // 8 gfx2 - { "128a15.20k", 0x100000, 0x6bbfedf4, 4 }, // 9 - { "128a14.19k", 0x100000, 0xf7bd89dd, 4 }, // 10 - { "128a13.17k", 0x100000, 0xe89b66a2, 4 }, // 11 - { "128a12.12k", 0x080000, 0x63de93e2, 4 }, // 12 - { "128a11.10k", 0x080000, 0x4eac941a, 4 }, // 13 - - { "128a06.2d", 0x200000, 0x88ed598c, 5 }, // 14 shared - { "128a07.1d", 0x200000, 0xdb79a66e, 5 }, // 15 - - { "mystwarrj.nv", 0x000080, 0x8e259918, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mystwarrj) -STD_ROM_FN(mystwarrj) - -struct BurnDriver BurnDrvMystwarrj = { - "mystwarrj", "mystwarr", NULL, NULL, "1993", - "Mystic Warriors (ver JAA)\0", NULL, "Konami", "GX128", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, mystwarrjRomInfo, mystwarrjRomName, NULL, NULL, MystwarrInputInfo, MystwarrDIPInfo, - MystwarrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Mystic Warriors (ver AAB) - -static struct BurnRomInfo mystwarraRomDesc[] = { - { "128aab01.20f", 0x040000, 0x3dc89153, 1 }, // 0 maincpu - { "128aab02.20g", 0x040000, 0x8fe92ad2, 1 }, // 1 - { "128a03.19f", 0x080000, 0xe98094f3, 1 }, // 2 - { "128a04.19g", 0x080000, 0x88c6a3e4, 1 }, // 3 - - { "128a05.6b", 0x020000, 0x0e5194e0, 2 }, // 4 soundcpu - - { "128a08.1h", 0x100000, 0x63d6cfa0, 3 }, // 5 gfx1 - { "128a09.1k", 0x100000, 0x573a7725, 3 }, // 6 - { "128a10.3h", 0x080000, 0x558e545a, 3 }, // 7 - - { "128a16.22k", 0x100000, 0x459b6407, 4 }, // 8 gfx2 - { "128a15.20k", 0x100000, 0x6bbfedf4, 4 }, // 9 - { "128a14.19k", 0x100000, 0xf7bd89dd, 4 }, // 10 - { "128a13.17k", 0x100000, 0xe89b66a2, 4 }, // 11 - { "128a12.12k", 0x080000, 0x63de93e2, 4 }, // 12 - { "128a11.10k", 0x080000, 0x4eac941a, 4 }, // 13 - - { "128a06.2d", 0x200000, 0x88ed598c, 5 }, // 14 shared - { "128a07.1d", 0x200000, 0xdb79a66e, 5 }, // 15 - - { "eeprom", 0x000080, 0xfd6a25b4, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mystwarra) -STD_ROM_FN(mystwarra) - -struct BurnDriver BurnDrvMystwarra = { - "mystwarra", "mystwarr", NULL, NULL, "1993", - "Mystic Warriors (ver AAB)\0", NULL, "Konami", "GX128", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, mystwarraRomInfo, mystwarraRomName, NULL, NULL, MystwarrInputInfo, MystwarrDIPInfo, - MystwarrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Mystic Warriors (ver AAA) - -static struct BurnRomInfo mystwarraaRomDesc[] = { - { "128aaa01.20f", 0x040000, 0x633ead86, 1 }, // 0 maincpu - { "128aaa02.20g", 0x040000, 0x69ab81a2, 1 }, // 1 - { "128a03.19f", 0x080000, 0xe98094f3, 1 }, // 2 - { "128a04.19g", 0x080000, 0x88c6a3e4, 1 }, // 3 - - { "128a05.6b", 0x020000, 0x0e5194e0, 2 }, // 4 soundcpu - - { "128a08.1h", 0x100000, 0x63d6cfa0, 3 }, // 5 gfx1 - { "128a09.1k", 0x100000, 0x573a7725, 3 }, // 6 - { "128a10.3h", 0x080000, 0x558e545a, 3 }, // 7 - - { "128a16.22k", 0x100000, 0x459b6407, 4 }, // 8 gfx2 - { "128a15.20k", 0x100000, 0x6bbfedf4, 4 }, // 9 - { "128a14.19k", 0x100000, 0xf7bd89dd, 4 }, // 10 - { "128a13.17k", 0x100000, 0xe89b66a2, 4 }, // 11 - { "128a12.12k", 0x080000, 0x63de93e2, 4 }, // 12 - { "128a11.10k", 0x080000, 0x4eac941a, 4 }, // 13 - - { "128a06.2d", 0x200000, 0x88ed598c, 5 }, // 14 shared - { "128a07.1d", 0x200000, 0xdb79a66e, 5 }, // 15 - - { "mystwarra.nv", 0x000080, 0x38951263, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mystwarraa) -STD_ROM_FN(mystwarraa) - -struct BurnDriver BurnDrvMystwarraa = { - "mystwarraa", "mystwarr", NULL, NULL, "1993", - "Mystic Warriors (ver AAA)\0", NULL, "Konami", "GX128", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, mystwarraaRomInfo, mystwarraaRomName, NULL, NULL, MystwarrInputInfo, MystwarrDIPInfo, - MystwarrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Violent Storm (ver EAC) - -static struct BurnRomInfo viostormRomDesc[] = { - { "168eac01.15h", 0x080000, 0x9f6b5c81, 1 }, // 0 maincpu - { "168eac02.15f", 0x080000, 0x126ecf03, 1 }, // 1 - - { "168a05.7c", 0x020000, 0x507fb3eb, 2 }, // 2 soundcpu - - { "168a09.1h", 0x200000, 0x1b34a881, 3 }, // 3 gfx1 - { "168a08.1k", 0x200000, 0xdb0ce743, 3 }, // 4 - - { "168a10.22k", 0x200000, 0xbd2bbdea, 4 }, // 5 gfx2 - { "168a11.19k", 0x200000, 0x7a57c9e7, 4 }, // 6 - { "168a12.20k", 0x200000, 0xb6b1c4ef, 4 }, // 7 - { "168a13.17k", 0x200000, 0xcdec3650, 4 }, // 8 - - { "168a06.1c", 0x200000, 0x25404fd7, 5 }, // 9 shared - { "168a07.1e", 0x200000, 0xfdbbf8cc, 5 }, // 10 - - { "viostorm.nv", 0x000080, 0x3cb1c96c, 6 }, // 11 eeprom -}; - -STD_ROM_PICK(viostorm) -STD_ROM_FN(viostorm) - -struct BurnDriver BurnDrvViostorm = { - "viostorm", NULL, NULL, NULL, "1993", - "Violent Storm (ver EAC)\0", NULL, "Konami", "GX224", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, viostormRomInfo, viostormRomName, NULL, NULL, ViostormInputInfo, ViostormDIPInfo, - ViostormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Violent Storm (ver EAB) - -static struct BurnRomInfo viostormebRomDesc[] = { - { "168eab01.15h", 0x080000, 0x4eee6a8e, 1 }, // 0 maincpu - { "168eab02.15f", 0x080000, 0x8dd8aa4c, 1 }, // 1 - - { "168a05.7c", 0x020000, 0x507fb3eb, 2 }, // 2 soundcpu - - { "168a09.1h", 0x200000, 0x1b34a881, 3 }, // 3 gfx1 - { "168a08.1k", 0x200000, 0xdb0ce743, 3 }, // 4 - - { "168a10.22k", 0x200000, 0xbd2bbdea, 4 }, // 5 gfx2 - { "168a11.19k", 0x200000, 0x7a57c9e7, 4 }, // 6 - { "168a12.20k", 0x200000, 0xb6b1c4ef, 4 }, // 7 - { "168a13.17k", 0x200000, 0xcdec3650, 4 }, // 8 - - { "168a06.1c", 0x200000, 0x25404fd7, 5 }, // 9 shared - { "168a07.1e", 0x200000, 0xfdbbf8cc, 5 }, // 10 - - { "viostormeb.nv", 0x000080, 0x28b5fe49, 6 }, // 11 eeprom -}; - -STD_ROM_PICK(viostormeb) -STD_ROM_FN(viostormeb) - -struct BurnDriver BurnDrvViostormeb = { - "viostormeb", "viostorm", NULL, NULL, "1993", - "Violent Storm (ver EAB)\0", NULL, "Konami", "GX168", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, viostormebRomInfo, viostormebRomName, NULL, NULL, ViostormInputInfo, ViostormDIPInfo, - ViostormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Violent Storm (ver UAC) - -static struct BurnRomInfo viostormuRomDesc[] = { - { "168uac01.15h", 0x080000, 0x49853530, 1 }, // 0 maincpu - { "168uac02.15f", 0x080000, 0x055ca6fe, 1 }, // 1 - - { "168a05.7c", 0x020000, 0x507fb3eb, 2 }, // 2 soundcpu - - { "168a09.1h", 0x200000, 0x1b34a881, 3 }, // 3 gfx1 - { "168a08.1k", 0x200000, 0xdb0ce743, 3 }, // 4 - - { "168a10.22k", 0x200000, 0xbd2bbdea, 4 }, // 5 gfx2 - { "168a11.19k", 0x200000, 0x7a57c9e7, 4 }, // 6 - { "168a12.20k", 0x200000, 0xb6b1c4ef, 4 }, // 7 - { "168a13.17k", 0x200000, 0xcdec3650, 4 }, // 8 - - { "168a06.1c", 0x200000, 0x25404fd7, 5 }, // 9 shared - { "168a07.1e", 0x200000, 0xfdbbf8cc, 5 }, // 10 - - { "viostormu.nv", 0x000080, 0x797042a1, 6 }, // 11 eeprom -}; - -STD_ROM_PICK(viostormu) -STD_ROM_FN(viostormu) - -struct BurnDriver BurnDrvViostormu = { - "viostormu", "viostorm", NULL, NULL, "1993", - "Violent Storm (ver UAC)\0", NULL, "Konami", "GX168", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, viostormuRomInfo, viostormuRomName, NULL, NULL, ViostormInputInfo, ViostormDIPInfo, - ViostormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Violent Storm (ver UAB) - -static struct BurnRomInfo viostormubRomDesc[] = { - { "168uab01.15h", 0x080000, 0x2d6a9fa3, 1 }, // 0 maincpu - { "168uab02.15f", 0x080000, 0x0e75f7cc, 1 }, // 1 - - { "168a05.7c", 0x020000, 0x507fb3eb, 2 }, // 2 soundcpu - - { "168a09.1h", 0x200000, 0x1b34a881, 3 }, // 3 gfx1 - { "168a08.1k", 0x200000, 0xdb0ce743, 3 }, // 4 - - { "168a10.22k", 0x200000, 0xbd2bbdea, 4 }, // 5 gfx2 - { "168a11.19k", 0x200000, 0x7a57c9e7, 4 }, // 6 - { "168a12.20k", 0x200000, 0xb6b1c4ef, 4 }, // 7 - { "168a13.17k", 0x200000, 0xcdec3650, 4 }, // 8 - - { "168a06.1c", 0x200000, 0x25404fd7, 5 }, // 9 shared - { "168a07.1e", 0x200000, 0xfdbbf8cc, 5 }, // 10 - - { "viostormub.nv", 0x000080, 0xb6937413, 6 }, // 11 eeprom -}; - -STD_ROM_PICK(viostormub) -STD_ROM_FN(viostormub) - -struct BurnDriver BurnDrvViostormub = { - "viostormub", "viostorm", NULL, NULL, "1993", - "Violent Storm (ver UAB)\0", NULL, "Konami", "GX168", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, viostormubRomInfo, viostormubRomName, NULL, NULL, ViostormInputInfo, ViostormDIPInfo, - ViostormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Violent Storm (ver AAC) - -static struct BurnRomInfo viostormaRomDesc[] = { - { "168aac01.15h", 0x080000, 0x3620635c, 1 }, // 0 maincpu - { "168aac02.15f", 0x080000, 0xdb679aec, 1 }, // 1 - - { "168a05.7c", 0x020000, 0x507fb3eb, 2 }, // 2 soundcpu - - { "168a09.1h", 0x200000, 0x1b34a881, 3 }, // 3 gfx1 - { "168a08.1k", 0x200000, 0xdb0ce743, 3 }, // 4 - - { "168a10.22k", 0x200000, 0xbd2bbdea, 4 }, // 5 gfx2 - { "168a11.19k", 0x200000, 0x7a57c9e7, 4 }, // 6 - { "168a12.20k", 0x200000, 0xb6b1c4ef, 4 }, // 7 - { "168a13.17k", 0x200000, 0xcdec3650, 4 }, // 8 - - { "168a06.1c", 0x200000, 0x25404fd7, 5 }, // 9 shared - { "168a07.1e", 0x200000, 0xfdbbf8cc, 5 }, // 10 - - { "viostorma.nv", 0x000080, 0x2cfbf966, 6 }, // 11 eeprom -}; - -STD_ROM_PICK(viostorma) -STD_ROM_FN(viostorma) - -struct BurnDriver BurnDrvViostorma = { - "viostorma", "viostorm", NULL, NULL, "1993", - "Violent Storm (ver AAC)\0", NULL, "Konami", "GX168", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, viostormaRomInfo, viostormaRomName, NULL, NULL, ViostormInputInfo, ViostormDIPInfo, - ViostormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Violent Storm (ver AAB) - -static struct BurnRomInfo viostormabRomDesc[] = { - { "168aab01.15h", 0x080000, 0x14f78423, 1 }, // 0 maincpu - { "168aab02.15f", 0x080000, 0x3dd1cc83, 1 }, // 1 - - { "168a05.7c", 0x020000, 0x507fb3eb, 2 }, // 2 soundcpu - - { "168a09.1h", 0x200000, 0x1b34a881, 3 }, // 3 gfx1 - { "168a08.1k", 0x200000, 0xdb0ce743, 3 }, // 4 - - { "168a10.22k", 0x200000, 0xbd2bbdea, 4 }, // 5 gfx2 - { "168a11.19k", 0x200000, 0x7a57c9e7, 4 }, // 6 - { "168a12.20k", 0x200000, 0xb6b1c4ef, 4 }, // 7 - { "168a13.17k", 0x200000, 0xcdec3650, 4 }, // 8 - - { "168a06.1c", 0x200000, 0x25404fd7, 5 }, // 9 shared - { "168a07.1e", 0x200000, 0xfdbbf8cc, 5 }, // 10 - - { "viostormab.nv", 0x000080, 0x38ffce43, 6 }, // 11 eeprom -}; - -STD_ROM_PICK(viostormab) -STD_ROM_FN(viostormab) - -struct BurnDriver BurnDrvViostormab = { - "viostormab", "viostorm", NULL, NULL, "1993", - "Violent Storm (ver AAB)\0", NULL, "Konami", "GX168", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, viostormabRomInfo, viostormabRomName, NULL, NULL, ViostormInputInfo, ViostormDIPInfo, - ViostormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Violent Storm (ver JAC) - -static struct BurnRomInfo viostormjRomDesc[] = { - { "168jac01.b01", 0x080000, 0xf8be1225, 1 }, // 0 maincpu - { "168jac02.b02", 0x080000, 0xf42fd1e5, 1 }, // 1 - - { "168a05.7c", 0x020000, 0x507fb3eb, 2 }, // 2 soundcpu - - { "168a09.1h", 0x200000, 0x1b34a881, 3 }, // 3 gfx1 - { "168a08.1k", 0x200000, 0xdb0ce743, 3 }, // 4 - - { "168a10.22k", 0x200000, 0xbd2bbdea, 4 }, // 5 gfx2 - { "168a11.19k", 0x200000, 0x7a57c9e7, 4 }, // 6 - { "168a12.20k", 0x200000, 0xb6b1c4ef, 4 }, // 7 - { "168a13.17k", 0x200000, 0xcdec3650, 4 }, // 8 - - { "168a06.1c", 0x200000, 0x25404fd7, 5 }, // 9 shared - { "168a07.1e", 0x200000, 0xfdbbf8cc, 5 }, // 10 - - { "viostormj.nv", 0x000080, 0x32f5d8bc, 6 }, // 11 eeprom -}; - -STD_ROM_PICK(viostormj) -STD_ROM_FN(viostormj) - -struct BurnDriver BurnDrvViostormj = { - "viostormj", "viostorm", NULL, NULL, "1993", - "Violent Storm (ver JAC)\0", NULL, "Konami", "GX168", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, viostormjRomInfo, viostormjRomName, NULL, NULL, ViostormInputInfo, ViostormDIPInfo, - ViostormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Metamorphic Force (ver EAA) - -static struct BurnRomInfo metamrphRomDesc[] = { - { "224eaa01.15h", 0x040000, 0x30962c2b, 1 }, // 0 maincpu - { "224eaa02.15f", 0x040000, 0xe314330a, 1 }, // 1 - { "224a03", 0x080000, 0xa5bedb01, 1 }, // 2 - { "224a04", 0x080000, 0xada53ba4, 1 }, // 3 - - { "224a05", 0x040000, 0x4b4c985c, 2 }, // 4 soundcpu - - { "224a09", 0x100000, 0x1931afce, 3 }, // 5 gfx1 - { "224a08", 0x100000, 0xdc94d53a, 3 }, // 6 - - { "224a10", 0x200000, 0x161287f0, 4 }, // 7 gfx2 - { "224a11", 0x200000, 0xdf5960e1, 4 }, // 8 - { "224a12", 0x200000, 0xca72a4b3, 4 }, // 9 - { "224a13", 0x200000, 0x86b58feb, 4 }, // 10 - - { "224a14", 0x040000, 0x3c79b404, 5 }, // 11 k053250_1 - - { "224a06", 0x200000, 0x972f6abe, 6 }, // 12 shared - { "224a07", 0x100000, 0x61b2f97a, 6 }, // 13 - - { "metamrph.nv", 0x000080, 0x2c51229a, 7 }, // 14 eeprom -}; - -STD_ROM_PICK(metamrph) -STD_ROM_FN(metamrph) - -struct BurnDriver BurnDrvMetamrph = { - "metamrph", NULL, NULL, NULL, "1993", - "Metamorphic Force (ver EAA)\0", NULL, "Konami", "GX224", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, metamrphRomInfo, metamrphRomName, NULL, NULL, MetamrphInputInfo, MetamrphDIPInfo, - MetamrphInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Metamorphic Force (ver EAA - alternate) -/* alternate set - possibly a bugfix version. Only 2 adjusted bytes causing a swap in commands */ - -static struct BurnRomInfo metamrpheRomDesc[] = { - { "3.15h", 0x040000, 0x8b9f1ba3, 1 }, // 0 maincpu - { "224eaa02.15f", 0x040000, 0xe314330a, 1 }, // 1 - { "224a03", 0x080000, 0xa5bedb01, 1 }, // 2 - { "224a04", 0x080000, 0xada53ba4, 1 }, // 3 - - { "224a05", 0x040000, 0x4b4c985c, 2 }, // 4 soundcpu - - { "224a09", 0x100000, 0x1931afce, 3 }, // 5 gfx1 - { "224a08", 0x100000, 0xdc94d53a, 3 }, // 6 - - { "224a10", 0x200000, 0x161287f0, 4 }, // 7 gfx2 - { "224a11", 0x200000, 0xdf5960e1, 4 }, // 8 - { "224a12", 0x200000, 0xca72a4b3, 4 }, // 9 - { "224a13", 0x200000, 0x86b58feb, 4 }, // 10 - - { "224a14", 0x040000, 0x3c79b404, 5 }, // 11 k053250_1 - - { "224a06", 0x200000, 0x972f6abe, 6 }, // 12 shared - { "224a07", 0x100000, 0x61b2f97a, 6 }, // 13 - - { "metamrph.nv", 0x000080, 0x2c51229a, 7 }, // 14 eeprom -}; - -STD_ROM_PICK(metamrphe) -STD_ROM_FN(metamrphe) - -struct BurnDriver BurnDrvMetamrphe = { - "metamrphe", "metamrph", NULL, NULL, "1993", - "Metamorphic Force (ver EAA - alternate)\0", NULL, "Konami", "GX224", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, metamrpheRomInfo, metamrpheRomName, NULL, NULL, MetamrphInputInfo, MetamrphDIPInfo, - MetamrphInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Metamorphic Force (ver AAA) - -static struct BurnRomInfo metamrphaRomDesc[] = { - { "224aaa01.15h", 0x040000, 0x12515518, 1 }, // 0 maincpu - { "224aaa02.15f", 0x040000, 0x04ed41df, 1 }, // 1 - { "224a03", 0x080000, 0xa5bedb01, 1 }, // 2 - { "224a04", 0x080000, 0xada53ba4, 1 }, // 3 - - { "224a05", 0x040000, 0x4b4c985c, 2 }, // 4 soundcpu - - { "224a09", 0x100000, 0x1931afce, 3 }, // 5 gfx1 - { "224a08", 0x100000, 0xdc94d53a, 3 }, // 6 - - { "224a10", 0x200000, 0x161287f0, 4 }, // 7 gfx2 - { "224a11", 0x200000, 0xdf5960e1, 4 }, // 8 - { "224a12", 0x200000, 0xca72a4b3, 4 }, // 9 - { "224a13", 0x200000, 0x86b58feb, 4 }, // 10 - - { "224a14", 0x040000, 0x3c79b404, 5 }, // 11 k053250_1 - - { "224a06", 0x200000, 0x972f6abe, 6 }, // 12 shared - { "224a07", 0x100000, 0x61b2f97a, 6 }, // 13 - - // default eeprom to prevent game booting upside down with error - { "metamrpha.nv", 0x000080, 0x6d34a4f2, 7 }, // 14 eeprom -}; - -STD_ROM_PICK(metamrpha) -STD_ROM_FN(metamrpha) - -struct BurnDriver BurnDrvMetamrpha = { - "metamrpha", "metamrph", NULL, NULL, "1993", - "Metamorphic Force (ver AAA)\0", NULL, "Konami", "GX224", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, metamrphaRomInfo, metamrphaRomName, NULL, NULL, MetamrphInputInfo, MetamrphDIPInfo, - MetamrphInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Metamorphic Force (ver UAA) - -static struct BurnRomInfo metamrphuRomDesc[] = { - { "224uaa01.15h", 0x040000, 0xe1d9b516, 1 }, // 0 maincpu - { "224uaa02.15f", 0x040000, 0x289c926b, 1 }, // 1 - { "224a03", 0x080000, 0xa5bedb01, 1 }, // 2 - { "224a04", 0x080000, 0xada53ba4, 1 }, // 3 - - { "224a05", 0x040000, 0x4b4c985c, 2 }, // 4 soundcpu - - { "224a09", 0x100000, 0x1931afce, 3 }, // 5 gfx1 - { "224a08", 0x100000, 0xdc94d53a, 3 }, // 6 - - { "224a10", 0x200000, 0x161287f0, 4 }, // 7 gfx2 - { "224a11", 0x200000, 0xdf5960e1, 4 }, // 8 - { "224a12", 0x200000, 0xca72a4b3, 4 }, // 9 - { "224a13", 0x200000, 0x86b58feb, 4 }, // 10 - - { "224a14", 0x040000, 0x3c79b404, 5 }, // 11 k053250_1 - - { "224a06", 0x200000, 0x972f6abe, 6 }, // 12 shared - { "224a07", 0x100000, 0x61b2f97a, 6 }, // 13 - - { "metamrphu.nv", 0x000080, 0x1af2f855, 7 }, // 14 eeprom -}; - -STD_ROM_PICK(metamrphu) -STD_ROM_FN(metamrphu) - -struct BurnDriver BurnDrvMetamrphu = { - "metamrphu", "metamrph", NULL, NULL, "1993", - "Metamorphic Force (ver UAA)\0", NULL, "Konami", "GX224", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, metamrphuRomInfo, metamrphuRomName, NULL, NULL, MetamrphInputInfo, MetamrphDIPInfo, - MetamrphInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Metamorphic Force (ver JAA) - -static struct BurnRomInfo metamrphjRomDesc[] = { - { "224jaa01.15h", 0x040000, 0x558d2602, 1 }, // 0 maincpu - { "224jaa02.15f", 0x040000, 0x9b252ace, 1 }, // 1 - { "224a03", 0x080000, 0xa5bedb01, 1 }, // 2 - { "224a04", 0x080000, 0xada53ba4, 1 }, // 3 - - { "224a05", 0x040000, 0x4b4c985c, 2 }, // 4 soundcpu - - { "224a09", 0x100000, 0x1931afce, 3 }, // 5 gfx1 - { "224a08", 0x100000, 0xdc94d53a, 3 }, // 6 - - { "224a10", 0x200000, 0x161287f0, 4 }, // 7 gfx2 - { "224a11", 0x200000, 0xdf5960e1, 4 }, // 8 - { "224a12", 0x200000, 0xca72a4b3, 4 }, // 9 - { "224a13", 0x200000, 0x86b58feb, 4 }, // 10 - - { "224a14", 0x040000, 0x3c79b404, 5 }, // 11 k053250_1 - - { "224a06", 0x200000, 0x972f6abe, 6 }, // 12 shared - { "224a07", 0x100000, 0x61b2f97a, 6 }, // 13 - - { "metamrphj.nv", 0x000080, 0x30497478, 7 }, // 14 eeprom -}; - -STD_ROM_PICK(metamrphj) -STD_ROM_FN(metamrphj) - -struct BurnDriver BurnDrvMetamrphj = { - "metamrphj", "metamrph", NULL, NULL, "1993", - "Metamorphic Force (ver JAA)\0", NULL, "Konami", "GX224", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, metamrphjRomInfo, metamrphjRomName, NULL, NULL, MetamrphInputInfo, MetamrphDIPInfo, - MetamrphInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x0800, - 288, 224, 4, 3 -}; - - -// Martial Champion (ver EAB) - -static struct BurnRomInfo mtlchampRomDesc[] = { - { "234eab01.20f", 0x040000, 0x7c4d1e50, 1 }, // 0 maincpu - { "234eab02.20g", 0x040000, 0xd8bc85c9, 1 }, // 1 - { "234_d03.19f", 0x080000, 0xabb577c6, 1 }, // 2 - { "234_d04.19g", 0x080000, 0x030a1925, 1 }, // 3 - - { "234_d05.6b", 0x020000, 0xefb6bcaa, 2 }, // 4 soundcpu - - { "234a08.1h", 0x100000, 0x27e94288, 3 }, // 5 gfx1 - { "234a09.1k", 0x100000, 0x03aad28f, 3 }, // 6 - { "234a10.3h", 0x080000, 0x51f50fe2, 3 }, // 7 - - { "234a16.22k", 0x200000, 0x14d909a5, 4 }, // 8 gfx2 - { "234a15.20k", 0x200000, 0xa5028418, 4 }, // 9 - { "234a14.19k", 0x200000, 0xd7921f47, 4 }, // 10 - { "234a13.17k", 0x200000, 0x5974392e, 4 }, // 11 - { "234a12.12k", 0x100000, 0xc7f2b099, 4 }, // 12 - { "234a11.10k", 0x100000, 0x82923713, 4 }, // 13 - - { "234a06.2d", 0x200000, 0x12d32384, 5 }, // 14 shared - { "234a07.1d", 0x200000, 0x05ee239f, 5 }, // 15 - - { "mtlchamp.nv", 0x000080, 0xcd47858e, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mtlchamp) -STD_ROM_FN(mtlchamp) - -struct BurnDriver BurnDrvMtlchamp = { - "mtlchamp", NULL, NULL, NULL, "1993", - "Martial Champion (ver EAB)\0", "Missing Graphics on Intro/Title screens", "Konami", "GX234", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, mtlchampRomInfo, mtlchampRomName, NULL, NULL, MartchmpInputInfo, MartchmpDIPInfo, - MartchmpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Martial Champion (ver EAA) - -static struct BurnRomInfo mtlchamp1RomDesc[] = { - { "234eaa01.20f", 0x040000, 0x8fa731db, 1 }, // 0 maincpu - { "234eaa02.20g", 0x040000, 0xe7b50b54, 1 }, // 1 - { "234_d03.19f", 0x080000, 0xabb577c6, 1 }, // 2 - { "234_d04.19g", 0x080000, 0x030a1925, 1 }, // 3 - - { "234_d05.6b", 0x020000, 0xefb6bcaa, 2 }, // 4 soundcpu - - { "234a08.1h", 0x100000, 0x27e94288, 3 }, // 5 gfx1 - { "234a09.1k", 0x100000, 0x03aad28f, 3 }, // 6 - { "234a10.3h", 0x080000, 0x51f50fe2, 3 }, // 7 - - { "234a16.22k", 0x200000, 0x14d909a5, 4 }, // 8 gfx2 - { "234a15.20k", 0x200000, 0xa5028418, 4 }, // 9 - { "234a14.19k", 0x200000, 0xd7921f47, 4 }, // 10 - { "234a13.17k", 0x200000, 0x5974392e, 4 }, // 11 - { "234a12.12k", 0x100000, 0xc7f2b099, 4 }, // 12 - { "234a11.10k", 0x100000, 0x82923713, 4 }, // 13 - - { "234a06.2d", 0x200000, 0x12d32384, 5 }, // 14 shared - { "234a07.1d", 0x200000, 0x05ee239f, 5 }, // 15 - - { "mtlchamp1.nv", 0x000080, 0x202f6968, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mtlchamp1) -STD_ROM_FN(mtlchamp1) - -struct BurnDriver BurnDrvMtlchamp1 = { - "mtlchamp1", "mtlchamp", NULL, NULL, "1993", - "Martial Champion (ver EAA)\0", "Missing Graphics on Intro/Title screens", "Konami", "GX234", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, mtlchamp1RomInfo, mtlchamp1RomName, NULL, NULL, MartchmpInputInfo, MartchmpDIPInfo, - MartchmpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Martial Champion (ver AAA) - -static struct BurnRomInfo mtlchampaRomDesc[] = { - { "234aaa01.20f", 0x040000, 0x32c70e65, 1 }, // 0 maincpu - { "234aaa02.20g", 0x040000, 0x2f666d52, 1 }, // 1 - { "234_d03.19f", 0x080000, 0xabb577c6, 1 }, // 2 - { "234_d04.19g", 0x080000, 0x030a1925, 1 }, // 3 - - { "234_d05.6b", 0x020000, 0xefb6bcaa, 2 }, // 4 soundcpu - - { "234a08.1h", 0x100000, 0x27e94288, 3 }, // 5 gfx1 - { "234a09.1k", 0x100000, 0x03aad28f, 3 }, // 6 - { "234a10.3h", 0x080000, 0x51f50fe2, 3 }, // 7 - - { "234a16.22k", 0x200000, 0x14d909a5, 4 }, // 8 gfx2 - { "234a15.20k", 0x200000, 0xa5028418, 4 }, // 9 - { "234a14.19k", 0x200000, 0xd7921f47, 4 }, // 10 - { "234a13.17k", 0x200000, 0x5974392e, 4 }, // 11 - { "234a12.12k", 0x100000, 0xc7f2b099, 4 }, // 12 - { "234a11.10k", 0x100000, 0x82923713, 4 }, // 13 - - { "234a06.2d", 0x200000, 0x12d32384, 5 }, // 14 shared - { "234a07.1d", 0x200000, 0x05ee239f, 5 }, // 15 - - { "mtlchampa.nv", 0x000080, 0x79a6f420, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mtlchampa) -STD_ROM_FN(mtlchampa) - -struct BurnDriver BurnDrvMtlchampa = { - "mtlchampa", "mtlchamp", NULL, NULL, "1993", - "Martial Champion (ver AAA)\0", "Missing Graphics on Intro/Title screens", "Konami", "GX234", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, mtlchampaRomInfo, mtlchampaRomName, NULL, NULL, MartchmpInputInfo, MartchmpDIPInfo, - MartchmpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Martial Champion (ver JAA) - -static struct BurnRomInfo mtlchampjRomDesc[] = { - { "234jaa01.20f", 0x040000, 0x76c3c568, 1 }, // 0 maincpu - { "234jaa02.20g", 0x040000, 0x95eec0aa, 1 }, // 1 - { "234_d03.19f", 0x080000, 0xabb577c6, 1 }, // 2 - { "234_d04.19g", 0x080000, 0x030a1925, 1 }, // 3 - - { "234_d05.6b", 0x020000, 0xefb6bcaa, 2 }, // 4 soundcpu - - { "234a08.1h", 0x100000, 0x27e94288, 3 }, // 5 gfx1 - { "234a09.1k", 0x100000, 0x03aad28f, 3 }, // 6 - { "234a10.3h", 0x080000, 0x51f50fe2, 3 }, // 7 - - { "234a16.22k", 0x200000, 0x14d909a5, 4 }, // 8 gfx2 - { "234a15.20k", 0x200000, 0xa5028418, 4 }, // 9 - { "234a14.19k", 0x200000, 0xd7921f47, 4 }, // 10 - { "234a13.17k", 0x200000, 0x5974392e, 4 }, // 11 - { "234a12.12k", 0x100000, 0xc7f2b099, 4 }, // 12 - { "234a11.10k", 0x100000, 0x82923713, 4 }, // 13 - - { "234a06.2d", 0x200000, 0x12d32384, 5 }, // 14 shared - { "234a07.1d", 0x200000, 0x05ee239f, 5 }, // 15 - - { "mtlchampj.nv", 0x000080, 0xe311816f, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mtlchampj) -STD_ROM_FN(mtlchampj) - -struct BurnDriver BurnDrvMtlchampj = { - "mtlchampj", "mtlchamp", NULL, NULL, "1993", - "Martial Champion (ver JAA)\0", "Missing Graphics on Intro/Title screens", "Konami", "GX234", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, mtlchampjRomInfo, mtlchampjRomName, NULL, NULL, MartchmpInputInfo, MartchmpDIPInfo, - MartchmpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Martial Champion (ver UAE) - -static struct BurnRomInfo mtlchampuRomDesc[] = { - { "234uae01.20f", 0x040000, 0xacecfec9, 1 }, // 0 maincpu - { "234uae02.20g", 0x040000, 0xc54ccf65, 1 }, // 1 - { "234_d03.19f", 0x080000, 0xabb577c6, 1 }, // 2 - { "234_d04.19g", 0x080000, 0x030a1925, 1 }, // 3 - - { "234_d05.6b", 0x020000, 0xefb6bcaa, 2 }, // 4 soundcpu - - { "234a08.1h", 0x100000, 0x27e94288, 3 }, // 5 gfx1 - { "234a09.1k", 0x100000, 0x03aad28f, 3 }, // 6 - { "234a10.3h", 0x080000, 0x51f50fe2, 3 }, // 7 - - { "234a16.22k", 0x200000, 0x14d909a5, 4 }, // 8 gfx2 - { "234a15.20k", 0x200000, 0xa5028418, 4 }, // 9 - { "234a14.19k", 0x200000, 0xd7921f47, 4 }, // 10 - { "234a13.17k", 0x200000, 0x5974392e, 4 }, // 11 - { "234a12.12k", 0x100000, 0xc7f2b099, 4 }, // 12 - { "234a11.10k", 0x100000, 0x82923713, 4 }, // 13 - - { "234a06.2d", 0x200000, 0x12d32384, 5 }, // 14 shared - { "234a07.1d", 0x200000, 0x05ee239f, 5 }, // 15 - - { "mtlchampu.nv", 0x000080, 0x182f146a, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mtlchampu) -STD_ROM_FN(mtlchampu) - -struct BurnDriver BurnDrvMtlchampu = { - "mtlchampu", "mtlchamp", NULL, NULL, "1993", - "Martial Champion (ver UAE)\0", "Missing Graphics on Intro/Title screens", "Konami", "GX234", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, mtlchampuRomInfo, mtlchampuRomName, NULL, NULL, MartchmpInputInfo, MartchmpDIPInfo, - MartchmpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Martial Champion (ver UAD) - -static struct BurnRomInfo mtlchampu1RomDesc[] = { - { "234uad01.20f", 0x040000, 0x5f6c8d09, 1 }, // 0 maincpu - { "234uad02.20g", 0x040000, 0x15ca4fb2, 1 }, // 1 - { "234_d03.19f", 0x080000, 0xabb577c6, 1 }, // 2 - { "234_d04.19g", 0x080000, 0x030a1925, 1 }, // 3 - - { "234_d05.6b", 0x020000, 0xefb6bcaa, 2 }, // 4 soundcpu - - { "234a08.1h", 0x100000, 0x27e94288, 3 }, // 5 gfx1 - { "234a09.1k", 0x100000, 0x03aad28f, 3 }, // 6 - { "234a10.3h", 0x080000, 0x51f50fe2, 3 }, // 7 - - { "234a16.22k", 0x200000, 0x14d909a5, 4 }, // 8 gfx2 - { "234a15.20k", 0x200000, 0xa5028418, 4 }, // 9 - { "234a14.19k", 0x200000, 0xd7921f47, 4 }, // 10 - { "234a13.17k", 0x200000, 0x5974392e, 4 }, // 11 - { "234a12.12k", 0x100000, 0xc7f2b099, 4 }, // 12 - { "234a11.10k", 0x100000, 0x82923713, 4 }, // 13 - - { "234a06.2d", 0x200000, 0x12d32384, 5 }, // 14 shared - { "234a07.1d", 0x200000, 0x05ee239f, 5 }, // 15 - - { "mtlchampu1.nv", 0x000080, 0xf5d84df7, 6 }, // 16 eeprom -}; - -STD_ROM_PICK(mtlchampu1) -STD_ROM_FN(mtlchampu1) - -struct BurnDriver BurnDrvMtlchampu1 = { - "mtlchampu1", "mtlchamp", NULL, NULL, "1993", - "Martial Champion (ver UAD)\0", "Missing Graphics on Intro/Title screens", "Konami", "GX234", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, mtlchampu1RomInfo, mtlchampu1RomName, NULL, NULL, MartchmpInputInfo, MartchmpDIPInfo, - MartchmpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Gaiapolis (ver EAF) - -static struct BurnRomInfo gaiapolsRomDesc[] = { - { "123e07.24m", 0x100000, 0xf1a1db0f, 1 }, // 0 maincpu - { "123e09.19l", 0x100000, 0x4b3b57e7, 1 }, // 1 - { "123eaf11.19p", 0x040000, 0x9c324ade, 1 }, // 2 - { "123eaf12.17p", 0x040000, 0x1dfa14c5, 1 }, // 3 - - { "123e13.9c", 0x040000, 0xe772f822, 2 }, // 4 soundcpu - - { "123e16.2t", 0x100000, 0xa3238200, 3 }, // 5 gfx1 - { "123e17.2x", 0x100000, 0xbd0b9fb9, 3 }, // 6 - - { "123e19.34u", 0x200000, 0x219a7c26, 4 }, // 7 gfx2 - { "123e21.34y", 0x200000, 0x1888947b, 4 }, // 8 - { "123e18.36u", 0x200000, 0x3719b6d4, 4 }, // 9 - { "123e20.36y", 0x200000, 0x490a6f64, 4 }, // 10 - - { "123e04.32n", 0x080000, 0x0d4d5b8b, 5 }, // 11 gfx3 - { "123e05.29n", 0x080000, 0x7d123f3e, 5 }, // 12 - { "123e06.26n", 0x080000, 0xfa50121e, 5 }, // 13 - - { "123e01.36j", 0x020000, 0x9dbc9678, 6 }, // 14 gfx4 - { "123e02.34j", 0x040000, 0xb8e3f500, 6 }, // 15 - { "123e03.36m", 0x040000, 0xfde4749f, 6 }, // 16 - - { "123e14.2g", 0x200000, 0x65dfd3ff, 7 }, // 17 shared - { "123e15.2m", 0x200000, 0x7017ff07, 7 }, // 18 - - { "gaiapols.nv", 0x000080, 0x44c78184, 8 }, // 19 eeprom -}; - -STD_ROM_PICK(gaiapols) -STD_ROM_FN(gaiapols) - -struct BurnDriver BurnDrvGaiapols = { - "gaiapols", NULL, NULL, NULL, "1993", - "Gaiapolis (ver EAF)\0", NULL, "Konami", "GX123", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, gaiapolsRomInfo, gaiapolsRomName, NULL, NULL, DadandrnInputInfo, DadandrnDIPInfo, - GaiapolisInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 376, 3, 4 -}; - - -// Gaiapolis (ver UAF) - -static struct BurnRomInfo gaiapolsuRomDesc[] = { - { "123e07.24m", 0x100000, 0xf1a1db0f, 1 }, // 0 maincpu - { "123e09.19l", 0x100000, 0x4b3b57e7, 1 }, // 1 - { "123uaf11.19p", 0x040000, 0x39dc1298, 1 }, // 2 - { "123uaf12.17p", 0x040000, 0xc633cf52, 1 }, // 3 - - { "123e13.9c", 0x040000, 0xe772f822, 2 }, // 4 soundcpu - - { "123e16.2t", 0x100000, 0xa3238200, 3 }, // 5 gfx1 - { "123e17.2x", 0x100000, 0xbd0b9fb9, 3 }, // 6 - - { "123e19.34u", 0x200000, 0x219a7c26, 4 }, // 7 gfx2 - { "123e21.34y", 0x200000, 0x1888947b, 4 }, // 8 - { "123e18.36u", 0x200000, 0x3719b6d4, 4 }, // 9 - { "123e20.36y", 0x200000, 0x490a6f64, 4 }, // 10 - - { "123e04.32n", 0x080000, 0x0d4d5b8b, 5 }, // 11 gfx3 - { "123e05.29n", 0x080000, 0x7d123f3e, 5 }, // 12 - { "123e06.26n", 0x080000, 0xfa50121e, 5 }, // 13 - - { "123e01.36j", 0x020000, 0x9dbc9678, 6 }, // 14 gfx4 - { "123e02.34j", 0x040000, 0xb8e3f500, 6 }, // 15 - { "123e03.36m", 0x040000, 0xfde4749f, 6 }, // 16 - - { "123e14.2g", 0x200000, 0x65dfd3ff, 7 }, // 17 shared - { "123e15.2m", 0x200000, 0x7017ff07, 7 }, // 18 - - { "gaiapolsu.nv", 0x000080, 0x7ece27b6, 8 }, // 19 eeprom -}; - -STD_ROM_PICK(gaiapolsu) -STD_ROM_FN(gaiapolsu) - -struct BurnDriver BurnDrvGaiapolsu = { - "gaiapolsu", "gaiapols", NULL, NULL, "1993", - "Gaiapolis (ver UAF)\0", NULL, "Konami", "GX123", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, gaiapolsuRomInfo, gaiapolsuRomName, NULL, NULL, DadandrnInputInfo, DadandrnDIPInfo, - GaiapolisInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 376, 3, 4 -}; - - -// Gaiapolis (ver JAF) - -static struct BurnRomInfo gaiapolsjRomDesc[] = { - { "123e07.24m", 0x100000, 0xf1a1db0f, 1 }, // 0 maincpu - { "123e09.19l", 0x100000, 0x4b3b57e7, 1 }, // 1 - { "123jaf11.19p", 0x040000, 0x19919571, 1 }, // 2 - { "123jaf12.17p", 0x040000, 0x4246e595, 1 }, // 3 - - { "123e13.9c", 0x040000, 0xe772f822, 2 }, // 4 soundcpu - - { "123e16.2t", 0x100000, 0xa3238200, 3 }, // 5 gfx1 - { "123e17.2x", 0x100000, 0xbd0b9fb9, 3 }, // 6 - - { "123e19.34u", 0x200000, 0x219a7c26, 4 }, // 7 gfx2 - { "123e21.34y", 0x200000, 0x1888947b, 4 }, // 8 - { "123e18.36u", 0x200000, 0x3719b6d4, 4 }, // 9 - { "123e20.36y", 0x200000, 0x490a6f64, 4 }, // 10 - - { "123e04.32n", 0x080000, 0x0d4d5b8b, 5 }, // 11 gfx3 - { "123e05.29n", 0x080000, 0x7d123f3e, 5 }, // 12 - { "123e06.26n", 0x080000, 0xfa50121e, 5 }, // 13 - - { "123e01.36j", 0x020000, 0x9dbc9678, 6 }, // 14 gfx4 - { "123e02.34j", 0x040000, 0xb8e3f500, 6 }, // 15 - { "123e03.36m", 0x040000, 0xfde4749f, 6 }, // 16 - - { "123e14.2g", 0x200000, 0x65dfd3ff, 7 }, // 17 shared - { "123e15.2m", 0x200000, 0x7017ff07, 7 }, // 18 - - { "gaiapolsj.nv", 0x000080, 0xc4b970df, 8 }, // 19 eeprom -}; - -STD_ROM_PICK(gaiapolsj) -STD_ROM_FN(gaiapolsj) - -struct BurnDriver BurnDrvGaiapolsj = { - "gaiapolsj", "gaiapols", NULL, NULL, "1993", - "Gaiapolis (ver JAF)\0", NULL, "Konami", "GX123", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, gaiapolsjRomInfo, gaiapolsjRomName, NULL, NULL, DadandrnInputInfo, DadandrnDIPInfo, - GaiapolisInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 376, 3, 4 -}; - - -// Monster Maulers (ver EAA) - -static struct BurnRomInfo mmaulersRomDesc[] = { - { "170eaa07.24m", 0x080000, 0x5458bd93, 1 }, // 0 maincpu - { "170eaa09.19l", 0x080000, 0x99c95c7b, 1 }, // 1 - { "170a08.21m", 0x040000, 0x03c59ba2, 1 }, // 2 - { "170a10.17l", 0x040000, 0x8a340909, 1 }, // 3 - - { "170a13.9c", 0x040000, 0x2ebf4d1c, 2 }, // 4 soundcpu - - { "170a16.2t", 0x100000, 0x41fee912, 3 }, // 5 gfx1 - { "170a17.2x", 0x100000, 0x96957c91, 3 }, // 6 - { "170a24.5r", 0x080000, 0x562ad4bd, 3 }, // 7 - - { "170a19.34u", 0x200000, 0xbe835141, 4 }, // 8 gfx2 - { "170a21.34y", 0x200000, 0xbcb68136, 4 }, // 9 - { "170a18.36u", 0x200000, 0xe1e3c8d2, 4 }, // 10 - { "170a20.36y", 0x200000, 0xccb4d88c, 4 }, // 11 - { "170a23.29y", 0x100000, 0x6b5390e4, 4 }, // 12 - { "170a22.32y", 0x100000, 0x21628106, 4 }, // 13 - - { "170a04.33n", 0x080000, 0x64b9a73b, 5 }, // 14 gfx3 - { "170a05.30n", 0x080000, 0xf2c101d0, 5 }, // 15 - { "170a06.27n", 0x080000, 0xb032e59b, 5 }, // 16 - - { "170a02.34j", 0x040000, 0xb040cebf, 6 }, // 17 gfx4 - { "170a03.36m", 0x040000, 0x7fb412b2, 6 }, // 18 - - { "170a14.2g", 0x200000, 0x83317cda, 7 }, // 19 shared - { "170a15.2m", 0x200000, 0xd4113ae9, 7 }, // 20 - - { "mmaulers.nv", 0x000080, 0x8324f517, 8 }, // 21 eeprom -}; - -STD_ROM_PICK(mmaulers) -STD_ROM_FN(mmaulers) - -struct BurnDriver BurnDrvMmaulers = { - "mmaulers", NULL, NULL, NULL, "1993", - "Monster Maulers (ver EAA)\0", NULL, "Konami", "GX170", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, mmaulersRomInfo, mmaulersRomName, NULL, NULL, DadandrnInputInfo, DadandrnDIPInfo, - DadandrnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Kyukyoku Sentai Dadandarn (ver JAA) - -static struct BurnRomInfo dadandrnRomDesc[] = { - { "170jaa07.24m", 0x080000, 0x6a55e828, 1 }, // 0 maincpu - { "170jaa09.19l", 0x080000, 0x9e821cd8, 1 }, // 1 - { "170a08.21m", 0x040000, 0x03c59ba2, 1 }, // 2 - { "170a10.17l", 0x040000, 0x8a340909, 1 }, // 3 - - { "170a13.9c", 0x040000, 0x2ebf4d1c, 2 }, // 4 soundcpu - - { "170a16.2t", 0x100000, 0x41fee912, 3 }, // 5 gfx1 - { "170a17.2x", 0x100000, 0x96957c91, 3 }, // 6 - { "170a24.5r", 0x080000, 0x562ad4bd, 3 }, // 7 - - { "170a19.34u", 0x200000, 0xbe835141, 4 }, // 8 gfx2 - { "170a21.34y", 0x200000, 0xbcb68136, 4 }, // 9 - { "170a18.36u", 0x200000, 0xe1e3c8d2, 4 }, // 10 - { "170a20.36y", 0x200000, 0xccb4d88c, 4 }, // 11 - { "170a23.29y", 0x100000, 0x6b5390e4, 4 }, // 12 - { "170a22.32y", 0x100000, 0x21628106, 4 }, // 13 - - { "170a04.33n", 0x080000, 0x64b9a73b, 5 }, // 14 gfx3 - { "170a05.30n", 0x080000, 0xf2c101d0, 5 }, // 15 - { "170a06.27n", 0x080000, 0xb032e59b, 5 }, // 16 - - { "170a02.34j", 0x040000, 0xb040cebf, 6 }, // 17 gfx4 - { "170a03.36m", 0x040000, 0x7fb412b2, 6 }, // 18 - - { "170a14.2g", 0x200000, 0x83317cda, 7 }, // 19 shared - { "170a15.2m", 0x200000, 0xd4113ae9, 7 }, // 20 - - { "dadandrn.nv", 0x000080, 0x346ae0cf, 8 }, // 21 eeprom -}; - -STD_ROM_PICK(dadandrn) -STD_ROM_FN(dadandrn) - -struct BurnDriver BurnDrvDadandrn = { - "dadandrn", "mmaulers", NULL, NULL, "1993", - "Kyukyoku Sentai Dadandarn (ver JAA)\0", NULL, "Konami", "GX170", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, dadandrnRomInfo, dadandrnRomName, NULL, NULL, DadandrnInputInfo, DadandrnDIPInfo, - DadandrnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_nemesis.cpp b/jan/src/burn/drv/konami/d_nemesis.cpp deleted file mode 100644 index 51fafc29f..000000000 --- a/jan/src/burn/drv/konami/d_nemesis.cpp +++ /dev/null @@ -1,4213 +0,0 @@ -// FB Alpha Nemesis driver module -// Based on MAME driver by Bryan McPhail w/additions by Hau, hap, and likely othes - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "k051649.h" -#include "k007232.h" -#include "k005289.h" -#include "vlm5030.h" -#include "burn_ym2151.h" -#include "flt_rc.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "burn_shift.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *K005289ROM; -static UINT8 *DrvVLMROM; -static UINT8 *K007232ROM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *Drv68KRAM2; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvColRAM0; -static UINT8 *DrvColRAM1; -static UINT8 *DrvCharRAM; -static UINT8 *DrvCharRAMExp; -static UINT8 *DrvScrollRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvZ80RAM; - -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *m68k_irq_enable; -static UINT8 *m68k_irq_enable2; -static UINT8 *m68k_irq_enable4; -static UINT8 *tilemap_flip_x; -static UINT8 *tilemap_flip_y; - -static UINT16 *xscroll1; -static UINT16 *yscroll1; -static UINT16 *xscroll2; -static UINT16 *yscroll2; - -static UINT8 selected_ip; - -static INT32 watchdog; -static void (*palette_write)(INT32) = NULL; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvDips[4]; -static UINT8 DrvReset; -static UINT16 DrvInputs[4]; -static INT32 DrvAnalogPort0 = 0; -static INT16 DrvDial1; - -static INT32 ay8910_enable = 0; -static INT32 ym2151_enable = 0; -static INT32 ym3812_enable = 0; -static INT32 k005289_enable = 0; -static INT32 k007232_enable = 0; -static INT32 k051649_enable = 0; -static INT32 vlm5030_enable = 0; -static INT32 rcflt_enable = 0; -static INT32 hcrash_mode = 0; -static INT32 gearboxmode = 0; -static INT32 bUseShifter = 0; - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo NemesisInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Nemesis) - -static struct BurnInputInfo SalamandInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Salamand) - -static struct BurnInputInfo TwinbeeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right"} , - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Twinbee) - -static struct BurnInputInfo GradiusInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Gradius) - -static struct BurnInputInfo GwarriorInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Gwarrior) - -static struct BurnInputInfo NyanpaniInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Nyanpani) - -static struct BurnInputInfo BlkpnthrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Blkpnthr) - -static struct BurnInputInfo CitybombInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Citybomb) - -static struct BurnInputInfo KonamigtInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"Accelerator", BIT_DIGITAL, DrvJoy4 + 6, "p1 fire 1" }, - {"Brake", BIT_DIGITAL, DrvJoy4 + 5, "p1 fire 2" }, - {"Gear Shift", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 3" }, - - A("Wheel" , BIT_ANALOG_REL, &DrvAnalogPort0 , "mouse x-axis"), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Konamigt) - -static struct BurnInputInfo HcrashInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"Accelerator", BIT_DIGITAL, DrvJoy4 + 6, "p1 fire 1" }, - {"Brake", BIT_DIGITAL, DrvJoy4 + 5, "p1 fire 2" }, - {"Jump", BIT_DIGITAL, DrvJoy4 + 4, "p1 fire 3" }, - - A("Wheel" , BIT_ANALOG_REL, &DrvAnalogPort0 , "mouse x-axis"), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Hcrash) - -static struct BurnDIPInfo NemesisDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x5b, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x04, 0x00, "Upright" }, - {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "50k and every 100k" }, - {0x15, 0x01, 0x18, 0x10, "30k" }, - {0x15, 0x01, 0x18, 0x08, "50k" }, - {0x15, 0x01, 0x18, 0x00, "100k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x01, 0x01, "Off" }, -// {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0, 0xfe, 0, 3, "Color Settings" }, - {0x17, 0x01, 0x03, 0x00, "Proper Colors (Dark)" }, - {0x17, 0x01, 0x03, 0x01, "Light Colors" }, - {0x17, 0x01, 0x03, 0x02, "MAMEUIFx Colors (Mid)"}, -}; - -STDDIPINFO(Nemesis) - -static struct BurnDIPInfo SalamandDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x42, NULL }, - {0x14, 0xff, 0xff, 0x0e, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Disabled" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Coin Slot(s)" }, - {0x13, 0x01, 0x04, 0x04, "1" }, - {0x13, 0x01, 0x04, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Max Credit(s)" }, - {0x13, 0x01, 0x18, 0x18, "1" }, - {0x13, 0x01, 0x18, 0x10, "3" }, - {0x13, 0x01, 0x18, 0x08, "5" }, - {0x13, 0x01, 0x18, 0x00, "9" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x02, 0x02, "Off" }, -// {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x80, 0x00, "Upright" }, - {0x14, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Salamand) - -static struct BurnDIPInfo LifefrcjDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x42, NULL }, - {0x14, 0xff, 0xff, 0x0e, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Disabled" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Coin Slot(s)" }, - {0x13, 0x01, 0x04, 0x04, "1" }, - {0x13, 0x01, 0x04, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Max Credit(s)" }, - {0x13, 0x01, 0x18, 0x18, "1" }, - {0x13, 0x01, 0x18, 0x10, "3" }, - {0x13, 0x01, 0x18, 0x08, "5" }, - {0x13, 0x01, 0x18, 0x00, "9" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x02, 0x02, "Off" }, -// {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x80, 0x00, "Upright" }, - {0x14, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Lifefrcj) - -static struct BurnDIPInfo TwinbeeDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x56, NULL }, - {0x14, 0xff, 0xff, 0xfd, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "20k 100k" }, - {0x13, 0x01, 0x18, 0x10, "30k 120k" }, - {0x13, 0x01, 0x18, 0x08, "40k 140k" }, - {0x13, 0x01, 0x18, 0x00, "50k 160k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x01, 0x01, "Off" }, -// {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Players" }, - {0x14, 0x01, 0x02, 0x02, "1" }, - {0x14, 0x01, 0x02, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0, 0xfe, 0, 3, "Color Settings" }, - {0x15, 0x01, 0x03, 0x00, "Proper Colors (Dark)" }, - {0x15, 0x01, 0x03, 0x01, "Light Colors" }, - {0x15, 0x01, 0x03, 0x02, "MAMEUIFx Colors (Mid)"}, -}; - -STDDIPINFO(Twinbee) - -static struct BurnDIPInfo GradiusDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x53, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x04, 0x00, "Upright" }, - {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "20k and every 70k" }, - {0x15, 0x01, 0x18, 0x10, "30k and every 80k" }, - {0x15, 0x01, 0x18, 0x08, "20k only" }, - {0x15, 0x01, 0x18, 0x00, "30k only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x01, 0x01, "Off" }, -// {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0, 0xfe, 0, 3, "Color Settings" }, - {0x17, 0x01, 0x03, 0x00, "Proper Colors (Dark)" }, - {0x17, 0x01, 0x03, 0x01, "Light Colors" }, - {0x17, 0x01, 0x03, 0x02, "MAMEUIFx Colors (Mid)"}, -}; - -STDDIPINFO(Gradius) - -static struct BurnDIPInfo GwarriorDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x5d, NULL }, - {0x16, 0xff, 0xff, 0xfd, NULL }, - {0x17, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "No Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "1" }, - {0x15, 0x01, 0x03, 0x02, "2" }, - {0x15, 0x01, 0x03, 0x01, "3" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "30k 100k 200k 400k" }, - {0x15, 0x01, 0x18, 0x10, "40k 120k 240k 480k" }, - {0x15, 0x01, 0x18, 0x08, "50k 150k 300k 600k" }, - {0x15, 0x01, 0x18, 0x00, "100k 200k 400k 800k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x01, 0x01, "Off" }, -// {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Players" }, - {0x16, 0x01, 0x02, 0x02, "1" }, - {0x16, 0x01, 0x02, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0, 0xfe, 0, 3, "Color Settings" }, - {0x17, 0x01, 0x03, 0x00, "Proper Colors (Dark)" }, - {0x17, 0x01, 0x03, 0x01, "Light Colors" }, - {0x17, 0x01, 0x03, 0x02, "MAMEUIFx Colors (Mid)"}, -}; - -STDDIPINFO(Gwarrior) - -static struct BurnDIPInfo NyanpaniDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x42, NULL }, - {0x16, 0xff, 0xff, 0x8e, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "No Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x02, 0x02, "Off" }, -// {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Nyanpani) - -static struct BurnDIPInfo BlkpnthrDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x53, NULL }, - {0x14, 0xff, 0xff, 0xa8, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "50k 100k" }, - {0x13, 0x01, 0x18, 0x10, "20k 50k" }, - {0x13, 0x01, 0x18, 0x08, "30k 70k" }, - {0x13, 0x01, 0x18, 0x00, "80k 150k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x20, 0x20, "Off" }, -// {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Continue" }, - {0x14, 0x01, 0xc0, 0xc0, "Off" }, - {0x14, 0x01, 0xc0, 0x80, "2 Areas" }, - {0x14, 0x01, 0xc0, 0x40, "3 Areas" }, - {0x14, 0x01, 0xc0, 0x00, "4 Areas" }, -}; - -STDDIPINFO(Blkpnthr) - -static struct BurnDIPInfo CitybombDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x53, NULL }, - {0x16, 0xff, 0xff, 0x8c, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "Invalid" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x15, 0x01, 0x04, 0x00, "Upright" }, -// {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Qualify" }, - {0x15, 0x01, 0x18, 0x18, "Long" }, - {0x15, 0x01, 0x18, 0x10, "Normal" }, - {0x15, 0x01, 0x18, 0x08, "Short" }, - {0x15, 0x01, 0x18, 0x00, "Very Short" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x02, 0x00, "Off" }, -// {0x16, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x04, 0x04, "Single" }, - {0x16, 0x01, 0x04, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Device Type" }, - {0x16, 0x01, 0x80, 0x00, "Handle (broken!)" }, - {0x16, 0x01, 0x80, 0x80, "Joystick" }, -}; - -STDDIPINFO(Citybomb) - -static struct BurnDIPInfo KonamigtDIPList[]= -{ - {0x07, 0xff, 0xff, 0xff, NULL }, - {0x08, 0xff, 0xff, 0x20, NULL }, - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x07, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x07, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x07, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x07, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x07, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x07, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x07, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x07, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x07, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x07, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x07, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x07, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x07, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x07, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x07, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x07, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x07, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x07, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x07, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x07, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x07, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x07, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x07, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x07, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x07, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x07, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x07, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x07, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x07, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x07, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x07, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x07, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x08, 0x01, 0x30, 0x30, "Easy" }, - {0x08, 0x01, 0x30, 0x20, "Normal" }, - {0x08, 0x01, 0x30, 0x10, "Hard" }, - {0x08, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x08, 0x01, 0x80, 0x80, "Off" }, - {0x08, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x09, 0x01, 0x01, 0x01, "Off" }, -// {0x09, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x09, 0x01, 0x04, 0x04, "Off" }, - {0x09, 0x01, 0x04, 0x00, "On" }, - - {0, 0xfe, 0, 3, "Color Settings" }, - {0x0a, 0x01, 0x03, 0x00, "Proper Colors (Dark)" }, - {0x0a, 0x01, 0x03, 0x01, "Light Colors" }, - {0x0a, 0x01, 0x03, 0x02, "MAMEUIFx Colors (Mid)"}, -}; - -STDDIPINFO(Konamigt) - -static struct BurnDIPInfo HcrashDIPList[]= -{ - {0x08, 0xff, 0xff, 0xff, NULL }, - {0x09, 0xff, 0xff, 0x41, NULL }, - {0x0a, 0xff, 0xff, 0x0d, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x08, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x08, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x08, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x08, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x08, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x08, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x08, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x08, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x08, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x08, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x08, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x08, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x08, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x08, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x08, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x08, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x08, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x08, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x08, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x08, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x08, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x08, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x08, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x08, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x08, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x08, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x08, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x08, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x08, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x08, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x08, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x08, 0x01, 0xf0, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 1, "Cabinet" }, - {0x09, 0x01, 0x03, 0x01, "Konami GT with brake" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x09, 0x01, 0x60, 0x60, "Easy" }, - {0x09, 0x01, 0x60, 0x40, "Normal" }, - {0x09, 0x01, 0x60, 0x20, "Hard" }, - {0x09, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x09, 0x01, 0x80, 0x80, "Off" }, - {0x09, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x0a, 0x01, 0x01, 0x01, "Off" }, -// {0x0a, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Quantity of Initials" }, - {0x0a, 0x01, 0x02, 0x00, "3" }, - {0x0a, 0x01, 0x02, 0x02, "7" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Speed Unit" }, - {0x0a, 0x01, 0x08, 0x08, "km/h" }, - {0x0a, 0x01, 0x08, 0x00, "M.P.H." }, -}; - -STDDIPINFO(Hcrash) - -static UINT32 scalerange(UINT32 x, UINT32 in_min, UINT32 in_max, UINT32 out_min, UINT32 out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -static UINT8 konamigt_read_wheel() -{ - UINT8 Temp = 0x7f + (DrvAnalogPort0 >> 4); - UINT8 Temp2 = 0; - - Temp2 = scalerange(Temp, 0x3f, 0xc0, 0x00, 0x7f); // konami gt scalings - //bprintf(0, _T("Port0-temp[%X] scaled[%X]\n"), Temp, Temp2); // debug, do not remove. - return Temp2; -} - -static UINT16 konamigt_read_analog(int /*Offset*/) -{ - UINT16 nRet = 0; - - if (DrvInputs[3] & 0x20) nRet |= 0x0300; // break - if (DrvInputs[3] & 0x40) nRet |= 0xf000; // accel - - nRet |= DrvDial1 & 0x7f; - - return nRet; -} - -static void __fastcall nemesis_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x05c001: - *soundlatch = data; - return; - - case 0x05c801: - watchdog = 0; - return; - - case 0x05e000: - // coin counter - return; - - case 0x05e001: - *m68k_irq_enable = data; - return; - - case 0x05e004: - if (data & 1) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - return; - - case 0x05e005: - *flipscreen = data & 0x01; - *tilemap_flip_x = data & 0x01; - return; - - case 0x05e007: - *tilemap_flip_y = data & 0x01; - return; - } - -// bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static void __fastcall nemesis_main_write_word(UINT32 address, UINT16 data) -{ - if (address && data) return; // kill warnings - -// bprintf (0, _T("WW %5.5x, %4.4x\n"), address, data); -} - -static UINT8 __fastcall nemesis_main_read_byte(UINT32 address) -{ - - switch (address) - { - case 0x05c401: - return DrvDips[0]; - - case 0x05c403: - return DrvDips[1]; - - case 0x05cc01: - return DrvInputs[0]; - - case 0x05cc03: - return DrvInputs[1]; - - case 0x05cc05: - return DrvInputs[2]; - - case 0x05cc07: - return DrvDips[2]; - - case 0x070000: - return konamigt_read_analog(0) >> 8; - - case 0x070001: - return konamigt_read_analog(1) & 0xff; - } - -// bprintf (0, _T("RB %5.5x\n"), address); - - return 0; -} - -static UINT16 __fastcall nemesis_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x070000: - case 0x0c2000: - return konamigt_read_analog(0); - } - -// bprintf (0, _T("RW %5.5x\n"), address); - - return 0; -} - -static void __fastcall konamigt_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x05e001: - *m68k_irq_enable2 = data; - return; - - case 0x05e003: - *m68k_irq_enable = data; - return; - } - - nemesis_main_write_byte(address, data); -} - -static void __fastcall salamand_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x0a0000: - if (data & 0x08) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x0a0001: - { - *m68k_irq_enable = data & 0x01; - *m68k_irq_enable2 = data & 0x02; - *flipscreen = data & 0x04; - *tilemap_flip_x = data & 0x04; - *tilemap_flip_y = data & 0x08; - } - return; - - case 0x0c0001: - *soundlatch = data; - return; - - case 0x0c0005: - case 0x0c0008: - case 0x0c0009: - watchdog = 0; - return; - } - -// bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static void __fastcall salamand_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x0a0000: - { - *m68k_irq_enable = data & 0x01; - *m68k_irq_enable2 = data & 0x02; - *flipscreen = data & 0x04; - *tilemap_flip_x = data & 0x04; - *tilemap_flip_y = data & 0x08; - if (data & 0x0800) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - return; - } - -// bprintf (0, _T("WW %5.5x, %4.4x\n"), address, data); -} - -static UINT8 __fastcall salamand_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0c0003: - return DrvDips[0]; - - case 0x0c2001: - return DrvInputs[0]; - - case 0x0c2003: - return DrvInputs[1]; - - case 0x0c2005: - return DrvInputs[2]; - - case 0x0c2007: - return DrvDips[1]; - } - -// bprintf (0, _T("RB %5.5x\n"), address); - - return 0; -} - -static UINT8 __fastcall hcrash_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0c0003: - return DrvDips[0]; - - case 0x0c0005: - return DrvDips[1]; - - case 0x0c0007: - return DrvDips[2]; //DrvInputs[2]; - - case 0x0c000b: - return DrvInputs[0]; - - case 0x0c2000: - return konamigt_read_analog(0) >> 8; - - case 0x0c2001: - return konamigt_read_analog(1) & 0xff; - - case 0x0c4001: - return DrvInputs[3]; - - case 0x0c4002: - case 0x0c4003: - switch (selected_ip & 0xf) - { // From WEC Le Mans Schems: - case 0xc: return (DrvInputs[3] & 0x40); // Accel - Schems: Accelevr - case 0: return (DrvInputs[3] & 0x40); - case 0xd: return konamigt_read_wheel(); // Wheel - Schems: Handlevr - case 1: return konamigt_read_wheel(); - - default: return ~0; - } - } - -// bprintf (0, _T("RB %5.5x\n"), address); - - return 0; -} - -static void __fastcall hcrash_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x0a0000: - if (data & 0x08) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x0a0001: - { - *m68k_irq_enable = data & 0x01; - *m68k_irq_enable2 = data & 0x02; - *flipscreen = data & 0x04; - *tilemap_flip_x = data & 0x04; - *tilemap_flip_y = data & 0x08; - } - return; - - case 0x0c0001: - *soundlatch = data; - return; - - case 0x0c0005: - case 0x0c0008: - case 0x0c0009: - watchdog = 0; - return; - - case 0x0c2801: - return; - - case 0x0c2802: - return; - - case 0x0c2803: - *m68k_irq_enable2 = data & 1; - return; - - case 0x0c2805: - return; - - case 0x0c4000: - case 0x0c4001: //bprintf(0, _T("s_ip ad[%X:%X]"), address & 1, data); - selected_ip = data; - return; - } - -// bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static void __fastcall gx400_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xff8001) == 0x020001) { - DrvShareRAM[(address & 0x7ffe)/2] = data & 0xff; - return; - } - - switch (address) - { - case 0x05c001: - *soundlatch = data; - return; - - case 0x05c801: // doesn't actually seem to work well as watchdog, use $5e008 instead? - watchdog = 0; - return; - - case 0x05e000: - // coin counter - return; - - case 0x05e001: - *m68k_irq_enable2 = data & 1; - return; - - case 0x05e003: - *m68k_irq_enable = data & 1; - return; - - case 0x05e004: - if (data & 1) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - return; - - case 0x05e005: - *flipscreen = data & 0x01; - *tilemap_flip_x = data & 0x01; - return; - - case 0x05e007: - *tilemap_flip_y = data & 0x01; - return; - - case 0x05e008: // nop - watchdog = 0; // ? - return; - - case 0x05e00e: - *m68k_irq_enable4 = data & 0x01; - return; - } - -// bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static UINT8 __fastcall gx400_main_read_byte(UINT32 address) -{ - if ((address & 0xff8001) == 0x020001) { - return DrvShareRAM[(address & 0x7ffe)/2]; - } - - switch (address) - { - case 0x05c403: - return DrvDips[0]; - - case 0x05c405: - return DrvDips[1]; - - case 0x05c407: - return DrvDips[2]; - - case 0x05cc01: - return DrvInputs[0]; - - case 0x05cc03: - return DrvInputs[1]; - - case 0x05cc05: - return DrvInputs[2]; - - case 0x070000: - return konamigt_read_analog(0) >> 8; - - case 0x070001: - return konamigt_read_analog(1) & 0xff; - } - -// bprintf (0, _T("RB %5.5x\n"), address); - - return 0; -} - -static void __fastcall citybomb_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x070011: - case 0x0f0011: - *soundlatch = data; - return; - - case 0x070019: - case 0x0f0019: - watchdog = 0; - return; - - case 0x078000: - case 0x0f8000: - // coin counters - if (data & 0x08) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - selected_ip = (~data & 0x10) >> 4; - return; - - case 0x078001: - case 0x0f8001: - { - if (data & 0x0c) bprintf (0, _T("WW %5.5x, %4.4x\n"), address, data); - *m68k_irq_enable = data & 0x01; - *m68k_irq_enable2 = data & 0x02; - *flipscreen = data & 0x04; - *tilemap_flip_x = data & 0x04; - *tilemap_flip_y = data & 0x08; - } - return; - } - -// bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static void __fastcall citybomb_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x078000: - case 0x0f8000: - { - *m68k_irq_enable = data & 0x01; - *m68k_irq_enable2 = data & 0x02; - *flipscreen = data & 0x04; - *tilemap_flip_x = data & 0x04; - *tilemap_flip_y = data & 0x08; - if (data & 0x0800) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - selected_ip = (~data & 0x1000) >> 12; - } - return; - } - -// bprintf (0, _T("WW %5.5x, %4.4x\n"), address, data); -} - -static UINT8 __fastcall citybomb_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0c2000: - return konamigt_read_analog(0) >> 8; - - case 0x0c2001: - return konamigt_read_analog(1) & 0xff; - - case 0x070001: - case 0x0f0001: - return DrvDips[1]; - - case 0x070003: - case 0x0f0003: - return DrvInputs[2]; - - case 0x070005: - case 0x0f0005: - return DrvInputs[1]; - - case 0x070007: - case 0x0f0007: - return DrvInputs[0]; - - case 0x070009: - case 0x0f0009: - return DrvDips[0]; - - case 0x0f0021: // WEC Le Mans inputs... - return 0; - } - -// bprintf (0, _T("RB %5.5x\n"), address); - - return 0; -} - -static void nemesis_filter_w(UINT16 /*offset*/) -{ -#if 0 - // not used right now.. - INT32 C1 = /* offset & 0x1000 ? 4700 : */ 0; // is this right? 4.7uF seems too large - INT32 C2 = offset & 0x0800 ? 33 : 0; // 0.033uF = 33 nF - INT32 AY8910_INTERNAL_RESISTANCE = 356; - - filter_rc_set_RC(0, FLT_RC_LOWPASS, (AY8910_INTERNAL_RESISTANCE + 12000) / 3, 0, 0, CAP_N(C1)); // unused? - filter_rc_set_RC(1, FLT_RC_LOWPASS, (AY8910_INTERNAL_RESISTANCE + 12000) / 3, 0, 0, CAP_N(C1)); // unused? - filter_rc_set_RC(2, FLT_RC_LOWPASS, (AY8910_INTERNAL_RESISTANCE + 12000) / 3, 0, 0, CAP_N(C1)); // unused? - - filter_rc_set_RC(3, FLT_RC_LOWPASS, AY8910_INTERNAL_RESISTANCE + 1000, 10000, 0, CAP_N(C2)); - filter_rc_set_RC(4, FLT_RC_LOWPASS, AY8910_INTERNAL_RESISTANCE + 1000, 10000, 0, CAP_N(C2)); - filter_rc_set_RC(5, FLT_RC_LOWPASS, AY8910_INTERNAL_RESISTANCE + 1000, 10000, 0, CAP_N(C2)); -#endif -} - -static void __fastcall nemesis_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xa000) { - K005289Ld1Write(address); - return; - } - - if ((address & 0xf000) == 0xc000) { - K005289Ld2Write(address); - return; - } - - switch (address) - { - case 0xe000: - if (vlm5030_enable) { - vlm5030_data_write(0, data); - } - return; - - case 0xe003: - K005289Tg1Write(); - return; - - case 0xe004: - K005289Tg2Write(); - return; - - case 0xe005: - AY8910Write(1, 0, data); - return; - - case 0xe006: - AY8910Write(0, 0, data); - return; - - case 0xe007: - case 0xe007+0x1ff8: - nemesis_filter_w(address); - return; - - case 0xe030: - if (vlm5030_enable) { - vlm5030_st(0,1); - vlm5030_st(0,0); - } - return; - - case 0xe106: - AY8910Write(0, 1, data); - return; - - case 0xe405: - AY8910Write(1, 1, data); - return; - } - //bprintf(0, _T("sw(%X, %X);.."), address, data); -} - -static UINT8 __fastcall nemesis_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe001: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xe086: - return AY8910Read(0); - - case 0xe205: - return AY8910Read(1); - } - - return 0; -} - -static void __fastcall salamand_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - switch (address) - { - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xd000: - if (vlm5030_enable) { - vlm5030_data_write(0, data); - } - return; - - case 0xf000: - if (vlm5030_enable) { - vlm5030_st(0,1); - vlm5030_st(0,0); - } - return; - } -} - -static UINT8 __fastcall salamand_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xb000) { - return K007232ReadReg(0, address & 0x0f); - } - - switch (address) - { - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xc000: - case 0xc001: - return BurnYM2151ReadStatus(); - - case 0xe000: - static int flipper; - flipper^=1; - return flipper & 1; - } - - return 0; -} - -static void sound_bankswitch(INT32 data) -{ - INT32 bank_A = (data >> 0) & 3; - INT32 bank_B = (data >> 2) & 3; - - k007232_set_bank(0, bank_A, bank_B); -} - -static void __fastcall citybomb_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff80) == 0x9800) { - K051649WaveformWrite(address & 0x7f, data); - return; - } - - if ((address & 0xfff0) == 0x9880) { - if (address <= 0x9889) - K051649FrequencyWrite(address & 0x0f, data); - else if (address <= 0x988e) - K051649VolumeWrite(address - 0x988a, data); - else if (address == 0x988f) - K051649KeyonoffWrite(data); - return; - } - - if ((address & 0xffe0) == 0x98e0) { - // k051649_test_w - return; - } - - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - switch (address) - { - case 0xa000: - case 0xa001: - BurnYM3812Write(0, address & 1, data); - return; - - case 0xc000: - sound_bankswitch(data); - return; - } -} - -static UINT8 __fastcall citybomb_sound_read(UINT16 address) -{ - if ((address & 0xff80) == 0x9800) { - return K051649WaveformRead(address & 0x7f); - } - - if ((address & 0xffe0) == 0x98e0) { - // k051649_test_r - return 0; - } - - if ((address & 0xfff0) == 0xb000) { - K007232ReadReg(0, address & 0x0f); - } - - switch (address) - { - case 0xa000: - case 0xa001: - return BurnYM3812Read(0, address & 1); - - case 0xd000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static UINT8 nemesis_AY8910_0_portA(UINT32) -{ - INT32 ret = (ZetTotalCycles() >> 10) & 0x2f; - - if (vlm5030_enable) { - if (vlm5030_bsy(0)) { - ret |= 0x20; - } - } - - return ret | 0xd0; -} - -static void k005289_control_A_write(UINT32, UINT32 data) -{ - K005289ControlAWrite(data); -} - -static void k005289_control_B_write(UINT32, UINT32 data) -{ - K005289ControlBWrite(data); -} - -static UINT32 salamand_vlm_sync(INT32 samples_rate) -{ - if (ZetGetActive() == -1) return 0; - - return (samples_rate * ZetTotalCycles()) / 1789772; -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - if (ZetGetActive() == -1) return 0; - - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -static inline void update_char_tiles(UINT32 offset) -{ - offset &= 0xfffe; - - INT32 data = *((UINT16*)(DrvCharRAM + offset)); - - offset *= 2; - - DrvCharRAMExp[offset + 0] = (data >> 12); - DrvCharRAMExp[offset + 1] = (data >> 8) & 0xf; - DrvCharRAMExp[offset + 2] = (data >> 4) & 0xf; - DrvCharRAMExp[offset + 3] = (data & 0x0f); -} - -static void __fastcall nemesis_charram_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvCharRAM + (address & 0xfffe))) = data; - - update_char_tiles(address); -} - -static void __fastcall nemesis_charram_write_byte(UINT32 address, UINT8 data) -{ - DrvCharRAM[(address & 0xffff)^1] = data; - - update_char_tiles(address); -} - -static void nemesis_palette_update(INT32 i) -{ - static const UINT8 color_table[3][32] = - { - { // correct colors (calculated by resnet system in MAME) - 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0b, 0x0d, 0x0f, 0x12, 0x14, 0x16, 0x19, 0x1c, - 0x21, 0x24, 0x29, 0x2e, 0x33, 0x39, 0x40, 0x49, 0x50, 0x5b, 0x68, 0x78, 0x8e, 0xa8, 0xcc, 0xff - }, - { // previous, incorrect (lighter) colors - 0x00, 0x08, 0x11, 0x19, 0x21, 0x29, 0x32, 0x3a, 0x40, 0x48, 0x51, 0x59, 0x61, 0x69, 0x72, 0x7a, - 0x85, 0x8d, 0x96, 0x9e, 0xa6, 0xae, 0xb7, 0xbf, 0xc5, 0xcd, 0xd6, 0xde, 0xe6, 0xee, 0xf7, 0xff - }, - { // MAMEUIFX colors (mid) - 0x00, 0x00, 0x01, 0x02, 0x04, 0x06, 0x09, 0x0d, 0x10, 0x14, 0x19, 0x1f, 0x24, 0x2b, 0x32, 0x3a, - 0x45, 0x4d, 0x58, 0x61, 0x6c, 0x76, 0x83, 0x8f, 0x98, 0xa4, 0xb3, 0xc1, 0xcf, 0xde, 0xef, 0xff - } - }; - - i &= 0xffe; - - INT32 p = (DrvPalRAM[i+1] << 8) | DrvPalRAM[i]; - - INT32 b = color_table[DrvDips[3]&3][(p >> 10) & 0x1f]; - INT32 g = color_table[DrvDips[3]&3][(p >> 5) & 0x1f]; - INT32 r = color_table[DrvDips[3]&3][(p >> 0) & 0x1f]; - - DrvPalette[i/2] = BurnHighCol(r,g,b,0); -} - -static void salamand_palette_update(INT32 i) -{ - i &= 0x1ffc; - - INT32 p = (DrvPalRAM[i+0] << 8) | DrvPalRAM[i+2]; - - INT32 b = (p >> 10) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 r = (p >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i/4] = BurnHighCol(r,g,b,0); -} - -static void __fastcall nemesis_palette_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + (address & 0x1ffe))) = data; - - palette_write(address); -} - -static void __fastcall nemesis_palette_write_byte(UINT32 address, UINT8 data) -{ - DrvPalRAM[(address & 0x1fff) ^ 1] = data; - - palette_write(address); -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x010000; - - K005289ROM = Next; Next += 0x000200; - DrvVLMROM = Next; Next += 0x004000; - K007232ROM = Next; Next += 0x080000; - - DrvCharRAMExp = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x010000; - Drv68KRAM1 = Next; Next += 0x020000; - Drv68KRAM2 = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x001000; - DrvVidRAM0 = Next; Next += 0x001000; - DrvVidRAM1 = Next; Next += 0x001000; - DrvColRAM0 = Next; Next += 0x001000; - DrvColRAM1 = Next; Next += 0x001000; - DrvCharRAM = Next; Next += 0x010000; - DrvScrollRAM = Next; Next += 0x002000; - - DrvZ80RAM = Next; Next += 0x000800; - DrvShareRAM = Next; Next += 0x004000; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - m68k_irq_enable = Next; Next += 0x000001; - m68k_irq_enable2 = Next; Next += 0x000001; - m68k_irq_enable4 = Next; Next += 0x000001; - tilemap_flip_x = Next; Next += 0x000001; - tilemap_flip_y = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(0); - if (ay8910_enable) AY8910Reset(0); - if (ay8910_enable) AY8910Reset(1); - if (ym2151_enable) BurnYM2151Reset(); - if (ym3812_enable) BurnYM3812Reset(); - if (vlm5030_enable) vlm5030Reset(0); -// if (k007232_enable) K007232Reset(); - if (k005289_enable) K005289Reset(); - if (k051649_enable) K051649Reset(); - ZetClose(); - - watchdog = 0; - selected_ip = 0; - - if (bUseShifter) - BurnShiftReset(); - - DrvDial1 = 0x3f; - - return 0; -} - -static void NemesisSoundInit(INT32 konamigtmode) -{ - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x4000, 0x47ff, MAP_RAM); - ZetSetWriteHandler(nemesis_sound_write); - ZetSetReadHandler(nemesis_sound_read); - ZetClose(); - - K005289Init(3579545, K005289ROM); - K005289SetRoute(BURN_SND_K005289_ROUTE_1, 0.35, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 14318180/8, nBurnSoundRate, &nemesis_AY8910_0_portA, NULL, NULL, NULL); - AY8910Init(1, 14318180/8, nBurnSoundRate, NULL, NULL, &k005289_control_A_write, &k005289_control_B_write); - AY8910SetAllRoutes(0, 0.35, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, (konamigtmode) ? 0.20 : 1.00, BURN_SND_ROUTE_BOTH); - -#if 0 - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 0); // ay 0 - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - - filter_rc_init(3, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); // ay 1 - filter_rc_init(4, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - - filter_rc_set_src_gain(0, 0.35); - filter_rc_set_src_gain(1, 0.35); - filter_rc_set_src_gain(2, 0.35); - filter_rc_set_src_gain(3, 1.00); - filter_rc_set_src_gain(4, 1.00); - filter_rc_set_src_gain(5, 1.00); - rcflt_enable = 1; -#endif - - ay8910_enable = 1; - k005289_enable = 1; -} - -static void Gx400SoundInit(INT32 rf2mode) -{ - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0x4000, 0x7fff, MAP_RAM); - ZetMapMemory(DrvVLMROM, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(nemesis_sound_write); - ZetSetReadHandler(nemesis_sound_read); - ZetClose(); - - K005289Init(3579545, K005289ROM); - K005289SetRoute(BURN_SND_K005289_ROUTE_1, (rf2mode) ? 0.60 : 0.35, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 14318180/8, nBurnSoundRate, &nemesis_AY8910_0_portA, NULL, NULL, NULL); - AY8910Init(1, 14318180/8, nBurnSoundRate, NULL, NULL, &k005289_control_A_write, &k005289_control_B_write); - AY8910SetAllRoutes(0, (rf2mode) ? 0.80 : 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, (rf2mode) ? 0.40 : 1.00, BURN_SND_ROUTE_BOTH); - - vlm5030Init(0, 3579545, salamand_vlm_sync, DrvVLMROM, 0x0800, 1); - vlm5030SetAllRoutes(0, 0.70, BURN_SND_ROUTE_BOTH); - - ay8910_enable = 1; - k005289_enable = 1; - vlm5030_enable = 1; -} - -static void TwinbeeGx400SoundInit() -{ - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0x4000, 0x7fff, MAP_RAM); - ZetMapMemory(DrvVLMROM, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(nemesis_sound_write); - ZetSetReadHandler(nemesis_sound_read); - ZetClose(); - - K005289Init(3579545, K005289ROM); - K005289SetRoute(BURN_SND_K005289_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 14318180/8, nBurnSoundRate, &nemesis_AY8910_0_portA, NULL, NULL, NULL); - AY8910Init(1, 14318180/8, nBurnSoundRate, NULL, NULL, &k005289_control_A_write, &k005289_control_B_write); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); // melody & hat - AY8910SetAllRoutes(1, 1.00, BURN_SND_ROUTE_BOTH); // drums, explosions - - vlm5030Init(0, 3579545, salamand_vlm_sync, DrvVLMROM, 0x0800, 1); - vlm5030SetAllRoutes(0, 3.10, BURN_SND_ROUTE_BOTH); - - ay8910_enable = 1; - k005289_enable = 1; - vlm5030_enable = 1; -} - -static void SalamandSoundInit() -{ - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(salamand_sound_write); - ZetSetReadHandler(salamand_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.20, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.20, BURN_SND_ROUTE_RIGHT); - - K007232Init(0, 3579545, K007232ROM, 0x20000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, (hcrash_mode) ? 0.10 : 0.08, BURN_SND_ROUTE_BOTH); - - if (DrvVLMROM[1] || DrvVLMROM[2]) { - vlm5030Init(0, 3579545, salamand_vlm_sync, DrvVLMROM, 0x4000, 1); - vlm5030SetAllRoutes(0, (hcrash_mode) ? 0.80 : 2.50, BURN_SND_ROUTE_BOTH); - vlm5030_enable = 1; - } - - ym2151_enable = 1; - k007232_enable = 1; -} - -static void CitybombSoundInit() -{ - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(citybomb_sound_write); - ZetSetReadHandler(citybomb_sound_read); - ZetClose(); - - BurnYM3812Init(1, 3579545, NULL, DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3579545); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - K007232Init(0, 3579545, K007232ROM, 0x80000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - K051649Init(3579545/2); - K051649SetRoute(0.38, BURN_SND_ROUTE_BOTH); - - ym3812_enable = 1; - k007232_enable = 1; - k051649_enable = 1; -} - -static INT32 NemesisInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x030001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x030000, 7, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(K005289ROM + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(K005289ROM + 0x00100, 10, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvCharRAM, 0x040000, 0x04ffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x050000, 0x051fff, MAP_RAM); - xscroll1 = (UINT16*)(DrvScrollRAM + 0x00000); - xscroll2 = (UINT16*)(DrvScrollRAM + 0x00400); - yscroll2 = (UINT16*)(DrvScrollRAM + 0x00f00); - yscroll1 = (UINT16*)(DrvScrollRAM + 0x00f80); - SekMapMemory(DrvVidRAM0, 0x052000, 0x052fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x053000, 0x053fff, MAP_RAM); - SekMapMemory(DrvColRAM0, 0x054000, 0x054fff, MAP_RAM); - SekMapMemory(DrvColRAM1, 0x055000, 0x055fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x056000, 0x056fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x05a000, 0x05afff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x060000, 0x067fff, MAP_RAM); - SekSetWriteWordHandler(0, nemesis_main_write_word); - SekSetWriteByteHandler(0, nemesis_main_write_byte); - SekSetReadWordHandler(0, nemesis_main_read_word); - SekSetReadByteHandler(0, nemesis_main_read_byte); - SekMapHandler(1, 0x040000, 0x04ffff, MAP_WRITE); - SekSetWriteWordHandler(1, nemesis_charram_write_word); - SekSetWriteByteHandler(1, nemesis_charram_write_byte); - SekMapHandler(2, 0x05a000, 0x05afff, MAP_WRITE); - SekSetWriteWordHandler(2, nemesis_palette_write_word); - SekSetWriteByteHandler(2, nemesis_palette_write_byte); - SekClose(); - - NemesisSoundInit(0); - - palette_write = nemesis_palette_update; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static void ShifterSetup() -{ - BurnShiftInit(SHIFT_POSITION_BOTTOM_RIGHT, SHIFT_COLOR_GREEN, 80); - bUseShifter = 1; -} - -static INT32 KonamigtInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x030001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x030000, 7, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(K005289ROM + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(K005289ROM + 0x00100, 10, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvCharRAM, 0x040000, 0x04ffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x050000, 0x051fff, MAP_RAM); - xscroll1 = (UINT16*)(DrvScrollRAM + 0x00000); - xscroll2 = (UINT16*)(DrvScrollRAM + 0x00400); - yscroll2 = (UINT16*)(DrvScrollRAM + 0x00f00); - yscroll1 = (UINT16*)(DrvScrollRAM + 0x00f80); - SekMapMemory(DrvVidRAM0, 0x052000, 0x052fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x053000, 0x053fff, MAP_RAM); - SekMapMemory(DrvColRAM0, 0x054000, 0x054fff, MAP_RAM); - SekMapMemory(DrvColRAM1, 0x055000, 0x055fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x056000, 0x056fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x05a000, 0x05afff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x060000, 0x067fff, MAP_RAM); - SekSetWriteWordHandler(0, nemesis_main_write_word); - SekSetWriteByteHandler(0, konamigt_main_write_byte); - SekSetReadWordHandler(0, nemesis_main_read_word); - SekSetReadByteHandler(0, nemesis_main_read_byte); - SekMapHandler(1, 0x040000, 0x04ffff, MAP_WRITE); - SekSetWriteWordHandler(1, nemesis_charram_write_word); - SekSetWriteByteHandler(1, nemesis_charram_write_byte); - SekMapHandler(2, 0x05a000, 0x05afff, MAP_WRITE); - SekSetWriteWordHandler(2, nemesis_palette_write_word); - SekSetWriteByteHandler(2, nemesis_palette_write_byte); - SekClose(); - - NemesisSoundInit(1); - - palette_write = nemesis_palette_update; - - GenericTilesInit(); - - ShifterSetup(); - - DrvDoReset(); - - gearboxmode = 1; - - return 0; -} - -static INT32 SalamandInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvVLMROM + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(K007232ROM + 0x00000, 6, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x080000, 0x087fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x090000, 0x091fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x101000, 0x101fff, MAP_RAM); - SekMapMemory(DrvColRAM1, 0x102000, 0x102fff, MAP_RAM); - SekMapMemory(DrvColRAM0, 0x103000, 0x103fff, MAP_RAM); - SekMapMemory(DrvCharRAM, 0x120000, 0x12ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x180000, 0x180fff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x190000, 0x191fff, MAP_RAM); - xscroll2 = (UINT16*)(DrvScrollRAM + 0x00000); - xscroll1 = (UINT16*)(DrvScrollRAM + 0x00400); - yscroll1 = (UINT16*)(DrvScrollRAM + 0x00f00); - yscroll2 = (UINT16*)(DrvScrollRAM + 0x00f80); - SekSetWriteWordHandler(0, salamand_main_write_word); - SekSetWriteByteHandler(0, salamand_main_write_byte); - SekSetReadWordHandler(0, nemesis_main_read_word); - SekSetReadByteHandler(0, salamand_main_read_byte); - SekMapHandler(1, 0x120000, 0x12ffff, MAP_WRITE); - SekSetWriteWordHandler(1, nemesis_charram_write_word); - SekSetWriteByteHandler(1, nemesis_charram_write_byte); - SekMapHandler(2, 0x090000, 0x091fff, MAP_WRITE); - SekSetWriteWordHandler(2, nemesis_palette_write_word); - SekSetWriteByteHandler(2, nemesis_palette_write_byte); - SekClose(); - - SalamandSoundInit(); - - palette_write = salamand_palette_update; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 BlkpnthrInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(K007232ROM + 0x00000, 5, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x080000, 0x081fff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x090000, 0x097fff, MAP_RAM); - SekMapMemory(DrvColRAM0, 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(DrvColRAM1, 0x101000, 0x101fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x102000, 0x102fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x103000, 0x103fff, MAP_RAM); - SekMapMemory(DrvCharRAM, 0x120000, 0x12ffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x180000, 0x181fff, MAP_RAM); - xscroll1 = (UINT16*)(DrvScrollRAM + 0x00000); - xscroll2 = (UINT16*)(DrvScrollRAM + 0x00400); - yscroll2 = (UINT16*)(DrvScrollRAM + 0x00f00); - yscroll1 = (UINT16*)(DrvScrollRAM + 0x00f80); - SekMapMemory(DrvSprRAM, 0x190000, 0x190fff, MAP_RAM); - SekSetWriteWordHandler(0, salamand_main_write_word); - SekSetWriteByteHandler(0, salamand_main_write_byte); - SekSetReadWordHandler(0, nemesis_main_read_word); - SekSetReadByteHandler(0, salamand_main_read_byte); - SekMapHandler(1, 0x120000, 0x12ffff, MAP_WRITE); - SekSetWriteWordHandler(1, nemesis_charram_write_word); - SekSetWriteByteHandler(1, nemesis_charram_write_byte); - SekMapHandler(2, 0x080000, 0x081fff, MAP_WRITE); - SekSetWriteWordHandler(2, nemesis_palette_write_word); - SekSetWriteByteHandler(2, nemesis_palette_write_byte); - SekClose(); - - SalamandSoundInit(); - - palette_write = salamand_palette_update; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 HcrashInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvVLMROM + 0x004000, 5, 1)) return 1; - memmove(DrvVLMROM, DrvVLMROM + 0x08000, 0x4000); - memset(DrvVLMROM + 0x08000, 0, 0x4000); - - if (BurnLoadRom(K007232ROM + 0x00000, 6, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x080000, 0x087fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x090000, 0x091fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x101000, 0x101fff, MAP_RAM); - SekMapMemory(DrvColRAM1, 0x102000, 0x102fff, MAP_RAM); - SekMapMemory(DrvColRAM0, 0x103000, 0x103fff, MAP_RAM); - SekMapMemory(DrvCharRAM, 0x120000, 0x12ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x180000, 0x180fff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x190000, 0x191fff, MAP_RAM); - xscroll2 = (UINT16*)(DrvScrollRAM + 0x00000); - xscroll1 = (UINT16*)(DrvScrollRAM + 0x00400); - yscroll1 = (UINT16*)(DrvScrollRAM + 0x00f00); - yscroll2 = (UINT16*)(DrvScrollRAM + 0x00f80); - SekSetWriteWordHandler(0, salamand_main_write_word); - SekSetWriteByteHandler(0, hcrash_main_write_byte); - SekSetReadWordHandler(0, nemesis_main_read_word); - SekSetReadByteHandler(0, hcrash_main_read_byte); - SekMapHandler(1, 0x120000, 0x12ffff, MAP_WRITE); - SekSetWriteWordHandler(1, nemesis_charram_write_word); - SekSetWriteByteHandler(1, nemesis_charram_write_byte); - SekMapHandler(2, 0x090000, 0x091fff, MAP_WRITE); - SekSetWriteWordHandler(2, nemesis_palette_write_word); - SekSetWriteByteHandler(2, nemesis_palette_write_byte); - SekClose(); - - hcrash_mode = 1; - SalamandSoundInit(); - - palette_write = salamand_palette_update; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 Gx400Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(K005289ROM + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(K005289ROM + 0x00100, 6, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x00ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x010000, 0x01ffff, MAP_RAM); - SekMapMemory(DrvCharRAM, 0x030000, 0x03ffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x050000, 0x051fff, MAP_RAM); - xscroll1 = (UINT16*)(DrvScrollRAM + 0x00000); - xscroll2 = (UINT16*)(DrvScrollRAM + 0x00400); - yscroll2 = (UINT16*)(DrvScrollRAM + 0x00f00); - yscroll1 = (UINT16*)(DrvScrollRAM + 0x00f80); - SekMapMemory(DrvVidRAM0, 0x052000, 0x052fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x053000, 0x053fff, MAP_RAM); - SekMapMemory(DrvColRAM0, 0x054000, 0x054fff, MAP_RAM); - SekMapMemory(DrvColRAM1, 0x055000, 0x055fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x056000, 0x056fff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x057000, 0x057fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x05a000, 0x05afff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x060000, 0x07ffff, MAP_RAM); - SekMapMemory(Drv68KROM + 0x10000, 0x080000, 0x0bffff, MAP_ROM); - SekSetWriteWordHandler(0, nemesis_main_write_word); - SekSetWriteByteHandler(0, gx400_main_write_byte); - SekSetReadWordHandler(0, nemesis_main_read_word); - SekSetReadByteHandler(0, gx400_main_read_byte); - SekMapHandler(1, 0x030000, 0x03ffff, MAP_WRITE); - SekSetWriteWordHandler(1, nemesis_charram_write_word); - SekSetWriteByteHandler(1, nemesis_charram_write_byte); - SekMapHandler(2, 0x05a000, 0x05afff, MAP_WRITE); - SekSetWriteWordHandler(2, nemesis_palette_write_word); - SekSetWriteByteHandler(2, nemesis_palette_write_byte); - SekClose(); - if (strstr(BurnDrvGetTextA(DRV_NAME), "twin")) { - TwinbeeGx400SoundInit(); - } else { - Gx400SoundInit((strstr(BurnDrvGetTextA(DRV_NAME), "gwarr")) ? 1 : 0); - } - - palette_write = nemesis_palette_update; - - ay8910_enable = 1; - k005289_enable = 1; - vlm5030_enable = 1; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 Rf2_gx400Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(K005289ROM + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(K005289ROM + 0x00100, 6, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x00ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x010000, 0x01ffff, MAP_RAM); - SekMapMemory(DrvCharRAM, 0x030000, 0x03ffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x050000, 0x051fff, MAP_RAM); - xscroll1 = (UINT16*)(DrvScrollRAM + 0x00000); - xscroll2 = (UINT16*)(DrvScrollRAM + 0x00400); - yscroll2 = (UINT16*)(DrvScrollRAM + 0x00f00); - yscroll1 = (UINT16*)(DrvScrollRAM + 0x00f80); - SekMapMemory(DrvVidRAM0, 0x052000, 0x052fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x053000, 0x053fff, MAP_RAM); - SekMapMemory(DrvColRAM0, 0x054000, 0x054fff, MAP_RAM); - SekMapMemory(DrvColRAM1, 0x055000, 0x055fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x056000, 0x056fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x05a000, 0x05afff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x060000, 0x067fff, MAP_RAM); - SekMapMemory(Drv68KROM + 0x10000, 0x080000, 0x0bffff, MAP_ROM); - SekSetWriteWordHandler(0, nemesis_main_write_word); - SekSetWriteByteHandler(0, gx400_main_write_byte); - SekSetReadWordHandler(0, nemesis_main_read_word); - SekSetReadByteHandler(0, gx400_main_read_byte); - SekMapHandler(1, 0x030000, 0x03ffff, MAP_WRITE); - SekSetWriteWordHandler(1, nemesis_charram_write_word); - SekSetWriteByteHandler(1, nemesis_charram_write_byte); - SekMapHandler(2, 0x05a000, 0x05afff, MAP_WRITE); - SekSetWriteWordHandler(2, nemesis_palette_write_word); - SekSetWriteByteHandler(2, nemesis_palette_write_byte); - SekClose(); - - Gx400SoundInit(1); - - palette_write = nemesis_palette_update; - - GenericTilesInit(); - - ShifterSetup(); - - DrvDoReset(); - - gearboxmode = 1; - - return 0; -} - -static INT32 CitybombInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0c0001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0c0000, 7, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(K007232ROM + 0x00000, 9, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x080000, 0x087fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0e0000, 0x0e1fff, MAP_RAM); - SekMapMemory(Drv68KROM + 0x40000, 0x100000, 0x1bffff, MAP_ROM); - SekMapMemory(DrvCharRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x210000, 0x210fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x211000, 0x211fff, MAP_RAM); - SekMapMemory(DrvColRAM0, 0x212000, 0x212fff, MAP_RAM); - SekMapMemory(DrvColRAM1, 0x213000, 0x213fff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x300000, 0x301fff, MAP_RAM); - xscroll1 = (UINT16*)(DrvScrollRAM + 0x00000); - xscroll2 = (UINT16*)(DrvScrollRAM + 0x00400); - yscroll2 = (UINT16*)(DrvScrollRAM + 0x00f00); - yscroll1 = (UINT16*)(DrvScrollRAM + 0x00f80); - SekMapMemory(DrvSprRAM, 0x310000, 0x310fff, MAP_RAM); - SekSetWriteWordHandler(0, citybomb_main_write_word); - SekSetWriteByteHandler(0, citybomb_main_write_byte); - SekSetReadWordHandler(0, nemesis_main_read_word); - SekSetReadByteHandler(0, citybomb_main_read_byte); - SekMapHandler(2, 0x0e0000, 0x0e1fff, MAP_WRITE); - SekSetWriteWordHandler(2, nemesis_palette_write_word); - SekSetWriteByteHandler(2, nemesis_palette_write_byte); - SekMapHandler(1, 0x200000, 0x20ffff, MAP_WRITE); - SekSetWriteWordHandler(1, nemesis_charram_write_word); - SekSetWriteByteHandler(1, nemesis_charram_write_byte); - SekClose(); - - CitybombSoundInit(); - - palette_write = salamand_palette_update; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 NyanpaniInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(K007232ROM + 0x00000, 5, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x040000, 0x047fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x060000, 0x061fff, MAP_RAM); - SekMapMemory(Drv68KROM + 0x40000, 0x100000, 0x13ffff, MAP_ROM); - SekMapMemory(DrvVidRAM0, 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x201000, 0x201fff, MAP_RAM); - SekMapMemory(DrvColRAM0, 0x202000, 0x202fff, MAP_RAM); - SekMapMemory(DrvColRAM1, 0x203000, 0x203fff, MAP_RAM); - SekMapMemory(DrvCharRAM, 0x210000, 0x21ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x300000, 0x300fff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x310000, 0x311fff, MAP_RAM); - xscroll1 = (UINT16*)(DrvScrollRAM + 0x00000); - xscroll2 = (UINT16*)(DrvScrollRAM + 0x00400); - yscroll2 = (UINT16*)(DrvScrollRAM + 0x00f00); - yscroll1 = (UINT16*)(DrvScrollRAM + 0x00f80); - SekSetWriteWordHandler(0, citybomb_main_write_word); - SekSetWriteByteHandler(0, citybomb_main_write_byte); - SekSetReadWordHandler(0, nemesis_main_read_word); - SekSetReadByteHandler(0, citybomb_main_read_byte); - SekMapHandler(2, 0x060000, 0x061fff, MAP_WRITE); - SekSetWriteWordHandler(2, nemesis_palette_write_word); - SekSetWriteByteHandler(2, nemesis_palette_write_byte); - SekMapHandler(1, 0x210000, 0x21ffff, MAP_WRITE); - SekSetWriteWordHandler(1, nemesis_charram_write_word); - SekSetWriteByteHandler(1, nemesis_charram_write_byte); - SekClose(); - - CitybombSoundInit(); - - palette_write = salamand_palette_update; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - - if (ay8910_enable) AY8910Exit(0); - if (ay8910_enable) AY8910Exit(1); - if (ym2151_enable) BurnYM2151Exit(); - if (ym3812_enable) BurnYM3812Exit(); - if (vlm5030_enable) vlm5030Exit(); - if (k007232_enable) K007232Exit(); - if (k005289_enable) K005289Exit(); - if (k051649_enable) K051649Exit(); - if (rcflt_enable) filter_rc_exit(); - if (bUseShifter) BurnShiftExit(); - bUseShifter = 0; - - BurnFree (AllMem); - - palette_write = NULL; - - ay8910_enable = 0; - ym2151_enable = 0; - ym3812_enable = 0; - k005289_enable = 0; - k007232_enable = 0; - k051649_enable = 0; - vlm5030_enable = 0; - hcrash_mode = 0; - gearboxmode = 0; - - return 0; -} - -static void draw_layer(UINT8 *vidram, UINT8 *colram, UINT16 *scrollx, UINT16 *scrolly, INT32 priority, INT32) -{ - UINT16 *vram = (UINT16*)vidram; - UINT16 *cram = (UINT16*)colram; - - for (INT32 y = 0; y < 256; y++) - { - INT32 xscroll = (scrollx[y] & 0xff) | ((scrollx[y+0x100] & 1) * 256); - - INT32 sx_off = xscroll & 0x07; - - for (INT32 x = 0; x < nScreenWidth + (sx_off); x+=8) - { - INT32 scry = scrolly[x/8] & 0xff; - - INT32 offs = ((((scry/8)+(y/8)) & 0x1f) * 64) + (((x/8)+(xscroll/8)) & 0x3f); - - INT32 sy = y - (scry & 0x07); - - INT32 dy = sy; - dy -= 16; - if (dy < 0 || dy >= nScreenHeight) continue; - - if (*tilemap_flip_y) dy = (nScreenHeight - 1) - dy; - - INT32 code = vram[offs]; - INT32 color = cram[offs]; - INT32 flipx = (color & 0x0080) ? 0x07 : 0; - INT32 flipy = (code & 0x0800) ? 0x38 : 0; - INT32 mask = (code & 0x1000) >> 12; - INT32 layer = (code & 0x4000) >> 14; - - INT32 transparency = 0; - - if (mask && layer == 0) layer = 1; - if ((code & 0x2000) == 0 && (code & 0xc000) == 0x4000) { transparency = 0xff; } - - if (priority != mask) continue; - - if (code & 0xf800) - { - code = (code & 0x7ff) * 0x40; - color = (color & 0x7f) * 0x10; - - UINT8 *rom = DrvCharRAMExp + code + (((y & 0x7)*8) ^ flipy); - - for (INT32 xx = 0; xx < 8; xx++) - { - int xxx = (xx + x) - sx_off; - - if (xxx >= 0 && xxx < nScreenWidth) - { - INT32 pxl = (rom[xx^flipx] & 0x0f); - - if (pxl!=transparency) { - pTransDraw[dy * nScreenWidth + xxx] = color + pxl; - } - } - } - } - else - { - if (transparency == 0xff) { - for (INT32 xx = 0; xx < 8; xx++) { - if ((xx + x) > 0 && (xx + x) < nScreenWidth) { - pTransDraw[dy * nScreenWidth + (xx+x)] = 0; - } - } - } - } - } - } -} - -static void draw_sprites() -{ - static INT32 table[8][2] = { - { 32, 32 }, { 16, 32 }, { 32, 16 }, { 64, 64 }, { 8, 8 }, { 16, 8 }, { 8, 16 }, { 16, 16 } - }; - - UINT16 *spriteram = (UINT16*)DrvSprRAM; - - for (INT32 priority = 0; priority < 256; priority++) - { - for (INT32 address = (0x1000/2) - 8; address >= 0; address -= 8) - { - if((spriteram[address] & 0xff) != priority) - continue; - - INT32 zoom = spriteram[address + 2] & 0xff; - - INT32 code; - if (!(spriteram[address + 2] & 0xff00) && ((spriteram[address + 3] & 0xff00) != 0xff00)) - code = spriteram[address + 3] + ((spriteram[address + 4] & 0xc0) << 2); - else - code = (spriteram[address + 3] & 0xff) + ((spriteram[address + 4] & 0xc0) << 2); - - if (zoom != 0xff || code != 0) - { - - INT32 size = spriteram[address + 1]; - zoom += (size & 0xc0) << 2; - - if (zoom == 0) continue; - - INT32 sx = spriteram[address + 5] & 0xff; - INT32 sy = spriteram[address + 6] & 0xff; - if (spriteram[address + 4] & 0x01) - sx-=0x100; - - INT32 color = (spriteram[address + 4] & 0x1e) >> 1; - INT32 flipx = spriteram[address + 1] & 0x01; - INT32 flipy = spriteram[address + 4] & 0x20; - - INT32 w = table[(size >> 3) & 7][0]; - INT32 h = table[(size >> 3) & 7][1]; - code = code * 8 * 16 / (w * h); - - zoom = ((1 << 16) * 0x80 / zoom) + 0x02ab; - - if (*flipscreen) - { - sx = 256 - ((zoom * w) >> 16) - sx; - sy = 256 - ((zoom * h) >> 16) - sy; - flipx = !flipx; - flipy = !flipy; - } - - RenderZoomedTile(pTransDraw, DrvCharRAMExp, code, color*16, 0, sx, sy - 16, flipx, flipy, w, h, zoom, zoom); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - if (palette_write != NULL) { - for (INT32 i = 0; i < 0x2000; i+=2) { // a little hackish, but works for salamander & nemesis palette types - palette_write(i); - } - - DrvRecalc = 0; - } - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(DrvVidRAM1, DrvColRAM1, xscroll2, yscroll2, 0, 1); - if (nBurnLayer & 2) draw_layer(DrvVidRAM0, DrvColRAM0, xscroll1, yscroll1, 0, 2); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 4) draw_layer(DrvVidRAM1, DrvColRAM1, xscroll2, yscroll2, 1, 4); - if (nBurnLayer & 8) draw_layer(DrvVidRAM0, DrvColRAM0, xscroll1, yscroll1, 1, 8); - - BurnTransferCopy(DrvPalette); - if (bUseShifter) - BurnShiftRender(); - - return 0; -} - -static INT32 NemesisFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(); - } - - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 4 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 9216000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 segment; - - segment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(segment); - if (i == 240 && *m68k_irq_enable) - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - segment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(segment); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - -#if 0 - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - filter_rc_update(3, pAY8910Buffer[3], pSoundBuf, nSegmentLength); - filter_rc_update(4, pAY8910Buffer[4], pSoundBuf, nSegmentLength); - filter_rc_update(5, pAY8910Buffer[5], pSoundBuf, nSegmentLength); -#endif - - } - } - - ZetClose(); - SekClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); -#if 0 - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - filter_rc_update(3, pAY8910Buffer[3], pSoundBuf, nSegmentLength); - filter_rc_update(4, pAY8910Buffer[4], pSoundBuf, nSegmentLength); - filter_rc_update(5, pAY8910Buffer[5], pSoundBuf, nSegmentLength); -#endif - } - K005289Update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static void spinner_update() -{ // spinner calculation stuff. (wheel) for rf2 / konamigt & hcrash - UINT8 INCREMENT = 0x02; - UINT8 target = konamigt_read_wheel(); - if (DrvDial1+INCREMENT < target) { // go "right" in blocks of "INCREMENT" - DrvDial1 += INCREMENT; - } - else - if (DrvDial1 < target) { // take care of remainder - DrvDial1++; - } - - if (DrvDial1-INCREMENT > target) { // go "left" in blocks of "INCREMENT" - DrvDial1 -= INCREMENT; - } - else - if (DrvDial1 > target) { // take care of remainder - DrvDial1--; - } -} - -static INT32 KonamigtFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(); - } - - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 4 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - DrvInputs[1] = DrvInputs[1] & ~0x10; - DrvInputs[1] |= ((BurnShiftInputCheckToggle(DrvJoy2[4])) ? 0x10 : 0x00); - } - - spinner_update(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 9216000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 segment; - - segment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(segment); - - if (*m68k_irq_enable && i == 240 && (nCurrentFrame & 1) == 0) - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - if (*m68k_irq_enable2 && i == 0) - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - segment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(segment); - } - - ZetClose(); - SekClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - K005289Update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 SalamandFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(); - } - - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0, 4 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - DrvInputs[0] |= (DrvDips[2] & 0x0a) << 4; - // DrvInputs[0] ^= 0x80; // service mode low - DrvInputs[1] |= (DrvDips[2] & 0x80); - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = (nBurnSoundLen) ? nBurnSoundLen : 256; - INT32 nCyclesTotal[2] = { 9216000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 segment; - - segment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(segment); - if (i == (nInterleave - 4) && *m68k_irq_enable) // should be 2500... - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - segment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(segment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - K007232Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 HcrashFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(); - } - - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0, 4 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] |= 1 << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - spinner_update(); - - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 256; // should be nBurnSoundLen, but we need scanlines! - INT32 nCyclesTotal[2] = { 6144000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 segment; - - segment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(segment); - - if (*m68k_irq_enable && i == 240 && (nCurrentFrame & 1) == 0) - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - if (*m68k_irq_enable2 && i == 0) - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - segment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(segment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - K007232Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 BlkpnthrFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(); - } - - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0, 4 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - DrvInputs[0] |= (DrvDips[2] & 0xe0); - DrvInputs[1] |= (DrvDips[2] & 0x08) << 4; - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = (nBurnSoundLen) ? nBurnSoundLen : 256; - INT32 nCyclesTotal[2] = { 9216000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 segment; - - segment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(segment); - if (i == (nInterleave - 4) && *m68k_irq_enable) - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - segment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(segment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - - K007232Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 Gx400Frame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(); - } - - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3 * sizeof(INT16)); - DrvInputs[3] = 0; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - if (gearboxmode) { // rf2 - DrvInputs[1] = DrvInputs[1] & ~0x10; - DrvInputs[1] |= ((BurnShiftInputCheckToggle(DrvJoy2[4])) ? 0x00 : 0x10); // different from the rest. - - spinner_update(); - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 9216000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 segment; - - segment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(segment); - - if (*m68k_irq_enable && (i == 240) && (nCurrentFrame & 1) == 0) - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - if (*m68k_irq_enable2 && (i == 0)) - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - if (*m68k_irq_enable4 && (i == 120)) - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - segment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(segment); - if (i == (nInterleave - 1)) ZetNmi(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - ZetClose(); - SekClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - K005289Update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 CitybombFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(); - } - - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 4 * sizeof(INT16)); - DrvInputs[3] = 0; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - DrvInputs[0] = (DrvInputs[0] & 0x1f) | ((DrvDips[2] & 0x0e)<<4); - DrvInputs[1] = (DrvInputs[1] & 0x7f) | (DrvDips[2] & 0x80); - } - - INT32 nCyclesTotal[2] = { 9216000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - nCyclesDone[0] += SekRun(nCyclesTotal[0]); - - if (*m68k_irq_enable) // 2500... - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - K007232Update(0, pBurnSoundOut, nBurnSoundLen); - K051649Update(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - if (ym2151_enable) BurnYM2151Scan(nAction); - if (ym3812_enable) BurnYM3812Scan(nAction, pnMin); - if (ay8910_enable) AY8910Scan(nAction, pnMin); - if (k005289_enable) K005289Scan(nAction, pnMin); - if (k007232_enable) K007232Scan(nAction, pnMin); - if (k051649_enable) K051649Scan(nAction, pnMin); - if (vlm5030_enable) vlm5030Scan(nAction); - if (bUseShifter) BurnShiftScan(nAction); - - SCAN_VAR(selected_ip); - SCAN_VAR(DrvDial1); - } - - if (nAction & ACB_WRITE) { - for (INT32 i = 0; i < 0x10000; i+=2) { - update_char_tiles(i); - } - - DrvRecalc = 1; - } - - return 0; -} - - -// Nemesis (ROM version) - -static struct BurnRomInfo nemesisRomDesc[] = { - { "456-d01.12a", 0x08000, 0x35ff1aaa, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "456-d05.12c", 0x08000, 0x23155faa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "456-d02.13a", 0x08000, 0xac0cf163, 1 | BRF_PRG | BRF_ESS }, // 2 - { "456-d06.13c", 0x08000, 0x023f22a9, 1 | BRF_PRG | BRF_ESS }, // 3 - { "456-d03.14a", 0x08000, 0x8cefb25f, 1 | BRF_PRG | BRF_ESS }, // 4 - { "456-d07.14c", 0x08000, 0xd50b82cb, 1 | BRF_PRG | BRF_ESS }, // 5 - { "456-d04.15a", 0x08000, 0x9ca75592, 1 | BRF_PRG | BRF_ESS }, // 6 - { "456-d08.15c", 0x08000, 0x03c0b7f5, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "456-d09.9c", 0x04000, 0x26bf9636, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "400-a01.fse", 0x00100, 0x5827b1e8, 3 | BRF_SND }, // 9 K005289 Samples - { "400-a02.fse", 0x00100, 0x2f44f970, 3 | BRF_SND }, // 10 -}; - -STD_ROM_PICK(nemesis) -STD_ROM_FN(nemesis) - -struct BurnDriver BurnDrvNemesis = { - "nemesis", NULL, NULL, NULL, "1985", - "Nemesis (ROM version)\0", NULL, "Konami", "GX400", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, nemesisRomInfo, nemesisRomName, NULL, NULL, NemesisInputInfo, NemesisDIPInfo, - NemesisInit, DrvExit, NemesisFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Nemesis (World?, ROM version) - -static struct BurnRomInfo nemesisukRomDesc[] = { - { "456-e01.12a", 0x08000, 0xe1993f91, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "456-e05.12c", 0x08000, 0xc9761c78, 1 | BRF_PRG | BRF_ESS }, // 1 - { "456-e02.13a", 0x08000, 0xf6169c4b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "456-e06.13c", 0x08000, 0xaf58c548, 1 | BRF_PRG | BRF_ESS }, // 3 - { "456-e03.14a", 0x08000, 0x8cefb25f, 1 | BRF_PRG | BRF_ESS }, // 4 - { "456-e07.14c", 0x08000, 0xd50b82cb, 1 | BRF_PRG | BRF_ESS }, // 5 - { "456-e04.15a", 0x08000, 0x322423d0, 1 | BRF_PRG | BRF_ESS }, // 6 - { "456-e08.15c", 0x08000, 0xeb656266, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "456-b09.9c", 0x04000, 0x26bf9636, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "400-a01.fse", 0x00100, 0x5827b1e8, 3 | BRF_SND }, // 9 K005289 Samples - { "400-a02.fse", 0x00100, 0x2f44f970, 3 | BRF_SND }, // 10 -}; - -STD_ROM_PICK(nemesisuk) -STD_ROM_FN(nemesisuk) - -struct BurnDriver BurnDrvNemesisuk = { - "nemesisuk", "nemesis", NULL, NULL, "1985", - "Nemesis (World?, ROM version)\0", NULL, "Konami", "GX400", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, nemesisukRomInfo, nemesisukRomName, NULL, NULL, NemesisInputInfo, NemesisDIPInfo, - NemesisInit, DrvExit, NemesisFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Konami GT - -static struct BurnRomInfo konamigtRomDesc[] = { - { "561-c01.12a", 0x08000, 0x56245bfd, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "561-c05.12c", 0x08000, 0x8d651f44, 1 | BRF_PRG | BRF_ESS }, // 1 - { "561-c02.13a", 0x08000, 0x3407b7cb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "561-c06.13c", 0x08000, 0x209942d4, 1 | BRF_PRG | BRF_ESS }, // 3 - { "561-b03.14a", 0x08000, 0xaef7df48, 1 | BRF_PRG | BRF_ESS }, // 4 - { "561-b07.14c", 0x08000, 0xe9bd6250, 1 | BRF_PRG | BRF_ESS }, // 5 - { "561-b04.15a", 0x08000, 0x94bd4bd7, 1 | BRF_PRG | BRF_ESS }, // 6 - { "561-b08.15c", 0x08000, 0xb7236567, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "561-b09.9c", 0x04000, 0x539d0c49, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "400-a01.fse", 0x00100, 0x5827b1e8, 3 | BRF_SND }, // 9 K005289 Samples - { "400-a02.fse", 0x00100, 0x2f44f970, 3 | BRF_SND }, // 10 -}; - -STD_ROM_PICK(konamigt) -STD_ROM_FN(konamigt) - -struct BurnDriver BurnDrvKonamigt = { - "konamigt", NULL, NULL, NULL, "1985", - "Konami GT\0", NULL, "Konami", "GX561", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_RACING, 0, - NULL, konamigtRomInfo, konamigtRomName, NULL, NULL, KonamigtInputInfo, KonamigtDIPInfo, - KonamigtInit, DrvExit, KonamigtFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Salamander (version D) - -static struct BurnRomInfo salamandRomDesc[] = { - { "587-d02.18b", 0x10000, 0xa42297f9, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "587-d05.18c", 0x10000, 0xf9130b0a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "587-c03.17b", 0x20000, 0xe5caf6e6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "587-c06.17c", 0x20000, 0xc2f567ea, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "587-d09.11j", 0x08000, 0x5020972c, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "587-d08.8g", 0x04000, 0xf9ac6b82, 4 | BRF_SND }, // 5 VLM5030 Samples - - { "587-c01.10a", 0x20000, 0x09fe0632, 5 | BRF_SND }, // 6 K007232 Samples -}; - -STD_ROM_PICK(salamand) -STD_ROM_FN(salamand) - -struct BurnDriver BurnDrvSalamand = { - "salamand", NULL, NULL, NULL, "1986", - "Salamander (version D)\0", NULL, "Konami", "GX587", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, salamandRomInfo, salamandRomName, NULL, NULL, SalamandInputInfo, SalamandDIPInfo, - SalamandInit, DrvExit, SalamandFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Salamander (version J) - -static struct BurnRomInfo salamandjRomDesc[] = { - { "587-j02.18b", 0x10000, 0xf68ee99a, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "587-j05.18c", 0x10000, 0x72c16128, 1 | BRF_PRG | BRF_ESS }, // 1 - { "587-c03.17b", 0x20000, 0xe5caf6e6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "587-c06.17c", 0x20000, 0xc2f567ea, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "587-d09.11j", 0x08000, 0x5020972c, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "587-d08.8g", 0x04000, 0xf9ac6b82, 4 | BRF_SND }, // 5 VLM5030 Samples - - { "587-c01.10a", 0x20000, 0x09fe0632, 5 | BRF_SND }, // 6 K007232 Samples -}; - -STD_ROM_PICK(salamandj) -STD_ROM_FN(salamandj) - -struct BurnDriver BurnDrvSalamandj = { - "salamandj", "salamand", NULL, NULL, "1986", - "Salamander (version J)\0", NULL, "Konami", "GX587", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, salamandjRomInfo, salamandjRomName, NULL, NULL, SalamandInputInfo, SalamandDIPInfo, - SalamandInit, DrvExit, SalamandFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Lifeforce (US) - -static struct BurnRomInfo lifefrceRomDesc[] = { - { "587-k02.18b", 0x10000, 0x4a44da18, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "587-k05.18c", 0x10000, 0x2f8c1cbd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "587-c03.17b", 0x20000, 0xe5caf6e6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "587-c06.17c", 0x20000, 0xc2f567ea, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "587-k09.11j", 0x08000, 0x2255fe8c, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "587-k08.8g", 0x04000, 0x7f0e9b41, 4 | BRF_SND }, // 5 VLM5030 Samples - - { "587-c01.10a", 0x20000, 0x09fe0632, 5 | BRF_SND }, // 6 K007232 Samples -}; - -STD_ROM_PICK(lifefrce) -STD_ROM_FN(lifefrce) - -struct BurnDriver BurnDrvLifefrce = { - "lifefrce", "salamand", NULL, NULL, "1986", - "Lifeforce (US)\0", NULL, "Konami", "GX587", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, lifefrceRomInfo, lifefrceRomName, NULL, NULL, SalamandInputInfo, SalamandDIPInfo, - SalamandInit, DrvExit, SalamandFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Lifeforce (Japan) - -static struct BurnRomInfo lifefrcejRomDesc[] = { - { "587-n02.18b", 0x10000, 0x235dba71, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "587-n05.18c", 0x10000, 0x054e569f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "587-n03.17b", 0x20000, 0x9041f850, 1 | BRF_PRG | BRF_ESS }, // 2 - { "587-n06.17c", 0x20000, 0xfba8b6aa, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "587-n09.11j", 0x08000, 0xe8496150, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "587-k08.8g", 0x04000, 0x7f0e9b41, 4 | BRF_SND }, // 5 VLM5030 Samples - - { "587-c01.10a", 0x20000, 0x09fe0632, 5 | BRF_SND }, // 6 K007232 Samples -}; - -STD_ROM_PICK(lifefrcej) -STD_ROM_FN(lifefrcej) - -struct BurnDriver BurnDrvLifefrcej = { - "lifefrcej", "salamand", NULL, NULL, "1987", - "Lifeforce (Japan)\0", NULL, "Konami", "GX587", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, lifefrcejRomInfo, lifefrcejRomName, NULL, NULL, SalamandInputInfo, LifefrcjDIPInfo, - SalamandInit, DrvExit, SalamandFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// TwinBee (ROM version) - -static struct BurnRomInfo twinbeeRomDesc[] = { - { "400-a06.15l", 0x08000, 0xb99d8cff, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "400-a04.10l", 0x08000, 0xd02c9552, 1 | BRF_PRG | BRF_ESS }, // 1 - { "412-a07.17l", 0x20000, 0xd93c5499, 1 | BRF_PRG | BRF_ESS }, // 2 - { "412-a05.12l", 0x20000, 0x2b357069, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "400-e03.5l", 0x02000, 0xa5a8e57d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "400-a01.fse", 0x00100, 0x5827b1e8, 3 | BRF_SND }, // 5 K005289 Samples - { "400-a02.fse", 0x00100, 0x2f44f970, 3 | BRF_SND }, // 6 -}; - -STD_ROM_PICK(twinbee) -STD_ROM_FN(twinbee) - -struct BurnDriver BurnDrvTwinbee = { - "twinbee", NULL, NULL, NULL, "1985", - "TwinBee (ROM version)\0", NULL, "Konami", "GX412", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0, - NULL, twinbeeRomInfo, twinbeeRomName, NULL, NULL, TwinbeeInputInfo, TwinbeeDIPInfo, - Gx400Init, DrvExit, Gx400Frame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Gradius (Japan, ROM version) - -static struct BurnRomInfo gradiusRomDesc[] = { - { "400-a06.15l", 0x08000, 0xb99d8cff, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "400-a04.10l", 0x08000, 0xd02c9552, 1 | BRF_PRG | BRF_ESS }, // 1 - { "456-a07.17l", 0x20000, 0x92df792c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "456-a05.12l", 0x20000, 0x5cafb263, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "400-e03.5l", 0x02000, 0xa5a8e57d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "400-a01.fse", 0x00100, 0x5827b1e8, 3 | BRF_SND }, // 5 K005289 Samples - { "400-a02.fse", 0x00100, 0x2f44f970, 3 | BRF_SND }, // 6 -}; - -STD_ROM_PICK(gradius) -STD_ROM_FN(gradius) - -struct BurnDriver BurnDrvGradius = { - "gradius", "nemesis", NULL, NULL, "1985", - "Gradius (Japan, ROM version)\0", NULL, "Konami", "GX456", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, gradiusRomInfo, gradiusRomName, NULL, NULL, GradiusInputInfo, GradiusDIPInfo, - Gx400Init, DrvExit, Gx400Frame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Galactic Warriors - -static struct BurnRomInfo gwarriorRomDesc[] = { - { "400-a06.15l", 0x08000, 0xb99d8cff, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "400-a04.10l", 0x08000, 0xd02c9552, 1 | BRF_PRG | BRF_ESS }, // 1 - { "578-a07.17l", 0x20000, 0x0aedacb5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "578-a05.12l", 0x20000, 0x76240e2e, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "400-e03.5l", 0x02000, 0xa5a8e57d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "400-a01.fse", 0x00100, 0x5827b1e8, 3 | BRF_SND }, // 5 K005289 Samples - { "400-a02.fse", 0x00100, 0x2f44f970, 3 | BRF_SND }, // 6 -}; - -STD_ROM_PICK(gwarrior) -STD_ROM_FN(gwarrior) - -struct BurnDriver BurnDrvGwarrior = { - "gwarrior", NULL, NULL, NULL, "1985", - "Galactic Warriors\0", NULL, "Konami", "GX578", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_VSFIGHT, 0, - NULL, gwarriorRomInfo, gwarriorRomName, NULL, NULL, GwarriorInputInfo, GwarriorDIPInfo, - Gx400Init, DrvExit, Gx400Frame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Konami RF2 - Red Fighter - -static struct BurnRomInfo rf2RomDesc[] = { - { "400-a06.15l", 0x08000, 0xb99d8cff, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "400-a04.10l", 0x08000, 0xd02c9552, 1 | BRF_PRG | BRF_ESS }, // 1 - { "561-a07.17l", 0x20000, 0xed6e7098, 1 | BRF_PRG | BRF_ESS }, // 2 - { "561-a05.12l", 0x20000, 0xdfe04425, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "400-e03.5l", 0x02000, 0xa5a8e57d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "400-a01.fse", 0x00100, 0x5827b1e8, 3 | BRF_SND }, // 5 K005289 Samples - { "400-a02.fse", 0x00100, 0x2f44f970, 3 | BRF_SND }, // 6 -}; - -STD_ROM_PICK(rf2) -STD_ROM_FN(rf2) - -struct BurnDriver BurnDrvRf2 = { - "rf2", "konamigt", NULL, NULL, "1985", - "Konami RF2 - Red Fighter\0", NULL, "Konami", "GX561", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_RACING, 0, - NULL, rf2RomInfo, rf2RomName, NULL, NULL, KonamigtInputInfo, KonamigtDIPInfo, - Rf2_gx400Init, DrvExit, Gx400Frame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Black Panther - -static struct BurnRomInfo blkpnthrRomDesc[] = { - { "604-f02.18b", 0x10000, 0x487bf8da, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "604-f05.18c", 0x10000, 0xb08f8ca2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "604-c03.17b", 0x20000, 0x815bc3b0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "604-c06.17c", 0x20000, 0x4af6bf7f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "604-a08.11j", 0x08000, 0xaff88a2b, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "604-a01.10a", 0x20000, 0xeceb64a6, 5 | BRF_SND }, // 5 K007232 Samples -}; - -STD_ROM_PICK(blkpnthr) -STD_ROM_FN(blkpnthr) - -struct BurnDriver BurnDrvBlkpnthr = { - "blkpnthr", NULL, NULL, NULL, "1987", - "Black Panther\0", NULL, "Konami", "GX604", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, blkpnthrRomInfo, blkpnthrRomName, NULL, NULL, BlkpnthrInputInfo, BlkpnthrDIPInfo, - BlkpnthrInit, DrvExit, BlkpnthrFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// City Bomber (World) - -static struct BurnRomInfo citybombRomDesc[] = { - { "787-g10.15k", 0x10000, 0x26207530, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "787-g09.15h", 0x10000, 0xce7de262, 1 | BRF_PRG | BRF_ESS }, // 1 - { "787-g08.15f", 0x20000, 0x6242ef35, 1 | BRF_PRG | BRF_ESS }, // 2 - { "787-g07.15d", 0x20000, 0x21be5e9e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "787-e06.14f", 0x20000, 0xc251154a, 1 | BRF_PRG | BRF_ESS }, // 4 - { "787-e05.14d", 0x20000, 0x0781e22d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "787-g04.13f", 0x20000, 0x137cf39f, 1 | BRF_PRG | BRF_ESS }, // 6 - { "787-g03.13d", 0x20000, 0x0cc704dc, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "787-e02.4h", 0x08000, 0xf4591e46, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "787-e01.1k", 0x80000, 0xedc34d01, 5 | BRF_SND }, // 9 K007232 Samples -}; - -STD_ROM_PICK(citybomb) -STD_ROM_FN(citybomb) - -struct BurnDriver BurnDrvCitybomb = { - "citybomb", NULL, NULL, NULL, "1987", - "City Bomber (World)\0", NULL, "Konami", "GX787", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_KONAMI_68K_Z80, GBF_SHOOT, 0, - NULL, citybombRomInfo, citybombRomName, NULL, NULL, CitybombInputInfo, CitybombDIPInfo, - CitybombInit, DrvExit, CitybombFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// City Bomber (Japan) - -static struct BurnRomInfo citybombjRomDesc[] = { - { "787-h10.15k", 0x10000, 0x66fecf69, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "787-h09.15h", 0x10000, 0xa0e29468, 1 | BRF_PRG | BRF_ESS }, // 1 - { "787-g08.15f", 0x20000, 0x6242ef35, 1 | BRF_PRG | BRF_ESS }, // 2 - { "787-g07.15d", 0x20000, 0x21be5e9e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "787-e06.14f", 0x20000, 0xc251154a, 1 | BRF_PRG | BRF_ESS }, // 4 - { "787-e05.14d", 0x20000, 0x0781e22d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "787-g04.13f", 0x20000, 0x137cf39f, 1 | BRF_PRG | BRF_ESS }, // 6 - { "787-g03.13d", 0x20000, 0x0cc704dc, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "787-e02.4h", 0x08000, 0xf4591e46, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "787-e01.1k", 0x80000, 0xedc34d01, 5 | BRF_SND }, // 9 K007232 Samples -}; - -STD_ROM_PICK(citybombj) -STD_ROM_FN(citybombj) - -struct BurnDriver BurnDrvCitybombj = { - "citybombj", "citybomb", NULL, NULL, "1987", - "City Bomber (Japan)\0", NULL, "Konami", "GX787", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_KONAMI_68K_Z80, GBF_SHOOT, 0, - NULL, citybombjRomInfo, citybombjRomName, NULL, NULL, CitybombInputInfo, CitybombDIPInfo, - CitybombInit, DrvExit, CitybombFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Kitten Kaboodle - -static struct BurnRomInfo kittenkRomDesc[] = { - { "kitten.15k", 0x10000, 0x8267cb2b, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "kitten.15h", 0x10000, 0xeb41cfa5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "712-b08.15f", 0x20000, 0xe6d71611, 1 | BRF_PRG | BRF_ESS }, // 2 - { "712-b07.15d", 0x20000, 0x30f75c9f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "712-e02.4h", 0x08000, 0xba76f310, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "712-b01.1k", 0x80000, 0xf65b5d95, 5 | BRF_SND }, // 5 K007232 Samples -}; - -STD_ROM_PICK(kittenk) -STD_ROM_FN(kittenk) - -struct BurnDriver BurnDrvKittenk = { - "kittenk", NULL, NULL, NULL, "1988", - "Kitten Kaboodle\0", NULL, "Konami", "GX712", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_PUZZLE, 0, - NULL, kittenkRomInfo, kittenkRomName, NULL, NULL, NyanpaniInputInfo, NyanpaniDIPInfo, - NyanpaniInit, DrvExit, CitybombFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Nyan Nyan Panic (Japan) - -static struct BurnRomInfo nyanpaniRomDesc[] = { - { "712-j10.15k", 0x10000, 0x924b27ec, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "712-j09.15h", 0x10000, 0xa9862ea1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "712-b08.15f", 0x20000, 0xe6d71611, 1 | BRF_PRG | BRF_ESS }, // 2 - { "712-b07.15d", 0x20000, 0x30f75c9f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "712-e02.4h", 0x08000, 0xba76f310, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "712-b01.1k", 0x80000, 0xf65b5d95, 5 | BRF_SND }, // 5 K007232 Samples -}; - -STD_ROM_PICK(nyanpani) -STD_ROM_FN(nyanpani) - -struct BurnDriver BurnDrvNyanpani = { - "nyanpani", "kittenk", NULL, NULL, "1988", - "Nyan Nyan Panic (Japan)\0", NULL, "Konami", "GX712", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PUZZLE, 0, - NULL, nyanpaniRomInfo, nyanpaniRomName, NULL, NULL, NyanpaniInputInfo, NyanpaniDIPInfo, - NyanpaniInit, DrvExit, CitybombFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Hyper Crash (version D) - -static struct BurnRomInfo hcrashRomDesc[] = { - { "790-d03.t9", 0x08000, 0x10177dce, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "790-d06.t7", 0x08000, 0xfca5ab3e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "790-c02.s9", 0x10000, 0x8ae6318f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "790-c05.s7", 0x10000, 0xc214f77b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "790-c09.n2", 0x08000, 0xa68a8cce, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "790-c08.j4", 0x08000, 0xcfb844bc, 4 | BRF_SND }, // 5 VLM5030 Samples - - { "790-c01.m10", 0x20000, 0x07976bc3, 5 | BRF_SND }, // 6 K007232 Samples -}; - -STD_ROM_PICK(hcrash) -STD_ROM_FN(hcrash) - -struct BurnDriver BurnDrvHcrash = { - "hcrash", NULL, NULL, NULL, "1987", - "Hyper Crash (version D)\0", NULL, "Konami", "GX790", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_RACING, 0, - NULL, hcrashRomInfo, hcrashRomName, NULL, NULL, HcrashInputInfo, HcrashDIPInfo, - HcrashInit, DrvExit, HcrashFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Hyper Crash (version C) - -static struct BurnRomInfo hcrashcRomDesc[] = { - { "790-c03.t9", 0x08000, 0xd98ec625, 1 | BRF_PRG | BRF_ESS }, // 0 m68000 Code - { "790-c06.t7", 0x08000, 0x1d641a86, 1 | BRF_PRG | BRF_ESS }, // 1 - { "790-c02.s9", 0x10000, 0x8ae6318f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "790-c05.s7", 0x10000, 0xc214f77b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "790-c09.n2", 0x08000, 0xa68a8cce, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "790-c08.j4", 0x08000, 0xcfb844bc, 4 | BRF_SND }, // 5 VLM5030 Samples - - { "790-c01.m10", 0x20000, 0x07976bc3, 5 | BRF_SND }, // 6 K007232 Samples -}; - -STD_ROM_PICK(hcrashc) -STD_ROM_FN(hcrashc) - -struct BurnDriver BurnDrvHcrashc = { - "hcrashc", "hcrash", NULL, NULL, "1987", - "Hyper Crash (version C)\0", NULL, "Konami", "GX790", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_RACING, 0, - NULL, hcrashcRomInfo, hcrashcRomName, NULL, NULL, HcrashInputInfo, HcrashDIPInfo, - HcrashInit, DrvExit, HcrashFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_pandoras.cpp b/jan/src/burn/drv/konami/d_pandoras.cpp deleted file mode 100644 index f69bf7b8c..000000000 --- a/jan/src/burn/drv/konami/d_pandoras.cpp +++ /dev/null @@ -1,827 +0,0 @@ -// FB Alpha Pandora's Palace driver module -// Based on MAME driver by Manuel Abadia - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "z80_intf.h" -#include "i8039.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvSubROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvI8039ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprRAM; - -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 soundlatch; -static UINT8 soundlatch2; -static UINT8 i8039_status; - -static UINT8 flipscreen; -static UINT8 scrolly; - -static UINT8 irq_enable[2]; -static UINT8 firq_trigger[2]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 watchdog; - -static struct BurnInputInfo PandorasInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Pandoras) - -static struct BurnDIPInfo PandorasDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x5b, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - {0x11, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x00, "Upright" }, - {0x11, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x18, 0x18, "20k and every 60k" }, - {0x11, 0x01, 0x18, 0x10, "30k and every 70k" }, - {0x11, 0x01, 0x18, 0x08, "20k" }, - {0x11, 0x01, 0x18, 0x00, "30k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x60, 0x60, "Easy" }, - {0x11, 0x01, 0x60, 0x40, "Normal" }, - {0x11, 0x01, 0x60, 0x20, "Difficult" }, - {0x11, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, -}; - -STDDIPINFO(Pandoras) - -static void interrupt_control(INT32 offset, UINT8 data, INT32 cpu) -{ - switch (offset & 0x07) - { - case 0x00: - { - if (data == 0) { - M6809Close(); - M6809Open(0); - M6809SetIRQLine(CPU_IRQLINE_IRQ, CPU_IRQSTATUS_NONE); - M6809Close(); - M6809Open(cpu); - } - irq_enable[0] = data; - } - return; - - case 0x02: - case 0x03: - // coin counters, data & 0x01 - return; - - case 0x05: - flipscreen = data; - return; - - case 0x06: - { - if (data == 0) { - M6809Close(); - M6809Open(1); - M6809SetIRQLine(CPU_IRQLINE_IRQ, CPU_IRQSTATUS_NONE); - M6809Close(); - M6809Open(cpu); - } - irq_enable[1] = data; - } - - case 0x07: - { - return; // disable NMI. Why??? - - M6809Close(); - M6809Open(1); - M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - M6809Close(); - M6809Open(cpu); - } - return; - } -} - -static void pandoras_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff8) == 0x1800) { - interrupt_control(address, data, 0); - return; - } - - switch (address) - { - case 0x1a00: - scrolly = data; - return; - - case 0x1c00: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x1e00: - soundlatch = data; - return; - - case 0x2000: - if (!firq_trigger[1] && data) { - M6809Close(); - M6809Open(1); - M6809SetIRQLine(CPU_IRQLINE_FIRQ, CPU_IRQSTATUS_AUTO); - M6809Close(); - M6809Open(0); - } - firq_trigger[1] = data; - return; - - case 0x2001: - watchdog = 0; - return; - } -} - -static void pandoras_sub_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff8) == 0x1800) { - interrupt_control(address, data, 1); - return; - } - - switch (address) - { - case 0x8000: - watchdog = 0; - return; - - case 0xa000: - if (!firq_trigger[0] && data) { - M6809Close(); - M6809Open(0); - M6809SetIRQLine(CPU_IRQLINE_FIRQ, CPU_IRQSTATUS_AUTO); - M6809Close(); - M6809Open(1); - } - firq_trigger[0] = data; - return; - } -} - -static UINT8 pandoras_sub_read(UINT16 address) -{ - switch (address) - { - case 0x1800: - return DrvDips[0]; - - case 0x1a00: - case 0x1a01: - case 0x1a02: - return DrvInputs[address & 3]; - - case 0x1a03: - return DrvDips[2]; - - case 0x1c00: - return DrvDips[1]; - - case 0x1e00: - return 0; - } - - return 0; -} - -static void __fastcall pandoras_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x6000: - case 0x6002: - AY8910Write(0, (address / 2) & 1, data); - return; - - case 0x8000: - I8039SetIrqState(CPU_IRQSTATUS_ACK); - return; - - case 0xa000: - soundlatch2 = data; - return; - } -} - -static UINT8 __fastcall pandoras_sound_read(UINT16 address) -{ - switch (address) - { - case 0x4000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - - case 0x6001: - return AY8910Read(0); - } - - return 0; -} - -static UINT8 __fastcall pandoras_i8039_read(UINT32 address) -{ - return DrvI8039ROM[address & 0x0fff]; -} - -static UINT8 __fastcall pandoras_i8039_read_port(UINT32 port) -{ - if ((port & 0x1ff) < 0x100) { - return soundlatch2; - } - - return 0; -} - -static void __fastcall pandoras_i8039_write_port(UINT32 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case I8039_p1: - DACWrite(0, data); - return; - - case I8039_p2: - if ((data & 0x80) == 0) { - I8039SetIrqState(CPU_IRQSTATUS_NONE); - } - i8039_status = (data >> 5) & 1; - return; - } -} - -static UINT8 AY8910_0_port_A_Read(UINT32) -{ - return i8039_status; -} - -static UINT8 AY8910_0_port_B_Read(UINT32) -{ - if (ZetGetActive() == -1) return 0; - - return (ZetTotalCycles() / 512) & 0xf; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (1789772.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - AY8910Reset(0); - ZetClose(); - - I8039Reset(); - - DACReset(); - - scrolly = 0; - flipscreen = 0; - - irq_enable[0] = 0; - irq_enable[1] = 0; - firq_trigger[0] = 0; - firq_trigger[1] = 0; - - soundlatch = 0; - soundlatch2 = 0; - i8039_status = 0; - - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x008000; - DrvSubROM = Next; Next += 0x002000; - DrvZ80ROM = Next; Next += 0x002000; - DrvI8039ROM = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x00c000; - DrvGfxROM1 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000220; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvShareRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001000; - DrvColRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvZ80RAM = Next; Next += 0x000400; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pens[32]; - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = bit2 * 151 + bit1 * 71 + bit0 * 33; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = bit2 * 151 + bit1 * 71 + bit0 * 33; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = bit1 * 174 + bit0 * 81; - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) { - DrvPalette[i] = pens[(DrvColPROM[i+0x020] & 0x0f) | ((i&0x100)>>4)]; - } -} - -static void DrvGfxExpand(UINT8 *rom, UINT32 len) -{ - for (INT32 i = len-1; i >= 0; i--) { - rom[i*2+0] = rom[i] >> 4; - rom[i*2+1] = rom[i] & 0xf; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSubROM + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvI8039ROM + 0x0000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 14, 1)) return 1; - - DrvGfxExpand(DrvGfxROM0, 0x6000); - DrvGfxExpand(DrvGfxROM1, 0x4000); - DrvPaletteInit(); - } - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvSprRAM, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x1000, 0x13ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x1400, 0x17ff, MAP_RAM); -// M6809MapMemory(DrvMainROM + 0x8000, 0x4000, 0x5fff, MAP_ROM); - M6809MapMemory(DrvShareRAM, 0x6000, 0x67ff, MAP_RAM); - M6809MapMemory(DrvMainROM, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(pandoras_main_write); -// M6809SetReadHandler(pandoras_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvSprRAM, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x1000, 0x13ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x1400, 0x17ff, MAP_RAM); - M6809MapMemory(DrvShareRAM, 0xc000, 0xc7ff, MAP_RAM); - M6809MapMemory(DrvSubROM, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(pandoras_sub_write); - M6809SetReadHandler(pandoras_sub_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x2000, 0x23ff, MAP_RAM); - ZetSetWriteHandler(pandoras_sound_write); - ZetSetReadHandler(pandoras_sound_read); - ZetClose(); - - I8039Init(NULL); - I8039SetProgramReadHandler(pandoras_i8039_read); - I8039SetCPUOpReadHandler(pandoras_i8039_read); - I8039SetCPUOpReadArgHandler(pandoras_i8039_read); - I8039SetIOReadHandler(pandoras_i8039_read_port); - I8039SetIOWriteHandler(pandoras_i8039_write_port); - - AY8910Init(0, 1789772, nBurnSoundRate, &AY8910_0_port_A_Read, &AY8910_0_port_B_Read, NULL, NULL); - AY8910SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - ZetExit(); - I8039Exit(); - - AY8910Exit(0); - DACExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(INT32 priority) -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 attr = DrvColRAM[offs]; - INT32 prio = (attr >> 5) & 1; - if (prio != priority) continue; - - INT32 code = DrvVidRAM[offs] + ((attr & 0x10) << 4); - INT32 color = attr & 0x0f; - INT32 flipy = attr & 0x80; - INT32 flipx = attr & 0x40; - - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = ((offs / 32) * 8) - scrolly; - - if (sy < -7) sy += 256; - - if (flipscreen) - { - sy = 248 - sy; - sx = 248 - sx; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0x100, DrvGfxROM1); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - INT32 sx = DrvSprRAM[0x800 + offs + 1]; - INT32 sy = 240 - DrvSprRAM[0x800 + offs]; - INT32 color = DrvSprRAM[0x800 + offs + 3] & 0x0f; - INT32 flipx = DrvSprRAM[0x800 + offs + 3] & 0x40; - INT32 flipy = DrvSprRAM[0x800 + offs + 3] & 0x80; - INT32 code = DrvSprRAM[0x800 + offs + 2]; - - RenderTileTranstab(pTransDraw, DrvGfxROM0, code, color * 16, 0, sx, sy - 16, flipx, flipy, 16, 16, DrvColPROM + 0x020); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(1); - draw_sprites(); - draw_layer(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - // bprintf (0, _T("Watchdog triggered!\n")); - } - - if (DrvReset) { - DrvDoReset(1); - } - - M6809NewFrame(); - ZetNewFrame(); - I8039NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 100; - INT32 nCyclesTotal[4] = { 3072000 / 60, 3072000 / 60, 1789772 / 60, 477272 / 60 }; - INT32 nCyclesDone[4] = { 0, 0, 0, 0 }; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - INT32 nSegment = (nCyclesTotal[0] * (i + 1)) / nInterleave; - nCyclesDone[0] += M6809Run(nSegment - nCyclesDone[0]); - if (i == (nInterleave - 1) && irq_enable[0]) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - nSegment = M6809TotalCycles(); - M6809Close(); - - M6809Open(1); - nCyclesDone[1] += M6809Run(nSegment - M6809TotalCycles()); - if (i == (nInterleave - 1) && irq_enable[1]) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - - nSegment = (nCyclesTotal[2] * (i + 1)) / nInterleave; - nCyclesDone[2] += ZetRun(nSegment - nCyclesDone[2]); - - nSegment = (nCyclesTotal[3] * (i + 1)) / nInterleave; - nCyclesDone[3] += I8039Run(nSegment - nCyclesDone[3]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - ZetScan(nAction); - I8039Scan(nAction,pnMin); - - AY8910Scan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(soundlatch2); - SCAN_VAR(flipscreen); - SCAN_VAR(scrolly); - - SCAN_VAR(irq_enable[0]); - SCAN_VAR(irq_enable[1]); - SCAN_VAR(firq_trigger[0]); - SCAN_VAR(firq_trigger[1]); - } - - return 0; -} - - -// Pandora's Palace - -static struct BurnRomInfo pandorasRomDesc[] = { - { "pand_j13.cpu", 0x2000, 0x7a0fe9c5, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "pand_j12.cpu", 0x2000, 0x7dc4bfe1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pand_j10.cpu", 0x2000, 0xbe3af3b7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pand_j9.cpu", 0x2000, 0xe674a17a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "pand_j5.cpu", 0x2000, 0x4aab190b, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - - { "pand_6c.snd", 0x2000, 0x0c1f109d, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "pand_7e.snd", 0x2000, 0x1071c1ba, 4 | BRF_GRA }, // 6 i8039 Code - - { "pand_j18.cpu", 0x2000, 0x99a696c5, 5 | BRF_GRA }, // 7 Sprites - { "pand_j17.cpu", 0x2000, 0x38a03c21, 5 | BRF_GRA }, // 8 - { "pand_j16.cpu", 0x2000, 0xe0708a78, 5 | BRF_GRA }, // 9 - - { "pand_a18.cpu", 0x2000, 0x23706d4a, 6 | BRF_GRA }, // 10 Characters - { "pand_a19.cpu", 0x2000, 0xa463b3f9, 6 | BRF_GRA }, // 11 - - { "pandora.2a", 0x0020, 0x4d56f939, 7 | BRF_GRA }, // 12 Color PROMs - { "pandora.17g", 0x0100, 0xc1a90cfc, 7 | BRF_GRA }, // 13 - { "pandora.16b", 0x0100, 0xc89af0c3, 7 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(pandoras) -STD_ROM_FN(pandoras) - -struct BurnDriver BurnDrvPandoras = { - "pandoras", NULL, NULL, NULL, "1984", - "Pandora's Palace\0", NULL, "Konami / Interlogic", "GX328", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, pandorasRomInfo, pandorasRomName, NULL, NULL, PandorasInputInfo, PandorasDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_parodius.cpp b/jan/src/burn/drv/konami/d_parodius.cpp deleted file mode 100644 index c27207625..000000000 --- a/jan/src/burn/drv/konami/d_parodius.cpp +++ /dev/null @@ -1,741 +0,0 @@ -// FB Alpha Parodius Da! driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "k053260.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvBankRAM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *nDrvRomBank; - -static INT32 layer_colorbase[3]; -static INT32 sprite_colorbase; -static INT32 layerpri[3]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static INT32 nCyclesDone[2]; - -static struct BurnInputInfo ParodiusInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 1, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Diagnostics", BIT_DIGITAL, DrvJoy3 + 1, "diag" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Parodius) - -static struct BurnDIPInfo ParodiusDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x5a, NULL }, - {0x17, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x15, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x03, "2" }, - {0x16, 0x01, 0x03, 0x02, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "7" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x16, 0x01, 0x04, 0x00, "Upright" }, -// {0x16, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x18, 0x18, "20000 80000" }, - {0x16, 0x01, 0x18, 0x10, "30000 100000" }, - {0x16, 0x01, 0x18, 0x08, "20000" }, - {0x16, 0x01, 0x18, 0x00, "70000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x60, 0x60, "Easy" }, - {0x16, 0x01, 0x60, 0x40, "Normal" }, - {0x16, 0x01, 0x60, 0x20, "Difficult" }, - {0x16, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x17, 0x01, 0x10, 0x10, "Off" }, -// {0x17, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x17, 0x01, 0x20, 0x20, "Single" }, - {0x17, 0x01, 0x20, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Parodius) - -void parodius_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3fc0: - K052109RMRDLine = data & 0x08; - return; - - case 0x3fc4: - nDrvRomBank[1] = data; - return; - - case 0x3fc8: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x3fcc: - case 0x3fcd: - K053260Write(0, address & 1, data); - return; - } - - if ((address & 0xf800) == 0x0000) { - if (nDrvRomBank[1] & 1) { - DrvPalRAM[((nDrvRomBank[1] & 0x04) << 9) + address] = data; - } else { - DrvBankRAM[address] = data; - } - return; - } - - if ((address & 0xfff0) == 0x3fa0) { - K053244Write(0, address & 0x0f, data); - return; - } - - if ((address & 0xfff0) == 0x3fb0) { - K053251Write(address & 0x0f, data); - return; - } - - if ((address & 0xf800) == 0x2000) { - if (nDrvRomBank[1] & 0x02) { - K053245Write(0, address & 0x7ff, data); - return; - } - } - - if (address >= 0x2000 && address <= 0x5fff) { - K052109Write(address - 0x2000, data); - } -} - -UINT8 parodius_main_read(UINT16 address) -{ - switch (address) - { - case 0x3f8c: - return DrvInputs[0]; - - case 0x3f8d: - return DrvInputs[1]; - - case 0x3f8e: - return (DrvDips[2] & 0xf0) | (DrvInputs[2] & 0x0f); - - case 0x3f8f: - return DrvDips[0]; - - case 0x3f90: - return DrvDips[1]; - - case 0x3fc0: // watchdog - return 0; - - case 0x3fcc: - case 0x3fcd: - return K053260Read(0, (address & 1)+2); - } - - if ((address & 0xf800) == 0x0000) { - if (nDrvRomBank[1] & 1) { - return DrvPalRAM[((nDrvRomBank[1] & 0x04) << 9) + address]; - } else { - return DrvBankRAM[address]; - } - } - - if ((address & 0xfff0) == 0x3fa0) { - return K053244Read(0, address & 0x0f); - } - - if ((address & 0xf800) == 0x2000) { - if (nDrvRomBank[1] & 0x02) { - return K053245Read(0, address & 0x7ff); - } - } - - if (address >= 0x2000 && address <= 0x5fff) { - return K052109Read(address - 0x2000); - } - - return 0; -} - -void __fastcall parodius_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf800: - BurnYM2151SelectRegister(data); - return; - - case 0xf801: - BurnYM2151WriteRegister(data); - return; - - case 0xfa00: - nCyclesDone[1] += ZetRun(100); - ZetNmi(); - return; - } - - if (address >= 0xfc00 && address <= 0xfc2f) { - K053260Write(0, address & 0x3f, data); - } -} - -UINT8 __fastcall parodius_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return 0xff; - case 0xf801: - return BurnYM2151ReadStatus(); - } - - if (address >= 0xfc00 && address <= 0xfc2f) { - if ((address & 0x3e) == 0x00) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - - return K053260Read(0, address & 0x3f); - } - - return 0; -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *flags, INT32 *) -{ - *flags = (*color & 0x80) >> 7; - *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); - *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5); -} - -static void K053245Callback(INT32 *code, INT32 *color, INT32 *priority) -{ - INT32 pri = 0x20 | ((*color & 0x60) >> 2); - if (pri <= layerpri[2]) *priority = 0x00; - else if (pri > layerpri[2] && pri <= layerpri[1]) *priority = 0xf0; - else if (pri > layerpri[1] && pri <= layerpri[0]) *priority = 0xfc; - else *priority = 0xfe; - - *code &= 0x1fff; - *color = sprite_colorbase + (*color & 0x1f); -} - -static void parodius_set_lines(INT32 lines) -{ - nDrvRomBank[0] = lines; - - konamiMapMemory(DrvKonROM + 0x10000 + ((~lines & 0x0f) * 0x4000), 0x6000, 0x9fff, MAP_ROM); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - K053260Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x050000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROMExp0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROMExp1 = Next; Next += 0x200000; - - DrvSndROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - DrvBankRAM = Next; Next += 0x000800; - DrvKonRAM = Next; Next += 0x001800; - DrvPalRAM = Next; Next += 0x001000; - - DrvZ80RAM = Next; Next += 0x000800; - - nDrvRomBank = Next; Next += 0x000002; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x010000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x030000, 1, 1)) return 1; - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x48000, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 4, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 7, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x100000); - K053245GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x100000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonRAM, 0x0800, 0x1fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x6000, 0x9fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x0a000, 0xa000, 0xffff, MAP_ROM); - konamiSetWriteHandler(parodius_main_write); - konamiSetReadHandler(parodius_main_read); - konamiSetlinesCallback(parodius_set_lines); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(parodius_sound_write); - ZetSetReadHandler(parodius_sound_read); - ZetClose(); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0xfffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(8, 0); - - K053245Init(0, DrvGfxROM1, DrvGfxROMExp1, 0xfffff, K053245Callback); - K053245SetSpriteOffset(0, -112, -16); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K053260Init(0, 3579545, DrvSndROM, 0x80000); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.70, BURN_SND_ROUTE_LEFT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.70, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - BurnYM2151Exit(); - K053260Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x1000); - - K052109UpdateScroll(); - - INT32 bg_colorbase, layer[3]; - - bg_colorbase = K053251GetPaletteIndex(0); - sprite_colorbase = K053251GetPaletteIndex(1); - layer_colorbase[0] = K053251GetPaletteIndex(2); - layer_colorbase[1] = K053251GetPaletteIndex(4); - layer_colorbase[2] = K053251GetPaletteIndex(3); - - layerpri[0] = K053251GetPriority(2); - layerpri[1] = K053251GetPriority(4); - layerpri[2] = K053251GetPriority(3); - layer[0] = 0; - layer[1] = 1; - layer[2] = 2; - - konami_sortlayers3(layer,layerpri); - - KonamiClearBitmaps(DrvPalette[16 * bg_colorbase]); - - if (nBurnLayer & 1) K052109RenderLayer(layer[0], 0, 1); - if (nBurnLayer & 2) K052109RenderLayer(layer[1], 0, 2); - if (nBurnLayer & 4) K052109RenderLayer(layer[2], 0, 4); - - if (nSpriteEnable & 1) K053245SpritesRender(0); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - konamiNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[0] & 0x06) == 0) DrvInputs[0] |= 0x06; - if ((DrvInputs[0] & 0x18) == 0) DrvInputs[0] |= 0x18; - if ((DrvInputs[1] & 0x06) == 0) DrvInputs[1] |= 0x06; - if ((DrvInputs[1] & 0x18) == 0) DrvInputs[1] |= 0x18; - } - - INT32 nInterleave = nBurnSoundLen; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 3000000 / 60, 3579545 / 60 }; - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = konamiRun(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K052109_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - - KonamiICScan(nAction); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - parodius_set_lines(nDrvRomBank[0]); - konamiClose(); - } - - return 0; -} - - -// Parodius DA! (World, set 1) - -static struct BurnRomInfo parodiusRomDesc[] = { - { "955l01.f5", 0x20000, 0x49a658eb, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "955l02.h5", 0x20000, 0x161d7322, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "955e03.d14", 0x10000, 0x940aa356, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "955d07.k19", 0x80000, 0x89473fec, 3 | BRF_GRA }, // 3 Background Tiles - { "955d08.k24", 0x80000, 0x43d5cda1, 3 | BRF_GRA }, // 4 - - { "955d05.k13", 0x80000, 0x7a1e55e0, 4 | BRF_GRA }, // 5 Sprites - { "955d06.k8", 0x80000, 0xf4252875, 4 | BRF_GRA }, // 6 - - { "955d04.c5", 0x80000, 0xe671491a, 5 | BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(parodius) -STD_ROM_FN(parodius) - -struct BurnDriver BurnDrvParodius = { - "parodius", NULL, NULL, NULL, "1990", - "Parodius DA! (World, set 1)\0", NULL, "Konami", "GX955", - L"Parodius \u30D1\u30ED\u30C7\u30A3\u30A6\u30B9\u3060\uFF01 \uFF0D\u795E\u8A71\u304B\u3089\u304A\u7B11\u3044\u3078\uFF0D (World, set 1)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, parodiusRomInfo, parodiusRomName, NULL, NULL, ParodiusInputInfo, ParodiusDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Parodius DA! (World, set 2) - -static struct BurnRomInfo parodiuseRomDesc[] = { - { "2.f5", 0x20000, 0x26a6410b, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "3.h5", 0x20000, 0x9410dbf2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "955e03.d14", 0x10000, 0x940aa356, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "955d07.k19", 0x80000, 0x89473fec, 3 | BRF_GRA }, // 3 Background Tiles - { "955d08.k24", 0x80000, 0x43d5cda1, 3 | BRF_GRA }, // 4 - - { "955d05.k13", 0x80000, 0x7a1e55e0, 4 | BRF_GRA }, // 5 Sprites - { "955d06.k8", 0x80000, 0xf4252875, 4 | BRF_GRA }, // 6 - - { "955d04.c5", 0x80000, 0xe671491a, 5 | BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(parodiuse) -STD_ROM_FN(parodiuse) - -struct BurnDriver BurnDrvParodiuse = { - "parodiuse", "parodius", NULL, NULL, "1990", - "Parodius DA! (World, set 2)\0", NULL, "Konami", "GX955", - L"Parodius \u30D1\u30ED\u30C7\u30A3\u30A6\u30B9\u3060\uFF01 \uFF0D\u795E\u8A71\u304B\u3089\u304A\u7B11\u3044\u3078\uFF0D (World, set 2)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, parodiuseRomInfo, parodiuseRomName, NULL, NULL, ParodiusInputInfo, ParodiusDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Parodius DA! (Japan) - -static struct BurnRomInfo parodiusjRomDesc[] = { - { "955e01.f5", 0x20000, 0x49baa334, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "955e02.h5", 0x20000, 0x14010d6f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "955e03.d14", 0x10000, 0x940aa356, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "955d07.k19", 0x80000, 0x89473fec, 3 | BRF_GRA }, // 3 Background Tiles - { "955d08.k24", 0x80000, 0x43d5cda1, 3 | BRF_GRA }, // 4 - - { "955d05.k13", 0x80000, 0x7a1e55e0, 4 | BRF_GRA }, // 5 Sprites - { "955d06.k8", 0x80000, 0xf4252875, 4 | BRF_GRA }, // 6 - - { "955d04.c5", 0x80000, 0xe671491a, 5 | BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(parodiusj) -STD_ROM_FN(parodiusj) - -struct BurnDriver BurnDrvParodiusj = { - "parodiusj", "parodius", NULL, NULL, "1990", - "Parodius DA! (Japan)\0", NULL, "Konami", "GX955", - L"Parodius \u30D1\u30ED\u30C7\u30A3\u30A6\u30B9\u3060\uFF01 \uFF0D\u795E\u8A71\u304B\u3089\u304A\u7B11\u3044\u3078\uFF0D (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, parodiusjRomInfo, parodiusjRomName, NULL, NULL, ParodiusInputInfo, ParodiusDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Parodius DA! (Asia) - -static struct BurnRomInfo parodiusaRomDesc[] = { - { "b-18.f5", 0x20000, 0x006356cd, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "b-19.h5", 0x20000, 0xe5a16417, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "955e03.d14", 0x10000, 0x940aa356, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "955d07.k19", 0x80000, 0x89473fec, 3 | BRF_GRA }, // 3 Background Tiles - { "955d08.k24", 0x80000, 0x43d5cda1, 3 | BRF_GRA }, // 4 - - { "955d05.k13", 0x80000, 0x7a1e55e0, 4 | BRF_GRA }, // 5 Sprites - { "955d06.k8", 0x80000, 0xf4252875, 4 | BRF_GRA }, // 6 - - { "955d04.c5", 0x80000, 0xe671491a, 5 | BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(parodiusa) -STD_ROM_FN(parodiusa) - -struct BurnDriver BurnDrvParodiusa = { - "parodiusa", "parodius", NULL, NULL, "1990", - "Parodius DA! (Asia)\0", NULL, "Konami", "GX955", - L"Parodius \u30D1\u30ED\u30C7\u30A3\u30A6\u30B9\u3060\uFF01 \uFF0D\u795E\u8A71\u304B\u3089\u304A\u7B11\u3044\u3078\uFF0D (Asia)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, parodiusaRomInfo, parodiusaRomName, NULL, NULL, ParodiusInputInfo, ParodiusDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_pingpong.cpp b/jan/src/burn/drv/konami/d_pingpong.cpp deleted file mode 100644 index 2ac7e0623..000000000 --- a/jan/src/burn/drv/konami/d_pingpong.cpp +++ /dev/null @@ -1,916 +0,0 @@ -// FB Alpha Ping Pong driver module -// Based on MAME driver by Jarek Parchanski - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "bitswap.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvBankROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvTransTab; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvNVRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 nmi_enable; -static UINT8 irq_enable; -static UINT8 question_addr_low_data; -static UINT8 question_addr_high_data; -static UINT32 question_addr_high; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; - -static UINT8 DrvInp[5]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static INT32 watchdog; -static INT32 nNMIMask; -static INT32 cashquiz = 0; - -static struct BurnInputInfo PingpongInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 6, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInputs + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvInputs + 3, "dip" }, -}; - -STDINPUTINFO(Pingpong) - -static struct BurnInputInfo MerlinmmInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 5, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 7, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 6, "p1 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInputs + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvInputs + 3, "dip" }, - {"Dip E", BIT_DIPSWITCH, DrvInputs + 4, "dip" }, -}; - -STDINPUTINFO(Merlinmm) - -static struct BurnInputInfo CashquizInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 5" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInputs + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvInputs + 3, "dip" }, - {"Dip E", BIT_DIPSWITCH, DrvInputs + 4, "dip" }, -}; - -STDINPUTINFO(Cashquiz) - -static struct BurnDIPInfo PingpongDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xfa, NULL }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0x0f, 0x04, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x01, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x02, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x0f, 0x08, "4 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0c, "3 Coins 4 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0xf0, 0x40, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x20, "3 Coins 2 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "4 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "3 Coins 4 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "2 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x06, 0x06, "Easy" }, - {0x11, 0x01, 0x06, 0x02, "Normal" }, - {0x11, 0x01, 0x06, 0x04, "Difficult" }, - {0x11, 0x01, 0x06, 0x00, "Very Difficult" }, -}; - -STDDIPINFO(Pingpong) - -static struct BurnDIPInfo MerlinmmDIPList[]= -{ - {0x07, 0xff, 0xff, 0xff, NULL }, - {0x08, 0xff, 0xff, 0xff, NULL }, - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Bank 3-3" }, - {0x07, 0x01, 0x01, 0x01, "Off" }, - {0x07, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 3-2" }, - {0x07, 0x01, 0x02, 0x02, "Off" }, - {0x07, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 3-1" }, - {0x07, 0x01, 0x04, 0x04, "Off" }, - {0x07, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Door Close" }, - {0x07, 0x01, 0x10, 0x10, "Off" }, - {0x07, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Door Open" }, - {0x07, 0x01, 0x20, 0x20, "Off" }, - {0x07, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Stake" }, - {0x09, 0x01, 0x02, 0x02, "10p" }, - {0x09, 0x01, 0x02, 0x00, "20p" }, - - {0 , 0xfe, 0 , 2, "Bank 1-6" }, - {0x09, 0x01, 0x04, 0x04, "Off" }, - {0x09, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 1-5" }, - {0x09, 0x01, 0x08, 0x08, "Off" }, - {0x09, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "10p Enabled" }, - {0x09, 0x01, 0x10, 0x10, "No" }, - {0x09, 0x01, 0x10, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "20p Enabled" }, - {0x09, 0x01, 0x20, 0x20, "No" }, - {0x09, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "50p Enabled" }, - {0x09, 0x01, 0x40, 0x40, "No" }, - {0x09, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "100p Enabled" }, - {0x09, 0x01, 0x80, 0x80, "No" }, - {0x09, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Bank 2-8" }, - {0x0a, 0x01, 0x01, 0x01, "Off" }, - {0x0a, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 2-7" }, - {0x0a, 0x01, 0x02, 0x02, "Off" }, - {0x0a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 2-6" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 2-5" }, - {0x0a, 0x01, 0x08, 0x08, "Off" }, - {0x0a, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 2-4" }, - {0x0a, 0x01, 0x10, 0x10, "Off" }, - {0x0a, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 2-3" }, - {0x0a, 0x01, 0x20, 0x20, "Off" }, - {0x0a, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 2-2" }, - {0x0a, 0x01, 0x40, 0x40, "Off" }, - {0x0a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bank 2-1" }, - {0x0a, 0x01, 0x80, 0x80, "Off" }, - {0x0a, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "10P Level" }, - {0x0b, 0x01, 0x01, 0x01, "Low" }, - {0x0b, 0x01, 0x01, 0x00, "High" }, - - {0 , 0xfe, 0 , 2, "20P Level" }, - {0x0b, 0x01, 0x02, 0x02, "Low" }, - {0x0b, 0x01, 0x02, 0x00, "High" }, - - {0 , 0xfe, 0 , 2, "50P Level" }, - {0x0b, 0x01, 0x04, 0x04, "Low" }, - {0x0b, 0x01, 0x04, 0x00, "High" }, - - {0 , 0xfe, 0 , 2, "100P Level" }, - {0x0b, 0x01, 0x08, 0x08, "Low" }, - {0x0b, 0x01, 0x08, 0x00, "High" }, -}; - -STDDIPINFO(Merlinmm) - -static struct BurnDIPInfo CashquizDIPList[]= -{ - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, -}; - -STDDIPINFO(Cashquiz) - -static void cashquiz_question_bank_high_write(UINT8 data) -{ - if (data != 0xff) - { - question_addr_high_data = data; - - for (INT32 i = 0; i < 8; i++) - { - if ((data ^ 0xff) == (1 << i)) - { - question_addr_high = i * 0x8000; - return; - } - } - } -} - -static void cashquiz_question_bank_low_write(UINT8 data) -{ - if (data >= 0x60 && data <= 0xdf) - { - question_addr_low_data = data; - - INT32 bank = (question_addr_low_data & 7) * 0x100; - INT32 bankaddr = question_addr_high + (question_addr_low_data - 0x60) * 0x100; - - ZetMapMemory(DrvBankROM + bankaddr, 0x5000 + bank, 0x50ff + bank, MAP_ROM); - } -} - -static void __fastcall pingpong_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x4000: - if (cashquiz) cashquiz_question_bank_high_write(data); - return; - - case 0x4001: - if (cashquiz) cashquiz_question_bank_low_write(data); - return; - - case 0xa000: - irq_enable = data & 0x04; - nmi_enable = data & 0x08; - // coin counter 1 and 2 - data & 1, data & 2 - return; - - case 0xa200: - return; // nop - - case 0xa400: - SN76496Write(0, data); - return; - - case 0xa600: - watchdog = 0; - return; - } -} - -static UINT8 __fastcall pingpong_read(UINT16 address) -{ - switch (address & ~0x800) - { - case 0x7000: // merlinmm - return DrvInp[4]; - - case 0xa000: - case 0xa080: - case 0xa100: - case 0xa180: - return DrvInp[(address >> 7) & 3]; - } - - return 0; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - if (cashquiz) ZetMapMemory(DrvBankROM, 0x5000, 0x57ff, MAP_ROM); - ZetClose(); - - question_addr_low_data = 0; - question_addr_high_data = 0; - question_addr_high = 0; - - irq_enable = 0; - nmi_enable = 0; - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x008000; - - if (cashquiz) { - DrvBankROM = Next; Next += 0x040000; - } - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000220; - - DrvTransTab = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - - DrvNVRAM = Next; Next += 0x000400; - - AllRam = Next; - - DrvColRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000800; - DrvZ80RAM = Next; Next += 0x000400; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Planes[2] = { 4, 0 }; - INT32 XOffs0[8] = { STEP4(3,-1), STEP4(8*8+3,-1) }; - INT32 XOffs1[16]= { STEP4(12*16+3,-1), STEP4(8*16+3,-1), STEP4(4*16+3,-1), STEP4(0*16+3,-1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(32*8,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Planes, XOffs0, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x2000); - - GfxDecode(0x0080, 2, 16, 16, Planes, XOffs1, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static void DrvPrgDecode(UINT8 *ROM, INT32 len) -{ - for (INT32 i = 0; i < len; i++) { - ROM[i] = BITSWAP08(ROM[i],0,1,2,3,4,5,6,7); - } -} - -static INT32 PingpongInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 5, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 6, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvColRAM, 0x8000, 0x83ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x8400, 0x87ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x9000, 0x97ff, MAP_RAM); - ZetSetWriteHandler(pingpong_write); - ZetSetReadHandler(pingpong_read); - ZetClose(); - - SN76496Init(0, 18432000/8, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - nNMIMask = 0x1f; - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 MerlinmmInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 2, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 4, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 5, 1)) return 1; - - DrvPrgDecode(DrvZ80ROM, 0x04000); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvNVRAM, 0x5000, 0x53ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0x5400, 0x57ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0x8000, 0x83ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x8400, 0x87ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x9000, 0x97ff, MAP_RAM); - ZetSetWriteHandler(pingpong_write); - ZetSetReadHandler(pingpong_read); - ZetClose(); - - SN76496Init(0, 18432000/8, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - nNMIMask = 0x1ff; - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 CashquizInit() -{ - cashquiz = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(tmp, i+1, 1)) return 1; - memcpy (DrvBankROM + i * 0x8000 + 0x2000, tmp + 0x0000, 0x6000); - memcpy (DrvBankROM + i * 0x8000 + 0x0000, tmp + 0x6000, 0x2000); - } - - BurnFree(tmp); - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 9, 1)) return 1; - memcpy (DrvGfxROM0, DrvGfxROM0 + 0x2000, 0x2000); - - // if (BurnLoadRom(DrvGfxROM1 + 0x0000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 13, 1)) return 1; - - DrvPrgDecode(DrvZ80ROM, 0x04000); - DrvPrgDecode(DrvBankROM, 0x40000); - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvBankROM, 0x5000, 0x57ff, MAP_ROM); - ZetMapMemory(DrvColRAM, 0x8000, 0x83ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x8400, 0x87ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x9000, 0x97ff, MAP_RAM); - ZetSetWriteHandler(pingpong_write); - ZetSetReadHandler(pingpong_read); - ZetClose(); - - SN76496Init(0, 18432000/8, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - nNMIMask = 0x1ff; - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - SN76496Exit(); - - BurnFree(AllMem); - - cashquiz = 0; - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 t[0x20]; - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - t[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x100; i++) - { - DrvPalette[i+0x000] = t[(DrvColPROM[i+0x020] & 0x0f) | 0x10]; - DrvPalette[i+0x100] = t[BITSWAP08(DrvColPROM[i+0x120], 7,6,5,4,0,1,2,3)]; - } - - for (INT32 i = 0; i < 0x200; i++) - { - DrvTransTab[i] = DrvPalette[i] ? 1 : 0; - } -} - -static void draw_layer() -{ - for (INT32 offs = 2 * 32; offs < 32 * 32 - 2 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy =((offs / 0x20) * 8) - 16; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + ((attr & 0x20) * 8); - INT32 color = attr & 0x1f; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - GenericTilesSetClip(0, 256, 32 - 16, 232 - 16); - - UINT8 *spr = DrvSprRAM + 3; - - for (INT32 offs = 0x50; offs >= 0; offs -= 4) - { - INT32 attr = spr[offs + 0]; - INT32 sx = spr[offs + 3]; - INT32 sy = 241 - spr[offs + 1]; - INT32 code = spr[offs + 2] & 0x7f; - - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - INT32 color = attr & 0x1f; - - RenderTileTranstab(pTransDraw, DrvGfxROM1, code, color*4+0x100, 0, sx, sy - 16, flipx, flipy, 16, 16, DrvTransTab); - } - - GenericTilesClearClip(); -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memcpy (DrvInp, DrvInputs, 5); - - for (INT32 i = 0; i < 8; i++) { - DrvInp[0] ^= (DrvJoy1[i] & 1) << i; - DrvInp[1] ^= (DrvJoy2[i] & 1) << i; - DrvInp[2] ^= (DrvJoy3[i] & 1) << i; - DrvInp[3] ^= (DrvJoy4[i] & 1) << i; - DrvInp[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nInterleave = 262; - INT32 nCyclesTotal = 18432000 / 6 / 60; - INT32 nCyclesDone = 0; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone += ZetRun(nCyclesTotal / nInterleave); - - if (i == 240 && irq_enable) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - if ((i & nNMIMask) == 0 && nmi_enable) ZetNmi(); - } - - ZetClose(); - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - SN76496Scan(nAction, pnMin); - - SCAN_VAR(irq_enable); - SCAN_VAR(nmi_enable); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNVRAM; - ba.nLen = 0x00400; - ba.nAddress = 0; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - if ((nAction & ACB_WRITE) && cashquiz) { - ZetOpen(0); - cashquiz_question_bank_high_write(question_addr_high_data); - cashquiz_question_bank_low_write(question_addr_low_data); - ZetClose(); - } - - return 0; -} - - -// Konami's Ping-Pong - -static struct BurnRomInfo pingpongRomDesc[] = { - { "pp_e04.rom", 0x4000, 0x18552f8f, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 code - { "pp_e03.rom", 0x4000, 0xae5f01e8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pp_e01.rom", 0x2000, 0xd1d6f090, 2 | BRF_GRA }, // 2 Background tiles - - { "pp_e02.rom", 0x2000, 0x33c687e0, 3 | BRF_GRA }, // 3 Sprites - - { "pingpong.3j", 0x0020, 0x3e04f06e, 4 | BRF_GRA }, // 4 Color data - { "pingpong.5h", 0x0100, 0x8456046a, 4 | BRF_GRA }, // 5 - { "pingpong.11j", 0x0100, 0x09d96b08, 4 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(pingpong) -STD_ROM_FN(pingpong) - -struct BurnDriver BurnDrvPingpong = { - "pingpong", NULL, NULL, NULL, "1985", - "Konami's Ping-Pong\0", NULL, "Konami", "GX555", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, pingpongRomInfo, pingpongRomName, NULL, NULL, PingpongInputInfo, PingpongDIPInfo, - PingpongInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Merlins Money Maze - -static struct BurnRomInfo merlinmmRomDesc[] = { - { "merlinmm.ic2", 0x4000, 0xea5b6590, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 code - - { "merlinmm.7h", 0x2000, 0xf7d535aa, 2 | BRF_GRA }, // 1 Background tiles - - { "merl_sp.12c", 0x2000, 0x517ecd57, 3 | BRF_GRA }, // 2 Sprites - - { "merlinmm.3j", 0x0020, 0xd56e91f4, 4 | BRF_GRA }, // 3 Color data - { "pingpong.5h", 0x0100, 0x8456046a, 4 | BRF_GRA }, // 4 - { "pingpong.11j", 0x0100, 0x09d96b08, 4 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(merlinmm) -STD_ROM_FN(merlinmm) - -struct BurnDriver BurnDrvMerlinmm = { - "merlinmm", NULL, NULL, NULL, "1986", - "Merlins Money Maze\0", NULL, "Zilec-Zenitone", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, merlinmmRomInfo, merlinmmRomName, NULL, NULL, MerlinmmInputInfo, MerlinmmDIPInfo, - MerlinmmInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Cash Quiz (Type B, Version 5) - -static struct BurnRomInfo cashquizRomDesc[] = { - { "cashqcv5.ic3", 0x4000, 0x8e9e2bed, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 code - - { "q30_soaps.ic1", 0x8000, 0xb35a30ac, 2 | BRF_GRA }, // 1 Question data - { "q10.ic2", 0x8000, 0x54962e11, 2 | BRF_GRA }, // 2 - { "q29_newsoccrick.ic3",0x8000, 0x03d47262, 2 | BRF_GRA }, // 3 - { "q28_sportstime.ic4", 0x8000, 0x2bd00476, 2 | BRF_GRA }, // 4 - { "q20_mot.ic5", 0x8000, 0x17a38baf, 2 | BRF_GRA }, // 5 - { "q14_popmusic2.ic6", 0x8000, 0xe486d6ee, 2 | BRF_GRA }, // 6 - { "q26_screenent.ic7", 0x8000, 0x9d130515, 2 | BRF_GRA }, // 7 - { "q19.ic8", 0x8000, 0x9f3f77e6, 2 | BRF_GRA }, // 8 - - { "cashq.7h", 0x4000, 0x44b72a4f, 3 | BRF_GRA }, // 9 Background tiles - - { "cashq.12c", 0x2000, 0x00000000, 4 | BRF_NODUMP }, // 10 Sprites - - { "cashquiz.3j", 0x0020, 0xdc70e23b, 5 | BRF_GRA }, // 11 Color data - { "pingpong.5h", 0x0100, 0x8456046a, 5 | BRF_GRA }, // 12 - { "pingpong.11j", 0x0100, 0x09d96b08, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(cashquiz) -STD_ROM_FN(cashquiz) - -struct BurnDriver BurnDrvCashquiz = { - "cashquiz", NULL, NULL, NULL, "1986", - "Cash Quiz (Type B, Version 5)\0", "Missing graphics due to undumped ROM!", "Zilec-Zenitone", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_QUIZ, 0, - NULL, cashquizRomInfo, cashquizRomName, NULL, NULL, CashquizInputInfo, CashquizDIPInfo, - CashquizInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_pooyan.cpp b/jan/src/burn/drv/konami/d_pooyan.cpp deleted file mode 100644 index 62eeba2e9..000000000 --- a/jan/src/burn/drv/konami/d_pooyan.cpp +++ /dev/null @@ -1,822 +0,0 @@ -// FB Alpha Pooyan Driver Module -// Based on MAME driver by Allard van der Bas, Mike Cuddy, Nicola Salmoria, Martin Binder, and Marco Cassili - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "timeplt_snd.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pFMBuffer; -static INT16 *pAY8910Buffer[6]; - -static UINT8 irqtrigger; -static UINT8 irq_enable; -static UINT8 flipscreen; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL , DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL , DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL , DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL , DrvJoy2 + 3, "p1 down" }, - {"P1 Button", BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL , DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL , DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL , DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL , DrvJoy3 + 3, "p2 down" }, - {"P2 Button", BIT_DIGITAL , DrvJoy3 + 4, "p2 fire 1" }, - - {"Service", BIT_DIGITAL , DrvJoy1 + 2, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0x7b, NULL }, - - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x0c, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x0c, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x0c, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x0c, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x0c, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x0c, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x0c, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x0c, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x0c, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x0c, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x0c, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x0c, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15 , "Coin B" }, - {0x0c, 0x82, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x0c, 0x82, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x0c, 0x82, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x0c, 0x82, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x0c, 0x82, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x0c, 0x82, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x0c, 0x82, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x0c, 0x82, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x0c, 0x82, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x0c, 0x82, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x0c, 0x82, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x0c, 0x82, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x0c, 0x82, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x0c, 0x82, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x0c, 0x82, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0d, 0x01, 0x03, 0x03, "3" }, - {0x0d, 0x01, 0x03, 0x02, "4" }, - {0x0d, 0x01, 0x03, 0x01, "5" }, - {0x0d, 0x01, 0x03, 0x00, "256" }, - - {0 , 0xfe, 0 , 1 , "Cabinet" }, - {0x0d, 0x01, 0x04, 0x00, "Upright" }, -// {0x0d, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0d, 0x01, 0x08, 0x08, "50K 80K+" }, - {0x0d, 0x01, 0x08, 0x00, "30K 70K+" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x0d, 0x01, 0x70, 0x70, "1 (Easy)" }, - {0x0d, 0x01, 0x70, 0x60, "2" }, - {0x0d, 0x01, 0x70, 0x50, "3" }, - {0x0d, 0x01, 0x70, 0x40, "4" }, - {0x0d, 0x01, 0x70, 0x30, "5" }, - {0x0d, 0x01, 0x70, 0x20, "6" }, - {0x0d, 0x01, 0x70, 0x10, "7" }, - {0x0d, 0x01, 0x70, 0x00, "8 (Hard)" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x80, 0x80, "Off" }, - {0x0d, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static UINT8 __fastcall pooyan_main_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return DrvDips[1]; - - case 0xa080: - return DrvInputs[0]; - - case 0xa0a0: - return DrvInputs[1]; - - case 0xa0c0: - return DrvInputs[2]; - - case 0xa0e0: - return DrvDips[0]; - } - - return 0; -} - -static void __fastcall pooyan_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - // watchdog - break; - - case 0xa100: - TimepltSndSoundlatch(data); - break; - - case 0xa180: - irq_enable = data & 1; - if (!irq_enable) - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - break; - - case 0xa181: - { - if (irqtrigger == 0 && data) { - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - } - - irqtrigger = data; - } - break; - - case 0xa183: - break; - - case 0xa187: - flipscreen = ~data & 1; - break; - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - TimepltSndReset(); - - irqtrigger = 0; - flipscreen = 0; - irq_enable = 0; - - HiscoreReset(); - - return 0; -} - -#define MAX_NETS 3 -#define MAX_RES_PER_NET 18 -#define Combine2Weights(tab,w0,w1) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5)) -#define Combine3Weights(tab,w0,w1,w2) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5)) - -static double ComputeResistorWeights(INT32 MinVal, INT32 MaxVal, double Scaler, INT32 Count1, const INT32 *Resistances1, double *Weights1, INT32 PullDown1, INT32 PullUp1, INT32 Count2, const INT32 *Resistances2, double *Weights2, INT32 PullDown2, INT32 PullUp2, INT32 Count3, const INT32 *Resistances3, double *Weights3, INT32 PullDown3, INT32 PullUp3) -{ - INT32 NetworksNum; - - INT32 ResCount[MAX_NETS]; - double r[MAX_NETS][MAX_RES_PER_NET]; - double w[MAX_NETS][MAX_RES_PER_NET]; - double ws[MAX_NETS][MAX_RES_PER_NET]; - INT32 r_pd[MAX_NETS]; - INT32 r_pu[MAX_NETS]; - - double MaxOut[MAX_NETS]; - double *Out[MAX_NETS]; - - INT32 i, j, n; - double Scale; - double Max; - - NetworksNum = 0; - for (n = 0; n < MAX_NETS; n++) { - INT32 Count, pd, pu; - const INT32 *Resistances; - double *Weights; - - switch (n) { - case 0: { - Count = Count1; - Resistances = Resistances1; - Weights = Weights1; - pd = PullDown1; - pu = PullUp1; - break; - } - - case 1: { - Count = Count2; - Resistances = Resistances2; - Weights = Weights2; - pd = PullDown2; - pu = PullUp2; - break; - } - - case 2: - default: { - Count = Count3; - Resistances = Resistances3; - Weights = Weights3; - pd = PullDown3; - pu = PullUp3; - break; - } - } - - if (Count > 0) { - ResCount[NetworksNum] = Count; - for (i = 0; i < Count; i++) { - r[NetworksNum][i] = 1.0 * Resistances[i]; - } - Out[NetworksNum] = Weights; - r_pd[NetworksNum] = pd; - r_pu[NetworksNum] = pu; - NetworksNum++; - } - } - - for (i = 0; i < NetworksNum; i++) { - double R0, R1, Vout, Dst; - - for (n = 0; n < ResCount[i]; n++) { - R0 = (r_pd[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pd[i]; - R1 = (r_pu[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pu[i]; - - for (j = 0; j < ResCount[i]; j++) { - if (j == n) { - if (r[i][j] != 0.0) R1 += 1.0 / r[i][j]; - } else { - if (r[i][j] != 0.0) R0 += 1.0 / r[i][j]; - } - } - - R0 = 1.0/R0; - R1 = 1.0/R1; - Vout = (MaxVal - MinVal) * R0 / (R1 + R0) + MinVal; - - Dst = (Vout < MinVal) ? MinVal : (Vout > MaxVal) ? MaxVal : Vout; - - w[i][n] = Dst; - } - } - - j = 0; - Max = 0.0; - for (i = 0; i < NetworksNum; i++) { - double Sum = 0.0; - - for (n = 0; n < ResCount[i]; n++) Sum += w[i][n]; - - MaxOut[i] = Sum; - if (Max < Sum) { - Max = Sum; - j = i; - } - } - - if (Scaler < 0.0) { - Scale = ((double)MaxVal) / MaxOut[j]; - } else { - Scale = Scaler; - } - - for (i = 0; i < NetworksNum; i++) { - for (n = 0; n < ResCount[i]; n++) { - ws[i][n] = w[i][n] * Scale; - (Out[i])[n] = ws[i][n]; - } - } - - return Scale; -} - -static void DrvPaletteInit() -{ - UINT32 pal[0x20]; - - static const INT32 resistances_rg[3] = { 1000, 470, 220 }; - static const INT32 resistances_b[2] = { 470, 220 }; - - double rweights[3], gweights[3], bweights[2]; - - ComputeResistorWeights(0, 0xff, -1.0, - 3, &resistances_rg[0], rweights, 1000, 0, - 3, &resistances_rg[0], gweights, 1000, 0, - 2, &resistances_b[0], bweights, 1000, 0); - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 r, g, b; - INT32 bit0, bit1, bit2; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = Combine3Weights(rweights, bit0, bit1, bit2); - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - g = Combine3Weights(gweights, bit0, bit1, bit2); - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - b = Combine2Weights(bweights, bit0, bit1); - - pal[i] = BurnHighCol(r, g, b, 0); - } - - for (INT32 i = 0; i < 0x100; i++) - { - DrvPalette[i + 0x000] = pal[(DrvColPROM[i + 0x020] & 0x0f) | 0x10]; - DrvPalette[i + 0x100] = pal[(DrvColPROM[i + 0x120] & 0x0f) | 0x00]; - } -} - -#undef MAX_NETS -#undef MAX_RES_PER_NET -#undef Combine2Weights -#undef Combine3Weights - -static INT32 DrvGfxDecode() -{ - INT32 Planes[4] = { 0x8004, 0x8000, 4, 0 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256, 8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x100, 4, 8, 8, Planes, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x2000); - - GfxDecode(0x40, 4, 16, 16, Planes, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x08000; - DrvZ80ROM1 = Next; Next += 0x02000; - - DrvGfxROM0 = Next; Next += 0x04000; - DrvGfxROM1 = Next; Next += 0x04000; - - DrvColPROM = Next; Next += 0x00220; - - DrvPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM0 = Next; Next += 0x000100; - DrvSprRAM1 = Next; Next += 0x000100; - DrvZ80RAM0 = Next; Next += 0x000800; - DrvZ80RAM1 = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000800; - - RamEnd = Next; - - pFMBuffer = (INT16 *)Next; Next += nBurnSoundLen * 6 * sizeof(INT16); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x1000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 12, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0x8000, 0x87ff, 0, DrvVidRAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvVidRAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvVidRAM); - ZetMapArea(0x8800, 0x8fff, 0, DrvZ80RAM0); - ZetMapArea(0x8800, 0x8fff, 1, DrvZ80RAM0); - ZetMapArea(0x8800, 0x8fff, 2, DrvZ80RAM0); - ZetMapArea(0x9000, 0x90ff, 0, DrvSprRAM0); - ZetMapArea(0x9000, 0x90ff, 1, DrvSprRAM0); - ZetMapArea(0x9000, 0x90ff, 2, DrvSprRAM0); - ZetMapArea(0x9400, 0x94ff, 0, DrvSprRAM1); - ZetMapArea(0x9400, 0x94ff, 1, DrvSprRAM1); - ZetMapArea(0x9400, 0x94ff, 2, DrvSprRAM1); - ZetSetWriteHandler(pooyan_main_write); - ZetSetReadHandler(pooyan_main_read); - ZetClose(); - - TimepltSndInit(DrvZ80ROM1, DrvZ80RAM1, 1); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - TimepltSndExit(); - - GenericTilesExit(); - - BurnFree (AllMem); - AllMem = NULL; - - return 0; -} - -static void draw_layer() -{ - for (INT32 i = 0; i < 0x0400; i++) - { - INT32 attr = DrvVidRAM[0x000 + i]; - INT32 code = DrvVidRAM[0x400 + i]; - INT32 color = attr & 0x0f; - INT32 flipx = (attr >> 6) & 1; - INT32 flipy = (attr >> 7) & 1; - - INT32 sx = (i << 3) & 0xf8; - INT32 sy = (i >> 2) & 0xf8; - - if (flipscreen) { - sx ^= 0xf8; - sy ^= 0xf8; - flipx ^= 1; - flipy ^= 1; - } - - if (sy > 239 || sy < 16) continue; - sy -= 16; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } - } -} extern int counter; - -static void RenderTileCPMP(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height) -{ - UINT16 *dest = pTransDraw; - UINT8 *gfx = DrvGfxROM1; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - if (DrvPalette[pxl | (color << 4) | 0x100] == 0) continue; // 0 and 0x10 is transparent - dest[sy * nScreenWidth + sx] = pxl | (color << 4) | 0x100; - } - sx -= width; - } -} - - -static void draw_sprites() -{ - for (INT32 i = 0x10; i < 0x40; i += 2) - { - INT32 sx = DrvSprRAM0[i]; - INT32 sy = 240 - DrvSprRAM1[1 + i]; - - INT32 code = DrvSprRAM0[i + 1] & 0x3f; - INT32 color = (DrvSprRAM1[i] & 0x0f);// | 0x10; - INT32 flipx = ~DrvSprRAM1[i] & 0x40; - INT32 flipy = DrvSprRAM1[i] & 0x80; - - if (sy == 0 || sy >= 240) continue; - - sy -= 16; - - RenderTileCPMP(code, color, sx, sy, flipx, flipy, 16, 16); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - } - - if (nBurnLayer & 1) draw_layer(); - if (nBurnLayer & 2) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 3072000 / 60, 1789772 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (irq_enable && i == (nInterleave - 1)) ZetNmi(); - ZetClose(); - - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - TimepltSndScan(nAction, pnMin); - - SCAN_VAR(irqtrigger); - SCAN_VAR(irq_enable); - SCAN_VAR(flipscreen); - } - - return 0; -} - - -// Pooyan - -static struct BurnRomInfo pooyanRomDesc[] = { - { "1.4a", 0x2000, 0xbb319c63, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.5a", 0x2000, 0xa1463d98, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.6a", 0x2000, 0xfe1a9e08, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.7a", 0x2000, 0x9e0f9bcc, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "xx.7a", 0x1000, 0xfbe2b368, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - { "xx.8a", 0x1000, 0xe1795b3d, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "8.10g", 0x1000, 0x931b29eb, 3 | BRF_GRA }, // 6 Characters - { "7.9g", 0x1000, 0xbbe6d6e4, 3 | BRF_GRA }, // 7 - - { "6.9a", 0x1000, 0xb2d8c121, 4 | BRF_GRA }, // 8 Sprites - { "5.8a", 0x1000, 0x1097c2b6, 4 | BRF_GRA }, // 9 - - { "pooyan.pr1", 0x0020, 0xa06a6d0e, 5 | BRF_GRA }, // 10 Color Proms - { "pooyan.pr3", 0x0100, 0x8cd4cd60, 5 | BRF_GRA }, // 11 - { "pooyan.pr2", 0x0100, 0x82748c0b, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(pooyan) -STD_ROM_FN(pooyan) - -struct BurnDriver BurnDrvPooyan = { - "pooyan", NULL, NULL, NULL, "1982", - "Pooyan\0", NULL, "Konami", "GX320", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, pooyanRomInfo, pooyanRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Pooyan (Stern) - -static struct BurnRomInfo pooyansRomDesc[] = { - { "ic22_a4.cpu", 0x2000, 0x916ae7d7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "ic23_a5.cpu", 0x2000, 0x8fe38c61, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic24_a6.cpu", 0x2000, 0x2660218a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic25_a7.cpu", 0x2000, 0x3d2a10ad, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "xx.7a", 0x1000, 0xfbe2b368, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - { "xx.8a", 0x1000, 0xe1795b3d, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "ic13_g10.cpu", 0x1000, 0x7433aea9, 3 | BRF_GRA }, // 6 Characters - { "ic14_g9.cpu", 0x1000, 0x87c1789e, 3 | BRF_GRA }, // 7 - - { "6.9a", 0x1000, 0xb2d8c121, 4 | BRF_GRA }, // 8 Sprites - { "5.8a", 0x1000, 0x1097c2b6, 4 | BRF_GRA }, // 9 - - { "pooyan.pr1", 0x0020, 0xa06a6d0e, 5 | BRF_GRA }, // 10 Color Proms - { "pooyan.pr3", 0x0100, 0x8cd4cd60, 5 | BRF_GRA }, // 11 - { "pooyan.pr2", 0x0100, 0x82748c0b, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(pooyans) -STD_ROM_FN(pooyans) - -struct BurnDriver BurnDrvPooyans = { - "pooyans", "pooyan", NULL, NULL, "1982", - "Pooyan (Stern)\0", NULL, "[Konami] (Stern license)", "GX320", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, pooyansRomInfo, pooyansRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Pootan - -static struct BurnRomInfo pootanRomDesc[] = { - { "poo_ic22.bin", 0x2000, 0x41b23a24, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "poo_ic23.bin", 0x2000, 0xc9d94661, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.6a", 0x2000, 0xfe1a9e08, 1 | BRF_PRG | BRF_ESS }, // 2 - { "poo_ic25.bin", 0x2000, 0x8ae459ef, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "xx.7a", 0x1000, 0xfbe2b368, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - { "xx.8a", 0x1000, 0xe1795b3d, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "poo_ic13.bin", 0x1000, 0x0be802e4, 3 | BRF_GRA }, // 6 Characters - { "poo_ic14.bin", 0x1000, 0xcba29096, 3 | BRF_GRA }, // 7 - - { "6.9a", 0x1000, 0xb2d8c121, 4 | BRF_GRA }, // 8 Sprites - { "5.8a", 0x1000, 0x1097c2b6, 4 | BRF_GRA }, // 9 - - { "pooyan.pr1", 0x0020, 0xa06a6d0e, 5 | BRF_GRA }, // 10 Color Proms - { "pooyan.pr3", 0x0100, 0x8cd4cd60, 5 | BRF_GRA }, // 11 - { "pooyan.pr2", 0x0100, 0x82748c0b, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(pootan) -STD_ROM_FN(pootan) - -struct BurnDriver BurnDrvPootan = { - "pootan", "pooyan", NULL, NULL, "1982", - "Pootan\0", NULL, "bootleg", "GX320", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, pootanRomInfo, pootanRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/konami/d_rockrage.cpp b/jan/src/burn/drv/konami/d_rockrage.cpp deleted file mode 100644 index bc2619285..000000000 --- a/jan/src/burn/drv/konami/d_rockrage.cpp +++ /dev/null @@ -1,695 +0,0 @@ -// FB ALpha Rock'n Rage driver module -// Based on MAME driver by Manuel Abadia - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "hd6309_intf.h" -#include "burn_ym2151.h" -#include "vlm5030.h" -#include "k007342_k007420.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvHD6309ROM; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvVLMROM; -static UINT8 *DrvLutPROM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *DrvHD6309RAM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvPalRAM; - -static UINT8 HD6309Bank; -static UINT8 soundlatch; -static UINT8 videoregs; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 watchdog; - -static struct BurnInputInfo RockrageInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up"} , - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Rockrage) - -static struct BurnDIPInfo RockrageDIPList[]= -{ - {0x12, 0xff, 0xff, 0xe0, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x5d, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "1" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x14, 0x01, 0x08, 0x08, "30k & Every 70k" }, - {0x14, 0x01, 0x08, 0x00, "40k & Every 80k" }, - - {0 , 0xfe, 0 , 2, "Freeze Screen" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x60, 0x60, "Easy" }, - {0x14, 0x01, 0x60, 0x40, "Medium" }, - {0x14, 0x01, 0x60, 0x20, "Hard" }, - {0x14, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Rockrage) - -static void bankswitch(INT32 bank) -{ - HD6309Bank = bank; - HD6309MapMemory(DrvHD6309ROM + 0x10000 + (((bank & 0x70) >> 4) * 0x2000), 0x6000, 0x7fff, MAP_ROM); -} - -static void rockrage_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff8) == 0x2600) { - K007342Regs[0][address & 7] = data; - return; - } - - switch (address) - { - case 0x2e80: - soundlatch = data; - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x2ec0: - watchdog = 0; - return; - - case 0x2f00: - videoregs = data; - return; - - case 0x2f40: - bankswitch(data); - return; - } -} - -static UINT8 rockrage_main_read(UINT16 address) -{ - switch (address) - { - case 0x2e00: - case 0x2e01: - case 0x2e02: - return DrvInputs[address & 3]; - - case 0x2e03: - return DrvDips[2]; - - case 0x2e40: - return DrvDips[1]; - } - - return 0; -} - -static void rockrage_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - vlm5030_data_write(0, data); - return; - - case 0x4000: - vlm5030_rst(0, (data >> 1) & 1); - vlm5030_st(0, (data >> 0) & 1); - return; - - case 0x6000: - BurnYM2151SelectRegister(data); - return; - - case 0x6001: - BurnYM2151WriteRegister(data); - return; - } -} - -static UINT8 rockrage_sound_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - return (vlm5030_bsy(0) ? 1 : 0); - - case 0x5000: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - - case 0x6000: - case 0x6001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static UINT32 DrvVLM5030Sync(INT32 samples_rate) -{ - return (samples_rate * M6809TotalCycles()) / 25000; -} - -static void rockrage_tile_callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 */*flags*/) -{ - if (layer == 1) { - *code |= ((*color & 0x40) << 2) | ((bank & 0x01) << 9); - } else { - *code |= ((*color & 0x40) << 2) | ((bank & 0x03) << 10) | ((videoregs & 0x04) << 7) | ((videoregs & 0x08) << 9); - } - - *color = (layer * 0x10) + (*color & 0xf); -} - -static void rockrage_sprite_callback(INT32 *code, INT32 *color) -{ - *code |= ((*color & 0x40) << 2) | ((*color & 0x80) << 1) * ((videoregs & 0x03) << 1); - *code = (*code << 2) | ((*color & 0x30) >> 4); - *color = 0x20 + (*color & 0x0f); -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - BurnYM2151Reset(); - vlm5030Reset(0); - - K007342Reset(); - - HD6309Bank = 0; - soundlatch = 0; - videoregs = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvHD6309ROM = Next; Next += 0x020000; - DrvM6809ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x080000; - - DrvVLMROM = Next; Next += 0x008000; - - DrvLutPROM = Next; Next += 0x000300; -; - DrvPalette = (UINT32*)Next; Next += 0x300 * sizeof(UINT32); - - AllRam = Next; - - DrvHD6309RAM = Next; Next += 0x002000; - DrvM6809RAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000100; - - K007342VidRAM[0] = Next; Next += 0x002000; - K007342ScrRAM[0] = Next; Next += 0x000200; - - K007420RAM[0] = Next; Next += 0x000200; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *src, INT32 len) // 64, 32 -{ - for (INT32 i = (len - 1) * 2; i >= 0; i-=2) { - src[i+0] = src[i/2] >> 4; - src[i+1] = src[i/2] & 0xf; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvHD6309ROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvHD6309ROM + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 2)) return 1; - - if (BurnDrvGetFlags() & BDF_PROTOTYPE) - { - if (BurnLoadRom(DrvGfxROM0 + 0x20001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 10, 1)) return 1; - - if (BurnLoadRom(DrvLutPROM + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvLutPROM + 0x00100, 12, 1)) return 1; - if (BurnLoadRom(DrvLutPROM + 0x00200, 13, 1)) return 1; - - if (BurnLoadRom(DrvVLMROM + 0x00000, 14, 1)) return 1; - } - else - { - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 6, 1)) return 1; - - if (BurnLoadRom(DrvLutPROM + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvLutPROM + 0x00100, 8, 1)) return 1; - if (BurnLoadRom(DrvLutPROM + 0x00200, 9, 1)) return 1; - - if (BurnLoadRom(DrvVLMROM + 0x00000, 10, 1)) return 1; - } - - DrvGfxExpand(DrvGfxROM0, 0x40000); - DrvGfxExpand(DrvGfxROM1, 0x40000); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(K007342VidRAM[0], 0x0000, 0x1fff, MAP_RAM); - HD6309MapMemory(K007420RAM[0], 0x2000, 0x21ff, MAP_RAM); - HD6309MapMemory(K007342ScrRAM[0], 0x2200, 0x23ff, MAP_RAM); - HD6309MapMemory(DrvPalRAM, 0x2400, 0x24ff, MAP_RAM); - HD6309MapMemory(DrvHD6309RAM, 0x4000, 0x5fff, MAP_RAM); - HD6309MapMemory(DrvHD6309ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(rockrage_main_write); - HD6309SetReadHandler(rockrage_main_read); - HD6309Close(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x7000, 0x77ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(rockrage_sound_write); - M6809SetReadHandler(rockrage_sound_read); - M6809Close(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.60, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.60, BURN_SND_ROUTE_RIGHT); - - vlm5030Init(0, 3579545, DrvVLM5030Sync, DrvVLMROM, 0x8000, 1); - vlm5030SetAllRoutes(0, 1.20, BURN_SND_ROUTE_BOTH); - - K007342Init(DrvGfxROM0, rockrage_tile_callback); - K007342SetOffsets(0, 16); - - K007420Init(0x3ff, rockrage_sprite_callback); - K007420SetOffsets(0, 16); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - HD6309Exit(); - - vlm5030Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pens[0x40]; - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x80 / 2; i++) { - INT32 r = (p[i] & 0x1f); - INT32 g = (p[i] >> 5) & 0x1f; - INT32 b = (p[i] >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x300; i++) { - DrvPalette[i] = pens[((i&0x300)/0x10)+(DrvLutPROM[i]&0xf)]; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 1; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) K007342DrawLayer(0, 0 | K007342_OPAQUE, 0); - if (nSpriteEnable & 1) K007420DrawSprites(DrvGfxROM1); - if (nBurnLayer & 2) K007342DrawLayer(0, 1 | K007342_OPAQUE, 0); - if (nBurnLayer & 4) K007342DrawLayer(1, 0, 0); - if (nBurnLayer & 8) K007342DrawLayer(1, 1, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - HD6309NewFrame(); - M6809NewFrame(); - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[0] = (DrvInputs[0] & 0x1f) | (DrvDips[0] & 0xe0); - } - - INT32 nInterleave = ((nBurnSoundLen) ? nBurnSoundLen : 1); - INT32 nCyclesTotal[2] = { 3000000 / 60, 1500000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - HD6309Open(0); - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += HD6309Run(nCyclesTotal[0] / nInterleave); - - nCyclesDone[1] += M6809Run(nCyclesTotal[1] / nInterleave); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K007342_irq_enabled()) HD6309SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - } - - HD6309Close(); - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029704; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - HD6309Scan(nAction); - M6809Scan(nAction); - - BurnYM2151Scan(nAction); - vlm5030Scan(nAction); - - K007342Scan(nAction); - - SCAN_VAR(HD6309Bank); - SCAN_VAR(soundlatch); - SCAN_VAR(videoregs); - } - - if (nAction & ACB_WRITE) { - HD6309Open(0); - bankswitch(HD6309Bank); - HD6309Close(); - } - - return 0; -} - - -// Rock'n Rage (World) - -static struct BurnRomInfo rockrageRomDesc[] = { - { "620q01.16c", 0x08000, 0x0ddb5ef5, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - { "620q02.15c", 0x10000, 0xb4f6e346, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "620k03.11c", 0x08000, 0x9fbefe82, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 Code - - { "620k05.rom", 0x20000, 0x145d387c, 3 | BRF_GRA }, // 3 Tiles - { "620k06.rom", 0x20000, 0x7fa2c57c, 3 | BRF_GRA }, // 4 - - { "620k11.rom", 0x20000, 0x70449239, 4 | BRF_GRA }, // 5 Sprites - { "620l10.8g", 0x20000, 0x06d108e0, 4 | BRF_GRA }, // 6 - - { "620k07.13g", 0x00100, 0xb6135ee0, 5 | BRF_GRA }, // 7 Color Lookup Tables - { "620k08.12g", 0x00100, 0xb499800c, 5 | BRF_GRA }, // 8 - { "620k09.11g", 0x00100, 0x9f0e0608, 5 | BRF_GRA }, // 9 - - { "620k04.6e", 0x08000, 0x8be969f3, 6 | BRF_GRA }, // 10 VLM5030 Samples -}; - -STD_ROM_PICK(rockrage) -STD_ROM_FN(rockrage) - -struct BurnDriver BurnDrvRockrage = { - "rockrage", NULL, NULL, NULL, "1986", - "Rock'n Rage (World)\0", NULL, "Konami", "GX620", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, rockrageRomInfo, rockrageRomName, NULL, NULL, RockrageInputInfo, RockrageDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 224, 4, 3 -}; - - -// Rock'n Rage (prototype?) - -static struct BurnRomInfo rockrageaRomDesc[] = { - { "620n01.16c", 0x10000, 0xf89f56ea, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - { "620n02.15c", 0x10000, 0x5bc1f1cf, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "620k03.11c", 0x08000, 0x9fbefe82, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 Code - - { "620d05a.16g", 0x10000, 0x4d53fde9, 3 | BRF_GRA }, // 3 Tiles - { "620d06a.15g", 0x10000, 0x8cc05d4b, 3 | BRF_GRA }, // 4 - { "620d05b.16f", 0x10000, 0x69f4599f, 3 | BRF_GRA }, // 5 - { "620d06b.15f", 0x10000, 0x3892d41d, 3 | BRF_GRA }, // 6 - - { "620g11a.7g", 0x10000, 0x0ef40c2c, 4 | BRF_GRA }, // 7 Sprites - { "620d11b.7f", 0x10000, 0x8f116cbf, 4 | BRF_GRA }, // 8 - { "620d10a.8g", 0x10000, 0x4789ae7b, 4 | BRF_GRA }, // 9 - { "620g10b.8f", 0x10000, 0x1618854a, 4 | BRF_GRA }, // 10 - - { "620k07.13g", 0x00100, 0xb6135ee0, 5 | BRF_GRA }, // 11 Color Lookup Tables - { "620k08.12g", 0x00100, 0xb499800c, 5 | BRF_GRA }, // 12 - { "620k09.11g", 0x00100, 0x9f0e0608, 5 | BRF_GRA }, // 13 - - { "620k04.6e", 0x08000, 0x8be969f3, 6 | BRF_GRA }, // 14 VLM5030 Samples -}; - -STD_ROM_PICK(rockragea) -STD_ROM_FN(rockragea) - -struct BurnDriver BurnDrvRockragea = { - "rockragea", "rockrage", NULL, NULL, "1986", - "Rock'n Rage (prototype?)\0", NULL, "Konami", "GX620", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, rockrageaRomInfo, rockrageaRomName, NULL, NULL, RockrageInputInfo, RockrageDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 224, 4, 3 -}; - - -// Koi no Hotrock (Japan) - -static struct BurnRomInfo rockragejRomDesc[] = { - { "620k01.16c", 0x08000, 0x4f5171f7, 1 | BRF_PRG | BRF_ESS }, // 0 HD6309 Code - { "620k02.15c", 0x10000, 0x04c4d8f7, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "620k03.11c", 0x08000, 0x9fbefe82, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 Code - - { "620k05.16g", 0x20000, 0xca9d9346, 3 | BRF_GRA }, // 3 Tiles - { "620k06.15g", 0x20000, 0xc0e2b35c, 3 | BRF_GRA }, // 4 - - { "620k11.7g", 0x20000, 0x7430f6e9, 4 | BRF_GRA }, // 5 Sprites - { "620k10.8g", 0x20000, 0x0d1a95ab, 4 | BRF_GRA }, // 6 - - { "620k07.13g", 0x00100, 0xb6135ee0, 5 | BRF_GRA }, // 7 Color Lookup Tables - { "620k08.12g", 0x00100, 0xb499800c, 5 | BRF_GRA }, // 8 - { "620k09.11g", 0x00100, 0x9f0e0608, 5 | BRF_GRA }, // 9 - - { "620k04.6e", 0x08000, 0x8be969f3, 6 | BRF_GRA }, // 10 VLM5030 Samples -}; - -STD_ROM_PICK(rockragej) -STD_ROM_FN(rockragej) - -struct BurnDriver BurnDrvRockragej = { - "rockragej", "rockrage", NULL, NULL, "1986", - "Koi no Hotrock (Japan)\0", NULL, "Konami", "GX620", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, rockragejRomInfo, rockragejRomName, NULL, NULL, RockrageInputInfo, RockrageDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_rocnrope.cpp b/jan/src/burn/drv/konami/d_rocnrope.cpp deleted file mode 100644 index 3d99f332a..000000000 --- a/jan/src/burn/drv/konami/d_rocnrope.cpp +++ /dev/null @@ -1,723 +0,0 @@ -// FB Alpha Rock'n Rope driver module -// Based on MAME driver by Chris Hardy - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "z80_intf.h" -#include "timeplt_snd.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809ROMDec; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprRAM; - -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 irq_enable; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 watchdog; - -static struct BurnInputInfo RocnropeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Rocnrope) - -static struct BurnDIPInfo RocnropeDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x5b, NULL }, - {0x14, 0xff, 0xff, 0x96, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 16, "Difficulty" }, - {0x13, 0x01, 0x78, 0x78, "1 (Easy)" }, - {0x13, 0x01, 0x78, 0x70, "2" }, - {0x13, 0x01, 0x78, 0x68, "3" }, - {0x13, 0x01, 0x78, 0x60, "4" }, - {0x13, 0x01, 0x78, 0x58, "5" }, - {0x13, 0x01, 0x78, 0x50, "6" }, - {0x13, 0x01, 0x78, 0x48, "7" }, - {0x13, 0x01, 0x78, 0x40, "8" }, - {0x13, 0x01, 0x78, 0x38, "9" }, - {0x13, 0x01, 0x78, 0x30, "10" }, - {0x13, 0x01, 0x78, 0x28, "11" }, - {0x13, 0x01, 0x78, 0x20, "12" }, - {0x13, 0x01, 0x78, 0x18, "13" }, - {0x13, 0x01, 0x78, 0x10, "14" }, - {0x13, 0x01, 0x78, 0x08, "15" }, - {0x13, 0x01, 0x78, 0x00, "16 (Difficult)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "First Bonus" }, - {0x14, 0x01, 0x07, 0x06, "20000" }, - {0x14, 0x01, 0x07, 0x05, "30000" }, - {0x14, 0x01, 0x07, 0x04, "40000" }, - {0x14, 0x01, 0x07, 0x03, "50000" }, - {0x14, 0x01, 0x07, 0x02, "60000" }, - {0x14, 0x01, 0x07, 0x01, "70000" }, - {0x14, 0x01, 0x07, 0x00, "80000" }, - - {0 , 0xfe, 0 , 5, "Repeated Bonus" }, - {0x14, 0x01, 0x38, 0x20, "40000" }, - {0x14, 0x01, 0x38, 0x18, "50000" }, - {0x14, 0x01, 0x38, 0x10, "60000" }, - {0x14, 0x01, 0x38, 0x08, "70000" }, - {0x14, 0x01, 0x38, 0x00, "80000" }, - - {0 , 0xfe, 0 , 2, "Grant Repeated Bonus" }, - {0x14, 0x01, 0x40, 0x40, "No" }, - {0x14, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Rocnrope) - -static UINT8 rocnrope_read(UINT16 address) -{ - switch (address) - { - case 0x3080: - return DrvInputs[0]; - - case 0x3081: - return DrvInputs[1]; - - case 0x3082: - return DrvInputs[2]; - - case 0x3083: - return DrvDips[0]; - - case 0x3000: - return DrvDips[1]; - - case 0x3100: - return DrvDips[2]; - } - - return 0; -} - -static void rocnrope_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8000: - watchdog = 0; - return; - - case 0x8080: - // flipscreen = ~data & 0x01; - return; - - case 0x8081: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x8082: - case 0x8083: - case 0x8084: - return; - - case 0x8087: - irq_enable = data & 0x01; - if (!irq_enable) { - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - } - return; - - case 0x8100: - TimepltSndSoundlatch(data); - return; - - case 0x8182: // write irq vectors! - case 0x8183: - case 0x8184: - case 0x8185: - case 0x8186: - case 0x8187: - case 0x8188: - case 0x8189: - case 0x818a: - case 0x818b: - case 0x818c: - case 0x818d: - DrvM6809ROM[0xfff0 + (address & 0xf)] = data; - return; - } -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset(AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - TimepltSndReset(); - - irq_enable = 0; - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x010000; - DrvM6809ROMDec = Next; Next += 0x010000; - DrvZ80ROM = Next; Next += 0x003000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000220; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM = Next; Next += 0x001010; - DrvSprRAM = Next; Next += 0x000800; - DrvColRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvZ80RAM = Next; Next += 0x000400; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x10004, 0x10000, 4, 0 }; - INT32 Plane1[4] = { 0x20004, 0x20000, 4, 0 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x8000); - - GfxDecode(0x100, 4, 16, 16, Plane1, XOffs, YOffs, 0x200, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x4000); - - GfxDecode(0x200, 4, 8, 8, Plane0, XOffs, YOffs, 0x080, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static void M6809Decode() -{ - for (INT32 i = 0x6000; i < 0x10000; i++) { - DrvM6809ROMDec[i] = DrvM6809ROM[i] ^ (((i&2)?0x80:0x20)|((i&8)?0x08:0x02)); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x06000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0a000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0e000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x01000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x06000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00120, 15, 1)) return 1; - - M6809Decode(); - DrvGfxDecode(); - - DrvM6809ROMDec[0x703d] = 0x98; // Patch bad opcode - - // allow us to use Color Prom data as transparency table for sprites - for (INT32 i = 0; i < 0x200; i++) { - DrvColPROM[0x20 + i] &= 0xf; - } - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvSprRAM, 0x4000, 0x47ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x4800, 0x4bff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x4c00, 0x4fff, MAP_RAM); - M6809MapMemory(DrvM6809RAM, 0x5000, 0x5fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x6000, 0x6000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809ROMDec + 0x6000, 0x6000, 0xffff, MAP_FETCH); - M6809SetWriteHandler(rocnrope_write); - M6809SetReadHandler(rocnrope_read); - M6809Close(); - - TimepltSndInit(DrvZ80ROM, DrvZ80RAM, 0); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - - TimepltSndExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pens[16]; - - for (INT32 i = 0; i < 16; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = bit2 * 151 + bit1 * 71 + bit0 * 33; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = bit2 * 151 + bit1 * 71 + bit0 * 33; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = bit1 * 174 + bit0 * 81; - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) - { - DrvPalette[i] = pens[DrvColPROM[0x20 + i]]; - } -} - -static void draw_layer() -{ - for (INT32 offs = (32 * 2); offs < (32 * 32) - (2 * 32); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + ((attr & 0x80) << 1); - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x20; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy - 16, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy - 16, color, 4, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy - 16, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile(pTransDraw, code, sx, sy - 16, color, 4, 0x100, DrvGfxROM1); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x30 - 2; offs >= 0; offs -= 2) - { - INT32 attr = DrvSprRAM[0x000 + offs + 0]; - INT32 code = DrvSprRAM[0x400 + offs + 1]; - INT32 sx = DrvSprRAM[0x400 + offs + 0]; - INT32 sy = DrvSprRAM[0x000 + offs + 1]; - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x40; - INT32 flipy =~attr & 0x80; - - RenderTileTranstab(pTransDraw, DrvGfxROM0, code, color * 16, 0, 240 - sx, sy - 16, flipx, flipy, 16, 16, DrvColPROM + 0x20); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 1536000 / 60, 1789772 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] * (i + 1)) / nInterleave; - nCyclesDone[0] += M6809Run(nSegment - nCyclesDone[0]); - if (i == (nInterleave - 1) && irq_enable) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - - nSegment = (nCyclesTotal[1] * i) / nInterleave; - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - ZetClose(); - M6809Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - ZetScan(nAction); - - TimepltSndScan(nAction, pnMin); - - SCAN_VAR(irq_enable); - } - - // Read and write irq vectors - if (nAction & ACB_READ) { - memcpy (DrvM6809RAM + 0x1000, DrvM6809ROM + 0xfff2, 0x0c); - } - - if (nAction & ACB_WRITE) { - memcpy (DrvM6809ROM + 0xfff2, DrvM6809RAM + 0x1000, 0x0c); - } - - return 0; -} - - -// Roc'n Rope - -static struct BurnRomInfo rocnropeRomDesc[] = { - { "rr1.1h", 0x2000, 0x83093134, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "rr2.2h", 0x2000, 0x75af8697, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rr3.3h", 0x2000, 0xb21372b1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rr4.4h", 0x2000, 0x7acb2a05, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rnr_h5.vid", 0x2000, 0x150a6264, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "rnr_7a.snd", 0x1000, 0x75d2c4e2, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "rnr_8a.snd", 0x1000, 0xca4325ae, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "rnr_a11.vid", 0x2000, 0xafdaba5e, 3 | BRF_GRA }, // 7 Sprites - { "rnr_a12.vid", 0x2000, 0x054cafeb, 3 | BRF_GRA }, // 8 - { "rnr_a9.vid", 0x2000, 0x9d2166b2, 3 | BRF_GRA }, // 9 - { "rnr_a10.vid", 0x2000, 0xaff6e22f, 3 | BRF_GRA }, // 10 - - { "rnr_h12.vid", 0x2000, 0xe2114539, 4 | BRF_GRA }, // 11 Characters - { "rnr_h11.vid", 0x2000, 0x169a8f3f, 4 | BRF_GRA }, // 12 - - { "a17_prom.bin", 0x0020, 0x22ad2c3e, 5 | BRF_GRA }, // 13 Color PROMs - { "b16_prom.bin", 0x0100, 0x750a9677, 5 | BRF_GRA }, // 14 - { "rocnrope.pr3", 0x0100, 0xb5c75a27, 5 | BRF_GRA }, // 15 - - { "h100.6g", 0x0001, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 16 PALs -}; - -STD_ROM_PICK(rocnrope) -STD_ROM_FN(rocnrope) - -struct BurnDriver BurnDrvRocnrope = { - "rocnrope", NULL, NULL, NULL, "1983", - "Roc'n Rope\0", NULL, "Konami", "GX364", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, rocnropeRomInfo, rocnropeRomName, NULL, NULL, RocnropeInputInfo, RocnropeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Roc'n Rope (Kosuka) - -static struct BurnRomInfo rocnropekRomDesc[] = { - { "rnr_h1.vid", 0x2000, 0x0fddc1f6, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "rnr_h2.vid", 0x2000, 0xce9db49a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rnr_h3.vid", 0x2000, 0x6d278459, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rnr_h4.vid", 0x2000, 0x9b2e5f2a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rnr_h5.vid", 0x2000, 0x150a6264, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "rnr_7a.snd", 0x1000, 0x75d2c4e2, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "rnr_8a.snd", 0x1000, 0xca4325ae, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "rnr_a11.vid", 0x2000, 0xafdaba5e, 3 | BRF_GRA }, // 7 Sprites - { "rnr_a12.vid", 0x2000, 0x054cafeb, 3 | BRF_GRA }, // 8 - { "rnr_a9.vid", 0x2000, 0x9d2166b2, 3 | BRF_GRA }, // 9 - { "rnr_a10.vid", 0x2000, 0xaff6e22f, 3 | BRF_GRA }, // 10 - - { "rnr_h12.vid", 0x2000, 0xe2114539, 4 | BRF_GRA }, // 11 Characters - { "rnr_h11.vid", 0x2000, 0x169a8f3f, 4 | BRF_GRA }, // 12 - - { "a17_prom.bin", 0x0020, 0x22ad2c3e, 5 | BRF_GRA }, // 13 Color PROMs - { "b16_prom.bin", 0x0100, 0x750a9677, 5 | BRF_GRA }, // 14 - { "rocnrope.pr3", 0x0100, 0xb5c75a27, 5 | BRF_GRA }, // 15 - - { "h100.6g", 0x0001, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 16 PALs -}; - -STD_ROM_PICK(rocnropek) -STD_ROM_FN(rocnropek) - -struct BurnDriver BurnDrvRocnropek = { - "rocnropek", "rocnrope", NULL, NULL, "1983", - "Roc'n Rope (Kosuka)\0", NULL, "Konami / Kosuka", "GX364", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, rocnropekRomInfo, rocnropekRomName, NULL, NULL, RocnropeInputInfo, RocnropeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Ropeman (bootleg of Roc'n Rope) - -static struct BurnRomInfo ropemanRomDesc[] = { - { "r1.1j", 0x2000, 0x6310a1fe, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "r2.2j", 0x2000, 0x75af8697, 1 | BRF_PRG | BRF_ESS }, // 1 - { "r3.3j", 0x2000, 0xb21372b1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "r4.4j", 0x2000, 0x7acb2a05, 1 | BRF_PRG | BRF_ESS }, // 3 - { "r5.5j", 0x2000, 0x150a6264, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "r12.7a", 0x1000, 0x75d2c4e2, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "r13.8a", 0x1000, 0xca4325ae, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "r10.11a", 0x2000, 0xafdaba5e, 3 | BRF_GRA }, // 7 Sprites - { "r11.12a", 0x2000, 0x054cafeb, 3 | BRF_GRA }, // 8 - { "r8.9a", 0x2000, 0x9d2166b2, 3 | BRF_GRA }, // 9 - { "r9.10a", 0x2000, 0xaff6e22f, 3 | BRF_GRA }, // 10 - - { "r7.12j", 0x2000, 0xcd8ac4bf, 4 | BRF_GRA }, // 11 Characters - { "r6.11j", 0x2000, 0x35891835, 4 | BRF_GRA }, // 12 - - { "1.17a", 0x0020, 0x22ad2c3e, 5 | BRF_GRA }, // 13 Color PROMs - { "2.16b", 0x0100, 0x750a9677, 5 | BRF_GRA }, // 14 - { "3.16g", 0x0100, 0xb5c75a27, 5 | BRF_GRA }, // 15 - - { "pal10l8.6g", 0x0001, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 16 PALs - { "n82s153.pal1.bin", 0x00eb, 0xbaebe804, 6 | BRF_OPT }, // 17 - { "n82s153.pal2.bin", 0x00eb, 0xa0e1b7a0, 6 | BRF_OPT }, // 18 -}; - -STD_ROM_PICK(ropeman) -STD_ROM_FN(ropeman) - -struct BurnDriver BurnDrvRopeman = { - "ropeman", "rocnrope", NULL, NULL, "1983", - "Ropeman (bootleg of Roc'n Rope)\0", NULL, "bootleg", "GX364", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, ropemanRomInfo, ropemanRomName, NULL, NULL, RocnropeInputInfo, RocnropeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_rollerg.cpp b/jan/src/burn/drv/konami/d_rollerg.cpp deleted file mode 100644 index 1c7e625bf..000000000 --- a/jan/src/burn/drv/konami/d_rollerg.cpp +++ /dev/null @@ -1,611 +0,0 @@ -// FB Alpha Roller Games driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "k053260.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 readzoomroms; -static UINT8 *nDrvBank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo RollergInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Rollerg) - -static struct BurnDIPInfo RollergDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x56, NULL }, - {0x14, 0xff, 0xff, 0x0f, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x01, "3" }, - {0x13, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Energy" }, - {0x13, 0x01, 0x18, 0x00, "1/2 for Stage Winner" }, - {0x13, 0x01, 0x18, 0x08, "1/4 for Stage Winner" }, - {0x13, 0x01, 0x18, 0x10, "1/4 for Cycle Winner" }, - {0x13, 0x01, 0x18, 0x18, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x01, 0x01, "Off" }, -// {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Rollerg) - -void rollerg_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0010: - readzoomroms = data & 0x04; - K051316WrapEnable(0, data & 0x20); - return; - - case 0x0020: - // watchdog - return; - - case 0x0030: - case 0x0031: - K053260Write(0, address & 1, data); - return; - - case 0x0040: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } - - if ((address & 0xfff0) == 0x0200) { - K051316WriteCtrl(0, address & 0x0f, data); - return; - } - - if ((address & 0xfff0) == 0x0300) { - K053244Write(0, address & 0x0f, data); - return; - } - - if ((address & 0xf800) == 0x0800) { - K051316Write(0, address & 0x7ff, data); - return; - } - - if ((address & 0xf800) == 0x1000) { - K053245Write(0, address & 0x7ff, data); - return; - } -} - -UINT8 rollerg_main_read(UINT16 address) -{ - switch (address) - { - case 0x0020: // watchdog - return 0; - - case 0x0030: - case 0x0031: - return K053260Read(0, (address & 1)+2); - - case 0x0050: - return DrvInputs[0]; - - case 0x0051: - return DrvInputs[1]; - - case 0x0052: - return (DrvInputs[2] & 0xf0) | (DrvDips[2] & 0x0f); - - case 0x0053: - return DrvDips[0]; - - case 0x0060: - return DrvDips[1]; - - case 0x0061: - return 0x7f; - } - - if ((address & 0xfff0) == 0x0300) { - return K053244Read(0, address & 0x0f); - } - - if ((address & 0xf800) == 0x0800) { - if (readzoomroms) - return K051316ReadRom(0, address & 0x7ff); - else - return K051316Read(0, address & 0x7ff); - } - - if ((address & 0xf800) == 0x1000) { - return K053245Read(0, address & 0x7ff); - } - - return 0; -} - -void __fastcall rollerg_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - case 0xc001: - BurnYM3812Write(0, address & 1, data); - return; - - case 0xfc00: - ZetRun(100); - ZetNmi(); - return; - } - - if (address >= 0xa000 && address <= 0xa02f) { - K053260Write(0, address & 0x3f, data); - return; - } -} - -UINT8 __fastcall rollerg_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - return BurnYM3812Read(0, address & 1); - } - - if (address >= 0xa000 && address <= 0xa02f) { - // not sure... - if ((address & 0x3e) == 0x00) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - - return K053260Read(0, address & 0x3f); - } - - return 0; -} - -static void rollerg_set_lines(INT32 lines) -{ - nDrvBank[0] = lines; - - INT32 offs = 0x10000 + ((lines & 0x07) * 0x4000); - - konamiMapMemory(DrvKonROM + offs, 0x4000, 0x7fff, MAP_ROM); -} - -static void K053245Callback(INT32 *, INT32 *color, INT32 *priority) -{ - *priority = (*color & 0x10) ? 0 : 0x02; - *color = 16 + (*color & 0x0f); -} - -static void K051316Callback(INT32 *code, INT32 *color, INT32 *flags) -{ - *flags = (*color & 0xc0) >> 6; - *code |= ((*color & 0x0f) << 8); - *color = ((*color & 0x30) >> 4); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - K053260Reset(0); - BurnYM3812Reset(); - - KonamiICReset(); - - readzoomroms = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x030000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROMExp0 = Next; Next += 0x400000; - DrvGfxROMExp1 = Next; Next += 0x100000; - - DrvSndROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - AllRam = Next; - - DrvKonRAM = Next; Next += 0x001b00; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - nDrvBank = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x010000, 0, 1)) return 1; - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x28000, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 2, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 3, 4, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 6, 1)) return 1; - - K053245GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x200000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvPalRAM, 0x1800, 0x1fff, MAP_RAM); - konamiMapMemory(DrvKonRAM, 0x2000, 0x3aff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x4000, 0x4000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(rollerg_main_write); - konamiSetReadHandler(rollerg_main_read); - konamiSetlinesCallback(rollerg_set_lines); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(rollerg_sound_write); - ZetSetReadHandler(rollerg_sound_read); - ZetClose(); - - K053245Init(0, DrvGfxROM0, DrvGfxROMExp0, 0x1fffff, K053245Callback); - K053245SetSpriteOffset(0, -112, 16); - - K051316Init(0, DrvGfxROM1, DrvGfxROMExp1, 0x07ffff, K051316Callback, 4, 0); - K051316SetOffset(0, -90, -15); - - BurnYM3812Init(1, 3579545, NULL, DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3579545); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - K053260Init(0, 3579545, DrvSndROM, 0x80000); - K053260PCMSetAllRoutes(0, 0.70, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - BurnYM3812Exit(); - K053260Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x800); - - KonamiClearBitmaps(DrvPalette[0x100]); - - K051316_zoom_draw(0, 1); - K053245SpritesRender(0); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - konamiNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[0] & 0x18) == 0) DrvInputs[0] |= 0x18; - if ((DrvInputs[0] & 0x60) == 0) DrvInputs[0] |= 0x60; - if ((DrvInputs[1] & 0x18) == 0) DrvInputs[1] |= 0x18; - if ((DrvInputs[1] & 0x60) == 0) DrvInputs[1] |= 0x60; - } - - INT32 nInterleave = nBurnSoundLen; - INT32 nCyclesTotal[2] = { 3000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = konamiRun(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - K053260Update(0, pBurnSoundOut, nBurnSoundLen); - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - K053260Scan(nAction); - - KonamiICScan(nAction); - - SCAN_VAR(readzoomroms); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - rollerg_set_lines(nDrvBank[0]); - konamiClose(); - } - - return 0; -} - - -// Rollergames (US) - -static struct BurnRomInfo rollergRomDesc[] = { - { "999m02.g7", 0x020000, 0x3df8db93, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "999m01.e11", 0x008000, 0x1fcfb22f, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "999h06.k2", 0x100000, 0xeda05130, 3 | BRF_GRA }, // 2 K053245 Tiles - { "999h05.k8", 0x100000, 0x5f321c7d, 3 | BRF_GRA }, // 3 - - { "999h03.d23", 0x040000, 0xea1edbd2, 4 | BRF_GRA }, // 4 K051316 Tiles - { "999h04.f23", 0x040000, 0xc1a35355, 4 | BRF_GRA }, // 5 - - { "999h09.c5", 0x080000, 0xc5188783, 5 | BRF_SND }, // 6 K053260 Samples -}; - -STD_ROM_PICK(rollerg) -STD_ROM_FN(rollerg) - -struct BurnDriver BurnDrvRollerg = { - "rollerg", NULL, NULL, NULL, "1991", - "Rollergames (US)\0", NULL, "Konami", "GX999", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, rollergRomInfo, rollergRomName, NULL, NULL, RollergInputInfo, RollergDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; - - -// Rollergames (Japan) - -static struct BurnRomInfo rollergjRomDesc[] = { - { "999v02.bin", 0x020000, 0x0dd8c3ac, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "999m01.e11", 0x008000, 0x1fcfb22f, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "999h06.k2", 0x100000, 0xeda05130, 3 | BRF_GRA }, // 2 K053245 Tiles - { "999h05.k8", 0x100000, 0x5f321c7d, 3 | BRF_GRA }, // 3 - - { "999h03.d23", 0x040000, 0xea1edbd2, 4 | BRF_GRA }, // 4 K051316 Tiles - { "999h04.f23", 0x040000, 0xc1a35355, 4 | BRF_GRA }, // 5 - - { "999h09.c5", 0x080000, 0xc5188783, 5 | BRF_SND }, // 6 K053260 Samples -}; - -STD_ROM_PICK(rollergj) -STD_ROM_FN(rollergj) - -struct BurnDriver BurnDrvRollergj = { - "rollergj", "rollerg", NULL, NULL, "1991", - "Rollergames (Japan)\0", NULL, "Konami", "GX999", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, rollergjRomInfo, rollergjRomName, NULL, NULL, RollergInputInfo, RollergDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_scotrsht.cpp b/jan/src/burn/drv/konami/d_scotrsht.cpp deleted file mode 100644 index 7e7e0e4b2..000000000 --- a/jan/src/burn/drv/konami/d_scotrsht.cpp +++ /dev/null @@ -1,648 +0,0 @@ -// FB Alpha Scooter Shooter driver module -// Based on MAME driver by Pierpaolo Prazzoli - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT32 *Palette; -static UINT8 DrvRecalc; - -static UINT8 *scroll; - -static UINT8 *soundlatch; -static UINT8 *charbank; -static UINT8 *irq_enable; -static UINT8 *flipscreen; -static UINT8 *palbank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvReset; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo ScotrshtInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Scotrsht) - -static struct BurnDIPInfo ScotrshtDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x5d, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "2" }, - {0x11, 0x01, 0x03, 0x02, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x08, 0x08, "30K 80K" }, - {0x11, 0x01, 0x08, 0x00, "40K 90K" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x30, 0x30, "Easy" }, - {0x11, 0x01, 0x30, 0x20, "Normal" }, - {0x11, 0x01, 0x30, 0x10, "Difficult" }, - {0x11, 0x01, 0x30, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, -}; - -STDDIPINFO(Scotrsht) - -void scotrsht_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2043: - *charbank = data & 1; - return; - - case 0x2044: - *irq_enable = data & 2; - *flipscreen = data & 8; - return; - - case 0x3000: - *palbank = (data & 0x70) >> 4; - return; - - case 0x3100: - *soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x3300: - // watchdog - return; - } - - if ((address & 0xffe0) == 0x2000) { - scroll[address & 0x1f] = data; - return; - } -} - -UINT8 scotrsht_main_read(UINT16 address) -{ - switch (address) - { - case 0x3100: - return DrvDips[1]; - - case 0x3200: - return DrvDips[2]; - - case 0x3300: - return DrvInputs[0]; - - case 0x3301: - return DrvInputs[1]; - - case 0x3302: - return DrvInputs[2]; - - case 0x3303: - return DrvDips[0]; - } - - if ((address & 0xffe0) == 0x2000) { - return scroll[address & 0x1f]; - } - - return 0; -} - -UINT8 __fastcall scotrsht_sound_read(UINT16 address) -{ - if (address == 0x8000) { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -void __fastcall scotrsht_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - BurnYM2203Write(0, port & 1, data); - return; - } -} - -UINT8 __fastcall scotrsht_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM2203Read(0, port & 1); - } - - return 0; -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3072000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3072000.0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x010000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000500; - - DrvPalette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - Palette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - - AllRam = Next; - - scroll = Next; Next += 0x000020; - - DrvSprRAM = Next; Next += 0x001000; - DrvColRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000400; - - soundlatch = Next; Next += 0x000001; - charbank = Next; Next += 0x000001; - irq_enable = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - palbank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 r = DrvColPROM[i + 0x000] & 0x0f; - INT32 g = DrvColPROM[i + 0x100] & 0x0f; - INT32 b = DrvColPROM[i + 0x200] & 0x0f; - - DrvPalette[i] = (r << 20) | (r << 16) | (g << 12) | (g << 8) | (b << 4) | (b << 0); - } - - for (INT32 i = 0; i < 0x200; i++) { - for (INT32 j = 0; j < 8; j++) { - INT32 col = ((~i & 0x100) >> 1) | (j << 4) | (DrvColPROM[i + 0x300] & 0x0f); - Palette[((i & 0x100) << 3) | (j << 8) | (i & 0xff)] = DrvPalette[col]; - } - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { STEP4(0,1) }; - INT32 XOffs[16] = { STEP8(0,4), STEP8(256,4) }; - INT32 YOffs[16] = { STEP8(0,32), STEP8(512,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x10000); - - GfxDecode(0x0200, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x08000, 0, 1)) return 1; - memcpy (DrvM6809ROM + 0x4000, DrvM6809ROM + 0xc000, 0x4000); - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 5, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 10, 1)) return 1; - - DrvPaletteInit(); - DrvGfxDecode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvColRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x0800, 0x0fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x04000, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(scotrsht_main_write); - M6809SetReadHandler(scotrsht_main_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM); - ZetMapArea(0x4000, 0x43ff, 0, DrvZ80RAM); - ZetMapArea(0x4000, 0x43ff, 1, DrvZ80RAM); - ZetMapArea(0x4000, 0x43ff, 2, DrvZ80RAM); - ZetSetReadHandler(scotrsht_sound_read); - ZetSetOutHandler(scotrsht_sound_out); - ZetSetInHandler(scotrsht_sound_in); - ZetClose(); - - BurnYM2203Init(1, 3072000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3072000); - BurnYM2203SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - ZetExit(); - - BurnYM2203Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - for (INT32 offs = 0x0000; offs < 0x0800; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - if (sx & 0x100) continue; - - sy -= scroll[offs & 0x1f]; - if (sy < -7) sy += 256; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] | (*charbank << 9) | ((attr & 0x40) << 2); - INT32 color= (attr & 0x0f) | (*palbank << 4); - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - - if (*flipscreen) - { - flipx = !flipx; - flipy = !flipy; - sy = 248 - sy; - sx = 248 - sx; - } - - sy -= 16; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 i = 0; i < 0xc0; i += 4) - { - INT32 attr = DrvSprRAM[i + 1]; - INT32 code = DrvSprRAM[i + 0] + ((attr & 0x40) << 2); - INT32 sx = DrvSprRAM[i + 2] - ((attr & 0x80) << 1); - INT32 sy = DrvSprRAM[i + 3]; - INT32 color = (attr & 0x0f) | (*palbank << 4); - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - - if (*flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 16; - - { - if (flipx) flipx = 0x0f; - if (flipy) flipx |= 0xf0; - - color = (color << 4) | 0x800; - - UINT8 *src = DrvGfxROM1 + (code << 8); - - for (INT32 y = 0; y < 16; y++, sy++) - { - if (sy < 0 || sy >= nScreenHeight) continue; - - INT32 xx = sx; - - for (INT32 x = 0; x < 16; x++, xx++) - { - if (xx < 0 || xx >= nScreenWidth) continue; - - INT32 pxl = src[((y << 4) | x) ^ flipx] | color; - INT32 trans = DrvPalette[pxl & 0xfff]; - - if (trans) { - pTransDraw[(sy * nScreenWidth) + xx] = pxl; - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i++) { - UINT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol((rgb >> 16)&0xff, (rgb >> 8)&0xff, rgb&0xff, 0); - } - } - - BurnTransferClear(); - draw_layer(); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 3072000 / 60, 3072000 / 60 }; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - - M6809Run(nCyclesTotal[0] / nInterleave); - - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (*irq_enable) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029706; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - } - - return 0; -} - - -// Scooter Shooter - -static struct BurnRomInfo scotrshtRomDesc[] = { - { "gx545_g03_12c.bin", 0x8000, 0xb808e0d3, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "gx545_g02_10c.bin", 0x4000, 0xb22c0586, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gx545_g01_8c.bin", 0x4000, 0x46a7cc65, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "gx545_g05_5f.bin", 0x8000, 0x856c349c, 3 | BRF_GRA }, // 3 Characters - - { "gx545_g06_6f.bin", 0x8000, 0x14ad7601, 4 | BRF_GRA }, // 4 Sprites - { "gx545_h04_4f.bin", 0x8000, 0xc06c11a3, 4 | BRF_GRA }, // 5 - - { "gx545_6301_1f.bin", 0x0100, 0xf584586f, 5 | BRF_GRA }, // 6 Color Proms - { "gx545_6301_2f.bin", 0x0100, 0xad464db1, 5 | BRF_GRA }, // 7 - { "gx545_6301_3f.bin", 0x0100, 0xbd475d23, 5 | BRF_GRA }, // 8 - { "gx545_6301_7f.bin", 0x0100, 0x2b0cd233, 5 | BRF_GRA }, // 9 - { "gx545_6301_8f.bin", 0x0100, 0xc1c7cf58, 5 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(scotrsht) -STD_ROM_FN(scotrsht) - -struct BurnDriver BurnDrvScotrsht = { - "scotrsht", NULL, NULL, NULL, "1985", - "Scooter Shooter\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, scotrshtRomInfo, scotrshtRomName, NULL, NULL, ScotrshtInputInfo, ScotrshtDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_shaolins.cpp b/jan/src/burn/drv/konami/d_shaolins.cpp deleted file mode 100644 index 273d6fdc6..000000000 --- a/jan/src/burn/drv/konami/d_shaolins.cpp +++ /dev/null @@ -1,657 +0,0 @@ -// FB Alpha Shaolin's Road driver module -// Based on MAME driver by Allard Van Der Bas - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvColRAM; - -static UINT8 *flipscreen; -static UINT8 *nmi_enable; -static UINT8 *palette_bank; -static UINT16 *scroll; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static INT32 watchdog; - -static struct BurnInputInfo ShaolinsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Shaolins) - -static struct BurnDIPInfo ShaolinsDIPList[]= -{ - {0x12, 0xff, 0xff, 0x5a, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x03, "2" }, - {0x12, 0x01, 0x03, 0x02, "3" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x04, 0x00, "Upright" }, - {0x12, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x18, 0x18, "30000 and every 70000" }, - {0x12, 0x01, 0x18, 0x10, "40000 and every 80000" }, - {0x12, 0x01, 0x18, 0x08, "40000" }, - {0x12, 0x01, 0x18, 0x00, "50000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x60, 0x60, "Easy" }, - {0x12, 0x01, 0x60, 0x40, "Medium" }, - {0x12, 0x01, 0x60, 0x20, "Hard" }, - {0x12, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x13, 0x01, 0x02, 0x02, "Single" }, - {0x13, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, -}; - -STDDIPINFO(Shaolins) - -static void shaolins_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0000: - // *flipscreen = data & 0x01; - *nmi_enable = data & 0x02; - return; - - case 0x0100: - watchdog = 0; - return; - - case 0x0300: - SN76496Write(0, data); - return; - - case 0x0400: - SN76496Write(1, data); - return; - - case 0x0800: - case 0x1000: - return; // nop - - case 0x1800: - *palette_bank = data & 0x07; - return; - - case 0x2000: - scroll[0] = data + 1; - return; - } -} - -static UINT8 shaolins_read(UINT16 address) -{ - switch (address) - { - case 0x0500: - return DrvDips[0]; - - case 0x0600: - return DrvDips[1]; - - case 0x0700: - case 0x0701: - case 0x0702: - return DrvInputs[address & 3]; - - case 0x0703: - return DrvDips[2]; - } - - return 0; -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x00c0000; - - DrvGfxROM0 = Next; Next += 0x0080000; - DrvGfxROM1 = Next; Next += 0x0100000; - - DrvColPROM = Next; Next += 0x0005000; -; - DrvPalette = (UINT32*)Next; Next += 0x10000 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM = Next; Next += 0x0009000; - DrvSprRAM = Next; Next += 0x0003000; - DrvColRAM = Next; Next += 0x0004000; - DrvVidRAM = Next; Next += 0x0004000; - - scroll = (UINT16*)Next; Next += 0x000001 * sizeof(UINT16); - flipscreen = Next; Next += 0x000001; - palette_bank = Next; Next += 0x000001; - nmi_enable = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Plane0[4] = { 512*16*8+4, 512*16*8+0, 4, 0 }; - INT32 Plane1[4] = { 256*64*8+4, 256*64*8+0, 4, 0 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - - memcpy (tmp, DrvGfxROM0, 0x04000); - - GfxDecode(0x200, 4, 8, 8, Plane0, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x8000); - - GfxDecode(0x100, 4, 16, 16, Plane1, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); -} - -static void DrvPaletteInit() -{ - UINT32 pens[0x100]; - - INT32 weights[4] = { 2200,1000,470,220 }; - - { - INT32 total = 0; - for (INT32 i = 0; i < 4; i++) { - total += weights[i]; - } - - for (INT32 i = 0; i < 4; i++) { - weights[i] = (((((INT32)weights[i] * 10000) / total) * 255) + 5000) / 10000; - } - } - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[i + 0x000] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i + 0x000] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i + 0x000] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i + 0x000] >> 3) & 0x01; - INT32 r = (weights[3] * bit0) + (weights[2] * bit1) + (weights[1] * bit2) + (weights[0] * bit3); - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - INT32 g = (weights[3] * bit0) + (weights[2] * bit1) + (weights[1] * bit2) + (weights[0] * bit3); - - bit0 = (DrvColPROM[i + 0x200] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x200] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x200] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x200] >> 3) & 0x01; - INT32 b = (weights[3] * bit0) + (weights[2] * bit1) + (weights[1] * bit2) + (weights[0] * bit3); - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) - { - for (INT32 j = 0; j < 8; j++) - { - UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (DrvColPROM[0x300+i] & 0x0f); - DrvPalette[((i & 0x100) << 3) | (j << 8) | (i & 0xff)] = pens[ctabentry]; - } - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x2000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x4000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x8000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0300, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0400, 11, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x2800, 0x30ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x3100, 0x33ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x3800, 0x3bff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x3c00, 0x3fff, MAP_RAM); - - M6809MapMemory(DrvM6809ROM, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(shaolins_write); - M6809SetReadHandler(shaolins_read); - M6809Close(); - - SN76489AInit(0, 1536000, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - SN76489AInit(1, 3072000, 1); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = ((offs / 0x20) * 8); - - if (sx >= 32) sy -= scroll[0] & 0xff; - if (sy < -7) sy += 256; - sy -= 16; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] | ((attr & 0x40) << 2); - INT32 color =(attr & 0x0f) + (*palette_bank << 4); - INT32 flipy = attr & 0x20; - - if (flipy) { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x300 - 0x20; offs >= 0; offs -= 0x20) - { - if (!DrvSprRAM[offs] || !DrvSprRAM[offs + 6]) continue; - - INT32 sy = 248 - DrvSprRAM[offs + 4]; - INT32 sx = 240 - DrvSprRAM[offs + 6]; - INT32 code = DrvSprRAM[offs + 8]; - INT32 attr = DrvSprRAM[offs + 9]; - INT32 color = (attr & 0x0f) + (*palette_bank << 4); - INT32 flipx = ~attr & 0x40; - INT32 flipy = attr & 0x80; - - if (*flipscreen) - { - sx = 240 - sx; - sy = 248 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x800, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x800, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x800, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x800, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - M6809NewFrame(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal[1] = { 1536000 / 60 }; - INT32 nCyclesDone[1] = { 0 }; - INT32 nSoundBufferPos = 0; - - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - - if (*nmi_enable && (i & 0x1f) == 0) - M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // 480x/second (8x/frame) - - if (i == 240) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - } - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - - SN76496Scan(nAction, pnMin); - } - - return 0; -} - - -// Kicker - -static struct BurnRomInfo kickerRomDesc[] = { - { "477-l03.d9", 0x2000, 0x2598dfdd, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "477-l04.d10", 0x4000, 0x0cf0351a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "477-l05.d11", 0x4000, 0x654037f8, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "477-k06.a10", 0x2000, 0x4d156afc, 2 | BRF_GRA | BRF_ESS }, // 3 Characters - { "477-k07.a11", 0x2000, 0xff6ca5df, 2 | BRF_GRA | BRF_ESS }, // 4 - - { "477-k02.h15", 0x4000, 0xb94e645b, 3 | BRF_GRA | BRF_ESS }, // 5 Sprites - { "477-k01.h14", 0x4000, 0x61bbf797, 3 | BRF_GRA | BRF_ESS }, // 6 - - { "477j10.a12", 0x0100, 0xb09db4b4, 4 | BRF_GRA | BRF_ESS }, // 7 Color PROMs - { "477j11.a13", 0x0100, 0x270a2bf3, 4 | BRF_GRA | BRF_ESS }, // 8 - { "477j12.a14", 0x0100, 0x83e95ea8, 4 | BRF_GRA | BRF_ESS }, // 9 - { "477j09.b8", 0x0100, 0xaa900724, 4 | BRF_GRA | BRF_ESS }, // 10 - { "477j08.f16", 0x0100, 0x80009cf5, 4 | BRF_GRA | BRF_ESS }, // 11 -}; - -STD_ROM_PICK(kicker) -STD_ROM_FN(kicker) - -struct BurnDriver BurnDrvKicker = { - "kicker", NULL, NULL, NULL, "1985", - "Kicker\0", NULL, "Konami", "GX477", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, kickerRomInfo, kickerRomName, NULL, NULL, ShaolinsInputInfo, ShaolinsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; - - -// Shao-lin's Road (set 1) - -static struct BurnRomInfo shaolinsRomDesc[] = { - { "477-l03.d9", 0x2000, 0x2598dfdd, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "477-l04.d10", 0x4000, 0x0cf0351a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "477-l05.d11", 0x4000, 0x654037f8, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "shaolins.a10", 0x2000, 0xff18a7ed, 2 | BRF_GRA | BRF_ESS }, // 3 Characters - { "shaolins.a11", 0x2000, 0x5f53ae61, 2 | BRF_GRA | BRF_ESS }, // 4 - - { "477-k02.h15", 0x4000, 0xb94e645b, 3 | BRF_GRA | BRF_ESS }, // 5 Sprites - { "477-k01.h14", 0x4000, 0x61bbf797, 3 | BRF_GRA | BRF_ESS }, // 6 - - { "477j10.a12", 0x0100, 0xb09db4b4, 4 | BRF_GRA | BRF_ESS }, // 7 Color PROMs - { "477j11.a13", 0x0100, 0x270a2bf3, 4 | BRF_GRA | BRF_ESS }, // 8 - { "477j12.a14", 0x0100, 0x83e95ea8, 4 | BRF_GRA | BRF_ESS }, // 9 - { "477j09.b8", 0x0100, 0xaa900724, 4 | BRF_GRA | BRF_ESS }, // 10 - { "477j08.f16", 0x0100, 0x80009cf5, 4 | BRF_GRA | BRF_ESS }, // 11 -}; - -STD_ROM_PICK(shaolins) -STD_ROM_FN(shaolins) - -struct BurnDriver BurnDrvShaolins = { - "shaolins", "kicker", NULL, NULL, "1985", - "Shao-lin's Road (set 1)\0", NULL, "Konami", "GX477", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, shaolinsRomInfo, shaolinsRomName, NULL, NULL, ShaolinsInputInfo, ShaolinsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; - - -// Shao-lin's Road (set 2) - -static struct BurnRomInfo shaolinbRomDesc[] = { - { "3.h4", 0x2000, 0x2598dfdd, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "4.i4", 0x4000, 0x0cf0351a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5.j4", 0x4000, 0x654037f8, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "6.i1", 0x2000, 0xff18a7ed, 2 | BRF_GRA | BRF_ESS }, // 3 Characters - { "7.j1", 0x4000, 0xd9a7cff6, 2 | BRF_GRA | BRF_ESS }, // 4 - - { "2.m8", 0x4000, 0x560521c7, 3 | BRF_GRA | BRF_ESS }, // 5 Sprites - { "1.l8", 0x4000, 0xa79959b2, 3 | BRF_GRA | BRF_ESS }, // 6 - - { "3.k1", 0x0100, 0xb09db4b4, 4 | BRF_GRA | BRF_ESS }, // 7 Color PROMs - { "4.l1", 0x0100, 0x270a2bf3, 4 | BRF_GRA | BRF_ESS }, // 8 - { "5.m1", 0x0100, 0x83e95ea8, 4 | BRF_GRA | BRF_ESS }, // 9 - { "2.g2", 0x0100, 0xaa900724, 4 | BRF_GRA | BRF_ESS }, // 10 - { "1.o6", 0x0100, 0x80009cf5, 4 | BRF_GRA | BRF_ESS }, // 11 -}; - -STD_ROM_PICK(shaolinb) -STD_ROM_FN(shaolinb) - -struct BurnDriver BurnDrvShaolinb = { - "shaolinb", "kicker", NULL, NULL, "1985", - "Shao-lin's Road (set 2)\0", NULL, "Konami", "GX477", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, shaolinbRomInfo, shaolinbRomName, NULL, NULL, ShaolinsInputInfo, ShaolinsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_simpsons.cpp b/jan/src/burn/drv/konami/d_simpsons.cpp deleted file mode 100644 index dd974db3d..000000000 --- a/jan/src/burn/drv/konami/d_simpsons.cpp +++ /dev/null @@ -1,981 +0,0 @@ -// FB Alpha The Simpsons driver module -// Based on MAME driver by Ernesto Corvi and various others - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "k053260.h" -#include "eeprom.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *nDrvBank; - -static INT32 videobank; -static INT32 init_eeprom_count; -static INT32 simpsons_firq_enabled; -static INT32 K053246Irq; - -static INT32 bg_colorbase; -static INT32 sprite_colorbase; -static INT32 layer_colorbase[3]; -static INT32 layerpri[3]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDiag; -static UINT8 DrvReset; -static UINT8 DrvInputs[5]; - -static INT32 nCyclesDone[2]; - -static struct BurnInputInfo SimpsonsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy5 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 7, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 2, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 3, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 0, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 1, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy5 + 3, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 7, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 2, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 3, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 0, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 1, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 2" }, - - {"Diagnostics", BIT_DIGITAL, &DrvDiag, "diag" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, -}; - -STDINPUTINFO(Simpsons) - -static struct BurnInputInfo Simpsons2pInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Diagnostics", BIT_DIGITAL, &DrvDiag, "diag" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, -}; - -STDINPUTINFO(Simpsons2p) - -void simpsons_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1fa0: - case 0x1fa1: - case 0x1fa2: - case 0x1fa3: - case 0x1fa4: - case 0x1fa5: - case 0x1fa6: - case 0x1fa7: - K053246Write(address & 7, data); - return; - - case 0x1fc0: - K052109RMRDLine = data & 0x08; - K053246_set_OBJCHA_line(~data & 0x20); - return; - - case 0x1fc2: - { - if (data == 0xff) return; // ok? - - EEPROMWrite((data & 0x10) >> 3, (data & 0x08) >> 3, (data & 0x80) >> 7); - - videobank = data & 3; - simpsons_firq_enabled = data & 0x04; - } - return; - - case 0x1fc6: - case 0x1fc7: - K053260Write(0, address & 1, data); - return; - } - - if ((address & 0xf000) == 0x0000) { - if (videobank & 1) { - DrvPalRAM[address & 0x0fff] = data; - return; - } - } - - if ((address & 0xfff0) == 0x1fb0) { - K053251Write(address & 0x0f, data); - return; - } - - if ((address & 0xe000) == 0x2000) { - if (videobank & 2) { - address ^= 1; - DrvSprRAM[address & 0x1fff] = data; - return; - } - } - - if ((address & 0xc000) == 0x0000) { - K052109Write(address & 0x3fff, data); - return; - } -} - -UINT8 simpsons_main_read(UINT16 address) -{ - switch (address) - { - case 0x1f81: - { - INT32 res = ((EEPROMRead() & 1) << 4) | 0x20 | (~DrvDiag & 1); - - if (init_eeprom_count > 0) - { - init_eeprom_count--; - res &= 0xfe; - } - return res; - } - - case 0x1f80: - return DrvInputs[4]; - - case 0x1f90: - return DrvInputs[0]; - - case 0x1f91: - return DrvInputs[1]; - - case 0x1f92: - return DrvInputs[2]; - - case 0x1f93: - return DrvInputs[3]; - - case 0x1fc4: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return 0; - - case 0x1fc6: - case 0x1fc7: - return K053260Read(0, (address & 1)+2); - - case 0x1fc8: - case 0x1fc9: - return K053246Read(address & 1); - - case 0x1fca: - return 0; // watchdog - } - - if ((address & 0xf000) == 0x0000) { - if (videobank & 1) { - return DrvPalRAM[address & 0x0fff]; - } - } - - if ((address & 0xe000) == 0x2000) { - if (videobank & 2) { - address ^= 1; - return DrvSprRAM[address & 0x1fff]; - } - } - - if ((address & 0xc000) == 0x0000) { - return K052109Read(address & 0x3fff); - } - - return 0; -} - -static void DrvZ80Bankswitch(INT32 data) -{ - data &= 0x07; - if (data < 2) return; - - INT32 nBank = (data & 7) * 0x4000; - - nDrvBank[1] = data; - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + nBank); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + nBank); -} - -void __fastcall simpsons_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf800: - BurnYM2151SelectRegister(data); - return; - - case 0xf801: - BurnYM2151WriteRegister(data); - return; - - case 0xfa00: - nCyclesDone[1] += ZetRun(100); - ZetNmi(); - return; - - case 0xfe00: - DrvZ80Bankswitch(data); - return; - } - - if (address >= 0xfc00 && address < 0xfc30) { - K053260Write(0, address & 0xff, data); - return; - } -} - -UINT8 __fastcall simpsons_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return 0xff; - case 0xf801: - return BurnYM2151ReadStatus(); - } - - if (address >= 0xfc00 && address < 0xfc30) { - if ((address & 0x3f) == 0x01) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - - return K053260Read(0, address & 0xff); - } - - return 0; -} - -static void simpsons_set_lines(INT32 lines) -{ - nDrvBank[0] = lines; - - INT32 nBank = (lines & 0x3f) * 0x2000; - - konamiMapMemory(DrvKonROM + 0x10000 + nBank, 0x6000, 0x7fff, MAP_ROM); -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - *code |= ((*color & 0x3f) << 8) | (bank << 14); - *color = layer_colorbase[layer] + ((*color & 0xc0) >> 6); - *code &= 0x7fff; -} - -static void DrvK053247Callback(INT32 *code, INT32 *color, INT32 *priority) -{ - INT32 pri = (*color & 0x0f80) >> 6; - if (pri <= layerpri[2]) *priority = 0x00; - else if (pri > layerpri[2] && pri <= layerpri[1]) *priority = 0xf0; - else if (pri > layerpri[1] && pri <= layerpri[0]) *priority = 0xfc; - else *priority = 0xfe; - - *color = sprite_colorbase + (*color & 0x001f); - - *code &= 0x7fff; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - K053260Reset(0); - - EEPROMReset(); - - videobank = 0; - - if (EEPROMAvailable()) { - init_eeprom_count = 0; - } else { - init_eeprom_count = 10; - } - - simpsons_firq_enabled = 0; - K053246Irq = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x090000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROMExp0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROMExp1 = Next; Next += 0x800000; - - DrvSndROM = Next; Next += 0x200000; - - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - - DrvKonRAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x002000; - - nDrvBank = Next; Next += 0x000002; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static const eeprom_interface simpsons_eeprom_intf = -{ - 7, // address bits - 8, // data bits - "011000", // read command - "011100", // write command - 0, // erase command - "0100000000000", // lock command - "0100110000000", // unlock command - 0, - 0 -}; - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x010000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x030000, 1, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x050000, 2, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x070000, 3, 1)) return 1; - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x88000, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 10, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x100000, 12, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x100000); - K053247GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x400000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonRAM, 0x4000, 0x5fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(simpsons_main_write); - konamiSetReadHandler(simpsons_main_read); - konamiSetlinesCallback(simpsons_set_lines); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + 0x08000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + 0x08000); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(simpsons_sound_write); - ZetSetReadHandler(simpsons_sound_read); - ZetClose(); - - EEPROMInit(&simpsons_eeprom_intf); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x0fffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(8, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x3fffff, DrvK053247Callback, 0x03 /* shadows & highlights */); - K053247SetSpriteOffset(-59, -39); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.00, BURN_SND_ROUTE_BOTH); // not connected - - K053260Init(0, 3579545, DrvSndROM, 0x140000); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.75, BURN_SND_ROUTE_RIGHT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.75, BURN_SND_ROUTE_LEFT); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - EEPROMExit(); - - BurnYM2151Exit(); - K053260Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void simpsons_objdma() -{ - INT32 counter, num_inactive; - UINT8 *dstptr; - UINT16 *src, *dst; - - K053247Export(&dstptr, 0, 0, 0, &counter); - src = (UINT16*)DrvSprRAM; - dst = (UINT16*)dstptr; - num_inactive = counter = 256; - - do { - if ((*src & BURN_ENDIAN_SWAP_INT16(0x8000)) && (*src & BURN_ENDIAN_SWAP_INT16(0xff))) - { - memcpy(dst, src, 0x10); - dst += 8; - num_inactive--; - } - src += 8; - } - while (--counter); - - if (num_inactive) do { *dst = 0; dst += 8; } while (--num_inactive); -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x1000); - - K052109UpdateScroll(); - - INT32 layer[3]; - - bg_colorbase = K053251GetPaletteIndex(0); - sprite_colorbase = K053251GetPaletteIndex(1); - layer_colorbase[0] = K053251GetPaletteIndex(2); - layer_colorbase[1] = K053251GetPaletteIndex(3); - layer_colorbase[2] = K053251GetPaletteIndex(4); - - layerpri[0] = K053251GetPriority(2); - layerpri[1] = K053251GetPriority(3); - layerpri[2] = K053251GetPriority(4); - layer[0] = 0; - layer[1] = 1; - layer[2] = 2; - - konami_sortlayers3(layer,layerpri); - - KonamiClearBitmaps(DrvPalette[16 * bg_colorbase]); - - if (nBurnLayer & 1) K052109RenderLayer(layer[0], 0, 1); - if (nBurnLayer & 2) K052109RenderLayer(layer[1], 0, 2); - if (nBurnLayer & 4) K052109RenderLayer(layer[2], 0, 4); - - if (nSpriteEnable & 1) K053247SpritesRender(); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - konamiNewFrame(); - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - - // Clear Opposites - if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c; - if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[3] & 0x0c) == 0) DrvInputs[3] |= 0x0c; - if ((DrvInputs[3] & 0x03) == 0) DrvInputs[3] |= 0x03; - } - - INT32 nInterleave = nBurnSoundLen; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 3000000 / 60, 3579545 / 60 }; - - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = konamiRun(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - if (i == 1 && K053246Irq && simpsons_firq_enabled) { - konamiSetIrqLine(KONAMI_FIRQ_LINE, CPU_IRQSTATUS_AUTO); - } - - K053246Irq = K053246_is_IRQ_enabled(); - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K053246Irq) simpsons_objdma(); - if (K052109_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K053260Scan(nAction); - - KonamiICScan(nAction); - - EEPROMScan(nAction, pnMin); - - SCAN_VAR(videobank); - SCAN_VAR(init_eeprom_count); - SCAN_VAR(simpsons_firq_enabled); - SCAN_VAR(K053246Irq); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - simpsons_set_lines(nDrvBank[0]); - konamiClose(); - - ZetOpen(0); - DrvZ80Bankswitch(nDrvBank[1]); - ZetClose(); - } - - return 0; -} - - -// The Simpsons (4 Players World, set 1) - -static struct BurnRomInfo simpsonsRomDesc[] = { - { "072-g02.16c", 0x020000, 0x580ce1d6, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "072-g01.17c", 0x020000, 0x9f843def, 1 | BRF_PRG | BRF_ESS }, // 1 - { "072-j13.13c", 0x020000, 0xaade2abd, 1 | BRF_PRG | BRF_ESS }, // 2 - { "072-j12.15c", 0x020000, 0x479e12f2, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "072-e03.6g", 0x020000, 0x866b7a35, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "072-b07.18h", 0x080000, 0xba1ec910, 3 | BRF_GRA }, // 5 K052109 Tiles - { "072-b06.16h", 0x080000, 0xcf2bbcab, 3 | BRF_GRA }, // 6 - - { "072-b08.3n", 0x100000, 0x7de500ad, 4 | BRF_GRA }, // 7 K053247 Tiles - { "072-b09.8n", 0x100000, 0xaa085093, 4 | BRF_GRA }, // 8 - { "072-b10.12n", 0x100000, 0x577dbd53, 4 | BRF_GRA }, // 9 - { "072-b11.16l", 0x100000, 0x55fab05d, 4 | BRF_GRA }, // 10 - - { "072-d05.1f", 0x100000, 0x1397a73b, 5 | BRF_SND }, // 11 K053260 Samples - { "072-d04.1d", 0x040000, 0x78778013, 5 | BRF_SND }, // 12 - - { "simpsons.12c.nv", 0x000080, 0xec3f0449, BRF_OPT }, -}; - -STD_ROM_PICK(simpsons) -STD_ROM_FN(simpsons) - -struct BurnDriver BurnDrvSimpsons = { - "simpsons", NULL, NULL, NULL, "1991", - "The Simpsons (4 Players World, set 1)\0", NULL, "Konami", "GX072", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, simpsonsRomInfo, simpsonsRomName, NULL, NULL, SimpsonsInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// The Simpsons (4 Players World, set 2) - -static struct BurnRomInfo simpsons4paRomDesc[] = { - { "072-g02.16c", 0x020000, 0x580ce1d6, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "072-g01.17c", 0x020000, 0x9f843def, 1 | BRF_PRG | BRF_ESS }, // 1 - { "072-m13.13c", 0x020000, 0xf36c9423, 1 | BRF_PRG | BRF_ESS }, // 2 - { "072-l12.15c", 0x020000, 0x84f9d9ba, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "072-e03.6g", 0x020000, 0x866b7a35, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "072-b07.18h", 0x080000, 0xba1ec910, 3 | BRF_GRA }, // 5 K052109 Tiles - { "072-b06.16h", 0x080000, 0xcf2bbcab, 3 | BRF_GRA }, // 6 - - { "072-b08.3n", 0x100000, 0x7de500ad, 4 | BRF_GRA }, // 7 K053247 Tiles - { "072-b09.8n", 0x100000, 0xaa085093, 4 | BRF_GRA }, // 8 - { "072-b10.12n", 0x100000, 0x577dbd53, 4 | BRF_GRA }, // 9 - { "072-b11.16l", 0x100000, 0x55fab05d, 4 | BRF_GRA }, // 10 - - { "072-d05.1f", 0x100000, 0x1397a73b, 5 | BRF_SND }, // 11 K053260 Samples - { "072-d04.1d", 0x040000, 0x78778013, 5 | BRF_SND }, // 12 - - { "simpsons4pa.12c.nv", 0x000080, 0xec3f0449, BRF_OPT }, -}; - -STD_ROM_PICK(simpsons4pa) -STD_ROM_FN(simpsons4pa) - -struct BurnDriver BurnDrvSimpsons4pa = { - "simpsons4pa", "simpsons", NULL, NULL, "1991", - "The Simpsons (4 Players World, set 2)\0", NULL, "Konami", "GX072", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, simpsons4paRomInfo, simpsons4paRomName, NULL, NULL, SimpsonsInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// The Simpsons (2 Players World, set 1) - -static struct BurnRomInfo simpsons2pRomDesc[] = { - { "072-g02.16c", 0x020000, 0x580ce1d6, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "072-p01.17c", 0x020000, 0x07ceeaea, 1 | BRF_PRG | BRF_ESS }, // 1 - { "072-013.13c", 0x020000, 0x8781105a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "072-012.15c", 0x020000, 0x244f9289, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "072-g03.6g", 0x020000, 0x76c1850c, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "072-b07.18h", 0x080000, 0xba1ec910, 3 | BRF_GRA }, // 5 K052109 Tiles - { "072-b06.16h", 0x080000, 0xcf2bbcab, 3 | BRF_GRA }, // 6 - - { "072-b08.3n", 0x100000, 0x7de500ad, 4 | BRF_GRA }, // 7 K053247 Tiles - { "072-b09.8n", 0x100000, 0xaa085093, 4 | BRF_GRA }, // 8 - { "072-b10.12n", 0x100000, 0x577dbd53, 4 | BRF_GRA }, // 9 - { "072-b11.16l", 0x100000, 0x55fab05d, 4 | BRF_GRA }, // 10 - - { "072-d05.1f", 0x100000, 0x1397a73b, 5 | BRF_SND }, // 11 K053260 Samples - { "072-d04.1d", 0x040000, 0x78778013, 5 | BRF_SND }, // 12 - - { "simpsons2p.12c.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(simpsons2p) -STD_ROM_FN(simpsons2p) - -struct BurnDriver BurnDrvSimpsons2p = { - "simpsons2p", "simpsons", NULL, NULL, "1991", - "The Simpsons (2 Players World, set 1)\0", NULL, "Konami", "GX072", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, simpsons2pRomInfo, simpsons2pRomName, NULL, NULL, Simpsons2pInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// The Simpsons (2 Players World, set 2) - -static struct BurnRomInfo simpsons2p2RomDesc[] = { - { "072-g02.16c", 0x020000, 0x580ce1d6, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "072-p01.17c", 0x020000, 0x07ceeaea, 1 | BRF_PRG | BRF_ESS }, // 1 - { "072-_13.13c", 0x020000, 0x54e6df66, 1 | BRF_PRG | BRF_ESS }, // 2 - { "072-_12.15c", 0x020000, 0x96636225, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "072-g03.6g", 0x020000, 0x76c1850c, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "072-b07.18h", 0x080000, 0xba1ec910, 3 | BRF_GRA }, // 5 K052109 Tiles - { "072-b06.16h", 0x080000, 0xcf2bbcab, 3 | BRF_GRA }, // 6 - - { "072-b08.3n", 0x100000, 0x7de500ad, 4 | BRF_GRA }, // 7 K053247 Tiles - { "072-b09.8n", 0x100000, 0xaa085093, 4 | BRF_GRA }, // 8 - { "072-b10.12n", 0x100000, 0x577dbd53, 4 | BRF_GRA }, // 9 - { "072-b11.16l", 0x100000, 0x55fab05d, 4 | BRF_GRA }, // 10 - - { "072-d05.1f", 0x100000, 0x1397a73b, 5 | BRF_SND }, // 11 K053260 Samples - { "072-d04.1d", 0x040000, 0x78778013, 5 | BRF_SND }, // 12 - - { "simpsons2p2.12c.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(simpsons2p2) -STD_ROM_FN(simpsons2p2) - -struct BurnDriver BurnDrvSimpsons2p2 = { - "simpsons2p2", "simpsons", NULL, NULL, "1991", - "The Simpsons (2 Players World, set 2)\0", NULL, "Konami", "GX072", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, simpsons2p2RomInfo, simpsons2p2RomName, NULL, NULL, SimpsonsInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// The Simpsons (2 Players World, set 3) // no rom labels - -static struct BurnRomInfo simpsons2p3RomDesc[] = { - { "072-g02.16c", 0x020000, 0x580ce1d6, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "072-p01.17c", 0x020000, 0x07ceeaea, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4.13c", 0x020000, 0xc3040e4f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3.15c", 0x020000, 0xeb4f5781, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "072-g03.6g", 0x020000, 0x76c1850c, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "072-b07.18h", 0x080000, 0xba1ec910, 3 | BRF_GRA }, // 5 K052109 Tiles - { "072-b06.16h", 0x080000, 0xcf2bbcab, 3 | BRF_GRA }, // 6 - - { "072-b08.3n", 0x100000, 0x7de500ad, 4 | BRF_GRA }, // 7 K053247 Tiles - { "072-b09.8n", 0x100000, 0xaa085093, 4 | BRF_GRA }, // 8 - { "072-b10.12n", 0x100000, 0x577dbd53, 4 | BRF_GRA }, // 9 - { "072-b11.16l", 0x100000, 0x55fab05d, 4 | BRF_GRA }, // 10 - - { "072-d05.1f", 0x100000, 0x1397a73b, 5 | BRF_SND }, // 11 K053260 Samples - { "072-d04.1d", 0x040000, 0x78778013, 5 | BRF_SND }, // 12 - - { "simpsons2p.12c.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(simpsons2p3) -STD_ROM_FN(simpsons2p3) - -struct BurnDriver BurnDrvSimpsons2p3 = { - "simpsons2p3", "simpsons", NULL, NULL, "1991", - "The Simpsons (2 Players World, set 3)\0", NULL, "Konami", "GX072", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, simpsons2p3RomInfo, simpsons2p3RomName, NULL, NULL, SimpsonsInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// The Simpsons (2 Players Asia) - -static struct BurnRomInfo simpsons2paRomDesc[] = { - { "072-g02.16c", 0x020000, 0x580ce1d6, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "072-p01.17c", 0x020000, 0x07ceeaea, 1 | BRF_PRG | BRF_ESS }, // 1 - { "072-113.13c", 0x020000, 0x8781105a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "072-112.15c", 0x020000, 0x3bd69404, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "072-e03.6g", 0x020000, 0x866b7a35, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "072-b07.18h", 0x080000, 0xba1ec910, 3 | BRF_GRA }, // 5 K052109 Tiles - { "072-b06.16h", 0x080000, 0xcf2bbcab, 3 | BRF_GRA }, // 6 - - { "072-b08.3n", 0x100000, 0x7de500ad, 4 | BRF_GRA }, // 7 K053247 Tiles - { "072-b09.8n", 0x100000, 0xaa085093, 4 | BRF_GRA }, // 8 - { "072-b10.12n", 0x100000, 0x577dbd53, 4 | BRF_GRA }, // 9 - { "072-b11.16l", 0x100000, 0x55fab05d, 4 | BRF_GRA }, // 10 - - { "072-d05.1f", 0x100000, 0x1397a73b, 5 | BRF_SND }, // 11 K053260 Samples - { "072-d04.1d", 0x040000, 0x78778013, 5 | BRF_SND }, // 12 - - { "simpsons2pa.12c.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(simpsons2pa) -STD_ROM_FN(simpsons2pa) - -struct BurnDriver BurnDrvSimpsons2pa = { - "simpsons2pa", "simpsons", NULL, NULL, "1991", - "The Simpsons (2 Players Asia)\0", NULL, "Konami", "GX072", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, simpsons2paRomInfo, simpsons2paRomName, NULL, NULL, Simpsons2pInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// The Simpsons (2 Players Japan) - -static struct BurnRomInfo simpsons2pjRomDesc[] = { - { "072-s02.16c", 0x020000, 0x265f7a47, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "072-t01.17c", 0x020000, 0x91de5c2d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "072-213.13c", 0x020000, 0xb326a9ae, 1 | BRF_PRG | BRF_ESS }, // 2 - { "072-212.15c", 0x020000, 0x584d9d37, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "072-g03.6g", 0x020000, 0x76c1850c, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "072-b07.18h", 0x080000, 0xba1ec910, 3 | BRF_GRA }, // 5 K052109 Tiles - { "072-b06.16h", 0x080000, 0xcf2bbcab, 3 | BRF_GRA }, // 6 - - { "072-b08.3n", 0x100000, 0x7de500ad, 4 | BRF_GRA }, // 7 K053247 Tiles - { "072-b09.8n", 0x100000, 0xaa085093, 4 | BRF_GRA }, // 8 - { "072-b10.12n", 0x100000, 0x577dbd53, 4 | BRF_GRA }, // 9 - { "072-b11.16l", 0x100000, 0x55fab05d, 4 | BRF_GRA }, // 10 - - { "072-d05.1f", 0x100000, 0x1397a73b, 5 | BRF_SND }, // 11 K053260 Samples - { "072-d04.1d", 0x040000, 0x78778013, 5 | BRF_SND }, // 12 - - { "simpsons2pj.12c.nv", 0x000080, 0x3550a54e, BRF_OPT }, -}; - -STD_ROM_PICK(simpsons2pj) -STD_ROM_FN(simpsons2pj) - -struct BurnDriver BurnDrvSimpsons2pj = { - "simpsons2pj", "simpsons", NULL, NULL, "1991", - "The Simpsons (2 Players Japan)\0", NULL, "Konami", "GX072", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, simpsons2pjRomInfo, simpsons2pjRomName, NULL, NULL, Simpsons2pInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_spy.cpp b/jan/src/burn/drv/konami/d_spy.cpp deleted file mode 100644 index 5193f65f5..000000000 --- a/jan/src/burn/drv/konami/d_spy.cpp +++ /dev/null @@ -1,789 +0,0 @@ -// FB Alpha S.P.Y. driver module -// Based on MAME driver by Nicola Salmoria and Acho A. Tang - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "burn_ym3812.h" -#include "konamiic.h" -#include "k007232.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvBankRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvPMCRAM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; - -static UINT8 *nDrvRomBank; - -static INT32 spy_video_enable; -static INT32 Drv3f90old; -static INT32 nRamBank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[8]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo SpyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 1, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Spy) - -static struct BurnDIPInfo SpyDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x5e, NULL }, - {0x14, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "10k and every 20k" }, - {0x13, 0x01, 0x18, 0x10, "20k and every 30k" }, - {0x13, 0x01, 0x18, 0x08, "20k only" }, - {0x13, 0x01, 0x18, 0x00, "30k only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x10, 0x10, "Off" }, -// {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Power" }, - {0x14, 0x01, 0x20, 0x20, "Normal" }, - {0x14, 0x01, 0x20, 0x00, "Strong" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x14, 0x01, 0x80, 0x80, "Unlimited" }, - {0x14, 0x01, 0x80, 0x00, "5 Times" }, -}; - -STDDIPINFO(Spy) - -static void DrvSetRAMBank(UINT8 bank, UINT8 data) -{ - nDrvRomBank[1] = bank; - nDrvRomBank[2] = data; - - if (data & 0x10) { - M6809MapMemory(DrvPalRAM, 0x0000, 0x07ff, MAP_RAM); - } else if (data & 0x20) { - if (bank & 0x80) { - M6809MapMemory(DrvPMCRAM, 0x0000, 0x07ff, MAP_RAM); - } else { - // unmap - M6809MapMemory(DrvM6809ROM + 0x800, 0x0000, 0x07ff, MAP_ROM); - M6809MapMemory(DrvM6809ROM + 0x000, 0x0000, 0x07ff, MAP_WRITE); - } - } else { - M6809MapMemory(DrvBankRAM, 0x0000, 0x07ff, MAP_RAM); - } -} - -static void spy_collision() -{ -#define MAX_SPRITES 64 -#define DEF_NEAR_PLANE 0x6400 -#define NEAR_PLANE_ZOOM 0x0100 -#define FAR_PLANE_ZOOM 0x0000 -#define pmcram DrvPMCRAM - - INT32 op1, x1, w1, z1, d1, y1, h1; - INT32 op2, x2, w2, z2, d2, y2, h2; - INT32 mode, i, loopend, nearplane; - - mode = pmcram[0x1]; - op1 = pmcram[0x2]; - if (op1 == 1) - { - x1 = (pmcram[0x3]<<8) + pmcram[0x4]; - w1 = (pmcram[0x5]<<8) + pmcram[0x6]; - z1 = (pmcram[0x7]<<8) + pmcram[0x8]; - d1 = (pmcram[0x9]<<8) + pmcram[0xa]; - y1 = (pmcram[0xb]<<8) + pmcram[0xc]; - h1 = (pmcram[0xd]<<8) + pmcram[0xe]; - - for (i=16; i<14*MAX_SPRITES + 2; i+=14) - { - op2 = pmcram[i]; - if (op2 || mode==0x0c) - { - x2 = (pmcram[i+0x1]<<8) + pmcram[i+0x2]; - w2 = (pmcram[i+0x3]<<8) + pmcram[i+0x4]; - z2 = (pmcram[i+0x5]<<8) + pmcram[i+0x6]; - d2 = (pmcram[i+0x7]<<8) + pmcram[i+0x8]; - y2 = (pmcram[i+0x9]<<8) + pmcram[i+0xa]; - h2 = (pmcram[i+0xb]<<8) + pmcram[i+0xc]; - - if (w2==0x58 && d2==0x04 && h2==0x10 && y2==0x30) h2 = y2; - - if ( (abs(x1-x2) 1) - { - loopend = (pmcram[0]<<8) + pmcram[1]; - nearplane = (pmcram[2]<<8) + pmcram[3]; - - if (loopend > MAX_SPRITES) loopend = MAX_SPRITES; - if (!nearplane) nearplane = DEF_NEAR_PLANE; - - loopend = (loopend<<1) + 4; - - for (i=4; i> 8; - pmcram[i+1] = op2 & 0xff; - } - - memset(pmcram+loopend, 0, 0x800-loopend); - } -} - -static void spy_3f90_w(INT32 data) -{ - K052109RMRDLine = data & 0x04; - - spy_video_enable = (~data & 0x08); - - nRamBank = data & 0xb0; - - DrvSetRAMBank(data & 0x80, data & 0x30); - - if ((data & 0x40) && (~Drv3f90old & 0x40)) - { - spy_collision(); - - M6809SetIRQLine(1 /*FIRQ*/, CPU_IRQSTATUS_ACK); - M6809Run(105); // delay or the M6809 won't read it... - M6809SetIRQLine(1 /*FIRQ*/, CPU_IRQSTATUS_NONE); - } - - Drv3f90old = data; -} - -static void bankswitch(INT32 data) -{ - nDrvRomBank[0] = data; - - INT32 nBank; - if (data & 0x10) { - nBank = 0x20000 + (data & 0x06) * 0x1000; - } else { - nBank = 0x10000 + (data & 0x0e) * 0x1000; - } - - M6809MapMemory(DrvM6809ROM + nBank, 0x6000, 0x7fff, MAP_ROM); -} - -void spy_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3f80: - bankswitch(data); - return; - - case 0x3f90: - spy_3f90_w(data); - return; - - case 0x3fa0: - // watchdog - return; - - case 0x3fb0: - *soundlatch = data; - return; - - case 0x3fc0: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } - - if (address >= 0x2000 && address <= 0x5fff) { - K052109_051960_w(address - 0x2000, data); - return; - } -} - -UINT8 spy_main_read(UINT16 address) -{ - switch (address) - { - case 0x3fd0: - return (DrvInputs[2] & 0x0f) | (DrvDips[2] & 0xf0); - - case 0x3fd1: - return DrvInputs[0]; - - case 0x3fd2: - return DrvInputs[1]; - - case 0x3fd3: - return DrvDips[0]; - - case 0x3fe0: - return DrvDips[1]; - } - - if (address >= 0x2000 && address <= 0x5fff) { - return K052109_051960_r(address - 0x2000); - } - - return 0; -} - -static void sound_bankswitch(INT32 data) -{ - INT32 bank_A,bank_B; - - bank_A = (data >> 0) & 0x03; - bank_B = (data >> 2) & 0x03; - k007232_set_bank(0,bank_A,bank_B); - - bank_A = (data >> 4) & 0x03; - bank_B = (data >> 6) & 0x03; - k007232_set_bank(1,bank_A,bank_B); -} - -void __fastcall spy_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xa000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(1, address & 0x0f, data); - return; - } - - switch (address) - { - case 0x9000: - sound_bankswitch(data); - return; - - case 0xc000: - case 0xc001: - BurnYM3812Write(0, address & 1, data); - return; - } -} - -UINT8 __fastcall spy_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xa000) { - return K007232ReadReg(0, address & 0x0f); - } - - if ((address & 0xfff0) == 0xb000) { - return K007232ReadReg(1, address & 0x0f); - } - - switch (address) - { - case 0xc000: - case 0xc001: - return BurnYM3812Read(0, address & 1); - - case 0xd000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *flags, INT32 *) -{ - INT32 colorbase[3] = { 0x30, 0, 0x10 }; - - *flags = *color & 0x20; - *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); - *color = colorbase[layer] + ((*color & 0xc0) >> 6); -} - -static void K051960Callback(INT32 *code, INT32 *color, INT32 *priority, INT32 *) -{ - *priority = 0x00; - if ( *color & 0x10) *priority = 0x0a; - if (~*color & 0x20) *priority = 0x0c; - - *color = 0x20 | (*color & 0x0f); - - *code = *code & 0x1fff; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) ZetNmi(); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -static void DrvK007232VolCallback0(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -static void DrvK007232VolCallback1(INT32 v) -{ - K007232SetVolume(1, 0, (v >> 4) * 0x11, 0); - K007232SetVolume(1, 1, 0, (v & 0x0f) * 0x11); -} - -static int DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - KonamiICReset(); - - BurnYM3812Reset(); - - spy_video_enable = 0; - Drv3f90old = 0; - nRamBank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x030000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROMExp0 = Next; Next += 0x100000; - DrvGfxROMExp1 = Next; Next += 0x200000; - - DrvSndROM0 = Next; Next += 0x040000; - DrvSndROM1 = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - AllRam = Next; - - DrvPMCRAM = Next; Next += 0x000800; - DrvBankRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - DrvM6809RAM = Next; Next += 0x001800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - nDrvRomBank = Next; Next += 0x000003; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x010000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x020000, 1, 1)) return 1; - memcpy (DrvM6809ROM + 0x08000, DrvM6809ROM + 0x28000, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 4, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 8, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x080000); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x100000); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x0800, 0x1aff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - M6809MapMemory(DrvM6809ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(spy_main_write); - M6809SetReadHandler(spy_main_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(spy_sound_write); - ZetSetReadHandler(spy_sound_read); - ZetClose(); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x07ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(-2, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0x0fffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(0, 0); - - BurnYM3812Init(1, 3579545, &DrvFMIRQHandler, DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3579545); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - K007232Init(0, 3579545, DrvSndROM0, 0x40000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback0); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - K007232Init(1, 3579545, DrvSndROM1, 0x40000); - K007232SetPortWriteHandler(1, DrvK007232VolCallback1); - K007232PCMSetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - M6809Exit(); - ZetExit(); - - BurnYM3812Exit(); - - K007232Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x800); - - K052109UpdateScroll(); - - if (spy_video_enable) { - K052109RenderLayer(1, K052109_OPAQUE, 1); - K052109RenderLayer(2, 0, 2); - K051960SpritesRender(-1, -1); - K052109RenderLayer(0, 0, 0); - } else { - KonamiClearBitmaps(DrvPalette[0x300]); - } - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0 ; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - if ((DrvInputs[0] & 0x06) == 0) DrvInputs[0] |= 0x06; - if ((DrvInputs[0] & 0x18) == 0) DrvInputs[0] |= 0x18; - if ((DrvInputs[1] & 0x06) == 0) DrvInputs[1] |= 0x06; - if ((DrvInputs[1] & 0x18) == 0) DrvInputs[1] |= 0x18; - } - - INT32 nCyclesSegment; - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { (((3000000 / 60) * 133) / 100) /* 33% overclock */, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - nCyclesSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - nCyclesDone[0] += M6809Run(nCyclesSegment - nCyclesDone[0]); - - nCyclesSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - nCyclesDone[1] += BurnTimerUpdateYM3812(nCyclesSegment - nCyclesDone[1]); - } - - if (K052109_irq_enabled) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - K007232Update(0, pBurnSoundOut, nBurnSoundLen); - K007232Update(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(spy_video_enable); - SCAN_VAR(Drv3f90old); - SCAN_VAR(nRamBank); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(nDrvRomBank[0]); - DrvSetRAMBank(nDrvRomBank[1], nDrvRomBank[2]); - M6809Close(); - } - - return 0; -} - - -// S.P.Y. - Special Project Y (World ver. N) - -static struct BurnRomInfo spyRomDesc[] = { - { "857n03.bin", 0x10000, 0x97993b38, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "857n02.bin", 0x10000, 0x31a97efe, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "857d01.bin", 0x08000, 0xaad4210f, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "857b09.bin", 0x40000, 0xb8780966, 3 | BRF_GRA }, // 3 Background Tiles - { "857b08.bin", 0x40000, 0x3e4d8d50, 3 | BRF_GRA }, // 4 - - { "857b06.bin", 0x80000, 0x7b515fb1, 4 | BRF_GRA }, // 5 Sprites - { "857b05.bin", 0x80000, 0x27b0f73b, 4 | BRF_GRA }, // 6 - - { "857b07.bin", 0x40000, 0xce3512d4, 5 | BRF_SND }, // 7 K007232 #0 Samples - - { "857b04.bin", 0x40000, 0x20b83c13, 6 | BRF_SND }, // 8 K007232 #1 Samples - - { "857a10.bin", 0x00100, 0x32758507, 7 | BRF_OPT }, // 9 Proms -}; - -STD_ROM_PICK(spy) -STD_ROM_FN(spy) - -struct BurnDriver BurnDrvSpy = { - "spy", NULL, NULL, NULL, "1989", - "S.P.Y. - Special Project Y (World ver. N)\0", NULL, "Konami", "GX857", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, spyRomInfo, spyRomName, NULL, NULL, SpyInputInfo, SpyDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 304, 216, 4, 3 -}; - - -// S.P.Y. - Special Project Y (US ver. M) - -static struct BurnRomInfo spyuRomDesc[] = { - { "857m03.bin", 0x10000, 0x3bd87fa4, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "857m02.bin", 0x10000, 0x306cc659, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "857d01.bin", 0x08000, 0xaad4210f, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "857b09.bin", 0x40000, 0xb8780966, 3 | BRF_GRA }, // 3 Background Tiles - { "857b08.bin", 0x40000, 0x3e4d8d50, 3 | BRF_GRA }, // 4 - - { "857b06.bin", 0x80000, 0x7b515fb1, 4 | BRF_GRA }, // 5 Sprites - { "857b05.bin", 0x80000, 0x27b0f73b, 4 | BRF_GRA }, // 6 - - { "857b07.bin", 0x40000, 0xce3512d4, 5 | BRF_SND }, // 7 K007232 #0 Samples - - { "857b04.bin", 0x40000, 0x20b83c13, 6 | BRF_SND }, // 8 K007232 #1 Samples - - { "857a10.bin", 0x00100, 0x32758507, 7 | BRF_OPT }, // 9 Proms -}; - -STD_ROM_PICK(spyu) -STD_ROM_FN(spyu) - -struct BurnDriver BurnDrvSpyu = { - "spyu", "spy", NULL, NULL, "1989", - "S.P.Y. - Special Project Y (US ver. M)\0", NULL, "Konami", "GX857", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, spyuRomInfo, spyuRomName, NULL, NULL, SpyInputInfo, SpyDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 304, 216, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_surpratk.cpp b/jan/src/burn/drv/konami/d_surpratk.cpp deleted file mode 100644 index a792cf4d8..000000000 --- a/jan/src/burn/drv/konami/d_surpratk.cpp +++ /dev/null @@ -1,608 +0,0 @@ -// FB Alpha Surprise Attack driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "burn_ym2151.h" -#include "konami_intf.h" -#include "konamiic.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvBankRAM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *nDrvRomBank; -static INT32 videobank; - -static INT32 layer_colorbase[3]; -static INT32 sprite_colorbase; -static INT32 layerpri[3]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo SurpratkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 1, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Test", BIT_DIGITAL, DrvJoy3 + 1, "diag" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Surpratk) - -static struct BurnDIPInfo SuratkjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x5a, NULL }, - {0x15, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "2" }, - {0x14, 0x01, 0x03, 0x02, "3" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "7" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x14, 0x01, 0x04, 0x00, "Upright" }, -// {0x14, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x60, 0x60, "Easy" }, - {0x14, 0x01, 0x60, 0x40, "Normal" }, - {0x14, 0x01, 0x60, 0x20, "Difficult" }, - {0x14, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x15, 0x01, 0x10, 0x10, "Off" }, -// {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x15, 0x01, 0x20, 0x20, "Single" }, - {0x15, 0x01, 0x20, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, -}; - -static struct BurnDIPInfo BonusQuizDIPList[]= -{ - {0 , 0xfe, 0 , 2, "Bonus Quiz" }, - {0x15, 0x01, 0x80, 0x80, "Include" }, - {0x15, 0x01, 0x80, 0x00, "Except" }, -}; - -STDDIPINFO(Suratkj) -STDDIPINFOEXT(Surpratk, Suratkj, BonusQuiz) - -UINT8 supratk_read(UINT16 address) -{ - switch (address) - { - case 0x5f8c: - return DrvInputs[0]; - - case 0x5f8d: - return DrvInputs[1]; - - case 0x5f8e: - return (DrvInputs[2] & 0x0f) | (DrvDips[2] & 0xf0); - - case 0x5f8f: - return DrvDips[0]; - - case 0x5f90: - return DrvDips[1]; - - case 0x5fc0: - // watchdog - return 0; - } - - if ((address & 0xf800) == 0x0000) { - if (videobank & 0x02) { - return DrvPalRAM[((videobank & 4) << 9) + address]; - } else if (videobank & 0x01) { - return K053245Read(0, address); - } - return DrvBankRAM[address]; - } - - if ((address & 0xfff0) == 0x5fa0) { - return K053244Read(0, address & 0x0f); - } - - if ((address & 0xc000) == 0x4000) { - return K052109Read(address & 0x3fff); - } - - return 0; -} - -void supratk_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x5fc0: - K052109RMRDLine = data & 0x08; - return; - - case 0x5fc4: - videobank = data; - return; - - case 0x5fd0: - BurnYM2151SelectRegister(data); - return; - - case 0x5fd1: - BurnYM2151WriteRegister(data); - return; - } - - if ((address & 0xf800) == 0x0000) { - if (videobank & 0x02) { - DrvPalRAM[((videobank & 4) << 9) + address] = data; - return; - } else if (videobank & 0x01) { - K053245Write(0, address, data); - return; - } - DrvBankRAM[address] = data; - return; - } - - if ((address & 0xfff0) == 0x5fa0) { - K053244Write(0, address & 0x0f, data); - return; - } - - if ((address & 0xfff0) == 0x5fb0) { - K053251Write(address & 0x0f, data); - return; - } - - if ((address & 0xc000) == 0x4000) { - K052109Write(address & 0x3fff, data); - return; - } -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *flags, INT32 *) -{ - *flags = (*color & 0x80) >> 7; - *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); - *color = layer_colorbase[layer] + ((*color & 0x60) >> 5); -} - -static void K053245Callback(INT32 *code, INT32 *color, INT32 *priority) -{ - INT32 pri = 0x20 | ((*color & 0x60) >> 2); - if (pri <= layerpri[2]) *priority = 0x00; - else if (pri > layerpri[2] && pri <= layerpri[1]) *priority = 0xf0; - else if (pri > layerpri[1] && pri <= layerpri[0]) *priority = 0xfc; - else *priority = 0xfe; - - *code &= 0xfff; - *color = sprite_colorbase + (*color & 0x1f); -} - -static void supratk_set_lines(INT32 lines) -{ - nDrvRomBank[0] = lines; - konamiMapMemory(DrvKonROM + 0x10000 + ((lines & 0x1f) * 0x2000), 0x2000, 0x3fff, MAP_ROM); -} - -static void DrvYM2151IRQHandler(INT32 nStatus) -{ - konamiSetIrqLine(KONAMI_FIRQ_LINE, nStatus ? 3 /* use 3 as ACK */ : 0); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - videobank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROMExp0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROMExp1 = Next; Next += 0x100000; - - DrvKonROM = Next; Next += 0x050000; - - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - DrvBankRAM = Next; Next += 0x000800; - DrvKonRAM = Next; Next += 0x001800; - DrvPalRAM = Next; Next += 0x001000; - - nDrvRomBank = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - int nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x010000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x030000, 1, 1)) return 1; - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x48000, 0x8000); - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 2, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 3, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 4, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 5, 4, 2)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x080000); - K053245GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x080000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonRAM, 0x0800, 0x1fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x2000, 0x3fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(supratk_write); - konamiSetReadHandler(supratk_read); - konamiSetlinesCallback(supratk_set_lines); - konamiClose(); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x7ffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(8, 0); - - K053245Init(0, DrvGfxROM1, DrvGfxROMExp1, 0x7ffff, K053245Callback); - K053245SetSpriteOffset(0, -112, 16); - - BurnYM2151Init(3579545); - YM2151SetIrqHandler(0, &DrvYM2151IRQHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - konami_set_highlight_over_sprites_mode(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - K053245Exit(); - - konamiExit(); - - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x1000); - - K052109UpdateScroll(); - - INT32 bg_colorbase, layer[3]; - - bg_colorbase = K053251GetPaletteIndex(0); - sprite_colorbase = K053251GetPaletteIndex(1); - layer_colorbase[0] = K053251GetPaletteIndex(2); - layer_colorbase[1] = K053251GetPaletteIndex(4); - layer_colorbase[2] = K053251GetPaletteIndex(3); - - layerpri[0] = K053251GetPriority(2); - layerpri[1] = K053251GetPriority(4); - layerpri[2] = K053251GetPriority(3); - layer[0] = 0; - layer[1] = 1; - layer[2] = 2; - - konami_sortlayers3(layer,layerpri); - - KonamiClearBitmaps(DrvPalette[16 * bg_colorbase]); - - if (nBurnLayer & 1) K052109RenderLayer(layer[0], 0, 1); - if (nBurnLayer & 2) K052109RenderLayer(layer[1], 0, 2); - if (nBurnLayer & 4) K052109RenderLayer(layer[2], 0, 4); - - if (nSpriteEnable & 1) K053245SpritesRender(0); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear Opposites - if ((DrvInputs[0] & 0x18) == 0) DrvInputs[0] |= 0x18; - if ((DrvInputs[0] & 0x06) == 0) DrvInputs[0] |= 0x06; - if ((DrvInputs[1] & 0x18) == 0) DrvInputs[1] |= 0x18; - if ((DrvInputs[1] & 0x06) == 0) DrvInputs[1] |= 0x06; - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 256; - INT32 nCyclesTotal = (((3000000 / 60) * 133) / 100); // 33% overclock - INT32 nCyclesDone = 0; - - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nSegment = (nCyclesTotal / nInterleave) * (i + 1); - - if (i == 240) { - if (K052109_irq_enabled) { - nCyclesDone += konamiRun(10); // avoid irq masking from ym2151-generated irq's - konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_HOLD); - nCyclesDone += konamiRun(10); - } - } - - nCyclesDone += konamiRun(nSegment - nCyclesDone); - - if (pBurnSoundOut && i%8 == 7) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - - BurnYM2151Scan(nAction); - - KonamiICScan(nAction); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(videobank); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - supratk_set_lines(nDrvRomBank[0]); - konamiClose(); - } - - return 0; -} - - -// Surprise Attack (World ver. K) - -static struct BurnRomInfo suratkRomDesc[] = { - { "911j01.f5", 0x20000, 0x1e647881, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "911k02.h5", 0x20000, 0xef10e7b6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "911d05.bin", 0x40000, 0x308d2319, 2 | BRF_GRA }, // 2 Background Tiles - { "911d06.bin", 0x40000, 0x91cc9b32, 2 | BRF_GRA }, // 3 - - { "911d03.bin", 0x40000, 0xe34ff182, 3 | BRF_GRA }, // 4 Sprites - { "911d04.bin", 0x40000, 0x20700bd2, 3 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(suratk) -STD_ROM_FN(suratk) - -struct BurnDriver BurnDrvSuratk = { - "suratk", NULL, NULL, NULL, "1990", - "Surprise Attack (World ver. K)\0", NULL, "Konami", "GX911", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT | GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, suratkRomInfo, suratkRomName, NULL, NULL, SurpratkInputInfo, SurpratkDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Surprise Attack (Asia ver. L) - -static struct BurnRomInfo suratkaRomDesc[] = { - { "911j01.f5", 0x20000, 0x1e647881, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "911l02.h5", 0x20000, 0x11db8288, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "911d05.bin", 0x40000, 0x308d2319, 2 | BRF_GRA }, // 2 Background Tiles - { "911d06.bin", 0x40000, 0x91cc9b32, 2 | BRF_GRA }, // 3 - - { "911d03.bin", 0x40000, 0xe34ff182, 3 | BRF_GRA }, // 4 Sprites - { "911d04.bin", 0x40000, 0x20700bd2, 3 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(suratka) -STD_ROM_FN(suratka) - -struct BurnDriver BurnDrvSuratka = { - "suratka", "suratk", NULL, NULL, "1990", - "Surprise Attack (Asia ver. L)\0", NULL, "Konami", "GX911", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT | GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, suratkaRomInfo, suratkaRomName, NULL, NULL, SurpratkInputInfo, SurpratkDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Surprise Attack (Japan ver. M) - -static struct BurnRomInfo suratkjRomDesc[] = { - { "911m01.f5", 0x20000, 0xee5b2cc8, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "911m02.h5", 0x20000, 0x5d4148a8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "911d05.bin", 0x40000, 0x308d2319, 2 | BRF_GRA }, // 2 Background Tiles - { "911d06.bin", 0x40000, 0x91cc9b32, 2 | BRF_GRA }, // 3 - - { "911d03.bin", 0x40000, 0xe34ff182, 3 | BRF_GRA }, // 4 Sprites - { "911d04.bin", 0x40000, 0x20700bd2, 3 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(suratkj) -STD_ROM_FN(suratkj) - -struct BurnDriver BurnDrvSuratkj = { - "suratkj", "suratk", NULL, NULL, "1990", - "Surprise Attack (Japan ver. M)\0", NULL, "Konami", "GX911", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT | GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, suratkjRomInfo, suratkjRomName, NULL, NULL, SurpratkInputInfo, SuratkjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_thunderx.cpp b/jan/src/burn/drv/konami/d_thunderx.cpp deleted file mode 100644 index 9b2ae0fad..000000000 --- a/jan/src/burn/drv/konami/d_thunderx.cpp +++ /dev/null @@ -1,1173 +0,0 @@ -// FB Alpha Thunder X / Super Contra driver module -// Based on MAME driver by by Bryan McPhail, Manuel Abadia, and Eddie Edwards - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k007232.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvBankRAM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *nDrvKonamiBank; - -static UINT8 *pmcram; -static UINT8 thunderx_1f98_data; -static UINT8 layer_priority; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 thunderx = 0; - -static struct BurnInputInfo ThunderxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Thunderx) - -static struct BurnDIPInfo ScontraDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x5a, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "30000 200000" }, - {0x13, 0x01, 0x18, 0x10, "50000 300000" }, - {0x13, 0x01, 0x18, 0x08, "30000" }, - {0x13, 0x01, 0x18, 0x00, "50000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x01, 0x01, "Off" }, -// {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Continue Limit" }, - {0x14, 0x01, 0x08, 0x08, "3" }, - {0x14, 0x01, 0x08, 0x00, "5" }, -}; - -STDDIPINFO(Scontra) - -static struct BurnDIPInfo ThunderxDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x52, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Award Bonus Life" }, - {0x13, 0x01, 0x04, 0x04, "No" }, - {0x13, 0x01, 0x04, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "30000 200000" }, - {0x13, 0x01, 0x18, 0x10, "50000 300000" }, - {0x13, 0x01, 0x18, 0x08, "30000" }, - {0x13, 0x01, 0x18, 0x00, "50000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x01, 0x01, "Off" }, -// {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Thunderx) - -static void run_collisions(INT32 s0, INT32 e0, INT32 s1, INT32 e1, INT32 cm, INT32 hm) -{ - INT32 ii, jj; - UINT8 *p0, *p1; - - p0 = &pmcram[16 + 5*s0]; - for (ii = s0; ii < e0; ii++, p0 += 5) - { - INT32 l0,r0,b0,t0; - - // check valid - if (!(p0[0] & cm)) continue; - - // get area - l0 = p0[3] - p0[1]; - r0 = p0[3] + p0[1]; - t0 = p0[4] - p0[2]; - b0 = p0[4] + p0[2]; - - p1 = &pmcram[16 + 5*s1]; - for (jj = s1; jj < e1; jj++,p1 += 5) - { - INT32 l1,r1,b1,t1; - - // check valid - if (!(p1[0] & hm)) continue; - - // get area - l1 = p1[3] - p1[1]; - r1 = p1[3] + p1[1]; - t1 = p1[4] - p1[2]; - b1 = p1[4] + p1[2]; - - // overlap check - if (l1 >= r0) continue; - if (l0 >= r1) continue; - if (t1 >= b0) continue; - if (t0 >= b1) continue; - - // set flags - p0[0] = (p0[0] & 0x9f) | (p1[0] & 0x04) | 0x10; - p1[0] = (p1[0] & 0x9f) | 0x10; - } - } -} - -static void calculate_collisions() -{ - INT32 X0,Y0; - INT32 X1,Y1; - INT32 CM,HM; - - Y0 = pmcram[0]; - Y0 = (Y0 << 8) + pmcram[1]; - Y0 = (Y0 - 15) / 5; - Y1 = (pmcram[2] - 15) / 5; - - if (pmcram[5] < 16) - { - // US Thunder Cross uses this form - X0 = pmcram[5]; - X0 = (X0 << 8) + pmcram[6]; - X0 = (X0 - 16) / 5; - X1 = (pmcram[7] - 16) / 5; - } - else - { - // Japan Thunder Cross uses this form - X0 = (pmcram[5] - 16) / 5; - X1 = (pmcram[6] - 16) / 5; - } - - CM = pmcram[3]; - HM = pmcram[4]; - - run_collisions(X0,Y0,X1,Y1,CM,HM); -} - -static void thunderx_1f98_w(UINT8 data) -{ - K052109RMRDLine = data & 0x01; - - if ((data & 4) && !(thunderx_1f98_data & 4)) - { - calculate_collisions(); - - konamiRun(10); - - konamiSetIrqLine(KONAMI_FIRQ_LINE, CPU_IRQSTATUS_AUTO); // must be delayed - } - - thunderx_1f98_data = data; -} - -static void scontra_bankswitch(INT32 data) -{ - nDrvKonamiBank[0] = data; - layer_priority = data & 0x80; - - if (~data & 0x10) { - konamiMapMemory(DrvPalRAM, 0x5800, 0x5fff, MAP_RAM); - } else { - konamiMapMemory(DrvBankRAM, 0x5800, 0x5fff, MAP_RAM); - } - - INT32 nBank = 0x10000 + (data & 0x0f) * 0x2000; - - konamiMapMemory(DrvKonROM + nBank, 0x6000, 0x7fff, MAP_ROM); -} - -static void thunderx_videobank(INT32 data) -{ - nDrvKonamiBank[0] = data; - layer_priority = data & 0x08; - - if (data & 0x01) { - konamiMapMemory(DrvBankRAM, 0x5800, 0x5fff, MAP_RAM); - } else if (data & 0x10) { - if (thunderx_1f98_data & 2) { - konamiMapMemory(pmcram + 0x800, 0x5800, 0x5fff, MAP_RAM); - } else { - konamiMapMemory(pmcram, 0x5800, 0x5fff, MAP_RAM); // junk? - } - } else { - konamiMapMemory(DrvPalRAM, 0x5800, 0x5fff, MAP_RAM); - } -} - -void scontra_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1f80: - if (thunderx) { - thunderx_videobank(data); - } else { - scontra_bankswitch(data); - } - return; - - case 0x1f84: - *soundlatch = data; - return; - - case 0x1f88: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x1f8c: - // watchdog - return; - - case 0x1f98: - thunderx_1f98_w(data); - return; - } - - if (address < 0x4000) { - K052109_051960_w(address & 0x3fff, data); - return; - } -} - -UINT8 scontra_main_read(UINT16 address) -{ - switch (address) - { - case 0x1f90: - return DrvInputs[0]; - - case 0x1f91: - return DrvInputs[1]; - - case 0x1f92: - return DrvInputs[2]; - - case 0x1f93: - return DrvDips[2]; - - case 0x1f94: - return DrvDips[0]; - - case 0x1f95: - return DrvDips[1]; - - case 0x1f98: - return thunderx_1f98_data; - } - - if (address < 0x4000) { - return K052109_051960_r(address & 0x3fff); - } - - return 0; -} - -static void scontra_snd_bankswitch_w(INT32 data) -{ - INT32 bank_A = (data & 0x03); - INT32 bank_B = ((data >> 2) & 0x03); - k007232_set_bank(0, bank_A, bank_B ); -} - -void __fastcall scontra_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } - - switch (address) - { - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xf000: - scontra_snd_bankswitch_w(data); - return; - } -} - -UINT8 __fastcall scontra_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0xb000) { - return K007232ReadReg(0, address & 0x0f); - } - - switch (address) - { - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xc001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - INT32 layer_colorbase[3] = { 48, 0, 16 }; - - *code |= ((*color & 0x1f) << 8) | (bank << 13); - *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5); -} - -static void K051960Callback(INT32 *, INT32 *color,INT32 *priority, INT32 *) -{ - switch (*color & 0x30) - { - case 0x00: *priority = 0xf0; break; - case 0x10: *priority = 0xfe; break; - case 0x20: *priority = 0xfc; break; - case 0x30: *priority = 0xffff; break; - } - - *color = 0x20 + (*color & 0x0f); -} - -static void thunderx_set_lines(INT32 lines) -{ - nDrvKonamiBank[0] = lines; - - INT32 nBank = 0x10000 + (((lines & 0x0f) ^ 0x08) * 0x2000); - if (nBank >= 0x28000) nBank -= 0x20000; - - konamiMapMemory(DrvKonROM + nBank, 0x6000, 0x7fff, MAP_ROM); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - layer_priority = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROMExp0 = Next; Next += 0x200000; - DrvGfxROMExp1 = Next; Next += 0x200000; - - DrvSndROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - AllRam = Next; - - DrvBankRAM = Next; Next += 0x000800; - DrvKonRAM = Next; Next += 0x001800; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - nDrvKonamiBank = Next; Next += 0x000002; - - pmcram = Next; Next += 0x001000; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 type) -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (type) { - if (BurnLoadRom(DrvKonROM + 0x010000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x020000, 1, 1)) return 1; - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x18000, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 5, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 6, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080001, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080002, 9, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080003, 10, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c0000, 11, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c0001, 12, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c0002, 13, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c0003, 14, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 15, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 16, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000002, 17, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000003, 18, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 19, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 20, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040002, 21, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040003, 22, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 23, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080001, 24, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080002, 25, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080003, 26, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 27, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0001, 28, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0002, 29, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0003, 30, 4)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 31, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x010000, 32, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x020000, 33, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x030000, 34, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x040000, 35, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x050000, 36, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x060000, 37, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x070000, 38, 1)) return 1; - } else { - if (BurnLoadRom(DrvKonROM + 0x010000, 0, 1)) return 1; - if (BurnLoadRom(DrvKonROM + 0x020000, 1, 1)) return 1; - memcpy (DrvKonROM + 0x8000, DrvKonROM + 0x28000, 0x8000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 5, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 6, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040001, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040002, 9, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040003, 10, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 12, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000002, 13, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000003, 14, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 15, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 16, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040002, 17, 4)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040003, 18, 4)) return 1; - - thunderx = 1; - } - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x100000); - K051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x100000); - } - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonRAM, 0x4000, 0x57ff, MAP_RAM); - konamiMapMemory(DrvBankRAM, 0x5800, 0x5fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(scontra_main_write); - konamiSetReadHandler(scontra_main_read); - konamiSetlinesCallback(thunderx_set_lines); - konamiClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(scontra_sound_write); - ZetSetReadHandler(scontra_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - K007232Init(0, 3579545, DrvSndROM, 0x80000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x0fffff >> thunderx); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(8, 0); - - K051960Init(DrvGfxROM1, DrvGfxROMExp1, 0x0fffff >> thunderx); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(8, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - thunderx = 0; - - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - K007232Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x800); - - K052109UpdateScroll(); - - if (layer_priority) - { - if (nBurnLayer & 1) K052109RenderLayer(2, K052109_OPAQUE, 1); - if (nBurnLayer & 2) K052109RenderLayer(1, 0, 2); - } - else - { - if (nBurnLayer & 1) K052109RenderLayer(1, K052109_OPAQUE, 1); - if (nBurnLayer & 2) K052109RenderLayer(2, 0, 2); - } - - if (nBurnLayer & 4) K052109RenderLayer(0, 0, 4); - - if (nSpriteEnable & 1) K051960SpritesRender(-1, -1); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - } - - konamiNewFrame(); - ZetNewFrame(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 3000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - konamiOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - - nCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K052109_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K007232Scan(nAction, pnMin); - - KonamiICScan(nAction); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(thunderx_1f98_data); - - SCAN_VAR(layer_priority); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - if (thunderx) { - thunderx_videobank(nDrvKonamiBank[0]); - thunderx_set_lines(nDrvKonamiBank[1]); - } else { - scontra_bankswitch(nDrvKonamiBank[0]); - } - konamiClose(); - } - - return 0; -} - - -// Super Contra - -static struct BurnRomInfo scontraRomDesc[] = { - { "775-e02.k11", 0x10000, 0xa61c0ead, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "775-e03.k13", 0x10000, 0x00b02622, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "775-c01.bin", 0x08000, 0x0ced785a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "775-a07a.bin", 0x20000, 0xe716bdf3, 3 | BRF_GRA }, // 3 Background Tiles - { "775-a07e.bin", 0x20000, 0x0986e3a5, 3 | BRF_GRA }, // 4 - { "775-a08a.bin", 0x20000, 0x3ddd11a4, 3 | BRF_GRA }, // 5 - { "775-a08e.bin", 0x20000, 0x1007d963, 3 | BRF_GRA }, // 6 - { "775-f07c.bin", 0x10000, 0xb0b30915, 3 | BRF_GRA }, // 7 - { "775-f07g.bin", 0x10000, 0xfbed827d, 3 | BRF_GRA }, // 8 - { "775-f08c.bin", 0x10000, 0x53abdaec, 3 | BRF_GRA }, // 9 - { "775-f08g.bin", 0x10000, 0x3df85a6e, 3 | BRF_GRA }, // 10 - { "775-f07d.bin", 0x10000, 0xf184be8e, 3 | BRF_GRA }, // 11 - { "775-f07h.bin", 0x10000, 0x7b56c348, 3 | BRF_GRA }, // 12 - { "775-f08d.bin", 0x10000, 0x102dcace, 3 | BRF_GRA }, // 13 - { "775-f08h.bin", 0x10000, 0xad9d7016, 3 | BRF_GRA }, // 14 - - { "775-a05a.bin", 0x10000, 0xa0767045, 4 | BRF_GRA }, // 15 Sprites - { "775-a05e.bin", 0x10000, 0x2f656f08, 4 | BRF_GRA }, // 16 - { "775-a06a.bin", 0x10000, 0x77a34ad0, 4 | BRF_GRA }, // 17 - { "775-a06e.bin", 0x10000, 0x8a910c94, 4 | BRF_GRA }, // 18 - { "775-a05b.bin", 0x10000, 0xab8ad4fd, 4 | BRF_GRA }, // 19 - { "775-a05f.bin", 0x10000, 0x1c0eb1b6, 4 | BRF_GRA }, // 20 - { "775-a06b.bin", 0x10000, 0x563fb565, 4 | BRF_GRA }, // 21 - { "775-a06f.bin", 0x10000, 0xe14995c0, 4 | BRF_GRA }, // 22 - { "775-f05c.bin", 0x10000, 0x5647761e, 4 | BRF_GRA }, // 23 - { "775-f05g.bin", 0x10000, 0xa1692cca, 4 | BRF_GRA }, // 24 - { "775-f06c.bin", 0x10000, 0x5ee6f3c1, 4 | BRF_GRA }, // 25 - { "775-f06g.bin", 0x10000, 0x2645274d, 4 | BRF_GRA }, // 26 - { "775-f05d.bin", 0x10000, 0xad676a6f, 4 | BRF_GRA }, // 27 - { "775-f05h.bin", 0x10000, 0x3f925bcf, 4 | BRF_GRA }, // 28 - { "775-f06d.bin", 0x10000, 0xc8b764fa, 4 | BRF_GRA }, // 29 - { "775-f06h.bin", 0x10000, 0xd6595f59, 4 | BRF_GRA }, // 30 - - { "775-a04a.bin", 0x10000, 0x7efb2e0f, 5 | BRF_SND }, // 31 K007232 Samples - { "775-a04b.bin", 0x10000, 0xf41a2b33, 5 | BRF_SND }, // 32 - { "775-a04c.bin", 0x10000, 0xe4e58f14, 5 | BRF_SND }, // 33 - { "775-a04d.bin", 0x10000, 0xd46736f6, 5 | BRF_SND }, // 34 - { "775-f04e.bin", 0x10000, 0xfbf7e363, 5 | BRF_SND }, // 35 - { "775-f04f.bin", 0x10000, 0xb031ef2d, 5 | BRF_SND }, // 36 - { "775-f04g.bin", 0x10000, 0xee107bbb, 5 | BRF_SND }, // 37 - { "775-f04h.bin", 0x10000, 0xfb0fab46, 5 | BRF_SND }, // 38 - - { "775a09.b19", 0x00100, 0x46d1e0df, 6 | BRF_OPT }, // 39 Proms -}; - -STD_ROM_PICK(scontra) -STD_ROM_FN(scontra) - -static INT32 scontraInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvScontra = { - "scontra", NULL, NULL, NULL, "1988", - "Super Contra\0", NULL, "Konami", "GX775", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT | GBF_HORSHOOT, 0, - NULL, scontraRomInfo, scontraRomName, NULL, NULL, ThunderxInputInfo, ScontraDIPInfo, - scontraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 304, 3, 4 -}; - - -// Super Contra (Japan) - -static struct BurnRomInfo scontrajRomDesc[] = { - { "775-f02.bin", 0x10000, 0x8d5933a7, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "775-f03.bin", 0x10000, 0x1ef63d80, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "775-c01.bin", 0x08000, 0x0ced785a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "775-a07a.bin", 0x20000, 0xe716bdf3, 3 | BRF_GRA }, // 3 Background Tiles - { "775-a07e.bin", 0x20000, 0x0986e3a5, 3 | BRF_GRA }, // 4 - { "775-a08a.bin", 0x20000, 0x3ddd11a4, 3 | BRF_GRA }, // 5 - { "775-a08e.bin", 0x20000, 0x1007d963, 3 | BRF_GRA }, // 6 - { "775-f07c.bin", 0x10000, 0xb0b30915, 3 | BRF_GRA }, // 7 - { "775-f07g.bin", 0x10000, 0xfbed827d, 3 | BRF_GRA }, // 8 - { "775-f08c.bin", 0x10000, 0x53abdaec, 3 | BRF_GRA }, // 9 - { "775-f08g.bin", 0x10000, 0x3df85a6e, 3 | BRF_GRA }, // 10 - { "775-f07d.bin", 0x10000, 0xf184be8e, 3 | BRF_GRA }, // 11 - { "775-f07h.bin", 0x10000, 0x7b56c348, 3 | BRF_GRA }, // 12 - { "775-f08d.bin", 0x10000, 0x102dcace, 3 | BRF_GRA }, // 13 - { "775-f08h.bin", 0x10000, 0xad9d7016, 3 | BRF_GRA }, // 14 - - { "775-a05a.bin", 0x10000, 0xa0767045, 4 | BRF_GRA }, // 15 Sprites - { "775-a05e.bin", 0x10000, 0x2f656f08, 4 | BRF_GRA }, // 16 - { "775-a06a.bin", 0x10000, 0x77a34ad0, 4 | BRF_GRA }, // 17 - { "775-a06e.bin", 0x10000, 0x8a910c94, 4 | BRF_GRA }, // 18 - { "775-a05b.bin", 0x10000, 0xab8ad4fd, 4 | BRF_GRA }, // 19 - { "775-a05f.bin", 0x10000, 0x1c0eb1b6, 4 | BRF_GRA }, // 20 - { "775-a06b.bin", 0x10000, 0x563fb565, 4 | BRF_GRA }, // 21 - { "775-a06f.bin", 0x10000, 0xe14995c0, 4 | BRF_GRA }, // 22 - { "775-f05c.bin", 0x10000, 0x5647761e, 4 | BRF_GRA }, // 23 - { "775-f05g.bin", 0x10000, 0xa1692cca, 4 | BRF_GRA }, // 24 - { "775-f06c.bin", 0x10000, 0x5ee6f3c1, 4 | BRF_GRA }, // 25 - { "775-f06g.bin", 0x10000, 0x2645274d, 4 | BRF_GRA }, // 26 - { "775-f05d.bin", 0x10000, 0xad676a6f, 4 | BRF_GRA }, // 27 - { "775-f05h.bin", 0x10000, 0x3f925bcf, 4 | BRF_GRA }, // 28 - { "775-f06d.bin", 0x10000, 0xc8b764fa, 4 | BRF_GRA }, // 29 - { "775-f06h.bin", 0x10000, 0xd6595f59, 4 | BRF_GRA }, // 30 - - { "775-a04a.bin", 0x10000, 0x7efb2e0f, 5 | BRF_SND }, // 31 K007232 Samples - { "775-a04b.bin", 0x10000, 0xf41a2b33, 5 | BRF_SND }, // 32 - { "775-a04c.bin", 0x10000, 0xe4e58f14, 5 | BRF_SND }, // 33 - { "775-a04d.bin", 0x10000, 0xd46736f6, 5 | BRF_SND }, // 34 - { "775-f04e.bin", 0x10000, 0xfbf7e363, 5 | BRF_SND }, // 35 - { "775-f04f.bin", 0x10000, 0xb031ef2d, 5 | BRF_SND }, // 36 - { "775-f04g.bin", 0x10000, 0xee107bbb, 5 | BRF_SND }, // 37 - { "775-f04h.bin", 0x10000, 0xfb0fab46, 5 | BRF_SND }, // 38 - - { "775a09.b19", 0x00100, 0x46d1e0df, 6 | BRF_OPT }, // 39 Proms -}; - -STD_ROM_PICK(scontraj) -STD_ROM_FN(scontraj) - -struct BurnDriver BurnDrvScontraj = { - "scontraj", "scontra", NULL, NULL, "1988", - "Super Contra (Japan)\0", NULL, "Konami", "GX775", - L"Super \u9B42\u6597\u7F85 \u30A8\u30A4\u30EA\u30A2\u30F3 \u306E\u9006\u8972 (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT | GBF_HORSHOOT, 0, - NULL, scontrajRomInfo, scontrajRomName, NULL, NULL, ThunderxInputInfo, ScontraDIPInfo, - scontraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 304, 3, 4 -}; - - -// Thunder Cross (set 1) - -static struct BurnRomInfo thunderxRomDesc[] = { - { "873-s03.k15", 0x10000, 0x2aec2699, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "873-s02.k13", 0x10000, 0x6619333a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "873-f01.f8", 0x08000, 0xea35ffa3, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "873c06a.f6", 0x10000, 0x0e340b67, 3 | BRF_GRA }, // 3 Background Tiles - { "873c06c.f5", 0x10000, 0xef0e72cd, 3 | BRF_GRA }, // 4 - { "873c07a.f4", 0x10000, 0xa8aab84f, 3 | BRF_GRA }, // 5 - { "873c07c.f3", 0x10000, 0x2521009a, 3 | BRF_GRA }, // 6 - { "873c06b.e6", 0x10000, 0x97ad202e, 3 | BRF_GRA }, // 7 - { "873c06d.e5", 0x10000, 0x8393d42e, 3 | BRF_GRA }, // 8 - { "873c07b.e4", 0x10000, 0x12a2b8ba, 3 | BRF_GRA }, // 9 - { "873c07d.e3", 0x10000, 0xfae9f965, 3 | BRF_GRA }, // 10 - - { "873c04a.f11", 0x10000, 0xf7740bf3, 4 | BRF_GRA }, // 11 Sprites - { "873c04c.f10", 0x10000, 0x5dacbd2b, 4 | BRF_GRA }, // 12 - { "873c05a.f9", 0x10000, 0xd73e107d, 4 | BRF_GRA }, // 13 - { "873c05c.f8", 0x10000, 0x59903200, 4 | BRF_GRA }, // 14 - { "873c04b.e11", 0x10000, 0x9ac581da, 4 | BRF_GRA }, // 15 - { "873c04d.e10", 0x10000, 0x44a4668c, 4 | BRF_GRA }, // 16 - { "873c05b.e9", 0x10000, 0x81059b99, 4 | BRF_GRA }, // 17 - { "873c05d.e8", 0x10000, 0x7fa3d7df, 4 | BRF_GRA }, // 18 - - { "873a08.f20", 0x00100, 0xe2d09a1b, 6 | BRF_OPT }, // 19 Proms -}; - -STD_ROM_PICK(thunderx) -STD_ROM_FN(thunderx) - -static INT32 thunderxInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvThunderx = { - "thunderx", NULL, NULL, NULL, "1988", - "Thunder Cross (set 1)\0", NULL, "Konami", "GX873", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, thunderxRomInfo, thunderxRomName, NULL, NULL, ThunderxInputInfo, ThunderxDIPInfo, - thunderxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; - - -// Thunder Cross (set 2) - -static struct BurnRomInfo thunderxaRomDesc[] = { - { "873-k03.k15", 0x10000, 0x276817ad, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "873-k02.k13", 0x10000, 0x80cc1c45, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "873-h01.f8", 0x08000, 0x990b7a7c, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "873c06a.f6", 0x10000, 0x0e340b67, 3 | BRF_GRA }, // 3 Background Tiles - { "873c06c.f5", 0x10000, 0xef0e72cd, 3 | BRF_GRA }, // 4 - { "873c07a.f4", 0x10000, 0xa8aab84f, 3 | BRF_GRA }, // 5 - { "873c07c.f3", 0x10000, 0x2521009a, 3 | BRF_GRA }, // 6 - { "873c06b.e6", 0x10000, 0x97ad202e, 3 | BRF_GRA }, // 7 - { "873c06d.e5", 0x10000, 0x8393d42e, 3 | BRF_GRA }, // 8 - { "873c07b.e4", 0x10000, 0x12a2b8ba, 3 | BRF_GRA }, // 9 - { "873c07d.e3", 0x10000, 0xfae9f965, 3 | BRF_GRA }, // 10 - - { "873c04a.f11", 0x10000, 0xf7740bf3, 4 | BRF_GRA }, // 11 Sprites - { "873c04c.f10", 0x10000, 0x5dacbd2b, 4 | BRF_GRA }, // 12 - { "873c05a.f9", 0x10000, 0xd73e107d, 4 | BRF_GRA }, // 13 - { "873c05c.f8", 0x10000, 0x59903200, 4 | BRF_GRA }, // 14 - { "873c04b.e11", 0x10000, 0x9ac581da, 4 | BRF_GRA }, // 15 - { "873c04d.e10", 0x10000, 0x44a4668c, 4 | BRF_GRA }, // 16 - { "873c05b.e9", 0x10000, 0x81059b99, 4 | BRF_GRA }, // 17 - { "873c05d.e8", 0x10000, 0x7fa3d7df, 4 | BRF_GRA }, // 18 - - { "873a08.f20", 0x00100, 0xe2d09a1b, 6 | BRF_OPT }, // 19 Proms -}; - -STD_ROM_PICK(thunderxa) -STD_ROM_FN(thunderxa) - -struct BurnDriver BurnDrvThunderxa = { - "thunderxa", "thunderx", NULL, NULL, "1988", - "Thunder Cross (set 2)\0", NULL, "Konami", "GX873", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, thunderxaRomInfo, thunderxaRomName, NULL, NULL, ThunderxInputInfo, ThunderxDIPInfo, - thunderxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; - - -// Thunder Cross (set 3) - -static struct BurnRomInfo thunderxbRomDesc[] = { - { "873-03.k15", 0x10000, 0x36680a4e, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "873-02.k13", 0x10000, 0xc58b2c34, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "873-f01.f8", 0x08000, 0xea35ffa3, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "873c06a.f6", 0x10000, 0x0e340b67, 3 | BRF_GRA }, // 3 Background Tiles - { "873c06c.f5", 0x10000, 0xef0e72cd, 3 | BRF_GRA }, // 4 - { "873c07a.f4", 0x10000, 0xa8aab84f, 3 | BRF_GRA }, // 5 - { "873c07c.f3", 0x10000, 0x2521009a, 3 | BRF_GRA }, // 6 - { "873c06b.e6", 0x10000, 0x97ad202e, 3 | BRF_GRA }, // 7 - { "873c06d.e5", 0x10000, 0x8393d42e, 3 | BRF_GRA }, // 8 - { "873c07b.e4", 0x10000, 0x12a2b8ba, 3 | BRF_GRA }, // 9 - { "873c07d.e3", 0x10000, 0xfae9f965, 3 | BRF_GRA }, // 10 - - { "873c04a.f11", 0x10000, 0xf7740bf3, 4 | BRF_GRA }, // 11 Sprites - { "873c04c.f10", 0x10000, 0x5dacbd2b, 4 | BRF_GRA }, // 12 - { "873c05a.f9", 0x10000, 0xd73e107d, 4 | BRF_GRA }, // 13 - { "873c05c.f8", 0x10000, 0x59903200, 4 | BRF_GRA }, // 14 - { "873c04b.e11", 0x10000, 0x9ac581da, 4 | BRF_GRA }, // 15 - { "873c04d.e10", 0x10000, 0x44a4668c, 4 | BRF_GRA }, // 16 - { "873c05b.e9", 0x10000, 0x81059b99, 4 | BRF_GRA }, // 17 - { "873c05d.e8", 0x10000, 0x7fa3d7df, 4 | BRF_GRA }, // 18 - - { "873a08.f20", 0x00100, 0xe2d09a1b, 6 | BRF_OPT }, // 19 Proms -}; - -STD_ROM_PICK(thunderxb) -STD_ROM_FN(thunderxb) - -struct BurnDriver BurnDrvThunderxb = { - "thunderxb", "thunderx", NULL, NULL, "1988", - "Thunder Cross (set 3)\0", NULL, "Konami", "GX873", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, thunderxbRomInfo, thunderxbRomName, NULL, NULL, ThunderxInputInfo, ThunderxDIPInfo, - thunderxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; - - -// Thunder Cross (Japan) - -static struct BurnRomInfo thunderxjRomDesc[] = { - { "873-n03.k15", 0x10000, 0xa01e2e3e, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - { "873-n02.k13", 0x10000, 0x55afa2cc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "873-f01.f8", 0x08000, 0xea35ffa3, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "873c06a.f6", 0x10000, 0x0e340b67, 3 | BRF_GRA }, // 3 Background Tiles - { "873c06c.f5", 0x10000, 0xef0e72cd, 3 | BRF_GRA }, // 4 - { "873c07a.f4", 0x10000, 0xa8aab84f, 3 | BRF_GRA }, // 5 - { "873c07c.f3", 0x10000, 0x2521009a, 3 | BRF_GRA }, // 6 - { "873c06b.e6", 0x10000, 0x97ad202e, 3 | BRF_GRA }, // 7 - { "873c06d.e5", 0x10000, 0x8393d42e, 3 | BRF_GRA }, // 8 - { "873c07b.e4", 0x10000, 0x12a2b8ba, 3 | BRF_GRA }, // 9 - { "873c07d.e3", 0x10000, 0xfae9f965, 3 | BRF_GRA }, // 10 - - { "873c04a.f11", 0x10000, 0xf7740bf3, 4 | BRF_GRA }, // 11 Sprites - { "873c04c.f10", 0x10000, 0x5dacbd2b, 4 | BRF_GRA }, // 12 - { "873c05a.f9", 0x10000, 0xd73e107d, 4 | BRF_GRA }, // 13 - { "873c05c.f8", 0x10000, 0x59903200, 4 | BRF_GRA }, // 14 - { "873c04b.e11", 0x10000, 0x9ac581da, 4 | BRF_GRA }, // 15 - { "873c04d.e10", 0x10000, 0x44a4668c, 4 | BRF_GRA }, // 16 - { "873c05b.e9", 0x10000, 0x81059b99, 4 | BRF_GRA }, // 17 - { "873c05d.e8", 0x10000, 0x7fa3d7df, 4 | BRF_GRA }, // 18 - - { "873a08.f20", 0x00100, 0xe2d09a1b, 6 | BRF_OPT }, // 19 Proms -}; - -STD_ROM_PICK(thunderxj) -STD_ROM_FN(thunderxj) - -struct BurnDriver BurnDrvThunderxj = { - "thunderxj", "thunderx", NULL, NULL, "1988", - "Thunder Cross (Japan)\0", NULL, "Konami", "GX873", - L"Thunder Cross\0\u30B5\u30F3\u30C0\u30FC\u30AF\u30ED\u30B9 (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, thunderxjRomInfo, thunderxjRomName, NULL, NULL, ThunderxInputInfo, ThunderxDIPInfo, - thunderxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_timeplt.cpp b/jan/src/burn/drv/konami/d_timeplt.cpp deleted file mode 100644 index 98da0f163..000000000 --- a/jan/src/burn/drv/konami/d_timeplt.cpp +++ /dev/null @@ -1,1073 +0,0 @@ -// FB Alpha Time Pilot driver module -// Based on MAME driver by Nicola Salmoria - -/* - To do: - tc8830f sound core (only for chkun - *very* low priority) -*/ - - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "timeplt_snd.h" -//#include "tc8830f.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprTmp; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 nmi_enable; -static UINT8 last_sound_irq; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 game_select; -static INT32 watchdog; - -static struct BurnInputInfo TimepltInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Timeplt) - -static struct BurnInputInfo ChkunInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"Bet 1B", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 2" }, - {"Bet 2B", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 3" }, - {"Bet 3B", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 4" }, - {"Bet HR", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 5" }, - {"Keyout", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Chkun) - -static struct BurnInputInfo BikkuricInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 coin" }, - {"Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"Right", BIT_DIGITAL, DrvJoy2 + 5, "p1 right" }, - {"Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"Keyout", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bikkuric) - -static struct BurnDIPInfo TimepltDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x4b, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - {0x11, 0x01, 0x03, 0x00, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x00, "Upright" }, - {0x11, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x08, 0x08, "10000 50000" }, - {0x11, 0x01, 0x08, 0x00, "20000 60000" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x11, 0x01, 0x70, 0x70, "1 (Easiest)" }, - {0x11, 0x01, 0x70, 0x60, "2" }, - {0x11, 0x01, 0x70, 0x50, "3" }, - {0x11, 0x01, 0x70, 0x40, "4" }, - {0x11, 0x01, 0x70, 0x30, "5" }, - {0x11, 0x01, 0x70, 0x20, "6" }, - {0x11, 0x01, 0x70, 0x10, "7" }, - {0x11, 0x01, 0x70, 0x00, "8 (Difficult)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Timeplt) - -static struct BurnDIPInfo PsurgeDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Initial Energy" }, - {0x10, 0x01, 0x08, 0x00, "4" }, - {0x10, 0x01, 0x08, 0x08, "6" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x20, "4" }, - {0x10, 0x01, 0x30, 0x10, "5" }, - {0x10, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x03, 0x00, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0c, 0x00, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Infinite Shots (Cheat)" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Stop at Junctions" }, - {0x11, 0x01, 0x80, 0x80, "No" }, - {0x11, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Psurge) - -static struct BurnDIPInfo ChkunDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x7f, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0a, 0x01, 0x40, 0x40, "Off" }, - {0x0a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x0a, 0x01, 0x80, 0x00, "Off" }, - {0x0a, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x0b, 0x01, 0x01, 0x01, "2 Coins 1 Credits" }, - {0x0b, 0x01, 0x01, 0x00, "1 Coin 1 Credits" }, -}; - -STDDIPINFO(Chkun) - -static struct BurnDIPInfo BikkuricDIPList[]= -{ - {0x09, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x09, 0x01, 0x01, 0x01, "2 Coins 1 Credits" }, - {0x09, 0x01, 0x01, 0x00, "1 Coin 1 Credits" }, -}; - -STDDIPINFO(Bikkuric) - -static void __fastcall timeplt_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - TimepltSndSoundlatch(data); - return; - - case 0xc200: - watchdog = 0; - return; - - case 0xc300: - if (game_select != 2) { // psurge doesn't use this - nmi_enable = data & 1; - if (!nmi_enable) ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - } - return; - - case 0xc302: - // flipscreen = ~data & 1; - return; - - case 0xc304: - if (last_sound_irq == 0 && data) { - ZetClose(); - ZetOpen(1); - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - } - last_sound_irq = data; - return; - - case 0xc30a: - // coin counter - return; - } -} - -static UINT8 __fastcall timeplt_main_read(UINT16 address) -{ - switch (address) - { - case 0x6004: - return 0x80; // psurge protection - - case 0xc000: - return ZetTotalCycles() / 200; // vpos - - case 0xc200: - return DrvDips[1]; - - case 0xc300: - return DrvInputs[0]; - - case 0xc320: - if (game_select > 2) return (DrvInputs[1] & ~0x02) | (ZetTotalCycles() & 0x02); - return DrvInputs[1]; - - case 0xc340: - return DrvInputs[2]; - - case 0xc360: - return DrvDips[0]; - } - - return 0; -} - -#if 0 -static void AY8910_1_portA_w(UINT32, UINT32 /*data*/) -{ -// if (~data & 0x40) tc8830fWrite(data & 0xf); -// if (~data & 0x10) tc8830fReset(); -} -#endif - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset(AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - TimepltSndReset(); - -// tc8830fReset(); - - last_sound_irq = 0; - nmi_enable = 0; - - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x006000; - DrvZ80ROM1 = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000240; - - DrvSndROM = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x0180 * sizeof(UINT32); - - DrvSprTmp = Next; Next += 0x6000; - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000200; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(INT32 mode) -{ - INT32 Plane[3] = { 4, 0, 4 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(8*8,1), STEP4(16*8,1), STEP4(24*8,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(32*8,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x8000); - - GfxDecode(0x0800, 2, 8, 8, Plane, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x4000); - - GfxDecode(0x0100, 2, 16, 16, Plane + mode, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit(INT32 game) -{ - game_select = game; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (game_select == 1) // timeplt - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00040, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00140, 10, 1)) return 1; - - DrvGfxDecode(0); - } - - if (game_select == 2) // psurge - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x01000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 7, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00040, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00140, 11, 1)) return 1; - - DrvGfxDecode(0); - } - - if (game_select == 3) // chkun - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 6, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00040, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00140, 8, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x10000, 10, 1)) return 1; - - DrvGfxDecode(1); - } - - if (game_select == 4) // bikkuric - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 6, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00040, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00140, 8, 1)) return 1; - - DrvGfxDecode(1); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); - if (game_select >= 3) { - ZetMapMemory(DrvZ80RAM0 + 0x0800,0x6000, 0x67ff, MAP_RAM); - } - ZetMapMemory(DrvColRAM, 0xa000, 0xa3ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xa400, 0xa7ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xa800, 0xafff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0000,0xb000, 0xb0ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0000,0xb100, 0xb1ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0000,0xb200, 0xb2ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0000,0xb300, 0xb3ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0100,0xb400, 0xb4ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0100,0xb500, 0xb5ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0100,0xb600, 0xb6ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0100,0xb700, 0xb7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0000,0xb800, 0xb8ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0000,0xb900, 0xb9ff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0000,0xba00, 0xbaff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0000,0xbb00, 0xbbff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0100,0xbc00, 0xbcff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0100,0xbd00, 0xbdff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0100,0xbe00, 0xbeff, MAP_RAM); - ZetMapMemory(DrvSprRAM + 0x0100,0xbf00, 0xbfff, MAP_RAM); - ZetSetWriteHandler(timeplt_main_write); - ZetSetReadHandler(timeplt_main_read); - ZetClose(); - - TimepltSndInit(DrvZ80ROM1, DrvZ80RAM1, 1); - -// tc8830fInit(512000, DrvSndROM, 0x20000, 1); -// tc8830fSetAllRoutes(0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - TimepltSndExit(); - -// tc8830fInit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pens[32]; - - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0 = (DrvColPROM[i + 1 * 32] >> 1) & 0x01; - INT32 bit1 = (DrvColPROM[i + 1 * 32] >> 2) & 0x01; - INT32 bit2 = (DrvColPROM[i + 1 * 32] >> 3) & 0x01; - INT32 bit3 = (DrvColPROM[i + 1 * 32] >> 4) & 0x01; - INT32 bit4 = (DrvColPROM[i + 1 * 32] >> 5) & 0x01; - INT32 r = 0x19 * bit0 + 0x24 * bit1 + 0x35 * bit2 + 0x40 * bit3 + 0x4d * bit4; - bit0 = (DrvColPROM[i + 1 * 32] >> 6) & 0x01; - bit1 = (DrvColPROM[i + 1 * 32] >> 7) & 0x01; - bit2 = (DrvColPROM[i + 0 * 32] >> 0) & 0x01; - bit3 = (DrvColPROM[i + 0 * 32] >> 1) & 0x01; - bit4 = (DrvColPROM[i + 0 * 32] >> 2) & 0x01; - INT32 g = 0x19 * bit0 + 0x24 * bit1 + 0x35 * bit2 + 0x40 * bit3 + 0x4d * bit4; - bit0 = (DrvColPROM[i + 0 * 32] >> 3) & 0x01; - bit1 = (DrvColPROM[i + 0 * 32] >> 4) & 0x01; - bit2 = (DrvColPROM[i + 0 * 32] >> 5) & 0x01; - bit3 = (DrvColPROM[i + 0 * 32] >> 6) & 0x01; - bit4 = (DrvColPROM[i + 0 * 32] >> 7) & 0x01; - INT32 b = 0x19 * bit0 + 0x24 * bit1 + 0x35 * bit2 + 0x40 * bit3 + 0x4d * bit4; - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 256; i++) { - DrvPalette[i + 0x80] = pens[DrvColPROM[i+0x040] & 0x0f]; - } - - for (INT32 i = 0; i < 128; i++) { - DrvPalette[i + 0x00] = pens[(DrvColPROM[i+0x140] & 0x0f) + 0x10]; - } -} - -static void draw_layer(INT32 priority) -{ - INT32 global_flip = (game_select == 2) ? ((32*32)-1) : 0; - - for (INT32 offs = (32 * 2); offs < (32 * 32) - (32 * 2); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvColRAM[offs^global_flip]; - INT32 code =(DrvVidRAM[offs^global_flip] + ((attr & 0x60) << 3)); - INT32 color = attr & 0x1f; - INT32 category, flipx, flipy; - - if (game_select > 2) { - flipx = flipy = 0; - category = attr >> 7; - } else { - flipx = attr & 0x40; - flipy = attr & 0x80; - category = (attr >> 4) & 1; - code &= 0x1ff; - } - - if (game_select == 2) { - flipx = !flipx; - flipy = !flipy; - } - - if (priority != category) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 line = 16; line < 240; line++) - { - UINT8 *ram = DrvSprTmp + (line * 0x60); - UINT16 *dst = pTransDraw + ((line - 16) * nScreenWidth); - - for (INT32 offs = 0x2e; offs >= 0; offs -= 2) - { - INT32 sy = 241 - ram[offs + 0x31]; - if (sy < (line-15) || sy > line) continue; - - INT32 sx = ram[offs + 0x00]; - INT32 code = ram[offs + 0x01]; - INT32 color = ram[offs + 0x30] & 0x3f; - INT32 flipx =~ram[offs + 0x30] & 0x40; - INT32 flipy = ram[offs + 0x30] & 0x80; - - { - UINT8 *gfx = DrvGfxROM1 + (code * 0x100); - color = (color << 2) + 0x80; - flipx = (flipx ? 0x0f : 0); - flipy = (flipy ? 0xf0 : 0); - gfx += (((line - sy) * 0x10) ^ flipy); - - for (INT32 x = 0; x < 16; x++, sx++) - { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[x^flipx]; - - if (pxl) { - dst[sx] = pxl + color; - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(0); - draw_sprites(); - draw_layer(1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 3072000 / 60, 1789772 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - INT32 scanline = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - INT32 nSegment = (nCyclesTotal[0] * (i + 1)) / nInterleave; - nCyclesDone[0] += ZetRun(nSegment - nCyclesDone[0]); - if (i == (nInterleave - 1) && nmi_enable) ZetSetIRQLine(0x20, CPU_IRQSTATUS_ACK); - if (i == (nInterleave - 1) && game_select == 2) ZetNmi(); - ZetClose(); - - scanline = i + 5; - if (scanline >= 16 && scanline < 240) { - memcpy (DrvSprTmp + scanline * 0x60 + 0x00, DrvSprRAM + 0x010, 0x30); - memcpy (DrvSprTmp + scanline * 0x60 + 0x30, DrvSprRAM + 0x110, 0x30); - } - - ZetOpen(1); - nSegment = (nCyclesTotal[1] * i) / nInterleave; - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); -// tc8830fUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - TimepltSndScan(nAction, pnMin); - - SCAN_VAR(nmi_enable); - SCAN_VAR(last_sound_irq); - } - - return 0; -} - - -// Time Pilot - -static struct BurnRomInfo timepltRomDesc[] = { - { "tm1", 0x2000, 0x1551f1b9, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "tm2", 0x2000, 0x58636cb5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tm3", 0x2000, 0xff4e0d83, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "tm7", 0x1000, 0xd66da813, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "tm6", 0x2000, 0xc2507f40, 3 | BRF_GRA }, // 4 Characters - - { "tm4", 0x2000, 0x7e437c3e, 4 | BRF_GRA }, // 5 Sprites - { "tm5", 0x2000, 0xe8ca87b9, 4 | BRF_GRA }, // 6 - - { "timeplt.b4", 0x0020, 0x34c91839, 5 | BRF_GRA }, // 7 Color PROMs - { "timeplt.b5", 0x0020, 0x463b2b07, 5 | BRF_GRA }, // 8 - { "timeplt.e9", 0x0100, 0x4bbb2150, 5 | BRF_GRA }, // 9 - { "timeplt.e12", 0x0100, 0xf7b7663e, 5 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(timeplt) -STD_ROM_FN(timeplt) - -static INT32 timepltInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvTimeplt = { - "timeplt", NULL, NULL, NULL, "1982", - "Time Pilot\0", NULL, "Konami", "GX393", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, timepltRomInfo, timepltRomName, NULL, NULL, TimepltInputInfo, TimepltDIPInfo, - timepltInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 224, 256, 3, 4 -}; - - -// Time Pilot (Atari) - -static struct BurnRomInfo timepltaRomDesc[] = { - { "cd_e1.bin", 0x2000, 0xa4513b35, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "cd_e2.bin", 0x2000, 0x38b0c72a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cd_e3.bin", 0x2000, 0x83846870, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "tm7", 0x1000, 0xd66da813, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "tm6", 0x2000, 0xc2507f40, 3 | BRF_GRA }, // 4 Characters - - { "tm4", 0x2000, 0x7e437c3e, 4 | BRF_GRA }, // 5 Sprites - { "tm5", 0x2000, 0xe8ca87b9, 4 | BRF_GRA }, // 6 - - { "timeplt.b4", 0x0020, 0x34c91839, 5 | BRF_GRA }, // 7 Color PROMs - { "timeplt.b5", 0x0020, 0x463b2b07, 5 | BRF_GRA }, // 8 - { "timeplt.e9", 0x0100, 0x4bbb2150, 5 | BRF_GRA }, // 9 - { "timeplt.e12", 0x0100, 0xf7b7663e, 5 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(timeplta) -STD_ROM_FN(timeplta) - -struct BurnDriver BurnDrvTimeplta = { - "timeplta", "timeplt", NULL, NULL, "1982", - "Time Pilot (Atari)\0", NULL, "Konami (Atari license)", "GX393", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, timepltaRomInfo, timepltaRomName, NULL, NULL, TimepltInputInfo, TimepltDIPInfo, - timepltInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 224, 256, 3, 4 -}; - - -// Time Pilot (Centuri) - -static struct BurnRomInfo timepltcRomDesc[] = { - { "cd1y", 0x2000, 0x83ec72c2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "cd2y", 0x2000, 0x0dcf5287, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cd3y", 0x2000, 0xc789b912, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "tm7", 0x1000, 0xd66da813, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "tm6", 0x2000, 0xc2507f40, 3 | BRF_GRA }, // 4 Characters - - { "tm4", 0x2000, 0x7e437c3e, 4 | BRF_GRA }, // 5 Sprites - { "tm5", 0x2000, 0xe8ca87b9, 4 | BRF_GRA }, // 6 - - { "timeplt.b4", 0x0020, 0x34c91839, 5 | BRF_GRA }, // 7 Color PROMs - { "timeplt.b5", 0x0020, 0x463b2b07, 5 | BRF_GRA }, // 8 - { "timeplt.e9", 0x0100, 0x4bbb2150, 5 | BRF_GRA }, // 9 - { "timeplt.e12", 0x0100, 0xf7b7663e, 5 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(timepltc) -STD_ROM_FN(timepltc) - -struct BurnDriver BurnDrvTimepltc = { - "timepltc", "timeplt", NULL, NULL, "1982", - "Time Pilot (Centuri)\0", NULL, "Konami (Centuri license)", "GX393", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, timepltcRomInfo, timepltcRomName, NULL, NULL, TimepltInputInfo, TimepltDIPInfo, - timepltInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 224, 256, 3, 4 -}; - - -// Space Pilot - -static struct BurnRomInfo spacepltRomDesc[] = { - { "sp1", 0x2000, 0xac8ca3ae, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "sp2", 0x2000, 0x1f0308ef, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sp3", 0x2000, 0x90aeca50, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "tm7", 0x1000, 0xd66da813, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "sp6", 0x2000, 0x76caa8af, 3 | BRF_GRA }, // 4 Characters - - { "sp4", 0x2000, 0x3781ce7a, 4 | BRF_GRA }, // 5 Sprites - { "tm5", 0x2000, 0xe8ca87b9, 4 | BRF_GRA }, // 6 - - { "timeplt.b4", 0x0020, 0x34c91839, 5 | BRF_GRA }, // 7 Color PROMs - { "timeplt.b5", 0x0020, 0x463b2b07, 5 | BRF_GRA }, // 8 - { "timeplt.e9", 0x0100, 0x4bbb2150, 5 | BRF_GRA }, // 9 - { "timeplt.e12", 0x0100, 0xf7b7663e, 5 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(spaceplt) -STD_ROM_FN(spaceplt) - -struct BurnDriver BurnDrvSpaceplt = { - "spaceplt", "timeplt", NULL, NULL, "1982", - "Space Pilot\0", NULL, "bootleg", "GX393", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, spacepltRomInfo, spacepltRomName, NULL, NULL, TimepltInputInfo, TimepltDIPInfo, - timepltInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 224, 256, 3, 4 -}; - - -// Power Surge - -static struct BurnRomInfo psurgeRomDesc[] = { - { "p1", 0x2000, 0x05f9ba12, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "p2", 0x2000, 0x3ff41576, 1 | BRF_PRG | BRF_ESS }, // 1 - { "p3", 0x2000, 0xe8fe120a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "p6", 0x1000, 0xb52d01fa, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "p7", 0x1000, 0x9db5c0ce, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "p4", 0x2000, 0x26fd7f81, 3 | BRF_GRA }, // 5 Characters - - { "p5", 0x2000, 0x6066ec8e, 4 | BRF_GRA }, // 6 Sprites - { "tm5", 0x2000, 0xe8ca87b9, 4 | BRF_GRA }, // 7 - - { "timeplt.b4", 0x0020, 0x34c91839, 5 | BRF_GRA }, // 8 Color PROMs - { "timeplt.b5", 0x0020, 0x463b2b07, 5 | BRF_GRA }, // 9 - { "timeplt.e9", 0x0100, 0x4bbb2150, 5 | BRF_GRA }, // 10 - { "timeplt.e12", 0x0100, 0xf7b7663e, 5 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(psurge) -STD_ROM_FN(psurge) - -static INT32 psurgeInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvPsurge = { - "psurge", NULL, NULL, NULL, "1988", - "Power Surge\0", NULL, "Vision Electronics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_MAZE, 0, - NULL, psurgeRomInfo, psurgeRomName, NULL, NULL, TimepltInputInfo, PsurgeDIPInfo, - psurgeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 224, 256, 3, 4 -}; - - -// Chance Kun (Japan) - -static struct BurnRomInfo chkunRomDesc[] = { - { "n1.16a", 0x04000, 0xc5879f9b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "12.14a", 0x02000, 0x80cc55da, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "15.3l", 0x02000, 0x1f1463ca, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "13.4d", 0x04000, 0x776427c0, 3 | BRF_GRA }, // 3 Characters - - { "14.8h", 0x04000, 0x0cb76a48, 4 | BRF_GRA }, // 4 Sprites - - { "3.2j", 0x00020, 0x34c91839, 5 | BRF_GRA }, // 5 Color PROMs - { "2.1h", 0x00020, 0x463b2b07, 5 | BRF_GRA }, // 6 - { "4.10h", 0x00100, 0x4bbb2150, 5 | BRF_GRA }, // 7 - { "mb7114e.2b", 0x00100, 0xadfa399a, 5 | BRF_GRA }, // 8 - - { "v1.8k", 0x10000, 0xd5ca802d, 6 | BRF_GRA }, // 9 tc8830f Samples - { "v2.9k", 0x10000, 0x70e902eb, 6 | BRF_GRA }, // 10 - - { "a.16c", 0x000eb, 0xe0d54999, 7 | BRF_GRA }, // 11 PLDs - { "b.9f", 0x000eb, 0xe3857f83, 7 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(chkun) -STD_ROM_FN(chkun) - -static INT32 chkunInit() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvChkun = { - "chkun", NULL, NULL, NULL, "1988", - "Chance Kun (Japan)\0", NULL, "Peni Soft", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_CASINO, 0, - NULL, chkunRomInfo, chkunRomName, NULL, NULL, ChkunInputInfo, ChkunDIPInfo, - chkunInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 224, 256, 3, 4 -}; - - -// Bikkuri Card (Japan) - -static struct BurnRomInfo bikkuricRomDesc[] = { - { "1.a16", 0x4000, 0xe8d595ab, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.a14", 0x2000, 0x63fd7d53, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "5.l3", 0x2000, 0xbc438531, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "3.d4", 0x8000, 0x74e8a64b, 3 | BRF_GRA }, // 3 Characters - - { "4.h8", 0x2000, 0xd303942d, 4 | BRF_GRA }, // 4 Sprites - - { "3.2j", 0x0020, 0x34c91839, 5 | BRF_GRA }, // 5 Color PROMs - { "2.1h", 0x0020, 0x463b2b07, 5 | BRF_GRA }, // 6 - { "4.10h", 0x0100, 0x4bbb2150, 5 | BRF_GRA }, // 7 - { "1.2b", 0x0100, 0xf7b7663e, 5 | BRF_GRA }, // 8 - - { "a.16c", 0x00eb, 0x00000000, 6 | BRF_NODUMP }, // 9 PLDs - { "b.9f", 0x00eb, 0x00000000, 6 | BRF_NODUMP }, // 10 -}; - -STD_ROM_PICK(bikkuric) -STD_ROM_FN(bikkuric) - -static INT32 bikkuricInit() -{ - return DrvInit(4); -} - -struct BurnDriver BurnDrvBikkuric = { - "bikkuric", NULL, NULL, NULL, "1987", - "Bikkuri Card (Japan)\0", NULL, "Peni Soft", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_CASINO, 0, - NULL, bikkuricRomInfo, bikkuricRomName, NULL, NULL, BikkuricInputInfo, BikkuricDIPInfo, - bikkuricInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_tmnt.cpp b/jan/src/burn/drv/konami/d_tmnt.cpp deleted file mode 100644 index d98c43837..000000000 --- a/jan/src/burn/drv/konami/d_tmnt.cpp +++ /dev/null @@ -1,6940 +0,0 @@ -// FB Alpha Teenage Mutant Ninja Turtle driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "upd7759.h" -#include "k007232.h" -#include "k053260.h" -#include "eeprom.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort4[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort5[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[3] = {0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvZ80Rom = NULL; -static UINT8 *DrvZ80Ram = NULL; -static UINT8 *DrvSoundRom = NULL; -static UINT8 *DrvUPD7759CRom = NULL; -static UINT8 *DrvTileRom = NULL; -static UINT8 *DrvSpriteRom = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvNvRam = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; -static INT16 *DrvTitleSample = NULL; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static UINT8 bIrqEnable; -static INT32 LayerColourBase[3]; -static INT32 SpriteColourBase; -static INT32 LayerPri[3]; -static UINT8 DrvSoundLatch; -static INT32 PriorityFlag; - -static INT32 dim_c, dim_v; -static INT32 NoDim = 0; - -static INT32 DrvNvRamBank; -static INT32 CuebrickSndIrqFire; -static INT32 BlswhstlTileRomBank; - -static INT32 TitleSoundLatch; -static INT32 PlayTitleSample; -static double TitleSamplePos = 0; -static double TitleSampleGain; -static INT32 TitleSampleOutputDir; - -static UINT8 DrvVBlank; - -static INT32 InitEEPROMCount; - -static const eeprom_interface BlswhstlEEPROMInterface = -{ - 7, - 8, - "011000", - "011100", - 0, - "0100000000000", - "0100110000000", - 0, - 0 -}; - -static const eeprom_interface thndrx2_eeprom_interface = -{ - 7, - 8, - "011000", - "010100", - 0, - "0100000000000", - "0100110000000", - 0, - 0 -}; - -static struct BurnInputInfo TmntInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 coin" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 coin" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , DrvInputPort0 + 2, "p3 coin" }, - {"P3 Up" , BIT_DIGITAL , DrvInputPort3 + 2, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , DrvInputPort3 + 3, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , DrvInputPort3 + 0, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , DrvInputPort3 + 1, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , DrvInputPort3 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , DrvInputPort3 + 5, "p3 fire 2" }, - - {"P4 Coin" , BIT_DIGITAL , DrvInputPort0 + 3, "p4 coin" }, - {"P4 Up" , BIT_DIGITAL , DrvInputPort4 + 2, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , DrvInputPort4 + 3, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , DrvInputPort4 + 0, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , DrvInputPort4 + 1, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , DrvInputPort4 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , DrvInputPort4 + 5, "p4 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service 1" , BIT_DIGITAL , DrvInputPort0 + 4, "service" }, - {"Service 2" , BIT_DIGITAL , DrvInputPort0 + 5, "service2" }, - {"Service 3" , BIT_DIGITAL , DrvInputPort0 + 6, "service3" }, - {"Service 4" , BIT_DIGITAL , DrvInputPort0 + 7, "service4" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Tmnt) - -static struct BurnInputInfo Tmnt2pInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service 1" , BIT_DIGITAL , DrvInputPort0 + 4, "service" }, - {"Service 2" , BIT_DIGITAL , DrvInputPort0 + 5, "service2" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Tmnt2p) - -static struct BurnInputInfo MiaInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort0 + 4, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort2 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 6, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Mia) - -static struct BurnInputInfo BlswhstlInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort0 + 5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 2, "service" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort0 + 3, "diag" }, -}; - -STDINPUTINFO(Blswhstl) - -static struct BurnInputInfo Ssriders4pInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 coin" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 coin" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , DrvInputPort0 + 2, "p3 coin" }, - {"P3 Up" , BIT_DIGITAL , DrvInputPort3 + 2, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , DrvInputPort3 + 3, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , DrvInputPort3 + 0, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , DrvInputPort3 + 1, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , DrvInputPort3 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , DrvInputPort3 + 5, "p3 fire 2" }, - - {"P4 Coin" , BIT_DIGITAL , DrvInputPort0 + 3, "p4 coin" }, - {"P4 Up" , BIT_DIGITAL , DrvInputPort4 + 2, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , DrvInputPort4 + 3, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , DrvInputPort4 + 0, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , DrvInputPort4 + 1, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , DrvInputPort4 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , DrvInputPort4 + 5, "p4 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service 1" , BIT_DIGITAL , DrvInputPort0 + 4, "service" }, - {"Service 2" , BIT_DIGITAL , DrvInputPort0 + 5, "service2" }, - {"Service 3" , BIT_DIGITAL , DrvInputPort0 + 6, "service3" }, - {"Service 4" , BIT_DIGITAL , DrvInputPort0 + 7, "service4" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort5 + 7, "diag" }, -}; - -STDINPUTINFO(Ssriders4p) - -static struct BurnInputInfo SsridersInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service 1" , BIT_DIGITAL , DrvInputPort0 + 4, "service" }, - {"Service 2" , BIT_DIGITAL , DrvInputPort0 + 5, "service2" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort5 + 7, "diag" }, -}; - -STDINPUTINFO(Ssriders) - -static struct BurnInputInfo Ssriders4psInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , DrvInputPort0 + 2, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , DrvInputPort3 + 7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , DrvInputPort3 + 2, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , DrvInputPort3 + 3, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , DrvInputPort3 + 0, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , DrvInputPort3 + 1, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , DrvInputPort3 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , DrvInputPort3 + 5, "p3 fire 2" }, - - {"P4 Coin" , BIT_DIGITAL , DrvInputPort0 + 3, "p4 coin" }, - {"P4 Start" , BIT_DIGITAL , DrvInputPort4 + 7, "p4 start" }, - {"P4 Up" , BIT_DIGITAL , DrvInputPort4 + 2, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , DrvInputPort4 + 3, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , DrvInputPort4 + 0, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , DrvInputPort4 + 1, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , DrvInputPort4 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , DrvInputPort4 + 5, "p4 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service 1" , BIT_DIGITAL , DrvInputPort0 + 4, "service" }, - {"Service 2" , BIT_DIGITAL , DrvInputPort0 + 5, "service2" }, - {"Service 3" , BIT_DIGITAL , DrvInputPort0 + 6, "service3" }, - {"Service 4" , BIT_DIGITAL , DrvInputPort0 + 7, "service4" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort5 + 7, "diag" }, -}; - -STDINPUTINFO(Ssriders4ps) - -static struct BurnInputInfo Thndrx2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort1 + 0, "p1 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvInputPort0 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvInputPort0 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvInputPort0 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvInputPort0 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvInputPort0 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvInputPort0 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvInputPort1 + 1, "p2 coin" }, - - {"P2 Start", BIT_DIGITAL, DrvInputPort2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvInputPort2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvInputPort2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvInputPort2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvInputPort2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvInputPort1 + 2, "service" }, - {"Diagnostics", BIT_DIGITAL, DrvInputPort1 + 3, "diag" }, -}; - -STDINPUTINFO(Thndrx2) - -static struct BurnInputInfo LgtnfghtInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort0 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvInputPort0 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvInputPort1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvInputPort1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvInputPort1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvInputPort1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvInputPort1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvInputPort1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvInputPort0 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvInputPort0 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvInputPort2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvInputPort2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvInputPort2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvInputPort2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvInputPort2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvInputPort2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvInputPort0 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip" }, -}; - -STDINPUTINFO(Lgtnfght) - -static struct BurnInputInfo QgakumonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort0 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvInputPort1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvInputPort1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvInputPort1 + 3, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvInputPort1 + 0, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvInputPort1 + 1, "p1 fire 4" }, - {"P1 Push", BIT_DIGITAL, DrvInputPort1 + 4, "p1 fire 5" }, - - {"P2 Coin", BIT_DIGITAL, DrvInputPort0 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvInputPort2 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvInputPort2 + 2, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvInputPort2 + 3, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvInputPort2 + 0, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvInputPort2 + 1, "p2 fire 4" }, - {"P2 Push", BIT_DIGITAL, DrvInputPort2 + 4, "p2 fire 5" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvInputPort0 + 4, "service" }, - {"Diagnostics", BIT_DIGITAL, DrvInputPort5 + 7, "diag" }, -}; - -STDINPUTINFO(Qgakumon) - -static struct BurnInputInfo PunkshotInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort0 + 0, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvInputPort1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvInputPort1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvInputPort1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvInputPort1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvInputPort1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvInputPort0 + 1, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvInputPort2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvInputPort2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvInputPort2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvInputPort2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvInputPort2 + 5, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvInputPort0 + 2, "p3 coin" }, - {"P3 Up", BIT_DIGITAL, DrvInputPort3 + 2, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvInputPort3 + 3, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvInputPort3 + 0, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvInputPort3 + 1, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvInputPort3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvInputPort3 + 5, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvInputPort0 + 3, "p4 coin" }, - {"P4 Up", BIT_DIGITAL, DrvInputPort4 + 2, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvInputPort4 + 3, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvInputPort4 + 0, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvInputPort4 + 1, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvInputPort4 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvInputPort4 + 5, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvInputPort0 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvInputPort0 + 5, "service2" }, - {"Service 3", BIT_DIGITAL, DrvInputPort0 + 6, "service3" }, - {"Service 4", BIT_DIGITAL, DrvInputPort0 + 7, "service4" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip" }, -}; - -STDINPUTINFO(Punkshot) - -static struct BurnInputInfo Punkshot2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort0 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvInputPort5 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvInputPort1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvInputPort1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvInputPort1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvInputPort1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvInputPort1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvInputPort0 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvInputPort5 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvInputPort2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvInputPort2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvInputPort2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvInputPort2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvInputPort0 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip" }, -}; - -STDINPUTINFO(Punkshot2) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = DrvInput[3] = DrvInput[4] = DrvInput[5] = 0x00; - - // Compile Digital Inputs - for (int i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - DrvInput[3] |= (DrvInputPort3[i] & 1) << i; - DrvInput[4] |= (DrvInputPort4[i] & 1) << i; - DrvInput[5] |= (DrvInputPort5[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); - DrvClearOpposites(&DrvInput[3]); - DrvClearOpposites(&DrvInput[4]); -} - -static inline void SsridersMakeInputs() -{ - DrvMakeInputs(); - - DrvInput[5] ^= 0xf6; - //if (DrvInputPort5[7]) DrvInput[5] -= 0x80; -} - -static struct BurnDIPInfo TmntDIPList[]= -{ - // Default Values - {0x21, 0xff, 0xff, 0xff, NULL }, - {0x22, 0xff, 0xff, 0x5e, NULL }, - {0x23, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Coinage" }, - {0x21, 0x01, 0x0f, 0x00, "5 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x21, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x21, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x21, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x21, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x21, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x21, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x21, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x21, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x22, 0x01, 0x03, 0x03, "1" }, - {0x22, 0x01, 0x03, 0x02, "2" }, - {0x22, 0x01, 0x03, 0x01, "3" }, - {0x22, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x22, 0x01, 0x60, 0x60, "Easy" }, - {0x22, 0x01, 0x60, 0x40, "Normal" }, - {0x22, 0x01, 0x60, 0x20, "Difficult" }, - {0x22, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x23, 0x01, 0x01, 0x01, "Off" }, - {0x23, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x23, 0x01, 0x04, 0x04, "Off" }, - {0x23, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Tmnt) - -static struct BurnDIPInfo Tmnt2pDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x5e, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x13, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15 , "Coin B" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x03, 0x03, "1" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x60, 0x60, "Easy" }, - {0x14, 0x01, 0x60, 0x40, "Normal" }, - {0x14, 0x01, 0x60, 0x20, "Difficult" }, - {0x14, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Tmnt2p) - -static struct BurnDIPInfo MiaDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x56, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15 , "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x03, 0x03, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "30k 80k" }, - {0x15, 0x01, 0x18, 0x10, "50k 100k" }, - {0x15, 0x01, 0x18, 0x08, "50k" }, - {0x15, 0x01, 0x18, 0x00, "100k" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Difficult" }, - {0x15, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "VRAM Character Check" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Mia) - -static struct BurnDIPInfo LgtnfghtDIPList[]= -{ - {0x14, 0xff, 0xff, 0x5e, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "2" }, - {0x14, 0x01, 0x03, 0x02, "3" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x18, 0x18, "100000 400000" }, - {0x14, 0x01, 0x18, 0x10, "150000 500000" }, - {0x14, 0x01, 0x18, 0x08, "200000" }, - {0x14, 0x01, 0x18, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x60, 0x60, "Easy" }, - {0x14, 0x01, 0x60, 0x40, "Medium" }, - {0x14, 0x01, 0x60, 0x20, "Hard" }, - {0x14, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x15, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound" }, - {0x16, 0x01, 0x02, 0x02, "Mono" }, - {0x16, 0x01, 0x02, 0x00, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Lgtnfght) - -static struct BurnDIPInfo PunkshotDIPList[]= -{ - {0x21, 0xff, 0xff, 0xff, NULL }, - {0x22, 0xff, 0xff, 0x7f, NULL }, - {0x23, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x21, 0x01, 0x0f, 0x00, "5 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x21, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x21, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x21, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x21, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x21, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x21, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x21, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x21, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x21, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x21, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Continue" }, - {0x21, 0x01, 0x10, 0x10, "Normal" }, - {0x21, 0x01, 0x10, 0x00, "1 Coin" }, - - {0 , 0xfe, 0 , 4, "Energy" }, - {0x22, 0x01, 0x03, 0x03, "30" }, - {0x22, 0x01, 0x03, 0x02, "40" }, - {0x22, 0x01, 0x03, 0x01, "50" }, - {0x22, 0x01, 0x03, 0x00, "60" }, - - {0 , 0xfe, 0 , 4, "Period Length" }, - {0x22, 0x01, 0x0c, 0x0c, "2 Minutes" }, - {0x22, 0x01, 0x0c, 0x08, "3 Minutes" }, - {0x22, 0x01, 0x0c, 0x04, "4 Minutes" }, - {0x22, 0x01, 0x0c, 0x00, "5 Minutes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x22, 0x01, 0x60, 0x60, "Easy" }, - {0x22, 0x01, 0x60, 0x40, "Medium" }, - {0x22, 0x01, 0x60, 0x20, "Hard" }, - {0x22, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x23, 0x01, 0x10, 0x10, "Off" }, - {0x23, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x23, 0x01, 0x40, 0x40, "Off" }, - {0x23, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x23, 0x01, 0x80, 0x80, "Off" }, - {0x23, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Punkshot) - -static struct BurnDIPInfo Punkshot2DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x12, 0x01, 0x0f, 0x00, "5 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Continue" }, - {0x12, 0x01, 0x10, 0x10, "Normal" }, - {0x12, 0x01, 0x10, 0x00, "1 Coin" }, - - {0 , 0xfe, 0 , 4, "Energy" }, - {0x13, 0x01, 0x03, 0x03, "40" }, - {0x13, 0x01, 0x03, 0x02, "50" }, - {0x13, 0x01, 0x03, 0x01, "60" }, - {0x13, 0x01, 0x03, 0x00, "70" }, - - {0 , 0xfe, 0 , 4, "Period Length" }, - {0x13, 0x01, 0x0c, 0x0c, "3 Minutes" }, - {0x13, 0x01, 0x0c, 0x08, "4 Minutes" }, - {0x13, 0x01, 0x0c, 0x04, "5 Minutes" }, - {0x13, 0x01, 0x0c, 0x00, "6 Minutes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Medium" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Punkshot2) - -static struct BurnDIPInfo PunkshotjDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Period Time" }, - {0x13, 0x01, 0x0c, 0x0c, "1 Minute" }, - {0x13, 0x01, 0x0c, 0x08, "2 Minutes" }, - {0x13, 0x01, 0x0c, 0x04, "3 Minutes" }, - {0x13, 0x01, 0x0c, 0x00, "4 Minutes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Medium" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Punkshotj) - -static struct BurnRomInfo TmntRomDesc[] = { - { "963-x23.j17", 0x020000, 0xa9549004, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963-x24.k17", 0x020000, 0xe5cc9067, BRF_ESS | BRF_PRG }, // 1 - { "963-x21.j15", 0x010000, 0x5789cf92, BRF_ESS | BRF_PRG }, // 2 - { "963-x22.k15", 0x010000, 0x0a74e277, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmnt) -STD_ROM_FN(Tmnt) - -static struct BurnRomInfo TmntuRomDesc[] = { - { "963-r23.j17", 0x020000, 0xa7f61195, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963-r24.k17", 0x020000, 0x661e056a, BRF_ESS | BRF_PRG }, // 1 - { "963-r21.j15", 0x010000, 0xde047bb6, BRF_ESS | BRF_PRG }, // 2 - { "963-r22.k15", 0x010000, 0xd86a0888, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmntu) -STD_ROM_FN(Tmntu) - -static struct BurnRomInfo TmntuaRomDesc[] = { - { "963-j23.j17", 0x020000, 0xf77314e2, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963-j24.k17", 0x020000, 0x47f662d3, BRF_ESS | BRF_PRG }, // 1 - { "963-j21.j15", 0x010000, 0x7bee9fe8, BRF_ESS | BRF_PRG }, // 2 - { "963-j22.k15", 0x010000, 0x2efed09f, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmntua) -STD_ROM_FN(Tmntua) - -static struct BurnRomInfo TmntubRomDesc[] = { - { "963-h23.j17", 0x020000, 0x718086e1, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963-h24.k17", 0x020000, 0x2f7d66e1, BRF_ESS | BRF_PRG }, // 1 - { "963-h21.j15", 0x010000, 0x1944641e, BRF_ESS | BRF_PRG }, // 2 - { "963-h22.k15", 0x010000, 0x50ce5512, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmntub) -STD_ROM_FN(Tmntub) - -static struct BurnRomInfo TmhtRomDesc[] = { - { "963-f23.j17", 0x020000, 0x9cb5e461, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963-f24.k17", 0x020000, 0x2d902fab, BRF_ESS | BRF_PRG }, // 1 - { "963-f21.j15", 0x010000, 0x9fa25378, BRF_ESS | BRF_PRG }, // 2 - { "963-f22.k15", 0x010000, 0x2127ee53, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmht) -STD_ROM_FN(Tmht) - -static struct BurnRomInfo TmhtaRomDesc[] = { - { "963-s23.j17", 0x020000, 0xb5af7eee, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963-s24.k17", 0x020000, 0xbcb8ce8b, BRF_ESS | BRF_PRG }, // 1 - { "963-s21.j15", 0x010000, 0x0b88bfa6, BRF_ESS | BRF_PRG }, // 2 - { "963-s22.k15", 0x010000, 0x44ce6d4b, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmhta) -STD_ROM_FN(Tmhta) - -static struct BurnRomInfo TmhtbRomDesc[] = { - { "unk3.i17", 0x020000, 0x537eb047, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "unk4.k17", 0x020000, 0x5afae564, BRF_ESS | BRF_PRG }, // 1 - { "unk2.j15", 0x010000, 0xee34de05, BRF_ESS | BRF_PRG }, // 2 - { "unk5.k15", 0x010000, 0x5ef58d4e, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmhtb) -STD_ROM_FN(Tmhtb) - -static struct BurnRomInfo TmntjRomDesc[] = { - { "963_223.j17", 0x020000, 0x0d34a5ff, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963_224.k17", 0x020000, 0x2fd453f2, BRF_ESS | BRF_PRG }, // 1 - { "963_221.j15", 0x010000, 0xfa8e25fd, BRF_ESS | BRF_PRG }, // 2 - { "963_222.k15", 0x010000, 0xca437a4f, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmntj) -STD_ROM_FN(Tmntj) - -static struct BurnRomInfo TmntaRomDesc[] = { - { "tmnt j17.bin", 0x020000, 0x00819687, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "tmnt k17.bin", 0x020000, 0x6930e085, BRF_ESS | BRF_PRG }, // 1 - { "tmnt j15.bin", 0x010000, 0xfd1e2e01, BRF_ESS | BRF_PRG }, // 2 - { "tmnt k15.bin", 0x010000, 0xb01eea79, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmnta) -STD_ROM_FN(Tmnta) - -static struct BurnRomInfo Tmht2pRomDesc[] = { - { "963-u23.j17", 0x020000, 0x58bec748, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963-u24.k17", 0x020000, 0xdce87c8d, BRF_ESS | BRF_PRG }, // 1 - { "963-u21.j15", 0x010000, 0xabce5ead, BRF_ESS | BRF_PRG }, // 2 - { "963-u22.k15", 0x010000, 0x4ecc8d6b, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmht2p) -STD_ROM_FN(Tmht2p) - -static struct BurnRomInfo Tmht2paRomDesc[] = { - { "963-_23.j17", 0x020000, 0x8698061a, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963-_24.k17", 0x020000, 0x4036c075, BRF_ESS | BRF_PRG }, // 1 - { "963-_21.j15", 0x010000, 0xddcc979c, BRF_ESS | BRF_PRG }, // 2 - { "963-_22.k15", 0x010000, 0x71a38d27, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmht2pa) -STD_ROM_FN(Tmht2pa) - -static struct BurnRomInfo Tmnt2pjRomDesc[] = { - { "963-123.j17", 0x020000, 0x6a3527c9, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "963-124.k17", 0x020000, 0x2c4bfa15, BRF_ESS | BRF_PRG }, // 1 - { "963-121.j15", 0x010000, 0x4181b733, BRF_ESS | BRF_PRG }, // 2 - { "963-122.k15", 0x010000, 0xc64eb5ff, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmnt2pj) -STD_ROM_FN(Tmnt2pj) - -static struct BurnRomInfo Tmnt2poRomDesc[] = { - { "tmnt123.j17", 0x020000, 0x2d905183, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "tmnt124.k17", 0x020000, 0xe0125352, BRF_ESS | BRF_PRG }, // 1 - { "tmnt21.j15", 0x010000, 0x12deeafb, BRF_ESS | BRF_PRG }, // 2 - { "tmnt22.k15", 0x010000, 0xaec4f1c3, BRF_ESS | BRF_PRG }, // 3 - - { "963e20.g13", 0x008000, 0x1692a6d6, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "963a28.h27", 0x080000, 0xdb4769a8, BRF_GRA }, // 5 Tiles - { "963a29.k27", 0x080000, 0x8069cd2e, BRF_GRA }, // 6 - - { "963a17.h4", 0x080000, 0xb5239a44, BRF_GRA }, // 7 Sprites - { "963a18.h6", 0x080000, 0xdd51adef, BRF_GRA }, // 8 - { "963a15.k4", 0x080000, 0x1f324eed, BRF_GRA }, // 9 - { "963a16.k6", 0x080000, 0xd4bd9984, BRF_GRA }, // 10 - - { "963a30.g7", 0x000100, 0xabd82680, BRF_GRA }, // 11 PROMs - { "963a31.g19", 0x000100, 0xf8004a1c, BRF_GRA }, // 12 - - { "963a26.c13", 0x020000, 0xe2ac3063, BRF_SND }, // 13 K007232 Samples - - { "963a27.d18", 0x020000, 0x2dfd674b, BRF_SND }, // 14 UP7759C Samples - - { "963a25.d5", 0x080000, 0xfca078c7, BRF_SND }, // 15 Title Music Sample -}; - -STD_ROM_PICK(Tmnt2po) -STD_ROM_FN(Tmnt2po) - -static struct BurnRomInfo MiaRomDesc[] = { - { "808t20.h17", 0x020000, 0x6f0acb1d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "808t21.j17", 0x020000, 0x42a30416, BRF_ESS | BRF_PRG }, // 1 - - { "808e03.f4", 0x008000, 0x3d93a7cd, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "808e12.f28", 0x010000, 0xd62f1fde, BRF_GRA }, // 3 Tiles - { "808e13.h28", 0x010000, 0x1fa708f4, BRF_GRA }, // 4 - { "808e22.i28", 0x010000, 0x73d758f6, BRF_GRA }, // 5 - { "808e23.k28", 0x010000, 0x8ff08b21, BRF_GRA }, // 6 - - { "808d17.j4", 0x080000, 0xd1299082, BRF_GRA }, // 7 Sprites - { "808d15.h4", 0x080000, 0x2b22a6b6, BRF_GRA }, // 8 - - { "808a18.f16", 0x000100, 0xeb95aede, BRF_GRA }, // 9 PROMs - - { "808d01.d4", 0x020000, 0xfd4d37c0, BRF_SND }, // 10 K007232 Samples -}; - -STD_ROM_PICK(Mia) -STD_ROM_FN(Mia) - -static struct BurnRomInfo Mia2RomDesc[] = { - { "808s20.h17", 0x020000, 0xcaa2897f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "808s21.j17", 0x020000, 0x3d892ffb, BRF_ESS | BRF_PRG }, // 1 - - { "808e03.f4", 0x008000, 0x3d93a7cd, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "808e12.f28", 0x010000, 0xd62f1fde, BRF_GRA }, // 3 Tiles - { "808e13.h28", 0x010000, 0x1fa708f4, BRF_GRA }, // 4 - { "808e22.i28", 0x010000, 0x73d758f6, BRF_GRA }, // 5 - { "808e23.k28", 0x010000, 0x8ff08b21, BRF_GRA }, // 6 - - { "808d17.j4", 0x080000, 0xd1299082, BRF_GRA }, // 7 Sprites - { "808d15.h4", 0x080000, 0x2b22a6b6, BRF_GRA }, // 8 - - { "808a18.f16", 0x000100, 0xeb95aede, BRF_GRA }, // 9 PROMs - - { "808d01.d4", 0x020000, 0xfd4d37c0, BRF_SND }, // 10 K007232 Samples -}; - -STD_ROM_PICK(Mia2) -STD_ROM_FN(Mia2) - -static struct BurnRomInfo CuebrickRomDesc[] = { - { "903d25.g12", 0x010000, 0x8d575663, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "903d24.f12", 0x010000, 0x2973625d, BRF_ESS | BRF_PRG }, // 1 - - { "903c29.k21", 0x010000, 0xfada986d, BRF_GRA }, // 2 Tiles - { "903c27.k17", 0x010000, 0x5bd4b8e1, BRF_GRA }, // 3 - { "903c28.k19", 0x010000, 0x80d2bfaf, BRF_GRA }, // 4 - { "903c26.k15", 0x010000, 0xf808fa3d, BRF_GRA }, // 5 - - { "903d23.k12", 0x010000, 0xc39fc9fd, BRF_GRA }, // 6 Sprites - { "903d21.k8", 0x010000, 0x3c7bf8cd, BRF_GRA }, // 7 - { "903d22.k10", 0x010000, 0x95ad8591, BRF_GRA }, // 8 - { "903d20.k6", 0x010000, 0x2872a1bb, BRF_GRA }, // 9 -}; - -STD_ROM_PICK(Cuebrick) -STD_ROM_FN(Cuebrick) - -static struct BurnRomInfo BlswhstlRomDesc[] = { - { "060_l02.e09", 0x020000, 0xe8b7b234, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "060_l03.g09", 0x020000, 0x3c26d281, BRF_ESS | BRF_PRG }, // 1 - { "060_l09.e11", 0x020000, 0x14628736, BRF_ESS | BRF_PRG }, // 2 - { "060_l10.g11", 0x020000, 0xf738ad4a, BRF_ESS | BRF_PRG }, // 3 - - { "060j01.f3", 0x010000, 0xf9d9a673, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "060e07.k16", 0x080000, 0xc400edf3, BRF_GRA }, // 5 Tiles - { "060e08.k12", 0x080000, 0x70dddba1, BRF_GRA }, // 6 - - { "060e06.k7", 0x080000, 0x09381492, BRF_GRA }, // 7 Sprites - { "060e05.k3", 0x080000, 0x32454241, BRF_GRA }, // 8 - - { "060e04.d1", 0x100000, 0xc680395d, BRF_SND }, // 9 K053260 Samples - - { "blswhstl.nv", 0x000080, 0x87434e3f, BRF_OPT }, -}; - -STD_ROM_PICK(Blswhstl) -STD_ROM_FN(Blswhstl) - -static struct BurnRomInfo BlswhstlaRomDesc[] = { - { "060_m02.e09", 0x020000, 0xbc9dd08f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "060_m03.g09", 0x020000, 0x7b6ee4a4, BRF_ESS | BRF_PRG }, // 1 - { "060_m09.e11", 0x020000, 0x14628736, BRF_ESS | BRF_PRG }, // 2 - { "060_m10.g11", 0x020000, 0xf738ad4a, BRF_ESS | BRF_PRG }, // 3 - - { "060j01.f3", 0x010000, 0xf9d9a673, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "060e07.k16", 0x080000, 0xc400edf3, BRF_GRA }, // 5 Tiles - { "060e08.k12", 0x080000, 0x70dddba1, BRF_GRA }, // 6 - - { "060e06.k7", 0x080000, 0x09381492, BRF_GRA }, // 7 Sprites - { "060e05.k3", 0x080000, 0x32454241, BRF_GRA }, // 8 - - { "060e04.d1", 0x100000, 0xc680395d, BRF_SND }, // 9 K053260 Samples - - { "blswhstl.nv", 0x000080, 0x87434e3f, BRF_OPT }, -}; - -STD_ROM_PICK(Blswhstla) -STD_ROM_FN(Blswhstla) - -static struct BurnRomInfo DetatwinRomDesc[] = { - { "060_j02.e09", 0x020000, 0x11b761ac, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "060_j03.g09", 0x020000, 0x8d0b588c, BRF_ESS | BRF_PRG }, // 1 - { "060_j09.e11", 0x020000, 0xf2a5f15f, BRF_ESS | BRF_PRG }, // 2 - { "060_j10.g11", 0x020000, 0x36eefdbc, BRF_ESS | BRF_PRG }, // 3 - - { "060j01.f3", 0x010000, 0xf9d9a673, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "060e07.k16", 0x080000, 0xc400edf3, BRF_GRA }, // 5 Tiles - { "060e08.k12", 0x080000, 0x70dddba1, BRF_GRA }, // 6 - - { "060e06.k7", 0x080000, 0x09381492, BRF_GRA }, // 7 Sprites - { "060e05.k3", 0x080000, 0x32454241, BRF_GRA }, // 8 - - { "060e04.d1", 0x100000, 0xc680395d, BRF_SND }, // 9 K053260 Samples - - { "blswhstl.nv", 0x000080, 0x87434e3f, BRF_OPT }, -}; - -STD_ROM_PICK(Detatwin) -STD_ROM_FN(Detatwin) - -static struct BurnRomInfo SsridersRomDesc[] = { - { "064eac02.8e", 0x040000, 0x5a5425f4, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064eac03.8g", 0x040000, 0x093c00fb, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_eac.nv", 0x000080, 0xf6d641a7, BRF_OPT }, -}; - -STD_ROM_PICK(Ssriders) -STD_ROM_FN(Ssriders) - -static struct BurnRomInfo SsridersebdRomDesc[] = { - { "064ebd02.8e", 0x040000, 0x8deef9ac, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064ebd03.8g", 0x040000, 0x2370c107, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_ebd.nv", 0x000080, 0xcbc903f6, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersebd) -STD_ROM_FN(Ssridersebd) - -static struct BurnRomInfo SsridersebcRomDesc[] = { - { "064ebc02.8e", 0x040000, 0x9bd7d164, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064ebc03.8g", 0x040000, 0x40fd4165, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_ebc.nv", 0x000080, 0x1918e90f, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersebc) -STD_ROM_FN(Ssridersebc) - -static struct BurnRomInfo SsridersudaRomDesc[] = { - { "064uda02.8e", 0x040000, 0x5129a6b7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064uda03.8g", 0x040000, 0x9f887214, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_uda.nv", 0x000080, 0x148c6d64, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersuda) -STD_ROM_FN(Ssridersuda) - -static struct BurnRomInfo SsriderseaaRomDesc[] = { - { "064eaa02.8e", 0x040000, 0x4844660f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064eaa03.8g", 0x040000, 0x0b9bcc7c, BRF_ESS | BRF_PRG }, // 1 - { "064eaa04.10e", 0x020000, 0x5d917c1c, BRF_ESS | BRF_PRG }, // 2 - { "064eaa05.10g", 0x020000, 0xf4647b74, BRF_ESS | BRF_PRG }, // 3 - - { "064eaa01.2f", 0x010000, 0xbce45d82, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_eaa.nv", 0x000080, 0x74a45ef5, BRF_OPT }, -}; - -STD_ROM_PICK(Ssriderseaa) -STD_ROM_FN(Ssriderseaa) - -static struct BurnRomInfo SsridersuabRomDesc[] = { - { "064uab02.8e", 0x040000, 0xf1a3c548, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064uab03.8g", 0x040000, 0x66a61287, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_uab.nv", 0x000080, 0xfe08b210, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersuab) -STD_ROM_FN(Ssridersuab) - -static struct BurnRomInfo SsridersuacRomDesc[] = { - { "064uac02.8e", 0x040000, 0x870473b6, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064uac03.8g", 0x040000, 0xeadf289a, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_uac.nv", 0x000080, 0x26c8f1a0, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersuac) -STD_ROM_FN(Ssridersuac) - -static struct BurnRomInfo SsridersubcRomDesc[] = { - { "064ubc02.8e", 0x040000, 0xaca7fda5, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064ubc03.8g", 0x040000, 0xbb1fdeff, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_ubc.nv", 0x000080, 0x31c5504f, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersubc) -STD_ROM_FN(Ssridersubc) - -static struct BurnRomInfo SsridersabdRomDesc[] = { - { "064abd02.8e", 0x040000, 0x713406cb, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064abd03.8g", 0x040000, 0x680feb3c, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_abd.nv", 0x000080, 0xbfdafedf, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersabd) -STD_ROM_FN(Ssridersabd) - -static struct BurnRomInfo SsridersaddRomDesc[] = { - { "064add02.8e", 0x040000, 0x06b0138e, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064add03.8g", 0x040000, 0x03eb8b91, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_add.nv", 0x000080, 0xf06242d5, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersadd) -STD_ROM_FN(Ssridersadd) - -static struct BurnRomInfo SsridersjacRomDesc[] = { - { "064jac02.8e", 0x040000, 0x64a35f6f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064jac03.8g", 0x040000, 0xb5957946, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_jac.nv", 0x000080, 0xeeb0c55f, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersjac) -STD_ROM_FN(Ssridersjac) - -static struct BurnRomInfo SsridersjadRomDesc[] = { - { "064jad02.8e", 0x040000, 0x13709ee6, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064jad03.8g", 0x040000, 0x2fa32229, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_jad.nv", 0x000080, 0x8962058c, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersjad) -STD_ROM_FN(Ssridersjad) - -static struct BurnRomInfo SsridersjbdRomDesc[] = { - { "064jbd02.8e", 0x040000, 0x7acdc1e3, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "064jbd03.8g", 0x040000, 0x6a424918, BRF_ESS | BRF_PRG }, // 1 - { "064eab04.10e", 0x020000, 0xef2315bd, BRF_ESS | BRF_PRG }, // 2 - { "064eab05.10g", 0x020000, 0x51d6fbc4, BRF_ESS | BRF_PRG }, // 3 - - { "064e01.2f", 0x010000, 0x44b9bc52, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 5 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 6 - - { "064e09.7l", 0x100000, 0x4160c372, BRF_GRA }, // 7 Sprites - { "064e07.3l", 0x100000, 0x64dd673c, BRF_GRA }, // 8 - - { "064e06.1d", 0x100000, 0x59810df9, BRF_SND }, // 9 K053260 Samples - - { "ssriders_jbd.nv", 0x000080, 0x006200e3, BRF_OPT }, -}; - -STD_ROM_PICK(Ssridersjbd) -STD_ROM_FN(Ssridersjbd) - -static struct BurnRomInfo ssridersbRomDesc[] = { - { "sunsetb.03", 0x080000, 0x37ffe90b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "sunsetb.04", 0x080000, 0x8ff647b7, BRF_ESS | BRF_PRG }, // 1 - - { "064e12.16k", 0x080000, 0xe2bdc619, BRF_GRA }, // 2 Tiles - { "064e11.12k", 0x080000, 0x2d8ca8b0, BRF_GRA }, // 3 - - { "sunsetb.05", 0x080000, 0x8a0ff31a, BRF_GRA }, // 4 Sprites - { "sunsetb.06", 0x080000, 0xfdf2c887, BRF_GRA }, // 5 - { "sunsetb.07", 0x080000, 0xa545b1ed, BRF_GRA }, // 6 - { "sunsetb.08", 0x080000, 0xf867cd38, BRF_GRA }, // 7 - - { "sunsetb.01", 0x080000, 0x1a8b5ca2, BRF_SND }, // 8 OKI Samples - { "sunsetb.02", 0x080000, 0x5d485523, BRF_SND }, // 9 -}; - -STD_ROM_PICK(ssridersb) -STD_ROM_FN(ssridersb) - -static struct BurnRomInfo thndrx2RomDesc[] = { - { "073-ea-l02.11c", 0x020000, 0xeae02b51, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "073-ea-l03.12c", 0x020000, 0x738ed007, BRF_ESS | BRF_PRG }, // 1 - - { "073-c01.4f", 0x010000, 0x44ebe83c, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "073-c06.16k", 0x080000, 0x24e22b42, BRF_GRA }, // 3 Tiles - { "073-c05.12k", 0x080000, 0x952a935f, BRF_GRA }, // 4 - - { "073-c07.7k", 0x080000, 0x14e93f38, BRF_GRA }, // 5 Sprites - { "073-c08.3k", 0x080000, 0x09fab3ab, BRF_GRA }, // 6 - - { "073-b04.2d", 0x080000, 0x05287a0b, BRF_SND }, // 7 K053260 Samples - - { "thndrx2.nv", 0x000080, 0xca613e98, BRF_OPT }, -}; - -STD_ROM_PICK(thndrx2) -STD_ROM_FN(thndrx2) - -static struct BurnRomInfo thndrx2aRomDesc[] = { - { "073-aa-m02.11c", 0x020000, 0x5b5b4cc0, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "073-aa-m03.12c", 0x020000, 0x320435a8, BRF_ESS | BRF_PRG }, // 1 - - { "073-c01.4f", 0x010000, 0x44ebe83c, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "073-c06.16k", 0x080000, 0x24e22b42, BRF_GRA }, // 3 Tiles - { "073-c05.12k", 0x080000, 0x952a935f, BRF_GRA }, // 4 - - { "073-c07.7k", 0x080000, 0x14e93f38, BRF_GRA }, // 5 Sprites - { "073-c08.3k", 0x080000, 0x09fab3ab, BRF_GRA }, // 6 - - { "073-b04.2d", 0x080000, 0x05287a0b, BRF_SND }, // 7 K053260 Samples - - { "thndrx2a.nv", 0x000080, 0xf7893d00, BRF_OPT }, -}; - -STD_ROM_PICK(thndrx2a) -STD_ROM_FN(thndrx2a) - -static struct BurnRomInfo thndrx2jRomDesc[] = { - { "073-ja-k02.11c", 0x020000, 0x0c8b2d3f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "073-ja-k03.12c", 0x020000, 0x3803b427, BRF_ESS | BRF_PRG }, // 1 - - { "073-c01.4f", 0x010000, 0x44ebe83c, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "073-c06.16k", 0x080000, 0x24e22b42, BRF_GRA }, // 3 Tiles - { "073-c05.12k", 0x080000, 0x952a935f, BRF_GRA }, // 4 - - { "073-c07.7k", 0x080000, 0x14e93f38, BRF_GRA }, // 5 Sprites - { "073-c08.3k", 0x080000, 0x09fab3ab, BRF_GRA }, // 6 - - { "073-b04.2d", 0x080000, 0x05287a0b, BRF_SND }, // 7 K053260 Samples - - { "thndrx2j.nv", 0x000080, 0x83b4799b, BRF_OPT }, -}; - -STD_ROM_PICK(thndrx2j) -STD_ROM_FN(thndrx2j) - -static struct BurnRomInfo lgtnfghtRomDesc[] = { - { "939k02.e11", 0x020000, 0x2dfefa53, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "939k03.e15", 0x020000, 0x14f0c454, BRF_ESS | BRF_PRG }, // 1 - - { "939e01.d7", 0x008000, 0x4a5fc848, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "939a07.k14", 0x080000, 0x7955dfcf, BRF_GRA }, // 3 Tiles - { "939a08.k19", 0x080000, 0xed95b385, BRF_GRA }, // 4 - - { "939a06.k8", 0x080000, 0xe393c206, BRF_GRA }, // 5 Sprites - { "939a05.k2", 0x080000, 0x3662d47a, BRF_GRA }, // 6 - - { "939a04.c5", 0x080000, 0xc24e2b6e, BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(lgtnfght) -STD_ROM_FN(lgtnfght) - -static struct BurnRomInfo lgtnfghtuRomDesc[] = { - { "939m02.e11", 0x020000, 0x61a12184, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "939m03.e15", 0x020000, 0x6db6659d, BRF_ESS | BRF_PRG }, // 1 - - { "939e01.d7", 0x008000, 0x4a5fc848, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "939a07.k14", 0x080000, 0x7955dfcf, BRF_GRA }, // 3 Tiles - { "939a08.k19", 0x080000, 0xed95b385, BRF_GRA }, // 4 - - { "939a06.k8", 0x080000, 0xe393c206, BRF_GRA }, // 5 Sprites - { "939a05.k2", 0x080000, 0x3662d47a, BRF_GRA }, // 6 - - { "939a04.c5", 0x080000, 0xc24e2b6e, BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(lgtnfghtu) -STD_ROM_FN(lgtnfghtu) - -static struct BurnRomInfo lgtnfghtaRomDesc[] = { - { "939j_02.e11", 0x020000, 0xbbbb4a74, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "939j_03.e15", 0x020000, 0x8d4da7b7, BRF_ESS | BRF_PRG }, // 1 - - { "939e01.d7", 0x008000, 0x4a5fc848, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "939a07.k14", 0x080000, 0x7955dfcf, BRF_GRA }, // 3 Tiles - { "939a08.k19", 0x080000, 0xed95b385, BRF_GRA }, // 4 - - { "939a06.k8", 0x080000, 0xe393c206, BRF_GRA }, // 5 Sprites - { "939a05.k2", 0x080000, 0x3662d47a, BRF_GRA }, // 6 - - { "939a04.c5", 0x080000, 0xc24e2b6e, BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(lgtnfghta) -STD_ROM_FN(lgtnfghta) - -static struct BurnRomInfo trigonRomDesc[] = { - { "939j02.e11", 0x020000, 0x38381d1b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "939j03.e15", 0x020000, 0xb5beddcd, BRF_ESS | BRF_PRG }, // 1 - - { "939e01.d7", 0x008000, 0x4a5fc848, BRF_ESS | BRF_PRG }, // 2 Z80 Code - - { "939a07.k14", 0x080000, 0x7955dfcf, BRF_GRA }, // 3 Tiles - { "939a08.k19", 0x080000, 0xed95b385, BRF_GRA }, // 4 - - { "939a06.k8", 0x080000, 0xe393c206, BRF_GRA }, // 5 Sprites - { "939a05.k2", 0x080000, 0x3662d47a, BRF_GRA }, // 6 - - { "939a04.c5", 0x080000, 0xc24e2b6e, BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(trigon) -STD_ROM_FN(trigon) - -static struct BurnRomInfo tmnt2RomDesc[] = { - { "063uaa02.8e", 0x020000, 0x58d5c93d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "063uaa03.8g", 0x020000, 0x0541fec9, BRF_ESS | BRF_PRG }, // 1 - { "063uaa04.10e", 0x020000, 0x1d441a7d, BRF_ESS | BRF_PRG }, // 2 - { "063uaa05.10g", 0x020000, 0x9c428273, BRF_ESS | BRF_PRG }, // 3 - - { "063b01.2f", 0x010000, 0x364f548a, BRF_ESS | BRF_PRG }, // 4 Z80 Code - - { "063b12.16k", 0x080000, 0xd3283d19, BRF_GRA }, // 5 Tiles - { "063b11.12k", 0x080000, 0x6ebc0c15, BRF_GRA }, // 6 - - { "063b09.7l", 0x100000, 0x2d7a9d2a, BRF_GRA }, // 7 Sprites - { "063b10.7k", 0x080000, 0xf2dd296e, BRF_GRA }, // 8 - { "063b07.3l", 0x100000, 0xd9bee7bf, BRF_GRA }, // 9 - { "063b08.3k", 0x080000, 0x3b1ae36f, BRF_GRA }, // 10 - - { "063b06.1d", 0x200000, 0x1e510aa5, BRF_SND }, // 11 K053260 Samples - - { "tmnt2_uaa.nv", 0x000080, 0x284357bd, BRF_OPT }, -}; - -STD_ROM_PICK(tmnt2) -STD_ROM_FN(tmnt2) - -static struct BurnRomInfo tmnt22puRomDesc[] = { - { "063uda02.8e", 0x020000, 0xaadffe3a, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "063uda03.8g", 0x020000, 0x125687a8, BRF_ESS | BRF_PRG }, // 1 - { "063uda04.10e", 0x020000, 0xfb5c7ded, BRF_ESS | BRF_PRG }, // 2 - { "063uda05.10g", 0x020000, 0x3c40fe66, BRF_ESS | BRF_PRG }, // 3 - - { "063b01.2f", 0x010000, 0x364f548a, BRF_ESS | BRF_PRG }, // 4 Z80 Code - - { "063b12.16k", 0x080000, 0xd3283d19, BRF_GRA }, // 5 Tiles - { "063b11.12k", 0x080000, 0x6ebc0c15, BRF_GRA }, // 6 - - { "063b09.7l", 0x100000, 0x2d7a9d2a, BRF_GRA }, // 7 Sprites - { "063b10.7k", 0x080000, 0xf2dd296e, BRF_GRA }, // 8 - { "063b07.3l", 0x100000, 0xd9bee7bf, BRF_GRA }, // 9 - { "063b08.3k", 0x080000, 0x3b1ae36f, BRF_GRA }, // 10 - - { "063b06.1d", 0x200000, 0x1e510aa5, BRF_SND }, // 11 K053260 Samples - - { "tmnt2_uda.nv", 0x000080, 0x44928d33, BRF_OPT }, -}; - -STD_ROM_PICK(tmnt22pu) -STD_ROM_FN(tmnt22pu) - -static struct BurnRomInfo tmht22peRomDesc[] = { - { "063eba02.8e", 0x020000, 0x99409094, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "063eba03.8g", 0x020000, 0x4d65650f, BRF_ESS | BRF_PRG }, // 1 - { "063eba04.10e", 0x020000, 0xf6e3b9c7, BRF_ESS | BRF_PRG }, // 2 - { "063eba05.10g", 0x020000, 0x1bad6696, BRF_ESS | BRF_PRG }, // 3 - - { "063b01.2f", 0x010000, 0x364f548a, BRF_ESS | BRF_PRG }, // 4 Z80 Code - - { "063b12.16k", 0x080000, 0xd3283d19, BRF_GRA }, // 5 Tiles - { "063b11.12k", 0x080000, 0x6ebc0c15, BRF_GRA }, // 6 - - { "063b09.7l", 0x100000, 0x2d7a9d2a, BRF_GRA }, // 7 Sprites - { "063b10.7k", 0x080000, 0xf2dd296e, BRF_GRA }, // 8 - { "063b07.3l", 0x100000, 0xd9bee7bf, BRF_GRA }, // 9 - { "063b08.3k", 0x080000, 0x3b1ae36f, BRF_GRA }, // 10 - - { "063b06.1d", 0x200000, 0x1e510aa5, BRF_SND }, // 11 K053260 Samples - - { "tmnt2_eba.nv", 0x000080, 0xc0a3ed50, BRF_OPT }, -}; - -STD_ROM_PICK(tmht22pe) -STD_ROM_FN(tmht22pe) - -static struct BurnRomInfo tmht24peRomDesc[] = { - { "063eaa02.8e", 0x020000, 0x665a68de, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "063eaa03.8g", 0x020000, 0x7b7fb3af, BRF_ESS | BRF_PRG }, // 1 - { "063eaa04.10e", 0x020000, 0x69f38e1d, BRF_ESS | BRF_PRG }, // 2 - { "063eaa05.10g", 0x020000, 0x818032af, BRF_ESS | BRF_PRG }, // 3 - - { "063b01.2f", 0x010000, 0x364f548a, BRF_ESS | BRF_PRG }, // 4 Z80 Code - - { "063b12.16k", 0x080000, 0xd3283d19, BRF_GRA }, // 5 Tiles - { "063b11.12k", 0x080000, 0x6ebc0c15, BRF_GRA }, // 6 - - { "063b09.7l", 0x100000, 0x2d7a9d2a, BRF_GRA }, // 7 Sprites - { "063b10.7k", 0x080000, 0xf2dd296e, BRF_GRA }, // 8 - { "063b07.3l", 0x100000, 0xd9bee7bf, BRF_GRA }, // 9 - { "063b08.3k", 0x080000, 0x3b1ae36f, BRF_GRA }, // 10 - - { "063b06.1d", 0x200000, 0x1e510aa5, BRF_SND }, // 11 K053260 Samples - - { "tmnt2_eaa.nv", 0x000080, 0x124af18f, BRF_OPT }, -}; - -STD_ROM_PICK(tmht24pe) -STD_ROM_FN(tmht24pe) - -static struct BurnRomInfo tmnt2aRomDesc[] = { - { "063ada02.8e", 0x020000, 0x4f11b587, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "063ada03.8g", 0x020000, 0x82a1b9ac, BRF_ESS | BRF_PRG }, // 1 - { "063ada04.10e", 0x020000, 0x05ad187a, BRF_ESS | BRF_PRG }, // 2 - { "063ada05.10g", 0x020000, 0xd4826547, BRF_ESS | BRF_PRG }, // 3 - - { "063b01.2f", 0x010000, 0x364f548a, BRF_ESS | BRF_PRG }, // 4 Z80 Code - - { "063b12.16k", 0x080000, 0xd3283d19, BRF_GRA }, // 5 Tiles - { "063b11.12k", 0x080000, 0x6ebc0c15, BRF_GRA }, // 6 - - { "063b09.7l", 0x100000, 0x2d7a9d2a, BRF_GRA }, // 7 Sprites - { "063b10.7k", 0x080000, 0xf2dd296e, BRF_GRA }, // 8 - { "063b07.3l", 0x100000, 0xd9bee7bf, BRF_GRA }, // 9 - { "063b08.3k", 0x080000, 0x3b1ae36f, BRF_GRA }, // 10 - - { "063b06.1d", 0x200000, 0x1e510aa5, BRF_SND }, // 11 K053260 Samples - - { "tmnt2_ada.nv", 0x000080, 0x063068a0, BRF_OPT }, -}; - -STD_ROM_PICK(tmnt2a) -STD_ROM_FN(tmnt2a) - -static struct BurnRomInfo qgakumonRomDesc[] = { - { "248jaa02.8e", 0x040000, 0xfab79410, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "248jaa03.8g", 0x040000, 0x8d888ef3, BRF_ESS | BRF_PRG }, // 1 - { "248jaa04.10e", 0x040000, 0x56cb16cb, BRF_ESS | BRF_PRG }, // 2 - { "248jaa05.10g", 0x040000, 0x27614fcd, BRF_ESS | BRF_PRG }, // 3 - - { "248a01.2f", 0x010000, 0xa8a41cc6, BRF_ESS | BRF_PRG }, // 4 Z80 Code - - { "248a12.16k", 0x080000, 0x62870987, BRF_GRA }, // 5 Tiles - { "248a11.12k", 0x080000, 0xfad2dbfd, BRF_GRA }, // 6 - - { "248a09.7l", 0x100000, 0xa176e205, BRF_GRA }, // 7 Sprites - { "248a07.3l", 0x100000, 0x9595589f, BRF_GRA }, // 8 - - { "248a06.1d", 0x200000, 0x0fba1def, BRF_SND }, // 9 K053260 Samples - - { "qgakumon.nv", 0x000080, 0x847bd238, BRF_OPT }, -}; - -STD_ROM_PICK(qgakumon) -STD_ROM_FN(qgakumon) - -static struct BurnRomInfo punkshotRomDesc[] = { - { "907-j02.i7", 0x020000, 0xdbb3a23b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "907-j03.i10", 0x020000, 0x2151d1ab, BRF_ESS | BRF_PRG }, // 1 - - { "907f01.e8", 0x008000, 0xf040c484, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "907d06.e23", 0x040000, 0xf5cc38f4, BRF_GRA }, // 3 Tiles - { "907d05.e22", 0x040000, 0xe25774c1, BRF_GRA }, // 4 - - { "907d07.k2", 0x100000, 0xb0fe4543, BRF_GRA }, // 5 Sprites - { "907d08.k7", 0x100000, 0xd5ac8d9d, BRF_GRA }, // 6 - - { "907d04.d3", 0x080000, 0x090feb5e, BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(punkshot) -STD_ROM_FN(punkshot) - -static struct BurnRomInfo punkshot2RomDesc[] = { - { "907m02.i7", 0x020000, 0x59e14575, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "907m03.i10", 0x020000, 0xadb14b1e, BRF_ESS | BRF_PRG }, // 1 - - { "907f01.e8", 0x008000, 0xf040c484, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "907d06.e23", 0x040000, 0xf5cc38f4, BRF_GRA }, // 3 Tiles - { "907d05.e22", 0x040000, 0xe25774c1, BRF_GRA }, // 4 - - { "907d07.k2", 0x100000, 0xb0fe4543, BRF_GRA }, // 5 Sprites - { "907d08.k7", 0x100000, 0xd5ac8d9d, BRF_GRA }, // 6 - - { "907d04.d3", 0x080000, 0x090feb5e, BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(punkshot2) -STD_ROM_FN(punkshot2) - -static struct BurnRomInfo punkshotjRomDesc[] = { - { "907z02.i7", 0x020000, 0x7a3a5c89, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "907z03.i10", 0x020000, 0x22a3d9d6, BRF_ESS | BRF_PRG }, // 1 - - { "907f01.e8", 0x008000, 0xf040c484, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "907d06.e23", 0x040000, 0xf5cc38f4, BRF_GRA }, // 3 Tiles - { "907d05.e22", 0x040000, 0xe25774c1, BRF_GRA }, // 4 - - { "907d07.k2", 0x100000, 0xb0fe4543, BRF_GRA }, // 5 Sprites - { "907d08.k7", 0x100000, 0xd5ac8d9d, BRF_GRA }, // 6 - - { "907d04.d3", 0x080000, 0x090feb5e, BRF_SND }, // 7 K053260 Samples -}; - -STD_ROM_PICK(punkshotj) -STD_ROM_FN(punkshotj) - -static INT32 TmntMemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x060000; - DrvZ80Rom = Next; Next += 0x008000; - DrvSoundRom = Next; Next += 0x020000; - DrvUPD7759CRom = Next; Next += 0x020000; - DrvTileRom = Next; Next += 0x100000; - DrvSpriteRom = Next; Next += 0x200000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x004000; - DrvZ80Ram = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x001000; - - RamEnd = Next; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - DrvTitleSample = (INT16*)Next; Next += 0x40000 * sizeof(INT16); - DrvTiles = Next; Next += 0x008000 * 8 * 8; - DrvSprites = Next; Next += 0x004000 * 16 * 16; - - MemEnd = Next; - - return 0; -} - -static INT32 MiaMemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x040000; - DrvZ80Rom = Next; Next += 0x008000; - DrvSoundRom = Next; Next += 0x020000; - DrvTileRom = Next; Next += 0x040000; - DrvSpriteRom = Next; Next += 0x100000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x008000; - DrvZ80Ram = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x001000; - - RamEnd = Next; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - DrvTiles = Next; Next += 0x002000 * 8 * 8; - DrvSprites = Next; Next += 0x002000 * 16 * 16; - - MemEnd = Next; - - return 0; -} - -static INT32 CuebrickMemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x020000; - DrvTileRom = Next; Next += 0x040000; - DrvSpriteRom = Next; Next += 0x040000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x008000; - DrvPaletteRam = Next; Next += 0x001000; - - RamEnd = Next; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - DrvTiles = Next; Next += 0x002000 * 8 * 8; - DrvSprites = Next; Next += 0x001000 * 16 * 16; - DrvNvRam = Next; Next += 0x400 * 0x20; - - MemEnd = Next; - - return 0; -} - -static INT32 BlswhstlMemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x080000; - DrvZ80Rom = Next; Next += 0x010000; - DrvSoundRom = Next; Next += 0x100000; - DrvTileRom = Next; Next += 0x100000; - DrvSpriteRom = Next; Next += 0x100000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x004000; - DrvZ80Ram = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x001000; - DrvSpriteRam = Next; Next += 0x004000; - - RamEnd = Next; - - DrvTiles = Next; Next += 0x008000 * 8 * 8; - DrvSprites = Next; Next += 0x002000 * 16 * 16; - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x00810 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 SsridersMemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x0c0000; - DrvZ80Rom = Next; Next += 0x010000; - DrvSoundRom = Next; Next += 0x100000; - DrvTileRom = Next; Next += 0x100000; - DrvSpriteRom = Next; Next += 0x200000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x004080; - DrvZ80Ram = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x001000; - DrvSpriteRam = Next; Next += 0x004000; - - RamEnd = Next; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x00810 * sizeof(UINT32); - DrvTiles = Next; Next += 0x008000 * 8 * 8; - DrvSprites = Next; Next += 0x004000 * 16 * 16; - - MemEnd = Next; - - return 0; -} - -static INT32 Tmnt2MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x100000; - DrvZ80Rom = Next; Next += 0x010000; - DrvSoundRom = Next; Next += 0x200000; - DrvTileRom = Next; Next += 0x100000; - DrvSpriteRom = Next; Next += 0x400000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x005080; - DrvZ80Ram = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x001000; - DrvSpriteRam = Next; Next += 0x004000; - - RamEnd = Next; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x00810 * sizeof(UINT32); - DrvTiles = Next; Next += 0x008000 * 8 * 8; - DrvSprites = Next; Next += 0x008000 * 16 * 16; - - MemEnd = Next; - - return 0; -} - -static INT32 Thndrx2MemIndex() -{ - UINT8 *Next; Next = Mem; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x004000; - DrvZ80Ram = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x001000; - - RamEnd = Next; - - Drv68KRom = Next; Next += 0x080000; - DrvZ80Rom = Next; Next += 0x010000; - DrvSoundRom = Next; Next += 0x080000; - DrvTileRom = Next; Next += 0x100000; - DrvSpriteRom = Next; Next += 0x100000; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x00810 * sizeof(UINT32); - DrvTiles = Next; Next += 0x008000 * 8 * 8; - DrvSprites = Next; Next += 0x002000 * 16 * 16; - - MemEnd = Next; - - return 0; -} - -static INT32 LgtnfghtMemIndex() -{ - UINT8 *Next; Next = Mem; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x004000; - DrvZ80Ram = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x001000; - DrvSpriteRam = Next; Next += 0x004000; - - RamEnd = Next; - - Drv68KRom = Next; Next += 0x080000; - DrvZ80Rom = Next; Next += 0x010000; - DrvSoundRom = Next; Next += 0x080000; - DrvTileRom = Next; Next += 0x100000; - DrvSpriteRom = Next; Next += 0x100000; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x00810 * sizeof(UINT32); - DrvTiles = Next; Next += 0x008000 * 8 * 8; - DrvSprites = Next; Next += 0x002000 * 16 * 16; - - MemEnd = Next; - - return 0; -} - -static INT32 PunkshotMemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x040000; - DrvZ80Rom = Next; Next += 0x010000; - DrvSoundRom = Next; Next += 0x080000; - DrvTileRom = Next; Next += 0x080000; - DrvSpriteRom = Next; Next += 0x200000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x004000; - DrvZ80Ram = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x001000; - - RamEnd = Next; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x00810 * sizeof(UINT32); - DrvTiles = Next; Next += 0x004000 * 8 * 8; - DrvSprites = Next; Next += 0x004000 * 16 * 16; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - bIrqEnable = 0; - DrvSoundLatch = 0; - TitleSoundLatch = 0; - PlayTitleSample = 0; - TitleSamplePos = 0; - PriorityFlag = 0; - - return 0; -} - -static INT32 TmntDoReset() -{ - INT32 nRet = DrvDoReset(); - - UPD7759Reset(); - - UPD7759StartWrite(0, 0); - UPD7759ResetWrite(0, 1); - - return nRet; -} - -static INT32 CuebrickDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - bIrqEnable = 0; - DrvNvRamBank = 0; - PriorityFlag = 0; - CuebrickSndIrqFire = 0; - - return 0; -} - -static INT32 BlswhstlDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - K053260Reset(0); - - KonamiICReset(); - - EEPROMReset(); - - if (EEPROMAvailable()) { - InitEEPROMCount = 0; - } else { - InitEEPROMCount = 10; - } - - BlswhstlTileRomBank = 0; - - K052109_irq_enabled = 0; - - return 0; -} - -static INT32 SsridersDoReset() -{ - static const UINT8 thndrx2_eeprom_data[128] = { // Enable stereo sound (Dink) - 0x00, 0x00, 0x40, 0xC0, 0x80, 0x20, 0x00, 0x0E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - }; - static const UINT8 thndrx2j_eeprom_data[128] = { // Enable stereo sound (Dink) - 0x00, 0x00, 0x40, 0xC0, 0x80, 0x20, 0x00, 0xD6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - }; - static const UINT8 thndrx2a_eeprom_data[128] = { // Enable stereo sound (Dink) - 0x00, 0x00, 0x40, 0xC0, 0x80, 0x20, 0x00, 0x2E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - }; - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - K053260Reset(0); - - KonamiICReset(); - - EEPROMReset(); - - if (EEPROMAvailable()) { - InitEEPROMCount = 0; - } else { - if (strncmp(BurnDrvGetTextA(DRV_NAME), "thndrx2j", 8) == 0) { - EEPROMFill(thndrx2j_eeprom_data, 0, 128); - } else - if (strncmp(BurnDrvGetTextA(DRV_NAME), "thndrx2a", 8) == 0) { - EEPROMFill(thndrx2a_eeprom_data, 0, 128); - } else - if (strncmp(BurnDrvGetTextA(DRV_NAME), "thndrx2", 7) == 0) { - EEPROMFill(thndrx2_eeprom_data, 0, 128); - } else { - InitEEPROMCount = 10; - } - } - - K052109_irq_enabled = 0; - DrvVBlank = 0; - - dim_c = 0; - dim_v = 0; - - return 0; -} - -static INT32 PunkshotDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - K053260Reset(0); - - KonamiICReset(); - - K052109_irq_enabled = 0; - DrvVBlank = 0; - - return 0; -} - -UINT8 __fastcall Tmnt68KReadByte(UINT32 a) -{ - K052109WordNoA12Read(0x100000) - K051937ByteRead(0x140000) - K051960ByteRead(0x140400) - - switch (a) { - case 0x0a0001: { - return 0xff - DrvInput[0]; - } - - case 0x0a0003: { - return 0xff - DrvInput[1]; - } - - case 0x0a0005: { - return 0xff - DrvInput[2]; - } - - case 0x0a0007: { - return 0xff - DrvInput[3]; - } - - case 0x0a0011: { - return DrvDip[0]; - } - - case 0x0a0013: { - return DrvDip[1]; - } - - case 0x0a0015: { - return 0xff - DrvInput[4]; - } - - case 0x0a0019: { - return DrvDip[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Tmnt68KWriteByte(UINT32 a, UINT8 d) -{ - K052109WordNoA12Write(0x100000) - K015937ByteWrite(0x140000) - K051960ByteWrite(0x140400) - - switch (a) { - case 0x0a0001: { - static INT32 Last; - if (Last == 0x08 && (d & 0x08) == 0) { - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - } - Last = d & 0x08; - - bIrqEnable = (d & 0x20) ? 1 : 0; - - K052109RMRDLine = d & 0x80; - return; - } - - case 0x0a0009: { - DrvSoundLatch = d; - return; - } - - case 0x0a0011: { - // watchdog write - return; - } - - case 0x0c0001: { - PriorityFlag = (d & 0x0c) >> 2; - return; - } - - case 0x10e801: { - // nop??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Tmnt68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Tmnt68KWriteWord(UINT32 a, UINT16 d) -{ - K051960WordWrite(0x140400) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Mia68KReadByte(UINT32 a) -{ - K052109WordNoA12Read(0x100000) - K051937ByteRead(0x140000) - K051960ByteRead(0x140400) - - switch (a) { - case 0x0a0001: { - return 0xff - DrvInput[0]; - } - - case 0x0a0003: { - return 0xff - DrvInput[1]; - } - - case 0x0a0005: { - return 0xff - DrvInput[2]; - } - - case 0x0a0011: { - return DrvDip[0]; - } - - case 0x0a0013: { - return DrvDip[1]; - } - - case 0x0a0019: { - return DrvDip[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Mia68KWriteByte(UINT32 a, UINT8 d) -{ - K052109WordNoA12Write(0x100000) - K015937ByteWrite(0x140000) - K051960ByteWrite(0x140400) - - switch (a) { - case 0x0a0001: { - static INT32 Last; - if (Last == 0x08 && (d & 0x08) == 0) { - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - } - Last = d & 0x08; - - bIrqEnable = (d & 0x20) ? 1 : 0; - - K052109RMRDLine = d & 0x80; - return; - } - - case 0x0a0009: { - DrvSoundLatch = d; - return; - } - - case 0x0a0011: { - // watchdog write - return; - } - - case 0x10e801: { - // nop??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Mia68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Mia68KWriteWord(UINT32 a, UINT16 d) -{ - K051960WordWrite(0x140400) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Cuebrick68KReadByte(UINT32 a) -{ - K052109WordNoA12Read(0x100000) - K051937ByteRead(0x140000) - K051960ByteRead(0x140400) - - if (a >= 0x0b0000 && a <= 0x0b03ff) { - return DrvNvRam[(a - 0x0b0000) + (DrvNvRamBank * 0x400)]; - } - - switch (a) { - case 0x0a0001: { - return 0xff - DrvInput[0]; - } - - case 0x0a0003: { - return 0xff - DrvInput[1]; - } - - case 0x0a0005: { - return 0xff - DrvInput[2]; - } - - case 0x0a0011: { - return DrvDip[1]; - } - - case 0x0a0013: { - return DrvDip[0]; - } - - case 0x0a0019: { - return DrvDip[2]; - } - - case 0x0c0000: - return 0xff; - - case 0x0c0002: { - return BurnYM2151ReadStatus(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Cuebrick68KWriteByte(UINT32 a, UINT8 d) -{ - K052109WordNoA12Write(0x100000) - K015937ByteWrite(0x140000) - K051960ByteWrite(0x140400) - - if (a >= 0x0b0000 && a <= 0x0b03ff) { - DrvNvRam[(a - 0x0b0000) + (DrvNvRamBank * 0x400)] = d; - return; - } - - switch (a) { - case 0x0a0001: { - bIrqEnable = (d & 0x20) ? 1 : 0; - - K052109RMRDLine = d & 0x80; - return; - } - - case 0x0a0011: { - // watchdog write - return; - } - - case 0x0b0400: { - DrvNvRamBank = d; - return; - } - - case 0x0c0000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x0c0002: { - BurnYM2151WriteRegister(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Cuebrick68KReadWord(UINT32 a) -{ - if (a >= 0x0b0000 && a <= 0x0b03ff) { - SEK_DEF_READ_WORD(0, a); - return 0; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Cuebrick68KWriteWord(UINT32 a, UINT16 d) -{ - K051960WordWrite(0x140400) - - if (a >= 0x0b0000 && a <= 0x0b03ff) { - SEK_DEF_WRITE_WORD(0, a, d); - return; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Blswhstl68KReadByte(UINT32 a) -{ - if (a >= 0x180000 && a <= 0x183fff) { - INT32 Offset = (a - 0x180000) >> 1; - - if (a & 1) { - return K052109Read(Offset + 0x2000); - } else { - return K052109Read(Offset + 0x0000); - } - } - - if (a >= 0x300000 && a <= 0x303fff) { - INT32 Offset = (a - 0x300000); - - if (Offset & (0x31 << 1)) { - return DrvSpriteRam[Offset ^ 1]; - } else { - Offset = ((Offset & (0x000e << 1)) >> 1) | ((Offset & (0x1fc0 << 1)) >> 3); - return K053245ReadWord(0, Offset/2) >> ((~a & 1) << 3); - } - } - - if (a >= 0x500000 && a <= 0x50003f) { - INT32 Offset = (a - 0x500000) >> 1; - if (a & 1) { - return K054000Read(Offset); - } else { - return 0; - } - } - - if (a >= 0x680000 && a <= 0x68001f) { - INT32 Offset = (a - 0x680000) >> 1; - Offset &= ~1; - - if (a & 1) { - return K053244Read(0, Offset + 1); - } else { - return K053244Read(0, Offset + 0); - } - } - - switch (a) { - case 0x700001: { - return 0xff - DrvInput[1]; - } - - case 0x700003: { - return 0xff - DrvInput[2]; - } - - case 0x700005: { - UINT8 Res; - static INT32 Toggle; - - Res = 0xff - DrvInput[0]; - - if (InitEEPROMCount) { - InitEEPROMCount--; - Res &= 0xf7; - } - - Toggle ^= 0x40; - - return Res ^ Toggle; - } - - case 0x700007: { - return 0xfe | (EEPROMRead() & 0x01); - } - - case 0x780601: - case 0x780603: { - INT32 Offset = (a - 0x780601) >> 1; - return K053260Read(0, Offset + 2); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Blswhstl68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x180000 && a <= 0x183fff) { - INT32 Offset = (a - 0x180000) >> 1; - - if (a & 1) { - K052109Write(Offset + 0x2000, d); - } else { - K052109Write(Offset + 0x0000, d); - } - return; - } - - if (a >= 0x300000 && a <= 0x303fff) { - INT32 Offset = (a - 0x300000); - DrvSpriteRam[Offset ^ 1] = d; - - if (!(Offset & (0x31 << 1))) { - Offset = ((Offset & (0x000e << 1)) >> 1) | ((Offset & (0x1fc0 << 1)) >> 3); - - INT32 data = K053245ReadWord(0, Offset/2); - - if (a & 1) { - data &= 0xff00; - data |= d; - } else { - data &= 0x00ff; - data |= d << 8; - } - - K053245WriteWord(0, Offset / 2, data); - } - return; - } - - if (a >= 0x500000 && a <= 0x50003f) { - INT32 Offset = (a - 0x500000) >> 1; - if (a & 1) K054000Write(Offset, d); - return; - } - - if (a >= 0x680000 && a <= 0x68001f) { - INT32 Offset = (a - 0x680000) >> 1; - Offset &= ~1; - - if (a & 1) { - K053244Write(0, Offset + 1, d); - } else { - K053244Write(0, Offset + 0, d); - } - return; - } - - if (a >= 0x780700 && a <= 0x78071f) { - K053251Write((a - 0x780700) >> 1, d); - return; - } - - switch (a) { - case 0x700201: { - EEPROMWrite(d & 0x04, d & 0x02, d & 0x01); - return; - } - - case 0x700301: { - K052109RMRDLine = d & 0x08; - BlswhstlTileRomBank = (d & 0x80) >> 7; - return; - } - - case 0x700401: { - // watchdog write - return; - } - - case 0x780601: { - K053260Write(0, 0, d); - return; - } - - case 0x780605: { - ZetOpen(0); - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Blswhstl68KReadWord(UINT32 a) -{ - if (a >= 0x300000 && a <= 0x303fff) { - UINT16 *SpriteRam = (UINT16*)DrvSpriteRam; - INT32 Offset = (a - 0x300000) >> 1; - - if (Offset & 0x31) { - return BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset]); - } else { - Offset = ((Offset & 0x000e) >> 1) | ((Offset & 0x1fc0) >> 3); - return K053245ReadWord(0, Offset); - } - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Blswhstl68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x180000 && a <= 0x183fff) { - INT32 Offset = (a - 0x180000) >> 1; - - K052109Write(Offset + 0x2000, d >> 8); - K052109Write(Offset + 0x0000, d & 0xff); - return; - } - - if (a >= 0x300000 && a <= 0x303fff) { - UINT16 *SpriteRam = (UINT16*)DrvSpriteRam; - INT32 Offset = (a - 0x300000) >> 1; - SpriteRam[Offset] = BURN_ENDIAN_SWAP_INT16(d); - - if (!(Offset & 0x0031)) { - Offset = ((Offset & 0x000e) >> 1) | ((Offset & 0x1fc0) >> 3); - K053245WriteWord(0, Offset, d); - } - return; - } - - if (a >= 0x500000 && a <= 0x50003f) { - INT32 Offset = (a - 0x500000) >> 1; - K054000Write(Offset, d & 0xff); - return; - } - - if (a >= 0x680000 && a <= 0x68001f) { - INT32 Offset = (a - 0x680000) >> 1; - Offset &= ~1; - - K053244Write(0, Offset + 1, d & 0xff); - K053244Write(0, Offset + 0, d >> 8); - return; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -#ifdef _XBOX1 -#define pow powf -#endif - -static void tmnt2_protection_write() -{ - UINT32 src_addr, dst_addr, mod_addr, attr1, code, attr2, cbase, cmod, color; - INT32 xoffs, yoffs, xmod, ymod, zmod, xzoom, yzoom, i; - UINT16 *mcu; - UINT16 src[4], mod[24]; - UINT8 keepaspect, xlock, ylock, zlock; - - mcu = (UINT16*)(Drv68KRam + 0x4800); - if ((BURN_ENDIAN_SWAP_INT16(mcu[8]) & 0xff00) != 0x8200) return; - - src_addr = (BURN_ENDIAN_SWAP_INT16(mcu[0]) | (BURN_ENDIAN_SWAP_INT16(mcu[1])&0xff)<<16) >> 1; - dst_addr = (BURN_ENDIAN_SWAP_INT16(mcu[2]) | (BURN_ENDIAN_SWAP_INT16(mcu[3])&0xff)<<16) >> 1; - mod_addr = (BURN_ENDIAN_SWAP_INT16(mcu[4]) | (BURN_ENDIAN_SWAP_INT16(mcu[5])&0xff)<<16) >> 1; - zlock = (BURN_ENDIAN_SWAP_INT16(mcu[8]) & 0xff) == 0x0001; - - for (i=0; i< 4; i++) src[i] = SekReadWord((src_addr + i) * 2); - for (i=0; i<24; i++) mod[i] = SekReadWord((mod_addr + i) * 2); - - code = src[0]; // code - - i= src[1]; - attr1 = i>>2 & 0x3f00; // flip y, flip x and sprite size - attr2 = i & 0x380; // mirror y, mirror x, shadow - cbase = i & 0x01f; // base color - cmod = mod[0x2a/2]>>8; - color = (cbase != 0x0f && cmod <= 0x1f && !zlock) ? cmod : cbase; - - xoffs = (INT16)src[2]; // local x - yoffs = (INT16)src[3]; // local y - - i = mod[0]; - attr2 |= i & 0x0060; // priority - keepaspect = (i & 0x0014) == 0x0014; - if (i & 0x8000) { attr1 |= 0x8000; } // active - if (keepaspect) { attr1 |= 0x4000; } // keep aspect - if (i & 0x4000) { attr1 ^= 0x1000; xoffs = -xoffs; } // flip x - - xmod = (INT16)mod[6]; // global x - ymod = (INT16)mod[7]; // global y - zmod = (INT16)mod[8]; // global z - xzoom = mod[0x1c/2]; - yzoom = (keepaspect) ? xzoom : mod[0x1e/2]; - - ylock = xlock = (i & 0x0020 && (!xzoom || xzoom == 0x100)); - - if (!xlock) - { - i = xzoom - 0x4f00; - if (i > 0) - { - i >>= 8; - xoffs += (INT32)(pow(i, /*1.898461*/1.891292) * xoffs / 599.250121); - } - else if (i < 0) - { - i = (i>>3) + (i>>4) + (i>>5) + (i>>6) + xzoom; - xoffs = (i > 0) ? (xoffs * i / 0x4f00) : 0; - } - } - if (!ylock) - { - i = yzoom - 0x4f00; - if (i > 0) - { - i >>= 8; - yoffs += (INT32)(pow(i, /*1.898461*/1.891292) * yoffs / 599.250121); - } - else if (i < 0) - { - i = (i>>3) + (i>>4) + (i>>5) + (i>>6) + yzoom; - yoffs = (i > 0) ? (yoffs * i / 0x4f00) : 0; - } - - } - if (!zlock) yoffs += zmod; - xoffs += xmod; - yoffs += ymod; - - SekWriteWord((dst_addr + 0) * 2, attr1); - SekWriteWord((dst_addr + 2) * 2, code); - SekWriteWord((dst_addr + 4) * 2, (UINT32)yoffs); - SekWriteWord((dst_addr + 6) * 2, (UINT32)xoffs); - SekWriteWord((dst_addr + 12) * 2, attr2 | color); -} - -void __fastcall Tmnt268KProtWord(UINT32 a, UINT16 d) -{ - *((UINT16*)(Drv68KRam + 0x4800 + (a & 0x1e))) = BURN_ENDIAN_SWAP_INT16(d); -} - -void __fastcall Tmnt268KProtByte(UINT32 a, UINT8 d) -{ - a &= 0x1f; - Drv68KRam[0x4801 ^ a] = d; - - if (a == 0x18) tmnt2_protection_write(); -} - -static UINT16 ssriders_protection_r() -{ - INT32 data = SekReadWord(0x105a0a); - INT32 cmd = SekReadWord(0x1058fc); - - switch (cmd) - { - case 0x100b: - return 0x0064; - - case 0x6003: - return data & 0x000f; - - case 0x6004: - return data & 0x001f; - - case 0x6000: - return data & 0x0001; - - case 0x0000: - return data & 0x00ff; - - case 0x6007: - return data & 0x00ff; - - case 0x8abc: - /* collision table */ - data = -SekReadWord(0x105818); - data = ((data / 8 - 4) & 0x1f) * 0x40; - data += ((SekReadWord(0x105cb0) + SekReadWord(0x1040c8) - 6) / 8 + 12) & 0x3f; - return data; - - default: - return 0xffff; - } -} - -static void ssriders_protection_w(INT32 offset) -{ - offset >>= 1; - - if (offset == 1) - { - INT32 logical_pri,hardware_pri; - - /* create sprite priority attributes */ - hardware_pri = 1; - for (logical_pri = 1;logical_pri < 0x100;logical_pri <<= 1) - { - INT32 i; - - for (i = 0;i < 128;i++) - { - if ((SekReadWord(0x180006 + 128*i) >> 8) == (UINT16)logical_pri) - { - K053245Write(0,((8*i) * 2)+1,hardware_pri); - hardware_pri++; - } - } - } - } -} - -UINT8 __fastcall Ssriders68KReadByte(UINT32 a) -{ - if (a >= 0x180000 && a <= 0x183fff) { - INT32 Offset = (a - 0x180000); - - if (Offset & (0x31 << 1)) { - return DrvSpriteRam[Offset ^ 1]; - } else { - Offset = ((Offset & (0x000e << 1)) >> 1) | ((Offset & (0x1fc0 << 1)) >> 3); - return K053245ReadWord(0, Offset / 2) >> ((~a & 1) << 3); - } - } - - if ((a & 0xffff80) == 0x1c0500) { - return Drv68KRam[0x4001 ^ (a & 0x7f)]; - } - - if (a >= 0x5a0000 && a <= 0x5a001f) { - INT32 Offset = (a - 0x5a0000) >> 1; - Offset &= ~1; - - if (a & 1) { - return K053244Read(0, Offset + 1); - } else { - return K053244Read(0, Offset + 0); - } - } - - if (a >= 0x600000 && a <= 0x603fff) { - INT32 Offset = (a - 0x600000) >> 1; - - if (a & 1) { - return K052109Read(Offset + 0x2000); - } else { - return K052109Read(Offset + 0x0000); - } - } - - switch (a) { - case 0x1c0800: - case 0x1c0801: - return ssriders_protection_r() >> ((~a & 1) << 3); - - case 0x1c0001: { - return 0xff - DrvInput[1]; - } - - case 0x1c0003: { - return 0xff - DrvInput[2]; - } - - case 0x1c0005: { - return 0xff - DrvInput[3]; - } - - case 0x1c0007: { - return 0xff - DrvInput[4]; - } - - case 0x1c0101: { - return 0xff - DrvInput[0]; - } - - case 0x1c0103: { - UINT8 Res; - static INT32 Toggle; - - Res = DrvInput[5]; - if (DrvVBlank) Res |= 0x08; - Res |= EEPROMRead() & 0x01; - - if (InitEEPROMCount) { - InitEEPROMCount--; - Res &= 0x7f; - } - - Toggle ^= 0x04; - - return Res ^ Toggle; - } - - case 0x1c0401: { - // watchdog read - return 0; - } - - case 0x5c0601: - case 0x5c0603: { - INT32 Offset = (a - 0x5c0601) >> 1; - return K053260Read(0, Offset + 2); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ssriders68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x180000 && a <= 0x183fff) { - INT32 Offset = (a - 0x180000); - DrvSpriteRam[Offset ^ 1] = d; - - if (!(Offset & (0x31 << 1))) { - Offset = ((Offset & (0x000e << 1)) >> 1) | ((Offset & (0x1fc0 << 1)) >> 3); - - INT32 data = K053245ReadWord(0, Offset/2); - - if (a & 1) { - data &= 0xff00; - data |= d; - } else { - data &= 0x00ff; - data |= d << 8; - } - - K053245WriteWord(0, Offset/2, data); - - } - return; - } - - if ((a & ~3) == 0x1c0800) { - bprintf (0, _T("protection write byte %x %x\n"), a, d); - return; - } - - // extra ram for tmnt2 - if ((a & 0xffff80) == 0x1c0500) { - Drv68KRam[0x4001 ^ (a & 0x7f)] = d; - //*((UINT16*)(Drv68KRam + 0x4000 + (a & 0x7e))) = d; - return; - } - - if (a >= 0x5a0000 && a <= 0x5a001f) { - INT32 Offset = (a - 0x5a0000) >> 1; - Offset &= ~1; - - K053244Write(0, Offset + (a&1), d); - return; - } - - if (a >= 0x5c0700 && a <= 0x5c071f) { - K053251Write((a - 0x5c0700) >> 1, d); - return; - } - - if (a >= 0x600000 && a <= 0x603fff) { - INT32 Offset = (a - 0x600000) >> 1; - - if (a & 1) { - K052109Write(Offset + 0x2000, d); - } else { - K052109Write(Offset + 0x0000, d); - } - return; - } - - switch (a) { - case 0x1c0201: { - EEPROMWrite(d & 0x04, d & 0x02, d & 0x01); - K053244BankSelect(0, ((d & 0x20) >> 5) << 2); - dim_c = d & 0x18; - return; - } - - case 0x1c0301: { - K052109RMRDLine = d & 0x08; - dim_v = (d & 0x70) >> 4; - return; - } - - case 0x5c0601: { - K053260Write(0, 0, d); - return; - } - - case 0x5c0605: { - ZetOpen(0); - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - - case 0x1c0401: { - // watchdog write - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Ssriders68KReadWord(UINT32 a) -{ - if (a >= 0x180000 && a <= 0x183fff) { - UINT16 *SpriteRam = (UINT16*)DrvSpriteRam; - INT32 Offset = (a - 0x180000) >> 1; - - if (Offset & 0x31) { - return BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset]); - } else { - Offset = ((Offset & 0x000e) >> 1) | ((Offset & 0x1fc0) >> 3); - return K053245ReadWord(0, Offset); - } - } - - if ((a & 0xffff80) == 0x1c0500) { - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(Drv68KRam + 0x4000 + (a & 0x7e)))); - } - - if (a == 0x1c0800) return ssriders_protection_r(); - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ssriders68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x180000 && a <= 0x183fff) { - UINT16 *SpriteRam = (UINT16*)DrvSpriteRam; - INT32 Offset = (a - 0x180000) >> 1; - SpriteRam[Offset] = BURN_ENDIAN_SWAP_INT16(d); - - if (!(Offset & 0x0031)) { - Offset = ((Offset & 0x000e) >> 1) | ((Offset & 0x1fc0) >> 3); - K053245WriteWord(0, Offset, d); - } - return; - } - - if (a >= 0x5a0000 && a <= 0x5a001f) { - INT32 Offset = (a - 0x5a0000) >> 1; - Offset &= ~1; - - K053244Write(0, Offset + 1, d & 0xff); - K053244Write(0, Offset + 0, d >> 8); - return; - } - - if ((a & 0xffff80) == 0x1c0500) { - *((UINT16*)(Drv68KRam + 0x4000 + (a & 0x7e))) = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - if (a == 0x1c0802) { - ssriders_protection_w(2); - return; - } - - switch (a) { - case 0x1c0800: - case 0x1c0802: { - ssriders_protection_w(a - 0x1c0800); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Thndrx268KReadByte(UINT32 a) -{ - K052109WordNoA12Read(0x600000) - K051937ByteRead(0x700000) - - if ((a & 0xffffc00) == 0x700400) { - return K051960Read(a & 0x3ff); - } - - if (a >= 0x500000 && a <= 0x50003f) { - INT32 Offset = (a - 0x500000) >> 1; - if (a & 1) { - return K054000Read(Offset); - } else { - return 0; - } - } - - switch (a) - { - case 0x400001: - case 0x400003: - return K053260Read(0, ((a & 2) >> 1) + 2); - - case 0x500200: - { - INT32 ret = DrvInput[1]^0xff; - if (InitEEPROMCount) { - ret &= 0xf7; - InitEEPROMCount--; - } - return ret; - } - - case 0x500201: - return DrvInput[0]^0xff; - - case 0x500202: - { - static INT32 toggle; - toggle ^= 0x08; - INT32 ret = 0xfe; - ret |= (EEPROMRead() & 1); - ret ^= toggle; - - return ret; - } - - case 0x500203: - return DrvInput[2]^0xff; - } - - - return 0; -} - -void __fastcall Thndrx268KWriteWord(UINT32 a, UINT16 d) -{ - if ((a & 0xffffc00) == 0x700400) { - K051960Write((a & 0x3fe) | 0, d >> 8); - K051960Write((a & 0x3fe) | 1, d & 0xff); - return; - } -} - -void __fastcall Thndrx268KWriteByte(UINT32 a, UINT8 d) -{ - K052109WordNoA12Write(0x600000) - K015937ByteWrite(0x700000) - - if ((a & 0xffffc00) == 0x700400) { - K051960Write(a & 0x3ff, d); - return; - } - - if (a >= 0x300000 && a <= 0x30001f) { - if (a & 1) K053251Write((a - 0x300000) >> 1, d); - return; - } - - if (a >= 0x500000 && a <= 0x50003f) { - INT32 Offset = (a - 0x500000) >> 1; - if (a & 1) K054000Write(Offset, d); - return; - } - - switch (a) - { - case 0x400001: - K053260Write(0, 0, d); - return; - - case 0x500101: - { - EEPROMWriteBit(d & 0x01); - EEPROMSetCSLine((d & 0x02) ? EEPROM_CLEAR_LINE : EEPROM_ASSERT_LINE); - EEPROMSetClockLine((d & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE); - - // EEPROMWrite(d & 0x04, d & 0x02, d & 0x01); - - static INT32 last; - if (last == 0 && (d & 0x20) != 0) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - last = d & 0x20; - - K052109RMRDLine = d & 0x40; - } - return; - } -} - -UINT16 __fastcall Lgtnfght68KReadWord(UINT32 a) -{ - if (a >= 0xb0000 && a <= 0xb3fff) { - UINT16 *SpriteRam = (UINT16*)DrvSpriteRam; - INT32 Offset = (a - 0xb0000) >> 1; - - if (Offset & 0x31) { - return BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset]); - } else { - Offset = ((Offset & 0x000e) >> 1) | ((Offset & 0x1fc0) >> 3); - return K053245ReadWord(0, Offset); - } - } - - return 0; -} - -UINT8 __fastcall Lgtnfght68KReadByte(UINT32 a) -{ - K052109WordNoA12Read(0x100000) - - if (a >= 0xb0000 && a <= 0xb3fff) { - INT32 Offset = (a - 0xb0000); - - if (Offset & (0x31 << 1)) { - return DrvSpriteRam[Offset ^ 1]; - } else { - Offset = ((Offset & (0x000e << 1)) >> 1) | ((Offset & (0x1fc0 << 1)) >> 3); - return K053245ReadWord(0, Offset / 2) >> ((~a & 1) << 3); - } - } - - if (a >= 0xc0000 && a <= 0xc001f) { - INT32 Offset = (a - 0xc0000) >> 1; - Offset &= ~1; - - if (a & 1) { - return K053244Read(0, Offset + 1); - } else { - return K053244Read(0, Offset + 0); - } - } - - switch (a) - { - case 0x0a0001: - return ~DrvInput[0] & 0xfb; - - case 0x0a0003: - return ~DrvInput[1]; - - case 0x0a0005: - return ~DrvInput[2]; - - case 0x0a0007: - return DrvDip[0]; - - case 0x0a0009: - return DrvDip[1]; - - case 0x0a0011: - return DrvDip[2]; - - case 0x0a0021: - case 0x0a0023: - return K053260Read(0, ((a & 2) >> 1) + 2); // k053260 - } - - return 0; -} - -void __fastcall Lgtnfght68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0xb0000 && a <= 0xb3fff) { - UINT16 *SpriteRam = (UINT16*)DrvSpriteRam; - INT32 Offset = (a - 0xb0000) >> 1; - SpriteRam[Offset] = BURN_ENDIAN_SWAP_INT16(d); - - if (!(Offset & 0x0031)) { - Offset = ((Offset & 0x000e) >> 1) | ((Offset & 0x1fc0) >> 3); - K053245WriteWord(0, Offset, d); - } - return; - } -} - -void __fastcall Lgtnfght68KWriteByte(UINT32 a, UINT8 d) -{ - K052109WordNoA12Write(0x100000) - - if (a >= 0x0e0000 && a <= 0x0e001f) { - K053251Write((a - 0x0e0000) >> 1, d); - return; - } - - if (a >= 0xb0000 && a <= 0xb3fff) { - INT32 Offset = (a - 0xb0000); - DrvSpriteRam[Offset ^ 1] = d; - - if (!(Offset & (0x31 << 1))) { - Offset = ((Offset & (0x000e << 1)) >> 1) | ((Offset & (0x1fc0 << 1)) >> 3); - - INT32 data = K053245ReadWord(0, Offset/2); - - if (a & 1) { - data &= 0xff00; - data |= d; - } else { - data &= 0x00ff; - data |= d << 8; - } - - K053245WriteWord(0, Offset/2, data); - - } - return; - } - - if (a >= 0xc0000 && a <= 0xc001f) { - INT32 Offset = (a - 0xc0000) >> 1; - Offset &= ~1; - - K053244Write(0, Offset + (a&1), d); - return; - } - - switch (a) - { - case 0xa0019: - { - static INT32 last; - if (last == 0 && (d & 0x4) != 0) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - last = d & 0x4; - - K052109RMRDLine = d & 0x8; - } - return; - - case 0xa0021: - K053260Write(0, 0, d); - return; - - case 0xa0029: // watchdog - return; - } -} - -UINT16 __fastcall Punkshot68KReadWord(UINT32 a) -{ - if ((a & 0xfffc00) == 0x110400) { - return K051960Read((a & 0x3fe) | 1) | (K051960Read((a & 0x3fe) | 0) << 8); - } - - return 0; -} - -UINT8 __fastcall Punkshot68KReadByte(UINT32 a) -{ - K052109WordNoA12Read(0x100000) - K051937ByteRead(0x110000) - K051960ByteRead(0x110400) - - switch (a) - { - case 0x0a0000: - return DrvDip[1]; - - case 0x0a0001: - return DrvDip[0]; - - case 0x0a0003: - return ~DrvInput[0]; - - case 0x0a0002: - return DrvDip[2] | (~DrvInput[5] & 0x0f); - - case 0x0a0005: - return ~DrvInput[3]; - - case 0x0a0004: - return ~DrvInput[4]; - - case 0x0a0007: - return ~DrvInput[1]; - - case 0x0a0006: - return ~DrvInput[2]; - - case 0x0a0041: - case 0x0a0043: - return K053260Read(0, ((a & 2) >> 1) | 2); - - case 0xfffffc: - case 0xfffffd: - case 0xfffffe: - case 0xffffff: - return BurnRandom(); - } - - return 0; -} - -void __fastcall Punkshot68KWriteWord(UINT32 a, UINT16 d) -{ - if ((a & 0xfffc00) == 0x110400) { - K051960Write((a & 0x3fe) | 0, d >> 8); - K051960Write((a & 0x3fe) | 1, d & 0xff); - - return; - } - - if ((a & 0xff8000) == 0x100000) { - SekWriteByte(a+1, d & 0xff); - return; - } -} - -void __fastcall Punkshot68KWriteByte(UINT32 a, UINT8 d) -{ - K052109WordNoA12Write(0x100000) - K015937ByteWrite(0x110000) - K051960ByteWrite(0x110400) - - if ((a & 0xffffe1) == 0xa0061) { - K053251Write((a & 0x1f) >> 1, d); - return; - } - - switch (a) - { - case 0x0a0020: - case 0x0a0021: - { - static INT32 last; - K052109RMRDLine = d & 0x08; - - if (last == 0x04 && (d & 0x04) == 0x00) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - - last = d & 0x04; - } - return; - - case 0x0a0041: - K053260Write(0, 0, d); - return; - - case 0x0a0081: - // watchdog - return; - } -} - -UINT8 __fastcall TmntZ80Read(UINT16 a) -{ - if (a >= 0xb000 && a <= 0xb00d) { - return K007232ReadReg(0, a - 0xb000); - } - - switch (a) { - case 0x9000: { - return TitleSoundLatch; - } - - case 0xa000: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return DrvSoundLatch; - } - - case 0xc001: { - return BurnYM2151ReadStatus(); - } - - case 0xf000: { - return UPD7759BusyRead(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall TmntZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0xb000 && a <= 0xb00d) { - K007232WriteReg(0, (a - 0xb000), d); - return; - } - - switch (a) { - case 0x9000: { - TitleSoundLatch = d; - if (d & 0x04) { - PlayTitleSample = 1; - } else { - PlayTitleSample = 0; - TitleSamplePos = 0; - } - - UPD7759ResetWrite(0, d & 2); - return; - } - - case 0xc000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xc001: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xd000: { - UPD7759PortWrite(0, d); - return; - } - - case 0xe000: { - UPD7759StartWrite(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall MiaZ80Read(UINT16 a) -{ - if (a >= 0xb000 && a <= 0xb00d) { - return K007232ReadReg(0, a - 0xb000); - } - - switch (a) { - case 0xa000: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return DrvSoundLatch; - } - - case 0xc001: { - return BurnYM2151ReadStatus(); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall MiaZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0xb000 && a <= 0xb00d) { - K007232WriteReg(0, (a - 0xb000), d); - return; - } - - switch (a) { - case 0xc000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xc001: { - BurnYM2151WriteRegister(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall BlswhstlZ80Read(UINT16 a) -{ - if (a >= 0xfa00 && a <= 0xfa2f) { - if (a == 0xfa00) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return K053260Read(0, a - 0xfa00); - } - - switch (a) { - case 0xf801: { - return BurnYM2151ReadStatus(); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall BlswhstlZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0xfa00 && a <= 0xfa2f) { - K053260Write(0, (a - 0xfa00), d); - return; - } - - switch (a) { - case 0xf800: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xf801: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xfc00: { // tmnt2 needs this - ZetRun(100); - ZetNmi(); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall Thndrx2Z80Write(UINT16 a, UINT8 d) -{ - if (a >= 0xfc00 && a <= 0xfc2f) { - K053260Write(0, (a - 0xfc00), d); - return; - } - - switch (a) - { - case 0xf800: - case 0xf810: - BurnYM2151SelectRegister(d); - return; - - case 0xf801: - case 0xf811: - BurnYM2151WriteRegister(d); - return; - - case 0xfa00: - ZetRun(100); - ZetNmi(); - return; - } -} - -UINT8 __fastcall Thndrx2Z80Read(UINT16 a) -{ - if (a >= 0xfc00 && a <= 0xfc2f) { - if (a == 0xfc00) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return K053260Read(0, a - 0xfc00); - } - - switch (a) - { - case 0xf801: - case 0xf811: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -void __fastcall LgtnfghtZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0xc000 && a <= 0xc02f) { - K053260Write(0, (a - 0xc000), d); - return; - } - - switch (a) - { - case 0xa000: - BurnYM2151SelectRegister(d); - return; - - case 0xa001: - BurnYM2151WriteRegister(d); - return; - } -} - -UINT8 __fastcall LgtnfghtZ80Read(UINT16 a) -{ - if (a >= 0xc000 && a <= 0xc02f) { - if (a == 0xc000) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return K053260Read(0, a - 0xc000); - } - - switch (a) - { - case 0xa001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void shuffle(UINT16 *buf, INT32 len) -{ - INT32 i; - UINT16 t; - - if (len == 2) return; - - if (len % 4) return; - - len /= 2; - - for (i = 0;i < len/2;i++) { - t = buf[len/2 + i]; - buf[len/2 + i] = buf[len + i]; - buf[len + i] = t; - } - - shuffle(buf,len); - shuffle(buf + len,len); -} - -static void byte_shuffle(UINT8 *buf, INT32 len) -{ - INT32 i; - UINT8 t; - - if (len == 2) return; - - if (len % 4) return; - - len /= 2; - - for (i = 0;i < len/2;i++) { - t = buf[len/2 + i]; - buf[len/2 + i] = buf[len + i]; - buf[len + i] = t; - } - - byte_shuffle(buf,len); - byte_shuffle(buf + len,len); -} - -static void TmntUnscrambleGfx(UINT8 *pSrc, INT32 nLength) -{ - INT32 bits[32]; - for (INT32 i = 0; i < nLength; i += 4) { - for (INT32 j = 0; j < 4; j++) { - for (INT32 k = 0; k < 8; k++) { - bits[8*j + k] = (pSrc[i + j] >> k) & 1; - } - } - - for (INT32 j = 0; j < 4; j++) { - pSrc[i + j] = 0; - for (INT32 k = 0; k < 8; k++) { - pSrc[i + j] |= bits[j + 4*k] << k; - } - } - } -} - -static void TmntUnscrambleSprites() -{ - BurnLoadRom(DrvTempRom + 0x200000, 11, 1); - UINT8 *SpriteConvTable = DrvTempRom + 0x200000; - - memcpy(DrvTempRom, DrvSpriteRom, 0x200000); - - for (INT32 A = 0; A < 0x80000; A++) { - INT32 B, i, entry; - INT32 bits[10]; - - static const UINT8 bit_pick_table[10][8] = { - { 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 5, 5, 5, 5, 5, 5 }, - { 1, 1, 0, 0, 0, 7, 7, 7 }, - { 2, 2, 1, 1, 1, 0, 0, 9 }, - { 4, 4, 2, 2, 2, 1, 1, 0 }, - { 5, 6, 4, 4, 4, 2, 2, 1 }, - { 6, 5, 6, 6, 6, 4, 4, 2 }, - { 7, 7, 7, 7, 8, 6, 6, 4 }, - { 8, 8, 8, 8, 7, 8, 8, 6 }, - { 9, 9, 9, 9, 9, 9, 9, 8 } - }; - - entry = SpriteConvTable[(A & 0x7f800) >> 11] & 7; - - for (i = 0;i < 10;i++) - bits[i] = (A >> i) & 0x01; - - B = A & 0x7fc00; - - for (i = 0; i < 10;i++) B |= bits[bit_pick_table[i][entry]] << i; - - DrvSpriteRom[4*A+0] = DrvTempRom[4*B+0]; - DrvSpriteRom[4*A+1] = DrvTempRom[4*B+1]; - DrvSpriteRom[4*A+2] = DrvTempRom[4*B+2]; - DrvSpriteRom[4*A+3] = DrvTempRom[4*B+3]; - } -} - -static void MiaUnscrambleSprites() -{ - memcpy(DrvTempRom, DrvSpriteRom, 0x100000); - - for (INT32 A = 0; A < 0x40000; A++) { - INT32 B, i; - INT32 bits[8]; - for (i = 0; i < 8; i++) bits[i] = (A >> i) & 0x01; - - B = A & 0x3ff00; - - if ((A & 0x3c000) == 0x3c000) { - B |= bits[3] << 0; - B |= bits[5] << 1; - B |= bits[0] << 2; - B |= bits[1] << 3; - B |= bits[2] << 4; - B |= bits[4] << 5; - B |= bits[6] << 6; - B |= bits[7] << 7; - } else { - B |= bits[3] << 0; - B |= bits[5] << 1; - B |= bits[7] << 2; - B |= bits[0] << 3; - B |= bits[1] << 4; - B |= bits[2] << 5; - B |= bits[4] << 6; - B |= bits[6] << 7; - } - - DrvSpriteRom[4*A+0] = DrvTempRom[4*B+0]; - DrvSpriteRom[4*A+1] = DrvTempRom[4*B+1]; - DrvSpriteRom[4*A+2] = DrvTempRom[4*B+2]; - DrvSpriteRom[4*A+3] = DrvTempRom[4*B+3]; - } -} - -static void TmntDecodeTitleSample() -{ - for (INT32 i = 0; i < 0x40000; i++) { - INT32 val = DrvTempRom[2 * i + 0] + (DrvTempRom[(2 * i) + 1] << 8); - INT32 expo = val >> 13; - - val = (val >> 3) & (0x3ff); - val -= 0x200; - - val <<= (expo-3); - - DrvTitleSample[i] = val; - } -} - -static void TmntTitleSampleSetRoute(double nVolume, INT32 nRouteDir) -{ - TitleSampleGain = nVolume; - TitleSampleOutputDir = nRouteDir; -} - -static INT32 TilePlaneOffsets[4] = { 24, 16, 8, 0 }; -static INT32 TileXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 TileYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 SpritePlaneOffsets[4] = { 24, 16, 8, 0 }; -static INT32 SpritePlaneOffsets2[4] = { 0, 8, 16, 24 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 256, 257, 258, 259, 260, 261, 262, 263 }; -static INT32 SpriteYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; - -static void K052109TmntCallback(INT32 Layer, INT32 Bank, INT32 *Code, INT32 *Colour, INT32*, INT32 *) -{ - *Code |= ((*Colour & 0x03) << 8) | ((*Colour & 0x10) << 6) | ((*Colour & 0x0c) << 9) | (Bank << 13); - *Colour = LayerColourBase[Layer] + ((*Colour & 0xe0) >> 5); -} - -static void K052109MiaCallback(INT32 Layer, INT32 Bank, INT32 *Code, INT32 *Colour, INT32 *xFlip, INT32 *) -{ - *xFlip = *Colour & 0x04; - - if (Layer == 0) { - *Code |= ((*Colour & 0x01) << 8); - *Colour = LayerColourBase[Layer] + ((*Colour & 0x80) >> 5) + ((*Colour & 0x10) >> 1); - } else { - *Code |= ((*Colour & 0x01) << 8) | ((*Colour & 0x18) << 6) | (Bank << 11); - *Colour = LayerColourBase[Layer] + ((*Colour & 0xe0) >> 5); - } -} - -static void K052109CuebrickCallback(INT32 Layer, INT32, INT32 *Code, INT32 *Colour, INT32 *, INT32 *) -{ - if (K052109RMRDLine == 0 && Layer == 0) { - *Code |= ((*Colour & 0x01) << 8); - *Colour = LayerColourBase[Layer] + ((*Colour & 0x0e) >> 1); - - } else { - *Code |= ((*Colour & 0x0f) << 8); - *Colour = LayerColourBase[Layer] + ((*Colour & 0xe0) >> 5); - } -} - -static void K052109BlswhstlCallback(INT32 Layer, INT32 Bank, INT32 *Code, INT32 *Colour, INT32 *, INT32 *) -{ - *Code |= ((*Colour & 0x01) << 8) | ((*Colour & 0x10) << 5) | ((*Colour & 0x0c) << 8) | (Bank << 12) | (BlswhstlTileRomBank << 14); - *Colour = LayerColourBase[Layer] + ((*Colour & 0xe0) >> 5); -} - -static void K051960TmntCallback(INT32 *Code, INT32 *Colour, INT32*, INT32*) -{ - *Code |= (*Colour & 0x10) << 9; - *Colour = SpriteColourBase + (*Colour & 0x0f); -} - -static void K051960MiaCallback(INT32* /*Code*/, INT32 *Colour, INT32*, INT32*) -{ - *Colour = SpriteColourBase + (*Colour & 0x0f); -} - -static void K051960CuebrickCallback(INT32* Code, INT32 *Colour, INT32*, INT32*) -{ - *Colour = SpriteColourBase + (*Colour & 0x0f); - *Code &= 0xfff; -} - -static void K051960Thndrx2Callback(INT32* code, INT32 *color, INT32* priority, INT32*) -{ - INT32 pri = 0x20 | ((*color & 0x60) >> 2); - if (pri <= LayerPri[2]) *priority = 0x00; - else if (pri > LayerPri[2] && pri <= LayerPri[1]) *priority = 0xf0; - else if (pri > LayerPri[1] && pri <= LayerPri[0]) *priority = 0xfc; - else *priority = 0xfe; - - *code &= 0x1fff; - *color = SpriteColourBase + (*color & 0x0f); -} - -static void K051960PunkshotCallback(INT32 *code, INT32 *color, INT32 *priority, INT32 *) -{ - INT32 pri = 0x20 | ((*color & 0x60) >> 2); - if (pri <= LayerPri[2]) *priority = 0x00; - else if (pri > LayerPri[2] && pri <= LayerPri[1]) *priority = 0xf0; - else if (pri > LayerPri[1] && pri <= LayerPri[0]) *priority = 0xfc; - else *priority = 0xfe; - - *code |= (*color & 0x10) << 9; - *code &= 0x3fff; - *color = SpriteColourBase + (*color & 0x0f); -} - -static void K053245BlswhstlCallback(INT32 *Code, INT32 *Colour, INT32 *Priority) -{ - INT32 Pri = 0x20 | ((*Colour & 0x60) >> 2); - if (Pri <= LayerPri[2]) *Priority = 0x00; - else if (Pri > LayerPri[2] && Pri <= LayerPri[1]) *Priority = 0xf0; - else if (Pri > LayerPri[1] && Pri <= LayerPri[0]) *Priority = 0xfc; - else *Priority = 0xfe; - - *Code &= 0x1fff; - *Colour = SpriteColourBase + (*Colour & 0x1f); -} - -static void K053245SsridersCallback(INT32 *, INT32 *Colour, INT32 *Priority) -{ - INT32 Pri = 0x20 | ((*Colour & 0x60) >> 2); - if (Pri <= LayerPri[2]) *Priority = 0x00; - else if (Pri > LayerPri[2] && Pri <= LayerPri[1]) *Priority = 0xf0; - else if (Pri > LayerPri[1] && Pri <= LayerPri[0]) *Priority = 0xfc; - else *Priority = 0xfe; - - *Colour = SpriteColourBase + (*Colour & 0x1f); -} - -static void K053245LgtnfghtCallback(INT32 *code, INT32 *color, INT32 *priority) -{ - INT32 pri = 0x20 | ((*color & 0x60) >> 2); - if (pri <= LayerPri[2]) *priority = 0x00; - else if (pri > LayerPri[2] && pri <= LayerPri[1]) *priority = 0xf0; - else if (pri > LayerPri[1] && pri <= LayerPri[0]) *priority = 0xfc; - else *priority = 0xfe; - - *color = SpriteColourBase + (*color & 0x1f); - *code &= 0x3fff; -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -static void CuebrickYM2151IrqHandler(INT32 Irq) -{ - CuebrickSndIrqFire = Irq; -} - -static INT32 TmntInit() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - TmntMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - TmntMemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x0fffff); - K052109SetCallback(K052109TmntCallback); - K051960Init(DrvSpriteRom, DrvSprites, 0x1fffff); - K051960SetCallback(K051960TmntCallback); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x040001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x040000, 3, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x080000, 6, 1); if (nRet != 0) return 1; - shuffle((UINT16*)DrvTileRom, 0x080000); - TmntUnscrambleGfx(DrvTileRom, 0x100000); - GfxDecode(0x100000 / 32, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - DrvTempRom = (UINT8 *)BurnMalloc(0x200100); - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x080000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x100000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x180000, 10, 1); if (nRet != 0) return 1; - shuffle((UINT16*)DrvSpriteRom, 0x100000); - TmntUnscrambleGfx(DrvSpriteRom, 0x200000); - TmntUnscrambleSprites(); - - // Decode the sprites - GfxDecode(0x200000 / 128, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, DrvSpriteRom, DrvSprites); - - // Load K007232 Sample Roms - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 13, 1); if (nRet != 0) return 1; - - // Load UPD7759C Sample Roms - nRet = BurnLoadRom(DrvUPD7759CRom + 0x00000, 14, 1); if (nRet != 0) return 1; - - // Load title sample - memset(DrvTempRom, 0, 0x080000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 15, 1); if (nRet != 0) return 1; - TmntDecodeTitleSample(); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x060000, 0x063fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x080000, 0x080fff, MAP_RAM); - SekSetReadWordHandler(0, Tmnt68KReadWord); - SekSetWriteWordHandler(0, Tmnt68KWriteWord); - SekSetReadByteHandler(0, Tmnt68KReadByte); - SekSetWriteByteHandler(0, Tmnt68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(TmntZ80Read); - ZetSetWriteHandler(TmntZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - K007232Init(0, 3579545, DrvSoundRom, 0x20000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.33, BURN_SND_ROUTE_BOTH); - - UPD7759Init(0, UPD7759_STANDARD_CLOCK, DrvUPD7759CRom); - UPD7759SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - - TmntTitleSampleSetRoute(1.00, BURN_SND_ROUTE_BOTH); - - LayerColourBase[0] = 0; - LayerColourBase[1] = 32; - LayerColourBase[2] = 40; - SpriteColourBase = 16; - - // Reset the driver - TmntDoReset(); - - return 0; -} - -static INT32 MiaInit() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MiaMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MiaMemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x03ffff); - K052109SetCallback(K052109MiaCallback); - K051960Init(DrvSpriteRom, DrvSprites, 0x0fffff); - K051960SetCallback(K051960MiaCallback); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x000001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x020000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x020001, 6, 2); if (nRet != 0) return 1; - shuffle((UINT16*)DrvTileRom, 0x020000); - TmntUnscrambleGfx(DrvTileRom, 0x040000); - GfxDecode(0x2000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x080000, 8, 1); if (nRet != 0) return 1; - shuffle((UINT16*)DrvSpriteRom, 0x080000); - TmntUnscrambleGfx(DrvSpriteRom, 0x100000); - MiaUnscrambleSprites(); - - // Decode the sprites - GfxDecode(0x2000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, DrvSpriteRom, DrvSprites); - - // Load K007232 Sample Roms - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 10, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRam + 0x0000 , 0x040000, 0x043fff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x4000 , 0x060000, 0x063fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x080000, 0x080fff, MAP_RAM); - SekSetReadWordHandler(0, Mia68KReadWord); - SekSetWriteWordHandler(0, Mia68KWriteWord); - SekSetReadByteHandler(0, Mia68KReadByte); - SekSetWriteByteHandler(0, Mia68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(MiaZ80Read); - ZetSetWriteHandler(MiaZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - K007232Init(0, 3579545, DrvSoundRom, 0x20000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - LayerColourBase[0] = 0; - LayerColourBase[1] = 32; - LayerColourBase[2] = 40; - SpriteColourBase = 16; - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 CuebrickInit() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - CuebrickMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - CuebrickMemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x03ffff); - K052109SetCallback(K052109CuebrickCallback); - - K051960Init(DrvSpriteRom, DrvSprites, 0x03ffff); - K051960SetCallback(K051960CuebrickCallback); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x000001, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x020000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x020001, 5, 2); if (nRet != 0) return 1; - byte_shuffle(DrvTileRom, 0x040000); - GfxDecode(0x2000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x000001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x020000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x020001, 9, 2); if (nRet != 0) return 1; - byte_shuffle(DrvSpriteRom, 0x040000); - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, DrvSpriteRom, DrvSprites); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Drv68KRam + 0x0000 , 0x040000, 0x043fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x080000, 0x080fff, MAP_RAM); - SekSetReadWordHandler(0, Cuebrick68KReadWord); - SekSetWriteWordHandler(0, Cuebrick68KWriteWord); - SekSetReadByteHandler(0, Cuebrick68KReadByte); - SekSetWriteByteHandler(0, Cuebrick68KWriteByte); - SekClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&CuebrickYM2151IrqHandler); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - LayerColourBase[0] = 0; - LayerColourBase[1] = 32; - LayerColourBase[2] = 40; - SpriteColourBase = 16; - - // Reset the driver - CuebrickDoReset(); - - return 0; -} - -static INT32 BlswhstlInit() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - BlswhstlMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - BlswhstlMemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x0fffff); - K052109SetCallback(K052109BlswhstlCallback); - K052109AdjustScroll(8, 0); - - K053245Init(0, DrvSpriteRom, DrvSprites, 0xfffff, K053245BlswhstlCallback); - K053245SetSpriteOffset(0, -112, 16); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x040001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x040000, 3, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x080000, 6, 1); if (nRet != 0) return 1; - BurnByteswap(DrvTileRom, 0x100000); - konami_rom_deinterleave_2(DrvTileRom, 0x100000); - GfxDecode(0x8000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x080000, 8, 1); if (nRet != 0) return 1; - BurnByteswap(DrvSpriteRom, 0x100000); - konami_rom_deinterleave_2(DrvSpriteRom, 0x100000); - K053245GfxDecode(DrvSpriteRom, DrvSprites, 0x100000); - - // Load K053260 Sample Roms - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x204000, 0x207fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x400000, 0x400fff, MAP_RAM); - SekSetReadWordHandler(0, Blswhstl68KReadWord); - SekSetWriteWordHandler(0, Blswhstl68KWriteWord); - SekSetReadByteHandler(0, Blswhstl68KReadByte); - SekSetWriteByteHandler(0, Blswhstl68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(BlswhstlZ80Read); - ZetSetWriteHandler(BlswhstlZ80Write); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80Rom ); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.70, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.70, BURN_SND_ROUTE_RIGHT); - - K053260Init(0, 3579545, DrvSoundRom, 0x100000); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.50, BURN_SND_ROUTE_RIGHT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.50, BURN_SND_ROUTE_LEFT); - - EEPROMInit(&BlswhstlEEPROMInterface); - - // Reset the driver - BlswhstlDoReset(); - - return 0; -} - -static INT32 SsridersInit() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - SsridersMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - SsridersMemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x0fffff); - K052109SetCallback(K052109TmntCallback); - K052109AdjustScroll(8, 0); - - K053245Init(0, DrvSpriteRom, DrvSprites, 0x1fffff, K053245LgtnfghtCallback); - K053245SetSpriteOffset(0, -112, 16); - K05324xSetZRejection(0); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x080001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x080000, 3, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x080000, 6, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvTileRom, 0x100000); - GfxDecode(0x8000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x100000, 8, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvSpriteRom, 0x200000); - K053245GfxDecode(DrvSpriteRom, DrvSprites, 0x200000); - - // Load K053260 Sample Roms - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x104000, 0x107fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x140fff, MAP_RAM); - SekSetReadWordHandler(0, Ssriders68KReadWord); - SekSetWriteWordHandler(0, Ssriders68KWriteWord); - SekSetReadByteHandler(0, Ssriders68KReadByte); - SekSetWriteByteHandler(0, Ssriders68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(BlswhstlZ80Read); - ZetSetWriteHandler(BlswhstlZ80Write); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80Rom ); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K053260Init(0, 3579545, DrvSoundRom, 0x100000); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.70, BURN_SND_ROUTE_LEFT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.70, BURN_SND_ROUTE_RIGHT); - - EEPROMInit(&BlswhstlEEPROMInterface); - - // Reset the driver - SsridersDoReset(); - - return 0; -} - -static INT32 Thndrx2Init() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - Thndrx2MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - Thndrx2MemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x0fffff); - K052109SetCallback(K052109TmntCallback); - K052109AdjustScroll(8, 0); - - K051960Init(DrvSpriteRom, DrvSprites, 0x0fffff); - K051960SetCallback(K051960Thndrx2Callback); - K051960SetSpriteOffset(8, 0); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x080000, 4, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvTileRom, 0x100000); - GfxDecode(0x8000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x080000, 6, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvSpriteRom, 0x100000); - GfxDecode(0x2000, 4, 16, 16, SpritePlaneOffsets2, SpriteXOffsets, SpriteYOffsets, 0x400, DrvSpriteRom, DrvSprites); - - // Load K053260 Sample Roms - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 7, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x200000, 0x200fff, MAP_RAM); - SekSetWriteWordHandler(0, Thndrx268KWriteWord); - SekSetReadByteHandler(0, Thndrx268KReadByte); - SekSetWriteByteHandler(0, Thndrx268KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Thndrx2Z80Read); - ZetSetWriteHandler(Thndrx2Z80Write); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80Rom ); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K053260Init(0, 3579545, DrvSoundRom, 0x80000); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - EEPROMInit(&thndrx2_eeprom_interface); - - // Reset the driver - SsridersDoReset(); - - return 0; -} - -static INT32 LgtnfghtInit() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - LgtnfghtMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - LgtnfghtMemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x0fffff); - K052109SetCallback(K052109TmntCallback); - K052109AdjustScroll(8, 0); - - K053245Init(0, DrvSpriteRom, DrvSprites, 0x0fffff, K053245LgtnfghtCallback); - K053245SetSpriteOffset(0, -112, 16); - K05324xSetZRejection(0); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x080000, 4, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvTileRom, 0x100000); - GfxDecode(0x8000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x080000, 6, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvSpriteRom, 0x100000); - K053245GfxDecode(DrvSpriteRom, DrvSprites, 0x100000); - - // Load K053260 Sample Roms - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 7, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPaletteRam , 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(Drv68KRam , 0x090000, 0x093fff, MAP_RAM); - SekSetReadWordHandler(0, Lgtnfght68KReadWord); - SekSetWriteWordHandler(0, Lgtnfght68KWriteWord); - SekSetReadByteHandler(0, Lgtnfght68KReadByte); - SekSetWriteByteHandler(0, Lgtnfght68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(LgtnfghtZ80Read); - ZetSetWriteHandler(LgtnfghtZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K053260Init(0, 3579545, DrvSoundRom, 0x80000); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.70, BURN_SND_ROUTE_LEFT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.70, BURN_SND_ROUTE_RIGHT); - - EEPROMInit(&thndrx2_eeprom_interface); - - NoDim = 1; - - // Reset the driver - SsridersDoReset(); - - return 0; -} - -static INT32 Tmnt2Init() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - Tmnt2MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - Tmnt2MemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x0fffff); - K052109SetCallback(K052109TmntCallback); - K052109AdjustScroll(8, 0); - - K053245Init(0, DrvSpriteRom, DrvSprites, 0x3fffff, K053245SsridersCallback); - K053245SetSpriteOffset(0, -112, 16); - K05324xSetZRejection(0); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x040001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x040000, 3, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x080000, 6, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvTileRom, 0x100000); - GfxDecode(0x8000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x100000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x200000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x300000, 10, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvSpriteRom, 0x400000); - K053245GfxDecode(DrvSpriteRom, DrvSprites, 0x400000); - - // Load K053260 Sample Roms - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 11, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x104000, 0x107fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x140fff, MAP_RAM); - SekSetReadWordHandler(0, Ssriders68KReadWord); - SekSetWriteWordHandler(0, Ssriders68KWriteWord); - SekSetReadByteHandler(0, Ssriders68KReadByte); - SekSetWriteByteHandler(0, Ssriders68KWriteByte); - - SekMapHandler(1, 0x1c0800, 0x1c081f, MAP_WRITE); - SekSetWriteWordHandler(1, Tmnt268KProtWord); - SekSetWriteByteHandler(1, Tmnt268KProtByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(BlswhstlZ80Read); - ZetSetWriteHandler(BlswhstlZ80Write); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80Rom ); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K053260Init(0, 3579545, DrvSoundRom, 0x200000); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - EEPROMInit(&BlswhstlEEPROMInterface); - - // Reset the driver - SsridersDoReset(); - - return 0; -} - -static INT32 QgakumonInit() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - Tmnt2MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - Tmnt2MemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x0fffff); - K052109SetCallback(K052109TmntCallback); - K052109AdjustScroll(0, 0); - - K053245Init(0, DrvSpriteRom, DrvSprites, 0x3fffff, K053245SsridersCallback); - K053245SetSpriteOffset(0, -112, 16); - K05324xSetZRejection(0); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x080001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x080000, 3, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x080000, 6, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvTileRom, 0x100000); - GfxDecode(0x8000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x200000, 8, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvSpriteRom, 0x400000); - K053245GfxDecode(DrvSpriteRom, DrvSprites, 0x400000); - - // Load K053260 Sample Roms - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x104000, 0x107fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x140fff, MAP_RAM); - SekSetReadWordHandler(0, Ssriders68KReadWord); - SekSetWriteWordHandler(0, Ssriders68KWriteWord); - SekSetReadByteHandler(0, Ssriders68KReadByte); - SekSetWriteByteHandler(0, Ssriders68KWriteByte); - - SekMapHandler(1, 0x1c0800, 0x1c081f, MAP_WRITE); - SekSetWriteWordHandler(1, Tmnt268KProtWord); - SekSetWriteByteHandler(1, Tmnt268KProtByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(BlswhstlZ80Read); - ZetSetWriteHandler(BlswhstlZ80Write); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80Rom ); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K053260Init(0, 3579545, DrvSoundRom, 0x200000); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - EEPROMInit(&BlswhstlEEPROMInterface); - - // Reset the driver - SsridersDoReset(); - - return 0; -} - -static INT32 PunkshotInit() -{ - GenericTilesInit(); - - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - PunkshotMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PunkshotMemIndex(); - - K052109Init(DrvTileRom, DrvTiles, 0x07ffff); - K052109SetCallback(K052109TmntCallback); - K052109AdjustScroll(8, 0); - - K051960Init(DrvSpriteRom, DrvSprites, 0x1fffff); - K051960SetCallback(K051960PunkshotCallback); - K051960SetSpriteOffset(8, 0); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTileRom + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTileRom + 0x040000, 4, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvTileRom, 0x80000); - GfxDecode(0x4000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles); - - // Load the sprites - nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSpriteRom + 0x100000, 6, 1); if (nRet != 0) return 1; - konami_rom_deinterleave_2(DrvSpriteRom, 0x200000); - GfxDecode(0x4000, 4, 16, 16, SpritePlaneOffsets2, SpriteXOffsets, SpriteYOffsets, 0x400, DrvSpriteRom, DrvSprites); - - // Load K053260 Sample Roms - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 7, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x080000, 0x083fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x090000, 0x090fff, MAP_RAM); - SekSetReadWordHandler(0, Punkshot68KReadWord); - SekSetWriteWordHandler(0, Punkshot68KWriteWord); - SekSetReadByteHandler(0, Punkshot68KReadByte); - SekSetWriteByteHandler(0, Punkshot68KWriteByte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Thndrx2Z80Read); - ZetSetWriteHandler(Thndrx2Z80Write); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80Rom ); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - K053260Init(0, 3579545, DrvSoundRom, 0x80000); - K053260PCMSetAllRoutes(0, 0.70, BURN_SND_ROUTE_BOTH); - - // Reset the driver - PunkshotDoReset(); - - return 0; -} - -static INT32 CommonExit() -{ - SekExit(); - - BurnYM2151Exit(); - - GenericTilesExit(); - - KonamiICExit(); - - BurnFree(Mem); - - bIrqEnable = 0; - DrvSoundLatch = 0; - TitleSoundLatch = 0; - PlayTitleSample = 0; - TitleSamplePos = 0; - SpriteColourBase = 0; - memset(LayerColourBase, 0, 3); - memset(LayerPri, 0, 3); - PriorityFlag = 0; - - DrvNvRamBank = 0; - CuebrickSndIrqFire = 0; - BlswhstlTileRomBank = 0; - DrvVBlank = 0; - InitEEPROMCount = 0; - - return 0; -} - -static INT32 CommonZ80Exit() -{ - ZetExit(); - - return CommonExit(); -} - -static INT32 TmntExit() -{ - UPD7759Exit(); - K007232Exit(); - - return CommonZ80Exit(); -} - -static INT32 MiaExit() -{ - K007232Exit(); - - return CommonZ80Exit(); -} - -static INT32 BlswhstlExit() -{ - K053260Exit(); - EEPROMExit(); - NoDim = 0; - - return CommonZ80Exit(); -} - -static INT32 PunkshotExit() -{ - K053260Exit(); - - return CommonZ80Exit(); -} - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -static void DrvCalcPalette() -{ - UINT16 *PaletteRam = (UINT16*)DrvPaletteRam; - - for (INT32 i = 0; i < 0x800; i += 2) { - INT32 Offset = i & ~1; - UINT32 Data = (BURN_ENDIAN_SWAP_INT16(PaletteRam[Offset]) << 8) | BURN_ENDIAN_SWAP_INT16(PaletteRam[Offset + 1]); - - DrvPalette[Offset >> 1] = (pal5bit(Data >> 0) << 16) | (pal5bit(Data >> 5) << 8) | pal5bit(Data >> 10); - } -} - -static void BlswhstlCalcPalette() -{ - UINT16 *PaletteRam = (UINT16*)DrvPaletteRam; - - for (INT32 i = 0; i < 0x800; i++) { - UINT32 Data = BURN_ENDIAN_SWAP_INT16(PaletteRam[i]); - - DrvPalette[i] = (pal5bit(Data >> 0) << 16) | (pal5bit(Data >> 5) << 8) | pal5bit(Data >> 10); - } -} - -static void sortlayers(INT32 *layer,INT32 *pri) -{ -#define SWAP(a,b) \ - if (pri[a] < pri[b]) \ - { \ - INT32 t; \ - t = pri[a]; pri[a] = pri[b]; pri[b] = t; \ - t = layer[a]; layer[a] = layer[b]; layer[b] = t; \ - } - - SWAP(0,1) - SWAP(0,2) - SWAP(1,2) -} - -static inline void BlswhstlCalcPaletteWithContrast(INT32 i, INT32 brt) -{ - INT32 r,g,b; - UINT16 *PaletteRam = (UINT16*)DrvPaletteRam; - - UINT32 Data = BURN_ENDIAN_SWAP_INT16(PaletteRam[i]); - - r = pal5bit(Data >> 0); - g = pal5bit(Data >> 5); - b = pal5bit(Data >> 10); - - r = (r * brt) / 100; - g = (g * brt) / 100; - b = (b * brt) / 100; - - DrvPalette[i] = (r<<16) | (g<<8) | b; -} - -static void PaletteDim(INT32 dimslayer) -{ - INT32 i, dim, en, cb, ce, brt; - - dim = dim_v | ((~dim_c & 0x10) >> 1); - en = (K053251GetPriority(5) && K053251GetPriority(5) != 0x3e); - - brt = 100; - if (en) brt -= 40*dim/8; - - if (brt < 100 && !NoDim) { - cb = LayerColourBase[dimslayer] << 4; - ce = cb + 128; - - for (i = 0; i < cb; i++) - BlswhstlCalcPaletteWithContrast(i, brt); - - for (i = cb; i < ce; i++) // text - BlswhstlCalcPaletteWithContrast(i, 100); - - for (i = ce; i < 2048; i++) - BlswhstlCalcPaletteWithContrast(i, brt); - - if (~dim_c & 0x10) { - konami_set_highlight_over_sprites_mode(1); - konami_set_highlight_mode(1); - } else { - konami_set_highlight_over_sprites_mode(0); - konami_set_highlight_mode(0); - } - - } else { - BlswhstlCalcPalette(); - } -} - -static void TmntDraw() -{ - DrvCalcPalette(); - K052109UpdateScroll(); - - K052109RenderLayer(2, K052109_OPAQUE, 0); - if ((PriorityFlag & 1) == 1) K051960SpritesRender(0, 0); - K052109RenderLayer(1, 0, 0); - if ((PriorityFlag & 1) == 0) K051960SpritesRender(0, 0); - K052109RenderLayer(0, 0, 0); - - KonamiBlendCopy(DrvPalette); -} - -static void BlswhstlDraw() -{ - INT32 Layer[3]; - - K052109UpdateScroll(); - - INT32 BGColourBase = K053251GetPaletteIndex(0); - SpriteColourBase = K053251GetPaletteIndex(1); - LayerColourBase[0] = K053251GetPaletteIndex(2); - LayerColourBase[1] = K053251GetPaletteIndex(4); - LayerColourBase[2] = K053251GetPaletteIndex(3); - - LayerPri[0] = K053251GetPriority(2); - LayerPri[1] = K053251GetPriority(4); - LayerPri[2] = K053251GetPriority(3); - Layer[0] = 0; - Layer[1] = 1; - Layer[2] = 2; - - KonamiClearBitmaps(DrvPalette[16 * BGColourBase]); - - sortlayers(Layer, LayerPri); - - PaletteDim(Layer[2]); - - if (nBurnLayer & 1) K052109RenderLayer(Layer[0], 0, 1); - if (nBurnLayer & 2) K052109RenderLayer(Layer[1], 0, 2); - if (nBurnLayer & 4) K052109RenderLayer(Layer[2], 0, 4); - - if (nSpriteEnable & 1) K053245SpritesRender(0); - - KonamiBlendCopy(DrvPalette); -} - -static INT32 Thndrx2Draw() -{ - INT32 Layer[3]; - - BlswhstlCalcPalette(); - K052109UpdateScroll(); - - INT32 BGColourBase = K053251GetPaletteIndex(0); - SpriteColourBase = K053251GetPaletteIndex(1); - LayerColourBase[0] = K053251GetPaletteIndex(2); - LayerColourBase[1] = K053251GetPaletteIndex(4); - LayerColourBase[2] = K053251GetPaletteIndex(3); - - LayerPri[0] = K053251GetPriority(2); - LayerPri[1] = K053251GetPriority(4); - LayerPri[2] = K053251GetPriority(3); - Layer[0] = 0; - Layer[1] = 1; - Layer[2] = 2; - - KonamiClearBitmaps(DrvPalette[16 * BGColourBase]); - - sortlayers(Layer, LayerPri); - - if (nBurnLayer & 1) K052109RenderLayer(Layer[0], 0, 1); - if (nBurnLayer & 2) K052109RenderLayer(Layer[1], 0, 2); - if (nBurnLayer & 4) K052109RenderLayer(Layer[2], 0, 4); - - if (nSpriteEnable & 1) K051960SpritesRender(-1, -1); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 PunkshotDraw() -{ - INT32 Layer[3]; - - BlswhstlCalcPalette(); - K052109UpdateScroll(); - -// INT32 BGColourBase = K053251GetPaletteIndex(0); - SpriteColourBase = K053251GetPaletteIndex(1); - LayerColourBase[0] = K053251GetPaletteIndex(2); - LayerColourBase[1] = K053251GetPaletteIndex(4); - LayerColourBase[2] = K053251GetPaletteIndex(3); - - LayerPri[0] = K053251GetPriority(2); - LayerPri[1] = K053251GetPriority(4); - LayerPri[2] = K053251GetPriority(3); - Layer[0] = 0; - Layer[1] = 1; - Layer[2] = 2; - - sortlayers(Layer, LayerPri); - - if (nBurnLayer & 1) K052109RenderLayer(Layer[0], K052109_OPAQUE, 1); - if (nBurnLayer & 2) K052109RenderLayer(Layer[1], 0, 2); - if (nBurnLayer & 4) K052109RenderLayer(Layer[2], 0, 4); - - if (nSpriteEnable & 1) K051960SpritesRender(-1, -1); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static void RenderTitleSample(INT16 *pSoundBuf, INT32 nLength) -{ - double Addr = TitleSamplePos; - double Step = (double)20000 / nBurnSoundRate; - - for (INT32 i = 0; i < nLength; i += 2) { - if (Addr > 0x3ffff) break; - INT16 Sample = DrvTitleSample[(INT32)Addr]; - - INT16 nLeftSample = 0, nRightSample = 0; - - if ((TitleSampleOutputDir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Sample * TitleSampleGain); - } - if ((TitleSampleOutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Sample * TitleSampleGain); - } - - pSoundBuf[i + 0] += nLeftSample; - pSoundBuf[i + 1] += nRightSample; - - Addr += Step; - } - - TitleSamplePos = Addr; -} - -static INT32 TmntFrame() -{ - INT32 nInterleave = nBurnSoundLen; - INT32 nSoundBufferPos = 0; - - if (DrvReset) TmntDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 8000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1) && bIrqEnable) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - UPD7759Update(0, pSoundBuf, nSegmentLength); - if (PlayTitleSample) RenderTitleSample(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - UPD7759Update(0, pSoundBuf, nSegmentLength); - if (PlayTitleSample) RenderTitleSample(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) TmntDraw(); - - return 0; -} - -static INT32 MiaFrame() -{ - INT32 nInterleave = nBurnSoundLen; - INT32 nSoundBufferPos = 0; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 8000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1) && bIrqEnable) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) TmntDraw(); - - return 0; -} - -static INT32 CuebrickFrame() -{ - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - if (DrvReset) CuebrickDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 8000000 / 60; - nCyclesDone[0] = 0; - - SekNewFrame(); - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1) && bIrqEnable) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - if (CuebrickSndIrqFire) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - } - - SekClose(); - - if (pBurnDraw) TmntDraw(); - - return 0; -} - -static INT32 BlswhstlFrame() -{ - INT32 nInterleave = 32; - INT32 nSoundBufferPos = 0; - - if (DrvReset) BlswhstlDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1) && K052109_irq_enabled) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) BlswhstlDraw(); - - K053245ClearBuffer(0); - - return 0; -} - -static INT32 SsridersFrame() -{ - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - - if (DrvReset) SsridersDoReset(); - - SsridersMakeInputs(); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesTotal[1] = 8000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 19) DrvVBlank = 0; - if (i == 240) DrvVBlank = 1; - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekOpen(0); - if (K052109_irq_enabled) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) BlswhstlDraw(); - - return 0; -} - -static INT32 Thndrx2Frame() -{ - INT32 nInterleave = 100; - INT32 nSoundBufferPos = 0; - - if (DrvReset) SsridersDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 12000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K052109_irq_enabled) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) Thndrx2Draw(); - - return 0; -} - -static INT32 LgtnfghtFrame() -{ - INT32 nInterleave = 100; - INT32 nSoundBufferPos = 0; - - if (DrvReset) SsridersDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 12000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K052109_irq_enabled) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) BlswhstlDraw(); - - return 0; -} - -static INT32 Tmnt2Frame() -{ - INT32 nInterleave = 262; - INT32 nSoundBufferPos = 0; - - if (DrvReset) SsridersDoReset(); - - SsridersMakeInputs(); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesTotal[1] = 8000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 19) DrvVBlank = 0; - if (i == 243) DrvVBlank = 1; - if (i == 243 && K052109_irq_enabled) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) BlswhstlDraw(); - - return 0; -} - -static INT32 PunkshotFrame() -{ - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - - if (DrvReset) PunkshotDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 12000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (K052109_irq_enabled) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) PunkshotDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029693; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - KonamiICScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - BurnYM2151Scan(nAction); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(DrvDip); - SCAN_VAR(DrvInput); - SCAN_VAR(bIrqEnable); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(TitleSoundLatch); - SCAN_VAR(PlayTitleSample); - SCAN_VAR(TitleSamplePos); - SCAN_VAR(PriorityFlag); - - BurnRandomScan(nAction); - } - - return 0; -} - -static INT32 TmntScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - K007232Scan(nAction, pnMin); - UPD7759Scan(0, nAction, pnMin); - } - - return DrvScan(nAction, pnMin); -} - -static INT32 MiaScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - K007232Scan(nAction, pnMin); - } - - return DrvScan(nAction, pnMin); -} - -static INT32 CuebrickScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (nAction & ACB_NVRAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvNvRam; - ba.nLen = 0x400 * 0x20; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - KonamiICScan(nAction); - SCAN_VAR(CuebrickSndIrqFire); - } - - return DrvScan(nAction, pnMin); -} - -static INT32 BlswhstlScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - K053260Scan(nAction); - - SCAN_VAR(InitEEPROMCount); - } - - EEPROMScan(nAction, pnMin); - - return DrvScan(nAction, pnMin); -} - -static INT32 SsridersScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - K053260Scan(nAction); - - SCAN_VAR(InitEEPROMCount); - SCAN_VAR(DrvVBlank); - } - - EEPROMScan(nAction, pnMin); - - return DrvScan(nAction, pnMin); -} - -static INT32 Thndrx2aScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - K053260Scan(nAction); - } - - return DrvScan(nAction, pnMin); -} - -struct BurnDriver BurnDrvTmnt = { - "tmnt", NULL, NULL, NULL, "1989", - "Teenage Mutant Ninja Turtles (World 4 Players, version X)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, TmntRomInfo, TmntRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmntu = { - "tmntu", "tmnt", NULL, NULL, "1989", - "Teenage Mutant Ninja Turtles (US 4 Players, version R)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, TmntuRomInfo, TmntuRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmntua = { - "tmntua", "tmnt", NULL, NULL, "1989", - "Teenage Mutant Ninja Turtles (US 4 Players, version J)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, TmntuaRomInfo, TmntuaRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmntub = { - "tmntub", "tmnt", NULL, NULL, "1989", - "Teenage Mutant Ninja Turtles (US 4 Players, version H)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, TmntubRomInfo, TmntubRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmht = { - "tmht", "tmnt", NULL, NULL, "1989", - "Teenage Mutant Hero Turtles (UK 4 Players, version F)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, TmhtRomInfo, TmhtRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmhta = { - "tmhta", "tmnt", NULL, NULL, "1989", - "Teenage Mutant Hero Turtles (UK 4 Players, version S)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, TmhtaRomInfo, TmhtaRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmhtb = { - "tmhtb", "tmnt", NULL, NULL, "1989", - "Teenage Mutant Hero Turtles (UK 4 Players, version ?)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, TmhtbRomInfo, TmhtbRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmntj = { - "tmntj", "tmnt", NULL, NULL, "1990", - "Teenage Mutant Ninja Turtles (Japan 4 Players, version 2)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, TmntjRomInfo, TmntjRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmnta = { - "tmnta", "tmnt", NULL, NULL, "1990", - "Teenage Mutant Ninja Turtles (Asia 4 Players, version ?)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, TmntaRomInfo, TmntaRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmht2p = { - "tmht2p", "tmnt", NULL, NULL, "1989", - "Teenage Mutant Hero Turtles (UK 2 Players, version U)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, Tmht2pRomInfo, Tmht2pRomName, NULL, NULL, Tmnt2pInputInfo, Tmnt2pDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmht2pa = { - "tmht2pa", "tmnt", NULL, NULL, "1989", - "Teenage Mutant Hero Turtles (UK 2 Players, version ?)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, Tmht2paRomInfo, Tmht2paRomName, NULL, NULL, Tmnt2pInputInfo, Tmnt2pDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmht2pj = { - "tmnt2pj", "tmnt", NULL, NULL, "1990", - "Teenage Mutant Ninja Turtles (Japan 2 Players, version 1)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, Tmnt2pjRomInfo, Tmnt2pjRomName, NULL, NULL, Tmnt2pInputInfo, Tmnt2pDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmht2po = { - "tmnt2po", "tmnt", NULL, NULL, "1989", - "Teenage Mutant Ninja Turtles (Oceania 2 Players, version ?)\0", NULL, "Konami", "GX963", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, Tmnt2poRomInfo, Tmnt2poRomName, NULL, NULL, Tmnt2pInputInfo, Tmnt2pDIPInfo, - TmntInit, TmntExit, TmntFrame, NULL, TmntScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMia = { - "mia", NULL, NULL, NULL, "1989", - "M.I.A. - Missing in Action (version T)\0", NULL, "Konami", "GX808", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, MiaRomInfo, MiaRomName, NULL, NULL, MiaInputInfo, MiaDIPInfo, - MiaInit, MiaExit, MiaFrame, NULL, MiaScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMia2 = { - "mia2", "mia", NULL, NULL, "1989", - "M.I.A. - Missing in Action (version S)\0", NULL, "Konami", "GX808", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, Mia2RomInfo, Mia2RomName, NULL, NULL, MiaInputInfo, MiaDIPInfo, - MiaInit, MiaExit, MiaFrame, NULL, MiaScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCuebrick = { - "cuebrick", NULL, NULL, NULL, "1989", - "Cue Brick (World, version D)\0", NULL, "Konami", "GX903", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_PUZZLE, 0, - NULL, CuebrickRomInfo, CuebrickRomName, NULL, NULL, MiaInputInfo, MiaDIPInfo, - CuebrickInit, CommonExit, CuebrickFrame, NULL, CuebrickScan, - NULL, 0x400, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBlswhstl = { - "blswhstl", NULL, NULL, NULL, "1991", - "Bells & Whistles (World, version L)\0", NULL, "Konami", "GX060", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0, - NULL, BlswhstlRomInfo, BlswhstlRomName, NULL, NULL, BlswhstlInputInfo, NULL, - BlswhstlInit, BlswhstlExit, BlswhstlFrame, NULL, BlswhstlScan, - NULL, 0x810, 224, 280, 3, 4 -}; - -struct BurnDriver BurnDrvBlswhstla = { - "blswhstla", "blswhstl", NULL, NULL, "1991", - "Bells & Whistles (Asia, version M)\0", NULL, "Konami", "GX060", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0, - NULL, BlswhstlaRomInfo, BlswhstlaRomName, NULL, NULL, BlswhstlInputInfo, NULL, - BlswhstlInit, BlswhstlExit, BlswhstlFrame, NULL, BlswhstlScan, - NULL, 0x810, 224, 280, 3, 4 -}; - -struct BurnDriver BurnDrvDetatwin = { - "detatwin", "blswhstl", NULL, NULL, "1991", - "Detana!! Twin Bee (Japan ver. J)\0", NULL, "Konami", "GX060", - L"\u51FA\u305F\u306A!! Twin Bee \u30C4\u30A4\u30F3\u30D3\u30FC (Japan, version J)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0, - NULL, DetatwinRomInfo, DetatwinRomName, NULL, NULL, BlswhstlInputInfo, NULL, - BlswhstlInit, BlswhstlExit, BlswhstlFrame, NULL, BlswhstlScan, - NULL, 0x810, 224, 280, 3, 4 -}; - -struct BurnDriver BurnDrvSsriders = { - "ssriders", NULL, NULL, NULL, "1991", - "Sunset Riders (4 Players ver. EAC)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersRomInfo, SsridersRomName, NULL, NULL, Ssriders4pInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersebd = { - "ssridersebd", "ssriders", NULL, NULL, "1991", - "Sunset Riders (2 Players ver. EBD)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersebdRomInfo, SsridersebdRomName, NULL, NULL, SsridersInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersebc = { - "ssridersebc", "ssriders", NULL, NULL, "1991", - "Sunset Riders (2 Players ver. EBC)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersebcRomInfo, SsridersebcRomName, NULL, NULL, SsridersInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersuda = { - "ssridersuda", "ssriders", NULL, NULL, "1991", - "Sunset Riders (4 Players ver. UDA)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersudaRomInfo, SsridersudaRomName, NULL, NULL, Ssriders4psInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsriderseaa = { - "ssriderseaa", "ssriders", NULL, NULL, "1991", - "Sunset Riders (4 Players ver. EAA)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsriderseaaRomInfo, SsriderseaaRomName, NULL, NULL, Ssriders4psInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersuab = { - "ssridersuab", "ssriders", NULL, NULL, "1991", - "Sunset Riders (4 Players ver. UAB)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersuabRomInfo, SsridersuabRomName, NULL, NULL, Ssriders4pInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersuac = { - "ssridersuac", "ssriders", NULL, NULL, "1991", - "Sunset Riders (4 Players ver. UAC)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersuacRomInfo, SsridersuacRomName, NULL, NULL, Ssriders4pInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersubc = { - "ssridersubc", "ssriders", NULL, NULL, "1991", - "Sunset Riders (2 Players ver. UBC)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersubcRomInfo, SsridersubcRomName, NULL, NULL, SsridersInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersabd = { - "ssridersabd", "ssriders", NULL, NULL, "1991", - "Sunset Riders (2 Players ver. ABD)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersabdRomInfo, SsridersabdRomName, NULL, NULL, SsridersInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersadd = { - "ssridersadd", "ssriders", NULL, NULL, "1991", - "Sunset Riders (4 Players ver. ADD)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersaddRomInfo, SsridersaddRomName, NULL, NULL, Ssriders4psInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersjac = { - "ssridersjac", "ssriders", NULL, NULL, "1991", - "Sunset Riders (4 Players ver. JAC)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersjacRomInfo, SsridersjacRomName, NULL, NULL, SsridersInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersjad = { - "ssridersjad", "ssriders", NULL, NULL, "1991", - "Sunset Riders (4 Players ver. JAD)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersjadRomInfo, SsridersjadRomName, NULL, NULL, SsridersInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsridersjbd = { - "ssridersjbd", "ssriders", NULL, NULL, "1991", - "Sunset Riders (2 Players ver. JBD)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, SsridersjbdRomInfo, SsridersjbdRomName, NULL, NULL, SsridersInputInfo, NULL, - SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -static INT32 SsridersbInit() -{ - return 1; -} - -struct BurnDriverD BurnDrvSsridersb = { - "ssridersb", "ssriders", NULL, NULL, "1991", - "Sunset Riders (bootleg 4 Players ver. ADD)\0", NULL, "Konami", "GX064", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0, - NULL, ssridersbRomInfo, ssridersbRomName, NULL, NULL, Ssriders4psInputInfo, NULL, - SsridersbInit, CommonExit, SsridersFrame, NULL, SsridersScan, - NULL, 0x810, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThndrx2 = { - "thndrx2", NULL, NULL, NULL, "1991", - "Thunder Cross II (World)\0", NULL, "Konami", "GX073", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, thndrx2RomInfo, thndrx2RomName, NULL, NULL, Thndrx2InputInfo, NULL, - Thndrx2Init, BlswhstlExit, Thndrx2Frame, NULL, Thndrx2aScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThndrx2a = { - "thndrx2a", "thndrx2", NULL, NULL, "1991", - "Thunder Cross II (Asia)\0", NULL, "Konami", "GX073", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, thndrx2aRomInfo, thndrx2aRomName, NULL, NULL, Thndrx2InputInfo, NULL, - Thndrx2Init, BlswhstlExit, Thndrx2Frame, NULL, Thndrx2aScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThndrx2j = { - "thndrx2j", "thndrx2", NULL, NULL, "1991", - "Thunder Cross II (Japan)\0", NULL, "Konami", "GX073", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0, - NULL, thndrx2jRomInfo, thndrx2jRomName, NULL, NULL, Thndrx2InputInfo, NULL, - Thndrx2Init, BlswhstlExit, Thndrx2Frame, NULL, Thndrx2aScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLgtnfght = { - "lgtnfght", NULL, NULL, NULL, "1990", - "Lightning Fighters (World)\0", NULL, "Konami", "GX939", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0, - NULL, lgtnfghtRomInfo, lgtnfghtRomName, NULL, NULL, LgtnfghtInputInfo, LgtnfghtDIPInfo, - LgtnfghtInit, BlswhstlExit, LgtnfghtFrame, NULL, Thndrx2aScan, - NULL, 0x800, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvLgtnfghtu = { - "lgtnfghtu", "lgtnfght", NULL, NULL, "1990", - "Lightning Fighters (US)\0", NULL, "Konami", "GX939", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0, - NULL, lgtnfghtuRomInfo, lgtnfghtuRomName, NULL, NULL, LgtnfghtInputInfo, LgtnfghtDIPInfo, - LgtnfghtInit, BlswhstlExit, LgtnfghtFrame, NULL, Thndrx2aScan, - NULL, 0x800, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvLgtnfghta = { - "lgtnfghta", "lgtnfght", NULL, NULL, "1990", - "Lightning Fighters (Asia)\0", NULL, "Konami", "GX939", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0, - NULL, lgtnfghtaRomInfo, lgtnfghtaRomName, NULL, NULL, LgtnfghtInputInfo, LgtnfghtDIPInfo, - LgtnfghtInit, BlswhstlExit, LgtnfghtFrame, NULL, Thndrx2aScan, - NULL, 0x800, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvTrigon = { - "trigon", "lgtnfght", NULL, NULL, "1990", - "Trigon (Japan)\0", NULL, "Konami", "GX939", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0, - NULL, trigonRomInfo, trigonRomName, NULL, NULL, LgtnfghtInputInfo, LgtnfghtDIPInfo, - LgtnfghtInit, BlswhstlExit, LgtnfghtFrame, NULL, Thndrx2aScan, - NULL, 0x800, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvTmnt2 = { - "tmnt2", NULL, NULL, NULL, "1991", - "Teenage Mutant Ninja Turtles - Turtles in Time (4 Players ver. UAA)\0", NULL, "Konami", "GX063", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, tmnt2RomInfo, tmnt2RomName, NULL, NULL, Ssriders4pInputInfo, NULL, - Tmnt2Init, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmnt22pu = { - "tmnt22pu", "tmnt2", NULL, NULL, "1991", - "Teenage Mutant Ninja Turtles - Turtles in Time (2 Players ver. UDA)\0", NULL, "Konami", "GX063", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, tmnt22puRomInfo, tmnt22puRomName, NULL, NULL, SsridersInputInfo, NULL, - Tmnt2Init, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmht22pe = { - "tmht22pe", "tmnt2", NULL, NULL, "1991", - "Teenage Mutant Hero Turtles - Turtles in Time (2 Players ver. EBA)\0", NULL, "Konami", "GX063", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, tmht22peRomInfo, tmht22peRomName, NULL, NULL, SsridersInputInfo, NULL, - Tmnt2Init, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmht24pe = { - "tmht24pe", "tmnt2", NULL, NULL, "1991", - "Teenage Mutant Hero Turtles - Turtles in Time (4 Players ver. EAA)\0", NULL, "Konami", "GX063", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, tmht24peRomInfo, tmht24peRomName, NULL, NULL, SsridersInputInfo, NULL, - Tmnt2Init, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTmnt2a = { - "tmnt2a", "tmnt2", NULL, NULL, "1991", - "Teenage Mutant Ninja Turtles - Turtles in Time (4 Players ver. ADA)\0", NULL, "Konami", "GX063", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0, - NULL, tmnt2aRomInfo, tmnt2aRomName, NULL, NULL, Ssriders4psInputInfo, NULL, - Tmnt2Init, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQgakumon = { - "qgakumon", NULL, NULL, NULL, "1993", - "Quiz Gakumon no Susume (Japan ver. JA2 Type L)\0", NULL, "Konami", "GX248", - L"\u30AF\u30A4\u30BA \u5B66\u554F\u30CE\u30B9\u30B9\u30E1 Gakumon no Susume (Japan ver. JA2 Type L)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_QUIZ, 0, - NULL, qgakumonRomInfo, qgakumonRomName, NULL, NULL, QgakumonInputInfo, NULL, - QgakumonInit, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan, - NULL, 0x800, 304, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPunkshot = { - "punkshot", NULL, NULL, NULL, "1990", - "Punk Shot (US 4 Players)\0", NULL, "Konami", "GX907", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_KONAMI_68K_Z80, GBF_SPORTSMISC, 0, - NULL, punkshotRomInfo, punkshotRomName, NULL, NULL, PunkshotInputInfo, PunkshotDIPInfo, - PunkshotInit, PunkshotExit, PunkshotFrame, NULL, Thndrx2aScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPunkshot2 = { - "punkshot2", "punkshot", NULL, NULL, "1990", - "Punk Shot (US 2 Players)\0", NULL, "Konami", "GX907", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SPORTSMISC, 0, - NULL, punkshot2RomInfo, punkshot2RomName, NULL, NULL, Punkshot2InputInfo, Punkshot2DIPInfo, - PunkshotInit, PunkshotExit, PunkshotFrame, NULL, Thndrx2aScan, - NULL, 0x800, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPunkshotj = { - "punkshotj", "punkshot", NULL, NULL, "1990", - "Punk Shot (Japan 2 Players)\0", NULL, "Konami", "GX907", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SPORTSMISC, 0, - NULL, punkshotjRomInfo, punkshotjRomName, NULL, NULL, Punkshot2InputInfo, PunkshotjDIPInfo, - PunkshotInit, PunkshotExit, PunkshotFrame, NULL, Thndrx2aScan, - NULL, 0x800, 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_tp84.cpp b/jan/src/burn/drv/konami/d_tp84.cpp deleted file mode 100644 index 2fee7a53c..000000000 --- a/jan/src/burn/drv/konami/d_tp84.cpp +++ /dev/null @@ -1,1113 +0,0 @@ -// FB Alpha Time Pilot '84 driver module -// Based on MAME driver by Marc Lafontaine - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "flt_rc.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvTransTable; -static UINT8 *DrvSprRAM; -static UINT8 *DrvColRAM0; -static UINT8 *DrvColRAM1; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvSprBuf; -static UINT8 *DrvShareRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pSoundBuffer[3]; - -static UINT8 palettebank; -static UINT8 flipscreenx; -static UINT8 flipscreeny; -static UINT8 soundlatch; -static UINT8 scrollx; -static UINT8 scrolly; -static UINT8 sub_irqmask; - -static INT32 scanline; -static INT32 watchdog; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo Tp84InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tp84) - -static struct BurnDIPInfo Tp84DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x52, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x02, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "10000 and every 50000"}, - {0x13, 0x01, 0x18, 0x10, "20000 and every 60000"}, - {0x13, 0x01, 0x18, 0x08, "30000 and every 70000"}, - {0x13, 0x01, 0x18, 0x00, "40000 and every 80000"}, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Tp84) - -static struct BurnDIPInfo Tp84aDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x52, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "10000 and every 50000"}, - {0x13, 0x01, 0x18, 0x10, "20000 and every 60000"}, - {0x13, 0x01, 0x18, 0x08, "30000 and every 70000"}, - {0x13, 0x01, 0x18, 0x00, "40000 and every 80000"}, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x60, "Easy" }, - {0x13, 0x01, 0x60, 0x40, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Tp84a) - -static void tp84_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - watchdog = 0; - return; - - case 0x2800: - palettebank = data; - return; - - case 0x3000: - return; - - case 0x3004: - flipscreenx = data & 0x01; - return; - - case 0x3005: - flipscreeny = data & 0x01; - return; - - case 0x3800: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x3a00: - soundlatch = data; - return; - - case 0x3c00: - scrollx = data; - return; - - case 0x3e00: - scrolly = data; - return; - } -} - -static UINT8 tp84_main_read(UINT16 address) -{ - switch (address) - { - case 0x2800: - return DrvInputs[0]; - - case 0x2820: - return DrvInputs[1]; - - case 0x2840: - return DrvInputs[2]; - - case 0x2860: - return DrvDips[0]; - - case 0x3000: - return DrvDips[1]; - } - - return 0; -} - -static void tp84b_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1800: - watchdog = 0; - return; - - case 0x1a00: - palettebank = data; - return; - - case 0x1c00: - return; - - case 0x1c04: - flipscreenx = data & 0x01; - return; - - case 0x1c05: - flipscreeny = data & 0x01; - return; - - case 0x1e00: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x1e80: - soundlatch = data; - return; - - case 0x1f00: - scrollx = data; - return; - - case 0x1f80: - scrolly = data; - return; - } -} - -static UINT8 tp84b_main_read(UINT16 address) -{ - switch (address) - { - case 0x1a00: - return DrvInputs[0]; - - case 0x1a20: - return DrvInputs[1]; - - case 0x1a40: - return DrvInputs[2]; - - case 0x1a60: - return DrvDips[0]; - - case 0x1c00: - return DrvDips[1]; - } - - return 0; -} - -static void tp84_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x4000: - sub_irqmask = data & 0x01; - return; - } -} - -static UINT8 tp84_sub_read(UINT16 address) -{ - switch (address) - { - case 0x2000: - return (M6809TotalCycles() / 100); // ((1536000 / 256) / 60) - } - - return 0; -} - -static void __fastcall tp84_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfe00) == 0xa000) { - INT32 C = 0; - if (address & 0x008) C += 47000; // 47000pF = 0.047uF - if (address & 0x010) C += 470000; // 470000pF = 0.47uF - filter_rc_set_RC(0, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(C)); - - C = 0; - if (address & 0x080) C += 470000; // 470000pF = 0.47uF - filter_rc_set_RC(1, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(C)); - - C = 0; - if (address & 0x100) C += 470000; // 470000pF = 0.47uF - filter_rc_set_RC(2, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(C)); - return; - } - - switch (address) - { - case 0xc000: - return; // nop - - case 0xc001: - SN76496Write(0, data); - return; - - case 0xc003: - SN76496Write(1, data); - return; - - case 0xc004: - SN76496Write(2, data); - return; - } -} - -static UINT8 __fastcall tp84_sound_read(UINT16 address) -{ - switch (address) - { - case 0x6000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - - case 0x8000: - return (ZetTotalCycles() >> 10) & 0xf; - } - - return 0; -} - -static int DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - palettebank = 0; - flipscreenx = 0; - flipscreeny = 0; - soundlatch = 0; - scrollx = 0; - scrolly = 0; - sub_irqmask = 0; - - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { ((0x8000/2) * 8) + 4, ((0x8000/2) * 8) + 0, 4, 0 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x00400, 2, 8, 8, Plane + 2, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x8000); - - GfxDecode(0x00100, 4, 16, 16, Plane + 0, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x008000; - DrvM6809ROM1 = Next; Next += 0x002000; - DrvZ80ROM = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000500; - - DrvTransTable = Next; Next += 0x001000; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - DrvSprBuf = Next; Next += 0x60 * 256; - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x000800; - DrvColRAM0 = Next; Next += 0x000400; - DrvColRAM1 = Next; Next += 0x000400; - DrvVidRAM0 = Next; Next += 0x000400; - DrvVidRAM1 = Next; Next += 0x000400; - DrvShareRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000400; - - RamEnd = Next; - - pSoundBuffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pSoundBuffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pSoundBuffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static int DrvInit() -{ - AllMem = NULL; - MemIndex(); - int nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x06000, 3, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 16, 1)) return 1; - - DrvGfxDecode(); - } - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvVidRAM0, 0x4000, 0x43ff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x4400, 0x47ff, MAP_RAM); - M6809MapMemory(DrvColRAM0, 0x4800, 0x4bff, MAP_RAM); - M6809MapMemory(DrvColRAM1, 0x4c00, 0x4fff, MAP_RAM); - M6809MapMemory(DrvShareRAM, 0x5000, 0x57ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(tp84_main_write); - M6809SetReadHandler(tp84_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvSprRAM, 0x6000, 0x67ff, MAP_RAM); - M6809MapMemory(DrvShareRAM, 0x8000, 0x87ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(tp84_sub_write); - M6809SetReadHandler(tp84_sub_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x4000, 0x43ff, MAP_RAM); - ZetSetWriteHandler(tp84_sound_write); - ZetSetReadHandler(tp84_sound_read); - ZetClose(); - - SN76489AInit(0, 3579545, 0); - SN76489AInit(1, 3579545, 1); - SN76489AInit(2, 3579545, 1); - SN76496SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.75, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(2, 0.75, BURN_SND_ROUTE_BOTH); - - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(0), 1); - - filter_rc_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static int DrvbInit() -{ - AllMem = NULL; - MemIndex(); - int nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x04000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 11, 1)) return 1; - - DrvGfxDecode(); - } - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvVidRAM0, 0x0000, 0x03ff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x0400, 0x07ff, MAP_RAM); - M6809MapMemory(DrvColRAM0, 0x0800, 0x0bff, MAP_RAM); - M6809MapMemory(DrvColRAM1, 0x0c00, 0x0fff, MAP_RAM); - M6809MapMemory(DrvShareRAM, 0x1000, 0x17ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(tp84b_main_write); - M6809SetReadHandler(tp84b_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvSprRAM, 0x6000, 0x67ff, MAP_RAM); - M6809MapMemory(DrvShareRAM, 0x8000, 0x87ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(tp84_sub_write); - M6809SetReadHandler(tp84_sub_read); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x4000, 0x43ff, MAP_RAM); - ZetSetWriteHandler(tp84_sound_write); - ZetSetReadHandler(tp84_sound_read); - ZetClose(); - - SN76489AInit(0, 3579545, 0); - SN76489AInit(1, 3579545, 1); - SN76489AInit(2, 3579545, 1); - SN76496SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.75, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(2, 0.75, BURN_SND_ROUTE_BOTH); - - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(0), 1); - - filter_rc_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static int DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - ZetExit(); - - SN76496Exit(); - filter_rc_exit(); - - BurnFree (AllMem); - AllMem = NULL; - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pens[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[i + 0x000] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i + 0x000] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i + 0x000] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i + 0x000] >> 3) & 0x01; - INT32 r = ((bit0 * 1424) + (bit1 * 3134) + (bit2 * 6696) + (bit3 * 14246) + 50) / 100; - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - INT32 g = ((bit0 * 1424) + (bit1 * 3134) + (bit2 * 6696) + (bit3 * 14246) + 50) / 100; - - bit0 = (DrvColPROM[i + 0x200] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x200] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x200] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x200] >> 3) & 0x01; - INT32 b = ((bit0 * 1424) + (bit1 * 3134) + (bit2 * 6696) + (bit3 * 14246) + 50) / 100; - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) - { - for (INT32 j = 0; j < 8; j++) - { - UINT8 ctabentry = ((~i & 0x100) >> 1) | (j << 4) | (DrvColPROM[i + 0x300] & 0x0f); - DrvPalette[((i & 0x100) << 3) | (j << 8) | (i & 0xff)] = pens[ctabentry]; - - DrvTransTable[((i & 0x100) << 3) | (j << 8) | (i & 0xff)] = DrvColPROM[i + 0x300] & 0x0f; - } - } -} - -static void draw_bg_layer() -{ - INT32 palbank = ((palettebank & 0x07) << 6) | ((palettebank & 0x18) << 1); - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sx -= scrollx; - if (sx < -7) sx += 256; - sy -= scrolly; - if (sy < -7) sy += 256; - - INT32 attr = DrvColRAM0[offs]; - INT32 code = DrvVidRAM0[offs] | ((attr & 0x30) << 4); - INT32 color = (attr & 0x0f) | palbank; - INT32 flipy = attr & 0x80; - INT32 flipx = attr & 0x40; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } - } - } -} - -static void draw_fg_layer() -{ - INT32 palbank = ((palettebank & 0x07) << 6) | ((palettebank & 0x18) << 1); - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - if (sx >= 16 && sx < 240) continue; - - INT32 attr = DrvColRAM1[offs]; - INT32 code = DrvVidRAM1[offs] | ((attr & 0x30) << 4); - INT32 color = (attr & 0x0f) | palbank; - INT32 flipy = attr & 0x80; - INT32 flipx = attr & 0x40; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - INT32 palbank = ((palettebank & 0x07) << 4); - - for (INT32 line = 16; line < 240; line++) - { - UINT8 *sprram = DrvSprBuf + line * 0x60; - UINT16 *dst = pTransDraw + ((line - 16) * nScreenWidth); - - for (INT32 offs = 0x5c; offs >= 0; offs -= 4) - { - INT32 sy = 240 - sprram[offs + 3]; - if (sy < (line-15) || sy > line) continue; - - INT32 sx = sprram[offs + 0]; - INT32 code = sprram[offs + 1]; - INT32 attr = sprram[offs + 2]; - INT32 color = (attr & 0x0f) | palbank | 0x80; - INT32 flipx = ~attr & 0x40; - INT32 flipy = attr & 0x80; - - { - UINT8 *gfx = DrvGfxROM1 + (code * 0x100); - color = (color << 4); - flipx = (flipx ? 0x0f : 0); - flipy = (flipy ? 0xf0 : 0); - gfx += (((line - sy) * 0x10) ^ flipy); - - for (INT32 x = 0; x < 16; x++, sx++) - { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[x^flipx]+color; - - if (DrvTransTable[pxl]) { - dst[sx] = pxl; - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - if ( nBurnLayer & 1) draw_bg_layer(); - if ( nSpriteEnable & 1) draw_sprites(); - if ( nBurnLayer & 2) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog == 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - M6809NewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 1536000 / 60, 1536000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - scanline = i; - - M6809Open(0); - INT32 nSegment = ((i + 1) * nCyclesTotal[0]) / nInterleave; - nCyclesDone[0] += M6809Run(nSegment - nCyclesDone[0]); - if (i == (nInterleave - 1)) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809Close(); - - M6809Open(1); - nSegment = ((i + 1) * nCyclesTotal[1]) / nInterleave; - nCyclesDone[1] += M6809Run(nSegment - nCyclesDone[1]); - if (i == (nInterleave - 1) && sub_irqmask) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809Close(); - - nSegment = ((i + 1) * nCyclesTotal[2]) / nInterleave; - nCyclesDone[2] += ZetRun(nSegment - nCyclesDone[2]); - - memcpy (DrvSprBuf + i * 0x60, DrvSprRAM + 0x7a0, 0x60); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - memset (pSoundBuf, 0, nSegmentLength * sizeof(INT16) * 2); - - SN76496UpdateToBuffer(0, pSoundBuffer[0], nSegmentLength); - SN76496UpdateToBuffer(1, pSoundBuffer[1], nSegmentLength); - SN76496UpdateToBuffer(2, pSoundBuffer[2], nSegmentLength); - - filter_rc_update(0, pSoundBuffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pSoundBuffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pSoundBuffer[2], pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - memset (pSoundBuf, 0, nSegmentLength * sizeof(INT16) * 2); - - SN76496UpdateToBuffer(0, pSoundBuffer[0], nSegmentLength); - SN76496UpdateToBuffer(1, pSoundBuffer[1], nSegmentLength); - SN76496UpdateToBuffer(2, pSoundBuffer[2], nSegmentLength); - - filter_rc_update(0, pSoundBuffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pSoundBuffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pSoundBuffer[2], pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - ZetScan(nAction); - - SN76496Scan(nAction, pnMin); - - SCAN_VAR(palettebank); - SCAN_VAR(flipscreenx); - SCAN_VAR(flipscreeny); - SCAN_VAR(soundlatch); - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - SCAN_VAR(sub_irqmask); - } - - return 0; -} - - -// Time Pilot '84 (set 1) - -static struct BurnRomInfo tp84RomDesc[] = { - { "388_f04.7j", 0x2000, 0x605f61c7, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "388_05.8j", 0x2000, 0x4b4629a4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "388_f06.9j", 0x2000, 0xdbd5333b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "388_07.10j", 0x2000, 0xa45237c4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "388_f08.10d", 0x2000, 0x36462ff1, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - - { "388j13.6a", 0x2000, 0xc44414da, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "388_h02.2j", 0x2000, 0x05c7508f, 4 | BRF_GRA }, // 6 Characters - { "388_d01.1j", 0x2000, 0x498d90b7, 4 | BRF_GRA }, // 7 - - { "388_e09.12a", 0x2000, 0xcd682f30, 5 | BRF_GRA }, // 8 Sprites - { "388_e10.13a", 0x2000, 0x888d4bd6, 5 | BRF_GRA }, // 9 - { "388_e11.14a", 0x2000, 0x9a220b39, 5 | BRF_GRA }, // 10 - { "388_e12.15a", 0x2000, 0xfac98397, 5 | BRF_GRA }, // 11 - - { "388d14.2c", 0x0100, 0xd737eaba, 6 | BRF_GRA }, // 12 Color PROMs - { "388d15.2d", 0x0100, 0x2f6a9a2a, 6 | BRF_GRA }, // 13 - { "388d16.1e", 0x0100, 0x2e21329b, 6 | BRF_GRA }, // 14 - { "388d18.1f", 0x0100, 0x61d2d398, 6 | BRF_GRA }, // 15 - { "388j17.16c", 0x0100, 0x13c4e198, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(tp84) -STD_ROM_FN(tp84) - -struct BurnDriver BurnDrvTp84 = { - "tp84", NULL, NULL, NULL, "1984", - "Time Pilot '84 (set 1)\0", NULL, "Konami", "GX388", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, tp84RomInfo, tp84RomName, NULL, NULL, Tp84InputInfo, Tp84DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; - - -// Time Pilot '84 (set 2) - -static struct BurnRomInfo tp84aRomDesc[] = { - { "388_f04.7j", 0x2000, 0x605f61c7, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "388_f05.8j", 0x2000, 0xe97d5093, 1 | BRF_PRG | BRF_ESS }, // 1 - { "388_f06.9j", 0x2000, 0xdbd5333b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "388_f07.10j", 0x2000, 0x8fbdb4ef, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "388_f08.10d", 0x2000, 0x36462ff1, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - - { "388j13.6a", 0x2000, 0xc44414da, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "388_h02.2j", 0x2000, 0x05c7508f, 4 | BRF_GRA }, // 6 Characters - { "388_d01.1j", 0x2000, 0x498d90b7, 4 | BRF_GRA }, // 7 - - { "388_e09.12a", 0x2000, 0xcd682f30, 5 | BRF_GRA }, // 8 Sprites - { "388_e10.13a", 0x2000, 0x888d4bd6, 5 | BRF_GRA }, // 9 - { "388_e11.14a", 0x2000, 0x9a220b39, 5 | BRF_GRA }, // 10 - { "388_e12.15a", 0x2000, 0xfac98397, 5 | BRF_GRA }, // 11 - - { "388d14.2c", 0x0100, 0xd737eaba, 6 | BRF_GRA }, // 12 Color PROMs - { "388d15.2d", 0x0100, 0x2f6a9a2a, 6 | BRF_GRA }, // 13 - { "388d16.1e", 0x0100, 0x2e21329b, 6 | BRF_GRA }, // 14 - { "388d18.1f", 0x0100, 0x61d2d398, 6 | BRF_GRA }, // 15 - { "388d17.16c", 0x0100, 0xaf8f839c, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(tp84a) -STD_ROM_FN(tp84a) - -struct BurnDriver BurnDrvTp84a = { - "tp84a", "tp84", NULL, NULL, "1984", - "Time Pilot '84 (set 2)\0", NULL, "Konami", "GX388", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, tp84aRomInfo, tp84aRomName, NULL, NULL, Tp84InputInfo, Tp84aDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; - - -// Time Pilot '84 (set 3) - -static struct BurnRomInfo tp84bRomDesc[] = { - { "388j05.8j", 0x4000, 0xa59e2fda, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "388j07.10j", 0x4000, 0xd25d18e6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "388j08.10d", 0x2000, 0x2aea6b42, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 #1 Code - - { "388j13.6a", 0x2000, 0xc44414da, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "388j02.2j", 0x4000, 0xe1225f53, 4 | BRF_GRA }, // 4 Characters - - { "388j09.12a", 0x4000, 0xaec90936, 5 | BRF_GRA }, // 5 Sprites - { "388j11.14a", 0x4000, 0x29257f03, 5 | BRF_GRA }, // 6 - - { "388j14.2c", 0x0100, 0xd737eaba, 6 | BRF_GRA }, // 7 Color PROMs - { "388j15.2d", 0x0100, 0x2f6a9a2a, 6 | BRF_GRA }, // 8 - { "388j16.1e", 0x0100, 0x2e21329b, 6 | BRF_GRA }, // 9 - { "388j18.1f", 0x0100, 0x61d2d398, 6 | BRF_GRA }, // 10 - { "388j17.16c", 0x0100, 0x13c4e198, 6 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(tp84b) -STD_ROM_FN(tp84b) - -struct BurnDriver BurnDrvTp84b = { - "tp84b", "tp84", NULL, NULL, "1984", - "Time Pilot '84 (set 3)\0", NULL, "Konami", "GX388", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VERSHOOT, 0, - NULL, tp84bRomInfo, tp84bRomName, NULL, NULL, Tp84InputInfo, Tp84DIPInfo, - DrvbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_trackfld.cpp b/jan/src/burn/drv/konami/d_trackfld.cpp deleted file mode 100644 index 3989df365..000000000 --- a/jan/src/burn/drv/konami/d_trackfld.cpp +++ /dev/null @@ -1,2328 +0,0 @@ -// FB Alpha Track & Field driver module -// Based on MAME driver by Chris Hardy. - -// To fix / Oddities: -// Watchdog timer doesn't get reset by Mastkin -// Wizz Quiz needs some work. - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "m6800_intf.h" -#include "z80_intf.h" -#include "bitswap.h" -#include "vlm5030.h" -#include "sn76496.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvM6809ROMDec; -static UINT8 *DrvQuizROM; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvM6800RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 bg_bank; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 irq_mask; -static UINT8 nmi_mask; -static UINT16 last_addr; -static UINT8 last_sound_irq; -static UINT8 SN76496_latch; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 watchdog; -static INT32 nowatchdog = 0; -static INT32 game_select; -static INT32 nSpriteMask, nCharMask; - -static struct BurnInputInfo TrackfldInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 3"}, - - {"P3 Start", BIT_DIGITAL, DrvJoy2 + 3, "p3 start"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 2, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 0, "p3 fire 3"}, - - {"P4 Start", BIT_DIGITAL, DrvJoy3 + 3, "p4 start"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy3 + 6, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, DrvJoy3 + 4, "p4 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Trackfld) - -static struct BurnInputInfo YieartfInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Yieartf) - -static struct BurnInputInfo ReaktorInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Reaktor) - -static struct BurnInputInfo WizzquizInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 4"}, - {"P1 Button 5", BIT_DIGITAL, DrvJoy3 + 3, "p1 fire 5"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Wizzquiz) - -static struct BurnInputInfo MastkinInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Mastkin) - -static struct BurnDIPInfo TrackfldDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x59, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x15, 0x01, 0x01, 0x01, "1" }, - {0x15, 0x01, 0x01, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "After Last Event" }, - {0x15, 0x01, 0x02, 0x02, "Game Over" }, - {0x15, 0x01, 0x02, 0x00, "Game Continues" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x04, 0x00, "Upright" }, - {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x15, 0x01, 0x08, 0x08, "None" }, - {0x15, 0x01, 0x08, 0x00, "100000" }, - - {0 , 0xfe, 0 , 2, "World Records" }, - {0x15, 0x01, 0x10, 0x10, "Don't Erase" }, - {0x15, 0x01, 0x10, 0x00, "Erase on Reset" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Trackfld) - -static struct BurnDIPInfo YieartfDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x5b, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x01, "3" }, - {0x13, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x13, 0x01, 0x08, 0x08, "30000 80000" }, - {0x13, 0x01, 0x08, 0x00, "40000 90000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x30, "Easy" }, - {0x13, 0x01, 0x30, 0x10, "Normal" }, - {0x13, 0x01, 0x30, 0x20, "Difficult" }, - {0x13, 0x01, 0x30, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 0, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x14, 0x01, 0x02, 0x02, "Single" }, - {0x14, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Yieartf) - -static struct BurnDIPInfo ReaktorDIPList[]= -{ - {0x09, 0xff, 0xff, 0xbf, NULL }, - {0x0a, 0xff, 0xff, 0xef, NULL }, - - {0 , 0xfe, 0 , 2, "Pricing" }, - {0x09, 0x01, 0x01, 0x01, "10p / 25c per play" }, - {0x09, 0x01, 0x01, 0x00, "20p / 50c per play" }, - - {0 , 0xfe, 0 , 2, "Coinage Type" }, - {0x09, 0x01, 0x10, 0x10, "English (10p / 20p)" }, - {0x09, 0x01, 0x10, 0x00, "American (25c / 50c)" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x09, 0x01, 0x60, 0x60, "2" }, - {0x09, 0x01, 0x60, 0x40, "3" }, - {0x09, 0x01, 0x60, 0x20, "4" }, - {0x09, 0x01, 0x60, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x09, 0x01, 0x80, 0x80, "20000" }, - {0x09, 0x01, 0x80, 0x00, "30000" }, - - {0 , 0xfe, 0 , 2, "Game Orientation" }, - {0x0a, 0x01, 0x01, 0x01, "For Vertical Monitor" }, - {0x0a, 0x01, 0x01, 0x00, "For Horizontal Monitor" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0a, 0x01, 0x08, 0x08, "Off" }, - {0x0a, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Wipe Highscores" }, - {0x0a, 0x01, 0x10, 0x00, "Off" }, - {0x0a, 0x01, 0x10, 0x10, "On" }, -}; - -STDDIPINFO(Reaktor) - -static struct BurnDIPInfo WizzquizDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 17, "Coin A" }, - {0x0e, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x0e, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x0e, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x0e, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x0e, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x0e, 0x01, 0x0f, 0x00, "Free Play" }, - {0x0e, 0x01, 0x0f, 0x00, "No Coin A" }, - - {0 , 0xfe, 0 , 17, "Coin B" }, - {0x0e, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x0e, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x0e, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x0e, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x0e, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x0e, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x0e, 0x01, 0xf0, 0x00, "Free Play" }, - {0x0e, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x03, 0x03, "3" }, - {0x0f, 0x01, 0x03, 0x02, "4" }, - {0x0f, 0x01, 0x03, 0x01, "5" }, - {0x0f, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x0f, 0x01, 0x04, 0x00, "8,000 Points" }, - {0x0f, 0x01, 0x04, 0x04, "10,000 Points" }, - - {0 , 0xfe, 0 , 0, "Show Correct Answer" }, - {0x0f, 0x01, 0x40, 0x40, "No" }, - {0x0f, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 0, "Credit Limit" }, - {0x0f, 0x01, 0x80, 0x80, "99 Credits" }, - {0x0f, 0x01, 0x80, 0x00, "9 Credits" }, -}; - -STDDIPINFO(Wizzquiz) - -static struct BurnDIPInfo MastkinDIPList[]= -{ - {0x09, 0xff, 0xff, 0xD6, NULL }, - {0x0a, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x09, 0x01, 0x01, 0x01, "Off" }, - {0x09, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Timer Speed" }, - {0x09, 0x01, 0x02, 0x02, "Normal" }, - {0x09, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x09, 0x01, 0x0c, 0x0c, "Easy" }, - {0x09, 0x01, 0x0c, 0x04, "Normal" }, - {0x09, 0x01, 0x0c, 0x08, "Hard" }, - {0x09, 0x01, 0x0c, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x09, 0x01, 0x10, 0x10, "4" }, - {0x09, 0x01, 0x10, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Internal speed" }, - {0x09, 0x01, 0x20, 0x20, "Slow" }, - {0x09, 0x01, 0x20, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 0, "Coin B" }, - {0x0a, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x05, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x06, "2 Coins 2 Credits" }, - {0x0a, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x0a, 0x01, 0x0f, 0x08, "2 Coins 4 Credits" }, - {0x0a, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x0a, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x0a, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x0a, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x0a, 0x01, 0xf0, 0x50, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0xf0, 0x60, "2 Coins 2 Credits" }, - {0x0a, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x0a, 0x01, 0xf0, 0x80, "2 Coins 4 Credits" }, - {0x0a, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x0a, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, -}; - -STDDIPINFO(Mastkin) - -static void trackfld_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc80) == 0x1000) address &= ~0x7; - if ((address & 0xff00) == 0x1200) address &= ~0x4; - - switch (address & ~0x78) - { - case 0x1000: - watchdog = 0; - return; - - case 0x1080: - case 0x10b0: - flipscreen = data; //? - return; - - case 0x1081: - case 0x10b1: - { - if (last_sound_irq == 0 && data) - { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - - last_sound_irq = data; - } - return; - - case 0x1082: - nmi_mask = data & 0x01; - return; - - case 0x1083: - case 0x1084: - case 0x10b3: - case 0x10b4: - // coin counter - return; - - case 0x1085: - case 0x1086: - return; // nop - - case 0x1087: - case 0x10b7: - irq_mask = data & 0x01; - return; - - case 0x1100: - soundlatch = data; - return; - } -} - -static UINT8 trackfld_main_read(UINT16 address) -{ - //if ((address & 0xfc80) == 0x1080) address &= ~0x7f; - //if ((address & 0xffff) == 0x1200) address &= ~0x7c; - - switch (address) - { - case 0x0000: // yieartf - return (vlm5030_bsy(0) ? 1 : 0); - - case 0x1080: // flipscreen_w; - return 0; - - case 0x1200: - return DrvDips[1]; - - case 0x1280: - return DrvInputs[0]; - - case 0x1281: - return DrvInputs[1]; - - case 0x1282: - return DrvInputs[2]; - - case 0x1283: - return DrvDips[0]; - - case 0x1300: // yieartf - return DrvDips[2]; - } - //bprintf(0, _T("mr %X. "), address); - return 0; -} - -static void yieartf_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0000: - SN76496_latch = data; - return; - - case 0x0001: - SN76496Write(0, SN76496_latch); - return; - - case 0x0002: - { - vlm5030_st(0, (data >> 1) & 1); - vlm5030_rst(0, (data >> 2) & 1); - } - return; - - case 0x0003: - vlm5030_data_write(0, data); - return; - - case 0x1100: - return; // no soundlatch - } - - trackfld_main_write(address, data); -} - -static void __fastcall reaktor_main_write(UINT16 address, UINT8 data) -{ - if (address == 0x9081) - { - if (last_sound_irq == 0 && data) - { - ZetClose(); - ZetOpen(1); - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetRun(100); - ZetSetIRQLine(0,CPU_IRQSTATUS_NONE); - ZetClose(); - ZetOpen(0); - } - last_sound_irq = data; - return; - } - - if (address == 0x9100) { - soundlatch = data; - return; - } - - if ((address & 0xfc00) == 0x9000) { - trackfld_main_write(address - 0x8000, data); - return; - } - - //bprintf (0, _T("wb %4.4x, %2.2x\n"), address, data); -} - -static UINT8 __fastcall reaktor_main_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x9000) { - return trackfld_main_read(address - 0x8000); - } - -// bprintf (0, _T("rb %4.4x\n"), address); - return 0; -} - -static void wizzquiz_bank(UINT8 data) -{ - for (INT32 i = 0; i < 8; i++) - { - if ((data & (1 << i)) == 0) - { - M6800MapMemory(DrvQuizROM + (i * 0x8000), 0x6000, 0xdfff, MAP_ROM); - return; - } - } -} - -static void wizzquiz_main_write(UINT16 address, UINT8 data) -{ -// if (address != 0x1000) -// bprintf (0, _T("%4.4x, %2.2x\n"), address, data); - -// if (address < 0x80) { -// DrvM6800RAM[address] = data; -// return; -// } - - switch (address) - { - case 0xc000: - wizzquiz_bank(data); - return; - } - - trackfld_main_write(address, data); -} - -static UINT8 wizzquiz_main_read(UINT16 address) -{ -// if (address != 0x1000) bprintf (0, _T("rb %4.4x\n"), address); - -// if (address < 0x80) { -// return DrvM6800RAM[address]; -// } - - switch (address) - { - case 0x1000: - watchdog = 0; - return 0; - } - - return trackfld_main_read(address); -} - - -static void __fastcall trackfld_sound_write(UINT16 address, UINT8 data) -{ - UINT16 unmasked = address; - if (address < 0xe000) address &= ~0x1fff; - if (address > 0xe000) address &= ~0x1ff8; - - switch (address) - { - case 0xa000: - SN76496_latch = data; - return; - - case 0xc000: - SN76496Write(0, SN76496_latch); - return; - - case 0xe000: - DACWrite(0, data); - return; - - case 0xe003: - { - INT32 addr = (unmasked & 0x380) ^ last_addr; - - if (addr & 0x100) vlm5030_st(0, (unmasked & 0x100) >> 8); - if (addr & 0x200) vlm5030_rst(0, (unmasked & 0x200) >> 9); - last_addr = unmasked & 0x380; - } - return; - - case 0xe004: - vlm5030_data_write(0, data); - return; - } -} - -static UINT8 __fastcall trackfld_sound_read(UINT16 address) -{ - if (address < 0xe000) address &= ~0x1fff; - if (address > 0xe000) address &= ~0x1ff8; - - switch (address) - { - case 0x6000: - return soundlatch; - - case 0x8000: - return (ZetTotalCycles() / 1024) & 0xf; - - case 0xc000: - SN76496Write(0, SN76496_latch); - return 0xff; - - case 0xe001: - return 0; // nop - - case 0xe002: - return (vlm5030_bsy(0) ? 0x10 : 0); - } - - return 0; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3579545.000 / (nBurnFPS / 100.000)))); -} - -static UINT32 DrvVLM5030Sync(INT32 samples_rate) -{ - return (samples_rate * ZetTotalCycles()) / (3579545 / 60); -} - -static UINT32 DrvVLM5030Sync2(INT32 samples_rate) -{ - return (samples_rate * M6809TotalCycles()) / (1536000 / 60); -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - if (game_select == 4) { - // M6800Open(0); - M6800Reset(); - wizzquiz_bank(0); - // M6800Close(); - } - - if (game_select == 3) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } - - if (game_select == 1 || game_select == 2) { - M6809Open(0); - M6809Reset(); - M6809Close(); - } - - if (game_select == 1 || game_select == 3 || game_select == 4) { - ZetOpen(1); - ZetReset(); - vlm5030Reset(0); - SN76496Reset(); - DACReset(); - ZetClose(); - } - - if (game_select == 2) { - vlm5030Reset(0); - SN76496Reset(); - } - - bg_bank = 0; - soundlatch = 0; - flipscreen = 0; - irq_mask = 0; - nmi_mask = 0; - last_addr = 0; - last_sound_irq = 0; - SN76496_latch = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; - DrvM6809ROM = Next; Next += 0x010000; - DrvM6809ROMDec = Next; Next += 0x010000; - - DrvQuizROM = Next; Next += 0x040000; - - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000220; - - DrvSndROM = Next; Next += 0x002000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvNVRAM = Next; Next += 0x000800; - DrvM6800RAM = Next; Next += 0x000100; - DrvSprRAM0 = Next; Next += 0x000400; - DrvSprRAM1 = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - DrvZ80RAM0 = Next; Next += 0x000c00; - DrvZ80RAM1 = Next; Next += 0x000400; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() // 0, 100 -{ - INT32 Plane1[4] = { STEP4(0,1) }; - INT32 XOffs1[8] = { STEP8(0,4) }; - INT32 YOffs1[8] = { STEP8(0,32) }; - - INT32 Plane0[4] = { (0x8000*8)+4, (0x8000*8), 4, 0 }; - INT32 XOffs0[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs0[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x10000); - - GfxDecode(0x0200, 4, 16, 16, Plane0, XOffs0, YOffs0, 0x200, tmp, DrvGfxROM0); - - memset (tmp, 0, 0x10000); - memcpy (tmp, DrvGfxROM1, 0x8000); - - GfxDecode(0x0400, 4, 8, 8, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static void M6809Decode() -{ - for (INT32 i = 0x6000; i < 0x10000; i++) { - DrvM6809ROMDec[i] = DrvM6809ROM[i] ^ (((i&2)?0x80:0x20)|((i&8)?0x08:0x02)); - } -} - -static void CommonSoundInit() -{ - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x3fff, MAP_ROM); - for (INT32 i = 0; i < 0x2000; i+=0x400) { - ZetMapMemory(DrvZ80RAM1, 0x4000+i, 0x43ff+i, MAP_RAM); - } - ZetSetWriteHandler(trackfld_sound_write); - ZetSetReadHandler(trackfld_sound_read); - ZetClose(); - - vlm5030Init(0, 3579545, DrvVLM5030Sync, DrvSndROM, 0x2000, 0); - vlm5030SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - SN76496Init(0, 1789772, 1); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); -} - -static INT32 DrvInit() -{ - game_select = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x6000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x8000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xa000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xc000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xe000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xa000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 15, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000, 16, 1)) return 1; - - DrvGfxDecode(); - M6809Decode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvSprRAM1, 0x1800, 0x1bff, MAP_RAM); - // spr2 00-3f, scroll 40-5f - M6809MapMemory(DrvSprRAM0, 0x1c00, 0x1fff, MAP_RAM); - // spr 00-3f, scroll 40-5f - M6809MapMemory(DrvNVRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x6000, 0x6000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809ROMDec + 0x6000, 0x6000, 0xffff, MAP_FETCH); - M6809SetWriteHandler(trackfld_main_write); - M6809SetReadHandler(trackfld_main_read); - M6809Close(); - - ZetInit(0); // reaktor - CommonSoundInit(); - - nSpriteMask = 0xff; - nCharMask = 0x3ff; - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static void TrackfldnzDecode() -{ - for (INT32 i = 0x6000; i < 0x10000; i++) - DrvM6809ROM[i] = BITSWAP08(DrvM6809ROM[i], 6, 7, 5, 4, 3, 2, 1, 0); -} - -static INT32 TrackfldnzInit() -{ - game_select = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x6000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x8000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xa000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xc000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xe000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xa000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 15, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000, 16, 1)) return 1; - - DrvGfxDecode(); - TrackfldnzDecode(); // before M6809Decode - M6809Decode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvSprRAM1, 0x1800, 0x1bff, MAP_RAM); - // spr2 00-3f, scroll 40-5f - M6809MapMemory(DrvSprRAM0, 0x1c00, 0x1fff, MAP_RAM); - // spr 00-3f, scroll 40-5f - M6809MapMemory(DrvNVRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x6000, 0x6000, 0xffff, MAP_READ); - M6809MapMemory(DrvM6809ROMDec + 0x6000, 0x6000, 0xffff, MAP_FETCH); - M6809SetWriteHandler(trackfld_main_write); - M6809SetReadHandler(trackfld_main_read); - M6809Close(); - - ZetInit(0); // reaktor - CommonSoundInit(); - - nSpriteMask = 0xff; - nCharMask = 0x3ff; - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 YieartfInit() -{ - game_select = 2; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x8000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xa000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xc000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xe000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xc000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 12, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000, 13, 1)) return 1; - - DrvGfxDecode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvSprRAM1, 0x1800, 0x1bff, MAP_RAM); - // spr2 00-3f, scroll 40-5f - M6809MapMemory(DrvSprRAM0, 0x1c00, 0x1fff, MAP_RAM); - // spr 00-3f, scroll 40-5f - M6809MapMemory(DrvNVRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x6000, 0x6000, 0xffff, MAP_ROM); - M6809SetWriteHandler(yieartf_main_write); - M6809SetReadHandler(trackfld_main_read); - M6809Close(); - - vlm5030Init(0, 3579545, DrvVLM5030Sync2, DrvSndROM, 0x2000, 1); - vlm5030SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - SN76496Init(0, 1536000, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - nSpriteMask = 0x1ff; - nCharMask = 0x1ff; - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 ReaktorInit() -{ - game_select = 3; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 1, 1)) return 1; - memmove(DrvZ80ROM1, DrvZ80ROM1 + 0x2000, 0x2000); - memset(DrvZ80ROM1 + 0x2000, 0, 0x2000); - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - - if (BurnLoadRom(tmp + 0x0000, 2, 1)) return 1; - memcpy (DrvGfxROM0 + 0x0000, tmp + 0x2000, 0x2000); - if (BurnLoadRom(tmp + 0x0000, 3, 1)) return 1; - memcpy (DrvGfxROM0 + 0x8000, tmp + 0x2000, 0x2000); - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 4, 1)) return 1; - if (BurnLoadRom(tmp + 0x0000, 5, 1)) return 1; - memcpy (DrvGfxROM0 + 0xa000, tmp + 0x2000, 0x2000); - - BurnFree(tmp); - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000, 12, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSprRAM1, 0x9800, 0x9bff, MAP_RAM); - ZetMapMemory(DrvSprRAM0, 0x9c00, 0x9fff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xa800, 0xabff, MAP_RAM); - ZetMapMemory(DrvNVRAM, 0xac00, 0xafff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xb000, 0xb7ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0xb800, 0xbfff, MAP_RAM); - ZetSetWriteHandler(reaktor_main_write); - ZetSetReadHandler(reaktor_main_read); - ZetClose(); - - CommonSoundInit(); - - nSpriteMask = 0xff; - nCharMask = 0x3ff; - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static void wizzquizSwap(UINT8 *rom) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - - memcpy (tmp + 0x2000, rom + 0x0000, 0x6000); - memcpy (tmp + 0x0000, rom + 0x6000, 0x2000); - - BurnFree(tmp); -} - -static void wizzquizDecode(UINT8 *rom, INT32 len) -{ - for (INT32 i = 0; i < len; i++) - rom[i] = BITSWAP08(rom[i],0,1,2,3,4,5,6,7); -} - -static INT32 WizzquizInit() -{ - game_select = 4; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x0000, 0, 1)) return 1; - - if (BurnLoadRom(DrvQuizROM + 0x00000, 1, 1)) return 1; - if (BurnLoadRom(DrvQuizROM + 0x08000, 2, 1)) return 1; - if (BurnLoadRom(DrvQuizROM + 0x10000, 3, 1)) return 1; - if (BurnLoadRom(DrvQuizROM + 0x18000, 4, 1)) return 1; - if (BurnLoadRom(DrvQuizROM + 0x20000, 5, 1)) return 1; - if (BurnLoadRom(DrvQuizROM + 0x28000, 6, 1)) return 1; - if (BurnLoadRom(DrvQuizROM + 0x30000, 7, 1)) return 1; - if (BurnLoadRom(DrvQuizROM + 0x38000, 8, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 14, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 17, 1)) return 1; - - wizzquizDecode(DrvM6809ROM, 0x02000); - for (INT32 i = 0; i < 8; i++) { - wizzquizDecode(DrvQuizROM + i * 0x8000, 0x8000); - wizzquizSwap(DrvQuizROM + i * 0x8000); - } - - DrvGfxDecode(); - } - - M6800Init(1); -// M6800Open(0); - M6800MapMemory(DrvM6800RAM, 0x0000, 0x00ff, MAP_RAM); - M6800MapMemory(DrvSprRAM1, 0x1800, 0x1bff, MAP_RAM); - M6800MapMemory(DrvSprRAM0, 0x1c00, 0x1fff, MAP_RAM); - M6800MapMemory(DrvZ80ROM0, 0x2800, 0x2bff, MAP_RAM); - M6800MapMemory(DrvNVRAM, 0x2c00, 0x2fff, MAP_RAM); - M6800MapMemory(DrvVidRAM, 0x3000, 0x37ff, MAP_RAM); - M6800MapMemory(DrvColRAM, 0x3800, 0x3fff, MAP_RAM); - M6800MapMemory(DrvM6809ROM, 0xe000, 0xffff, MAP_ROM); - M6800SetWriteHandler(wizzquiz_main_write); - M6800SetReadHandler(wizzquiz_main_read); -// M6800Close(); - - ZetInit(0); // reaktor - - CommonSoundInit(); - - nSpriteMask = 0x7f; - nCharMask = 0x3ff; - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static void MastkinPaletteCreate() -{ - for (INT32 i = 0; i < 0x20; i++) - { - DrvColPROM[i] = i * 4; - } - - for (INT32 i = 0; i < 0x200; i++) - { - DrvColPROM[i + 0x20] = (i & 0x0f) ? ((i + i / 16) & 0x0f) : 0; - } -} - -static INT32 MastkinInit() -{ - game_select = 1; - nowatchdog = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x8000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xa000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0xe000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xa000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 10, 1)) return 1; - -#if 0 - if (BurnLoadRom(DrvColPROM + 0x0000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 13, 1)) return 1; -#endif - - if (BurnLoadRom(DrvSndROM + 0x0000, 14, 1)) return 1; - - MastkinPaletteCreate(); - DrvGfxDecode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvSprRAM1, 0x1800, 0x1bff, MAP_RAM); - // spr2 00-3f, scroll 40-5f - M6809MapMemory(DrvSprRAM0, 0x1c00, 0x1fff, MAP_RAM); - // spr 00-3f, scroll 40-5f - M6809MapMemory(DrvZ80RAM0, 0x2000, 0x2bff, MAP_RAM); - M6809MapMemory(DrvNVRAM, 0x2c00, 0x2fff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x3800, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x6000, 0x6000, 0xffff, MAP_ROM); - M6809SetWriteHandler(trackfld_main_write); - M6809SetReadHandler(trackfld_main_read); - M6809Close(); - - ZetInit(0); // reaktor - CommonSoundInit(); - - nSpriteMask = 0xff; - nCharMask = 0x3ff; - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - - -static INT32 DrvExit() -{ - GenericTilesExit(); - - if (game_select == 4) M6800Exit(); - if (game_select == 1 || game_select == 2) M6809Exit(); - if (game_select == 1 || game_select == 3) ZetExit(); - - vlm5030Exit(); - if (game_select == 1 || game_select == 3) DACExit(); - SN76496Exit(); - - nowatchdog = 0; - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 tab[0x20]; - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = bit0 * 33 + bit1 * 71 + bit2 * 151; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = bit0 * 33 + bit1 * 71 + bit2 * 151; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = bit0 * 81 + bit1 * 174; - - tab[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x100; i++) - { - DrvPalette[0x000 + i] = tab[(DrvColPROM[i + 0x020] & 0x0f) | 0x00]; - DrvPalette[0x100 + i] = tab[(DrvColPROM[i + 0x120] & 0x0f) | 0x10]; - } -} - -static void draw_layers() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sy -= 16; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + (((attr & 0xc0) << 2) | (bg_bank ? 0x400 : 0)); - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - - code &= nCharMask; - - sx -= DrvSprRAM1[0x40+(sy/8)+2] + ((DrvSprRAM0[0x40+(sy/8)+2] & 1) * 256); - if (sx < -7) sx += 512; - - if (flipx) { - if (flipy) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM1); - } - } else { - if (flipy) { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM1); - } - } - } -} - -static void draw_single_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x40 - 2; offs >= 0; offs -= 2) - { - INT32 attr = DrvSprRAM1[offs]; - INT32 code = DrvSprRAM0[offs + 1]; - INT32 color = attr & 0x0f; - if (game_select == 2 && (attr & 1)) code |= 0x100; // yiear - // code += m_sprite_bank1 + m_sprite_bank2; // atlantol - code &= nSpriteMask; - INT32 flipx = ~attr & 0x40; - INT32 flipy = attr & 0x80; - INT32 sx = DrvSprRAM0[offs] - 1; - INT32 sy = 240 - DrvSprRAM1[offs + 1]; - - sy -= 16; - - if (flipscreen) - { - sy = 240 - sy; - flipy = !flipy; - } - - draw_single_sprite(code, color, sx , sy + 1, flipx, flipy); - draw_single_sprite(code, color, sx - 256, sy + 1, flipx, flipy); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 1; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layers(); - if (nBurnLayer & 2) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 120 && !nowatchdog) { - bprintf(0, _T("Watchdog tripped.\n")); - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - M6809NewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 1536000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - M6809Open(0); - ZetOpen(1); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - - if (i == (nInterleave-1) && irq_mask) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - } - - if (pBurnSoundOut) { - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 YieartfFrame() -{ - watchdog++; - if (watchdog >= 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 1536000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - - if ((i & 0xff) == 0xff && irq_mask) M6809SetIRQLine(0x00, CPU_IRQSTATUS_AUTO); - if ((i & 0x1f) == 0x1f && nmi_mask) M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - } - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 ReaktorFrame() -{ - watchdog++; - if (watchdog >= 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 3072000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave-1) && irq_mask) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - ZetClose(); - - } - - ZetOpen(1); - - if (pBurnSoundOut) { - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 WizzquizFrame() -{ - watchdog++; - if (watchdog >= 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - M6800NewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 2048000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - -// M6800Open(0); - ZetOpen(1); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6800Run(nCyclesTotal[0] / nInterleave); - - if (i == 239 && irq_mask) M6800SetIRQLine(M6800_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - } - - if (pBurnSoundOut) { - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); -// M6800Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - if (game_select == 4) M6800Scan(nAction); - if (game_select == 1 || game_select == 2) M6809Scan(nAction); - if (game_select == 1 || game_select == 3) ZetScan(nAction); - if (game_select == 1 || game_select == 3) DACScan(nAction, pnMin); - - SN76496Scan(nAction, pnMin); - vlm5030Scan(nAction); - - SCAN_VAR(watchdog); - SCAN_VAR(bg_bank); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(irq_mask); - SCAN_VAR(nmi_mask); - SCAN_VAR(last_addr); - SCAN_VAR(last_sound_irq); - SCAN_VAR(SN76496_latch); - } - - return 0; -} - - -// Track & Field - -static struct BurnRomInfo trackfldRomDesc[] = { - { "a01_e01.bin", 0x2000, 0x2882f6d4, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "a02_e02.bin", 0x2000, 0x1743b5ee, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a03_k03.bin", 0x2000, 0x6c0d1ee9, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a04_e04.bin", 0x2000, 0x21d6c448, 1 | BRF_PRG | BRF_ESS }, // 3 - { "a05_e05.bin", 0x2000, 0xf08c7b7e, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "c2_d13.bin", 0x2000, 0x95bf79b6, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "c11_d06.bin", 0x2000, 0x82e2185a, 3 | BRF_GRA }, // 6 gfx1 - { "c12_d07.bin", 0x2000, 0x800ff1f1, 3 | BRF_GRA }, // 7 - { "c13_d08.bin", 0x2000, 0xd9faf183, 3 | BRF_GRA }, // 8 - { "c14_d09.bin", 0x2000, 0x5886c802, 3 | BRF_GRA }, // 9 - - { "h16_e12.bin", 0x2000, 0x50075768, 4 | BRF_GRA }, // 10 gfx2 - { "h15_e11.bin", 0x2000, 0xdda9e29f, 4 | BRF_GRA }, // 11 - { "h14_e10.bin", 0x2000, 0xc2166a5c, 4 | BRF_GRA }, // 12 - - { "361b16.f1", 0x0020, 0xd55f30b5, 5 | BRF_GRA }, // 13 proms - { "361b17.b16", 0x0100, 0xd2ba4d32, 5 | BRF_GRA }, // 14 - { "361b18.e15", 0x0100, 0x053e5861, 5 | BRF_GRA }, // 15 - - { "c9_d15.bin", 0x2000, 0xf546a56b, 6 | BRF_GRA }, // 16 vlm -}; - -STD_ROM_PICK(trackfld) -STD_ROM_FN(trackfld) - -struct BurnDriver BurnDrvTrackfld = { - "trackfld", NULL, NULL, NULL, "1983", - "Track & Field\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, trackfldRomInfo, trackfldRomName, NULL, NULL, TrackfldInputInfo, TrackfldDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Track & Field (Centuri) - -static struct BurnRomInfo trackfldcRomDesc[] = { - { "f01.1a", 0x2000, 0x4e32b360, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "f02.2a", 0x2000, 0x4e7ebf07, 1 | BRF_PRG | BRF_ESS }, // 1 - { "l03.3a", 0x2000, 0xfef4c0ea, 1 | BRF_PRG | BRF_ESS }, // 2 - { "f04.4a", 0x2000, 0x73940f2d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "f05.5a", 0x2000, 0x363fd761, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "c2_d13.bin", 0x2000, 0x95bf79b6, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "c11_d06.bin", 0x2000, 0x82e2185a, 3 | BRF_GRA }, // 6 gfx1 - { "c12_d07.bin", 0x2000, 0x800ff1f1, 3 | BRF_GRA }, // 7 - { "c13_d08.bin", 0x2000, 0xd9faf183, 3 | BRF_GRA }, // 8 - { "c14_d09.bin", 0x2000, 0x5886c802, 3 | BRF_GRA }, // 9 - - { "h16_e12.bin", 0x2000, 0x50075768, 4 | BRF_GRA }, // 10 gfx2 - { "h15_e11.bin", 0x2000, 0xdda9e29f, 4 | BRF_GRA }, // 11 - { "h14_e10.bin", 0x2000, 0xc2166a5c, 4 | BRF_GRA }, // 12 - - { "361b16.f1", 0x0020, 0xd55f30b5, 5 | BRF_GRA }, // 13 proms - { "361b17.b16", 0x0100, 0xd2ba4d32, 5 | BRF_GRA }, // 14 - { "361b18.e15", 0x0100, 0x053e5861, 5 | BRF_GRA }, // 15 - - { "c9_d15.bin", 0x2000, 0xf546a56b, 6 | BRF_GRA }, // 16 vlm -}; - -STD_ROM_PICK(trackfldc) -STD_ROM_FN(trackfldc) - -struct BurnDriver BurnDrvTrackfldc = { - "trackfldc", "trackfld", NULL, NULL, "1983", - "Track & Field (Centuri)\0", NULL, "Konami (Centuri license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, trackfldcRomInfo, trackfldcRomName, NULL, NULL, TrackfldInputInfo, TrackfldDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Hyper Olympic - -static struct BurnRomInfo hyprolymRomDesc[] = { - { "361-d01.a01", 0x2000, 0x82257fb7, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "361-d02.a02", 0x2000, 0x15b83099, 1 | BRF_PRG | BRF_ESS }, // 1 - { "361-d03.a03", 0x2000, 0xe54cc960, 1 | BRF_PRG | BRF_ESS }, // 2 - { "361-d04.a04", 0x2000, 0xd099b1e8, 1 | BRF_PRG | BRF_ESS }, // 3 - { "361-d05.a05", 0x2000, 0x974ff815, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "c2_d13.bin", 0x2000, 0x95bf79b6, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "c11_d06.bin", 0x2000, 0x82e2185a, 3 | BRF_GRA }, // 6 gfx1 - { "c12_d07.bin", 0x2000, 0x800ff1f1, 3 | BRF_GRA }, // 7 - { "c13_d08.bin", 0x2000, 0xd9faf183, 3 | BRF_GRA }, // 8 - { "c14_d09.bin", 0x2000, 0x5886c802, 3 | BRF_GRA }, // 9 - - { "361-d12.h16", 0x2000, 0x768bb63d, 4 | BRF_GRA }, // 10 gfx2 - { "361-d11.h15", 0x2000, 0x3af0e2a8, 4 | BRF_GRA }, // 11 - { "h14_e10.bin", 0x2000, 0xc2166a5c, 4 | BRF_GRA }, // 12 - - { "361b16.f1", 0x0020, 0xd55f30b5, 5 | BRF_GRA }, // 13 proms - { "361b17.b16", 0x0100, 0xd2ba4d32, 5 | BRF_GRA }, // 14 - { "361b18.e15", 0x0100, 0x053e5861, 5 | BRF_GRA }, // 15 - - { "c9_d15.bin", 0x2000, 0xf546a56b, 6 | BRF_GRA }, // 16 vlm -}; - -STD_ROM_PICK(hyprolym) -STD_ROM_FN(hyprolym) - -struct BurnDriver BurnDrvHyprolym = { - "hyprolym", "trackfld", NULL, NULL, "1983", - "Hyper Olympic\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, hyprolymRomInfo, hyprolymRomName, NULL, NULL, TrackfldInputInfo, TrackfldDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Track & Field (NZ bootleg?) - -static struct BurnRomInfo trackfldnzRomDesc[] = { - { "gold.7a", 0x2000, 0x77ea4509, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "gold.6a", 0x2000, 0xa13f3131, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gold.5a", 0x2000, 0xb0abe171, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gold.4a", 0x2000, 0xfee9b922, 1 | BRF_PRG | BRF_ESS }, // 3 - { "gold.2a", 0x2000, 0xad6dc048, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "gold.2d", 0x2000, 0x95bf79b6, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "gold.20a", 0x2000, 0x82e2185a, 3 | BRF_GRA }, // 6 gfx1 - { "gold.21a", 0x2000, 0x800ff1f1, 3 | BRF_GRA }, // 7 - { "gold.17a", 0x2000, 0xd9faf183, 3 | BRF_GRA }, // 8 - { "gold.19a", 0x2000, 0x5886c802, 3 | BRF_GRA }, // 9 - - { "gold.2k", 0x2000, 0x50075768, 4 | BRF_GRA }, // 10 gfx2 - { "gold.4k", 0x2000, 0xdda9e29f, 4 | BRF_GRA }, // 11 - { "gold.5k", 0x2000, 0xc2166a5c, 4 | BRF_GRA }, // 12 - - { "gold.2g", 0x0020, 0xd55f30b5, 5 | BRF_GRA }, // 13 proms - { "gold.18d", 0x0100, 0xd2ba4d32, 5 | BRF_GRA }, // 14 - { "gold.4j", 0x0100, 0x053e5861, 5 | BRF_GRA }, // 15 - - { "gold.d9", 0x2000, 0xf546a56b, 6 | BRF_GRA }, // 16 vlm -}; - -STD_ROM_PICK(trackfldnz) -STD_ROM_FN(trackfldnz) - -struct BurnDriver BurnDrvTrackfldnz = { - "trackfldnz", "trackfld", NULL, NULL, "1982", - "Track & Field (NZ bootleg?)\0", NULL, "bootleg? (Goldberg Enterprizes Inc.)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, trackfldnzRomInfo, trackfldnzRomName, NULL, NULL, TrackfldInputInfo, TrackfldDIPInfo, - TrackfldnzInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Hyper Olympic (bootleg, set 1) - -static struct BurnRomInfo hyprolymbRomDesc[] = { - { "blue.a1", 0x2000, 0x82257fb7, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "2.a2", 0x2000, 0x15b83099, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.a4", 0x2000, 0x2d6fc308, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.a5", 0x2000, 0xd099b1e8, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.a7", 0x2000, 0x974ff815, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "c2_d13.bin", 0x2000, 0x95bf79b6, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "2764.1", 0x2000, 0xa4cddeb8, 3 | BRF_SND }, // 6 adpcm - { "2764.2", 0x2000, 0xe9919365, 3 | BRF_SND }, // 7 - { "2764.3", 0x2000, 0xc3ec42e1, 3 | BRF_SND }, // 8 - { "2764.4", 0x2000, 0x76998389, 3 | BRF_SND }, // 9 - - { "6.a18", 0x2000, 0x82e2185a, 4 | BRF_GRA }, // 10 gfx1 - { "7.a19", 0x2000, 0x800ff1f1, 4 | BRF_GRA }, // 11 - { "8.a21", 0x2000, 0xd9faf183, 4 | BRF_GRA }, // 12 - { "9.a22", 0x2000, 0x5886c802, 4 | BRF_GRA }, // 13 - - { "12.h22", 0x2000, 0x768bb63d, 5 | BRF_GRA }, // 14 gfx2 - { "11.h21", 0x2000, 0x3af0e2a8, 5 | BRF_GRA }, // 15 - { "10.h19", 0x2000, 0xc2166a5c, 5 | BRF_GRA }, // 16 - - { "361b16.e1", 0x0020, 0xd55f30b5, 6 | BRF_GRA }, // 17 proms - { "361b17.b15", 0x0100, 0xd2ba4d32, 6 | BRF_GRA }, // 18 - { "361b18.f22", 0x0100, 0x053e5861, 6 | BRF_GRA }, // 19 - - { "pal16l8.e4", 0x0104, 0x641efc84, 7 | BRF_OPT }, // 20 plds - { "pal16l8.e6", 0x0104, 0x122f23e6, 7 | BRF_OPT }, // 21 -}; - -STD_ROM_PICK(hyprolymb) -STD_ROM_FN(hyprolymb) - -static INT32 bootInit() -{ - return 1; -} - -struct BurnDriver BurnDrvHyprolymb = { - "hyprolymb", "trackfld", NULL, NULL, "1983", - "Hyper Olympic (bootleg, set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0 | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, hyprolymbRomInfo, hyprolymbRomName, NULL, NULL, TrackfldInputInfo, TrackfldDIPInfo, - bootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Hyper Olympic (bootleg, set 2) - -static struct BurnRomInfo hyprolymbaRomDesc[] = { - { "1.a1", 0x2000, 0x9aee2d5a, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "2.a2", 0x2000, 0x15b83099, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.a4", 0x2000, 0x2d6fc308, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.a5", 0x2000, 0xd099b1e8, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.a7", 0x2000, 0x974ff815, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "c2_d13.bin", 0x2000, 0x95bf79b6, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "2764.1", 0x2000, 0xa4cddeb8, 3 | BRF_SND }, // 6 adpcm - { "2764.2", 0x2000, 0xe9919365, 3 | BRF_SND }, // 7 - { "2764.3", 0x2000, 0xc3ec42e1, 3 | BRF_SND }, // 8 - { "2764.4", 0x2000, 0x76998389, 3 | BRF_SND }, // 9 - - { "6.a18", 0x2000, 0x82e2185a, 4 | BRF_GRA }, // 10 gfx1 - { "7.a19", 0x2000, 0x800ff1f1, 4 | BRF_GRA }, // 11 - { "8.a21", 0x2000, 0xd9faf183, 4 | BRF_GRA }, // 12 - { "9.a22", 0x2000, 0x5886c802, 4 | BRF_GRA }, // 13 - - { "12.h22", 0x2000, 0x768bb63d, 5 | BRF_GRA }, // 14 gfx2 - { "11.h21", 0x2000, 0x3af0e2a8, 5 | BRF_GRA }, // 15 - { "10.h19", 0x2000, 0xc2166a5c, 5 | BRF_GRA }, // 16 - - { "361b16.e1", 0x0020, 0xd55f30b5, 6 | BRF_GRA }, // 17 proms - { "361b17.b15", 0x0100, 0xd2ba4d32, 6 | BRF_GRA }, // 18 - { "361b18.f22", 0x0100, 0x053e5861, 6 | BRF_GRA }, // 19 - - { "pal16l8.e4", 0x0104, 0x641efc84, 7 | BRF_OPT }, // 20 plds - { "pal16l8.e6", 0x0104, 0x122f23e6, 7 | BRF_OPT }, // 21 -}; - -STD_ROM_PICK(hyprolymba) -STD_ROM_FN(hyprolymba) - -struct BurnDriver BurnDrvHyprolymba = { - "hyprolymba", "trackfld", NULL, NULL, "1983", - "Hyper Olympic (bootleg, set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0 | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, hyprolymbaRomInfo, hyprolymbaRomName, NULL, NULL, TrackfldInputInfo, TrackfldDIPInfo, - bootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Hipoly (bootleg of Hyper Olympic) - -static struct BurnRomInfo hipolyRomDesc[] = { - { "2.1a", 0x2000, 0x82257fb7, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "2.2a", 0x2000, 0x15b83099, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2.4a", 0x2000, 0x93a32a97, 1 | BRF_PRG | BRF_ESS }, // 2 - { "2.5a", 0x2000, 0xd099b1e8, 1 | BRF_PRG | BRF_ESS }, // 3 - { "2.7a", 0x2000, 0x974ff815, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "1.2c", 0x2000, 0x95bf79b6, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "1.11d", 0x2000, 0x102d3a78, 3 | BRF_SND }, // 6 adpcm - { "1.10d", 0x2000, 0xe9919365, 3 | BRF_SND }, // 7 - { "1.11c", 0x2000, 0xc3ec42e1, 3 | BRF_SND }, // 8 - { "1.10c", 0x2000, 0x76998389, 3 | BRF_SND }, // 9 - - { "2.18a", 0x2000, 0x8d28864f, 4 | BRF_GRA }, // 10 gfx1 - { "2.19a", 0x2000, 0x800ff1f1, 4 | BRF_GRA }, // 11 - { "2.21a", 0x2000, 0xd9faf183, 4 | BRF_GRA }, // 12 - { "2.22a", 0x2000, 0x5886c802, 4 | BRF_GRA }, // 13 - - { "2.22h", 0x2000, 0x6c107a9c, 5 | BRF_GRA }, // 14 gfx2 - { "2.21h", 0x2000, 0x21847e56, 5 | BRF_GRA }, // 15 - { "2.19h", 0x2000, 0xc2166a5c, 5 | BRF_GRA }, // 16 - - { "361b16.e1", 0x0020, 0xd55f30b5, 6 | BRF_GRA }, // 17 proms - { "361b17.b15", 0x0100, 0xd2ba4d32, 6 | BRF_GRA }, // 18 - { "361b18.f22", 0x0100, 0x053e5861, 6 | BRF_GRA }, // 19 - - { "pal16l8.e4", 0x0104, 0x00000000, 7 | BRF_NODUMP | BRF_OPT }, // 20 plds - { "pal16l8.e6", 0x0104, 0x00000000, 7 | BRF_NODUMP | BRF_OPT }, // 21 -}; - -STD_ROM_PICK(hipoly) -STD_ROM_FN(hipoly) - -struct BurnDriver BurnDrvHipoly = { - "hipoly", "trackfld", NULL, NULL, "1983", - "Hipoly (bootleg of Hyper Olympic)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, hipolyRomInfo, hipolyRomName, NULL, NULL, TrackfldInputInfo, TrackfldDIPInfo, - bootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Atlant Olimpic - -static struct BurnRomInfo atlantolRomDesc[] = { - { "atl37", 0x20000, 0xaca8da51, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "atl35", 0x20000, 0x03331597, 2 | BRF_PRG | BRF_ESS }, // 1 audiocpu - - { "atl36", 0x20000, 0x0bae8489, 3 | BRF_SND }, // 2 adpcm - - { "atl38", 0x20000, 0xdbbcbcda, 4 | BRF_GRA }, // 3 gfx1 - { "atl39", 0x20000, 0xd08f067f, 4 | BRF_GRA }, // 4 - - { "atl40", 0x20000, 0xc915f53a, 5 | BRF_GRA }, // 5 gfx2 - - { "361b16.f1", 0x00020, 0xd55f30b5, 6 | BRF_GRA }, // 6 proms - { "361b17.b16", 0x00100, 0xd2ba4d32, 6 | BRF_GRA }, // 7 - { "361b18.e15", 0x00100, 0x053e5861, 6 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(atlantol) -STD_ROM_FN(atlantol) - -struct BurnDriver BurnDrvAtlantol = { - "atlantol", "trackfld", NULL, NULL, "1996", - "Atlant Olimpic\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0 | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, atlantolRomInfo, atlantolRomName, NULL, NULL, TrackfldInputInfo, TrackfldDIPInfo, //AtlantolInputInfo, AtlantolDIPInfo, - bootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0, - 256, 224, 4, 3 -}; - - -// Yie Ar Kung-Fu (GX361 conversion) - -static struct BurnRomInfo yieartfRomDesc[] = { - { "2.2a", 0x2000, 0x349430e9, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "3.3a", 0x2000, 0x17d8337b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4.4a", 0x2000, 0xa89a2166, 1 | BRF_PRG | BRF_ESS }, // 2 - { "5.5a", 0x2000, 0xff1599eb, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "a.15c", 0x4000, 0x45109b29, 2 | BRF_GRA }, // 4 gfx1 - { "b.16c", 0x4000, 0x1d650790, 2 | BRF_GRA }, // 5 - { "c.17c", 0x4000, 0xe6aa945b, 2 | BRF_GRA }, // 6 - { "d.18c", 0x4000, 0xcc187c22, 2 | BRF_GRA }, // 7 - - { "6.16h", 0x2000, 0x05a23af3, 3 | BRF_GRA }, // 8 gfx2 - { "7.15h", 0x2000, 0x988154fa, 3 | BRF_GRA }, // 9 - - { "yiear.clr", 0x0020, 0xc283d71f, 4 | BRF_GRA }, // 10 proms - { "prom1.b16", 0x0100, 0x93dc32a0, 4 | BRF_GRA }, // 11 - { "prom2.e15", 0x0100, 0xe7e0f9e5, 4 | BRF_GRA }, // 12 - - { "01.snd", 0x2000, 0xf75a1539, 5 | BRF_GRA }, // 13 vlm -}; - -STD_ROM_PICK(yieartf) -STD_ROM_FN(yieartf) - -struct BurnDriver BurnDrvYieartf = { - "yieartf", "yiear", NULL, NULL, "1985", - "Yie Ar Kung-Fu (GX361 conversion)\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, yieartfRomInfo, yieartfRomName, NULL, NULL, YieartfInputInfo, YieartfDIPInfo, - YieartfInit, DrvExit, YieartfFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Reaktor (Track & Field conversion) - -static struct BurnRomInfo reaktorRomDesc[] = { - { "prog3.bin", 0x8000, 0x8ba956fa, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "2c.bin", 0x4000, 0x105a8beb, 2 | BRF_PRG | BRF_ESS }, // 1 audiocpu - - { "11c.bin", 0x4000, 0xd24553fa, 3 | BRF_GRA }, // 2 gfx1 - { "14c.bin", 0x4000, 0x4d0ab831, 3 | BRF_GRA }, // 3 - { "12c.bin", 0x2000, 0xd0d39e66, 3 | BRF_GRA }, // 4 - { "15c.bin", 0x4000, 0xbf1e608d, 3 | BRF_GRA }, // 5 - - { "16h.bin", 0x4000, 0xcb062c3b, 4 | BRF_GRA }, // 6 gfx2 - { "15h.bin", 0x4000, 0xdf83e659, 4 | BRF_GRA }, // 7 - { "14h.bin", 0x4000, 0x5ca53215, 4 | BRF_GRA }, // 8 - - { "361b16.f1", 0x0020, 0xd55f30b5, 5 | BRF_GRA }, // 9 proms - { "361b17.b16", 0x0100, 0xd2ba4d32, 5 | BRF_GRA }, // 10 - { "361b18.e15", 0x0100, 0x053e5861, 5 | BRF_GRA }, // 11 - - { "c9_d15.bin", 0x2000, 0xf546a56b, 6 | BRF_GRA }, // 12 vlm -}; - -STD_ROM_PICK(reaktor) -STD_ROM_FN(reaktor) - -struct BurnDriver BurnDrvReaktor = { - "reaktor", NULL, NULL, NULL, "1987", - "Reaktor (Track & Field conversion)\0", NULL, "Zilec", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, reaktorRomInfo, reaktorRomName, NULL, NULL, ReaktorInputInfo, ReaktorDIPInfo, - ReaktorInit, DrvExit, ReaktorFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Wizz Quiz (Konami version) - -static struct BurnRomInfo wizzquizRomDesc[] = { - { "pros.rom", 0x2000, 0x4c858841, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "sn1.rom", 0x8000, 0x0ae28676, 2 | BRF_GRA }, // 1 user1 - { "sn2.rom", 0x8000, 0xf2b7374a, 2 | BRF_GRA }, // 2 - { "tvmov1.rom", 0x8000, 0x921f551d, 2 | BRF_GRA }, // 3 - { "tvmov2.rom", 0x8000, 0x1ed44df6, 2 | BRF_GRA }, // 4 - { "sport1.rom", 0x8000, 0x3b7f2ce4, 2 | BRF_GRA }, // 5 - { "sport2.rom", 0x8000, 0x14dbfa23, 2 | BRF_GRA }, // 6 - { "pop1.rom", 0x8000, 0x61f60def, 2 | BRF_GRA }, // 7 - { "pop2.rom", 0x8000, 0x5a5b41cd, 2 | BRF_GRA }, // 8 - - { "zandz.2c", 0x2000, 0x3daca93a, 3 | BRF_PRG | BRF_ESS }, // 9 audiocpu - - { "rom.11c", 0x2000, 0x87d060d4, 4 | BRF_GRA }, // 10 gfx1 - { "rom.14c", 0x2000, 0x5bff1607, 4 | BRF_GRA }, // 11 - - { "rom.16h", 0x2000, 0xe6728bda, 5 | BRF_GRA }, // 12 gfx2 - { "rom.15h", 0x2000, 0x9c067ef4, 5 | BRF_GRA }, // 13 - { "rom.14h", 0x2000, 0x3bbad920, 5 | BRF_GRA }, // 14 - - { "361b16.f1", 0x0020, 0xd55f30b5, 6 | BRF_GRA }, // 15 proms - { "361b17.b16", 0x0100, 0xd2ba4d32, 6 | BRF_GRA }, // 16 - { "361b18.e15", 0x0100, 0x053e5861, 6 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(wizzquiz) -STD_ROM_FN(wizzquiz) - -struct BurnDriver BurnDrvWizzquiz = { - "wizzquiz", NULL, NULL, NULL, "1985", - "Wizz Quiz (Konami version)\0", NULL, "Zilec-Zenitone (Konami license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, wizzquizRomInfo, wizzquizRomName, NULL, NULL, WizzquizInputInfo, WizzquizDIPInfo, - WizzquizInit, DrvExit, WizzquizFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 256, 4, 3 -}; - - -// Wizz Quiz (version 4) - -static struct BurnRomInfo wizzquizaRomDesc[] = { - { "ic9_a1.bin", 0x2000, 0x608e1ff3, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "ic1_q06.bin", 0x8000, 0xc62f25b1, 2 | BRF_GRA }, // 1 user1 - { "ic2_q28.bin", 0x8000, 0x2bd00476, 2 | BRF_GRA }, // 2 - { "ic3_q27.bin", 0x8000, 0x46d28aaf, 2 | BRF_GRA }, // 3 - { "ic4_q23.bin", 0x8000, 0x3f46f702, 2 | BRF_GRA }, // 4 - { "ic5_q26.bin", 0x8000, 0x9d130515, 2 | BRF_GRA }, // 5 - { "ic6_q09.bin", 0x8000, 0x636f89b4, 2 | BRF_GRA }, // 6 - { "ic7_q15.bin", 0x8000, 0xb35332b1, 2 | BRF_GRA }, // 7 - { "ic8_q19.bin", 0x8000, 0x8d152da0, 2 | BRF_GRA }, // 8 - - { "02c.bin", 0x2000, 0x3daca93a, 3 | BRF_PRG | BRF_ESS }, // 9 audiocpu - - { "11c.bin", 0x2000, 0x87d060d4, 4 | BRF_GRA }, // 10 gfx1 - { "14c.bin", 0x2000, 0x5bff1607, 4 | BRF_GRA }, // 11 - - { "16h.bin", 0x2000, 0xe6728bda, 5 | BRF_GRA }, // 12 gfx2 - { "15h.bin", 0x2000, 0x9c067ef4, 5 | BRF_GRA }, // 13 - { "14h.bin", 0x2000, 0x3bbad920, 5 | BRF_GRA }, // 14 - - { "361b16.f1", 0x0020, 0xd55f30b5, 6 | BRF_GRA }, // 15 proms - { "361b17.b16", 0x0100, 0xd2ba4d32, 6 | BRF_GRA }, // 16 - { "361b18.e15", 0x0100, 0x053e5861, 6 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(wizzquiza) -STD_ROM_FN(wizzquiza) - -struct BurnDriver BurnDrvWizzquiza = { - "wizzquiza", "wizzquiz", NULL, NULL, "1985", - "Wizz Quiz (version 4)\0", NULL, "Zilec-Zenitone", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0 | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, wizzquizaRomInfo, wizzquizaRomName, NULL, NULL, WizzquizInputInfo, WizzquizDIPInfo, - WizzquizInit, DrvExit, WizzquizFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 256, 4, 3 -}; - - -// The Masters of Kin - -static struct BurnRomInfo mastkinRomDesc[] = { - { "mk3", 0x2000, 0x9f80d6ae, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "mk4", 0x2000, 0x99f361e7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mk5", 0x2000, 0x143d76ce, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "mk1", 0x2000, 0x95bf79b6, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "mk6", 0x2000, 0x18fbe047, 3 | BRF_GRA }, // 4 gfx1 - { "mk7", 0x2000, 0x47dee791, 3 | BRF_GRA }, // 5 - { "mk8", 0x2000, 0x9c091ead, 3 | BRF_GRA }, // 6 - { "mk9", 0x2000, 0x5c8ed3fe, 3 | BRF_GRA }, // 7 - - { "mk12", 0x2000, 0x8b1a19cf, 4 | BRF_GRA }, // 8 gfx2 - { "mk11", 0x2000, 0x1a56d24d, 4 | BRF_GRA }, // 9 - { "mk10", 0x2000, 0xe7d05634, 4 | BRF_GRA }, // 10 - - { "prom.1", 0x0020, 0x00000000, 5 | BRF_NODUMP | BRF_GRA }, // 11 proms - { "prom.3", 0x0100, 0x00000000, 5 | BRF_NODUMP | BRF_GRA }, // 12 - { "prom.2", 0x0100, 0x00000000, 5 | BRF_NODUMP | BRF_GRA }, // 13 - - { "mk2", 0x2000, 0xf546a56b, 6 | BRF_GRA }, // 14 vlm -}; - -STD_ROM_PICK(mastkin) -STD_ROM_FN(mastkin) - -struct BurnDriver BurnDrvMastkin = { - "mastkin", NULL, NULL, NULL, "1988", - "The Masters of Kin\0", "Colors are wrong", "Du Tech", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, mastkinRomInfo, mastkinRomName, NULL, NULL, MastkinInputInfo, MastkinDIPInfo, - MastkinInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_tutankhm.cpp b/jan/src/burn/drv/konami/d_tutankhm.cpp deleted file mode 100644 index 9ca0ddfea..000000000 --- a/jan/src/burn/drv/konami/d_tutankhm.cpp +++ /dev/null @@ -1,580 +0,0 @@ -// FB Alpha Tutankham driver module -// Based on MAME driver by Mirko Buffoni & Rob Jarrett - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "z80_intf.h" -#include "timeplt_snd.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; - -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 scrolldata; -static UINT8 sound_mute; -static UINT8 irq_enable; -static UINT8 flipscreenx; -static UINT8 flipscreeny; -static UINT8 nRomBank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 watchdog; - -static struct BurnInputInfo TutankhmInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Left Stick Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Left Stick Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left Stick Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Left Stick Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Right Stick Left", BIT_DIGITAL, DrvJoy2 + 4, "p3 left" }, - {"P1 Right Stick Right",BIT_DIGITAL, DrvJoy2 + 5, "p3 right" }, - {"P1 Flash Bomb", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Left Stick Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Left Stick Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left Stick Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Left Stick Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Right Stick Left", BIT_DIGITAL, DrvJoy3 + 4, "p4 left" }, - {"P2 Right Stick Right",BIT_DIGITAL, DrvJoy3 + 5, "p4 right" }, - {"P2 Flash Bomb", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tutankhm) - -static struct BurnDIPInfo TutankhmDIPList[]= -{ - {0x14, 0xff, 0xff, 0x6b, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x01, "4" }, - {0x14, 0x01, 0x03, 0x02, "5" }, - {0x14, 0x01, 0x03, 0x00, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x04, 0x00, "Upright" }, - {0x14, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x14, 0x01, 0x08, 0x08, "30000" }, - {0x14, 0x01, 0x08, 0x00, "40000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x30, "Easy" }, - {0x14, 0x01, 0x30, 0x20, "Normal" }, - {0x14, 0x01, 0x30, 0x10, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flash Bomb" }, - {0x14, 0x01, 0x40, 0x40, "1 per Life" }, - {0x14, 0x01, 0x40, 0x00, "1 per Game" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x15, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "No Coin B" }, -}; - -STDDIPINFO(Tutankhm) - -static void bankswitch(INT32 data) -{ - nRomBank = data; - - INT32 bank = 0x10000 + (data & 0x0f) * 0x1000; - - M6809MapMemory(DrvM6809ROM + bank, 0x9000, 0x9fff, MAP_ROM); -} - -static void tutankhm_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0x8000) { - DrvPalRAM[address & 0x0f] = data; - return; - } - - switch (address) - { - case 0x8100: - scrolldata = data; - return; - - case 0x8200: - irq_enable = data & 1; - if (!irq_enable) { - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - } - return; - - case 0x8202: - // coin counter - return; - - case 0x8204: - return; - - case 0x8205: - sound_mute = data & 1; - return; - - case 0x8206: - flipscreenx = data & 1; - return; - - case 0x8207: - flipscreeny = data & 1; - return; - - case 0x8300: - bankswitch(data); - return; - - case 0x8600: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x8700: - TimepltSndSoundlatch(data); - return; - } -} - -static UINT8 tutankhm_read(UINT16 address) -{ - switch (address) - { - case 0x8120: - watchdog = 0; - return 0; - - case 0x8160: - return DrvDips[1]; - - case 0x8180: - return DrvInputs[0]; - - case 0x81a0: - return DrvInputs[1]; - - case 0x81c0: - return DrvInputs[2]; - - case 0x81e0: - return DrvDips[0]; - - case 0x8200: - return 0; - } - - return 0; -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset(AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - bankswitch(0); - M6809Close(); - - TimepltSndReset(); - - irq_enable = 0; - sound_mute = 0; - watchdog = 0; - scrolldata = 0; - flipscreenx = 0; - flipscreeny = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x020000; - DrvZ80ROM = Next; Next += 0x003000; - - DrvPalette = (UINT32*)Next; Next += 0x0010 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x008000; - DrvM6809RAM = Next; Next += 0x000800; - DrvZ80RAM = Next; Next += 0x000400; - DrvPalRAM = Next; Next += 0x000010; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x0a000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0b000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0d000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0e000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0f000, 5, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x10000, 6, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x11000, 7, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x12000, 8, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x13000, 9, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x14000, 10, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x15000, 11, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x16000, 12, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x17000, 13, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x18000, 14, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 15, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x01000, 16, 1)) return 1; - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x7fff, MAP_RAM); - M6809MapMemory(DrvM6809RAM, 0x8800, 0x8fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0xa000, 0xa000, 0xffff, MAP_ROM); - M6809SetWriteHandler(tutankhm_write); - M6809SetReadHandler(tutankhm_read); - M6809Close(); - - TimepltSndInit(DrvZ80ROM, DrvZ80RAM, 0); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - - TimepltSndExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 0x10; i++) { - INT32 r = (DrvPalRAM[i] >> 0) & 7; - INT32 g = (DrvPalRAM[i] >> 3) & 7; - INT32 b = (DrvPalRAM[i] >> 6) & 3; - - r = (r << 5) | (r << 2) | (r >> 1); - g = (g << 5) | (g << 2) | (g >> 1); - b |= (b << 6) | (b << 4) | (b << 2); - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_layer() -{ - INT32 flipx = (flipscreenx) ? 255 : 0; - INT32 flipy = (flipscreeny) ? 255 : 0; - - for (INT32 y = 16; y < 256 - 16; y++) - { - UINT16 *dst = pTransDraw + (y - 16) * nScreenWidth; - - for (INT32 x = 0; x < nScreenWidth; x++) - { - UINT8 effx = x ^ flipx; - UINT8 yscroll = (effx < 192) ? scrolldata : 0; - UINT8 effy = (y ^ flipy) + yscroll; - dst[x] = (DrvVidRAM[effy * 128 + effx / 2] >> (4 * (effx & 1))) & 0xf; - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; -// } - - draw_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear opposites - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x30) == 0) DrvInputs[1] |= 0x30; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[2] & 0x30) == 0) DrvInputs[2] |= 0x30; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 1536000 / 60, 1789772 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] * (i + 1)) / nInterleave; - nCyclesDone[0] += M6809Run(nSegment - nCyclesDone[0]); - if (i == (nInterleave - 1) && irq_enable && (nCurrentFrame & 1)) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - - nSegment = (nCyclesTotal[1] * i) / nInterleave; - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (!sound_mute) TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - ZetClose(); - M6809Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (sound_mute) { - memset (pBurnSoundOut, 0, nBurnSoundLen * sizeof(INT16) * 2); - } else { - TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - TimepltSndScan(nAction, pnMin); - - SCAN_VAR(scrolldata); - SCAN_VAR(sound_mute); - SCAN_VAR(irq_enable); - SCAN_VAR(flipscreenx); - SCAN_VAR(flipscreeny); - SCAN_VAR(nRomBank); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(nRomBank); - M6809Close(); - } - - return 0; -} - - -// Tutankham - -static struct BurnRomInfo tutankhmRomDesc[] = { - { "m1.1h", 0x1000, 0xda18679f, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "m2.2h", 0x1000, 0xa0f02c85, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3j.3h", 0x1000, 0xea03a1ab, 1 | BRF_PRG | BRF_ESS }, // 2 - { "m4.4h", 0x1000, 0xbd06fad0, 1 | BRF_PRG | BRF_ESS }, // 3 - { "m5.5h", 0x1000, 0xbf9fd9b0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "j6.6h", 0x1000, 0xfe079c5b, 1 | BRF_PRG | BRF_ESS }, // 5 - { "c1.1i", 0x1000, 0x7eb59b21, 1 | BRF_PRG | BRF_ESS }, // 6 - { "c2.2i", 0x1000, 0x6615eff3, 1 | BRF_PRG | BRF_ESS }, // 7 - { "c3.3i", 0x1000, 0xa10d4444, 1 | BRF_PRG | BRF_ESS }, // 8 - { "c4.4i", 0x1000, 0x58cd143c, 1 | BRF_PRG | BRF_ESS }, // 9 - { "c5.5i", 0x1000, 0xd7e7ae95, 1 | BRF_PRG | BRF_ESS }, // 10 - { "c6.6i", 0x1000, 0x91f62b82, 1 | BRF_PRG | BRF_ESS }, // 11 - { "c7.7i", 0x1000, 0xafd0a81f, 1 | BRF_PRG | BRF_ESS }, // 12 - { "c8.8i", 0x1000, 0xdabb609b, 1 | BRF_PRG | BRF_ESS }, // 13 - { "c9.9i", 0x1000, 0x8ea9c6a6, 1 | BRF_PRG | BRF_ESS }, // 14 - - { "s1.7a", 0x1000, 0xb52d01fa, 2 | BRF_PRG | BRF_ESS }, // 15 Z80 Code - { "s2.8a", 0x1000, 0x9db5c0ce, 2 | BRF_PRG | BRF_ESS }, // 16 -}; - -STD_ROM_PICK(tutankhm) -STD_ROM_FN(tutankhm) - -struct BurnDriver BurnDrvTutankhm = { - "tutankhm", NULL, NULL, NULL, "1982", - "Tutankham\0", NULL, "Konami", "GX350", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_KONAMI, GBF_MAZE, 0, - NULL, tutankhmRomInfo, tutankhmRomName, NULL, NULL, TutankhmInputInfo, TutankhmDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 224, 256, 3, 4 -}; - - -// Tutankham (Stern Electronics) - -static struct BurnRomInfo tutankhmsRomDesc[] = { - { "m1.1h", 0x1000, 0xda18679f, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "m2.2h", 0x1000, 0xa0f02c85, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3a.3h", 0x1000, 0x2d62d7b1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "m4.4h", 0x1000, 0xbd06fad0, 1 | BRF_PRG | BRF_ESS }, // 3 - { "m5.5h", 0x1000, 0xbf9fd9b0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "a6.6h", 0x1000, 0xc43b3865, 1 | BRF_PRG | BRF_ESS }, // 5 - { "c1.1i", 0x1000, 0x7eb59b21, 1 | BRF_PRG | BRF_ESS }, // 6 - { "c2.2i", 0x1000, 0x6615eff3, 1 | BRF_PRG | BRF_ESS }, // 7 - { "c3.3i", 0x1000, 0xa10d4444, 1 | BRF_PRG | BRF_ESS }, // 8 - { "c4.4i", 0x1000, 0x58cd143c, 1 | BRF_PRG | BRF_ESS }, // 9 - { "c5.5i", 0x1000, 0xd7e7ae95, 1 | BRF_PRG | BRF_ESS }, // 10 - { "c6.6i", 0x1000, 0x91f62b82, 1 | BRF_PRG | BRF_ESS }, // 11 - { "c7.7i", 0x1000, 0xafd0a81f, 1 | BRF_PRG | BRF_ESS }, // 12 - { "c8.8i", 0x1000, 0xdabb609b, 1 | BRF_PRG | BRF_ESS }, // 13 - { "c9.9i", 0x1000, 0x8ea9c6a6, 1 | BRF_PRG | BRF_ESS }, // 14 - - { "s1.7a", 0x1000, 0xb52d01fa, 2 | BRF_PRG | BRF_ESS }, // 15 Z80 Code - { "s2.8a", 0x1000, 0x9db5c0ce, 2 | BRF_PRG | BRF_ESS }, // 16 -}; - -STD_ROM_PICK(tutankhms) -STD_ROM_FN(tutankhms) - -struct BurnDriver BurnDrvTutankhms = { - "tutankhms", "tutankhm", NULL, NULL, "1982", - "Tutankham (Stern Electronics)\0", NULL, "Konami (Stern Electronics license)", "GX350", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_KONAMI, GBF_MAZE, 0, - NULL, tutankhmsRomInfo, tutankhmsRomName, NULL, NULL, TutankhmInputInfo, TutankhmDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/konami/d_twin16.cpp b/jan/src/burn/drv/konami/d_twin16.cpp deleted file mode 100644 index 3e9c9370e..000000000 --- a/jan/src/burn/drv/konami/d_twin16.cpp +++ /dev/null @@ -1,2246 +0,0 @@ -// FB Alpha Twin16 driver module -// Based on MAME driver by Phil Stroffolino - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "upd7759.h" -#include "k007232.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *Drv68KROM0; -static UINT8 *Drv68KROM1; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvShareRAM; -static UINT8 *Drv68KRAM0; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM2; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvNvRAM; -static UINT8 *DrvNvRAMBank; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvFgRAM; -static UINT8 *DrvTileRAM; -static UINT8 *DrvSprGfxRAM; -static UINT8 *DrvGfxExp; - -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 *scrollx; -static UINT16 *scrolly; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; - -static INT32 video_register; -static INT32 gfx_bank; - -static INT32 twin16_CPUA_register; -static INT32 twin16_CPUB_register; - -static INT32 need_process_spriteram; -static INT32 twin16_custom_video; -static INT32 is_vulcan = 0; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvInputs[4]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo DevilwInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Map Button", BIT_DIGITAL, DrvJoy1 + 3, "service2" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Devilw) - -static struct BurnInputInfo DarkadvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 2, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 3, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 0, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 1, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p3 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 7, "service2" }, - {"Service 3", BIT_DIGITAL, DrvJoy2 + 7, "service3" }, - {"Map Button", BIT_DIGITAL, DrvJoy1 + 3, "service4" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Darkadv) - -#define coinage_dips(offs) \ - {0 , 0xfe, 0 , 16, "Coin A" }, \ - {offs, 0x01, 0x0f, 0x02, "4 Coins 1 Credit " }, \ - {offs, 0x01, 0x0f, 0x05, "3 Coins 1 Credit " }, \ - {offs, 0x01, 0x0f, 0x08, "2 Coins 1 Credit " }, \ - {offs, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, \ - {offs, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, \ - {offs, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit " }, \ - {offs, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, \ - {offs, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, \ - {offs, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, \ - {offs, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, \ - {offs, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, \ - {offs, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, \ - {offs, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, \ - {offs, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, \ - {offs, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, \ - {offs, 0x01, 0x0f, 0x00, "Free Play" }, \ - \ - {0 , 0xfe, 0 , 16, "Coin B" }, \ - {offs, 0x01, 0xf0, 0x20, "4 Coins 1 Credit " }, \ - {offs, 0x01, 0xf0, 0x50, "3 Coins 1 Credit " }, \ - {offs, 0x01, 0xf0, 0x80, "2 Coins 1 Credit " }, \ - {offs, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, \ - {offs, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, \ - {offs, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit " }, \ - {offs, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, \ - {offs, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, \ - {offs, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, \ - {offs, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, \ - {offs, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, \ - {offs, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, \ - {offs, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, \ - {offs, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, \ - {offs, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, \ - {offs, 0x01, 0xf0, 0x00, "Disabled" }, - -static struct BurnDIPInfo DevilwDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x5e, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - coinage_dips(0x13) - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "2" }, - {0x14, 0x01, 0x03, 0x02, "3" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x60, 0x60, "Easy" }, - {0x14, 0x01, 0x60, 0x40, "Normal" }, - {0x14, 0x01, 0x60, 0x20, "Difficult" }, - {0x14, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Devilw) - -static struct BurnDIPInfo DarkadvDIPList[]= -{ - {0x1d, 0xff, 0xff, 0xff, NULL }, - {0x1e, 0xff, 0xff, 0x5e, NULL }, - {0x1f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x1d, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x1d, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x1d, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x1d, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x1d, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x1d, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x1d, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x1d, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x1d, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x1d, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x1d, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x1d, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x1d, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x1d, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x1d, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x1d, 0x01, 0x0f, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x1e, 0x01, 0x03, 0x03, "2" }, - {0x1e, 0x01, 0x03, 0x02, "3" }, - {0x1e, 0x01, 0x03, 0x01, "5" }, - {0x1e, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1e, 0x01, 0x60, 0x60, "Easy" }, - {0x1e, 0x01, 0x60, 0x40, "Normal" }, - {0x1e, 0x01, 0x60, 0x20, "Difficult" }, - {0x1e, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1e, 0x01, 0x80, 0x80, "Off" }, - {0x1e, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1f, 0x01, 0x01, 0x01, "Off" }, - {0x1f, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1f, 0x01, 0x04, 0x04, "Off" }, - {0x1f, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Darkadv) - -static struct BurnDIPInfo VulcanDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x5a, NULL }, - {0x16, 0xff, 0xff, 0xfd, NULL }, - - coinage_dips(0x14) - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x01, "4" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x04, 0x00, "Upright" }, - {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "20K 70K" }, - {0x15, 0x01, 0x18, 0x10, "30K 80K" }, - {0x15, 0x01, 0x18, 0x08, "20K" }, - {0x15, 0x01, 0x18, 0x00, "70K" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Difficult" }, - {0x15, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Vulcan) - -static struct BurnDIPInfo Gradius2DIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x5a, NULL }, - {0x16, 0xff, 0xff, 0xfd, NULL }, - - coinage_dips(0x14) - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x01, "4" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x04, 0x00, "Upright" }, - {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "20K 150K" }, - {0x15, 0x01, 0x18, 0x10, "30K 200K" }, - {0x15, 0x01, 0x18, 0x08, "20K" }, - {0x15, 0x01, 0x18, 0x00, "70K" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Difficult" }, - {0x15, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Gradius2) - -static struct BurnDIPInfo FroundDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x42, NULL }, - {0x16, 0xff, 0xff, 0xfd, NULL }, - - coinage_dips(0x14) - - {0 , 0xfe, 0 , 4, "Energy" }, - {0x15, 0x01, 0x03, 0x03, "18" }, - {0x15, 0x01, 0x03, 0x02, "20" }, - {0x15, 0x01, 0x03, 0x01, "22" }, - {0x15, 0x01, 0x03, 0x00, "24" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Difficult" }, - {0x15, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Fround) - -static struct BurnDIPInfo MiajDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x52, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - coinage_dips(0x14) - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x18, 0x18, "30K 80K" }, - {0x15, 0x01, 0x18, 0x10, "50K 100K" }, - {0x15, 0x01, 0x18, 0x08, "50K" }, - {0x15, 0x01, 0x18, 0x00, "100K" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Difficult" }, - {0x15, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "VRAM Character Check" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Miaj) - -static struct BurnDIPInfo CuebrckjDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x5a, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - coinage_dips(0x14) - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "1" }, - {0x15, 0x01, 0x03, 0x02, "2" }, - {0x15, 0x01, 0x03, 0x01, "3" }, - {0x15, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x04, 0x00, "Upright" }, - {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Machine Name" }, - {0x15, 0x01, 0x18, 0x18, "None" }, - {0x15, 0x01, 0x18, 0x10, "Lewis" }, - {0x15, 0x01, 0x18, 0x08, "Johnson" }, - {0x15, 0x01, 0x18, 0x00, "George" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Mode" }, - {0x16, 0x01, 0x08, 0x08, "3" }, - {0x16, 0x01, 0x08, 0x00, "4" }, -}; - -STDDIPINFO(Cuebrckj) - -static void twin16_spriteram_process() -{ - INT32 dx = BURN_ENDIAN_SWAP_INT16(scrollx[0]); - INT32 dy = BURN_ENDIAN_SWAP_INT16(scrolly[0]); - - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - UINT16 *source = spriteram16; - UINT16 *finish = spriteram16 + 0x1800; - - memset(&spriteram16[0x1800], 0, 0x800); - - while (source < finish) - { - INT32 priority = BURN_ENDIAN_SWAP_INT16(source[0]); - if (priority & 0x8000 ) - { - UINT16 *dest = &spriteram16[0x1800 + ((priority & 0xff) << 2)]; - - INT32 xpos = (BURN_ENDIAN_SWAP_INT16(source[4]) << 16) | BURN_ENDIAN_SWAP_INT16(source[5]); - INT32 ypos = (BURN_ENDIAN_SWAP_INT16(source[6]) << 16) | BURN_ENDIAN_SWAP_INT16(source[7]); - - INT32 attributes = BURN_ENDIAN_SWAP_INT16(source[2])&0x03ff; - if (priority & 0x0200) attributes |= 0x4000; - - attributes |= 0x8000; - - dest[0] = source[3]; - dest[1] = BURN_ENDIAN_SWAP_INT16(((xpos >> 8) - dx) & 0xffff); - dest[2] = BURN_ENDIAN_SWAP_INT16(((ypos >> 8) - dy) & 0xffff); - dest[3] = BURN_ENDIAN_SWAP_INT16(attributes); - } - - source += 0x50/2; - } - - need_process_spriteram = 0; -} - -static void fround_CPU_register_w(INT32 data) -{ - INT32 old = twin16_CPUA_register; - twin16_CPUA_register = data; - if (twin16_CPUA_register != old) - { - if ((old & 0x08) == 0 && (twin16_CPUA_register & 0x08)) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - } -} - -static void twin16_CPUA_register_w(INT32 data) -{ - if (twin16_CPUA_register != data) - { - if ((twin16_CPUA_register & 0x08) == 0 && (data & 0x08)) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - - if ((twin16_CPUA_register & 0x40) && (data & 0x40) == 0) - twin16_spriteram_process(); - - if ((twin16_CPUA_register & 0x10) == 0 && (data & 0x10)) { - SekClose(); - SekOpen(1); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekClose(); - SekOpen(0); - } - - twin16_CPUA_register = data; - } -} - -static void twin16_CPUB_register_w(INT32 data) -{ - INT32 old = twin16_CPUB_register; - twin16_CPUB_register = data; - if (twin16_CPUB_register != old) - { - if ((old & 0x01) == 0 && (twin16_CPUB_register & 0x01)) - { - SekClose(); - SekOpen(0); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekClose(); - SekOpen(1); - } - - INT32 offset = (twin16_CPUB_register & 4) << 17; - SekMapMemory(DrvGfxROM1 + 0x100000 + offset, 0x700000, 0x77ffff, MAP_ROM); - } -} - -void __fastcall twin16_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0xc0002: - case 0xc0006: - case 0xc000a: - scrollx[((address - 2) & 0x0c) >> 2] = BURN_ENDIAN_SWAP_INT16(data); - return; - - case 0xc0004: - case 0xc0008: - case 0xc000c: - scrolly[((address - 4) & 0x0c) >> 2] = BURN_ENDIAN_SWAP_INT16(data); - return; - - case 0xe0000: - gfx_bank = BURN_ENDIAN_SWAP_INT16(data); - return; - } -} - -void __fastcall twin16_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xa0001: - if (twin16_custom_video == 1) { - fround_CPU_register_w(data); - } else { - twin16_CPUA_register_w(data); - } - return; - - case 0xa0008: - case 0xa0009: - *soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0xa0011: // watchdog - return; - - case 0xb0400: - { - *DrvNvRAMBank = data & 0x1f; - int offset = data & 0x1f; - SekMapMemory(DrvNvRAM + offset * 0x400, 0x0b0000, 0x0b03ff, MAP_RAM); - } - return; - - case 0xc0001: - video_register = data; - return; - } -} - -UINT16 __fastcall twin16_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x0c000e: - case 0x0c000f: { - static INT32 ret = 0; - ret = 1-ret; - return ret; - } - - case 0x0a0000: - case 0x0a0002: - case 0x0a0004: - case 0x0a0006: - return DrvInputs[(address - 0x0a0000)/2]; - - case 0x0a0010: - return DrvDips[1]; - - case 0x0a0012: - return DrvDips[0]; - - case 0x0a0018: - return DrvDips[2]; - } - - return 0; -} - -UINT8 __fastcall twin16_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0c000e: - case 0x0c000f: { - static INT32 ret = 0; - ret = 1-ret; - return ret; - } - - case 0x0a0000: - case 0x0a0001: - case 0x0a0002: - case 0x0a0003: - case 0x0a0004: - case 0x0a0005: - case 0x0a0006: - case 0x0a0007: - return DrvInputs[(address - 0x0a0000)/2]; - - case 0x0a0010: - case 0x0a0011: - return DrvDips[1]; - - case 0x0a0012: - case 0x0a0013: - return DrvDips[0]; - - case 0x0a0018: - case 0x0a0019: - return DrvDips[2]; - } - - return 0; -} - -static inline void twin16_tile_write(INT32 offset) -{ - DrvGfxExp[(offset << 1) + 2] = DrvTileRAM[offset + 0] >> 4; - DrvGfxExp[(offset << 1) + 3] = DrvTileRAM[offset + 0] & 0x0f; - DrvGfxExp[(offset << 1) + 0] = DrvTileRAM[offset + 1] >> 4; - DrvGfxExp[(offset << 1) + 1] = DrvTileRAM[offset + 1] & 0x0f; -} - -void __fastcall twin16_sub_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfc0000) == 0x500000) { - INT32 offset = address & 0x3ffff; - *((UINT16*)(DrvTileRAM + offset)) = BURN_ENDIAN_SWAP_INT16(data); - twin16_tile_write(offset); - return; - } -} - -void __fastcall twin16_sub_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xa0001: - twin16_CPUB_register_w(data); - return; - } - - if ((address & 0xfc0000) == 0x500000) { - INT32 offset = address & 0x3ffff; - DrvTileRAM[offset^1] = data; - twin16_tile_write(offset & ~1); - return; - } -} - -void __fastcall twin16_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - *soundlatch2 = data; - UPD7759ResetWrite(0, data & 2); - return; - - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xd000: - UPD7759PortWrite(0, data); - return; - - case 0xe000: - UPD7759StartWrite(0, data & 1); - return; - } - - if ((address & 0xfff0) == 0xb000) { - K007232WriteReg(0, address & 0x0f, data); - return; - } -} - -UINT8 __fastcall twin16_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9000: - return *soundlatch2; - - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xc000: - case 0xc001: - return BurnYM2151ReadStatus(); - - case 0xf000: - return UPD7759BusyRead(0) ? 1 : 0; - } - - if ((address & 0xfff0) == 0xb000) { - return K007232ReadReg(0, address & 0x0f); - } - - return 0; -} - -static void DrvK007232VolCallback(INT32 v) -{ - K007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0); - K007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - SekOpen(1); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - UPD7759Reset(); - - gfx_bank = 0x3210; // for other than fround - video_register = 0; - - twin16_CPUA_register = 0; - twin16_CPUB_register = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM0 = Next; Next += 0x040000; - Drv68KROM1 = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvSndROM0 = Next; Next += 0x020000; - DrvSndROM1 = Next; Next += 0x020000; - - DrvGfxExp = Next; Next += 0x400000; - DrvNvRAM = Next; Next += 0x008000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x004000; - DrvSprBuf = Next; Next += 0x004000; - DrvShareRAM = Next; Next += 0x010000; - Drv68KRAM0 = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x001000; - DrvVidRAM2 = Next; Next += 0x006000; - DrvVidRAM = Next; Next += 0x004000; - Drv68KRAM1 = Next; Next += 0x004000; - DrvFgRAM = Next; Next += 0x004000; - DrvTileRAM = Next; Next += 0x040000; - DrvSprGfxRAM = Next; Next += 0x020000; - - DrvZ80RAM = Next; Next += 0x001000; - - DrvNvRAMBank = Next; Next += 0x000001; - - scrollx = (UINT16*)Next; Next += 0x00004 * sizeof(UINT16); - scrolly = (UINT16*)Next; Next += 0x00004 * sizeof(UINT16); - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void expand4bpp(UINT8 *src, UINT8 *dst, INT32 len) -{ - for (INT32 i = len-1; i > 0; i--) { - dst[i * 2 + 0] = src[i] >> 4; - dst[i * 2 + 1] = src[i] & 0x0f; - } -} - -static void gfxdecode() -{ - UINT16 *src = (UINT16*)DrvGfxROM1; - UINT16 *dst = (UINT16*)BurnMalloc(0x200000); - for (INT32 i = 0; i < 0x80000; i++) - { - dst[i * 2 + 0] = src[i + 0x80000]; - dst[i * 2 + 1] = src[i + 0x00000]; - } - memcpy (src, dst, 0x200000); - BurnFree(dst); -} - -static INT32 load68k(UINT8 *rom, INT32 offs) -{ - if (BurnLoadRom(rom + 0x000001, offs+0, 2)) return 1; - if (BurnLoadRom(rom + 0x000000, offs+1, 2)) return 1; - if (BurnLoadRom(rom + 0x020001, offs+2, 2)) return 1; - if (BurnLoadRom(rom + 0x020000, offs+3, 2)) return 1; - - return 0; -} - -static INT32 DrvInit(INT32 (pLoadCallback)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (pLoadCallback != NULL) { - if (pLoadCallback()) return 1; - } - - gfxdecode(); - expand4bpp(DrvGfxROM0, DrvGfxROM0, 0x4000); - - if (twin16_custom_video == 1) - { - BurnByteswap(DrvGfxROM1, 0x200000); - expand4bpp(DrvGfxROM1, DrvGfxExp, 0x200000); - BurnByteswap(DrvGfxROM1, 0x200000); - } - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvShareRAM, 0x040000, 0x04ffff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x060000, 0x063fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvNvRAM, 0x0b0000, 0x0b03ff, MAP_RAM); - SekMapMemory(DrvVidRAM2, 0x100000, 0x105fff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x120000, 0x123fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x140000, 0x143fff, MAP_RAM); - SekMapMemory(DrvGfxROM1, 0x500000, 0x6fffff, MAP_ROM); - SekSetWriteWordHandler(0, twin16_main_write_word); - SekSetWriteByteHandler(0, twin16_main_write_byte); - SekSetReadWordHandler(0, twin16_main_read_word); - SekSetReadByteHandler(0, twin16_main_read_byte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Drv68KROM1, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvShareRAM, 0x040000, 0x04ffff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x060000, 0x063fff, MAP_RAM); - SekMapMemory(DrvGfxROM2, 0x080000, 0x09ffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x480000, 0x483fff, MAP_RAM); - SekMapMemory(DrvTileRAM, 0x500000, 0x53ffff, MAP_ROM); - SekMapMemory(DrvGfxROM1, 0x600000, 0x6fffff, MAP_ROM); - SekMapMemory(DrvGfxROM1 + 0x100000, 0x700000, 0x77ffff, MAP_ROM); - SekMapMemory(DrvSprGfxRAM, 0x780000, 0x79ffff, MAP_RAM); - SekSetWriteWordHandler(0, twin16_sub_write_word); - SekSetWriteByteHandler(0, twin16_sub_write_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x8fff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x8fff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x8fff, 2, DrvZ80RAM); - ZetSetWriteHandler(twin16_sound_write); - ZetSetReadHandler(twin16_sound_read); - ZetClose(); - - K007232Init(0, 3579545, DrvSndROM0, 0x20000); - K007232SetPortWriteHandler(0, DrvK007232VolCallback); - K007232PCMSetAllRoutes(0, 0.12, BURN_SND_ROUTE_BOTH); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - UPD7759Init(0, UPD7759_STANDARD_CLOCK, DrvSndROM1); - UPD7759SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - - K007232Exit(); - UPD7759Exit(); - BurnYM2151Exit(); - - BurnFree (AllMem); - - is_vulcan = 0; - twin16_custom_video = 0; - - return 0; -} - -static inline void DrvRecalcPal() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x1000 / 2; i+=2) - { - INT32 d = ((BURN_ENDIAN_SWAP_INT16(p[i+0]) & 0xff) << 8) | (BURN_ENDIAN_SWAP_INT16(p[i+1]) & 0xff); - - r = (d >> 0) & 0x1f; - g = (d >> 5) & 0x1f; - b = (d >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i/2] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_fg_layer() -{ - INT32 flipx = (video_register & 2) ? 0x1f8 : 0; - INT32 flipy = (video_register & 1) ? 0x0f8 : 0; - - UINT16 *vram = (UINT16*)DrvVidRAM2; - - for (INT32 offs = 0x80; offs < 0x780; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx ^= flipx; - sy ^= flipy; - - if (flipx) sx -= 192; - sy -= 16; - - if (sx >= nScreenWidth) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 code = attr & 0x1ff; - INT32 color = (attr >> 9) & 0x0f; - - if (code == 0) continue; - - if (sx >= 0 && sx < nScreenWidth-7 && sy >= 0 && sy < nScreenHeight-7) { - if (flipx) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } - } - } -} - -static void draw_layer(INT32 opaque) -{ - INT32 o = 0; - INT32 banks[4]; - if (((video_register & 8) >> 3) != opaque) o = 1; - - UINT16 *vram = (UINT16*)(DrvVidRAM + (o << 13)); - banks[3] = gfx_bank >> 12; - banks[2] = (gfx_bank >> 8) & 0x0f; - banks[1] = (gfx_bank >> 4) & 0x0f; - banks[0] = gfx_bank & 0xf; - - INT32 dx = BURN_ENDIAN_SWAP_INT16(scrollx[1+o]); - INT32 dy = BURN_ENDIAN_SWAP_INT16(scrolly[1+o]); - - INT32 flipx = 0; - INT32 flipy = 0; - - if (video_register & 2) { - dx = 256-dx-64; - flipx = 1; - } - - if (video_register & 1) { - dy = 256-dy; - flipy = 1; - } - if (is_vulcan) flipy ^= 1; - - INT32 palette = o; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - if (video_register & 2) sx ^= 0x1f8; - if (video_register & 1) sy ^= 0x1f8; - - sx = (sx - dx) & 0x1ff; - sy = (sy - dy) & 0x1ff; - if (sx >= 320) sx-=512; - if (sy >= 256) sy-=512; - - sy -= 16; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 color = (0x20 + (code >> 13) + 8 * palette); - code = (code & 0x7ff) | (banks[(code >> 11) & 3] << 11); - - if (sx >= 0 && sx < nScreenWidth-7 && sy >= 0 && sy < nScreenHeight-7) { - if (opaque) { - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxExp); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxExp); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxExp); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxExp); - } - } - } else { - if (code == 0) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxExp); - } else { - Render8x8Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxExp); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxExp); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxExp); - } - } - } - } else { - if (sy < -7 || sy >= nScreenHeight || sx >= nScreenWidth) continue; - - if (opaque) { - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxExp); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxExp); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxExp); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxExp); - } - } - } else { - if (code == 0) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxExp); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxExp); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxExp); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxExp); - } - } - } - } - } -} - -static void draw_sprite(UINT16 *pen_data, INT32 pal_base, INT32 xpos, INT32 ypos, INT32 width, INT32 height, INT32 flipx, INT32 flipy) -{ - if (xpos >= 320) xpos -= 0x10000; - if (ypos >= 256) ypos -= 0x10000; - - for (INT32 y = 0; y < height; y++) - { - INT32 sy = (flipy) ? (ypos + height - 1 - y) : (ypos + y); - - if (sy >= 16 && sy < 240) - { - UINT16 *dest = pTransDraw + (sy - 16) * nScreenWidth; - - for (INT32 x = 0; x < width; x++) - { - INT32 sx = (flipx) ? (xpos + width - 1 - x) : (xpos + x); - - if (sx >= 0 && sx < 320) - { - INT32 pen = BURN_ENDIAN_SWAP_INT16(pen_data[x/4]); - - pen = (pen >> ((~x & 3) << 2)) & 0x0f; - - if (pen) dest[sx] = pal_base + pen; - } - } - } - - pen_data += width/4; - } -} - -static void draw_sprites(INT32 priority) -{ - UINT16 *twin16_sprite_gfx_ram = (UINT16*)DrvSprGfxRAM; - UINT16 *twin16_gfx_rom = (UINT16*)DrvGfxROM1; - UINT16 *buffered_spriteram16 = (UINT16*)DrvSprBuf; - - UINT16 *source = 0x1800+buffered_spriteram16; - UINT16 *finish = 0x1800+buffered_spriteram16 + 0x800 - 4; - - for (; source < finish; source += 4) - { - INT32 attributes = BURN_ENDIAN_SWAP_INT16(source[3]); - INT32 prio = (attributes&0x4000) >> 14; - if (prio != priority) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(source[0]); - - if (code != 0xffff && attributes & 0x8000) - { - INT32 xpos = BURN_ENDIAN_SWAP_INT16(source[1]); - INT32 ypos = BURN_ENDIAN_SWAP_INT16(source[2]); - - INT32 pal_base = ((attributes&0xf)+0x10)*16; - INT32 height = 16<<((attributes>>6)&0x3); - INT32 width = 16<<((attributes>>4)&0x3); - INT32 flipy = attributes&0x0200; - INT32 flipx = attributes&0x0100; - UINT16 *pen_data = 0; - - if( twin16_custom_video == 1 ) - { - pen_data = twin16_gfx_rom + 0x80000; - } - else - { - switch( (code>>12)&0x3 ) - { - case 0: - pen_data = twin16_gfx_rom; - break; - - case 1: - pen_data = twin16_gfx_rom + 0x40000; - break; - - case 2: - pen_data = twin16_gfx_rom + 0x80000; - if( code&0x4000 ) pen_data += 0x40000; - break; - - case 3: - pen_data = twin16_sprite_gfx_ram; - break; - } - - code &= 0xfff; - } - - if (height == 64 && width == 64) - { - code &= ~8; - } - else if (height == 32 && width == 32) - { - code &= ~3; - } - else if (height == 32 && width == 16) - { - code &= ~1; - } - else if (height == 16 && width == 32) - { - code &= ~1; - } - - pen_data += code << 6; - - if( video_register&1 ) - { - if (ypos>65000) ypos=ypos-65536; - ypos = 256-ypos-height; - flipy = !flipy; - } - if( video_register&2 ) - { - if (xpos>65000) xpos=xpos-65536; - xpos = 320-xpos-width; - flipx = !flipx; - } - - draw_sprite(pen_data, pal_base, xpos, ypos, width, height, flipx, flipy); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPal(); - } - - if (nBurnLayer & 1) draw_layer(1); - if (nSpriteEnable & 1) draw_sprites(1); - if (nBurnLayer & 2) draw_layer(0); - if (nSpriteEnable & 2) draw_sprites(0); - if (nBurnLayer & 4) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, sizeof ( DrvInputs )); - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - // Clear Opposites - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[3] & 0x0c) == 0) DrvInputs[3] |= 0x0c; - if ((DrvInputs[3] & 0x03) == 0) DrvInputs[3] |= 0x03; - } - - INT32 nSegment; - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 100; - if (twin16_custom_video == 0 && is_vulcan == 0) nInterleave = 1000; // devilw - - INT32 nTotalCycles[3] = { (twin16_custom_video == 1) ? 10000000 / 60 : 9216000 / 60, 9216000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekOpen(0); - nSegment = (nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nSegment); - if ((twin16_CPUA_register & 0x20) && i == nInterleave-1) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (twin16_custom_video != 1) { - SekOpen(1); - nCyclesDone[1] += SekRun(nSegment); - if ((twin16_CPUB_register & 0x02) && i == nInterleave-1) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - nSegment = (nTotalCycles[2] - nCyclesDone[2]) / (nInterleave - i); - - nCyclesDone[1] += ZetRun(nSegment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - UPD7759Update(0, pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - UPD7759Update(0, pSoundBuf, nSegmentLength); - K007232Update(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - if(~twin16_CPUA_register & 0x40 && need_process_spriteram) - twin16_spriteram_process(); - - need_process_spriteram = 1; - - memcpy (DrvSprBuf, DrvSprRAM, 0x4000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.nAddress = 0x000000; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNvRAM; - ba.nLen = 0x008000; - ba.nAddress = 0xb00000; - ba.szName = "Cue Brick NV RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - UPD7759Scan(0, nAction, pnMin); - BurnYM2151Scan(nAction); - K007232Scan(nAction, pnMin); - - SCAN_VAR(gfx_bank); - SCAN_VAR(video_register); - SCAN_VAR(twin16_CPUA_register); - SCAN_VAR(twin16_CPUB_register); - } - - if (nAction & ACB_WRITE) { - if (twin16_custom_video != 1) { - for (INT32 i = 0; i < 0x40000; i+=2) { - twin16_tile_write(i); - } - } - - SekOpen(0); - SekMapMemory(DrvNvRAM + (*DrvNvRAMBank * 0x400), 0x0b0000, 0x0b03ff, MAP_RAM); - SekClose(); - - SekOpen(1); - INT32 offset = (twin16_CPUB_register & 4) << 17; - SekMapMemory(DrvGfxROM1 + 0x100000 + offset, 0x700000, 0x77ffff, MAP_ROM); - SekClose(); - } - - return 0; -} - - -// Devil World - -static struct BurnRomInfo devilwRomDesc[] = { - { "687_t05.6n", 0x10000, 0x8ab7dc61, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "687_t04.4n", 0x10000, 0xc69924da, 1 | BRF_PRG | BRF_ESS }, // 1 - { "687_t09.6r", 0x10000, 0xfae97de0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "687_t08.4r", 0x10000, 0x8c898d67, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "687_q07.10n", 0x10000, 0x53110c0b, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "687_q06.8n", 0x10000, 0x9c53a0c5, 2 | BRF_PRG | BRF_ESS }, // 5 - { "687_q13.10s", 0x10000, 0x36ae6014, 2 | BRF_PRG | BRF_ESS }, // 6 - { "687_q12.8s", 0x10000, 0x6d012167, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "687_l03.10a", 0x08000, 0x7201983c, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "687_m14.d8", 0x04000, 0xd7338557, 4 | BRF_GRA }, // 9 Characters - - { "687i17.p16", 0x80000, 0x66cb3923, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "687i18.p18", 0x80000, 0xa1c7d0db, 5 | BRF_GRA }, // 11 - { "687i15.p13", 0x80000, 0xeec8c5b2, 5 | BRF_GRA }, // 12 - { "687i16.p15", 0x80000, 0x746cf48b, 5 | BRF_GRA }, // 13 - - { "687_l11.10r", 0x10000, 0x399deee8, 6 | BRF_GRA }, // 14 Sprites / Bg Tiles - { "687_l10.8r", 0x10000, 0x117c91ee, 6 | BRF_GRA }, // 15 - - { "687_i01.5a", 0x20000, 0xd4992dfb, 7 | BRF_SND }, // 16 K007232 Samples - - { "687_i02.7c", 0x20000, 0xe5947501, 8 | BRF_SND }, // 17 UPD7759 Samples -}; - -STD_ROM_PICK(devilw) -STD_ROM_FN(devilw) - -static INT32 devilwCallback() -{ - if (load68k(Drv68KROM0, 0)) return 1; - if (load68k(Drv68KROM1, 4)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 15, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 16, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x000000, 17, 1)) return 1; - - return 0; -} - -static INT32 devilwInit() -{ - twin16_custom_video = 0; - - return DrvInit(devilwCallback); -} - -struct BurnDriver BurnDrvDevilw = { - "devilw", NULL, NULL, NULL, "1987", - "Devil World\0", NULL, "Konami", "GX687", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, devilwRomInfo, devilwRomName, NULL, NULL, DevilwInputInfo, DevilwDIPInfo, - devilwInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Majuu no Ohkoku - -static struct BurnRomInfo majuuRomDesc[] = { - { "687_s05.6n", 0x10000, 0xbd99b434, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "687_s04.4n", 0x10000, 0x3df732e2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "687_s09.6r", 0x10000, 0x1f6efec3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "687_s08.4r", 0x10000, 0x8a16c8c6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "687_q07.10n", 0x10000, 0x53110c0b, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "687_q06.8n", 0x10000, 0x9c53a0c5, 2 | BRF_PRG | BRF_ESS }, // 5 - { "687_q13.10s", 0x10000, 0x36ae6014, 2 | BRF_PRG | BRF_ESS }, // 6 - { "687_q12.8s", 0x10000, 0x6d012167, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "687_l03.10a", 0x08000, 0x7201983c, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "687_l14.d8", 0x04000, 0x20ecccd6, 4 | BRF_GRA }, // 9 Characters - - { "687i17.p16", 0x80000, 0x66cb3923, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "687i18.p18", 0x80000, 0xa1c7d0db, 5 | BRF_GRA }, // 11 - { "687i15.p13", 0x80000, 0xeec8c5b2, 5 | BRF_GRA }, // 12 - { "687i16.p15", 0x80000, 0x746cf48b, 5 | BRF_GRA }, // 13 - - { "687_l11.10r", 0x10000, 0x399deee8, 6 | BRF_GRA }, // 14 Sprites / Bg Tiles - { "687_l10.8r", 0x10000, 0x117c91ee, 6 | BRF_GRA }, // 15 - - { "687_i01.5a", 0x20000, 0xd4992dfb, 7 | BRF_SND }, // 16 K007232 Samples - - { "687_i02.7c", 0x20000, 0xe5947501, 8 | BRF_SND }, // 17 UPD7759 Samples -}; - -STD_ROM_PICK(majuu) -STD_ROM_FN(majuu) - -struct BurnDriver BurnDrvMajuu = { - "majuu", "devilw", NULL, NULL, "1987", - "Majuu no Ohkoku\0", NULL, "Konami", "GX687", - L"\u9B54\u7363\u306E\u738B\u56FD\0Majuu no Ohkoku\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, majuuRomInfo, majuuRomName, NULL, NULL, DevilwInputInfo, DevilwDIPInfo, - devilwInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Dark Adventure - -static struct BurnRomInfo darkadvRomDesc[] = { - { "687_n05.6n", 0x10000, 0xa9195b0b, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "687_n04.4n", 0x10000, 0x65b55105, 1 | BRF_PRG | BRF_ESS }, // 1 - { "687_n09.6r", 0x10000, 0x1c6b594c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "687_n08.4r", 0x10000, 0xa9603196, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "687_n07.10n", 0x10000, 0x6154322a, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "687_n06.8n", 0x10000, 0x37a72e8b, 2 | BRF_PRG | BRF_ESS }, // 5 - { "687_n13.10s", 0x10000, 0xf1c252af, 2 | BRF_PRG | BRF_ESS }, // 6 - { "687_n12.8s", 0x10000, 0xda221944, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "687_n03.10a", 0x08000, 0xa24c682f, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "687_n14.d8", 0x04000, 0xc76ac6d2, 4 | BRF_GRA }, // 9 Characters - - { "687i17.p16", 0x80000, 0x66cb3923, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "687i18.p18", 0x80000, 0xa1c7d0db, 5 | BRF_GRA }, // 11 - { "687i15.p13", 0x80000, 0xeec8c5b2, 5 | BRF_GRA }, // 12 - { "687i16.p15", 0x80000, 0x746cf48b, 5 | BRF_GRA }, // 13 - - { "687_l11.10r", 0x10000, 0x399deee8, 6 | BRF_GRA }, // 14 Sprites / Bg Tiles - { "687_l10.8r", 0x10000, 0x117c91ee, 6 | BRF_GRA }, // 15 - - { "687_i01.5a", 0x20000, 0xd4992dfb, 7 | BRF_SND }, // 16 K007232 Samples - - { "687_i02.7c", 0x20000, 0xe5947501, 8 | BRF_SND }, // 17 UPD7759 Samples -}; - -STD_ROM_PICK(darkadv) -STD_ROM_FN(darkadv) - -struct BurnDriver BurnDrvDarkadv = { - "darkadv", "devilw", NULL, NULL, "1987", - "Dark Adventure\0", NULL, "Konami", "GX687", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_PREFIX_KONAMI, GBF_SHOOT, 0, - NULL, darkadvRomInfo, darkadvRomName, NULL, NULL, DarkadvInputInfo, DarkadvDIPInfo, - devilwInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Vulcan Venture (New) - -static struct BurnRomInfo vulcanRomDesc[] = { - { "785_w05.6n", 0x10000, 0x6e0e99cd, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "785_w04.4n", 0x10000, 0x23ec74ca, 1 | BRF_PRG | BRF_ESS }, // 1 - { "785_w09.6r", 0x10000, 0x377e4f28, 1 | BRF_PRG | BRF_ESS }, // 2 - { "785_w08.4r", 0x10000, 0x813d41ea, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "785_p07.10n", 0x10000, 0x686d549d, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "785_p06.8n", 0x10000, 0x70c94bee, 2 | BRF_PRG | BRF_ESS }, // 5 - { "785_p13.10s", 0x10000, 0x478fdb0a, 2 | BRF_PRG | BRF_ESS }, // 6 - { "785_p12.8s", 0x10000, 0x38ea402a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "785_g03.10a", 0x08000, 0x67a3b50d, 3 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - - { "785_h14.d8", 0x04000, 0x02f4b16f, 4 | BRF_GRA }, // 9 Characters - - { "785f17.p16", 0x80000, 0x4e7a7b82, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "785f18.p18", 0x80000, 0x3f604e9a, 5 | BRF_GRA }, // 11 - { "785f15.p13", 0x80000, 0x5bd239ac, 5 | BRF_GRA }, // 12 - { "785f16.p15", 0x80000, 0x95c6b8a3, 5 | BRF_GRA }, // 13 - - { "785_f01.5a", 0x20000, 0xa0d8d69e, 7 | BRF_SND }, // 14 K007232 Samples - - { "785_f02.7c", 0x20000, 0xc39f5ca4, 8 | BRF_SND }, // 15 UPD7759 Samples -}; - -STD_ROM_PICK(vulcan) -STD_ROM_FN(vulcan) - -static INT32 vulcanCallback() -{ - if (load68k(Drv68KROM0, 0)) return 1; - if (load68k(Drv68KROM1, 4)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x000000, 15, 1)) return 1; - - return 0; -} - -static INT32 vulcanInit() -{ - is_vulcan = 1; - twin16_custom_video = 0; - - return DrvInit(vulcanCallback); -} - -struct BurnDriver BurnDrvVulcan = { - "vulcan", NULL, NULL, NULL, "1988", - "Vulcan Venture (New)\0", NULL, "Konami", "GX785", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, vulcanRomInfo, vulcanRomName, NULL, NULL, DrvInputInfo, VulcanDIPInfo, - vulcanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Vulcan Venture (Old) - -static struct BurnRomInfo vulcanaRomDesc[] = { - { "785_r05.6n", 0x10000, 0x1777a57b, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "785_r04.4n", 0x10000, 0x790cbdf3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "785_u09.6r", 0x10000, 0x1aba7010, 1 | BRF_PRG | BRF_ESS }, // 2 - { "785_k08.4r", 0x10000, 0x36bb1be1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "785_p07.10n", 0x10000, 0x686d549d, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "785_p06.8n", 0x10000, 0x70c94bee, 2 | BRF_PRG | BRF_ESS }, // 5 - { "785_p13.10s", 0x10000, 0x478fdb0a, 2 | BRF_PRG | BRF_ESS }, // 6 - { "785_p12.8s", 0x10000, 0x38ea402a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "785_g03.10a", 0x08000, 0x67a3b50d, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "785_h14.d8", 0x04000, 0x02f4b16f, 4 | BRF_GRA }, // 9 Characters - - { "785f17.p16", 0x80000, 0x4e7a7b82, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "785f18.p18", 0x80000, 0x3f604e9a, 5 | BRF_GRA }, // 11 - { "785f15.p13", 0x80000, 0x5bd239ac, 5 | BRF_GRA }, // 12 - { "785f16.p15", 0x80000, 0x95c6b8a3, 5 | BRF_GRA }, // 13 - - { "785_f01.5a", 0x20000, 0xa0d8d69e, 7 | BRF_SND }, // 14 K007232 Samples - - { "785_f02.7c", 0x20000, 0xc39f5ca4, 8 | BRF_SND }, // 15 UPD7759 Samples -}; - -STD_ROM_PICK(vulcana) -STD_ROM_FN(vulcana) - -struct BurnDriver BurnDrvVulcana = { - "vulcana", "vulcan", NULL, NULL, "1988", - "Vulcan Venture (Old)\0", NULL, "Konami", "GX785", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, vulcanaRomInfo, vulcanaRomName, NULL, NULL, DrvInputInfo, VulcanDIPInfo, - vulcanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Vulcan Venture (Oldest) - -static struct BurnRomInfo vulcanbRomDesc[] = { - { "785_n05.6n", 0x10000, 0x6371d475, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "785_n04.4n", 0x10000, 0xb6f24b9e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "785_r09.6r", 0x10000, 0xfbfd1543, 1 | BRF_PRG | BRF_ESS }, // 2 - { "785_r08.4r", 0x10000, 0x36bb1be1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "785_g07.10n", 0x10000, 0xee09dd5d, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "785_g06.8n", 0x10000, 0x85ab7af7, 2 | BRF_PRG | BRF_ESS }, // 5 - { "785_g13.10s", 0x10000, 0x274f325d, 2 | BRF_PRG | BRF_ESS }, // 6 - { "785_g12.8s", 0x10000, 0x1625f933, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "785_g03.10a", 0x08000, 0x67a3b50d, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "785_h14.d8", 0x04000, 0x02f4b16f, 4 | BRF_GRA }, // 9 Characters - - { "785f17.p16", 0x80000, 0x4e7a7b82, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "785f18.p18", 0x80000, 0x3f604e9a, 5 | BRF_GRA }, // 11 - { "785f15.p13", 0x80000, 0x5bd239ac, 5 | BRF_GRA }, // 12 - { "785f16.p15", 0x80000, 0x95c6b8a3, 5 | BRF_GRA }, // 13 - - { "785_f01.5a", 0x20000, 0xa0d8d69e, 7 | BRF_SND }, // 14 K007232 Samples - - { "785_f02.7c", 0x20000, 0xc39f5ca4, 8 | BRF_SND }, // 15 UPD7759 Samples -}; - -STD_ROM_PICK(vulcanb) -STD_ROM_FN(vulcanb) - -struct BurnDriver BurnDrvVulcanb = { - "vulcanb", "vulcan", NULL, NULL, "1988", - "Vulcan Venture (Oldest)\0", NULL, "Konami", "GX785", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, vulcanbRomInfo, vulcanbRomName, NULL, NULL, DrvInputInfo, VulcanDIPInfo, - vulcanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Gradius II - GOFER no Yabou (Japan New ver.) - -static struct BurnRomInfo gradius2RomDesc[] = { - { "785_x05.6n", 0x10000, 0x8a23a7b8, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "785_x04.4n", 0x10000, 0x88e466ce, 1 | BRF_PRG | BRF_ESS }, // 1 - { "785_x09.6r", 0x10000, 0x3f3d7d7a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "785_x08.4r", 0x10000, 0xc39c8efd, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "785_p07.10n", 0x10000, 0x686d549d, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "785_p06.8n", 0x10000, 0x70c94bee, 2 | BRF_PRG | BRF_ESS }, // 5 - { "785_p13.10s", 0x10000, 0x478fdb0a, 2 | BRF_PRG | BRF_ESS }, // 6 - { "785_p12.8s", 0x10000, 0x38ea402a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "785_g03.10a", 0x08000, 0x67a3b50d, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "785_g14.d8", 0x04000, 0x9dcdad9d, 4 | BRF_GRA }, // 9 Characters - - { "785f17.p16", 0x80000, 0x4e7a7b82, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "785f18.p18", 0x80000, 0x3f604e9a, 5 | BRF_GRA }, // 11 - { "785f15.p13", 0x80000, 0x5bd239ac, 5 | BRF_GRA }, // 12 - { "785f16.p15", 0x80000, 0x95c6b8a3, 5 | BRF_GRA }, // 13 - - { "785_f01.5a", 0x20000, 0xa0d8d69e, 7 | BRF_SND }, // 14 K007232 Samples - - { "785_f02.7c", 0x20000, 0xc39f5ca4, 8 | BRF_SND }, // 15 UPD7759 Samples -}; - -STD_ROM_PICK(gradius2) -STD_ROM_FN(gradius2) - -struct BurnDriver BurnDrvGradius2 = { - "gradius2", "vulcan", NULL, NULL, "1988", - "Gradius II - GOFER no Yabou (Japan New ver.)\0", NULL, "Konami", "GX785", - L"Gradius II - GOFER \u306E\u91CE\u671B (Japan New ver.)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, gradius2RomInfo, gradius2RomName, NULL, NULL, DrvInputInfo, Gradius2DIPInfo, - vulcanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Gradius II - GOFER no Yabou (Japan Old ver.) - -static struct BurnRomInfo gradius2aRomDesc[] = { - { "785_p05.6n", 0x10000, 0x4db0e736, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "785_p04.4n", 0x10000, 0x765b99e6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "785_t09.6r", 0x10000, 0x4e3f4965, 1 | BRF_PRG | BRF_ESS }, // 2 - { "785_j08.4r", 0x10000, 0x2b1c9108, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "785_p07.10n", 0x10000, 0x686d549d, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "785_p06.8n", 0x10000, 0x70c94bee, 2 | BRF_PRG | BRF_ESS }, // 5 - { "785_p13.10s", 0x10000, 0x478fdb0a, 2 | BRF_PRG | BRF_ESS }, // 6 - { "785_p12.8s", 0x10000, 0x38ea402a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "785_g03.10a", 0x08000, 0x67a3b50d, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "785_g14.d8", 0x04000, 0x9dcdad9d, 4 | BRF_GRA }, // 9 Characters - - { "785f17.p16", 0x80000, 0x4e7a7b82, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "785f18.p18", 0x80000, 0x3f604e9a, 5 | BRF_GRA }, // 11 - { "785f15.p13", 0x80000, 0x5bd239ac, 5 | BRF_GRA }, // 12 - { "785f16.p15", 0x80000, 0x95c6b8a3, 5 | BRF_GRA }, // 13 - - { "785_f01.5a", 0x20000, 0xa0d8d69e, 7 | BRF_SND }, // 14 K007232 Samples - - { "785_f02.7c", 0x20000, 0xc39f5ca4, 8 | BRF_SND }, // 15 UPD7759 Samples -}; - -STD_ROM_PICK(gradius2a) -STD_ROM_FN(gradius2a) - -struct BurnDriver BurnDrvGradius2a = { - "gradius2a", "vulcan", NULL, NULL, "1988", - "Gradius II - GOFER no Yabou (Japan Old ver.)\0", NULL, "Konami", "GX785", - L"Gradius II - GOFER \u306E\u91CE\u671B (Japan Old ver.)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, gradius2aRomInfo, gradius2aRomName, NULL, NULL, DrvInputInfo, VulcanDIPInfo, - vulcanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Gradius II - GOFER no Yabou (Japan Older ver.) - -static struct BurnRomInfo gradius2bRomDesc[] = { - { "785_p05.6n", 0x10000, 0x4db0e736, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "785_p04.4n", 0x10000, 0x765b99e6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "785_j09.6r", 0x10000, 0x6d96a7e3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "785_j08.4r", 0x10000, 0x2b1c9108, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "785_p07.10n", 0x10000, 0x686d549d, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "785_p06.8n", 0x10000, 0x70c94bee, 2 | BRF_PRG | BRF_ESS }, // 5 - { "785_p13.10s", 0x10000, 0x478fdb0a, 2 | BRF_PRG | BRF_ESS }, // 6 - { "785_p12.8s", 0x10000, 0x38ea402a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "785_g03.10a", 0x08000, 0x67a3b50d, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "785_g14.d8", 0x04000, 0x9dcdad9d, 4 | BRF_GRA }, // 9 Characters - - { "785f17.p16", 0x80000, 0x4e7a7b82, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "785f18.p18", 0x80000, 0x3f604e9a, 5 | BRF_GRA }, // 11 - { "785f15.p13", 0x80000, 0x5bd239ac, 5 | BRF_GRA }, // 12 - { "785f16.p15", 0x80000, 0x95c6b8a3, 5 | BRF_GRA }, // 13 - - { "785_f01.5a", 0x20000, 0xa0d8d69e, 7 | BRF_GRA }, // 14 K007232 Samples - - { "785_f02.7c", 0x20000, 0xc39f5ca4, 8 | BRF_GRA }, // 15 UPD7759 Samples -}; - -STD_ROM_PICK(gradius2b) -STD_ROM_FN(gradius2b) - -struct BurnDriver BurnDrvGradius2b = { - "gradius2b", "vulcan", NULL, NULL, "1988", - "Gradius II - GOFER no Yabou (Japan Older ver.)\0", NULL, "Konami", "GX785", - L"Gradius II - GOFER \u306E\u91CE\u671B (Japan Older ver.)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, gradius2bRomInfo, gradius2bRomName, NULL, NULL, DrvInputInfo, VulcanDIPInfo, - vulcanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// The Final Round (ver. M) - -static struct BurnRomInfo froundRomDesc[] = { - { "870_m21.bin", 0x20000, 0x436dbffb, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "870_m20.bin", 0x20000, 0xb1c79d6a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "870_f03.10a", 0x08000, 0xa645c727, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "870_f14.d8", 0x04000, 0xc9b46615, 4 | BRF_PRG | BRF_ESS }, // 3 Characters - - { "870c18.p18", 0x80000, 0x07927fe8, 5 | BRF_GRA }, // 4 Sprites / Bg Tiles - { "870c17.p16", 0x80000, 0x2bc99ff8, 5 | BRF_GRA }, // 5 - { "870c16.p15", 0x80000, 0x41df6a1b, 5 | BRF_GRA }, // 6 - { "870c15.p13", 0x80000, 0x8c9281df, 5 | BRF_GRA }, // 7 - - { "870_c01.5a", 0x20000, 0x6af96546, 7 | BRF_GRA }, // 8 K007232 Samples - - { "870_c02.7c", 0x20000, 0x54e12c6d, 8 | BRF_GRA }, // 9 UPD7759 Samples -}; - -STD_ROM_PICK(fround) -STD_ROM_FN(fround) - -static INT32 froundCallback() -{ - if (BurnLoadRom(Drv68KROM0 + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 7, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x000000, 9, 1)) return 1; - - return 0; -} - -static INT32 froundInit() -{ - twin16_custom_video = 1; - - return DrvInit(froundCallback); -} - -struct BurnDriver BurnDrvFround = { - "fround", NULL, NULL, NULL, "1988", - "The Final Round (ver. M)\0", NULL, "Konami", "GX870", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, froundRomInfo, froundRomName, NULL, NULL, DrvInputInfo, FroundDIPInfo, - froundInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// The Final Round (ver. L) - -static struct BurnRomInfo froundlRomDesc[] = { - { "870_l21.bin", 0x20000, 0xe21a3a19, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "870_l20.bin", 0x20000, 0x0ce9786f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "870_f03.10a", 0x08000, 0xa645c727, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "870_f14.d8", 0x04000, 0xc9b46615, 4 | BRF_PRG | BRF_ESS }, // 3 Characters - - { "870c18.p18", 0x80000, 0x07927fe8, 5 | BRF_GRA }, // 4 Sprites / Bg Tiles - { "870c17.p16", 0x80000, 0x2bc99ff8, 5 | BRF_GRA }, // 5 - { "870c16.p15", 0x80000, 0x41df6a1b, 5 | BRF_GRA }, // 6 - { "870c15.p13", 0x80000, 0x8c9281df, 5 | BRF_GRA }, // 7 - - { "870_c01.5a", 0x20000, 0x6af96546, 7 | BRF_GRA }, // 8 K007232 Samples - - { "870_c02.7c", 0x20000, 0x54e12c6d, 8 | BRF_GRA }, // 9 UPD7759 Samples -}; - -STD_ROM_PICK(froundl) -STD_ROM_FN(froundl) - -struct BurnDriver BurnDrvFroundl = { - "froundl", "fround", NULL, NULL, "1988", - "The Final Round (ver. L)\0", NULL, "Konami", "GX870", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, froundlRomInfo, froundlRomName, NULL, NULL, DrvInputInfo, FroundDIPInfo, - froundInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Hard Puncher (Japan) - -static struct BurnRomInfo hpuncherRomDesc[] = { - { "870_h05.6n", 0x10000, 0x2bcfeef3, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "870_h04.4n", 0x10000, 0xb9f97fd3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "870_h09.6r", 0x10000, 0x96a4f8b1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "870_h08.4r", 0x10000, 0x46d65156, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "870_h07.10n", 0x10000, 0xb4dda612, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "870_h06.8n", 0x10000, 0x696ba702, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "870_g03.10a", 0x08000, 0xdb9c10c8, 3 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "870_f14.d8", 0x04000, 0xc9b46615, 4 | BRF_GRA }, // 7 Characters - - { "870c17.p16", 0x80000, 0x2bc99ff8, 5 | BRF_GRA }, // 8 Sprites / Bg Tiles - { "870c18.p18", 0x80000, 0x07927fe8, 5 | BRF_GRA }, // 9 - { "870c15.p13", 0x80000, 0x8c9281df, 5 | BRF_GRA }, // 10 - { "870c16.p15", 0x80000, 0x41df6a1b, 5 | BRF_GRA }, // 11 - - { "870_c01.5a", 0x20000, 0x6af96546, 7 | BRF_GRA }, // 12 K007232 Samples - - { "870_c02.7c", 0x20000, 0x54e12c6d, 8 | BRF_GRA }, // 13 UPD7759 Samples -}; - -STD_ROM_PICK(hpuncher) -STD_ROM_FN(hpuncher) - -static INT32 hpuncherCallback() -{ - if (load68k(Drv68KROM0, 0)) return 1; - - if (BurnLoadRom(Drv68KROM1 + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x000000, 5, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 12, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x000000, 13, 1)) return 1; - - return 0; -} - -static INT32 hpuncherInit() -{ - twin16_custom_video = 2; - - return DrvInit(hpuncherCallback); -} - -struct BurnDriver BurnDrvHpuncher = { - "hpuncher", "fround", NULL, NULL, "1988", - "Hard Puncher (Japan)\0", NULL, "Konami", "GX870", - L"Hard Puncher \uFF0D\u8840\u307E\u307F\u308C\u306E\u6804\u5149\uFF0D (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SPORTSMISC, 0, - NULL, hpuncherRomInfo, hpuncherRomName, NULL, NULL, DrvInputInfo, FroundDIPInfo, - hpuncherInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// M.I.A. - Missing in Action (version R) (Japan) - -static struct BurnRomInfo miajRomDesc[] = { - { "808_r05.6n", 0x10000, 0x91fd83f4, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "808_r04.4n", 0x10000, 0xf1c8c597, 1 | BRF_PRG | BRF_ESS }, // 1 - { "808_r09.6r", 0x10000, 0xf74d4467, 1 | BRF_PRG | BRF_ESS }, // 2 - { "808_r08.4r", 0x10000, 0x26f21704, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "808_e07.10n", 0x10000, 0x297bdcea, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "808_e06.8n", 0x10000, 0x8f576b33, 2 | BRF_PRG | BRF_ESS }, // 5 - { "808_e13.10s", 0x10000, 0x1fa708f4, 2 | BRF_PRG | BRF_ESS }, // 6 - { "808_e12.8s", 0x10000, 0xd62f1fde, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "808_e03.10a", 0x08000, 0x3d93a7cd, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "808_e14.d8", 0x04000, 0xb9d36525, 4 | BRF_GRA }, // 9 Characters - - { "808d17.p16", 0x80000, 0xd1299082, 5 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "808d15.p13", 0x80000, 0x2b22a6b6, 5 | BRF_GRA }, // 11 - - { "808_d01.5a", 0x20000, 0xfd4d37c0, 7 | BRF_GRA }, // 12 K007232 Samples -}; - -STD_ROM_PICK(miaj) -STD_ROM_FN(miaj) - -static INT32 miajCallback() -{ - if (load68k(Drv68KROM0, 0)) return 1; - if (load68k(Drv68KROM1, 4)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 12, 1)) return 1; - - return 0; -} - -static INT32 miajInit() -{ - twin16_custom_video = 2; - - return DrvInit(miajCallback); -} - -struct BurnDriver BurnDrvMiaj = { - "miaj", "mia", NULL, NULL, "1989", - "M.I.A. - Missing in Action (version R) (Japan)\0", NULL, "Konami", "GX808", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM, 0, - NULL, miajRomInfo, miajRomName, NULL, NULL, DrvInputInfo, MiajDIPInfo, - miajInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; - - -// Cue Brick (Japan) - -static struct BurnRomInfo cuebrckjRomDesc[] = { - { "903_e05.6n", 0x10000, 0x8b556220, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "903_e04.4n", 0x10000, 0xbf9c7927, 1 | BRF_PRG | BRF_ESS }, // 1 - { "903_e09.6r", 0x10000, 0x2a77554d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "903_e08.4r", 0x10000, 0xc0a430c1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "903_d07.10n", 0x10000, 0xfc0edce7, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "903_d06.8n", 0x10000, 0xb2cef6fe, 2 | BRF_PRG | BRF_ESS }, // 5 - { "903_e13.10s", 0x10000, 0x4fb5fb80, 2 | BRF_PRG | BRF_ESS }, // 6 - { "903_e12.8s", 0x10000, 0x883e3097, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "903_d03.10a", 0x08000, 0x455e855a, 3 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "903_e14.d8", 0x04000, 0xddbebbd5, 4 | BRF_GRA }, // 9 Characters - - { "903_e11.10r", 0x10000, 0x5c41faf8, 6 | BRF_GRA }, // 10 Sprites / Bg Tiles - { "903_e10.8r", 0x10000, 0x417576d4, 6 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(cuebrckj) -STD_ROM_FN(cuebrckj) - -static INT32 cuebrckjCallback() -{ - if (load68k(Drv68KROM0, 0)) return 1; - if (load68k(Drv68KROM1, 4)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11, 2)) return 1; - - return 0; -} - -static INT32 cuebrckjInit() -{ - twin16_custom_video = 2; - - return DrvInit(cuebrckjCallback); -} - -struct BurnDriver BurnDrvCuebrckj = { - "cuebrickj", "cuebrick", NULL, NULL, "1989", - "Cue Brick (Japan)\0", NULL, "Konami", "GX903", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PUZZLE, 0, - NULL, cuebrckjRomInfo, cuebrckjRomName, NULL, NULL, DrvInputInfo, CuebrckjDIPInfo, - cuebrckjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_ultraman.cpp b/jan/src/burn/drv/konami/d_ultraman.cpp deleted file mode 100644 index eaba18efa..000000000 --- a/jan/src/burn/drv/konami/d_ultraman.cpp +++ /dev/null @@ -1,691 +0,0 @@ -// FB Alpha Ultraman driver module -// Based on MAME driver by Manuel Abadia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "konamiic.h" - -static UINT8 *AllMem; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvGfxROMExp2; -static UINT8 *DrvGfxROMExp3; -static UINT8 *DrvSndROM; -static UINT8 *AllRam; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *soundlatch; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 bank0; -static INT32 bank1; -static INT32 bank2; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo UltramanInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 1, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 7, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Diagnostics", BIT_DIGITAL, DrvJoy1 + 4, "diag" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ultraman) - -static struct BurnDIPInfo UltramanDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x74, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x15, 0x01, 0x0f, 0x02, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x05, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x08, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x50, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x80, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "No Coin B" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x04, 0x00, "No" }, - {0x16, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x30, 0x10, "Easy" }, - {0x16, 0x01, 0x30, 0x30, "Normal" }, - {0x16, 0x01, 0x30, 0x20, "Hard" }, - {0x16, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x40, 0x40, "Single" }, - {0x16, 0x01, 0x40, 0x00, "Dual" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x16, 0x01, 0x80, 0x00, "Upright" }, -// {0x16, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Ultraman) - -void __fastcall ultraman_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x1c0019: - { - if (((data & 0x02) >> 1) != bank0) { - bank0 = (data & 0x02) >> 1; - K051316RedrawTiles(0); - } - - if (((data & 0x08) >> 3) != bank1) { - bank1 = (data & 0x08) >> 3; - K051316RedrawTiles(1); - } - - if (((data & 0x20) >> 5) != bank2) { - bank2 = (data & 0x20) >> 5; - K051316RedrawTiles(2); - } - - K051316WrapEnable(0,data & 0x01); - K051316WrapEnable(1,data & 0x04); - K051316WrapEnable(2,data & 0x10); - } - return; - - case 0x1c0021: - ZetNmi(); - return; - - case 0x1c0029: - *soundlatch = data; - return; - - case 0x1c0031: // watchdog - return; - } - - if ((address & 0xfff001) == 0x204001) { - K051316Write(0, (address >> 1) & 0x7ff, data); - return; - } - - if ((address & 0xfff001) == 0x205001) { - K051316Write(1, (address >> 1) & 0x7ff, data); - return; - } - - if ((address & 0xfff001) == 0x206001) { - K051316Write(2, (address >> 1) & 0x7ff, data); - return; - } - - if ((address & 0xffffe1) == 0x207f81) { - K051316WriteCtrl(0, (address >> 1) & 0x0f, data); - return; - } - - if ((address & 0xffffe1) == 0x207fa1) { - K051316WriteCtrl(1, (address >> 1) & 0x0f, data); - return; - } - - if ((address & 0xffffe1) == 0x207fc1) { - K051316WriteCtrl(2, (address >> 1) & 0x0f, data); - return; - } - - if ((address & 0xfffff1) == 0x304001) { - K051937Write((address >> 1) & 0x007, data); - return; - } - - if ((address & 0xfff801) == 0x304801) { - K051960Write((address >> 1) & 0x3ff, data); - return; - } - -} - -UINT8 __fastcall ultraman_read_byte(UINT32 address) -{ - switch (address) - { - case 0x1c0001: - return DrvInputs[0]; - - case 0x1c0003: - return DrvInputs[1]; - - case 0x1c0005: - return DrvInputs[2]; - - case 0x1c0007: - return DrvDips[0]; - - case 0x1c0009: - return DrvDips[1]; - } - - if ((address & 0xfff000) == 0x204000) { - return K051316Read(0, (address >> 1) & 0x7ff); - } - - if ((address & 0xfff000) == 0x205000) { - return K051316Read(1, (address >> 1) & 0x7ff); - } - - if ((address & 0xfff000) == 0x206000) { - return K051316Read(2, (address >> 1) & 0x7ff); - } - - if ((address & 0xfffff0) == 0x304000) { - return K051937Read((address >> 1) & 0x007); - } - - if ((address & 0xfff800) == 0x304800) { - return K051960Read((address >> 1) & 0x3ff); - } - - return 0; -} - -void __fastcall ultraman_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xd000: - return; - - case 0xe000: - MSM6295Command(0, data); - return; - - case 0xf000: - BurnYM2151SelectRegister(data); - return; - - case 0xf001: - BurnYM2151WriteRegister(data); - return; - } -} - -UINT8 __fastcall ultraman_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return *soundlatch; - - case 0xe000: - return MSM6295ReadStatus(0); - - case 0xf000: - case 0xf001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void K051960Callback(INT32 *, INT32 *color, INT32 *priority, INT32 *shadow) -{ - *priority = (*color & 0x80) >> 7; - *color = 0xc0 + ((*color & 0x7e) >> 1); - *shadow = 0; -} - -static void K051316Callback0(INT32 *code, INT32 *color, INT32 *) -{ - *code |= ((*color & 0x07) << 8) | (bank0 << 11); - *color = ((*color & 0xf8) >> 3); -} - -static void K051316Callback1(INT32 *code, INT32 *color, INT32 *) -{ - *code |= ((*color & 0x07) << 8) | (bank1 << 11); - *color = 0x40 + ((*color & 0xf8) >> 3); -} - -static void K051316Callback2(INT32 *code, INT32 *color, INT32 *) -{ - *code |= ((*color & 0x07) << 8) | (bank2 << 11); - *color = 0x80 + ((*color & 0xf8) >> 3); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - - KonamiICReset(); - - bank0 = bank1 = bank2 = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x080000; - DrvGfxROMExp0 = Next; Next += 0x200000; - DrvGfxROMExp1 = Next; Next += 0x100000; - DrvGfxROMExp2 = Next; Next += 0x100000; - DrvGfxROMExp3 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - konami_palette32= (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x004000; - - DrvZ80RAM = Next; Next += 0x004000; - - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { STEP4(0,8) }; - INT32 XOffs0[16] = { STEP8(0, 1), STEP8(256, 1) }; - INT32 YOffs0[16] = { STEP8(0,32), STEP8(512,32) }; - INT32 Plane1[4] = { STEP4(0,1) }; - INT32 XOffs1[16] = { STEP16(0,4) }; - INT32 YOffs1[16] = { STEP16(0,64) }; - - GfxDecode(0x02000, 4, 16, 16, Plane0, XOffs0, YOffs0, 0x400, DrvGfxROM0, DrvGfxROMExp0); - GfxDecode(0x01000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, DrvGfxROM1, DrvGfxROMExp1); - GfxDecode(0x01000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, DrvGfxROM2, DrvGfxROMExp2); - GfxDecode(0x01000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, DrvGfxROM3, DrvGfxROMExp3); - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 4, 4, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x060000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x040000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x060000, 16, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 17, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x08ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x180000, 0x183fff, MAP_RAM); - SekSetWriteByteHandler(0, ultraman_write_byte); - SekSetReadByteHandler(0, ultraman_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0xbfff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80RAM); - ZetSetWriteHandler(ultraman_sound_write); - ZetSetReadHandler(ultraman_sound_read); - ZetClose(); - - K051960Init(DrvGfxROM0, DrvGfxROMExp0, 0xfffff); - K051960SetCallback(K051960Callback); - K051960SetSpriteOffset(9, 0); - - K051316Init(0, DrvGfxROM1, DrvGfxROMExp1, 0x7ffff, K051316Callback0, 4, 0); - K051316SetOffset(0, -105, -16); - - K051316Init(1, DrvGfxROM2, DrvGfxROMExp2, 0x7ffff, K051316Callback1, 4, 0); - K051316SetOffset(1, -105, -16); - - K051316Init(2, DrvGfxROM3, DrvGfxROMExp3, 0x7ffff, K051316Callback2, 4, 0); - K051316SetOffset(2, -105, -16); - - BurnYM2151Init(4000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - SekExit(); - ZetExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - - BurnFree (AllMem); - - return 0; -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x4000 / 2; i++) { - r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 10) & 0x1f; - g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 5) & 0x1f; - b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = (r << 16) + (g << 8) + b; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - KonamiClearBitmaps(0); - - K051316_zoom_draw(2, 0); - K051316_zoom_draw(1, 0); - K051960SpritesRender(0, 0); - K051316_zoom_draw(0, 0); - K051960SpritesRender(1, 1); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear Opposites - if ((DrvInputs[1] & 0x18) == 0) DrvInputs[1] |= 0x18; - if ((DrvInputs[1] & 0x06) == 0) DrvInputs[1] |= 0x06; - if ((DrvInputs[2] & 0x18) == 0) DrvInputs[2] |= 0x18; - if ((DrvInputs[2] & 0x06) == 0) DrvInputs[2] |= 0x06; - } - - INT32 nInterleave = 100; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCyclesSegment = nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] += SekRun(nCyclesSegment); - - nCyclesSegment = nCyclesTotal[1] / nInterleave; - - nCyclesDone[1] += ZetRun(nCyclesSegment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - KonamiICScan(nAction); - - SCAN_VAR(bank0); - SCAN_VAR(bank1); - SCAN_VAR(bank2); - } - - return 0; -} - - -// Ultraman (Japan) - -static struct BurnRomInfo ultramanRomDesc[] = { - { "910-b01.c11", 0x20000, 0x3d9e4323, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "910-b02.d11", 0x20000, 0xd24c82e9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "910-a05.d05", 0x08000, 0xebaef189, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "910-a19.l04", 0x80000, 0x2dc9ffdc, 3 | BRF_GRA }, // 3 K051960 Sprites - { "910-a20.l01", 0x80000, 0xa4298dce, 3 | BRF_GRA }, // 4 - - { "910-a07.j15", 0x20000, 0x8b43a64e, 4 | BRF_GRA }, // 5 K051316 #0 Tiles - { "910-a08.j16", 0x20000, 0xc3829826, 4 | BRF_GRA }, // 6 - { "910-a09.j18", 0x20000, 0xee10b519, 4 | BRF_GRA }, // 7 - { "910-a10.j19", 0x20000, 0xcffbb0c3, 4 | BRF_GRA }, // 8 - - { "910-a11.l15", 0x20000, 0x17a5581d, 5 | BRF_GRA }, // 9 K051316 #1 Tiles - { "910-a12.l16", 0x20000, 0x39763fb5, 5 | BRF_GRA }, // 10 - { "910-a13.l18", 0x20000, 0x66b25a4f, 5 | BRF_GRA }, // 11 - { "910-a14.l19", 0x20000, 0x09fbd412, 5 | BRF_GRA }, // 12 - - { "910-a15.m15", 0x20000, 0x6d5bfbb7, 6 | BRF_GRA }, // 13 K051316 #2 Tiles - { "910-a16.m16", 0x20000, 0x5f6f8c3d, 6 | BRF_GRA }, // 14 - { "910-a17.m18", 0x20000, 0x1f3ec4ff, 6 | BRF_GRA }, // 15 - { "910-a18.m19", 0x20000, 0xfdc42929, 6 | BRF_GRA }, // 16 - - { "910-a06.c06", 0x40000, 0x28fa99c9, 7 | BRF_SND }, // 17 MSM6295 Samples - - { "910-a21.f14", 0x00100, 0x64460fbc, 0 | BRF_OPT }, // 18 Priority Prom -}; - -STD_ROM_PICK(ultraman) -STD_ROM_FN(ultraman) - -struct BurnDriver BurnDrvUltraman = { - "ultraman", NULL, NULL, NULL, "1991", - "Ultraman (Japan)\0", NULL, "Banpresto / Bandai", "GX910", - L"\uFEFF\u30A6\u30EB\u30c8\u30E9\u30DE\u30f3 \u7A7A\u60F3\u7279\u64AE\u30B7\u30EA\u30FC\u30BA (Japan)\0Ultraman\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, ultramanRomInfo, ultramanRomName, NULL, NULL, UltramanInputInfo, UltramanDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_vendetta.cpp b/jan/src/burn/drv/konami/d_vendetta.cpp deleted file mode 100644 index 49e136066..000000000 --- a/jan/src/burn/drv/konami/d_vendetta.cpp +++ /dev/null @@ -1,1276 +0,0 @@ -// FB Alpha Vendetta / Crime Fighters 2 / Escape Kids driver module -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "konami_intf.h" -#include "konamiic.h" -#include "k053260.h" -#include "eeprom.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvKonROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *DrvKonRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *nDrvBank; - -static INT32 videobank; -static INT32 init_eeprom_count; -static INT32 irq_enabled; -static INT32 vblank = 0; -static INT32 bankoffset; - -static INT32 bg_colorbase; -static INT32 sprite_colorbase; -static INT32 layer_colorbase[3]; -static INT32 layerpri[3]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvJoy6; -static UINT8 DrvReset; -static UINT8 DrvInputs[5]; - -static INT32 nCyclesDone[2]; - -static struct BurnInputInfo Vendet4pInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p3 coin" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 2, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 3, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 0, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy4 + 7, "p4 coin" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 2, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 3, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 0, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Diagnostics", BIT_DIGITAL, &DrvJoy6, "diag" }, -}; - -STDINPUTINFO(Vendet4p) - -static struct BurnInputInfo VendettaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy5 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy5 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Diagnostics", BIT_DIGITAL, &DrvJoy6, "diag" }, - {"Service", BIT_DIGITAL, DrvJoy5 + 4, "service" }, -}; - -STDINPUTINFO(Vendetta) - -static struct BurnInputInfo EsckidsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy5 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy5 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy5 + 2, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 2, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 3, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 0, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy4 + 7, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy5 + 3, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 2, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 3, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 0, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Diagnostics", BIT_DIGITAL, &DrvJoy6, "diag" }, - {"Service 1", BIT_DIGITAL, DrvJoy5 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy5 + 5, "service2" }, - {"Service 3", BIT_DIGITAL, DrvJoy5 + 6, "service3" }, - {"Service 4", BIT_DIGITAL, DrvJoy5 + 7, "service4" }, -}; - -STDINPUTINFO(Esckids) - -static struct BurnInputInfo EsckidsjInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy5 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy5 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Diagnostics", BIT_DIGITAL, &DrvJoy6, "diag" }, - {"Service 1", BIT_DIGITAL, DrvJoy5 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy5 + 5, "service2" }, -}; - -STDINPUTINFO(Esckidsj) - -void vendetta_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x5fe0: - K052109RMRDLine = data & 0x08; - K053246_set_OBJCHA_line(data & 0x20); - return; - - case 0x5fe2: - { - if (data == 0xff) return; - - EEPROMWrite(data & 0x10, data & 0x08, data & 0x20); - - irq_enabled = (data >> 6) & 1; - - videobank = data & 1; - } - return; - - case 0x5fe4: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x5fe6: - case 0x5fe7: - K053260Write(0, address & 1, data); - return; - } - - if ((address & 0xffe0) == 0x5f80) { - K054000Write(address, data); - return; - } - - if ((address & 0xfff0) == 0x5fa0) { - K053251Write(address & 0x0f, data); - return; - } - - if ((address & 0xfff8) == 0x5fb0) { - K053246Write(address & 7, data); - return; - } - - if (videobank) { - if ((address & 0xf000) == 0x4000) { - address ^= 1; - K053247Write(address & 0x0fff, data); - return; - } - - if ((address & 0xf000) == 0x6000) { - DrvPalRAM[address & 0xfff] = data; - return; - } - } - - if ((address & 0xc000) == 0x4000) { - K052109Write(address & 0x3fff, data); - return; - } -} - -UINT8 vendetta_main_read(UINT16 address) -{ - switch (address) - { - case 0x5fc0: - return DrvInputs[0]; - - case 0x5fc1: - return DrvInputs[1]; - - case 0x5fc2: - return DrvInputs[2]; - - case 0x5fc3: - return DrvInputs[3]; - - case 0x5fd0: - { - INT32 res = (EEPROMRead() & 1) | vblank | ((DrvJoy6 << 2) ^ 0xf6); - - if (init_eeprom_count > 0) - { - init_eeprom_count--; - res &= 0xfb; - } - return res; - } - - case 0x5fd1: - return DrvInputs[4]; - - case 0x5fe4: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return 0; - - case 0x5fe6: - case 0x5fe7: - return K053260Read(0, (address & 1)+2); - - case 0x5fe8: - case 0x5fe9: - return K053246Read(address & 1); - - case 0x5fea: - return 0; // watchdog - } - - if ((address & 0xffe0) == 0x5f80) { - return K054000Read(address); - } - - if (videobank) { - if ((address & 0xf000) == 0x4000) { - address ^= 1; - return K053247Read(address & 0x0fff); - } - - if ((address & 0xf000) == 0x6000) { - return DrvPalRAM[address & 0x0fff]; - } - } - - if ((address & 0xc000) == 0x4000) { - return K052109Read(address & 0x3fff); - } - - return 0; -} - -void esckids_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3fd0: - K052109RMRDLine = data & 0x08; - K053246_set_OBJCHA_line(data & 0x20); - return; - - case 0x3fd2: - { - if (data == 0xff) return; - - EEPROMWrite(data & 0x10, data & 0x08, data & 0x20); - - irq_enabled = (data >> 6) & 1; - - videobank = data & 1; - } - return; - - case 0x3fd4: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x3fd6: - case 0x3fd7: - K053260Write(0, address & 1, data); - return; - } - - if ((address & 0xfff0) == 0x3fb0) { - K053251Write(address & 0x0f, data); - return; - } - - if ((address & 0xfff8) == 0x3fa0) { - K053246Write(address & 7, data); - return; - } - - if (videobank) { - if ((address & 0xf000) == 0x2000) { - address ^= 1; - K053247Write(address & 0x0fff, data); - return; - } - - if ((address & 0xf000) == 0x4000) { - DrvPalRAM[address & 0xfff] = data; - return; - } - } - - if (address >= 0x2000 && address <= 0x5fff) { - K052109Write(address - 0x2000, data); - return; - } -} - -UINT8 esckids_main_read(UINT16 address) -{ - switch (address) - { - case 0x3f80: - return DrvInputs[0]; - - case 0x3f81: - return DrvInputs[1]; - - case 0x3f82: - return DrvInputs[2]; - - case 0x3f83: - return DrvInputs[3]; - - case 0x3f92: - { - INT32 res = (EEPROMRead() & 1) | vblank | ((DrvJoy6 << 2) ^ 0xf6); - - if (init_eeprom_count > 0) - { - init_eeprom_count--; - res &= 0xfb; - } - return res; - } - - case 0x3f93: - return DrvInputs[4]; - - case 0x3fd4: - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return 0; - - case 0x3fd6: - case 0x3fd7: - return K053260Read(0, (address & 1)+2); - - case 0x3fd8: - case 0x3fd9: - return K053246Read(address & 1); - - } - - if (videobank) { - if ((address & 0xf000) == 0x2000) { - address ^= 1; - return K053247Read(address & 0x0fff); - } - - if ((address & 0xf000) == 0x4000) { - return DrvPalRAM[address & 0x0fff]; - } - } - - if (address >= 0x2000 && address <= 0x5fff) { - return K052109Read(address - 0x2000); - } - - return 0; -} - -void __fastcall vendetta_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf800: - BurnYM2151SelectRegister(data); - return; - - case 0xf801: - BurnYM2151WriteRegister(data); - return; - - case 0xfa00: - nCyclesDone[1] += ZetRun(100); - ZetNmi(); - return; - } - - if (address >= 0xfc00 && address < 0xfc30) { - K053260Write(0, address & 0xff, data); - return; - } -} - -UINT8 __fastcall vendetta_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return 0xff; - case 0xf801: - return BurnYM2151ReadStatus(); - } - - if (address >= 0xfc00 && address < 0xfc30) { - if ((address & 0x3f) == 0x01) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - - return K053260Read(0, address & 0xff); - } - - return 0; -} - -static void vendetta_set_lines(INT32 lines) -{ - nDrvBank[0] = lines; - - if (lines < 0x1c) { - konamiMapMemory(DrvKonROM + 0x10000 + (lines * 0x2000), 0x0000 | bankoffset, 0x1fff | bankoffset, MAP_ROM); - } -} - -static void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - *code |= ((*color & 0x03) << 8) | ((*color & 0x30) << 6) | ((*color & 0x0c) << 10) | (bank << 14); - *color = layer_colorbase[layer] + ((*color & 0xc0) >> 6); -} - -static void EsckidsK052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *) -{ - *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); - *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5); -} - -static void VendettaK053247Callback(INT32 *code, INT32 *color, INT32 *priority) -{ - INT32 pri = (*color & 0x03e0) >> 4; - if (pri <= layerpri[2]) *priority = 0; - else if (pri > layerpri[2] && pri <= layerpri[1]) *priority = 0xf0; - else if (pri > layerpri[1] && pri <= layerpri[0]) *priority = 0xf0 | 0xcc; - else *priority = 0xf0 | 0xcc | 0xaa; - - *code &= 0x7fff; - - *color = sprite_colorbase + (*color & 0x001f); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - konamiOpen(0); - konamiReset(); - konamiClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - KonamiICReset(); - - K053260Reset(0); - - EEPROMReset(); - - videobank = 0; - - if (EEPROMAvailable()) { - init_eeprom_count = 0; - } else { - init_eeprom_count = 1000; - } - - irq_enabled = 0; - videobank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvKonROM = Next; Next += 0x050000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROMExp0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROMExp1 = Next; Next += 0x800000; - - DrvSndROM = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - - DrvKonRAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x001000; - - nDrvBank = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static const eeprom_interface vendetta_eeprom_intf = -{ - 7, // address bits - 8, // data bits - "011000", // read command - "011100", // write command - 0, // erase command - "0100000000000", // lock command - "0100110000000", // unlock command - 0, - 0 -}; - -static INT32 DrvInit(INT32 nGame) -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvKonROM + 0x010000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 2, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 3, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 4, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 5, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 6, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 7, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 8, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x100000); - K053247GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x400000); - } - - if (nGame) // escape kids - { - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x28000, 0x8000); - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonRAM, 0x0000, 0x1fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x10000, 0x6000, 0x7fff, MAP_ROM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(esckids_main_write); - konamiSetReadHandler(esckids_main_read); - konamiSetlinesCallback(vendetta_set_lines); - konamiClose(); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x0fffff); - K052109SetCallback(EsckidsK052109Callback); - K052109AdjustScroll(8, -8); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x3fffff, VendettaK053247Callback, 1); - K053247SetSpriteOffset(-11, -14); - - bankoffset = 0x6000; - } else { - memcpy (DrvKonROM + 0x08000, DrvKonROM + 0x48000, 0x8000); - - konamiInit(0); - konamiOpen(0); - konamiMapMemory(DrvKonROM + 0x10000, 0x0000, 0x1fff, MAP_ROM); - konamiMapMemory(DrvKonRAM, 0x2000, 0x3fff, MAP_RAM); - konamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - konamiSetWriteHandler(vendetta_main_write); - konamiSetReadHandler(vendetta_main_read); - konamiSetlinesCallback(vendetta_set_lines); - konamiClose(); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x0fffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(0, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x3fffff, VendettaK053247Callback, 1); - K053247SetSpriteOffset(-53+2, -22); - - bankoffset = 0; - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(vendetta_sound_write); - ZetSetReadHandler(vendetta_sound_read); - ZetClose(); - - EEPROMInit(&vendetta_eeprom_intf); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - K053260Init(0, 3579545, DrvSndROM, 0x100000 >> nGame); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - K053260SetRoute(0, BURN_SND_K053260_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - konamiExit(); - ZetExit(); - - EEPROMExit(); - - BurnYM2151Exit(); - K053260Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - KonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x1000); - - K052109UpdateScroll(); - - INT32 layer[3]; - - bg_colorbase = K053251GetPaletteIndex(0); - sprite_colorbase = K053251GetPaletteIndex(1); - layer_colorbase[0] = K053251GetPaletteIndex(2); - layer_colorbase[1] = K053251GetPaletteIndex(3); - layer_colorbase[2] = K053251GetPaletteIndex(4); - - layerpri[0] = K053251GetPriority(2); - layerpri[1] = K053251GetPriority(3); - layerpri[2] = K053251GetPriority(4); - layer[0] = 0; - layer[1] = 1; - layer[2] = 2; - - konami_sortlayers3(layer,layerpri); - - if (nBurnLayer & 1) K052109RenderLayer(layer[0], K052109_OPAQUE, 1); - if (nBurnLayer & 2) K052109RenderLayer(layer[1], 0, 2); - if (nBurnLayer & 4) K052109RenderLayer(layer[2], 0, 4); - - if (nSpriteEnable & 1) K053247SpritesRender(); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - konamiNewFrame(); - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - - // Clear Opposites - if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c; - if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[2] & 0x0c) == 0) DrvInputs[2] |= 0x0c; - if ((DrvInputs[2] & 0x03) == 0) DrvInputs[2] |= 0x03; - if ((DrvInputs[3] & 0x0c) == 0) DrvInputs[3] |= 0x0c; - if ((DrvInputs[3] & 0x03) == 0) DrvInputs[3] |= 0x03; - } - - INT32 nInterleave = 100; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 6000000 / 60, 3579545 / 60 }; - - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetOpen(0); - konamiOpen(0); - - vblank = 8; - - INT32 trigger_vblank = (nInterleave / 256) * 240; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = konamiRun(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - - if (i == trigger_vblank) vblank = 0; // or 8? - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - K053260Update(0, pSoundBuf, nSegmentLength); - } - } - - konamiClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - konamiCpuScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K053260Scan(nAction); - - KonamiICScan(nAction); - - EEPROMScan(nAction, pnMin); - - SCAN_VAR(irq_enabled); - SCAN_VAR(videobank); - SCAN_VAR(nCyclesDone[1]); - } - - if (nAction & ACB_WRITE) { - konamiOpen(0); - vendetta_set_lines(nDrvBank[0]); - konamiClose(); - } - - return 0; -} - - -// Vendetta (World, 4 Players ver. T) - -static struct BurnRomInfo vendettaRomDesc[] = { - { "081t01.17c", 0x040000, 0xe76267f5, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "081b02", 0x010000, 0x4c604d9b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "081a09", 0x080000, 0xb4c777a9, 3 | BRF_GRA }, // 2 K052109 Tiles - { "081a08", 0x080000, 0x272ac8d9, 3 | BRF_GRA }, // 3 - - { "081a04", 0x100000, 0x464b9aa4, 4 | BRF_GRA }, // 4 K053247 Tiles - { "081a05", 0x100000, 0x4e173759, 4 | BRF_GRA }, // 5 - { "081a06", 0x100000, 0xe9fe6d80, 4 | BRF_GRA }, // 6 - { "081a07", 0x100000, 0x8a22b29a, 4 | BRF_GRA }, // 7 - - { "081a03", 0x100000, 0x14b6baea, 5 | BRF_SND }, // 8 K053260 Samples - - { "vendetta.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(vendetta) -STD_ROM_FN(vendetta) - -static INT32 VendettaInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvVendetta = { - "vendetta", NULL, NULL, NULL, "1991", - "Vendetta (World, 4 Players ver. T)\0", NULL, "Konami", "GX081", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, vendettaRomInfo, vendettaRomName, NULL, NULL, Vendet4pInputInfo, NULL, - VendettaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Vendetta (US, 4 Players ver. R) - -static struct BurnRomInfo vendettarRomDesc[] = { - { "081r01.17c", 0x040000, 0x84796281, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "081b02", 0x010000, 0x4c604d9b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "081a09", 0x080000, 0xb4c777a9, 3 | BRF_GRA }, // 2 K052109 Tiles - { "081a08", 0x080000, 0x272ac8d9, 3 | BRF_GRA }, // 3 - - { "081a04", 0x100000, 0x464b9aa4, 4 | BRF_GRA }, // 4 K053247 Tiles - { "081a05", 0x100000, 0x4e173759, 4 | BRF_GRA }, // 5 - { "081a06", 0x100000, 0xe9fe6d80, 4 | BRF_GRA }, // 6 - { "081a07", 0x100000, 0x8a22b29a, 4 | BRF_GRA }, // 7 - - { "081a03", 0x100000, 0x14b6baea, 5 | BRF_SND }, // 8 K053260 Samples - - { "vendettar.nv", 0x000080, 0xec3f0449, BRF_OPT }, -}; - -STD_ROM_PICK(vendettar) -STD_ROM_FN(vendettar) - -struct BurnDriver BurnDrvVendettar = { - "vendettar", "vendetta", NULL, NULL, "1991", - "Vendetta (US, 4 Players ver. R)\0", NULL, "Konami", "GX081", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, vendettarRomInfo, vendettarRomName, NULL, NULL, Vendet4pInputInfo, NULL, - VendettaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Vendetta (Asia, 4 Players ver. Z) - -static struct BurnRomInfo vendettazRomDesc[] = { - { "081z01.17c", 0x040000, 0x4d225a8d, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "081b02", 0x010000, 0x4c604d9b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "081a09", 0x080000, 0xb4c777a9, 3 | BRF_GRA }, // 2 K052109 Tiles - { "081a08", 0x080000, 0x272ac8d9, 3 | BRF_GRA }, // 3 - - { "081a04", 0x100000, 0x464b9aa4, 4 | BRF_GRA }, // 4 K053247 Tiles - { "081a05", 0x100000, 0x4e173759, 4 | BRF_GRA }, // 5 - { "081a06", 0x100000, 0xe9fe6d80, 4 | BRF_GRA }, // 6 - { "081a07", 0x100000, 0x8a22b29a, 4 | BRF_GRA }, // 7 - - { "081a03", 0x100000, 0x14b6baea, 5 | BRF_SND }, // 8 K053260 Samples - - { "vendetta.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(vendettaz) -STD_ROM_FN(vendettaz) - -struct BurnDriver BurnDrvVendettaz = { - "vendettaz", "vendetta", NULL, NULL, "1991", - "Vendetta (Asia, 4 Players ver. Z)\0", NULL, "Konami", "GX081", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, vendettazRomInfo, vendettazRomName, NULL, NULL, Vendet4pInputInfo, NULL, - VendettaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Vendetta (World, 2 Players ver. W) - -static struct BurnRomInfo vendetta2pRomDesc[] = { - { "081w01.17c", 0x040000, 0xcee57132, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "081b02", 0x010000, 0x4c604d9b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "081a09", 0x080000, 0xb4c777a9, 3 | BRF_GRA }, // 2 K052109 Tiles - { "081a08", 0x080000, 0x272ac8d9, 3 | BRF_GRA }, // 3 - - { "081a04", 0x100000, 0x464b9aa4, 4 | BRF_GRA }, // 4 K053247 Tiles - { "081a05", 0x100000, 0x4e173759, 4 | BRF_GRA }, // 5 - { "081a06", 0x100000, 0xe9fe6d80, 4 | BRF_GRA }, // 6 - { "081a07", 0x100000, 0x8a22b29a, 4 | BRF_GRA }, // 7 - - { "081a03", 0x100000, 0x14b6baea, 5 | BRF_SND }, // 8 K053260 Samples - - { "vendetta.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(vendetta2p) -STD_ROM_FN(vendetta2p) - -struct BurnDriver BurnDrvVendetta2p = { - "vendetta2p", "vendetta", NULL, NULL, "1991", - "Vendetta (World, 2 Players ver. W)\0", NULL, "Konami", "GX081", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, vendetta2pRomInfo, vendetta2pRomName, NULL, NULL, VendettaInputInfo, NULL, - VendettaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Vendetta (World, 2 Players ver. EB-A?) - -static struct BurnRomInfo vendetta2pebaRomDesc[] = { - { "081-eb-a01.17c", 0x040000, 0x8430bb52, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "081b02", 0x010000, 0x4c604d9b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "081a09", 0x080000, 0xb4c777a9, 3 | BRF_GRA }, // 2 K052109 Tiles - { "081a08", 0x080000, 0x272ac8d9, 3 | BRF_GRA }, // 3 - - { "081a04", 0x100000, 0x464b9aa4, 4 | BRF_GRA }, // 4 K053247 Tiles - { "081a05", 0x100000, 0x4e173759, 4 | BRF_GRA }, // 5 - { "081a06", 0x100000, 0xe9fe6d80, 4 | BRF_GRA }, // 6 - { "081a07", 0x100000, 0x8a22b29a, 4 | BRF_GRA }, // 7 - - { "081a03", 0x100000, 0x14b6baea, 5 | BRF_SND }, // 8 K053260 Samples - - { "vendetta.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(vendetta2peba) -STD_ROM_FN(vendetta2peba) - -struct BurnDriver BurnDrvVendetta2peba = { - "vendetta2peba", "vendetta", NULL, NULL, "1991", - "Vendetta (World, 2 Players ver. EB-A?)\0", NULL, "Konami", "GX081", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, vendetta2pebaRomInfo, vendetta2pebaRomName, NULL, NULL, VendettaInputInfo, NULL, - VendettaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Vendetta (World, 2 Players ver. ?) - -static struct BurnRomInfo vendetta2punRomDesc[] = { - /* program rom labeled as 1 */ - { "1.17c", 0x040000, 0xb4edde48, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "081b02", 0x010000, 0x4c604d9b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "081a09", 0x080000, 0xb4c777a9, 3 | BRF_GRA }, // 2 K052109 Tiles - { "081a08", 0x080000, 0x272ac8d9, 3 | BRF_GRA }, // 3 - - { "081a04", 0x100000, 0x464b9aa4, 4 | BRF_GRA }, // 4 K053247 Tiles - { "081a05", 0x100000, 0x4e173759, 4 | BRF_GRA }, // 5 - { "081a06", 0x100000, 0xe9fe6d80, 4 | BRF_GRA }, // 6 - { "081a07", 0x100000, 0x8a22b29a, 4 | BRF_GRA }, // 7 - - { "081a03", 0x100000, 0x14b6baea, 5 | BRF_SND }, // 8 K053260 Samples - - { "vendetta.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(vendetta2pun) -STD_ROM_FN(vendetta2pun) - -struct BurnDriver BurnDrvVendetta2pun = { - "vendetta2pun", "vendetta", NULL, NULL, "1991", - "Vendetta (World, 2 Players ver. ?)\0", NULL, "Konami", "GX081", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, vendetta2punRomInfo, vendetta2punRomName, NULL, NULL, VendettaInputInfo, NULL, - VendettaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Vendetta (Asia, 2 Players ver. U) - -static struct BurnRomInfo vendetta2puRomDesc[] = { - { "081u01.17c", 0x040000, 0xb4d9ade5, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "081b02", 0x010000, 0x4c604d9b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "081a09", 0x080000, 0xb4c777a9, 3 | BRF_GRA }, // 2 K052109 Tiles - { "081a08", 0x080000, 0x272ac8d9, 3 | BRF_GRA }, // 3 - - { "081a04", 0x100000, 0x464b9aa4, 4 | BRF_GRA }, // 4 K053247 Tiles - { "081a05", 0x100000, 0x4e173759, 4 | BRF_GRA }, // 5 - { "081a06", 0x100000, 0xe9fe6d80, 4 | BRF_GRA }, // 6 - { "081a07", 0x100000, 0x8a22b29a, 4 | BRF_GRA }, // 7 - - { "081a03", 0x100000, 0x14b6baea, 5 | BRF_SND }, // 8 K053260 Samples - - { "vendetta.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(vendetta2pu) -STD_ROM_FN(vendetta2pu) - -struct BurnDriver BurnDrvVendetta2pu = { - "vendetta2pu", "vendetta", NULL, NULL, "1991", - "Vendetta (Asia, 2 Players ver. U)\0", NULL, "Konami", "GX081", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, vendetta2puRomInfo, vendetta2puRomName, NULL, NULL, VendettaInputInfo, NULL, - VendettaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Vendetta (Asia, 2 Players ver. D) - -static struct BurnRomInfo vendetta2pdRomDesc[] = { - { "081d01.17c", 0x040000, 0x335da495, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "081b02", 0x010000, 0x4c604d9b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "081a09", 0x080000, 0xb4c777a9, 3 | BRF_GRA }, // 2 K052109 Tiles - { "081a08", 0x080000, 0x272ac8d9, 3 | BRF_GRA }, // 3 - - { "081a04", 0x100000, 0x464b9aa4, 4 | BRF_GRA }, // 4 K053247 Tiles - { "081a05", 0x100000, 0x4e173759, 4 | BRF_GRA }, // 5 - { "081a06", 0x100000, 0xe9fe6d80, 4 | BRF_GRA }, // 6 - { "081a07", 0x100000, 0x8a22b29a, 4 | BRF_GRA }, // 7 - - { "081a03", 0x100000, 0x14b6baea, 5 | BRF_SND }, // 8 K053260 Samples - - { "vendetta.nv", 0x000080, 0xfbac4e30, BRF_OPT }, -}; - -STD_ROM_PICK(vendetta2pd) -STD_ROM_FN(vendetta2pd) - -struct BurnDriver BurnDrvVendetta2pd = { - "vendetta2pd", "vendetta", NULL, NULL, "1991", - "Vendetta (Asia, 2 Players ver. D)\0", NULL, "Konami", "GX081", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, vendetta2pdRomInfo, vendetta2pdRomName, NULL, NULL, VendettaInputInfo, NULL, - VendettaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Crime Fighters 2 (Japan, 2 Players ver. P) - -static struct BurnRomInfo vendettajRomDesc[] = { - { "081p01.17c", 0x040000, 0x5fe30242, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "081b02", 0x010000, 0x4c604d9b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "081a09", 0x080000, 0xb4c777a9, 3 | BRF_GRA }, // 2 K052109 Tiles - { "081a08", 0x080000, 0x272ac8d9, 3 | BRF_GRA }, // 3 - - { "081a04", 0x100000, 0x464b9aa4, 4 | BRF_GRA }, // 4 K053247 Tiles - { "081a05", 0x100000, 0x4e173759, 4 | BRF_GRA }, // 5 - { "081a06", 0x100000, 0xe9fe6d80, 4 | BRF_GRA }, // 6 - { "081a07", 0x100000, 0x8a22b29a, 4 | BRF_GRA }, // 7 - - { "081a03", 0x100000, 0x14b6baea, 5 | BRF_SND }, // 8 K053260 Samples - - { "vendettaj.nv", 0x000080, 0x3550a54e, BRF_OPT }, -}; - -STD_ROM_PICK(vendettaj) -STD_ROM_FN(vendettaj) - -struct BurnDriver BurnDrvVendettaj = { - "vendettaj", "vendetta", NULL, NULL, "1991", - "Crime Fighters 2 (Japan, 2 Players ver. P)\0", NULL, "Konami", "GX081", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, vendettajRomInfo, vendettajRomName, NULL, NULL, VendettaInputInfo, NULL, - VendettaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 304, 224, 4, 3 -}; - - -// Escape Kids (Asia, 4 Players) - -static struct BurnRomInfo esckidsRomDesc[] = { - { "17c.bin", 0x020000, 0x9dfba99c, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "975f02", 0x010000, 0x994fb229, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "975c09", 0x080000, 0xbc52210e, 3 | BRF_GRA }, // 2 K052109 Tiles - { "975c08", 0x080000, 0xfcff9256, 3 | BRF_GRA }, // 3 - - { "975c04", 0x100000, 0x15688a6f, 4 | BRF_GRA }, // 4 K053247 Tiles - { "975c05", 0x100000, 0x1ff33bb7, 4 | BRF_GRA }, // 5 - { "975c06", 0x100000, 0x36d410f9, 4 | BRF_GRA }, // 6 - { "975c07", 0x100000, 0x97ec541e, 4 | BRF_GRA }, // 7 - - { "975c03", 0x080000, 0xdc4a1707, 5 | BRF_SND }, // 8 K053260 Samples - - { "esckids.nv", 0x000080, 0xa8522e1f, BRF_OPT }, -}; - -STD_ROM_PICK(esckids) -STD_ROM_FN(esckids) - -static INT32 EsckidsInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvEsckids = { - "esckids", NULL, NULL, NULL, "1991", - "Escape Kids (Asia, 4 Players)\0", NULL, "Konami", "GX975", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, esckidsRomInfo, esckidsRomName, NULL, NULL, EsckidsInputInfo, NULL, - EsckidsInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x800, - 288, 240, 4, 3 -}; - - -// Escape Kids (Japan, 2 Players) - -static struct BurnRomInfo esckidsjRomDesc[] = { - { "975r01", 0x020000, 0x7b5c5572, 1 | BRF_PRG | BRF_ESS }, // 0 Konami Custom Code - - { "975f02", 0x010000, 0x994fb229, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "975c09", 0x080000, 0xbc52210e, 3 | BRF_GRA }, // 2 K052109 Tiles - { "975c08", 0x080000, 0xfcff9256, 3 | BRF_GRA }, // 3 - - { "975c04", 0x100000, 0x15688a6f, 4 | BRF_GRA }, // 4 K053247 Tiles - { "975c05", 0x100000, 0x1ff33bb7, 4 | BRF_GRA }, // 5 - { "975c06", 0x100000, 0x36d410f9, 4 | BRF_GRA }, // 6 - { "975c07", 0x100000, 0x97ec541e, 4 | BRF_GRA }, // 7 - - { "975c03", 0x080000, 0xdc4a1707, 5 | BRF_SND }, // 8 K053260 Samples - - { "esckidsj.nv", 0x000080, 0x985e2a2d, BRF_OPT }, -}; - -STD_ROM_PICK(esckidsj) -STD_ROM_FN(esckidsj) - -struct BurnDriver BurnDrvEsckidsj = { - "esckidsj", "esckids", NULL, NULL, "1991", - "Escape Kids (Japan, 2 Players)\0", NULL, "Konami", "GX975", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0, - NULL, esckidsjRomInfo, esckidsjRomName, NULL, NULL, EsckidsjInputInfo, NULL, - EsckidsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_xexex.cpp b/jan/src/burn/drv/konami/d_xexex.cpp deleted file mode 100644 index 7d3593fb3..000000000 --- a/jan/src/burn/drv/konami/d_xexex.cpp +++ /dev/null @@ -1,995 +0,0 @@ -// FB Alpha Xexex driver module -// Based on MAME driver by Olivier Galibert - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k054539.h" -#include "eeprom.h" - -static UINT8 *AllMem; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvGfxROMExp2; -static UINT8 *DrvSndROM; -static UINT8 *DrvEeprom; -static UINT8 *AllRam; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; -static UINT8 *soundlatch3; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 layerpri[4]; -static INT32 layer_colorbase[4]; -static INT32 sprite_colorbase; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvReset; -static UINT16 DrvInputs[4]; -static UINT8 DrvDips[2]; - -static INT32 z80_bank; -static INT32 sound_nmi_enable; -static INT32 irq5_timer; -static UINT16 control_data; -static INT32 enable_alpha; - -static struct BurnInputInfo XexexInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service"}, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service"}, - {"Service Mode", BIT_DIGITAL, DrvJoy4 + 3, "diagnostics"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Xexex) - -static struct BurnDIPInfo XexexDIPList[]= -{ - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "PCM Volume Boost" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, -}; - -STDDIPINFO(Xexex) - -static void xexex_objdma() -{ - UINT16 *dst = (UINT16*)K053247Ram; - UINT16 *src = (UINT16*)DrvSprRAM; - INT32 num_inactive = 256; - INT32 counter = 256; - - do - { - if (*src & 0x8000) - { - dst[0] = src[0x0]; dst[1] = src[0x2]; - dst[2] = src[0x4]; dst[3] = src[0x6]; - dst[4] = src[0x8]; dst[5] = src[0xa]; - dst[6] = src[0xc]; dst[7] = src[0xe]; - dst += 8; - num_inactive--; - } - src += 0x40; - } - while (--counter); - - if (num_inactive) do { *dst = 0; dst += 8; } while (--num_inactive); -} - -static void update_de000() -{ - K053246_set_OBJCHA_line((control_data & 0x100) >> 8); - EEPROMWrite((control_data & 0x04), (control_data & 0x02), (control_data & 0x01)); - enable_alpha = ~control_data & 0x200; - -} - -static void __fastcall xexex_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffc0) == 0x0c0000) { - K056832WordWrite(address & 0x3e, data); - return; - } - - if ((address & 0xfffff8) == 0x0c2000) { - K053246Write((address & 0x06) + 0, data >> 8); - K053246Write((address & 0x06) + 1, data&0xff); - return; - } - - if ((address & 0xfffff0) == 0x0c8000) { - K053250RegWrite(0, address, data); - return; - } - - if ((address & 0xffffe0) == 0x0ca000) { - K054338WriteWord(address, data); - return; - } - - if ((address & 0xfffff8) == 0x0d8000) { - return; // regsb - } - - if ((address & 0xffc000) == 0x180000) { - K056832RamWriteWord(address & 0x1fff, data); - return; - } - - switch (address) - { - case 0x0de000: - control_data = data; - update_de000(); - return; - } -} - -static void __fastcall xexex_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffffc0) == 0x0c0000) { - K056832ByteWrite(address & 0x3f, data); - return; - } - - if ((address & 0xfffff8) == 0x0c2000) { - K053246Write((address & 0x07) ^ 0, data); - return; - } - - if ((address & 0xfffff0) == 0x0c8000) { - K053250RegWrite(0, address, data); - return; - } - - if ((address & 0xffffe0) == 0x0ca000) { - K054338WriteByte(address, data); - return; - } - - if ((address & 0xffffe1) == 0x0cc001) { - K053251Write((address / 2) & 0xf, data); - return; - } - - if ((address & 0xffffe0) == 0x0d0000) { - // k053252 - return; - } - - if ((address & 0xfffff8) == 0x0d8000) { - return; // regsb - } - - if ((address & 0xffc000) == 0x180000) { - K056832RamWriteByte(address & 0x1fff, data); - return; - } - - switch (address) - { - case 0x0d4000: - case 0x0d4001: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x0d6001: - case 0x0d6003: - case 0x0d6005: - case 0x0d6007: - case 0x0d6009: - return; // nop - - case 0x0d600c: - case 0x0d600d: - *soundlatch = data; - return; - - case 0x0d600e: - case 0x0d600f: - *soundlatch2 = data; - return; - - case 0x0de000: - control_data = (control_data & 0x00ff) | (data << 8); - update_de000(); - return; - - case 0x0de001: - control_data = (control_data & 0xff00) | (data << 0); - update_de000(); - return; - - case 0x170000: - return; // watchdog - } -} - -static UINT16 __fastcall xexex_main_read_word(UINT32 address) -{ - if ((address & 0xfffff0) == 0x0c8000) { - return K053250RegRead(0, address); - } - - if ((address & 0xffc000) == 0x180000) { - return K056832RamReadWord(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x190000) { - return K056832RomWordRead(address); - } - - if ((address & 0xffe000) == 0x1a0000) { - return K053250RomRead(0, address); - } - - switch (address) - { - case 0x0c4000: - return K053246Read(1) + (K053246Read(0) << 8); - - case 0x0da000: - return DrvInputs[1]; - - case 0x0da002: - return DrvInputs[2]; - - case 0x0dc000: - return DrvInputs[0]; - - case 0x0dc002: - return (DrvInputs[3] & 0x8) | 2 | (EEPROMRead() ? 0x01 : 0); - - case 0x0de000: - return control_data; - } - - return 0; -} - -static UINT8 __fastcall xexex_main_read_byte(UINT32 address) -{ - if ((address & 0xfffff0) == 0x0c8000) { - return K053250RegRead(0, address); - } - - if ((address & 0xffc000) == 0x180000) { - return K056832RamReadByte(address & 0x1fff); - } - - if ((address & 0xffe000) == 0x190000) { - return K056832RomWordRead(address) >> ((~address & 1) * 8); - } - - if ((address & 0xffe000) == 0x1a0000) { - return K053250RomRead(0, address) >> ((~address & 1) * 8); - } - - switch (address) - { - case 0x0c4000: - case 0x0c4001: - return K053246Read((address & 1)); // ^ 1? ?? - - case 0x0d6011: - return 0; // nop - - case 0x0d6015: - return *soundlatch3; - - case 0x0da000: - return DrvInputs[1] >> 8; - - case 0x0da001: - return DrvInputs[1]; - - case 0x0da002: - return DrvInputs[2] >> 8; - - case 0x0da003: - return DrvInputs[2]; - - case 0x0dc000: - return DrvInputs[0] >> 8; - - case 0x0dc001: - return DrvInputs[0]; - - case 0x0dc002: - return 0; - - case 0x0dc003: - return (DrvInputs[3] & 0x8) | 2 | (EEPROMRead() ? 0x01 : 0); - } - - return 0; -} - -static void bankswitch(INT32 data) -{ - z80_bank = data; - ZetMapMemory(DrvZ80ROM + ((data & 0x07) * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall xexex_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xec00: - BurnYM2151SelectRegister(data); - return; - - case 0xec01: - BurnYM2151WriteRegister(data); - return; - - case 0xf000: - *soundlatch3 = data; - return; - - case 0xf800: - bankswitch(data); - return; - } - - if (address >= 0xe000 && address <= 0xe22f) { - return K054539Write(0, address & 0x3ff, data); - } -} - -static UINT8 __fastcall xexex_sound_read(UINT16 address) -{ - if (address >= 0xe000 && address <= 0xe22f) { - return K054539Read(0, address & 0x3ff); - } - - switch (address) - { - case 0xec00: - case 0xec01: - return BurnYM2151ReadStatus(); - - case 0xf002: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xf003: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch2; - } - - return 0; -} - -static void xexex_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority) -{ - INT32 pri = (*color & 0x3e0) >> 4; - - if (pri <= layerpri[3]) *priority = 0x0000; - else if (pri > layerpri[3] && pri <= layerpri[2]) *priority = 0xff00; - else if (pri > layerpri[2] && pri <= layerpri[1]) *priority = 0xfff0; - else if (pri > layerpri[1] && pri <= layerpri[0]) *priority = 0xfffc; - else *priority = 0xfffe; - - *color = sprite_colorbase | (*color & 0x001f); -} - -static void xexex_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/) -{ - *color = layer_colorbase[layer] | (*color >> 2 & 0x0f); -} - -static const eeprom_interface xexex_eeprom_interface = -{ - 7, - 8, - "011000", - "011100", - "0100100000000", - "0100000000000", - "0100110000000", - 0, - 0 -}; - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - bankswitch(2); - ZetClose(); - - KonamiICReset(); - - BurnYM2151Reset(); - K054539Reset(0); - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvEeprom, 0, 128); - } - - control_data = 0; - irq5_timer = 0; - - for (INT32 i = 0; i < 4; i++) - { - layer_colorbase[i] = 0; - layerpri[i] = 0; - } - - sound_nmi_enable = 0; - z80_bank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROMExp0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROMExp1 = Next; Next += 0x800000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROMExp2 = Next; Next += 0x100000; - - DrvSndROM = Next; Next += 0x400000; - - DrvEeprom = Next; Next += 0x000080; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvSprRAM = Next; Next += 0x008000; - DrvPalRAM = Next; Next += 0x002000; - - DrvZ80RAM = Next; Next += 0x002000; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - soundlatch3 = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void XexexApanCallback(double one, double two) -{ - //bprintf(0, _T("apan %f, %f. "), one, two); - wip -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(54.25); - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 10, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 12, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 13, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 14, 1)) return 1; - - K053247GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x200000); - K053247GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x400000); - } - - K054338Init(); - - K053250Init(0, DrvGfxROM2, DrvGfxROMExp2, 0x80000); - K053250SetOffsets(0, -45, -16); - - K056832Init(DrvGfxROM0, DrvGfxROMExp0, 0x200000, xexex_tile_callback); - K056832SetGlobalOffsets(40, 0); - K056832SetLayerOffsets(0, -2, 16); - K056832SetLayerOffsets(1, 2, 16); - K056832SetLayerOffsets(2, 4, 16); - K056832SetLayerOffsets(3, 6, 16); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x3fffff, xexex_sprite_callback, 1); - K053247SetSpriteOffset(-88, -32); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x08ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x090000, 0x097fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x098000, 0x09ffff, MAP_RAM); - SekMapMemory((UINT8*)K053250Ram, 0x0c6000, 0x0c7fff, MAP_RAM); - SekMapMemory(Drv68KROM + 0x080000, 0x100000, 0x17ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x1b0000, 0x1b1fff, MAP_RAM); - SekSetWriteWordHandler(0, xexex_main_write_word); - SekSetWriteByteHandler(0, xexex_main_write_byte); - SekSetReadWordHandler(0, xexex_main_read_word); - SekSetReadByteHandler(0, xexex_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(xexex_sound_write); - ZetSetReadHandler(xexex_sound_read); - ZetClose(); - - EEPROMInit(&xexex_eeprom_interface); - - BurnYM2151Init(4000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - - K054539Init(0, 48000, DrvSndROM, 0x300000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, (DrvDips[0] & 0x08) ? 1.40 : 1.10, BURN_SND_ROUTE_BOTH); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, (DrvDips[0] & 0x08) ? 1.40 : 1.10, BURN_SND_ROUTE_BOTH); - K054539SetApanCallback(0, XexexApanCallback); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - SekExit(); - ZetExit(); - - EEPROMExit(); - - BurnYM2151Exit(); - K054539Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x2000/2; i+=2) { - DrvPalette[i/2] = ((pal[i+0] & 0xff) << 16) + pal[i+1]; - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - INT32 layer[4], bg_colorbase, plane, alpha; - - sprite_colorbase = K053251GetPaletteIndex(0); - - bg_colorbase = K053251GetPaletteIndex(1); - - layer_colorbase[0] = 0x70; - - for (plane = 1; plane < 4; plane++) - { - layer_colorbase[plane] = K053251GetPaletteIndex(plane+1); - } - - layer[0] = 1; - layerpri[0] = K053251GetPriority(2); - layer[1] = 2; - layerpri[1] = K053251GetPriority(3); - layer[2] = 3; - layerpri[2] = K053251GetPriority(4); - layer[3] = -1; - layerpri[3] = K053251GetPriority(1); - - konami_sortlayers4(layer, layerpri); - - KonamiClearBitmaps(0); - - for (plane = 0; plane < 4; plane++) - { - if (layer[plane] < 0) - { - if (nSpriteEnable & 2) K053250Draw(0, bg_colorbase, 0, 1 << plane); - } - else if (!enable_alpha || layer[plane] != 1) - { - if (nBurnLayer & (1 << layer[plane])) K056832Draw(layer[plane], 0, 1 << plane); - } - } - - if (nSpriteEnable & 1) K053247SpritesRender(); - - if (enable_alpha) - { - alpha = K054338_set_alpha_level(1); - - // this kludge fixes: flashy transitions in intro, cutscene after stage 3 - // is missing several effects, continue screen is missing "zooming!" numbers. - if (alpha < 0x10) - alpha = 0x10; - - if (alpha > 0) - { - if (nBurnLayer & 8) K056832Draw(1, K056832_SET_ALPHA(255-alpha), 0); - } - } - - if (nBurnLayer & 8) K056832Draw(0, 0, 0); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3 * sizeof(INT16)); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[3] = (DrvJoy4[3]) ? 0x00 : 0x08; // Service Mode - } - - INT32 nInterleave = 120; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { (16000000 * 100) / 5425, (8000000 * 100) / 5425 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesDone[0] += SekRun(nCyclesSegment); - - if (i == 0 && control_data & 0x20) { - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - - if (i != 0 && i != ((nInterleave/2)-1)) { - if (irq5_timer > 0) { - irq5_timer--; - if (irq5_timer == 0 && control_data & 0x40) { - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - } - } - } - - if (i == ((nInterleave/2)-1)) { - if (K053246_is_IRQ_enabled()) { - xexex_objdma(); - irq5_timer = 5; // lots of testing led to this number. - } - - if (control_data & 0x0800) - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesDone[1] += ZetRun(nCyclesSegment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - K054539Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029732; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - K054539Scan(nAction); - - KonamiICScan(nAction); - - SCAN_VAR(z80_bank); - SCAN_VAR(sound_nmi_enable); - - SCAN_VAR(irq5_timer); - - SCAN_VAR(control_data); - SCAN_VAR(enable_alpha); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(z80_bank); - ZetClose(); - } - - EEPROMScan(nAction, pnMin); - - return 0; -} - - - -// Xexex (ver EAA) - -static struct BurnRomInfo xexexRomDesc[] = { - { "067eaa01.16d", 0x040000, 0x3ebcb066, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "067eaa02.16f", 0x040000, 0x36ea7a48, 1 | BRF_PRG | BRF_ESS }, // 1 - { "067b03.13d", 0x040000, 0x97833086, 1 | BRF_PRG | BRF_ESS }, // 2 - { "067b04.13f", 0x040000, 0x26ec5dc8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "067eaa05.4e", 0x020000, 0x0e33d6ec, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "067b14.1n", 0x100000, 0x02a44bfa, 3 | BRF_GRA }, // 5 K056832 Characters - { "067b13.2n", 0x100000, 0x633c8eb5, 3 | BRF_GRA }, // 6 - - { "067b12.17n", 0x100000, 0x08d611b0, 4 | BRF_GRA }, // 7 K056832 Sprites - { "067b11.19n", 0x100000, 0xa26f7507, 4 | BRF_GRA }, // 8 - { "067b10.20n", 0x100000, 0xee31db8d, 4 | BRF_GRA }, // 9 - { "067b09.22n", 0x100000, 0x88f072ef, 4 | BRF_GRA }, // 10 - - { "067b08.22f", 0x080000, 0xca816b7b, 5 | BRF_GRA }, // 11 K053250 Tiles - - { "067b06.3e", 0x200000, 0x3b12fce4, 6 | BRF_SND }, // 12 K054539 Samples - { "067b07.1e", 0x100000, 0xec87fe1b, 6 | BRF_SND }, // 13 - - { "er5911.19b", 0x000080, 0x155624cc, 7 | BRF_PRG | BRF_ESS }, // 14 eeprom data -}; - -STD_ROM_PICK(xexex) -STD_ROM_FN(xexex) - -struct BurnDriver BurnDrvXexex = { - "xexex", NULL, NULL, NULL, "1991", - "Xexex (ver EAA)\0", NULL, "Konami", "GX067", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, xexexRomInfo, xexexRomName, NULL, NULL, XexexInputInfo, XexexDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 256, 4, 3 -}; - - -// Orius (ver UAA) - -static struct BurnRomInfo oriusRomDesc[] = { - { "067uaa01.16d", 0x040000, 0xf1263d3e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "067uaa02.16f", 0x040000, 0x77709f64, 1 | BRF_PRG | BRF_ESS }, // 1 - { "067b03.13d", 0x040000, 0x97833086, 1 | BRF_PRG | BRF_ESS }, // 2 - { "067b04.13f", 0x040000, 0x26ec5dc8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "067uaa05.4e", 0x020000, 0x0e33d6ec, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "067b14.1n", 0x100000, 0x02a44bfa, 3 | BRF_GRA }, // 5 K056832 Characters - { "067b13.2n", 0x100000, 0x633c8eb5, 3 | BRF_GRA }, // 6 - - { "067b12.17n", 0x100000, 0x08d611b0, 4 | BRF_GRA }, // 7 K056832 Sprites - { "067b11.19n", 0x100000, 0xa26f7507, 4 | BRF_GRA }, // 8 - { "067b10.20n", 0x100000, 0xee31db8d, 4 | BRF_GRA }, // 9 - { "067b09.22n", 0x100000, 0x88f072ef, 4 | BRF_GRA }, // 10 - - { "067b08.22f", 0x080000, 0xca816b7b, 5 | BRF_GRA }, // 11 K053250 Tiles - - { "067b06.3e", 0x200000, 0x3b12fce4, 6 | BRF_SND }, // 12 K054539 Samples - { "067b07.1e", 0x100000, 0xec87fe1b, 6 | BRF_SND }, // 13 - - { "er5911.19b", 0x000080, 0x547ee4e4, 7 | BRF_PRG | BRF_ESS }, // 14 eeprom data -}; - -STD_ROM_PICK(orius) -STD_ROM_FN(orius) - -struct BurnDriver BurnDrvOrius = { - "orius", "xexex", NULL, NULL, "1991", - "Orius (ver UAA)\0", NULL, "Konami", "GX067", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, oriusRomInfo, oriusRomName, NULL, NULL, XexexInputInfo, XexexDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 256, 4, 3 -}; - - -// Xexex (ver AAA) - -static struct BurnRomInfo xexexaRomDesc[] = { - { "067aaa01.16d", 0x040000, 0xcf557144, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "067aaa02.16f", 0x040000, 0xb7b98d52, 1 | BRF_PRG | BRF_ESS }, // 1 - { "067b03.13d", 0x040000, 0x97833086, 1 | BRF_PRG | BRF_ESS }, // 2 - { "067b04.13f", 0x040000, 0x26ec5dc8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "067eaa05.4e", 0x020000, 0x0e33d6ec, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "067b14.1n", 0x100000, 0x02a44bfa, 3 | BRF_GRA }, // 5 K056832 Characters - { "067b13.2n", 0x100000, 0x633c8eb5, 3 | BRF_GRA }, // 6 - - { "067b12.17n", 0x100000, 0x08d611b0, 4 | BRF_GRA }, // 7 K056832 Sprites - { "067b11.19n", 0x100000, 0xa26f7507, 4 | BRF_GRA }, // 8 - { "067b10.20n", 0x100000, 0xee31db8d, 4 | BRF_GRA }, // 9 - { "067b09.22n", 0x100000, 0x88f072ef, 4 | BRF_GRA }, // 10 - - { "067b08.22f", 0x080000, 0xca816b7b, 5 | BRF_GRA }, // 11 K053250 Tiles - - { "067b06.3e", 0x200000, 0x3b12fce4, 6 | BRF_SND }, // 12 K054539 Samples - { "067b07.1e", 0x100000, 0xec87fe1b, 6 | BRF_SND }, // 13 - - { "er5911.19b", 0x000080, 0x051c14c6, 7 | BRF_PRG | BRF_ESS }, // 14 eeprom data -}; - -STD_ROM_PICK(xexexa) -STD_ROM_FN(xexexa) - -struct BurnDriver BurnDrvXexexa = { - "xexexa", "xexex", NULL, NULL, "1991", - "Xexex (ver AAA)\0", NULL, "Konami", "GX067", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, xexexaRomInfo, xexexaRomName, NULL, NULL, XexexInputInfo, XexexDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 256, 4, 3 -}; - - -// Xexex (ver JAA) - -static struct BurnRomInfo xexexjRomDesc[] = { - { "067jaa01.16d", 0x040000, 0x06e99784, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "067jaa02.16f", 0x040000, 0x30ae5bc4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "067b03.13d", 0x040000, 0x97833086, 1 | BRF_PRG | BRF_ESS }, // 2 - { "067b04.13f", 0x040000, 0x26ec5dc8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "067jaa05.4e", 0x020000, 0x2f4dd0a8, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "067b14.1n", 0x100000, 0x02a44bfa, 3 | BRF_GRA }, // 5 K056832 Characters - { "067b13.2n", 0x100000, 0x633c8eb5, 3 | BRF_GRA }, // 6 - - { "067b12.17n", 0x100000, 0x08d611b0, 4 | BRF_GRA }, // 7 K056832 Sprites - { "067b11.19n", 0x100000, 0xa26f7507, 4 | BRF_GRA }, // 8 - { "067b10.20n", 0x100000, 0xee31db8d, 4 | BRF_GRA }, // 9 - { "067b09.22n", 0x100000, 0x88f072ef, 4 | BRF_GRA }, // 10 - - { "067b08.22f", 0x080000, 0xca816b7b, 5 | BRF_GRA }, // 11 K053250 Tiles - - { "067b06.3e", 0x200000, 0x3b12fce4, 6 | BRF_SND }, // 12 K054539 Samples - { "067b07.1e", 0x100000, 0xec87fe1b, 6 | BRF_SND }, // 13 - - { "er5911.19b", 0x000080, 0x79a79c7b, 7 | BRF_PRG | BRF_ESS }, // 14 eeprom data -}; - -STD_ROM_PICK(xexexj) -STD_ROM_FN(xexexj) - -struct BurnDriver BurnDrvXexexj = { - "xexexj", "xexex", NULL, NULL, "1991", - "Xexex (ver JAA)\0", NULL, "Konami", "GX067", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_HORSHOOT, 0, - NULL, xexexjRomInfo, xexexjRomName, NULL, NULL, XexexInputInfo, XexexDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_xmen.cpp b/jan/src/burn/drv/konami/d_xmen.cpp deleted file mode 100644 index 27153bce9..000000000 --- a/jan/src/burn/drv/konami/d_xmen.cpp +++ /dev/null @@ -1,1077 +0,0 @@ -// FB Alpha X-Men driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "konamiic.h" -#include "burn_ym2151.h" -#include "k054539.h" -#include "eeprom.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROMExp0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROMExp1; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; -static UINT8 *nDrvZ80Bank; - -static INT32 interrupt_enable; -static INT32 init_eeprom_count; - -static INT32 sprite_colorbase; -static INT32 bg_colorbase; -static INT32 layerpri[3]; -static INT32 layer_colorbase[3]; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static struct BurnInputInfo XmenInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 8, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 9, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy2 + 15, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 10, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy2 + 8, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy2 + 9, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy2 + 10, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy2 + 11, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy1 + 15, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy3 + 11, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy1 + 8, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy1 + 9, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy1 + 10, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy1 + 11, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Diagnostics", BIT_DIGITAL, DrvJoy3 + 14, "diag" }, -}; - -STDINPUTINFO(Xmen) - -static struct BurnInputInfo Xmen2pInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 8, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 9, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Diagnostics", BIT_DIGITAL, DrvJoy3 + 14, "diag" }, - {"Service 1", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy3 + 1, "service2" }, -}; - -STDINPUTINFO(Xmen2p) - -void __fastcall xmen_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x108000: - K052109RMRDLine = data & 0x02; - K053246_set_OBJCHA_line(data & 0x01); - return; - - case 0x108001: - EEPROMWrite(data & 0x08, data & 0x10, data & 0x04); - return; - - case 0x10804d: - *soundlatch = data; - return; - - case 0x10804e: - case 0x10804f: - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x10a001: - // watchdog - return; - - case 0x18fa01: - interrupt_enable = data & 0x04; - return; - } - - if (address >= 0x18c000 && address <= 0x197fff) { - if (address & 1) K052109Write((address - 0x18c000) >> 1, data); - return; - } - - if ((address & 0xfff000) == 0x100000) { - K053247Write((address & 0xfff) ^ 1, data); - return; - } - - if ((address & 0xfffff8) == 0x108020) { - K053246Write((address & 0x007)^1, data); - return; - } - - if ((address & 0xffffe0) == 0x108060) { - if (address & 1) K053251Write((address >> 1) & 0x0f, data); - return; - } -} - -void __fastcall xmen_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x100000) { - K053247Write(address & 0xffe, data | 0x10000); - return; - } - - if ((address & 0xfffff8) == 0x108020) { - K053246Write((address & 0x006), 0x10000|data); - return; - } -} - -UINT8 __fastcall xmen_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x108054: - case 0x108055: - return *soundlatch2; - - case 0x10a000: - case 0x10a001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x10a002: - case 0x10a003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x10a004: - if (init_eeprom_count > 0) { - init_eeprom_count--; - return 0xbf; - } - return DrvInputs[2] >> 8; - - case 0x10a005: // eeprom_r - init_eeprom_count--; - return (DrvInputs[2] & 0xbf) | (EEPROMRead() << 6); - - case 0x10a00c: - case 0x10a00d: - return K053246Read(~address & 1); - } - - if ((address & 0xfff000) == 0x100000) { - return K053247Read((address & 0xfff)^1); - } - - if (address >= 0x18c000 && address <= 0x197fff) { - return K052109Read((address - 0x18c000) >> 1); - } - - return 0; -} - -UINT16 __fastcall xmen_main_read_word(UINT32 /*address*/) -{ - return 0; -} - -static void bankswitch(INT32 bank) -{ - nDrvZ80Bank[0] = bank & 7; - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + nDrvZ80Bank[0] * 0x4000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + nDrvZ80Bank[0] * 0x4000); -} - -void __fastcall xmen_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe800: - case 0xec00: - BurnYM2151SelectRegister(data); - return; - - case 0xe801: - case 0xec01: - BurnYM2151WriteRegister(data); - return; - - case 0xf000: - *soundlatch2 = data; - return; - - case 0xf800: - bankswitch(data); - return; - } - - if (address >= 0xe000 && address <= 0xe22f) { - return K054539Write(0, address & 0x3ff, data); - } -} - -UINT8 __fastcall xmen_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe800: - case 0xe801: - case 0xec00: - case 0xec01: - return BurnYM2151ReadStatus(); - - case 0xf002: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - if (address >= 0xe000 && address <= 0xe22f) { - return K054539Read(0, address & 0x3ff); - } - - return 0; -} - -static void K052109Callback(INT32 layer, INT32 , INT32 *, INT32 *color, INT32 *, INT32 *) -{ - if (layer == 0) - *color = layer_colorbase[layer] + ((*color & 0xf0) >> 4); - else - *color = layer_colorbase[layer] + ((*color & 0x7c) >> 2); -} - -static void XmenK053247Callback(INT32 *code, INT32 *color, INT32 *priority_mask) -{ - INT32 pri = (*color & 0x00e0) >> 4; - if (pri <= layerpri[2]) *priority_mask = 0x00; - else if (pri > layerpri[2] && pri <= layerpri[1]) *priority_mask = 0xf0; - else if (pri > layerpri[1] && pri <= layerpri[0]) *priority_mask = 0xfc; - else *priority_mask = 0xfe; - - *color = (sprite_colorbase + (*color & 0x001f)) & 0x7f; - *code &= 0x7fff; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - K054539Reset(0); - - KonamiICReset(); - - EEPROMReset(); - - if (EEPROMAvailable()) { - init_eeprom_count = 0; - } else { - init_eeprom_count = 10; - } - - interrupt_enable = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROMExp0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROMExp1 = Next; Next += 0x800000; - - DrvSndROM = Next; Next += 0x200000; - - konami_palette32 = (UINT32*)Next; - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - DrvPalRAM = Next; Next += 0x001000; - Drv68KRAM = Next; Next += 0x005000; - - DrvZ80RAM = Next; Next += 0x002000; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - - nDrvZ80Bank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static const eeprom_interface xmen_eeprom_intf = -{ - 7, // address bits - 8, // data bits - "011000", // read command - "011100", // write command - 0, // erase command - "0100000000000", // lock command - "0100110000000", // unlock command - 0, - 0 -}; - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 5, 4, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 6, 4, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000004, 9, 8, 2)) return 1; - if (BurnLoadRomExt(DrvGfxROM1 + 0x000006, 10, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 11, 1)) return 1; - - K052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x200000); - K053247GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x400000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM + 0x00000, 0x101000, 0x101fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x104000, 0x104fff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x01000, 0x110000, 0x113fff, MAP_RAM); - SekSetWriteByteHandler(0, xmen_main_write_byte); - SekSetWriteWordHandler(0, xmen_main_write_word); - SekSetReadByteHandler(0, xmen_main_read_byte); - SekSetReadWordHandler(0, xmen_main_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + 0x8000); - ZetMapArea(0xc000, 0xdfff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xdfff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xdfff, 2, DrvZ80RAM); - ZetSetWriteHandler(xmen_sound_write); - ZetSetReadHandler(xmen_sound_read); - ZetClose(); - - EEPROMInit(&xmen_eeprom_intf); - - K052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x1fffff); - K052109SetCallback(K052109Callback); - K052109AdjustScroll(8, 0); - - K053247Init(DrvGfxROM1, DrvGfxROMExp1, 0x3fffff, XmenK053247Callback, 1); - K053247SetSpriteOffset(514, -158); - - BurnYM2151Init(4000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.20, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.20, BURN_SND_ROUTE_RIGHT); - - K054539Init(0, 48000, DrvSndROM, 0x200000); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - K054539SetRoute(0, BURN_SND_K054539_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - KonamiICExit(); - - SekExit(); - ZetExit(); - - BurnYM2151Exit(); - K054539Exit(); - - EEPROMExit(); - - BurnFree (AllMem); - - return 0; -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x1000 / 2; i++) { - INT32 d = BURN_ENDIAN_SWAP_INT16(p[i]); - - r = (d >> 0) & 0x1f; - g = (d >> 5) & 0x1f; - b = (d >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = (r << 16) | (g << 8) | b; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - K052109UpdateScroll(); - - INT32 layer[3]; - - bg_colorbase = K053251GetPaletteIndex(4); - sprite_colorbase = K053251GetPaletteIndex(1); - layer_colorbase[0] = K053251GetPaletteIndex(3); - layer_colorbase[1] = K053251GetPaletteIndex(0); - layer_colorbase[2] = K053251GetPaletteIndex(2); - - layerpri[0] = K053251GetPriority(3); - layerpri[1] = K053251GetPriority(0); - layerpri[2] = K053251GetPriority(2); - layer[0] = 0; - layer[1] = 1; - layer[2] = 2; - - konami_sortlayers3(layer,layerpri); - - KonamiClearBitmaps(DrvPalette[16 * bg_colorbase+1]); - - if (nBurnLayer & 1) K052109RenderLayer(layer[0], 0, 1); - if (nBurnLayer & 2) K052109RenderLayer(layer[1], 0, 2); - if (nBurnLayer & 4) K052109RenderLayer(layer[2], 0, 4); - - if (nSpriteEnable & 1) K053247SpritesRender(); - - KonamiBlendCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Clear Opposites - if ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03; - if ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c; - if ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03; - if ((DrvInputs[1] & 0xc00) == 0) DrvInputs[1] |= 0xc00; - if ((DrvInputs[1] & 0x300) == 0) DrvInputs[1] |= 0x300; - if ((DrvInputs[0] & 0xc00) == 0) DrvInputs[0] |= 0xc00; - if ((DrvInputs[0] & 0x300) == 0) DrvInputs[0] |= 0x300; - } - - INT32 nInterleave = nBurnSoundLen; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 16000000 / 60, 8000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCyclesSegment; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesSegment = SekRun(nCyclesSegment); - nCyclesDone[0] += nCyclesSegment; - - if (i == (nInterleave / 2) && interrupt_enable) { - SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - } - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (interrupt_enable) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - K054539Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - - K054539Scan(nAction); - - KonamiICScan(nAction); - EEPROMScan(nAction, pnMin); - - SCAN_VAR(interrupt_enable); - SCAN_VAR(init_eeprom_count); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(nDrvZ80Bank[0]); - ZetClose(); - } - - EEPROMScan(nAction, pnMin); - - return 0; -} - - -// X-Men (4 Players ver UBB) - -static struct BurnRomInfo xmenRomDesc[] = { - { "065-ubb04.10d", 0x020000, 0xf896c93b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-ubb05.10f", 0x020000, 0xe02e5d64, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.9d", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.9f", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.6f", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.15l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.16l", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.2h", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.2l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.1h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.1l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1f", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_ubb.nv", 0x000080, 0x52f334ba, BRF_OPT }, -}; - -STD_ROM_PICK(xmen) -STD_ROM_FN(xmen) - -struct BurnDriver BurnDrvXmen = { - "xmen", NULL, NULL, NULL, "1992", - "X-Men (4 Players ver UBB)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmenRomInfo, xmenRomName, NULL, NULL, XmenInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// X-Men (4 Players ver AEA) - -static struct BurnRomInfo xmenaRomDesc[] = { - { "065-aea04.10d", 0x020000, 0x0e8d2e98, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-aea05.10f", 0x020000, 0x0b742a4e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.9d", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.9f", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.6f", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.15l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.16l", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.2h", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.2l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.1h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.1l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1f", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_aea.nv", 0x000080, 0xd73d4f20, BRF_OPT }, -}; - -STD_ROM_PICK(xmena) -STD_ROM_FN(xmena) - -struct BurnDriver BurnDrvXmena = { - "xmena", "xmen", NULL, NULL, "1992", - "X-Men (4 Players ver AEA)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmenaRomInfo, xmenaRomName, NULL, NULL, XmenInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// X-Men (4 Players ver ADA) - -static struct BurnRomInfo xmenaaRomDesc[] = { - { "065-ada04.10d", 0x020000, 0xb8276624, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-ada05.10f", 0x020000, 0xc68582ad, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.9d", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.9f", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.6f", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.15l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.16l", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.2h", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.2l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.1h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.1l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1f", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_ada.nv", 0x000080, 0xa77a3891, BRF_OPT }, -}; - -STD_ROM_PICK(xmenaa) -STD_ROM_FN(xmenaa) - -struct BurnDriver BurnDrvXmenaa = { - "xmenaa", "xmen", NULL, NULL, "1992", - "X-Men (4 Players ver ADA)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmenaaRomInfo, xmenaaRomName, NULL, NULL, XmenInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// X-Men (4 Players ver EBA) - -static struct BurnRomInfo xmeneRomDesc[] = { - { "065-eba04.10d", 0x020000, 0x3588c5ec, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-eba05.10f", 0x020000, 0x79ce32f8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.9d", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.9f", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.6f", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.15l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.16l", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.2h", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.2l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.1h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.1l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1f", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_eba.nv", 0x000080, 0x37f8e77a, BRF_OPT }, -}; - -STD_ROM_PICK(xmene) -STD_ROM_FN(xmene) - -struct BurnDriver BurnDrvXmene = { - "xmene", "xmen", NULL, NULL, "1992", - "X-Men (4 Players ver EBA)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmeneRomInfo, xmeneRomName, NULL, NULL, XmenInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// X-Men (4 Players ver JBA) - -static struct BurnRomInfo xmenjRomDesc[] = { - { "065-jba04.10d", 0x020000, 0xd86cf5eb, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-jba05.10f", 0x020000, 0xabbc8126, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.9d", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.9f", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.6f", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.15l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.16l", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.2h", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.2l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.1h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.1l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1f", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_jba.nv", 0x000080, 0x7439cea7, BRF_OPT }, -}; - -STD_ROM_PICK(xmenj) -STD_ROM_FN(xmenj) - -struct BurnDriver BurnDrvXmenj = { - "xmenj", "xmen", NULL, NULL, "1992", - "X-Men (4 Players ver JBA)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmenjRomInfo, xmenjRomName, NULL, NULL, XmenInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// X-Men (2 Players ver EAA) - -static struct BurnRomInfo xmen2peRomDesc[] = { - { "065-eaa04.10d", 0x020000, 0x502861e7, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-eaa05.10f", 0x020000, 0xca6071bf, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.9d", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.9f", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.6f", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.15l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.16l", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.2h", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.2l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.1h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.1l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1f", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_eaa.nv", 0x000080, 0x1cbcb653, BRF_OPT }, -}; - -STD_ROM_PICK(xmen2pe) -STD_ROM_FN(xmen2pe) - -struct BurnDriver BurnDrvXmen2pe = { - "xmen2pe", "xmen", NULL, NULL, "1992", - "X-Men (2 Players ver EAA)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmen2peRomInfo, xmen2peRomName, NULL, NULL, Xmen2pInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// X-Men (2 Players ver UAB) - -static struct BurnRomInfo xmen2puRomDesc[] = { - { "065-uab04.10d", 0x020000, 0xff003db1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-uab05.10f", 0x020000, 0x4e99a943, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.9d", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.9f", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.6f", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.15l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.16l", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.2h", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.2l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.1h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.1l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1f", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_uab.nv", 0x000080, 0x79b76593, BRF_OPT }, -}; - -STD_ROM_PICK(xmen2pu) -STD_ROM_FN(xmen2pu) - -struct BurnDriver BurnDrvXmen2pu = { - "xmen2pu", "xmen", NULL, NULL, "1992", - "X-Men (2 Players ver UAB)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmen2puRomInfo, xmen2puRomName, NULL, NULL, Xmen2pInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// X-Men (2 Players ver AAA) - -static struct BurnRomInfo xmen2paRomDesc[] = { - { "065-aaa04.10d", 0x020000, 0x7f8b27c2, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-aaa05.10f", 0x020000, 0x841ed636, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.9d", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.9f", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.6f", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.15l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.16l", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.2h", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.2l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.1h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.1l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1f", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_aaa.nv", 0x000080, 0x750fd447, BRF_OPT }, -}; - -STD_ROM_PICK(xmen2pa) -STD_ROM_FN(xmen2pa) - -struct BurnDriver BurnDrvXmen2pa = { - "xmen2pa", "xmen", NULL, NULL, "1992", - "X-Men (2 Players ver AAA)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmen2paRomInfo, xmen2paRomName, NULL, NULL, Xmen2pInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// X-Men (2 Players ver JAA) - -static struct BurnRomInfo xmen2pjRomDesc[] = { - { "065-jaa04.10d", 0x020000, 0x66746339, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-jaa05.10f", 0x020000, 0x1215b706, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.9d", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.9f", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.6f", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.15l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.16l", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.2h", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.2l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.1h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.1l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1f", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_jaa.nv", 0x000080, 0x849a9e19, BRF_OPT }, -}; - -STD_ROM_PICK(xmen2pj) -STD_ROM_FN(xmen2pj) - -struct BurnDriver BurnDrvXmen2pj = { - "xmen2pj", "xmen", NULL, NULL, "1992", - "X-Men (2 Players ver JAA)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmen2pjRomInfo, xmen2pjRomName, NULL, NULL, Xmen2pInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// X-Men (6 Players ver ECB) - -static struct BurnRomInfo xmen6pRomDesc[] = { - { "065-ecb04.18g", 0x020000, 0x258eb21f, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-ecb05.18j", 0x020000, 0x25997bcd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.17g", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.17j", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.7b", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.1l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.1h", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.12l", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.17l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.22h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.22l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1d", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_ecb.nv", 0x000080, 0x462c6e1a, BRF_OPT }, -}; - -STD_ROM_PICK(xmen6p) -STD_ROM_FN(xmen6p) - -struct BurnDriverD BurnDrvXmen6p = { - "xmen6p", "xmen", NULL, NULL, "1992", - "X-Men (6 Players ver ECB)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_CLONE, 6, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmen6pRomInfo, xmen6pRomName, NULL, NULL, XmenInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 256, 4, 3 -}; - - -// X-Men (6 Players ver UCB) - -static struct BurnRomInfo xmen6puRomDesc[] = { - { "065-ucb04.18g", 0x020000, 0x0f09b8e0, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "065-ucb05.18j", 0x020000, 0x867becbf, 1 | BRF_PRG | BRF_ESS }, // 1 - { "065-a02.17g", 0x040000, 0xb31dc44c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "065-a03.17j", 0x040000, 0x13842fe6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "065-a01.7b", 0x020000, 0x147d3a4d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "065-a08.1l", 0x100000, 0x6b649aca, 3 | BRF_GRA }, // 5 Background Tiles - { "065-a07.1h", 0x100000, 0xc5dc8fc4, 3 | BRF_GRA }, // 6 - - { "065-a09.12l", 0x100000, 0xea05d52f, 4 | BRF_GRA }, // 7 Sprites - { "065-a10.17l", 0x100000, 0x96b91802, 4 | BRF_GRA }, // 8 - { "065-a12.22h", 0x100000, 0x321ed07a, 4 | BRF_GRA }, // 9 - { "065-a11.22l", 0x100000, 0x46da948e, 4 | BRF_GRA }, // 10 - - { "065-a06.1d", 0x200000, 0x5adbcee0, 5 | BRF_SND }, // 11 K054539 Samples - - { "xmen_ucb.nv", 0x000080, 0xf3d0f682, BRF_OPT }, -}; - -STD_ROM_PICK(xmen6pu) -STD_ROM_FN(xmen6pu) - -struct BurnDriverD BurnDrvXmen6pu = { - "xmen6pu", "xmen", NULL, NULL, "1992", - "X-Men (6 Players ver UCB)\0", NULL, "Konami", "GX065", - NULL, NULL, NULL, NULL, - BDF_CLONE, 6, HARDWARE_PREFIX_KONAMI, GBF_SCRFIGHT, 0, - NULL, xmen6puRomInfo, xmen6puRomName, NULL, NULL, XmenInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/d_yiear.cpp b/jan/src/burn/drv/konami/d_yiear.cpp deleted file mode 100644 index 995f33208..000000000 --- a/jan/src/burn/drv/konami/d_yiear.cpp +++ /dev/null @@ -1,601 +0,0 @@ -// FB Alpha Yie Ar Kung-Fu driver module -// Based on MAME driver by Enrique Sanchez (?) - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "vlm5030.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvVLMROM; -static UINT8 *DrvColPROM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; -static UINT8 *AllRam; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *flipscreen; -static UINT8 *nmi_enable; -static UINT8 *irq_enable; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static UINT8 sn76496_latch; - -static struct BurnInputInfo YiearInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Yiear) - -static struct BurnDIPInfo YiearDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x5b, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "1" }, - {0x15, 0x01, 0x03, 0x02, "2" }, - {0x15, 0x01, 0x03, 0x01, "3" }, - {0x15, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x04, 0x00, "Upright" }, - {0x15, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x15, 0x01, 0x08, 0x08, "30000 80000" }, - {0x15, 0x01, 0x08, 0x00, "40000 90000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x30, 0x30, "Easy" }, - {0x15, 0x01, 0x30, 0x10, "Normal" }, - {0x15, 0x01, 0x30, 0x20, "Difficult" }, - {0x15, 0x01, 0x30, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 0, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x16, 0x01, 0x02, 0x02, "Single" }, - {0x16, 0x01, 0x02, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Yiear) - -static void yiear_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x4000: - *flipscreen = data & 0x01; - *nmi_enable = data & 0x02; - *irq_enable = data & 0x04; - // coincounter = data & 0x18; (0 -> 8, 1 -> 10) - return; - - case 0x4800: - sn76496_latch = data; - return; - - case 0x4900: - SN76496Write(0, sn76496_latch); - return; - - case 0x4a00: - vlm5030_st(0, (data >> 1) & 1); - vlm5030_rst(0, (data >> 2) & 1); - return; - - case 0x4b00: - vlm5030_data_write(0, data); - return; - } -} - -static UINT8 yiear_read(UINT16 address) -{ - switch (address) - { - case 0x0000: - return vlm5030_bsy(0) ? 1 : 0; - - case 0x4c00: - return DrvDips[1]; - - case 0x4d00: - return DrvDips[2]; - - case 0x4e00: - return DrvInputs[0]; - - case 0x4e01: - return DrvInputs[1]; - - case 0x4e02: - return DrvInputs[2]; - - case 0x4e03: - return DrvDips[2]; - } - - return 0; -} - -static UINT32 vlm_sync(INT32 samples_rate) -{ - return (samples_rate * M6809TotalCycles()) / 25600; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - vlm5030Reset(0); - - sn76496_latch = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvVLMROM = Next; Next += 0x002000; - - DrvColPROM = Next; Next += 0x000020; -; - DrvPalette = (UINT32*)Next; Next += 0x20 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM = Next; // 0x800 - DrvSprRAM0 = Next; Next += 0x000400; - DrvSprRAM1 = Next; Next += 0x000400; - - DrvVidRAM = Next; Next += 0x000800; - - flipscreen = Next; Next += 0x000001; - nmi_enable = Next; Next += 0x000001; - irq_enable = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Plane0[4] = { 4, 0, (0x2000*8)+4, (0x2000*8)+0 }; - INT32 Plane1[4] = { 4, 0, (0x8000*8)+4, (0x8000*8)+0 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - - memcpy (tmp, DrvGfxROM0, 0x04000); - - GfxDecode(0x200, 4, 8, 8, Plane0, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x10000); - - GfxDecode(0x200, 4, 16, 16, Plane1, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvInit() -{ -// BurnSetRefreshRate(60.58); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x4000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x8000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xc000, 7, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 8, 1)) return 1; - - if (BurnLoadRom(DrvVLMROM + 0x0000, 9, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x5000, 0x57ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x5800, 0x5fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(yiear_write); - M6809SetReadHandler(yiear_read); - M6809Close(); - - SN76489AInit(0, 1536000, 0); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - vlm5030Init(0, 3579545, vlm_sync, DrvVLMROM, 0x2000, 1); - vlm5030SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - vlm5030Exit(); - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - for (INT32 offs = 32 * 2; offs < 32 * 30; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = ((offs / 0x20) * 8) - 16; - - INT32 attr = DrvVidRAM[offs*2+0]; - INT32 code = DrvVidRAM[offs*2+1] | ((attr & 0x10) << 4); - INT32 flipx = attr & 0x80; - INT32 flipy = attr & 0x40; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy, 0, 4, 0x10, DrvGfxROM0); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy, 0, 4, 0x10, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy, 0, 4, 0x10, DrvGfxROM0); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, 0, 4, 0x10, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x30 - 2; offs >= 0; offs -= 2) - { - INT32 attr = DrvSprRAM0[offs + 0]; - INT32 code = DrvSprRAM1[offs + 1] + 256 * (attr & 0x01); - INT32 flipx = ~attr & 0x40; - INT32 flipy = attr & 0x80; - INT32 sy = 240 - DrvSprRAM0[offs + 1]; - INT32 sx = DrvSprRAM1 [offs + 0]; - - if (0) // if (*flipscreen) - { - sy = 240 - sy; - flipy = !flipy; - } - - if (offs < 0x26) sy++; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, 0, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, 0, 4, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, 0, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, 0, 4, 0, 0, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - M6809NewFrame(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal[1] = { 1536000 / 60 }; - INT32 nCyclesDone[1] = { 0 }; - INT32 nSoundBufferPos = 0; - - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - - if (*nmi_enable && (i & 0x1f) == 0) // copy shao-lin's road - M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // 480x/second (8x/frame) - - if (i == 240 && *irq_enable) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - } - // vlm5030 won't interlace, so just run it at the end of the frame.. - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - - vlm5030Scan(nAction); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(sn76496_latch); - } - - return 0; -} - - -// Yie Ar Kung-Fu (program code I) - -static struct BurnRomInfo yiearRomDesc[] = { - { "407_i08.10d", 0x4000, 0xe2d7458b, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "407_i07.8d", 0x4000, 0x7db7442e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "407_c01.6h", 0x2000, 0xb68fd91d, 2 | BRF_GRA }, // 2 Background Tiles - { "407_c02.7h", 0x2000, 0xd9b167c6, 2 | BRF_GRA }, // 3 - - { "407_d05.16h", 0x4000, 0x45109b29, 3 | BRF_GRA }, // 4 Sprites - { "407_d06.17h", 0x4000, 0x1d650790, 3 | BRF_GRA }, // 5 - { "407_d03.14h", 0x4000, 0xe6aa945b, 3 | BRF_GRA }, // 6 - { "407_d04.15h", 0x4000, 0xcc187c22, 3 | BRF_GRA }, // 7 - - { "407c10.1g", 0x0020, 0xc283d71f, 4 | BRF_GRA }, // 8 Color PROM - - { "407_c09.8b", 0x2000, 0xf75a1539, 5 | BRF_GRA }, // 9 VLM Samples -}; - -STD_ROM_PICK(yiear) -STD_ROM_FN(yiear) - -struct BurnDriver BurnDrvYiear = { - "yiear", NULL, NULL, NULL, "1985", - "Yie Ar Kung-Fu (program code I)\0", NULL, "Konami", "GX407", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, yiearRomInfo, yiearRomName, NULL, NULL, YiearInputInfo, YiearDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 256, 224, 4, 3 -}; - - -// Yie Ar Kung-Fu (program code G) - -static struct BurnRomInfo yiear2RomDesc[] = { - { "407_g08.10d", 0x4000, 0x49ecd9dd, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "407_g07.8d", 0x4000, 0xbc2e1208, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "407_c01.6h", 0x2000, 0xb68fd91d, 2 | BRF_GRA }, // 2 Background Tiles - { "407_c02.7h", 0x2000, 0xd9b167c6, 2 | BRF_GRA }, // 3 - - { "407_d05.16h", 0x4000, 0x45109b29, 3 | BRF_GRA }, // 4 Sprites - { "407_d06.17h", 0x4000, 0x1d650790, 3 | BRF_GRA }, // 5 - { "407_d03.14h", 0x4000, 0xe6aa945b, 3 | BRF_GRA }, // 6 - { "407_d04.15h", 0x4000, 0xcc187c22, 3 | BRF_GRA }, // 7 - - { "407c10.1g", 0x0020, 0xc283d71f, 4 | BRF_GRA }, // 8 Color PROM - - { "407_c09.8b", 0x2000, 0xf75a1539, 5 | BRF_GRA }, // 9 VLM Samples -}; - -STD_ROM_PICK(yiear2) -STD_ROM_FN(yiear2) - -struct BurnDriver BurnDrvYiear2 = { - "yiear2", "yiear", NULL, NULL, "1985", - "Yie Ar Kung-Fu (program code G)\0", NULL, "Konami", "GX407", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0, - NULL, yiear2RomInfo, yiear2RomName, NULL, NULL, YiearInputInfo, YiearDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/konami/k007342_k007420.cpp b/jan/src/burn/drv/konami/k007342_k007420.cpp deleted file mode 100644 index 9e7946e56..000000000 --- a/jan/src/burn/drv/konami/k007342_k007420.cpp +++ /dev/null @@ -1,420 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Fabio Priuli,Acho A. Tang, R. Belmont - -#include "tiles_generic.h" - -#define K007342_OPAQUE (1<<16) - -UINT8 *K007342VidRAM[1] = { NULL }; -UINT8 *K007342ScrRAM[1] = { NULL }; -UINT8 K007342Regs[1][8]; - -static INT32 GlobalXOffsets = 0; -static INT32 GlobalYOffsets = 0; -static UINT8 *GfxBase; -static UINT8 *ColorRAM[2]; -static UINT8 *VideoRAM[2]; - -static void (*pCallback)(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *flags) = NULL; - -void K007342Init(UINT8 *gfx, void (*Callback)(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *flags)) -{ - GfxBase = gfx; - pCallback = Callback; - - for (INT32 i = 0; i < 2; i++) { - ColorRAM[i] = K007342VidRAM[0] + i * 0x1000; - VideoRAM[i] = ColorRAM[i] + 0x0800; - } - - GlobalXOffsets = 0; - GlobalYOffsets = 0; -} - -void K007342SetOffsets(INT32 x, INT32 y) -{ - GlobalXOffsets = x; - GlobalYOffsets = y; -} - -void K007342Reset() -{ - memset (K007342Regs[0], 0, 8); -} - -INT32 K007342_irq_enabled() -{ - return (K007342Regs[0][0] & 0x02); -} - -void K007342DrawLayer(INT32 layer, INT32 baseflags, INT32 /*priority*/) -{ -// INT32 flipscreen = K007342Regs[0][0] & 0x10; - - INT32 scrollx0 = ((K007342Regs[0][2] & 0x01) * 256) + K007342Regs[0][3]; - INT32 scrollx1 = ((K007342Regs[0][2] & 0x02) * 128) + K007342Regs[0][5]; - INT32 scrolly0 = K007342Regs[0][4]; - INT32 scrolly1 = K007342Regs[0][6]; - - INT32 scrollx = ((layer) ? scrollx1 : scrollx0); - INT32 scrolly = ((layer) ? scrolly1 : scrolly0); - - scrollx = (scrollx + GlobalXOffsets) & 0x1ff; - scrolly = (scrolly + GlobalYOffsets) & 0xff; - - INT32 scroll_ctrl = K007342Regs[0][2] & 0x1c; - INT32 opaque = baseflags & K007342_OPAQUE; - INT32 category_select = baseflags & 1; - - if (scroll_ctrl == 0x00 || scroll_ctrl == 0x08 || layer == 1) - { - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - INT32 ofst = (offs & 0x1f) + (((offs / 0x40) + (offs & 0x20)) * 0x20); - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = VideoRAM[layer][ofst]; - INT32 color = ColorRAM[layer][ofst]; - - INT32 flags = (color >> 4) & 3; - - INT32 category = (color >> 7) & 1; - if (category_select != category) continue; // right? - - if (pCallback) { - pCallback(layer, K007342Regs[0][1], &code, &color, &flags); - } - - INT32 flipx = flags & 1; - INT32 flipy = flags & 2; - - if (opaque) { - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, GfxBase); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, GfxBase); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, GfxBase); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, GfxBase); - } - } - } else { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, GfxBase); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, GfxBase); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, GfxBase); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, GfxBase); - } - } - } - } - } - else if (scroll_ctrl == 0x0c) // 32 columns - { - for (INT32 y = 0; y < nScreenHeight + 8; y+=8) - { - for (INT32 x = 0; x < nScreenWidth + 8; x+=8) - { - INT32 sxx = (scrollx + x) & 0x1ff; - - INT32 yscroll = (K007342ScrRAM[0][((sxx/8)&0x1f) * 2] + (K007342ScrRAM[0][((sxx/8)&0x1f) * 2 + 1] * 256) + GlobalYOffsets) & 0xff; - - INT32 syy = (yscroll + y) & 0xff; - - INT32 ofst = ((sxx / 8) & 0x1f) + (((syy / 8) + ((sxx / 8) & 0x20)) * 0x20); - - INT32 code = VideoRAM[layer][ofst]; - INT32 color = ColorRAM[layer][ofst]; - - INT32 flags = (color >> 4) & 3; - INT32 category = color >> 7; - - if (category_select != category) continue; // right? - - if (pCallback) { - pCallback(layer, K007342Regs[0][1], &code, &color, &flags); - } - - INT32 flipx = (flags & 1) * 0x07; - INT32 flipy = (flags & 2) * 0x38; - - if (opaque) { - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, x - (scrollx & 7), y - (yscroll & 7), color, 4, 0, GfxBase); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, x - (scrollx & 7), y - (yscroll & 7), color, 4, 0, GfxBase); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, x - (scrollx & 7), y - (yscroll & 7), color, 4, 0, GfxBase); - } else { - Render8x8Tile_Clip(pTransDraw, code, x - (scrollx & 7), y - (yscroll & 7), color, 4, 0, GfxBase); - } - } - } else { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, x - (scrollx & 7), y - (yscroll & 7), color, 4, 0, 0, GfxBase); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, x - (scrollx & 7), y - (yscroll & 7), color, 4, 0, 0, GfxBase); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, x - (scrollx & 7), y - (yscroll & 7), color, 4, 0, 0, GfxBase); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, x - (scrollx & 7), y - (yscroll & 7), color, 4, 0, 0, GfxBase); - } - } - } - } - } - } - else if (scroll_ctrl == 0x14) // 256 rows - { - for (INT32 y = 0; y < nScreenHeight; y++) - { - INT32 syy = (y + scrolly) & 0xff; - INT32 xscroll = (K007342ScrRAM[0][syy * 2] + (K007342ScrRAM[0][syy * 2 + 1] * 256) + GlobalXOffsets) & 0x1ff; - - UINT16 *dest = pTransDraw + y * nScreenWidth; - - for (INT32 x = 0; x < nScreenWidth + 8; x += 8) - { - INT32 sxx = (xscroll + x) & 0x1ff; - INT32 ofst = ((sxx / 8) & 0x1f) + (((syy / 8) + ((sxx / 8) & 0x20)) * 0x20); - -// return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5); - - INT32 code = VideoRAM[layer][ofst]; - INT32 color = ColorRAM[layer][ofst]; - - INT32 flags = (color >> 4) & 3; - INT32 category = color >> 7; - - if (category_select != category) continue; // right? - - if (pCallback) { - pCallback(layer, K007342Regs[0][1], &code, &color, &flags); - } - - INT32 flipx = (flags & 1) * 0x07; - INT32 flipy = (flags & 2) * 0x38; - - { - color *= 16; - INT32 sxxx = x - (xscroll & 7); - UINT8 *base = GfxBase + (code * 0x40) + (((y & 7) * 8) ^ flipy); - - for (INT32 xx = 0; xx < 8; xx++, sxxx++) - { - if (sxxx < 0) continue; - if (sxxx >= nScreenWidth) break; - - INT32 pxl = base[xx ^ flipx]; - - if (pxl || opaque) { - dest[sxxx] = pxl + color; - } - } - } - } - } - } -} - -INT32 K007342Scan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(K007342Regs); - } - - return 0; -} - -static INT32 K007420GlobalXOffset = 0; -static INT32 K007420GlobalYOffset = 0; - -UINT8 *K007420RAM[1] = { NULL }; -static INT32 K007420_banklimit = ~0; -static void (*pSprCallback)(INT32 *code, INT32 *color) = NULL; - -void K007420Init(INT32 banklimit, void (*Callback)(INT32 *code, INT32 *color)) -{ - pSprCallback = Callback; - K007420_banklimit = banklimit; - - K007420GlobalXOffset = K007420GlobalYOffset = 0; -} - -void K007420SetOffsets(INT32 x, INT32 y) -{ - K007420GlobalXOffset = x; - K007420GlobalYOffset = y; -} - -void K007420DrawSprites(UINT8 *gfxbase) -{ - INT32 codemask = K007420_banklimit; - INT32 bankmask = ~K007420_banklimit; - - UINT8 *m_ram = K007420RAM[0]; - - for (INT32 offs = 0x200 - 8; offs >= 0; offs -= 8) - { - INT32 ox, oy, code, color, flipx, flipy, zoom, w, h, x, y, bank; - static const INT32 xoffset[4] = { 0, 1, 4, 5 }; - static const INT32 yoffset[4] = { 0, 2, 8, 10 }; - - code = m_ram[offs + 1]; - color = m_ram[offs + 2]; - ox = m_ram[offs + 3] - ((m_ram[offs + 4] & 0x80) << 1); - oy = 256 - m_ram[offs + 0]; - flipx = m_ram[offs + 4] & 0x04; - flipy = m_ram[offs + 4] & 0x08; - - pSprCallback(&code, &color); - - bank = code & bankmask; - code &= codemask; - - zoom = m_ram[offs + 5] | ((m_ram[offs + 4] & 0x03) << 8); - if (!zoom) - continue; - zoom = 0x10000 * 128 / zoom; - - switch (m_ram[offs + 4] & 0x70) - { - case 0x30: w = h = 1; break; - case 0x20: w = 2; h = 1; code &= (~1); break; - case 0x10: w = 1; h = 2; code &= (~2); break; - case 0x00: w = h = 2; code &= (~3); break; - case 0x40: w = h = 4; code &= (~3); break; - default: w = 1; h = 1; - } - - if (K007342Regs[0][2] & 0x10) - { - ox = 256 - ox - ((zoom * w + (1 << 12)) >> 13); - oy = 256 - oy - ((zoom * h + (1 << 12)) >> 13); - flipx = !flipx; - flipy = !flipy; - } - - if (zoom == 0x10000) - { - INT32 sx, sy; - - for (y = 0; y < h; y++) - { - sy = oy + 8 * y; - - for (x = 0; x < w; x++) - { - INT32 c = code; - - sx = ox + 8 * x; - if (flipx) - c += xoffset[(w - 1 - x)]; - else - c += xoffset[x]; - - if (flipy) - c += yoffset[(h - 1 - y)]; - else - c += yoffset[y]; - - if (c & bankmask) - continue; - else - c += bank; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, c, sx - K007420GlobalXOffset, sy - K007420GlobalYOffset, color, 4, 0, 0, gfxbase); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, c, sx - K007420GlobalXOffset, sy - K007420GlobalYOffset, color, 4, 0, 0, gfxbase); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, c, sx - K007420GlobalXOffset, sy - K007420GlobalYOffset, color, 4, 0, 0, gfxbase); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, c, sx - K007420GlobalXOffset, sy - K007420GlobalYOffset, color, 4, 0, 0, gfxbase); - } - } - - if (K007342Regs[0][2] & 0x80) { // wrap - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, c, sx - K007420GlobalXOffset, (sy-K007420GlobalYOffset)-256, color, 4, 0, 0, gfxbase); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, c, sx - K007420GlobalXOffset, (sy-K007420GlobalYOffset)-256, color, 4, 0, 0, gfxbase); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, c, sx - K007420GlobalXOffset, (sy-K007420GlobalYOffset)-256, color, 4, 0, 0, gfxbase); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, c, sx - K007420GlobalXOffset, (sy-K007420GlobalYOffset)-256, color, 4, 0, 0, gfxbase); - } - } - } - } - } - } - else - { - INT32 sx, sy, zw, zh; - for (y = 0; y < h; y++) - { - sy = oy + ((zoom * y + (1 << 12)) >> 13); - zh = (oy + ((zoom * (y + 1) + (1 << 12)) >> 13)) - sy; - - for (x = 0; x < w; x++) - { - INT32 c = code; - - sx = ox + ((zoom * x + (1<<12)) >> 13); - zw = (ox + ((zoom * (x + 1) + (1 << 12)) >> 13)) - sx; - if (flipx) - c += xoffset[(w - 1 - x)]; - else - c += xoffset[x]; - - if (flipy) - c += yoffset[(h - 1 - y)]; - else - c += yoffset[y]; - - if (c & bankmask) - continue; - else - c += bank; - - RenderZoomedTile(pTransDraw, gfxbase, c, color*16, 0, sx - K007420GlobalXOffset, (sy-K007420GlobalYOffset), flipx, flipy, 8, 8, (zw << 16) / 8,(zh << 16) / 8); - - if (K007342Regs[0][2] & 0x80) { // wrap - RenderZoomedTile(pTransDraw, gfxbase, c, color*16, 0, sx - K007420GlobalXOffset, (sy-K007420GlobalYOffset)-256, flipx, flipy, 8, 8, (zw << 16) / 8,(zh << 16) / 8); - } - } - } - } - } -} diff --git a/jan/src/burn/drv/konami/k007342_k007420.h b/jan/src/burn/drv/konami/k007342_k007420.h deleted file mode 100644 index 27dfa90eb..000000000 --- a/jan/src/burn/drv/konami/k007342_k007420.h +++ /dev/null @@ -1,20 +0,0 @@ -extern UINT8 *K007342VidRAM[1]; -extern UINT8 *K007342ScrRAM[1]; -extern UINT8 K007342Regs[1][8]; -extern UINT8 *K007420RAM[1]; - -void K007342Init(UINT8 *gfx, void (*Callback)(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *flags)); -void K007342SetOffsets(INT32 x, INT32 y); -void K007342Reset(); -INT32 K007342_irq_enabled(); - -#define K007342_OPAQUE (1<<16) - -void K007342DrawLayer(INT32 layer, INT32 baseflags, INT32 priority); -INT32 K007342Scan(INT32 nAction); - -void K007420Init(INT32 banklimit, void (*Callback)(INT32 *code, INT32 *color)); -void K007420SetOffsets(INT32 x, INT32 y); -void K007420DrawSprites(UINT8 *gfxbase); - - diff --git a/jan/src/burn/drv/konami/k051316.cpp b/jan/src/burn/drv/konami/k051316.cpp deleted file mode 100644 index 34e6e0338..000000000 --- a/jan/src/burn/drv/konami/k051316.cpp +++ /dev/null @@ -1,362 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Fabio Priuli,Acho A. Tang, R. Belmont - -#include "tiles_generic.h" -#include "konamiic.h" - -static UINT16 *K051316TileMap[3]; -static void (*K051316Callback[3])(INT32 *code,INT32 *color,INT32 *flags); -static INT32 K051316Depth[3]; -static INT32 K051316TransColor[3]; -static UINT32 K051316TransMask[3]; -static UINT8 *K051316Gfx[3]; -static UINT8 *K051316GfxExp[3]; -static INT32 K051316Mask[3]; -static INT32 K051316Offs[3][2]; - -static UINT8 *K051316Ram[3]; -static UINT8 K051316Ctrl[3][16]; -static UINT8 K051316Wrap[3]; - -// Decode 4bpp graphics -static void K051316GfxExpand(UINT8 *src, UINT8 *dst, INT32 len) -{ - for (INT32 i = 0; i < len; i++) { - INT32 d = src[i]; - dst[i * 2 + 0] = d >> 4; - dst[i * 2 + 1] = d & 0x0f; - } -} - -void K051316Init(INT32 chip, UINT8 *gfx, UINT8 *gfxexp, INT32 mask, void (*callback)(INT32 *code,INT32 *color,INT32 *flags), INT32 bpp, INT32 transp) -{ - K051316Ram[chip] = (UINT8*)BurnMalloc(0x800); - K051316TileMap[chip] = (UINT16*)BurnMalloc(((32 * 16) * (32 * 16)) * sizeof(UINT16)); - - K051316Callback[chip] = callback; - - K051316Depth[chip] = bpp; - K051316Gfx[chip] = gfx; - K051316GfxExp[chip] = gfxexp; - - K051316Mask[chip] = mask; - - if (bpp == 4) { - K051316GfxExpand(gfx, gfxexp, mask+1); - } - - KonamiAllocateBitmaps(); - - KonamiIC_K051316InUse = 1; - - K051316Offs[chip][0] = K051316Offs[chip][1] = 0; - - K051316TransMask[chip] = 0; - K051316TransColor[chip] = transp & 0xff; - - if (transp & 0x200) { - K051316TransMask[chip] = transp & 0xff; - K051316TransColor[chip] = 0; - } -} - -void K051316Reset() -{ - for (INT32 i = 0; i < 3; i++) - { - if (K051316Ram[i]) { - memset (K051316Ram[i], 0, 0x800); - } - - memset (K051316Ctrl[i], 0, 16); - - K051316Wrap[i] = 0; - - if (K051316TileMap[i]) { - memset (K051316TileMap[i], 0, (32 * 16) * (32 * 16) * sizeof(INT16)); - } - } -} - -void K051316Exit() -{ - for (INT32 i = 0; i < 3; i++) - { - BurnFree (K051316Ram[i]); - BurnFree (K051316TileMap[i]); - K051316Callback[i] = NULL; - } -} - -void K051316SetOffset(INT32 chip, INT32 xoffs, INT32 yoffs) -{ - K051316Offs[chip][0] = xoffs; - K051316Offs[chip][1] = yoffs; -} - -UINT8 K051316ReadRom(INT32 chip, INT32 offset) -{ - if ((K051316Ctrl[chip][0x0e] & 0x01) == 0) - { - INT32 addr = offset + (K051316Ctrl[chip][0x0c] << 11) + (K051316Ctrl[chip][0x0d] << 19); - if (K051316Depth[chip] <= 4) addr /= 2; - addr &= K051316Mask[chip]; - - return K051316Gfx[chip][addr]; - } - - return 0; -} - -UINT8 K051316Read(INT32 chip, INT32 offset) -{ - return K051316Ram[chip][offset]; -} - -static inline void K051316_write_tile(INT32 offset, INT32 chip) -{ - offset &= 0x3ff; - - INT32 sx = (offset & 0x1f) << 4; - INT32 sy = (offset >> 5) << 4; - - INT32 code = K051316Ram[chip][offset]; - INT32 color = K051316Ram[chip][offset + 0x400]; - INT32 flags = 0; - - (*K051316Callback[chip])(&code,&color,&flags); - - UINT8 *src = K051316GfxExp[chip] + (code * 16 * 16); - UINT16 *dst; - - color <<= K051316Depth[chip]; - - INT32 flipx = flags & 1; - INT32 flipy = flags & 2; - if (flipx) flipx = 0x0f; - if (flipy) flipy = 0x0f; - - INT32 tmask = K051316TransMask[chip]; - - for (INT32 y = 0; y < 16; y++, sy++) - { - dst = K051316TileMap[chip] + ((sy << 9) + sx); - - for (INT32 x = 0; x < 16; x++) - { - INT32 pxl = src[((y^flipy) << 4) | (x ^ flipx)]; - - if (tmask) { - if ((pxl & tmask) == tmask) { - dst[x] = color | pxl; - } else { - dst[x] = 0x8000 | color | pxl; - } - } else { - if (pxl != K051316TransColor[chip]) { - dst[x] = color | pxl; - } else { - dst[x] = 0x8000 | color | pxl; - } - } - } - } -} - -void K051316Write(INT32 chip, INT32 offset, INT32 data) -{ - K051316Ram[chip][offset] = data; - K051316_write_tile(offset & 0x3ff, chip); -} - -void K051316WriteCtrl(INT32 chip, INT32 offset, INT32 data) -{ - K051316Ctrl[chip][offset & 0x0f] = data; -} - -void K051316WrapEnable(INT32 chip, INT32 status) -{ - K051316Wrap[chip] = status; -} - -static inline void copy_roz(INT32 chip, UINT32 startx, UINT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, INT32 wrap, INT32 transp, INT32 flags) -{ - UINT32 hshift = 512 << 16; - UINT32 wshift = 512 << 16; - - if (flags & 0x200) transp = 0; // force opaque - - INT32 priority = flags & 0xff; - - if (flags & 0x100) // indexed colors - { - UINT16 *dst = pTransDraw; - UINT16 *src = K051316TileMap[chip]; - - for (INT32 sy = 0; sy < nScreenHeight; sy++, startx+=incyx, starty+=incyy) - { - UINT32 cx = startx; - UINT32 cy = starty; - - if (wrap) { - if (transp) { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++) - { - INT32 pxl = src[(((cy >> 16) & 0x1ff) << 9) | ((cx >> 16) & 0x1ff)]; - - if (!(pxl & 0x8000)) { - *dst = pxl; - } - } - } else { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++) { - *dst = src[(((cy >> 16) & 0x1ff) << 9) | ((cx >> 16) & 0x1ff)] & 0x7fff; - } - } - } else { - if (transp) { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++) - { - if (cx < wshift && cy < hshift) { - INT32 pxl = src[(((cy >> 16) & 0x1ff) << 9) | ((cx >> 16) & 0x1ff)]; - if (!(pxl & 0x8000)) { - *dst = pxl; - } - } - } - } else { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++) - { - UINT32 pos = ((cy >> 16) << 9) | (cx >> 16); - - if (pos >= 0x40000) continue; - - *dst = src[pos] & 0x7fff; - } - } - } - } - } - else // 32-bit colors - { - UINT32 *dst = konami_bitmap32; - UINT8 *pri = konami_priority_bitmap; - UINT16 *src = K051316TileMap[chip]; - UINT32 *pal = konami_palette32; - - for (INT32 sy = 0; sy < nScreenHeight; sy++, startx+=incyx, starty+=incyy) - { - UINT32 cx = startx; - UINT32 cy = starty; - - if (wrap) { - if (transp) { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++, pri++) - { - INT32 pxl = src[(((cy >> 16) & 0x1ff) << 9) | ((cx >> 16) & 0x1ff)]; - - if (!(pxl & 0x8000)) { - *dst = pal[pxl]; - *pri = priority; - } - } - } else { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++, pri++) { - *dst = pal[src[(((cy >> 16) & 0x1ff) << 9) | ((cx >> 16) & 0x1ff)] & 0x7fff]; - *pri = priority; - } - } - } else { - if (transp) { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++, pri++) - { - if (cx < wshift && cy < hshift) { - INT32 pxl = src[(((cy >> 16) & 0x1ff) << 9) | ((cx >> 16) & 0x1ff)]; - if (!(pxl & 0x8000)) { - *dst = pal[pxl]; - *pri = priority; - } - } - } - } else { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++, pri++) - { - UINT32 pos = ((cy >> 16) << 9) | (cx >> 16); - - if (pos >= 0x40000) continue; - - *dst = pal[src[pos] & 0x7fff]; - *pri = priority; - } - } - } - } - } -} - -void K051316_zoom_draw(INT32 chip, INT32 flags) -{ - UINT32 startx,starty; - INT32 incxx,incxy,incyx,incyy; - - startx = 256 * ((INT16)(256 * K051316Ctrl[chip][0x00] + K051316Ctrl[chip][0x01])); - incxx = (INT16)(256 * K051316Ctrl[chip][0x02] + K051316Ctrl[chip][0x03]); - incyx = (INT16)(256 * K051316Ctrl[chip][0x04] + K051316Ctrl[chip][0x05]); - starty = 256 * ((INT16)(256 * K051316Ctrl[chip][0x06] + K051316Ctrl[chip][0x07])); - incxy = (INT16)(256 * K051316Ctrl[chip][0x08] + K051316Ctrl[chip][0x09]); - incyy = (INT16)(256 * K051316Ctrl[chip][0x0a] + K051316Ctrl[chip][0x0b]); - - startx -= (16 + K051316Offs[chip][1]) * incyx; - starty -= (16 + K051316Offs[chip][1]) * incyy; - - startx -= (89 + K051316Offs[chip][0]) * incxx; - starty -= (89 + K051316Offs[chip][0]) * incxy; - - INT32 transp = K051316TransColor[chip] + 1; - - copy_roz(chip, startx << 5,starty << 5,incxx << 5,incxy << 5,incyx << 5,incyy << 5, K051316Wrap[chip], transp, flags); // transp.. -} - -void K051316RedrawTiles(INT32 chip) -{ - if (K051316Ram[chip]) { - for (INT32 j = 0; j < 0x400; j++) { - K051316_write_tile(j, chip); - } - } -} - -void K051316Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - for (INT32 i = 0; i < 3; i++) { - if (K051316Ram[i]) { - memset(&ba, 0, sizeof(ba)); - ba.Data = K051316Ram[i]; - ba.nLen = 0x800; - ba.szName = "K052109 Ram"; - BurnAcb(&ba); - } - - memset(&ba, 0, sizeof(ba)); - ba.Data = K051316Ctrl[i]; - ba.nLen = 0x010; - ba.szName = "K052109 Control"; - BurnAcb(&ba); - } - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(K051316Wrap[0]); - SCAN_VAR(K051316Wrap[1]); - SCAN_VAR(K051316Wrap[2]); - } - - if (nAction & ACB_WRITE) { - K051316RedrawTiles(0); - K051316RedrawTiles(1); - K051316RedrawTiles(2); - } -} diff --git a/jan/src/burn/drv/konami/k051733.cpp b/jan/src/burn/drv/konami/k051733.cpp deleted file mode 100644 index 7b07f46ef..000000000 --- a/jan/src/burn/drv/konami/k051733.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Fabio Priuli,Acho A. Tang, R. Belmont - -#include "burnint.h" - -static UINT8 K051733Ram[0x20]; -static UINT8 K051733RNG; - -void K051733Reset() -{ - memset (K051733Ram, 0, 0x20); - K051733RNG = 0; -} - -void K051733Write(INT32 offset, INT32 data) -{ - K051733Ram[offset & 0x1f] = data; -} - -static INT32 int_sqrt(UINT32 op) -{ - UINT32 i,step; - - i = 0x8000; - step = 0x4000; - while (step) - { - if (i*i == op) return i; - else if (i*i > op) i -= step; - else i += step; - step >>= 1; - } - return i; -} - -UINT8 K051733Read(INT32 offset) -{ - INT32 op1 = (K051733Ram[0x00] << 8) | K051733Ram[0x01]; - INT32 op2 = (K051733Ram[0x02] << 8) | K051733Ram[0x03]; - INT32 op3 = (K051733Ram[0x04] << 8) | K051733Ram[0x05]; - INT32 rad = (K051733Ram[0x06] << 8) | K051733Ram[0x07]; - INT32 yobj1c = (K051733Ram[0x08] << 8) | K051733Ram[0x09]; - INT32 xobj1c = (K051733Ram[0x0a] << 8) | K051733Ram[0x0b]; - INT32 yobj2c = (K051733Ram[0x0c] << 8) | K051733Ram[0x0d]; - INT32 xobj2c = (K051733Ram[0x0e] << 8) | K051733Ram[0x0f]; - - offset &= 0x1f; - - switch (offset) - { - case 0x00: - if (op2) return (op1 / op2) >> 8; - else return 0xff; - - case 0x01: - if (op2) return (op1 / op2) & 0xff; - else return 0xff; - - case 0x02: - if (op2) return (op1 % op2) >> 8; - else return 0xff; - - case 0x03: - if (op2) return (op1 % op2) & 0xff; - else return 0xff; - - case 0x04: - return int_sqrt(op3<<16) >> 8; - - case 0x05: - return int_sqrt(op3<<16) & 0xff; - - case 0x06: - K051733RNG += K051733Ram[0x13]; - return K051733RNG; - - case 0x07: { - if (xobj1c + rad < xobj2c) - return 0xff; - - if (xobj2c + rad < xobj1c) - return 0xff; - - if (yobj1c + rad < yobj2c) - return 0xff; - - if (yobj2c + rad < yobj1c) - return 0xff; - - return 0; - } - - case 0x0e: - return (xobj2c - xobj1c) >> 8; - - case 0x0f: - return (xobj2c - xobj1c) & 0xff; - - default: - return K051733Ram[offset]; - } - - return 0; -} - -void K051733Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = K051733Ram; - ba.nLen = 0x20; - ba.szName = "K051733 Ram"; - BurnAcb(&ba); - - SCAN_VAR(K051733RNG); - } -} diff --git a/jan/src/burn/drv/konami/k051960.cpp b/jan/src/burn/drv/konami/k051960.cpp deleted file mode 100644 index 9d6f20e84..000000000 --- a/jan/src/burn/drv/konami/k051960.cpp +++ /dev/null @@ -1,355 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Fabio Priuli,Acho A. Tang, R. Belmont - -// K051960 - -#include "tiles_generic.h" -#include "konamiic.h" - -INT32 K051960_irq_enabled; -INT32 K051960_nmi_enabled; -INT32 K051960_spriteflip; - -static UINT8 *K051960Ram = NULL; -static UINT8 K051960SpriteRomBank[3]; -INT32 K051960ReadRoms; -static INT32 K051960RomOffset; -static UINT8 *K051960Rom; -static UINT32 K051960RomMask; -static UINT8 *K051960RomExp; -static UINT32 K051960RomExpMask; -static UINT8 blank_tile[0x100]; -static INT32 nBpp = 0; - -static INT32 nSpriteXOffset; -static INT32 nSpriteYOffset; - -typedef void (*K051960_Callback)(INT32 *Code, INT32 *Colour, INT32 *Priority, INT32 *Shadow); -static K051960_Callback K051960Callback; - -void K051960SpritesRender(INT32 min_priority, INT32 max_priority) -{ -#define NUM_SPRITES 128 - INT32 Offset, PriCode; - INT32 SortedList[NUM_SPRITES]; - - for (Offset = 0; Offset < NUM_SPRITES; Offset++) SortedList[Offset] = -1; - - for (Offset = 0; Offset < 0x400; Offset += 8) { - if (K051960Ram[Offset] & 0x80) { - if (max_priority == -1) /* draw front to back when using priority buffer */ - SortedList[(K051960Ram[Offset] & 0x7f) ^ 0x7f] = Offset; - else - SortedList[K051960Ram[Offset] & 0x7f] = Offset; - } - } - - for (PriCode = 0; PriCode < NUM_SPRITES; PriCode++) { - INT32 ox, oy, Code, Colour, Pri, Shadow, Size, w, h, x, y, xFlip, yFlip, xZoom, yZoom; - - static const INT32 xOffset[8] = { 0, 1, 4, 5, 16, 17, 20, 21 }; - static const INT32 yOffset[8] = { 0, 2, 8, 10, 32, 34, 40, 42 }; - static const INT32 Width[8] = { 1, 2, 1, 2, 4, 2, 4, 8 }; - static const INT32 Height[8] = { 1, 1, 2, 2, 2, 4, 4, 8 }; - - Offset = SortedList[PriCode]; - if (Offset == -1) continue; - - Code = K051960Ram[Offset + 2] + ((K051960Ram[Offset + 1] & 0x1f) << 8); - Colour = K051960Ram[Offset + 3] & 0xff; - Pri = 0; - Shadow = Colour & 0x80; - K051960Callback(&Code, &Colour, &Pri, &Shadow); - - if (max_priority != -1) - if (Pri < min_priority || Pri > max_priority) - continue; - - if (Pri == 1 && (nSpriteEnable & 2) == 0) continue; - if (Pri == 2 && (nSpriteEnable & 4) == 0) continue; - if (Pri == 3 && (nSpriteEnable & 8) == 0) continue; - - Size = (K051960Ram[Offset + 1] & 0xe0) >> 5; - w = Width[Size]; - h = Height[Size]; - - if (w >= 2) Code &= ~0x01; - if (h >= 2) Code &= ~0x02; - if (w >= 4) Code &= ~0x04; - if (h >= 4) Code &= ~0x08; - if (w >= 8) Code &= ~0x10; - if (h >= 8) Code &= ~0x20; - - ox = (256 * K051960Ram[Offset + 6] + K051960Ram[Offset + 7]) & 0x01ff; - oy = 256 - ((256 * K051960Ram[Offset + 4] + K051960Ram[Offset + 5]) & 0x01ff); - - xFlip = K051960Ram[Offset + 6] & 0x02; - yFlip = K051960Ram[Offset + 4] & 0x02; - xZoom = (K051960Ram[Offset + 6] & 0xfc) >> 2; - yZoom = (K051960Ram[Offset + 4] & 0xfc) >> 2; - xZoom = 0x10000 / 128 * (128 - xZoom); - yZoom = 0x10000 / 128 * (128 - yZoom); - - if (xZoom == 0x10000 && yZoom == 0x10000) { - INT32 sx,sy; - - for (y = 0; y < h; y++) { - sy = oy + 16 * y; - sy -= nSpriteYOffset; - sy -= 16; - - for (x = 0; x < w; x++) { - INT32 c = Code; - - sx = ox + 16 * x; - if (xFlip) c += xOffset[(w - 1 - x) & 7]; - else c += xOffset[x]; - if (yFlip) c += yOffset[(h - 1 - y) & 7]; - else c += yOffset[y]; - - sx &= 0x1ff; - sx -= 104; - sx -= nSpriteXOffset; - - c &= K051960RomExpMask; - - if (Shadow) { - konami_render_zoom_shadow_tile(K051960RomExp, c, nBpp, Colour, sx, sy, xFlip, yFlip, 16, 16, 0x10000, 0x10000, (max_priority ==-1) ? Pri:0xffffffff, 0); - } else { - if (max_priority == -1) { - konami_draw_16x16_prio_tile(K051960RomExp, c, nBpp, Colour, sx, sy, xFlip, yFlip, Pri); - } else { - konami_draw_16x16_tile(K051960RomExp, c, nBpp, Colour, sx, sy, xFlip, yFlip); - } - } - } - } - } else { - INT32 sx, sy, zw, zh; - - for (y = 0; y < h; y++) { - sy = oy + ((yZoom * y + (1 << 11)) >> 12); - zh = (oy + ((yZoom * (y + 1) + (1 << 11)) >> 12)) - sy; - sy -=nSpriteYOffset; - sy -= 16; - - for (x = 0; x < w; x++) { - INT32 c = Code; - - sx = ox + ((xZoom * x + (1 << 11)) >> 12); - zw = (ox + ((xZoom * (x + 1) + (1 << 11)) >> 12)) - sx; - if (xFlip) c += xOffset[(w - 1 - x) & 7]; - else c += xOffset[x]; - if (yFlip) c += yOffset[(h - 1 - y) & 7]; - else c += yOffset[y]; - - sx &= 0x1ff; - sx -= 104; - sx -= nSpriteXOffset; - - c &= K051960RomExpMask; - - if (Shadow) { - konami_render_zoom_shadow_tile(K051960RomExp, c, nBpp, Colour, sx, sy, xFlip, yFlip, 16, 16, zw << 12, zh << 12, (max_priority ==-1) ? Pri:0xffffffff, 0); - } else { - if (max_priority == -1) { - konami_draw_16x16_priozoom_tile(K051960RomExp, c, nBpp, Colour, 0, sx, sy, xFlip, yFlip, 16, 16, zw << 12, zh << 12, Pri); - } else { - konami_draw_16x16_zoom_tile(K051960RomExp, c, nBpp, Colour, 0, sx, sy, xFlip, yFlip, 16, 16, zw << 12, zh << 12); - } - } - } - } - } - } -} - -UINT8 K0519060FetchRomData(UINT32 Offset) -{ - INT32 Code, Colour, Pri, Shadow, Off1, Addr; - - Addr = K051960RomOffset + (K051960SpriteRomBank[0] << 8) + ((K051960SpriteRomBank[1] & 0x03) << 16); - Code = (Addr & 0x3ffe0) >> 5; - Off1 = Addr & 0x1f; - Colour = ((K051960SpriteRomBank[1] & 0xfc) >> 2) + ((K051960SpriteRomBank[2] & 0x03) << 6); - Pri = 0; - Shadow = Colour & 0x80; - K051960Callback(&Code, &Colour, &Pri, &Shadow); - - Addr = (Code << 7) | (Off1 << 2) | Offset; - Addr &= K051960RomMask; - - return K051960Rom[Addr]; -} - -UINT8 K051960Read(UINT32 Offset) -{ - if (K051960ReadRoms) { - K051960RomOffset = (Offset & 0x3fc) >> 2; - K0519060FetchRomData(Offset & 3); - } - - return K051960Ram[Offset]; -} - -void K051960Write(UINT32 Offset, UINT8 Data) -{ - K051960Ram[Offset] = Data; -} - - -UINT8 K052109_051960_r(INT32 offset) -{ - if (K052109RMRDLine == 0) - { - if (offset >= 0x3800 && offset < 0x3808) - return K051937Read(offset - 0x3800); - else if (offset < 0x3c00) - return K052109Read(offset); - else - return K051960Read(offset - 0x3c00); - } - else return K052109Read(offset); -} - -void K052109_051960_w(INT32 offset, INT32 data) -{ - if (offset >= 0x3800 && offset < 0x3808) - K051937Write(offset - 0x3800,data); - else if (offset < 0x3c00) - K052109Write(offset, data); - else - K051960Write(offset - 0x3c00,data); -} - -void K051960SetCallback(void (*Callback)(INT32 *Code, INT32 *Colour, INT32 *Priority, INT32 *Shadow)) -{ - K051960Callback = Callback; -} - -void K051960SetSpriteOffset(INT32 x, INT32 y) -{ - nSpriteXOffset = x; - nSpriteYOffset = y; -} - -void K051960Reset() -{ - memset(K051960SpriteRomBank, 0, 3); - K051960ReadRoms = 0; - K051960RomOffset = 0; - - K051960_irq_enabled = 0; - K051960_nmi_enabled = 0; - K051960_spriteflip = 0; -} - -void K051960GfxDecode(UINT8 *src, UINT8 *dst, INT32 len) -{ - INT32 Plane[4] = { STEP4(0, 8) }; - INT32 XOffs[16] = { STEP8(0, 1), STEP8(256, 1) }; - INT32 YOffs[16] = { STEP8(0,32), STEP8(512,32) }; - - GfxDecode(len >> 7, 4, 16, 16, Plane, XOffs, YOffs, 0x400, src, dst); -} - -void K051960Init(UINT8* pRomSrc, UINT8* pRomSrcExp, UINT32 RomMask) -{ - nSpriteXOffset = nSpriteYOffset = 0; - - K051960Ram = (UINT8*)BurnMalloc(0x400); - - K051960RomMask = RomMask; - K051960RomExpMask = (RomMask * 2) / (16 * 16); - - K051960Rom = pRomSrc; - K051960RomExp = pRomSrcExp; - - KonamiIC_K051960InUse = 1; - - memset (blank_tile, 0, 0x100); - - nSpriteXOffset = nSpriteYOffset = 0; - - KonamiAllocateBitmaps(); - - nBpp = 4; -} - -void K051960SetBpp(INT32 bpp) -{ - nBpp = bpp; -} - -void K051960Exit() -{ - BurnFree(K051960Ram); - - K051960Callback = NULL; - K051960RomMask = 0; - K051960Rom = NULL; - K051960RomExpMask = 0; - K051960RomExp = NULL; - memset(K051960SpriteRomBank, 0, 3); - K051960ReadRoms = 0; - K051960RomOffset = 0; - - K051960Callback = NULL; -} - -void K051960Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = K051960Ram; - ba.nLen = 0x400; - ba.szName = "K051960 Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(K051960SpriteRomBank); - SCAN_VAR(K051960ReadRoms); - SCAN_VAR(K051960RomOffset); - SCAN_VAR(K051960_irq_enabled); - SCAN_VAR(K051960_nmi_enabled); - SCAN_VAR(K051960_spriteflip); - } -} - -void K051937Write(UINT32 Offset, UINT8 Data) -{ - if (Offset == 0) { - K051960_irq_enabled = Data & 0x01; - K051960_nmi_enabled = Data & 0x04; - K051960_spriteflip = Data & 0x08; - K051960ReadRoms = Data & 0x20; - return; - } - - if (Offset >= 2 && Offset <= 4) { - K051960SpriteRomBank[Offset - 2] = Data; - return; - } -} - -UINT8 K051937Read(UINT32 Offset) -{ - if (K051960ReadRoms && Offset >= 4 && Offset < 8) - { - return K0519060FetchRomData(Offset & 3); - } - else - { - if (Offset == 0) - { - static INT32 counter; - return (counter++) & 1; - } - - return 0; - } -} - diff --git a/jan/src/burn/drv/konami/k052109.cpp b/jan/src/burn/drv/konami/k052109.cpp deleted file mode 100644 index 73f72b8ae..000000000 --- a/jan/src/burn/drv/konami/k052109.cpp +++ /dev/null @@ -1,486 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Fabio Priuli,Acho A. Tang, R. Belmont - -// K052109 - -#include "tiles_generic.h" -#include "konamiic.h" - -static UINT8 *K052109Ram = NULL; - -typedef void (*K052109_Callback)(INT32 Layer, INT32 Bank, INT32 *Code, INT32 *Colour, INT32 *xFlip, INT32 *Priority); -static K052109_Callback K052109Callback; -static INT32 K052109ScrollX[3]; -static INT32 K052109ScrollY[3]; -static UINT8 K052109ScrollCtrl; -static UINT8 K052109CharRomBank[4]; -static UINT8 K052109CharRomBank2[4]; -INT32 K052109RMRDLine; -static UINT8 K052109RomSubBank; -static UINT32 K052109RomMask; -static UINT8 *K052109Rom; -static UINT32 K052109RomExpMask; -static UINT8 *K052109RomExp; - -static INT32 K052109FlipEnable; -INT32 K052109_irq_enabled; - -static INT32 K052109ScrollXOff[3]; -static INT32 K052109ScrollYOff[3]; - -static INT32 K052109EnableRows[3]; -static INT32 K052109EnableLine[3]; -static INT32 K052109ScrollRows[3][256]; -static INT32 K052109EnableCols[3]; -static INT32 K052109ScrollCols[3][64]; - -static INT32 has_extra_video_ram = 0; // xmen kludge - -static void update_scroll_one(INT32 nLayer, INT32 control, INT32 ram_offset) -{ - K052109EnableLine[nLayer] = 0; - K052109EnableRows[nLayer] = 1; - K052109EnableCols[nLayer] = 1; - - UINT8 *sourceram = K052109Ram + ram_offset; - - if ((control & 0x03) == 0x02 || (control & 0x03) == 0x03) - { - K052109EnableLine[nLayer] = 1; - - K052109EnableRows[nLayer] = 256; - - INT32 andval = ((control & 0x03) == 0x02) ? 0xfff8 : 0xffff; - UINT8 *scrollram = &sourceram[0x1a00]; - INT32 yscroll = sourceram[0x180c]; - - for (INT32 offs = 0; offs < 256; offs++) - { - INT32 xscroll = scrollram[2 * (offs & andval) + 0] + 256 * scrollram[2 * (offs & andval) + 1]; - K052109ScrollRows[nLayer][(offs + yscroll)&0xff] = xscroll - 6; - } - - K052109EnableCols[nLayer] = 1; - K052109ScrollCols[nLayer][0] = yscroll; - } - else if ((control & 0x04) == 0x04) - { - // K052109EnableLine[nLayer] = 1; - - UINT8 *scrollram = &sourceram[0x1800]; - INT32 xscroll = (sourceram[0x1a00] + 256 * sourceram[0x1a01]) - 6; - - K052109EnableCols[nLayer] = 64; - for (INT32 offs = 0; offs < 512/8; offs++) - { - K052109ScrollCols[nLayer][(((offs*8)+xscroll)&0x1f8)/8] = scrollram[offs]; - } - - K052109EnableRows[nLayer] = 1; - K052109ScrollRows[nLayer][0] = K052109ScrollX[nLayer] = xscroll; - } - else - { - K052109EnableRows[nLayer] = K052109EnableCols[nLayer] = 1; - K052109ScrollX[nLayer] = (sourceram[0x1a00] + 256 * sourceram[0x1a01]) - 6; - K052109ScrollY[nLayer] = sourceram[0x180c]; - } -} - -void K052109UpdateScroll() -{ - update_scroll_one(1, K052109ScrollCtrl >> 0, 0x0000); - update_scroll_one(2, K052109ScrollCtrl >> 3, 0x2000); -} - -void K052109AdjustScroll(INT32 x, INT32 y) -{ - for (INT32 i = 0; i < 3; i++) { - K052109ScrollXOff[i] = x; - K052109ScrollYOff[i] = y; - } -} - -void K052109RenderLayerLineScroll(INT32 nLayer, INT32 Flags, INT32 Priority) -{ - INT32 Category = Flags & 0xff; - INT32 Opaque = (Flags >> 16) & 1; - - UINT32 *dst = konami_bitmap32; - UINT8 *pdst = konami_priority_bitmap; - - INT32 ram_offset = nLayer * 0x800; - - INT32 rowdiv = 256 / K052109EnableRows[nLayer]; - - for (INT32 y = 0; y < nScreenHeight; y++) - { - for (INT32 x = 0; x < nScreenWidth + 8; x+=8) - { - INT32 yy = (y + (K052109ScrollCols[nLayer][0] + K052109ScrollYOff[nLayer] + 16)) & 0xff; - INT32 xx = (x + (K052109ScrollRows[nLayer][yy/rowdiv] + K052109ScrollXOff[nLayer] + 104)) & 0x1ff; - - INT32 TileIndex = (xx/8) + ((yy/8)*64); - - INT32 Colour = K052109Ram[TileIndex + ram_offset]; - INT32 Code = K052109Ram[TileIndex + 0x2000 + ram_offset] + (K052109Ram[TileIndex + 0x4000 + ram_offset] << 8); - - INT32 Bank = K052109CharRomBank[(Colour & 0x0c) >> 2]; - if (has_extra_video_ram) Bank = (Colour & 0x0c) >> 2; // kludge for X-Men - - Colour = (Colour & 0xf3) | ((Bank & 0x03) << 2); - Bank >>= 2; - - INT32 yFlip = Colour & 0x02; - INT32 xFlip = 0; - INT32 Prio = 0; - - K052109Callback(nLayer, Bank, &Code, &Colour, &xFlip, &Prio); - - if (Prio != Category && Category) continue; - - if (xFlip && !(K052109FlipEnable & 1)) xFlip = 0; - if (yFlip && !(K052109FlipEnable & 2)) yFlip = 0; - - UINT8 *src = K052109RomExp + ((Code & K052109RomExpMask) * 0x40) + ((yFlip ? (~yy & 7) : (yy & 7)) * 8); - UINT32 *pal = konami_palette32 + (Colour * 16); - - if (xFlip) xFlip = 0x07; - - INT32 xv = xx & 0x07; - - for (INT32 dx = 0; dx < 8; dx++) - { - if ((x+dx-xv) < 0 || (x+dx-xv) >= nScreenWidth) continue; - - INT32 pxl = src[dx^xFlip]; - if (!Opaque && !pxl) continue; - - dst[x+dx-xv] = pal[pxl]; - pdst[x+dx-xv] = Priority; - } - } - - pdst += nScreenWidth; - dst += nScreenWidth; - } -} - -void K052109RenderLayer(INT32 nLayer, INT32 Flags, INT32 Priority) -{ - nLayer &= 0x03; - - // Row and line scroll. - if (K052109EnableLine[nLayer]) { - K052109RenderLayerLineScroll(nLayer, Flags, Priority); - return; - } - - INT32 EnableCategory = Flags & 0x100; - INT32 Category = Flags & 0xff; - - Priority = (EnableCategory) ? Category : Priority; - - INT32 Opaque = (Flags >> 16) & 1; - INT32 ram_offset = nLayer * 0x800; - - INT32 mx, my, Bank, Code, Colour, x, y, xFlip = 0, yFlip, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - TileIndex = (my << 6) | mx; - - Colour = K052109Ram[TileIndex + ram_offset]; - Code = K052109Ram[TileIndex + 0x2000 + ram_offset] + (K052109Ram[TileIndex + 0x4000 + ram_offset] << 8); - - Bank = K052109CharRomBank[(Colour & 0x0c) >> 2]; - if (has_extra_video_ram) Bank = (Colour & 0x0c) >> 2; // kludge for X-Men - - Colour = (Colour & 0xf3) | ((Bank & 0x03) << 2); - Bank >>= 2; - - yFlip = Colour & 0x02; - - INT32 Prio = 0; - - K052109Callback(nLayer, Bank, &Code, &Colour, &xFlip, &Prio); - - if (Prio != Category && EnableCategory) continue; - - if (xFlip && !(K052109FlipEnable & 1)) xFlip = 0; - if (yFlip && !(K052109FlipEnable & 2)) yFlip = 0; - - x = 8 * mx; - y = 8 * my; - - INT32 scrollx = K052109ScrollX[nLayer] + K052109ScrollXOff[nLayer]; - INT32 scrolly = K052109ScrollYOff[nLayer]; - - x -= (scrollx + 104) & 0x1ff; - if (x < -7) x += 512; - - if (K052109EnableCols[nLayer] == 64) { - scrolly += K052109ScrollCols[nLayer][((mx*8)&0x1ff)/8]; - } else { - scrolly += K052109ScrollY[nLayer]; - } - - y -= (scrolly + 16) & 0xff; - if (y < -7) y += 256; - - if (x >= nScreenWidth || y >= nScreenHeight) continue; - - { - UINT32 *dst = konami_bitmap32 + y * nScreenWidth + x; - UINT8 *pri = konami_priority_bitmap + y * nScreenWidth + x; - UINT8 *gfx = K052109RomExp + (Code & K052109RomExpMask) * 0x40; - - INT32 flip = 0; - if (xFlip) flip |= 0x07; - if (yFlip) flip |= 0x38; - - UINT32 *pal = konami_palette32 + (Colour * 16); - INT32 trans = (Opaque) ? 0xffff : 0; - - for (INT32 yy = 0; yy < 8; yy++, y++) - { - if (y >= 0 && y < nScreenHeight) - { - for (INT32 xx = 0; xx < 8; xx++) - { - if ((x+xx) >= 0 && (x+xx) < nScreenWidth) - { - INT32 pxl = gfx[((yy*8)+xx)^flip]; - - if (pxl != trans) - { - dst[xx] = pal[pxl]; - pri[xx] = Priority; - } - } - } - } - - dst += nScreenWidth; - pri += nScreenWidth; - } - } - } - } -} - -UINT8 K052109Read(UINT32 Offset) -{ - if (Offset > 0x5fff) return 0; - - if (K052109RMRDLine) { - INT32 Flags = 0; - INT32 Code = (Offset & 0x1fff) >> 5; - INT32 Colour = K052109RomSubBank; - INT32 Bank = K052109CharRomBank[(Colour & 0x0c) >> 2] >> 2; - Bank |= (K052109CharRomBank2[(Colour & 0x0c) >> 2] >> 2); - - if (has_extra_video_ram) - Code |= Colour << 8; /* kludge for X-Men */ - else - K052109Callback(0, Bank, &Code, &Colour, &Flags, &Flags /*actually priority*/); - - INT32 Addr = (Code << 5) + (Offset & 0x1f); - Addr &= K052109RomMask; - - return K052109Rom[Addr]; - } - - return K052109Ram[Offset]; -} - -void K052109Write(UINT32 Offset, UINT8 Data) -{ - if (Offset > 0x5fff) return; - - K052109Ram[Offset] = Data; - - if (Offset >= 0x4000) has_extra_video_ram = 1; /* kludge for X-Men */ - - if ((Offset & 0x1fff) >= 0x1800) { - switch (Offset) { - case 0x1c80: { - K052109ScrollCtrl = Data; - return; - } - - case 0x1d00: { - K052109_irq_enabled = Data & 0x04; - return; - } - - case 0x1d80: { - K052109CharRomBank[0] = Data & 0x0f; - K052109CharRomBank[1] = (Data >> 4) & 0x0f; - return; - } - - case 0x1e00: // Normal.. - case 0x3e00: // Suprise Attack - { - K052109RomSubBank = Data; - return; - } - - case 0x1e80: { - // flip - K052109FlipEnable = ((Data & 0x06) >> 1); - return; - } - - case 0x1f00: { - K052109CharRomBank[2] = Data & 0x0f; - K052109CharRomBank[3] = (Data >> 4) & 0x0f; - return; - } - - case 0x3d80: // Surprise Attack (rom test) - { -// K052109CharRomBank2[0]; -// K052109CharRomBank2[1]; - return; - } - - case 0x3f00: // Surprise Attack (rom test) - { -// K052109CharRomBank2[2]; -// K052109CharRomBank2[3]; - return; - } - - case 0x180c: - case 0x180d: - case 0x1a00: - case 0x1a01: - case 0x380c: - case 0x380d: - case 0x3a00: - case 0x3a01: { - // Scroll Writes - return; - } - - case 0x1c00: { - //??? - return; - } - } - } -} - -void K052109SetCallback(void (*Callback)(INT32 Layer, INT32 Bank, INT32 *Code, INT32 *Colour, INT32 *xFlip, INT32 *Priority)) -{ - K052109Callback = Callback; -} - -void K052109Reset() -{ - memset(K052109ScrollX, 0, 3 * sizeof(INT32)); - memset(K052109ScrollY, 0, 3 * sizeof(INT32)); - K052109ScrollCtrl = 0; - memset(K052109CharRomBank, 0, 4); - memset(K052109CharRomBank2,0, 4); - K052109RMRDLine = 0; - K052109RomSubBank = 0; - K052109_irq_enabled = 0; - memset (K052109Ram, 0, 0x6000); - - memset (K052109EnableRows, 0, 3 * sizeof(INT32)); - memset (K052109EnableLine, 0, 3 * sizeof(INT32)); - memset (K052109ScrollRows, 0, 256 * 3 * sizeof(INT32)); - memset (K052109EnableCols, 0, 3 * sizeof(INT32)); - memset (K052109ScrollCols, 0, 64 * 3 * sizeof(INT32)); -} - -void K052109GfxDecode(UINT8 *src, UINT8 *dst, INT32 nLen) -{ - INT32 Plane[4] = { STEP4(24, -8) }; - INT32 XOffs[8] = { STEP8(0, 1) }; - INT32 YOffs[8] = { STEP8(0, 32) }; - - GfxDecode((nLen * 2) / (8 * 8), 4, 8, 8, Plane, XOffs, YOffs, 0x100, src, dst); -} - -void K052109Init(UINT8 *pRomSrc, UINT8 *pRomSrcExp, UINT32 RomMask) -{ - K052109Ram = (UINT8*)BurnMalloc(0x6000); - - K052109RomMask = RomMask; - K052109RomExpMask = (RomMask * 2) / (8 * 8); - - K052109Rom = pRomSrc; - K052109RomExp = pRomSrcExp; - - KonamiIC_K052109InUse = 1; - - for (INT32 i = 0; i < 3; i++) { - K052109ScrollXOff[i]=0; - K052109ScrollYOff[i]=0; - } - - KonamiAllocateBitmaps(); - - has_extra_video_ram = 0; -} - -void K052109Exit() -{ - BurnFree(K052109Ram); - - K052109Callback = NULL; - K052109RomMask = 0; - K052109Rom = NULL; - - memset(K052109ScrollX, 0, 3); - memset(K052109ScrollY, 0, 3); - K052109ScrollCtrl = 0; - memset(K052109CharRomBank, 0, 4); - K052109RMRDLine = 0; - K052109RomSubBank = 0; - K052109FlipEnable = 0; - K052109_irq_enabled = 0; - - has_extra_video_ram = 0; -} - -void K052109Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = K052109Ram; - ba.nLen = 0x6000; - ba.szName = "K052109 Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(K052109ScrollX[0]); - SCAN_VAR(K052109ScrollX[1]); - SCAN_VAR(K052109ScrollX[2]); - SCAN_VAR(K052109ScrollY[0]); - SCAN_VAR(K052109ScrollY[1]); - SCAN_VAR(K052109ScrollY[2]); - SCAN_VAR(K052109ScrollCtrl); - SCAN_VAR(K052109ScrollCtrl); - SCAN_VAR(K052109CharRomBank[0]); - SCAN_VAR(K052109CharRomBank[1]); - SCAN_VAR(K052109CharRomBank[2]); - SCAN_VAR(K052109CharRomBank[3]); - SCAN_VAR(K052109CharRomBank2[0]); - SCAN_VAR(K052109CharRomBank2[1]); - SCAN_VAR(K052109CharRomBank2[2]); - SCAN_VAR(K052109CharRomBank2[3]); - SCAN_VAR(K052109RMRDLine); - SCAN_VAR(K052109RomSubBank); - SCAN_VAR(K052109FlipEnable); - SCAN_VAR(K052109_irq_enabled); - SCAN_VAR(has_extra_video_ram); - } -} diff --git a/jan/src/burn/drv/konami/k053245.cpp b/jan/src/burn/drv/konami/k053245.cpp deleted file mode 100644 index ff018f63c..000000000 --- a/jan/src/burn/drv/konami/k053245.cpp +++ /dev/null @@ -1,399 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood - -// k053245 - -#include "tiles_generic.h" -#include "konamiic.h" - -static void (*K053245Callback[2])(INT32 *code,INT32 *color,INT32 *priority); - -UINT8 *K053245Ram[2]; -static UINT8 *K053245Buf[2]; -static UINT8 *K053245Gfx[2]; -static UINT8 *K053245GfxExp[2]; -static INT32 K053245Mask[2]; -static INT32 K053245MaskExp[2]; -static INT32 K053245_dx[2]; -static INT32 K053245_dy[2]; - -static INT32 nBpp[2]; -static UINT8 K053244Regs[2][0x10]; -static INT32 K053244Bank[2]; - -static INT32 K053245Active = 0; - -INT32 K05324xZRejection = -1; - -INT32 K053245Reset() -{ - for (INT32 i = 0; i < K053245Active; i++) { - memset (K053245Ram[i], 0, 0x800); - memset (K053245Buf[i], 0, 0x800); - memset (K053244Regs[i], 0, 0x10); - - K053244Bank[i] = 0; - } - - return 0; -} - -void K053245GfxDecode(UINT8 *src, UINT8 *dst, INT32 len) -{ - INT32 Plane[4] = { STEP4(24, -8) }; - INT32 XOffs[16] = { STEP8(0, 1), STEP8(256, 1) }; - INT32 YOffs[16] = { STEP8(0,32), STEP8(512,32) }; - - GfxDecode(len >> 7, 4, 16, 16, Plane, XOffs, YOffs, 0x400, src, dst); -} - -void K053245Init(INT32 chip, UINT8 *gfx, UINT8 *gfxexp, INT32 mask, void (*callback)(INT32 *code,INT32 *color,INT32 *priority)) -{ - K053245Ram[chip] = (UINT8*)BurnMalloc(0x800); // enough - K053245Buf[chip] = (UINT8*)BurnMalloc(0x800); // enough - - K053245Mask[chip] = mask; - K053245MaskExp[chip] = (mask * 2) / (16 * 16); - - K053245Gfx[chip] = gfx; - K053245GfxExp[chip] = gfxexp; - - K053245Callback[chip] = callback; - - K053245Active++; - - KonamiIC_K053245InUse = 1; - - KonamiAllocateBitmaps(); - - K053245Reset(); - - nBpp[chip] = 4; -} - -void K053245SetBpp(INT32 chip, INT32 bpp) -{ - nBpp[chip] = bpp; -} - -void K053245Exit() -{ - for (INT32 i = 0; i < K053245Active; i++) { - BurnFree (K053245Ram[i]); - BurnFree (K053245Buf[i]); - - K053245_dx[i] = 0; - K053245_dy[i] = 0; - } - - K053245Active = 0; -} - -// Useful functions - -void K053245SetSpriteOffset(INT32 chip,INT32 offsx, INT32 offsy) -{ - K053245_dx[chip] = offsx; - K053245_dy[chip] = offsy; -} - -void K053245ClearBuffer(INT32 chip) -{ - UINT16 *buf = (UINT16*)K053245Buf[chip]; - - for (INT32 i = 0; i < 0x800/2; i+=8) buf[i] = 0; -} - -void K053245UpdateBuffer(INT32 chip) -{ - memcpy (K053245Buf[chip], K053245Ram[chip], 0x800); -} - -void K053244BankSelect(INT32 chip, INT32 bank) -{ - K053244Bank[chip] = bank; -} - - -// 8 bit read/write handlers - -UINT8 K053245Read(INT32 chip, INT32 offset) -{ - return K053245Ram[chip][offset ^ 1]; // -} - -void K053245Write(INT32 chip, INT32 offset, INT32 data) -{ - K053245Ram[chip][offset ^ 1] = data; // -} - -UINT16 K053245ReadWord(INT32 chip, INT32 offset) -{ - UINT16 *ret = (UINT16*)K053245Ram[chip]; - -#if 0 - INT32 r = ret[offset]; - - return (r << 8) | (r >> 8); -#else - return BURN_ENDIAN_SWAP_INT16(ret[offset]); -#endif -} - -void K053245WriteWord(INT32 chip, INT32 offset, INT32 data) -{ - UINT16 *ret = (UINT16*)K053245Ram[chip]; - -#if 0 - ret[offset] = (data << 8) | (data >> 8); -#else - ret[offset] = BURN_ENDIAN_SWAP_INT16(data); -#endif -} - -UINT8 K053244Read(INT32 chip, INT32 offset) -{ - if (K053244Regs[chip][5] & 0x10 && (offset & 0x0c) == 0x0c) - { - INT32 addr = (K053244Bank[chip] << 19) | ((K053244Regs[chip][11] & 0x07) << 18); - addr |= (K053244Regs[chip][8] << 10) | (K053244Regs[chip][ 9] << 2); - addr |= (offset & 3) ^ 1; - addr &= K053245Mask[chip]; - - return K053245Gfx[chip][addr]; - } - else if (offset == 0x06) { - K053245UpdateBuffer(chip); - } - - return 0; -} - -void K053244Write(INT32 chip, INT32 offset, INT32 data) -{ - K053244Regs[chip][offset] = data; - - if (offset == 0x06) { - K053245UpdateBuffer(chip); - } -} - -void K05324xSetZRejection(INT32 z) -{ - K05324xZRejection = z; -} - -// Sprite Rendering - -void K053245SpritesRender(INT32 chip) -{ -#define NUM_SPRITES 128 - INT32 offs,pri_code,i; - INT32 sortedlist[NUM_SPRITES]; - INT32 flipscreenX, flipscreenY, spriteoffsX, spriteoffsY; - - flipscreenX = K053244Regs[chip][5] & 0x01; - flipscreenY = K053244Regs[chip][5] & 0x02; - spriteoffsX = (K053244Regs[chip][0] << 8) | K053244Regs[chip][1]; - spriteoffsY = (K053244Regs[chip][2] << 8) | K053244Regs[chip][3]; - - for (offs = 0;offs < NUM_SPRITES;offs++) - sortedlist[offs] = -1; - - UINT16 *sprbuf = (UINT16*)K053245Buf[chip]; - - UINT8 *gfxdata = K053245GfxExp[chip]; - - /* prebuild a sorted table */ - for (i=0x800/2, offs=0; offs= 0; pri_code--) - { - INT32 ox,oy,color,code,size,w,h,x,y,flipx,flipy,mirrorx,mirrory,shadow,zoomx,zoomy,pri; - - offs = sortedlist[pri_code]; - if (offs == -1) continue; - - code = BURN_ENDIAN_SWAP_INT16(sprbuf[offs+1]); - code = ((code & 0xffe1) + ((code & 0x0010) >> 2) + ((code & 0x0008) << 1) - + ((code & 0x0004) >> 1) + ((code & 0x0002) << 2)); - color = BURN_ENDIAN_SWAP_INT16(sprbuf[offs+6]) & 0x00ff; - pri = 0; - - (*K053245Callback[chip])(&code,&color,&pri); - - size = (BURN_ENDIAN_SWAP_INT16(sprbuf[offs]) & 0x0f00) >> 8; - - w = 1 << (size & 0x03); - h = 1 << ((size >> 2) & 0x03); - - /* zoom control: - 0x40 = normal scale - <0x40 enlarge (0x20 = double size) - >0x40 reduce (0x80 = half size) - */ - zoomy = BURN_ENDIAN_SWAP_INT16(sprbuf[offs+4]); - if (zoomy > 0x2000) continue; - if (zoomy) zoomy = (0x400000+zoomy/2) / zoomy; - else zoomy = 2 * 0x400000; - if ((BURN_ENDIAN_SWAP_INT16(sprbuf[offs]) & 0x4000) == 0) - { - zoomx = BURN_ENDIAN_SWAP_INT16(sprbuf[offs+5]); - if (zoomx > 0x2000) continue; - if (zoomx) zoomx = (0x400000+zoomx/2) / zoomx; - else zoomx = 2 * 0x400000; -// else zoomx = zoomy; /* workaround for TMNT2 */ - } - else zoomx = zoomy; - - ox = BURN_ENDIAN_SWAP_INT16(sprbuf[offs+3]) + spriteoffsX; - oy = BURN_ENDIAN_SWAP_INT16(sprbuf[offs+2]); - - ox += K053245_dx[chip]; - oy += K053245_dy[chip]; - - flipx = BURN_ENDIAN_SWAP_INT16(sprbuf[offs]) & 0x1000; - flipy = BURN_ENDIAN_SWAP_INT16(sprbuf[offs]) & 0x2000; - mirrorx = BURN_ENDIAN_SWAP_INT16(sprbuf[offs+6]) & 0x0100; - if (mirrorx) flipx = 0; // documented and confirmed - mirrory = BURN_ENDIAN_SWAP_INT16(sprbuf[offs+6]) & 0x0200; - shadow = BURN_ENDIAN_SWAP_INT16(sprbuf[offs+6]) & 0x0080; - - if (flipscreenX) - { - ox = 512 - ox; - if (!mirrorx) flipx = !flipx; - } - if (flipscreenY) - { - oy = -oy; - if (!mirrory) flipy = !flipy; - } - - ox = (ox + 0x5d) & 0x3ff; - if (ox >= 768) ox -= 1024; - oy = (-(oy + spriteoffsY + 0x07)) & 0x3ff; - if (oy >= 640) oy -= 1024; - - /* the coordinates given are for the *center* of the sprite */ - ox -= (zoomx * w) >> 13; - oy -= (zoomy * h) >> 13; - - for (y = 0;y < h;y++) - { - INT32 sx,sy,zw,zh; - - sy = oy + ((zoomy * y + (1<<11)) >> 12); - zh = (oy + ((zoomy * (y+1) + (1<<11)) >> 12)) - sy; - - for (x = 0;x < w;x++) - { - INT32 c,fx,fy; - - sx = ox + ((zoomx * x + (1<<11)) >> 12); - zw = (ox + ((zoomx * (x+1) + (1<<11)) >> 12)) - sx; - c = code; - if (mirrorx) - { - if ((flipx == 0) ^ (2*x < w)) - { - /* mirror left/right */ - c += (w-x-1); - fx = 1; - } - else - { - c += x; - fx = 0; - } - } - else - { - if (flipx) c += w-1-x; - else c += x; - fx = flipx; - } - if (mirrory) - { - if ((flipy == 0) ^ (2*y >= h)) - { - /* mirror top/bottom */ - c += 8*(h-y-1); - fy = 1; - } - else - { - c += 8*y; - fy = 0; - } - } - else - { - if (flipy) c += 8*(h-1-y); - else c += 8*y; - fy = flipy; - } - - c = ((c & 0x3f) | (code & ~0x3f)) & K053245MaskExp[chip]; - - if (shadow) { - konami_render_zoom_shadow_tile(gfxdata, c, nBpp[chip], color, sx, sy, fx, fy, 16, 16, zw << 12, zh << 12, pri, 0); - continue; - } - - if (zoomx == 0x10000 && zoomy == 0x10000) - { - konami_draw_16x16_prio_tile(gfxdata, c, nBpp[chip], color, sx, sy, fx, fy, pri); - } - else - { - konami_draw_16x16_priozoom_tile(gfxdata, c, nBpp[chip], color, 0, sx, sy, fx, fy, 16, 16, zw << 12, zh << 12, pri); - } - } - } - } -} - -void K053245Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - for (INT32 i = 0; i < 2; i++) { - if (K053245Ram[i]) { - memset(&ba, 0, sizeof(ba)); - ba.Data = K053245Ram[i]; - ba.nLen = 0x800; - ba.szName = "K053245 Ram"; - BurnAcb(&ba); - - ba.Data = K053245Buf[i]; - ba.nLen = 0x800; - ba.szName = "K053245 Buffer"; - BurnAcb(&ba); - } - - memset(&ba, 0, sizeof(ba)); - ba.Data = K053244Regs[i]; - ba.nLen = 0x010; - ba.szName = "K053244 Registers"; - BurnAcb(&ba); - } - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(K053244Bank[0]); - SCAN_VAR(K053244Bank[1]); - } -} diff --git a/jan/src/burn/drv/konami/k053247.cpp b/jan/src/burn/drv/konami/k053247.cpp deleted file mode 100644 index 28fcce337..000000000 --- a/jan/src/burn/drv/konami/k053247.cpp +++ /dev/null @@ -1,1225 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood - -// k053247 - -#include "tiles_generic.h" -#include "konamiic.h" - -#define K053247_CUSTOMSHADOW 0x20000000 -#define K053247_SHDSHIFT 20 - -static UINT8 K053246Regs[8]; -static UINT8 K053246_OBJCHA_line; -UINT8 *K053247Ram; -static UINT16 K053247Regs[16]; - -static UINT8 *K053246Gfx; -static UINT32 K053246Mask; -static UINT8 *K053246GfxExp; -static UINT32 K053246MaskExp; - -static INT32 K053247_dx; -static INT32 K053247_dy; -static INT32 K053247_wraparound; - -static INT32 nBpp = 4; - -static INT32 K053247Flags; - -void (*K053247Callback)(INT32 *code, INT32 *color, INT32 *priority); - -void K053247Reset() -{ - memset (K053247Ram, 0, 0x1000); - memset (K053247Regs, 0, 16 * sizeof (UINT16)); - memset (K053246Regs, 0, 8); - - K053246_OBJCHA_line = 0; // clear -} - -void K053247Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = K053247Ram; - ba.nLen = 0x1000; - ba.szName = "K053247 Ram"; - BurnAcb(&ba); - - ba.Data = K053247Regs; - ba.nLen = 0x0010 * sizeof(UINT16); - ba.szName = "K053247 Regs"; - BurnAcb(&ba); - - ba.Data = K053246Regs; - ba.nLen = 0x0008; - ba.szName = "K053246 Regs"; - BurnAcb(&ba); - - SCAN_VAR(K053246_OBJCHA_line); - SCAN_VAR(K053247_wraparound); - } -} - -void K053247Init(UINT8 *gfxrom, UINT8 *gfxromexp, INT32 gfxlen, void (*Callback)(INT32 *code, INT32 *color, INT32 *priority), INT32 flags) -{ - K053247Ram = (UINT8*)BurnMalloc(0x1000); - - K053246Gfx = gfxrom; - K053246Mask = gfxlen; - - K053246GfxExp = gfxromexp; - K053246MaskExp = ((gfxlen * 2) + 1) / 0x100; - - K053247Callback = Callback; - - K053247_dx = 0; - K053247_dy = 0; - K053247_wraparound = 1; - - KonamiAllocateBitmaps(); - - K053247Flags = flags; // 0x02 highlight, 0x01 shadow - - KonamiIC_K053247InUse = 1; - - nBpp = 4; -} - -void K053247SetBpp(INT32 bpp) -{ - nBpp = bpp; -} - -void K053247Exit() -{ - BurnFree (K053247Ram); - - K053247Flags = 0; - - memset (K053247Regs, 0, 16 * sizeof(UINT16)); -} - -void K053247Export(UINT8 **ram, UINT8 **gfx, void (**callback)(INT32 *, INT32 *, INT32 *), INT32 *dx, INT32 *dy) -{ - if (ram) *ram = K053247Ram; - if (gfx) *gfx = K053246Gfx; - - if (dx) *dx = K053247_dx; - if (dy) *dy = K053247_dy; - - if(callback) *callback = K053247Callback; -} - -void K053247GfxDecode(UINT8 *src, UINT8 *dst, INT32 len) // 16x16 -{ - for (INT32 i = 0; i < len; i++) - { - INT32 t = src[i^1]; - dst[(i << 1) + 0] = t >> 4; - dst[(i << 1) + 1] = t & 0x0f; - } -} - -void K053247SetSpriteOffset(INT32 offsx, INT32 offsy) -{ - K053247_dx = offsx; - K053247_dy = offsy; -} - -void K053247WrapEnable(INT32 status) -{ - K053247_wraparound = status; -} - -UINT8 K053247Read(INT32 offset) -{ - return K053247Ram[offset & 0xfff]; -} - -UINT16 K053247ReadWord(INT32 offset) -{ - return *((UINT16*)(K053247Ram + (offset & 0xffe))); -} - -void K053247WriteWord(INT32 offset, UINT16 data) -{ - *((UINT16*)(K053247Ram + (offset & 0xffe))) = BURN_ENDIAN_SWAP_INT16(data); -} - -void K053247Write(INT32 offset, INT32 data) -{ - if (data & 0x10000) { // use word - *((UINT16*)(K053247Ram + (offset & 0xffe))) = BURN_ENDIAN_SWAP_INT16(data); - } else { - K053247Ram[offset & 0xfff] = data; - } -} - -void K053247WriteRegsByte(INT32 offset, UINT8 data) -{ - UINT8 *regs = (UINT8*)&K053247Regs; - - regs[(offset & 0x1f)^1] = data; -} - -void K053247WriteRegsWord(INT32 offset, UINT16 data) -{ - K053247Regs[(offset & 0x1e) / 2] = data; -} - -UINT16 K053247ReadRegs(INT32 offset) -{ - return K053247Regs[offset & 0xf]; -} - -UINT16 K053246ReadRegs(INT32 offset) -{ - return K053246Regs[offset & 7]; -} - -UINT8 K053246Read(INT32 offset) -{ - if (K053246_OBJCHA_line) // assert_line - { - INT32 addr; - - addr = (K053246Regs[6] << 17) | (K053246Regs[7] << 9) | (K053246Regs[4] << 1) | ((offset & 1) ^ 1); - addr &= K053246Mask; - - return K053246Gfx[addr]; - } - else - { - return 0; - } -} - -void K053246Write(INT32 offset, INT32 data) -{ - if (data & 0x10000) { // handle it as a word - *((UINT16*)(K053246Regs + (offset & 6))) = BURN_ENDIAN_SWAP_INT16(data); - } else { - K053246Regs[offset & 7] = data; - } -} - -void K053246_set_OBJCHA_line(INT32 state) -{ - K053246_OBJCHA_line = state; -} - -INT32 K053246_is_IRQ_enabled() -{ - return K053246Regs[5] & 0x10; -} - -void K053247SpritesRender() -{ -#define NUM_SPRITES 256 - - - UINT8 dtable[256]; - UINT8 stable[256]; - UINT8 *wtable; - - memset(dtable, 1, 256); - dtable[0] = 0; - memset(stable, 2, 256); - stable[0] = 0; - - static const INT32 xoffset[8] = { 0, 1, 4, 5, 16, 17, 20, 21 }; - static const INT32 yoffset[8] = { 0, 2, 8, 10, 32, 34, 40, 42 }; - - INT32 sortedlist[NUM_SPRITES]; - INT32 offs,zcode; - INT32 ox,oy,color,code,size,w,h,x,y,xa,ya,flipx,flipy,mirrorx,mirrory,shadow,zoomx,zoomy,primask; - INT32 nozoom,count,temp,shdmask; - - INT32 flipscreenx = K053246Regs[5] & 0x01; - INT32 flipscreeny = K053246Regs[5] & 0x02; - INT32 offx = (INT16)((K053246Regs[0] << 8) | K053246Regs[1]); - INT32 offy = (INT16)((K053246Regs[2] << 8) | K053246Regs[3]); - - UINT16 *SprRam = (UINT16*)K053247Ram; - - UINT8 *gfxbase = K053246GfxExp; - - INT32 screen_width = nScreenWidth-1; - - if (K053247Flags & 1) { - if (K053247Flags & 2) { - shdmask = 3; - } else { - shdmask = 0; - } - } else { - shdmask = -1; - } - - // Prebuild a sorted table by descending Z-order. - zcode = K05324xZRejection; - offs = count = 0; - - if (zcode == -1) - { - for (; offs<0x800; offs+=8) - if (BURN_ENDIAN_SWAP_INT16(SprRam[offs]) & 0x8000) sortedlist[count++] = offs; - } - else - { - for (; offs<0x800; offs+=8) - if ((BURN_ENDIAN_SWAP_INT16(SprRam[offs]) & 0x8000) && ((BURN_ENDIAN_SWAP_INT16(SprRam[offs]) & 0xff) != zcode)) sortedlist[count++] = offs; - } - - w = count; - count--; - h = count; - - if (!(K053247Regs[0xc/2] & 0x10)) - { - // sort objects in decending order(smaller z closer) when OPSET PRI is clear - for (y=0; y= code) { zcode = code; sortedlist[x] = offs; sortedlist[y] = offs = temp; } - } - } - } - - for (INT32 i = count; i >= 0; i--) - { - offs = sortedlist[i]; - - code = BURN_ENDIAN_SWAP_INT16(SprRam[offs+1]); - shadow = color = BURN_ENDIAN_SWAP_INT16(SprRam[offs+6]); - primask = 0; - - (*K053247Callback)(&code,&color,&primask); - - temp = BURN_ENDIAN_SWAP_INT16(SprRam[offs]); - - size = (temp & 0x0f00) >> 8; - w = 1 << (size & 0x03); - h = 1 << ((size >> 2) & 0x03); - - /* the sprite can start at any point in the 8x8 grid. We have to */ - /* adjust the offsets to draw it correctly. Simpsons does this all the time. */ - xa = 0; - ya = 0; - if (code & 0x01) xa += 1; - if (code & 0x02) ya += 1; - if (code & 0x04) xa += 2; - if (code & 0x08) ya += 2; - if (code & 0x10) xa += 4; - if (code & 0x20) ya += 4; - code &= ~0x3f; - - oy = (INT16)BURN_ENDIAN_SWAP_INT16(SprRam[offs+2]); - ox = (INT16)BURN_ENDIAN_SWAP_INT16(SprRam[offs+3]); - - ox += K053247_dx; - oy -= K053247_dy; - - if (K053247_wraparound) - { - offx &= 0x3ff; - offy &= 0x3ff; - oy &= 0x3ff; - ox &= 0x3ff; - } - - y = zoomy = BURN_ENDIAN_SWAP_INT16(SprRam[offs+4]) & 0x3ff; - if (zoomy) zoomy = (0x400000+(zoomy>>1)) / zoomy; else zoomy = 0x800000; - if (!(temp & 0x4000)) - { - x = zoomx = BURN_ENDIAN_SWAP_INT16(SprRam[offs+5]) & 0x3ff; - if (zoomx) zoomx = (0x400000+(zoomx>>1)) / zoomx; - else zoomx = 0x800000; - } - else { zoomx = zoomy; x = y; } - - if ( K053246Regs[5] & 0x08 ) // Check only "Bit #3 is '1'?" (NOTE: good guess) - { - zoomx >>= 1; // Fix sprite width to HALF size - ox = (ox >> 1) + 1; // Fix sprite draw position - if (flipscreenx) ox += screen_width; - nozoom = 0; - } - else - nozoom = (x == 0x40 && y == 0x40); - - flipx = temp & 0x1000; - flipy = temp & 0x2000; - mirrorx = shadow & 0x4000; - if (mirrorx) flipx = 0; // documented and confirmed - mirrory = shadow & 0x8000; - - INT32 highlight = 0; - - wtable = dtable; - - if (color == -1) - { - // drop the entire sprite to shadow unconditionally - if (shdmask < 0) continue; - color = 0; - shadow = -1; - - wtable = stable; - } - else - { - if (shdmask >= 0) - { - shadow = (color & 0x20000000) ? (color >> 20) : (shadow >> 10); - - if (shadow &= 3) { - if (((shadow-1) & shdmask) == 1) highlight = 1; - } - } - else - shadow = 0; - } - - color &= 0xffff; // strip attribute flags - - if (flipscreenx) - { - ox = -ox; - if (!mirrorx) flipx = !flipx; - } - if (flipscreeny) - { - oy = -oy; - if (!mirrory) flipy = !flipy; - } - - // apply wrapping and global offsets - if (K053247_wraparound) - { - ox = ( ox - offx) & 0x3ff; - oy = (-oy - offy) & 0x3ff; - if (ox >= 0x300) ox -= 0x400; - if (oy >= 0x280) oy -= 0x400; - } - else - { - ox = ox - offx; - oy = -oy - offy; - } - - // apply global and display window offsets - - /* the coordinates given are for the *center* of the sprite */ - ox -= (zoomx * w) >> 13; - oy -= (zoomy * h) >> 13; - - dtable[15] = shadow ? 2 : 1; - - for (y = 0;y < h;y++) - { - INT32 sx,sy,zw,zh; - - sy = oy + ((zoomy * y + (1<<11)) >> 12); - zh = (oy + ((zoomy * (y+1) + (1<<11)) >> 12)) - sy; - - for (x = 0;x < w;x++) - { - INT32 c,fx,fy; - - sx = ox + ((zoomx * x + (1<<11)) >> 12); - zw = (ox + ((zoomx * (x+1) + (1<<11)) >> 12)) - sx; - c = code; - if (mirrorx) - { - if ((flipx == 0) ^ ((x<<1) < w)) - { - /* mirror left/right */ - c += xoffset[(w-1-x+xa)&7]; - fx = 1; - } - else - { - c += xoffset[(x+xa)&7]; - fx = 0; - } - } - else - { - if (flipx) c += xoffset[(w-1-x+xa)&7]; - else c += xoffset[(x+xa)&7]; - fx = flipx; - } - - if (mirrory) - { - if ((flipy == 0) ^ ((y<<1) >= h)) - { - /* mirror top/bottom */ - c += yoffset[(h-1-y+ya)&7]; - fy = 1; - } - else - { - c += yoffset[(y+ya)&7]; - fy = 0; - } - } - else - { - if (flipy) c += yoffset[(h-1-y+ya)&7]; - else c += yoffset[(y+ya)&7]; - fy = flipy; - } - - c &= K053246MaskExp; - - if (shadow || wtable == stable) { - if (mirrory && h == 1) - konami_render_zoom_shadow_tile(gfxbase, c, nBpp, color, sx, sy, fx, !fy, 16, 16, zw << 12, zh << 12, primask, highlight); - - konami_render_zoom_shadow_tile(gfxbase, c, nBpp, color, sx, sy, fx, fy, 16, 16, zw << 12, zh << 12, primask, highlight); - continue; - } - - if (mirrory && h == 1) - { - if (nozoom) { - konami_draw_16x16_prio_tile(gfxbase, c, nBpp, color, sx, sy, fx, !fy, primask); - } else { - konami_draw_16x16_priozoom_tile(gfxbase, c, nBpp, color, 0, sx, sy, fx, !fy, 16, 16, zw<<12, zh<<12, primask); - } - } - - if (nozoom) { - konami_draw_16x16_prio_tile(gfxbase, c, nBpp, color, sx, sy, fx, fy, primask); - } else { - konami_draw_16x16_priozoom_tile(gfxbase, c, nBpp, color, 0, sx, sy, fx, fy, 16, 16, zw<<12, zh<<12, primask); - } - } // end of X loop - } // end of Y loop - - } // end of sprite-list loop -#undef NUM_SPRITES -} - -static inline UINT32 alpha_blend_r32(UINT32 d, UINT32 s, UINT32 p) -{ - if (p == 0) return d; - - INT32 a = 256 - p; - - return (((((s & 0xff00ff) * p) + ((d & 0xff00ff) * a)) & 0xff00ff00) | - ((((s & 0x00ff00) * p) + ((d & 0x00ff00) * a)) & 0x00ff0000)) >> 8; -} - -static inline UINT32 shadow_blend(UINT32 d) -{ - return ((((d & 0xff00ff) * 0x9d) & 0xff00ff00) + (((d & 0x00ff00) * 0x9d) & 0x00ff0000)) / 0x100; -} - -static inline UINT32 highlight_blend(UINT32 d) -{ - INT32 r = ((d&0xff0000)+0x220000); - if (r > 0xff0000) r = 0xff0000; - - INT32 g = ((d&0x00ff00)+0x002200); - if (g > 0x00ff00) g = 0x00ff00; - - INT32 b = ((d&0x0000ff)+0x000022); - if (b > 0x0000ff) b = 0x0000ff; - return r|g|b; -} - -#define GX_ZBUFW 512 -#define GX_ZBUFH 256 - -void zdrawgfxzoom32GP(UINT32 code, UINT32 color, INT32 flipx, INT32 flipy, INT32 sx, INT32 sy, - INT32 scalex, INT32 scaley, INT32 alpha, INT32 drawmode, INT32 zcode, INT32 pri, UINT8* gx_objzbuf, UINT8* gx_shdzbuf) -{ -#define FP 19 -#define FPONE (1<> 4) && (K053247Flags & 2);// for fba - //INT32 highlight_enable = drawmode >> 4;// for fba - drawmode &= 0xf; - - // cull illegal and transparent objects - if (!scalex || !scaley) return; - - // find shadow pens and cull invisible shadows - granularity = shdpen = ((1 << nBpp) /*- 1*/); - shdpen--; - - if (zcode >= 0) - { - if (drawmode == 5) { drawmode = 4; shdpen = 1; } - } - else - if (drawmode >= 4) return; - - // alpha blend necessary? - if (drawmode & 2) - { - if (alpha <= 0) return; - if (alpha >= 255) drawmode &= ~2; - } - - // fill internal data structure with default values - ozbuf_ptr = gx_objzbuf; - szbuf_ptr = gx_shdzbuf; - - src_pitch = 16; - src_fw = 16; - src_fh = 16; - src_base = K053246GfxExp + (code * 0x100); - - pal_base = konami_palette32 + (color << nBpp); - shd_base = konami_palette32; // m_palette->shadow_table(); // iq_132 - - dst_ptr = konami_bitmap32; - dst_pitch = nScreenWidth; - dst_minx = 0; - dst_maxx = (nScreenWidth - 1); - dst_miny = 0; - dst_maxy = (nScreenHeight - 1); - dst_x = sx; - dst_y = sy; - - // cull off-screen objects - if (dst_x > dst_maxx || dst_y > dst_maxy) return; - nozoom = (scalex == 0x10000 && scaley == 0x10000); - if (nozoom) - { - dst_h = dst_w = 16; - src_fdy = src_fdx = 1; - } - else - { - dst_w = ((scalex<<4)+0x8000)>>16; - dst_h = ((scaley<<4)+0x8000)>>16; - if (!dst_w || !dst_h) return; - - src_fw <<= FP; - src_fh <<= FP; - src_fdx = src_fw / dst_w; - src_fdy = src_fh / dst_h; - } - dst_lastx = dst_x + dst_w - 1; - if (dst_lastx < dst_minx) return; - dst_lasty = dst_y + dst_h - 1; - if (dst_lasty < dst_miny) return; - - // clip destination - dst_skipx = 0; - eax = dst_minx; if ((eax -= dst_x) > 0) { dst_skipx = eax; dst_w -= eax; dst_x = dst_minx; } - eax = dst_lastx; if ((eax -= dst_maxx) > 0) dst_w -= eax; - dst_skipy = 0; - eax = dst_miny; if ((eax -= dst_y) > 0) { dst_skipy = eax; dst_h -= eax; dst_y = dst_miny; } - eax = dst_lasty; if ((eax -= dst_maxy) > 0) dst_h -= eax; - - // calculate zoom factors and clip source - if (nozoom) - { - if (!flipx) src_fbx = 0; else { src_fbx = src_fw - 1; src_fdx = -src_fdx; } - if (!flipy) src_fby = 0; else { src_fby = src_fh - 1; src_fdy = -src_fdy; src_pitch = -src_pitch; } - } - else - { - if (!flipx) src_fbx = FPENT; else { src_fbx = src_fw - FPENT - 1; src_fdx = -src_fdx; } - if (!flipy) src_fby = FPENT; else { src_fby = src_fh - FPENT - 1; src_fdy = -src_fdy; } - } - src_fbx += dst_skipx * src_fdx; - src_fby += dst_skipy * src_fdy; - - // adjust insertion points and pre-entry constants - eax = (dst_y - dst_miny) * GX_ZBUFW + (dst_x - dst_minx) + dst_w; - z8 = (UINT8)zcode; - p8 = (UINT8)pri; - ozbuf_ptr += eax; - szbuf_ptr += eax << 1; - dst_ptr += dst_y * dst_pitch + dst_x + dst_w; - dst_w = -dst_w; - - if (!nozoom) - { - ecx = src_fby; src_fby += src_fdy; - ecx >>= FP; src_fx = src_fbx; - src_x = src_fbx; src_fx += src_fdx; - ecx <<= 4; src_ptr = src_base; - src_x >>= FP; src_ptr += ecx; - ecx = dst_w; - - if (zcode < 0) // no shadow and z-buffering - { - do { - do { - eax = src_ptr[src_x]; - src_x = src_fx; - src_fx += src_fdx; - src_x >>= FP; - if (!eax || eax >= shdpen) continue; - dst_ptr [ecx] = pal_base[eax]; - } - while (++ecx); - - ecx = src_fby; src_fby += src_fdy; - dst_ptr += dst_pitch; - ecx >>= FP; src_fx = src_fbx; - src_x = src_fbx; src_fx += src_fdx; - ecx <<= 4; src_ptr = src_base; - src_x >>= FP; src_ptr += ecx; - ecx = dst_w; - } - while (--dst_h); - } - else - { - switch (drawmode) - { - case 0: // all pens solid - do { - do { - eax = src_ptr[src_x]; - src_x = src_fx; - src_fx += src_fdx; - src_x >>= FP; - if (!eax || ozbuf_ptr[ecx] < z8) continue; - eax = pal_base[eax]; - ozbuf_ptr[ecx] = z8; - dst_ptr [ecx] = eax; - } - while (++ecx); - - ecx = src_fby; src_fby += src_fdy; - ozbuf_ptr += GX_ZBUFW; - dst_ptr += dst_pitch; - ecx >>= FP; src_fx = src_fbx; - src_x = src_fbx; src_fx += src_fdx; - ecx <<= 4; src_ptr = src_base; - src_x >>= FP; src_ptr += ecx; - ecx = dst_w; - } - while (--dst_h); - break; - - case 1: // solid pens only - do { - do { - eax = src_ptr[src_x]; - src_x = src_fx; - src_fx += src_fdx; - src_x >>= FP; - if (!eax || eax >= shdpen || ozbuf_ptr[ecx] < z8) continue; - eax = pal_base[eax]; - ozbuf_ptr[ecx] = z8; - dst_ptr [ecx] = eax; - } - while (++ecx); - - ecx = src_fby; src_fby += src_fdy; - ozbuf_ptr += GX_ZBUFW; - dst_ptr += dst_pitch; - ecx >>= FP; src_fx = src_fbx; - src_x = src_fbx; src_fx += src_fdx; - ecx <<= 4; src_ptr = src_base; - src_x >>= FP; src_ptr += ecx; - ecx = dst_w; - } - while (--dst_h); - break; - - case 2: // all pens solid with alpha blending - do { - do { - eax = src_ptr[src_x]; - src_x = src_fx; - src_fx += src_fdx; - src_x >>= FP; - if (!eax || ozbuf_ptr[ecx] < z8) continue; - ozbuf_ptr[ecx] = z8; - - dst_ptr[ecx] = alpha_blend_r32(pal_base[eax], dst_ptr[ecx], alpha); - } - while (++ecx); - - ecx = src_fby; src_fby += src_fdy; - ozbuf_ptr += GX_ZBUFW; - dst_ptr += dst_pitch; - ecx >>= FP; src_fx = src_fbx; - src_x = src_fbx; src_fx += src_fdx; - ecx <<= 4; src_ptr = src_base; - src_x >>= FP; src_ptr += ecx; - ecx = dst_w; - } - while (--dst_h); - break; - - case 3: // solid pens only with alpha blending - do { - do { - eax = src_ptr[src_x]; - src_x = src_fx; - src_fx += src_fdx; - src_x >>= FP; - if (!eax || eax >= shdpen || ozbuf_ptr[ecx] < z8) continue; - ozbuf_ptr[ecx] = z8; - - dst_ptr[ecx] = alpha_blend_r32(pal_base[eax], dst_ptr[ecx], alpha); - } - while (++ecx); - - ecx = src_fby; src_fby += src_fdy; - ozbuf_ptr += GX_ZBUFW; - dst_ptr += dst_pitch; - ecx >>= FP; src_fx = src_fbx; - src_x = src_fbx; src_fx += src_fdx; - ecx <<= 4; src_ptr = src_base; - src_x >>= FP; src_ptr += ecx; - ecx = dst_w; - } - while (--dst_h); - break; - - case 4: // shadow pens only - do { - do { - eax = src_ptr[src_x]; - src_x = src_fx; - src_fx += src_fdx; - src_x >>= FP; - if (eax < shdpen || szbuf_ptr[ecx*2] < z8 || szbuf_ptr[ecx*2+1] <= p8) continue; - //UINT32 pix = dst_ptr[ecx]; - szbuf_ptr[ecx*2] = z8; - szbuf_ptr[ecx*2+1] = p8; - - // the shadow tables are 15-bit lookup tables which accept RGB15... lossy, nasty, yuck! - if (highlight_enable) { - dst_ptr[ecx] = highlight_blend(dst_ptr[ecx]); - } else { - dst_ptr[ecx] = shadow_blend(dst_ptr[ecx]); //shd_base[pix.as_rgb15()]; - } - //dst_ptr[ecx] =(eax>>3&0x001f);lend_r32( eax, 0x00000000, 128); - } - while (++ecx); - - ecx = src_fby; src_fby += src_fdy; - szbuf_ptr += (GX_ZBUFW<<1); - dst_ptr += dst_pitch; - ecx >>= FP; src_fx = src_fbx; - src_x = src_fbx; src_fx += src_fdx; - ecx <<= 4; src_ptr = src_base; - src_x >>= FP; src_ptr += ecx; - ecx = dst_w; - } - while (--dst_h); - break; - } // switch (drawmode) - } // if (zcode < 0) - } // if (!nozoom) - else - { - src_ptr = src_base + (src_fby<<4) + src_fbx; - src_fdy = src_fdx * dst_w + src_pitch; - ecx = dst_w; - - if (zcode < 0) // no shadow and z-buffering - { - do { - do { - eax = *src_ptr; - src_ptr += src_fdx; - if (!eax || eax >= shdpen) continue; - dst_ptr[ecx] = pal_base[eax]; - } - while (++ecx); - - src_ptr += src_fdy; - dst_ptr += dst_pitch; - ecx = dst_w; - } - while (--dst_h); - } - else - { - switch (drawmode) - { - case 0: // all pens solid - do { - do { - eax = *src_ptr; - src_ptr += src_fdx; - if (!eax || ozbuf_ptr[ecx] < z8) continue; - eax = pal_base[eax]; - ozbuf_ptr[ecx] = z8; - dst_ptr[ecx] = eax; - } - while (++ecx); - - src_ptr += src_fdy; - ozbuf_ptr += GX_ZBUFW; - dst_ptr += dst_pitch; - ecx = dst_w; - } - while (--dst_h); - break; - - case 1: // solid pens only - do { - do { - eax = *src_ptr; - src_ptr += src_fdx; - if (!eax || eax >= shdpen || ozbuf_ptr[ecx] < z8) continue; - eax = pal_base[eax]; - ozbuf_ptr[ecx] = z8; - dst_ptr[ecx] = eax; - } - while (++ecx); - - src_ptr += src_fdy; - ozbuf_ptr += GX_ZBUFW; - dst_ptr += dst_pitch; - ecx = dst_w; - } - while (--dst_h); - break; - - case 2: // all pens solid with alpha blending - do { - do { - eax = *src_ptr; - src_ptr += src_fdx; - if (!eax || ozbuf_ptr[ecx] < z8) continue; - ozbuf_ptr[ecx] = z8; - - dst_ptr[ecx] = alpha_blend_r32(pal_base[eax], dst_ptr[ecx], alpha); - } - while (++ecx); - - src_ptr += src_fdy; - ozbuf_ptr += GX_ZBUFW; - dst_ptr += dst_pitch; - ecx = dst_w; - } - while (--dst_h); - break; - - case 3: // solid pens only with alpha blending - do { - do { - eax = *src_ptr; - src_ptr += src_fdx; - if (!eax || eax >= shdpen || ozbuf_ptr[ecx] < z8) continue; - ozbuf_ptr[ecx] = z8; - - dst_ptr[ecx] = alpha_blend_r32(pal_base[eax], dst_ptr[ecx], alpha); - } - while (++ecx); - - src_ptr += src_fdy; - ozbuf_ptr += GX_ZBUFW; - dst_ptr += dst_pitch; - ecx = dst_w; - } - while (--dst_h); - break; - - case 4: // shadow pens only - do { - do { - eax = *src_ptr; - src_ptr += src_fdx; - if (eax < shdpen || szbuf_ptr[ecx*2] < z8 || szbuf_ptr[ecx*2+1] <= p8) continue; - //UINT32 pix = dst_ptr[ecx]; - szbuf_ptr[ecx*2] = z8; - szbuf_ptr[ecx*2+1] = p8; - - // the shadow tables are 15-bit lookup tables which accept RGB15... lossy, nasty, yuck! - if (highlight_enable) { - dst_ptr[ecx] = highlight_blend(dst_ptr[ecx]); - } else { - dst_ptr[ecx] = shadow_blend(dst_ptr[ecx]); //shd_base[pix.as_rgb15()]; - } - } - while (++ecx); - - src_ptr += src_fdy; - szbuf_ptr += (GX_ZBUFW<<1); - dst_ptr += dst_pitch; - ecx = dst_w; - } - while (--dst_h); - break; - } - } - } -#undef FP -#undef FPONE -#undef FPHALF -#undef FPENT -} - - - - - -void k053247_draw_yxloop_gx( - INT32 code, - INT32 color, - INT32 height, INT32 width, - INT32 zoomx, INT32 zoomy, INT32 flipx, INT32 flipy, - INT32 ox, INT32 oy, - INT32 xa, INT32 ya, - INT32 mirrorx, INT32 mirrory, - INT32 nozoom, - /* gx specifics */ - INT32 pri, - INT32 zcode, INT32 alpha, INT32 drawmode, - UINT8* gx_objzbuf, UINT8* gx_shdzbuf, - /* non-gx specifics */ - INT32 /*primask*/, - UINT8* /*whichtable*/ - ) - { - static const INT32 xoffset[8] = { 0, 1, 4, 5, 16, 17, 20, 21 }; - static const INT32 yoffset[8] = { 0, 2, 8, 10, 32, 34, 40, 42 }; - INT32 zw,zh; - INT32 fx, fy, sx, sy; - INT32 tempcode; - - for (INT32 y=0; y> 12); - zh = (oy + ((zoomy * (y+1) + (1<<11)) >> 12)) - sy; - - for (INT32 x=0; x> 12); - zw = (ox + ((zoomx * (x+1) + (1<<11)) >> 12)) - sx; - tempcode = code; - - if (mirrorx) - { - if ((!flipx)^((x<<1)=height)) - { - /* mirror top/bottom */ - tempcode += yoffset[(height-1-y+ya)&7]; - fy = 1; - } - else - { - tempcode += yoffset[(y+ya)&7]; - fy = 0; - } - } - else - { - if (flipy) tempcode += yoffset[(height-1-y+ya)&7]; - else tempcode += yoffset[(y+ya)&7]; - fy = flipy; - } - - { - if (nozoom) { zw = zh = 0x10; } - - zdrawgfxzoom32GP( - tempcode, - color, - fx,fy, - sx,sy, - zw << 12, zh << 12, alpha, drawmode, zcode, pri, - gx_objzbuf, gx_shdzbuf - ); - - } - } // end of X loop - } // end of Y loop - } - - - - -void k053247_draw_single_sprite_gxcore(UINT8 *gx_objzbuf, UINT8 *gx_shdzbuf, INT32 code, UINT16 *gx_spriteram, INT32 offs, - INT32 color, INT32 alpha, INT32 drawmode, INT32 zcode, INT32 pri, - INT32 /*primask*/, INT32 /*shadow*/, UINT8 */*drawmode_table*/, UINT8 */*shadowmode_table*/, INT32 /*shdmask*/) - { - INT32 xa,ya,ox,oy,flipx,flipy,mirrorx,mirrory,zoomx,zoomy,scalex,scaley,nozoom; - INT32 temp, temp4; - INT32 flipscreenx = K053246Regs[5] & 0x01; - INT32 flipscreeny = K053246Regs[5] & 0x02; - - xa = ya = 0; - if (code & 0x01) xa += 1; - if (code & 0x02) ya += 1; - if (code & 0x04) xa += 2; - if (code & 0x08) ya += 2; - if (code & 0x10) xa += 4; - if (code & 0x20) ya += 4; - code &= ~0x3f; - - temp4 = gx_spriteram[offs]; - - // mask off the upper 6 bits of coordinate and zoom registers - oy = gx_spriteram[offs+2] & 0x3ff; - ox = gx_spriteram[offs+3] & 0x3ff; - - scaley = zoomy = gx_spriteram[offs+4] & 0x3ff; - if (zoomy) zoomy = (0x400000+(zoomy>>1)) / zoomy; - else zoomy = 0x800000; - if (!(temp4 & 0x4000)) - { - scalex = zoomx = gx_spriteram[offs+5] & 0x3ff; - if (zoomx) zoomx = (0x400000+(zoomx>>1)) / zoomx; - else zoomx = 0x800000; - } - else { zoomx = zoomy; scalex = scaley; } - - nozoom = (scalex == 0x40 && scaley == 0x40); - - flipx = temp4 & 0x1000; - flipy = temp4 & 0x2000; - - temp = gx_spriteram[offs+6]; - mirrorx = temp & 0x4000; - if (mirrorx) flipx = 0; // only applies to x mirror, proven - mirrory = temp & 0x8000; - - INT32 objset1 = K053246ReadRegs(5); - // for Escape Kids (GX975) - if ( objset1 & 8 ) // Check only "Bit #3 is '1'?" - { - INT32 screenwidth = nScreenWidth-1; - - zoomx = zoomx>>1; // Fix sprite width to HALF size - ox = (ox>>1) + 1; // Fix sprite draw position - - if (flipscreenx) ox += screenwidth; - nozoom = 0; - } - - if (flipscreenx) { ox = -ox; if (!mirrorx) flipx = !flipx; } - if (flipscreeny) { oy = -oy; if (!mirrory) flipy = !flipy; } - - INT32 k053247_opset = K053247ReadRegs(0xc/2); - INT32 wrapsize, xwraplim, ywraplim; - if (k053247_opset & 0x40) - { - wrapsize = 512; - xwraplim = 512 - 64; - ywraplim = 512 - 128; - } - else - { - wrapsize = 1024; - xwraplim = 1024 - 384; - ywraplim = 1024 - 512; - } - - // get "display window" offsets - INT32 offx = (INT16)((K053246Regs[0] << 8) | K053246Regs[1]); - INT32 offy = (INT16)((K053246Regs[2] << 8) | K053246Regs[3]); - - // apply wrapping and global offsets - temp = wrapsize-1; - - ox += K053247_dx; - oy -= K053247_dy; - - ox = ( ox - offx) & temp; - oy = (-oy - offy) & temp; - if (ox >= xwraplim) ox -= wrapsize; - if (oy >= ywraplim) oy -= wrapsize; - - temp = temp4>>8 & 0x0f; - INT32 width = 1 << (temp & 3); - INT32 height = 1 << (temp>>2 & 3); - - ox -= (zoomx * width) >> 13; - oy -= (zoomy * height) >> 13; - - k053247_draw_yxloop_gx( code, - color, - height, width, - zoomx, zoomy, flipx, flipy, - ox, oy, - xa, ya, - mirrorx, mirrory, - nozoom, - pri, - zcode, alpha, drawmode, - gx_objzbuf, gx_shdzbuf, - 0,NULL - ); - } diff --git a/jan/src/burn/drv/konami/k053250.cpp b/jan/src/burn/drv/konami/k053250.cpp deleted file mode 100644 index d01711c32..000000000 --- a/jan/src/burn/drv/konami/k053250.cpp +++ /dev/null @@ -1,490 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert - -#include "tiles_generic.h" -#include "konamiic.h" - -static INT32 global_offx = 0; -static INT32 global_offy = 0; -static INT32 unpacked_size = 0; -static UINT8 *k053250Rom; -static UINT8 *k053250RomExp; - -UINT16 *K053250Ram; -static UINT8 regs[8]; -static INT32 page = 0; - -static UINT16 *buffer[2]; -static INT32 frame = -1; - -#define ORIENTATION_FLIP_X 0x0001 /* mirror everything in the X direction */ -#define ORIENTATION_FLIP_Y 0x0002 /* mirror everything in the Y direction */ -#define ORIENTATION_SWAP_XY 0x0004 /* mirror along the top-left/bottom-right diagonal */ - -void K053250SetOffsets(INT32 , int offx, int offy) -{ - global_offx = offx; - global_offy = offy; -} - -static void unpack_nibbles(INT32 , UINT8 *src, UINT8 *dst, INT32 size) -{ - for(INT32 i=0; i> 4; - dst[2*i+1] = src[i] & 15; - } - - unpacked_size = 2*size; -} - -void K053250Init(INT32 , UINT8 *rom, UINT8 *romexp, INT32 size) -{ - KonamiAllocateBitmaps(); - - K053250Ram = (UINT16*)BurnMalloc(0x6000); - buffer[0] = K053250Ram + 0x2000; - buffer[1] = K053250Ram + 0x2800; - - k053250Rom = rom; - k053250RomExp = romexp; - - unpack_nibbles(0, rom, romexp, size); - - KonamiIC_K053250InUse = 1; -} - -void K053250Reset() -{ - page = 0; - frame = -1; - memset (regs, 0, 8); -} - -void K053250Exit() -{ - BurnFree (K053250Ram); -} - -void K053250Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = K053250Ram; - ba.nLen = 0x6000; - ba.szName = "K053250 Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ba.Data = regs; - ba.nLen = 8; - ba.szName = "K053250 Regs"; - BurnAcb(&ba); - - SCAN_VAR(page); - } -} - -// utility function to render a clipped scanline vertically or horizontally -static inline void pdraw_scanline32(UINT32 *palette, UINT8 *source, int linepos, int scroll, int zoom, UINT32 clipmask, UINT32 wrapmask, UINT32 orientation, UINT8 pri) -{ -// a sixteen-bit fixed point resolution should be adequate to our application -#define FIXPOINT_PRECISION 16 -#define FIXPOINT_PRECISION_HALF (1<<(FIXPOINT_PRECISION-1)) - - int end_pixel, flip, dst_min, dst_max, dst_start, dst_length; - - UINT32 src_wrapmask; - UINT8 *src_base; - int src_fx, src_fdx; - int pix_data, dst_offset; - UINT32 *pal_base; - UINT8 *pri_base = konami_priority_bitmap; - UINT32 *dst_base = konami_bitmap32; - int dst_adv; - - // flip X and flip Y also switch role when the X Y coordinates are swapped - if (!(orientation & ORIENTATION_SWAP_XY)) - { - flip = orientation & ORIENTATION_FLIP_X; - dst_min = 0; //cliprect.min_x; - dst_max = nScreenWidth - 1; //cliprect.max_x; - } - else - { - flip = orientation & ORIENTATION_FLIP_Y; - dst_min = 0; //cliprect.min_y; - dst_max = nScreenHeight - 1; //cliprect.max_y; - } - - if (clipmask) - { - // reject scanlines that are outside of the target bitmap's right(bottom) clip boundary - dst_start = -scroll; - if (dst_start > dst_max) return; - - // calculate target length - dst_length = clipmask + 1; - if (zoom) dst_length = (dst_length << 6) / zoom; - - // reject scanlines that are outside of the target bitmap's left(top) clip boundary - end_pixel = dst_start + dst_length - 1; - if (end_pixel < dst_min) return; - - // clip scanline tail - if ((end_pixel -= dst_max) > 0) dst_length -= end_pixel; - - // reject 0-length scanlines - if (dst_length <= 0) return; - - // calculate zoom factor - src_fdx = zoom << (FIXPOINT_PRECISION-6); - - // clip scanline head - end_pixel = dst_min; - if ((end_pixel -= dst_start) > 0) - { - // chop scanline to the correct length and move target start location to the left(top) clip boundary - dst_length -= end_pixel; - dst_start = dst_min; - - // and skip the source for the left(top) clip region - src_fx = end_pixel * src_fdx + FIXPOINT_PRECISION_HALF; - } - else - // the point five bias is to ensure even distribution of stretched or shrinked pixels - src_fx = FIXPOINT_PRECISION_HALF; - - // adjust flipped source - if (flip) - { - // start from the target's clipped end if the scanline is flipped - dst_start = dst_max + dst_min - dst_start - (dst_length-1); - - // and move source start location to the opposite end - src_fx += (dst_length-1) * src_fdx - 1; - src_fdx = -src_fdx; - } - } - else - { - // draw wrapped scanline at virtual bitmap boundary when source clipping is off - dst_start = dst_min; - dst_length = dst_max - dst_min + 1; // target scanline spans the entire visible area - src_fdx = zoom << (FIXPOINT_PRECISION-6); - - // pre-advance source for the clipped region - if (!flip) - src_fx = (scroll + dst_min) * src_fdx + FIXPOINT_PRECISION_HALF; - else - { - src_fx = (scroll + dst_max) * src_fdx + FIXPOINT_PRECISION_HALF-1; - src_fdx = -src_fdx; - } - } - - if (!(orientation & ORIENTATION_SWAP_XY)) - { - // calculate target increment for horizontal scanlines which is exactly one - dst_adv = 1; - dst_offset = dst_length; - pri_base = konami_priority_bitmap + (linepos * nScreenWidth) + dst_start + dst_offset; //&priority.pix8(linepos, dst_start + dst_offset); - dst_base = konami_bitmap32 + (linepos * nScreenWidth) + dst_start + dst_length; //&bitmap.pix32(linepos, dst_start + dst_length); - } - else - { - // calculate target increment for vertical scanlines which is the bitmap's pitch value - dst_adv = nScreenWidth; - dst_offset= dst_length * dst_adv; - pri_base = konami_priority_bitmap + (dst_start * nScreenWidth) + linepos + dst_offset; //&priority.pix8(dst_start, linepos + dst_offset); - dst_base = konami_bitmap32 + (dst_start * nScreenWidth) + linepos + dst_offset; //&bitmap.pix32(dst_start, linepos + dst_offset); - } - - // generalized - src_base = source; - - // there is no need to wrap source offsets along with source clipping - // so we set all bits of the wrapmask to one - src_wrapmask = (clipmask) ? ~0 : wrapmask; - - pal_base = palette; - dst_offset = -dst_offset; // negate target offset in order to terminated draw loop at 0 condition - - if (pri) - { - // draw scanline and update priority bitmap - do - { - pix_data = src_base[(src_fx>>FIXPOINT_PRECISION) & src_wrapmask]; - src_fx += src_fdx; - - if (pix_data) - { - pix_data = pal_base[pix_data]; - pri_base[dst_offset] = pri; - dst_base[dst_offset] = pix_data; - } - } - while (dst_offset += dst_adv); - } - else - { - // draw scanline but do not update priority bitmap - do - { - pix_data = src_base[(src_fx>>FIXPOINT_PRECISION) & src_wrapmask]; - src_fx += src_fdx; - - if (pix_data) - { - dst_base[dst_offset] = pal_base[pix_data]; - } - } - while (dst_offset += dst_adv); - } - -#undef FIXPOINT_PRECISION -#undef FIXPOINT_PRECISION_HALF -} - -void K053250Draw(INT32 , int colorbase, int /*flags*/, int priority) -{ - UINT8 *pix_ptr; - UINT32 *pal_base, *pal_ptr; - UINT8 *unpacked = k053250RomExp; - UINT32 src_clipmask, src_wrapmask, dst_wrapmask; - int linedata_offs, line_pos, line_start, line_end, scroll_corr; - int color, offset, zoom, scroll, passes, i; - bool wrap500 = false; - - UINT16 *line_ram = buffer[page]; // pointer to physical line RAM - int map_scrollx = short(regs[0] << 8 | regs[1]) - global_offx; // signed horizontal scroll value - int map_scrolly = short(regs[2] << 8 | regs[3]) - global_offy; // signed vertical scroll value - UINT8 ctrl = regs[4]; // register four is the main control register - - // copy visible boundary values to more accessible locations - int dst_minx = 0; //cliprect.min_x; - int dst_maxx = (nScreenWidth - 1); //cliprect.max_x; - int dst_miny = 0; //cliprect.min_y; - int dst_maxy = (nScreenHeight - 1); //cliprect.max_y; - - int orientation = 0; // orientation defaults to no swapping and no flipping - int dst_height = 512; // virtual bitmap height defaults to 512 pixels - int linedata_adv = 4; // line info packets are four words(eight bytes) apart - - // switch X and Y parameters when the first bit of the control register is cleared - if (!(ctrl & 0x01)) orientation |= ORIENTATION_SWAP_XY; - - // invert X parameters when the forth bit of the control register is set - if (ctrl & 0x08) orientation |= ORIENTATION_FLIP_X; - - // invert Y parameters when the fifth bit of the control register is set - if (ctrl & 0x10) orientation |= ORIENTATION_FLIP_Y; - - switch (ctrl >> 5) // the upper four bits of the control register select source and target dimensions - { - case 0 : - // Xexex: L6 galaxies - // Metam: L4 forest, L5 arena, L6 tower interior, final boss - - // crop source offset between 0 and 255 inclusive, - // and set virtual bitmap height to 256 pixels - src_wrapmask = src_clipmask = 0xff; - dst_height = 0x100; - break; - case 1 : - // Xexex: prologue, L7 nebulae - - // the source offset is cropped to 0 and 511 inclusive - src_wrapmask = src_clipmask = 0x1ff; - break; - case 4 : - // Xexex: L1 sky and boss, L3 planet, L5 poly-face, L7 battle ship patches - // Metam: L1 summoning circle, L3 caves, L6 gargoyle towers - - // crop source offset between 0 and 255 inclusive, - // and allow source offset to wrap back at 0x500 to -0x300 - src_wrapmask = src_clipmask = 0xff; - wrap500 = true; - break; -// case 2 : // Xexex: title -// case 7 : // Xexex: L4 organic stage - default: - // crop source offset between 0 and 1023 inclusive, - // keep other dimensions to their defaults - src_wrapmask = src_clipmask = 0x3ff; - break; - } - - // disable source clipping when the third bit of the control register is set - if (ctrl & 0x04) src_clipmask = 0; - - if (!(orientation & ORIENTATION_SWAP_XY)) // normal orientaion with no X Y switching - { - line_start = dst_miny; // the first scanline starts at the minimum Y clip location - line_end = dst_maxy; // the last scanline ends at the maximum Y clip location - scroll_corr = map_scrollx; // concentrate global X scroll - linedata_offs = map_scrolly; // determine where to get info for the first line - - if (orientation & ORIENTATION_FLIP_X) - { - scroll_corr = -scroll_corr; // X scroll adjustment should be negated in X flipped scenarioes - } - - if (orientation & ORIENTATION_FLIP_Y) - { - linedata_adv = -linedata_adv; // traverse line RAM backward in Y flipped scenarioes - linedata_offs += nScreenHeight - 1; // and get info for the first line from the bottom - } - - dst_wrapmask = ~0; // scanlines don't seem to wrap horizontally in normal orientation - passes = 1; // draw scanline in a single pass - } - else // orientaion with X and Y parameters switched - { - line_start = dst_minx; // the first scanline starts at the minimum X clip location - line_end = dst_maxx; // the last scanline ends at the maximum X clip location - scroll_corr = map_scrolly; // concentrate global Y scroll - linedata_offs = map_scrollx; // determine where to get info for the first line - - if (orientation & ORIENTATION_FLIP_Y) - { - scroll_corr = 0x100 - scroll_corr; // apply common vertical correction - - // Y correction (ref: 1st and 5th boss) - scroll_corr -= 2; // apply unique vertical correction - - // X correction (ref: 1st boss, seems to undo non-rotated global X offset) - linedata_offs -= 5; // apply unique horizontal correction - } - - if (orientation & ORIENTATION_FLIP_X) - { - linedata_adv = -linedata_adv; // traverse line RAM backward in X flipped scenarioes - linedata_offs += nScreenWidth - 1; // and get info for the first line from the bottom - } - - if (src_clipmask) - { - // determine target wrap boundary and draw scanline in two passes if the source is clipped - dst_wrapmask = dst_height - 1; - passes = 2; - } - else - { - // otherwise disable target wraparound and draw scanline in a single pass - dst_wrapmask = ~0; - passes = 1; - } - } - - linedata_offs *= 4; // each line info packet has four words(eight bytes) - linedata_offs &= 0x7ff; // and it should wrap at the four-kilobyte boundary - linedata_offs += line_start * linedata_adv; // pre-advance line info offset for the clipped region - - // load physical palette base - pal_base = konami_palette32 + (colorbase << 4); - - // walk the target bitmap within the visible area vertically or horizontally, one line at a time - for (line_pos=line_start; line_pos <= line_end; linedata_offs += linedata_adv, line_pos++) - { - linedata_offs &= 0x7ff; // line info data wraps at the four-kilobyte boundary - - color = line_ram[linedata_offs]; // get scanline color code - if (color == 0xffff) continue; // reject scanline if color code equals minus one - - offset = line_ram[linedata_offs + 1]; // get first pixel offset in ROM - if (!(color & 0xff) && !offset) continue; // reject scanline if both color and pixel offset are 0 - - // calculate physical palette location - // there can be thirty-two color codes and each code represents sixteen pens - pal_ptr = pal_base + ((color & 0x1f) << 4); - - // calculate physical pixel location - // each offset unit represents 256 pixels and should wrap at ROM boundary for safety - pix_ptr = unpacked + ((offset << 8) % unpacked_size); - - // get scanline zoom factor - // For example, 0x20 doubles the length, 0x40 maintains a one-to-one length, - // and 0x80 halves the length. The zoom center is at the beginning of the - // scanline therefore it is not necessary to adjust render start position - zoom = line_ram[linedata_offs + 2]; - - scroll = (short)line_ram[linedata_offs + 3]; // get signed local scroll value for the current scanline - - // scavenged from old code; improves Xexex' first level sky - if (wrap500 && scroll >= 0x500) scroll -= 0x800; - - scroll += scroll_corr; // apply final scroll correction - scroll &= dst_wrapmask; // wraparound scroll value if necessary - - // draw scanlines wrapped at virtual bitmap boundary in two passes - // this should not impose too much overhead due to clipping performed by the render code - i = passes; - do - { - /* - Parameter descriptions: - - bitmap : pointer to a MAME bitmap as the render target - pal_ptr : pointer to the palette's physical location relative to the scanline - pix_ptr : pointer to the physical start location of source pixels in ROM - cliprect : pointer to a rectangle structue which describes the visible area of the target bitmap - line_pos : scanline render position relative to the target bitmap - should be a Y offset to the target bitmap in normal orientaion, - or an X offset to the target bitmap if X,Y are swapped - scroll : source scroll value of the scanline - zoom : source zoom factor of the scanline - src_clipmask : source offset clip mask; source pixels with offsets beyond the scope of this mask will not be drawn - src_wrapmask : source offset wrap mask; wraps source offset around, no effect when src_clipmask is set - orientation : flags indicating whether scanlines should be drawn horizontally, vertically, forward or backward - priority : value to be written to the priority bitmap, no effect when equals 0 - */ - pdraw_scanline32(pal_ptr, pix_ptr,line_pos, scroll, zoom, src_clipmask, src_wrapmask, orientation, (UINT8)priority); - - // shift scanline position one virtual screen upward to render the wrapped end if necessary - scroll -= dst_height; - } - while (--i); - } -} - -static void k053250_dma(INT32 , int limiter) -{ - int current_frame = nCurrentFrame; - - if (limiter && current_frame == frame) - return; // make sure we only do DMA transfer once per frame - - frame = current_frame; - memcpy(buffer[page], K053250Ram, 0x1000); - page ^= 1; -} - -UINT16 K053250RegRead(INT32 , INT32 offset) -{ - return regs[(offset/2)&7]; -} - -void K053250RegWrite(INT32 , INT32 offset, UINT8 data) -{ - if (offset & 1) - { - offset = (offset / 2) & 7; - - // start LVC DMA transfer at the falling edge of control register's bit1 - if (offset == 4 && !(data & 2) && (regs[4] & 2)) - k053250_dma(0,1); - - regs[offset] = data; - } -} - -UINT16 K053250RomRead(INT32 , INT32 offset) -{ - offset = (offset/2)&0xfff; - - return k053250Rom[0x80000 * regs[6] + 0x800 * regs[7] + offset/2]; -} diff --git a/jan/src/burn/drv/konami/k053251.cpp b/jan/src/burn/drv/konami/k053251.cpp deleted file mode 100644 index b57b51c70..000000000 --- a/jan/src/burn/drv/konami/k053251.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Fabio Priuli,Acho A. Tang, R. Belmont - -#include "burnint.h" - -static UINT8 K053251Ram[0x10]; -static INT32 K053251PalIndex[6]; - -void K053251ResetIndexes() -{ - K053251PalIndex[0] = 32 * ((K053251Ram[9] >> 0) & 0x03); - K053251PalIndex[1] = 32 * ((K053251Ram[9] >> 2) & 0x03); - K053251PalIndex[2] = 32 * ((K053251Ram[9] >> 4) & 0x03); - K053251PalIndex[3] = 16 * ((K053251Ram[10] >> 0) & 0x07); - K053251PalIndex[4] = 16 * ((K053251Ram[10] >> 3) & 0x07); -} - -void K053251Reset() -{ - memset (K053251Ram, 0, sizeof(K053251Ram)); - memset (K053251PalIndex, 0, sizeof(K053251PalIndex)); - K053251ResetIndexes(); -} - -void K053251Write(INT32 offset, INT32 data) -{ - data &= 0x3f; - offset &= 0x0f; - - K053251Ram[offset] = data & 0xff; - - if (offset == 9) - { - for (INT32 i = 0; i < 3; i++) { - K053251PalIndex[0+i] = 32 * ((data >> 2*i) & 0x03); - } - } - else if (offset == 10) - { - for (INT32 i = 0; i < 2; i++) { - K053251PalIndex[3+i] = 16 * ((data >> 3*i) & 0x07); - } - } -} - -INT32 K053251GetPriority(INT32 idx) -{ - return K053251Ram[idx & 0x0f]; -} - -INT32 K053251GetPaletteIndex(INT32 idx) -{ - return K053251PalIndex[idx]; -} - -void K053251Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = &K053251Ram; - ba.nLen = sizeof(K053251Ram); - ba.szName = "K053251 Ram"; - BurnAcb(&ba); - - SCAN_VAR(K053251PalIndex[0]); - SCAN_VAR(K053251PalIndex[1]); - SCAN_VAR(K053251PalIndex[2]); - SCAN_VAR(K053251PalIndex[3]); - SCAN_VAR(K053251PalIndex[4]); - - if (nAction & ACB_WRITE) { - K053251ResetIndexes(); - } - } -} diff --git a/jan/src/burn/drv/konami/k053936.cpp b/jan/src/burn/drv/konami/k053936.cpp deleted file mode 100644 index e56bff199..000000000 --- a/jan/src/burn/drv/konami/k053936.cpp +++ /dev/null @@ -1,719 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood - -#include "tiles_generic.h" -#include "konamiic.h" - -#define MAX_K053936 2 - -static INT32 nRamLen[MAX_K053936] = { 0, 0 }; -static INT32 nWidth[MAX_K053936] = { 0, 0 }; -static INT32 nHeight[MAX_K053936] = { 0, 0 }; -static UINT16 *tscreen[MAX_K053936] = { NULL, NULL }; -static UINT8 *ramptr[MAX_K053936] = { NULL, NULL }; -static UINT8 *rambuf[MAX_K053936] = { NULL, NULL }; - -static INT32 K053936Wrap[MAX_K053936] = { 0, 0 }; -static INT32 K053936Offset[MAX_K053936][2] = { { 0, 0 }, { 0, 0 } }; - -static INT32 glfgreat_mode = 0; - -static void (*pTileCallback0)(INT32 offset, UINT16 *ram, INT32 *code, INT32 *color, INT32 *sx, INT32 *sy, INT32 *fx, INT32 *fy); -static void (*pTileCallback1)(INT32 offset, UINT16 *ram, INT32 *code, INT32 *color, INT32 *sx, INT32 *sy, INT32 *fx, INT32 *fy); - -void K053936Reset() -{ - for (INT32 i = 0; i < MAX_K053936; i++) { - if (rambuf[i]) { - memset (rambuf[i], 0xff, nRamLen[i]); - } - } -} - -void K053936Init(INT32 chip, UINT8 *ram, INT32 len, INT32 w, INT32 h, void (*pCallback)(INT32 offset, UINT16 *ram, INT32 *code, INT32 *color, INT32 *sx, INT32 *sy, INT32 *fx, INT32 *fy)) -{ - ramptr[chip] = ram; - - nRamLen[chip] = len; - - if (rambuf[chip] == NULL) { - rambuf[chip] = (UINT8*)BurnMalloc(len); - memset (rambuf[chip], 0xff, len); - } - - nWidth[chip] = w; - nHeight[chip] = h; - - if (tscreen[chip] == NULL) { - tscreen[chip] = (UINT16*)BurnMalloc(w * h * 2); - - for (INT32 i = 0; i < w*h; i++) { - tscreen[chip][i] = 0x8000; - } - } - - if (chip == 0) { - pTileCallback0 = pCallback; - } - if (chip == 1) { - pTileCallback1 = pCallback; - } - - KonamiAllocateBitmaps(); - - KonamiIC_K053936InUse = 1; -} - -void K053936Exit() -{ - for (INT32 i = 0; i < MAX_K053936; i++) { - nRamLen[i] = 0; - nWidth[i] = 0; - nHeight[i] = 0; - BurnFree (tscreen[i]); - ramptr[i] = NULL; - BurnFree (rambuf[i]); - K053936Wrap[i] = 0; - K053936Offset[i][0] = K053936Offset[i][1] = 0; - } - - KonamiIC_K053936InUse = 0; -} - -void K053936PredrawTiles3(INT32 chip, UINT8 *gfx, INT32 tile_size_x, INT32 tile_size_y, INT32 transparent) -{ - UINT16 *ram = (UINT16*)ramptr[chip]; - UINT16 *buf = (UINT16*)rambuf[chip]; - - INT32 tilemap_height = nHeight[chip]; - INT32 tilemap_width = nWidth[chip]; - INT32 tilemap_wide = tilemap_width / tile_size_x; - INT32 tilemap_high = tilemap_height / tile_size_y; - - INT32 xflip = (tile_size_x - 1); - INT32 yflip = (tile_size_y - 1); - - for (INT32 i = 0; i < tilemap_wide * tilemap_high; i++) - { - if (ram[i] != buf[i]) - { - INT32 sx = (i % tilemap_wide) * tile_size_x; - INT32 sy = (i / tilemap_wide) * tile_size_y; - - INT32 flipx = 0; - INT32 flipy = 0; - INT32 code = 0; - INT32 color = 0; - - if (chip==0) - pTileCallback0(i, ram, &code, &color, &sx, &sy, &flipx, &flipy); - else - pTileCallback1(i, ram, &code, &color, &sx, &sy, &flipx, &flipy); - - // draw tile - { - INT32 flip = 0; - if (flipx) flip += xflip; - if (flipy) flip += yflip; - UINT8 *src = gfx + (code * tile_size_x * tile_size_y); - UINT16 *dst = tscreen[chip] + (sy * tilemap_width) + sx; - - for (INT32 y = 0; y < tile_size_y; y++) { - for (INT32 x = 0; x < tile_size_x; x++) { - dst[x] = src[((y*tile_size_x)+x)^flip] + color; - if (src[x] == transparent) dst[x] |= 0x8000; - } - dst += tilemap_width; - } - } - - buf[i] = ram[i]; - } - } -} - -void K053936PredrawTiles2(INT32 chip, UINT8 *gfx) -{ - UINT16 *ram = (UINT16*)ramptr[chip]; - UINT16 *buf = (UINT16*)rambuf[chip]; - - for (INT32 i = 0; i < (nWidth[chip] / 16) * (nHeight[chip] / 16); i++) - { - if (ram[(i*2)+0] != buf[(i*2)+0] || ram[(i*2)+1] != buf[(i*2)+1]) - { - INT32 sx = (i % (nWidth[chip]/16)) * 16; - INT32 sy = i / (nWidth[chip]/16) * 16; - INT32 code = 0; - INT32 color = 0; - INT32 flipx = 0; - INT32 flipy = 0; - - if (chip) { - pTileCallback1(i, ram, &code, &color, &sx, &sy, &flipx, &flipy); - } else { - pTileCallback0(i, ram, &code, &color, &sx, &sy, &flipx, &flipy); - } - - // draw tile - { - INT32 flip = 0; - if (flipx) flip = 0x0f; - if (flipy) flip |= 0xf0; - - UINT8 *src = gfx + (code * 16 * 16); - UINT16 *dst = tscreen[chip] + (sy * nWidth[chip]) + sx; - - for (INT32 y = 0; y < 16; y++) { - for (INT32 x = 0; x < 16; x++) { - INT32 pxl = src[((y << 4) | x) ^ flip]; - if (pxl == 0) pxl |= 0x8000; - dst[x] = (pxl | color); - } - dst += nWidth[chip]; - } - } - } - buf[(i*2)+0] = ram[(i*2)+0]; - buf[(i*2)+1] = ram[(i*2)+1]; - } -} - -void K053936PredrawTiles(INT32 chip, UINT8 *gfx, INT32 transparent, INT32 tcol) -{ - INT32 twidth = nWidth[chip]; - UINT16 *ram = (UINT16*)ramptr[chip]; - UINT16 *buf = (UINT16*)rambuf[chip]; - - for (INT32 i = 0; i < nRamLen[chip] / 2; i++) - { - if (ram[i] != buf[i]) { - INT32 sx = 0; - INT32 sy = 0; - INT32 code = 0; - INT32 color = 0; - INT32 fx = 0; - INT32 fy = 0; - - if (chip) { - pTileCallback1(i, ram, &code, &color, &sx, &sy, &fx, &fy); - } else { - pTileCallback0(i, ram, &code, &color, &sx, &sy, &fx, &fy); - } - - if (code == -1) continue; - - // draw tile - { - if (fy) fy = 0xf0; - if (fx) fy |= 0x0f; - - UINT8 *src = gfx + (code * 16 * 16); - UINT16 *sdst = tscreen[chip] + (sy * twidth) + sx; - - for (INT32 y = 0; y < 16; y++) { - for (INT32 x = 0; x < 16; x++) { - INT32 pxl = src[((y << 4) | x) ^ fy]; - if (transparent) { - if (pxl == tcol) pxl |= 0x8000; - } - - sdst[x] = pxl | color; - } - sdst += twidth; - } - } - } - buf[i] = ram[i]; - } -} - -static inline void copy_roz(INT32 chip, INT32 minx, INT32 maxx, INT32 miny, INT32 maxy, UINT32 startx, UINT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, INT32 transp, INT32 priority) -{ - if (incxx == (1 << 16) && incxy == 0 && incyx == 0 && incyy == (1 << 16) && K053936Wrap[chip]) - { - INT32 scrollx = startx >> 16; - INT32 scrolly = starty >> 16; - - for (INT32 sy = 0; sy < nScreenHeight; sy++) { - UINT8 *pri = konami_priority_bitmap + (sy * nScreenWidth); - UINT16 *src = tscreen[chip] + (((scrolly + sy) % nHeight[chip]) * nWidth[chip]); - UINT32 *dst = konami_bitmap32 + (sy * nScreenWidth); - - for (INT32 sx = 0; sx < nScreenWidth; sx++) { - INT32 pxl = src[(scrollx+sx)%nWidth[chip]]; - if ((pxl & 0x8000)!=0 && transp) continue; - - dst[sx] = konami_palette32[pxl & 0x7fff]; - pri[sx] = priority; - } - } - return; - } - - UINT8 *pri = konami_priority_bitmap; - UINT32 *dst = konami_bitmap32; - UINT32 *pal = konami_palette32; - UINT16 *src = tscreen[chip]; - - INT32 width = nWidth[chip]; - INT32 hmask = nHeight[chip] - 1; - INT32 wmask = nWidth[chip] - 1; - - INT32 wrap = K053936Wrap[chip]; - - for (INT32 sy = miny; sy < maxy; sy++, startx+=incyx, starty+=incyy) - { - UINT32 cx = startx; - UINT32 cy = starty; - - if (transp) { - if (wrap) { - for (INT32 x = minx; x < maxx; x++, cx+=incxx, cy+=incxy, dst++, pri++) - { - INT32 pxl = src[(((cy >> 16) & hmask) * width) + ((cx >> 16) & wmask)]; - - if (!(pxl & 0x8000)) { - *dst = pal[pxl]; - *pri = priority; - } - } - } else { - for (INT32 x = minx; x < maxx; x++, cx+=incxx, cy+=incxy, dst++, pri++) - { - INT32 yy = cy >> 16; - if (yy > hmask || yy < 0) continue; - INT32 xx = cx >> 16; - if (xx > wmask || xx < 0) continue; - - INT32 pxl = src[(yy * width) + xx]; - - if (!(pxl & 0x8000)) { - *dst = pal[pxl]; - *pri = priority; - } - } - } - } else { - if (wrap) { - for (INT32 x = minx; x < maxx; x++, cx+=incxx, cy+=incxy, dst++, pri++) { - *dst = pal[src[(((cy >> 16) & hmask) * width) + ((cx >> 16) & wmask)] & 0x7fff]; - *pri = priority; - } - } else { - for (INT32 x = minx; x < maxx; x++, cx+=incxx, cy+=incxy, dst++, pri++) { - INT32 yy = cy >> 16; - if (yy > hmask || yy < 0) continue; - INT32 xx = cx >> 16; - if (xx > wmask || xx < 0) continue; - - *dst = pal[src[(yy * width) + xx] & 0x7fff]; - *pri = priority; - } - } - } - } -} - -void K053936Draw(INT32 chip, UINT16 *ctrl, UINT16 *linectrl, INT32 flags) -{ - INT32 transp = flags & 0xff; - INT32 priority = (flags >> 8) & 0xff; - - if (ctrl[0x07] & 0x0040 && linectrl) // Super! - { - UINT32 startx,starty; - INT32 incxx,incxy; - - INT32 minx, maxx, maxy, miny, y; - - if ((ctrl[0x07] & 0x0002) && ctrl[0x09] && glfgreat_mode) // glfgreat - { - minx = ctrl[0x08] + K053936Offset[chip][0]+2; - maxx = ctrl[0x09] + K053936Offset[chip][0]+2 - 1; - if (minx < 0) minx = 0; - if (maxx > nScreenWidth) maxx = nScreenWidth; - - y = ctrl[0x0a] + K053936Offset[chip][1]-2; - if (y < 0) y = 0; - maxy = ctrl[0x0b] + K053936Offset[chip][1]-2 - 1; - if (maxy > nScreenHeight) maxy = nScreenHeight; - } - else - { - minx = 0; - maxx = nScreenWidth; - - y = 0; - maxy = nScreenHeight; - } - - while (y <= maxy) - { - UINT16 *lineaddr = linectrl + 4*((y - K053936Offset[chip][1]) & 0x1ff); - miny = maxy = y; - - startx = 256 * (INT16)(lineaddr[0] + ctrl[0x00]); - starty = 256 * (INT16)(lineaddr[1] + ctrl[0x01]); - incxx = (INT16)(lineaddr[2]); - incxy = (INT16)(lineaddr[3]); - - if (ctrl[0x06] & 0x8000) incxx *= 256; - if (ctrl[0x06] & 0x0080) incxy *= 256; - - startx -= K053936Offset[chip][0] * incxx; - starty -= K053936Offset[chip][0] * incxy; - - copy_roz(chip, minx, maxx, miny, maxy, startx << 5, starty << 5, incxx << 5, incxy << 5, 0, 0, transp, priority); - - y++; - } - } - else // simple - { - UINT32 startx, starty; - INT32 incxx, incxy, incyx, incyy; - - startx = 256 * (INT16)(ctrl[0x00]); - starty = 256 * (INT16)(ctrl[0x01]); - incyx = (INT16)(ctrl[0x02]); - incyy = (INT16)(ctrl[0x03]); - incxx = (INT16)(ctrl[0x04]); - incxy = (INT16)(ctrl[0x05]); - - if (ctrl[0x06] & 0x4000) - { - incyx *= 256; - incyy *= 256; - } - - if (ctrl[0x06] & 0x0040) - { - incxx *= 256; - incxy *= 256; - } - - startx -= K053936Offset[chip][1] * incyx; - starty -= K053936Offset[chip][1] * incyy; - - startx -= K053936Offset[chip][0] * incxx; - starty -= K053936Offset[chip][0] * incxy; - - copy_roz(chip, 0, nScreenWidth, 0, nScreenHeight, startx << 5, starty << 5, incxx << 5, incxy << 5, incyx << 5, incyy << 5, transp, priority); - } -} - -void K053936EnableWrap(INT32 chip, INT32 status) -{ - K053936Wrap[chip] = status; -} - -void K053936SetOffset(INT32 chip, INT32 xoffs, INT32 yoffs) -{ - K053936Offset[chip][0] = xoffs; - K053936Offset[chip][1] = yoffs; -} - -void K053936Scan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(K053936Wrap[0]); - SCAN_VAR(K053936Wrap[1]); - } -} - - -// this is not safe to hook up to any other driver than mystwarr!!!!!!!! - -static INT32 K053936_clip_enabled[2]; -static INT32 K053936_cliprect[2][4]; -static INT32 K053936_offset[2][2]; -static INT32 K053936_enable[2] = { 0, 0 }; -static INT32 K053936_color[2] = { 0, 0 }; -UINT16 *m_k053936_0_ctrl_16 = NULL; -UINT16 *m_k053936_0_linectrl_16 = NULL; -UINT16 *m_k053936_0_ctrl = NULL; -UINT16 *m_k053936_0_linectrl = NULL; -UINT16 *K053936_external_bitmap = NULL; - -void K053936GpInit() -{ - -} - -void K053936GPExit() -{ - K053936_clip_enabled[0] = K053936_clip_enabled[1] = 0; - K053936_enable[0] = K053936_enable[1] = 0; - K053936_color[0] = K053936_color[1] = 0; - memset(K053936_cliprect,0,sizeof(K053936_cliprect)); //2*4*sizeof(INT32)); - memset(K053936_offset,0,sizeof(K053936_offset)); //2*2*sizeof(INT32)); - m_k053936_0_ctrl_16 = NULL; - m_k053936_0_linectrl_16 = NULL; - m_k053936_0_ctrl = NULL; - m_k053936_0_linectrl = NULL; - K053936_external_bitmap = NULL; -} - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s, UINT32 p) -{ - if (p == 0) return d; - - INT32 a = 256 - p; - - return (((((s & 0xff00ff) * p) + ((d & 0xff00ff) * a)) & 0xff00ff00) | - ((((s & 0x00ff00) * p) + ((d & 0x00ff00) * a)) & 0x00ff0000)) >> 8; -} - -void K053936GP_set_colorbase(INT32 chip, INT32 color_base) -{ - K053936_color[chip] = color_base; -} - -void K053936GP_enable(INT32 chip, INT32 enable) -{ - K053936_enable[chip] = enable; -} - -void K053936GP_set_offset(INT32 chip, INT32 xoffs, INT32 yoffs) { K053936_offset[chip][0] = xoffs; K053936_offset[chip][1] = yoffs; } - -void K053936GP_clip_enable(INT32 chip, INT32 status) { K053936_clip_enabled[chip] = status; } - -void K053936GP_set_cliprect(INT32 chip, INT32 minx, INT32 maxx, INT32 miny, INT32 maxy) -{ - K053936_cliprect[chip][0] = minx; - K053936_cliprect[chip][1] = maxx; - K053936_cliprect[chip][2] = miny; - K053936_cliprect[chip][3] = maxy; -} - -static inline void K053936GP_copyroz32clip(INT32 chip, UINT16 *src_bitmap, INT32 *my_clip, UINT32 _startx,UINT32 _starty,INT32 _incxx,INT32 _incxy,INT32 _incyx,INT32 _incyy, - INT32 tilebpp, INT32 blend, INT32 alpha, INT32 clip, INT32 pixeldouble_output) -{ - static const INT32 colormask[8]={1,3,7,0xf,0x1f,0x3f,0x7f,0xff}; - INT32 cy, cx; - INT32 ecx; - INT32 src_pitch, incxy, incxx; - INT32 src_minx, src_maxx, src_miny, src_maxy, cmask; - UINT16 *src_base; - INT32 src_size; - - const UINT32 *pal_base; - INT32 dst_ptr; - INT32 dst_size; - INT32 dst_base2; - - INT32 tx, dst_pitch; - UINT32 *dst_base; - INT32 starty, incyy, startx, incyx, ty, sx, sy; - - incxy = _incxy; incxx = _incxx; incyy = _incyy; incyx = _incyx; - starty = _starty; startx = _startx; - - INT32 color_base = K053936_color[chip]; - - if (clip) // set source clip range to some extreme values when disabled - { - src_minx = K053936_cliprect[chip][0]; - src_maxx = K053936_cliprect[chip][1]; - src_miny = K053936_cliprect[chip][2]; - src_maxy = K053936_cliprect[chip][3]; - } - // this simply isn't safe to do! - else { src_minx = src_miny = -0x10000; src_maxx = src_maxy = 0x10000; } - - // set target clip range - sx = my_clip[0]; - tx = my_clip[1] - sx + 1; - sy = my_clip[2]; - ty = my_clip[3] - sy + 1; - - startx += sx * incxx + sy * incyx; - starty += sx * incxy + sy * incyy; - - // adjust entry points and other loop constants - dst_pitch = nScreenWidth; - dst_base = konami_bitmap32; - dst_base2 = sy * dst_pitch + sx + tx; - ecx = tx = -tx; - - tilebpp = (tilebpp-1) & 7; - pal_base = konami_palette32; - cmask = colormask[tilebpp]; - - src_pitch = 0x2000; - src_base = src_bitmap; - src_size = 0x2000 * 0x2000; - dst_size = nScreenWidth * nScreenHeight; - dst_ptr = 0;//dst_base; - cy = starty; - cx = startx; - - if (blend > 0) - { - dst_ptr += dst_pitch; // draw blended - starty += incyy; - startx += incyx; - - do { - do { - INT32 srcx = (cx >> 16) & 0x1fff; - INT32 srcy = (cy >> 16) & 0x1fff; - INT32 pixel; - INT32 offs; - offs = srcy * src_pitch + srcx; - - cx += incxx; - cy += incxy; - - if (offs>=src_size||offs<0) - continue; - - if (srcx < src_minx || srcx > src_maxx || srcy < src_miny || srcy > src_maxy) - continue; - - pixel = src_base[offs]|color_base; - if (!(pixel & cmask)) - continue; -// this one below is borked. - if ((dst_ptr+ecx+dst_base2)> 16) & 0x1fff; - INT32 srcy = (cy >> 16) & 0x1fff; - INT32 pixel; - INT32 offs; - - offs = srcy * src_pitch + srcx; - - cx += incxx; - cy += incxy; - - if (offs>=src_size||offs<0) - continue; - - if (srcx < src_minx || srcx > src_maxx || srcy < src_miny || srcy > src_maxy) - continue; - - pixel = src_base[offs]|color_base; - if (!(pixel & cmask)) - continue; - - if ((dst_ptr+ecx+dst_base2)= 0x100) - d -= 0x200; - m_shd_rgb[i] = d; - } -} - -void K054338_export_config(INT32 **shd_rgb) -{ - *shd_rgb = m_shd_rgb; -} - -// k054338 BG color fill -void K054338_fill_solid_bg() -{ - UINT32 bgcolor; - UINT32 *pLine; - INT32 x, y; - - bgcolor = (K054338_read_register(K338_REG_BGC_R)&0xff)<<16; - bgcolor |= K054338_read_register(K338_REG_BGC_GB); - - /* and fill the screen with it */ - for (y = 0; y < nScreenHeight; y++) - { - pLine = konami_bitmap32; - pLine += (nScreenWidth*y); - for (x = 0; x < nScreenWidth; x++) - *pLine++ = bgcolor; - } -} - -// Unified k054338/K055555 BG color fill -void K054338_fill_backcolor(INT32 palette_offset, INT32 mode) // (see p.67) -{ - INT32 clipx, clipy, clipw, cliph, i, dst_pitch; - INT32 BGC_CBLK, BGC_SET; - UINT32 *dst_ptr, *pal_ptr; - INT32 bgcolor; - - clipx = 0 & ~3; - clipy = 0; - clipw = ((nScreenWidth - 1) + 4) & ~3; - cliph = (nScreenHeight-1) + 1; - - dst_ptr = konami_bitmap32 + palette_offset; - dst_pitch = nScreenWidth; - dst_ptr += 0; - - BGC_SET = 0; - pal_ptr = konami_palette32; - - if (!mode) - { - // single color output from CLTC - bgcolor = (int)(k54338_regs[K338_REG_BGC_R]&0xff)<<16 | (int)k54338_regs[K338_REG_BGC_GB]; - } - else - { - BGC_CBLK = K055555ReadRegister(0); - BGC_SET = K055555ReadRegister(1); - pal_ptr += BGC_CBLK << 9; - - // single color output from PCU2 - if (!(BGC_SET & 2)) { bgcolor = *pal_ptr; mode = 0; } else bgcolor = 0; - } - - if (!mode) - { - // single color fill - dst_ptr += clipw; - i = clipw = -clipw; - do - { - do { dst_ptr[i] = dst_ptr[i+1] = dst_ptr[i+2] = dst_ptr[i+3] = bgcolor; } while (i += 4); - dst_ptr += dst_pitch; - i = clipw; - } - while (--cliph); - } - else - { - if (!(BGC_SET & 1)) - { - // vertical gradient fill - pal_ptr += clipy; - dst_ptr += clipw; - bgcolor = *pal_ptr++; - i = clipw = -clipw; - do - { - do { dst_ptr[i] = dst_ptr[i+1] = dst_ptr[i+2] = dst_ptr[i+3] = bgcolor; } while (i += 4); - dst_ptr += dst_pitch; - bgcolor = *pal_ptr++; - i = clipw; - } - while (--cliph); - } - else - { - // horizontal gradient fill - pal_ptr += clipx; - clipw <<= 2; - do - { - memcpy(dst_ptr, pal_ptr, clipw); - dst_ptr += dst_pitch; - } - while (--cliph); - } - } -} - -// addition blending unimplemented (requires major changes to drawgfx and tilemap.c) -INT32 K054338_set_alpha_level(INT32 pblend) -{ - UINT16 *regs; - INT32 ctrl, mixpri, mixset, mixlv; - - if (pblend <= 0 || pblend > 3) - { - // alpha_set_level(255); - return(255); - } - - regs = k54338_regs; - ctrl = k54338_regs[K338_REG_CONTROL]; - mixpri = ctrl & K338_CTL_MIXPRI; - mixset = regs[K338_REG_PBLEND + (pblend>>1 & 1)] >> (~pblend<<3 & 8); - mixlv = mixset & 0x1f; - - if (k054338_alphainverted) mixlv = 0x1f - mixlv; - - if (!(mixset & 0x20)) - { - mixlv = mixlv<<3 | mixlv>>2; - // alpha_set_level(mixlv); // source x alpha/255 + target x (255-alpha)/255 - } - else - { - if (!mixpri) - { - // source x alpha + target (clipped at 255) - } - else - { - // source + target x alpha (clipped at 255) - } - - // DUMMY - if (mixlv && mixlv<0x1f) mixlv = 0x10; - mixlv = mixlv<<3 | mixlv>>2; - // alpha_set_level(mixlv); - } - - return(mixlv); -} - -void K054338_invert_alpha(INT32 invert) -{ - k054338_alphainverted = invert; -} diff --git a/jan/src/burn/drv/konami/k055555.cpp b/jan/src/burn/drv/konami/k055555.cpp deleted file mode 100644 index 2023026c3..000000000 --- a/jan/src/burn/drv/konami/k055555.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// 055555 - -// license:BSD-3-Clause -// copyright-holders:David Haywood - -#include "burnint.h" -#include "konamiic.h" - -static UINT8 m_regs[128]; -INT32 K055555_enabled = 0; - -void K055555WriteReg(UINT8 regnum, UINT8 regdat) -{ - m_regs[regnum & 0x7f] = regdat; -} - -#if 0 -void K055555LongWrite(INT32 offset, UINT32 data) -{ - UINT8 regnum, regdat; - - if (ACCESSING_BITS_24_31) - { - regnum = offset<<1; - regdat = data>>24; - } - else - { - if (ACCESSING_BITS_8_15) - { - regnum = (offset<<1)+1; - regdat = data>>8; - } - else - { - return; - } - } - k055555_write_reg(regnum, regdat); -} -#endif - -void K055555WordWrite(INT32 offset, UINT16 data) -{ - K055555WriteReg((offset / 2) & 0x7f, data&0xff); -} - -void K055555ByteWrite(INT32 offset, UINT8 data) -{ - K055555WriteReg((offset / 2) & 0x7f, data&0xff); -} - -INT32 K055555ReadRegister(INT32 regnum) -{ - return m_regs[regnum & 0x7f]; -} - -INT32 K055555GetPaletteIndex(INT32 idx) -{ - return m_regs[(K55_PALBASE_A + idx) & 0x7f]; -} - -void K055555Reset() -{ - memset(m_regs, 0, 128 * sizeof(UINT8)); -} - -void K055555Init() -{ - K055555_enabled = 1; - KonamiIC_K055555InUse = 1; -} - -void K055555Exit() -{ - K055555_enabled = 0; -} - -void K055555Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - ba.Data = m_regs; - ba.nLen = 128; - ba.szName = "K055555 Regs"; - BurnAcb(&ba); - } -} diff --git a/jan/src/burn/drv/konami/k056832.cpp b/jan/src/burn/drv/konami/k056832.cpp deleted file mode 100644 index fbe00ba2e..000000000 --- a/jan/src/burn/drv/konami/k056832.cpp +++ /dev/null @@ -1,967 +0,0 @@ -// Based on MAME sources by David Haywood - -#include "tiles_generic.h" -#include "konamiic.h" - -#define K056832_FLIPY 0x00002 -#define K056832_FLIPX 0x00001 - -static UINT16 k056832Regs[0x20]; -static UINT16 k056832Regsb[0x20]; -static UINT16 *K056832VideoRAM; - -static UINT8 *K056832Rom; -static UINT8 *K056832RomExp; -static UINT8 *K056832TransTab; - -static INT32 K056832RomExpMask; - -static INT32 m_layer_offs[8][2]; -static INT32 global_clip[4]; - -static INT32 m_use_ext_linescroll; -static INT32 m_layer_association; -static INT32 m_active_layer; -static INT32 m_layer_assoc_with_page[16]; -static INT32 m_selected_page; -static INT32 m_selected_page_x4096; -static INT32 m_lsram_page[8][2]; -static INT32 m_default_layer_association; -static INT32 m_uses_tile_banks; -static INT32 m_cur_tile_bank; -static INT32 m_layer_tile_mode[8]; -static INT32 m_page_tile_mode[16]; -static INT32 m_num_gfx_banks; -static INT32 m_cur_gfx_banks; -static INT32 tilemap_flip; -static INT32 m_rom_half; -static INT32 K056832_metamorphic_textfix = 0; - -#define CLIP_MINX global_clip[0] -#define CLIP_MAXX global_clip[1] -#define CLIP_MINY global_clip[2] -#define CLIP_MAXY global_clip[3] - -static void (*m_callback)(INT32 layer, INT32 *code, INT32 *color, INT32 *flags); - -void K056832Reset() -{ - memset (K056832VideoRAM, 0, 0x2000 * 0x11 * 2); - - for (INT32 i = 0; i < 0x20; i++) { - k056832Regs[i] = 0; - k056832Regsb[i] = 0; - } - - m_cur_gfx_banks = 0; - m_uses_tile_banks = 0; - m_cur_tile_bank = 0; - m_active_layer = 0; - tilemap_flip = 0; - m_rom_half = 0; - m_selected_page = 0; - m_selected_page_x4096 = 0; -} - -static void CalculateTranstab() -{ - INT32 explen = (K056832RomExpMask + 1); - - K056832TransTab = (UINT8*)BurnMalloc(explen); - - memset (K056832TransTab, 1, explen); - - for (INT32 i = 0; i < explen*0x40; i+= 0x40) { - for (INT32 j = 0; j < 0x40; j++) { - if (K056832RomExp[i+j]) { - K056832TransTab[i/0x40] = 0; - break; - } - } - } -} - -void K056832Init(UINT8 *rom, UINT8 *romexp, INT32 rom_size, void (*cb)(INT32 layer, INT32 *code, INT32 *color, INT32 *flags)) -{ - KonamiIC_K056832InUse = 1; - - for (INT32 i = 0; i < 8; i++) { - m_layer_offs[i][0] = m_layer_offs[i][1] = 0; - m_lsram_page[i][0] = i; - m_lsram_page[i][1] = i << 11; - m_layer_tile_mode[i] = 1; - } - - for (INT32 i = 0; i < 16; i++) { - m_page_tile_mode[i] = 1; - } - - K056832SetGlobalOffsets(0, 0); - - KonamiAllocateBitmaps(); - - m_callback = cb; - - K056832Rom = rom; - K056832RomExp = romexp; - K056832RomExpMask = ((rom_size * 2) / 0x40) - 1; - m_num_gfx_banks = rom_size / 0x2000; - - CalculateTranstab(); - - m_use_ext_linescroll = 0; // enable later, no reset. - m_default_layer_association = 1; - m_layer_association = m_default_layer_association; - - K056832VideoRAM = (UINT16*)BurnMalloc(0x2000 * 0x11 * 2); - - K056832Reset(); -} - -void K056832Exit() -{ - BurnFree (K056832VideoRAM); - BurnFree (K056832TransTab); - - K056832_metamorphic_textfix = 0; - - m_callback = NULL; -} - -void K056832SetLayerAssociation(INT32 status) -{ - m_layer_association = m_default_layer_association = status; -} - -void K056832SetGlobalOffsets(INT32 minx, INT32 miny) -{ - CLIP_MINX = (minx < 0) ? 0 : minx; - CLIP_MAXX = CLIP_MINX + nScreenWidth; - CLIP_MINY = (miny < 0) ? 0 : miny; - CLIP_MAXY = CLIP_MINY + nScreenHeight; -} - -void K056832SetLayerOffsets(INT32 layer, INT32 xoffs, INT32 yoffs) -{ - m_layer_offs[layer & 3][0] = xoffs; - m_layer_offs[layer & 3][1] = yoffs; -} - -void K056832SetExtLinescroll() -{ - m_use_ext_linescroll = 1; -} - -INT32 K056832IsIrqEnabled() -{ - return k056832Regs[3] & 1; -} - -void K056832ReadAvac(INT32 *mode, INT32 *data) -{ - *mode = k056832Regs[0x04/2] & 7; - *data = k056832Regs[0x38/2]; -} - -UINT16 K056832ReadRegister(INT32 reg) -{ - return k056832Regs[reg & 0x1f]; -} - -INT32 K056832GetLookup( INT32 bits ) -{ - INT32 res; - - res = (k056832Regs[0x1c] >> (bits << 2)) & 0x0f; - - if (m_uses_tile_banks) /* Asterix */ - res |= m_cur_tile_bank << 4; - - return res; -} - -static void mark_all_tilemaps_dirty() -{ // this sets the page/layer associations. - for (INT32 i = 0; i < 16; i++) - { - if (m_layer_assoc_with_page[i] != -1) - { - m_page_tile_mode[i] = m_layer_tile_mode[m_layer_assoc_with_page[i]]; - } - } -} - -static void k056832_change_rambank() -{ - INT32 bank = k056832Regs[0x19]; - - if (k056832Regs[0] & 0x02) // external linescroll enable - m_selected_page = 16; - else - m_selected_page = ((bank >> 1) & 0xc) | (bank & 3); - - m_selected_page_x4096 = m_selected_page << 12; - - mark_all_tilemaps_dirty(); -} - -#if 0 -static INT32 k056832_get_current_rambank() -{ - INT32 bank = k056832Regs[0x19]; - - return ((bank >> 1) & 0xc) | (bank & 3); -} -#endif - -static void k056832_change_rombank() -{ - INT32 bank; - - if (m_uses_tile_banks) /* Asterix */ - bank = (k056832Regs[0x1a] >> 8) | (k056832Regs[0x1b] << 4) | (m_cur_tile_bank << 6); - else - bank = k056832Regs[0x1a] | (k056832Regs[0x1b] << 16); - - m_cur_gfx_banks = bank % m_num_gfx_banks; -} - -void K056832SetTileBank(INT32 bank) -{ - m_uses_tile_banks = 1; - - m_cur_tile_bank = bank; - - k056832_change_rombank(); -} - -static void k056832_update_page_layout() -{ - m_layer_association = m_default_layer_association; - - INT32 m_y[4] = { 0, 0, 0, 0 }; // not sure why initializing these is necessary - INT32 m_x[4] = { 0, 0, 0, 0 }; // as they should be all set below, but it causes - INT32 m_h[4] = { 0, 0, 0, 0 }; // a hang in monster maulers otherswise. -iq - INT32 m_w[4] = { 0, 0, 0, 0 }; - - for (INT32 layer = 0; layer < 4; layer++) - { - m_y[layer] = (k056832Regs[0x08|layer] & 0x18) >> 3; - m_x[layer] = (k056832Regs[0x0c|layer] & 0x18) >> 3; - m_h[layer] = (k056832Regs[0x08|layer] & 0x03) >> 0; - m_w[layer] = (k056832Regs[0x0c|layer] & 0x03) >> 0; - - if (!m_y[layer] && !m_x[layer] && m_h[layer] == 3 && m_w[layer] == 3) - { - m_layer_association = 0; - break; - } - } - - // disable all tilemaps - for (INT32 page_idx = 0; page_idx < 16; page_idx++) - { - m_layer_assoc_with_page[page_idx] = -1; - } - - // enable associated tilemaps - for (INT32 layer = 0; layer < 4; layer++) - { - INT32 rowstart = m_y[layer]; - INT32 colstart = m_x[layer]; - INT32 rowspan = m_h[layer] + 1; - INT32 colspan = m_w[layer] + 1; - - INT32 setlayer = (m_layer_association) ? layer : m_active_layer; - - for (INT32 r = 0; r < rowspan; r++) - { - for (INT32 c = 0; c < colspan; c++) - { - INT32 page_idx = (((rowstart + r) & 3) << 2) + ((colstart + c) & 3); - if (m_layer_assoc_with_page[page_idx] == -1) - m_layer_assoc_with_page[page_idx] = setlayer; - } - } - } - - mark_all_tilemaps_dirty(); -} - -static void k056832_word_write_update(INT32 offset) // (offset/2)&0x1f internally -{ - offset = (offset / 2) & 0x1f; - - UINT16 data = k056832Regs[offset]; - - if (offset >= 0x10/2 && offset <= 0x1e/2) - { - m_active_layer = offset & 3; - k056832_update_page_layout(); - return; - } - - switch (offset) - { - case 0x00/2: - tilemap_flip = 0; - if (data & 0x20) tilemap_flip |= K056832_FLIPY; - if (data & 0x10) tilemap_flip |= K056832_FLIPX; - k056832_change_rambank(); - break; - - case 0x08/2: - for (INT32 layer = 0; layer < 4; layer++) { - m_layer_tile_mode[layer] = data & (1 << layer); - - INT32 tilemode = m_layer_tile_mode[layer]; - - for (INT32 i = 0; i < 16; i++) - { - if (m_layer_assoc_with_page[i] == layer) - { - m_page_tile_mode[i] = tilemode; - //mark_page_dirty(i); - } - } - } - break; - - case 0x32/2: - k056832_change_rambank(); - break; - - case 0x34/2: - case 0x36/2: - k056832_change_rombank(); - break; - } -} - -void K056832WordWrite(INT32 offset, UINT16 data) -{ - k056832Regs[(offset / 2) & 0x1f] = data; - k056832_word_write_update(offset); -} - -void K056832ByteWrite(INT32 offset, UINT8 data) -{ - UINT8 *regs = (UINT8*)&k056832Regs; - regs[(offset & 0x3f) ^ 1] = data; - - k056832_word_write_update(offset); -} - -UINT16 K056832RomWordRead(UINT16 offset) -{ - offset &= 0x1ffe; - - INT32 addr = 0x2000 * m_cur_gfx_banks + offset; - - return K056832Rom[addr+1] | (K056832Rom[addr] << 8); -} - -void K056832HalfRamWriteWord(UINT32 offset, UINT16 data) -{ - K056832VideoRAM[m_selected_page_x4096 + (offset & 0xffe) + 1] = data; -} - -void K056832HalfRamWriteByte(UINT32 offset, UINT8 data) -{ - UINT8 *ram = (UINT8*)(K056832VideoRAM + (m_selected_page_x4096 + (offset & 0xffe) + 1)); - - ram[(offset & 1) ^ 1] = data; -} - -UINT16 K056832HalfRamReadWord(UINT32 offset) -{ - return K056832VideoRAM[m_selected_page_x4096 + (offset & 0xffe) + (((offset >> 12) ^ 1) & 1)]; -} - -UINT8 K056832HalfRamReadByte(UINT32 offset) -{ - UINT8 *ram = (UINT8*)(K056832VideoRAM + m_selected_page_x4096 + ((offset & 0xffe) + (((offset >> 12) ^ 1) & 1))); - return ram[(offset & 1) ^ 1]; -} - -void K056832RamWriteWord(UINT32 offset, UINT16 data) -{ - offset = (offset & 0x1fff) / 2; - - K056832VideoRAM[m_selected_page_x4096 + (offset)] = data; -} - -void K056832RamWriteByte(UINT32 offset, UINT8 data) -{ - UINT8 *ram = (UINT8*)(K056832VideoRAM + m_selected_page_x4096); - - ram[(offset & 0x1fff) ^ 1] = data; -} - -UINT16 K056832RamReadWord(UINT32 offset) -{ - return K056832VideoRAM[m_selected_page_x4096 + ((offset & 0x1fff) / 2)]; -} - -UINT8 K056832RamReadByte(UINT32 offset) -{ - UINT8 *ram = (UINT8*)(K056832VideoRAM + m_selected_page_x4096); - - m_rom_half = 0; - - return ram[(offset & 0x1fff) ^ 1]; -} - -UINT16 K056832RomWord8000Read(INT32 offset) -{ - int addr = 0x8000 * m_cur_gfx_banks + (offset & 0x7ffe); - - return K056832Rom[addr + 2] | (K056832Rom[addr] << 8); -} - -void K056832WritebRegsWord(INT32 offset, UINT16 data) -{ - k056832Regsb[(offset & 0x1f)/2] = data; -} - -void K056832WritebRegsByte(INT32 offset, UINT8 data) -{ - UINT8 *regs = (UINT8*)&k056832Regsb; - - regs[(offset & 0x1f)^1] = data; -} - -UINT16 K056832mwRomWordRead(INT32 address) -{ - INT32 offset = (address / 2) & 0x1fff; - INT32 bank = (0x800 * m_cur_gfx_banks) * 5; - - if (k056832Regsb[0x02] & 0x08) - { - UINT16 temp = K056832Rom[((offset / 4) * 5) + 4 + bank]; - - switch (offset & 3) - { - case 0: return ((temp & 0x80) << 5) | ((temp & 0x40) >> 2); - case 1: return ((temp & 0x20) << 7) | ((temp & 0x10) >> 0); - case 2: return ((temp & 0x08) << 9) | ((temp & 0x04) << 2); - case 3: return ((temp & 0x02) << 11) | ((temp & 0x01) << 4); - } - } - else - { - INT32 addr = ((offset >> 1) * 5) + ((offset & 1) * 2) + bank; - - return K056832Rom[addr + 1] | (K056832Rom[addr] << 8); - } - - return 0; -} - - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s, UINT32 p) -{ - if (p == 0) return d; - - INT32 a = 256 - p; - - return (((((s & 0xff00ff) * p) + ((d & 0xff00ff) * a)) & 0xff00ff00) | - ((((s & 0x00ff00) * p) + ((d & 0x00ff00) * a)) & 0x00ff0000)) >> 8; -} - -static void draw_layer_internal(INT32 layer, INT32 pageIndex, INT32 *clip, INT32 scrollx, INT32 scrolly, INT32 flags, INT32 priority) -{ - static const struct K056832_SHIFTMASKS - { - INT32 flips, palm1, pals2, palm2; - } - k056832_shiftmasks[4] = {{6, 0x3f, 0, 0x00}, {4, 0x0f, 2, 0x30}, {2, 0x03, 2, 0x3c}, {0, 0x00, 2, 0x3f}}; - const struct K056832_SHIFTMASKS *smptr; - - scrollx &= 0x1ff; - scrolly &= 0xff; - - INT32 minx = clip[0]; - INT32 maxx = clip[1]; - INT32 miny = clip[2]; - INT32 maxy = clip[3]; - - INT32 alpha_enable = flags & K056832_LAYER_ALPHA; - INT32 alpha = (flags >> 8) & 0xff; - INT32 opaque = flags & K056832_LAYER_OPAQUE; - - if (alpha == 255) alpha_enable = 0; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - - if (tilemap_flip & 1) sx = (512 - 8) - sx; - if (tilemap_flip & 2) sy = (256 - 8) - sy; - - if (sy < (miny-7) || sy > maxy || sx < (minx-7) || sx > maxx) continue; - - UINT16 *pMem = &K056832VideoRAM[(pageIndex << 12) + (offs << 1)]; - - INT32 attr = pMem[0]; - INT32 code = pMem[1]; - - if (m_layer_association) - { - layer = m_layer_assoc_with_page[pageIndex]; - if (layer == -1) - layer = 0; // use layer 0's palette info for unmapped pages - } - else - layer = m_active_layer; - - INT32 fbits = (k056832Regs[3] >> 6) & 3; - INT32 flip = (k056832Regs[1] >> (layer << 1)) & 0x3; // tile-flip override (see p.20 3.2.2 "REG2") - smptr = &k056832_shiftmasks[fbits]; - - flip &= (attr >> smptr->flips) & 3; - INT32 color = (attr & smptr->palm1) | (attr >> smptr->pals2 & smptr->palm2); - INT32 g_flags = flip & 3; - - m_callback(layer, &code, &color, &g_flags); - - // hack - mystic warriors' water level - iq - if (g_flags & 0x8000) { - alpha_enable = 1; - alpha = (g_flags >> 16) & 0xff; - } - - // code &= K056832RomExpMask; // mask in callback if necessary - - if (!opaque) { - if (K056832TransTab[code]) continue; - } - - { - if (tilemap_flip & 1) g_flags ^= 1; - if (tilemap_flip & 2) g_flags ^= 2; - - UINT8 *rom = K056832RomExp + (code * 0x40); - UINT32 *pal = konami_palette32 + (color * 16); // if > 4 bit, adjust in tilemap callback - - INT32 flip_tile = 0; - if (g_flags & 0x01) flip_tile |= 0x07; - if (g_flags & 0x02) flip_tile |= 0x38; - - UINT8 *pri = konami_priority_bitmap + ((sy - CLIP_MINY) * nScreenWidth) - CLIP_MINX; - UINT32 *dst = konami_bitmap32 + ((sy - CLIP_MINY) * nScreenWidth) - CLIP_MINX; - - { - if (alpha_enable) { - for (INT32 iy = 0; iy < 8; iy++, dst += nScreenWidth, pri += nScreenWidth) { - INT32 yy = sy+iy; - - if (yy < miny || yy > maxy) continue; - - for (INT32 ix = 0; ix < 8; ix++) { - INT32 xx = sx+ix; - - if (xx < minx || xx > maxx) continue; - - INT32 pxl = rom[((iy*8)+ix)^flip_tile]; - - if (pxl || opaque) { - dst[xx] = alpha_blend(dst[xx], pal[pxl], alpha); - pri[xx] = priority; - } - } - } - } else { - for (INT32 iy = 0; iy < 8; iy++, dst += nScreenWidth, pri += nScreenWidth) { - INT32 yy = sy+iy; - - if (yy < miny || yy > maxy) continue; - - for (INT32 ix = 0; ix < 8; ix++) { - INT32 xx = sx+ix; - - if (xx < minx || xx > maxx) continue; - - INT32 pxl = rom[((iy*8)+ix)^flip_tile]; - - if (pxl || opaque) { - dst[xx] = pal[pxl]; - pri[xx] = priority; - } - } - } - } - } - } - } -} - -#define K056832_PAGE_COLS 64 -#define K056832_PAGE_ROWS 32 -#define K056832_PAGE_HEIGHT (K056832_PAGE_ROWS*8) -#define K056832_PAGE_WIDTH (K056832_PAGE_COLS*8) - -#define K056832_PAGE_COUNT 16 - -void K056832Draw(INT32 layer, UINT32 flags, UINT32 priority) -{ - UINT16 *m_videoram = K056832VideoRAM; - UINT16 *m_regs = k056832Regs; - - UINT32 last_dx, last_visible, last_active; - INT32 sx, sy, ay, tx, ty, width, height; - INT32 clipw, clipx, cliph, clipy, clipmaxy; - INT32 line_height, line_endy, line_starty, line_y; - INT32 sdat_start, sdat_walk, sdat_adv, sdat_wrapmask, sdat_offs; - INT32 pageIndex, flipx, flipy, corr, r, c; - INT32 cminy, cmaxy, cminx, cmaxx; - INT32 dminy, dmaxy, dminx, dmaxx; - UINT16 *p_scroll_data; - UINT16 ram16[2]; - INT32 tmap; - - INT32 tmap_scrollx=0,tmap_scrolly=0; - - INT32 clip_data[4] = {0, 0, 0, 0}; // minx, maxx, miny, maxy - - INT32 rowstart = (m_regs[0x08|layer] & 0x18) >> 3; - INT32 colstart = (m_regs[0x0c|layer] & 0x18) >> 3; - INT32 rowspan = ((m_regs[0x08|layer] & 0x03) >> 0) + 1; - INT32 colspan = ((m_regs[0x0c|layer] & 0x03) >> 0) + 1; - INT32 dy = (INT16)m_regs[0x10|layer]; - INT32 dx = (INT16)m_regs[0x14|layer];; - INT32 scrollbank = ((m_regs[0x18] >> 1) & 0xc) | (m_regs[0x18] & 3); - INT32 scrollmode = m_regs[0x05] >> (m_lsram_page[layer][0] << 1) & 3; - - if (m_use_ext_linescroll) - { - scrollbank = K056832_PAGE_COUNT; - } - - height = rowspan * K056832_PAGE_HEIGHT; - width = colspan * K056832_PAGE_WIDTH; - - cminx = CLIP_MINX; - cmaxx = CLIP_MAXX - 1; - cminy = CLIP_MINY; - cmaxy = CLIP_MAXY - 1; - - // flip correction registers - flipy = m_regs[0] & 0x20; - if (flipy) - { - corr = m_regs[0x3c/2]; - if (corr & 0x400) - corr |= 0xfffff800; - } - else - corr = 0; - - dy += corr; - ay = (UINT32)(dy - m_layer_offs[layer][1]) % height; - - flipx = m_regs[0] & 0x10; - if (flipx) - { - corr = m_regs[0x3a/2]; - if (corr & 0x800) - corr |= 0xfffff000; - } - else - corr = 0; - - corr -= m_layer_offs[layer][0]; - - switch( scrollmode ) - { - case 0: // linescroll - p_scroll_data = &m_videoram[scrollbank<<12] + (m_lsram_page[layer][1]>>1); - line_height = 1; - sdat_wrapmask = 0x3ff; - sdat_adv = 2; - break; - case 2: // rowscroll - p_scroll_data = &m_videoram[scrollbank << 12] + (m_lsram_page[layer][1] >> 1); - line_height = 8; - sdat_wrapmask = 0x3ff; - sdat_adv = 16; - break; - default: // xyscroll - p_scroll_data = ram16; - line_height = K056832_PAGE_HEIGHT; - sdat_wrapmask = 0; - sdat_adv = 0; - ram16[0] = 0; - ram16[1] = dx; - } - if (flipy) - sdat_adv = -sdat_adv; - - last_active = m_active_layer; - - for (r = 0; r < rowspan; r++) - { - if (rowspan > 1) - { - sy = ay; - ty = r * K056832_PAGE_HEIGHT; - - if (!flipy) - { - // handle bottom-edge wraparoundness and cull off-screen tilemaps - if ((r == 0) && (sy > height - K056832_PAGE_HEIGHT)) sy -= height; - if ((sy + K056832_PAGE_HEIGHT <= ty) || (sy - K056832_PAGE_HEIGHT >= ty)) continue; - - // switch frame of reference and clip y - if ((ty -= sy) >= 0) - { - cliph = K056832_PAGE_HEIGHT - ty; - clipy = line_starty = ty; - line_endy = K056832_PAGE_HEIGHT; - sdat_start = 0; - } - else - { - cliph = K056832_PAGE_HEIGHT + ty; - ty = -ty; - clipy = line_starty = 0; - line_endy = cliph; - sdat_start = ty; - if (scrollmode == 2) { sdat_start &= ~7; line_starty -= ty & 7; } - } - } - else - { - ty += K056832_PAGE_HEIGHT; - - // handle top-edge wraparoundness and cull off-screen tilemaps - if ((r == rowspan - 1) && (sy < K056832_PAGE_HEIGHT)) sy += height; - if ((sy + K056832_PAGE_HEIGHT <= ty) || (sy - K056832_PAGE_HEIGHT >= ty)) continue; - - // switch frame of reference and clip y - if ((ty -= sy) <= 0) - { - cliph = K056832_PAGE_HEIGHT + ty; - clipy = line_starty = -ty; - line_endy = K056832_PAGE_HEIGHT; - sdat_start = K056832_PAGE_HEIGHT - 1; - if (scrollmode == 2) sdat_start &= ~7; - } - else - { - cliph = K056832_PAGE_HEIGHT - ty; - clipy = line_starty = 0; - line_endy = cliph; - sdat_start = cliph - 1; - if (scrollmode == 2) - { - sdat_start &= ~7; - line_starty -= ty & 7; - } - } - } - } - else - { - cliph = line_endy = K056832_PAGE_HEIGHT; - clipy = line_starty = 0; - - if (!flipy) - sdat_start = dy; - else - /* - doesn't work with Metamorphic Force and Martial Champion (software Y-flipped) but - LE2U (naturally Y-flipped) seems to expect this condition as an override. - - sdat_start = K056832_PAGE_HEIGHT-1 -dy; - */ - sdat_start = K056832_PAGE_HEIGHT - 1; - - if (scrollmode == 2) { - if (K056832_metamorphic_textfix) sdat_start = dy - 8; // fix for Metamorphic Force "Break the Statue" - sdat_start &= ~7; - line_starty -= dy & 7; - } - } - - sdat_start += r * K056832_PAGE_HEIGHT; - sdat_start <<= 1; - - clipmaxy = clipy + cliph - 1; - - for (c = 0; c < colspan; c++) - { - pageIndex = (((rowstart + r) & 3) << 2) + ((colstart + c) & 3); - - if (m_layer_association) - { - if (m_layer_assoc_with_page[pageIndex] != layer) - continue; - } - else - { - if (m_layer_assoc_with_page[pageIndex] == -1) - continue; - - m_active_layer = layer; - } - - if (K055555_enabled == 0) // are we using k055555 palette? - { - if (!pageIndex) - m_active_layer = 0; - } - - // if (update_linemap(pageIndex, flags)) // unnecessary? - // continue; - - if (!m_page_tile_mode[pageIndex]) continue; // this was hidden in update_linemap() - - tmap = pageIndex; - - tmap_scrolly = ay; - - last_dx = 0x100000; - last_visible = 0; - - for (sdat_walk = sdat_start, line_y = line_starty; line_y < line_endy; sdat_walk += sdat_adv, line_y += line_height) - { - dminy = line_y; - dmaxy = line_y + line_height - 1; - - if (dminy < clipy) dminy = clipy; - if (dmaxy > clipmaxy) dmaxy = clipmaxy; - if (dminy > cmaxy || dmaxy < cminy) continue; - - sdat_offs = sdat_walk & sdat_wrapmask; - - clip_data[2] = (dminy < cminy ) ? cminy : dminy; - clip_data[3] = (dmaxy > cmaxy ) ? cmaxy : dmaxy; - - if ((scrollmode == 2) && (flags & K056832_DRAW_FLAG_MIRROR) && (flipy)) - dx = ((INT32)p_scroll_data[sdat_offs + 0x1e0 + 14]<<16 | (INT32)p_scroll_data[sdat_offs + 0x1e0 + 15]) + corr; - else - dx = ((INT32)p_scroll_data[sdat_offs]<<16 | (INT32)p_scroll_data[sdat_offs + 1]) + corr; - - if ((INT32)last_dx == dx) { if (last_visible) draw_layer_internal(layer, tmap, clip_data, tmap_scrollx, tmap_scrolly, flags, priority); continue; } - last_dx = dx; - - if (colspan > 1) - { - //sx = (UINT32)dx % width; - sx = (UINT32)dx & (width-1); - - //tx = c * K056832_PAGE_WIDTH; - tx = c << 9; - - if (!flipx) - { - // handle right-edge wraparoundness and cull off-screen tilemaps - if ((c == 0) && (sx > width - K056832_PAGE_WIDTH)) sx -= width; - if ((sx + K056832_PAGE_WIDTH <= tx) || (sx - K056832_PAGE_WIDTH >= tx)) - { last_visible = 0; continue; } - - // switch frame of reference and clip x - if ((tx -= sx) <= 0) { clipw = K056832_PAGE_WIDTH + tx; clipx = 0; } - else { clipw = K056832_PAGE_WIDTH - tx; clipx = tx; } - } - else - { - tx += K056832_PAGE_WIDTH; - - // handle left-edge wraparoundness and cull off-screen tilemaps - if ((c == colspan-1) && (sx < K056832_PAGE_WIDTH)) sx += width; - if ((sx + K056832_PAGE_WIDTH <= tx) || (sx - K056832_PAGE_WIDTH >= tx)) - { last_visible = 0; continue; } - - // switch frame of reference and clip y - if ((tx -= sx) >= 0) { clipw = K056832_PAGE_WIDTH - tx; clipx = 0; } - else { clipw = K056832_PAGE_WIDTH + tx; clipx = -tx; } - } - } - else { clipw = K056832_PAGE_WIDTH; clipx = 0; } - - last_visible = 1; - - dminx = clipx; - dmaxx = clipx + clipw - 1; - - clip_data[0] = (dminx < cminx ) ? cminx : dminx; - clip_data[1] = (dmaxx > cmaxx ) ? cmaxx : dmaxx; - - // soccer superstars visible area is >512 pixels, this causes problems with the logic because - // the tilemaps are 512 pixels across. Assume that if the limits were set as below that we - // want the tilemap to be drawn on the right hand side.. this is probably not the correct - // logic, but it works. - if ((clip_data[0]>0) && (clip_data[1]==511)) - clip_data[1]=cmaxx; - - tmap_scrollx = dx; - - draw_layer_internal(layer, tmap, clip_data, tmap_scrollx, tmap_scrolly, flags, priority); - } - } - } - - m_active_layer = last_active; -} - -int K056832GetLayerAssociation() -{ - return m_layer_association; -} - -void K056832Metamorphic_Fixup() -{ // Metmorphic Force (metamrph)'s scroll data has a different offset. Notably, this fixes the jumbled up "Break the Statue" text. (for those familiar with the game) - K056832_metamorphic_textfix = 1; -} - -// some of these this may not be necessary to save... -void K056832Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = (UINT8*)K056832VideoRAM; - ba.nLen = 0x2000 * 0x11 * 2; - ba.szName = "K056832 Video RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i < 0x20; i++) { - SCAN_VAR(k056832Regs[i]); - SCAN_VAR(k056832Regsb[i]); - } - - for (INT32 i = 0; i < 16; i++) { - SCAN_VAR(m_layer_assoc_with_page[i]); - } - - for (INT32 i = 0; i < 8; i++) { - SCAN_VAR(m_layer_tile_mode[i]); - SCAN_VAR(m_lsram_page[i][0]); - SCAN_VAR(m_lsram_page[i][1]); - } - - SCAN_VAR(m_use_ext_linescroll); // ? - SCAN_VAR(m_layer_association); // ? - SCAN_VAR(m_active_layer); - SCAN_VAR(m_selected_page); - SCAN_VAR(m_selected_page_x4096); - SCAN_VAR(m_default_layer_association); - SCAN_VAR(m_uses_tile_banks); - SCAN_VAR(m_cur_tile_bank); - SCAN_VAR(m_cur_gfx_banks); - SCAN_VAR(m_num_gfx_banks); - SCAN_VAR(tilemap_flip); - SCAN_VAR(m_rom_half); - } -} diff --git a/jan/src/burn/drv/konami/konamigx.cpp b/jan/src/burn/drv/konami/konamigx.cpp deleted file mode 100644 index 74035adb0..000000000 --- a/jan/src/burn/drv/konami/konamigx.cpp +++ /dev/null @@ -1,706 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:R. Belmont, Acho A. Tang, Phil Stroffolino, Olivier Galibert - -#include "tiles_generic.h" -#include "konamiic.h" - -static INT32 konamigx_wrport1_0 = 0; - -//static UINT8 m_sound_ctrl; -//static UINT8 m_sound_intck; -//static UINT32 m_fantjour_dma[8]; -//static INT32 m_konamigx_current_frame; -static INT32 m_gx_objdma, m_gx_primode; - -#define GX_MAX_SPRITES 512 -#define GX_MAX_LAYERS 6 -#define GX_MAX_OBJECTS (GX_MAX_SPRITES + GX_MAX_LAYERS) - -static struct GX_OBJ { INT32 order, offs, code, color; } *gx_objpool; -static UINT16 *gx_spriteram; - -static INT32 *K054338_shdRGB; - -static UINT8 *gx_shdzbuf, *gx_objzbuf; - -static INT32 k053247_vrcbk[4]; -static INT32 k053247_opset; -static INT32 k053247_coreg; -static INT32 k053247_coregshift; - -static INT32 opri; -static INT32 oinprion; -static INT32 vcblk[6]; -static INT32 ocblk; -static INT32 vinmix; -static INT32 vmixon; -static INT32 osinmix; -static INT32 osmixon; - -void konamigx_precache_registers() -{ - // (see sprite color coding scheme on p.46 & 47) - static const INT32 coregmasks[5] = {0xf,0xe,0xc,0x8,0x0}; - static const INT32 coregshifts[5]= {4,5,6,7,8}; - INT32 i; - - i = K053247ReadRegs(0x8/2); - k053247_vrcbk[0] = (i & 0x000f) << 14; - k053247_vrcbk[1] = (i & 0x0f00) << 6; - i = K053247ReadRegs(0xa/2); - k053247_vrcbk[2] = (i & 0x000f) << 14; - k053247_vrcbk[3] = (i & 0x0f00) << 6; - - // COREG == OBJSET2+1C == bit8-11 of OPSET ??? (see p.50 last table, needs p.49 to confirm) - k053247_opset = K053247ReadRegs(0xc/2); - - i = k053247_opset & 7; if (i > 4) i = 4; - - k053247_coreg = K053247ReadRegs(0xc/2)>>8 & 0xf; - k053247_coreg =(k053247_coreg & coregmasks[i]) << 12; - - k053247_coregshift = coregshifts[i]; - - opri = K055555ReadRegister(K55_PRIINP_8); - oinprion = K055555ReadRegister(K55_OINPRI_ON); - vcblk[0] = K055555ReadRegister(K55_PALBASE_A); - vcblk[1] = K055555ReadRegister(K55_PALBASE_B); - vcblk[2] = K055555ReadRegister(K55_PALBASE_C); - vcblk[3] = K055555ReadRegister(K55_PALBASE_D); - vcblk[4] = K055555ReadRegister(K55_PALBASE_SUB1); - vcblk[5] = K055555ReadRegister(K55_PALBASE_SUB2); - ocblk = K055555ReadRegister(K55_PALBASE_OBJ); - vinmix = K055555ReadRegister(K55_BLEND_ENABLES); - vmixon = K055555ReadRegister(K55_VINMIX_ON); - osinmix = K055555ReadRegister(K55_OSBLEND_ENABLES); - osmixon = K055555ReadRegister(K55_OSBLEND_ON); -} - -void konamigx_mixer_init(INT32 objdma) -{ - m_gx_objdma = 0; - m_gx_primode = 0; - - gx_shdzbuf = (UINT8*)BurnMalloc(512 * 256 * 2); - gx_objzbuf = (UINT8*)BurnMalloc(512 * 256 * 2); - - gx_objpool = (struct GX_OBJ*)BurnMalloc(GX_MAX_OBJECTS * sizeof(GX_OBJ)); - - K054338_export_config(&K054338_shdRGB); - - gx_spriteram = (UINT16*)K053247Ram; - - if (objdma) - { - gx_spriteram = (UINT16*)BurnMalloc(0x1000); - m_gx_objdma = 1; - } - else - gx_spriteram = (UINT16*)K053247Ram; - -// m_palette->set_shadow_dRGB32(3,-80,-80,-80, 0); - K054338_invert_alpha(1); -} - -void konamigx_mixer_exit() -{ - BurnFree(gx_shdzbuf); - BurnFree(gx_objzbuf); - if (m_gx_objdma && gx_spriteram) { - BurnFree(gx_spriteram); - } - BurnFree(gx_objpool); - m_gx_objdma = 0; -} - -static void gx_wipezbuf(INT32 noshadow) -{ -#define GX_ZBUFW 512 - - INT32 w = (nScreenWidth); // - 1); - sept.2.2016, fixes lines of pixels - INT32 h = (nScreenHeight); // - 1); - around gaiapolis's intro - dink - - UINT8 *zptr = gx_objzbuf; - INT32 ecx = h; - - do { memset(zptr, -1, w); zptr += GX_ZBUFW; } while (--ecx); - - if (!noshadow) - { - zptr = gx_shdzbuf; - w <<= 1; - ecx = h; - do { memset(zptr, -1, w); zptr += (GX_ZBUFW<<1); } while (--ecx); - } -} - -void konamigx_mixer_primode(INT32 mode) -{ - m_gx_primode = mode; -} - -static void gx_draw_basic_tilemaps(INT32 mixerflags, INT32 code) -{ - INT32 temp1,temp2,temp3,temp4; - INT32 i = code<<1; - INT32 j = mixerflags>>i & 3; - INT32 k = 0; - - INT32 disp = K055555ReadRegister(K55_INPUT_ENABLES); - if (disp & (1<>(i+16); temp3 = 3; } - else - { - temp1 = vinmix; - temp2 = vinmix>>i & 3; - temp3 = vmixon>>i & 3; - } - - /* blend layer only when: - 1) vinmix != 0xff - 2) its internal mix code is set - 3) all mix code bits are internal(overriden until tile blending has been implemented) - 4) 0 > alpha < 255; - */ - if (temp1!=0xff && temp2 /*&& temp3==3*/) - { - temp4 = K054338_set_alpha_level(temp2); - - if (temp4 <= 0) return; - if (temp4 < 255) k = K056832_SET_ALPHA(temp4); - } - - if (mixerflags & 1<<(code+12)) k |= K056382_DRAW_FLAG_FORCE_XYSCROLL; - - if (nBurnLayer & (1 << code)) K056832Draw(code, k, 0); - } -} - -static void gx_draw_basic_extended_tilemaps_1(INT32 mixerflags, INT32 code, INT32 sub1, INT32 sub1flags, INT32 rushingheroes_hack, INT32 offs) -{ - INT32 temp1,temp2,temp3,temp4; - INT32 i = code<<1; - INT32 j = mixerflags>>i & 3; - INT32 k = 0; - static INT32 parity = 0; - parity ^= 1; - - sub1 ^= 0; // kill warnings - - INT32 disp = K055555ReadRegister(K55_INPUT_ENABLES); - if ((disp & K55_INP_SUB1) || (rushingheroes_hack)) - { - INT32 alpha = 255; - - if (j == GXMIX_BLEND_NONE) { temp1 = 0xff; temp2 = temp3 = 0; } else - if (j == GXMIX_BLEND_FORCE) { temp1 = 0x00; temp2 = mixerflags>>24; temp3 = 3; } - else - { - temp1 = osinmix; - temp2 = osinmix>>2 & 3; - temp3 = osmixon>>2 & 3; - } - - if (temp1!=0xff && temp2 /*&& temp3==3*/) - { - alpha = temp4 = K054338_set_alpha_level(temp2); - - if (temp4 <= 0) return; - if (temp4 < 255) k = (j == GXMIX_BLEND_FAST) ? ~parity : 1; - } - - INT32 l = sub1flags & 0xf; - - if (offs == -2) - { - - INT32 pixeldouble_output = 0; - - INT32 width = nScreenWidth; - - if (width>512) // vsnetscr case - pixeldouble_output = 1; - - if (nSpriteEnable & 4 && K053936_external_bitmap) - K053936GP_0_zoom_draw(K053936_external_bitmap, l, k, alpha, pixeldouble_output, m_k053936_0_ctrl_16, m_k053936_0_linectrl_16, m_k053936_0_ctrl, m_k053936_0_linectrl); - } - else - { - if (nSpriteEnable & 2) - if (KonamiIC_K053250InUse) K053250Draw(0, vcblk[4]<>i & 3; -// INT32 k = 0; -// static INT32 parity = 0; -// parity ^= 1; - - sub2 ^= 0; // kill warnings - - INT32 disp = K055555ReadRegister(K55_INPUT_ENABLES); - if (disp & K55_INP_SUB2) - { - //INT32 alpha = 255; - if (j == GXMIX_BLEND_NONE) { temp1 = 0xff; temp2 = temp3 = 0; } else - if (j == GXMIX_BLEND_FORCE) { temp1 = 0x00; temp2 = mixerflags>>26; temp3 = 3; } - else - { - temp1 = osinmix; - temp2 = osinmix>>4 & 3; - temp3 = osmixon>>4 & 3; - } - - if (temp1!=0xff && temp2 /*&& temp3==3*/) - { - //alpha = - temp4 = K054338_set_alpha_level(temp2); - - if (temp4 <= 0) return; - //if (temp4 < 255) k = (j == GXMIX_BLEND_FAST) ? ~parity : 1; - } - - INT32 l = sub2flags & 0xf; - - if (offs == -3) - { - if (extra_bitmap) // soccer superstars roz layer - { -#if 0 // iq_132 - INT32 xx,yy; - INT32 width = screen.width(); - INT32 height = screen.height(); - const pen_t *paldata = m_palette->pens(); - - // the output size of the roz layer has to be doubled horizontally - // so that it aligns with the sprites and normal tilemaps. This appears - // to be done as a post-processing / mixing step effect - // - // - todo, use the pixeldouble_output I just added for vsnet instead? - for (yy=0;yypix16(yy); - UINT32* dst = &bitmap.pix32(yy); - INT32 shiftpos = 0; - for (xx=0;xx("k053250_2")->draw(bitmap, cliprect, vcblk[5]<order; - INT32 offs = objptr->offs; - INT32 code = objptr->code; - INT32 color = objptr->color; - - /* entries >=0 in our list are sprites */ - if (offs >= 0) - { - if (!(disp & K55_INP_OBJ)) continue; - - INT32 drawmode = order>>4 & 0xf; - - INT32 alpha = 255; - INT32 pri = 0; - INT32 zcode = -1; // negative zcode values turn off z-buffering - - if (drawmode & 2) - { - alpha = color>>K055555_MIXSHIFT & 3; - if (alpha) alpha = K054338_set_alpha_level(alpha); - if (alpha <= 0) continue; - } - color &= K055555_COLORMASK; - - if (drawmode >= 4) { - // m_palette->set_shadow_mode(order & 0x0f); - drawmode |= (order & 0x0f)<<4; - } - - if (!(mixerflags & GXMIX_NOZBUF)) - { - zcode = order>>16 & 0xff; - pri = order>>24 & 0xff; - } - - if (nSpriteEnable & 1) - k053247_draw_single_sprite_gxcore(gx_objzbuf, gx_shdzbuf,code,gx_spriteram,offs,color,alpha,drawmode,zcode,pri,0,0,NULL,NULL,0); - } - else - { - switch (offs) - { - case -1: - gx_draw_basic_tilemaps(mixerflags, code); - continue; - case -2: - case -4: - gx_draw_basic_extended_tilemaps_1(mixerflags, code, sub1, sub1flags, rushingheroes_hack, offs); - continue; - case -3: - case -5: - gx_draw_basic_extended_tilemaps_2(mixerflags, code, sub2, sub2flags, extra_bitmap, offs); - continue; - } - continue; - } - } -} - -void konamigx_mixer(INT32 sub1 /*extra tilemap 1*/, INT32 sub1flags, INT32 sub2 /*extra tilemap 2*/, INT32 sub2flags, INT32 mixerflags, INT32 extra_bitmap /*extra tilemap 3*/, INT32 rushingheroes_hack) -{ - INT32 objbuf[GX_MAX_OBJECTS]; - INT32 shadowon[3], shdpri[3], layerid[6], layerpri[6]; - - struct GX_OBJ *objpool, *objptr; - INT32 cltc_shdpri, /*prflp,*/ disp; - - // abort if object database failed to initialize - objpool = gx_objpool; - if (!objpool) return; - - // clear screen with backcolor and update flicker pulse - if (konamigx_wrport1_0 & 0x20) - K054338_fill_backcolor(K055555ReadRegister(0) << 9, K055555ReadRegister(1)); - else - K054338_fill_solid_bg(); - - // abort if video has been disabled - disp = K055555ReadRegister(K55_INPUT_ENABLES); - if (!disp) return; - cltc_shdpri = K054338_read_register(K338_REG_CONTROL); - - if (!rushingheroes_hack) // Slam Dunk 2 never sets this. It's either part of the protection, or type4 doesn't use it - { - if (!(cltc_shdpri & K338_CTL_KILL)) return; - } - - // demote shadows by one layer when this bit is set??? (see p.73 8.6) - cltc_shdpri &= K338_CTL_SHDPRI; - - // wipe z-buffer - if (mixerflags & GXMIX_NOZBUF) - mixerflags |= GXMIX_NOSHADOW; - else - gx_wipezbuf(mixerflags & GXMIX_NOSHADOW); - - // cache global parameters - konamigx_precache_registers(); - - // init OBJSET2 and mixer parameters (see p.51 and chapter 7) - layerid[0] = 0; layerid[1] = 1; layerid[2] = 2; layerid[3] = 3; layerid[4] = 4; layerid[5] = 5; - - // invert layer priority when this flag is set (not used by any GX game?) - //prflp = K055555ReadRegister(K55_CONTROL) & K55_CTL_FLIPPRI; - - layerpri[0] = K055555ReadRegister(K55_PRIINP_0); - layerpri[1] = K055555ReadRegister(K55_PRIINP_3); - layerpri[3] = K055555ReadRegister(K55_PRIINP_7); - layerpri[4] = K055555ReadRegister(K55_PRIINP_9); - layerpri[5] = K055555ReadRegister(K55_PRIINP_10); - - INT32 shdprisel; - - if (m_gx_primode == -1) - { - // Lethal Enforcer hack (requires pixel color comparison) - layerpri[2] = K055555ReadRegister(K55_PRIINP_3) + 0x20; - shdprisel = 0x3f; - } - else - { - layerpri[2] = K055555ReadRegister(K55_PRIINP_6); - shdprisel = K055555ReadRegister(K55_SHD_PRI_SEL); - } - - // SHDPRISEL filters shadows by different priority comparison methods (UNIMPLEMENTED, see detail on p.66) - if (!(shdprisel & 0x03)) shadowon[0] = 0; - if (!(shdprisel & 0x0c)) shadowon[1] = 0; - if (!(shdprisel & 0x30)) shadowon[2] = 0; - - shdpri[0] = K055555ReadRegister(K55_SHAD1_PRI); - shdpri[1] = K055555ReadRegister(K55_SHAD2_PRI); - shdpri[2] = K055555ReadRegister(K55_SHAD3_PRI); - - INT32 spri_min = 0; - - shadowon[2] = shadowon[1] = shadowon[0] = 0; - - INT32 k = 0; - if (!(mixerflags & GXMIX_NOSHADOW)) - { - INT32 i,j; - // only enable shadows beyond a +/-7 RGB threshold - for (j=0,i=0; i<3; j+=3,i++) - { - k = K054338_shdRGB[j ]; if (k < -7 || k > 7) { shadowon[i] = 1; continue; } - k = K054338_shdRGB[j+1]; if (k < -7 || k > 7) { shadowon[i] = 1; continue; } - k = K054338_shdRGB[j+2]; if (k < -7 || k > 7) { shadowon[i] = 1; } - } - - // SHDON specifies layers on which shadows can be projected (see detail on p.65 7.2.8) - INT32 temp = K055555ReadRegister(K55_SHD_ON); - for (i=0; i<4; i++) if (!(temp>>i & 1) && spri_min < layerpri[i]) spri_min = layerpri[i]; // HACK - - // update shadows status - K054338_update_all_shadows(); - } - - // pre-sort layers - for (INT32 j=0; j<5; j++) - { - INT32 temp1 = layerpri[j]; - for (INT32 i=j+1; i<6; i++) - { - INT32 temp2 = layerpri[i]; - if ((UINT32)temp1 <= (UINT32)temp2) - { - layerpri[i] = temp1; layerpri[j] = temp1 = temp2; - temp2 = layerid[i]; layerid[i] = layerid[j]; layerid[j] = temp2; - } - } - } - - // build object database and create indices - objptr = objpool; - INT32 nobj = 0; - - for (INT32 i=5; i>=0; i--) - { - INT32 offs; - - INT32 code = layerid[i]; - switch (code) - { - /* - Background layers are represented by negative offset values as follow: - - 0+ : normal sprites - -1 : tile layer A - D - -2 : K053936 ROZ+ layer 1 - -3 : K053936 ROZ+ layer 2 - -4 : K053250 LVC layer 1 - -5 : K053250 LVC layer 2 - */ - case 4 : - offs = -128; - if (sub1flags & 0xf) { if (sub1flags & GXSUB_K053250) offs = -4; else if (sub1) offs = -2; } - break; - case 5 : - offs = -128; - if (sub2flags & 0xf) { if (sub2flags & GXSUB_K053250) offs = -5; else if (sub2) offs = -3; } - if (extra_bitmap) offs = -3; - break; - default: offs = -1; - } - - if (offs != -128) - { - objptr->order = layerpri[i]<<24; - objptr->code = code; - objptr->offs = offs; - objptr++; - - objbuf[nobj] = nobj; - nobj++; - } - } - -// i = j = 0xff; - INT32 l = 0; - - for (INT32 offs=0; offs<0x800; offs+=8) - { - INT32 pri = 0; - - if (!(gx_spriteram[offs] & 0x8000)) continue; - - INT32 zcode = gx_spriteram[offs] & 0xff; - - // invert z-order when opset_pri is set (see p.51 OPSET PRI) - if (k053247_opset & 0x10) zcode = 0xff - zcode; - - INT32 code = gx_spriteram[offs+1]; - INT32 color = k = gx_spriteram[offs+6]; - l = gx_spriteram[offs+7]; - - K053247Callback(&code, &color, &pri); - - /* - shadow = shadow code - spri = shadow priority - temp1 = add solid object - temp2 = solid pens draw mode - temp3 = add shadow object - temp4 = shadow pens draw mode - */ - INT32 temp4 = 0; - INT32 temp3 = 0; - INT32 temp2 = 0; - INT32 temp1 = 0; - INT32 spri = 0; - INT32 shadow = 0; - - if (color & K055555_FULLSHADOW) - { - shadow = 3; // use default intensity and color - spri = pri; // retain host priority - temp3 = 1; // add shadow - temp4 = 5; // draw full shadow - } - else - { - shadow = k>>10 & 3; - if (shadow) // object has shadow? - { - INT32 k053246_objset1 = K053246ReadRegs(5); - - if (shadow != 1 || k053246_objset1 & 0x20) - { - shadow--; - temp1 = 1; // add solid - temp2 = 1; // draw partial solid - if (shadowon[shadow]) - { - temp3 = 1; // add shadow - temp4 = 4; // draw partial shadow - } - } - else - { - // drop the entire sprite to shadow if its shadow code is 1 and SD0EN is off (see p.48) - shadow = 0; - if (!shadowon[0]) continue; - temp3 = 1; // add shadow - temp4 = 5; // draw full shadow - } - } - else - { - temp1 = 1; // add solid - temp2 = 0; // draw full solid - } - - if (temp1) - { - // tag sprite for alpha blending - if (color>>K055555_MIXSHIFT & 3) temp2 |= 2; - } - - if (temp3) - { - // determine shadow priority - spri = (k053247_opset & 0x20) ? pri : shdpri[shadow]; // (see p.51 OPSET SDSEL) - } - } - - switch (m_gx_primode & 0xf) - { - // Dadandarn zcode suppression - case 1: - zcode = 0; - break; - - // Daisukiss bad shadow filter - case 4: - if (k & 0x3000 || k == 0x0800) continue; - - // Tokkae shadow masking (INACCURATE) - case 5: - if (spri < spri_min) spri = spri_min; - break; - } - - /* - default sort order: - fedcba9876543210fedcba9876543210 - xxxxxxxx------------------------ (priority) - --------xxxxxxxx---------------- (zcode) - ----------------xxxxxxxx-------- (offset) - ------------------------xxxx---- (shadow mode) - ----------------------------xxxx (shadow code) - */ - if (temp1) - { - - // add objects with solid or alpha pens - INT32 order = pri<<24 | zcode<<16 | offs<<(8-3) | temp2<<4; - objptr->order = order; - objptr->offs = offs; - objptr->code = code; - objptr->color = color; - objptr++; - - objbuf[nobj] = nobj; - nobj++; - } - - if (temp3 && !(color & K055555_SKIPSHADOW) && !(mixerflags & GXMIX_NOSHADOW)) - { - // add objects with shadows if enabled - INT32 order = spri<<24 | zcode<<16 | offs<<(8-3) | temp4<<4 | shadow; - objptr->order = order; - objptr->offs = offs; - objptr->code = code; - objptr->color = color; - objptr++; - - objbuf[nobj] = nobj; - nobj++; - } - } - - // sort objects in decending order (SLOW) - k = nobj; - l = nobj - 1; - - for (INT32 j=0; j>= 1; - - for (INT32 i = 0; i < len/2; i++) - { - INT32 t = buf[len/2 + i]; - buf[len/2 + i] = buf[len + i]; - buf[len + i] = t; - } - - shuffle(buf, len); - shuffle(buf + len, len); -} - -void konami_rom_deinterleave_2(UINT8 *src, INT32 len) -{ - shuffle((UINT16*)src,len/2); -} - -void konami_rom_deinterleave_4(UINT8 *src, INT32 len) -{ - konami_rom_deinterleave_2(src, len); - konami_rom_deinterleave_2(src, len); -} - -void KonamiRecalcPalette(UINT8 *src, UINT32 *dst, INT32 len) -{ - konami_palette32 = dst; - - UINT8 r,g,b; - UINT16 *p = (UINT16*)src; - for (INT32 i = 0; i < len / 2; i++) { - UINT16 d = BURN_ENDIAN_SWAP_INT16((p[i] << 8) | (p[i] >> 8)); - - r = (d >> 0) & 0x1f; - g = (d >> 5) & 0x1f; - b = (d >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - dst[i] = (r << 16) | (g << 8) | b; // 32-bit colors - } -} - -void KonamiICReset() -{ - if (KonamiIC_K051960InUse) K051960Reset(); - if (KonamiIC_K052109InUse) K052109Reset(); - if (KonamiIC_K051316InUse) K051316Reset(); - if (KonamiIC_K053245InUse) K053245Reset(); - if (KonamiIC_K053247InUse) K053247Reset(); - if (KonamiIC_K053936InUse) K053936Reset(); - if (KonamiIC_K053250InUse) K053250Reset(); - if (KonamiIC_K055555InUse) K055555Reset(); - if (KonamiIC_K054338InUse) K054338Reset(); - if (KonamiIC_K056832InUse) K056832Reset(); - - K053251Reset(); - K054000Reset(); - K051733Reset(); -} - -void KonamiICExit() -{ - if (konami_bitmap32) { - BurnFree (konami_bitmap32); - konami_bitmap32 = NULL; - } - - if (konami_priority_bitmap) { - BurnFree(konami_priority_bitmap); - konami_priority_bitmap = NULL; - } - - previous_depth = 0; - if (palette_lut) { - BurnFree(palette_lut); - } - palette_lut = NULL; - - if (KonamiIC_K051960InUse) K051960Exit(); - if (KonamiIC_K052109InUse) K052109Exit(); - if (KonamiIC_K051316InUse) K051316Exit(); - if (KonamiIC_K053245InUse) K053245Exit(); - if (KonamiIC_K053247InUse) K053247Exit(); - if (KonamiIC_K053936InUse) K053936Exit(); - if (KonamiIC_K053250InUse) K053250Exit(); - if (KonamiIC_K055555InUse) K055555Exit(); - if (KonamiIC_K054338InUse) K054338Exit(); - if (KonamiIC_K056832InUse) K056832Exit(); - - KonamiIC_K051960InUse = 0; - KonamiIC_K052109InUse = 0; - KonamiIC_K051316InUse = 0; - KonamiIC_K053245InUse = 0; - KonamiIC_K053247InUse = 0; - KonamiIC_K053250InUse = 0; - KonamiIC_K055555InUse = 0; - KonamiIC_K054338InUse = 0; - KonamiIC_K056832InUse = 0; - - highlight_over_sprites_mode = 0; - highlight_mode = 0; - - K05324xZRejection = -1; -} - -void KonamiICScan(INT32 nAction) -{ - if (KonamiIC_K051960InUse) K051960Scan(nAction); - if (KonamiIC_K052109InUse) K052109Scan(nAction); - if (KonamiIC_K051316InUse) K051316Scan(nAction); - if (KonamiIC_K053245InUse) K053245Scan(nAction); - if (KonamiIC_K053247InUse) K053247Scan(nAction); - if (KonamiIC_K053936InUse) K053936Scan(nAction); - if (KonamiIC_K053250InUse) K053250Scan(nAction); - if (KonamiIC_K055555InUse) K055555Scan(nAction); - if (KonamiIC_K054338InUse) K054338Scan(nAction); - if (KonamiIC_K056832InUse) K056832Scan(nAction); - - K053251Scan(nAction); - K054000Scan(nAction); - K051733Scan(nAction); -} - -void KonamiAllocateBitmaps() -{ - INT32 width, height; - BurnDrvGetVisibleSize(&width, &height); - - if (konami_bitmap32 == NULL) { - konami_bitmap32 = (UINT32*)BurnMalloc(width * height * sizeof(INT32)); - } - - if (konami_priority_bitmap == NULL) { - konami_priority_bitmap = (UINT8*)BurnMalloc(width * height * sizeof(INT8)); - } -} - -void KonamiClearBitmaps(UINT32 color) -{ - if (konami_priority_bitmap && konami_bitmap32) { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - konami_priority_bitmap[i] = 0; - konami_bitmap32[i] = color; - } - } -} - -void KonamiBlendCopy(UINT32 *pPalette) -{ - pBurnDrvPalette = pPalette; - - UINT32 *bmp = konami_bitmap32; - - if (previous_depth != 2 && nBurnBpp == 2) { - if (palette_lut == NULL) { - palette_lut = (UINT16*)BurnMalloc((1 << 24) * 2); - - for (INT32 i = 0; i < (1 << 24); i++) { - palette_lut[i] = BurnHighCol(i / 0x10000, (i / 0x100) & 0xff, i & 0xff, 0); - } - } - } - - previous_depth = nBurnBpp; - - switch (nBurnBpp) - { - case 4: - { - memcpy (pBurnDraw, bmp, nScreenWidth * nScreenHeight * sizeof(INT32)); - } - break; - - case 2: - { - UINT16 *dst = (UINT16*)pBurnDraw; - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++, dst++, bmp++) { - *dst = palette_lut[*bmp]; - } - } - break; - - case 3: - { - UINT8 *dst = pBurnDraw; - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++, dst+=3, bmp++) { - dst[0] = *bmp; - dst[1] = *bmp / 0x100; - dst[2] = *bmp / 0x10000; - } - } - break; -#if 0 - case 2: - { - UINT16 *dst = (UINT16*)pBurnDraw; - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++, dst++, bmp++) { - *dst = *bmp / 0x10000; - *dst += (*bmp / 0x400) & 0x3f; - *dst += (*bmp / 8) & 0x1f; - } - - } - break; -#endif - default: - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - PutPix(pBurnDraw + (i * nBurnBpp), BurnHighCol((bmp[i]>>16)&0xff, (bmp[i]>>8)&0xff, bmp[i]&0xff, 0)); - } - // bprintf (0, _T("Unsupported KonamiBlendCopy bit depth! %d\n"), nBurnBpp); - break; - } -} - -void konami_draw_16x16_priozoom_tile(UINT8 *gfx, INT32 code, INT32 bpp, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, UINT32 priority) -{ - // Based on MAME sources for tile zooming - UINT8 *gfx_base = gfx + (code * width * height); - int dh = (zoomy * height + 0x8000) / 0x10000; - int dw = (zoomx * width + 0x8000) / 0x10000; - - priority |= 1<<31; // always on! - - UINT32 *pal = konami_palette32 + (color << bpp); - - if (dw && dh) - { - int dx = (width * 0x10000) / dw; - int dy = (height * 0x10000) / dh; - int ex = sx + dw; - int ey = sy + dh; - int x_index_base = 0; - int y_index = 0; - - if (fx) { - x_index_base = (dw - 1) * dx; - dx = -dx; - } - - if (fy) { - y_index = (dh - 1) * dy; - dy = -dy; - } - - for (INT32 y = sy; y < ey; y++) - { - if (y >= 0 && y < nScreenHeight) - { - UINT8 *src = gfx_base + (y_index / 0x10000) * width; - UINT32 *dst = konami_bitmap32 + y * nScreenWidth; - UINT8 *prio = konami_priority_bitmap + y * nScreenWidth; - - for (INT32 x = sx, x_index = x_index_base; x < ex; x++) - { - if (x >= 0 && x < nScreenWidth) { - INT32 pxl = src[x_index>>16]; - - if (pxl != t) { - if ((priority & (1 << (prio[x]&0x1f)))==0) { - dst[x] = pal[pxl]; - } - prio[x] |= 0x1f; - } - } - x_index += dx; - } - } - - y_index += dy; - } - } -} - -void konami_draw_16x16_zoom_tile(UINT8 *gfxbase, INT32 code, INT32 bpp, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy) -{ - UINT8 *gfx_base = gfxbase + (code * width * height); - int dh = (zoomy * height + 0x8000) / 0x10000; - int dw = (zoomx * width + 0x8000) / 0x10000; - - UINT32 *pal = konami_palette32 + (color << bpp); - - if (dw && dh) - { - int dx = (width * 0x10000) / dw; - int dy = (height * 0x10000) / dh; - int ex = sx + dw; - int ey = sy + dh; - int x_index_base = 0; - int y_index = 0; - - if (fx) { - x_index_base = (dw - 1) * dx; - dx = -dx; - } - - if (fy) { - y_index = (dh - 1) * dy; - dy = -dy; - } - - for (INT32 y = sy; y < ey; y++) - { - if (y >= 0 && y < nScreenHeight) - { - UINT8 *src = gfx_base + (y_index / 0x10000) * width; - UINT32 *dst = konami_bitmap32 + y * nScreenWidth; - - for (INT32 x = sx, x_index = x_index_base; x < ex; x++) - { - if (x >= 0 && x < nScreenWidth) { - INT32 pxl = src[x_index>>16]; - - if (pxl != t) { - dst[x] = pal[pxl]; - } - } - - x_index += dx; - } - } - - y_index += dy; - } - } -} - -void konami_set_highlight_mode(INT32 mode) -{ - highlight_mode = mode; -} - -void konami_set_highlight_over_sprites_mode(INT32 mode) -{ - highlight_over_sprites_mode = mode; -} - -static inline UINT32 shadow_blend(UINT32 d) -{ - return ((((d & 0xff00ff) * 0x9d) & 0xff00ff00) + (((d & 0x00ff00) * 0x9d) & 0x00ff0000)) / 0x100; -} - -static inline UINT32 highlight_blend(UINT32 d) -{ - INT32 r = ((d&0xff0000)+0x220000); - if (r > 0xff0000) r = 0xff0000; - - INT32 g = ((d&0x00ff00)+0x002200); - if (g > 0x00ff00) g = 0x00ff00; - - INT32 b = ((d&0x0000ff)+0x000022); - if (b > 0x0000ff) b = 0x0000ff; - return r|g|b; -} - -void konami_draw_16x16_prio_tile(UINT8 *gfxbase, INT32 code, INT32 bpp, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, UINT32 priority) -{ - INT32 flip = 0; - if (flipx) flip |= 0x0f; - if (flipy) flip |= 0xf0; - - UINT8 *gfx = gfxbase + code * 0x100; - - UINT8 *pri = konami_priority_bitmap + (sy * nScreenWidth) + sx; - UINT32 *dst = konami_bitmap32 + (sy * nScreenWidth) + sx; - UINT32 *pal = konami_palette32 + (color << bpp); - - priority |= 1 << 31; // always on! - - for (INT32 y = 0; y < 16; y++, sy++) - { - if (sy >= 0 && sy < nScreenHeight) - { - for (INT32 x = 0; x < 16; x++) - { - if ((sx+x) >= 0 && (sx+x) < nScreenWidth) - { - INT32 pxl = gfx[((y*16)+x)^flip]; - - if (pxl) { - if ((priority & (1 << (pri[x]&0x1f)))==0) { - if (pri[x] & 0x20) { - dst[x] = highlight_mode ? highlight_blend(pal[pxl]) : shadow_blend(pal[pxl]);//pal[pxl]; - } else { - dst[x] = pal[pxl]; - } - } - pri[x] |= 0x1f; - } - } - } - } - - pri += nScreenWidth; - dst += nScreenWidth; - } -} - -void konami_draw_16x16_tile(UINT8 *gfxbase, INT32 code, INT32 bpp, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - INT32 flip = 0; - if (flipx) flip |= 0x0f; - if (flipy) flip |= 0xf0; - - UINT8 *gfx = gfxbase + code * 0x100; - - UINT32 *pal = konami_palette32 + (color << bpp); - UINT32 *dst = konami_bitmap32 + (sy * nScreenWidth) + sx; - - for (INT32 y = 0; y < 16; y++, sy++) - { - if (sy >= 0 && sy < nScreenHeight) - { - for (INT32 x = 0; x < 16; x++) - { - if ((sx+x) >= 0 && (sx+x) < nScreenWidth) - { - INT32 pxl = gfx[((y*16)+x)^flip]; - - if (pxl) { - dst[x] = pal[pxl]; - } - } - } - } - - dst += nScreenWidth; - } -} - -void konami_render_zoom_shadow_tile(UINT8 *gfxbase, INT32 code, INT32 bpp, INT32 color, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, UINT32 priority, INT32 /*highlight*/) -{ - // Based on MAME sources for tile zooming - UINT8 *gfx_base = gfxbase + (code * width * height); - int dh = (zoomy * height + 0x8000) / 0x10000; - int dw = (zoomx * width + 0x8000) / 0x10000; - - INT32 shadow_color = (1 << bpp) - 1; - - UINT32 *pal = konami_palette32 + (color << bpp); - - if (dw && dh) - { - int dx = (width * 0x10000) / dw; - int dy = (height * 0x10000) / dh; - int ex = sx + dw; - int ey = sy + dh; - int x_index_base = 0; - int y_index = 0; - - if (fx) { - x_index_base = (dw - 1) * dx; - dx = -dx; - } - - if (fy) { - y_index = (dh - 1) * dy; - dy = -dy; - } - - if (priority == 0xffffffff) - { - for (INT32 y = sy; y < ey; y++) - { - if (y >= 0 && y < nScreenHeight) - { - UINT8 *src = gfx_base + (y_index / 0x10000) * width; - UINT32 *dst = konami_bitmap32 + y * nScreenWidth; - UINT8 *pri = konami_priority_bitmap + y * nScreenWidth; - - for (INT32 x = sx, x_index = x_index_base; x < ex; x++) - { - if (x >= 0 && x < nScreenWidth) { - INT32 pxl = src[x_index>>16]; - - if (pxl) { - if (pxl == shadow_color) { - dst[x] = highlight_mode ? highlight_blend(dst[x]) : shadow_blend(dst[x]); - if (highlight_over_sprites_mode) - pri[x] |= 0x20; - } else { - if (pri[x] & 0x20) { - dst[x] = highlight_mode ? highlight_blend(dst[x]) : shadow_blend(dst[x]);//pal[pxl]; - } else { - dst[x] = pal[pxl]; - } - } - } - } - - x_index += dx; - } - } - - y_index += dy; - } - } else { - priority |= 1<<31; // always on! - - for (INT32 y = sy; y < ey; y++) - { - if (y >= 0 && y < nScreenHeight) - { - UINT8 *src = gfx_base + (y_index / 0x10000) * width; - UINT32 *dst = konami_bitmap32 + y * nScreenWidth; - UINT8 *pri = konami_priority_bitmap + y * nScreenWidth; - - for (INT32 x = sx, x_index = x_index_base; x < ex; x++) - { - if (x >= 0 && x < nScreenWidth) { - INT32 pxl = src[x_index>>16]; - - if (pxl) { - if (pxl == shadow_color) { - if ((priority & (1 << (pri[x]&0x1f)))==0 && (pri[x] & 0x80) == 0) { - dst[x] = highlight_mode ? highlight_blend(dst[x]) : shadow_blend(dst[x]); - pri[x] = 0x80; - if (highlight_over_sprites_mode) - pri[x] |= 0x20; - } - } else { - if ((priority & (1 << (pri[x]&0x1f)))==0) { - if (pri[x] & 0x20) { - dst[x] = highlight_mode ? highlight_blend(dst[x]) : shadow_blend(dst[x]);//pal[pxl]; - } else { - dst[x] = pal[pxl]; - } - pri[x] = (pri[x]&0x80)|0x1f; - } - } - } - } - - x_index += dx; - } - } - - y_index += dy; - } - } - } -} diff --git a/jan/src/burn/drv/konami/konamiic.h b/jan/src/burn/drv/konami/konamiic.h deleted file mode 100644 index 8f7a7a96f..000000000 --- a/jan/src/burn/drv/konami/konamiic.h +++ /dev/null @@ -1,501 +0,0 @@ -// konamiic.cpp -//--------------------------------------------------------------------------------------------------------------- -extern UINT32 KonamiIC_K051960InUse; -extern UINT32 KonamiIC_K052109InUse; -extern UINT32 KonamiIC_K051316InUse; -extern UINT32 KonamiIC_K053245InUse; -extern UINT32 KonamiIC_K053247InUse; -extern UINT32 KonamiIC_K053936InUse; -extern UINT32 KonamiIC_K053250InUse; -extern UINT32 KonamiIC_K055555InUse; -extern UINT32 KonamiIC_K054338InUse; -extern UINT32 KonamiIC_K056832InUse; - -extern UINT8 *konami_priority_bitmap; -extern UINT32 *konami_bitmap32; -extern UINT32 *konami_palette32; - -void KonamiClearBitmaps(UINT32 color); -void KonamiBlendCopy(UINT32 *palette); - -void KonamiICReset(); -void KonamiICExit(); -void KonamiICScan(INT32 nAction); - -void konami_sortlayers3( int *layer, int *pri ); -void konami_sortlayers4( int *layer, int *pri ); -void konami_sortlayers5( int *layer, int *pri ); - -void KonamiRecalcPalette(UINT8 *src, UINT32 *dst, INT32 len); - -void konami_rom_deinterleave_2(UINT8 *src, INT32 len); -void konami_rom_deinterleave_4(UINT8 *src, INT32 len); - -// internal -void KonamiAllocateBitmaps(); -void konami_draw_16x16_tile(UINT8 *gfx, INT32 code, INT32 bpp, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy); -void konami_draw_16x16_prio_tile(UINT8 *gfx, INT32 code, INT32 bpp, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, UINT32 priority); -void konami_draw_16x16_zoom_tile(UINT8 *gfx, INT32 code, INT32 bpp, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy); -void konami_draw_16x16_priozoom_tile(UINT8 *gfx, INT32 code, INT32 bpp, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, UINT32 priority); -void konami_render_zoom_shadow_tile(UINT8 *gfx, INT32 code, INT32 bpp, INT32 color, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, UINT32 priority, INT32 shadow); -void konami_set_highlight_mode(INT32 mode); -void konami_set_highlight_over_sprites_mode(INT32 mode); - -// k051960 / k052109 shared -//--------------------------------------------------------------------------------------------------------------- -void K052109_051960_w(INT32 offset, INT32 data); -UINT8 K052109_051960_r(INT32 offset); - -// k051960.cpp -//--------------------------------------------------------------------------------------------------------------- -extern INT32 K051960ReadRoms; -extern INT32 K052109_irq_enabled; -void K051960SpritesRender(INT32 min_priority, INT32 max_priority); -UINT8 K0519060FetchRomData(UINT32 Offset); -UINT8 K051960Read(UINT32 Offset); -void K051960Write(UINT32 Offset, UINT8 Data); -void K051960SetCallback(void (*Callback)(INT32 *Code, INT32 *Colour, INT32 *Priority, INT32 *Shadow)); -void K051960SetSpriteOffset(INT32 x, INT32 y); -void K051960Reset(); -void K051960GfxDecode(UINT8 *src, UINT8 *dst, INT32 len); -void K051960Init(UINT8* pRomSrc, UINT8* pRomSrcExp, UINT32 RomMask); -void K051960Exit(); -void K051960Scan(INT32 nAction); -void K051960SetBpp(INT32 bpp); - -void K051937Write(UINT32 Offset, UINT8 Data); -UINT8 K051937Read(UINT32 Offset); - -// k052109.cpp -//--------------------------------------------------------------------------------------------------------------- -extern INT32 K052109RMRDLine; -extern INT32 K051960_irq_enabled; -extern INT32 K051960_nmi_enabled; -extern INT32 K051960_spriteflip; - -void K052109UpdateScroll(); -void K052109AdjustScroll(INT32 x, INT32 y); - -#define K052109_OPAQUE 0x10000 -#define K052109_CATEGORY(x) (0x100|((x)&0xff)) - -void K052109RenderLayer(INT32 nLayer, INT32 Flags, INT32 Priority); -UINT8 K052109Read(UINT32 Offset); -void K052109Write(UINT32 Offset, UINT8 Data); -void K052109SetCallback(void (*Callback)(INT32 Layer, INT32 Bank, INT32 *Code, INT32 *Colour, INT32 *xFlip, INT32 *priority)); -void K052109Reset(); -void K052109GfxDecode(UINT8 *src, UINT8 *dst, INT32 nLen); -void K052109Init(UINT8 *pRomSrc, UINT8* pRomSrcExp, UINT32 RomMask); -void K052109Exit(); -void K052109Scan(INT32 nAction); - -#define K051960ByteRead(nStartAddress) \ -if (a >= nStartAddress && a <= nStartAddress + 0x3ff) { \ - return K051960Read(a - nStartAddress); \ -} - -#define K051960ByteWrite(nStartAddress) \ -if (a >= nStartAddress && a <= nStartAddress + 0x3ff) { \ - K051960Write((a - nStartAddress), d); \ - return; \ -} - -#define K051960WordWrite(nStartAddress) \ -if (a >= nStartAddress && a <= nStartAddress + 0x3ff) { \ - if (a & 1) { \ - K051960Write((a - nStartAddress) + 1, d & 0xff); \ - } else { \ - K051960Write((a - nStartAddress) + 0, (d >> 8) & 0xff); \ - } \ - return; \ -} - -#define K051937ByteRead(nStartAddress) \ -if (a >= nStartAddress && a <= nStartAddress + 7) { \ - INT32 Offset = (a - nStartAddress); \ - \ - if (Offset == 0) { \ - static INT32 Counter; \ - return (Counter++) & 1; \ - } \ - \ - if (K051960ReadRoms && (Offset >= 0x04 && Offset <= 0x07)) { \ - return K0519060FetchRomData(Offset & 3); \ - } \ - \ - return 0; \ -} - -#define K015937ByteWrite(nStartAddress) \ -if (a >= nStartAddress && a <= nStartAddress + 7) { \ - K051937Write((a - nStartAddress), d); \ - return; \ -} - -#define K052109WordNoA12Read(nStartAddress) \ -if (a >= nStartAddress && a <= nStartAddress + 0x7fff) { \ - INT32 Offset = (a - nStartAddress) >> 1; \ - Offset = ((Offset & 0x3000) >> 1) | (Offset & 0x07ff); \ - \ - if (a & 1) { \ - return K052109Read(Offset + 0x2000); \ - } else { \ - return K052109Read(Offset + 0x0000); \ - } \ -} - - -#define K052109WordNoA12Write(nStartAddress) \ -if (a >= nStartAddress && a <= nStartAddress + 0x7fff) { \ - INT32 Offset = (a - nStartAddress) >> 1; \ - Offset = ((Offset & 0x3000) >> 1) | (Offset & 0x07ff); \ - \ - if (a & 1) { \ - K052109Write(Offset + 0x2000, d); \ - } else { \ - K052109Write(Offset + 0x0000, d); \ - } \ - return; \ -} - - -// K056832.cpp -//--------------------------------------------------------------------------------------------------------------- -#define K056832_LAYER_ALPHA 0x00100000 -#define K056832_LAYER_OPAQUE 0x00400000 -#define K056832_DRAW_FLAG_MIRROR 0x00800000 -#define K056382_DRAW_FLAG_FORCE_XYSCROLL 0x00800000 // same as flag mirror - -#define K056832_SET_ALPHA(x) (K056832_LAYER_ALPHA | ((x)<<8)) - -void K056832Reset(); -void K056832Init(UINT8 *rom, UINT8 *romexp, INT32 rom_size, void (*cb)(INT32 layer, INT32 *code, INT32 *color, INT32 *flags)); -void K056832Exit(); -void K056832Scan(INT32 nAction); -void K056832SetLayerAssociation(INT32 status); -void K056832SetGlobalOffsets(INT32 minx, INT32 miny); -void K056832SetLayerOffsets(INT32 layer, INT32 xoffs, INT32 yoffs); -void K056832SetExtLinescroll(); -INT32 K056832IsIrqEnabled(); -void K056832ReadAvac(INT32 *mode, INT32 *data); -UINT16 K056832ReadRegister(int reg); -INT32 K056832GetLookup(INT32 bits); -void K056832SetTileBank(int bank); -void K056832WordWrite(INT32 offset, UINT16 data); -void K056832ByteWrite(INT32 offset, UINT8 data); -UINT16 K056832RomWordRead(UINT16 offset); -void K056832HalfRamWriteWord(UINT32 offset, UINT16 data); -void K056832HalfRamWriteByte(UINT32 offset, UINT8 data); -UINT16 K056832HalfRamReadWord(UINT32 offset); -UINT8 K056832HalfRamReadByte(UINT32 offset); -void K056832RamWriteWord(UINT32 offset, UINT16 data); -void K056832RamWriteByte(UINT32 offset, UINT8 data); -UINT16 K056832RamReadWord(UINT32 offset); -UINT8 K056832RamReadByte(UINT32 offset); -UINT16 K056832RomWord8000Read(INT32 offset); -void K056832WritebRegsWord(INT32 offset, UINT16 data); -void K056832WritebRegsByte(INT32 offset, UINT8 data); -UINT16 K056832mwRomWordRead(INT32 address); -void K056832Draw(INT32 layer, UINT32 flags, UINT32 priority); -INT32 K056832GetLayerAssociation(); -void K056832Metamorphic_Fixup(); - -// K051316.cpp -//--------------------------------------------------------------------------------------------------------------- -void K051316Init(INT32 chip, UINT8 *gfx, UINT8 *gfxexp, INT32 mask, void (*callback)(INT32 *code,INT32 *color,INT32 *flags), INT32 bpp, INT32 transp); -void K051316Reset(); -void K051316Exit(); - -#define K051316_16BIT (1<<8) - -void K051316RedrawTiles(INT32 chip); - -UINT8 K051316ReadRom(INT32 chip, INT32 offset); -UINT8 K051316Read(INT32 chip, INT32 offset); -void K051316Write(INT32 chip, INT32 offset, INT32 data); - -void K051316WriteCtrl(INT32 chip, INT32 offset, INT32 data); -void K051316WrapEnable(INT32 chip, INT32 status); -void K051316SetOffset(INT32 chip, INT32 xoffs, INT32 yoffs); -void K051316_zoom_draw(INT32 chip, INT32 flags); -void K051316Scan(INT32 nAction); - -// K053245 / k053247 shared -//--------------------------------------------------------------------------------------------------------------- -extern INT32 K05324xZRejection; -void K05324xSetZRejection(INT32 z); - -// K053245.cpp -//--------------------------------------------------------------------------------------------------------------- -INT32 K053245Reset(); -void K053245GfxDecode(UINT8 *src, UINT8 *dst, INT32 len); -void K053245Init(INT32 chip, UINT8 *gfx, UINT8 *gfxexp, INT32 mask, void (*callback)(INT32 *code,INT32 *color,INT32 *priority)); -void K053245Exit(); -void K053245SetBpp(INT32 chip, INT32 bpp); - -void K053245SpritesRender(INT32 chip); - -void K053245SetSpriteOffset(INT32 chip,INT32 offsx, INT32 offsy); -void K053245ClearBuffer(INT32 chip); -void K053245UpdateBuffer(INT32 chip); -void K053244BankSelect(INT32 chip, INT32 bank); - -UINT16 K053245ReadWord(INT32 chip, INT32 offset); -void K053245WriteWord(INT32 chip, INT32 offset, INT32 data); - -UINT8 K053245Read(INT32 chip, INT32 offset); -void K053245Write(INT32 chip, INT32 offset, INT32 data); -UINT8 K053244Read(INT32 chip, INT32 offset); -void K053244Write(INT32 chip, INT32 offset, INT32 data); - -void K053245Scan(INT32 nAction); - -extern UINT8 *K053245Ram[2]; - -// K053251.cpp -//--------------------------------------------------------------------------------------------------------------- -void K053251Reset(); - -void K053251Write(INT32 offset, INT32 data); - -INT32 K053251GetPriority(INT32 idx); -INT32 K053251GetPaletteIndex(INT32 idx); - -void K053251Write(INT32 offset, INT32 data); - -void K053251Scan(INT32 nAction); - -// K053247.cpp -//--------------------------------------------------------------------------------------------------------------- -void K053247Reset(); -void K053247Init(UINT8 *gfxrom, UINT8 *gfxromexp, INT32 gfxlen, void (*Callback)(INT32 *code, INT32 *color, INT32 *priority), INT32 flags); -void K053247Exit(); -void K053247Scan(INT32 nAction); - -void K053247SetBpp(INT32 bpp); - -extern UINT8 *K053247Ram; -extern void (*K053247Callback)(INT32 *code, INT32 *color, INT32 *priority); - -void K053247Export(UINT8 **ram, UINT8 **gfx, void (**callback)(INT32 *, INT32 *, INT32 *), INT32 *dx, INT32 *dy); -void K053247GfxDecode(UINT8 *src, UINT8 *dst, INT32 len); // 16x16 -void K053247SetSpriteOffset(INT32 offsx, INT32 offsy); -void K053247WrapEnable(INT32 status); - -void K053246_set_OBJCHA_line(INT32 state); // 1 assert, 0 clear -INT32 K053246_is_IRQ_enabled(); - -UINT8 K053247Read(INT32 offset); -void K053247Write(INT32 offset, INT32 data); -UINT8 K053246Read(INT32 offset); -void K053246Write(INT32 offset, INT32 data); - -void K053247WriteRegsByte(INT32 offset, UINT8 data); -void K053247WriteRegsWord(INT32 offset, UINT16 data); -UINT16 K053247ReadRegs(INT32 offset); -UINT16 K053246ReadRegs(INT32 offset); - -void K053247SpritesRender(); - -UINT16 K053247ReadWord(INT32 offset); -void K053247WriteWord(INT32 offset, UINT16 data); - -// k054000.cpp -//------------------------------------------------------------------------------------------ -void K054000Reset(); -void K054000Write(INT32 offset, INT32 data); -UINT8 K054000Read(INT32 address); -void K054000Scan(INT32 nAction); - -// K051733.cpp -//------------------------------------------------------------------------------------------ -void K051733Reset(); -void K051733Write(INT32 offset, INT32 data); -UINT8 K051733Read(INT32 offset); -void K051733Scan(INT32 nAction); - -// K053936.cpp -//------------------------------------------------------------------------------------------ - -void K053936Init(INT32 chip, UINT8 *ram, INT32 len, INT32 w, INT32 h, void (*pCallback)(INT32 offset, UINT16 *ram, INT32 *code, INT32 *color, INT32 *sx, INT32 *sy, INT32 *fx, INT32 *fy)); - -void K053936Reset(); -void K053936Exit(); -void K053936Scan(INT32 nAction); - -void K053936EnableWrap(INT32 chip, INT32 status); -void K053936SetOffset(INT32 chip, INT32 xoffs, INT32 yoffs); -void K053936PredrawTiles3(INT32 chip, UINT8 *gfx, INT32 tile_size_x, INT32 tile_size_y, INT32 transparent); -void K053936PredrawTiles2(INT32 chip, UINT8 *gfx); -void K053936PredrawTiles(INT32 chip, UINT8 *gfx, INT32 transparent, INT32 tcol /*transparent color*/); -void K053936Draw(INT32 chip, UINT16 *ctrl, UINT16 *linectrl, INT32 transp); - -extern UINT16 *m_k053936_0_ctrl_16; -extern UINT16 *m_k053936_0_linectrl_16; -extern UINT16 *m_k053936_0_ctrl; -extern UINT16 *m_k053936_0_linectrl; -extern UINT16 *K053936_external_bitmap; - -void K053936GP_set_colorbase(INT32 chip, INT32 color_base); -void K053936GP_enable(int chip, int enable); -void K053936GP_set_offset(int chip, int xoffs, int yoffs); -void K053936GP_clip_enable(int chip, int status); -void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy); -void K053936GP_0_zoom_draw(UINT16 *bitmap, int tilebpp, int blend, int alpha, int pixeldouble_output, UINT16* temp_m_k053936_0_ctrl_16, UINT16* temp_m_k053936_0_linectrl_16,UINT16* temp_m_k053936_0_ctrl, UINT16* temp_m_k053936_0_linectrl); -void K053936GpInit(); -void K053936GPExit(); - -// k053250.cpp -//------------------------------------------------------------------------------------------ - -extern UINT16 *K053250Ram; // allocated in k053250Init - -void K053250Init(INT32 chip, UINT8 *rom, UINT8 *romexp, INT32 size); -void K053250SetOffsets(INT32 chip, int offx, int offy); -void K053250Reset(); -void K053250Scan(INT32 nAction); -void K053250Exit(); - -void K053250Draw(INT32 chip, int colorbase, int flags, int priority); - -UINT16 K053250RegRead(INT32 chip, INT32 offset); -void K053250RegWrite(INT32 chip, INT32 offset, UINT8 data); -UINT16 K053250RomRead(INT32 chip, INT32 offset); - - -// k054338.cpp -//------------------------------------------------------------------------------------------ - -#define K338_REG_BGC_R 0 -#define K338_REG_BGC_GB 1 -#define K338_REG_SHAD1R 2 -#define K338_REG_BRI3 11 -#define K338_REG_PBLEND 13 -#define K338_REG_CONTROL 15 - -#define K338_CTL_KILL 0x01 /* 0 = no video output, 1 = enable */ -#define K338_CTL_MIXPRI 0x02 -#define K338_CTL_SHDPRI 0x04 -#define K338_CTL_BRTPRI 0x08 -#define K338_CTL_WAILSL 0x10 -#define K338_CTL_CLIPSL 0x20 - -void K054338Init(); -void K054338Reset(); -void K054338Exit(); -void K054338Scan(INT32 nAction); -void K054338WriteWord(INT32 offset, UINT16 data); -void K054338WriteByte(INT32 offset, UINT8 data); -INT32 K054338_read_register(int reg); -void K054338_fill_solid_bg(); -void K054338_fill_backcolor(int palette_offset, int mode); -INT32 K054338_set_alpha_level(int pblend); -void K054338_invert_alpha(int invert); -void K054338_update_all_shadows(); -void K054338_export_config(int **shdRGB); - - -// k055555.cpp -//------------------------------------------------------------------------------------------ - -#define K55_PALBASE_BG 0 // background palette -#define K55_CONTROL 1 // control register -#define K55_COLSEL_0 2 // layer A, B color depth -#define K55_COLSEL_1 3 // layer C, D color depth -#define K55_COLSEL_2 4 // object, S1 color depth -#define K55_COLSEL_3 5 // S2, S3 color depth - -#define K55_PRIINP_0 7 // layer A pri 0 -#define K55_PRIINP_1 8 // layer A pri 1 -#define K55_PRIINP_2 9 // layer A "COLPRI" -#define K55_PRIINP_3 10 // layer B pri 0 -#define K55_PRIINP_4 11 // layer B pri 1 -#define K55_PRIINP_5 12 // layer B "COLPRI" -#define K55_PRIINP_6 13 // layer C pri -#define K55_PRIINP_7 14 // layer D pri -#define K55_PRIINP_8 15 // OBJ pri -#define K55_PRIINP_9 16 // sub 1 (GP:PSAC) pri -#define K55_PRIINP_10 17 // sub 2 (GX:PSAC) pri -#define K55_PRIINP_11 18 // sub 3 pri - -#define K55_OINPRI_ON 19 // object priority bits selector - -#define K55_PALBASE_A 23 // layer A palette -#define K55_PALBASE_B 24 // layer B palette -#define K55_PALBASE_C 25 // layer C palette -#define K55_PALBASE_D 26 // layer D palette -#define K55_PALBASE_OBJ 27 // OBJ palette -#define K55_PALBASE_SUB1 28 // SUB1 palette -#define K55_PALBASE_SUB2 29 // SUB2 palette -#define K55_PALBASE_SUB3 30 // SUB3 palette - -#define K55_BLEND_ENABLES 33 // blend enables for tilemaps -#define K55_VINMIX_ON 34 // additional blend enables for tilemaps -#define K55_OSBLEND_ENABLES 35 // obj/sub blend enables -#define K55_OSBLEND_ON 36 // not sure, related to obj/sub blend - -#define K55_SHAD1_PRI 37 // shadow/highlight 1 priority -#define K55_SHAD2_PRI 38 // shadow/highlight 2 priority -#define K55_SHAD3_PRI 39 // shadow/highlight 3 priority -#define K55_SHD_ON 40 // shadow/highlight -#define K55_SHD_PRI_SEL 41 // shadow/highlight - -#define K55_VBRI 42 // VRAM layer brightness enable -#define K55_OSBRI 43 // obj/sub brightness enable, part 1 -#define K55_OSBRI_ON 44 // obj/sub brightness enable, part 2 -#define K55_INPUT_ENABLES 45 // input enables - -/* bit masks for the control register */ -#define K55_CTL_GRADDIR 0x01 // 0=vertical, 1=horizontal -#define K55_CTL_GRADENABLE 0x02 // 0=BG is base color only, 1=gradient -#define K55_CTL_FLIPPRI 0x04 // 0=standard Konami priority, 1=reverse -#define K55_CTL_SDSEL 0x08 // 0=normal shadow timing, 1=(not used by GX) - -/* bit masks for the input enables */ -#define K55_INP_VRAM_A 0x01 -#define K55_INP_VRAM_B 0x02 -#define K55_INP_VRAM_C 0x04 -#define K55_INP_VRAM_D 0x08 -#define K55_INP_OBJ 0x10 -#define K55_INP_SUB1 0x20 -#define K55_INP_SUB2 0x40 -#define K55_INP_SUB3 0x80 - -#define K055555_COLORMASK 0x0000ffff -#define K055555_MIXSHIFT 16 -#define K055555_BRTSHIFT 18 -#define K055555_SKIPSHADOW 0x40000000 -#define K055555_FULLSHADOW 0x80000000 - -extern INT32 K055555_enabled; -void K055555WriteReg(UINT8 regnum, UINT8 regdat); -void K055555LongWrite(INT32 offset, UINT32 data); // not implimented -void K055555WordWrite(INT32 offset, UINT16 data); -void K055555ByteWrite(INT32 offset, UINT8 data); -INT32 K055555ReadRegister(INT32 regnum); -INT32 K055555GetPaletteIndex(INT32 idx); -void K055555Reset(); -void K055555Init(); -void K055555Exit(); -void K055555Scan(INT32 nAction); - - -// konamigx.cpp -#define GXMIX_BLEND_AUTO 0 // emulate all blend effects -#define GXMIX_BLEND_NONE 1 // disable all blend effects -#define GXMIX_BLEND_FAST 2 // simulate translucency -#define GXMIX_BLEND_FORCE 3 // force mix code on selected layer(s) -#define GXMIX_NOLINESCROLL 0x1000 // disable linescroll on selected layer(s) -#define GXMIX_NOSHADOW 0x10000000 // disable all shadows (shadow pens will be skipped) -#define GXMIX_NOZBUF 0x20000000 // disable z-buffering (shadow pens will be drawn as solid) - -// Sub Layer Flags -#define GXSUB_K053250 0x10 // chip type: 0=K053936 ROZ+, 1=K053250 LVC -#define GXSUB_4BPP 0x04 // 16 colors -#define GXSUB_5BPP 0x05 // 32 colors -#define GXSUB_8BPP 0x08 // 256 colors - -void konamigx_mixer_init(int objdma); -void konamigx_mixer_exit(); -void konamigx_mixer_primode(int mode); -void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extra tilemap 2*/, int sub2flags, int mixerflags, int extra_bitmap /*extra tilemap 3*/, int rushingheroes_hack); diff --git a/jan/src/burn/drv/konami/timeplt_snd.cpp b/jan/src/burn/drv/konami/timeplt_snd.cpp deleted file mode 100644 index 385a1ed96..000000000 --- a/jan/src/burn/drv/konami/timeplt_snd.cpp +++ /dev/null @@ -1,241 +0,0 @@ -// Time pilot, pooyan, rallyx, tutankhm, and rocnrope sound -// Based on MAME driver by Nicola Salmoria - -#include "burnint.h" -#include "z80_intf.h" -#include "flt_rc.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 soundlatch; -static UINT8 *z80rom; -static UINT8 *z80ram; -static INT32 z80_select = 0; -static INT32 locomotnmode = 0; - -static void filter_write(INT32 num, UINT8 d) -{ - INT32 C = 0; - if (d & 1) C += 220000; /* 220000pF = 0.220uF */ - if (d & 2) C += 47000; /* 47000pF = 0.047uF */ - filter_rc_set_RC(num, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(C)); -} - -static void __fastcall timeplt_sound_write(UINT16 address, UINT8 data) -{ - //bprintf(0, _T("tpsw %X %X\n"), address, data); - if (!locomotnmode && address >= 0x8000 /*&& address <= 0xffff*/) { - INT32 Offset = address & 0xfff; - filter_write(3, (Offset >> 0) & 3); - filter_write(4, (Offset >> 2) & 3); - filter_write(5, (Offset >> 4) & 3); - filter_write(0, (Offset >> 6) & 3); - filter_write(1, (Offset >> 8) & 3); - filter_write(2, (Offset >> 10) & 3); - return; - } - - if (locomotnmode && address >= 0x3000 && address <= 0x3fff) { - INT32 Offset = address & 0xfff; - filter_write(3, (Offset >> 0) & 3); - filter_write(4, (Offset >> 2) & 3); - filter_write(5, (Offset >> 4) & 3); - filter_write(0, (Offset >> 6) & 3); - filter_write(1, (Offset >> 8) & 3); - filter_write(2, (Offset >> 10) & 3); - return; - } - - switch (address & 0xf000) - { - case 0x4000: - AY8910Write(0, 1, data); - return; - - case 0x5000: - AY8910Write(0, 0, data); - return; - - case 0x6000: - AY8910Write(1, 1, data); - return; - - case 0x7000: - AY8910Write(1, 0, data); - return; - } -} - -static UINT8 __fastcall timeplt_sound_read(UINT16 address) -{ - switch (address & 0xf000) - { - case 0x4000: - return AY8910Read(0); - - case 0x6000: - return AY8910Read(1); - } - - return 0; -} - -static UINT8 AY8910_0_portA(UINT32) -{ - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; -} - -static UINT8 AY8910_0_portB(UINT32) -{ - static const int timeplt_timer[10] = { - 0x00, 0x10, 0x20, 0x30, 0x40, 0x90, 0xa0, 0xb0, 0xa0, 0xd0 - }; - - return timeplt_timer[(ZetTotalCycles() >> 9) % 10]; -} - -void TimepltSndSoundlatch(UINT8 data) -{ - soundlatch = data; -} - -void TimepltSndReset() -{ - ZetOpen(z80_select); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - soundlatch = 0; -} - -void TimepltSndInit(UINT8 *rom, UINT8 *ram, INT32 z80number) -{ - z80rom = rom; - z80ram = ram; - z80_select = z80number; - - ZetInit(z80_select); - ZetOpen(z80_select); - ZetMapMemory(z80rom, 0x0000, 0x2fff, MAP_ROM); - ZetMapMemory(z80ram, 0x3000, 0x33ff, MAP_RAM); - ZetMapMemory(z80ram, 0x3400, 0x37ff, MAP_RAM); - ZetMapMemory(z80ram, 0x3800, 0x3bff, MAP_RAM); - ZetMapMemory(z80ram, 0x3c00, 0x3fff, MAP_RAM); - ZetSetWriteHandler(timeplt_sound_write); - ZetSetReadHandler(timeplt_sound_read); - ZetClose(); - - AY8910Init(0, 1789772, nBurnSoundRate, &AY8910_0_portA, &AY8910_0_portB, NULL, NULL); - AY8910Init(1, 1789772, nBurnSoundRate,NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.60, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.60, BURN_SND_ROUTE_BOTH); - - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(3, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - - filter_rc_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, 1.00, BURN_SND_ROUTE_BOTH); - locomotnmode = 0; -} - -void LocomotnSndInit(UINT8 *rom, UINT8 *ram, INT32 z80number) -{ - z80rom = rom; - z80ram = ram; - z80_select = z80number; - - ZetInit(z80_select); - ZetOpen(z80_select); - ZetMapMemory(z80rom, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(z80ram, 0x2000, 0x23ff, MAP_RAM); - ZetMapMemory(z80ram, 0x2400, 0x27ff, MAP_RAM); - ZetMapMemory(z80ram, 0x2800, 0x2bff, MAP_RAM); - ZetMapMemory(z80ram, 0x2c00, 0x2fff, MAP_RAM); - ZetSetWriteHandler(timeplt_sound_write); - ZetSetReadHandler(timeplt_sound_read); - ZetClose(); - - AY8910Init(0, 1789772, nBurnSoundRate, &AY8910_0_portA, &AY8910_0_portB, NULL, NULL); - AY8910Init(1, 1789772, nBurnSoundRate,NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.60, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.60, BURN_SND_ROUTE_BOTH); - - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(3, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - - filter_rc_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, 1.00, BURN_SND_ROUTE_BOTH); - locomotnmode = 1; -} - -void TimepltSndVol(double vol0, double vol1) -{ - filter_rc_set_route(0, vol0, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, vol0, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, vol0, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, vol1, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, vol1, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, vol1, BURN_SND_ROUTE_BOTH); -} - -void TimepltSndExit() -{ - if (z80_select == 0) ZetExit(); - - AY8910Exit(0); - AY8910Exit(1); - filter_rc_exit(); - - z80_select = 0; - z80rom = NULL; - z80ram = NULL; - locomotnmode = 0; -} - -void TimepltSndUpdate(INT16 **pAY8910Buffer, INT16 *pSoundBuf, INT32 nSegmentLength) -{ - if (nSegmentLength <= 0) return; - - AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); - AY8910Update(1, &pAY8910Buffer[3], nSegmentLength); - - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - filter_rc_update(3, pAY8910Buffer[3], pSoundBuf, nSegmentLength); - filter_rc_update(4, pAY8910Buffer[4], pSoundBuf, nSegmentLength); - filter_rc_update(5, pAY8910Buffer[5], pSoundBuf, nSegmentLength); -} - -INT32 TimepltSndScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_VOLATILE) { - if (z80_select == 0) ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(soundlatch); - } - - return 0; -} diff --git a/jan/src/burn/drv/konami/timeplt_snd.h b/jan/src/burn/drv/konami/timeplt_snd.h deleted file mode 100644 index cc796374d..000000000 --- a/jan/src/burn/drv/konami/timeplt_snd.h +++ /dev/null @@ -1,8 +0,0 @@ -void TimepltSndSoundlatch(UINT8 data); -void TimepltSndReset(); -void TimepltSndInit(UINT8 *rom, UINT8 *ram, INT32 z80number); -void LocomotnSndInit(UINT8 *rom, UINT8 *ram, INT32 z80number); -void TimepltSndVol(double vol0, double vol1); -void TimepltSndExit(); -void TimepltSndUpdate(INT16 **pAY8910Buffer, INT16 *pSoundBuf, INT32 nSegmentLength); -INT32 TimepltSndScan(INT32 nAction, INT32 *pnMin); diff --git a/jan/src/burn/drv/megadrive/d_megadrive.cpp b/jan/src/burn/drv/megadrive/d_megadrive.cpp deleted file mode 100644 index f20bb020a..000000000 --- a/jan/src/burn/drv/megadrive/d_megadrive.cpp +++ /dev/null @@ -1,41418 +0,0 @@ -#include "burnint.h" -#include "megadrive.h" - -// Driver generated by database on http://www.barryharris.me.uk - -static struct BurnInputInfo MegadriveInputList[] = { - {"P1 Start", BIT_DIGITAL, MegadriveJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, MegadriveJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, MegadriveJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, MegadriveJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, MegadriveJoy1 + 3, "p1 right" }, - {"P1 Button A", BIT_DIGITAL, MegadriveJoy1 + 6, "p1 fire 1" }, - {"P1 Button B", BIT_DIGITAL, MegadriveJoy1 + 4, "p1 fire 2" }, - {"P1 Button C", BIT_DIGITAL, MegadriveJoy1 + 5, "p1 fire 3" }, - {"P1 Button X", BIT_DIGITAL, MegadriveJoy1 + 10, "p1 fire 4" }, - {"P1 Button Y", BIT_DIGITAL, MegadriveJoy1 + 9, "p1 fire 5" }, - {"P1 Button Z", BIT_DIGITAL, MegadriveJoy1 + 8, "p1 fire 6" }, - {"P1 Mode", BIT_DIGITAL, MegadriveJoy1 + 11, "p1 select" }, - - {"P2 Start", BIT_DIGITAL, MegadriveJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, MegadriveJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, MegadriveJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, MegadriveJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, MegadriveJoy2 + 3, "p2 right" }, - {"P2 Button A", BIT_DIGITAL, MegadriveJoy2 + 6, "p2 fire 1" }, - {"P2 Button B", BIT_DIGITAL, MegadriveJoy2 + 4, "p2 fire 2" }, - {"P2 Button C", BIT_DIGITAL, MegadriveJoy2 + 5, "p2 fire 3" }, - {"P2 Button X", BIT_DIGITAL, MegadriveJoy2 + 10, "p2 fire 4" }, - {"P2 Button Y", BIT_DIGITAL, MegadriveJoy2 + 9, "p2 fire 5" }, - {"P2 Button Z", BIT_DIGITAL, MegadriveJoy2 + 8, "p2 fire 6" }, - {"P2 Mode", BIT_DIGITAL, MegadriveJoy2 + 11, "p2 select" }, - - {"Reset", BIT_DIGITAL, &MegadriveReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, MegadriveDIP + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, MegadriveDIP + 1, "dip" }, -}; - -STDINPUTINFO(Megadrive) - -static struct BurnInputInfo Megadrive4pInputList[] = { - {"P1 Start", BIT_DIGITAL, MegadriveJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, MegadriveJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, MegadriveJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, MegadriveJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, MegadriveJoy1 + 3, "p1 right" }, - {"P1 Button A", BIT_DIGITAL, MegadriveJoy1 + 6, "p1 fire 1" }, - {"P1 Button B", BIT_DIGITAL, MegadriveJoy1 + 4, "p1 fire 2" }, - {"P1 Button C", BIT_DIGITAL, MegadriveJoy1 + 5, "p1 fire 3" }, - {"P1 Button X", BIT_DIGITAL, MegadriveJoy1 + 10, "p1 fire 4" }, - {"P1 Button Y", BIT_DIGITAL, MegadriveJoy1 + 9, "p1 fire 5" }, - {"P1 Button Z", BIT_DIGITAL, MegadriveJoy1 + 8, "p1 fire 6" }, - {"P1 Mode", BIT_DIGITAL, MegadriveJoy1 + 11, "p1 select" }, - - {"P2 Start", BIT_DIGITAL, MegadriveJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, MegadriveJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, MegadriveJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, MegadriveJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, MegadriveJoy2 + 3, "p2 right" }, - {"P2 Button A", BIT_DIGITAL, MegadriveJoy2 + 6, "p2 fire 1" }, - {"P2 Button B", BIT_DIGITAL, MegadriveJoy2 + 4, "p2 fire 2" }, - {"P2 Button C", BIT_DIGITAL, MegadriveJoy2 + 5, "p2 fire 3" }, - {"P2 Button X", BIT_DIGITAL, MegadriveJoy2 + 10, "p2 fire 4" }, - {"P2 Button Y", BIT_DIGITAL, MegadriveJoy2 + 9, "p2 fire 5" }, - {"P2 Button Z", BIT_DIGITAL, MegadriveJoy2 + 8, "p2 fire 6" }, - {"P2 Mode", BIT_DIGITAL, MegadriveJoy2 + 11, "p2 select" }, - - {"P3 Start", BIT_DIGITAL, MegadriveJoy3 + 7, "p3 start" }, - {"P3 Up", BIT_DIGITAL, MegadriveJoy3 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, MegadriveJoy3 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, MegadriveJoy3 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, MegadriveJoy3 + 3, "p3 right" }, - {"P3 Button A", BIT_DIGITAL, MegadriveJoy3 + 6, "p3 fire 1" }, - {"P3 Button B", BIT_DIGITAL, MegadriveJoy3 + 4, "p3 fire 2" }, - {"P3 Button C", BIT_DIGITAL, MegadriveJoy3 + 5, "p3 fire 3" }, - {"P3 Button X", BIT_DIGITAL, MegadriveJoy3 + 10, "p3 fire 4" }, - {"P3 Button Y", BIT_DIGITAL, MegadriveJoy3 + 9, "p3 fire 5" }, - {"P3 Button Z", BIT_DIGITAL, MegadriveJoy3 + 8, "p3 fire 6" }, - {"P3 Mode", BIT_DIGITAL, MegadriveJoy3 + 11, "p3 select" }, - - {"P4 Start", BIT_DIGITAL, MegadriveJoy4 + 7, "p4 start" }, - {"P4 Up", BIT_DIGITAL, MegadriveJoy4 + 0, "p4 up" }, - {"P4 Down", BIT_DIGITAL, MegadriveJoy4 + 1, "p4 down" }, - {"P4 Left", BIT_DIGITAL, MegadriveJoy4 + 2, "p4 left" }, - {"P4 Right", BIT_DIGITAL, MegadriveJoy4 + 3, "p4 right" }, - {"P4 Button A", BIT_DIGITAL, MegadriveJoy4 + 6, "p4 fire 1" }, - {"P4 Button B", BIT_DIGITAL, MegadriveJoy4 + 4, "p4 fire 2" }, - {"P4 Button C", BIT_DIGITAL, MegadriveJoy4 + 5, "p4 fire 3" }, - {"P4 Button X", BIT_DIGITAL, MegadriveJoy4 + 10, "p4 fire 4" }, - {"P4 Button Y", BIT_DIGITAL, MegadriveJoy4 + 9, "p4 fire 5" }, - {"P4 Button Z", BIT_DIGITAL, MegadriveJoy4 + 8, "p4 fire 6" }, - {"P4 Mode", BIT_DIGITAL, MegadriveJoy4 + 11, "p4 select" }, - - {"Reset", BIT_DIGITAL, &MegadriveReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, MegadriveDIP + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, MegadriveDIP + 1, "dip" }, -}; - -STDINPUTINFO(Megadrive4p) - -static struct BurnDIPInfo MegadriveDIPList[] = { - {0x1a, 0xff, 0xff, 0x01, NULL }, - - {0, 0xfe, 0, 5, "Hardware" }, - {0x19, 0x01, 0xc1, 0x01, "Auto Detect" }, - {0x19, 0x01, 0xc1, 0x00, "Japan NTSC" }, - {0x19, 0x01, 0xc1, 0x40, "Japan PAL" }, - {0x19, 0x01, 0xc1, 0x80, "USA" }, - {0x19, 0x01, 0xc1, 0xc0, "Europe" }, - - {0, 0xfe, 0, 2, "CD-ROM" }, - {0x19, 0x01, 0x20, 0x20, "No" }, - {0x19, 0x01, 0x20, 0x00, "Yes" }, - - {0, 0xfe, 0, 3, "32-Col Mode Draw" }, - {0x1a, 0x01, 0x03, 0x00, "No Change" }, - {0x1a, 0x01, 0x03, 0x01, "Center" }, - {0x1a, 0x01, 0x03, 0x02, "Inner Zoom" }, -}; - -static struct BurnDIPInfo AutoDetectRegionDIPList[] = { - {0x19, 0xff, 0xff, 0x21, NULL}, -}; - -static struct BurnDIPInfo PALRegionDIPList[] = { - {0x19, 0xff, 0xff, 0xe0, NULL}, -}; - -static struct BurnDIPInfo JNTSCRegionDIPList[] = { - {0x19, 0xff, 0xff, 0x20, NULL}, -}; - -static struct BurnDIPInfo Megadrive4pDIPList[] = { - {0x32, 0xff, 0xff, 0x01, NULL }, - - {0, 0xfe, 0, 5, "Hardware" }, - {0x31, 0x01, 0xc1, 0x01, "Auto Detect" }, - {0x31, 0x01, 0xc1, 0x00, "Japan NTSC" }, - {0x31, 0x01, 0xc1, 0x40, "Japan PAL" }, - {0x31, 0x01, 0xc1, 0x80, "USA" }, - {0x31, 0x01, 0xc1, 0xc0, "Europe" }, - - {0, 0xfe, 0, 2, "CD-ROM" }, - {0x31, 0x01, 0x20, 0x20, "No" }, - {0x31, 0x01, 0x20, 0x00, "Yes" }, - - {0, 0xfe, 0, 3, "32-Col Mode Draw" }, - {0x32, 0x01, 0x03, 0x00, "No Change" }, - {0x32, 0x01, 0x03, 0x01, "Center" }, - {0x32, 0x01, 0x03, 0x02, "Inner Zoom" }, -}; - -static struct BurnDIPInfo AutoDetectRegion4pDIPList[] = { - {0x31, 0xff, 0xff, 0x21, NULL}, -}; - -STDDIPINFOEXT(Megadrive, AutoDetectRegion, Megadrive) -STDDIPINFOEXT(MegadrivePAL, PALRegion, Megadrive) -STDDIPINFOEXT(MegadriveJNTSC, JNTSCRegion, Megadrive) -STDDIPINFOEXT(Megadrive4p, AutoDetectRegion4p, Megadrive4p) - -INT32 MegadriveGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = BurnDrvGetTextA(DRV_NAME); - } else { - pszGameName = BurnDrvGetTextA(DRV_PARENT); - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - - // remove the "md_" - for (UINT32 j = 0; j < strlen(pszGameName); j++) { - szFilename[j] = pszGameName[j + 3]; - } - - *pszName = szFilename; - - return 0; -} - -// F-22 Interceptor (Euro, USA, 199109) -static struct BurnRomInfo md_f22aRomDesc[] = { - { "f-22_intercept_f-202-4.u1", 0x080000, 0x649771f8, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, - { "f-22_intercept_f-202-1.u2", 0x020000, 0xd3d7cbb8, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_080000 }, -}; - -STD_ROM_PICK(md_f22a) -STD_ROM_FN(md_f22a) - -struct BurnDriver BurnDrvmd_f22a = { - "md_f22a", "md_f22", NULL, NULL, "1991", - "F-22 Interceptor (Euro, USA, 199109)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f22aRomInfo, md_f22aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA 97 Gold Edition (Euro, USA) -static struct BurnRomInfo md_fifa97RomDesc[] = { - { "fifa_97_b1", 0x200000, 0x2bedb061, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa97) -STD_ROM_FN(md_fifa97) - -struct BurnDriver BurnDrvmd_fifa97 = { - "md_fifa97", NULL, NULL, NULL, "1996", - "FIFA 97 Gold Edition (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fifa97RomInfo, md_fifa97RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// James Bond 007 - The Duel (Euro, Rev. A) -static struct BurnRomInfo md_jb007RomDesc[] = { - { "mpr-15312a", 0x080000, 0x66635364, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jb007) -STD_ROM_FN(md_jb007) - -struct BurnDriver BurnDrvmd_jb007 = { - "md_jb007", NULL, NULL, NULL, "1992", - "James Bond 007 - The Duel (Euro, Rev. A)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jb007RomInfo, md_jb007RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// James Pond - Underwater Agent (Euro, USA) -static struct BurnRomInfo md_jpondRomDesc[] = { - { "james_pond_u1_jam03", 0x080000, 0xd0e7b466, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jpond) -STD_ROM_FN(md_jpond) - -struct BurnDriver BurnDrvmd_jpond = { - "md_jpond", NULL, NULL, NULL, "1993", - "James Pond - Underwater Agent (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jpondRomInfo, md_jpondRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// James Pond II - Codename RoboCod (Euro, USA) -static struct BurnRomInfo md_robocodRomDesc[] = { - { "pond_ii_robocod_ro_b02", 0x080000, 0xc32b5d66, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_robocod) -STD_ROM_FN(md_robocod) - -struct BurnDriver BurnDrvmd_robocod = { - "md_robocod", NULL, NULL, NULL, "1991", - "James Pond II - Codename RoboCod (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robocodRomInfo, md_robocodRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lotus Turbo Challenge (Euro, USA) -static struct BurnRomInfo md_lotustRomDesc[] = { - { "lotus_turbo_lot03.u1", 0x100000, 0xb83ccb7a, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lotust) -STD_ROM_FN(md_lotust) - -struct BurnDriver BurnDrvmd_lotust = { - "md_lotust", NULL, NULL, NULL, "1992", - "Lotus Turbo Challenge (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lotustRomInfo, md_lotustRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL '94 (Euro, USA) -static struct BurnRomInfo md_nhl94RomDesc[] = { - { "nhl94_hl9402", 0x100000, 0xacecd225, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhl94) -STD_ROM_FN(md_nhl94) - -struct BurnDriver BurnDrvmd_nhl94 = { - "md_nhl94", NULL, NULL, NULL, "1993", - "NHL '94 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhl94RomInfo, md_nhl94RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// PGA Tour Golf II (Euro, USA) -static struct BurnRomInfo md_pga2aRomDesc[] = { - { "pga_tour_golf_pgt04", 0x100000, 0x8d980bb4, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pga2a) -STD_ROM_FN(md_pga2a) - -struct BurnDriver BurnDrvmd_pga2a = { - "md_pga2a", "md_pga2", NULL, NULL, "1992", - "PGA Tour Golf II (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pga2aRomInfo, md_pga2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rise of the Robots (Euro) -static struct BurnRomInfo md_riseroboRomDesc[] = { - { "es133-1_rise_of_the_robots.u1", 0x200000, 0xed583ef7, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, - { "es133-2_rise_of_the_robots.u2", 0x100000, 0xfcf18470, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_200000 }, -}; - -STD_ROM_PICK(md_riserobo) -STD_ROM_FN(md_riserobo) - -struct BurnDriver BurnDrvmd_riserobo = { - "md_riserobo", NULL, NULL, NULL, "1994", - "Rise of the Robots (Euro)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_riseroboRomInfo, md_riseroboRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Splatterhouse Part 2 (Jpn) -static struct BurnRomInfo md_splatth2jRomDesc[] = { - { "sh2j", 0x100000, 0xadbd991b, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_splatth2j) -STD_ROM_FN(md_splatth2j) - -struct BurnDriver BurnDrvmd_splatth2j = { - "md_splatth2j", "md_splatth2", NULL, NULL, "1992", - "Splatterhouse Part 2 (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_splatth2jRomInfo, md_splatth2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zero Tolerance (Euro, USA) -static struct BurnRomInfo md_zerotolRomDesc[] = { - { "zetsg_lo_7500-00034a.u2", 0x100000, 0xb9c2d518, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_000000 }, - { "zetsg_hi_7500-00033a.u1", 0x100000, 0xaf362b8c, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_000001 }, -}; - -STD_ROM_PICK(md_zerotol) -STD_ROM_FN(md_zerotol) - -struct BurnDriver BurnDrvmd_zerotol = { - "md_zerotol", NULL, NULL, NULL, "1994", - "Zero Tolerance (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zerotolRomInfo, md_zerotolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Euro) -static struct BurnRomInfo md_advbatrRomDesc[] = { - { "mpr-18019.ic1", 0x200000, 0x355e8c39, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatr) -STD_ROM_FN(md_advbatr) - -struct BurnDriver BurnDrvmd_advbatr = { - "md_advbatr", NULL, NULL, NULL, "1995", - "The Adventures of Batman & Robin (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrRomInfo, md_advbatrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Mighty Max (Euro) -static struct BurnRomInfo md_mightmaxRomDesc[] = { - { "mpr-17434.ic1", 0x100000, 0x24f1a3bb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mightmax) -STD_ROM_FN(md_mightmax) - -struct BurnDriver BurnDrvmd_mightmax = { - "md_mightmax", NULL, NULL, NULL, "1994", - "The Adventures of Mighty Max (Euro)\0", NULL, "Ocean", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mightmaxRomInfo, md_mightmaxRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alex Kidd in the Enchanted Castle (Euro, Rev. A) -static struct BurnRomInfo md_alexkiddRomDesc[] = { - { "mpr-12608a.ic1", 0x040000, 0x778a0f00, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alexkidd) -STD_ROM_FN(md_alexkidd) - -struct BurnDriver BurnDrvmd_alexkidd = { - "md_alexkidd", NULL, NULL, NULL, "1990", - "Alex Kidd in the Enchanted Castle (Euro, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alexkiddRomInfo, md_alexkiddRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alisia Dragoon (Euro) -static struct BurnRomInfo md_alisiadRomDesc[] = { - { "mpr-14680.ic1", 0x100000, 0x28165bd1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alisiad) -STD_ROM_FN(md_alisiad) - -struct BurnDriver BurnDrvmd_alisiad = { - "md_alisiad", NULL, NULL, NULL, "1992", - "Alisia Dragoon (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alisiadRomInfo, md_alisiadRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Andre Agassi Tennis (Euro) -static struct BurnRomInfo md_agassiRomDesc[] = { - { "mpr-15488.ic1", 0x080000, 0x224256c7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_agassi) -STD_ROM_FN(md_agassi) - -struct BurnDriver BurnDrvmd_agassi = { - "md_agassi", NULL, NULL, NULL, "1992", - "Andre Agassi Tennis (Euro)\0", NULL, "TecMagik", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_agassiRomInfo, md_agassiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Another World (Euro) -static struct BurnRomInfo md_anotherwRomDesc[] = { - { "mpr-15498.ic1", 0x100000, 0xe9742041, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_anotherw) -STD_ROM_FN(md_anotherw) - -struct BurnDriver BurnDrvmd_anotherw = { - "md_anotherw", NULL, NULL, NULL, "1993", - "Another World (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_anotherwRomInfo, md_anotherwRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Arcade Classics (Euro, USA) -static struct BurnRomInfo md_arcadeclRomDesc[] = { - { "mpr-18815.ic1", 0x080000, 0x8aed2090, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_arcadecl) -STD_ROM_FN(md_arcadecl) - -struct BurnDriver BurnDrvmd_arcadecl = { - "md_arcadecl", NULL, NULL, NULL, "1996", - "Arcade Classics (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arcadeclRomInfo, md_arcadeclRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Art Alive (World) -static struct BurnRomInfo md_artaliveRomDesc[] = { - { "mpr-14384.ic1", 0x020000, 0xf1b72cdd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_artalive) -STD_ROM_FN(md_artalive) - -struct BurnDriver BurnDrvmd_artalive = { - "md_artalive", NULL, NULL, NULL, "1991", - "Art Alive (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_artaliveRomInfo, md_artaliveRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage (Euro, USA, Rev. A) ~ Bare Knuckle - Ikari no Tetsuken (Jpn, Rev. A) -static struct BurnRomInfo md_sorRomDesc[] = { - { "mpr-14125a.ic1", 0x080000, 0x4052e845, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor) -STD_ROM_FN(md_sor) - -struct BurnDriver BurnDrvmd_sor = { - "md_sor", NULL, NULL, NULL, "1991", - "Streets of Rage (Euro, USA, Rev. A) ~ Bare Knuckle - Ikari no Tetsuken (Jpn, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sorRomInfo, md_sorRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage (Euro, USA) ~ Bare Knuckle - Ikari no Tetsuken (Jpn) -static struct BurnRomInfo md_soraRomDesc[] = { - { "mpr-14125.ic1", 0x080000, 0xbff227c6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sora) -STD_ROM_FN(md_sora) - -struct BurnDriver BurnDrvmd_sora = { - "md_sora", "md_sor", NULL, NULL, "1991", - "Streets of Rage (Euro, USA) ~ Bare Knuckle - Ikari no Tetsuken (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_soraRomInfo, md_soraRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Batman (Euro) -static struct BurnRomInfo md_batmanRomDesc[] = { - { "mpr-14561.ic1", 0x080000, 0x61c60c35, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_batman) -STD_ROM_FN(md_batman) - -struct BurnDriver BurnDrvmd_batman = { - "md_batman", NULL, NULL, NULL, "1990", - "Batman (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_batmanRomInfo, md_batmanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ferrari Grand Prix Challenge (Euro, Rev. A) -static struct BurnRomInfo md_ferrariRomDesc[] = { - { "mpr-14770a.ic1", 0x100000, 0x250111df, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ferrari) -STD_ROM_FN(md_ferrari) - -struct BurnDriver BurnDrvmd_ferrari = { - "md_ferrari", NULL, NULL, NULL, "1992", - "Ferrari Grand Prix Challenge (Euro, Rev. A)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ferrariRomInfo, md_ferrariRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Game Toshokan (Jpn, Rev. A) -static struct BurnRomInfo md_gametoRomDesc[] = { - { "mpr-12750a.ic1", 0x020000, 0xc185c819, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gameto) -STD_ROM_FN(md_gameto) - -struct BurnDriver BurnDrvmd_gameto = { - "md_gameto", NULL, NULL, NULL, "1990", - "Game Toshokan (Jpn, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_gametoRomInfo, md_gametoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ghouls'n Ghosts (Euro, USA, Kor, Rev. A) -static struct BurnRomInfo md_ghoulsRomDesc[] = { - { "mpr-12605a t04.ic1", 0x020000, 0xd367c3cc, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, - { "mpr-12606a w57.ic2", 0x080000, 0x5291d097, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL_CONTINUE_020000_080000 | SEGA_MD_ROM_OFFS_080000 }, -}; - -STD_ROM_PICK(md_ghouls) -STD_ROM_FN(md_ghouls) - -struct BurnDriver BurnDrvmd_ghouls = { - "md_ghouls", NULL, NULL, NULL, "1989", - "Ghouls'n Ghosts (Euro, USA, Kor, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ghoulsRomInfo, md_ghoulsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ghouls'n Ghosts (Euro, USA) -static struct BurnRomInfo md_ghouls1RomDesc[] = { - { "mpr-12605 t02.ic1", 0x020000, 0x1066c6ab, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, - { "mpr-12606 r32.ic2", 0x080000, 0xd0be7777, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL_CONTINUE_020000_080000 | SEGA_MD_ROM_OFFS_080000 }, -}; - -STD_ROM_PICK(md_ghouls1) -STD_ROM_FN(md_ghouls1) - -struct BurnDriver BurnDrvmd_ghouls1 = { - "md_ghouls1", "md_ghouls", NULL, NULL, "1989", - "Ghouls'n Ghosts (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ghouls1RomInfo, md_ghouls1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Greatest Heavyweights (Euro) -static struct BurnRomInfo md_ghwRomDesc[] = { - { "mpr-16211.ic1", 0x200000, 0x9778c181, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ghw) -STD_ROM_FN(md_ghw) - -struct BurnDriver BurnDrvmd_ghw = { - "md_ghw", NULL, NULL, NULL, "1994", - "Greatest Heavyweights (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_ghwRomInfo, md_ghwRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Capt'n Havoc (Euro) -static struct BurnRomInfo md_havocRomDesc[] = { - { "mdch 9642.bin", 0x100000, 0x76e6d20d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_havoc) -STD_ROM_FN(md_havoc) - -struct BurnDriver BurnDrvmd_havoc = { - "md_havoc", NULL, NULL, NULL, "1994", - "Capt'n Havoc (Euro)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_havocRomInfo, md_havocRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Home Alone (Euro, USA) -static struct BurnRomInfo md_homeaRomDesc[] = { - { "mpr-14996.ic1", 0x080000, 0xaa0d4387, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_homea) -STD_ROM_FN(md_homea) - -struct BurnDriver BurnDrvmd_homea = { - "md_homea", NULL, NULL, NULL, "1992", - "Home Alone (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_homeaRomInfo, md_homeaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Joe Montana II Sports Talk Football (World) -static struct BurnRomInfo md_joemont2aRomDesc[] = { - { "mpr-14356.ic1", 0x100000, 0xf2363a4a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_joemont2a) -STD_ROM_FN(md_joemont2a) - -struct BurnDriver BurnDrvmd_joemont2a = { - "md_joemont2a", "md_joemont2", NULL, NULL, "1991", - "Joe Montana II Sports Talk Football (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_joemont2aRomInfo, md_joemont2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Talmit's Adventure (Euro) -static struct BurnRomInfo md_talmitRomDesc[] = { - { "lrog453-eta.bin", 0x100000, 0x05dc3ffc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_talmit) -STD_ROM_FN(md_talmit) - -struct BurnDriver BurnDrvmd_talmit = { - "md_talmit", NULL, NULL, NULL, "1991", - "Talmit's Adventure (Euro)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_talmitRomInfo, md_talmitRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Marvel Land (Jpn) -static struct BurnRomInfo md_marvlandjRomDesc[] = { - { "lrog452-mml.bin", 0x100000, 0x5d162d21, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_marvlandj) -STD_ROM_FN(md_marvlandj) - -struct BurnDriver BurnDrvmd_marvlandj = { - "md_marvlandj", "md_talmit", NULL, NULL, "1991", - "Marvel Land (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_marvlandjRomInfo, md_marvlandjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Bomberman (Euro, Kor) -static struct BurnRomInfo md_megabombRomDesc[] = { - { "mpr-17108.ic1", 0x100000, 0x54ab3beb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megabomb) -STD_ROM_FN(md_megabomb) - -struct BurnDriver BurnDrvmd_megabomb = { - "md_megabomb", NULL, NULL, NULL, "1994", - "Mega Bomberman (Euro, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megabombRomInfo, md_megabombRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Games 6 Vol. 3 (Euro) -static struct BurnRomInfo md_megaga63RomDesc[] = { - { "mpr-18871.ic1", 0x300000, 0xfe3e7e4f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaga63) -STD_ROM_FN(md_megaga63) - -struct BurnDriver BurnDrvmd_megaga63 = { - "md_megaga63", NULL, NULL, NULL, "1995", - "Mega Games 6 Vol. 3 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaga63RomInfo, md_megaga63RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Micro Machines 2 - Turbo Tournament (Euro, J-Cart) -static struct BurnRomInfo md_micromc2RomDesc[] = { - { "mdm_2bead.bin", 0x100000, 0x42bfb7eb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_micromc2) -STD_ROM_FN(md_micromc2) - -struct BurnDriver BurnDrvmd_micromc2 = { - "md_micromc2", NULL, NULL, NULL, "1994", - "Micro Machines 2 - Turbo Tournament (Euro, J-Cart)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 4, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART_SEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_micromc2RomInfo, md_micromc2RomName, NULL, NULL, Megadrive4pInputInfo, Megadrive4pDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Micro Machines Turbo Tournament 96 (Euro, v1.1, J-Cart) -static struct BurnRomInfo md_microm96RomDesc[] = { - { "mm96mdeddb.bin", 0x100000, 0x23319d0d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_microm96) -STD_ROM_FN(md_microm96) - -struct BurnDriver BurnDrvmd_microm96 = { - "md_microm96", NULL, NULL, NULL, "1995", - "Micro Machines Turbo Tournament 96 (Euro, v1.1, J-Cart)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 4, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART_SEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_microm96RomInfo, md_microm96RomName, NULL, NULL, Megadrive4pInputInfo, Megadrive4pDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pete Sampras Tennis (Euro, USA, J-Cart) -static struct BurnRomInfo md_samprasRomDesc[] = { - { "mdst6636.bin", 0x100000, 0x94e505b2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sampras) -STD_ROM_FN(md_sampras) - -struct BurnDriver BurnDrvmd_sampras = { - "md_sampras", NULL, NULL, NULL, "1994", - "Pete Sampras Tennis (Euro, USA, J-Cart)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 4, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART, GBF_MISC, 0, - MegadriveGetZipName, md_samprasRomInfo, md_samprasRomName, NULL, NULL, Megadrive4pInputInfo, Megadrive4pDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II (Euro, USA, Rev. A) -static struct BurnRomInfo md_pstar2RomDesc[] = { - { "mpr-12851a.ic1", 0x080000, 0x74714110, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, - { "mpr-12852a.ic2", 0x080000, 0xe304231a, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_080000 }, -}; - -STD_ROM_PICK(md_pstar2) -STD_ROM_FN(md_pstar2) - -struct BurnDriver BurnDrvmd_pstar2 = { - "md_pstar2", NULL, NULL, NULL, "1989", - "Phantasy Star II (Euro, USA, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar2RomInfo, md_pstar2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining Force II (Euro) -static struct BurnRomInfo md_shinfrc2RomDesc[] = { - { "mpr-16933.ic1", 0x200000, 0x83cb46d1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinfrc2) -STD_ROM_FN(md_shinfrc2) - -struct BurnDriver BurnDrvmd_shinfrc2 = { - "md_shinfrc2", NULL, NULL, NULL, "1994", - "Shining Force II (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shinfrc2RomInfo, md_shinfrc2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Smurfs (Euro, Rev. A) -static struct BurnRomInfo md_smurfsRomDesc[] = { - { "mpr-17019a.ic1", 0x100000, 0x88b30eff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smurfs) -STD_ROM_FN(md_smurfs) - -struct BurnDriver BurnDrvmd_smurfs = { - "md_smurfs", NULL, NULL, NULL, "1995", - "The Smurfs (Euro, Rev. A)\0", NULL, "Infogrames", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smurfsRomInfo, md_smurfsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Soleil (Spa) -static struct BurnRomInfo md_soleilsRomDesc[] = { - { "mpr-17512.ic1", 0x200000, 0x9ed4c323, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_soleils) -STD_ROM_FN(md_soleils) - -struct BurnDriver BurnDrvmd_soleils = { - "md_soleils", "md_soleil", NULL, NULL, "1994", - "Soleil (Spa)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_soleilsRomInfo, md_soleilsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Soleil (Fra) -static struct BurnRomInfo md_soleilfRomDesc[] = { - { "mpr-17513.ic1", 0x200000, 0x08dc1ead, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_soleilf) -STD_ROM_FN(md_soleilf) - -struct BurnDriver BurnDrvmd_soleilf = { - "md_soleilf", "md_soleil", NULL, NULL, "1994", - "Soleil (Fra)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_soleilfRomInfo, md_soleilfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Soleil (Ger) -static struct BurnRomInfo md_soleilgRomDesc[] = { - { "mpr-17514.ic1", 0x200000, 0x332b9ecd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_soleilg) -STD_ROM_FN(md_soleilg) - -struct BurnDriver BurnDrvmd_soleilg = { - "md_soleilg", "md_soleil", NULL, NULL, "1994", - "Soleil (Ger)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_soleilgRomInfo, md_soleilgRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 3 (Euro) -static struct BurnRomInfo md_sonic3RomDesc[] = { - { "mpr-16342.ic1", 0x200000, 0x6a632503, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3) -STD_ROM_FN(md_sonic3) - -struct BurnDriver BurnDrvmd_sonic3 = { - "md_sonic3", NULL, NULL, NULL, "1994", - "Sonic the Hedgehog 3 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_FRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3RomInfo, md_sonic3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 3 (Jpn, Kor) -static struct BurnRomInfo md_sonic3jRomDesc[] = { - { "mpr-16343.ic1", 0x200000, 0xf4951d1f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3j) -STD_ROM_FN(md_sonic3j) - -struct BurnDriver BurnDrvmd_sonic3j = { - "md_sonic3j", "md_sonic3", NULL, NULL, "1994", - "Sonic the Hedgehog 3 (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_FRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3jRomInfo, md_sonic3jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Compilation (Euro, Earlier) -static struct BurnRomInfo md_soniccmp1RomDesc[] = { - { "mpr-18203.ic1", 0x200000, 0xfe61c79e, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, - { "mpr-18204.ic2", 0x100000, 0x21d42146, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_200000 }, -}; - -STD_ROM_PICK(md_soniccmp1) -STD_ROM_FN(md_soniccmp1) - -struct BurnDriver BurnDrvmd_soniccmp1 = { - "md_soniccmp1", "md_soniccmp", NULL, NULL, "1995", - "Sonic Compilation (Euro, Earlier)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_soniccmp1RomInfo, md_soniccmp1RomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Spinball (Euro) -static struct BurnRomInfo md_sspinRomDesc[] = { - { "mpr-16077.ic1", 0x100000, 0xaea0786d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sspin) -STD_ROM_FN(md_sspin) - -struct BurnDriver BurnDrvmd_sspin = { - "md_sspin", NULL, NULL, NULL, "1993", - "Sonic Spinball (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sspinRomInfo, md_sspinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Space Harrier II (World) -static struct BurnRomInfo md_sharrierRomDesc[] = { - { "mpr-12355.ic1", 0x080000, 0xe5c9cbb0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sharrier) -STD_ROM_FN(md_sharrier) - -struct BurnDriver BurnDrvmd_sharrier = { - "md_sharrier", NULL, NULL, NULL, "1989", - "Space Harrier II (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sharrierRomInfo, md_sharrierRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Story of Thor - A Successor of The Light (Fra) -static struct BurnRomInfo md_thorfRomDesc[] = { - { "mpr-17720.ic1", 0x200000, 0x5385f970, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, - { "mpr-17721.ic2", 0x100000, 0x158fa2aa, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_200000 }, -}; - -STD_ROM_PICK(md_thorf) -STD_ROM_FN(md_thorf) - -struct BurnDriver BurnDrvmd_thorf = { - "md_thorf", "md_thor", NULL, NULL, "1995", - "The Story of Thor - A Successor of The Light (Fra)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_thorfRomInfo, md_thorfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Monaco GP (Euro, Jpn, Rev. A) -static struct BurnRomInfo md_smgpRomDesc[] = { - { "mpr-13250a.ic1", 0x080000, 0xbe91b28a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smgp) -STD_ROM_FN(md_smgp) - -struct BurnDriver BurnDrvmd_smgp = { - "md_smgp", NULL, NULL, NULL, "1990", - "Super Monaco GP (Euro, Jpn, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smgpRomInfo, md_smgpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Smash TV (Euro, USA) -static struct BurnRomInfo md_ssmashtvRomDesc[] = { - { "mpr-15040.ic1", 0x080000, 0xf22412b6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ssmashtv) -STD_ROM_FN(md_ssmashtv) - -struct BurnDriver BurnDrvmd_ssmashtv = { - "md_ssmashtv", NULL, NULL, NULL, "1992", - "Super Smash TV (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ssmashtvRomInfo, md_ssmashtvRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Addams Family (Euro, USA) -static struct BurnRomInfo md_addfamRomDesc[] = { - { "mpr-16147.ic1", 0x100000, 0x71f58614, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_addfam) -STD_ROM_FN(md_addfam) - -struct BurnDriver BurnDrvmd_addfam = { - "md_addfam", NULL, NULL, NULL, "1994", - "The Addams Family (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_addfamRomInfo, md_addfamRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Light Crusader (Euro) -static struct BurnRomInfo md_lightcRomDesc[] = { - { "mpr-18090.ic1", 0x200000, 0x52c7252b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lightc) -STD_ROM_FN(md_lightc) - -struct BurnDriver BurnDrvmd_lightc = { - "md_lightc", NULL, NULL, NULL, "1995", - "Light Crusader (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_lightcRomInfo, md_lightcRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ESPN Speedworld (USA, Prototype) -static struct BurnRomInfo md_espnspedpRomDesc[] = { - { "u4.bin", 0x080000, 0x525788b1, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_000000 }, - { "u5.bin", 0x080000, 0xada9c9a8, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_000001 }, - { "u1.bin", 0x080000, 0xe8ee1029, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_100000 }, - { "u2.bin", 0x080000, 0x0f3ec491, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_100001 }, -}; - -STD_ROM_PICK(md_espnspedp) -STD_ROM_FN(md_espnspedp) - -struct BurnDriver BurnDrvmd_espnspedp = { - "md_espnspedp", "md_espnsped", NULL, NULL, "1994", - "ESPN Speedworld (USA, Prototype)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_espnspedpRomInfo, md_espnspedpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ESPN Sunday Night NFL (USA, Prototype) -static struct BurnRomInfo md_espnnflpRomDesc[] = { - { "u4.bin", 0x080000, 0x9f427221, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_000000 }, - { "u5.bin", 0x080000, 0x3445f0e8, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_000001 }, - { "u1.bin", 0x080000, 0x5d05efc5, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_100000 }, - { "u2.bin", 0x080000, 0x7ae6fd4b, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_100001 }, -}; - -STD_ROM_PICK(md_espnnflp) -STD_ROM_FN(md_espnnflp) - -struct BurnDriver BurnDrvmd_espnnflp = { - "md_espnnflp", "md_espnnfl", NULL, NULL, "1994", - "ESPN Sunday Night NFL (USA, Prototype)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_espnnflpRomInfo, md_espnnflpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Incredible Crash Dummies (Euro, USA) -static struct BurnRomInfo md_crashdumRomDesc[] = { - { "mpr-16259.ic1", 0x100000, 0x1f6e574a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crashdum) -STD_ROM_FN(md_crashdum) - -struct BurnDriver BurnDrvmd_crashdum = { - "md_crashdum", NULL, NULL, NULL, "1993", - "The Incredible Crash Dummies (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crashdumRomInfo, md_crashdumRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ESWAT - City Under Siege (Euro, USA, Rev. A) -static struct BurnRomInfo md_eswatRomDesc[] = { - { "mpr-13192a.ic1", 0x080000, 0xe72f8a36, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eswat) -STD_ROM_FN(md_eswat) - -struct BurnDriver BurnDrvmd_eswat = { - "md_eswat", NULL, NULL, NULL, "1990", - "ESWAT - City Under Siege (Euro, USA, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eswatRomInfo, md_eswatRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Evander Holyfield's 'Real Deal' Boxing (World) -static struct BurnRomInfo md_evanderRomDesc[] = { - { "mpr-14860.ic1", 0x080000, 0x4fef37c8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_evander) -STD_ROM_FN(md_evander) - -struct BurnDriver BurnDrvmd_evander = { - "md_evander", NULL, NULL, NULL, "1992", - "Evander Holyfield's 'Real Deal' Boxing (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_evanderRomInfo, md_evanderRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ex-Mutants (Euro, USA) -static struct BurnRomInfo md_exmutantRomDesc[] = { - { "mpr-15225.ic1", 0x100000, 0x33b1979f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_exmutant) -STD_ROM_FN(md_exmutant) - -struct BurnDriver BurnDrvmd_exmutant = { - "md_exmutant", NULL, NULL, NULL, "1992", - "Ex-Mutants (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_exmutantRomInfo, md_exmutantRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Galaxy Force II (World, Rev. B) -static struct BurnRomInfo md_gforce2RomDesc[] = { - { "mpr-14248b.ic1", 0x100000, 0xd15f5c3c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gforce2) -STD_ROM_FN(md_gforce2) - -struct BurnDriver BurnDrvmd_gforce2 = { - "md_gforce2", NULL, NULL, NULL, "1991", - "Galaxy Force II (World, Rev. B)\0", NULL, "CRI ~ Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gforce2RomInfo, md_gforce2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mutant League Football (Euro, USA) -static struct BurnRomInfo md_mlfootbRomDesc[] = { - { "mlf03.u1", 0x100000, 0xdce29c9d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mlfootb) -STD_ROM_FN(md_mlfootb) - -struct BurnDriver BurnDrvmd_mlfootb = { - "md_mlfootb", NULL, NULL, NULL, "1993", - "Mutant League Football (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mlfootbRomInfo, md_mlfootbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pink Goes to Hollywood (Euro, USA) -static struct BurnRomInfo md_pinkRomDesc[] = { - { "mpr-16065.ic1", 0x100000, 0xb5804771, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pink) -STD_ROM_FN(md_pink) - -struct BurnDriver BurnDrvmd_pink = { - "md_pink", NULL, NULL, NULL, "1993", - "Pink Goes to Hollywood (Euro, USA)\0", NULL, "TecMagik", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pinkRomInfo, md_pinkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spider-Man and X-Men - Arcade's Revenge (Euro, USA) -static struct BurnRomInfo md_spidxmenRomDesc[] = { - { "mpr-15709.ic1", 0x100000, 0x4a4414ea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spidxmen) -STD_ROM_FN(md_spidxmen) - -struct BurnDriver BurnDrvmd_spidxmen = { - "md_spidxmen", NULL, NULL, NULL, "1994", - "Spider-Man and X-Men - Arcade's Revenge (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spidxmenRomInfo, md_spidxmenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zoom! (World) -static struct BurnRomInfo md_zoomRomDesc[] = { - { "mpr-12807.ic1", 0x040000, 0x724d6965, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zoom) -STD_ROM_FN(md_zoom) - -struct BurnDriver BurnDrvmd_zoom = { - "md_zoom", NULL, NULL, NULL, "1990", - "Zoom! (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zoomRomInfo, md_zoomRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zany Golf (Euro, USA, v1.1) -static struct BurnRomInfo md_zanygolfRomDesc[] = { - { "zany golf (euro, usa) (v1.1).bin", 0x080000, 0x74ed7607, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zanygolf) -STD_ROM_FN(md_zanygolf) - -struct BurnDriver BurnDrvmd_zanygolf = { - "md_zanygolf", NULL, NULL, NULL, "1990", - "Zany Golf (Euro, USA, v1.1)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zanygolfRomInfo, md_zanygolfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bugs Bunny in Double Trouble (Euro) -static struct BurnRomInfo md_bugsbunRomDesc[] = { - { "mpr-18887.ic1", 0x200000, 0xcec0a0bb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bugsbun) -STD_ROM_FN(md_bugsbun) - -struct BurnDriver BurnDrvmd_bugsbun = { - "md_bugsbun", NULL, NULL, NULL, "1996", - "Bugs Bunny in Double Trouble (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bugsbunRomInfo, md_bugsbunRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kid Chameleon (Euro, Korea, USA) -static struct BurnRomInfo md_kidchamRomDesc[] = { - { "mpr-14557.ic1", 0x100000, 0xce36e6cc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kidcham) -STD_ROM_FN(md_kidcham) - -struct BurnDriver BurnDrvmd_kidcham = { - "md_kidcham", NULL, NULL, NULL, "1992", - "Kid Chameleon (Euro, Korea, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kidchamRomInfo, md_kidchamRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA Soccer 95 (Kor) -static struct BurnRomInfo md_fifa95kRomDesc[] = { - { "lh5370hd.bin", 0x200000, 0x012591f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa95k) -STD_ROM_FN(md_fifa95k) - -struct BurnDriver BurnDrvmd_fifa95k = { - "md_fifa95k", "md_fifa95", NULL, NULL, "1994", - "FIFA Soccer 95 (Kor)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fifa95kRomInfo, md_fifa95kRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shinobi III - Return of the Ninja Master (Euro) -static struct BurnRomInfo md_shinobi3RomDesc[] = { - { "mpr-15798.ic1", 0x100000, 0x0b6d3eb5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinobi3) -STD_ROM_FN(md_shinobi3) - -struct BurnDriver BurnDrvmd_shinobi3 = { - "md_shinobi3", NULL, NULL, NULL, "1993", - "Shinobi III - Return of the Ninja Master (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shinobi3RomInfo, md_shinobi3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thunder Force II (Euro, USA) -static struct BurnRomInfo md_tf2RomDesc[] = { - { "mpr-12559.ic1", 0x080000, 0x9b1561b3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tf2) -STD_ROM_FN(md_tf2) - -struct BurnDriver BurnDrvmd_tf2 = { - "md_tf2", NULL, NULL, NULL, "1989", - "Thunder Force II (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tf2RomInfo, md_tf2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// QuackShot Starring Donald Duck ~ QuackShot - Guruzia Ou no Hihou (World) -static struct BurnRomInfo md_quackshtRomDesc[] = { - { "mpr-14371.ic1", 0x080000, 0x5dd28dd7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP_CONTINUE_040000_100000 | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_quacksht) -STD_ROM_FN(md_quacksht) - -struct BurnDriver BurnDrvmd_quacksht = { - "md_quacksht", NULL, NULL, NULL, "1991", - "QuackShot Starring Donald Duck ~ QuackShot - Guruzia Ou no Hihou (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_quackshtRomInfo, md_quackshtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Herzog Zwei (Euro, USA) -static struct BurnRomInfo md_herzogRomDesc[] = { - { "mpr-12929.ic1", 0x080000, 0xa605b65b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_herzog) -STD_ROM_FN(md_herzog) - -struct BurnDriver BurnDrvmd_herzog = { - "md_herzog", NULL, NULL, NULL, "1990", - "Herzog Zwei (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_herzogRomInfo, md_herzogRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Landstalker - Le Trsor du Roi Nole (Fra) -static struct BurnRomInfo md_landstlkfRomDesc[] = { - { "mpr-15976.ic1", 0x200000, 0x5de7d917, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_landstlkf) -STD_ROM_FN(md_landstlkf) - -struct BurnDriver BurnDrvmd_landstlkf = { - "md_landstlkf", "md_landstlk", NULL, NULL, "1993", - "Landstalker - Le Tresor du Roi Nole (Fra)\0", NULL, "Sega", "Sega Megadrive", - L"Landstalker - Le Tr\u00e9sor du Roi Nole (Fra)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM | HARDWARE_SEGA_MEGADRIVE_SRAM_10000, GBF_MISC, 0, - MegadriveGetZipName, md_landstlkfRomInfo, md_landstlkfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog (Euro, USA) -static struct BurnRomInfo md_sonicRomDesc[] = { - { "mpr-13913.ic1", 0x080000, 0xf9394e97, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic) -STD_ROM_FN(md_sonic) - -struct BurnDriver BurnDrvmd_sonic = { - "md_sonic", NULL, NULL, NULL, "1991", - "Sonic the Hedgehog (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonicRomInfo, md_sonicRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aero the Acro-Bat 2 (Euro) -static struct BurnRomInfo md_aero2RomDesc[] = { - { "mpr-17303.ic1", 0x200000, 0xa451f9a1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aero2) -STD_ROM_FN(md_aero2) - -struct BurnDriver BurnDrvmd_aero2 = { - "md_aero2", NULL, NULL, NULL, "1994", - "Aero the Acro-Bat 2 (Euro)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aero2RomInfo, md_aero2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Batman Returns (World) -static struct BurnRomInfo md_batmanrnRomDesc[] = { - { "mpr-14998.ic1", 0x100000, 0x4a3225c0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_batmanrn) -STD_ROM_FN(md_batmanrn) - -struct BurnDriver BurnDrvmd_batmanrn = { - "md_batmanrn", NULL, NULL, NULL, "1992", - "Batman Returns (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_batmanrnRomInfo, md_batmanrnRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Thunder Blade (World) -static struct BurnRomInfo md_stbladRomDesc[] = { - { "mpr-12354.bin", 0x080000, 0xb13087ee, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_stblad) -STD_ROM_FN(md_stblad) - -struct BurnDriver BurnDrvmd_stblad = { - "md_stblad", NULL, NULL, NULL, "1989", - "Super Thunder Blade (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_stbladRomInfo, md_stbladRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA Soccer 95 (Euro, USA) -static struct BurnRomInfo md_fifa95RomDesc[] = { - { "fifa95b1.bin", 0x200000, 0xb389d036, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa95) -STD_ROM_FN(md_fifa95) - -struct BurnDriver BurnDrvmd_fifa95 = { - "md_fifa95", NULL, NULL, NULL, "1994", - "FIFA Soccer 95 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_fifa95RomInfo, md_fifa95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Skitchin (Euro, USA) -static struct BurnRomInfo md_skitchinRomDesc[] = { - { "skitchin skit09.bin", 0x200000, 0xf785f9d7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skitchin) -STD_ROM_FN(md_skitchin) - -struct BurnDriver BurnDrvmd_skitchin = { - "md_skitchin", NULL, NULL, NULL, "1993", - "Skitchin (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skitchinRomInfo, md_skitchinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Paperboy 2 (Euro, USA) -static struct BurnRomInfo md_paperbo2RomDesc[] = { - { "mpr-15320.ic1", 0x100000, 0x1de28bb1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_paperbo2) -STD_ROM_FN(md_paperbo2) - -struct BurnDriver BurnDrvmd_paperbo2 = { - "md_paperbo2", NULL, NULL, NULL, "1992", - "Paperboy 2 (Euro, USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_paperbo2RomInfo, md_paperbo2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jewel Master (Euro, USA, Rev. A) -static struct BurnRomInfo md_jewelmsRomDesc[] = { - { "mpr-14118a.ic1", 0x080000, 0xcee98813, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jewelms) -STD_ROM_FN(md_jewelms) - -struct BurnDriver BurnDrvmd_jewelms = { - "md_jewelms", NULL, NULL, NULL, "1991", - "Jewel Master (Euro, USA, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jewelmsRomInfo, md_jewelmsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Side Pocket (USA) -static struct BurnRomInfo md_sidepockuRomDesc[] = { - { "mpr-15008.ic1", 0x100000, 0xaf9f275d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sidepocku) -STD_ROM_FN(md_sidepocku) - -struct BurnDriver BurnDrvmd_sidepocku = { - "md_sidepocku", "md_sidepock", NULL, NULL, "1992", - "Side Pocket (USA)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sidepockuRomInfo, md_sidepockuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Psycho Pinball (Euro, 199410) -static struct BurnRomInfo md_psychoRomDesc[] = { - { "mdppf821.bin", 0x200000, 0x32dd8351, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_psycho) -STD_ROM_FN(md_psycho) - -struct BurnDriver BurnDrvmd_psycho = { - "md_psycho", NULL, NULL, NULL, "1994", - "Psycho Pinball (Euro, 199410)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_psychoRomInfo, md_psychoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Psycho Pinball (Euro, 199409) -static struct BurnRomInfo md_psycho1RomDesc[] = { - { "mdpp021f.bin", 0x200000, 0x1ab8f1a1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_psycho1) -STD_ROM_FN(md_psycho1) - -struct BurnDriver BurnDrvmd_psycho1 = { - "md_psycho1", "md_psycho", NULL, NULL, "1994", - "Psycho Pinball (Euro, 199409)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_psycho1RomInfo, md_psycho1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Micro Machines (Euro, USA) -static struct BurnRomInfo md_micromacRomDesc[] = { - { "mdmmacd3.bin", 0x080000, 0x50081a0b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_micromac) -STD_ROM_FN(md_micromac) - -struct BurnDriver BurnDrvmd_micromac = { - "md_micromac", NULL, NULL, NULL, "1993", - "Micro Machines (Euro, USA)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_micromacRomInfo, md_micromacRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 2 in 1 - Psycho Pinball & Micro Machines (Euro) -static struct BurnRomInfo md_2psymmacRomDesc[] = { - { "mdppf821.bin", 0x200000, 0x32dd8351, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, - { "mdmm_acd3.bin", 0x080000, 0x50081a0b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_200000 }, -}; - -STD_ROM_PICK(md_2psymmac) -STD_ROM_FN(md_2psymmac) - -struct BurnDriver BurnDrvmd_2psymmac = { - "md_2psymmac", NULL, NULL, NULL, "1993", - "2 in 1 - Psycho Pinball & Micro Machines (Euro)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_2psymmacRomInfo, md_2psymmacRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 13 Ma Jiang - 98 Mei Shao Nu Pian (Chi) -static struct BurnRomInfo md_13mahjanRomDesc[] = { - { "13 mahjong 98 (unl).bin", 0x0a0000, 0x68b372f6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_13mahjan) -STD_ROM_FN(md_13mahjan) - -struct BurnDriver BurnDrvmd_13mahjan = { - "md_13mahjan", NULL, NULL, NULL, "1998", - "13 Ma Jiang - 98 Mei Shao Nu Pian (Chi)\0", NULL, "BBD", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_13mahjanRomInfo, md_13mahjanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 16 Ton (Jpn, SegaNet) -static struct BurnRomInfo md_16tonRomDesc[] = { - { "16 ton (jpn) (sn).bin", 0x040000, 0x537f04b6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_16ton) -STD_ROM_FN(md_16ton) - -struct BurnDriver BurnDrvmd_16ton = { - "md_16ton", NULL, NULL, NULL, "1991", - "16 Ton (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_16tonRomInfo, md_16tonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 16 Ton (Jpn, Game no Kandume MegaCD Rip) -static struct BurnRomInfo md_16tongnkRomDesc[] = { - { "16 ton (jpn) (gnk).bin", 0x040000, 0x98149eaf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_16tongnk) -STD_ROM_FN(md_16tongnk) - -struct BurnDriver BurnDrvmd_16tongnk = { - "md_16tongnk", "md_16ton", NULL, NULL, "1991", - "16 Ton (Jpn, Game no Kandume MegaCD Rip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_16tongnkRomInfo, md_16tongnkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 16 Zhang Ma Jiang (Chi) -static struct BurnRomInfo md_16zhanRomDesc[] = { - { "16 zhang ma jiang (chi) (unl).bin", 0x100000, 0x36407c82, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_16zhan) -STD_ROM_FN(md_16zhan) - -struct BurnDriver BurnDrvmd_16zhan = { - "md_16zhan", NULL, NULL, NULL, "199?", - "16 Zhang Ma Jiang (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_16zhanRomInfo, md_16zhanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 3 Ninjas Kick Back (USA) -static struct BurnRomInfo md_3ninjaRomDesc[] = { - { "3 ninjas kick back (usa).bin", 0x200000, 0xe5a24999, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_3ninja) -STD_ROM_FN(md_3ninja) - -struct BurnDriver BurnDrvmd_3ninja = { - "md_3ninja", NULL, NULL, NULL, "1994", - "3 Ninjas Kick Back (USA)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_3ninjaRomInfo, md_3ninjaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 3 in 1 Flashback - World Championship Soccer - Tecmo World Cup 92 (Pirate) -static struct BurnRomInfo md_3in1fwtRomDesc[] = { - { "3-in-1 flashback - world champ. soccer - tecmo world cup 92 (pirate).bin", 0x200000, 0xa8fd28d7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_3in1fwt) -STD_ROM_FN(md_3in1fwt) - -struct BurnDriver BurnDrvmd_3in1fwt = { - "md_3in1fwt", NULL, NULL, NULL, "199?", - "3 in 1 Flashback - World Championship Soccer - Tecmo World Cup 92 (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_3in1fwtRomInfo, md_3in1fwtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 3 in 1 Road Rash - Ms. Pac-Man - Block Out (Pirate) -static struct BurnRomInfo md_3in1rmbRomDesc[] = { - { "3-in-1 road rash - ms. pac-man - block out (pirate).bin", 0x100000, 0x13c96154, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_3in1rmb) -STD_ROM_FN(md_3in1rmb) - -struct BurnDriver BurnDrvmd_3in1rmb = { - "md_3in1rmb", NULL, NULL, NULL, "199?", - "3 in 1 Road Rash - Ms. Pac-Man - Block Out (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_3in1rmbRomInfo, md_3in1rmbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 6-Pak (USA) -static struct BurnRomInfo md_6pakRomDesc[] = { - { "6-pak (usa).bin", 0x300000, 0x1a6f45dc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_6pak) -STD_ROM_FN(md_6pak) - -struct BurnDriver BurnDrvmd_6pak = { - "md_6pak", NULL, NULL, NULL, "1996", - "6-Pak (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_6pakRomInfo, md_6pakRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 688 Attack Sub (Euro, USA) -static struct BurnRomInfo md_688atsubRomDesc[] = { - { "mpr-13956.bin", 0x100000, 0xf2c58bf7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_688atsub) -STD_ROM_FN(md_688atsub) - -struct BurnDriver BurnDrvmd_688atsub = { - "md_688atsub", NULL, NULL, NULL, "1991", - "688 Attack Sub (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_688atsubRomInfo, md_688atsubRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// A Ressha de Ikou MD - Take the "A" Train (Jpn) -static struct BurnRomInfo md_aresshmdRomDesc[] = { - { "a ressha de ikou md (jpn).bin", 0x080000, 0x3d45de4f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aresshmd) -STD_ROM_FN(md_aresshmd) - -struct BurnDriver BurnDrvmd_aresshmd = { - "md_aresshmd", NULL, NULL, NULL, "1992", - "A Ressha de Ikou MD - Take the 'A' Train (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_aresshmdRomInfo, md_aresshmdRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aa Harimanada (Jpn) -static struct BurnRomInfo md_aaharimaRomDesc[] = { - { "aa harimanada (jpn).bin", 0x200000, 0x065f6021, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aaharima) -STD_ROM_FN(md_aaharima) - -struct BurnDriver BurnDrvmd_aaharima = { - "md_aaharima", NULL, NULL, NULL, "1993", - "Aa Harimanada (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aaharimaRomInfo, md_aaharimaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// AAAHH!!! Real Monsters (Euro) -static struct BurnRomInfo md_aaahhrmRomDesc[] = { - { "aaahh!!! real monsters (euro).bin", 0x200000, 0x7ad115ff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aaahhrm) -STD_ROM_FN(md_aaahhrm) - -struct BurnDriver BurnDrvmd_aaahhrm = { - "md_aaahhrm", NULL, NULL, NULL, "1995", - "AAAHH!!! Real Monsters (Euro)\0", NULL, "Viacom New Media", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aaahhrmRomInfo, md_aaahhrmRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// AAAHH!!! Real Monsters (USA) -static struct BurnRomInfo md_aaahhrmuRomDesc[] = { - { "aaahh!!! real monsters (usa).bin", 0x200000, 0xfdc80bfc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aaahhrmu) -STD_ROM_FN(md_aaahhrmu) - -struct BurnDriver BurnDrvmd_aaahhrmu = { - "md_aaahhrmu", "md_aaahhrm", NULL, NULL, "1995", - "AAAHH!!! Real Monsters (USA)\0", NULL, "Viacom New Media", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aaahhrmuRomInfo, md_aaahhrmuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Action 52 (USA) -static struct BurnRomInfo md_action52RomDesc[] = { - { "action 52 (usa) (unl).bin", 0x200000, 0x29ff58ae, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_action52) -STD_ROM_FN(md_action52) - -struct BurnDriver BurnDrvmd_action52 = { - "md_action52", NULL, NULL, NULL, "1993", - "Action 52 (USA)\0", NULL, "Active Enterprises", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_action52RomInfo, md_action52RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Action 52 (USA, Alt) -static struct BurnRomInfo md_action52aRomDesc[] = { - { "action 52 (usa) (alt) (unl).bin", 0x200000, 0x8809d666, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_action52a) -STD_ROM_FN(md_action52a) - -struct BurnDriver BurnDrvmd_action52a = { - "md_action52a", "md_action52", NULL, NULL, "1993", - "Action 52 (USA, Alt)\0", NULL, "Active Enterprises", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_action52aRomInfo, md_action52aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Addams Family Values (Euro) -static struct BurnRomInfo md_addfamvRomDesc[] = { - { "addams family values (euro).bin", 0x200000, 0xb906b992, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_addfamv) -STD_ROM_FN(md_addfamv) - -struct BurnDriver BurnDrvmd_addfamv = { - "md_addfamv", NULL, NULL, NULL, "1994", - "Addams Family Values (Euro)\0", NULL, "Ocean", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_addfamvRomInfo, md_addfamvRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Addams Family (USA, Prototype) -static struct BurnRomInfo md_addfamp1RomDesc[] = { - { "addams family, the (usa) (beta).bin", 0x100000, 0x2803a5ca, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_addfamp1) -STD_ROM_FN(md_addfamp1) - -struct BurnDriver BurnDrvmd_addfamp1 = { - "md_addfamp1", "md_addfam", NULL, NULL, "1994", - "The Addams Family (USA, Prototype)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_addfamp1RomInfo, md_addfamp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Addams Family (USA, Prototype, Alt) -static struct BurnRomInfo md_addfamp2RomDesc[] = { - { "addams family, the (usa) (beta) (alt).bin", 0x100000, 0x3a173e1f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_addfamp2) -STD_ROM_FN(md_addfamp2) - -struct BurnDriver BurnDrvmd_addfamp2 = { - "md_addfamp2", "md_addfam", NULL, NULL, "1994", - "The Addams Family (USA, Prototype, Alt)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_addfamp2RomInfo, md_addfamp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Advanced Daisenryaku - Deutsch Dengeki Sakusen (Jpn, Rev. A) -static struct BurnRomInfo md_advdaisnRomDesc[] = { - { "mpr-13842a.bin", 0x100000, 0xe0d5e18a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advdaisn) -STD_ROM_FN(md_advdaisn) - -struct BurnDriver BurnDrvmd_advdaisn = { - "md_advdaisn", NULL, NULL, NULL, "1991", - "Advanced Daisenryaku - Deutsch Dengeki Sakusen (Jpn, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_advdaisnRomInfo, md_advdaisnRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950406) -static struct BurnRomInfo md_advbatrp12RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 06, 1995).bin", 0x200000, 0xf05cf389, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp12) -STD_ROM_FN(md_advbatrp12) - -struct BurnDriver BurnDrvmd_advbatrp12 = { - "md_advbatrp12", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950406)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp12RomInfo, md_advbatrp12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950410) -static struct BurnRomInfo md_advbatrp11RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 10, 1995).bin", 0x200000, 0xd4f3a070, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp11) -STD_ROM_FN(md_advbatrp11) - -struct BurnDriver BurnDrvmd_advbatrp11 = { - "md_advbatrp11", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950410)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp11RomInfo, md_advbatrp11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950411) -static struct BurnRomInfo md_advbatrp10RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 11, 1995).bin", 0x200000, 0xb5b5a290, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp10) -STD_ROM_FN(md_advbatrp10) - -struct BurnDriver BurnDrvmd_advbatrp10 = { - "md_advbatrp10", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950411)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp10RomInfo, md_advbatrp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950418) -static struct BurnRomInfo md_advbatrp09RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 18, 1995).bin", 0x200000, 0x6874142b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp09) -STD_ROM_FN(md_advbatrp09) - -struct BurnDriver BurnDrvmd_advbatrp09 = { - "md_advbatrp09", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950418)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp09RomInfo, md_advbatrp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950419) -static struct BurnRomInfo md_advbatrp08RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 19, 1995).bin", 0x200000, 0x7002da56, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp08) -STD_ROM_FN(md_advbatrp08) - -struct BurnDriver BurnDrvmd_advbatrp08 = { - "md_advbatrp08", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950419)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp08RomInfo, md_advbatrp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950421) -static struct BurnRomInfo md_advbatrp07RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 21, 1995).bin", 0x200000, 0x61f02f13, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp07) -STD_ROM_FN(md_advbatrp07) - -struct BurnDriver BurnDrvmd_advbatrp07 = { - "md_advbatrp07", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950421)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp07RomInfo, md_advbatrp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950422) -static struct BurnRomInfo md_advbatrp06RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 22, 1995).bin", 0x200000, 0xeb8236b2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp06) -STD_ROM_FN(md_advbatrp06) - -struct BurnDriver BurnDrvmd_advbatrp06 = { - "md_advbatrp06", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950422)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp06RomInfo, md_advbatrp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950424) -static struct BurnRomInfo md_advbatrp05RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 24, 1995).bin", 0x200000, 0x253947f8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp05) -STD_ROM_FN(md_advbatrp05) - -struct BurnDriver BurnDrvmd_advbatrp05 = { - "md_advbatrp05", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950424)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp05RomInfo, md_advbatrp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950426) -static struct BurnRomInfo md_advbatrp04RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 26, 1995).bin", 0x200000, 0xbc79f7ee, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp04) -STD_ROM_FN(md_advbatrp04) - -struct BurnDriver BurnDrvmd_advbatrp04 = { - "md_advbatrp04", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950426)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp04RomInfo, md_advbatrp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950427) -static struct BurnRomInfo md_advbatrp03RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 27, 1995).bin", 0x200000, 0xfdac8190, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp03) -STD_ROM_FN(md_advbatrp03) - -struct BurnDriver BurnDrvmd_advbatrp03 = { - "md_advbatrp03", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950427)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp03RomInfo, md_advbatrp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950428) -static struct BurnRomInfo md_advbatrp02RomDesc[] = { - { "adventures of batman & robin, the (prototype - apr 28, 1995).bin", 0x200000, 0x27a1524b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp02) -STD_ROM_FN(md_advbatrp02) - -struct BurnDriver BurnDrvmd_advbatrp02 = { - "md_advbatrp02", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950428)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp02RomInfo, md_advbatrp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (Prototype, 19950501) -static struct BurnRomInfo md_advbatrp01RomDesc[] = { - { "adventures of batman & robin, the (prototype - may 01, 1995).bin", 0x200000, 0x589aa203, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatrp01) -STD_ROM_FN(md_advbatrp01) - -struct BurnDriver BurnDrvmd_advbatrp01 = { - "md_advbatrp01", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (Prototype, 19950501)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatrp01RomInfo, md_advbatrp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Batman & Robin (USA) -static struct BurnRomInfo md_advbatruRomDesc[] = { - { "adventures of batman & robin, the (usa).bin", 0x200000, 0x0caaa4ac, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_advbatru) -STD_ROM_FN(md_advbatru) - -struct BurnDriver BurnDrvmd_advbatru = { - "md_advbatru", "md_advbatr", NULL, NULL, "1995", - "The Adventures of Batman & Robin (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_advbatruRomInfo, md_advbatruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Mighty Max (USA) -static struct BurnRomInfo md_mightmaxuRomDesc[] = { - { "adventures of mighty max, the (usa).bin", 0x100000, 0x55f13a00, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mightmaxu) -STD_ROM_FN(md_mightmaxu) - -struct BurnDriver BurnDrvmd_mightmaxu = { - "md_mightmaxu", "md_mightmax", NULL, NULL, "1994", - "The Adventures of Mighty Max (USA)\0", NULL, "Ocean", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mightmaxuRomInfo, md_mightmaxuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Adventures of Rocky and Bullwinkle and Friends (USA) -static struct BurnRomInfo md_rockybwRomDesc[] = { - { "adventures of rocky and bullwinkle and friends, the (usa).bin", 0x100000, 0xef02d57b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rockybw) -STD_ROM_FN(md_rockybw) - -struct BurnDriver BurnDrvmd_rockybw = { - "md_rockybw", NULL, NULL, NULL, "1993", - "The Adventures of Rocky and Bullwinkle and Friends (USA)\0", NULL, "Absolute Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rockybwRomInfo, md_rockybwRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Adventurous Boy - Mao Xian Xiao Zi (Chi) -static struct BurnRomInfo md_adveboyRomDesc[] = { - { "adventurous boy - mao xian xiao zi (chi) (unl).bin", 0x080000, 0xd4403913, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_adveboy) -STD_ROM_FN(md_adveboy) - -struct BurnDriver BurnDrvmd_adveboy = { - "md_adveboy", NULL, NULL, NULL, "199?", - "Adventurous Boy - Mao Xian Xiao Zi (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_adveboyRomInfo, md_adveboyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aero the Acro-Bat (Euro) -static struct BurnRomInfo md_aeroRomDesc[] = { - { "mpr-16603.bin", 0x100000, 0x1a3eaf57, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aero) -STD_ROM_FN(md_aero) - -struct BurnDriver BurnDrvmd_aero = { - "md_aero", NULL, NULL, NULL, "1993", - "Aero the Acro-Bat (Euro)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aeroRomInfo, md_aeroRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aero the Acro-Bat (Prototype) -static struct BurnRomInfo md_aeropRomDesc[] = { - { "aero the acro-bat (beta).bin", 0x100000, 0xdcd14b10, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aerop) -STD_ROM_FN(md_aerop) - -struct BurnDriver BurnDrvmd_aerop = { - "md_aerop", "md_aero", NULL, NULL, "1993", - "Aero the Acro-Bat (Prototype)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aeropRomInfo, md_aeropRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aero the Acro-Bat (USA) -static struct BurnRomInfo md_aerouRomDesc[] = { - { "aero the acro-bat (usa).bin", 0x100000, 0xa3a7a8b5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aerou) -STD_ROM_FN(md_aerou) - -struct BurnDriver BurnDrvmd_aerou = { - "md_aerou", "md_aero", NULL, NULL, "1993", - "Aero the Acro-Bat (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aerouRomInfo, md_aerouRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aero the Acro-Bat 2 (USA) -static struct BurnRomInfo md_aero2uRomDesc[] = { - { "aero the acro-bat 2 (usa).bin", 0x200000, 0x39eb74eb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aero2u) -STD_ROM_FN(md_aero2u) - -struct BurnDriver BurnDrvmd_aero2u = { - "md_aero2u", "md_aero2", NULL, NULL, "1994", - "Aero the Acro-Bat 2 (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aero2uRomInfo, md_aero2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aerobiz (USA) -static struct BurnRomInfo md_aerobizRomDesc[] = { - { "aerobiz (usa).bin", 0x100000, 0xcfaa9bce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aerobiz) -STD_ROM_FN(md_aerobiz) - -struct BurnDriver BurnDrvmd_aerobiz = { - "md_aerobiz", NULL, NULL, NULL, "1992", - "Aerobiz (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_aerobizRomInfo, md_aerobizRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Air Management - Oozora ni Kakeru (Jpn) -static struct BurnRomInfo md_airmanagRomDesc[] = { - { "air management - oozora ni kakeru (jpn).bin", 0x100000, 0xb3db0c71, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_airmanag) -STD_ROM_FN(md_airmanag) - -struct BurnDriver BurnDrvmd_airmanag = { - "md_airmanag", "md_aerobiz", NULL, NULL, "1992", - "Air Management - Oozora ni Kakeru (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_airmanagRomInfo, md_airmanagRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aerobiz Supersonic (USA) -static struct BurnRomInfo md_aerobizsRomDesc[] = { - { "aerobiz supersonic (usa).bin", 0x100000, 0x9377f1b5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aerobizs) -STD_ROM_FN(md_aerobizs) - -struct BurnDriver BurnDrvmd_aerobizs = { - "md_aerobizs", NULL, NULL, NULL, "1994", - "Aerobiz Supersonic (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_aerobizsRomInfo, md_aerobizsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Air Management II - Koukuuou o Mezase (Jpn) -static struct BurnRomInfo md_airmang2RomDesc[] = { - { "air management ii - koukuuou o mezase (jpn).bin", 0x100000, 0x4582817b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_airmang2) -STD_ROM_FN(md_airmang2) - -struct BurnDriver BurnDrvmd_airmang2 = { - "md_airmang2", "md_aerobizs", NULL, NULL, "1994", - "Air Management II - Koukuuou o Mezase (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_airmang2RomInfo, md_airmang2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// After Burner II (Euro, USA) -static struct BurnRomInfo md_aburner2RomDesc[] = { - { "mpr-13261.bin", 0x080000, 0xccafe00e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aburner2) -STD_ROM_FN(md_aburner2) - -struct BurnDriver BurnDrvmd_aburner2 = { - "md_aburner2", NULL, NULL, NULL, "1990", - "After Burner II (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aburner2RomInfo, md_aburner2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// After Burner II (Jpn) -static struct BurnRomInfo md_aburner2jRomDesc[] = { - { "mpr-12941.bin", 0x080000, 0x4ff37e66, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aburner2j) -STD_ROM_FN(md_aburner2j) - -struct BurnDriver BurnDrvmd_aburner2j = { - "md_aburner2j", "md_aburner2", NULL, NULL, "1990", - "After Burner II (Jpn)\0", NULL, "Denpa Shinbunsha", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aburner2jRomInfo, md_aburner2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Air Buster: Trouble Specialty Raid Unit (USA) -static struct BurnRomInfo md_airbustrRomDesc[] = { - { "air buster (usa).bin", 0x080000, 0xf3d65baa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_airbustr) -STD_ROM_FN(md_airbustr) - -struct BurnDriver BurnDrvmd_airbustr = { - "md_airbustr", NULL, NULL, NULL, "1991", - "Air Buster: Trouble Specialty Raid Unit (USA)\0", NULL, "Kaneko", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_airbustrRomInfo, md_airbustrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aero Blasters: Trouble Specialty Raid Unit (Jpn) -static struct BurnRomInfo md_aeroblstRomDesc[] = { - { "aero blasters (jpn).bin", 0x080000, 0xa00da987, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aeroblst) -STD_ROM_FN(md_aeroblst) - -struct BurnDriver BurnDrvmd_aeroblst = { - "md_aeroblst", "md_airbustr", NULL, NULL, "1991", - "Aero Blasters: Trouble Specialty Raid Unit (Jpn)\0", NULL, "Kaneko", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aeroblstRomInfo, md_aeroblstRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Air Diver (USA) -static struct BurnRomInfo md_airdiverRomDesc[] = { - { "air diver (usa).bin", 0x080000, 0x2041885e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_airdiver) -STD_ROM_FN(md_airdiver) - -struct BurnDriver BurnDrvmd_airdiver = { - "md_airdiver", NULL, NULL, NULL, "1990", - "Air Diver (USA)\0", NULL, "Seismic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_airdiverRomInfo, md_airdiverRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Air Diver (Jpn) -static struct BurnRomInfo md_airdiverjRomDesc[] = { - { "air diver (jpn).bin", 0x080000, 0x9e2d5b91, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_airdiverj) -STD_ROM_FN(md_airdiverj) - -struct BurnDriver BurnDrvmd_airdiverj = { - "md_airdiverj", "md_airdiver", NULL, NULL, "1990", - "Air Diver (Jpn)\0", NULL, "Asmik Ace", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_airdiverjRomInfo, md_airdiverjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Disney's Aladdin (Euro) -static struct BurnRomInfo md_aladdinRomDesc[] = { - { "mpr-15939.bin", 0x200000, 0xd1845e8f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aladdin) -STD_ROM_FN(md_aladdin) - -struct BurnDriver BurnDrvmd_aladdin = { - "md_aladdin", NULL, NULL, NULL, "1993", - "Disney's Aladdin (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aladdinRomInfo, md_aladdinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Disney's Aladdin (Jpn) -static struct BurnRomInfo md_aladdinjRomDesc[] = { - { "aladdin (jpn).bin", 0x200000, 0xfb5aacf0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aladdinj) -STD_ROM_FN(md_aladdinj) - -struct BurnDriver BurnDrvmd_aladdinj = { - "md_aladdinj", "md_aladdin", NULL, NULL, "1993", - "Disney's Aladdin (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aladdinjRomInfo, md_aladdinjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Disney's Aladdin (USA) -static struct BurnRomInfo md_aladdinuRomDesc[] = { - { "aladdin (usa).bin", 0x200000, 0xed427ea9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aladdinu) -STD_ROM_FN(md_aladdinu) - -struct BurnDriver BurnDrvmd_aladdinu = { - "md_aladdinu", "md_aladdin", NULL, NULL, "1993", - "Disney's Aladdin (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aladdinuRomInfo, md_aladdinuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Disney's Aladdin (USA, Prototype) -static struct BurnRomInfo md_aladdinupRomDesc[] = { - { "aladdin (usa) (beta).bin", 0x200000, 0x8c60ef73, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aladdinup) -STD_ROM_FN(md_aladdinup) - -struct BurnDriver BurnDrvmd_aladdinup = { - "md_aladdinup", "md_aladdin", NULL, NULL, "1993", - "Disney's Aladdin (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aladdinupRomInfo, md_aladdinupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aladdin II -static struct BurnRomInfo md_aladdin2RomDesc[] = { - { "aladdin ii (unl).bin", 0x200000, 0xbe5f9397, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aladdin2) -STD_ROM_FN(md_aladdin2) - -struct BurnDriver BurnDrvmd_aladdin2 = { - "md_aladdin2", NULL, NULL, NULL, "199?", - "Aladdin II\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aladdin2RomInfo, md_aladdin2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alex Kidd in the Enchanted Castle (Euro) -static struct BurnRomInfo md_alexkidd1RomDesc[] = { - { "alex kidd in the enchanted castle (euro).bin", 0x040000, 0xc3a52529, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alexkidd1) -STD_ROM_FN(md_alexkidd1) - -struct BurnDriver BurnDrvmd_alexkidd1 = { - "md_alexkidd1", "md_alexkidd", NULL, NULL, "1990", - "Alex Kidd in the Enchanted Castle (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alexkidd1RomInfo, md_alexkidd1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alex Kidd in the Enchanted Castle (Jpn) -static struct BurnRomInfo md_alexkiddjRomDesc[] = { - { "alex kidd - tenkuu majou (jpn).bin", 0x040000, 0x8a5ed856, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alexkiddj) -STD_ROM_FN(md_alexkiddj) - -struct BurnDriver BurnDrvmd_alexkiddj = { - "md_alexkiddj", "md_alexkidd", NULL, NULL, "1989", - "Alex Kidd in the Enchanted Castle (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alexkiddjRomInfo, md_alexkiddjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alex Kidd - Cheongong Maseong (Kor) -static struct BurnRomInfo md_alexkiddkRomDesc[] = { - { "alex kidd - cheongong maseong (kor).bin", 0x040000, 0x5b0678fb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alexkiddk) -STD_ROM_FN(md_alexkiddk) - -struct BurnDriver BurnDrvmd_alexkiddk = { - "md_alexkiddk", "md_alexkidd", NULL, NULL, "1990", - "Alex Kidd - Cheongong Maseong (Kor)\0", NULL, "Samsung", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alexkiddkRomInfo, md_alexkiddkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alex Kidd in the Enchanted Castle (USA) -static struct BurnRomInfo md_alexkidduRomDesc[] = { - { "alex kidd in the enchanted castle (usa).bin", 0x040000, 0x47dba0ac, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alexkiddu) -STD_ROM_FN(md_alexkiddu) - -struct BurnDriver BurnDrvmd_alexkiddu = { - "md_alexkiddu", "md_alexkidd", NULL, NULL, "1989", - "Alex Kidd in the Enchanted Castle (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alexkidduRomInfo, md_alexkidduRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alien (Euro, USA, Rev. A) -static struct BurnRomInfo md_alien3RomDesc[] = { - { "mpr-15061a.bin", 0x080000, 0xb327fd1b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alien3) -STD_ROM_FN(md_alien3) - -struct BurnDriver BurnDrvmd_alien3 = { - "md_alien3", NULL, NULL, NULL, "1993", - "Alien3 (Euro, USA, Rev. A)\0", NULL, "Arena Entertainment", "Sega Megadrive", - L"Alien\u00b3 (Euro, USA, Rev. A)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alien3RomInfo, md_alien3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alien (Euro, USA) -static struct BurnRomInfo md_alien3aRomDesc[] = { - { "mpr-15061.bin", 0x080000, 0xa3b00d6e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alien3a) -STD_ROM_FN(md_alien3a) - -struct BurnDriver BurnDrvmd_alien3a = { - "md_alien3a", "md_alien3", NULL, NULL, "1993", - "Alien3 (Euro, USA)\0", NULL, "Arena Entertainment", "Sega Megadrive", - L"Alien\u00b3 (Euro, USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alien3aRomInfo, md_alien3aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alien Soldier (Euro) -static struct BurnRomInfo md_aliensolRomDesc[] = { - { "alien soldier (euro).bin", 0x200000, 0x0496e06c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aliensol) -STD_ROM_FN(md_aliensol) - -struct BurnDriver BurnDrvmd_aliensol = { - "md_aliensol", NULL, NULL, NULL, "1995", - "Alien Soldier (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aliensolRomInfo, md_aliensolRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alien Soldier (Jpn) -static struct BurnRomInfo md_aliensoljRomDesc[] = { - { "alien soldier (jpn).bin", 0x200000, 0x90fa1539, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aliensolj) -STD_ROM_FN(md_aliensolj) - -struct BurnDriver BurnDrvmd_aliensolj = { - "md_aliensolj", "md_aliensol", NULL, NULL, "1995", - "Alien Soldier (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aliensoljRomInfo, md_aliensoljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alien Storm (World) -static struct BurnRomInfo md_astormRomDesc[] = { - { "mpr-13941.bin", 0x080000, 0xf5ac8de5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_astorm) -STD_ROM_FN(md_astorm) - -struct BurnDriver BurnDrvmd_astorm = { - "md_astorm", NULL, NULL, NULL, "1991", - "Alien Storm (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_astormRomInfo, md_astormRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alisia Dragoon (Jpn) -static struct BurnRomInfo md_alisiadjRomDesc[] = { - { "alisia dragoon (jpn).bin", 0x100000, 0x4d476722, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alisiadj) -STD_ROM_FN(md_alisiadj) - -struct BurnDriver BurnDrvmd_alisiadj = { - "md_alisiadj", "md_alisiad", NULL, NULL, "1992", - "Alisia Dragoon (Jpn)\0", NULL, "Game Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alisiadjRomInfo, md_alisiadjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Alisia Dragoon (USA) -static struct BurnRomInfo md_alisiaduRomDesc[] = { - { "alisia dragoon (usa).bin", 0x100000, 0xd28d5c40, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_alisiadu) -STD_ROM_FN(md_alisiadu) - -struct BurnDriver BurnDrvmd_alisiadu = { - "md_alisiadu", "md_alisiad", NULL, NULL, "1992", - "Alisia Dragoon (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_alisiaduRomInfo, md_alisiaduRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Altered Beast (Euro, USA) -static struct BurnRomInfo md_altbeastRomDesc[] = { - { "mpr-12538.bin", 0x080000, 0x154d59bb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_altbeast) -STD_ROM_FN(md_altbeast) - -struct BurnDriver BurnDrvmd_altbeast = { - "md_altbeast", NULL, NULL, NULL, "1989", - "Altered Beast (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_altbeastRomInfo, md_altbeastRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Juuouki (Jpn, v1.1) -static struct BurnRomInfo md_juuoukiRomDesc[] = { - { "juuouki (jpn) (v1.1).bin", 0x080000, 0xb2233e87, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_juuouki) -STD_ROM_FN(md_juuouki) - -struct BurnDriver BurnDrvmd_juuouki = { - "md_juuouki", "md_altbeast", NULL, NULL, "1988", - "Juuouki (Jpn, v1.1)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_juuoukiRomInfo, md_juuoukiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Juuouki (Jpn) -static struct BurnRomInfo md_juuouki1RomDesc[] = { - { "juuouki (jpn).bin", 0x080000, 0x1b7c96c0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_juuouki1) -STD_ROM_FN(md_juuouki1) - -struct BurnDriver BurnDrvmd_juuouki1 = { - "md_juuouki1", "md_altbeast", NULL, NULL, "1988", - "Juuouki (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_juuouki1RomInfo, md_juuouki1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// American Gladiators (USA) -static struct BurnRomInfo md_amergladRomDesc[] = { - { "american gladiators (usa).bin", 0x100000, 0x9952fa85, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_amerglad) -STD_ROM_FN(md_amerglad) - -struct BurnDriver BurnDrvmd_amerglad = { - "md_amerglad", NULL, NULL, NULL, "1992", - "American Gladiators (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_amergladRomInfo, md_amergladRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Andre Agassi Tennis (USA) -static struct BurnRomInfo md_agassiuRomDesc[] = { - { "andre agassi tennis (usa).bin", 0x080000, 0xe755dd51, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_agassiu) -STD_ROM_FN(md_agassiu) - -struct BurnDriver BurnDrvmd_agassiu = { - "md_agassiu", "md_agassi", NULL, NULL, "1992", - "Andre Agassi Tennis (USA)\0", NULL, "TecMagik", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_agassiuRomInfo, md_agassiuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Andre Agassi Tennis (USA, Prototype) -static struct BurnRomInfo md_agassiupRomDesc[] = { - { "andre agassi tennis (usa) (beta).bin", 0x080000, 0x3bbf700d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_agassiup) -STD_ROM_FN(md_agassiup) - -struct BurnDriver BurnDrvmd_agassiup = { - "md_agassiup", "md_agassi", NULL, NULL, "1992", - "Andre Agassi Tennis (USA, Prototype)\0", NULL, "TecMagik", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_agassiupRomInfo, md_agassiupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Animaniacs (Euro) -static struct BurnRomInfo md_animaniaRomDesc[] = { - { "fx014a1.bin", 0x100000, 0x92b6f255, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_animania) -STD_ROM_FN(md_animania) - -struct BurnDriver BurnDrvmd_animania = { - "md_animania", NULL, NULL, NULL, "1994", - "Animaniacs (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_animaniaRomInfo, md_animaniaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Animaniacs (USA) -static struct BurnRomInfo md_animaniauRomDesc[] = { - { "animaniacs (usa).bin", 0x100000, 0x86224d86, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_animaniau) -STD_ROM_FN(md_animaniau) - -struct BurnDriver BurnDrvmd_animaniau = { - "md_animaniau", "md_animania", NULL, NULL, "1994", - "Animaniacs (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_animaniauRomInfo, md_animaniauRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Out of This World (USA) -static struct BurnRomInfo md_ootwRomDesc[] = { - { "out of this world (usa).bin", 0x100000, 0x2da36e01, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ootw) -STD_ROM_FN(md_ootw) - -struct BurnDriver BurnDrvmd_ootw = { - "md_ootw", "md_anotherw", NULL, NULL, "1993", - "Out of This World (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ootwRomInfo, md_ootwRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Out of this World (Prototype) -static struct BurnRomInfo md_ootwpRomDesc[] = { - { "out of this world (beta).bin", 0x100000, 0x3aad905a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ootwp) -STD_ROM_FN(md_ootwp) - -struct BurnDriver BurnDrvmd_ootwp = { - "md_ootwp", "md_anotherw", NULL, NULL, "1993", - "Out of this World (Prototype)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ootwpRomInfo, md_ootwpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aq Renkan Awa (Chi) -static struct BurnRomInfo md_aqrenkRomDesc[] = { - { "aq renkan awa (chi) (unl).bin", 0x100000, 0x2c6cbd77, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aqrenk) -STD_ROM_FN(md_aqrenk) - -struct BurnDriver BurnDrvmd_aqrenk = { - "md_aqrenk", NULL, NULL, NULL, "1995", - "Aq Renkan Awa (Chi)\0", NULL, "C&E", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aqrenkRomInfo, md_aqrenkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Aquatic Games Starring James Pond and the Aquabats (Euro, USA) -static struct BurnRomInfo md_aquagameRomDesc[] = { - { "aqua01.bin", 0x080000, 0x400f4ba7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aquagame) -STD_ROM_FN(md_aquagame) - -struct BurnDriver BurnDrvmd_aquagame = { - "md_aquagame", NULL, NULL, NULL, "1992", - "The Aquatic Games Starring James Pond and the Aquabats (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aquagameRomInfo, md_aquagameRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Arch Rivals (Euro, USA) -static struct BurnRomInfo md_archrivlRomDesc[] = { - { "mpr-14764.bin", 0x080000, 0xe389d7e7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_archrivl) -STD_ROM_FN(md_archrivl) - -struct BurnDriver BurnDrvmd_archrivl = { - "md_archrivl", NULL, NULL, NULL, "1992", - "Arch Rivals (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_archrivlRomInfo, md_archrivlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Arcus Odyssey (USA) -static struct BurnRomInfo md_arcusRomDesc[] = { - { "arcus odyssey (usa).bin", 0x100000, 0xbc4d9b20, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_arcus) -STD_ROM_FN(md_arcus) - -struct BurnDriver BurnDrvmd_arcus = { - "md_arcus", NULL, NULL, NULL, "1991", - "Arcus Odyssey (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arcusRomInfo, md_arcusRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Arcus Odyssey (Jpn) -static struct BurnRomInfo md_arcusjRomDesc[] = { - { "arcus odyssey (jpn).bin", 0x100000, 0x41c5fb4f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_arcusj) -STD_ROM_FN(md_arcusj) - -struct BurnDriver BurnDrvmd_arcusj = { - "md_arcusj", "md_arcus", NULL, NULL, "1991", - "Arcus Odyssey (Jpn)\0", NULL, "Wolf Team", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arcusjRomInfo, md_arcusjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Disney's Ariel the Little Mermaid (Euro, USA) -static struct BurnRomInfo md_arielRomDesc[] = { - { "mpr-15153.bin", 0x080000, 0x58e297df, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ariel) -STD_ROM_FN(md_ariel) - -struct BurnDriver BurnDrvmd_ariel = { - "md_ariel", NULL, NULL, NULL, "1992", - "Disney's Ariel the Little Mermaid (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arielRomInfo, md_arielRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Arnold Palmer Tournament Golf (Euro, USA) -static struct BurnRomInfo md_arnoldpRomDesc[] = { - { "mpr-12645.bin", 0x080000, 0x35b995ef, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_arnoldp) -STD_ROM_FN(md_arnoldp) - -struct BurnDriver BurnDrvmd_arnoldp = { - "md_arnoldp", NULL, NULL, NULL, "1989", - "Arnold Palmer Tournament Golf (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arnoldpRomInfo, md_arnoldpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Naomichi Ozaki no Super Masters (Jpn) -static struct BurnRomInfo md_smastersRomDesc[] = { - { "naomichi ozaki no super masters (jpn).bin", 0x080000, 0x088ba825, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smasters) -STD_ROM_FN(md_smasters) - -struct BurnDriver BurnDrvmd_smasters = { - "md_smasters", "md_arnoldp", NULL, NULL, "1989", - "Naomichi Ozaki no Super Masters (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smastersRomInfo, md_smastersRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Arrow Flash (World) -static struct BurnRomInfo md_arrowRomDesc[] = { - { "mpr-13396.bin", 0x080000, 0xd49f8444, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_arrow) -STD_ROM_FN(md_arrow) - -struct BurnDriver BurnDrvmd_arrow = { - "md_arrow", NULL, NULL, NULL, "1990", - "Arrow Flash (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arrowRomInfo, md_arrowRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Arrow Flash (USA, Prototype) -static struct BurnRomInfo md_arrowpRomDesc[] = { - { "arrowflash.a04c.bin", 0x080000, 0x4d89e66b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_arrowp) -STD_ROM_FN(md_arrowp) - -struct BurnDriver BurnDrvmd_arrowp = { - "md_arrowp", "md_arrow", NULL, NULL, "1990", - "Arrow Flash (USA, Prototype)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arrowpRomInfo, md_arrowpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Art of Fighting (Euro) -static struct BurnRomInfo md_aofRomDesc[] = { - { "art of fighting (euro).bin", 0x200000, 0x9970c422, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aof) -STD_ROM_FN(md_aof) - -struct BurnDriver BurnDrvmd_aof = { - "md_aof", NULL, NULL, NULL, "1994", - "Art of Fighting (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aofRomInfo, md_aofRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Art of Fighting (Prototype, 19940711) -static struct BurnRomInfo md_aofpRomDesc[] = { - { "art of fighting (prototype - jul 11, 1994).bin", 0x200000, 0x19ce567d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aofp) -STD_ROM_FN(md_aofp) - -struct BurnDriver BurnDrvmd_aofp = { - "md_aofp", "md_aof", NULL, NULL, "1994", - "Art of Fighting (Prototype, 19940711)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aofpRomInfo, md_aofpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Art of Fighting (USA) -static struct BurnRomInfo md_aofuRomDesc[] = { - { "art of fighting (usa).bin", 0x200000, 0xc9a57e07, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aofu) -STD_ROM_FN(md_aofu) - -struct BurnDriver BurnDrvmd_aofu = { - "md_aofu", "md_aof", NULL, NULL, "1994", - "Art of Fighting (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aofuRomInfo, md_aofuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ryuuko no Ken (Jpn) -static struct BurnRomInfo md_ryukokenRomDesc[] = { - { "ryuuko no ken (jpn).bin", 0x200000, 0x054cf5f6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ryukoken) -STD_ROM_FN(md_ryukoken) - -struct BurnDriver BurnDrvmd_ryukoken = { - "md_ryukoken", "md_aof", NULL, NULL, "1994", - "Ryuuko no Ken (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ryukokenRomInfo, md_ryukokenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Astrix and the Great Rescue (Euro) -static struct BurnRomInfo md_astergreRomDesc[] = { - { "mpr-15961+mpr-15962.bin", 0x200000, 0x4735fee6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_astergre) -STD_ROM_FN(md_astergre) - -struct BurnDriver BurnDrvmd_astergre = { - "md_astergre", NULL, NULL, NULL, "1993", - "Asterix and the Great Rescue (Euro)\0", NULL, "Sega", "Sega Megadrive", - L"Ast\u00e9rix and the Great Rescue (Euro)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_astergreRomInfo, md_astergreRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Astrix and the Great Rescue (USA) -static struct BurnRomInfo md_astergreuRomDesc[] = { - { "asterix and the great rescue (usa).bin", 0x200000, 0x7f112cd8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_astergreu) -STD_ROM_FN(md_astergreu) - -struct BurnDriver BurnDrvmd_astergreu = { - "md_astergreu", "md_astergre", NULL, NULL, "1994", - "Asterix and the Great Rescue (USA)\0", NULL, "Sega", "Sega Megadrive", - L"Ast\u00e9rix and the Great Rescue (USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_astergreuRomInfo, md_astergreuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Astrix and the Power of the Gods (Euro) -static struct BurnRomInfo md_asterpgRomDesc[] = { - { "mpr-17719.bin", 0x200000, 0x4ff1d83f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_asterpg) -STD_ROM_FN(md_asterpg) - -struct BurnDriver BurnDrvmd_asterpg = { - "md_asterpg", NULL, NULL, NULL, "1995", - "Asterix and the Power of the Gods (Euro)\0", NULL, "Sega", "Sega Megadrive", - L"Ast\u00e9rix and the Power of the Gods (Euro)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_asterpgRomInfo, md_asterpgRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Astrix and the Power of the Gods (Euro, Prototype) -static struct BurnRomInfo md_asterpgpRomDesc[] = { - { "asterix and the power of the gods (euro) (beta).bin", 0x200000, 0x45c8b5b7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_asterpgp) -STD_ROM_FN(md_asterpgp) - -struct BurnDriver BurnDrvmd_asterpgp = { - "md_asterpgp", "md_asterpg", NULL, NULL, "1995", - "Asterix and the Power of the Gods (Euro, Prototype)\0", NULL, "Sega", "Sega Megadrive", - L"Ast\u00e9rix and the Power of the Gods (Euro, Prototype)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_asterpgpRomInfo, md_asterpgpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Atomic Robo-Kid (USA) -static struct BurnRomInfo md_atomroboRomDesc[] = { - { "atomic robo-kid (usa).bin", 0x080000, 0x7cd8169e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atomrobo) -STD_ROM_FN(md_atomrobo) - -struct BurnDriver BurnDrvmd_atomrobo = { - "md_atomrobo", NULL, NULL, NULL, "1990", - "Atomic Robo-Kid (USA)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_atomroboRomInfo, md_atomroboRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Atomic Robo-Kid (Jpn) -static struct BurnRomInfo md_atomrobojRomDesc[] = { - { "mpr-13483.bin", 0x080000, 0xe833067e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atomroboj) -STD_ROM_FN(md_atomroboj) - -struct BurnDriver BurnDrvmd_atomroboj = { - "md_atomroboj", "md_atomrobo", NULL, NULL, "1990", - "Atomic Robo-Kid (Jpn)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_atomrobojRomInfo, md_atomrobojRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Atomic Runner (Euro) -static struct BurnRomInfo md_atomrunRomDesc[] = { - { "mpr-15286.bin", 0x100000, 0xb3c05418, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atomrun) -STD_ROM_FN(md_atomrun) - -struct BurnDriver BurnDrvmd_atomrun = { - "md_atomrun", NULL, NULL, NULL, "1992", - "Atomic Runner (Euro)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_atomrunRomInfo, md_atomrunRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Atomic Runner (USA) -static struct BurnRomInfo md_atomrunuRomDesc[] = { - { "atomic runner (usa).bin", 0x100000, 0x0677c210, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atomrunu) -STD_ROM_FN(md_atomrunu) - -struct BurnDriver BurnDrvmd_atomrunu = { - "md_atomrunu", "md_atomrun", NULL, NULL, "1992", - "Atomic Runner (USA)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_atomrunuRomInfo, md_atomrunuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chelnov (Jpn) -static struct BurnRomInfo md_chelnovRomDesc[] = { - { "chelnov (jpn).bin", 0x100000, 0xb2fe74d8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chelnov) -STD_ROM_FN(md_chelnov) - -struct BurnDriver BurnDrvmd_chelnov = { - "md_chelnov", "md_atomrun", NULL, NULL, "1992", - "Chelnov (Jpn)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chelnovRomInfo, md_chelnovRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ATP Tour Championship Tennis (Euro) -static struct BurnRomInfo md_atptourRomDesc[] = { - { "atp tour (euro).bin", 0x200000, 0x1a3da8c5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atptour) -STD_ROM_FN(md_atptour) - -struct BurnDriver BurnDrvmd_atptour = { - "md_atptour", NULL, NULL, NULL, "1995", - "ATP Tour Championship Tennis (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_atptourRomInfo, md_atptourRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ATP Tour Championship Tennis (Prototype, 19940802) -static struct BurnRomInfo md_atptourp4RomDesc[] = { - { "atp tour championship tennis (prototype - aug 02, 1994).bin", 0x200000, 0x686a9fa1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atptourp4) -STD_ROM_FN(md_atptourp4) - -struct BurnDriver BurnDrvmd_atptourp4 = { - "md_atptourp4", "md_atptour", NULL, NULL, "1994", - "ATP Tour Championship Tennis (Prototype, 19940802)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_atptourp4RomInfo, md_atptourp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ATP Tour Championship Tennis (Prototype, 19940805) -static struct BurnRomInfo md_atptourp3RomDesc[] = { - { "atp tour championship tennis (prototype - aug 05, 1994).bin", 0x200000, 0xa1fef967, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atptourp3) -STD_ROM_FN(md_atptourp3) - -struct BurnDriver BurnDrvmd_atptourp3 = { - "md_atptourp3", "md_atptour", NULL, NULL, "1994", - "ATP Tour Championship Tennis (Prototype, 19940805)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_atptourp3RomInfo, md_atptourp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ATP Tour Championship Tennis (Prototype, 19940808) -static struct BurnRomInfo md_atptourp2RomDesc[] = { - { "atp tour championship tennis (prototype - aug 08, 1994).bin", 0x200000, 0xe6398864, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atptourp2) -STD_ROM_FN(md_atptourp2) - -struct BurnDriver BurnDrvmd_atptourp2 = { - "md_atptourp2", "md_atptour", NULL, NULL, "1994", - "ATP Tour Championship Tennis (Prototype, 19940808)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_atptourp2RomInfo, md_atptourp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ATP Tour Championship Tennis (Prototype, 19940719) -static struct BurnRomInfo md_atptourp6RomDesc[] = { - { "atp tour championship tennis (prototype - jul 19, 1994).bin", 0x200000, 0xcb927488, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atptourp6) -STD_ROM_FN(md_atptourp6) - -struct BurnDriver BurnDrvmd_atptourp6 = { - "md_atptourp6", "md_atptour", NULL, NULL, "1994", - "ATP Tour Championship Tennis (Prototype, 19940719)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_atptourp6RomInfo, md_atptourp6RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ATP Tour Championship Tennis (Prototype, 19940723) -static struct BurnRomInfo md_atptourp5RomDesc[] = { - { "atp tour championship tennis (prototype - jul 23, 1994).bin", 0x200000, 0xa15d5051, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atptourp5) -STD_ROM_FN(md_atptourp5) - -struct BurnDriver BurnDrvmd_atptourp5 = { - "md_atptourp5", "md_atptour", NULL, NULL, "1994", - "ATP Tour Championship Tennis (Prototype, 19940723)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_atptourp5RomInfo, md_atptourp5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ATP Tour Championship Tennis (Prototype, 19940509) -static struct BurnRomInfo md_atptourp7RomDesc[] = { - { "atp tour championship tennis (prototype - may 09, 1994).bin", 0x200000, 0xb17a8dbc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atptourp7) -STD_ROM_FN(md_atptourp7) - -struct BurnDriver BurnDrvmd_atptourp7 = { - "md_atptourp7", "md_atptour", NULL, NULL, "1994", - "ATP Tour Championship Tennis (Prototype, 19940509)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_atptourp7RomInfo, md_atptourp7RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ATP Tour Championship Tennis (Prototype, 19940908) -static struct BurnRomInfo md_atptourp1RomDesc[] = { - { "atp tour championship tennis (prototype - sep 08, 1994).bin", 0x200000, 0xb83f4ca4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atptourp1) -STD_ROM_FN(md_atptourp1) - -struct BurnDriver BurnDrvmd_atptourp1 = { - "md_atptourp1", "md_atptour", NULL, NULL, "1994", - "ATP Tour Championship Tennis (Prototype, 19940908)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_atptourp1RomInfo, md_atptourp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ATP Tour Championship Tennis (USA) -static struct BurnRomInfo md_atptouruRomDesc[] = { - { "atp tour championship tennis (usa).bin", 0x200000, 0x8c822884, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_atptouru) -STD_ROM_FN(md_atptouru) - -struct BurnDriver BurnDrvmd_atptouru = { - "md_atptouru", "md_atptour", NULL, NULL, "1994", - "ATP Tour Championship Tennis (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_atptouruRomInfo, md_atptouruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Australian Rugby League (Euro) -static struct BurnRomInfo md_austrarlRomDesc[] = { - { "australian rugby league (euro).bin", 0x200000, 0xac5bc26a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_austrarl) -STD_ROM_FN(md_austrarl) - -struct BurnDriver BurnDrvmd_austrarl = { - "md_austrarl", NULL, NULL, NULL, "1994", - "Australian Rugby League (Euro)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_austrarlRomInfo, md_austrarlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Awesome Possum (USA) -static struct BurnRomInfo md_awepossmRomDesc[] = { - { "awesome possum (usa).bin", 0x200000, 0x1f07577f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_awepossm) -STD_ROM_FN(md_awepossm) - -struct BurnDriver BurnDrvmd_awepossm = { - "md_awepossm", NULL, NULL, NULL, "1993", - "Awesome Possum (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_awepossmRomInfo, md_awepossmRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Awesome Possum (USA, Prototype) -static struct BurnRomInfo md_awepossmpRomDesc[] = { - { "awesome possum (usa) (beta).bin", 0x200000, 0x0158dc53, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_awepossmp) -STD_ROM_FN(md_awepossmp) - -struct BurnDriver BurnDrvmd_awepossmp = { - "md_awepossmp", "md_awepossm", NULL, NULL, "1993", - "Awesome Possum (USA, Prototype)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_awepossmpRomInfo, md_awepossmpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aworg (Jpn, SegaNet) -static struct BurnRomInfo md_aworgRomDesc[] = { - { "aworg (jpn) (sn).bin", 0x040000, 0x069c27c1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_aworg) -STD_ROM_FN(md_aworg) - -struct BurnDriver BurnDrvmd_aworg = { - "md_aworg", NULL, NULL, NULL, "1991", - "Aworg (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_aworgRomInfo, md_aworgRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// AWS Pro Moves Soccer (USA) -static struct BurnRomInfo md_awsproRomDesc[] = { - { "aws pro moves soccer (usa).bin", 0x080000, 0x707017e5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_awspro) -STD_ROM_FN(md_awspro) - -struct BurnDriver BurnDrvmd_awspro = { - "md_awspro", NULL, NULL, NULL, "1993", - "AWS Pro Moves Soccer (USA)\0", NULL, "ASCII Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_awsproRomInfo, md_awsproRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ayrton Senna's Super Monaco GP II (Euro, Jpn) -static struct BurnRomInfo md_smgp2RomDesc[] = { - { "mpr-14861.bin", 0x100000, 0x60af0f76, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smgp2) -STD_ROM_FN(md_smgp2) - -struct BurnDriver BurnDrvmd_smgp2 = { - "md_smgp2", NULL, NULL, NULL, "1992", - "Ayrton Senna's Super Monaco GP II (Euro, Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_smgp2RomInfo, md_smgp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ayrton Senna's Super Monaco GP II (USA) -static struct BurnRomInfo md_smgp2uRomDesc[] = { - { "ayrton senna's super monaco gp ii (usa).bin", 0x100000, 0xeac8ded6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smgp2u) -STD_ROM_FN(md_smgp2u) - -struct BurnDriver BurnDrvmd_smgp2u = { - "md_smgp2u", "md_smgp2", NULL, NULL, "1992", - "Ayrton Senna's Super Monaco GP II (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_smgp2uRomInfo, md_smgp2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// B.O.B. (Euro, USA) -static struct BurnRomInfo md_bobRomDesc[] = { - { "b.o.b. (euro, usa).bin", 0x100000, 0xeaa2acb7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bob) -STD_ROM_FN(md_bob) - -struct BurnDriver BurnDrvmd_bob = { - "md_bob", NULL, NULL, NULL, "1993", - "B.O.B. (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bobRomInfo, md_bobRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// B.O.B. (USA, Prototype) -static struct BurnRomInfo md_bobpRomDesc[] = { - { "b.o.b. (usa) (beta).bin", 0x100000, 0xe3e8421e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bobp) -STD_ROM_FN(md_bobp) - -struct BurnDriver BurnDrvmd_bobp = { - "md_bobp", "md_bob", NULL, NULL, "1993", - "B.O.B. (USA, Prototype)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bobpRomInfo, md_bobpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Space Funky B.O.B. (Jpn) -static struct BurnRomInfo md_spacebobRomDesc[] = { - { "space funky b.o.b. (jpn).bin", 0x100000, 0xe9310d3b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spacebob) -STD_ROM_FN(md_spacebob) - -struct BurnDriver BurnDrvmd_spacebob = { - "md_spacebob", "md_bob", NULL, NULL, "1993", - "Space Funky B.O.B. (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spacebobRomInfo, md_spacebobRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Baby Boom (Prototype, 19940811) -static struct BurnRomInfo md_babyboomRomDesc[] = { - { "baby boom (prototype - aug 11, 1994).bin", 0x200000, 0xbd697054, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_babyboom) -STD_ROM_FN(md_babyboom) - -struct BurnDriver BurnDrvmd_babyboom = { - "md_babyboom", NULL, NULL, NULL, "199?", - "Baby Boom (Prototype, 19940811)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_babyboomRomInfo, md_babyboomRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Baby Boom (Prototype, 19940603) -static struct BurnRomInfo md_babyboom1RomDesc[] = { - { "baby boom (prototype - jun 03, 1994).bin", 0x200000, 0xc0d97f6f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_babyboom1) -STD_ROM_FN(md_babyboom1) - -struct BurnDriver BurnDrvmd_babyboom1 = { - "md_babyboom1", "md_babyboom", NULL, NULL, "199?", - "Baby Boom (Prototype, 19940603)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_babyboom1RomInfo, md_babyboom1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Baby Boom (Prototype, 19940606) -static struct BurnRomInfo md_babyboom2RomDesc[] = { - { "baby boom (prototype - jun 06, 1994).bin", 0x200000, 0x6e0cf48d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_babyboom2) -STD_ROM_FN(md_babyboom2) - -struct BurnDriver BurnDrvmd_babyboom2 = { - "md_babyboom2", "md_babyboom", NULL, NULL, "199?", - "Baby Boom (Prototype, 19940606)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_babyboom2RomInfo, md_babyboom2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Baby's Day Out (USA, Prototype) -static struct BurnRomInfo md_babydRomDesc[] = { - { "baby's day out (usa) (prototype).bin", 0x100000, 0xb2e7cc49, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_babyd) -STD_ROM_FN(md_babyd) - -struct BurnDriver BurnDrvmd_babyd = { - "md_babyd", NULL, NULL, NULL, "199?", - "Baby's Day Out (USA, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_babydRomInfo, md_babydRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Baby's Day Out (USA, Prototype, Earlier) -static struct BurnRomInfo md_babydoRomDesc[] = { - { "baby's day out (usa) (prototype) (earlier).bin", 0x100000, 0x459b891c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_babydo) -STD_ROM_FN(md_babydo) - -struct BurnDriver BurnDrvmd_babydo = { - "md_babydo", "md_babyd", NULL, NULL, "199?", - "Baby's Day Out (USA, Prototype, Earlier)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_babydoRomInfo, md_babydoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Back to the Future Part III (Euro) -static struct BurnRomInfo md_backtof3RomDesc[] = { - { "mpr-14328.bin", 0x080000, 0x2737f92e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_backtof3) -STD_ROM_FN(md_backtof3) - -struct BurnDriver BurnDrvmd_backtof3 = { - "md_backtof3", NULL, NULL, NULL, "1991", - "Back to the Future Part III (Euro)\0", NULL, "Imageworks", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_backtof3RomInfo, md_backtof3RomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Back to the Future Part III (USA) -static struct BurnRomInfo md_backtof3uRomDesc[] = { - { "back to the future part iii (usa).bin", 0x080000, 0x66a388c3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_backtof3u) -STD_ROM_FN(md_backtof3u) - -struct BurnDriver BurnDrvmd_backtof3u = { - "md_backtof3u", "md_backtof3", NULL, NULL, "1991", - "Back to the Future Part III (USA)\0", NULL, "Arena Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_backtof3uRomInfo, md_backtof3uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bahamut Senki (Jpn) -static struct BurnRomInfo md_bahamutsRomDesc[] = { - { "mpr-13677.bin", 0x080000, 0xb1e268da, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bahamuts) -STD_ROM_FN(md_bahamuts) - -struct BurnDriver BurnDrvmd_bahamuts = { - "md_bahamuts", NULL, NULL, NULL, "1991", - "Bahamut Senki (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_bahamutsRomInfo, md_bahamutsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ball Jacks (Euro, Jpn) -static struct BurnRomInfo md_balljackRomDesc[] = { - { "ball jacks (euro, jpn).bin", 0x040000, 0xf5c3c54f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_balljack) -STD_ROM_FN(md_balljack) - -struct BurnDriver BurnDrvmd_balljack = { - "md_balljack", NULL, NULL, NULL, "1993", - "Ball Jacks (Euro, Jpn)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_balljackRomInfo, md_balljackRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ballz 3D (Euro, USA) -static struct BurnRomInfo md_ballz3dRomDesc[] = { - { "ballz 3d - fighting at its ballziest (euro, usa).bin", 0x200000, 0xb362b705, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ballz3d) -STD_ROM_FN(md_ballz3d) - -struct BurnDriver BurnDrvmd_ballz3d = { - "md_ballz3d", NULL, NULL, NULL, "1994", - "Ballz 3D (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ballz3dRomInfo, md_ballz3dRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Barbie Super Model (USA) -static struct BurnRomInfo md_barbiesmRomDesc[] = { - { "barbie super model (usa).bin", 0x100000, 0x81c9662b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_barbiesm) -STD_ROM_FN(md_barbiesm) - -struct BurnDriver BurnDrvmd_barbiesm = { - "md_barbiesm", NULL, NULL, NULL, "1992", - "Barbie Super Model (USA)\0", NULL, "Hi Tech Expressions", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_barbiesmRomInfo, md_barbiesmRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Barbie Vacation Adventure (USA, Prototype) -static struct BurnRomInfo md_barbvacRomDesc[] = { - { "barbie vacation adventure (usa) (prototype).bin", 0x100000, 0x10e0ba69, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_barbvac) -STD_ROM_FN(md_barbvac) - -struct BurnDriver BurnDrvmd_barbvac = { - "md_barbvac", NULL, NULL, NULL, "1994", - "Barbie Vacation Adventure (USA, Prototype)\0", NULL, "Hi Tech Expressions", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_barbvacRomInfo, md_barbvacRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Barkley Shut Up and Jam! (Euro, USA) -static struct BurnRomInfo md_barkleyRomDesc[] = { - { "barkley shut up and jam! (euro, usa).bin", 0x100000, 0x63fbf497, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_barkley) -STD_ROM_FN(md_barkley) - -struct BurnDriver BurnDrvmd_barkley = { - "md_barkley", NULL, NULL, NULL, "1993", - "Barkley Shut Up and Jam! (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_barkleyRomInfo, md_barkleyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Barkley Shut Up and Jam! 2 (USA) -static struct BurnRomInfo md_barkley2RomDesc[] = { - { "barkley shut up and jam! 2 (usa).bin", 0x200000, 0x321bb6bd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_barkley2) -STD_ROM_FN(md_barkley2) - -struct BurnDriver BurnDrvmd_barkley2 = { - "md_barkley2", NULL, NULL, NULL, "1995", - "Barkley Shut Up and Jam! 2 (USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_barkley2RomInfo, md_barkley2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Barkley Shut Up and Jam! 2 (USA, Prototype) -static struct BurnRomInfo md_barkley2pRomDesc[] = { - { "barkley shut up and jam! 2 (usa) (beta).bin", 0x200000, 0xde27357b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_barkley2p) -STD_ROM_FN(md_barkley2p) - -struct BurnDriver BurnDrvmd_barkley2p = { - "md_barkley2p", "md_barkley2", NULL, NULL, "1995", - "Barkley Shut Up and Jam! 2 (USA, Prototype)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_barkley2pRomInfo, md_barkley2pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Barney's Hide & Seek Game (USA) -static struct BurnRomInfo md_barneyRomDesc[] = { - { "barney's hide & seek game (usa).bin", 0x100000, 0x1efa9d53, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_barney) -STD_ROM_FN(md_barney) - -struct BurnDriver BurnDrvmd_barney = { - "md_barney", NULL, NULL, NULL, "1993", - "Barney's Hide & Seek Game (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_barneyRomInfo, md_barneyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Barver Battle Saga - Tai Kong Zhan Shi (Chi) -static struct BurnRomInfo md_barverRomDesc[] = { - { "barver battle saga - tai kong zhan shi (chi) (unl).bin", 0x200000, 0xd37a37c6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_barver) -STD_ROM_FN(md_barver) - -struct BurnDriver BurnDrvmd_barver = { - "md_barver", NULL, NULL, NULL, "199?", - "Barver Battle Saga - Tai Kong Zhan Shi (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_barverRomInfo, md_barverRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// BASS Masters Classic (USA) -static struct BurnRomInfo md_bassmcRomDesc[] = { - { "bass masters classic (usa).bin", 0x200000, 0xcf1ff00a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bassmc) -STD_ROM_FN(md_bassmc) - -struct BurnDriver BurnDrvmd_bassmc = { - "md_bassmc", NULL, NULL, NULL, "1995", - "BASS Masters Classic (USA)\0", NULL, "Black Pearl", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bassmcRomInfo, md_bassmcRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// BASS Masters Classic - Pro Edition (USA) -static struct BurnRomInfo md_bassmproRomDesc[] = { - { "bass masters classic - pro edition (usa).bin", 0x200000, 0x9eddeb3d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bassmpro) -STD_ROM_FN(md_bassmpro) - -struct BurnDriver BurnDrvmd_bassmpro = { - "md_bassmpro", NULL, NULL, NULL, "1996", - "BASS Masters Classic - Pro Edition (USA)\0", NULL, "THQ", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bassmproRomInfo, md_bassmproRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Batman (Jpn) -static struct BurnRomInfo md_batmanjRomDesc[] = { - { "batman (jpn).bin", 0x080000, 0xd7b4febf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_batmanj) -STD_ROM_FN(md_batmanj) - -struct BurnDriver BurnDrvmd_batmanj = { - "md_batmanj", "md_batman", NULL, NULL, "1990", - "Batman (Jpn)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_batmanjRomInfo, md_batmanjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Batman (USA) -static struct BurnRomInfo md_batmanuRomDesc[] = { - { "batman (usa).bin", 0x080000, 0x017410ae, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_batmanu) -STD_ROM_FN(md_batmanu) - -struct BurnDriver BurnDrvmd_batmanu = { - "md_batmanu", "md_batman", NULL, NULL, "1990", - "Batman (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_batmanuRomInfo, md_batmanuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Batman - Revenge of the Joker (USA) -static struct BurnRomInfo md_batmanrjRomDesc[] = { - { "batman - revenge of the joker (usa).bin", 0x100000, 0xcaa044a1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_batmanrj) -STD_ROM_FN(md_batmanrj) - -struct BurnDriver BurnDrvmd_batmanrj = { - "md_batmanrj", NULL, NULL, NULL, "1992", - "Batman - Revenge of the Joker (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_batmanrjRomInfo, md_batmanrjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Batman Forever (World) -static struct BurnRomInfo md_batmanfRomDesc[] = { - { "batman forever (world).bin", 0x300000, 0x8b723d01, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_batmanf) -STD_ROM_FN(md_batmanf) - -struct BurnDriver BurnDrvmd_batmanf = { - "md_batmanf", NULL, NULL, NULL, "1995", - "Batman Forever (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_batmanfRomInfo, md_batmanfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Battle Golfer Yui (Jpn) -static struct BurnRomInfo md_battlyuiRomDesc[] = { - { "battle golfer yui (jpn).bin", 0x080000, 0x4aa03e4e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_battlyui) -STD_ROM_FN(md_battlyui) - -struct BurnDriver BurnDrvmd_battlyui = { - "md_battlyui", NULL, NULL, NULL, "1991", - "Battle Golfer Yui (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_battlyuiRomInfo, md_battlyuiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Battle Mania Daiginjou (Jpn, Kor) -static struct BurnRomInfo md_btlmanidRomDesc[] = { - { "battle mania daiginjou (jpn, kor).bin", 0x100000, 0x312fa0f2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_btlmanid) -STD_ROM_FN(md_btlmanid) - -struct BurnDriver BurnDrvmd_btlmanid = { - "md_btlmanid", NULL, NULL, NULL, "1993", - "Battle Mania Daiginjou (Jpn, Kor)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_btlmanidRomInfo, md_btlmanidRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Battle Squadron (Euro, USA) -static struct BurnRomInfo md_battlesqRomDesc[] = { - { "battle squadron (euro, usa).bin", 0x080000, 0x0feaa8bf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_battlesq) -STD_ROM_FN(md_battlesq) - -struct BurnDriver BurnDrvmd_battlesq = { - "md_battlesq", NULL, NULL, NULL, "1990", - "Battle Squadron (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_battlesqRomInfo, md_battlesqRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Battlemaster (USA) -static struct BurnRomInfo md_battlemsRomDesc[] = { - { "battlemaster (usa).bin", 0x080000, 0xfd2b35e3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_battlems) -STD_ROM_FN(md_battlems) - -struct BurnDriver BurnDrvmd_battlems = { - "md_battlems", NULL, NULL, NULL, "1991", - "Battlemaster (USA)\0", NULL, "Arena Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_battlemsRomInfo, md_battlemsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// BattleTech (USA) -static struct BurnRomInfo md_btechRomDesc[] = { - { "battletech - a game of armored combat (usa).bin", 0x200000, 0x409e5d14, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_btech) -STD_ROM_FN(md_btech) - -struct BurnDriver BurnDrvmd_btech = { - "md_btech", NULL, NULL, NULL, "1994", - "BattleTech (USA)\0", NULL, "Extreme Entertainment Group", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_btechRomInfo, md_btechRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Battletoads & Double Dragon - The Ultimate Team (USA) -static struct BurnRomInfo md_btoadsddRomDesc[] = { - { "battletoads & double dragon (usa).bin", 0x100000, 0x8239dd17, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_btoadsdd) -STD_ROM_FN(md_btoadsdd) - -struct BurnDriver BurnDrvmd_btoadsdd = { - "md_btoadsdd", NULL, NULL, NULL, "1993", - "Battletoads & Double Dragon - The Ultimate Team (USA)\0", NULL, "Tradewest", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_btoadsddRomInfo, md_btoadsddRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Battletoads (World) -static struct BurnRomInfo md_btoadsRomDesc[] = { - { "battletoads (world).bin", 0x080000, 0xd10e103a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_btoads) -STD_ROM_FN(md_btoads) - -struct BurnDriver BurnDrvmd_btoads = { - "md_btoads", NULL, NULL, NULL, "1991", - "Battletoads (World)\0", NULL, "Tradewest", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_btoadsRomInfo, md_btoadsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Beastball (Prototype) -static struct BurnRomInfo md_beastbalRomDesc[] = { - { "beast ball.bin", 0x0fb8e0, 0x6a176576, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beastbal) -STD_ROM_FN(md_beastbal) - -struct BurnDriver BurnDrvmd_beastbal = { - "md_beastbal", NULL, NULL, NULL, "199?", - "Beastball (Prototype)\0", NULL, "Spectrum Holobyte", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beastbalRomInfo, md_beastbalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Beast Wrestler (USA) -static struct BurnRomInfo md_beastwRomDesc[] = { - { "beast wrestler (usa).bin", 0x100000, 0x0ca5bb64, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beastw) -STD_ROM_FN(md_beastw) - -struct BurnDriver BurnDrvmd_beastw = { - "md_beastw", NULL, NULL, NULL, "1991", - "Beast Wrestler (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beastwRomInfo, md_beastwRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Beast Warriors (Jpn) -static struct BurnRomInfo md_beastwjRomDesc[] = { - { "beast warriors (jpn).bin", 0x100000, 0x4646c694, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beastwj) -STD_ROM_FN(md_beastwj) - -struct BurnDriver BurnDrvmd_beastwj = { - "md_beastwj", "md_beastw", NULL, NULL, "1991", - "Beast Warriors (Jpn)\0", NULL, "Riot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beastwjRomInfo, md_beastwjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Disney's Beauty and the Beast - Belle's Quest (USA) -static struct BurnRomInfo md_beautyRomDesc[] = { - { "beauty and the beast - belle's quest (usa).bin", 0x100000, 0xbefb6fae, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beauty) -STD_ROM_FN(md_beauty) - -struct BurnDriver BurnDrvmd_beauty = { - "md_beauty", NULL, NULL, NULL, "1993", - "Disney's Beauty and the Beast - Belle's Quest (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beautyRomInfo, md_beautyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Disney's Beauty and the Beast - Roar of the Beast (USA) -static struct BurnRomInfo md_beautyrbRomDesc[] = { - { "beauty and the beast - roar of the beast (usa).bin", 0x100000, 0x13e7b519, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beautyrb) -STD_ROM_FN(md_beautyrb) - -struct BurnDriver BurnDrvmd_beautyrb = { - "md_beautyrb", NULL, NULL, NULL, "1993", - "Disney's Beauty and the Beast - Roar of the Beast (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beautyrbRomInfo, md_beautyrbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Beavis and Butt-Head (Euro) -static struct BurnRomInfo md_beavisRomDesc[] = { - { "beavis and butt-head (euro).bin", 0x200000, 0xc7b6435e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beavis) -STD_ROM_FN(md_beavis) - -struct BurnDriver BurnDrvmd_beavis = { - "md_beavis", NULL, NULL, NULL, "1994", - "Beavis and Butt-Head (Euro)\0", NULL, "Viacom New Media", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beavisRomInfo, md_beavisRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Beavis and Butt-Head (USA) -static struct BurnRomInfo md_beavisuRomDesc[] = { - { "beavis and butt-head (usa).bin", 0x200000, 0xf5d7b948, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beavisu) -STD_ROM_FN(md_beavisu) - -struct BurnDriver BurnDrvmd_beavisu = { - "md_beavisu", "md_beavis", NULL, NULL, "1994", - "Beavis and Butt-Head (USA)\0", NULL, "Viacom New Media", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beavisuRomInfo, md_beavisuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Beavis and Butt-Head (USA, Prototype) -static struct BurnRomInfo md_beavisupRomDesc[] = { - { "beavis and butt-head (usa) (beta).bin", 0x200000, 0x81ed5335, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beavisup) -STD_ROM_FN(md_beavisup) - -struct BurnDriver BurnDrvmd_beavisup = { - "md_beavisup", "md_beavis", NULL, NULL, "1994", - "Beavis and Butt-Head (USA, Prototype)\0", NULL, "Viacom New Media", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beavisupRomInfo, md_beavisupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (USA) -static struct BurnRomInfo md_berensRomDesc[] = { - { "berenstain bears' camping adventure, the (usa).bin", 0x100000, 0x1f86237b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berens) -STD_ROM_FN(md_berens) - -struct BurnDriver BurnDrvmd_berens = { - "md_berens", NULL, NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensRomInfo, md_berensRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940428) -static struct BurnRomInfo md_berensp19RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - apr 28, 1994).bin", 0x100000, 0xf222e946, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp19) -STD_ROM_FN(md_berensp19) - -struct BurnDriver BurnDrvmd_berensp19 = { - "md_berensp19", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940428)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp19RomInfo, md_berensp19RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940429) -static struct BurnRomInfo md_berensp18RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - apr 29, 1994).bin", 0x100000, 0xe21493b4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp18) -STD_ROM_FN(md_berensp18) - -struct BurnDriver BurnDrvmd_berensp18 = { - "md_berensp18", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940429)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp18RomInfo, md_berensp18RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940801) -static struct BurnRomInfo md_berensp05RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - aug 01, 1994).bin", 0x100000, 0xb7cd465c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp05) -STD_ROM_FN(md_berensp05) - -struct BurnDriver BurnDrvmd_berensp05 = { - "md_berensp05", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940801)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp05RomInfo, md_berensp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940802) -static struct BurnRomInfo md_berensp04RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - aug 02, 1994).bin", 0x100000, 0x383ad564, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp04) -STD_ROM_FN(md_berensp04) - -struct BurnDriver BurnDrvmd_berensp04 = { - "md_berensp04", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940802)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp04RomInfo, md_berensp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940803) -static struct BurnRomInfo md_berensp03RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - aug 03, 1994).bin", 0x100000, 0x18f268a6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp03) -STD_ROM_FN(md_berensp03) - -struct BurnDriver BurnDrvmd_berensp03 = { - "md_berensp03", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940803)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp03RomInfo, md_berensp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940805) -static struct BurnRomInfo md_berensp02RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - aug 05, 1994).bin", 0x100000, 0x24159b6f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp02) -STD_ROM_FN(md_berensp02) - -struct BurnDriver BurnDrvmd_berensp02 = { - "md_berensp02", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940805)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp02RomInfo, md_berensp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940808) -static struct BurnRomInfo md_berensp01RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - aug 08, 1994).bin", 0x100000, 0x58b6b0fc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp01) -STD_ROM_FN(md_berensp01) - -struct BurnDriver BurnDrvmd_berensp01 = { - "md_berensp01", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940808)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp01RomInfo, md_berensp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940709) -static struct BurnRomInfo md_berensp08RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - jul 09, 1994).bin", 0x100000, 0xbf6aa405, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp08) -STD_ROM_FN(md_berensp08) - -struct BurnDriver BurnDrvmd_berensp08 = { - "md_berensp08", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940709)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp08RomInfo, md_berensp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940716) -static struct BurnRomInfo md_berensp07RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - jul 16, 1994).bin", 0x100000, 0xc84aad8e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp07) -STD_ROM_FN(md_berensp07) - -struct BurnDriver BurnDrvmd_berensp07 = { - "md_berensp07", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940716)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp07RomInfo, md_berensp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940720) -static struct BurnRomInfo md_berensp06RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - jul 20, 1994).bin", 0x100000, 0xabee4c5e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp06) -STD_ROM_FN(md_berensp06) - -struct BurnDriver BurnDrvmd_berensp06 = { - "md_berensp06", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940720)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp06RomInfo, md_berensp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940602) -static struct BurnRomInfo md_berensp10RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - jun 02, 1994).bin", 0x100000, 0x83cf19e4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp10) -STD_ROM_FN(md_berensp10) - -struct BurnDriver BurnDrvmd_berensp10 = { - "md_berensp10", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940602)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp10RomInfo, md_berensp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940610) -static struct BurnRomInfo md_berensp09RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - jun 10, 1994).bin", 0x100000, 0xa748e2cf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp09) -STD_ROM_FN(md_berensp09) - -struct BurnDriver BurnDrvmd_berensp09 = { - "md_berensp09", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940610)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp09RomInfo, md_berensp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940323) -static struct BurnRomInfo md_berensp20RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - mar 23, 1994).bin", 0x100000, 0xbfbcd7cc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp20) -STD_ROM_FN(md_berensp20) - -struct BurnDriver BurnDrvmd_berensp20 = { - "md_berensp20", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940323)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp20RomInfo, md_berensp20RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940506) -static struct BurnRomInfo md_berensp17RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - may 06, 1994).bin", 0x100000, 0x713c14d8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp17) -STD_ROM_FN(md_berensp17) - -struct BurnDriver BurnDrvmd_berensp17 = { - "md_berensp17", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940506)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp17RomInfo, md_berensp17RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940511) -static struct BurnRomInfo md_berensp16RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - may 11, 1994).bin", 0x100000, 0xf7b81c6a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp16) -STD_ROM_FN(md_berensp16) - -struct BurnDriver BurnDrvmd_berensp16 = { - "md_berensp16", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940511)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp16RomInfo, md_berensp16RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940517) -static struct BurnRomInfo md_berensp15RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - may 17, 1994).bin", 0x100000, 0xe1855ade, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp15) -STD_ROM_FN(md_berensp15) - -struct BurnDriver BurnDrvmd_berensp15 = { - "md_berensp15", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940517)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp15RomInfo, md_berensp15RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940519) -static struct BurnRomInfo md_berensp14RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - may 19, 1994).bin", 0x100000, 0x07c9f71f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp14) -STD_ROM_FN(md_berensp14) - -struct BurnDriver BurnDrvmd_berensp14 = { - "md_berensp14", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940519)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp14RomInfo, md_berensp14RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940523) -static struct BurnRomInfo md_berensp13RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - may 23, 1994).bin", 0x100000, 0x913887b7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp13) -STD_ROM_FN(md_berensp13) - -struct BurnDriver BurnDrvmd_berensp13 = { - "md_berensp13", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940523)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp13RomInfo, md_berensp13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940526) -static struct BurnRomInfo md_berensp12RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - may 26, 1994).bin", 0x100000, 0xd33c0fa4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp12) -STD_ROM_FN(md_berensp12) - -struct BurnDriver BurnDrvmd_berensp12 = { - "md_berensp12", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940526)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp12RomInfo, md_berensp12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Berenstain Bears' Camping Adventure (Prototype, 19940530) -static struct BurnRomInfo md_berensp11RomDesc[] = { - { "berenstain bears' camping adventure, the (prototype - may 30, 1994).bin", 0x100000, 0x9c3bf429, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_berensp11) -STD_ROM_FN(md_berensp11) - -struct BurnDriver BurnDrvmd_berensp11 = { - "md_berensp11", "md_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940530)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_berensp11RomInfo, md_berensp11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Best of the Best - Championship Karate (USA) -static struct BurnRomInfo md_bestofRomDesc[] = { - { "best of the best - championship karate (usa).bin", 0x100000, 0xc3d6a5d4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bestof) -STD_ROM_FN(md_bestof) - -struct BurnDriver BurnDrvmd_bestof = { - "md_bestof", NULL, NULL, NULL, "1993", - "Best of the Best - Championship Karate (USA)\0", NULL, "Electro Brain", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bestofRomInfo, md_bestofRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Best of the Best - Championship Karate (Euro, Prototype) -static struct BurnRomInfo md_bestofpRomDesc[] = { - { "best of the best - championship karate (euro) (beta).bin", 0x100000, 0xf842240b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bestofp) -STD_ROM_FN(md_bestofp) - -struct BurnDriver BurnDrvmd_bestofp = { - "md_bestofp", "md_bestof", NULL, NULL, "1993", - "Best of the Best - Championship Karate (Euro, Prototype)\0", NULL, "Electro Brain", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bestofpRomInfo, md_bestofpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Kick Boxing (Jpn, Kor) -static struct BurnRomInfo md_kickboxRomDesc[] = { - { "mpr-15333.bin", 0x100000, 0x9bdc230c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kickbox) -STD_ROM_FN(md_kickbox) - -struct BurnDriver BurnDrvmd_kickbox = { - "md_kickbox", "md_bestof", NULL, NULL, "1993", - "The Kick Boxing (Jpn, Kor)\0", NULL, "Micro World", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kickboxRomInfo, md_kickboxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Beyond Zero Tolerance (USA, Prototype) -static struct BurnRomInfo md_beyondztRomDesc[] = { - { "beyond zero tolerance (usa) (prototype).bin", 0x200000, 0xc61ed2ed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beyondzt) -STD_ROM_FN(md_beyondzt) - -struct BurnDriver BurnDrvmd_beyondzt = { - "md_beyondzt", NULL, NULL, NULL, "1995", - "Beyond Zero Tolerance (USA, Prototype)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beyondztRomInfo, md_beyondztRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bible Adventures (USA) -static struct BurnRomInfo md_bibleadvRomDesc[] = { - { "bible adventures (usa) (unl).bin", 0x080000, 0x64446b77, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bibleadv) -STD_ROM_FN(md_bibleadv) - -struct BurnDriver BurnDrvmd_bibleadv = { - "md_bibleadv", NULL, NULL, NULL, "1995", - "Bible Adventures (USA)\0", NULL, "Wisdom Tree", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bibleadvRomInfo, md_bibleadvRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bill Walsh College Football (Euro, USA) -static struct BurnRomInfo md_billwlshRomDesc[] = { - { "bwcf01.bin", 0x100000, 0x3ed83362, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_billwlsh) -STD_ROM_FN(md_billwlsh) - -struct BurnDriver BurnDrvmd_billwlsh = { - "md_billwlsh", NULL, NULL, NULL, "1993", - "Bill Walsh College Football (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_billwlshRomInfo, md_billwlshRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bill Walsh College Football 95 (USA) -static struct BurnRomInfo md_billwl95RomDesc[] = { - { "bill walsh college football 95 (usa).bin", 0x200000, 0xa582f45a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_billwl95) -STD_ROM_FN(md_billwl95) - -struct BurnDriver BurnDrvmd_billwl95 = { - "md_billwl95", NULL, NULL, NULL, "1994", - "Bill Walsh College Football 95 (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_billwl95RomInfo, md_billwl95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bimini Run (USA) -static struct BurnRomInfo md_biminiRomDesc[] = { - { "bimini run (usa).bin", 0x080000, 0xd4dc5188, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bimini) -STD_ROM_FN(md_bimini) - -struct BurnDriver BurnDrvmd_bimini = { - "md_bimini", NULL, NULL, NULL, "1990", - "Bimini Run (USA)\0", NULL, "Nuvision Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_biminiRomInfo, md_biminiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bio Hazard Battle (Euro, USA) -static struct BurnRomInfo md_biohazrbRomDesc[] = { - { "mpr-15204.bin", 0x100000, 0x95b0ea2b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_biohazrb) -STD_ROM_FN(md_biohazrb) - -struct BurnDriver BurnDrvmd_biohazrb = { - "md_biohazrb", NULL, NULL, NULL, "1992", - "Bio Hazard Battle (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_biohazrbRomInfo, md_biohazrbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bio Hazard Battle (USA, Prototype) -static struct BurnRomInfo md_biohazrbpRomDesc[] = { - { "bio hazard battle (usa) (beta).bin", 0x100000, 0xdd10dd1a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_biohazrbp) -STD_ROM_FN(md_biohazrbp) - -struct BurnDriver BurnDrvmd_biohazrbp = { - "md_biohazrbp", "md_biohazrb", NULL, NULL, "1992", - "Bio Hazard Battle (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_biohazrbpRomInfo, md_biohazrbpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crying - Aseimei Sensou (Jpn) -static struct BurnRomInfo md_cryingRomDesc[] = { - { "crying - aseimei sensou (jpn).bin", 0x100000, 0x4aba1d6a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crying) -STD_ROM_FN(md_crying) - -struct BurnDriver BurnDrvmd_crying = { - "md_crying", "md_biohazrb", NULL, NULL, "1992", - "Crying - Aseimei Sensou (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cryingRomInfo, md_cryingRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Blades of Vengeance (Euro, USA) -static struct BurnRomInfo md_bladevenRomDesc[] = { - { "blades of vengeance (euro, usa).bin", 0x100000, 0x74c65a49, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bladeven) -STD_ROM_FN(md_bladeven) - -struct BurnDriver BurnDrvmd_bladeven = { - "md_bladeven", NULL, NULL, NULL, "1993", - "Blades of Vengeance (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bladevenRomInfo, md_bladevenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Blaster Master 2 (USA) -static struct BurnRomInfo md_bmaster2RomDesc[] = { - { "blaster master 2 (usa).bin", 0x100000, 0xc11e4ba1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bmaster2) -STD_ROM_FN(md_bmaster2) - -struct BurnDriver BurnDrvmd_bmaster2 = { - "md_bmaster2", NULL, NULL, NULL, "1993", - "Blaster Master 2 (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bmaster2RomInfo, md_bmaster2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Blaster Master 2 (USA, Prototype) -static struct BurnRomInfo md_bmaster2pRomDesc[] = { - { "blaster master 2 (usa) (beta).bin", 0x100000, 0x08f78c70, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bmaster2p) -STD_ROM_FN(md_bmaster2p) - -struct BurnDriver BurnDrvmd_bmaster2p = { - "md_bmaster2p", "md_bmaster2", NULL, NULL, "1993", - "Blaster Master 2 (USA, Prototype)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bmaster2pRomInfo, md_bmaster2pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Blockbuster World Video Game Championship II (USA) -static struct BurnRomInfo md_blockbRomDesc[] = { - { "blockbuster world video game championship ii (usa).bin", 0x400000, 0x4385e366, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_blockb) -STD_ROM_FN(md_blockb) - -struct BurnDriver BurnDrvmd_blockb = { - "md_blockb", NULL, NULL, NULL, "1995", - "Blockbuster World Video Game Championship II (USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_blockbRomInfo, md_blockbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Blockout (World) -static struct BurnRomInfo md_blockoutRomDesc[] = { - { "bloc-u1_blo03+bloc-u2_blo03.bin,mpr-14247.bin", 0x020000, 0x5e2966f1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_blockout) -STD_ROM_FN(md_blockout) - -struct BurnDriver BurnDrvmd_blockout = { - "md_blockout", NULL, NULL, NULL, "1991", - "Blockout (World)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_blockoutRomInfo, md_blockoutRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bloodshot ~ Battle Frenzy (Euro) -static struct BurnRomInfo md_bloodshtRomDesc[] = { - { "es210.bin", 0x200000, 0xf9f2bceb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bloodsht) -STD_ROM_FN(md_bloodsht) - -struct BurnDriver BurnDrvmd_bloodsht = { - "md_bloodsht", NULL, NULL, NULL, "1994", - "Bloodshot ~ Battle Frenzy (Euro)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bloodshtRomInfo, md_bloodshtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Blue Almanac (Jpn) -static struct BurnRomInfo md_bluealmaRomDesc[] = { - { "blue almanac (jpn).bin", 0x100000, 0x7222ebb3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bluealma) -STD_ROM_FN(md_bluealma) - -struct BurnDriver BurnDrvmd_bluealma = { - "md_bluealma", NULL, NULL, NULL, "1991", - "Blue Almanac (Jpn)\0", NULL, "Kodansha", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_bluealmaRomInfo, md_bluealmaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Body Count (Euro) -static struct BurnRomInfo md_bodycoRomDesc[] = { - { "body count (euro).bin", 0x100000, 0x3575a030, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bodyco) -STD_ROM_FN(md_bodyco) - -struct BurnDriver BurnDrvmd_bodyco = { - "md_bodyco", NULL, NULL, NULL, "1994", - "Body Count (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bodycoRomInfo, md_bodycoRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Body Count (Bra) -static struct BurnRomInfo md_bodycobRomDesc[] = { - { "mpr-16252 w51.ic1", 0x100000, 0x649607d1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bodycob) -STD_ROM_FN(md_bodycob) - -struct BurnDriver BurnDrvmd_bodycob = { - "md_bodycob", "md_bodyco", NULL, NULL, "1994", - "Body Count (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bodycobRomInfo, md_bodycobRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Body Count (Euro, Prototype) -static struct BurnRomInfo md_bodycopRomDesc[] = { - { "body count (euro) (beta).bin", 0x100000, 0xb4ffb6ce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bodycop) -STD_ROM_FN(md_bodycop) - -struct BurnDriver BurnDrvmd_bodycop = { - "md_bodycop", "md_bodyco", NULL, NULL, "1994", - "Body Count (Euro, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bodycopRomInfo, md_bodycopRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Body Count (USA, Prototype, 19940208) -static struct BurnRomInfo md_bodycop4RomDesc[] = { - { "body count (prototype - feb 08, 1994).bin", 0x0ff900, 0xc5fed897, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bodycop4) -STD_ROM_FN(md_bodycop4) - -struct BurnDriver BurnDrvmd_bodycop4 = { - "md_bodycop4", "md_bodyco", NULL, NULL, "1994", - "Body Count (USA, Prototype, 19940208)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bodycop4RomInfo, md_bodycop4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Body Count (USA, Prototype, 19940127) -static struct BurnRomInfo md_bodycop5RomDesc[] = { - { "body count (prototype - jan 27, 1994).bin", 0x100000, 0x66ca4e71, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bodycop5) -STD_ROM_FN(md_bodycop5) - -struct BurnDriver BurnDrvmd_bodycop5 = { - "md_bodycop5", "md_bodyco", NULL, NULL, "1994", - "Body Count (USA, Prototype, 19940127)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bodycop5RomInfo, md_bodycop5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Body Count (USA, Prototype, 19940303) -static struct BurnRomInfo md_bodycop3RomDesc[] = { - { "body count (prototype - mar 03, 1994).bin", 0x100000, 0x6abc6e77, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bodycop3) -STD_ROM_FN(md_bodycop3) - -struct BurnDriver BurnDrvmd_bodycop3 = { - "md_bodycop3", "md_bodyco", NULL, NULL, "1994", - "Body Count (USA, Prototype, 19940303)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bodycop3RomInfo, md_bodycop3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Body Count (USA, Prototype, 19940308) -static struct BurnRomInfo md_bodycop2RomDesc[] = { - { "body count (prototype - mar 08, 1994).bin", 0x100000, 0x8965213f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bodycop2) -STD_ROM_FN(md_bodycop2) - -struct BurnDriver BurnDrvmd_bodycop2 = { - "md_bodycop2", "md_bodyco", NULL, NULL, "1994", - "Body Count (USA, Prototype, 19940308)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bodycop2RomInfo, md_bodycop2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bonanza Bros. (Euro, Jpn, Rev. A) -static struct BurnRomInfo md_bnzabrosRomDesc[] = { - { "mpr-13905a.bin", 0x080000, 0xc6aac589, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bnzabros) -STD_ROM_FN(md_bnzabros) - -struct BurnDriver BurnDrvmd_bnzabros = { - "md_bnzabros", NULL, NULL, NULL, "1991", - "Bonanza Bros. (Euro, Jpn, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bnzabrosRomInfo, md_bnzabrosRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bonanza Bros. (Euro, Jpn) -static struct BurnRomInfo md_bnzabros1RomDesc[] = { - { "bonanza bros. (euro, jpn).bin", 0x080000, 0xadf6476c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bnzabros1) -STD_ROM_FN(md_bnzabros1) - -struct BurnDriver BurnDrvmd_bnzabros1 = { - "md_bnzabros1", "md_bnzabros", NULL, NULL, "1991", - "Bonanza Bros. (Euro, Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bnzabros1RomInfo, md_bnzabros1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bonanza Bros. (USA, Kor) -static struct BurnRomInfo md_bnzabrosuRomDesc[] = { - { "bonanza bros. (usa, kor).bin", 0x080000, 0x20d1ad4c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bnzabrosu) -STD_ROM_FN(md_bnzabrosu) - -struct BurnDriver BurnDrvmd_bnzabrosu = { - "md_bnzabrosu", "md_bnzabros", NULL, NULL, "1991", - "Bonanza Bros. (USA, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bnzabrosuRomInfo, md_bnzabrosuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bonkers (Euro, USA) -static struct BurnRomInfo md_bonkersRomDesc[] = { - { "bonkers (euro, usa).bin", 0x100000, 0xd1e66017, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bonkers) -STD_ROM_FN(md_bonkers) - -struct BurnDriver BurnDrvmd_bonkers = { - "md_bonkers", NULL, NULL, NULL, "1994", - "Bonkers (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bonkersRomInfo, md_bonkersRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bonkers (USA, Prototype, 19940328) -static struct BurnRomInfo md_bonkersp5RomDesc[] = { - { "bonkers (prototype - mar 28, 1994).bin", 0x100000, 0xcd67c588, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bonkersp5) -STD_ROM_FN(md_bonkersp5) - -struct BurnDriver BurnDrvmd_bonkersp5 = { - "md_bonkersp5", "md_bonkers", NULL, NULL, "1994", - "Bonkers (USA, Prototype, 19940328)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bonkersp5RomInfo, md_bonkersp5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bonkers (USA, Prototype, 19940503) -static struct BurnRomInfo md_bonkersp4RomDesc[] = { - { "bonkers (prototype - may 03, 1994).bin", 0x100000, 0xe4cd0d61, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bonkersp4) -STD_ROM_FN(md_bonkersp4) - -struct BurnDriver BurnDrvmd_bonkersp4 = { - "md_bonkersp4", "md_bonkers", NULL, NULL, "1994", - "Bonkers (USA, Prototype, 19940503)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bonkersp4RomInfo, md_bonkersp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bonkers (USA, Prototype, 19941004) -static struct BurnRomInfo md_bonkersp3RomDesc[] = { - { "bonkers (prototype - oct 04, 1994).bin", 0x100000, 0x913cc834, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bonkersp3) -STD_ROM_FN(md_bonkersp3) - -struct BurnDriver BurnDrvmd_bonkersp3 = { - "md_bonkersp3", "md_bonkers", NULL, NULL, "1994", - "Bonkers (USA, Prototype, 19941004)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bonkersp3RomInfo, md_bonkersp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bonkers (USA, Prototype, 19941025) -static struct BurnRomInfo md_bonkersp2RomDesc[] = { - { "bonkers (prototype - oct 25, 1994).bin", 0x100000, 0x3e5edc4f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bonkersp2) -STD_ROM_FN(md_bonkersp2) - -struct BurnDriver BurnDrvmd_bonkersp2 = { - "md_bonkersp2", "md_bonkers", NULL, NULL, "1994", - "Bonkers (USA, Prototype, 19941025)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bonkersp2RomInfo, md_bonkersp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bonkers (USA, Prototype, 19941029) -static struct BurnRomInfo md_bonkersp1RomDesc[] = { - { "bonkers (prototype - oct 29, 1994).bin", 0x100000, 0x7b84793e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bonkersp1) -STD_ROM_FN(md_bonkersp1) - -struct BurnDriver BurnDrvmd_bonkersp1 = { - "md_bonkersp1", "md_bonkers", NULL, NULL, "1994", - "Bonkers (USA, Prototype, 19941029)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bonkersp1RomInfo, md_bonkersp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Boogerman - A Pick and Flick Adventure (Euro) -static struct BurnRomInfo md_boogerRomDesc[] = { - { "boogerman - a pick and flick adventure (euro).bin", 0x300000, 0xdbc4340c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_booger) -STD_ROM_FN(md_booger) - -struct BurnDriver BurnDrvmd_booger = { - "md_booger", NULL, NULL, NULL, "1994", - "Boogerman - A Pick and Flick Adventure (Euro)\0", NULL, "Interplay", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_boogerRomInfo, md_boogerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Boogerman - A Pick and Flick Adventure (USA) -static struct BurnRomInfo md_boogeruRomDesc[] = { - { "boogerman - a pick and flick adventure (usa).bin", 0x300000, 0x1a7a2bec, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_boogeru) -STD_ROM_FN(md_boogeru) - -struct BurnDriver BurnDrvmd_boogeru = { - "md_boogeru", "md_booger", NULL, NULL, "1994", - "Boogerman - A Pick and Flick Adventure (USA)\0", NULL, "Interplay", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_boogeruRomInfo, md_boogeruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Boxing Legends of the Ring (USA) -static struct BurnRomInfo md_boxinglgRomDesc[] = { - { "boxing legends of the ring (usa).bin", 0x100000, 0x00f225ac, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_boxinglg) -STD_ROM_FN(md_boxinglg) - -struct BurnDriver BurnDrvmd_boxinglg = { - "md_boxinglg", NULL, NULL, NULL, "1993", - "Boxing Legends of the Ring (USA)\0", NULL, "Electro Brain", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_boxinglgRomInfo, md_boxinglgRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chavez II (USA) -static struct BurnRomInfo md_chavez2RomDesc[] = { - { "chavez ii (usa).bin", 0x100000, 0x5bc0dbb8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chavez2) -STD_ROM_FN(md_chavez2) - -struct BurnDriver BurnDrvmd_chavez2 = { - "md_chavez2", "md_boxinglg", NULL, NULL, "1993", - "Chavez II (USA)\0", NULL, "American Softworks", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chavez2RomInfo, md_chavez2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bram Stoker's Dracula (Euro) -static struct BurnRomInfo md_draculaRomDesc[] = { - { "bram stoker's dracula (euro).bin", 0x100000, 0x9ba5a063, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dracula) -STD_ROM_FN(md_dracula) - -struct BurnDriver BurnDrvmd_dracula = { - "md_dracula", NULL, NULL, NULL, "1993", - "Bram Stoker's Dracula (Euro)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_draculaRomInfo, md_draculaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bram Stoker's Dracula (USA) -static struct BurnRomInfo md_draculauRomDesc[] = { - { "bram stoker's dracula (usa).bin", 0x100000, 0x077084a6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_draculau) -STD_ROM_FN(md_draculau) - -struct BurnDriver BurnDrvmd_draculau = { - "md_draculau", "md_dracula", NULL, NULL, "1993", - "Bram Stoker's Dracula (USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_draculauRomInfo, md_draculauRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Brett Hull Hockey '95 (USA) -static struct BurnRomInfo md_bretthRomDesc[] = { - { "brett hull hockey '95 (usa).bin", 0x200000, 0xf7775a09, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bretth) -STD_ROM_FN(md_bretth) - -struct BurnDriver BurnDrvmd_bretth = { - "md_bretth", NULL, NULL, NULL, "1994", - "Brett Hull Hockey '95 (USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_bretthRomInfo, md_bretthRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Brian Lara Cricket (Euro, 199506) -static struct BurnRomInfo md_brianlarRomDesc[] = { - { "brian lara cricket (euro) (june 1995).bin", 0x100000, 0x408cf5c3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_brianlar) -STD_ROM_FN(md_brianlar) - -struct BurnDriver BurnDrvmd_brianlar = { - "md_brianlar", NULL, NULL, NULL, "1995", - "Brian Lara Cricket (Euro, 199506)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_brianlarRomInfo, md_brianlarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Brian Lara Cricket (Euro, 199503) -static struct BurnRomInfo md_brianlar1RomDesc[] = { - { "brian lara cricket (euro) (march 1995).bin", 0x100000, 0x90f5c2b7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_brianlar1) -STD_ROM_FN(md_brianlar1) - -struct BurnDriver BurnDrvmd_brianlar1 = { - "md_brianlar1", "md_brianlar", NULL, NULL, "1995", - "Brian Lara Cricket (Euro, 199503)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_brianlar1RomInfo, md_brianlar1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Brian Lara Cricket 96 (Euro, 199604) -static struct BurnRomInfo md_brianl96RomDesc[] = { - { "brian lara cricket 96 (euro) (april 1996).bin", 0x100000, 0xfe52f7e1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_brianl96) -STD_ROM_FN(md_brianl96) - -struct BurnDriver BurnDrvmd_brianl96 = { - "md_brianl96", NULL, NULL, NULL, "1996", - "Brian Lara Cricket 96 (Euro, 199604)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_CODE_MASTERS, GBF_MISC, 0, - MegadriveGetZipName, md_brianl96RomInfo, md_brianl96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Brian Lara Cricket 96 (Euro, 199603) -static struct BurnRomInfo md_brianl96aRomDesc[] = { - { "mdbl_9844.bin", 0x100000, 0xfa3024af, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_brianl96a) -STD_ROM_FN(md_brianl96a) - -struct BurnDriver BurnDrvmd_brianl96a = { - "md_brianl96a", "md_brianl96", NULL, NULL, "1996", - "Brian Lara Cricket 96 (Euro, 199603)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_CODE_MASTERS, GBF_MISC, 0, - MegadriveGetZipName, md_brianl96aRomInfo, md_brianl96aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Brutal - Paws of Fury (Euro) -static struct BurnRomInfo md_brutalRomDesc[] = { - { "brutal - paws of fury (euro).bin", 0x200000, 0x7e9a8d32, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_brutal) -STD_ROM_FN(md_brutal) - -struct BurnDriver BurnDrvmd_brutal = { - "md_brutal", NULL, NULL, NULL, "1994", - "Brutal - Paws of Fury (Euro)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_brutalRomInfo, md_brutalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Brutal - Paws of Fury (USA) -static struct BurnRomInfo md_brutaluRomDesc[] = { - { "brutal - paws of fury (usa).bin", 0x200000, 0x98d502cd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_brutalu) -STD_ROM_FN(md_brutalu) - -struct BurnDriver BurnDrvmd_brutalu = { - "md_brutalu", "md_brutal", NULL, NULL, "1994", - "Brutal - Paws of Fury (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_brutaluRomInfo, md_brutaluRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bubba'n'Stix (Euro) -static struct BurnRomInfo md_bubbaRomDesc[] = { - { "bubba'n'stix (euro).bin", 0x100000, 0xb467432e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bubba) -STD_ROM_FN(md_bubba) - -struct BurnDriver BurnDrvmd_bubba = { - "md_bubba", NULL, NULL, NULL, "1994", - "Bubba'n'Stix (Euro)\0", NULL, "Core Design", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bubbaRomInfo, md_bubbaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bubba'n'Stix (Euro, Prototype) -static struct BurnRomInfo md_bubbapRomDesc[] = { - { "bubba'n'stix (euro) (beta).bin", 0x100000, 0xa8731cb4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bubbap) -STD_ROM_FN(md_bubbap) - -struct BurnDriver BurnDrvmd_bubbap = { - "md_bubbap", "md_bubba", NULL, NULL, "1994", - "Bubba'n'Stix (Euro, Prototype)\0", NULL, "Core Design", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bubbapRomInfo, md_bubbapRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bubba'n'Stix (USA) -static struct BurnRomInfo md_bubbauRomDesc[] = { - { "bubba'n'stix - a strategy adventure (usa).bin", 0x100000, 0xd45cb46f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bubbau) -STD_ROM_FN(md_bubbau) - -struct BurnDriver BurnDrvmd_bubbau = { - "md_bubbau", "md_bubba", NULL, NULL, "1993", - "Bubba'n'Stix (USA)\0", NULL, "Core Design", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bubbauRomInfo, md_bubbauRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bubble and Squeak (Euro) -static struct BurnRomInfo md_bubblesqRomDesc[] = { - { "bubble and squeak (euro).bin", 0x080000, 0x86151bf1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bubblesq) -STD_ROM_FN(md_bubblesq) - -struct BurnDriver BurnDrvmd_bubblesq = { - "md_bubblesq", NULL, NULL, NULL, "1994", - "Bubble and Squeak (Euro)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bubblesqRomInfo, md_bubblesqRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bubble and Squeak (USA) -static struct BurnRomInfo md_bubblesquRomDesc[] = { - { "bubble and squeak (usa).bin", 0x080000, 0x28c4a006, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bubblesqu) -STD_ROM_FN(md_bubblesqu) - -struct BurnDriver BurnDrvmd_bubblesqu = { - "md_bubblesqu", "md_bubblesq", NULL, NULL, "1994", - "Bubble and Squeak (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bubblesquRomInfo, md_bubblesquRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bubsy in Claws Encounters of the Furred Kind (Euro, USA) -static struct BurnRomInfo md_bubsyRomDesc[] = { - { "bubsy in claws encounters of the furred kind (euro, usa).bin", 0x200000, 0x3e30d365, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bubsy) -STD_ROM_FN(md_bubsy) - -struct BurnDriver BurnDrvmd_bubsy = { - "md_bubsy", NULL, NULL, NULL, "1993", - "Bubsy in Claws Encounters of the Furred Kind (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bubsyRomInfo, md_bubsyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bubsy II (Euro, USA) -static struct BurnRomInfo md_bubsy2RomDesc[] = { - { "bu2sg.bin", 0x200000, 0xf8beff56, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bubsy2) -STD_ROM_FN(md_bubsy2) - -struct BurnDriver BurnDrvmd_bubsy2 = { - "md_bubsy2", NULL, NULL, NULL, "1994", - "Bubsy II (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bubsy2RomInfo, md_bubsy2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Buck Rogers - Countdown to Doomsday (Euro, USA) -static struct BurnRomInfo md_buckrogRomDesc[] = { - { "buc05.bin", 0x100000, 0x44e3bfff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_buckrog) -STD_ROM_FN(md_buckrog) - -struct BurnDriver BurnDrvmd_buckrog = { - "md_buckrog", NULL, NULL, NULL, "1991", - "Buck Rogers - Countdown to Doomsday (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM | HARDWARE_SEGA_MEGADRIVE_SRAM_04000, GBF_MISC, 0, - MegadriveGetZipName, md_buckrogRomInfo, md_buckrogRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Budokan - The Martial Spirit (Euro) -static struct BurnRomInfo md_budokanRomDesc[] = { - { "budokan - the martial spirit (euro).bin", 0x080000, 0x97add5bd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_budokan) -STD_ROM_FN(md_budokan) - -struct BurnDriver BurnDrvmd_budokan = { - "md_budokan", NULL, NULL, NULL, "1990", - "Budokan - The Martial Spirit (Euro)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_budokanRomInfo, md_budokanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Budokan - The Martial Spirit (USA) -static struct BurnRomInfo md_budokanuRomDesc[] = { - { "budokan - the martial spirit (usa).bin", 0x080000, 0xacd9f5fc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_budokanu) -STD_ROM_FN(md_budokanu) - -struct BurnDriver BurnDrvmd_budokanu = { - "md_budokanu", "md_budokan", NULL, NULL, "1990", - "Budokan - The Martial Spirit (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_budokanuRomInfo, md_budokanuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bugs Bunny in Double Trouble (USA) -static struct BurnRomInfo md_bugsbunuRomDesc[] = { - { "bugs bunny in double trouble (usa).bin", 0x200000, 0x365305a2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bugsbunu) -STD_ROM_FN(md_bugsbunu) - -struct BurnDriver BurnDrvmd_bugsbunu = { - "md_bugsbunu", "md_bugsbun", NULL, NULL, "1996", - "Bugs Bunny in Double Trouble (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bugsbunuRomInfo, md_bugsbunuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bulls versus Blazers and the NBA Playoffs (Euro, USA) -static struct BurnRomInfo md_bullvsblRomDesc[] = { - { "bulls versus blazers and the nba playoffs (euro, usa).bin", 0x100000, 0xd4e4b4e8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bullvsbl) -STD_ROM_FN(md_bullvsbl) - -struct BurnDriver BurnDrvmd_bullvsbl = { - "md_bullvsbl", NULL, NULL, NULL, "1993", - "Bulls versus Blazers and the NBA Playoffs (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bullvsblRomInfo, md_bullvsblRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bulls Vs Lakers and the NBA Playoffs (Euro, USA) -static struct BurnRomInfo md_bullvslaRomDesc[] = { - { "bulls vs lakers and the nba playoffs (euro, usa).bin", 0x100000, 0xe56023a0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bullvsla) -STD_ROM_FN(md_bullvsla) - -struct BurnDriver BurnDrvmd_bullvsla = { - "md_bullvsla", NULL, NULL, NULL, "1992", - "Bulls Vs Lakers and the NBA Playoffs (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bullvslaRomInfo, md_bullvslaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Burning Force (Euro) -static struct BurnRomInfo md_burnforcRomDesc[] = { - { "burning force (euro).bin", 0x080000, 0x776ff6ff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_burnforc) -STD_ROM_FN(md_burnforc) - -struct BurnDriver BurnDrvmd_burnforc = { - "md_burnforc", NULL, NULL, NULL, "1991", - "Burning Force (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_burnforcRomInfo, md_burnforcRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Burning Force (Jpn) -static struct BurnRomInfo md_burnforcjRomDesc[] = { - { "burning force (jpn).bin", 0x080000, 0x0c1deb47, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_burnforcj) -STD_ROM_FN(md_burnforcj) - -struct BurnDriver BurnDrvmd_burnforcj = { - "md_burnforcj", "md_burnforc", NULL, NULL, "1990", - "Burning Force (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_burnforcjRomInfo, md_burnforcjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Burning Force (USA) -static struct BurnRomInfo md_burnforcuRomDesc[] = { - { "burning force (usa).bin", 0x080000, 0xbdc8f02c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_burnforcu) -STD_ROM_FN(md_burnforcu) - -struct BurnDriver BurnDrvmd_burnforcu = { - "md_burnforcu", "md_burnforc", NULL, NULL, "1990", - "Burning Force (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_burnforcuRomInfo, md_burnforcuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cadash (USA, Asia, Kor) -static struct BurnRomInfo md_cadashRomDesc[] = { - { "cadash (usa, asia, kor).bin", 0x080000, 0x13bdf374, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cadash) -STD_ROM_FN(md_cadash) - -struct BurnDriver BurnDrvmd_cadash = { - "md_cadash", NULL, NULL, NULL, "1992", - "Cadash (USA, Asia, Kor)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cadashRomInfo, md_cadashRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Caesars Palace (USA) -static struct BurnRomInfo md_caesarsRomDesc[] = { - { "caesars palace (usa).bin", 0x080000, 0x8fdaa9bb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_caesars) -STD_ROM_FN(md_caesars) - -struct BurnDriver BurnDrvmd_caesars = { - "md_caesars", NULL, NULL, NULL, "1993", - "Caesars Palace (USA)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_caesarsRomInfo, md_caesarsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cal Ripken Jr. Baseball (USA) -static struct BurnRomInfo md_calripknRomDesc[] = { - { "cal ripken jr. baseball (usa).bin", 0x100000, 0x9b1c96c0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_calripkn) -STD_ROM_FN(md_calripkn) - -struct BurnDriver BurnDrvmd_calripkn = { - "md_calripkn", NULL, NULL, NULL, "1992", - "Cal Ripken Jr. Baseball (USA)\0", NULL, "Mindscape", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_calripknRomInfo, md_calripknRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cal.50 - Caliber Fifty (USA) -static struct BurnRomInfo md_cal50RomDesc[] = { - { "caliber .50 (usa).bin", 0x100000, 0x44f4fa05, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cal50) -STD_ROM_FN(md_cal50) - -struct BurnDriver BurnDrvmd_cal50 = { - "md_cal50", NULL, NULL, NULL, "1991", - "Cal.50 - Caliber Fifty (USA)\0", NULL, "Mentrix Software", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cal50RomInfo, md_cal50RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// California Games (Euro, USA) -static struct BurnRomInfo md_calgamesRomDesc[] = { - { "mpr-14372.bin", 0x080000, 0x43b1b672, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_calgames) -STD_ROM_FN(md_calgames) - -struct BurnDriver BurnDrvmd_calgames = { - "md_calgames", NULL, NULL, NULL, "1991", - "California Games (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_calgamesRomInfo, md_calgamesRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cannon Fodder (Euro) -static struct BurnRomInfo md_cfodderRomDesc[] = { - { "cannon fodder (euro).bin", 0x180000, 0xad217654, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cfodder) -STD_ROM_FN(md_cfodder) - -struct BurnDriver BurnDrvmd_cfodder = { - "md_cfodder", NULL, NULL, NULL, "1994", - "Cannon Fodder (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cfodderRomInfo, md_cfodderRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Captain America and the Avengers (Euro) -static struct BurnRomInfo md_captavenRomDesc[] = { - { "mpr-15499.bin", 0x100000, 0x43225612, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_captaven) -STD_ROM_FN(md_captaven) - -struct BurnDriver BurnDrvmd_captaven = { - "md_captaven", NULL, NULL, NULL, "1992", - "Captain America and the Avengers (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_captavenRomInfo, md_captavenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Captain America and the Avengers (USA) -static struct BurnRomInfo md_captavenuRomDesc[] = { - { "captain america and the avengers (usa).bin", 0x100000, 0xe0639ca2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_captavenu) -STD_ROM_FN(md_captavenu) - -struct BurnDriver BurnDrvmd_captavenu = { - "md_captavenu", "md_captaven", NULL, NULL, "1992", - "Captain America and the Avengers (USA)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_captavenuRomInfo, md_captavenuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Captain America and the Avengers (USA, Prototype) -static struct BurnRomInfo md_captavenupRomDesc[] = { - { "captain america and the avengers (usa) (beta).bin", 0x100000, 0xbaac59c0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_captavenup) -STD_ROM_FN(md_captavenup) - -struct BurnDriver BurnDrvmd_captavenup = { - "md_captavenup", "md_captaven", NULL, NULL, "1992", - "Captain America and the Avengers (USA, Prototype)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_captavenupRomInfo, md_captavenupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Captain Lang (Jpn) -static struct BurnRomInfo md_captlangRomDesc[] = { - { "captain lang (japan).bin", 0x100000, 0x61ba8199, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_captlang) -STD_ROM_FN(md_captlang) - -struct BurnDriver BurnDrvmd_captlang = { - "md_captlang", "md_havoc", NULL, NULL, "1994", - "Captain Lang (Jpn)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_captlangRomInfo, md_captlangRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Captain Planet and the Planeteers (Euro) -static struct BurnRomInfo md_captplanRomDesc[] = { - { "captain planet and the planeteers (euro).bin", 0x080000, 0x7672efa5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_captplan) -STD_ROM_FN(md_captplan) - -struct BurnDriver BurnDrvmd_captplan = { - "md_captplan", NULL, NULL, NULL, "1993", - "Captain Planet and the Planeteers (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_captplanRomInfo, md_captplanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Captain Planet and the Planeteers (USA) -static struct BurnRomInfo md_captplanuRomDesc[] = { - { "captain planet and the planeteers (usa).bin", 0x080000, 0xbf2cbd3a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_captplanu) -STD_ROM_FN(md_captplanu) - -struct BurnDriver BurnDrvmd_captplanu = { - "md_captplanu", "md_captplan", NULL, NULL, "1993", - "Captain Planet and the Planeteers (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_captplanuRomInfo, md_captplanuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Castle of Illusion Starring Mickey Mouse (Euro, USA) -static struct BurnRomInfo md_castlillRomDesc[] = { - { "castle of illusion starring mickey mouse (euro, usa).bin", 0x080000, 0xba4e9fd0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_castlill) -STD_ROM_FN(md_castlill) - -struct BurnDriver BurnDrvmd_castlill = { - "md_castlill", NULL, NULL, NULL, "1990", - "Castle of Illusion Starring Mickey Mouse (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_castlillRomInfo, md_castlillRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Castle of Illusion - Fushigi no Oshiro Daibouken (Jpn) -static struct BurnRomInfo md_castlilljRomDesc[] = { - { "mpr-13498.bin", 0x080000, 0xce8333c6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_castlillj) -STD_ROM_FN(md_castlillj) - -struct BurnDriver BurnDrvmd_castlillj = { - "md_castlillj", "md_castlill", NULL, NULL, "1990", - "Castle of Illusion - Fushigi no Oshiro Daibouken (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_castlilljRomInfo, md_castlilljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Castlevania - The New Generation (Euro) -static struct BurnRomInfo md_cvaniaRomDesc[] = { - { "castlevania - the new generation (euro).bin", 0x100000, 0x4dd4e4a5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cvania) -STD_ROM_FN(md_cvania) - -struct BurnDriver BurnDrvmd_cvania = { - "md_cvania", NULL, NULL, NULL, "1994", - "Castlevania - The New Generation (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cvaniaRomInfo, md_cvaniaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Castlevania - The New Generation (Euro, Prototype) -static struct BurnRomInfo md_cvaniapRomDesc[] = { - { "castlevania - the new generation (euro) (beta).bin", 0x100000, 0x84cd103a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cvaniap) -STD_ROM_FN(md_cvaniap) - -struct BurnDriver BurnDrvmd_cvaniap = { - "md_cvaniap", "md_cvania", NULL, NULL, "1994", - "Castlevania - The New Generation (Euro, Prototype)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cvaniapRomInfo, md_cvaniapRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Castlevania - Bloodlines (USA) -static struct BurnRomInfo md_cvaniauRomDesc[] = { - { "castlevania - bloodlines (usa).bin", 0x100000, 0xfb1ea6df, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cvaniau) -STD_ROM_FN(md_cvaniau) - -struct BurnDriver BurnDrvmd_cvaniau = { - "md_cvaniau", "md_cvania", NULL, NULL, "1994", - "Castlevania - Bloodlines (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cvaniauRomInfo, md_cvaniauRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Akumajou Dracula - Vampire Killer (Jpn) -static struct BurnRomInfo md_akumajoRomDesc[] = { - { "akumajou dracula - vampire killer (jpn).bin", 0x100000, 0x91b57d2b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_akumajo) -STD_ROM_FN(md_akumajo) - -struct BurnDriver BurnDrvmd_akumajo = { - "md_akumajo", "md_cvania", NULL, NULL, "1994", - "Akumajou Dracula - Vampire Killer (Jpn)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_akumajoRomInfo, md_akumajoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Centurion - Defender of Rome (Euro, USA) -static struct BurnRomInfo md_centurRomDesc[] = { - { "centurion - defender of rome (euro, usa).bin", 0x0c0000, 0x21283b14, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_centur) -STD_ROM_FN(md_centur) - -struct BurnDriver BurnDrvmd_centur = { - "md_centur", NULL, NULL, NULL, "1991", - "Centurion - Defender of Rome (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_centurRomInfo, md_centurRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chakan (Euro, USA) -static struct BurnRomInfo md_chakanRomDesc[] = { - { "chakan (euro, usa).bin", 0x100000, 0x046a48de, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chakan) -STD_ROM_FN(md_chakan) - -struct BurnDriver BurnDrvmd_chakan = { - "md_chakan", NULL, NULL, NULL, "1992", - "Chakan (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chakanRomInfo, md_chakanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Champions World Class Soccer (World) -static struct BurnRomInfo md_champwcsRomDesc[] = { - { "s357.bin", 0x100000, 0x883e33db, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_champwcs) -STD_ROM_FN(md_champwcs) - -struct BurnDriver BurnDrvmd_champwcs = { - "md_champwcs", NULL, NULL, NULL, "1993", - "Champions World Class Soccer (World)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_champwcsRomInfo, md_champwcsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Championship Bowling (USA) -static struct BurnRomInfo md_champbwlRomDesc[] = { - { "championship bowling (usa).bin", 0x080000, 0x1bf92520, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_champbwl) -STD_ROM_FN(md_champbwl) - -struct BurnDriver BurnDrvmd_champbwl = { - "md_champbwl", NULL, NULL, NULL, "1993", - "Championship Bowling (USA)\0", NULL, "Mentrix Software", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_champbwlRomInfo, md_champbwlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Boogie Woogie Bowling (Jpn) -static struct BurnRomInfo md_boogieRomDesc[] = { - { "boogie woogie bowling (jpn).bin", 0x080000, 0xccf52828, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_boogie) -STD_ROM_FN(md_boogie) - -struct BurnDriver BurnDrvmd_boogie = { - "md_boogie", "md_champbwl", NULL, NULL, "1993", - "Boogie Woogie Bowling (Jpn)\0", NULL, "Visco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_boogieRomInfo, md_boogieRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Championship Pool (USA) -static struct BurnRomInfo md_champoolRomDesc[] = { - { "championship pool (usa).bin", 0x100000, 0x253512cf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_champool) -STD_ROM_FN(md_champool) - -struct BurnDriver BurnDrvmd_champool = { - "md_champool", NULL, NULL, NULL, "1993", - "Championship Pool (USA)\0", NULL, "Mindscape", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_champoolRomInfo, md_champoolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Championship Pro-Am (USA) -static struct BurnRomInfo md_cproamRomDesc[] = { - { "championship pro-am (usa).bin", 0x040000, 0xb496de28, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cproam) -STD_ROM_FN(md_cproam) - -struct BurnDriver BurnDrvmd_cproam = { - "md_cproam", NULL, NULL, NULL, "1992", - "Championship Pro-Am (USA)\0", NULL, "Tradewest", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cproamRomInfo, md_cproamRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chao Ji Da Fu Weng (Chi) -static struct BurnRomInfo md_cjfuwengRomDesc[] = { - { "chao ji da fu weng (chi) (unl).bin", 0x100000, 0x2e2ea687, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cjfuweng) -STD_ROM_FN(md_cjfuweng) - -struct BurnDriver BurnDrvmd_cjfuweng = { - "md_cjfuweng", NULL, NULL, NULL, "199?", - "Chao Ji Da Fu Weng (Chi)\0", NULL, "Gametec?", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_cjfuwengRomInfo, md_cjfuwengRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Chaos Engine (Euro) -static struct BurnRomInfo md_chaosengRomDesc[] = { - { "chaos engine, the (euro).bin", 0x180000, 0xbd9eecf4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chaoseng) -STD_ROM_FN(md_chaoseng) - -struct BurnDriver BurnDrvmd_chaoseng = { - "md_chaoseng", NULL, NULL, NULL, "1992", - "The Chaos Engine (Euro)\0", NULL, "Microprose", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chaosengRomInfo, md_chaosengRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Soldiers of Fortune (USA) -static struct BurnRomInfo md_soldfortRomDesc[] = { - { "soldiers of fortune (usa).bin", 0x180000, 0xa84d28a1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_soldfort) -STD_ROM_FN(md_soldfort) - -struct BurnDriver BurnDrvmd_soldfort = { - "md_soldfort", "md_chaoseng", NULL, NULL, "1993", - "Soldiers of Fortune (USA)\0", NULL, "Spectrum Holobyte", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_soldfortRomInfo, md_soldfortRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Chaos Engine 2 (Euro, Prototype) -static struct BurnRomInfo md_chaosen2RomDesc[] = { - { "chaos engine 2, the (euro) (prototype).bin", 0x100000, 0x3fb045c2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chaosen2) -STD_ROM_FN(md_chaosen2) - -struct BurnDriver BurnDrvmd_chaosen2 = { - "md_chaosen2", NULL, NULL, NULL, "199?", - "The Chaos Engine 2 (Euro, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chaosen2RomInfo, md_chaosen2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chase H.Q. II (USA) -static struct BurnRomInfo md_chasehq2RomDesc[] = { - { "chase h.q. ii (usa).bin", 0x080000, 0xf39e4bf2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chasehq2) -STD_ROM_FN(md_chasehq2) - -struct BurnDriver BurnDrvmd_chasehq2 = { - "md_chasehq2", NULL, NULL, NULL, "1992", - "Chase H.Q. II (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chasehq2RomInfo, md_chasehq2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super H.Q. (Jpn) -static struct BurnRomInfo md_superhqRomDesc[] = { - { "super h.q. (jpn).bin", 0x080000, 0xab2c52b0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_superhq) -STD_ROM_FN(md_superhq) - -struct BurnDriver BurnDrvmd_superhq = { - "md_superhq", "md_chasehq2", NULL, NULL, "1992", - "Super H.Q. (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_superhqRomInfo, md_superhqRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cheese Cat-Astrophe Starring Speedy Gonzales (Euro) -static struct BurnRomInfo md_cheeseRomDesc[] = { - { "cheese cat-astrophe starring speedy gonzales (euro).bin", 0x200000, 0xff634b28, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cheese) -STD_ROM_FN(md_cheese) - -struct BurnDriver BurnDrvmd_cheese = { - "md_cheese", NULL, NULL, NULL, "1995", - "Cheese Cat-Astrophe Starring Speedy Gonzales (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cheeseRomInfo, md_cheeseRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chester Cheetah - Too Cool to Fool (USA) -static struct BurnRomInfo md_chesterRomDesc[] = { - { "chester cheetah - too cool to fool (usa).bin", 0x100000, 0x250e3ec3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chester) -STD_ROM_FN(md_chester) - -struct BurnDriver BurnDrvmd_chester = { - "md_chester", NULL, NULL, NULL, "1992", - "Chester Cheetah - Too Cool to Fool (USA)\0", NULL, "Kaneko", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chesterRomInfo, md_chesterRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chester Cheetah - Wild Wild Quest (USA) -static struct BurnRomInfo md_chesterwRomDesc[] = { - { "chester cheetah - wild wild quest (usa).bin", 0x100000, 0xb97b735d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chesterw) -STD_ROM_FN(md_chesterw) - -struct BurnDriver BurnDrvmd_chesterw = { - "md_chesterw", NULL, NULL, NULL, "1992", - "Chester Cheetah - Wild Wild Quest (USA)\0", NULL, "Kaneko", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chesterwRomInfo, md_chesterwRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chi Chi's Pro Challenge Golf (USA) -static struct BurnRomInfo md_chichiRomDesc[] = { - { "chi chi's pro challenge golf (usa).bin", 0x100000, 0x9c3973a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chichi) -STD_ROM_FN(md_chichi) - -struct BurnDriver BurnDrvmd_chichi = { - "md_chichi", NULL, NULL, NULL, "1993", - "Chi Chi's Pro Challenge Golf (USA)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chichiRomInfo, md_chichiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chibi Maruko-chan - Wakuwaku Shopping (Jpn) -static struct BurnRomInfo md_chibimRomDesc[] = { - { "chibi maruko-chan - wakuwaku shopping (jpn).bin", 0x080000, 0x91a144b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chibim) -STD_ROM_FN(md_chibim) - -struct BurnDriver BurnDrvmd_chibim = { - "md_chibim", NULL, NULL, NULL, "1992", - "Chibi Maruko-chan - Wakuwaku Shopping (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chibimRomInfo, md_chibimRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chiki Chiki Boys (Euro, USA) -static struct BurnRomInfo md_chikiRomDesc[] = { - { "chiki chiki boys (euro, usa).bin", 0x100000, 0x813a7d62, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chiki) -STD_ROM_FN(md_chiki) - -struct BurnDriver BurnDrvmd_chiki = { - "md_chiki", NULL, NULL, NULL, "1992", - "Chiki Chiki Boys (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chikiRomInfo, md_chikiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chiki Chiki Boys (Jpn, Kor) -static struct BurnRomInfo md_chikijRomDesc[] = { - { "chiki chiki boys (jpn, kor).bin", 0x100000, 0x06918c17, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chikij) -STD_ROM_FN(md_chikij) - -struct BurnDriver BurnDrvmd_chikij = { - "md_chikij", "md_chiki", NULL, NULL, "1992", - "Chiki Chiki Boys (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chikijRomInfo, md_chikijRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chinese Chess -static struct BurnRomInfo md_chinesecRomDesc[] = { - { "chinese chess (unl).bin", 0x080000, 0x475215a0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chinesec) -STD_ROM_FN(md_chinesec) - -struct BurnDriver BurnDrvmd_chinesec = { - "md_chinesec", NULL, NULL, NULL, "199?", - "Chinese Chess\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chinesecRomInfo, md_chinesecRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chuck Rock (Euro) -static struct BurnRomInfo md_chuckrckRomDesc[] = { - { "chuck rock (euro).bin", 0x100000, 0x7cd40bea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chuckrck) -STD_ROM_FN(md_chuckrck) - -struct BurnDriver BurnDrvmd_chuckrck = { - "md_chuckrck", NULL, NULL, NULL, "1992", - "Chuck Rock (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chuckrckRomInfo, md_chuckrckRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chuck Rock (USA) -static struct BurnRomInfo md_chuckrckuRomDesc[] = { - { "chuck rock (usa).bin", 0x100000, 0xf8ac454a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chuckrcku) -STD_ROM_FN(md_chuckrcku) - -struct BurnDriver BurnDrvmd_chuckrcku = { - "md_chuckrcku", "md_chuckrck", NULL, NULL, "1992", - "Chuck Rock (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chuckrckuRomInfo, md_chuckrckuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chuck Rock II - Son of Chuck (Euro) -static struct BurnRomInfo md_chukrck2RomDesc[] = { - { "chuck rock ii - son of chuck (euro).bin", 0x100000, 0x1ade9488, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chukrck2) -STD_ROM_FN(md_chukrck2) - -struct BurnDriver BurnDrvmd_chukrck2 = { - "md_chukrck2", NULL, NULL, NULL, "1993", - "Chuck Rock II - Son of Chuck (Euro)\0", NULL, "Core Design", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chukrck2RomInfo, md_chukrck2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chuck Rock II (Jpn) -static struct BurnRomInfo md_chukrck2jRomDesc[] = { - { "chuck rock ii (jpn).bin", 0x100000, 0xbfd24be8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chukrck2j) -STD_ROM_FN(md_chukrck2j) - -struct BurnDriver BurnDrvmd_chukrck2j = { - "md_chukrck2j", "md_chukrck2", NULL, NULL, "1994", - "Chuck Rock II (Jpn)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chukrck2jRomInfo, md_chukrck2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chuck Rock II - Son of Chuck (USA) -static struct BurnRomInfo md_chukrck2uRomDesc[] = { - { "chuck rock ii - son of chuck (usa).bin", 0x100000, 0x408b1cdb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chukrck2u) -STD_ROM_FN(md_chukrck2u) - -struct BurnDriver BurnDrvmd_chukrck2u = { - "md_chukrck2u", "md_chukrck2", NULL, NULL, "1993", - "Chuck Rock II - Son of Chuck (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chukrck2uRomInfo, md_chukrck2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chuck Rock II - Son of Chuck (USA, Prototype) -static struct BurnRomInfo md_chukrck2upRomDesc[] = { - { "chuck rock ii - son of chuck (usa) (beta).bin", 0x100000, 0xd6a3b324, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chukrck2up) -STD_ROM_FN(md_chukrck2up) - -struct BurnDriver BurnDrvmd_chukrck2up = { - "md_chukrck2up", "md_chukrck2", NULL, NULL, "1993", - "Chuck Rock II - Son of Chuck (USA, Prototype)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chukrck2upRomInfo, md_chukrck2upRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chuck's Excellent Art Tool Animator (USA) -static struct BurnRomInfo md_excelartRomDesc[] = { - { "chuck's excellent art tool animator (usa) (unl).bin", 0x060000, 0x6360ee58, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_excelart) -STD_ROM_FN(md_excelart) - -struct BurnDriver BurnDrvmd_excelart = { - "md_excelart", NULL, NULL, NULL, "199?", - "Chuck's Excellent Art Tool Animator (USA)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_excelartRomInfo, md_excelartRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Classic Collection (Euro) -static struct BurnRomInfo md_classiccRomDesc[] = { - { "classic collection (euro).bin", 0x200000, 0x73f948b1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_classicc) -STD_ROM_FN(md_classicc) - -struct BurnDriver BurnDrvmd_classicc = { - "md_classicc", NULL, NULL, NULL, "1994", - "Classic Collection (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_classiccRomInfo, md_classiccRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Clay Fighter (Euro) -static struct BurnRomInfo md_clayfghtRomDesc[] = { - { "mpr-17510.bin", 0x200000, 0x1aaf7707, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_clayfght) -STD_ROM_FN(md_clayfght) - -struct BurnDriver BurnDrvmd_clayfght = { - "md_clayfght", NULL, NULL, NULL, "1994", - "Clay Fighter (Euro)\0", NULL, "Interplay", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_clayfghtRomInfo, md_clayfghtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Clay Fighter (USA) -static struct BurnRomInfo md_clayfghtuRomDesc[] = { - { "clay fighter (usa).bin", 0x200000, 0xb12c1bc1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_clayfghtu) -STD_ROM_FN(md_clayfghtu) - -struct BurnDriver BurnDrvmd_clayfghtu = { - "md_clayfghtu", "md_clayfght", NULL, NULL, "1994", - "Clay Fighter (USA)\0", NULL, "Interplay", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_clayfghtuRomInfo, md_clayfghtuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cliffhanger (Euro) -static struct BurnRomInfo md_cliffhRomDesc[] = { - { "cliffhanger (euro).bin", 0x100000, 0x35bff1fd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cliffh) -STD_ROM_FN(md_cliffh) - -struct BurnDriver BurnDrvmd_cliffh = { - "md_cliffh", NULL, NULL, NULL, "1993", - "Cliffhanger (Euro)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cliffhRomInfo, md_cliffhRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cliffhanger (Prototype) -static struct BurnRomInfo md_cliffhpRomDesc[] = { - { "cliffhanger (beta).bin", 0x100000, 0x628251fd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cliffhp) -STD_ROM_FN(md_cliffhp) - -struct BurnDriver BurnDrvmd_cliffhp = { - "md_cliffhp", "md_cliffh", NULL, NULL, "1993", - "Cliffhanger (Prototype)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cliffhpRomInfo, md_cliffhpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cliffhanger (USA) -static struct BurnRomInfo md_cliffhuRomDesc[] = { - { "cliffhanger (usa).bin", 0x100000, 0x9cbf44d3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cliffhu) -STD_ROM_FN(md_cliffhu) - -struct BurnDriver BurnDrvmd_cliffhu = { - "md_cliffhu", "md_cliffh", NULL, NULL, "1993", - "Cliffhanger (USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cliffhuRomInfo, md_cliffhuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Clue (USA) -static struct BurnRomInfo md_clueRomDesc[] = { - { "clue (usa).bin", 0x080000, 0x7753a296, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_clue) -STD_ROM_FN(md_clue) - -struct BurnDriver BurnDrvmd_clue = { - "md_clue", NULL, NULL, NULL, "1992", - "Clue (USA)\0", NULL, "Parker Brothers", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_clueRomInfo, md_clueRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Coach K College Basketball (USA) -static struct BurnRomInfo md_coachkRomDesc[] = { - { "coach k college basketball (usa).bin", 0x200000, 0x67c309c6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_coachk) -STD_ROM_FN(md_coachk) - -struct BurnDriver BurnDrvmd_coachk = { - "md_coachk", NULL, NULL, NULL, "1995", - "Coach K College Basketball (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_coachkRomInfo, md_coachkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football USA 96 (USA) -static struct BurnRomInfo md_colleg96RomDesc[] = { - { "college football usa 96 (usa).bin", 0x200000, 0xb9075385, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_colleg96) -STD_ROM_FN(md_colleg96) - -struct BurnDriver BurnDrvmd_colleg96 = { - "md_colleg96", NULL, NULL, NULL, "1995", - "College Football USA 96 (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_colleg96RomInfo, md_colleg96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football USA 97 (USA) -static struct BurnRomInfo md_colleg97RomDesc[] = { - { "college football usa 97 (usa).bin", 0x200000, 0x2ebb90a3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_colleg97) -STD_ROM_FN(md_colleg97) - -struct BurnDriver BurnDrvmd_colleg97 = { - "md_colleg97", NULL, NULL, NULL, "1996", - "College Football USA 97 (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_colleg97RomInfo, md_colleg97RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (USA) -static struct BurnRomInfo md_collncRomDesc[] = { - { "college football's national championship (usa).bin", 0x200000, 0x172c5dbb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collnc) -STD_ROM_FN(md_collnc) - -struct BurnDriver BurnDrvmd_collnc = { - "md_collnc", NULL, NULL, NULL, "1994", - "College Football's National Championship (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncRomInfo, md_collncRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940413) -static struct BurnRomInfo md_collncp19RomDesc[] = { - { "college football's national championship (prototype - apr 13, 1994).bin", 0x200000, 0xd9772def, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp19) -STD_ROM_FN(md_collncp19) - -struct BurnDriver BurnDrvmd_collncp19 = { - "md_collncp19", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940413)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp19RomInfo, md_collncp19RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940418) -static struct BurnRomInfo md_collncp18RomDesc[] = { - { "college football's national championship (prototype - apr 18, 1994).bin", 0x200000, 0xe0a1705f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp18) -STD_ROM_FN(md_collncp18) - -struct BurnDriver BurnDrvmd_collncp18 = { - "md_collncp18", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940418)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp18RomInfo, md_collncp18RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940419) -static struct BurnRomInfo md_collncp17RomDesc[] = { - { "college football's national championship (prototype - apr 19, 1994).bin", 0x200000, 0xd5fe66c3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp17) -STD_ROM_FN(md_collncp17) - -struct BurnDriver BurnDrvmd_collncp17 = { - "md_collncp17", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940419)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp17RomInfo, md_collncp17RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940429) -static struct BurnRomInfo md_collncp16RomDesc[] = { - { "college football's national championship (prototype - apr 29, 1994).bin", 0x200000, 0x99da1973, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp16) -STD_ROM_FN(md_collncp16) - -struct BurnDriver BurnDrvmd_collncp16 = { - "md_collncp16", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940429)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp16RomInfo, md_collncp16RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940601) -static struct BurnRomInfo md_collncp08RomDesc[] = { - { "college football's national championship (prototype - jun 01, 1994).bin", 0x200000, 0x994dbc8f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp08) -STD_ROM_FN(md_collncp08) - -struct BurnDriver BurnDrvmd_collncp08 = { - "md_collncp08", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940601)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp08RomInfo, md_collncp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940603) -static struct BurnRomInfo md_collncp07RomDesc[] = { - { "college football's national championship (prototype - jun 03, 1994).bin", 0x200000, 0x9ca29321, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp07) -STD_ROM_FN(md_collncp07) - -struct BurnDriver BurnDrvmd_collncp07 = { - "md_collncp07", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940603)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp07RomInfo, md_collncp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940607) -static struct BurnRomInfo md_collncp06RomDesc[] = { - { "college football's national championship (prototype - jun 07, 1994).bin", 0x200000, 0xb40b791e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp06) -STD_ROM_FN(md_collncp06) - -struct BurnDriver BurnDrvmd_collncp06 = { - "md_collncp06", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940607)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp06RomInfo, md_collncp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940608) -static struct BurnRomInfo md_collncp05RomDesc[] = { - { "college football's national championship (prototype - jun 08, 1994).bin", 0x200000, 0xd008debc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp05) -STD_ROM_FN(md_collncp05) - -struct BurnDriver BurnDrvmd_collncp05 = { - "md_collncp05", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940608)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp05RomInfo, md_collncp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940614) -static struct BurnRomInfo md_collncp04RomDesc[] = { - { "college football's national championship (prototype - jun 14, 1994).bin", 0x200000, 0xecef7de7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp04) -STD_ROM_FN(md_collncp04) - -struct BurnDriver BurnDrvmd_collncp04 = { - "md_collncp04", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940614)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp04RomInfo, md_collncp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940615) -static struct BurnRomInfo md_collncp03RomDesc[] = { - { "college football's national championship (prototype - jun 15, 1994).bin", 0x200000, 0xc7e5a998, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp03) -STD_ROM_FN(md_collncp03) - -struct BurnDriver BurnDrvmd_collncp03 = { - "md_collncp03", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940615)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp03RomInfo, md_collncp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940618) -static struct BurnRomInfo md_collncp02RomDesc[] = { - { "college football's national championship (prototype - jun 18, 1994).bin", 0x200000, 0x74988a9d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp02) -STD_ROM_FN(md_collncp02) - -struct BurnDriver BurnDrvmd_collncp02 = { - "md_collncp02", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940618)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp02RomInfo, md_collncp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940620) -static struct BurnRomInfo md_collncp01RomDesc[] = { - { "college football's national championship (prototype - jun 20, 1994).bin", 0x200000, 0x898c17fa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp01) -STD_ROM_FN(md_collncp01) - -struct BurnDriver BurnDrvmd_collncp01 = { - "md_collncp01", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940620)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp01RomInfo, md_collncp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940503) -static struct BurnRomInfo md_collncp15RomDesc[] = { - { "college football's national championship (prototype - may 03, 1994).bin", 0x200000, 0xdb1a3f66, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp15) -STD_ROM_FN(md_collncp15) - -struct BurnDriver BurnDrvmd_collncp15 = { - "md_collncp15", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940503)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp15RomInfo, md_collncp15RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940506) -static struct BurnRomInfo md_collncp14RomDesc[] = { - { "college football's national championship (prototype - may 06, 1994).bin", 0x200000, 0x0a538e75, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp14) -STD_ROM_FN(md_collncp14) - -struct BurnDriver BurnDrvmd_collncp14 = { - "md_collncp14", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940506)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp14RomInfo, md_collncp14RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940511-A) -static struct BurnRomInfo md_collncp13RomDesc[] = { - { "college football's national championship (prototype - may 11, 1994 - a).bin", 0x200000, 0xce65b294, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp13) -STD_ROM_FN(md_collncp13) - -struct BurnDriver BurnDrvmd_collncp13 = { - "md_collncp13", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940511-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp13RomInfo, md_collncp13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940517-A) -static struct BurnRomInfo md_collncp12RomDesc[] = { - { "college football's national championship (prototype - may 17, 1994 - a).bin", 0x200000, 0x8cfd4c86, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp12) -STD_ROM_FN(md_collncp12) - -struct BurnDriver BurnDrvmd_collncp12 = { - "md_collncp12", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940517-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp12RomInfo, md_collncp12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940520) -static struct BurnRomInfo md_collncp11RomDesc[] = { - { "college football's national championship (prototype - may 20, 1994).bin", 0x200000, 0xf285385e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp11) -STD_ROM_FN(md_collncp11) - -struct BurnDriver BurnDrvmd_collncp11 = { - "md_collncp11", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940520)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp11RomInfo, md_collncp11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940525) -static struct BurnRomInfo md_collncp10RomDesc[] = { - { "college football's national championship (prototype - may 25, 1994).bin", 0x200000, 0x482e334a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp10) -STD_ROM_FN(md_collncp10) - -struct BurnDriver BurnDrvmd_collncp10 = { - "md_collncp10", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940525)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp10RomInfo, md_collncp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship (Prototype, 19940531) -static struct BurnRomInfo md_collncp09RomDesc[] = { - { "college football's national championship (prototype - may 31, 1994).bin", 0x200000, 0xc6766745, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collncp09) -STD_ROM_FN(md_collncp09) - -struct BurnDriver BurnDrvmd_collncp09 = { - "md_collncp09", "md_collnc", NULL, NULL, "1994", - "College Football's National Championship (Prototype, 19940531)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collncp09RomInfo, md_collncp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Football's National Championship II (USA) -static struct BurnRomInfo md_collnc2RomDesc[] = { - { "college football's national championship ii (usa).bin", 0x200000, 0x65b64413, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collnc2) -STD_ROM_FN(md_collnc2) - -struct BurnDriver BurnDrvmd_collnc2 = { - "md_collnc2", NULL, NULL, NULL, "1995", - "College Football's National Championship II (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_collnc2RomInfo, md_collnc2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// College Slam (USA) -static struct BurnRomInfo md_collslamRomDesc[] = { - { "college slam (usa).bin", 0x400000, 0x96a42431, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_collslam) -STD_ROM_FN(md_collslam) - -struct BurnDriver BurnDrvmd_collslam = { - "md_collslam", NULL, NULL, NULL, "1996", - "College Slam (USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_C_SLAM, GBF_MISC, 0, - MegadriveGetZipName, md_collslamRomInfo, md_collslamRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Columns (World, v1.1) -static struct BurnRomInfo md_columnsRomDesc[] = { - { "columns (world) (v1.1).bin", 0x020000, 0xd783c244, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_columns) -STD_ROM_FN(md_columns) - -struct BurnDriver BurnDrvmd_columns = { - "md_columns", NULL, NULL, NULL, "1990", - "Columns (World, v1.1)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_columnsRomInfo, md_columnsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Columns (World) -static struct BurnRomInfo md_columns1RomDesc[] = { - { "mpr-13193.bin", 0x020000, 0x03163d7a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_columns1) -STD_ROM_FN(md_columns1) - -struct BurnDriver BurnDrvmd_columns1 = { - "md_columns1", "md_columns", NULL, NULL, "1990", - "Columns (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_columns1RomInfo, md_columns1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Columns III - Revenge of Columns (USA) -static struct BurnRomInfo md_columns3RomDesc[] = { - { "columns iii - revenge of columns (usa).bin", 0x080000, 0xdc678f6d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_columns3) -STD_ROM_FN(md_columns3) - -struct BurnDriver BurnDrvmd_columns3 = { - "md_columns3", NULL, NULL, NULL, "1993", - "Columns III - Revenge of Columns (USA)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_columns3RomInfo, md_columns3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Columns III - Taiketsu! Columns World (Jpn, Kor) -static struct BurnRomInfo md_columns3jRomDesc[] = { - { "columns iii - taiketsu! columns world (jpn, kor).bin", 0x080000, 0xcd07462f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_columns3j) -STD_ROM_FN(md_columns3j) - -struct BurnDriver BurnDrvmd_columns3j = { - "md_columns3j", "md_columns3", NULL, NULL, "1993", - "Columns III - Taiketsu! Columns World (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_columns3jRomInfo, md_columns3jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Combat Aces (Prototype) -static struct BurnRomInfo md_combatRomDesc[] = { - { "combat aces (beta).bin", 0x080000, 0x84560d5a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_combat) -STD_ROM_FN(md_combat) - -struct BurnDriver BurnDrvmd_combat = { - "md_combat", NULL, NULL, NULL, "199?", - "Combat Aces (Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_combatRomInfo, md_combatRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Combat Cars (Euro, USA) -static struct BurnRomInfo md_combatcaRomDesc[] = { - { "combat cars (euro, usa).bin", 0x100000, 0xe439b101, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_combatca) -STD_ROM_FN(md_combatca) - -struct BurnDriver BurnDrvmd_combatca = { - "md_combatca", NULL, NULL, NULL, "1994", - "Combat Cars (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_combatcaRomInfo, md_combatcaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (Euro) -static struct BurnRomInfo md_comixRomDesc[] = { - { "mpr-18301.bin", 0x200000, 0x1318e923, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comix) -STD_ROM_FN(md_comix) - -struct BurnDriver BurnDrvmd_comix = { - "md_comix", NULL, NULL, NULL, "1995", - "Comix Zone (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixRomInfo, md_comixRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (Euro, Prototype, 19950628) -static struct BurnRomInfo md_comixpRomDesc[] = { - { "comix zone (euro) (prototype - jun 28, 1995).bin", 0x200000, 0x939efd4c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixp) -STD_ROM_FN(md_comixp) - -struct BurnDriver BurnDrvmd_comixp = { - "md_comixp", "md_comix", NULL, NULL, "1995", - "Comix Zone (Euro, Prototype, 19950628)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixpRomInfo, md_comixpRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (Jpn) -static struct BurnRomInfo md_comixjRomDesc[] = { - { "comix zone (jpn).bin", 0x200000, 0x7a6027b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixj) -STD_ROM_FN(md_comixj) - -struct BurnDriver BurnDrvmd_comixj = { - "md_comixj", "md_comix", NULL, NULL, "1995", - "Comix Zone (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixjRomInfo, md_comixjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (Euro, Prototype, 19950712) -static struct BurnRomInfo md_comixup01RomDesc[] = { - { "comix zone (prototype - jul 12, 1995).bin", 0x200000, 0xe28c89c1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup01) -STD_ROM_FN(md_comixup01) - -struct BurnDriver BurnDrvmd_comixup01 = { - "md_comixup01", "md_comix", NULL, NULL, "1995", - "Comix Zone (Euro, Prototype, 19950712)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup01RomInfo, md_comixup01RomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (USA, Prototype, 19950601-B) -static struct BurnRomInfo md_comixup08RomDesc[] = { - { "comix zone (prototype - jun 01, 1995 - b).bin", 0x200000, 0xbbe03cb6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup08) -STD_ROM_FN(md_comixup08) - -struct BurnDriver BurnDrvmd_comixup08 = { - "md_comixup08", "md_comix", NULL, NULL, "1995", - "Comix Zone (USA, Prototype, 19950601-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup08RomInfo, md_comixup08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (USA, Prototype, 19950601-C) -static struct BurnRomInfo md_comixup07RomDesc[] = { - { "comix zone (prototype - jun 01, 1995 - c).bin", 0x200000, 0x413b9a94, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup07) -STD_ROM_FN(md_comixup07) - -struct BurnDriver BurnDrvmd_comixup07 = { - "md_comixup07", "md_comix", NULL, NULL, "1995", - "Comix Zone (USA, Prototype, 19950601-C)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup07RomInfo, md_comixup07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (USA, Prototype, 19950601-D) -static struct BurnRomInfo md_comixup06RomDesc[] = { - { "comix zone (prototype - jun 01, 1995 - d).bin", 0x200000, 0x9ae93c9d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup06) -STD_ROM_FN(md_comixup06) - -struct BurnDriver BurnDrvmd_comixup06 = { - "md_comixup06", "md_comix", NULL, NULL, "1995", - "Comix Zone (USA, Prototype, 19950601-D)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup06RomInfo, md_comixup06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (USA, Prototype, 19950601) -static struct BurnRomInfo md_comixup05RomDesc[] = { - { "comix zone (prototype - jun 01, 1995).bin", 0x200000, 0xba506835, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup05) -STD_ROM_FN(md_comixup05) - -struct BurnDriver BurnDrvmd_comixup05 = { - "md_comixup05", "md_comix", NULL, NULL, "1995", - "Comix Zone (USA, Prototype, 19950601)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup05RomInfo, md_comixup05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (USA, Prototype, 19950602-B) -static struct BurnRomInfo md_comixup04RomDesc[] = { - { "comix zone (prototype - jun 02, 1995 - b).bin", 0x200000, 0xb5f0dae5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup04) -STD_ROM_FN(md_comixup04) - -struct BurnDriver BurnDrvmd_comixup04 = { - "md_comixup04", "md_comix", NULL, NULL, "1995", - "Comix Zone (USA, Prototype, 19950602-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup04RomInfo, md_comixup04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (USA, Prototype, 19950602) -static struct BurnRomInfo md_comixup03RomDesc[] = { - { "comix zone (prototype - jun 02, 1995).bin", 0x200000, 0x1a4abcf3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup03) -STD_ROM_FN(md_comixup03) - -struct BurnDriver BurnDrvmd_comixup03 = { - "md_comixup03", "md_comix", NULL, NULL, "1995", - "Comix Zone (USA, Prototype, 19950602)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup03RomInfo, md_comixup03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (USA, Prototype, 19950603) -static struct BurnRomInfo md_comixup02RomDesc[] = { - { "comix zone (prototype - jun 03, 1995).bin", 0x200000, 0xaff32614, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup02) -STD_ROM_FN(md_comixup02) - -struct BurnDriver BurnDrvmd_comixup02 = { - "md_comixup02", "md_comix", NULL, NULL, "1995", - "Comix Zone (USA, Prototype, 19950603)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup02RomInfo, md_comixup02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (Prototype, 19950526) -static struct BurnRomInfo md_comixup10RomDesc[] = { - { "comix zone (prototype - may 26, 1995).bin", 0x200000, 0x36029a1f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup10) -STD_ROM_FN(md_comixup10) - -struct BurnDriver BurnDrvmd_comixup10 = { - "md_comixup10", "md_comix", NULL, NULL, "1995", - "Comix Zone (Prototype, 19950526)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup10RomInfo, md_comixup10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (Prototype, 19950530) -static struct BurnRomInfo md_comixup09RomDesc[] = { - { "comix zone (prototype - may 30, 1995).bin", 0x200000, 0xa72eca2c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup09) -STD_ROM_FN(md_comixup09) - -struct BurnDriver BurnDrvmd_comixup09 = { - "md_comixup09", "md_comix", NULL, NULL, "1995", - "Comix Zone (Prototype, 19950530)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixup09RomInfo, md_comixup09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (Kor, Prototype, 19950609) -static struct BurnRomInfo md_comixkpRomDesc[] = { - { "comix zone (kor) (prototype - jun 09, 1995).bin", 0x200000, 0xe45a15f4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixkp) -STD_ROM_FN(md_comixkp) - -struct BurnDriver BurnDrvmd_comixkp = { - "md_comixkp", "md_comix", NULL, NULL, "1995", - "Comix Zone (Kor, Prototype, 19950609)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixkpRomInfo, md_comixkpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (Sega Channel, Prototype, 19950612) -static struct BurnRomInfo md_comixscRomDesc[] = { - { "comix zone (sega channel) (prototype - jun 12, 1995).bin", 0x200000, 0xc77db9e1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixsc) -STD_ROM_FN(md_comixsc) - -struct BurnDriver BurnDrvmd_comixsc = { - "md_comixsc", "md_comix", NULL, NULL, "1995", - "Comix Zone (Sega Channel, Prototype, 19950612)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixscRomInfo, md_comixscRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (USA) -static struct BurnRomInfo md_comixuRomDesc[] = { - { "comix zone (usa).bin", 0x200000, 0x17da0354, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixu) -STD_ROM_FN(md_comixu) - -struct BurnDriver BurnDrvmd_comixu = { - "md_comixu", "md_comix", NULL, NULL, "1995", - "Comix Zone (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixuRomInfo, md_comixuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Comix Zone (USA, Prototype) -static struct BurnRomInfo md_comixupRomDesc[] = { - { "comix zone (usa) (beta).bin", 0x200000, 0x2efcb6ee, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_comixup) -STD_ROM_FN(md_comixup) - -struct BurnDriver BurnDrvmd_comixup = { - "md_comixup", "md_comix", NULL, NULL, "1995", - "Comix Zone (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_comixupRomInfo, md_comixupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Congo (Prototype) -static struct BurnRomInfo md_congoRomDesc[] = { - { "congo (unknown) (prototype).bin", 0x0f7d36, 0x13746716, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_congo) -STD_ROM_FN(md_congo) - -struct BurnDriver BurnDrvmd_congo = { - "md_congo", NULL, NULL, NULL, "199?", - "Congo (Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_congoRomInfo, md_congoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cool Spot (Euro) -static struct BurnRomInfo md_coolspotRomDesc[] = { - { "mpr-15477.bin", 0x100000, 0x5f09fa41, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_coolspot) -STD_ROM_FN(md_coolspot) - -struct BurnDriver BurnDrvmd_coolspot = { - "md_coolspot", NULL, NULL, NULL, "1994", - "Cool Spot (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_coolspotRomInfo, md_coolspotRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cool Spot (Jpn, Kor) -static struct BurnRomInfo md_coolspotjRomDesc[] = { - { "cool spot (jpn, kor).bin", 0x100000, 0xe869efb1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_coolspotj) -STD_ROM_FN(md_coolspotj) - -struct BurnDriver BurnDrvmd_coolspotj = { - "md_coolspotj", "md_coolspot", NULL, NULL, "1994", - "Cool Spot (Jpn, Kor)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_coolspotjRomInfo, md_coolspotjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cool Spot (USA) -static struct BurnRomInfo md_coolspotuRomDesc[] = { - { "cool spot (usa).bin", 0x100000, 0xf024c1a1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_coolspotu) -STD_ROM_FN(md_coolspotu) - -struct BurnDriver BurnDrvmd_coolspotu = { - "md_coolspotu", "md_coolspot", NULL, NULL, "1994", - "Cool Spot (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_coolspotuRomInfo, md_coolspotuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cool Spot (USA, Prototype) -static struct BurnRomInfo md_coolspotupRomDesc[] = { - { "cool spot (usa) (beta).bin", 0x100000, 0x0ebaa4a8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_coolspotup) -STD_ROM_FN(md_coolspotup) - -struct BurnDriver BurnDrvmd_coolspotup = { - "md_coolspotup", "md_coolspot", NULL, NULL, "1994", - "Cool Spot (USA, Prototype)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_coolspotupRomInfo, md_coolspotupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Corporation (Euro) -static struct BurnRomInfo md_corporatRomDesc[] = { - { "mpr-15065.bin", 0x100000, 0xa80d18aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_corporat) -STD_ROM_FN(md_corporat) - -struct BurnDriver BurnDrvmd_corporat = { - "md_corporat", NULL, NULL, NULL, "1992", - "Corporation (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_corporatRomInfo, md_corporatRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cyber-Cop (USA) -static struct BurnRomInfo md_cybercopRomDesc[] = { - { "cyber-cop (usa).bin", 0x100000, 0x01e719c8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cybercop) -STD_ROM_FN(md_cybercop) - -struct BurnDriver BurnDrvmd_cybercop = { - "md_cybercop", "md_corporat", NULL, NULL, "1992", - "Cyber-Cop (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cybercopRomInfo, md_cybercopRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cosmic Spacehead (Euro, USA) -static struct BurnRomInfo md_cosmicRomDesc[] = { - { "cosmic spacehead (euro, usa).bin", 0x100000, 0xc593d31c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cosmic) -STD_ROM_FN(md_cosmic) - -struct BurnDriver BurnDrvmd_cosmic = { - "md_cosmic", NULL, NULL, NULL, "1993", - "Cosmic Spacehead (Euro, USA)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cosmicRomInfo, md_cosmicRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crack Down (Euro, Jpn, Rev. A) -static struct BurnRomInfo md_crkdownRomDesc[] = { - { "mpr-13578a.bin", 0x080000, 0xd012a47a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crkdown) -STD_ROM_FN(md_crkdown) - -struct BurnDriver BurnDrvmd_crkdown = { - "md_crkdown", NULL, NULL, NULL, "1990", - "Crack Down (Euro, Jpn, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crkdownRomInfo, md_crkdownRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crack Down (Euro, Jpn) -static struct BurnRomInfo md_crkdown1RomDesc[] = { - { "crack down (euro, jpn).bin", 0x080000, 0x538aaa5d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crkdown1) -STD_ROM_FN(md_crkdown1) - -struct BurnDriver BurnDrvmd_crkdown1 = { - "md_crkdown1", "md_crkdown", NULL, NULL, "1990", - "Crack Down (Euro, Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crkdown1RomInfo, md_crkdown1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crack Down (USA) -static struct BurnRomInfo md_crkdownuRomDesc[] = { - { "crack down (usa).bin", 0x080000, 0xb9ce9051, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crkdownu) -STD_ROM_FN(md_crkdownu) - -struct BurnDriver BurnDrvmd_crkdownu = { - "md_crkdownu", "md_crkdown", NULL, NULL, "1991", - "Crack Down (USA)\0", NULL, "Sage's Creation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crkdownuRomInfo, md_crkdownuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crayon Shin-chan - Arashi o Yobu Enji (Jpn) -static struct BurnRomInfo md_crayonRomDesc[] = { - { "crayon shin-chan - arashi o yobu enji (jpn).bin", 0x200000, 0x97fc42d2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crayon) -STD_ROM_FN(md_crayon) - -struct BurnDriver BurnDrvmd_crayon = { - "md_crayon", NULL, NULL, NULL, "1994", - "Crayon Shin-chan - Arashi o Yobu Enji (Jpn)\0", NULL, "Ma-Ba", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crayonRomInfo, md_crayonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cross Fire (USA) -static struct BurnRomInfo md_xfireRomDesc[] = { - { "cross fire (usa).bin", 0x080000, 0xcc73f3a9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xfire) -STD_ROM_FN(md_xfire) - -struct BurnDriver BurnDrvmd_xfire = { - "md_xfire", NULL, NULL, NULL, "1991", - "Cross Fire (USA)\0", NULL, "Kyugo Boueki", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xfireRomInfo, md_xfireRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Airwolf (Jpn) -static struct BurnRomInfo md_superairRomDesc[] = { - { "mpr-13814.bin", 0x080000, 0xfa451982, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_superair) -STD_ROM_FN(md_superair) - -struct BurnDriver BurnDrvmd_superair = { - "md_superair", "md_xfire", NULL, NULL, "1991", - "Super Airwolf (Jpn)\0", NULL, "Kyugo Boueki", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_superairRomInfo, md_superairRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crue Ball (Euro, USA) -static struct BurnRomInfo md_crueballRomDesc[] = { - { "crue06.bin", 0x080000, 0x4b195fc0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crueball) -STD_ROM_FN(md_crueball) - -struct BurnDriver BurnDrvmd_crueball = { - "md_crueball", NULL, NULL, NULL, "1992", - "Crue Ball (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crueballRomInfo, md_crueballRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crue Ball (Jpn) -static struct BurnRomInfo md_crueballjRomDesc[] = { - { "crue ball (jpn).bin", 0x080000, 0x514c53e2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crueballj) -STD_ROM_FN(md_crueballj) - -struct BurnDriver BurnDrvmd_crueballj = { - "md_crueballj", "md_crueball", NULL, NULL, "1993", - "Crue Ball (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crueballjRomInfo, md_crueballjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Twisted Flipper (USA, Prototype) -static struct BurnRomInfo md_twistedfRomDesc[] = { - { "twisted flipper (usa) (beta).bin", 0x080000, 0x6dd47554, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_twistedf) -STD_ROM_FN(md_twistedf) - -struct BurnDriver BurnDrvmd_twistedf = { - "md_twistedf", "md_crueball", NULL, NULL, "199?", - "Twisted Flipper (USA, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_twistedfRomInfo, md_twistedfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA) -static struct BurnRomInfo md_crystlptRomDesc[] = { - { "crystal's pony tale (usa).bin", 0x100000, 0x6cf7a4df, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlpt) -STD_ROM_FN(md_crystlpt) - -struct BurnDriver BurnDrvmd_crystlpt = { - "md_crystlpt", NULL, NULL, NULL, "1994", - "Crystal's Pony Tale (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptRomInfo, md_crystlptRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940701) -static struct BurnRomInfo md_crystlptp06RomDesc[] = { - { "crystal's pony tale (prototype - jul 01, 1994).bin", 0x100000, 0x16ac2e4f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp06) -STD_ROM_FN(md_crystlptp06) - -struct BurnDriver BurnDrvmd_crystlptp06 = { - "md_crystlptp06", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940701)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp06RomInfo, md_crystlptp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940702) -static struct BurnRomInfo md_crystlptp05RomDesc[] = { - { "crystal's pony tale (prototype - jul 02, 1994).bin", 0x100000, 0x24bc4354, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp05) -STD_ROM_FN(md_crystlptp05) - -struct BurnDriver BurnDrvmd_crystlptp05 = { - "md_crystlptp05", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940702)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp05RomInfo, md_crystlptp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940703) -static struct BurnRomInfo md_crystlptp04RomDesc[] = { - { "crystal's pony tale (prototype - jul 03, 1994).bin", 0x100000, 0x6d67a87c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp04) -STD_ROM_FN(md_crystlptp04) - -struct BurnDriver BurnDrvmd_crystlptp04 = { - "md_crystlptp04", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940703)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp04RomInfo, md_crystlptp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940712-B) -static struct BurnRomInfo md_crystlptp03RomDesc[] = { - { "crystal's pony tale (prototype - jul 12, 1994 - b).bin", 0x100000, 0x3577dc72, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp03) -STD_ROM_FN(md_crystlptp03) - -struct BurnDriver BurnDrvmd_crystlptp03 = { - "md_crystlptp03", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940712-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp03RomInfo, md_crystlptp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940712) -static struct BurnRomInfo md_crystlptp02RomDesc[] = { - { "crystal's pony tale (prototype - jul 12, 1994).bin", 0x0ff554, 0x2bfc0a53, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp02) -STD_ROM_FN(md_crystlptp02) - -struct BurnDriver BurnDrvmd_crystlptp02 = { - "md_crystlptp02", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940712)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp02RomInfo, md_crystlptp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940713) -static struct BurnRomInfo md_crystlptp01RomDesc[] = { - { "crystal's pony tale (prototype - jul 13, 1994).bin", 0x100000, 0xc67b6dba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp01) -STD_ROM_FN(md_crystlptp01) - -struct BurnDriver BurnDrvmd_crystlptp01 = { - "md_crystlptp01", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940713)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp01RomInfo, md_crystlptp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940601) -static struct BurnRomInfo md_crystlptp12RomDesc[] = { - { "crystal's pony tale (prototype - jun 01, 1994).bin", 0x100000, 0x14c6347c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp12) -STD_ROM_FN(md_crystlptp12) - -struct BurnDriver BurnDrvmd_crystlptp12 = { - "md_crystlptp12", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940601)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp12RomInfo, md_crystlptp12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940606) -static struct BurnRomInfo md_crystlptp11RomDesc[] = { - { "crystal's pony tale (prototype - jun 06, 1994).bin", 0x100000, 0x83e8cac9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp11) -STD_ROM_FN(md_crystlptp11) - -struct BurnDriver BurnDrvmd_crystlptp11 = { - "md_crystlptp11", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940606)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp11RomInfo, md_crystlptp11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940610) -static struct BurnRomInfo md_crystlptp10RomDesc[] = { - { "crystal's pony tale (prototype - jun 10, 1994).bin", 0x100000, 0x9e1dd267, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp10) -STD_ROM_FN(md_crystlptp10) - -struct BurnDriver BurnDrvmd_crystlptp10 = { - "md_crystlptp10", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940610)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp10RomInfo, md_crystlptp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940623) -static struct BurnRomInfo md_crystlptp09RomDesc[] = { - { "crystal's pony tale (prototype - jun 23, 1994).bin", 0x100000, 0x4ccc19af, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp09) -STD_ROM_FN(md_crystlptp09) - -struct BurnDriver BurnDrvmd_crystlptp09 = { - "md_crystlptp09", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940623)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp09RomInfo, md_crystlptp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940628) -static struct BurnRomInfo md_crystlptp08RomDesc[] = { - { "crystal's pony tale (prototype - jun 28, 1994).bin", 0x100000, 0x03be7f66, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp08) -STD_ROM_FN(md_crystlptp08) - -struct BurnDriver BurnDrvmd_crystlptp08 = { - "md_crystlptp08", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940628)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp08RomInfo, md_crystlptp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940630) -static struct BurnRomInfo md_crystlptp07RomDesc[] = { - { "crystal's pony tale (prototype - jun 30, 1994).bin", 0x100000, 0xdd8c73fb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp07) -STD_ROM_FN(md_crystlptp07) - -struct BurnDriver BurnDrvmd_crystlptp07 = { - "md_crystlptp07", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940630)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp07RomInfo, md_crystlptp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940511) -static struct BurnRomInfo md_crystlptp15RomDesc[] = { - { "crystal's pony tale (prototype - may 11, 1994).bin", 0x100000, 0xeac9d74b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp15) -STD_ROM_FN(md_crystlptp15) - -struct BurnDriver BurnDrvmd_crystlptp15 = { - "md_crystlptp15", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940511)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp15RomInfo, md_crystlptp15RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940519) -static struct BurnRomInfo md_crystlptp14RomDesc[] = { - { "crystal's pony tale (prototype - may 19, 1994).bin", 0x100000, 0xdc50b741, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp14) -STD_ROM_FN(md_crystlptp14) - -struct BurnDriver BurnDrvmd_crystlptp14 = { - "md_crystlptp14", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940519)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp14RomInfo, md_crystlptp14RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crystal's Pony Tale (USA, Prototype, 19940526) -static struct BurnRomInfo md_crystlptp13RomDesc[] = { - { "crystal's pony tale (prototype - may 26, 1994).bin", 0x100000, 0xa2eaba55, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crystlptp13) -STD_ROM_FN(md_crystlptp13) - -struct BurnDriver BurnDrvmd_crystlptp13 = { - "md_crystlptp13", "md_crystlpt", NULL, NULL, "1994", - "Crystal's Pony Tale (USA, Prototype, 19940526)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crystlptp13RomInfo, md_crystlptp13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Curse (Jpn) -static struct BurnRomInfo md_curseRomDesc[] = { - { "curse (jpn).bin", 0x080000, 0xa4fbf9a9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_curse) -STD_ROM_FN(md_curse) - -struct BurnDriver BurnDrvmd_curse = { - "md_curse", NULL, NULL, NULL, "1989", - "Curse (Jpn)\0", NULL, "Micronet", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_curseRomInfo, md_curseRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cutie Suzuki no Ringside Angel (Jpn) -static struct BurnRomInfo md_cutiesuzRomDesc[] = { - { "cutie suzuki no ringside angel (jpn).bin", 0x080000, 0x13795dca, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cutiesuz) -STD_ROM_FN(md_cutiesuz) - -struct BurnDriver BurnDrvmd_cutiesuz = { - "md_cutiesuz", NULL, NULL, NULL, "1990", - "Cutie Suzuki no Ringside Angel (Jpn)\0", NULL, "Asmik Ace", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cutiesuzRomInfo, md_cutiesuzRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// CutThroat Island (Euro, USA) -static struct BurnRomInfo md_cutthrRomDesc[] = { - { "cutthroat island (euro, usa).bin", 0x200000, 0xebabbc70, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cutthr) -STD_ROM_FN(md_cutthr) - -struct BurnDriver BurnDrvmd_cutthr = { - "md_cutthr", NULL, NULL, NULL, "1995", - "CutThroat Island (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cutthrRomInfo, md_cutthrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// CutThroat Island (Prototye) -static struct BurnRomInfo md_cutthrpRomDesc[] = { - { "cipreview.bin", 0x200000, 0x7f4939f2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cutthrp) -STD_ROM_FN(md_cutthrp) - -struct BurnDriver BurnDrvmd_cutthrp = { - "md_cutthrp", "md_cutthr", NULL, NULL, "1995", - "CutThroat Island (Prototye)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cutthrpRomInfo, md_cutthrpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// CyberBall (World) -static struct BurnRomInfo md_cyberbalRomDesc[] = { - { "mpr-13201.bin", 0x080000, 0x76120e96, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cyberbal) -STD_ROM_FN(md_cyberbal) - -struct BurnDriver BurnDrvmd_cyberbal = { - "md_cyberbal", NULL, NULL, NULL, "1990", - "CyberBall (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cyberbalRomInfo, md_cyberbalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cyborg Justice (Euro, USA) -static struct BurnRomInfo md_cyborgjRomDesc[] = { - { "mpr-15468.bin", 0x080000, 0xab0d1269, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cyborgj) -STD_ROM_FN(md_cyborgj) - -struct BurnDriver BurnDrvmd_cyborgj = { - "md_cyborgj", NULL, NULL, NULL, "1993", - "Cyborg Justice (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cyborgjRomInfo, md_cyborgjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cyborg Justice (Prototype) -static struct BurnRomInfo md_cyborgjpRomDesc[] = { - { "cyborg justice (beta).bin", 0x080000, 0x91daf11e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cyborgjp) -STD_ROM_FN(md_cyborgjp) - -struct BurnDriver BurnDrvmd_cyborgjp = { - "md_cyborgjp", "md_cyborgj", NULL, NULL, "1993", - "Cyborg Justice (Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cyborgjpRomInfo, md_cyborgjpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Daffy Duck in Hollywood (Euro) -static struct BurnRomInfo md_daffyRomDesc[] = { - { "daffy duck in hollywood (euro).bin", 0x200000, 0x1fdc66b0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_daffy) -STD_ROM_FN(md_daffy) - -struct BurnDriver BurnDrvmd_daffy = { - "md_daffy", NULL, NULL, NULL, "1994", - "Daffy Duck in Hollywood (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_daffyRomInfo, md_daffyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Daffy Duck in Hollywood (Euro, Prototype) -static struct BurnRomInfo md_daffypRomDesc[] = { - { "daffy duck in hollywood (euro) (beta).bin", 0x200000, 0x0eaa4740, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_daffyp) -STD_ROM_FN(md_daffyp) - -struct BurnDriver BurnDrvmd_daffyp = { - "md_daffyp", "md_daffy", NULL, NULL, "1994", - "Daffy Duck in Hollywood (Euro, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_daffypRomInfo, md_daffypRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dahna Megami Tanjou (Jpn) -static struct BurnRomInfo md_dahnamRomDesc[] = { - { "dahna megami tanjou (jpn).bin", 0x100000, 0x4602584f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dahnam) -STD_ROM_FN(md_dahnam) - -struct BurnDriver BurnDrvmd_dahnam = { - "md_dahnam", NULL, NULL, NULL, "1991", - "Dahna Megami Tanjou (Jpn)\0", NULL, "IGS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dahnamRomInfo, md_dahnamRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dahna (Kor) -static struct BurnRomInfo md_dahnamkRomDesc[] = { - { "mpr-14636.bin", 0x100000, 0x10829ea1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dahnamk) -STD_ROM_FN(md_dahnamk) - -struct BurnDriver BurnDrvmd_dahnamk = { - "md_dahnamk", "md_dahnam", NULL, NULL, "199?", - "Dahna (Kor)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dahnamkRomInfo, md_dahnamkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hercules -static struct BurnRomInfo md_herculesRomDesc[] = { - { "hercules (unl).bin", 0x100000, 0xff75d9d0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hercules) -STD_ROM_FN(md_hercules) - -struct BurnDriver BurnDrvmd_hercules = { - "md_hercules", "md_dahnam", NULL, NULL, "199?", - "Hercules\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_herculesRomInfo, md_herculesRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dangerous Seed (Jpn) -static struct BurnRomInfo md_dangseedRomDesc[] = { - { "dangerous seed (jpn).bin", 0x080000, 0xa2990031, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dangseed) -STD_ROM_FN(md_dangseed) - -struct BurnDriver BurnDrvmd_dangseed = { - "md_dangseed", NULL, NULL, NULL, "1990", - "Dangerous Seed (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dangseedRomInfo, md_dangseedRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dark Castle (Euro, USA) -static struct BurnRomInfo md_darkcastRomDesc[] = { - { "dark castle (euro, usa).bin", 0x080000, 0x0464aca4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_darkcast) -STD_ROM_FN(md_darkcast) - -struct BurnDriver BurnDrvmd_darkcast = { - "md_darkcast", NULL, NULL, NULL, "1991", - "Dark Castle (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_darkcastRomInfo, md_darkcastRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Darwin 4081 (Jpn, Kor) -static struct BurnRomInfo md_darwinRomDesc[] = { - { "darwin 4081 (jpn, kor).bin", 0x080000, 0x7a33b0cb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_darwin) -STD_ROM_FN(md_darwin) - -struct BurnDriver BurnDrvmd_darwin = { - "md_darwin", NULL, NULL, NULL, "1990", - "Darwin 4081 (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_darwinRomInfo, md_darwinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dashin' Desperadoes (USA) -static struct BurnRomInfo md_dashdesRomDesc[] = { - { "dashin' desperadoes (usa).bin", 0x100000, 0xdcb76fb7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dashdes) -STD_ROM_FN(md_dashdes) - -struct BurnDriver BurnDrvmd_dashdes = { - "md_dashdes", NULL, NULL, NULL, "1993", - "Dashin' Desperadoes (USA)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dashdesRomInfo, md_dashdesRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dashin' Desperadoes (Euro, Prototype) -static struct BurnRomInfo md_dashdesp1RomDesc[] = { - { "dashin' desperadoes (usa) (beta).bin", 0x100000, 0x98d224a5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dashdesp1) -STD_ROM_FN(md_dashdesp1) - -struct BurnDriver BurnDrvmd_dashdesp1 = { - "md_dashdesp1", "md_dashdes", NULL, NULL, "1993", - "Dashin' Desperadoes (Euro, Prototype)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dashdesp1RomInfo, md_dashdesp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dashin' Desperadoes (USA, Prototype) -static struct BurnRomInfo md_dashdesp2RomDesc[] = { - { "dashin' desperadoes (beta).bin", 0x100000, 0xadaffc3f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dashdesp2) -STD_ROM_FN(md_dashdesp2) - -struct BurnDriver BurnDrvmd_dashdesp2 = { - "md_dashdesp2", "md_dashdes", NULL, NULL, "1993", - "Dashin' Desperadoes (USA, Prototype)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dashdesp2RomInfo, md_dashdesp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// David Crane's Amazing Tennis (USA) -static struct BurnRomInfo md_amazntenRomDesc[] = { - { "david crane's amazing tennis (usa).bin", 0x100000, 0x9177088c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_amaznten) -STD_ROM_FN(md_amaznten) - -struct BurnDriver BurnDrvmd_amaznten = { - "md_amaznten", NULL, NULL, NULL, "1992", - "David Crane's Amazing Tennis (USA)\0", NULL, "Absolute Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_amazntenRomInfo, md_amazntenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// David Robinson's Supreme Court (Euro, USA) -static struct BurnRomInfo md_drscRomDesc[] = { - { "mpr-14835.bin", 0x080000, 0x512b7599, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_drsc) -STD_ROM_FN(md_drsc) - -struct BurnDriver BurnDrvmd_drsc = { - "md_drsc", NULL, NULL, NULL, "1992", - "David Robinson's Supreme Court (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_drscRomInfo, md_drscRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// David Robinson Basketball (Jpn) -static struct BurnRomInfo md_drscjRomDesc[] = { - { "david robinson basketball (jpn).bin", 0x080000, 0x56164b00, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_drscj) -STD_ROM_FN(md_drscj) - -struct BurnDriver BurnDrvmd_drscj = { - "md_drscj", "md_drsc", NULL, NULL, "1992", - "David Robinson Basketball (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_drscjRomInfo, md_drscjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Davis Cup World Tour (Euro, USA, 199307) -static struct BurnRomInfo md_daviscupRomDesc[] = { - { "davis cup world tour (euro, usa) (july 1993).bin", 0x100000, 0x894686f0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_daviscup) -STD_ROM_FN(md_daviscup) - -struct BurnDriver BurnDrvmd_daviscup = { - "md_daviscup", NULL, NULL, NULL, "1993", - "Davis Cup World Tour (Euro, USA, 199307)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_daviscupRomInfo, md_daviscupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Davis Cup World Tour (Euro, USA, 199306) -static struct BurnRomInfo md_daviscupaRomDesc[] = { - { "davis cup world tour (euro, usa) (june 1993).bin", 0x100000, 0x7c6b0646, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_daviscupa) -STD_ROM_FN(md_daviscupa) - -struct BurnDriver BurnDrvmd_daviscupa = { - "md_daviscupa", "md_daviscup", NULL, NULL, "1993", - "Davis Cup World Tour (Euro, USA, 199306)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_daviscupaRomInfo, md_daviscupaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Davis Cup World Tour Tennis 2 (Prototype 1) -static struct BurnRomInfo md_daviscp2RomDesc[] = { - { "davis cup world tour tennis 2 (beta 1).bin", 0x200000, 0x6f4183c0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_daviscp2) -STD_ROM_FN(md_daviscp2) - -struct BurnDriver BurnDrvmd_daviscp2 = { - "md_daviscp2", NULL, NULL, NULL, "199?", - "Davis Cup World Tour Tennis 2 (Prototype 1)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_daviscp2RomInfo, md_daviscp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Davis Cup II (USA, Prototype) -static struct BurnRomInfo md_daviscp2aRomDesc[] = { - { "davis cup ii (usa) (prototype).bin", 0x200000, 0x76f2bed8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_daviscp2a) -STD_ROM_FN(md_daviscp2a) - -struct BurnDriver BurnDrvmd_daviscp2a = { - "md_daviscp2a", "md_daviscp2", NULL, NULL, "199?", - "Davis Cup II (USA, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_daviscp2aRomInfo, md_daviscp2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Daze Before Christmas (Oceania) -static struct BurnRomInfo md_dazexmasRomDesc[] = { - { "daze before christmas (aus).bin", 0x200000, 0xb95e25c9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dazexmas) -STD_ROM_FN(md_dazexmas) - -struct BurnDriver BurnDrvmd_dazexmas = { - "md_dazexmas", NULL, NULL, NULL, "1994", - "Daze Before Christmas (Oceania)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dazexmasRomInfo, md_dazexmasRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Daze Before Christmas (Oceania, Prototype) -static struct BurnRomInfo md_dazexmaspRomDesc[] = { - { "daze before christmas (aus) (beta).bin", 0x200000, 0x317c9491, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dazexmasp) -STD_ROM_FN(md_dazexmasp) - -struct BurnDriver BurnDrvmd_dazexmasp = { - "md_dazexmasp", "md_dazexmas", NULL, NULL, "1994", - "Daze Before Christmas (Oceania, Prototype)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dazexmaspRomInfo, md_dazexmaspRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Deadly Moves (USA) -static struct BurnRomInfo md_deadlymvRomDesc[] = { - { "deadly moves (usa).bin", 0x100000, 0x35cbd237, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_deadlymv) -STD_ROM_FN(md_deadlymv) - -struct BurnDriver BurnDrvmd_deadlymv = { - "md_deadlymv", NULL, NULL, NULL, "1992", - "Deadly Moves (USA)\0", NULL, "Kaneko", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_deadlymvRomInfo, md_deadlymvRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Power Athlete (Jpn, Kor) -static struct BurnRomInfo md_powerathRomDesc[] = { - { "power athlete (jpn, kor).bin", 0x100000, 0xb41b77cf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_powerath) -STD_ROM_FN(md_powerath) - -struct BurnDriver BurnDrvmd_powerath = { - "md_powerath", "md_deadlymv", NULL, NULL, "1992", - "Power Athlete (Jpn, Kor)\0", NULL, "Kaneko", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_powerathRomInfo, md_powerathRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Death and Return of Superman (USA) -static struct BurnRomInfo md_deathretRomDesc[] = { - { "death and return of superman, the (usa).bin", 0x200000, 0x982242d3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_deathret) -STD_ROM_FN(md_deathret) - -struct BurnDriver BurnDrvmd_deathret = { - "md_deathret", NULL, NULL, NULL, "1995", - "The Death and Return of Superman (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_deathretRomInfo, md_deathretRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Death Duel (USA) -static struct BurnRomInfo md_deathdlRomDesc[] = { - { "death duel (usa).bin", 0x100000, 0xa9804dcc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_deathdl) -STD_ROM_FN(md_deathdl) - -struct BurnDriver BurnDrvmd_deathdl = { - "md_deathdl", NULL, NULL, NULL, "1992", - "Death Duel (USA)\0", NULL, "Razorsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_deathdlRomInfo, md_deathdlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// DecapAttack (Euro, USA, Kor) -static struct BurnRomInfo md_decapattRomDesc[] = { - { "mpr-14249.bin", 0x080000, 0x73dc0dd8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_decapatt) -STD_ROM_FN(md_decapatt) - -struct BurnDriver BurnDrvmd_decapatt = { - "md_decapatt", NULL, NULL, NULL, "1991", - "DecapAttack (Euro, USA, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_decapattRomInfo, md_decapattRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Demolition Man (Euro, USA) -static struct BurnRomInfo md_demomanRomDesc[] = { - { "demolition man (euro, usa).bin", 0x200000, 0x5ff71877, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_demoman) -STD_ROM_FN(md_demoman) - -struct BurnDriver BurnDrvmd_demoman = { - "md_demoman", NULL, NULL, NULL, "1995", - "Demolition Man (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_demomanRomInfo, md_demomanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Demolition Man (USA, Prototype) -static struct BurnRomInfo md_demomanpRomDesc[] = { - { "demolition man (usa) (beta).bin", 0x200000, 0x57ffad7a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_demomanp) -STD_ROM_FN(md_demomanp) - -struct BurnDriver BurnDrvmd_demomanp = { - "md_demomanp", "md_demoman", NULL, NULL, "1995", - "Demolition Man (USA, Prototype)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_demomanpRomInfo, md_demomanpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Euro, USA) -static struct BurnRomInfo md_desrtdemRomDesc[] = { - { "desert demolition starring road runner and wile e. coyote (euro, usa).bin", 0x100000, 0xc287343d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdem) -STD_ROM_FN(md_desrtdem) - -struct BurnDriver BurnDrvmd_desrtdem = { - "md_desrtdem", NULL, NULL, NULL, "1994", - "Desert Demolition (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemRomInfo, md_desrtdemRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Prototype, 19941206) -static struct BurnRomInfo md_desrtdemp9RomDesc[] = { - { "desert demolition (prototype - dec 06, 1994).bin", 0x0ed0ad, 0xd27fe9e5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdemp9) -STD_ROM_FN(md_desrtdemp9) - -struct BurnDriver BurnDrvmd_desrtdemp9 = { - "md_desrtdemp9", "md_desrtdem", NULL, NULL, "1994", - "Desert Demolition (Prototype, 19941206)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemp9RomInfo, md_desrtdemp9RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Prototype, 19941208) -static struct BurnRomInfo md_desrtdemp8RomDesc[] = { - { "desert demolition (prototype - dec 08, 1994).bin", 0x0fdfb8, 0x69aaeab6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdemp8) -STD_ROM_FN(md_desrtdemp8) - -struct BurnDriver BurnDrvmd_desrtdemp8 = { - "md_desrtdemp8", "md_desrtdem", NULL, NULL, "1994", - "Desert Demolition (Prototype, 19941208)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemp8RomInfo, md_desrtdemp8RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Prototype, 19941212-B) -static struct BurnRomInfo md_desrtdemp7RomDesc[] = { - { "desert demolition (prototype - dec 12, 1994 - b).bin", 0x100000, 0x16f19283, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdemp7) -STD_ROM_FN(md_desrtdemp7) - -struct BurnDriver BurnDrvmd_desrtdemp7 = { - "md_desrtdemp7", "md_desrtdem", NULL, NULL, "1994", - "Desert Demolition (Prototype, 19941212-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemp7RomInfo, md_desrtdemp7RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Prototype, 19941212) -static struct BurnRomInfo md_desrtdemp6RomDesc[] = { - { "desert demolition (prototype - dec 12, 1994).bin", 0x0ec988, 0x5dad49d7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdemp6) -STD_ROM_FN(md_desrtdemp6) - -struct BurnDriver BurnDrvmd_desrtdemp6 = { - "md_desrtdemp6", "md_desrtdem", NULL, NULL, "1994", - "Desert Demolition (Prototype, 19941212)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemp6RomInfo, md_desrtdemp6RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Prototype, 19941213) -static struct BurnRomInfo md_desrtdemp5RomDesc[] = { - { "desert demolition (prototype - dec 13, 1994).bin", 0x0fde9c, 0x375dee15, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdemp5) -STD_ROM_FN(md_desrtdemp5) - -struct BurnDriver BurnDrvmd_desrtdemp5 = { - "md_desrtdemp5", "md_desrtdem", NULL, NULL, "1994", - "Desert Demolition (Prototype, 19941213)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemp5RomInfo, md_desrtdemp5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Prototype, 19941214) -static struct BurnRomInfo md_desrtdemp4RomDesc[] = { - { "desert demolition (prototype - dec 14, 1994).bin", 0x0fde9c, 0x39f9f304, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdemp4) -STD_ROM_FN(md_desrtdemp4) - -struct BurnDriver BurnDrvmd_desrtdemp4 = { - "md_desrtdemp4", "md_desrtdem", NULL, NULL, "1994", - "Desert Demolition (Prototype, 19941214)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemp4RomInfo, md_desrtdemp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Prototype, 19941215) -static struct BurnRomInfo md_desrtdemp3RomDesc[] = { - { "desert demolition (prototype - dec 15, 1994).bin", 0x0fde9c, 0x5109736a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdemp3) -STD_ROM_FN(md_desrtdemp3) - -struct BurnDriver BurnDrvmd_desrtdemp3 = { - "md_desrtdemp3", "md_desrtdem", NULL, NULL, "1994", - "Desert Demolition (Prototype, 19941215)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemp3RomInfo, md_desrtdemp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Prototype, 19941216) -static struct BurnRomInfo md_desrtdemp2RomDesc[] = { - { "desert demolition (prototype - dec 16, 1994).bin", 0x100000, 0x573fabfb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdemp2) -STD_ROM_FN(md_desrtdemp2) - -struct BurnDriver BurnDrvmd_desrtdemp2 = { - "md_desrtdemp2", "md_desrtdem", NULL, NULL, "1994", - "Desert Demolition (Prototype, 19941216)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemp2RomInfo, md_desrtdemp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Demolition (Prototype, 19941219) -static struct BurnRomInfo md_desrtdemp1RomDesc[] = { - { "desert demolition (prototype - dec 19, 1994).bin", 0x0fde9c, 0xb0ece758, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_desrtdemp1) -STD_ROM_FN(md_desrtdemp1) - -struct BurnDriver BurnDrvmd_desrtdemp1 = { - "md_desrtdemp1", "md_desrtdem", NULL, NULL, "1994", - "Desert Demolition (Prototype, 19941219)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_desrtdemp1RomInfo, md_desrtdemp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Strike (Euro, USA) -static struct BurnRomInfo md_dstrikeRomDesc[] = { - { "desert strike (euro, usa).bin", 0x100000, 0x67a9860b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dstrike) -STD_ROM_FN(md_dstrike) - -struct BurnDriver BurnDrvmd_dstrike = { - "md_dstrike", NULL, NULL, NULL, "1992", - "Desert Strike (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dstrikeRomInfo, md_dstrikeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Desert Strike (Jpn, Kor) -static struct BurnRomInfo md_dstrikejRomDesc[] = { - { "desert strike (jpn, kor).bin", 0x100000, 0x1e740145, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dstrikej) -STD_ROM_FN(md_dstrikej) - -struct BurnDriver BurnDrvmd_dstrikej = { - "md_dstrikej", "md_dstrike", NULL, NULL, "1993", - "Desert Strike (Jpn, Kor)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dstrikejRomInfo, md_dstrikejRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Devilish - The Next Possession (USA) -static struct BurnRomInfo md_devilishRomDesc[] = { - { "devilish - the next possession (usa).bin", 0x080000, 0xd3f300ac, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_devilish) -STD_ROM_FN(md_devilish) - -struct BurnDriver BurnDrvmd_devilish = { - "md_devilish", NULL, NULL, NULL, "1992", - "Devilish - The Next Possession (USA)\0", NULL, "Sage's Creation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_devilishRomInfo, md_devilishRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bad Omen (Jpn, Kor) -static struct BurnRomInfo md_badomenRomDesc[] = { - { "bad omen (jpn, kor).bin", 0x080000, 0x975693ce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_badomen) -STD_ROM_FN(md_badomen) - -struct BurnDriver BurnDrvmd_badomen = { - "md_badomen", "md_devilish", NULL, NULL, "1992", - "Bad Omen (Jpn, Kor)\0", NULL, "Hot-B", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_badomenRomInfo, md_badomenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dial Q o Mawase! (Jpn) -static struct BurnRomInfo md_dialqoRomDesc[] = { - { "dial q o mawase! (jpn) (unl).bin", 0x100000, 0xc632e5af, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dialqo) -STD_ROM_FN(md_dialqo) - -struct BurnDriver BurnDrvmd_dialqo = { - "md_dialqo", NULL, NULL, NULL, "199?", - "Dial Q o Mawase! (Jpn)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dialqoRomInfo, md_dialqoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dick Tracy (World) -static struct BurnRomInfo md_dicktrRomDesc[] = { - { "mpr-13661.bin", 0x080000, 0xef887533, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dicktr) -STD_ROM_FN(md_dicktr) - -struct BurnDriver BurnDrvmd_dicktr = { - "md_dicktr", NULL, NULL, NULL, "1991", - "Dick Tracy (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dicktrRomInfo, md_dicktrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dick Vitale's 'Awesome, Baby!' College Hoops (USA) -static struct BurnRomInfo md_dickvitlRomDesc[] = { - { "dick vitale's 'awesome, baby!' college hoops (usa).bin", 0x200000, 0x1312cf22, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dickvitl) -STD_ROM_FN(md_dickvitl) - -struct BurnDriver BurnDrvmd_dickvitl = { - "md_dickvitl", NULL, NULL, NULL, "1994", - "Dick Vitale's 'Awesome, Baby!' College Hoops (USA)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dickvitlRomInfo, md_dickvitlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dino Dini's Soccer (Euro) -static struct BurnRomInfo md_dinodiniRomDesc[] = { - { "dino dini's soccer (euro).bin", 0x100000, 0x4608f53a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dinodini) -STD_ROM_FN(md_dinodini) - -struct BurnDriverD BurnDrvmd_dinodini = { - "md_dinodini", NULL, NULL, NULL, "1994", - "Dino Dini's Soccer (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_dinodiniRomInfo, md_dinodiniRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dino Land (USA) -static struct BurnRomInfo md_dinolandRomDesc[] = { - { "dino land (usa).bin", 0x080000, 0x5fe351b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dinoland) -STD_ROM_FN(md_dinoland) - -struct BurnDriver BurnDrvmd_dinoland = { - "md_dinoland", NULL, NULL, NULL, "1991", - "Dino Land (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dinolandRomInfo, md_dinolandRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chou Touryuu Retsuden - Dino Land (Jpn) -static struct BurnRomInfo md_dinolandjRomDesc[] = { - { "chou touryuu retsuden - dino land (jpn).bin", 0x080000, 0x81f939de, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dinolandj) -STD_ROM_FN(md_dinolandj) - -struct BurnDriver BurnDrvmd_dinolandj = { - "md_dinolandj", "md_dinoland", NULL, NULL, "1991", - "Chou Touryuu Retsuden - Dino Land (Jpn)\0", NULL, "Wolf Team", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dinolandjRomInfo, md_dinolandjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// A Dinosaur's Tale (USA) -static struct BurnRomInfo md_dinotaleRomDesc[] = { - { "dinosaur's tale, a (usa).bin", 0x100000, 0x70155b5b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dinotale) -STD_ROM_FN(md_dinotale) - -struct BurnDriver BurnDrvmd_dinotale = { - "md_dinotale", NULL, NULL, NULL, "1993", - "A Dinosaur's Tale (USA)\0", NULL, "Hi-Tech Expression", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dinotaleRomInfo, md_dinotaleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tom Mason's Dinosaurs for Hire (USA) -static struct BurnRomInfo md_dinohireRomDesc[] = { - { "dinosaurs for hire (usa).bin", 0x100000, 0x39351146, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dinohire) -STD_ROM_FN(md_dinohire) - -struct BurnDriver BurnDrvmd_dinohire = { - "md_dinohire", NULL, NULL, NULL, "1993", - "Tom Mason's Dinosaurs for Hire (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dinohireRomInfo, md_dinohireRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tom Mason's Dinosaurs for Hire (Prototype, 19930426) -static struct BurnRomInfo md_dinohirep3RomDesc[] = { - { "dinosaurs for hire (prototype - apr 26, 1993).bin", 0x100000, 0x54c77d3e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dinohirep3) -STD_ROM_FN(md_dinohirep3) - -struct BurnDriver BurnDrvmd_dinohirep3 = { - "md_dinohirep3", "md_dinohire", NULL, NULL, "1993", - "Tom Mason's Dinosaurs for Hire (Prototype, 19930426)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dinohirep3RomInfo, md_dinohirep3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tom Mason's Dinosaurs for Hire (Prototype, 19930427) -static struct BurnRomInfo md_dinohirep2RomDesc[] = { - { "dinosaurs for hire (prototype - apr 27, 1993).bin", 0x100000, 0x16000453, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dinohirep2) -STD_ROM_FN(md_dinohirep2) - -struct BurnDriver BurnDrvmd_dinohirep2 = { - "md_dinohirep2", "md_dinohire", NULL, NULL, "1993", - "Tom Mason's Dinosaurs for Hire (Prototype, 19930427)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dinohirep2RomInfo, md_dinohirep2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tom Mason's Dinosaurs for Hire (Prototype, 19930502) -static struct BurnRomInfo md_dinohirep1RomDesc[] = { - { "dinosaurs for hire (prototype - may 02, 1993).bin", 0x100000, 0x8954dee9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dinohirep1) -STD_ROM_FN(md_dinohirep1) - -struct BurnDriver BurnDrvmd_dinohirep1 = { - "md_dinohirep1", "md_dinohire", NULL, NULL, "1993", - "Tom Mason's Dinosaurs for Hire (Prototype, 19930502)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dinohirep1RomInfo, md_dinohirep1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Disney Collection - Mickey and Donald (Euro) -static struct BurnRomInfo md_disneyclRomDesc[] = { - { "disney collection, the (euro).bin", 0x100000, 0xadfde883, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_disneycl) -STD_ROM_FN(md_disneycl) - -struct BurnDriver BurnDrvmd_disneycl = { - "md_disneycl", NULL, NULL, NULL, "1996", - "The Disney Collection - Mickey and Donald (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_disneyclRomInfo, md_disneyclRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Divine Sealing (Jpn) -static struct BurnRomInfo md_divineRomDesc[] = { - { "divine sealing (jpn) (unl).bin", 0x100000, 0xca72973c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_divine) -STD_ROM_FN(md_divine) - -struct BurnDriver BurnDrvmd_divine = { - "md_divine", NULL, NULL, NULL, "1991", - "Divine Sealing (Jpn)\0", NULL, "CYX", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_divineRomInfo, md_divineRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// DJ Boy (Euro) -static struct BurnRomInfo md_djboyRomDesc[] = { - { "mpr-14560.bin", 0x080000, 0x860e749a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_djboy) -STD_ROM_FN(md_djboy) - -struct BurnDriver BurnDrvmd_djboy = { - "md_djboy", NULL, NULL, NULL, "1991", - "DJ Boy (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_djboyRomInfo, md_djboyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// DJ Boy (Jpn) -static struct BurnRomInfo md_djboyjRomDesc[] = { - { "dj boy (jpn).bin", 0x080000, 0x202abaa8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_djboyj) -STD_ROM_FN(md_djboyj) - -struct BurnDriver BurnDrvmd_djboyj = { - "md_djboyj", "md_djboy", NULL, NULL, "1990", - "DJ Boy (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_djboyjRomInfo, md_djboyjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// DJ Boy (USA) -static struct BurnRomInfo md_djboyuRomDesc[] = { - { "dj boy (usa).bin", 0x080000, 0xdc9f02db, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_djboyu) -STD_ROM_FN(md_djboyu) - -struct BurnDriver BurnDrvmd_djboyu = { - "md_djboyu", "md_djboy", NULL, NULL, "1990", - "DJ Boy (USA)\0", NULL, "Kaneko", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_djboyuRomInfo, md_djboyuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ikazuse! Koi no Doki Doki Penguin Land MD (Jpn, SegaNet) -static struct BurnRomInfo md_dokidokiRomDesc[] = { - { "ikazuse! koi no doki doki penguin land md (jpn) (sn).bin", 0x040000, 0x0053bfd6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dokidoki) -STD_ROM_FN(md_dokidoki) - -struct BurnDriver BurnDrvmd_dokidoki = { - "md_dokidoki", NULL, NULL, NULL, "1991", - "Ikazuse! Koi no Doki Doki Penguin Land MD (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dokidokiRomInfo, md_dokidokiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ikazuse! Koi no Doki Doki Penguin Land MD (Jpn, Game no Kandume MegaCD Rip) -static struct BurnRomInfo md_dokidokignkRomDesc[] = { - { "ikazuse! koi no doki doki penguin land md (jpn) (gnk).bin", 0x040000, 0x22736650, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dokidokignk) -STD_ROM_FN(md_dokidokignk) - -struct BurnDriver BurnDrvmd_dokidokignk = { - "md_dokidokignk", "md_dokidoki", NULL, NULL, "1991", - "Ikazuse! Koi no Doki Doki Penguin Land MD (Jpn, Game no Kandume MegaCD Rip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dokidokignkRomInfo, md_dokidokignkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dominus (USA, Prototype) -static struct BurnRomInfo md_dominusRomDesc[] = { - { "dominus (usa) (prototype).bin", 0x0c0000, 0x30006ebd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dominus) -STD_ROM_FN(md_dominus) - -struct BurnDriver BurnDrvmd_dominus = { - "md_dominus", NULL, NULL, NULL, "199?", - "Dominus (USA, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_dominusRomInfo, md_dominusRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Donald in Maui Mallard (Euro) -static struct BurnRomInfo md_mauimallRomDesc[] = { - { "donald in maui mallard (euro).bin", 0x300000, 0xb2dd857f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mauimall) -STD_ROM_FN(md_mauimall) - -struct BurnDriver BurnDrvmd_mauimall = { - "md_mauimall", NULL, NULL, NULL, "1995", - "Donald in Maui Mallard (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mauimallRomInfo, md_mauimallRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Donald in Maui Mallard (Bra) -static struct BurnRomInfo md_mauimallbRomDesc[] = { - { "mpr-19625-u.ic1", 0x300000, 0x5f9b9a48, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mauimallb) -STD_ROM_FN(md_mauimallb) - -struct BurnDriver BurnDrvmd_mauimallb = { - "md_mauimallb", "md_mauimall", NULL, NULL, "1995", - "Donald in Maui Mallard (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mauimallbRomInfo, md_mauimallbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Doom Troopers - The Mutant Chronicles (USA) -static struct BurnRomInfo md_doomtropRomDesc[] = { - { "doom troopers - the mutant chronicles (usa).bin", 0x200000, 0x11194414, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_doomtrop) -STD_ROM_FN(md_doomtrop) - -struct BurnDriver BurnDrvmd_doomtrop = { - "md_doomtrop", NULL, NULL, NULL, "1995", - "Doom Troopers - The Mutant Chronicles (USA)\0", NULL, "Playmates Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_doomtropRomInfo, md_doomtropRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Doraemon - Yume Dorobou to 7-nin no Gozans (Jpn) -static struct BurnRomInfo md_doraemonRomDesc[] = { - { "doraemon - yume dorobou to 7-nin no gozans (jpn).bin", 0x080000, 0xeeed1130, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_doraemon) -STD_ROM_FN(md_doraemon) - -struct BurnDriver BurnDrvmd_doraemon = { - "md_doraemon", NULL, NULL, NULL, "1993", - "Doraemon - Yume Dorobou to 7-nin no Gozans (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_doraemonRomInfo, md_doraemonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Double Clutch (Euro) -static struct BurnRomInfo md_doubleclRomDesc[] = { - { "double clutch (euro).bin", 0x040000, 0xd98c623c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_doublecl) -STD_ROM_FN(md_doublecl) - -struct BurnDriver BurnDrvmd_doublecl = { - "md_doublecl", NULL, NULL, NULL, "1992", - "Double Clutch (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_doubleclRomInfo, md_doubleclRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Double Dragon (Euro, USA) -static struct BurnRomInfo md_ddragonRomDesc[] = { - { "double dragon (euro, usa).bin", 0x080000, 0x054f5d53, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ddragon) -STD_ROM_FN(md_ddragon) - -struct BurnDriver BurnDrvmd_ddragon = { - "md_ddragon", NULL, NULL, NULL, "1993", - "Double Dragon (Euro, USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ddragonRomInfo, md_ddragonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Double Dragon II - The Revenge (Jpn) -static struct BurnRomInfo md_ddragon2RomDesc[] = { - { "double dragon ii - the revenge (jpn).bin", 0x080000, 0xa8bfdbd6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ddragon2) -STD_ROM_FN(md_ddragon2) - -struct BurnDriverD BurnDrvmd_ddragon2 = { - "md_ddragon2", NULL, NULL, NULL, "1991", - "Double Dragon II - The Revenge (Jpn)\0", NULL, "Palsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ddragon2RomInfo, md_ddragon2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Double Dragon 3 - The Arcade Game (Euro, USA) -static struct BurnRomInfo md_ddragon3RomDesc[] = { - { "double dragon 3 - the arcade game (euro, usa).bin", 0x100000, 0xb36ab75c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ddragon3) -STD_ROM_FN(md_ddragon3) - -struct BurnDriver BurnDrvmd_ddragon3 = { - "md_ddragon3", NULL, NULL, NULL, "1992", - "Double Dragon 3 - The Arcade Game (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ddragon3RomInfo, md_ddragon3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Double Dragon V - The Shadow Falls (USA) -static struct BurnRomInfo md_ddragon5RomDesc[] = { - { "double dragon v - the shadow falls (usa).bin", 0x300000, 0x27e59e35, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ddragon5) -STD_ROM_FN(md_ddragon5) - -struct BurnDriver BurnDrvmd_ddragon5 = { - "md_ddragon5", NULL, NULL, NULL, "1994", - "Double Dragon V - The Shadow Falls (USA)\0", NULL, "Tradewest", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ddragon5RomInfo, md_ddragon5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dr. Robotnik's Mean Bean Machine (Euro) -static struct BurnRomInfo md_drrobotnRomDesc[] = { - { "dr. robotnik's mean bean machine (euro).bin", 0x100000, 0x70680706, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_drrobotn) -STD_ROM_FN(md_drrobotn) - -struct BurnDriver BurnDrvmd_drrobotn = { - "md_drrobotn", NULL, NULL, NULL, "1993", - "Dr. Robotnik's Mean Bean Machine (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_drrobotnRomInfo, md_drrobotnRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dr. Robotnik's Mean Bean Machine (USA, Prototype) -static struct BurnRomInfo md_drrobotnupRomDesc[] = { - { "dr. robotnik's mean bean machine (usa) (beta).bin", 0x100000, 0x4d0e5273, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_drrobotnup) -STD_ROM_FN(md_drrobotnup) - -struct BurnDriver BurnDrvmd_drrobotnup = { - "md_drrobotnup", "md_drrobotn", NULL, NULL, "1993", - "Dr. Robotnik's Mean Bean Machine (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_drrobotnupRomInfo, md_drrobotnupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dr. Robotnik's Mean Bean Machine (USA) -static struct BurnRomInfo md_drrobotnuRomDesc[] = { - { "dr. robotnik's mean bean machine (usa).bin", 0x100000, 0xc7ca517f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_drrobotnu) -STD_ROM_FN(md_drrobotnu) - -struct BurnDriver BurnDrvmd_drrobotnu = { - "md_drrobotnu", "md_drrobotn", NULL, NULL, "1993", - "Dr. Robotnik's Mean Bean Machine (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_drrobotnuRomInfo, md_drrobotnuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dong Gu Ri Te Chi Jak Jeon (Kor) -static struct BurnRomInfo md_dongguriRomDesc[] = { - { "dong gu ri te chi jak jeon (kor).bin", 0x100000, 0xe32f0b1c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dongguri) -STD_ROM_FN(md_dongguri) - -struct BurnDriver BurnDrvmd_dongguri = { - "md_dongguri", "md_drrobotn", NULL, NULL, "199?", - "Dong Gu Ri Te Chi Jak Jeon (Kor)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dongguriRomInfo, md_dongguriRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon - The Bruce Lee Story (Euro) -static struct BurnRomInfo md_dragonRomDesc[] = { - { "dragon - the bruce lee story (euro).bin", 0x200000, 0xfdeed51d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dragon) -STD_ROM_FN(md_dragon) - -struct BurnDriver BurnDrvmd_dragon = { - "md_dragon", NULL, NULL, NULL, "1993", - "Dragon - The Bruce Lee Story (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dragonRomInfo, md_dragonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon - The Bruce Lee Story (USA) -static struct BurnRomInfo md_dragonuRomDesc[] = { - { "dragon - the bruce lee story (usa).bin", 0x200000, 0xefe850e5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dragonu) -STD_ROM_FN(md_dragonu) - -struct BurnDriver BurnDrvmd_dragonu = { - "md_dragonu", "md_dragon", NULL, NULL, "1994", - "Dragon - The Bruce Lee Story (USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dragonuRomInfo, md_dragonuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon Ball Z - Buyuu Retsuden (Jpn) -static struct BurnRomInfo md_dbzRomDesc[] = { - { "dragon ball z - buyuu retsuden (jpn).bin", 0x200000, 0xaf8f3371, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dbz) -STD_ROM_FN(md_dbz) - -struct BurnDriver BurnDrvmd_dbz = { - "md_dbz", NULL, NULL, NULL, "1994", - "Dragon Ball Z - Buyuu Retsuden (Jpn)\0", NULL, "Bandai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dbzRomInfo, md_dbzRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon Ball Z - L'Appel du Destin (Fra) -static struct BurnRomInfo md_dbzfRomDesc[] = { - { "dragon ball z - l'appel du destin (france).bin", 0x200000, 0xf035c737, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dbzf) -STD_ROM_FN(md_dbzf) - -struct BurnDriver BurnDrvmd_dbzf = { - "md_dbzf", "md_dbz", NULL, NULL, "1994", - "Dragon Ball Z - L'Appel du Destin (Fra)\0", NULL, "Bandai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dbzfRomInfo, md_dbzfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon Slayer - Eiyuu Densetsu (Jpn) -static struct BurnRomInfo md_dslayedRomDesc[] = { - { "dragon slayer - eiyuu densetsu (jpn).bin", 0x200000, 0x01bc1604, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dslayed) -STD_ROM_FN(md_dslayed) - -struct BurnDriverD BurnDrvmd_dslayed = { - "md_dslayed", NULL, NULL, NULL, "1994", - "Dragon Slayer - Eiyuu Densetsu (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_dslayedRomInfo, md_dslayedRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon Slayer - Eiyuu Densetsu II (Jpn) -static struct BurnRomInfo md_dslayed2RomDesc[] = { - { "dragon slayer - eiyuu densetsu ii (jpn).bin", 0x200000, 0x46924dc3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dslayed2) -STD_ROM_FN(md_dslayed2) - -struct BurnDriverD BurnDrvmd_dslayed2 = { - "md_dslayed2", NULL, NULL, NULL, "1995", - "Dragon Slayer - Eiyuu Densetsu II (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_dslayed2RomInfo, md_dslayed2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon's Eye Plus - Shanghai III (Jpn) -static struct BurnRomInfo md_shangh3RomDesc[] = { - { "dragon's eye plus - shanghai iii (jpn).bin", 0x040000, 0x81f0c3cf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shangh3) -STD_ROM_FN(md_shangh3) - -struct BurnDriver BurnDrvmd_shangh3 = { - "md_shangh3", NULL, NULL, NULL, "1991", - "Dragon's Eye Plus - Shanghai III (Jpn)\0", NULL, "Home Data", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shangh3RomInfo, md_shangh3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon's Fury (Euro, USA) -static struct BurnRomInfo md_dfuryRomDesc[] = { - { "dragon's fury (euro, usa).bin", 0x080000, 0x58037bc6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dfury) -STD_ROM_FN(md_dfury) - -struct BurnDriver BurnDrvmd_dfury = { - "md_dfury", NULL, NULL, NULL, "1992", - "Dragon's Fury (Euro, USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dfuryRomInfo, md_dfuryRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon's Lair (USA, Prototype) -static struct BurnRomInfo md_dlairRomDesc[] = { - { "dragon's lair (usa, prototype).bin", 0x080000, 0xa33eb522, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dlair) -STD_ROM_FN(md_dlair) - -struct BurnDriver BurnDrvmd_dlair = { - "md_dlair", NULL, NULL, NULL, "199?", - "Dragon's Lair (USA, Prototype)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dlairRomInfo, md_dlairRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Devil Crash MD (Jpn) -static struct BurnRomInfo md_devlcrshRomDesc[] = { - { "devil crash md (jpn).bin", 0x080000, 0x4c4caad8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_devlcrsh) -STD_ROM_FN(md_devlcrsh) - -struct BurnDriver BurnDrvmd_devlcrsh = { - "md_devlcrsh", "md_dfury", NULL, NULL, "1993", - "Devil Crash MD (Jpn)\0", NULL, "Technosoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_devlcrshRomInfo, md_devlcrshRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon's Revenge (Euro, USA) -static struct BurnRomInfo md_dragnrevRomDesc[] = { - { "dragon's revenge (euro, usa).bin", 0x100000, 0x841edbc0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dragnrev) -STD_ROM_FN(md_dragnrev) - -struct BurnDriver BurnDrvmd_dragnrev = { - "md_dragnrev", NULL, NULL, NULL, "1993", - "Dragon's Revenge (Euro, USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dragnrevRomInfo, md_dragnrevRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dragon's Revenge (Jpn) -static struct BurnRomInfo md_dragnrevjRomDesc[] = { - { "dragon's revenge (japan).bin", 0x100000, 0xd8d2efd7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dragnrevj) -STD_ROM_FN(md_dragnrevj) - -struct BurnDriver BurnDrvmd_dragnrevj = { - "md_dragnrevj", "md_dragnrev", NULL, NULL, "1993", - "Dragon's Revenge (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dragnrevjRomInfo, md_dragnrevjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Duke Nukem 3D (Bra) -static struct BurnRomInfo md_dukenk3dRomDesc[] = { - { "duke nukem 3d (bra).bin", 0x400000, 0x6bd2accb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dukenk3d) -STD_ROM_FN(md_dukenk3d) - -struct BurnDriver BurnDrvmd_dukenk3d = { - "md_dukenk3d", NULL, NULL, NULL, "1998", - "Duke Nukem 3D (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_dukenk3dRomInfo, md_dukenk3dRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dune II - Battle for Arrakis (Euro) -static struct BurnRomInfo md_dune2RomDesc[] = { - { "dune ii - battle for arrakis (euro).bin", 0x100000, 0xb58ae71d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dune2) -STD_ROM_FN(md_dune2) - -struct BurnDriver BurnDrvmd_dune2 = { - "md_dune2", NULL, NULL, NULL, "1993", - "Dune II - Battle for Arrakis (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dune2RomInfo, md_dune2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dune II - Kampf um den Wustenplaneten (Ger) -static struct BurnRomInfo md_dune2gRomDesc[] = { - { "dune ii - kampf um den wustenplaneten (germany).bin", 0x100000, 0x39790728, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dune2g) -STD_ROM_FN(md_dune2g) - -struct BurnDriver BurnDrvmd_dune2g = { - "md_dune2g", "md_dune2", NULL, NULL, "1993", - "Dune II - Kampf um den Wustenplaneten (Ger)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dune2gRomInfo, md_dune2gRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dune - The Battle for Arrakis (USA) -static struct BurnRomInfo md_duneuRomDesc[] = { - { "dune - the battle for arrakis (usa).bin", 0x100000, 0x4dea40ba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_duneu) -STD_ROM_FN(md_duneu) - -struct BurnDriver BurnDrvmd_duneu = { - "md_duneu", "md_dune2", NULL, NULL, "1993", - "Dune - The Battle for Arrakis (USA)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_duneuRomInfo, md_duneuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dungeons & Dragons - Warriors of the Eternal Sun (Euro, USA) -static struct BurnRomInfo md_ddwaresRomDesc[] = { - { "dungeons & dragons - warriors of the eternal sun (euro, usa).bin", 0x100000, 0xaf4a9cd7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ddwares) -STD_ROM_FN(md_ddwares) - -struct BurnDriver BurnDrvmd_ddwares = { - "md_ddwares", NULL, NULL, NULL, "1992", - "Dungeons & Dragons - Warriors of the Eternal Sun (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ddwaresRomInfo, md_ddwaresRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dyna Brothers (Jpn) -static struct BurnRomInfo md_dynabrRomDesc[] = { - { "dyna brothers (jpn).bin", 0x100000, 0x360c1b20, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dynabr) -STD_ROM_FN(md_dynabr) - -struct BurnDriver BurnDrvmd_dynabr = { - "md_dynabr", NULL, NULL, NULL, "1992", - "Dyna Brothers (Jpn)\0", NULL, "CRI", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dynabrRomInfo, md_dynabrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dyna Brothers 2 (Jpn) -static struct BurnRomInfo md_dynabr2RomDesc[] = { - { "dyna brothers 2 (jpn).bin", 0x200000, 0x47e0a64e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dynabr2) -STD_ROM_FN(md_dynabr2) - -struct BurnDriver BurnDrvmd_dynabr2 = { - "md_dynabr2", NULL, NULL, NULL, "1993", - "Dyna Brothers 2 (Jpn)\0", NULL, "CRI", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dynabr2RomInfo, md_dynabr2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dyna Brothers 2 - Sega Channel Special (Jpn, Sega Channel) -static struct BurnRomInfo md_dynabr2spRomDesc[] = { - { "dyna brothers 2 - sega channel special (jpn).bin", 0x280000, 0xba3554bc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dynabr2sp) -STD_ROM_FN(md_dynabr2sp) - -struct BurnDriver BurnDrvmd_dynabr2sp = { - "md_dynabr2sp", "md_dynabr2", NULL, NULL, "1991", - "Dyna Brothers 2 - Sega Channel Special (Jpn, Sega Channel)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_dynabr2spRomInfo, md_dynabr2spRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dynamite Duke (World, Rev. A) -static struct BurnRomInfo md_dyndukeRomDesc[] = { - { "mpr-13438a.bin", 0x080000, 0x246f0bda, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dynduke) -STD_ROM_FN(md_dynduke) - -struct BurnDriver BurnDrvmd_dynduke = { - "md_dynduke", NULL, NULL, NULL, "1990", - "Dynamite Duke (World, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dyndukeRomInfo, md_dyndukeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dynamite Duke (World) -static struct BurnRomInfo md_dynduke1RomDesc[] = { - { "mpr-13438.bin", 0x080000, 0x39d01c8c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dynduke1) -STD_ROM_FN(md_dynduke1) - -struct BurnDriver BurnDrvmd_dynduke1 = { - "md_dynduke1", "md_dynduke", NULL, NULL, "1990", - "Dynamite Duke (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dynduke1RomInfo, md_dynduke1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dynamite Headdy (Euro, USA) -static struct BurnRomInfo md_dheadRomDesc[] = { - { "mpr-16990.bin", 0x200000, 0x3dfeeb77, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dhead) -STD_ROM_FN(md_dhead) - -struct BurnDriver BurnDrvmd_dhead = { - "md_dhead", NULL, NULL, NULL, "1994", - "Dynamite Headdy (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dheadRomInfo, md_dheadRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dynamite Headdy (Jpn) -static struct BurnRomInfo md_dheadjRomDesc[] = { - { "dynamite headdy (jpn).bin", 0x200000, 0xd03cdb53, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dheadj) -STD_ROM_FN(md_dheadj) - -struct BurnDriver BurnDrvmd_dheadj = { - "md_dheadj", "md_dhead", NULL, NULL, "1994", - "Dynamite Headdy (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dheadjRomInfo, md_dheadjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dynamite Headdy (Jpn, Prototype) -static struct BurnRomInfo md_dheadjpRomDesc[] = { - { "dynamite headdy (jpn) (beta).bin", 0x200000, 0x5c25e934, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dheadjp) -STD_ROM_FN(md_dheadjp) - -struct BurnDriver BurnDrvmd_dheadjp = { - "md_dheadjp", "md_dhead", NULL, NULL, "1994", - "Dynamite Headdy (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dheadjpRomInfo, md_dheadjpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dynamite Headdy (Prototype, 19940614-CABEZA) -static struct BurnRomInfo md_dheadp3RomDesc[] = { - { "dynamite headdy (prototype - jun 14, 1994 - cabeza).bin", 0x200000, 0x971ef24c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dheadp3) -STD_ROM_FN(md_dheadp3) - -struct BurnDriver BurnDrvmd_dheadp3 = { - "md_dheadp3", "md_dhead", NULL, NULL, "1994", - "Dynamite Headdy (Prototype, 19940614-CABEZA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dheadp3RomInfo, md_dheadp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dynamite Headdy (Prototype, 19940616) -static struct BurnRomInfo md_dheadp2RomDesc[] = { - { "dynamite headdy (prototype - jun 16, 1994).bin", 0x200000, 0xf8a96719, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dheadp2) -STD_ROM_FN(md_dheadp2) - -struct BurnDriver BurnDrvmd_dheadp2 = { - "md_dheadp2", "md_dhead", NULL, NULL, "1994", - "Dynamite Headdy (Prototype, 19940616)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dheadp2RomInfo, md_dheadp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dynamite Headdy (Prototype, 19940622) -static struct BurnRomInfo md_dheadp1RomDesc[] = { - { "dynamite headdy (prototype - jun 22, 1994).bin", 0x200000, 0x61001ec8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dheadp1) -STD_ROM_FN(md_dheadp1) - -struct BurnDriver BurnDrvmd_dheadp1 = { - "md_dheadp1", "md_dhead", NULL, NULL, "1994", - "Dynamite Headdy (Prototype, 19940622)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dheadp1RomInfo, md_dheadp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// EA Hockey (Euro) -static struct BurnRomInfo md_eahockeyRomDesc[] = { - { "ea hockey (euro).bin", 0x080000, 0x9bfc279c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eahockey) -STD_ROM_FN(md_eahockey) - -struct BurnDriver BurnDrvmd_eahockey = { - "md_eahockey", NULL, NULL, NULL, "1991", - "EA Hockey (Euro)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eahockeyRomInfo, md_eahockeyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// EA Hockey (Jpn) -static struct BurnRomInfo md_eahockeyjRomDesc[] = { - { "ea hockey (jpn).bin", 0x080000, 0x9dcdc894, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eahockeyj) -STD_ROM_FN(md_eahockeyj) - -struct BurnDriver BurnDrvmd_eahockeyj = { - "md_eahockeyj", "md_eahockey", NULL, NULL, "1992", - "EA Hockey (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eahockeyjRomInfo, md_eahockeyjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL Hockey (USA) -static struct BurnRomInfo md_nhlRomDesc[] = { - { "nhl hockey (usa).bin", 0x080000, 0x2641653f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhl) -STD_ROM_FN(md_nhl) - -struct BurnDriver BurnDrvmd_nhl = { - "md_nhl", NULL, NULL, NULL, "1991", - "NHL Hockey (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlRomInfo, md_nhlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// EA Sports Double Header (Euro) -static struct BurnRomInfo md_easportsRomDesc[] = { - { "ea304.bin", 0x100000, 0xa0b54cbc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_easports) -STD_ROM_FN(md_easports) - -struct BurnDriver BurnDrvmd_easports = { - "md_easports", NULL, NULL, NULL, "1993", - "EA Sports Double Header (Euro)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_easportsRomInfo, md_easportsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Earnest Evans (USA) -static struct BurnRomInfo md_earnestRomDesc[] = { - { "earnest evans (usa).bin", 0x100000, 0xa243816d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_earnest) -STD_ROM_FN(md_earnest) - -struct BurnDriver BurnDrvmd_earnest = { - "md_earnest", NULL, NULL, NULL, "1992", - "Earnest Evans (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_earnestRomInfo, md_earnestRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Earthworm Jim (Euro) -static struct BurnRomInfo md_ejimRomDesc[] = { - { "earthworm jim (euro).bin", 0x300000, 0x1c07b337, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ejim) -STD_ROM_FN(md_ejim) - -struct BurnDriver BurnDrvmd_ejim = { - "md_ejim", NULL, NULL, NULL, "1994", - "Earthworm Jim (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ejimRomInfo, md_ejimRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Earthworm Jim (USA) -static struct BurnRomInfo md_ejimuRomDesc[] = { - { "earthworm jim (usa).bin", 0x300000, 0xdf3acf59, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ejimu) -STD_ROM_FN(md_ejimu) - -struct BurnDriver BurnDrvmd_ejimu = { - "md_ejimu", "md_ejim", NULL, NULL, "1994", - "Earthworm Jim (USA)\0", NULL, "Playmates Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ejimuRomInfo, md_ejimuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Earthworm Jim 2 (Euro) -static struct BurnRomInfo md_ejim2RomDesc[] = { - { "earthworm jim 2 (euro).bin", 0x300000, 0xaf235fdf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ejim2) -STD_ROM_FN(md_ejim2) - -struct BurnDriver BurnDrvmd_ejim2 = { - "md_ejim2", NULL, NULL, NULL, "1995", - "Earthworm Jim 2 (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ejim2RomInfo, md_ejim2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Earthworm Jim 2 (USA) -static struct BurnRomInfo md_ejim2uRomDesc[] = { - { "earthworm jim 2 (usa).bin", 0x300000, 0xd57f8ba7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ejim2u) -STD_ROM_FN(md_ejim2u) - -struct BurnDriver BurnDrvmd_ejim2u = { - "md_ejim2u", "md_ejim2", NULL, NULL, "1996", - "Earthworm Jim 2 (USA)\0", NULL, "Playmates Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ejim2uRomInfo, md_ejim2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco the Dolphin (Euro, USA, Kor) -static struct BurnRomInfo md_eccoRomDesc[] = { - { "mpr-15265.bin", 0x100000, 0x45547390, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ecco) -STD_ROM_FN(md_ecco) - -struct BurnDriver BurnDrvmd_ecco = { - "md_ecco", NULL, NULL, NULL, "1993", - "Ecco the Dolphin (Euro, USA, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eccoRomInfo, md_eccoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco the Dolphin (Jpn) -static struct BurnRomInfo md_eccojRomDesc[] = { - { "mpr-15702.bin", 0x100000, 0x6520304d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eccoj) -STD_ROM_FN(md_eccoj) - -struct BurnDriver BurnDrvmd_eccoj = { - "md_eccoj", "md_ecco", NULL, NULL, "1993", - "Ecco the Dolphin (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eccojRomInfo, md_eccojRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco - The Tides of Time (Euro) -static struct BurnRomInfo md_ecco2RomDesc[] = { - { "ecco - the tides of time (euro).bin", 0x200000, 0x7b1bf89c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ecco2) -STD_ROM_FN(md_ecco2) - -struct BurnDriver BurnDrvmd_ecco2 = { - "md_ecco2", NULL, NULL, NULL, "1994", - "Ecco - The Tides of Time (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ecco2RomInfo, md_ecco2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco - The Tides of Time (USA, Prototype) -static struct BurnRomInfo md_ecco2pRomDesc[] = { - { "ecco - the tides of time (beta).bin", 0x200000, 0x8db60749, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ecco2p) -STD_ROM_FN(md_ecco2p) - -struct BurnDriver BurnDrvmd_ecco2p = { - "md_ecco2p", "md_ecco2", NULL, NULL, "1994", - "Ecco - The Tides of Time (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ecco2pRomInfo, md_ecco2pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco - The Tides of Time (USA, Prototype, Alt) -static struct BurnRomInfo md_ecco2p1RomDesc[] = { - { "ecco - the tides of time (beta, alt).bin", 0x200000, 0x1d1470ea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ecco2p1) -STD_ROM_FN(md_ecco2p1) - -struct BurnDriver BurnDrvmd_ecco2p1 = { - "md_ecco2p1", "md_ecco2", NULL, NULL, "1994", - "Ecco - The Tides of Time (USA, Prototype, Alt)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ecco2p1RomInfo, md_ecco2p1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco - The Tides of Time (USA, Prototype, 19940429) -static struct BurnRomInfo md_ecco2p2RomDesc[] = { - { "ecco ii - the tides of time (prototype - apr 29, 1994).bin", 0x200000, 0x5af83ecb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ecco2p2) -STD_ROM_FN(md_ecco2p2) - -struct BurnDriver BurnDrvmd_ecco2p2 = { - "md_ecco2p2", "md_ecco2", NULL, NULL, "1994", - "Ecco - The Tides of Time (USA, Prototype, 19940429)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ecco2p2RomInfo, md_ecco2p2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco the Dolphin II (Jpn) -static struct BurnRomInfo md_ecco2jRomDesc[] = { - { "mpr-16996.bin", 0x200000, 0x062d439c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ecco2j) -STD_ROM_FN(md_ecco2j) - -struct BurnDriver BurnDrvmd_ecco2j = { - "md_ecco2j", "md_ecco2", NULL, NULL, "1994", - "Ecco the Dolphin II (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ecco2jRomInfo, md_ecco2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco - The Tides of Time (USA, Prototype X11, 19940413) -static struct BurnRomInfo md_ecco2px11RomDesc[] = { - { "ecco - the tides of time (prototype x11 - apr 13, 1994).bin", 0x200000, 0xb5d64817, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ecco2px11) -STD_ROM_FN(md_ecco2px11) - -struct BurnDriver BurnDrvmd_ecco2px11 = { - "md_ecco2px11", "md_ecco2", NULL, NULL, "1994", - "Ecco - The Tides of Time (USA, Prototype X11, 19940413)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ecco2px11RomInfo, md_ecco2px11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco - The Tides of Time (USA) -static struct BurnRomInfo md_ecco2uRomDesc[] = { - { "ecco - the tides of time (usa).bin", 0x200000, 0xccb21f98, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ecco2u) -STD_ROM_FN(md_ecco2u) - -struct BurnDriver BurnDrvmd_ecco2u = { - "md_ecco2u", "md_ecco2", NULL, NULL, "1994", - "Ecco - The Tides of Time (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ecco2uRomInfo, md_ecco2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco Jr. (USA, Oceania, 199502) -static struct BurnRomInfo md_eccojrRomDesc[] = { - { "ecco jr. (usa, aus) (february 1995).bin", 0x100000, 0x6c6f4b89, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eccojr) -STD_ROM_FN(md_eccojr) - -struct BurnDriver BurnDrvmd_eccojr = { - "md_eccojr", NULL, NULL, NULL, "1995", - "Ecco Jr. (USA, Oceania, 199502)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eccojrRomInfo, md_eccojrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ecco Jr. (USA, Oceania, 199503) -static struct BurnRomInfo md_eccojr1RomDesc[] = { - { "ecco jr. (usa, aus) (march 1995).bin", 0x100000, 0x3c517975, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eccojr1) -STD_ROM_FN(md_eccojr1) - -struct BurnDriver BurnDrvmd_eccojr1 = { - "md_eccojr1", "md_eccojr", NULL, NULL, "1995", - "Ecco Jr. (USA, Oceania, 199503)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eccojr1RomInfo, md_eccojr1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// El Viento (USA) -static struct BurnRomInfo md_elvientoRomDesc[] = { - { "mpr-14336.bin", 0x100000, 0x070a1ceb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_elviento) -STD_ROM_FN(md_elviento) - -struct BurnDriver BurnDrvmd_elviento = { - "md_elviento", NULL, NULL, NULL, "1991", - "El Viento (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_elvientoRomInfo, md_elvientoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// El Viento (Jpn) -static struct BurnRomInfo md_elvientojRomDesc[] = { - { "el viento (jpn).bin", 0x100000, 0x6091c36e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_elvientoj) -STD_ROM_FN(md_elvientoj) - -struct BurnDriver BurnDrvmd_elvientoj = { - "md_elvientoj", "md_elviento", NULL, NULL, "1991", - "El Viento (Jpn)\0", NULL, "Wolf Team", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_elvientojRomInfo, md_elvientojRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Elemental Master (USA) -static struct BurnRomInfo md_elemastRomDesc[] = { - { "elemental master (usa).bin", 0x080000, 0x390918c6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_elemast) -STD_ROM_FN(md_elemast) - -struct BurnDriver BurnDrvmd_elemast = { - "md_elemast", NULL, NULL, NULL, "1993", - "Elemental Master (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_elemastRomInfo, md_elemastRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Elemental Master (Jpn) -static struct BurnRomInfo md_elemastjRomDesc[] = { - { "elemental master (jpn).bin", 0x080000, 0x5f553e29, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_elemastj) -STD_ROM_FN(md_elemastj) - -struct BurnDriver BurnDrvmd_elemastj = { - "md_elemastj", "md_elemast", NULL, NULL, "1990", - "Elemental Master (Jpn)\0", NULL, "Technosoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_elemastjRomInfo, md_elemastjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Eliminate Down (Jpn) -static struct BurnRomInfo md_elimdownRomDesc[] = { - { "eliminate down (jpn).bin", 0x100000, 0x48467542, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_elimdown) -STD_ROM_FN(md_elimdown) - -struct BurnDriver BurnDrvmd_elimdown = { - "md_elimdown", NULL, NULL, NULL, "1993", - "Eliminate Down (Jpn)\0", NULL, "Soft Vision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_elimdownRomInfo, md_elimdownRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Elitserien 95 (Swe) -static struct BurnRomInfo md_elit95RomDesc[] = { - { "swed9584.bin", 0x200000, 0xe10a25c0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_elit95) -STD_ROM_FN(md_elit95) - -struct BurnDriver BurnDrvmd_elit95 = { - "md_elit95", NULL, NULL, NULL, "1994", - "Elitserien 95 (Swe)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_elit95RomInfo, md_elit95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Elitserien 96 (Swe) -static struct BurnRomInfo md_elit96RomDesc[] = { - { "elitserien 96 (sweden).bin", 0x200000, 0x9821d0a3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_elit96) -STD_ROM_FN(md_elit96) - -struct BurnDriver BurnDrvmd_elit96 = { - "md_elit96", NULL, NULL, NULL, "1995", - "Elitserien 96 (Swe)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_elit96RomInfo, md_elit96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Empire of Steel (Euro) -static struct BurnRomInfo md_empsteelRomDesc[] = { - { "empire of steel (euro).bin", 0x100000, 0xe5517b77, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_empsteel) -STD_ROM_FN(md_empsteel) - -struct BurnDriver BurnDrvmd_empsteel = { - "md_empsteel", NULL, NULL, NULL, "1992", - "Empire of Steel (Euro)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_empsteelRomInfo, md_empsteelRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Steel Empire (USA) -static struct BurnRomInfo md_steelempRomDesc[] = { - { "steel empire (usa).bin", 0x100000, 0xd0e7a0b6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_steelemp) -STD_ROM_FN(md_steelemp) - -struct BurnDriver BurnDrvmd_steelemp = { - "md_steelemp", "md_empsteel", NULL, NULL, "1992", - "Steel Empire (USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_steelempRomInfo, md_steelempRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Koutetsu Teikoku (Jpn) -static struct BurnRomInfo md_koteteikRomDesc[] = { - { "koutetsu teikoku (jpn).bin", 0x100000, 0x755d0b8a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_koteteik) -STD_ROM_FN(md_koteteik) - -struct BurnDriver BurnDrvmd_koteteik = { - "md_koteteik", "md_empsteel", NULL, NULL, "1992", - "Koutetsu Teikoku (Jpn)\0", NULL, "Hot-B", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_koteteikRomInfo, md_koteteikRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Euro) -static struct BurnRomInfo md_tazmarsRomDesc[] = { - { "taz in escape from mars (euro).bin", 0x200000, 0x62100099, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmars) -STD_ROM_FN(md_tazmars) - -struct BurnDriver BurnDrvmd_tazmars = { - "md_tazmars", NULL, NULL, NULL, "1994", - "Escape from Mars Starring Taz (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsRomInfo, md_tazmarsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940418) -static struct BurnRomInfo md_tazmarsp10RomDesc[] = { - { "taz in escape from mars (prototype - apr 18, 1994).bin", 0x200000, 0xbfa776ec, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp10) -STD_ROM_FN(md_tazmarsp10) - -struct BurnDriver BurnDrvmd_tazmarsp10 = { - "md_tazmarsp10", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940418)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp10RomInfo, md_tazmarsp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940602) -static struct BurnRomInfo md_tazmarsp06RomDesc[] = { - { "taz in escape from mars (prototype - jun 02, 1994).bin", 0x200000, 0x39f345c2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp06) -STD_ROM_FN(md_tazmarsp06) - -struct BurnDriver BurnDrvmd_tazmarsp06 = { - "md_tazmarsp06", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940602)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp06RomInfo, md_tazmarsp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940607) -static struct BurnRomInfo md_tazmarsp05RomDesc[] = { - { "taz in escape from mars (prototype - jun 07, 1994).bin", 0x200000, 0x3481e709, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp05) -STD_ROM_FN(md_tazmarsp05) - -struct BurnDriver BurnDrvmd_tazmarsp05 = { - "md_tazmarsp05", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940607)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp05RomInfo, md_tazmarsp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940610) -static struct BurnRomInfo md_tazmarsp04RomDesc[] = { - { "taz in escape from mars (prototype - jun 10, 1994).bin", 0x200000, 0x832f4cb4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp04) -STD_ROM_FN(md_tazmarsp04) - -struct BurnDriver BurnDrvmd_tazmarsp04 = { - "md_tazmarsp04", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940610)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp04RomInfo, md_tazmarsp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940614) -static struct BurnRomInfo md_tazmarsp03RomDesc[] = { - { "taz in escape from mars (prototype - jun 14, 1994).bin", 0x200000, 0x2badb65b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp03) -STD_ROM_FN(md_tazmarsp03) - -struct BurnDriver BurnDrvmd_tazmarsp03 = { - "md_tazmarsp03", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940614)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp03RomInfo, md_tazmarsp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940618-A) -static struct BurnRomInfo md_tazmarsp02RomDesc[] = { - { "taz in escape from mars (prototype - jun 18, 1994 - a).bin", 0x200000, 0x3c4b1e9c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp02) -STD_ROM_FN(md_tazmarsp02) - -struct BurnDriver BurnDrvmd_tazmarsp02 = { - "md_tazmarsp02", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940618-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp02RomInfo, md_tazmarsp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940620) -static struct BurnRomInfo md_tazmarsp01RomDesc[] = { - { "taz in escape from mars (prototype - jun 20, 1994).bin", 0x200000, 0xf00f4203, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp01) -STD_ROM_FN(md_tazmarsp01) - -struct BurnDriver BurnDrvmd_tazmarsp01 = { - "md_tazmarsp01", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940620)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp01RomInfo, md_tazmarsp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940309) -static struct BurnRomInfo md_tazmarsp11RomDesc[] = { - { "taz in escape from mars (prototype - mar 09, 1994).bin", 0x1d9936, 0xe3c2271e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp11) -STD_ROM_FN(md_tazmarsp11) - -struct BurnDriver BurnDrvmd_tazmarsp11 = { - "md_tazmarsp11", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940309)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp11RomInfo, md_tazmarsp11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940509) -static struct BurnRomInfo md_tazmarsp09RomDesc[] = { - { "taz in escape from mars (prototype - may 09, 1994).bin", 0x200000, 0x11727086, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp09) -STD_ROM_FN(md_tazmarsp09) - -struct BurnDriver BurnDrvmd_tazmarsp09 = { - "md_tazmarsp09", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940509)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp09RomInfo, md_tazmarsp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940518) -static struct BurnRomInfo md_tazmarsp08RomDesc[] = { - { "taz in escape from mars (prototype - may 18, 1994).bin", 0x0b9584, 0x6e2666de, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp08) -STD_ROM_FN(md_tazmarsp08) - -struct BurnDriver BurnDrvmd_tazmarsp08 = { - "md_tazmarsp08", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940518)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp08RomInfo, md_tazmarsp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (Prototype, 19940523) -static struct BurnRomInfo md_tazmarsp07RomDesc[] = { - { "taz in escape from mars (prototype - may 23, 1994).bin", 0x200000, 0xea344fd2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsp07) -STD_ROM_FN(md_tazmarsp07) - -struct BurnDriver BurnDrvmd_tazmarsp07 = { - "md_tazmarsp07", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (Prototype, 19940523)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsp07RomInfo, md_tazmarsp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Escape from Mars Starring Taz (USA) -static struct BurnRomInfo md_tazmarsuRomDesc[] = { - { "taz in escape from mars (usa).bin", 0x200000, 0x62009f8c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmarsu) -STD_ROM_FN(md_tazmarsu) - -struct BurnDriver BurnDrvmd_tazmarsu = { - "md_tazmarsu", "md_tazmars", NULL, NULL, "1994", - "Escape from Mars Starring Taz (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmarsuRomInfo, md_tazmarsuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ESPN Baseball Tonight (USA) -static struct BurnRomInfo md_espnbbRomDesc[] = { - { "espn baseball tonight (usa).bin", 0x200000, 0x96d8440c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_espnbb) -STD_ROM_FN(md_espnbb) - -struct BurnDriver BurnDrvmd_espnbb = { - "md_espnbb", NULL, NULL, NULL, "1995", - "ESPN Baseball Tonight (USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_espnbbRomInfo, md_espnbbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ESPN National Hockey Night (USA) -static struct BurnRomInfo md_espnhnRomDesc[] = { - { "espn national hockey night (usa).bin", 0x200000, 0x1d08828c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_espnhn) -STD_ROM_FN(md_espnhn) - -struct BurnDriver BurnDrvmd_espnhn = { - "md_espnhn", NULL, NULL, NULL, "1994", - "ESPN National Hockey Night (USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_espnhnRomInfo, md_espnhnRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ESPN National Hockey Night (USA, Prototype) -static struct BurnRomInfo md_espnhnpRomDesc[] = { - { "espn national hockey night (usa) (beta).bin", 0x200000, 0xa427814a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_espnhnp) -STD_ROM_FN(md_espnhnp) - -struct BurnDriver BurnDrvmd_espnhnp = { - "md_espnhnp", "md_espnhn", NULL, NULL, "1994", - "ESPN National Hockey Night (USA, Prototype)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_espnhnpRomInfo, md_espnhnpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ESPN Speedworld (USA) -static struct BurnRomInfo md_espnspedRomDesc[] = { - { "espn speed world (usa).bin", 0x200000, 0xf50be478, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_espnsped) -STD_ROM_FN(md_espnsped) - -struct BurnDriver BurnDrvmd_espnsped = { - "md_espnsped", NULL, NULL, NULL, "1994", - "ESPN Speedworld (USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_espnspedRomInfo, md_espnspedRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// ESPN Sunday Night NFL (USA) -static struct BurnRomInfo md_espnnflRomDesc[] = { - { "espn sunday night nfl (usa).bin", 0x200000, 0x61e9c309, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_espnnfl) -STD_ROM_FN(md_espnnfl) - -struct BurnDriver BurnDrvmd_espnnfl = { - "md_espnnfl", NULL, NULL, NULL, "1994", - "ESPN Sunday Night NFL (USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_espnnflRomInfo, md_espnnflRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Cyber Police ESWAT (Jpn, Rev. 0) -static struct BurnRomInfo md_eswatjRomDesc[] = { - { "mpr-13192.bin", 0x080000, 0x87b636a2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eswatj) -STD_ROM_FN(md_eswatj) - -struct BurnDriver BurnDrvmd_eswatj = { - "md_eswatj", "md_eswat", NULL, NULL, "1990", - "Cyber Police ESWAT (Jpn, Rev. 0)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eswatjRomInfo, md_eswatjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Eternal Champions (Euro) -static struct BurnRomInfo md_eternalcRomDesc[] = { - { "mpr-16212+mpr-16213.bin", 0x300000, 0xb9512f5e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eternalc) -STD_ROM_FN(md_eternalc) - -struct BurnDriver BurnDrvmd_eternalc = { - "md_eternalc", NULL, NULL, NULL, "1994", - "Eternal Champions (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eternalcRomInfo, md_eternalcRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Eternal Champions (Euro, Prototype) -static struct BurnRomInfo md_eternalcpRomDesc[] = { - { "eternal champions (euro) (beta).bin", 0x300000, 0xe0665f06, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eternalcp) -STD_ROM_FN(md_eternalcp) - -struct BurnDriver BurnDrvmd_eternalcp = { - "md_eternalcp", "md_eternalc", NULL, NULL, "1994", - "Eternal Champions (Euro, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eternalcpRomInfo, md_eternalcpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Eternal Champions (Jpn, Kor) -static struct BurnRomInfo md_eternalcjRomDesc[] = { - { "eternal champions (jpn, kor).bin", 0x300000, 0x66aa3c64, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eternalcj) -STD_ROM_FN(md_eternalcj) - -struct BurnDriver BurnDrvmd_eternalcj = { - "md_eternalcj", "md_eternalc", NULL, NULL, "1994", - "Eternal Champions (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eternalcjRomInfo, md_eternalcjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Eternal Champions (Jpn, Prototype, 19931117) -static struct BurnRomInfo md_eternalcjpRomDesc[] = { - { "eternal champions (jpn) (prototype - nov 17, 1993).bin", 0x2ff4b0, 0xc486b439, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eternalcjp) -STD_ROM_FN(md_eternalcjp) - -struct BurnDriver BurnDrvmd_eternalcjp = { - "md_eternalcjp", "md_eternalc", NULL, NULL, "1994", - "Eternal Champions (Jpn, Prototype, 19931117)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eternalcjpRomInfo, md_eternalcjpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Eternal Champions (USA) -static struct BurnRomInfo md_eternalcuRomDesc[] = { - { "eternal champions (usa).bin", 0x300000, 0x48f1a42e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eternalcu) -STD_ROM_FN(md_eternalcu) - -struct BurnDriver BurnDrvmd_eternalcu = { - "md_eternalcu", "md_eternalc", NULL, NULL, "1994", - "Eternal Champions (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_eternalcuRomInfo, md_eternalcuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// European Club Soccer (Euro) -static struct BurnRomInfo md_euroclubRomDesc[] = { - { "mpr-14776.bin", 0x080000, 0x6a5cf104, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_euroclub) -STD_ROM_FN(md_euroclub) - -struct BurnDriver BurnDrvmd_euroclub = { - "md_euroclub", NULL, NULL, NULL, "1992", - "European Club Soccer (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_euroclubRomInfo, md_euroclubRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Trophy Soccer (USA) -static struct BurnRomInfo md_worldtsRomDesc[] = { - { "world trophy soccer (usa).bin", 0x080000, 0x6e3edc7c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_worldts) -STD_ROM_FN(md_worldts) - -struct BurnDriver BurnDrvmd_worldts = { - "md_worldts", "md_euroclub", NULL, NULL, "1992", - "World Trophy Soccer (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_worldtsRomInfo, md_worldtsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// J. League Champion Soccer (Jpn) -static struct BurnRomInfo md_jlcsRomDesc[] = { - { "j. league champion soccer (jpn).bin", 0x080000, 0x453c405e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jlcs) -STD_ROM_FN(md_jlcs) - -struct BurnDriver BurnDrvmd_jlcs = { - "md_jlcs", "md_euroclub", NULL, NULL, "1993", - "J. League Champion Soccer (Jpn)\0", NULL, "Game Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jlcsRomInfo, md_jlcsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Exile (USA) -static struct BurnRomInfo md_exileRomDesc[] = { - { "exile (usa).bin", 0x100000, 0x1b569dc2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_exile) -STD_ROM_FN(md_exile) - -struct BurnDriver BurnDrvmd_exile = { - "md_exile", NULL, NULL, NULL, "1991", - "Exile (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_exileRomInfo, md_exileRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Exile - Toki no Hazama e (Jpn) -static struct BurnRomInfo md_exilejRomDesc[] = { - { "exile - toki no hazama e (jpn).bin", 0x100000, 0x880bf311, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_exilej) -STD_ROM_FN(md_exilej) - -struct BurnDriver BurnDrvmd_exilej = { - "md_exilej", "md_exile", NULL, NULL, "1991", - "Exile - Toki no Hazama e (Jpn)\0", NULL, "Riot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_exilejRomInfo, md_exilejRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Exo Squad (Euro) -static struct BurnRomInfo md_exosquadRomDesc[] = { - { "exo squad (euro).bin", 0x100000, 0xb599b9f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_exosquad) -STD_ROM_FN(md_exosquad) - -struct BurnDriver BurnDrvmd_exosquad = { - "md_exosquad", NULL, NULL, NULL, "1995", - "Exo Squad (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_exosquadRomInfo, md_exosquadRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Exo Squad (USA) -static struct BurnRomInfo md_exosquaduRomDesc[] = { - { "exo squad (usa).bin", 0x100000, 0x10ec03f3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_exosquadu) -STD_ROM_FN(md_exosquadu) - -struct BurnDriver BurnDrvmd_exosquadu = { - "md_exosquadu", "md_exosquad", NULL, NULL, "1995", - "Exo Squad (USA)\0", NULL, "Playmates Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_exosquaduRomInfo, md_exosquaduRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Exo Squad (USA, Prototype) -static struct BurnRomInfo md_exosquadupRomDesc[] = { - { "exo squad (usa) (beta).bin", 0x100000, 0x70edf964, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_exosquadup) -STD_ROM_FN(md_exosquadup) - -struct BurnDriver BurnDrvmd_exosquadup = { - "md_exosquadup", "md_exosquad", NULL, NULL, "1995", - "Exo Squad (USA, Prototype)\0", NULL, "Playmates Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_exosquadupRomInfo, md_exosquadupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Exodus - Journey to the Promised Land (USA) -static struct BurnRomInfo md_exodusRomDesc[] = { - { "exodus - journey to the promised land (usa) (unl).bin", 0x080000, 0x22e6fc04, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_exodus) -STD_ROM_FN(md_exodus) - -struct BurnDriver BurnDrvmd_exodus = { - "md_exodus", NULL, NULL, NULL, "1993", - "Exodus - Journey to the Promised Land (USA)\0", NULL, "Wisdom Tree", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_exodusRomInfo, md_exodusRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F-117 Night Storm (Euro, USA) -static struct BurnRomInfo md_f117RomDesc[] = { - { "f-117 night storm (euro, usa).bin", 0x200000, 0x1bf67a07, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f117) -STD_ROM_FN(md_f117) - -struct BurnDriver BurnDrvmd_f117 = { - "md_f117", NULL, NULL, NULL, "1993", - "F-117 Night Storm (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f117RomInfo, md_f117RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F-117 Stealth - Operation Night Storm (Jpn) -static struct BurnRomInfo md_f117jRomDesc[] = { - { "f-117 stealth - operation night storm (jpn).bin", 0x200000, 0xea6e421a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f117j) -STD_ROM_FN(md_f117j) - -struct BurnDriver BurnDrvmd_f117j = { - "md_f117j", "md_f117", NULL, NULL, "1994", - "F-117 Stealth - Operation Night Storm (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f117jRomInfo, md_f117jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F-15 Strike Eagle II (Euro) -static struct BurnRomInfo md_f15se2RomDesc[] = { - { "f-15 strike eagle ii (euro).bin", 0x100000, 0xe98ee370, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f15se2) -STD_ROM_FN(md_f15se2) - -struct BurnDriver BurnDrvmd_f15se2 = { - "md_f15se2", NULL, NULL, NULL, "1993", - "F-15 Strike Eagle II (Euro)\0", NULL, "Microprose", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f15se2RomInfo, md_f15se2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F-15 Strike Eagle II (USA) -static struct BurnRomInfo md_f15se2uRomDesc[] = { - { "f-15 strike eagle ii (usa).bin", 0x100000, 0x412c4d60, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f15se2u) -STD_ROM_FN(md_f15se2u) - -struct BurnDriver BurnDrvmd_f15se2u = { - "md_f15se2u", "md_f15se2", NULL, NULL, "1993", - "F-15 Strike Eagle II (USA)\0", NULL, "Microprose", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f15se2uRomInfo, md_f15se2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F-15 Strike Eagle II (USA, Prototype) -static struct BurnRomInfo md_f15se2upRomDesc[] = { - { "f-15 strike eagle ii (usa) (beta).bin", 0x100000, 0xfd4f5a01, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f15se2up) -STD_ROM_FN(md_f15se2up) - -struct BurnDriver BurnDrvmd_f15se2up = { - "md_f15se2up", "md_f15se2", NULL, NULL, "1993", - "F-15 Strike Eagle II (USA, Prototype)\0", NULL, "Microprose", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f15se2upRomInfo, md_f15se2upRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F-22 Interceptor (Euro, USA, 199206) -static struct BurnRomInfo md_f22RomDesc[] = { - { "f-22 interceptor (euro, usa) (june 1992).bin", 0x0c0000, 0xdd19b2b3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f22) -STD_ROM_FN(md_f22) - -struct BurnDriver BurnDrvmd_f22 = { - "md_f22", NULL, NULL, NULL, "1991", - "F-22 Interceptor (Euro, USA, 199206)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f22RomInfo, md_f22RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F-22 Interceptor (Euro, USA, Prototype) -static struct BurnRomInfo md_f22pRomDesc[] = { - { "f-22 interceptor (euro, usa) (beta).bin", 0x0c0000, 0xd6a880a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f22p) -STD_ROM_FN(md_f22p) - -struct BurnDriver BurnDrvmd_f22p = { - "md_f22p", "md_f22", NULL, NULL, "1991", - "F-22 Interceptor (Euro, USA, Prototype)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f22pRomInfo, md_f22pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F-22 Interceptor (Jpn) -static struct BurnRomInfo md_f22jRomDesc[] = { - { "f-22 interceptor (jpn).bin", 0x0c0000, 0xfb55c785, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f22j) -STD_ROM_FN(md_f22j) - -struct BurnDriver BurnDrvmd_f22j = { - "md_f22j", "md_f22", NULL, NULL, "1993", - "F-22 Interceptor (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f22jRomInfo, md_f22jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F1 (Euro) -static struct BurnRomInfo md_f1RomDesc[] = { - { "mpr-15834.bin", 0x100000, 0xfbdd4520, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f1) -STD_ROM_FN(md_f1) - -struct BurnDriver BurnDrvmd_f1 = { - "md_f1", NULL, NULL, NULL, "1993", - "F1 (Euro)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_f1RomInfo, md_f1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Formula One (USA) -static struct BurnRomInfo md_formula1RomDesc[] = { - { "formula one (usa).bin", 0x100000, 0xccd73738, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_formula1) -STD_ROM_FN(md_formula1) - -struct BurnDriver BurnDrvmd_formula1 = { - "md_formula1", "md_f1", NULL, NULL, "1993", - "Formula One (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_formula1RomInfo, md_formula1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F1 - World Championship Edition (Euro) -static struct BurnRomInfo md_f1wcRomDesc[] = { - { "f1 - world championship edition (euro).bin", 0x200000, 0x74cee0a7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f1wc) -STD_ROM_FN(md_f1wc) - -struct BurnDriver BurnDrvmd_f1wc = { - "md_f1wc", NULL, NULL, NULL, "1993", - "F1 - World Championship Edition (Euro)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f1wcRomInfo, md_f1wcRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F1 - World Championship Edition (Euro, Prototype) -static struct BurnRomInfo md_f1wcpRomDesc[] = { - { "f1 - world championship edition (euro) (beta).bin", 0x200000, 0x2269ed6b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f1wcp) -STD_ROM_FN(md_f1wcp) - -struct BurnDriver BurnDrvmd_f1wcp = { - "md_f1wcp", "md_f1wc", NULL, NULL, "1993", - "F1 - World Championship Edition (Euro, Prototype)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f1wcpRomInfo, md_f1wcpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// F1 Circus MD (Jpn) -static struct BurnRomInfo md_f1circusRomDesc[] = { - { "f1 circus md (jpn).bin", 0x080000, 0x5d30befb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f1circus) -STD_ROM_FN(md_f1circus) - -struct BurnDriver BurnDrvmd_f1circus = { - "md_f1circus", NULL, NULL, NULL, "1991", - "F1 Circus MD (Jpn)\0", NULL, "Nichibutsu", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_f1circusRomInfo, md_f1circusRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Faery Tale Adventure (Euro, USA) -static struct BurnRomInfo md_faerytalRomDesc[] = { - { "faery tale adventure, the (euro, usa).bin", 0x080000, 0x963f4969, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_faerytal) -STD_ROM_FN(md_faerytal) - -struct BurnDriver BurnDrvmd_faerytal = { - "md_faerytal", NULL, NULL, NULL, "1991", - "The Faery Tale Adventure (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_faerytalRomInfo, md_faerytalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Family Feud (USA) -static struct BurnRomInfo md_famfeudRomDesc[] = { - { "family feud (usa).bin", 0x080000, 0x1aa628b0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_famfeud) -STD_ROM_FN(md_famfeud) - -struct BurnDriver BurnDrvmd_famfeud = { - "md_famfeud", NULL, NULL, NULL, "1993", - "Family Feud (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_famfeudRomInfo, md_famfeudRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fantasia (World, Rev. A) -static struct BurnRomInfo md_fantasiaRomDesc[] = { - { "mpr-14028a.bin", 0x080000, 0xfc43df2d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fantasia) -STD_ROM_FN(md_fantasia) - -struct BurnDriver BurnDrvmd_fantasia = { - "md_fantasia", NULL, NULL, NULL, "1991", - "Fantasia (World, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fantasiaRomInfo, md_fantasiaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fantasia (World) -static struct BurnRomInfo md_fantasia1RomDesc[] = { - { "mpr-14028.bin", 0x080000, 0xd351b242, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fantasia1) -STD_ROM_FN(md_fantasia1) - -struct BurnDriver BurnDrvmd_fantasia1 = { - "md_fantasia1", "md_fantasia", NULL, NULL, "1991", - "Fantasia (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fantasia1RomInfo, md_fantasia1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fantastic Dizzy (Euro, USA) -static struct BurnRomInfo md_fantdizzRomDesc[] = { - { "fantastic dizzy (euro, usa).bin", 0x080000, 0x46447e7a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fantdizz) -STD_ROM_FN(md_fantdizz) - -struct BurnDriver BurnDrvmd_fantdizz = { - "md_fantdizz", NULL, NULL, NULL, "1991", - "Fantastic Dizzy (Euro, USA)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fantdizzRomInfo, md_fantdizzRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fantastic Dizzy (Euro, USA, Alt) -static struct BurnRomInfo md_fantdizz1RomDesc[] = { - { "fantastic dizzy (euro, usa) (alt).bin", 0x080000, 0x86b2a235, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fantdizz1) -STD_ROM_FN(md_fantdizz1) - -struct BurnDriver BurnDrvmd_fantdizz1 = { - "md_fantdizz1", "md_fantdizz", NULL, NULL, "1991", - "Fantastic Dizzy (Euro, USA, Alt)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fantdizz1RomInfo, md_fantdizz1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fastest 1 (Jpn) -static struct BurnRomInfo md_fastest1RomDesc[] = { - { "fastest 1 (jpn).bin", 0x080000, 0xbb43f0de, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fastest1) -STD_ROM_FN(md_fastest1) - -struct BurnDriver BurnDrvmd_fastest1 = { - "md_fastest1", NULL, NULL, NULL, "1991", - "Fastest 1 (Jpn)\0", NULL, "Human Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_fastest1RomInfo, md_fastest1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fatal Fury (Euro, Kor) -static struct BurnRomInfo md_fatfuryRomDesc[] = { - { "fatal fury (euro, kor).bin", 0x180000, 0x2e730a91, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fatfury) -STD_ROM_FN(md_fatfury) - -struct BurnDriver BurnDrvmd_fatfury = { - "md_fatfury", NULL, NULL, NULL, "1993", - "Fatal Fury (Euro, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fatfuryRomInfo, md_fatfuryRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fatal Fury (USA) -static struct BurnRomInfo md_fatfuryuRomDesc[] = { - { "fatal fury (usa).bin", 0x180000, 0x98d49170, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fatfuryu) -STD_ROM_FN(md_fatfuryu) - -struct BurnDriver BurnDrvmd_fatfuryu = { - "md_fatfuryu", "md_fatfury", NULL, NULL, "1993", - "Fatal Fury (USA)\0", NULL, "Takara", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fatfuryuRomInfo, md_fatfuryuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Garou Densetsu - Shukumei no Tatakai (Jpn) -static struct BurnRomInfo md_garouRomDesc[] = { - { "garou densetsu - shukumei no tatakai (jpn).bin", 0x180000, 0xbf3e3fa4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_garou) -STD_ROM_FN(md_garou) - -struct BurnDriver BurnDrvmd_garou = { - "md_garou", "md_fatfury", NULL, NULL, "1993", - "Garou Densetsu - Shukumei no Tatakai (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_garouRomInfo, md_garouRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fatal Fury 2 (USA, Kor) -static struct BurnRomInfo md_fatfury2RomDesc[] = { - { "fatal fury 2 (usa, kor).bin", 0x300000, 0x1b1754cb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fatfury2) -STD_ROM_FN(md_fatfury2) - -struct BurnDriver BurnDrvmd_fatfury2 = { - "md_fatfury2", NULL, NULL, NULL, "1994", - "Fatal Fury 2 (USA, Kor)\0", NULL, "Takara", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fatfury2RomInfo, md_fatfury2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Garou Densetsu 2 - Aratanaru Tatakai (Jpn) -static struct BurnRomInfo md_garou2RomDesc[] = { - { "mpr-16704+mpr-16710.bin", 0x300000, 0x2af4427f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_garou2) -STD_ROM_FN(md_garou2) - -struct BurnDriver BurnDrvmd_garou2 = { - "md_garou2", "md_fatfury2", NULL, NULL, "1994", - "Garou Densetsu 2 - Aratanaru Tatakai (Jpn)\0", NULL, "Takara", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_garou2RomInfo, md_garou2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fatal Labyrinth (Euro, USA) -static struct BurnRomInfo md_fatallabRomDesc[] = { - { "fatal labyrinth (euro, usa).bin", 0x020000, 0x5f0bd984, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fatallab) -STD_ROM_FN(md_fatallab) - -struct BurnDriver BurnDrvmd_fatallab = { - "md_fatallab", NULL, NULL, NULL, "1991", - "Fatal Labyrinth (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fatallabRomInfo, md_fatallabRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shi no Meikyuu - Labyrinth of Death (Jpn, SegaNet) -static struct BurnRomInfo md_labdeathRomDesc[] = { - { "shi no meikyuu - labyrinth of death (jpn) (sn).bin", 0x040000, 0xa6d7e02d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_labdeath) -STD_ROM_FN(md_labdeath) - -struct BurnDriver BurnDrvmd_labdeath = { - "md_labdeath", "md_fatallab", NULL, NULL, "1991", - "Shi no Meikyuu - Labyrinth of Death (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_labdeathRomInfo, md_labdeathRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shi no Meikyuu - Labyrinth of Death (Jpn, Game no Kandume MegaCD Rip) -static struct BurnRomInfo md_labdeathgnkRomDesc[] = { - { "shi no meikyuu - labyrinth of death (jpn) (gnk).bin", 0x020000, 0x40c44cd3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_labdeathgnk) -STD_ROM_FN(md_labdeathgnk) - -struct BurnDriver BurnDrvmd_labdeathgnk = { - "md_labdeathgnk", "md_fatallab", NULL, NULL, "1991", - "Shi no Meikyuu - Labyrinth of Death (Jpn, Game no Kandume MegaCD Rip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_labdeathgnkRomInfo, md_labdeathgnkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fatal Rewind (Euro, USA) -static struct BurnRomInfo md_fatalrewRomDesc[] = { - { "fatal rewind (euro, usa).bin", 0x080000, 0xe91aed05, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fatalrew) -STD_ROM_FN(md_fatalrew) - -struct BurnDriver BurnDrvmd_fatalrew = { - "md_fatalrew", NULL, NULL, NULL, "1991", - "Fatal Rewind (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fatalrewRomInfo, md_fatalrewRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Killing Game Show (Jpn) -static struct BurnRomInfo md_killshowRomDesc[] = { - { "killing game show, the (jpn).bin", 0x100000, 0xb8e7668a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_killshow) -STD_ROM_FN(md_killshow) - -struct BurnDriver BurnDrvmd_killshow = { - "md_killshow", "md_fatalrew", NULL, NULL, "1993", - "The Killing Game Show (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_killshowRomInfo, md_killshowRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Feng Kuang Tao Hua Yuan (Chi) -static struct BurnRomInfo md_fengkuanRomDesc[] = { - { "feng kuang tao hua yuan (chi) (unl).bin", 0x100000, 0x8d40d64f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fengkuan) -STD_ROM_FN(md_fengkuan) - -struct BurnDriver BurnDrvmd_fengkuan = { - "md_fengkuan", NULL, NULL, NULL, "199?", - "Feng Kuang Tao Hua Yuan (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fengkuanRomInfo, md_fengkuanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Feng Shen Ying Jie Chuan (Chi) -static struct BurnRomInfo md_fengshenRomDesc[] = { - { "feng shen ying jie chuan (chi) (unl).bin", 0x200000, 0x6a382b60, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fengshen) -STD_ROM_FN(md_fengshen) - -struct BurnDriver BurnDrvmd_fengshen = { - "md_fengshen", NULL, NULL, NULL, "1996", - "Feng Shen Ying Jie Chuan (Chi)\0", NULL, "Chuanpu Technologies", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fengshenRomInfo, md_fengshenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Feng Shen Ying Jie Zhuan (Chi, Alt?) -static struct BurnRomInfo md_fengshenaRomDesc[] = { - { "unknown chinese game 1 (chi).bin", 0x200000, 0xdfacb9ff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fengshena) -STD_ROM_FN(md_fengshena) - -struct BurnDriver BurnDrvmd_fengshena = { - "md_fengshena", "md_fengshen", NULL, NULL, "1996", - "Feng Shen Ying Jie Zhuan (Chi, Alt?)\0", NULL, "Chuanpu Technologies", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_fengshenaRomInfo, md_fengshenaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Frias Frustradas do Pica-Pau (Bra) -static struct BurnRomInfo md_feriasRomDesc[] = { - { "ferias frustradas do pica-pau (bra).bin", 0x100000, 0x7b2e416d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ferias) -STD_ROM_FN(md_ferias) - -struct BurnDriver BurnDrvmd_ferias = { - "md_ferias", NULL, NULL, NULL, "1995", - "Ferias Frustradas do Pica-Pau (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - L"F\u00e9rias Frustradas do Pica-Pau (Bra)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_feriasRomInfo, md_feriasRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ferrari Grand Prix Challenge (Prototype) -static struct BurnRomInfo md_ferraripRomDesc[] = { - { "ferrari grand prix challenge (beta).bin", 0x100000, 0xd48d02d4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ferrarip) -STD_ROM_FN(md_ferrarip) - -struct BurnDriver BurnDrvmd_ferrarip = { - "md_ferrarip", "md_ferrari", NULL, NULL, "1992", - "Ferrari Grand Prix Challenge (Prototype)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ferraripRomInfo, md_ferraripRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ferrari Grand Prix Challenge (USA) -static struct BurnRomInfo md_ferrariuRomDesc[] = { - { "ferrari grand prix challenge (usa).bin", 0x100000, 0xf73f6bec, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ferrariu) -STD_ROM_FN(md_ferrariu) - -struct BurnDriver BurnDrvmd_ferrariu = { - "md_ferrariu", "md_ferrari", NULL, NULL, "1992", - "Ferrari Grand Prix Challenge (USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ferrariuRomInfo, md_ferrariuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fever Pitch Soccer (Euro) -static struct BurnRomInfo md_feverpitRomDesc[] = { - { "fever pitch soccer (euro).bin", 0x200000, 0xfac29677, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_feverpit) -STD_ROM_FN(md_feverpit) - -struct BurnDriver BurnDrvmd_feverpit = { - "md_feverpit", NULL, NULL, NULL, "1995", - "Fever Pitch Soccer (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_feverpitRomInfo, md_feverpitRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Head-On Soccer (USA) -static struct BurnRomInfo md_headonRomDesc[] = { - { "head-on soccer (usa).bin", 0x200000, 0xdcffa327, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_headon) -STD_ROM_FN(md_headon) - -struct BurnDriver BurnDrvmd_headon = { - "md_headon", "md_feverpit", NULL, NULL, "1995", - "Head-On Soccer (USA)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_headonRomInfo, md_headonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fido Dido (USA, Prototype) -static struct BurnRomInfo md_fidodidoRomDesc[] = { - { "fido dido (usa) (prototype).bin", 0x100000, 0xc6d4a240, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fidodido) -STD_ROM_FN(md_fidodido) - -struct BurnDriver BurnDrvmd_fidodido = { - "md_fidodido", NULL, NULL, NULL, "1994", - "Fido Dido (USA, Prototype)\0", NULL, "Kaneko", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fidodidoRomInfo, md_fidodidoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA International Soccer (Euro, USA) -static struct BurnRomInfo md_fifaRomDesc[] = { - { "soccer10.bin", 0x200000, 0xbddbb763, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa) -STD_ROM_FN(md_fifa) - -struct BurnDriver BurnDrvmd_fifa = { - "md_fifa", NULL, NULL, NULL, "1994", - "FIFA International Soccer (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fifaRomInfo, md_fifaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Futbol Argentino 98 - Pasion de Multitudes (Pirate) -static struct BurnRomInfo md_futbolRomDesc[] = { - { "futbol argentino 98 - pasion de multitudes (unl).bin", 0x200000, 0x5c015888, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_futbol) -STD_ROM_FN(md_futbol) - -struct BurnDriver BurnDrvmd_futbol = { - "md_futbol", "md_fifa95", NULL, NULL, "199?", - "Futbol Argentino 98 - Pasion de Multitudes (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_futbolRomInfo, md_futbolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA Soccer 96 (Euro, USA) -static struct BurnRomInfo md_fifa96RomDesc[] = { - { "fifa01.bin", 0x200000, 0xbad30ffa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa96) -STD_ROM_FN(md_fifa96) - -struct BurnDriver BurnDrvmd_fifa96 = { - "md_fifa96", NULL, NULL, NULL, "1995", - "FIFA Soccer 96 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_fifa96RomInfo, md_fifa96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA Soccer 99 (Pirate) -static struct BurnRomInfo md_fifa99RomDesc[] = { - { "fifa soccer 99 (pirate) (unl).bin", 0x200000, 0xc5c5a4b0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa99) -STD_ROM_FN(md_fifa99) - -struct BurnDriver BurnDrvmd_fifa99 = { - "md_fifa99", "md_fifa96", NULL, NULL, "199?", - "FIFA Soccer 99 (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_fifa99RomInfo, md_fifa99RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA Soccer 2000 Gold Edition (Pirate) -static struct BurnRomInfo md_fifa2kRomDesc[] = { - { "fifa soccer 2000 gold edition (pirate) (unl).bin", 0x200000, 0x647df504, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa2k) -STD_ROM_FN(md_fifa2k) - -struct BurnDriver BurnDrvmd_fifa2k = { - "md_fifa2k", "md_fifa97", NULL, NULL, "199?", - "FIFA Soccer 2000 Gold Edition (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fifa2kRomInfo, md_fifa2kRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA 98 - Road to World Cup (Euro) -static struct BurnRomInfo md_fifa98RomDesc[] = { - { "fifa 98 - road to world cup (euro).bin", 0x200000, 0x96947f57, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa98) -STD_ROM_FN(md_fifa98) - -struct BurnDriver BurnDrvmd_fifa98 = { - "md_fifa98", NULL, NULL, NULL, "1997", - "FIFA 98 - Road to World Cup (Euro)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_fifa98RomInfo, md_fifa98RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fighting Masters (USA) -static struct BurnRomInfo md_fightmasRomDesc[] = { - { "fighting masters (usa).bin", 0x080000, 0x5f51983b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fightmas) -STD_ROM_FN(md_fightmas) - -struct BurnDriver BurnDrvmd_fightmas = { - "md_fightmas", NULL, NULL, NULL, "1992", - "Fighting Masters (USA)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fightmasRomInfo, md_fightmasRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fighting Masters (Jpn, Kor) -static struct BurnRomInfo md_fightmasjRomDesc[] = { - { "fighting masters (jpn, kor).bin", 0x080000, 0x39be80ec, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fightmasj) -STD_ROM_FN(md_fightmasj) - -struct BurnDriver BurnDrvmd_fightmasj = { - "md_fightmasj", "md_fightmas", NULL, NULL, "1991", - "Fighting Masters (Jpn, Kor)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fightmasjRomInfo, md_fightmasjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Final Zone (USA) ~ FZ Senki Axis (Jpn) -static struct BurnRomInfo md_fzoneRomDesc[] = { - { "final zone -- fz senki axis (usa, jpn).bin", 0x080000, 0x731fa4a1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fzone) -STD_ROM_FN(md_fzone) - -struct BurnDriver BurnDrvmd_fzone = { - "md_fzone", NULL, NULL, NULL, "1990", - "Final Zone (USA) ~ FZ Senki Axis (Jpn)\0", NULL, "Wolf Team", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fzoneRomInfo, md_fzoneRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fire Mustang (Jpn) -static struct BurnRomInfo md_firemustRomDesc[] = { - { "fire mustang (jpn).bin", 0x080000, 0xeb7e36c3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_firemust) -STD_ROM_FN(md_firemust) - -struct BurnDriver BurnDrvmd_firemust = { - "md_firemust", NULL, NULL, NULL, "1991", - "Fire Mustang (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_firemustRomInfo, md_firemustRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fire Shark (Euro) -static struct BurnRomInfo md_fireshrkRomDesc[] = { - { "mpr-14341.bin", 0x080000, 0x2351ce61, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fireshrk) -STD_ROM_FN(md_fireshrk) - -struct BurnDriver BurnDrvmd_fireshrk = { - "md_fireshrk", NULL, NULL, NULL, "1991", - "Fire Shark (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fireshrkRomInfo, md_fireshrkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fire Shark (USA) -static struct BurnRomInfo md_fireshrkuRomDesc[] = { - { "fire shark (usa).bin", 0x080000, 0x570b5024, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fireshrku) -STD_ROM_FN(md_fireshrku) - -struct BurnDriver BurnDrvmd_fireshrku = { - "md_fireshrku", "md_fireshrk", NULL, NULL, "1990", - "Fire Shark (USA)\0", NULL, "Dreamworks Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fireshrkuRomInfo, md_fireshrkuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fire Shark (USA, Alt) -static struct BurnRomInfo md_fireshrku1RomDesc[] = { - { "fire shark (usa) (alt).bin", 0x080000, 0x9c175146, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fireshrku1) -STD_ROM_FN(md_fireshrku1) - -struct BurnDriver BurnDrvmd_fireshrku1 = { - "md_fireshrku1", "md_fireshrk", NULL, NULL, "1990", - "Fire Shark (USA, Alt)\0", NULL, "Dreamworks Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fireshrku1RomInfo, md_fireshrku1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Same! Same! Same! (Jpn) -static struct BurnRomInfo md_samesameRomDesc[] = { - { "mpr-13301.bin", 0x080000, 0x77bbd841, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_samesame) -STD_ROM_FN(md_samesame) - -struct BurnDriver BurnDrvmd_samesame = { - "md_samesame", "md_fireshrk", NULL, NULL, "1990", - "Same! Same! Same! (Jpn)\0", NULL, "Toaplan", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_samesameRomInfo, md_samesameRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Flashback (Euro, Rev. A) -static struct BurnRomInfo md_flashbRomDesc[] = { - { "mpr-15410a.bin", 0x180000, 0x6f311c83, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flashb) -STD_ROM_FN(md_flashb) - -struct BurnDriver BurnDrvmd_flashb = { - "md_flashb", NULL, NULL, NULL, "1993", - "Flashback (Euro, Rev. A)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flashbRomInfo, md_flashbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Flashback (Jpn) -static struct BurnRomInfo md_flashbjRomDesc[] = { - { "flashback (jpn).bin", 0x180000, 0xb790e3b4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flashbj) -STD_ROM_FN(md_flashbj) - -struct BurnDriver BurnDrvmd_flashbj = { - "md_flashbj", "md_flashb", NULL, NULL, "1993", - "Flashback (Jpn)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flashbjRomInfo, md_flashbjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Flashback - The Quest for Identity (USA) -static struct BurnRomInfo md_flashbuRomDesc[] = { - { "flashback - the quest for identity (usa).bin", 0x180000, 0x23a9616d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flashbu) -STD_ROM_FN(md_flashbu) - -struct BurnDriver BurnDrvmd_flashbu = { - "md_flashbu", "md_flashb", NULL, NULL, "1993", - "Flashback - The Quest for Identity (USA)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flashbuRomInfo, md_flashbuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Flashback - The Quest for Identity (USA, Alt) -static struct BurnRomInfo md_flashbu1RomDesc[] = { - { "flashback - the quest for identity (usa) (alt).bin", 0x180000, 0x33cd2b65, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flashbu1) -STD_ROM_FN(md_flashbu1) - -struct BurnDriver BurnDrvmd_flashbu1 = { - "md_flashbu1", "md_flashb", NULL, NULL, "1993", - "Flashback - The Quest for Identity (USA, Alt)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flashbu1RomInfo, md_flashbu1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Flash Point (Jpn, Prototype) -static struct BurnRomInfo md_flashpRomDesc[] = { - { "flash point (japan) (proto).bin", 0x020000, 0x0655074d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flashp) -STD_ROM_FN(md_flashp) - -struct BurnDriver BurnDrvmd_flashp = { - "md_flashp", NULL, NULL, NULL, "199?", - "Flash Point (Jpn, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flashpRomInfo, md_flashpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Flicky (Euro, USA) -static struct BurnRomInfo md_flickyRomDesc[] = { - { "flicky (euro, usa).bin", 0x020000, 0x4291c8ab, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flicky) -STD_ROM_FN(md_flicky) - -struct BurnDriver BurnDrvmd_flicky = { - "md_flicky", NULL, NULL, NULL, "1991", - "Flicky (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flickyRomInfo, md_flickyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Flink (Euro) -static struct BurnRomInfo md_flinkRomDesc[] = { - { "flink (euro).bin", 0x100000, 0xbef9a4f4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flink) -STD_ROM_FN(md_flink) - -struct BurnDriver BurnDrvmd_flink = { - "md_flink", NULL, NULL, NULL, "1994", - "Flink (Euro)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flinkRomInfo, md_flinkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Flintstones (Euro) -static struct BurnRomInfo md_flintRomDesc[] = { - { "flintstones, the (euro).bin", 0x080000, 0x21845d61, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flint) -STD_ROM_FN(md_flint) - -struct BurnDriver BurnDrvmd_flint = { - "md_flint", NULL, NULL, NULL, "1993", - "The Flintstones (Euro)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flintRomInfo, md_flintRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Flintstones (Jpn) -static struct BurnRomInfo md_flintjRomDesc[] = { - { "flintstone (jpn).bin", 0x080000, 0x920a3031, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flintj) -STD_ROM_FN(md_flintj) - -struct BurnDriver BurnDrvmd_flintj = { - "md_flintj", "md_flint", NULL, NULL, "1993", - "The Flintstones (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flintjRomInfo, md_flintjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Flintstones (USA) -static struct BurnRomInfo md_flintuRomDesc[] = { - { "flintstones, the (usa).bin", 0x080000, 0x7c982c59, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flintu) -STD_ROM_FN(md_flintu) - -struct BurnDriver BurnDrvmd_flintu = { - "md_flintu", "md_flint", NULL, NULL, "1993", - "The Flintstones (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_flintuRomInfo, md_flintuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Foreman for Real (World) -static struct BurnRomInfo md_foremanRomDesc[] = { - { "foreman for real (world).bin", 0x300000, 0x36248f90, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_foreman) -STD_ROM_FN(md_foreman) - -struct BurnDriver BurnDrvmd_foreman = { - "md_foreman", NULL, NULL, NULL, "1995", - "Foreman for Real (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_foremanRomInfo, md_foremanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Forgotten Worlds (World, v1.1) -static struct BurnRomInfo md_forgottnRomDesc[] = { - { "forgotten worlds (world) (v1.1).bin", 0x080000, 0x95513985, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_forgottn) -STD_ROM_FN(md_forgottn) - -struct BurnDriver BurnDrvmd_forgottn = { - "md_forgottn", NULL, NULL, NULL, "1989", - "Forgotten Worlds (World, v1.1)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_forgottnRomInfo, md_forgottnRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Forgotten Worlds (World) -static struct BurnRomInfo md_forgottn1RomDesc[] = { - { "mpr-12672.bin", 0x080000, 0xd0ee6434, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_forgottn1) -STD_ROM_FN(md_forgottn1) - -struct BurnDriver BurnDrvmd_forgottn1 = { - "md_forgottn1", "md_forgottn", NULL, NULL, "1989", - "Forgotten Worlds (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_forgottn1RomInfo, md_forgottn1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mary Shelley's Frankenstein (USA) -static struct BurnRomInfo md_frankenRomDesc[] = { - { "mary shelley's frankenstein (usa).bin", 0x200000, 0x48993dc3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_franken) -STD_ROM_FN(md_franken) - -struct BurnDriver BurnDrvmd_franken = { - "md_franken", NULL, NULL, NULL, "1994", - "Mary Shelley's Frankenstein (USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_frankenRomInfo, md_frankenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Frank Thomas Big Hurt Baseball (Euro, USA) -static struct BurnRomInfo md_bighurtRomDesc[] = { - { "frank thomas big hurt baseball (euro, usa).bin", 0x400000, 0x863e0950, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bighurt) -STD_ROM_FN(md_bighurt) - -struct BurnDriver BurnDrvmd_bighurt = { - "md_bighurt", NULL, NULL, NULL, "1995", - "Frank Thomas Big Hurt Baseball (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_C_SLAM, GBF_MISC, 0, - MegadriveGetZipName, md_bighurtRomInfo, md_bighurtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Frogger (USA) -static struct BurnRomInfo md_froggerRomDesc[] = { - { "frogger (usa).bin", 0x080000, 0xea2e48c0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_frogger) -STD_ROM_FN(md_frogger) - -struct BurnDriver BurnDrvmd_frogger = { - "md_frogger", NULL, NULL, NULL, "1998", - "Frogger (USA)\0", NULL, "Majesco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_froggerRomInfo, md_froggerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fun 'N Games (Euro) -static struct BurnRomInfo md_funngameRomDesc[] = { - { "fun 'n' games (euro).bin", 0x100000, 0xda4ab3cd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_funngame) -STD_ROM_FN(md_funngame) - -struct BurnDriver BurnDrvmd_funngame = { - "md_funngame", NULL, NULL, NULL, "1993", - "Fun 'N Games (Euro)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_funngameRomInfo, md_funngameRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fun 'N' Games (USA) -static struct BurnRomInfo md_funngameuRomDesc[] = { - { "fun 'n' games (usa).bin", 0x100000, 0xb5ae351d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_funngameu) -STD_ROM_FN(md_funngameu) - -struct BurnDriver BurnDrvmd_funngameu = { - "md_funngameu", "md_funngame", NULL, NULL, "1993", - "Fun 'N' Games (USA)\0", NULL, "Tradewest", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_funngameuRomInfo, md_funngameuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fun Car Rally (USA, Prototype) -static struct BurnRomInfo md_funcarRomDesc[] = { - { "fun car rally (usa) (prototype).bin", 0x100000, 0x42e27845, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_funcar) -STD_ROM_FN(md_funcar) - -struct BurnDriver BurnDrvmd_funcar = { - "md_funcar", NULL, NULL, NULL, "199?", - "Fun Car Rally (USA, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_funcarRomInfo, md_funcarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// G-LOC Air Battle (World) -static struct BurnRomInfo md_glocRomDesc[] = { - { "mpr-15326.bin", 0x100000, 0xf2af886e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gloc) -STD_ROM_FN(md_gloc) - -struct BurnDriver BurnDrvmd_gloc = { - "md_gloc", NULL, NULL, NULL, "1993", - "G-LOC Air Battle (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_glocRomInfo, md_glocRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// G-LOC Air Battle (World, Prototype) -static struct BurnRomInfo md_glocpRomDesc[] = { - { "g-loc air battle (world) (beta).bin", 0x100000, 0x175c7e63, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_glocp) -STD_ROM_FN(md_glocp) - -struct BurnDriver BurnDrvmd_glocp = { - "md_glocp", "md_gloc", NULL, NULL, "1993", - "G-LOC Air Battle (World, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_glocpRomInfo, md_glocpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gadget Twins (USA) -static struct BurnRomInfo md_gadgetRomDesc[] = { - { "gadget twins (usa).bin", 0x100000, 0x7ae5e248, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gadget) -STD_ROM_FN(md_gadget) - -struct BurnDriver BurnDrvmd_gadget = { - "md_gadget", NULL, NULL, NULL, "1992", - "Gadget Twins (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gadgetRomInfo, md_gadgetRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gaiares (Jpn, USA) -static struct BurnRomInfo md_gaiaresRomDesc[] = { - { "gaiares (usa, jpn).bin", 0x100000, 0x5d8bf68b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gaiares) -STD_ROM_FN(md_gaiares) - -struct BurnDriver BurnDrvmd_gaiares = { - "md_gaiares", NULL, NULL, NULL, "1990", - "Gaiares (Jpn, USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gaiaresRomInfo, md_gaiaresRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gain Ground (World) -static struct BurnRomInfo md_ggroundRomDesc[] = { - { "gain ground (world).bin", 0x080000, 0x8641a2ab, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gground) -STD_ROM_FN(md_gground) - -struct BurnDriver BurnDrvmd_gground = { - "md_gground", NULL, NULL, NULL, "1991", - "Gain Ground (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ggroundRomInfo, md_ggroundRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gain Ground (USA, Prototype) -static struct BurnRomInfo md_gground1pRomDesc[] = { - { "gainground.a760.bin", 0x080000, 0x83e7b8ae, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gground1p) -STD_ROM_FN(md_gground1p) - -struct BurnDriver BurnDrvmd_gground1p = { - "md_gground1p", "md_gground", NULL, NULL, "1991", - "Gain Ground (USA, Prototype)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gground1pRomInfo, md_gground1pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Galaxy Force II (World) -static struct BurnRomInfo md_gforce2aRomDesc[] = { - { "galaxy force ii (world).bin", 0x100000, 0xcae883c5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gforce2a) -STD_ROM_FN(md_gforce2a) - -struct BurnDriver BurnDrvmd_gforce2a = { - "md_gforce2a", "md_gforce2", NULL, NULL, "1991", - "Galaxy Force II (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gforce2aRomInfo, md_gforce2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gambler Jikochuushinha - Katayama Masayuki no Mahjong Doujou (Jpn) -static struct BurnRomInfo md_gamblerRomDesc[] = { - { "gambler jiko chuushinha - katayama masayuki no mahjong doujou (jpn).bin", 0x080000, 0x05650b7a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gambler) -STD_ROM_FN(md_gambler) - -struct BurnDriver BurnDrvmd_gambler = { - "md_gambler", NULL, NULL, NULL, "1990", - "Gambler Jikochuushinha - Katayama Masayuki no Mahjong Doujou (Jpn)\0", NULL, "Game Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gamblerRomInfo, md_gamblerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Game no Kandume Otokuyou (Jpn) -static struct BurnRomInfo md_gamenkoRomDesc[] = { - { "game no kandume otokuyou (jpn).bin", 0x300000, 0xcdad7e6b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gamenko) -STD_ROM_FN(md_gamenko) - -struct BurnDriver BurnDrvmd_gamenko = { - "md_gamenko", NULL, NULL, NULL, "199?", - "Game no Kandume Otokuyou (Jpn)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_GAME_KANDUME, GBF_MISC, 0, - MegadriveGetZipName, md_gamenkoRomInfo, md_gamenkoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Garfield - Caught in the Act (Euro, USA) -static struct BurnRomInfo md_garfieldRomDesc[] = { - { "garfield - caught in the act (euro, usa).bin", 0x200000, 0xf0ff078e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_garfield) -STD_ROM_FN(md_garfield) - -struct BurnDriver BurnDrvmd_garfield = { - "md_garfield", NULL, NULL, NULL, "1995", - "Garfield - Caught in the Act (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_garfieldRomInfo, md_garfieldRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gargoyles (USA) -static struct BurnRomInfo md_gargoyleRomDesc[] = { - { "gargoyles (usa).bin", 0x300000, 0x2d965364, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gargoyle) -STD_ROM_FN(md_gargoyle) - -struct BurnDriver BurnDrvmd_gargoyle = { - "md_gargoyle", NULL, NULL, NULL, "1995", - "Gargoyles (USA)\0", NULL, "Disney Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gargoyleRomInfo, md_gargoyleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gauntlet IV (Euro, USA, 199309) -static struct BurnRomInfo md_gauntlt4RomDesc[] = { - { "gauntlet iv (euro, usa) (september 1993).bin", 0x100000, 0xf9d60510, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gauntlt4) -STD_ROM_FN(md_gauntlt4) - -struct BurnDriver BurnDrvmd_gauntlt4 = { - "md_gauntlt4", NULL, NULL, NULL, "1993", - "Gauntlet IV (Euro, USA, 199309)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gauntlt4RomInfo, md_gauntlt4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gauntlet IV (Euro, USA, 199308) -static struct BurnRomInfo md_gauntlt4aRomDesc[] = { - { "gauntlet iv (euro, usa) (august 1993).bin", 0x100000, 0x3bf46dce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gauntlt4a) -STD_ROM_FN(md_gauntlt4a) - -struct BurnDriver BurnDrvmd_gauntlt4a = { - "md_gauntlt4a", "md_gauntlt4", NULL, NULL, "1993", - "Gauntlet IV (Euro, USA, 199308)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gauntlt4aRomInfo, md_gauntlt4aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gauntlet (Jpn) -static struct BurnRomInfo md_gauntlt4jRomDesc[] = { - { "gauntlet (jpn).bin", 0x100000, 0xf9872055, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gauntlt4j) -STD_ROM_FN(md_gauntlt4j) - -struct BurnDriver BurnDrvmd_gauntlt4j = { - "md_gauntlt4j", "md_gauntlt4", NULL, NULL, "1993", - "Gauntlet (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gauntlt4jRomInfo, md_gauntlt4jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gemfire (USA) -static struct BurnRomInfo md_gemfireRomDesc[] = { - { "gemfire (usa).bin", 0x100000, 0x3d36135b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gemfire) -STD_ROM_FN(md_gemfire) - -struct BurnDriver BurnDrvmd_gemfire = { - "md_gemfire", NULL, NULL, NULL, "1992", - "Gemfire (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_gemfireRomInfo, md_gemfireRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Royal Blood (Jpn) -static struct BurnRomInfo md_royalbldRomDesc[] = { - { "royal blood (jpn).bin", 0x100000, 0x0e0107f1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_royalbld) -STD_ROM_FN(md_royalbld) - -struct BurnDriver BurnDrvmd_royalbld = { - "md_royalbld", "md_gemfire", NULL, NULL, "1992", - "Royal Blood (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_royalbldRomInfo, md_royalbldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// General Chaos (Euro, USA) -static struct BurnRomInfo md_genchaosRomDesc[] = { - { "general chaos (euro, usa).bin", 0x100000, 0xf1ecc4df, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_genchaos) -STD_ROM_FN(md_genchaos) - -struct BurnDriver BurnDrvmd_genchaos = { - "md_genchaos", NULL, NULL, NULL, "1994", - "General Chaos (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_genchaosRomInfo, md_genchaosRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// General Chaos Daikonsen (Jpn) -static struct BurnRomInfo md_genchaosjRomDesc[] = { - { "general chaos daikonsen (jpn).bin", 0x100000, 0x05cc7369, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_genchaosj) -STD_ROM_FN(md_genchaosj) - -struct BurnDriver BurnDrvmd_genchaosj = { - "md_genchaosj", "md_genchaos", NULL, NULL, "1994", - "General Chaos Daikonsen (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_genchaosjRomInfo, md_genchaosjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Generations Lost (Euro, USA) -static struct BurnRomInfo md_genelostRomDesc[] = { - { "generations lost (euro, usa).bin", 0x100000, 0x131f36a6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_genelost) -STD_ROM_FN(md_genelost) - -struct BurnDriver BurnDrvmd_genelost = { - "md_genelost", NULL, NULL, NULL, "1994", - "Generations Lost (Euro, USA)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_genelostRomInfo, md_genelostRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Genghis Khan II - Clan of the Gray Wolf (USA) -static struct BurnRomInfo md_genghis2RomDesc[] = { - { "genghis khan ii - clan of the gray wolf (usa).bin", 0x100000, 0x87a281ae, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_genghis2) -STD_ROM_FN(md_genghis2) - -struct BurnDriver BurnDrvmd_genghis2 = { - "md_genghis2", NULL, NULL, NULL, "1993", - "Genghis Khan II - Clan of the Gray Wolf (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_genghis2RomInfo, md_genghis2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Aoki Ookami to Shiroki Mejika - Genchou Hishi (Jpn) -static struct BurnRomInfo md_genchohiRomDesc[] = { - { "aoki ookami to shiroki meshika - genchou hishi (jpn).bin", 0x140000, 0x10be1d93, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_genchohi) -STD_ROM_FN(md_genchohi) - -struct BurnDriver BurnDrvmd_genchohi = { - "md_genchohi", "md_genghis2", NULL, NULL, "1993", - "Aoki Ookami to Shiroki Mejika - Genchou Hishi (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_genchohiRomInfo, md_genchohiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// George Foreman's KO Boxing (Euro) -static struct BurnRomInfo md_georgekoRomDesc[] = { - { "george foreman's ko boxing (euro).bin", 0x100000, 0xbd556381, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_georgeko) -STD_ROM_FN(md_georgeko) - -struct BurnDriver BurnDrvmd_georgeko = { - "md_georgeko", NULL, NULL, NULL, "1992", - "George Foreman's KO Boxing (Euro)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_georgekoRomInfo, md_georgekoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// George Foreman's KO Boxing (USA) -static struct BurnRomInfo md_georgekouRomDesc[] = { - { "george foreman's ko boxing (usa).bin", 0x100000, 0xe1fdc787, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_georgekou) -STD_ROM_FN(md_georgekou) - -struct BurnDriver BurnDrvmd_georgekou = { - "md_georgekou", "md_georgeko", NULL, NULL, "1992", - "George Foreman's KO Boxing (USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_georgekouRomInfo, md_georgekouRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ghostbusters (World, v1.1) -static struct BurnRomInfo md_ghostbstRomDesc[] = { - { "ghostbusters (world) (v1.1).bin", 0x080000, 0x792df93b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ghostbst) -STD_ROM_FN(md_ghostbst) - -struct BurnDriver BurnDrvmd_ghostbst = { - "md_ghostbst", NULL, NULL, NULL, "1990", - "Ghostbusters (World, v1.1)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ghostbstRomInfo, md_ghostbstRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ghostbusters (World) -static struct BurnRomInfo md_ghostbst1RomDesc[] = { - { "ghostbusters (world).bin", 0x080000, 0x00419da3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ghostbst1) -STD_ROM_FN(md_ghostbst1) - -struct BurnDriver BurnDrvmd_ghostbst1 = { - "md_ghostbst1", "md_ghostbst", NULL, NULL, "1990", - "Ghostbusters (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ghostbst1RomInfo, md_ghostbst1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dai Makaimura (Jpn) -static struct BurnRomInfo md_daimakaiRomDesc[] = { - { "dai makaimura (jpn).bin", 0x0a0000, 0x5659f379, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_daimakai) -STD_ROM_FN(md_daimakai) - -struct BurnDriver BurnDrvmd_daimakai = { - "md_daimakai", "md_ghouls", NULL, NULL, "1989", - "Dai Makaimura (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_daimakaiRomInfo, md_daimakaiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// GleyLancer (Jpn) -static struct BurnRomInfo md_gleylancRomDesc[] = { - { "advanced busterhawk gleylancer (jpn).bin", 0x100000, 0x42cf9b5b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gleylanc) -STD_ROM_FN(md_gleylanc) - -struct BurnDriver BurnDrvmd_gleylanc = { - "md_gleylanc", NULL, NULL, NULL, "1992", - "GleyLancer (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gleylancRomInfo, md_gleylancRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mick & Mack as the Global Gladiators (Euro) -static struct BurnRomInfo md_mickmackRomDesc[] = { - { "mpr-15237.bin", 0x100000, 0x5c218c6a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mickmack) -STD_ROM_FN(md_mickmack) - -struct BurnDriver BurnDrvmd_mickmack = { - "md_mickmack", NULL, NULL, NULL, "1993", - "Mick & Mack as the Global Gladiators (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mickmackRomInfo, md_mickmackRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mick & Mack as the Global Gladiators (USA) -static struct BurnRomInfo md_mickmackuRomDesc[] = { - { "mick & mack as the global gladiators (usa).bin", 0x100000, 0x40f17bb3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mickmacku) -STD_ROM_FN(md_mickmacku) - -struct BurnDriver BurnDrvmd_mickmacku = { - "md_mickmacku", "md_mickmack", NULL, NULL, "1992", - "Mick & Mack as the Global Gladiators (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mickmackuRomInfo, md_mickmackuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mick & Mack as the Global Gladiators (USA, Prototype) -static struct BurnRomInfo md_mickmackupRomDesc[] = { - { "mick & mack as the global gladiators (usa) (beta).bin", 0x100000, 0x08c2af21, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mickmackup) -STD_ROM_FN(md_mickmackup) - -struct BurnDriver BurnDrvmd_mickmackup = { - "md_mickmackup", "md_mickmack", NULL, NULL, "1992", - "Mick & Mack as the Global Gladiators (USA, Prototype)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mickmackupRomInfo, md_mickmackupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gods (Euro) -static struct BurnRomInfo md_godsRomDesc[] = { - { "gods (euro).bin", 0x100000, 0x6c415016, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gods) -STD_ROM_FN(md_gods) - -struct BurnDriver BurnDrvmd_gods = { - "md_gods", NULL, NULL, NULL, "1993", - "Gods (Euro)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_godsRomInfo, md_godsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gods (Jpn) -static struct BurnRomInfo md_godsjRomDesc[] = { - { "gods (jpn).bin", 0x100000, 0xe4f50206, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_godsj) -STD_ROM_FN(md_godsj) - -struct BurnDriver BurnDrvmd_godsj = { - "md_godsj", "md_gods", NULL, NULL, "1993", - "Gods (Jpn)\0", NULL, "PCM Complete", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_godsjRomInfo, md_godsjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gods (USA) -static struct BurnRomInfo md_godsuRomDesc[] = { - { "gods (usa).bin", 0x100000, 0xfd234ccd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_godsu) -STD_ROM_FN(md_godsu) - -struct BurnDriver BurnDrvmd_godsu = { - "md_godsu", "md_gods", NULL, NULL, "1992", - "Gods (USA)\0", NULL, "Mindscape", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_godsuRomInfo, md_godsuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gods (USA, Prototype) -static struct BurnRomInfo md_godsupRomDesc[] = { - { "gods (usa) (beta).bin", 0x100000, 0x2c06bb64, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_godsup) -STD_ROM_FN(md_godsup) - -struct BurnDriver BurnDrvmd_godsup = { - "md_godsup", "md_gods", NULL, NULL, "1992", - "Gods (USA, Prototype)\0", NULL, "Mindscape", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_godsupRomInfo, md_godsupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Golden Axe (World, v1.1) -static struct BurnRomInfo md_goldnaxeRomDesc[] = { - { "golden axe (world) (v1.1).bin", 0x080000, 0x665d7df9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_goldnaxe) -STD_ROM_FN(md_goldnaxe) - -struct BurnDriver BurnDrvmd_goldnaxe = { - "md_goldnaxe", NULL, NULL, NULL, "1989", - "Golden Axe (World, v1.1)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_goldnaxeRomInfo, md_goldnaxeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Golden Axe (World) -static struct BurnRomInfo md_goldnaxe1RomDesc[] = { - { "mpr-12806.bin", 0x080000, 0xe8182b90, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_goldnaxe1) -STD_ROM_FN(md_goldnaxe1) - -struct BurnDriver BurnDrvmd_goldnaxe1 = { - "md_goldnaxe1", "md_goldnaxe", NULL, NULL, "1989", - "Golden Axe (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_goldnaxe1RomInfo, md_goldnaxe1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Golden Axe II (World) -static struct BurnRomInfo md_goldnax2RomDesc[] = { - { "mpr-14272.bin", 0x080000, 0x725e0a18, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_goldnax2) -STD_ROM_FN(md_goldnax2) - -struct BurnDriver BurnDrvmd_goldnax2 = { - "md_goldnax2", NULL, NULL, NULL, "1991", - "Golden Axe II (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_goldnax2RomInfo, md_goldnax2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Golden Axe II (World, Prototype) -static struct BurnRomInfo md_goldnax2pRomDesc[] = { - { "golden axe ii (world) (beta).bin", 0x080000, 0xe62ea1bb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_goldnax2p) -STD_ROM_FN(md_goldnax2p) - -struct BurnDriver BurnDrvmd_goldnax2p = { - "md_goldnax2p", "md_goldnax2", NULL, NULL, "1991", - "Golden Axe II (World, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_goldnax2pRomInfo, md_goldnax2pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Golden Axe III (Jpn) -static struct BurnRomInfo md_goldnax3RomDesc[] = { - { "golden axe iii (jpn).bin", 0x100000, 0xc7862ea3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_goldnax3) -STD_ROM_FN(md_goldnax3) - -struct BurnDriver BurnDrvmd_goldnax3 = { - "md_goldnax3", NULL, NULL, NULL, "1993", - "Golden Axe III (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_goldnax3RomInfo, md_goldnax3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Uchuu Senkan Gomora (Jpn) -static struct BurnRomInfo md_gomoraRomDesc[] = { - { "uchuu senkan gomora (jpn).bin", 0x100000, 0xc511e8d2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gomora) -STD_ROM_FN(md_gomora) - -struct BurnDriver BurnDrvmd_gomora = { - "md_gomora", NULL, NULL, NULL, "1991", - "Uchuu Senkan Gomora (Jpn)\0", NULL, "UPL", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gomoraRomInfo, md_gomoraRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Goofy's Hysterical History Tour (USA) -static struct BurnRomInfo md_goofyRomDesc[] = { - { "goofy's hysterical history tour (usa).bin", 0x100000, 0x4e1cc833, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_goofy) -STD_ROM_FN(md_goofy) - -struct BurnDriver BurnDrvmd_goofy = { - "md_goofy", NULL, NULL, NULL, "1993", - "Goofy's Hysterical History Tour (USA)\0", NULL, "Absolute Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_goofyRomInfo, md_goofyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gouketsuji Ichizoku (Jpn) -static struct BurnRomInfo md_gouketsuRomDesc[] = { - { "gouketsuji ichizoku (jpn).bin", 0x300000, 0xabe9c415, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gouketsu) -STD_ROM_FN(md_gouketsu) - -struct BurnDriver BurnDrvmd_gouketsu = { - "md_gouketsu", NULL, NULL, NULL, "1994", - "Gouketsuji Ichizoku (Jpn)\0", NULL, "Atlus", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gouketsuRomInfo, md_gouketsuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Granada (Jpn, USA, v1.1) -static struct BurnRomInfo md_granadaRomDesc[] = { - { "granada (usa, jpn) (v1.1).bin", 0x080000, 0xe89d1e66, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_granada) -STD_ROM_FN(md_granada) - -struct BurnDriver BurnDrvmd_granada = { - "md_granada", NULL, NULL, NULL, "1990", - "Granada (Jpn, USA, v1.1)\0", NULL, "Renovation ~ Wolf Team", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_granadaRomInfo, md_granadaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Granada (Jpn, USA) -static struct BurnRomInfo md_granada1RomDesc[] = { - { "granada (usa, jpn).bin", 0x080000, 0x7f45719b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_granada1) -STD_ROM_FN(md_granada1) - -struct BurnDriver BurnDrvmd_granada1 = { - "md_granada1", "md_granada", NULL, NULL, "1990", - "Granada (Jpn, USA)\0", NULL, "Renovation ~ Wolf Team", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_granada1RomInfo, md_granada1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// GrandSlam - The Tennis Tournament (Euro) -static struct BurnRomInfo md_grandslRomDesc[] = { - { "mpr-15208.bin", 0x080000, 0x8c2670de, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_grandsl) -STD_ROM_FN(md_grandsl) - -struct BurnDriver BurnDrvmd_grandsl = { - "md_grandsl", NULL, NULL, NULL, "1992", - "GrandSlam - The Tennis Tournament (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_grandslRomInfo, md_grandslRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// GrandSlam - The Tennis Tournament '92 (Jpn) -static struct BurnRomInfo md_grandsljRomDesc[] = { - { "grandslam - the tennis tournament '92 (jpn).bin", 0x080000, 0x30cf37d0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_grandslj) -STD_ROM_FN(md_grandslj) - -struct BurnDriver BurnDrvmd_grandslj = { - "md_grandslj", "md_grandsl", NULL, NULL, "1992", - "GrandSlam - The Tennis Tournament '92 (Jpn)\0", NULL, "Nihon Telenet", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_grandsljRomInfo, md_grandsljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jennifer Capriati Tennis (USA) -static struct BurnRomInfo md_jennifctRomDesc[] = { - { "jennifer capriati tennis (usa).bin", 0x080000, 0xab2abc8e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jennifct) -STD_ROM_FN(md_jennifct) - -struct BurnDriver BurnDrvmd_jennifct = { - "md_jennifct", "md_grandsl", NULL, NULL, "1992", - "Jennifer Capriati Tennis (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jennifctRomInfo, md_jennifctRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Great Circus Mystery - Mickey to Minnie Magical Adventure 2 (Jpn) -static struct BurnRomInfo md_greatcirjRomDesc[] = { - { "great circus mystery - mickey to minnie magical adventure 2 (jpn).bin", 0x200000, 0x5aa0f3a0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_greatcirj) -STD_ROM_FN(md_greatcirj) - -struct BurnDriver BurnDrvmd_greatcirj = { - "md_greatcirj", "md_mickeycm", NULL, NULL, "1994", - "Great Circus Mystery - Mickey to Minnie Magical Adventure 2 (Jpn)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_greatcirjRomInfo, md_greatcirjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Great Circus Mystery Starring Mickey & Minnie (USA) -static struct BurnRomInfo md_mickeycmRomDesc[] = { - { "great circus mystery starring mickey & minnie, the (usa).bin", 0x200000, 0x14744883, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mickeycm) -STD_ROM_FN(md_mickeycm) - -struct BurnDriver BurnDrvmd_mickeycm = { - "md_mickeycm", NULL, NULL, NULL, "1994", - "The Great Circus Mystery Starring Mickey & Minnie (USA)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mickeycmRomInfo, md_mickeycmRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Great Waldo Search (USA) -static struct BurnRomInfo md_waldoRomDesc[] = { - { "great waldo search, the (usa).bin", 0x100000, 0x8c5c93b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_waldo) -STD_ROM_FN(md_waldo) - -struct BurnDriver BurnDrvmd_waldo = { - "md_waldo", NULL, NULL, NULL, "1992", - "The Great Waldo Search (USA)\0", NULL, "THQ", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_waldoRomInfo, md_waldoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Greatest Heavyweights (Jpn) -static struct BurnRomInfo md_ghwjRomDesc[] = { - { "greatest heavyweights (jpn).bin", 0x200000, 0x7ef8b162, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ghwj) -STD_ROM_FN(md_ghwj) - -struct BurnDriver BurnDrvmd_ghwj = { - "md_ghwj", "md_ghw", NULL, NULL, "1994", - "Greatest Heavyweights (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_ghwjRomInfo, md_ghwjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Greatest Heavyweights (USA) -static struct BurnRomInfo md_ghwuRomDesc[] = { - { "greatest heavyweights (usa).bin", 0x200000, 0x6e3621d5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ghwu) -STD_ROM_FN(md_ghwu) - -struct BurnDriver BurnDrvmd_ghwu = { - "md_ghwu", "md_ghw", NULL, NULL, "1994", - "Greatest Heavyweights (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_ghwuRomInfo, md_ghwuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Greendog - The Beached Surfer Dude! (Euro, USA) -static struct BurnRomInfo md_greendogRomDesc[] = { - { "mpr-14993.bin", 0x080000, 0xc4820a03, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_greendog) -STD_ROM_FN(md_greendog) - -struct BurnDriver BurnDrvmd_greendog = { - "md_greendog", NULL, NULL, NULL, "1992", - "Greendog - The Beached Surfer Dude! (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_greendogRomInfo, md_greendogRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Grind Stormer (USA) -static struct BurnRomInfo md_grindstRomDesc[] = { - { "grind stormer (usa).bin", 0x100000, 0x7e6bef15, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_grindst) -STD_ROM_FN(md_grindst) - -struct BurnDriver BurnDrvmd_grindst = { - "md_grindst", NULL, NULL, NULL, "1994", - "Grind Stormer (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_grindstRomInfo, md_grindstRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// V-Five (Jpn) -static struct BurnRomInfo md_vfiveRomDesc[] = { - { "v-v (jpn).bin", 0x100000, 0xad9d0ec0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vfive) -STD_ROM_FN(md_vfive) - -struct BurnDriver BurnDrvmd_vfive = { - "md_vfive", "md_grindst", NULL, NULL, "1994", - "V-Five (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vfiveRomInfo, md_vfiveRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Growl (USA) -static struct BurnRomInfo md_growlRomDesc[] = { - { "growl (usa).bin", 0x080000, 0xf60ef143, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_growl) -STD_ROM_FN(md_growl) - -struct BurnDriver BurnDrvmd_growl = { - "md_growl", NULL, NULL, NULL, "1991", - "Growl (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_growlRomInfo, md_growlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Runark (Jpn, Kor) -static struct BurnRomInfo md_runarkRomDesc[] = { - { "runark (jpn, kor).bin", 0x080000, 0x0894d8fb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_runark) -STD_ROM_FN(md_runark) - -struct BurnDriver BurnDrvmd_runark = { - "md_runark", "md_growl", NULL, NULL, "1991", - "Runark (Jpn, Kor)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_runarkRomInfo, md_runarkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gunship (Euro) -static struct BurnRomInfo md_gunshipRomDesc[] = { - { "gunship (euro).bin", 0x100000, 0xda1440c9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gunship) -STD_ROM_FN(md_gunship) - -struct BurnDriver BurnDrvmd_gunship = { - "md_gunship", NULL, NULL, NULL, "1993", - "Gunship (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gunshipRomInfo, md_gunshipRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gunstar Heroes (Euro) -static struct BurnRomInfo md_gunstarRomDesc[] = { - { "gunstar heroes (euro).bin", 0x100000, 0x866ed9d0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gunstar) -STD_ROM_FN(md_gunstar) - -struct BurnDriver BurnDrvmd_gunstar = { - "md_gunstar", NULL, NULL, NULL, "1993", - "Gunstar Heroes (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gunstarRomInfo, md_gunstarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gunstar Heroes (Jpn) -static struct BurnRomInfo md_gunstarjRomDesc[] = { - { "gunstar heroes (jpn).bin", 0x100000, 0x1cfd0383, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gunstarj) -STD_ROM_FN(md_gunstarj) - -struct BurnDriver BurnDrvmd_gunstarj = { - "md_gunstarj", "md_gunstar", NULL, NULL, "1993", - "Gunstar Heroes (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gunstarjRomInfo, md_gunstarjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gunstar Heroes (Jpn, Sample) -static struct BurnRomInfo md_gunstarjsRomDesc[] = { - { "gunstar heroes (jpn) (sample).bin", 0x100000, 0x6f90b502, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gunstarjs) -STD_ROM_FN(md_gunstarjs) - -struct BurnDriver BurnDrvmd_gunstarjs = { - "md_gunstarjs", "md_gunstar", NULL, NULL, "1993", - "Gunstar Heroes (Jpn, Sample)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gunstarjsRomInfo, md_gunstarjsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gunstar Heroes (USA) -static struct BurnRomInfo md_gunstaruRomDesc[] = { - { "gunstar heroes (usa).bin", 0x100000, 0xb813cf0d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gunstaru) -STD_ROM_FN(md_gunstaru) - -struct BurnDriver BurnDrvmd_gunstaru = { - "md_gunstaru", "md_gunstar", NULL, NULL, "1993", - "Gunstar Heroes (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gunstaruRomInfo, md_gunstaruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gynoug (Euro) -static struct BurnRomInfo md_gynougRomDesc[] = { - { "mpr-14439.bin", 0x080000, 0x03405102, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gynoug) -STD_ROM_FN(md_gynoug) - -struct BurnDriver BurnDrvmd_gynoug = { - "md_gynoug", NULL, NULL, NULL, "1991", - "Gynoug (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gynougRomInfo, md_gynougRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gynoug (Jpn) -static struct BurnRomInfo md_gynougjRomDesc[] = { - { "gynoug (jpn).bin", 0x080000, 0x1b69241f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gynougj) -STD_ROM_FN(md_gynougj) - -struct BurnDriver BurnDrvmd_gynougj = { - "md_gynougj", "md_gynoug", NULL, NULL, "1991", - "Gynoug (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gynougjRomInfo, md_gynougjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wings of Wor (USA) -static struct BurnRomInfo md_wingsworRomDesc[] = { - { "wings of wor (usa).bin", 0x080000, 0x210a2fcd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wingswor) -STD_ROM_FN(md_wingswor) - -struct BurnDriver BurnDrvmd_wingswor = { - "md_wingswor", "md_gynoug", NULL, NULL, "1991", - "Wings of Wor (USA)\0", NULL, "Dreamworks Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wingsworRomInfo, md_wingsworRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hard Drivin' (World) -static struct BurnRomInfo md_harddrivRomDesc[] = { - { "mpr-13489.bin", 0x040000, 0x3225baaf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_harddriv) -STD_ROM_FN(md_harddriv) - -struct BurnDriver BurnDrvmd_harddriv = { - "md_harddriv", NULL, NULL, NULL, "1991", - "Hard Drivin' (World)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_harddrivRomInfo, md_harddrivRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// HardBall '94 (Euro, USA) -static struct BurnRomInfo md_hardbl94RomDesc[] = { - { "hardball '94 (euro, usa).bin", 0x200000, 0xea9c4878, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hardbl94) -STD_ROM_FN(md_hardbl94) - -struct BurnDriver BurnDrvmd_hardbl94 = { - "md_hardbl94", NULL, NULL, NULL, "1994", - "HardBall '94 (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_hardbl94RomInfo, md_hardbl94RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// HardBall '95 (USA) -static struct BurnRomInfo md_hardbl95RomDesc[] = { - { "hardball '95 (usa).bin", 0x300000, 0xed10bc9e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hardbl95) -STD_ROM_FN(md_hardbl95) - -struct BurnDriver BurnDrvmd_hardbl95 = { - "md_hardbl95", NULL, NULL, NULL, "1995", - "HardBall '95 (USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_hardbl95RomInfo, md_hardbl95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// HardBall III (USA) -static struct BurnRomInfo md_hardbal3RomDesc[] = { - { "hardball iii (usa).bin", 0x200000, 0xa4f2f011, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hardbal3) -STD_ROM_FN(md_hardbal3) - -struct BurnDriver BurnDrvmd_hardbal3 = { - "md_hardbal3", NULL, NULL, NULL, "1993", - "HardBall III (USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_hardbal3RomInfo, md_hardbal3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// HardBall! (USA) -static struct BurnRomInfo md_hardballRomDesc[] = { - { "hardball! (usa).bin", 0x100000, 0xbd1b9a04, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hardball) -STD_ROM_FN(md_hardball) - -struct BurnDriver BurnDrvmd_hardball = { - "md_hardball", NULL, NULL, NULL, "1991", - "HardBall! (USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hardballRomInfo, md_hardballRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Haunting Starring Polterguy (Euro, USA) -static struct BurnRomInfo md_hauntingRomDesc[] = { - { "haunting starring polterguy (euro, usa).bin", 0x200000, 0xc9fc876d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_haunting) -STD_ROM_FN(md_haunting) - -struct BurnDriver BurnDrvmd_haunting = { - "md_haunting", NULL, NULL, NULL, "1993", - "Haunting Starring Polterguy (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hauntingRomInfo, md_hauntingRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// High Seas Havoc (USA) -static struct BurnRomInfo md_havocuRomDesc[] = { - { "high seas havoc (usa).bin", 0x100000, 0x17be551c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_havocu) -STD_ROM_FN(md_havocu) - -struct BurnDriver BurnDrvmd_havocu = { - "md_havocu", "md_havoc", NULL, NULL, "1993", - "High Seas Havoc (USA)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_havocuRomInfo, md_havocuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Heavy Nova (USA) -static struct BurnRomInfo md_heavynovRomDesc[] = { - { "heavy nova (usa).bin", 0x100000, 0xf6b6a9d8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_heavynov) -STD_ROM_FN(md_heavynov) - -struct BurnDriver BurnDrvmd_heavynov = { - "md_heavynov", NULL, NULL, NULL, "1992", - "Heavy Nova (USA)\0", NULL, "Micronet", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_heavynovRomInfo, md_heavynovRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Heavy Unit - Mega Drive Special (Jpn) -static struct BurnRomInfo md_hvyunitRomDesc[] = { - { "heavy unit - mega drive special (jpn).bin", 0x080000, 0x1acbe608, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hvyunit) -STD_ROM_FN(md_hvyunit) - -struct BurnDriver BurnDrvmd_hvyunit = { - "md_hvyunit", NULL, NULL, NULL, "1990", - "Heavy Unit - Mega Drive Special (Jpn)\0", NULL, "Toho", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hvyunitRomInfo, md_hvyunitRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hei Tao 2 - Super Big 2 (Chi) -static struct BurnRomInfo md_heitaoRomDesc[] = { - { "hei tao 2 - super big 2 (chi) (unl).bin", 0x100000, 0x31449113, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_heitao) -STD_ROM_FN(md_heitao) - -struct BurnDriver BurnDrvmd_heitao = { - "md_heitao", NULL, NULL, NULL, "199?", - "Hei Tao 2 - Super Big 2 (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_heitaoRomInfo, md_heitaoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hellfire (Euro) -static struct BurnRomInfo md_hellfireRomDesc[] = { - { "mpr-14430.bin", 0x080000, 0xcf30acec, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hellfire) -STD_ROM_FN(md_hellfire) - -struct BurnDriver BurnDrvmd_hellfire = { - "md_hellfire", NULL, NULL, NULL, "1991", - "Hellfire (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hellfireRomInfo, md_hellfireRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hellfire (Jpn) -static struct BurnRomInfo md_hellfirejRomDesc[] = { - { "hellfire (jpn).bin", 0x080000, 0x8e5e13ba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hellfirej) -STD_ROM_FN(md_hellfirej) - -struct BurnDriver BurnDrvmd_hellfirej = { - "md_hellfirej", "md_hellfire", NULL, NULL, "1990", - "Hellfire (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hellfirejRomInfo, md_hellfirejRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hellfire (USA) -static struct BurnRomInfo md_hellfireuRomDesc[] = { - { "hellfire (usa).bin", 0x080000, 0x184018f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hellfireu) -STD_ROM_FN(md_hellfireu) - -struct BurnDriver BurnDrvmd_hellfireu = { - "md_hellfireu", "md_hellfire", NULL, NULL, "1991", - "Hellfire (USA)\0", NULL, "Seismic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hellfireuRomInfo, md_hellfireuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Herzog Zwei (Jpn) -static struct BurnRomInfo md_herzogjRomDesc[] = { - { "herzog zwei (jpn).bin", 0x080000, 0x4cf676b3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_herzogj) -STD_ROM_FN(md_herzogj) - -struct BurnDriver BurnDrvmd_herzogj = { - "md_herzogj", "md_herzog", NULL, NULL, "1989", - "Herzog Zwei (Jpn)\0", NULL, "Technosoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_herzogjRomInfo, md_herzogjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hit the Ice (USA) -static struct BurnRomInfo md_hiticeRomDesc[] = { - { "hit the ice (usa).bin", 0x080000, 0x85b23606, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hitice) -STD_ROM_FN(md_hitice) - -struct BurnDriver BurnDrvmd_hitice = { - "md_hitice", NULL, NULL, NULL, "1992", - "Hit the Ice (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hiticeRomInfo, md_hiticeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Home Alone (USA, Prototype) -static struct BurnRomInfo md_homeapRomDesc[] = { - { "home alone (usa) (beta).bin", 0x100000, 0x3a235fb9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_homeap) -STD_ROM_FN(md_homeap) - -struct BurnDriver BurnDrvmd_homeap = { - "md_homeap", "md_homea", NULL, NULL, "1992", - "Home Alone (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_homeapRomInfo, md_homeapRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Home Alone 2 - Lost in New York (USA) -static struct BurnRomInfo md_homea2RomDesc[] = { - { "home alone 2 - lost in new york (usa).bin", 0x080000, 0xcbf87c14, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_homea2) -STD_ROM_FN(md_homea2) - -struct BurnDriver BurnDrvmd_homea2 = { - "md_homea2", NULL, NULL, NULL, "1993", - "Home Alone 2 - Lost in New York (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_homea2RomInfo, md_homea2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Honoo no Toukyuuji - Dodge Danpei (Jpn) -static struct BurnRomInfo md_ddanpeiRomDesc[] = { - { "mpr-14856.bin", 0x080000, 0x630f07c6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ddanpei) -STD_ROM_FN(md_ddanpei) - -struct BurnDriver BurnDrvmd_ddanpei = { - "md_ddanpei", NULL, NULL, NULL, "1992", - "Honoo no Toukyuuji - Dodge Danpei (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ddanpeiRomInfo, md_ddanpeiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hook (Euro) -static struct BurnRomInfo md_hookRomDesc[] = { - { "hook (euro).bin", 0x100000, 0xa154433a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hook) -STD_ROM_FN(md_hook) - -struct BurnDriver BurnDrvmd_hook = { - "md_hook", NULL, NULL, NULL, "1992", - "Hook (Euro)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hookRomInfo, md_hookRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hook (USA) -static struct BurnRomInfo md_hookuRomDesc[] = { - { "hook (usa).bin", 0x100000, 0x2c48e712, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hooku) -STD_ROM_FN(md_hooku) - -struct BurnDriver BurnDrvmd_hooku = { - "md_hooku", "md_hook", NULL, NULL, "1992", - "Hook (USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hookuRomInfo, md_hookuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Humans (USA) -static struct BurnRomInfo md_humansRomDesc[] = { - { "humans, the (usa).bin", 0x100000, 0xa0cf4366, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_humans) -STD_ROM_FN(md_humans) - -struct BurnDriver BurnDrvmd_humans = { - "md_humans", NULL, NULL, NULL, "1992", - "The Humans (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_humansRomInfo, md_humansRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hurricanes (Euro) -static struct BurnRomInfo md_hurricanRomDesc[] = { - { "hurricanes (euro).bin", 0x200000, 0xdeccc874, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hurrican) -STD_ROM_FN(md_hurrican) - -struct BurnDriver BurnDrvmd_hurrican = { - "md_hurrican", NULL, NULL, NULL, "1994", - "Hurricanes (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hurricanRomInfo, md_hurricanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Hybrid Front (Jpn) -static struct BurnRomInfo md_hybridfRomDesc[] = { - { "hybrid front, the (jpn).bin", 0x200000, 0xa1f1cfe7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hybridf) -STD_ROM_FN(md_hybridf) - -struct BurnDriver BurnDrvmd_hybridf = { - "md_hybridf", NULL, NULL, NULL, "1994", - "The Hybrid Front (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_hybridfRomInfo, md_hybridfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Hybrid Front (Jpn, Prototype) -static struct BurnRomInfo md_hybridfpRomDesc[] = { - { "hybrid front, the (jpn) (beta).bin", 0x300000, 0x04f02687, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hybridfp) -STD_ROM_FN(md_hybridfp) - -struct BurnDriver BurnDrvmd_hybridfp = { - "md_hybridfp", "md_hybridf", NULL, NULL, "1994", - "The Hybrid Front (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_hybridfpRomInfo, md_hybridfpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hyokkori Hyoutan Jima - Daitouryou o Mezase! (Jpn) -static struct BurnRomInfo md_hyokkohjRomDesc[] = { - { "hyokkori hyoutanjima - daitouryou o mezase! (jpn).bin", 0x080000, 0x72253bdb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hyokkohj) -STD_ROM_FN(md_hyokkohj) - -struct BurnDriver BurnDrvmd_hyokkohj = { - "md_hyokkohj", NULL, NULL, NULL, "1992", - "Hyokkori Hyoutan Jima - Daitouryou o Mezase! (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hyokkohjRomInfo, md_hyokkohjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hyper Dunk (Euro) -static struct BurnRomInfo md_hyperdnkRomDesc[] = { - { "hyper dunk (euro).bin", 0x200000, 0xf27c576a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hyperdnk) -STD_ROM_FN(md_hyperdnk) - -struct BurnDriver BurnDrvmd_hyperdnk = { - "md_hyperdnk", NULL, NULL, NULL, "1994", - "Hyper Dunk (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hyperdnkRomInfo, md_hyperdnkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hyper Dunk - The Playoff Edition (Jpn) -static struct BurnRomInfo md_hyperdnkjRomDesc[] = { - { "fz009a1.bin", 0x200000, 0x5baf53d7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hyperdnkj) -STD_ROM_FN(md_hyperdnkj) - -struct BurnDriver BurnDrvmd_hyperdnkj = { - "md_hyperdnkj", "md_hyperdnk", NULL, NULL, "1994", - "Hyper Dunk - The Playoff Edition (Jpn)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hyperdnkjRomInfo, md_hyperdnkjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hyper Dunk - The Playoff Edition (Jpn, Prototype) -static struct BurnRomInfo md_hyperdnkjpRomDesc[] = { - { "hyper dunk - the playoff edition (jpn) (beta).in", 0x200000, 0xdb124bbb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hyperdnkjp) -STD_ROM_FN(md_hyperdnkjp) - -struct BurnDriver BurnDrvmd_hyperdnkjp = { - "md_hyperdnkjp", "md_hyperdnk", NULL, NULL, "1994", - "Hyper Dunk - The Playoff Edition (Jpn, Prototype)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hyperdnkjpRomInfo, md_hyperdnkjpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Double Dribble - The Playoff Edition (USA) -static struct BurnRomInfo md_ddribbleRomDesc[] = { - { "double dribble - the playoff edition (usa).bin", 0x200000, 0x8352b1d0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ddribble) -STD_ROM_FN(md_ddribble) - -struct BurnDriver BurnDrvmd_ddribble = { - "md_ddribble", "md_hyperdnk", NULL, NULL, "1994", - "Double Dribble - The Playoff Edition (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ddribbleRomInfo, md_ddribbleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hyper Marbles (Jpn, SegaNet) -static struct BurnRomInfo md_hypermRomDesc[] = { - { "hyper marbles (jpn) (sn).bin", 0x040000, 0x83bb2799, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hyperm) -STD_ROM_FN(md_hyperm) - -struct BurnDriver BurnDrvmd_hyperm = { - "md_hyperm", NULL, NULL, NULL, "1991", - "Hyper Marbles (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hypermRomInfo, md_hypermRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hyper Marbles (Jpn, Game no Kandume MegaCD Rip) -static struct BurnRomInfo md_hypermgnkRomDesc[] = { - { "hyper marbles (jpn) (gnk).bin", 0x040000, 0x9ed72146, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hypermgnk) -STD_ROM_FN(md_hypermgnk) - -struct BurnDriver BurnDrvmd_hypermgnk = { - "md_hypermgnk", "md_hyperm", NULL, NULL, "1991", - "Hyper Marbles (Jpn, Game no Kandume MegaCD Rip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hypermgnkRomInfo, md_hypermgnkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// IMG International Tour Tennis (Euro, USA) -static struct BurnRomInfo md_imgittRomDesc[] = { - { "img international tour tennis (euro, usa).bin", 0x200000, 0xe04ffc2b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_imgitt) -STD_ROM_FN(md_imgitt) - -struct BurnDriver BurnDrvmd_imgitt = { - "md_imgitt", NULL, NULL, NULL, "1994", - "IMG International Tour Tennis (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_imgittRomInfo, md_imgittRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Immortal (Euro, USA) -static struct BurnRomInfo md_immortalRomDesc[] = { - { "immortal, the (euro, usa).bin", 0x100000, 0xf653c508, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_immortal) -STD_ROM_FN(md_immortal) - -struct BurnDriver BurnDrvmd_immortal = { - "md_immortal", NULL, NULL, NULL, "1993", - "The Immortal (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_immortalRomInfo, md_immortalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wizard of the Immortal (Jpn) -static struct BurnRomInfo md_immortaljRomDesc[] = { - { "wizard of the immortal (jpn).bin", 0x200000, 0xc99fad92, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_immortalj) -STD_ROM_FN(md_immortalj) - -struct BurnDriver BurnDrvmd_immortalj = { - "md_immortalj", "md_immortal", NULL, NULL, "1993", - "Wizard of the Immortal (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_immortaljRomInfo, md_immortaljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Incredible Crash Dummies (USA, Prototype) -static struct BurnRomInfo md_crashdumpRomDesc[] = { - { "incredible crash dummies, the (usa) (beta).bin", 0x100000, 0x623a920f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crashdump) -STD_ROM_FN(md_crashdump) - -struct BurnDriver BurnDrvmd_crashdump = { - "md_crashdump", "md_crashdum", NULL, NULL, "1993", - "The Incredible Crash Dummies (USA, Prototype)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crashdumpRomInfo, md_crashdumpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Incredible Hulk (Euro, USA) -static struct BurnRomInfo md_hulkRomDesc[] = { - { "incredible hulk, the (euro, usa).bin", 0x200000, 0x84a5a2dc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hulk) -STD_ROM_FN(md_hulk) - -struct BurnDriver BurnDrvmd_hulk = { - "md_hulk", NULL, NULL, NULL, "1994", - "The Incredible Hulk (Euro, USA)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hulkRomInfo, md_hulkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Indiana Jones and the Last Crusade (Euro) -static struct BurnRomInfo md_indycrusRomDesc[] = { - { "mpr-15207.bin", 0x100000, 0xeb8f4374, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_indycrus) -STD_ROM_FN(md_indycrus) - -struct BurnDriver BurnDrvmd_indycrus = { - "md_indycrus", NULL, NULL, NULL, "1992", - "Indiana Jones and the Last Crusade (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_indycrusRomInfo, md_indycrusRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Indiana Jones and the Last Crusade (USA) -static struct BurnRomInfo md_indycrusuRomDesc[] = { - { "indiana jones and the last crusade (usa).bin", 0x100000, 0x3599a3fd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_indycrusu) -STD_ROM_FN(md_indycrusu) - -struct BurnDriver BurnDrvmd_indycrusu = { - "md_indycrusu", "md_indycrus", NULL, NULL, "1992", - "Indiana Jones and the Last Crusade (USA)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_indycrusuRomInfo, md_indycrusuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Insector X (USA) -static struct BurnRomInfo md_insectxRomDesc[] = { - { "insector x (usa).bin", 0x080000, 0x70626304, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_insectx) -STD_ROM_FN(md_insectx) - -struct BurnDriver BurnDrvmd_insectx = { - "md_insectx", NULL, NULL, NULL, "1990", - "Insector X (USA)\0", NULL, "Sage's Creation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_insectxRomInfo, md_insectxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Insector X (Jpn, Kor) -static struct BurnRomInfo md_insectxjRomDesc[] = { - { "insector x (jpn, kor).bin", 0x080000, 0x9625c434, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_insectxj) -STD_ROM_FN(md_insectxj) - -struct BurnDriver BurnDrvmd_insectxj = { - "md_insectxj", "md_insectx", NULL, NULL, "1990", - "Insector X (Jpn, Kor)\0", NULL, "Hot-B", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_insectxjRomInfo, md_insectxjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (USA) -static struct BurnRomInfo md_instchRomDesc[] = { - { "instruments of chaos starring young indiana jones (usa).bin", 0x100000, 0x4e384ef0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instch) -STD_ROM_FN(md_instch) - -struct BurnDriver BurnDrvmd_instch = { - "md_instch", NULL, NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchRomInfo, md_instchRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (Prototype) -static struct BurnRomInfo md_instchp1RomDesc[] = { - { "instruments of chaos starring young indiana jones (usa) (beta).bin", 0x180000, 0xad6c2050, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instchp1) -STD_ROM_FN(md_instchp1) - -struct BurnDriver BurnDrvmd_instchp1 = { - "md_instchp1", "md_instch", NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchp1RomInfo, md_instchp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (Prototype, 19941229) -static struct BurnRomInfo md_instchp2RomDesc[] = { - { "instruments of chaos starring young indiana jones (prototype - dec 29, 1994).bin", 0x100000, 0x94b02351, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instchp2) -STD_ROM_FN(md_instchp2) - -struct BurnDriver BurnDrvmd_instchp2 = { - "md_instchp2", "md_instch", NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (Prototype, 19941229)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchp2RomInfo, md_instchp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (Prototype, 19941228-A) -static struct BurnRomInfo md_instchp3RomDesc[] = { - { "instruments of chaos starring young indiana jones (prototype - dec 28, 1994 - a).bin", 0x0ff73c, 0xf285ad46, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instchp3) -STD_ROM_FN(md_instchp3) - -struct BurnDriver BurnDrvmd_instchp3 = { - "md_instchp3", "md_instch", NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (Prototype, 19941228-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchp3RomInfo, md_instchp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940101) -static struct BurnRomInfo md_instchp8RomDesc[] = { - { "instruments of chaos starring young indiana jones (prototype - jan 01, 1994).bin", 0x100000, 0x263f1a4c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instchp8) -STD_ROM_FN(md_instchp8) - -struct BurnDriver BurnDrvmd_instchp8 = { - "md_instchp8", "md_instch", NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940101)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchp8RomInfo, md_instchp8RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940103) -static struct BurnRomInfo md_instchp7RomDesc[] = { - { "instruments of chaos starring young indiana jones (prototype - jan 03, 1994).bin", 0x100000, 0x3c46d83d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instchp7) -STD_ROM_FN(md_instchp7) - -struct BurnDriver BurnDrvmd_instchp7 = { - "md_instchp7", "md_instch", NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940103)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchp7RomInfo, md_instchp7RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940126) -static struct BurnRomInfo md_instchp6RomDesc[] = { - { "instruments of chaos starring young indiana jones (prototype - jan 26, 1994).bin", 0x100000, 0xf3498542, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instchp6) -STD_ROM_FN(md_instchp6) - -struct BurnDriver BurnDrvmd_instchp6 = { - "md_instchp6", "md_instch", NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940126)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchp6RomInfo, md_instchp6RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940127) -static struct BurnRomInfo md_instchp5RomDesc[] = { - { "instruments of chaos starring young indiana jones (prototype - jan 27, 1994).bin", 0x100000, 0xf43112c3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instchp5) -STD_ROM_FN(md_instchp5) - -struct BurnDriver BurnDrvmd_instchp5 = { - "md_instchp5", "md_instch", NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940127)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchp5RomInfo, md_instchp5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940923-A) -static struct BurnRomInfo md_instchp4RomDesc[] = { - { "instruments of chaos starring young indiana jones (prototype - sep 23, 1994 - a).bin", 0x0fe3c4, 0x14443a29, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instchp4) -STD_ROM_FN(md_instchp4) - -struct BurnDriver BurnDrvmd_instchp4 = { - "md_instchp4", "md_instch", NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (Prototype, 19940923-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchp4RomInfo, md_instchp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Instruments of Chaos Starring Young Indiana Jones (Prototype, 19931228) -static struct BurnRomInfo md_instchp9RomDesc[] = { - { "instruments of chaos starring young indiana jones (prototype - dec 28, 1993).bin", 0x100000, 0x51ca641c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_instchp9) -STD_ROM_FN(md_instchp9) - -struct BurnDriver BurnDrvmd_instchp9 = { - "md_instchp9", "md_instch", NULL, NULL, "1994", - "Instruments of Chaos Starring Young Indiana Jones (Prototype, 19931228)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_instchp9RomInfo, md_instchp9RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// International Rugby (Euro) -static struct BurnRomInfo md_intrugbyRomDesc[] = { - { "international rugby (euro).bin", 0x080000, 0xd97d1699, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_intrugby) -STD_ROM_FN(md_intrugby) - -struct BurnDriver BurnDrvmd_intrugby = { - "md_intrugby", NULL, NULL, NULL, "1993", - "International Rugby (Euro)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_intrugbyRomInfo, md_intrugbyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// International Superstar Soccer Deluxe (Euro) -static struct BurnRomInfo md_issdxRomDesc[] = { - { "international superstar soccer deluxe (euro).bin", 0x200000, 0x9bb3b180, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_issdx) -STD_ROM_FN(md_issdx) - -struct BurnDriver BurnDrvmd_issdx = { - "md_issdx", NULL, NULL, NULL, "1996", - "International Superstar Soccer Deluxe (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_issdxRomInfo, md_issdxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ronaldinho 98 (Pirate) -static struct BurnRomInfo md_dinho98RomDesc[] = { - { "ronaldinho 98 (pirate).bin", 0x200000, 0xdd27c84e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dinho98) -STD_ROM_FN(md_dinho98) - -struct BurnDriver BurnDrvmd_dinho98 = { - "md_dinho98", "md_issdx", NULL, NULL, "199?", - "Ronaldinho 98 (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dinho98RomInfo, md_dinho98RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ishido - The Way of Stones (USA) -static struct BurnRomInfo md_ishidoRomDesc[] = { - { "mb834200a.bin", 0x020000, 0xb1de7d5e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ishido) -STD_ROM_FN(md_ishido) - -struct BurnDriver BurnDrvmd_ishido = { - "md_ishido", NULL, NULL, NULL, "1990", - "Ishido - The Way of Stones (USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ishidoRomInfo, md_ishidoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// It Came from the Desert (USA) -static struct BurnRomInfo md_itcameRomDesc[] = { - { "it came from the desert (usa).bin", 0x080000, 0x25afb4f7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_itcame) -STD_ROM_FN(md_itcame) - -struct BurnDriver BurnDrvmd_itcame = { - "md_itcame", NULL, NULL, NULL, "1990", - "It Came from the Desert (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_itcameRomInfo, md_itcameRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Itchy and Scratchy Game (USA, Prototype) -static struct BurnRomInfo md_itchyRomDesc[] = { - { "itchy and scratchy game, the (usa) (prototype).bin", 0x100000, 0x81b7725d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_itchy) -STD_ROM_FN(md_itchy) - -struct BurnDriver BurnDrvmd_itchy = { - "md_itchy", NULL, NULL, NULL, "1994", - "The Itchy and Scratchy Game (USA, Prototype)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_itchyRomInfo, md_itchyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Izzy's Quest for the Olympic Rings (Euro, USA) -static struct BurnRomInfo md_izzyqstRomDesc[] = { - { "izzy's quest for the olympic rings (euro, usa).bin", 0x200000, 0x77b416e4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_izzyqst) -STD_ROM_FN(md_izzyqst) - -struct BurnDriver BurnDrvmd_izzyqst = { - "md_izzyqst", NULL, NULL, NULL, "1995", - "Izzy's Quest for the Olympic Rings (Euro, USA)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_izzyqstRomInfo, md_izzyqstRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// J. League Pro Striker '93 (Jpn, v1.3) -static struct BurnRomInfo md_jlpsRomDesc[] = { - { "j. league pro striker (jpn) (v1.3).bin", 0x100000, 0x2d5b7a11, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jlps) -STD_ROM_FN(md_jlps) - -struct BurnDriver BurnDrvmd_jlps = { - "md_jlps", NULL, NULL, NULL, "1993", - "J. League Pro Striker '93 (Jpn, v1.3)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_jlpsRomInfo, md_jlpsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// J. League Pro Striker '93 (Jpn, v1.0) -static struct BurnRomInfo md_jlpsaRomDesc[] = { - { "j. league pro striker (jpn) (v1.0).bin", 0x100000, 0xec229156, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jlpsa) -STD_ROM_FN(md_jlpsa) - -struct BurnDriver BurnDrvmd_jlpsa = { - "md_jlpsa", "md_jlps", NULL, NULL, "1993", - "J. League Pro Striker '93 (Jpn, v1.0)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_jlpsaRomInfo, md_jlpsaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// J. League Pro Striker 2 (Jpn) -static struct BurnRomInfo md_jlps2RomDesc[] = { - { "mpr-16857.bin", 0x200000, 0x9fe71002, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jlps2) -STD_ROM_FN(md_jlps2) - -struct BurnDriver BurnDrvmd_jlps2 = { - "md_jlps2", NULL, NULL, NULL, "1994", - "J. League Pro Striker 2 (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_jlps2RomInfo, md_jlps2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pro Striker Final Stage (Jpn) -static struct BurnRomInfo md_prostrfsRomDesc[] = { - { "j. league pro striker final stage (jpn).bin", 0x200000, 0xe35e25fb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_prostrfs) -STD_ROM_FN(md_prostrfs) - -struct BurnDriver BurnDrvmd_prostrfs = { - "md_prostrfs", NULL, NULL, NULL, "1995", - "Pro Striker Final Stage (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_prostrfsRomInfo, md_prostrfsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// J. League Pro Striker Perfect (Jpn) -static struct BurnRomInfo md_jlpspRomDesc[] = { - { "mpr-16267.bin", 0x100000, 0x0abed379, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jlpsp) -STD_ROM_FN(md_jlpsp) - -struct BurnDriver BurnDrvmd_jlpsp = { - "md_jlpsp", NULL, NULL, NULL, "1993", - "J. League Pro Striker Perfect (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_jlpspRomInfo, md_jlpspRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jack Nicklaus' Power Challenge Golf (Euro, USA) -static struct BurnRomInfo md_nicklausRomDesc[] = { - { "jack nicklaus' power challenge golf (euro, usa).bin", 0x100000, 0x5545e909, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nicklaus) -STD_ROM_FN(md_nicklaus) - -struct BurnDriver BurnDrvmd_nicklaus = { - "md_nicklaus", NULL, NULL, NULL, "1993", - "Jack Nicklaus' Power Challenge Golf (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nicklausRomInfo, md_nicklausRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// James 'Buster' Douglas Knockout Boxing (Euro, USA) -static struct BurnRomInfo md_jbdougkoRomDesc[] = { - { "mpr-13262.bin", 0x080000, 0x87bbcf2a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jbdougko) -STD_ROM_FN(md_jbdougko) - -struct BurnDriver BurnDrvmd_jbdougko = { - "md_jbdougko", NULL, NULL, NULL, "1990", - "James 'Buster' Douglas Knockout Boxing (Euro, USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jbdougkoRomInfo, md_jbdougkoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Final Blow (Jpn) -static struct BurnRomInfo md_finalbRomDesc[] = { - { "final blow (jpn).bin", 0x080000, 0x48ad505d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_finalb) -STD_ROM_FN(md_finalb) - -struct BurnDriver BurnDrvmd_finalb = { - "md_finalb", "md_jbdougko", NULL, NULL, "1990", - "Final Blow (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_finalbRomInfo, md_finalbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// James Bond 007 - The Duel (USA) -static struct BurnRomInfo md_jb007uRomDesc[] = { - { "james bond 007 - the duel (usa).bin", 0x080000, 0x4e614548, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jb007u) -STD_ROM_FN(md_jb007u) - -struct BurnDriver BurnDrvmd_jb007u = { - "md_jb007u", "md_jb007", NULL, NULL, "1992", - "James Bond 007 - The Duel (USA)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jb007uRomInfo, md_jb007uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// James Bond 007 - The Duel (Jpn) -static struct BurnRomInfo md_jb007jRomDesc[] = { - { "007 shitou - the duel (jpn).bin", 0x080000, 0xaeb4b262, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jb007j) -STD_ROM_FN(md_jb007j) - -struct BurnDriver BurnDrvmd_jb007j = { - "md_jb007j", "md_jb007", NULL, NULL, "1993", - "James Bond 007 - The Duel (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jb007jRomInfo, md_jb007jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// James Pond II - Codename RoboCod (Jpn, Kor) -static struct BurnRomInfo md_robocodjRomDesc[] = { - { "james pond ii - codename robocod (jpn, kor).bin", 0x080000, 0x98794702, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_robocodj) -STD_ROM_FN(md_robocodj) - -struct BurnDriver BurnDrvmd_robocodj = { - "md_robocodj", "md_robocod", NULL, NULL, "1993", - "James Pond II - Codename RoboCod (Jpn, Kor)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robocodjRomInfo, md_robocodjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// James Pond 3 - Operation Starfish (Euro, USA) -static struct BurnRomInfo md_jpond3RomDesc[] = { - { "james pond 3 - operation starfish (euro, usa).bin", 0x200000, 0x26f64b2a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jpond3) -STD_ROM_FN(md_jpond3) - -struct BurnDriver BurnDrvmd_jpond3 = { - "md_jpond3", NULL, NULL, NULL, "1993", - "James Pond 3 - Operation Starfish (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jpond3RomInfo, md_jpond3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jammit (USA) -static struct BurnRomInfo md_jammitRomDesc[] = { - { "jammit (usa).bin", 0x200000, 0xd91b52b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jammit) -STD_ROM_FN(md_jammit) - -struct BurnDriver BurnDrvmd_jammit = { - "md_jammit", NULL, NULL, NULL, "1994", - "Jammit (USA)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jammitRomInfo, md_jammitRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Janou Touryuumon (Jpn) -static struct BurnRomInfo md_janoutRomDesc[] = { - { "janou touryuumon (jpn).bin", 0x100000, 0xb5ef97c6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_janout) -STD_ROM_FN(md_janout) - -struct BurnDriver BurnDrvmd_janout = { - "md_janout", NULL, NULL, NULL, "1993", - "Janou Touryuumon (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_janoutRomInfo, md_janoutRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jantei Monogatari (Jpn) -static struct BurnRomInfo md_janteiRomDesc[] = { - { "jantei monogatari (jpn).bin", 0x100000, 0x8a1b19ad, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jantei) -STD_ROM_FN(md_jantei) - -struct BurnDriver BurnDrvmd_jantei = { - "md_jantei", NULL, NULL, NULL, "1991", - "Jantei Monogatari (Jpn)\0", NULL, "Reno", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_janteiRomInfo, md_janteiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jelly Boy (Euro, Prototype) -static struct BurnRomInfo md_jellyboyRomDesc[] = { - { "jelly boy (euro) (prototype).bin", 0x100000, 0x7cfadc16, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jellyboy) -STD_ROM_FN(md_jellyboy) - -struct BurnDriver BurnDrvmd_jellyboy = { - "md_jellyboy", NULL, NULL, NULL, "199?", - "Jelly Boy (Euro, Prototype)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jellyboyRomInfo, md_jellyboyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jeopardy! (USA) -static struct BurnRomInfo md_jeopardyRomDesc[] = { - { "jeopardy! (usa).bin", 0x080000, 0x56cff3f1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jeopardy) -STD_ROM_FN(md_jeopardy) - -struct BurnDriver BurnDrvmd_jeopardy = { - "md_jeopardy", NULL, NULL, NULL, "1992", - "Jeopardy! (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jeopardyRomInfo, md_jeopardyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jeopardy! Deluxe (USA) -static struct BurnRomInfo md_jeoparddRomDesc[] = { - { "jeopardy! deluxe (usa).bin", 0x080000, 0x25e2f9d2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jeopardd) -STD_ROM_FN(md_jeopardd) - -struct BurnDriver BurnDrvmd_jeopardd = { - "md_jeopardd", NULL, NULL, NULL, "1993", - "Jeopardy! Deluxe (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jeoparddRomInfo, md_jeoparddRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jeopardy! Sports Edition (USA) -static struct BurnRomInfo md_jeopardsRomDesc[] = { - { "jeopardy! sports edition (usa).bin", 0x080000, 0x13f924d2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jeopards) -STD_ROM_FN(md_jeopards) - -struct BurnDriver BurnDrvmd_jeopards = { - "md_jeopards", NULL, NULL, NULL, "1993", - "Jeopardy! Sports Edition (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jeopardsRomInfo, md_jeopardsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jerry Glanville's Pigskin Footbrawl (USA) -static struct BurnRomInfo md_pigskinfRomDesc[] = { - { "jerry glanville's pigskin footbrawl (usa).bin", 0x100000, 0xe7f48d30, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pigskinf) -STD_ROM_FN(md_pigskinf) - -struct BurnDriver BurnDrvmd_pigskinf = { - "md_pigskinf", NULL, NULL, NULL, "1992", - "Jerry Glanville's Pigskin Footbrawl (USA)\0", NULL, "Razorsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pigskinfRomInfo, md_pigskinfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jewel Master (Jpn) -static struct BurnRomInfo md_jewelmsjRomDesc[] = { - { "jewel master (jpn).bin", 0x080000, 0x2cf6926c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jewelmsj) -STD_ROM_FN(md_jewelmsj) - -struct BurnDriver BurnDrvmd_jewelmsj = { - "md_jewelmsj", "md_jewelms", NULL, NULL, "1991", - "Jewel Master (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jewelmsjRomInfo, md_jewelmsjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jim Power - The Arcade Game (USA, Prototype) -static struct BurnRomInfo md_jimpowerRomDesc[] = { - { "jim power - the arcade game (usa) (prototype) (bad dump).bin", 0x100000, 0x1cf3238b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jimpower) -STD_ROM_FN(md_jimpower) - -struct BurnDriver BurnDrvmd_jimpower = { - "md_jimpower", NULL, NULL, NULL, "199?", - "Jim Power - The Arcade Game (USA, Prototype)\0", "imperfect graphics", "Loriciel", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jimpowerRomInfo, md_jimpowerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jimmy White's Whirlwind Snooker (Euro) -static struct BurnRomInfo md_jimmywwsRomDesc[] = { - { "jimmy white's whirlwind snooker (euro).bin", 0x080000, 0x0aef5b1f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jimmywws) -STD_ROM_FN(md_jimmywws) - -struct BurnDriver BurnDrvmd_jimmywws = { - "md_jimmywws", NULL, NULL, NULL, "1991", - "Jimmy White's Whirlwind Snooker (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jimmywwsRomInfo, md_jimmywwsRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jiu Ji Ma Jiang II - Ye Yan Bian (Chi) -static struct BurnRomInfo md_jiujimRomDesc[] = { - { "jiu ji ma jiang ii - ye yan bian (chi) (unl).bin", 0x100000, 0xe9829b22, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jiujim) -STD_ROM_FN(md_jiujim) - -struct BurnDriver BurnDrvmd_jiujim = { - "md_jiujim", NULL, NULL, NULL, "199?", - "Jiu Ji Ma Jiang II - Ye Yan Bian (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jiujimRomInfo, md_jiujimRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Joe & Mac (USA) -static struct BurnRomInfo md_joemacRomDesc[] = { - { "joe & mac (usa).bin", 0x100000, 0x85bcc1c7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_joemac) -STD_ROM_FN(md_joemac) - -struct BurnDriver BurnDrvmd_joemac = { - "md_joemac", NULL, NULL, NULL, "1991", - "Joe & Mac (USA)\0", NULL, "Takara", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_joemacRomInfo, md_joemacRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Joe Montana Football (World) -static struct BurnRomInfo md_joemontRomDesc[] = { - { "mpr-13654.bin", 0x080000, 0x8aa6a1dd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_joemont) -STD_ROM_FN(md_joemont) - -struct BurnDriver BurnDrvmd_joemont = { - "md_joemont", NULL, NULL, NULL, "1990", - "Joe Montana Football (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_joemontRomInfo, md_joemontRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Joe Montana II Sports Talk Football (World, Rev. A) -static struct BurnRomInfo md_joemont2RomDesc[] = { - { "mpr-14356a.bin", 0x100000, 0xa45da893, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_joemont2) -STD_ROM_FN(md_joemont2) - -struct BurnDriver BurnDrvmd_joemont2 = { - "md_joemont2", NULL, NULL, NULL, "1991", - "Joe Montana II Sports Talk Football (World, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_joemont2RomInfo, md_joemont2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// John Madden Football '92 (Euro, USA) -static struct BurnRomInfo md_madden92RomDesc[] = { - { "john madden football '92 (euro, usa).bin", 0x080000, 0x046e3945, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madden92) -STD_ROM_FN(md_madden92) - -struct BurnDriver BurnDrvmd_madden92 = { - "md_madden92", NULL, NULL, NULL, "1991", - "John Madden Football '92 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_madden92RomInfo, md_madden92RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// John Madden Football '93 (Euro, USA) -static struct BurnRomInfo md_madden93RomDesc[] = { - { "jmf302.bin", 0x100000, 0xca323b3e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madden93) -STD_ROM_FN(md_madden93) - -struct BurnDriver BurnDrvmd_madden93 = { - "md_madden93", NULL, NULL, NULL, "1992", - "John Madden Football '93 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_madden93RomInfo, md_madden93RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// John Madden Football '93 - Championship Edition (USA) -static struct BurnRomInfo md_madd93ceRomDesc[] = { - { "john madden football '93 - championship edition (usa).bin", 0x100000, 0xca534b1a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madd93ce) -STD_ROM_FN(md_madd93ce) - -struct BurnDriver BurnDrvmd_madd93ce = { - "md_madd93ce", NULL, NULL, NULL, "1992", - "John Madden Football '93 - Championship Edition (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_madd93ceRomInfo, md_madd93ceRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// John Madden Football (Euro, USA) -static struct BurnRomInfo md_maddenRomDesc[] = { - { "john madden football (euro, usa).bin", 0x080000, 0x90fb8818, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madden) -STD_ROM_FN(md_madden) - -struct BurnDriver BurnDrvmd_madden = { - "md_madden", NULL, NULL, NULL, "1990", - "John Madden Football (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_maddenRomInfo, md_maddenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// John Madden Football - Pro Football (Jpn) -static struct BurnRomInfo md_maddenjRomDesc[] = { - { "john madden football - pro football (jpn).bin", 0x080000, 0x0460611c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_maddenj) -STD_ROM_FN(md_maddenj) - -struct BurnDriver BurnDrvmd_maddenj = { - "md_maddenj", "md_madden", NULL, NULL, "1992", - "John Madden Football - Pro Football (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_maddenjRomInfo, md_maddenjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super One on One - Jordan Vs Bird (Euro, USA, v1.1) -static struct BurnRomInfo md_jordanbRomDesc[] = { - { "jordan vs bird (euro, usa) (v1.1).bin", 0x080000, 0x4d3ddd7c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jordanb) -STD_ROM_FN(md_jordanb) - -struct BurnDriver BurnDrvmd_jordanb = { - "md_jordanb", NULL, NULL, NULL, "1992", - "Super One on One - Jordan Vs Bird (Euro, USA, v1.1)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jordanbRomInfo, md_jordanbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super One on One - Jordan Vs Bird (Euro, USA) -static struct BurnRomInfo md_jordanb1RomDesc[] = { - { "jordan vs bird (euro, usa).bin", 0x080000, 0x22d77e6d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jordanb1) -STD_ROM_FN(md_jordanb1) - -struct BurnDriver BurnDrvmd_jordanb1 = { - "md_jordanb1", "md_jordanb", NULL, NULL, "1992", - "Super One on One - Jordan Vs Bird (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jordanb1RomInfo, md_jordanb1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super One on One - Jordan Vs Bird (Jpn) -static struct BurnRomInfo md_jordanbjRomDesc[] = { - { "jordan vs bird - one on one (jpn).bin", 0x080000, 0x8837e896, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jordanbj) -STD_ROM_FN(md_jordanbj) - -struct BurnDriver BurnDrvmd_jordanbj = { - "md_jordanbj", "md_jordanb", NULL, NULL, "1993", - "Super One on One - Jordan Vs Bird (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jordanbjRomInfo, md_jordanbjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Joshua & The Battle of Jericho (USA) -static struct BurnRomInfo md_joshuaRomDesc[] = { - { "joshua & the battle of jericho (usa) (unl).bin", 0x040000, 0xda9e25aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_joshua) -STD_ROM_FN(md_joshua) - -struct BurnDriver BurnDrvmd_joshua = { - "md_joshua", NULL, NULL, NULL, "1992", - "Joshua & The Battle of Jericho (USA)\0", NULL, "Wisdom Tree", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_joshuaRomInfo, md_joshuaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Judge Dredd (World) -static struct BurnRomInfo md_jdreddRomDesc[] = { - { "judge dredd (world).bin", 0x200000, 0xea342ed8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jdredd) -STD_ROM_FN(md_jdredd) - -struct BurnDriver BurnDrvmd_jdredd = { - "md_jdredd", NULL, NULL, NULL, "1995", - "Judge Dredd (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jdreddRomInfo, md_jdreddRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Judge Dredd (USA, Prototype, Alt) -static struct BurnRomInfo md_jdreddp2RomDesc[] = { - { "judge dredd (usa) (beta) (alt).bin", 0x200000, 0xe649f784, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jdreddp2) -STD_ROM_FN(md_jdreddp2) - -struct BurnDriver BurnDrvmd_jdreddp2 = { - "md_jdreddp2", "md_jdredd", NULL, NULL, "1995", - "Judge Dredd (USA, Prototype, Alt)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jdreddp2RomInfo, md_jdreddp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Judge Dredd (USA, Prototype) -static struct BurnRomInfo md_jdreddp1RomDesc[] = { - { "judge dredd (usa) (beta).bin", 0x200000, 0x8d46f4da, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jdreddp1) -STD_ROM_FN(md_jdreddp1) - -struct BurnDriver BurnDrvmd_jdreddp1 = { - "md_jdreddp1", "md_jdredd", NULL, NULL, "1995", - "Judge Dredd (USA, Prototype)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jdreddp1RomInfo, md_jdreddp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Junction (Jpn, USA) -static struct BurnRomInfo md_junctionRomDesc[] = { - { "junction (usa, jpn).bin", 0x080000, 0x94cdce8d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_junction) -STD_ROM_FN(md_junction) - -struct BurnDriver BurnDrvmd_junction = { - "md_junction", NULL, NULL, NULL, "1990", - "Junction (Jpn, USA)\0", NULL, "Micronet", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_junctionRomInfo, md_junctionRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Disney's The Jungle Book (Euro) -static struct BurnRomInfo md_jungleRomDesc[] = { - { "jungle book, the (euro).bin", 0x200000, 0xb9709a99, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jungle) -STD_ROM_FN(md_jungle) - -struct BurnDriver BurnDrvmd_jungle = { - "md_jungle", NULL, NULL, NULL, "1994", - "Disney's The Jungle Book (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jungleRomInfo, md_jungleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Disney's The Jungle Book (USA) -static struct BurnRomInfo md_jungleuRomDesc[] = { - { "jungle book, the (usa).bin", 0x200000, 0x3fb6d92e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jungleu) -STD_ROM_FN(md_jungleu) - -struct BurnDriver BurnDrvmd_jungleu = { - "md_jungleu", "md_jungle", NULL, NULL, "1994", - "Disney's The Jungle Book (USA)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jungleuRomInfo, md_jungleuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jungle Strike (Euro, USA) -static struct BurnRomInfo md_jstrikeRomDesc[] = { - { "jungle strike (euro, usa).bin", 0x200000, 0xa5d29735, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jstrike) -STD_ROM_FN(md_jstrike) - -struct BurnDriver BurnDrvmd_jstrike = { - "md_jstrike", NULL, NULL, NULL, "1993", - "Jungle Strike (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jstrikeRomInfo, md_jstrikeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jungle Strike (USA, Prototype) -static struct BurnRomInfo md_jstrikepRomDesc[] = { - { "jungle strike (usa) (beta).bin", 0x200000, 0x0cd540d4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jstrikep) -STD_ROM_FN(md_jstrikep) - -struct BurnDriver BurnDrvmd_jstrikep = { - "md_jstrikep", "md_jstrike", NULL, NULL, "1993", - "Jungle Strike (USA, Prototype)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jstrikepRomInfo, md_jstrikepRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jungle Strike - Uketsugareta Kyouki (Jpn) -static struct BurnRomInfo md_jstrikejRomDesc[] = { - { "jungle strike - uketsugareta kyouki (jpn).bin", 0x200000, 0xba7a870b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jstrikej) -STD_ROM_FN(md_jstrikej) - -struct BurnDriver BurnDrvmd_jstrikej = { - "md_jstrikej", "md_jstrike", NULL, NULL, "1993", - "Jungle Strike - Uketsugareta Kyouki (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jstrikejRomInfo, md_jstrikejRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park (Euro) -static struct BurnRomInfo md_jparkRomDesc[] = { - { "mpr-15679.bin", 0x200000, 0x448341f6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jpark) -STD_ROM_FN(md_jpark) - -struct BurnDriver BurnDrvmd_jpark = { - "md_jpark", NULL, NULL, NULL, "1993", - "Jurassic Park (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkRomInfo, md_jparkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park (Jpn) -static struct BurnRomInfo md_jparkjRomDesc[] = { - { "jurassic park (jpn).bin", 0x200000, 0xec8e5783, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkj) -STD_ROM_FN(md_jparkj) - -struct BurnDriver BurnDrvmd_jparkj = { - "md_jparkj", "md_jpark", NULL, NULL, "1993", - "Jurassic Park (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkjRomInfo, md_jparkjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park (USA) -static struct BurnRomInfo md_jparkuRomDesc[] = { - { "jurassic park (usa).bin", 0x200000, 0x7b31deef, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparku) -STD_ROM_FN(md_jparku) - -struct BurnDriver BurnDrvmd_jparku = { - "md_jparku", "md_jpark", NULL, NULL, "1993", - "Jurassic Park (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkuRomInfo, md_jparkuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park (USA, Prototype) -static struct BurnRomInfo md_jparkupRomDesc[] = { - { "jurassic park (usa) (beta).bin", 0x200000, 0xcf890eed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkup) -STD_ROM_FN(md_jparkup) - -struct BurnDriver BurnDrvmd_jparkup = { - "md_jparkup", "md_jpark", NULL, NULL, "1993", - "Jurassic Park (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkupRomInfo, md_jparkupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Euro, USA) -static struct BurnRomInfo md_jparkreRomDesc[] = { - { "jurassic park - rampage edition (euro, usa).bin", 0x200000, 0x98b4aa1b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkre) -STD_ROM_FN(md_jparkre) - -struct BurnDriver BurnDrvmd_jparkre = { - "md_jparkre", NULL, NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkreRomInfo, md_jparkreRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Prototype, 19940708) -static struct BurnRomInfo md_jparkrep6RomDesc[] = { - { "jurassic park - rampage edition (prototype - jul 08, 1994).bin", 0x200000, 0xf4c78bd0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkrep6) -STD_ROM_FN(md_jparkrep6) - -struct BurnDriver BurnDrvmd_jparkrep6 = { - "md_jparkrep6", "md_jparkre", NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Prototype, 19940708)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkrep6RomInfo, md_jparkrep6RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Prototype, 19940713) -static struct BurnRomInfo md_jparkrep5RomDesc[] = { - { "jurassic park - rampage edition (prototype - jul 13, 1994).bin", 0x200000, 0x8475a105, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkrep5) -STD_ROM_FN(md_jparkrep5) - -struct BurnDriver BurnDrvmd_jparkrep5 = { - "md_jparkrep5", "md_jparkre", NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Prototype, 19940713)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkrep5RomInfo, md_jparkrep5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Prototype, 19940714) -static struct BurnRomInfo md_jparkrep4RomDesc[] = { - { "jurassic park - rampage edition (prototype - jul 14, 1994).bin", 0x200000, 0x9bf0e28d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkrep4) -STD_ROM_FN(md_jparkrep4) - -struct BurnDriver BurnDrvmd_jparkrep4 = { - "md_jparkrep4", "md_jparkre", NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Prototype, 19940714)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkrep4RomInfo, md_jparkrep4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Prototype, 19940715) -static struct BurnRomInfo md_jparkrep3RomDesc[] = { - { "jurassic park - rampage edition (prototype - jul 15, 1994).bin", 0x200000, 0xd2202be5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkrep3) -STD_ROM_FN(md_jparkrep3) - -struct BurnDriver BurnDrvmd_jparkrep3 = { - "md_jparkrep3", "md_jparkre", NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Prototype, 19940715)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkrep3RomInfo, md_jparkrep3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Prototype, 19940717) -static struct BurnRomInfo md_jparkrep2RomDesc[] = { - { "jurassic park - rampage edition (prototype - jul 17, 1994).bin", 0x200000, 0x2eae6140, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkrep2) -STD_ROM_FN(md_jparkrep2) - -struct BurnDriver BurnDrvmd_jparkrep2 = { - "md_jparkrep2", "md_jparkre", NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Prototype, 19940717)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkrep2RomInfo, md_jparkrep2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Prototype, 19940718) -static struct BurnRomInfo md_jparkrep1RomDesc[] = { - { "jurassic park - rampage edition (prototype - jul 18, 1994).bin", 0x200000, 0x1a62b826, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkrep1) -STD_ROM_FN(md_jparkrep1) - -struct BurnDriver BurnDrvmd_jparkrep1 = { - "md_jparkrep1", "md_jparkre", NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Prototype, 19940718)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkrep1RomInfo, md_jparkrep1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Prototype, 19940620) -static struct BurnRomInfo md_jparkrep9RomDesc[] = { - { "jurassic park - rampage edition (prototype - jun 20, 1994).bin", 0x1f6e60, 0x1280fa5c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkrep9) -STD_ROM_FN(md_jparkrep9) - -struct BurnDriver BurnDrvmd_jparkrep9 = { - "md_jparkrep9", "md_jparkre", NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Prototype, 19940620)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkrep9RomInfo, md_jparkrep9RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Prototype, 19940622) -static struct BurnRomInfo md_jparkrep8RomDesc[] = { - { "jurassic park - rampage edition (prototype - jun 22, 1994).bin", 0x200000, 0x53582f2b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkrep8) -STD_ROM_FN(md_jparkrep8) - -struct BurnDriver BurnDrvmd_jparkrep8 = { - "md_jparkrep8", "md_jparkre", NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Prototype, 19940622)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkrep8RomInfo, md_jparkrep8RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jurassic Park - Rampage Edition (Prototype, 19940630) -static struct BurnRomInfo md_jparkrep7RomDesc[] = { - { "jurassic park - rampage edition (prototype - jun 30, 1994).bin", 0x200000, 0xbff4b396, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jparkrep7) -STD_ROM_FN(md_jparkrep7) - -struct BurnDriver BurnDrvmd_jparkrep7 = { - "md_jparkrep7", "md_jparkre", NULL, NULL, "1994", - "Jurassic Park - Rampage Edition (Prototype, 19940630)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jparkrep7RomInfo, md_jparkrep7RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Justice League Task Force (World) -static struct BurnRomInfo md_jleagueRomDesc[] = { - { "justice league task force (world).bin", 0x300000, 0x2a60ebe9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_jleague) -STD_ROM_FN(md_jleague) - -struct BurnDriver BurnDrvmd_jleague = { - "md_jleague", NULL, NULL, NULL, "1995", - "Justice League Task Force (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_jleagueRomInfo, md_jleagueRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ka-Ge-Ki - Fists of Steel (USA) -static struct BurnRomInfo md_kagekiRomDesc[] = { - { "ka-ge-ki - fists of steel (usa).bin", 0x100000, 0xeffc0fa6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kageki) -STD_ROM_FN(md_kageki) - -struct BurnDriver BurnDrvmd_kageki = { - "md_kageki", NULL, NULL, NULL, "1991", - "Ka-Ge-Ki - Fists of Steel (USA)\0", NULL, "Sage's Creation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kagekiRomInfo, md_kagekiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ka-Ge-Ki (Jpn) -static struct BurnRomInfo md_kagekijRomDesc[] = { - { "ka-ge-ki (jpn).bin", 0x100000, 0x391866a1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kagekij) -STD_ROM_FN(md_kagekij) - -struct BurnDriver BurnDrvmd_kagekij = { - "md_kagekij", "md_kageki", NULL, NULL, "1991", - "Ka-Ge-Ki (Jpn)\0", NULL, "Hot-B", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kagekijRomInfo, md_kagekijRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kawasaki Superbike Challenge (Euro, USA) -static struct BurnRomInfo md_kawasakiRomDesc[] = { - { "kawasaki superbike challenge (euro, usa).bin", 0x100000, 0x631cc8e9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kawasaki) -STD_ROM_FN(md_kawasaki) - -struct BurnDriver BurnDrvmd_kawasaki = { - "md_kawasaki", NULL, NULL, NULL, "1994", - "Kawasaki Superbike Challenge (Euro, USA)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kawasakiRomInfo, md_kawasakiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kawasaki Superbike Challenge (USA, Prototype) -static struct BurnRomInfo md_kawasakipRomDesc[] = { - { "kawasaki superbike challenge (usa) (beta).bin", 0x100000, 0x55934d1b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kawasakip) -STD_ROM_FN(md_kawasakip) - -struct BurnDriver BurnDrvmd_kawasakip = { - "md_kawasakip", "md_kawasaki", NULL, NULL, "1994", - "Kawasaki Superbike Challenge (USA, Prototype)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kawasakipRomInfo, md_kawasakipRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kick Off 3 - European Challenge (Euro) -static struct BurnRomInfo md_kickoff3RomDesc[] = { - { "kick off 3 - european challenge (euro).bin", 0x100000, 0xbc37401a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kickoff3) -STD_ROM_FN(md_kickoff3) - -struct BurnDriver BurnDrvmd_kickoff3 = { - "md_kickoff3", NULL, NULL, NULL, "1994", - "Kick Off 3 - European Challenge (Euro)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kickoff3RomInfo, md_kickoff3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chameleon Kid (Jpn) -static struct BurnRomInfo md_kidchamjRomDesc[] = { - { "chameleon kid (jpn).bin", 0x100000, 0x50217c80, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kidchamj) -STD_ROM_FN(md_kidchamj) - -struct BurnDriver BurnDrvmd_kidchamj = { - "md_kidchamj", "md_kidcham", NULL, NULL, "1992", - "Chameleon Kid (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kidchamjRomInfo, md_kidchamjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kidou Keisatsu Patlabor - 98-shiki Kidou Seyo! (Jpn) -static struct BurnRomInfo md_patlaborRomDesc[] = { - { "kidou keisatsu patlabor - 98-shiki kidou seyo! (jpn).bin", 0x080000, 0x21a0e749, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_patlabor) -STD_ROM_FN(md_patlabor) - -struct BurnDriver BurnDrvmd_patlabor = { - "md_patlabor", NULL, NULL, NULL, "1992", - "Kidou Keisatsu Patlabor - 98-shiki Kidou Seyo! (Jpn)\0", NULL, "Ma-Ba", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_patlaborRomInfo, md_patlaborRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tougiou King Colossus (Jpn) -static struct BurnRomInfo md_kingcolRomDesc[] = { - { "mpr-14929.bin", 0x100000, 0xffe7b3c7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kingcol) -STD_ROM_FN(md_kingcol) - -struct BurnDriver BurnDrvmd_kingcol = { - "md_kingcol", NULL, NULL, NULL, "1992", - "Tougiou King Colossus (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_kingcolRomInfo, md_kingcolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// King of the Monsters (Euro) -static struct BurnRomInfo md_kotmRomDesc[] = { - { "king of the monsters (euro).bin", 0x100000, 0x7a94fd49, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kotm) -STD_ROM_FN(md_kotm) - -struct BurnDriver BurnDrvmd_kotm = { - "md_kotm", NULL, NULL, NULL, "1993", - "King of the Monsters (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kotmRomInfo, md_kotmRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// King of the Monsters (USA) -static struct BurnRomInfo md_kotmuRomDesc[] = { - { "king of the monsters (usa).bin", 0x100000, 0xf390d406, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kotmu) -STD_ROM_FN(md_kotmu) - -struct BurnDriver BurnDrvmd_kotmu = { - "md_kotmu", "md_kotm", NULL, NULL, "1993", - "King of the Monsters (USA)\0", NULL, "Takara", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kotmuRomInfo, md_kotmuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// King of the Monsters (Jpn) -static struct BurnRomInfo md_kotmjRomDesc[] = { - { "king of the monsters (jpn).bin", 0x100000, 0x3af7e74e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kotmj) -STD_ROM_FN(md_kotmj) - -struct BurnDriver BurnDrvmd_kotmj = { - "md_kotmj", "md_kotm", NULL, NULL, "1993", - "King of the Monsters (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kotmjRomInfo, md_kotmjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// King of the Monsters 2 (USA) -static struct BurnRomInfo md_kotm2RomDesc[] = { - { "king of the monsters 2 (usa).bin", 0x200000, 0xee1638ac, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kotm2) -STD_ROM_FN(md_kotm2) - -struct BurnDriver BurnDrvmd_kotm2 = { - "md_kotm2", NULL, NULL, NULL, "1994", - "King of the Monsters 2 (USA)\0", NULL, "Takara", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kotm2RomInfo, md_kotm2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// King Salmon - The Big Catch (USA) -static struct BurnRomInfo md_kingsalRomDesc[] = { - { "king salmon - the big catch (usa).bin", 0x080000, 0xf516e7d9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kingsal) -STD_ROM_FN(md_kingsal) - -struct BurnDriver BurnDrvmd_kingsal = { - "md_kingsal", NULL, NULL, NULL, "1993", - "King Salmon - The Big Catch (USA)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kingsalRomInfo, md_kingsalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// King Salmon (Jpn) -static struct BurnRomInfo md_kingsaljRomDesc[] = { - { "king salmon (jpn).bin", 0x080000, 0x2cfc9f61, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kingsalj) -STD_ROM_FN(md_kingsalj) - -struct BurnDriver BurnDrvmd_kingsalj = { - "md_kingsalj", "md_kingsal", NULL, NULL, "1992", - "King Salmon (Jpn)\0", NULL, "Hot-B", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kingsaljRomInfo, md_kingsaljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// King's Bounty - The Conqueror's Quest (Euro, USA) -static struct BurnRomInfo md_kingsbtyRomDesc[] = { - { "king's bounty - the conqueror's quest (euro, usa).bin", 0x080000, 0xaa68a92e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kingsbty) -STD_ROM_FN(md_kingsbty) - -struct BurnDriver BurnDrvmd_kingsbty = { - "md_kingsbty", NULL, NULL, NULL, "1991", - "King's Bounty - The Conqueror's Quest (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kingsbtyRomInfo, md_kingsbtyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kishi Densetsu (Jpn) -static struct BurnRomInfo md_kishidenRomDesc[] = { - { "kishi densetsu (jpn).bin", 0x180000, 0x22e1f04a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kishiden) -STD_ROM_FN(md_kishiden) - -struct BurnDriver BurnDrvmd_kishiden = { - "md_kishiden", NULL, NULL, NULL, "1993", - "Kishi Densetsu (Jpn)\0", NULL, "Kodansha", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_kishidenRomInfo, md_kishidenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kiss Shot (Jpn, SegaNet) -static struct BurnRomInfo md_kissshotRomDesc[] = { - { "kiss shot (jpn) (sn).bin", 0x040000, 0xe487088c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kissshot) -STD_ROM_FN(md_kissshot) - -struct BurnDriver BurnDrvmd_kissshot = { - "md_kissshot", NULL, NULL, NULL, "1991", - "Kiss Shot (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kissshotRomInfo, md_kissshotRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Klax (Euro, USA) -static struct BurnRomInfo md_klaxRomDesc[] = { - { "klax (euro, usa).bin", 0x040000, 0x248cd09e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_klax) -STD_ROM_FN(md_klax) - -struct BurnDriver BurnDrvmd_klax = { - "md_klax", NULL, NULL, NULL, "1990", - "Klax (Euro, USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_klaxRomInfo, md_klaxRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Klax (Jpn) -static struct BurnRomInfo md_klaxjRomDesc[] = { - { "klax (jpn).bin", 0x040000, 0x1afcc1da, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_klaxj) -STD_ROM_FN(md_klaxj) - -struct BurnDriver BurnDrvmd_klaxj = { - "md_klaxj", "md_klax", NULL, NULL, "1990", - "Klax (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_klaxjRomInfo, md_klaxjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Krusty's Super Fun House (Euro, USA, v1.1) -static struct BurnRomInfo md_krustyRomDesc[] = { - { "krusty's super fun house (euro, usa) (v1.1).bin", 0x080000, 0x56976261, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_krusty) -STD_ROM_FN(md_krusty) - -struct BurnDriver BurnDrvmd_krusty = { - "md_krusty", NULL, NULL, NULL, "1992", - "Krusty's Super Fun House (Euro, USA, v1.1)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_krustyRomInfo, md_krustyRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Krusty's Super Fun House (Euro, USA) -static struct BurnRomInfo md_krusty1RomDesc[] = { - { "krusty's super fun house (euro, usa).bin", 0x080000, 0xf764005e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_krusty1) -STD_ROM_FN(md_krusty1) - -struct BurnDriver BurnDrvmd_krusty1 = { - "md_krusty1", "md_krusty", NULL, NULL, "1992", - "Krusty's Super Fun House (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_krusty1RomInfo, md_krusty1RomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kyuukai Douchuuki (Jpn) -static struct BurnRomInfo md_kyukaidkRomDesc[] = { - { "kyuukai douchuuki (jpn).bin", 0x080000, 0xde48dce3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kyukaidk) -STD_ROM_FN(md_kyukaidk) - -struct BurnDriver BurnDrvmd_kyukaidk = { - "md_kyukaidk", NULL, NULL, NULL, "1991", - "Kyuukai Douchuuki (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kyukaidkRomInfo, md_kyukaidkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// La Russa Baseball 95 (USA, Oceania) -static struct BurnRomInfo md_laruss95RomDesc[] = { - { "la russa baseball 95 (usa, aus).bin", 0x200000, 0x3f848a92, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_laruss95) -STD_ROM_FN(md_laruss95) - -struct BurnDriver BurnDrvmd_laruss95 = { - "md_laruss95", NULL, NULL, NULL, "1994", - "La Russa Baseball 95 (USA, Oceania)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_laruss95RomInfo, md_laruss95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lakers versus Celtics and the NBA Playoffs (USA) -static struct BurnRomInfo md_lakersRomDesc[] = { - { "lakers versus celtics and the nba playoffs (usa).bin", 0x080000, 0x0e33fc75, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lakers) -STD_ROM_FN(md_lakers) - -struct BurnDriver BurnDrvmd_lakers = { - "md_lakers", NULL, NULL, NULL, "1991", - "Lakers versus Celtics and the NBA Playoffs (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lakersRomInfo, md_lakersRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Landstalker - The Treasures of King Nole (Euro) -static struct BurnRomInfo md_landstlkRomDesc[] = { - { "landstalker - the treasures of king nole (euro).bin", 0x200000, 0xe3c65277, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_landstlk) -STD_ROM_FN(md_landstlk) - -struct BurnDriver BurnDrvmd_landstlk = { - "md_landstlk", NULL, NULL, NULL, "1993", - "Landstalker - The Treasures of King Nole (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM | HARDWARE_SEGA_MEGADRIVE_SRAM_10000, GBF_MISC, 0, - MegadriveGetZipName, md_landstlkRomInfo, md_landstlkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Landstalker - Die Schtze von Knig Nolo (Ger) -static struct BurnRomInfo md_landstlkgRomDesc[] = { - { "landstalker - die schatze von konig nolo (germany).bin", 0x200000, 0x10fedb8f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_landstlkg) -STD_ROM_FN(md_landstlkg) - -struct BurnDriver BurnDrvmd_landstlkg = { - "md_landstlkg", "md_landstlk", NULL, NULL, "1993", - "Landstalker - Die Schatze von Konig Nolo (Ger)\0", NULL, "Sega", "Sega Megadrive", - L"Landstalker - Die Sch\u00E4tze von K\u00F6nig Nolo (Ger)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM | HARDWARE_SEGA_MEGADRIVE_SRAM_10000, GBF_MISC, 0, - MegadriveGetZipName, md_landstlkgRomInfo, md_landstlkgRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Landstalker - Koutei no Zaihou (Jpn) -static struct BurnRomInfo md_landstlkjRomDesc[] = { - { "landstalker - koutei no zaihou (jpn).bin", 0x200000, 0x60d4cedb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_landstlkj) -STD_ROM_FN(md_landstlkj) - -struct BurnDriver BurnDrvmd_landstlkj = { - "md_landstlkj", "md_landstlk", NULL, NULL, "1992", - "Landstalker - Koutei no Zaihou (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM | HARDWARE_SEGA_MEGADRIVE_SRAM_10000, GBF_MISC, 0, - MegadriveGetZipName, md_landstlkjRomInfo, md_landstlkjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Landstalker - The Treasures of King Nole (USA) -static struct BurnRomInfo md_landstlkuRomDesc[] = { - { "landstalker (usa).bin", 0x200000, 0xfbbb5b97, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_landstlku) -STD_ROM_FN(md_landstlku) - -struct BurnDriver BurnDrvmd_landstlku = { - "md_landstlku", "md_landstlk", NULL, NULL, "1992", - "Landstalker - The Treasures of King Nole (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM | HARDWARE_SEGA_MEGADRIVE_SRAM_10000, GBF_MISC, 0, - MegadriveGetZipName, md_landstlkuRomInfo, md_landstlkuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Landstalker - Treasure of King Nole (USA, Prototype) -static struct BurnRomInfo md_landstlkupRomDesc[] = { - { "landstalker (usa) (beta).bin", 0x200000, 0x70483d03, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_landstlkup) -STD_ROM_FN(md_landstlkup) - -struct BurnDriver BurnDrvmd_landstlkup = { - "md_landstlkup", "md_landstlk", NULL, NULL, "1992", - "Landstalker - Treasure of King Nole (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM | HARDWARE_SEGA_MEGADRIVE_SRAM_10000, GBF_MISC, 0, - MegadriveGetZipName, md_landstlkupRomInfo, md_landstlkupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Langrisser (Jpn) -static struct BurnRomInfo md_langrissRomDesc[] = { - { "mpr-13845.bin", 0x080000, 0xb6ea5016, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_langriss) -STD_ROM_FN(md_langriss) - -struct BurnDriver BurnDrvmd_langriss = { - "md_langriss", "md_warsong", NULL, NULL, "1991", - "Langrisser (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_langrissRomInfo, md_langrissRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Langrisser II (Jpn, v1.2) -static struct BurnRomInfo md_langris2RomDesc[] = { - { "langrisser ii (jpn) (v1.2).bin", 0x200000, 0x4967c9f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_langris2) -STD_ROM_FN(md_langris2) - -struct BurnDriver BurnDrvmd_langris2 = { - "md_langris2", NULL, NULL, NULL, "1994", - "Langrisser II (Jpn, v1.2)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_langris2RomInfo, md_langris2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Langrisser II (Jpn, v1.1) -static struct BurnRomInfo md_langris2aRomDesc[] = { - { "langrisser ii (jpn) (v1.1).bin", 0x200000, 0x0caa0593, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_langris2a) -STD_ROM_FN(md_langris2a) - -struct BurnDriver BurnDrvmd_langris2a = { - "md_langris2a", "md_langris2", NULL, NULL, "1994", - "Langrisser II (Jpn, v1.1)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_langris2aRomInfo, md_langris2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Langrisser II (Jpn) -static struct BurnRomInfo md_langris2bRomDesc[] = { - { "langrisser ii (jpn).bin", 0x200000, 0x7f891dfc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_langris2b) -STD_ROM_FN(md_langris2b) - -struct BurnDriver BurnDrvmd_langris2b = { - "md_langris2b", "md_langris2", NULL, NULL, "1994", - "Langrisser II (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_langris2bRomInfo, md_langris2bRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Last Action Hero (Euro, USA) -static struct BurnRomInfo md_lastactRomDesc[] = { - { "last action hero (euro, usa).bin", 0x100000, 0x15357dde, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lastact) -STD_ROM_FN(md_lastact) - -struct BurnDriver BurnDrvmd_lastact = { - "md_lastact", NULL, NULL, NULL, "1993", - "Last Action Hero (Euro, USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lastactRomInfo, md_lastactRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Last Battle (Euro, USA, Kor) -static struct BurnRomInfo md_lastbtleRomDesc[] = { - { "mpr-12578.bin", 0x080000, 0xbbfaad77, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lastbtle) -STD_ROM_FN(md_lastbtle) - -struct BurnDriver BurnDrvmd_lastbtle = { - "md_lastbtle", NULL, NULL, NULL, "1989", - "Last Battle (Euro, USA, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lastbtleRomInfo, md_lastbtleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hokuto no Ken - Shin Seikimatsu Kyuuseishu Densetsu (Jpn) -static struct BurnRomInfo md_hokutoRomDesc[] = { - { "hokuto no ken - shin seikimatsu kyuuseishu densetsu (jpn).bin", 0x080000, 0x1b6585e7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hokuto) -STD_ROM_FN(md_hokuto) - -struct BurnDriver BurnDrvmd_hokuto = { - "md_hokuto", "md_lastbtle", NULL, NULL, "1989", - "Hokuto no Ken - Shin Seikimatsu Kyuuseishu Densetsu (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hokutoRomInfo, md_hokutoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Lawnmower Man (Euro, USA) -static struct BurnRomInfo md_lawnmowrRomDesc[] = { - { "lawnmower man, the (euro, usa).bin", 0x100000, 0xa7cacd59, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lawnmowr) -STD_ROM_FN(md_lawnmowr) - -struct BurnDriver BurnDrvmd_lawnmowr = { - "md_lawnmowr", NULL, NULL, NULL, "1994", - "The Lawnmower Man (Euro, USA)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lawnmowrRomInfo, md_lawnmowrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Galahad (Euro, USA) -static struct BurnRomInfo md_galahadRomDesc[] = { - { "gal01.bin", 0x100000, 0x679557bc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_galahad) -STD_ROM_FN(md_galahad) - -struct BurnDriver BurnDrvmd_galahad = { - "md_galahad", NULL, NULL, NULL, "1992", - "Galahad (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_galahadRomInfo, md_galahadRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lemmings (Euro) -static struct BurnRomInfo md_lemmingsRomDesc[] = { - { "mpr-15233.bin", 0x100000, 0x6a1a4579, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lemmings) -STD_ROM_FN(md_lemmings) - -struct BurnDriver BurnDrvmd_lemmings = { - "md_lemmings", NULL, NULL, NULL, "1992", - "Lemmings (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lemmingsRomInfo, md_lemmingsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lemmings (Jpn, USA, Kor, v1.1) -static struct BurnRomInfo md_lemmingsjuRomDesc[] = { - { "sunsoft_lem8_j.bin", 0x100000, 0x68c70362, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lemmingsju) -STD_ROM_FN(md_lemmingsju) - -struct BurnDriver BurnDrvmd_lemmingsju = { - "md_lemmingsju", "md_lemmings", NULL, NULL, "1992", - "Lemmings (Jpn, USA, Kor, v1.1)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lemmingsjuRomInfo, md_lemmingsjuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lemmings (Jpn, USA) -static struct BurnRomInfo md_lemmingsju1RomDesc[] = { - { "lemmings (usa, jpn).bin", 0x100000, 0xf015c2ad, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lemmingsju1) -STD_ROM_FN(md_lemmingsju1) - -struct BurnDriver BurnDrvmd_lemmingsju1 = { - "md_lemmingsju1", "md_lemmings", NULL, NULL, "1992", - "Lemmings (Jpn, USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lemmingsju1RomInfo, md_lemmingsju1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lemmings 2 - The Tribes (Euro) -static struct BurnRomInfo md_lemming2RomDesc[] = { - { "lemmings 2 - the tribes (euro).bin", 0x200000, 0x741eb624, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lemming2) -STD_ROM_FN(md_lemming2) - -struct BurnDriver BurnDrvmd_lemming2 = { - "md_lemming2", NULL, NULL, NULL, "1994", - "Lemmings 2 - The Tribes (Euro)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lemming2RomInfo, md_lemming2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lemmings 2 - The Tribes (USA) -static struct BurnRomInfo md_lemming2uRomDesc[] = { - { "lemmings 2 - the tribes (usa).bin", 0x200000, 0xde59a3a3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lemming2u) -STD_ROM_FN(md_lemming2u) - -struct BurnDriver BurnDrvmd_lemming2u = { - "md_lemming2u", "md_lemming2", NULL, NULL, "1994", - "Lemmings 2 - The Tribes (USA)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lemming2uRomInfo, md_lemming2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lethal Enforcers (Euro) -static struct BurnRomInfo md_lethalenRomDesc[] = { - { "lethal enforcers (euro).bin", 0x200000, 0xca2bf99d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lethalen) -STD_ROM_FN(md_lethalen) - -struct BurnDriver BurnDrvmd_lethalen = { - "md_lethalen", NULL, NULL, NULL, "1993", - "Lethal Enforcers (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lethalenRomInfo, md_lethalenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lethal Enforcers (Jpn) -static struct BurnRomInfo md_lethalenjRomDesc[] = { - { "fz008.bin", 0x200000, 0xf25f1e49, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lethalenj) -STD_ROM_FN(md_lethalenj) - -struct BurnDriver BurnDrvmd_lethalenj = { - "md_lethalenj", "md_lethalen", NULL, NULL, "1993", - "Lethal Enforcers (Jpn)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lethalenjRomInfo, md_lethalenjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lethal Enforcers (USA) -static struct BurnRomInfo md_lethalenuRomDesc[] = { - { "lethal enforcers (usa).bin", 0x200000, 0x51d9a84a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lethalenu) -STD_ROM_FN(md_lethalenu) - -struct BurnDriver BurnDrvmd_lethalenu = { - "md_lethalenu", "md_lethalen", NULL, NULL, "1993", - "Lethal Enforcers (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lethalenuRomInfo, md_lethalenuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lethal Enforcers II - Gun Fighters (Euro) -static struct BurnRomInfo md_le2RomDesc[] = { - { "lethal enforcers ii - gun fighters (euro).bin", 0x200000, 0x4bfe045c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_le2) -STD_ROM_FN(md_le2) - -struct BurnDriver BurnDrvmd_le2 = { - "md_le2", NULL, NULL, NULL, "1994", - "Lethal Enforcers II - Gun Fighters (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_le2RomInfo, md_le2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lethal Enforcers II - Gun Fighters (USA) -static struct BurnRomInfo md_le2uRomDesc[] = { - { "lethal enforcers ii - gun fighters (usa).bin", 0x200000, 0xe5fdd28b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_le2u) -STD_ROM_FN(md_le2u) - -struct BurnDriver BurnDrvmd_le2u = { - "md_le2u", "md_le2", NULL, NULL, "1994", - "Lethal Enforcers II - Gun Fighters (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_le2uRomInfo, md_le2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// LHX Attack Chopper (Euro, USA) -static struct BurnRomInfo md_lhxRomDesc[] = { - { "lhx04.bin", 0x100000, 0x70c3428d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lhx) -STD_ROM_FN(md_lhx) - -struct BurnDriver BurnDrvmd_lhx = { - "md_lhx", NULL, NULL, NULL, "1992", - "LHX Attack Chopper (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lhxRomInfo, md_lhxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// LHX Attack Chopper (Jpn) -static struct BurnRomInfo md_lhxjRomDesc[] = { - { "lhx attack chopper (jpn).bin", 0x100000, 0x224ff103, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lhxj) -STD_ROM_FN(md_lhxj) - -struct BurnDriver BurnDrvmd_lhxj = { - "md_lhxj", "md_lhx", NULL, NULL, "1993", - "LHX Attack Chopper (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lhxjRomInfo, md_lhxjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Liberty or Death (USA) -static struct BurnRomInfo md_libertyRomDesc[] = { - { "liberty or death (usa).bin", 0x200000, 0x2adb0364, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_liberty) -STD_ROM_FN(md_liberty) - -struct BurnDriver BurnDrvmd_liberty = { - "md_liberty", NULL, NULL, NULL, "1994", - "Liberty or Death (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_libertyRomInfo, md_libertyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Light Crusader (Jpn) -static struct BurnRomInfo md_lightcjRomDesc[] = { - { "light crusader (jpn).bin", 0x200000, 0x237076a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lightcj) -STD_ROM_FN(md_lightcj) - -struct BurnDriver BurnDrvmd_lightcj = { - "md_lightcj", "md_lightc", NULL, NULL, "1995", - "Light Crusader (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_lightcjRomInfo, md_lightcjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Light Crusader (Kor) -static struct BurnRomInfo md_lightckRomDesc[] = { - { "light crusader (kor).bin", 0x200000, 0x6d0cbcb2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lightck) -STD_ROM_FN(md_lightck) - -struct BurnDriver BurnDrvmd_lightck = { - "md_lightck", "md_lightc", NULL, NULL, "1995", - "Light Crusader (Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_lightckRomInfo, md_lightckRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Light Crusader (Prototype, 19950608) -static struct BurnRomInfo md_lightcpRomDesc[] = { - { "light crusader (prototype - jun 08, 1995).bin", 0x200000, 0xe350ccfa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lightcp) -STD_ROM_FN(md_lightcp) - -struct BurnDriver BurnDrvmd_lightcp = { - "md_lightcp", "md_lightc", NULL, NULL, "1995", - "Light Crusader (Prototype, 19950608)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_lightcpRomInfo, md_lightcpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Light Crusader (USA) -static struct BurnRomInfo md_lightcuRomDesc[] = { - { "light crusader (usa).bin", 0x200000, 0xbeb715dc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lightcu) -STD_ROM_FN(md_lightcu) - -struct BurnDriver BurnDrvmd_lightcu = { - "md_lightcu", "md_lightc", NULL, NULL, "1995", - "Light Crusader (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_lightcuRomInfo, md_lightcuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Lion King (World) -static struct BurnRomInfo md_lionkingRomDesc[] = { - { "mpr-17270.bin", 0x300000, 0x5696a5bc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lionking) -STD_ROM_FN(md_lionking) - -struct BurnDriver BurnDrvmd_lionking = { - "md_lionking", NULL, NULL, NULL, "1994", - "The Lion King (World)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lionkingRomInfo, md_lionkingRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lobo (USA, Prototype) -static struct BurnRomInfo md_loboRomDesc[] = { - { "lobo (usa) (prototype).bin", 0x300000, 0xb5e09338, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lobo) -STD_ROM_FN(md_lobo) - -struct BurnDriver BurnDrvmd_lobo = { - "md_lobo", NULL, NULL, NULL, "1996", - "Lobo (USA, Prototype)\0", NULL, "Ocean", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_loboRomInfo, md_loboRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Long (Chi) -static struct BurnRomInfo md_longRomDesc[] = { - { "long (chi) (unl).bin", 0x040000, 0x1b86e623, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_long) -STD_ROM_FN(md_long) - -struct BurnDriver BurnDrvmd_long = { - "md_long", NULL, NULL, NULL, "199?", - "Long (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_longRomInfo, md_longRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lord Monarch - Tokoton Sentou Densetsu (Jpn) -static struct BurnRomInfo md_lordmonRomDesc[] = { - { "lord monarch - tokoton sentou densetsu (jpn).bin", 0x200000, 0x238bf5db, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lordmon) -STD_ROM_FN(md_lordmon) - -struct BurnDriver BurnDrvmd_lordmon = { - "md_lordmon", NULL, NULL, NULL, "1994", - "Lord Monarch - Tokoton Sentou Densetsu (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_lordmonRomInfo, md_lordmonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Lost Vikings (Euro) -static struct BurnRomInfo md_lostvikRomDesc[] = { - { "lost vikings, the (euro).bin", 0x100000, 0x1f14efc6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lostvik) -STD_ROM_FN(md_lostvik) - -struct BurnDriver BurnDrvmd_lostvik = { - "md_lostvik", NULL, NULL, NULL, "1993", - "The Lost Vikings (Euro)\0", NULL, "Interplay", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lostvikRomInfo, md_lostvikRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Lost Vikings (Euro, Prototype) -static struct BurnRomInfo md_lostvikpRomDesc[] = { - { "lost vikings, the (euro) (beta).bin", 0x100000, 0x17bed25f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lostvikp) -STD_ROM_FN(md_lostvikp) - -struct BurnDriver BurnDrvmd_lostvikp = { - "md_lostvikp", "md_lostvik", NULL, NULL, "1993", - "The Lost Vikings (Euro, Prototype)\0", NULL, "Interplay", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lostvikpRomInfo, md_lostvikpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Lost Vikings (USA) -static struct BurnRomInfo md_lostvikuRomDesc[] = { - { "lost vikings, the (usa).bin", 0x100000, 0x7ba49edb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lostviku) -STD_ROM_FN(md_lostviku) - -struct BurnDriver BurnDrvmd_lostviku = { - "md_lostviku", "md_lostvik", NULL, NULL, "1992", - "The Lost Vikings (USA)\0", NULL, "Interplay", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lostvikuRomInfo, md_lostvikuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Lost World - Jurassic Park (Euro, USA) -static struct BurnRomInfo md_lostwrldRomDesc[] = { - { "lost world, the - jurassic park (euro, usa).bin", 0x400000, 0x140a284c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lostwrld) -STD_ROM_FN(md_lostwrld) - -struct BurnDriver BurnDrvmd_lostwrld = { - "md_lostwrld", NULL, NULL, NULL, "1997", - "The Lost World - Jurassic Park (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lostwrldRomInfo, md_lostwrldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lotus II (Euro, USA) -static struct BurnRomInfo md_lotus2RomDesc[] = { - { "lot205.bin", 0x100000, 0x1d8ee010, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lotus2) -STD_ROM_FN(md_lotus2) - -struct BurnDriver BurnDrvmd_lotus2 = { - "md_lotus2", NULL, NULL, NULL, "1993", - "Lotus II (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lotus2RomInfo, md_lotus2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lotus II (USA, Prototype) -static struct BurnRomInfo md_lotus2pRomDesc[] = { - { "lotus ii (usa) (beta).bin", 0x100000, 0x2997b7d4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lotus2p) -STD_ROM_FN(md_lotus2p) - -struct BurnDriver BurnDrvmd_lotus2p = { - "md_lotus2p", "md_lotus2", NULL, NULL, "1993", - "Lotus II (USA, Prototype)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lotus2pRomInfo, md_lotus2pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// M-1 Abrams Battle Tank (Euro, USA) -static struct BurnRomInfo md_m1abramsRomDesc[] = { - { "m-1 abrams battle tank (euro, usa).bin", 0x080000, 0x1e2f74cf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_m1abrams) -STD_ROM_FN(md_m1abrams) - -struct BurnDriver BurnDrvmd_m1abrams = { - "md_m1abrams", NULL, NULL, NULL, "1991", - "M-1 Abrams Battle Tank (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_m1abramsRomInfo, md_m1abramsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ma Qiao E Mo Ta - Devilish Mahjong Tower (Chi) -static struct BurnRomInfo md_maqiaoRomDesc[] = { - { "ma qiao e mo ta - devilish mahjong tower (chi) (unl).bin", 0x100000, 0x12e35994, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_maqiao) -STD_ROM_FN(md_maqiao) - -struct BurnDriver BurnDrvmd_maqiao = { - "md_maqiao", NULL, NULL, NULL, "1994", - "Ma Qiao E Mo Ta - Devilish Mahjong Tower (Chi)\0", NULL, "C&E", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_maqiaoRomInfo, md_maqiaoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Madden NFL '94 (Euro, USA) -static struct BurnRomInfo md_madden94RomDesc[] = { - { "madden nfl '94 (euro, usa).bin", 0x200000, 0xd14b811b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madden94) -STD_ROM_FN(md_madden94) - -struct BurnDriver BurnDrvmd_madden94 = { - "md_madden94", NULL, NULL, NULL, "1994", - "Madden NFL '94 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_madden94RomInfo, md_madden94RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Madden NFL 95 (Euro, USA) -static struct BurnRomInfo md_madden95RomDesc[] = { - { "madden nfl 95 (euro, usa).bin", 0x200000, 0xdb0be0c2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madden95) -STD_ROM_FN(md_madden95) - -struct BurnDriver BurnDrvmd_madden95 = { - "md_madden95", NULL, NULL, NULL, "1994", - "Madden NFL 95 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_madden95RomInfo, md_madden95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Madden NFL 96 (Euro, USA) -static struct BurnRomInfo md_madden96RomDesc[] = { - { "madden nfl 96 (euro, usa).bin", 0x200000, 0xf126918b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madden96) -STD_ROM_FN(md_madden96) - -struct BurnDriver BurnDrvmd_madden96 = { - "md_madden96", NULL, NULL, NULL, "1995", - "Madden NFL 96 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_madden96RomInfo, md_madden96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Madden NFL 97 (Euro, USA) -static struct BurnRomInfo md_madden97RomDesc[] = { - { "madden nfl 97 (euro, usa).bin", 0x200000, 0xc4b4e112, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madden97) -STD_ROM_FN(md_madden97) - -struct BurnDriver BurnDrvmd_madden97 = { - "md_madden97", NULL, NULL, NULL, "1997", - "Madden NFL 97 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_madden97RomInfo, md_madden97RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Madden NFL 98 (USA) -static struct BurnRomInfo md_madden98RomDesc[] = { - { "madden nfl 98 (usa).bin", 0x200000, 0xe051ea62, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madden98) -STD_ROM_FN(md_madden98) - -struct BurnDriver BurnDrvmd_madden98 = { - "md_madden98", NULL, NULL, NULL, "1997", - "Madden NFL 98 (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_madden98RomInfo, md_madden98RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Madou Monogatari I (Jpn) -static struct BurnRomInfo md_madoumonRomDesc[] = { - { "madou monogatari i (jpn).bin", 0x200000, 0xdd82c401, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madoumon) -STD_ROM_FN(md_madoumon) - -struct BurnDriver BurnDrvmd_madoumon = { - "md_madoumon", NULL, NULL, NULL, "1996", - "Madou Monogatari I (Jpn)\0", NULL, "Compile", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_madoumonRomInfo, md_madoumonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Scholastic's The Magic School Bus (USA) -static struct BurnRomInfo md_msbRomDesc[] = { - { "magic school bus, the (usa).bin", 0x100000, 0x1a5d4412, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msb) -STD_ROM_FN(md_msb) - -struct BurnDriver BurnDrvmd_msb = { - "md_msb", NULL, NULL, NULL, "1995", - "Scholastic's The Magic School Bus (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbRomInfo, md_msbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Scholastic's The Magic School Bus (Prototype, 19950411) -static struct BurnRomInfo md_msbp05RomDesc[] = { - { "magic school bus, the (prototype - apr 11, 1995).bin", 0x0fdfbc, 0x883023bc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp05) -STD_ROM_FN(md_msbp05) - -struct BurnDriver BurnDrvmd_msbp05 = { - "md_msbp05", "md_msb", NULL, NULL, "1995", - "Scholastic's The Magic School Bus (Prototype, 19950411)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp05RomInfo, md_msbp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Scholastic's The Magic School Bus (Prototype, 19950421) -static struct BurnRomInfo md_msbp04RomDesc[] = { - { "magic school bus, the (prototype - apr 21, 1995).bin", 0x0fcfdc, 0x7844b7ad, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp04) -STD_ROM_FN(md_msbp04) - -struct BurnDriver BurnDrvmd_msbp04 = { - "md_msbp04", "md_msb", NULL, NULL, "1995", - "Scholastic's The Magic School Bus (Prototype, 19950421)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp04RomInfo, md_msbp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Scholastic's The Magic School Bus (Prototype, 19950425) -static struct BurnRomInfo md_msbp03RomDesc[] = { - { "magic school bus, the (prototype - apr 25, 1995).bin", 0x0fd5e0, 0xb6bd2d87, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp03) -STD_ROM_FN(md_msbp03) - -struct BurnDriver BurnDrvmd_msbp03 = { - "md_msbp03", "md_msb", NULL, NULL, "1995", - "Scholastic's The Magic School Bus (Prototype, 19950425)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp03RomInfo, md_msbp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Scholastic's The Magic School Bus (Prototype, 19950428) -static struct BurnRomInfo md_msbp02RomDesc[] = { - { "magic school bus, the (prototype - apr 28, 1995).bin", 0x0fe89c, 0x9b6bae87, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp02) -STD_ROM_FN(md_msbp02) - -struct BurnDriver BurnDrvmd_msbp02 = { - "md_msbp02", "md_msb", NULL, NULL, "1995", - "Scholastic's The Magic School Bus (Prototype, 19950428)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp02RomInfo, md_msbp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Magic School Bus (Prototype, 19950202) -static struct BurnRomInfo md_msbp11RomDesc[] = { - { "magic school bus, the (prototype - feb 02, 1995).bin", 0x100000, 0x7805b5c9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp11) -STD_ROM_FN(md_msbp11) - -struct BurnDriver BurnDrvmd_msbp11 = { - "md_msbp11", "md_msb", NULL, NULL, "1995", - "The Magic School Bus (Prototype, 19950202)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp11RomInfo, md_msbp11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Magic School Bus (Prototype, 19950217) -static struct BurnRomInfo md_msbp10RomDesc[] = { - { "magic school bus, the (prototype - feb 17, 1995).bin", 0x0df6bc, 0x2b7a88c0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp10) -STD_ROM_FN(md_msbp10) - -struct BurnDriver BurnDrvmd_msbp10 = { - "md_msbp10", "md_msb", NULL, NULL, "1995", - "The Magic School Bus (Prototype, 19950217)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp10RomInfo, md_msbp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Magic School Bus (Prototype, 19950112) -static struct BurnRomInfo md_msbp12RomDesc[] = { - { "magic school bus, the (prototype - jan 12, 1995).bin", 0x0eb2e4, 0x946346f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp12) -STD_ROM_FN(md_msbp12) - -struct BurnDriver BurnDrvmd_msbp12 = { - "md_msbp12", "md_msb", NULL, NULL, "1995", - "The Magic School Bus (Prototype, 19950112)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp12RomInfo, md_msbp12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Magic School Bus (Prototype, 19950307) -static struct BurnRomInfo md_msbp09RomDesc[] = { - { "magic school bus, the (prototype - mar 07, 1995).bin", 0x0e9aa8, 0x26c71eb8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp09) -STD_ROM_FN(md_msbp09) - -struct BurnDriver BurnDrvmd_msbp09 = { - "md_msbp09", "md_msb", NULL, NULL, "1995", - "The Magic School Bus (Prototype, 19950307)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp09RomInfo, md_msbp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Magic School Bus (Prototype, 19950314) -static struct BurnRomInfo md_msbp08RomDesc[] = { - { "magic school bus, the (prototype - mar 14, 1995).bin", 0x0f1c30, 0x37a6a1af, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp08) -STD_ROM_FN(md_msbp08) - -struct BurnDriver BurnDrvmd_msbp08 = { - "md_msbp08", "md_msb", NULL, NULL, "1995", - "The Magic School Bus (Prototype, 19950314)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp08RomInfo, md_msbp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Magic School Bus (Prototype, 19950327) -static struct BurnRomInfo md_msbp07RomDesc[] = { - { "magic school bus, the (prototype - mar 27, 1995).bin", 0x0f52e8, 0xb065da40, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp07) -STD_ROM_FN(md_msbp07) - -struct BurnDriver BurnDrvmd_msbp07 = { - "md_msbp07", "md_msb", NULL, NULL, "1995", - "The Magic School Bus (Prototype, 19950327)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp07RomInfo, md_msbp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Scholastic's The Magic School Bus (Prototype, 19950331) -static struct BurnRomInfo md_msbp06RomDesc[] = { - { "magic school bus, the (prototype - mar 31, 1995).bin", 0x0f93c0, 0xcd788def, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp06) -STD_ROM_FN(md_msbp06) - -struct BurnDriver BurnDrvmd_msbp06 = { - "md_msbp06", "md_msb", NULL, NULL, "1995", - "Scholastic's The Magic School Bus (Prototype, 19950331)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp06RomInfo, md_msbp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Scholastic's The Magic School Bus (Prototype, 19950505) -static struct BurnRomInfo md_msbp01RomDesc[] = { - { "magic school bus, the (prototype - may 05, 1995).bin", 0x0fea00, 0xa2315f1c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_msbp01) -STD_ROM_FN(md_msbp01) - -struct BurnDriver BurnDrvmd_msbp01 = { - "md_msbp01", "md_msb", NULL, NULL, "1995", - "Scholastic's The Magic School Bus (Prototype, 19950505)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_msbp01RomInfo, md_msbp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Magical Hat no Buttobi Turbo! Daibouken (Jpn) -static struct BurnRomInfo md_magichatRomDesc[] = { - { "magical hat no buttobi turbo! daibouken (jpn).bin", 0x080000, 0xe43e853d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_magichat) -STD_ROM_FN(md_magichat) - -struct BurnDriver BurnDrvmd_magichat = { - "md_magichat", NULL, NULL, NULL, "1990", - "Magical Hat no Buttobi Turbo! Daibouken (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_magichatRomInfo, md_magichatRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Magical Taruruuto-kun (Jpn) -static struct BurnRomInfo md_mtaruruRomDesc[] = { - { "magical taruruuto-kun (jpn).bin", 0x080000, 0xf11060a5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mtaruru) -STD_ROM_FN(md_mtaruru) - -struct BurnDriver BurnDrvmd_mtaruru = { - "md_mtaruru", NULL, NULL, NULL, "1992", - "Magical Taruruuto-kun (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mtaruruRomInfo, md_mtaruruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mahjong Cop Ryuu - Shiro Ookami no Yabou (Jpn) -static struct BurnRomInfo md_mahjongcRomDesc[] = { - { "mahjong cop ryuu - shiro ookami no yabou (jpn).bin", 0x040000, 0x1ccbc782, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mahjongc) -STD_ROM_FN(md_mahjongc) - -struct BurnDriver BurnDrvmd_mahjongc = { - "md_mahjongc", NULL, NULL, NULL, "1989", - "Mahjong Cop Ryuu - Shiro Ookami no Yabou (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mahjongcRomInfo, md_mahjongcRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mamono Hunter Youko - Dai 7 no Keishou (Jpn) -static struct BurnRomInfo md_mamonoRomDesc[] = { - { "mamono hunter youko - dai 7 no keishou (jpn).bin", 0x080000, 0x10bb359b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mamono) -STD_ROM_FN(md_mamono) - -struct BurnDriver BurnDrvmd_mamono = { - "md_mamono", NULL, NULL, NULL, "1991", - "Mamono Hunter Youko - Dai 7 no Keishou (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mamonoRomInfo, md_mamonoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// S.S. Lucifer - Man Overboard! (Euro) -static struct BurnRomInfo md_manoverRomDesc[] = { - { "mdss12c4.bin", 0x100000, 0xcae0e3a6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_manover) -STD_ROM_FN(md_manover) - -struct BurnDriver BurnDrvmd_manover = { - "md_manover", NULL, NULL, NULL, "1994", - "S.S. Lucifer - Man Overboard! (Euro)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_manoverRomInfo, md_manoverRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Newman Haas IndyCar Featuring Nigel Mansell ~ Nigel Mansell Indy Car (World) -static struct BurnRomInfo md_newmanhRomDesc[] = { - { "newman haas indy car featuring nigel mansell -- nigel mansell indy car (world).bin", 0x200000, 0x1233a229, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_newmanh) -STD_ROM_FN(md_newmanh) - -struct BurnDriver BurnDrvmd_newmanh = { - "md_newmanh", NULL, NULL, NULL, "1994", - "Newman Haas IndyCar Featuring Nigel Mansell ~ Nigel Mansell Indy Car (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_newmanhRomInfo, md_newmanhRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Marble Madness (Euro, USA) -static struct BurnRomInfo md_marbleRomDesc[] = { - { "mar01.bin", 0x080000, 0x79eba28a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_marble) -STD_ROM_FN(md_marble) - -struct BurnDriver BurnDrvmd_marble = { - "md_marble", NULL, NULL, NULL, "1993", - "Marble Madness (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_marbleRomInfo, md_marbleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mario Andretti Racing (Euro, USA) -static struct BurnRomInfo md_andrettiRomDesc[] = { - { "mario andretti racing (euro, usa).bin", 0x200000, 0x7f1dc0aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_andretti) -STD_ROM_FN(md_andretti) - -struct BurnDriver BurnDrvmd_andretti = { - "md_andretti", NULL, NULL, NULL, "1994", - "Mario Andretti Racing (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_andrettiRomInfo, md_andrettiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mario Lemieux Hockey (Euro, USA) -static struct BurnRomInfo md_mariolhRomDesc[] = { - { "mpr-14376.bin", 0x080000, 0xf664eb6c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mariolh) -STD_ROM_FN(md_mariolh) - -struct BurnDriver BurnDrvmd_mariolh = { - "md_mariolh", NULL, NULL, NULL, "1991", - "Mario Lemieux Hockey (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mariolhRomInfo, md_mariolhRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Marko's Magic Football (Euro) -static struct BurnRomInfo md_markoRomDesc[] = { - { "mpr-16825.bin", 0x200000, 0x2307b905, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_marko) -STD_ROM_FN(md_marko) - -struct BurnDriver BurnDrvmd_marko = { - "md_marko", NULL, NULL, NULL, "1994", - "Marko's Magic Football (Euro)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_markoRomInfo, md_markoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Marko's Magic Football (Euro, Prototype) -static struct BurnRomInfo md_markopRomDesc[] = { - { "marko's magic football (euro) (beta).bin", 0x200000, 0x0273e564, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_markop) -STD_ROM_FN(md_markop) - -struct BurnDriver BurnDrvmd_markop = { - "md_markop", "md_marko", NULL, NULL, "1994", - "Marko's Magic Football (Euro, Prototype)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_markopRomInfo, md_markopRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Marko (USA) -static struct BurnRomInfo md_markouRomDesc[] = { - { "marko's magic football (usa).bin", 0x200000, 0x2b8c8cce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_markou) -STD_ROM_FN(md_markou) - -struct BurnDriver BurnDrvmd_markou = { - "md_markou", "md_marko", NULL, NULL, "1994", - "Marko (USA)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_markouRomInfo, md_markouRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Marsupilami (Euro) -static struct BurnRomInfo md_marsupRomDesc[] = { - { "marsupilami (euro).bin", 0x200000, 0xe09bbd70, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_marsup) -STD_ROM_FN(md_marsup) - -struct BurnDriver BurnDrvmd_marsup = { - "md_marsup", NULL, NULL, NULL, "1995", - "Marsupilami (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_marsupRomInfo, md_marsupRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Marsupilami (USA) -static struct BurnRomInfo md_marsupuRomDesc[] = { - { "marsupilami (usa).bin", 0x200000, 0xc76558df, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_marsupu) -STD_ROM_FN(md_marsupu) - -struct BurnDriver BurnDrvmd_marsupu = { - "md_marsupu", "md_marsup", NULL, NULL, "1995", - "Marsupilami (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_marsupuRomInfo, md_marsupuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Master of Monsters (USA) -static struct BurnRomInfo md_mastermRomDesc[] = { - { "master of monsters (usa).bin", 0x080000, 0x91354820, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_masterm) -STD_ROM_FN(md_masterm) - -struct BurnDriver BurnDrvmd_masterm = { - "md_masterm", NULL, NULL, NULL, "1991", - "Master of Monsters (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_mastermRomInfo, md_mastermRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Master of Monsters (Jpn) -static struct BurnRomInfo md_mastermjRomDesc[] = { - { "mpr-14120.bin", 0x080000, 0xd51ee8c2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mastermj) -STD_ROM_FN(md_mastermj) - -struct BurnDriver BurnDrvmd_mastermj = { - "md_mastermj", "md_masterm", NULL, NULL, "1991", - "Master of Monsters (Jpn)\0", NULL, "Toshiba EMI", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_mastermjRomInfo, md_mastermjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Master of Weapon (Jpn) -static struct BurnRomInfo md_mweaponRomDesc[] = { - { "master of weapon (jpn).bin", 0x080000, 0x12ad6178, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mweapon) -STD_ROM_FN(md_mweapon) - -struct BurnDriver BurnDrvmd_mweapon = { - "md_mweapon", NULL, NULL, NULL, "1991", - "Master of Weapon (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mweaponRomInfo, md_mweaponRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Maten no Soumetsu (Jpn) -static struct BurnRomInfo md_matenRomDesc[] = { - { "maten no soumetsu (jpn).bin", 0x100000, 0xb804a105, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_maten) -STD_ROM_FN(md_maten) - -struct BurnDriver BurnDrvmd_maten = { - "md_maten", NULL, NULL, NULL, "1993", - "Maten no Soumetsu (Jpn)\0", NULL, "Kodansha", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_matenRomInfo, md_matenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Math Blaster - Episode 1 (USA) -static struct BurnRomInfo md_mathblstRomDesc[] = { - { "math blaster - episode 1 (usa).bin", 0x100000, 0xd055a462, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mathblst) -STD_ROM_FN(md_mathblst) - -struct BurnDriver BurnDrvmd_mathblst = { - "md_mathblst", NULL, NULL, NULL, "1994", - "Math Blaster - Episode 1 (USA)\0", NULL, "Davidson & Associates", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mathblstRomInfo, md_mathblstRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mazin Wars (Euro) -static struct BurnRomInfo md_mazinwarRomDesc[] = { - { "mazin wars (euro).bin", 0x100000, 0x4b07a105, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mazinwar) -STD_ROM_FN(md_mazinwar) - -struct BurnDriver BurnDrvmd_mazinwar = { - "md_mazinwar", NULL, NULL, NULL, "1993", - "Mazin Wars (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mazinwarRomInfo, md_mazinwarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mazin Saga (Asia) -static struct BurnRomInfo md_mazinsagaRomDesc[] = { - { "mazin saga (asia).bin", 0x100000, 0x36459b59, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mazinsaga) -STD_ROM_FN(md_mazinsaga) - -struct BurnDriver BurnDrvmd_mazinsaga = { - "md_mazinsaga", "md_mazinwar", NULL, NULL, "1993", - "Mazin Saga (Asia)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mazinsagaRomInfo, md_mazinsagaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mazin Saga (Jpn, Kor) -static struct BurnRomInfo md_mazinsagjRomDesc[] = { - { "mazin saga (jpn, kor).bin", 0x100000, 0x45b3a34b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mazinsagj) -STD_ROM_FN(md_mazinsagj) - -struct BurnDriver BurnDrvmd_mazinsagj = { - "md_mazinsagj", "md_mazinwar", NULL, NULL, "1993", - "Mazin Saga (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mazinsagjRomInfo, md_mazinsagjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mazin Saga (USA) -static struct BurnRomInfo md_mazinsaguRomDesc[] = { - { "mazin saga - mutant fighter (usa).bin", 0x100000, 0x1bd9fef1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mazinsagu) -STD_ROM_FN(md_mazinsagu) - -struct BurnDriver BurnDrvmd_mazinsagu = { - "md_mazinsagu", "md_mazinwar", NULL, NULL, "1993", - "Mazin Saga (USA)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mazinsaguRomInfo, md_mazinsaguRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// McDonald's Treasure Land Adventure (Euro) -static struct BurnRomInfo md_mcdonaldRomDesc[] = { - { "mcdonald's treasure land adventure (euro).bin", 0x100000, 0x6ab6a8da, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mcdonald) -STD_ROM_FN(md_mcdonald) - -struct BurnDriver BurnDrvmd_mcdonald = { - "md_mcdonald", NULL, NULL, NULL, "1993", - "McDonald's Treasure Land Adventure (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mcdonaldRomInfo, md_mcdonaldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// McDonald's Treasure Land Adventure (Jpn) -static struct BurnRomInfo md_mcdonaldjRomDesc[] = { - { "mcdonald's treasure land adventure (jpn).bin", 0x100000, 0xfebcfd06, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mcdonaldj) -STD_ROM_FN(md_mcdonaldj) - -struct BurnDriver BurnDrvmd_mcdonaldj = { - "md_mcdonaldj", "md_mcdonald", NULL, NULL, "1993", - "McDonald's Treasure Land Adventure (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mcdonaldjRomInfo, md_mcdonaldjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// McDonald's Treasure Land Adventure (Jpn, Prototype) -static struct BurnRomInfo md_mcdonaldjpRomDesc[] = { - { "mcdonald's treasure land adventure (jpn) (beta).bin", 0x100000, 0x7bf477e8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mcdonaldjp) -STD_ROM_FN(md_mcdonaldjp) - -struct BurnDriver BurnDrvmd_mcdonaldjp = { - "md_mcdonaldjp", "md_mcdonald", NULL, NULL, "1993", - "McDonald's Treasure Land Adventure (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mcdonaldjpRomInfo, md_mcdonaldjpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// McDonald's Treasure Land Adventure (USA) -static struct BurnRomInfo md_mcdonalduRomDesc[] = { - { "mcdonald's treasure land adventure (usa).bin", 0x100000, 0x04ef4899, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mcdonaldu) -STD_ROM_FN(md_mcdonaldu) - -struct BurnDriver BurnDrvmd_mcdonaldu = { - "md_mcdonaldu", "md_mcdonald", NULL, NULL, "1993", - "McDonald's Treasure Land Adventure (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mcdonalduRomInfo, md_mcdonalduRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Medal City (Jpn, SegaNet) -static struct BurnRomInfo md_medalcRomDesc[] = { - { "medal city (jpn) (sn).bin", 0x040000, 0x3ef4135d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_medalc) -STD_ROM_FN(md_medalc) - -struct BurnDriver BurnDrvmd_medalc = { - "md_medalc", NULL, NULL, NULL, "1991", - "Medal City (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_medalcRomInfo, md_medalcRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Bomberman (USA) -static struct BurnRomInfo md_megabombuRomDesc[] = { - { "mega bomberman (usa).bin", 0x100000, 0x4bd6667d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megabombu) -STD_ROM_FN(md_megabombu) - -struct BurnDriver BurnDrvmd_megabombu = { - "md_megabombu", "md_megabomb", NULL, NULL, "1994", - "Mega Bomberman (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megabombuRomInfo, md_megabombuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Bomberman - 8 Player Demo -static struct BurnRomInfo md_megabm8RomDesc[] = { - { "mega bomberman - 8 player demo (unl).bin", 0x100000, 0xd41c0d81, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megabm8) -STD_ROM_FN(md_megabm8) - -struct BurnDriver BurnDrvmd_megabm8 = { - "md_megabm8", NULL, NULL, NULL, "199?", - "Mega Bomberman - 8 Player Demo\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megabm8RomInfo, md_megabm8RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Games I (Euro) -static struct BurnRomInfo md_megaga1RomDesc[] = { - { "mpr-15009.bin", 0x100000, 0xdb753224, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaga1) -STD_ROM_FN(md_megaga1) - -struct BurnDriver BurnDrvmd_megaga1 = { - "md_megaga1", NULL, NULL, NULL, "1992", - "Mega Games I (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaga1RomInfo, md_megaga1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Games 2 (Euro) -static struct BurnRomInfo md_megaga2RomDesc[] = { - { "mega games 2 (euro).bin", 0x200000, 0x30d59f2f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaga2) -STD_ROM_FN(md_megaga2) - -struct BurnDriver BurnDrvmd_megaga2 = { - "md_megaga2", NULL, NULL, NULL, "1993", - "Mega Games 2 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaga2RomInfo, md_megaga2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Games 3 (Euro, Asia) -static struct BurnRomInfo md_megaga3RomDesc[] = { - { "mega games 3 (euro, asia).bin", 0x200000, 0xb4247d98, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaga3) -STD_ROM_FN(md_megaga3) - -struct BurnDriver BurnDrvmd_megaga3 = { - "md_megaga3", NULL, NULL, NULL, "1993", - "Mega Games 3 (Euro, Asia)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaga3RomInfo, md_megaga3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Games 6 Vol. 1 (Euro) -static struct BurnRomInfo md_megaga61RomDesc[] = { - { "mpr-18002+mpr18003.bin", 0x300000, 0xb66fb80d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaga61) -STD_ROM_FN(md_megaga61) - -struct BurnDriver BurnDrvmd_megaga61 = { - "md_megaga61", NULL, NULL, NULL, "1995", - "Mega Games 6 Vol. 1 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaga61RomInfo, md_megaga61RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Games 6 Vol. 2 (Euro) -static struct BurnRomInfo md_megaga62RomDesc[] = { - { "mega games 6 vol. 2 (euro).bin", 0x300000, 0xe8d10db9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaga62) -STD_ROM_FN(md_megaga62) - -struct BurnDriver BurnDrvmd_megaga62 = { - "md_megaga62", NULL, NULL, NULL, "1995", - "Mega Games 6 Vol. 2 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaga62RomInfo, md_megaga62RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Games 10 (Bra) -static struct BurnRomInfo md_megaga10RomDesc[] = { - { "mega games 10 (bra).bin", 0x400000, 0xc19ae368, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaga10) -STD_ROM_FN(md_megaga10) - -struct BurnDriver BurnDrvmd_megaga10 = { - "md_megaga10", NULL, NULL, NULL, "199?", - "Mega Games 10 (Bra)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaga10RomInfo, md_megaga10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Man - The Wily Wars (Euro) -static struct BurnRomInfo md_megamanRomDesc[] = { - { "mega man - the wily wars (euro).bin", 0x200000, 0xdcf6e8b2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaman) -STD_ROM_FN(md_megaman) - -struct BurnDriver BurnDrvmd_megaman = { - "md_megaman", NULL, NULL, NULL, "1994", - "Mega Man - The Wily Wars (Euro)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_megamanRomInfo, md_megamanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rockman Mega World (Jpn) -static struct BurnRomInfo md_rockmanRomDesc[] = { - { "rockman mega world (jpn).bin", 0x200000, 0x4d87235e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rockman) -STD_ROM_FN(md_rockman) - -struct BurnDriver BurnDrvmd_rockman = { - "md_rockman", "md_megaman", NULL, NULL, "1994", - "Rockman Mega World (Jpn)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_rockmanRomInfo, md_rockmanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rockman Mega World (Jpn, Alt) -static struct BurnRomInfo md_rockman1RomDesc[] = { - { "rockman mega world (jpn) (alt).bin", 0x200000, 0x85c956ef, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rockman1) -STD_ROM_FN(md_rockman1) - -struct BurnDriver BurnDrvmd_rockman1 = { - "md_rockman1", "md_megaman", NULL, NULL, "1994", - "Rockman Mega World (Jpn, Alt)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rockman1RomInfo, md_rockman1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega SWIV (Euro) -static struct BurnRomInfo md_megaswivRomDesc[] = { - { "mega swiv (euro).bin", 0x100000, 0x78c2f046, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaswiv) -STD_ROM_FN(md_megaswiv) - -struct BurnDriver BurnDrvmd_megaswiv = { - "md_megaswiv", NULL, NULL, NULL, "1994", - "Mega SWIV (Euro)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaswivRomInfo, md_megaswivRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega SWIV (Euro, Pirate) -static struct BurnRomInfo md_megaswivbRomDesc[] = { - { "mega swiv (euro) (pirate).bin", 0x100000, 0x1ec66bf7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaswivb) -STD_ROM_FN(md_megaswivb) - -struct BurnDriver BurnDrvmd_megaswivb = { - "md_megaswivb", "md_megaswiv", NULL, NULL, "1994", - "Mega SWIV (Euro, Pirate)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaswivbRomInfo, md_megaswivbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Turrican (Euro) -static struct BurnRomInfo md_megaturrRomDesc[] = { - { "mega turrican (euro).bin", 0x100000, 0xb1d15d0f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaturr) -STD_ROM_FN(md_megaturr) - -struct BurnDriver BurnDrvmd_megaturr = { - "md_megaturr", NULL, NULL, NULL, "1994", - "Mega Turrican (Euro)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaturrRomInfo, md_megaturrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Turrican (USA) -static struct BurnRomInfo md_megaturruRomDesc[] = { - { "mega turrican (usa).bin", 0x100000, 0xfe898cc9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaturru) -STD_ROM_FN(md_megaturru) - -struct BurnDriver BurnDrvmd_megaturru = { - "md_megaturru", "md_megaturr", NULL, NULL, "1994", - "Mega Turrican (USA)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaturruRomInfo, md_megaturruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega-Lo-Mania (Euro, v1.1) -static struct BurnRomInfo md_megaloRomDesc[] = { - { "mega-lo-mania (euro) (v1.1).bin", 0x100000, 0xab9fed30, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megalo) -STD_ROM_FN(md_megalo) - -struct BurnDriver BurnDrvmd_megalo = { - "md_megalo", NULL, NULL, NULL, "1992", - "Mega-Lo-Mania (Euro, v1.1)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaloRomInfo, md_megaloRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega-Lo-Mania (Euro) -static struct BurnRomInfo md_megalo1RomDesc[] = { - { "mpr-15230.bin", 0x100000, 0x2148d56d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megalo1) -STD_ROM_FN(md_megalo1) - -struct BurnDriver BurnDrvmd_megalo1 = { - "md_megalo1", "md_megalo", NULL, NULL, "1992", - "Mega-Lo-Mania (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megalo1RomInfo, md_megalo1RomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega-Lo-Mania (Fra) -static struct BurnRomInfo md_megalofRomDesc[] = { - { "mega-lo-mania (france).bin", 0x100000, 0x3b3231ed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megalof) -STD_ROM_FN(md_megalof) - -struct BurnDriver BurnDrvmd_megalof = { - "md_megalof", "md_megalo", NULL, NULL, "1992", - "Mega-Lo-Mania (Fra)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megalofRomInfo, md_megalofRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega-Lo-Mania (Jpn) -static struct BurnRomInfo md_megalojRomDesc[] = { - { "mega-lo-mania (jpn).bin", 0x100000, 0xa60d8619, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaloj) -STD_ROM_FN(md_megaloj) - -struct BurnDriver BurnDrvmd_megaloj = { - "md_megaloj", "md_megalo", NULL, NULL, "1993", - "Mega-Lo-Mania (Jpn)\0", NULL, "CRI", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megalojRomInfo, md_megalojRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tyrants - Fight through Time (USA) -static struct BurnRomInfo md_tyrantRomDesc[] = { - { "tyrants - fight through time (usa).bin", 0x100000, 0xa744921e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tyrant) -STD_ROM_FN(md_tyrant) - -struct BurnDriver BurnDrvmd_tyrant = { - "md_tyrant", "md_megalo", NULL, NULL, "1992", - "Tyrants - Fight through Time (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tyrantRomInfo, md_tyrantRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// MegaMind (Jpn, SegaNet) -static struct BurnRomInfo md_megamindRomDesc[] = { - { "megamind (jpn) (sn).bin", 0x040000, 0x76df2ae2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megamind) -STD_ROM_FN(md_megamind) - -struct BurnDriver BurnDrvmd_megamind = { - "md_megamind", NULL, NULL, NULL, "1991", - "MegaMind (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megamindRomInfo, md_megamindRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// MegaPanel (Jpn) -static struct BurnRomInfo md_megapanlRomDesc[] = { - { "megapanel (jpn).bin", 0x040000, 0x6240f579, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megapanl) -STD_ROM_FN(md_megapanl) - -struct BurnDriver BurnDrvmd_megapanl = { - "md_megapanl", NULL, NULL, NULL, "1990", - "MegaPanel (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megapanlRomInfo, md_megapanlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Menacer 6-Game Cartridge (Euro, USA) -static struct BurnRomInfo md_menacerRomDesc[] = { - { "mpr-15075.bin", 0x100000, 0x936b85f7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_menacer) -STD_ROM_FN(md_menacer) - -struct BurnDriver BurnDrvmd_menacer = { - "md_menacer", NULL, NULL, NULL, "1992", - "Menacer 6-Game Cartridge (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_menacerRomInfo, md_menacerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Meng Huan Shui Guo Pan - 777 Casino (Chi) -static struct BurnRomInfo md_menghuRomDesc[] = { - { "meng huan shui guo pan - 777 casino (chi) (unl).bin", 0x100000, 0x42dc03e4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_menghu) -STD_ROM_FN(md_menghu) - -struct BurnDriver BurnDrvmd_menghu = { - "md_menghu", NULL, NULL, NULL, "199?", - "Meng Huan Shui Guo Pan - 777 Casino (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_menghuRomInfo, md_menghuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mercs (Euro, USA) ~ Senjou no Ookami II (Jpn) -static struct BurnRomInfo md_mercsRomDesc[] = { - { "mpr-14242.bin", 0x100000, 0x16113a72, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mercs) -STD_ROM_FN(md_mercs) - -struct BurnDriver BurnDrvmd_mercs = { - "md_mercs", NULL, NULL, NULL, "1991", - "Mercs (Euro, USA) ~ Senjou no Ookami II (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mercsRomInfo, md_mercsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Metal Fangs (Jpn) -static struct BurnRomInfo md_metalfngRomDesc[] = { - { "metal fangs (jpn).bin", 0x080000, 0xa8df1c4c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_metalfng) -STD_ROM_FN(md_metalfng) - -struct BurnDriver BurnDrvmd_metalfng = { - "md_metalfng", NULL, NULL, NULL, "1993", - "Metal Fangs (Jpn)\0", NULL, "Victor Interactive Software", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_metalfngRomInfo, md_metalfngRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Michael Jackson's Moonwalker (World, Rev. A) -static struct BurnRomInfo md_mwalkRomDesc[] = { - { "mpr-13285a.bin", 0x080000, 0x11ce1f9e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mwalk) -STD_ROM_FN(md_mwalk) - -struct BurnDriver BurnDrvmd_mwalk = { - "md_mwalk", NULL, NULL, NULL, "1990", - "Michael Jackson's Moonwalker (World, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mwalkRomInfo, md_mwalkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Michael Jackson's Moonwalker (World) -static struct BurnRomInfo md_mwalk1RomDesc[] = { - { "mpr-13285.bin", 0x080000, 0x6a70791b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mwalk1) -STD_ROM_FN(md_mwalk1) - -struct BurnDriver BurnDrvmd_mwalk1 = { - "md_mwalk1", "md_mwalk", NULL, NULL, "1990", - "Michael Jackson's Moonwalker (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mwalk1RomInfo, md_mwalk1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mickey Mania - The Timeless Adventures of Mickey Mouse (Euro) -static struct BurnRomInfo md_mmaniaRomDesc[] = { - { "mpr-17089.bin", 0x200000, 0xcb5a8b85, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmania) -STD_ROM_FN(md_mmania) - -struct BurnDriver BurnDrvmd_mmania = { - "md_mmania", NULL, NULL, NULL, "1994", - "Mickey Mania - The Timeless Adventures of Mickey Mouse (Euro)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmaniaRomInfo, md_mmaniaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mickey Mania - The Timeless Adventures of Mickey Mouse (Jpn) -static struct BurnRomInfo md_mmaniajRomDesc[] = { - { "mickey mania - the timeless adventures of mickey mouse (jpn).bin", 0x200000, 0x23180cf7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmaniaj) -STD_ROM_FN(md_mmaniaj) - -struct BurnDriver BurnDrvmd_mmaniaj = { - "md_mmaniaj", "md_mmania", NULL, NULL, "1995", - "Mickey Mania - The Timeless Adventures of Mickey Mouse (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmaniajRomInfo, md_mmaniajRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mickey Mania - The Timeless Adventures of Mickey Mouse (USA) -static struct BurnRomInfo md_mmaniauRomDesc[] = { - { "mickey mania - the timeless adventures of mickey mouse (usa).bin", 0x200000, 0x629e5963, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmaniau) -STD_ROM_FN(md_mmaniau) - -struct BurnDriver BurnDrvmd_mmaniau = { - "md_mmaniau", "md_mmania", NULL, NULL, "1994", - "Mickey Mania - The Timeless Adventures of Mickey Mouse (USA)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmaniauRomInfo, md_mmaniauRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mickey Mania - The Timeless Adventures of Mickey Mouse (USA, Prototype) -static struct BurnRomInfo md_mmaniaupRomDesc[] = { - { "mickey mania - the timeless adventures of mickey mouse (usa) (beta).bin", 0x200000, 0x7fc1bdf0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmaniaup) -STD_ROM_FN(md_mmaniaup) - -struct BurnDriver BurnDrvmd_mmaniaup = { - "md_mmaniaup", "md_mmania", NULL, NULL, "1994", - "Mickey Mania - The Timeless Adventures of Mickey Mouse (USA, Prototype)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmaniaupRomInfo, md_mmaniaupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mickey's Ultimate Challenge (USA) -static struct BurnRomInfo md_mickeyucRomDesc[] = { - { "mickey's ultimate challenge (usa).bin", 0x100000, 0x30b512ee, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mickeyuc) -STD_ROM_FN(md_mickeyuc) - -struct BurnDriver BurnDrvmd_mickeyuc = { - "md_mickeyuc", NULL, NULL, NULL, "1994", - "Mickey's Ultimate Challenge (USA)\0", NULL, "Hi Tech Expressions", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mickeyucRomInfo, md_mickeyucRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Micro Machines (Euro, USA, Alt) -static struct BurnRomInfo md_micromacaRomDesc[] = { - { "micro machines (euro, usa) (alt).bin", 0x080000, 0xe5cf560d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_micromaca) -STD_ROM_FN(md_micromaca) - -struct BurnDriver BurnDrvmd_micromaca = { - "md_micromaca", "md_micromac", NULL, NULL, "1993", - "Micro Machines (Euro, USA, Alt)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_micromacaRomInfo, md_micromacaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Micro Machines (Euro, USA, Alt 2) -static struct BurnRomInfo md_micromacbRomDesc[] = { - { "micro machines (euro, usa) (alt2).bin", 0x080000, 0x7ffbd1ad, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_micromacb) -STD_ROM_FN(md_micromacb) - -struct BurnDriver BurnDrvmd_micromacb = { - "md_micromacb", "md_micromac", NULL, NULL, "1993", - "Micro Machines (Euro, USA, Alt 2)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_micromacbRomInfo, md_micromacbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Micro Machines (Can) -static struct BurnRomInfo md_micromaccRomDesc[] = { - { "micro machines (canada).bin", 0x080000, 0x54e4cff1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_micromacc) -STD_ROM_FN(md_micromacc) - -struct BurnDriver BurnDrvmd_micromacc = { - "md_micromacc", "md_micromac", NULL, NULL, "1993", - "Micro Machines (Can)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_micromaccRomInfo, md_micromaccRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Micro Machines Turbo Tournament 96 (Euro, J-Cart) -static struct BurnRomInfo md_microm96aRomDesc[] = { - { "mm96md7cc3.bin", 0x100000, 0x7492b1de, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_microm96a) -STD_ROM_FN(md_microm96a) - -struct BurnDriver BurnDrvmd_microm96a = { - "md_microm96a", "md_microm96", NULL, NULL, "1995", - "Micro Machines Turbo Tournament 96 (Euro, J-Cart)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 4, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART_SEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_microm96aRomInfo, md_microm96aRomName, NULL, NULL, Megadrive4pInputInfo, Megadrive4pDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Micro Machines 2 - Turbo Tournament (Euro, J-Cart, Alt) -static struct BurnRomInfo md_micromc2aRomDesc[] = { - { "micro machines 2 - turbo tournament (euro) (j-cart) (alt).bin", 0x100000, 0x01c22a5d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_micromc2a) -STD_ROM_FN(md_micromc2a) - -struct BurnDriver BurnDrvmd_micromc2a = { - "md_micromc2a", "md_micromc2", NULL, NULL, "1994", - "Micro Machines 2 - Turbo Tournament (Euro, J-Cart, Alt)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 4, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART_SEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_micromc2aRomInfo, md_micromc2aRomName, NULL, NULL, Megadrive4pInputInfo, Megadrive4pDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Micro Machines Military (Euro, J-Cart) -static struct BurnRomInfo md_micrommRomDesc[] = { - { "micro machines military (euro) (j-cart).bin", 0x100000, 0xb3abb15e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_micromm) -STD_ROM_FN(md_micromm) - -struct BurnDriver BurnDrvmd_micromm = { - "md_micromm", NULL, NULL, NULL, "1996", - "Micro Machines Military (Euro, J-Cart)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 4, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART_SEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_micrommRomInfo, md_micrommRomName, NULL, NULL, Megadrive4pInputInfo, Megadrive4pDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Midnight Resistance (USA) -static struct BurnRomInfo md_midresRomDesc[] = { - { "midnight resistance (usa).bin", 0x100000, 0x187c6af6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_midres) -STD_ROM_FN(md_midres) - -struct BurnDriver BurnDrvmd_midres = { - "md_midres", NULL, NULL, NULL, "1991", - "Midnight Resistance (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_midresRomInfo, md_midresRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Midnight Resistance (Jpn) -static struct BurnRomInfo md_midresjRomDesc[] = { - { "midnight resistance (jpn).bin", 0x100000, 0x8f3f6e4d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_midresj) -STD_ROM_FN(md_midresj) - -struct BurnDriver BurnDrvmd_midresj = { - "md_midresj", "md_midres", NULL, NULL, "1991", - "Midnight Resistance (Jpn)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_midresjRomInfo, md_midresjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Arcade's Greatest Hits (Euro) -static struct BurnRomInfo md_arcadeghRomDesc[] = { - { "midway presents arcade's greatest hits (euro).bin", 0x080000, 0xc0dce0e5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_arcadegh) -STD_ROM_FN(md_arcadegh) - -struct BurnDriver BurnDrvmd_arcadegh = { - "md_arcadegh", NULL, NULL, NULL, "1996", - "Arcade's Greatest Hits (Euro)\0", NULL, "Midway", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arcadeghRomInfo, md_arcadeghRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mig-29 Fighter Pilot (Euro) -static struct BurnRomInfo md_mig29RomDesc[] = { - { "mpr-15659.bin", 0x100000, 0x70b0a5d7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mig29) -STD_ROM_FN(md_mig29) - -struct BurnDriver BurnDrvmd_mig29 = { - "md_mig29", NULL, NULL, NULL, "1993", - "Mig-29 Fighter Pilot (Euro)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mig29RomInfo, md_mig29RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mig-29 Fighter Pilot (Jpn) -static struct BurnRomInfo md_mig29jRomDesc[] = { - { "mig-29 fighter pilot (jpn).bin", 0x100000, 0x3d239046, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mig29j) -STD_ROM_FN(md_mig29j) - -struct BurnDriver BurnDrvmd_mig29j = { - "md_mig29j", "md_mig29", NULL, NULL, "1993", - "Mig-29 Fighter Pilot (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mig29jRomInfo, md_mig29jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mig-29 Fighter Pilot (USA) -static struct BurnRomInfo md_mig29uRomDesc[] = { - { "mig-29 fighter pilot (usa).bin", 0x100000, 0x59ccabb2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mig29u) -STD_ROM_FN(md_mig29u) - -struct BurnDriver BurnDrvmd_mig29u = { - "md_mig29u", "md_mig29", NULL, NULL, "1993", - "Mig-29 Fighter Pilot (USA)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mig29uRomInfo, md_mig29uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Might and Magic - Gates to Another World (Euro, USA) -static struct BurnRomInfo md_mightmagRomDesc[] = { - { "might and magic - gates to another world (euro, usa).bin", 0x0c0000, 0xf509145f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mightmag) -STD_ROM_FN(md_mightmag) - -struct BurnDriver BurnDrvmd_mightmag = { - "md_mightmag", NULL, NULL, NULL, "1991", - "Might and Magic - Gates to Another World (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mightmagRomInfo, md_mightmagRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Might and Magic III - Isles of Terra (USA, Prototype) -static struct BurnRomInfo md_mightmg3RomDesc[] = { - { "might and magic iii - isles of terra (usa) (prototype).bin", 0x200000, 0x6ef7104a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mightmg3) -STD_ROM_FN(md_mightmg3) - -struct BurnDriver BurnDrvmd_mightmg3 = { - "md_mightmg3", NULL, NULL, NULL, "1993", - "Might and Magic III - Isles of Terra (USA, Prototype)\0", NULL, "FCI?", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mightmg3RomInfo, md_mightmg3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers (Euro) -static struct BurnRomInfo md_mmprRomDesc[] = { - { "mighty morphin power rangers (euro).bin", 0x200000, 0x7f96e663, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmpr) -STD_ROM_FN(md_mmpr) - -struct BurnDriver BurnDrvmd_mmpr = { - "md_mmpr", NULL, NULL, NULL, "1994", - "Mighty Morphin Power Rangers (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprRomInfo, md_mmprRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers (USA) -static struct BurnRomInfo md_mmpruRomDesc[] = { - { "mighty morphin power rangers (usa).bin", 0x200000, 0x715158a9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmpru) -STD_ROM_FN(md_mmpru) - -struct BurnDriver BurnDrvmd_mmpru = { - "md_mmpru", "md_mmpr", NULL, NULL, "1994", - "Mighty Morphin Power Rangers (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmpruRomInfo, md_mmpruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers (USA, Prototype, 19940804) -static struct BurnRomInfo md_mmprp4RomDesc[] = { - { "mighty morphin power rangers (prototype - aug 04, 1994).bin", 0x200000, 0xf3ae5aaf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprp4) -STD_ROM_FN(md_mmprp4) - -struct BurnDriver BurnDrvmd_mmprp4 = { - "md_mmprp4", "md_mmpr", NULL, NULL, "1994", - "Mighty Morphin Power Rangers (USA, Prototype, 19940804)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprp4RomInfo, md_mmprp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers (USA, Prototype, 19940808) -static struct BurnRomInfo md_mmprp3RomDesc[] = { - { "mighty morphin power rangers (prototype - aug 08, 1994).bin", 0x200000, 0x57644549, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprp3) -STD_ROM_FN(md_mmprp3) - -struct BurnDriver BurnDrvmd_mmprp3 = { - "md_mmprp3", "md_mmpr", NULL, NULL, "1994", - "Mighty Morphin Power Rangers (USA, Prototype, 19940808)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprp3RomInfo, md_mmprp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers (Prototype, 19940809) -static struct BurnRomInfo md_mmprp2RomDesc[] = { - { "mighty morphin power rangers (prototype - aug 09, 1994).bin", 0x200000, 0x4356fe0a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprp2) -STD_ROM_FN(md_mmprp2) - -struct BurnDriver BurnDrvmd_mmprp2 = { - "md_mmprp2", "md_mmpr", NULL, NULL, "1994", - "Mighty Morphin Power Rangers (Prototype, 19940809)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprp2RomInfo, md_mmprp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers (Prototype, 19940810) -static struct BurnRomInfo md_mmprp1RomDesc[] = { - { "mighty morphin power rangers (prototype - aug 10, 1994).bin", 0x200000, 0xe79cd214, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprp1) -STD_ROM_FN(md_mmprp1) - -struct BurnDriver BurnDrvmd_mmprp1 = { - "md_mmprp1", "md_mmpr", NULL, NULL, "1994", - "Mighty Morphin Power Rangers (Prototype, 19940810)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprp1RomInfo, md_mmprp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers (Prototype, 19940708) -static struct BurnRomInfo md_mmprp6RomDesc[] = { - { "mighty morphin power rangers (prototype - jul 08, 1994).bin", 0x200000, 0xe6916c54, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprp6) -STD_ROM_FN(md_mmprp6) - -struct BurnDriver BurnDrvmd_mmprp6 = { - "md_mmprp6", "md_mmpr", NULL, NULL, "1994", - "Mighty Morphin Power Rangers (Prototype, 19940708)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprp6RomInfo, md_mmprp6RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers (Prototype, 19940718) -static struct BurnRomInfo md_mmprp5RomDesc[] = { - { "mighty morphin power rangers (prototype - jul 18, 1994).bin", 0x200000, 0x5accdb1a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprp5) -STD_ROM_FN(md_mmprp5) - -struct BurnDriver BurnDrvmd_mmprp5 = { - "md_mmprp5", "md_mmpr", NULL, NULL, "1994", - "Mighty Morphin Power Rangers (Prototype, 19940718)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprp5RomInfo, md_mmprp5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers - The Movie (Euro) -static struct BurnRomInfo md_mmprtmRomDesc[] = { - { "mighty morphin power rangers - the movie (euro).bin", 0x200000, 0x254a4972, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprtm) -STD_ROM_FN(md_mmprtm) - -struct BurnDriver BurnDrvmd_mmprtm = { - "md_mmprtm", NULL, NULL, NULL, "1995", - "Mighty Morphin Power Rangers - The Movie (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprtmRomInfo, md_mmprtmRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers - The Movie (USA) -static struct BurnRomInfo md_mmprtmuRomDesc[] = { - { "mighty morphin power rangers - the movie (usa).bin", 0x200000, 0xaa941cbc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprtmu) -STD_ROM_FN(md_mmprtmu) - -struct BurnDriver BurnDrvmd_mmprtmu = { - "md_mmprtmu", "md_mmprtm", NULL, NULL, "1995", - "Mighty Morphin Power Rangers - The Movie (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprtmuRomInfo, md_mmprtmuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers - The Movie (USA, Prototype, 19950713) -static struct BurnRomInfo md_mmprtmp4RomDesc[] = { - { "mighty morphin power rangers - the movie (prototype - jul 13, 1995).bin", 0x200000, 0x227bf7fd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprtmp4) -STD_ROM_FN(md_mmprtmp4) - -struct BurnDriver BurnDrvmd_mmprtmp4 = { - "md_mmprtmp4", "md_mmprtm", NULL, NULL, "1995", - "Mighty Morphin Power Rangers - The Movie (USA, Prototype, 19950713)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprtmp4RomInfo, md_mmprtmp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers - The Movie (USA, Prototype, 19950717) -static struct BurnRomInfo md_mmprtmp3RomDesc[] = { - { "mighty morphin power rangers - the movie (prototype - jul 17, 1995).bin", 0x200000, 0x579de657, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprtmp3) -STD_ROM_FN(md_mmprtmp3) - -struct BurnDriver BurnDrvmd_mmprtmp3 = { - "md_mmprtmp3", "md_mmprtm", NULL, NULL, "1995", - "Mighty Morphin Power Rangers - The Movie (USA, Prototype, 19950717)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprtmp3RomInfo, md_mmprtmp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers - The Movie (USA, Prototype, 19950722) -static struct BurnRomInfo md_mmprtmp2RomDesc[] = { - { "mighty morphin power rangers - the movie (prototype - jul 22, 1995).bin", 0x200000, 0xc2ca3a8b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprtmp2) -STD_ROM_FN(md_mmprtmp2) - -struct BurnDriver BurnDrvmd_mmprtmp2 = { - "md_mmprtmp2", "md_mmprtm", NULL, NULL, "1995", - "Mighty Morphin Power Rangers - The Movie (USA, Prototype, 19950722)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprtmp2RomInfo, md_mmprtmp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers - The Movie (USA, Prototype, 19950724) -static struct BurnRomInfo md_mmprtmp1RomDesc[] = { - { "mighty morphin power rangers - the movie (prototype - jul 24, 1995).bin", 0x200000, 0x3429fa3a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprtmp1) -STD_ROM_FN(md_mmprtmp1) - -struct BurnDriver BurnDrvmd_mmprtmp1 = { - "md_mmprtmp1", "md_mmprtm", NULL, NULL, "1995", - "Mighty Morphin Power Rangers - The Movie (USA, Prototype, 19950724)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprtmp1RomInfo, md_mmprtmp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mike Ditka Power Football (Euro, USA) -static struct BurnRomInfo md_ditkapfRomDesc[] = { - { "mike ditka power football (euro, usa).bin", 0x100000, 0x6078b310, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ditkapf) -STD_ROM_FN(md_ditkapf) - -struct BurnDriver BurnDrvmd_ditkapf = { - "md_ditkapf", NULL, NULL, NULL, "1991", - "Mike Ditka Power Football (Euro, USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ditkapfRomInfo, md_ditkapfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mike Ditka Power Football (Euro, USA, Alt) -static struct BurnRomInfo md_ditkapf1RomDesc[] = { - { "mike ditka power football (euro, usa) (alt).bin", 0x100000, 0xde50ca8e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ditkapf1) -STD_ROM_FN(md_ditkapf1) - -struct BurnDriver BurnDrvmd_ditkapf1 = { - "md_ditkapf1", "md_ditkapf", NULL, NULL, "1991", - "Mike Ditka Power Football (Euro, USA, Alt)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ditkapf1RomInfo, md_ditkapf1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Minnesota Fats - Pool Legend (USA) -static struct BurnRomInfo md_mfpoolRomDesc[] = { - { "minnesota fats - pool legend (usa).bin", 0x100000, 0x38174f40, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mfpool) -STD_ROM_FN(md_mfpool) - -struct BurnDriver BurnDrvmd_mfpool = { - "md_mfpool", NULL, NULL, NULL, "1995", - "Minnesota Fats - Pool Legend (USA)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mfpoolRomInfo, md_mfpoolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chou Kyuukai Miracle Nine (Jpn) -static struct BurnRomInfo md_miracle9RomDesc[] = { - { "chou kyuukai miracle nine (jpn).bin", 0x200000, 0x6d8c2206, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_miracle9) -STD_ROM_FN(md_miracle9) - -struct BurnDriver BurnDrvmd_miracle9 = { - "md_miracle9", NULL, NULL, NULL, "1995", - "Chou Kyuukai Miracle Nine (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_miracle9RomInfo, md_miracle9RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Miracle Piano Teaching System (USA) -static struct BurnRomInfo md_miraclepRomDesc[] = { - { "miracle piano teaching system, the (usa).bin", 0x080000, 0xa719542e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_miraclep) -STD_ROM_FN(md_miraclep) - -struct BurnDriver BurnDrvmd_miraclep = { - "md_miraclep", NULL, NULL, NULL, "1992", - "The Miracle Piano Teaching System (USA)\0", NULL, "Software Toolworks", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_miraclepRomInfo, md_miraclepRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// MK 5 - Mortal Combat - SubZero -static struct BurnRomInfo md_mk5RomDesc[] = { - { "mk 5 - mortal combat - subzero (unl).bin", 0x200000, 0x11e367a1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mk5) -STD_ROM_FN(md_mk5) - -struct BurnDriver BurnDrvmd_mk5 = { - "md_mk5", NULL, NULL, NULL, "199?", - "MK 5 - Mortal Combat - SubZero\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mk5RomInfo, md_mk5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// MK 5 - Mortal Combat - SubZero (Pirate) -static struct BurnRomInfo md_mk5aRomDesc[] = { - { "mk 5 - mortal combat - subzero (unl) (pirate).bin", 0x200000, 0x41203006, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mk5a) -STD_ROM_FN(md_mk5a) - -struct BurnDriver BurnDrvmd_mk5a = { - "md_mk5a", "md_mk5", NULL, NULL, "199?", - "MK 5 - Mortal Combat - SubZero (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mk5aRomInfo, md_mk5aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// MLBPA Baseball (USA) -static struct BurnRomInfo md_mlbpaRomDesc[] = { - { "mlbpa baseball (usa).bin", 0x200000, 0x14a8064d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mlbpa) -STD_ROM_FN(md_mlbpa) - -struct BurnDriver BurnDrvmd_mlbpa = { - "md_mlbpa", NULL, NULL, NULL, "1992", - "MLBPA Baseball (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_mlbpaRomInfo, md_mlbpaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Monopoly (USA) -static struct BurnRomInfo md_monopolyRomDesc[] = { - { "monopoly (usa).bin", 0x080000, 0xc10268da, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_monopoly) -STD_ROM_FN(md_monopoly) - -struct BurnDriver BurnDrvmd_monopoly = { - "md_monopoly", NULL, NULL, NULL, "1992", - "Monopoly (USA)\0", NULL, "Parker Brothers", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_monopolyRomInfo, md_monopolyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Monopoly (USA, Prototype) -static struct BurnRomInfo md_monopolypRomDesc[] = { - { "monopoly (usa) (beta).bin", 0x080000, 0xdfbcc3fa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_monopolyp) -STD_ROM_FN(md_monopolyp) - -struct BurnDriver BurnDrvmd_monopolyp = { - "md_monopolyp", "md_monopoly", NULL, NULL, "1992", - "Monopoly (USA, Prototype)\0", NULL, "Parker Brothers", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_monopolypRomInfo, md_monopolypRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Monster World IV (Jpn) -static struct BurnRomInfo md_mworld4RomDesc[] = { - { "monster world iv (jpn).bin", 0x200000, 0x36a3aaa4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mworld4) -STD_ROM_FN(md_mworld4) - -struct BurnDriver BurnDrvmd_mworld4 = { - "md_mworld4", NULL, NULL, NULL, "1994", - "Monster World IV (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_mworld4RomInfo, md_mworld4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mortal Kombat (World, v1.1) -static struct BurnRomInfo md_mkRomDesc[] = { - { "mortal kombat (world) (v1.1).bin", 0x200000, 0x33f19ab6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mk) -STD_ROM_FN(md_mk) - -struct BurnDriver BurnDrvmd_mk = { - "md_mk", NULL, NULL, NULL, "1993", - "Mortal Kombat (World, v1.1)\0", NULL, "Arena", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mkRomInfo, md_mkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mortal Kombat (World) -static struct BurnRomInfo md_mkaRomDesc[] = { - { "s215_ver_1.00.bin", 0x200000, 0x1aa3a207, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mka) -STD_ROM_FN(md_mka) - -struct BurnDriver BurnDrvmd_mka = { - "md_mka", "md_mk", NULL, NULL, "1993", - "Mortal Kombat (World)\0", NULL, "Arena", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mkaRomInfo, md_mkaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mortal Kombat II (World) -static struct BurnRomInfo md_mk2RomDesc[] = { - { "s376-u2.1+s382-u1.1.bin", 0x300000, 0xa9e013d8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mk2) -STD_ROM_FN(md_mk2) - -struct BurnDriver BurnDrvmd_mk2 = { - "md_mk2", NULL, NULL, NULL, "1994", - "Mortal Kombat II (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mk2RomInfo, md_mk2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mortal Kombat 3 (Euro) -static struct BurnRomInfo md_mk3RomDesc[] = { - { "mortal_kombat_3_pal.bin", 0x400000, 0xaf6de3e8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mk3) -STD_ROM_FN(md_mk3) - -struct BurnDriver BurnDrvmd_mk3 = { - "md_mk3", NULL, NULL, NULL, "1995", - "Mortal Kombat 3 (Euro)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mk3RomInfo, md_mk3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mortal Kombat 3 (USA) -static struct BurnRomInfo md_mk3uRomDesc[] = { - { "mortal kombat 3 (usa).bin", 0x400000, 0xdd638af6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mk3u) -STD_ROM_FN(md_mk3u) - -struct BurnDriver BurnDrvmd_mk3u = { - "md_mk3u", "md_mk3", NULL, NULL, "1995", - "Mortal Kombat 3 (USA)\0", NULL, "Williams", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mk3uRomInfo, md_mk3uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mr. Nutz (Euro) -static struct BurnRomInfo md_mrnutzRomDesc[] = { - { "mr. nutz (euro).bin", 0x100000, 0x0786ea0b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mrnutz) -STD_ROM_FN(md_mrnutz) - -struct BurnDriver BurnDrvmd_mrnutz = { - "md_mrnutz", NULL, NULL, NULL, "1994", - "Mr. Nutz (Euro)\0", NULL, "Ocean", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mrnutzRomInfo, md_mrnutzRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mr. Nutz - Hoppin' Mad (Prototype) -static struct BurnRomInfo md_mrnutz2RomDesc[] = { - { "mr. nutz - hoppin' mad (proto).bin", 0x100000, 0x2bfcaa3e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mrnutz2) -STD_ROM_FN(md_mrnutz2) - -struct BurnDriver BurnDrvmd_mrnutz2 = { - "md_mrnutz2", NULL, NULL, NULL, "1994", - "Mr. Nutz - Hoppin' Mad (Prototype)\0", NULL, "Ocean", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mrnutz2RomInfo, md_mrnutz2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ms. Pac-Man (Euro, USA) -static struct BurnRomInfo md_mspacmanRomDesc[] = { - { "ms. pac-man (euro, usa).bin", 0x020000, 0xaf041be6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mspacman) -STD_ROM_FN(md_mspacman) - -struct BurnDriver BurnDrvmd_mspacman = { - "md_mspacman", NULL, NULL, NULL, "1991", - "Ms. Pac-Man (Euro, USA)\0", NULL, "Tengen ~ Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mspacmanRomInfo, md_mspacmanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ms. Pac-Man (Pirate, Ripped from Golden 10 in 1) -static struct BurnRomInfo md_mspacmanpirRomDesc[] = { - { "ms. pac-man (usa) (pirate).bin", 0x020000, 0x39b51b26, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mspacmanpir) -STD_ROM_FN(md_mspacmanpir) - -struct BurnDriver BurnDrvmd_mspacmanpir = { - "md_mspacmanpir", "md_mspacman", NULL, NULL, "199?", - "Ms. Pac-Man (Pirate, Ripped from Golden 10 in 1)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mspacmanpirRomInfo, md_mspacmanpirRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Muhammad Ali Heavyweight Boxing (Euro) -static struct BurnRomInfo md_muhammadRomDesc[] = { - { "muhammad ali heavyweight boxing (euro).bin", 0x100000, 0x8ea4717b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_muhammad) -STD_ROM_FN(md_muhammad) - -struct BurnDriver BurnDrvmd_muhammad = { - "md_muhammad", NULL, NULL, NULL, "1992", - "Muhammad Ali Heavyweight Boxing (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_muhammadRomInfo, md_muhammadRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Muhammad Ali Heavyweight Boxing (USA) -static struct BurnRomInfo md_muhammaduRomDesc[] = { - { "muhammad ali heavyweight boxing (usa).bin", 0x100000, 0xb638b6a3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_muhammadu) -STD_ROM_FN(md_muhammadu) - -struct BurnDriver BurnDrvmd_muhammadu = { - "md_muhammadu", "md_muhammad", NULL, NULL, "1992", - "Muhammad Ali Heavyweight Boxing (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_muhammaduRomInfo, md_muhammaduRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Muhammad Ali Heavyweight Boxing (USA, Prototype) -static struct BurnRomInfo md_muhammadupRomDesc[] = { - { "muhammad ali heavyweight boxing (usa) (beta).bin", 0x100000, 0x7b852653, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_muhammadup) -STD_ROM_FN(md_muhammadup) - -struct BurnDriver BurnDrvmd_muhammadup = { - "md_muhammadup", "md_muhammad", NULL, NULL, "1992", - "Muhammad Ali Heavyweight Boxing (USA, Prototype)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_muhammadupRomInfo, md_muhammadupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// MUSHA - Metallic Uniframe Super Hybrid Armor (USA) -static struct BurnRomInfo md_mushaRomDesc[] = { - { "musha - metallic uniframe super hybrid armor (usa).bin", 0x080000, 0x58a7f7b4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_musha) -STD_ROM_FN(md_musha) - -struct BurnDriver BurnDrvmd_musha = { - "md_musha", NULL, NULL, NULL, "1990", - "MUSHA - Metallic Uniframe Super Hybrid Armor (USA)\0", NULL, "Seismic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mushaRomInfo, md_mushaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Musha Aleste - Full Metal Fighter Ellinor (Jpn) -static struct BurnRomInfo md_mushajRomDesc[] = { - { "musha aleste - full metal fighter ellinor (jpn).bin", 0x080000, 0x8fde18ab, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mushaj) -STD_ROM_FN(md_mushaj) - -struct BurnDriver BurnDrvmd_mushaj = { - "md_mushaj", "md_musha", NULL, NULL, "1990", - "Musha Aleste - Full Metal Fighter Ellinor (Jpn)\0", NULL, "Toaplan", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mushajRomInfo, md_mushajRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mutant League Football (Jpn) -static struct BurnRomInfo md_mlfootbjRomDesc[] = { - { "mutant league football (jpn).bin", 0x100000, 0x2a97e6af, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mlfootbj) -STD_ROM_FN(md_mlfootbj) - -struct BurnDriver BurnDrvmd_mlfootbj = { - "md_mlfootbj", "md_mlfootb", NULL, NULL, "1993", - "Mutant League Football (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mlfootbjRomInfo, md_mlfootbjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mutant League Hockey (Euro, USA) -static struct BurnRomInfo md_mlhockeyRomDesc[] = { - { "mutant league hockey (euro, usa).bin", 0x200000, 0x3529180f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mlhockey) -STD_ROM_FN(md_mlhockey) - -struct BurnDriver BurnDrvmd_mlhockey = { - "md_mlhockey", NULL, NULL, NULL, "1994", - "Mutant League Hockey (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mlhockeyRomInfo, md_mlhockeyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mystic Defender (Euro, USA, Rev. A) -static struct BurnRomInfo md_mystdefRomDesc[] = { - { "mpr-12707a.bin", 0x080000, 0x50fd5d93, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mystdef) -STD_ROM_FN(md_mystdef) - -struct BurnDriver BurnDrvmd_mystdef = { - "md_mystdef", NULL, NULL, NULL, "1989", - "Mystic Defender (Euro, USA, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mystdefRomInfo, md_mystdefRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mystic Defender (Euro, USA) -static struct BurnRomInfo md_mystdefaRomDesc[] = { - { "mpr-12707.bin", 0x080000, 0xf9ce1ab8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mystdefa) -STD_ROM_FN(md_mystdefa) - -struct BurnDriver BurnDrvmd_mystdefa = { - "md_mystdefa", "md_mystdef", NULL, NULL, "1989", - "Mystic Defender (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mystdefaRomInfo, md_mystdefaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kujaku Ou 2 - Geneijou (Jpn) -static struct BurnRomInfo md_kujaku2RomDesc[] = { - { "kujaku ou 2 - geneijou (jpn).bin", 0x060000, 0xaffd56bc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kujaku2) -STD_ROM_FN(md_kujaku2) - -struct BurnDriver BurnDrvmd_kujaku2 = { - "md_kujaku2", "md_mystdef", NULL, NULL, "1989", - "Kujaku Ou 2 - Geneijou (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kujaku2RomInfo, md_kujaku2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// On Dal Jang Goon (Kor) -static struct BurnRomInfo md_ondalRomDesc[] = { - { "on dal jang goon (kor).bin", 0x080000, 0x67ccb1ca, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ondal) -STD_ROM_FN(md_ondal) - -struct BurnDriver BurnDrvmd_ondal = { - "md_ondal", "md_mystdef", NULL, NULL, "1990?", - "On Dal Jang Goon (Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ondalRomInfo, md_ondalRomName, NULL, NULL, MegadriveInputInfo, MegadriveJNTSCDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mystical Fighter (USA) -static struct BurnRomInfo md_mysticfRomDesc[] = { - { "mystical fighter (usa).bin", 0x080000, 0xb2f2a69b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mysticf) -STD_ROM_FN(md_mysticf) - -struct BurnDriver BurnDrvmd_mysticf = { - "md_mysticf", NULL, NULL, NULL, "1992", - "Mystical Fighter (USA)\0", NULL, "Dreamworks", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mysticfRomInfo, md_mysticfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Maou Renjishi (Jpn) -static struct BurnRomInfo md_maourenRomDesc[] = { - { "maou renjishi (jpn).bin", 0x080000, 0x24a7f28c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_maouren) -STD_ROM_FN(md_maouren) - -struct BurnDriver BurnDrvmd_maouren = { - "md_maouren", "md_mysticf", NULL, NULL, "1991", - "Maou Renjishi (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_maourenRomInfo, md_maourenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fushigi no Umi no Nadia (Jpn) -static struct BurnRomInfo md_nadiaRomDesc[] = { - { "namcot_mfn_mb838200-20.bin", 0x100000, 0x4762062a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nadia) -STD_ROM_FN(md_nadia) - -struct BurnDriver BurnDrvmd_nadia = { - "md_nadia", NULL, NULL, NULL, "1991", - "Fushigi no Umi no Nadia (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nadiaRomInfo, md_nadiaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nakajima Satoru Kanshuu F1 Grand Prix (Jpn) -static struct BurnRomInfo md_nakaf1gpRomDesc[] = { - { "nakajima satoru kanshuu f1 grand prix (jpn).bin", 0x100000, 0x93be47cf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nakaf1gp) -STD_ROM_FN(md_nakaf1gp) - -struct BurnDriver BurnDrvmd_nakaf1gp = { - "md_nakaf1gp", NULL, NULL, NULL, "1991", - "Nakajima Satoru Kanshuu F1 Grand Prix (Jpn)\0", NULL, "Varie", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nakaf1gpRomInfo, md_nakaf1gpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nakajima Satoru Kanshuu F1 Hero MD (Jpn) -static struct BurnRomInfo md_f1heromdRomDesc[] = { - { "nakajima satoru kanshuu f1 hero md (jpn).bin", 0x100000, 0x24f87987, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_f1heromd) -STD_ROM_FN(md_f1heromd) - -struct BurnDriver BurnDrvmd_f1heromd = { - "md_f1heromd", NULL, NULL, NULL, "1992", - "Nakajima Satoru Kanshuu F1 Hero MD (Jpn)\0", NULL, "Varie", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_f1heromdRomInfo, md_f1heromdRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nakajima Satoru Kanshuu F1 Super License (Jpn) -static struct BurnRomInfo md_nakaf1slRomDesc[] = { - { "nakajima satoru kanshuu f1 super license (jpn).bin", 0x100000, 0x8774bc79, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nakaf1sl) -STD_ROM_FN(md_nakaf1sl) - -struct BurnDriver BurnDrvmd_nakaf1sl = { - "md_nakaf1sl", NULL, NULL, NULL, "1992", - "Nakajima Satoru Kanshuu F1 Super License (Jpn)\0", NULL, "Varie", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nakaf1slRomInfo, md_nakaf1slRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action (USA) -static struct BurnRomInfo md_nbaactRomDesc[] = { - { "nba action (usa).bin", 0x200000, 0x99c348ba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact) -STD_ROM_FN(md_nbaact) - -struct BurnDriver BurnDrvmd_nbaact = { - "md_nbaact", NULL, NULL, NULL, "1994", - "NBA Action (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaactRomInfo, md_nbaactRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action (Prototype, 19940104) -static struct BurnRomInfo md_nbaactp3RomDesc[] = { - { "nba action (prototype - jan 04, 1994).bin", 0x200000, 0x2491df2f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaactp3) -STD_ROM_FN(md_nbaactp3) - -struct BurnDriver BurnDrvmd_nbaactp3 = { - "md_nbaactp3", "md_nbaact", NULL, NULL, "1994", - "NBA Action (Prototype, 19940104)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nbaactp3RomInfo, md_nbaactp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action (Prototype, 19940116) -static struct BurnRomInfo md_nbaactp2RomDesc[] = { - { "nba action (prototype - jan 16, 1994).bin", 0x200000, 0xfe43c79d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaactp2) -STD_ROM_FN(md_nbaactp2) - -struct BurnDriver BurnDrvmd_nbaactp2 = { - "md_nbaactp2", "md_nbaact", NULL, NULL, "1994", - "NBA Action (Prototype, 19940116)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaactp2RomInfo, md_nbaactp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action (Prototype, 19940127, Broken - C08 missing) -static struct BurnRomInfo md_nbaactp1RomDesc[] = { - { "nba action (prototype - jan 27, 1994) (broken - c08 missing).bin", 0x200000, 0x176a4bc5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaactp1) -STD_ROM_FN(md_nbaactp1) - -struct BurnDriver BurnDrvmd_nbaactp1 = { - "md_nbaactp1", "md_nbaact", NULL, NULL, "1994", - "NBA Action (Prototype, 19940127, Broken - C08 missing)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaactp1RomInfo, md_nbaactp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Euro, USA) -static struct BurnRomInfo md_nbaact95RomDesc[] = { - { "nba action '95 starring david robinson (euro, usa).bin", 0x200000, 0xaa7006d6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95) -STD_ROM_FN(md_nbaact95) - -struct BurnDriver BurnDrvmd_nbaact95 = { - "md_nbaact95", NULL, NULL, NULL, "1995", - "NBA Action '95 (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95RomInfo, md_nbaact95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941202-B) -static struct BurnRomInfo md_nbaact95p23RomDesc[] = { - { "nba action '95 (prototype - dec 02, 1994 - b).bin", 0x200000, 0x04bf6f6e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p23) -STD_ROM_FN(md_nbaact95p23) - -struct BurnDriver BurnDrvmd_nbaact95p23 = { - "md_nbaact95p23", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941202-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p23RomInfo, md_nbaact95p23RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941209) -static struct BurnRomInfo md_nbaact95p22RomDesc[] = { - { "nba action '95 (prototype - dec 09, 1994).bin", 0x200000, 0x2b198487, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p22) -STD_ROM_FN(md_nbaact95p22) - -struct BurnDriver BurnDrvmd_nbaact95p22 = { - "md_nbaact95p22", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941209)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p22RomInfo, md_nbaact95p22RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941215) -static struct BurnRomInfo md_nbaact95p21RomDesc[] = { - { "nba action '95 (prototype - dec 15, 1994).bin", 0x200000, 0x10a3b46d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p21) -STD_ROM_FN(md_nbaact95p21) - -struct BurnDriver BurnDrvmd_nbaact95p21 = { - "md_nbaact95p21", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941215)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p21RomInfo, md_nbaact95p21RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941222-A) -static struct BurnRomInfo md_nbaact95p20RomDesc[] = { - { "nba action '95 (prototype - dec 22, 1994 - a).bin", 0x200000, 0xf92ba323, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p20) -STD_ROM_FN(md_nbaact95p20) - -struct BurnDriver BurnDrvmd_nbaact95p20 = { - "md_nbaact95p20", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941222-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p20RomInfo, md_nbaact95p20RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941224-A) -static struct BurnRomInfo md_nbaact95p19RomDesc[] = { - { "nba action '95 (prototype - dec 24, 1994 - a).bin", 0x200000, 0xddb04550, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p19) -STD_ROM_FN(md_nbaact95p19) - -struct BurnDriver BurnDrvmd_nbaact95p19 = { - "md_nbaact95p19", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941224-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p19RomInfo, md_nbaact95p19RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941229) -static struct BurnRomInfo md_nbaact95p18RomDesc[] = { - { "nba action '95 (prototype - dec 29, 1994).bin", 0x200000, 0xdcebe32a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p18) -STD_ROM_FN(md_nbaact95p18) - -struct BurnDriver BurnDrvmd_nbaact95p18 = { - "md_nbaact95p18", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941229)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p18RomInfo, md_nbaact95p18RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941230) -static struct BurnRomInfo md_nbaact95p17RomDesc[] = { - { "nba action '95 (prototype - dec 30, 1994).bin", 0x200000, 0xd87956c9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p17) -STD_ROM_FN(md_nbaact95p17) - -struct BurnDriver BurnDrvmd_nbaact95p17 = { - "md_nbaact95p17", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941230)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p17RomInfo, md_nbaact95p17RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941231) -static struct BurnRomInfo md_nbaact95p16RomDesc[] = { - { "nba action '95 (prototype - dec 31, 1994).bin", 0x200000, 0x582a378f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p16) -STD_ROM_FN(md_nbaact95p16) - -struct BurnDriver BurnDrvmd_nbaact95p16 = { - "md_nbaact95p16", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941231)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p16RomInfo, md_nbaact95p16RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950201, Alt) -static struct BurnRomInfo md_nbaact95p03RomDesc[] = { - { "nba action '95 (prototype - feb 01, 1995).bin", 0x200000, 0x2c02a79d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p03) -STD_ROM_FN(md_nbaact95p03) - -struct BurnDriver BurnDrvmd_nbaact95p03 = { - "md_nbaact95p03", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950201, Alt)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p03RomInfo, md_nbaact95p03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950201) -static struct BurnRomInfo md_nbaact95p02RomDesc[] = { - { "nba action '95 (prototype - feb 1, 1995).bin", 0x1ff49e, 0xc4a0a624, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p02) -STD_ROM_FN(md_nbaact95p02) - -struct BurnDriver BurnDrvmd_nbaact95p02 = { - "md_nbaact95p02", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950201)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p02RomInfo, md_nbaact95p02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950202) -static struct BurnRomInfo md_nbaact95p01RomDesc[] = { - { "nba action '95 (prototype - feb 2, 1995).bin", 0x1fe1f0, 0xa9167903, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p01) -STD_ROM_FN(md_nbaact95p01) - -struct BurnDriver BurnDrvmd_nbaact95p01 = { - "md_nbaact95p01", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950202)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p01RomInfo, md_nbaact95p01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950103) -static struct BurnRomInfo md_nbaact95p15RomDesc[] = { - { "nba action '95 (prototype - jan 03, 1995).bin", 0x200000, 0x374af160, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p15) -STD_ROM_FN(md_nbaact95p15) - -struct BurnDriver BurnDrvmd_nbaact95p15 = { - "md_nbaact95p15", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950103)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p15RomInfo, md_nbaact95p15RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950108) -static struct BurnRomInfo md_nbaact95p14RomDesc[] = { - { "nba action '95 (prototype - jan 08, 1995).bin", 0x200000, 0x0a6b7b9e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p14) -STD_ROM_FN(md_nbaact95p14) - -struct BurnDriver BurnDrvmd_nbaact95p14 = { - "md_nbaact95p14", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950108)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p14RomInfo, md_nbaact95p14RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950112) -static struct BurnRomInfo md_nbaact95p13RomDesc[] = { - { "nba action '95 (prototype - jan 12, 1995).bin", 0x200000, 0xb47ff025, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p13) -STD_ROM_FN(md_nbaact95p13) - -struct BurnDriver BurnDrvmd_nbaact95p13 = { - "md_nbaact95p13", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950112)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p13RomInfo, md_nbaact95p13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950115-A) -static struct BurnRomInfo md_nbaact95p12RomDesc[] = { - { "nba action '95 (prototype - jan 15, 1995 - a).bin", 0x200000, 0x9c6a1f27, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p12) -STD_ROM_FN(md_nbaact95p12) - -struct BurnDriver BurnDrvmd_nbaact95p12 = { - "md_nbaact95p12", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950115-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p12RomInfo, md_nbaact95p12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950121) -static struct BurnRomInfo md_nbaact95p11RomDesc[] = { - { "nba action '95 (prototype - jan 21, 1995).bin", 0x200000, 0xe337bdfb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p11) -STD_ROM_FN(md_nbaact95p11) - -struct BurnDriver BurnDrvmd_nbaact95p11 = { - "md_nbaact95p11", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950121)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p11RomInfo, md_nbaact95p11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950122-B) -static struct BurnRomInfo md_nbaact95p10RomDesc[] = { - { "nba action '95 (prototype - jan 22, 1995 - b).bin", 0x200000, 0x7bd7ca47, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p10) -STD_ROM_FN(md_nbaact95p10) - -struct BurnDriver BurnDrvmd_nbaact95p10 = { - "md_nbaact95p10", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950122-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p10RomInfo, md_nbaact95p10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950124-B) -static struct BurnRomInfo md_nbaact95p09RomDesc[] = { - { "nba action '95 (prototype - jan 24, 1995 - b).bin", 0x200000, 0x15abcf41, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p09) -STD_ROM_FN(md_nbaact95p09) - -struct BurnDriver BurnDrvmd_nbaact95p09 = { - "md_nbaact95p09", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950124-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p09RomInfo, md_nbaact95p09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950127-A) -static struct BurnRomInfo md_nbaact95p08RomDesc[] = { - { "nba action '95 (prototype - jan 27, 1995 - a).bin", 0x1fe190, 0x79c7fb00, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p08) -STD_ROM_FN(md_nbaact95p08) - -struct BurnDriver BurnDrvmd_nbaact95p08 = { - "md_nbaact95p08", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950127-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p08RomInfo, md_nbaact95p08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950127-B) -static struct BurnRomInfo md_nbaact95p07RomDesc[] = { - { "nba action '95 (prototype - jan 27, 1995 - b).bin", 0x1fe190, 0xef7f608b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p07) -STD_ROM_FN(md_nbaact95p07) - -struct BurnDriver BurnDrvmd_nbaact95p07 = { - "md_nbaact95p07", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950127-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p07RomInfo, md_nbaact95p07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950128-A) -static struct BurnRomInfo md_nbaact95p06RomDesc[] = { - { "nba action '95 (prototype - jan 28, 1995 - a).bin", 0x200000, 0x57c2c69c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p06) -STD_ROM_FN(md_nbaact95p06) - -struct BurnDriver BurnDrvmd_nbaact95p06 = { - "md_nbaact95p06", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950128-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p06RomInfo, md_nbaact95p06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950128) -static struct BurnRomInfo md_nbaact95p05RomDesc[] = { - { "nba action '95 (prototype - jan 28, 1995).bin", 0x1fe19e, 0x97d7075d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p05) -STD_ROM_FN(md_nbaact95p05) - -struct BurnDriver BurnDrvmd_nbaact95p05 = { - "md_nbaact95p05", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950128)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p05RomInfo, md_nbaact95p05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19950130) -static struct BurnRomInfo md_nbaact95p04RomDesc[] = { - { "nba action '95 (prototype - jan 30, 1995).bin", 0x200000, 0x2fac80b2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p04) -STD_ROM_FN(md_nbaact95p04) - -struct BurnDriver BurnDrvmd_nbaact95p04 = { - "md_nbaact95p04", "md_nbaact95", NULL, NULL, "1995", - "NBA Action '95 (Prototype, 19950130)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p04RomInfo, md_nbaact95p04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941118) -static struct BurnRomInfo md_nbaact95p25RomDesc[] = { - { "nba action '95 (prototype - nov 18, 1994).bin", 0x200000, 0x2d411e4b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p25) -STD_ROM_FN(md_nbaact95p25) - -struct BurnDriver BurnDrvmd_nbaact95p25 = { - "md_nbaact95p25", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941118)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p25RomInfo, md_nbaact95p25RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Action '95 (Prototype, 19941123-A) -static struct BurnRomInfo md_nbaact95p24RomDesc[] = { - { "nba action '95 (prototype - nov 23, 1994 - a).bin", 0x200000, 0x4650cfcc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaact95p24) -STD_ROM_FN(md_nbaact95p24) - -struct BurnDriver BurnDrvmd_nbaact95p24 = { - "md_nbaact95p24", "md_nbaact95", NULL, NULL, "1994", - "NBA Action '95 (Prototype, 19941123-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaact95p24RomInfo, md_nbaact95p24RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA All-Star Challenge (Euro, USA) -static struct BurnRomInfo md_nbaallstRomDesc[] = { - { "nba all-star challenge (euro, usa).bin", 0x100000, 0xc4674adf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaallst) -STD_ROM_FN(md_nbaallst) - -struct BurnDriver BurnDrvmd_nbaallst = { - "md_nbaallst", NULL, NULL, NULL, "1992", - "NBA All-Star Challenge (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nbaallstRomInfo, md_nbaallstRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Hang Time (Euro) -static struct BurnRomInfo md_nbahangRomDesc[] = { - { "nba hang time (euro).bin", 0x300000, 0xedb4d4aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbahang) -STD_ROM_FN(md_nbahang) - -struct BurnDriver BurnDrvmd_nbahang = { - "md_nbahang", NULL, NULL, NULL, "1996", - "NBA Hang Time (Euro)\0", NULL, "Midway", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nbahangRomInfo, md_nbahangRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Hang Time (USA) -static struct BurnRomInfo md_nbahanguRomDesc[] = { - { "nba hang time (usa).bin", 0x300000, 0x176b0338, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbahangu) -STD_ROM_FN(md_nbahangu) - -struct BurnDriver BurnDrvmd_nbahangu = { - "md_nbahangu", "md_nbahang", NULL, NULL, "1996", - "NBA Hang Time (USA)\0", NULL, "Midway", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nbahanguRomInfo, md_nbahanguRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Jam (Euro, USA, v1.1) -static struct BurnRomInfo md_nbajamRomDesc[] = { - { "nba jam (euro, usa) (v1.1).bin", 0x200000, 0xeb8360e6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbajam) -STD_ROM_FN(md_nbajam) - -struct BurnDriver BurnDrvmd_nbajam = { - "md_nbajam", NULL, NULL, NULL, "1993", - "NBA Jam (Euro, USA, v1.1)\0", NULL, "Arena", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbajamRomInfo, md_nbajamRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Jam (Euro, USA) -static struct BurnRomInfo md_nbajam1RomDesc[] = { - { "s285_ver_1.00.bin", 0x200000, 0x10fa248f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbajam1) -STD_ROM_FN(md_nbajam1) - -struct BurnDriver BurnDrvmd_nbajam1 = { - "md_nbajam1", "md_nbajam", NULL, NULL, "1993", - "NBA Jam (Euro, USA)\0", NULL, "Arena", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbajam1RomInfo, md_nbajam1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Jam (Jpn) -static struct BurnRomInfo md_nbajamjRomDesc[] = { - { "nba jam (jpn).bin", 0x200000, 0xa6c6305a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbajamj) -STD_ROM_FN(md_nbajamj) - -struct BurnDriver BurnDrvmd_nbajamj = { - "md_nbajamj", "md_nbajam", NULL, NULL, "1994", - "NBA Jam (Jpn)\0", NULL, "Acclaim Japan", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbajamjRomInfo, md_nbajamjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Jam (Jpn, Prototype) -static struct BurnRomInfo md_nbajamjpRomDesc[] = { - { "jamod0.ic1", 0x080000, 0x8506240d, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_000000 }, - { "jamev0.ic2", 0x080000, 0x2e597f94, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_000001 }, - { "jamod1.ic3", 0x080000, 0x762c4fac, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_100000 }, - { "jamev1.ic4", 0x080000, 0x8735b9f6, BRF_PRG | SEGA_MD_ROM_LOAD16_BYTE | SEGA_MD_ROM_OFFS_100001 }, -}; - -STD_ROM_PICK(md_nbajamjp) -STD_ROM_FN(md_nbajamjp) - -struct BurnDriver BurnDrvmd_nbajamjp = { - "md_nbajamjp", "md_nbajam", NULL, NULL, "1994", - "NBA Jam (Jpn, Prototype)\0", NULL, "Acclaim Japan", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbajamjpRomInfo, md_nbajamjpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Jam Tournament Edition (World) -static struct BurnRomInfo md_nbajamteRomDesc[] = { - { "nba jam tournament edition (world).bin", 0x300000, 0xe9ffcb37, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbajamte) -STD_ROM_FN(md_nbajamte) - -struct BurnDriver BurnDrvmd_nbajamte = { - "md_nbajamte", NULL, NULL, NULL, "1995", - "NBA Jam Tournament Edition (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM_TE, GBF_MISC, 0, - MegadriveGetZipName, md_nbajamteRomInfo, md_nbajamteRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Jam Tournament Edition (World, 2002 Fix Release) -static struct BurnRomInfo md_nbajamtefRomDesc[] = { - { "nba jam tournament edition (world) (fixed).bin", 0x300000, 0x6e25ebf0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbajamtef) -STD_ROM_FN(md_nbajamtef) - -struct BurnDriver BurnDrvmd_nbajamtef = { - "md_nbajamtef", "md_nbajamte", NULL, NULL, "2002?", - "NBA Jam Tournament Edition (World, 2002 Fix Release)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM_TE, GBF_MISC, 0, - MegadriveGetZipName, md_nbajamtefRomInfo, md_nbajamtefRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Live 95 (Euro, USA) -static struct BurnRomInfo md_nbaliv95RomDesc[] = { - { "nba live 95 (euro, usa).bin", 0x200000, 0x66018abc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaliv95) -STD_ROM_FN(md_nbaliv95) - -struct BurnDriver BurnDrvmd_nbaliv95 = { - "md_nbaliv95", NULL, NULL, NULL, "1994", - "NBA Live 95 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaliv95RomInfo, md_nbaliv95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Live 95 (Kor) -static struct BurnRomInfo md_nbaliv95kRomDesc[] = { - { "lh5370hc.bin", 0x200000, 0x779c1244, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaliv95k) -STD_ROM_FN(md_nbaliv95k) - -struct BurnDriver BurnDrvmd_nbaliv95k = { - "md_nbaliv95k", "md_nbaliv95", NULL, NULL, "1994", - "NBA Live 95 (Kor)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nbaliv95kRomInfo, md_nbaliv95kRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Live 96 (Euro, USA) -static struct BurnRomInfo md_nbaliv96RomDesc[] = { - { "nba live 96 (euro, usa).bin", 0x200000, 0x49de0062, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaliv96) -STD_ROM_FN(md_nbaliv96) - -struct BurnDriver BurnDrvmd_nbaliv96 = { - "md_nbaliv96", NULL, NULL, NULL, "1995", - "NBA Live 96 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaliv96RomInfo, md_nbaliv96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Live 97 (Euro, USA) -static struct BurnRomInfo md_nbaliv97RomDesc[] = { - { "nba live 97 (euro, usa).bin", 0x200000, 0x7024843a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaliv97) -STD_ROM_FN(md_nbaliv97) - -struct BurnDriver BurnDrvmd_nbaliv97 = { - "md_nbaliv97", NULL, NULL, NULL, "1996", - "NBA Live 97 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbaliv97RomInfo, md_nbaliv97RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Live 98 (USA) -static struct BurnRomInfo md_nbaliv98RomDesc[] = { - { "nba live 98 (usa).bin", 0x200000, 0x23473a8a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbaliv98) -STD_ROM_FN(md_nbaliv98) - -struct BurnDriver BurnDrvmd_nbaliv98 = { - "md_nbaliv98", NULL, NULL, NULL, "1997", - "NBA Live 98 (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nbaliv98RomInfo, md_nbaliv98RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Playoffs - Bulls Vs Blazers (Jpn) -static struct BurnRomInfo md_bullvsbljRomDesc[] = { - { "nba playoffs - bulls vs blazers (jpn).bin", 0x100000, 0xeae8c000, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bullvsblj) -STD_ROM_FN(md_bullvsblj) - -struct BurnDriver BurnDrvmd_bullvsblj = { - "md_bullvsblj", "md_bullvsbl", NULL, NULL, "1993", - "NBA Playoffs - Bulls Vs Blazers (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bullvsbljRomInfo, md_bullvsbljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Playoffs - Bulls Vs Blazers (Jpn, Alt) -static struct BurnRomInfo md_bullvsblj1RomDesc[] = { - { "nba playoffs - bulls vs blazers (jpn) (alt).bin", 0x100000, 0x4565ce1f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bullvsblj1) -STD_ROM_FN(md_bullvsblj1) - -struct BurnDriver BurnDrvmd_bullvsblj1 = { - "md_bullvsblj1", "md_bullvsbl", NULL, NULL, "1993", - "NBA Playoffs - Bulls Vs Blazers (Jpn, Alt)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bullvsblj1RomInfo, md_bullvsblj1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Pro Basketball - Bulls Vs Lakers (Jpn) -static struct BurnRomInfo md_bullvslajRomDesc[] = { - { "nba pro basketball - bulls vs lakers (jpn).bin", 0x100000, 0x4416ce39, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bullvslaj) -STD_ROM_FN(md_bullvslaj) - -struct BurnDriver BurnDrvmd_bullvslaj = { - "md_bullvslaj", "md_bullvsla", NULL, NULL, "1993", - "NBA Pro Basketball - Bulls Vs Lakers (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bullvslajRomInfo, md_bullvslajRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Pro Basketball '94 (Jpn) -static struct BurnRomInfo md_nbapro94RomDesc[] = { - { "nba pro basketball '94 (jpn).bin", 0x200000, 0xeea19bce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbapro94) -STD_ROM_FN(md_nbapro94) - -struct BurnDriver BurnDrvmd_nbapro94 = { - "md_nbapro94", NULL, NULL, NULL, "1994", - "NBA Pro Basketball '94 (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbapro94RomInfo, md_nbapro94RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Showdown '94 (Euro, USA) -static struct BurnRomInfo md_nbashowRomDesc[] = { - { "nba showdown '94 (euro, usa).bin", 0x200000, 0x160b7090, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbashow) -STD_ROM_FN(md_nbashow) - -struct BurnDriver BurnDrvmd_nbashow = { - "md_nbashow", NULL, NULL, NULL, "1994", - "NBA Showdown '94 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbashowRomInfo, md_nbashowRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA Showdown '94 (USA, Prototype, Hacked) -static struct BurnRomInfo md_nbashowpRomDesc[] = { - { "nba showdown '94 (usa) (beta).bin", 0x200000, 0x6643a308, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nbashowp) -STD_ROM_FN(md_nbashowp) - -struct BurnDriver BurnDrvmd_nbashowp = { - "md_nbashowp", "md_nbashow", NULL, NULL, "1994", - "NBA Showdown '94 (USA, Prototype, Hacked)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nbashowpRomInfo, md_nbashowpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NCAA Final Four Basketball (USA) -static struct BurnRomInfo md_ncaabaskRomDesc[] = { - { "ncaa final four basketball (usa).bin", 0x180000, 0xed0c1303, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ncaabask) -STD_ROM_FN(md_ncaabask) - -struct BurnDriver BurnDrvmd_ncaabask = { - "md_ncaabask", NULL, NULL, NULL, "1994", - "NCAA Final Four Basketball (USA)\0", NULL, "Mindscape", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ncaabaskRomInfo, md_ncaabaskRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NCAA Football (USA) -static struct BurnRomInfo md_ncaafootRomDesc[] = { - { "ncaa football (usa).bin", 0x100000, 0x081012f0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ncaafoot) -STD_ROM_FN(md_ncaafoot) - -struct BurnDriver BurnDrvmd_ncaafoot = { - "md_ncaafoot", NULL, NULL, NULL, "1994", - "NCAA Football (USA)\0", NULL, "Mindscape", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ncaafootRomInfo, md_ncaafootRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nekketsu Koukou Dodgeball Bu - Soccer Hen MD (Jpn) -static struct BurnRomInfo md_neksoccrRomDesc[] = { - { "nekketsu koukou dodgeball bu - soccer hen md (jpn).bin", 0x080000, 0xf49c3a86, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_neksoccr) -STD_ROM_FN(md_neksoccr) - -struct BurnDriver BurnDrvmd_neksoccr = { - "md_neksoccr", NULL, NULL, NULL, "1992", - "Nekketsu Koukou Dodgeball Bu - Soccer Hen MD (Jpn)\0", NULL, "Palsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_neksoccrRomInfo, md_neksoccrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// New 3D Golf Simulation - Devil's Course (Jpn) -static struct BurnRomInfo md_n3dgdeviRomDesc[] = { - { "new 3d golf simulation devil's course (jpn).bin", 0x180000, 0xbd090c67, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_n3dgdevi) -STD_ROM_FN(md_n3dgdevi) - -struct BurnDriver BurnDrvmd_n3dgdevi = { - "md_n3dgdevi", NULL, NULL, NULL, "1994", - "New 3D Golf Simulation - Devil's Course (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_n3dgdeviRomInfo, md_n3dgdeviRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// New 3D Golf Simulation - Harukanaru Augusta (Jpn) -static struct BurnRomInfo md_n3dgauguRomDesc[] = { - { "mpr-16076.bin", 0x180000, 0xd2a9bf92, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_n3dgaugu) -STD_ROM_FN(md_n3dgaugu) - -struct BurnDriver BurnDrvmd_n3dgaugu = { - "md_n3dgaugu", NULL, NULL, NULL, "1993", - "New 3D Golf Simulation - Harukanaru Augusta (Jpn)\0", NULL, "T & E Soft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_n3dgauguRomInfo, md_n3dgauguRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// New 3D Golf Simulation - Waialae no Kiseki (Jpn) -static struct BurnRomInfo md_n3dgwaiaRomDesc[] = { - { "new 3d golf simulation waialae no kiseki (jpn).bin", 0x180000, 0xcbe2c1f6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_n3dgwaia) -STD_ROM_FN(md_n3dgwaia) - -struct BurnDriver BurnDrvmd_n3dgwaia = { - "md_n3dgwaia", NULL, NULL, NULL, "1994", - "New 3D Golf Simulation - Waialae no Kiseki (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_n3dgwaiaRomInfo, md_n3dgwaiaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Euro, USA) -static struct BurnRomInfo md_nfl95RomDesc[] = { - { "nfl '95 (euro, usa).bin", 0x200000, 0xb58e4a81, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95) -STD_ROM_FN(md_nfl95) - -struct BurnDriver BurnDrvmd_nfl95 = { - "md_nfl95", NULL, NULL, NULL, "1994", - "NFL '95 (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95RomInfo, md_nfl95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940801) -static struct BurnRomInfo md_nfl95p21RomDesc[] = { - { "nfl '95 (prototype - aug 01, 1994).bin", 0x200000, 0x5a57ea4e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p21) -STD_ROM_FN(md_nfl95p21) - -struct BurnDriver BurnDrvmd_nfl95p21 = { - "md_nfl95p21", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940801)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p21RomInfo, md_nfl95p21RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940805) -static struct BurnRomInfo md_nfl95p20RomDesc[] = { - { "nfl '95 (prototype - aug 05, 1994).bin", 0x200000, 0x88d51773, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p20) -STD_ROM_FN(md_nfl95p20) - -struct BurnDriver BurnDrvmd_nfl95p20 = { - "md_nfl95p20", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940805)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p20RomInfo, md_nfl95p20RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940810) -static struct BurnRomInfo md_nfl95p19RomDesc[] = { - { "nfl '95 (prototype - aug 10, 1994).bin", 0x200000, 0xa3c5710b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p19) -STD_ROM_FN(md_nfl95p19) - -struct BurnDriver BurnDrvmd_nfl95p19 = { - "md_nfl95p19", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940810)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p19RomInfo, md_nfl95p19RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940812) -static struct BurnRomInfo md_nfl95p18RomDesc[] = { - { "nfl '95 (prototype - aug 12, 1994).bin", 0x200000, 0x3d23633b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p18) -STD_ROM_FN(md_nfl95p18) - -struct BurnDriver BurnDrvmd_nfl95p18 = { - "md_nfl95p18", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940812)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p18RomInfo, md_nfl95p18RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940812, Alt) -static struct BurnRomInfo md_nfl95p17RomDesc[] = { - { "nfl '95 (prototype - aug 12, 1994 - b).bin", 0x200000, 0xcc86a259, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p17) -STD_ROM_FN(md_nfl95p17) - -struct BurnDriver BurnDrvmd_nfl95p17 = { - "md_nfl95p17", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940812, Alt)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p17RomInfo, md_nfl95p17RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940817-B) -static struct BurnRomInfo md_nfl95p16RomDesc[] = { - { "nfl '95 (prototype - aug 17, 1994 - b).bin", 0x200000, 0xa6015c29, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p16) -STD_ROM_FN(md_nfl95p16) - -struct BurnDriver BurnDrvmd_nfl95p16 = { - "md_nfl95p16", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940817-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p16RomInfo, md_nfl95p16RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940817) -static struct BurnRomInfo md_nfl95p15RomDesc[] = { - { "nfl '95 (prototype - aug 17, 1994).bin", 0x200000, 0x655966c8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p15) -STD_ROM_FN(md_nfl95p15) - -struct BurnDriver BurnDrvmd_nfl95p15 = { - "md_nfl95p15", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940817)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p15RomInfo, md_nfl95p15RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940822) -static struct BurnRomInfo md_nfl95p14RomDesc[] = { - { "nfl '95 (prototype - aug 22, 1994).bin", 0x200000, 0xb01434e5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p14) -STD_ROM_FN(md_nfl95p14) - -struct BurnDriver BurnDrvmd_nfl95p14 = { - "md_nfl95p14", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940822)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p14RomInfo, md_nfl95p14RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940830) -static struct BurnRomInfo md_nfl95p13RomDesc[] = { - { "nfl '95 (prototype - aug 30, 1994).bin", 0x200000, 0xd0e0a436, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p13) -STD_ROM_FN(md_nfl95p13) - -struct BurnDriver BurnDrvmd_nfl95p13 = { - "md_nfl95p13", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940830)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p13RomInfo, md_nfl95p13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940831) -static struct BurnRomInfo md_nfl95p12RomDesc[] = { - { "nfl '95 (prototype - aug 31, 1994).bin", 0x200000, 0xc360521e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p12) -STD_ROM_FN(md_nfl95p12) - -struct BurnDriver BurnDrvmd_nfl95p12 = { - "md_nfl95p12", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940831)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p12RomInfo, md_nfl95p12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940901) -static struct BurnRomInfo md_nfl95p11RomDesc[] = { - { "nfl '95 (prototype - sep 01, 1994).bin", 0x200000, 0x9240fcaa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p11) -STD_ROM_FN(md_nfl95p11) - -struct BurnDriver BurnDrvmd_nfl95p11 = { - "md_nfl95p11", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940901)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p11RomInfo, md_nfl95p11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940902) -static struct BurnRomInfo md_nfl95p10RomDesc[] = { - { "nfl '95 (prototype - sep 02, 1994).bin", 0x200000, 0xff049a49, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p10) -STD_ROM_FN(md_nfl95p10) - -struct BurnDriver BurnDrvmd_nfl95p10 = { - "md_nfl95p10", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940902)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p10RomInfo, md_nfl95p10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940904) -static struct BurnRomInfo md_nfl95p09RomDesc[] = { - { "nfl '95 (prototype - sep 04, 1994).bin", 0x200000, 0x60604d40, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p09) -STD_ROM_FN(md_nfl95p09) - -struct BurnDriver BurnDrvmd_nfl95p09 = { - "md_nfl95p09", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940904)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p09RomInfo, md_nfl95p09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940905-B) -static struct BurnRomInfo md_nfl95p08RomDesc[] = { - { "nfl '95 (prototype - sep 05, 1994 - b).bin", 0x200000, 0x123985a5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p08) -STD_ROM_FN(md_nfl95p08) - -struct BurnDriver BurnDrvmd_nfl95p08 = { - "md_nfl95p08", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940905-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p08RomInfo, md_nfl95p08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940905) -static struct BurnRomInfo md_nfl95p07RomDesc[] = { - { "nfl '95 (prototype - sep 05, 1994).bin", 0x200000, 0xdbdf61ac, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p07) -STD_ROM_FN(md_nfl95p07) - -struct BurnDriver BurnDrvmd_nfl95p07 = { - "md_nfl95p07", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940905)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p07RomInfo, md_nfl95p07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940906) -static struct BurnRomInfo md_nfl95p06RomDesc[] = { - { "nfl '95 (prototype - sep 06, 1994).bin", 0x200000, 0x624b8699, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p06) -STD_ROM_FN(md_nfl95p06) - -struct BurnDriver BurnDrvmd_nfl95p06 = { - "md_nfl95p06", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940906)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p06RomInfo, md_nfl95p06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940907) -static struct BurnRomInfo md_nfl95p05RomDesc[] = { - { "nfl '95 (prototype - sep 07, 1994).bin", 0x200000, 0xae8aa4be, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p05) -STD_ROM_FN(md_nfl95p05) - -struct BurnDriver BurnDrvmd_nfl95p05 = { - "md_nfl95p05", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940907)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p05RomInfo, md_nfl95p05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940908) -static struct BurnRomInfo md_nfl95p04RomDesc[] = { - { "nfl '95 (prototype - sep 08, 1994).bin", 0x200000, 0x22c5e289, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p04) -STD_ROM_FN(md_nfl95p04) - -struct BurnDriver BurnDrvmd_nfl95p04 = { - "md_nfl95p04", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940908)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p04RomInfo, md_nfl95p04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940909) -static struct BurnRomInfo md_nfl95p03RomDesc[] = { - { "nfl '95 (prototype - sep 09, 1994).bin", 0x200000, 0x55df1066, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p03) -STD_ROM_FN(md_nfl95p03) - -struct BurnDriver BurnDrvmd_nfl95p03 = { - "md_nfl95p03", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940909)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p03RomInfo, md_nfl95p03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940911-B) -static struct BurnRomInfo md_nfl95p02RomDesc[] = { - { "nfl '95 (prototype - sep 11, 1994 - b).bin", 0x200000, 0x111ac6a0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p02) -STD_ROM_FN(md_nfl95p02) - -struct BurnDriver BurnDrvmd_nfl95p02 = { - "md_nfl95p02", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940911-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p02RomInfo, md_nfl95p02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL '95 (Prototype, 19940911) -static struct BurnRomInfo md_nfl95p01RomDesc[] = { - { "nfl '95 (prototype - sep 11, 1994).bin", 0x200000, 0x21614c4f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl95p01) -STD_ROM_FN(md_nfl95p01) - -struct BurnDriver BurnDrvmd_nfl95p01 = { - "md_nfl95p01", "md_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940911)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl95p01RomInfo, md_nfl95p01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL 98 (USA) -static struct BurnRomInfo md_nfl98RomDesc[] = { - { "nfl 98 (usa).bin", 0x200000, 0xf73ec54c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl98) -STD_ROM_FN(md_nfl98) - -struct BurnDriver BurnDrvmd_nfl98 = { - "md_nfl98", NULL, NULL, NULL, "1997", - "NFL 98 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl98RomInfo, md_nfl98RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL Football '94 Starring Joe Montana (USA) -static struct BurnRomInfo md_nfl94RomDesc[] = { - { "nfl football '94 starring joe montana (usa).bin", 0x200000, 0x0d486ed5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl94) -STD_ROM_FN(md_nfl94) - -struct BurnDriver BurnDrvmd_nfl94 = { - "md_nfl94", NULL, NULL, NULL, "1993", - "NFL Football '94 Starring Joe Montana (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfl94RomInfo, md_nfl94RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL Football '94 Starring Joe Montana (Jpn) -static struct BurnRomInfo md_nfl94jRomDesc[] = { - { "nfl football '94 (jpn).bin", 0x200000, 0xe490dc4a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfl94j) -STD_ROM_FN(md_nfl94j) - -struct BurnDriver BurnDrvmd_nfl94j = { - "md_nfl94j", "md_nfl94", NULL, NULL, "1994", - "NFL Football '94 Starring Joe Montana (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nfl94jRomInfo, md_nfl94jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL Quarterback Club (World) -static struct BurnRomInfo md_nflqbRomDesc[] = { - { "nfl quarterback club (world).bin", 0x300000, 0x94542eaf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nflqb) -STD_ROM_FN(md_nflqb) - -struct BurnDriver BurnDrvmd_nflqb = { - "md_nflqb", NULL, NULL, NULL, "1994", - "NFL Quarterback Club (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM_TE, GBF_MISC, 0, - MegadriveGetZipName, md_nflqbRomInfo, md_nflqbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL Quarterback Club 96 (Euro, USA) -static struct BurnRomInfo md_nflqb96RomDesc[] = { - { "nfl quarterback club 96 (euro, usa).bin", 0x400000, 0xd5a37cab, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nflqb96) -STD_ROM_FN(md_nflqb96) - -struct BurnDriver BurnDrvmd_nflqb96 = { - "md_nflqb96", NULL, NULL, NULL, "1996", - "NFL Quarterback Club 96 (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_NFL_QB_96, GBF_MISC, 0, - MegadriveGetZipName, md_nflqb96RomInfo, md_nflqb96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NFL Sports Talk Football '93 Starring Joe Montana (Euro, USA) -static struct BurnRomInfo md_nflsportRomDesc[] = { - { "mpr-15005+mpr-15006.bin", 0x180000, 0xce0b1fe1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nflsport) -STD_ROM_FN(md_nflsport) - -struct BurnDriver BurnDrvmd_nflsport = { - "md_nflsport", NULL, NULL, NULL, "1992", - "NFL Sports Talk Football '93 Starring Joe Montana (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nflsportRomInfo, md_nflsportRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHK Taiga Drama - Taiheiki (Jpn) -static struct BurnRomInfo md_nhktaidrRomDesc[] = { - { "nhk taiga drama - taiheiki (jpn).bin", 0x100000, 0x09fbb30e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhktaidr) -STD_ROM_FN(md_nhktaidr) - -struct BurnDriver BurnDrvmd_nhktaidr = { - "md_nhktaidr", NULL, NULL, NULL, "1991", - "NHK Taiga Drama - Taiheiki (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhktaidrRomInfo, md_nhktaidrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL 95 (Euro, USA) -static struct BurnRomInfo md_nhl95RomDesc[] = { - { "nhl 95 (euro, usa).bin", 0x200000, 0xe8ee917e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhl95) -STD_ROM_FN(md_nhl95) - -struct BurnDriver BurnDrvmd_nhl95 = { - "md_nhl95", NULL, NULL, NULL, "1995", - "NHL 95 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhl95RomInfo, md_nhl95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL 96 (Euro, USA) -static struct BurnRomInfo md_nhl96RomDesc[] = { - { "nhl 96 (euro, usa).bin", 0x200000, 0x8135702c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhl96) -STD_ROM_FN(md_nhl96) - -struct BurnDriver BurnDrvmd_nhl96 = { - "md_nhl96", NULL, NULL, NULL, "1995", - "NHL 96 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhl96RomInfo, md_nhl96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL 97 (Euro, USA) -static struct BurnRomInfo md_nhl97RomDesc[] = { - { "nhl 97 (euro, usa).bin", 0x200000, 0xf067c103, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhl97) -STD_ROM_FN(md_nhl97) - -struct BurnDriver BurnDrvmd_nhl97 = { - "md_nhl97", NULL, NULL, NULL, "1996", - "NHL 97 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhl97RomInfo, md_nhl97RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL 98 (USA) -static struct BurnRomInfo md_nhl98RomDesc[] = { - { "nhl 98 (usa).bin", 0x200000, 0x7b64cd98, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhl98) -STD_ROM_FN(md_nhl98) - -struct BurnDriver BurnDrvmd_nhl98 = { - "md_nhl98", NULL, NULL, NULL, "1997", - "NHL 98 (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhl98RomInfo, md_nhl98RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (USA) -static struct BurnRomInfo md_nhlasRomDesc[] = { - { "nhl all-star hockey '95 (usa).bin", 0x200000, 0xe6c0218b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlas) -STD_ROM_FN(md_nhlas) - -struct BurnDriver BurnDrvmd_nhlas = { - "md_nhlas", NULL, NULL, NULL, "1995", - "NHL All-Star Hockey '95 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasRomInfo, md_nhlasRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941201-B) -static struct BurnRomInfo md_nhlasp03RomDesc[] = { - { "nhl all-star hockey '95 (prototype - dec 01, 1994 - b).bin", 0x1ffffa, 0xc209d720, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp03) -STD_ROM_FN(md_nhlasp03) - -struct BurnDriver BurnDrvmd_nhlasp03 = { - "md_nhlasp03", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941201-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp03RomInfo, md_nhlasp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941201) -static struct BurnRomInfo md_nhlasp02RomDesc[] = { - { "nhl all-star hockey '95 (prototype - dec 01, 1994).bin", 0x1ffffa, 0x112e4cb3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp02) -STD_ROM_FN(md_nhlasp02) - -struct BurnDriver BurnDrvmd_nhlasp02 = { - "md_nhlasp02", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941201)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp02RomInfo, md_nhlasp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941202) -static struct BurnRomInfo md_nhlasp01RomDesc[] = { - { "nhl all-star hockey '95 (prototype - dec 02, 1994).bin", 0x1ffffa, 0x01d6a6c7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp01) -STD_ROM_FN(md_nhlasp01) - -struct BurnDriver BurnDrvmd_nhlasp01 = { - "md_nhlasp01", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941202)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp01RomInfo, md_nhlasp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941107) -static struct BurnRomInfo md_nhlasp12RomDesc[] = { - { "nhl all-star hockey '95 (prototype - nov 07, 1994).bin", 0x200000, 0xe8f2c88f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp12) -STD_ROM_FN(md_nhlasp12) - -struct BurnDriver BurnDrvmd_nhlasp12 = { - "md_nhlasp12", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941107)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp12RomInfo, md_nhlasp12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941109) -static struct BurnRomInfo md_nhlasp11RomDesc[] = { - { "nhl all-star hockey '95 (prototype - nov 09, 1994).bin", 0x1ffff9, 0x82624073, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp11) -STD_ROM_FN(md_nhlasp11) - -struct BurnDriver BurnDrvmd_nhlasp11 = { - "md_nhlasp11", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941109)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp11RomInfo, md_nhlasp11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941119) -static struct BurnRomInfo md_nhlasp10RomDesc[] = { - { "nhl all-star hockey '95 (prototype - nov 19, 1994).bin", 0x200000, 0xcd0f588a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp10) -STD_ROM_FN(md_nhlasp10) - -struct BurnDriver BurnDrvmd_nhlasp10 = { - "md_nhlasp10", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941119)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp10RomInfo, md_nhlasp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941121) -static struct BurnRomInfo md_nhlasp09RomDesc[] = { - { "nhl all-star hockey '95 (prototype - nov 21, 1994).bin", 0x200000, 0xcfe4059d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp09) -STD_ROM_FN(md_nhlasp09) - -struct BurnDriver BurnDrvmd_nhlasp09 = { - "md_nhlasp09", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941121)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp09RomInfo, md_nhlasp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941122) -static struct BurnRomInfo md_nhlasp08RomDesc[] = { - { "nhl all-star hockey '95 (prototype - nov 22, 1994).bin", 0x1ffffa, 0x81d30fe6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp08) -STD_ROM_FN(md_nhlasp08) - -struct BurnDriver BurnDrvmd_nhlasp08 = { - "md_nhlasp08", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941122)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp08RomInfo, md_nhlasp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941123) -static struct BurnRomInfo md_nhlasp07RomDesc[] = { - { "nhl all-star hockey '95 (prototype - nov 23, 1994).bin", 0x1ffffa, 0x88d4fc38, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp07) -STD_ROM_FN(md_nhlasp07) - -struct BurnDriver BurnDrvmd_nhlasp07 = { - "md_nhlasp07", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941123)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp07RomInfo, md_nhlasp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941127) -static struct BurnRomInfo md_nhlasp06RomDesc[] = { - { "nhl all-star hockey '95 (prototype - nov 27, 1994).bin", 0x1ffffa, 0x658ffe52, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp06) -STD_ROM_FN(md_nhlasp06) - -struct BurnDriver BurnDrvmd_nhlasp06 = { - "md_nhlasp06", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941127)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp06RomInfo, md_nhlasp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941128) -static struct BurnRomInfo md_nhlasp05RomDesc[] = { - { "nhl all-star hockey '95 (prototype - nov 28, 1994).bin", 0x1ffffa, 0x51ad0056, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp05) -STD_ROM_FN(md_nhlasp05) - -struct BurnDriver BurnDrvmd_nhlasp05 = { - "md_nhlasp05", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941128)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp05RomInfo, md_nhlasp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941129) -static struct BurnRomInfo md_nhlasp04RomDesc[] = { - { "nhl all-star hockey '95 (prototype - nov 29, 1994).bin", 0x1ffffa, 0xa060a60b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp04) -STD_ROM_FN(md_nhlasp04) - -struct BurnDriver BurnDrvmd_nhlasp04 = { - "md_nhlasp04", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941129)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp04RomInfo, md_nhlasp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941001) -static struct BurnRomInfo md_nhlasp14RomDesc[] = { - { "nhl all-star hockey '95 (prototype - oct 01, 1994).bin", 0x1ffff9, 0xb1c0fbb2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp14) -STD_ROM_FN(md_nhlasp14) - -struct BurnDriver BurnDrvmd_nhlasp14 = { - "md_nhlasp14", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941001)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp14RomInfo, md_nhlasp14RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19941021) -static struct BurnRomInfo md_nhlasp13RomDesc[] = { - { "nhl all-star hockey '95 (prototype - oct 21, 1994).bin", 0x200000, 0x17eb2238, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp13) -STD_ROM_FN(md_nhlasp13) - -struct BurnDriver BurnDrvmd_nhlasp13 = { - "md_nhlasp13", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19941021)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp13RomInfo, md_nhlasp13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19940914) -static struct BurnRomInfo md_nhlasp16RomDesc[] = { - { "nhl all-star hockey '95 (prototype - sep 14, 1994).bin", 0x200000, 0x5d4bc48d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp16) -STD_ROM_FN(md_nhlasp16) - -struct BurnDriver BurnDrvmd_nhlasp16 = { - "md_nhlasp16", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19940914)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp16RomInfo, md_nhlasp16RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHL All-Star Hockey '95 (Prototype, 19940929) -static struct BurnRomInfo md_nhlasp15RomDesc[] = { - { "nhl all-star hockey '95 (prototype - sep 29, 1994).bin", 0x1ffff9, 0x96bae44f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlasp15) -STD_ROM_FN(md_nhlasp15) - -struct BurnDriver BurnDrvmd_nhlasp15 = { - "md_nhlasp15", "md_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey '95 (Prototype, 19940929)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlasp15RomInfo, md_nhlasp15RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHLPA Hockey 93 (Euro, USA, v1.1) -static struct BurnRomInfo md_nhlpa93RomDesc[] = { - { "h9306.bin", 0x080000, 0xf361d0bf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlpa93) -STD_ROM_FN(md_nhlpa93) - -struct BurnDriver BurnDrvmd_nhlpa93 = { - "md_nhlpa93", NULL, NULL, NULL, "1992", - "NHLPA Hockey 93 (Euro, USA, v1.1)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_EA_NHLPA, GBF_MISC, 0, - MegadriveGetZipName, md_nhlpa93RomInfo, md_nhlpa93RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHLPA Hockey 93 (Euro, USA) -static struct BurnRomInfo md_nhlpa93aRomDesc[] = { - { "nhlpa hockey 93 (euro, usa).bin", 0x080000, 0xcbbf4262, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlpa93a) -STD_ROM_FN(md_nhlpa93a) - -struct BurnDriver BurnDrvmd_nhlpa93a = { - "md_nhlpa93a", "md_nhlpa93", NULL, NULL, "1992", - "NHLPA Hockey 93 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_EA_NHLPA, GBF_MISC, 0, - MegadriveGetZipName, md_nhlpa93aRomInfo, md_nhlpa93aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nigel Mansell's World Championship Racing (Euro) -static struct BurnRomInfo md_mansellRomDesc[] = { - { "nigel mansell's world championship racing (euro).bin", 0x100000, 0x3fe3d63b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mansell) -STD_ROM_FN(md_mansell) - -struct BurnDriver BurnDrvmd_mansell = { - "md_mansell", NULL, NULL, NULL, "1993", - "Nigel Mansell's World Championship Racing (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mansellRomInfo, md_mansellRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nigel Mansell's World Championship Racing (USA) -static struct BurnRomInfo md_manselluRomDesc[] = { - { "nigel mansell's world championship racing (usa).bin", 0x100000, 0x6bc57b2c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mansellu) -STD_ROM_FN(md_mansellu) - -struct BurnDriver BurnDrvmd_mansellu = { - "md_mansellu", "md_mansell", NULL, NULL, "1993", - "Nigel Mansell's World Championship Racing (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_manselluRomInfo, md_manselluRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nightmare Circus (Bra) -static struct BurnRomInfo md_ncircRomDesc[] = { - { "nightmare circus (bra).bin", 0x200000, 0x06da3217, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ncirc) -STD_ROM_FN(md_ncirc) - -struct BurnDriver BurnDrvmd_ncirc = { - "md_ncirc", NULL, NULL, NULL, "1995", - "Nightmare Circus (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ncircRomInfo, md_ncircRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nightmare Circus (Bra, Alt) -static struct BurnRomInfo md_ncirc1RomDesc[] = { - { "nightmare circus (bra) (alt).bin", 0x200000, 0x31de5a94, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ncirc1) -STD_ROM_FN(md_ncirc1) - -struct BurnDriver BurnDrvmd_ncirc1 = { - "md_ncirc1", "md_ncirc", NULL, NULL, "1995", - "Nightmare Circus (Bra, Alt)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ncirc1RomInfo, md_ncirc1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nightmare Circus (Prototype) -static struct BurnRomInfo md_ncircpRomDesc[] = { - { "nightmare circus (prototype).bin", 0x400000, 0xee96f1b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ncircp) -STD_ROM_FN(md_ncircp) - -struct BurnDriver BurnDrvmd_ncircp = { - "md_ncircp", "md_ncirc", NULL, NULL, "199?", - "Nightmare Circus (Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ncircpRomInfo, md_ncircpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nikkan Sports Pro Yakyuu Van (Jpn) -static struct BurnRomInfo md_nikkanRomDesc[] = { - { "nikkan sports pro yakyuu van (jpn).bin", 0x080000, 0xc3655a59, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nikkan) -STD_ROM_FN(md_nikkan) - -struct BurnDriver BurnDrvmd_nikkan = { - "md_nikkan", NULL, NULL, NULL, "1991", - "Nikkan Sports Pro Yakyuu Van (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nikkanRomInfo, md_nikkanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ninja Burai Densetsu (Jpn) -static struct BurnRomInfo md_ninjabRomDesc[] = { - { "ninja burai densetsu (jpn).bin", 0x100000, 0xa8d828a0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ninjab) -STD_ROM_FN(md_ninjab) - -struct BurnDriver BurnDrvmd_ninjab = { - "md_ninjab", NULL, NULL, NULL, "1991", - "Ninja Burai Densetsu (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ninjabRomInfo, md_ninjabRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ninja Gaiden (Jpn, Prototype) -static struct BurnRomInfo md_ngaidenRomDesc[] = { - { "ninja gaiden (jpn) (prototype) (bad dump).bin", 0x100000, 0x0d7f74ba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ngaiden) -STD_ROM_FN(md_ngaiden) - -struct BurnDriver BurnDrvmd_ngaiden = { - "md_ngaiden", NULL, NULL, NULL, "1992", - "Ninja Gaiden (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ngaidenRomInfo, md_ngaidenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// No Escape (USA) -static struct BurnRomInfo md_noescapeRomDesc[] = { - { "no escape (usa).bin", 0x200000, 0x44ee5f20, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_noescape) -STD_ROM_FN(md_noescape) - -struct BurnDriver BurnDrvmd_noescape = { - "md_noescape", NULL, NULL, NULL, "1994", - "No Escape (USA)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_noescapeRomInfo, md_noescapeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nobunaga no Yabou - Bushou Fuuunroku (Jpn) -static struct BurnRomInfo md_nobubufuRomDesc[] = { - { "mpr-14456.bin", 0x100000, 0x30bf8637, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nobubufu) -STD_ROM_FN(md_nobubufu) - -struct BurnDriver BurnDrvmd_nobubufu = { - "md_nobubufu", NULL, NULL, NULL, "1991", - "Nobunaga no Yabou - Bushou Fuuunroku (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nobubufuRomInfo, md_nobubufuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nobunaga no Yabou - Haouden (Jpn) -static struct BurnRomInfo md_nobuhaoRomDesc[] = { - { "nobunaga no yabou - haouden (jpn).bin", 0x200000, 0x96c01fc6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nobuhao) -STD_ROM_FN(md_nobuhao) - -struct BurnDriver BurnDrvmd_nobuhao = { - "md_nobuhao", NULL, NULL, NULL, "1994", - "Nobunaga no Yabou - Haouden (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nobuhaoRomInfo, md_nobuhaoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nobunaga's Ambition (USA) -static struct BurnRomInfo md_nobuambRomDesc[] = { - { "nobunaga's ambition (usa).bin", 0x080000, 0xb9bc07bc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nobuamb) -STD_ROM_FN(md_nobuamb) - -struct BurnDriver BurnDrvmd_nobuamb = { - "md_nobuamb", NULL, NULL, NULL, "1993", - "Nobunaga's Ambition (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nobuambRomInfo, md_nobuambRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Nobunaga no Yabou - Zenkokuban (Jpn) -static struct BurnRomInfo md_nobuzenkRomDesc[] = { - { "nobunaga no yabou - zenkoku ban (jpn).bin", 0x080000, 0x1381b313, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nobuzenk) -STD_ROM_FN(md_nobuzenk) - -struct BurnDriver BurnDrvmd_nobuzenk = { - "md_nobuzenk", "md_nobuamb", NULL, NULL, "1993", - "Nobunaga no Yabou - Zenkokuban (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_nobuzenkRomInfo, md_nobuzenkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Normy's Beach Babe-O-Rama (Euro, USA) -static struct BurnRomInfo md_normyRomDesc[] = { - { "normy's beach babe-o-rama (euro, usa).bin", 0x100000, 0xb56a8220, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_normy) -STD_ROM_FN(md_normy) - -struct BurnDriver BurnDrvmd_normy = { - "md_normy", NULL, NULL, NULL, "1994", - "Normy's Beach Babe-O-Rama (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_normyRomInfo, md_normyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Olympic Gold (Euro) -static struct BurnRomInfo md_olympgldRomDesc[] = { - { "mpr-14753.bin", 0x080000, 0x924e57d3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_olympgld) -STD_ROM_FN(md_olympgld) - -struct BurnDriver BurnDrvmd_olympgld = { - "md_olympgld", NULL, NULL, NULL, "1992", - "Olympic Gold (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_olympgldRomInfo, md_olympgldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Olympic Gold (Jpn, Kor) -static struct BurnRomInfo md_olympgldjRomDesc[] = { - { "olympic gold (jpn, kor).bin", 0x080000, 0xe9c925b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_olympgldj) -STD_ROM_FN(md_olympgldj) - -struct BurnDriver BurnDrvmd_olympgldj = { - "md_olympgldj", "md_olympgld", NULL, NULL, "1992", - "Olympic Gold (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_olympgldjRomInfo, md_olympgldjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Olympic Gold (USA) -static struct BurnRomInfo md_olympglduRomDesc[] = { - { "olympic gold (usa).bin", 0x080000, 0x339594b4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_olympgldu) -STD_ROM_FN(md_olympgldu) - -struct BurnDriver BurnDrvmd_olympgldu = { - "md_olympgldu", "md_olympgld", NULL, NULL, "1992", - "Olympic Gold (USA)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_olympglduRomInfo, md_olympglduRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Olympic Gold (USA, Alt) -static struct BurnRomInfo md_olympgldu1RomDesc[] = { - { "olympic gold (usa) (alt).bin", 0x080000, 0xaf639376, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_olympgldu1) -STD_ROM_FN(md_olympgldu1) - -struct BurnDriver BurnDrvmd_olympgldu1 = { - "md_olympgldu1", "md_olympgld", NULL, NULL, "1992", - "Olympic Gold (USA, Alt)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_olympgldu1RomInfo, md_olympgldu1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Olympic Summer Games (Euro, USA) -static struct BurnRomInfo md_olympsumRomDesc[] = { - { "olympic summer games (euro, usa).bin", 0x200000, 0x9e470fb9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_olympsum) -STD_ROM_FN(md_olympsum) - -struct BurnDriver BurnDrvmd_olympsum = { - "md_olympsum", NULL, NULL, NULL, "1996", - "Olympic Summer Games (Euro, USA)\0", NULL, "Black Pearl", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_olympsumRomInfo, md_olympsumRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Onslaught (Euro, USA) -static struct BurnRomInfo md_onslauRomDesc[] = { - { "onslaught (euro, usa).bin", 0x080000, 0x9f19d6df, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_onslau) -STD_ROM_FN(md_onslau) - -struct BurnDriver BurnDrvmd_onslau = { - "md_onslau", NULL, NULL, NULL, "1991", - "Onslaught (Euro, USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_onslauRomInfo, md_onslauRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ooze (Euro) -static struct BurnRomInfo md_oozeRomDesc[] = { - { "ooze, the (euro).bin", 0x100000, 0xe16b102c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ooze) -STD_ROM_FN(md_ooze) - -struct BurnDriver BurnDrvmd_ooze = { - "md_ooze", NULL, NULL, NULL, "1995", - "The Ooze (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_oozeRomInfo, md_oozeRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ooze (Jpn, USA) -static struct BurnRomInfo md_oozejuRomDesc[] = { - { "ooze, the (usa, jpn).bin", 0x100000, 0x1c0dd42f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_oozeju) -STD_ROM_FN(md_oozeju) - -struct BurnDriver BurnDrvmd_oozeju = { - "md_oozeju", "md_ooze", NULL, NULL, "1995", - "The Ooze (Jpn, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_oozejuRomInfo, md_oozejuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ooze (Euro, Prototype, 19950728) -static struct BurnRomInfo md_oozep01RomDesc[] = { - { "ooze, the (euro) (prototype - jul 28, 1995).bin", 0x100000, 0x7cf868e7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_oozep01) -STD_ROM_FN(md_oozep01) - -struct BurnDriver BurnDrvmd_oozep01 = { - "md_oozep01", "md_ooze", NULL, NULL, "1995", - "The Ooze (Euro, Prototype, 19950728)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_oozep01RomInfo, md_oozep01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ooze (Prototype, 19950615) -static struct BurnRomInfo md_oozep07RomDesc[] = { - { "ooze, the (prototype - jun 15, 1995).bin", 0x0e35ce, 0x921106fd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_oozep07) -STD_ROM_FN(md_oozep07) - -struct BurnDriver BurnDrvmd_oozep07 = { - "md_oozep07", "md_ooze", NULL, NULL, "1995", - "The Ooze (Prototype, 19950615)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_oozep07RomInfo, md_oozep07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ooze (Prototype, 19950619) -static struct BurnRomInfo md_oozep06RomDesc[] = { - { "ooze, the (prototype - jun 19, 1995).bin", 0x100000, 0xfa39281d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_oozep06) -STD_ROM_FN(md_oozep06) - -struct BurnDriver BurnDrvmd_oozep06 = { - "md_oozep06", "md_ooze", NULL, NULL, "1995", - "The Ooze (Prototype, 19950619)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_oozep06RomInfo, md_oozep06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ooze (Prototype, 19950629-B) -static struct BurnRomInfo md_oozep03RomDesc[] = { - { "ooze, the (prototype - jun 29, 1995 - b).bin", 0x0ee456, 0xca93e93b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_oozep03) -STD_ROM_FN(md_oozep03) - -struct BurnDriver BurnDrvmd_oozep03 = { - "md_oozep03", "md_ooze", NULL, NULL, "1995", - "The Ooze (Prototype, 19950629-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_oozep03RomInfo, md_oozep03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ooze (Prototype, 19950629) -static struct BurnRomInfo md_oozep02RomDesc[] = { - { "ooze, the (prototype - jun 29, 1995).bin", 0x100000, 0x1776763b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_oozep02) -STD_ROM_FN(md_oozep02) - -struct BurnDriver BurnDrvmd_oozep02 = { - "md_oozep02", "md_ooze", NULL, NULL, "1995", - "The Ooze (Prototype, 19950629)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_oozep02RomInfo, md_oozep02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ooze (Prototype 104, 19950622) -static struct BurnRomInfo md_oozep05RomDesc[] = { - { "ooze, the (prototype 104 - jun 22, 1995).bin", 0x0ebea8, 0xce1f139f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_oozep05) -STD_ROM_FN(md_oozep05) - -struct BurnDriver BurnDrvmd_oozep05 = { - "md_oozep05", "md_ooze", NULL, NULL, "1995", - "The Ooze (Prototype 104, 19950622)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_oozep05RomInfo, md_oozep05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ooze (Prototype 112, 19950626) -static struct BurnRomInfo md_oozep04RomDesc[] = { - { "ooze, the (prototype 112 - jun 26, 1995).bin", 0x0ec570, 0x70419442, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_oozep04) -STD_ROM_FN(md_oozep04) - -struct BurnDriver BurnDrvmd_oozep04 = { - "md_oozep04", "md_ooze", NULL, NULL, "1995", - "The Ooze (Prototype 112, 19950626)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_oozep04RomInfo, md_oozep04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Operation Europe - Path to Victory 1939-45 (USA) -static struct BurnRomInfo md_opeuropeRomDesc[] = { - { "operation europe - path to victory 1939-45 (usa).bin", 0x100000, 0xe7cba1d8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_opeurope) -STD_ROM_FN(md_opeurope) - -struct BurnDriver BurnDrvmd_opeurope = { - "md_opeurope", NULL, NULL, NULL, "1994", - "Operation Europe - Path to Victory 1939-45 (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_opeuropeRomInfo, md_opeuropeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Europa Sensen (Jpn) -static struct BurnRomInfo md_eurosensRomDesc[] = { - { "europa sensen (jpn).bin", 0x100000, 0xb0416c60, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_eurosens) -STD_ROM_FN(md_eurosens) - -struct BurnDriver BurnDrvmd_eurosens = { - "md_eurosens", "md_opeurope", NULL, NULL, "1993", - "Europa Sensen (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_eurosensRomInfo, md_eurosensRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Osomatsu-kun Hachamecha Gekijou (Jpn) -static struct BurnRomInfo md_osomatsuRomDesc[] = { - { "osomatsu-kun hachamecha gekijou (jpn).bin", 0x040000, 0x2453350c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_osomatsu) -STD_ROM_FN(md_osomatsu) - -struct BurnDriver BurnDrvmd_osomatsu = { - "md_osomatsu", NULL, NULL, NULL, "1988", - "Osomatsu-kun Hachamecha Gekijou (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_osomatsuRomInfo, md_osomatsuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ottifants (Euro) -static struct BurnRomInfo md_ottifantRomDesc[] = { - { "ottifants, the (euro).bin", 0x100000, 0x41ac8003, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ottifant) -STD_ROM_FN(md_ottifant) - -struct BurnDriver BurnDrvmd_ottifant = { - "md_ottifant", NULL, NULL, NULL, "1993", - "The Ottifants (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ottifantRomInfo, md_ottifantRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Ottifants (Ger, Prototype) -static struct BurnRomInfo md_ottifantgRomDesc[] = { - { "ottifants, the (germany) (beta).bin", 0x100000, 0xc6e3dd23, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ottifantg) -STD_ROM_FN(md_ottifantg) - -struct BurnDriver BurnDrvmd_ottifantg = { - "md_ottifantg", "md_ottifant", NULL, NULL, "1993", - "The Ottifants (Ger, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ottifantgRomInfo, md_ottifantgRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Outlander (Euro) -static struct BurnRomInfo md_outlandrRomDesc[] = { - { "outlander (euro).bin", 0x100000, 0xfe6f2350, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_outlandr) -STD_ROM_FN(md_outlandr) - -struct BurnDriver BurnDrvmd_outlandr = { - "md_outlandr", NULL, NULL, NULL, "1992", - "Outlander (Euro)\0", NULL, "Mindscape", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_outlandrRomInfo, md_outlandrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Outlander (USA) -static struct BurnRomInfo md_outlandruRomDesc[] = { - { "outlander (usa).bin", 0x100000, 0xc5ba7bbf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_outlandru) -STD_ROM_FN(md_outlandru) - -struct BurnDriver BurnDrvmd_outlandru = { - "md_outlandru", "md_outlandr", NULL, NULL, "1992", - "Outlander (USA)\0", NULL, "Mindscape", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_outlandruRomInfo, md_outlandruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// OutRun (Euro, USA) -static struct BurnRomInfo md_outrunRomDesc[] = { - { "outrun (euro, usa).bin", 0x100000, 0xfdd9a8d2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_outrun) -STD_ROM_FN(md_outrun) - -struct BurnDriver BurnDrvmd_outrun = { - "md_outrun", NULL, NULL, NULL, "1991", - "OutRun (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_outrunRomInfo, md_outrunRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// OutRun (Jpn) -static struct BurnRomInfo md_outrunjRomDesc[] = { - { "outrun (jpn).bin", 0x100000, 0xee7d9f4a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_outrunj) -STD_ROM_FN(md_outrunj) - -struct BurnDriver BurnDrvmd_outrunj = { - "md_outrunj", "md_outrun", NULL, NULL, "1991", - "OutRun (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_outrunjRomInfo, md_outrunjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// OutRun 2019 (Euro) -static struct BurnRomInfo md_outr2019RomDesc[] = { - { "mpr-15482.bin", 0x100000, 0x5cb3536a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_outr2019) -STD_ROM_FN(md_outr2019) - -struct BurnDriver BurnDrvmd_outr2019 = { - "md_outr2019", NULL, NULL, NULL, "1993", - "OutRun 2019 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_outr2019RomInfo, md_outr2019RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// OutRun 2019 (Jpn) -static struct BurnRomInfo md_outr2019jRomDesc[] = { - { "outrun 2019 (jpn).bin", 0x100000, 0x0eac7440, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_outr2019j) -STD_ROM_FN(md_outr2019j) - -struct BurnDriver BurnDrvmd_outr2019j = { - "md_outr2019j", "md_outr2019", NULL, NULL, "1993", - "OutRun 2019 (Jpn)\0", NULL, "Sims", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_outr2019jRomInfo, md_outr2019jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// OutRun 2019 (USA) -static struct BurnRomInfo md_outr2019uRomDesc[] = { - { "outrun 2019 (usa).bin", 0x100000, 0xe32e17e2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_outr2019u) -STD_ROM_FN(md_outr2019u) - -struct BurnDriver BurnDrvmd_outr2019u = { - "md_outr2019u", "md_outr2019", NULL, NULL, "1993", - "OutRun 2019 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_outr2019uRomInfo, md_outr2019uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// OutRun 2019 (USA, Prototype) -static struct BurnRomInfo md_outr2019upRomDesc[] = { - { "outrun 2019 (usa) (beta).bin", 0x100000, 0xd2ecddfa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_outr2019up) -STD_ROM_FN(md_outr2019up) - -struct BurnDriver BurnDrvmd_outr2019up = { - "md_outr2019up", "md_outr2019", NULL, NULL, "1993", - "OutRun 2019 (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_outr2019upRomInfo, md_outr2019upRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Junker's High (Jpn, Prototype) -static struct BurnRomInfo md_junkerRomDesc[] = { - { "junker's high (jpn) (beta) (bad dump).bin", 0x100000, 0x23534949, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_junker) -STD_ROM_FN(md_junker) - -struct BurnDriver BurnDrvmd_junker = { - "md_junker", "md_outr2019", NULL, NULL, "199?", - "Junker's High (Jpn, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_junkerRomInfo, md_junkerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// OutRunners (USA) -static struct BurnRomInfo md_orunnersRomDesc[] = { - { "outrunners (usa).bin", 0x200000, 0xede636b9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_orunners) -STD_ROM_FN(md_orunners) - -struct BurnDriver BurnDrvmd_orunners = { - "md_orunners", NULL, NULL, NULL, "1994", - "OutRunners (USA)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_orunnersRomInfo, md_orunnersRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// OutRunners (Jpn) -static struct BurnRomInfo md_orunnersjRomDesc[] = { - { "outrunners (jpn).bin", 0x200000, 0xe164a09f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_orunnersj) -STD_ROM_FN(md_orunnersj) - -struct BurnDriver BurnDrvmd_orunnersj = { - "md_orunnersj", "md_orunners", NULL, NULL, "1994", - "OutRunners (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_orunnersjRomInfo, md_orunnersjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pac-Attack (USA) -static struct BurnRomInfo md_pacattakRomDesc[] = { - { "pac-attack (usa).bin", 0x040000, 0x5df382f7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pacattak) -STD_ROM_FN(md_pacattak) - -struct BurnDriver BurnDrvmd_pacattak = { - "md_pacattak", "md_pacpanic", NULL, NULL, "1993", - "Pac-Attack (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pacattakRomInfo, md_pacattakRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pac-Man 2 - The New Adventures (USA) -static struct BurnRomInfo md_pacman2RomDesc[] = { - { "pac-man 2 - the new adventures (usa).bin", 0x200000, 0xfe7a7ed1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pacman2) -STD_ROM_FN(md_pacman2) - -struct BurnDriver BurnDrvmd_pacman2 = { - "md_pacman2", NULL, NULL, NULL, "1994", - "Pac-Man 2 - The New Adventures (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pacman2RomInfo, md_pacman2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pac-Mania (Euro, USA) -static struct BurnRomInfo md_pacmaniaRomDesc[] = { - { "mpr-14392.bin", 0x040000, 0x74bba09b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pacmania) -STD_ROM_FN(md_pacmania) - -struct BurnDriver BurnDrvmd_pacmania = { - "md_pacmania", NULL, NULL, NULL, "1991", - "Pac-Mania (Euro, USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pacmaniaRomInfo, md_pacmaniaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pac-Panic (Euro) -static struct BurnRomInfo md_pacpanicRomDesc[] = { - { "pac-panic (euro).bin", 0x040000, 0x3c427882, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pacpanic) -STD_ROM_FN(md_pacpanic) - -struct BurnDriver BurnDrvmd_pacpanic = { - "md_pacpanic", NULL, NULL, NULL, "1993", - "Pac-Panic (Euro)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pacpanicRomInfo, md_pacpanicRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pachinko Kuunyan (Jpn) -static struct BurnRomInfo md_pachinkoRomDesc[] = { - { "pachinko kuunyan (jpn).bin", 0x100000, 0x9d137e7f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pachinko) -STD_ROM_FN(md_pachinko) - -struct BurnDriver BurnDrvmd_pachinko = { - "md_pachinko", NULL, NULL, NULL, "1992", - "Pachinko Kuunyan (Jpn)\0", NULL, "Soft Vision International", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pachinkoRomInfo, md_pachinkoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// P.T.O. - Pacific Theater of Operations (USA) -static struct BurnRomInfo md_ptoRomDesc[] = { - { "pacific theater of operations (usa).bin", 0x100000, 0xd9d4c6e2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pto) -STD_ROM_FN(md_pto) - -struct BurnDriver BurnDrvmd_pto = { - "md_pto", NULL, NULL, NULL, "1993", - "P.T.O. - Pacific Theater of Operations (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ptoRomInfo, md_ptoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Teitoku no Ketsudan (Jpn) -static struct BurnRomInfo md_teiketsuRomDesc[] = { - { "teitoku no ketsudan (jpn).bin", 0x100000, 0x9b08e4e4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_teiketsu) -STD_ROM_FN(md_teiketsu) - -struct BurnDriver BurnDrvmd_teiketsu = { - "md_teiketsu", "md_pto", NULL, NULL, "1992", - "Teitoku no Ketsudan (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_teiketsuRomInfo, md_teiketsuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Paddle Fighter (Jpn, SegaNet) -static struct BurnRomInfo md_paddleRomDesc[] = { - { "paddle fighter (jpn) (sn).bin", 0x040000, 0x3d8147e6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_paddle) -STD_ROM_FN(md_paddle) - -struct BurnDriver BurnDrvmd_paddle = { - "md_paddle", NULL, NULL, NULL, "1991", - "Paddle Fighter (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_paddleRomInfo, md_paddleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Paddle Fighter (Jpn, Game no Kandume MegaCD Rip) -static struct BurnRomInfo md_paddlegnkRomDesc[] = { - { "paddle fighter (jpn) (gnk).bin", 0x040000, 0xebef05a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_paddlegnk) -STD_ROM_FN(md_paddlegnk) - -struct BurnDriver BurnDrvmd_paddlegnk = { - "md_paddlegnk", "md_paddle", NULL, NULL, "1991", - "Paddle Fighter (Jpn, Game no Kandume MegaCD Rip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_paddlegnkRomInfo, md_paddlegnkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Pagemaster (Euro) -static struct BurnRomInfo md_pagemstrRomDesc[] = { - { "pagemaster, the (euro).bin", 0x200000, 0x79a180e2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pagemstr) -STD_ROM_FN(md_pagemstr) - -struct BurnDriver BurnDrvmd_pagemstr = { - "md_pagemstr", NULL, NULL, NULL, "1994", - "The Pagemaster (Euro)\0", NULL, "Fox Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pagemstrRomInfo, md_pagemstrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Pagemaster (USA) -static struct BurnRomInfo md_pagemstruRomDesc[] = { - { "pagemaster, the (usa).bin", 0x200000, 0x75a96d4e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pagemstru) -STD_ROM_FN(md_pagemstru) - -struct BurnDriver BurnDrvmd_pagemstru = { - "md_pagemstru", "md_pagemstr", NULL, NULL, "1994", - "The Pagemaster (USA)\0", NULL, "Fox Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pagemstruRomInfo, md_pagemstruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Pagemaster (USA, Prototype) -static struct BurnRomInfo md_pagemstrupRomDesc[] = { - { "pagemaster, the (usa) (beta).bin", 0x200000, 0x29895e3d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pagemstrup) -STD_ROM_FN(md_pagemstrup) - -struct BurnDriver BurnDrvmd_pagemstrup = { - "md_pagemstrup", "md_pagemstr", NULL, NULL, "1994", - "The Pagemaster (USA, Prototype)\0", NULL, "Fox Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pagemstrupRomInfo, md_pagemstrupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Panorama Cotton (Jpn) -static struct BurnRomInfo md_pcottonRomDesc[] = { - { "panorama cotton (jpn).bin", 0x280000, 0x9e57d92e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pcotton) -STD_ROM_FN(md_pcotton) - -struct BurnDriver BurnDrvmd_pcotton = { - "md_pcotton", NULL, NULL, NULL, "1994", - "Panorama Cotton (Jpn)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pcottonRomInfo, md_pcottonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Paperboy (Euro, USA) -static struct BurnRomInfo md_paperboyRomDesc[] = { - { "paperboy (euro, usa).bin", 0x080000, 0x0a44819b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_paperboy) -STD_ROM_FN(md_paperboy) - -struct BurnDriver BurnDrvmd_paperboy = { - "md_paperboy", NULL, NULL, NULL, "1991", - "Paperboy (Euro, USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_paperboyRomInfo, md_paperboyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Paperboy (Jpn) -static struct BurnRomInfo md_paperboyjRomDesc[] = { - { "mpr-14774.bin", 0x080000, 0xe14250ae, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_paperboyj) -STD_ROM_FN(md_paperboyj) - -struct BurnDriver BurnDrvmd_paperboyj = { - "md_paperboyj", "md_paperboy", NULL, NULL, "1992", - "Paperboy (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_paperboyjRomInfo, md_paperboyjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Party Quiz Mega Q (Jpn) -static struct BurnRomInfo md_partyqRomDesc[] = { - { "party quiz mega q (jpn).bin", 0x100000, 0x9d4b447a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_partyq) -STD_ROM_FN(md_partyq) - -struct BurnDriver BurnDrvmd_partyq = { - "md_partyq", NULL, NULL, NULL, "1993", - "Party Quiz Mega Q (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_partyqRomInfo, md_partyqRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pebble Beach Golf Links (Euro) -static struct BurnRomInfo md_pebbleRomDesc[] = { - { "pebble beach golf links (euro).bin", 0x200000, 0x6cfc7297, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pebble) -STD_ROM_FN(md_pebble) - -struct BurnDriver BurnDrvmd_pebble = { - "md_pebble", NULL, NULL, NULL, "1993", - "Pebble Beach Golf Links (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pebbleRomInfo, md_pebbleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pebble Beach Golf Links (USA) -static struct BurnRomInfo md_pebbleuRomDesc[] = { - { "pebble beach golf links (usa).bin", 0x200000, 0x95823c43, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pebbleu) -STD_ROM_FN(md_pebbleu) - -struct BurnDriver BurnDrvmd_pebbleu = { - "md_pebbleu", "md_pebble", NULL, NULL, "1993", - "Pebble Beach Golf Links (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pebbleuRomInfo, md_pebbleuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// New 3D Golf Simulation - Pebble Beach no Hatou (Jpn) -static struct BurnRomInfo md_n3dgpebbRomDesc[] = { - { "new 3d golf simulation pebble beach no hatou (jpn).bin", 0x180000, 0x96ed2e5d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_n3dgpebb) -STD_ROM_FN(md_n3dgpebb) - -struct BurnDriver BurnDrvmd_n3dgpebb = { - "md_n3dgpebb", "md_pebble", NULL, NULL, "1993", - "New 3D Golf Simulation - Pebble Beach no Hatou (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_n3dgpebbRomInfo, md_n3dgpebbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pel's World Tournament Soccer (Euro, USA) -static struct BurnRomInfo md_pele2RomDesc[] = { - { "pele ii - world tournament soccer (euro, usa).bin", 0x200000, 0x05a486e9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pele2) -STD_ROM_FN(md_pele2) - -struct BurnDriver BurnDrvmd_pele2 = { - "md_pele2", NULL, NULL, NULL, "1994", - "Pele's World Tournament Soccer (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - L"Pel\u00e9's World Tournament Soccer (Euro, USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pele2RomInfo, md_pele2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pel! (Euro, USA) -static struct BurnRomInfo md_peleRomDesc[] = { - { "pele! (euro, usa).bin", 0x100000, 0x5a8abe51, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pele) -STD_ROM_FN(md_pele) - -struct BurnDriver BurnDrvmd_pele = { - "md_pele", NULL, NULL, NULL, "1993", - "Pele! (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - L"Pel\u00e9! (Euro, USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_peleRomInfo, md_peleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pepenga Pengo (Jpn) -static struct BurnRomInfo md_ppengoRomDesc[] = { - { "pepenga pengo (jpn).bin", 0x100000, 0xd1e2324b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ppengo) -STD_ROM_FN(md_ppengo) - -struct BurnDriver BurnDrvmd_ppengo = { - "md_ppengo", NULL, NULL, NULL, "1995", - "Pepenga Pengo (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ppengoRomInfo, md_ppengoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pete Sampras Tennis (Euro, USA, J-Cart, Alt) -static struct BurnRomInfo md_sampras1RomDesc[] = { - { "mdstee_13.bin", 0x100000, 0xaa8b19bc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sampras1) -STD_ROM_FN(md_sampras1) - -struct BurnDriver BurnDrvmd_sampras1 = { - "md_sampras1", "md_sampras", NULL, NULL, "1994", - "Pete Sampras Tennis (Euro, USA, J-Cart, Alt)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sampras1RomInfo, md_sampras1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pete Sampras Tennis (Euro, USA, J-Cart, Alt 2) -static struct BurnRomInfo md_sampras2RomDesc[] = { - { "pete sampras tennis (euro, usa) (j-cart).bin", 0x100000, 0x9ef5bbd1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sampras2) -STD_ROM_FN(md_sampras2) - -struct BurnDriver BurnDrvmd_sampras2 = { - "md_sampras2", "md_sampras", NULL, NULL, "1994", - "Pete Sampras Tennis (Euro, USA, J-Cart, Alt 2)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sampras2RomInfo, md_sampras2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// PGA European Tour (Euro, USA) -static struct BurnRomInfo md_pgaeuroRomDesc[] = { - { "euro03.bin", 0x100000, 0x8ca45acd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pgaeuro) -STD_ROM_FN(md_pgaeuro) - -struct BurnDriver BurnDrvmd_pgaeuro = { - "md_pgaeuro", NULL, NULL, NULL, "1994", - "PGA European Tour (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pgaeuroRomInfo, md_pgaeuroRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// PGA Tour 96 (Euro, USA) -static struct BurnRomInfo md_pga96RomDesc[] = { - { "pga9601.bin", 0x200000, 0x9698bbde, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pga96) -STD_ROM_FN(md_pga96) - -struct BurnDriver BurnDrvmd_pga96 = { - "md_pga96", NULL, NULL, NULL, "1995", - "PGA Tour 96 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pga96RomInfo, md_pga96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// PGA Tour Golf (Euro, USA, v1.2) -static struct BurnRomInfo md_pgaRomDesc[] = { - { "pga09.bin", 0x080000, 0xc1f0b4e1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pga) -STD_ROM_FN(md_pga) - -struct BurnDriver BurnDrvmd_pga = { - "md_pga", NULL, NULL, NULL, "1991", - "PGA Tour Golf (Euro, USA, v1.2)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pgaRomInfo, md_pgaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// PGA Tour Golf (Euro, USA, v1.1) -static struct BurnRomInfo md_pgaaRomDesc[] = { - { "pga tour golf (euro, usa) (v1.1).bin", 0x080000, 0x0489ff8e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pgaa) -STD_ROM_FN(md_pgaa) - -struct BurnDriver BurnDrvmd_pgaa = { - "md_pgaa", "md_pga", NULL, NULL, "1991", - "PGA Tour Golf (Euro, USA, v1.1)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pgaaRomInfo, md_pgaaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// PGA Tour Golf II (Euro, USA, v1.1) -static struct BurnRomInfo md_pga2RomDesc[] = { - { "pga tour golf ii (euro, usa) (v1.1).bin", 0x100000, 0xe82b8606, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pga2) -STD_ROM_FN(md_pga2) - -struct BurnDriver BurnDrvmd_pga2 = { - "md_pga2", NULL, NULL, NULL, "1992", - "PGA Tour Golf II (Euro, USA, v1.1)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pga2RomInfo, md_pga2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// PGA Tour Golf II (Jpn) -static struct BurnRomInfo md_pga2jRomDesc[] = { - { "pga tour golf ii (jpn).bin", 0x100000, 0xc05b7a4a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pga2j) -STD_ROM_FN(md_pga2j) - -struct BurnDriver BurnDrvmd_pga2j = { - "md_pga2j", "md_pga2", NULL, NULL, "1993", - "PGA Tour Golf II (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pga2jRomInfo, md_pga2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// PGA Tour Golf III (Euro, USA) -static struct BurnRomInfo md_pga3RomDesc[] = { - { "pga tour golf iii (euro, usa).bin", 0x200000, 0xaeb3f65f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pga3) -STD_ROM_FN(md_pga3) - -struct BurnDriver BurnDrvmd_pga3 = { - "md_pga3", NULL, NULL, NULL, "1994", - "PGA Tour Golf III (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pga3RomInfo, md_pga3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II (Euro, USA) -static struct BurnRomInfo md_pstar2aRomDesc[] = { - { "phantasy star ii (euro, usa).bin", 0x0c0000, 0x0d07d0ef, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar2a) -STD_ROM_FN(md_pstar2a) - -struct BurnDriver BurnDrvmd_pstar2a = { - "md_pstar2a", "md_pstar2", NULL, NULL, "1989", - "Phantasy Star II (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar2aRomInfo, md_pstar2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II (Bra) -static struct BurnRomInfo md_pstar2brRomDesc[] = { - { "phantasy star ii (bra).bin", 0x0c0000, 0xe6688b66, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar2br) -STD_ROM_FN(md_pstar2br) - -struct BurnDriver BurnDrvmd_pstar2br = { - "md_pstar2br", "md_pstar2", NULL, NULL, "199?", - "Phantasy Star II (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar2brRomInfo, md_pstar2brRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II - Kaerazaru Toki no Owari ni (Jpn) -static struct BurnRomInfo md_pstar2jRomDesc[] = { - { "mpr-12140+mpr-12181+mpr-12182.bin", 0x0c0000, 0xbec8eb5a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar2j) -STD_ROM_FN(md_pstar2j) - -struct BurnDriver BurnDrvmd_pstar2j = { - "md_pstar2j", "md_pstar2", NULL, NULL, "1989", - "Phantasy Star II - Kaerazaru Toki no Owari ni (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar2jRomInfo, md_pstar2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II - Amia's Adventure (Jpn, SegaNet) -static struct BurnRomInfo md_ps2aaRomDesc[] = { - { "phantasy star ii - amia's adventure (jpn) (sn).bin", 0x040000, 0xa3a724aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ps2aa) -STD_ROM_FN(md_ps2aa) - -struct BurnDriver BurnDrvmd_ps2aa = { - "md_ps2aa", NULL, NULL, NULL, "1991", - "Phantasy Star II - Amia's Adventure (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ps2aaRomInfo, md_ps2aaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II - Anne's Adventure (Jpn, SegaNet) -static struct BurnRomInfo md_ps2abRomDesc[] = { - { "phantasy star ii - anne's adventure (jpn) (sn).bin", 0x040000, 0xfafa5b6f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ps2ab) -STD_ROM_FN(md_ps2ab) - -struct BurnDriver BurnDrvmd_ps2ab = { - "md_ps2ab", NULL, NULL, NULL, "1991", - "Phantasy Star II - Anne's Adventure (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ps2abRomInfo, md_ps2abRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II - Huey's Adventure (Jpn, SegaNet) -static struct BurnRomInfo md_ps2acRomDesc[] = { - { "phantasy star ii - huey's adventure (jpn) (sn).bin", 0x040000, 0x1a076f83, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ps2ac) -STD_ROM_FN(md_ps2ac) - -struct BurnDriver BurnDrvmd_ps2ac = { - "md_ps2ac", NULL, NULL, NULL, "1991", - "Phantasy Star II - Huey's Adventure (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ps2acRomInfo, md_ps2acRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II - Kinds's Adventure (Jpn, SegaNet) -static struct BurnRomInfo md_ps2adRomDesc[] = { - { "phantasy star ii - kinds's adventure (jpn) (sn).bin", 0x040000, 0xc334f308, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ps2ad) -STD_ROM_FN(md_ps2ad) - -struct BurnDriver BurnDrvmd_ps2ad = { - "md_ps2ad", NULL, NULL, NULL, "1991", - "Phantasy Star II - Kinds's Adventure (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ps2adRomInfo, md_ps2adRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II - Nei's Adventure (Jpn, SegaNet) -static struct BurnRomInfo md_ps2aeRomDesc[] = { - { "phantasy star ii - nei's adventure (jpn) (sn).bin", 0x040000, 0x3d9ad465, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ps2ae) -STD_ROM_FN(md_ps2ae) - -struct BurnDriver BurnDrvmd_ps2ae = { - "md_ps2ae", NULL, NULL, NULL, "1991", - "Phantasy Star II - Nei's Adventure (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ps2aeRomInfo, md_ps2aeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II - Rudger's Adventure (Jpn, SegaNet) -static struct BurnRomInfo md_ps2afRomDesc[] = { - { "phantasy star ii - rudger's adventure (jpn) (sn).bin", 0x040000, 0x6b5916d2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ps2af) -STD_ROM_FN(md_ps2af) - -struct BurnDriver BurnDrvmd_ps2af = { - "md_ps2af", NULL, NULL, NULL, "1991", - "Phantasy Star II - Rudger's Adventure (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ps2afRomInfo, md_ps2afRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II - Shilka's Adventure (Jpn, SegaNet) -static struct BurnRomInfo md_ps2agRomDesc[] = { - { "phantasy star ii - shilka's adventure (jpn) (sn).bin", 0x040000, 0x1f83beb2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ps2ag) -STD_ROM_FN(md_ps2ag) - -struct BurnDriver BurnDrvmd_ps2ag = { - "md_ps2ag", NULL, NULL, NULL, "1991", - "Phantasy Star II - Shilka's Adventure (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ps2agRomInfo, md_ps2agRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star II - Yushis's Adventure (Jpn, SegaNet) -static struct BurnRomInfo md_ps2ahRomDesc[] = { - { "phantasy star ii - yushis's adventure (jpn) (sn).bin", 0x040000, 0xd40c76d6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ps2ah) -STD_ROM_FN(md_ps2ah) - -struct BurnDriver BurnDrvmd_ps2ah = { - "md_ps2ah", NULL, NULL, NULL, "1991", - "Phantasy Star II - Yushis's Adventure (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ps2ahRomInfo, md_ps2ahRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star III - Generations of Doom (Euro, USA, Kor) -static struct BurnRomInfo md_pstar3RomDesc[] = { - { "phantasy star iii - generations of doom (euro, usa, kor).bin", 0x0c0000, 0xc6b42b0f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar3) -STD_ROM_FN(md_pstar3) - -struct BurnDriver BurnDrvmd_pstar3 = { - "md_pstar3", NULL, NULL, NULL, "1990", - "Phantasy Star III - Generations of Doom (Euro, USA, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar3RomInfo, md_pstar3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star III - Generations of Doom (Bra) -static struct BurnRomInfo md_pstar3brRomDesc[] = { - { "phantasy star iii - generations of doom (bra).bin", 0x0c0000, 0x2e9b4c23, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar3br) -STD_ROM_FN(md_pstar3br) - -struct BurnDriver BurnDrvmd_pstar3br = { - "md_pstar3br", "md_pstar3", NULL, NULL, "1998", - "Phantasy Star III - Generations of Doom (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar3brRomInfo, md_pstar3brRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star III - Toki no Keishousha (Jpn) -static struct BurnRomInfo md_pstar3jRomDesc[] = { - { "phantasy star iii - toki no keishousha (jpn).bin", 0x0c0000, 0x6c48c06f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar3j) -STD_ROM_FN(md_pstar3j) - -struct BurnDriver BurnDrvmd_pstar3j = { - "md_pstar3j", "md_pstar3", NULL, NULL, "1990", - "Phantasy Star III - Toki no Keishousha (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar3jRomInfo, md_pstar3jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star - The End of the Millennium (USA) -static struct BurnRomInfo md_pstar4uRomDesc[] = { - { "phantasy star iv (usa).bin", 0x300000, 0xfe236442, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar4u) -STD_ROM_FN(md_pstar4u) - -struct BurnDriver BurnDrvmd_pstar4u = { - "md_pstar4u", "md_pstar4", NULL, NULL, "1994", - "Phantasy Star - The End of the Millennium (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar4uRomInfo, md_pstar4uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star - The End of the Millennium (Euro) -static struct BurnRomInfo md_pstar4RomDesc[] = { - { "phantasy star iv (euro).bin", 0x300000, 0x389c2968, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar4) -STD_ROM_FN(md_pstar4) - -struct BurnDriver BurnDrvmd_pstar4 = { - "md_pstar4", NULL, NULL, NULL, "1994", - "Phantasy Star - The End of the Millennium (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar4RomInfo, md_pstar4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star - Sennenki no Owari ni (Jpn) -static struct BurnRomInfo md_pstar4jRomDesc[] = { - { "phantasy star - sennenki no owari ni (jpn).bin", 0x300000, 0xf0bfad42, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar4j) -STD_ROM_FN(md_pstar4j) - -struct BurnDriver BurnDrvmd_pstar4j = { - "md_pstar4j", "md_pstar4", NULL, NULL, "1993", - "Phantasy Star - Sennenki no Owari ni (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar4jRomInfo, md_pstar4jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star - The End of the Millennium (Prototype, 19940815) -static struct BurnRomInfo md_pstar4p3RomDesc[] = { - { "phantasy star iv (prototype - aug 15, 1994).bin", 0x300000, 0x60137f25, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar4p3) -STD_ROM_FN(md_pstar4p3) - -struct BurnDriver BurnDrvmd_pstar4p3 = { - "md_pstar4p3", "md_pstar4", NULL, NULL, "1994", - "Phantasy Star - The End of the Millennium (Prototype, 19940815)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar4p3RomInfo, md_pstar4p3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star - The End of the Millennium (Prototype, 19940608) -static struct BurnRomInfo md_pstar4p4RomDesc[] = { - { "phantasy star iv (prototype - jun 08, 1994).bin", 0x300000, 0xdc2e1c0a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar4p4) -STD_ROM_FN(md_pstar4p4) - -struct BurnDriver BurnDrvmd_pstar4p4 = { - "md_pstar4p4", "md_pstar4", NULL, NULL, "1994", - "Phantasy Star - The End of the Millennium (Prototype, 19940608)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar4p4RomInfo, md_pstar4p4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star - The End of the Millennium (Prototype, 19940530) -static struct BurnRomInfo md_pstar4p5RomDesc[] = { - { "phantasy star iv (prototype - may 30, 1994).bin", 0x300000, 0xb32b17e1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar4p5) -STD_ROM_FN(md_pstar4p5) - -struct BurnDriver BurnDrvmd_pstar4p5 = { - "md_pstar4p5", "md_pstar4", NULL, NULL, "1994", - "Phantasy Star - The End of the Millennium (Prototype, 19940530)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar4p5RomInfo, md_pstar4p5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star - The End of the Millennium (Prototype, 19941107) -static struct BurnRomInfo md_pstar4p1RomDesc[] = { - { "phantasy star iv (prototype - nov 07, 1994).bin", 0x300000, 0xbda29cdf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar4p1) -STD_ROM_FN(md_pstar4p1) - -struct BurnDriver BurnDrvmd_pstar4p1 = { - "md_pstar4p1", "md_pstar4", NULL, NULL, "1994", - "Phantasy Star - The End of the Millennium (Prototype, 19941107)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar4p1RomInfo, md_pstar4p1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantasy Star - The End of the Millennium (Prototype, 19941027) -static struct BurnRomInfo md_pstar4p2RomDesc[] = { - { "phantasy star iv (prototype - oct 27, 1994).bin", 0x300000, 0x12a2590a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pstar4p2) -STD_ROM_FN(md_pstar4p2) - -struct BurnDriver BurnDrvmd_pstar4p2 = { - "md_pstar4p2", "md_pstar4", NULL, NULL, "1994", - "Phantasy Star - The End of the Millennium (Prototype, 19941027)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pstar4p2RomInfo, md_pstar4p2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantom 2040 (Euro) -static struct BurnRomInfo md_phantomRomDesc[] = { - { "phantom 2040 (euro).bin", 0x200000, 0xb024882e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_phantom) -STD_ROM_FN(md_phantom) - -struct BurnDriver BurnDrvmd_phantom = { - "md_phantom", NULL, NULL, NULL, "1995", - "Phantom 2040 (Euro)\0", NULL, "Viacom New Media", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_phantomRomInfo, md_phantomRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phantom 2040 (USA) -static struct BurnRomInfo md_phantomuRomDesc[] = { - { "phantom 2040 (usa).bin", 0x200000, 0xfb36e1f3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_phantomu) -STD_ROM_FN(md_phantomu) - -struct BurnDriver BurnDrvmd_phantomu = { - "md_phantomu", "md_phantom", NULL, NULL, "1995", - "Phantom 2040 (USA)\0", NULL, "Viacom New Media", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_phantomuRomInfo, md_phantomuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phelios (Euro) -static struct BurnRomInfo md_pheliosRomDesc[] = { - { "phelios (euro).bin", 0x080000, 0x13abc2b2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_phelios) -STD_ROM_FN(md_phelios) - -struct BurnDriver BurnDrvmd_phelios = { - "md_phelios", NULL, NULL, NULL, "1990", - "Phelios (Euro)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pheliosRomInfo, md_pheliosRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phelios (Jpn) -static struct BurnRomInfo md_pheliosjRomDesc[] = { - { "phelios (jpn).bin", 0x080000, 0x94596174, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pheliosj) -STD_ROM_FN(md_pheliosj) - -struct BurnDriver BurnDrvmd_pheliosj = { - "md_pheliosj", "md_phelios", NULL, NULL, "1990", - "Phelios (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pheliosjRomInfo, md_pheliosjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Phelios (USA) -static struct BurnRomInfo md_pheliosuRomDesc[] = { - { "phelios (usa).bin", 0x080000, 0x11c79320, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pheliosu) -STD_ROM_FN(md_pheliosu) - -struct BurnDriver BurnDrvmd_pheliosu = { - "md_pheliosu", "md_phelios", NULL, NULL, "1990", - "Phelios (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pheliosuRomInfo, md_pheliosuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pink Goes to Hollywood (USA, Prototype) -static struct BurnRomInfo md_pinkpRomDesc[] = { - { "pink goes to hollywood (usa) (beta).bin", 0x100000, 0x56087cff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pinkp) -STD_ROM_FN(md_pinkp) - -struct BurnDriver BurnDrvmd_pinkp = { - "md_pinkp", "md_pink", NULL, NULL, "1993", - "Pink Goes to Hollywood (USA, Prototype)\0", NULL, "TecMagik", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pinkpRomInfo, md_pinkpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pinocchio (Euro) -static struct BurnRomInfo md_pinocRomDesc[] = { - { "pinocchio (euro).bin", 0x300000, 0x28014bdc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pinoc) -STD_ROM_FN(md_pinoc) - -struct BurnDriver BurnDrvmd_pinoc = { - "md_pinoc", NULL, NULL, NULL, "1995", - "Pinocchio (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pinocRomInfo, md_pinocRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pinocchio (USA) -static struct BurnRomInfo md_pinocuRomDesc[] = { - { "pinocchio (usa).bin", 0x300000, 0xcd4128d8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pinocu) -STD_ROM_FN(md_pinocu) - -struct BurnDriver BurnDrvmd_pinocu = { - "md_pinocu", "md_pinoc", NULL, NULL, "1996", - "Pinocchio (USA)\0", NULL, "THQ", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pinocuRomInfo, md_pinocuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Pirates of Dark Water (USA, January 1994) -static struct BurnRomInfo md_piratedwRomDesc[] = { - { "pirates of dark water, the (usa) (january 1994).bin", 0x200000, 0x0c45b9f7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_piratedw) -STD_ROM_FN(md_piratedw) - -struct BurnDriver BurnDrvmd_piratedw = { - "md_piratedw", NULL, NULL, NULL, "1994", - "The Pirates of Dark Water (USA, January 1994)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_piratedwRomInfo, md_piratedwRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Pirates of Dark Water (Euro, USA, May 1994) -static struct BurnRomInfo md_piratedw1RomDesc[] = { - { "pirates of dark water, the (euro, usa) (may 1994).bin", 0x200000, 0x0a62de34, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_piratedw1) -STD_ROM_FN(md_piratedw1) - -struct BurnDriver BurnDrvmd_piratedw1 = { - "md_piratedw1", "md_piratedw", NULL, NULL, "1994", - "The Pirates of Dark Water (Euro, USA, May 1994)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_piratedw1RomInfo, md_piratedw1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pirates! Gold (USA) -static struct BurnRomInfo md_piratesRomDesc[] = { - { "pirates! gold (usa).bin", 0x100000, 0xed50e75c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pirates) -STD_ROM_FN(md_pirates) - -struct BurnDriver BurnDrvmd_pirates = { - "md_pirates", NULL, NULL, NULL, "1993", - "Pirates! Gold (USA)\0", NULL, "Microprose", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_piratesRomInfo, md_piratesRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pirates! Gold (USA, Prototype) -static struct BurnRomInfo md_piratespRomDesc[] = { - { "pirates! gold (usa) (beta).bin", 0x100000, 0x0a525641, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_piratesp) -STD_ROM_FN(md_piratesp) - -struct BurnDriver BurnDrvmd_piratesp = { - "md_piratesp", "md_pirates", NULL, NULL, "1993", - "Pirates! Gold (USA, Prototype)\0", NULL, "Microprose", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_piratespRomInfo, md_piratespRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pit-Fighter (World, Rev. A) -static struct BurnRomInfo md_pitfightRomDesc[] = { - { "mpr-14320a.bin", 0x100000, 0xd48a8b02, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pitfight) -STD_ROM_FN(md_pitfight) - -struct BurnDriver BurnDrvmd_pitfight = { - "md_pitfight", NULL, NULL, NULL, "1991", - "Pit-Fighter (World, Rev. A)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pitfightRomInfo, md_pitfightRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pit-Fighter (World) -static struct BurnRomInfo md_pitfight1RomDesc[] = { - { "pit-fighter (world).bin", 0x100000, 0x1e0e0831, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pitfight1) -STD_ROM_FN(md_pitfight1) - -struct BurnDriver BurnDrvmd_pitfight1 = { - "md_pitfight1", "md_pitfight", NULL, NULL, "1991", - "Pit-Fighter (World)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pitfight1RomInfo, md_pitfight1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pitfall - The Mayan Adventure (Euro) -static struct BurnRomInfo md_pitfallRomDesc[] = { - { "pitfall - the mayan adventure (euro).bin", 0x200000, 0xc9198e19, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pitfall) -STD_ROM_FN(md_pitfall) - -struct BurnDriver BurnDrvmd_pitfall = { - "md_pitfall", NULL, NULL, NULL, "1994", - "Pitfall - The Mayan Adventure (Euro)\0", NULL, "Activision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pitfallRomInfo, md_pitfallRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pitfall - The Mayan Adventure (USA) -static struct BurnRomInfo md_pitfalluRomDesc[] = { - { "pitfall - the mayan adventure (usa).bin", 0x200000, 0xf917e34f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pitfallu) -STD_ROM_FN(md_pitfallu) - -struct BurnDriver BurnDrvmd_pitfallu = { - "md_pitfallu", "md_pitfall", NULL, NULL, "1994", - "Pitfall - The Mayan Adventure (USA)\0", NULL, "Activision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pitfalluRomInfo, md_pitfalluRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pocahontas (Euro) -static struct BurnRomInfo md_pocahontRomDesc[] = { - { "mpr-18875.bin", 0x400000, 0x165e7987, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pocahont) -STD_ROM_FN(md_pocahont) - -struct BurnDriver BurnDrvmd_pocahont = { - "md_pocahont", NULL, NULL, NULL, "1996", - "Pocahontas (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pocahontRomInfo, md_pocahontRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pocahontas (USA) -static struct BurnRomInfo md_pocahontuRomDesc[] = { - { "pocahontas (usa).bin", 0x400000, 0x6ddd1c6d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pocahontu) -STD_ROM_FN(md_pocahontu) - -struct BurnDriver BurnDrvmd_pocahontu = { - "md_pocahontu", "md_pocahont", NULL, NULL, "1996", - "Pocahontas (USA)\0", NULL, "Disney Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pocahontuRomInfo, md_pocahontuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pocket Monsters -static struct BurnRomInfo md_pokemonRomDesc[] = { - { "pocket monsters (unl).bin", 0x200000, 0xf68f6367, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pokemon) -STD_ROM_FN(md_pokemon) - -struct BurnDriver BurnDrvmd_pokemon = { - "md_pokemon", NULL, NULL, NULL, "199?", - "Pocket Monsters\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_POKEMON, GBF_MISC, 0, - MegadriveGetZipName, md_pokemonRomInfo, md_pokemonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pocket Monsters (Alt) -static struct BurnRomInfo md_pokemonaRomDesc[] = { - { "pocket monsters (unl) (alt).bin", 0x200000, 0xfb176667, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pokemona) -STD_ROM_FN(md_pokemona) - -struct BurnDriver BurnDrvmd_pokemona = { - "md_pokemona", "md_pokemon", NULL, NULL, "199?", - "Pocket Monsters (Alt)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pokemonaRomInfo, md_pokemonaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pocket Monsters 2 -static struct BurnRomInfo md_pokemon2RomDesc[] = { - { "pocket monsters 2 (unl).bin", 0x200000, 0x30f7031f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pokemon2) -STD_ROM_FN(md_pokemon2) - -struct BurnDriver BurnDrvmd_pokemon2 = { - "md_pokemon2", NULL, NULL, NULL, "199?", - "Pocket Monsters 2\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_POKEMON2, GBF_MISC, 0, - MegadriveGetZipName, md_pokemon2RomInfo, md_pokemon2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pokemon Crazy Drummer -static struct BurnRomInfo md_pokecdRomDesc[] = { - { "pokemon crazy drummer (unl).bin", 0x200000, 0x8838a25d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pokecd) -STD_ROM_FN(md_pokecd) - -struct BurnDriver BurnDrvmd_pokecd = { - "md_pokecd", NULL, NULL, NULL, "199?", - "Pokemon Crazy Drummer\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pokecdRomInfo, md_pokecdRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Populous (Euro) -static struct BurnRomInfo md_populousRomDesc[] = { - { "populous (euro).bin", 0x080000, 0x83d56f64, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_populous) -STD_ROM_FN(md_populous) - -struct BurnDriver BurnDrvmd_populous = { - "md_populous", NULL, NULL, NULL, "1991", - "Populous (Euro)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_populousRomInfo, md_populousRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Populous (Jpn) -static struct BurnRomInfo md_populousjRomDesc[] = { - { "populous (jpn).bin", 0x080000, 0x97c26818, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_populousj) -STD_ROM_FN(md_populousj) - -struct BurnDriver BurnDrvmd_populousj = { - "md_populousj", "md_populous", NULL, NULL, "1991", - "Populous (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_populousjRomInfo, md_populousjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Populous (USA) -static struct BurnRomInfo md_populousuRomDesc[] = { - { "populous (usa).bin", 0x080000, 0xbd74b31e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_populousu) -STD_ROM_FN(md_populousu) - -struct BurnDriver BurnDrvmd_populousu = { - "md_populousu", "md_populous", NULL, NULL, "1991", - "Populous (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_populousuRomInfo, md_populousuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Power Drive (Euro) -static struct BurnRomInfo md_pdriveRomDesc[] = { - { "power drive (euro).bin", 0x100000, 0x8c00ad61, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pdrive) -STD_ROM_FN(md_pdrive) - -struct BurnDriver BurnDrvmd_pdrive = { - "md_pdrive", NULL, NULL, NULL, "1994", - "Power Drive (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pdriveRomInfo, md_pdriveRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Power Monger (Euro, USA) -static struct BurnRomInfo md_pmongerRomDesc[] = { - { "pm14.bin", 0x100000, 0xfb599b86, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pmonger) -STD_ROM_FN(md_pmonger) - -struct BurnDriver BurnDrvmd_pmonger = { - "md_pmonger", NULL, NULL, NULL, "1993", - "Power Monger (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pmongerRomInfo, md_pmongerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Power Monger (Jpn, Kor) -static struct BurnRomInfo md_pmongerjRomDesc[] = { - { "power monger (jpn, kor).bin", 0x100000, 0x553289b3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pmongerj) -STD_ROM_FN(md_pmongerj) - -struct BurnDriver BurnDrvmd_pmongerj = { - "md_pmongerj", "md_pmonger", NULL, NULL, "1993", - "Power Monger (Jpn, Kor)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_pmongerjRomInfo, md_pmongerjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Powerball (USA) -static struct BurnRomInfo md_powerbalRomDesc[] = { - { "powerball (usa).bin", 0x080000, 0x7adf232f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_powerbal) -STD_ROM_FN(md_powerbal) - -struct BurnDriver BurnDrvmd_powerbal = { - "md_powerbal", NULL, NULL, NULL, "1991", - "Powerball (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_powerbalRomInfo, md_powerbalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wrestleball (Jpn) -static struct BurnRomInfo md_wrstballRomDesc[] = { - { "wrestleball (jpn).bin", 0x080000, 0xd563e07f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wrstball) -STD_ROM_FN(md_wrstball) - -struct BurnDriver BurnDrvmd_wrstball = { - "md_wrstball", "md_powerbal", NULL, NULL, "1991", - "Wrestleball (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wrstballRomInfo, md_wrstballRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Predator 2 (Euro, USA) -static struct BurnRomInfo md_predatr2RomDesc[] = { - { "predator 2 (euro, usa).bin", 0x100000, 0xbdba113e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_predatr2) -STD_ROM_FN(md_predatr2) - -struct BurnDriver BurnDrvmd_predatr2 = { - "md_predatr2", NULL, NULL, NULL, "1992", - "Predator 2 (Euro, USA)\0", NULL, "Arena", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_predatr2RomInfo, md_predatr2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Premier Manager (Euro) -static struct BurnRomInfo md_premiermRomDesc[] = { - { "mpr-18473.bin", 0x100000, 0x303b889f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_premierm) -STD_ROM_FN(md_premierm) - -struct BurnDriver BurnDrvmd_premierm = { - "md_premierm", NULL, NULL, NULL, "1995", - "Premier Manager (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_premiermRomInfo, md_premiermRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Premier Manager 97 (Euro) -static struct BurnRomInfo md_premrm97RomDesc[] = { - { "premier manager 97 (euro).bin", 0x100000, 0xfccbf69b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_premrm97) -STD_ROM_FN(md_premrm97) - -struct BurnDriver BurnDrvmd_premrm97 = { - "md_premrm97", NULL, NULL, NULL, "1996", - "Premier Manager 97 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_premrm97RomInfo, md_premrm97RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Primal Rage (Euro, USA) -static struct BurnRomInfo md_primalRomDesc[] = { - { "primal rage (euro, usa).bin", 0x300000, 0x2884c6d1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_primal) -STD_ROM_FN(md_primal) - -struct BurnDriver BurnDrvmd_primal = { - "md_primal", NULL, NULL, NULL, "1995", - "Primal Rage (Euro, USA)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_primalRomInfo, md_primalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Prime Time NFL Starring Deion Sanders (USA) -static struct BurnRomInfo md_primetimRomDesc[] = { - { "prime time nfl starring deion sanders (usa).bin", 0x200000, 0x5aa53cbc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_primetim) -STD_ROM_FN(md_primetim) - -struct BurnDriver BurnDrvmd_primetim = { - "md_primetim", NULL, NULL, NULL, "1995", - "Prime Time NFL Starring Deion Sanders (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_primetimRomInfo, md_primetimRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Prince of Persia (Euro) -static struct BurnRomInfo md_ppersiaRomDesc[] = { - { "prince of persia (euro).bin", 0x100000, 0x61de6fe0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ppersia) -STD_ROM_FN(md_ppersia) - -struct BurnDriver BurnDrvmd_ppersia = { - "md_ppersia", NULL, NULL, NULL, "1993", - "Prince of Persia (Euro)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ppersiaRomInfo, md_ppersiaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Prince of Persia (Prototype) -static struct BurnRomInfo md_ppersiapRomDesc[] = { - { "prince of persia (beta).bin", 0x100000, 0x505314b6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ppersiap) -STD_ROM_FN(md_ppersiap) - -struct BurnDriver BurnDrvmd_ppersiap = { - "md_ppersiap", "md_ppersia", NULL, NULL, "1993", - "Prince of Persia (Prototype)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ppersiapRomInfo, md_ppersiapRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Prince of Persia (Prototype, Earlier) -static struct BurnRomInfo md_ppersiap1RomDesc[] = { - { "prince of persia (beta) (earlier).bin", 0x040000, 0x425e6a87, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ppersiap1) -STD_ROM_FN(md_ppersiap1) - -struct BurnDriver BurnDrvmd_ppersiap1 = { - "md_ppersiap1", "md_ppersia", NULL, NULL, "1993", - "Prince of Persia (Prototype, Earlier)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ppersiap1RomInfo, md_ppersiap1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Prince of Persia (USA) -static struct BurnRomInfo md_ppersiauRomDesc[] = { - { "prince of persia (usa).bin", 0x100000, 0x13c181a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ppersiau) -STD_ROM_FN(md_ppersiau) - -struct BurnDriver BurnDrvmd_ppersiau = { - "md_ppersiau", "md_ppersia", NULL, NULL, "1993", - "Prince of Persia (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ppersiauRomInfo, md_ppersiauRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Prince of Persia 2 - The Shadow and the Flame (Euro, Prototype) -static struct BurnRomInfo md_ppersia2RomDesc[] = { - { "prince of persia 2 - the shadow and the flame (euro) (prototype).bin", 0x200000, 0x3ab44d46, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ppersia2) -STD_ROM_FN(md_ppersia2) - -struct BurnDriver BurnDrvmd_ppersia2 = { - "md_ppersia2", NULL, NULL, NULL, "199?", - "Prince of Persia 2 - The Shadow and the Flame (Euro, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ppersia2RomInfo, md_ppersia2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pro Quarterback (USA) -static struct BurnRomInfo md_proqbRomDesc[] = { - { "pro quarterback (usa).bin", 0x100000, 0xcc8b2b69, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_proqb) -STD_ROM_FN(md_proqb) - -struct BurnDriver BurnDrvmd_proqb = { - "md_proqb", NULL, NULL, NULL, "1992", - "Pro Quarterback (USA)\0", NULL, "Tradewest", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_proqbRomInfo, md_proqbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pro Yakyuu Super League '91 (Jpn) -static struct BurnRomInfo md_proyakyuRomDesc[] = { - { "pro yakyuu super league '91 (jpn).bin", 0x080000, 0xa948ab7e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_proyakyu) -STD_ROM_FN(md_proyakyu) - -struct BurnDriver BurnDrvmd_proyakyu = { - "md_proyakyu", NULL, NULL, NULL, "1991", - "Pro Yakyuu Super League '91 (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_proyakyuRomInfo, md_proyakyuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Contra - Hard Corps (USA, Kor) -static struct BurnRomInfo md_contraRomDesc[] = { - { "contra - hard corps (usa, kor).bin", 0x200000, 0xc579f45e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_contra) -STD_ROM_FN(md_contra) - -struct BurnDriver BurnDrvmd_contra = { - "md_contra", NULL, NULL, NULL, "1994", - "Contra - Hard Corps (USA, Kor)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_contraRomInfo, md_contraRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Contra - The Hard Corps (Jpn) -static struct BurnRomInfo md_contrajRomDesc[] = { - { "contra - the hard corps (jpn).bin", 0x200000, 0x2ab26380, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_contraj) -STD_ROM_FN(md_contraj) - -struct BurnDriver BurnDrvmd_contraj = { - "md_contraj", "md_contra", NULL, NULL, "1994", - "Contra - The Hard Corps (Jpn)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_contrajRomInfo, md_contrajRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Probotector (Euro) -static struct BurnRomInfo md_probotRomDesc[] = { - { "probotector (euro).bin", 0x200000, 0xbc597d48, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_probot) -STD_ROM_FN(md_probot) - -struct BurnDriver BurnDrvmd_probot = { - "md_probot", "md_contra", NULL, NULL, "1994", - "Probotector (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_probotRomInfo, md_probotRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Psy-O-Blade (Jpn) -static struct BurnRomInfo md_psyobladRomDesc[] = { - { "psy-o-blade (jpn).bin", 0x0a0000, 0x8ba7e6c5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_psyoblad) -STD_ROM_FN(md_psyoblad) - -struct BurnDriver BurnDrvmd_psyoblad = { - "md_psyoblad", NULL, NULL, NULL, "1990", - "Psy-O-Blade (Jpn)\0", NULL, "Sigma", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_psyobladRomInfo, md_psyobladRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Puggsy (Euro) -static struct BurnRomInfo md_puggsyRomDesc[] = { - { "puggsy (euro).bin", 0x100000, 0x5d5c9ade, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_puggsy) -STD_ROM_FN(md_puggsy) - -struct BurnDriver BurnDrvmd_puggsy = { - "md_puggsy", NULL, NULL, NULL, "1993", - "Puggsy (Euro)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_puggsyRomInfo, md_puggsyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Puggsy (Prototype) -static struct BurnRomInfo md_puggsypRomDesc[] = { - { "puggsy (beta).bin", 0x100000, 0x37fa4877, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_puggsyp) -STD_ROM_FN(md_puggsyp) - -struct BurnDriver BurnDrvmd_puggsyp = { - "md_puggsyp", "md_puggsy", NULL, NULL, "1993", - "Puggsy (Prototype)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_puggsypRomInfo, md_puggsypRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Puggsy (USA) -static struct BurnRomInfo md_puggsyuRomDesc[] = { - { "puggsy (usa).bin", 0x100000, 0x70132168, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_puggsyu) -STD_ROM_FN(md_puggsyu) - -struct BurnDriver BurnDrvmd_puggsyu = { - "md_puggsyu", "md_puggsy", NULL, NULL, "1993", - "Puggsy (USA)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_puggsyuRomInfo, md_puggsyuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pulseman (Jpn) -static struct BurnRomInfo md_pulsemanRomDesc[] = { - { "pulseman (jpn).bin", 0x200000, 0x138a104e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pulseman) -STD_ROM_FN(md_pulseman) - -struct BurnDriver BurnDrvmd_pulseman = { - "md_pulseman", NULL, NULL, NULL, "1994", - "Pulseman (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pulsemanRomInfo, md_pulsemanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Punisher (Euro) -static struct BurnRomInfo md_punisherRomDesc[] = { - { "punisher, the (euro).bin", 0x200000, 0x729edd17, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_punisher) -STD_ROM_FN(md_punisher) - -struct BurnDriver BurnDrvmd_punisher = { - "md_punisher", NULL, NULL, NULL, "1994", - "The Punisher (Euro)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_punisherRomInfo, md_punisherRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Punisher (USA) -static struct BurnRomInfo md_punisheruRomDesc[] = { - { "punisher, the (usa).bin", 0x200000, 0x695cd8b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_punisheru) -STD_ROM_FN(md_punisheru) - -struct BurnDriver BurnDrvmd_punisheru = { - "md_punisheru", "md_punisher", NULL, NULL, "1994", - "The Punisher (USA)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_punisheruRomInfo, md_punisheruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Putter Golf (Jpn, SegaNet) -static struct BurnRomInfo md_putterRomDesc[] = { - { "putter golf (jpn) (sn).bin", 0x040000, 0x20f168a6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_putter) -STD_ROM_FN(md_putter) - -struct BurnDriver BurnDrvmd_putter = { - "md_putter", NULL, NULL, NULL, "1991", - "Putter Golf (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_putterRomInfo, md_putterRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Putter Golf (Jpn, Game no Kandume MegaCD Rip) -static struct BurnRomInfo md_puttergnkRomDesc[] = { - { "putter golf (jpn) (gnk).bin", 0x040000, 0xa6557faa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_puttergnk) -STD_ROM_FN(md_puttergnk) - -struct BurnDriver BurnDrvmd_puttergnk = { - "md_puttergnk", "md_putter", NULL, NULL, "1991", - "Putter Golf (Jpn, Game no Kandume MegaCD Rip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_puttergnkRomInfo, md_puttergnkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Puyo Puyo (Jpn) -static struct BurnRomInfo md_puyopuyoRomDesc[] = { - { "puyo puyo (jpn).bin", 0x080000, 0x7f26614e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_puyopuyo) -STD_ROM_FN(md_puyopuyo) - -struct BurnDriver BurnDrvmd_puyopuyo = { - "md_puyopuyo", NULL, NULL, NULL, "1992", - "Puyo Puyo (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_puyopuyoRomInfo, md_puyopuyoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Puyo Puyo 2 (Jpn, v1.1) -static struct BurnRomInfo md_puyopuy2RomDesc[] = { - { "puyo puyo 2 (jpn) (v1.1).bin", 0x200000, 0x25b7b2aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_puyopuy2) -STD_ROM_FN(md_puyopuy2) - -struct BurnDriver BurnDrvmd_puyopuy2 = { - "md_puyopuy2", NULL, NULL, NULL, "1994", - "Puyo Puyo 2 (Jpn, v1.1)\0", NULL, "Compile", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_puyopuy2RomInfo, md_puyopuy2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Puyo Puyo 2 (Jpn) -static struct BurnRomInfo md_puyopuy2aRomDesc[] = { - { "puyo puyo 2 (jpn).bin", 0x200000, 0x51ad7797, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_puyopuy2a) -STD_ROM_FN(md_puyopuy2a) - -struct BurnDriver BurnDrvmd_puyopuy2a = { - "md_puyopuy2a", "md_puyopuy2", NULL, NULL, "1994", - "Puyo Puyo 2 (Jpn)\0", NULL, "Compile", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_puyopuy2aRomInfo, md_puyopuy2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Puzzle & Action - Ichidant-R (Jpn) -static struct BurnRomInfo md_ichirRomDesc[] = { - { "puzzle & action - ichidanto-r (jpn).bin", 0x200000, 0x7bdec762, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ichir) -STD_ROM_FN(md_ichir) - -struct BurnDriver BurnDrvmd_ichir = { - "md_ichir", NULL, NULL, NULL, "1995", - "Puzzle & Action - Ichidant-R (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ichirRomInfo, md_ichirRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Puzzle & Action - Tant-R (Jpn) -static struct BurnRomInfo md_tantrRomDesc[] = { - { "puzzle & action - tanto-r (jpn).bin", 0x200000, 0xd2d2d437, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tantr) -STD_ROM_FN(md_tantr) - -struct BurnDriver BurnDrvmd_tantr = { - "md_tantr", NULL, NULL, NULL, "1994", - "Puzzle & Action - Tant-R (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tantrRomInfo, md_tantrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pyramid Magic (Jpn, SegaNet) -static struct BurnRomInfo md_pyramidRomDesc[] = { - { "pyramid magic (jpn) (sn).bin", 0x040000, 0x306d839e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pyramid) -STD_ROM_FN(md_pyramid) - -struct BurnDriver BurnDrvmd_pyramid = { - "md_pyramid", NULL, NULL, NULL, "1991", - "Pyramid Magic (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pyramidRomInfo, md_pyramidRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pyramid Magic (Jpn, Game no Kandume MegaCD Rip) -static struct BurnRomInfo md_pyramidgnkRomDesc[] = { - { "pyramid magic (jpn) (gnk).bin", 0x040000, 0xb20272ea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pyramidgnk) -STD_ROM_FN(md_pyramidgnk) - -struct BurnDriver BurnDrvmd_pyramidgnk = { - "md_pyramidgnk", "md_pyramid", NULL, NULL, "1991", - "Pyramid Magic (Jpn, Game no Kandume MegaCD Rip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pyramidgnkRomInfo, md_pyramidgnkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pyramid Magic II (Jpn, SegaNet) -static struct BurnRomInfo md_pyramid2RomDesc[] = { - { "pyramid magic ii (jpn) (sn).bin", 0x040000, 0xc9ddac72, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pyramid2) -STD_ROM_FN(md_pyramid2) - -struct BurnDriver BurnDrvmd_pyramid2 = { - "md_pyramid2", NULL, NULL, NULL, "1991", - "Pyramid Magic II (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pyramid2RomInfo, md_pyramid2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pyramid Magic III (Jpn, SegaNet) -static struct BurnRomInfo md_pyramid3RomDesc[] = { - { "pyramid magic iii (jpn) (sn).bin", 0x040000, 0x8329820a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pyramid3) -STD_ROM_FN(md_pyramid3) - -struct BurnDriver BurnDrvmd_pyramid3 = { - "md_pyramid3", NULL, NULL, NULL, "1991", - "Pyramid Magic III (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pyramid3RomInfo, md_pyramid3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pyramid Magic Special (Jpn, SegaNet) -static struct BurnRomInfo md_pyramidsRomDesc[] = { - { "pyramid magic special (jpn) (sn).bin", 0x040000, 0x153a3afa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pyramids) -STD_ROM_FN(md_pyramids) - -struct BurnDriver BurnDrvmd_pyramids = { - "md_pyramids", NULL, NULL, NULL, "1991", - "Pyramid Magic Special (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pyramidsRomInfo, md_pyramidsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// QuackShot Starring Donald Duck ~ QuackShot - Guruzia Ou no Hihou (World, Alt) -static struct BurnRomInfo md_quacksht1RomDesc[] = { - { "quackshot starring donald duck -- quackshot - guruzia ou no hihou (world) (alt).bin", 0x080000, 0x88c8dd94, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_quacksht1) -STD_ROM_FN(md_quacksht1) - -struct BurnDriver BurnDrvmd_quacksht1 = { - "md_quacksht1", "md_quacksht", NULL, NULL, "1991", - "QuackShot Starring Donald Duck ~ QuackShot - Guruzia Ou no Hihou (World, Alt)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_quacksht1RomInfo, md_quacksht1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Quad Challenge (USA) -static struct BurnRomInfo md_quadchalRomDesc[] = { - { "quad challenge (usa).bin", 0x080000, 0x74736a80, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_quadchal) -STD_ROM_FN(md_quadchal) - -struct BurnDriver BurnDrvmd_quadchal = { - "md_quadchal", NULL, NULL, NULL, "1991", - "Quad Challenge (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_quadchalRomInfo, md_quadchalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// MegaTrax (Jpn) -static struct BurnRomInfo md_megatraxRomDesc[] = { - { "megatrax (jpn).bin", 0x080000, 0xa0837741, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megatrax) -STD_ROM_FN(md_megatrax) - -struct BurnDriver BurnDrvmd_megatrax = { - "md_megatrax", "md_quadchal", NULL, NULL, "1991", - "MegaTrax (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megatraxRomInfo, md_megatraxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Queen of Poker Club (Tw) -static struct BurnRomInfo md_qpokerRomDesc[] = { - { "poker club (sachen).bin", 0x100000, 0xae28d9eb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_qpoker) -STD_ROM_FN(md_qpoker) - -struct BurnDriver BurnDrvmd_qpoker = { - "md_qpoker", NULL, NULL, NULL, "199?", - "Queen of Poker Club (Tw)\0", NULL, "Sachen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_qpokerRomInfo, md_qpokerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// R.B.I. Baseball '93 (USA) -static struct BurnRomInfo md_rbibb93RomDesc[] = { - { "r.b.i. baseball '93 (usa).bin", 0x100000, 0xbeafce84, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rbibb93) -STD_ROM_FN(md_rbibb93) - -struct BurnDriver BurnDrvmd_rbibb93 = { - "md_rbibb93", NULL, NULL, NULL, "1993", - "R.B.I. Baseball '93 (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rbibb93RomInfo, md_rbibb93RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// R.B.I. Baseball '94 (Euro, USA) -static struct BurnRomInfo md_rbibb94RomDesc[] = { - { "r.b.i. baseball '94 (euro, usa).bin", 0x200000, 0x4eb4d5e4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rbibb94) -STD_ROM_FN(md_rbibb94) - -struct BurnDriver BurnDrvmd_rbibb94 = { - "md_rbibb94", NULL, NULL, NULL, "1994", - "R.B.I. Baseball '94 (Euro, USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rbibb94RomInfo, md_rbibb94RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// R.B.I. Baseball 3 (USA) -static struct BurnRomInfo md_rbibb3RomDesc[] = { - { "r.b.i. baseball 3 (usa).bin", 0x080000, 0x4840348c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rbibb3) -STD_ROM_FN(md_rbibb3) - -struct BurnDriver BurnDrvmd_rbibb3 = { - "md_rbibb3", NULL, NULL, NULL, "1991", - "R.B.I. Baseball 3 (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rbibb3RomInfo, md_rbibb3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// R.B.I. Baseball 4 (USA) -static struct BurnRomInfo md_rbibb4RomDesc[] = { - { "r.b.i. baseball 4 (usa).bin", 0x100000, 0xfecf9b94, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rbibb4) -STD_ROM_FN(md_rbibb4) - -struct BurnDriver BurnDrvmd_rbibb4 = { - "md_rbibb4", NULL, NULL, NULL, "1992", - "R.B.I. Baseball 4 (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rbibb4RomInfo, md_rbibb4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// R.B.I. Baseball 4 (Prototype) -static struct BurnRomInfo md_rbibb4pRomDesc[] = { - { "r.b.i. baseball 4 (beta).bin", 0x100000, 0xf7420278, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rbibb4p) -STD_ROM_FN(md_rbibb4p) - -struct BurnDriver BurnDrvmd_rbibb4p = { - "md_rbibb4p", "md_rbibb4", NULL, NULL, "1992", - "R.B.I. Baseball 4 (Prototype)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rbibb4pRomInfo, md_rbibb4pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// R.B.I. Baseball 4 (Jpn) -static struct BurnRomInfo md_rbibb4jRomDesc[] = { - { "r.b.i. baseball 4 (jpn).bin", 0x100000, 0x8f4e1005, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rbibb4j) -STD_ROM_FN(md_rbibb4j) - -struct BurnDriver BurnDrvmd_rbibb4j = { - "md_rbibb4j", "md_rbibb4", NULL, NULL, "1992", - "R.B.I. Baseball 4 (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rbibb4jRomInfo, md_rbibb4jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Race Drivin' (USA) -static struct BurnRomInfo md_racedrivRomDesc[] = { - { "race drivin' (usa).bin", 0x080000, 0xd737cf3d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_racedriv) -STD_ROM_FN(md_racedriv) - -struct BurnDriver BurnDrvmd_racedriv = { - "md_racedriv", NULL, NULL, NULL, "1993", - "Race Drivin' (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_racedrivRomInfo, md_racedrivRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Radical Rex (Euro) -static struct BurnRomInfo md_radrexRomDesc[] = { - { "radical rex (euro).bin", 0x100000, 0xd02d3282, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_radrex) -STD_ROM_FN(md_radrex) - -struct BurnDriver BurnDrvmd_radrex = { - "md_radrex", NULL, NULL, NULL, "1994", - "Radical Rex (Euro)\0", NULL, "Activision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_radrexRomInfo, md_radrexRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Radical Rex (USA) -static struct BurnRomInfo md_radrexuRomDesc[] = { - { "radical rex (usa).bin", 0x100000, 0x2e6eec7e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_radrexu) -STD_ROM_FN(md_radrexu) - -struct BurnDriver BurnDrvmd_radrexu = { - "md_radrexu", "md_radrex", NULL, NULL, "1994", - "Radical Rex (USA)\0", NULL, "Activision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_radrexuRomInfo, md_radrexuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Raiden Trad (USA) ~ Raiden Densetsu (Jpn) -static struct BurnRomInfo md_raidenRomDesc[] = { - { "raiden trad -- raiden densetsu (usa, jpn).bin", 0x100000, 0xf839a811, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_raiden) -STD_ROM_FN(md_raiden) - -struct BurnDriver BurnDrvmd_raiden = { - "md_raiden", NULL, NULL, NULL, "1991", - "Raiden Trad (USA) ~ Raiden Densetsu (Jpn)\0", NULL, "Micronet", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_raidenRomInfo, md_raidenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rainbow Islands Extra (Jpn) -static struct BurnRomInfo md_rbislandRomDesc[] = { - { "rainbow islands extra (jpn).bin", 0x080000, 0xc74dcb35, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rbisland) -STD_ROM_FN(md_rbisland) - -struct BurnDriver BurnDrvmd_rbisland = { - "md_rbisland", NULL, NULL, NULL, "1990", - "Rainbow Islands Extra (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rbislandRomInfo, md_rbislandRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rambo III (World, v1.1) -static struct BurnRomInfo md_rambo3RomDesc[] = { - { "rambo iii (world) (v1.1).bin", 0x040000, 0x4d47a647, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rambo3) -STD_ROM_FN(md_rambo3) - -struct BurnDriver BurnDrvmd_rambo3 = { - "md_rambo3", NULL, NULL, NULL, "1989", - "Rambo III (World, v1.1)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rambo3RomInfo, md_rambo3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rambo III (World) -static struct BurnRomInfo md_rambo3aRomDesc[] = { - { "mpr-12651.bin", 0x040000, 0x2232f03d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rambo3a) -STD_ROM_FN(md_rambo3a) - -struct BurnDriver BurnDrvmd_rambo3a = { - "md_rambo3a", "md_rambo3", NULL, NULL, "1989", - "Rambo III (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rambo3aRomInfo, md_rambo3aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rampart (USA) -static struct BurnRomInfo md_rampartRomDesc[] = { - { "rampart (usa).bin", 0x080000, 0x9c4dd057, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rampart) -STD_ROM_FN(md_rampart) - -struct BurnDriver BurnDrvmd_rampart = { - "md_rampart", NULL, NULL, NULL, "1991", - "Rampart (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rampartRomInfo, md_rampartRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rampart (Jpn, Kor) -static struct BurnRomInfo md_rampartjRomDesc[] = { - { "rampart (jpn, kor).bin", 0x080000, 0x16ead64c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rampartj) -STD_ROM_FN(md_rampartj) - -struct BurnDriver BurnDrvmd_rampartj = { - "md_rampartj", "md_rampart", NULL, NULL, "1992", - "Rampart (Jpn, Kor)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rampartjRomInfo, md_rampartjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ranger-X (Euro) -static struct BurnRomInfo md_rangerxRomDesc[] = { - { "ranger-x (euro).bin", 0x100000, 0xb8c04804, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rangerx) -STD_ROM_FN(md_rangerx) - -struct BurnDriver BurnDrvmd_rangerx = { - "md_rangerx", NULL, NULL, NULL, "1993", - "Ranger-X (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rangerxRomInfo, md_rangerxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ranger-X (USA) -static struct BurnRomInfo md_rangerxuRomDesc[] = { - { "ranger-x (usa).bin", 0x100000, 0x55915915, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rangerxu) -STD_ROM_FN(md_rangerxu) - -struct BurnDriver BurnDrvmd_rangerxu = { - "md_rangerxu", "md_rangerx", NULL, NULL, "1993", - "Ranger-X (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rangerxuRomInfo, md_rangerxuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ex-Ranza (Jpn) -static struct BurnRomInfo md_exranzaRomDesc[] = { - { "mpr-15585.bin", 0x100000, 0x349bb68d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_exranza) -STD_ROM_FN(md_exranza) - -struct BurnDriver BurnDrvmd_exranza = { - "md_exranza", "md_rangerx", NULL, NULL, "1993", - "Ex-Ranza (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_exranzaRomInfo, md_exranzaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ex-Ranza (Jpn, Prototype) -static struct BurnRomInfo md_exranzapRomDesc[] = { - { "ex-ranza (jpn) (beta).bin", 0x100000, 0xc642fdf4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_exranzap) -STD_ROM_FN(md_exranzap) - -struct BurnDriver BurnDrvmd_exranzap = { - "md_exranzap", "md_rangerx", NULL, NULL, "1993", - "Ex-Ranza (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_exranzapRomInfo, md_exranzapRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ransei no Hasha (Jpn) -static struct BurnRomInfo md_ranseiRomDesc[] = { - { "ransei no hasha (jpn).bin", 0x100000, 0xa9a0083d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ransei) -STD_ROM_FN(md_ransei) - -struct BurnDriver BurnDrvmd_ransei = { - "md_ransei", NULL, NULL, NULL, "1991", - "Ransei no Hasha (Jpn)\0", NULL, "Asmik Ace", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ranseiRomInfo, md_ranseiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rastan Saga II (USA) -static struct BurnRomInfo md_rastan2RomDesc[] = { - { "rastan saga ii (usa).bin", 0x080000, 0xc7ee8965, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rastan2) -STD_ROM_FN(md_rastan2) - -struct BurnDriver BurnDrvmd_rastan2 = { - "md_rastan2", NULL, NULL, NULL, "1990", - "Rastan Saga II (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rastan2RomInfo, md_rastan2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rastan Saga II (Jpn) -static struct BurnRomInfo md_rastan2jRomDesc[] = { - { "rastan saga ii (jpn).bin", 0x080000, 0xebacfb5a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rastan2j) -STD_ROM_FN(md_rastan2j) - -struct BurnDriver BurnDrvmd_rastan2j = { - "md_rastan2j", "md_rastan2", NULL, NULL, "1990", - "Rastan Saga II (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rastan2jRomInfo, md_rastan2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Red Zone (Euro, USA) -static struct BurnRomInfo md_redzoneRomDesc[] = { - { "red zone (euro, usa).bin", 0x200000, 0x56512ee5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_redzone) -STD_ROM_FN(md_redzone) - -struct BurnDriver BurnDrvmd_redzone = { - "md_redzone", NULL, NULL, NULL, "1994", - "Red Zone (Euro, USA)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_redzoneRomInfo, md_redzoneRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Stimpy's Invention Starring Starring Ren Hok & Stimpy (Euro) -static struct BurnRomInfo md_renstimRomDesc[] = { - { "ren & stimpy show presents stimpy's invention, the (euro).bin", 0x100000, 0xc276c220, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_renstim) -STD_ROM_FN(md_renstim) - -struct BurnDriver BurnDrvmd_renstim = { - "md_renstim", NULL, NULL, NULL, "1993", - "Stimpy's Invention Starring Starring Ren Hoek & Stimpy (Euro)\0", NULL, "Sega", "Sega Megadrive", - L"Stimpy's Invention Starring Starring Ren Ho\u00EBk & Stimpy (Euro)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_renstimRomInfo, md_renstimRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Stimpy's Invention Starring Starring Ren Hok & Stimpy (USA) -static struct BurnRomInfo md_renstimuRomDesc[] = { - { "ren & stimpy show presents stimpy's invention, the (usa).bin", 0x100000, 0xd9503ba5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_renstimu) -STD_ROM_FN(md_renstimu) - -struct BurnDriver BurnDrvmd_renstimu = { - "md_renstimu", "md_renstim", NULL, NULL, "1993", - "Stimpy's Invention Starring Starring Ren Hoek & Stimpy (USA)\0", NULL, "Sega", "Sega Megadrive", - L"Stimpy's Invention Starring Starring Ren Ho\u00EBk & Stimpy (USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_renstimuRomInfo, md_renstimuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Stimpy's Invention Starring Starring Ren Hok & Stimpy (USA, Prototype) -static struct BurnRomInfo md_renstimupRomDesc[] = { - { "ren & stimpy show presents stimpy's invention, the (usa) (beta).bin", 0x100000, 0xfcb86336, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_renstimup) -STD_ROM_FN(md_renstimup) - -struct BurnDriver BurnDrvmd_renstimup = { - "md_renstimup", "md_renstim", NULL, NULL, "1993", - "Stimpy's Invention Starring Starring Ren Hoek & Stimpy (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - L"Stimpy's Invention Starring Starring Ren Ho\u00EBk & Stimpy (USA, Prototype)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_renstimupRomInfo, md_renstimupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rent a Hero (Jpn) -static struct BurnRomInfo md_rentheroRomDesc[] = { - { "mpr-14187.bin", 0x100000, 0x2e515f82, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_renthero) -STD_ROM_FN(md_renthero) - -struct BurnDriver BurnDrvmd_renthero = { - "md_renthero", NULL, NULL, NULL, "1991", - "Rent a Hero (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_rentheroRomInfo, md_rentheroRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Resq (Euro, Prototype) -static struct BurnRomInfo md_resqRomDesc[] = { - { "resq (euro) (prototype).bin", 0x100000, 0x558e35e0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_resq) -STD_ROM_FN(md_resq) - -struct BurnDriver BurnDrvmd_resq = { - "md_resq", NULL, NULL, NULL, "199?", - "Resq (Euro, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_resqRomInfo, md_resqRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Revenge of Shinobi (Euro, USA, Rev. B) -static struct BurnRomInfo md_revshinRomDesc[] = { - { "mpr-12930b.bin", 0x080000, 0x4d35ebe4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_revshin) -STD_ROM_FN(md_revshin) - -struct BurnDriver BurnDrvmd_revshin = { - "md_revshin", NULL, NULL, NULL, "1989", - "The Revenge of Shinobi (Euro, USA, Rev. B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_revshinRomInfo, md_revshinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Revenge of Shinobi (Euro, USA, Rev. A) -static struct BurnRomInfo md_revshin1RomDesc[] = { - { "revenge of shinobi, the (euro, usa) (rev a).bin", 0x080000, 0xfe91ab7e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_revshin1) -STD_ROM_FN(md_revshin1) - -struct BurnDriver BurnDrvmd_revshin1 = { - "md_revshin1", "md_revshin", NULL, NULL, "1989", - "The Revenge of Shinobi (Euro, USA, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_revshin1RomInfo, md_revshin1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Revenge of Shinobi (Euro, USA) -static struct BurnRomInfo md_revshin2RomDesc[] = { - { "revenge of shinobi, the (euro, usa).bin", 0x080000, 0x05f27994, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_revshin2) -STD_ROM_FN(md_revshin2) - -struct BurnDriver BurnDrvmd_revshin2 = { - "md_revshin2", "md_revshin", NULL, NULL, "1989", - "The Revenge of Shinobi (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_revshin2RomInfo, md_revshin2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Super Shinobi (Jpn) -static struct BurnRomInfo md_supshinRomDesc[] = { - { "mpr-12675.bin", 0x080000, 0x5c7e5ea6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_supshin) -STD_ROM_FN(md_supshin) - -struct BurnDriver BurnDrvmd_supshin = { - "md_supshin", "md_revshin", NULL, NULL, "1989", - "The Super Shinobi (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_supshinRomInfo, md_supshinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Revolution X (Euro, USA) -static struct BurnRomInfo md_revxRomDesc[] = { - { "revolution x (euro, usa).bin", 0x400000, 0x5fb0c5d4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_revx) -STD_ROM_FN(md_revx) - -struct BurnDriver BurnDrvmd_revx = { - "md_revx", NULL, NULL, NULL, "1995", - "Revolution X (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_revxRomInfo, md_revxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Richard Scarry's BusyTown (USA) -static struct BurnRomInfo md_rsbtRomDesc[] = { - { "richard scarry's busytown (usa).bin", 0x200000, 0x7bb60c3f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rsbt) -STD_ROM_FN(md_rsbt) - -struct BurnDriver BurnDrvmd_rsbt = { - "md_rsbt", NULL, NULL, NULL, "1994", - "Richard Scarry's BusyTown (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rsbtRomInfo, md_rsbtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Richard Scarry's Busytown (Prototype, 19940809) -static struct BurnRomInfo md_rsbtp6RomDesc[] = { - { "richard scarry's busytown (prototype - aug 09, 1994).bin", 0x1fecec, 0xc48cbc30, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rsbtp6) -STD_ROM_FN(md_rsbtp6) - -struct BurnDriver BurnDrvmd_rsbtp6 = { - "md_rsbtp6", "md_rsbt", NULL, NULL, "1994", - "Richard Scarry's Busytown (Prototype, 19940809)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rsbtp6RomInfo, md_rsbtp6RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Richard Scarry's Busytown (Prototype, 19940815) -static struct BurnRomInfo md_rsbtp5RomDesc[] = { - { "richard scarry's busytown (prototype - aug 15, 1994).bin", 0x200000, 0x650ed917, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rsbtp5) -STD_ROM_FN(md_rsbtp5) - -struct BurnDriver BurnDrvmd_rsbtp5 = { - "md_rsbtp5", "md_rsbt", NULL, NULL, "1994", - "Richard Scarry's Busytown (Prototype, 19940815)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rsbtp5RomInfo, md_rsbtp5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Richard Scarry's Busytown (Prototype, 19940816-B) -static struct BurnRomInfo md_rsbtp4RomDesc[] = { - { "richard scarry's busytown (prototype - aug 16, 1994 - b).bin", 0x200000, 0x760cff62, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rsbtp4) -STD_ROM_FN(md_rsbtp4) - -struct BurnDriver BurnDrvmd_rsbtp4 = { - "md_rsbtp4", "md_rsbt", NULL, NULL, "1994", - "Richard Scarry's Busytown (Prototype, 19940816-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rsbtp4RomInfo, md_rsbtp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Richard Scarry's Busytown (Prototype, 19940817) -static struct BurnRomInfo md_rsbtp3RomDesc[] = { - { "richard scarry's busytown (prototype - aug 17, 1994).bin", 0x1ffaa4, 0x3b9c3f4a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rsbtp3) -STD_ROM_FN(md_rsbtp3) - -struct BurnDriver BurnDrvmd_rsbtp3 = { - "md_rsbtp3", "md_rsbt", NULL, NULL, "1994", - "Richard Scarry's Busytown (Prototype, 19940817)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rsbtp3RomInfo, md_rsbtp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Richard Scarry's Busytown (Prototype, 19940825) -static struct BurnRomInfo md_rsbtp2RomDesc[] = { - { "richard scarry's busytown (prototype - aug 25, 1994).bin", 0x200000, 0xa0c013ba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rsbtp2) -STD_ROM_FN(md_rsbtp2) - -struct BurnDriver BurnDrvmd_rsbtp2 = { - "md_rsbtp2", "md_rsbt", NULL, NULL, "1994", - "Richard Scarry's Busytown (Prototype, 19940825)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rsbtp2RomInfo, md_rsbtp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Richard Scarry's Busytown (Prototype, 19940826) -static struct BurnRomInfo md_rsbtp1RomDesc[] = { - { "richard scarry's busytown (prototype - aug 26, 1994).bin", 0x200000, 0x1ad270f3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rsbtp1) -STD_ROM_FN(md_rsbtp1) - -struct BurnDriver BurnDrvmd_rsbtp1 = { - "md_rsbtp1", "md_rsbt", NULL, NULL, "1994", - "Richard Scarry's Busytown (Prototype, 19940826)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rsbtp1RomInfo, md_rsbtp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Richard Scarry's Busytown (Prototype, 19940721) -static struct BurnRomInfo md_rsbtp7RomDesc[] = { - { "richard scarry's busytown (prototype - jul 21, 1994).bin", 0x1f3008, 0x1e92d6ff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rsbtp7) -STD_ROM_FN(md_rsbtp7) - -struct BurnDriver BurnDrvmd_rsbtp7 = { - "md_rsbtp7", "md_rsbt", NULL, NULL, "1994", - "Richard Scarry's Busytown (Prototype, 19940721)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rsbtp7RomInfo, md_rsbtp7RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Riddle Wired (Jpn, SegaNet) -static struct BurnRomInfo md_riddleRomDesc[] = { - { "riddle wired (jpn) (sn).bin", 0x040000, 0xfae3d720, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_riddle) -STD_ROM_FN(md_riddle) - -struct BurnDriver BurnDrvmd_riddle = { - "md_riddle", NULL, NULL, NULL, "1991", - "Riddle Wired (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_riddleRomInfo, md_riddleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rings of Power (Euro, USA) -static struct BurnRomInfo md_ringspowRomDesc[] = { - { "rin09.bin", 0x100000, 0x41fcc497, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ringspow) -STD_ROM_FN(md_ringspow) - -struct BurnDriver BurnDrvmd_ringspow = { - "md_ringspow", NULL, NULL, NULL, "1991", - "Rings of Power (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_EA_NHLPA, GBF_MISC, 0, - MegadriveGetZipName, md_ringspowRomInfo, md_ringspowRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Risk (USA) -static struct BurnRomInfo md_riskRomDesc[] = { - { "risk (usa).bin", 0x080000, 0x80416d0d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_risk) -STD_ROM_FN(md_risk) - -struct BurnDriver BurnDrvmd_risk = { - "md_risk", NULL, NULL, NULL, "1994", - "Risk (USA)\0", NULL, "Parker Brothers", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_riskRomInfo, md_riskRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Risky Woods (Euro, USA) -static struct BurnRomInfo md_riskywRomDesc[] = { - { "risky woods (euro, usa).bin", 0x100000, 0xd975e93c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_riskyw) -STD_ROM_FN(md_riskyw) - -struct BurnDriver BurnDrvmd_riskyw = { - "md_riskyw", NULL, NULL, NULL, "1992", - "Risky Woods (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_riskywRomInfo, md_riskywRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Jashin Draxos (Jpn, Kor) -static struct BurnRomInfo md_draxosRomDesc[] = { - { "jashin draxos (jpn, kor).bin", 0x100000, 0x1ea07af2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_draxos) -STD_ROM_FN(md_draxos) - -struct BurnDriver BurnDrvmd_draxos = { - "md_draxos", "md_riskyw", NULL, NULL, "1993", - "Jashin Draxos (Jpn, Kor)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_draxosRomInfo, md_draxosRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ristar (Euro, USA, 199409) -static struct BurnRomInfo md_ristarRomDesc[] = { - { "ristar (euro, usa) (september 1994).bin", 0x200000, 0x6511aa61, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ristar) -STD_ROM_FN(md_ristar) - -struct BurnDriver BurnDrvmd_ristar = { - "md_ristar", NULL, NULL, NULL, "1994", - "Ristar (Euro, USA, 199409)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ristarRomInfo, md_ristarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ristar (Euro, USA, 199408) -static struct BurnRomInfo md_ristar1RomDesc[] = { - { "ristar (euro, usa) (august 1994).bin", 0x200000, 0x9700139b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ristar1) -STD_ROM_FN(md_ristar1) - -struct BurnDriver BurnDrvmd_ristar1 = { - "md_ristar1", "md_ristar", NULL, NULL, "1994", - "Ristar (Euro, USA, 199408)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ristar1RomInfo, md_ristar1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ristar - The Shooting Star (Jpn, Kor) -static struct BurnRomInfo md_ristarjRomDesc[] = { - { "ristar - the shooting star (jpn, kor).bin", 0x200000, 0xce464f0e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ristarj) -STD_ROM_FN(md_ristarj) - -struct BurnDriver BurnDrvmd_ristarj = { - "md_ristarj", "md_ristar", NULL, NULL, "1995", - "Ristar - The Shooting Star (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ristarjRomInfo, md_ristarjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ristar (Prototype, 19940812) -static struct BurnRomInfo md_ristarp2RomDesc[] = { - { "ristar (prototype - aug 12, 1994).bin", 0x200000, 0x4371f046, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ristarp2) -STD_ROM_FN(md_ristarp2) - -struct BurnDriver BurnDrvmd_ristarp2 = { - "md_ristarp2", "md_ristar", NULL, NULL, "1994", - "Ristar (Prototype, 19940812)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ristarp2RomInfo, md_ristarp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ristar (Prototype, 19940826) -static struct BurnRomInfo md_ristarp1RomDesc[] = { - { "ristar (prototype - aug 26, 1994).bin", 0x200000, 0xd0c74fdd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ristarp1) -STD_ROM_FN(md_ristarp1) - -struct BurnDriver BurnDrvmd_ristarp1 = { - "md_ristarp1", "md_ristar", NULL, NULL, "1994", - "Ristar (Prototype, 19940826)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ristarp1RomInfo, md_ristarp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ristar (Prototype, 19940701) -static struct BurnRomInfo md_ristarp4RomDesc[] = { - { "ristar (prototype - jul 01, 1994).bin", 0x200000, 0x7c5c7a0a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ristarp4) -STD_ROM_FN(md_ristarp4) - -struct BurnDriver BurnDrvmd_ristarp4 = { - "md_ristarp4", "md_ristar", NULL, NULL, "1994", - "Ristar (Prototype, 19940701)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ristarp4RomInfo, md_ristarp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ristar (Prototype, 19940718) -static struct BurnRomInfo md_ristarp3RomDesc[] = { - { "ristar (prototype - jul 18, 1994).bin", 0x200000, 0x6becccc9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ristarp3) -STD_ROM_FN(md_ristarp3) - -struct BurnDriver BurnDrvmd_ristarp3 = { - "md_ristarp3", "md_ristar", NULL, NULL, "1994", - "Ristar (Prototype, 19940718)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ristarp3RomInfo, md_ristarp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Road Rash (Euro, USA) -static struct BurnRomInfo md_roadrashRomDesc[] = { - { "road rash (euro, usa).bin", 0x0c0000, 0xdea53d19, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_roadrash) -STD_ROM_FN(md_roadrash) - -struct BurnDriver BurnDrvmd_roadrash = { - "md_roadrash", NULL, NULL, NULL, "1991", - "Road Rash (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_roadrashRomInfo, md_roadrashRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Road Rash II (Euro, USA, v1.2) -static struct BurnRomInfo md_rrash2RomDesc[] = { - { "road rash ii (euro, usa) (v1.2).bin", 0x100000, 0x0876e992, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rrash2) -STD_ROM_FN(md_rrash2) - -struct BurnDriver BurnDrvmd_rrash2 = { - "md_rrash2", NULL, NULL, NULL, "1992", - "Road Rash II (Euro, USA, v1.2)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rrash2RomInfo, md_rrash2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Road Rash II (Euro, USA) -static struct BurnRomInfo md_rrash2aRomDesc[] = { - { "rr205.bin", 0x100000, 0x7b29c209, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rrash2a) -STD_ROM_FN(md_rrash2a) - -struct BurnDriver BurnDrvmd_rrash2a = { - "md_rrash2a", "md_rrash2", NULL, NULL, "1992", - "Road Rash II (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rrash2aRomInfo, md_rrash2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Road Rash II (Jpn) -static struct BurnRomInfo md_rrash2jRomDesc[] = { - { "road rash ii (jpn).bin", 0x100000, 0x9a5723b6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rrash2j) -STD_ROM_FN(md_rrash2j) - -struct BurnDriver BurnDrvmd_rrash2j = { - "md_rrash2j", "md_rrash2", NULL, NULL, "1993", - "Road Rash II (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rrash2jRomInfo, md_rrash2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Road 3 Rash - Tour de Force (Euro, USA) -static struct BurnRomInfo md_rrash3RomDesc[] = { - { "rr3b3.bin", 0x200000, 0x15785956, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rrash3) -STD_ROM_FN(md_rrash3) - -struct BurnDriver BurnDrvmd_rrash3 = { - "md_rrash3", NULL, NULL, NULL, "1995", - "Road 3 Rash - Tour de Force (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rrash3RomInfo, md_rrash3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Road 3 Rash - World Warriors (USA, Prototype) -static struct BurnRomInfo md_rrash3pRomDesc[] = { - { "road rash 3 (usa) (alpha).bin", 0x200000, 0xb6626083, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rrash3p) -STD_ROM_FN(md_rrash3p) - -struct BurnDriver BurnDrvmd_rrash3p = { - "md_rrash3p", "md_rrash3", NULL, NULL, "1995", - "Road 3 Rash - World Warriors (USA, Prototype)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rrash3pRomInfo, md_rrash3pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// RoadBlasters (USA) -static struct BurnRomInfo md_roadblstRomDesc[] = { - { "roadblasters (usa).bin", 0x080000, 0xec6cd5f0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_roadblst) -STD_ROM_FN(md_roadblst) - -struct BurnDriver BurnDrvmd_roadblst = { - "md_roadblst", NULL, NULL, NULL, "1991", - "RoadBlasters (USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_roadblstRomInfo, md_roadblstRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// RoadBlasters (Jpn) -static struct BurnRomInfo md_roadblstjRomDesc[] = { - { "roadblasters (jpn).bin", 0x080000, 0xa0015440, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_roadblstj) -STD_ROM_FN(md_roadblstj) - -struct BurnDriver BurnDrvmd_roadblstj = { - "md_roadblstj", "md_roadblst", NULL, NULL, "1992", - "RoadBlasters (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_roadblstjRomInfo, md_roadblstjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// RoboCop 3 (Euro, USA) -static struct BurnRomInfo md_robocop3RomDesc[] = { - { "robocop 3 (euro, usa).bin", 0x080000, 0x34fb7b27, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_robocop3) -STD_ROM_FN(md_robocop3) - -struct BurnDriver BurnDrvmd_robocop3 = { - "md_robocop3", NULL, NULL, NULL, "1993", - "RoboCop 3 (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robocop3RomInfo, md_robocop3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// RoboCop versus The Terminator (Euro) -static struct BurnRomInfo md_robotermRomDesc[] = { - { "robocop versus the terminator (euro).bin", 0x200000, 0x85a93f8d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_roboterm) -STD_ROM_FN(md_roboterm) - -struct BurnDriver BurnDrvmd_roboterm = { - "md_roboterm", NULL, NULL, NULL, "1994", - "RoboCop versus The Terminator (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robotermRomInfo, md_robotermRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// RoboCop versus The Terminator (Jpn, Kor) -static struct BurnRomInfo md_robotermjRomDesc[] = { - { "robocop versus the terminator (jpn, kor).bin", 0x200000, 0xd444e1f0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_robotermj) -STD_ROM_FN(md_robotermj) - -struct BurnDriver BurnDrvmd_robotermj = { - "md_robotermj", "md_roboterm", NULL, NULL, "1994", - "RoboCop versus The Terminator (Jpn, Kor)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robotermjRomInfo, md_robotermjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// RoboCop versus The Terminator (Prototype) -static struct BurnRomInfo md_robotermpRomDesc[] = { - { "robocop versus the terminator (beta).bin", 0x200000, 0x2487049f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_robotermp) -STD_ROM_FN(md_robotermp) - -struct BurnDriver BurnDrvmd_robotermp = { - "md_robotermp", "md_roboterm", NULL, NULL, "1994", - "RoboCop versus The Terminator (Prototype)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robotermpRomInfo, md_robotermpRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Robocop Versus The Terminator (Prototype, Alt) -static struct BurnRomInfo md_robotermp1RomDesc[] = { - { "robocop versus the terminator (beta) (alt).bin", 0x200000, 0xecebff29, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_robotermp1) -STD_ROM_FN(md_robotermp1) - -struct BurnDriver BurnDrvmd_robotermp1 = { - "md_robotermp1", "md_roboterm", NULL, NULL, "1994", - "Robocop Versus The Terminator (Prototype, Alt)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robotermp1RomInfo, md_robotermp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// RoboCop versus The Terminator (USA) -static struct BurnRomInfo md_robotermuRomDesc[] = { - { "robocop versus the terminator (usa).bin", 0x200000, 0xbbad77a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_robotermu) -STD_ROM_FN(md_robotermu) - -struct BurnDriver BurnDrvmd_robotermu = { - "md_robotermu", "md_roboterm", NULL, NULL, "1994", - "RoboCop versus The Terminator (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robotermuRomInfo, md_robotermuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Robot Battler (Jpn, SegaNet) -static struct BurnRomInfo md_robotbatRomDesc[] = { - { "robot battler (jpn) (sn).bin", 0x040000, 0xfdf23eff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_robotbat) -STD_ROM_FN(md_robotbat) - -struct BurnDriver BurnDrvmd_robotbat = { - "md_robotbat", NULL, NULL, NULL, "1991", - "Robot Battler (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robotbatRomInfo, md_robotbatRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Robot Wreckage (USA, Prototype) -static struct BurnRomInfo md_robowrekRomDesc[] = { - { "robot wreckage (usa) (prototype).bin", 0x100000, 0xc67ddb14, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_robowrek) -STD_ROM_FN(md_robowrek) - -struct BurnDriver BurnDrvmd_robowrek = { - "md_robowrek", NULL, NULL, NULL, "199?", - "Robot Wreckage (USA, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_robowrekRomInfo, md_robowrekRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rock n' Roll Racing (Euro) -static struct BurnRomInfo md_rnrracinRomDesc[] = { - { "rock n' roll racing (euro).bin", 0x100000, 0xbc5a0562, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rnrracin) -STD_ROM_FN(md_rnrracin) - -struct BurnDriver BurnDrvmd_rnrracin = { - "md_rnrracin", NULL, NULL, NULL, "1994", - "Rock n' Roll Racing (Euro)\0", NULL, "Interplay", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rnrracinRomInfo, md_rnrracinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rock n' Roll Racing (USA) -static struct BurnRomInfo md_rnrracinuRomDesc[] = { - { "rock n' roll racing (usa).bin", 0x100000, 0x6abab577, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rnrracinu) -STD_ROM_FN(md_rnrracinu) - -struct BurnDriver BurnDrvmd_rnrracinu = { - "md_rnrracinu", "md_rnrracin", NULL, NULL, "1994", - "Rock n' Roll Racing (USA)\0", NULL, "Interplay", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rnrracinuRomInfo, md_rnrracinuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rocket Knight Adventures (Euro) -static struct BurnRomInfo md_rocketRomDesc[] = { - { "fx004.bin", 0x100000, 0x8eedfd51, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rocket) -STD_ROM_FN(md_rocket) - -struct BurnDriver BurnDrvmd_rocket = { - "md_rocket", NULL, NULL, NULL, "1993", - "Rocket Knight Adventures (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rocketRomInfo, md_rocketRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rocket Knight Adventures (Jpn) -static struct BurnRomInfo md_rocketjRomDesc[] = { - { "rocket knight adventures (jpn).bin", 0x100000, 0xd1c8c1c5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rocketj) -STD_ROM_FN(md_rocketj) - -struct BurnDriver BurnDrvmd_rocketj = { - "md_rocketj", "md_rocket", NULL, NULL, "1993", - "Rocket Knight Adventures (Jpn)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rocketjRomInfo, md_rocketjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rocket Knight Adventures (USA) -static struct BurnRomInfo md_rocketuRomDesc[] = { - { "rocket knight adventures (usa).bin", 0x100000, 0xa6efec47, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rocketu) -STD_ROM_FN(md_rocketu) - -struct BurnDriver BurnDrvmd_rocketu = { - "md_rocketu", "md_rocket", NULL, NULL, "1993", - "Rocket Knight Adventures (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rocketuRomInfo, md_rocketuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Roger Clements MVP Baseball (USA) -static struct BurnRomInfo md_mvpbbRomDesc[] = { - { "roger clements mvp baseball (usa).bin", 0x100000, 0x83699e34, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mvpbb) -STD_ROM_FN(md_mvpbb) - -struct BurnDriver BurnDrvmd_mvpbb = { - "md_mvpbb", NULL, NULL, NULL, "1992", - "Roger Clements MVP Baseball (USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mvpbbRomInfo, md_mvpbbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rolling Thunder 2 (Euro) -static struct BurnRomInfo md_rthun2RomDesc[] = { - { "rolling thunder 2 (euro).bin", 0x100000, 0xc440f292, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rthun2) -STD_ROM_FN(md_rthun2) - -struct BurnDriver BurnDrvmd_rthun2 = { - "md_rthun2", NULL, NULL, NULL, "1991", - "Rolling Thunder 2 (Euro)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rthun2RomInfo, md_rthun2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rolling Thunder 2 (Jpn) -static struct BurnRomInfo md_rthun2jRomDesc[] = { - { "rolling thunder 2 (jpn).bin", 0x100000, 0x965b2628, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rthun2j) -STD_ROM_FN(md_rthun2j) - -struct BurnDriver BurnDrvmd_rthun2j = { - "md_rthun2j", "md_rthun2", NULL, NULL, "1991", - "Rolling Thunder 2 (Jpn)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rthun2jRomInfo, md_rthun2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rolling Thunder 2 (USA) -static struct BurnRomInfo md_rthun2uRomDesc[] = { - { "rolling thunder 2 (usa).bin", 0x100000, 0x3ace429b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rthun2u) -STD_ROM_FN(md_rthun2u) - -struct BurnDriver BurnDrvmd_rthun2u = { - "md_rthun2u", "md_rthun2", NULL, NULL, "1991", - "Rolling Thunder 2 (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rthun2uRomInfo, md_rthun2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rolling Thunder 3 (USA) -static struct BurnRomInfo md_rthun3RomDesc[] = { - { "rolling thunder 3 (usa).bin", 0x180000, 0x64fb13aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rthun3) -STD_ROM_FN(md_rthun3) - -struct BurnDriver BurnDrvmd_rthun3 = { - "md_rthun3", NULL, NULL, NULL, "1993", - "Rolling Thunder 3 (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rthun3RomInfo, md_rthun3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rolo to the Rescue (Euro, USA) -static struct BurnRomInfo md_roloRomDesc[] = { - { "rolo to the rescue (euro, usa).bin", 0x080000, 0x306861a2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rolo) -STD_ROM_FN(md_rolo) - -struct BurnDriver BurnDrvmd_rolo = { - "md_rolo", NULL, NULL, NULL, "1992", - "Rolo to the Rescue (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_roloRomInfo, md_roloRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zou! Zou! Zou! Rescue Daisakusen (Jpn) -static struct BurnRomInfo md_zouzouRomDesc[] = { - { "zou! zou! zou! rescue daisakusen (jpn).bin", 0x080000, 0x1a761e67, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zouzou) -STD_ROM_FN(md_zouzou) - -struct BurnDriver BurnDrvmd_zouzou = { - "md_zouzou", "md_rolo", NULL, NULL, "1993", - "Zou! Zou! Zou! Rescue Daisakusen (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zouzouRomInfo, md_zouzouRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Romance of the Three Kingdoms II (USA) -static struct BurnRomInfo md_roman3k2RomDesc[] = { - { "romance of the three kingdoms ii (usa).bin", 0x100000, 0x3d842478, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_roman3k2) -STD_ROM_FN(md_roman3k2) - -struct BurnDriver BurnDrvmd_roman3k2 = { - "md_roman3k2", NULL, NULL, NULL, "1991", - "Romance of the Three Kingdoms II (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_roman3k2RomInfo, md_roman3k2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sangokushi II (Jpn) -static struct BurnRomInfo md_sangoku2RomDesc[] = { - { "mpr-14455.bin", 0x100000, 0x437ba326, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sangoku2) -STD_ROM_FN(md_sangoku2) - -struct BurnDriver BurnDrvmd_sangoku2 = { - "md_sangoku2", "md_roman3k2", NULL, NULL, "1991", - "Sangokushi II (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sangoku2RomInfo, md_sangoku2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Romance of the Three Kingdoms III - Dragon of Destiny (USA) -static struct BurnRomInfo md_roman3k3RomDesc[] = { - { "romance of the three kingdoms iii - dragon of destiny (usa).bin", 0x140000, 0x7e41c8fe, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_roman3k3) -STD_ROM_FN(md_roman3k3) - -struct BurnDriver BurnDrvmd_roman3k3 = { - "md_roman3k3", NULL, NULL, NULL, "1993", - "Romance of the Three Kingdoms III - Dragon of Destiny (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_roman3k3RomInfo, md_roman3k3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sangokushi III (Jpn) -static struct BurnRomInfo md_sangoku3RomDesc[] = { - { "sangokushi iii (jpn).bin", 0x180000, 0xa8de6aea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sangoku3) -STD_ROM_FN(md_sangoku3) - -struct BurnDriver BurnDrvmd_sangoku3 = { - "md_sangoku3", "md_roman3k3", NULL, NULL, "1992", - "Sangokushi III (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sangoku3RomInfo, md_sangoku3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rugby World Cup 1995 (Euro, USA) -static struct BurnRomInfo md_rugbywcRomDesc[] = { - { "rugby world cup 1995 (euro, usa).bin", 0x200000, 0x61f90a8a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rugbywc) -STD_ROM_FN(md_rugbywc) - -struct BurnDriver BurnDrvmd_rugbywc = { - "md_rugbywc", NULL, NULL, NULL, "1994", - "Rugby World Cup 1995 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rugbywcRomInfo, md_rugbywcRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sagaia (USA) -static struct BurnRomInfo md_sagaiaRomDesc[] = { - { "sagaia (usa).bin", 0x100000, 0xf1e22f43, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sagaia) -STD_ROM_FN(md_sagaia) - -struct BurnDriver BurnDrvmd_sagaia = { - "md_sagaia", NULL, NULL, NULL, "1991", - "Sagaia (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sagaiaRomInfo, md_sagaiaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Darius II (Jpn) -static struct BurnRomInfo md_darius2RomDesc[] = { - { "darius ii (jpn).bin", 0x100000, 0x25dfe62a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_darius2) -STD_ROM_FN(md_darius2) - -struct BurnDriver BurnDrvmd_darius2 = { - "md_darius2", "md_sagaia", NULL, NULL, "1990", - "Darius II (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_darius2RomInfo, md_darius2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bishoujo Senshi Sailor Moon (Jpn) -static struct BurnRomInfo md_sailormnRomDesc[] = { - { "bishoujo senshi sailor moon (jpn).bin", 0x200000, 0x5e246938, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sailormn) -STD_ROM_FN(md_sailormn) - -struct BurnDriver BurnDrvmd_sailormn = { - "md_sailormn", NULL, NULL, NULL, "1994", - "Bishoujo Senshi Sailor Moon (Jpn)\0", NULL, "Ma-Ba", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sailormnRomInfo, md_sailormnRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Saint Sword (USA) -static struct BurnRomInfo md_sswordRomDesc[] = { - { "saint sword (usa).bin", 0x080000, 0x44f66bff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ssword) -STD_ROM_FN(md_ssword) - -struct BurnDriver BurnDrvmd_ssword = { - "md_ssword", NULL, NULL, NULL, "1991", - "Saint Sword (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sswordRomInfo, md_sswordRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Saint Sword (Jpn) -static struct BurnRomInfo md_sswordjRomDesc[] = { - { "saint sword (jpn).bin", 0x080000, 0x3960a00f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sswordj) -STD_ROM_FN(md_sswordj) - -struct BurnDriver BurnDrvmd_sswordj = { - "md_sswordj", "md_ssword", NULL, NULL, "1991", - "Saint Sword (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sswordjRomInfo, md_sswordjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pete Sampras Tennis '96 (Euro, J-Cart) -static struct BurnRomInfo md_sampra96RomDesc[] = { - { "sampras tennis 96 (euro) (j-cart).bin", 0x200000, 0x14e3fb7b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sampra96) -STD_ROM_FN(md_sampra96) - -struct BurnDriver BurnDrvmd_sampra96 = { - "md_sampra96", NULL, NULL, NULL, "1995", - "Pete Sampras Tennis '96 (Euro, J-Cart)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sampra96RomInfo, md_sampra96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Samurai Shodown (Euro) -static struct BurnRomInfo md_samshoRomDesc[] = { - { "samurai shodown (euro).bin", 0x300000, 0xc972014f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_samsho) -STD_ROM_FN(md_samsho) - -struct BurnDriver BurnDrvmd_samsho = { - "md_samsho", NULL, NULL, NULL, "1994", - "Samurai Shodown (Euro)\0", NULL, "Takara", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_samshoRomInfo, md_samshoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Samurai Shodown (USA) -static struct BurnRomInfo md_samshouRomDesc[] = { - { "samurai shodown (usa).bin", 0x300000, 0x5bb8b2d4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_samshou) -STD_ROM_FN(md_samshou) - -struct BurnDriver BurnDrvmd_samshou = { - "md_samshou", "md_samsho", NULL, NULL, "1994", - "Samurai Shodown (USA)\0", NULL, "Takara", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_samshouRomInfo, md_samshouRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Samurai Spirits (Jpn) -static struct BurnRomInfo md_samspirRomDesc[] = { - { "samurai spirits (jpn).bin", 0x300000, 0x0ea2ae36, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_samspir) -STD_ROM_FN(md_samspir) - -struct BurnDriver BurnDrvmd_samspir = { - "md_samspir", "md_samsho", NULL, NULL, "1994", - "Samurai Spirits (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_samspirRomInfo, md_samspirRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// San Guo Zhi Lie Zhuan - Luan Shi Qun Ying (Chi) -static struct BurnRomInfo md_sanguoRomDesc[] = { - { "san guo zhi lie zhuan - luan shi qun ying (chi).bin", 0x100000, 0x3b5cc398, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sanguo) -STD_ROM_FN(md_sanguo) - -struct BurnDriver BurnDrvmd_sanguo = { - "md_sanguo", "md_sangoret", NULL, NULL, "199?", - "San Guo Zhi Lie Zhuan - Luan Shi Qun Ying (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sanguoRomInfo, md_sanguoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// San Guo Zhi V (Chi) -static struct BurnRomInfo md_sanguo5RomDesc[] = { - { "san guo zhi v (chi) (unl).bin", 0x200000, 0xcd7e53d0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sanguo5) -STD_ROM_FN(md_sanguo5) - -struct BurnDriver BurnDrvmd_sanguo5 = { - "md_sanguo5", NULL, NULL, NULL, "199?", - "San Guo Zhi V (Chi)\0", NULL, "SKOB", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sanguo5RomInfo, md_sanguo5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// San San (Jpn) -static struct BurnRomInfo md_sansanRomDesc[] = { - { "san san (japan).bin", 0x100000, 0x5b85deed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sansan) -STD_ROM_FN(md_sansan) - -struct BurnDriver BurnDrvmd_sansan = { - "md_sansan", NULL, NULL, NULL, "1994", - "San San (Jpn)\0", NULL, "San San Co.", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sansanRomInfo, md_sansanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sangokushi Retsuden - Ransei no Eiyuutachi (Jpn) -static struct BurnRomInfo md_sangoretRomDesc[] = { - { "sangokushi retsuden - ransei no eiyuutachi (jpn).bin", 0x100000, 0x0f56785a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sangoret) -STD_ROM_FN(md_sangoret) - -struct BurnDriver BurnDrvmd_sangoret = { - "md_sangoret", NULL, NULL, NULL, "1991", - "Sangokushi Retsuden - Ransei no Eiyuutachi (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sangoretRomInfo, md_sangoretRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Saturday Night Slammasters (Euro) -static struct BurnRomInfo md_slammastRomDesc[] = { - { "saturday night slammasters (euro).bin", 0x400000, 0x08fa5a3f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_slammast) -STD_ROM_FN(md_slammast) - -struct BurnDriver BurnDrvmd_slammast = { - "md_slammast", NULL, NULL, NULL, "1994", - "Saturday Night Slammasters (Euro)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_slammastRomInfo, md_slammastRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Saturday Night Slammasters (USA) -static struct BurnRomInfo md_slammastuRomDesc[] = { - { "saturday night slammasters (usa).bin", 0x400000, 0x2fb4eaba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_slammastu) -STD_ROM_FN(md_slammastu) - -struct BurnDriver BurnDrvmd_slammastu = { - "md_slammastu", "md_slammast", NULL, NULL, "1994", - "Saturday Night Slammasters (USA)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_slammastuRomInfo, md_slammastuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Scooby-Doo Mystery (USA) -static struct BurnRomInfo md_scoobyRomDesc[] = { - { "scooby doo mystery (usa).bin", 0x200000, 0x7bb9dd9b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_scooby) -STD_ROM_FN(md_scooby) - -struct BurnDriver BurnDrvmd_scooby = { - "md_scooby", NULL, NULL, NULL, "1995", - "Scooby-Doo Mystery (USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_scoobyRomInfo, md_scoobyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Scrabble (Euro, Prototype) -static struct BurnRomInfo md_scrabbleRomDesc[] = { - { "scrabble (euro) (prototype).bin", 0x100000, 0x360b2610, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_scrabble) -STD_ROM_FN(md_scrabble) - -struct BurnDriver BurnDrvmd_scrabble = { - "md_scrabble", NULL, NULL, NULL, "199?", - "Scrabble (Euro, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_scrabbleRomInfo, md_scrabbleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// SeaQuest DSV (Euro) -static struct BurnRomInfo md_seaquestRomDesc[] = { - { "seaquest dsv (euro).bin", 0x200000, 0x0bb511bd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_seaquest) -STD_ROM_FN(md_seaquest) - -struct BurnDriver BurnDrvmd_seaquest = { - "md_seaquest", NULL, NULL, NULL, "1994", - "SeaQuest DSV (Euro)\0", NULL, "THQ", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_seaquestRomInfo, md_seaquestRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// SeaQuest DSV (USA) -static struct BurnRomInfo md_seaquestuRomDesc[] = { - { "seaquest dsv (usa).bin", 0x200000, 0x25b05480, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_seaquestu) -STD_ROM_FN(md_seaquestu) - -struct BurnDriver BurnDrvmd_seaquestu = { - "md_seaquestu", "md_seaquest", NULL, NULL, "1994", - "SeaQuest DSV (USA)\0", NULL, "Black Pearl", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_seaquestuRomInfo, md_seaquestuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Second Samurai (Euro) -static struct BurnRomInfo md_secondsRomDesc[] = { - { "second samurai (euro).bin", 0x100000, 0x78e92143, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_seconds) -STD_ROM_FN(md_seconds) - -struct BurnDriver BurnDrvmd_seconds = { - "md_seconds", NULL, NULL, NULL, "1994", - "The Second Samurai (Euro)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_secondsRomInfo, md_secondsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sega Sports 1 (Euro) -static struct BurnRomInfo md_segasprtRomDesc[] = { - { "sega sports 1 (euro).bin", 0x280000, 0x07fedaf1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_segasprt) -STD_ROM_FN(md_segasprt) - -struct BurnDriver BurnDrvmd_segasprt = { - "md_segasprt", NULL, NULL, NULL, "1995", - "Sega Sports 1 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_segasprtRomInfo, md_segasprtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sega Top Five (Bra) -static struct BurnRomInfo md_segatopRomDesc[] = { - { "sega top five (bra).bin", 0x200000, 0x61069069, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_segatop) -STD_ROM_FN(md_segatop) - -struct BurnDriver BurnDrvmd_segatop = { - "md_segatop", NULL, NULL, NULL, "199?", - "Sega Top Five (Bra)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_segatopRomInfo, md_segatopRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sensible Soccer (Euro) -static struct BurnRomInfo md_sensibleRomDesc[] = { - { "mpr-16014.bin", 0x080000, 0xf9b396b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sensible) -STD_ROM_FN(md_sensible) - -struct BurnDriver BurnDrvmd_sensible = { - "md_sensible", NULL, NULL, NULL, "1993", - "Sensible Soccer (Euro)\0", NULL, "Renegade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sensibleRomInfo, md_sensibleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sensible Soccer (Prototype) -static struct BurnRomInfo md_sensiblepRomDesc[] = { - { "sensible soccer (beta).bin", 0x080000, 0xef52664d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sensiblep) -STD_ROM_FN(md_sensiblep) - -struct BurnDriver BurnDrvmd_sensiblep = { - "md_sensiblep", "md_sensible", NULL, NULL, "1993", - "Sensible Soccer (Prototype)\0", NULL, "Renegade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sensiblepRomInfo, md_sensiblepRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sensible Soccer - International Edition (Euro) -static struct BurnRomInfo md_sensibieRomDesc[] = { - { "sensible soccer - international edition (euro).bin", 0x080000, 0x04e3bcca, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sensibie) -STD_ROM_FN(md_sensibie) - -struct BurnDriver BurnDrvmd_sensibie = { - "md_sensibie", NULL, NULL, NULL, "1993", - "Sensible Soccer - International Edition (Euro)\0", NULL, "Sony Imagesoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sensibieRomInfo, md_sensibieRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sesame Street Counting Cafe (USA) -static struct BurnRomInfo md_sesameRomDesc[] = { - { "sesame street counting cafe (usa).bin", 0x100000, 0x0a4f48c3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sesame) -STD_ROM_FN(md_sesame) - -struct BurnDriver BurnDrvmd_sesame = { - "md_sesame", NULL, NULL, NULL, "1994", - "Sesame Street Counting Cafe (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sesameRomInfo, md_sesameRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadow Blasters (USA) -static struct BurnRomInfo md_shadowRomDesc[] = { - { "shadow blasters (usa).bin", 0x080000, 0x713d377b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shadow) -STD_ROM_FN(md_shadow) - -struct BurnDriver BurnDrvmd_shadow = { - "md_shadow", NULL, NULL, NULL, "1990", - "Shadow Blasters (USA)\0", NULL, "Sage's Creation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shadowRomInfo, md_shadowRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shiten Myouou (Jpn) -static struct BurnRomInfo md_shitenRomDesc[] = { - { "shiten myouou (jpn).bin", 0x080000, 0x7e729693, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shiten) -STD_ROM_FN(md_shiten) - -struct BurnDriver BurnDrvmd_shiten = { - "md_shiten", "md_shadow", NULL, NULL, "1990", - "Shiten Myouou (Jpn)\0", NULL, "Sigma", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shitenRomInfo, md_shitenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadow Dancer - The Secret of Shinobi (World) -static struct BurnRomInfo md_shdancerRomDesc[] = { - { "mpr-13571.bin", 0x080000, 0xebe9ad10, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shdancer) -STD_ROM_FN(md_shdancer) - -struct BurnDriver BurnDrvmd_shdancer = { - "md_shdancer", NULL, NULL, NULL, "1990", - "Shadow Dancer - The Secret of Shinobi (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shdancerRomInfo, md_shdancerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadow of the Beast (Euro, USA) -static struct BurnRomInfo md_beastRomDesc[] = { - { "sha01.bin", 0x100000, 0xbd385c27, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beast) -STD_ROM_FN(md_beast) - -struct BurnDriver BurnDrvmd_beast = { - "md_beast", NULL, NULL, NULL, "1991", - "Shadow of the Beast (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beastRomInfo, md_beastRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadow of the Beast - Mashou no Okite (Jpn) -static struct BurnRomInfo md_beastjRomDesc[] = { - { "shadow of the beast - mashou no okite (jpn).bin", 0x100000, 0x0cd09d31, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beastj) -STD_ROM_FN(md_beastj) - -struct BurnDriver BurnDrvmd_beastj = { - "md_beastj", "md_beast", NULL, NULL, "1992", - "Shadow of the Beast - Mashou no Okite (Jpn)\0", NULL, "Victor Interactive Software", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beastjRomInfo, md_beastjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadow of the Beast II (Euro, USA) -static struct BurnRomInfo md_beast2RomDesc[] = { - { "shadow of the beast ii (euro, usa).bin", 0x100000, 0x2dede3db, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beast2) -STD_ROM_FN(md_beast2) - -struct BurnDriver BurnDrvmd_beast2 = { - "md_beast2", NULL, NULL, NULL, "1992", - "Shadow of the Beast II (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_beast2RomInfo, md_beast2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadowrun (USA) -static struct BurnRomInfo md_shadowrnRomDesc[] = { - { "shadowrun (usa).bin", 0x200000, 0xfbb92909, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shadowrn) -STD_ROM_FN(md_shadowrn) - -struct BurnDriver BurnDrvmd_shadowrn = { - "md_shadowrn", NULL, NULL, NULL, "1994", - "Shadowrun (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shadowrnRomInfo, md_shadowrnRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadowrun (Jpn) -static struct BurnRomInfo md_shadowrnjRomDesc[] = { - { "shadowrun (jpn).bin", 0x200000, 0xd32199f7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shadowrnj) -STD_ROM_FN(md_shadowrnj) - -struct BurnDriver BurnDrvmd_shadowrnj = { - "md_shadowrnj", "md_shadowrn", NULL, NULL, "199?", - "Shadowrun (Jpn)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shadowrnjRomInfo, md_shadowrnjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadowrun (USA, Prototype, 19931228) -static struct BurnRomInfo md_shadowrnp4RomDesc[] = { - { "shadowrun (prototype - dec 28, 1993).bin", 0x200000, 0x2455add2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shadowrnp4) -STD_ROM_FN(md_shadowrnp4) - -struct BurnDriver BurnDrvmd_shadowrnp4 = { - "md_shadowrnp4", "md_shadowrn", NULL, NULL, "1993", - "Shadowrun (USA, Prototype, 19931228)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shadowrnp4RomInfo, md_shadowrnp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadowrun (USA, Prototype, 19931231) -static struct BurnRomInfo md_shadowrnp3RomDesc[] = { - { "shadowrun (prototype - dec 31, 1993).bin", 0x200000, 0xbbb5e2fa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shadowrnp3) -STD_ROM_FN(md_shadowrnp3) - -struct BurnDriver BurnDrvmd_shadowrnp3 = { - "md_shadowrnp3", "md_shadowrn", NULL, NULL, "1993", - "Shadowrun (USA, Prototype, 19931231)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shadowrnp3RomInfo, md_shadowrnp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadowrun (USA, Prototype, 19940125-C) -static struct BurnRomInfo md_shadowrnp2RomDesc[] = { - { "shadowrun (prototype - jan 25, 1994 - c).bin", 0x200000, 0x6e2bbca8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shadowrnp2) -STD_ROM_FN(md_shadowrnp2) - -struct BurnDriver BurnDrvmd_shadowrnp2 = { - "md_shadowrnp2", "md_shadowrn", NULL, NULL, "1994", - "Shadowrun (USA, Prototype, 19940125-C)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shadowrnp2RomInfo, md_shadowrnp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shadowrun (USA, Prototype, 19940125) -static struct BurnRomInfo md_shadowrnp1RomDesc[] = { - { "shadowrun (prototype - jan 25, 1994).bin", 0x200000, 0x2a964bcd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shadowrnp1) -STD_ROM_FN(md_shadowrnp1) - -struct BurnDriver BurnDrvmd_shadowrnp1 = { - "md_shadowrnp1", "md_shadowrn", NULL, NULL, "1994", - "Shadowrun (USA, Prototype, 19940125)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shadowrnp1RomInfo, md_shadowrnp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shane Warne Cricket (Aus) -static struct BurnRomInfo md_shanewarRomDesc[] = { - { "shane warne cricket (aus).bin", 0x100000, 0x68865f6f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shanewar) -STD_ROM_FN(md_shanewar) - -struct BurnDriver BurnDrvmd_shanewar = { - "md_shanewar", NULL, NULL, NULL, "1997", - "Shane Warne Cricket (Aus)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shanewarRomInfo, md_shanewarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shanghai II - Dragon's Eye (USA) -static struct BurnRomInfo md_shangh2RomDesc[] = { - { "shanghai ii - dragon's eye (usa).bin", 0x100000, 0xebe9e840, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shangh2) -STD_ROM_FN(md_shangh2) - -struct BurnDriver BurnDrvmd_shangh2 = { - "md_shangh2", NULL, NULL, NULL, "1994", - "Shanghai II - Dragon's Eye (USA)\0", NULL, "Activision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shangh2RomInfo, md_shangh2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shanghai II - Dragon's Eye (USA, Prototype) -static struct BurnRomInfo md_shangh2pRomDesc[] = { - { "shanghai ii - dragon's eye (beta).bin", 0x100000, 0x154aca2d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shangh2p) -STD_ROM_FN(md_shangh2p) - -struct BurnDriver BurnDrvmd_shangh2p = { - "md_shangh2p", "md_shangh2", NULL, NULL, "1994", - "Shanghai II - Dragon's Eye (USA, Prototype)\0", NULL, "Activision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shangh2pRomInfo, md_shangh2pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shanghai II - Dragon's Eye (USA, Prototype, Alt) -static struct BurnRomInfo md_shangh2p1RomDesc[] = { - { "shanghai ii - dragon's eye (beta) (alt).bin", 0x100000, 0x5e33867b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shangh2p1) -STD_ROM_FN(md_shangh2p1) - -struct BurnDriver BurnDrvmd_shangh2p1 = { - "md_shangh2p1", "md_shangh2", NULL, NULL, "1994", - "Shanghai II - Dragon's Eye (USA, Prototype, Alt)\0", NULL, "Activision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shangh2p1RomInfo, md_shangh2p1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shaq Fu (Euro, USA) -static struct BurnRomInfo md_shaqfuRomDesc[] = { - { "sfb2_u1+sfb2_u2.bin", 0x300000, 0x499955f2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shaqfu) -STD_ROM_FN(md_shaqfu) - -struct BurnDriver BurnDrvmd_shaqfu = { - "md_shaqfu", NULL, NULL, NULL, "1994", - "Shaq Fu (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shaqfuRomInfo, md_shaqfuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shi Jie Zhi Bang Zheng Ba Zhan - World Pro Baseball 94 (Chi) -static struct BurnRomInfo md_shijieRomDesc[] = { - { "shi jie zhi bang zheng ba zhan - world pro baseball 94 (chi) (unl).bin", 0x200000, 0x72dd884f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shijie) -STD_ROM_FN(md_shijie) - -struct BurnDriver BurnDrvmd_shijie = { - "md_shijie", NULL, NULL, NULL, "1994", - "Shi Jie Zhi Bang Zheng Ba Zhan - World Pro Baseball 94 (Chi)\0", NULL, "C&E", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shijieRomInfo, md_shijieRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shikinjoh (Jpn) -static struct BurnRomInfo md_shikinjoRomDesc[] = { - { "shikinjoh (jpn).bin", 0x080000, 0x5ea0c97d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shikinjo) -STD_ROM_FN(md_shikinjo) - -struct BurnDriver BurnDrvmd_shikinjo = { - "md_shikinjo", NULL, NULL, NULL, "1991", - "Shikinjoh (Jpn)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shikinjoRomInfo, md_shikinjoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining Force (USA) -static struct BurnRomInfo md_shinfrceRomDesc[] = { - { "shining force (usa).bin", 0x180000, 0xe0594abe, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinfrce) -STD_ROM_FN(md_shinfrce) - -struct BurnDriver BurnDrvmd_shinfrce = { - "md_shinfrce", NULL, NULL, NULL, "1992", - "Shining Force (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shinfrceRomInfo, md_shinfrceRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining Force (USA, Prototype) -static struct BurnRomInfo md_shinfrcepRomDesc[] = { - { "shining force (usa) (beta).bin", 0x180000, 0xce67143a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinfrcep) -STD_ROM_FN(md_shinfrcep) - -struct BurnDriver BurnDrvmd_shinfrcep = { - "md_shinfrcep", "md_shinfrce", NULL, NULL, "1992", - "Shining Force (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shinfrcepRomInfo, md_shinfrcepRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining Force - Kamigami no Isan (Jpn) -static struct BurnRomInfo md_shinfrcejRomDesc[] = { - { "shining force - kamigami no isan (jpn).bin", 0x180000, 0x9378fbcd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinfrcej) -STD_ROM_FN(md_shinfrcej) - -struct BurnDriver BurnDrvmd_shinfrcej = { - "md_shinfrcej", "md_shinfrce", NULL, NULL, "1992", - "Shining Force - Kamigami no Isan (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shinfrcejRomInfo, md_shinfrcejRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining Force II - Koe no Fuuin (Jpn) -static struct BurnRomInfo md_shinfrc2jRomDesc[] = { - { "shining force ii - koe no fuuin (jpn).bin", 0x200000, 0x0288f3e1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinfrc2j) -STD_ROM_FN(md_shinfrc2j) - -struct BurnDriver BurnDrvmd_shinfrc2j = { - "md_shinfrc2j", "md_shinfrc2", NULL, NULL, "1993", - "Shining Force II - Koe no Fuuin (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shinfrc2jRomInfo, md_shinfrc2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining Force II (USA, Prototype, 19940404) -static struct BurnRomInfo md_shinfrc2p2RomDesc[] = { - { "shining force ii (prototype - apr 04, 1994).bin", 0x200000, 0x5843670c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinfrc2p2) -STD_ROM_FN(md_shinfrc2p2) - -struct BurnDriver BurnDrvmd_shinfrc2p2 = { - "md_shinfrc2p2", "md_shinfrc2", NULL, NULL, "1994", - "Shining Force II (USA, Prototype, 19940404)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shinfrc2p2RomInfo, md_shinfrc2p2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining Force II (USA, Prototype, 19940607) -static struct BurnRomInfo md_shinfrc2p1RomDesc[] = { - { "shining force ii (prototype - jun 07, 1994).bin", 0x200000, 0x03b68bba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinfrc2p1) -STD_ROM_FN(md_shinfrc2p1) - -struct BurnDriver BurnDrvmd_shinfrc2p1 = { - "md_shinfrc2p1", "md_shinfrc2", NULL, NULL, "1994", - "Shining Force II (USA, Prototype, 19940607)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shinfrc2p1RomInfo, md_shinfrc2p1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining Force II (USA) -static struct BurnRomInfo md_shinfrc2uRomDesc[] = { - { "shining force ii (usa).bin", 0x200000, 0x4815e075, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinfrc2u) -STD_ROM_FN(md_shinfrc2u) - -struct BurnDriver BurnDrvmd_shinfrc2u = { - "md_shinfrc2u", "md_shinfrc2", NULL, NULL, "1994", - "Shining Force II (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shinfrc2uRomInfo, md_shinfrc2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining in the Darkness (Euro, USA) -static struct BurnRomInfo md_shindarkRomDesc[] = { - { "shining in the darkness (euro, usa).bin", 0x100000, 0x4d2785bc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shindark) -STD_ROM_FN(md_shindark) - -struct BurnDriver BurnDrvmd_shindark = { - "md_shindark", NULL, NULL, NULL, "1991", - "Shining in the Darkness (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shindarkRomInfo, md_shindarkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining in the Darkness (Bra) -static struct BurnRomInfo md_shindarkbrRomDesc[] = { - { "shining in the darkness (bra).bin", 0x100000, 0x3ee2bbc4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shindarkbr) -STD_ROM_FN(md_shindarkbr) - -struct BurnDriver BurnDrvmd_shindarkbr = { - "md_shindarkbr", "md_shindark", NULL, NULL, "1994", - "Shining in the Darkness (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shindarkbrRomInfo, md_shindarkbrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shining and the Darkness (Jpn) -static struct BurnRomInfo md_shindarkjRomDesc[] = { - { "mpr-13807.bin", 0x100000, 0x496af51c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shindarkj) -STD_ROM_FN(md_shindarkj) - -struct BurnDriver BurnDrvmd_shindarkj = { - "md_shindarkj", "md_shindark", NULL, NULL, "1991", - "Shining and the Darkness (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_shindarkjRomInfo, md_shindarkjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shinobi III - Return of the Ninja Master (USA) -static struct BurnRomInfo md_shinobi3uRomDesc[] = { - { "shinobi iii - return of the ninja master (usa).bin", 0x100000, 0x5381506f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shinobi3u) -STD_ROM_FN(md_shinobi3u) - -struct BurnDriver BurnDrvmd_shinobi3u = { - "md_shinobi3u", "md_shinobi3", NULL, NULL, "1993", - "Shinobi III - Return of the Ninja Master (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shinobi3uRomInfo, md_shinobi3uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Super Shinobi II (Jpn, Kor) -static struct BurnRomInfo md_supshin2RomDesc[] = { - { "super shinobi ii, the (jpn, kor).bin", 0x100000, 0x5b412816, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_supshin2) -STD_ROM_FN(md_supshin2) - -struct BurnDriver BurnDrvmd_supshin2 = { - "md_supshin2", "md_shinobi3", NULL, NULL, "1993", - "The Super Shinobi II (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_supshin2RomInfo, md_supshin2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Super Shinobi II (Jpn, Prototype) -static struct BurnRomInfo md_supshin2p1RomDesc[] = { - { "super shinobi ii, the (jpn) (beta).bin", 0x100000, 0xc47e8aea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_supshin2p1) -STD_ROM_FN(md_supshin2p1) - -struct BurnDriver BurnDrvmd_supshin2p1 = { - "md_supshin2p1", "md_shinobi3", NULL, NULL, "1993", - "The Super Shinobi II (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_supshin2p1RomInfo, md_supshin2p1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Super Shinobi II (Jpn, Prototype, Earlier) -static struct BurnRomInfo md_supshin2p2RomDesc[] = { - { "super shinobi ii, the (jpn) (beta) (earlier).bin", 0x100000, 0x1ee5bce3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_supshin2p2) -STD_ROM_FN(md_supshin2p2) - -struct BurnDriver BurnDrvmd_supshin2p2 = { - "md_supshin2p2", "md_shinobi3", NULL, NULL, "1993", - "The Super Shinobi II (Jpn, Prototype, Earlier)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_supshin2p2RomInfo, md_supshin2p2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ship (Prototype) -static struct BurnRomInfo md_shipRomDesc[] = { - { "ship (prototype).bin", 0x020000, 0x4cdc9f16, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ship) -STD_ROM_FN(md_ship) - -struct BurnDriver BurnDrvmd_ship = { - "md_ship", NULL, NULL, NULL, "199?", - "Ship (Prototype)\0", NULL, "Technopop", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shipRomInfo, md_shipRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shougi no Hoshi (Jpn) -static struct BurnRomInfo md_shougiRomDesc[] = { - { "shougi no hoshi (jpn).bin", 0x040000, 0x4148f816, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shougi) -STD_ROM_FN(md_shougi) - -struct BurnDriver BurnDrvmd_shougi = { - "md_shougi", NULL, NULL, NULL, "1991", - "Shougi no Hoshi (Jpn)\0", NULL, "Home Data", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shougiRomInfo, md_shougiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shove It! ...The Warehouse Game (USA) -static struct BurnRomInfo md_shoveitRomDesc[] = { - { "shove it! ...the warehouse game (usa).bin", 0x020000, 0xc51f40cb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shoveit) -STD_ROM_FN(md_shoveit) - -struct BurnDriver BurnDrvmd_shoveit = { - "md_shoveit", NULL, NULL, NULL, "1990", - "Shove It! ...The Warehouse Game (USA)\0", NULL, "Dreamworks", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shoveitRomInfo, md_shoveitRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shijou Saidai no Soukoban (Jpn) -static struct BurnRomInfo md_sokobanRomDesc[] = { - { "shijou saidai no soukoban (jpn).bin", 0x040000, 0x40f4aacc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sokoban) -STD_ROM_FN(md_sokoban) - -struct BurnDriver BurnDrvmd_sokoban = { - "md_sokoban", "md_shoveit", NULL, NULL, "1990", - "Shijou Saidai no Soukoban (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sokobanRomInfo, md_sokobanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Show do Milho (Bra) -static struct BurnRomInfo md_sdmilhaoRomDesc[] = { - { "show do milhao (bra).bin", 0x200000, 0x0a22df04, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sdmilhao) -STD_ROM_FN(md_sdmilhao) - -struct BurnDriver BurnDrvmd_sdmilhao = { - "md_sdmilhao", NULL, NULL, NULL, "2001", - "Show do Milhao (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - L"Show do Milh\u00e3o (Bra)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sdmilhaoRomInfo, md_sdmilhaoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Show do Milho Volume 2 (Bra) -static struct BurnRomInfo md_sdmilha2RomDesc[] = { - { "show do milhao volume 2 (bra).bin", 0x200000, 0x48ee66cb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sdmilha2) -STD_ROM_FN(md_sdmilha2) - -struct BurnDriver BurnDrvmd_sdmilha2 = { - "md_sdmilha2", NULL, NULL, NULL, "2002", - "Show do Milhao Volume 2 (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - L"Show do Milh\u00e3o Volume 2 (Bra)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sdmilha2RomInfo, md_sdmilha2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Show do Milho Volume 2 (Bra, Alt) -static struct BurnRomInfo md_sdmilha2aRomDesc[] = { - { "show do milhao volume 2 (bra) (alt).bin", 0x200000, 0xd8c9ac6d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sdmilha2a) -STD_ROM_FN(md_sdmilha2a) - -struct BurnDriver BurnDrvmd_sdmilha2a = { - "md_sdmilha2a", "md_sdmilha2", NULL, NULL, "2002", - "Show do Milhao Volume 2 (Bra, Alt)\0", NULL, "Tec Toy", "Sega Megadrive", - L"Show do Milh\u00e3o Volume 2 (Bra, Alt)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sdmilha2aRomInfo, md_sdmilha2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shui Hu - Feng Yun Zhuan (Chi) -static struct BurnRomInfo md_shuihuRomDesc[] = { - { "shui hu - feng yun zhuan (chi) (unl).bin", 0x200000, 0x3e9e010c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shuihu) -STD_ROM_FN(md_shuihu) - -struct BurnDriver BurnDrvmd_shuihu = { - "md_shuihu", NULL, NULL, NULL, "1999", - "Shui Hu - Feng Yun Zhuan (Chi)\0", NULL, "Never Ending Soft Team", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shuihuRomInfo, md_shuihuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shui Hu Zhuan (Chi) -static struct BurnRomInfo md_shuihuzhRomDesc[] = { - { "shui hu zhuan (chi) (unl).bin", 0x200000, 0x61e458c3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shuihuzh) -STD_ROM_FN(md_shuihuzh) - -struct BurnDriver BurnDrvmd_shuihuzh = { - "md_shuihuzh", NULL, NULL, NULL, "1996", - "Shui Hu Zhuan (Chi)\0", NULL, "Chuanpu Technologies", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shuihuzhRomInfo, md_shuihuzhRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shura no Mon (Jpn) -static struct BurnRomInfo md_shuramonRomDesc[] = { - { "shura no mon (jpn).bin", 0x100000, 0xe19da6e5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shuramon) -STD_ROM_FN(md_shuramon) - -struct BurnDriver BurnDrvmd_shuramon = { - "md_shuramon", NULL, NULL, NULL, "1992", - "Shura no Mon (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shuramonRomInfo, md_shuramonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Side Pocket (Euro) -static struct BurnRomInfo md_sidepockRomDesc[] = { - { "side pocket (euro).bin", 0x100000, 0x36e08145, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sidepock) -STD_ROM_FN(md_sidepock) - -struct BurnDriver BurnDrvmd_sidepock = { - "md_sidepock", NULL, NULL, NULL, "1992", - "Side Pocket (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sidepockRomInfo, md_sidepockRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Side Pocket (Jpn) -static struct BurnRomInfo md_sidepockjRomDesc[] = { - { "side pocket (jpn).bin", 0x100000, 0x336bbf3e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sidepockj) -STD_ROM_FN(md_sidepockj) - -struct BurnDriver BurnDrvmd_sidepockj = { - "md_sidepockj", "md_sidepock", NULL, NULL, "1992", - "Side Pocket (Jpn)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sidepockjRomInfo, md_sidepockjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Simpsons - Bart Vs The Space Mutants (Euro, USA, Rev. A) -static struct BurnRomInfo md_bartvssmRomDesc[] = { - { "mpr-14759a.bin", 0x080000, 0xdb70e8ca, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bartvssm) -STD_ROM_FN(md_bartvssm) - -struct BurnDriver BurnDrvmd_bartvssm = { - "md_bartvssm", NULL, NULL, NULL, "1992", - "The Simpsons - Bart Vs The Space Mutants (Euro, USA, Rev. A)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bartvssmRomInfo, md_bartvssmRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Simpsons - Bart Vs The Space Mutants (Euro, USA) -static struct BurnRomInfo md_bartvssm1RomDesc[] = { - { "simpsons, the - bart vs the space mutants (euro, usa).bin", 0x080000, 0xc8620574, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bartvssm1) -STD_ROM_FN(md_bartvssm1) - -struct BurnDriver BurnDrvmd_bartvssm1 = { - "md_bartvssm1", "md_bartvssm", NULL, NULL, "1992", - "The Simpsons - Bart Vs The Space Mutants (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bartvssm1RomInfo, md_bartvssm1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Simpsons - Bart's Nightmare (Euro, USA) -static struct BurnRomInfo md_bartnighRomDesc[] = { - { "simpsons, the - bart's nightmare (euro, usa).bin", 0x100000, 0x24d7507c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bartnigh) -STD_ROM_FN(md_bartnigh) - -struct BurnDriver BurnDrvmd_bartnigh = { - "md_bartnigh", NULL, NULL, NULL, "1993", - "The Simpsons - Bart's Nightmare (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bartnighRomInfo, md_bartnighRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Skeleton Krew (Euro) -static struct BurnRomInfo md_skelkrewRomDesc[] = { - { "skeleton krew (euro).bin", 0x200000, 0x5f872737, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skelkrew) -STD_ROM_FN(md_skelkrew) - -struct BurnDriver BurnDrvmd_skelkrew = { - "md_skelkrew", NULL, NULL, NULL, "1995", - "Skeleton Krew (Euro)\0", NULL, "Core Design", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skelkrewRomInfo, md_skelkrewRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Skeleton Krew (USA) -static struct BurnRomInfo md_skelkrewuRomDesc[] = { - { "skeleton krew (usa).bin", 0x200000, 0xc2e05acb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skelkrewu) -STD_ROM_FN(md_skelkrewu) - -struct BurnDriver BurnDrvmd_skelkrewu = { - "md_skelkrewu", "md_skelkrew", NULL, NULL, "1995", - "Skeleton Krew (USA)\0", NULL, "Core Design", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skelkrewuRomInfo, md_skelkrewuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// From TV Animation Slam Dunk - Kyougou Makkou Taiketsu! (Jpn) -static struct BurnRomInfo md_slamdunkRomDesc[] = { - { "from tv animation slam dunk - kyougou makkou taiketsu! (jpn).bin", 0x200000, 0xcdf5678f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_slamdunk) -STD_ROM_FN(md_slamdunk) - -struct BurnDriver BurnDrvmd_slamdunk = { - "md_slamdunk", NULL, NULL, NULL, "1995", - "From TV Animation Slam Dunk - Kyougou Makkou Taiketsu! (Jpn)\0", NULL, "Bandai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_slamdunkRomInfo, md_slamdunkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Slam - Shaq vs. the Legends (Prototype) -static struct BurnRomInfo md_slamshaqRomDesc[] = { - { "slam - shaq vs. the legends (prototype).bin", 0x1f485a, 0xc19c200e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_slamshaq) -STD_ROM_FN(md_slamshaq) - -struct BurnDriver BurnDrvmd_slamshaq = { - "md_slamshaq", NULL, NULL, NULL, "199?", - "Slam - Shaq vs. the Legends (Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_slamshaqRomInfo, md_slamshaqRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Slap Fight MD (Jpn) -static struct BurnRomInfo md_slapfighRomDesc[] = { - { "slap fight md (jpn).bin", 0x100000, 0xd6695695, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_slapfigh) -STD_ROM_FN(md_slapfigh) - -struct BurnDriver BurnDrvmd_slapfigh = { - "md_slapfigh", NULL, NULL, NULL, "1993", - "Slap Fight MD (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_slapfighRomInfo, md_slapfighRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Slaughter Sport (USA) -static struct BurnRomInfo md_slaughtrRomDesc[] = { - { "slaughter sport (usa).bin", 0x0a0000, 0xaf9f9d9c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_slaughtr) -STD_ROM_FN(md_slaughtr) - -struct BurnDriver BurnDrvmd_slaughtr = { - "md_slaughtr", NULL, NULL, NULL, "1991", - "Slaughter Sport (USA)\0", NULL, "Razorsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_slaughtrRomInfo, md_slaughtrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fatman (Jpn) -static struct BurnRomInfo md_fatmanRomDesc[] = { - { "fatman (jpn).bin", 0x0a0000, 0x7867da3a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fatman) -STD_ROM_FN(md_fatman) - -struct BurnDriver BurnDrvmd_fatman = { - "md_fatman", "md_slaughtr", NULL, NULL, "1990", - "Fatman (Jpn)\0", NULL, "Sanritsu Denki", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fatmanRomInfo, md_fatmanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Smurfs Travel the World (Euro) -static struct BurnRomInfo md_smurfstwRomDesc[] = { - { "smurfs travel the world, the (euro).bin", 0x100000, 0xb28bdd69, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smurfstw) -STD_ROM_FN(md_smurfstw) - -struct BurnDriver BurnDrvmd_smurfstw = { - "md_smurfstw", NULL, NULL, NULL, "1996", - "The Smurfs Travel the World (Euro)\0", NULL, "Infogrames", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smurfstwRomInfo, md_smurfstwRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Snake Rattle n' Roll (Euro) -static struct BurnRomInfo md_snakernrRomDesc[] = { - { "snake rattle n' roll (euro).bin", 0x080000, 0x543bed30, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_snakernr) -STD_ROM_FN(md_snakernr) - -struct BurnDriver BurnDrvmd_snakernr = { - "md_snakernr", NULL, NULL, NULL, "1993", - "Snake Rattle n' Roll (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_snakernrRomInfo, md_snakernrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Snow Bros. - Nick & Tom (Jpn) -static struct BurnRomInfo md_snowbrosRomDesc[] = { - { "snow bros. - nick & tom (jpn).bin", 0x100000, 0x11b56228, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_snowbros) -STD_ROM_FN(md_snowbros) - -struct BurnDriver BurnDrvmd_snowbros = { - "md_snowbros", NULL, NULL, NULL, "1993", - "Snow Bros. - Nick & Tom (Jpn)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_snowbrosRomInfo, md_snowbrosRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Socket (USA) -static struct BurnRomInfo md_socketRomDesc[] = { - { "socket (usa).bin", 0x100000, 0x3c14e15a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_socket) -STD_ROM_FN(md_socket) - -struct BurnDriver BurnDrvmd_socket = { - "md_socket", NULL, NULL, NULL, "1994", - "Socket (USA)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_socketRomInfo, md_socketRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Time Dominator 1st (Jpn, Kor) -static struct BurnRomInfo md_timedomRomDesc[] = { - { "time dominator 1st (jpn, kor).bin", 0x100000, 0x7eba7a5c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_timedom) -STD_ROM_FN(md_timedom) - -struct BurnDriver BurnDrvmd_timedom = { - "md_timedom", "md_socket", NULL, NULL, "1994", - "Time Dominator 1st (Jpn, Kor)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_timedomRomInfo, md_timedomRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sol-Deace (USA) -static struct BurnRomInfo md_soldeaceRomDesc[] = { - { "sol-deace (usa).bin", 0x100000, 0xa77e4e9f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_soldeace) -STD_ROM_FN(md_soldeace) - -struct BurnDriver BurnDrvmd_soldeace = { - "md_soldeace", NULL, NULL, NULL, "1992", - "Sol-Deace (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_soldeaceRomInfo, md_soldeaceRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Soleil (Euro) -static struct BurnRomInfo md_soleilRomDesc[] = { - { "mpr-17499.bin", 0x200000, 0xa30ebdb1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_soleil) -STD_ROM_FN(md_soleil) - -struct BurnDriver BurnDrvmd_soleil = { - "md_soleil", NULL, NULL, NULL, "1994", - "Soleil (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_soleilRomInfo, md_soleilRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crusader of Centy (USA) -static struct BurnRomInfo md_crusaderRomDesc[] = { - { "crusader of centy (usa).bin", 0x200000, 0x41858f6f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crusader) -STD_ROM_FN(md_crusader) - -struct BurnDriver BurnDrvmd_crusader = { - "md_crusader", "md_soleil", NULL, NULL, "1994", - "Crusader of Centy (USA)\0", NULL, "Atlus", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_crusaderRomInfo, md_crusaderRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shin Souseiki Ragnacenty (Jpn) -static struct BurnRomInfo md_ragnacenRomDesc[] = { - { "shin souseiki ragnacenty (jpn).bin", 0x200000, 0x6a3f5ae2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ragnacen) -STD_ROM_FN(md_ragnacen) - -struct BurnDriver BurnDrvmd_ragnacen = { - "md_ragnacen", "md_soleil", NULL, NULL, "1994", - "Shin Souseiki Ragnacenty (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ragnacenRomInfo, md_ragnacenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shin Souseiki Ragnacenty (Jpn, Prototype) -static struct BurnRomInfo md_ragnacenpRomDesc[] = { - { "shin souseiki ragnacenty (jpn) (beta).bin", 0x100000, 0x43797455, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ragnacenp) -STD_ROM_FN(md_ragnacenp) - -struct BurnDriver BurnDrvmd_ragnacenp = { - "md_ragnacenp", "md_soleil", NULL, NULL, "1994", - "Shin Souseiki Ragnacenty (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ragnacenpRomInfo, md_ragnacenpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ragnacenty (Kor) -static struct BurnRomInfo md_ragnacenkRomDesc[] = { - { "ragnacenty (kor).bin", 0x200000, 0x77b5b10b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ragnacenk) -STD_ROM_FN(md_ragnacenk) - -struct BurnDriver BurnDrvmd_ragnacenk = { - "md_ragnacenk", "md_soleil", NULL, NULL, "1994", - "Ragnacenty (Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ragnacenkRomInfo, md_ragnacenkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (World) -static struct BurnRomInfo md_skRomDesc[] = { - { "mpr-16910-u.ic1", 0x200000, 0x0658f691, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, - { "mpr-16911-s.ic2", 0x040000, 0x4dcfd55c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_300000 }, -}; - -STD_ROM_PICK(md_sk) -STD_ROM_FN(md_sk) - -struct BurnDriver BurnDrvmd_sk = { - "md_sk", NULL, NULL, NULL, "1994", - "Sonic & Knuckles (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skRomInfo, md_skRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0606, 19940606, 10.02) -static struct BurnRomInfo md_skp10RomDesc[] = { - { "sonic & knuckles (prototype 0606 - jun 06, 1994, 10.02).bin", 0x200000, 0x03a52f63, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp10) -STD_ROM_FN(md_skp10) - -struct BurnDriver BurnDrvmd_skp10 = { - "md_skp10", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0606, 19940606, 10.02)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp10RomInfo, md_skp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0608, 19940608, 05.03) -static struct BurnRomInfo md_skp08RomDesc[] = { - { "sonic & knuckles (prototype 0608 - jun 08, 1994, 05.03).bin", 0x200000, 0x7a6c1317, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp08) -STD_ROM_FN(md_skp08) - -struct BurnDriver BurnDrvmd_skp08 = { - "md_skp08", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0608, 19940608, 05.03)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp08RomInfo, md_skp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0610, 19940610, 07.49) -static struct BurnRomInfo md_skp06RomDesc[] = { - { "sonic & knuckles (prototype 0610 - jun 10, 1994, 07.49).bin", 0x200000, 0x7092f368, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp06) -STD_ROM_FN(md_skp06) - -struct BurnDriver BurnDrvmd_skp06 = { - "md_skp06", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0610, 19940610, 07.49)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp06RomInfo, md_skp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0612, 19940612, 18.27) -static struct BurnRomInfo md_skp04RomDesc[] = { - { "sonic & knuckles (prototype 0612 - jun 12, 1994, 18.27).bin", 0x200000, 0xb0a253e8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp04) -STD_ROM_FN(md_skp04) - -struct BurnDriver BurnDrvmd_skp04 = { - "md_skp04", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0612, 19940612, 18.27)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp04RomInfo, md_skp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0618, 19940618, 09.15) -static struct BurnRomInfo md_skp02RomDesc[] = { - { "sonic & knuckles (prototype 0618 - jun 18, 1994, 09.15).bin", 0x200000, 0x2615f5dc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp02) -STD_ROM_FN(md_skp02) - -struct BurnDriver BurnDrvmd_skp02 = { - "md_skp02", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0618, 19940618, 09.15)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp02RomInfo, md_skp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0619, 19940619, 08.18) -static struct BurnRomInfo md_skp01RomDesc[] = { - { "sonic & knuckles (prototype 0619 - jun 19, 1994, 08.18).bin", 0x200000, 0x1ea5b9d1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp01) -STD_ROM_FN(md_skp01) - -struct BurnDriver BurnDrvmd_skp01 = { - "md_skp01", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0619, 19940619, 08.18)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp01RomInfo, md_skp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0606, 19940605, 22.25, S2K chip) -static struct BurnRomInfo md_skp11RomDesc[] = { - { "sonic & knuckles (s2k chip) (prototype 0606 - jun 05, 1994, 22.25).bin", 0x040000, 0xbd619ea9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp11) -STD_ROM_FN(md_skp11) - -struct BurnDriver BurnDrvmd_skp11 = { - "md_skp11", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0606, 19940605, 22.25, S2K chip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp11RomInfo, md_skp11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0608, 19940608, 03.35, S2K chip) -static struct BurnRomInfo md_skp09RomDesc[] = { - { "sonic & knuckles (s2k chip) (prototype 0608 - jun 08, 1994, 03.35).bin", 0x040000, 0x6a5dcbe6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp09) -STD_ROM_FN(md_skp09) - -struct BurnDriver BurnDrvmd_skp09 = { - "md_skp09", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0608, 19940608, 03.35, S2K chip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp09RomInfo, md_skp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0610, 19940610, 03.11, S2K chip) -static struct BurnRomInfo md_skp07RomDesc[] = { - { "sonic & knuckles (s2k chip) (prototype 0610 - jun 10, 1994, 03.11).bin", 0x040000, 0x0f6ff22b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp07) -STD_ROM_FN(md_skp07) - -struct BurnDriver BurnDrvmd_skp07 = { - "md_skp07", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0610, 19940610, 03.11, S2K chip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp07RomInfo, md_skp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0612, 19940612, 18.18, S2K chip) -static struct BurnRomInfo md_skp05RomDesc[] = { - { "sonic & knuckles (s2k chip) (prototype 0612 - jun 12, 1994, 18.18).bin", 0x040000, 0x9a5f8183, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp05) -STD_ROM_FN(md_skp05) - -struct BurnDriver BurnDrvmd_skp05 = { - "md_skp05", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0612, 19940612, 18.18, S2K chip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp05RomInfo, md_skp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0618, 19940618, 9.07, S2K chip) -static struct BurnRomInfo md_skp03RomDesc[] = { - { "sonic & knuckles (s2k chip) (prototype 0618 - jun 18, 1994, 9.07).bin", 0x040000, 0x4dcfd55c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp03) -STD_ROM_FN(md_skp03) - -struct BurnDriver BurnDrvmd_skp03 = { - "md_skp03", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0618, 19940618, 9.07, S2K chip)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp03RomInfo, md_skp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Knuckles in Sonic 2 (Prototype 0524, 19940527, 10.46) -static struct BurnRomInfo md_knucklpRomDesc[] = { - { "knuckles in sonic 2 (prototype 0524 - may 27, 1994, 10.46).bin", 0x400000, 0x8878c1a8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_knucklp) -STD_ROM_FN(md_knucklp) - -struct BurnDriver BurnDrvmd_knucklp = { - "md_knucklp", NULL, NULL, NULL, "199?", - "Knuckles in Sonic 2 (Prototype 0524, 19940527, 10.46)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_knucklpRomInfo, md_knucklpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles (Prototype 0525, 19940525, 15.28) -static struct BurnRomInfo md_skp12RomDesc[] = { - { "sonic & knuckles (prototype 0525 - may 25, 1994, 15.28).bin", 0x400000, 0x8e8dadd0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skp12) -STD_ROM_FN(md_skp12) - -struct BurnDriver BurnDrvmd_skp12 = { - "md_skp12", "md_sk", NULL, NULL, "1994", - "Sonic & Knuckles (Prototype 0525, 19940525, 15.28)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_skp12RomInfo, md_skp12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3C (Prototype 0408, 19940408, 17.29) -static struct BurnRomInfo md_sonic3cRomDesc[] = { - { "sonic 3c (prototype 0408 - apr 08, 1994, 17.29).bin", 0x400000, 0x59d23df5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3c) -STD_ROM_FN(md_sonic3c) - -struct BurnDriver BurnDrvmd_sonic3c = { - "md_sonic3c", NULL, NULL, NULL, "199?", - "Sonic 3C (Prototype 0408, 19940408, 17.29)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_FRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3cRomInfo, md_sonic3cRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3C (Prototype 0517, 19940517, 17.08) -static struct BurnRomInfo md_sonic3caRomDesc[] = { - { "sonic 3c (prototype 0517 - may 17, 1994, 17.08).bin", 0x400000, 0x766c4b81, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3ca) -STD_ROM_FN(md_sonic3ca) - -struct BurnDriver BurnDrvmd_sonic3ca = { - "md_sonic3ca", NULL, NULL, NULL, "199?", - "Sonic 3C (Prototype 0517, 19940517, 17.08)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_FRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3caRomInfo, md_sonic3caRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3D - Flickies' Island (Euro) ~ Sonic 3D Blast (USA, Kor) -static struct BurnRomInfo md_sonic3dRomDesc[] = { - { "sonic 3d blast -- sonic 3d - flickies' island (euro, usa, kor).bin", 0x400000, 0x44a2ca44, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3d) -STD_ROM_FN(md_sonic3d) - -struct BurnDriver BurnDrvmd_sonic3d = { - "md_sonic3d", NULL, NULL, NULL, "1996", - "Sonic 3D - Flickies' Island (Euro) ~ Sonic 3D Blast (USA, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3dRomInfo, md_sonic3dRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3D Blast (Prototype 73, 19960703, 13.58) -static struct BurnRomInfo md_sonic3dp8RomDesc[] = { - { "sonic 3d blast (prototype 73 - jul 03, 1996, 13.58).bin", 0x200000, 0x93b75e99, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3dp8) -STD_ROM_FN(md_sonic3dp8) - -struct BurnDriver BurnDrvmd_sonic3dp8 = { - "md_sonic3dp8", "md_sonic3d", NULL, NULL, "1996", - "Sonic 3D Blast (Prototype 73, 19960703, 13.58)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3dp8RomInfo, md_sonic3dp8RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3D Blast (Prototype 814, 19960815, 07.55) -static struct BurnRomInfo md_sonic3dp7RomDesc[] = { - { "sonic 3d blast (prototype 814 - aug 15, 1996, 07.55).bin", 0x400000, 0xd64e7675, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3dp7) -STD_ROM_FN(md_sonic3dp7) - -struct BurnDriver BurnDrvmd_sonic3dp7 = { - "md_sonic3dp7", "md_sonic3d", NULL, NULL, "1996", - "Sonic 3D Blast (Prototype 814, 19960815, 07.55)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3dp7RomInfo, md_sonic3dp7RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3D Blast (Prototype 819, 19960819, 19.49) -static struct BurnRomInfo md_sonic3dp6RomDesc[] = { - { "sonic 3d blast (prototype 819 - aug 19, 1996, 19.49).bin", 0x400000, 0x2c43f43a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3dp6) -STD_ROM_FN(md_sonic3dp6) - -struct BurnDriver BurnDrvmd_sonic3dp6 = { - "md_sonic3dp6", "md_sonic3d", NULL, NULL, "1996", - "Sonic 3D Blast (Prototype 819, 19960819, 19.49)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3dp6RomInfo, md_sonic3dp6RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3D Blast (Prototype 825, 19960826, 15.46) -static struct BurnRomInfo md_sonic3dp5RomDesc[] = { - { "sonic 3d blast (prototype 825 - aug 26, 1996, 15.46).bin", 0x400000, 0x465bcfbd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3dp5) -STD_ROM_FN(md_sonic3dp5) - -struct BurnDriver BurnDrvmd_sonic3dp5 = { - "md_sonic3dp5", "md_sonic3d", NULL, NULL, "1996", - "Sonic 3D Blast (Prototype 825, 19960826, 15.46)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3dp5RomInfo, md_sonic3dp5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3D Blast (Prototype 830, 19960831, 08.19) -static struct BurnRomInfo md_sonic3dp4RomDesc[] = { - { "sonic 3d blast (prototype 830 - aug 31, 1996, 08.19).bin", 0x3fff06, 0x57640422, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3dp4) -STD_ROM_FN(md_sonic3dp4) - -struct BurnDriver BurnDrvmd_sonic3dp4 = { - "md_sonic3dp4", "md_sonic3d", NULL, NULL, "1996", - "Sonic 3D Blast (Prototype 830, 19960831, 08.19)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3dp4RomInfo, md_sonic3dp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3D Blast (Prototype 831, 19960903, 10.07) -static struct BurnRomInfo md_sonic3dp3RomDesc[] = { - { "sonic 3d blast (prototype 831 - sep 03, 1996, 10.07).bin", 0x400000, 0x5933e453, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3dp3) -STD_ROM_FN(md_sonic3dp3) - -struct BurnDriver BurnDrvmd_sonic3dp3 = { - "md_sonic3dp3", "md_sonic3d", NULL, NULL, "1996", - "Sonic 3D Blast (Prototype 831, 19960903, 10.07)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3dp3RomInfo, md_sonic3dp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3D Blast (Prototype 94, 19960904, 12.01) -static struct BurnRomInfo md_sonic3dp2RomDesc[] = { - { "sonic 3d blast (prototype 94 - sep 04, 1996, 12.01).bin", 0x400000, 0x2f2a4271, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3dp2) -STD_ROM_FN(md_sonic3dp2) - -struct BurnDriver BurnDrvmd_sonic3dp2 = { - "md_sonic3dp2", "md_sonic3d", NULL, NULL, "1996", - "Sonic 3D Blast (Prototype 94, 19960904, 12.01)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3dp2RomInfo, md_sonic3dp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic 3D Blast (USA, Prototype) -static struct BurnRomInfo md_sonic3dp1RomDesc[] = { - { "sonic 3d blast (usa) (beta).bin", 0x400000, 0xd20f385b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3dp1) -STD_ROM_FN(md_sonic3dp1) - -struct BurnDriver BurnDrvmd_sonic3dp1 = { - "md_sonic3dp1", "md_sonic3d", NULL, NULL, "1996", - "Sonic 3D Blast (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3dp1RomInfo, md_sonic3dp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Compilation (Euro) ~ Sonic Classics (USA, Kor) -static struct BurnRomInfo md_soniccmpRomDesc[] = { - { "mpr-19693.bin", 0x400000, 0xc696aee3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_soniccmp) -STD_ROM_FN(md_soniccmp) - -struct BurnDriver BurnDrvmd_soniccmp = { - "md_soniccmp", NULL, NULL, NULL, "1995", - "Sonic Compilation (Euro) ~ Sonic Classics (USA, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_soniccmpRomInfo, md_soniccmpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Crackers (Jpn, Prototype) -static struct BurnRomInfo md_scrackRomDesc[] = { - { "sonic crackers (jpn) (prototype).bin", 0x100000, 0x7fada88d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_scrack) -STD_ROM_FN(md_scrack) - -struct BurnDriver BurnDrvmd_scrack = { - "md_scrack", NULL, NULL, NULL, "199?", - "Sonic Crackers (Jpn, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_scrackRomInfo, md_scrackRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Eraser (Jpn, SegaNet) -static struct BurnRomInfo md_sonicerRomDesc[] = { - { "sonic eraser (jpn) (sn).bin", 0x040000, 0x62d8a0e7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonicer) -STD_ROM_FN(md_sonicer) - -struct BurnDriver BurnDrvmd_sonicer = { - "md_sonicer", NULL, NULL, NULL, "1991", - "Sonic Eraser (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonicerRomInfo, md_sonicerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Jam 6 -static struct BurnRomInfo md_sonicjamRomDesc[] = { - { "sonic jam 6 (unl).bin", 0x200000, 0xbf39d897, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonicjam) -STD_ROM_FN(md_sonicjam) - -struct BurnDriver BurnDrvmd_sonicjam = { - "md_sonicjam", NULL, NULL, NULL, "199?", - "Sonic Jam 6\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonicjamRomInfo, md_sonicjamRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Jam 6 (Alt) -static struct BurnRomInfo md_sonicjam1RomDesc[] = { - { "sonic jam 6 (unl) (pirate).bin", 0x200000, 0x04f0c93e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonicjam1) -STD_ROM_FN(md_sonicjam1) - -struct BurnDriver BurnDrvmd_sonicjam1 = { - "md_sonicjam1", "md_sonicjam", NULL, NULL, "199?", - "Sonic Jam 6 (Alt)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonicjam1RomInfo, md_sonicjam1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Spinball (Prototype) -static struct BurnRomInfo md_sspinpRomDesc[] = { - { "sonic spinball (beta).bin", 0x140000, 0xb1524979, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sspinp) -STD_ROM_FN(md_sspinp) - -struct BurnDriver BurnDrvmd_sspinp = { - "md_sspinp", "md_sspin", NULL, NULL, "1993", - "Sonic Spinball (Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sspinpRomInfo, md_sspinpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Spinball (Jpn) -static struct BurnRomInfo md_sspinjRomDesc[] = { - { "sonic spinball (jpn).bin", 0x100000, 0xacd08ce8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sspinj) -STD_ROM_FN(md_sspinj) - -struct BurnDriver BurnDrvmd_sspinj = { - "md_sspinj", "md_sspin", NULL, NULL, "1993", - "Sonic Spinball (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sspinjRomInfo, md_sspinjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Spinball (USA) -static struct BurnRomInfo md_sspinuRomDesc[] = { - { "sonic spinball (usa).bin", 0x100000, 0x677206cb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sspinu) -STD_ROM_FN(md_sspinu) - -struct BurnDriver BurnDrvmd_sspinu = { - "md_sspinu", "md_sspin", NULL, NULL, "1993", - "Sonic Spinball (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sspinuRomInfo, md_sspinuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Spinball (USA, Alt) -static struct BurnRomInfo md_sspinuaRomDesc[] = { - { "sonic spinball (usa) (alt).bin", 0x100000, 0xe9960371, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sspinua) -STD_ROM_FN(md_sspinua) - -struct BurnDriver BurnDrvmd_sspinua = { - "md_sspinua", "md_sspin", NULL, NULL, "1993", - "Sonic Spinball (USA, Alt)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sspinuaRomInfo, md_sspinuaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog (Jpn, Kor) -static struct BurnRomInfo md_sonicjRomDesc[] = { - { "mpr-13933.bin", 0x080000, 0xafe05eee, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonicj) -STD_ROM_FN(md_sonicj) - -struct BurnDriver BurnDrvmd_sonicj = { - "md_sonicj", "md_sonic", NULL, NULL, "1991", - "Sonic the Hedgehog (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonicjRomInfo, md_sonicjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog (Pirate, Ripped from Golden 10 in 1) -static struct BurnRomInfo md_sonicpirRomDesc[] = { - { "sonic the hedgehog (euro, usa) (pirate).bin", 0x080000, 0x7a093f0b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonicpir) -STD_ROM_FN(md_sonicpir) - -struct BurnDriver BurnDrvmd_sonicpir = { - "md_sonicpir", "md_sonic", NULL, NULL, "1991?", - "Sonic the Hedgehog (Pirate, Ripped from Golden 10 in 1)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonicpirRomInfo, md_sonicpirRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (World, Rev. A) -static struct BurnRomInfo md_sonic2RomDesc[] = { - { "mpr-15000a.bin", 0x100000, 0x7b905383, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2) -STD_ROM_FN(md_sonic2) - -struct BurnDriver BurnDrvmd_sonic2 = { - "md_sonic2", NULL, NULL, NULL, "1992", - "Sonic the Hedgehog 2 (World, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2RomInfo, md_sonic2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (World) -static struct BurnRomInfo md_sonic2aRomDesc[] = { - { "sonic the hedgehog 2 (world).bin", 0x100000, 0x24ab4c3a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2a) -STD_ROM_FN(md_sonic2a) - -struct BurnDriver BurnDrvmd_sonic2a = { - "md_sonic2a", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2aRomInfo, md_sonic2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (Beta 4, 19920918, 16.26) -static struct BurnRomInfo md_sonic2p8RomDesc[] = { - { "sonic the hedgehog 2 (beta 4 - sep 18, 1992, 16.26).bin", 0x100000, 0x8fda5cc5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2p8) -STD_ROM_FN(md_sonic2p8) - -struct BurnDriver BurnDrvmd_sonic2p8 = { - "md_sonic2p8", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (Beta 4, 19920918, 16.26)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2p8RomInfo, md_sonic2p8RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (Beta 5, 19920921, 12.06) -static struct BurnRomInfo md_sonic2p7RomDesc[] = { - { "sonic the hedgehog 2 (beta 5 - sep 21, 1992, 12.06).bin", 0x100000, 0x066b9a89, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2p7) -STD_ROM_FN(md_sonic2p7) - -struct BurnDriver BurnDrvmd_sonic2p7 = { - "md_sonic2p7", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (Beta 5, 19920921, 12.06)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2p7RomInfo, md_sonic2p7RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (Beta 6, 19920922, 18.47) -static struct BurnRomInfo md_sonic2p6RomDesc[] = { - { "sonic the hedgehog 2 (beta 6 - sep 22, 1992, 18.47).bin", 0x100000, 0xcebc64e0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2p6) -STD_ROM_FN(md_sonic2p6) - -struct BurnDriver BurnDrvmd_sonic2p6 = { - "md_sonic2p6", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (Beta 6, 19920922, 18.47)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2p6RomInfo, md_sonic2p6RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (Beta 6, 19920922, 19.42) -static struct BurnRomInfo md_sonic2p5RomDesc[] = { - { "sonic the hedgehog 2 (beta 6 - sep 22, 1992, 19.42).bin", 0x100000, 0xcb036e6c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2p5) -STD_ROM_FN(md_sonic2p5) - -struct BurnDriver BurnDrvmd_sonic2p5 = { - "md_sonic2p5", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (Beta 6, 19920922, 19.42)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2p5RomInfo, md_sonic2p5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (Beta 7, 19920924, 09.26) -static struct BurnRomInfo md_sonic2p4RomDesc[] = { - { "sonic the hedgehog 2 (beta 7 - sep 24, 1992, 09.26).bin", 0x100000, 0xdc7be12c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2p4) -STD_ROM_FN(md_sonic2p4) - -struct BurnDriver BurnDrvmd_sonic2p4 = { - "md_sonic2p4", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (Beta 7, 19920924, 09.26)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2p4RomInfo, md_sonic2p4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (Beta 8, 19920924, 19.27) -static struct BurnRomInfo md_sonic2p3RomDesc[] = { - { "sonic the hedgehog 2 (beta 8 - sep 24, 1992, 19.27).bin", 0x100000, 0x6089fadd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2p3) -STD_ROM_FN(md_sonic2p3) - -struct BurnDriver BurnDrvmd_sonic2p3 = { - "md_sonic2p3", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (Beta 8, 19920924, 19.27)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2p3RomInfo, md_sonic2p3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (Prototype) -static struct BurnRomInfo md_sonic2p2RomDesc[] = { - { "sonic the hedgehog 2 (prototype).bin", 0x100000, 0xeea21b5c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2p2) -STD_ROM_FN(md_sonic2p2) - -struct BurnDriver BurnDrvmd_sonic2p2 = { - "md_sonic2p2", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2p2RomInfo, md_sonic2p2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (World, Rev. 01a) -static struct BurnRomInfo md_sonic2bRomDesc[] = { - { "sonic the hedgehog 2 (world) (rev 01a).bin", 0x100000, 0x92d8817d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2b) -STD_ROM_FN(md_sonic2b) - -struct BurnDriver BurnDrvmd_sonic2b = { - "md_sonic2b", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (World, Rev. 01a)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2bRomInfo, md_sonic2bRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (World, Rev. SC02) -static struct BurnRomInfo md_sonic2cRomDesc[] = { - { "sonic the hedgehog 2 (world) (rev sc02).bin", 0x100000, 0xf23ad4b3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2c) -STD_ROM_FN(md_sonic2c) - -struct BurnDriver BurnDrvmd_sonic2c = { - "md_sonic2c", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (World, Rev. SC02)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2cRomInfo, md_sonic2cRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 2 (World, Prototype) -static struct BurnRomInfo md_sonic2p1RomDesc[] = { - { "sonic the hedgehog 2 (world) (beta).bin", 0x100000, 0x39faaa70, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic2p1) -STD_ROM_FN(md_sonic2p1) - -struct BurnDriver BurnDrvmd_sonic2p1 = { - "md_sonic2p1", "md_sonic2", NULL, NULL, "1992", - "Sonic the Hedgehog 2 (World, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonic2p1RomInfo, md_sonic2p1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 3 (Pirate) -static struct BurnRomInfo md_sonic3pirRomDesc[] = { - { "sonic the hedgehog 3 (pirate).bin", 0x200000, 0xc818f6fd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3pir) -STD_ROM_FN(md_sonic3pir) - -struct BurnDriver BurnDrvmd_sonic3pir = { - "md_sonic3pir", "md_sonic3", NULL, NULL, "1994?", - "Sonic the Hedgehog 3 (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_FRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3pirRomInfo, md_sonic3pirRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic the Hedgehog 3 (USA) -static struct BurnRomInfo md_sonic3uRomDesc[] = { - { "sonic the hedgehog 3 (usa).bin", 0x200000, 0x9bc192ce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonic3u) -STD_ROM_FN(md_sonic3u) - -struct BurnDriver BurnDrvmd_sonic3u = { - "md_sonic3u", "md_sonic3", NULL, NULL, "1994", - "Sonic the Hedgehog 3 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_FRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sonic3uRomInfo, md_sonic3uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sorcerer's Kingdom (USA, v1.1) -static struct BurnRomInfo md_sorcerkRomDesc[] = { - { "sorcerer's kingdom (usa) (v1.1).bin", 0x100000, 0xbb1fc9ce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sorcerk) -STD_ROM_FN(md_sorcerk) - -struct BurnDriver BurnDrvmd_sorcerk = { - "md_sorcerk", NULL, NULL, NULL, "1992", - "Sorcerer's Kingdom (USA, v1.1)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sorcerkRomInfo, md_sorcerkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sorcerer's Kingdom (USA) -static struct BurnRomInfo md_sorcerk1RomDesc[] = { - { "sorcerer's kingdom (usa).bin", 0x100000, 0xcbe6c1ea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sorcerk1) -STD_ROM_FN(md_sorcerk1) - -struct BurnDriver BurnDrvmd_sorcerk1 = { - "md_sorcerk1", "md_sorcerk", NULL, NULL, "1992", - "Sorcerer's Kingdom (USA)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sorcerk1RomInfo, md_sorcerk1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sorcer Kingdom (Jpn) -static struct BurnRomInfo md_sorcerkjRomDesc[] = { - { "sorcer kingdom (jpn).bin", 0x100000, 0x944135ca, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sorcerkj) -STD_ROM_FN(md_sorcerkj) - -struct BurnDriver BurnDrvmd_sorcerkj = { - "md_sorcerkj", "md_sorcerk", NULL, NULL, "1992", - "Sorcer Kingdom (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sorcerkjRomInfo, md_sorcerkjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sorcerian (Jpn) -static struct BurnRomInfo md_sorcerRomDesc[] = { - { "mpr-12906.bin", 0x080000, 0xa143a8c5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sorcer) -STD_ROM_FN(md_sorcer) - -struct BurnDriver BurnDrvmd_sorcer = { - "md_sorcer", NULL, NULL, NULL, "1990", - "Sorcerian (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sorcerRomInfo, md_sorcerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Space Harrier II (Jpn, Launch Cart) -static struct BurnRomInfo md_sharrierjRomDesc[] = { - { "mpr-11934.bin", 0x080000, 0xedc0fb28, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sharrierj) -STD_ROM_FN(md_sharrierj) - -struct BurnDriver BurnDrvmd_sharrierj = { - "md_sharrierj", "md_sharrier", NULL, NULL, "1988", - "Space Harrier II (Jpn, Launch Cart)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sharrierjRomInfo, md_sharrierjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Space Invaders 91 (USA) -static struct BurnRomInfo md_sinv91RomDesc[] = { - { "space invaders 91 (usa).bin", 0x040000, 0xbb83b528, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sinv91) -STD_ROM_FN(md_sinv91) - -struct BurnDriver BurnDrvmd_sinv91 = { - "md_sinv91", NULL, NULL, NULL, "1991", - "Space Invaders 91 (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sinv91RomInfo, md_sinv91RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Space Invaders 90 (Jpn) -static struct BurnRomInfo md_sinv90RomDesc[] = { - { "space invaders 90 (jpn).bin", 0x040000, 0x22adbd66, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sinv90) -STD_ROM_FN(md_sinv90) - -struct BurnDriver BurnDrvmd_sinv90 = { - "md_sinv90", "md_sinv91", NULL, NULL, "1990", - "Space Invaders 90 (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sinv90RomInfo, md_sinv90RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sparkster (Euro) -static struct BurnRomInfo md_sparkstrRomDesc[] = { - { "sparkster (euro).bin", 0x100000, 0xd63e9f2d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sparkstr) -STD_ROM_FN(md_sparkstr) - -struct BurnDriver BurnDrvmd_sparkstr = { - "md_sparkstr", NULL, NULL, NULL, "1994", - "Sparkster (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sparkstrRomInfo, md_sparkstrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sparkster (USA) -static struct BurnRomInfo md_sparkstruRomDesc[] = { - { "sparkster (usa).bin", 0x100000, 0x6bdb14ed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sparkstru) -STD_ROM_FN(md_sparkstru) - -struct BurnDriver BurnDrvmd_sparkstru = { - "md_sparkstru", "md_sparkstr", NULL, NULL, "1994", - "Sparkster (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sparkstruRomInfo, md_sparkstruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sparkster (Jpn) -static struct BurnRomInfo md_sparkstrjRomDesc[] = { - { "sparkster - rocket knight adventures 2 (jpn).bin", 0x100000, 0x914ec662, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sparkstrj) -STD_ROM_FN(md_sparkstrj) - -struct BurnDriver BurnDrvmd_sparkstrj = { - "md_sparkstrj", "md_sparkstr", NULL, NULL, "1994", - "Sparkster (Jpn)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sparkstrjRomInfo, md_sparkstrjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Speedball 2 (Euro) -static struct BurnRomInfo md_speedbl2RomDesc[] = { - { "mpr-14990.bin", 0x080000, 0x056a6e03, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_speedbl2) -STD_ROM_FN(md_speedbl2) - -struct BurnDriver BurnDrvmd_speedbl2 = { - "md_speedbl2", NULL, NULL, NULL, "1992", - "Speedball 2 (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_speedbl2RomInfo, md_speedbl2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Speedball 2 (Jpn) -static struct BurnRomInfo md_speedbl2jRomDesc[] = { - { "speedball 2 (jpn).bin", 0x080000, 0xf5442334, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_speedbl2j) -STD_ROM_FN(md_speedbl2j) - -struct BurnDriver BurnDrvmd_speedbl2j = { - "md_speedbl2j", "md_speedbl2", NULL, NULL, "1992", - "Speedball 2 (Jpn)\0", NULL, "CRI", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_speedbl2jRomInfo, md_speedbl2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Speedball 2 - Brutal Deluxe (USA) -static struct BurnRomInfo md_speedbl2uRomDesc[] = { - { "speedball 2 - brutal deluxe (usa).bin", 0x080000, 0x9fc340a7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_speedbl2u) -STD_ROM_FN(md_speedbl2u) - -struct BurnDriver BurnDrvmd_speedbl2u = { - "md_speedbl2u", "md_speedbl2", NULL, NULL, "1991", - "Speedball 2 - Brutal Deluxe (USA)\0", NULL, "Arena", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_speedbl2uRomInfo, md_speedbl2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spider-Man (Euro, USA) -static struct BurnRomInfo md_spidermnRomDesc[] = { - { "spider-man (euro, usa) (acclaim).bin", 0x200000, 0x11b5b590, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spidermn) -STD_ROM_FN(md_spidermn) - -struct BurnDriver BurnDrvmd_spidermn = { - "md_spidermn", NULL, NULL, NULL, "1995", - "Spider-Man (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spidermnRomInfo, md_spidermnRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spider-Man (USA, Prototype) -static struct BurnRomInfo md_spidermnp1RomDesc[] = { - { "spider-man (usa) (acclaim) (beta).bin", 0x200000, 0xb88a710d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spidermnp1) -STD_ROM_FN(md_spidermnp1) - -struct BurnDriver BurnDrvmd_spidermnp1 = { - "md_spidermnp1", "md_spidermn", NULL, NULL, "1995", - "Spider-Man (USA, Prototype)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spidermnp1RomInfo, md_spidermnp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spider-Man (USA, Prototype, Earlier) -static struct BurnRomInfo md_spidermnp2RomDesc[] = { - { "spider-man (usa) (acclaim) (beta) (earlier).bin", 0x200000, 0x83e1fe76, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spidermnp2) -STD_ROM_FN(md_spidermnp2) - -struct BurnDriver BurnDrvmd_spidermnp2 = { - "md_spidermnp2", "md_spidermn", NULL, NULL, "1995", - "Spider-Man (USA, Prototype, Earlier)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spidermnp2RomInfo, md_spidermnp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spider-Man vs. the Kingpin (World) -static struct BurnRomInfo md_spidkingRomDesc[] = { - { "mpr-14027.bin", 0x080000, 0x70ab775f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spidking) -STD_ROM_FN(md_spidking) - -struct BurnDriver BurnDrvmd_spidking = { - "md_spidking", NULL, NULL, NULL, "1991", - "Spider-Man vs. the Kingpin (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spidkingRomInfo, md_spidkingRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spider-Man & Venom - Maximum Carnage (World) -static struct BurnRomInfo md_spidmaxcRomDesc[] = { - { "spider-man and venom - maximum carnage (world).bin", 0x200000, 0x8fa0b6e6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spidmaxc) -STD_ROM_FN(md_spidmaxc) - -struct BurnDriver BurnDrvmd_spidmaxc = { - "md_spidmaxc", NULL, NULL, NULL, "1994", - "Spider-Man & Venom - Maximum Carnage (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spidmaxcRomInfo, md_spidmaxcRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Venom & Spider-Man - Separation Anxiety (Euro, USA) -static struct BurnRomInfo md_venomRomDesc[] = { - { "spider-man and venom - separation anxiety (euro, usa).bin", 0x300000, 0x512ade32, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_venom) -STD_ROM_FN(md_venom) - -struct BurnDriver BurnDrvmd_venom = { - "md_venom", NULL, NULL, NULL, "1995", - "Venom & Spider-Man - Separation Anxiety (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_venomRomInfo, md_venomRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spiritual Warfare (USA) -static struct BurnRomInfo md_spiritwfRomDesc[] = { - { "spiritual warfare (usa) (unl).bin", 0x080000, 0xd9a364ff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spiritwf) -STD_ROM_FN(md_spiritwf) - -struct BurnDriver BurnDrvmd_spiritwf = { - "md_spiritwf", NULL, NULL, NULL, "1994", - "Spiritual Warfare (USA)\0", NULL, "Wisdom Tree", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spiritwfRomInfo, md_spiritwfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spirou (Euro) -static struct BurnRomInfo md_spirouRomDesc[] = { - { "spirou (euro).bin", 0x100000, 0x6634b130, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spirou) -STD_ROM_FN(md_spirou) - -struct BurnDriver BurnDrvmd_spirou = { - "md_spirou", NULL, NULL, NULL, "1996", - "Spirou (Euro)\0", NULL, "Infogrames", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spirouRomInfo, md_spirouRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Splatterhouse 2 (Euro) -static struct BurnRomInfo md_splatth2RomDesc[] = { - { "splatterhouse 2 (euro).bin", 0x100000, 0x2559e03c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_splatth2) -STD_ROM_FN(md_splatth2) - -struct BurnDriver BurnDrvmd_splatth2 = { - "md_splatth2", NULL, NULL, NULL, "1992", - "Splatterhouse 2 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_splatth2RomInfo, md_splatth2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Splatterhouse 2 (USA) -static struct BurnRomInfo md_splatth2uRomDesc[] = { - { "splatterhouse 2 (usa).bin", 0x100000, 0x2d1766e9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_splatth2u) -STD_ROM_FN(md_splatth2u) - -struct BurnDriver BurnDrvmd_splatth2u = { - "md_splatth2u", "md_splatth2", NULL, NULL, "1992", - "Splatterhouse 2 (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_splatth2uRomInfo, md_splatth2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Splatterhouse 3 (USA) -static struct BurnRomInfo md_splatth3RomDesc[] = { - { "splatterhouse 3 (usa).bin", 0x200000, 0x00f05d07, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_splatth3) -STD_ROM_FN(md_splatth3) - -struct BurnDriver BurnDrvmd_splatth3 = { - "md_splatth3", NULL, NULL, NULL, "1993", - "Splatterhouse 3 (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_splatth3RomInfo, md_splatth3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Splatterhouse Part 3 (Jpn, Kor) -static struct BurnRomInfo md_splatth3jRomDesc[] = { - { "splatterhouse part 3 (jpn, kor).bin", 0x200000, 0x31b83d22, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_splatth3j) -STD_ROM_FN(md_splatth3j) - -struct BurnDriver BurnDrvmd_splatth3j = { - "md_splatth3j", "md_splatth3", NULL, NULL, "1993", - "Splatterhouse Part 3 (Jpn, Kor)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_splatth3jRomInfo, md_splatth3jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sport Games (Bra) -static struct BurnRomInfo md_sportgRomDesc[] = { - { "mpr-19945-mx.ic1", 0x400000, 0x25da0747, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sportg) -STD_ROM_FN(md_sportg) - -struct BurnDriver BurnDrvmd_sportg = { - "md_sportg", NULL, NULL, NULL, "199?", - "Sport Games (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sportgRomInfo, md_sportgRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sports Talk Baseball (USA) -static struct BurnRomInfo md_sporttbbRomDesc[] = { - { "sports talk baseball (usa).bin", 0x100000, 0x0deb79c2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sporttbb) -STD_ROM_FN(md_sporttbb) - -struct BurnDriver BurnDrvmd_sporttbb = { - "md_sporttbb", NULL, NULL, NULL, "1992", - "Sports Talk Baseball (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_sporttbbRomInfo, md_sporttbbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spot Goes to Hollywood (Euro) -static struct BurnRomInfo md_spotgoRomDesc[] = { - { "mpr-18680+mpr-18681.bin", 0x300000, 0xfbe254ea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spotgo) -STD_ROM_FN(md_spotgo) - -struct BurnDriver BurnDrvmd_spotgo = { - "md_spotgo", NULL, NULL, NULL, "1996", - "Spot Goes to Hollywood (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spotgoRomInfo, md_spotgoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spot Goes to Hollywood (USA) -static struct BurnRomInfo md_spotgouRomDesc[] = { - { "spot goes to hollywood (usa).bin", 0x300000, 0xbdad1cbc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spotgou) -STD_ROM_FN(md_spotgou) - -struct BurnDriver BurnDrvmd_spotgou = { - "md_spotgou", "md_spotgo", NULL, NULL, "1995", - "Spot Goes to Hollywood (USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spotgouRomInfo, md_spotgouRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Control (USA) -static struct BurnRomInfo md_starctrlRomDesc[] = { - { "star control (usa).bin", 0x180000, 0x8e2bceaf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_starctrl) -STD_ROM_FN(md_starctrl) - -struct BurnDriver BurnDrvmd_starctrl = { - "md_starctrl", NULL, NULL, NULL, "1991", - "Star Control (USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_starctrlRomInfo, md_starctrlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Cruiser (Jpn) -static struct BurnRomInfo md_starcrusRomDesc[] = { - { "star cruiser (jpn).bin", 0x080000, 0x2b75b52f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_starcrus) -STD_ROM_FN(md_starcrus) - -struct BurnDriver BurnDrvmd_starcrus = { - "md_starcrus", NULL, NULL, NULL, "1990", - "Star Cruiser (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_starcrusRomInfo, md_starcrusRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - Deep Space Nine - Crossroads of Time (Euro) -static struct BurnRomInfo md_stds9RomDesc[] = { - { "star trek - deep space nine - crossroads of time (euro).bin", 0x100000, 0xd4b122f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_stds9) -STD_ROM_FN(md_stds9) - -struct BurnDriver BurnDrvmd_stds9 = { - "md_stds9", NULL, NULL, NULL, "1995", - "Star Trek - Deep Space Nine - Crossroads of Time (Euro)\0", NULL, "Virgin Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_stds9RomInfo, md_stds9RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - Deep Space Nine - Crossroads of Time (USA) -static struct BurnRomInfo md_stds9uRomDesc[] = { - { "star trek - deep space nine - crossroads of time (usa).bin", 0x100000, 0xa771e1a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_stds9u) -STD_ROM_FN(md_stds9u) - -struct BurnDriver BurnDrvmd_stds9u = { - "md_stds9u", "md_stds9", NULL, NULL, "1995", - "Star Trek - Deep Space Nine - Crossroads of Time (USA)\0", NULL, "Playmates Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_stds9uRomInfo, md_stds9uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - The Next Generation - Echoes from the Past (USA, v1.1) -static struct BurnRomInfo md_sttngRomDesc[] = { - { "star trek - the next generation - echoes from the past (usa) (v1.1).bin", 0x200000, 0xef840ef2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sttng) -STD_ROM_FN(md_sttng) - -struct BurnDriver BurnDrvmd_sttng = { - "md_sttng", NULL, NULL, NULL, "1994", - "Star Trek - The Next Generation - Echoes from the Past (USA, v1.1)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sttngRomInfo, md_sttngRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - The Next Generation - Echoes from the Past (USA) -static struct BurnRomInfo md_sttngaRomDesc[] = { - { "star trek - the next generation - echoes from the past (usa).bin", 0x200000, 0x272153fb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sttnga) -STD_ROM_FN(md_sttnga) - -struct BurnDriver BurnDrvmd_sttnga = { - "md_sttnga", "md_sttng", NULL, NULL, "1994", - "Star Trek - The Next Generation - Echoes from the Past (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sttngaRomInfo, md_sttngaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - The Next Generation - Echoes from the Past (Prototype, 19941228) -static struct BurnRomInfo md_sttngp06RomDesc[] = { - { "star trek - the next generation - echoes from the past (prototype - dec 28, 1994).bin", 0x200000, 0x3ba670f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sttngp06) -STD_ROM_FN(md_sttngp06) - -struct BurnDriver BurnDrvmd_sttngp06 = { - "md_sttngp06", "md_sttng", NULL, NULL, "1994", - "Star Trek - The Next Generation - Echoes from the Past (Prototype, 19941228)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sttngp06RomInfo, md_sttngp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - The Next Generation - Echoes from the Past (Prototype, 19941229) -static struct BurnRomInfo md_sttngp05RomDesc[] = { - { "star trek - the next generation - echoes from the past (prototype - dec 29, 1994).bin", 0x200000, 0x316bbc43, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sttngp05) -STD_ROM_FN(md_sttngp05) - -struct BurnDriver BurnDrvmd_sttngp05 = { - "md_sttngp05", "md_sttng", NULL, NULL, "1994", - "Star Trek - The Next Generation - Echoes from the Past (Prototype, 19941229)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sttngp05RomInfo, md_sttngp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - The Next Generation - Echoes from the Past (Prototype, 19940103) -static struct BurnRomInfo md_sttngp04RomDesc[] = { - { "star trek - the next generation - echoes from the past (prototype - jan 03, 1994).bin", 0x200000, 0xcac86b68, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sttngp04) -STD_ROM_FN(md_sttngp04) - -struct BurnDriver BurnDrvmd_sttngp04 = { - "md_sttngp04", "md_sttng", NULL, NULL, "1994", - "Star Trek - The Next Generation - Echoes from the Past (Prototype, 19940103)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sttngp04RomInfo, md_sttngp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - The Next Generation - Echoes from the Past (Prototype, 19940110) -static struct BurnRomInfo md_sttngp03RomDesc[] = { - { "star trek - the next generation - echoes from the past (prototype - jan 10, 1994).bin", 0x200000, 0xd138ca3e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sttngp03) -STD_ROM_FN(md_sttngp03) - -struct BurnDriver BurnDrvmd_sttngp03 = { - "md_sttngp03", "md_sttng", NULL, NULL, "1994", - "Star Trek - The Next Generation - Echoes from the Past (Prototype, 19940110)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sttngp03RomInfo, md_sttngp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - The Next Generation - Echoes from the Past (Prototype, 19940118) -static struct BurnRomInfo md_sttngp02RomDesc[] = { - { "star trek - the next generation - echoes from the past (prototype - jan 18, 1994).bin", 0x200000, 0xd8dab97a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sttngp02) -STD_ROM_FN(md_sttngp02) - -struct BurnDriver BurnDrvmd_sttngp02 = { - "md_sttngp02", "md_sttng", NULL, NULL, "1994", - "Star Trek - The Next Generation - Echoes from the Past (Prototype, 19940118)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sttngp02RomInfo, md_sttngp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Trek - The Next Generation - Echoes from the Past (Prototype, 19940125) -static struct BurnRomInfo md_sttngp01RomDesc[] = { - { "star trek - the next generation - echoes from the past (prototype - jan 25, 1994).bin", 0x200000, 0x63f29e6f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sttngp01) -STD_ROM_FN(md_sttngp01) - -struct BurnDriver BurnDrvmd_sttngp01 = { - "md_sttngp01", "md_sttng", NULL, NULL, "1994", - "Star Trek - The Next Generation - Echoes from the Past (Prototype, 19940125)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_sttngp01RomInfo, md_sttngp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Starflight (Euro, USA, v1.1) -static struct BurnRomInfo md_starflRomDesc[] = { - { "starflight (euro, usa) (v1.1).bin", 0x100000, 0x1217dbea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_starfl) -STD_ROM_FN(md_starfl) - -struct BurnDriver BurnDrvmd_starfl = { - "md_starfl", NULL, NULL, NULL, "1991", - "Starflight (Euro, USA, v1.1)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_starflRomInfo, md_starflRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Starflight (Euro, USA) -static struct BurnRomInfo md_starfl1RomDesc[] = { - { "starflight (euro, usa).bin", 0x100000, 0xd550c928, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_starfl1) -STD_ROM_FN(md_starfl1) - -struct BurnDriver BurnDrvmd_starfl1 = { - "md_starfl1", "md_starfl", NULL, NULL, "1991", - "Starflight (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_starfl1RomInfo, md_starfl1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Stargate (Euro, USA) -static struct BurnRomInfo md_stargateRomDesc[] = { - { "stargate (euro, usa).bin", 0x200000, 0xe587069e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_stargate) -STD_ROM_FN(md_stargate) - -struct BurnDriver BurnDrvmd_stargate = { - "md_stargate", NULL, NULL, NULL, "1994", - "Stargate (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_stargateRomInfo, md_stargateRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Stargate (Euro, Prototype) -static struct BurnRomInfo md_stargatepRomDesc[] = { - { "stargate (euro) (beta).bin", 0x200000, 0x8dc8ab23, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_stargatep) -STD_ROM_FN(md_stargatep) - -struct BurnDriver BurnDrvmd_stargatep = { - "md_stargatep", "md_stargate", NULL, NULL, "1994", - "Stargate (Euro, Prototype)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_stargatepRomInfo, md_stargatepRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Steel Talons (Euro, USA) -static struct BurnRomInfo md_steeltalRomDesc[] = { - { "steel talons (euro, usa).bin", 0x080000, 0x10e4ec63, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_steeltal) -STD_ROM_FN(md_steeltal) - -struct BurnDriver BurnDrvmd_steeltal = { - "md_steeltal", NULL, NULL, NULL, "1992", - "Steel Talons (Euro, USA)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_steeltalRomInfo, md_steeltalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Steel Talons (Jpn, Kor) -static struct BurnRomInfo md_steeltaljRomDesc[] = { - { "steel talons (jpn, kor).bin", 0x080000, 0x04f388e6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_steeltalj) -STD_ROM_FN(md_steeltalj) - -struct BurnDriver BurnDrvmd_steeltalj = { - "md_steeltalj", "md_steeltal", NULL, NULL, "1993", - "Steel Talons (Jpn, Kor)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_steeltaljRomInfo, md_steeltaljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Steel Talons (USA, Prototype) -static struct BurnRomInfo md_steeltalpRomDesc[] = { - { "steel talons (usa) (beta).bin", 0x080000, 0xc4052f18, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_steeltalp) -STD_ROM_FN(md_steeltalp) - -struct BurnDriver BurnDrvmd_steeltalp = { - "md_steeltalp", "md_steeltal", NULL, NULL, "1992", - "Steel Talons (USA, Prototype)\0", NULL, "Tengen", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_steeltalpRomInfo, md_steeltalpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Stone Protectors (USA, Prototype) -static struct BurnRomInfo md_stonprotRomDesc[] = { - { "stone protectors.bin", 0x200000, 0xfbf0d54f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_stonprot) -STD_ROM_FN(md_stonprot) - -struct BurnDriver BurnDrvmd_stonprot = { - "md_stonprot", NULL, NULL, NULL, "1994", - "Stone Protectors (USA, Prototype)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_stonprotRomInfo, md_stonprotRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Stormlord (USA) -static struct BurnRomInfo md_strmlordRomDesc[] = { - { "stormlord (usa).bin", 0x080000, 0x39ab50a5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_strmlord) -STD_ROM_FN(md_strmlord) - -struct BurnDriver BurnDrvmd_strmlord = { - "md_strmlord", NULL, NULL, NULL, "1990", - "Stormlord (USA)\0", NULL, "RazorSoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_strmlordRomInfo, md_strmlordRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Stormlord (Jpn) -static struct BurnRomInfo md_strmlordjRomDesc[] = { - { "stormlord (jpn).bin", 0x080000, 0x0b440fed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_strmlordj) -STD_ROM_FN(md_strmlordj) - -struct BurnDriver BurnDrvmd_strmlordj = { - "md_strmlordj", "md_strmlord", NULL, NULL, "1990", - "Stormlord (Jpn)\0", NULL, "Micro World", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_strmlordjRomInfo, md_strmlordjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Story of Thor (Euro) -static struct BurnRomInfo md_thorRomDesc[] = { - { "mpr-17588+mpr-17606.bin", 0x300000, 0x1110b0db, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_thor) -STD_ROM_FN(md_thor) - -struct BurnDriver BurnDrvmd_thor = { - "md_thor", NULL, NULL, NULL, "1995", - "The Story of Thor (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_thorRomInfo, md_thorRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Story of Thor (Ger) -static struct BurnRomInfo md_thorgRomDesc[] = { - { "story of thor, the (germany).bin", 0x300000, 0xfa20d011, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_thorg) -STD_ROM_FN(md_thorg) - -struct BurnDriver BurnDrvmd_thorg = { - "md_thorg", "md_thor", NULL, NULL, "1995", - "The Story of Thor (Ger)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_thorgRomInfo, md_thorgRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Story of Thor - Hikari o Tsugumono (Jpn) -static struct BurnRomInfo md_thorjRomDesc[] = { - { "story of thor, the - hikari o tsugumono (jpn).bin", 0x300000, 0x4f39783c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_thorj) -STD_ROM_FN(md_thorj) - -struct BurnDriver BurnDrvmd_thorj = { - "md_thorj", "md_thor", NULL, NULL, "1995", - "The Story of Thor - Hikari o Tsugumono (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_thorjRomInfo, md_thorjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Story of Thor (Jpn, Prototype) -static struct BurnRomInfo md_thorjpRomDesc[] = { - { "story of thor, the (jpn) (beta) (bad dump).bin", 0x1b0000, 0xbfc11649, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_thorjp) -STD_ROM_FN(md_thorjp) - -struct BurnDriver BurnDrvmd_thorjp = { - "md_thorjp", "md_thor", NULL, NULL, "1994", - "The Story of Thor (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_thorjpRomInfo, md_thorjpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Story of Thor (Kor) -static struct BurnRomInfo md_thorkRomDesc[] = { - { "story of thor, the (kor).bin", 0x300000, 0xee1603c5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_thork) -STD_ROM_FN(md_thork) - -struct BurnDriver BurnDrvmd_thork = { - "md_thork", "md_thor", NULL, NULL, "1995", - "The Story of Thor (Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_thorkRomInfo, md_thorkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Story of Thor (USA, Prototype, 19941004) -static struct BurnRomInfo md_thorp2RomDesc[] = { - { "story of thor, the (prototype - oct 04, 1994).bin", 0x300000, 0x9e486f91, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_thorp2) -STD_ROM_FN(md_thorp2) - -struct BurnDriver BurnDrvmd_thorp2 = { - "md_thorp2", "md_thor", NULL, NULL, "1994", - "The Story of Thor (USA, Prototype, 19941004)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_thorp2RomInfo, md_thorp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Story of Thor (USA, Prototype, 19941017) -static struct BurnRomInfo md_thorp1RomDesc[] = { - { "story of thor, the (prototype - oct 17, 1994).bin", 0x300000, 0xaa43d34a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_thorp1) -STD_ROM_FN(md_thorp1) - -struct BurnDriver BurnDrvmd_thorp1 = { - "md_thorp1", "md_thor", NULL, NULL, "1994", - "The Story of Thor (USA, Prototype, 19941017)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_thorp1RomInfo, md_thorp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Beyond Oasis (USA, Prototype, 19941101) -static struct BurnRomInfo md_beyoasispRomDesc[] = { - { "beyond oasis (prototype - nov 01, 1994).bin", 0x300000, 0xfa59f847, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beyoasisp) -STD_ROM_FN(md_beyoasisp) - -struct BurnDriver BurnDrvmd_beyoasisp = { - "md_beyoasisp", "md_thor", NULL, NULL, "1994", - "Beyond Oasis (USA, Prototype, 19941101)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_beyoasispRomInfo, md_beyoasispRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Story of Thor (Spa) -static struct BurnRomInfo md_thorsRomDesc[] = { - { "story of thor, the (spain).bin", 0x300000, 0x4631f941, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_thors) -STD_ROM_FN(md_thors) - -struct BurnDriver BurnDrvmd_thors = { - "md_thors", "md_thor", NULL, NULL, "1995", - "The Story of Thor (Spa)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_thorsRomInfo, md_thorsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Beyond Oasis (USA) -static struct BurnRomInfo md_beyoasisRomDesc[] = { - { "beyond oasis (usa).bin", 0x300000, 0xc4728225, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_beyoasis) -STD_ROM_FN(md_beyoasis) - -struct BurnDriver BurnDrvmd_beyoasis = { - "md_beyoasis", "md_thor", NULL, NULL, "1995", - "Beyond Oasis (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_beyoasisRomInfo, md_beyoasisRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Street Fighter II' - Special Champion Edition (Euro) -static struct BurnRomInfo md_sf2RomDesc[] = { - { "mpr-15910+mpr-15911.bin", 0x300000, 0x56d41136, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sf2) -STD_ROM_FN(md_sf2) - -struct BurnDriver BurnDrvmd_sf2 = { - "md_sf2", NULL, NULL, NULL, "1993", - "Street Fighter II' - Special Champion Edition (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sf2RomInfo, md_sf2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Street Fighter II' Plus (Jpn, Asia, Kor) -static struct BurnRomInfo md_sf2jRomDesc[] = { - { "street fighter ii' plus (jpn, asia, kor).bin", 0x300000, 0x2e487ee3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sf2j) -STD_ROM_FN(md_sf2j) - -struct BurnDriver BurnDrvmd_sf2j = { - "md_sf2j", "md_sf2", NULL, NULL, "1993", - "Street Fighter II' Plus (Jpn, Asia, Kor)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sf2jRomInfo, md_sf2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Street Fighter II' Turbo (Pirate) -static struct BurnRomInfo md_sf2pirRomDesc[] = { - { "street fighter ii' turbo (pirate).bin", 0x200000, 0xa85491ae, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sf2pir) -STD_ROM_FN(md_sf2pir) - -struct BurnDriver BurnDrvmd_sf2pir = { - "md_sf2pir", "md_sf2", NULL, NULL, "1993?", - "Street Fighter II' Turbo (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sf2pirRomInfo, md_sf2pirRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Street Fighter II' - Special Champion Edition (USA) -static struct BurnRomInfo md_sf2uRomDesc[] = { - { "street fighter ii' - special champion edition (usa).bin", 0x300000, 0x13fe08a1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sf2u) -STD_ROM_FN(md_sf2u) - -struct BurnDriver BurnDrvmd_sf2u = { - "md_sf2u", "md_sf2", NULL, NULL, "1993", - "Street Fighter II' - Special Champion Edition (USA)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sf2uRomInfo, md_sf2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Street Racer (Euro) -static struct BurnRomInfo md_sracerRomDesc[] = { - { "mpr-17987.bin", 0x100000, 0x1a58d5fe, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sracer) -STD_ROM_FN(md_sracer) - -struct BurnDriver BurnDrvmd_sracer = { - "md_sracer", NULL, NULL, NULL, "1995", - "Street Racer (Euro)\0", NULL, "Ubi Soft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sracerRomInfo, md_sracerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Street Smart (Jpn, USA) -static struct BurnRomInfo md_ssmartRomDesc[] = { - { "street smart (usa, jpn).bin", 0x080000, 0xb1dedfad, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ssmart) -STD_ROM_FN(md_ssmart) - -struct BurnDriver BurnDrvmd_ssmart = { - "md_ssmart", NULL, NULL, NULL, "1991", - "Street Smart (Jpn, USA)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ssmartRomInfo, md_ssmartRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage II (Euro) ~ Bare Knuckle II - Shitou e no Chingonka (Jpn) -static struct BurnRomInfo md_sor2RomDesc[] = { - { "mpr-15309.bin", 0x200000, 0x42e3efdc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor2) -STD_ROM_FN(md_sor2) - -struct BurnDriver BurnDrvmd_sor2 = { - "md_sor2", NULL, NULL, NULL, "1993", - "Streets of Rage II (Euro) ~ Bare Knuckle II - Shitou e no Chingonka (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor2RomInfo, md_sor2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 2 (USA) -static struct BurnRomInfo md_sor2uRomDesc[] = { - { "streets of rage 2 (usa).bin", 0x200000, 0xe01fa526, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor2u) -STD_ROM_FN(md_sor2u) - -struct BurnDriver BurnDrvmd_sor2u = { - "md_sor2u", "md_sor2", NULL, NULL, "1992", - "Streets of Rage 2 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor2uRomInfo, md_sor2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bare Knuckle II (Jpn, Prototype) -static struct BurnRomInfo md_bk2pRomDesc[] = { - { "bare knuckle ii (jpn) (beta).bin", 0x130000, 0x0cf2acbe, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bk2p) -STD_ROM_FN(md_bk2p) - -struct BurnDriver BurnDrvmd_bk2p = { - "md_bk2p", "md_sor2", NULL, NULL, "1992", - "Bare Knuckle II (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bk2pRomInfo, md_bk2pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Euro) -static struct BurnRomInfo md_sor3RomDesc[] = { - { "mpr-16834+mpr-16835.bin", 0x300000, 0x3b78135f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3) -STD_ROM_FN(md_sor3) - -struct BurnDriver BurnDrvmd_sor3 = { - "md_sor3", NULL, NULL, NULL, "1994", - "Streets of Rage 3 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3RomInfo, md_sor3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Kor) -static struct BurnRomInfo md_sor3kRomDesc[] = { - { "streets of rage 3 (kor).bin", 0x300000, 0x90ef991e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3k) -STD_ROM_FN(md_sor3k) - -struct BurnDriver BurnDrvmd_sor3k = { - "md_sor3k", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3kRomInfo, md_sor3kRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Euro, Prototype, 19940412) -static struct BurnRomInfo md_sor3p5RomDesc[] = { - { "streets of rage 3 (euro) (prototype - apr 12, 1994).bin", 0x300000, 0xa17ce5ab, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3p5) -STD_ROM_FN(md_sor3p5) - -struct BurnDriver BurnDrvmd_sor3p5 = { - "md_sor3p5", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Euro, Prototype, 19940412)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3p5RomInfo, md_sor3p5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Euro, Prototype, 19940413) -static struct BurnRomInfo md_sor3p4RomDesc[] = { - { "streets of rage 3 (euro) (prototype - apr 13, 1994).bin", 0x300000, 0x164e42ae, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3p4) -STD_ROM_FN(md_sor3p4) - -struct BurnDriver BurnDrvmd_sor3p4 = { - "md_sor3p4", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Euro, Prototype, 19940413)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3p4RomInfo, md_sor3p4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Euro, Prototype, 19940415) -static struct BurnRomInfo md_sor3p3RomDesc[] = { - { "streets of rage 3 (euro) (prototype - apr 15, 1994).bin", 0x300000, 0xc64f1e6b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3p3) -STD_ROM_FN(md_sor3p3) - -struct BurnDriver BurnDrvmd_sor3p3 = { - "md_sor3p3", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Euro, Prototype, 19940415)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3p3RomInfo, md_sor3p3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Euro, Prototype, 19940420) -static struct BurnRomInfo md_sor3p2RomDesc[] = { - { "streets of rage 3 (euro) (prototype - apr 20, 1994).bin", 0x300000, 0x6ae4bd8e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3p2) -STD_ROM_FN(md_sor3p2) - -struct BurnDriver BurnDrvmd_sor3p2 = { - "md_sor3p2", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Euro, Prototype, 19940420)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3p2RomInfo, md_sor3p2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Euro, Prototype, 19940425) -static struct BurnRomInfo md_sor3p1RomDesc[] = { - { "streets of rage 3 (euro) (prototype - apr 25, 1994).bin", 0x300000, 0x7033878a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3p1) -STD_ROM_FN(md_sor3p1) - -struct BurnDriver BurnDrvmd_sor3p1 = { - "md_sor3p1", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Euro, Prototype, 19940425)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3p1RomInfo, md_sor3p1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940401) -static struct BurnRomInfo md_sor3up06RomDesc[] = { - { "streets of rage 3 (prototype - apr 01, 1994).bin", 0x300000, 0x797e75b7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up06) -STD_ROM_FN(md_sor3up06) - -struct BurnDriver BurnDrvmd_sor3up06 = { - "md_sor3up06", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940401)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up06RomInfo, md_sor3up06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940404) -static struct BurnRomInfo md_sor3up05RomDesc[] = { - { "streets of rage 3 (prototype - apr 04, 1994).bin", 0x300000, 0x6b968f13, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up05) -STD_ROM_FN(md_sor3up05) - -struct BurnDriver BurnDrvmd_sor3up05 = { - "md_sor3up05", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940404)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up05RomInfo, md_sor3up05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940408) -static struct BurnRomInfo md_sor3up04RomDesc[] = { - { "streets of rage 3 (prototype - apr 08, 1994).bin", 0x300000, 0xd4ba76c2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up04) -STD_ROM_FN(md_sor3up04) - -struct BurnDriver BurnDrvmd_sor3up04 = { - "md_sor3up04", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940408)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up04RomInfo, md_sor3up04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940411) -static struct BurnRomInfo md_sor3up03RomDesc[] = { - { "streets of rage 3 (prototype - apr 11, 1994).bin", 0x300000, 0xfa5e5a82, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up03) -STD_ROM_FN(md_sor3up03) - -struct BurnDriver BurnDrvmd_sor3up03 = { - "md_sor3up03", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940411)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up03RomInfo, md_sor3up03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940412) -static struct BurnRomInfo md_sor3up02RomDesc[] = { - { "streets of rage 3 (prototype - apr 12, 1994).bin", 0x300000, 0x3f52cb72, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up02) -STD_ROM_FN(md_sor3up02) - -struct BurnDriver BurnDrvmd_sor3up02 = { - "md_sor3up02", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940412)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up02RomInfo, md_sor3up02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940413) -static struct BurnRomInfo md_sor3up01RomDesc[] = { - { "streets of rage 3 (prototype - apr 13, 1994).bin", 0x300000, 0x6b675807, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up01) -STD_ROM_FN(md_sor3up01) - -struct BurnDriver BurnDrvmd_sor3up01 = { - "md_sor3up01", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940413)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up01RomInfo, md_sor3up01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940308) -static struct BurnRomInfo md_sor3up10RomDesc[] = { - { "streets of rage 3 (prototype - mar 08, 1994).bin", 0x300000, 0xea50b551, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up10) -STD_ROM_FN(md_sor3up10) - -struct BurnDriver BurnDrvmd_sor3up10 = { - "md_sor3up10", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940308)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up10RomInfo, md_sor3up10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940317) -static struct BurnRomInfo md_sor3up09RomDesc[] = { - { "streets of rage 3 (prototype - mar 17, 1994).bin", 0x300000, 0x39ad962b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up09) -STD_ROM_FN(md_sor3up09) - -struct BurnDriver BurnDrvmd_sor3up09 = { - "md_sor3up09", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940317)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up09RomInfo, md_sor3up09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940318) -static struct BurnRomInfo md_sor3up08RomDesc[] = { - { "streets of rage 3 (prototype - mar 18, 1994).bin", 0x300000, 0x60142484, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up08) -STD_ROM_FN(md_sor3up08) - -struct BurnDriver BurnDrvmd_sor3up08 = { - "md_sor3up08", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940318)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up08RomInfo, md_sor3up08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (Prototype, 19940328) -static struct BurnRomInfo md_sor3up07RomDesc[] = { - { "streets of rage 3 (prototype - mar 28, 1994).bin", 0x300000, 0x8757f797, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3up07) -STD_ROM_FN(md_sor3up07) - -struct BurnDriver BurnDrvmd_sor3up07 = { - "md_sor3up07", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (Prototype, 19940328)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3up07RomInfo, md_sor3up07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Streets of Rage 3 (USA) -static struct BurnRomInfo md_sor3uRomDesc[] = { - { "streets of rage 3 (usa).bin", 0x300000, 0xd5bb15d9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sor3u) -STD_ROM_FN(md_sor3u) - -struct BurnDriver BurnDrvmd_sor3u = { - "md_sor3u", "md_sor3", NULL, NULL, "1994", - "Streets of Rage 3 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sor3uRomInfo, md_sor3uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bare Knuckle III (Jpn) -static struct BurnRomInfo md_bk3RomDesc[] = { - { "bare knuckle iii (jpn).bin", 0x300000, 0x5d09236f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bk3) -STD_ROM_FN(md_bk3) - -struct BurnDriver BurnDrvmd_bk3 = { - "md_bk3", "md_sor3", NULL, NULL, "1994", - "Bare Knuckle III (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bk3RomInfo, md_bk3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bare Knuckle III (Jpn, Prototype) -static struct BurnRomInfo md_bk3pRomDesc[] = { - { "bare knuckle iii (jpn) (beta).bin", 0x300000, 0xe7ff99db, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bk3p) -STD_ROM_FN(md_bk3p) - -struct BurnDriver BurnDrvmd_bk3p = { - "md_bk3p", "md_sor3", NULL, NULL, "1994", - "Bare Knuckle III (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bk3pRomInfo, md_bk3pRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Strider (Euro, USA) -static struct BurnRomInfo md_striderRomDesc[] = { - { "mpr-13487.bin", 0x100000, 0xb9d099a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_strider) -STD_ROM_FN(md_strider) - -struct BurnDriver BurnDrvmd_strider = { - "md_strider", NULL, NULL, NULL, "1990", - "Strider (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_striderRomInfo, md_striderRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Strider Hiryuu (Jpn, Kor) -static struct BurnRomInfo md_striderjRomDesc[] = { - { "strider hiryuu (jpn, kor).bin", 0x100000, 0x859173f2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_striderj) -STD_ROM_FN(md_striderj) - -struct BurnDriver BurnDrvmd_striderj = { - "md_striderj", "md_strider", NULL, NULL, "1990", - "Strider Hiryuu (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_striderjRomInfo, md_striderjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Strider II (Euro) -static struct BurnRomInfo md_strider2RomDesc[] = { - { "strider ii (euro).bin", 0x100000, 0xe85e5270, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_strider2) -STD_ROM_FN(md_strider2) - -struct BurnDriver BurnDrvmd_strider2 = { - "md_strider2", NULL, NULL, NULL, "1990", - "Strider II (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_strider2RomInfo, md_strider2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Strider Returns - Journey from Darkness (USA) -static struct BurnRomInfo md_strider2uRomDesc[] = { - { "strider returns - journey from darkness (usa).bin", 0x100000, 0x42589b79, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_strider2u) -STD_ROM_FN(md_strider2u) - -struct BurnDriver BurnDrvmd_strider2u = { - "md_strider2u", "md_strider2", NULL, NULL, "1990", - "Strider Returns - Journey from Darkness (USA)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_strider2uRomInfo, md_strider2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Striker (Euro) -static struct BurnRomInfo md_strikerRomDesc[] = { - { "striker (euro).bin", 0x200000, 0xcc5d7ab2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_striker) -STD_ROM_FN(md_striker) - -struct BurnDriver BurnDrvmd_striker = { - "md_striker", NULL, NULL, NULL, "1994", - "Striker (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_strikerRomInfo, md_strikerRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Striker (Euro, Prototype) -static struct BurnRomInfo md_strikerpRomDesc[] = { - { "striker (euro) (beta).bin", 0x200000, 0xc10b270e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_strikerp) -STD_ROM_FN(md_strikerp) - -struct BurnDriver BurnDrvmd_strikerp = { - "md_strikerp", "md_striker", NULL, NULL, "1994", - "Striker (Euro, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_strikerpRomInfo, md_strikerpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// SubTerrania (Euro) -static struct BurnRomInfo md_subterrRomDesc[] = { - { "mpr-16627.bin", 0x200000, 0xe8ced28d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_subterr) -STD_ROM_FN(md_subterr) - -struct BurnDriver BurnDrvmd_subterr = { - "md_subterr", NULL, NULL, NULL, "1994", - "SubTerrania (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_subterrRomInfo, md_subterrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// SubTerrania (Prototype) -static struct BurnRomInfo md_subterrp1RomDesc[] = { - { "subterrania (beta).bin", 0x200000, 0x3a1022d1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_subterrp1) -STD_ROM_FN(md_subterrp1) - -struct BurnDriver BurnDrvmd_subterrp1 = { - "md_subterrp1", "md_subterr", NULL, NULL, "1994", - "SubTerrania (Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_subterrp1RomInfo, md_subterrp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// SubTerrania (Prototype, Earlier) -static struct BurnRomInfo md_subterrp2RomDesc[] = { - { "subterrania (beta) (earlier).bin", 0x140000, 0x9c13d25c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_subterrp2) -STD_ROM_FN(md_subterrp2) - -struct BurnDriver BurnDrvmd_subterrp2 = { - "md_subterrp2", "md_subterr", NULL, NULL, "1994", - "SubTerrania (Prototype, Earlier)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_subterrp2RomInfo, md_subterrp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// SubTerrania (Jpn) -static struct BurnRomInfo md_subterrjRomDesc[] = { - { "subterrania (jpn).bin", 0x200000, 0x7638ea91, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_subterrj) -STD_ROM_FN(md_subterrj) - -struct BurnDriver BurnDrvmd_subterrj = { - "md_subterrj", "md_subterr", NULL, NULL, "1994?", - "SubTerrania (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_subterrjRomInfo, md_subterrjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// SubTerrania (Jpn, Prototype, 19940202) -static struct BurnRomInfo md_subterrp3RomDesc[] = { - { "subterrania (prototype - feb 02, 1994).bin", 0x200000, 0xb368e394, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_subterrp3) -STD_ROM_FN(md_subterrp3) - -struct BurnDriver BurnDrvmd_subterrp3 = { - "md_subterrp3", "md_subterr", NULL, NULL, "1994", - "SubTerrania (Jpn, Prototype, 19940202)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_subterrp3RomInfo, md_subterrp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// SubTerrania (USA) -static struct BurnRomInfo md_subterruRomDesc[] = { - { "subterrania (usa).bin", 0x200000, 0xdc3c6c45, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_subterru) -STD_ROM_FN(md_subterru) - -struct BurnDriver BurnDrvmd_subterru = { - "md_subterru", "md_subterr", NULL, NULL, "1993", - "SubTerrania (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_subterruRomInfo, md_subterruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Summer Challenge (Euro, USA) -static struct BurnRomInfo md_summerRomDesc[] = { - { "summer challenge (euro, usa).bin", 0x200000, 0xd7d53dc1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_summer) -STD_ROM_FN(md_summer) - -struct BurnDriver BurnDrvmd_summer = { - "md_summer", NULL, NULL, NULL, "1993", - "Summer Challenge (Euro, USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_summerRomInfo, md_summerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sunset Riders (Euro) -static struct BurnRomInfo md_ssridersRomDesc[] = { - { "mpr-15305.bin", 0x080000, 0x0ff33054, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ssriders) -STD_ROM_FN(md_ssriders) - -struct BurnDriver BurnDrvmd_ssriders = { - "md_ssriders", NULL, NULL, NULL, "1992", - "Sunset Riders (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ssridersRomInfo, md_ssridersRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sunset Riders (USA) -static struct BurnRomInfo md_ssridersuRomDesc[] = { - { "sunset riders (usa).bin", 0x080000, 0xac30c297, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ssridersu) -STD_ROM_FN(md_ssridersu) - -struct BurnDriver BurnDrvmd_ssridersu = { - "md_ssridersu", "md_ssriders", NULL, NULL, "1992", - "Sunset Riders (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ssridersuRomInfo, md_ssridersuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Baseball 2020 (Euro, USA) -static struct BurnRomInfo md_2020bbRomDesc[] = { - { "super02.bin", 0x200000, 0xc17acee5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_2020bb) -STD_ROM_FN(md_2020bb) - -struct BurnDriver BurnDrvmd_2020bb = { - "md_2020bb", NULL, NULL, NULL, "1994", - "Super Baseball 2020 (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_2020bbRomInfo, md_2020bbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 2020 Toshi Super Baseball (Jpn) -static struct BurnRomInfo md_2020bbjRomDesc[] = { - { "2020 toshi super baseball (jpn).bin", 0x200000, 0x2bbee127, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_2020bbj) -STD_ROM_FN(md_2020bbj) - -struct BurnDriver BurnDrvmd_2020bbj = { - "md_2020bbj", "md_2020bb", NULL, NULL, "1994", - "2020 Toshi Super Baseball (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_2020bbjRomInfo, md_2020bbjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Battleship (USA) -static struct BurnRomInfo md_sbshipRomDesc[] = { - { "super battleship (usa).bin", 0x080000, 0x99ca1bfb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sbship) -STD_ROM_FN(md_sbship) - -struct BurnDriver BurnDrvmd_sbship = { - "md_sbship", NULL, NULL, NULL, "1993", - "Super Battleship (USA)\0", NULL, "Mindscape", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sbshipRomInfo, md_sbshipRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Garry Kitchen's Super Battletank - War in the Gulf (USA) -static struct BurnRomInfo md_sbtankRomDesc[] = { - { "super battletank - war in the gulf (usa).bin", 0x080000, 0xb0b5e3c9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sbtank) -STD_ROM_FN(md_sbtank) - -struct BurnDriver BurnDrvmd_sbtank = { - "md_sbtank", NULL, NULL, NULL, "1992", - "Garry Kitchen's Super Battletank - War in the Gulf (USA)\0", NULL, "Absolute Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sbtankRomInfo, md_sbtankRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Daisenryaku (Jpn, Rev. 02) -static struct BurnRomInfo md_supdaisnRomDesc[] = { - { "mpr-12477a-h.ic1", 0x080000, 0x11645d6e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_supdaisn) -STD_ROM_FN(md_supdaisn) - -struct BurnDriver BurnDrvmd_supdaisn = { - "md_supdaisn", NULL, NULL, NULL, "1989", - "Super Daisenryaku (Jpn, Rev. 02)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_supdaisnRomInfo, md_supdaisnRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Daisenryaku (Jpn) -static struct BurnRomInfo md_supdaisnaRomDesc[] = { - { "mpr-12477.ic1", 0x080000, 0xd50a166f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_supdaisna) -STD_ROM_FN(md_supdaisna) - -struct BurnDriver BurnDrvmd_supdaisna = { - "md_supdaisna", "md_supdaisn", NULL, NULL, "1989", - "Super Daisenryaku (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_supdaisnaRomInfo, md_supdaisnaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Fantasy Zone (Euro) -static struct BurnRomInfo md_sfzoneRomDesc[] = { - { "mpr-15124.bin", 0x100000, 0x927975be, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sfzone) -STD_ROM_FN(md_sfzone) - -struct BurnDriver BurnDrvmd_sfzone = { - "md_sfzone", NULL, NULL, NULL, "1993", - "Super Fantasy Zone (Euro)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sfzoneRomInfo, md_sfzoneRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Fantasy Zone (Jpn) -static struct BurnRomInfo md_sfzonejRomDesc[] = { - { "super fantasy zone (jpn).bin", 0x100000, 0x767780d7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sfzonej) -STD_ROM_FN(md_sfzonej) - -struct BurnDriver BurnDrvmd_sfzonej = { - "md_sfzonej", "md_sfzone", NULL, NULL, "1992", - "Super Fantasy Zone (Jpn)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sfzonejRomInfo, md_sfzonejRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Hang-On (World, Rev. A) -static struct BurnRomInfo md_shangonRomDesc[] = { - { "mpr-12640a.bin", 0x080000, 0x3877d107, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shangon) -STD_ROM_FN(md_shangon) - -struct BurnDriver BurnDrvmd_shangon = { - "md_shangon", NULL, NULL, NULL, "1989", - "Super Hang-On (World, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shangonRomInfo, md_shangonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Hang-On (World) -static struct BurnRomInfo md_shangon1RomDesc[] = { - { "mpr-12640.bin", 0x080000, 0xcb2201a3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shangon1) -STD_ROM_FN(md_shangon1) - -struct BurnDriver BurnDrvmd_shangon1 = { - "md_shangon1", "md_shangon", NULL, NULL, "1989", - "Super Hang-On (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shangon1RomInfo, md_shangon1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super High Impact (USA) -static struct BurnRomInfo md_shimpactRomDesc[] = { - { "super high impact (usa).bin", 0x100000, 0xb870c2f7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shimpact) -STD_ROM_FN(md_shimpact) - -struct BurnDriver BurnDrvmd_shimpact = { - "md_shimpact", NULL, NULL, NULL, "1992", - "Super High Impact (USA)\0", NULL, "Arena", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shimpactRomInfo, md_shimpactRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Hydlide (Euro) -static struct BurnRomInfo md_suphydlRomDesc[] = { - { "super hydlide (euro).bin", 0x080000, 0x1fe2d90b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_suphydl) -STD_ROM_FN(md_suphydl) - -struct BurnDriver BurnDrvmd_suphydl = { - "md_suphydl", NULL, NULL, NULL, "1991", - "Super Hydlide (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_suphydlRomInfo, md_suphydlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Hydlide (Jpn) -static struct BurnRomInfo md_suphydljRomDesc[] = { - { "mpr-12632.bin", 0x080000, 0x599be386, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_suphydlj) -STD_ROM_FN(md_suphydlj) - -struct BurnDriver BurnDrvmd_suphydlj = { - "md_suphydlj", "md_suphydl", NULL, NULL, "1989", - "Super Hydlide (Jpn)\0", NULL, "Asmik Ace", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_suphydljRomInfo, md_suphydljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Hydlide (USA) -static struct BurnRomInfo md_suphydluRomDesc[] = { - { "super hydlide (usa).bin", 0x080000, 0x1335ddaa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_suphydlu) -STD_ROM_FN(md_suphydlu) - -struct BurnDriver BurnDrvmd_suphydlu = { - "md_suphydlu", "md_suphydl", NULL, NULL, "1989", - "Super Hydlide (USA)\0", NULL, "Seismic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_suphydluRomInfo, md_suphydluRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Kick Off (Euro) -static struct BurnRomInfo md_skickoffRomDesc[] = { - { "mpr-15420.bin", 0x080000, 0xf43793ff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_skickoff) -STD_ROM_FN(md_skickoff) - -struct BurnDriver BurnDrvmd_skickoff = { - "md_skickoff", NULL, NULL, NULL, "1992", - "Super Kick Off (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_skickoffRomInfo, md_skickoffRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super League (Euro) -static struct BurnRomInfo md_suprleagRomDesc[] = { - { "super league (euro).bin", 0x080000, 0x55baec6e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_suprleag) -STD_ROM_FN(md_suprleag) - -struct BurnDriver BurnDrvmd_suprleag = { - "md_suprleag", NULL, NULL, NULL, "1990", - "Super League (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_suprleagRomInfo, md_suprleagRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super League (Jpn) -static struct BurnRomInfo md_suprleagjRomDesc[] = { - { "super league (jpn).bin", 0x080000, 0xea13cb1d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_suprleagj) -STD_ROM_FN(md_suprleagj) - -struct BurnDriver BurnDrvmd_suprleagj = { - "md_suprleagj", "md_suprleag", NULL, NULL, "1989", - "Super League (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_suprleagjRomInfo, md_suprleagjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tommy Lasorda Baseball (USA) -static struct BurnRomInfo md_lasordaRomDesc[] = { - { "mpr-12706.bin", 0x080000, 0x4fb50304, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lasorda) -STD_ROM_FN(md_lasorda) - -struct BurnDriver BurnDrvmd_lasorda = { - "md_lasorda", "md_suprleag", NULL, NULL, "1989", - "Tommy Lasorda Baseball (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lasordaRomInfo, md_lasordaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Mario World ~ Super Mario Bros. (Pirate, Alt) -static struct BurnRomInfo md_smbaRomDesc[] = { - { "super mario world (unl).bin", 0x200000, 0xcf540ba6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smba) -STD_ROM_FN(md_smba) - -struct BurnDriver BurnDrvmd_smba = { - "md_smba", "md_smb", NULL, NULL, "199?", - "Super Mario World ~ Super Mario Bros. (Pirate, Alt)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smbaRomInfo, md_smbaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Mario World ~ Super Mario Bros. (Pirate, Alt 2) -static struct BurnRomInfo md_smbbRomDesc[] = { - { "super mario world (unl) (pirate).bin", 0x200000, 0x97c2695e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smbb) -STD_ROM_FN(md_smbb) - -struct BurnDriver BurnDrvmd_smbb = { - "md_smbb", "md_smb", NULL, NULL, "199?", - "Super Mario World ~ Super Mario Bros. (Pirate, Alt 2)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smbbRomInfo, md_smbbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Monaco GP (Euro, Jpn) -static struct BurnRomInfo md_smgpaRomDesc[] = { - { "super monaco gp (euro, jpn).bin", 0x080000, 0xb1823595, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smgpa) -STD_ROM_FN(md_smgpa) - -struct BurnDriver BurnDrvmd_smgpa = { - "md_smgpa", "md_smgp", NULL, NULL, "1990", - "Super Monaco GP (Euro, Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smgpaRomInfo, md_smgpaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Monaco GP (Jpn) -static struct BurnRomInfo md_smgpjRomDesc[] = { - { "mpr-13215.bin", 0x080000, 0x90f9bab3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smgpj) -STD_ROM_FN(md_smgpj) - -struct BurnDriver BurnDrvmd_smgpj = { - "md_smgpj", "md_smgp", NULL, NULL, "1990", - "Super Monaco GP (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smgpjRomInfo, md_smgpjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Monaco GP (USA) -static struct BurnRomInfo md_smgpuRomDesc[] = { - { "super monaco gp (usa).bin", 0x080000, 0x725018ee, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smgpu) -STD_ROM_FN(md_smgpu) - -struct BurnDriver BurnDrvmd_smgpu = { - "md_smgpu", "md_smgp", NULL, NULL, "1990", - "Super Monaco GP (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smgpuRomInfo, md_smgpuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Off Road (Euro, USA) -static struct BurnRomInfo md_superoffRomDesc[] = { - { "super off road (euro, usa).bin", 0x080000, 0x8f2fdada, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_superoff) -STD_ROM_FN(md_superoff) - -struct BurnDriver BurnDrvmd_superoff = { - "md_superoff", NULL, NULL, NULL, "1994", - "Super Off Road (Euro, USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_superoffRomInfo, md_superoffRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Real Basketball (Euro) -static struct BurnRomInfo md_srealbasRomDesc[] = { - { "mpr-13432.bin", 0x080000, 0xf04765ba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_srealbas) -STD_ROM_FN(md_srealbas) - -struct BurnDriver BurnDrvmd_srealbas = { - "md_srealbas", NULL, NULL, NULL, "1990", - "Super Real Basketball (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_srealbasRomInfo, md_srealbasRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Real Basketball (Jpn, Kor) -static struct BurnRomInfo md_srealbasjRomDesc[] = { - { "mpr-12904.bin", 0x080000, 0x4346e11a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_srealbasj) -STD_ROM_FN(md_srealbasj) - -struct BurnDriver BurnDrvmd_srealbasj = { - "md_srealbasj", "md_srealbas", NULL, NULL, "1990", - "Super Real Basketball (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_srealbasjRomInfo, md_srealbasjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pat Riley Basketball (USA) -static struct BurnRomInfo md_patrileyRomDesc[] = { - { "pat riley basketball (usa).bin", 0x080000, 0x3d9318a7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_patriley) -STD_ROM_FN(md_patriley) - -struct BurnDriver BurnDrvmd_patriley = { - "md_patriley", "md_srealbas", NULL, NULL, "1990", - "Pat Riley Basketball (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_patrileyRomInfo, md_patrileyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Skidmarks (Euro, J-Cart) -static struct BurnRomInfo md_sskidRomDesc[] = { - { "super skidmarks (euro) (j-cart).bin", 0x200000, 0x4a9c62f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sskid) -STD_ROM_FN(md_sskid) - -struct BurnDriver BurnDrvmd_sskid = { - "md_sskid", NULL, NULL, NULL, "1995", - "Super Skidmarks (Euro, J-Cart)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sskidRomInfo, md_sskidRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Skidmarks (USA, Prototype) -static struct BurnRomInfo md_sskidpRomDesc[] = { - { "super skidmarks (euro) (beta).bin", 0x200000, 0xa61a0f0c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sskidp) -STD_ROM_FN(md_sskidp) - -struct BurnDriver BurnDrvmd_sskidp = { - "md_sskidp", "md_sskid", NULL, NULL, "1995", - "Super Skidmarks (USA, Prototype)\0", NULL, "Codemasters", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sskidpRomInfo, md_sskidpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Street Fighter II - The New Challengers (Euro) -static struct BurnRomInfo md_ssf2RomDesc[] = { - { "super street fighter ii - the new challengers (euro).bin", 0x500000, 0x682c192f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ssf2) -STD_ROM_FN(md_ssf2) - -struct BurnDriver BurnDrvmd_ssf2 = { - "md_ssf2", NULL, NULL, NULL, "1994", - "Super Street Fighter II - The New Challengers (Euro)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SSF2, GBF_MISC, 0, - MegadriveGetZipName, md_ssf2RomInfo, md_ssf2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Street Fighter II - The New Challengers (Jpn) -static struct BurnRomInfo md_ssf2jRomDesc[] = { - { "super street fighter ii - the new challengers (jpn).bin", 0x500000, 0xd8eeb2bd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ssf2j) -STD_ROM_FN(md_ssf2j) - -struct BurnDriver BurnDrvmd_ssf2j = { - "md_ssf2j", "md_ssf2", NULL, NULL, "1994", - "Super Street Fighter II - The New Challengers (Jpn)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SSF2, GBF_MISC, 0, - MegadriveGetZipName, md_ssf2jRomInfo, md_ssf2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Street Fighter II - The New Challengers (USA) -static struct BurnRomInfo md_ssf2uRomDesc[] = { - { "super street fighter ii - the new challengers (usa).bin", 0x500000, 0x165defbf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ssf2u) -STD_ROM_FN(md_ssf2u) - -struct BurnDriver BurnDrvmd_ssf2u = { - "md_ssf2u", "md_ssf2", NULL, NULL, "1994", - "Super Street Fighter II - The New Challengers (USA)\0", NULL, "Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SSF2, GBF_MISC, 0, - MegadriveGetZipName, md_ssf2uRomInfo, md_ssf2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Thunder Blade (Jpn, Launch Cart) -static struct BurnRomInfo md_stbladjRomDesc[] = { - { "mpr-11996.bin", 0x080000, 0x8bd77836, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_stbladj) -STD_ROM_FN(md_stbladj) - -struct BurnDriver BurnDrvmd_stbladj = { - "md_stbladj", "md_stblad", NULL, NULL, "1988", - "Super Thunder Blade (Jpn, Launch Cart)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_stbladjRomInfo, md_stbladjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Volley Ball (USA) -static struct BurnRomInfo md_svolleyRomDesc[] = { - { "super volley ball (usa).bin", 0x040000, 0xa88fee44, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_svolley) -STD_ROM_FN(md_svolley) - -struct BurnDriver BurnDrvmd_svolley = { - "md_svolley", NULL, NULL, NULL, "1991", - "Super Volley Ball (USA)\0", NULL, "Video System", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_svolleyRomInfo, md_svolleyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Volley Ball (USA, Alt) -static struct BurnRomInfo md_svolley1RomDesc[] = { - { "super volley ball (usa) (alt).bin", 0x040000, 0x85102799, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_svolley1) -STD_ROM_FN(md_svolley1) - -struct BurnDriver BurnDrvmd_svolley1 = { - "md_svolley1", "md_svolley", NULL, NULL, "1991", - "Super Volley Ball (USA, Alt)\0", NULL, "Video System", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_svolley1RomInfo, md_svolley1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Volley Ball (Jpn) -static struct BurnRomInfo md_svolleyjRomDesc[] = { - { "super volley ball (jpn).bin", 0x040000, 0x9b5c28ea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_svolleyj) -STD_ROM_FN(md_svolleyj) - -struct BurnDriver BurnDrvmd_svolleyj = { - "md_svolleyj", "md_svolley", NULL, NULL, "1991", - "Super Volley Ball (Jpn)\0", NULL, "Video System", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_svolleyjRomInfo, md_svolleyjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Superman - The Man of Steel (Euro) -static struct BurnRomInfo md_supermanRomDesc[] = { - { "mpr-15327.bin", 0x100000, 0x7db434ba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_superman) -STD_ROM_FN(md_superman) - -struct BurnDriver BurnDrvmd_superman = { - "md_superman", NULL, NULL, NULL, "1993", - "Superman - The Man of Steel (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_supermanRomInfo, md_supermanRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Superman (USA, Prototype) -static struct BurnRomInfo md_supermanpRomDesc[] = { - { "superman (usa) (beta).bin", 0x100000, 0x5cd0e1d4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_supermanp) -STD_ROM_FN(md_supermanp) - -struct BurnDriver BurnDrvmd_supermanp = { - "md_supermanp", "md_superman", NULL, NULL, "1992", - "Superman (USA, Prototype)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_supermanpRomInfo, md_supermanpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Superman (USA) -static struct BurnRomInfo md_supermanuRomDesc[] = { - { "superman (usa).bin", 0x100000, 0x543a5869, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_supermanu) -STD_ROM_FN(md_supermanu) - -struct BurnDriver BurnDrvmd_supermanu = { - "md_supermanu", "md_superman", NULL, NULL, "1992", - "Superman (USA)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_supermanuRomInfo, md_supermanuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Surging Aura (Jpn) -static struct BurnRomInfo md_surgingRomDesc[] = { - { "surging aura (jpn).bin", 0x200000, 0x65ac1d2b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_surging) -STD_ROM_FN(md_surging) - -struct BurnDriver BurnDrvmd_surging = { - "md_surging", NULL, NULL, NULL, "1995", - "Surging Aura (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_surgingRomInfo, md_surgingRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Swamp Thing (USA, Prototype) -static struct BurnRomInfo md_swampRomDesc[] = { - { "swamp thing proto.bin", 0x400000, 0xe6ebe9d5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_swamp) -STD_ROM_FN(md_swamp) - -struct BurnDriver BurnDrvmd_swamp = { - "md_swamp", NULL, NULL, NULL, "1991", - "Swamp Thing (USA, Prototype)\0", NULL, "NuVision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_swampRomInfo, md_swampRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sword of Sodan (Euro, USA) -static struct BurnRomInfo md_swordsodRomDesc[] = { - { "sword of sodan (euro, usa).bin", 0x080000, 0x9cb8468f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_swordsod) -STD_ROM_FN(md_swordsod) - -struct BurnDriver BurnDrvmd_swordsod = { - "md_swordsod", NULL, NULL, NULL, "1990", - "Sword of Sodan (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_swordsodRomInfo, md_swordsodRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sword of Sodan (Jpn) -static struct BurnRomInfo md_swordsodjRomDesc[] = { - { "sword of sodan (jpn).bin", 0x080000, 0x58edb3f3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_swordsodj) -STD_ROM_FN(md_swordsodj) - -struct BurnDriver BurnDrvmd_swordsodj = { - "md_swordsodj", "md_swordsod", NULL, NULL, "1990", - "Sword of Sodan (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_swordsodjRomInfo, md_swordsodjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Syd of Valis (USA) -static struct BurnRomInfo md_sydvalisRomDesc[] = { - { "syd of valis (usa).bin", 0x080000, 0x37dc0108, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sydvalis) -STD_ROM_FN(md_sydvalis) - -struct BurnDriver BurnDrvmd_sydvalis = { - "md_sydvalis", NULL, NULL, NULL, "1992", - "Syd of Valis (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sydvalisRomInfo, md_sydvalisRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// SD Valis (Jpn) -static struct BurnRomInfo md_sdvalisRomDesc[] = { - { "sd valis (jpn).bin", 0x080000, 0x1aef72ea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sdvalis) -STD_ROM_FN(md_sdvalis) - -struct BurnDriver BurnDrvmd_sdvalis = { - "md_sdvalis", "md_sydvalis", NULL, NULL, "1992", - "SD Valis (Jpn)\0", NULL, "Laser Soft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sdvalisRomInfo, md_sdvalisRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sword of Vermilion (Euro, USA) -static struct BurnRomInfo md_vermilRomDesc[] = { - { "mpr-13430+mpr-13431.bin", 0x0a0000, 0xea1bc9ab, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vermil) -STD_ROM_FN(md_vermil) - -struct BurnDriver BurnDrvmd_vermil = { - "md_vermil", NULL, NULL, NULL, "1990", - "Sword of Vermilion (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_vermilRomInfo, md_vermilRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vermilion (Jpn) -static struct BurnRomInfo md_vermiljRomDesc[] = { - { "vermilion (jpn).bin", 0x0a0000, 0xe400dfc3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vermilj) -STD_ROM_FN(md_vermilj) - -struct BurnDriver BurnDrvmd_vermilj = { - "md_vermilj", "md_vermil", NULL, NULL, "1989", - "Vermilion (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_vermiljRomInfo, md_vermiljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sylvester & Tweety in Cagey Capers (Euro) -static struct BurnRomInfo md_sylvestrRomDesc[] = { - { "sylvester & tweety in cagey capers (euro).bin", 0x200000, 0x89fc54ce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sylvestr) -STD_ROM_FN(md_sylvestr) - -struct BurnDriver BurnDrvmd_sylvestr = { - "md_sylvestr", NULL, NULL, NULL, "1994", - "Sylvester & Tweety in Cagey Capers (Euro)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sylvestrRomInfo, md_sylvestrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sylvester and Tweety in Cagey Capers (USA) -static struct BurnRomInfo md_sylvestruRomDesc[] = { - { "sylvester and tweety in cagey capers (usa).bin", 0x200000, 0x9d9c786b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sylvestru) -STD_ROM_FN(md_sylvestru) - -struct BurnDriver BurnDrvmd_sylvestru = { - "md_sylvestru", "md_sylvestr", NULL, NULL, "1993", - "Sylvester and Tweety in Cagey Capers (USA)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sylvestruRomInfo, md_sylvestruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Syndicate (Euro, USA) -static struct BurnRomInfo md_syndicatRomDesc[] = { - { "syndicate (euro, usa).bin", 0x200000, 0x95bbf87b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_syndicat) -STD_ROM_FN(md_syndicat) - -struct BurnDriver BurnDrvmd_syndicat = { - "md_syndicat", NULL, NULL, NULL, "1994", - "Syndicate (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_syndicatRomInfo, md_syndicatRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// T2 - Terminator 2 - Judgment Day (Euro, USA) -static struct BurnRomInfo md_term2RomDesc[] = { - { "t2 - terminator 2 - judgment day (euro, usa).bin", 0x100000, 0x2f75e896, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_term2) -STD_ROM_FN(md_term2) - -struct BurnDriver BurnDrvmd_term2 = { - "md_term2", NULL, NULL, NULL, "1991", - "T2 - Terminator 2 - Judgment Day (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_term2RomInfo, md_term2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// T2 - The Arcade Game (Euro, USA) -static struct BurnRomInfo md_t2agRomDesc[] = { - { "mpr-15238.bin", 0x100000, 0xa1264f17, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_t2ag) -STD_ROM_FN(md_t2ag) - -struct BurnDriver BurnDrvmd_t2ag = { - "md_t2ag", NULL, NULL, NULL, "1992", - "T2 - The Arcade Game (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_t2agRomInfo, md_t2agRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// T2 - The Arcade Game (USA, Prototype) -static struct BurnRomInfo md_t2agpRomDesc[] = { - { "t2 - the arcade game (usa) (beta).bin", 0x100000, 0x94255703, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_t2agp) -STD_ROM_FN(md_t2agp) - -struct BurnDriver BurnDrvmd_t2agp = { - "md_t2agp", "md_t2ag", NULL, NULL, "1992", - "T2 - The Arcade Game (USA, Prototype)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_t2agpRomInfo, md_t2agpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// T2 - The Arcade Game (Jpn) -static struct BurnRomInfo md_t2agjRomDesc[] = { - { "t2 - the arcade game (jpn).bin", 0x100000, 0x5e6fe52c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_t2agj) -STD_ROM_FN(md_t2agj) - -struct BurnDriver BurnDrvmd_t2agj = { - "md_t2agj", "md_t2ag", NULL, NULL, "1994", - "T2 - The Arcade Game (Jpn)\0", NULL, "Acclaim Japan", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_t2agjRomInfo, md_t2agjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Taikou Risshiden (Jpn) -static struct BurnRomInfo md_taikorisRomDesc[] = { - { "taikou risshiden (jpn).bin", 0x140000, 0xf96fe15b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_taikoris) -STD_ROM_FN(md_taikoris) - -struct BurnDriver BurnDrvmd_taikoris = { - "md_taikoris", NULL, NULL, NULL, "1993", - "Taikou Risshiden (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_taikorisRomInfo, md_taikorisRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Taiwan Daheng (Chi) -static struct BurnRomInfo md_taiwanRomDesc[] = { - { "taiwan daheng (chi) (unl).bin", 0x100000, 0xbaf20f81, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_taiwan) -STD_ROM_FN(md_taiwan) - -struct BurnDriver BurnDrvmd_taiwan = { - "md_taiwan", NULL, NULL, NULL, "1994", - "Taiwan Daheng (Chi)\0", NULL, "C&E", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_taiwanRomInfo, md_taiwanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// TaleSpin (Euro, USA) -static struct BurnRomInfo md_talespinRomDesc[] = { - { "mpr-15058.bin", 0x080000, 0xf5c0c8d0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_talespin) -STD_ROM_FN(md_talespin) - -struct BurnDriver BurnDrvmd_talespin = { - "md_talespin", NULL, NULL, NULL, "1992", - "TaleSpin (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_talespinRomInfo, md_talespinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Marvel Land (USA) -static struct BurnRomInfo md_marvlandRomDesc[] = { - { "marvel land (usa).bin", 0x100000, 0xcd7eeeb7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_marvland) -STD_ROM_FN(md_marvland) - -struct BurnDriver BurnDrvmd_marvland = { - "md_marvland", "md_talmit", NULL, NULL, "1991", - "Marvel Land (USA)\0", NULL, "Namcot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_marvlandRomInfo, md_marvlandRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Target Earth (USA) -static struct BurnRomInfo md_trgearthRomDesc[] = { - { "target earth (usa).bin", 0x080000, 0xcddf62d3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_trgearth) -STD_ROM_FN(md_trgearth) - -struct BurnDriver BurnDrvmd_trgearth = { - "md_trgearth", NULL, NULL, NULL, "1990", - "Target Earth (USA)\0", NULL, "Dreamworks Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_trgearthRomInfo, md_trgearthRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Assault Suit Leynos (Jpn) -static struct BurnRomInfo md_leynosRomDesc[] = { - { "assault suit leynos (jpn).bin", 0x080000, 0x81a2c800, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_leynos) -STD_ROM_FN(md_leynos) - -struct BurnDriver BurnDrvmd_leynos = { - "md_leynos", "md_trgearth", NULL, NULL, "1990", - "Assault Suit Leynos (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_leynosRomInfo, md_leynosRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Task Force Harrier EX (USA) -static struct BurnRomInfo md_taskfhexRomDesc[] = { - { "task force harrier ex (usa).bin", 0x100000, 0xc8bb0257, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_taskfhex) -STD_ROM_FN(md_taskfhex) - -struct BurnDriver BurnDrvmd_taskfhex = { - "md_taskfhex", NULL, NULL, NULL, "1991", - "Task Force Harrier EX (USA)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_taskfhexRomInfo, md_taskfhexRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Task Force Harrier EX (Jpn) -static struct BurnRomInfo md_taskfhexjRomDesc[] = { - { "task force harrier ex (jpn).bin", 0x100000, 0xe9a54eed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_taskfhexj) -STD_ROM_FN(md_taskfhexj) - -struct BurnDriver BurnDrvmd_taskfhexj = { - "md_taskfhexj", "md_taskfhex", NULL, NULL, "1991", - "Task Force Harrier EX (Jpn)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_taskfhexjRomInfo, md_taskfhexjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Truxton (Euro, USA) ~ Tatsujin (Jpn) -static struct BurnRomInfo md_truxtonRomDesc[] = { - { "truxton -- tatsujin (world).bin", 0x080000, 0x5bd0882d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_truxton) -STD_ROM_FN(md_truxton) - -struct BurnDriver BurnDrvmd_truxton = { - "md_truxton", NULL, NULL, NULL, "1989", - "Truxton (Euro, USA) ~ Tatsujin (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_truxtonRomInfo, md_truxtonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Taz-Mania (World) -static struct BurnRomInfo md_tazmaniaRomDesc[] = { - { "mpr-14838.bin", 0x080000, 0x0e901f45, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tazmania) -STD_ROM_FN(md_tazmania) - -struct BurnDriver BurnDrvmd_tazmania = { - "md_tazmania", NULL, NULL, NULL, "1992", - "Taz-Mania (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tazmaniaRomInfo, md_tazmaniaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// USA Basketball World Challenge (Euro, USA) -static struct BurnRomInfo md_teamusaRomDesc[] = { - { "team usa basketball (euro, usa).bin", 0x100000, 0xa0caf97e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_teamusa) -STD_ROM_FN(md_teamusa) - -struct BurnDriver BurnDrvmd_teamusa = { - "md_teamusa", NULL, NULL, NULL, "1992", - "USA Basketball World Challenge (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_teamusaRomInfo, md_teamusaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// USA Basketball World Challenge (Jpn) -static struct BurnRomInfo md_dreamteamRomDesc[] = { - { "dream team usa (jpn).bin", 0x100000, 0xe2e21b72, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dreamteam) -STD_ROM_FN(md_dreamteam) - -struct BurnDriver BurnDrvmd_dreamteam = { - "md_dreamteam", "md_teamusa", NULL, NULL, "1992", - "USA Basketball World Challenge (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dreamteamRomInfo, md_dreamteamRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Techno Clash (Euro, USA) -static struct BurnRomInfo md_technoclRomDesc[] = { - { "techno clash (euro, usa).bin", 0x100000, 0x4e65e483, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_technocl) -STD_ROM_FN(md_technocl) - -struct BurnDriver BurnDrvmd_technocl = { - "md_technocl", NULL, NULL, NULL, "1993", - "Techno Clash (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_technoclRomInfo, md_technoclRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Technocop (USA) -static struct BurnRomInfo md_tecnocopRomDesc[] = { - { "technocop (usa).bin", 0x080000, 0x7459ad06, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecnocop) -STD_ROM_FN(md_tecnocop) - -struct BurnDriver BurnDrvmd_tecnocop = { - "md_tecnocop", NULL, NULL, NULL, "1990", - "Technocop (USA)\0", NULL, "Razorsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tecnocopRomInfo, md_tecnocopRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Boy Soccer Team III (Jpn, Pirate) -static struct BurnRomInfo md_bsteam3RomDesc[] = { - { "tecmo cup (jpn) (pirate).bin", 0x080000, 0xe889e218, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bsteam3) -STD_ROM_FN(md_bsteam3) - -struct BurnDriver BurnDrvmd_bsteam3 = { - "md_bsteam3", "md_tecmocup", NULL, NULL, "199?", - "Boy Soccer Team III (Jpn, Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bsteam3RomInfo, md_bsteam3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Cup (Jpn, Prototype?) -static struct BurnRomInfo md_tecmocupRomDesc[] = { - { "tecmo cup (jpn) (prototype?) (bad dump).bin", 0x080000, 0x88fdd060, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmocup) -STD_ROM_FN(md_tecmocup) - -struct BurnDriver BurnDrvmd_tecmocup = { - "md_tecmocup", NULL, NULL, NULL, "199?", - "Tecmo Cup (Jpn, Prototype?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tecmocupRomInfo, md_tecmocupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super Baseball (USA) -static struct BurnRomInfo md_tecmobbRomDesc[] = { - { "tecmo super baseball (usa).bin", 0x100000, 0x227a1178, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmobb) -STD_ROM_FN(md_tecmobb) - -struct BurnDriver BurnDrvmd_tecmobb = { - "md_tecmobb", NULL, NULL, NULL, "1994", - "Tecmo Super Baseball (USA)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmobbRomInfo, md_tecmobbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super Bowl (USA, 199310) -static struct BurnRomInfo md_tecmosbwRomDesc[] = { - { "tecmo super bowl (usa) (october 1993).bin", 0x100000, 0x21f27d34, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmosbw) -STD_ROM_FN(md_tecmosbw) - -struct BurnDriver BurnDrvmd_tecmosbw = { - "md_tecmosbw", NULL, NULL, NULL, "1993", - "Tecmo Super Bowl (USA, 199310)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmosbwRomInfo, md_tecmosbwRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super Bowl (USA, 199309) -static struct BurnRomInfo md_tecmosbwaRomDesc[] = { - { "tecmo super bowl (usa) (september 1993).bin", 0x100000, 0xbd5933ee, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmosbwa) -STD_ROM_FN(md_tecmosbwa) - -struct BurnDriver BurnDrvmd_tecmosbwa = { - "md_tecmosbwa", "md_tecmosbw", NULL, NULL, "1993", - "Tecmo Super Bowl (USA, 199309)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmosbwaRomInfo, md_tecmosbwaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super Bowl (Jpn) -static struct BurnRomInfo md_tecmosbwjRomDesc[] = { - { "tecmo super bowl (jpn).bin", 0x100000, 0x90c6e20c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmosbwj) -STD_ROM_FN(md_tecmosbwj) - -struct BurnDriver BurnDrvmd_tecmosbwj = { - "md_tecmosbwj", "md_tecmosbw", NULL, NULL, "1993", - "Tecmo Super Bowl (Jpn)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmosbwjRomInfo, md_tecmosbwjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super Bowl II (USA) -static struct BurnRomInfo md_tecmosb2RomDesc[] = { - { "tecmo super bowl ii - special edition (usa).bin", 0x200000, 0x0a0e67d8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmosb2) -STD_ROM_FN(md_tecmosb2) - -struct BurnDriver BurnDrvmd_tecmosb2 = { - "md_tecmosb2", NULL, NULL, NULL, "1994", - "Tecmo Super Bowl II (USA)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmosb2RomInfo, md_tecmosb2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super Bowl II - Special Edition (Jpn) -static struct BurnRomInfo md_tecmosb2jRomDesc[] = { - { "tecmo super bowl ii - special edition (jpn).bin", 0x200000, 0x32fb633d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmosb2j) -STD_ROM_FN(md_tecmosb2j) - -struct BurnDriver BurnDrvmd_tecmosb2j = { - "md_tecmosb2j", "md_tecmosb2", NULL, NULL, "1994", - "Tecmo Super Bowl II - Special Edition (Jpn)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmosb2jRomInfo, md_tecmosb2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super Bowl III - Final Edition (USA) -static struct BurnRomInfo md_tecmosb3RomDesc[] = { - { "tecmo super bowl iii - final edition (usa).bin", 0x200000, 0xaae4089f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmosb3) -STD_ROM_FN(md_tecmosb3) - -struct BurnDriver BurnDrvmd_tecmosb3 = { - "md_tecmosb3", NULL, NULL, NULL, "1995", - "Tecmo Super Bowl III - Final Edition (USA)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmosb3RomInfo, md_tecmosb3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super Hockey (USA) -static struct BurnRomInfo md_tecmohckRomDesc[] = { - { "tecmo super hockey (usa).bin", 0x100000, 0x5f86ddc9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmohck) -STD_ROM_FN(md_tecmohck) - -struct BurnDriver BurnDrvmd_tecmohck = { - "md_tecmohck", NULL, NULL, NULL, "1994", - "Tecmo Super Hockey (USA)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmohckRomInfo, md_tecmohckRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super NBA Basketball (USA) -static struct BurnRomInfo md_tecmonbaRomDesc[] = { - { "tecmo super nba basketball (usa).bin", 0x100000, 0x53913991, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmonba) -STD_ROM_FN(md_tecmonba) - -struct BurnDriver BurnDrvmd_tecmonba = { - "md_tecmonba", NULL, NULL, NULL, "1993", - "Tecmo Super NBA Basketball (USA)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmonbaRomInfo, md_tecmonbaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo Super NBA Basketball (Jpn) -static struct BurnRomInfo md_tecmonbajRomDesc[] = { - { "tecmo super nba basketball (jpn).bin", 0x100000, 0x79f33eb6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmonbaj) -STD_ROM_FN(md_tecmonbaj) - -struct BurnDriver BurnDrvmd_tecmonbaj = { - "md_tecmonbaj", "md_tecmonba", NULL, NULL, "1994", - "Tecmo Super NBA Basketball (Jpn)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tecmonbajRomInfo, md_tecmonbajRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo World Cup '92 (Jpn) -static struct BurnRomInfo md_tecmow92RomDesc[] = { - { "tecmo world cup '92 (jpn).bin", 0x040000, 0x5e93c8b0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmow92) -STD_ROM_FN(md_tecmow92) - -struct BurnDriver BurnDrvmd_tecmow92 = { - "md_tecmow92", NULL, NULL, NULL, "1992", - "Tecmo World Cup '92 (Jpn)\0", NULL, "Sims", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tecmow92RomInfo, md_tecmow92RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tecmo World Cup (USA) -static struct BurnRomInfo md_tecmowcRomDesc[] = { - { "tecmo world cup (usa).bin", 0x040000, 0xcaf8eb2c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tecmowc) -STD_ROM_FN(md_tecmowc) - -struct BurnDriver BurnDrvmd_tecmowc = { - "md_tecmowc", NULL, NULL, NULL, "1990", - "Tecmo World Cup (USA)\0", NULL, "Tecmo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tecmowcRomInfo, md_tecmowcRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Teddy Boy Blues (Jpn, SegaNet) -static struct BurnRomInfo md_teddyboyRomDesc[] = { - { "teddy boy blues (jpn) (sn).bin", 0x040000, 0x733d2eb3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_teddyboy) -STD_ROM_FN(md_teddyboy) - -struct BurnDriver BurnDrvmd_teddyboy = { - "md_teddyboy", NULL, NULL, NULL, "1991", - "Teddy Boy Blues (Jpn, SegaNet)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_teddyboyRomInfo, md_teddyboyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Teenage Mutant Hero Turtles - The Hyperstone Heist (Euro) -static struct BurnRomInfo md_tmhthhRomDesc[] = { - { "teenage mutant hero turtles - the hyperstone heist (euro).bin", 0x100000, 0x966d5286, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tmhthh) -STD_ROM_FN(md_tmhthh) - -struct BurnDriver BurnDrvmd_tmhthh = { - "md_tmhthh", NULL, NULL, NULL, "1992", - "Teenage Mutant Hero Turtles - The Hyperstone Heist (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tmhthhRomInfo, md_tmhthhRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Teenage Mutant Ninja Turtles - Return of the Shredder (Jpn) -static struct BurnRomInfo md_tmntshjRomDesc[] = { - { "teenage mutant ninja turtles - return of the shredder (jpn).bin", 0x100000, 0x1b003498, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tmntshj) -STD_ROM_FN(md_tmntshj) - -struct BurnDriver BurnDrvmd_tmntshj = { - "md_tmntshj", "md_tmhthh", NULL, NULL, "1992", - "Teenage Mutant Ninja Turtles - Return of the Shredder (Jpn)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tmntshjRomInfo, md_tmntshjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Teenage Mutant Ninja Turtles - The Hyperstone Heist (USA) -static struct BurnRomInfo md_tmnthhRomDesc[] = { - { "teenage mutant ninja turtles - the hyperstone heist (usa).bin", 0x100000, 0x679c41de, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tmnthh) -STD_ROM_FN(md_tmnthh) - -struct BurnDriver BurnDrvmd_tmnthh = { - "md_tmnthh", "md_tmhthh", NULL, NULL, "1992", - "Teenage Mutant Ninja Turtles - The Hyperstone Heist (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tmnthhRomInfo, md_tmnthhRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Teenage Mutant Hero Turtles - Tournament Fighters (Euro) -static struct BurnRomInfo md_tmhttfRomDesc[] = { - { "teenage mutant hero turtles - tournament fighters (euro).bin", 0x200000, 0x3cd2b7e6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tmhttf) -STD_ROM_FN(md_tmhttf) - -struct BurnDriver BurnDrvmd_tmhttf = { - "md_tmhttf", NULL, NULL, NULL, "1993", - "Teenage Mutant Hero Turtles - Tournament Fighters (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tmhttfRomInfo, md_tmhttfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Teenage Mutant Ninja Turtles - Tournament Fighters (Jpn) -static struct BurnRomInfo md_tmnttfjRomDesc[] = { - { "teenage mutant ninja turtles - tournament fighters (jpn).bin", 0x200000, 0x8843f2c9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tmnttfj) -STD_ROM_FN(md_tmnttfj) - -struct BurnDriver BurnDrvmd_tmnttfj = { - "md_tmnttfj", "md_tmhttf", NULL, NULL, "1993", - "Teenage Mutant Ninja Turtles - Tournament Fighters (Jpn)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tmnttfjRomInfo, md_tmnttfjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Teenage Mutant Ninja Turtles - Tournament Fighters (USA) -static struct BurnRomInfo md_tmnttfuRomDesc[] = { - { "teenage mutant ninja turtles - tournament fighters (usa).bin", 0x200000, 0x95b5484d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tmnttfu) -STD_ROM_FN(md_tmnttfu) - -struct BurnDriver BurnDrvmd_tmnttfu = { - "md_tmnttfu", "md_tmhttf", NULL, NULL, "1993", - "Teenage Mutant Ninja Turtles - Tournament Fighters (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tmnttfuRomInfo, md_tmnttfuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tekken 3 Special -static struct BurnRomInfo md_tekkn3spRomDesc[] = { - { "tekken 3 special (unl).bin", 0x200000, 0x7fcae658, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tekkn3sp) -STD_ROM_FN(md_tekkn3sp) - -struct BurnDriver BurnDrvmd_tekkn3sp = { - "md_tekkn3sp", NULL, NULL, NULL, "199?", - "Tekken 3 Special\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tekkn3spRomInfo, md_tekkn3spRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tel-Tel Mahjong (Jpn) -static struct BurnRomInfo md_telmahRomDesc[] = { - { "tel-tel mahjong (jpn).bin", 0x040000, 0x44817e92, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_telmah) -STD_ROM_FN(md_telmah) - -struct BurnDriver BurnDrvmd_telmah = { - "md_telmah", NULL, NULL, NULL, "1990", - "Tel-Tel Mahjong (Jpn)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_telmahRomInfo, md_telmahRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tel-Tel Stadium (Jpn) -static struct BurnRomInfo md_telstadRomDesc[] = { - { "md-tsd.bin", 0x080000, 0x54cf8c29, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_telstad) -STD_ROM_FN(md_telstad) - -struct BurnDriver BurnDrvmd_telstad = { - "md_telstad", NULL, NULL, NULL, "1990", - "Tel-Tel Stadium (Jpn)\0", NULL, "Sunsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_telstadRomInfo, md_telstadRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Telebradesco Residencia (Bra) -static struct BurnRomInfo md_telebradRomDesc[] = { - { "telebradesco residencia (bra).bin", 0x040000, 0x1db99045, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_telebrad) -STD_ROM_FN(md_telebrad) - -struct BurnDriver BurnDrvmd_telebrad = { - "md_telebrad", NULL, NULL, NULL, "199?", - "Telebradesco Residencia (Bra)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_telebradRomInfo, md_telebradRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Terminator (Euro) -static struct BurnRomInfo md_termintrRomDesc[] = { - { "mpr-14925.bin", 0x100000, 0x15f4d302, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_termintr) -STD_ROM_FN(md_termintr) - -struct BurnDriver BurnDrvmd_termintr = { - "md_termintr", NULL, NULL, NULL, "1991", - "The Terminator (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_termintrRomInfo, md_termintrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Terminator (USA) -static struct BurnRomInfo md_termintruRomDesc[] = { - { "terminator, the (usa).bin", 0x100000, 0x31a629be, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_termintru) -STD_ROM_FN(md_termintru) - -struct BurnDriver BurnDrvmd_termintru = { - "md_termintru", "md_termintr", NULL, NULL, "1991", - "The Terminator (USA)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_termintruRomInfo, md_termintruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Test Drive II - The Duel (Euro, USA) -static struct BurnRomInfo md_td2RomDesc[] = { - { "test drive ii - the duel (euro, usa).bin", 0x100000, 0xf9bdf8c5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_td2) -STD_ROM_FN(md_td2) - -struct BurnDriver BurnDrvmd_td2 = { - "md_td2", NULL, NULL, NULL, "1992", - "Test Drive II - The Duel (Euro, USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_td2RomInfo, md_td2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tetris (Jpn) -static struct BurnRomInfo md_tetrisRomDesc[] = { - { "mpr-12356+mpr-12357.bin", 0x040000, 0x4ce90db0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tetris) -STD_ROM_FN(md_tetris) - -struct BurnDriver BurnDrvmd_tetris = { - "md_tetris", NULL, NULL, NULL, "1989", - "Tetris (Jpn)\0", NULL, "Tetris", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tetrisRomInfo, md_tetrisRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Theme Park (Euro, USA) -static struct BurnRomInfo md_themeprkRomDesc[] = { - { "tpb10.bin", 0x200000, 0x289da2c5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_themeprk) -STD_ROM_FN(md_themeprk) - -struct BurnDriver BurnDrvmd_themeprk = { - "md_themeprk", NULL, NULL, NULL, "1995", - "Theme Park (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_themeprkRomInfo, md_themeprkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The New Zealand Story (Jpn) -static struct BurnRomInfo md_tnzsRomDesc[] = { - { "new zealand story, the (jpn).bin", 0x080000, 0x1c77ad21, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tnzs) -STD_ROM_FN(md_tnzs) - -struct BurnDriver BurnDrvmd_tnzs = { - "md_tnzs", NULL, NULL, NULL, "1990", - "The New Zealand Story (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tnzsRomInfo, md_tnzsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thomas the Tank Engine & Friends (USA) -static struct BurnRomInfo md_thomasRomDesc[] = { - { "thomas the tank engine & friends (usa).bin", 0x100000, 0x1a406299, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_thomas) -STD_ROM_FN(md_thomas) - -struct BurnDriver BurnDrvmd_thomas = { - "md_thomas", NULL, NULL, NULL, "1993", - "Thomas the Tank Engine & Friends (USA)\0", NULL, "THQ", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_thomasRomInfo, md_thomasRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thunder Force II MD (Jpn) -static struct BurnRomInfo md_tf2jRomDesc[] = { - { "thunder force ii md (jpn).bin", 0x080000, 0xe75ec3e0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tf2j) -STD_ROM_FN(md_tf2j) - -struct BurnDriver BurnDrvmd_tf2j = { - "md_tf2j", "md_tf2", NULL, NULL, "1989", - "Thunder Force II MD (Jpn)\0", NULL, "Technosoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tf2jRomInfo, md_tf2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thunder Force III (Jpn, USA) -static struct BurnRomInfo md_tf3RomDesc[] = { - { "thunder force iii (usa, jpn).bin", 0x080000, 0x1b3f399a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tf3) -STD_ROM_FN(md_tf3) - -struct BurnDriver BurnDrvmd_tf3 = { - "md_tf3", NULL, NULL, NULL, "1990", - "Thunder Force III (Jpn, USA)\0", NULL, "Technosoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tf3RomInfo, md_tf3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thunder Force IV (Euro) -static struct BurnRomInfo md_tf4RomDesc[] = { - { "mpr-15209.bin", 0x100000, 0xe7e3c05b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tf4) -STD_ROM_FN(md_tf4) - -struct BurnDriver BurnDrvmd_tf4 = { - "md_tf4", NULL, NULL, NULL, "1993", - "Thunder Force IV (Euro)\0", NULL, "Technosoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tf4RomInfo, md_tf4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thunder Force IV (Jpn) -static struct BurnRomInfo md_tf4jRomDesc[] = { - { "thunder force iv (jpn).bin", 0x100000, 0x8d606480, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tf4j) -STD_ROM_FN(md_tf4j) - -struct BurnDriver BurnDrvmd_tf4j = { - "md_tf4j", "md_tf4", NULL, NULL, "1992", - "Thunder Force IV (Jpn)\0", NULL, "Technosoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tf4jRomInfo, md_tf4jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lightening Force - Quest for the Darkstar (USA) -static struct BurnRomInfo md_lightforRomDesc[] = { - { "lightening force - quest for the darkstar (usa).bin", 0x100000, 0xc8f8c0e0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lightfor) -STD_ROM_FN(md_lightfor) - -struct BurnDriver BurnDrvmd_lightfor = { - "md_lightfor", "md_tf4", NULL, NULL, "1992", - "Lightening Force - Quest for the Darkstar (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lightforRomInfo, md_lightforRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thunder Fox (USA) -static struct BurnRomInfo md_tfoxRomDesc[] = { - { "thunder fox (usa).bin", 0x100000, 0x5463f50f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tfox) -STD_ROM_FN(md_tfox) - -struct BurnDriver BurnDrvmd_tfox = { - "md_tfox", NULL, NULL, NULL, "1991", - "Thunder Fox (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tfoxRomInfo, md_tfoxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thunder Fox (Jpn) -static struct BurnRomInfo md_tfoxjRomDesc[] = { - { "thunder fox (jpn).bin", 0x100000, 0xeca6cffa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tfoxj) -STD_ROM_FN(md_tfoxj) - -struct BurnDriver BurnDrvmd_tfoxj = { - "md_tfoxj", "md_tfox", NULL, NULL, "1991", - "Thunder Fox (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tfoxjRomInfo, md_tfoxjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thunder Pro Wrestling Retsuden (Jpn) -static struct BurnRomInfo md_tpwresRomDesc[] = { - { "mpr-14675.bin", 0x080000, 0x24408c73, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tpwres) -STD_ROM_FN(md_tpwres) - -struct BurnDriver BurnDrvmd_tpwres = { - "md_tpwres", NULL, NULL, NULL, "1992", - "Thunder Pro Wrestling Retsuden (Jpn)\0", NULL, "Human", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tpwresRomInfo, md_tpwresRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Tick (USA) -static struct BurnRomInfo md_tickRomDesc[] = { - { "tick, the (usa).bin", 0x200000, 0x425132f0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tick) -STD_ROM_FN(md_tick) - -struct BurnDriver BurnDrvmd_tick = { - "md_tick", NULL, NULL, NULL, "1994", - "The Tick (USA)\0", NULL, "Fox Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tickRomInfo, md_tickRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Time Killers (Euro) -static struct BurnRomInfo md_timekillRomDesc[] = { - { "time killers (euro).bin", 0x200000, 0xa4f48a1a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_timekill) -STD_ROM_FN(md_timekill) - -struct BurnDriver BurnDrvmd_timekill = { - "md_timekill", NULL, NULL, NULL, "1996", - "Time Killers (Euro)\0", NULL, "Black Pearl", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_timekillRomInfo, md_timekillRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Time Killers (USA) -static struct BurnRomInfo md_timekilluRomDesc[] = { - { "time killers (usa).bin", 0x200000, 0x4b5f52ac, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_timekillu) -STD_ROM_FN(md_timekillu) - -struct BurnDriver BurnDrvmd_timekillu = { - "md_timekillu", "md_timekill", NULL, NULL, "1996", - "Time Killers (USA)\0", NULL, "Black Pearl", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_timekilluRomInfo, md_timekilluRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// TinHead (USA) -static struct BurnRomInfo md_tinheadRomDesc[] = { - { "tinhead (usa).bin", 0x100000, 0xd6724b84, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tinhead) -STD_ROM_FN(md_tinhead) - -struct BurnDriver BurnDrvmd_tinhead = { - "md_tinhead", NULL, NULL, NULL, "1993", - "TinHead (USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tinheadRomInfo, md_tinheadRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tintin au Tibet (Euro) -static struct BurnRomInfo md_tintinRomDesc[] = { - { "tintin au tibet (euro).bin", 0x200000, 0x4243caf3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tintin) -STD_ROM_FN(md_tintin) - -struct BurnDriver BurnDrvmd_tintin = { - "md_tintin", NULL, NULL, NULL, "1995", - "Tintin au Tibet (Euro)\0", NULL, "Infogrames", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tintinRomInfo, md_tintinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tiny Toon Adventures - Acme All-Stars (Euro) -static struct BurnRomInfo md_ttacmeRomDesc[] = { - { "mpr-17066.bin", 0x100000, 0x1227b2b2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ttacme) -STD_ROM_FN(md_ttacme) - -struct BurnDriver BurnDrvmd_ttacme = { - "md_ttacme", NULL, NULL, NULL, "1994", - "Tiny Toon Adventures - Acme All-Stars (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ttacmeRomInfo, md_ttacmeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tiny Toon Adventures - Acme All-Stars (USA, Kor) -static struct BurnRomInfo md_ttacmeuRomDesc[] = { - { "tiny toon adventures - acme all-stars (usa, kor).bin", 0x100000, 0x2f9faa1d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ttacmeu) -STD_ROM_FN(md_ttacmeu) - -struct BurnDriver BurnDrvmd_ttacmeu = { - "md_ttacmeu", "md_ttacme", NULL, NULL, "1994", - "Tiny Toon Adventures - Acme All-Stars (USA, Kor)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ttacmeuRomInfo, md_ttacmeuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tiny Toon Adventures - Buster's Hidden Treasure (Euro) -static struct BurnRomInfo md_ttoonbhtRomDesc[] = { - { "mpr-15406.bin", 0x080000, 0xd10fba51, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ttoonbht) -STD_ROM_FN(md_ttoonbht) - -struct BurnDriver BurnDrvmd_ttoonbht = { - "md_ttoonbht", NULL, NULL, NULL, "1993", - "Tiny Toon Adventures - Buster's Hidden Treasure (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ttoonbhtRomInfo, md_ttoonbhtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tiny Toon Adventures (Kor) -static struct BurnRomInfo md_ttoonbhtkRomDesc[] = { - { "tiny toon adventures (kor).bin", 0x080000, 0x4ca3a8fb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ttoonbhtk) -STD_ROM_FN(md_ttoonbhtk) - -struct BurnDriver BurnDrvmd_ttoonbhtk = { - "md_ttoonbhtk", "md_ttoonbht", NULL, NULL, "1993", - "Tiny Toon Adventures (Kor)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ttoonbhtkRomInfo, md_ttoonbhtkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tiny Toon Adventures - Buster's Hidden Treasure (USA) -static struct BurnRomInfo md_ttoonbhtuRomDesc[] = { - { "tiny toon adventures - buster's hidden treasure (usa).bin", 0x080000, 0xa26d3ae0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ttoonbhtu) -STD_ROM_FN(md_ttoonbhtu) - -struct BurnDriver BurnDrvmd_ttoonbhtu = { - "md_ttoonbhtu", "md_ttoonbht", NULL, NULL, "1993", - "Tiny Toon Adventures - Buster's Hidden Treasure (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ttoonbhtuRomInfo, md_ttoonbhtuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// TNN Bass Tournament of Champions (USA) -static struct BurnRomInfo md_tnnbassRomDesc[] = { - { "tnn bass tournament of champions (usa).bin", 0x100000, 0xc83ffa1b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tnnbass) -STD_ROM_FN(md_tnnbass) - -struct BurnDriver BurnDrvmd_tnnbass = { - "md_tnnbass", NULL, NULL, NULL, "1993", - "TNN Bass Tournament of Champions (USA)\0", NULL, "American Softworks", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tnnbassRomInfo, md_tnnbassRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// TNN Outdoors Bass Tournament '96 (USA) -static struct BurnRomInfo md_tnnoutRomDesc[] = { - { "tnn outdoors bass tournament '96 (usa).bin", 0x200000, 0x5c523c0b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tnnout) -STD_ROM_FN(md_tnnout) - -struct BurnDriver BurnDrvmd_tnnout = { - "md_tnnout", NULL, NULL, NULL, "1996", - "TNN Outdoors Bass Tournament '96 (USA)\0", NULL, "American Softworks", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tnnoutRomInfo, md_tnnoutRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Todd's Adventures in Slime World (USA) -static struct BurnRomInfo md_slimewRomDesc[] = { - { "todd's adventures in slime world (usa).bin", 0x080000, 0x652e8b7d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_slimew) -STD_ROM_FN(md_slimew) - -struct BurnDriver BurnDrvmd_slimew = { - "md_slimew", NULL, NULL, NULL, "1991", - "Todd's Adventures in Slime World (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_slimewRomInfo, md_slimewRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Slime World (Jpn) -static struct BurnRomInfo md_slimewjRomDesc[] = { - { "slime world (jpn).bin", 0x080000, 0x7ff5529f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_slimewj) -STD_ROM_FN(md_slimewj) - -struct BurnDriver BurnDrvmd_slimewj = { - "md_slimewj", "md_slimew", NULL, NULL, "1992", - "Slime World (Jpn)\0", NULL, "Micro World", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_slimewjRomInfo, md_slimewjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toe Jam & Earl (World, Rev. A) -static struct BurnRomInfo md_toejamRomDesc[] = { - { "mpr-14236a.bin", 0x100000, 0x7a588f4b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toejam) -STD_ROM_FN(md_toejam) - -struct BurnDriver BurnDrvmd_toejam = { - "md_toejam", NULL, NULL, NULL, "1992", - "Toe Jam & Earl (World, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toejamRomInfo, md_toejamRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toe Jam & Earl (World) -static struct BurnRomInfo md_toejamaRomDesc[] = { - { "toe jam & earl (world).bin", 0x100000, 0xd1b36786, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toejama) -STD_ROM_FN(md_toejama) - -struct BurnDriver BurnDrvmd_toejama = { - "md_toejama", "md_toejam", NULL, NULL, "1992", - "Toe Jam & Earl (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toejamaRomInfo, md_toejamaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toe Jam & Earl in Panic on Funkotron (Euro) -static struct BurnRomInfo md_toejam2RomDesc[] = { - { "mpr-16179.bin", 0x200000, 0x47b0a871, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toejam2) -STD_ROM_FN(md_toejam2) - -struct BurnDriver BurnDrvmd_toejam2 = { - "md_toejam2", NULL, NULL, NULL, "1993", - "Toe Jam & Earl in Panic on Funkotron (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toejam2RomInfo, md_toejam2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toe Jam & Earl in Panic auf Funkotron (Ger) -static struct BurnRomInfo md_toejam2gRomDesc[] = { - { "toe jam & earl in panic auf funkotron (germany).bin", 0x200000, 0x4081b9f2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toejam2g) -STD_ROM_FN(md_toejam2g) - -struct BurnDriver BurnDrvmd_toejam2g = { - "md_toejam2g", "md_toejam2", NULL, NULL, "1993", - "Toe Jam & Earl in Panic auf Funkotron (Ger)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toejam2gRomInfo, md_toejam2gRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toe Jam & Earl in Panic on Funkotron (Jpn) -static struct BurnRomInfo md_toejam2jRomDesc[] = { - { "toe jam & earl in panic on funkotron (jpn).bin", 0x200000, 0xe1b36850, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toejam2j) -STD_ROM_FN(md_toejam2j) - -struct BurnDriver BurnDrvmd_toejam2j = { - "md_toejam2j", "md_toejam2", NULL, NULL, "1993", - "Toe Jam & Earl in Panic on Funkotron (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toejam2jRomInfo, md_toejam2jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toe Jam & Earl in Panic on Funkotron (USA) -static struct BurnRomInfo md_toejam2uRomDesc[] = { - { "toe jam & earl in panic on funkotron (usa).bin", 0x200000, 0xaa021bdd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toejam2u) -STD_ROM_FN(md_toejam2u) - -struct BurnDriver BurnDrvmd_toejam2u = { - "md_toejam2u", "md_toejam2", NULL, NULL, "1993", - "Toe Jam & Earl in Panic on Funkotron (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toejam2uRomInfo, md_toejam2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toki - Going Ape Spit ~ JuJu Densetsu (World, Rev. A) -static struct BurnRomInfo md_tokiRomDesc[] = { - { "mpr-14464a.bin", 0x080000, 0x7362c3f4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toki) -STD_ROM_FN(md_toki) - -struct BurnDriver BurnDrvmd_toki = { - "md_toki", NULL, NULL, NULL, "1991", - "Toki - Going Ape Spit ~ JuJu Densetsu (World, Rev. A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tokiRomInfo, md_tokiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toki - Going Ape Spit ~ JuJu Densetsu (World) -static struct BurnRomInfo md_toki1RomDesc[] = { - { "toki - going ape spit -- juju densetsu (world).bin", 0x080000, 0xd09b1ef1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toki1) -STD_ROM_FN(md_toki1) - -struct BurnDriver BurnDrvmd_toki1 = { - "md_toki1", "md_toki", NULL, NULL, "1991", - "Toki - Going Ape Spit ~ JuJu Densetsu (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toki1RomInfo, md_toki1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tom and Jerry - Frantic Antics (USA, 1993) -static struct BurnRomInfo md_tomjerryRomDesc[] = { - { "tom and jerry - frantic antics (usa) (1993).bin", 0x100000, 0xb9992e1c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tomjerry) -STD_ROM_FN(md_tomjerry) - -struct BurnDriver BurnDrvmd_tomjerry = { - "md_tomjerry", NULL, NULL, NULL, "1993", - "Tom and Jerry - Frantic Antics (USA, 1993)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tomjerryRomInfo, md_tomjerryRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tom and Jerry - Frantic Antics (USA, 1994) -static struct BurnRomInfo md_tomjerry1RomDesc[] = { - { "tom and jerry - frantic antics (usa) (1994).bin", 0x100000, 0x3044460c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tomjerry1) -STD_ROM_FN(md_tomjerry1) - -struct BurnDriver BurnDrvmd_tomjerry1 = { - "md_tomjerry1", "md_tomjerry", NULL, NULL, "1994", - "Tom and Jerry - Frantic Antics (USA, 1994)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tomjerry1RomInfo, md_tomjerry1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tony La Russa Baseball (USA, Oceania) -static struct BurnRomInfo md_larussaRomDesc[] = { - { "tony la russa baseball (usa, aus).bin", 0x100000, 0x24629c78, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_larussa) -STD_ROM_FN(md_larussa) - -struct BurnDriver BurnDrvmd_larussa = { - "md_larussa", NULL, NULL, NULL, "1993", - "Tony La Russa Baseball (USA, Oceania)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_larussaRomInfo, md_larussaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Top Gear 2 (USA) -static struct BurnRomInfo md_topgear2RomDesc[] = { - { "top gear 2 (usa).bin", 0x100000, 0xbd3074d2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_topgear2) -STD_ROM_FN(md_topgear2) - -struct BurnDriver BurnDrvmd_topgear2 = { - "md_topgear2", NULL, NULL, NULL, "1994", - "Top Gear 2 (USA)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_topgear2RomInfo, md_topgear2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Top Pro Golf (Jpn) -static struct BurnRomInfo md_topgolfRomDesc[] = { - { "mpr-14853.bin", 0x100000, 0x62bad606, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_topgolf) -STD_ROM_FN(md_topgolf) - -struct BurnDriver BurnDrvmd_topgolf = { - "md_topgolf", NULL, NULL, NULL, "1992", - "Top Pro Golf (Jpn)\0", NULL, "Soft Vision", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_topgolfRomInfo, md_topgolfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Top Pro Golf 2 (Jpn) -static struct BurnRomInfo md_topgolf2RomDesc[] = { - { "top pro golf 2 (jpn).bin", 0x100000, 0xb8ce98b3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_topgolf2) -STD_ROM_FN(md_topgolf2) - -struct BurnDriver BurnDrvmd_topgolf2 = { - "md_topgolf2", "md_chichi", NULL, NULL, "1993", - "Top Pro Golf 2 (Jpn)\0", NULL, "Soft Vision International", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_topgolf2RomInfo, md_topgolf2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Total Football (Euro) -static struct BurnRomInfo md_totlfootRomDesc[] = { - { "total football (euro).bin", 0x200000, 0x8360b66a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_totlfoot) -STD_ROM_FN(md_totlfoot) - -struct BurnDriver BurnDrvmd_totlfoot = { - "md_totlfoot", NULL, NULL, NULL, "1995", - "Total Football (Euro)\0", NULL, "Domark", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_totlfootRomInfo, md_totlfootRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toughman Contest (Euro, USA) -static struct BurnRomInfo md_toughmanRomDesc[] = { - { "toughman contest (euro, usa).bin", 0x400000, 0xe19fbc93, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toughman) -STD_ROM_FN(md_toughman) - -struct BurnDriver BurnDrvmd_toughman = { - "md_toughman", NULL, NULL, NULL, "1995", - "Toughman Contest (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toughmanRomInfo, md_toughmanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toxic Crusaders (USA) -static struct BurnRomInfo md_toxiccRomDesc[] = { - { "toxic crusaders (usa).bin", 0x080000, 0x11fd46ce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toxicc) -STD_ROM_FN(md_toxicc) - -struct BurnDriver BurnDrvmd_toxicc = { - "md_toxicc", NULL, NULL, NULL, "1992", - "Toxic Crusaders (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toxiccRomInfo, md_toxiccRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toy Story (Euro) -static struct BurnRomInfo md_toystoryRomDesc[] = { - { "mpr-18848.bin", 0x400000, 0x8e89a9f3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toystory) -STD_ROM_FN(md_toystory) - -struct BurnDriver BurnDrvmd_toystory = { - "md_toystory", NULL, NULL, NULL, "1996", - "Toy Story (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toystoryRomInfo, md_toystoryRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toy Story (USA) -static struct BurnRomInfo md_toystoryuRomDesc[] = { - { "toy story (usa).bin", 0x400000, 0x829fe313, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toystoryu) -STD_ROM_FN(md_toystoryu) - -struct BurnDriver BurnDrvmd_toystoryu = { - "md_toystoryu", "md_toystory", NULL, NULL, "1996", - "Toy Story (USA)\0", NULL, "Disney Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toystoryuRomInfo, md_toystoryuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Toys (USA) -static struct BurnRomInfo md_toysRomDesc[] = { - { "mpr-15574.bin", 0x100000, 0xcbc9951b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toys) -STD_ROM_FN(md_toys) - -struct BurnDriver BurnDrvmd_toys = { - "md_toys", NULL, NULL, NULL, "1993", - "Toys (USA)\0", NULL, "Absolute Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toysRomInfo, md_toysRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Trampoline Terror! (USA) -static struct BurnRomInfo md_trampterRomDesc[] = { - { "trampoline terror! (usa).bin", 0x040000, 0xaabb349f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_trampter) -STD_ROM_FN(md_trampter) - -struct BurnDriver BurnDrvmd_trampter = { - "md_trampter", NULL, NULL, NULL, "1990", - "Trampoline Terror! (USA)\0", NULL, "Dreamworks", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_trampterRomInfo, md_trampterRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Traysia (USA) -static struct BurnRomInfo md_traysiaRomDesc[] = { - { "traysia (usa).bin", 0x100000, 0x96184f4f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_traysia) -STD_ROM_FN(md_traysia) - -struct BurnDriver BurnDrvmd_traysia = { - "md_traysia", NULL, NULL, NULL, "1992", - "Traysia (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_traysiaRomInfo, md_traysiaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Minato no Traysia (Jpn) -static struct BurnRomInfo md_traysiajRomDesc[] = { - { "minato no traysia (jpn).bin", 0x100000, 0xbd89fd09, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_traysiaj) -STD_ROM_FN(md_traysiaj) - -struct BurnDriver BurnDrvmd_traysiaj = { - "md_traysiaj", "md_traysia", NULL, NULL, "1992", - "Minato no Traysia (Jpn)\0", NULL, "Riot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_traysiajRomInfo, md_traysiajRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Triple Play '96 (USA) -static struct BurnRomInfo md_tplay96RomDesc[] = { - { "triple play '96 (usa).bin", 0x400000, 0xf1748e91, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tplay96) -STD_ROM_FN(md_tplay96) - -struct BurnDriver BurnDrvmd_tplay96 = { - "md_tplay96", NULL, NULL, NULL, "1995", - "Triple Play '96 (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tplay96RomInfo, md_tplay96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Triple Play Gold (USA) -static struct BurnRomInfo md_tplaygldRomDesc[] = { - { "triple play gold (usa).bin", 0x400000, 0xbbe69017, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tplaygld) -STD_ROM_FN(md_tplaygld) - -struct BurnDriver BurnDrvmd_tplaygld = { - "md_tplaygld", NULL, NULL, NULL, "1996", - "Triple Play Gold (USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tplaygldRomInfo, md_tplaygldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Triple Play Gold (USA, Alt) -static struct BurnRomInfo md_tplaygldaRomDesc[] = { - { "triple play gold (usa) (alt).bin", 0x400000, 0xa89638a0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tplayglda) -STD_ROM_FN(md_tplayglda) - -struct BurnDriver BurnDrvmd_tplayglda = { - "md_tplayglda", "md_tplaygld", NULL, NULL, "1995", - "Triple Play Gold (USA, Alt)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_tplaygldaRomInfo, md_tplaygldaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Trouble Shooter (USA) -static struct BurnRomInfo md_troubshtRomDesc[] = { - { "trouble shooter (usa).bin", 0x080000, 0xbecfc39b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_troubsht) -STD_ROM_FN(md_troubsht) - -struct BurnDriver BurnDrvmd_troubsht = { - "md_troubsht", NULL, NULL, NULL, "1991", - "Trouble Shooter (USA)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_troubshtRomInfo, md_troubshtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Battle Mania (Jpn) -static struct BurnRomInfo md_btlmaniaRomDesc[] = { - { "battle mania (jpn).bin", 0x080000, 0xa76c4a29, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_btlmania) -STD_ROM_FN(md_btlmania) - -struct BurnDriver BurnDrvmd_btlmania = { - "md_btlmania", "md_troubsht", NULL, NULL, "1992", - "Battle Mania (Jpn)\0", NULL, "Vic Tokai", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_btlmaniaRomInfo, md_btlmaniaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Troy Aikman NFL Football (USA) -static struct BurnRomInfo md_troyaikRomDesc[] = { - { "troy aikman nfl football (usa).bin", 0x200000, 0x015f2713, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_troyaik) -STD_ROM_FN(md_troyaik) - -struct BurnDriver BurnDrvmd_troyaik = { - "md_troyaik", NULL, NULL, NULL, "1994", - "Troy Aikman NFL Football (USA)\0", NULL, "Tradewest", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_troyaikRomInfo, md_troyaikRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// True Lies (World) -static struct BurnRomInfo md_trueliesRomDesc[] = { - { "true lies (world).bin", 0x200000, 0x18c09468, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_truelies) -STD_ROM_FN(md_truelies) - -struct BurnDriver BurnDrvmd_truelies = { - "md_truelies", NULL, NULL, NULL, "1995", - "True Lies (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_trueliesRomInfo, md_trueliesRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tun Shi Tian Di III (China, Simple Chinese) -static struct BurnRomInfo md_tunshiRomDesc[] = { - { "tun shi tian di iii (chi) (simple chinese) (unl).bin", 0x200000, 0xea57b668, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tunshi) -STD_ROM_FN(md_tunshi) - -struct BurnDriver BurnDrvmd_tunshi = { - "md_tunshi", NULL, NULL, NULL, "199?", - "Tun Shi Tian Di III (China, Simple Chinese)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tunshiRomInfo, md_tunshiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tun Shi Tian Di III (Chi) -static struct BurnRomInfo md_tunshi1RomDesc[] = { - { "tun shi tian di iii (chi) (unl).bin", 0x200000, 0xb23c4166, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tunshi1) -STD_ROM_FN(md_tunshi1) - -struct BurnDriver BurnDrvmd_tunshi1 = { - "md_tunshi1", "md_tunshi", NULL, NULL, "199?", - "Tun Shi Tian Di III (Chi)\0", NULL, "SKOB", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tunshi1RomInfo, md_tunshi1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Turbo OutRun (Euro, Jpn) -static struct BurnRomInfo md_toutrunRomDesc[] = { - { "turbo outrun (euro, jpn).bin", 0x080000, 0x0c661369, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_toutrun) -STD_ROM_FN(md_toutrun) - -struct BurnDriver BurnDrvmd_toutrun = { - "md_toutrun", NULL, NULL, NULL, "1992", - "Turbo OutRun (Euro, Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_toutrunRomInfo, md_toutrunRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Turrican (Euro, USA) -static struct BurnRomInfo md_turricanRomDesc[] = { - { "turrican (euro, usa).bin", 0x080000, 0x634d67a6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_turrican) -STD_ROM_FN(md_turrican) - -struct BurnDriver BurnDrvmd_turrican = { - "md_turrican", NULL, NULL, NULL, "1991", - "Turrican (Euro, USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_turricanRomInfo, md_turricanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Twin Cobra (USA) -static struct BurnRomInfo md_twincobrRomDesc[] = { - { "twin cobra (usa).bin", 0x0a0000, 0x2c708248, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_twincobr) -STD_ROM_FN(md_twincobr) - -struct BurnDriver BurnDrvmd_twincobr = { - "md_twincobr", NULL, NULL, NULL, "1991", - "Twin Cobra (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_twincobrRomInfo, md_twincobrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kyuukyoku Tiger (Jpn) -static struct BurnRomInfo md_ktigerRomDesc[] = { - { "kyuukyoku tiger (jpn).bin", 0x0a0000, 0x61276d21, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ktiger) -STD_ROM_FN(md_ktiger) - -struct BurnDriver BurnDrvmd_ktiger = { - "md_ktiger", "md_twincobr", NULL, NULL, "1991", - "Kyuukyoku Tiger (Jpn)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ktigerRomInfo, md_ktigerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Twinkle Tale (Jpn) -static struct BurnRomInfo md_twinkletRomDesc[] = { - { "twinkle tale (jpn).bin", 0x100000, 0xd757f924, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_twinklet) -STD_ROM_FN(md_twinklet) - -struct BurnDriver BurnDrvmd_twinklet = { - "md_twinklet", NULL, NULL, NULL, "1992", - "Twinkle Tale (Jpn)\0", NULL, "Toyo Records", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_twinkletRomInfo, md_twinkletRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Twin Hawk (Euro) ~ Daisenpuu (Jpn) -static struct BurnRomInfo md_twinhawkRomDesc[] = { - { "twin hawk -- daisenpuu (euro, jpn).bin", 0x080000, 0xa2ec8c67, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_twinhawk) -STD_ROM_FN(md_twinhawk) - -struct BurnDriver BurnDrvmd_twinhawk = { - "md_twinhawk", NULL, NULL, NULL, "1990", - "Twin Hawk (Euro) ~ Daisenpuu (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_twinhawkRomInfo, md_twinhawkRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Two Crude Dudes (Euro) -static struct BurnRomInfo md_twocrudeRomDesc[] = { - { "two crude dudes (euro).bin", 0x100000, 0xb6d90a10, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_twocrude) -STD_ROM_FN(md_twocrude) - -struct BurnDriver BurnDrvmd_twocrude = { - "md_twocrude", NULL, NULL, NULL, "1992", - "Two Crude Dudes (Euro)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_twocrudeRomInfo, md_twocrudeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Two Crude Dudes (USA) -static struct BurnRomInfo md_twocrudeuRomDesc[] = { - { "two crude dudes (usa).bin", 0x100000, 0x721b5744, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_twocrudeu) -STD_ROM_FN(md_twocrudeu) - -struct BurnDriver BurnDrvmd_twocrudeu = { - "md_twocrudeu", "md_twocrude", NULL, NULL, "1992", - "Two Crude Dudes (USA)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_twocrudeuRomInfo, md_twocrudeuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crude Buster (Jpn) -static struct BurnRomInfo md_crudebRomDesc[] = { - { "crude buster (jpn).bin", 0x100000, 0xaffb4b00, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crudeb) -STD_ROM_FN(md_crudeb) - -struct BurnDriver BurnDrvmd_crudeb = { - "md_crudeb", "md_twocrude", NULL, NULL, "1992", - "Crude Buster (Jpn)\0", NULL, "Data East", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crudebRomInfo, md_crudebRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Two Tribes - Populous II (Euro) -static struct BurnRomInfo md_twotribeRomDesc[] = { - { "mpr-15652.bin", 0x100000, 0xee988bd9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_twotribe) -STD_ROM_FN(md_twotribe) - -struct BurnDriver BurnDrvmd_twotribe = { - "md_twotribe", NULL, NULL, NULL, "1993", - "Two Tribes - Populous II (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_twotribeRomInfo, md_twotribeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ultimate Mortal Kombat 3 (Euro) -static struct BurnRomInfo md_umk3RomDesc[] = { - { "pal_ultimate_mk3.bin", 0x400000, 0xecfb5cb4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_umk3) -STD_ROM_FN(md_umk3) - -struct BurnDriver BurnDrvmd_umk3 = { - "md_umk3", NULL, NULL, NULL, "1996", - "Ultimate Mortal Kombat 3 (Euro)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_umk3RomInfo, md_umk3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ultimate Mortal Kombat 3 (USA) -static struct BurnRomInfo md_umk3uRomDesc[] = { - { "ultimate mortal kombat 3 (usa).bin", 0x400000, 0x7290770d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_umk3u) -STD_ROM_FN(md_umk3u) - -struct BurnDriver BurnDrvmd_umk3u = { - "md_umk3u", "md_umk3", NULL, NULL, "1996", - "Ultimate Mortal Kombat 3 (USA)\0", NULL, "Williams", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_umk3uRomInfo, md_umk3uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ultimate Qix (USA) -static struct BurnRomInfo md_ultqixRomDesc[] = { - { "ultimate qix (usa).bin", 0x040000, 0xd83369d9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ultqix) -STD_ROM_FN(md_ultqix) - -struct BurnDriver BurnDrvmd_ultqix = { - "md_ultqix", NULL, NULL, NULL, "1991", - "Ultimate Qix (USA)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ultqixRomInfo, md_ultqixRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Volfied (Jpn) -static struct BurnRomInfo md_volfiedRomDesc[] = { - { "volfied (jpn).bin", 0x040000, 0xb0c5e3f7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_volfied) -STD_ROM_FN(md_volfied) - -struct BurnDriver BurnDrvmd_volfied = { - "md_volfied", "md_ultqix", NULL, NULL, "1991", - "Volfied (Jpn)\0", NULL, "Taito", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_volfiedRomInfo, md_volfiedRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ultimate Soccer (Euro) -static struct BurnRomInfo md_ultsoccrRomDesc[] = { - { "mpr-15819.bin", 0x100000, 0x83db6e58, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ultsoccr) -STD_ROM_FN(md_ultsoccr) - -struct BurnDriver BurnDrvmd_ultsoccr = { - "md_ultsoccr", NULL, NULL, NULL, "1993", - "Ultimate Soccer (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ultsoccrRomInfo, md_ultsoccrRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ultraman (Jpn) -static struct BurnRomInfo md_ultramanRomDesc[] = { - { "ultraman (jpn).bin", 0x080000, 0x83b4d5fb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ultraman) -STD_ROM_FN(md_ultraman) - -struct BurnDriver BurnDrvmd_ultraman = { - "md_ultraman", NULL, NULL, NULL, "1993", - "Ultraman (Jpn)\0", NULL, "Ma-Ba", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ultramanRomInfo, md_ultramanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Uncharted Waters (USA) -static struct BurnRomInfo md_unchartdRomDesc[] = { - { "uncharted waters (usa).bin", 0x100000, 0x4edaec59, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_unchartd) -STD_ROM_FN(md_unchartd) - -struct BurnDriver BurnDrvmd_unchartd = { - "md_unchartd", NULL, NULL, NULL, "1992", - "Uncharted Waters (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_unchartdRomInfo, md_unchartdRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Daikoukai Jidai (Jpn) -static struct BurnRomInfo md_daikokaiRomDesc[] = { - { "daikoukai jidai (jpn).bin", 0x100000, 0x5a652458, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_daikokai) -STD_ROM_FN(md_daikokai) - -struct BurnDriver BurnDrvmd_daikokai = { - "md_daikokai", "md_unchartd", NULL, NULL, "1992", - "Daikoukai Jidai (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_daikokaiRomInfo, md_daikokaiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// New Horizons (USA) -static struct BurnRomInfo md_newhorizRomDesc[] = { - { "uncharted waters - new horizons (usa).bin", 0x200000, 0xead69824, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_newhoriz) -STD_ROM_FN(md_newhoriz) - -struct BurnDriver BurnDrvmd_newhoriz = { - "md_newhoriz", NULL, NULL, NULL, "1994", - "New Horizons (USA)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_newhorizRomInfo, md_newhorizRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Daikoukai Jidai II (Jpn) -static struct BurnRomInfo md_daikok2RomDesc[] = { - { "daikoukai jidai ii (jpn).bin", 0x200000, 0xe040f0da, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_daikok2) -STD_ROM_FN(md_daikok2) - -struct BurnDriver BurnDrvmd_daikok2 = { - "md_daikok2", "md_newhoriz", NULL, NULL, "1994", - "Daikoukai Jidai II (Jpn)\0", NULL, "Koei", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_daikok2RomInfo, md_daikok2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Undead Line (Jpn) -static struct BurnRomInfo md_undeadRomDesc[] = { - { "undead line (jpn).bin", 0x100000, 0xfb3ca1e6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_undead) -STD_ROM_FN(md_undead) - -struct BurnDriver BurnDrvmd_undead = { - "md_undead", NULL, NULL, NULL, "1991", - "Undead Line (Jpn)\0", NULL, "Palsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_undeadRomInfo, md_undeadRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Universal Soldier (Euro, USA) -static struct BurnRomInfo md_univsoldRomDesc[] = { - { "universal soldier (euro, usa).bin", 0x100000, 0x352ebd49, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_univsold) -STD_ROM_FN(md_univsold) - -struct BurnDriver BurnDrvmd_univsold = { - "md_univsold", NULL, NULL, NULL, "1992", - "Universal Soldier (Euro, USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_univsoldRomInfo, md_univsoldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Unnecessary Roughness 95 (USA) -static struct BurnRomInfo md_unnecessRomDesc[] = { - { "unnecessary roughness 95 (usa).bin", 0x200000, 0x9920e7b7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_unnecess) -STD_ROM_FN(md_unnecess) - -struct BurnDriver BurnDrvmd_unnecess = { - "md_unnecess", NULL, NULL, NULL, "1994", - "Unnecessary Roughness 95 (USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_unnecessRomInfo, md_unnecessRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Urban Strike (Euro, USA) -static struct BurnRomInfo md_ustrikeRomDesc[] = { - { "urban strike (euro, usa).bin", 0x200000, 0xcf690a75, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ustrike) -STD_ROM_FN(md_ustrike) - -struct BurnDriver BurnDrvmd_ustrike = { - "md_ustrike", NULL, NULL, NULL, "1994", - "Urban Strike (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ustrikeRomInfo, md_ustrikeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Uzu Keobukseon (Kor) -static struct BurnRomInfo md_uzukeoRomDesc[] = { - { "uzu keobukseon (kor).bin", 0x080000, 0xa7255ba8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_uzukeo) -STD_ROM_FN(md_uzukeo) - -struct BurnDriver BurnDrvmd_uzukeo = { - "md_uzukeo", NULL, NULL, NULL, "199?", - "Uzu Keobukseon (Kor)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_uzukeoRomInfo, md_uzukeoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Valis (USA) -static struct BurnRomInfo md_valisRomDesc[] = { - { "valis (usa).bin", 0x100000, 0x13bc5b72, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_valis) -STD_ROM_FN(md_valis) - -struct BurnDriver BurnDrvmd_valis = { - "md_valis", NULL, NULL, NULL, "1991", - "Valis (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_valisRomInfo, md_valisRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mugen Senshi Valis (Jpn) -static struct BurnRomInfo md_valisjRomDesc[] = { - { "mugen senshi valis (jpn).bin", 0x100000, 0x24431625, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_valisj) -STD_ROM_FN(md_valisj) - -struct BurnDriver BurnDrvmd_valisj = { - "md_valisj", "md_valis", NULL, NULL, "1991", - "Mugen Senshi Valis (Jpn)\0", NULL, "Riot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_valisjRomInfo, md_valisjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Valis III (USA) -static struct BurnRomInfo md_valis3RomDesc[] = { - { "valis iii (usa).bin", 0x100000, 0x59a2a368, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_valis3) -STD_ROM_FN(md_valis3) - -struct BurnDriver BurnDrvmd_valis3 = { - "md_valis3", NULL, NULL, NULL, "1991", - "Valis III (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_valis3RomInfo, md_valis3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Valis III (Jpn, Rev. A) -static struct BurnRomInfo md_valis3jRomDesc[] = { - { "valis iii (jpn) (rev a).bin", 0x100000, 0x4d49a166, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_valis3j) -STD_ROM_FN(md_valis3j) - -struct BurnDriver BurnDrvmd_valis3j = { - "md_valis3j", "md_valis3", NULL, NULL, "1991", - "Valis III (Jpn, Rev. A)\0", NULL, "Reno", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_valis3jRomInfo, md_valis3jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vapor Trail (USA) -static struct BurnRomInfo md_vaportrRomDesc[] = { - { "vapor trail (usa).bin", 0x100000, 0xc49e3a0a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vaportr) -STD_ROM_FN(md_vaportr) - -struct BurnDriver BurnDrvmd_vaportr = { - "md_vaportr", NULL, NULL, NULL, "1991", - "Vapor Trail (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vaportrRomInfo, md_vaportrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kuuga - Operation Code "Vapor Trail" (Jpn) -static struct BurnRomInfo md_kuugaRomDesc[] = { - { "kuuga - operation code 'vapor trail' (jpn).bin", 0x100000, 0x83b6b6ba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kuuga) -STD_ROM_FN(md_kuuga) - -struct BurnDriver BurnDrvmd_kuuga = { - "md_kuuga", "md_vaportr", NULL, NULL, "1991", - "Kuuga - Operation Code 'Vapor Trail' (Jpn)\0", NULL, "Riot", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kuugaRomInfo, md_kuugaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman (Euro, USA) -static struct BurnRomInfo md_vecmanRomDesc[] = { - { "vectorman (euro, usa).bin", 0x200000, 0xd38b3354, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecman) -STD_ROM_FN(md_vecman) - -struct BurnDriver BurnDrvmd_vecman = { - "md_vecman", NULL, NULL, NULL, "1995", - "Vectorman (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecmanRomInfo, md_vecmanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman (Prototype) -static struct BurnRomInfo md_vecmanp1RomDesc[] = { - { "vectorman (beta).bin", 0x200000, 0xa315c8aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecmanp1) -STD_ROM_FN(md_vecmanp1) - -struct BurnDriver BurnDrvmd_vecmanp1 = { - "md_vecmanp1", "md_vecman", NULL, NULL, "1995", - "Vectorman (Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecmanp1RomInfo, md_vecmanp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman (Prototype, Alt) -static struct BurnRomInfo md_vecmanp2RomDesc[] = { - { "vectorman (beta) (alt).bin", 0x200000, 0x2084d3da, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecmanp2) -STD_ROM_FN(md_vecmanp2) - -struct BurnDriver BurnDrvmd_vecmanp2 = { - "md_vecmanp2", "md_vecman", NULL, NULL, "1995", - "Vectorman (Prototype, Alt)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecmanp2RomInfo, md_vecmanp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman (Prototype, 19950724) -static struct BurnRomInfo md_vecmanp3RomDesc[] = { - { "vectorman (prototype - jul 24, 1995).bin", 0x200000, 0x0145738b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecmanp3) -STD_ROM_FN(md_vecmanp3) - -struct BurnDriver BurnDrvmd_vecmanp3 = { - "md_vecmanp3", "md_vecman", NULL, NULL, "1995", - "Vectorman (Prototype, 19950724)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecmanp3RomInfo, md_vecmanp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman 2 (USA) -static struct BurnRomInfo md_vecman2RomDesc[] = { - { "vectorman 2 (usa).bin", 0x300000, 0xc1a24088, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecman2) -STD_ROM_FN(md_vecman2) - -struct BurnDriver BurnDrvmd_vecman2 = { - "md_vecman2", NULL, NULL, NULL, "1996", - "Vectorman 2 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecman2RomInfo, md_vecman2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman 2 (Prototype) -static struct BurnRomInfo md_vecman2p1RomDesc[] = { - { "vectorman 2 (beta).bin", 0x200000, 0xada2b0ef, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecman2p1) -STD_ROM_FN(md_vecman2p1) - -struct BurnDriver BurnDrvmd_vecman2p1 = { - "md_vecman2p1", "md_vecman2", NULL, NULL, "1996", - "Vectorman 2 (Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecman2p1RomInfo, md_vecman2p1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman 2 (Prototype, 19960815) -static struct BurnRomInfo md_vecman2p6RomDesc[] = { - { "vectorman 2 (prototype - aug 15, 1996).bin", 0x300000, 0x998b087c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecman2p6) -STD_ROM_FN(md_vecman2p6) - -struct BurnDriver BurnDrvmd_vecman2p6 = { - "md_vecman2p6", "md_vecman2", NULL, NULL, "1996", - "Vectorman 2 (Prototype, 19960815)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecman2p6RomInfo, md_vecman2p6RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman 2 (Prototype, 19960816) -static struct BurnRomInfo md_vecman2p5RomDesc[] = { - { "vectorman 2 (prototype - aug 16, 1996).bin", 0x300000, 0x2986e5ce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecman2p5) -STD_ROM_FN(md_vecman2p5) - -struct BurnDriver BurnDrvmd_vecman2p5 = { - "md_vecman2p5", "md_vecman2", NULL, NULL, "1996", - "Vectorman 2 (Prototype, 19960816)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecman2p5RomInfo, md_vecman2p5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman 2 (Prototype, 19960819) -static struct BurnRomInfo md_vecman2p4RomDesc[] = { - { "vectorman 2 (prototype - aug 19, 1996).bin", 0x300000, 0x49efab7e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecman2p4) -STD_ROM_FN(md_vecman2p4) - -struct BurnDriver BurnDrvmd_vecman2p4 = { - "md_vecman2p4", "md_vecman2", NULL, NULL, "1996", - "Vectorman 2 (Prototype, 19960819)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecman2p4RomInfo, md_vecman2p4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman 2 (Prototype, 19960826) -static struct BurnRomInfo md_vecman2p3RomDesc[] = { - { "vectorman 2 (prototype - aug 26, 1996).bin", 0x2a8e46, 0xeb8124c8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecman2p3) -STD_ROM_FN(md_vecman2p3) - -struct BurnDriver BurnDrvmd_vecman2p3 = { - "md_vecman2p3", "md_vecman2", NULL, NULL, "1996", - "Vectorman 2 (Prototype, 19960826)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecman2p3RomInfo, md_vecman2p3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vectorman 2 (Prototype, 19960827) -static struct BurnRomInfo md_vecman2p2RomDesc[] = { - { "vectorman 2 (prototype - aug 27, 1996).bin", 0x300000, 0x6333d89a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vecman2p2) -STD_ROM_FN(md_vecman2p2) - -struct BurnDriver BurnDrvmd_vecman2p2 = { - "md_vecman2p2", "md_vecman2", NULL, NULL, "1996", - "Vectorman 2 (Prototype, 19960827)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vecman2p2RomInfo, md_vecman2p2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Verytex (Jpn) -static struct BurnRomInfo md_verytexRomDesc[] = { - { "verytex (jpn).bin", 0x080000, 0xbafc375f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_verytex) -STD_ROM_FN(md_verytex) - -struct BurnDriver BurnDrvmd_verytex = { - "md_verytex", NULL, NULL, NULL, "1991", - "Verytex (Jpn)\0", NULL, "Asmik Ace", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_verytexRomInfo, md_verytexRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Viewpoint (USA) -static struct BurnRomInfo md_viewpoinRomDesc[] = { - { "viewpoint (usa).bin", 0x200000, 0x59c71866, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_viewpoin) -STD_ROM_FN(md_viewpoin) - -struct BurnDriver BurnDrvmd_viewpoin = { - "md_viewpoin", NULL, NULL, NULL, "1994", - "Viewpoint (USA)\0", NULL, "American Sammy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_viewpoinRomInfo, md_viewpoinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Viewpoint (USA, Prototype) -static struct BurnRomInfo md_viewpoinpRomDesc[] = { - { "viewpoint (usa) (beta).bin", 0x180000, 0xf2e69ce7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_viewpoinp) -STD_ROM_FN(md_viewpoinp) - -struct BurnDriver BurnDrvmd_viewpoinp = { - "md_viewpoinp", "md_viewpoin", NULL, NULL, "1994", - "Viewpoint (USA, Prototype)\0", NULL, "American Sammy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_viewpoinpRomInfo, md_viewpoinpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Fighter 2 - Genesis (Euro, USA) -static struct BurnRomInfo md_vf2RomDesc[] = { - { "mpr-19107+mpr-19108.bin", 0x400000, 0x937380f3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vf2) -STD_ROM_FN(md_vf2) - -struct BurnDriver BurnDrvmd_vf2 = { - "md_vf2", NULL, NULL, NULL, "1997", - "Virtua Fighter 2 - Genesis (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vf2RomInfo, md_vf2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Fighter 2 - Genesis (Kor) -static struct BurnRomInfo md_vf2kRomDesc[] = { - { "mpr-19369.bin", 0x400000, 0xa95d0949, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vf2k) -STD_ROM_FN(md_vf2k) - -struct BurnDriver BurnDrvmd_vf2k = { - "md_vf2k", "md_vf2", NULL, NULL, "1997", - "Virtua Fighter 2 - Genesis (Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vf2kRomInfo, md_vf2kRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Fighter 2 - Genesis (Prototype, 19960819) -static struct BurnRomInfo md_vf2p5RomDesc[] = { - { "virtua fighter 2 (prototype - aug 19, 1996).bin", 0x400000, 0xc5ee3974, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vf2p5) -STD_ROM_FN(md_vf2p5) - -struct BurnDriver BurnDrvmd_vf2p5 = { - "md_vf2p5", "md_vf2", NULL, NULL, "1996", - "Virtua Fighter 2 - Genesis (Prototype, 19960819)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vf2p5RomInfo, md_vf2p5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Fighter 2 - Genesis (Prototype, 19960830) -static struct BurnRomInfo md_vf2p4RomDesc[] = { - { "virtua fighter 2 (prototype - aug 30, 1996).bin", 0x400000, 0x6a0f3a7b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vf2p4) -STD_ROM_FN(md_vf2p4) - -struct BurnDriver BurnDrvmd_vf2p4 = { - "md_vf2p4", "md_vf2", NULL, NULL, "1996", - "Virtua Fighter 2 - Genesis (Prototype, 19960830)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vf2p4RomInfo, md_vf2p4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Fighter 2 - Genesis (Prototype, 19960913) -static struct BurnRomInfo md_vf2p3RomDesc[] = { - { "virtua fighter 2 (prototype - sep 13, 1996).bin", 0x400000, 0xfa5bad91, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vf2p3) -STD_ROM_FN(md_vf2p3) - -struct BurnDriver BurnDrvmd_vf2p3 = { - "md_vf2p3", "md_vf2", NULL, NULL, "1996", - "Virtua Fighter 2 - Genesis (Prototype, 19960913)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vf2p3RomInfo, md_vf2p3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Fighter 2 - Genesis (Prototype, 19960920) -static struct BurnRomInfo md_vf2p2RomDesc[] = { - { "virtua fighter 2 (prototype - sep 20, 1996).bin", 0x400000, 0xaf516dad, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vf2p2) -STD_ROM_FN(md_vf2p2) - -struct BurnDriver BurnDrvmd_vf2p2 = { - "md_vf2p2", "md_vf2", NULL, NULL, "1996", - "Virtua Fighter 2 - Genesis (Prototype, 19960920)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vf2p2RomInfo, md_vf2p2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Fighter 2 - Genesis (Prototype, 19960927) -static struct BurnRomInfo md_vf2p1RomDesc[] = { - { "virtua fighter 2 (prototype - sep 27, 1996).bin", 0x400000, 0x95ab6ab6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vf2p1) -STD_ROM_FN(md_vf2p1) - -struct BurnDriver BurnDrvmd_vf2p1 = { - "md_vf2p1", "md_vf2", NULL, NULL, "1996", - "Virtua Fighter 2 - Genesis (Prototype, 19960927)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vf2p1RomInfo, md_vf2p1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Fighter 2 vs Tekken 2 -static struct BurnRomInfo md_vf2tekRomDesc[] = { - { "virtua fighter 2 vs tekken 2 (unl).bin", 0x200000, 0x2cdb499d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vf2tek) -STD_ROM_FN(md_vf2tek) - -struct BurnDriver BurnDrvmd_vf2tek = { - "md_vf2tek", NULL, NULL, NULL, "199?", - "Virtua Fighter 2 vs Tekken 2\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vf2tekRomInfo, md_vf2tekRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtual Bart (World) -static struct BurnRomInfo md_vbartRomDesc[] = { - { "virtual bart (world).bin", 0x200000, 0x8db9f378, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vbart) -STD_ROM_FN(md_vbart) - -struct BurnDriver BurnDrvmd_vbart = { - "md_vbart", NULL, NULL, NULL, "1994", - "Virtual Bart (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vbartRomInfo, md_vbartRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtual Pinball (Euro, USA) -static struct BurnRomInfo md_vpinballRomDesc[] = { - { "virtual pinball (euro, usa).bin", 0x100000, 0xd63473aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vpinball) -STD_ROM_FN(md_vpinball) - -struct BurnDriver BurnDrvmd_vpinball = { - "md_vpinball", NULL, NULL, NULL, "1993", - "Virtual Pinball (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_vpinballRomInfo, md_vpinballRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Vixen 357 (Jpn) -static struct BurnRomInfo md_vixen357RomDesc[] = { - { "vixen 357 (jpn).bin", 0x100000, 0x3afa2d7b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vixen357) -STD_ROM_FN(md_vixen357) - -struct BurnDriver BurnDrvmd_vixen357 = { - "md_vixen357", NULL, NULL, NULL, "1992", - "Vixen 357 (Jpn)\0", NULL, "NCS", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_vixen357RomInfo, md_vixen357RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// VR Troopers (Euro, USA) -static struct BurnRomInfo md_vrtroopRomDesc[] = { - { "vr troopers (euro, usa).bin", 0x200000, 0x2f35516e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vrtroop) -STD_ROM_FN(md_vrtroop) - -struct BurnDriver BurnDrvmd_vrtroop = { - "md_vrtroop", NULL, NULL, NULL, "1994", - "VR Troopers (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vrtroopRomInfo, md_vrtroopRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wacky Races (USA, Prototype) -static struct BurnRomInfo md_wackyracRomDesc[] = { - { "wacky races (usa) (prototype).bin", 0x200000, 0x1b173f09, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wackyrac) -STD_ROM_FN(md_wackyrac) - -struct BurnDriver BurnDrvmd_wackyrac = { - "md_wackyrac", NULL, NULL, NULL, "199?", - "Wacky Races (USA, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wackyracRomInfo, md_wackyracRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wacky Worlds (USA) -static struct BurnRomInfo md_wworldsRomDesc[] = { - { "wacky worlds (usa).bin", 0x100000, 0x8af4552d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wworlds) -STD_ROM_FN(md_wworlds) - -struct BurnDriver BurnDrvmd_wworlds = { - "md_wworlds", NULL, NULL, NULL, "1994", - "Wacky Worlds (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wworldsRomInfo, md_wworldsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wacky Worlds (Prototype, 19940808) -static struct BurnRomInfo md_wworldsp3RomDesc[] = { - { "wacky worlds (prototype - aug 08, 1994).bin", 0x100000, 0x48d33ea0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wworldsp3) -STD_ROM_FN(md_wworldsp3) - -struct BurnDriver BurnDrvmd_wworldsp3 = { - "md_wworldsp3", "md_wworlds", NULL, NULL, "1994", - "Wacky Worlds (Prototype, 19940808)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wworldsp3RomInfo, md_wworldsp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wacky Worlds (Prototype, 19940817) -static struct BurnRomInfo md_wworldsp2RomDesc[] = { - { "wacky worlds (prototype - aug 17, 1994).bin", 0x0fcbb0, 0x4615970b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wworldsp2) -STD_ROM_FN(md_wworldsp2) - -struct BurnDriver BurnDrvmd_wworldsp2 = { - "md_wworldsp2", "md_wworlds", NULL, NULL, "1994", - "Wacky Worlds (Prototype, 19940817)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wworldsp2RomInfo, md_wworldsp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wacky Worlds (Prototype, 19940819) -static struct BurnRomInfo md_wworldsp1RomDesc[] = { - { "wacky worlds (prototype - aug 19, 1994).bin", 0x0fcb96, 0x7f286925, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wworldsp1) -STD_ROM_FN(md_wworldsp1) - -struct BurnDriver BurnDrvmd_wworldsp1 = { - "md_wworldsp1", "md_wworlds", NULL, NULL, "1994", - "Wacky Worlds (Prototype, 19940819)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wworldsp1RomInfo, md_wworldsp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wani Wani World (Jpn) -static struct BurnRomInfo md_waniwaniRomDesc[] = { - { "wani wani world (jpn).bin", 0x080000, 0x56f0dbb2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_waniwani) -STD_ROM_FN(md_waniwani) - -struct BurnDriver BurnDrvmd_waniwani = { - "md_waniwani", NULL, NULL, NULL, "1992", - "Wani Wani World (Jpn)\0", NULL, "Kaneko", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_waniwaniRomInfo, md_waniwaniRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wardner (USA) -static struct BurnRomInfo md_wardnerRomDesc[] = { - { "wardner (usa).bin", 0x080000, 0x1e369ae2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wardner) -STD_ROM_FN(md_wardner) - -struct BurnDriver BurnDrvmd_wardner = { - "md_wardner", NULL, NULL, NULL, "1991", - "Wardner (USA)\0", NULL, "Mentrix Software", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wardnerRomInfo, md_wardnerRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wardner no Mori Special (Jpn) -static struct BurnRomInfo md_wardnerjRomDesc[] = { - { "wardner no mori special (jpn).bin", 0x080000, 0x80f1035c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wardnerj) -STD_ROM_FN(md_wardnerj) - -struct BurnDriver BurnDrvmd_wardnerj = { - "md_wardnerj", "md_wardner", NULL, NULL, "1991", - "Wardner no Mori Special (Jpn)\0", NULL, "Visco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wardnerjRomInfo, md_wardnerjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Warlock (Euro, USA) -static struct BurnRomInfo md_warlockRomDesc[] = { - { "warlock (euro, usa).bin", 0x200000, 0x0a46539b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_warlock) -STD_ROM_FN(md_warlock) - -struct BurnDriver BurnDrvmd_warlock = { - "md_warlock", NULL, NULL, NULL, "1994", - "Warlock (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_warlockRomInfo, md_warlockRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Warlock (USA, Prototype) -static struct BurnRomInfo md_warlockpRomDesc[] = { - { "warlock (usa) (beta).bin", 0x200000, 0xc9b6edb3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_warlockp) -STD_ROM_FN(md_warlockp) - -struct BurnDriver BurnDrvmd_warlockp = { - "md_warlockp", "md_warlock", NULL, NULL, "1994", - "Warlock (USA, Prototype)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_warlockpRomInfo, md_warlockpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Warpspeed (USA) -static struct BurnRomInfo md_warpspedRomDesc[] = { - { "warpspeed (usa).bin", 0x200000, 0x143697ed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_warpsped) -STD_ROM_FN(md_warpsped) - -struct BurnDriver BurnDrvmd_warpsped = { - "md_warpsped", NULL, NULL, NULL, "1993", - "Warpspeed (USA)\0", NULL, "Accolade", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_warpspedRomInfo, md_warpspedRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Warrior of Rome (USA) -static struct BurnRomInfo md_warriorRomDesc[] = { - { "warrior of rome (usa).bin", 0x100000, 0x5be10c6a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_warrior) -STD_ROM_FN(md_warrior) - -struct BurnDriver BurnDrvmd_warrior = { - "md_warrior", NULL, NULL, NULL, "1991", - "Warrior of Rome (USA)\0", NULL, "Micronet", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_warriorRomInfo, md_warriorRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Caesar no Yabou (Jpn) -static struct BurnRomInfo md_caesarRomDesc[] = { - { "caesar no yabou (jpn).bin", 0x100000, 0x69796e93, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_caesar) -STD_ROM_FN(md_caesar) - -struct BurnDriver BurnDrvmd_caesar = { - "md_caesar", "md_warrior", NULL, NULL, "1991", - "Caesar no Yabou (Jpn)\0", NULL, "Micronet", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_caesarRomInfo, md_caesarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Warrior of Rome II (USA) -static struct BurnRomInfo md_warrior2RomDesc[] = { - { "warrior of rome ii (usa).bin", 0x100000, 0xcd8c472a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_warrior2) -STD_ROM_FN(md_warrior2) - -struct BurnDriver BurnDrvmd_warrior2 = { - "md_warrior2", NULL, NULL, NULL, "1992", - "Warrior of Rome II (USA)\0", NULL, "Micronet", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_warrior2RomInfo, md_warrior2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Caesar no Yabou II (Jpn) -static struct BurnRomInfo md_caesar2RomDesc[] = { - { "caesar no yabou ii (jpn).bin", 0x100000, 0x4f327b3a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_caesar2) -STD_ROM_FN(md_caesar2) - -struct BurnDriver BurnDrvmd_caesar2 = { - "md_caesar2", "md_warrior2", NULL, NULL, "1992", - "Caesar no Yabou II (Jpn)\0", NULL, "Micronet", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_caesar2RomInfo, md_caesar2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Warsong (USA) -static struct BurnRomInfo md_warsongRomDesc[] = { - { "warsong (usa).bin", 0x080000, 0x4b680285, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_warsong) -STD_ROM_FN(md_warsong) - -struct BurnDriver BurnDrvmd_warsong = { - "md_warsong", NULL, NULL, NULL, "1991", - "Warsong (USA)\0", NULL, "Treco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_warsongRomInfo, md_warsongRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// WaterWorld (Euro, Prototype) -static struct BurnRomInfo md_waterwldRomDesc[] = { - { "waterworld (euro) (prototype).bin", 0x200000, 0x51c80498, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_waterwld) -STD_ROM_FN(md_waterwld) - -struct BurnDriver BurnDrvmd_waterwld = { - "md_waterwld", NULL, NULL, NULL, "1995?", - "WaterWorld (Euro, Prototype)\0", NULL, "Ocean", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_waterwldRomInfo, md_waterwldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wayne Gretzky and the NHLPA All-Stars (Euro, USA) -static struct BurnRomInfo md_waynegRomDesc[] = { - { "wayne gretzky and the nhlpa all-stars (euro, usa).bin", 0x200000, 0xc2c13b81, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wayneg) -STD_ROM_FN(md_wayneg) - -struct BurnDriver BurnDrvmd_wayneg = { - "md_wayneg", NULL, NULL, NULL, "1995", - "Wayne Gretzky and the NHLPA All-Stars (Euro, USA)\0", NULL, "Time Warner Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_waynegRomInfo, md_waynegRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wayne's World (USA) -static struct BurnRomInfo md_waynewldRomDesc[] = { - { "wayne's world (usa).bin", 0x100000, 0xd2cf6ebe, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_waynewld) -STD_ROM_FN(md_waynewld) - -struct BurnDriver BurnDrvmd_waynewld = { - "md_waynewld", NULL, NULL, NULL, "1993", - "Wayne's World (USA)\0", NULL, "THQ", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_waynewldRomInfo, md_waynewldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Weaponlord (USA) -static struct BurnRomInfo md_weaponldRomDesc[] = { - { "weaponlord (usa).bin", 0x300000, 0xb9895365, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_weaponld) -STD_ROM_FN(md_weaponld) - -struct BurnDriver BurnDrvmd_weaponld = { - "md_weaponld", NULL, NULL, NULL, "1995", - "Weaponlord (USA)\0", NULL, "Namco", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_weaponldRomInfo, md_weaponldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wheel of Fortune (USA) -static struct BurnRomInfo md_wheelforRomDesc[] = { - { "wheel of fortune (usa).bin", 0x080000, 0xc8d8efc3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wheelfor) -STD_ROM_FN(md_wheelfor) - -struct BurnDriver BurnDrvmd_wheelfor = { - "md_wheelfor", NULL, NULL, NULL, "1992", - "Wheel of Fortune (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wheelforRomInfo, md_wheelforRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Where in the World Is Carmen Sandiego? (Euro, USA) -static struct BurnRomInfo md_carmnwldRomDesc[] = { - { "where in the world is carmen sandiego (euro, usa).bin", 0x100000, 0xeef372e8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_carmnwld) -STD_ROM_FN(md_carmnwld) - -struct BurnDriver BurnDrvmd_carmnwld = { - "md_carmnwld", NULL, NULL, NULL, "1992", - "Where in the World Is Carmen Sandiego? (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_carmnwldRomInfo, md_carmnwldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Where in the World Is Carmen Sandiego? (Bra) -static struct BurnRomInfo md_carmnwldbRomDesc[] = { - { "where in the world is carmen sandiego (bra).bin", 0x100000, 0x7d4450ad, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_carmnwldb) -STD_ROM_FN(md_carmnwldb) - -struct BurnDriver BurnDrvmd_carmnwldb = { - "md_carmnwldb", "md_carmnwld", NULL, NULL, "199?", - "Where in the World Is Carmen Sandiego? (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_carmnwldbRomInfo, md_carmnwldbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Where in Time Is Carmen Sandiego? (Euro, USA) -static struct BurnRomInfo md_carmntimRomDesc[] = { - { "where in time is carmen sandiego (euro, usa).bin", 0x100000, 0xea19d4a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_carmntim) -STD_ROM_FN(md_carmntim) - -struct BurnDriver BurnDrvmd_carmntim = { - "md_carmntim", NULL, NULL, NULL, "1992", - "Where in Time Is Carmen Sandiego? (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_carmntimRomInfo, md_carmntimRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Where in Time Is Carmen Sandiego? (Bra) -static struct BurnRomInfo md_carmntimbRomDesc[] = { - { "where in time is carmen sandiego (bra).bin", 0x100000, 0xd523b552, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_carmntimb) -STD_ROM_FN(md_carmntimb) - -struct BurnDriver BurnDrvmd_carmntimb = { - "md_carmntimb", "md_carmntim", NULL, NULL, "199?", - "Where in Time Is Carmen Sandiego? (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_carmntimbRomInfo, md_carmntimbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Whip Rush (USA) -static struct BurnRomInfo md_whiprushRomDesc[] = { - { "whip rush (usa).bin", 0x080000, 0x7eb6b86b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whiprush) -STD_ROM_FN(md_whiprush) - -struct BurnDriver BurnDrvmd_whiprush = { - "md_whiprush", NULL, NULL, NULL, "1990", - "Whip Rush (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whiprushRomInfo, md_whiprushRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Whip Rush - Wakusei Voltegas no Nazo (Jpn) -static struct BurnRomInfo md_whiprushjRomDesc[] = { - { "whip rush - wakusei voltegas no nazo (jpn).bin", 0x080000, 0x8084b4d1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whiprushj) -STD_ROM_FN(md_whiprushj) - -struct BurnDriver BurnDrvmd_whiprushj = { - "md_whiprushj", "md_whiprush", NULL, NULL, "1990", - "Whip Rush - Wakusei Voltegas no Nazo (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whiprushjRomInfo, md_whiprushjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wild Snake (USA, Prototype) -static struct BurnRomInfo md_wildsnakRomDesc[] = { - { "wild snake (usa) (prototype).bin", 0x080000, 0x0c1a49e5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wildsnak) -STD_ROM_FN(md_wildsnak) - -struct BurnDriver BurnDrvmd_wildsnak = { - "md_wildsnak", NULL, NULL, NULL, "1994", - "Wild Snake (USA, Prototype)\0", NULL, "Bullet-Proof Software", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wildsnakRomInfo, md_wildsnakRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Williams Arcade's Greatest Hits (USA) -static struct BurnRomInfo md_arcadeghuRomDesc[] = { - { "williams arcade's greatest hits (usa).bin", 0x080000, 0xd68e9c00, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_arcadeghu) -STD_ROM_FN(md_arcadeghu) - -struct BurnDriver BurnDrvmd_arcadeghu = { - "md_arcadeghu", "md_arcadegh", NULL, NULL, "1996", - "Williams Arcade's Greatest Hits (USA)\0", NULL, "Williams", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arcadeghuRomInfo, md_arcadeghuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wimbledon Championship Tennis (Euro) -static struct BurnRomInfo md_wimbledRomDesc[] = { - { "wimbledon championship tennis (euro).bin", 0x100000, 0xb791a435, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wimbled) -STD_ROM_FN(md_wimbled) - -struct BurnDriver BurnDrvmd_wimbled = { - "md_wimbled", NULL, NULL, NULL, "1994", - "Wimbledon Championship Tennis (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wimbledRomInfo, md_wimbledRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wimbledon Championship Tennis (Jpn) -static struct BurnRomInfo md_wimbledjRomDesc[] = { - { "wimbledon championship tennis (jpn).bin", 0x100000, 0x3e0c9daf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wimbledj) -STD_ROM_FN(md_wimbledj) - -struct BurnDriver BurnDrvmd_wimbledj = { - "md_wimbledj", "md_wimbled", NULL, NULL, "1994", - "Wimbledon Championship Tennis (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wimbledjRomInfo, md_wimbledjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wimbledon Championship Tennis (USA) -static struct BurnRomInfo md_wimbleduRomDesc[] = { - { "wimbledon championship tennis (usa).bin", 0x100000, 0xf9142aee, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wimbledu) -STD_ROM_FN(md_wimbledu) - -struct BurnDriver BurnDrvmd_wimbledu = { - "md_wimbledu", "md_wimbled", NULL, NULL, "1993", - "Wimbledon Championship Tennis (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wimbleduRomInfo, md_wimbleduRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wimbledon Championship Tennis (USA, Prototype) -static struct BurnRomInfo md_wimbledupRomDesc[] = { - { "wimbledon championship tennis (usa) (beta).bin", 0x100000, 0x9febc760, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wimbledup) -STD_ROM_FN(md_wimbledup) - -struct BurnDriver BurnDrvmd_wimbledup = { - "md_wimbledup", "md_wimbled", NULL, NULL, "1993", - "Wimbledon Championship Tennis (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wimbledupRomInfo, md_wimbledupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Winter Challenge (Euro, USA, Rev. 1) -static struct BurnRomInfo md_wintchalRomDesc[] = { - { "acwcsg-1_(1-92).bin", 0x100000, 0xf57c7068, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wintchal) -STD_ROM_FN(md_wintchal) - -struct BurnDriver BurnDrvmd_wintchal = { - "md_wintchal", NULL, NULL, NULL, "1992", - "Winter Challenge (Euro, USA, Rev. 1)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wintchalRomInfo, md_wintchalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Games: Winter Challenge (Euro, USA) -static struct BurnRomInfo md_wintchal1RomDesc[] = { - { "acwcsg_(12-91).bin", 0x100000, 0xdbc3ed1c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wintchal1) -STD_ROM_FN(md_wintchal1) - -struct BurnDriver BurnDrvmd_wintchal1 = { - "md_wintchal1", "md_wintchal", NULL, NULL, "1992", - "The Games: Winter Challenge (Euro, USA)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wintchal1RomInfo, md_wintchal1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Winter Challenge (Prototype) -static struct BurnRomInfo md_wintchalpRomDesc[] = { - { "winter challenge (beta).bin", 0x100000, 0x60d2a8c4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wintchalp) -STD_ROM_FN(md_wintchalp) - -struct BurnDriver BurnDrvmd_wintchalp = { - "md_wintchalp", "md_wintchal", NULL, NULL, "1992", - "Winter Challenge (Prototype)\0", NULL, "Ballistic", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wintchalpRomInfo, md_wintchalpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Winter Olympics (Euro) -static struct BurnRomInfo md_wintolRomDesc[] = { - { "winter olympics (euro).bin", 0x200000, 0xfa537a45, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wintol) -STD_ROM_FN(md_wintol) - -struct BurnDriver BurnDrvmd_wintol = { - "md_wintol", NULL, NULL, NULL, "1994", - "Winter Olympics (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wintolRomInfo, md_wintolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Winter Olympics (Jpn) -static struct BurnRomInfo md_wintoljRomDesc[] = { - { "winter olympics (jpn).bin", 0x200000, 0x654a4684, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wintolj) -STD_ROM_FN(md_wintolj) - -struct BurnDriver BurnDrvmd_wintolj = { - "md_wintolj", "md_wintol", NULL, NULL, "1994", - "Winter Olympics (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wintoljRomInfo, md_wintoljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Winter Olympic Games (USA) -static struct BurnRomInfo md_wintoluRomDesc[] = { - { "winter olympic games (usa).bin", 0x200000, 0xc5834437, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wintolu) -STD_ROM_FN(md_wintolu) - -struct BurnDriver BurnDrvmd_wintolu = { - "md_wintolu", "md_wintol", NULL, NULL, "1993", - "Winter Olympic Games (USA)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wintoluRomInfo, md_wintoluRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wiz'n'Liz - The Frantic Wabbit Wescue (Euro) -static struct BurnRomInfo md_wiznlizRomDesc[] = { - { "wiz'n'liz - the frantic wabbit wescue (euro).bin", 0x100000, 0xf09353b4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wiznliz) -STD_ROM_FN(md_wiznliz) - -struct BurnDriver BurnDrvmd_wiznliz = { - "md_wiznliz", NULL, NULL, NULL, "1993", - "Wiz'n'Liz - The Frantic Wabbit Wescue (Euro)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wiznlizRomInfo, md_wiznlizRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wiz'n'Liz (USA) -static struct BurnRomInfo md_wiznlizuRomDesc[] = { - { "wiz'n'liz (usa).bin", 0x100000, 0xdf036b62, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wiznlizu) -STD_ROM_FN(md_wiznlizu) - -struct BurnDriver BurnDrvmd_wiznlizu = { - "md_wiznlizu", "md_wiznliz", NULL, NULL, "1993", - "Wiz'n'Liz (USA)\0", NULL, "Psygnosis", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wiznlizuRomInfo, md_wiznlizuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wolfchild (USA) -static struct BurnRomInfo md_wolfchldRomDesc[] = { - { "wolfchild (usa).bin", 0x100000, 0xeb5b1cbf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wolfchld) -STD_ROM_FN(md_wolfchld) - -struct BurnDriver BurnDrvmd_wolfchld = { - "md_wolfchld", NULL, NULL, NULL, "1993", - "Wolfchild (USA)\0", NULL, "JVC Musical Industries", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wolfchldRomInfo, md_wolfchldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wolverine - Adamantium Rage (Euro, USA) -static struct BurnRomInfo md_wolverinRomDesc[] = { - { "wolverine - adamantium rage (euro, usa).bin", 0x200000, 0xd2437bb7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wolverin) -STD_ROM_FN(md_wolverin) - -struct BurnDriver BurnDrvmd_wolverin = { - "md_wolverin", NULL, NULL, NULL, "1994", - "Wolverine - Adamantium Rage (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wolverinRomInfo, md_wolverinRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wonder Boy III - Monster Lair (Euro) ~ Monster Lair (Jpn) -static struct BurnRomInfo md_wboy3RomDesc[] = { - { "mpr-13619.bin", 0x080000, 0xc24bc5e4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wboy3) -STD_ROM_FN(md_wboy3) - -struct BurnDriver BurnDrvmd_wboy3 = { - "md_wboy3", NULL, NULL, NULL, "1991", - "Wonder Boy III - Monster Lair (Euro) ~ Monster Lair (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wboy3RomInfo, md_wboy3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wonder Boy in Monster World (Euro, USA) -static struct BurnRomInfo md_wboymwRomDesc[] = { - { "mpr-14556.bin", 0x0c0000, 0x1592f5b0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wboymw) -STD_ROM_FN(md_wboymw) - -struct BurnDriver BurnDrvmd_wboymw = { - "md_wboymw", NULL, NULL, NULL, "1992", - "Wonder Boy in Monster World (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_wboymwRomInfo, md_wboymwRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wonder Boy V - Monster World III (Jpn, Kor) -static struct BurnRomInfo md_wboy5RomDesc[] = { - { "wonder boy v - monster world iii (jpn, kor).bin", 0x0a0000, 0x45a50f96, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wboy5) -STD_ROM_FN(md_wboy5) - -struct BurnDriver BurnDrvmd_wboy5 = { - "md_wboy5", "md_wboymw", NULL, NULL, "1991", - "Wonder Boy V - Monster World III (Jpn, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_wboy5RomInfo, md_wboy5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Turma da Mnica na Terra dos Monstros (Bra) -static struct BurnRomInfo md_turmamonRomDesc[] = { - { "turma da monica na terra dos monstros (bra).bin", 0x100000, 0xf8288de1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_turmamon) -STD_ROM_FN(md_turmamon) - -struct BurnDriver BurnDrvmd_turmamon = { - "md_turmamon", "md_wboymw", NULL, NULL, "1996", - "Turma da Monica na Terra dos Monstros (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - L"Turma da M\u00F4nica na Terra dos Monstros (Bra)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM, GBF_MISC, 0, - MegadriveGetZipName, md_turmamonRomInfo, md_turmamonRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wonder Library (Jpn) -static struct BurnRomInfo md_wondlibRomDesc[] = { - { "wonder library (jpn).bin", 0x080000, 0x9350e754, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wondlib) -STD_ROM_FN(md_wondlib) - -struct BurnDriver BurnDrvmd_wondlib = { - "md_wondlib", NULL, NULL, NULL, "199?", - "Wonder Library (Jpn)\0", NULL, "Victor", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wondlibRomInfo, md_wondlibRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Euro) -static struct BurnRomInfo md_wcs2RomDesc[] = { - { "world championship soccer ii (europe).bin", 0x100000, 0x6065774d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2) -STD_ROM_FN(md_wcs2) - -struct BurnDriver BurnDrvmd_wcs2 = { - "md_wcs2", NULL, NULL, NULL, "1994", - "World Championship Soccer II (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2RomInfo, md_wcs2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (USA) -static struct BurnRomInfo md_wcs2uRomDesc[] = { - { "world championship soccer ii (usa).bin", 0x100000, 0xc1dd1c8e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2u) -STD_ROM_FN(md_wcs2u) - -struct BurnDriver BurnDrvmd_wcs2u = { - "md_wcs2u", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2uRomInfo, md_wcs2uRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940223) -static struct BurnRomInfo md_wcs2p17RomDesc[] = { - { "world championship soccer ii (prototype - feb 23, 1994).bin", 0x100000, 0xaab9e240, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p17) -STD_ROM_FN(md_wcs2p17) - -struct BurnDriver BurnDrvmd_wcs2p17 = { - "md_wcs2p17", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940223)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p17RomInfo, md_wcs2p17RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940309) -static struct BurnRomInfo md_wcs2p12RomDesc[] = { - { "world championship soccer ii (prototype - mar 09, 1994).bin", 0x100000, 0x71fa89cc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p12) -STD_ROM_FN(md_wcs2p12) - -struct BurnDriver BurnDrvmd_wcs2p12 = { - "md_wcs2p12", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940309)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p12RomInfo, md_wcs2p12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940323) -static struct BurnRomInfo md_wcs2p08RomDesc[] = { - { "world championship soccer ii (prototype - mar 23, 1994).bin", 0x100000, 0x3852e514, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p08) -STD_ROM_FN(md_wcs2p08) - -struct BurnDriver BurnDrvmd_wcs2p08 = { - "md_wcs2p08", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940323)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p08RomInfo, md_wcs2p08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940324) -static struct BurnRomInfo md_wcs2p07RomDesc[] = { - { "world championship soccer ii (prototype - mar 24, 1994).bin", 0x100000, 0xa6d43b4a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p07) -STD_ROM_FN(md_wcs2p07) - -struct BurnDriver BurnDrvmd_wcs2p07 = { - "md_wcs2p07", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940324)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p07RomInfo, md_wcs2p07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940325) -static struct BurnRomInfo md_wcs2p06RomDesc[] = { - { "world championship soccer ii (prototype - mar 25, 1994).bin", 0x100000, 0x6b3624fb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p06) -STD_ROM_FN(md_wcs2p06) - -struct BurnDriver BurnDrvmd_wcs2p06 = { - "md_wcs2p06", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940325)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p06RomInfo, md_wcs2p06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940326) -static struct BurnRomInfo md_wcs2p05RomDesc[] = { - { "world championship soccer ii (prototype - mar 26, 1994).bin", 0x100000, 0x1ad7ed9c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p05) -STD_ROM_FN(md_wcs2p05) - -struct BurnDriver BurnDrvmd_wcs2p05 = { - "md_wcs2p05", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940326)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p05RomInfo, md_wcs2p05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940327) -static struct BurnRomInfo md_wcs2p04RomDesc[] = { - { "world championship soccer ii (prototype - mar 27, 1994).bin", 0x100000, 0x4e141509, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p04) -STD_ROM_FN(md_wcs2p04) - -struct BurnDriver BurnDrvmd_wcs2p04 = { - "md_wcs2p04", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940327)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p04RomInfo, md_wcs2p04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940329-B) -static struct BurnRomInfo md_wcs2p03RomDesc[] = { - { "world championship soccer ii (prototype - mar 29, 1994 - b).bin", 0x100000, 0xa6759340, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p03) -STD_ROM_FN(md_wcs2p03) - -struct BurnDriver BurnDrvmd_wcs2p03 = { - "md_wcs2p03", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940329-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p03RomInfo, md_wcs2p03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940329) -static struct BurnRomInfo md_wcs2p02RomDesc[] = { - { "world championship soccer ii (prototype - mar 29, 1994).bin", 0x100000, 0x5f9c51f7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p02) -STD_ROM_FN(md_wcs2p02) - -struct BurnDriver BurnDrvmd_wcs2p02 = { - "md_wcs2p02", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940329)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p02RomInfo, md_wcs2p02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype, 19940330) -static struct BurnRomInfo md_wcs2p01RomDesc[] = { - { "world championship soccer ii (prototype - mar 30, 1994).bin", 0x100000, 0x8dd49c92, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p01) -STD_ROM_FN(md_wcs2p01) - -struct BurnDriver BurnDrvmd_wcs2p01 = { - "md_wcs2p01", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype, 19940330)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p01RomInfo, md_wcs2p01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype G, 19940222) -static struct BurnRomInfo md_wcs2p18RomDesc[] = { - { "world championship soccer ii (prototype g - feb 22, 1994).bin", 0x100000, 0x6fbfa14e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p18) -STD_ROM_FN(md_wcs2p18) - -struct BurnDriver BurnDrvmd_wcs2p18 = { - "md_wcs2p18", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype G, 19940222)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p18RomInfo, md_wcs2p18RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype J, 19940228) -static struct BurnRomInfo md_wcs2p16RomDesc[] = { - { "world championship soccer ii (prototype j - feb 28, 1994).bin", 0x100000, 0xe210a74c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p16) -STD_ROM_FN(md_wcs2p16) - -struct BurnDriver BurnDrvmd_wcs2p16 = { - "md_wcs2p16", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype J, 19940228)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p16RomInfo, md_wcs2p16RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype N, 19940303) -static struct BurnRomInfo md_wcs2p15RomDesc[] = { - { "world championship soccer ii (prototype n - mar 03, 1994).bin", 0x100000, 0x07b387a4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p15) -STD_ROM_FN(md_wcs2p15) - -struct BurnDriver BurnDrvmd_wcs2p15 = { - "md_wcs2p15", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype N, 19940303)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p15RomInfo, md_wcs2p15RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype O, 19940303) -static struct BurnRomInfo md_wcs2p14RomDesc[] = { - { "world championship soccer ii (prototype o - mar 03, 1994).bin", 0x100000, 0x5a458d42, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p14) -STD_ROM_FN(md_wcs2p14) - -struct BurnDriver BurnDrvmd_wcs2p14 = { - "md_wcs2p14", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype O, 19940303)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p14RomInfo, md_wcs2p14RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype P, 19940304) -static struct BurnRomInfo md_wcs2p13RomDesc[] = { - { "world championship soccer ii (prototype p - mar 04, 1994).bin", 0x100000, 0x8fe9f6ef, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p13) -STD_ROM_FN(md_wcs2p13) - -struct BurnDriver BurnDrvmd_wcs2p13 = { - "md_wcs2p13", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype P, 19940304)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p13RomInfo, md_wcs2p13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype R, 19940309) -static struct BurnRomInfo md_wcs2p11RomDesc[] = { - { "world championship soccer ii (prototype r - mar 09, 1994).bin", 0x100000, 0x94625572, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p11) -STD_ROM_FN(md_wcs2p11) - -struct BurnDriver BurnDrvmd_wcs2p11 = { - "md_wcs2p11", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype R, 19940309)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p11RomInfo, md_wcs2p11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype U, 19940314) -static struct BurnRomInfo md_wcs2p10RomDesc[] = { - { "world championship soccer ii (prototype u - mar 14, 1994).bin", 0x100000, 0x43ec107c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p10) -STD_ROM_FN(md_wcs2p10) - -struct BurnDriver BurnDrvmd_wcs2p10 = { - "md_wcs2p10", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype U, 19940314)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p10RomInfo, md_wcs2p10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (Prototype Y, 19940318) -static struct BurnRomInfo md_wcs2p09RomDesc[] = { - { "world championship soccer ii (prototype y - mar 18, 1994).bin", 0x100000, 0xf6735b61, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2p09) -STD_ROM_FN(md_wcs2p09) - -struct BurnDriver BurnDrvmd_wcs2p09 = { - "md_wcs2p09", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (Prototype Y, 19940318)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2p09RomInfo, md_wcs2p09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer II (USA, Prototype) -static struct BurnRomInfo md_wcs2upRomDesc[] = { - { "world championship soccer ii (usa) (beta).bin", 0x100000, 0xc1e21c1a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs2up) -STD_ROM_FN(md_wcs2up) - -struct BurnDriver BurnDrvmd_wcs2up = { - "md_wcs2up", "md_wcs2", NULL, NULL, "1994", - "World Championship Soccer II (USA, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcs2upRomInfo, md_wcs2upRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Class Leaderboard Golf (Euro) -static struct BurnRomInfo md_wcleadRomDesc[] = { - { "mpr-15278.bin", 0x080000, 0xdaca01c3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wclead) -STD_ROM_FN(md_wclead) - -struct BurnDriver BurnDrvmd_wclead = { - "md_wclead", NULL, NULL, NULL, "1992", - "World Class Leaderboard Golf (Euro)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcleadRomInfo, md_wcleadRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Class Leaderboard Golf (USA) -static struct BurnRomInfo md_wcleaduRomDesc[] = { - { "world class leaderboard golf (usa).bin", 0x080000, 0x53434bab, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcleadu) -STD_ROM_FN(md_wcleadu) - -struct BurnDriver BurnDrvmd_wcleadu = { - "md_wcleadu", "md_wclead", NULL, NULL, "1992", - "World Class Leaderboard Golf (USA)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcleaduRomInfo, md_wcleaduRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Cup Italia '90 (Euro) -static struct BurnRomInfo md_wcup90RomDesc[] = { - { "mpr-13239.bin", 0x040000, 0xdd95f829, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcup90) -STD_ROM_FN(md_wcup90) - -struct BurnDriver BurnDrvmd_wcup90 = { - "md_wcup90", NULL, NULL, NULL, "1990", - "World Cup Italia '90 (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcup90RomInfo, md_wcup90RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer (USA, Rev. B) ~ World Cup Soccer (Jpn, Rev. B) -static struct BurnRomInfo md_wcsRomDesc[] = { - { "mpr-12607b.bin", 0x040000, 0xbf272bcb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcs) -STD_ROM_FN(md_wcs) - -struct BurnDriver BurnDrvmd_wcs = { - "md_wcs", "md_wcup90", NULL, NULL, "1989", - "World Championship Soccer (USA, Rev. B) ~ World Cup Soccer (Jpn, Rev. B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcsRomInfo, md_wcsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer (USA, v1.2) ~ World Cup Soccer (Jpn, v1.2) -static struct BurnRomInfo md_wcsaRomDesc[] = { - { "world cup soccer -- world championship soccer (usa, jpn) (v1.2).bin", 0x040000, 0xbf84ede6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcsa) -STD_ROM_FN(md_wcsa) - -struct BurnDriver BurnDrvmd_wcsa = { - "md_wcsa", "md_wcup90", NULL, NULL, "1989", - "World Championship Soccer (USA, v1.2) ~ World Cup Soccer (Jpn, v1.2)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcsaRomInfo, md_wcsaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Championship Soccer (USA) ~ World Cup Soccer (Jpn) -static struct BurnRomInfo md_wcsbRomDesc[] = { - { "world cup soccer -- world championship soccer (usa, jpn).bin", 0x040000, 0xb01c3d70, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcsb) -STD_ROM_FN(md_wcsb) - -struct BurnDriver BurnDrvmd_wcsb = { - "md_wcsb", "md_wcup90", NULL, NULL, "1989", - "World Championship Soccer (USA) ~ World Cup Soccer (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wcsbRomInfo, md_wcsbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Cup USA 94 (Euro, USA, Kor) -static struct BurnRomInfo md_wcup94RomDesc[] = { - { "world cup usa 94 (euro, usa, kor).bin", 0x100000, 0x0171b47f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wcup94) -STD_ROM_FN(md_wcup94) - -struct BurnDriver BurnDrvmd_wcup94 = { - "md_wcup94", NULL, NULL, NULL, "1994", - "World Cup USA 94 (Euro, USA, Kor)\0", NULL, "U.S. Gold", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wcup94RomInfo, md_wcup94RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA) -static struct BurnRomInfo md_whRomDesc[] = { - { "world heroes (usa).bin", 0x200000, 0x0f4d22ec, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wh) -STD_ROM_FN(md_wh) - -struct BurnDriver BurnDrvmd_wh = { - "md_wh", NULL, NULL, NULL, "1994", - "World Heroes (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whRomInfo, md_whRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (Jpn) -static struct BurnRomInfo md_whjRomDesc[] = { - { "world heroes (jpn).bin", 0x200000, 0x56e3ceff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whj) -STD_ROM_FN(md_whj) - -struct BurnDriver BurnDrvmd_whj = { - "md_whj", "md_wh", NULL, NULL, "199?", - "World Heroes (Jpn)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whjRomInfo, md_whjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940331-B) -static struct BurnRomInfo md_whp02RomDesc[] = { - { "world heroes (euro) (prototype - mar 31, 1994 - b).bin", 0x200000, 0xd210aa6e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp02) -STD_ROM_FN(md_whp02) - -struct BurnDriver BurnDrvmd_whp02 = { - "md_whp02", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940331-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp02RomInfo, md_whp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940331) -static struct BurnRomInfo md_whp01RomDesc[] = { - { "world heroes (euro) (prototype - mar 31, 1994).bin", 0x200000, 0x92e1bf14, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp01) -STD_ROM_FN(md_whp01) - -struct BurnDriver BurnDrvmd_whp01 = { - "md_whp01", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940331)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp01RomInfo, md_whp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (Jpn, Prototype, 19940408) -static struct BurnRomInfo md_whjp4RomDesc[] = { - { "world heroes (jpn) (prototype - apr 08, 1994).bin", 0x200000, 0x2bea7215, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whjp4) -STD_ROM_FN(md_whjp4) - -struct BurnDriver BurnDrvmd_whjp4 = { - "md_whjp4", "md_wh", NULL, NULL, "1994", - "World Heroes (Jpn, Prototype, 19940408)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whjp4RomInfo, md_whjp4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (Jpn, Prototype, 19940415) -static struct BurnRomInfo md_whjp3RomDesc[] = { - { "world heroes (jpn) (prototype - apr 15, 1994).bin", 0x200000, 0x6dec07b3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whjp3) -STD_ROM_FN(md_whjp3) - -struct BurnDriver BurnDrvmd_whjp3 = { - "md_whjp3", "md_wh", NULL, NULL, "1994", - "World Heroes (Jpn, Prototype, 19940415)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whjp3RomInfo, md_whjp3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (Jpn, Prototype, 19940420-B) -static struct BurnRomInfo md_whjp2RomDesc[] = { - { "world heroes (jpn) (prototype - apr 20, 1994 - b).bin", 0x200000, 0xf5ffb191, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whjp2) -STD_ROM_FN(md_whjp2) - -struct BurnDriver BurnDrvmd_whjp2 = { - "md_whjp2", "md_wh", NULL, NULL, "1994", - "World Heroes (Jpn, Prototype, 19940420-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whjp2RomInfo, md_whjp2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (Jpn, Prototype, 19940420, broken - C05 missing) -static struct BurnRomInfo md_whjp1RomDesc[] = { - { "world heroes (jpn) (prototype - apr 20, 1994) (broken - c05 missing).bin", 0x200000, 0xb43b518c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whjp1) -STD_ROM_FN(md_whjp1) - -struct BurnDriver BurnDrvmd_whjp1 = { - "md_whjp1", "md_wh", NULL, NULL, "1994", - "World Heroes (Jpn, Prototype, 19940420, broken - C05 missing)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whjp1RomInfo, md_whjp1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (Jpn, Prototype, 19940330) -static struct BurnRomInfo md_whjp5RomDesc[] = { - { "world heroes (jpn) (prototype - mar 30, 1994).bin", 0x200000, 0x3f93181a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whjp5) -STD_ROM_FN(md_whjp5) - -struct BurnDriver BurnDrvmd_whjp5 = { - "md_whjp5", "md_wh", NULL, NULL, "1994", - "World Heroes (Jpn, Prototype, 19940330)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whjp5RomInfo, md_whjp5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940223) -static struct BurnRomInfo md_whp13RomDesc[] = { - { "world heroes (usa) (prototype - feb 23, 1994).bin", 0x200000, 0xf5db477e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp13) -STD_ROM_FN(md_whp13) - -struct BurnDriver BurnDrvmd_whp13 = { - "md_whp13", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940223)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp13RomInfo, md_whp13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940303) -static struct BurnRomInfo md_whp12RomDesc[] = { - { "world heroes (usa) (prototype - mar 03, 1994).bin", 0x200000, 0x24a63aef, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp12) -STD_ROM_FN(md_whp12) - -struct BurnDriver BurnDrvmd_whp12 = { - "md_whp12", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940303)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp12RomInfo, md_whp12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940307) -static struct BurnRomInfo md_whp11RomDesc[] = { - { "world heroes (usa) (prototype - mar 07, 1994).bin", 0x200000, 0x45c29350, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp11) -STD_ROM_FN(md_whp11) - -struct BurnDriver BurnDrvmd_whp11 = { - "md_whp11", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940307)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp11RomInfo, md_whp11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940309) -static struct BurnRomInfo md_whp10RomDesc[] = { - { "world heroes (usa) (prototype - mar 09, 1994).bin", 0x200000, 0x2c7f9e64, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp10) -STD_ROM_FN(md_whp10) - -struct BurnDriver BurnDrvmd_whp10 = { - "md_whp10", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940309)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp10RomInfo, md_whp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940315) -static struct BurnRomInfo md_whp09RomDesc[] = { - { "world heroes (usa) (prototype - mar 15, 1994).bin", 0x200000, 0x2c0b2f4f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp09) -STD_ROM_FN(md_whp09) - -struct BurnDriver BurnDrvmd_whp09 = { - "md_whp09", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940315)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp09RomInfo, md_whp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940316) -static struct BurnRomInfo md_whp08RomDesc[] = { - { "world heroes (usa) (prototype - mar 16, 1994).bin", 0x200000, 0x19c74e2a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp08) -STD_ROM_FN(md_whp08) - -struct BurnDriver BurnDrvmd_whp08 = { - "md_whp08", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940316)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp08RomInfo, md_whp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940318) -static struct BurnRomInfo md_whp07RomDesc[] = { - { "world heroes (usa) (prototype - mar 18, 1994).bin", 0x200000, 0x2bc2a6bb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp07) -STD_ROM_FN(md_whp07) - -struct BurnDriver BurnDrvmd_whp07 = { - "md_whp07", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940318)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp07RomInfo, md_whp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940322, broken - C07 missing) -static struct BurnRomInfo md_whp06RomDesc[] = { - { "world heroes (usa) (prototype - mar 22, 1994) (broken - c07 missing).bin", 0x200000, 0x5c3c0931, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp06) -STD_ROM_FN(md_whp06) - -struct BurnDriver BurnDrvmd_whp06 = { - "md_whp06", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940322, broken - C07 missing)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp06RomInfo, md_whp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940323) -static struct BurnRomInfo md_whp05RomDesc[] = { - { "world heroes (usa) (prototype - mar 23, 1994).bin", 0x200000, 0x587e6739, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp05) -STD_ROM_FN(md_whp05) - -struct BurnDriver BurnDrvmd_whp05 = { - "md_whp05", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940323)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp05RomInfo, md_whp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940324) -static struct BurnRomInfo md_whp04RomDesc[] = { - { "world heroes (usa) (prototype - mar 24, 1994).bin", 0x200000, 0x8a656942, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp04) -STD_ROM_FN(md_whp04) - -struct BurnDriver BurnDrvmd_whp04 = { - "md_whp04", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940324)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp04RomInfo, md_whp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Heroes (USA, Prototype, 19940330) -static struct BurnRomInfo md_whp03RomDesc[] = { - { "world heroes (usa) (prototype - mar 30, 1994).bin", 0x200000, 0x50c797cb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whp03) -STD_ROM_FN(md_whp03) - -struct BurnDriver BurnDrvmd_whp03 = { - "md_whp03", "md_wh", NULL, NULL, "1994", - "World Heroes (USA, Prototype, 19940330)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_whp03RomInfo, md_whp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World of Illusion Starring Mickey Mouse and Donald Duck (Euro) -static struct BurnRomInfo md_worldillRomDesc[] = { - { "mpr-15271.bin", 0x100000, 0x121c6a49, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_worldill) -STD_ROM_FN(md_worldill) - -struct BurnDriver BurnDrvmd_worldill = { - "md_worldill", NULL, NULL, NULL, "1992", - "World of Illusion Starring Mickey Mouse and Donald Duck (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_worldillRomInfo, md_worldillRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World of Illusion - Fushigi na Magic Box (Jpn) -static struct BurnRomInfo md_worldilljRomDesc[] = { - { "world of illusion - fushigi na magic box (jpn).bin", 0x100000, 0xcb9ee238, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_worldillj) -STD_ROM_FN(md_worldillj) - -struct BurnDriver BurnDrvmd_worldillj = { - "md_worldillj", "md_worldill", NULL, NULL, "1992", - "World of Illusion - Fushigi na Magic Box (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_worldilljRomInfo, md_worldilljRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World of Illusion - Fushigi na Magic Box (Jpn, Prototype) -static struct BurnRomInfo md_worldilljpRomDesc[] = { - { "world of illusion - fushigi na magic box (jpn) (beta).bin", 0x100000, 0x577f680f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_worldilljp) -STD_ROM_FN(md_worldilljp) - -struct BurnDriver BurnDrvmd_worldilljp = { - "md_worldilljp", "md_worldill", NULL, NULL, "1992", - "World of Illusion - Fushigi na Magic Box (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_worldilljpRomInfo, md_worldilljpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World of Illusion Starring Mickey Mouse and Donald Duck (USA, Kor) -static struct BurnRomInfo md_worldilluRomDesc[] = { - { "world of illusion starring mickey mouse and donald duck (usa, kor).bin", 0x100000, 0x921ebd1c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_worldillu) -STD_ROM_FN(md_worldillu) - -struct BurnDriver BurnDrvmd_worldillu = { - "md_worldillu", "md_worldill", NULL, NULL, "1992", - "World of Illusion Starring Mickey Mouse and Donald Duck (USA, Kor)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_worldilluRomInfo, md_worldilluRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA) -static struct BurnRomInfo md_wsb95RomDesc[] = { - { "world series baseball '95 (usa).bin", 0x300000, 0x25130077, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95) -STD_ROM_FN(md_wsb95) - -struct BurnDriver BurnDrvmd_wsb95 = { - "md_wsb95", NULL, NULL, NULL, "1995", - "World Series Baseball '95 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95RomInfo, md_wsb95RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19941208) -static struct BurnRomInfo md_wsb95p23RomDesc[] = { - { "world series baseball '95 (prototype - dec 08, 1994).bin", 0x300000, 0x8846b050, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p23) -STD_ROM_FN(md_wsb95p23) - -struct BurnDriver BurnDrvmd_wsb95p23 = { - "md_wsb95p23", "md_wsb95", NULL, NULL, "1994", - "World Series Baseball '95 (USA, Prototype, 19941208)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p23RomInfo, md_wsb95p23RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19941214) -static struct BurnRomInfo md_wsb95p22RomDesc[] = { - { "world series baseball '95 (prototype - dec 14, 1994).bin", 0x300000, 0x385be354, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p22) -STD_ROM_FN(md_wsb95p22) - -struct BurnDriver BurnDrvmd_wsb95p22 = { - "md_wsb95p22", "md_wsb95", NULL, NULL, "1994", - "World Series Baseball '95 (USA, Prototype, 19941214)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p22RomInfo, md_wsb95p22RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19941228-SB) -static struct BurnRomInfo md_wsb95p21RomDesc[] = { - { "world series baseball '95 (prototype - dec 28, 1994 - sb).bin", 0x300000, 0x9e6dbc7c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p21) -STD_ROM_FN(md_wsb95p21) - -struct BurnDriver BurnDrvmd_wsb95p21 = { - "md_wsb95p21", "md_wsb95", NULL, NULL, "1994", - "World Series Baseball '95 (USA, Prototype, 19941228-SB)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p21RomInfo, md_wsb95p21RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950202) -static struct BurnRomInfo md_wsb95p09RomDesc[] = { - { "world series baseball '95 (prototype - feb 02, 1995).bin", 0x300000, 0xa947fe5c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p09) -STD_ROM_FN(md_wsb95p09) - -struct BurnDriver BurnDrvmd_wsb95p09 = { - "md_wsb95p09", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950202)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p09RomInfo, md_wsb95p09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950203) -static struct BurnRomInfo md_wsb95p08RomDesc[] = { - { "world series baseball '95 (prototype - feb 03, 1995).bin", 0x300000, 0x1f3754fc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p08) -STD_ROM_FN(md_wsb95p08) - -struct BurnDriver BurnDrvmd_wsb95p08 = { - "md_wsb95p08", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950203)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p08RomInfo, md_wsb95p08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950207) -static struct BurnRomInfo md_wsb95p07RomDesc[] = { - { "world series baseball '95 (prototype - feb 07, 1995).bin", 0x300000, 0xe4056559, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p07) -STD_ROM_FN(md_wsb95p07) - -struct BurnDriver BurnDrvmd_wsb95p07 = { - "md_wsb95p07", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950207)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p07RomInfo, md_wsb95p07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950209-B) -static struct BurnRomInfo md_wsb95p06RomDesc[] = { - { "world series baseball '95 (prototype - feb 09, 1995 - b).bin", 0x300000, 0x33bb9eda, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p06) -STD_ROM_FN(md_wsb95p06) - -struct BurnDriver BurnDrvmd_wsb95p06 = { - "md_wsb95p06", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950209-B)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p06RomInfo, md_wsb95p06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950209) -static struct BurnRomInfo md_wsb95p05RomDesc[] = { - { "world series baseball '95 (prototype - feb 09, 1995).bin", 0x300000, 0x83be98cf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p05) -STD_ROM_FN(md_wsb95p05) - -struct BurnDriver BurnDrvmd_wsb95p05 = { - "md_wsb95p05", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950209)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p05RomInfo, md_wsb95p05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950211) -static struct BurnRomInfo md_wsb95p04RomDesc[] = { - { "world series baseball '95 (prototype - feb 11, 1995).bin", 0x300000, 0xa0664fe9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p04) -STD_ROM_FN(md_wsb95p04) - -struct BurnDriver BurnDrvmd_wsb95p04 = { - "md_wsb95p04", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950211)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p04RomInfo, md_wsb95p04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950212) -static struct BurnRomInfo md_wsb95p03RomDesc[] = { - { "world series baseball '95 (prototype - feb 12, 1995).bin", 0x300000, 0x45da8f18, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p03) -STD_ROM_FN(md_wsb95p03) - -struct BurnDriver BurnDrvmd_wsb95p03 = { - "md_wsb95p03", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950212)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p03RomInfo, md_wsb95p03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950213) -static struct BurnRomInfo md_wsb95p02RomDesc[] = { - { "world series baseball '95 (prototype - feb 13, 1995).bin", 0x300000, 0x9f30ae30, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p02) -STD_ROM_FN(md_wsb95p02) - -struct BurnDriver BurnDrvmd_wsb95p02 = { - "md_wsb95p02", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950213)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p02RomInfo, md_wsb95p02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950214) -static struct BurnRomInfo md_wsb95p01RomDesc[] = { - { "world series baseball '95 (prototype - feb 14, 1995).bin", 0x300000, 0xf300a857, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p01) -STD_ROM_FN(md_wsb95p01) - -struct BurnDriver BurnDrvmd_wsb95p01 = { - "md_wsb95p01", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950214)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p01RomInfo, md_wsb95p01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950101-TST) -static struct BurnRomInfo md_wsb95p20RomDesc[] = { - { "world series baseball '95 (prototype - jan 01, 1995 - tst).bin", 0x300000, 0xc7574372, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p20) -STD_ROM_FN(md_wsb95p20) - -struct BurnDriver BurnDrvmd_wsb95p20 = { - "md_wsb95p20", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950101-TST)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p20RomInfo, md_wsb95p20RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950103-TST) -static struct BurnRomInfo md_wsb95p19RomDesc[] = { - { "world series baseball '95 (prototype - jan 03, 1995 - tst).bin", 0x300000, 0x498363f7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p19) -STD_ROM_FN(md_wsb95p19) - -struct BurnDriver BurnDrvmd_wsb95p19 = { - "md_wsb95p19", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950103-TST)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p19RomInfo, md_wsb95p19RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950105) -static struct BurnRomInfo md_wsb95p18RomDesc[] = { - { "world series baseball '95 (prototype - jan 05, 1995).bin", 0x300000, 0x1820abfb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p18) -STD_ROM_FN(md_wsb95p18) - -struct BurnDriver BurnDrvmd_wsb95p18 = { - "md_wsb95p18", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950105)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p18RomInfo, md_wsb95p18RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950109-TST) -static struct BurnRomInfo md_wsb95p17RomDesc[] = { - { "world series baseball '95 (prototype - jan 09, 1995 - tst).bin", 0x300000, 0x3de7cdbc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p17) -STD_ROM_FN(md_wsb95p17) - -struct BurnDriver BurnDrvmd_wsb95p17 = { - "md_wsb95p17", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950109-TST)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p17RomInfo, md_wsb95p17RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950110) -static struct BurnRomInfo md_wsb95p16RomDesc[] = { - { "world series baseball '95 (prototype - jan 10, 1995).bin", 0x300000, 0xac2772b0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p16) -STD_ROM_FN(md_wsb95p16) - -struct BurnDriver BurnDrvmd_wsb95p16 = { - "md_wsb95p16", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950110)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p16RomInfo, md_wsb95p16RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950114-RM) -static struct BurnRomInfo md_wsb95p15RomDesc[] = { - { "world series baseball '95 (prototype - jan 14, 1995 - rm).bin", 0x301655, 0xf70b07cf, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p15) -STD_ROM_FN(md_wsb95p15) - -struct BurnDriver BurnDrvmd_wsb95p15 = { - "md_wsb95p15", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950114-RM)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p15RomInfo, md_wsb95p15RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950116) -static struct BurnRomInfo md_wsb95p14RomDesc[] = { - { "world series baseball '95 (prototype - jan 16, 1995).bin", 0x300000, 0xf0e22b21, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p14) -STD_ROM_FN(md_wsb95p14) - -struct BurnDriver BurnDrvmd_wsb95p14 = { - "md_wsb95p14", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950116)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p14RomInfo, md_wsb95p14RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950118-RM) -static struct BurnRomInfo md_wsb95p13RomDesc[] = { - { "world series baseball '95 (prototype - jan 18, 1995 - rm).bin", 0x3023d3, 0x5ce70f8f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p13) -STD_ROM_FN(md_wsb95p13) - -struct BurnDriver BurnDrvmd_wsb95p13 = { - "md_wsb95p13", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950118-RM)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p13RomInfo, md_wsb95p13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950120) -static struct BurnRomInfo md_wsb95p12RomDesc[] = { - { "world series baseball '95 (prototype - jan 20, 1995).bin", 0x300000, 0x16c15e46, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p12) -STD_ROM_FN(md_wsb95p12) - -struct BurnDriver BurnDrvmd_wsb95p12 = { - "md_wsb95p12", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950120)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p12RomInfo, md_wsb95p12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950125) -static struct BurnRomInfo md_wsb95p11RomDesc[] = { - { "world series baseball '95 (prototype - jan 25, 1995).bin", 0x300000, 0xb45d9e33, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p11) -STD_ROM_FN(md_wsb95p11) - -struct BurnDriver BurnDrvmd_wsb95p11 = { - "md_wsb95p11", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950125)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p11RomInfo, md_wsb95p11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '95 (USA, Prototype, 19950130) -static struct BurnRomInfo md_wsb95p10RomDesc[] = { - { "world series baseball '95 (prototype - jan 30, 1995).bin", 0x300000, 0x6aa76a9d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb95p10) -STD_ROM_FN(md_wsb95p10) - -struct BurnDriver BurnDrvmd_wsb95p10 = { - "md_wsb95p10", "md_wsb95", NULL, NULL, "1995", - "World Series Baseball '95 (USA, Prototype, 19950130)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb95p10RomInfo, md_wsb95p10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '96 (USA) -static struct BurnRomInfo md_wsb96RomDesc[] = { - { "world series baseball '96 (usa).bin", 0x300000, 0x04ee8272, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb96) -STD_ROM_FN(md_wsb96) - -struct BurnDriver BurnDrvmd_wsb96 = { - "md_wsb96", NULL, NULL, NULL, "1996", - "World Series Baseball '96 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb96RomInfo, md_wsb96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball '98 (USA) -static struct BurnRomInfo md_wsb98RomDesc[] = { - { "world series baseball '98 (usa).bin", 0x300000, 0x05b1ab53, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb98) -STD_ROM_FN(md_wsb98) - -struct BurnDriver BurnDrvmd_wsb98 = { - "md_wsb98", NULL, NULL, NULL, "1997", - "World Series Baseball '98 (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsb98RomInfo, md_wsb98RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA) -static struct BurnRomInfo md_wsbRomDesc[] = { - { "world series baseball (usa).bin", 0x200000, 0x57c1d5ec, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsb) -STD_ROM_FN(md_wsb) - -struct BurnDriver BurnDrvmd_wsb = { - "md_wsb", NULL, NULL, NULL, "1994", - "World Series Baseball (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsbRomInfo, md_wsbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19931222) -static struct BurnRomInfo md_wsbp09RomDesc[] = { - { "world series baseball (prototype - dec 22, 1993).bin", 0x1fc05d, 0x0dc0558d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp09) -STD_ROM_FN(md_wsbp09) - -struct BurnDriver BurnDrvmd_wsbp09 = { - "md_wsbp09", "md_wsb", NULL, NULL, "1993", - "World Series Baseball (USA, Prototype, 19931222)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp09RomInfo, md_wsbp09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19931226) -static struct BurnRomInfo md_wsbp08RomDesc[] = { - { "world series baseball (prototype - dec 26, 1993).bin", 0x200000, 0x472e6a58, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp08) -STD_ROM_FN(md_wsbp08) - -struct BurnDriver BurnDrvmd_wsbp08 = { - "md_wsbp08", "md_wsb", NULL, NULL, "1993", - "World Series Baseball (USA, Prototype, 19931226)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp08RomInfo, md_wsbp08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19931229) -static struct BurnRomInfo md_wsbp07RomDesc[] = { - { "world series baseball (prototype - dec 29, 1993).bin", 0x200000, 0xed949936, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp07) -STD_ROM_FN(md_wsbp07) - -struct BurnDriver BurnDrvmd_wsbp07 = { - "md_wsbp07", "md_wsb", NULL, NULL, "1993", - "World Series Baseball (USA, Prototype, 19931229)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp07RomInfo, md_wsbp07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19940218) -static struct BurnRomInfo md_wsbp03RomDesc[] = { - { "world series baseball (prototype - feb 18, 1994).bin", 0x200000, 0x3cadfc50, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp03) -STD_ROM_FN(md_wsbp03) - -struct BurnDriver BurnDrvmd_wsbp03 = { - "md_wsbp03", "md_wsb", NULL, NULL, "1994", - "World Series Baseball (USA, Prototype, 19940218)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp03RomInfo, md_wsbp03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19940103) -static struct BurnRomInfo md_wsbp06RomDesc[] = { - { "world series baseball (prototype - jan 03, 1994).bin", 0x200000, 0x4b53f035, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp06) -STD_ROM_FN(md_wsbp06) - -struct BurnDriver BurnDrvmd_wsbp06 = { - "md_wsbp06", "md_wsb", NULL, NULL, "1994", - "World Series Baseball (USA, Prototype, 19940103)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp06RomInfo, md_wsbp06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19940106) -static struct BurnRomInfo md_wsbp05RomDesc[] = { - { "world series baseball (prototype - jan 06, 1994).bin", 0x200000, 0xb07de2d3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp05) -STD_ROM_FN(md_wsbp05) - -struct BurnDriver BurnDrvmd_wsbp05 = { - "md_wsbp05", "md_wsb", NULL, NULL, "1994", - "World Series Baseball (USA, Prototype, 19940106)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp05RomInfo, md_wsbp05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19940116) -static struct BurnRomInfo md_wsbp04RomDesc[] = { - { "world series baseball (prototype - jan 16, 1994).bin", 0x200000, 0x5322133e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp04) -STD_ROM_FN(md_wsbp04) - -struct BurnDriver BurnDrvmd_wsbp04 = { - "md_wsbp04", "md_wsb", NULL, NULL, "1994", - "World Series Baseball (USA, Prototype, 19940116)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp04RomInfo, md_wsbp04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19940304) -static struct BurnRomInfo md_wsbp02RomDesc[] = { - { "world series baseball (prototype - mar 04, 1994).bin", 0x1feaa2, 0xedda44a5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp02) -STD_ROM_FN(md_wsbp02) - -struct BurnDriver BurnDrvmd_wsbp02 = { - "md_wsbp02", "md_wsb", NULL, NULL, "1994", - "World Series Baseball (USA, Prototype, 19940304)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp02RomInfo, md_wsbp02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19940527) -static struct BurnRomInfo md_wsbp01RomDesc[] = { - { "world series baseball (prototype - may 27, 1994).bin", 0x200000, 0xe473728a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp01) -STD_ROM_FN(md_wsbp01) - -struct BurnDriver BurnDrvmd_wsbp01 = { - "md_wsbp01", "md_wsb", NULL, NULL, "1994", - "World Series Baseball (USA, Prototype, 19940527)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp01RomInfo, md_wsbp01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// World Series Baseball (USA, Prototype, 19931001) -static struct BurnRomInfo md_wsbp10RomDesc[] = { - { "world series baseball (prototype - oct 01, 1993).bin", 0x200000, 0x4f7ab92e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wsbp10) -STD_ROM_FN(md_wsbp10) - -struct BurnDriver BurnDrvmd_wsbp10 = { - "md_wsbp10", "md_wsb", NULL, NULL, "1993", - "World Series Baseball (USA, Prototype, 19931001)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wsbp10RomInfo, md_wsbp10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Worms (Euro) -static struct BurnRomInfo md_wormsRomDesc[] = { - { "worms (euro).bin", 0x200000, 0xb9a8b299, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_worms) -STD_ROM_FN(md_worms) - -struct BurnDriver BurnDrvmd_worms = { - "md_worms", NULL, NULL, NULL, "1995", - "Worms (Euro)\0", NULL, "Ocean", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wormsRomInfo, md_wormsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Worms (Euro, Prototype) -static struct BurnRomInfo md_wormspRomDesc[] = { - { "worms (euro) (beta).bin", 0x200000, 0x1d191694, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wormsp) -STD_ROM_FN(md_wormsp) - -struct BurnDriver BurnDrvmd_wormsp = { - "md_wormsp", "md_worms", NULL, NULL, "1995", - "Worms (Euro, Prototype)\0", NULL, "Ocean", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wormspRomInfo, md_wormspRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wrestle War (Euro, Jpn) -static struct BurnRomInfo md_wrestwarRomDesc[] = { - { "mpr-14025.bin", 0x080000, 0x2d162a85, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wrestwar) -STD_ROM_FN(md_wrestwar) - -struct BurnDriver BurnDrvmd_wrestwar = { - "md_wrestwar", NULL, NULL, NULL, "1991", - "Wrestle War (Euro, Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wrestwarRomInfo, md_wrestwarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wrestle War (Jpn, Prototype) -static struct BurnRomInfo md_wrestwarpRomDesc[] = { - { "wrestle war (jpn) (beta).bin", 0x080000, 0x1cdee87b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wrestwarp) -STD_ROM_FN(md_wrestwarp) - -struct BurnDriver BurnDrvmd_wrestwarp = { - "md_wrestwarp", "md_wrestwar", NULL, NULL, "1991", - "Wrestle War (Jpn, Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wrestwarpRomInfo, md_wrestwarpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wu Kong Wai Zhuan (Chi) -static struct BurnRomInfo md_wukongRomDesc[] = { - { "wu kong wai zhuan (chi) (unl).bin", 0x200000, 0x880a916e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wukong) -STD_ROM_FN(md_wukong) - -struct BurnDriver BurnDrvmd_wukong = { - "md_wukong", NULL, NULL, NULL, "1996", - "Wu Kong Wai Zhuan (Chi)\0", NULL, "Ming", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_wukongRomInfo, md_wukongRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// WWF Raw (World) -static struct BurnRomInfo md_wwfrawRomDesc[] = { - { "wwf raw (world).bin", 0x300000, 0x4ef5d411, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wwfraw) -STD_ROM_FN(md_wwfraw) - -struct BurnDriver BurnDrvmd_wwfraw = { - "md_wwfraw", NULL, NULL, NULL, "1994", - "WWF Raw (World)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wwfrawRomInfo, md_wwfrawRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// WWF Royal Rumble (World) -static struct BurnRomInfo md_wwfroyalRomDesc[] = { - { "wwf royal rumble (world).bin", 0x200000, 0xb69dc53e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wwfroyal) -STD_ROM_FN(md_wwfroyal) - -struct BurnDriver BurnDrvmd_wwfroyal = { - "md_wwfroyal", NULL, NULL, NULL, "1994", - "WWF Royal Rumble (World)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wwfroyalRomInfo, md_wwfroyalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// WWF Super WrestleMania (Euro, USA) -static struct BurnRomInfo md_wwfsupRomDesc[] = { - { "mpr-15215.bin", 0x100000, 0xb929d6c5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wwfsup) -STD_ROM_FN(md_wwfsup) - -struct BurnDriver BurnDrvmd_wwfsup = { - "md_wwfsup", NULL, NULL, NULL, "1992", - "WWF Super WrestleMania (Euro, USA)\0", NULL, "Flying Edge", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wwfsupRomInfo, md_wwfsupRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// WWF WrestleMania - The Arcade Game (Euro, USA) -static struct BurnRomInfo md_wwfagRomDesc[] = { - { "9539d+9540d.bin", 0x400000, 0xa5d023f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wwfag) -STD_ROM_FN(md_wwfag) - -struct BurnDriver BurnDrvmd_wwfag = { - "md_wwfag", NULL, NULL, NULL, "1995", - "WWF WrestleMania - The Arcade Game (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wwfagRomInfo, md_wwfagRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// WWF WrestleMania - The Arcade Game (USA, Prototype) -static struct BurnRomInfo md_wwfagpRomDesc[] = { - { "wwf wrestlemania - the arcade game (usa) (alpha).bin", 0x040000, 0x719d6155, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wwfagp) -STD_ROM_FN(md_wwfagp) - -struct BurnDriver BurnDrvmd_wwfagp = { - "md_wwfagp", "md_wwfag", NULL, NULL, "1995", - "WWF WrestleMania - The Arcade Game (USA, Prototype)\0", NULL, "Acclaim Entertainment", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wwfagpRomInfo, md_wwfagpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men (Euro) -static struct BurnRomInfo md_xmenRomDesc[] = { - { "mpr-15505.bin", 0x100000, 0x0b78ca97, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen) -STD_ROM_FN(md_xmen) - -struct BurnDriver BurnDrvmd_xmen = { - "md_xmen", NULL, NULL, NULL, "1993", - "X-Men (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmenRomInfo, md_xmenRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men (USA) -static struct BurnRomInfo md_xmenuRomDesc[] = { - { "x-men (usa).bin", 0x100000, 0xf71b21b4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmenu) -STD_ROM_FN(md_xmenu) - -struct BurnDriver BurnDrvmd_xmenu = { - "md_xmenu", "md_xmen", NULL, NULL, "1993", - "X-Men (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmenuRomInfo, md_xmenuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Euro, USA) -static struct BurnRomInfo md_xmen2RomDesc[] = { - { "x-men 2 - clone wars (euro, usa).bin", 0x200000, 0x710bc628, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2) -STD_ROM_FN(md_xmen2) - -struct BurnDriver BurnDrvmd_xmen2 = { - "md_xmen2", NULL, NULL, NULL, "1995", - "X-Men 2 - Clone Wars (Euro, USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2RomInfo, md_xmen2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941202) -static struct BurnRomInfo md_xmen2p12RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 02, 1994).bin", 0x1fbe22, 0x7ad7a4e9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p12) -STD_ROM_FN(md_xmen2p12) - -struct BurnDriver BurnDrvmd_xmen2p12 = { - "md_xmen2p12", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941202)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p12RomInfo, md_xmen2p12RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941203) -static struct BurnRomInfo md_xmen2p11RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 03, 1994).bin", 0x200000, 0x669b939c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p11) -STD_ROM_FN(md_xmen2p11) - -struct BurnDriver BurnDrvmd_xmen2p11 = { - "md_xmen2p11", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941203)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p11RomInfo, md_xmen2p11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941206) -static struct BurnRomInfo md_xmen2p10RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 06, 1994).bin", 0x200000, 0x5b1d0cf5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p10) -STD_ROM_FN(md_xmen2p10) - -struct BurnDriver BurnDrvmd_xmen2p10 = { - "md_xmen2p10", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941206)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p10RomInfo, md_xmen2p10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941207) -static struct BurnRomInfo md_xmen2p09RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 07, 1994).bin", 0x200000, 0x246a30da, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p09) -STD_ROM_FN(md_xmen2p09) - -struct BurnDriver BurnDrvmd_xmen2p09 = { - "md_xmen2p09", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941207)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p09RomInfo, md_xmen2p09RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941208) -static struct BurnRomInfo md_xmen2p08RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 08, 1994).bin", 0x1feedc, 0xc6d90b1c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p08) -STD_ROM_FN(md_xmen2p08) - -struct BurnDriver BurnDrvmd_xmen2p08 = { - "md_xmen2p08", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941208)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p08RomInfo, md_xmen2p08RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941209) -static struct BurnRomInfo md_xmen2p07RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 09, 1994).bin", 0x200000, 0x28307b58, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p07) -STD_ROM_FN(md_xmen2p07) - -struct BurnDriver BurnDrvmd_xmen2p07 = { - "md_xmen2p07", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941209)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p07RomInfo, md_xmen2p07RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941210) -static struct BurnRomInfo md_xmen2p06RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 10, 1994).bin", 0x1ffaf0, 0x73e2effe, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p06) -STD_ROM_FN(md_xmen2p06) - -struct BurnDriver BurnDrvmd_xmen2p06 = { - "md_xmen2p06", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941210)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p06RomInfo, md_xmen2p06RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941211-A) -static struct BurnRomInfo md_xmen2p05RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 11, 1994 - a).bin", 0x200000, 0x11415b86, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p05) -STD_ROM_FN(md_xmen2p05) - -struct BurnDriver BurnDrvmd_xmen2p05 = { - "md_xmen2p05", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941211-A)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p05RomInfo, md_xmen2p05RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941211) -static struct BurnRomInfo md_xmen2p04RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 11, 1994).bin", 0x200000, 0x51876259, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p04) -STD_ROM_FN(md_xmen2p04) - -struct BurnDriver BurnDrvmd_xmen2p04 = { - "md_xmen2p04", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941211)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p04RomInfo, md_xmen2p04RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941214) -static struct BurnRomInfo md_xmen2p03RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 14, 1994).bin", 0x200000, 0xcd662de6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p03) -STD_ROM_FN(md_xmen2p03) - -struct BurnDriver BurnDrvmd_xmen2p03 = { - "md_xmen2p03", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941214)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p03RomInfo, md_xmen2p03RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941215) -static struct BurnRomInfo md_xmen2p02RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 15, 1994).bin", 0x1ffe54, 0xa5188e30, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p02) -STD_ROM_FN(md_xmen2p02) - -struct BurnDriver BurnDrvmd_xmen2p02 = { - "md_xmen2p02", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941215)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p02RomInfo, md_xmen2p02RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941216) -static struct BurnRomInfo md_xmen2p01RomDesc[] = { - { "x-men 2 - clone wars (prototype - dec 16, 1994).bin", 0x200000, 0xe8c40972, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p01) -STD_ROM_FN(md_xmen2p01) - -struct BurnDriver BurnDrvmd_xmen2p01 = { - "md_xmen2p01", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941216)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p01RomInfo, md_xmen2p01RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19940506) -static struct BurnRomInfo md_xmen2p19RomDesc[] = { - { "x-men 2 - clone wars (prototype - may 06, 1994).bin", 0x200000, 0xa720ebb4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p19) -STD_ROM_FN(md_xmen2p19) - -struct BurnDriver BurnDrvmd_xmen2p19 = { - "md_xmen2p19", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19940506)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p19RomInfo, md_xmen2p19RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19940510) -static struct BurnRomInfo md_xmen2p18RomDesc[] = { - { "x-men 2 - clone wars (prototype - may 10, 1994).bin", 0x200000, 0x9b5dd185, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p18) -STD_ROM_FN(md_xmen2p18) - -struct BurnDriver BurnDrvmd_xmen2p18 = { - "md_xmen2p18", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19940510)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p18RomInfo, md_xmen2p18RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941117) -static struct BurnRomInfo md_xmen2p16RomDesc[] = { - { "x-men 2 - clone wars (prototype - nov 17, 1994).bin", 0x200000, 0xd90cd0de, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p16) -STD_ROM_FN(md_xmen2p16) - -struct BurnDriver BurnDrvmd_xmen2p16 = { - "md_xmen2p16", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941117)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p16RomInfo, md_xmen2p16RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941123) -static struct BurnRomInfo md_xmen2p15RomDesc[] = { - { "x-men 2 - clone wars (prototype - nov 23, 1994).bin", 0x200000, 0x4386a381, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p15) -STD_ROM_FN(md_xmen2p15) - -struct BurnDriver BurnDrvmd_xmen2p15 = { - "md_xmen2p15", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941123)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p15RomInfo, md_xmen2p15RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941128) -static struct BurnRomInfo md_xmen2p14RomDesc[] = { - { "x-men 2 - clone wars (prototype - nov 28, 1994).bin", 0x200000, 0x70383a4d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p14) -STD_ROM_FN(md_xmen2p14) - -struct BurnDriver BurnDrvmd_xmen2p14 = { - "md_xmen2p14", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941128)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p14RomInfo, md_xmen2p14RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941130) -static struct BurnRomInfo md_xmen2p13RomDesc[] = { - { "x-men 2 - clone wars (prototype - nov 30, 1994).bin", 0x200000, 0x331dae0a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p13) -STD_ROM_FN(md_xmen2p13) - -struct BurnDriver BurnDrvmd_xmen2p13 = { - "md_xmen2p13", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941130)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p13RomInfo, md_xmen2p13RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-Men 2 - Clone Wars (Prototype, 19941018) -static struct BurnRomInfo md_xmen2p17RomDesc[] = { - { "x-men 2 - clone wars (prototype - oct 18, 1994).bin", 0x200000, 0x52cff37d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xmen2p17) -STD_ROM_FN(md_xmen2p17) - -struct BurnDriver BurnDrvmd_xmen2p17 = { - "md_xmen2p17", "md_xmen2", NULL, NULL, "1994", - "X-Men 2 - Clone Wars (Prototype, 19941018)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xmen2p17RomInfo, md_xmen2p17RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-perts (USA) -static struct BurnRomInfo md_xpertsRomDesc[] = { - { "x-perts (usa).bin", 0x400000, 0x57e8abfd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xperts) -STD_ROM_FN(md_xperts) - -struct BurnDriver BurnDrvmd_xperts = { - "md_xperts", NULL, NULL, NULL, "1996", - "X-perts (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xpertsRomInfo, md_xpertsRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// X-perts (Prototype) -static struct BurnRomInfo md_xpertspRomDesc[] = { - { "x-perts (prototype).bin", 0x400000, 0x9d067249, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xpertsp) -STD_ROM_FN(md_xpertsp) - -struct BurnDriver BurnDrvmd_xpertsp = { - "md_xpertsp", "md_xperts", NULL, NULL, "1996", - "X-perts (Prototype)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xpertspRomInfo, md_xpertspRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// XDR - X Dazedly Ray (Jpn) -static struct BurnRomInfo md_xdrRomDesc[] = { - { "xdr - x dazedly ray (jpn).bin", 0x080000, 0xab22d002, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xdr) -STD_ROM_FN(md_xdr) - -struct BurnDriver BurnDrvmd_xdr = { - "md_xdr", NULL, NULL, NULL, "1990", - "XDR - X Dazedly Ray (Jpn)\0", NULL, "Unipac", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xdrRomInfo, md_xdrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Xenon 2 - Megablast (Euro) -static struct BurnRomInfo md_xenon2RomDesc[] = { - { "mpr-15064.bin", 0x080000, 0x59abe7f9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xenon2) -STD_ROM_FN(md_xenon2) - -struct BurnDriver BurnDrvmd_xenon2 = { - "md_xenon2", NULL, NULL, NULL, "1992", - "Xenon 2 - Megablast (Euro)\0", NULL, "Virgin Games", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xenon2RomInfo, md_xenon2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Xiao Monv - Magic Girl (Chi) -static struct BurnRomInfo md_xiaomoRomDesc[] = { - { "xiao monv - magic girl (chi) (unl).bin", 0x080000, 0x8e49a92e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xiaomo) -STD_ROM_FN(md_xiaomo) - -struct BurnDriver BurnDrvmd_xiaomo = { - "md_xiaomo", NULL, NULL, NULL, "199?", - "Xiao Monv - Magic Girl (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_xiaomoRomInfo, md_xiaomoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Xin Qi Gai Wang Zi (Chi, Alt) -static struct BurnRomInfo md_xinqig1RomDesc[] = { - { "xin qi gai wang zi (chi) (alt) (unl).bin", 0x400000, 0xda5a4bfe, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xinqig1) -STD_ROM_FN(md_xinqig1) - -struct BurnDriver BurnDrvmd_xinqig1 = { - "md_xinqig1", "md_xinqig", NULL, NULL, "1996", - "Xin Qi Gai Wang Zi (Chi, Alt)\0", NULL, "C&E", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_BEGGAR, GBF_MISC, 0, - MegadriveGetZipName, md_xinqig1RomInfo, md_xinqig1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Xin Qi Gai Wang Zi (Chi) -static struct BurnRomInfo md_xinqigRomDesc[] = { - { "xin qi gai wang zi (chi) (unl).bin", 0x400000, 0xdd2f38b5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_xinqig) -STD_ROM_FN(md_xinqig) - -struct BurnDriver BurnDrvmd_xinqig = { - "md_xinqig", NULL, NULL, NULL, "1996", - "Xin Qi Gai Wang Zi (Chi)\0", NULL, "C&E", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_BEGGAR, GBF_MISC, 0, - MegadriveGetZipName, md_xinqigRomInfo, md_xinqigRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ya Se Chuan Shuo (Chi) -static struct BurnRomInfo md_yasechRomDesc[] = { - { "ya se chuan shuo (chi) (unl).bin", 0x200000, 0x095b9a15, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_yasech) -STD_ROM_FN(md_yasech) - -struct BurnDriver BurnDrvmd_yasech = { - "md_yasech", NULL, NULL, NULL, "1995", - "Ya Se Chuan Shuo (Chi)\0", NULL, "Chuanpu Technologies", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_yasechRomInfo, md_yasechRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Yang Jia Jiang - Yang Warrior Family (Chi) -static struct BurnRomInfo md_yangjiRomDesc[] = { - { "yang jia jiang - yang warrior family (chi) (unl).bin", 0x200000, 0x6604a79e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_yangji) -STD_ROM_FN(md_yangji) - -struct BurnDriver BurnDrvmd_yangji = { - "md_yangji", NULL, NULL, NULL, "199?", - "Yang Jia Jiang - Yang Warrior Family (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_yangjiRomInfo, md_yangjiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Yogi Bear's Cartoon Capers (Euro) -static struct BurnRomInfo md_yogibearRomDesc[] = { - { "yogi bear's cartoon capers (euro).bin", 0x100000, 0x204f97d8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_yogibear) -STD_ROM_FN(md_yogibear) - -struct BurnDriver BurnDrvmd_yogibear = { - "md_yogibear", NULL, NULL, NULL, "1994", - "Yogi Bear's Cartoon Capers (Euro)\0", NULL, "Empire Interactive", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_yogibearRomInfo, md_yogibearRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Young Indiana Jones Chronicles (USA, Prototype) -static struct BurnRomInfo md_youngindRomDesc[] = { - { "young indiana jones chronicles, the (usa) (prototype).bin", 0x080000, 0x44f6be35, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_youngind) -STD_ROM_FN(md_youngind) - -struct BurnDriver BurnDrvmd_youngind = { - "md_youngind", NULL, NULL, NULL, "199?", - "The Young Indiana Jones Chronicles (USA, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_youngindRomInfo, md_youngindRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ys III (USA) -static struct BurnRomInfo md_ys3RomDesc[] = { - { "ys iii (usa).bin", 0x100000, 0xea27976e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ys3) -STD_ROM_FN(md_ys3) - -struct BurnDriver BurnDrvmd_ys3 = { - "md_ys3", NULL, NULL, NULL, "1991", - "Ys III (USA)\0", NULL, "Renovation", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ys3RomInfo, md_ys3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ys - Wanderers from Ys (Jpn) -static struct BurnRomInfo md_ys3jRomDesc[] = { - { "ys - wanderers from ys (jpn).bin", 0x100000, 0x52da4e76, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ys3j) -STD_ROM_FN(md_ys3j) - -struct BurnDriver BurnDrvmd_ys3j = { - "md_ys3j", "md_ys3", NULL, NULL, "1991", - "Ys - Wanderers from Ys (Jpn)\0", NULL, "Reno", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_ys3jRomInfo, md_ys3jRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Yu Yu Hakusho - Makyou Toitsusen (Jpn) -static struct BurnRomInfo md_yuyumtRomDesc[] = { - { "yuu yuu hakusho - makyou toitsusen (jpn).bin", 0x300000, 0x71ceac6f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_yuyumt) -STD_ROM_FN(md_yuyumt) - -struct BurnDriver BurnDrvmd_yuyumt = { - "md_yuyumt", "md_yuyusf", NULL, NULL, "1994", - "Yu Yu Hakusho - Makyou Toitsusen (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_yuyumtRomInfo, md_yuyumtRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Yu Yu Hakusho - Sunset Fighters (Bra) -static struct BurnRomInfo md_yuyusfRomDesc[] = { - { "yuu yuu hakusho - sunset fighters (bra).bin", 0x300000, 0xfe3fb8ee, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_yuyusf) -STD_ROM_FN(md_yuyusf) - -struct BurnDriver BurnDrvmd_yuyusf = { - "md_yuyusf", NULL, NULL, NULL, "199?", - "Yu Yu Hakusho - Sunset Fighters (Bra)\0", NULL, "Tec Toy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_yuyusfRomInfo, md_yuyusfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Yu Yu Hakusho Gaiden (Jpn) -static struct BurnRomInfo md_yuyugRomDesc[] = { - { "yuu yuu hakusho gaiden (jpn).bin", 0x200000, 0x7dc98176, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_yuyug) -STD_ROM_FN(md_yuyug) - -struct BurnDriver BurnDrvmd_yuyug = { - "md_yuyug", NULL, NULL, NULL, "1994", - "Yu Yu Hakusho Gaiden (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_yuyugRomInfo, md_yuyugRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zan Yasha Enbukyoku (Jpn) -static struct BurnRomInfo md_zanyashaRomDesc[] = { - { "zan yasha enbukyoku (jpn).bin", 0x080000, 0x637fe8f3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zanyasha) -STD_ROM_FN(md_zanyasha) - -struct BurnDriver BurnDrvmd_zanyasha = { - "md_zanyasha", NULL, NULL, NULL, "1991", - "Zan Yasha Enbukyoku (Jpn)\0", NULL, "Wolf Team", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_zanyashaRomInfo, md_zanyashaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zany Golf (Euro, USA) -static struct BurnRomInfo md_zanygolf1RomDesc[] = { - { "zany golf (euro, usa).bin", 0x080000, 0xed5d12ea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zanygolf1) -STD_ROM_FN(md_zanygolf1) - -struct BurnDriver BurnDrvmd_zanygolf1 = { - "md_zanygolf1", "md_zanygolf", NULL, NULL, "1990", - "Zany Golf (Euro, USA)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zanygolf1RomInfo, md_zanygolf1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zero the Kamikaze Squirrel (Euro) -static struct BurnRomInfo md_zeroRomDesc[] = { - { "zero the kamikaze squirrel (euro).bin", 0x200000, 0x45ff0b4b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zero) -STD_ROM_FN(md_zero) - -struct BurnDriver BurnDrvmd_zero = { - "md_zero", NULL, NULL, NULL, "1994", - "Zero the Kamikaze Squirrel (Euro)\0", NULL, "SunSoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zeroRomInfo, md_zeroRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zero the Kamikaze Squirrel (USA) -static struct BurnRomInfo md_zerouRomDesc[] = { - { "zero the kamikaze squirrel (usa).bin", 0x200000, 0x423968df, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zerou) -STD_ROM_FN(md_zerou) - -struct BurnDriver BurnDrvmd_zerou = { - "md_zerou", "md_zero", NULL, NULL, "1994", - "Zero the Kamikaze Squirrel (USA)\0", NULL, "SunSoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zerouRomInfo, md_zerouRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zero Wing (Euro) -static struct BurnRomInfo md_zerowingRomDesc[] = { - { "mpr-14463.bin", 0x100000, 0x89b744a3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zerowing) -STD_ROM_FN(md_zerowing) - -struct BurnDriver BurnDrvmd_zerowing = { - "md_zerowing", NULL, NULL, NULL, "1991", - "Zero Wing (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zerowingRomInfo, md_zerowingRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zero Wing (Jpn) -static struct BurnRomInfo md_zerowingjRomDesc[] = { - { "zero wing (jpn).bin", 0x100000, 0x7e203d2b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zerowingj) -STD_ROM_FN(md_zerowingj) - -struct BurnDriver BurnDrvmd_zerowingj = { - "md_zerowingj", "md_zerowing", NULL, NULL, "1991", - "Zero Wing (Jpn)\0", NULL, "Toaplan", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zerowingjRomInfo, md_zerowingjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zhuo Gui Da Shi - Ghost Hunter (Chi) -static struct BurnRomInfo md_zhuoguRomDesc[] = { - { "zhuo gui da shi - ghost hunter (chi) (unl).bin", 0x080000, 0x76c62a8b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zhuogu) -STD_ROM_FN(md_zhuogu) - -struct BurnDriver BurnDrvmd_zhuogu = { - "md_zhuogu", NULL, NULL, NULL, "1994", - "Zhuo Gui Da Shi - Ghost Hunter (Chi)\0", NULL, "Shenchi Technology", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zhuoguRomInfo, md_zhuoguRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zombie High (USA, Prototype) -static struct BurnRomInfo md_zombhighRomDesc[] = { - { "zombie high (usa) (prototype).bin", 0x0fa0ef, 0x7bea6194, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zombhigh) -STD_ROM_FN(md_zombhigh) - -struct BurnDriver BurnDrvmd_zombhigh = { - "md_zombhigh", NULL, NULL, NULL, "199?", - "Zombie High (USA, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zombhighRomInfo, md_zombhighRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zombies (Euro) -static struct BurnRomInfo md_zombiesRomDesc[] = { - { "zombies (euro).bin", 0x100000, 0x179a1aa2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zombies) -STD_ROM_FN(md_zombies) - -struct BurnDriver BurnDrvmd_zombies = { - "md_zombies", NULL, NULL, NULL, "1993", - "Zombies (Euro)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zombiesRomInfo, md_zombiesRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zombies Ate My Neighbors (USA) -static struct BurnRomInfo md_zombiesuRomDesc[] = { - { "zombies ate my neighbors (usa).bin", 0x100000, 0x2bf3626f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zombiesu) -STD_ROM_FN(md_zombiesu) - -struct BurnDriver BurnDrvmd_zombiesu = { - "md_zombiesu", "md_zombies", NULL, NULL, "1994", - "Zombies Ate My Neighbors (USA)\0", NULL, "Konami", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zombiesuRomInfo, md_zombiesuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zool (Euro) -static struct BurnRomInfo md_zoolRomDesc[] = { - { "zool04.bin", 0x100000, 0x1ee58b03, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zool) -STD_ROM_FN(md_zool) - -struct BurnDriver BurnDrvmd_zool = { - "md_zool", NULL, NULL, NULL, "1993", - "Zool (Euro)\0", NULL, "Electronic Arts", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zoolRomInfo, md_zoolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zool (USA) -static struct BurnRomInfo md_zooluRomDesc[] = { - { "zool - ninja of the 'nth' dimension (usa).bin", 0x100000, 0xcb2939f1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zoolu) -STD_ROM_FN(md_zoolu) - -struct BurnDriver BurnDrvmd_zoolu = { - "md_zoolu", "md_zool", NULL, NULL, "1993", - "Zool (USA)\0", NULL, "GameTek", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zooluRomInfo, md_zooluRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zoop (Euro) -static struct BurnRomInfo md_zoopRomDesc[] = { - { "mpr-18564.bin", 0x080000, 0x2fdac6ab, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zoop) -STD_ROM_FN(md_zoop) - -struct BurnDriver BurnDrvmd_zoop = { - "md_zoop", NULL, NULL, NULL, "1995", - "Zoop (Euro)\0", NULL, "Viacom New Media", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zoopRomInfo, md_zoopRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Zoop (USA) -static struct BurnRomInfo md_zoopuRomDesc[] = { - { "zoop (usa).bin", 0x080000, 0xa899befa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_zoopu) -STD_ROM_FN(md_zoopu) - -struct BurnDriver BurnDrvmd_zoopu = { - "md_zoopu", "md_zoop", NULL, NULL, "1995", - "Zoop (USA)\0", NULL, "Viacom New Media", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_zoopuRomInfo, md_zoopuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Flux (Euro) -static struct BurnRomInfo md_fluxRomDesc[] = { - { "flux (euro).bin", 0x040000, 0x2a1da08c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_flux) -STD_ROM_FN(md_flux) - -struct BurnDriver BurnDrvmd_flux = { - "md_flux", NULL, NULL, NULL, "199?", - "Flux (Euro)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fluxRomInfo, md_fluxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Anser (Jpn) -static struct BurnRomInfo md_meganserRomDesc[] = { - { "mega anser (jpn).bin", 0x080000, 0x08ece367, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_meganser) -STD_ROM_FN(md_meganser) - -struct BurnDriver BurnDrvmd_meganser = { - "md_meganser", NULL, NULL, NULL, "199?", - "Mega Anser (Jpn)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_meganserRomInfo, md_meganserRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// MegaNet (Bra) -static struct BurnRomInfo md_meganetRomDesc[] = { - { "meganet (bra).bin", 0x040000, 0xfab33cc2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_meganet) -STD_ROM_FN(md_meganet) - -struct BurnDriver BurnDrvmd_meganet = { - "md_meganet", NULL, NULL, NULL, "199?", - "MegaNet (Bra)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_meganetRomInfo, md_meganetRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sega Channel (Scientific Atlanta) (USA) -static struct BurnRomInfo md_segachnlRomDesc[] = { - { "sega channel (usa).bin", 0x040000, 0xbc79b6ed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_segachnl) -STD_ROM_FN(md_segachnl) - -struct BurnDriver BurnDrvmd_segachnl = { - "md_segachnl", NULL, NULL, NULL, "199?", - "Sega Channel (Scientific Atlanta) (USA)\0", NULL, "Scientific Atlanta", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_segachnlRomInfo, md_segachnlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sega Channel (General Instrument) (USA) -static struct BurnRomInfo md_segachnlaRomDesc[] = { - { "sega channel (general instruments) (usa).bin", 0x080000, 0x5df93f11, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_segachnla) -STD_ROM_FN(md_segachnla) - -struct BurnDriver BurnDrvmd_segachnla = { - "md_segachnla", "md_segachnl", NULL, NULL, "199?", - "Sega Channel (General Instrument) (USA)\0", NULL, "Scientific Atlanta", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_segachnlaRomInfo, md_segachnlaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sega Channel Demo (USA) -static struct BurnRomInfo md_segachdRomDesc[] = { - { "sega channel demo (usa).bin", 0x080000, 0x2abae889, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_segachd) -STD_ROM_FN(md_segachd) - -struct BurnDriver BurnDrvmd_segachd = { - "md_segachd", NULL, NULL, NULL, "199?", - "Sega Channel Demo (USA)\0", NULL, "Scientific Atlanta", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_segachdRomInfo, md_segachdRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 12 in 1 -static struct BurnRomInfo md_12in1RomDesc[] = { - { "12-in-1 (unl).bin", 0x200000, 0xa98bf454, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_12in1) -STD_ROM_FN(md_12in1) - -struct BurnDriver BurnDrvmd_12in1 = { - "md_12in1", NULL, NULL, NULL, "199?", - "12 in 1\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_MC_12IN1, GBF_MISC, 0, - MegadriveGetZipName, md_12in1RomInfo, md_12in1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// 4 in 1 (Pirate) -static struct BurnRomInfo md_4in1pbRomDesc[] = { - { "4-in-1 (pirate).bin", 0x200000, 0xbe72857b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_4in1pb) -STD_ROM_FN(md_4in1pb) - -struct BurnDriver BurnDrvmd_4in1pb = { - "md_4in1pb", NULL, NULL, NULL, "199?", - "4 in 1 (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_MC_12IN1, GBF_MISC, 0, - MegadriveGetZipName, md_4in1pbRomInfo, md_4in1pbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// A Bug's Life -static struct BurnRomInfo md_bugslifeRomDesc[] = { - { "bug's life, a (unl).bin", 0x100000, 0x10458e09, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bugslife) -STD_ROM_FN(md_bugslife) - -struct BurnDriver BurnDrvmd_bugslife = { - "md_bugslife", NULL, NULL, NULL, "199?", - "A Bug's Life\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_BUGSLIFE, GBF_MISC, 0, - MegadriveGetZipName, md_bugslifeRomInfo, md_bugslifeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// A Bug's Life (Alt?) -static struct BurnRomInfo md_bugslifeaRomDesc[] = { - { "bug's life (unl).bin", 0x100000, 0xed1c1a67, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bugslifea) -STD_ROM_FN(md_bugslifea) - -struct BurnDriver BurnDrvmd_bugslifea = { - "md_bugslifea", "md_bugslife", NULL, NULL, "199?", - "A Bug's Life (Alt?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bugslifeaRomInfo, md_bugslifeaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chinese Fighter III (Chi) -static struct BurnRomInfo md_chinf3RomDesc[] = { - { "chinese fighter iii (unl).bin", 0x200000, 0xe833bc6e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chinf3) -STD_ROM_FN(md_chinf3) - -struct BurnDriver BurnDrvmd_chinf3 = { - "md_chinf3", NULL, NULL, NULL, "199?", - "Chinese Fighter III (Chi)\0", "Imperfect Protection Emulation", "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_CHINFIGHT3, GBF_MISC, 0, - MegadriveGetZipName, md_chinf3RomInfo, md_chinf3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Earth Defense (USA) -static struct BurnRomInfo md_earthdefRomDesc[] = { - { "earth defense (usa) (unl).bin", 0x080000, 0x3519c422, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_earthdef) -STD_ROM_FN(md_earthdef) - -struct BurnDriver BurnDrvmd_earthdef = { - "md_earthdef", NULL, NULL, NULL, "1995", - "The Earth Defense (USA)\0", NULL, "Realtec", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_REALTEC, GBF_MISC, 0, - MegadriveGetZipName, md_earthdefRomInfo, md_earthdefRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Funny World & Balloon Boy (USA) -static struct BurnRomInfo md_funnywldRomDesc[] = { - { "funny world & balloon boy (usa) (unl).bin", 0x080000, 0xa82f05f0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_funnywld) -STD_ROM_FN(md_funnywld) - -struct BurnDriver BurnDrvmd_funnywld = { - "md_funnywld", NULL, NULL, NULL, "1993", - "Funny World & Balloon Boy (USA)\0", NULL, "Realtec", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_REALTEC, GBF_MISC, 0, - MegadriveGetZipName, md_funnywldRomInfo, md_funnywldRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Golden 10 in 1 (Incomplete Dump) -static struct BurnRomInfo md_golden10RomDesc[] = { - { "golden 10-in-1 (bad dump).bin", 0x100000, 0x4fa3f82b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_golden10) -STD_ROM_FN(md_golden10) - -struct BurnDriver BurnDrvmd_golden10 = { - "md_golden10", NULL, NULL, NULL, "199?", - "Golden 10 in 1 (Incomplete Dump)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_MC_12IN1, GBF_MISC, 0, - MegadriveGetZipName, md_golden10RomInfo, md_golden10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hua Mu Lan - Mulan (Chi) -static struct BurnRomInfo md_huamulRomDesc[] = { - { "hua mu lan - mulan (chi) (unl).bin", 0x200000, 0x796882b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_huamul) -STD_ROM_FN(md_huamul) - -struct BurnDriver BurnDrvmd_huamul = { - "md_huamul", NULL, NULL, NULL, "199?", - "Hua Mu Lan - Mulan (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_MULAN, GBF_MISC, 0, - MegadriveGetZipName, md_huamulRomInfo, md_huamulRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Huan Le Tao Qi Shu - Smart Mouse (Chi) -static struct BurnRomInfo md_huanleRomDesc[] = { - { "huan le tao qi shu - smart mouse (chi) (unl).bin", 0x080000, 0xdecdf740, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_huanle) -STD_ROM_FN(md_huanle) - -struct BurnDriver BurnDrvmd_huanle = { - "md_huanle", NULL, NULL, NULL, "199?", - "Huan Le Tao Qi Shu - Smart Mouse (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SMOUSE, GBF_MISC, 0, - MegadriveGetZipName, md_huanleRomInfo, md_huanleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// K.O.F 98' -static struct BurnRomInfo md_kof98RomDesc[] = { - { "king of fighters '98, the (unl).bin", 0x200000, 0xcbc38eea, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kof98) -STD_ROM_FN(md_kof98) - -struct BurnDriver BurnDrvmd_kof98 = { - "md_kof98", NULL, NULL, NULL, "199?", - "K.O.F 98'\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_KOF98, GBF_MISC, 0, - MegadriveGetZipName, md_kof98RomInfo, md_kof98RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The King of Fighters '99 -static struct BurnRomInfo md_kof99RomDesc[] = { - { "the king of fighters 99 (unl).bin", 0x300000, 0x54638c11, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kof99) -STD_ROM_FN(md_kof99) - -struct BurnDriver BurnDrvmd_kof99 = { - "md_kof99", NULL, NULL, NULL, "199?", - "The King of Fighters '99\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_KOF99, GBF_MISC, 0, - MegadriveGetZipName, md_kof99RomInfo, md_kof99RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The King of Fighters '99 (Alt) -static struct BurnRomInfo md_kof99aRomDesc[] = { - { "king of fighters 99 (unl).bin", 0x300000, 0xab82afbe, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kof99a) -STD_ROM_FN(md_kof99a) - -struct BurnDriver BurnDrvmd_kof99a = { - "md_kof99a", "md_kof99", NULL, NULL, "199?", - "The King of Fighters '99 (Alt)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_KOF99, GBF_MISC, 0, - MegadriveGetZipName, md_kof99aRomInfo, md_kof99aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Linghuan Daoshi Super Magician (Chi) -static struct BurnRomInfo md_supmagicRomDesc[] = { - { "elf wor (chi) (unl).bin", 0x100000, 0xe24ac6b2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_supmagic) -STD_ROM_FN(md_supmagic) - -struct BurnDriver BurnDrvmd_supmagic = { - "md_supmagic", NULL, NULL, NULL, "199?", - "Linghuan Daoshi Super Magician (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_ELFWOR, GBF_MISC, 0, - MegadriveGetZipName, md_supmagicRomInfo, md_supmagicRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shi Zi Wang II - Lion King II -static struct BurnRomInfo md_lionkin2RomDesc[] = { - { "shi zi wang ii - the lion king ii, the (chi) (unl).bin", 0x200000, 0xaff46765, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lionkin2) -STD_ROM_FN(md_lionkin2) - -struct BurnDriver BurnDrvmd_lionkin2 = { - "md_lionkin2", NULL, NULL, NULL, "199?", - "Shi Zi Wang II - Lion King II\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_LIONK2, GBF_MISC, 0, - MegadriveGetZipName, md_lionkin2RomInfo, md_lionkin2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lion King 3 -static struct BurnRomInfo md_lionkin3RomDesc[] = { - { "shi zi wang 3 - the lion king 3 (chi) (unl).bin", 0x200000, 0xc004219d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lionkin3) -STD_ROM_FN(md_lionkin3) - -struct BurnDriver BurnDrvmd_lionkin3 = { - "md_lionkin3", NULL, NULL, NULL, "199?", - "Lion King 3\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_LIONK3, GBF_MISC, 0, - MegadriveGetZipName, md_lionkin3RomInfo, md_lionkin3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ma Jiang Qing Ren - Ji Ma Jiang Zhi (Chi) -static struct BurnRomInfo md_majianRomDesc[] = { - { "ma jiang qing ren - ji ma jiang zhi (chi) (unl).bin", 0x100000, 0xddd02ba4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_majian) -STD_ROM_FN(md_majian) - -struct BurnDriver BurnDrvmd_majian = { - "md_majian", NULL, NULL, NULL, "199?", - "Ma Jiang Qing Ren - Ji Ma Jiang Zhi (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_MJLOVER, GBF_MISC, 0, - MegadriveGetZipName, md_majianRomInfo, md_majianRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ma Jiang Qing Ren - Ji Ma Jiang Zhi (Chi, Alt) -static struct BurnRomInfo md_majianaRomDesc[] = { - { "mahjong lover (unl).bin", 0x100000, 0xf6c2cff2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_majiana) -STD_ROM_FN(md_majiana) - -struct BurnDriver BurnDrvmd_majiana = { - "md_majiana", "md_majian", NULL, NULL, "199?", - "Ma Jiang Qing Ren - Ji Ma Jiang Zhi (Chi, Alt)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_MJLOVER, GBF_MISC, 0, - MegadriveGetZipName, md_majianaRomInfo, md_majianaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pokemon Stadium -static struct BurnRomInfo md_pokestadRomDesc[] = { - { "pokemon stadium (unl).bin", 0x200000, 0xfe187c5d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pokestad) -STD_ROM_FN(md_pokestad) - -struct BurnDriver BurnDrvmd_pokestad = { - "md_pokestad", NULL, NULL, NULL, "199?", - "Pokemon Stadium\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_KAIJU, GBF_MISC, 0, - MegadriveGetZipName, md_pokestadRomInfo, md_pokestadRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rockman X3 -static struct BurnRomInfo md_rockmnx3RomDesc[] = { - { "rockman x3 (unl).bin", 0x200000, 0x3ee639f0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rockmnx3) -STD_ROM_FN(md_rockmnx3) - -struct BurnDriver BurnDrvmd_rockmnx3 = { - "md_rockmnx3", NULL, NULL, NULL, "199?", - "Rockman X3\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_ROCKMANX3, GBF_MISC, 0, - MegadriveGetZipName, md_rockmnx3RomInfo, md_rockmnx3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Soul Blade -static struct BurnRomInfo md_soulbladRomDesc[] = { - { "soul blade (unl).bin", 0x400000, 0xf26f88d1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_soulblad) -STD_ROM_FN(md_soulblad) - -struct BurnDriver BurnDrvmd_soulblad = { - "md_soulblad", NULL, NULL, NULL, "199?", - "Soul Blade\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SOULBLAD, GBF_MISC, 0, - MegadriveGetZipName, md_soulbladRomInfo, md_soulbladRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Soul Blade (Alt) -static struct BurnRomInfo md_soulbladaRomDesc[] = { - { "soul blade (unl)[p].bin", 0x300000, 0xdd1c7a79, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_soulblada) -STD_ROM_FN(md_soulblada) - -struct BurnDriver BurnDrvmd_soulblada = { - "md_soulblada", "md_soulblad", NULL, NULL, "199?", - "Soul Blade (Alt)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_soulbladaRomInfo, md_soulbladaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Squirrel King (Chi) -static struct BurnRomInfo md_squirrelRomDesc[] = { - { "squirrel king (chi) (unl).bin", 0x100000, 0xb8261ff5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_squirrel) -STD_ROM_FN(md_squirrel) - -struct BurnDriver BurnDrvmd_squirrel = { - "md_squirrel", NULL, NULL, NULL, "199?", - "Squirrel King (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SQUIRRELK, GBF_MISC, 0, - MegadriveGetZipName, md_squirrelRomInfo, md_squirrelRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super 15 in 1 (Pirate) -static struct BurnRomInfo md_s15in1RomDesc[] = { - { "super 15-in-1 (pirate).bin", 0x200000, 0x6d17dfff, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_s15in1) -STD_ROM_FN(md_s15in1) - -struct BurnDriver BurnDrvmd_s15in1 = { - "md_s15in1", NULL, NULL, NULL, "199?", - "Super 15 in 1 (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_MC_SUP15IN1, GBF_MISC, 0, - MegadriveGetZipName, md_s15in1RomInfo, md_s15in1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super 19 in 1 (Pirate) -static struct BurnRomInfo md_s19in1RomDesc[] = { - { "super 19-in-1 (pirate).bin", 0x400000, 0x0ad2b342, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_s19in1) -STD_ROM_FN(md_s19in1) - -struct BurnDriver BurnDrvmd_s19in1 = { - "md_s19in1", NULL, NULL, NULL, "199?", - "Super 19 in 1 (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_MC_SUP19IN1, GBF_MISC, 0, - MegadriveGetZipName, md_s19in1RomInfo, md_s19in1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Bubble Bobble MD (Chi) -static struct BurnRomInfo md_suprbublRomDesc[] = { - { "super bubble bobble (chi) (unl).bin", 0x100000, 0x4820a161, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_suprbubl) -STD_ROM_FN(md_suprbubl) - -struct BurnDriver BurnDrvmd_suprbubl = { - "md_suprbubl", NULL, NULL, NULL, "199?", - "Super Bubble Bobble MD (Chi)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SBUBBOB, GBF_MISC, 0, - MegadriveGetZipName, md_suprbublRomInfo, md_suprbublRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Donkey Kong 99 (Protected) -static struct BurnRomInfo md_sdkong99RomDesc[] = { - { "super donkey kong 99 (unl) (protected).bin", 0x300000, 0x43be4dd5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 | SEGA_MD_ROM_RELOAD_100000_300000 }, -}; - -STD_ROM_PICK(md_sdkong99) -STD_ROM_FN(md_sdkong99) - -struct BurnDriver BurnDrvmd_sdkong99 = { - "md_sdkong99", NULL, NULL, NULL, "199?", - "Super Donkey Kong 99 (Protected)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SDK99, GBF_MISC, 0, - MegadriveGetZipName, md_sdkong99RomInfo, md_sdkong99RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super King Kong 99 -static struct BurnRomInfo md_skkong99RomDesc[] = { - { "super king kong 99 (unl).bin", 0x200000, 0x413dfee2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 | SEGA_MD_ROM_RELOAD_200000_200000 }, -}; - -STD_ROM_PICK(md_skkong99) -STD_ROM_FN(md_skkong99) - -struct BurnDriver BurnDrvmd_skkong99 = { - "md_skkong99", "md_sdkong99", NULL, NULL, "199?", - "Super King Kong 99\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SKINGKONG, GBF_MISC, 0, - MegadriveGetZipName, md_skkong99RomInfo, md_skkong99RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Mario 2 1998 -static struct BurnRomInfo md_smario2RomDesc[] = { - { "super mario 2 1998 (unl).bin", 0x200000, 0xf7e1b3e1, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smario2) -STD_ROM_FN(md_smario2) - -struct BurnDriver BurnDrvmd_smario2 = { - "md_smario2", NULL, NULL, NULL, "199?", - "Super Mario 2 1998\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SMB2, GBF_MISC, 0, - MegadriveGetZipName, md_smario2RomInfo, md_smario2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Mario World ~ Super Mario Bros. (Pirate) -static struct BurnRomInfo md_smbRomDesc[] = { - { "super mario bros. (unl).bin", 0x200000, 0x9cfa2bd8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smb) -STD_ROM_FN(md_smb) - -struct BurnDriver BurnDrvmd_smb = { - "md_smb", NULL, NULL, NULL, "199?", - "Super Mario World ~ Super Mario Bros. (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SMB, GBF_MISC, 0, - MegadriveGetZipName, md_smbRomInfo, md_smbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Battle of Red Cliffs - Romance of the Three Kingdoms -static struct BurnRomInfo md_redcliffRomDesc[] = { - { "the battle of red cliffs - romance of the three kingdoms (unl).bin", 0x200005, 0x44463492, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_redcliff) -STD_ROM_FN(md_redcliff) - -struct BurnDriver BurnDrvmd_redcliff = { - "md_redcliff", NULL, NULL, NULL, "199?", - "The Battle of Red Cliffs - Romance of the Three Kingdoms\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_REDCL_EN, GBF_MISC, 0, - MegadriveGetZipName, md_redcliffRomInfo, md_redcliffRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Battle of Red Cliffs - Romance of the Three Kingdoms (Hacked out Protection?) -static struct BurnRomInfo md_redcliffaRomDesc[] = { - { "the battle of red cliffs (unl).bin", 0x200000, 0x63eca090, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_redcliffa) -STD_ROM_FN(md_redcliffa) - -struct BurnDriver BurnDrvmd_redcliffa = { - "md_redcliffa", "md_redcliff", NULL, NULL, "199?", - "The Battle of Red Cliffs - Romance of the Three Kingdoms (Hacked out Protection?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_redcliffaRomInfo, md_redcliffaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Top Fighter 2000 MK VIII -static struct BurnRomInfo md_topfightRomDesc[] = { - { "top fighter 2000 mk viii (unl).bin", 0x200000, 0xf75519dc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_topfight) -STD_ROM_FN(md_topfight) - -struct BurnDriver BurnDrvmd_topfight = { - "md_topfight", NULL, NULL, NULL, "199?", - "Top Fighter 2000 MK VIII\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_TOPFIGHTER, GBF_MISC, 0, - MegadriveGetZipName, md_topfightRomInfo, md_topfightRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Top Fighter 2005 -static struct BurnRomInfo md_topf2k5RomDesc[] = { - { "top fighter 2005 (unl).bin", 0x200000, 0x174defe6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_topf2k5) -STD_ROM_FN(md_topf2k5) - -struct BurnDriver BurnDrvmd_topf2k5 = { - "md_topf2k5", NULL, NULL, NULL, "199?", - "Top Fighter 2005\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_topf2k5RomInfo, md_topf2k5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Whac-a-Critter (USA) -static struct BurnRomInfo md_whacacriRomDesc[] = { - { "whac-a-critter (usa) (unl).bin", 0x080000, 0x1bdd02b8, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_whacacri) -STD_ROM_FN(md_whacacri) - -struct BurnDriver BurnDrvmd_whacacri = { - "md_whacacri", NULL, NULL, NULL, "1993", - "Whac-a-Critter (USA)\0", NULL, "Realtec", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_REALTEC, GBF_MISC, 0, - MegadriveGetZipName, md_whacacriRomInfo, md_whacacriRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Radica: Volume 1 (USA) -static struct BurnRomInfo md_radicav1RomDesc[] = { - { "radicav1.bin", 0x400000, 0x3b4c8438, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_radicav1) -STD_ROM_FN(md_radicav1) - -struct BurnDriver BurnDrvmd_radicav1 = { - "md_radicav1", NULL, NULL, NULL, "2004", - "Radica: Volume 1 (USA)\0", NULL, "Radica Games ~ Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_RADICA, GBF_MISC, 0, - MegadriveGetZipName, md_radicav1RomInfo, md_radicav1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Radica: Street Fighter Pack (Euro) -static struct BurnRomInfo md_radicasfRomDesc[] = { - { "radicasf.bin", 0x400000, 0x868afb44, BRF_PRG | SEGA_MD_ROM_LOAD_NORMAL | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_radicasf) -STD_ROM_FN(md_radicasf) - -struct BurnDriver BurnDrvmd_radicasf = { - "md_radicasf", NULL, NULL, NULL, "2004", - "Radica: Street Fighter Pack (Euro)\0", NULL, "Radica Games ~ Capcom", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_RADICA, GBF_MISC, 0, - MegadriveGetZipName, md_radicasfRomInfo, md_radicasfRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chinese Fighter III (Chi, Unprotected?) -static struct BurnRomInfo md_chinf3aRomDesc[] = { - { "chinese fighter iii (unl, alt).bin", 0x200000, 0x6f98247d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chinf3a) -STD_ROM_FN(md_chinf3a) - -struct BurnDriver BurnDrvmd_chinf3a = { - "md_chinf3a", "md_chinf3", NULL, NULL, "199?", - "Chinese Fighter III (Chi, Unprotected?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chinf3aRomInfo, md_chinf3aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// K.O.F 98' (Unprotected?) -static struct BurnRomInfo md_kof98aRomDesc[] = { - { "king of fighters '98, the (unl) (pirate).bin", 0x200000, 0xc79e1074, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kof98a) -STD_ROM_FN(md_kof98a) - -struct BurnDriver BurnDrvmd_kof98a = { - "md_kof98a", "md_kof98", NULL, NULL, "199?", - "K.O.F 98' (Unprotected?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kof98aRomInfo, md_kof98aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shi Zi Wang II - Lion King II (Pirate, Hacked?) -static struct BurnRomInfo md_lionkin2aRomDesc[] = { - { "shi zi wang ii - the lion king ii, the (chi) (unl) (pirate).bin", 0x200000, 0x721b4981, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lionkin2a) -STD_ROM_FN(md_lionkin2a) - -struct BurnDriver BurnDrvmd_lionkin2a = { - "md_lionkin2a", "md_lionkin2", NULL, NULL, "199?", - "Shi Zi Wang II - Lion King II (Pirate, Hacked?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lionkin2aRomInfo, md_lionkin2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Donkey Kong 99 (Unprotected) -static struct BurnRomInfo md_sdkong99aRomDesc[] = { - { "super donkey kong 99 (unl).bin", 0x200000, 0x8e7d9177, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sdkong99a) -STD_ROM_FN(md_sdkong99a) - -struct BurnDriver BurnDrvmd_sdkong99a = { - "md_sdkong99a", "md_sdkong99", NULL, NULL, "199?", - "Super Donkey Kong 99 (Unprotected)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sdkong99aRomInfo, md_sdkong99aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bomboy (Tw) -static struct BurnRomInfo md_bomboyRomDesc[] = { - { "bomboy (unl).bin", 0x080000, 0x065d2019, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bomboy) -STD_ROM_FN(md_bomboy) - -struct BurnDriver BurnDrvmd_bomboy = { - "md_bomboy", NULL, NULL, NULL, "1993", - "Bomboy (Tw)\0", NULL, "Gamtec", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bomboyRomInfo, md_bomboyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Truco '96 (Arg) -static struct BurnRomInfo md_truco96RomDesc[] = { - { "truco96.bin", 0x100000, 0xcddbecfc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_truco96) -STD_ROM_FN(md_truco96) - -struct BurnDriver BurnDrvmd_truco96 = { - "md_truco96", NULL, NULL, NULL, "1996", - "Truco '96 (Arg)\0", NULL, "Miky", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_truco96RomInfo, md_truco96RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// TC 2000 (Arg) -static struct BurnRomInfo md_tc2000RomDesc[] = { - { "tc2000.bin", 0x100000, 0xcef91bdb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tc2000) -STD_ROM_FN(md_tc2000) - -struct BurnDriver BurnDrvmd_tc2000 = { - "md_tc2000", NULL, NULL, NULL, "199?", - "TC 2000 (Arg)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tc2000RomInfo, md_tc2000RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Unknown Game 2 (Rockman-related?) -static struct BurnRomInfo md_unknown2RomDesc[] = { - { "xxx3.bin", 0x200000, 0x188da9f0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_unknown2) -STD_ROM_FN(md_unknown2) - -struct BurnDriver BurnDrvmd_unknown2 = { - "md_unknown2", NULL, NULL, NULL, "199?", - "Unknown Game 2 (Rockman-related?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_unknown2RomInfo, md_unknown2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ultimate Soccer (Euro, Prototype) -static struct BurnRomInfo md_ultsoccrpRomDesc[] = { - { "world soccer (prototype).bin", 0x100000, 0x9d451f72, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ultsoccrp) -STD_ROM_FN(md_ultsoccrp) - -struct BurnDriver BurnDrvmd_ultsoccrp = { - "md_ultsoccrp", "md_ultsoccr", NULL, NULL, "199?", - "Ultimate Soccer (Euro, Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ultsoccrpRomInfo, md_ultsoccrpRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Duke Nukem 3D (Pirate) -static struct BurnRomInfo md_dukenk3daRomDesc[] = { - { "duke_nukem_3d.bin", 0x200000, 0x13e93c0d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dukenk3da) -STD_ROM_FN(md_dukenk3da) - -struct BurnDriverD BurnDrvmd_dukenk3da = { - "md_dukenk3da", "md_dukenk3d", NULL, NULL, "199?", - "Duke Nukem 3D (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM, GBF_MISC, 0, - MegadriveGetZipName, md_dukenk3daRomInfo, md_dukenk3daRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// K.O.F 2000 -static struct BurnRomInfo md_kof2kRomDesc[] = { - { "king of fighters 2000 (unl).bin", 0x200000, 0x34cbac5d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kof2k) -STD_ROM_FN(md_kof2k) - -struct BurnDriver BurnDrvmd_kof2k = { - "md_kof2k", "md_kof98", NULL, NULL, "199?", - "K.O.F 2000\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kof2kRomInfo, md_kof2kRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lion King 3 (Alt?) -static struct BurnRomInfo md_lionkin3aRomDesc[] = { - { "lion_king_3.bin", 0x200000, 0x87e86943, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lionkin3a) -STD_ROM_FN(md_lionkin3a) - -struct BurnDriver BurnDrvmd_lionkin3a = { - "md_lionkin3a", "md_lionkin3", NULL, NULL, "199?", - "Lion King 3 (Alt?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lionkin3aRomInfo, md_lionkin3aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lion King 3 (Alt 2?) -static struct BurnRomInfo md_lionkin3bRomDesc[] = { - { "lion king 3 (unl).bin", 0x200000, 0x8e0555e4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lionkin3b) -STD_ROM_FN(md_lionkin3b) - -struct BurnDriver BurnDrvmd_lionkin3b = { - "md_lionkin3b", "md_lionkin3", NULL, NULL, "199?", - "Lion King 3 (Alt 2?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lionkin3bRomInfo, md_lionkin3bRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Magic Bubble (Pirate) -static struct BurnRomInfo md_mbubbleRomDesc[] = { - { "magic_bubble.bin", 0x080000, 0xce4a0c46, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mbubble) -STD_ROM_FN(md_mbubble) - -struct BurnDriver BurnDrvmd_mbubble = { - "md_mbubble", NULL, NULL, NULL, "199?", - "Magic Bubble (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mbubbleRomInfo, md_mbubbleRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Magistr 16 (Rus) -static struct BurnRomInfo md_magist16RomDesc[] = { - { "magistr 16.bin", 0x400000, 0x2488e685, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_magist16) -STD_ROM_FN(md_magist16) - -struct BurnDriver BurnDrvmd_magist16 = { - "md_magist16", NULL, NULL, NULL, "199?", - "Magistr 16 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_magist16RomInfo, md_magist16RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic Jam 6 (Hacked?) -static struct BurnRomInfo md_sonicjam2RomDesc[] = { - { "sonic_6.bin", 0x200000, 0x87d86501, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sonicjam2) -STD_ROM_FN(md_sonicjam2) - -struct BurnDriver BurnDrvmd_sonicjam2 = { - "md_sonicjam2", "md_sonicjam", NULL, NULL, "199?", - "Sonic Jam 6 (Hacked?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sonicjam2RomInfo, md_sonicjam2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Soul Edge vs Samurai Spirits (Pirate) -static struct BurnRomInfo md_souledgeRomDesc[] = { - { "soul edge vs samurai spirits (unl).bin", 0x200000, 0xb11bd611, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_souledge) -STD_ROM_FN(md_souledge) - -struct BurnDriver BurnDrvmd_souledge = { - "md_souledge", NULL, NULL, NULL, "199?", - "Soul Edge vs Samurai Spirits (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_souledgeRomInfo, md_souledgeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Soul Edge vs Samurai Spirits (Pirate, Cracked) -static struct BurnRomInfo md_souledgeaRomDesc[] = { - { "soul edge vs samurai spirits (unl)[f1].bin", 0x200000, 0x74a6d7a7, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_souledgea) -STD_ROM_FN(md_souledgea) - -struct BurnDriver BurnDrvmd_souledgea = { - "md_souledgea", "md_souledge", NULL, NULL, "199?", - "Soul Edge vs Samurai Spirits (Pirate, Cracked)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_souledgeaRomInfo, md_souledgeaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Mario 2 (Alt?) -static struct BurnRomInfo md_smario2aRomDesc[] = { - { "super_mario_2.bin", 0x200000, 0x0da6dc4b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smario2a) -STD_ROM_FN(md_smario2a) - -struct BurnDriver BurnDrvmd_smario2a = { - "md_smario2a", "md_smario2", NULL, NULL, "199?", - "Super Mario 2 (Alt?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smario2aRomInfo, md_smario2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tetris (Pirate?) -static struct BurnRomInfo md_tetris1RomDesc[] = { - { "tetris.bin", 0x080000, 0xeb024ab2, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tetris1) -STD_ROM_FN(md_tetris1) - -struct BurnDriver BurnDrvmd_tetris1 = { - "md_tetris1", NULL, NULL, NULL, "199?", - "Tetris (Pirate?)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tetris1RomInfo, md_tetris1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Voina Irak (Pirate) -static struct BurnRomInfo md_virakRomDesc[] = { - { "voina_irak.bin", 0x200000, 0xc7177e93, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_virak) -STD_ROM_FN(md_virak) - -struct BurnDriver BurnDrvmd_virak = { - "md_virak", NULL, NULL, NULL, "199?", - "Voina Irak (Pirate)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_virakRomInfo, md_virakRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Dyno Blaze (Early Prototype) -static struct BurnRomInfo md_dynoblazRomDesc[] = { - { "dyno blaze (proto).bin", 0x1711c6, 0xd625e584, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_dynoblaz) -STD_ROM_FN(md_dynoblaz) - -struct BurnDriver BurnDrvmd_dynoblaz = { - "md_dynoblaz", NULL, NULL, NULL, "199?", - "Dyno Blaze (Early Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dynoblazRomInfo, md_dynoblazRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Assassins Creed (Rus) -static struct BurnRomInfo md_asscreedRomDesc[] = { - { "assassins creed (unl).bin", 0x100000, 0x3f2d6ccc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_asscreed) -STD_ROM_FN(md_asscreed) - -struct BurnDriver BurnDrvmd_asscreed = { - "md_asscreed", "md_dlair", NULL, NULL, "199?", - "Assassins Creed (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_asscreedRomInfo, md_asscreedRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Avatar (Rus) -static struct BurnRomInfo md_avatarRomDesc[] = { - { "avatar.bin", 0x110000, 0xd33e0ada, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_avatar) -STD_ROM_FN(md_avatar) - -struct BurnDriver BurnDrvmd_avatar = { - "md_avatar", "md_jimpower", NULL, NULL, "199?", - "Avatar (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_avatarRomInfo, md_avatarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ben 10 (Rus) -static struct BurnRomInfo md_ben10RomDesc[] = { - { "ben 10 (unl)[rus].bin", 0x100000, 0xc8be0b26, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ben10) -STD_ROM_FN(md_ben10) - -struct BurnDriver BurnDrvmd_ben10 = { - "md_ben10", NULL, NULL, NULL, "199?", - "Ben 10 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ben10RomInfo, md_ben10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bomber -static struct BurnRomInfo md_bomberRomDesc[] = { - { "bomber [!].bin", 0x020000, 0x6389a658, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bomber) -STD_ROM_FN(md_bomber) - -struct BurnDriver BurnDrvmd_bomber = { - "md_bomber", NULL, NULL, NULL, "2005", - "Bomber\0", NULL, "TecToy", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bomberRomInfo, md_bomberRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chess (Rus) -static struct BurnRomInfo md_chessRomDesc[] = { - { "chess (unl).bin", 0x080000, 0x47380edd, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chess) -STD_ROM_FN(md_chess) - -struct BurnDriver BurnDrvmd_chess = { - "md_chess", NULL, NULL, NULL, "1998", - "Chess (Rus)\0", NULL, "BSComp", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chessRomInfo, md_chessRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chess (Rus, Alt) -static struct BurnRomInfo md_chessaRomDesc[] = { - { "chess (unl) [rus].bin", 0x080000, 0xa5cef7b6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chessa) -STD_ROM_FN(md_chessa) - -struct BurnDriver BurnDrvmd_chessa = { - "md_chessa", "md_chess", NULL, NULL, "1998", - "Chess (Rus, Alt)\0", NULL, "BSComp", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chessaRomInfo, md_chessaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chess (Rus, v1.05) -static struct BurnRomInfo md_chessbRomDesc[] = { - { "chess (unl) [rus v1.05].bin", 0x100000, 0x10683e83, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chessb) -STD_ROM_FN(md_chessb) - -struct BurnDriver BurnDrvmd_chessb = { - "md_chessb", "md_chess", NULL, NULL, "199?", - "Chess (Rus, v1.05)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chessbRomInfo, md_chessbRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Command & Conquer (Prototype) -static struct BurnRomInfo md_commconqRomDesc[] = { - { "command & conquer (beta).bin", 0x186286, 0x747fcc62, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_commconq) -STD_ROM_FN(md_commconq) - -struct BurnDriver BurnDrvmd_commconq = { - "md_commconq", NULL, NULL, NULL, "199?", - "Command & Conquer (Prototype)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_commconqRomInfo, md_commconqRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Commandos (Rus) -static struct BurnRomInfo md_commandsRomDesc[] = { - { "commandos.bin", 0x200000, 0x28a88d6f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_commands) -STD_ROM_FN(md_commands) - -struct BurnDriver BurnDrvmd_commands = { - "md_commands", NULL, NULL, NULL, "199?", - "Commandos (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_commandsRomInfo, md_commandsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Counter Strike (Rus) -static struct BurnRomInfo md_cstrikeRomDesc[] = { - { "counter strike.bin", 0x200000, 0x9e7b83ba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cstrike) -STD_ROM_FN(md_cstrike) - -struct BurnDriver BurnDrvmd_cstrike = { - "md_cstrike", "md_lethalen", NULL, NULL, "199?", - "Counter Strike (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cstrikeRomInfo, md_cstrikeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Crash Bandicoot (Rus) -static struct BurnRomInfo md_crashRomDesc[] = { - { "crash bandicoot.bin", 0x400000, 0xe06bd944, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_crash) -STD_ROM_FN(md_crash) - -struct BurnDriver BurnDrvmd_crash = { - "md_crash", "md_zero", NULL, NULL, "199?", - "Crash Bandicoot (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_crashRomInfo, md_crashRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Death Caliber (Rus) -static struct BurnRomInfo md_deathcalRomDesc[] = { - { "death caliber.bin", 0x400000, 0x3cd2c797, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_deathcal) -STD_ROM_FN(md_deathcal) - -struct BurnDriver BurnDrvmd_deathcal = { - "md_deathcal", NULL, NULL, NULL, "199?", - "Death Caliber (Rus)\0", NULL, "Tomsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_deathcalRomInfo, md_deathcalRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Deer Hunter (Rus) -static struct BurnRomInfo md_deerhuntRomDesc[] = { - { "deer hunter.bin", 0x100000, 0xda11978b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_deerhunt) -STD_ROM_FN(md_deerhunt) - -struct BurnDriver BurnDrvmd_deerhunt = { - "md_deerhunt", NULL, NULL, NULL, "199?", - "Deer Hunter (Rus)\0", NULL, "Tomsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_deerhuntRomInfo, md_deerhuntRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Diablo (Rus) -static struct BurnRomInfo md_diabloRomDesc[] = { - { "diablo.bin", 0x100000, 0xbd642da0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_diablo) -STD_ROM_FN(md_diablo) - -struct BurnDriver BurnDrvmd_diablo = { - "md_diablo", "md_fatallab", NULL, NULL, "199?", - "Diablo (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_diabloRomInfo, md_diabloRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Domino (Rus) -static struct BurnRomInfo md_dominoRomDesc[] = { - { "domino (unl).bin", 0x100000, 0xa64409be, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_domino) -STD_ROM_FN(md_domino) - -struct BurnDriver BurnDrvmd_domino = { - "md_domino", NULL, NULL, NULL, "199?", - "Domino (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_dominoRomInfo, md_dominoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA World Cup 2002 (Rus) -static struct BurnRomInfo md_fifa2k2RomDesc[] = { - { "fifa world cup 2002 (unl).bin", 0x100000, 0x852bff8e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa2k2) -STD_ROM_FN(md_fifa2k2) - -struct BurnDriver BurnDrvmd_fifa2k2 = { - "md_fifa2k2", "md_wcs2", NULL, NULL, "199?", - "FIFA World Cup 2002 (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fifa2k2RomInfo, md_fifa2k2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA 2003 (Rus) -static struct BurnRomInfo md_fifa2k3RomDesc[] = { - { "fifa 2003 (unl).bin", 0x200000, 0x419bcb02, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa2k3) -STD_ROM_FN(md_fifa2k3) - -struct BurnDriver BurnDrvmd_fifa2k3 = { - "md_fifa2k3", "md_fifa95", NULL, NULL, "199?", - "FIFA 2003 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fifa2k3RomInfo, md_fifa2k3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// FIFA World Cup - South Africa 2010 (Rus) -static struct BurnRomInfo md_fifa2k10RomDesc[] = { - { "fifa 2010 (unl).bin", 0x400000, 0x851e8411, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fifa2k10) -STD_ROM_FN(md_fifa2k10) - -struct BurnDriver BurnDrvmd_fifa2k10 = { - "md_fifa2k10", "md_fifa", NULL, NULL, "199?", - "FIFA World Cup - South Africa 2010 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fifa2k10RomInfo, md_fifa2k10RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Finding Nemo (Rus) -static struct BurnRomInfo md_nemoRomDesc[] = { - { "finding nemo.bin", 0x0a0000, 0x89b92f66, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nemo) -STD_ROM_FN(md_nemo) - -struct BurnDriver BurnDrvmd_nemo = { - "md_nemo", "md_jpond", NULL, NULL, "199?", - "Finding Nemo (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nemoRomInfo, md_nemoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Forsazh 5 Bystraya ~ Fast and the Furious 5 Quick (Rus) -static struct BurnRomInfo md_fastfur5RomDesc[] = { - { "fast and the furious 5 (unl).bin", 0x10b000, 0x29f4d87a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fastfur5) -STD_ROM_FN(md_fastfur5) - -struct BurnDriver BurnDrvmd_fastfur5 = { - "md_fastfur5", "md_combatca", NULL, NULL, "199?", - "Forsazh 5 Bystraya ~ Fast and the Furious 5 Quick (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fastfur5RomInfo, md_fastfur5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Gran Turismo 5 (Rus) -static struct BurnRomInfo md_gt5RomDesc[] = { - { "gran turismo 5 (unl).bin", 0x12a0d0, 0xd4392181, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gt5) -STD_ROM_FN(md_gt5) - -struct BurnDriver BurnDrvmd_gt5 = { - "md_gt5", "md_funcar", NULL, NULL, "199?", - "Gran Turismo 5 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gt5RomInfo, md_gt5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Harry Potter (Rus) -static struct BurnRomInfo md_hpotterRomDesc[] = { - { "harry potter.bin", 0x200000, 0xa184fc76, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hpotter) -STD_ROM_FN(md_hpotter) - -struct BurnDriver BurnDrvmd_hpotter = { - "md_hpotter", NULL, NULL, NULL, "199?", - "Harry Potter (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hpotterRomInfo, md_hpotterRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Harry Potter and the Chamber of Secrets (Rus) -static struct BurnRomInfo md_hpotter2RomDesc[] = { - { "harry potter 2.bin", 0x100000, 0x1684479f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_hpotter2) -STD_ROM_FN(md_hpotter2) - -struct BurnDriver BurnDrvmd_hpotter2 = { - "md_hpotter2", "md_mickmack", NULL, NULL, "199?", - "Harry Potter and the Chamber of Secrets (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_hpotter2RomInfo, md_hpotter2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Hercules 2 -static struct BurnRomInfo md_herculs2RomDesc[] = { - { "hercules 2 (unl).bin", 0x200000, 0x292623db, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_herculs2) -STD_ROM_FN(md_herculs2) - -struct BurnDriver BurnDrvmd_herculs2 = { - "md_herculs2", NULL, NULL, NULL, "199?", - "Hercules 2\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_herculs2RomInfo, md_herculs2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ice Age (Rus) -static struct BurnRomInfo md_iceageRomDesc[] = { - { "ice age.bin", 0x400000, 0x3a585408, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_iceage) -STD_ROM_FN(md_iceage) - -struct BurnDriver BurnDrvmd_iceage = { - "md_iceage", "md_awepossm", NULL, NULL, "199?", - "Ice Age (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_iceageRomInfo, md_iceageRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ice Age 3 (Rus) -static struct BurnRomInfo md_iceage3RomDesc[] = { - { "ice age 3 (unl).bin", 0x107120, 0x58fcffb3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_iceage3) -STD_ROM_FN(md_iceage3) - -struct BurnDriver BurnDrvmd_iceage3 = { - "md_iceage3", "md_chuckrck", NULL, NULL, "199?", - "Ice Age 3 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_iceage3RomInfo, md_iceage3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ice Age 4 (Rus) -static struct BurnRomInfo md_iceage4RomDesc[] = { - { "ice age 4 (unl).bin", 0x10e620, 0x92e86cfc, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_iceage4) -STD_ROM_FN(md_iceage4) - -struct BurnDriver BurnDrvmd_iceage4 = { - "md_iceage4", "md_chuckrck", NULL, NULL, "199?", - "Ice Age 4 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_iceage4RomInfo, md_iceage4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// The Incredibles (Rus) -static struct BurnRomInfo md_incredibRomDesc[] = { - { "the incredibles (unl).bin", 0x200000, 0x31f7af7c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_incredib) -STD_ROM_FN(md_incredib) - -struct BurnDriver BurnDrvmd_incredib = { - "md_incredib", "md_tick", NULL, NULL, "199?", - "The Incredibles (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_incredibRomInfo, md_incredibRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Indiana Jones - Koridory Vremeni (Rus) -static struct BurnRomInfo md_indyrusRomDesc[] = { - { "indiana jones - corridors of time (unl).bin", 0x400000, 0x54f82c76, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_indyrus) -STD_ROM_FN(md_indyrus) - -struct BurnDriver BurnDrvmd_indyrus = { - "md_indyrus", "md_rickdang", NULL, NULL, "199?", - "Indiana Jones - Koridory Vremeni (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_indyrusRomInfo, md_indyrusRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Iraq War 2003 -static struct BurnRomInfo md_iraqwarRomDesc[] = { - { "iraq war 2003 (unl).bin", 0x100000, 0x49dd6f52, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_iraqwar) -STD_ROM_FN(md_iraqwar) - -struct BurnDriver BurnDrvmd_iraqwar = { - "md_iraqwar", NULL, NULL, NULL, "199?", - "Iraq War 2003\0", NULL, "Tomsoft", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_iraqwarRomInfo, md_iraqwarRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Iraq War 2003 (Alt) -static struct BurnRomInfo md_iraqwaraRomDesc[] = { - { "iraq war 2003 (alt) (unl).bin", 0x100000, 0x23689237, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_iraqwara) -STD_ROM_FN(md_iraqwara) - -struct BurnDriver BurnDrvmd_iraqwara = { - "md_iraqwara", "md_iraqwar", NULL, NULL, "199?", - "Iraq War 2003 (Alt)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_iraqwaraRomInfo, md_iraqwaraRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kolobok ~ Pyramid (Rus) -static struct BurnRomInfo md_kolobokRomDesc[] = { - { "kolobok.bin", 0x020000, 0xc4c55bab, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kolobok) -STD_ROM_FN(md_kolobok) - -struct BurnDriver BurnDrvmd_kolobok = { - "md_kolobok", NULL, NULL, NULL, "199?", - "Kolobok ~ Pyramid (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kolobokRomInfo, md_kolobokRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kung Fu Panda 2 (Rus) -static struct BurnRomInfo md_kfpanda2RomDesc[] = { - { "kung fu panda 2 (unl).bin", 0x400000, 0xa08c3b25, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kfpanda2) -STD_ROM_FN(md_kfpanda2) - -struct BurnDriver BurnDrvmd_kfpanda2 = { - "md_kfpanda2", "md_brutal", NULL, NULL, "199?", - "Kung Fu Panda 2 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kfpanda2RomInfo, md_kfpanda2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kuzya - V Mire Dinozavrov (Rus) -static struct BurnRomInfo md_kuzyamdRomDesc[] = { - { "agent hugo - in the world of dinosaurs (unl).bin", 0x200000, 0xbd0ebe1c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kuzyamd) -STD_ROM_FN(md_kuzyamd) - -struct BurnDriver BurnDrvmd_kuzyamd = { - "md_kuzyamd", "md_chukrck2", NULL, NULL, "199?", - "Kuzya - V Mire Dinozavrov (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kuzyamdRomInfo, md_kuzyamdRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Kuzya - Ekologiya V Opasnosti (Rus) -static struct BurnRomInfo md_kuzyaeoRomDesc[] = { - { "agent hugo - environment at risk (unl).bin", 0x200000, 0xbe32d65b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_kuzyaeo) -STD_ROM_FN(md_kuzyaeo) - -struct BurnDriver BurnDrvmd_kuzyaeo = { - "md_kuzyaeo", "md_chukrck2", NULL, NULL, "199?", - "Kuzya - Ekologiya V Opasnosti (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_kuzyaeoRomInfo, md_kuzyaeoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lord of the Rings (Rus, Hack of Stormlord) -static struct BurnRomInfo md_lotrRomDesc[] = { - { "lord of the rings (unl).bin", 0x080000, 0xe2a2342a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lotr) -STD_ROM_FN(md_lotr) - -struct BurnDriver BurnDrvmd_lotr = { - "md_lotr", "md_strmlord", NULL, NULL, "199?", - "Lord of the Rings (Rus, Hack of Stormlord)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lotrRomInfo, md_lotrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lord of the Rings - The Return of the King (Rus) -static struct BurnRomInfo md_lotrgsRomDesc[] = { - { "lord of the rings (unl).bin", 0x200000, 0x513ea675, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_lotrgs) -STD_ROM_FN(md_lotrgs) - -struct BurnDriver BurnDrvmd_lotrgs = { - "md_lotrgs", NULL, NULL, NULL, "199?", - "Lord of the Rings - The Return of the King (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_lotrgsRomInfo, md_lotrgsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Madagascar - Operatsiya Pingvin (Rus) -static struct BurnRomInfo md_madagoppRomDesc[] = { - { "madagascar.bin", 0x100000, 0x6d28ace5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madagopp) -STD_ROM_FN(md_madagopp) - -struct BurnDriver BurnDrvmd_madagopp = { - "md_madagopp", "md_magichat", NULL, NULL, "199?", - "Madagascar - Operatsiya Pingvin (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_madagoppRomInfo, md_madagoppRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Madagascar 3 (Rus) -static struct BurnRomInfo md_madagsc3RomDesc[] = { - { "madagascar 3 (unl).bin", 0x100000, 0x0bd6d0a5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_madagsc3) -STD_ROM_FN(md_madagsc3) - -struct BurnDriver BurnDrvmd_madagsc3 = { - "md_madagsc3", "md_dinotale", NULL, NULL, "199?", - "Madagascar 3 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_madagsc3RomInfo, md_madagsc3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mafia (Rus) -static struct BurnRomInfo md_mafiaRomDesc[] = { - { "mafia (unl).bin", 0x100000, 0xede60834, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mafia) -STD_ROM_FN(md_mafia) - -struct BurnDriver BurnDrvmd_mafia = { - "md_mafia", "md_dicktr", NULL, NULL, "199?", - "Mafia (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mafiaRomInfo, md_mafiaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mario 3 - Vokrug Sveta (Rus) -static struct BurnRomInfo md_mario3RomDesc[] = { - { "mario 3 (unl).bin", 0x200000, 0x69f5b02f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mario3) -STD_ROM_FN(md_mario3) - -struct BurnDriver BurnDrvmd_mario3 = { - "md_mario3", NULL, NULL, NULL, "199?", - "Mario 3 - Vokrug Sveta (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mario3RomInfo, md_mario3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mario 4 - Kosmicheskaya Odissyeya (Rus) -static struct BurnRomInfo md_mario4RomDesc[] = { - { "mario 4 (unl).bin", 0x200000, 0x96b0ecd9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mario4) -STD_ROM_FN(md_mario4) - -struct BurnDriver BurnDrvmd_mario4 = { - "md_mario4", NULL, NULL, NULL, "199?", - "Mario 4 - Kosmicheskaya Odissyeya (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mario4RomInfo, md_mario4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Mario World 64 -static struct BurnRomInfo md_smario64RomDesc[] = { - { "super mario world 64 (unl).bin", 0x100000, 0xe7ac4161, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smario64) -STD_ROM_FN(md_smario64) - -struct BurnDriver BurnDrvmd_smario64 = { - "md_smario64", NULL, NULL, NULL, "199?", - "Super Mario World 64\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smario64RomInfo, md_smario64RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Mario World 64 (Hacked Protection) -static struct BurnRomInfo md_smario64hRomDesc[] = { - { "super mario world 64 (hacked).bin", 0x100000, 0xa20f98aa, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smario64h) -STD_ROM_FN(md_smario64h) - -struct BurnDriver BurnDrvmd_smario64h = { - "md_smario64h", "md_smario64", NULL, NULL, "199?", - "Super Mario World 64 (Hacked Protection)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smario64hRomInfo, md_smario64hRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Metal Gear Solid (Rus) -static struct BurnRomInfo md_mgsRomDesc[] = { - { "metal gear solid (unl).bin", 0x080000, 0xb38191eb, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mgs) -STD_ROM_FN(md_mgs) - -struct BurnDriver BurnDrvmd_mgs = { - "md_mgs", "md_crkdown", NULL, NULL, "199?", - "Metal Gear Solid (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mgsRomInfo, md_mgsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mighty Morphin Power Rangers - The Fighting Edition (Rus) -static struct BurnRomInfo md_mmprfeRomDesc[] = { - { "mighty morphin power ranger - the fighting edition (unl).bin", 0x200000, 0xb53ff16c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_mmprfe) -STD_ROM_FN(md_mmprfe) - -struct BurnDriver BurnDrvmd_mmprfe = { - "md_mmprfe", NULL, NULL, NULL, "199?", - "Mighty Morphin Power Rangers - The Fighting Edition (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_mmprfeRomInfo, md_mmprfeRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Monsters, Inc. (Rus) -static struct BurnRomInfo md_monstincRomDesc[] = { - { "monsters inc. (unl).bin", 0x080000, 0x3f4657d5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_monstinc) -STD_ROM_FN(md_monstinc) - -struct BurnDriver BurnDrvmd_monstinc = { - "md_monstinc", "md_decapatt", NULL, NULL, "199?", - "Monsters, Inc. (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_monstincRomInfo, md_monstincRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Narnia 3 (Rus) -static struct BurnRomInfo md_narnia3RomDesc[] = { - { "narnia 3 (unl).bin", 0x129dc0, 0xab69bcd3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_narnia3) -STD_ROM_FN(md_narnia3) - -struct BurnDriver BurnDrvmd_narnia3 = { - "md_narnia3", "md_galahad", NULL, NULL, "199?", - "Narnia 3 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_narnia3RomInfo, md_narnia3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Naruto (Rus) -static struct BurnRomInfo md_narutoRomDesc[] = { - { "naruto (unl).bin", 0x400000, 0xb29b3503, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_naruto) -STD_ROM_FN(md_naruto) - -struct BurnDriver BurnDrvmd_naruto = { - "md_naruto", "md_3ninja", NULL, NULL, "199?", - "Naruto (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_narutoRomInfo, md_narutoRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA 2000 (Rus) -static struct BurnRomInfo md_nba2kRomDesc[] = { - { "nba 2000 (unl).bin", 0x200000, 0x2cef6950, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nba2k) -STD_ROM_FN(md_nba2k) - -struct BurnDriver BurnDrvmd_nba2k = { - "md_nba2k", "md_nbaact", NULL, NULL, "199?", - "NBA 2000 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nba2kRomInfo, md_nba2kRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NBA 2005 (Rus) -static struct BurnRomInfo md_nba2k5RomDesc[] = { - { "nba 2005 (unl).bin", 0x200000, 0xe8610238, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nba2k5) -STD_ROM_FN(md_nba2k5) - -struct BurnDriver BurnDrvmd_nba2k5 = { - "md_nba2k5", "md_nbaact95", NULL, NULL, "199?", - "NBA 2005 (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nba2k5RomInfo, md_nba2k5RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Need for Speed Undercover (Rus) -static struct BurnRomInfo md_nfsuRomDesc[] = { - { "need for speed undercover (unl).bin", 0x100000, 0xbe1b8e93, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nfsu) -STD_ROM_FN(md_nfsu) - -struct BurnDriver BurnDrvmd_nfsu = { - "md_nfsu", "md_toutrun", NULL, NULL, "199?", - "Need for Speed Undercover (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nfsuRomInfo, md_nfsuRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// NHLPA 2003 (Rus) -static struct BurnRomInfo md_nhlpa2k3RomDesc[] = { - { "nhlpa 2003 (unl).bin", 0x200000, 0x4591571b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_nhlpa2k3) -STD_ROM_FN(md_nhlpa2k3) - -struct BurnDriver BurnDrvmd_nhlpa2k3 = { - "md_nhlpa2k3", "md_nhl98", NULL, NULL, "199?", - "NHLPA 2003 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_nhlpa2k3RomInfo, md_nhlpa2k3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pirates of the Caribbean (Rus) -static struct BurnRomInfo md_pcaribRomDesc[] = { - { "pirates of the caribbean (unl).bin", 0x200000, 0x48da0bf4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pcarib) -STD_ROM_FN(md_pcarib) - -struct BurnDriver BurnDrvmd_pcarib = { - "md_pcarib", "md_unchartd", NULL, NULL, "199?", - "Pirates of the Caribbean (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pcaribRomInfo, md_pcaribRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Piraty Karibskogo Morya - Na Strannyh Beregah ~ Pirates of the Caribbean - On Stranger Tides (Rus) -static struct BurnRomInfo md_pcarib2RomDesc[] = { - { "pirates of the caribbean - on stranger tides (unl).bin", 0x100000, 0x63c90c7c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pcarib2) -STD_ROM_FN(md_pcarib2) - -struct BurnDriver BurnDrvmd_pcarib2 = { - "md_pcarib2", NULL, NULL, NULL, "199?", - "Piraty Karibskogo Morya - Na Strannyh Beregah ~ Pirates of the Caribbean - On Stranger Tides (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pcarib2RomInfo, md_pcarib2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pokemon Crazy Drummer (Alt) -static struct BurnRomInfo md_pokecdaRomDesc[] = { - { "pokemon crazy drummer (unl) [a].bin", 0x200000, 0x84f49061, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_pokecda) -STD_ROM_FN(md_pokecda) - -struct BurnDriver BurnDrvmd_pokecda = { - "md_pokecda", "md_pokecd", NULL, NULL, "199?", - "Pokemon Crazy Drummer (Alt)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_pokecdaRomInfo, md_pokecdaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// RHL 2007 (Rus) -static struct BurnRomInfo md_rhl2k7RomDesc[] = { - { "rhl 2000 (unl).bin", 0x0a0000, 0xbb7a978b, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rhl2k7) -STD_ROM_FN(md_rhl2k7) - -struct BurnDriver BurnDrvmd_rhl2k7 = { - "md_rhl2k7", "md_nhlpa93", NULL, NULL, "199?", - "RHL 2007 (Rus)\0", NULL, "NewGame", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rhl2k7RomInfo, md_rhl2k7RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Rick Dangerous (Rus) -static struct BurnRomInfo md_rickdangRomDesc[] = { - { "rick dangerous (unl).bin", 0x3e0000, 0x545cbbe4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_rickdang) -STD_ROM_FN(md_rickdang) - -struct BurnDriver BurnDrvmd_rickdang = { - "md_rickdang", NULL, NULL, NULL, "199?", - "Rick Dangerous (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_rickdangRomInfo, md_rickdangRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shrek (Rus) -static struct BurnRomInfo md_shrekRomDesc[] = { - { "shrek (unl).bin", 0x100000, 0x561e84b9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shrek) -STD_ROM_FN(md_shrek) - -struct BurnDriver BurnDrvmd_shrek = { - "md_shrek", "md_yogibear", NULL, NULL, "199?", - "Shrek (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shrekRomInfo, md_shrekRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Shrek 2 (Rus) -static struct BurnRomInfo md_shrek2RomDesc[] = { - { "shrek 2 (unl).bin", 0x100000, 0x0ccd3651, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_shrek2) -STD_ROM_FN(md_shrek2) - -struct BurnDriver BurnDrvmd_shrek2 = { - "md_shrek2", "md_ottifant", NULL, NULL, "199?", - "Shrek 2 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_shrek2RomInfo, md_shrek2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sezon Ohoty (Rus) -static struct BurnRomInfo md_openseaRomDesc[] = { - { "open season (unl).bin", 0x100000, 0x06eb2472, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_opensea) -STD_ROM_FN(md_opensea) - -struct BurnDriver BurnDrvmd_opensea = { - "md_opensea", "md_rolo", NULL, NULL, "199?", - "Sezon Ohoty (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_openseaRomInfo, md_openseaRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sezon Ohoty 3 (Rus) -static struct BurnRomInfo md_opensea3RomDesc[] = { - { "hunting season 3 (unl).bin", 0x090d20, 0xb433878c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_opensea3) -STD_ROM_FN(md_opensea3) - -struct BurnDriver BurnDrvmd_opensea3 = { - "md_opensea3", "md_rolo", NULL, NULL, "199?", - "Sezon Ohoty 3 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_opensea3RomInfo, md_opensea3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Snezhnaya Koroleva (Rus) -static struct BurnRomInfo md_snezkoroRomDesc[] = { - { "snow queen (unl).bin", 0x200000, 0xe6c07946, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_snezkoro) -STD_ROM_FN(md_snezkoro) - -struct BurnDriver BurnDrvmd_snezkoro = { - "md_snezkoro", "md_mickmack", NULL, NULL, "199?", - "Snezhnaya Koroleva (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_snezkoroRomInfo, md_snezkoroRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sponge Bob (Rus) -static struct BurnRomInfo md_spongbobRomDesc[] = { - { "sponge bob.bin", 0x100000, 0xc5437496, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spongbob) -STD_ROM_FN(md_spongbob) - -struct BurnDriver BurnDrvmd_spongbob = { - "md_spongbob", "md_coolspot", NULL, NULL, "199?", - "Sponge Bob (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spongbobRomInfo, md_spongbobRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Spy Kids 4 - All The Time In The World (Rus) -static struct BurnRomInfo md_spykids4RomDesc[] = { - { "spy kids 4.bin", 0x200000, 0x9a045ea3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_spykids4) -STD_ROM_FN(md_spykids4) - -struct BurnDriver BurnDrvmd_spykids4 = { - "md_spykids4", "md_dinotale", NULL, NULL, "199?", - "Spy Kids 4 - All The Time In The World (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_spykids4RomInfo, md_spykids4RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Wars (Rus) -static struct BurnRomInfo md_starwarsRomDesc[] = { - { "star wars (unl).bin", 0x100000, 0x94af8d44, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_starwars) -STD_ROM_FN(md_starwars) - -struct BurnDriver BurnDrvmd_starwars = { - "md_starwars", "md_elimdown", NULL, NULL, "199?", - "Star Wars (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_starwarsRomInfo, md_starwarsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Star Wars Jedi (Rus) -static struct BurnRomInfo md_starjediRomDesc[] = { - { "star wars jedi (unl).bin", 0x12a0d0, 0x48c5bf60, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_starjedi) -STD_ROM_FN(md_starjedi) - -struct BurnDriver BurnDrvmd_starjedi = { - "md_starjedi", "md_wolfchld", NULL, NULL, "199?", - "Star Wars Jedi (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_starjediRomInfo, md_starjediRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Mario Bros. + Battle City (Rus) -static struct BurnRomInfo md_smbbcRomDesc[] = { - { "mario & battle city (unl).bin", 0x080000, 0x568f7994, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smbbc) -STD_ROM_FN(md_smbbc) - -struct BurnDriver BurnDrvmd_smbbc = { - "md_smbbc", NULL, NULL, NULL, "199?", - "Super Mario Bros. + Battle City (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_SRAM | HARDWARE_SEGA_MEGADRIVE_SRAM_04000, GBF_MISC, 0, - MegadriveGetZipName, md_smbbcRomInfo, md_smbbcRomName, NULL, NULL, MegadriveInputInfo, MegadrivePALDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Robot Wars (Rus) -static struct BurnRomInfo md_srobowrsRomDesc[] = { - { "super robot wars (unl).bin", 0x080000, 0xcfae2614, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_srobowrs) -STD_ROM_FN(md_srobowrs) - -struct BurnDriver BurnDrvmd_srobowrs = { - "md_srobowrs", "md_trgearth", NULL, NULL, "199?", - "Super Robot Wars (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_srobowrsRomInfo, md_srobowrsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// T3 - The Arcade Game (Rus) -static struct BurnRomInfo md_t3agRomDesc[] = { - { "t3 - the arcade game (unl).bin", 0x100000, 0xd2b5ef77, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_t3ag) -STD_ROM_FN(md_t3ag) - -struct BurnDriver BurnDrvmd_t3ag = { - "md_t3ag", "md_t2ag", NULL, NULL, "199?", - "T3 - The Arcade Game (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_t3agRomInfo, md_t3agRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tachki (Rus) -static struct BurnRomInfo md_carsRomDesc[] = { - { "disney's cars (r).bin", 0x200000, 0x6c5f2530, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cars) -STD_ROM_FN(md_cars) - -struct BurnDriver BurnDrvmd_cars = { - "md_cars", "md_sskid", NULL, NULL, "199?", - "Tachki (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_carsRomInfo, md_carsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tachki 2 (Rus) -static struct BurnRomInfo md_cars2RomDesc[] = { - { "cars 2 (unl).bin", 0x200000, 0x4fd4d967, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_cars2) -STD_ROM_FN(md_cars2) - -struct BurnDriver BurnDrvmd_cars2 = { - "md_cars2", "md_cproam", NULL, NULL, "199?", - "Tachki 2 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_cars2RomInfo, md_cars2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tanki 2011 (Rus) -static struct BurnRomInfo md_tank2011RomDesc[] = { - { "tank 2011 (unl).bin", 0x080000, 0x03739820, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tank2011) -STD_ROM_FN(md_tank2011) - -struct BurnDriver BurnDrvmd_tank2011 = { - "md_tank2011", NULL, NULL, NULL, "199?", - "Tanki 2011 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tank2011RomInfo, md_tank2011RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Tiny Toon Adventures 3 (Tw, Cracked) -static struct BurnRomInfo md_ttoon3RomDesc[] = { - { "tiny toon adventures 3 (unl).bin", 0x100000, 0xd65d83d4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ttoon3) -STD_ROM_FN(md_ttoon3) - -struct BurnDriver BurnDrvmd_ttoon3 = { - "md_ttoon3", NULL, NULL, NULL, "199?", - "Tiny Toon Adventures 3 (Tw, Cracked)\0", NULL, "Gamtec?", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SQUIRRELK, GBF_MISC, 0, - MegadriveGetZipName, md_ttoon3RomInfo, md_ttoon3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Teenage Mutant Ninja Turtles - Vozvrashchenie Legendy (Rus) -static struct BurnRomInfo md_tmntruRomDesc[] = { - { "tmnt (unl).bin", 0x100000, 0x7fb1356e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tmntru) -STD_ROM_FN(md_tmntru) - -struct BurnDriver BurnDrvmd_tmntru = { - "md_tmntru", NULL, NULL, NULL, "199?", - "Teenage Mutant Ninja Turtles - Vozvrashchenie Legendy (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tmntruRomInfo, md_tmntruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Transformers 3 (Rus) -static struct BurnRomInfo md_transf3RomDesc[] = { - { "transformers 3 (unl).bin", 0x110d20, 0x8632246d, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_transf3) -STD_ROM_FN(md_transf3) - -struct BurnDriver BurnDrvmd_transf3 = { - "md_transf3", "md_mazinwar", NULL, NULL, "199?", - "Transformers 3 (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_transf3RomInfo, md_transf3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Wario Land 3 (Rus) -static struct BurnRomInfo md_wario3RomDesc[] = { - { "wario land 3 (unl).bin", 0x100000, 0xcd5c93a5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_wario3) -STD_ROM_FN(md_wario3) - -struct BurnDriver BurnDrvmd_wario3 = { - "md_wario3", "md_puggsy", NULL, NULL, "199?", - "Wario Land 3 (Rus)\0", NULL, "Glorysun", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_wario3RomInfo, md_wario3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Winx - Shkola Volshyebnits (Rus) -static struct BurnRomInfo md_winxRomDesc[] = { - { "winx (rus).bin", 0x200000, 0x16bde3e0, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_winx) -STD_ROM_FN(md_winx) - -struct BurnDriver BurnDrvmd_winx = { - "md_winx", "md_valis", NULL, NULL, "199?", - "Winx - Shkola Volshyebnits (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_winxRomInfo, md_winxRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Winx 3D Volshebnoe Priklyuchenie (Rus) -static struct BurnRomInfo md_winx3dRomDesc[] = { - { "winx 3d (unl).bin", 0x12a3d0, 0x933cecc9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_winx3d) -STD_ROM_FN(md_winx3d) - -struct BurnDriver BurnDrvmd_winx3d = { - "md_winx3d", "md_valis3", NULL, NULL, "199?", - "Winx 3D Volshebnoe Priklyuchenie (Rus)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_winx3dRomInfo, md_winx3dRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Action Replay (Euro) -static struct BurnRomInfo md_arRomDesc[] = { - { "action replay (euro).bin", 0x008000, 0x95ff7c3e, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ar) -STD_ROM_FN(md_ar) - -struct BurnDriver BurnDrvmd_ar = { - "md_ar", NULL, NULL, NULL, "199?", - "Action Replay (Euro)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arRomInfo, md_arRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Game Genie (Euro, USA, Rev. A) -static struct BurnRomInfo md_ggenieRomDesc[] = { - { "sgr001-a+sgr002-a.bin", 0x008000, 0x14dbce4a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ggenie) -STD_ROM_FN(md_ggenie) - -struct BurnDriver BurnDrvmd_ggenie = { - "md_ggenie", NULL, NULL, NULL, "199?", - "Game Genie (Euro, USA, Rev. A)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ggenieRomInfo, md_ggenieRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Game Genie (Euro, USA) -static struct BurnRomInfo md_ggenie1RomDesc[] = { - { "sgr001+sgr002.bin", 0x008000, 0x5f293e4c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ggenie1) -STD_ROM_FN(md_ggenie1) - -struct BurnDriver BurnDrvmd_ggenie1 = { - "md_ggenie1", "md_ggenie", NULL, NULL, "199?", - "Game Genie (Euro, USA)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ggenie1RomInfo, md_ggenie1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pro Action Replay (Euro) -static struct BurnRomInfo md_parRomDesc[] = { - { "pro action replay (euro).bin", 0x020000, 0x17255224, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_par) -STD_ROM_FN(md_par) - -struct BurnDriver BurnDrvmd_par = { - "md_par", NULL, NULL, NULL, "199?", - "Pro Action Replay (Euro)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_parRomInfo, md_parRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pro Action Replay 2 (Euro) -static struct BurnRomInfo md_par2RomDesc[] = { - { "pro action replay 2 (euro).bin", 0x010000, 0xa73abd27, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_par2) -STD_ROM_FN(md_par2) - -struct BurnDriver BurnDrvmd_par2 = { - "md_par2", NULL, NULL, NULL, "199?", - "Pro Action Replay 2 (Euro)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_par2RomInfo, md_par2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Pro Action Replay 2 (Euro, Alt) -static struct BurnRomInfo md_par2aRomDesc[] = { - { "pro action replay 2 (euro) (alt).bin", 0x010000, 0xe6669a61, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_par2a) -STD_ROM_FN(md_par2a) - -struct BurnDriver BurnDrvmd_par2a = { - "md_par2a", "md_par2", NULL, NULL, "199?", - "Pro Action Replay 2 (Euro, Alt)\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_par2aRomInfo, md_par2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Racing (Euro) -static struct BurnRomInfo md_vrRomDesc[] = { - { "mpr-16420.bin", 0x200000, 0x9624d4ef, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vr) -STD_ROM_FN(md_vr) - -struct BurnDriverD BurnDrvmd_vr = { - "md_vr", NULL, NULL, NULL, "1994", - "Virtua Racing (Euro)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vrRomInfo, md_vrRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Racing (Jpn) -static struct BurnRomInfo md_vrjRomDesc[] = { - { "mpr-16389.bin", 0x200000, 0x53a293b5, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vrj) -STD_ROM_FN(md_vrj) - -struct BurnDriverD BurnDrvmd_vrj = { - "md_vrj", "md_vr", NULL, NULL, "1994", - "Virtua Racing (Jpn)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vrjRomInfo, md_vrjRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Virtua Racing (USA) -static struct BurnRomInfo md_vruRomDesc[] = { - { "virtua racing (usa).bin", 0x200000, 0x7e1a324a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_vru) -STD_ROM_FN(md_vru) - -struct BurnDriverD BurnDrvmd_vru = { - "md_vru", "md_vr", NULL, NULL, "1994", - "Virtua Racing (USA)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_vruRomInfo, md_vruRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// GEMS v2.8 -static struct BurnRomInfo md_gemsRomDesc[] = { - { "gems.bin", 0x040000, 0x98ebb058, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_gems) -STD_ROM_FN(md_gems) - -struct BurnDriver BurnDrvmd_gems = { - "md_gems", NULL, NULL, NULL, "199?", - "GEMS v2.8\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_gemsRomInfo, md_gemsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sound Tool v2.2? -static struct BurnRomInfo md_sndtoolRomDesc[] = { - { "sndtool.bin", 0x040000, 0xee41b452, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_sndtool) -STD_ROM_FN(md_sndtool) - -struct BurnDriver BurnDrvmd_sndtool = { - "md_sndtool", NULL, NULL, NULL, "1991", - "Sound Tool v2.2?\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sndtoolRomInfo, md_sndtoolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Art Tool -static struct BurnRomInfo md_arttoolRomDesc[] = { - { "arttool.bin", 0x040000, 0x5353f532, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_arttool) -STD_ROM_FN(md_arttool) - -struct BurnDriver BurnDrvmd_arttool = { - "md_arttool", NULL, NULL, NULL, "199?", - "Art Tool\0", NULL, "", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_arttoolRomInfo, md_arttoolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles + Sonic the Hedgehog (World) -static struct BurnRomInfo md_sks1RomDesc[] = { - { "mpr-16910-u.ic1", 0x200000, 0x0658f691, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, - { "mpr-13913.ic1", 0x080000, 0xf9394e97, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_200000 }, -}; - -STD_ROM_PICK(md_sks1) -STD_ROM_FN(md_sks1) - -struct BurnDriver BurnDrvmd_sks1 = { - "md_sks1", NULL, NULL, NULL, "199?", - "Sonic & Knuckles + Sonic the Hedgehog (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sks1RomInfo, md_sks1RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles + Sonic the Hedgehog 2 (World) -static struct BurnRomInfo md_sks2RomDesc[] = { - { "mpr-16910-u.ic1", 0x200000, 0x0658f691, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, - { "mpr-16911-s.ic2", 0x040000, 0x4dcfd55c, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_300000 }, - { "mpr-15000a.bin", 0x100000, 0x7b905383, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_200000 }, -}; - -STD_ROM_PICK(md_sks2) -STD_ROM_FN(md_sks2) - -struct BurnDriver BurnDrvmd_sks2 = { - "md_sks2", NULL, NULL, NULL, "199?", - "Sonic & Knuckles + Sonic the Hedgehog 2 (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sks2RomInfo, md_sks2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sonic & Knuckles + Sonic the Hedgehog 3 (World) -static struct BurnRomInfo md_sks3RomDesc[] = { - { "mpr-16910-u.ic1", 0x200000, 0x0658f691, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, - { "sonic the hedgehog 3 (usa).bin", 0x200000, 0x9bc192ce, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_200000 }, -}; - -STD_ROM_PICK(md_sks3) -STD_ROM_FN(md_sks3) - -struct BurnDriver BurnDrvmd_sks3 = { - "md_sks3", NULL, NULL, NULL, "199?", - "Sonic & Knuckles + Sonic the Hedgehog 3 (World)\0", NULL, "Sega", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_sks3RomInfo, md_sks3RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// -- Homebrew additions below -- - -// Uwol Quest for Money -static struct BurnRomInfo md_uwolRomDesc[] = { - { "uwol.bin", 0x010000, 0x6fa88172, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_uwol) -STD_ROM_FN(md_uwol) - -struct BurnDriver BurnDrvmd_uwol = { - "md_uwol", NULL, NULL, NULL, "2006", - "UWOL Quest for Money\0", NULL, "Mojon Twins", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_uwolRomInfo, md_uwolRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Super Mario Bros. 4 MegaDrive (SMB4MD) 1.4.2 -static struct BurnRomInfo md_smb4mdRomDesc[] = { - { "muls_1.4.2.bin", 0x010000, 0x87a8c533, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smb4md) -STD_ROM_FN(md_smb4md) - -struct BurnDriver BurnDrvmd_smb4md = { - "md_smb4md", NULL, NULL, NULL, "2010", - "Super Mario Bros. 4 MD\0", NULL, "Mairtrus", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smb4mdRomInfo, md_smb4mdRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Lego Batman -static struct BurnRomInfo md_legobatmanRomDesc[] = { - { "Lego Batman (Unl).bin", 0x080000, 0x00da53a9, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_legobatman) -STD_ROM_FN(md_legobatman) - -struct BurnDriver BurnDrvmd_legobatman = { - "md_legobatman", NULL, NULL, NULL, "2014", - "Lego Batman\0", NULL, "Russia", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_legobatmanRomInfo, md_legobatmanRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Oh Mummy -static struct BurnRomInfo md_ohmummyRomDesc[] = { - { "Oh Mummy Genesis.bin", 0x100000, 0xb7f68b29, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_ohmummy) -STD_ROM_FN(md_ohmummy) - -struct BurnDriver BurnDrvmd_ohmummy = { - "md_ohmummy", NULL, NULL, NULL, "2013", - "Oh Mummy\0", NULL, "1985 Alternativo", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_ohmummyRomInfo, md_ohmummyRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fix it Felix JR -static struct BurnRomInfo md_fixitfelixRomDesc[] = { - { "FixItFelixJr_AirwalkStudios.bin", 0x92f0e, 0x424ff451, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fixitfelix) -STD_ROM_FN(md_fixitfelix) - -struct BurnDriver BurnDrvmd_fixitfelix = { - "md_fixitfelixjr", NULL, NULL, NULL, "2014", - "Fix It Felix Jr.\0", NULL, "2014 TOBIKOMI / Airwalkstudios", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fixitfelixRomInfo, md_fixitfelixRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// TGUN II -static struct BurnRomInfo md_tguniiRomDesc[] = { - { "TGUNII05302015_FINALDRAFT002.bin", 0xc0000, 0xc842b4d4, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tgunii) -STD_ROM_FN(md_tgunii) - -struct BurnDriver BurnDrvmd_tgunii = { - "md_tgunii", NULL, NULL, NULL, "2015", - "T*GUN II\0", NULL, "2015 TooManyGames ", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tguniiRomInfo, md_tguniiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Papi CommandoMD -static struct BurnRomInfo md_papiRomDesc[] = { - { "PapiCommandoMD.bin", 0x34e564, 0xec16d540, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_papi) -STD_ROM_FN(md_papi) - -struct BurnDriver BurnDrvmd_papi = { - "md_papicommandomd", NULL, NULL, NULL, "2015", - "Papi Commando MD\0", NULL, "2015 Vetea", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_papiRomInfo, md_papiRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Chase -static struct BurnRomInfo md_chaseRomDesc[] = { - { "Chase (v2.00).bin", 0x60000, 0x0b3426ed, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_chase) -STD_ROM_FN(md_chase) - -struct BurnDriver BurnDrvmd_chase = { - "md_chase", NULL, NULL, NULL, "2014", - "Chase\0", NULL, "2014 Jack Nolddor & Davidian", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_chaseRomInfo, md_chaseRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Fatal Smarties -static struct BurnRomInfo md_fatalsmartiesRomDesc[] = { - { "fatalsmarties.bin", 0x56000, 0x79d461b6, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_fatalsmarties) -STD_ROM_FN(md_fatalsmarties) - -struct BurnDriver BurnDrvmd_fatalsmarties = { - "md_fatalsmarties", NULL, NULL, NULL, "2016", - "Fatal Smarties\0", NULL, "2016 Global Game Jam", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_fatalsmartiesRomInfo, md_fatalsmartiesRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// -- Prototype/Hack additions below -- - -// Thunderbolt II -static struct BurnRomInfo md_tbolt2RomDesc[] = { - { "thunderbolt ii.bin", 0x80000, 0xd5fcc49f, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tbolt2) -STD_ROM_FN(md_tbolt2) - -struct BurnDriver BurnDrvmd_tbolt2 = { - "md_tbolt2", NULL, NULL, NULL, "1995", - "Thunderbolt II (Prototype)\0", NULL, "1995 SUN GREEN", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE | HARDWARE_SEGA_MEGADRIVE_PCB_SMOUSE, GBF_MISC, 0, - MegadriveGetZipName, md_tbolt2RomInfo, md_tbolt2RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Thunderbolt II -static struct BurnRomInfo md_tbolt2aRomDesc[] = { - { "Thunderbolt II (Unl) [f1].bin", 0x80000, 0xa2ef16de, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_tbolt2a) -STD_ROM_FN(md_tbolt2a) - -struct BurnDriver BurnDrvmd_tbolt2a = { - "md_tbolt2a", NULL, NULL, NULL, "1995", - "Thunderbolt II (Unprotected, Prototype)\0", NULL, "1995 SUN GREEN", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_tbolt2aRomInfo, md_tbolt2aRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Big's Fishing Derby -static struct BurnRomInfo md_bigfdRomDesc[] = { - { "bigfd.bin", 0x100000, 0xe1448457, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bigfd) -STD_ROM_FN(md_bigfd) - -struct BurnDriver BurnDrvmd_bigfd = { - "md_bigfd", NULL, NULL, NULL, "2014", - "Big's Fishing Derby\0", NULL, "2014 flamewing", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bigfdRomInfo, md_bigfdRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Sega Master System Brawl -static struct BurnRomInfo md_smsbrawlRomDesc[] = { - { "SMSBrawl.bin", 0x178e2a, 0x7e4a52f3, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_smsbrawl) -STD_ROM_FN(md_smsbrawl) - -struct BurnDriver BurnDrvmd_smsbrawl = { - "md_smsbrawl", NULL, NULL, NULL, "2014", - "Sega Master System Brawl\0", NULL, "2014 Bonaf", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_smsbrawlRomInfo, md_smsbrawlRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Bomb on Basic City 2.06 -static struct BurnRomInfo md_bobc206RomDesc[] = { - { "BasicCity206.bin", 0x1160a6, 0x8f4ac700, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_bobc206) -STD_ROM_FN(md_bobc206) - -struct BurnDriver BurnDrvmd_bobc206 = { - "md_bobc206", NULL, NULL, NULL, "2016", - "Bomb on Basic City 2.06\0", NULL, "2016 Vetea", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_bobc206RomInfo, md_bobc206RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mega Q-Bert v1.1 -static struct BurnRomInfo md_megaqbert11RomDesc[] = { - { "Mega Qbert.bin", 0x80000, 0x692a9227, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_megaqbert11) -STD_ROM_FN(md_megaqbert11) - -struct BurnDriver BurnDrvmd_megaqbert11 = { - "md_megaqbert11", NULL, NULL, NULL, "2016", - "Mega Q-Bert (v1.1)\0", NULL, "2016 Jaklub", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_megaqbert11RomInfo, md_megaqbert11RomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Mini Planets -static struct BurnRomInfo md_miniplanetsRomDesc[] = { - { "Miniplanets-REV02.bin", 0x40000, 0x48460e4a, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_miniplanets) -STD_ROM_FN(md_miniplanets) - -struct BurnDriver BurnDrvmd_miniplanets = { - "md_miniplanets", NULL, NULL, NULL, "2016", - "Mini Planets (REV02)\0", NULL, "2016 Sik", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_miniplanetsRomInfo, md_miniplanetsRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; - -// Ultimate Mortal Kombat Trilogy Hack r.5149 -static struct BurnRomInfo md_umk3tRomDesc[] = { - { "UMKT_5149.bin", 0xA00000, 0x1d9d2eba, BRF_PRG | SEGA_MD_ROM_LOAD16_WORD_SWAP | SEGA_MD_ROM_OFFS_000000 }, -}; - -STD_ROM_PICK(md_umk3t) -STD_ROM_FN(md_umk3t) - -struct BurnDriver BurnDrvmd_umk3t = { - "md_umk3t", NULL, NULL, NULL, "2017", - "Ultimate Mortal Kombat Trilogy Hack rev.5149\0", NULL, "2017 KABAL_MK", "Sega Megadrive", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_SEGA_MEGADRIVE, GBF_MISC, 0, - MegadriveGetZipName, md_umk3tRomInfo, md_umk3tRomName, NULL, NULL, MegadriveInputInfo, MegadriveDIPInfo, - MegadriveInit, MegadriveExit, MegadriveFrame, NULL, MegadriveScan, - &bMegadriveRecalcPalette, 0x100, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/megadrive/megadrive.cpp b/jan/src/burn/drv/megadrive/megadrive.cpp deleted file mode 100644 index 2767cb62d..000000000 --- a/jan/src/burn/drv/megadrive/megadrive.cpp +++ /dev/null @@ -1,4466 +0,0 @@ -/******************************************************************************** - SEGA Genesis / Mega Drive Driver for FBA - ******************************************************************************** - This is part of Pico Library v0936 - - (c) Copyright 2004 Dave, All rights reserved. - (c) Copyright 2006 notaz, All rights reserved. - Free for non-commercial use. - - For commercial use, separate licencing terms must be obtained. - ******************************************************************************** - - PicoOpt bits LSb->MSb: - enable_ym2612&dac, enable_sn76496, enable_z80, stereo_sound, - alt_renderer, 6button_gamepad, accurate_timing, accurate_sprites, - draw_no_32col_border, external_ym2612 - - tofix: - .) Notice the hung notes when Sonic jumps out of the water? (Sonic & Knuckles & Sonic 3). [probably not related to irq handling] - .) FIXED Dec. 31 2015: Battle Squadron - loses sound after weapon upgrade [x] pickup - - ******************************************************************************** - Port by OopsWare overhaul by dink - ********************************************************************************/ - -#include "burnint.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2612.h" -#include "sn76496.h" -#include "megadrive.h" -#include "bitswap.h" -#include "m68000_debug.h" - -#define OSC_NTSC 53693175 -#define OSC_PAL 53203424 - -#define MAX_CARTRIDGE_SIZE 0xc00000 -#define MAX_SRAM_SIZE 0x010000 - -static INT32 dma_xfers = 0; - -typedef void (*MegadriveCb)(); -static MegadriveCb MegadriveCallback; - -struct PicoVideo { - UINT8 reg[0x20]; - UINT32 command; // 32-bit Command - UINT8 pending; // 1 if waiting for second half of 32-bit command - UINT8 type; // Command type (v/c/vsram read/write) - UINT16 addr; // Read/Write address - INT32 status; // Status bits - UINT8 pending_ints; // pending interrupts: ??VH???? - INT8 lwrite_cnt; // VDP write count during active display line - UINT16 v_counter; // V-counter - UINT8 pad[0x13]; // -}; - -struct PicoMisc { - UINT32 Z80Run; - UINT32 Bank68k; - UINT8 Rotate; - -// UINT8 Pad[3]; - -// UINT32 SRamReg; - UINT32 SRamStart; - UINT32 SRamEnd; - UINT32 SRamDetected; - UINT32 SRamActive; - UINT32 SRamHandlersInstalled; - UINT32 SRamReadOnly; - UINT32 SRamHasSerialEEPROM; - - UINT8 I2CMem; - UINT8 I2CClk; - - UINT16 JCartIOData[2]; - - UINT8 L3AltPDat; - UINT8 L3AltPCmd; - - UINT16 SquirrelkingExtra; - - UINT16 Lionk2ProtData; - UINT16 Lionk2ProtData2; - - UINT32 RealtecBankAddr; - UINT32 RealtecBankSize; -}; - -struct TileStrip -{ - INT32 nametab; // Position in VRAM of name table (for this tile line) - INT32 line; // Line number in pixels 0x000-0x3ff within the virtual tilemap - INT32 hscroll; // Horizontal scroll value in pixels for the line - INT32 xmask; // X-Mask (0x1f - 0x7f) for horizontal wraparound in the tilemap - INT32 *hc; // cache for high tile codes and their positions - INT32 cells; // cells (tiles) to draw (32 col mode doesn't need to update whole 320) -}; - -struct MegadriveJoyPad { - UINT16 pad[4]; - UINT8 padTHPhase[4]; - UINT8 padDelay[4]; -}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; - -static UINT8 *RomMain; -static UINT8 *OriginalRom = NULL; - -static UINT8 *Ram68K; -static UINT8 *RamZ80; - -static UINT8 *SRam; -static UINT8 *RamIO; - -static UINT16 *RamPal; -static UINT16 *RamVid; -static UINT16 *RamSVid; -static struct PicoVideo *RamVReg; -static struct PicoMisc *RamMisc; -static struct MegadriveJoyPad *JoyPad; - -UINT16 *MegadriveCurPal; - -static UINT16 *MegadriveBackupRam; - -static UINT8 *HighCol; -static UINT8 *HighColFull; -static UINT16 *LineBuf; - -static INT32 *HighCacheA; -static INT32 *HighCacheB; -static INT32 *HighCacheS; -static INT32 *HighPreSpr; -static INT8 *HighSprZ; - -UINT8 MegadriveReset = 0; -UINT8 bMegadriveRecalcPalette = 0; - -UINT8 MegadriveJoy1[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 MegadriveJoy2[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 MegadriveJoy3[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 MegadriveJoy4[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 MegadriveDIP[2] = {0, 0}; - -static UINT32 RomNum = 0; -static UINT32 RomSize = 0; -static UINT32 SRamSize = 0; - -static INT32 SpriteBlocks; - -static INT32 Scanline = 0; - -static INT32 Z80HasBus = 0; -static INT32 MegadriveZ80Reset = 0; -static INT32 RomNoByteswap; -static UINT32 Z80BankPartial = 0; -static UINT32 Z80BankPos = 0; -static INT32 Z80CyclesPrev = 0; - -static UINT8 Hardware; -static UINT8 DrvSECAM = 0; // NTSC -static UINT8 bNoDebug = 0; -static INT32 bForce3Button = 0; - -void MegadriveCheckHardware() -{ - Hardware = MegadriveDIP[0] & 0xe0; - if (MegadriveDIP[0] & 0x01) { - // Auto Detect Region and SECAM - UINT32 support = 0; - for (INT32 i = 0; i < 4; i++) { - UINT32 v = RomMain[0x1f0 + i]; - if (v <= 0x20) continue; - - switch (v) { - case 0x30: - case 0x31: - case 0x32: - case 0x33: - case 0x34: - case 0x35: - case 0x36: - case 0x37: - case 0x38: - case 0x39: { - support |= v - 0x30; - break; - } - - case 0x41: - case 0x42: - case 0x43: - case 0x44: - case 0x46: { - support |= v - 0x41; - break; - } - - case 0x45: { - // Japan - support |= 0x08; - break; - } - - case 0x4a: { - // Europe - support |= 0x01; - break; - } - - case 0x55: { - // USA - support |= 0x04; - break; - } - - case 0x61: - case 0x62: - case 0x63: - case 0x64: - case 0x65: - case 0x66: { - support |= v - 0x61; - break; - } - } - } - - bprintf(PRINT_IMPORTANT, _T("Autodetecting Cartridge (Hardware Code: %02x%02x%02x%02x):\n"), RomMain[0x1f0], RomMain[0x1f1], RomMain[0x1f2], RomMain[0x1f3]); - Hardware = 0x80; - - if (support & 0x02) { - Hardware = 0x40; // Japan PAL - bprintf(PRINT_IMPORTANT, _T("Japan PAL supported ???\n")); - } - - if (support & 0x01) { - Hardware = 0x00; // Japan NTSC - bprintf(PRINT_IMPORTANT, _T("Japan NTSC supported\n")); - } - - if (support & 0x08) { - Hardware = 0xc0; // Europe PAL - bprintf(PRINT_IMPORTANT, _T("Europe PAL supported\n")); - } - - if (support & 0x04) { - Hardware = 0x80; // USA NTSC - bprintf(PRINT_IMPORTANT, _T("USA NTSC supported\n")); - } - - if ((Hardware & 0xc0) == 0xc0) { - bprintf(PRINT_IMPORTANT, _T("Emulating Europe PAL Machine\n")); - } else { - if ((Hardware & 0x80) == 0x80) { - bprintf(PRINT_IMPORTANT, _T("Emulating USA NTSC Machine\n")); - } else { - if ((Hardware & 0x40) == 0x40) { - bprintf(PRINT_IMPORTANT, _T("Emulating Japan PAL Machine ???\n")); - } else { - if ((Hardware & 0x00) == 0x00) { - bprintf(PRINT_IMPORTANT, _T("Emulating Japan NTSC Machine\n")); - } - } - } - } - - // CD-ROM - Hardware |= MegadriveDIP[0] & 0x20; - } - - if ((Hardware & 0x20) != 0x20) bprintf(PRINT_IMPORTANT, _T("Emulating Mega-CD Add-on\n")); -} - -//----------------------------------------------------------------- - -inline static void CalcCol(INT32 index, UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x000f) << 4; // Red - g = (nColour & 0x00f0) << 0; // Green - b = (nColour & 0x0f00) >> 4; // Blue - - r |= r >> 4; - g |= g >> 4; - b |= b >> 4; - - RamPal[index] = nColour; - - // Normal Color - MegadriveCurPal[index + 0x00] = BurnHighCol(r, g, b, 0); - - // Shadow Color - MegadriveCurPal[index + 0x40] = MegadriveCurPal[index + 0xc0] = BurnHighCol(r>>1, g>>1, b>>1, 0); - - // Highlight Color - r += 0x80; if (r > 0xFF) r = 0xFF; - g += 0x80; if (g > 0xFF) g = 0xFF; - b += 0x80; if (b > 0xFF) b = 0xFF; - MegadriveCurPal[index + 0x80] = BurnHighCol(r, g, b, 0); -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - RomMain = Next; Next += MAX_CARTRIDGE_SIZE; // 68000 ROM, Max enough - - RamStart = Next; - - Ram68K = Next; Next += 0x010000; - RamZ80 = Next; Next += 0x002000; - SRam = Next; Next += MAX_SRAM_SIZE; // SRam - RamIO = Next; Next += 0x000010; // I/O - - RamPal = (UINT16 *) Next; Next += 0x000040 * sizeof(UINT16); - RamSVid = (UINT16 *) Next; Next += 0x000040 * sizeof(UINT16); // VSRam - RamVid = (UINT16 *) Next; Next += 0x008000 * sizeof(UINT16); // Video Ram - RamVReg = (struct PicoVideo *)Next; Next += sizeof(struct PicoVideo); - - RamEnd = Next; - - // Keep RamMisc out of the Ram section to keep from getting cleared on reset. - RamMisc = (struct PicoMisc *)Next; Next += sizeof(struct PicoMisc); - - MegadriveCurPal = (UINT16 *) Next; Next += 0x000040 * sizeof(UINT16) * 4; - - HighColFull = Next; Next += (8 + 320 + 8) * 240 + 1; - - LineBuf = (UINT16 *) Next; Next += 320 * 320 * sizeof(UINT16); // palete-processed line-buffer (dink / for sonic mode) - - HighCacheA = (INT32 *) Next; Next += (41+1) * sizeof(INT32); // caches for high layers - HighCacheB = (INT32 *) Next; Next += (41+1) * sizeof(INT32); - HighCacheS = (INT32 *) Next; Next += (80+1) * sizeof(INT32); // and sprites - HighPreSpr = (INT32 *) Next; Next += (80*2+1) * sizeof(INT32); // slightly preprocessed sprites - HighSprZ = (INT8*) Next; Next += (320+8+8); // Z-buffer for accurate sprites and shadow/hilight mode - - JoyPad = (struct MegadriveJoyPad *) Next; Next += sizeof(struct MegadriveJoyPad); - - MemEnd = Next; - return 0; -} - -UINT16 __fastcall MegadriveReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xa11100: { - UINT16 retVal = rand() & 0xffff; - if (Z80HasBus || MegadriveZ80Reset) { - retVal |= 0x100; - } else { - retVal &= 0xfeff; - } - return retVal; - } - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - } - return 0; -} - -UINT8 __fastcall MegadriveReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xa04000: - case 0xa04001: - case 0xa04002: - case 0xa04003: { - if (!Z80HasBus && !MegadriveZ80Reset) { - return BurnYM2612Read(0, 0); - } else { - return 0; - } - } - - case 0xa11100: { - UINT8 retVal = rand() & 0xff; - if (Z80HasBus || MegadriveZ80Reset) { - retVal |= 0x01; - } else { - retVal &= 0xfe; - } - return retVal; - } - - default: { - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - } - return 0; -} - -void __fastcall MegadriveWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if(sekAddress >= 0xA13004 && sekAddress < 0xA13040) { - // dumb 12-in-1 or 4-in-1 banking support - sekAddress &= 0x3f; - sekAddress <<= 16; - INT32 len = RomSize - sekAddress; - if (len <= 0) return; // invalid/missing bank - if (len > 0x200000) len = 0x200000; // 2 megs - // code which does this is in RAM so this is safe. - memcpy(RomMain, RomMain + sekAddress, len); - return; - } - - switch (sekAddress) { - case 0xa04000: { - if (!Z80HasBus && !MegadriveZ80Reset) { - BurnYM2612Write(0, 0, byteValue); - } - return; - } - - case 0xa04001: { - if (!Z80HasBus && !MegadriveZ80Reset) { - BurnYM2612Write(0, 1, byteValue); - } - return; - } - - case 0xa04002: { - if (!Z80HasBus && !MegadriveZ80Reset) { - BurnYM2612Write(0, 2, byteValue); - } - return; - } - - case 0xa04003: { - if (!Z80HasBus && !MegadriveZ80Reset) { - BurnYM2612Write(0, 3, byteValue); - } - return; - } - - case 0xA11100: { - if (byteValue & 1) { - RamMisc->Z80Run = 0; - Z80HasBus = 0; - } else { - RamMisc->Z80Run = 1; - Z80HasBus = 1; - } - return; - } - - case 0xA11200: { - if (!(byteValue & 1)) { - ZetReset(); - - BurnYM2612Reset(); - MegadriveZ80Reset = 1; - } else { - MegadriveZ80Reset = 0; - } - return; - } - -// case 0xA130F1: { - // sram access register -// RamMisc->SRamReg = byteValue & 0x03; -// return; -// } - - default: { - if (!bNoDebug) - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } - } -} - -void __fastcall MegadriveWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0xa11100: { - if (wordValue & 0x100) { - RamMisc->Z80Run = 0; - Z80HasBus = 0; - } else { - RamMisc->Z80Run = 1; - Z80HasBus = 1; - } - return; - } - - case 0xa11200: { - if (!(wordValue & 0x100)) { - ZetReset(); - - BurnYM2612Reset(); - MegadriveZ80Reset = 1; - } else { - MegadriveZ80Reset = 0; - } - return; - } - - default: { - if (!bNoDebug) - bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } - } -} - -//--------------------------------------------------------------- -// Megadrive Video Port Read Write -//--------------------------------------------------------------- - -static INT32 rendstatus = 0; - -static INT32 GetDmaLength() -{ - INT32 len = 0; - // 16-bit words to transfer: - len = RamVReg->reg[0x13]; - len |= RamVReg->reg[0x14]<<8; - // Charles MacDonald: - if(!len) len = 0xffff; - return len; -} - - - -// dma2vram settings are just hacks to unglitch Legend of Galahad (needs <= 104 to work) -// same for Outrunners (92-121, when active is set to 24) -// 96 is VR hack -static const int dma_timings[] = { - 167, 167, 166, 83, // vblank: 32cell: dma2vram dma2[vs|c]ram vram_fill vram_copy - 102, 205, 204, 102, // vblank: 40cell: - 16, 16, 15, 8, // active: 32cell: - 24, 18, 17, 9 // ... -}; - -static const int dma_bsycles[] = { - (488<<8)/167, (488<<8)/167, (488<<8)/166, (488<<8)/83, - (488<<8)/102, (488<<8)/233, (488<<8)/204, (488<<8)/102, - (488<<8)/16, (488<<8)/16, (488<<8)/15, (488<<8)/8, - (488<<8)/24, (488<<8)/18, (488<<8)/17, (488<<8)/9 -}; - -static UINT32 CheckDMA(void) -{ - int burn = 0, xfers_can, dma_op = RamVReg->reg[0x17]>>6; // see gens for 00 and 01 modes - int xfers = dma_xfers; - int dma_op1; - - if(!(dma_op&2)) dma_op = (RamVReg->type == 1) ? 0 : 1; // setting dma_timings offset here according to Gens - dma_op1 = dma_op; - if(RamVReg->reg[12] & 1) dma_op |= 4; // 40 cell mode? - if(!(RamVReg->status&8)&&(RamVReg->reg[1]&0x40)) dma_op|=8; // active display? - xfers_can = dma_timings[dma_op]; - if(xfers <= xfers_can) - { - if(dma_op&2) RamVReg->status&=~2; // dma no longer busy - else { - burn = xfers * dma_bsycles[dma_op] >> 8; // have to be approximate because can't afford division.. - } - dma_xfers = 0; - } else { - if(!(dma_op&2)) burn = 488; - dma_xfers -= xfers_can; - } - - //elprintf(EL_VDPDMA, "~Dma %i op=%i can=%i burn=%i [%i]", Pico.m.dma_xfers, dma_op1, xfers_can, burn, SekCyclesDone()); - //dprintf("~aim: %i, cnt: %i", SekCycleAim, SekCycleCnt); - //bprintf(0, _T("burn[%d]"), burn); - return burn; -} - -static inline int DMABURN() { // add cycles to the 68k cpu - if (dma_xfers) { - return CheckDMA(); - } else return 0; -} -// extern int counter; -static void DmaSlow(INT32 len) -{ - UINT16 *pd=0, *pdend, *r; - UINT32 a = RamVReg->addr, a2, d; - UINT8 inc = RamVReg->reg[0xf]; - UINT32 source; - - source = RamVReg->reg[0x15] << 1; - source |= RamVReg->reg[0x16] << 9; - source |= RamVReg->reg[0x17] << 17; - - //dprintf("DmaSlow[%i] %06x->%04x len %i inc=%i blank %i [%i|%i]", Pico.video.type, source, a, len, inc, - // (Pico.video.status&8)||!(Pico.video.reg[1]&0x40), Pico.m.scanline, SekCyclesDone()); - - if ((source & 0xe00000) == 0xe00000) { // RAM - pd = (UINT16 *)(Ram68K + (source & 0xfffe)); - pdend = (UINT16 *)(Ram68K + 0x10000); - } else if( source < RomSize) { // ROM - pd = (UINT16 *)(RomMain + (source & ~1)); - pdend = (UINT16 *)(RomMain + RomSize); - } else return; // Invalid source address - - - dma_xfers += len; - - INT32 dmab = DMABURN(); - SekRunAdjust(0 - dmab); // might be wrong! - SekIdle(dmab); - - //if(!(RamVReg->status & 8)) - // SekRunEnd(); - // overflow protection, might break something.. - if (len > pdend - pd) { - len = pdend - pd; - //bprintf(0, _T("DmaSlow() overflow(!).\n")); - //elprintf(EL_VDPDMA|EL_ANOMALY, "DmaSlow overflow"); - } - - switch ( RamVReg->type ) { - case 1: // vram - r = RamVid; - for(; len; len--) { - d = *pd++; - if(a&1) d=(d<<8)|(d>>8); - r[a>>1] = (UINT16)d; // will drop the upper bits - // AutoIncrement - a = (UINT16)(a+inc); - // didn't src overlap? - //if(pd >= pdend) pd -= 0x8000; // should be good for RAM, bad for ROM - } - rendstatus |= 0x10; - break; - - case 3: // cram - //dprintf("DmaSlow[%i] %06x->%04x len %i inc=%i blank %i [%i|%i]", Pico.video.type, source, a, len, inc, - // (Pico.video.status&8)||!(Pico.video.reg[1]&0x40), Pico.m.scanline, SekCyclesDone()); - for(a2 = a&0x7f; len; len--) { - CalcCol( a2>>1, BURN_ENDIAN_SWAP_INT16(*pd) ); - pd++; - // AutoIncrement - a2+=inc; - // didn't src overlap? - //if(pd >= pdend) pd-=0x8000; - // good dest? - if(a2 >= 0x80) break; // Todds Adventures in Slime World / Andre Agassi tennis - } - a = (a&0xff00) | a2; - break; - - case 5: // vsram[a&0x003f]=d; - r = RamSVid; - for(a2=a&0x7f; len; len--) { - r[a2>>1] = (UINT16)*pd++; - // AutoIncrement - a2+=inc; - // didn't src overlap? - //if(pd >= pdend) pd-=0x8000; - // good dest? - if(a2 >= 0x80) break; - } - a=(a&0xff00)|a2; - break; - } - // remember addr - RamVReg->addr = (UINT16)a; -} - -static void DmaCopy(INT32 len) -{ - UINT8 * vr = (UINT8 *) RamVid; - UINT8 * vrs; - //UINT16 a = Pico.video.addr; - //UINT8 inc = RamVReg->reg[0xf]; - INT32 source; - - //dprintf("DmaCopy len %i [%i|%i]", len, Pico.m.scanline, SekCyclesDone()); - - RamVReg->status |= 2; // dma busy - dma_xfers += len; - - source = RamVReg->reg[0x15]; - source |= RamVReg->reg[0x16]<<8; - vrs = vr + source; - - if (source+len > 0x10000) - len = 0x10000 - source; // clip?? - - for(;len;len--) { - vr[RamVReg->addr] = *vrs++; - // AutoIncrement - //a = (u16)(a + inc); - RamVReg->addr += RamVReg->reg[0xf]; - } - rendstatus |= 0x10; -} - -static void DmaFill(INT32 data) -{ - INT32 len = GetDmaLength(); - UINT8 *vr = (UINT8 *) RamVid; - UINT8 high = (UINT8) (data >> 8); - UINT16 a = RamVReg->addr; - UINT8 inc = RamVReg->reg[0xf]; - - //dprintf("DmaFill len %i inc %i [%i|%i]", len, inc, Pico.m.scanline, SekCyclesDone()); - - // from Charles MacDonald's genvdp.txt: - // Write lower byte to address specified - RamVReg->status |= 2; // dma busy - dma_xfers += len; - vr[a] = (UINT8) data; - a = (UINT16)(a+inc); - - if(!inc) len=1; - - for(;len;len--) { - // Write upper byte to adjacent address - // (here we are byteswapped, so address is already 'adjacent') - vr[a] = high; - // Increment address register - a = (UINT16)(a+inc); - } - // remember addr - RamVReg->addr = a; - // update length - RamVReg->reg[0x13] = RamVReg->reg[0x14] = 0; // Dino Dini's Soccer (E) (by Haze) - - rendstatus |= 0x10; -} - -static void CommandChange() -{ - //struct PicoVideo *pvid=&Pico.video; - UINT32 cmd = RamVReg->command; - UINT32 addr = 0; - - // Get type of transfer 0xc0000030 (v/c/vsram read/write) - RamVReg->type = (UINT8)(((cmd >> 2) & 0xc) | (cmd >> 30)); - - // Get address 0x3fff0003 - addr = (cmd >> 16) & 0x3fff; - addr |= (cmd << 14) & 0xc000; - RamVReg->addr = (UINT16)addr; - //dprintf("addr set: %04x", addr); - - // Check for dma: - if (cmd & 0x80) { - // Command DMA - if ((RamVReg->reg[1] & 0x10) == 0) return; // DMA not enabled - INT32 len = GetDmaLength(); - switch ( RamVReg->reg[0x17]>>6 ) { - case 0x00: - case 0x01: - DmaSlow(len); // 68000 to VDP - break; - case 0x03: - DmaCopy(len); // VRAM Copy - break; - case 0x02: // DMA Fill Flag ??? - default: - ;//bprintf(PRINT_NORMAL, _T("Video Command DMA Unknown %02x len %d\n"), RamVReg->reg[0x17]>>6, len); - } - } -} - -// H-counter table for hvcounter reads in 40col mode -// based on Gens code -const UINT8 hcounts_40[] = { - 0x07,0x07,0x08,0x08,0x08,0x09,0x09,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0d,0x0d, - 0x0e,0x0e,0x0e,0x0f,0x0f,0x10,0x10,0x10,0x11,0x11,0x12,0x12,0x13,0x13,0x13,0x14, - 0x14,0x15,0x15,0x15,0x16,0x16,0x17,0x17,0x18,0x18,0x18,0x19,0x19,0x1a,0x1a,0x1b, - 0x1b,0x1b,0x1c,0x1c,0x1d,0x1d,0x1d,0x1e,0x1e,0x1f,0x1f,0x20,0x20,0x20,0x21,0x21, - 0x22,0x22,0x23,0x23,0x23,0x24,0x24,0x25,0x25,0x25,0x26,0x26,0x27,0x27,0x28,0x28, - 0x28,0x29,0x29,0x2a,0x2a,0x2a,0x2b,0x2b,0x2c,0x2c,0x2d,0x2d,0x2d,0x2e,0x2e,0x2f, - 0x2f,0x30,0x30,0x30,0x31,0x31,0x32,0x32,0x32,0x33,0x33,0x34,0x34,0x35,0x35,0x35, - 0x36,0x36,0x37,0x37,0x38,0x38,0x38,0x39,0x39,0x3a,0x3a,0x3a,0x3b,0x3b,0x3c,0x3c, - 0x3d,0x3d,0x3d,0x3e,0x3e,0x3f,0x3f,0x3f,0x40,0x40,0x41,0x41,0x42,0x42,0x42,0x43, - 0x43,0x44,0x44,0x45,0x45,0x45,0x46,0x46,0x47,0x47,0x47,0x48,0x48,0x49,0x49,0x4a, - 0x4a,0x4a,0x4b,0x4b,0x4c,0x4c,0x4d,0x4d,0x4d,0x4e,0x4e,0x4f,0x4f,0x4f,0x50,0x50, - 0x51,0x51,0x52,0x52,0x52,0x53,0x53,0x54,0x54,0x55,0x55,0x55,0x56,0x56,0x57,0x57, - 0x57,0x58,0x58,0x59,0x59,0x5a,0x5a,0x5a,0x5b,0x5b,0x5c,0x5c,0x5c,0x5d,0x5d,0x5e, - 0x5e,0x5f,0x5f,0x5f,0x60,0x60,0x61,0x61,0x62,0x62,0x62,0x63,0x63,0x64,0x64,0x64, - 0x65,0x65,0x66,0x66,0x67,0x67,0x67,0x68,0x68,0x69,0x69,0x6a,0x6a,0x6a,0x6b,0x6b, - 0x6c,0x6c,0x6c,0x6d,0x6d,0x6e,0x6e,0x6f,0x6f,0x6f,0x70,0x70,0x71,0x71,0x71,0x72, - 0x72,0x73,0x73,0x74,0x74,0x74,0x75,0x75,0x76,0x76,0x77,0x77,0x77,0x78,0x78,0x79, - 0x79,0x79,0x7a,0x7a,0x7b,0x7b,0x7c,0x7c,0x7c,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f,0x7f, - 0x80,0x80,0x81,0x81,0x81,0x82,0x82,0x83,0x83,0x84,0x84,0x84,0x85,0x85,0x86,0x86, - 0x86,0x87,0x87,0x88,0x88,0x89,0x89,0x89,0x8a,0x8a,0x8b,0x8b,0x8c,0x8c,0x8c,0x8d, - 0x8d,0x8e,0x8e,0x8e,0x8f,0x8f,0x90,0x90,0x91,0x91,0x91,0x92,0x92,0x93,0x93,0x94, - 0x94,0x94,0x95,0x95,0x96,0x96,0x96,0x97,0x97,0x98,0x98,0x99,0x99,0x99,0x9a,0x9a, - 0x9b,0x9b,0x9b,0x9c,0x9c,0x9d,0x9d,0x9e,0x9e,0x9e,0x9f,0x9f,0xa0,0xa0,0xa1,0xa1, - 0xa1,0xa2,0xa2,0xa3,0xa3,0xa3,0xa4,0xa4,0xa5,0xa5,0xa6,0xa6,0xa6,0xa7,0xa7,0xa8, - 0xa8,0xa9,0xa9,0xa9,0xaa,0xaa,0xab,0xab,0xab,0xac,0xac,0xad,0xad,0xae,0xae,0xae, - 0xaf,0xaf,0xb0,0xb0,0xe4,0xe4,0xe4,0xe5,0xe5,0xe6,0xe6,0xe6,0xe7,0xe7,0xe8,0xe8, - 0xe9,0xe9,0xe9,0xea,0xea,0xeb,0xeb,0xeb,0xec,0xec,0xed,0xed,0xee,0xee,0xee,0xef, - 0xef,0xf0,0xf0,0xf1,0xf1,0xf1,0xf2,0xf2,0xf3,0xf3,0xf3,0xf4,0xf4,0xf5,0xf5,0xf6, - 0xf6,0xf6,0xf7,0xf7,0xf8,0xf8,0xf9,0xf9,0xf9,0xfa,0xfa,0xfb,0xfb,0xfb,0xfc,0xfc, - 0xfd,0xfd,0xfe,0xfe,0xfe,0xff,0xff,0x00,0x00,0x00,0x01,0x01,0x02,0x02,0x03,0x03, - 0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,0x07,0x07,0x08,0x08,0x08,0x09,0x09,0x0a, - 0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0d,0x0d,0x0e,0x0e,0x0e,0x0f,0x0f,0x10,0x10,0x10, -}; - -// H-counter table for hvcounter reads in 32col mode -const UINT8 hcounts_32[] = { - 0x05,0x05,0x05,0x06,0x06,0x07,0x07,0x07,0x08,0x08,0x08,0x09,0x09,0x09,0x0a,0x0a, - 0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0e,0x0e,0x0f,0x0f,0x0f,0x10, - 0x10,0x10,0x11,0x11,0x11,0x12,0x12,0x12,0x13,0x13,0x13,0x14,0x14,0x14,0x15,0x15, - 0x15,0x16,0x16,0x17,0x17,0x17,0x18,0x18,0x18,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1b, - 0x1b,0x1b,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1e,0x1e,0x1f,0x1f,0x1f,0x20,0x20,0x20, - 0x21,0x21,0x21,0x22,0x22,0x22,0x23,0x23,0x23,0x24,0x24,0x24,0x25,0x25,0x26,0x26, - 0x26,0x27,0x27,0x27,0x28,0x28,0x28,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b, - 0x2c,0x2c,0x2c,0x2d,0x2d,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x30,0x30,0x30,0x31,0x31, - 0x31,0x32,0x32,0x32,0x33,0x33,0x33,0x34,0x34,0x34,0x35,0x35,0x36,0x36,0x36,0x37, - 0x37,0x37,0x38,0x38,0x38,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3c,0x3c, - 0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x40,0x40,0x40,0x41,0x41,0x41,0x42, - 0x42,0x42,0x43,0x43,0x43,0x44,0x44,0x45,0x45,0x45,0x46,0x46,0x46,0x47,0x47,0x47, - 0x48,0x48,0x48,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4c,0x4c,0x4d,0x4d, - 0x4d,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x50,0x50,0x50,0x51,0x51,0x51,0x52,0x52,0x52, - 0x53,0x53,0x53,0x54,0x54,0x55,0x55,0x55,0x56,0x56,0x56,0x57,0x57,0x57,0x58,0x58, - 0x58,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5b,0x5b,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5e, - 0x5e,0x5e,0x5f,0x5f,0x5f,0x60,0x60,0x60,0x61,0x61,0x61,0x62,0x62,0x62,0x63,0x63, - 0x64,0x64,0x64,0x65,0x65,0x65,0x66,0x66,0x66,0x67,0x67,0x67,0x68,0x68,0x68,0x69, - 0x69,0x69,0x6a,0x6a,0x6a,0x6b,0x6b,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e, - 0x6f,0x6f,0x6f,0x70,0x70,0x70,0x71,0x71,0x71,0x72,0x72,0x72,0x73,0x73,0x74,0x74, - 0x74,0x75,0x75,0x75,0x76,0x76,0x76,0x77,0x77,0x77,0x78,0x78,0x78,0x79,0x79,0x79, - 0x7a,0x7a,0x7b,0x7b,0x7b,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f, - 0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x82,0x82,0x83,0x83,0x83,0x84,0x84,0x84,0x85, - 0x85,0x85,0x86,0x86,0x86,0x87,0x87,0x87,0x88,0x88,0x88,0x89,0x89,0x89,0x8a,0x8a, - 0x8b,0x8b,0x8b,0x8c,0x8c,0x8c,0x8d,0x8d,0x8d,0x8e,0x8e,0x8e,0x8f,0x8f,0x8f,0x90, - 0x90,0x90,0x91,0x91,0xe8,0xe8,0xe8,0xe9,0xe9,0xe9,0xea,0xea,0xea,0xeb,0xeb,0xeb, - 0xec,0xec,0xec,0xed,0xed,0xed,0xee,0xee,0xee,0xef,0xef,0xf0,0xf0,0xf0,0xf1,0xf1, - 0xf1,0xf2,0xf2,0xf2,0xf3,0xf3,0xf3,0xf4,0xf4,0xf4,0xf5,0xf5,0xf5,0xf6,0xf6,0xf6, - 0xf7,0xf7,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfc,0xfc, - 0xfc,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xff,0xff,0x00,0x00,0x00,0x01,0x01,0x01,0x02, - 0x02,0x02,0x03,0x03,0x03,0x04,0x04,0x04,0x05,0x05,0x05,0x06,0x06,0x07,0x07,0x07, - 0x08,0x08,0x08,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0c,0x0d, -}; - -static UINT32 line_base_cycles = 0; - -UINT16 __fastcall MegadriveVideoReadWord(UINT32 sekAddress) -{ - //bprintf(PRINT_NORMAL, _T("Video Attempt to read word value of location %x\n"), sekAddress); - //return MegadriveVDPRead((sekAddress - 0xc00000) >> 1); - - if (sekAddress > 0xC0001F) - bprintf(PRINT_NORMAL, _T("Video Attempt to read word value of location %x\n"), sekAddress); - - UINT16 res = 0; - - switch (sekAddress & 0x1c) { - case 0x00: // data - switch (RamVReg->type) { - case 0: res = BURN_ENDIAN_SWAP_INT16(RamVid [(RamVReg->addr >> 1) & 0x7fff]); break; - case 4: res = BURN_ENDIAN_SWAP_INT16(RamSVid[(RamVReg->addr >> 1) & 0x003f]); break; - case 8: res = BURN_ENDIAN_SWAP_INT16(RamPal [(RamVReg->addr >> 1) & 0x003f]); break; - } - RamVReg->addr += RamVReg->reg[0xf]; - break; - - case 0x04: // command - { - UINT16 d = RamVReg->status; //xxxxxxxxxxx - if (SekTotalCycles() - line_base_cycles >= 488-88) - d|=0x0004; // H-Blank (Sonic3 vs) - - d |= ((RamVReg->reg[1]&0x40)^0x40) >> 3; // set V-Blank if display is disabled - d |= (RamVReg->pending_ints&0x20)<<2; // V-int pending? - if (d&0x100) RamVReg->status&=~0x100; // FIFO no longer full - - RamVReg->pending = 0; // ctrl port reads clear write-pending flag (Charles MacDonald) - - return d; - } - break; - case 0x08: // H-counter info - { - UINT32 d; - - d = (SekTotalCycles() - line_base_cycles) & 0x1ff; // FIXME - - if (RamVReg->reg[12]&1) - d = hcounts_40[d]; - else d = hcounts_32[d]; - - //elprintf(EL_HVCNT, "hv: %02x %02x (%i) @ %06x", d, Pico.video.v_counter, SekCyclesDone(), SekPc); - return d | (RamVReg->v_counter << 8); - } - break; - - default: - bprintf(PRINT_NORMAL, _T("Video Attempt to read word value of location %x, %x\n"), sekAddress, sekAddress & 0x1c); - break; - } - - return res; -} - -UINT8 __fastcall MegadriveVideoReadByte(UINT32 sekAddress) -{ - //bprintf(PRINT_NORMAL, _T("Video Attempt to read byte value of location %x\n"), sekAddress); - UINT16 res = MegadriveVideoReadWord(sekAddress & ~1); - if ((sekAddress&1)==0) res >>= 8; - return res & 0xff; -} - -void __fastcall MegadriveVideoWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress > 0xC0001F) - bprintf(PRINT_NORMAL, _T("Video Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - - switch (sekAddress & 0x1c) { - case 0x00: // data - if (RamVReg->pending) { - CommandChange(); - RamVReg->pending = 0; - } - if ((RamVReg->command & 0x80) && (RamVReg->reg[1]&0x10) && (RamVReg->reg[0x17]>>6)==2) { - - DmaFill(wordValue); - - } else { - - // FIFO - // preliminary FIFO emulation for Chaos Engine, The (E) - if (!(RamVReg->status&8) && (RamVReg->reg[1]&0x40)) // active display? - { - RamVReg->status&=~0x200; // FIFO no longer empty - RamVReg->lwrite_cnt++; - if (RamVReg->lwrite_cnt >= 4) RamVReg->status|=0x100; // FIFO full - if (RamVReg->lwrite_cnt > 4) { - SekRunAdjust(0-80); - SekIdle(80); - } - //elprintf(EL_ASVDP, "VDP data write: %04x [%06x] {%i} #%i @ %06x", d, Pico.video.addr, - // Pico.video.type, pvid->lwrite_cnt, SekPc); - } - - //UINT32 a=Pico.video.addr; - switch (RamVReg->type) { - case 1: - // If address is odd, bytes are swapped (which game needs this?) - // williams arcade greatest hits -dink - if (RamVReg->addr & 1) { - //bprintf(PRINT_NORMAL, _T("Video address is odd, bytes are swapped!!!\n")); - wordValue = (wordValue<<8)|(wordValue>>8); - } - RamVid[(RamVReg->addr >> 1) & 0x7fff] = BURN_ENDIAN_SWAP_INT16(wordValue); - rendstatus |= 0x10; - break; - case 3: - //Pico.m.dirtyPal = 1; - //dprintf("w[%i] @ %04x, inc=%i [%i|%i]", Pico.video.type, a, Pico.video.reg[0xf], Pico.m.scanline, SekCyclesDone()); - CalcCol((RamVReg->addr >> 1) & 0x003f, wordValue); - break; - case 5: - RamSVid[(RamVReg->addr >> 1) & 0x003f] = BURN_ENDIAN_SWAP_INT16(wordValue); - break; - } - //dprintf("w[%i] @ %04x, inc=%i [%i|%i]", Pico.video.type, a, Pico.video.reg[0xf], Pico.m.scanline, SekCyclesDone()); - //AutoIncrement(); - RamVReg->addr += RamVReg->reg[0xf]; - } - return; - - case 0x04: // command - if(RamVReg->pending) { - // Low word of command: - RamVReg->command &= 0xffff0000; - RamVReg->command |= wordValue; - RamVReg->pending = 0; - CommandChange(); - } else { - if((wordValue & 0xc000) == 0x8000) { - INT32 num = (wordValue >> 8) & 0x1f; - RamVReg->type = 0; // register writes clear command (else no Sega logo in Golden Axe II) - if (num > 0x0a && !(RamVReg->reg[1] & 4)) { - //bprintf(0, _T("%02x written to reg %02x in SMS mode @ %06x"), d, num, SekGetPC(-1)); - return; - } - RamVReg->reg[num] = wordValue & 0xff; - - // update IRQ level (Lemmings, Wiz 'n' Liz intro, ... ) - // may break if done improperly: - // International Superstar Soccer Deluxe (crash), Street Racer (logos), Burning Force (gfx), Fatal Rewind (hang), Sesame Street Counting Cafe - if(num < 2 && !SekShouldInterrupt()) { - - INT32 irq = 0; - INT32 lines = (RamVReg->reg[1] & 0x20) | (RamVReg->reg[0] & 0x10); - INT32 pints = (RamVReg->pending_ints&lines); - if (pints & 0x20) irq = 6; - else if (pints & 0x10) irq = 4; - - if (pints) { - SekSetIRQLine(irq, CPU_IRQSTATUS_ACK); - SekRunAdjust(0-4); // delay irq, fixes Sesame Street - SekIdle(4); - } else { - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - } - - if (num == 5) rendstatus |= 1; -// else if(num == 0xc) Pico.m.dirtyPal = 2; // renderers should update their palettes if sh/hi mode is changed - } else { - // High word of command: - RamVReg->command &= 0x0000ffff; - RamVReg->command |= wordValue << 16; - RamVReg->pending = 1; - } - } - return; - - case 0x10: - case 0x14: - // PSG Sound - //bprintf(PRINT_NORMAL, _T("PSG Attempt to write word value %04x to location %08x\n"), wordValue, sekAddress); - SN76496Write(0, wordValue & 0xFF); - return; - - } - bprintf(0, _T("unmapped vdp %X %X\n"), sekAddress, sekAddress & 0x1c); -} - -void __fastcall MegadriveVideoWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - //bprintf(PRINT_NORMAL, _T("Video Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - MegadriveVideoWriteWord(sekAddress, (byteValue << 8) | byteValue); -} - -// -- Z80 Ram Read Write ------------------------------------------ - -UINT8 __fastcall MegadriveZ80RamReadByte(UINT32 sekAddress) -{ - if (!Z80HasBus && !MegadriveZ80Reset) { - return RamZ80[sekAddress & 0x1fff]; - } - - return 0; -} - -UINT16 __fastcall MegadriveZ80RamReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Z80Ram Attempt to read word value of location %x\n"), sekAddress); - return 0; -} - -void __fastcall MegadriveZ80RamWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (!Z80HasBus && !MegadriveZ80Reset) { - RamZ80[sekAddress & 0x1fff] = byteValue; - return; - } - bprintf(PRINT_NORMAL, _T("Z80Ram Attempt to write byte value %x to location %x and didn't have the Bus!\n"), byteValue, sekAddress); -} - -void __fastcall MegadriveZ80RamWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (!Z80HasBus && !MegadriveZ80Reset) { - RamZ80[sekAddress & 0x1fff] = wordValue >> 8; - return; - } - - bprintf(PRINT_NORMAL, _T("Z80Ram Attempt to write word value %x to location %x and didn't have the Bus!\n"), wordValue, sekAddress); -// MegadriveZ80RamWriteByte(sekAddress, wordValue >> 0x08); -} - -// -- I/O Read Write ------------------------------------------ - -static INT32 PadRead3btn(INT32 i) -{ - INT32 pad = ~(JoyPad->pad[i]); // Get inverse of pad MXYZ SACB RLDU - INT32 value; - - if (RamIO[i+1] & 0x40) // TH - value = pad & 0x3f; // ?1CB RLDU - else - value = ((pad & 0xc0) >> 2) | (pad & 3); // ?0SA 00DU - - value |= RamIO[i+1] & 0x40; - return value; -} - -static INT32 PadRead(INT32 i) -{ - if (bForce3Button) return // get that out of the way... (Forgotten Worlds...) - PadRead3btn(i); - - INT32 pad=0,value=0,TH; - pad = ~(JoyPad->pad[i]); // Get inverse of pad MXYZ SACB RLDU - TH = RamIO[i+1] & 0x40; - - /*if(PicoOpt & 0x20)*/ { // 6 button gamepad enabled - INT32 phase = JoyPad->padTHPhase[i]; - - if(phase == 2 && !TH) { - value = (pad&0xc0)>>2; // ?0SA 0000 - goto end; - } else if(phase == 3 && TH) { - value=(pad&0x30)|((pad>>8)&0xf); // ?1CB MXYZ - goto end; - } else if(phase == 3 && !TH) { - value=((pad&0xc0)>>2)|0x0f; // ?0SA 1111 - goto end; - } - } - - if(TH) value=(pad&0x3f); // ?1CB RLDU - else value=((pad&0xc0)>>2)|(pad&3); // ?0SA 00DU - -end: - - // orr the bits, which are set as output - value |= RamIO[i+1] & RamIO[i+4]; - - return value; // will mirror later -} - -UINT8 __fastcall MegadriveIOReadByte(UINT32 sekAddress) -{ - if (sekAddress > 0xA1001F) - bprintf(PRINT_NORMAL, _T("IO Attempt to read byte value of location %x\n"), sekAddress); - - INT32 offset = (sekAddress >> 1) & 0xf; - switch (offset) { - case 0: // Get Hardware - return Hardware; - case 1: // Pad 1 - return (RamIO[1] & 0x80) | PadRead(0); - case 2: // Pad 2 - return (RamIO[2] & 0x80) | PadRead(1); - default: - //bprintf(PRINT_NORMAL, _T("IO Attempt to read byte value of location %x\n"), sekAddress); - return RamIO[offset]; - } - return 0; -} - -UINT16 __fastcall MegadriveIOReadWord(UINT32 sekAddress) -{ - //if (sekAddress > 0xA1001F) - // bprintf(PRINT_NORMAL, _T("IO Attempt to read word value of location %x\n"), sekAddress); - - UINT8 res = MegadriveIOReadByte(sekAddress); - return res | (res << 8); -} - -void __fastcall MegadriveIOWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (sekAddress > 0xA1001F) - bprintf(PRINT_NORMAL, _T("IO Attempt to byte byte value %x to location %x\n"), byteValue, sekAddress); - - INT32 offset = (sekAddress >> 1) & 0xf; - // 6-Button Support - switch( offset ) { - case 1: - JoyPad->padDelay[0] = 0; - if(!(RamIO[1] & 0x40) && (byteValue&0x40)) - JoyPad->padTHPhase[0] ++; - break; - case 2: - JoyPad->padDelay[1] = 0; - if(!(RamIO[2] & 0x40) && (byteValue&0x40)) - JoyPad->padTHPhase[1] ++; - break; - } - RamIO[offset] = byteValue; -} - -void __fastcall MegadriveIOWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - //if (sekAddress > 0xA1001F) - // bprintf(PRINT_NORMAL, _T("IO Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - - MegadriveIOWriteByte(sekAddress, wordValue & 0xff); -} - -// -- YM2612/YM2612 FM Chip ---------------------------------------------------------- - -inline static INT32 MegadriveSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)SekTotalCycles() * nSoundRate / (OSC_NTSC / 7); -} - -inline static double MegadriveGetTime() -{ - return (double)SekTotalCycles() / (OSC_NTSC / 7); -} - -inline static INT32 MegadriveSynchroniseStreamPAL(INT32 nSoundRate) -{ - return (INT64)SekTotalCycles() * nSoundRate / (OSC_PAL / 7); -} - -inline static double MegadriveGetTimePAL() -{ - return (double)SekTotalCycles() / (OSC_PAL / 7); -} - -// --------------------------------------------------------------- - -static INT32 MegadriveResetDo() -{ - memset (RamStart, 0, RamEnd - RamStart); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2612Reset(); - - MegadriveZ80Reset = 1; - Z80HasBus = 1; - -#if 0 - FILE * f = fopen("Megadrive.bin", "wb+"); - fwrite(RomMain, 1, 0x200000, f); - fclose(f); -#endif - - MegadriveCheckHardware(); - - if (Hardware & 0x40) { - BurnSetRefreshRate(50.0); - Reinitialise(); - - BurnYM2612Exit(); - BurnYM2612Init(1, OSC_PAL / 7, NULL, MegadriveSynchroniseStreamPAL, MegadriveGetTimePAL, 0); - BurnTimerAttachSek(OSC_PAL / 7); - BurnYM2612SetRoute(0, BURN_SND_YM2612_YM2612_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - BurnYM2612SetRoute(0, BURN_SND_YM2612_YM2612_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - BurnYM2612Reset(); - - SN76496Exit(); - SN76496Init(0, OSC_PAL / 15, 1); - SN76496SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - } else { - BurnSetRefreshRate(60.0); - Reinitialise(); - - BurnYM2612Exit(); - BurnYM2612Init(1, OSC_NTSC / 7, NULL, MegadriveSynchroniseStream, MegadriveGetTime, 0); - BurnTimerAttachSek(OSC_NTSC / 7); - BurnYM2612SetRoute(0, BURN_SND_YM2612_YM2612_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - BurnYM2612SetRoute(0, BURN_SND_YM2612_YM2612_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - BurnYM2612Reset(); - - SN76496Exit(); - SN76496Init(0, OSC_NTSC / 15, 1); - SN76496SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - } - - // other reset - //memset(RamMisc, 0, sizeof(struct PicoMisc)); // do not clear because Mappers/SRam are set up in here when the driver inits - memset(JoyPad, 0, sizeof(struct MegadriveJoyPad)); - - // default VDP register values (based on Fusion) - memset(RamVReg, 0, sizeof(struct PicoVideo)); - RamVReg->reg[0x00] = 0x04; - RamVReg->reg[0x01] = 0x04; - RamVReg->reg[0x0c] = 0x81; - RamVReg->reg[0x0f] = 0x02; - - RamVReg->status = 0x3408 | ((MegadriveDIP[0] & 0x40) >> 6); // 'always set' bits | vblank | collision | pal - - RamMisc->Bank68k = 0; - Z80BankPartial = 0; - Z80BankPos = 0; - Z80CyclesPrev = 0; - - dma_xfers = rand() & 0x7fff; // random start cycle, so Bonkers has a different boot-up logo each run and possibly affects other games as well. - Scanline = 0; - rendstatus = 0; - bMegadriveRecalcPalette = 1; - - return 0; -} - -INT32 __fastcall MegadriveIrqCallback(INT32 irq) -{ - switch ( irq ) { - case 4: RamVReg->pending_ints = 0x00; break; - case 6: RamVReg->pending_ints &= ~0x20; break; - } - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - return -1; -} - -// ---------------------------------------------------------------- -// Z80 Read/Write -// ---------------------------------------------------------------- - -UINT8 __fastcall MegadriveZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0xbf: break; // some games read this, case added just to prevent massive debug scroll - default: { - //bprintf(PRINT_NORMAL, _T("Z80 Port Read %02x\n"), a); - } - } - - return 0; -} - -void __fastcall MegadriveZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write %02x, %02%x\n"), a, d); - } - } -} - -UINT8 __fastcall MegadriveZ80ProgRead(UINT16 a) -{ - if (a >= 0x6100 && a <= 0x7eff) { - return 0xff; - } - - if (a >= 0x8000) { - UINT32 addr68k = RamMisc->Bank68k; - addr68k += a & 0x7fff; - if (addr68k <= 0x3fffff) return RomMain[addr68k ^ 1]; - - //bprintf(PRINT_NORMAL, _T("Z80 trying to read 68k address %06X\n"), addr68k); - return 0; - } - - switch (a) { - case 0x4000: - case 0x4001: - case 0x4002: { - return BurnYM2612Read(0, 0); - } - - default: { - //bprintf(PRINT_NORMAL, _T("Z80 Read %04x\n"), a); - } - } - - return 0; -} - -void __fastcall MegadriveZ80ProgWrite(UINT16 a, UINT8 d) -{ - if (a == 0x6000 || a == 0x6001) { - Z80BankPartial |= (d & 0x01) << 23; - Z80BankPos++; - - if (Z80BankPos < 9) { - Z80BankPartial >>= 1; - } else { - Z80BankPos = 0; - RamMisc->Bank68k = Z80BankPartial; - Z80BankPartial = 0; - } - return; - } - - if (a >= 0x8000) { - UINT32 addr68k = RamMisc->Bank68k; - addr68k += a & 0x7fff; - - if (addr68k <= 0x3fffff) return; - - if (addr68k == 0xc00011) { - SN76496Write(0, d); - return; - } - - if ((addr68k >= 0xe00000) && (addr68k <= 0xffffff)) { - addr68k &=0xffff; - UINT16 *Ram = (UINT16*)Ram68K; - if (addr68k & 0x01) { - Ram[addr68k >> 1] = (Ram[addr68k >> 1] & 0xff00) | d; - } else { - Ram[addr68k >> 1] = (Ram[addr68k >> 1] & 0x00ff) | (d << 8); - } - return; - } - - bprintf(PRINT_NORMAL, _T("Z80-Bank68K Attempt to write byte value %02x to location %06x\n"), d, addr68k); - return; - } - - switch (a) { - case 0x4000: { - BurnYM2612Write(0, 0, d); - return; - } - - case 0x4001: { - BurnYM2612Write(0, 1, d); - return; - } - - case 0x4002: { - BurnYM2612Write(0, 2, d); - return; - } - - case 0x4003: { - BurnYM2612Write(0, 3, d); - return; - } - - case 0x7f11: - case 0x7f13: - case 0x7f15: - case 0x7f17: { - SN76496Write(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write %04x, %02x\n"), a, d); - } - } -} - -static INT32 MegadriveLoadRoms(bool bLoad) -{ - struct BurnRomInfo ri; - ri.nType = 0; - ri.nLen = 0; - INT32 nOffset = -1; - UINT32 i; - INT32 nRet = 0; - - if (!bLoad) { - do { - ri.nLen = 0; - ri.nType = 0; - BurnDrvGetRomInfo(&ri, ++nOffset); - if(ri.nLen) RomNum++; - RomSize += ri.nLen; - } while (ri.nLen); - - bprintf(PRINT_NORMAL, _T("68K Rom, Num %i, Size %x\n"), RomNum, RomSize); - } - - if (bLoad) { - INT32 Offset = 0; - - for (i = 0; i < RomNum; i++) { - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & SEGA_MD_ROM_OFFS_000000) == SEGA_MD_ROM_OFFS_000000) Offset = 0x000000; - if ((ri.nType & SEGA_MD_ROM_OFFS_000001) == SEGA_MD_ROM_OFFS_000001) Offset = 0x000001; - if ((ri.nType & SEGA_MD_ROM_OFFS_020000) == SEGA_MD_ROM_OFFS_020000) Offset = 0x020000; - if ((ri.nType & SEGA_MD_ROM_OFFS_080000) == SEGA_MD_ROM_OFFS_080000) Offset = 0x080000; - if ((ri.nType & SEGA_MD_ROM_OFFS_100000) == SEGA_MD_ROM_OFFS_100000) Offset = 0x100000; - if ((ri.nType & SEGA_MD_ROM_OFFS_100001) == SEGA_MD_ROM_OFFS_100001) Offset = 0x100001; - if ((ri.nType & SEGA_MD_ROM_OFFS_200000) == SEGA_MD_ROM_OFFS_200000) Offset = 0x200000; - if ((ri.nType & SEGA_MD_ROM_OFFS_300000) == SEGA_MD_ROM_OFFS_300000) Offset = 0x300000; - - switch (ri.nType & 0xf0) { - case SEGA_MD_ROM_LOAD_NORMAL: { - nRet = BurnLoadRom(RomMain + Offset, i, 1); if (nRet) return 1; - break; - } - - case SEGA_MD_ROM_LOAD16_WORD_SWAP: { - nRet = BurnLoadRom(RomMain + Offset, i, 1); if (nRet) return 1; - BurnByteswap(RomMain + Offset, ri.nLen); - break; - } - - case SEGA_MD_ROM_LOAD16_BYTE: { - nRet = BurnLoadRom(RomMain + Offset, i, 2); if (nRet) return 1; - break; - } - - case SEGA_MD_ROM_LOAD_NORMAL_CONTINUE_020000_080000: { // ghouls[1] (Ghouls 'n Ghosts) - nRet = BurnLoadRom(RomMain + Offset, i, 1); if (nRet) return 1; - memmove(RomMain + 0x020000, RomMain + 0xa0000, 0x60000); - break; - } - - case SEGA_MD_ROM_LOAD16_WORD_SWAP_CONTINUE_040000_100000: { - nRet = BurnLoadRom(RomMain + Offset, i, 1); if (nRet) return 1; - memcpy(RomMain + 0x100000, RomMain + 0x040000, 0x40000); - BurnByteswap(RomMain + Offset, 0x140000); - break; - } - } - - if ((ri.nType & SEGA_MD_ROM_RELOAD_200000_200000) == SEGA_MD_ROM_RELOAD_200000_200000) { - memcpy(RomMain + 0x200000, RomMain + 0x000000, 0x200000); - } - - if ((ri.nType & SEGA_MD_ROM_RELOAD_100000_300000) == SEGA_MD_ROM_RELOAD_100000_300000) { - memcpy(RomMain + 0x300000, RomMain + 0x000000, 0x100000); - } - } - } - - return 0; -} - -// Custom Cartridge Mapping - -UINT8 __fastcall JCartCtrlReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("JCartCtrlRead Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall JCartCtrlReadWord(UINT32 /*sekAddress*/) -{ - UINT16 retData = 0; - - UINT8 JPad3 = ~(JoyPad->pad[2] & 0xff); - UINT8 JPad4 = ~(JoyPad->pad[3] & 0xff); - - if (RamMisc->JCartIOData[0] & 0x40) { - retData = (RamMisc->JCartIOData[0] & 0x40) | JPad3 | (JPad4 << 8); - } else { - retData = ((JPad3 & 0xc0) >> 2) | (JPad3 & 0x03); - retData += (((JPad4 & 0xc0) >> 2) | (JPad4 & 0x03)) << 8; - } - - return retData; -} - -void __fastcall JCartCtrlWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - bprintf(PRINT_NORMAL, _T("JCartCtrlWrite byte %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall JCartCtrlWriteWord(UINT32 /*sekAddress*/, UINT16 wordValue) -{ - RamMisc->JCartIOData[0] = (wordValue & 1) << 6; - RamMisc->JCartIOData[1] = (wordValue & 1) << 6; -} - -void __fastcall Ssf2BankWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0xa130f1: { - if (byteValue == 2) memcpy(RomMain + 0x000000, RomMain + 0x400000 + (((byteValue & 0x0f) - 2) * 0x080000), 0x080000); - return; - } - - case 0xa130f3: { - memcpy(RomMain + 0x080000, RomMain + 0x400000 + ((byteValue & 0xf) * 0x080000), 0x080000); - return; - } - - case 0xa130f5: { - memcpy(RomMain + 0x100000, RomMain + 0x400000 + ((byteValue & 0xf) * 0x080000), 0x080000); - return; - } - - case 0xa130f7: { - memcpy(RomMain + 0x180000, RomMain + 0x400000 + ((byteValue & 0xf) * 0x080000), 0x080000); - return; - } - - case 0xa130f9: { - memcpy(RomMain + 0x200000, RomMain + 0x400000 + ((byteValue & 0xf) * 0x080000), 0x080000); - return; - } - - case 0xa130fb: { - memcpy(RomMain + 0x280000, RomMain + 0x400000 + ((byteValue & 0xf) * 0x080000), 0x080000); - return; - } - - case 0xa130fd: { - memcpy(RomMain + 0x300000, RomMain + 0x400000 + ((byteValue & 0xf) * 0x080000), 0x080000); - return; - } - - case 0xa130ff: { - memcpy(RomMain + 0x380000, RomMain + 0x400000 + ((byteValue & 0xf) * 0x080000), 0x080000); - return; - } - } -} - -UINT8 __fastcall LK3AltProtReadByte(UINT32 sekAddress) -{ - INT32 Offset = (sekAddress - 0x600000) >> 1; - Offset &= 0x07; - - UINT8 retData = 0; - - switch (Offset) { - case 0x02: { - switch (RamMisc->L3AltPCmd) { - case 1: - retData = RamMisc->L3AltPDat >> 1; - break; - - case 2: - retData = RamMisc->L3AltPDat >> 4; - retData |= (RamMisc->L3AltPDat & 0x0f) << 4; - break; - - default: - retData = (BIT(RamMisc->L3AltPDat, 7) << 0); - retData |= (BIT(RamMisc->L3AltPDat, 6) << 1); - retData |= (BIT(RamMisc->L3AltPDat, 5) << 2); - retData |= (BIT(RamMisc->L3AltPDat, 4) << 3); - retData |= (BIT(RamMisc->L3AltPDat, 3) << 4); - retData |= (BIT(RamMisc->L3AltPDat, 2) << 5); - retData |= (BIT(RamMisc->L3AltPDat, 1) << 6); - retData |= (BIT(RamMisc->L3AltPDat, 0) << 7); - break; - } - break; - } - } - -// bprintf(PRINT_NORMAL, _T("LK3AltProt Read Byte %x\n"), sekAddress); - - return retData; -} - -UINT16 __fastcall LK3AltProtReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("LK3AltProt Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall LK3AltProtWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - INT32 Offset = (sekAddress - 0x600000) >> 1; - Offset &= 0x07; - - switch (Offset) { - case 0x00: - RamMisc->L3AltPDat = byteValue; - return; - - case 0x01: - RamMisc->L3AltPCmd = byteValue; - return; - } - -// bprintf(PRINT_NORMAL, _T("LK3AltProt write byte %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall LK3AltProtWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("LK3AltProt write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -void __fastcall LK3AltBankWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - INT32 Offset = (sekAddress - 0x700000) >> 1; - Offset &= 0x07; - - if (Offset == 0) { - memcpy(RomMain, OriginalRom + ((byteValue & 0xff) * 0x8000), 0x8000); - return; - } - - bprintf(PRINT_NORMAL, _T("LK3AltBank write byte %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall LK3AltBankWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("LK3AltBank write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -UINT8 __fastcall RedclifProtReadByte(UINT32 /*sekAddress*/) -{ - return (UINT8)-0x56; -} - -UINT16 __fastcall RedclifProtReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("RedclifeProt Read Word %x\n"), sekAddress); - - return 0; -} - -UINT8 __fastcall RedclifProt2ReadByte(UINT32 /*sekAddress*/) -{ - return 0x55; -} - -UINT16 __fastcall RedclifProt2ReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("RedclifeProt2 Read Word %x\n"), sekAddress); - - return 0; -} - -UINT8 __fastcall RadicaBankSelectReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("RadicaBankSelect Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall RadicaBankSelectReadWord(UINT32 sekAddress) -{ - INT32 Bank = ((sekAddress - 0xa13000) >> 1) & 0x3f; - memcpy(RomMain, RomMain + 0x400000 + (Bank * 0x10000), 0x400000); - - return 0; -} - -UINT8 __fastcall Kof99A13000ReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Kof99A13000 Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall Kof99A13000ReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xa13000: return 0x00; - case 0xa13002: return 0x01; - case 0xa1303e: return 0x1f; - - } - - bprintf(PRINT_NORMAL, _T("Kof99A13000 Read Word %x\n"), sekAddress); - - return 0; -} - -UINT8 __fastcall SoulbladReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x400002: return 0x98; - case 0x400004: return 0xc0; - case 0x400006: return 0xf0; - - } - - bprintf(PRINT_NORMAL, _T("Soulblad Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall SoulbladReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Soulblad Read Word %x\n"), sekAddress); - - return 0; -} - -UINT8 __fastcall MjloverProt1ReadByte(UINT32 /*sekAddress*/) -{ - return 0x90; -} - -UINT16 __fastcall MjloverProt1ReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("MjloverProt1 Read Word %x\n"), sekAddress); - - return 0; -} - -UINT8 __fastcall MjloverProt2ReadByte(UINT32 /*sekAddress*/) -{ - return 0xd3; -} - -UINT16 __fastcall MjloverProt2ReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("MjloverProt2 Read Word %x\n"), sekAddress); - - return 0; -} - -UINT8 __fastcall SquirrelKingExtraReadByte(UINT32 /*sekAddress*/) -{ - return RamMisc->SquirrelkingExtra; -} - -UINT16 __fastcall SquirrelKingExtraReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("SquirrelKingExtra Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall SquirrelKingExtraWriteByte(UINT32 /*sekAddress*/, UINT8 byteValue) -{ - RamMisc->SquirrelkingExtra = byteValue; -} - -void __fastcall SquirrelKingExtraWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("SquirrelKingExtra write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -UINT8 __fastcall SmouseProtReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x400000: return 0x55; - case 0x400002: return 0x0f; - case 0x400004: return 0xaa; - case 0x400005: return 0xf0; - } - - return 0; -} - -UINT16 __fastcall SmouseProtReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("SmouseProt Read Word %x\n"), sekAddress); - - return 0; -} - -UINT8 __fastcall SmbProtReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Smbprot Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall SmbProtReadWord(UINT32 /*sekAddress*/) -{ - return 0x0c; -} - -UINT8 __fastcall Smb2ProtReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Smb2Prot Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall Smb2ProtReadWord(UINT32 /*sekAddress*/) -{ - return 0x0a; -} - -void __fastcall KaijuBankWriteByte(UINT32 /*sekAddress*/, UINT8 byteValue) -{ - memcpy(RomMain + 0x000000, RomMain + 0x400000 + (byteValue & 0x7f) * 0x8000, 0x8000); -} - -void __fastcall KaijuBankWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("KaijuBank write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -UINT8 __fastcall Chinfi3ProtReadByte(UINT32 /*sekAddress*/) -{ - UINT8 retDat = 0; - - if (SekGetPC(0) == 0x01782) // makes 'VS' screen appear - { - retDat = SekDbgGetRegister(SEK_REG_D3) & 0xff; -// retDat <<= 8; - return retDat; - } - else if (SekGetPC(0) == 0x1c24) // background gfx etc. - { - retDat = SekDbgGetRegister(SEK_REG_D3) & 0xff; -// retDat <<= 8; - return retDat; - } - else if (SekGetPC(0) == 0x10c4a) // unknown - { - return rand() & 0xff;//space->machine().rand(); - } - else if (SekGetPC(0) == 0x10c50) // unknown - { - return rand() & 0xff;//space->machine().rand(); - } - else if (SekGetPC(0) == 0x10c52) // relates to the game speed.. - { - retDat = SekDbgGetRegister(SEK_REG_D4) & 0xff; -// retDat <<= 8; - return retDat; - } - else if (SekGetPC(0) == 0x061ae) - { - retDat = SekDbgGetRegister(SEK_REG_D3) & 0xff; -// retDat <<= 8; - return retDat; - } - else if (SekGetPC(0) == 0x061b0) - { - retDat = SekDbgGetRegister(SEK_REG_D3) & 0xff; -// retDat <<= 8; - return retDat; - } - - return 0; -} - -UINT16 __fastcall Chinfi3ProtReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Chinfi3Prot Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall Chinfi3BankWriteByte(UINT32 /*sekAddress*/, UINT8 byteValue) -{ - if (byteValue == 0xf1) // *hit player - { - INT32 x; - for (x = 0; x < 0x100000; x += 0x10000) - { - memcpy(RomMain + x, RomMain + 0x410000, 0x10000); - } - } - else if (byteValue == 0xd7) // title screen.. - { - INT32 x; - for (x = 0; x < 0x100000; x += 0x10000) - { - memcpy(RomMain + x, RomMain + 0x470000, 0x10000); - } - } - else if (byteValue == 0xd3) // character hits floor - { - INT32 x; - for (x = 0; x < 0x100000; x += 0x10000) - { - memcpy(RomMain + x, RomMain + 0x430000, 0x10000); - } - } - else if (byteValue == 0x00) - { - INT32 x; - for (x = 0; x < 0x100000; x += 0x10000) - { - memcpy(RomMain + x, RomMain + 0x400000 + x, 0x10000); - } - } -} - -void __fastcall Chinfi3BankWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("Chinfi3Bank write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -UINT8 __fastcall Lionk2ProtReadByte(UINT32 sekAddress) -{ - switch(sekAddress) { - case 0x400002: { - return RamMisc->Lionk2ProtData; - } - - case 0x400006: { - return RamMisc->Lionk2ProtData2; - } - } - - bprintf(PRINT_NORMAL, _T("Lion2Prot Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall Lionk2ProtReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Lion2Prot Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall Lionk2ProtWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x400000: { - RamMisc->Lionk2ProtData = byteValue; - return; - } - - case 0x400004: { - RamMisc->Lionk2ProtData2 = byteValue; - return; - } - } - - bprintf(PRINT_NORMAL, _T("Lion2Prot write byte %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall Lionk2ProtWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("Lion2Prot write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -UINT8 __fastcall BuglExtraReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("BuglExtra Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall BuglExtraReadWord(UINT32 /*sekAddress*/) -{ - return 0x28; -} - -UINT8 __fastcall Elfwor400000ReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x400000: return 0x55; - case 0x400002: return 0x0f; - case 0x400004: return 0xc9; - case 0x400006: return 0x18; - } - - bprintf(PRINT_NORMAL, _T("Elfwor400000 Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall Elfwor400000ReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Elfwor400000 Read Word %x\n"), sekAddress); - - return 0; -} - -UINT8 __fastcall RockmanX3ExtraReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("RockmanX3Extra Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall RockmanX3ExtraReadWord(UINT32 /*sekAddress*/) -{ - return 0x0c; -} - -UINT8 __fastcall SbubExtraReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x400000: return 0x55; - case 0x400002: return 0x0f; - } - - bprintf(PRINT_NORMAL, _T("SbubExtra Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall SbubExtraReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("SbubExtra Read Word %x\n"), sekAddress); - - return 0; -} - -UINT8 __fastcall Kof98ReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Kof98 Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall Kof98ReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x480000: return 0xaa00; - case 0x4800e0: return 0xaa00; - case 0x4824a0: return 0xaa00; - case 0x488880: return 0xaa00; - case 0x4a8820: return 0x0a00; - case 0x4f8820: return 0x0000; - } - - bprintf(PRINT_NORMAL, _T("Kof98 Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall RealtecWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x400000: { - INT32 BankData = (byteValue >> 1) & 0x7; - - RamMisc->RealtecBankAddr = (RamMisc->RealtecBankAddr & 0x7) | BankData << 3; - - memcpy(RomMain, RomMain + (RamMisc->RealtecBankAddr * 0x20000) + 0x400000, RamMisc->RealtecBankSize * 0x20000); - memcpy(RomMain + RamMisc->RealtecBankSize * 0x20000, RomMain + (RamMisc->RealtecBankAddr * 0x20000) + 0x400000, RamMisc->RealtecBankSize * 0x20000); - return; - } - - case 0x402000:{ - RamMisc->RealtecBankAddr = 0; - RamMisc->RealtecBankSize = byteValue & 0x1f; - return; - } - - case 0x404000: { - INT32 BankData = byteValue & 0x3; - - RamMisc->RealtecBankAddr = (RamMisc->RealtecBankAddr & 0xf8) | BankData; - - memcpy(RomMain, RomMain + (RamMisc->RealtecBankAddr * 0x20000)+ 0x400000, RamMisc->RealtecBankSize * 0x20000); - memcpy(RomMain + RamMisc->RealtecBankSize * 0x20000, RomMain + (RamMisc->RealtecBankAddr * 0x20000) + 0x400000, RamMisc->RealtecBankSize * 0x20000); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Realtec write byte %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall RealtecWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("Realtec write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -void __fastcall Sup19in1BankWriteByte(UINT32 sekAddress, UINT8 /*byteValue*/) -{ - INT32 Offset = (sekAddress - 0xa13000) >> 1; - - memcpy(RomMain + 0x000000, RomMain + 0x400000 + ((Offset << 1) * 0x10000), 0x80000); -} - -void __fastcall Sup19in1BankWriteWord(UINT32 sekAddress, UINT16 /*wordValue*/) -{ - INT32 Offset = (sekAddress - 0xa13000) >> 1; - - memcpy(RomMain + 0x000000, RomMain + 0x400000 + ((Offset << 1) * 0x10000), 0x80000); -} - -void __fastcall Mc12in1BankWriteByte(UINT32 sekAddress, UINT8 /*byteValue*/) -{ - INT32 Offset = (sekAddress - 0xa13000) >> 1; - memcpy(RomMain + 0x000000, OriginalRom + ((Offset & 0x3f) << 17), 0x100000); -} - -void __fastcall Mc12in1BankWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("Mc12in1Bank write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -UINT8 __fastcall TopfigReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x645b45: return 0x9f; - - case 0x6bd295: { - static INT32 x = -1; - - if (SekGetPC(0) == 0x1771a2) { - return 0x50; - } else { - x++; - return (UINT8)x; - } - } - - case 0x6f5345: { - static INT32 x = -1; - - if (SekGetPC(0) == 0x4C94E) { - return SekDbgGetRegister(SEK_REG_D0) & 0xff; - } else { - x++; - return (UINT8)x; - } - } - } - - bprintf(PRINT_NORMAL, _T("Topfig Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall TopfigReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Topfig Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall TopfigWriteByte(UINT32 /*sekAddress*/, UINT8 byteValue) -{ - if (byteValue == 0x002a) - { - memcpy(RomMain + 0x060000, RomMain + 0x570000, 0x8000); // == 0x2e*0x8000?! - - } - else if (byteValue==0x0035) // characters ingame - { - memcpy(RomMain + 0x020000, RomMain + 0x5a8000, 0x8000); // == 0x35*0x8000 - } - else if (byteValue==0x000f) // special moves - { - memcpy(RomMain + 0x058000, RomMain + 0x478000, 0x8000); // == 0xf*0x8000 - } - else if (byteValue==0x0000) - { - memcpy(RomMain + 0x060000, RomMain + 0x460000, 0x8000); - memcpy(RomMain + 0x020000, RomMain + 0x420000, 0x8000); - memcpy(RomMain + 0x058000, RomMain + 0x458000, 0x8000); - } -} - -void __fastcall TopfigWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("Topfig write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -static void SetupCustomCartridgeMappers() -{ - if (((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART) || ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART_SEPROM)) { - SekOpen(0); - SekMapHandler(7, 0x38fffe, 0x38ffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(7, JCartCtrlReadByte); - SekSetReadWordHandler(7, JCartCtrlReadWord); - SekSetWriteByteHandler(7, JCartCtrlWriteByte); - SekSetWriteWordHandler(7, JCartCtrlWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SSF2) { - OriginalRom = (UINT8*)BurnMalloc(0x500000); - memcpy(OriginalRom, RomMain, 0x500000); - - memcpy(RomMain + 0x800000, OriginalRom + 0x400000, 0x100000); - memcpy(RomMain + 0x400000, OriginalRom + 0x000000, 0x400000); - memcpy(RomMain + 0x000000, OriginalRom + 0x000000, 0x400000); - - SekOpen(0); - SekMapHandler(7, 0xa130f0, 0xa130ff, MAP_WRITE); - SekSetWriteByteHandler(7, Ssf2BankWriteByte); - SekClose(); - } - - if (((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_LIONK3) || - ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SKINGKONG) || - ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_POKEMON2) || - ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_MULAN)) { - RamMisc->L3AltPDat = 0; - RamMisc->L3AltPCmd = 0; - - OriginalRom = (UINT8*)BurnMalloc(0x200000); - memcpy(OriginalRom, RomMain, 0x200000); - - memcpy(RomMain + 0x000000, OriginalRom + 0x000000, 0x200000); - memcpy(RomMain + 0x200000, OriginalRom + 0x000000, 0x200000); - - SekOpen(0); - SekMapHandler(7, 0x600000, 0x6fffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(7, LK3AltProtReadByte); - SekSetReadWordHandler(7, LK3AltProtReadWord); - SekSetWriteByteHandler(7, LK3AltProtWriteByte); - SekSetWriteWordHandler(7, LK3AltProtWriteWord); - SekMapHandler(8, 0x700000, 0x7fffff, MAP_WRITE); - SekSetWriteByteHandler(8, LK3AltBankWriteByte); - SekSetWriteWordHandler(8, LK3AltBankWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SDK99) { - RamMisc->L3AltPDat = 0; - RamMisc->L3AltPCmd = 0; - - OriginalRom = (UINT8*)BurnMalloc(0x300000); - memcpy(OriginalRom, RomMain, 0x300000); - - memcpy(RomMain + 0x000000, OriginalRom + 0x000000, 0x300000); - memcpy(RomMain + 0x300000, OriginalRom + 0x000000, 0x100000); - - SekOpen(0); - SekMapHandler(7, 0x600000, 0x6fffff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(7, LK3AltProtReadByte); - SekSetReadWordHandler(7, LK3AltProtReadWord); - SekSetWriteByteHandler(7, LK3AltProtWriteByte); - SekSetWriteWordHandler(7, LK3AltProtWriteWord); - SekMapHandler(8, 0x700000, 0x7fffff, MAP_WRITE); - SekSetWriteByteHandler(8, LK3AltBankWriteByte); - SekSetWriteWordHandler(8, LK3AltBankWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_REDCL_EN) { - OriginalRom = (UINT8*)BurnMalloc(0x200005); - memcpy(OriginalRom, RomMain, 0x200005); - for (UINT32 i = 0; i < RomSize; i++) { - OriginalRom[i] ^= 0x40; - } - - memcpy(RomMain + 0x000000, OriginalRom + 0x000004, 0x200000); - - SekOpen(0); - SekMapHandler(7, 0x400000, 0x400001, MAP_READ); - SekSetReadByteHandler(7, RedclifProt2ReadByte); - SekSetReadWordHandler(7, RedclifProt2ReadWord); - SekMapHandler(8, 0x400004, 0x400005, MAP_READ); - SekSetReadByteHandler(8, RedclifProtReadByte); - SekSetReadWordHandler(8, RedclifProtReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_RADICA) { - OriginalRom = (UINT8*)BurnMalloc(RomSize); - memcpy(OriginalRom, RomMain, RomSize); - - memcpy(RomMain + 0x000000, OriginalRom + 0x000000, 0x400000); - memcpy(RomMain + 0x400000, OriginalRom + 0x000000, 0x400000); - memcpy(RomMain + 0x800000, OriginalRom + 0x000000, 0x400000); - - SekOpen(0); - SekMapHandler(7, 0xa13000, 0xa1307f, MAP_READ); - SekSetReadByteHandler(7, RadicaBankSelectReadByte); - SekSetReadWordHandler(7, RadicaBankSelectReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_KOF99 || - (BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_POKEMON) { - SekOpen(0); - SekMapHandler(7, 0xa13000, 0xa1303f, MAP_READ); - SekSetReadByteHandler(7, Kof99A13000ReadByte); - SekSetReadWordHandler(7, Kof99A13000ReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SOULBLAD) { - SekOpen(0); - SekMapHandler(7, 0x400002, 0x400007, MAP_READ); - SekSetReadByteHandler(7, SoulbladReadByte); - SekSetReadWordHandler(7, SoulbladReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_MJLOVER) { - SekOpen(0); - SekMapHandler(7, 0x400000, 0x400001, MAP_READ); - SekSetReadByteHandler(7, MjloverProt1ReadByte); - SekSetReadWordHandler(7, MjloverProt1ReadWord); - SekMapHandler(8, 0x401000, 0x401001, MAP_READ); - SekSetReadByteHandler(8, MjloverProt2ReadByte); - SekSetReadWordHandler(8, MjloverProt2ReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SQUIRRELK) { - SekOpen(0); - SekMapHandler(7, 0x400000, 0x400007, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(7, SquirrelKingExtraReadByte); - SekSetReadWordHandler(7, SquirrelKingExtraReadWord); - SekSetWriteByteHandler(7, SquirrelKingExtraWriteByte); - SekSetWriteWordHandler(7, SquirrelKingExtraWriteWord); - SekClose(); - bNoDebug = 1; // Games make a lot of unmapped word-writes - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SMOUSE) { - SekOpen(0); - SekMapHandler(7, 0x400000, 0x400007, MAP_READ); - SekSetReadByteHandler(7, SmouseProtReadByte); - SekSetReadWordHandler(7, SmouseProtReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SMB) { - SekOpen(0); - SekMapHandler(7, 0xa13000, 0xa13001, MAP_READ); - SekSetReadByteHandler(7, SmbProtReadByte); - SekSetReadWordHandler(7, SmbProtReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SMB2) { - SekOpen(0); - SekMapHandler(7, 0xa13000, 0xa13001, MAP_READ); - SekSetReadByteHandler(7, Smb2ProtReadByte); - SekSetReadWordHandler(7, Smb2ProtReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_KAIJU) { - OriginalRom = (UINT8*)BurnMalloc(RomSize); - memcpy(OriginalRom, RomMain, RomSize); - - memcpy(RomMain + 0x400000, OriginalRom, 0x200000); - memcpy(RomMain + 0x600000, OriginalRom, 0x200000); - memcpy(RomMain + 0x000000, OriginalRom, 0x200000); - - SekOpen(0); - SekMapHandler(7, 0x700000, 0x7fffff, MAP_WRITE); - SekSetWriteByteHandler(7, KaijuBankWriteByte); - SekSetWriteWordHandler(7, KaijuBankWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_CHINFIGHT3) { - OriginalRom = (UINT8*)BurnMalloc(RomSize); - memcpy(OriginalRom, RomMain, RomSize); - - memcpy(RomMain + 0x400000, OriginalRom + 0x000000, 0x200000); - memcpy(RomMain + 0x600000, OriginalRom + 0x000000, 0x200000); - memcpy(RomMain + 0x000000, OriginalRom + 0x000000, 0x200000); - - SekOpen(0); - SekMapHandler(7, 0x400000, 0x4fffff, MAP_READ); - SekSetReadByteHandler(7, Chinfi3ProtReadByte); - SekSetReadWordHandler(7, Chinfi3ProtReadWord); - SekMapHandler(8, 0x600000, 0x6fffff, MAP_WRITE); - SekSetWriteByteHandler(8, Chinfi3BankWriteByte); - SekSetWriteWordHandler(8, Chinfi3BankWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_LIONK2) { - RamMisc->Lionk2ProtData = 0; - RamMisc->Lionk2ProtData2 = 0; - - SekOpen(0); - SekMapHandler(7, 0x400000, 0x400007, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(7, Lionk2ProtReadByte); - SekSetReadWordHandler(7, Lionk2ProtReadWord); - SekSetWriteByteHandler(7, Lionk2ProtWriteByte); - SekSetWriteWordHandler(7, Lionk2ProtWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_BUGSLIFE) { - SekOpen(0); - SekMapHandler(7, 0xa13000, 0xa13001, MAP_READ); - SekSetReadByteHandler(7, BuglExtraReadByte); - SekSetReadWordHandler(7, BuglExtraReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_ELFWOR) { - SekOpen(0); - SekMapHandler(7, 0x400000, 0x400007, MAP_READ); - SekSetReadByteHandler(7, Elfwor400000ReadByte); - SekSetReadWordHandler(7, Elfwor400000ReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_ROCKMANX3) { - SekOpen(0); - SekMapHandler(7, 0xa13000, 0xa13001, MAP_READ); - SekSetReadByteHandler(7, RockmanX3ExtraReadByte); - SekSetReadWordHandler(7, RockmanX3ExtraReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SBUBBOB) { - SekOpen(0); - SekMapHandler(7, 0x400000, 0x400003, MAP_READ); - SekSetReadByteHandler(7, SbubExtraReadByte); - SekSetReadWordHandler(7, SbubExtraReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_KOF98) { - SekOpen(0); - SekMapHandler(7, 0x480000, 0x4fffff, MAP_READ); - SekSetReadByteHandler(7, Kof98ReadByte); - SekSetReadWordHandler(7, Kof98ReadWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_REALTEC) { - RamMisc->RealtecBankAddr = 0; - RamMisc->RealtecBankSize = 0; - - OriginalRom = (UINT8*)BurnMalloc(RomSize); - memcpy(OriginalRom, RomMain, RomSize); - - memcpy(RomMain + 0x400000, OriginalRom + 0x000000, 0x080000); - - for (INT32 i = 0; i < 0x400000; i += 0x2000) { - memcpy(RomMain + i, OriginalRom + 0x7e000, 0x2000); - } - - SekOpen(0); - SekMapHandler(7, 0x400000, 0x40400f, MAP_WRITE); - SekSetWriteByteHandler(7, RealtecWriteByte); - SekSetWriteWordHandler(7, RealtecWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_MC_SUP19IN1) { - OriginalRom = (UINT8*)BurnMalloc(RomSize); - memcpy(OriginalRom, RomMain, RomSize); - - memcpy(RomMain + 0x400000, OriginalRom + 0x000000, 0x400000); - - SekOpen(0); - SekMapHandler(7, 0xa13000, 0xa13039, MAP_WRITE); - SekSetWriteByteHandler(7, Sup19in1BankWriteByte); - SekSetWriteWordHandler(7, Sup19in1BankWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_MC_SUP15IN1) { - OriginalRom = (UINT8*)BurnMalloc(RomSize); - memcpy(OriginalRom, RomMain, RomSize); - - memcpy(RomMain + 0x400000, OriginalRom + 0x000000, 0x200000); - - SekOpen(0); - SekMapHandler(7, 0xa13000, 0xa13039, MAP_WRITE); - SekSetWriteByteHandler(7, Sup19in1BankWriteByte); - SekSetWriteWordHandler(7, Sup19in1BankWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_MC_12IN1) { - OriginalRom = (UINT8*)BurnMalloc(RomSize * 2); // add a little buffer on the end so memcpy @ the last bank doesn't crash - memcpy(OriginalRom, RomMain, RomSize); - - memcpy(RomMain + 0x000000, OriginalRom + 0x000000, 0x200000); - - SekOpen(0); - SekMapHandler(7, 0xa13000, 0xa1303f, MAP_WRITE); - SekSetWriteByteHandler(7, Mc12in1BankWriteByte); - SekSetWriteWordHandler(7, Mc12in1BankWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_TOPFIGHTER) { - OriginalRom = (UINT8*)BurnMalloc(RomSize); - memcpy(OriginalRom, RomMain, RomSize); - - memcpy(RomMain + 0x000000, OriginalRom + 0x000000, 0x200000); - memcpy(RomMain + 0x200000, OriginalRom + 0x000000, 0x200000); - memcpy(RomMain + 0x400000, OriginalRom + 0x000000, 0x200000); - memcpy(RomMain + 0x600000, OriginalRom + 0x000000, 0x200000); - - SekOpen(0); - SekMapHandler(7, 0x600000, 0x6fffff, MAP_READ); - SekSetReadByteHandler(7, TopfigReadByte); - SekSetReadWordHandler(7, TopfigReadWord); - SekMapHandler(8, 0x700000, 0x7fffff, MAP_WRITE); - SekSetWriteByteHandler(8, TopfigWriteByte); - SekSetWriteWordHandler(8, TopfigWriteWord); - SekClose(); - } -} - -// SRAM and EEPROM Handling - -UINT8 __fastcall MegadriveSRAMReadByte(UINT32 sekAddress) -{ - if (RamMisc->SRamActive) { - return SRam[(sekAddress - RamMisc->SRamStart) ^ 1]; - } else { - return RomMain[sekAddress ^ 1]; - } -} - -UINT16 __fastcall MegadriveSRAMReadWord(UINT32 sekAddress) -{ - if (RamMisc->SRamActive) { - UINT16 *Ram = (UINT16*)SRam; - return Ram[(sekAddress - RamMisc->SRamStart) >> 1]; - } else { - UINT16 *Rom = (UINT16*)RomMain; - return Rom[sekAddress >> 1]; - } -} - -void __fastcall MegadriveSRAMWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (RamMisc->SRamActive) { - if (!RamMisc->SRamReadOnly) { - SRam[(sekAddress - RamMisc->SRamStart) ^ 1] = byteValue; - return; - } - } -} - -void __fastcall MegadriveSRAMWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (RamMisc->SRamActive) { - if (!RamMisc->SRamReadOnly) { - UINT16 *Ram = (UINT16*)SRam; - Ram[(sekAddress - RamMisc->SRamStart) >> 1] = wordValue; - return; - } - } -} - -static void InstallSRAMHandlers(bool MaskAddr) -{ - UINT32 Mask = MaskAddr ? 0x3fffff : 0xffffff; - - memset(SRam, 0xff, MAX_SRAM_SIZE); - memcpy((UINT8*)MegadriveBackupRam, SRam, RamMisc->SRamEnd - RamMisc->SRamStart + 1); - - SekOpen(0); - SekMapHandler(6, RamMisc->SRamStart & Mask, RamMisc->SRamEnd & Mask, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(6, MegadriveSRAMReadByte); - SekSetReadWordHandler(6, MegadriveSRAMReadWord); - SekSetWriteByteHandler(6, MegadriveSRAMWriteByte); - SekSetWriteWordHandler(6, MegadriveSRAMWriteWord); - SekClose(); - - RamMisc->SRamHandlersInstalled = 1; -} - -UINT8 __fastcall Megadrive6658ARegReadByte(UINT32 sekAddress) -{ - if (sekAddress & 1) return RamMisc->SRamActive; - - bprintf(PRINT_NORMAL, _T("Megadrive6658AReg Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall Megadrive6658ARegReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Megadrive6658AReg Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall Megadrive6658ARegWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (sekAddress & 1) { - if (byteValue == 1) { - RamMisc->SRamActive = 1; - return; - } - - if (byteValue == 0) { - RamMisc->SRamActive = 0; - return; - } - } - - bprintf(PRINT_NORMAL, _T("6658A Reg write byte %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall Megadrive6658ARegWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("6658A Reg write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -UINT8 __fastcall WboyVEEPROMReadByte(UINT32 sekAddress) -{ - if (sekAddress & 1) return ~RamMisc->I2CMem & 1; - - bprintf(PRINT_NORMAL, _T("WboyVEEPROM Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall WboyVEEPROMReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("WboyVEEPROM Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall WboyVEEPROMWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (sekAddress & 1) { - RamMisc->I2CClk = (byteValue & 0x0002) >> 1; - RamMisc->I2CMem = (byteValue & 0x0001); - return; - } - - bprintf(PRINT_NORMAL, _T("WboyVEEPROM write byte value %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall WboyVEEPROMWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("WboyVEEPROM write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -UINT8 __fastcall NbajamEEPROMReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Nbajam Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall NbajamEEPROMReadWord(UINT32 /*sekAddress*/) -{ - return RamMisc->I2CMem & 1; -} - -void __fastcall NbajamEEPROMWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - bprintf(PRINT_NORMAL, _T("Nbajam write byte value %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall NbajamEEPROMWriteWord(UINT32 /*sekAddress*/, UINT16 wordValue) -{ - RamMisc->I2CClk = (wordValue & 0x0002) >> 1; - RamMisc->I2CMem = (wordValue & 0x0001); -} - -UINT8 __fastcall NbajamteEEPROMReadByte(UINT32 sekAddress) -{ - if (sekAddress & 1) return RamMisc->I2CMem & 1; - - bprintf(PRINT_NORMAL, _T("Nbajamte Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall NbajamteEEPROMReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Nbajamte Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall NbajamteEEPROMWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (sekAddress & 1) { -// RamMisc->I2CClk = (wordValue & 0x0002) >> 1; - RamMisc->I2CMem = (byteValue & 0x0001); - return; - } - - bprintf(PRINT_NORMAL, _T("Nbajamte write byte value %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall NbajamteEEPROMWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("Nbajamte write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -UINT8 __fastcall EANhlpaEEPROMReadByte(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("EANhlpa Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall EANhlpaEEPROMReadWord(UINT32 /*sekAddress*/) -{ - return (RamMisc->I2CMem & 1) << 7; -} - -void __fastcall EANhlpaEEPROMWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - bprintf(PRINT_NORMAL, _T("EANhlpa write byte value %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall EANhlpaEEPROMWriteWord(UINT32 /*sekAddress*/, UINT16 wordValue) -{ - RamMisc->I2CClk = ((wordValue & 0x0040) >> 6); - RamMisc->I2CMem = ((wordValue & 0x0080) >> 7); -} - -UINT8 __fastcall CodemastersEEPROMReadByte(UINT32 sekAddress) -{ - if (sekAddress & 1) return RamMisc->I2CMem & 1; - - bprintf(PRINT_NORMAL, _T("Codemasters Read Byte %x\n"), sekAddress); - - return 0; -} - -UINT16 __fastcall CodemastersEEPROMReadWord(UINT32 sekAddress) -{ - bprintf(PRINT_NORMAL, _T("Codemasters Read Word %x\n"), sekAddress); - - return 0; -} - -void __fastcall CodemastersEEPROMWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (sekAddress & 1) { - RamMisc->I2CClk = (byteValue & 0x0002) >> 1; - RamMisc->I2CMem = (byteValue & 0x0001); - return; - } else { - RamMisc->I2CClk = (byteValue & 0x0002) >> 1; - RamMisc->I2CMem = (byteValue & 0x0001); - return; - } - - bprintf(PRINT_NORMAL, _T("Codemasters write byte value %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall CodemastersEEPROMWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("Codemasters write word value %04x to location %08x\n"), wordValue, sekAddress); -} - -void __fastcall MegadriveSRAMToggleWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - bprintf(PRINT_NORMAL, _T("SRam Toggle byte %02x to location %08x\n"), byteValue, sekAddress); -} - -void __fastcall MegadriveSRAMToggleWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - bprintf(PRINT_NORMAL, _T("SRam Toggle word value %04x to location %08x\n"), wordValue, sekAddress); -} - -static void MegadriveSetupSRAM() -{ - SRamSize = 0; - RamMisc->SRamStart = 0; - RamMisc->SRamEnd = 0; - RamMisc->SRamDetected = 0; - RamMisc->SRamHandlersInstalled = 0; - RamMisc->SRamActive = 0; - RamMisc->SRamReadOnly = 0; - RamMisc->SRamHasSerialEEPROM = 0; - MegadriveBackupRam = NULL; - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_00400) || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_00800) || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_01000) || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_04000) || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_10000)) { - RamMisc->SRamStart = 0x200000; - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_00400) RamMisc->SRamEnd = 0x2003ff; - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_00800) RamMisc->SRamEnd = 0x2007ff; - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_01000) RamMisc->SRamEnd = 0x200fff; - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_04000) RamMisc->SRamEnd = 0x203fff; - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_SRAM_10000) RamMisc->SRamEnd = 0x20ffff; - - bprintf(PRINT_IMPORTANT, _T("SRAM Settings: start %06x - end %06x\n"), RamMisc->SRamStart, RamMisc->SRamEnd); - RamMisc->SRamDetected = 1; - MegadriveBackupRam = (UINT16*)RomMain + RamMisc->SRamStart; - - SekOpen(0); - SekMapHandler(5, 0xa130f0, 0xa130f1, MAP_WRITE); - SekSetWriteByteHandler(5, MegadriveSRAMToggleWriteByte); - SekSetWriteWordHandler(5, MegadriveSRAMToggleWriteWord); - SekClose(); - - if (RomSize <= RamMisc->SRamStart) { - RamMisc->SRamActive = 1; - InstallSRAMHandlers(false); - } - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_BEGGAR) { - RamMisc->SRamStart = 0x400000; - RamMisc->SRamEnd = 0x40ffff; - - RamMisc->SRamDetected = 1; - MegadriveBackupRam = (UINT16*)RomMain + RamMisc->SRamStart; - - RamMisc->SRamActive = 1; - InstallSRAMHandlers(false); - } - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MEGADRIVE_FRAM_00400) { - RamMisc->SRamStart = 0x200000; - RamMisc->SRamEnd = 0x2003ff; - - RamMisc->SRamDetected = 1; - MegadriveBackupRam = (UINT16*)RomMain + RamMisc->SRamStart; - - SekOpen(0); - SekMapHandler(5, 0xa130f0, 0xa130f1, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(5, Megadrive6658ARegReadByte); - SekSetReadWordHandler(5, Megadrive6658ARegReadWord); - SekSetWriteByteHandler(5, Megadrive6658ARegWriteByte); - SekSetWriteWordHandler(5, Megadrive6658ARegWriteWord); - SekClose(); - - InstallSRAMHandlers(false); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_SEGA_EEPROM) { - RamMisc->SRamHasSerialEEPROM = 1; - SekOpen(0); - SekMapHandler(5, 0x200000, 0x200001, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(5, WboyVEEPROMReadByte); - SekSetReadWordHandler(5, WboyVEEPROMReadWord); - SekSetWriteByteHandler(5, WboyVEEPROMWriteByte); - SekSetWriteWordHandler(5, WboyVEEPROMWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM) { - RamMisc->SRamHasSerialEEPROM = 1; - SekOpen(0); - SekMapHandler(5, 0x200000, 0x200001, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(5, NbajamEEPROMReadByte); - SekSetReadWordHandler(5, NbajamEEPROMReadWord); - SekSetWriteByteHandler(5, NbajamEEPROMWriteByte); - SekSetWriteWordHandler(5, NbajamEEPROMWriteWord); - SekClose(); - } - - if (((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_NBA_JAM_TE) || ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_NFL_QB_96) || ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_C_SLAM)) { - RamMisc->SRamHasSerialEEPROM = 1; - SekOpen(0); - SekMapHandler(5, 0x200000, 0x200001, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(5, NbajamteEEPROMReadByte); - SekSetReadWordHandler(5, NbajamteEEPROMReadWord); - SekSetWriteByteHandler(5, NbajamteEEPROMWriteByte); - SekSetWriteWordHandler(5, NbajamteEEPROMWriteWord); - SekClose(); - } - - if ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_EA_NHLPA) { - RamMisc->SRamHasSerialEEPROM = 1; - SekOpen(0); - SekMapHandler(5, 0x200000, 0x200001, MAP_READ | MAP_WRITE); - SekSetReadByteHandler(5, EANhlpaEEPROMReadByte); - SekSetReadWordHandler(5, EANhlpaEEPROMReadWord); - SekSetWriteByteHandler(5, EANhlpaEEPROMWriteByte); - SekSetWriteWordHandler(5, EANhlpaEEPROMWriteWord); - SekClose(); - } - - if (((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_CODE_MASTERS) || ((BurnDrvGetHardwareCode() & 0xff) == HARDWARE_SEGA_MEGADRIVE_PCB_CM_JCART_SEPROM)) { - RamMisc->SRamHasSerialEEPROM = 1; - SekOpen(0); - SekMapHandler(5, 0x300000, 0x300001, MAP_WRITE); - SekSetWriteByteHandler(5, CodemastersEEPROMWriteByte); - SekSetWriteWordHandler(5, CodemastersEEPROMWriteWord); - SekMapHandler(6, 0x380000, 0x380001, MAP_READ); - SekSetReadByteHandler(6, CodemastersEEPROMReadByte); - SekSetReadWordHandler(6, CodemastersEEPROMReadWord); - SekClose(); - } - - if (!RamMisc->SRamDetected && !RamMisc->SRamHasSerialEEPROM) { - // check if cart has battery save - if (RomMain[0x1b1] == 'R' && RomMain[0x1b0] == 'A') { - // SRAM info found in header - RamMisc->SRamStart = (RomMain[0x1b5] << 24 | RomMain[0x1b4] << 16 | RomMain[0x1b7] << 8 | RomMain[0x1b6]); - RamMisc->SRamEnd = (RomMain[0x1b9] << 24 | RomMain[0x1b8] << 16 | RomMain[0x1bb] << 8 | RomMain[0x1ba]); - - // The 68k only has 24 address bits. - RamMisc->SRamStart &= 0xffffff; - RamMisc->SRamEnd &= 0xffffff; - - if ((RamMisc->SRamStart > RamMisc->SRamEnd) || ((RamMisc->SRamEnd - RamMisc->SRamStart) >= 0x10000)) { - RamMisc->SRamEnd = RamMisc->SRamStart + 0x0FFFF; - } - - // for some games using serial EEPROM, difference between SRAM end to start is 0 or 1. Currently EEPROM is not emulated. - if ((RamMisc->SRamEnd - RamMisc->SRamStart) < 2) { - RamMisc->SRamHasSerialEEPROM = 1; - } else { - RamMisc->SRamDetected = 1; - } - } else { - // set default SRAM positions, with size = 64k - RamMisc->SRamStart = 0x200000; - RamMisc->SRamEnd = RamMisc->SRamStart + 0xffff; - } - - if (RamMisc->SRamStart & 1) RamMisc->SRamStart -= 1; - - if (!(RamMisc->SRamEnd & 1)) RamMisc->SRamEnd += 1; - - // calculate backup RAM location - MegadriveBackupRam = (UINT16*) (RomMain + (RamMisc->SRamStart & 0x3fffff)); - - if (RamMisc->SRamDetected) { - bprintf(PRINT_IMPORTANT, _T("SRAM detected in header: start %06x - end %06x\n"), RamMisc->SRamStart, RamMisc->SRamEnd); - } - - // Enable SRAM handlers only if the game does not use EEPROM. - if (!RamMisc->SRamHasSerialEEPROM) { - // Info from DGen: If SRAM does not overlap main ROM, set it active by default since a few games can't manage to properly switch it on/off. - if (RomSize <= RamMisc->SRamStart) { - RamMisc->SRamActive = 1; - } - - SekOpen(0); - SekMapHandler(5, 0xa130f0, 0xa130f1, MAP_WRITE); - SekSetWriteByteHandler(5, MegadriveSRAMToggleWriteByte); - SekSetWriteWordHandler(5, MegadriveSRAMToggleWriteWord); - SekClose(); - - // Sonic 1 included in Sonic Classics doesn't have SRAM and does lots of ROM access at this range, then only install read write handlers if SRAM is active to not slow down emulation. - if (RamMisc->SRamActive) InstallSRAMHandlers(true); - } - } -} - -static INT32 __fastcall MegadriveTAScallback(void) -{ - return 0; // disable -} - -INT32 MegadriveInit() -{ - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - MegadriveLoadRoms(0); - if (MegadriveLoadRoms(1)) return 1; - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(RomMain, 0x000000, 0x9FFFFF, MAP_ROM); // 68000 ROM - - // RAM and it's mirrors (Fix Xaio Monv: Magic Girl) - for (INT32 a = 0xe00000; a < 0x1000000; a += 0x010000) { - SekMapMemory(Ram68K, a, a + 0xFFFF, MAP_RAM); // 68000 RAM - } - - SekMapHandler(1, 0xC00000, 0xC0001F, MAP_RAM); // Video Port - SekMapHandler(2, 0xA00000, 0xA01FFF, MAP_RAM); // Z80 Ram - SekMapHandler(3, 0xA02000, 0xA03FFF, MAP_RAM); // Z80 Ram - SekMapHandler(4, 0xA10000, 0xA1001F, MAP_RAM); // I/O - - SekSetReadByteHandler (0, MegadriveReadByte); - SekSetReadWordHandler (0, MegadriveReadWord); - SekSetWriteByteHandler(0, MegadriveWriteByte); - SekSetWriteWordHandler(0, MegadriveWriteWord); - - SekSetReadByteHandler (1, MegadriveVideoReadByte); - SekSetReadWordHandler (1, MegadriveVideoReadWord); - SekSetWriteByteHandler(1, MegadriveVideoWriteByte); - SekSetWriteWordHandler(1, MegadriveVideoWriteWord); - - SekSetReadByteHandler (2, MegadriveZ80RamReadByte); - SekSetReadWordHandler (2, MegadriveZ80RamReadWord); - SekSetWriteByteHandler(2, MegadriveZ80RamWriteByte); - SekSetWriteWordHandler(2, MegadriveZ80RamWriteWord); - - SekSetReadByteHandler (3, MegadriveZ80RamReadByte); - SekSetReadWordHandler (3, MegadriveZ80RamReadWord); - SekSetWriteByteHandler(3, MegadriveZ80RamWriteByte); - SekSetWriteWordHandler(3, MegadriveZ80RamWriteWord); - - SekSetReadByteHandler (4, MegadriveIOReadByte); - SekSetReadWordHandler (4, MegadriveIOReadWord); - SekSetWriteByteHandler(4, MegadriveIOWriteByte); - SekSetWriteWordHandler(4, MegadriveIOWriteWord); - - SekSetIrqCallback( MegadriveIrqCallback ); - SekSetTASCallback(MegadriveTAScallback); - SekClose(); - } - - { - ZetInit(0); - ZetOpen(0); - - ZetMapArea(0x0000, 0x1FFF, 0, RamZ80); - ZetMapArea(0x0000, 0x1FFF, 1, RamZ80); - ZetMapArea(0x0000, 0x1FFF, 2, RamZ80); - - ZetMapArea(0x2000, 0x3FFF, 0, RamZ80); - ZetMapArea(0x2000, 0x3FFF, 1, RamZ80); - ZetMapArea(0x2000, 0x3FFF, 2, RamZ80); - - - ZetSetReadHandler(MegadriveZ80ProgRead); - ZetSetWriteHandler(MegadriveZ80ProgWrite); - ZetSetInHandler(MegadriveZ80PortRead); - ZetSetOutHandler(MegadriveZ80PortWrite); - ZetClose(); - } - - // OSC_NTSC / 7 - BurnSetRefreshRate(60.0); - - bNoDebug = 0; - DrvSECAM = 0; - BurnYM2612Init(1, OSC_NTSC / 7, NULL, MegadriveSynchroniseStream, MegadriveGetTime, 0); - BurnTimerAttachSek(OSC_NTSC / 7); - BurnYM2612SetRoute(0, BURN_SND_YM2612_YM2612_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - BurnYM2612SetRoute(0, BURN_SND_YM2612_YM2612_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - SN76496Init(0, OSC_NTSC / 15, 1); - SN76496SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - MegadriveSetupSRAM(); - SetupCustomCartridgeMappers(); - - if (MegadriveCallback) MegadriveCallback(); - - pBurnDrvPalette = (UINT32*)MegadriveCurPal; - - MegadriveResetDo(); - - if (strstr(BurnDrvGetTextA(DRV_NAME), "puggsy")) { - bprintf(0, _T("Puggsy protection fix activated!\n")); - RamMisc->SRamActive = 0; - } - - if (strstr(BurnDrvGetTextA(DRV_NAME), "forgottn")) { - bprintf(0, _T("Forced 3-button mode for Forgotten Worlds!\n")); - bForce3Button = 1; - } - - return 0; -} - -INT32 MegadriveExit() -{ - SekExit(); - ZetExit(); - - BurnYM2612Exit(); - SN76496Exit(); - - if (Mem) { - BurnFree(Mem); - Mem = NULL; - } - - if (OriginalRom) { - BurnFree(OriginalRom); - OriginalRom = NULL; - } - - MegadriveCallback = NULL; - RomNoByteswap = 0; - MegadriveReset = 0; - RomSize = 0; - RomNum = 0; - SRamSize = 0; - Scanline = 0; - Z80HasBus = 0; - MegadriveZ80Reset = 0; - Hardware = 0; - DrvSECAM = 0; - HighCol = NULL; - bNoDebug = 0; - bForce3Button = 0; - - return 0; -} - -//--------------------------------------------------------------- -// Megadrive Draw -//--------------------------------------------------------------- - -static INT32 TileNorm(INT32 sx,INT32 addr,INT32 pal) -{ - UINT8 *pd = HighCol+sx; - UINT32 pack=0; - UINT32 t=0; - - pack = BURN_ENDIAN_SWAP_INT32(*(UINT32 *)(RamVid + addr)); // Get 8 pixels - if (pack) { - t=pack&0x0000f000; if (t) pd[0]=(UINT8)(pal|(t>>12)); - t=pack&0x00000f00; if (t) pd[1]=(UINT8)(pal|(t>> 8)); - t=pack&0x000000f0; if (t) pd[2]=(UINT8)(pal|(t>> 4)); - t=pack&0x0000000f; if (t) pd[3]=(UINT8)(pal|(t )); - t=pack&0xf0000000; if (t) pd[4]=(UINT8)(pal|(t>>28)); - t=pack&0x0f000000; if (t) pd[5]=(UINT8)(pal|(t>>24)); - t=pack&0x00f00000; if (t) pd[6]=(UINT8)(pal|(t>>20)); - t=pack&0x000f0000; if (t) pd[7]=(UINT8)(pal|(t>>16)); - return 0; - } - return 1; // Tile blank -} - -static INT32 TileFlip(INT32 sx,INT32 addr,INT32 pal) -{ - UINT8 *pd = HighCol+sx; - UINT32 pack=0; - UINT32 t=0; - - pack = BURN_ENDIAN_SWAP_INT32(*(UINT32 *)(RamVid + addr)); // Get 8 pixels - if (pack) { - t=pack&0x000f0000; if (t) pd[0]=(UINT8)(pal|(t>>16)); - t=pack&0x00f00000; if (t) pd[1]=(UINT8)(pal|(t>>20)); - t=pack&0x0f000000; if (t) pd[2]=(UINT8)(pal|(t>>24)); - t=pack&0xf0000000; if (t) pd[3]=(UINT8)(pal|(t>>28)); - t=pack&0x0000000f; if (t) pd[4]=(UINT8)(pal|(t )); - t=pack&0x000000f0; if (t) pd[5]=(UINT8)(pal|(t>> 4)); - t=pack&0x00000f00; if (t) pd[6]=(UINT8)(pal|(t>> 8)); - t=pack&0x0000f000; if (t) pd[7]=(UINT8)(pal|(t>>12)); - return 0; - } - return 1; // Tile blank -} - -// tile renderers for hacky operator sprite support -#define sh_pix(x) \ - if(!t); \ - else if(t==0xe) pd[x]=(UINT8)((pd[x]&0x3f)|0x80); /* hilight */ \ - else if(t==0xf) pd[x]=(UINT8)((pd[x]&0x3f)|0xc0); /* shadow */ \ - else pd[x]=(UINT8)(pal|t); - -static INT32 TileNormSH(INT32 sx,INT32 addr,INT32 pal) -{ - UINT32 pack=0; UINT32 t=0; - UINT8 *pd = HighCol+sx; - - pack=BURN_ENDIAN_SWAP_INT32(*(UINT32 *)(RamVid+addr)); // Get 8 pixels - if (pack) { - t=(pack&0x0000f000)>>12; sh_pix(0); - t=(pack&0x00000f00)>> 8; sh_pix(1); - t=(pack&0x000000f0)>> 4; sh_pix(2); - t=(pack&0x0000000f) ; sh_pix(3); - t=(pack&0xf0000000)>>28; sh_pix(4); - t=(pack&0x0f000000)>>24; sh_pix(5); - t=(pack&0x00f00000)>>20; sh_pix(6); - t=(pack&0x000f0000)>>16; sh_pix(7); - return 0; - } - return 1; // Tile blank -} - -static INT32 TileFlipSH(INT32 sx,INT32 addr,INT32 pal) -{ - UINT32 pack=0; UINT32 t=0; - UINT8 *pd = HighCol+sx; - - pack=BURN_ENDIAN_SWAP_INT32(*(UINT32 *)(RamVid+addr)); // Get 8 pixels - if (pack) { - t=(pack&0x000f0000)>>16; sh_pix(0); - t=(pack&0x00f00000)>>20; sh_pix(1); - t=(pack&0x0f000000)>>24; sh_pix(2); - t=(pack&0xf0000000)>>28; sh_pix(3); - t=(pack&0x0000000f) ; sh_pix(4); - t=(pack&0x000000f0)>> 4; sh_pix(5); - t=(pack&0x00000f00)>> 8; sh_pix(6); - t=(pack&0x0000f000)>>12; sh_pix(7); - return 0; - } - return 1; // Tile blank -} - -static INT32 TileNormZ(INT32 sx,INT32 addr,INT32 pal,INT32 zval) -{ - UINT32 pack=0; - UINT32 t=0; - UINT8 *pd = HighCol+sx; - INT8 *zb = HighSprZ+sx; - INT32 collision = 0, zb_s; - - pack=BURN_ENDIAN_SWAP_INT32(*(UINT32 *)(RamVid+addr)); // Get 8 pixels - if (pack) { - t=pack&0x0000f000; if(t) { zb_s=zb[0]; if(zb_s) collision=1; if(zval>zb_s) { pd[0]=(UINT8)(pal|(t>>12)); zb[0]=(INT8)zval; } } - t=pack&0x00000f00; if(t) { zb_s=zb[1]; if(zb_s) collision=1; if(zval>zb_s) { pd[1]=(UINT8)(pal|(t>> 8)); zb[1]=(INT8)zval; } } - t=pack&0x000000f0; if(t) { zb_s=zb[2]; if(zb_s) collision=1; if(zval>zb_s) { pd[2]=(UINT8)(pal|(t>> 4)); zb[2]=(INT8)zval; } } - t=pack&0x0000000f; if(t) { zb_s=zb[3]; if(zb_s) collision=1; if(zval>zb_s) { pd[3]=(UINT8)(pal|(t )); zb[3]=(INT8)zval; } } - t=pack&0xf0000000; if(t) { zb_s=zb[4]; if(zb_s) collision=1; if(zval>zb_s) { pd[4]=(UINT8)(pal|(t>>28)); zb[4]=(INT8)zval; } } - t=pack&0x0f000000; if(t) { zb_s=zb[5]; if(zb_s) collision=1; if(zval>zb_s) { pd[5]=(UINT8)(pal|(t>>24)); zb[5]=(INT8)zval; } } - t=pack&0x00f00000; if(t) { zb_s=zb[6]; if(zb_s) collision=1; if(zval>zb_s) { pd[6]=(UINT8)(pal|(t>>20)); zb[6]=(INT8)zval; } } - t=pack&0x000f0000; if(t) { zb_s=zb[7]; if(zb_s) collision=1; if(zval>zb_s) { pd[7]=(UINT8)(pal|(t>>16)); zb[7]=(INT8)zval; } } - if(collision) RamVReg->status |= 0x20; - return 0; - } - return 1; // Tile blank -} - -static INT32 TileFlipZ(INT32 sx,INT32 addr,INT32 pal,INT32 zval) -{ - UINT32 pack=0; - UINT32 t=0; - UINT8 *pd = HighCol+sx; - INT8 *zb = HighSprZ+sx; - INT32 collision = 0, zb_s; - - pack=BURN_ENDIAN_SWAP_INT32(*(UINT32 *)(RamVid+addr)); // Get 8 pixels - if (pack) { - t=pack&0x000f0000; if(t) { zb_s=zb[0]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[0]=(UINT8)(pal|(t>>16)); zb[0]=(INT8)zval; } } - t=pack&0x00f00000; if(t) { zb_s=zb[1]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[1]=(UINT8)(pal|(t>>20)); zb[1]=(INT8)zval; } } - t=pack&0x0f000000; if(t) { zb_s=zb[2]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[2]=(UINT8)(pal|(t>>24)); zb[2]=(INT8)zval; } } - t=pack&0xf0000000; if(t) { zb_s=zb[3]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[3]=(UINT8)(pal|(t>>28)); zb[3]=(INT8)zval; } } - t=pack&0x0000000f; if(t) { zb_s=zb[4]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[4]=(UINT8)(pal|(t )); zb[4]=(INT8)zval; } } - t=pack&0x000000f0; if(t) { zb_s=zb[5]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[5]=(UINT8)(pal|(t>> 4)); zb[5]=(INT8)zval; } } - t=pack&0x00000f00; if(t) { zb_s=zb[6]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[6]=(UINT8)(pal|(t>> 8)); zb[6]=(INT8)zval; } } - t=pack&0x0000f000; if(t) { zb_s=zb[7]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[7]=(UINT8)(pal|(t>>12)); zb[7]=(INT8)zval; } } - if(collision) RamVReg->status |= 0x20; - return 0; - } - return 1; // Tile blank -} - - -#define sh_pixZ(x) \ - if(t) { \ - if(zb[x]) collision=1; \ - if(zval>zb[x]) { \ - if (t==0xe) { pd[x]=(UINT8)((pd[x]&0x3f)|0x80); /* hilight */ } \ - else if(t==0xf) { pd[x]=(UINT8)((pd[x]&0x3f)|0xc0); /* shadow */ } \ - else { zb[x]=(INT8)zval; pd[x]=(UINT8)(pal|t); } \ - } \ - } - -static INT32 TileNormZSH(INT32 sx,INT32 addr,INT32 pal,INT32 zval) -{ - UINT32 pack=0; - UINT32 t=0; - UINT8 *pd = HighCol+sx; - INT8 *zb = HighSprZ+sx; - INT32 collision = 0; - - pack=BURN_ENDIAN_SWAP_INT32(*(UINT32 *)(RamVid+addr)); // Get 8 pixels - if (pack) { - t=(pack&0x0000f000)>>12; sh_pixZ(0); - t=(pack&0x00000f00)>> 8; sh_pixZ(1); - t=(pack&0x000000f0)>> 4; sh_pixZ(2); - t=(pack&0x0000000f) ; sh_pixZ(3); - t=(pack&0xf0000000)>>28; sh_pixZ(4); - t=(pack&0x0f000000)>>24; sh_pixZ(5); - t=(pack&0x00f00000)>>20; sh_pixZ(6); - t=(pack&0x000f0000)>>16; sh_pixZ(7); - if(collision) RamVReg->status |= 0x20; - return 0; - } - return 1; // Tile blank -} - -static INT32 TileFlipZSH(INT32 sx,INT32 addr,INT32 pal,INT32 zval) -{ - UINT32 pack=0; - UINT32 t=0; - UINT8 *pd = HighCol+sx; - INT8 *zb = HighSprZ+sx; - INT32 collision = 0; - - pack=BURN_ENDIAN_SWAP_INT32(*(UINT32 *)(RamVid+addr)); // Get 8 pixels - if (pack) { - t=(pack&0x000f0000)>>16; sh_pixZ(0); - t=(pack&0x00f00000)>>20; sh_pixZ(1); - t=(pack&0x0f000000)>>24; sh_pixZ(2); - t=(pack&0xf0000000)>>28; sh_pixZ(3); - t=(pack&0x0000000f) ; sh_pixZ(4); - t=(pack&0x000000f0)>> 4; sh_pixZ(5); - t=(pack&0x00000f00)>> 8; sh_pixZ(6); - t=(pack&0x0000f000)>>12; sh_pixZ(7); - if(collision) RamVReg->status |= 0x20; - return 0; - } - return 1; // Tile blank -} - -static void DrawStrip(struct TileStrip *ts, INT32 sh) -{ - INT32 tilex=0,dx=0,ty=0,code=0,addr=0,cells; - INT32 oldcode=-1,blank=-1; // The tile we know is blank - INT32 pal=0; - - // Draw tiles across screen: - tilex = (-ts->hscroll)>>3; - ty = (ts->line&7)<<1; // Y-Offset into tile - dx = ((ts->hscroll-1)&7)+1; - cells = ts->cells; - if(dx != 8) cells++; // have hscroll, need to draw 1 cell more - - for (; cells; dx+=8,tilex++,cells--) { - INT32 zero=0; - - code=BURN_ENDIAN_SWAP_INT16(RamVid[ts->nametab + (tilex&ts->xmask)]); - if (code==blank) continue; - if (code>>15) { // high priority tile - INT32 cval = code | (dx<<16) | (ty<<25); - if(code&0x1000) cval^=7<<26; - *ts->hc++ = cval; // cache it - continue; - } - - if (code!=oldcode) { - oldcode = code; - // Get tile address/2: - addr=(code&0x7ff)<<4; - addr+=ty; - if (code&0x1000) addr^=0xe; // Y-flip - pal=((code>>9)&0x30)|(sh<<6); - } - - if (code&0x0800) zero=TileFlip(dx,addr,pal); - else zero=TileNorm(dx,addr,pal); - - if (zero) blank=code; // We know this tile is blank now - } - - // terminate the cache list - *ts->hc = 0; -} - -static void DrawStripVSRam(struct TileStrip *ts, INT32 plane, INT32 sh) -{ - INT32 tilex=0,dx=0,ty=0,code=0,addr=0,cell=0,nametabadd=0; - INT32 oldcode=-1,blank=-1; // The tile we know is blank - INT32 pal=0,scan=Scanline; - - // Draw tiles across screen: - tilex=(-ts->hscroll)>>3; - dx=((ts->hscroll-1)&7)+1; - if(dx != 8) { - INT32 vscroll, line; - cell--; // have hscroll, start with negative cell - // also calculate intial VS stuff - vscroll = BURN_ENDIAN_SWAP_INT16(RamSVid[plane]); - - // Find the line in the name table - line = (vscroll+scan)&ts->line&0xffff; // ts->line is really ymask .. - nametabadd = (line>>3)<<(ts->line>>24); // .. and shift[width] - ty = (line&7)<<1; // Y-Offset into tile - } - - for (; cell < ts->cells; dx+=8,tilex++,cell++) { - INT32 zero=0; - - if((cell&1)==0) { - INT32 line,vscroll; - vscroll = BURN_ENDIAN_SWAP_INT16(RamSVid[plane+(cell&~1)]); - - // Find the line in the name table - line = (vscroll+scan)&ts->line&0xffff; // ts->line is really ymask .. - nametabadd = (line>>3)<<(ts->line>>24); // .. and shift[width] - ty = (line&7)<<1; // Y-Offset into tile - } - - code = BURN_ENDIAN_SWAP_INT16(RamVid[ts->nametab + nametabadd + (tilex&ts->xmask)]); - if (code==blank) continue; - if (code>>15) { // high priority tile - INT32 cval = code | (dx<<16) | (ty<<25); - if(code&0x1000) cval^=7<<26; - *ts->hc++ = cval; // cache it - continue; - } - - if (code!=oldcode) { - oldcode = code; - // Get tile address/2: - addr=(code&0x7ff)<<4; - if (code&0x1000) addr+=14-ty; else addr+=ty; // Y-flip - pal=((code>>9)&0x30)|(sh<<6); - } - - if (code&0x0800) zero=TileFlip(dx,addr,pal); - else zero=TileNorm(dx,addr,pal); - - if (zero) blank=code; // We know this tile is blank now - } - - // terminate the cache list - *ts->hc = 0; -} - -static void DrawStripInterlace(struct TileStrip *ts) -{ - INT32 tilex=0,dx=0,ty=0,code=0,addr=0,cells; - INT32 oldcode=-1,blank=-1; // The tile we know is blank - INT32 pal=0; - - // Draw tiles across screen: - tilex=(-ts->hscroll)>>3; - ty=(ts->line&15)<<1; // Y-Offset into tile - dx=((ts->hscroll-1)&7)+1; - cells = ts->cells; - if(dx != 8) cells++; // have hscroll, need to draw 1 cell more - - for (; cells; dx+=8,tilex++,cells--) { - INT32 zero=0; - - code=BURN_ENDIAN_SWAP_INT16(RamVid[ts->nametab+(tilex&ts->xmask)]); - if (code==blank) continue; - if (code>>15) { // high priority tile - INT32 cval = (code&0xfc00) | (dx<<16) | (ty<<25); - cval |= (code&0x3ff)<<1; - if(code&0x1000) cval^=0xf<<26; - *ts->hc++ = cval; // cache it - continue; - } - - if (code!=oldcode) { - oldcode = code; - // Get tile address/2: - addr=(code&0x7ff)<<5; - if (code&0x1000) addr+=30-ty; else addr+=ty; // Y-flip - pal=((code>>9)&0x30); - } - - if (code&0x0800) zero=TileFlip(dx,addr,pal); - else zero=TileNorm(dx,addr,pal); - - if (zero) blank=code; // We know this tile is blank now - } - - // terminate the cache list - *ts->hc = 0; -} - -static void DrawLayer(INT32 plane, INT32 *hcache, INT32 maxcells, INT32 sh) -{ - const INT8 shift[4]={5,6,5,7}; // 32,64 or 128 sized tilemaps (2 is invalid) - struct TileStrip ts; - INT32 width, height, ymask; - INT32 vscroll, htab; - - ts.hc = hcache; - ts.cells = maxcells; - - // Work out the TileStrip to draw - - // Work out the name table size: 32 64 or 128 tiles (0-3) - width = RamVReg->reg[16]; - height = (width>>4)&3; - width &= 3; - - ts.xmask=(1<1) ymask =0x0ff; - - // Find name table: - if (plane==0) ts.nametab=(RamVReg->reg[2] & 0x38)<< 9; // A - else ts.nametab=(RamVReg->reg[4] & 0x07)<<12; // B - - htab = RamVReg->reg[13] << 9; // Horizontal scroll table address - if ( RamVReg->reg[11] & 2) htab += Scanline<<1; // Offset by line - if ((RamVReg->reg[11] & 1)==0) htab &= ~0xf; // Offset by tile - htab += plane; // A or B - - // Get horizontal scroll value, will be masked later - ts.hscroll = BURN_ENDIAN_SWAP_INT16(RamVid[htab & 0x7fff]); - - if((RamVReg->reg[12]&6) == 6) { - // interlace mode 2 - vscroll = BURN_ENDIAN_SWAP_INT16(RamSVid[plane]); // Get vertical scroll value - - // Find the line in the name table - ts.line=(vscroll+(Scanline<<1))&((ymask<<1)|1); - ts.nametab+=(ts.line>>4)<reg[11]&4) { - // we have 2-cell column based vscroll - // luckily this doesn't happen too often - ts.line = ymask | (shift[width]<<24); // save some stuff instead of line - DrawStripVSRam(&ts, plane, sh); - } else { - vscroll = BURN_ENDIAN_SWAP_INT16(RamSVid[plane]); // Get vertical scroll value - - // Find the line in the name table - ts.line = (vscroll+Scanline)&ymask; - ts.nametab += (ts.line>>3)<reg[12] & 1) { - nametab = (RamVReg->reg[3] & 0x3c)<<9; - nametab += (Scanline>>3)<<6; // 40-cell mode - } else { - nametab = (RamVReg->reg[3] & 0x3e)<<9; - nametab += (Scanline>>3)<<5; // 32-cell mode - } - - tilex = tstart<<1; - tend <<= 1; - - ty = (Scanline & 7)<<1; // Y-Offset into tile - - if(!(rendstatus & 2)) { - // check the first tile code - code = BURN_ENDIAN_SWAP_INT16(RamVid[nametab + tilex]); - // if the whole window uses same priority (what is often the case), we may be able to skip this field - if((code>>15) != prio) return; - } - - // Draw tiles across screen: - for (; tilex <= tend; tilex++) { - INT32 addr=0, zero=0, pal; - - code = BURN_ENDIAN_SWAP_INT16(RamVid[nametab + tilex]); - if(code==blank) continue; - if((code>>15) != prio) { - rendstatus |= 2; - continue; - } - - pal=((code>>9)&0x30); - - if(sh) { - INT32 tmp, *zb = (INT32 *)(HighCol+8+(tilex<<3)); - if(prio) { - tmp = *zb; - if(!(tmp&0x00000080)) tmp&=~0x000000c0; - if(!(tmp&0x00008000)) tmp&=~0x0000c000; - if(!(tmp&0x00800000)) tmp&=~0x00c00000; - if(!(tmp&0x80000000)) tmp&=~0xc0000000; - *zb++=tmp; tmp = *zb; - if(!(tmp&0x00000080)) tmp&=~0x000000c0; - if(!(tmp&0x00008000)) tmp&=~0x0000c000; - if(!(tmp&0x00800000)) tmp&=~0x00c00000; - if(!(tmp&0x80000000)) tmp&=~0xc0000000; - *zb++=tmp; - } else { - pal |= 0x40; - } - } - - // Get tile address/2: - addr = (code&0x7ff)<<4; - if (code&0x1000) addr += 14-ty; else addr += ty; // Y-flip - - if (code&0x0800) zero = TileFlip(8+(tilex<<3),addr,pal); - else zero = TileNorm(8+(tilex<<3),addr,pal); - - if (zero) blank = code; // We know this tile is blank now - } - // terminate the cache list - //*hcache = 0; -} - -static void DrawTilesFromCache(INT32 *hc, INT32 sh) -{ - INT32 code, addr, zero, dx; - INT32 pal; - INT16 blank=-1; // The tile we know is blank - - // *ts->hc++ = code | (dx<<16) | (ty<<25); // cache it - - while((code = *hc++)) { - if(!sh && (INT16)code == blank) continue; - - // Get tile address/2: - addr=(code&0x7ff)<<4; - addr+=(UINT32)code>>25; // y offset into tile - dx=(code>>16)&0x1ff; - if(sh) { - UINT8 *zb = HighCol+dx; - if(!(*zb&0x80)) *zb&=0x3f; - zb++; - if(!(*zb&0x80)) *zb&=0x3f; - zb++; - if(!(*zb&0x80)) *zb&=0x3f; - zb++; - if(!(*zb&0x80)) *zb&=0x3f; - zb++; - if(!(*zb&0x80)) *zb&=0x3f; - zb++; - if(!(*zb&0x80)) *zb&=0x3f; - zb++; - if(!(*zb&0x80)) *zb&=0x3f; - zb++; - if(!(*zb&0x80)) *zb&=0x3f; - zb++; - } - - pal=((code>>9)&0x30); - - if (code&0x0800) zero=TileFlip(dx,addr,pal); - else zero=TileNorm(dx,addr,pal); - - if(zero) blank=(INT16)code; - } -} - -// Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size -// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - -static void DrawSprite(INT32 *sprite, INT32 **hc, INT32 sh) -{ - INT32 width=0,height=0; - INT32 row=0,code=0; - INT32 pal; - INT32 tile=0,delta=0; - INT32 sx, sy; - INT32 (*fTileFunc)(INT32 sx,INT32 addr,INT32 pal); - - // parse the sprite data - sy=sprite[0]; - code=sprite[1]; - sx=code>>16; // X - width=sy>>28; - height=(sy>>24)&7; // Width and height in tiles - sy=(sy<<16)>>16; // Y - - row=Scanline-sy; // Row of the sprite we are on - - if (code&0x1000) row=(height<<3)-1-row; // Flip Y - - tile=code&0x7ff; // Tile number - tile+=row>>3; // Tile number increases going down - delta=height; // Delta to increase tile by going right - if (code&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X - - tile<<=4; tile+=(row&7)<<1; // Tile address - - if(code&0x8000) { // high priority - cache it - *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>16)&0xf); - } else { - delta<<=4; // Delta of address - pal=((code>>9)&0x30)|(sh<<6); - - if(sh && (code&0x6000) == 0x6000) { - if(code&0x0800) fTileFunc=TileFlipSH; - else fTileFunc=TileNormSH; - } else { - if(code&0x0800) fTileFunc=TileFlip; - else fTileFunc=TileNorm; - } - - for (; width; width--,sx+=8,tile+=delta) { - if(sx<=0) continue; - if(sx>=328) break; // Offscreen - - tile&=0x7fff; // Clip tile address - fTileFunc(sx,tile,pal); - } - } -} - -// Index + 0 : hhhhvvvv s---hhvv yyyyyyyy yyyyyyyy // s: skip flag, h: horiz. size -// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - -static void DrawSpriteZ(INT32 pack, INT32 pack2, INT32 shpri, INT32 sprio) -{ - INT32 width=0,height=0; - INT32 row=0; - INT32 pal; - INT32 tile=0,delta=0; - INT32 sx, sy; - INT32 (*fTileFunc)(INT32 sx,INT32 addr,INT32 pal,INT32 zval); - - // parse the sprite data - sx = pack2>>16; // X - sy = (pack <<16)>>16; // Y - width = pack >>28; - height= (pack >>24)&7; // Width and height in tiles - - row = Scanline-sy; // Row of the sprite we are on - - if (pack2&0x1000) row=(height<<3)-1-row; // Flip Y - - tile = pack2&0x7ff; // Tile number - tile+= row>>3; // Tile number increases going down - delta=height; // Delta to increase tile by going right - if (pack2&0x0800) { // Flip X - tile += delta*(width-1); - delta = -delta; - } - - tile<<=4; - tile+=(row&7)<<1; // Tile address - delta<<=4; // Delta of address - pal=((pack2>>9)&0x30); - if((shpri&1)&&!(shpri&2)) pal|=0x40; - - shpri&=1; - if((pack2&0x6000) != 0x6000) shpri = 0; - shpri |= (pack2&0x0800)>>10; - switch(shpri) { - default: - case 0: fTileFunc=TileNormZ; break; - case 1: fTileFunc=TileNormZSH; break; - case 2: fTileFunc=TileFlipZ; break; - case 3: fTileFunc=TileFlipZSH; break; - } - - for (; width; width--,sx+=8,tile+=delta) { - if(sx<=0) continue; - if(sx>=328) break; // Offscreen - - tile&=0x7fff; // Clip tile address - fTileFunc(sx,tile,pal,sprio); - } -} - - -static void DrawSpriteInterlace(UINT32 *sprite) -{ - INT32 width=0,height=0; - INT32 row=0,code=0; - INT32 pal; - INT32 tile=0,delta=0; - INT32 sx, sy; - - // parse the sprite data - sy=sprite[0]; - height=sy>>24; - sy=(sy&0x3ff)-0x100; // Y - width=(height>>2)&3; height&=3; - width++; height++; // Width and height in tiles - - row=(Scanline<<1)-sy; // Row of the sprite we are on - - code=sprite[1]; - sx=((code>>16)&0x1ff)-0x78; // X - - if (code&0x1000) row^=(16<>4; // Tile number increases going down - delta=height; // Delta to increase tile by going right - if (code&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X - - tile<<=5; tile+=(row&15)<<1; // Tile address - - delta<<=5; // Delta of address - pal=((code>>9)&0x30); // Get palette pointer - - for (; width; width--,sx+=8,tile+=delta) { - if(sx<=0) continue; - if(sx>=328) break; // Offscreen - - tile&=0x7fff; // Clip tile address - if (code&0x0800) TileFlip(sx,tile,pal); - else TileNorm(sx,tile,pal); - } -} - - -static void DrawAllSpritesInterlace(INT32 pri, INT32 maxwidth) -{ - INT32 i,u,table,link=0,sline=Scanline<<1; - UINT32 *sprites[80]; // Sprite index - - table = RamVReg->reg[5]&0x7f; - if (RamVReg->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode - table<<=8; // Get sprite table address/2 - - for (i=u=0; u < 80 && i < 21; u++) { - UINT32 *sprite; - INT32 code, sx, sy, height; - - sprite=(UINT32 *)(RamVid+((table+(link<<2))&0x7ffc)); // Find sprite - - // get sprite info - code = BURN_ENDIAN_SWAP_INT32(sprite[0]); - sx = BURN_ENDIAN_SWAP_INT32(sprite[1]); - if(((sx>>15)&1) != pri) goto nextsprite; // wrong priority sprite - - // check if it is on this line - sy = (code&0x3ff)-0x100; - height = (((code>>24)&3)+1)<<4; - if(sline < sy || sline >= sy+height) goto nextsprite; // no - - // check if sprite is not hidden offscreen - sx = (sx>>16)&0x1ff; - sx -= 0x78; // Get X coordinate + 8 - if(sx <= -8*3 || sx >= maxwidth) goto nextsprite; - - // sprite is good, save it's pointer - sprites[i++]=sprite; - - nextsprite: - // Find next sprite - link=(code>>16)&0x7f; - if(!link) break; // End of sprites - } - - // Go through sprites backwards: - for (i-- ;i>=0; i--) - DrawSpriteInterlace(sprites[i]); -} - -static void DrawSpritesFromCache(INT32 *hc, INT32 sh) -{ - INT32 code, tile, sx, delta, width; - INT32 pal; - INT32 (*fTileFunc)(INT32 sx,INT32 addr,INT32 pal); - - // *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>24)&0xf); - - while((code=*hc++)) { - pal=(code&0x30); - delta=code&0xf; - width=delta>>2; delta&=3; - width++; delta++; // Width and height in tiles - if (code&0x10000) delta=-delta; // Flip X - delta<<=4; - tile=((UINT32)code>>17)<<1; - sx=(code<<16)>>22; // sx can be negative (start offscreen), so sign extend - - if(sh && pal == 0x30) { // - if(code&0x10000) fTileFunc=TileFlipSH; - else fTileFunc=TileNormSH; - } else { - if(code&0x10000) fTileFunc=TileFlip; - else fTileFunc=TileNorm; - } - - for (; width; width--,sx+=8,tile+=delta) { - if(sx<=0) continue; - if(sx>=328) break; // Offscreen - - tile&=0x7fff; // Clip tile address - fTileFunc(sx,tile,pal); - } - } -} - -// Index + 0 : ----hhvv -lllllll -------y yyyyyyyy -// Index + 4 : -------x xxxxxxxx pccvhnnn nnnnnnnn -// v -// Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size -// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - -static void PrepareSprites(INT32 full) -{ - INT32 u=0,link=0,sblocks=0; - INT32 table=0; - INT32 *pd = HighPreSpr; - - table=RamVReg->reg[5]&0x7f; - if (RamVReg->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode - table<<=8; // Get sprite table address/2 - - if (!full) { - INT32 pack; - // updates: tilecode, sx - for (u=0; u < 80 && (pack = *pd); u++, pd+=2) { - UINT32 *sprite; - INT32 code, code2, sx, sy, skip=0; - - sprite=(UINT32 *)(RamVid+((table+(link<<2))&0x7ffc)); // Find sprite - - // parse sprite info - code = BURN_ENDIAN_SWAP_INT32(sprite[0]); - code2 = BURN_ENDIAN_SWAP_INT32(sprite[1]); - code2 &= ~0xfe000000; - code2 -= 0x00780000; // Get X coordinate + 8 in upper 16 bits - sx = code2>>16; - - if((sx <= 8-((pack>>28)<<3) && sx >= -0x76) || sx >= 328) skip=1<<23; - else if ((sy = (pack<<16)>>16) < 240 && sy > -32) { - INT32 sbl = (2<<(pack>>28))-1; - sblocks |= sbl<<(sy>>3); - } - - *pd = (pack&~(1<<23))|skip; - *(pd+1) = code2; - - // Find next sprite - link=(code>>16)&0x7f; - if(!link) break; // End of sprites - } - SpriteBlocks |= sblocks; - } else { - for (; u < 80; u++) { - UINT32 *sprite; - INT32 code, code2, sx, sy, hv, height, width, skip=0, sx_min; - - sprite=(UINT32 *)(RamVid+((table+(link<<2))&0x7ffc)); // Find sprite - - // parse sprite info - code = BURN_ENDIAN_SWAP_INT32(sprite[0]); - sy = (code&0x1ff)-0x80; - hv = (code>>24)&0xf; - height = (hv&3)+1; - - if(sy > 240 || sy + (height<<3) <= 0) skip|=1<<22; - - width = (hv>>2)+1; - code2 = BURN_ENDIAN_SWAP_INT32(sprite[1]); - sx = (code2>>16)&0x1ff; - sx -= 0x78; // Get X coordinate + 8 - sx_min = 8-(width<<3); - - if((sx <= sx_min && sx >= -0x76) || sx >= 328) skip|=1<<23; - else if (sx > sx_min && !skip) { - INT32 sbl = (2<>3; - if(shi < 0) shi=0; // negative sy - sblocks |= sbl<>16)&0x7f; - if(!link) break; // End of sprites - } - SpriteBlocks = sblocks; - *pd = 0; // terminate - } -} - -static void DrawAllSprites(INT32 *hcache, INT32 maxwidth, INT32 prio, INT32 sh) -{ - INT32 i,u,n; - INT32 sx1seen=0; // sprite with x coord 1 or 0 seen - INT32 ntiles = 0; // tile counter for sprite limit emulation - INT32 *sprites[40]; // Sprites to draw in fast mode - INT32 *ps, pack, rs = rendstatus, scan=Scanline; - - if(rs&8) { - DrawAllSpritesInterlace(prio, maxwidth); - return; - } - if(rs&0x11) { - //dprintf("PrepareSprites(%i) [%i]", (rs>>4)&1, scan); - PrepareSprites(rs&0x10); - rendstatus=rs&~0x11; - } - if (!(SpriteBlocks & (1<<(scan>>3)))) return; - - if(((rs&4)||sh)&&prio==0) - memset(HighSprZ, 0, 328); - if(!(rs&4)&&prio) { - if(hcache[0]) DrawSpritesFromCache(hcache, sh); - return; - } - - ps = HighPreSpr; - - // Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size - // Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - - for(i=u=n=0; (pack = *ps) && n < 20; ps+=2, u++) { - INT32 sx, sy, row, pack2; - - if(pack & 0x00400000) continue; - - // get sprite info - pack2 = *(ps+1); - sx = pack2>>16; - sy = (pack <<16)>>16; - row = scan-sy; - - //dprintf("x: %i y: %i %ix%i", sx, sy, (pack>>28)<<3, (pack>>21)&0x38); - - if(sx == -0x77) sx1seen |= 1; // for masking mode 2 - - // check if it is on this line - if(row < 0 || row >= ((pack>>21)&0x38)) continue; // no - n++; // number of sprites on this line (both visible and hidden, max is 20) [broken] - - // sprite limit - ntiles += pack>>28; - if(ntiles > 40) break; - - if(pack & 0x00800000) continue; - - // masking sprite? - if(sx == -0x78) { - if(!(sx1seen&1) || sx1seen==3) { - break; // this sprite is not drawn and remaining sprites are masked - } - if((sx1seen>>8) == 0) sx1seen=(i+1)<<8; - continue; - } - else if(sx == -0x77) { - // masking mode2 (Outrun, Galaxy Force II, Shadow of the beast) - if(sx1seen>>8) { - i=(sx1seen>>8)-1; - break; - } // seen both 0 and 1 - sx1seen |= 2; - continue; - } - - // accurate sprites - //dprintf("P:%i",((sx>>15)&1)); - if(rs&4) { - // might need to skip this sprite - if((pack2&0x8000) ^ (prio<<15)) continue; - DrawSpriteZ(pack,pack2,sh|(prio<<1),(INT8)(0x1f-n)); - continue; - } - - // sprite is good, save it's pointer - sprites[i++]=ps; - } - - // Go through sprites backwards: - if(!(rs&4)) { - for (i--; i>=0; i--) - DrawSprite(sprites[i],&hcache,sh); - - // terminate cache list - *hcache = 0; - } -} - - -static void BackFill(INT32 reg7, INT32 sh) -{ - // Start with a blank scanline (background colour): - UINT32 *pd = (UINT32 *)(HighCol+8); - UINT32 *end= (UINT32 *)(HighCol+8+320); - UINT32 back = reg7 & 0x3f; - back |= sh<<6; - back |= back<<8; - back |= back<<16; - do { pd[0]=pd[1]=pd[2]=pd[3]=back; pd+=4; } while (pd < end); -} - - -static INT32 DrawDisplay(INT32 sh) -{ - INT32 maxw, maxcells; - INT32 win=0, edge=0, hvwind=0; - - if(RamVReg->reg[12] & 1) { - maxw = 328; maxcells = 40; - } else { - maxw = 264; maxcells = 32; - } - - // Find out if the window is on this line: - win = RamVReg->reg[0x12]; - edge = (win & 0x1f)<<3; - - if (win&0x80) { if (Scanline>=edge) hvwind=1; } - else { if (Scanline< edge) hvwind=1; } - - if(!hvwind) { // we might have a vertical window here - win = RamVReg->reg[0x11]; - edge = win&0x1f; - if(win&0x80) { - if(!edge) hvwind=1; - else if(edge < (maxcells>>1)) hvwind=2; - } else { - if(!edge); - else if(edge < (maxcells>>1)) hvwind=2; - else hvwind=1; - } - } - - DrawLayer(1, HighCacheB, maxcells, sh); - if(hvwind == 1) - DrawWindow(0, maxcells>>1, 0, sh); // HighCacheAW - else if(hvwind == 2) { - // ahh, we have vertical window - DrawLayer(0, HighCacheA, (win&0x80) ? edge<<1 : maxcells, sh); - DrawWindow((win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 0, sh); // HighCacheW - } else - DrawLayer(0, HighCacheA, maxcells, sh); - DrawAllSprites(HighCacheS, maxw, 0, sh); - - if(HighCacheB[0]) - DrawTilesFromCache(HighCacheB, sh); - if(hvwind == 1) - DrawWindow(0, maxcells>>1, 1, sh); - else if(hvwind == 2) { - if(HighCacheA[0]) DrawTilesFromCache(HighCacheA, sh); - DrawWindow((win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 1, sh); - } else - if(HighCacheA[0]) DrawTilesFromCache(HighCacheA, sh); - DrawAllSprites(HighCacheS, maxw, 1, sh); - - return 0; -} - -static void PicoFrameStart() -{ - // prepare to do this frame - rendstatus = 0x80 >> 5; // accurate sprites - RamVReg->status &= ~0x0020; - if((RamVReg->reg[12]&6) == 6) rendstatus |= 8; // interlace mode - Scanline = 0; - - INT32 offset = 0; - if (!(RamVReg->reg[1] & 8)) offset = 8; - HighCol = HighColFull + ( (offset + Scanline) * (8 + 320 + 8) ); // the FIRST line. - - //if(Pico.m.dirtyPal) Pico.m.dirtyPal = 2; // reset dirty if needed - PrepareSprites(1); -} - -static INT32 PicoLine(INT32 /*scan*/) -{ - INT32 sh = (RamVReg->reg[0xC] & 8)>>3; // shadow/hilight? - - BackFill(RamVReg->reg[7], sh); - if (RamVReg->reg[1] & 0x40) - DrawDisplay(sh); - - { - INT32 offset = 0; - if (!(RamVReg->reg[1] & 8)) offset = 8; - HighCol = HighColFull + ( (offset + Scanline + 1) * (8 + 320 + 8) ); // re: PicoFrameStart(); above: the SECOND line and following.. hence + 1 - - { // render current line to linebuf, for mid-screen palette changes (referred to as SONIC rendering mode, for water & etc.) - UINT16 *pDest = LineBuf + (Scanline * 320); - UINT8 *pSrc = HighColFull + (Scanline + offset)*(8+320+8) + 8; - - for (INT32 i = 0; i < 320; i++) - pDest[i] = MegadriveCurPal[pSrc[i]]; - - } - }; - - return 0; -} - -static void MegadriveDraw() -{ - UINT16 *pDest = (UINT16 *)pBurnDraw; - - if ((RamVReg->reg[12]&1) || !(MegadriveDIP[1] & 0x03)) { - - for (INT32 j=0; j < 224; j++) { - UINT16 *pSrc = LineBuf + (j * 320); - for (INT32 i = 0; i < 320; i++) - pDest[i] = pSrc[i]; - pDest += 320; - } - - } else { - - if (( MegadriveDIP[1] & 0x03 ) == 0x01 ) { - // Center - pDest += 32; - for (INT32 j = 0; j < 224; j++) { - UINT16 *pSrc = LineBuf + (j * 320); - - memset((UINT8 *)pDest - 32*2, 0, 64); - - for (INT32 i = 0; i < 256; i++) - pDest[i] = pSrc[i]; - - memset((UINT8 *)pDest + 256*2, 0, 64); - - pDest += 320; - } - } else { - // Zoom - for (INT32 j = 0; j < 224; j++) { - UINT16 *pSrc = LineBuf + (j * 320); - UINT32 delta = 0; - for (INT32 i = 0; i < 320; i++) { - pDest[i] = pSrc[delta >> 16]; - delta += 0xCCCC; - } - pDest += 320; - } - } - - } - memset(LineBuf, 0, 320 * 320 * sizeof(UINT16)); -} - -#define TOTAL_68K_CYCLES ((double)OSC_NTSC / 7) / 60 -#define TOTAL_Z80_CYCLES ((double)OSC_NTSC / 15) / 60 -#define TOTAL_68K_CYCLES_PAL ((double)OSC_PAL / 7) / 50 -#define TOTAL_Z80_CYCLES_PAL ((double)OSC_PAL / 15) / 50 -#define CYCLES_M68K_LINE 488 // suitable for both PAL/NTSC -#define CYCLES_M68K_VINT_LAG 68 -#define CYCLES_M68K_ASD 148 - -INT32 MegadriveFrame() -{ - if (MegadriveReset) { - MegadriveResetDo(); - MegadriveReset = 0; - return 0xdead; // prevent crash because of a call to Reinitialise() in MegadriveResetDo(); - } - - if (bMegadriveRecalcPalette) { - for (INT32 i=0;i<0x40;i++) - CalcCol(i, BURN_ENDIAN_SWAP_INT16(RamPal[i])); - bMegadriveRecalcPalette = 0; - } - - JoyPad->pad[0] = JoyPad->pad[1] = JoyPad->pad[2] = JoyPad->pad[3] = 0; - for (INT32 i = 0; i < 12; i++) { - JoyPad->pad[0] |= (MegadriveJoy1[i] & 1) << i; - JoyPad->pad[1] |= (MegadriveJoy2[i] & 1) << i; - JoyPad->pad[2] |= (MegadriveJoy3[i] & 1) << i; - JoyPad->pad[3] |= (MegadriveJoy4[i] & 1) << i; - } - - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - PicoFrameStart(); - - INT32 lines, lines_vis = 224, line_sample; - INT32 done_z80 = 0; - INT32 hint = RamVReg->reg[10]; // Hint counter - INT32 total_68k_cycles, total_z80_cycles; - INT32 vcnt_wrap = 0; - - if( Hardware & 0x40 ) { - lines = 313; - line_sample = 68; - if( RamVReg->reg[1]&8 ) lines_vis = 240; - total_68k_cycles = (INT32)(INT64)(TOTAL_68K_CYCLES_PAL * nBurnCPUSpeedAdjust / 0x100); - total_z80_cycles = (INT32)TOTAL_Z80_CYCLES_PAL; - } else { - lines = 262; - line_sample = 93; - total_68k_cycles = (INT32)(INT64)(TOTAL_68K_CYCLES * nBurnCPUSpeedAdjust / 0x100); - total_z80_cycles = (INT32)TOTAL_Z80_CYCLES; - } - - INT32 cycles_68k = total_68k_cycles / lines; - INT32 cycles_z80 = total_z80_cycles / lines; - - RamVReg->status &= ~0x88; // clear V-Int, come out of vblank - RamVReg->v_counter = 0; - - BurnTimerUpdate(CYCLES_M68K_ASD); // needed for Double Dragon II - - for (INT32 y=0; ylwrite_cnt -= 12; - if (RamVReg->lwrite_cnt <= 0) { - RamVReg->lwrite_cnt=0; - RamVReg->status|=0x200; - } - RamVReg->v_counter = y; - if ((RamVReg->reg[12]&6) == 6) { // interlace mode 2 - RamVReg->v_counter <<= 1; - RamVReg->v_counter |= RamVReg->v_counter >> 8; - RamVReg->v_counter &= 0xff; - } - } else if (y == lines_vis) { - vcnt_wrap = (Hardware & 0x40) ? 0x103 : 0xEB; // based on Gens, TODO: verify - // V-int line (224 or 240) - RamVReg->v_counter = 0xe0; // bad for 240 mode - if ((RamVReg->reg[12]&6) == 6) RamVReg->v_counter = 0xc1; - // VDP FIFO - RamVReg->lwrite_cnt = 0; - RamVReg->status |= 0x200; - - } else if (y > lines_vis) { - RamVReg->v_counter = y; - if (y >= vcnt_wrap) - RamVReg->v_counter -= (Hardware & 0x40) ? 56 : 6; - if ((RamVReg->reg[12]&6) == 6) - RamVReg->v_counter = (RamVReg->v_counter << 1) | 1; - RamVReg->v_counter &= 0xff; - } - - /*if(PicoOpt&0x20)*/ { - // pad delay (for 6 button pads) - if(JoyPad->padDelay[0]++ > 25) JoyPad->padTHPhase[0] = 0; - if(JoyPad->padDelay[1]++ > 25) JoyPad->padTHPhase[1] = 0; - } - - // H-Interrupts: - if((y <= lines_vis) && (--hint < 0)) { // y <= lines_vis: Comix Zone, Golden Axe - hint = RamVReg->reg[10]; // Reload H-Int counter - RamVReg->pending_ints |= 0x10; - if (RamVReg->reg[0] & 0x10) { - SekSetIRQLine(4, CPU_IRQSTATUS_ACK); - } - } - - // V-Interrupt: - if (y == lines_vis) { - RamVReg->status |= 0x08; // V-Int - - line_base_cycles = SekTotalCycles(); - // there must be a gap between H and V ints, also after vblank bit set (Mazin Saga, Bram Stoker's Dracula) - SekIdle(DMABURN()); - BurnTimerUpdate(((y + 1) * cycles_68k) + CYCLES_M68K_VINT_LAG - cycles_68k); - - RamVReg->pending_ints |= 0x20; - if(RamVReg->reg[1] & 0x20) { - SekSetIRQLine(6, CPU_IRQSTATUS_ACK); - } - RamVReg->status |= 0x88; // VBL (some games wont boot without this, Mega-lo-Mania is one of them) - } - - // decide if we draw this line - if ((!(RamVReg->reg[1]&8) && y<=224) || ((RamVReg->reg[1]&8) && y<240)) - PicoLine(y); - - // Run scanline - if (y == lines_vis) { - BurnTimerUpdate((y + 1) * cycles_68k - CYCLES_M68K_ASD - CYCLES_M68K_VINT_LAG); - } else { - line_base_cycles = SekTotalCycles(); - SekIdle(DMABURN()); - BurnTimerUpdate((y + 1) * cycles_68k); - } - - if (Z80HasBus && !MegadriveZ80Reset) { - INT32 nSegment = ((y + 1) * cycles_z80) - done_z80; - done_z80 += ZetRun(nSegment + Z80CyclesPrev); - Z80CyclesPrev = 0; - - if (y == line_sample) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - } - } - - if (pBurnDraw) MegadriveDraw(); - - BurnTimerEndFrame(total_68k_cycles); - - if (Z80HasBus && !MegadriveZ80Reset) { - if (done_z80 < total_z80_cycles) { - done_z80 += ZetRun(total_z80_cycles - done_z80); - } - Z80CyclesPrev = total_z80_cycles - done_z80; // Sync Z80 cycles between frames - } else { - Z80CyclesPrev = 0; - } - - if (pBurnSoundOut) { - BurnYM2612Update(pBurnSoundOut, nBurnSoundLen); - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - ZetClose(); - - return 0; -} - -INT32 MegadriveScan(INT32 nAction, INT32 *pnMin) -{ - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029738; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - struct BurnArea ba; - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamMisc; - ba.nLen = sizeof(struct PicoMisc); - ba.szName = "RAMMisc"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - BurnYM2612Scan(nAction, pnMin); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(Scanline); // - SCAN_VAR(Scanline); // Yes, let's scan Scanline 3x. (maintain compatibility with earlier savestates) - SCAN_VAR(Scanline); - SCAN_VAR(Z80HasBus); - SCAN_VAR(MegadriveZ80Reset); - SCAN_VAR(SpriteBlocks); - SCAN_VAR(rendstatus); - SCAN_VAR(Z80BankPartial); - SCAN_VAR(Z80BankPos); - } - - if (nAction & ACB_WRITE) { - bMegadriveRecalcPalette = 1; - } - - return 0; -} diff --git a/jan/src/burn/drv/megadrive/megadrive.h b/jan/src/burn/drv/megadrive/megadrive.h deleted file mode 100644 index cfc5a923f..000000000 --- a/jan/src/burn/drv/megadrive/megadrive.h +++ /dev/null @@ -1,29 +0,0 @@ -#define SEGA_MD_ROM_LOAD_NORMAL 0x10 -#define SEGA_MD_ROM_LOAD16_WORD_SWAP 0x20 -#define SEGA_MD_ROM_LOAD16_BYTE 0x30 -#define SEGA_MD_ROM_LOAD16_WORD_SWAP_CONTINUE_040000_100000 0x40 -#define SEGA_MD_ROM_LOAD_NORMAL_CONTINUE_020000_080000 0x50 -#define SEGA_MD_ROM_OFFS_000000 0x01 -#define SEGA_MD_ROM_OFFS_000001 0x02 -#define SEGA_MD_ROM_OFFS_020000 0x03 -#define SEGA_MD_ROM_OFFS_080000 0x04 -#define SEGA_MD_ROM_OFFS_100000 0x05 -#define SEGA_MD_ROM_OFFS_100001 0x06 -#define SEGA_MD_ROM_OFFS_200000 0x07 -#define SEGA_MD_ROM_OFFS_300000 0x08 -#define SEGA_MD_ROM_RELOAD_200000_200000 0x09 -#define SEGA_MD_ROM_RELOAD_100000_300000 0x0a - -extern UINT8 MegadriveReset; -extern UINT8 bMegadriveRecalcPalette; -extern UINT8 MegadriveJoy1[12]; -extern UINT8 MegadriveJoy2[12]; -extern UINT8 MegadriveJoy3[12]; -extern UINT8 MegadriveJoy4[12]; -extern UINT8 MegadriveDIP[2]; -extern UINT16 *MegadriveCurPal; - -INT32 MegadriveInit(); -INT32 MegadriveExit(); -INT32 MegadriveFrame(); -INT32 MegadriveScan(INT32 nAction, INT32 *pnMin); diff --git a/jan/src/burn/drv/midway/d_kinst.cpp b/jan/src/burn/drv/midway/d_kinst.cpp deleted file mode 100644 index 6126ce3cc..000000000 --- a/jan/src/burn/drv/midway/d_kinst.cpp +++ /dev/null @@ -1,584 +0,0 @@ -// Based on MAME driver by Aaron Giles - -#include "driver.h" -#include "burnint.h" -#include "mips3_intf.h" -#include "ide.h" -#include "dcs2k.h" -#include - -#define IDE_IRQ 1 -#define VBLANK_IRQ 0 - -#define KINST 0x100000 -#define KINST2 0x200000 - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvBootROM; -static UINT8 *DrvRAM0; -static UINT8 *DrvRAM1; -static UINT8 *DrvSoundROM; -static UINT8 DrvRecalc; -static UINT8 DrvJoy1[32]; -static UINT8 DrvJoy2[32]; -static UINT8 DrvDSW[8]; -static UINT32 DrvVRAMBase; -static UINT32 DrvInputs[3]; -static UINT32 nSoundData; -static UINT32 nSoundCtrl; -static ide::ide_disk *DrvDisk; - -// Fast conversion from BGR555 to RGB565 -static UINT16 *DrvColorLUT; - -static struct BurnInputInfo kinstInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 10, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 8, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 9, "p1 right" }, - {"P1 Button A", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button B", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - {"P1 Button C", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 3" }, - {"P1 Button X", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 4" }, - {"P1 Button Y", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 5" }, - {"P1 Button Z", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 6" }, - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 11, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 10, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 8, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 9, "p2 right" }, - {"P2 Button A", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1" }, - {"P2 Button B", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2" }, - {"P2 Button C", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 3" }, - {"P2 Button X", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 4" }, - {"P2 Button Y", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 5" }, - {"P2 Button Z", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 6" }, - {"Test", BIT_DIGITAL, DrvDSW + 0, "diag" }, -}; - -STDINPUTINFO(kinst) - -static struct BurnDIPInfo kinstDIPList[1]= -{ -}; - -STDDIPINFO(kinst) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvBootROM = Next; Next += 0x80000; - AllRam = Next; - DrvRAM0 = Next; Next += 0x80000; - DrvRAM1 = Next; Next += 0x800000; - DrvSoundROM = Next; Next += 0x1000000; - DrvColorLUT = (UINT16*) Next; Next += 0x8000 * sizeof(UINT16); - - RamEnd = Next; - MemEnd = Next; - return 0; -} - - -#define RGB888(b,g,r) ((r) | ((g) << 8) | ((b) << 16)) -#define RGB888_r(x) ((x) & 0xFF) -#define RGB888_g(x) (((x) >> 8) & 0xFF) -#define RGB888_b(x) (((x) >> 16) & 0xFF) - -#define RGB555_2_888(x) \ - RGB888((x >> 7) & 0xF8, \ - (x >> 2) & 0xF8, \ - (x << 3) & 0xF8) - -#define RGB888_2_565(x) ( \ - ((RGB888_r(x) << 8) & 0xF800) | \ - ((RGB888_g(x) << 3) & 0x07E0) | \ - ((RGB888_b(x) >> 3))) - -static void GenerateColorLUT() -{ - for (int i = 0; i < 0x8000; i++) { - //UINT16 x = i; - DrvColorLUT[i] = RGB888_2_565(RGB555_2_888(i)); - } -} - -static void IDESetIRQState(int state) -{ - Mips3SetIRQLine(IDE_IRQ, state); -} - -static UINT32 ideRead(UINT32 address) -{ - if (address >= 0x10000100 && address <= 0x1000013f) - return DrvDisk->read((address - 0x10000100) / 8); - - if (address >= 0x10000170 && address <= 0x10000173) - return DrvDisk->read_alternate(6); - return 0; -} - -static void ideWrite(UINT32 address, UINT32 value) -{ - if (address >= 0x10000100 && address <= 0x1000013f) { - DrvDisk->write((address - 0x10000100) / 8, value); - return; - } - - if (address >= 0x10000170 && address <= 0x10000173) { - DrvDisk->write_alternate(6, value); - return; - } -} - -static UINT32 kinstRead(UINT32 address) -{ - UINT32 tmp; - if (address >= 0x10000080 && address <= 0x100000ff) { - switch (address & 0xFF) { - case 0x90: - tmp = ~2; - if (Dcs2kDataRead() & 0x800) - tmp |= 2; - return tmp; - case 0x98: - return nSoundData; - - case 0x80: - return ~DrvInputs[0]; - case 0x88: - return ~DrvInputs[1]; - case 0xA0: - return ~DrvInputs[2] & ~0x00003e00; - } - return ~0; - } - - if (address >= 0x10000100 && address <= 0x10000173) { - return ideRead(address); - } - - - printf("Invalid read %08X\n", address); - return ~0; -} - -static UINT32 kinst2Read(UINT32 address) -{ - UINT32 tmp; - if (address >= 0x10000080 && address <= 0x100000ff) { - switch (address & 0xFF) { - case 0x80: - tmp = ~2; - if (Dcs2kDataRead() & 0x800) - tmp |= 2; - return tmp; - case 0xA0: - return nSoundData; - - case 0x98: - return ~DrvInputs[0]; - case 0x90: - return ~DrvInputs[1]; - case 0x88: - return ~DrvInputs[2] & ~0x00003e00; - } - return ~0; - } - - if (address >= 0x10000100 && address <= 0x10000173) { - return ideRead(address); - } - - - printf("Invalid read %08X\n", address); - return ~0; -} - - -static void kinstWrite(UINT32 address, UINT64 value) -{ - if (address >= 0x10000080 && address <= 0x100000ff) { - switch (address & 0xFF) { - case 0x80: - DrvVRAMBase = (value & 4) ? 0x58000 : 0x30000; - break; - case 0x88: - Dcs2kResetWrite(~value & 1); - break; - case 0x90: { - UINT32 old = nSoundCtrl; - nSoundCtrl = value; - if (!(old & 2) && (nSoundCtrl & 2)) { - Dcs2kDataWrite(nSoundData); - } - break; - } - case 0x98: - nSoundData = value; - break; - } - return; - } - - if (address >= 0x10000100 && address <= 0x10000173) { - ideWrite(address, value); - return; - } - -} - - -static void kinst2Write(UINT32 address, UINT64 value) -{ - if (address >= 0x10000080 && address <= 0x100000ff) { - switch (address & 0xFF) { - case 0x98: - DrvVRAMBase = (value & 4) ? 0x58000 : 0x30000; - break; - case 0x90: - Dcs2kResetWrite(~value & 1); - break; - case 0x80: { - UINT32 old = nSoundCtrl; - nSoundCtrl = value; - if (!(old & 2) && (nSoundCtrl & 2)) { - Dcs2kDataWrite(nSoundData); - } - break; - } - case 0xA0: - nSoundData = value; - break; - } - return; - } - - if (address >= 0x10000100 && address <= 0x10000173) { - ideWrite(address, value); - return; - } - -} - -static void kinstWriteByte(UINT32 address, UINT8 value) { kinstWrite(address, value); } -static void kinstWriteHalf(UINT32 address, UINT16 value) { kinstWrite(address, value); } -static void kinstWriteWord(UINT32 address, UINT32 value) { kinstWrite(address, value); } -static void kinstWriteDouble(UINT32 address, UINT64 value) { kinstWrite(address, value); } - -static UINT8 kinstReadByte(UINT32 address) { return kinstRead(address); } -static UINT16 kinstReadHalf(UINT32 address) { return kinstRead(address); } -static UINT32 kinstReadWord(UINT32 address) { return kinstRead(address); } -static UINT64 kinstReadDouble(UINT32 address) { return kinstRead(address); } - -static void kinst2WriteByte(UINT32 address, UINT8 value) { kinst2Write(address, value); } -static void kinst2WriteHalf(UINT32 address, UINT16 value) { kinst2Write(address, value); } -static void kinst2WriteWord(UINT32 address, UINT32 value) { kinst2Write(address, value); } -static void kinst2WriteDouble(UINT32 address, UINT64 value) { kinst2Write(address, value); } - -static UINT8 kinst2ReadByte(UINT32 address) { return kinst2Read(address); } -static UINT16 kinst2ReadHalf(UINT32 address) { return kinst2Read(address); } -static UINT32 kinst2ReadWord(UINT32 address) { return kinst2Read(address); } -static UINT64 kinst2ReadDouble(UINT32 address) { return kinst2Read(address); } - -static void MakeInputs() -{ - DrvInputs[0] = 0; - DrvInputs[1] = 0; - - for (int i = 0; i < 12; i++) { - if (DrvJoy1[i] & 1) - DrvInputs[0] |= (1 << i); - if (DrvJoy2[i] & 1) - DrvInputs[1] |= (1 << i); - } - - if (DrvDSW[0] & 1) - DrvInputs[2] ^= 0x08000; -} - -static INT32 LoadSoundBanks() -{ - memset(DrvSoundROM, 0xFF, 0x1000000); - if (BurnLoadRom(DrvSoundROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0x200000, 2, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0x400000, 3, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0x600000, 4, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0x800000, 5, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0xA00000, 6, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0xC00000, 7, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0xE00000, 8, 2)) return 1; - return 0; -} - -static INT32 kinstSetup() -{ - printf("kinst: loading image at kinst.img\n"); - // FIXME: - if (!DrvDisk->load_disk_image("hdd/kinst.img")) { - printf("kinst: harddisk image not found!"); - return 1; - } - - Mips3SetReadByteHandler(1, kinstReadByte); - Mips3SetReadHalfHandler(1, kinstReadHalf); - Mips3SetReadWordHandler(1, kinstReadWord); - Mips3SetReadDoubleHandler(1, kinstReadDouble); - - Mips3SetWriteByteHandler(1, kinstWriteByte); - Mips3SetWriteHalfHandler(1, kinstWriteHalf); - Mips3SetWriteWordHandler(1, kinstWriteWord); - Mips3SetWriteDoubleHandler(1, kinstWriteDouble); - - Mips3MapHandler(1, 0x10000000, 0x100001FF, MAP_READ | MAP_WRITE); - - return 0; -} - -static INT32 kinst2Setup() -{ - printf("kinst: loading image at kinst2.img\n"); - // FIXME: - if (!DrvDisk->load_disk_image("hdd/kinst2.img")) { - printf("kinst: harddisk image not found!"); - return 1; - } - - Mips3SetReadByteHandler(1, kinst2ReadByte); - Mips3SetReadHalfHandler(1, kinst2ReadHalf); - Mips3SetReadWordHandler(1, kinst2ReadWord); - Mips3SetReadDoubleHandler(1, kinst2ReadDouble); - - Mips3SetWriteByteHandler(1, kinst2WriteByte); - Mips3SetWriteHalfHandler(1, kinst2WriteHalf); - Mips3SetWriteWordHandler(1, kinst2WriteWord); - Mips3SetWriteDoubleHandler(1, kinst2WriteDouble); - - Mips3MapHandler(1, 0x10000000, 0x100001FF, MAP_READ | MAP_WRITE); - - return 0; -} - -static INT32 DrvInit(int version) -{ - printf("kinst: DrvInit\n"); - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) - return 1; - - DrvDisk = new ide::ide_disk(); - DrvDisk->set_irq_callback(IDESetIRQState); - - MemIndex(); - - GenerateColorLUT(); - - UINT32 nRet = BurnLoadRom(DrvBootROM, 0, 0); - if (nRet != 0) - return 1; - - nRet = LoadSoundBanks(); - if (nRet != 0) - return 1; - - Dcs2kInit(); - -#ifdef MIPS3_X64_DRC - Mips3UseRecompiler(true); -#endif - Mips3Init(); - Mips3Reset(); - - DrvVRAMBase = 0x30000; - - Mips3MapMemory(DrvBootROM, 0x1FC00000, 0x1FC7FFFF, MAP_READ); - Mips3MapMemory(DrvRAM0, 0x00000000, 0x0007FFFF, MAP_RAM); - Mips3MapMemory(DrvRAM1, 0x08000000, 0x087FFFFF, MAP_RAM); - - switch (version) { - case KINST: - kinstSetup(); - break; - case KINST2: - kinst2Setup(); - break; - } - - - Dcs2kMapSoundROM(DrvSoundROM, 0x1000000); - Dcs2kBoot(); - - DrvInputs[2] = 0; - - nSoundData = 0; - nSoundCtrl = 0; - - return 0; -} - -static INT32 kinstDrvInit() { return DrvInit(KINST); } -static INT32 kinst2DrvInit() { return DrvInit(KINST2); } - -static INT32 DrvExit() -{ - Dcs2kExit(); - delete DrvDisk; - printf("kinst: DrvExit\n"); - Mips3Exit(); - BurnFree(AllMem); - return 0; -} - -static INT32 DrvDraw() -{ - UINT16 *src = (UINT16*) &DrvRAM0[DrvVRAMBase]; - - for (int y = 0; y < 240; y++) { - UINT16 *dst = (UINT16*) pBurnDraw + (y * 320); - - for (int x = 0; x < 320; x++) { - *dst = DrvColorLUT[*src & 0x7FFF]; - dst++; - src++; - } - } - return 0; -} - -#define MHz(x) (x * 1000000) -#define kHz(x) (x * 1000) - -// R4600: 100 MHz -// VIDEO: 60 Hz -// VBLANK: 20 kHz, 50us (from MAME)) -// 50us = 20kHz -// -static INT32 DrvFrame() -{ - MakeInputs(); - - const long FPS = 60; - const long nMipsCycPerFrame = MHz(100) / FPS; - const long nMipsVblankCyc = nMipsCycPerFrame - kHz(20); - const long nDcsCycPerFrame = MHz(10) / FPS; - - long nNextMipsSegment = 0; - long nNextDcsSegment = 0; - - long nMipsTotalCyc = 0; - long nDcsTotalCyc = 0; - - // mips 100MHz -> dcs 10MHz => 10:1 - const long mQuantum = kHz(10); - const long dQuantum = kHz(1); - - nNextMipsSegment = mQuantum; - nNextDcsSegment = dQuantum; - - Mips3SetIRQLine(VBLANK_IRQ, 0); - - bool isVblank = false; - - while ((nMipsTotalCyc < nMipsCycPerFrame) || (nDcsTotalCyc < nDcsCycPerFrame)) - { - if ((nNextMipsSegment + nMipsTotalCyc) > nMipsCycPerFrame) - nNextMipsSegment -= (nNextMipsSegment + nMipsTotalCyc) - nMipsCycPerFrame; - - if ((nNextDcsSegment + nDcsTotalCyc) > nDcsCycPerFrame) - nNextDcsSegment -= (nNextDcsSegment + nDcsTotalCyc) - nDcsCycPerFrame; - - if (!isVblank) { - if ((nNextMipsSegment + nMipsTotalCyc) >= nMipsVblankCyc) { - nNextMipsSegment -= (nNextMipsSegment + nMipsTotalCyc) - nMipsVblankCyc; - } - if (nMipsTotalCyc == nMipsVblankCyc) { - isVblank = true; - Mips3SetIRQLine(VBLANK_IRQ, 1); - if (pBurnDraw) { - DrvDraw(); - } - } - } - if (nNextMipsSegment) { - Mips3Run(nNextMipsSegment); - nMipsTotalCyc += nNextMipsSegment; - } - if (nNextDcsSegment) { - Dcs2kRun(nNextDcsSegment); - nDcsTotalCyc += nNextDcsSegment; - } - - nNextDcsSegment = dQuantum; - nNextMipsSegment = mQuantum; - } - if (pBurnSoundOut) { - Dcs2kRender(pBurnSoundOut, nBurnSoundLen); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - return 0; -} -static struct BurnRomInfo kinstRomDesc[] = { - { "ki-l15d.u98", 0x80000, 0x7b65ca3d, 1 | BRF_PRG | BRF_ESS }, // 0 MIPS R4600 Code - - { "u10-l1", 0x80000, 0xb6cc155f, 2 | BRF_SND | BRF_ESS }, // 1 DCS sound banks - { "u11-l1", 0x80000, 0x0b5e05df, 2 | BRF_SND | BRF_ESS }, // 2 - { "u12-l1", 0x80000, 0xd05ce6ad, 2 | BRF_SND | BRF_ESS }, // 3 - { "u13-l1", 0x80000, 0x7d0954ea, 2 | BRF_SND | BRF_ESS }, // 4 - { "u33-l1", 0x80000, 0x8bbe4f0c, 2 | BRF_SND | BRF_ESS }, // 5 - { "u34-l1", 0x80000, 0xb2e73603, 2 | BRF_SND | BRF_ESS }, // 6 - { "u35-l1", 0x80000, 0x0aaef4fc, 2 | BRF_SND | BRF_ESS }, // 7 - { "u36-l1", 0x80000, 0x0577bb60, 2 | BRF_SND | BRF_ESS }, // 8 -}; - -STD_ROM_PICK(kinst) -STD_ROM_FN(kinst) - -struct BurnDriver BurnDrvKinst = { - "kinst", NULL, NULL, NULL, "1994/1995", - "Killer Instinct (ver. 1.5)\0", NULL, "Rare/Nintendo", "MIDWAY", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, kinstRomInfo, kinstRomName, NULL, NULL, kinstInputInfo, kinstDIPInfo, - kinstDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 320, 240, 4, 3 -}; - -static struct BurnRomInfo kinst2RomDesc[] = { - { "ki2-l14.u98", 0x80000, 0x27d0285e, 1 | BRF_PRG | BRF_ESS }, // 0 MIPS R4600 Code - { "ki2_l1.u10", 0x80000, 0xfdf6ed51, 2 | BRF_SND | BRF_ESS }, // 1 DCS sound banks - { "ki2_l1.u11", 0x80000, 0xf9e70024, 2 | BRF_SND | BRF_ESS }, // 2 - { "ki2_l1.u12", 0x80000, 0x2994c199, 2 | BRF_SND | BRF_ESS }, // 3 - { "ki2_l1.u13", 0x80000, 0x3fe6327b, 2 | BRF_SND | BRF_ESS }, // 4 - { "ki2_l1.u33", 0x80000, 0x6f4dcdcf, 2 | BRF_SND | BRF_ESS }, // 5 - { "ki2_l1.u34", 0x80000, 0x5db48206, 2 | BRF_SND | BRF_ESS }, // 6 - { "ki2_l1.u35", 0x80000, 0x7245ce69, 2 | BRF_SND | BRF_ESS }, // 7 - { "ki2_l1.u36", 0x80000, 0x8920acbb, 2 | BRF_SND | BRF_ESS }, // 8 -}; - -STD_ROM_PICK(kinst2) -STD_ROM_FN(kinst2) - -struct BurnDriver BurnDrvKinst2 = { - "kinst2", NULL, NULL, NULL, "1994/1995", - "Killer Instinct II (ver. 1.4)\0", NULL, "Rare/Nintendo", "MIDWAY", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, kinst2RomInfo, kinst2RomName, NULL, NULL, kinstInputInfo, kinstDIPInfo, - kinst2DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 320, 240, 4, 3 -}; - diff --git a/jan/src/burn/drv/midway/d_wunit.cpp b/jan/src/burn/drv/midway/d_wunit.cpp deleted file mode 100644 index fd8eb296c..000000000 --- a/jan/src/burn/drv/midway/d_wunit.cpp +++ /dev/null @@ -1,1279 +0,0 @@ -// Based on MAME driver by Alex Pasadyn, Zsolt Vasvari, Ernesto Corvi, Aaron Giles - -#include "driver.h" -#include "burnint.h" -#include "midwunit.h" - -static UINT8 DrvReset = 0; // needs hooked-up :) - -static struct BurnInputInfo Mk3InputList[] = { - {"P1 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, nWolfUnitJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, nWolfUnitJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, nWolfUnitJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, nWolfUnitJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, nWolfUnitJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, nWolfUnitJoy2 + 0, "p1 fire 4"}, - {"P1 Button 5", BIT_DIGITAL, nWolfUnitJoy2 + 1, "p1 fire 5"}, - {"P1 Button 6", BIT_DIGITAL, nWolfUnitJoy2 + 2, "p1 fire 6"}, - - {"P2 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, nWolfUnitJoy3 + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, nWolfUnitJoy1 + 8, "p2 up"}, - {"P2 Down", BIT_DIGITAL, nWolfUnitJoy1 + 9, "p2 down"}, - {"P2 Left", BIT_DIGITAL, nWolfUnitJoy1 + 10, "p2 left"}, - {"P2 Right", BIT_DIGITAL, nWolfUnitJoy1 + 11, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 12, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 13, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 14, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, nWolfUnitJoy2 + 4, "p2 fire 4"}, - {"P2 Button 5", BIT_DIGITAL, nWolfUnitJoy2 + 5, "p2 fire 5"}, - {"P2 Button 6", BIT_DIGITAL, nWolfUnitJoy2 + 6, "p2 fire 6"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, nWolfUnitJoy3 + 6, "service"}, - {"Tilt", BIT_DIGITAL, nWolfUnitJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, nWolfUnitDSW + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, nWolfUnitDSW + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, nWolfUnitDSW + 2, "dip"}, - {"Dip D", BIT_DIPSWITCH, nWolfUnitDSW + 3, "dip"}, - {"Dip E", BIT_DIPSWITCH, nWolfUnitDSW + 4, "dip"}, -}; - -STDINPUTINFO(Mk3) - - -static struct BurnDIPInfo Mk3DIPList[]= -{ - {0x1b, 0xff, 0xff, 0x7d, NULL }, - {0x1c, 0xff, 0xff, 0x04, NULL }, - {0x1d, 0xff, 0xff, 0x10, NULL }, - {0x1e, 0xff, 0xff, 0xc0, NULL }, - {0x1f, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2, "Test Switch" }, - {0x1b, 0x01, 0x01, 0x01, "Off" }, - {0x1b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Counters" }, - {0x1b, 0x01, 0x02, 0x02, "One" }, - {0x1b, 0x01, 0x02, 0x00, "Two" }, - - {0 , 0xfe, 0 , 19, "Coinage" }, - {0x1b, 0x01, 0x7c, 0x7c, "USA-1" }, - {0x1b, 0x01, 0x7c, 0x3c, "USA-2" }, - {0x1b, 0x01, 0x7c, 0x5c, "USA-3" }, - {0x1b, 0x01, 0x7c, 0x1c, "USA-4" }, - {0x1b, 0x01, 0x7c, 0x6c, "USA-ECA" }, - {0x1b, 0x01, 0x7c, 0x0c, "USA-Free Play" }, - {0x1b, 0x01, 0x7c, 0x74, "German-1" }, - {0x1b, 0x01, 0x7c, 0x34, "German-2" }, - {0x1b, 0x01, 0x7c, 0x54, "German-3" }, - {0x1b, 0x01, 0x7c, 0x14, "German-4" }, - {0x1b, 0x01, 0x7c, 0x64, "German-5" }, - {0x1b, 0x01, 0x7c, 0x24, "German-ECA" }, - {0x1b, 0x01, 0x7c, 0x04, "German-Free Play" }, - {0x1b, 0x01, 0x7c, 0x78, "French-1" }, - {0x1b, 0x01, 0x7c, 0x38, "French-2" }, - {0x1b, 0x01, 0x7c, 0x58, "French-3" }, - {0x1b, 0x01, 0x7c, 0x18, "French-4" }, - {0x1b, 0x01, 0x7c, 0x68, "French-ECA" }, - {0x1b, 0x01, 0x7c, 0x08, "French-Free Play" }, - - {0 , 0xfe, 0 , 2, "Coinage Source" }, - {0x1b, 0x01, 0x80, 0x80, "Dipswitch" }, - {0x1b, 0x01, 0x80, 0x00, "CMOS" }, - - {0 , 0xfe, 0 , 2, "Powerup Test" }, - {0x1c, 0x01, 0x02, 0x00, "Off" }, - {0x1c, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Bill Validator" }, - {0x1c, 0x01, 0x04, 0x04, "Off" }, - {0x1c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Attract Sound" }, - {0x1c, 0x01, 0x10, 0x00, "Off" }, - {0x1c, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Blood" }, - {0x1c, 0x01, 0x40, 0x00, "Off" }, - {0x1c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Violence" }, - {0x1c, 0x01, 0x80, 0x00, "Off" }, - {0x1c, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 1, "Service Mode (No Toggle)" }, - {0x1d, 0x01, 0x10, 0x10, "Off" }, -}; - -STDDIPINFO(Mk3) - -static struct BurnInputInfo OpeniceInputList[] = { - {"P1 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, nWolfUnitJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, nWolfUnitJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, nWolfUnitJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, nWolfUnitJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, nWolfUnitJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 4, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 5, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, nWolfUnitJoy3 + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, nWolfUnitJoy1 + 8, "p2 up"}, - {"P2 Down", BIT_DIGITAL, nWolfUnitJoy1 + 9, "p2 down"}, - {"P2 Left", BIT_DIGITAL, nWolfUnitJoy1 + 10, "p2 left"}, - {"P2 Right", BIT_DIGITAL, nWolfUnitJoy1 + 11, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 14, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 12, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 13, "p2 fire 3"}, - - {"P3 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 7, "p3 coin"}, - {"P3 Start", BIT_DIGITAL, nWolfUnitJoy3 + 9, "p3 start"}, - {"P3 Up", BIT_DIGITAL, nWolfUnitJoy2 + 0, "p3 up"}, - {"P3 Down", BIT_DIGITAL, nWolfUnitJoy2 + 1, "p3 down"}, - {"P3 Left", BIT_DIGITAL, nWolfUnitJoy2 + 2, "p3 left"}, - {"P3 Right", BIT_DIGITAL, nWolfUnitJoy2 + 3, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, nWolfUnitJoy2 + 6, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, nWolfUnitJoy2 + 4, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, nWolfUnitJoy2 + 5, "p3 fire 3"}, - - {"P4 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 8, "p4 coin"}, - {"P4 Start", BIT_DIGITAL, nWolfUnitJoy3 + 10, "p4 start"}, - {"P4 Up", BIT_DIGITAL, nWolfUnitJoy2 + 8, "p4 up"}, - {"P4 Down", BIT_DIGITAL, nWolfUnitJoy2 + 9, "p4 down"}, - {"P4 Left", BIT_DIGITAL, nWolfUnitJoy2 + 10, "p4 left"}, - {"P4 Right", BIT_DIGITAL, nWolfUnitJoy2 + 11, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, nWolfUnitJoy2 + 14, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, nWolfUnitJoy2 + 12, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, nWolfUnitJoy2 + 13, "p4 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, nWolfUnitJoy3 + 6, "service"}, - {"Tilt", BIT_DIGITAL, nWolfUnitJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, nWolfUnitDSW + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, nWolfUnitDSW + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, nWolfUnitDSW + 2, "dip"}, - {"Dip D", BIT_DIPSWITCH, nWolfUnitDSW + 3, "dip"}, -}; - -STDINPUTINFO(Openice) - - -static struct BurnDIPInfo OpeniceDIPList[]= -{ - {0x27, 0xff, 0xff, 0xbe, NULL }, - {0x28, 0xff, 0xff, 0x0b, NULL }, - {0x29, 0xff, 0xff, 0x80, NULL }, - {0x2a, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2, "Coinage Source" }, - {0x27, 0x01, 0x01, 0x01, "Dipswitch" }, - {0x27, 0x01, 0x01, 0x00, "CMOS" }, - - {0 , 0xfe, 0 , 23, "Coinage" }, - {0x27, 0x01, 0x3e, 0x3e, "USA-1" }, - {0x27, 0x01, 0x3e, 0x3c, "USA-2" }, - {0x27, 0x01, 0x3e, 0x3a, "USA-3" }, - {0x27, 0x01, 0x3e, 0x38, "USA-4" }, - {0x27, 0x01, 0x3e, 0x34, "USA-9" }, - {0x27, 0x01, 0x3e, 0x32, "USA-10" }, - {0x27, 0x01, 0x3e, 0x36, "USA-ECA" }, - {0x27, 0x01, 0x3e, 0x30, "USA-Free Play" }, - {0x27, 0x01, 0x3e, 0x2e, "German-1" }, - {0x27, 0x01, 0x3e, 0x2c, "German-2" }, - {0x27, 0x01, 0x3e, 0x2a, "German-3" }, - {0x27, 0x01, 0x3e, 0x28, "German-4" }, - {0x27, 0x01, 0x3e, 0x24, "German-5" }, - {0x27, 0x01, 0x3e, 0x26, "German-ECA" }, - {0x27, 0x01, 0x3e, 0x20, "German-Free Play" }, - {0x27, 0x01, 0x3e, 0x1e, "French-1" }, - {0x27, 0x01, 0x3e, 0x1c, "French-2" }, - {0x27, 0x01, 0x3e, 0x1a, "French-3" }, - {0x27, 0x01, 0x3e, 0x18, "French-4" }, - {0x27, 0x01, 0x3e, 0x14, "French-11" }, - {0x27, 0x01, 0x3e, 0x12, "French-12" }, - {0x27, 0x01, 0x3e, 0x16, "French-ECA" }, - {0x27, 0x01, 0x3e, 0x10, "French-Free Play" }, - - {0 , 0xfe, 0 , 2, "Counters" }, - {0x27, 0x01, 0x40, 0x40, "One" }, - {0x27, 0x01, 0x40, 0x00, "Two" }, - - {0 , 0xfe, 0 , 2, "Bill Validator" }, - {0x28, 0x01, 0x01, 0x01, "Off" }, - {0x28, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Attract Sound" }, - {0x28, 0x01, 0x02, 0x00, "Off" }, - {0x28, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Powerup Test" }, - {0x28, 0x01, 0x04, 0x00, "Off" }, - {0x28, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Head Size" }, - {0x28, 0x01, 0x08, 0x08, "Normal" }, - {0x28, 0x01, 0x08, 0x00, "Large" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x28, 0x01, 0x10, 0x00, "2-player" }, - {0x28, 0x01, 0x10, 0x10, "4-player" }, - - {0 , 0xfe, 0 , 2, "Test Switch" }, - {0x28, 0x01, 0x80, 0x80, "Off" }, - {0x28, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 1, "Service Mode (No Toggle)" }, - {0x29, 0x01, 0x10, 0x10, "Off" }, -}; - -STDDIPINFO(Openice) - -static struct BurnInputInfo NbahangtInputList[] = { - {"P1 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, nWolfUnitJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, nWolfUnitJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, nWolfUnitJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, nWolfUnitJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, nWolfUnitJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 4, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 5, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, nWolfUnitJoy3 + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, nWolfUnitJoy1 + 8, "p2 up"}, - {"P2 Down", BIT_DIGITAL, nWolfUnitJoy1 + 9, "p2 down"}, - {"P2 Left", BIT_DIGITAL, nWolfUnitJoy1 + 10, "p2 left"}, - {"P2 Right", BIT_DIGITAL, nWolfUnitJoy1 + 11, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 14, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 12, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 13, "p2 fire 3"}, - - {"P3 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 7, "p3 coin"}, - {"P3 Start", BIT_DIGITAL, nWolfUnitJoy3 + 9, "p3 start"}, - {"P3 Up", BIT_DIGITAL, nWolfUnitJoy2 + 0, "p3 up"}, - {"P3 Down", BIT_DIGITAL, nWolfUnitJoy2 + 1, "p3 down"}, - {"P3 Left", BIT_DIGITAL, nWolfUnitJoy2 + 2, "p3 left"}, - {"P3 Right", BIT_DIGITAL, nWolfUnitJoy2 + 3, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, nWolfUnitJoy2 + 6, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, nWolfUnitJoy2 + 4, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, nWolfUnitJoy2 + 5, "p3 fire 3"}, - - {"P4 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 8, "p4 coin"}, - {"P4 Start", BIT_DIGITAL, nWolfUnitJoy3 + 10, "p4 start"}, - {"P4 Up", BIT_DIGITAL, nWolfUnitJoy2 + 8, "p4 up"}, - {"P4 Down", BIT_DIGITAL, nWolfUnitJoy2 + 9, "p4 down"}, - {"P4 Left", BIT_DIGITAL, nWolfUnitJoy2 + 10, "p4 left"}, - {"P4 Right", BIT_DIGITAL, nWolfUnitJoy2 + 11, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, nWolfUnitJoy2 + 14, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, nWolfUnitJoy2 + 12, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, nWolfUnitJoy2 + 13, "p4 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, nWolfUnitJoy3 + 6, "service"}, - {"Tilt", BIT_DIGITAL, nWolfUnitJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, nWolfUnitDSW + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, nWolfUnitDSW + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, nWolfUnitDSW + 2, "dip"}, -}; - -STDINPUTINFO(Nbahangt) - - -static struct BurnDIPInfo NbahangtDIPList[]= -{ - {0x27, 0xff, 0xff, 0x7d, NULL }, - {0x28, 0xff, 0xff, 0x7f, NULL }, - {0x29, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2, "Test Switch" }, - {0x27, 0x01, 0x01, 0x01, "Off" }, - {0x27, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Powerup Test" }, - {0x27, 0x01, 0x02, 0x00, "Off" }, - {0x27, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Bill Validator" }, - {0x27, 0x01, 0x40, 0x40, "Off" }, - {0x27, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x27, 0x01, 0x80, 0x00, "2-player" }, - {0x27, 0x01, 0x80, 0x80, "4-player" }, - - {0 , 0xfe, 0 , 3, "Counters" }, - {0x28, 0x01, 0x03, 0x03, "One, 1/1" }, - {0x28, 0x01, 0x03, 0x02, "One, Totalizing" }, - {0x28, 0x01, 0x03, 0x01, "Two, 1/1" }, - - {0 , 0xfe, 0 , 3, "Country" }, - {0x28, 0x01, 0x0c, 0x0c, "USA" }, - {0x28, 0x01, 0x0c, 0x08, "French" }, - {0x28, 0x01, 0x0c, 0x04, "German" }, - - {0 , 0xfe, 0 , 6, "Coinage" }, - {0x28, 0x01, 0x70, 0x70, "1" }, - {0x28, 0x01, 0x70, 0x30, "2" }, - {0x28, 0x01, 0x70, 0x50, "3" }, - {0x28, 0x01, 0x70, 0x10, "4" }, - {0x28, 0x01, 0x70, 0x60, "ECA" }, - {0x28, 0x01, 0x70, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Coinage Source" }, - {0x28, 0x01, 0x80, 0x80, "Dipswitch" }, - {0x28, 0x01, 0x80, 0x00, "CMOS" }, - - {0 , 0xfe, 0 , 1, "Service Mode (No Toggle)" }, - {0x29, 0x01, 0x10, 0x10, "Off" }, -}; - -STDDIPINFO(Nbahangt) - -static struct BurnInputInfo RmpgwtInputList[] = { - {"P1 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, nWolfUnitJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, nWolfUnitJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, nWolfUnitJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, nWolfUnitJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, nWolfUnitJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 4, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 5, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, nWolfUnitJoy3 + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, nWolfUnitJoy1 + 8, "p2 up"}, - {"P2 Down", BIT_DIGITAL, nWolfUnitJoy1 + 9, "p2 down"}, - {"P2 Left", BIT_DIGITAL, nWolfUnitJoy1 + 10, "p2 left"}, - {"P2 Right", BIT_DIGITAL, nWolfUnitJoy1 + 11, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 14, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 12, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 13, "p2 fire 3"}, - - {"P3 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 7, "p3 coin"}, - {"P3 Start", BIT_DIGITAL, nWolfUnitJoy3 + 9, "p3 start"}, - {"P3 Up", BIT_DIGITAL, nWolfUnitJoy2 + 0, "p3 up"}, - {"P3 Down", BIT_DIGITAL, nWolfUnitJoy2 + 1, "p3 down"}, - {"P3 Left", BIT_DIGITAL, nWolfUnitJoy2 + 2, "p3 left"}, - {"P3 Right", BIT_DIGITAL, nWolfUnitJoy2 + 3, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, nWolfUnitJoy2 + 6, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, nWolfUnitJoy2 + 4, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, nWolfUnitJoy2 + 5, "p3 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, nWolfUnitJoy3 + 6, "service"}, - {"Tilt", BIT_DIGITAL, nWolfUnitJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, nWolfUnitDSW + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, nWolfUnitDSW + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, nWolfUnitDSW + 2, "dip"}, - {"Dip D", BIT_DIPSWITCH, nWolfUnitDSW + 3, "dip"}, - {"Dip E", BIT_DIPSWITCH, nWolfUnitDSW + 4, "dip"}, -}; - -STDINPUTINFO(Rmpgwt) - - -static struct BurnDIPInfo RmpgwtDIPList[]= -{ - {0x1e, 0xff, 0xff, 0xbe, NULL }, - {0x1f, 0xff, 0xff, 0x01, NULL }, - {0x20, 0xff, 0xff, 0x00, NULL }, - {0x21, 0xff, 0xff, 0x80, NULL }, - {0x22, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2, "Coinage Source" }, - {0x1e, 0x01, 0x01, 0x01, "Dipswitch" }, - {0x1e, 0x01, 0x01, 0x00, "CMOS" }, - - {0 , 0xfe, 0 , 23, "Coinage" }, - {0x1e, 0x01, 0x3e, 0x3e, "USA-1" }, - {0x1e, 0x01, 0x3e, 0x3c, "USA-2" }, - {0x1e, 0x01, 0x3e, 0x3a, "USA-3" }, - {0x1e, 0x01, 0x3e, 0x38, "USA-4" }, - {0x1e, 0x01, 0x3e, 0x34, "USA-9" }, - {0x1e, 0x01, 0x3e, 0x32, "USA-10" }, - {0x1e, 0x01, 0x3e, 0x36, "USA-ECA" }, - {0x1e, 0x01, 0x3e, 0x30, "USA-Free Play" }, - {0x1e, 0x01, 0x3e, 0x2e, "German-1" }, - {0x1e, 0x01, 0x3e, 0x2c, "German-2" }, - {0x1e, 0x01, 0x3e, 0x2a, "German-3" }, - {0x1e, 0x01, 0x3e, 0x28, "German-4" }, - {0x1e, 0x01, 0x3e, 0x24, "German-5" }, - {0x1e, 0x01, 0x3e, 0x26, "German-ECA" }, - {0x1e, 0x01, 0x3e, 0x20, "German-Free Play" }, - {0x1e, 0x01, 0x3e, 0x1e, "French-1" }, - {0x1e, 0x01, 0x3e, 0x1c, "French-2" }, - {0x1e, 0x01, 0x3e, 0x1a, "French-3" }, - {0x1e, 0x01, 0x3e, 0x18, "French-4" }, - {0x1e, 0x01, 0x3e, 0x14, "French-11" }, - {0x1e, 0x01, 0x3e, 0x12, "French-12" }, - {0x1e, 0x01, 0x3e, 0x16, "French-ECA" }, - {0x1e, 0x01, 0x3e, 0x10, "French-Free Play" }, - - {0 , 0xfe, 0 , 2, "Counters" }, - {0x1e, 0x01, 0x40, 0x40, "One" }, - {0x1e, 0x01, 0x40, 0x00, "Two" }, - - {0 , 0xfe, 0 , 2, "Bill Validator" }, - {0x1f, 0x01, 0x01, 0x01, "Off" }, - {0x1f, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Powerup Test" }, - {0x1f, 0x01, 0x04, 0x00, "Off" }, - {0x1f, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Test Switch" }, - {0x1f, 0x01, 0x80, 0x80, "Off" }, - {0x1f, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode (No Toggle)" }, - {0x20, 0x01, 0x10, 0x10, "Off" }, -}; - -STDDIPINFO(Rmpgwt) - -static struct BurnInputInfo WwfmaniaInputList[] = { - {"P1 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, nWolfUnitJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, nWolfUnitJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, nWolfUnitJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, nWolfUnitJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, nWolfUnitJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, nWolfUnitJoy2 + 0, "p1 fire 4"}, - {"P1 Button 5", BIT_DIGITAL, nWolfUnitJoy2 + 1, "p1 fire 5"}, - - {"P2 Coin", BIT_DIGITAL, nWolfUnitJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, nWolfUnitJoy3 + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, nWolfUnitJoy1 + 8, "p2 up"}, - {"P2 Down", BIT_DIGITAL, nWolfUnitJoy1 + 9, "p2 down"}, - {"P2 Left", BIT_DIGITAL, nWolfUnitJoy1 + 10, "p2 left"}, - {"P2 Right", BIT_DIGITAL, nWolfUnitJoy1 + 11, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, nWolfUnitJoy1 + 12, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, nWolfUnitJoy1 + 13, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, nWolfUnitJoy1 + 14, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, nWolfUnitJoy2 + 4, "p2 fire 4"}, - {"P2 Button 5", BIT_DIGITAL, nWolfUnitJoy2 + 5, "p2 fire 5"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, nWolfUnitJoy3 + 6, "service"}, - {"Tilt", BIT_DIGITAL, nWolfUnitJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, nWolfUnitDSW + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, nWolfUnitDSW + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, nWolfUnitDSW + 2, "dip"}, -}; - -STDINPUTINFO(Wwfmania) - - -static struct BurnDIPInfo WwfmaniaDIPList[]= -{ - {0x19, 0xff, 0xff, 0xfd, NULL }, - {0x1a, 0xff, 0xff, 0x7f, NULL }, - {0x1b, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2, "Test Switch" }, - {0x19, 0x01, 0x01, 0x01, "Off" }, - {0x19, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Powerup Test" }, - {0x19, 0x01, 0x02, 0x00, "Off" }, - {0x19, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Realtime Clock" }, - {0x19, 0x01, 0x08, 0x08, "No" }, - {0x19, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Bill Validator" }, - {0x19, 0x01, 0x40, 0x40, "Off" }, - {0x19, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Counters" }, - {0x1a, 0x01, 0x03, 0x03, "One, 1/1" }, - {0x1a, 0x01, 0x03, 0x02, "One, Totalizing" }, - {0x1a, 0x01, 0x03, 0x01, "Two, 1/1" }, - - {0 , 0xfe, 0 , 3, "Country" }, - {0x1a, 0x01, 0x0c, 0x0c, "USA" }, - {0x1a, 0x01, 0x0c, 0x08, "French" }, - {0x1a, 0x01, 0x0c, 0x04, "German" }, - - {0 , 0xfe, 0 , 6, "Coinage" }, - {0x1a, 0x01, 0x70, 0x70, "1" }, - {0x1a, 0x01, 0x70, 0x30, "2" }, - {0x1a, 0x01, 0x70, 0x50, "3" }, - {0x1a, 0x01, 0x70, 0x10, "4" }, - {0x1a, 0x01, 0x70, 0x60, "ECA" }, - {0x1a, 0x01, 0x70, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Coinage Source" }, - {0x1a, 0x01, 0x80, 0x80, "Dipswitch" }, - {0x1a, 0x01, 0x80, 0x00, "CMOS" }, - - {0 , 0xfe, 0 , 1, "Service Mode (No Toggle)" }, - {0x1b, 0x01, 0x10, 0x10, "Off" }, -}; - -STDDIPINFO(Wwfmania) - -// Mortal Kombat 3 (rev 2.1) - -static struct BurnRomInfo mk3RomDesc[] = { - { "mk321u54.bin", 0x080000, 0x9e344401, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "mk321u63.bin", 0x080000, 0x64d34776, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "l1_mortal_kombat_3_u2_music_spch.u2", 0x100000, 0x5273436f, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "l1_mortal_kombat_3_u3_music_spch.u3", 0x100000, 0x856fe411, 2 | BRF_PRG | BRF_ESS }, // 3 - { "l1_mortal_kombat_3_u4_music_spch.u4", 0x100000, 0x428a406f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "l1_mortal_kombat_3_u5_music_spch.u5", 0x100000, 0x3b98a09f, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "l1_mortal_kombat_3_u133_game_rom.u133", 0x100000, 0x79b94667, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "l1_mortal_kombat_3_u132_game_rom.u132", 0x100000, 0x13e95228, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "l1_mortal_kombat_3_u131_game_rom.u131", 0x100000, 0x41001e30, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "l1_mortal_kombat_3_u130_game_rom.u130", 0x100000, 0x49379dd7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "l1_mortal_kombat_3_u129_game_rom.u129", 0x100000, 0xa8b41803, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "l1_mortal_kombat_3_u128_game_rom.u128", 0x100000, 0xb410d72f, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "l1_mortal_kombat_3_u127_game_rom.u127", 0x100000, 0xbd985be7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "l1_mortal_kombat_3_u126_game_rom.u126", 0x100000, 0xe7c32cf4, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "l1_mortal_kombat_3_u125_game_rom.u125", 0x100000, 0x9a52227e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "l1_mortal_kombat_3_u124_game_rom.u124", 0x100000, 0x5c750ebc, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "l1_mortal_kombat_3_u123_game_rom.u123", 0x100000, 0xf0ab88a8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "l1_mortal_kombat_3_u122_game_rom.u122", 0x100000, 0x9b87cdac, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "l1_mortal_kombat_3_u121_game_rom.u121", 0x100000, 0xb6c6296a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "l1_mortal_kombat_3_u120_game_rom.u120", 0x100000, 0x8d1ccc3b, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "l1_mortal_kombat_3_u119_game_rom.u119", 0x100000, 0x63215b59, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "l1_mortal_kombat_3_u118_game_rom.u118", 0x100000, 0x8b681e34, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "l1_mortal_kombat_3_u117_game_rom.u117", 0x080000, 0x1ab20377, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "l1_mortal_kombat_3_u116_game_rom.u116", 0x080000, 0xba246ad0, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "l1_mortal_kombat_3_u115_game_rom.u115", 0x080000, 0x3ee8b124, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "l1_mortal_kombat_3_u114_game_rom.u114", 0x080000, 0xa8d99922, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 -}; - -STD_ROM_PICK(mk3) -STD_ROM_FN(mk3) - -struct BurnDriver BurnDrvMk3 = { - "mk3", NULL, NULL, NULL, "1994", - "Mortal Kombat 3 (rev 2.1)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, mk3RomInfo, mk3RomName, NULL, NULL, Mk3InputInfo, Mk3DIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// Mortal Kombat 3 (rev 2.0) - -static struct BurnRomInfo mk3r20RomDesc[] = { - { "mk320u54.bin", 0x080000, 0x453da302, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "mk320u63.bin", 0x080000, 0xf8dc0600, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "l1_mortal_kombat_3_u2_music_spch.u2", 0x100000, 0x5273436f, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "l1_mortal_kombat_3_u3_music_spch.u3", 0x100000, 0x856fe411, 2 | BRF_PRG | BRF_ESS }, // 3 - { "l1_mortal_kombat_3_u4_music_spch.u4", 0x100000, 0x428a406f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "l1_mortal_kombat_3_u5_music_spch.u5", 0x100000, 0x3b98a09f, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "l1_mortal_kombat_3_u133_game_rom.u133", 0x100000, 0x79b94667, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "l1_mortal_kombat_3_u132_game_rom.u132", 0x100000, 0x13e95228, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "l1_mortal_kombat_3_u131_game_rom.u131", 0x100000, 0x41001e30, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "l1_mortal_kombat_3_u130_game_rom.u130", 0x100000, 0x49379dd7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "l1_mortal_kombat_3_u129_game_rom.u129", 0x100000, 0xa8b41803, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "l1_mortal_kombat_3_u128_game_rom.u128", 0x100000, 0xb410d72f, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "l1_mortal_kombat_3_u127_game_rom.u127", 0x100000, 0xbd985be7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "l1_mortal_kombat_3_u126_game_rom.u126", 0x100000, 0xe7c32cf4, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "l1_mortal_kombat_3_u125_game_rom.u125", 0x100000, 0x9a52227e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "l1_mortal_kombat_3_u124_game_rom.u124", 0x100000, 0x5c750ebc, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "l1_mortal_kombat_3_u123_game_rom.u123", 0x100000, 0xf0ab88a8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "l1_mortal_kombat_3_u122_game_rom.u122", 0x100000, 0x9b87cdac, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "l1_mortal_kombat_3_u121_game_rom.u121", 0x100000, 0xb6c6296a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "l1_mortal_kombat_3_u120_game_rom.u120", 0x100000, 0x8d1ccc3b, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "l1_mortal_kombat_3_u119_game_rom.u119", 0x100000, 0x63215b59, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "l1_mortal_kombat_3_u118_game_rom.u118", 0x100000, 0x8b681e34, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "l1_mortal_kombat_3_u117_game_rom.u117", 0x080000, 0x1ab20377, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "l1_mortal_kombat_3_u116_game_rom.u116", 0x080000, 0xba246ad0, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "l1_mortal_kombat_3_u115_game_rom.u115", 0x080000, 0x3ee8b124, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "l1_mortal_kombat_3_u114_game_rom.u114", 0x080000, 0xa8d99922, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 -}; - -STD_ROM_PICK(mk3r20) -STD_ROM_FN(mk3r20) - -struct BurnDriver BurnDrvMk3r20 = { - "mk3r20", "mk3", NULL, NULL, "1994", - "Mortal Kombat 3 (rev 2.0)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, mk3r20RomInfo, mk3r20RomName, NULL, NULL, Mk3InputInfo, Mk3DIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// Mortal Kombat 3 (rev 1.0) - -static struct BurnRomInfo mk3r10RomDesc[] = { - { "mk310u54.bin", 0x080000, 0x41829228, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "mk310u63.bin", 0x080000, 0xb074e1e8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "l1_mortal_kombat_3_u2_music_spch.u2", 0x100000, 0x5273436f, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "l1_mortal_kombat_3_u3_music_spch.u3", 0x100000, 0x856fe411, 2 | BRF_PRG | BRF_ESS }, // 3 - { "l1_mortal_kombat_3_u4_music_spch.u4", 0x100000, 0x428a406f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "l1_mortal_kombat_3_u5_music_spch.u5", 0x100000, 0x3b98a09f, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "l1_mortal_kombat_3_u133_game_rom.u133", 0x100000, 0x79b94667, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "l1_mortal_kombat_3_u132_game_rom.u132", 0x100000, 0x13e95228, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "l1_mortal_kombat_3_u131_game_rom.u131", 0x100000, 0x41001e30, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "l1_mortal_kombat_3_u130_game_rom.u130", 0x100000, 0x49379dd7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "l1_mortal_kombat_3_u129_game_rom.u129", 0x100000, 0xa8b41803, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "l1_mortal_kombat_3_u128_game_rom.u128", 0x100000, 0xb410d72f, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "l1_mortal_kombat_3_u127_game_rom.u127", 0x100000, 0xbd985be7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "l1_mortal_kombat_3_u126_game_rom.u126", 0x100000, 0xe7c32cf4, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "l1_mortal_kombat_3_u125_game_rom.u125", 0x100000, 0x9a52227e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "l1_mortal_kombat_3_u124_game_rom.u124", 0x100000, 0x5c750ebc, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "l1_mortal_kombat_3_u123_game_rom.u123", 0x100000, 0xf0ab88a8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "l1_mortal_kombat_3_u122_game_rom.u122", 0x100000, 0x9b87cdac, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "l1_mortal_kombat_3_u121_game_rom.u121", 0x100000, 0xb6c6296a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "l1_mortal_kombat_3_u120_game_rom.u120", 0x100000, 0x8d1ccc3b, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "l1_mortal_kombat_3_u119_game_rom.u119", 0x100000, 0x63215b59, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "l1_mortal_kombat_3_u118_game_rom.u118", 0x100000, 0x8b681e34, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "l1_mortal_kombat_3_u117_game_rom.u117", 0x080000, 0x1ab20377, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "l1_mortal_kombat_3_u116_game_rom.u116", 0x080000, 0xba246ad0, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "l1_mortal_kombat_3_u115_game_rom.u115", 0x080000, 0x3ee8b124, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "l1_mortal_kombat_3_u114_game_rom.u114", 0x080000, 0xa8d99922, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 -}; - -STD_ROM_PICK(mk3r10) -STD_ROM_FN(mk3r10) - -struct BurnDriver BurnDrvMk3r10 = { - "mk3r10", "mk3", NULL, NULL, "1994", - "Mortal Kombat 3 (rev 1.0)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, mk3r10RomInfo, mk3r10RomName, NULL, NULL, Mk3InputInfo, Mk3DIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// Mortal Kombat 3 (rev 1 chip label p4.0) - -static struct BurnRomInfo mk3p40RomDesc[] = { - { "mk3p40.u54", 0x080000, 0x4dfb0748, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "mk3p40.u63", 0x080000, 0xf25a8083, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "l1_mortal_kombat_3_u2_music_spch.u2", 0x100000, 0x5273436f, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "l1_mortal_kombat_3_u3_music_spch.u3", 0x100000, 0x856fe411, 2 | BRF_PRG | BRF_ESS }, // 3 - { "l1_mortal_kombat_3_u4_music_spch.u4", 0x100000, 0x428a406f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "l1_mortal_kombat_3_u5_music_spch.u5", 0x100000, 0x3b98a09f, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "l1_mortal_kombat_3_u133_game_rom.u133", 0x100000, 0x79b94667, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "l1_mortal_kombat_3_u132_game_rom.u132", 0x100000, 0x13e95228, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "l1_mortal_kombat_3_u131_game_rom.u131", 0x100000, 0x41001e30, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "l1_mortal_kombat_3_u130_game_rom.u130", 0x100000, 0x49379dd7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "l1_mortal_kombat_3_u129_game_rom.u129", 0x100000, 0xa8b41803, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "l1_mortal_kombat_3_u128_game_rom.u128", 0x100000, 0xb410d72f, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "l1_mortal_kombat_3_u127_game_rom.u127", 0x100000, 0xbd985be7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "l1_mortal_kombat_3_u126_game_rom.u126", 0x100000, 0xe7c32cf4, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "l1_mortal_kombat_3_u125_game_rom.u125", 0x100000, 0x9a52227e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "l1_mortal_kombat_3_u124_game_rom.u124", 0x100000, 0x5c750ebc, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "l1_mortal_kombat_3_u123_game_rom.u123", 0x100000, 0xf0ab88a8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "l1_mortal_kombat_3_u122_game_rom.u122", 0x100000, 0x9b87cdac, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "l1_mortal_kombat_3_u121_game_rom.u121", 0x100000, 0xb6c6296a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "l1_mortal_kombat_3_u120_game_rom.u120", 0x100000, 0x8d1ccc3b, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "l1_mortal_kombat_3_u119_game_rom.u119", 0x100000, 0x63215b59, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "l1_mortal_kombat_3_u118_game_rom.u118", 0x100000, 0x8b681e34, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "l1_mortal_kombat_3_u117_game_rom.u117", 0x080000, 0x1ab20377, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "l1_mortal_kombat_3_u116_game_rom.u116", 0x080000, 0xba246ad0, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "l1_mortal_kombat_3_u115_game_rom.u115", 0x080000, 0x3ee8b124, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "l1_mortal_kombat_3_u114_game_rom.u114", 0x080000, 0xa8d99922, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 -}; - -STD_ROM_PICK(mk3p40) -STD_ROM_FN(mk3p40) - -struct BurnDriver BurnDrvMk3p40 = { - "mk3p40", "mk3", NULL, NULL, "1994", - "Mortal Kombat 3 (rev 1 chip label p4.0)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, mk3p40RomInfo, mk3p40RomName, NULL, NULL, Mk3InputInfo, Mk3DIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// Ultimate Mortal Kombat 3 (rev 1.2) - -static struct BurnRomInfo umk3RomDesc[] = { - { "l1.2_mortal_kombat_3_u54_ultimate.u54", 0x080000, 0x712b4db6, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "l1.2_mortal_kombat_3_u63_ultimate.u63", 0x080000, 0x6d301faf, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "l2.0_mortal_kombat_3_u2_ultimate.u2", 0x100000, 0x3838cfe5, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "l1_mortal_kombat_3_u3_music_spch.u3", 0x100000, 0x856fe411, 2 | BRF_PRG | BRF_ESS }, // 3 - { "l1_mortal_kombat_3_u4_music_spch.u4", 0x100000, 0x428a406f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "l1_mortal_kombat_3_u5_music_spch.u5", 0x100000, 0x3b98a09f, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "l1_mortal_kombat_3_u133_game_rom.u133", 0x100000, 0x79b94667, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "l1_mortal_kombat_3_u132_game_rom.u132", 0x100000, 0x13e95228, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "l1_mortal_kombat_3_u131_game_rom.u131", 0x100000, 0x41001e30, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "l1_mortal_kombat_3_u130_game_rom.u130", 0x100000, 0x49379dd7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "l1_mortal_kombat_3_u129_game_rom.u129", 0x100000, 0xa8b41803, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "l1_mortal_kombat_3_u128_game_rom.u128", 0x100000, 0xb410d72f, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "l1_mortal_kombat_3_u127_game_rom.u127", 0x100000, 0xbd985be7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "l1_mortal_kombat_3_u126_game_rom.u126", 0x100000, 0xe7c32cf4, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "l1_mortal_kombat_3_u125_game_rom.u125", 0x100000, 0x9a52227e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "l1_mortal_kombat_3_u124_game_rom.u124", 0x100000, 0x5c750ebc, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "l1_mortal_kombat_3_u123_game_rom.u123", 0x100000, 0xf0ab88a8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "l1_mortal_kombat_3_u122_game_rom.u122", 0x100000, 0x9b87cdac, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "umk-u121.bin", 0x100000, 0xcc4b95db, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "umk-u120.bin", 0x100000, 0x1c8144cd, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "umk-u119.bin", 0x100000, 0x5f10c543, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "umk-u118.bin", 0x100000, 0xde0c4488, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "umk-u113.bin", 0x100000, 0x99d74a1e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "umk-u112.bin", 0x100000, 0xb5a46488, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "umk-u111.bin", 0x100000, 0xa87523c8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "umk-u110.bin", 0x100000, 0x0038f205, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 - - { "463_MK3_Ultimate.u64", 0x1009, 0x4f425218, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(umk3) -STD_ROM_FN(umk3) - -struct BurnDriver BurnDrvUmk3 = { - "umk3", NULL, NULL, NULL, "1994", - "Ultimate Mortal Kombat 3 (rev 1.2)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, umk3RomInfo, umk3RomName, NULL, NULL, Mk3InputInfo, Mk3DIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// Ultimate Mortal Kombat 3 (rev 1.1) - -static struct BurnRomInfo umk3r11RomDesc[] = { - { "l1.1_mortal_kombat_3_u54_ultimate.u54", 0x080000, 0x8bb27659, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "l1.1_mortal_kombat_3_u63_ultimate.u63", 0x080000, 0xea731783, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "l2.0_mortal_kombat_3_u2_ultimate.u2", 0x100000, 0x3838cfe5, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "l1_mortal_kombat_3_u3_music_spch.u3", 0x100000, 0x856fe411, 2 | BRF_PRG | BRF_ESS }, // 3 - { "l1_mortal_kombat_3_u4_music_spch.u4", 0x100000, 0x428a406f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "l1_mortal_kombat_3_u5_music_spch.u5", 0x100000, 0x3b98a09f, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "l1_mortal_kombat_3_u133_game_rom.u133", 0x100000, 0x79b94667, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "l1_mortal_kombat_3_u132_game_rom.u132", 0x100000, 0x13e95228, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "l1_mortal_kombat_3_u131_game_rom.u131", 0x100000, 0x41001e30, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "l1_mortal_kombat_3_u130_game_rom.u130", 0x100000, 0x49379dd7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "l1_mortal_kombat_3_u129_game_rom.u129", 0x100000, 0xa8b41803, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "l1_mortal_kombat_3_u128_game_rom.u128", 0x100000, 0xb410d72f, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "l1_mortal_kombat_3_u127_game_rom.u127", 0x100000, 0xbd985be7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "l1_mortal_kombat_3_u126_game_rom.u126", 0x100000, 0xe7c32cf4, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "l1_mortal_kombat_3_u125_game_rom.u125", 0x100000, 0x9a52227e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "l1_mortal_kombat_3_u124_game_rom.u124", 0x100000, 0x5c750ebc, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "l1_mortal_kombat_3_u123_game_rom.u123", 0x100000, 0xf0ab88a8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "l1_mortal_kombat_3_u122_game_rom.u122", 0x100000, 0x9b87cdac, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "mortal_kombat_iii_ultimate_u121_video_image.u121", 0x100000, 0xcc4b95db, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "mortal_kombat_iii_ultimate_u120_video_image.u120", 0x100000, 0x1c8144cd, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "mortal_kombat_iii_ultimate_u119_video_image.u119", 0x100000, 0x5f10c543, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "mortal_kombat_iii_ultimate_u118_video_image.u118", 0x100000, 0xde0c4488, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "mortal_kombat_iii_ultimate_u113_video_image.u113", 0x100000, 0x99d74a1e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "mortal_kombat_iii_ultimate_u112_video_image.u112", 0x100000, 0xb5a46488, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "mortal_kombat_iii_ultimate_u111_video_image.u111", 0x100000, 0xa87523c8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "mortal_kombat_iii_ultimate_u110_video_image.u110", 0x100000, 0x0038f205, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 - - { "463_MK3_Ultimate.u64", 0x1009, 0x4f425218, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(umk3r11) -STD_ROM_FN(umk3r11) - -struct BurnDriver BurnDrvUmk3r11 = { - "umk3r11", "umk3", NULL, NULL, "1994", - "Ultimate Mortal Kombat 3 (rev 1.1)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, umk3r11RomInfo, umk3r11RomName, NULL, NULL, Mk3InputInfo, Mk3DIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// Ultimate Mortal Kombat 3 (rev 1.0) - -static struct BurnRomInfo umk3r10RomDesc[] = { - { "l1.0_mortal_kombat_3_u54_ultimate.u54", 0x080000, 0xdfd735da, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "l1.0_mortal_kombat_3_u63_ultimate.u63", 0x080000, 0x2dff0c83, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "l1.0_mortal_kombat_3_u2_ultimate.u2", 0x100000, 0x3838cfe5, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "l1_mortal_kombat_3_u3_music_spch.u3", 0x100000, 0x856fe411, 2 | BRF_PRG | BRF_ESS }, // 3 - { "l1_mortal_kombat_3_u4_music_spch.u4", 0x100000, 0x428a406f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "l1_mortal_kombat_3_u5_music_spch.u5", 0x100000, 0x3b98a09f, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "l1_mortal_kombat_3_u133_game_rom.u133", 0x100000, 0x79b94667, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "l1_mortal_kombat_3_u132_game_rom.u132", 0x100000, 0x13e95228, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "l1_mortal_kombat_3_u131_game_rom.u131", 0x100000, 0x41001e30, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "l1_mortal_kombat_3_u130_game_rom.u130", 0x100000, 0x49379dd7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "l1_mortal_kombat_3_u129_game_rom.u129", 0x100000, 0xa8b41803, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "l1_mortal_kombat_3_u128_game_rom.u128", 0x100000, 0xb410d72f, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "l1_mortal_kombat_3_u127_game_rom.u127", 0x100000, 0xbd985be7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "l1_mortal_kombat_3_u126_game_rom.u126", 0x100000, 0xe7c32cf4, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "l1_mortal_kombat_3_u125_game_rom.u125", 0x100000, 0x9a52227e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "l1_mortal_kombat_3_u124_game_rom.u124", 0x100000, 0x5c750ebc, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "l1_mortal_kombat_3_u123_game_rom.u123", 0x100000, 0xf0ab88a8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "l1_mortal_kombat_3_u122_game_rom.u122", 0x100000, 0x9b87cdac, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "mortal_kombat_iii_ultimate_u121_video_image.u121", 0x100000, 0xcc4b95db, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "mortal_kombat_iii_ultimate_u120_video_image.u120", 0x100000, 0x1c8144cd, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "mortal_kombat_iii_ultimate_u119_video_image.u119", 0x100000, 0x5f10c543, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "mortal_kombat_iii_ultimate_u118_video_image.u118", 0x100000, 0xde0c4488, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "mortal_kombat_iii_ultimate_u113_video_image.u113", 0x100000, 0x99d74a1e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "mortal_kombat_iii_ultimate_u112_video_image.u112", 0x100000, 0xb5a46488, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "mortal_kombat_iii_ultimate_u111_video_image.u111", 0x100000, 0xa87523c8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "mortal_kombat_iii_ultimate_u110_video_image.u110", 0x100000, 0x0038f205, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 - - { "463_MK3_Ultimate.u64", 0x1009, 0x4f425218, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(umk3r10) -STD_ROM_FN(umk3r10) - -struct BurnDriver BurnDrvUmk3r10 = { - "umk3r10", "umk3", NULL, NULL, "1994", - "Ultimate Mortal Kombat 3 (rev 1.0)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, umk3r10RomInfo, umk3r10RomName, NULL, NULL, Mk3InputInfo, Mk3DIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// 2 On 2 Open Ice Challenge (rev 1.21) - -static struct BurnRomInfo openiceRomDesc[] = { - { "open_ice_l1.21.u54", 0x080000, 0xe4225284, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "open_ice_l1.21.u63", 0x080000, 0x97d308a3, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "open_ice_l1.2.u2", 0x100000, 0x8adb5aab, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "open_ice_l1.u3", 0x100000, 0x11c61ad6, 2 | BRF_PRG | BRF_ESS }, // 3 - { "open_ice_l1.u4", 0x100000, 0x04279290, 2 | BRF_PRG | BRF_ESS }, // 4 - { "open_ice_l1.u5", 0x100000, 0xe90ad61f, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "open_ice_l1.2.u133", 0x100000, 0x8a81605c, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "open_ice_l1.2.u132", 0x100000, 0xcfdd6702, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "open_ice_l1.2.u131", 0x100000, 0xcc428eb7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "open_ice_l1.2.u130", 0x100000, 0x74c2d50c, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "open_ice_l1.2.u129", 0x100000, 0x9e2ff012, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "open_ice_l1.2.u128", 0x100000, 0x35d2e610, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "open_ice_l1.2.u127", 0x100000, 0xbcbf19fe, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "open_ice_l1.2.u126", 0x100000, 0x8e3106ae, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "open_ice_l1.u125", 0x100000, 0xa7b54550, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "open_ice_l1.u124", 0x100000, 0x7c02cb50, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "open_ice_l1.u123", 0x100000, 0xd543bd9d, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "open_ice_l1.u122", 0x100000, 0x3744d291, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "open_ice_l1.2.u121", 0x100000, 0xacd2f7c7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "open_ice_l1.2.u120", 0x100000, 0x4295686a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "open_ice_l1.2.u119", 0x100000, 0x948b9b27, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "open_ice_l1.2.u118", 0x100000, 0x9eaaf93e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 -}; - -STD_ROM_PICK(openice) -STD_ROM_FN(openice) - -struct BurnDriver BurnDrvOpenice = { - "openice", NULL, NULL, NULL, "1995", - "2 On 2 Open Ice Challenge (rev 1.21)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, openiceRomInfo, openiceRomName, NULL, NULL, OpeniceInputInfo, OpeniceDIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// NBA Hangtime (rev L1.1 04/16/96) - -static struct BurnRomInfo nbahangtRomDesc[] = { - { "htime54.bin", 0x080000, 0xc2875d98, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "htime63.bin", 0x080000, 0x6f4728c3, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mhtu2.bin", 0x100000, 0x3f0b0d0a, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "mhtu3.bin", 0x100000, 0xec1db988, 2 | BRF_PRG | BRF_ESS }, // 3 - { "mhtu4.bin", 0x100000, 0xc7f847a3, 2 | BRF_PRG | BRF_ESS }, // 4 - { "mhtu5.bin", 0x100000, 0xef19316a, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "mhtu133.bin", 0x100000, 0x3163feed, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "mhtu132.bin", 0x100000, 0x428eaf44, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "mhtu131.bin", 0x100000, 0x5f7c5111, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "mhtu130.bin", 0x100000, 0xc7c0c514, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "mhtu129.bin", 0x100000, 0xb3d0daa0, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "mhtu128.bin", 0x100000, 0x3704ee69, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "mhtu127.bin", 0x100000, 0x4ea64d5a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "mhtu126.bin", 0x100000, 0x0c5c19b7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "mhtu125.bin", 0x100000, 0x46c43d67, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "mhtu124.bin", 0x100000, 0xed495156, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "mhtu123.bin", 0x100000, 0xb48aa5da, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "mhtu122.bin", 0x100000, 0xb18cd181, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "mhtu121.bin", 0x100000, 0x5acb267a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "mhtu120.bin", 0x100000, 0x28e05f86, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "mhtu119.bin", 0x100000, 0xb4f604ea, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "mhtu118.bin", 0x100000, 0xa257b973, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "mhtu113.bin", 0x100000, 0xd712a779, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "mhtu112.bin", 0x100000, 0x644e1bca, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "mhtu111.bin", 0x100000, 0x10d3b768, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "mhtu110.bin", 0x100000, 0x8575aeb2, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 -}; - -STD_ROM_PICK(nbahangt) -STD_ROM_FN(nbahangt) - -struct BurnDriver BurnDrvNbahangt = { - "nbahangt", NULL, NULL, NULL, "1996", - "NBA Hangtime (rev L1.1 04/16/96)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, nbahangtRomInfo, nbahangtRomName, NULL, NULL, NbahangtInputInfo, NbahangtDIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// NBA Maximum Hangtime (rev 1.03 06/09/97) - -static struct BurnRomInfo nbamhtRomDesc[] = { - { "mhtu54_v103.bin", 0x080000, 0x21b0d9e1, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "mhtu63_v103.bin", 0x080000, 0xc6fdbb97, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mhtu2.bin", 0x100000, 0x3f0b0d0a, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "mhtu3.bin", 0x100000, 0xec1db988, 2 | BRF_PRG | BRF_ESS }, // 3 - { "mhtu4.bin", 0x100000, 0xc7f847a3, 2 | BRF_PRG | BRF_ESS }, // 4 - { "mhtu5.bin", 0x100000, 0xef19316a, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "mhtu133.bin", 0x100000, 0x3163feed, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "mhtu132.bin", 0x100000, 0x428eaf44, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "mhtu131.bin", 0x100000, 0x5f7c5111, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "mhtu130.bin", 0x100000, 0xc7c0c514, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "mhtu129.bin", 0x100000, 0xb3d0daa0, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "mhtu128.bin", 0x100000, 0x3704ee69, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "mhtu127.bin", 0x100000, 0x4ea64d5a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "mhtu126.bin", 0x100000, 0x0c5c19b7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "mhtu125.bin", 0x100000, 0x46c43d67, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "mhtu124.bin", 0x100000, 0xed495156, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "mhtu123.bin", 0x100000, 0xb48aa5da, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "mhtu122.bin", 0x100000, 0xb18cd181, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "mhtu121.bin", 0x100000, 0x5acb267a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "mhtu120.bin", 0x100000, 0x28e05f86, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "mhtu119.bin", 0x100000, 0xb4f604ea, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "mhtu118.bin", 0x100000, 0xa257b973, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "mhtu113.bin", 0x100000, 0xd712a779, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "mhtu112.bin", 0x100000, 0x644e1bca, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "mhtu111.bin", 0x100000, 0x10d3b768, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "mhtu110.bin", 0x100000, 0x8575aeb2, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 -}; - -STD_ROM_PICK(nbamht) -STD_ROM_FN(nbamht) - -struct BurnDriver BurnDrvNbamht = { - "nbamht", NULL, NULL, NULL, "1996", - "NBA Maximum Hangtime (rev 1.03 06/09/97)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, nbamhtRomInfo, nbamhtRomName, NULL, NULL, NbahangtInputInfo, NbahangtDIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// NBA Maximum Hangtime (rev 1.0 11/08/96) - -static struct BurnRomInfo nbamht1RomDesc[] = { - { "mhtu54_v10.bin", 0x080000, 0xdfb6b3ae, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "mhtu63_v10.bin", 0x080000, 0x78da472c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mhtu2.bin", 0x100000, 0x3f0b0d0a, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "mhtu3.bin", 0x100000, 0xec1db988, 2 | BRF_PRG | BRF_ESS }, // 3 - { "mhtu4.bin", 0x100000, 0xc7f847a3, 2 | BRF_PRG | BRF_ESS }, // 4 - { "mhtu5.bin", 0x100000, 0xef19316a, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "mhtu133.bin", 0x100000, 0x3163feed, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "mhtu132.bin", 0x100000, 0x428eaf44, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "mhtu131.bin", 0x100000, 0x5f7c5111, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "mhtu130.bin", 0x100000, 0xc7c0c514, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "mhtu129.bin", 0x100000, 0xb3d0daa0, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "mhtu128.bin", 0x100000, 0x3704ee69, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "mhtu127.bin", 0x100000, 0x4ea64d5a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "mhtu126.bin", 0x100000, 0x0c5c19b7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "mhtu125.bin", 0x100000, 0x46c43d67, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "mhtu124.bin", 0x100000, 0xed495156, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "mhtu123.bin", 0x100000, 0xb48aa5da, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "mhtu122.bin", 0x100000, 0xb18cd181, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "mhtu121.bin", 0x100000, 0x5acb267a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "mhtu120.bin", 0x100000, 0x28e05f86, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "mhtu119.bin", 0x100000, 0xb4f604ea, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "mhtu118.bin", 0x100000, 0xa257b973, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "mhtu113.bin", 0x100000, 0xd712a779, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 0) }, // 22 - { "mhtu112.bin", 0x100000, 0x644e1bca, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 1) }, // 23 - { "mhtu111.bin", 0x100000, 0x10d3b768, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 2) }, // 24 - { "mhtu110.bin", 0x100000, 0x8575aeb2, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x14, 3) }, // 25 -}; - -STD_ROM_PICK(nbamht1) -STD_ROM_FN(nbamht1) - -struct BurnDriver BurnDrvNbamht1 = { - "nbamht1", "nbamht", NULL, NULL, "1996", - "NBA Maximum Hangtime (rev 1.0 11/08/96)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, nbamht1RomInfo, nbamht1RomName, NULL, NULL, NbahangtInputInfo, NbahangtDIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// Rampage: World Tour (rev 1.3) - -static struct BurnRomInfo rmpgwtRomDesc[] = { - { "1.3_rampage_world_u54_game.u54", 0x080000, 0x2a8f6e1e, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "1.3_rampage_world_u63_game.u63", 0x080000, 0x403ae41e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.0_rampage_world_tour_u2_sound.u2", 0x100000, 0x0e82f83d, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "1.0_rampage_world_tour_u3_sound.u3", 0x100000, 0x3ff54d15, 2 | BRF_PRG | BRF_ESS }, // 3 - { "1.0_rampage_world_tour_u4_sound.u4", 0x100000, 0x5c7f5656, 2 | BRF_PRG | BRF_ESS }, // 4 - { "1.0_rampage_world_tour_u5_sound.u5", 0x100000, 0xfd9aaf24, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "1.0_rampage_world_tour_u133_image.u133", 0x100000, 0x5b5ac449, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "1.0_rampage_world_tour_u132_image.u132", 0x100000, 0x7b3f09c6, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "1.0_rampage_world_tour_u131_image.u131", 0x100000, 0xfdecf12e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "1.0_rampage_world_tour_u130_image.u130", 0x100000, 0x4a983b05, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "1.0_rampage_world_tour_u129_image.u129", 0x100000, 0xdc495c6e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "1.0_rampage_world_tour_u128_image.u128", 0x100000, 0x5545503d, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "1.0_rampage_world_tour_u127_image.u127", 0x100000, 0x6e1756ba, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "1.0_rampage_world_tour_u126_image.u126", 0x100000, 0xc300eb1b, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "1.0_rampage_world_tour_u125_image.u125", 0x100000, 0x7369bf5d, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "1.0_rampage_world_tour_u124_image.u124", 0x100000, 0xc0bf88c8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "1.0_rampage_world_tour_u123_image.u123", 0x100000, 0xac4c712a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "1.0_rampage_world_tour_u122_image.u122", 0x100000, 0x609862a2, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "1.0_rampage_world_tour_u121_image.u121", 0x100000, 0xf65119b7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "1.0_rampage_world_tour_u120_image.u120", 0x100000, 0x6d643dee, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "1.0_rampage_world_tour_u119_image.u119", 0x100000, 0x4e49c133, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "1.0_rampage_world_tour_u118_image.u118", 0x100000, 0x43a6f51e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "465 Rampage WT.u64", 0x001009, 0x5c14d850, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(rmpgwt) -STD_ROM_FN(rmpgwt) - -struct BurnDriver BurnDrvRmpgwt = { - "rmpgwt", NULL, NULL, NULL, "1997", - "Rampage: World Tour (rev 1.3)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, rmpgwtRomInfo, rmpgwtRomName, NULL, NULL, RmpgwtInputInfo, RmpgwtDIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// Rampage: World Tour (rev 1.1) - -static struct BurnRomInfo rmpgwt11RomDesc[] = { - { "1.1_rampage_world_u54_game.u54", 0x080000, 0x3aa514eb, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "1.1_rampage_world_u63_game.u63", 0x080000, 0x031c908f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.0_rampage_world_tour_u2_sound.u2", 0x100000, 0x0e82f83d, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "1.0_rampage_world_tour_u3_sound.u3", 0x100000, 0x3ff54d15, 2 | BRF_PRG | BRF_ESS }, // 3 - { "1.0_rampage_world_tour_u4_sound.u4", 0x100000, 0x5c7f5656, 2 | BRF_PRG | BRF_ESS }, // 4 - { "1.0_rampage_world_tour_u5_sound.u5", 0x100000, 0xfd9aaf24, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "1.0_rampage_world_tour_u133_image.u133", 0x100000, 0x5b5ac449, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "1.0_rampage_world_tour_u132_image.u132", 0x100000, 0x7b3f09c6, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "1.0_rampage_world_tour_u131_image.u131", 0x100000, 0xfdecf12e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "1.0_rampage_world_tour_u130_image.u130", 0x100000, 0x4a983b05, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "1.0_rampage_world_tour_u129_image.u129", 0x100000, 0xdc495c6e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "1.0_rampage_world_tour_u128_image.u128", 0x100000, 0x5545503d, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "1.0_rampage_world_tour_u127_image.u127", 0x100000, 0x6e1756ba, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "1.0_rampage_world_tour_u126_image.u126", 0x100000, 0xc300eb1b, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "1.0_rampage_world_tour_u125_image.u125", 0x100000, 0x7369bf5d, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "1.0_rampage_world_tour_u124_image.u124", 0x100000, 0xc0bf88c8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "1.0_rampage_world_tour_u123_image.u123", 0x100000, 0xac4c712a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "1.0_rampage_world_tour_u122_image.u122", 0x100000, 0x609862a2, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "1.0_rampage_world_tour_u121_image.u121", 0x100000, 0xf65119b7, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "1.0_rampage_world_tour_u120_image.u120", 0x100000, 0x6d643dee, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "1.0_rampage_world_tour_u119_image.u119", 0x100000, 0x4e49c133, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "1.0_rampage_world_tour_u118_image.u118", 0x100000, 0x43a6f51e, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 - - { "465 Rampage WT.u64", 0x010009, 0x5c14d850, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(rmpgwt11) -STD_ROM_FN(rmpgwt11) - -struct BurnDriver BurnDrvRmpgwt11 = { - "rmpgwt11", "rmpgwt", NULL, NULL, "1997", - "Rampage: World Tour (rev 1.1)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, rmpgwt11RomInfo, rmpgwt11RomName, NULL, NULL, RmpgwtInputInfo, RmpgwtDIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// WWF: Wrestlemania (rev 1.30 08/10/95) - -static struct BurnRomInfo wwfmaniaRomDesc[] = { - { "wwf_game_rom_l1.30.u54", 0x080000, 0xeeb7bf58, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "wwf_game_rom_l1.30.u63", 0x080000, 0x09759529, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "wwf_music-spch_l1.u2", 0x100000, 0xa9acb250, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "wwf_music-spch_l1.u3", 0x100000, 0x9442b6c9, 2 | BRF_PRG | BRF_ESS }, // 3 - { "wwf_music-spch_l1.u4", 0x100000, 0xcee78fac, 2 | BRF_PRG | BRF_ESS }, // 4 - { "wwf_music-spch_l1.u5", 0x100000, 0x5b31fd40, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "wwf_image_rom_l1.u133", 0x100000, 0x5e1b1e3d, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "wwf_image_rom_l1.u132", 0x100000, 0x5943b3b2, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "wwf_image_rom_l1.u131", 0x100000, 0x0815db22, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "wwf_image_rom_l1.u130", 0x100000, 0x9ee9a145, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "wwf_image_rom_l1.u129", 0x100000, 0xc644c2f4, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "wwf_image_rom_l1.u128", 0x100000, 0xfcda4e9a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "wwf_image_rom_l1.u127", 0x100000, 0x45be7428, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "wwf_image_rom_l1.u126", 0x100000, 0xeaa276a8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "wwf_image_rom_l1.u125", 0x100000, 0xa19ebeed, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "wwf_image_rom_l1.u124", 0x100000, 0xdc7d3dbb, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "wwf_image_rom_l1.u123", 0x100000, 0xe0ade56f, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "wwf_image_rom_l1.u122", 0x100000, 0x2800c78d, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "wwf_image_rom_l1.u121", 0x100000, 0xa28ffcba, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "wwf_image_rom_l1.u120", 0x100000, 0x3a05d371, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "wwf_image_rom_l1.u119", 0x100000, 0x97ffa659, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "wwf_image_rom_l1.u118", 0x100000, 0x46668e97, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 -}; - -STD_ROM_PICK(wwfmania) -STD_ROM_FN(wwfmania) - -struct BurnDriver BurnDrvWwfmania = { - "wwfmania", NULL, NULL, NULL, "1995", - "WWF: Wrestlemania (rev 1.30 08/10/95)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, wwfmaniaRomInfo, wwfmaniaRomName, NULL, NULL, WwfmaniaInputInfo, WwfmaniaDIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - -// WWF: Wrestlemania (rev 1.20 08/02/95) - -static struct BurnRomInfo wwfmaniabRomDesc[] = { - { "wwf_game_rom_l1.20.u54", 0x080000, 0x1b2dce48, 1 | BRF_PRG | BRF_ESS }, // 0 TMS34010 - { "wwf_game_rom_l1.20.u63", 0x080000, 0x1262f0bb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "wwf_music-spch_l1.u2", 0x100000, 0xa9acb250, 2 | BRF_PRG | BRF_ESS }, // 2 DCS sound banks - { "wwf_music-spch_l1.u3", 0x100000, 0x9442b6c9, 2 | BRF_PRG | BRF_ESS }, // 3 - { "wwf_music-spch_l1.u4", 0x100000, 0xcee78fac, 2 | BRF_PRG | BRF_ESS }, // 4 - { "wwf_music-spch_l1.u5", 0x100000, 0x5b31fd40, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "wwf_image_rom_l1.u133", 0x100000, 0x5e1b1e3d, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 0) }, // 6 GFX - { "wwf_image_rom_l1.u132", 0x100000, 0x5943b3b2, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 1) }, // 7 - { "wwf_image_rom_l1.u131", 0x100000, 0x0815db22, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 2) }, // 8 - { "wwf_image_rom_l1.u130", 0x100000, 0x9ee9a145, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x00, 3) }, // 9 - - { "wwf_image_rom_l1.u129", 0x100000, 0xc644c2f4, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 0) }, // 10 - { "wwf_image_rom_l1.u128", 0x100000, 0xfcda4e9a, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 1) }, // 11 - { "wwf_image_rom_l1.u127", 0x100000, 0x45be7428, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 2) }, // 12 - { "wwf_image_rom_l1.u126", 0x100000, 0xeaa276a8, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x04, 3) }, // 13 - - { "wwf_image_rom_l1.u125", 0x100000, 0xa19ebeed, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 0) }, // 14 - { "wwf_image_rom_l1.u124", 0x100000, 0xdc7d3dbb, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 1) }, // 15 - { "wwf_image_rom_l1.u123", 0x100000, 0xe0ade56f, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 2) }, // 16 - { "wwf_image_rom_l1.u122", 0x100000, 0x2800c78d, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x08, 3) }, // 17 - - { "wwf_image_rom_l1.u121", 0x100000, 0xa28ffcba, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 0) }, // 18 - { "wwf_image_rom_l1.u120", 0x100000, 0x3a05d371, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 1) }, // 19 - { "wwf_image_rom_l1.u119", 0x100000, 0x97ffa659, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 2) }, // 20 - { "wwf_image_rom_l1.u118", 0x100000, 0x46668e97, 3 | BRF_GRA | BRF_ESS | WUNIT_GFX(0x0c, 3) }, // 21 -}; - -STD_ROM_PICK(wwfmaniab) -STD_ROM_FN(wwfmaniab) - -struct BurnDriver BurnDrvWwfmaniab = { - "wwfmaniab", "wwfmania", NULL, NULL, "1995", - "WWF: Wrestlemania (rev 1.20 08/02/95)\0", NULL, "Midway", "MIDWAY Wolf-Unit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, wwfmaniabRomInfo, wwfmaniabRomName, NULL, NULL, WwfmaniaInputInfo, WwfmaniaDIPInfo, - WolfUnitInit, WolfUnitExit, WolfUnitFrame, WolfUnitDraw, WolfUnitScan, &nWolfUnitRecalc, 0x8000, - 512, 254, 4, 3 -}; - - diff --git a/jan/src/burn/drv/midway/dcs2k.cpp b/jan/src/burn/drv/midway/dcs2k.cpp deleted file mode 100644 index 5f86441c4..000000000 --- a/jan/src/burn/drv/midway/dcs2k.cpp +++ /dev/null @@ -1,595 +0,0 @@ -#include -#include -#include "adsp2100_intf.h" -#include "adsp2100/adsp2100.h" -#include "dcs2k.h" -#include - -//31250Hz sample rate -#define MHz(x) (x * 1000000) -#define ADSP_CLOCK MHz(10) - -#define LOG_ENABLE 0 -#define LOG_MEMACC 0 - -#if LOG_ENABLE -#define dcs_log(...) fprintf(stdout, "dcs: " __VA_ARGS__); fflush(stdout) -#else -#define dcs_log(...) -#endif -// From mame... -#define S1_AUTOBUF_REG 15 -#define S1_RFSDIV_REG 16 -#define S1_SCLKDIV_REG 17 -#define S1_CONTROL_REG 18 -#define S0_AUTOBUF_REG 19 -#define S0_RFSDIV_REG 20 -#define S0_SCLKDIV_REG 21 -#define S0_CONTROL_REG 22 -#define S0_MCTXLO_REG 23 -#define S0_MCTXHI_REG 24 -#define S0_MCRXLO_REG 25 -#define S0_MCRXHI_REG 26 -#define TIMER_SCALE_REG 27 -#define TIMER_COUNT_REG 28 -#define TIMER_PERIOD_REG 29 -#define WAITSTATES_REG 30 -#define SYSCONTROL_REG 31 - - -template -class resampler_buffer { - T *buffer; - uint64_t head; - uint64_t tail; - size_t buffer_size; - int target_rate; - int host_rate; - int t2h_count; - double factor; - int unused; -public: - resampler_buffer(int buf_size) : buffer_size(buf_size) { - buffer = new T[buffer_size]; - for (size_t i = 0; i < buffer_size; i++) - buffer[i] = 0; - head = 0; - tail = 0; - target_rate = 0; - host_rate = 0; - } - ~resampler_buffer() { - delete [] buffer; - } - - void clear() { - memset(buffer, 0, sizeof(T) * buffer_size); - } - - void set_target_rate(int freq) { - target_rate = freq; - } - - void set_host_rate(int freq) { - host_rate = freq; - factor = static_cast(host_rate) / static_cast(target_rate); - unused = target_rate * factor; - t2h_count = target_rate / unused; - } - - void write(const T *buf, size_t lenght) { - uint64_t tail_ = tail; - for (auto i = 0; i < lenght; i++) { - buffer[tail_ % buffer_size] = buf[i]; - ++tail_; - } - tail = tail_; - } - - T next() { - T val = buffer[head % buffer_size]; - buffer[head++ % buffer_size] = 0; - return val; - } - - T sample() { - int sum = 0; - for (int x = 0; x < t2h_count; x++) - sum += next(); - return sum / t2h_count; - } - -}; - -#define LATCH_OUTPUT_EMPTY 0x400 -#define LATCH_INPUT_EMPTY 0x800 -#define SET_OUTPUT_EMPTY() nLatchControl |= LATCH_OUTPUT_EMPTY -#define SET_OUTPUT_FULL() nLatchControl &= ~LATCH_OUTPUT_EMPTY -#define SET_INPUT_EMPTY() nLatchControl |= LATCH_INPUT_EMPTY -#define SET_INPUT_FULL() nLatchControl &= ~LATCH_INPUT_EMPTY - -static UINT8 *pIntRAM; -static UINT8 *pExtRAM; -static UINT32 *pExtRAM32; -static UINT8 *pDataRAM; -static UINT8 *pSoundROM; -static UINT16 nCurrentBank; -static UINT32 nSoundSize; -static UINT32 nSoundBanks; -static UINT32 nOutputData; -static UINT32 nInputData; -static UINT16 nLatchControl; -static UINT32 nCtrlReg[32]; -static UINT16 nTxIR; -static UINT16 nTxIRBase; -static UINT32 nTxSize; -static UINT32 nTxIncrement; -static UINT64 nNextIRQCycle; -static UINT64 nTotalCycles; -static UINT8 bGenerateIRQ; -static INT64 nSavedCycles; -static resampler_buffer *pSoundBuffer; -extern UINT16 adsp21xx_data_read_word_16le(UINT32 address); - -void Dcs2kBoot(); -static void SetupMemory(); -static int RxCallback(int port); -static void TxCallback(int port, int data); -static void TimerCallback(int enable); -static int IRQCallback(int line); - -static void DcsIRQ(); - -static UINT16 ReadRAM(UINT32 address); -static void WriteRAM(UINT32 address, UINT16 value); - -static UINT16 ReadRAMBank(UINT32 address); - -static UINT16 ReadData(UINT32 address); -static void WriteData(UINT32 address, UINT16 value); -static void SelectDataBank(UINT32 address, UINT16 value); -static UINT16 InputLatch(UINT32 address); -static void OutputLatch(UINT32 address, UINT16 value); -static UINT16 AdspRead(UINT32 address); -static void AdspWrite(UINT32 address, UINT16 value); - -void Dcs2kInit() -{ - dcs_log("init\n"); - Adsp2100Init(); - - Adsp2100SetIRQCallback(IRQCallback); - Adsp2100SetRxCallback(RxCallback); - Adsp2100SetTxCallback(TxCallback); - Adsp2100SetTimerCallback(TimerCallback); - - pIntRAM = BurnMalloc(0x400 * sizeof(UINT32)); - pExtRAM = BurnMalloc(0x800 * sizeof(UINT32)); - pDataRAM = BurnMalloc(0x200 * sizeof(UINT16)); - - pExtRAM32 = (UINT32*) pExtRAM; - - nCurrentBank = 0; - nSoundBanks = 0; - nSoundSize = 0; - - SetupMemory(); - - pSoundBuffer = new resampler_buffer(31250); - pSoundBuffer->set_target_rate(31250); - pSoundBuffer->set_host_rate(nBurnSoundRate); - - nCurrentBank = 0; -} - -void Dcs2kExit() -{ - dcs_log("exit\n"); - Adsp2100Exit(); - delete pSoundBuffer; - BurnFree(pIntRAM); - BurnFree(pExtRAM); - BurnFree(pDataRAM); -} - - -void Dcs2kRender(INT16 *pSoundBuf, INT32 nSegmentLenght) -{ - for (int i = 0; i < nSegmentLenght; i++) { - INT16 sample = pSoundBuffer->sample(); - pSoundBuf[i * 2 + 0] = sample; - pSoundBuf[i * 2 + 1] = sample; - } -} - -void Dcs2kRun(int cycles) -{ - const INT64 nEndCycle = nTotalCycles + cycles; - INT64 nNextCycles = cycles; - - while (nTotalCycles < nEndCycle) { - // check for next IRQ - if (nTotalCycles >= nNextIRQCycle) { - if (bGenerateIRQ) { - bGenerateIRQ = 0; - DcsIRQ(); - } - } - INT64 next = nNextCycles; - if ((nTotalCycles + next) >= nNextIRQCycle) - next = (nTotalCycles + next) - nNextIRQCycle; - - INT64 elapsed = Adsp2100Run(next); - elapsed -= nSavedCycles; - nSavedCycles = 0; - nTotalCycles += elapsed; - nNextCycles -= elapsed; - } -} - - -static UINT32 ReadProgram(UINT32 address) -{ -#if LOG_MEMACC - dcs_log("prg_r %x - %x\n", address); -#endif - UINT32 *p = (UINT32*)pIntRAM; - return p[address & 0x3FF]; -} - -static void WriteProgram(UINT32 address, UINT32 value) -{ -#if LOG_MEMACC - dcs_log("prg_w %x - %x\n", address, value); -#endif - UINT32 *p = (UINT32*)pIntRAM; - p[address & 0x3FF] = value & 0xFFFFFF; -} - -static UINT32 ReadProgramEXT(UINT32 address) -{ -#if LOG_MEMACC - dcs_log("prg_ext_r %x - %x\n", address, pExtRAM32[address & 0x7FF]); -#endif - return pExtRAM32[address & 0x7FF]; -} - -static void WriteProgramEXT(UINT32 address, UINT32 value) -{ - int offset = address & 0x7FF; -#if LOG_MEMACC - dcs_log("prg_ext_w %x - %x\n", address, value); -#endif - pExtRAM32[offset] = value; -} - -static void SetupMemory() -{ - // program address space - Adsp2100SetReadLongHandler (1, ReadProgram); - Adsp2100SetWriteLongHandler (1, WriteProgram); - Adsp2100SetReadLongHandler (2, ReadProgramEXT); - Adsp2100SetWriteLongHandler (2, WriteProgramEXT); - Adsp2100MapHandler(1, 0x0000, 0x03FF, MAP_RAM); - Adsp2100MapHandler(2, 0x0800, 0x0FFF, MAP_RAM); - Adsp2100MapHandler(2, 0x1000, 0x17FF, MAP_RAM); - Adsp2100MapHandler(2, 0x1800, 0x1FFF, MAP_RAM); - - // data address space - Adsp2100SetReadDataWordHandler (1, ReadData); - Adsp2100SetWriteDataWordHandler (1, WriteData); - - Adsp2100SetReadDataWordHandler (2, ReadRAMBank); - - Adsp2100SetWriteDataWordHandler (3, SelectDataBank); - - Adsp2100SetReadDataWordHandler (4, InputLatch); - Adsp2100SetWriteDataWordHandler (4, OutputLatch); - - Adsp2100SetReadDataWordHandler (5, ReadRAM); - Adsp2100SetWriteDataWordHandler (5, WriteRAM); - - Adsp2100SetReadDataWordHandler (6, AdspRead); - Adsp2100SetWriteDataWordHandler (6, AdspWrite); - - Adsp2100MapDataHandler(1, 0x0000, 0x07FF, MAP_RAM); - Adsp2100MapDataHandler(1, 0x0800, 0x0FFF, MAP_RAM); - Adsp2100MapDataHandler(1, 0x1000, 0x17FF, MAP_RAM); - Adsp2100MapDataHandler(1, 0x1800, 0x1FFF, MAP_RAM); - - Adsp2100MapDataHandler(2, 0x2000, 0x2FFF, MAP_READ); - - Adsp2100MapDataHandler(3, 0x3000, 0x33FF, MAP_WRITE); - - Adsp2100MapDataHandler(4, 0x3400, 0x37FF, MAP_READ | MAP_WRITE); - - Adsp2100MapDataHandler(5, 0x3800, 0x39FF, MAP_READ | MAP_WRITE); - - Adsp2100MapDataHandler(6, 0x3FE0, 0x3FFF, MAP_READ | MAP_WRITE); -} - - - -void Dcs2kMapSoundROM(void *ptr, int size) -{ - pSoundROM = (UINT8*)ptr; - nSoundSize = size; - nSoundBanks = (nSoundSize / 2) / 0x1000; - dcs_log("Sound size %x", size); - dcs_log("Sound banks %x", nSoundBanks); -} - -extern UINT32 adsp21xx_read_dword_32le(UINT32 address); -void Dcs2kBoot() -{ - UINT8 buffer[0x1000]; - UINT16 *base; - int i; - - base = (UINT16*) pSoundROM + ((nCurrentBank & 0x7FF) * 0x1000); - - for (i = 0; i < 0x1000; i++) - buffer[i] = base[i]; - Adsp2100LoadBootROM(buffer, pIntRAM); -} - -void Dcs2kReset() -{ - memset(pIntRAM, 0, 0x400 * sizeof(UINT32)); - memset(pExtRAM, 0, 0x800 * sizeof(UINT32)); - memset(pDataRAM, 0, 0x200 * sizeof(UINT16)); - Adsp2100Reset(); - Adsp2100SetIRQLine(ADSP2105_IRQ0, CLEAR_LINE); - Adsp2100SetIRQLine(ADSP2105_IRQ1, CLEAR_LINE); - Adsp2100SetIRQLine(ADSP2105_IRQ2, CLEAR_LINE); - - nTxIR = 0; - nTxIRBase = 0; - nTxSize = 0; - nTxIncrement = 0; - bGenerateIRQ = 0; - - nTotalCycles = 0ULL; - nNextIRQCycle = ~0ULL; - - nOutputData = 0; - nInputData = 0; - nLatchControl = 0; - - for (int i = 0; i < 32; i++) - nCtrlReg[i] = 0; - - SET_INPUT_EMPTY(); - SET_OUTPUT_EMPTY(); - - Dcs2kBoot(); - - pSoundBuffer->clear(); -} - -static UINT16 ReadRAMBank(UINT32 address) -{ - UINT16 *p = (UINT16 *) pSoundROM; - unsigned offset = (nCurrentBank * 0x1000) + (address & 0xFFF); -#if LOG_MEMACC - dcs_log("bank_r[%x] %x - %x\n", nCurrentBank, address & 0xFFF, p[offset]); -#endif - return p[offset]; - -} - -static UINT16 ReadRAM(UINT32 address) -{ -#if LOG_MEMACC - dcs_log("ram_r %x\n", address); -#endif - UINT16 *p = (UINT16 *) pDataRAM; - return p[address & 0x1FF]; -} - -static void WriteRAM(UINT32 address, UINT16 value) -{ -#if LOG_MEMACC - dcs_log("ram_w %x, %x\n", address, value); -#endif - UINT16 *p = (UINT16 *) pDataRAM; - p[address & 0x1FF] = value; -} - -static UINT16 ReadData(UINT32 address) -{ - int offset = (address & 0x7FF); -#if LOG_MEMACC - dcs_log("dataram_r %x - %x\n", offset, pExtRAM32[offset] >> 8); -#endif - return pExtRAM32[offset] >> 8; -} - -static void WriteData(UINT32 address, UINT16 value) -{ - int offset = (address & 0x7FF); - UINT32 data = value; - pExtRAM32[offset] &= 0xFF; - pExtRAM32[offset] |= data << 8; -#if LOG_MEMACC - dcs_log("dataram_w %x - %x\n", offset, value); -#endif -} - -static void SelectDataBank(UINT32 address, UINT16 value) -{ - dcs_log("bank_select %x\n", value); - nCurrentBank = value & 0x7FF; -} - -static UINT16 InputLatch(UINT32 address) -{ - Adsp2100SetIRQLine(ADSP2105_IRQ2, CLEAR_LINE); - SET_INPUT_EMPTY(); - dcs_log("input_latch %x\n", nInputData); - return nInputData; -} - -static void OutputLatch(UINT32 address, UINT16 value) -{ - dcs_log("output_latch %x, %x\n", address, value); - SET_OUTPUT_FULL(); - nOutputData = value; -} - -static UINT16 AdspRead(UINT32 address) -{ - dcs_log("adsp_r %x\n", address); - return nCtrlReg[address & 0x1F]; -} - - -static void AdspWrite(UINT32 address, UINT16 value) -{ - dcs_log("adsp_w %x, %x\n", address, value); - nCtrlReg[address & 0x1F] = value; - - switch (address & 0x1F) { - case SYSCONTROL_REG: - if (value & 0x0200) { - dcs_log("reboot\n"); - Adsp2100Reset(); - Dcs2kBoot(); - nCtrlReg[SYSCONTROL_REG] = 0; - } - if ((value & 0x0800) == 0) { - bGenerateIRQ = 0; - nNextIRQCycle = ~0ULL; - } - - break; - } -} - -void Dcs2kDataWrite(int data) -{ - dcs_log("data_w %x\n", data); - SET_INPUT_FULL(); - Adsp2100SetIRQLine(ADSP2105_IRQ2, ASSERT_LINE); - nInputData = data; -} - -void Dcs2kResetWrite(int data) -{ - dcs_log("reset_w %x\n", data); - if (data) { - Dcs2kReset(); - } -} - -int Dcs2kDataRead() -{ - dcs_log("data_r %x\n", nLatchControl); - return nLatchControl; -} - -int Dcs2kOutputData() -{ - return nOutputData; -} - - -static int RxCallback(int port) -{ - dcs_log("rx_sport %d\n", port); - return 0; -} - -static void ComputeNextIRQCycle() -{ - if (nTxIncrement) { - adsp2100_state *adsp = Adsp2100GetState(); - nNextIRQCycle = (nTotalCycles + adsp->icount) + 76800/2; - bGenerateIRQ = 1; - nSavedCycles = adsp->icount; - // stop CPU - adsp->icount = 1; - } - -} - -static void TxCallback(int port, int data) -{ - dcs_log("tx_sport p: %d, d: %d\n", port, data); - if (port != 1) - return; - - if (nCtrlReg[SYSCONTROL_REG] & 0x800) { - if (nCtrlReg[S1_AUTOBUF_REG] & 2) { - adsp2100_state *adsp = Adsp2100GetState(); - UINT16 src; - int m, l; - - nTxIR = (nCtrlReg[S1_AUTOBUF_REG] >> 9) & 7; - m = (nCtrlReg[S1_AUTOBUF_REG] >> 7) & 3; - m |= nTxIR & 0x04; - l = nTxIR; - - src = adsp->i[nTxIR]; - nTxIncrement = adsp->m[m]; - nTxSize = adsp->l[l]; - - src -= nTxIncrement; - adsp->i[nTxIR] = src; - nTxIRBase = src; - - dcs_log("tx_info base = %x, inc = %x, size = %x\n", src, nTxIncrement, nTxSize); - ComputeNextIRQCycle(); - return; - } - } - dcs_log("disable_irq\n"); - bGenerateIRQ = 0; - nNextIRQCycle = ~0ULL; -} - -static void DcsIRQ() -{ - adsp2100_state *adsp = Adsp2100GetState(); - int r = adsp->i[nTxIR]; - - int count = nTxSize / 2; - INT16 buffer[0x400]; - - - for (int i = 0; i < count; i++) { - buffer[i] = adsp21xx_data_read_word_16le(r<<1); - r += nTxIncrement; - } - - pSoundBuffer->write(buffer, count); - - bool wrapped = false; - - if (r >= (nTxIRBase + nTxSize)) { - r = nTxIRBase; - wrapped = true; - } - adsp->i[nTxIR] = r; - - nNextIRQCycle = nTotalCycles + 76800/2; - bGenerateIRQ = 1; - - if (wrapped) { - Adsp2100SetIRQLine(ADSP2105_IRQ1, ASSERT_LINE); - Adsp2100Run(1); - Adsp2100SetIRQLine(ADSP2105_IRQ1, CLEAR_LINE); - nTotalCycles++; - } -} - -static void TimerCallback(int enable) -{ - dcs_log("timer %d\n", enable); -} - -static int IRQCallback(int line) -{ - dcs_log("irq %d\n", line); - return 0; -} diff --git a/jan/src/burn/drv/midway/dcs2k.h b/jan/src/burn/drv/midway/dcs2k.h deleted file mode 100644 index 861a80f83..000000000 --- a/jan/src/burn/drv/midway/dcs2k.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - - -void Dcs2kInit(); -void Dcs2kExit(); -void Dcs2kRun(int cycles); -void Dcs2kMapSoundROM(void *ptr, int size); -void Dcs2kBoot(); -void Dcs2kDataWrite(int data); -int Dcs2kDataRead(); -int Dcs2kOutputData(); -void Dcs2kResetWrite(int data); -void Dcs2kRender(INT16 *pSoundBuf, INT32 nSegmentLenght); -void Dcs2kReset(); diff --git a/jan/src/burn/drv/midway/ide.cpp b/jan/src/burn/drv/midway/ide.cpp deleted file mode 100644 index d9922066e..000000000 --- a/jan/src/burn/drv/midway/ide.cpp +++ /dev/null @@ -1,496 +0,0 @@ -// Killer Instinct hd image: -// Tag='GDDD' Index=0 Length=34 bytes -// CYLS:419,HEADS:13,SECS:47,BPS:512. -#include -#include -#include -#include -#include "ide.h" - -#define DEBUG_ATA 0 - -#if DEBUG_ATA -# define ata_log(...) printf("ata_device: " __VA_ARGS__); fflush(stdout) -#else -# define ata_log(...) -#endif - -namespace ide -{ - - -using namespace std; - -enum ata_registers { - REG_DATA = 0, - REG_ERROR_RO = 1, - REG_SECTOR_COUNT = 2, - REG_SECTOR_NUMBER = 3, - REG_CYLINDER_LOW = 4, - REG_CYLINDER_HIGH = 5, - REG_DRIVE_HEAD = 6, - REG_STATUS_RO = 7, - REG_FEATURES_WO = 1, - REG_COMMAND_WO = 7, -}; - -enum ata_alt_registers { - REG_ALT_STATUS_RO = 6, - REG_ALT_DRIVE_ADDRESS_RO = 7, - REG_ALT_DEV_CONTROL_WO = 6, -}; - -enum ata_commands { - CMD_EXEC_DRIVE_DIAG = 0x90, - CMD_FORMAT_TRACK = 0x50, - CMD_INIT_DRIVE_PARAM = 0x91, - CMD_READ_LONG = 0x22, - CMD_READ_LONG_NO_RETRY = 0x23, - CMD_READ_SECTOR = 0x20, - CMD_READ_SECTOR_NO_RETRY = 0x21, - CMD_VERIFY_SECTOR = 0x40, - CMD_VERIFY_SECTOR_NO_RETRY = 0x41, - CMD_RECALIBRATE = 0x10, - CMD_WRITE_LONG = 0x32, - CMD_WRITE_LONG_NO_RETRY = 0x33, - CMD_WRITE_SECTOR = 0x30, - CMD_WRITE_SECTOR_NO_RETRY = 0x31, - CMD_IDENTIFY_DRIVE = 0xEC, -}; - -enum transfer_operations { - TRF_NONE = 0, - TRF_SECTOR_READ, - TRF_SECTOR_WRITE, - TRF_IDENTIFY, -}; - -enum ata_status_flags { - ST_ERR = 1, - ST_IDX = 2, - ST_CORR = 4, - ST_DRQ = 8, - ST_DSC = 16, - ST_DF = 32, - ST_DRDY = 64, - ST_BSY = 128 -}; - -enum ata_error_flags { - ERR_AMNF = 1, - ERR_TKNONF = 2, - ERR_ABRT = 4, - ERR_MCR = 8, - ERR_IDNF = 16, - ERR_MC = 32, - ERR_UNC = 64, -}; - -ide_disk::ide_disk() -{ - reset(); - m_buffer_pos = 0; - m_buffer = new unsigned short[256]; - m_irq_callback = nullptr; -} - -void ide_disk::set_irq_callback(void (*irq)(int)) -{ - m_irq_callback = irq; -} - -void ide_disk::reset() -{ - // Killer Instinct geometry - // CYLS:419,HEADS:13,SECS:47,BPS:512. - m_num_cylinders = 419; - m_num_heads = 13; - m_num_sectors = 47; - m_num_bytes_per_sector = 512; - - m_status = 0; - build_identify_buffer(); -} - -void ide_disk::execute() -{ - switch (m_command) { - case CMD_EXEC_DRIVE_DIAG: cmd_exec_drive_diag(); break; - case CMD_INIT_DRIVE_PARAM: cmd_init_drive_params(); break; - case CMD_READ_LONG: cmd_read_long(); break; - case CMD_READ_LONG_NO_RETRY: cmd_read_long_wor(); break; - case CMD_READ_SECTOR: cmd_read_sector(); break; - case CMD_READ_SECTOR_NO_RETRY: cmd_read_sector_wor(); break; - case CMD_WRITE_LONG: cmd_write_long(); break; - case CMD_WRITE_LONG_NO_RETRY: cmd_write_long_wor(); break; - case CMD_WRITE_SECTOR: cmd_write_sector(); break; - case CMD_WRITE_SECTOR_NO_RETRY: cmd_write_sector_wor(); break; - case CMD_IDENTIFY_DRIVE: cmd_indentify_drive(); break; - default: - ata_log("unimplemented command %x\n", m_command); - break; - } -} - -void ide_disk::build_identify_buffer() -{ - memset(m_identify_buffer, 0, sizeof(m_identify_buffer)); - - // Killer Instinct 1 - m_identify_buffer[0] = 0x5354; - m_identify_buffer[1] = 0x3931; - m_identify_buffer[2] = 0x3530; - m_identify_buffer[3] = 0x4147; - m_identify_buffer[4] = 0x2020; - m_identify_buffer[6] = m_num_sectors; - - // serial number - for (int i = 0; i < 10; i++) - m_identify_buffer[10 + i] = '0'; - - strncpy((char *) &m_identify_buffer[27], "Generic IDE HD", 27); - - - // KI I - m_identify_buffer[10] = ('0' << 8) | '0'; - m_identify_buffer[11] = ('S' << 8) | 'T'; - m_identify_buffer[12] = ('9' << 8) | '1'; - m_identify_buffer[13] = ('5' << 8) | '0'; - m_identify_buffer[14] = ('A' << 8) | 'G'; - - // KI II - m_identify_buffer[27] = ('S' << 8) | 'T'; - m_identify_buffer[28] = ('9' << 8) | '1'; - m_identify_buffer[29] = ('5' << 8) | '0'; - m_identify_buffer[30] = ('A' << 8) | 'G'; - m_identify_buffer[31] = (' ' << 8) | ' '; -} - -unsigned ide_disk::chs_to_lba(int cylinder, int head, int sector) -{ - return ((cylinder * m_num_heads + head) * m_num_sectors) + sector - 1; -} - -void ide_disk::chs_next_sector() -{ - m_sector_number++; - if (m_sector_number >= m_num_sectors) { - m_sector_number = 0; - m_drive_head++; - if (m_drive_head >= m_num_heads) { - m_drive_head = 0; - m_cylinder_low++; - if (m_cylinder_low >= 256) { - m_cylinder_low = 0; - m_cylinder_high++; - } - } - } -} - -unsigned ide_disk::lba_from_regs() -{ - return chs_to_lba(m_cylinder_low | (m_cylinder_high << 8), m_drive_head, m_sector_number); -} - -inline bool ide_disk::is_drive_ready() -{ - if (m_status & ST_DRDY) - return true; - - m_error |= ERR_ABRT; - m_status |= ST_ERR; - m_status &= ~ST_BSY; -} - -void ide_disk::raise_interrupt() -{ - if (~m_device_control & 2) - if (m_irq_callback) - m_irq_callback(1); -} - -void ide_disk::clear_interrupt() -{ - if (m_irq_callback) - m_irq_callback(0); -} - - -void ide_disk::write(unsigned offset, unsigned value) -{ - //ata_log("[%x] write: %x = %x\n", mips::g_mips->m_state.pc, offset, value); - - switch (offset) { - case REG_COMMAND_WO: - - m_command = value; - execute(); - - break; - - case REG_DATA: - if (m_status & ST_DRQ) { - if (m_transfer_operation == TRF_SECTOR_WRITE) { - m_buffer[m_buffer_pos++] = value; - //ata_log("ata_write_data: %02x\n", value); - if (m_buffer_pos >= m_num_bytes_per_sector / 2) - update_transfer(); - } - } - break; - - case REG_FEATURES_WO: - break; - - case REG_SECTOR_COUNT: - m_sector_count = value; - break; - - case REG_SECTOR_NUMBER: - m_sector_number = value; - break; - - case REG_CYLINDER_LOW: - m_cylinder_low = value; - break; - - case REG_CYLINDER_HIGH: - m_cylinder_high = value; - break; - - case REG_DRIVE_HEAD: - m_drive_head = value; - break; - } -} - -void ide_disk::write_alternate(unsigned offset, unsigned value) -{ - ata_log("write_alt: %x = %x\n", offset, value); - m_device_control = value; -} - -unsigned ide_disk::read(unsigned offset) -{ - //ata_log("ata_read: %x\n", offset); - - switch (offset) { - case REG_STATUS_RO: - //ata_log("ata_read_status: %x\n", offset); - clear_interrupt(); - return m_status; - - case REG_ERROR_RO: - return m_error; - - case REG_DATA: - if (m_status & ST_DRQ) { - if ((m_transfer_operation == TRF_SECTOR_READ) || - (m_transfer_operation == TRF_IDENTIFY)) { - unsigned data = m_buffer[m_buffer_pos++]; - - if (m_transfer_operation == TRF_IDENTIFY) { - ata_log("ata_read_data: %02x\n", data); - } - if (m_buffer_pos >= m_num_bytes_per_sector / 2) - update_transfer(); - return data; - } - } - return 0; - case REG_SECTOR_COUNT: - return m_sector_count; - case REG_SECTOR_NUMBER: - return m_sector_number; - case REG_CYLINDER_LOW: - return m_cylinder_low; - case REG_CYLINDER_HIGH: - return m_cylinder_high; - case REG_DRIVE_HEAD: - return m_drive_head; - } - - // shouldn't happen - return 0; -} - -unsigned ide_disk::read_alternate(unsigned offset) -{ - //ata_log("read_alt: %x\n", offset); - switch (offset) { - case REG_ALT_DRIVE_ADDRESS_RO: - case REG_ALT_STATUS_RO: - return m_status | 0x40 /* hack? */; - } - return 0; -} - -bool ide_disk::load_disk_image(const string &filename) -{ - m_disk_image.open(filename, ios_base::binary | ios_base::in | ios_base::out); - if (!m_disk_image.is_open()) { - ata_log("disk image not found!\n"); - return false; - } - return true; -} - -void ide_disk::setup_transfer(int mode) -{ - m_transfer_operation = mode; - - m_buffer_pos = 0; - if (m_sector_count == 0) - m_sector_count = 256; - - if (mode == TRF_IDENTIFY) - m_sector_count = 1; - - m_transfer_write_first = true; - update_transfer(); - m_transfer_write_first = false; -} - -void ide_disk::update_transfer() -{ - if (m_transfer_operation == TRF_NONE) - return; - - if (m_sector_count < 0) { - m_status &= ~ST_DRQ; - m_transfer_operation = TRF_NONE; - return; - } - - unsigned lba = 0; - switch (m_transfer_operation) { - case TRF_IDENTIFY: - memcpy(m_buffer, m_identify_buffer, sizeof(m_identify_buffer)); - break; - - case TRF_SECTOR_WRITE: - if (!m_transfer_write_first) - flush_write_transfer(); - - case TRF_SECTOR_READ: - lba = lba_from_regs() * m_num_bytes_per_sector; - m_last_buffer_lba = lba; - - m_disk_image.seekg(lba, ios_base::beg); - m_disk_image.read(reinterpret_cast(m_buffer), m_num_bytes_per_sector); - m_buffer_pos = 0; - - chs_next_sector(); - break; - } - - - m_sector_count--; - m_status |= ST_DRQ; - raise_interrupt(); -} - -void ide_disk::flush_write_transfer() -{ - ata_log("flush write buffer\n"); - - m_disk_image.seekp(m_last_buffer_lba, ios_base::beg); - m_disk_image.write(reinterpret_cast(m_buffer), m_num_bytes_per_sector); -} - -// ========================================================================== // -// ATA COMMANDS // -// ========================================================================== // - -void ide_disk::cmd_exec_drive_diag() -{ - ata_log("exec_drive_dialog()\n"); -} - -void ide_disk::cmd_init_drive_params() -{ - ata_log("init_drive_params(logsec_per_logtrack=%d, logheads=%d)\n", - m_sector_count, m_drive_head - 1); - - m_num_sectors = m_sector_count; - m_num_heads = (m_drive_head & 0xF) + 1; - - m_status |= ST_DRDY; - m_status &= ~ST_BSY; - raise_interrupt(); -} - -void ide_disk::cmd_read_long() -{ - ata_log("read_long(cyl_lo=%d, cyl_hi=%d, head=%d, sector=%d) [sec_count=%d]\n", - m_cylinder_low, m_cylinder_high, m_drive_head, - m_sector_number, m_sector_count); -} - -void ide_disk::cmd_read_long_wor() -{ - ata_log("read_long_wor(cyl_lo=%d, cyl_hi=%d, head=%d, sector=%d) [sec_count=%d]\n", - m_cylinder_low, m_cylinder_high, m_drive_head, - m_sector_number, m_sector_count); -} - -void ide_disk::cmd_read_sector() -{ - ata_log("read_sector(cyl_lo=%d, cyl_hi=%d, head=%d, sector=%d, sec_count=%d) [%0x]\n", - m_cylinder_low, m_cylinder_high, m_drive_head, - m_sector_number, m_sector_count, - chs_to_lba(m_cylinder_low | (m_cylinder_high << 8), m_drive_head, m_sector_number)); - - setup_transfer(TRF_SECTOR_READ); -} - -void ide_disk::cmd_read_sector_wor() -{ - ata_log("read_sector_wor(cyl_lo=%d, cyl_hi=%d, head=%d, sector=%d, sec_count=%d) [%0x]\n", - m_cylinder_low, m_cylinder_high, m_drive_head, - m_sector_number, m_sector_count, - chs_to_lba(m_cylinder_low | (m_cylinder_high << 8), m_drive_head, m_sector_number)); -} - -void ide_disk::cmd_write_long() -{ - ata_log("write_long(cyl_lo=%d, cyl_hi=%d, head=%d, sector=%d) [sec_count=%d]\n", - m_cylinder_low, m_cylinder_high, m_drive_head, - m_sector_number, m_sector_count); -} - -void ide_disk::cmd_write_long_wor() -{ - ata_log("write_long_wor(cyl_lo=%d, cyl_hi=%d, head=%d, sector=%d) [sec_count=%d]\n", - m_cylinder_low, m_cylinder_high, m_drive_head, - m_sector_number, m_sector_count); -} - -void ide_disk::cmd_write_sector() -{ - ata_log("write_sector(cyl_lo=%d, cyl_hi=%d, head=%d, sector=%d, sec_count=%d) [%0x]\n", - m_cylinder_low, m_cylinder_high, m_drive_head, - m_sector_number, m_sector_count, - chs_to_lba(m_cylinder_low | (m_cylinder_high << 8), m_drive_head, m_sector_number)); - - setup_transfer(TRF_SECTOR_WRITE); -} - -void ide_disk::cmd_write_sector_wor() -{ - ata_log("write_sector_wor(cyl_lo=%d, cyl_hi=%d, head=%d, sector=%d, sec_count=%d) [%0x]\n", - m_cylinder_low, m_cylinder_high, m_drive_head, - m_sector_number, m_sector_count, - chs_to_lba(m_cylinder_low | (m_cylinder_high << 8), m_drive_head, m_sector_number)); -} - -void ide_disk::cmd_indentify_drive() -{ - ata_log("identify_drive()\n"); - setup_transfer(TRF_IDENTIFY); -} - - - -} diff --git a/jan/src/burn/drv/midway/ide.h b/jan/src/burn/drv/midway/ide.h deleted file mode 100644 index 1c0fb2c6d..000000000 --- a/jan/src/burn/drv/midway/ide.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef IDE -#define IDE - -#include -#include - -namespace ide -{ - -using namespace std; - -class ide_disk -{ -public: - void write(unsigned offset, unsigned value); - void write_alternate(unsigned offset, unsigned value); - unsigned read(unsigned offset); - unsigned read_alternate(unsigned offset); - bool load_disk_image(const string &filename); - ide_disk(); - - void set_irq_callback(void (*irq)(int state)); - - -private: - void reset(); - void execute(); - void build_identify_buffer(); - - unsigned chs_to_lba(int cylinder, int head, int sector); - void chs_next_sector(); - unsigned lba_from_regs(); - bool is_drive_ready(); - void raise_interrupt(); - void clear_interrupt(); - - // commands - void cmd_exec_drive_diag(); - void cmd_init_drive_params(); - void cmd_read_long(); - void cmd_read_long_wor(); - void cmd_read_sector(); - void cmd_read_sector_wor(); - void cmd_write_long(); - void cmd_write_long_wor(); - void cmd_write_sector(); - void cmd_write_sector_wor(); - void cmd_indentify_drive(); - - void (*m_irq_callback)(int state); - - unsigned short *m_buffer; - int m_buffer_pos; - unsigned m_last_buffer_lba; - - void setup_transfer(int mode); - void update_transfer(); - void flush_write_transfer(); - - short m_identify_buffer[256]; - - int m_transfer_count; - int m_transfer_operation; - bool m_transfer_write_first; - - int m_num_cylinders; - int m_num_heads; - int m_num_sectors; - int m_num_bytes_per_sector; - - int m_device_control; - int m_error; - int m_sector_count; - int m_sector_number; - int m_cylinder_low; - int m_cylinder_high; - int m_drive_head; - int m_status; - int m_features; - int m_command; - - fstream m_disk_image; - -}; - -} - -#endif // IDE - diff --git a/jan/src/burn/drv/midway/midtunit_dma.h b/jan/src/burn/drv/midway/midtunit_dma.h deleted file mode 100644 index 4b0a75981..000000000 --- a/jan/src/burn/drv/midway/midtunit_dma.h +++ /dev/null @@ -1,438 +0,0 @@ -// license:??? -// copyright-holders:Alex Pasadyn, Zsolt Vasvari, Kurt Mahan, Ernesto Corvi, Aaron Giles -/************************************************************************* - - Driver for Midway T-unit games. - -**************************************************************************/ -// Adapted to FBAlpha -#define XPOSMASK 0x3ff -#define YPOSMASK 0x1ff - -enum -{ - DMA_LRSKIP = 0, - DMA_COMMAND, - DMA_OFFSETLO, - DMA_OFFSETHI, - DMA_XSTART, - DMA_YSTART, - DMA_WIDTH, - DMA_HEIGHT, - DMA_PALETTE, - DMA_COLOR, - DMA_SCALE_X, - DMA_SCALE_Y, - DMA_TOPCLIP, - DMA_BOTCLIP, - DMA_UNKNOWN_E, /* MK1/2 never write here; NBA only writes 0 */ - DMA_CONFIG, - DMA_LEFTCLIP, /* pseudo-register */ - DMA_RIGHTCLIP /* pseudo-register */ -}; - - -static struct -{ - UINT8 * gfxrom; - - UINT32 offset; /* source offset, in bits */ - INT32 rowbits; /* source bits to skip each row */ - INT32 xpos; /* x position, clipped */ - INT32 ypos; /* y position, clipped */ - INT32 width; /* horizontal pixel count */ - INT32 height; /* vertical pixel count */ - UINT16 palette; /* palette base */ - UINT16 color; /* current foreground color with palette */ - - UINT8 yflip; /* yflip? */ - UINT8 bpp; /* bits per pixel */ - UINT8 preskip; /* preskip scale */ - UINT8 postskip; /* postskip scale */ - INT32 topclip; /* top clipping scanline */ - INT32 botclip; /* bottom clipping scanline */ - INT32 leftclip; /* left clipping column */ - INT32 rightclip; /* right clipping column */ - INT32 startskip; /* pixels to skip at start */ - INT32 endskip; /* pixels to skip at end */ - UINT16 xstep; /* 8.8 fixed number scale x factor */ - UINT16 ystep; /* 8.8 fixed number scale y factor */ -} dma_state; - -/*** constant definitions ***/ -#define PIXEL_SKIP 0 -#define PIXEL_COLOR 1 -#define PIXEL_COPY 2 - -#define XFLIP_NO 0 -#define XFLIP_YES 1 - -#define SKIP_NO 0 -#define SKIP_YES 1 - -#define SCALE_NO 0 -#define SCALE_YES 1 - -#define XPOSMASK 0x3ff -#define YPOSMASK 0x1ff - - -typedef void (*dma_draw_func)(void); - - -/*** fast pixel extractors ***/ -#if 1//!defined(ALIGN_SHORTS) && defined(LSB_FIRST) -#define EXTRACTGEN(m) ((*(UINT16 *)&base[o >> 3] >> (o & 7)) & (m)) -#elif defined(powerc) -#define EXTRACTGEN(m) ((__lhbrx(base, o >> 3) >> (o & 7)) & (m)) -#else -#define EXTRACTGEN(m) (((base[o >> 3] | (base[(o >> 3) + 1] << 8)) >> (o & 7)) & (m)) -#endif - -/*** core blitter routine macro ***/ -#define DMA_DRAW_FUNC_BODY(name, bitsperpixel, extractor, xflip, skip, scale, zero, nonzero) \ -{ \ - int height = dma_state.height << 8; \ - UINT8 *base = dma_state.gfxrom; \ - UINT32 offset = dma_state.offset; \ - UINT16 pal = dma_state.palette; \ - UINT16 color = pal | dma_state.color; \ - int sy = dma_state.ypos, iy = 0, ty; \ - int bpp = bitsperpixel; \ - int mask = (1 << bpp) - 1; \ - int xstep = scale ? dma_state.xstep : 0x100; \ - \ - /* loop over the height */ \ - while (iy < height) \ - { \ - int startskip = dma_state.startskip << 8; \ - int endskip = dma_state.endskip << 8; \ - int width = dma_state.width << 8; \ - int sx = dma_state.xpos, ix = 0, tx; \ - UINT32 o = offset; \ - int pre, post; \ - UINT16 *d; \ - \ - /* handle skipping */ \ - if (skip) \ - { \ - UINT8 value = EXTRACTGEN(0xff); \ - o += 8; \ - \ - /* adjust for preskip */ \ - pre = (value & 0x0f) << (dma_state.preskip + 8); \ - tx = pre / xstep; \ - if (xflip) \ - sx = (sx - tx) & XPOSMASK; \ - else \ - sx = (sx + tx) & XPOSMASK; \ - ix += tx * xstep; \ - \ - /* adjust for postskip */ \ - post = ((value >> 4) & 0x0f) << (dma_state.postskip + 8); \ - width -= post; \ - endskip -= post; \ - } \ - \ - /* handle Y clipping */ \ - if (sy < dma_state.topclip || sy > dma_state.botclip) \ - goto clipy; \ - \ - /* handle start skip */ \ - if (ix < startskip) \ - { \ - tx = ((startskip - ix) / xstep) * xstep; \ - ix += tx; \ - o += (tx >> 8) * bpp; \ - } \ - \ - /* handle end skip */ \ - if ((width >> 8) > dma_state.width - dma_state.endskip) \ - width = (dma_state.width - dma_state.endskip) << 8; \ - \ - /* determine destination pointer */ \ - d = &DrvVRAM16[sy * 512]; \ - \ - /* loop until we draw the entire width */ \ - while (ix < width) \ - { \ - /* only process if not clipped */ \ - if (sx >= dma_state.leftclip && sx <= dma_state.rightclip) \ - { \ - /* special case similar handling of zero/non-zero */ \ - if (zero == nonzero) \ - { \ - if (zero == PIXEL_COLOR) \ - d[sx] = color; \ - else if (zero == PIXEL_COPY) \ - d[sx] = (extractor(mask)) | pal; \ - } \ - \ - /* otherwise, read the pixel and look */ \ - else \ - { \ - int pixel = (extractor(mask)); \ - \ - /* non-zero pixel case */ \ - if (pixel) \ - { \ - if (nonzero == PIXEL_COLOR) \ - d[sx] = color; \ - else if (nonzero == PIXEL_COPY) \ - d[sx] = pixel | pal; \ - } \ - \ - /* zero pixel case */ \ - else \ - { \ - if (zero == PIXEL_COLOR) \ - d[sx] = color; \ - else if (zero == PIXEL_COPY) \ - d[sx] = pal; \ - } \ - } \ - } \ - \ - /* update pointers */ \ - if (xflip) \ - sx = (sx - 1) & XPOSMASK; \ - else \ - sx = (sx + 1) & XPOSMASK; \ - \ - /* advance to the next pixel */ \ - if (!scale) \ - { \ - ix += 0x100; \ - o += bpp; \ - } \ - else \ - { \ - tx = ix >> 8; \ - ix += xstep; \ - tx = (ix >> 8) - tx; \ - o += bpp * tx; \ - } \ - } \ - \ -clipy: \ - /* advance to the next row */ \ - if (dma_state.yflip) \ - sy = (sy - 1) & YPOSMASK; \ - else \ - sy = (sy + 1) & YPOSMASK; \ - if (!scale) \ - { \ - iy += 0x100; \ - width = dma_state.width; \ - if (skip) \ - { \ - offset += 8; \ - width -= (pre + post) >> 8; \ - if (width > 0) offset += width * bpp; \ - } \ - else \ - offset += width * bpp; \ - } \ - else \ - { \ - ty = iy >> 8; \ - iy += dma_state.ystep; \ - ty = (iy >> 8) - ty; \ - if (!skip) \ - offset += ty * dma_state.width * bpp; \ - else if (ty--) \ - { \ - o = offset + 8; \ - width = dma_state.width - ((pre + post) >> 8);\ - if (width > 0) o += width * bpp; \ - while (ty--) \ - { \ - UINT8 value = EXTRACTGEN(0xff); \ - o += 8; \ - pre = (value & 0x0f) << dma_state.preskip;\ - post = ((value >> 4) & 0x0f) << dma_state.postskip; \ - width = dma_state.width - pre - post; \ - if (width > 0) o += width * bpp; \ - } \ - offset = o; \ - } \ - } \ - } \ -} - - -/*** slightly simplified one for most blitters ***/ -#define DMA_DRAW_FUNC(name, bpp, extract, xflip, skip, scale, zero, nonzero) \ - static void name(void) \ -{ \ - DMA_DRAW_FUNC_BODY(name, bpp, extract, xflip, skip, scale, zero, nonzero) \ -} - -/*** empty blitter ***/ -static void dma_draw_none(void) -{ -} - -/*** super macro for declaring an entire blitter family ***/ -#define DECLARE_BLITTER_SET(prefix, bpp, extract, skip, scale) \ - DMA_DRAW_FUNC(prefix##_p0, bpp, extract, XFLIP_NO, skip, scale, PIXEL_COPY, PIXEL_SKIP) \ - DMA_DRAW_FUNC(prefix##_p1, bpp, extract, XFLIP_NO, skip, scale, PIXEL_SKIP, PIXEL_COPY) \ - DMA_DRAW_FUNC(prefix##_c0, bpp, extract, XFLIP_NO, skip, scale, PIXEL_COLOR, PIXEL_SKIP) \ - DMA_DRAW_FUNC(prefix##_c1, bpp, extract, XFLIP_NO, skip, scale, PIXEL_SKIP, PIXEL_COLOR) \ - DMA_DRAW_FUNC(prefix##_p0p1, bpp, extract, XFLIP_NO, skip, scale, PIXEL_COPY, PIXEL_COPY) \ - DMA_DRAW_FUNC(prefix##_c0c1, bpp, extract, XFLIP_NO, skip, scale, PIXEL_COLOR, PIXEL_COLOR) \ - DMA_DRAW_FUNC(prefix##_c0p1, bpp, extract, XFLIP_NO, skip, scale, PIXEL_COLOR, PIXEL_COPY) \ - DMA_DRAW_FUNC(prefix##_p0c1, bpp, extract, XFLIP_NO, skip, scale, PIXEL_COPY, PIXEL_COLOR) \ - \ - DMA_DRAW_FUNC(prefix##_p0_xf, bpp, extract, XFLIP_YES, skip, scale, PIXEL_COPY, PIXEL_SKIP) \ - DMA_DRAW_FUNC(prefix##_p1_xf, bpp, extract, XFLIP_YES, skip, scale, PIXEL_SKIP, PIXEL_COPY) \ - DMA_DRAW_FUNC(prefix##_c0_xf, bpp, extract, XFLIP_YES, skip, scale, PIXEL_COLOR, PIXEL_SKIP) \ - DMA_DRAW_FUNC(prefix##_c1_xf, bpp, extract, XFLIP_YES, skip, scale, PIXEL_SKIP, PIXEL_COLOR) \ - DMA_DRAW_FUNC(prefix##_p0p1_xf, bpp, extract, XFLIP_YES, skip, scale, PIXEL_COPY, PIXEL_COPY) \ - DMA_DRAW_FUNC(prefix##_c0c1_xf, bpp, extract, XFLIP_YES, skip, scale, PIXEL_COLOR, PIXEL_COLOR) \ - DMA_DRAW_FUNC(prefix##_c0p1_xf, bpp, extract, XFLIP_YES, skip, scale, PIXEL_COLOR, PIXEL_COPY) \ - DMA_DRAW_FUNC(prefix##_p0c1_xf, bpp, extract, XFLIP_YES, skip, scale, PIXEL_COPY, PIXEL_COLOR) \ - \ - static const dma_draw_func prefix[32] = \ - { \ - /* B0:N / B1:N B0:Y / B1:N B0:N / B1:Y B0:Y / B1:Y */ \ - dma_draw_none, prefix##_p0, prefix##_p1, prefix##_p0p1, /* no color */ \ - prefix##_c0, prefix##_c0, prefix##_c0p1, prefix##_c0p1, /* color 0 pixels */ \ - prefix##_c1, prefix##_p0c1, prefix##_c1, prefix##_p0c1, /* color non-0 pixels */\ - prefix##_c0c1, prefix##_c0c1, prefix##_c0c1, prefix##_c0c1, /* fill */ \ - \ - dma_draw_none, prefix##_p0_xf, prefix##_p1_xf, prefix##_p0p1_xf, /* no color */ \ - prefix##_c0_xf, prefix##_c0_xf, prefix##_c0p1_xf, prefix##_c0p1_xf, /* color 0 pixels */ \ - prefix##_c1_xf, prefix##_p0c1_xf, prefix##_c1_xf, prefix##_p0c1_xf, /* color non-0 pixels */\ - prefix##_c0c1_xf, prefix##_c0c1_xf, prefix##_c0c1_xf, prefix##_c0c1_xf /* fill */ \ - }; - - -/*** blitter family declarations ***/ -DECLARE_BLITTER_SET(dma_draw_skip_scale, dma_state.bpp, EXTRACTGEN, SKIP_YES, SCALE_YES) -DECLARE_BLITTER_SET(dma_draw_noskip_scale, dma_state.bpp, EXTRACTGEN, SKIP_NO, SCALE_YES) -DECLARE_BLITTER_SET(dma_draw_skip_noscale, dma_state.bpp, EXTRACTGEN, SKIP_YES, SCALE_NO) -DECLARE_BLITTER_SET(dma_draw_noskip_noscale, dma_state.bpp, EXTRACTGEN, SKIP_NO, SCALE_NO) - - -static UINT16 TUnitDmaRead(UINT32 address) -{ - UINT32 offset = (address >> 4) & 0xF; - if (offset == 0) - offset = 1; - return nDMA[offset]; -} - -#define DMA_IRQ TMS34010_INT_EX1 -static void TUnitDmaWrite(UINT32 address, UINT16 value) -{ - dma_state.gfxrom = DrvGfxROM; - static const UINT8 register_map[2][16] = - { - { 0,1,2,3,4,5,6,7,8,9,10,11,16,17,14,15 }, - { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 } - }; - int regbank = (nDMA[DMA_CONFIG] >> 5) & 1; - int reg = register_map[regbank][(address >> 4) & 0xF]; - int command, bpp, regnum; - UINT32 gfxoffset; - int pixels = 0; - - nDMA[reg] = value; - - if (reg != DMA_COMMAND) - return; - command = nDMA[DMA_COMMAND]; - regnum = reg; - - TMS34010ClearIRQ(DMA_IRQ); - if (!(value & 0x8000)) { - return; - } - bpp = (command >> 12) & 7; - - /* fill in the basic data */ - dma_state.xpos = nDMA[DMA_XSTART] & XPOSMASK; - dma_state.ypos = nDMA[DMA_YSTART] & YPOSMASK; - dma_state.width = nDMA[DMA_WIDTH] & 0x3ff; - dma_state.height = nDMA[DMA_HEIGHT] & 0x3ff; - dma_state.palette = nDMA[DMA_PALETTE] & 0x7f00; - dma_state.color = nDMA[DMA_COLOR] & 0xff; - - /* fill in the rev 2 data */ - dma_state.yflip = (command & 0x20) >> 5; - dma_state.bpp = bpp ? bpp : 8; - dma_state.preskip = (command >> 8) & 3; - dma_state.postskip = (command >> 10) & 3; - dma_state.xstep = nDMA[DMA_SCALE_X] ? nDMA[DMA_SCALE_X] : 0x100; - dma_state.ystep = nDMA[DMA_SCALE_Y] ? nDMA[DMA_SCALE_Y] : 0x100; - - /* clip the clippers */ - dma_state.topclip = nDMA[DMA_TOPCLIP] & 0x1ff; - dma_state.botclip = nDMA[DMA_BOTCLIP] & 0x1ff; - dma_state.leftclip = nDMA[DMA_LEFTCLIP] & 0x3ff; - dma_state.rightclip = nDMA[DMA_RIGHTCLIP] & 0x3ff; - - /* determine the offset */ - gfxoffset = nDMA[DMA_OFFSETLO] | (nDMA[DMA_OFFSETHI] << 16); - - /* special case: drawing mode C doesn't need to know about any pixel data */ - if ((command & 0x0f) == 0x0c) - gfxoffset = 0; - - /* determine the location */ - if (!bGfxRomLarge && gfxoffset >= 0x2000000) - gfxoffset -= 0x2000000; - if (gfxoffset >= 0xf8000000) - gfxoffset -= 0xf8000000; - if (gfxoffset < 0x10000000) - dma_state.offset = gfxoffset; - else - { - goto skipdma; - } - - /* there seems to be two types of behavior for the DMA chip */ - /* for MK1 and MK2, the upper byte of the LRSKIP is the */ - /* starting skip value, and the lower byte is the ending */ - /* skip value; for the NBA Jam, Hangtime, and Open Ice, the */ - /* full word seems to be the starting skip value. */ - if (command & 0x40) - { - dma_state.startskip = nDMA[DMA_LRSKIP] & 0xff; - dma_state.endskip = nDMA[DMA_LRSKIP] >> 8; - } - else - { - dma_state.startskip = 0; - dma_state.endskip = nDMA[DMA_LRSKIP]; - } - - /* then draw */ - if (dma_state.xstep == 0x100 && dma_state.ystep == 0x100) - { - if (command & 0x80) - (*dma_draw_skip_noscale[command & 0x1f])(); - else - (*dma_draw_noskip_noscale[command & 0x1f])(); - - pixels = dma_state.width * dma_state.height; - } - else - { - if (command & 0x80) - (*dma_draw_skip_scale[command & 0x1f])(); - else - (*dma_draw_noskip_scale[command & 0x1f])(); - - if (dma_state.xstep && dma_state.ystep) - pixels = ((dma_state.width << 8) / dma_state.xstep) * ((dma_state.height << 8) / dma_state.ystep); - else - pixels = 0; - } - -skipdma: - TMS34010GenerateIRQ(DMA_IRQ); - nDMA[DMA_COMMAND] &= ~0x8000; - -} diff --git a/jan/src/burn/drv/midway/midwayic.cpp b/jan/src/burn/drv/midway/midwayic.cpp deleted file mode 100644 index 41a19ea0f..000000000 --- a/jan/src/burn/drv/midway/midwayic.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* Ported from MAME */ -#include "burnint.h" -#include "midwayic.h" - -static int nUpper; -static UINT8 nData[16]; -static UINT8 nBuffer; -static UINT8 nIndex; -static UINT8 nStatus; -static UINT8 nBits; -static UINT8 nOrMask; - -void MidwaySerialPicInit(int upper) -{ - nUpper = upper; - for (int i = 0; i < 16; i++) - nData[i] = 0; - MidwaySerialPicReset(); - - int year = 1994, month = 12, day = 11; - UINT32 serial_number, temp; - UINT8 serial_digit[9]; - - serial_number = 123456; - serial_number += upper * 1000000; - - serial_digit[0] = (serial_number / 100000000) % 10; - serial_digit[1] = (serial_number / 10000000) % 10; - serial_digit[2] = (serial_number / 1000000) % 10; - serial_digit[3] = (serial_number / 100000) % 10; - serial_digit[4] = (serial_number / 10000) % 10; - serial_digit[5] = (serial_number / 1000) % 10; - serial_digit[6] = (serial_number / 100) % 10; - serial_digit[7] = (serial_number / 10) % 10; - serial_digit[8] = (serial_number / 1) % 10; - - nData[12] = rand() & 0xff; - nData[13] = rand() & 0xff; - - nData[14] = 0; /* ??? */ - nData[15] = 0; /* ??? */ - - temp = 0x174 * (year - 1980) + 0x1f * (month - 1) + day; - nData[10] = (temp >> 8) & 0xff; - nData[11] = temp & 0xff; - - temp = serial_digit[4] + serial_digit[7] * 10 + serial_digit[1] * 100; - temp = (temp + 5 * nData[13]) * 0x1bcd + 0x1f3f0; - nData[7] = temp & 0xff; - nData[8] = (temp >> 8) & 0xff; - nData[9] = (temp >> 16) & 0xff; - - temp = serial_digit[6] + serial_digit[8] * 10 + serial_digit[0] * 100 + serial_digit[2] * 10000; - temp = (temp + 2 * nData[13] + nData[12]) * 0x107f + 0x71e259; - nData[3] = temp & 0xff; - nData[4] = (temp >> 8) & 0xff; - nData[5] = (temp >> 16) & 0xff; - nData[6] = (temp >> 24) & 0xff; - - temp = serial_digit[5] * 10 + serial_digit[3] * 100; - temp = (temp + nData[12]) * 0x245 + 0x3d74; - nData[0] = temp & 0xff; - nData[1] = (temp >> 8) & 0xff; - nData[2] = (temp >> 16) & 0xff; - - /* special hack for RevX */ - nOrMask = 0x80; - if (upper == 419) - nOrMask = 0x00; -} - -void MidwaySerialPicReset() -{ - nBuffer = 0; - nIndex = 0; - nStatus = 0; - nBits = 0; - nOrMask = 0; -} - - -UINT32 MidwaySerialPicStatus() -{ - return nStatus; -} - -UINT8 MidwaySerialPicRead() -{ - nStatus = 1; - return nBuffer; -} - - -void MidwaySerialPicWrite(UINT8 data) -{ - nStatus = (data >> 4) & 1; - if (!nStatus) { - if (data & 0x0f) - nBuffer = nOrMask | data; - else - nBuffer = nData[nIndex++ % sizeof(nData)]; - } -} - diff --git a/jan/src/burn/drv/midway/midwayic.h b/jan/src/burn/drv/midway/midwayic.h deleted file mode 100644 index 629964114..000000000 --- a/jan/src/burn/drv/midway/midwayic.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef SERIALPIC -#define SERIALPIC - -void MidwaySerialPicInit(int upper); -void MidwaySerialPicReset(); -UINT32 MidwaySerialPicStatus(); -UINT8 MidwaySerialPicRead(); -void MidwaySerialPicWrite(UINT8 data); - -#endif // SERIALPIC - diff --git a/jan/src/burn/drv/midway/midwunit.cpp b/jan/src/burn/drv/midway/midwunit.cpp deleted file mode 100644 index d0b150212..000000000 --- a/jan/src/burn/drv/midway/midwunit.cpp +++ /dev/null @@ -1,413 +0,0 @@ -#include "driver.h" -#include "burnint.h" -#include "midwunit.h" -#include "midwayic.h" -#include "dcs2k.h" -#include "tms34010_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *DrvBootROM; -static UINT8 *DrvSoundROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvRAM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvPalette; -static UINT16 *DrvPaletteB; -static UINT8 *DrvVRAM; -static UINT16 *DrvVRAM16; - -UINT8 nWolfUnitRecalc; -UINT8 nWolfUnitJoy1[32]; -UINT8 nWolfUnitJoy2[32]; -UINT8 nWolfUnitJoy3[32]; -UINT8 nWolfUnitDSW[8]; -static UINT32 DrvInputs[4]; -int nIOShuffle[16]; - - -static bool bCMOSWriteEnable = false; - -static bool bGfxRomLarge = true; -static UINT32 nGfxBankOffset[2] = { 0x000000, 0x400000 }; -static UINT32 nVideoBank = 1; - -static UINT16 nDMA[32]; -static UINT16 nWolfUnitCtrl = 0; - - - -#define RGB888(r,g,b) ((r) | ((g) << 8) | ((b) << 16)) -#define RGB888_r(x) ((x) & 0xFF) -#define RGB888_g(x) (((x) >> 8) & 0xFF) -#define RGB888_b(x) (((x) >> 16) & 0xFF) - -#define RGB555_2_888(x) \ - RGB888((x >> 7) & 0xF8, \ - (x >> 2) & 0xF8, \ - (x << 3) & 0xF8) - -#define RGB888_2_565(x) ( \ - ((RGB888_r(x) << 8) & 0xF800) | \ - ((RGB888_g(x) << 3) & 0x07E0) | \ - ((RGB888_b(x) >> 3))) - -#include "midtunit_dma.h" - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvBootROM = Next; Next += 0x80000 * 2; - DrvSoundROM = Next; Next += 0x1000000; - DrvGfxROM = Next; Next += 0x2000000; - DrvRAM = Next; Next += 0x80000; - DrvNVRAM = Next; Next += 0xC000; - DrvPalette = Next; Next += 0x10000; - DrvPaletteB = (UINT16*)Next; Next += 0x10000; - DrvVRAM = Next; Next += 0x400000; - DrvVRAM16 = (UINT16*)DrvVRAM; - MemEnd = Next; - return 0; -} - - -static UINT16 WolfUnitIoRead(UINT32 address) -{ - UINT32 offset = (address >> 4); - offset = nIOShuffle[offset % 16]; - switch (offset) { - case 0: return ~DrvInputs[0]; - case 1: return ~DrvInputs[1]; - case 2: return DrvInputs[2]; - case 3: return ~DrvInputs[3]; - case 4: return ((MidwaySerialPicStatus() << 12) | (Dcs2kDataRead())); - default: - return ~0; - } -} - -void WolfUnitIoWrite(UINT32 address, UINT16 value) -{ - UINT32 offset = (address >> 4) % 8; - switch(offset) { - case 1: - Dcs2kResetWrite(value & 0x10); - MidwaySerialPicReset(); - break; - } -} - -UINT16 WolfUnitCtrlRead(UINT32 address) -{ - return nWolfUnitCtrl; -} - -void WolfUnitCtrlWrite(UINT32 address, UINT16 value) -{ - nWolfUnitCtrl = value; - nGfxBankOffset[0] = 0x800000 * ((nWolfUnitCtrl >> 8) & 3); - nVideoBank = (nWolfUnitCtrl >> 11) & 1; -} - -UINT16 WolfUnitSecurityRead(UINT32 address) -{ - return MidwaySerialPicRead(); -} - -void WolfUnitSecurityWrite(UINT32 address, UINT16 value) -{ - if (address == 0x01600000) { - MidwaySerialPicWrite(value); - } -} - -UINT16 WolfUnitCMOSRead(UINT32 address) -{ - UINT16 *wn = (UINT16*)DrvNVRAM; - UINT32 offset = (address - 0x01400000) >> 1; - return wn[offset]; -} - - -void WolfUnitCMOSWrite(UINT32 address, UINT16 value) -{ - if (bCMOSWriteEnable) { - UINT16 *wn = (UINT16*) DrvNVRAM; - UINT32 offset = (address - 0x01400000) >> 1; - wn[offset] = value; - bCMOSWriteEnable = false; - } -} - -void WolfUnitCMOSWriteEnable(UINT32 address, UINT16 value) -{ - bCMOSWriteEnable = true; -} - - -UINT16 WolfUnitPalRead(UINT32 address) -{ - address &= 0x7FFFF; - return *(UINT16*)(&DrvPalette[TOBYTE(address)]); -} - -void WolfUnitPalWrite(UINT32 address, UINT16 value) -{ - address &= 0x7FFFF; - *(UINT16*)(&DrvPalette[TOBYTE(address)]) = value; - - UINT32 col = RGB555_2_888(BURN_ENDIAN_SWAP_INT16(value)); - DrvPaletteB[address>>4] = BurnHighCol(RGB888_r(col),RGB888_g(col),RGB888_b(col),0); -} - - - -UINT16 WolfUnitVramRead(UINT32 address) -{ - UINT32 offset = TOBYTE(address & 0x3fffff); - if (nVideoBank) - return (DrvVRAM16[offset] & 0x00ff) | (DrvVRAM16[offset + 1] << 8); - else - return (DrvVRAM16[offset] >> 8) | (DrvVRAM16[offset + 1] & 0xff00); -} - -void WolfUnitVramWrite(UINT32 address, UINT16 data) -{ - UINT32 offset = TOBYTE(address & 0x3fffff); - if (nVideoBank) - { - DrvVRAM16[offset] = (data & 0xff) | ((nDMA[DMA_PALETTE] & 0xff) << 8); - DrvVRAM16[offset + 1] = ((data >> 8) & 0xff) | (nDMA[DMA_PALETTE] & 0xff00); - } - else - { - DrvVRAM16[offset] = (DrvVRAM16[offset] & 0xff) | ((data & 0xff) << 8); - DrvVRAM16[offset + 1] = (DrvVRAM16[offset + 1] & 0xff) | (data & 0xff00); - } -} - -UINT16 WolfUnitGfxRead(UINT32 address) -{ - UINT8 *base = DrvGfxROM + nGfxBankOffset[0]; - UINT32 offset = TOBYTE(address - 0x02000000); - return base[offset] | (base[offset + 1] << 8); -} - - -static void WolfUnitToShift(UINT32 address, void *dst) -{ - memcpy(dst, &DrvVRAM16[(address >> 3)], 4096/2); -} - -static void WolfUnitFromShift(UINT32 address, void *src) -{ - memcpy(&DrvVRAM16[(address >> 3)], src, 4096/2); -} - - -static int ScanlineRender(int line, TMS34010Display *info) -{ - if (!pBurnDraw) - return 0; - - UINT16 *src = &DrvVRAM16[(info->rowaddr << 9) & 0x3FE00]; - if (info->rowaddr >= 254) - return 0; - - int col = info->coladdr << 1; - UINT16 *dest = (UINT16*) pBurnDraw + (info->rowaddr * 512); - - const int heblnk = info->heblnk; - const int hsblnk = info->hsblnk; - for (int x = heblnk; x < hsblnk; x++) { - dest[x] = DrvPaletteB[src[col++ & 0x1FF] & 0x7FFF]; - } - - // blank - for (int x = 0; x < heblnk; x++) { - dest[x] = 0; - } - for (int x = hsblnk; x < info->htotal; x++) { - dest[x] = 0; - } - return 0; -} - - -static INT32 LoadSoundBanks() -{ - memset(DrvSoundROM, 0xFF, 0x1000000); - if (BurnLoadRom(DrvSoundROM + 0x000000, 2, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0x200000, 3, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0x400000, 4, 2)) return 1; - if (BurnLoadRom(DrvSoundROM + 0x600000, 5, 2)) return 1; - - return 0; -} - -static INT32 LoadGfxBanks() -{ - char *pRomName; - struct BurnRomInfo pri; - - for (int i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - bprintf(PRINT_NORMAL, _T("ROM %d\n"), i); - BurnDrvGetRomInfo(&pri, i); - if ((pri.nType & 7) == 3) { - - UINT32 addr = WUNIT_GFX_ADR(pri.nType) << 20; - UINT32 offs = WUNIT_GFX_OFF(pri.nType); - - bprintf(PRINT_NORMAL, _T("ROM %d - %X\n"), i, addr+offs); - - if (BurnLoadRom(DrvGfxROM + addr + offs, i, 4) != 0) { - return 1; - } - } - } - return 0; -} - -INT32 WolfUnitInit() -{ - - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) - return 1; - - MemIndex(); - - UINT32 nRet; - nRet = BurnLoadRom(DrvBootROM + 0, 0, 2); - if (nRet != 0) - return 1; - - nRet = BurnLoadRom(DrvBootROM + 1, 1, 2); - if (nRet != 0) - return 1; - - nRet = LoadSoundBanks(); - if (nRet != 0) - return 1; - - nRet = LoadGfxBanks(); - if (nRet != 0) - return 1; - - for (int i = 0; i < 16; i++) - nIOShuffle[i] = i % 8; - - - Dcs2kInit(); - Dcs2kMapSoundROM(DrvSoundROM, 0x1000000); - - MidwaySerialPicInit(528); - MidwaySerialPicReset(); - - TMS34010MapReset(); - TMS34010Init(); - - TMS34010SetScanlineRender(ScanlineRender); - TMS34010SetToShift(WolfUnitToShift); - TMS34010SetFromShift(WolfUnitFromShift); - - TMS34010MapMemory(DrvBootROM, 0xFF800000, 0xFFFFFFFF, MAP_READ); - TMS34010MapMemory(DrvRAM, 0x01000000, 0x013FFFFF, MAP_READ | MAP_WRITE); - - TMS34010SetHandlers(1, WolfUnitIoRead, WolfUnitIoWrite); - TMS34010MapHandler(1, 0x01800000, 0x0187ffff, MAP_READ | MAP_WRITE); - - TMS34010SetHandlers(2, WolfUnitCtrlRead, WolfUnitCtrlWrite); - TMS34010MapHandler(2, 0x01b00000, 0x01b0001f, MAP_READ | MAP_WRITE); - - TMS34010SetHandlers(3, WolfUnitSecurityRead, WolfUnitSecurityWrite); - TMS34010MapHandler(3, 0x01600000, 0x0160001f, MAP_READ | MAP_WRITE); - - TMS34010SetHandlers(4, WolfUnitCMOSRead, WolfUnitCMOSWrite); - TMS34010MapHandler(4, 0x01400000, 0x0145ffff, MAP_READ | MAP_WRITE); - - TMS34010SetWriteHandler(5, WolfUnitCMOSWriteEnable); - TMS34010MapHandler(5, 0x01480000, 0x014fffff, MAP_READ | MAP_WRITE); - - TMS34010SetHandlers(6, WolfUnitPalRead, WolfUnitPalWrite); - TMS34010MapHandler(6, 0x01880000, 0x018fffff, MAP_READ | MAP_WRITE); - - TMS34010SetHandlers(7, TUnitDmaRead, TUnitDmaWrite); - TMS34010MapHandler(7, 0x01a00000, 0x01a000ff, MAP_READ | MAP_WRITE); - TMS34010MapHandler(7, 0x01a80000, 0x01a800ff, MAP_READ | MAP_WRITE); - - - TMS34010SetReadHandler(8, WolfUnitGfxRead); - TMS34010MapHandler(8, 0x02000000, 0x06ffffff, MAP_READ); - - TMS34010SetHandlers(11, WolfUnitVramRead, WolfUnitVramWrite); - TMS34010MapHandler(11, 0x00000000, 0x003fffff, MAP_READ | MAP_WRITE); - - - Dcs2kBoot(); - - Dcs2kResetWrite(1); - Dcs2kResetWrite(0); - - - memset(DrvVRAM, 0, 0x400000); - DrvInputs[2] = 0; - - TMS34010Reset(); - return 0; -} - -static void MakeInputs() -{ - DrvInputs[0] = 0; - DrvInputs[1] = 0; - DrvInputs[2] = 0xFD7D | 0x0200; - DrvInputs[3] = 0; - - for (int i = 0; i < 16; i++) { - if (nWolfUnitJoy1[i] & 1) - DrvInputs[0] |= (1 << i); - if (nWolfUnitJoy2[i] & 1) - DrvInputs[1] |= (1 << i); - if (nWolfUnitJoy3[i] & 1) - DrvInputs[3] |= (1 << i); - } - - if (nWolfUnitDSW[0] & 1) - DrvInputs[2] ^= 0x08000; -} - -INT32 WolfUnitFrame() -{ - MakeInputs(); - static int line = 0; - for (int i = 0; i < 288; i++) { - TMS34010Run(2893);//50000000/60/288 - line = TMS34010GenerateScanline(line); - } - - return 0; -} - -INT32 WolfUnitExit() -{ - Dcs2kExit(); - BurnFree(AllMem); - return 0; -} - -INT32 WolfUnitDraw() -{ - // TMS34010 renders scanlines direct to pBurnDraw - return 0; -} - - - -INT32 WolfUnitScan(INT32 nAction, INT32 *pnMin) -{ - return 0; -} \ No newline at end of file diff --git a/jan/src/burn/drv/midway/midwunit.h b/jan/src/burn/drv/midway/midwunit.h deleted file mode 100644 index 688222ce1..000000000 --- a/jan/src/burn/drv/midway/midwunit.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - - -extern UINT8 nWolfUnitJoy1[32]; -extern UINT8 nWolfUnitJoy2[32]; -extern UINT8 nWolfUnitJoy3[32]; -extern UINT8 nWolfUnitDSW[8]; -extern UINT8 nWolfUnitRecalc; - -#define WUNIT_GFX(msb,s) ((msb & 0xFF) << 12) | ((s & 7) << 8) -#define WUNIT_GFX_ADR(value) ((value & (0xFF << 12)) >> 12) -#define WUNIT_GFX_OFF(value) ((value & (7 << 8)) >> 8) - -INT32 WolfUnitInit(); -INT32 WolfUnitFrame(); -INT32 WolfUnitExit(); -INT32 WolfUnitDraw(); -INT32 WolfUnitScan(INT32 nAction, INT32 *pnMin); \ No newline at end of file diff --git a/jan/src/burn/drv/msx/d_msx.cpp b/jan/src/burn/drv/msx/d_msx.cpp deleted file mode 100644 index a24c4709a..000000000 --- a/jan/src/burn/drv/msx/d_msx.cpp +++ /dev/null @@ -1,24550 +0,0 @@ -// FB Alpha MSX arcade driver module, by dink. memory mapping code (megarom) from fMSX -// -// TODO: -// 1: Clean-up! -// -// Oddities: -// VoidRunner and Milk Race freeze when selecting between kbd/joy. (VoidRunner has a kludge, but it doesn't work for Milk Race) -// Krakout any key starts, can't get into settings - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -#include "tms9928a.h" -#include "8255ppi.h" -#include "bitswap.h" -#include "k051649.h" -#include "dac.h" - -#ifdef BUILD_WIN32 -extern void (*cBurnerKeyCallback)(UINT8 code, UINT8 KeyType, UINT8 down); -extern INT32 nReplayExternalDataCount; -extern UINT8 *ReplayExternalData; -#endif - -#ifndef BUILD_WIN32 -INT32 nReplayExternalDataCount = 0; -UINT8 *ReplayExternalData = NULL; -#endif - -extern "C" { - #include "ay8910.h" -} - -static INT16 *pAY8910Buffer[6]; - -static UINT8 *AllMem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *AllRam = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *maincpu = NULL; // msx bios rom -static UINT8 *game = NULL; // game cart rom, tape side A -static UINT8 *game2 = NULL; // tape side B -static UINT8 *main_mem = NULL; -static UINT8 *kanji_rom = NULL; -static UINT8 *game_sram = NULL; - -static UINT8 *curtape = NULL; // pointer(only) to currently inserted tape. -static INT32 curtapelen = 0; - -static UINT8 use_kanji = 0; -static UINT8 msx_basicmode = 0; - -static UINT8 DrvInputs[2]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy4[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; -static UINT8 DrvNMI = 0; - -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; - -static struct BurnInputInfo MSXInputList[] = { - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Key F1", BIT_DIGITAL, DrvJoy4 + 3, "p1 F1" }, - {"Key F2", BIT_DIGITAL, DrvJoy4 + 4, "p1 F2" }, - {"Key F3", BIT_DIGITAL, DrvJoy4 + 5, "p1 F3" }, - {"Key F4", BIT_DIGITAL, DrvJoy4 + 6, "p1 F4" }, - {"Key F5", BIT_DIGITAL, DrvJoy4 + 7, "p1 F5" }, - {"Key F6", BIT_DIGITAL, DrvJoy4 + 8, "p1 F6" }, - - {"Key UP", BIT_DIGITAL, DrvJoy4 + 9, "p1 KEYUP" }, - {"Key DOWN", BIT_DIGITAL, DrvJoy4 + 10, "p1 KEYDOWN" }, - {"Key LEFT", BIT_DIGITAL, DrvJoy4 + 11, "p1 KEYLEFT" }, - {"Key RIGHT", BIT_DIGITAL, DrvJoy4 + 12, "p1 KEYRIGHT" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(MSX) - -static struct BurnDIPInfo MSXDIPList[]= -{ - //{0x17, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2, "BIOS - NOTE: Changes require re-start!" }, - {0x17, 0x01, 0x01, 0x00, "Normal (REQ: msx.rom)" }, - {0x17, 0x01, 0x01, 0x01, "Japanese (REQ: msxj.rom, kanji.rom" }, - - {0 , 0xfe, 0 , 2, "Hertz" }, - {0x17, 0x01, 0x10, 0x00, "50hz (Europe)" }, - {0x17, 0x01, 0x10, 0x10, "60hz (Japan, US)" }, - - {0 , 0xfe, 0 , 2, "Key-Clicker / 1-Bit DAC" }, - {0x17, 0x01, 0x02, 0x00, "Off" }, - {0x17, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Swap Joyports" }, - {0x17, 0x01, 0x20, 0x00, "Normal" }, - {0x17, 0x01, 0x20, 0x20, "Swapped" }, - - {0 , 0xfe, 0 , 2, "Map Cursor Keys to Joy #1" }, - {0x17, 0x01, 0x80, 0x00, "Off" }, - {0x17, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Tape Side" }, - {0x17, 0x01, 0x40, 0x00, "Side A" }, - {0x17, 0x01, 0x40, 0x40, "Side B" }, -}; - -static struct BurnDIPInfo MSXDefaultDIPList[]= -{ - {0x17, 0xff, 0xff, 0x10, NULL }, -}; - -static struct BurnDIPInfo MSXJBIOSDIPList[]= -{ - {0x17, 0xff, 0xff, 0x11, NULL }, -}; - -static struct BurnDIPInfo MSX50hzJoySwapDIPList[]= -{ - {0x17, 0xff, 0xff, 0x20, NULL }, -}; - -static struct BurnDIPInfo MSX50hzDIPList[]= -{ - {0x17, 0xff, 0xff, 0x20, NULL }, -}; - -static struct BurnDIPInfo MSXJoySwapDIPList[]= -{ - {0x17, 0xff, 0xff, 0x30, NULL }, -}; - -static struct BurnDIPInfo MSXMapCursorToJoy1DIPList[]= -{ - {0x17, 0xff, 0xff, 0x80, NULL }, -}; - -static struct BurnDIPInfo MSXMapCursorToJoy1_60hzDIPList[]= -{ - {0x17, 0xff, 0xff, 0x80+0x10, NULL }, -}; - -static struct BurnDIPInfo MSXKeyClickerDACDIPList[]= -{ - {0x17, 0xff, 0xff, 0x02, NULL }, -}; - -STDDIPINFOEXT(MSX, MSXDefault, MSX) -STDDIPINFOEXT(MSXJapan, MSXJBIOS, MSX) -STDDIPINFOEXT(MSXJoyport2, MSXJoySwap, MSX) -STDDIPINFOEXT(MSXEuropeJoyport2, MSX50hzJoySwap, MSX) -STDDIPINFOEXT(MSXEurope, MSX50hz, MSX) -STDDIPINFOEXT(MSXJoyCursor, MSXMapCursorToJoy1, MSX) -STDDIPINFOEXT(MSXJoyCursor60hz, MSXMapCursorToJoy1_60hz, MSX) -STDDIPINFOEXT(MSXKeyClick, MSXKeyClickerDAC, MSX) - -// ROM mapper types: -#define MAP_KONGEN8 0 // KonamiGeneric 8k -#define MAP_KONGEN16 1 // KonamiGeneric 16k -#define MAP_KONAMI5 2 // Konami SCC -#define MAP_KONAMI4 3 // Konami -#define MAP_ASCII8 4 // ASCII 8 -#define MAP_ASCII16 5 // ASCII 16 -#define MAP_DOOLY 6 // Dooly -#define MAP_CROSSBL 7 // Cross Blaim -#define MAP_RTYPE 8 // R-Type - -#define MAXSLOTS 4 -#define MAXMAPPERS 9 - -#define MAX_MSX_CARTSIZE 0x200000 - -// Machine Config -#define DEFAULT_BIOSSLOT 0 -#define DEFAULT_CARTSLOTA 1 -#define DEFAULT_CARTSLOTB 2 -#define DEFAULT_RAMSLOT 3 - -static UINT8 SwapJoyports = 0; // Swap Joyport DIP -static UINT8 Joyselect = 0; // read from Joystick 0 or 1? (internal) -static UINT8 Hertz60 = 0; // DIP setting. -static UINT8 BiosmodeJapan = 0;// DIP setting. - -// Game-based kludges -static INT32 MapCursorToJoy1 = 0; // Map Cursor Keys & space to Joy1 - -static INT32 VBlankKludge = 0; // For VoidRunner (joystick selection hangs) -static INT32 SwapRamslot = 0; // For Toshiba-EMI's Break Out! -static INT32 SwapButton2 = 0; // Swaps Joy button#2 with 'm', for Xenon and Astro Marine Corps -static INT32 SwapSlash = 0; // For Square Dancer, swaps the / key with the Japanese Underscore key - -static INT32 CASMode = 0; // Using .cas file? -static INT32 CASPos = 0; // Internal tape position counter -static INT32 CASFrameCounter = 0; // for autoloading -static INT32 CASSide = 0; // Tape Side, 0 = A, 1 = B -static INT32 CASSideLast = 0; // used for detecting side changes - -static INT32 BIOSSLOT = 0; // Machine slot configuration -static INT32 CARTSLOTA = 0; -static INT32 CARTSLOTB = 0; -static INT32 RAMSLOT = 0; - -static UINT8 *RAM[8]; // Mapped address space -static UINT8 *EmptyRAM = NULL; // Unmapped stuff points here -static UINT8 *MemMap[4][8]; // [prislot] [page] - -static UINT8 *RAMData; // main flat-chunk of ram -static UINT8 RAMMapper[4]; -static UINT8 RAMMask; -static INT32 RAMPages = 4; - -static UINT8 *SRAMData[MAXSLOTS]; // ascii8/16 sram - -static UINT8 *ROMData[MAXSLOTS]; // flat chunk of cart-rom -static UINT8 ROMMapper[MAXSLOTS][4]; -static UINT8 ROMMask[MAXSLOTS]; -static UINT8 ROMType[MAXSLOTS]; - -// Game-specific mappers -static UINT8 dooly_prot; -static UINT8 crossblaim_selected_bank; -static UINT8 *crossblaim_bank_base[4]; -static UINT8 rtype_selected_bank; -static UINT8 *rtype_bank_base[2]; - -static INT32 CurRomSizeA = 0; // cart A -static INT32 CurRomSizeB = 0; // cart B - -static UINT8 WriteMode[MAXSLOTS]; -static UINT8 PSL[MAXSLOTS]; // primary slot list -static UINT8 PSLReg; // primary slot register -static UINT8 SCCReg[MAXSLOTS]; // Konami-scc enable register - -static UINT8 Kana, KanaByte; // Kanji-rom stuff - -static UINT8 ppiC_row; -static UINT8 keyRows[12]; -static INT32 charMatrix[][3] = { - {'0', 0, 0}, {')', 0, 0}, {'1', 0, 1}, {'!', 0, 1}, {'2', 0, 2}, {'@', 0, 2}, - {'3', 0, 3}, {'#', 0, 3}, {'4', 0, 4}, {'$', 0, 4}, {'5', 0, 5}, {'%', 0, 5}, - {'6', 0, 6}, {'^', 0, 6}, {'7', 0, 7}, {'&', 0, 7}, - - {'8', 1, 0}, {'*', 1, 0}, {'9', 1, 1}, {'(', 1, 1}, {'-', 1, 2}, {'_', 1, 2}, - {'=', 1, 3}, {'+', 1, 3}, {'\\', 1, 4}, {'|', 1, 4}, {'[', 1, 5}, {'{', 1, 5}, - {']', 1, 6}, {'}', 1, 6}, {';', 1, 7}, {':', 1, 7}, - - {'A', 2, 6}, {'B', 2, 7}, {'a', 2, 6}, {'b', 2, 7}, - {'/', 2, 4}, {'?', 2, 4}, {'.', 2, 3}, {'>', 2, 3}, - {',', 2, 2}, {'<', 2, 2}, {'`', 2, 1}, {'~', 2, 1}, - {'\'', 2, 0}, {'"', 2, 0}, - - {'C', 3, 0}, {'D', 3, 1}, {'E', 3, 2}, {'F', 3, 3}, {'G', 3, 4}, {'H', 3, 5}, - {'I', 3, 6}, {'J', 3, 7}, - {'c', 3, 0}, {'d', 3, 1}, {'e', 3, 2}, {'f', 3, 3}, {'g', 3, 4}, {'h', 3, 5}, - {'i', 3, 6}, {'j', 3, 7}, - - {'K', 4, 0}, {'L', 4, 1}, {'M', 4, 2}, {'N', 4, 3}, {'O', 4, 4}, {'P', 4, 5}, - {'Q', 4, 6}, {'R', 4, 7}, - {'k', 4, 0}, {'l', 4, 1}, {'m', 4, 2}, {'n', 4, 3}, {'o', 4, 4}, {'p', 4, 5}, - {'q', 4, 6}, {'r', 4, 7}, - - {'S', 5, 0}, {'T', 5, 1}, {'U', 5, 2}, {'V', 5, 3}, {'W', 5, 4}, {'X', 5, 5}, - {'Y', 5, 6}, {'Z', 5, 7}, - {'s', 5, 0}, {'t', 5, 1}, {'u', 5, 2}, {'v', 5, 3}, {'w', 5, 4}, {'x', 5, 5}, - {'y', 5, 6}, {'z', 5, 7}, - {/*VK_RETURN, */0x0d, 7, 7}, - {/*VK_ESCAPE, */0x1b, 7, 2}, - {/*VK_SPACE, */' ', 8, 0}, - {/*VK_F1, */0xf1, 6, 5}, - {/*VK_F2, */0xf2, 6, 6}, - {/*VK_F3, */0xf3, 6, 7}, - {/*VK_F4, */0xf4, 7, 0}, - {/*VK_F5, */0xf5, 7, 1}, - {/*VK_F6, */0xf6, 7, 6}, - - {/*J-SPADE */0xe0, 2, 5}, - - {/*VK_SHIFT */0x10, 6, 0}, - {/*VK_CONTROL */0x11, 6, 1}, - {/*VK_TAB */0x09, 7, 3}, - //{VK_STOP, 7, 4}, - {/*VK_BACK */0x08, 7, 5}, - //{VK_HOME, 8, 1}, - //{VK_INSERT, 8, 2}, - {/*VK_DELETE */0x2e, 8, 3}, - {/*VK_UP, */0xf8, 8, 5}, - {/*VK_DOWN, */0xf9, 8, 6}, - {/*VK_LEFT, */0xfa, 8, 4}, - {/*VK_RIGHT, */0xfb, 8, 7}, - {'\0', 0, 0} // NULL/END. -}; - -static inline void intkeyOn(INT32 row, INT32 bit) { - keyRows[row] = ((keyRows[row] & 0xff) | (1 << bit)); -} - -static inline void intkeyOff(INT32 row, INT32 bit) { - keyRows[row] = ((keyRows[row] & 0xff) & ~(1 << bit)); -} - -static UINT8 keyRowGet(INT32 row) { // for ppi to read - if (row > 11) return 0xff; - return ~keyRows[row]; -} - -static void keyInput(UINT8 kchar, UINT8 onoff) { // input from emulator - INT32 i = 0; - INT32 gotkey = 0; - - while (charMatrix[i][0] != '\0') { - if (kchar == charMatrix[i][0]) { - if (onoff) { - intkeyOn(charMatrix[i][1], charMatrix[i][2]); - } else { - intkeyOff(charMatrix[i][1], charMatrix[i][2]); - } - gotkey = 1; - break; - } - i++; - } -} - -void msxKeyCallback(UINT8 code, UINT8 KeyType, UINT8 down) -{ - static INT32 lastshifted = 0; - - //bprintf(0, _T(" %c:%S,"), code, (down==1)?"DOWN":"UP"); - if (SwapSlash && code == '/') code = 0xe0; - - if (lastshifted) memset(&keyRows, 0, sizeof(keyRows)); - keyInput(/*VK_SHIFT*/'\x10', (KeyType & 0xf0)); - keyInput(code, down); - lastshifted = (KeyType & 0xf0); - // Note regarding 'lastshifted'. If shift+key is pressed (f.ex. ") and shift - // is let up before the key is let up, windows won't send the right keyup message. - // this causes keys to get stuck. To kludge around this, we clear the keyboard - // matrix-buffer when shift is let up. -dink -} - -static const char *ROMNames[MAXMAPPERS + 1] = -{ - "KonamiGeneric 8k\0", "KonamiGeneric 16k\0", "Konami-SCC\0", - "Konami\0", "ASCII 8k\0", "ASCII 16k\0", - "Dooly\0", "Cross Blaim\0", "R-Type\0", "???\0" -}; - -#define CAS_BLOAD 1 -#define CAS_RUN 2 -#define CAS_CLOAD 3 -#define CAS_CLOADRR 4 -#define CAS_WRONGSIDE 5 - -static const char *CASAutoLoadTypes[] = -{ - "bload \"cas:\", r\x0d", "run \"cas:\"\x0d", "cload\x0drun\x0d", - "cload\x0drun\x0drun\x0d", "rem Set Tape Side-A in DIPs & reboot!\x0d" -}; - -static INT32 InsertCart(UINT8 *cartbuf, INT32 cartsize, INT32 nSlot); -static void PageMap(INT32 CartSlot, const char *cMap); //("0:0:0:0:0:0:0:0") -static void MapMegaROM(UINT8 nSlot, UINT8 nPg0, UINT8 nPg1, UINT8 nPg2, UINT8 nPg3); - -static INT32 CASAutoLoadPos = 0; -static INT32 CASAutoLoadTicker = 0; - -static void CASSideChange() -{ - curtape = (CASSide) ? game2 : game; - curtapelen = (CASSide) ? CurRomSizeB : CurRomSizeA; - CASPos = 0; - CASSideLast = CASSide; -} - -static void CASAutoLoad() -{ - CASAutoLoadPos = 0; - CASAutoLoadTicker = 0; - CASFrameCounter = 0; - CASPos = 0; -} - -static void CASAutoLoadTick() -{ - if (CASAutoLoadPos == 0xff) return; - - UINT8 CASModeTmp = (CASSide) ? CAS_WRONGSIDE : CASMode; - UINT8 c = CASAutoLoadTypes[CASModeTmp - 1][CASAutoLoadPos]; - if (!c) { - CASAutoLoadPos = 0xff; - return; - } - - keyInput(c, !(CASAutoLoadTicker & 1)); - if (c == '\"' || c == ':' || c == '&' || c == '!') - keyInput(0x10/*SHIFT*/, !(CASAutoLoadTicker & 1)); - if (CASAutoLoadTicker & 1) CASAutoLoadPos++; - CASAutoLoadTicker++; -} - -static void CASPatchBIOS(UINT8 *bios) -{ - UINT8 PatchBytes[] = { 0xe1, 0xe4, 0xe7, 0xea, 0xed, 0xf0, 0xf3, 0x00 }; - UINT8 i = 0; - - while (PatchBytes[i] != 0x00) { - UINT8 *p = bios + PatchBytes[i]; - p[0] = 0xed; - p[1] = 0xfe; - p[2] = 0xc9; - i++; - } -} - -extern void (*z80edfe_callback)(Z80_Regs *Regs); - -static void Z80EDFECallback(Z80_Regs *Regs) -{ - static const UINT8 TapeHeader[8] = { 0x1f, 0xa6, 0xde, 0xba, 0xcc, 0x13, 0x7d, 0x74 }; - #define Z80CF 0x01 - - switch (Regs->pc.d - 2) - { - case 0x00e1: // TAPION (open & read header) - { - bprintf(0, _T("CAS: Searching header: ")); - - Regs->af.b.l |= Z80CF; - if (CASMode) { - while (CASPos + 8 < curtapelen) { - if (!memcmp(curtape + CASPos, TapeHeader, 8)) { - CASPos+=8; - bprintf(0, _T("Found.\n")); - Regs->af.b.l &= ~Z80CF; - return; - } - CASPos += 1; - } - bprintf(0, _T("Not found.\n")); - CASPos = 0; - return; - } - bprintf(0, _T("Tape offline.\n")); - - return; - } - - case 0x00e4: // TAPIN (read) - { - Regs->af.b.l |= Z80CF; - - if (CASMode) { - UINT8 c = curtape[CASPos++]; - - if (CASPos > curtapelen) { - CASPos = 0; - } - else - { - Regs->af.b.h = c; - Regs->af.b.l &= ~Z80CF; - } - } - - return; - } - - case 0x00e7: // TAPIOF (stop reading from tape) - Regs->af.b.l &= ~Z80CF; - return; - - case 0x00ea: // TAPOON (write header) - bprintf(0, _T("TAPOON")); - return; - - case 0x00ed: // TAPOUT (write byte) - bprintf(0, _T("TAPOUT")); - return; - - case 0x00f0: // TAPOOF (stop writing) - Regs->af.b.l &= ~Z80CF; - return; - - case 0x00f3: // STMOTR (motor control) - Regs->af.b.l &= ~Z80CF; - return; - } -} - - -void msxinit(INT32 cart_len) -{ - for(INT32 i = 0; i < MAXSLOTS; i++) { - ROMMask[i] = 0; - ROMData[i] = 0; - ROMType[i] = 0; - SRAMData[i] = 0; - SCCReg[i] = 0; - } - - BIOSSLOT = DEFAULT_BIOSSLOT; - CARTSLOTA = DEFAULT_CARTSLOTA; - CARTSLOTB = DEFAULT_CARTSLOTB; - RAMSLOT = DEFAULT_RAMSLOT; - - if (SwapRamslot) { // Kludge for Toshiba-EMI's Break Out! - needs ram in slot 2 - RAMSLOT = 2; - CARTSLOTB = 3; - } - - bprintf(0, _T("Slots: BIOS %d RAM %d CART1 %d CART2 %d\n"), BIOSSLOT, RAMSLOT, CARTSLOTA, CARTSLOTB); - - memset(EmptyRAM, 0xff, 0x4000); // bus is pulled high for unmapped reads - - for(INT32 PSlot = 0; PSlot < 4; PSlot++) // Point all pages there by default - for(INT32 Page = 0; Page < 8; Page++) - MemMap[PSlot][Page] = EmptyRAM; - - RAMPages = 4; // 64k - RAMMask = RAMPages - 1; - RAMData = main_mem; - - if (CASMode) { - bprintf(0, _T("Cassette mode.\n")); - ZetSetEDFECallback(Z80EDFECallback); - CASPatchBIOS(maincpu); - CASAutoLoad(); - CASSide = 0; // Always start @ side A - CASSideChange(); - } - - // "Insert" BIOS ROM - ROMData[BIOSSLOT] = maincpu; - PageMap(BIOSSLOT, "0:1:2:3:e:e:e:e"); - - if (!msx_basicmode) - InsertCart(game, cart_len, CARTSLOTA); - - PSLReg = 0; - - for (INT32 i = 0; i < 4; i++) { - WriteMode[i] = 0; - PSL[i] = 0; - MemMap[RAMSLOT][i * 2] = RAMData + (3 - i) * 0x4000; - MemMap[RAMSLOT][i * 2 + 1] = MemMap[RAMSLOT][i * 2] + 0x2000; - RAMMapper[i] = 3 - i; - RAM[i * 2] = MemMap[BIOSSLOT][i * 2]; - RAM[i * 2 + 1] = MemMap[BIOSSLOT][i * 2 + 1]; - } - - - for (INT32 J = 0; J < MAXSLOTS; J++) - if (((ROMMask[J] + 1) > 4) || (ROMType[J] == MAP_DOOLY)) - { - INT32 I = ROMMask[J] + 1; - - if ((ROMData[J][0] == 'A') && (ROMData[J][1] == 'B')) { - MapMegaROM(J, 0, 1, 2, 3); - } else { - if ((ROMData[J][(I - 2) << 13] == 'A') && (ROMData[J][((I - 2) << 13) + 1] == 'B')) - MapMegaROM(J, I - 2, I - 1, I - 2, I - 1); - } - } -} - -static void rtype_do_bank(UINT8 *romdata) -{ - rtype_bank_base[0] = romdata + 15 * 0x4000; - if (rtype_selected_bank & 0x10) - { - rtype_selected_bank &= 0x17; - } - rtype_bank_base[1] = romdata + rtype_selected_bank * 0x4000; -} - -static void crossblaim_do_bank(UINT8 *romdata) -{ - crossblaim_bank_base[0] = ( crossblaim_selected_bank & 2 ) ? NULL : romdata + ( crossblaim_selected_bank & 0x03 ) * 0x4000; - crossblaim_bank_base[1] = romdata; - crossblaim_bank_base[2] = romdata + ( crossblaim_selected_bank & 0x03 ) * 0x4000; - crossblaim_bank_base[3] = ( crossblaim_selected_bank & 2 ) ? NULL : romdata + ( crossblaim_selected_bank & 0x03 ) * 0x4000; -} - -static void Mapper_write(UINT16 address, UINT8 data) -{ - UINT8 Page = address >> 14; // pg. num - UINT8 PSlot = PSL[Page]; - - if (PSlot >= MAXSLOTS) return; - - if (!ROMData[PSlot] && (address == 0x9000)) - SCCReg[PSlot] = (data == 0x3f) ? 1 : 0; - - if (((address & 0xdf00) == 0x9800) && SCCReg[PSlot]) { // Handle Konami-SCC (+) - UINT16 offset = address & 0x00ff; - - if (offset < 0x80) { - K051649WaveformWrite(offset, data); - } - else if (offset < 0xa0) { - offset &= 0xf; - - if (offset < 0xa) { - K051649FrequencyWrite(offset, data); - } - else if (offset < 0xf) { - K051649VolumeWrite(offset - 0xa, data); - } - else { - K051649KeyonoffWrite(data); - } - } - - return; - } - - if (!ROMData[PSlot] || !ROMMask[PSlot]) return; - - switch (ROMType[PSlot]) - { - case MAP_DOOLY: - dooly_prot = data & 0x07; - return; - - case MAP_CROSSBL: - crossblaim_selected_bank = data & 3; - if (crossblaim_selected_bank == 0) { - crossblaim_selected_bank = 1; - } - crossblaim_do_bank(ROMData[PSlot]); - - return; - - case MAP_RTYPE: - if (address >= 0x7000 && address < 0x8000) - { - rtype_selected_bank = data & 0x1f; - if (rtype_selected_bank & 0x10) - { - rtype_selected_bank &= 0x17; - } - rtype_bank_base[1] = ROMData[PSlot] + rtype_selected_bank * 0x4000; - } - - case MAP_KONGEN8: - if ((address < 0x4000) || (address > 0xbfff)) break; - Page = (address - 0x4000) >> 13; - if (Page == 2) SCCReg[PSlot] = (data == 0x3f) ? 1 : 0; - - data &= ROMMask[PSlot]; - if (data != ROMMapper[PSlot][Page]) - { - RAM[Page + 2] = MemMap[PSlot][Page + 2] = ROMData[PSlot] + (data << 13); - ROMMapper[PSlot][Page] = data; - } - return; - - case MAP_KONGEN16: - if ((address < 0x4000) || (address > 0xbfff)) break; - Page = (address & 0x8000) >> 14; - - data = (data << 1) & ROMMask[PSlot]; - if (data != ROMMapper[PSlot][Page]) - { - RAM[Page + 2] = MemMap[PSlot][Page + 2] = ROMData[PSlot] + (data << 13); - RAM[Page + 3] = MemMap[PSlot][Page + 3] = RAM[Page + 2] + 0x2000; - ROMMapper[PSlot][Page] = data; - ROMMapper[PSlot][Page + 1] = data + 1; - } - return; - - case MAP_KONAMI5: - if ((address < 0x5000) || (address > 0xb000) || ((address & 0x1fff) != 0x1000)) break; - Page = (address - 0x5000) >> 13; - - if (Page == 2) SCCReg[PSlot] = (data == 0x3f) ? 1 : 0; - - data &= ROMMask[PSlot]; - if (data != ROMMapper[PSlot][Page]) - { - RAM[Page + 2] = MemMap[PSlot][Page + 2] = ROMData[PSlot] + (data << 13); - ROMMapper[PSlot][Page] = data; - } - return; - - case MAP_KONAMI4: - if ((address < 0x6000) || (address > 0xa000) || (address & 0x1fff)) break; - Page = (address - 0x4000) >> 13; - - data &= ROMMask[PSlot]; - if (data != ROMMapper[PSlot][Page]) - { - RAM[Page + 2] = MemMap[PSlot][Page + 2] = ROMData[PSlot] + (data << 13); - ROMMapper[PSlot][Page] = data; - } - return; - - case MAP_ASCII8: - if ((address >= 0x6000) && (address < 0x8000)) - { - UINT8 *pgPtr; - - Page = (address & 0x1800) >> 11; - - if (data & (ROMMask[PSlot] + 1)) { - data = 0xff; - pgPtr = SRAMData[PSlot]; - } - else - { - data &= ROMMask[PSlot]; - pgPtr = ROMData[PSlot] + (data << 13); - } - - if (data != ROMMapper[PSlot][Page]) - { - MemMap[PSlot][Page + 2] = pgPtr; - ROMMapper[PSlot][Page] = data; - - if (PSL[(Page >> 1) + 1] == PSlot) - RAM[Page + 2] = pgPtr; - } - return; - } - if ((address >= 0x8000) && (address < 0xc000) && (ROMMapper[PSlot][((address >> 13) & 1) + 2] == 0xff)) - { - RAM[address >> 13][address & 0x1fff] = data; - return; - } - break; - - case MAP_ASCII16: - if ((address >= 0x6000) && (address < 0x8000) && ((data <= ROMMask[PSlot] + 1) || !(address & 0x0fff))) - { - UINT8 *pgPtr; - Page = (address & 0x1000) >> 11; - - if (data & (ROMMask[PSlot] + 1)) - { - data = 0xff; - pgPtr = SRAMData[PSlot]; - } - else - { - - data = (data << 1) & ROMMask[PSlot]; - pgPtr = ROMData[PSlot] + (data << 13); - } - - if (data != ROMMapper[PSlot][Page]) - { - MemMap[PSlot][Page + 2] = pgPtr; - MemMap[PSlot][Page + 3] = pgPtr + 0x2000; - ROMMapper[PSlot][Page] = data; - ROMMapper[PSlot][Page + 1] = data + 1; - - if (PSL[(Page >> 1) + 1] == PSlot) - { - RAM[Page + 2] = pgPtr; - RAM[Page + 3] = pgPtr + 0x2000; - } - } - return; - } - - if ((address >= 0x8000) && (address < 0xc000) && (ROMMapper[PSlot][2] == 0xff)) - { - UINT8 *pgPtr = RAM[address >> 13]; - address &= 0x07ff; - pgPtr[address + 0x0800] = pgPtr[address + 0x1000] = pgPtr[address + 0x1800] = - pgPtr[address + 0x2000] = pgPtr[address + 0x2800] = pgPtr[address + 0x3000] = - pgPtr[address + 0x3800] = pgPtr[address] = data; - return; - } - break; - } - - //bprintf(0, _T("Unhandled mapper write. 0x%04X: %02X, slot %d\n"), address, data, PSlot); -} - -static INT32 Mapper_read(UINT16 address, UINT8 *data) -{ - UINT8 Page = address >> 14; - UINT8 PSlot = PSL[Page]; - - if (PSlot >= MAXSLOTS) return 0; - - if (!ROMData[PSlot] || !ROMMask[PSlot]) return 0; - - switch (ROMType[PSlot]) - { - case MAP_CROSSBL: - { - UINT8 *bank_base = crossblaim_bank_base[address >> 14]; - - if (bank_base != NULL) { - *data = bank_base[address & 0x3fff]; - return 1; - } - } - case MAP_DOOLY: - { - if ((address > 0x3fff) && (address < 0xc000)) { - UINT8 rb = ROMData[PSlot][address - 0x4000]; - - if (dooly_prot == 0x04) { - rb = BITSWAP08(rb, 7, 6, 5, 4, 3, 1, 0, 2); - } - - *data = rb; - return 1; - } - } - case MAP_RTYPE: - { - if (address > 0x3fff && address < 0xc000) - { - *data = rtype_bank_base[address >> 15][address & 0x3fff]; - return 1; - } - } - } - return 0; -} - -static void SetSlot(UINT8 nSlot) -{ - UINT8 I, J; - - if (PSLReg != nSlot) { - PSLReg = nSlot; - for (J = 0; J < 4; J++) { - I = J << 1; - PSL[J] = nSlot & 3; - RAM[I] = MemMap[PSL[J]][I]; - RAM[I + 1] = MemMap[PSL[J]][I + 1]; - WriteMode[J] = (PSL[J] == RAMSLOT) && (MemMap[RAMSLOT][I] != EmptyRAM); - nSlot >>= 2; - } - } -} - -static void PageMap(INT32 CartSlot, const char *cMap) -{ - for (INT32 i = 0; i < 8; i++) { - switch (cMap[i << 1]) { - case 'n': // no change - break; - case 'e': // empty page - { - MemMap[CartSlot][i] = EmptyRAM; - } - break; - default: // map page num. - { - MemMap[CartSlot][i] = ROMData[CartSlot] + ((cMap[i << 1] - '0') * 0x2000); - //bprintf(0, _T("pg %X @ %X\n"), i, ((cMap[i << 1] - '0') * 0x2000)); - } - } - } -} - -static void MapMegaROM(UINT8 nSlot, UINT8 nPg0, UINT8 nPg1, UINT8 nPg2, UINT8 nPg3) -{ - if (nSlot >= MAXSLOTS) return; - - nPg0 &= ROMMask[nSlot]; - nPg1 &= ROMMask[nSlot]; - nPg2 &= ROMMask[nSlot]; - nPg3 &= ROMMask[nSlot]; - - MemMap[nSlot][2] = ROMData[nSlot] + nPg0 * 0x2000; - MemMap[nSlot][3] = ROMData[nSlot] + nPg1 * 0x2000; - MemMap[nSlot][4] = ROMData[nSlot] + nPg2 * 0x2000; - MemMap[nSlot][5] = ROMData[nSlot] + nPg3 * 0x2000; - - ROMMapper[nSlot][0] = nPg0; - ROMMapper[nSlot][1] = nPg1; - ROMMapper[nSlot][2] = nPg2; - ROMMapper[nSlot][3] = nPg3; -} - -static INT32 GuessROM(UINT8 *buf, INT32 Size) -{ - INT32 i, j; - INT32 ROMCount[MAXMAPPERS]; - - for (i = 0; i < MAXMAPPERS; i++) - ROMCount[i] = 1; - - ROMCount[MAP_KONGEN8] += 1; - ROMCount[MAP_ASCII16] -= 1; - - for (i = 0; i < Size-2; i++) { - switch (buf[i] + (buf[i + 1] << 8) + (buf[i + 2] << 16)) - { - case 0x500032: - case 0x900032: - case 0xB00032: - { - ROMCount[MAP_KONAMI5]++; - break; - } - case 0x400032: - case 0x800032: - case 0xA00032: - { - ROMCount[MAP_KONAMI4]++; - break; - } - case 0x680032: - case 0x780032: - { - ROMCount[MAP_ASCII8]++; - break; - } - case 0x600032: - { - ROMCount[MAP_KONAMI4]++; - ROMCount[MAP_ASCII8]++; - ROMCount[MAP_ASCII16]++; - break; - } - case 0x700032: - { - ROMCount[MAP_KONAMI5]++; - ROMCount[MAP_ASCII8]++; - ROMCount[MAP_ASCII16]++; - break; - } - case 0x77FF32: - { - ROMCount[MAP_ASCII16]++; - break; - } - } - } - - for (i = 0, j = 0; j < MAXMAPPERS; j++) - if (ROMCount[j] > ROMCount[i]) i = j; - - return i; -} - -static INT32 IsBasicROM(UINT8 *rom) -{ - return (rom[2] == 0 && rom[3] == 0 && rom[8] && rom[9]); -} - -static UINT16 GetRomStart(UINT8* romData, INT32 size) -{ - INT32 pages[3] = { 0, 0, 0 }; - - for (INT32 startPage = 0; startPage < 2; startPage++) { - UINT8* romPtr = romData + 0x4000 * startPage; - - if (size < 0x4000 * startPage + 0x10) { - continue; - } - if (romPtr[0] == 'A' && romPtr[1] == 'B') { - for (INT32 i = 0; i < 4; i++) { - UINT16 address = romPtr[2 * i + 2] + 256 * (UINT16)romPtr[2 * i + 3]; - - if (address > 0) { - UINT16 page = address / 0x4000 - startPage; - - if (page < 3) { - pages[page]++; - } - } - } - } - } - - if (pages[1] && (pages[1] >= pages[0]) && (pages[1] >= pages[2])) { - return 0x4000; - } - - if (pages[0] && pages[0] >= pages[2]) { - return 0x0000; - } - - if (pages[2]) { - return 0x8000; - } - - return 0x0000; -} - -static INT32 InsertCart(UINT8 *cartbuf, INT32 cartsize, INT32 nSlot) -{ - INT32 Len, Pages, Flat64, BasicROM; - UINT8 ca, cb; - - if (nSlot >= MAXSLOTS) return 0; - - Len = cartsize >> 13; // Len, in 8k pages - - for (Pages = 1; Pages < Len; Pages <<= 1); // Calculate nearest power of 2 of len - - ROMData[nSlot] = cartbuf; - SRAMData[nSlot] = game_sram; - - Flat64 = 0; - BasicROM = 0; - - ca = cartbuf[0]; - cb = cartbuf[1]; - - if ((ca == 'A') || (cb == 'B')) { - BasicROM = IsBasicROM(cartbuf); - } else { - ca = cartbuf[0 + 0x4000]; - cb = cartbuf[1 + 0x4000]; - Flat64 = (ca == 'A') && (cb == 'B'); - } - - if ((Len >= 2) && ((ca != 'A') || (cb != 'B'))) { // check last page - ca = cartbuf[0 + 0x2000 * (Len - 2)]; - cb = cartbuf[1 + 0x2000 * (Len - 2)]; - } - - if ((ca != 'A') || (cb != 'B')) { - bprintf(0, _T("MSX Cartridge signature not found!\n")); - return 0; - } - - if (Len < Pages) { // rom isn't a valid page-length, so mirror - memcpy(ROMData[nSlot] + Len * 0x2000, - ROMData[nSlot] + (Len - Pages / 2) * 0x2000, - (Pages - Len) * 0x2000); - } - - bprintf(0, _T("Cartridge %c: %dk "), 'A' + nSlot - CARTSLOTA, Len * 8); - - - ROMMask[nSlot]= !Flat64 && (Len > 4) ? (Pages - 1) : 0x00; - - bprintf(0, _T("%S\n"), (BasicROM) ? "Basic ROM Detected." : ""); - - // Override mapper from hardware code - switch (BurnDrvGetHardwareCode() & 0xff) { - case HARDWARE_MSX_MAPPER_BASIC: - BasicROM = 1; - break; - case HARDWARE_MSX_MAPPER_ASCII8: - ROMType[nSlot] = MAP_ASCII8; - break; - case HARDWARE_MSX_MAPPER_ASCII16: - ROMType[nSlot] = MAP_ASCII16; - break; - case HARDWARE_MSX_MAPPER_KONAMI: - ROMType[nSlot] = MAP_KONAMI4; - break; - case HARDWARE_MSX_MAPPER_KONAMI_SCC: - ROMType[nSlot] = MAP_KONAMI5; - break; - case HARDWARE_MSX_MAPPER_DOOLY: - ROMType[nSlot] = MAP_DOOLY; - ROMMask[nSlot]=3; - break; - case HARDWARE_MSX_MAPPER_CROSS_BLAIM: - ROMType[nSlot] = MAP_CROSSBL; - crossblaim_selected_bank = 1; - crossblaim_do_bank(ROMData[nSlot]); - break; - case HARDWARE_MSX_MAPPER_RTYPE: - ROMType[nSlot] = MAP_RTYPE; - rtype_selected_bank = 15; - rtype_do_bank(ROMData[nSlot]); - break; - default: - if (ROMMask[nSlot] + 1 > 4) { - ROMType[nSlot] = GuessROM(ROMData[nSlot], 0x2000 * (ROMMask[nSlot] + 1)); - bprintf(0, _T("Mapper heusitics detected: %S..\n"), ROMNames[ROMType[nSlot]]); - } - } - - if (ROMType[nSlot] != MAP_DOOLY) { // set-up non-megarom mirroring & mapping - switch (Len) - { - case 1: // 8k rom-mirroring - if (BasicROM) - { // BasicROM only on page 2 - PageMap(nSlot, "e:e:e:e:0:0:e:e"); - } else - { // normal 8k ROM - PageMap(nSlot, "0:0:0:0:0:0:0:0"); - } - break; - - case 2: // 16k rom-mirroring - if (BasicROM) - { // BasicROM only on page 2 - PageMap(nSlot, "e:e:e:e:0:1:e:e"); - } else - { // normal 16k ROM - PageMap(nSlot, "0:1:0:1:0:1:0:1"); - } - break; - - case 3: - case 4: // 24k & 32k rom-mirroring - if (GetRomStart(cartbuf, cartsize) != 0x4000) { - PageMap(nSlot, "0:1:0:1:2:3:2:3"); // normal - } else { - PageMap(nSlot, "2:3:0:1:2:3:0:1"); // swapped - bprintf(0, _T("Swapped mirroring.\n")); - } - break; - - default: - if (Flat64) - { // Flat-64k ROM - PageMap(nSlot, "0:1:2:3:4:5:6:7"); - } - break; - } - if (Flat64 || Len < 5) - bprintf(0, _T("starting address 0x%04X.\n"), - MemMap[nSlot][2][2] + 256 * MemMap[nSlot][2][3]); - } - - // map gen/16k megaROM pages 0:1:last-1:last - if ((ROMType[nSlot] == MAP_KONGEN16) && (ROMMask[nSlot] + 1 > 4)) - MapMegaROM(nSlot, 0, 1, ROMMask[nSlot] - 1, ROMMask[nSlot]); - - return 1; -} - - -static void __fastcall msx_write_port(UINT16 port, UINT8 data) -{ - port &= 0xff; - switch (port) - { - case 0x98: - TMS9928AWriteVRAM(data); - return; - - case 0x99: - TMS9928AWriteRegs(data); - return; - - case 0xa0: - AY8910Write(0, 0, data); - break; - - case 0xa1: - AY8910Write(0, 1, data); - break; - - case 0xa8: - case 0xa9: - case 0xaa: - case 0xab: - ppi8255_w(0, port & 3, data); - return; - - case 0xd8: // Kanji high bit address selector - Kana = (Kana & 0x1f800) | (data & 0x3f) << 5; - KanaByte = 0; - return; - - case 0xd9: // Kanji low bit address selector - Kana = (Kana & 0x007e0) | (data & 0x3f) << 11; - KanaByte = 0; - return; - -#if 0 - // disable the ram-mapper for now (only really used in msx2) - // causes some issues with games that erraneously write to 0xfc (stardust and utopia demo?) - - case 0xfc: // map ram-page 0x0000, 0x4000, 0x8000, 0xc000 - case 0xfd: - case 0xfe: - case 0xff: bprintf(0, _T("Port %X Data %X.\n"), port, data); - INT32 PSlot = port - 0xfc; - data &= RAMMask; - if (RAMMapper[PSlot] != data) { - bprintf(0, _T("Mapped RAM chunk %d @ 0x%X\n"), data, PSlot * 0x4000); - INT32 Page = PSlot << 1; - RAMMapper[PSlot] = data; - MemMap[RAMSLOT][Page] = RAMData + (data << 14); - MemMap[RAMSLOT][Page + 1] = MemMap[RAMSLOT][Page] + 0x2000; - - if ((PSL[PSlot] == RAMSLOT)) { - WriteMode[PSlot] = 1; - RAM[Page] = MemMap[RAMSLOT][Page]; - RAM[Page + 1] = MemMap[RAMSLOT][Page + 1]; - } - } - return; -#endif - } - - //bprintf(0, _T("port[%X] data[%X],"), port, data); -} - -static UINT8 __fastcall msx_read_port(UINT16 port) -{ - port &= 0xff; - - switch (port) - { - case 0x98: - return TMS9928AReadVRAM(); - - case 0x99: - return TMS9928AReadRegs() | ((VBlankKludge) ? 0x80 : 0x00); - - case 0xa2: - return AY8910Read(0); - - case 0xa8: - case 0xa9: - case 0xaa: - case 0xab: - return ppi8255_r(0, port & 3); - - case 0xd9: { - UINT8 Kan = (use_kanji) ? kanji_rom[Kana + KanaByte] : 0xff; - KanaByte = (KanaByte + 1) & 0x1f; - return Kan; - } - - case 0xfc: // map ram-page 0x0000, 0x4000, 0x8000, 0xc000 - case 0xfd: - case 0xfe: - case 0xff: - return RAMMapper[port - 0xfc] | ~RAMMask; - } - - //bprintf(0, _T("port[%X],"), port); - - return 0xff; -} - -static UINT8 msx_ppi8255_portB_read() -{ - return keyRowGet(ppiC_row); -} - -static void msx_ppi8255_portA_write(UINT8 data) -{ - SetSlot(data); -} - -static void msx_ppi8255_portC_write(UINT8 data) -{ - ppiC_row = data & 0x0f; - if (DrvDips[0] & 0x02) - DACWrite(0, (data & 0x80) ? 0x80 : 0x00); // Key-Clicker / 1-bit DAC -} - -static UINT8 ay8910portAread(UINT32 /*offset*/) -{ - if (SwapJoyports) { - return (Joyselect) ? DrvInputs[0] : DrvInputs[1]; - } else { - return (Joyselect) ? DrvInputs[1] : DrvInputs[0]; - } -} - -static void ay8910portAwrite(UINT32 /*offset*/, UINT32 /*data*/) -{ - //bprintf(0, _T("8910 portAwrite %X:%X\n"), offset, data); -} - -static void ay8910portBwrite(UINT32 /*offset*/, UINT32 data) -{ - //bprintf(0, _T("B %X:%X\n"), offset, data); - Joyselect = (data & 0x40) ? 1 : 0; -} - -static void vdp_interrupt(INT32 state) -{ - ZetSetIRQLine(0, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - memset(&keyRows, 0, sizeof(keyRows)); - ppiC_row = 0; - - Kana = 0; - KanaByte = 0; - - msxinit(CurRomSizeA); - - ppi8255_init(1); // there is no reset, so use this. - - ZetOpen(0); - ZetReset(); - TMS9928AReset(); - ZetClose(); - - AY8910Reset(0); - K051649Reset(); - DACReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - maincpu = Next; Next += 0x020000; - game = Next; Next += MAX_MSX_CARTSIZE; - game2 = Next; Next += MAX_MSX_CARTSIZE; - kanji_rom = Next; Next += 0x040000; - - game_sram = Next; Next += 0x004000; - - AllRam = Next; - - main_mem = Next; Next += 0x020000; - EmptyRAM = Next; Next += 0x010000; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void __fastcall msx_write(UINT16 address, UINT8 data) -{ - if (WriteMode[address >> 14]) { - RAM[address >> 13][address & 0x1fff] = data; - return; - } - - if ((address > 0x3fff) && (address < 0xc000)) - Mapper_write(address, data); - -} - -static UINT8 __fastcall msx_read(UINT16 address) -{ - UINT8 d = 0; - - if (Mapper_read(address, &d)) { - return d; - } - - return (RAM[address >> 13][address & 0x1fff]); -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3579545.000 / ((Hertz60) ? 60.0 : 50.0)))); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - struct BurnRomInfo ri; - - bprintf(0, _T("MSXINIT...\n")); - Hertz60 = (DrvDips[0] & 0x10) ? 1 : 0; - BiosmodeJapan = (DrvDips[0] & 0x01) ? 1 : 0; - SwapJoyports = (DrvDips[0] & 0x20) ? 1 : 0; - - bprintf(0, _T("%Shz mode.\n"), (Hertz60) ? "60" : "50"); - bprintf(0, _T("BIOS mode: %S\n"), (BiosmodeJapan) ? "Japanese" : "Normal"); - bprintf(0, _T("%S"), (SwapJoyports) ? "Joystick Ports: Swapped.\n" : ""); - if (BurnLoadRom(maincpu, 0x80 + BiosmodeJapan, 1)) return 1; // BIOS - - use_kanji = (BurnLoadRom(kanji_rom, 0x82, 1) == 0); - - if (use_kanji) - bprintf(0, _T("Kanji ROM loaded.\n")); - - BurnDrvGetRomInfo(&ri, 0); - - if (ri.nLen > MAX_MSX_CARTSIZE) { - bprintf(0, _T("Bad MSX1 ROMSize! exiting.. (> %dk) \n"), MAX_MSX_CARTSIZE / 1024); - return 1; - } - - memset(game, 0xff, MAX_MSX_CARTSIZE); - - if (BurnLoadRom(game + 0x00000, 0, 1)) return 1; - - CurRomSizeA = ri.nLen; - - BurnDrvGetRomInfo(&ri, 1); - - if (ri.nLen > 0 && ri.nLen < MAX_MSX_CARTSIZE) { - memset(game2, 0xff, MAX_MSX_CARTSIZE); - - if (BurnLoadRom(game2 + 0x00000, 1, 1)) return 1; - - CurRomSizeB = ri.nLen; - bprintf(0, _T("Loaded secondary tape/rom, size: %d.\n"), CurRomSizeB); - } - - // msxinit(ri.nLen); (in DrvDoReset()! -dink) - } -#ifdef BUILD_WIN32 - cBurnerKeyCallback = msxKeyCallback; - nReplayExternalDataCount = sizeof(keyRows); - ReplayExternalData = &keyRows[0]; -#endif - BurnSetRefreshRate((Hertz60) ? 60.0 : 50.0); - - ZetInit(0); - ZetOpen(0); - - ZetSetOutHandler(msx_write_port); - ZetSetInHandler(msx_read_port); - ZetSetWriteHandler(msx_write); - ZetSetReadHandler(msx_read); - ZetClose(); - - AY8910Init(0, 3579545/2, nBurnSoundRate, ay8910portAread, NULL, ay8910portAwrite, ay8910portBwrite); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - - K051649Init(3579545/2); - K051649SetRoute(0.20, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - - TMS9928AInit(TMS99x8A, 0x4000, 0, 0, vdp_interrupt); - - ppi8255_init(1); - PPI0PortReadB = msx_ppi8255_portB_read; - PPI0PortWriteA = msx_ppi8255_portA_write; - PPI0PortWriteC = msx_ppi8255_portC_write; - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - TMS9928AExit(); - ZetExit(); - - AY8910Exit(0); - K051649Exit(); - DACExit(); - - ppi8255_exit(); - - BurnFree (AllMem); - AllMem = NULL; - - msx_basicmode = 0; - BiosmodeJapan = 0; - CASMode = 0; - VBlankKludge = 0; - SwapRamslot = 0; - SwapButton2 = 0; - SwapSlash = 0; - MapCursorToJoy1 = 0; - -#ifdef BUILD_WIN32 - cBurnerKeyCallback = NULL; - nReplayExternalDataCount = 0; - ReplayExternalData = NULL; -#endif - return 0; -} - -static INT32 DrvFrame() -{ - static UINT8 lastnmi = 0; - - if (DrvReset) { - DrvDoReset(); - } - - { // Compile Inputs - memset (DrvInputs, 0xff, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - if (SwapButton2) - { // Kludge for Xenon and Astro Marine Corps where button #2 is the 'm' key. - static INT32 lastM = 0; - if (DrvJoy1[5]) { - keyInput('m', DrvJoy1[5]); - } else { - if (lastM) { // only turn 'm' off once after Button2 is unpressed. - keyInput('m', DrvJoy1[5]); - } - } - lastM = DrvJoy1[5]; - } - - SwapJoyports = (DrvDips[0] & 0x20) ? 1 : 0; - MapCursorToJoy1 = (DrvDips[0] & 0x80) ? 1 : 0; - - // Keyboard fun! - keyInput(0xf1, DrvJoy4[3]); // f1 - f6 - keyInput(0xf2, DrvJoy4[4]); - keyInput(0xf3, DrvJoy4[5]); - keyInput(0xf4, DrvJoy4[6]); - keyInput(0xf5, DrvJoy4[7]); - keyInput(0xf6, DrvJoy4[8]); - - if (MapCursorToJoy1) - { // Mapped to Joy #1 - keyInput(0xf8, DrvJoy1[0]); // Key UP - keyInput(0xf9, DrvJoy1[1]); // Key DOWN - keyInput(0xfa, DrvJoy1[2]); // Key LEFT - keyInput(0xfb, DrvJoy1[3]); // Key RIGHT - keyInput(' ', DrvJoy1[4]); - } else - { // Normal Cursor-key function - keyInput(0xf8, DrvJoy4[9]); // Key UP - keyInput(0xf9, DrvJoy4[10]); // Key DOWN - keyInput(0xfa, DrvJoy4[11]); // Key LEFT - keyInput(0xfb, DrvJoy4[12]); // Key RIGHT - } - } - - { // detect tape side changes - CASSide = (DrvDips[0] & 0x40) ? 1 : 0; - if (CASSideLast != CASSide) { - bprintf(0, _T("Tape change: Side %c\n"), (CASSide) ? 'B' : 'A'); - CASSideChange(); - } - - // cassette auto-load keyboard stuffing - if (CASMode && CASFrameCounter > 250 && CASFrameCounter & 2) - CASAutoLoadTick(); - CASFrameCounter++; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[1] = { 3579545 / ((Hertz60) ? 60 : 50) }; - INT32 nCyclesDone[1] = { 0 }; - INT32 nSoundBufferPos = 0; - - ZetNewFrame(); - ZetOpen(0); - - if (DrvNMI && !lastnmi) { - ZetNmi(); - lastnmi = DrvNMI; - } else lastnmi = DrvNMI; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - - TMS9928AScanline(i); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - K051649Update(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - ZetClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - K051649Update(pSoundBuf, nSegmentLength); - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - TMS9928ADraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029708; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - K051649Scan(nAction, pnMin); - DACScan(nAction,pnMin); - TMS9928AScan(nAction, pnMin); - ppi8255_scan(); - - SCAN_VAR(RAMMapper); - SCAN_VAR(ROMMapper); - SCAN_VAR(WriteMode); - SCAN_VAR(PSL); - SCAN_VAR(PSLReg); - SCAN_VAR(SCCReg); - - SCAN_VAR(dooly_prot); - SCAN_VAR(crossblaim_selected_bank); - SCAN_VAR(rtype_selected_bank); - - SCAN_VAR(CASPos); - SCAN_VAR(CASAutoLoadPos); - SCAN_VAR(CASAutoLoadTicker); - SCAN_VAR(CASFrameCounter); - } - - if (nAction & ACB_WRITE) { - if (RAMMask) { // re-map ram - for (INT32 i = 0; i < 4; i++) { - RAMMapper[i] &= RAMMask; - MemMap[RAMSLOT][i * 2] = RAMData + RAMMapper[i] * 0x4000; - MemMap[RAMSLOT][i * 2 + 1] = MemMap[RAMSLOT][i * 2] + 0x2000; - } - } - - for (INT32 i = 0; i < MAXSLOTS; i++) - if (ROMData[i] && ROMMask[i]) { - MapMegaROM(i, ROMMapper[i][0], ROMMapper[i][1], ROMMapper[i][2], ROMMapper[i][3]); - crossblaim_do_bank(ROMData[i]); - rtype_do_bank(ROMData[i]); - } - - for (INT32 i = 0; i < 4; i++) { - RAM[2 * i] = MemMap[PSL[i]][2 * i]; - RAM[2 * i + 1] = MemMap[PSL[i]][2 * i + 1]; - } - } - - return 0; -} - -INT32 MSXGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = BurnDrvGetTextA(DRV_NAME); - } else { - if (i == 1 && BurnDrvGetTextA(DRV_BOARDROM)) { - pszGameName = BurnDrvGetTextA(DRV_BOARDROM); - } else { - pszGameName = BurnDrvGetTextA(DRV_PARENT); - } - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - // remove msx_ - for (UINT32 j = 0; j < strlen(pszGameName); j++) { - szFilename[j] = pszGameName[j + 4]; - } - - *pszName = szFilename; - - return 0; -} - -// MSX1 BIOS -static struct BurnRomInfo msx_msxRomDesc[] = { - { "msx.rom", 0x8000, 0xa317e6b4, BRF_BIOS }, // 0x80 - standard bios - { "msxj.rom", 0x8000, 0x071135e0, BRF_BIOS | BRF_OPT }, // 0x81 - japanese bios - { "kanji.rom", 0x40000, 0x1f6406fb, BRF_BIOS | BRF_OPT }, // 0x82 - kanji support -}; - -STD_ROM_PICK(msx_msx) -STD_ROM_FN(msx_msx) - -struct BurnDriver BurnDrvmsx_msx = { - "msx_msx", NULL, NULL, NULL, "1982", - "MSX1 System BIOS\0", "BIOS only", "MSX", "MSX", - NULL, NULL, NULL, NULL, - BDF_BOARDROM, 0, HARDWARE_MSX, GBF_BIOS, 0, - MSXGetZipName, msx_msxRomInfo, msx_msxRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - -static INT32 SwapSlashDrvInit() -{ - SwapSlash = 1; - return DrvInit(); -} - -static INT32 SwapButton2DrvInit() -{ - SwapButton2 = 1; - return DrvInit(); -} - -static INT32 SwapRamDrvInit() -{ - SwapRamslot = 1; - return DrvInit(); -} - -static INT32 BasicDrvInit() -{ - msx_basicmode = 1; - return DrvInit(); -} - -static INT32 CasBloadDrvInit() -{ - msx_basicmode = 1; - CASMode = CAS_BLOAD; - return DrvInit(); -} - -static INT32 CasRunSwapButton2DrvInit() -{ - msx_basicmode = 1; - SwapButton2 = 1; - CASMode = CAS_RUN; - return DrvInit(); -} - -static INT32 CasRunDrvInit() -{ - msx_basicmode = 1; - CASMode = CAS_RUN; - return DrvInit(); -} - -static INT32 CasCloadDrvInit() -{ - msx_basicmode = 1; - CASMode = CAS_CLOAD; - return DrvInit(); -} - -static INT32 CasCloadRRDrvInit() -{ // special for perez the mouse :) - msx_basicmode = 1; - CASMode = CAS_CLOADRR; - return DrvInit(); -} - -static INT32 VoidrunnerDrvInit() -{ - msx_basicmode = 1; - VBlankKludge = 1; - CASMode = CAS_RUN; - return DrvInit(); -} - -// MSX1 Basic - -static struct BurnRomInfo MSX_msxbasicRomDesc[] = { - { "msx.rom", 0x08000, 0xa317e6b4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_msxbasic, MSX_msxbasic, msx_msx) -STD_ROM_FN(MSX_msxbasic) - -struct BurnDriver BurnDrvMSX_msxbasic = { - "msx_msxbasic", NULL, "msx_msx", NULL, "1983", - "MSX Basic\0", NULL, "Microsoft / ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_msxbasicRomInfo, MSX_msxbasicRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - BasicDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// 1942 (Jpn) - -static struct BurnRomInfo MSX_1942RomDesc[] = { - { "nc81820-g30 japan 8649", 0x20000, 0xa27787af, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_1942, MSX_1942, msx_msx) -STD_ROM_FN(MSX_1942) - -struct BurnDriver BurnDrvMSX_1942 = { - "msx_1942", NULL, "msx_msx", NULL, "1986", - "1942 (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_1942RomInfo, MSX_1942RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Black Onyx II - Search For The Fire Crystal (Jpn) - -static struct BurnRomInfo MSX_blckony2RomDesc[] = { - { "lh231013", 0x20000, 0x67bf8337, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_blckony2, MSX_blckony2, msx_msx) -STD_ROM_FN(MSX_blckony2) - -struct BurnDriver BurnDrvMSX_blckony2 = { - "msx_blckony2", NULL, "msx_msx", NULL, "1986", - "The Black Onyx II - Search For The Fire Crystal (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_blckony2RomInfo, MSX_blckony2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Borfes to 5-nin no Akuma - An Adventure Story (Jpn) - -static struct BurnRomInfo MSX_borfesRomDesc[] = { - { "lh231066", 0x20000, 0xe040e8a1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_borfes, MSX_borfes, msx_msx) -STD_ROM_FN(MSX_borfes) - -struct BurnDriver BurnDrvMSX_borfes = { - "msx_borfes", NULL, "msx_msx", NULL, "1987", - "Borfes to 5-nin no Akuma - An Adventure Story (Jpn)\0", NULL, "Xtal Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_borfesRomInfo, MSX_borfesRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Daiva Story 4 - Asura's Bloodfeud (Jpn) - -static struct BurnRomInfo MSX_daiva4RomDesc[] = { - { "lh532020", 0x40000, 0x99198ed9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_daiva4, MSX_daiva4, msx_msx) -STD_ROM_FN(MSX_daiva4) - -struct BurnDriver BurnDrvMSX_daiva4 = { - "msx_daiva4", NULL, "msx_msx", NULL, "1987", - "Daiva Story 4 - Asura's Bloodfeud (Jpn)\0", NULL, "T&E Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_daiva4RomInfo, MSX_daiva4RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Digital Devil Monogatari - Megami Tensei (Jpn) - -static struct BurnRomInfo MSX_megamitRomDesc[] = { - { "lh231089", 0x20000, 0x25fc11fa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_megamit, MSX_megamit, msx_msx) -STD_ROM_FN(MSX_megamit) - -struct BurnDriver BurnDrvMSX_megamit = { - "msx_megamit", NULL, "msx_msx", NULL, "1987", - "Digital Devil Monogatari - Megami Tensei (Jpn)\0", NULL, "Nihon Telenet", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_megamitRomInfo, MSX_megamitRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dragon Quest (Jpn) - -static struct BurnRomInfo MSX_dquestRomDesc[] = { - { "cxk381000", 0x20000, 0x49f5478b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dquest, MSX_dquest, msx_msx) -STD_ROM_FN(MSX_dquest) - -struct BurnDriver BurnDrvMSX_dquest = { - "msx_dquest", NULL, "msx_msx", NULL, "1986", - "Dragon Quest (Jpn)\0", NULL, "Enix", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_dquestRomInfo, MSX_dquestRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dragon Quest II - Akuryou no Kamigami (Jpn) - -static struct BurnRomInfo MSX_dquest2RomDesc[] = { - { "lh532060", 0x40000, 0x8076fec6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dquest2, MSX_dquest2, msx_msx) -STD_ROM_FN(MSX_dquest2) - -struct BurnDriver BurnDrvMSX_dquest2 = { - "msx_dquest2", NULL, "msx_msx", NULL, "1987", - "Dragon Quest II - Akuryou no Kamigami (Jpn)\0", NULL, "Enix", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_dquest2RomInfo, MSX_dquest2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dragon Slayer IV - Drasle Family (Jpn) - -static struct BurnRomInfo MSX_dslayer4RomDesc[] = { - { "lh5320z5", 0x40000, 0x87dcd309, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dslayer4, MSX_dslayer4, msx_msx) -STD_ROM_FN(MSX_dslayer4) - -struct BurnDriver BurnDrvMSX_dslayer4 = { - "msx_dslayer4", NULL, "msx_msx", NULL, "1987", - "Dragon Slayer IV - Drasle Family (Jpn)\0", NULL, "Nihon Falcom", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_dslayer4RomInfo, MSX_dslayer4RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dungeon Hunter (Jpn) - -static struct BurnRomInfo MSX_dngnhntrRomDesc[] = { - { "rp231026d", 0x20000, 0x2526e568, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dngnhntr, MSX_dngnhntr, msx_msx) -STD_ROM_FN(MSX_dngnhntr) - -struct BurnDriver BurnDrvMSX_dngnhntr = { - "msx_dngnhntr", NULL, "msx_msx", NULL, "1989", - "Dungeon Hunter (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_dngnhntrRomInfo, MSX_dngnhntrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Fantasy Zone (Jpn) - -static struct BurnRomInfo MSX_fantzoneRomDesc[] = { - { "lh531057", 0x20000, 0x3e96d005, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fantzone, MSX_fantzone, msx_msx) -STD_ROM_FN(MSX_fantzone) - -struct BurnDriver BurnDrvMSX_fantzone = { - "msx_fantzone", NULL, "msx_msx", NULL, "1986", - "Fantasy Zone (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_fantzoneRomInfo, MSX_fantzoneRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Final Zone (Jpn) - -static struct BurnRomInfo MSX_fzoneRomDesc[] = { - { "fzr-2001", 0x20000, 0x14e2efcc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fzone, MSX_fzone, msx_msx) -STD_ROM_FN(MSX_fzone) - -struct BurnDriver BurnDrvMSX_fzone = { - "msx_fzone", NULL, "msx_msx", NULL, "1986", - "Final Zone (Jpn)\0", NULL, "Nihon Telenet", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_fzoneRomInfo, MSX_fzoneRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flight Simulator - Gyorai Kougeki (Jpn) - -static struct BurnRomInfo MSX_fsimRomDesc[] = { - { "rp231024d", 0x20000, 0xa6165bd4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fsim, MSX_fsim, msx_msx) -STD_ROM_FN(MSX_fsim) - -struct BurnDriver BurnDrvMSX_fsim = { - "msx_fsim", NULL, "msx_msx", NULL, "1988", - "Flight Simulator - Gyorai Kougeki (Jpn)\0", NULL, "subLOGIC", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_fsimRomInfo, MSX_fsimRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gambler Jikochuushinha (Jpn) - -static struct BurnRomInfo MSX_gamblerRomDesc[] = { - { "lh53210a game arts", 0x40000, 0x91955bcd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gambler, MSX_gambler, msx_msx) -STD_ROM_FN(MSX_gambler) - -struct BurnDriver BurnDrvMSX_gambler = { - "msx_gambler", NULL, "msx_msx", NULL, "1988", - "Gambler Jikochuushinha (Jpn)\0", NULL, "Game Arts", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_gamblerRomInfo, MSX_gamblerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Golvellius (Jpn) - -static struct BurnRomInfo MSX_golvellRomDesc[] = { - { "compile ia-8701", 0x20000, 0x5eac55df, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_golvell, MSX_golvell, msx_msx) -STD_ROM_FN(MSX_golvell) - -struct BurnDriver BurnDrvMSX_golvell = { - "msx_golvell", NULL, "msx_msx", NULL, "1987", - "Golvellius (Jpn)\0", NULL, "Compile", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_golvellRomInfo, MSX_golvellRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hydlide II - Shine of Darkness (Jpn) - -static struct BurnRomInfo MSX_hydlide2RomDesc[] = { - { "lh531043", 0x20000, 0xd8055f5f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hydlide2, MSX_hydlide2, msx_msx) -STD_ROM_FN(MSX_hydlide2) - -struct BurnDriver BurnDrvMSX_hydlide2 = { - "msx_hydlide2", NULL, "msx_msx", NULL, "1986", - "Hydlide II - Shine of Darkness (Jpn)\0", NULL, "T&E Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16_SRAM, GBF_MISC, 0, - MSXGetZipName, MSX_hydlide2RomInfo, MSX_hydlide2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hydlide 3 - The Space Memories (Jpn) - -static struct BurnRomInfo MSX_hydlide3RomDesc[] = { - { "hydlide3 4m-rom", 0x80000, 0x00c5d5b5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hydlide3, MSX_hydlide3, msx_msx) -STD_ROM_FN(MSX_hydlide3) - -struct BurnDriver BurnDrvMSX_hydlide3 = { - "msx_hydlide3", NULL, "msx_msx", NULL, "1987", - "Hydlide 3 - The Space Memories (Jpn)\0", NULL, "T&E Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_hydlide3RomInfo, MSX_hydlide3RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Jagur (Jpn) - -static struct BurnRomInfo MSX_jagurRomDesc[] = { - { "rp231024d", 0x20000, 0xd6465702, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jagur, MSX_jagur, msx_msx) -STD_ROM_FN(MSX_jagur) - -struct BurnDriver BurnDrvMSX_jagur = { - "msx_jagur", NULL, "msx_msx", NULL, "1987", - "Jagur (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_jagurRomInfo, MSX_jagurRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King's Knight (Jpn) - -static struct BurnRomInfo MSX_kingkngtRomDesc[] = { - { "643103", 0x20000, 0xa0481321, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingkngt, MSX_kingkngt, msx_msx) -STD_ROM_FN(MSX_kingkngt) - -struct BurnDriver BurnDrvMSX_kingkngt = { - "msx_kingkngt", NULL, "msx_msx", NULL, "1986", - "King's Knight (Jpn)\0", NULL, "Square", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_kingkngtRomInfo, MSX_kingkngtRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Marchen Veil I (Jpn) - -static struct BurnRomInfo MSX_marchenRomDesc[] = { - { "cxk381000", 0x20000, 0x44aa5422, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_marchen, MSX_marchen, msx_msx) -STD_ROM_FN(MSX_marchen) - -struct BurnDriver BurnDrvMSX_marchen = { - "msx_marchen", NULL, "msx_msx", NULL, "1987", - "Marchen Veil I (Jpn)\0", NULL, "System Sacom", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_marchenRomInfo, MSX_marchenRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mirai (Jpn) - -static struct BurnRomInfo MSX_miraiRomDesc[] = { - { "rp231024d", 0x20000, 0x72eb9d0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mirai, MSX_mirai, msx_msx) -STD_ROM_FN(MSX_mirai) - -struct BurnDriver BurnDrvMSX_mirai = { - "msx_mirai", NULL, "msx_msx", NULL, "1987", - "Mirai (Jpn)\0", NULL, "Xain Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_miraiRomInfo, MSX_miraiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mugen Senshi Valis (Jpn) - -static struct BurnRomInfo MSX_valisRomDesc[] = { - { "831000-440 20 bk z86", 0x20000, 0x309d996c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_valis, MSX_valis, msx_msx) -STD_ROM_FN(MSX_valis) - -struct BurnDriver BurnDrvMSX_valis = { - "msx_valis", NULL, "msx_msx", NULL, "1986", - "Mugen Senshi Valis (Jpn)\0", NULL, "Nihon Telenet", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_valisRomInfo, MSX_valisRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Relics (Jpn) - -static struct BurnRomInfo MSX_relicsRomDesc[] = { - { "cxk381000", 0x20000, 0xb612d79a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_relics, MSX_relics, msx_msx) -STD_ROM_FN(MSX_relics) - -struct BurnDriver BurnDrvMSX_relics = { - "msx_relics", NULL, "msx_msx", NULL, "1986", - "Relics (Jpn)\0", NULL, "Bothtec", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_relicsRomInfo, MSX_relicsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Romancia (Jpn) - -static struct BurnRomInfo MSX_romanciaRomDesc[] = { - { "831000-20", 0x20000, 0x387c1de7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_romancia, MSX_romancia, msx_msx) -STD_ROM_FN(MSX_romancia) - -struct BurnDriver BurnDrvMSX_romancia = { - "msx_romancia", NULL, "msx_msx", NULL, "1987", - "Romancia (Jpn)\0", NULL, "Nihon Falcom", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_romanciaRomInfo, MSX_romanciaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// R-Type (Jpn) - -static struct BurnRomInfo MSX_rtypeRomDesc[] = { - { "R-Type (1988) (Irem) (J).rom", 0x60000, 0xa884911c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rtype, MSX_rtype, msx_msx) -STD_ROM_FN(MSX_rtype) - -struct BurnDriver BurnDrvMSX_rtype = { - "msx_rtype", NULL, "msx_msx", NULL, "1988", - "R-Type (Jpn)\0", NULL, "Irem", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_RTYPE, GBF_MISC, 0, - MSXGetZipName, MSX_rtypeRomInfo, MSX_rtypeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// R-Type (Jpn, Alt) - -static struct BurnRomInfo MSX_rtypeaRomDesc[] = { - { "r-type (japan) (alt 2).rom", 0x80000, 0x827919e4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rtypea, MSX_rtypea, msx_msx) -STD_ROM_FN(MSX_rtypea) - -struct BurnDriver BurnDrvMSX_rtypea = { - "msx_rtypea", "msx_rtype", "msx_msx", NULL, "1988", - "R-Type (Jpn, Alt)\0", NULL, "Irem", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_RTYPE, GBF_MISC, 0, - MSXGetZipName, MSX_rtypeaRomInfo, MSX_rtypeaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Senjou no Ookami (Jpn) - -static struct BurnRomInfo MSX_senjokamRomDesc[] = { - { "lh231073", 0x20000, 0x427b3f14, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_senjokam, MSX_senjokam, msx_msx) -STD_ROM_FN(MSX_senjokam) - -struct BurnDriver BurnDrvMSX_senjokam = { - "msx_senjokam", NULL, "msx_msx", NULL, "1987", - "Senjou no Ookami (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_senjokamRomInfo, MSX_senjokamRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Shougun (Jpn) - -static struct BurnRomInfo MSX_shogunRomDesc[] = { - { "lh23100y", 0x20000, 0x0e691c47, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_shogun, MSX_shogun, msx_msx) -STD_ROM_FN(MSX_shogun) - -struct BurnDriver BurnDrvMSX_shogun = { - "msx_shogun", NULL, "msx_msx", NULL, "1987", - "Shougun (Jpn)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8_SRAM, GBF_MISC, 0, - MSXGetZipName, MSX_shogunRomInfo, MSX_shogunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Laydock - Mission Striker (Jpn) - -static struct BurnRomInfo MSX_slaydockRomDesc[] = { - { "lh532072", 0x40000, 0x5dc45624, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_slaydock, MSX_slaydock, msx_msx) -STD_ROM_FN(MSX_slaydock) - -struct BurnDriver BurnDrvMSX_slaydock = { - "msx_slaydock", NULL, "msx_msx", NULL, "1987", - "Super Laydock - Mission Striker (Jpn)\0", NULL, "T&E Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_slaydockRomInfo, MSX_slaydockRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Vaxol (Jpn) - -static struct BurnRomInfo MSX_vaxolRomDesc[] = { - { "rp231024d", 0x20000, 0xfea70207, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_vaxol, MSX_vaxol, msx_msx) -STD_ROM_FN(MSX_vaxol) - -struct BurnDriver BurnDrvMSX_vaxol = { - "msx_vaxol", NULL, "msx_msx", NULL, "1987", - "Vaxol (Jpn)\0", NULL, "Heart Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_vaxolRomInfo, MSX_vaxolRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Wing Man 2 - Kitakura no Fukkatsu (Jpn) - -static struct BurnRomInfo MSX_wingman2RomDesc[] = { - { "enix wing2 rp231024d 0408", 0x20000, 0x5c9d8f62, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wingman2, MSX_wingman2, msx_msx) -STD_ROM_FN(MSX_wingman2) - -struct BurnDriver BurnDrvMSX_wingman2 = { - "msx_wingman2", NULL, "msx_msx", NULL, "1987", - "Wing Man 2 - Kitakura no Fukkatsu (Jpn)\0", NULL, "Enix", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_wingman2RomInfo, MSX_wingman2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Xanadu - Dragon Slayer II (Jpn) - -static struct BurnRomInfo MSX_xanaduRomDesc[] = { - { "lh532051", 0x40000, 0xd640deaf, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_xanadu, MSX_xanadu, msx_msx) -STD_ROM_FN(MSX_xanadu) - -struct BurnDriver BurnDrvMSX_xanadu = { - "msx_xanadu", NULL, "msx_msx", NULL, "1987", - "Xanadu - Dragon Slayer II (Jpn)\0", NULL, "Nihon Falcom", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_xanaduRomInfo, MSX_xanaduRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// 10-Yard Fight (Jpn) - -static struct BurnRomInfo MSX_10yardRomDesc[] = { - { "10-yard fight (japan).rom", 0x08000, 0x4e20d256, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_10yard, MSX_10yard, msx_msx) -STD_ROM_FN(MSX_10yard) - -struct BurnDriver BurnDrvMSX_10yard = { - "msx_10yard", NULL, "msx_msx", NULL, "1986", - "10-Yard Fight (Jpn)\0", NULL, "Irem", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_10yardRomInfo, MSX_10yardRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// 10-Yard Fight (Jpn, Alt) - -static struct BurnRomInfo MSX_10yardaRomDesc[] = { - { "10-yard fight (japan) (alt 1).rom", 0x08000, 0x879e6ddb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_10yarda, MSX_10yarda, msx_msx) -STD_ROM_FN(MSX_10yarda) - -struct BurnDriver BurnDrvMSX_10yarda = { - "msx_10yarda", "msx_10yard", "msx_msx", NULL, "1986", - "10-Yard Fight (Jpn, Alt)\0", NULL, "Irem", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_10yardaRomInfo, MSX_10yardaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// 1942 (Jpn, Alt) - -static struct BurnRomInfo MSX_1942aRomDesc[] = { - { "1942 (japan) (alt 1).rom", 0x20000, 0xe54ee601, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_1942a, MSX_1942a, msx_msx) -STD_ROM_FN(MSX_1942a) - -struct BurnDriver BurnDrvMSX_1942a = { - "msx_1942a", "msx_1942", "msx_msx", NULL, "1986", - "1942 (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_1942aRomInfo, MSX_1942aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// 1942 (Kor) - -static struct BurnRomInfo MSX_1942kRomDesc[] = { - { "1942 (zemina).rom", 0x20000, 0x10d97b9e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_1942k, MSX_1942k, msx_msx) -STD_ROM_FN(MSX_1942k) - -struct BurnDriver BurnDrvMSX_1942k = { - "msx_1942k", "msx_1942", "msx_msx", NULL, "1987", - "1942 (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_1942kRomInfo, MSX_1942kRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// A Life Planet - M36 - Mother Brain has been aliving (Jpn) - -static struct BurnRomInfo MSX_m36RomDesc[] = { - { "m36 - a life planet (japan).rom", 0x20000, 0xfa8f9bbc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_m36, MSX_m36, msx_msx) -STD_ROM_FN(MSX_m36) - -struct BurnDriver BurnDrvMSX_m36 = { - "msx_m36", NULL, "msx_msx", NULL, "1987", - "A Life Planet - M36 - Mother Brain has been aliving (Jpn)\0", NULL, "Pixel", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_m36RomInfo, MSX_m36RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// A Na Za - Kaleidoscope Special (Jpn) - -static struct BurnRomInfo MSX_anazaRomDesc[] = { - { "anaza - kaleidoscope special (japan).rom", 0x08000, 0x7dc880eb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_anaza, MSX_anaza, msx_msx) -STD_ROM_FN(MSX_anaza) - -struct BurnDriver BurnDrvMSX_anaza = { - "msx_anaza", NULL, "msx_msx", NULL, "1987", - "A Na Za - Kaleidoscope Special (Jpn)\0", NULL, "GA-Yume", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_anazaRomInfo, MSX_anazaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// A.E. (Jpn) - -static struct BurnRomInfo MSX_aeRomDesc[] = { - { "a.e. (japan).rom", 0x04000, 0x2e1b3dd4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ae, MSX_ae, msx_msx) -STD_ROM_FN(MSX_ae) - -struct BurnDriver BurnDrvMSX_ae = { - "msx_ae", NULL, "msx_msx", NULL, "1982", - "A.E. (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_aeRomInfo, MSX_aeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// A1 Spirit - The Way to Formula-1 (Jpn) - -static struct BurnRomInfo MSX_a1spiritRomDesc[] = { - { "a1 spirit - the way to formula-1 (japan).rom", 0x20000, 0x2608c959, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_a1spirit, MSX_a1spirit, msx_msx) -STD_ROM_FN(MSX_a1spirit) - -struct BurnDriver BurnDrvMSX_a1spirit = { - "msx_a1spirit", "msx_f1spirit", "msx_msx", NULL, "1987", - "A1 Spirit - The Way to Formula-1 (Jpn)\0", "Set BIOS to Japanese mode.", "Panasoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_a1spiritRomInfo, MSX_a1spiritRomName, NULL, NULL, MSXInputInfo, MSXJapanDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Actman (Jpn) - -static struct BurnRomInfo MSX_actmanRomDesc[] = { - { "actman (japan).rom", 0x04000, 0xe4dbcdbd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_actman, MSX_actman, msx_msx) -STD_ROM_FN(MSX_actman) - -struct BurnDriver BurnDrvMSX_actman = { - "msx_actman", NULL, "msx_msx", NULL, "1985", - "Actman (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_actmanRomInfo, MSX_actmanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Actman (Jpn, Alt) - -static struct BurnRomInfo MSX_actmanaRomDesc[] = { - { "actman (japan) (alt 1).rom", 0x04000, 0x7179a4bd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_actmana, MSX_actmana, msx_msx) -STD_ROM_FN(MSX_actmana) - -struct BurnDriver BurnDrvMSX_actmana = { - "msx_actmana", "msx_actman", "msx_msx", NULL, "1985", - "Actman (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_actmanaRomInfo, MSX_actmanaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Albatross (Jpn) - -static struct BurnRomInfo MSX_albatrosRomDesc[] = { - { "albatros (japan).rom", 0x08000, 0x847fc6e2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_albatros, MSX_albatros, msx_msx) -STD_ROM_FN(MSX_albatros) - -struct BurnDriver BurnDrvMSX_albatros = { - "msx_albatros", NULL, "msx_msx", NULL, "1986", - "Albatross (Jpn)\0", NULL, "Nihon Telenet", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_albatrosRomInfo, MSX_albatrosRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Albatross (Jpn, Alt) - -static struct BurnRomInfo MSX_albatrosaRomDesc[] = { - { "albatros (japan) (alt 1).rom", 0x08000, 0xe27f41df, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_albatrosa, MSX_albatrosa, msx_msx) -STD_ROM_FN(MSX_albatrosa) - -struct BurnDriver BurnDrvMSX_albatrosa = { - "msx_albatrosa", "msx_albatros", "msx_msx", NULL, "1986", - "Albatross (Jpn, Alt)\0", NULL, "Nihon Telenet", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_albatrosaRomInfo, MSX_albatrosaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Alibaba and 40 Thieves (Jpn) - -static struct BurnRomInfo MSX_alibabaRomDesc[] = { - { "alibaba and 40 thieves (japan).rom", 0x04000, 0x2f72b1e3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alibaba, MSX_alibaba, msx_msx) -STD_ROM_FN(MSX_alibaba) - -struct BurnDriver BurnDrvMSX_alibaba = { - "msx_alibaba", NULL, "msx_msx", NULL, "1984", - "Alibaba and 40 Thieves (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alibabaRomInfo, MSX_alibabaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Alibaba and 40 Thieves (Jpn, Alt) - -static struct BurnRomInfo MSX_alibabaaRomDesc[] = { - { "alibaba and 40 thieves (japan) (alt 1).rom", 0x04000, 0xf1b90309, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alibabaa, MSX_alibabaa, msx_msx) -STD_ROM_FN(MSX_alibabaa) - -struct BurnDriver BurnDrvMSX_alibabaa = { - "msx_alibabaa", "msx_alibaba", "msx_msx", NULL, "1984", - "Alibaba and 40 Thieves (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alibabaaRomInfo, MSX_alibabaaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Alibaba and 40 Thieves (Jpn, Alt 2) - -static struct BurnRomInfo MSX_alibababRomDesc[] = { - { "alibaba and 40 thieves (japan) (alt 2).rom", 0x04000, 0xf1d176ff, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alibabab, MSX_alibabab, msx_msx) -STD_ROM_FN(MSX_alibabab) - -struct BurnDriver BurnDrvMSX_alibabab = { - "msx_alibabab", "msx_alibaba", "msx_msx", NULL, "1984", - "Alibaba and 40 Thieves (Jpn, Alt 2)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alibababRomInfo, MSX_alibababRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Alien 8 (Jpn) - -static struct BurnRomInfo MSX_alien8RomDesc[] = { - { "alien 8 (japan).rom", 0x08000, 0x93a25be1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alien8, MSX_alien8, msx_msx) -STD_ROM_FN(MSX_alien8) - -struct BurnDriver BurnDrvMSX_alien8 = { - "msx_alien8", NULL, "msx_msx", NULL, "1987", - "Alien 8 (Jpn)\0", NULL, "Jaleco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alien8RomInfo, MSX_alien8RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Alien 8 (Jpn, Hacked?) - -static struct BurnRomInfo MSX_alien8hRomDesc[] = { - { "alien 8 (japan) (alt 1).rom", 0x08000, 0x3b4ed316, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alien8h, MSX_alien8h, msx_msx) -STD_ROM_FN(MSX_alien8h) - -struct BurnDriver BurnDrvMSX_alien8h = { - "msx_alien8h", "msx_alien8", "msx_msx", NULL, "1985", - "Alien 8 (Jpn, Hacked?)\0", NULL, "A.C.G.", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alien8hRomInfo, MSX_alien8hRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Aliens - Alien 2 (Jpn) - -static struct BurnRomInfo MSX_aliensRomDesc[] = { - { "aliens - alien 2 (japan).rom", 0x20000, 0xc6fc7bd7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_aliens, MSX_aliens, msx_msx) -STD_ROM_FN(MSX_aliens) - -struct BurnDriver BurnDrvMSX_aliens = { - "msx_aliens", NULL, "msx_msx", NULL, "1987", - "Aliens - Alien 2 (Jpn)\0", NULL, "Square", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_aliensRomInfo, MSX_aliensRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Aliens - Alien 2 (Jpn, Alt) - -static struct BurnRomInfo MSX_aliensaRomDesc[] = { - { "aliens - alien 2 (japan) (alt 1).rom", 0x20000, 0xa6e924ab, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_aliensa, MSX_aliensa, msx_msx) -STD_ROM_FN(MSX_aliensa) - -struct BurnDriver BurnDrvMSX_aliensa = { - "msx_aliensa", "msx_aliens", "msx_msx", NULL, "1987", - "Aliens - Alien 2 (Jpn, Alt)\0", NULL, "Square", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_aliensaRomInfo, MSX_aliensaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Aliens - Alien 2 (Jpn, Alt 2) - -static struct BurnRomInfo MSX_aliensbRomDesc[] = { - { "aliens - alien 2 (japan) (alt 2).rom", 0x20000, 0x3ddcb524, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_aliensb, MSX_aliensb, msx_msx) -STD_ROM_FN(MSX_aliensb) - -struct BurnDriver BurnDrvMSX_aliensb = { - "msx_aliensb", "msx_aliens", "msx_msx", NULL, "1987", - "Aliens - Alien 2 (Jpn, Alt 2)\0", NULL, "Square", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_aliensbRomInfo, MSX_aliensbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Alfa Roid (Jpn) - -static struct BurnRomInfo MSX_aroidRomDesc[] = { - { "alpha roid (japan).rom", 0x08000, 0x4ef7c4e7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_aroid, MSX_aroid, msx_msx) -STD_ROM_FN(MSX_aroid) - -struct BurnDriver BurnDrvMSX_aroid = { - "msx_aroid", NULL, "msx_msx", NULL, "1986", - "Alfa Roid (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_aroidRomInfo, MSX_aroidRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Alfa Roid (Jpn, Alt) - -static struct BurnRomInfo MSX_aroidaRomDesc[] = { - { "alpha roid (japan) (alt 1).rom", 0x08000, 0x716dc9af, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_aroida, MSX_aroida, msx_msx) -STD_ROM_FN(MSX_aroida) - -struct BurnDriver BurnDrvMSX_aroida = { - "msx_aroida", "msx_aroid", "msx_msx", NULL, "1986", - "Alfa Roid (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_aroidaRomInfo, MSX_aroidaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// American Truck (Jpn) - -static struct BurnRomInfo MSX_amtruckaRomDesc[] = { - { "american truck (japan).rom", 0x08000, 0x1dd9b4d9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_amtrucka, MSX_amtrucka, msx_msx) -STD_ROM_FN(MSX_amtrucka) - -struct BurnDriver BurnDrvMSX_amtrucka = { - "msx_amtrucka", NULL, "msx_msx", NULL, "1985", - "American Truck (Jpn)\0", NULL, "Nihon Telenet", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_amtruckaRomInfo, MSX_amtruckaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Angelo (Jpn) - -static struct BurnRomInfo MSX_angeloRomDesc[] = { - { "angelo (japan).rom", 0x04000, 0x20143ec7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_angelo, MSX_angelo, msx_msx) -STD_ROM_FN(MSX_angelo) - -struct BurnDriver BurnDrvMSX_angelo = { - "msx_angelo", NULL, "msx_msx", NULL, "1984", - "Angelo (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_angeloRomInfo, MSX_angeloRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Angelo (Jpn, Alt) - -static struct BurnRomInfo MSX_angeloaRomDesc[] = { - { "angelo (japan) (alt 1).rom", 0x04000, 0x3d8d0f4b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_angeloa, MSX_angeloa, msx_msx) -STD_ROM_FN(MSX_angeloa) - -struct BurnDriver BurnDrvMSX_angeloa = { - "msx_angeloa", "msx_angelo", "msx_msx", NULL, "1984", - "Angelo (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_angeloaRomInfo, MSX_angeloaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Antarctic Adventure (Euro) - -static struct BurnRomInfo MSX_antarctRomDesc[] = { - { "antarctic adventure (europe).rom", 0x04000, 0x6b739c93, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_antarct, MSX_antarct, msx_msx) -STD_ROM_FN(MSX_antarct) - -struct BurnDriver BurnDrvMSX_antarct = { - "msx_antarct", NULL, "msx_msx", NULL, "1984", - "Antarctic Adventure (Euro)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_antarctRomInfo, MSX_antarctRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Antarctic Adventure (Euro, Alt) - -static struct BurnRomInfo MSX_antarctaRomDesc[] = { - { "antarctic adventure (europe) (alt 1).rom", 0x04000, 0xe8bddedd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_antarcta, MSX_antarcta, msx_msx) -STD_ROM_FN(MSX_antarcta) - -struct BurnDriver BurnDrvMSX_antarcta = { - "msx_antarcta", "msx_antarct", "msx_msx", NULL, "1984", - "Antarctic Adventure (Euro, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_antarctaRomInfo, MSX_antarctaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Antarctic Adventure (Jpn) - -static struct BurnRomInfo MSX_antarctjRomDesc[] = { - { "antarctic adventure (japan).rom", 0x04000, 0xaae7028b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_antarctj, MSX_antarctj, msx_msx) -STD_ROM_FN(MSX_antarctj) - -struct BurnDriver BurnDrvMSX_antarctj = { - "msx_antarctj", "msx_antarct", "msx_msx", NULL, "1984", - "Antarctic Adventure (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_antarctjRomInfo, MSX_antarctjRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Antarctic Adventure (Kor) - -static struct BurnRomInfo MSX_antarctkRomDesc[] = { - { "antarctic adventure - japanese version (1984)(konami)[cr prosoft][rc-701].rom", 0x04001, 0x8ced0683, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_antarctk, MSX_antarctk, msx_msx) -STD_ROM_FN(MSX_antarctk) - -struct BurnDriver BurnDrvMSX_antarctk = { - "msx_antarctk", "msx_antarct", "msx_msx", NULL, "19??", - "Antarctic Adventure (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_antarctkRomInfo, MSX_antarctkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Anty (Jpn) - -static struct BurnRomInfo MSX_antyRomDesc[] = { - { "anty (japan).rom", 0x04000, 0xb1ace0a0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_anty, MSX_anty, msx_msx) -STD_ROM_FN(MSX_anty) - -struct BurnDriver BurnDrvMSX_anty = { - "msx_anty", NULL, "msx_msx", NULL, "1984", - "Anty (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_antyRomInfo, MSX_antyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Anty (Jpn, Alt) - -static struct BurnRomInfo MSX_antyaRomDesc[] = { - { "anty (japan) (alt 1).rom", 0x04000, 0x5baacb31, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_antya, MSX_antya, msx_msx) -STD_ROM_FN(MSX_antya) - -struct BurnDriver BurnDrvMSX_antya = { - "msx_antya", "msx_anty", "msx_msx", NULL, "1984", - "Anty (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_antyaRomInfo, MSX_antyaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Aqua Polis SOS (Jpn) - -static struct BurnRomInfo MSX_aquasosRomDesc[] = { - { "aqua polis sos (japan).rom", 0x04000, 0xf115257a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_aquasos, MSX_aquasos, msx_msx) -STD_ROM_FN(MSX_aquasos) - -struct BurnDriver BurnDrvMSX_aquasos = { - "msx_aquasos", NULL, "msx_msx", NULL, "1983", - "Aqua Polis SOS (Jpn)\0", NULL, "Paxon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_aquasosRomInfo, MSX_aquasosRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Aquattack (Jpn) - -static struct BurnRomInfo MSX_aquatackRomDesc[] = { - { "aquattack (japan).rom", 0x04000, 0xf3297895, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_aquatack, MSX_aquatack, msx_msx) -STD_ROM_FN(MSX_aquatack) - -struct BurnDriver BurnDrvMSX_aquatack = { - "msx_aquatack", NULL, "msx_msx", NULL, "1984", - "Aquattack (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_aquatackRomInfo, MSX_aquatackRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Aramo (Jpn) - -static struct BurnRomInfo MSX_aramoRomDesc[] = { - { "aramo (japan).rom", 0x08000, 0xab6b56ba, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_aramo, MSX_aramo, msx_msx) -STD_ROM_FN(MSX_aramo) - -struct BurnDriver BurnDrvMSX_aramo = { - "msx_aramo", NULL, "msx_msx", NULL, "1986", - "Aramo (Jpn)\0", NULL, "Sein Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_aramoRomInfo, MSX_aramoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Arkanoid (Euro?) - -static struct BurnRomInfo MSX_arkanoidRomDesc[] = { - { "arkanoid (japan) (alt 1).rom", 0x08000, 0x4fd4f778, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_arkanoid, MSX_arkanoid, msx_msx) -STD_ROM_FN(MSX_arkanoid) - -struct BurnDriver BurnDrvMSX_arkanoid = { - "msx_arkanoid", NULL, "msx_msx", NULL, "1986", - "Arkanoid (Euro?)\0", NULL, "Taito ~ Imagine", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_arkanoidRomInfo, MSX_arkanoidRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Arkanoid (Euro?, Alt) - -static struct BurnRomInfo MSX_arkanoidaRomDesc[] = { - { "arkanoid (japan) (alt 3).rom", 0x08000, 0x140a5965, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_arkanoida, MSX_arkanoida, msx_msx) -STD_ROM_FN(MSX_arkanoida) - -struct BurnDriver BurnDrvMSX_arkanoida = { - "msx_arkanoida", "msx_arkanoid", "msx_msx", NULL, "1986", - "Arkanoid (Euro?, Alt)\0", NULL, "Taito ~ Imagine", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_arkanoidaRomInfo, MSX_arkanoidaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Arkanoid (Jpn) - -static struct BurnRomInfo MSX_arkanoidjRomDesc[] = { - { "arkanoid (japan).rom", 0x08000, 0xc9a22dfc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_arkanoidj, MSX_arkanoidj, msx_msx) -STD_ROM_FN(MSX_arkanoidj) - -struct BurnDriver BurnDrvMSX_arkanoidj = { - "msx_arkanoidj", "msx_arkanoid", "msx_msx", NULL, "1986", - "Arkanoid (Jpn)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_arkanoidjRomInfo, MSX_arkanoidjRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Arkanoid (Jpn, Alt) - -static struct BurnRomInfo MSX_arkanoidjaRomDesc[] = { - { "arkanoid (japan) (alt 2).rom", 0x08000, 0x38a00d1b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_arkanoidja, MSX_arkanoidja, msx_msx) -STD_ROM_FN(MSX_arkanoidja) - -struct BurnDriver BurnDrvMSX_arkanoidja = { - "msx_arkanoidja", "msx_arkanoid", "msx_msx", NULL, "1986", - "Arkanoid (Jpn, Alt)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_arkanoidjaRomInfo, MSX_arkanoidjaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Arkanoid (Kor) - -static struct BurnRomInfo MSX_arkanoidkRomDesc[] = { - { "arkanoid.rom", 0x08000, 0xb62a0973, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_arkanoidk, MSX_arkanoidk, msx_msx) -STD_ROM_FN(MSX_arkanoidk) - -struct BurnDriver BurnDrvMSX_arkanoidk = { - "msx_arkanoidk", "msx_arkanoid", "msx_msx", NULL, "198?", - "Arkanoid (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_arkanoidkRomInfo, MSX_arkanoidkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Astro Marine Corps (Spa) - -static struct BurnRomInfo MSX_amcRomDesc[] = { - { "astro marine corps (1989)(dinamic software)(es).rom", 0x20000, 0x60f99d30, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_amc, MSX_amc, msx_msx) -STD_ROM_FN(MSX_amc) - -struct BurnDriver BurnDrvMSX_amc = { - "msx_amc", NULL, "msx_msx", NULL, "1989", - "Astro Marine Corps (Spa)\0", "Uses joyport #2. Press 'M' for Grenade.", "Dinamic Software?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_amcRomInfo, MSX_amcRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - SwapButton2DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Athletic Ball (Jpn) - -static struct BurnRomInfo MSX_athlballRomDesc[] = { - { "athletic ball (japan).rom", 0x04000, 0x11bac0e6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_athlball, MSX_athlball, msx_msx) -STD_ROM_FN(MSX_athlball) - -struct BurnDriver BurnDrvMSX_athlball = { - "msx_athlball", NULL, "msx_msx", NULL, "1984", - "Athletic Ball (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_athlballRomInfo, MSX_athlballRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Athletic Land (Jpn) - -static struct BurnRomInfo MSX_athlandRomDesc[] = { - { "athletic land (japan).rom", 0x04000, 0x7b1acdea, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_athland, MSX_athland, msx_msx) -STD_ROM_FN(MSX_athland) - -struct BurnDriver BurnDrvMSX_athland = { - "msx_athland", NULL, "msx_msx", NULL, "1984", - "Athletic Land (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_athlandRomInfo, MSX_athlandRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Athletic Land (Jpn, Alt) - -static struct BurnRomInfo MSX_athlandaRomDesc[] = { - { "athletic land (japan) (alt 1).rom", 0x04000, 0xd14361b2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_athlanda, MSX_athlanda, msx_msx) -STD_ROM_FN(MSX_athlanda) - -struct BurnDriver BurnDrvMSX_athlanda = { - "msx_athlanda", "msx_athland", "msx_msx", NULL, "1984", - "Athletic Land (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_athlandaRomInfo, MSX_athlandaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Athletic Land (Jpn, Prototype) - -static struct BurnRomInfo MSX_athlandpRomDesc[] = { - { "athletic land (japan) (beta).rom", 0x04000, 0xe4a428b5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_athlandp, MSX_athlandp, msx_msx) -STD_ROM_FN(MSX_athlandp) - -struct BurnDriver BurnDrvMSX_athlandp = { - "msx_athlandp", "msx_athland", "msx_msx", NULL, "1984", - "Athletic Land (Jpn, Prototype)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_athlandpRomInfo, MSX_athlandpRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// B.C.'s Quest (Jpn) - -static struct BurnRomInfo MSX_bcquestRomDesc[] = { - { "b.c.'s quest (japan).rom", 0x08000, 0x9c9420d0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bcquest, MSX_bcquest, msx_msx) -STD_ROM_FN(MSX_bcquest) - -struct BurnDriver BurnDrvMSX_bcquest = { - "msx_bcquest", NULL, "msx_msx", NULL, "1985", - "B.C.'s Quest for Tires (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bcquestRomInfo, MSX_bcquestRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// B.C.'s Quest (Jpn, Alt) - -static struct BurnRomInfo MSX_bcquestaRomDesc[] = { - { "b.c.'s quest (japan) (alt 1).rom", 0x08000, 0xe2400f55, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bcquesta, MSX_bcquesta, msx_msx) -STD_ROM_FN(MSX_bcquesta) - -struct BurnDriver BurnDrvMSX_bcquesta = { - "msx_bcquesta", "msx_bcquest", "msx_msx", NULL, "1985", - "B.C.'s Quest for Tires (Jpn, Alt)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bcquestaRomInfo, MSX_bcquestaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Back to the Future (Jpn) - -static struct BurnRomInfo MSX_backtofRomDesc[] = { - { "back to the future (japan).rom", 0x08000, 0xdbdb64ac, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_backtof, MSX_backtof, msx_msx) -STD_ROM_FN(MSX_backtof) - -struct BurnDriver BurnDrvMSX_backtof = { - "msx_backtof", NULL, "msx_msx", NULL, "1986", - "Back to the Future (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_backtofRomInfo, MSX_backtofRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Back to the Future (Jpn, Alt) - -static struct BurnRomInfo MSX_backtofaRomDesc[] = { - { "back to the future (japan) (alt 1).rom", 0x08000, 0x795c7aa1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_backtofa, MSX_backtofa, msx_msx) -STD_ROM_FN(MSX_backtofa) - -struct BurnDriver BurnDrvMSX_backtofa = { - "msx_backtofa", "msx_backtof", "msx_msx", NULL, "1986", - "Back to the Future (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_backtofaRomInfo, MSX_backtofaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Back Gammon (Jpn) - -static struct BurnRomInfo MSX_backgamjRomDesc[] = { - { "back gammon (japan).rom", 0x04000, 0xb632b6bb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_backgamj, MSX_backgamj, msx_msx) -STD_ROM_FN(MSX_backgamj) - -struct BurnDriver BurnDrvMSX_backgamj = { - "msx_backgamj", NULL, "msx_msx", NULL, "1984", - "Back Gammon (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_backgamjRomInfo, MSX_backgamjRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Back Gammon (Jpn, Alt) - -static struct BurnRomInfo MSX_backgamjaRomDesc[] = { - { "back gammon (japan) (alt 1).rom", 0x04000, 0x70c79a87, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_backgamja, MSX_backgamja, msx_msx) -STD_ROM_FN(MSX_backgamja) - -struct BurnDriver BurnDrvMSX_backgamja = { - "msx_backgamja", "msx_backgamj", "msx_msx", NULL, "1984", - "Back Gammon (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_backgamjaRomInfo, MSX_backgamjaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Balance (Jpn) - -static struct BurnRomInfo MSX_balanceRomDesc[] = { - { "balance (japan).rom", 0x02000, 0xcdabd75b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_balance, MSX_balance, msx_msx) -STD_ROM_FN(MSX_balance) - -struct BurnDriver BurnDrvMSX_balance = { - "msx_balance", NULL, "msx_msx", NULL, "1985", - "Balance (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_balanceRomInfo, MSX_balanceRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Balance (Jpn, Alt) - -static struct BurnRomInfo MSX_balance1RomDesc[] = { - { "balance (japan) (alt 1).rom", 0x02000, 0x336fdcd9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_balance1, MSX_balance1, msx_msx) -STD_ROM_FN(MSX_balance1) - -struct BurnDriver BurnDrvMSX_balance1 = { - "msx_balance1", "msx_balance", "msx_msx", NULL, "1985", - "Balance (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_balance1RomInfo, MSX_balance1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Balance (Jpn, Alt 2) - -static struct BurnRomInfo MSX_balance2RomDesc[] = { - { "balance (japan) (alt 2).rom", 0x04000, 0x86ea609d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_balance2, MSX_balance2, msx_msx) -STD_ROM_FN(MSX_balance2) - -struct BurnDriver BurnDrvMSX_balance2 = { - "msx_balance2", "msx_balance", "msx_msx", NULL, "1985", - "Balance (Jpn, Alt 2)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_balance2RomInfo, MSX_balance2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Banana (Jpn) - -static struct BurnRomInfo MSX_bananaRomDesc[] = { - { "banana (japan).rom", 0x04000, 0x6aa7cbe0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_banana, MSX_banana, msx_msx) -STD_ROM_FN(MSX_banana) - -struct BurnDriver BurnDrvMSX_banana = { - "msx_banana", NULL, "msx_msx", NULL, "19??", - "Banana (Jpn)\0", NULL, "Studio GEN", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bananaRomInfo, MSX_bananaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bank Panic (Jpn) - -static struct BurnRomInfo MSX_bankpRomDesc[] = { - { "bank panic (japan).rom", 0x08000, 0xd5e18df0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bankp, MSX_bankp, msx_msx) -STD_ROM_FN(MSX_bankp) - -struct BurnDriver BurnDrvMSX_bankp = { - "msx_bankp", NULL, "msx_msx", NULL, "1986", - "Bank Panic (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bankpRomInfo, MSX_bankpRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bank Panic (Jpn, Alt) - -static struct BurnRomInfo MSX_bankpaRomDesc[] = { - { "bank panic (japan) (alt 1).rom", 0x08000, 0xa0a844ca, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bankpa, MSX_bankpa, msx_msx) -STD_ROM_FN(MSX_bankpa) - -struct BurnDriver BurnDrvMSX_bankpa = { - "msx_bankpa", "msx_bankp", "msx_msx", NULL, "1986", - "Bank Panic (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bankpaRomInfo, MSX_bankpaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bank Panic (Kor) - -static struct BurnRomInfo MSX_bankpkRomDesc[] = { - { "bank panic (1985)(pony canyon)[cr prosoft].rom", 0x08000, 0x70160fe9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bankpk, MSX_bankpk, msx_msx) -STD_ROM_FN(MSX_bankpk) - -struct BurnDriver BurnDrvMSX_bankpk = { - "msx_bankpk", "msx_bankp", "msx_msx", NULL, "19??", - "Bank Panic (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bankpkRomInfo, MSX_bankpkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Batman (Jpn) - -static struct BurnRomInfo MSX_batmanRomDesc[] = { - { "batman (japan).rom", 0x10000, 0x637f0494, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_batman, MSX_batman, msx_msx) -STD_ROM_FN(MSX_batman) - -struct BurnDriver BurnDrvMSX_batman = { - "msx_batman", NULL, "msx_msx", NULL, "1987", - "Batman (Jpn)\0", NULL, "Pack-In-Video", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_batmanRomInfo, MSX_batmanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Batten Tanuki no Daibouken (Jpn, v1.03) - -static struct BurnRomInfo MSX_btanukiRomDesc[] = { - { "batten tanuki no daibouken (japan) (v1.03).rom", 0x08000, 0xeba0738d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_btanuki, MSX_btanuki, msx_msx) -STD_ROM_FN(MSX_btanuki) - -struct BurnDriver BurnDrvMSX_btanuki = { - "msx_btanuki", NULL, "msx_msx", NULL, "1986", - "Batten Tanuki no Daibouken (Jpn, v1.03)\0", NULL, "Tecno Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_btanukiRomInfo, MSX_btanukiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Batten Tanuki no Daibouken (Jpn) - -static struct BurnRomInfo MSX_btanukiaRomDesc[] = { - { "batten tanuki no daibouken (japan) (alt 1).rom", 0x08000, 0xe403ebea, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_btanukia, MSX_btanukia, msx_msx) -STD_ROM_FN(MSX_btanukia) - -struct BurnDriver BurnDrvMSX_btanukia = { - "msx_btanukia", "msx_btanuki", "msx_msx", NULL, "1986", - "Batten Tanuki no Daibouken (Jpn)\0", NULL, "Tecno Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_btanukiaRomInfo, MSX_btanukiaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Batten Tanuki no Daibouken (Jpn, Alt) - -static struct BurnRomInfo MSX_btanukibRomDesc[] = { - { "batten tanuki no daibouken (japan) (alt 2).rom", 0x08000, 0x42262bd4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_btanukib, MSX_btanukib, msx_msx) -STD_ROM_FN(MSX_btanukib) - -struct BurnDriver BurnDrvMSX_btanukib = { - "msx_btanukib", "msx_btanuki", "msx_msx", NULL, "1986", - "Batten Tanuki no Daibouken (Jpn, Alt)\0", NULL, "Tecno Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_btanukibRomInfo, MSX_btanukibRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Battle Cross (Jpn) - -static struct BurnRomInfo MSX_battlexRomDesc[] = { - { "battle cross (japan).rom", 0x04000, 0x25e675ea, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_battlex, MSX_battlex, msx_msx) -STD_ROM_FN(MSX_battlex) - -struct BurnDriver BurnDrvMSX_battlex = { - "msx_battlex", NULL, "msx_msx", NULL, "1984", - "Battle Cross (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_battlexRomInfo, MSX_battlexRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Battleship Clapton II (Jpn) - -static struct BurnRomInfo MSX_clapton2RomDesc[] = { - { "battleship clapton ii (japan).rom", 0x02000, 0x85f4767b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_clapton2, MSX_clapton2, msx_msx) -STD_ROM_FN(MSX_clapton2) - -struct BurnDriver BurnDrvMSX_clapton2 = { - "msx_clapton2", NULL, "msx_msx", NULL, "1984", - "Battleship Clapton II (Jpn)\0", NULL, "T&E Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_clapton2RomInfo, MSX_clapton2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Battleship Clapton II (Jpn, Alt) - -static struct BurnRomInfo MSX_clapton2aRomDesc[] = { - { "battleship clapton ii (japan) (alt 1).rom", 0x04000, 0x2de725a3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_clapton2a, MSX_clapton2a, msx_msx) -STD_ROM_FN(MSX_clapton2a) - -struct BurnDriver BurnDrvMSX_clapton2a = { - "msx_clapton2a", "msx_clapton2", "msx_msx", NULL, "1984", - "Battleship Clapton II (Jpn, Alt)\0", NULL, "T&E Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_clapton2aRomInfo, MSX_clapton2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Beach-Head (Euro) - -static struct BurnRomInfo MSX_beacheadRomDesc[] = { - { "beach-head (europe).rom", 0x08000, 0x785fa4cc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_beachead, MSX_beachead, msx_msx) -STD_ROM_FN(MSX_beachead) - -struct BurnDriver BurnDrvMSX_beachead = { - "msx_beachead", NULL, "msx_msx", NULL, "19??", - "Beach-Head (Euro)\0", NULL, "Access Software?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_beacheadRomInfo, MSX_beacheadRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Beam Rider (Jpn) - -static struct BurnRomInfo MSX_beamridrRomDesc[] = { - { "beam rider (japan) (alt 1).rom", 0x04000, 0xd6a6bee6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_beamridr, MSX_beamridr, msx_msx) -STD_ROM_FN(MSX_beamridr) - -struct BurnDriver BurnDrvMSX_beamridr = { - "msx_beamridr", NULL, "msx_msx", NULL, "1984", - "Beam Rider (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_beamridrRomInfo, MSX_beamridrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Becky (Jpn) - -static struct BurnRomInfo MSX_beckyRomDesc[] = { - { "becky (japan).rom", 0x04000, 0xa580b72a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_becky, MSX_becky, msx_msx) -STD_ROM_FN(MSX_becky) - -struct BurnDriver BurnDrvMSX_becky = { - "msx_becky", NULL, "msx_msx", NULL, "1983", - "Becky (Jpn)\0", NULL, "MIA", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_beckyRomInfo, MSX_beckyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Becky (Jpn, Alt) - -static struct BurnRomInfo MSX_beckyaRomDesc[] = { - { "becky (japan) (alt 1).rom", 0x04000, 0xd062ad02, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_beckya, MSX_beckya, msx_msx) -STD_ROM_FN(MSX_beckya) - -struct BurnDriver BurnDrvMSX_beckya = { - "msx_beckya", "msx_becky", "msx_msx", NULL, "1983", - "Becky (Jpn, Alt)\0", NULL, "MIA", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_beckyaRomInfo, MSX_beckyaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Becky (Jpn, Alt 2) - -static struct BurnRomInfo MSX_beckybRomDesc[] = { - { "becky (japan) (alt 2).rom", 0x04000, 0x14156258, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_beckyb, MSX_beckyb, msx_msx) -STD_ROM_FN(MSX_beckyb) - -struct BurnDriver BurnDrvMSX_beckyb = { - "msx_beckyb", "msx_becky", "msx_msx", NULL, "1983", - "Becky (Jpn, Alt 2)\0", NULL, "MIA", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_beckybRomInfo, MSX_beckybRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bee & Flower (Jpn) - -static struct BurnRomInfo MSX_beeflowrRomDesc[] = { - { "bee & flower (japan).rom", 0x04000, 0x0ad3707d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_beeflowr, MSX_beeflowr, msx_msx) -STD_ROM_FN(MSX_beeflowr) - -struct BurnDriver BurnDrvMSX_beeflowr = { - "msx_beeflowr", NULL, "msx_msx", NULL, "1983", - "Bee & Flower (Jpn)\0", NULL, "Reizon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_beeflowrRomInfo, MSX_beeflowrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bee & Flower (Jpn, Alt) - -static struct BurnRomInfo MSX_beeflowraRomDesc[] = { - { "bee & flower (japan) (alt 1).rom", 0x04000, 0x36fc4792, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_beeflowra, MSX_beeflowra, msx_msx) -STD_ROM_FN(MSX_beeflowra) - -struct BurnDriver BurnDrvMSX_beeflowra = { - "msx_beeflowra", "msx_beeflowr", "msx_msx", NULL, "1983", - "Bee & Flower (Jpn, Alt)\0", NULL, "Reizon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_beeflowraRomInfo, MSX_beeflowraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bee & Flower (Jpn, Alt 2) - -static struct BurnRomInfo MSX_beeflowrbRomDesc[] = { - { "bee & flower (japan) (alt 2).rom", 0x04000, 0xcf2335c7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_beeflowrb, MSX_beeflowrb, msx_msx) -STD_ROM_FN(MSX_beeflowrb) - -struct BurnDriver BurnDrvMSX_beeflowrb = { - "msx_beeflowrb", "msx_beeflowr", "msx_msx", NULL, "1983", - "Bee & Flower (Jpn, Alt 2)\0", NULL, "Reizon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_beeflowrbRomInfo, MSX_beeflowrbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Black Onyx (Jpn) - -static struct BurnRomInfo MSX_blckonyxRomDesc[] = { - { "black onyx, the (japan).rom", 0x08000, 0xe258c032, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_blckonyx, MSX_blckonyx, msx_msx) -STD_ROM_FN(MSX_blckonyx) - -struct BurnDriver BurnDrvMSX_blckonyx = { - "msx_blckonyx", NULL, "msx_msx", NULL, "1985", - "The Black Onyx (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_blckonyxRomInfo, MSX_blckonyxRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Blagger MSX (Jpn) - -static struct BurnRomInfo MSX_blaggerRomDesc[] = { - { "blagger.rom", 0x08000, 0x50475a7c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_blagger, MSX_blagger, msx_msx) -STD_ROM_FN(MSX_blagger) - -struct BurnDriver BurnDrvMSX_blagger = { - "msx_blagger", NULL, "msx_msx", NULL, "1984", - "Blagger MSX (Jpn)\0", NULL, "MicroCabin", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_blaggerRomInfo, MSX_blaggerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Blagger Enhanced - -static struct BurnRomInfo MSX_blaggerenhRomDesc[] = { - { "blaggere.rom", 0x04000, 0xbdbdf44a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_blaggerenh, MSX_blaggerenh, msx_msx) -STD_ROM_FN(MSX_blaggerenh) - -struct BurnDriver BurnDrvMSX_blaggerenh = { - "msx_blaggerenh", NULL, "msx_msx", NULL, "2013", - "Blagger Enhanced\0", NULL, "MicroCabin / JLTURSAN", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_blaggerenhRomInfo, MSX_blaggerenhRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Block Hole (Kor) - -static struct BurnRomInfo MSX_blockholRomDesc[] = { - { "block hole (korea) (unl).rom", 0x08000, 0x824ae486, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_blockhol, MSX_blockhol, msx_msx) -STD_ROM_FN(MSX_blockhol) - -struct BurnDriver BurnDrvMSX_blockhol = { - "msx_blockhol", NULL, "msx_msx", NULL, "1990", - "Block Hole (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_blockholRomInfo, MSX_blockholRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Blockade Runner (Jpn) - -static struct BurnRomInfo MSX_blockrunRomDesc[] = { - { "blockade runner (japan).rom", 0x04000, 0x8334b431, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_blockrun, MSX_blockrun, msx_msx) -STD_ROM_FN(MSX_blockrun) - -struct BurnDriver BurnDrvMSX_blockrun = { - "msx_blockrun", NULL, "msx_msx", NULL, "1985", - "Blockade Runner (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_blockrunRomInfo, MSX_blockrunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boggy '84 (Jpn) - -static struct BurnRomInfo MSX_boggy84RomDesc[] = { - { "boggy '84 (japan).rom", 0x02000, 0xec089246, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boggy84, MSX_boggy84, msx_msx) -STD_ROM_FN(MSX_boggy84) - -struct BurnDriver BurnDrvMSX_boggy84 = { - "msx_boggy84", NULL, "msx_msx", NULL, "1984", - "Boggy '84 (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boggy84RomInfo, MSX_boggy84RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boggy '84 (Jpn, Alt) - -static struct BurnRomInfo MSX_boggy84aRomDesc[] = { - { "boggy '84 (japan) (alt 1).rom", 0x04000, 0x22e8b312, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boggy84a, MSX_boggy84a, msx_msx) -STD_ROM_FN(MSX_boggy84a) - -struct BurnDriver BurnDrvMSX_boggy84a = { - "msx_boggy84a", "msx_boggy84", "msx_msx", NULL, "1984", - "Boggy '84 (Jpn, Alt)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boggy84aRomInfo, MSX_boggy84aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boggy '84 (Jpn, Alt 2) - -static struct BurnRomInfo MSX_boggy84bRomDesc[] = { - { "boggy '84 (japan) (alt 2).rom", 0x02000, 0xa4bf1253, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boggy84b, MSX_boggy84b, msx_msx) -STD_ROM_FN(MSX_boggy84b) - -struct BurnDriver BurnDrvMSX_boggy84b = { - "msx_boggy84b", "msx_boggy84", "msx_msx", NULL, "1984", - "Boggy '84 (Jpn, Alt 2)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boggy84bRomInfo, MSX_boggy84bRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boing Boing (Spa) - -static struct BurnRomInfo MSX_boing2RomDesc[] = { - { "boing boing (spain).rom", 0x02000, 0xf44e7fcd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boing2, MSX_boing2, msx_msx) -STD_ROM_FN(MSX_boing2) - -struct BurnDriver BurnDrvMSX_boing2 = { - "msx_boing2", NULL, "msx_msx", NULL, "1985", - "Boing Boing (Spa)\0", NULL, "Sony Spain", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boing2RomInfo, MSX_boing2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bokosuka Wars (Jpn) - -static struct BurnRomInfo MSX_bokosukaRomDesc[] = { - { "bokosuka wars (japan).rom", 0x04000, 0xdd6d9aad, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bokosuka, MSX_bokosuka, msx_msx) -STD_ROM_FN(MSX_bokosuka) - -struct BurnDriver BurnDrvMSX_bokosuka = { - "msx_bokosuka", NULL, "msx_msx", NULL, "1984", - "Bokosuka Wars (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bokosukaRomInfo, MSX_bokosukaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bokosuka Wars (Jpn, Alt) - -static struct BurnRomInfo MSX_bokosukaaRomDesc[] = { - { "bokosuka wars (japan) (alt 1).rom", 0x04000, 0x93b8917a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bokosukaa, MSX_bokosukaa, msx_msx) -STD_ROM_FN(MSX_bokosukaa) - -struct BurnDriver BurnDrvMSX_bokosukaa = { - "msx_bokosukaa", "msx_bokosuka", "msx_msx", NULL, "1984", - "Bokosuka Wars (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bokosukaaRomInfo, MSX_bokosukaaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bomber King (Jpn) - -static struct BurnRomInfo MSX_bombkingRomDesc[] = { - { "bomber king (japan).rom", 0x20000, 0x8cf0e6c0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bombking, MSX_bombking, msx_msx) -STD_ROM_FN(MSX_bombking) - -struct BurnDriver BurnDrvMSX_bombking = { - "msx_bombking", NULL, "msx_msx", NULL, "1988", - "Bomber King (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_bombkingRomInfo, MSX_bombkingRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bomber Man (Jpn) - -static struct BurnRomInfo MSX_bombmanRomDesc[] = { - { "bomber man (japan).rom", 0x02000, 0x9a5aef05, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bombman, MSX_bombman, msx_msx) -STD_ROM_FN(MSX_bombman) - -struct BurnDriver BurnDrvMSX_bombman = { - "msx_bombman", NULL, "msx_msx", NULL, "1983", - "Bomber Man (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bombmanRomInfo, MSX_bombmanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bomber Man (Kor) - -static struct BurnRomInfo MSX_bombmank1RomDesc[] = { - { "bomber man (1986)(korea soft bank).rom", 0x04000, 0x3df1f56f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bombmank1, MSX_bombmank1, msx_msx) -STD_ROM_FN(MSX_bombmank1) - -struct BurnDriver BurnDrvMSX_bombmank1 = { - "msx_bombmank1", "msx_bombman", "msx_msx", NULL, "1986", - "Bomber Man (Kor)\0", NULL, "Korea Soft Bank", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bombmank1RomInfo, MSX_bombmank1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bomber Man (Kor, Alt) - -static struct BurnRomInfo MSX_bombmank2RomDesc[] = { - { "bomber man (1986)(korea soft bank)[a].rom", 0x02000, 0xc9a2c37e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bombmank2, MSX_bombmank2, msx_msx) -STD_ROM_FN(MSX_bombmank2) - -struct BurnDriver BurnDrvMSX_bombmank2 = { - "msx_bombmank2", "msx_bombman", "msx_msx", NULL, "1986", - "Bomber Man (Kor, Alt)\0", NULL, "Korea Soft Bank", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bombmank2RomInfo, MSX_bombmank2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bomber Man Special (Jpn) - -static struct BurnRomInfo MSX_bombmnspRomDesc[] = { - { "bomber man special (japan).rom", 0x08000, 0x042ad44d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bombmnsp, MSX_bombmnsp, msx_msx) -STD_ROM_FN(MSX_bombmnsp) - -struct BurnDriver BurnDrvMSX_bombmnsp = { - "msx_bombmnsp", NULL, "msx_msx", NULL, "1986", - "Bomber Man Special (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bombmnspRomInfo, MSX_bombmnspRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boogie Woogi Jungle (Jpn) - -static struct BurnRomInfo MSX_boogieRomDesc[] = { - { "boogie woogi jungle (japan).rom", 0x04000, 0x90ccea11, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boogie, MSX_boogie, msx_msx) -STD_ROM_FN(MSX_boogie) - -struct BurnDriver BurnDrvMSX_boogie = { - "msx_boogie", NULL, "msx_msx", NULL, "1983", - "Boogie Woogi Jungle (Jpn)\0", NULL, "Ample Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boogieRomInfo, MSX_boogieRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boogie Woogi Jungle (Jpn, Alt) - -static struct BurnRomInfo MSX_boogie1RomDesc[] = { - { "boogie woogi jungle (japan) (alt 1).rom", 0x04000, 0x374b63c9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boogie1, MSX_boogie1, msx_msx) -STD_ROM_FN(MSX_boogie1) - -struct BurnDriver BurnDrvMSX_boogie1 = { - "msx_boogie1", "msx_boogie", "msx_msx", NULL, "1983", - "Boogie Woogi Jungle (Jpn, Alt)\0", NULL, "Ample Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boogie1RomInfo, MSX_boogie1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boogie Woogi Jungle (Jpn, Alt 2) - -static struct BurnRomInfo MSX_boogie2RomDesc[] = { - { "boogie woogi jungle (japan) (alt 2).rom", 0x04001, 0x464e7594, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boogie2, MSX_boogie2, msx_msx) -STD_ROM_FN(MSX_boogie2) - -struct BurnDriver BurnDrvMSX_boogie2 = { - "msx_boogie2", "msx_boogie", "msx_msx", NULL, "1983", - "Boogie Woogi Jungle (Jpn, Alt 2)\0", NULL, "Ample Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boogie2RomInfo, MSX_boogie2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boomerang (Jpn) - -static struct BurnRomInfo MSX_boomrangRomDesc[] = { - { "boomerang (japan).rom", 0x04000, 0x0a140b27, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boomrang, MSX_boomrang, msx_msx) -STD_ROM_FN(MSX_boomrang) - -struct BurnDriver BurnDrvMSX_boomrang = { - "msx_boomrang", NULL, "msx_msx", NULL, "1984", - "Boomerang (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boomrangRomInfo, MSX_boomrangRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boomerang (Jpn, Alt) - -static struct BurnRomInfo MSX_boomrangaRomDesc[] = { - { "boomerang (japan) (alt 1).rom", 0x04000, 0x5f1f9288, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boomranga, MSX_boomranga, msx_msx) -STD_ROM_FN(MSX_boomranga) - -struct BurnDriver BurnDrvMSX_boomranga = { - "msx_boomranga", "msx_boomrang", "msx_msx", NULL, "1984", - "Boomerang (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boomrangaRomInfo, MSX_boomrangaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Destroyer Bosconian (Jpn) - -static struct BurnRomInfo MSX_boscoRomDesc[] = { - { "bosconian (japan).rom", 0x08000, 0x02f1997a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bosco, MSX_bosco, msx_msx) -STD_ROM_FN(MSX_bosco) - -struct BurnDriver BurnDrvMSX_bosco = { - "msx_bosco", NULL, "msx_msx", NULL, "1984", - "Star Destroyer Bosconian (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boscoRomInfo, MSX_boscoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Destroyer Bosconian (Jpn, Alt) - -static struct BurnRomInfo MSX_boscoaRomDesc[] = { - { "bosconian (japan) (alt 1).rom", 0x08000, 0xaf3c5d48, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boscoa, MSX_boscoa, msx_msx) -STD_ROM_FN(MSX_boscoa) - -struct BurnDriver BurnDrvMSX_boscoa = { - "msx_boscoa", "msx_bosco", "msx_msx", NULL, "1984", - "Star Destroyer Bosconian (Jpn, Alt)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boscoaRomInfo, MSX_boscoaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Destroyer Bosconian (Jpn, Alt 2) - -static struct BurnRomInfo MSX_boscobRomDesc[] = { - { "bosconian (japan) (alt 2).rom", 0x08000, 0x626132ae, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_boscob, MSX_boscob, msx_msx) -STD_ROM_FN(MSX_boscob) - -struct BurnDriver BurnDrvMSX_boscob = { - "msx_boscob", "msx_bosco", "msx_msx", NULL, "1984", - "Star Destroyer Bosconian (Jpn, Alt 2)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boscobRomInfo, MSX_boscobRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bouken Roman - Dota (Jpn) - -static struct BurnRomInfo MSX_dotaRomDesc[] = { - { "bouken roman - dota (japan).rom", 0x08000, 0x57efca5a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dota, MSX_dota, msx_msx) -STD_ROM_FN(MSX_dota) - -struct BurnDriver BurnDrvMSX_dota = { - "msx_dota", NULL, "msx_msx", NULL, "1986", - "Bouken Roman - Dota (Jpn)\0", NULL, "System Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dotaRomInfo, MSX_dotaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bouken Roman - Dota (Jpn, Alt) - -static struct BurnRomInfo MSX_dotaaRomDesc[] = { - { "bouken roman - dota (japan) (alt 1).rom", 0x08000, 0xc5ca7dff, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dotaa, MSX_dotaa, msx_msx) -STD_ROM_FN(MSX_dotaa) - -struct BurnDriver BurnDrvMSX_dotaa = { - "msx_dotaa", "msx_dota", "msx_msx", NULL, "1986", - "Bouken Roman - Dota (Jpn, Alt)\0", NULL, "System Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dotaaRomInfo, MSX_dotaaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Boulder Dash (Jpn) - -static struct BurnRomInfo MSX_bdashRomDesc[] = { - { "boulder dash (japan).rom", 0x08000, 0xa3a56524, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bdash, MSX_bdash, msx_msx) -STD_ROM_FN(MSX_bdash) - -struct BurnDriver BurnDrvMSX_bdash = { - "msx_bdash", NULL, "msx_msx", NULL, "1985", - "Boulder Dash (Jpn)\0", NULL, "Comptiq", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bdashRomInfo, MSX_bdashRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Break In (Jpn) - -static struct BurnRomInfo MSX_breakinjRomDesc[] = { - { "break in (japan).rom", 0x10000, 0x8801b31e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_breakinj, MSX_breakinj, msx_msx) -STD_ROM_FN(MSX_breakinj) - -struct BurnDriver BurnDrvMSX_breakinj = { - "msx_breakinj", NULL, "msx_msx", NULL, "1987", - "Break In (Jpn)\0", NULL, "Jaleco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_breakinjRomInfo, MSX_breakinjRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Break Out (Jpn) - -static struct BurnRomInfo MSX_breakoutRomDesc[] = { - { "break out (japan).rom", 0x04000, 0x70113f76, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_breakout, MSX_breakout, msx_msx) -STD_ROM_FN(MSX_breakout) - -struct BurnDriver BurnDrvMSX_breakout = { - "msx_breakout", NULL, "msx_msx", NULL, "1983", - "Break Out (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_breakoutRomInfo, MSX_breakoutRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Brother Adventure - Hyeongje Moheom (Kor) - -static struct BurnRomInfo MSX_brosadvRomDesc[] = { - { "brother adventure (korea) (unl).rom", 0x08000, 0x3ca757d0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_brosadv, MSX_brosadv, msx_msx) -STD_ROM_FN(MSX_brosadv) - -struct BurnDriver BurnDrvMSX_brosadv = { - "msx_brosadv", NULL, "msx_msx", NULL, "1987", - "Brother Adventure - Hyeongje Moheom (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_brosadvRomInfo, MSX_brosadvRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Brother Adventure - Hyeongje Moheom (Kor, Alt) - -static struct BurnRomInfo MSX_brosadvaRomDesc[] = { - { "brother adventure (korea) (alt 1) (unl).rom", 0x08000, 0xfe0a902c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_brosadva, MSX_brosadva, msx_msx) -STD_ROM_FN(MSX_brosadva) - -struct BurnDriver BurnDrvMSX_brosadva = { - "msx_brosadva", "msx_brosadv", "msx_msx", NULL, "1987", - "Brother Adventure - Hyeongje Moheom (Kor, Alt)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_brosadvaRomInfo, MSX_brosadvaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bruce Lee (Jpn) - -static struct BurnRomInfo MSX_bruceleeRomDesc[] = { - { "bruce lee (japan).rom", 0x08000, 0xa20b196d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_brucelee, MSX_brucelee, msx_msx) -STD_ROM_FN(MSX_brucelee) - -struct BurnDriver BurnDrvMSX_brucelee = { - "msx_brucelee", NULL, "msx_msx", NULL, "1985", - "Bruce Lee (Jpn)\0", NULL, "Comptiq", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bruceleeRomInfo, MSX_bruceleeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Burgertime (Jpn) - -static struct BurnRomInfo MSX_btimeRomDesc[] = { - { "burgertime (japan).rom", 0x08000, 0xe4a7c230, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_btime, MSX_btime, msx_msx) -STD_ROM_FN(MSX_btime) - -struct BurnDriver BurnDrvMSX_btime = { - "msx_btime", NULL, "msx_msx", NULL, "1986", - "Burgertime (Jpn)\0", NULL, "Dempa", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_btimeRomInfo, MSX_btimeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bull to Mighty Kiki Ippatsu (Jpn) - -static struct BurnRomInfo MSX_bullmigtRomDesc[] = { - { "buru to marty kikiippatsu - inspecteur z (japan).rom", 0x08000, 0x9cf39bd6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bullmigt, MSX_bullmigt, msx_msx) -STD_ROM_FN(MSX_bullmigt) - -struct BurnDriver BurnDrvMSX_bullmigt = { - "msx_bullmigt", NULL, "msx_msx", NULL, "1986", - "Bull to Mighty Kiki Ippatsu (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bullmigtRomInfo, MSX_bullmigtRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Butamaru Pants. Pig Mock (Jpn) - -static struct BurnRomInfo MSX_butampanRomDesc[] = { - { "butam pants (japan).rom", 0x02000, 0x4b2aa972, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_butampan, MSX_butampan, msx_msx) -STD_ROM_FN(MSX_butampan) - -struct BurnDriver BurnDrvMSX_butampan = { - "msx_butampan", NULL, "msx_msx", NULL, "1983", - "Butamaru Pants. Pig Mock (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_butampanRomInfo, MSX_butampanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Butam Pants (Jpn, Alt) - -static struct BurnRomInfo MSX_butampanaRomDesc[] = { - { "butam pants (japan) (alt 1).rom", 0x04000, 0x4474ca21, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_butampana, MSX_butampana, msx_msx) -STD_ROM_FN(MSX_butampana) - -struct BurnDriver BurnDrvMSX_butampana = { - "msx_butampana", "msx_butampan", "msx_msx", NULL, "1983", - "Butam Pants (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_butampanaRomInfo, MSX_butampanaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Butam Pants (Jpn, Alt 2) - -static struct BurnRomInfo MSX_butampanbRomDesc[] = { - { "butam pants (japan) (alt 2).rom", 0x04000, 0xa102f82d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_butampanb, MSX_butampanb, msx_msx) -STD_ROM_FN(MSX_butampanb) - -struct BurnDriver BurnDrvMSX_butampanb = { - "msx_butampanb", "msx_butampan", "msx_msx", NULL, "1983", - "Butam Pants (Jpn, Alt 2)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_butampanbRomInfo, MSX_butampanbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// C_So! (Jpn) - -static struct BurnRomInfo MSX_csoRomDesc[] = { - { "c-so! (japan).rom", 0x04000, 0xdf8bfc89, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cso, MSX_cso, msx_msx) -STD_ROM_FN(MSX_cso) - -struct BurnDriver BurnDrvMSX_cso = { - "msx_cso", NULL, "msx_msx", NULL, "1985", - "C_So! (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_csoRomInfo, MSX_csoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// C_So! (Kor) - -static struct BurnRomInfo MSX_csokRomDesc[] = { - { "c-so.rom", 0x08000, 0x4f195441, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_csok, MSX_csok, msx_msx) -STD_ROM_FN(MSX_csok) - -struct BurnDriver BurnDrvMSX_csok = { - "msx_csok", "msx_cso", "msx_msx", NULL, "198?", - "C_So! (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_csokRomInfo, MSX_csokRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cannon Turbo (Jpn) - -static struct BurnRomInfo MSX_cannontRomDesc[] = { - { "cannon_turbo_(1987)_(brother).rom", 0x08000, 0x1ff280e3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cannont, MSX_cannont, msx_msx) -STD_ROM_FN(MSX_cannont) - -struct BurnDriver BurnDrvMSX_cannont = { - "msx_cannont", NULL, "msx_msx", NULL, "198?", - "Cannon Turbo (Jpn)\0", NULL, "Brother Kougyou", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cannontRomInfo, MSX_cannontRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cabbage Patch Kids (Jpn) - -static struct BurnRomInfo MSX_cabbagepRomDesc[] = { - { "cabbage patch kids (japan) (alt 1).rom", 0x04000, 0x97a1b4b9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cabbagep, MSX_cabbagep, msx_msx) -STD_ROM_FN(MSX_cabbagep) - -struct BurnDriver BurnDrvMSX_cabbagep = { - "msx_cabbagep", NULL, "msx_msx", NULL, "1984", - "Cabbage Patch Kids (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cabbagepRomInfo, MSX_cabbagepRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cabbage Patch Kids (Jpn, Older?) - -static struct BurnRomInfo MSX_cabbagepaRomDesc[] = { - { "cabbage patch kids (japan).rom", 0x04000, 0x057d2790, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cabbagepa, MSX_cabbagepa, msx_msx) -STD_ROM_FN(MSX_cabbagepa) - -struct BurnDriver BurnDrvMSX_cabbagepa = { - "msx_cabbagepa", "msx_cabbagep", "msx_msx", NULL, "1983", - "Cabbage Patch Kids (Jpn, Older?)\0", NULL, "Konami?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cabbagepaRomInfo, MSX_cabbagepaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cabbage Patch Kids (Kor) - -static struct BurnRomInfo MSX_cabbagepkRomDesc[] = { - { "cpkids.rom", 0x08000, 0x2ab67576, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cabbagepk, MSX_cabbagepk, msx_msx) -STD_ROM_FN(MSX_cabbagepk) - -struct BurnDriver BurnDrvMSX_cabbagepk = { - "msx_cabbagepk", "msx_cabbagep", "msx_msx", NULL, "198?", - "Cabbage Patch Kids (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cabbagepkRomInfo, MSX_cabbagepkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Candoo Ninja (Jpn) - -static struct BurnRomInfo MSX_candoonRomDesc[] = { - { "candoo ninja (japan).rom", 0x04000, 0xb6ab6786, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_candoon, MSX_candoon, msx_msx) -STD_ROM_FN(MSX_candoon) - -struct BurnDriver BurnDrvMSX_candoon = { - "msx_candoon", NULL, "msx_msx", NULL, "1984", - "Candoo Ninja (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_candoonRomInfo, MSX_candoonRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Candoo Ninja (Jpn, Alt) - -static struct BurnRomInfo MSX_candoonaRomDesc[] = { - { "candoo ninja (japan) (alt 1).rom", 0x04000, 0x037ba8b7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_candoona, MSX_candoona, msx_msx) -STD_ROM_FN(MSX_candoona) - -struct BurnDriver BurnDrvMSX_candoona = { - "msx_candoona", "msx_candoon", "msx_msx", NULL, "1984", - "Candoo Ninja (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_candoonaRomInfo, MSX_candoonaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cannon Ball (Jpn) - -static struct BurnRomInfo MSX_cannonblRomDesc[] = { - { "cannon ball (japan).rom", 0x02000, 0xa667ad8a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cannonbl, MSX_cannonbl, msx_msx) -STD_ROM_FN(MSX_cannonbl) - -struct BurnDriver BurnDrvMSX_cannonbl = { - "msx_cannonbl", NULL, "msx_msx", NULL, "1983", - "Cannon Ball (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cannonblRomInfo, MSX_cannonblRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cannon Ball (Jpn, Alt) - -static struct BurnRomInfo MSX_cannonblaRomDesc[] = { - { "cannon ball (japan) (alt 1).rom", 0x04000, 0xb64390e7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cannonbla, MSX_cannonbla, msx_msx) -STD_ROM_FN(MSX_cannonbla) - -struct BurnDriver BurnDrvMSX_cannonbla = { - "msx_cannonbla", "msx_cannonbl", "msx_msx", NULL, "1983", - "Cannon Ball (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cannonblaRomInfo, MSX_cannonblaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Captain Chef (Jpn) - -static struct BurnRomInfo MSX_captchefRomDesc[] = { - { "captain chef (japan).rom", 0x02000, 0x8e985857, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_captchef, MSX_captchef, msx_msx) -STD_ROM_FN(MSX_captchef) - -struct BurnDriver BurnDrvMSX_captchef = { - "msx_captchef", NULL, "msx_msx", NULL, "1984", - "Captain Chef (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_captchefRomInfo, MSX_captchefRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Car Fighter (Jpn) - -static struct BurnRomInfo MSX_carfightRomDesc[] = { - { "car fighter (japan).rom", 0x04000, 0x303187f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_carfight, MSX_carfight, msx_msx) -STD_ROM_FN(MSX_carfight) - -struct BurnDriver BurnDrvMSX_carfight = { - "msx_carfight", NULL, "msx_msx", NULL, "1985", - "Car Fighter (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_carfightRomInfo, MSX_carfightRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Car Jamboree (Jpn) - -static struct BurnRomInfo MSX_carjambRomDesc[] = { - { "car jamboree (japan).rom", 0x04000, 0x94fc9169, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_carjamb, MSX_carjamb, msx_msx) -STD_ROM_FN(MSX_carjamb) - -struct BurnDriver BurnDrvMSX_carjamb = { - "msx_carjamb", NULL, "msx_msx", NULL, "1984", - "Car Jamboree (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_carjambRomInfo, MSX_carjambRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Car Jamboree (Jpn, Alt) - -static struct BurnRomInfo MSX_carjambaRomDesc[] = { - { "car jamboree (japan) (alt 1).rom", 0x08000, 0xa24195fa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_carjamba, MSX_carjamba, msx_msx) -STD_ROM_FN(MSX_carjamba) - -struct BurnDriver BurnDrvMSX_carjamba = { - "msx_carjamba", "msx_carjamb", "msx_msx", NULL, "1984", - "Car Jamboree (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_carjambaRomInfo, MSX_carjambaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Car-Race (Jpn) - -static struct BurnRomInfo MSX_carraceRomDesc[] = { - { "car-race (japan).rom", 0x02000, 0x3f0db564, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_carrace, MSX_carrace, msx_msx) -STD_ROM_FN(MSX_carrace) - -struct BurnDriver BurnDrvMSX_carrace = { - "msx_carrace", NULL, "msx_msx", NULL, "1983", - "Car-Race (Jpn)\0", NULL, "Ample Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_carraceRomInfo, MSX_carraceRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Car-Race (Jpn, Alt) - -static struct BurnRomInfo MSX_carraceaRomDesc[] = { - { "car-race (japan) (alt 1).rom", 0x04000, 0x9538d829, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_carracea, MSX_carracea, msx_msx) -STD_ROM_FN(MSX_carracea) - -struct BurnDriver BurnDrvMSX_carracea = { - "msx_carracea", "msx_carrace", "msx_msx", NULL, "1983", - "Car-Race (Jpn, Alt)\0", NULL, "Ample Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_carraceaRomInfo, MSX_carraceaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Car-Race (Jpn, Alt 2) - -static struct BurnRomInfo MSX_carracebRomDesc[] = { - { "car-race (japan) (alt 2).rom", 0x04001, 0x51445292, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_carraceb, MSX_carraceb, msx_msx) -STD_ROM_FN(MSX_carraceb) - -struct BurnDriver BurnDrvMSX_carraceb = { - "msx_carraceb", "msx_carrace", "msx_msx", NULL, "1983", - "Car-Race (Jpn, Alt 2)\0", NULL, "Ample Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_carracebRomInfo, MSX_carracebRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Casio Worldopen (Jpn) - -static struct BurnRomInfo MSX_wrldopenRomDesc[] = { - { "casio worldopen (japan).rom", 0x08000, 0x338491f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wrldopen, MSX_wrldopen, msx_msx) -STD_ROM_FN(MSX_wrldopen) - -struct BurnDriver BurnDrvMSX_wrldopen = { - "msx_wrldopen", NULL, "msx_msx", NULL, "1985", - "Casio Worldopen (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_wrldopenRomInfo, MSX_wrldopenRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Casio Worldopen (Kor) - -static struct BurnRomInfo MSX_wrldopenkRomDesc[] = { - { "casio world open (1985)(casio)[cr boram soft].rom", 0x08000, 0x3508626f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wrldopenk, MSX_wrldopenk, msx_msx) -STD_ROM_FN(MSX_wrldopenk) - -struct BurnDriver BurnDrvMSX_wrldopenk = { - "msx_wrldopenk", "msx_wrldopen", "msx_msx", NULL, "1986", - "Casio Worldopen (Kor)\0", NULL, "Boram Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_wrldopenkRomInfo, MSX_wrldopenkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Castle (Jpn) - -static struct BurnRomInfo MSX_castleRomDesc[] = { - { "castle, the (japan).rom", 0x08000, 0x2149c32d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_castle, MSX_castle, msx_msx) -STD_ROM_FN(MSX_castle) - -struct BurnDriver BurnDrvMSX_castle = { - "msx_castle", NULL, "msx_msx", NULL, "1985", - "The Castle (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_castleRomInfo, MSX_castleRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Castle (Kor) - -static struct BurnRomInfo MSX_castlekRomDesc[] = { - { "castle, the (1986)(ascii)[cr static soft].rom", 0x08000, 0x48eccfaf, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_castlek, MSX_castlek, msx_msx) -STD_ROM_FN(MSX_castlek) - -struct BurnDriver BurnDrvMSX_castlek = { - "msx_castlek", "msx_castle", "msx_msx", NULL, "1987", - "The Castle (Kor)\0", NULL, "Static Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_castlekRomInfo, MSX_castlekRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Castle Excellent (Jpn) - -static struct BurnRomInfo MSX_castlexRomDesc[] = { - { "castle excellent (japan).rom", 0x08000, 0x90f38029, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_castlex, MSX_castlex, msx_msx) -STD_ROM_FN(MSX_castlex) - -struct BurnDriver BurnDrvMSX_castlex = { - "msx_castlex", NULL, "msx_msx", NULL, "1986", - "Castle Excellent (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_castlexRomInfo, MSX_castlexRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Castle Excellent (Jpn, Alt) - -static struct BurnRomInfo MSX_castlexaRomDesc[] = { - { "castle excellent (japan) (alt 1).rom", 0x08000, 0x3794a648, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_castlexa, MSX_castlexa, msx_msx) -STD_ROM_FN(MSX_castlexa) - -struct BurnDriver BurnDrvMSX_castlexa = { - "msx_castlexa", "msx_castlex", "msx_msx", NULL, "1986", - "Castle Excellent (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_castlexaRomInfo, MSX_castlexaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Chack'n Pop (Jpn) - -static struct BurnRomInfo MSX_chacknRomDesc[] = { - { "chack'n pop (japan).rom", 0x04000, 0x04f7e0b1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chackn, MSX_chackn, msx_msx) -STD_ROM_FN(MSX_chackn) - -struct BurnDriver BurnDrvMSX_chackn = { - "msx_chackn", NULL, "msx_msx", NULL, "1984", - "Chack'n Pop (Jpn)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chacknRomInfo, MSX_chacknRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Chack'n Pop (Jpn, Alt) - -static struct BurnRomInfo MSX_chacknaRomDesc[] = { - { "chack'n pop (japan) (alt 1).rom", 0x04000, 0x0fff4d26, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chackna, MSX_chackna, msx_msx) -STD_ROM_FN(MSX_chackna) - -struct BurnDriver BurnDrvMSX_chackna = { - "msx_chackna", "msx_chackn", "msx_msx", NULL, "1984", - "Chack'n Pop (Jpn, Alt)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chacknaRomInfo, MSX_chacknaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Champion Boxing (Jpn) - -static struct BurnRomInfo MSX_champboxRomDesc[] = { - { "champion boxing (japan).rom", 0x08000, 0xc4b7a5b9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_champbox, MSX_champbox, msx_msx) -STD_ROM_FN(MSX_champbox) - -struct BurnDriver BurnDrvMSX_champbox = { - "msx_champbox", NULL, "msx_msx", NULL, "1985", - "Champion Boxing (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_champboxRomInfo, MSX_champboxRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Champion Ice Hockey (Jpn) - -static struct BurnRomInfo MSX_champiceRomDesc[] = { - { "champion ice hockey (japan).rom", 0x08000, 0xbf4b018f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_champice, MSX_champice, msx_msx) -STD_ROM_FN(MSX_champice) - -struct BurnDriver BurnDrvMSX_champice = { - "msx_champice", NULL, "msx_msx", NULL, "1986", - "Champion Ice Hockey (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_champiceRomInfo, MSX_champiceRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Champion Kendou (Jpn) - -static struct BurnRomInfo MSX_champkenRomDesc[] = { - { "champion kendou (japan).rom", 0x08000, 0x0103c767, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_champken, MSX_champken, msx_msx) -STD_ROM_FN(MSX_champken) - -struct BurnDriver BurnDrvMSX_champken = { - "msx_champken", NULL, "msx_msx", NULL, "1986", - "Champion Kendou (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_champkenRomInfo, MSX_champkenRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Champion Kendou (Jpn, Alt) - -static struct BurnRomInfo MSX_champkenaRomDesc[] = { - { "champion kendou (japan) (alt 1).rom", 0x08000, 0x6f05e6bf, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_champkena, MSX_champkena, msx_msx) -STD_ROM_FN(MSX_champkena) - -struct BurnDriver BurnDrvMSX_champkena = { - "msx_champkena", "msx_champken", "msx_msx", NULL, "1986", - "Champion Kendou (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_champkenaRomInfo, MSX_champkenaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Champion Pro Wrestling (Jpn) - -static struct BurnRomInfo MSX_champpwrRomDesc[] = { - { "champion pro wrestling (japan).rom", 0x08000, 0x6686c84e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_champpwr, MSX_champpwr, msx_msx) -STD_ROM_FN(MSX_champpwr) - -struct BurnDriver BurnDrvMSX_champpwr = { - "msx_champpwr", NULL, "msx_msx", NULL, "1985", - "Champion Pro Wrestling (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_champpwrRomInfo, MSX_champpwrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Champion Pro Wrestling (Jpn, Alt) - -static struct BurnRomInfo MSX_champpwraRomDesc[] = { - { "champion pro wrestling (japan) (alt 1).rom", 0x08000, 0x8d658f41, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_champpwra, MSX_champpwra, msx_msx) -STD_ROM_FN(MSX_champpwra) - -struct BurnDriver BurnDrvMSX_champpwra = { - "msx_champpwra", "msx_champpwr", "msx_msx", NULL, "1985", - "Champion Pro Wrestling (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_champpwraRomInfo, MSX_champpwraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Champion Pro Wrestling (Jpn, Alt 2) - -static struct BurnRomInfo MSX_champpwrbRomDesc[] = { - { "champion pro wrestling (japan) (alt 2).rom", 0x08000, 0xd4b0accd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_champpwrb, MSX_champpwrb, msx_msx) -STD_ROM_FN(MSX_champpwrb) - -struct BurnDriver BurnDrvMSX_champpwrb = { - "msx_champpwrb", "msx_champpwr", "msx_msx", NULL, "1985", - "Champion Pro Wrestling (Jpn, Alt 2)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_champpwrbRomInfo, MSX_champpwrbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Champion Soccer (Jpn) - -static struct BurnRomInfo MSX_champscrRomDesc[] = { - { "champion soccer (japan).rom", 0x04000, 0x67ab6f8f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_champscr, MSX_champscr, msx_msx) -STD_ROM_FN(MSX_champscr) - -struct BurnDriver BurnDrvMSX_champscr = { - "msx_champscr", NULL, "msx_msx", NULL, "1985", - "Champion Soccer (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_champscrRomInfo, MSX_champscrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Championship Lode Runner (Jpn) - -static struct BurnRomInfo MSX_cloderunRomDesc[] = { - { "championship lode runner (japan).rom", 0x08000, 0x2f75e79c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cloderun, MSX_cloderun, msx_msx) -STD_ROM_FN(MSX_cloderun) - -struct BurnDriver BurnDrvMSX_cloderun = { - "msx_cloderun", NULL, "msx_msx", NULL, "1985", - "Championship Lode Runner (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cloderunRomInfo, MSX_cloderunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Checkers in Tan Tan Tanuki (Jpn) - -static struct BurnRomInfo MSX_tantanRomDesc[] = { - { "checkers in tantan tanuki (japan).rom", 0x04000, 0xd2b8c058, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tantan, MSX_tantan, msx_msx) -STD_ROM_FN(MSX_tantan) - -struct BurnDriver BurnDrvMSX_tantan = { - "msx_tantan", NULL, "msx_msx", NULL, "1985", - "Checkers in Tan Tan Tanuki (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tantanRomInfo, MSX_tantanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Chess (Jpn) - -static struct BurnRomInfo MSX_chessRomDesc[] = { - { "chess (japan).rom", 0x04000, 0x11eed1c7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chess, MSX_chess, msx_msx) -STD_ROM_FN(MSX_chess) - -struct BurnDriver BurnDrvMSX_chess = { - "msx_chess", NULL, "msx_msx", NULL, "1984", - "Chess (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chessRomInfo, MSX_chessRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Choplifter (Jpn) - -static struct BurnRomInfo MSX_chopliftRomDesc[] = { - { "choplifter (japan).rom", 0x08000, 0x1f5eafc8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_choplift, MSX_choplift, msx_msx) -STD_ROM_FN(MSX_choplift) - -struct BurnDriver BurnDrvMSX_choplift = { - "msx_choplift", NULL, "msx_msx", NULL, "1985", - "Choplifter (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chopliftRomInfo, MSX_chopliftRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Choplifter (Jpn, Alt) - -static struct BurnRomInfo MSX_chopliftaRomDesc[] = { - { "choplifter (japan) (alt 1).rom", 0x08000, 0xc6f30d45, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_choplifta, MSX_choplifta, msx_msx) -STD_ROM_FN(MSX_choplifta) - -struct BurnDriver BurnDrvMSX_choplifta = { - "msx_choplifta", "msx_choplift", "msx_msx", NULL, "1985", - "Choplifter (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chopliftaRomInfo, MSX_chopliftaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Choplifter (Jpn, Alt 2) - -static struct BurnRomInfo MSX_chopliftbRomDesc[] = { - { "choplifter (japan) (alt 2).rom", 0x08000, 0x155768b0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chopliftb, MSX_chopliftb, msx_msx) -STD_ROM_FN(MSX_chopliftb) - -struct BurnDriver BurnDrvMSX_chopliftb = { - "msx_chopliftb", "msx_choplift", "msx_msx", NULL, "1985", - "Choplifter (Jpn, Alt 2)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chopliftbRomInfo, MSX_chopliftbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Choro Q (Jpn) - -static struct BurnRomInfo MSX_choroqRomDesc[] = { - { "choro q (japan).rom", 0x04000, 0x5506bf9b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_choroq, MSX_choroq, msx_msx) -STD_ROM_FN(MSX_choroq) - -struct BurnDriver BurnDrvMSX_choroq = { - "msx_choroq", NULL, "msx_msx", NULL, "1984", - "Choro Q (Jpn)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_choroqRomInfo, MSX_choroqRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Choro Q (Jpn, Alt) - -static struct BurnRomInfo MSX_choroqaRomDesc[] = { - { "choro q (japan) (alt 1).rom", 0x04000, 0x65b34072, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_choroqa, MSX_choroqa, msx_msx) -STD_ROM_FN(MSX_choroqa) - -struct BurnDriver BurnDrvMSX_choroqa = { - "msx_choroqa", "msx_choroq", "msx_msx", NULL, "1984", - "Choro Q (Jpn, Alt)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_choroqaRomInfo, MSX_choroqaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Choro Q (Kor) - -static struct BurnRomInfo MSX_choroqkRomDesc[] = { - { "choro q (1984)(taito)[cr prosoft].rom", 0x08000, 0xba580eb7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_choroqk, MSX_choroqk, msx_msx) -STD_ROM_FN(MSX_choroqk) - -struct BurnDriver BurnDrvMSX_choroqk = { - "msx_choroqk", "msx_choroq", "msx_msx", NULL, "19??", - "Choro Q (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_choroqkRomInfo, MSX_choroqkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Chuugaku Hisshuu Eibunpou 1 (Jpn) - -static struct BurnRomInfo MSX_chuheib1RomDesc[] = { - { "chugaku hisshu eibunpo 1 (japan).rom", 0x08000, 0x097e4a7e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chuheib1, MSX_chuheib1, msx_msx) -STD_ROM_FN(MSX_chuheib1) - -struct BurnDriver BurnDrvMSX_chuheib1 = { - "msx_chuheib1", NULL, "msx_msx", NULL, "1984", - "Chuugaku Hisshuu Eibunpou 1 (Jpn)\0", NULL, "Stratford Computer Center", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chuheib1RomInfo, MSX_chuheib1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Circus Charlie (Jpn) - -static struct BurnRomInfo MSX_circuscRomDesc[] = { - { "circus charlie (japan).rom", 0x04000, 0x83b8d8f3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_circusc, MSX_circusc, msx_msx) -STD_ROM_FN(MSX_circusc) - -struct BurnDriver BurnDrvMSX_circusc = { - "msx_circusc", NULL, "msx_msx", NULL, "1984", - "Circus Charlie (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_circuscRomInfo, MSX_circuscRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// City Connection (Jpn) - -static struct BurnRomInfo MSX_cityconRomDesc[] = { - { "city connection (japan).rom", 0x08000, 0x6031a583, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_citycon, MSX_citycon, msx_msx) -STD_ROM_FN(MSX_citycon) - -struct BurnDriver BurnDrvMSX_citycon = { - "msx_citycon", NULL, "msx_msx", NULL, "1986", - "City Connection (Jpn)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cityconRomInfo, MSX_cityconRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// City Connection (Jpn, Alt) - -static struct BurnRomInfo MSX_cityconaRomDesc[] = { - { "city connection (japan) (alt 1).rom", 0x08000, 0x625c3689, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_citycona, MSX_citycona, msx_msx) -STD_ROM_FN(MSX_citycona) - -struct BurnDriver BurnDrvMSX_citycona = { - "msx_citycona", "msx_citycon", "msx_msx", NULL, "1986", - "City Connection (Jpn, Alt)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cityconaRomInfo, MSX_cityconaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Coaster Race (Jpn) - -static struct BurnRomInfo MSX_coastracRomDesc[] = { - { "coaster race (japan).rom", 0x08000, 0x399fd445, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_coastrac, MSX_coastrac, msx_msx) -STD_ROM_FN(MSX_coastrac) - -struct BurnDriver BurnDrvMSX_coastrac = { - "msx_coastrac", NULL, "msx_msx", NULL, "1986", - "Coaster Race (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_coastracRomInfo, MSX_coastracRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Coaster Race (Jpn, Alt) - -static struct BurnRomInfo MSX_coastracaRomDesc[] = { - { "coaster race (japan) (alt 1).rom", 0x08000, 0xa48acff7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_coastraca, MSX_coastraca, msx_msx) -STD_ROM_FN(MSX_coastraca) - -struct BurnDriver BurnDrvMSX_coastraca = { - "msx_coastraca", "msx_coastrac", "msx_msx", NULL, "1986", - "Coaster Race (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_coastracaRomInfo, MSX_coastracaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Coaster Race (Jpn, Alt 2) - -static struct BurnRomInfo MSX_coastracbRomDesc[] = { - { "coaster race (japan) (alt 2).rom", 0x08000, 0x00d996ff, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_coastracb, MSX_coastracb, msx_msx) -STD_ROM_FN(MSX_coastracb) - -struct BurnDriver BurnDrvMSX_coastracb = { - "msx_coastracb", "msx_coastrac", "msx_msx", NULL, "1986", - "Coaster Race (Jpn, Alt 2)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_coastracbRomInfo, MSX_coastracbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Color Ball (Jpn) - -static struct BurnRomInfo MSX_colballRomDesc[] = { - { "color ball (japan).rom", 0x02000, 0x12552a1f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_colball, MSX_colball, msx_msx) -STD_ROM_FN(MSX_colball) - -struct BurnDriver BurnDrvMSX_colball = { - "msx_colball", NULL, "msx_msx", NULL, "1984", - "Color Ball (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_colballRomInfo, MSX_colballRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Color Ball (Jpn, Alt) - -static struct BurnRomInfo MSX_colballaRomDesc[] = { - { "color ball (japan) (alt 1).rom", 0x04000, 0x73f1e939, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_colballa, MSX_colballa, msx_msx) -STD_ROM_FN(MSX_colballa) - -struct BurnDriver BurnDrvMSX_colballa = { - "msx_colballa", "msx_colball", "msx_msx", NULL, "1984", - "Color Ball (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_colballaRomInfo, MSX_colballaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Color Ball (Jpn, Alt 2) - -static struct BurnRomInfo MSX_colballbRomDesc[] = { - { "color ball (japan) (alt 2).rom", 0x04000, 0xf4f6e561, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_colballb, MSX_colballb, msx_msx) -STD_ROM_FN(MSX_colballb) - -struct BurnDriver BurnDrvMSX_colballb = { - "msx_colballb", "msx_colball", "msx_msx", NULL, "1984", - "Color Ball (Jpn, Alt 2)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_colballbRomInfo, MSX_colballbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Come On! Picot (Jpn) - -static struct BurnRomInfo MSX_picotRomDesc[] = { - { "come on! picot (japan).rom", 0x08000, 0x98b1cc99, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_picot, MSX_picot, msx_msx) -STD_ROM_FN(MSX_picot) - -struct BurnDriver BurnDrvMSX_picot = { - "msx_picot", NULL, "msx_msx", NULL, "1986", - "Come On! Picot (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_picotRomInfo, MSX_picotRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Comet Tail (Jpn) - -static struct BurnRomInfo MSX_cometailRomDesc[] = { - { "comet tail (japan).rom", 0x04000, 0x74af0726, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cometail, MSX_cometail, msx_msx) -STD_ROM_FN(MSX_cometail) - -struct BurnDriver BurnDrvMSX_cometail = { - "msx_cometail", NULL, "msx_msx", NULL, "1983", - "Comet Tail (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cometailRomInfo, MSX_cometailRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Comic Bakery (Jpn) - -static struct BurnRomInfo MSX_comicbakRomDesc[] = { - { "comic bakery (japan).rom", 0x04000, 0xa4097e41, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_comicbak, MSX_comicbak, msx_msx) -STD_ROM_FN(MSX_comicbak) - -struct BurnDriver BurnDrvMSX_comicbak = { - "msx_comicbak", NULL, "msx_msx", NULL, "1984", - "Comic Bakery (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_comicbakRomInfo, MSX_comicbakRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Comic Bakery (Jpn, Alt) - -static struct BurnRomInfo MSX_comicbakaRomDesc[] = { - { "comic bakery (japan) (alt 1).rom", 0x04000, 0x9a70d9c9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_comicbaka, MSX_comicbaka, msx_msx) -STD_ROM_FN(MSX_comicbaka) - -struct BurnDriver BurnDrvMSX_comicbaka = { - "msx_comicbaka", "msx_comicbak", "msx_msx", NULL, "1984", - "Comic Bakery (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_comicbakaRomInfo, MSX_comicbakaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Comic Bakery (Jpn, Alt 2) - -static struct BurnRomInfo MSX_comicbakbRomDesc[] = { - { "comic bakery (japan) (alt 2).rom", 0x04000, 0x03dae53c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_comicbakb, MSX_comicbakb, msx_msx) -STD_ROM_FN(MSX_comicbakb) - -struct BurnDriver BurnDrvMSX_comicbakb = { - "msx_comicbakb", "msx_comicbak", "msx_msx", NULL, "1984", - "Comic Bakery (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_comicbakbRomInfo, MSX_comicbakbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Computer Billiards (Jpn) - -static struct BurnRomInfo MSX_cbilliarRomDesc[] = { - { "computer billiards (japan).rom", 0x02000, 0x9098682d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cbilliar, MSX_cbilliar, msx_msx) -STD_ROM_FN(MSX_cbilliar) - -struct BurnDriver BurnDrvMSX_cbilliar = { - "msx_cbilliar", NULL, "msx_msx", NULL, "1983", - "Computer Billiards (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cbilliarRomInfo, MSX_cbilliarRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Computer Nyuumon (Jpn) - -static struct BurnRomInfo MSX_cnyumonRomDesc[] = { - { "computer nyuumon - computer lessons (japan).rom", 0x08000, 0x50bb1930, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cnyumon, MSX_cnyumon, msx_msx) -STD_ROM_FN(MSX_cnyumon) - -struct BurnDriver BurnDrvMSX_cnyumon = { - "msx_cnyumon", NULL, "msx_msx", NULL, "1985", - "Computer Nyuumon (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cnyumonRomInfo, MSX_cnyumonRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Computer Pachinko (Jpn) - -static struct BurnRomInfo MSX_cpachiRomDesc[] = { - { "computer pachinko (japan).rom", 0x04000, 0x1bd2c6b3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cpachi, MSX_cpachi, msx_msx) -STD_ROM_FN(MSX_cpachi) - -struct BurnDriver BurnDrvMSX_cpachi = { - "msx_cpachi", NULL, "msx_msx", NULL, "1984", - "Computer Pachinko (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cpachiRomInfo, MSX_cpachiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Con-Dori (Jpn) - -static struct BurnRomInfo MSX_condoriRomDesc[] = { - { "con-dori (japan).rom", 0x02000, 0xd9006ebe, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_condori, MSX_condori, msx_msx) -STD_ROM_FN(MSX_condori) - -struct BurnDriver BurnDrvMSX_condori = { - "msx_condori", NULL, "msx_msx", NULL, "1983", - "Con-Dori (Jpn)\0", NULL, "Cross Talk", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_condoriRomInfo, MSX_condoriRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Con-Dori (Jpn, Alt) - -static struct BurnRomInfo MSX_condoriaRomDesc[] = { - { "con-dori (japan) (alt 1).rom", 0x04000, 0xce71bb57, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_condoria, MSX_condoria, msx_msx) -STD_ROM_FN(MSX_condoria) - -struct BurnDriver BurnDrvMSX_condoria = { - "msx_condoria", "msx_condori", "msx_msx", NULL, "1983", - "Con-Dori (Jpn, Alt)\0", NULL, "Cross Talk", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_condoriaRomInfo, MSX_condoriaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Con-Dori (Jpn, Alt 2) - -static struct BurnRomInfo MSX_condoribRomDesc[] = { - { "con-dori (japan) (alt 2).rom", 0x04000, 0x69405f96, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_condorib, MSX_condorib, msx_msx) -STD_ROM_FN(MSX_condorib) - -struct BurnDriver BurnDrvMSX_condorib = { - "msx_condorib", "msx_condori", "msx_msx", NULL, "1983", - "Con-Dori (Jpn, Alt 2)\0", NULL, "Cross Talk", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_condoribRomInfo, MSX_condoribRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Confused? (Euro) - -static struct BurnRomInfo MSX_confusedRomDesc[] = { - { "confused (europe).rom", 0x0c000, 0x63084e71, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_confused, MSX_confused, msx_msx) -STD_ROM_FN(MSX_confused) - -struct BurnDriver BurnDrvMSX_confused = { - "msx_confused", NULL, "msx_msx", NULL, "198?", - "Confused? (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_confusedRomInfo, MSX_confusedRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cosmo (Jpn) - -static struct BurnRomInfo MSX_cosmoRomDesc[] = { - { "cosmo (japan).rom", 0x04000, 0x5780acfd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cosmo, MSX_cosmo, msx_msx) -STD_ROM_FN(MSX_cosmo) - -struct BurnDriver BurnDrvMSX_cosmo = { - "msx_cosmo", NULL, "msx_msx", NULL, "1984", - "Cosmo (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cosmoRomInfo, MSX_cosmoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cosmo (Jpn, Alt) - -static struct BurnRomInfo MSX_cosmoaRomDesc[] = { - { "cosmo (japan) (alt 1).rom", 0x04000, 0xff3c8091, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cosmoa, MSX_cosmoa, msx_msx) -STD_ROM_FN(MSX_cosmoa) - -struct BurnDriver BurnDrvMSX_cosmoa = { - "msx_cosmoa", "msx_cosmo", "msx_msx", NULL, "1984", - "Cosmo (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cosmoaRomInfo, MSX_cosmoaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cosmo-Explorer (Jpn) - -static struct BurnRomInfo MSX_cosmoexpRomDesc[] = { - { "cosmo-explorer (japan).rom", 0x08000, 0x3f534824, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cosmoexp, MSX_cosmoexp, msx_msx) -STD_ROM_FN(MSX_cosmoexp) - -struct BurnDriver BurnDrvMSX_cosmoexp = { - "msx_cosmoexp", NULL, "msx_msx", NULL, "1985", - "Cosmo-Explorer (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cosmoexpRomInfo, MSX_cosmoexpRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cosmo-Explorer (Jpn, Alt) - -static struct BurnRomInfo MSX_cosmoexpaRomDesc[] = { - { "cosmo-explorer (japan) (alt 1).rom", 0x08000, 0xd21f6b76, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cosmoexpa, MSX_cosmoexpa, msx_msx) -STD_ROM_FN(MSX_cosmoexpa) - -struct BurnDriver BurnDrvMSX_cosmoexpa = { - "msx_cosmoexpa", "msx_cosmoexp", "msx_msx", NULL, "1985", - "Cosmo-Explorer (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cosmoexpaRomInfo, MSX_cosmoexpaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Craze (Jpn) - -static struct BurnRomInfo MSX_crazeRomDesc[] = { - { "craze (japan).rom", 0x20000, 0xd83966d0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_craze, MSX_craze, msx_msx) -STD_ROM_FN(MSX_craze) - -struct BurnDriver BurnDrvMSX_craze = { - "msx_craze", NULL, "msx_msx", NULL, "1988", - "Craze (Jpn)\0", NULL, "Heart Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_crazeRomInfo, MSX_crazeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Crazy Bullet (Jpn) - -static struct BurnRomInfo MSX_crazybulRomDesc[] = { - { "crazy bullet (japan).rom", 0x04000, 0xd0e8f418, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crazybul, MSX_crazybul, msx_msx) -STD_ROM_FN(MSX_crazybul) - -struct BurnDriver BurnDrvMSX_crazybul = { - "msx_crazybul", NULL, "msx_msx", NULL, "1983", - "Crazy Bullet (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_crazybulRomInfo, MSX_crazybulRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Crazy Cars (Euro) - -static struct BurnRomInfo MSX_crazycarRomDesc[] = { - { "crazy cars (europe).rom", 0x08000, 0xde18372d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crazycar, MSX_crazycar, msx_msx) -STD_ROM_FN(MSX_crazycar) - -struct BurnDriver BurnDrvMSX_crazycar = { - "msx_crazycar", NULL, "msx_msx", NULL, "1988", - "Crazy Cars (Euro)\0", NULL, "Titus", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_crazycarRomInfo, MSX_crazycarRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Crazy Train (Jpn) - -static struct BurnRomInfo MSX_crazytrnRomDesc[] = { - { "crazy train (japan).rom", 0x02000, 0x39e6ff25, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crazytrn, MSX_crazytrn, msx_msx) -STD_ROM_FN(MSX_crazytrn) - -struct BurnDriver BurnDrvMSX_crazytrn = { - "msx_crazytrn", NULL, "msx_msx", NULL, "1983", - "Crazy Train (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_crazytrnRomInfo, MSX_crazytrnRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Crazy Train (Jpn, Alt) - -static struct BurnRomInfo MSX_crazytrnaRomDesc[] = { - { "crazy train (japan) (alt 1).rom", 0x02000, 0xb8764cd3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crazytrna, MSX_crazytrna, msx_msx) -STD_ROM_FN(MSX_crazytrna) - -struct BurnDriver BurnDrvMSX_crazytrna = { - "msx_crazytrna", "msx_crazytrn", "msx_msx", NULL, "1983", - "Crazy Train (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_crazytrnaRomInfo, MSX_crazytrnaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cross Blaim (Jpn) - -static struct BurnRomInfo MSX_crossblmRomDesc[] = { - { "cross blaim (japan).rom", 0x10000, 0x47273220, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crossblm, MSX_crossblm, msx_msx) -STD_ROM_FN(MSX_crossblm) - -struct BurnDriver BurnDrvMSX_crossblm = { - "msx_crossblm", NULL, "msx_msx", NULL, "1986", - "Cross Blaim (Jpn)\0", NULL, "dB-Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_CROSS_BLAIM, GBF_MISC, 0, - MSXGetZipName, MSX_crossblmRomInfo, MSX_crossblmRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Crusader (Jpn) - -static struct BurnRomInfo MSX_crusaderRomDesc[] = { - { "crusader (japan).rom", 0x08000, 0x0b69dd50, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crusader, MSX_crusader, msx_msx) -STD_ROM_FN(MSX_crusader) - -struct BurnDriver BurnDrvMSX_crusader = { - "msx_crusader", NULL, "msx_msx", NULL, "1985", - "Crusader (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_crusaderRomInfo, MSX_crusaderRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Crusader (Jpn, Alt) - -static struct BurnRomInfo MSX_crusaderaRomDesc[] = { - { "crusader (japan) (alt 1).rom", 0x08000, 0xe167fede, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crusadera, MSX_crusadera, msx_msx) -STD_ROM_FN(MSX_crusadera) - -struct BurnDriver BurnDrvMSX_crusadera = { - "msx_crusadera", "msx_crusader", "msx_msx", NULL, "1985", - "Crusader (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_crusaderaRomInfo, MSX_crusaderaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Crusader (Jpn, Alt 2) - -static struct BurnRomInfo MSX_crusaderbRomDesc[] = { - { "crusader (japan) (alt 2).rom", 0x08000, 0x40afef74, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crusaderb, MSX_crusaderb, msx_msx) -STD_ROM_FN(MSX_crusaderb) - -struct BurnDriver BurnDrvMSX_crusaderb = { - "msx_crusaderb", "msx_crusader", "msx_msx", NULL, "1985", - "Crusader (Jpn, Alt 2)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_crusaderbRomInfo, MSX_crusaderbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Crusader (Kor) - -static struct BurnRomInfo MSX_crusaderkRomDesc[] = { - { "crusader.rom", 0x08000, 0x73f3c7e2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crusaderk, MSX_crusaderk, msx_msx) -STD_ROM_FN(MSX_crusaderk) - -struct BurnDriver BurnDrvMSX_crusaderk = { - "msx_crusaderk", "msx_crusader", "msx_msx", NULL, "198?", - "Crusader (Kor)\0", NULL, "Clover", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_crusaderkRomInfo, MSX_crusaderkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Cyborg Z (Kor) - -static struct BurnRomInfo MSX_cyborgzRomDesc[] = { - { "cyborg z (zemina, 1991).rom", 0x20000, 0x77efe84a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cyborgz, MSX_cyborgz, msx_msx) -STD_ROM_FN(MSX_cyborgz) - -struct BurnDriver BurnDrvMSX_cyborgz = { - "msx_cyborgz", NULL, "msx_msx", NULL, "1991", - "Cyborg Z (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_cyborgzRomInfo, MSX_cyborgzRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// D-Day (Jpn) - -static struct BurnRomInfo MSX_ddayRomDesc[] = { - { "d-day (japan).rom", 0x04000, 0x5d284ea6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dday, MSX_dday, msx_msx) -STD_ROM_FN(MSX_dday) - -struct BurnDriver BurnDrvMSX_dday = { - "msx_dday", NULL, "msx_msx", NULL, "1984", - "D-Day (Jpn)\0", NULL, "Toshiba", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ddayRomInfo, MSX_ddayRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// D-Day (Jpn, Alt) - -static struct BurnRomInfo MSX_ddayaRomDesc[] = { - { "d-day (japan) (alt 1).rom", 0x04000, 0x6641c97a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ddaya, MSX_ddaya, msx_msx) -STD_ROM_FN(MSX_ddaya) - -struct BurnDriver BurnDrvMSX_ddaya = { - "msx_ddaya", "msx_dday", "msx_msx", NULL, "1984", - "D-Day (Jpn, Alt)\0", NULL, "Toshiba", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ddayaRomInfo, MSX_ddayaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// D-Day (Jpn, Alt 2) - -static struct BurnRomInfo MSX_ddaybRomDesc[] = { - { "d-day (japan) (alt 2).rom", 0x04000, 0xa7f0dd41, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ddayb, MSX_ddayb, msx_msx) -STD_ROM_FN(MSX_ddayb) - -struct BurnDriver BurnDrvMSX_ddayb = { - "msx_ddayb", "msx_dday", "msx_msx", NULL, "1984", - "D-Day (Jpn, Alt 2)\0", NULL, "Toshiba", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ddaybRomInfo, MSX_ddaybRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// D-Day (Jpn, Alt 3) - -static struct BurnRomInfo MSX_ddaycRomDesc[] = { - { "d-day (japan) (alt 3).rom", 0x04000, 0xa89b0f57, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ddayc, MSX_ddayc, msx_msx) -STD_ROM_FN(MSX_ddayc) - -struct BurnDriver BurnDrvMSX_ddayc = { - "msx_ddayc", "msx_dday", "msx_msx", NULL, "1984", - "D-Day (Jpn, Alt 3)\0", NULL, "Toshiba", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ddaycRomInfo, MSX_ddaycRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// D-Day (Kor) - -static struct BurnRomInfo MSX_ddaykRomDesc[] = { - { "d-day.rom", 0x04000, 0x8a79ee57, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ddayk, MSX_ddayk, msx_msx) -STD_ROM_FN(MSX_ddayk) - -struct BurnDriver BurnDrvMSX_ddayk = { - "msx_ddayk", "msx_dday", "msx_msx", NULL, "198?", - "D-Day (Kor)\0", NULL, "San Ho", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ddaykRomInfo, MSX_ddaykRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dai Shougai Keiba (Jpn) - -static struct BurnRomInfo MSX_dskeibaRomDesc[] = { - { "casio daishogai keiba (japan).rom", 0x04000, 0x5312db08, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dskeiba, MSX_dskeiba, msx_msx) -STD_ROM_FN(MSX_dskeiba) - -struct BurnDriver BurnDrvMSX_dskeiba = { - "msx_dskeiba", NULL, "msx_msx", NULL, "1984", - "Dai Shougai Keiba (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dskeibaRomInfo, MSX_dskeibaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dai Dassou (Jpn) - -static struct BurnRomInfo MSX_daidassoRomDesc[] = { - { "daidasso (japan).rom", 0x08000, 0xfc17c9bc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_daidasso, MSX_daidasso, msx_msx) -STD_ROM_FN(MSX_daidasso) - -struct BurnDriver BurnDrvMSX_daidasso = { - "msx_daidasso", NULL, "msx_msx", NULL, "1985", - "Dai Dassou (Jpn)\0", NULL, "Carry Lab", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_daidassoRomInfo, MSX_daidassoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Dam Busters (Euro?) - -static struct BurnRomInfo MSX_dambustrRomDesc[] = { - { "dam busters, the (japan) (alt 1).rom", 0x08000, 0x711a7a6e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dambustr, MSX_dambustr, msx_msx) -STD_ROM_FN(MSX_dambustr) - -struct BurnDriver BurnDrvMSX_dambustr = { - "msx_dambustr", NULL, "msx_msx", NULL, "1985", - "The Dam Busters (Euro?)\0", NULL, "Comptiq", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dambustrRomInfo, MSX_dambustrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Dam Busters (Jpn) - -static struct BurnRomInfo MSX_dambustraRomDesc[] = { - { "dam busters, the (japan).rom", 0x08000, 0x6fde5bca, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dambustra, MSX_dambustra, msx_msx) -STD_ROM_FN(MSX_dambustra) - -struct BurnDriver BurnDrvMSX_dambustra = { - "msx_dambustra", "msx_dambustr", "msx_msx", NULL, "1985", - "The Dam Busters (Jpn)\0", NULL, "Comptiq", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dambustraRomInfo, MSX_dambustraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Danger X4 (Jpn) - -static struct BurnRomInfo MSX_dangerx4RomDesc[] = { - { "danger x4 (japan).rom", 0x04000, 0x571f12fb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dangerx4, MSX_dangerx4, msx_msx) -STD_ROM_FN(MSX_dangerx4) - -struct BurnDriver BurnDrvMSX_dangerx4 = { - "msx_dangerx4", NULL, "msx_msx", NULL, "1984", - "Danger X4 (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dangerx4RomInfo, MSX_dangerx4RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Danger X4 (Jpn, Alt) - -static struct BurnRomInfo MSX_dangerx4aRomDesc[] = { - { "danger x4 (japan) (alt 1).rom", 0x04000, 0x3cf16a16, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dangerx4a, MSX_dangerx4a, msx_msx) -STD_ROM_FN(MSX_dangerx4a) - -struct BurnDriver BurnDrvMSX_dangerx4a = { - "msx_dangerx4a", "msx_dangerx4", "msx_msx", NULL, "1984", - "Danger X4 (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dangerx4aRomInfo, MSX_dangerx4aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Danger X4 (Jpn, Alt 2) - -static struct BurnRomInfo MSX_dangerx4bRomDesc[] = { - { "danger x4 (japan) (alt 2).rom", 0x04000, 0x22f5e82a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dangerx4b, MSX_dangerx4b, msx_msx) -STD_ROM_FN(MSX_dangerx4b) - -struct BurnDriver BurnDrvMSX_dangerx4b = { - "msx_dangerx4b", "msx_dangerx4", "msx_msx", NULL, "1984", - "Danger X4 (Jpn, Alt 2)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_dangerx4bRomInfo, MSX_dangerx4bRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dawn Patrol (Jpn) - -static struct BurnRomInfo MSX_dawnpatrRomDesc[] = { - { "dawn patrol (japan).rom", 0x10000, 0x1fc65e80, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dawnpatr, MSX_dawnpatr, msx_msx) -STD_ROM_FN(MSX_dawnpatr) - -struct BurnDriver BurnDrvMSX_dawnpatr = { - "msx_dawnpatr", NULL, "msx_msx", NULL, "1986", - "Dawn Patrol (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dawnpatrRomInfo, MSX_dawnpatrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Decathlon (Jpn) - -static struct BurnRomInfo MSX_decathlnRomDesc[] = { - { "decathlon (japan).rom", 0x04000, 0xf99b1c22, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_decathln, MSX_decathln, msx_msx) -STD_ROM_FN(MSX_decathln) - -struct BurnDriver BurnDrvMSX_decathln = { - "msx_decathln", NULL, "msx_msx", NULL, "1984", - "Decathlon (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_decathlnRomInfo, MSX_decathlnRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Deep Dungeon (Jpn) - -static struct BurnRomInfo MSX_deepdngRomDesc[] = { - { "deep dungeon (japan).rom", 0x20000, 0x27fd8f9a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_deepdng, MSX_deepdng, msx_msx) -STD_ROM_FN(MSX_deepdng) - -struct BurnDriver BurnDrvMSX_deepdng = { - "msx_deepdng", NULL, "msx_msx", NULL, "1988", - "Deep Dungeon (Jpn)\0", NULL, "ScapTrust", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_deepdngRomInfo, MSX_deepdngRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Deep Dungeon II - Yuushi no Monshou (Jpn) - -static struct BurnRomInfo MSX_deepdng2RomDesc[] = { - { "deep dungeon ii (japan).rom", 0x20000, 0x101db19c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_deepdng2, MSX_deepdng2, msx_msx) -STD_ROM_FN(MSX_deepdng2) - -struct BurnDriver BurnDrvMSX_deepdng2 = { - "msx_deepdng2", NULL, "msx_msx", NULL, "1988", - "Deep Dungeon II - Yuushi no Monshou (Jpn)\0", NULL, "ScapTrust", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_deepdng2RomInfo, MSX_deepdng2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Demon Crystal (Jpn) - -static struct BurnRomInfo MSX_dcrystalRomDesc[] = { - { "demon crystal, the (japan).rom", 0x08000, 0x11de4dfd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dcrystal, MSX_dcrystal, msx_msx) -STD_ROM_FN(MSX_dcrystal) - -struct BurnDriver BurnDrvMSX_dcrystal = { - "msx_dcrystal", NULL, "msx_msx", NULL, "1986", - "The Demon Crystal (Jpn)\0", NULL, "Dempa", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dcrystalRomInfo, MSX_dcrystalRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// D.H. - Devil's Heaven (Jpn) - -static struct BurnRomInfo MSX_devilhvnRomDesc[] = { - { "devil's heaven (japan).rom", 0x04000, 0xce08f27d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_devilhvn, MSX_devilhvn, msx_msx) -STD_ROM_FN(MSX_devilhvn) - -struct BurnDriver BurnDrvMSX_devilhvn = { - "msx_devilhvn", NULL, "msx_msx", NULL, "1984", - "D.H. - Devil's Heaven (Jpn)\0", NULL, "General", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_devilhvnRomInfo, MSX_devilhvnRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dig Dug (Jpn) - -static struct BurnRomInfo MSX_digdugRomDesc[] = { - { "dig dug (japan).rom", 0x08000, 0x3c749758, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_digdug, MSX_digdug, msx_msx) -STD_ROM_FN(MSX_digdug) - -struct BurnDriver BurnDrvMSX_digdug = { - "msx_digdug", NULL, "msx_msx", NULL, "1984", - "Dig Dug (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_digdugRomInfo, MSX_digdugRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dig Dug (Jpn, Alt) - -static struct BurnRomInfo MSX_digdugaRomDesc[] = { - { "dig dug (japan) (alt 1).rom", 0x08000, 0x7c3d7dea, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_digduga, MSX_digduga, msx_msx) -STD_ROM_FN(MSX_digduga) - -struct BurnDriver BurnDrvMSX_digduga = { - "msx_digduga", "msx_digdug", "msx_msx", NULL, "1984", - "Dig Dug (Jpn, Alt)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_digdugaRomInfo, MSX_digdugaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Digital Devil Monogatari - Megami Tensei (Jpn, Alt) - -static struct BurnRomInfo MSX_megamitaRomDesc[] = { - { "digital devil monogatari megami tensei (japan) (alt 1).rom", 0x20000, 0x367d385e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_megamita, MSX_megamita, msx_msx) -STD_ROM_FN(MSX_megamita) - -struct BurnDriver BurnDrvMSX_megamita = { - "msx_megamita", "msx_megamit", "msx_msx", NULL, "1987", - "Digital Devil Monogatari - Megami Tensei (Jpn, Alt)\0", NULL, "Nihon Telenet", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_megamitaRomInfo, MSX_megamitaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Doki Doki Penguin Land (Jpn) - -static struct BurnRomInfo MSX_dokidokiRomDesc[] = { - { "doki doki penguin land (japan).rom", 0x08000, 0x652d0e39, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dokidoki, MSX_dokidoki, msx_msx) -STD_ROM_FN(MSX_dokidoki) - -struct BurnDriver BurnDrvMSX_dokidoki = { - "msx_dokidoki", NULL, "msx_msx", NULL, "1985", - "Doki Doki Penguin Land (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dokidokiRomInfo, MSX_dokidokiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Doki Doki Penguin Land (Jpn, Alt) - -static struct BurnRomInfo MSX_dokidokiaRomDesc[] = { - { "doki doki penguin land (japan) (alt 1).rom", 0x08000, 0xde4af7f6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dokidokia, MSX_dokidokia, msx_msx) -STD_ROM_FN(MSX_dokidokia) - -struct BurnDriver BurnDrvMSX_dokidokia = { - "msx_dokidokia", "msx_dokidoki", "msx_msx", NULL, "1985", - "Doki Doki Penguin Land (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dokidokiaRomInfo, MSX_dokidokiaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Doordoor (Jpn) - -static struct BurnRomInfo MSX_doordoorRomDesc[] = { - { "doordoor (japan).rom", 0x04000, 0xf8ad9717, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_doordoor, MSX_doordoor, msx_msx) -STD_ROM_FN(MSX_doordoor) - -struct BurnDriver BurnDrvMSX_doordoor = { - "msx_doordoor", NULL, "msx_msx", NULL, "1985", - "Doordoor (Jpn)\0", NULL, "Enix", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_doordoorRomInfo, MSX_doordoorRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dorodon (Jpn) - -static struct BurnRomInfo MSX_dorodonRomDesc[] = { - { "dorodon (japan).rom", 0x04000, 0x5aa63a76, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dorodon, MSX_dorodon, msx_msx) -STD_ROM_FN(MSX_dorodon) - -struct BurnDriver BurnDrvMSX_dorodon = { - "msx_dorodon", NULL, "msx_msx", NULL, "1984", - "Dorodon (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dorodonRomInfo, MSX_dorodonRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Double Dragon (Kor) - -static struct BurnRomInfo MSX_ddragonRomDesc[] = { - { "double dragon (korea) (unl).rom", 0x08000, 0xc70e3a34, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ddragon, MSX_ddragon, msx_msx) -STD_ROM_FN(MSX_ddragon) - -struct BurnDriver BurnDrvMSX_ddragon = { - "msx_ddragon", NULL, "msx_msx", NULL, "1989", - "Double Dragon (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ddragonRomInfo, MSX_ddragonRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dragon Attack (Jpn) - -static struct BurnRomInfo MSX_drgnatckRomDesc[] = { - { "dragon attack (japan).rom", 0x02000, 0xa0ff8771, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_drgnatck, MSX_drgnatck, msx_msx) -STD_ROM_FN(MSX_drgnatck) - -struct BurnDriver BurnDrvMSX_drgnatck = { - "msx_drgnatck", NULL, "msx_msx", NULL, "1983", - "Dragon Attack (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_drgnatckRomInfo, MSX_drgnatckRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dragon Attack (Jpn, Alt) - -static struct BurnRomInfo MSX_drgnatckaRomDesc[] = { - { "dragon attack (japan) (alt 1).rom", 0x04000, 0x981facd3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_drgnatcka, MSX_drgnatcka, msx_msx) -STD_ROM_FN(MSX_drgnatcka) - -struct BurnDriver BurnDrvMSX_drgnatcka = { - "msx_drgnatcka", "msx_drgnatck", "msx_msx", NULL, "1983", - "Dragon Attack (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_drgnatckaRomInfo, MSX_drgnatckaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dragon Quest II (Jpn, Alt) - -static struct BurnRomInfo MSX_dquest2aRomDesc[] = { - { "dragon quest ii (japan) (alt 1).rom", 0x40000, 0xd44165a3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dquest2a, MSX_dquest2a, msx_msx) -STD_ROM_FN(MSX_dquest2a) - -struct BurnDriver BurnDrvMSX_dquest2a = { - "msx_dquest2a", "msx_dquest", "msx_msx", NULL, "1987", - "Dragon Quest II (Jpn, Alt)\0", NULL, "Enix", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_dquest2aRomInfo, MSX_dquest2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dragon Slayer (Jpn) - -static struct BurnRomInfo MSX_dslayerRomDesc[] = { - { "dragon slayer (japan).rom", 0x08000, 0x6a515349, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dslayer, MSX_dslayer, msx_msx) -STD_ROM_FN(MSX_dslayer) - -struct BurnDriver BurnDrvMSX_dslayer = { - "msx_dslayer", NULL, "msx_msx", NULL, "1985", - "Dragon Slayer (Jpn)\0", NULL, "Square", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dslayerRomInfo, MSX_dslayerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Drainer (Jpn) - -static struct BurnRomInfo MSX_drainerRomDesc[] = { - { "drainer (japan).rom", 0x08000, 0xdb803e8a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_drainer, MSX_drainer, msx_msx) -STD_ROM_FN(MSX_drainer) - -struct BurnDriver BurnDrvMSX_drainer = { - "msx_drainer", NULL, "msx_msx", NULL, "1987", - "Drainer (Jpn)\0", NULL, "Victor", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_drainerRomInfo, MSX_drainerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dunk Shot (Jpn) - -static struct BurnRomInfo MSX_dunkshotRomDesc[] = { - { "dunk shot (japan).rom", 0x08000, 0x6c366b32, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dunkshot, MSX_dunkshot, msx_msx) -STD_ROM_FN(MSX_dunkshot) - -struct BurnDriver BurnDrvMSX_dunkshot = { - "msx_dunkshot", NULL, "msx_msx", NULL, "1986", - "Dunk Shot (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dunkshotRomInfo, MSX_dunkshotRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dunk Shot (Jpn, Alt) - -static struct BurnRomInfo MSX_dunkshotaRomDesc[] = { - { "dunk shot (japan) (alt 1).rom", 0x08000, 0x99b7eab1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dunkshota, MSX_dunkshota, msx_msx) -STD_ROM_FN(MSX_dunkshota) - -struct BurnDriver BurnDrvMSX_dunkshota = { - "msx_dunkshota", "msx_dunkshot", "msx_msx", NULL, "1986", - "Dunk Shot (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dunkshotaRomInfo, MSX_dunkshotaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Dynamite Bowl (Jpn) - -static struct BurnRomInfo MSX_dynabowlRomDesc[] = { - { "dynamite bowl (japan).rom", 0x20000, 0x47ec57da, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dynabowl, MSX_dynabowl, msx_msx) -STD_ROM_FN(MSX_dynabowl) - -struct BurnDriver BurnDrvMSX_dynabowl = { - "msx_dynabowl", NULL, "msx_msx", NULL, "1988", - "Dynamite Bowl (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_dynabowlRomInfo, MSX_dynabowlRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// E.I. - Exa Innova (Jpn) - -static struct BurnRomInfo MSX_exainnovRomDesc[] = { - { "exa innova (japan).rom", 0x04000, 0x4ff88059, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exainnov, MSX_exainnov, msx_msx) -STD_ROM_FN(MSX_exainnov) - -struct BurnDriver BurnDrvMSX_exainnov = { - "msx_exainnov", NULL, "msx_msx", NULL, "1983", - "E.I. - Exa Innova (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exainnovRomInfo, MSX_exainnovRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// E.I. - Exa Innova (Jpn, Alt) - -static struct BurnRomInfo MSX_exainnov1RomDesc[] = { - { "exa innova (japan) (alt 1).rom", 0x04000, 0xd5b51149, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exainnov1, MSX_exainnov1, msx_msx) -STD_ROM_FN(MSX_exainnov1) - -struct BurnDriver BurnDrvMSX_exainnov1 = { - "msx_exainnov1", "msx_exainnov", "msx_msx", NULL, "1983", - "E.I. - Exa Innova (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exainnov1RomInfo, MSX_exainnov1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Eagles 5 (Kor) - -static struct BurnRomInfo MSX_eagle5RomDesc[] = { - { "eagles 5 (zemina, 1990).rom", 0x08000, 0xb9df4c42, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_eagle5, MSX_eagle5, msx_msx) -STD_ROM_FN(MSX_eagle5) - -struct BurnDriver BurnDrvMSX_eagle5 = { - "msx_eagle5", NULL, "msx_msx", NULL, "1990", - "Eagles 5 (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_eagle5RomInfo, MSX_eagle5RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Eagle Fighter (Jpn) - -static struct BurnRomInfo MSX_eaglefgtRomDesc[] = { - { "eagle fighter (japan).rom", 0x08000, 0x5c808e73, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_eaglefgt, MSX_eaglefgt, msx_msx) -STD_ROM_FN(MSX_eaglefgt) - -struct BurnDriver BurnDrvMSX_eaglefgt = { - "msx_eaglefgt", NULL, "msx_msx", NULL, "1985", - "Eagle Fighter (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_eaglefgtRomInfo, MSX_eaglefgtRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Eagle Fighter (Jpn, Alt) - -static struct BurnRomInfo MSX_eaglefgtaRomDesc[] = { - { "eagle fighter (japan) (alt 1).rom", 0x08000, 0xcf7edaeb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_eaglefgta, MSX_eaglefgta, msx_msx) -STD_ROM_FN(MSX_eaglefgta) - -struct BurnDriver BurnDrvMSX_eaglefgta = { - "msx_eaglefgta", "msx_eaglefgt", "msx_msx", NULL, "1985", - "Eagle Fighter (Jpn, Alt)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_eaglefgtaRomInfo, MSX_eaglefgtaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Eggerland Mystery (Jpn) - -static struct BurnRomInfo MSX_eggerlndRomDesc[] = { - { "eggerland mystery (japan).rom", 0x08000, 0x232b1050, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_eggerlnd, MSX_eggerlnd, msx_msx) -STD_ROM_FN(MSX_eggerlnd) - -struct BurnDriver BurnDrvMSX_eggerlnd = { - "msx_eggerlnd", NULL, "msx_msx", NULL, "1985", - "Eggerland Mystery (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_eggerlndRomInfo, MSX_eggerlndRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Elevator Action (Jpn) - -static struct BurnRomInfo MSX_elevatorRomDesc[] = { - { "elevator action (japan).rom", 0x08000, 0x39886593, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_elevator, MSX_elevator, msx_msx) -STD_ROM_FN(MSX_elevator) - -struct BurnDriver BurnDrvMSX_elevator = { - "msx_elevator", NULL, "msx_msx", NULL, "1985", - "Elevator Action (Jpn)\0", NULL, "Nidecom", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_elevatorRomInfo, MSX_elevatorRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exchanger (Jpn) - -static struct BurnRomInfo MSX_exchangrRomDesc[] = { - { "exchanger (japan).rom", 0x04000, 0x2c2b8a0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exchangr, MSX_exchangr, msx_msx) -STD_ROM_FN(MSX_exchangr) - -struct BurnDriver BurnDrvMSX_exchangr = { - "msx_exchangr", NULL, "msx_msx", NULL, "1984", - "Exchanger (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_exchangrRomInfo, MSX_exchangrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exchanger (Jpn, Alt) - -static struct BurnRomInfo MSX_exchangraRomDesc[] = { - { "exchanger (japan) (alt 1).rom", 0x04000, 0x691c0503, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exchangra, MSX_exchangra, msx_msx) -STD_ROM_FN(MSX_exchangra) - -struct BurnDriver BurnDrvMSX_exchangra = { - "msx_exchangra", "msx_exchangr", "msx_msx", NULL, "1984", - "Exchanger (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_exchangraRomInfo, MSX_exchangraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exerion (Jpn) - -static struct BurnRomInfo MSX_exerionRomDesc[] = { - { "exerion (japan).rom", 0x04000, 0x7abefd3d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exerion, MSX_exerion, msx_msx) -STD_ROM_FN(MSX_exerion) - -struct BurnDriver BurnDrvMSX_exerion = { - "msx_exerion", NULL, "msx_msx", NULL, "1984", - "Exerion (Jpn)\0", NULL, "Jaleco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exerionRomInfo, MSX_exerionRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exerion (Jpn, Alt) - -static struct BurnRomInfo MSX_exerionaRomDesc[] = { - { "exerion (japan) (alt 1).rom", 0x04000, 0x24b3b811, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exeriona, MSX_exeriona, msx_msx) -STD_ROM_FN(MSX_exeriona) - -struct BurnDriver BurnDrvMSX_exeriona = { - "msx_exeriona", "msx_exerion", "msx_msx", NULL, "1984", - "Exerion (Jpn, Alt)\0", NULL, "Jaleco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exerionaRomInfo, MSX_exerionaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exerion (Jpn, Alt 2) - -static struct BurnRomInfo MSX_exerionbRomDesc[] = { - { "exerion (japan) (alt 2).rom", 0x04021, 0x369cb84e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exerionb, MSX_exerionb, msx_msx) -STD_ROM_FN(MSX_exerionb) - -struct BurnDriver BurnDrvMSX_exerionb = { - "msx_exerionb", "msx_exerion", "msx_msx", NULL, "1984", - "Exerion (Jpn, Alt 2)\0", NULL, "Jaleco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exerionbRomInfo, MSX_exerionbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exerion (Kor) - -static struct BurnRomInfo MSX_exerionkRomDesc[] = { - { "exerion.rom", 0x08000, 0x55b25506, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exerionk, MSX_exerionk, msx_msx) -STD_ROM_FN(MSX_exerionk) - -struct BurnDriver BurnDrvMSX_exerionk = { - "msx_exerionk", "msx_exerion", "msx_msx", NULL, "198?", - "Exerion (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exerionkRomInfo, MSX_exerionkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exerion II - Zorni (Jpn) - -static struct BurnRomInfo MSX_exerion2RomDesc[] = { - { "exerion ii - zorni (japan).rom", 0x04000, 0x0b6c146f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exerion2, MSX_exerion2, msx_msx) -STD_ROM_FN(MSX_exerion2) - -struct BurnDriver BurnDrvMSX_exerion2 = { - "msx_exerion2", NULL, "msx_msx", NULL, "1985", - "Exerion II - Zorni (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exerion2RomInfo, MSX_exerion2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exerion II - Zorni (Jpn, Alt) - -static struct BurnRomInfo MSX_exerion2aRomDesc[] = { - { "exerion ii - zorni (japan) (alt 1).rom", 0x04000, 0xf3144243, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exerion2a, MSX_exerion2a, msx_msx) -STD_ROM_FN(MSX_exerion2a) - -struct BurnDriver BurnDrvMSX_exerion2a = { - "msx_exerion2a", "msx_exerion2", "msx_msx", NULL, "1985", - "Exerion II - Zorni (Jpn, Alt)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exerion2aRomInfo, MSX_exerion2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exoide-Z (Jpn) - -static struct BurnRomInfo MSX_exoidezRomDesc[] = { - { "exoide-z (japan).rom", 0x04000, 0x6e19c254, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exoidez, MSX_exoidez, msx_msx) -STD_ROM_FN(MSX_exoidez) - -struct BurnDriver BurnDrvMSX_exoidez = { - "msx_exoidez", NULL, "msx_msx", NULL, "1986", - "Exoide-Z (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exoidezRomInfo, MSX_exoidezRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exoide-Z (Jpn, Alt) - -static struct BurnRomInfo MSX_exoidezaRomDesc[] = { - { "exoide-z (japan) (alt 1).rom", 0x04000, 0x0c7fb621, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exoideza, MSX_exoideza, msx_msx) -STD_ROM_FN(MSX_exoideza) - -struct BurnDriver BurnDrvMSX_exoideza = { - "msx_exoideza", "msx_exoidez", "msx_msx", NULL, "1986", - "Exoide-Z (Jpn, Alt)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exoidezaRomInfo, MSX_exoidezaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exoide-Z (Jpn, Alt 2) - -static struct BurnRomInfo MSX_exoidezbRomDesc[] = { - { "exoide-z (japan) (alt 2).rom", 0x04000, 0x2d97d2bd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exoidezb, MSX_exoidezb, msx_msx) -STD_ROM_FN(MSX_exoidezb) - -struct BurnDriver BurnDrvMSX_exoidezb = { - "msx_exoidezb", "msx_exoidez", "msx_msx", NULL, "1986", - "Exoide-Z (Jpn, Alt 2)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exoidezbRomInfo, MSX_exoidezbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exoide-Z Area 5 (Jpn) - -static struct BurnRomInfo MSX_exoidez5RomDesc[] = { - { "exoide-z area 5 (japan).rom", 0x08000, 0xad529df0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exoidez5, MSX_exoidez5, msx_msx) -STD_ROM_FN(MSX_exoidez5) - -struct BurnDriver BurnDrvMSX_exoidez5 = { - "msx_exoidez5", NULL, "msx_msx", NULL, "1986", - "Exoide-Z Area 5 (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exoidez5RomInfo, MSX_exoidez5RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Exoide-Z Area 5 (Kor) - -static struct BurnRomInfo MSX_exoidez5kRomDesc[] = { - { "exoidez.rom", 0x08000, 0xb0d63c50, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_exoidez5k, MSX_exoidez5k, msx_msx) -STD_ROM_FN(MSX_exoidez5k) - -struct BurnDriver BurnDrvMSX_exoidez5k = { - "msx_exoidez5k", "msx_exoidez5", "msx_msx", NULL, "198?", - "Exoide-Z Area 5 (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exoidez5kRomInfo, MSX_exoidez5kRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// F-1 Spirit - The Way to Formula-1 (Jpn) - -static struct BurnRomInfo MSX_f1spiritRomDesc[] = { - { "f-1 spirit - the way to formula-1 (japan).rom", 0x20000, 0x12bfd3a9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_f1spirit, MSX_f1spirit, msx_msx) -STD_ROM_FN(MSX_f1spirit) - -struct BurnDriver BurnDrvMSX_f1spirit = { - "msx_f1spirit", NULL, "msx_msx", NULL, "1987", - "F-1 Spirit - The Way to Formula-1 (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_f1spiritRomInfo, MSX_f1spiritRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// F-1 Spirit - The Way to Formula-1 (Jpn, Alt) - -static struct BurnRomInfo MSX_f1spiritaRomDesc[] = { - { "f-1 spirit - the way to formula-1 (japan) (alt 1).rom", 0x20000, 0x64d2df7c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_f1spirita, MSX_f1spirita, msx_msx) -STD_ROM_FN(MSX_f1spirita) - -struct BurnDriver BurnDrvMSX_f1spirita = { - "msx_f1spirita", "msx_f1spirit", "msx_msx", NULL, "1987", - "F-1 Spirit - The Way to Formula-1 (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_f1spiritaRomInfo, MSX_f1spiritaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// F-1 Spirit - The Way to Formula-1 (Kor) - -static struct BurnRomInfo MSX_f1spiritkRomDesc[] = { - { "f-1 spirit - the way to formula 1 (1987)(zemina)[rc-752].rom", 0x20000, 0xf5a3b765, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_f1spiritk, MSX_f1spiritk, msx_msx) -STD_ROM_FN(MSX_f1spiritk) - -struct BurnDriver BurnDrvMSX_f1spiritk = { - "msx_f1spiritk", "msx_f1spirit", "msx_msx", NULL, "19??", - "F-1 Spirit - The Way to Formula-1 (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_f1spiritkRomInfo, MSX_f1spiritkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// FA Tetris (Kor) - -static struct BurnRomInfo MSX_fatetrisRomDesc[] = { - { "fa tetris (korea) (unl).rom", 0x08000, 0x1ec87e3a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fatetris, MSX_fatetris, msx_msx) -STD_ROM_FN(MSX_fatetris) - -struct BurnDriver BurnDrvMSX_fatetris = { - "msx_fatetris", NULL, "msx_msx", NULL, "1989", - "FA Tetris (Kor)\0", NULL, "FA Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fatetrisRomInfo, MSX_fatetrisRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// FA Tetris (Kor, Alt) - -static struct BurnRomInfo MSX_fatetrisaRomDesc[] = { - { "tetrisb.rom", 0x08000, 0x4c6df534, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fatetrisa, MSX_fatetrisa, msx_msx) -STD_ROM_FN(MSX_fatetrisa) - -struct BurnDriver BurnDrvMSX_fatetrisa = { - "msx_fatetrisa", "msx_fatetris", "msx_msx", NULL, "1989", - "FA Tetris (Kor, Alt)\0", NULL, "FA Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fatetrisaRomInfo, MSX_fatetrisaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// FA Tetris (Kor, Alt 2) - -static struct BurnRomInfo MSX_fatetrisbRomDesc[] = { - { "tetris_n.rom", 0x08000, 0x30151594, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fatetrisb, MSX_fatetrisb, msx_msx) -STD_ROM_FN(MSX_fatetrisb) - -struct BurnDriver BurnDrvMSX_fatetrisb = { - "msx_fatetrisb", "msx_fatetris", "msx_msx", NULL, "1989", - "FA Tetris (Kor, Alt 2)\0", NULL, "FA Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fatetrisbRomInfo, MSX_fatetrisbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Fairy (Jpn) - -static struct BurnRomInfo MSX_fairyRomDesc[] = { - { "fairy (japan).rom", 0x04000, 0x314728c3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fairy, MSX_fairy, msx_msx) -STD_ROM_FN(MSX_fairy) - -struct BurnDriver BurnDrvMSX_fairy = { - "msx_fairy", NULL, "msx_msx", NULL, "1985", - "Fairy (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fairyRomInfo, MSX_fairyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Fairyland Story (Jpn) - -static struct BurnRomInfo MSX_flstoryRomDesc[] = { - { "fairy land story, the (japan).rom", 0x20000, 0x26e34f05, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flstory, MSX_flstory, msx_msx) -STD_ROM_FN(MSX_flstory) - -struct BurnDriver BurnDrvMSX_flstory = { - "msx_flstory", NULL, "msx_msx", NULL, "1987", - "The Fairyland Story (Jpn)\0", NULL, "Hot-B", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_flstoryRomInfo, MSX_flstoryRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Fairyland Story (Jpn, Alt) - -static struct BurnRomInfo MSX_flstoryaRomDesc[] = { - { "fairy land story, the (japan) (alt 1).rom", 0x20000, 0xc032376b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flstorya, MSX_flstorya, msx_msx) -STD_ROM_FN(MSX_flstorya) - -struct BurnDriver BurnDrvMSX_flstorya = { - "msx_flstorya", "msx_flstory", "msx_msx", NULL, "1987", - "The Fairyland Story (Jpn, Alt)\0", NULL, "Hot-B", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_flstoryaRomInfo, MSX_flstoryaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Fantasy Zone (Kor) - -static struct BurnRomInfo MSX_fantzonekRomDesc[] = { - { "fantasy zone (1987)(zemina).rom", 0x20000, 0xc73d4d25, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fantzonek, MSX_fantzonek, msx_msx) -STD_ROM_FN(MSX_fantzonek) - -struct BurnDriver BurnDrvMSX_fantzonek = { - "msx_fantzonek", "msx_fantzone", "msx_msx", NULL, "19??", - "Fantasy Zone (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_fantzonekRomInfo, MSX_fantzonekRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Fathom (Jpn) - -static struct BurnRomInfo MSX_fathomRomDesc[] = { - { "fathom (japan).rom", 0x08000, 0xf06a58da, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fathom, MSX_fathom, msx_msx) -STD_ROM_FN(MSX_fathom) - -struct BurnDriver BurnDrvMSX_fathom = { - "msx_fathom", NULL, "msx_msx", NULL, "1985", - "Fathom (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fathomRomInfo, MSX_fathomRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Final Justice (Jpn) - -static struct BurnRomInfo MSX_fjusticeRomDesc[] = { - { "final justice (japan).rom", 0x04000, 0x851ba4bb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fjustice, MSX_fjustice, msx_msx) -STD_ROM_FN(MSX_fjustice) - -struct BurnDriver BurnDrvMSX_fjustice = { - "msx_fjustice", NULL, "msx_msx", NULL, "1985", - "Final Justice (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fjusticeRomInfo, MSX_fjusticeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Final Justice (Jpn, Alt) - -static struct BurnRomInfo MSX_fjusticeaRomDesc[] = { - { "final justice (japan) (alt 1).rom", 0x04000, 0x41a86301, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fjusticea, MSX_fjusticea, msx_msx) -STD_ROM_FN(MSX_fjusticea) - -struct BurnDriver BurnDrvMSX_fjusticea = { - "msx_fjusticea", "msx_fjustice", "msx_msx", NULL, "1985", - "Final Justice (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fjusticeaRomInfo, MSX_fjusticeaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Final Justice (Jpn, Alt 2) - -static struct BurnRomInfo MSX_fjusticebRomDesc[] = { - { "final justice (japan) (alt 2).rom", 0x04000, 0xb1663de8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fjusticeb, MSX_fjusticeb, msx_msx) -STD_ROM_FN(MSX_fjusticeb) - -struct BurnDriver BurnDrvMSX_fjusticeb = { - "msx_fjusticeb", "msx_fjustice", "msx_msx", NULL, "1985", - "Final Justice (Jpn, Alt 2)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fjusticebRomInfo, MSX_fjusticebRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Final Zone (Kor) - -static struct BurnRomInfo MSX_fzonekRomDesc[] = { - { "final zone wolf (1986)(zemina).rom", 0x20000, 0x06310fb1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fzonek, MSX_fzonek, msx_msx) -STD_ROM_FN(MSX_fzonek) - -struct BurnDriver BurnDrvMSX_fzonek = { - "msx_fzonek", "msx_fzone", "msx_msx", NULL, "19??", - "Final Zone (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_fzonekRomInfo, MSX_fzonekRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Fire Rescue (Jpn) - -static struct BurnRomInfo MSX_firerescRomDesc[] = { - { "fire rescue (japan).rom", 0x04000, 0x8005a9ba, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fireresc, MSX_fireresc, msx_msx) -STD_ROM_FN(MSX_fireresc) - -struct BurnDriver BurnDrvMSX_fireresc = { - "msx_fireresc", NULL, "msx_msx", NULL, "1984", - "Fire Rescue (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_firerescRomInfo, MSX_firerescRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Fire Rescue (Jpn, Alt) - -static struct BurnRomInfo MSX_firerescaRomDesc[] = { - { "fire rescue (japan) (alt 1).rom", 0x04000, 0x7b2ef621, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fireresca, MSX_fireresca, msx_msx) -STD_ROM_FN(MSX_fireresca) - -struct BurnDriver BurnDrvMSX_fireresca = { - "msx_fireresca", "msx_fireresc", "msx_msx", NULL, "1984", - "Fire Rescue (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_firerescaRomInfo, MSX_firerescaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flappy (Jpn) - -static struct BurnRomInfo MSX_flappyRomDesc[] = { - { "flappy (japan).rom", 0x04000, 0xb6285a0b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flappy, MSX_flappy, msx_msx) -STD_ROM_FN(MSX_flappy) - -struct BurnDriver BurnDrvMSX_flappy = { - "msx_flappy", NULL, "msx_msx", NULL, "1985", - "Flappy (Jpn)\0", NULL, "dB-Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_flappyRomInfo, MSX_flappyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flappy (Jpn, Alt) - -static struct BurnRomInfo MSX_flappyaRomDesc[] = { - { "flappy (japan) (alt 1).rom", 0x04000, 0x56ec7bbf, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flappya, MSX_flappya, msx_msx) -STD_ROM_FN(MSX_flappya) - -struct BurnDriver BurnDrvMSX_flappya = { - "msx_flappya", "msx_flappy", "msx_msx", NULL, "1985", - "Flappy (Jpn, Alt)\0", NULL, "dB-Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_flappyaRomInfo, MSX_flappyaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flappy - Limited 85 (Jpn) - -static struct BurnRomInfo MSX_flappy85RomDesc[] = { - { "flappy - limited 85 (japan).rom", 0x04000, 0x4a4f3084, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flappy85, MSX_flappy85, msx_msx) -STD_ROM_FN(MSX_flappy85) - -struct BurnDriver BurnDrvMSX_flappy85 = { - "msx_flappy85", NULL, "msx_msx", NULL, "1985", - "Flappy - Limited 85 (Jpn)\0", NULL, "dB-Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_flappy85RomInfo, MSX_flappy85RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flashpoint (Kor) - -static struct BurnRomInfo MSX_fpointRomDesc[] = { - { "flash point (korea) (unl).rom", 0x08000, 0xc4a33da7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fpoint, MSX_fpoint, msx_msx) -STD_ROM_FN(MSX_fpoint) - -struct BurnDriver BurnDrvMSX_fpoint = { - "msx_fpoint", NULL, "msx_msx", NULL, "1991", - "Flashpoint (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fpointRomInfo, MSX_fpointRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flashpoint (Kor, Alt) - -static struct BurnRomInfo MSX_fpointaRomDesc[] = { - { "flash point (korea) (alt 1) (unl).rom", 0x08000, 0x25708cfa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fpointa, MSX_fpointa, msx_msx) -STD_ROM_FN(MSX_fpointa) - -struct BurnDriver BurnDrvMSX_fpointa = { - "msx_fpointa", "msx_fpoint", "msx_msx", NULL, "1991", - "Flashpoint (Kor, Alt)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fpointaRomInfo, MSX_fpointaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flash Splash (Jpn) - -static struct BurnRomInfo MSX_fsplashRomDesc[] = { - { "flash splash (japan).rom", 0x02000, 0x5c187cf7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fsplash, MSX_fsplash, msx_msx) -STD_ROM_FN(MSX_fsplash) - -struct BurnDriver BurnDrvMSX_fsplash = { - "msx_fsplash", NULL, "msx_msx", NULL, "1984", - "Flash Splash (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fsplashRomInfo, MSX_fsplashRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flicky (Jpn) - -static struct BurnRomInfo MSX_flickyRomDesc[] = { - { "flicky (japan).rom", 0x08000, 0x88250e5d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flicky, MSX_flicky, msx_msx) -STD_ROM_FN(MSX_flicky) - -struct BurnDriver BurnDrvMSX_flicky = { - "msx_flicky", NULL, "msx_msx", NULL, "1986", - "Flicky (Jpn)\0", NULL, "Micronet", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_flickyRomInfo, MSX_flickyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flight Deck (Jpn) - -static struct BurnRomInfo MSX_flideckRomDesc[] = { - { "flight deck (japan).rom", 0x10000, 0xa00526d0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flideck, MSX_flideck, msx_msx) -STD_ROM_FN(MSX_flideck) - -struct BurnDriver BurnDrvMSX_flideck = { - "msx_flideck", NULL, "msx_msx", NULL, "1986", - "Flight Deck (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_flideckRomInfo, MSX_flideckRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flight Deck (Jpn, Alt) - -static struct BurnRomInfo MSX_flideckaRomDesc[] = { - { "flight deck (japan) (alt 1).rom", 0x10000, 0x4b162065, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flidecka, MSX_flidecka, msx_msx) -STD_ROM_FN(MSX_flidecka) - -struct BurnDriver BurnDrvMSX_flidecka = { - "msx_flidecka", "msx_flideck", "msx_msx", NULL, "1986", - "Flight Deck (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_flideckaRomInfo, MSX_flideckaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flipper Slipper (Jpn) - -static struct BurnRomInfo MSX_flipperRomDesc[] = { - { "flipper slipper (japan).rom", 0x04000, 0xfd7de91e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flipper, MSX_flipper, msx_msx) -STD_ROM_FN(MSX_flipper) - -struct BurnDriver BurnDrvMSX_flipper = { - "msx_flipper", NULL, "msx_msx", NULL, "1983", - "Flipper Slipper (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_flipperRomInfo, MSX_flipperRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Flipper Slipper (Jpn, Alt) - -static struct BurnRomInfo MSX_flipperaRomDesc[] = { - { "flipper slipper (japan) (alt 1).rom", 0x04000, 0xf0b5fe8d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flippera, MSX_flippera, msx_msx) -STD_ROM_FN(MSX_flippera) - -struct BurnDriver BurnDrvMSX_flippera = { - "msx_flippera", "msx_flipper", "msx_msx", NULL, "1983", - "Flipper Slipper (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_flipperaRomInfo, MSX_flipperaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Formation Z (Jpn) - -static struct BurnRomInfo MSX_formatzRomDesc[] = { - { "formation z (japan).rom", 0x08000, 0x37b55d09, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_formatz, MSX_formatz, msx_msx) -STD_ROM_FN(MSX_formatz) - -struct BurnDriver BurnDrvMSX_formatz = { - "msx_formatz", NULL, "msx_msx", NULL, "1985", - "Formation Z (Jpn)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_formatzRomInfo, MSX_formatzRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Formation Z (Jpn, Alt) - -static struct BurnRomInfo MSX_formatzaRomDesc[] = { - { "formation z (japan) (alt 1).rom", 0x08000, 0x74560bbd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_formatza, MSX_formatza, msx_msx) -STD_ROM_FN(MSX_formatza) - -struct BurnDriver BurnDrvMSX_formatza = { - "msx_formatza", "msx_formatz", "msx_msx", NULL, "1985", - "Formation Z (Jpn, Alt)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_formatzaRomInfo, MSX_formatzaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Frogger (Jpn) - -static struct BurnRomInfo MSX_froggerRomDesc[] = { - { "frogger (japan).rom", 0x02000, 0x97e2fcb4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_frogger, MSX_frogger, msx_msx) -STD_ROM_FN(MSX_frogger) - -struct BurnDriver BurnDrvMSX_frogger = { - "msx_frogger", NULL, "msx_msx", NULL, "1983", - "Frogger (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_froggerRomInfo, MSX_froggerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Frogger (Jpn, Alt) - -static struct BurnRomInfo MSX_froggeraRomDesc[] = { - { "frogger (japan) (alt 1).rom", 0x04000, 0x71edc580, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_froggera, MSX_froggera, msx_msx) -STD_ROM_FN(MSX_froggera) - -struct BurnDriver BurnDrvMSX_froggera = { - "msx_froggera", "msx_frogger", "msx_msx", NULL, "1983", - "Frogger (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_froggeraRomInfo, MSX_froggeraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Front Line (Jpn) - -static struct BurnRomInfo MSX_frontlinRomDesc[] = { - { "front line (japan).rom", 0x04000, 0xb9d03f7b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_frontlin, MSX_frontlin, msx_msx) -STD_ROM_FN(MSX_frontlin) - -struct BurnDriver BurnDrvMSX_frontlin = { - "msx_frontlin", NULL, "msx_msx", NULL, "1984", - "Front Line (Jpn)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_frontlinRomInfo, MSX_frontlinRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Front Line (Jpn, Alt) - -static struct BurnRomInfo MSX_frontlinaRomDesc[] = { - { "front line (japan) (alt 1).rom", 0x04000, 0x8d632577, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_frontlina, MSX_frontlina, msx_msx) -STD_ROM_FN(MSX_frontlina) - -struct BurnDriver BurnDrvMSX_frontlina = { - "msx_frontlina", "msx_frontlin", "msx_msx", NULL, "1984", - "Front Line (Jpn, Alt)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_frontlinaRomInfo, MSX_frontlinaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Front Line (Jpn, Alt 2) - -static struct BurnRomInfo MSX_frontlinbRomDesc[] = { - { "front line (japan) (alt 2).rom", 0x04000, 0x5958f98c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_frontlinb, MSX_frontlinb, msx_msx) -STD_ROM_FN(MSX_frontlinb) - -struct BurnDriver BurnDrvMSX_frontlinb = { - "msx_frontlinb", "msx_frontlin", "msx_msx", NULL, "1984", - "Front Line (Jpn, Alt 2)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_frontlinbRomInfo, MSX_frontlinbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Fruit Search (Jpn) - -static struct BurnRomInfo MSX_fruitsrcRomDesc[] = { - { "fruit search (japan).rom", 0x02000, 0xeba95a38, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fruitsrc, MSX_fruitsrc, msx_msx) -STD_ROM_FN(MSX_fruitsrc) - -struct BurnDriver BurnDrvMSX_fruitsrc = { - "msx_fruitsrc", NULL, "msx_msx", NULL, "1983", - "Fruit Search (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fruitsrcRomInfo, MSX_fruitsrcRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Fruit Search (Jpn, Alt) - -static struct BurnRomInfo MSX_fruitsrcaRomDesc[] = { - { "fruit search (japan) (alt 1).rom", 0x04000, 0xb1160421, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fruitsrca, MSX_fruitsrca, msx_msx) -STD_ROM_FN(MSX_fruitsrca) - -struct BurnDriver BurnDrvMSX_fruitsrca = { - "msx_fruitsrca", "msx_fruitsrc", "msx_msx", NULL, "1983", - "Fruit Search (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fruitsrcaRomInfo, MSX_fruitsrcaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Funky Mouse (Jpn) - -static struct BurnRomInfo MSX_funmouseRomDesc[] = { - { "funky mouse (japan).rom", 0x04000, 0xb5c0dace, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_funmouse, MSX_funmouse, msx_msx) -STD_ROM_FN(MSX_funmouse) - -struct BurnDriver BurnDrvMSX_funmouse = { - "msx_funmouse", NULL, "msx_msx", NULL, "1984", - "Funky Mouse (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_funmouseRomInfo, MSX_funmouseRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Galaga (Jpn) - -static struct BurnRomInfo MSX_galagaRomDesc[] = { - { "galaga (japan).rom", 0x08000, 0x8856961d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_galaga, MSX_galaga, msx_msx) -STD_ROM_FN(MSX_galaga) - -struct BurnDriver BurnDrvMSX_galaga = { - "msx_galaga", NULL, "msx_msx", NULL, "1984", - "Galaga (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_galagaRomInfo, MSX_galagaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Galaxian (Jpn) - -static struct BurnRomInfo MSX_galaxianRomDesc[] = { - { "galaxian (japan).rom", 0x02000, 0xe223ffd1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_galaxian, MSX_galaxian, msx_msx) -STD_ROM_FN(MSX_galaxian) - -struct BurnDriver BurnDrvMSX_galaxian = { - "msx_galaxian", NULL, "msx_msx", NULL, "1984", - "Galaxian (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_galaxianRomInfo, MSX_galaxianRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Galaxian (Jpn, Alt) - -static struct BurnRomInfo MSX_galaxianaRomDesc[] = { - { "galaxian (japan) (alt 1).rom", 0x02000, 0x4980ffac, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_galaxiana, MSX_galaxiana, msx_msx) -STD_ROM_FN(MSX_galaxiana) - -struct BurnDriver BurnDrvMSX_galaxiana = { - "msx_galaxiana", "msx_galaxian", "msx_msx", NULL, "1984", - "Galaxian (Jpn, Alt)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_galaxianaRomInfo, MSX_galaxianaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Galaxian (Jpn, Alt 2) - -static struct BurnRomInfo MSX_galaxianbRomDesc[] = { - { "galaxian (japan) (alt 2).rom", 0x02000, 0xe6f9d8a7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_galaxianb, MSX_galaxianb, msx_msx) -STD_ROM_FN(MSX_galaxianb) - -struct BurnDriver BurnDrvMSX_galaxianb = { - "msx_galaxianb", "msx_galaxian", "msx_msx", NULL, "1984", - "Galaxian (Jpn, Alt 2)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_galaxianbRomInfo, MSX_galaxianbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Gall Force - Defense of Chaos (Jpn) - -static struct BurnRomInfo MSX_galforceRomDesc[] = { - { "gall force - defense of chaos (japan).rom", 0x20000, 0xf65b5271, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_galforce, MSX_galforce, msx_msx) -STD_ROM_FN(MSX_galforce) - -struct BurnDriver BurnDrvMSX_galforce = { - "msx_galforce", NULL, "msx_msx", NULL, "1986", - "Gall Force - Defense of Chaos (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_galforceRomInfo, MSX_galforceRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gall Force - Defense of Chaos (Jpn, Alt) - -static struct BurnRomInfo MSX_galforcebRomDesc[] = { - { "gall force - defense of chaos (japan) (alt).rom", 0x20000, 0xec036e37, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_galforceb, MSX_galforceb, msx_msx) -STD_ROM_FN(MSX_galforceb) - -struct BurnDriver BurnDrvMSX_galforceb = { - "msx_galforcea", "msx_galforce", "msx_msx", NULL, "1986", - "Gall Force - Defense of Chaos (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_galforcebRomInfo, MSX_galforcebRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ghostbusters (Jpn) - -static struct BurnRomInfo MSX_ghostbstRomDesc[] = { - { "ghostbusters (europe).rom", 0x08000, 0xc9bcbe5a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ghostbst, MSX_ghostbst, msx_msx) -STD_ROM_FN(MSX_ghostbst) - -struct BurnDriver BurnDrvMSX_ghostbst = { - "msx_ghostbst", NULL, "msx_msx", NULL, "1984", - "Ghostbusters (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ghostbstRomInfo, MSX_ghostbstRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Glider (Jpn) - -static struct BurnRomInfo MSX_gliderRomDesc[] = { - { "glider (japan).rom", 0x04000, 0xae35e4ad, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_glider, MSX_glider, msx_msx) -STD_ROM_FN(MSX_glider) - -struct BurnDriver BurnDrvMSX_glider = { - "msx_glider", NULL, "msx_msx", NULL, "1985", - "Glider (Jpn)\0", NULL, "ZAP", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gliderRomInfo, MSX_gliderRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Glider (Jpn, Alt) - -static struct BurnRomInfo MSX_glideraRomDesc[] = { - { "glider (japan) (alt 1).rom", 0x04000, 0x5a23f1ee, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_glidera, MSX_glidera, msx_msx) -STD_ROM_FN(MSX_glidera) - -struct BurnDriver BurnDrvMSX_glidera = { - "msx_glidera", "msx_glider", "msx_msx", NULL, "1985", - "Glider (Jpn, Alt)\0", NULL, "ZAP", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_glideraRomInfo, MSX_glideraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Godzilla (Jpn) - -static struct BurnRomInfo MSX_godzillaRomDesc[] = { - { "godzilla (japan).rom", 0x04000, 0xbe071826, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_godzilla, MSX_godzilla, msx_msx) -STD_ROM_FN(MSX_godzilla) - -struct BurnDriver BurnDrvMSX_godzilla = { - "msx_godzilla", NULL, "msx_msx", NULL, "1984", - "Godzilla (Jpn)\0", NULL, "Bandai", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_godzillaRomInfo, MSX_godzillaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Godzilla (Jpn, Hacked?) - -static struct BurnRomInfo MSX_godzillaaRomDesc[] = { - { "godzilla (japan) (alt 1).rom", 0x04000, 0x83d44b03, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_godzillaa, MSX_godzillaa, msx_msx) -STD_ROM_FN(MSX_godzillaa) - -struct BurnDriver BurnDrvMSX_godzillaa = { - "msx_godzillaa", "msx_godzilla", "msx_msx", NULL, "1984", - "Godzilla (Jpn, Hacked?)\0", NULL, "Bandai", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_godzillaaRomInfo, MSX_godzillaaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Godzilla-kun (Jpn) - -static struct BurnRomInfo MSX_godzikunRomDesc[] = { - { "godzilla-kun (japan).rom", 0x08000, 0xed4a211d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_godzikun, MSX_godzikun, msx_msx) -STD_ROM_FN(MSX_godzikun) - -struct BurnDriver BurnDrvMSX_godzikun = { - "msx_godzikun", NULL, "msx_msx", NULL, "1985", - "Godzilla-kun (Jpn)\0", NULL, "Toho", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_godzikunRomInfo, MSX_godzikunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Godzilla-kun (Jpn, Alt) - -static struct BurnRomInfo MSX_godzikunaRomDesc[] = { - { "godzilla-kun (japan) (alt 1).rom", 0x08000, 0x6498865f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_godzikuna, MSX_godzikuna, msx_msx) -STD_ROM_FN(MSX_godzikuna) - -struct BurnDriver BurnDrvMSX_godzikuna = { - "msx_godzikuna", "msx_godzikun", "msx_msx", NULL, "1985", - "Godzilla-kun (Jpn, Alt)\0", NULL, "Toho", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_godzikunaRomInfo, MSX_godzikunaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gokiburi Daisakusen (Jpn) - -static struct BurnRomInfo MSX_gokiburiRomDesc[] = { - { "gokiburi daisakusen - bug bomb (japan).rom", 0x04000, 0x69ecb2ed, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gokiburi, MSX_gokiburi, msx_msx) -STD_ROM_FN(MSX_gokiburi) - -struct BurnDriver BurnDrvMSX_gokiburi = { - "msx_gokiburi", NULL, "msx_msx", NULL, "1983", - "Gokiburi Daisakusen. Bug Bomb (Jpn)\0", NULL, "Magicsoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gokiburiRomInfo, MSX_gokiburiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Golf Game (Jpn) - -static struct BurnRomInfo MSX_golfgameRomDesc[] = { - { "golf game (japan).rom", 0x04000, 0x5d88275f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_golfgame, MSX_golfgame, msx_msx) -STD_ROM_FN(MSX_golfgame) - -struct BurnDriver BurnDrvMSX_golfgame = { - "msx_golfgame", NULL, "msx_msx", NULL, "1983", - "Golf Game (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_golfgameRomInfo, MSX_golfgameRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gomoku Narabe (Jpn) - -static struct BurnRomInfo MSX_gomokunaRomDesc[] = { - { "gomok narabe - omo go (japan).rom", 0x04000, 0x269f079f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gomokuna, MSX_gomokuna, msx_msx) -STD_ROM_FN(MSX_gomokuna) - -struct BurnDriver BurnDrvMSX_gomokuna = { - "msx_gomokuna", NULL, "msx_msx", NULL, "1984", - "Gomoku Narabe (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gomokunaRomInfo, MSX_gomokunaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gomoku Narabe (Jpn, Alt) - -static struct BurnRomInfo MSX_gomokunaaRomDesc[] = { - { "gomok narabe - omo go (japan) (alt 1).rom", 0x04000, 0xc3816d36, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gomokunaa, MSX_gomokunaa, msx_msx) -STD_ROM_FN(MSX_gomokunaa) - -struct BurnDriver BurnDrvMSX_gomokunaa = { - "msx_gomokunaa", "msx_gomokuna", "msx_msx", NULL, "1984", - "Gomoku Narabe (Jpn, Alt)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gomokunaaRomInfo, MSX_gomokunaaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Goonies (Jpn) - -static struct BurnRomInfo MSX_gooniesRomDesc[] = { - { "goonies, the (japan).rom", 0x08000, 0xdb327847, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_goonies, MSX_goonies, msx_msx) -STD_ROM_FN(MSX_goonies) - -struct BurnDriver BurnDrvMSX_goonies = { - "msx_goonies", NULL, "msx_msx", NULL, "1986", - "The Goonies (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gooniesRomInfo, MSX_gooniesRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Goonies (Jpn, Alt) - -static struct BurnRomInfo MSX_gooniesaRomDesc[] = { - { "goonies, the (japan) (alt 1).rom", 0x08000, 0xc6445f82, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gooniesa, MSX_gooniesa, msx_msx) -STD_ROM_FN(MSX_gooniesa) - -struct BurnDriver BurnDrvMSX_gooniesa = { - "msx_gooniesa", "msx_goonies", "msx_msx", NULL, "1986", - "The Goonies (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gooniesaRomInfo, MSX_gooniesaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Goonies (Jpn, Alt 2) - -static struct BurnRomInfo MSX_gooniesbRomDesc[] = { - { "goonies, the (japan) (alt 2).rom", 0x08000, 0x38f04741, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gooniesb, MSX_gooniesb, msx_msx) -STD_ROM_FN(MSX_gooniesb) - -struct BurnDriver BurnDrvMSX_gooniesb = { - "msx_gooniesb", "msx_goonies", "msx_msx", NULL, "1986", - "The Goonies (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gooniesbRomInfo, MSX_gooniesbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// GP World (Jpn) - -static struct BurnRomInfo MSX_gpworldRomDesc[] = { - { "gp world (japan).rom", 0x08000, 0x9dbdd4bc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gpworld, MSX_gpworld, msx_msx) -STD_ROM_FN(MSX_gpworld) - -struct BurnDriver BurnDrvMSX_gpworld = { - "msx_gpworld", NULL, "msx_msx", NULL, "1985", - "GP World (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gpworldRomInfo, MSX_gpworldRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Green Beret (Euro) - -static struct BurnRomInfo MSX_gberetRomDesc[] = { - { "green beret (europe).rom", 0x08000, 0x61f41bcd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gberet, MSX_gberet, msx_msx) -STD_ROM_FN(MSX_gberet) - -struct BurnDriver BurnDrvMSX_gberet = { - "msx_gberet", NULL, "msx_msx", NULL, "1986", - "Green Beret (Euro)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gberetRomInfo, MSX_gberetRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Green Beret (Euro, Alt) - -static struct BurnRomInfo MSX_gberetaRomDesc[] = { - { "green beret (europe) (alt 1).rom", 0x08000, 0x46f5e571, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gbereta, MSX_gbereta, msx_msx) -STD_ROM_FN(MSX_gbereta) - -struct BurnDriver BurnDrvMSX_gbereta = { - "msx_gbereta", "msx_gberet", "msx_msx", NULL, "1986", - "Green Beret (Euro, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gberetaRomInfo, MSX_gberetaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Green Beret (Kor) - -static struct BurnRomInfo MSX_gberetkRomDesc[] = { - { "green beret (1987)(zemina).rom", 0x08000, 0x3caec828, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gberetk, MSX_gberetk, msx_msx) -STD_ROM_FN(MSX_gberetk) - -struct BurnDriver BurnDrvMSX_gberetk = { - "msx_gberetk", "msx_gberet", "msx_msx", NULL, "1987", - "Green Beret (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gberetkRomInfo, MSX_gberetkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Grog's Revenge (Jpn) - -static struct BurnRomInfo MSX_grogrevRomDesc[] = { - { "grog's revenge (japan).rom", 0x08000, 0x5f74ae0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_grogrev, MSX_grogrev, msx_msx) -STD_ROM_FN(MSX_grogrev) - -struct BurnDriver BurnDrvMSX_grogrev = { - "msx_grogrev", NULL, "msx_msx", NULL, "1985", - "B.C.'s Quest for Tires II - Grog's Revenge (Jpn)\0", NULL, "Comptiq", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_grogrevRomInfo, MSX_grogrevRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Grog's Revenge (Jpn, Alt) - -static struct BurnRomInfo MSX_grogrevaRomDesc[] = { - { "grog's revenge (japan) (alt 1).rom", 0x08000, 0xeba19b7e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_grogreva, MSX_grogreva, msx_msx) -STD_ROM_FN(MSX_grogreva) - -struct BurnDriver BurnDrvMSX_grogreva = { - "msx_grogreva", "msx_grogrev", "msx_msx", NULL, "1985", - "B.C.'s Quest for Tires II - Grog's Revenge (Jpn, Alt)\0", NULL, "Comptiq", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_grogrevaRomInfo, MSX_grogrevaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Guardic (Jpn) - -static struct BurnRomInfo MSX_guardicRomDesc[] = { - { "guardic (japan).rom", 0x08000, 0x6aebb9d3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_guardic, MSX_guardic, msx_msx) -STD_ROM_FN(MSX_guardic) - -struct BurnDriver BurnDrvMSX_guardic = { - "msx_guardic", NULL, "msx_msx", NULL, "1986", - "Guardic (Jpn)\0", NULL, "Compile", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_guardicRomInfo, MSX_guardicRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Guardic (Jpn, Alt) - -static struct BurnRomInfo MSX_guardicaRomDesc[] = { - { "guardic (japan) (alt 1).rom", 0x08000, 0x106230b8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_guardica, MSX_guardica, msx_msx) -STD_ROM_FN(MSX_guardica) - -struct BurnDriver BurnDrvMSX_guardica = { - "msx_guardica", "msx_guardic", "msx_msx", NULL, "1986", - "Guardic (Jpn, Alt)\0", NULL, "Compile", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_guardicaRomInfo, MSX_guardicaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gulkave (Jpn) - -static struct BurnRomInfo MSX_gulkaveRomDesc[] = { - { "gulkave (japan).rom", 0x08000, 0xa02029d0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gulkave, MSX_gulkave, msx_msx) -STD_ROM_FN(MSX_gulkave) - -struct BurnDriver BurnDrvMSX_gulkave = { - "msx_gulkave", NULL, "msx_msx", NULL, "1986", - "Gulkave (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gulkaveRomInfo, MSX_gulkaveRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gulkave (Jpn, Alt) - -static struct BurnRomInfo MSX_gulkaveaRomDesc[] = { - { "gulkave (japan) (alt 1).rom", 0x08000, 0xfdb3bc27, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gulkavea, MSX_gulkavea, msx_msx) -STD_ROM_FN(MSX_gulkavea) - -struct BurnDriver BurnDrvMSX_gulkavea = { - "msx_gulkavea", "msx_gulkave", "msx_msx", NULL, "1986", - "Gulkave (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gulkaveaRomInfo, MSX_gulkaveaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gulkave (Kor) - -static struct BurnRomInfo MSX_gulkavekRomDesc[] = { - { "gulkave.rom", 0x08000, 0x0bee5a87, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gulkavek, MSX_gulkavek, msx_msx) -STD_ROM_FN(MSX_gulkavek) - -struct BurnDriver BurnDrvMSX_gulkavek = { - "msx_gulkavek", "msx_gulkave", "msx_msx", NULL, "198?", - "Gulkave (Kor)\0", NULL, "ProSoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gulkavekRomInfo, MSX_gulkavekRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gun.Smoke - -static struct BurnRomInfo MSX_gunsmokeRomDesc[] = { - { "prosoft_gunsmoke_(1990)(prosoft).rom", 0x08000, 0x1318dba7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gunsmoke, MSX_gunsmoke, msx_msx) -STD_ROM_FN(MSX_gunsmoke) - -struct BurnDriver BurnDrvMSX_gunsmoke = { - "msx_gunsmoke", NULL, "msx_msx", NULL, "1990", - "Gun.Smoke\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gunsmokeRomInfo, MSX_gunsmokeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gun Fright (Jpn) - -static struct BurnRomInfo MSX_gunfrghtRomDesc[] = { - { "gun fright (japan).rom", 0x08000, 0xf877b3d6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gunfrght, MSX_gunfrght, msx_msx) -STD_ROM_FN(MSX_gunfrght) - -struct BurnDriver BurnDrvMSX_gunfrght = { - "msx_gunfrght", NULL, "msx_msx", NULL, "1986", - "Gun Fright (Jpn)\0", NULL, "Jaleco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gunfrghtRomInfo, MSX_gunfrghtRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gun Fright (Jpn, Hacked?) - -static struct BurnRomInfo MSX_gunfrghtaRomDesc[] = { - { "gunfright (1986)(ultimate play the game).rom", 0x08000, 0x31fe5c5b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gunfrghta, MSX_gunfrghta, msx_msx) -STD_ROM_FN(MSX_gunfrghta) - -struct BurnDriver BurnDrvMSX_gunfrghta = { - "msx_gunfrghta", "msx_gunfrght", "msx_msx", NULL, "1985", - "Gun Fright (Jpn, Hacked?)\0", NULL, "A.C.G.", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gunfrghtaRomInfo, MSX_gunfrghtaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gyrodine (Jpn) - -static struct BurnRomInfo MSX_gyrodineRomDesc[] = { - { "gyrodine (japan).rom", 0x08000, 0x0e89433b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gyrodine, MSX_gyrodine, msx_msx) -STD_ROM_FN(MSX_gyrodine) - -struct BurnDriver BurnDrvMSX_gyrodine = { - "msx_gyrodine", NULL, "msx_msx", NULL, "1986", - "Gyrodine (Jpn)\0", NULL, "Nidecom", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gyrodineRomInfo, MSX_gyrodineRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gyrodine (Kor) - -static struct BurnRomInfo MSX_gyrodinekRomDesc[] = { - { "gyrodine.rom", 0x08000, 0x1f10db79, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gyrodinek, MSX_gyrodinek, msx_msx) -STD_ROM_FN(MSX_gyrodinek) - -struct BurnDriver BurnDrvMSX_gyrodinek = { - "msx_gyrodinek", "msx_gyrodine", "msx_msx", NULL, "198?", - "Gyrodine (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gyrodinekRomInfo, MSX_gyrodinekRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// H.E.R.O. (Jpn) - -static struct BurnRomInfo MSX_heroRomDesc[] = { - { "h.e.r.o. (japan).rom", 0x04000, 0x97ab0d70, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hero, MSX_hero, msx_msx) -STD_ROM_FN(MSX_hero) - -struct BurnDriver BurnDrvMSX_hero = { - "msx_hero", NULL, "msx_msx", NULL, "1984", - "H.E.R.O. (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_heroRomInfo, MSX_heroRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hang-On (Jpn) - -static struct BurnRomInfo MSX_hangonRomDesc[] = { - { "hang-on (japan).rom", 0x08000, 0x48e7212c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hangon, MSX_hangon, msx_msx) -STD_ROM_FN(MSX_hangon) - -struct BurnDriver BurnDrvMSX_hangon = { - "msx_hangon", NULL, "msx_msx", NULL, "1986", - "Hang-On (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hangonRomInfo, MSX_hangonRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hang-On (Jpn, Alt) - -static struct BurnRomInfo MSX_hangonaRomDesc[] = { - { "hang-on (japan) (alt 1).rom", 0x08000, 0x1f9bbd9a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hangona, MSX_hangona, msx_msx) -STD_ROM_FN(MSX_hangona) - -struct BurnDriver BurnDrvMSX_hangona = { - "msx_hangona", "msx_hangon", "msx_msx", NULL, "1986", - "Hang-On (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hangonaRomInfo, MSX_hangonaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hang-On (Jpn, Alt 2) - -static struct BurnRomInfo MSX_hangonbRomDesc[] = { - { "hang-on (japan) (alt 2).rom", 0x08000, 0x69dc9f85, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hangonb, MSX_hangonb, msx_msx) -STD_ROM_FN(MSX_hangonb) - -struct BurnDriver BurnDrvMSX_hangonb = { - "msx_hangonb", "msx_hangon", "msx_msx", NULL, "1986", - "Hang-On (Jpn, Alt 2)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hangonbRomInfo, MSX_hangonbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Harapeko Pakkun (Jpn) - -static struct BurnRomInfo MSX_harapekoRomDesc[] = { - { "harapeko pakkun (japan).rom", 0x02000, 0x145bb27b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_harapeko, MSX_harapeko, msx_msx) -STD_ROM_FN(MSX_harapeko) - -struct BurnDriver BurnDrvMSX_harapeko = { - "msx_harapeko", NULL, "msx_msx", NULL, "1984", - "Harapeko Pakkun (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_harapekoRomInfo, MSX_harapekoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Heist (Jpn) - -static struct BurnRomInfo MSX_heistRomDesc[] = { - { "heist, the (japan).rom", 0x08000, 0x04e454c5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_heist, MSX_heist, msx_msx) -STD_ROM_FN(MSX_heist) - -struct BurnDriver BurnDrvMSX_heist = { - "msx_heist", NULL, "msx_msx", NULL, "1985", - "The Heist (Jpn)\0", NULL, "Comptiq", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_heistRomInfo, MSX_heistRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Helitank (Jpn) - -static struct BurnRomInfo MSX_helitankRomDesc[] = { - { "helitank (japan).rom", 0x04000, 0xcd63cd50, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_helitank, MSX_helitank, msx_msx) -STD_ROM_FN(MSX_helitank) - -struct BurnDriver BurnDrvMSX_helitank = { - "msx_helitank", NULL, "msx_msx", NULL, "1984", - "Helitank (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_helitankRomInfo, MSX_helitankRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// High Way Star (Jpn) - -static struct BurnRomInfo MSX_highwayRomDesc[] = { - { "high way star (japan).rom", 0x04000, 0x24851440, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_highway, MSX_highway, msx_msx) -STD_ROM_FN(MSX_highway) - -struct BurnDriver BurnDrvMSX_highway = { - "msx_highway", NULL, "msx_msx", NULL, "1983", - "High Way Star (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_highwayRomInfo, MSX_highwayRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// High Way Star (Kor) - -static struct BurnRomInfo MSX_highwaykRomDesc[] = { - { "high way star (korea).rom", 0x04000, 0xed1625d8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_highwayk, MSX_highwayk, msx_msx) -STD_ROM_FN(MSX_highwayk) - -struct BurnDriver BurnDrvMSX_highwayk = { - "msx_highwayk", "msx_highway", "msx_msx", NULL, "1983", - "High Way Star (Kor)\0", NULL, "Qnix", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_highwaykRomInfo, MSX_highwaykRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hitsuji-Ya (Jpn) - -static struct BurnRomInfo MSX_hitsujiRomDesc[] = { - { "hitsuji yai - preety sheep (japan).rom", 0x02000, 0x11502a96, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hitsuji, MSX_hitsuji, msx_msx) -STD_ROM_FN(MSX_hitsuji) - -struct BurnDriver BurnDrvMSX_hitsuji = { - "msx_hitsuji", NULL, "msx_msx", NULL, "1984", - "Hitsuji-Ya (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hitsujiRomInfo, MSX_hitsujiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hole in One (Jpn) - -static struct BurnRomInfo MSX_holein1RomDesc[] = { - { "hole in one (japan).rom", 0x04000, 0x98e7b01b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_holein1, MSX_holein1, msx_msx) -STD_ROM_FN(MSX_holein1) - -struct BurnDriver BurnDrvMSX_holein1 = { - "msx_holein1", NULL, "msx_msx", NULL, "1984", - "Hole in One (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_holein1RomInfo, MSX_holein1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hole in One (Jpn, Alt) - -static struct BurnRomInfo MSX_holein1aRomDesc[] = { - { "hole in one (japan) (alt 1).rom", 0x04000, 0x86731751, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_holein1a, MSX_holein1a, msx_msx) -STD_ROM_FN(MSX_holein1a) - -struct BurnDriver BurnDrvMSX_holein1a = { - "msx_holein1a", "msx_holein1", "msx_msx", NULL, "1984", - "Hole in One (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_holein1aRomInfo, MSX_holein1aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hole in One (Jpn, Alt 2) - -static struct BurnRomInfo MSX_holein1bRomDesc[] = { - { "hole in one (japan) (alt 2).rom", 0x04000, 0xff063cdb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_holein1b, MSX_holein1b, msx_msx) -STD_ROM_FN(MSX_holein1b) - -struct BurnDriver BurnDrvMSX_holein1b = { - "msx_holein1b", "msx_holein1", "msx_msx", NULL, "1984", - "Hole in One (Jpn, Alt 2)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_holein1bRomInfo, MSX_holein1bRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hole in One (Jpn, Alt 3) - -static struct BurnRomInfo MSX_holein1cRomDesc[] = { - { "hole in one (japan) (alt 3).rom", 0x04000, 0x5bd60572, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_holein1c, MSX_holein1c, msx_msx) -STD_ROM_FN(MSX_holein1c) - -struct BurnDriver BurnDrvMSX_holein1c = { - "msx_holein1c", "msx_holein1", "msx_msx", NULL, "1984", - "Hole in One (Jpn, Alt 3)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_holein1cRomInfo, MSX_holein1cRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hole in One Professional (Jpn) - -static struct BurnRomInfo MSX_holein1pRomDesc[] = { - { "hole in one professional (japan).rom", 0x08000, 0x350ae107, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_holein1p, MSX_holein1p, msx_msx) -STD_ROM_FN(MSX_holein1p) - -struct BurnDriver BurnDrvMSX_holein1p = { - "msx_holein1p", NULL, "msx_msx", NULL, "1985", - "Hole in One Professional (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_holein1pRomInfo, MSX_holein1pRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hole in One Professional (Jpn, Alt) - -static struct BurnRomInfo MSX_holein1paRomDesc[] = { - { "hole in one professional (japan) (alt 1).rom", 0x08000, 0xacfcbba6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_holein1pa, MSX_holein1pa, msx_msx) -STD_ROM_FN(MSX_holein1pa) - -struct BurnDriver BurnDrvMSX_holein1pa = { - "msx_holein1pa", "msx_holein1p", "msx_msx", NULL, "1985", - "Hole in One Professional (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_holein1paRomInfo, MSX_holein1paRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hopper (Euro) - -static struct BurnRomInfo MSX_hopperRomDesc[] = { - { "hopper (europe).rom", 0x04000, 0xd3032ad7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hopper, MSX_hopper, msx_msx) -STD_ROM_FN(MSX_hopper) - -struct BurnDriver BurnDrvMSX_hopper = { - "msx_hopper", NULL, "msx_msx", NULL, "1986", - "Hopper (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hopperRomInfo, MSX_hopperRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hurry Fox MSX Special (Jpn) - -static struct BurnRomInfo MSX_hfoxRomDesc[] = { - { "harryfox msx special (japan).rom", 0x20000, 0x96b7faca, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hfox, MSX_hfox, msx_msx) -STD_ROM_FN(MSX_hfox) - -struct BurnDriver BurnDrvMSX_hfox = { - "msx_hfox", NULL, "msx_msx", NULL, "1986", - "Hurry Fox MSX Special (Jpn)\0", NULL, "MicroCabin", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16_SRAM, GBF_MISC, 0, - MSXGetZipName, MSX_hfoxRomInfo, MSX_hfoxRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hustle! Chumy (Jpn) - -static struct BurnRomInfo MSX_hustleRomDesc[] = { - { "hustle! chumy (japan).rom", 0x04000, 0x99518a12, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hustle, MSX_hustle, msx_msx) -STD_ROM_FN(MSX_hustle) - -struct BurnDriver BurnDrvMSX_hustle = { - "msx_hustle", NULL, "msx_msx", NULL, "1984", - "Hustle! Chumy (Jpn)\0", NULL, "General", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hustleRomInfo, MSX_hustleRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hustle! Chumy (Jpn, Alt) - -static struct BurnRomInfo MSX_hustleaRomDesc[] = { - { "hustle! chumy (japan) (alt 1).rom", 0x04000, 0x22fd4780, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hustlea, MSX_hustlea, msx_msx) -STD_ROM_FN(MSX_hustlea) - -struct BurnDriver BurnDrvMSX_hustlea = { - "msx_hustlea", "msx_hustle", "msx_msx", NULL, "1984", - "Hustle! Chumy (Jpn, Alt)\0", NULL, "General", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hustleaRomInfo, MSX_hustleaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hydlide (Jpn) - -static struct BurnRomInfo MSX_hydlideRomDesc[] = { - { "hydlide (japan).rom", 0x08000, 0x0f9d6f56, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hydlide, MSX_hydlide, msx_msx) -STD_ROM_FN(MSX_hydlide) - -struct BurnDriver BurnDrvMSX_hydlide = { - "msx_hydlide", NULL, "msx_msx", NULL, "1985", - "Hydlide (Jpn)\0", NULL, "T&E Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hydlideRomInfo, MSX_hydlideRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hydlide II - Shine of Darkness (Jpn, Alt) - -static struct BurnRomInfo MSX_hydlide2aRomDesc[] = { - { "hydlide ii - shine of darkness (japan) (alt 1).rom", 0x20000, 0xb886d7f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hydlide2a, MSX_hydlide2a, msx_msx) -STD_ROM_FN(MSX_hydlide2a) - -struct BurnDriver BurnDrvMSX_hydlide2a = { - "msx_hydlide2a", "msx_hydlide2", "msx_msx", NULL, "1986", - "Hydlide II - Shine of Darkness (Jpn, Alt)\0", NULL, "T&E Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16_SRAM, GBF_MISC, 0, - MSXGetZipName, MSX_hydlide2aRomInfo, MSX_hydlide2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Olympic 1 (Jpn) - -static struct BurnRomInfo MSX_hyperol1RomDesc[] = { - { "hyper olympic 1 (japan).rom", 0x04000, 0xfef1d8fa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyperol1, MSX_hyperol1, msx_msx) -STD_ROM_FN(MSX_hyperol1) - -struct BurnDriver BurnDrvMSX_hyperol1 = { - "msx_hyperol1", "msx_trackfld", "msx_msx", NULL, "1984", - "Hyper Olympic 1 (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hyperol1RomInfo, MSX_hyperol1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Olympic 1 (Kor) - -static struct BurnRomInfo MSX_hyperol1kRomDesc[] = { - { "holympic.rom", 0x08000, 0xf36447c5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyperol1k, MSX_hyperol1k, msx_msx) -STD_ROM_FN(MSX_hyperol1k) - -struct BurnDriver BurnDrvMSX_hyperol1k = { - "msx_hyperol1k", "msx_trackfld", "msx_msx", NULL, "198?", - "Hyper Olympic 1 (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hyperol1kRomInfo, MSX_hyperol1kRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Olympic 2 (Jpn) - -static struct BurnRomInfo MSX_hyperol2RomDesc[] = { - { "hyper olympic 2 (japan).rom", 0x04000, 0x38cb690b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyperol2, MSX_hyperol2, msx_msx) -STD_ROM_FN(MSX_hyperol2) - -struct BurnDriver BurnDrvMSX_hyperol2 = { - "msx_hyperol2", "msx_trackfl2", "msx_msx", NULL, "1984", - "Hyper Olympic 2 (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hyperol2RomInfo, MSX_hyperol2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Rally (Jpn) - -static struct BurnRomInfo MSX_hyprallyRomDesc[] = { - { "hyper rally (japan).rom", 0x04000, 0xf94d452e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyprally, MSX_hyprally, msx_msx) -STD_ROM_FN(MSX_hyprally) - -struct BurnDriver BurnDrvMSX_hyprally = { - "msx_hyprally", NULL, "msx_msx", NULL, "1985", - "Hyper Rally (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hyprallyRomInfo, MSX_hyprallyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Rally (Jpn, Alt) - -static struct BurnRomInfo MSX_hyprallyaRomDesc[] = { - { "hyper rally (japan) (alt 1).rom", 0x04000, 0xc575cec6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyprallya, MSX_hyprallya, msx_msx) -STD_ROM_FN(MSX_hyprallya) - -struct BurnDriver BurnDrvMSX_hyprallya = { - "msx_hyprallya", "msx_hyprally", "msx_msx", NULL, "1985", - "Hyper Rally (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hyprallyaRomInfo, MSX_hyprallyaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Rally (Jpn, Alt 2) - -static struct BurnRomInfo MSX_hyprallybRomDesc[] = { - { "hyper rally (japan) (alt 2).rom", 0x04000, 0x75cbb75d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyprallyb, MSX_hyprallyb, msx_msx) -STD_ROM_FN(MSX_hyprallyb) - -struct BurnDriver BurnDrvMSX_hyprallyb = { - "msx_hyprallyb", "msx_hyprally", "msx_msx", NULL, "1985", - "Hyper Rally (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hyprallybRomInfo, MSX_hyprallybRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Rally (Jpn, Alt 3) - -static struct BurnRomInfo MSX_hyprallycRomDesc[] = { - { "hyper rally (japan) (alt 3).rom", 0x04000, 0x0c5957aa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyprallyc, MSX_hyprallyc, msx_msx) -STD_ROM_FN(MSX_hyprallyc) - -struct BurnDriver BurnDrvMSX_hyprallyc = { - "msx_hyprallyc", "msx_hyprally", "msx_msx", NULL, "1985", - "Hyper Rally (Jpn, Alt 3)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hyprallycRomInfo, MSX_hyprallycRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Sports 1 (Jpn) - -static struct BurnRomInfo MSX_hypersptRomDesc[] = { - { "hyper sports 1 (japan).rom", 0x04000, 0x18db4ff2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyperspt, MSX_hyperspt, msx_msx) -STD_ROM_FN(MSX_hyperspt) - -struct BurnDriver BurnDrvMSX_hyperspt = { - "msx_hyperspt", NULL, "msx_msx", NULL, "1984", - "Hyper Sports 1 (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hypersptRomInfo, MSX_hypersptRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Sports 1 (Jpn, Alt) - -static struct BurnRomInfo MSX_hypersptaRomDesc[] = { - { "hyper sports 1 (japan) (alt 1).rom", 0x04000, 0x0b5296f7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyperspta, MSX_hyperspta, msx_msx) -STD_ROM_FN(MSX_hyperspta) - -struct BurnDriver BurnDrvMSX_hyperspta = { - "msx_hyperspta", "msx_hyperspt", "msx_msx", NULL, "1984", - "Hyper Sports 1 (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hypersptaRomInfo, MSX_hypersptaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Sports 2 (Jpn) - -static struct BurnRomInfo MSX_hypersp2RomDesc[] = { - { "hyper sports 2 (japan).rom", 0x04000, 0x968fa8d6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hypersp2, MSX_hypersp2, msx_msx) -STD_ROM_FN(MSX_hypersp2) - -struct BurnDriver BurnDrvMSX_hypersp2 = { - "msx_hypersp2", NULL, "msx_msx", NULL, "1984", - "Hyper Sports 2 (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hypersp2RomInfo, MSX_hypersp2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Sports 2 (Kor) - -static struct BurnRomInfo MSX_hypersp2kRomDesc[] = { - { "hsports2.rom", 0x08000, 0xfc932c9f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hypersp2k, MSX_hypersp2k, msx_msx) -STD_ROM_FN(MSX_hypersp2k) - -struct BurnDriver BurnDrvMSX_hypersp2k = { - "msx_hypersp2k", "msx_hypersp2", "msx_msx", NULL, "198?", - "Hyper Sports 2 (Kor)\0", NULL, "Topia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hypersp2kRomInfo, MSX_hypersp2kRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Sports 3 (Jpn) - -static struct BurnRomInfo MSX_hypersp3RomDesc[] = { - { "hyper sports 3 (japan).rom", 0x08000, 0x80a831e1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hypersp3, MSX_hypersp3, msx_msx) -STD_ROM_FN(MSX_hypersp3) - -struct BurnDriver BurnDrvMSX_hypersp3 = { - "msx_hypersp3", NULL, "msx_msx", NULL, "1985", - "Hyper Sports 3 (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hypersp3RomInfo, MSX_hypersp3RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Sports 3 (Jpn, Alt) - -static struct BurnRomInfo MSX_hypersp3aRomDesc[] = { - { "hyper sports 3 (japan) (alt 1).rom", 0x08000, 0x9f47e445, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hypersp3a, MSX_hypersp3a, msx_msx) -STD_ROM_FN(MSX_hypersp3a) - -struct BurnDriver BurnDrvMSX_hypersp3a = { - "msx_hypersp3a", "msx_hypersp3", "msx_msx", NULL, "1985", - "Hyper Sports 3 (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hypersp3aRomInfo, MSX_hypersp3aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Hyper Sports 3 (Jpn, Alt 2) - -static struct BurnRomInfo MSX_hypersp3bRomDesc[] = { - { "hyper sports 3 (japan) (alt 2).rom", 0x08000, 0xb615c709, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hypersp3b, MSX_hypersp3b, msx_msx) -STD_ROM_FN(MSX_hypersp3b) - -struct BurnDriver BurnDrvMSX_hypersp3b = { - "msx_hypersp3b", "msx_hypersp3", "msx_msx", NULL, "1985", - "Hyper Sports 3 (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hypersp3bRomInfo, MSX_hypersp3bRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ice World (Jpn) - -static struct BurnRomInfo MSX_iceworldRomDesc[] = { - { "ice world (japan).rom", 0x04000, 0x16e7b4be, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_iceworld, MSX_iceworld, msx_msx) -STD_ROM_FN(MSX_iceworld) - -struct BurnDriver BurnDrvMSX_iceworld = { - "msx_iceworld", NULL, "msx_msx", NULL, "1985", - "Ice World (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_iceworldRomInfo, MSX_iceworldRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Iga Ninpouchou (Jpn) - -static struct BurnRomInfo MSX_iganinpoRomDesc[] = { - { "iga ninpouten - small ninja (japan).rom", 0x04000, 0x51727e48, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_iganinpo, MSX_iganinpo, msx_msx) -STD_ROM_FN(MSX_iganinpo) - -struct BurnDriver BurnDrvMSX_iganinpo = { - "msx_iganinpo", NULL, "msx_msx", NULL, "1985", - "Iga Ninpouchou (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_iganinpoRomInfo, MSX_iganinpoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Iga Ninpouchou - Mangetsujou no Tatakai (Jpn) - -static struct BurnRomInfo MSX_iganinp2RomDesc[] = { - { "iga ninpouten 2 - small ninja 2 (japan).rom", 0x08000, 0x4aa97644, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_iganinp2, MSX_iganinp2, msx_msx) -STD_ROM_FN(MSX_iganinp2) - -struct BurnDriver BurnDrvMSX_iganinp2 = { - "msx_iganinp2", NULL, "msx_msx", NULL, "1986", - "Iga Ninpouchou - Mangetsujou no Tatakai (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_iganinp2RomInfo, MSX_iganinp2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Indian no Bouken (Jpn) - -static struct BurnRomInfo MSX_indianbRomDesc[] = { - { "indian no bouken (japan).rom", 0x04000, 0x3a550788, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_indianb, MSX_indianb, msx_msx) -STD_ROM_FN(MSX_indianb) - -struct BurnDriver BurnDrvMSX_indianb = { - "msx_indianb", NULL, "msx_msx", NULL, "1983", - "Indian no Bouken (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_indianbRomInfo, MSX_indianbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Theseus - Iligks I (Jpn) - -static struct BurnRomInfo MSX_theseusRomDesc[] = { - { "iriegas - theseus (japan).rom", 0x04000, 0x80495007, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_theseus, MSX_theseus, msx_msx) -STD_ROM_FN(MSX_theseus) - -struct BurnDriver BurnDrvMSX_theseus = { - "msx_theseus", NULL, "msx_msx", NULL, "1984", - "Theseus - Iligks I (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_theseusRomInfo, MSX_theseusRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Theseus - Iligks I (Jpn, Alt) - -static struct BurnRomInfo MSX_theseusaRomDesc[] = { - { "iriegas - theseus (japan) (alt 1).rom", 0x04000, 0x53236741, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_theseusa, MSX_theseusa, msx_msx) -STD_ROM_FN(MSX_theseusa) - -struct BurnDriver BurnDrvMSX_theseusa = { - "msx_theseusa", "msx_theseus", "msx_msx", NULL, "1984", - "Theseus - Iligks I (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_theseusaRomInfo, MSX_theseusaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Theseus - Iligks I (Kor) - -static struct BurnRomInfo MSX_theseuskRomDesc[] = { - { "theseus.rom", 0x04000, 0x6235de29, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_theseusk, MSX_theseusk, msx_msx) -STD_ROM_FN(MSX_theseusk) - -struct BurnDriver BurnDrvMSX_theseusk = { - "msx_theseusk", "msx_theseus", "msx_msx", NULL, "198?", - "Theseus - Iligks I (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_theseuskRomInfo, MSX_theseuskRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Issunboushi no Donnamondai (Jpn) - -static struct BurnRomInfo MSX_issunRomDesc[] = { - { "issunhoushi no donnamondai (japan).rom", 0x08000, 0xa7c43855, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_issun, MSX_issun, msx_msx) -STD_ROM_FN(MSX_issun) - -struct BurnDriver BurnDrvMSX_issun = { - "msx_issun", NULL, "msx_msx", NULL, "1987", - "Issunboushi no Donnamondai (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_issunRomInfo, MSX_issunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Issunboushi no Donnamondai (Jpn, Alt) - -static struct BurnRomInfo MSX_issunaRomDesc[] = { - { "issunhoushi no donnamondai (japan) (alt 1).rom", 0x08000, 0x2a285706, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_issuna, MSX_issuna, msx_msx) -STD_ROM_FN(MSX_issuna) - -struct BurnDriver BurnDrvMSX_issuna = { - "msx_issuna", "msx_issun", "msx_msx", NULL, "1987", - "Issunboushi no Donnamondai (Jpn, Alt)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_issunaRomInfo, MSX_issunaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Issunboushi no Donnamondai (Jpn, Hacked?) - -static struct BurnRomInfo MSX_issunhRomDesc[] = { - { "issunhoushi no donnamondai. little samurai (1987)(casio)[cr angel].rom", 0x08000, 0x5b66062b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_issunh, MSX_issunh, msx_msx) -STD_ROM_FN(MSX_issunh) - -struct BurnDriver BurnDrvMSX_issunh = { - "msx_issunh", "msx_issun", "msx_msx", NULL, "1987", - "Issunboushi no Donnamondai (Jpn, Hacked?)\0", NULL, "Angel?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_issunhRomInfo, MSX_issunhRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// J.P. Winkle (Jpn) - -static struct BurnRomInfo MSX_jpwinkleRomDesc[] = { - { "j.p. winkle (japan).rom", 0x08000, 0x57e1221c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jpwinkle, MSX_jpwinkle, msx_msx) -STD_ROM_FN(MSX_jpwinkle) - -struct BurnDriver BurnDrvMSX_jpwinkle = { - "msx_jpwinkle", NULL, "msx_msx", NULL, "1986", - "J.P. Winkle (Jpn)\0", NULL, "ASCII ~ MSX Magazine", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jpwinkleRomInfo, MSX_jpwinkleRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// J.P. Winkle (Kor) - -static struct BurnRomInfo MSX_jpwinklekRomDesc[] = { - { "jpwinkle.rom", 0x08000, 0x1bc4132b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jpwinklek, MSX_jpwinklek, msx_msx) -STD_ROM_FN(MSX_jpwinklek) - -struct BurnDriver BurnDrvMSX_jpwinklek = { - "msx_jpwinklek", "msx_jpwinkle", "msx_msx", NULL, "198?", - "J.P. Winkle (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jpwinklekRomInfo, MSX_jpwinklekRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Jagur (Jpn, Alt) - -static struct BurnRomInfo MSX_jaguraRomDesc[] = { - { "jagur (japan) (alt 1).rom", 0x20000, 0xdbf2f244, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jagura, MSX_jagura, msx_msx) -STD_ROM_FN(MSX_jagura) - -struct BurnDriver BurnDrvMSX_jagura = { - "msx_jagura", "msx_jagur", "msx_msx", NULL, "1987", - "Jagur (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_jaguraRomInfo, MSX_jaguraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Jet Set Willy (Jpn) - -static struct BurnRomInfo MSX_jetsetwRomDesc[] = { - { "jet set willy (japan).rom", 0x04000, 0x9191c890, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jetsetw, MSX_jetsetw, msx_msx) -STD_ROM_FN(MSX_jetsetw) - -struct BurnDriver BurnDrvMSX_jetsetw = { - "msx_jetsetw", NULL, "msx_msx", NULL, "1985", - "Jet Set Willy (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jetsetwRomInfo, MSX_jetsetwRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Jet Set Willy (Jpn, Alt) - -static struct BurnRomInfo MSX_jetsetwaRomDesc[] = { - { "jet set willy (japan) (alt 1).rom", 0x04000, 0x6e57f290, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jetsetwa, MSX_jetsetwa, msx_msx) -STD_ROM_FN(MSX_jetsetwa) - -struct BurnDriver BurnDrvMSX_jetsetwa = { - "msx_jetsetwa", "msx_jetsetw", "msx_msx", NULL, "1985", - "Jet Set Willy (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jetsetwaRomInfo, MSX_jetsetwaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Jump (Jpn) - -static struct BurnRomInfo MSX_jumpRomDesc[] = { - { "jump (japan).rom", 0x04000, 0x0599617b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jump, MSX_jump, msx_msx) -STD_ROM_FN(MSX_jump) - -struct BurnDriver BurnDrvMSX_jump = { - "msx_jump", NULL, "msx_msx", NULL, "1985", - "Jump (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jumpRomInfo, MSX_jumpRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Jump Coaster (Jpn) - -static struct BurnRomInfo MSX_jumpcstrRomDesc[] = { - { "jump coaster (japan).rom", 0x02000, 0xc15a25da, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jumpcstr, MSX_jumpcstr, msx_msx) -STD_ROM_FN(MSX_jumpcstr) - -struct BurnDriver BurnDrvMSX_jumpcstr = { - "msx_jumpcstr", NULL, "msx_msx", NULL, "1984", - "Jump Coaster (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jumpcstrRomInfo, MSX_jumpcstrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Juno First (Jpn) - -static struct BurnRomInfo MSX_junofrstRomDesc[] = { - { "juno first (japan).rom", 0x02000, 0xea67df20, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_junofrst, MSX_junofrst, msx_msx) -STD_ROM_FN(MSX_junofrst) - -struct BurnDriver BurnDrvMSX_junofrst = { - "msx_junofrst", NULL, "msx_msx", NULL, "1983", - "Juno First (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_junofrstRomInfo, MSX_junofrstRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kage no Densetsu - The Legend of Kage (Jpn) - -static struct BurnRomInfo MSX_legkageRomDesc[] = { - { "kage no densetsu - legend of kage, the (japan).rom", 0x08000, 0x69367e10, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_legkage, MSX_legkage, msx_msx) -STD_ROM_FN(MSX_legkage) - -struct BurnDriver BurnDrvMSX_legkage = { - "msx_legkage", NULL, "msx_msx", NULL, "1986", - "Kage no Densetsu - The Legend of Kage (Jpn)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_legkageRomInfo, MSX_legkageRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Karamaru - Chindou Chuu (Jpn) - -static struct BurnRomInfo MSX_karamaruRomDesc[] = { - { "karamaru (japan).rom", 0x04000, 0x12be29fc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_karamaru, MSX_karamaru, msx_msx) -STD_ROM_FN(MSX_karamaru) - -struct BurnDriver BurnDrvMSX_karamaru = { - "msx_karamaru", NULL, "msx_msx", NULL, "1985", - "Karamaru - Chindou Chuu (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_karamaruRomInfo, MSX_karamaruRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Keystone Kapers (Jpn) - -static struct BurnRomInfo MSX_keykaperRomDesc[] = { - { "keystone kapers (japan).rom", 0x04000, 0xb1cf2097, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_keykaper, MSX_keykaper, msx_msx) -STD_ROM_FN(MSX_keykaper) - -struct BurnDriver BurnDrvMSX_keykaper = { - "msx_keykaper", NULL, "msx_msx", NULL, "1984", - "Keystone Kapers (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_keykaperRomInfo, MSX_keykaperRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kick It (Jpn) - -static struct BurnRomInfo MSX_kickitRomDesc[] = { - { "kick it (japan).rom", 0x08000, 0xe4f63cb7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kickit, MSX_kickit, msx_msx) -STD_ROM_FN(MSX_kickit) - -struct BurnDriver BurnDrvMSX_kickit = { - "msx_kickit", NULL, "msx_msx", NULL, "1986", - "Kick It (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kickitRomInfo, MSX_kickitRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kick It (Jpn, Alt) - -static struct BurnRomInfo MSX_kickitaRomDesc[] = { - { "kick it (japan) (alt 1).rom", 0x08000, 0x3424a220, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kickita, MSX_kickita, msx_msx) -STD_ROM_FN(MSX_kickita) - -struct BurnDriver BurnDrvMSX_kickita = { - "msx_kickita", "msx_kickit", "msx_msx", NULL, "1986", - "Kick It (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kickitaRomInfo, MSX_kickitaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King & Balloon (Jpn) - -static struct BurnRomInfo MSX_kingballRomDesc[] = { - { "king & balloon (japan).rom", 0x08000, 0x2aba2253, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingball, MSX_kingball, msx_msx) -STD_ROM_FN(MSX_kingball) - -struct BurnDriver BurnDrvMSX_kingball = { - "msx_kingball", NULL, "msx_msx", NULL, "1984", - "King & Balloon (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kingballRomInfo, MSX_kingballRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King & Balloon (Jpn, Alt) - -static struct BurnRomInfo MSX_kingballaRomDesc[] = { - { "king & balloon (japan) (alt 1).rom", 0x04000, 0x1eeba987, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingballa, MSX_kingballa, msx_msx) -STD_ROM_FN(MSX_kingballa) - -struct BurnDriver BurnDrvMSX_kingballa = { - "msx_kingballa", "msx_kingball", "msx_msx", NULL, "1984", - "King & Balloon (Jpn, Alt)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kingballaRomInfo, MSX_kingballaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King's Knight (Jpn, Alt) - -static struct BurnRomInfo MSX_kingkngtaRomDesc[] = { - { "king knight (japan) (alt 1).rom", 0x20000, 0x4d884352, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingkngta, MSX_kingkngta, msx_msx) -STD_ROM_FN(MSX_kingkngta) - -struct BurnDriver BurnDrvMSX_kingkngta = { - "msx_kingkngta", "msx_kingkngt", "msx_msx", NULL, "1986", - "King's Knight (Jpn, Alt)\0", NULL, "Square", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_kingkngtaRomInfo, MSX_kingkngtaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King's Knight (Jpn, Alt 2) - -static struct BurnRomInfo MSX_kingkngtbRomDesc[] = { - { "king knight (japan) (alt 2).rom", 0x20000, 0xab6cd62c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingkngtb, MSX_kingkngtb, msx_msx) -STD_ROM_FN(MSX_kingkngtb) - -struct BurnDriver BurnDrvMSX_kingkngtb = { - "msx_kingkngtb", "msx_kingkngt", "msx_msx", NULL, "1986", - "King's Knight (Jpn, Alt 2)\0", NULL, "Square", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_kingkngtbRomInfo, MSX_kingkngtbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King's Valley (Euro, Jpn) - -static struct BurnRomInfo MSX_kingvalRomDesc[] = { - { "king's valley (japan, europe).rom", 0x04000, 0xdfac2125, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingval, MSX_kingval, msx_msx) -STD_ROM_FN(MSX_kingval) - -struct BurnDriver BurnDrvMSX_kingval = { - "msx_kingval", NULL, "msx_msx", NULL, "1985", - "King's Valley (Euro, Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kingvalRomInfo, MSX_kingvalRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King's Valley (Euro, Jpn, Alt) - -static struct BurnRomInfo MSX_kingvalaRomDesc[] = { - { "king's valley (japan, europe) (alt 1).rom", 0x04000, 0x5a141c44, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingvala, MSX_kingvala, msx_msx) -STD_ROM_FN(MSX_kingvala) - -struct BurnDriver BurnDrvMSX_kingvala = { - "msx_kingvala", "msx_kingval", "msx_msx", NULL, "1985", - "King's Valley (Euro, Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kingvalaRomInfo, MSX_kingvalaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King's Valley (Euro, Jpn, Alt 2) - -static struct BurnRomInfo MSX_kingvalbRomDesc[] = { - { "king's valley (japan, europe) (alt 2).rom", 0x04000, 0xe7c3e1b7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingvalb, MSX_kingvalb, msx_msx) -STD_ROM_FN(MSX_kingvalb) - -struct BurnDriver BurnDrvMSX_kingvalb = { - "msx_kingvalb", "msx_kingval", "msx_msx", NULL, "1985", - "King's Valley (Euro, Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kingvalbRomInfo, MSX_kingvalbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King's Valley (Euro, Jpn, Alt 3) - -static struct BurnRomInfo MSX_kingvalcRomDesc[] = { - { "king's valley (japan, europe) (alt 3).rom", 0x04000, 0x201d7691, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingvalc, MSX_kingvalc, msx_msx) -STD_ROM_FN(MSX_kingvalc) - -struct BurnDriver BurnDrvMSX_kingvalc = { - "msx_kingvalc", "msx_kingval", "msx_msx", NULL, "1985", - "King's Valley (Euro, Jpn, Alt 3)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kingvalcRomInfo, MSX_kingvalcRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King's Valley (Euro, Jpn, Alt 4) - -static struct BurnRomInfo MSX_kingvaldRomDesc[] = { - { "king's valley (japan, europe) (alt 4).rom", 0x04000, 0x627bdcd6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingvald, MSX_kingvald, msx_msx) -STD_ROM_FN(MSX_kingvald) - -struct BurnDriver BurnDrvMSX_kingvald = { - "msx_kingvald", "msx_kingval", "msx_msx", NULL, "1985", - "King's Valley (Euro, Jpn, Alt 4)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kingvaldRomInfo, MSX_kingvaldRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// King's Valley II (Euro) ~ Ouke no Tani - El Giza no Fuuin (Jpn) - -static struct BurnRomInfo MSX_kingval2RomDesc[] = { - { "king's valley ii (japan, europe).rom", 0x20000, 0xe82a8e8e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingval2, MSX_kingval2, msx_msx) -STD_ROM_FN(MSX_kingval2) - -struct BurnDriver BurnDrvMSX_kingval2 = { - "msx_kingval2", NULL, "msx_msx", NULL, "1988", - "King's Valley II (Euro) ~ Ouke no Tani - El Giza no Fuuin (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_kingval2RomInfo, MSX_kingval2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kinnikuman - Colosseum Deathmatch (Jpn) - -static struct BurnRomInfo MSX_kinnikumRomDesc[] = { - { "kinnikuman - muscle man (japan).rom", 0x08000, 0x166781b7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kinnikum, MSX_kinnikum, msx_msx) -STD_ROM_FN(MSX_kinnikum) - -struct BurnDriver BurnDrvMSX_kinnikum = { - "msx_kinnikum", NULL, "msx_msx", NULL, "1985", - "Kinnikuman - Colosseum Deathmatch (Jpn)\0", NULL, "Bandai", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kinnikumRomInfo, MSX_kinnikumRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kinnikuman - Colosseum Deathmatch (Jpn, Alt) - -static struct BurnRomInfo MSX_kinnikumaRomDesc[] = { - { "kinnikuman - muscle man (japan) (alt 1).rom", 0x08000, 0x500d112d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kinnikuma, MSX_kinnikuma, msx_msx) -STD_ROM_FN(MSX_kinnikuma) - -struct BurnDriver BurnDrvMSX_kinnikuma = { - "msx_kinnikuma", "msx_kinnikum", "msx_msx", NULL, "1985", - "Kinnikuman - Colosseum Deathmatch (Jpn, Alt)\0", NULL, "Bandai", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kinnikumaRomInfo, MSX_kinnikumaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kinnikuman - Colosseum Deathmatch (Kor) - -static struct BurnRomInfo MSX_kinnikumkRomDesc[] = { - { "wrestling.rom", 0x08000, 0x36ed61af, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kinnikumk, MSX_kinnikumk, msx_msx) -STD_ROM_FN(MSX_kinnikumk) - -struct BurnDriver BurnDrvMSX_kinnikumk = { - "msx_kinnikumk", "msx_kinnikum", "msx_msx", NULL, "198?", - "Kinnikuman - Colosseum Deathmatch (Kor)\0", NULL, "San Ho", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kinnikumkRomInfo, MSX_kinnikumkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knight Lore (Jpn) - -static struct BurnRomInfo MSX_knightlrRomDesc[] = { - { "knight lore (japan).rom", 0x08000, 0xb575c44a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knightlr, MSX_knightlr, msx_msx) -STD_ROM_FN(MSX_knightlr) - -struct BurnDriver BurnDrvMSX_knightlr = { - "msx_knightlr", NULL, "msx_msx", NULL, "1986", - "Knight Lore (Jpn)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_knightlrRomInfo, MSX_knightlrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knightmare - Majou Densetsu (Jpn) - -static struct BurnRomInfo MSX_knightmrRomDesc[] = { - { "knightmare - majou densetsu (japan).rom", 0x08000, 0x0db84205, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knightmr, MSX_knightmr, msx_msx) -STD_ROM_FN(MSX_knightmr) - -struct BurnDriver BurnDrvMSX_knightmr = { - "msx_knightmr", NULL, "msx_msx", NULL, "1986", - "Knightmare - Majou Densetsu (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_knightmrRomInfo, MSX_knightmrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knightmare - Majou Densetsu (Jpn, Alt) - -static struct BurnRomInfo MSX_knightmraRomDesc[] = { - { "knightmare - majou densetsu (japan) (alt 1).rom", 0x08000, 0xca9f791b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knightmra, MSX_knightmra, msx_msx) -STD_ROM_FN(MSX_knightmra) - -struct BurnDriver BurnDrvMSX_knightmra = { - "msx_knightmra", "msx_knightmr", "msx_msx", NULL, "1986", - "Knightmare - Majou Densetsu (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_knightmraRomInfo, MSX_knightmraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knightmare - Majou Densetsu (Jpn, Alt 2) - -static struct BurnRomInfo MSX_knightmrbRomDesc[] = { - { "knightmare - majou densetsu (japan) (alt 2).rom", 0x08000, 0x5876a372, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knightmrb, MSX_knightmrb, msx_msx) -STD_ROM_FN(MSX_knightmrb) - -struct BurnDriver BurnDrvMSX_knightmrb = { - "msx_knightmrb", "msx_knightmr", "msx_msx", NULL, "1986", - "Knightmare - Majou Densetsu (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_knightmrbRomInfo, MSX_knightmrbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knightmare - Majou Densetsu (Kor) - -static struct BurnRomInfo MSX_knightmrkRomDesc[] = { - { "knightma.rom", 0x08000, 0xb9819ea6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knightmrk, MSX_knightmrk, msx_msx) -STD_ROM_FN(MSX_knightmrk) - -struct BurnDriver BurnDrvMSX_knightmrk = { - "msx_knightmrk", "msx_knightmr", "msx_msx", NULL, "198?", - "Knightmare - Majou Densetsu (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_knightmrkRomInfo, MSX_knightmrkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knightmare II - The Maze of Galious (Jpn) - -static struct BurnRomInfo MSX_knightm2RomDesc[] = { - { "knightmare ii - the maze of galious (japan).rom", 0x20000, 0xfe23d253, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knightm2, MSX_knightm2, msx_msx) -STD_ROM_FN(MSX_knightm2) - -struct BurnDriver BurnDrvMSX_knightm2 = { - "msx_knightm2", NULL, "msx_msx", NULL, "1987", - "Knightmare II - The Maze of Galious (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_knightm2RomInfo, MSX_knightm2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knightmare II - The Maze of Galious (Kor) - -static struct BurnRomInfo MSX_knightm2kRomDesc[] = { - { "knightmare ii - the maze of galious (1987)(zemina)[rc-749].rom", 0x20000, 0xd7f35938, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knightm2k, MSX_knightm2k, msx_msx) -STD_ROM_FN(MSX_knightm2k) - -struct BurnDriver BurnDrvMSX_knightm2k = { - "msx_knightm2k", "msx_knightm2", "msx_msx", NULL, "1987", - "Knightmare II - The Maze of Galious (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_knightm2kRomInfo, MSX_knightm2kRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knightmare III - Shalom (Jpn) - -static struct BurnRomInfo MSX_knightm3RomDesc[] = { - { "knightmare iii - shalom (japan).rom", 0x40000, 0xcf60fa7d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knightm3, MSX_knightm3, msx_msx) -STD_ROM_FN(MSX_knightm3) - -struct BurnDriver BurnDrvMSX_knightm3 = { - "msx_knightm3", NULL, "msx_msx", NULL, "1987", - "Knightmare III - Shalom (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_knightm3RomInfo, MSX_knightm3RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knither Special (Jpn) - -static struct BurnRomInfo MSX_knithersRomDesc[] = { - { "knither special (japan).rom", 0x20000, 0xa3b2fe71, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knithers, MSX_knithers, msx_msx) -STD_ROM_FN(MSX_knithers) - -struct BurnDriver BurnDrvMSX_knithers = { - "msx_knithers", NULL, "msx_msx", NULL, "1987", - "Knither Special (Jpn)\0", NULL, "Dempa", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_knithersRomInfo, MSX_knithersRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Knuckle Joe (Kor) - -static struct BurnRomInfo MSX_knucklejRomDesc[] = { - { "knuckle joe.rom", 0x08000, 0x33be6192, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_knucklej, MSX_knucklej, msx_msx) -STD_ROM_FN(MSX_knucklej) - -struct BurnDriver BurnDrvMSX_knucklej = { - "msx_knucklej", NULL, "msx_msx", NULL, "1989", - "Knuckle Joe (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_knucklejRomInfo, MSX_knucklejRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Koedoli (Kor) - -static struct BurnRomInfo MSX_koedoliRomDesc[] = { - { "koedoli (mickey soft, 1988).rom", 0x08000, 0xcb345bcc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_koedoli, MSX_koedoli, msx_msx) -STD_ROM_FN(MSX_koedoli) - -struct BurnDriver BurnDrvMSX_koedoli = { - "msx_koedoli", NULL, "msx_msx", NULL, "1988", - "Koedoli (Kor)\0", NULL, "Aproman", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_koedoliRomInfo, MSX_koedoliRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Baseball (Jpn) - -static struct BurnRomInfo MSX_konbballRomDesc[] = { - { "konami's baseball (japan).rom", 0x04000, 0xb660494b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konbball, MSX_konbball, msx_msx) -STD_ROM_FN(MSX_konbball) - -struct BurnDriver BurnDrvMSX_konbball = { - "msx_konbball", NULL, "msx_msx", NULL, "1985", - "Konami's Baseball (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konbballRomInfo, MSX_konbballRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Baseball (Jpn, Alt) - -static struct BurnRomInfo MSX_konbballaRomDesc[] = { - { "konami's baseball (japan) (alt 1).rom", 0x04000, 0x6a8e56e1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konbballa, MSX_konbballa, msx_msx) -STD_ROM_FN(MSX_konbballa) - -struct BurnDriver BurnDrvMSX_konbballa = { - "msx_konbballa", "msx_konbball", "msx_msx", NULL, "1985", - "Konami's Baseball (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konbballaRomInfo, MSX_konbballaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Billiards (Euro) - -static struct BurnRomInfo MSX_konbillRomDesc[] = { - { "konami's billiards (europe).rom", 0x02000, 0x0b65fe4d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konbill, MSX_konbill, msx_msx) -STD_ROM_FN(MSX_konbill) - -struct BurnDriver BurnDrvMSX_konbill = { - "msx_konbill", NULL, "msx_msx", NULL, "1984", - "Konami's Billiards (Euro)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konbillRomInfo, MSX_konbillRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Boxing (Jpn) - -static struct BurnRomInfo MSX_konboxinRomDesc[] = { - { "konami's boxing (japan).rom", 0x08000, 0x3a442408, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konboxin, MSX_konboxin, msx_msx) -STD_ROM_FN(MSX_konboxin) - -struct BurnDriver BurnDrvMSX_konboxin = { - "msx_konboxin", NULL, "msx_msx", NULL, "1985", - "Konami's Boxing (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konboxinRomInfo, MSX_konboxinRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Boxing (Jpn, Alt) - -static struct BurnRomInfo MSX_konboxinaRomDesc[] = { - { "konami's boxing (japan) (alt 1).rom", 0x08000, 0x19ccbce1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konboxina, MSX_konboxina, msx_msx) -STD_ROM_FN(MSX_konboxina) - -struct BurnDriver BurnDrvMSX_konboxina = { - "msx_konboxina", "msx_konboxin", "msx_msx", NULL, "1985", - "Konami's Boxing (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konboxinaRomInfo, MSX_konboxinaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Boxing (Jpn, Alt 2) - -static struct BurnRomInfo MSX_konboxinbRomDesc[] = { - { "konami's boxing (japan) (alt 2).rom", 0x08000, 0x0d94e7b2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konboxinb, MSX_konboxinb, msx_msx) -STD_ROM_FN(MSX_konboxinb) - -struct BurnDriver BurnDrvMSX_konboxinb = { - "msx_konboxinb", "msx_konboxin", "msx_msx", NULL, "1985", - "Konami's Boxing (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konboxinbRomInfo, MSX_konboxinbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Football (Euro) - -static struct BurnRomInfo MSX_konfootbRomDesc[] = { - { "konami's football (europe).rom", 0x08000, 0xba1b16fc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konfootb, MSX_konfootb, msx_msx) -STD_ROM_FN(MSX_konfootb) - -struct BurnDriver BurnDrvMSX_konfootb = { - "msx_konfootb", NULL, "msx_msx", NULL, "1985", - "Konami's Football (Euro)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konfootbRomInfo, MSX_konfootbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Football (Euro, Alt) - -static struct BurnRomInfo MSX_konfootbaRomDesc[] = { - { "konami's football (europe) (alt 1).rom", 0x08000, 0x93604c07, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konfootba, MSX_konfootba, msx_msx) -STD_ROM_FN(MSX_konfootba) - -struct BurnDriver BurnDrvMSX_konfootba = { - "msx_konfootba", "msx_konfootb", "msx_msx", NULL, "1985", - "Konami's Football (Euro, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konfootbaRomInfo, MSX_konfootbaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Football (Euro, Alt 2) - -static struct BurnRomInfo MSX_konfootbbRomDesc[] = { - { "konami's football (europe) (alt 2).rom", 0x08000, 0xc700fc49, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konfootbb, MSX_konfootbb, msx_msx) -STD_ROM_FN(MSX_konfootbb) - -struct BurnDriver BurnDrvMSX_konfootbb = { - "msx_konfootbb", "msx_konfootb", "msx_msx", NULL, "1985", - "Konami's Football (Euro, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konfootbbRomInfo, MSX_konfootbbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Golf (Jpn) - -static struct BurnRomInfo MSX_kongolfRomDesc[] = { - { "konami's golf (japan).rom", 0x04000, 0x08c7e406, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kongolf, MSX_kongolf, msx_msx) -STD_ROM_FN(MSX_kongolf) - -struct BurnDriver BurnDrvMSX_kongolf = { - "msx_kongolf", NULL, "msx_msx", NULL, "1985", - "Konami's Golf (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kongolfRomInfo, MSX_kongolfRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Golf (Jpn, Alt) - -static struct BurnRomInfo MSX_kongolfaRomDesc[] = { - { "konami's golf (japan) (alt 1).rom", 0x04000, 0x0e3380fe, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kongolfa, MSX_kongolfa, msx_msx) -STD_ROM_FN(MSX_kongolfa) - -struct BurnDriver BurnDrvMSX_kongolfa = { - "msx_kongolfa", "msx_kongolf", "msx_msx", NULL, "1985", - "Konami's Golf (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kongolfaRomInfo, MSX_kongolfaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Golf (Jpn, Alt 2) - -static struct BurnRomInfo MSX_kongolfbRomDesc[] = { - { "konami's golf (japan) (alt 2).rom", 0x04000, 0xf06befd3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kongolfb, MSX_kongolfb, msx_msx) -STD_ROM_FN(MSX_kongolfb) - -struct BurnDriver BurnDrvMSX_kongolfb = { - "msx_kongolfb", "msx_kongolf", "msx_msx", NULL, "1985", - "Konami's Golf (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kongolfbRomInfo, MSX_kongolfbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mahjong Dojo (Jpn) - -static struct BurnRomInfo MSX_mjdojoRomDesc[] = { - { "konami's mahjong (japan).rom", 0x08000, 0x114198e5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mjdojo, MSX_mjdojo, msx_msx) -STD_ROM_FN(MSX_mjdojo) - -struct BurnDriver BurnDrvMSX_mjdojo = { - "msx_mjdojo", NULL, "msx_msx", NULL, "1984", - "Mahjong Dojo (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mjdojoRomInfo, MSX_mjdojoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Ping-Pong (Jpn) - -static struct BurnRomInfo MSX_pingpongRomDesc[] = { - { "konami's ping-pong (japan).rom", 0x04000, 0x3f200491, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pingpong, MSX_pingpong, msx_msx) -STD_ROM_FN(MSX_pingpong) - -struct BurnDriver BurnDrvMSX_pingpong = { - "msx_pingpong", NULL, "msx_msx", NULL, "1985", - "Konami's Ping-Pong (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pingpongRomInfo, MSX_pingpongRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Ping-Pong (Jpn, Alt) - -static struct BurnRomInfo MSX_pingpongaRomDesc[] = { - { "konami's ping-pong (japan) (alt 1).rom", 0x04000, 0xbbcdd731, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pingponga, MSX_pingponga, msx_msx) -STD_ROM_FN(MSX_pingponga) - -struct BurnDriver BurnDrvMSX_pingponga = { - "msx_pingponga", "msx_pingpong", "msx_msx", NULL, "1985", - "Konami's Ping-Pong (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pingpongaRomInfo, MSX_pingpongaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Ping-Pong (Jpn, Alt 2) - -static struct BurnRomInfo MSX_pingpongbRomDesc[] = { - { "konami's ping-pong (japan) (alt 2).rom", 0x04000, 0xa4d465a4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pingpongb, MSX_pingpongb, msx_msx) -STD_ROM_FN(MSX_pingpongb) - -struct BurnDriver BurnDrvMSX_pingpongb = { - "msx_pingpongb", "msx_pingpong", "msx_msx", NULL, "1985", - "Konami's Ping-Pong (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pingpongbRomInfo, MSX_pingpongbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Ping-Pong (Jpn, Alt 3) - -static struct BurnRomInfo MSX_pingpongcRomDesc[] = { - { "konami's ping-pong (japan) (alt 3).rom", 0x04000, 0x2829a061, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pingpongc, MSX_pingpongc, msx_msx) -STD_ROM_FN(MSX_pingpongc) - -struct BurnDriver BurnDrvMSX_pingpongc = { - "msx_pingpongc", "msx_pingpong", "msx_msx", NULL, "1985", - "Konami's Ping-Pong (Jpn, Alt 3)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pingpongcRomInfo, MSX_pingpongcRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Ping-Pong (Kor) - -static struct BurnRomInfo MSX_pingpongkRomDesc[] = { - { "pingpong.rom", 0x08000, 0x67a1ba79, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pingpongk, MSX_pingpongk, msx_msx) -STD_ROM_FN(MSX_pingpongk) - -struct BurnDriver BurnDrvMSX_pingpongk = { - "msx_pingpongk", "msx_pingpong", "msx_msx", NULL, "198?", - "Konami's Ping-Pong (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pingpongkRomInfo, MSX_pingpongkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Soccer (Jpn) - -static struct BurnRomInfo MSX_konsoccrRomDesc[] = { - { "konami's soccer (japan).rom", 0x08000, 0x74bc8295, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konsoccr, MSX_konsoccr, msx_msx) -STD_ROM_FN(MSX_konsoccr) - -struct BurnDriver BurnDrvMSX_konsoccr = { - "msx_konsoccr", "msx_konfootb", "msx_msx", NULL, "1985", - "Konami's Soccer (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konsoccrRomInfo, MSX_konsoccrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Soccer (Jpn, Alt) - -static struct BurnRomInfo MSX_konsoccraRomDesc[] = { - { "konami's soccer (japan) (alt 1).rom", 0x08000, 0x58ea53b9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konsoccra, MSX_konsoccra, msx_msx) -STD_ROM_FN(MSX_konsoccra) - -struct BurnDriver BurnDrvMSX_konsoccra = { - "msx_konsoccra", "msx_konfootb", "msx_msx", NULL, "1985", - "Konami's Soccer (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konsoccraRomInfo, MSX_konsoccraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Soccer (Jpn, Alt 2) - -static struct BurnRomInfo MSX_konsoccrbRomDesc[] = { - { "konami's soccer (japan) (alt 2).rom", 0x08000, 0xe861d2bd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konsoccrb, MSX_konsoccrb, msx_msx) -STD_ROM_FN(MSX_konsoccrb) - -struct BurnDriver BurnDrvMSX_konsoccrb = { - "msx_konsoccrb", "msx_konfootb", "msx_msx", NULL, "1985", - "Konami's Soccer (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konsoccrbRomInfo, MSX_konsoccrbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Soccer (Jpn, Alt 3) - -static struct BurnRomInfo MSX_konsoccrcRomDesc[] = { - { "konami's soccer (japan) (alt 3).rom", 0x08000, 0xccfb0ca2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_konsoccrc, MSX_konsoccrc, msx_msx) -STD_ROM_FN(MSX_konsoccrc) - -struct BurnDriver BurnDrvMSX_konsoccrc = { - "msx_konsoccrc", "msx_konfootb", "msx_msx", NULL, "1985", - "Konami's Soccer (Jpn, Alt 3)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konsoccrcRomInfo, MSX_konsoccrcRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Tennis (Jpn) - -static struct BurnRomInfo MSX_kontennRomDesc[] = { - { "konami's tennis (japan).rom", 0x04000, 0x61726be4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kontenn, MSX_kontenn, msx_msx) -STD_ROM_FN(MSX_kontenn) - -struct BurnDriver BurnDrvMSX_kontenn = { - "msx_kontenn", NULL, "msx_msx", NULL, "1985", - "Konami's Tennis (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kontennRomInfo, MSX_kontennRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Tennis (Jpn, Alt) - -static struct BurnRomInfo MSX_kontennaRomDesc[] = { - { "konami's tennis (japan) (alt 1).rom", 0x04000, 0xcfce0a28, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kontenna, MSX_kontenna, msx_msx) -STD_ROM_FN(MSX_kontenna) - -struct BurnDriver BurnDrvMSX_kontenna = { - "msx_kontenna", "msx_kontenn", "msx_msx", NULL, "1985", - "Konami's Tennis (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kontennaRomInfo, MSX_kontennaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Konami's Tennis (Kor) - -static struct BurnRomInfo MSX_kontennkRomDesc[] = { - { "konami's tennis (1984)(konami)[cr prosoft][rc-720].rom", 0x04001, 0xa5427ecd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kontennk, MSX_kontennk, msx_msx) -STD_ROM_FN(MSX_kontennk) - -struct BurnDriver BurnDrvMSX_kontennk = { - "msx_kontennk", "msx_kontenn", "msx_msx", NULL, "19??", - "Konami's Tennis (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kontennkRomInfo, MSX_kontennkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Koneko no Daibouken - Chibi-chan ga Iku (Jpn) - -static struct BurnRomInfo MSX_konekoRomDesc[] = { - { "koneko no daibouken - catboy (japan).rom", 0x08000, 0x5a0b8739, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_koneko, MSX_koneko, msx_msx) -STD_ROM_FN(MSX_koneko) - -struct BurnDriver BurnDrvMSX_koneko = { - "msx_koneko", NULL, "msx_msx", NULL, "1986", - "Koneko no Daibouken - Chibi-chan ga Iku (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_konekoRomInfo, MSX_konekoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kung Fu Master (Jpn) - -static struct BurnRomInfo MSX_kungfumRomDesc[] = { - { "kung fu master (japan).rom", 0x04000, 0x08f23b3e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kungfum, MSX_kungfum, msx_msx) -STD_ROM_FN(MSX_kungfum) - -struct BurnDriver BurnDrvMSX_kungfum = { - "msx_kungfum", NULL, "msx_msx", NULL, "1983", - "Kung Fu Master (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kungfumRomInfo, MSX_kungfumRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kung Fu Master (Jpn, Alt) - -static struct BurnRomInfo MSX_kungfumaRomDesc[] = { - { "kung fu master (japan) (alt 1).rom", 0x04000, 0x10fc1118, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kungfuma, MSX_kungfuma, msx_msx) -STD_ROM_FN(MSX_kungfuma) - -struct BurnDriver BurnDrvMSX_kungfuma = { - "msx_kungfuma", "msx_kungfum", "msx_msx", NULL, "1983", - "Kung Fu Master (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kungfumaRomInfo, MSX_kungfumaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kung Fu Master (Jpn, Alt 2) - -static struct BurnRomInfo MSX_kungfumbRomDesc[] = { - { "kung fu master (japan) (alt 2).rom", 0x04000, 0x103724ad, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kungfumb, MSX_kungfumb, msx_msx) -STD_ROM_FN(MSX_kungfumb) - -struct BurnDriver BurnDrvMSX_kungfumb = { - "msx_kungfumb", "msx_kungfum", "msx_msx", NULL, "1983", - "Kung Fu Master (Jpn, Alt 2)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kungfumbRomInfo, MSX_kungfumbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kung-Fu Taikun (Jpn) - -static struct BurnRomInfo MSX_kungfutRomDesc[] = { - { "kung fu taigun (japan).rom", 0x04000, 0xc1aaf8cb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kungfut, MSX_kungfut, msx_msx) -STD_ROM_FN(MSX_kungfut) - -struct BurnDriver BurnDrvMSX_kungfut = { - "msx_kungfut", NULL, "msx_msx", NULL, "1985", - "Kung-Fu Taikun (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kungfutRomInfo, MSX_kungfutRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kung-Fu Taikun (Jpn, Alt) - -static struct BurnRomInfo MSX_kungfutaRomDesc[] = { - { "kung fu taigun (japan) (alt 1).rom", 0x04001, 0x8c30be94, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kungfuta, MSX_kungfuta, msx_msx) -STD_ROM_FN(MSX_kungfuta) - -struct BurnDriver BurnDrvMSX_kungfuta = { - "msx_kungfuta", "msx_kungfut", "msx_msx", NULL, "1985", - "Kung-Fu Taikun (Jpn, Alt)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kungfutaRomInfo, MSX_kungfutaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kung-Fu Taikun (Kor) - -static struct BurnRomInfo MSX_kungfutkRomDesc[] = { - { "kimpo.rom", 0x04000, 0xcb43bfba, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kungfutk, MSX_kungfutk, msx_msx) -STD_ROM_FN(MSX_kungfutk) - -struct BurnDriver BurnDrvMSX_kungfutk = { - "msx_kungfutk", "msx_kungfut", "msx_msx", NULL, "198?", - "Kung-Fu Taikun (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kungfutkRomInfo, MSX_kungfutkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Laptick 2 (Jpn) - -static struct BurnRomInfo MSX_laptick2RomDesc[] = { - { "laptick 2 (japan).rom", 0x08000, 0x091fe438, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_laptick2, MSX_laptick2, msx_msx) -STD_ROM_FN(MSX_laptick2) - -struct BurnDriver BurnDrvMSX_laptick2 = { - "msx_laptick2", NULL, "msx_msx", NULL, "1986", - "Laptick 2 (Jpn)\0", NULL, "dB-Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_laptick2RomInfo, MSX_laptick2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Legendly Knight - Daemaseong (Kor) - -static struct BurnRomInfo MSX_legendkRomDesc[] = { - { "legendly knight (korea).rom", 0x20000, 0x8e0f0638, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_legendk, MSX_legendk, msx_msx) -STD_ROM_FN(MSX_legendk) - -struct BurnDriver BurnDrvMSX_legendk = { - "msx_legendk", NULL, "msx_msx", NULL, "1988", - "Legendly Knight - Daemaseong (Kor)\0", NULL, "Topia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_legendkRomInfo, MSX_legendkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Legendly Knight - Daemaseong (Kor, Alt) - -static struct BurnRomInfo MSX_legendkaRomDesc[] = { - { "legendly knight (korea) (alt 1).rom", 0x20000, 0xd6635d68, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_legendka, MSX_legendka, msx_msx) -STD_ROM_FN(MSX_legendka) - -struct BurnDriver BurnDrvMSX_legendka = { - "msx_legendka", "msx_legendk", "msx_msx", NULL, "1988", - "Legendly Knight - Daemaseong (Kor, Alt)\0", NULL, "Topia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_legendkaRomInfo, MSX_legendkaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Lode Runner (Jpn) - -static struct BurnRomInfo MSX_ldrunRomDesc[] = { - { "lode runner (japan).rom", 0x08000, 0xadc58732, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ldrun, MSX_ldrun, msx_msx) -STD_ROM_FN(MSX_ldrun) - -struct BurnDriver BurnDrvMSX_ldrun = { - "msx_ldrun", NULL, "msx_msx", NULL, "1983", - "Lode Runner (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ldrunRomInfo, MSX_ldrunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Lode Runner (Jpn, Alt) - -static struct BurnRomInfo MSX_ldrunaRomDesc[] = { - { "lode runner (japan) (alt 1).rom", 0x08000, 0x25b70773, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ldruna, MSX_ldruna, msx_msx) -STD_ROM_FN(MSX_ldruna) - -struct BurnDriver BurnDrvMSX_ldruna = { - "msx_ldruna", "msx_ldrun", "msx_msx", NULL, "1983", - "Lode Runner (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ldrunaRomInfo, MSX_ldrunaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Lode Runner II (Jpn) - -static struct BurnRomInfo MSX_ldrun2RomDesc[] = { - { "lode runner ii (japan).rom", 0x08000, 0x32ab8b20, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ldrun2, MSX_ldrun2, msx_msx) -STD_ROM_FN(MSX_ldrun2) - -struct BurnDriver BurnDrvMSX_ldrun2 = { - "msx_ldrun2", NULL, "msx_msx", NULL, "1985", - "Lode Runner II (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ldrun2RomInfo, MSX_ldrun2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Lord Over (Jpn) - -static struct BurnRomInfo MSX_lordoverRomDesc[] = { - { "lord over (japan).rom", 0x04000, 0xab5e42fe, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lordover, MSX_lordover, msx_msx) -STD_ROM_FN(MSX_lordover) - -struct BurnDriver BurnDrvMSX_lordover = { - "msx_lordover", NULL, "msx_msx", NULL, "1984", - "Lord Over (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lordoverRomInfo, MSX_lordoverRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Lot Lot (Jpn) - -static struct BurnRomInfo MSX_lotlotRomDesc[] = { - { "lot lot (japan).rom", 0x08000, 0xc1679aeb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lotlot, MSX_lotlot, msx_msx) -STD_ROM_FN(MSX_lotlot) - -struct BurnDriver BurnDrvMSX_lotlot = { - "msx_lotlot", NULL, "msx_msx", NULL, "1985", - "Lot Lot (Jpn)\0", NULL, "Tokuma Shoten", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lotlotRomInfo, MSX_lotlotRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Lunar Ball (Jpn) - -static struct BurnRomInfo MSX_lunarbalRomDesc[] = { - { "lunar ball (japan).rom", 0x08000, 0xd8a116d8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lunarbal, MSX_lunarbal, msx_msx) -STD_ROM_FN(MSX_lunarbal) - -struct BurnDriver BurnDrvMSX_lunarbal = { - "msx_lunarbal", NULL, "msx_msx", NULL, "1985", - "Lunar Ball (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lunarbalRomInfo, MSX_lunarbalRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Machinegun Joe vs The Mafia (Jpn) - -static struct BurnRomInfo MSX_mgunjoeRomDesc[] = { - { "machinegun joe vs the mafia (japan).rom", 0x04000, 0x628f033d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mgunjoe, MSX_mgunjoe, msx_msx) -STD_ROM_FN(MSX_mgunjoe) - -struct BurnDriver BurnDrvMSX_mgunjoe = { - "msx_mgunjoe", NULL, "msx_msx", NULL, "1984", - "Machinegun Joe vs The Mafia (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mgunjoeRomInfo, MSX_mgunjoeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Choujikuu Yousai Macross (Jpn) - -static struct BurnRomInfo MSX_macrossRomDesc[] = { - { "macross (japan).rom", 0x08000, 0x6e742024, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_macross, MSX_macross, msx_msx) -STD_ROM_FN(MSX_macross) - -struct BurnDriver BurnDrvMSX_macross = { - "msx_macross", NULL, "msx_msx", NULL, "1985", - "Choujikuu Yousai Macross (Jpn)\0", NULL, "Bothtec", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_macrossRomInfo, MSX_macrossRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Choujikuu Yousai Macross (Jpn, Alt) - -static struct BurnRomInfo MSX_macrossaRomDesc[] = { - { "macross (japan) (alt 1).rom", 0x08000, 0x86ccf417, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_macrossa, MSX_macrossa, msx_msx) -STD_ROM_FN(MSX_macrossa) - -struct BurnDriver BurnDrvMSX_macrossa = { - "msx_macrossa", "msx_macross", "msx_msx", NULL, "1985", - "Choujikuu Yousai Macross (Jpn, Alt)\0", NULL, "Bothtec", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_macrossaRomInfo, MSX_macrossaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Magical Kid Wiz (Jpn) - -static struct BurnRomInfo MSX_mkidwizRomDesc[] = { - { "magical kid wiz (japan).rom", 0x08000, 0x8c2f2c59, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mkidwiz, MSX_mkidwiz, msx_msx) -STD_ROM_FN(MSX_mkidwiz) - -struct BurnDriver BurnDrvMSX_mkidwiz = { - "msx_mkidwiz", NULL, "msx_msx", NULL, "1986", - "Magical Kid Wiz (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mkidwizRomInfo, MSX_mkidwizRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Magical Kid Wiz (Jpn, Alt) - -static struct BurnRomInfo MSX_mkidwizaRomDesc[] = { - { "magical kid wiz (japan) (alt 1).rom", 0x08000, 0x2c2f5b6c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mkidwiza, MSX_mkidwiza, msx_msx) -STD_ROM_FN(MSX_mkidwiza) - -struct BurnDriver BurnDrvMSX_mkidwiza = { - "msx_mkidwiza", "msx_mkidwiz", "msx_msx", NULL, "1986", - "Magical Kid Wiz (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mkidwizaRomInfo, MSX_mkidwizaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Magical Kid Wiz (Jpn, Alt 2) - -static struct BurnRomInfo MSX_mkidwizbRomDesc[] = { - { "magical kid wiz (japan) (alt 2).rom", 0x08000, 0x74d6a1b1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mkidwizb, MSX_mkidwizb, msx_msx) -STD_ROM_FN(MSX_mkidwizb) - -struct BurnDriver BurnDrvMSX_mkidwizb = { - "msx_mkidwizb", "msx_mkidwiz", "msx_msx", NULL, "1986", - "Magical Kid Wiz (Jpn, Alt 2)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mkidwizbRomInfo, MSX_mkidwizbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Magical Tree (Jpn) - -static struct BurnRomInfo MSX_magtreeRomDesc[] = { - { "magical tree (japan).rom", 0x04000, 0x827038a2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_magtree, MSX_magtree, msx_msx) -STD_ROM_FN(MSX_magtree) - -struct BurnDriver BurnDrvMSX_magtree = { - "msx_magtree", NULL, "msx_msx", NULL, "1985", - "Magical Tree (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_magtreeRomInfo, MSX_magtreeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Magical Tree (Jpn, Alt) - -static struct BurnRomInfo MSX_magtreeaRomDesc[] = { - { "magical tree (japan) (alt 1).rom", 0x04000, 0xf3606c66, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_magtreea, MSX_magtreea, msx_msx) -STD_ROM_FN(MSX_magtreea) - -struct BurnDriver BurnDrvMSX_magtreea = { - "msx_magtreea", "msx_magtree", "msx_msx", NULL, "1985", - "Magical Tree (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_magtreeaRomInfo, MSX_magtreeaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Magnum Kiki Ippatsu - Empire City 1931 (Jpn) - -static struct BurnRomInfo MSX_empcityRomDesc[] = { - { "magnum prohibition 1931 (japan).rom", 0x20000, 0xd446ba1e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_empcity, MSX_empcity, msx_msx) -STD_ROM_FN(MSX_empcity) - -struct BurnDriver BurnDrvMSX_empcity = { - "msx_empcity", NULL, "msx_msx", NULL, "1988", - "Magnum Kiki Ippatsu - Empire City 1931 (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_empcityRomInfo, MSX_empcityRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Magnum Kiki Ippatsu - Empire City 1931 (Jpn, Alt) - -static struct BurnRomInfo MSX_empcityaRomDesc[] = { - { "magnum prohibition 1931 (japan) (alt 1).rom", 0x20000, 0x2a8bbb4d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_empcitya, MSX_empcitya, msx_msx) -STD_ROM_FN(MSX_empcitya) - -struct BurnDriver BurnDrvMSX_empcitya = { - "msx_empcitya", "msx_empcity", "msx_msx", NULL, "1988", - "Magnum Kiki Ippatsu - Empire City 1931 (Jpn, Alt)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_empcityaRomInfo, MSX_empcityaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Manes (Jpn) - -static struct BurnRomInfo MSX_manesRomDesc[] = { - { "manes (japan).rom", 0x04000, 0xb7002f08, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_manes, MSX_manes, msx_msx) -STD_ROM_FN(MSX_manes) - -struct BurnDriver BurnDrvMSX_manes = { - "msx_manes", NULL, "msx_msx", NULL, "1984", - "Manes (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_manesRomInfo, MSX_manesRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Manes (Jpn, Alt) - -static struct BurnRomInfo MSX_manesaRomDesc[] = { - { "manes (japan) (alt 1).rom", 0x04000, 0xa97a19ec, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_manesa, MSX_manesa, msx_msx) -STD_ROM_FN(MSX_manesa) - -struct BurnDriver BurnDrvMSX_manesa = { - "msx_manesa", "msx_manes", "msx_msx", NULL, "1984", - "Manes (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_manesaRomInfo, MSX_manesaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Manes (Jpn, Alt 2) - -static struct BurnRomInfo MSX_manesbRomDesc[] = { - { "manes (japan) (alt 2).rom", 0x04000, 0xaf275ca8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_manesb, MSX_manesb, msx_msx) -STD_ROM_FN(MSX_manesb) - -struct BurnDriver BurnDrvMSX_manesb = { - "msx_manesb", "msx_manes", "msx_msx", NULL, "1984", - "Manes (Jpn, Alt 2)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_manesbRomInfo, MSX_manesbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mappy (Jpn) - -static struct BurnRomInfo MSX_mappyRomDesc[] = { - { "mappy (japan).rom", 0x04000, 0x3b702e9a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mappy, MSX_mappy, msx_msx) -STD_ROM_FN(MSX_mappy) - -struct BurnDriver BurnDrvMSX_mappy = { - "msx_mappy", NULL, "msx_msx", NULL, "1984", - "Mappy (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mappyRomInfo, MSX_mappyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mappy (Jpn, Alt) - -static struct BurnRomInfo MSX_mappyaRomDesc[] = { - { "mappy (japan) (alt 1).rom", 0x08000, 0xa0358870, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mappya, MSX_mappya, msx_msx) -STD_ROM_FN(MSX_mappya) - -struct BurnDriver BurnDrvMSX_mappya = { - "msx_mappya", "msx_mappy", "msx_msx", NULL, "1984", - "Mappy (Jpn, Alt)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mappyaRomInfo, MSX_mappyaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mappy (Jpn, Alt 2) - -static struct BurnRomInfo MSX_mappybRomDesc[] = { - { "mappy (japan) (alt 2).rom", 0x08000, 0xa006ad6b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mappyb, MSX_mappyb, msx_msx) -STD_ROM_FN(MSX_mappyb) - -struct BurnDriver BurnDrvMSX_mappyb = { - "msx_mappyb", "msx_mappy", "msx_msx", NULL, "1984", - "Mappy (Jpn, Alt 2)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mappybRomInfo, MSX_mappybRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Marine Battle (Jpn) - -static struct BurnRomInfo MSX_marinbatRomDesc[] = { - { "marine battle (japan).rom", 0x04000, 0x24923bdb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_marinbat, MSX_marinbat, msx_msx) -STD_ROM_FN(MSX_marinbat) - -struct BurnDriver BurnDrvMSX_marinbat = { - "msx_marinbat", NULL, "msx_msx", NULL, "1983", - "Marine Battle (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_marinbatRomInfo, MSX_marinbatRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mashou no Yakata - Gabalin (Jpn) - -static struct BurnRomInfo MSX_gabalinRomDesc[] = { - { "mashou no tachi goblin (japan).rom", 0x10000, 0xd34d74f7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gabalin, MSX_gabalin, msx_msx) -STD_ROM_FN(MSX_gabalin) - -struct BurnDriver BurnDrvMSX_gabalin = { - "msx_gabalin", NULL, "msx_msx", NULL, "1987", - "Mashou no Yakata - Goblin (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gabalinRomInfo, MSX_gabalinRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mashou no Yakata - Gabalin (Jpn, Alt) - -static struct BurnRomInfo MSX_gabalinaRomDesc[] = { - { "mashou no tachi goblin (japan) (alt 1).rom", 0x10000, 0x6ef086eb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gabalina, MSX_gabalina, msx_msx) -STD_ROM_FN(MSX_gabalina) - -struct BurnDriver BurnDrvMSX_gabalina = { - "msx_gabalina", "msx_gabalin", "msx_msx", NULL, "1987", - "Mashou no Yakata - Gabalin (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gabalinaRomInfo, MSX_gabalinaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Megalopolis SOS (Jpn) - -static struct BurnRomInfo MSX_megalsosRomDesc[] = { - { "megalopolis sos (japan).rom", 0x04000, 0xcf744d2e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_megalsos, MSX_megalsos, msx_msx) -STD_ROM_FN(MSX_megalsos) - -struct BurnDriver BurnDrvMSX_megalsos = { - "msx_megalsos", NULL, "msx_msx", NULL, "1983", - "Megalopolis SOS (Jpn)\0", NULL, "Paxon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_megalsosRomInfo, MSX_megalsosRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Megalopolis SOS (Jpn, Alt) - -static struct BurnRomInfo MSX_megalsosaRomDesc[] = { - { "megalopolis sos (japan) (alt 1).rom", 0x04000, 0x02b17e2a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_megalsosa, MSX_megalsosa, msx_msx) -STD_ROM_FN(MSX_megalsosa) - -struct BurnDriver BurnDrvMSX_megalsosa = { - "msx_megalsosa", "msx_megalsos", "msx_msx", NULL, "1983", - "Megalopolis SOS (Jpn, Alt)\0", NULL, "Paxon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_megalsosaRomInfo, MSX_megalsosaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Megalopolis SOS (Jpn, Alt 2) - -static struct BurnRomInfo MSX_megalsosbRomDesc[] = { - { "megalopolis sos (japan) (alt 2).rom", 0x04000, 0x07e85697, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_megalsosb, MSX_megalsosb, msx_msx) -STD_ROM_FN(MSX_megalsosb) - -struct BurnDriver BurnDrvMSX_megalsosb = { - "msx_megalsosb", "msx_megalsos", "msx_msx", NULL, "1983", - "Megalopolis SOS (Jpn, Alt 2)\0", NULL, "Paxon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_megalsosbRomInfo, MSX_megalsosbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Meikyuu Shinwa (Jpn, Alt) - -static struct BurnRomInfo MSX_meikyushaRomDesc[] = { - { "meikyuu shinwa (japan) (alt 1).rom", 0x20000, 0x1d1ec602, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_meikyusha, MSX_meikyusha, msx_msx) -STD_ROM_FN(MSX_meikyusha) - -struct BurnDriver BurnDrvMSX_meikyusha = { - "msx_meikyusha", NULL, "msx_msx", NULL, "1986", - "Meikyuu Shinwa (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_meikyushaRomInfo, MSX_meikyushaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Midnight Brothers (Jpn) - -static struct BurnRomInfo MSX_midbrosRomDesc[] = { - { "midnight brothers (japan).rom", 0x08000, 0xce2882f6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_midbros, MSX_midbros, msx_msx) -STD_ROM_FN(MSX_midbros) - -struct BurnDriver BurnDrvMSX_midbros = { - "msx_midbros", NULL, "msx_msx", NULL, "1986", - "Midnight Brothers (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_midbrosRomInfo, MSX_midbrosRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Midnight Brothers (Jpn, Alt) - -static struct BurnRomInfo MSX_midbrosaRomDesc[] = { - { "midnight brothers (japan) (alt 1).rom", 0x08000, 0x7bc61bd5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_midbrosa, MSX_midbrosa, msx_msx) -STD_ROM_FN(MSX_midbrosa) - -struct BurnDriver BurnDrvMSX_midbrosa = { - "msx_midbrosa", "msx_midbros", "msx_msx", NULL, "1986", - "Midnight Brothers (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_midbrosaRomInfo, MSX_midbrosaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Midnight Building (Jpn) - -static struct BurnRomInfo MSX_midbuildRomDesc[] = { - { "midnight building (japan).rom", 0x04000, 0x7b5282e4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_midbuild, MSX_midbuild, msx_msx) -STD_ROM_FN(MSX_midbuild) - -struct BurnDriver BurnDrvMSX_midbuild = { - "msx_midbuild", NULL, "msx_msx", NULL, "1983", - "Midnight Building (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_midbuildRomInfo, MSX_midbuildRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Midway (Jpn) - -static struct BurnRomInfo MSX_midwayRomDesc[] = { - { "midway (japan).rom", 0x04000, 0x40e2f32a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_midway, MSX_midway, msx_msx) -STD_ROM_FN(MSX_midway) - -struct BurnDriver BurnDrvMSX_midway = { - "msx_midway", NULL, "msx_msx", NULL, "1983", - "Midway (Jpn)\0", NULL, "Magicsoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_midwayRomInfo, MSX_midwayRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mitsume Ga Tooru - The Three-Eyed One Comes Here (Jpn) - -static struct BurnRomInfo MSX_mitsumgtRomDesc[] = { - { "mitsumega toohru - three-eyed one comes here, the (japan).rom", 0x20000, 0x4faccae0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mitsumgt, MSX_mitsumgt, msx_msx) -STD_ROM_FN(MSX_mitsumgt) - -struct BurnDriver BurnDrvMSX_mitsumgt = { - "msx_mitsumgt", NULL, "msx_msx", NULL, "1989", - "Mitsume Ga Tooru - The Three-Eyed One Comes Here (Jpn)\0", NULL, "Natsume", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_mitsumgtRomInfo, MSX_mitsumgtRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Moai no Hihou (Jpn) - -static struct BurnRomInfo MSX_moaihihoRomDesc[] = { - { "moai no hibou (japan).rom", 0x08000, 0x0427df83, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_moaihiho, MSX_moaihiho, msx_msx) -STD_ROM_FN(MSX_moaihiho) - -struct BurnDriver BurnDrvMSX_moaihiho = { - "msx_moaihiho", NULL, "msx_msx", NULL, "1986", - "Moai no Hihou (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_moaihihoRomInfo, MSX_moaihihoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Moai no Hihou (Kor) - -static struct BurnRomInfo MSX_moaihihokRomDesc[] = { - { "moai no hibou (japan) (alt 1).rom", 0x08000, 0x0b3061fc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_moaihihok, MSX_moaihihok, msx_msx) -STD_ROM_FN(MSX_moaihihok) - -struct BurnDriver BurnDrvMSX_moaihihok = { - "msx_moaihihok", "msx_moaihiho", "msx_msx", NULL, "1986?", - "Moai no Hihou (Kor)\0", NULL, "Static Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_moaihihokRomInfo, MSX_moaihihokRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mobile Planet Suthirus - Approach from the Westgate (Jpn) - -static struct BurnRomInfo MSX_suthirRomDesc[] = { - { "mobile planet suthirus - approach from the westgate (japan).rom", 0x08000, 0xeba19259, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_suthir, MSX_suthir, msx_msx) -STD_ROM_FN(MSX_suthir) - -struct BurnDriver BurnDrvMSX_suthir = { - "msx_suthir", NULL, "msx_msx", NULL, "1986", - "Mobile Planet Suthirus - Approach from the Westgate (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_suthirRomInfo, MSX_suthirRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mobile-Suit Gundam - Last Shooting (Jpn) - -static struct BurnRomInfo MSX_gundamRomDesc[] = { - { "mobile-suit gundam - last shooting (japan).rom", 0x04000, 0x1d27d31f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gundam, MSX_gundam, msx_msx) -STD_ROM_FN(MSX_gundam) - -struct BurnDriver BurnDrvMSX_gundam = { - "msx_gundam", NULL, "msx_msx", NULL, "1984", - "Mobile-Suit Gundam - Last Shooting (Jpn)\0", NULL, "Bandai", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gundamRomInfo, MSX_gundamRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mobile-Suit Gundam - Last Shooting (Jpn, Alt) - -static struct BurnRomInfo MSX_gundamaRomDesc[] = { - { "mobile-suit gundam - last shooting (japan) (alt 1).rom", 0x08000, 0x4725206f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gundama, MSX_gundama, msx_msx) -STD_ROM_FN(MSX_gundama) - -struct BurnDriver BurnDrvMSX_gundama = { - "msx_gundama", "msx_gundam", "msx_msx", NULL, "1984", - "Mobile-Suit Gundam - Last Shooting (Jpn, Alt)\0", NULL, "Bandai", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gundamaRomInfo, MSX_gundamaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mobile-Suit Gundam - Last Shooting (Kor) - -static struct BurnRomInfo MSX_gundamkRomDesc[] = { - { "gundam.rom", 0x08000, 0x5cef14d1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gundamk, MSX_gundamk, msx_msx) -STD_ROM_FN(MSX_gundamk) - -struct BurnDriver BurnDrvMSX_gundamk = { - "msx_gundamk", "msx_gundam", "msx_msx", NULL, "198?", - "Mobile-Suit Gundam - Last Shooting (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gundamkRomInfo, MSX_gundamkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mokari Makka? Bochibochi Denna! (Jpn) - -static struct BurnRomInfo MSX_mokarimaRomDesc[] = { - { "mokarimakka (japan).rom", 0x08000, 0xd40f481d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mokarima, MSX_mokarima, msx_msx) -STD_ROM_FN(MSX_mokarima) - -struct BurnDriver BurnDrvMSX_mokarima = { - "msx_mokarima", NULL, "msx_msx", NULL, "1986", - "Mokari Makka? Bochibochi Denna! (Jpn)\0", NULL, "Leben Pro", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mokarimaRomInfo, MSX_mokarimaRomName, NULL, NULL, MSXInputInfo, MSXJoyCursor60hzDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mole Mole (Bra) - -static struct BurnRomInfo MSX_molemolRomDesc[] = { - { "mole mole (1985)(victor)[tr pt].rom", 0x08000, 0x7092ca0c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_molemol, MSX_molemol, msx_msx) -STD_ROM_FN(MSX_molemol) - -struct BurnDriver BurnDrvMSX_molemol = { - "msx_molemol", NULL, "msx_msx", NULL, "198?", - "Mole Mole (Bra)\0", NULL, "Unknown", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_molemolRomInfo, MSX_molemolRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mole Mole 2 (Jpn) - -static struct BurnRomInfo MSX_molemol2RomDesc[] = { - { "mole mole 2 (japan).rom", 0x08000, 0x309f886b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_molemol2, MSX_molemol2, msx_msx) -STD_ROM_FN(MSX_molemol2) - -struct BurnDriver BurnDrvMSX_molemol2 = { - "msx_molemol2", NULL, "msx_msx", NULL, "1987", - "Mole Mole 2 (Jpn)\0", NULL, "Victor", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_molemol2RomInfo, MSX_molemol2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Monkey Academy (Jpn) - -static struct BurnRomInfo MSX_monkeyacRomDesc[] = { - { "monkey academy (japan).rom", 0x04000, 0x98cd6912, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_monkeyac, MSX_monkeyac, msx_msx) -STD_ROM_FN(MSX_monkeyac) - -struct BurnDriver BurnDrvMSX_monkeyac = { - "msx_monkeyac", NULL, "msx_msx", NULL, "1984", - "Monkey Academy (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_monkeyacRomInfo, MSX_monkeyacRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Monkey Academy (Jpn, Alt) - -static struct BurnRomInfo MSX_monkeyacaRomDesc[] = { - { "monkey academy (japan) (alt 1).rom", 0x04000, 0xe73c12e6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_monkeyaca, MSX_monkeyaca, msx_msx) -STD_ROM_FN(MSX_monkeyaca) - -struct BurnDriver BurnDrvMSX_monkeyaca = { - "msx_monkeyaca", "msx_monkeyac", "msx_msx", NULL, "1984", - "Monkey Academy (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_monkeyacaRomInfo, MSX_monkeyacaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Monkey Academy (Jpn, Alt 2) - -static struct BurnRomInfo MSX_monkeyacbRomDesc[] = { - { "monkey academy (japan) (alt 2).rom", 0x04000, 0x3ddcac18, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_monkeyacb, MSX_monkeyacb, msx_msx) -STD_ROM_FN(MSX_monkeyacb) - -struct BurnDriver BurnDrvMSX_monkeyacb = { - "msx_monkeyacb", "msx_monkeyac", "msx_msx", NULL, "1984", - "Monkey Academy (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_monkeyacbRomInfo, MSX_monkeyacbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Monkey Academy (Jpn, Alt 3) - -static struct BurnRomInfo MSX_monkeyaccRomDesc[] = { - { "monkey academy (japan) (alt 3).rom", 0x04000, 0xd1896f6e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_monkeyacc, MSX_monkeyacc, msx_msx) -STD_ROM_FN(MSX_monkeyacc) - -struct BurnDriver BurnDrvMSX_monkeyacc = { - "msx_monkeyacc", "msx_monkeyac", "msx_msx", NULL, "1984", - "Monkey Academy (Jpn, Alt 3)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_monkeyaccRomInfo, MSX_monkeyaccRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Monster's Fair (Jpn) - -static struct BurnRomInfo MSX_mnstfairRomDesc[] = { - { "monster's fair (japan).rom", 0x08000, 0x1ba6e461, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mnstfair, MSX_mnstfair, msx_msx) -STD_ROM_FN(MSX_mnstfair) - -struct BurnDriver BurnDrvMSX_mnstfair = { - "msx_mnstfair", NULL, "msx_msx", NULL, "1986", - "Monster's Fair (Jpn)\0", NULL, "Toho", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mnstfairRomInfo, MSX_mnstfairRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Moon Patrol (Jpn) - -static struct BurnRomInfo MSX_mpatrolRomDesc[] = { - { "moon patrol (japan).rom", 0x04000, 0xfebb1155, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mpatrol, MSX_mpatrol, msx_msx) -STD_ROM_FN(MSX_mpatrol) - -struct BurnDriver BurnDrvMSX_mpatrol = { - "msx_mpatrol", NULL, "msx_msx", NULL, "1984", - "Moon Patrol (Jpn)\0", NULL, "Dempa", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mpatrolRomInfo, MSX_mpatrolRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Moon Patrol (Kor) - -static struct BurnRomInfo MSX_mpatrolkRomDesc[] = { - { "moon patrol (1984)(irem)[cr prosoft].rom", 0x04000, 0xd4151ce7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mpatrolk, MSX_mpatrolk, msx_msx) -STD_ROM_FN(MSX_mpatrolk) - -struct BurnDriver BurnDrvMSX_mpatrolk = { - "msx_mpatrolk", "msx_mpatrol", "msx_msx", NULL, "19??", - "Moon Patrol (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mpatrolkRomInfo, MSX_mpatrolkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Moonsweeper (Jpn) - -static struct BurnRomInfo MSX_moonswepRomDesc[] = { - { "moonsweeper (japan).rom", 0x08000, 0xf1637c31, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_moonswep, MSX_moonswep, msx_msx) -STD_ROM_FN(MSX_moonswep) - -struct BurnDriver BurnDrvMSX_moonswep = { - "msx_moonswep", NULL, "msx_msx", NULL, "1985", - "Moonsweeper (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_moonswepRomInfo, MSX_moonswepRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mopiranger (Jpn) - -static struct BurnRomInfo MSX_mopirangRomDesc[] = { - { "mopiranger (japan).rom", 0x04000, 0x9d73e4c5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mopirang, MSX_mopirang, msx_msx) -STD_ROM_FN(MSX_mopirang) - -struct BurnDriver BurnDrvMSX_mopirang = { - "msx_mopirang", NULL, "msx_msx", NULL, "1985", - "Mopiranger (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mopirangRomInfo, MSX_mopirangRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mopiranger (Jpn, Alt) - -static struct BurnRomInfo MSX_mopirangaRomDesc[] = { - { "mopiranger (japan) (alt 1).rom", 0x04000, 0x097f4e4a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mopiranga, MSX_mopiranga, msx_msx) -STD_ROM_FN(MSX_mopiranga) - -struct BurnDriver BurnDrvMSX_mopiranga = { - "msx_mopiranga", "msx_mopirang", "msx_msx", NULL, "1985", - "Mopiranger (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mopirangaRomInfo, MSX_mopirangaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mopiranger (Jpn, Alt 2) - -static struct BurnRomInfo MSX_mopirangbRomDesc[] = { - { "mopiranger (japan) (alt 2).rom", 0x04000, 0x213e623b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mopirangb, MSX_mopirangb, msx_msx) -STD_ROM_FN(MSX_mopirangb) - -struct BurnDriver BurnDrvMSX_mopirangb = { - "msx_mopirangb", "msx_mopirang", "msx_msx", NULL, "1985", - "Mopiranger (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mopirangbRomInfo, MSX_mopirangbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mopiranger (Jpn, Alt 3) - -static struct BurnRomInfo MSX_mopirangcRomDesc[] = { - { "mopiranger (japan) (alt 3).rom", 0x04000, 0x73d0ce5a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mopirangc, MSX_mopirangc, msx_msx) -STD_ROM_FN(MSX_mopirangc) - -struct BurnDriver BurnDrvMSX_mopirangc = { - "msx_mopirangc", "msx_mopirang", "msx_msx", NULL, "1985", - "Mopiranger (Jpn, Alt 3)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mopirangcRomInfo, MSX_mopirangcRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mopiranger (Jpn, Alt 4) - -static struct BurnRomInfo MSX_mopirangdRomDesc[] = { - { "mopiranger (japan) (alt 4).rom", 0x04000, 0x6135bd9a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mopirangd, MSX_mopirangd, msx_msx) -STD_ROM_FN(MSX_mopirangd) - -struct BurnDriver BurnDrvMSX_mopirangd = { - "msx_mopirangd", "msx_mopirang", "msx_msx", NULL, "1985", - "Mopiranger (Jpn, Alt 4)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mopirangdRomInfo, MSX_mopirangdRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mopiranger (Kor) - -static struct BurnRomInfo MSX_mopirangkRomDesc[] = { - { "mopirang.rom", 0x08000, 0x46bfe597, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mopirangk, MSX_mopirangk, msx_msx) -STD_ROM_FN(MSX_mopirangk) - -struct BurnDriver BurnDrvMSX_mopirangk = { - "msx_mopirangk", "msx_mopirang", "msx_msx", NULL, "198?", - "Mopiranger (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mopirangkRomInfo, MSX_mopirangkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Morita Kazuo no Othello (Jpn) - -static struct BurnRomInfo MSX_moritaotRomDesc[] = { - { "morita kazuo no othello (japan).rom", 0x08000, 0xa94d7d08, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_moritaot, MSX_moritaot, msx_msx) -STD_ROM_FN(MSX_moritaot) - -struct BurnDriver BurnDrvMSX_moritaot = { - "msx_moritaot", NULL, "msx_msx", NULL, "1986", - "Morita Kazuo no Othello (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_moritaotRomInfo, MSX_moritaotRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mouser (Jpn) - -static struct BurnRomInfo MSX_mouserRomDesc[] = { - { "mouser (japan).rom", 0x04000, 0x06a64527, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mouser, MSX_mouser, msx_msx) -STD_ROM_FN(MSX_mouser) - -struct BurnDriver BurnDrvMSX_mouser = { - "msx_mouser", NULL, "msx_msx", NULL, "1983", - "Mouser (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mouserRomInfo, MSX_mouserRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mr. Chin (Jpn) - -static struct BurnRomInfo MSX_mrchinRomDesc[] = { - { "mr. chin (japan).rom", 0x02000, 0x414d29bc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrchin, MSX_mrchin, msx_msx) -STD_ROM_FN(MSX_mrchin) - -struct BurnDriver BurnDrvMSX_mrchin = { - "msx_mrchin", NULL, "msx_msx", NULL, "1984", - "Mr. Chin (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mrchinRomInfo, MSX_mrchinRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mr. Chin (Kor) - -static struct BurnRomInfo MSX_mrchinkRomDesc[] = { - { "mrchin.rom", 0x08000, 0x68c2426a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrchink, MSX_mrchink, msx_msx) -STD_ROM_FN(MSX_mrchink) - -struct BurnDriver BurnDrvMSX_mrchink = { - "msx_mrchink", "msx_mrchin", "msx_msx", NULL, "198?", - "Mr. Chin (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mrchinkRomInfo, MSX_mrchinkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mr. Do (Jpn) - -static struct BurnRomInfo MSX_mrdoRomDesc[] = { - { "mr. do (japan).rom", 0x02000, 0x4098d71d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrdo, MSX_mrdo, msx_msx) -STD_ROM_FN(MSX_mrdo) - -struct BurnDriver BurnDrvMSX_mrdo = { - "msx_mrdo", NULL, "msx_msx", NULL, "1984", - "Mr. Do (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mrdoRomInfo, MSX_mrdoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mr. Do (Kor) - -static struct BurnRomInfo MSX_mrdokRomDesc[] = { - { "extra.rom", 0x08000, 0x121c7d23, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrdok, MSX_mrdok, msx_msx) -STD_ROM_FN(MSX_mrdok) - -struct BurnDriver BurnDrvMSX_mrdok = { - "msx_mrdok", "msx_mrdo", "msx_msx", NULL, "198?", - "Mr. Do (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mrdokRomInfo, MSX_mrdokRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mr. Do! vs Unicorns (Jpn) - -static struct BurnRomInfo MSX_mrdovsunRomDesc[] = { - { "mr. do vs unicorns (japan).rom", 0x04000, 0x09090135, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrdovsun, MSX_mrdovsun, msx_msx) -STD_ROM_FN(MSX_mrdovsun) - -struct BurnDriver BurnDrvMSX_mrdovsun = { - "msx_mrdovsun", NULL, "msx_msx", NULL, "1984", - "Mr. Do! vs Unicorns (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mrdovsunRomInfo, MSX_mrdovsunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mr. Do's Wild Ride (Jpn) - -static struct BurnRomInfo MSX_mrdowildRomDesc[] = { - { "mr. do's wild ride (japan).rom", 0x04000, 0x6786a7ee, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrdowild, MSX_mrdowild, msx_msx) -STD_ROM_FN(MSX_mrdowild) - -struct BurnDriver BurnDrvMSX_mrdowild = { - "msx_mrdowild", NULL, "msx_msx", NULL, "1985", - "Mr. Do's Wild Ride (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mrdowildRomInfo, MSX_mrdowildRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mr. Do's Wild Ride (Jpn, Hacked?) - -static struct BurnRomInfo MSX_mrdowildhRomDesc[] = { - { "mr. do's wildride (1985)(nippon columbia - colpax - universal)[cr angel].rom", 0x04000, 0x01ea3a27, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrdowildh, MSX_mrdowildh, msx_msx) -STD_ROM_FN(MSX_mrdowildh) - -struct BurnDriver BurnDrvMSX_mrdowildh = { - "msx_mrdowildh", "msx_mrdowild", "msx_msx", NULL, "1985", - "Mr. Do's Wild Ride (Jpn, Hacked?)\0", NULL, "Angel?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mrdowildhRomInfo, MSX_mrdowildhRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Baseball (Jpn) - -static struct BurnRomInfo MSX_msxbballRomDesc[] = { - { "msx baseball (japan).rom", 0x04000, 0xf79d3088, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_msxbball, MSX_msxbball, msx_msx) -STD_ROM_FN(MSX_msxbball) - -struct BurnDriver BurnDrvMSX_msxbball = { - "msx_msxbball", NULL, "msx_msx", NULL, "1984", - "MSX Baseball (Jpn)\0", NULL, "Panasoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_msxbballRomInfo, MSX_msxbballRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Baseball (Jpn, Alt) - -static struct BurnRomInfo MSX_msxbballaRomDesc[] = { - { "msx baseball (japan) (alt 1).rom", 0x04000, 0xf928f075, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_msxbballa, MSX_msxbballa, msx_msx) -STD_ROM_FN(MSX_msxbballa) - -struct BurnDriver BurnDrvMSX_msxbballa = { - "msx_msxbballa", "msx_msxbball", "msx_msx", NULL, "1984", - "MSX Baseball (Jpn, Alt)\0", NULL, "Panasoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_msxbballaRomInfo, MSX_msxbballaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Baseball II National (Jpn) - -static struct BurnRomInfo MSX_msxbbal2RomDesc[] = { - { "msx baseball ii national (japan).rom", 0x04000, 0x0cb78f0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_msxbbal2, MSX_msxbbal2, msx_msx) -STD_ROM_FN(MSX_msxbbal2) - -struct BurnDriver BurnDrvMSX_msxbbal2 = { - "msx_msxbbal2", NULL, "msx_msx", NULL, "1986", - "MSX Baseball II National (Jpn)\0", NULL, "Panasoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_msxbbal2RomInfo, MSX_msxbbal2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Rugby (Jpn) - -static struct BurnRomInfo MSX_msxrugbyRomDesc[] = { - { "msx rugby (japan).rom", 0x04000, 0x61b33748, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_msxrugby, MSX_msxrugby, msx_msx) -STD_ROM_FN(MSX_msxrugby) - -struct BurnDriver BurnDrvMSX_msxrugby = { - "msx_msxrugby", NULL, "msx_msx", NULL, "1985", - "MSX Rugby (Jpn)\0", NULL, "Panasoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_msxrugbyRomInfo, MSX_msxrugbyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Soccer (Jpn) - -static struct BurnRomInfo MSX_msxsoccrRomDesc[] = { - { "msx soccer (japan).rom", 0x04000, 0x6824e45d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_msxsoccr, MSX_msxsoccr, msx_msx) -STD_ROM_FN(MSX_msxsoccr) - -struct BurnDriver BurnDrvMSX_msxsoccr = { - "msx_msxsoccr", NULL, "msx_msx", NULL, "1985", - "MSX Soccer (Jpn)\0", NULL, "Panasoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_msxsoccrRomInfo, MSX_msxsoccrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Soccer (Jpn, Alt) - -static struct BurnRomInfo MSX_msxsoccraRomDesc[] = { - { "msx soccer (japan) (alt 1).rom", 0x04000, 0xf31d13b9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_msxsoccra, MSX_msxsoccra, msx_msx) -STD_ROM_FN(MSX_msxsoccra) - -struct BurnDriver BurnDrvMSX_msxsoccra = { - "msx_msxsoccra", "msx_msxsoccr", "msx_msx", NULL, "1985", - "MSX Soccer (Jpn, Alt)\0", NULL, "Panasoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_msxsoccraRomInfo, MSX_msxsoccraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Soccer (Kor) - -static struct BurnRomInfo MSX_msxsoccrkRomDesc[] = { - { "msxsocce.rom", 0x08000, 0x80d26722, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_msxsoccrk, MSX_msxsoccrk, msx_msx) -STD_ROM_FN(MSX_msxsoccrk) - -struct BurnDriver BurnDrvMSX_msxsoccrk = { - "msx_msxsoccrk", "msx_msxsoccr", "msx_msx", NULL, "198?", - "MSX Soccer (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_msxsoccrkRomInfo, MSX_msxsoccrkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Soukoban (Jpn) - -static struct BurnRomInfo MSX_sokobanRomDesc[] = { - { "soukoban (japan).rom", 0x04000, 0x030ddf11, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sokoban, MSX_sokoban, msx_msx) -STD_ROM_FN(MSX_sokoban) - -struct BurnDriver BurnDrvMSX_sokoban = { - "msx_sokoban", NULL, "msx_msx", NULL, "1984", - "MSX Soukoban (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sokobanRomInfo, MSX_sokobanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Soukoban (Jpn, Alt) - -static struct BurnRomInfo MSX_sokobanaRomDesc[] = { - { "soukoban (japan) (alt 1).rom", 0x08000, 0xbc815cfa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sokobana, MSX_sokobana, msx_msx) -STD_ROM_FN(MSX_sokobana) - -struct BurnDriver BurnDrvMSX_sokobana = { - "msx_sokobana", "msx_sokoban", "msx_msx", NULL, "1984", - "MSX Soukoban (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sokobanaRomInfo, MSX_sokobanaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Soukoban (Jpn, Alt 2) - -static struct BurnRomInfo MSX_sokobanbRomDesc[] = { - { "soukoban (japan) (alt 2).rom", 0x04000, 0xe683af8a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sokobanb, MSX_sokobanb, msx_msx) -STD_ROM_FN(MSX_sokobanb) - -struct BurnDriver BurnDrvMSX_sokobanb = { - "msx_sokobanb", "msx_sokoban", "msx_msx", NULL, "1984", - "MSX Soukoban (Jpn, Alt 2)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sokobanbRomInfo, MSX_sokobanbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Soukoban (Kor) - -static struct BurnRomInfo MSX_sokobankRomDesc[] = { - { "soukoban (1984)(qnix).rom", 0x04000, 0xebb55d7f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sokobank, MSX_sokobank, msx_msx) -STD_ROM_FN(MSX_sokobank) - -struct BurnDriver BurnDrvMSX_sokobank = { - "msx_sokobank", "msx_sokoban", "msx_msx", NULL, "1984?", - "Soukoban (Kor)\0", NULL, "Qnix", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sokobankRomInfo, MSX_sokobankRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mugen Senshi Valis (Kor) - -static struct BurnRomInfo MSX_valiskRomDesc[] = { - { "valis - the fantasm soldier (1987)(zemina).rom", 0x20000, 0x87361b76, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_valisk, MSX_valisk, msx_msx) -STD_ROM_FN(MSX_valisk) - -struct BurnDriver BurnDrvMSX_valisk = { - "msx_valisk", "msx_valis", "msx_msx", NULL, "1987", - "Mugen Senshi Valis (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_valiskRomInfo, MSX_valiskRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nemesis (Euro) ~ Gradius (Jpn) - -static struct BurnRomInfo MSX_gradiusRomDesc[] = { - { "nemesis (japan, europe).rom", 0x20000, 0x4d44255f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gradius, MSX_gradius, msx_msx) -STD_ROM_FN(MSX_gradius) - -struct BurnDriver BurnDrvMSX_gradius = { - "msx_gradius", NULL, "msx_msx", NULL, "1986", - "Nemesis (Euro) ~ Gradius (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_gradiusRomInfo, MSX_gradiusRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nemesis (Euro) ~ Gradius (Jpn) (Alt) - -static struct BurnRomInfo MSX_gradiusaRomDesc[] = { - { "nemesis (japan, europe) (alt 1).rom", 0x20000, 0x4dfcc009, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gradiusa, MSX_gradiusa, msx_msx) -STD_ROM_FN(MSX_gradiusa) - -struct BurnDriver BurnDrvMSX_gradiusa = { - "msx_gradiusa", "msx_gradius", "msx_msx", NULL, "1986", - "Nemesis (Euro) ~ Gradius (Jpn) (Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_gradiusaRomInfo, MSX_gradiusaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nemesis 2 (Euro) ~ Gradius 2 (Jpn) - -static struct BurnRomInfo MSX_gradius2RomDesc[] = { - { "nemesis 2 (japan, europe).rom", 0x20000, 0xdb847b2b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gradius2, MSX_gradius2, msx_msx) -STD_ROM_FN(MSX_gradius2) - -struct BurnDriver BurnDrvMSX_gradius2 = { - "msx_gradius2", NULL, "msx_msx", NULL, "1987", - "Nemesis 2 (Euro) ~ Gradius 2 (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_gradius2RomInfo, MSX_gradius2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nemesis 2 (Euro) ~ Gradius 2 (Jpn) (Alt) - -static struct BurnRomInfo MSX_gradius2aRomDesc[] = { - { "nemesis 2 (japan, europe) (alt 1).rom", 0x20000, 0x32aba4e3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gradius2a, MSX_gradius2a, msx_msx) -STD_ROM_FN(MSX_gradius2a) - -struct BurnDriver BurnDrvMSX_gradius2a = { - "msx_gradius2a", "msx_gradius2", "msx_msx", NULL, "1987", - "Nemesis 2 (Euro) ~ Gradius 2 (Jpn) (Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_gradius2aRomInfo, MSX_gradius2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nemesis 2 (Euro) ~ Gradius 2 (Jpn) (Prototype) - -static struct BurnRomInfo MSX_gradius2pRomDesc[] = { - { "nemesis 2 (japan, europe) (beta).rom", 0x20000, 0xdfa8c827, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gradius2p, MSX_gradius2p, msx_msx) -STD_ROM_FN(MSX_gradius2p) - -struct BurnDriver BurnDrvMSX_gradius2p = { - "msx_gradius2p", "msx_gradius2", "msx_msx", NULL, "1987", - "Nemesis 2 (Euro) ~ Gradius 2 (Jpn) (Prototype)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_gradius2pRomInfo, MSX_gradius2pRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nemesis 2 (Euro) ~ Gradius 2 (Jpn) (Demo) - -static struct BurnRomInfo MSX_gradius2dRomDesc[] = { - { "nemesis 2 (japan) (demo).rom", 0x20000, 0xc8fac21a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gradius2d, MSX_gradius2d, msx_msx) -STD_ROM_FN(MSX_gradius2d) - -struct BurnDriver BurnDrvMSX_gradius2d = { - "msx_gradius2d", "msx_gradius2", "msx_msx", NULL, "1987", - "Nemesis 2 (Euro) ~ Gradius 2 (Jpn) (Demo)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_gradius2dRomInfo, MSX_gradius2dRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nemesis 3 - The Eve of Destruction (Euro) ~ Gopher no Yabou - Episode II (Jpn) - -static struct BurnRomInfo MSX_nemesis3RomDesc[] = { - { "nemesis 3 - the eve of destruction (japan, europe).rom", 0x40000, 0x4b61ae91, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nemesis3, MSX_nemesis3, msx_msx) -STD_ROM_FN(MSX_nemesis3) - -struct BurnDriver BurnDrvMSX_nemesis3 = { - "msx_nemesis3", NULL, "msx_msx", NULL, "1988", - "Nemesis 3 - The Eve of Destruction (Euro) ~ Gopher no Yabou - Episode II (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_nemesis3RomInfo, MSX_nemesis3RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nemesis 3 - The Eve of Destruction (Euro) ~ Gopher no Yabou - Episode II (Jpn) (Alt) - -static struct BurnRomInfo MSX_nemesis3aRomDesc[] = { - { "nemesis 3 - the eve of destruction (japan, europe) (alt 1).rom", 0x40000, 0x0db7132f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nemesis3a, MSX_nemesis3a, msx_msx) -STD_ROM_FN(MSX_nemesis3a) - -struct BurnDriver BurnDrvMSX_nemesis3a = { - "msx_nemesis3a", "msx_nemesis3", "msx_msx", NULL, "1988", - "Nemesis 3 - The Eve of Destruction (Euro) ~ Gopher no Yabou - Episode II (Jpn) (Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_nemesis3aRomInfo, MSX_nemesis3aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nemesis 3 - The Eve of Destruction (Euro) ~ Gopher no Yabou - Episode II (Jpn) (Alt 2) - -static struct BurnRomInfo MSX_nemesis3bRomDesc[] = { - { "nemesis 3 - the eve of destruction (japan, europe) (alt 2).rom", 0x40000, 0x329987bc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nemesis3b, MSX_nemesis3b, msx_msx) -STD_ROM_FN(MSX_nemesis3b) - -struct BurnDriver BurnDrvMSX_nemesis3b = { - "msx_nemesis3b", "msx_nemesis3", "msx_msx", NULL, "1988", - "Nemesis 3 - The Eve of Destruction (Euro) ~ Gopher no Yabou - Episode II (Jpn) (Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_nemesis3bRomInfo, MSX_nemesis3bRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nessen Koushien (Jpn) - -static struct BurnRomInfo MSX_nkoshienRomDesc[] = { - { "nessen koushiyen (japan).rom", 0x04000, 0x2afbf7d1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nkoshien, MSX_nkoshien, msx_msx) -STD_ROM_FN(MSX_nkoshien) - -struct BurnDriver BurnDrvMSX_nkoshien = { - "msx_nkoshien", NULL, "msx_msx", NULL, "1984", - "Nessen Koushien (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_nkoshienRomInfo, MSX_nkoshienRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Night Shade (Jpn) - -static struct BurnRomInfo MSX_nightshdRomDesc[] = { - { "night shade (japan).rom", 0x08000, 0x72ddb449, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nightshd, MSX_nightshd, msx_msx) -STD_ROM_FN(MSX_nightshd) - -struct BurnDriver BurnDrvMSX_nightshd = { - "msx_nightshd", NULL, "msx_msx", NULL, "1986", - "Night Shade (Jpn)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_nightshdRomInfo, MSX_nightshdRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ninja II (Kor) - -static struct BurnRomInfo MSX_ninja2RomDesc[] = { - { "ninja.rom", 0x08000, 0x18510ca7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninja2, MSX_ninja2, msx_msx) -STD_ROM_FN(MSX_ninja2) - -struct BurnDriver BurnDrvMSX_ninja2 = { - "msx_ninja2", "msx_iganinp2", "msx_msx", NULL, "198?", - "Ninja II (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninja2RomInfo, MSX_ninja2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ninja Jajamaru-kun (Jpn) - -static struct BurnRomInfo MSX_ninjajajRomDesc[] = { - { "ninja jajamaru-kun (japan).rom", 0x08000, 0x2a28ff97, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninjajaj, MSX_ninjajaj, msx_msx) -STD_ROM_FN(MSX_ninjajaj) - -struct BurnDriver BurnDrvMSX_ninjajaj = { - "msx_ninjajaj", NULL, "msx_msx", NULL, "1986", - "Ninja Jajamaru-kun (Jpn)\0", NULL, "Jaleco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninjajajRomInfo, MSX_ninjajajRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ninja Jajamaru-kun (Kor) - -static struct BurnRomInfo MSX_ninjajajkRomDesc[] = { - { "ninja jaja maru kun (1986)(nippon dexter)[cr prosoft].rom", 0x08000, 0x9cc8c883, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninjajajk, MSX_ninjajajk, msx_msx) -STD_ROM_FN(MSX_ninjajajk) - -struct BurnDriver BurnDrvMSX_ninjajajk = { - "msx_ninjajajk", "msx_ninjajaj", "msx_msx", NULL, "19??", - "Ninja Jajamaru-kun (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninjajajkRomInfo, MSX_ninjajajkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ninja Princess (Jpn) - -static struct BurnRomInfo MSX_ninjapriRomDesc[] = { - { "ninja princess (japan).rom", 0x08000, 0x203ef741, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninjapri, MSX_ninjapri, msx_msx) -STD_ROM_FN(MSX_ninjapri) - -struct BurnDriver BurnDrvMSX_ninjapri = { - "msx_ninjapri", NULL, "msx_msx", NULL, "1986", - "Ninja Princess (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninjapriRomInfo, MSX_ninjapriRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ninja Princess (Jpn, Alt) - -static struct BurnRomInfo MSX_ninjapriaRomDesc[] = { - { "ninja princess (japan) (alt 1).rom", 0x08000, 0x99260557, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninjapria, MSX_ninjapria, msx_msx) -STD_ROM_FN(MSX_ninjapria) - -struct BurnDriver BurnDrvMSX_ninjapria = { - "msx_ninjapria", "msx_ninjapri", "msx_msx", NULL, "1986", - "Ninja Princess (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninjapriaRomInfo, MSX_ninjapriaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ninja-kun (Jpn) - -static struct BurnRomInfo MSX_ninjakunRomDesc[] = { - { "ninjakun (japan).rom", 0x04000, 0xd388cfd1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninjakun, MSX_ninjakun, msx_msx) -STD_ROM_FN(MSX_ninjakun) - -struct BurnDriver BurnDrvMSX_ninjakun = { - "msx_ninjakun", NULL, "msx_msx", NULL, "1983", - "Ninja-kun (Jpn)\0", NULL, "Toshiba", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninjakunRomInfo, MSX_ninjakunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ninja-kun - Majou no Bouken (Jpn) - -static struct BurnRomInfo MSX_ninjakmbRomDesc[] = { - { "ninjakun majou (japan).rom", 0x08000, 0xef339b82, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninjakmb, MSX_ninjakmb, msx_msx) -STD_ROM_FN(MSX_ninjakmb) - -struct BurnDriver BurnDrvMSX_ninjakmb = { - "msx_ninjakmb", NULL, "msx_msx", NULL, "1985", - "Ninja-kun - Majou no Bouken (Jpn)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninjakmbRomInfo, MSX_ninjakmbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ninjya Kage (Jpn) - -static struct BurnRomInfo MSX_ninjakagRomDesc[] = { - { "ninjya kage (japan).rom", 0x04000, 0xb202f481, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninjakag, MSX_ninjakag, msx_msx) -STD_ROM_FN(MSX_ninjakag) - -struct BurnDriver BurnDrvMSX_ninjakag = { - "msx_ninjakag", NULL, "msx_msx", NULL, "1984", - "Ninjya Kage (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninjakagRomInfo, MSX_ninjakagRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ninjya Kage (Jpn, Alt) - -static struct BurnRomInfo MSX_ninjakagaRomDesc[] = { - { "ninjya kage (japan) (alt 1).rom", 0x04000, 0x56bd8018, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninjakaga, MSX_ninjakaga, msx_msx) -STD_ROM_FN(MSX_ninjakaga) - -struct BurnDriver BurnDrvMSX_ninjakaga = { - "msx_ninjakaga", "msx_ninjakag", "msx_msx", NULL, "1984", - "Ninjya Kage (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninjakagaRomInfo, MSX_ninjakagaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Nuts & Milk (Jpn) - -static struct BurnRomInfo MSX_nutsmilkRomDesc[] = { - { "nuts_milk_(1984)_(hudson).rom", 0x08000, 0x8bff4901, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nutsmilk, MSX_nutsmilk, msx_msx) -STD_ROM_FN(MSX_nutsmilk) - -struct BurnDriver BurnDrvMSX_nutsmilk = { - "msx_nutsmilk", NULL, "msx_msx", NULL, "1983", - "Nuts & Milk (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_nutsmilkRomInfo, MSX_nutsmilkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// O'Mac Farmer (Jpn) - -static struct BurnRomInfo MSX_omacfarmRomDesc[] = { - { "o'mac farmer (japan).rom", 0x04000, 0xb05ffed2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_omacfarm, MSX_omacfarm, msx_msx) -STD_ROM_FN(MSX_omacfarm) - -struct BurnDriver BurnDrvMSX_omacfarm = { - "msx_omacfarm", NULL, "msx_msx", NULL, "1983", - "O'Mac Farmer (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_omacfarmRomInfo, MSX_omacfarmRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Oil's Well (Jpn) - -static struct BurnRomInfo MSX_oilswellRomDesc[] = { - { "oil's well (japan).rom", 0x08000, 0x3c7f3767, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_oilswell, MSX_oilswell, msx_msx) -STD_ROM_FN(MSX_oilswell) - -struct BurnDriver BurnDrvMSX_oilswell = { - "msx_oilswell", NULL, "msx_msx", NULL, "1985", - "Oil's Well (Jpn)\0", NULL, "Comptiq", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_oilswellRomInfo, MSX_oilswellRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Oil's Well (Jpn, Alt) - -static struct BurnRomInfo MSX_oilswellaRomDesc[] = { - { "oil's well (japan) (alt 1).rom", 0x08000, 0xaa2154fb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_oilswella, MSX_oilswella, msx_msx) -STD_ROM_FN(MSX_oilswella) - -struct BurnDriver BurnDrvMSX_oilswella = { - "msx_oilswella", "msx_oilswell", "msx_msx", NULL, "1985", - "Oil's Well (Jpn, Alt)\0", NULL, "Comptiq", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_oilswellaRomInfo, MSX_oilswellaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Othello (Jpn, Pony Canyon) - -static struct BurnRomInfo MSX_othelloRomDesc[] = { - { "othello (japan).rom", 0x08000, 0xfd3921cd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_othello, MSX_othello, msx_msx) -STD_ROM_FN(MSX_othello) - -struct BurnDriver BurnDrvMSX_othello = { - "msx_othello", NULL, "msx_msx", NULL, "1985", - "Othello (Jpn, Pony Canyon)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_othelloRomInfo, MSX_othelloRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Oyoide Tango (Jpn) - -static struct BurnRomInfo MSX_oyotangoRomDesc[] = { - { "oyoide tango (japan).rom", 0x02000, 0x01a24ca7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_oyotango, MSX_oyotango, msx_msx) -STD_ROM_FN(MSX_oyotango) - -struct BurnDriver BurnDrvMSX_oyotango = { - "msx_oyotango", NULL, "msx_msx", NULL, "1985", - "Oyoide Tango (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_oyotangoRomInfo, MSX_oyotangoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pac-Man (Jpn) - -static struct BurnRomInfo MSX_pacmanRomDesc[] = { - { "pac-man (japan).rom", 0x04000, 0xd74dffa2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pacman, MSX_pacman, msx_msx) -STD_ROM_FN(MSX_pacman) - -struct BurnDriver BurnDrvMSX_pacman = { - "msx_pacman", NULL, "msx_msx", NULL, "1984", - "Pac-Man (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pacmanRomInfo, MSX_pacmanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pac-Man (Jpn, Alt) - -static struct BurnRomInfo MSX_pacmanaRomDesc[] = { - { "pac-man (japan) (alt 1).rom", 0x08000, 0x505acae7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pacmana, MSX_pacmana, msx_msx) -STD_ROM_FN(MSX_pacmana) - -struct BurnDriver BurnDrvMSX_pacmana = { - "msx_pacmana", "msx_pacman", "msx_msx", NULL, "1984", - "Pac-Man (Jpn, Alt)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pacmanaRomInfo, MSX_pacmanaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pac-Man (Jpn, Alt 2) - -static struct BurnRomInfo MSX_pacmanbRomDesc[] = { - { "pac-man (japan) (alt 2).rom", 0x04000, 0x926bc903, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pacmanb, MSX_pacmanb, msx_msx) -STD_ROM_FN(MSX_pacmanb) - -struct BurnDriver BurnDrvMSX_pacmanb = { - "msx_pacmanb", "msx_pacman", "msx_msx", NULL, "1984", - "Pac-Man (Jpn, Alt 2)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pacmanbRomInfo, MSX_pacmanbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pachi Com (Jpn) - -static struct BurnRomInfo MSX_pachicomRomDesc[] = { - { "pachi com (japan).rom", 0x08000, 0xce7f6c91, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pachicom, MSX_pachicom, msx_msx) -STD_ROM_FN(MSX_pachicom) - -struct BurnDriver BurnDrvMSX_pachicom = { - "msx_pachicom", NULL, "msx_msx", NULL, "1985", - "Pachi Com (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pachicomRomInfo, MSX_pachicomRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pachi Com (Kor) - -static struct BurnRomInfo MSX_pachicomkRomDesc[] = { - { "pachicom (1985)(toshiba-emi)[cr boram soft].rom", 0x08000, 0xbc1b4322, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pachicomk, MSX_pachicomk, msx_msx) -STD_ROM_FN(MSX_pachicomk) - -struct BurnDriver BurnDrvMSX_pachicomk = { - "msx_pachicomk", "msx_pachicom", "msx_msx", NULL, "1986", - "Pachi Com (Kor)\0", NULL, "Boram Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pachicomkRomInfo, MSX_pachicomkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pachinko-U.F.O. (Jpn) - -static struct BurnRomInfo MSX_pachiufoRomDesc[] = { - { "casio pachinko-u.f.o. (japan).rom", 0x04000, 0x4088efaa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pachiufo, MSX_pachiufo, msx_msx) -STD_ROM_FN(MSX_pachiufo) - -struct BurnDriver BurnDrvMSX_pachiufo = { - "msx_pachiufo", NULL, "msx_msx", NULL, "1984", - "Pachinko-U.F.O. (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pachiufoRomInfo, MSX_pachiufoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pai Panic (Jpn) - -static struct BurnRomInfo MSX_paipanicRomDesc[] = { - { "pai panic (japan).rom", 0x04000, 0x6fd70773, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_paipanic, MSX_paipanic, msx_msx) -STD_ROM_FN(MSX_paipanic) - -struct BurnDriver BurnDrvMSX_paipanic = { - "msx_paipanic", NULL, "msx_msx", NULL, "1983", - "Pai Panic (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_paipanicRomInfo, MSX_paipanicRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pairs (Jpn) - -static struct BurnRomInfo MSX_pairsRomDesc[] = { - { "pairs (japan).rom", 0x04000, 0x9c1c10ca, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pairs, MSX_pairs, msx_msx) -STD_ROM_FN(MSX_pairs) - -struct BurnDriver BurnDrvMSX_pairs = { - "msx_pairs", NULL, "msx_msx", NULL, "1983", - "Pairs (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_pairsRomInfo, MSX_pairsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pairs (Jpn, Alt) - -static struct BurnRomInfo MSX_pairsaRomDesc[] = { - { "pairs (japan) (alt 1).rom", 0x04000, 0x3f042540, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pairsa, MSX_pairsa, msx_msx) -STD_ROM_FN(MSX_pairsa) - -struct BurnDriver BurnDrvMSX_pairsa = { - "msx_pairsa", "msx_pairs", "msx_msx", NULL, "1983", - "Pairs (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_pairsaRomInfo, MSX_pairsaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Panther (Jpn) - -static struct BurnRomInfo MSX_pantherRomDesc[] = { - { "panther (japan).rom", 0x08000, 0x33b9968c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_panther, MSX_panther, msx_msx) -STD_ROM_FN(MSX_panther) - -struct BurnDriver BurnDrvMSX_panther = { - "msx_panther", NULL, "msx_msx", NULL, "1986", - "Panther (Jpn)\0", NULL, "Irem", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pantherRomInfo, MSX_pantherRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Parodius - Tako wa Chikyuu wo Sukuu (Jpn) - -static struct BurnRomInfo MSX_parodiusRomDesc[] = { - { "parodius (japan).rom", 0x20000, 0x9bb308f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_parodius, MSX_parodius, msx_msx) -STD_ROM_FN(MSX_parodius) - -struct BurnDriver BurnDrvMSX_parodius = { - "msx_parodius", NULL, "msx_msx", NULL, "1988", - "Parodius - Tako wa Chikyuu wo Sukuu (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_parodiusRomInfo, MSX_parodiusRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Parodius - Tako wa Chikyuu wo Sukuu (Jpn, Alt) - -static struct BurnRomInfo MSX_parodiusaRomDesc[] = { - { "parodius (japan) (alt 1).rom", 0x20000, 0xca21cde4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_parodiusa, MSX_parodiusa, msx_msx) -STD_ROM_FN(MSX_parodiusa) - -struct BurnDriver BurnDrvMSX_parodiusa = { - "msx_parodiusa", "msx_parodius", "msx_msx", NULL, "1988", - "Parodius - Tako wa Chikyuu wo Sukuu (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_parodiusaRomInfo, MSX_parodiusaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Parodius - Tako Saves Earth (1988)(Konami)[SCC][RC-759].rom - -static struct BurnRomInfo MSX_parodiuseRomDesc[] = { - { "parodius (eng).rom", 0x20000, 0x68dea3f0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_parodiuse, MSX_parodiuse, msx_msx) -STD_ROM_FN(MSX_parodiuse) - -struct BurnDriver BurnDrvMSX_parodiuse = { - "msx_parodiuse", "msx_parodius", "msx_msx", NULL, "1988", - "Parodius - Tako Saves Earth (English)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_parodiuseRomInfo, MSX_parodiuseRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pastfinder (Jpn) - -static struct BurnRomInfo MSX_pastfindRomDesc[] = { - { "pastfinder (japan).rom", 0x04000, 0xd6d8d1d7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pastfind, MSX_pastfind, msx_msx) -STD_ROM_FN(MSX_pastfind) - -struct BurnDriver BurnDrvMSX_pastfind = { - "msx_pastfind", NULL, "msx_msx", NULL, "1984", - "Pastfinder (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pastfindRomInfo, MSX_pastfindRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Peetan (Jpn) - -static struct BurnRomInfo MSX_peetanRomDesc[] = { - { "peetan (japan).rom", 0x02000, 0x941069ae, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_peetan, MSX_peetan, msx_msx) -STD_ROM_FN(MSX_peetan) - -struct BurnDriver BurnDrvMSX_peetan = { - "msx_peetan", NULL, "msx_msx", NULL, "1984", - "Peetan (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_peetanRomInfo, MSX_peetanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pegasus (Jpn) - -static struct BurnRomInfo MSX_pegasusRomDesc[] = { - { "pegasus (japan).rom", 0x08000, 0xc23fa0d5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pegasus, MSX_pegasus, msx_msx) -STD_ROM_FN(MSX_pegasus) - -struct BurnDriver BurnDrvMSX_pegasus = { - "msx_pegasus", NULL, "msx_msx", NULL, "1986", - "Pegasus (Jpn)\0", NULL, "Victor", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pegasusRomInfo, MSX_pegasusRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Penguin Adventure (Euro) ~ Yume Tairiku Adventure (Jpn) - -static struct BurnRomInfo MSX_pengadvRomDesc[] = { - { "penguin adventure (japan, europe).rom", 0x20000, 0x0f6418d3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pengadv, MSX_pengadv, msx_msx) -STD_ROM_FN(MSX_pengadv) - -struct BurnDriver BurnDrvMSX_pengadv = { - "msx_pengadv", NULL, "msx_msx", NULL, "1986", - "Penguin Adventure (Euro) ~ Yume Tairiku Adventure (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_pengadvRomInfo, MSX_pengadvRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yume Tairiku Adventure (Kor, Zemina) - -static struct BurnRomInfo MSX_pengadvk1RomDesc[] = { - { "yume tairiku adventure. penguin adventure (1987)(zemina)[rc-743].rom", 0x20000, 0x80814e55, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pengadvk1, MSX_pengadvk1, msx_msx) -STD_ROM_FN(MSX_pengadvk1) - -struct BurnDriver BurnDrvMSX_pengadvk1 = { - "msx_pengadvk1", "msx_pengadv", "msx_msx", NULL, "1987", - "Yume Tairiku Adventure (Kor, Zemina)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_pengadvk1RomInfo, MSX_pengadvk1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yume Tairiku Adventure (Kor, Screen Software) - -static struct BurnRomInfo MSX_pengadvk2RomDesc[] = { - { "yume tairiku adventure. penguin adventure (1986)(konami)[cr screen][rc-743].rom", 0x20000, 0x38c35d99, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pengadvk2, MSX_pengadvk2, msx_msx) -STD_ROM_FN(MSX_pengadvk2) - -struct BurnDriver BurnDrvMSX_pengadvk2 = { - "msx_pengadvk2", "msx_pengadv", "msx_msx", NULL, "1988", - "Yume Tairiku Adventure (Kor, Screen Software)\0", NULL, "Screen Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_pengadvk2RomInfo, MSX_pengadvk2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Penguin-kun Wars (Jpn) - -static struct BurnRomInfo MSX_penguinwRomDesc[] = { - { "penguin-kun wars (japan).rom", 0x08000, 0x6d2b3e0c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_penguinw, MSX_penguinw, msx_msx) -STD_ROM_FN(MSX_penguinw) - -struct BurnDriver BurnDrvMSX_penguinw = { - "msx_penguinw", NULL, "msx_msx", NULL, "1985", - "Penguin-kun Wars (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_penguinwRomInfo, MSX_penguinwRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Penguin-kun Wars (Kor) - -static struct BurnRomInfo MSX_penguinwkRomDesc[] = { - { "penguin wars (1985)(ascii)[cr prosoft].rom", 0x08000, 0x9827fad6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_penguinwk, MSX_penguinwk, msx_msx) -STD_ROM_FN(MSX_penguinwk) - -struct BurnDriver BurnDrvMSX_penguinwk = { - "msx_penguinwk", "msx_penguinw", "msx_msx", NULL, "19??", - "Penguin-kun Wars (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_penguinwkRomInfo, MSX_penguinwkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pico Pico (Jpn) - -static struct BurnRomInfo MSX_picopicoRomDesc[] = { - { "pico pico (japan).rom", 0x02000, 0xba3e62d3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_picopico, MSX_picopico, msx_msx) -STD_ROM_FN(MSX_picopico) - -struct BurnDriver BurnDrvMSX_picopico = { - "msx_picopico", NULL, "msx_msx", NULL, "1983", - "Pico Pico (Jpn)\0", NULL, "Microcabin", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_picopicoRomInfo, MSX_picopicoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pillbox (Jpn) - -static struct BurnRomInfo MSX_pillboxRomDesc[] = { - { "pillbox (japan).rom", 0x04000, 0x436c3f29, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pillbox, MSX_pillbox, msx_msx) -STD_ROM_FN(MSX_pillbox) - -struct BurnDriver BurnDrvMSX_pillbox = { - "msx_pillbox", NULL, "msx_msx", NULL, "1983", - "Pillbox (Jpn)\0", NULL, "Magicsoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pillboxRomInfo, MSX_pillboxRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pillbox (Jpn, Alt) - -static struct BurnRomInfo MSX_pillboxaRomDesc[] = { - { "pillbox (japan) (alt 1).rom", 0x04000, 0x3345caef, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pillboxa, MSX_pillboxa, msx_msx) -STD_ROM_FN(MSX_pillboxa) - -struct BurnDriver BurnDrvMSX_pillboxa = { - "msx_pillboxa", "msx_pillbox", "msx_msx", NULL, "1983", - "Pillbox (Jpn, Alt)\0", NULL, "Magicsoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pillboxaRomInfo, MSX_pillboxaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pinball Blaster (Euro) - -static struct BurnRomInfo MSX_pinblastRomDesc[] = { - { "pinball blaster (europe).rom", 0x10000, 0x68fe9580, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pinblast, MSX_pinblast, msx_msx) -STD_ROM_FN(MSX_pinblast) - -struct BurnDriver BurnDrvMSX_pinblast = { - "msx_pinblast", NULL, "msx_msx", NULL, "1988", - "Pinball Blaster (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_pinblastRomInfo, MSX_pinblastRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pine Applin (Jpn) - -static struct BurnRomInfo MSX_pineapplRomDesc[] = { - { "pine applin (japan).rom", 0x04000, 0x7411c6f2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pineappl, MSX_pineappl, msx_msx) -STD_ROM_FN(MSX_pineappl) - -struct BurnDriver BurnDrvMSX_pineappl = { - "msx_pineappl", NULL, "msx_msx", NULL, "1984", - "Pine Applin (Jpn)\0", NULL, "ZAP", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pineapplRomInfo, MSX_pineapplRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pine Applin (Jpn, Alt) - -static struct BurnRomInfo MSX_pineapplaRomDesc[] = { - { "pine applin (japan) (alt 1).rom", 0x04000, 0xbdcb6199, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pineappla, MSX_pineappla, msx_msx) -STD_ROM_FN(MSX_pineappla) - -struct BurnDriver BurnDrvMSX_pineappla = { - "msx_pineappla", "msx_pineappl", "msx_msx", NULL, "1984", - "Pine Applin (Jpn, Alt)\0", NULL, "ZAP", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pineapplaRomInfo, MSX_pineapplaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pinky Chase (Jpn) - -static struct BurnRomInfo MSX_pinkychsRomDesc[] = { - { "pinky chase (japan).rom", 0x04000, 0xb5b40df0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pinkychs, MSX_pinkychs, msx_msx) -STD_ROM_FN(MSX_pinkychs) - -struct BurnDriver BurnDrvMSX_pinkychs = { - "msx_pinkychs", NULL, "msx_msx", NULL, "1984", - "Pinky Chase (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pinkychsRomInfo, MSX_pinkychsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pipi (Jpn) - -static struct BurnRomInfo MSX_pipiRomDesc[] = { - { "pipi (japan).rom", 0x08000, 0x6f172cd8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pipi, MSX_pipi, msx_msx) -STD_ROM_FN(MSX_pipi) - -struct BurnDriver BurnDrvMSX_pipi = { - "msx_pipi", NULL, "msx_msx", NULL, "1985", - "Pipi (Jpn)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pipiRomInfo, MSX_pipiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pippols (Jpn) - -static struct BurnRomInfo MSX_pippolsRomDesc[] = { - { "pippols (japan).rom", 0x04000, 0xbe6a5e19, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pippols, MSX_pippols, msx_msx) -STD_ROM_FN(MSX_pippols) - -struct BurnDriver BurnDrvMSX_pippols = { - "msx_pippols", NULL, "msx_msx", NULL, "1985", - "Pippols (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pippolsRomInfo, MSX_pippolsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pippols (Jpn, Alt) - -static struct BurnRomInfo MSX_pippolsaRomDesc[] = { - { "pippols (japan) (alt 1).rom", 0x04000, 0xf4e97ad5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pippolsa, MSX_pippolsa, msx_msx) -STD_ROM_FN(MSX_pippolsa) - -struct BurnDriver BurnDrvMSX_pippolsa = { - "msx_pippolsa", "msx_pippols", "msx_msx", NULL, "1985", - "Pippols (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pippolsaRomInfo, MSX_pippolsaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pippols (Jpn, Alt 2) - -static struct BurnRomInfo MSX_pippolsbRomDesc[] = { - { "pippols (japan) (alt 2).rom", 0x04000, 0xd5fe3564, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pippolsb, MSX_pippolsb, msx_msx) -STD_ROM_FN(MSX_pippolsb) - -struct BurnDriver BurnDrvMSX_pippolsb = { - "msx_pippolsb", "msx_pippols", "msx_msx", NULL, "1985", - "Pippols (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pippolsbRomInfo, MSX_pippolsbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pippols (Jpn, Alt 3) - -static struct BurnRomInfo MSX_pippolscRomDesc[] = { - { "pippols (japan) (alt 3).rom", 0x04000, 0xeab63f24, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pippolsc, MSX_pippolsc, msx_msx) -STD_ROM_FN(MSX_pippolsc) - -struct BurnDriver BurnDrvMSX_pippolsc = { - "msx_pippolsc", "msx_pippols", "msx_msx", NULL, "1985", - "Pippols (Jpn, Alt 3)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pippolscRomInfo, MSX_pippolscRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pitfall II - Lost Caverns (Jpn) - -static struct BurnRomInfo MSX_pitfall2RomDesc[] = { - { "pitfall ii - lost caverns (japan).rom", 0x04000, 0xd307a7b8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pitfall2, MSX_pitfall2, msx_msx) -STD_ROM_FN(MSX_pitfall2) - -struct BurnDriver BurnDrvMSX_pitfall2 = { - "msx_pitfall2", NULL, "msx_msx", NULL, "1984", - "Pitfall II - Lost Caverns (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pitfall2RomInfo, MSX_pitfall2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pitfall II - Lost Caverns (Jpn, Alt) - -static struct BurnRomInfo MSX_pitfall2aRomDesc[] = { - { "pitfall ii - lost caverns (japan) (alt 1).rom", 0x04000, 0x71c59868, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pitfall2a, MSX_pitfall2a, msx_msx) -STD_ROM_FN(MSX_pitfall2a) - -struct BurnDriver BurnDrvMSX_pitfall2a = { - "msx_pitfall2a", "msx_pitfall2", "msx_msx", NULL, "1984", - "Pitfall II - Lost Caverns (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pitfall2aRomInfo, MSX_pitfall2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pitfall! (Jpn) - -static struct BurnRomInfo MSX_pitfallRomDesc[] = { - { "pitfall! (japan).rom", 0x04000, 0x5a009c55, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pitfall, MSX_pitfall, msx_msx) -STD_ROM_FN(MSX_pitfall) - -struct BurnDriver BurnDrvMSX_pitfall = { - "msx_pitfall", NULL, "msx_msx", NULL, "1984", - "Pitfall! (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pitfallRomInfo, MSX_pitfallRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pitfall! (Jpn, Alt) - -static struct BurnRomInfo MSX_pitfallaRomDesc[] = { - { "pitfall! (japan) (alt 1).rom", 0x04000, 0x930aeb2c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pitfalla, MSX_pitfalla, msx_msx) -STD_ROM_FN(MSX_pitfalla) - -struct BurnDriver BurnDrvMSX_pitfalla = { - "msx_pitfalla", "msx_pitfall", "msx_msx", NULL, "1984", - "Pitfall! (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pitfallaRomInfo, MSX_pitfallaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pitfall! (Jpn, Alt 2) - -static struct BurnRomInfo MSX_pitfallbRomDesc[] = { - { "pitfall! (japan) (alt 2).rom", 0x04000, 0x2cb24473, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pitfallb, MSX_pitfallb, msx_msx) -STD_ROM_FN(MSX_pitfallb) - -struct BurnDriver BurnDrvMSX_pitfallb = { - "msx_pitfallb", "msx_pitfall", "msx_msx", NULL, "1984", - "Pitfall! (Jpn, Alt 2)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pitfallbRomInfo, MSX_pitfallbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Play Ball (Jpn) - -static struct BurnRomInfo MSX_playballRomDesc[] = { - { "play ball (japan).rom", 0x08000, 0xd178833b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_playball, MSX_playball, msx_msx) -STD_ROM_FN(MSX_playball) - -struct BurnDriver BurnDrvMSX_playball = { - "msx_playball", NULL, "msx_msx", NULL, "1986", - "Play Ball (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_playballRomInfo, MSX_playballRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Police Story (Jpn) - -static struct BurnRomInfo MSX_policestRomDesc[] = { - { "police story, the (japan).rom", 0x08000, 0x7867d044, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_policest, MSX_policest, msx_msx) -STD_ROM_FN(MSX_policest) - -struct BurnDriver BurnDrvMSX_policest = { - "msx_policest", NULL, "msx_msx", NULL, "1986", - "The Police Story (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_policestRomInfo, MSX_policestRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Police Story (Jpn, Alt) - -static struct BurnRomInfo MSX_policestaRomDesc[] = { - { "police story, the (japan) (alt 1).rom", 0x08000, 0xe4554b51, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_policesta, MSX_policesta, msx_msx) -STD_ROM_FN(MSX_policesta) - -struct BurnDriver BurnDrvMSX_policesta = { - "msx_policesta", "msx_policest", "msx_msx", NULL, "1986", - "The Police Story (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_policestaRomInfo, MSX_policestaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pooyan (Jpn) - -static struct BurnRomInfo MSX_pooyanRomDesc[] = { - { "pooyan (japan).rom", 0x04000, 0x558a09f6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pooyan, MSX_pooyan, msx_msx) -STD_ROM_FN(MSX_pooyan) - -struct BurnDriver BurnDrvMSX_pooyan = { - "msx_pooyan", NULL, "msx_msx", NULL, "1985", - "Pooyan (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pooyanRomInfo, MSX_pooyanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Poppaq the Fish (Jpn) - -static struct BurnRomInfo MSX_poppaqRomDesc[] = { - { "poppaq the fish (japan).rom", 0x04000, 0xbd387377, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_poppaq, MSX_poppaq, msx_msx) -STD_ROM_FN(MSX_poppaq) - -struct BurnDriver BurnDrvMSX_poppaq = { - "msx_poppaq", NULL, "msx_msx", NULL, "1984", - "Poppaq the Fish (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_poppaqRomInfo, MSX_poppaqRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Poppaq the Fish (Kor) - -static struct BurnRomInfo MSX_poppaqkRomDesc[] = { - { "poppaq the fish (1986)(ascii)[cr boram soft].rom", 0x04000, 0xcc36e779, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_poppaqk, MSX_poppaqk, msx_msx) -STD_ROM_FN(MSX_poppaqk) - -struct BurnDriver BurnDrvMSX_poppaqk = { - "msx_poppaqk", "msx_poppaq", "msx_msx", NULL, "1986", - "Poppaq the Fish (Kor)\0", NULL, "Boram Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_poppaqkRomInfo, MSX_poppaqkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Price of Magik (Euro) - -static struct BurnRomInfo MSX_pricemagRomDesc[] = { - { "price of magik, the (europe).rom", 0x10000, 0xb43e7881, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pricemag, MSX_pricemag, msx_msx) -STD_ROM_FN(MSX_pricemag) - -struct BurnDriver BurnDrvMSX_pricemag = { - "msx_pricemag", NULL, "msx_msx", NULL, "1986", - "The Price of Magik (Euro)\0", NULL, "Level 9 Computing", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_pricemagRomInfo, MSX_pricemagRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Professional Baseball (Jpn) - -static struct BurnRomInfo MSX_profbbRomDesc[] = { - { "professional baseball (japan).rom", 0x08000, 0x8ca4cd58, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_profbb, MSX_profbb, msx_msx) -STD_ROM_FN(MSX_profbb) - -struct BurnDriver BurnDrvMSX_profbb = { - "msx_profbb", NULL, "msx_msx", NULL, "1986", - "Professional Baseball (Jpn)\0", NULL, "Technopolis Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_profbbRomInfo, MSX_profbbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Protector (Jpn) - -static struct BurnRomInfo MSX_protectrRomDesc[] = { - { "protector, the (japan).rom", 0x04000, 0x5747e69d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_protectr, MSX_protectr, msx_msx) -STD_ROM_FN(MSX_protectr) - -struct BurnDriver BurnDrvMSX_protectr = { - "msx_protectr", NULL, "msx_msx", NULL, "1985", - "The Protector (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_protectrRomInfo, MSX_protectrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Puznic - -static struct BurnRomInfo MSX_puznicRomDesc[] = { - { "puznic.rom", 0x08000, 0xac28fa71, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_puznic, MSX_puznic, msx_msx) -STD_ROM_FN(MSX_puznic) - -struct BurnDriver BurnDrvMSX_puznic = { - "msx_puznic", NULL, "msx_msx", NULL, "1990", - "Puznic\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_puznicRomInfo, MSX_puznicRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Puzzle Panic (Jpn) - -static struct BurnRomInfo MSX_puzpanicRomDesc[] = { - { "puzzle panic (japan).rom", 0x08000, 0x1313c0c7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_puzpanic, MSX_puzpanic, msx_msx) -STD_ROM_FN(MSX_puzpanic) - -struct BurnDriver BurnDrvMSX_puzpanic = { - "msx_puzpanic", NULL, "msx_msx", NULL, "1986", - "Puzzle Panic (Jpn)\0", NULL, "System Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_puzpanicRomInfo, MSX_puzpanicRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pyramid Warp (Jpn) - -static struct BurnRomInfo MSX_pyramidwRomDesc[] = { - { "pyramid warp (japan).rom", 0x02000, 0x0aec8ddb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pyramidw, MSX_pyramidw, msx_msx) -STD_ROM_FN(MSX_pyramidw) - -struct BurnDriver BurnDrvMSX_pyramidw = { - "msx_pyramidw", NULL, "msx_msx", NULL, "1983", - "Pyramid Warp (Jpn)\0", NULL, "T&E Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pyramidwRomInfo, MSX_pyramidwRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Q*bert (Jpn) - -static struct BurnRomInfo MSX_qbertRomDesc[] = { - { "q-bert (japan).rom", 0x08000, 0x0e988f0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_qbert, MSX_qbert, msx_msx) -STD_ROM_FN(MSX_qbert) - -struct BurnDriver BurnDrvMSX_qbert = { - "msx_qbert", NULL, "msx_msx", NULL, "1986", - "Q*bert (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_qbertRomInfo, MSX_qbertRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Q*bert (Jpn, Alt) - -static struct BurnRomInfo MSX_qbertaRomDesc[] = { - { "q-bert (japan) (alt 1).rom", 0x08000, 0xa112532b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_qberta, MSX_qberta, msx_msx) -STD_ROM_FN(MSX_qberta) - -struct BurnDriver BurnDrvMSX_qberta = { - "msx_qberta", "msx_qbert", "msx_msx", NULL, "1986", - "Q*bert (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_qbertaRomInfo, MSX_qbertaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Queen's Golf (Jpn) - -static struct BurnRomInfo MSX_queenglfRomDesc[] = { - { "queen's golf (japan).rom", 0x04000, 0x40eef5cd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_queenglf, MSX_queenglf, msx_msx) -STD_ROM_FN(MSX_queenglf) - -struct BurnDriver BurnDrvMSX_queenglf = { - "msx_queenglf", NULL, "msx_msx", NULL, "1984", - "Queen's Golf (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_queenglfRomInfo, MSX_queenglfRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Queen's Golf (Jpn, Alt) - -static struct BurnRomInfo MSX_queenglfaRomDesc[] = { - { "queen's golf (japan) (alt 2).rom", 0x04000, 0x9c4787d7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_queenglfa, MSX_queenglfa, msx_msx) -STD_ROM_FN(MSX_queenglfa) - -struct BurnDriver BurnDrvMSX_queenglfa = { - "msx_queenglfa", "msx_queenglf", "msx_msx", NULL, "1984", - "Queen's Golf (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_queenglfaRomInfo, MSX_queenglfaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Queen's Golf (Jpn, Hacked?) - -static struct BurnRomInfo MSX_queenglfbRomDesc[] = { - { "queen's golf (japan) (alt 1).rom", 0x04000, 0x27b78cb3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_queenglfb, MSX_queenglfb, msx_msx) -STD_ROM_FN(MSX_queenglfb) - -struct BurnDriver BurnDrvMSX_queenglfb = { - "msx_queenglfb", "msx_queenglf", "msx_msx", NULL, "1984", - "Queen's Golf (Jpn, Hacked?)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_queenglfbRomInfo, MSX_queenglfbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Raid on Bungeling Bay (Jpn) - -static struct BurnRomInfo MSX_raidbungRomDesc[] = { - { "raid on bungeling bay (japan).rom", 0x08000, 0xa87a666d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_raidbung, MSX_raidbung, msx_msx) -STD_ROM_FN(MSX_raidbung) - -struct BurnDriver BurnDrvMSX_raidbung = { - "msx_raidbung", NULL, "msx_msx", NULL, "1984", - "Raid on Bungeling Bay (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_raidbungRomInfo, MSX_raidbungRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rally-X (Jpn) - -static struct BurnRomInfo MSX_rallyxRomDesc[] = { - { "rally-x (japan).rom", 0x04000, 0x63413493, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rallyx, MSX_rallyx, msx_msx) -STD_ROM_FN(MSX_rallyx) - -struct BurnDriver BurnDrvMSX_rallyx = { - "msx_rallyx", NULL, "msx_msx", NULL, "1984", - "Rally-X (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rallyxRomInfo, MSX_rallyxRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rally-X (Jpn, Alt) - -static struct BurnRomInfo MSX_rallyxaRomDesc[] = { - { "rally-x (japan) (alt 1).rom", 0x04000, 0x9fd2f1dc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rallyxa, MSX_rallyxa, msx_msx) -STD_ROM_FN(MSX_rallyxa) - -struct BurnDriver BurnDrvMSX_rallyxa = { - "msx_rallyxa", "msx_rallyx", "msx_msx", NULL, "1984", - "Rally-X (Jpn, Alt)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rallyxaRomInfo, MSX_rallyxaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rally-X (Jpn, Alt 2) - -static struct BurnRomInfo MSX_rallyxbRomDesc[] = { - { "rally-x (japan) (alt 2).rom", 0x08000, 0x2b5cb04e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rallyxb, MSX_rallyxb, msx_msx) -STD_ROM_FN(MSX_rallyxb) - -struct BurnDriver BurnDrvMSX_rallyxb = { - "msx_rallyxb", "msx_rallyx", "msx_msx", NULL, "1984", - "Rally-X (Jpn, Alt 2)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rallyxbRomInfo, MSX_rallyxbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rally-X (Kor) - -static struct BurnRomInfo MSX_rallyxkRomDesc[] = { - { "rally-x.rom", 0x08000, 0xcf49b8f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rallyxk, MSX_rallyxk, msx_msx) -STD_ROM_FN(MSX_rallyxk) - -struct BurnDriver BurnDrvMSX_rallyxk = { - "msx_rallyxk", "msx_rallyx", "msx_msx", NULL, "198?", - "Rally-X (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rallyxkRomInfo, MSX_rallyxkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rambo (Jpn) - -static struct BurnRomInfo MSX_ramboRomDesc[] = { - { "rambo (japan).rom", 0x08000, 0x6a2e3726, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rambo, MSX_rambo, msx_msx) -STD_ROM_FN(MSX_rambo) - -struct BurnDriver BurnDrvMSX_rambo = { - "msx_rambo", NULL, "msx_msx", NULL, "1985", - "Rambo (Jpn)\0", NULL, "Pack-In-Video", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ramboRomInfo, MSX_ramboRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rambo (Jpn, Alt) - -static struct BurnRomInfo MSX_ramboaRomDesc[] = { - { "rambo (japan) (alt 1).rom", 0x08000, 0xdba4377b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ramboa, MSX_ramboa, msx_msx) -STD_ROM_FN(MSX_ramboa) - -struct BurnDriver BurnDrvMSX_ramboa = { - "msx_ramboa", "msx_rambo", "msx_msx", NULL, "1985", - "Rambo (Jpn, Alt)\0", NULL, "Pack-In-Video", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ramboaRomInfo, MSX_ramboaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rambo (Jpn, Alt 2) - -static struct BurnRomInfo MSX_rambobRomDesc[] = { - { "rambo (japan) (alt 2).rom", 0x08000, 0x0859f662, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rambob, MSX_rambob, msx_msx) -STD_ROM_FN(MSX_rambob) - -struct BurnDriver BurnDrvMSX_rambob = { - "msx_rambob", "msx_rambo", "msx_msx", NULL, "1985", - "Rambo (Jpn, Alt 2)\0", NULL, "Pack-In-Video", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rambobRomInfo, MSX_rambobRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rambo (Jpn, Alt 3) - -static struct BurnRomInfo MSX_rambocRomDesc[] = { - { "rambo (japan) (alt 3).rom", 0x08000, 0x2236ddf6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ramboc, MSX_ramboc, msx_msx) -STD_ROM_FN(MSX_ramboc) - -struct BurnDriver BurnDrvMSX_ramboc = { - "msx_ramboc", "msx_rambo", "msx_msx", NULL, "1985", - "Rambo (Jpn, Alt 3)\0", NULL, "Pack-In-Video", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rambocRomInfo, MSX_rambocRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Real Tennis (Jpn) - -static struct BurnRomInfo MSX_realtennRomDesc[] = { - { "real tennis (japan).rom", 0x02000, 0x25fe441c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_realtenn, MSX_realtenn, msx_msx) -STD_ROM_FN(MSX_realtenn) - -struct BurnDriver BurnDrvMSX_realtenn = { - "msx_realtenn", NULL, "msx_msx", NULL, "1983", - "Real Tennis (Jpn)\0", NULL, "Takara", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_realtennRomInfo, MSX_realtennRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Red Zone (Jpn) - -static struct BurnRomInfo MSX_redzoneRomDesc[] = { - { "red zone (japan).rom", 0x04000, 0xe9b5b6ff, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_redzone, MSX_redzone, msx_msx) -STD_ROM_FN(MSX_redzone) - -struct BurnDriver BurnDrvMSX_redzone = { - "msx_redzone", NULL, "msx_msx", NULL, "1985", - "Red Zone (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_redzoneRomInfo, MSX_redzoneRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Red Zone (Jpn, Alt) - -static struct BurnRomInfo MSX_redzoneaRomDesc[] = { - { "red zone (japan) (alt 1).rom", 0x04000, 0x0c2da50f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_redzonea, MSX_redzonea, msx_msx) -STD_ROM_FN(MSX_redzonea) - -struct BurnDriver BurnDrvMSX_redzonea = { - "msx_redzonea", "msx_redzone", "msx_msx", NULL, "1985", - "Red Zone (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_redzoneaRomInfo, MSX_redzoneaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rise Out from Dungeons (Jpn) - -static struct BurnRomInfo MSX_risedungRomDesc[] = { - { "rise out from dungeons (japan).rom", 0x04000, 0x6a6d37cf, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_risedung, MSX_risedung, msx_msx) -STD_ROM_FN(MSX_risedung) - -struct BurnDriver BurnDrvMSX_risedung = { - "msx_risedung", NULL, "msx_msx", NULL, "1983", - "Rise Out from Dungeons (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_risedungRomInfo, MSX_risedungRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rise Out from Dungeons (Jpn, Alt) - -static struct BurnRomInfo MSX_risedungaRomDesc[] = { - { "rise out from dungeons (japan) (alt 1).rom", 0x04000, 0x01043328, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_risedunga, MSX_risedunga, msx_msx) -STD_ROM_FN(MSX_risedunga) - -struct BurnDriver BurnDrvMSX_risedunga = { - "msx_risedunga", "msx_risedung", "msx_msx", NULL, "1983", - "Rise Out from Dungeons (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_risedungaRomInfo, MSX_risedungaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// River Raid (Jpn) - -static struct BurnRomInfo MSX_riveraidRomDesc[] = { - { "river raid (japan).rom", 0x04000, 0x2fc1d75b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_riveraid, MSX_riveraid, msx_msx) -STD_ROM_FN(MSX_riveraid) - -struct BurnDriver BurnDrvMSX_riveraid = { - "msx_riveraid", NULL, "msx_msx", NULL, "1985", - "River Raid (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_riveraidRomInfo, MSX_riveraidRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Road Fighter (Jpn) - -static struct BurnRomInfo MSX_roadfghtRomDesc[] = { - { "road fighter (japan).rom", 0x04000, 0x01ddb68f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_roadfght, MSX_roadfght, msx_msx) -STD_ROM_FN(MSX_roadfght) - -struct BurnDriver BurnDrvMSX_roadfght = { - "msx_roadfght", NULL, "msx_msx", NULL, "1985", - "Road Fighter (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_roadfghtRomInfo, MSX_roadfghtRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Road Fighter (Jpn, Alt) - -static struct BurnRomInfo MSX_roadfghtaRomDesc[] = { - { "road fighter (japan) (alt 1).rom", 0x04000, 0xcb82d8c9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_roadfghta, MSX_roadfghta, msx_msx) -STD_ROM_FN(MSX_roadfghta) - -struct BurnDriver BurnDrvMSX_roadfghta = { - "msx_roadfghta", "msx_roadfght", "msx_msx", NULL, "1985", - "Road Fighter (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_roadfghtaRomInfo, MSX_roadfghtaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// RoboCop - -static struct BurnRomInfo MSX_seicorobocopRomDesc[] = { - { "sieco_robocop_(1992)(sieco).rom", 0x20000, 0x4628ef05, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_seicorobocop, MSX_seicorobocop, msx_msx) -STD_ROM_FN(MSX_seicorobocop) - -struct BurnDriver BurnDrvMSX_seicorobocop = { - "msx_seicorobocop", NULL, "msx_msx", NULL, "1992", - "RoboCop\0", NULL, "Sieco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_seicorobocopRomInfo, MSX_seicorobocopRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Robofrog (Jpn) - -static struct BurnRomInfo MSX_robofrogRomDesc[] = { - { "robofrog (japan).rom", 0x04000, 0x99ddb974, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_robofrog, MSX_robofrog, msx_msx) -STD_ROM_FN(MSX_robofrog) - -struct BurnDriver BurnDrvMSX_robofrog = { - "msx_robofrog", NULL, "msx_msx", NULL, "1985", - "Robofrog (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_robofrogRomInfo, MSX_robofrogRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Robofrog (Jpn, Alt) - -static struct BurnRomInfo MSX_robofrogaRomDesc[] = { - { "robofrog (japan) (alt 1).rom", 0x04000, 0x82e47a43, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_robofroga, MSX_robofroga, msx_msx) -STD_ROM_FN(MSX_robofroga) - -struct BurnDriver BurnDrvMSX_robofroga = { - "msx_robofroga", "msx_robofrog", "msx_msx", NULL, "1985", - "Robofrog (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_robofrogaRomInfo, MSX_robofrogaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rock'n Bolt (Jpn) - -static struct BurnRomInfo MSX_rockboltRomDesc[] = { - { "rock'n bolt (japan).rom", 0x04000, 0x430e5789, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rockbolt, MSX_rockbolt, msx_msx) -STD_ROM_FN(MSX_rockbolt) - -struct BurnDriver BurnDrvMSX_rockbolt = { - "msx_rockbolt", NULL, "msx_msx", NULL, "1985", - "Rock'n Bolt (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rockboltRomInfo, MSX_rockboltRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Roger Rubbish (Euro) - -static struct BurnRomInfo MSX_rogerrubRomDesc[] = { - { "roger rubbish (europe).rom", 0x04000, 0x452556ce, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rogerrub, MSX_rogerrub, msx_msx) -STD_ROM_FN(MSX_rogerrub) - -struct BurnDriver BurnDrvMSX_rogerrub = { - "msx_rogerrub", NULL, "msx_msx", NULL, "1985", - "Roger Rubbish (Euro)\0", NULL, "Spectravideo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rogerrubRomInfo, MSX_rogerrubRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Roger Rubbish (Euro, Alt) - -static struct BurnRomInfo MSX_rogerrubaRomDesc[] = { - { "roger rubbish (europe) (alt 1).rom", 0x02000, 0x33056633, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rogerruba, MSX_rogerruba, msx_msx) -STD_ROM_FN(MSX_rogerruba) - -struct BurnDriver BurnDrvMSX_rogerruba = { - "msx_rogerruba", "msx_rogerrub", "msx_msx", NULL, "1985", - "Roger Rubbish (Euro, Alt)\0", NULL, "Spectravideo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rogerrubaRomInfo, MSX_rogerrubaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Roller Ball (Jpn) - -static struct BurnRomInfo MSX_rollerblRomDesc[] = { - { "roller ball (japan).rom", 0x04000, 0x56200fef, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rollerbl, MSX_rollerbl, msx_msx) -STD_ROM_FN(MSX_rollerbl) - -struct BurnDriver BurnDrvMSX_rollerbl = { - "msx_rollerbl", NULL, "msx_msx", NULL, "1984", - "Roller Ball (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rollerblRomInfo, MSX_rollerblRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Roller Ball (Jpn, Alt) - -static struct BurnRomInfo MSX_rollerblaRomDesc[] = { - { "roller ball (japan) (alt 1).rom", 0x04000, 0x798fa044, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rollerbla, MSX_rollerbla, msx_msx) -STD_ROM_FN(MSX_rollerbla) - -struct BurnDriver BurnDrvMSX_rollerbla = { - "msx_rollerbla", "msx_rollerbl", "msx_msx", NULL, "1984", - "Roller Ball (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rollerblaRomInfo, MSX_rollerblaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Rotors (Jpn) - -static struct BurnRomInfo MSX_rotorsRomDesc[] = { - { "rotors (japan).rom", 0x04000, 0x1cdb462e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rotors, MSX_rotors, msx_msx) -STD_ROM_FN(MSX_rotors) - -struct BurnDriver BurnDrvMSX_rotors = { - "msx_rotors", NULL, "msx_msx", NULL, "1984", - "Rotors (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_rotorsRomInfo, MSX_rotorsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Salamander (Jpn) - -static struct BurnRomInfo MSX_salamandRomDesc[] = { - { "salamander (japan).rom", 0x20000, 0xc36f559d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_salamand, MSX_salamand, msx_msx) -STD_ROM_FN(MSX_salamand) - -struct BurnDriver BurnDrvMSX_salamand = { - "msx_salamand", NULL, "msx_msx", NULL, "1987", - "Salamander (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_salamandRomInfo, MSX_salamandRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Salamander - Operation X (Kor) - -static struct BurnRomInfo MSX_salamandkRomDesc[] = { - { "salamander - operation x (1988)(zemina)[rc-758].rom", 0x20000, 0x40d19bf6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_salamandk, MSX_salamandk, msx_msx) -STD_ROM_FN(MSX_salamandk) - -struct BurnDriver BurnDrvMSX_salamandk = { - "msx_salamandk", "msx_salamand", "msx_msx", NULL, "1988", - "Salamander - Operation X (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_salamandkRomInfo, MSX_salamandkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sasa (Jpn) - -static struct BurnRomInfo MSX_sasaRomDesc[] = { - { "sasa (japan).rom", 0x04000, 0x7faf00c0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sasa, MSX_sasa, msx_msx) -STD_ROM_FN(MSX_sasa) - -struct BurnDriver BurnDrvMSX_sasa = { - "msx_sasa", NULL, "msx_msx", NULL, "1984", - "Sasa (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sasaRomInfo, MSX_sasaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sasa (Jpn, Alt) - -static struct BurnRomInfo MSX_sasaaRomDesc[] = { - { "sasa (japan) (alt 1).rom", 0x04000, 0xae6f517d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sasaa, MSX_sasaa, msx_msx) -STD_ROM_FN(MSX_sasaa) - -struct BurnDriver BurnDrvMSX_sasaa = { - "msx_sasaa", "msx_sasa", "msx_msx", NULL, "1984", - "Sasa (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sasaaRomInfo, MSX_sasaaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Saurusland (Jpn) - -static struct BurnRomInfo MSX_saurusRomDesc[] = { - { "saurus land (japan).rom", 0x04000, 0x5f2fe556, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_saurus, MSX_saurus, msx_msx) -STD_ROM_FN(MSX_saurus) - -struct BurnDriver BurnDrvMSX_saurus = { - "msx_saurus", NULL, "msx_msx", NULL, "1983", - "Saurusland (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_saurusRomInfo, MSX_saurusRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Scarlet 7 - The Mightiest Women (Jpn) - -static struct BurnRomInfo MSX_scarlet7RomDesc[] = { - { "scarlet 7 - the mightiest women (japan).rom", 0x08000, 0xc2ed4c08, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_scarlet7, MSX_scarlet7, msx_msx) -STD_ROM_FN(MSX_scarlet7) - -struct BurnDriver BurnDrvMSX_scarlet7 = { - "msx_scarlet7", NULL, "msx_msx", NULL, "1986", - "Scarlet 7 - The Mightiest Women (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_scarlet7RomInfo, MSX_scarlet7RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Scion (Jpn) - -static struct BurnRomInfo MSX_scionRomDesc[] = { - { "scion (japan).rom", 0x04000, 0xba3a8ea1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_scion, MSX_scion, msx_msx) -STD_ROM_FN(MSX_scion) - -struct BurnDriver BurnDrvMSX_scion = { - "msx_scion", NULL, "msx_msx", NULL, "1985", - "Scion (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_scionRomInfo, MSX_scionRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Scramble Eggs (Jpn) - -static struct BurnRomInfo MSX_scrameggRomDesc[] = { - { "scramble eggs (japan).rom", 0x02000, 0x02dc77e8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_scramegg, MSX_scramegg, msx_msx) -STD_ROM_FN(MSX_scramegg) - -struct BurnDriver BurnDrvMSX_scramegg = { - "msx_scramegg", NULL, "msx_msx", NULL, "1983", - "Scramble Eggs (Jpn)\0", NULL, "Ample Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_scrameggRomInfo, MSX_scrameggRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sea Hunter (Euro) - -static struct BurnRomInfo MSX_seahuntrRomDesc[] = { - { "sea hunter (europe).rom", 0x04000, 0x1fd18174, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_seahuntr, MSX_seahuntr, msx_msx) -STD_ROM_FN(MSX_seahuntr) - -struct BurnDriver BurnDrvMSX_seahuntr = { - "msx_seahuntr", NULL, "msx_msx", NULL, "1984", - "Sea Hunter (Euro)\0", NULL, "DynaData?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_seahuntrRomInfo, MSX_seahuntrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Seiken Achou (Jpn) - -static struct BurnRomInfo MSX_seikachoRomDesc[] = { - { "kung fu acho (japan).rom", 0x08000, 0x999dd794, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_seikacho, MSX_seikacho, msx_msx) -STD_ROM_FN(MSX_seikacho) - -struct BurnDriver BurnDrvMSX_seikacho = { - "msx_seikacho", NULL, "msx_msx", NULL, "1985", - "Kung Fu Master. Seiken Achou (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_seikachoRomInfo, MSX_seikachoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Seiken Achou (Jpn, Alt) - -static struct BurnRomInfo MSX_seikachoaRomDesc[] = { - { "kung fu acho (japan) (alt 1).rom", 0x08000, 0x0da11df8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_seikachoa, MSX_seikachoa, msx_msx) -STD_ROM_FN(MSX_seikachoa) - -struct BurnDriver BurnDrvMSX_seikachoa = { - "msx_seikachoa", "msx_seikacho", "msx_msx", NULL, "1985", - "Kung Fu Master. Seiken Achou (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_seikachoaRomInfo, MSX_seikachoaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Seiken Achou (Kor) - -static struct BurnRomInfo MSX_seikachokRomDesc[] = { - { "karateka.rom", 0x08000, 0x6adeadf5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_seikachok, MSX_seikachok, msx_msx) -STD_ROM_FN(MSX_seikachok) - -struct BurnDriver BurnDrvMSX_seikachok = { - "msx_seikachok", "msx_seikacho", "msx_msx", NULL, "198?", - "Kung Fu Master. Seiken Achou (Kor)\0", NULL, "Clover", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_seikachokRomInfo, MSX_seikachokRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Senjyo (Jpn) - -static struct BurnRomInfo MSX_senjyoRomDesc[] = { - { "senjyo (japan).rom", 0x04000, 0x126bc4cd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_senjyo, MSX_senjyo, msx_msx) -STD_ROM_FN(MSX_senjyo) - -struct BurnDriver BurnDrvMSX_senjyo = { - "msx_senjyo", NULL, "msx_msx", NULL, "1984", - "Senjyo (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_senjyoRomInfo, MSX_senjyoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Senjyo (Jpn, Alt) - -static struct BurnRomInfo MSX_senjyoaRomDesc[] = { - { "senjyo (japan) (alt 1).rom", 0x04000, 0x7d558b04, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_senjyoa, MSX_senjyoa, msx_msx) -STD_ROM_FN(MSX_senjyoa) - -struct BurnDriver BurnDrvMSX_senjyoa = { - "msx_senjyoa", "msx_senjyo", "msx_msx", NULL, "1984", - "Senjyo (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_senjyoaRomInfo, MSX_senjyoaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sewer Sam (Jpn) - -static struct BurnRomInfo MSX_sewersamRomDesc[] = { - { "sewer sam (japan).rom", 0x08000, 0x925c0aee, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sewersam, MSX_sewersam, msx_msx) -STD_ROM_FN(MSX_sewersam) - -struct BurnDriver BurnDrvMSX_sewersam = { - "msx_sewersam", NULL, "msx_msx", NULL, "1984", - "Sewer Sam (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sewersamRomInfo, MSX_sewersamRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Shout Match (Jpn) - -static struct BurnRomInfo MSX_shoutmatRomDesc[] = { - { "shout match (japan).rom", 0x08000, 0x729d2540, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_shoutmat, MSX_shoutmat, msx_msx) -STD_ROM_FN(MSX_shoutmat) - -struct BurnDriver BurnDrvMSX_shoutmat = { - "msx_shoutmat", NULL, "msx_msx", NULL, "1987", - "Shout Match (Jpn)\0", NULL, "Victor", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_shoutmatRomInfo, MSX_shoutmatRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sinbad - Nanatsu no Bouken (Jpn) - -static struct BurnRomInfo MSX_sinbadRomDesc[] = { - { "sinbad (japan).rom", 0x04000, 0x8273fd0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sinbad, MSX_sinbad, msx_msx) -STD_ROM_FN(MSX_sinbad) - -struct BurnDriver BurnDrvMSX_sinbad = { - "msx_sinbad", NULL, "msx_msx", NULL, "1986", - "Sinbad - Nanatsu no Bouken (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sinbadRomInfo, MSX_sinbadRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ski Command (Jpn) - -static struct BurnRomInfo MSX_skicommRomDesc[] = { - { "casio ski command (japan).rom", 0x04000, 0xd8750242, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skicomm, MSX_skicomm, msx_msx) -STD_ROM_FN(MSX_skicomm) - -struct BurnDriver BurnDrvMSX_skicomm = { - "msx_skicomm", NULL, "msx_msx", NULL, "1985", - "Ski Command (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skicommRomInfo, MSX_skicommRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ski Command (Kor, Aproman) - -static struct BurnRomInfo MSX_skicommk1RomDesc[] = { - { "skicomma.rom", 0x08000, 0x06980ea1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skicommk1, MSX_skicommk1, msx_msx) -STD_ROM_FN(MSX_skicommk1) - -struct BurnDriver BurnDrvMSX_skicommk1 = { - "msx_skicommk1", "msx_skicomm", "msx_msx", NULL, "198?", - "Ski Command (Kor, Aproman)\0", NULL, "Aproman", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skicommk1RomInfo, MSX_skicommk1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ski Command (Kor, ProSoft) - -static struct BurnRomInfo MSX_skicommk2RomDesc[] = { - { "skicommb.rom", 0x08000, 0xa0276799, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skicommk2, MSX_skicommk2, msx_msx) -STD_ROM_FN(MSX_skicommk2) - -struct BurnDriver BurnDrvMSX_skicommk2 = { - "msx_skicommk2", "msx_skicomm", "msx_msx", NULL, "198?", - "Ski Command (Kor, ProSoft)\0", NULL, "ProSoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skicommk2RomInfo, MSX_skicommk2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Skooter (Jpn) - -static struct BurnRomInfo MSX_skooterRomDesc[] = { - { "skooter (japan) (alt 1).rom", 0x08000, 0xf9e0fb4c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skooter, MSX_skooter, msx_msx) -STD_ROM_FN(MSX_skooter) - -struct BurnDriver BurnDrvMSX_skooter = { - "msx_skooter", NULL, "msx_msx", NULL, "1988", - "Skooter (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skooterRomInfo, MSX_skooterRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Skooter (Jpn, Alt) - -static struct BurnRomInfo MSX_skooteraRomDesc[] = { - { "skooter (japan).rom", 0x08000, 0x53b87deb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skootera, MSX_skootera, msx_msx) -STD_ROM_FN(MSX_skootera) - -struct BurnDriver BurnDrvMSX_skootera = { - "msx_skootera", "msx_skooter", "msx_msx", NULL, "1988", - "Skooter (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skooteraRomInfo, MSX_skooteraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Skygaldo (Jpn) - -static struct BurnRomInfo MSX_skygaldoRomDesc[] = { - { "sky galdo (japan).rom", 0x08000, 0x54f84047, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skygaldo, MSX_skygaldo, msx_msx) -STD_ROM_FN(MSX_skygaldo) - -struct BurnDriver BurnDrvMSX_skygaldo = { - "msx_skygaldo", NULL, "msx_msx", NULL, "1986", - "Skygaldo (Jpn)\0", NULL, "Magical Zoo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skygaldoRomInfo, MSX_skygaldoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sky Jaguar (Jpn) - -static struct BurnRomInfo MSX_skyjagRomDesc[] = { - { "sky jaguar (japan).rom", 0x04000, 0xe4f725fd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skyjag, MSX_skyjag, msx_msx) -STD_ROM_FN(MSX_skyjag) - -struct BurnDriver BurnDrvMSX_skyjag = { - "msx_skyjag", NULL, "msx_msx", NULL, "1984", - "Sky Jaguar (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skyjagRomInfo, MSX_skyjagRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sky Jaguar (Kor) - -static struct BurnRomInfo MSX_skyjagkRomDesc[] = { - { "skyjagua.rom", 0x08000, 0x7e7fa3a0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skyjagk, MSX_skyjagk, msx_msx) -STD_ROM_FN(MSX_skyjagk) - -struct BurnDriver BurnDrvMSX_skyjagk = { - "msx_skyjagk", "msx_skyjag", "msx_msx", NULL, "198?", - "Sky Jaguar (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skyjagkRomInfo, MSX_skyjagkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Snake It (Euro) - -static struct BurnRomInfo MSX_snakeitRomDesc[] = { - { "snake it (europe).rom", 0x08000, 0x4a44bf23, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_snakeit, MSX_snakeit, msx_msx) -STD_ROM_FN(MSX_snakeit) - -struct BurnDriver BurnDrvMSX_snakeit = { - "msx_snakeit", NULL, "msx_msx", NULL, "1986?", - "Snake It (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_snakeitRomInfo, MSX_snakeitRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sofia (Jpn) - -static struct BurnRomInfo MSX_sofiaRomDesc[] = { - { "sofia (japan).rom", 0x10000, 0x14811951, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sofia, MSX_sofia, msx_msx) -STD_ROM_FN(MSX_sofia) - -struct BurnDriver BurnDrvMSX_sofia = { - "msx_sofia", NULL, "msx_msx", NULL, "1988", - "Sofia (Jpn)\0", NULL, "Dempa", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_sofiaRomInfo, MSX_sofiaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Space Camp (Jpn) - -static struct BurnRomInfo MSX_spacecmpRomDesc[] = { - { "space camp (japan).rom", 0x08000, 0xeb197b9d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spacecmp, MSX_spacecmp, msx_msx) -STD_ROM_FN(MSX_spacecmp) - -struct BurnDriver BurnDrvMSX_spacecmp = { - "msx_spacecmp", NULL, "msx_msx", NULL, "1986", - "Space Camp (Jpn)\0", NULL, "Pack-In-Video", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spacecmpRomInfo, MSX_spacecmpRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Space Camp (Jpn, Alt) - -static struct BurnRomInfo MSX_spacecmpaRomDesc[] = { - { "space camp (japan) (alt 1).rom", 0x08000, 0xcdd43807, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spacecmpa, MSX_spacecmpa, msx_msx) -STD_ROM_FN(MSX_spacecmpa) - -struct BurnDriver BurnDrvMSX_spacecmpa = { - "msx_spacecmpa", "msx_spacecmp", "msx_msx", NULL, "1986", - "Space Camp (Jpn, Alt)\0", NULL, "Pack-In-Video", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spacecmpaRomInfo, MSX_spacecmpaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Space Invaders (Jpn) - -static struct BurnRomInfo MSX_spaceinvRomDesc[] = { - { "space invaders (japan).rom", 0x04000, 0xde02932d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spaceinv, MSX_spaceinv, msx_msx) -STD_ROM_FN(MSX_spaceinv) - -struct BurnDriver BurnDrvMSX_spaceinv = { - "msx_spaceinv", NULL, "msx_msx", NULL, "1985", - "Space Invaders (Jpn)\0", NULL, "Nidecom", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spaceinvRomInfo, MSX_spaceinvRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Space Maze Attack (Jpn) - -static struct BurnRomInfo MSX_spacmazeRomDesc[] = { - { "space maze attack (japan).rom", 0x02000, 0x4a45cbc0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spacmaze, MSX_spacmaze, msx_msx) -STD_ROM_FN(MSX_spacmaze) - -struct BurnDriver BurnDrvMSX_spacmaze = { - "msx_spacmaze", NULL, "msx_msx", NULL, "1983", - "Space Maze Attack (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spacmazeRomInfo, MSX_spacmazeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Space Maze Attack (Jpn, Alt) - -static struct BurnRomInfo MSX_spacmazeaRomDesc[] = { - { "space maze attack (japan) (alt 1).rom", 0x02000, 0xd6eadaa2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spacmazea, MSX_spacmazea, msx_msx) -STD_ROM_FN(MSX_spacmazea) - -struct BurnDriver BurnDrvMSX_spacmazea = { - "msx_spacmazea", "msx_spacmaze", "msx_msx", NULL, "1983", - "Space Maze Attack (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spacmazeaRomInfo, MSX_spacmazeaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Space Maze Attack (Jpn, Alt 2) - -static struct BurnRomInfo MSX_spacmazebRomDesc[] = { - { "space maze attack (japan) (alt 2).rom", 0x04000, 0x1932baf6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spacmazeb, MSX_spacmazeb, msx_msx) -STD_ROM_FN(MSX_spacmazeb) - -struct BurnDriver BurnDrvMSX_spacmazeb = { - "msx_spacmazeb", "msx_spacmaze", "msx_msx", NULL, "1983", - "Space Maze Attack (Jpn, Alt 2)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spacmazebRomInfo, MSX_spacmazebRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Space Trouble (Jpn) - -static struct BurnRomInfo MSX_spacetrbRomDesc[] = { - { "space trouble (japan).rom", 0x02000, 0x26119f0a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spacetrb, MSX_spacetrb, msx_msx) -STD_ROM_FN(MSX_spacetrb) - -struct BurnDriver BurnDrvMSX_spacetrb = { - "msx_spacetrb", NULL, "msx_msx", NULL, "1984", - "Space Trouble (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spacetrbRomInfo, MSX_spacetrbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sparkie (Jpn) - -static struct BurnRomInfo MSX_sparkieRomDesc[] = { - { "sparkie (japan).rom", 0x02000, 0xf03ed7d5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sparkie, MSX_sparkie, msx_msx) -STD_ROM_FN(MSX_sparkie) - -struct BurnDriver BurnDrvMSX_sparkie = { - "msx_sparkie", NULL, "msx_msx", NULL, "1983", - "Sparkie (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sparkieRomInfo, MSX_sparkieRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Spelunker (Jpn) - -static struct BurnRomInfo MSX_spelunkrRomDesc[] = { - { "spelunker (japan).rom", 0x08000, 0xdc948a3a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spelunkr, MSX_spelunkr, msx_msx) -STD_ROM_FN(MSX_spelunkr) - -struct BurnDriver BurnDrvMSX_spelunkr = { - "msx_spelunkr", NULL, "msx_msx", NULL, "1986", - "Spelunker (Jpn)\0", NULL, "Irem", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spelunkrRomInfo, MSX_spelunkrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Spelunker (Jpn, Alt) - -static struct BurnRomInfo MSX_spelunkraRomDesc[] = { - { "spelunker (japan) (alt 1).rom", 0x08000, 0x4c738b64, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spelunkra, MSX_spelunkra, msx_msx) -STD_ROM_FN(MSX_spelunkra) - -struct BurnDriver BurnDrvMSX_spelunkra = { - "msx_spelunkra", "msx_spelunkr", "msx_msx", NULL, "1986", - "Spelunker (Jpn, Alt)\0", NULL, "Irem", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spelunkraRomInfo, MSX_spelunkraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Spider (Jpn) - -static struct BurnRomInfo MSX_spiderRomDesc[] = { - { "spider, the (japan).rom", 0x04000, 0xa156ac02, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spider, MSX_spider, msx_msx) -STD_ROM_FN(MSX_spider) - -struct BurnDriver BurnDrvMSX_spider = { - "msx_spider", NULL, "msx_msx", NULL, "1984", - "The Spider (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spiderRomInfo, MSX_spiderRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Square Dancer (Jpn) - -static struct BurnRomInfo MSX_squardanRomDesc[] = { - { "square dancer (japan).rom", 0x04000, 0xdd5cf5c8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_squardan, MSX_squardan, msx_msx) -STD_ROM_FN(MSX_squardan) - -struct BurnDriver BurnDrvMSX_squardan = { - "msx_squardan", NULL, "msx_msx", NULL, "1984", - "Square Dancer (Jpn)\0", "Use keys 'Z', '/' and Enter", "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_squardanRomInfo, MSX_squardanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - SwapSlashDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Squish'em (Jpn) - -static struct BurnRomInfo MSX_squishemRomDesc[] = { - { "squish'em (japan).rom", 0x04000, 0xf3b22c91, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_squishem, MSX_squishem, msx_msx) -STD_ROM_FN(MSX_squishem) - -struct BurnDriver BurnDrvMSX_squishem = { - "msx_squishem", NULL, "msx_msx", NULL, "1984", - "Squish'em (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_squishemRomInfo, MSX_squishemRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Squish'em (Jpn, Alt) - -static struct BurnRomInfo MSX_squishemaRomDesc[] = { - { "squish'em (japan) (alt 1).rom", 0x04000, 0xda50254f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_squishema, MSX_squishema, msx_msx) -STD_ROM_FN(MSX_squishema) - -struct BurnDriver BurnDrvMSX_squishema = { - "msx_squishema", "msx_squishem", "msx_msx", NULL, "1984", - "Squish'em (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_squishemaRomInfo, MSX_squishemaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Blazer (Jpn) - -static struct BurnRomInfo MSX_starblazRomDesc[] = { - { "star blazer (japan).rom", 0x04000, 0xfd902e5d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starblaz, MSX_starblaz, msx_msx) -STD_ROM_FN(MSX_starblaz) - -struct BurnDriver BurnDrvMSX_starblaz = { - "msx_starblaz", NULL, "msx_msx", NULL, "1985", - "Star Blazer (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starblazRomInfo, MSX_starblazRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Blazer (Jpn, Alt) - -static struct BurnRomInfo MSX_starblazaRomDesc[] = { - { "star blazer (japan) (alt 1).rom", 0x04000, 0x1c952691, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starblaza, MSX_starblaza, msx_msx) -STD_ROM_FN(MSX_starblaza) - -struct BurnDriver BurnDrvMSX_starblaza = { - "msx_starblaza", "msx_starblaz", "msx_msx", NULL, "1985", - "Star Blazer (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starblazaRomInfo, MSX_starblazaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Blazer (Jpn, Alt 2) - -static struct BurnRomInfo MSX_starblazbRomDesc[] = { - { "star blazer (japan) (alt 2).rom", 0x04000, 0xa242fe0d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starblazb, MSX_starblazb, msx_msx) -STD_ROM_FN(MSX_starblazb) - -struct BurnDriver BurnDrvMSX_starblazb = { - "msx_starblazb", "msx_starblaz", "msx_msx", NULL, "1985", - "Star Blazer (Jpn, Alt 2)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starblazbRomInfo, MSX_starblazbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Force (Jpn) - -static struct BurnRomInfo MSX_starfrceRomDesc[] = { - { "star force (japan).rom", 0x08000, 0xc14e53a1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starfrce, MSX_starfrce, msx_msx) -STD_ROM_FN(MSX_starfrce) - -struct BurnDriver BurnDrvMSX_starfrce = { - "msx_starfrce", NULL, "msx_msx", NULL, "1985", - "Star Force (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starfrceRomInfo, MSX_starfrceRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Force (Jpn, Alt) - -static struct BurnRomInfo MSX_starfrceaRomDesc[] = { - { "star force (japan) (alt 1).rom", 0x08000, 0xe9de7e32, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starfrcea, MSX_starfrcea, msx_msx) -STD_ROM_FN(MSX_starfrcea) - -struct BurnDriver BurnDrvMSX_starfrcea = { - "msx_starfrcea", "msx_starfrce", "msx_msx", NULL, "1985", - "Star Force (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starfrceaRomInfo, MSX_starfrceaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Soldier (Jpn) - -static struct BurnRomInfo MSX_starsoldRomDesc[] = { - { "star soldier (japan).rom", 0x08000, 0x0b3d975d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starsold, MSX_starsold, msx_msx) -STD_ROM_FN(MSX_starsold) - -struct BurnDriver BurnDrvMSX_starsold = { - "msx_starsold", NULL, "msx_msx", NULL, "1986", - "Star Soldier (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starsoldRomInfo, MSX_starsoldRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Star Soldier (Jpn, Alt) - -static struct BurnRomInfo MSX_starsoldaRomDesc[] = { - { "star soldier (japan) (alt 1).rom", 0x08000, 0xf6d4e101, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starsolda, MSX_starsolda, msx_msx) -STD_ROM_FN(MSX_starsolda) - -struct BurnDriver BurnDrvMSX_starsolda = { - "msx_starsolda", "msx_starsold", "msx_msx", NULL, "1986", - "Star Soldier (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starsoldaRomInfo, MSX_starsoldaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Starship Simulator (Jpn) - -static struct BurnRomInfo MSX_starshipRomDesc[] = { - { "starship simulator (japan).rom", 0x04000, 0x236d2ab1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starship, MSX_starship, msx_msx) -STD_ROM_FN(MSX_starship) - -struct BurnDriver BurnDrvMSX_starship = { - "msx_starship", NULL, "msx_msx", NULL, "1984", - "Starship Simulator (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starshipRomInfo, MSX_starshipRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Starship Simulator (Jpn, Alt) - -static struct BurnRomInfo MSX_starshipaRomDesc[] = { - { "starship simulator (japan) (alt 1).rom", 0x04000, 0x87824af6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starshipa, MSX_starshipa, msx_msx) -STD_ROM_FN(MSX_starshipa) - -struct BurnDriver BurnDrvMSX_starshipa = { - "msx_starshipa", "msx_starship", "msx_msx", NULL, "1984", - "Starship Simulator (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starshipaRomInfo, MSX_starshipaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Step Up (Jpn) - -static struct BurnRomInfo MSX_stepupRomDesc[] = { - { "step up (japan).rom", 0x02000, 0xcabcddf1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_stepup, MSX_stepup, msx_msx) -STD_ROM_FN(MSX_stepup) - -struct BurnDriver BurnDrvMSX_stepup = { - "msx_stepup", NULL, "msx_msx", NULL, "1983", - "Step Up (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_stepupRomInfo, MSX_stepupRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Step Up (Jpn, Alt) - -static struct BurnRomInfo MSX_stepupaRomDesc[] = { - { "step up (japan) (alt 1).rom", 0x02000, 0x60a8927b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_stepupa, MSX_stepupa, msx_msx) -STD_ROM_FN(MSX_stepupa) - -struct BurnDriver BurnDrvMSX_stepupa = { - "msx_stepupa", "msx_stepup", "msx_msx", NULL, "1983", - "Step Up (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_stepupaRomInfo, MSX_stepupaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Step Up (Kor) - -static struct BurnRomInfo MSX_stepupkRomDesc[] = { - { "stepup.rom", 0x08000, 0x5bce3fec, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_stepupk, MSX_stepupk, msx_msx) -STD_ROM_FN(MSX_stepupk) - -struct BurnDriver BurnDrvMSX_stepupk = { - "msx_stepupk", "msx_stepup", "msx_msx", NULL, "198?", - "Step Up (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_stepupkRomInfo, MSX_stepupkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Stepper (Jpn) - -static struct BurnRomInfo MSX_stepperRomDesc[] = { - { "stepper (japan).rom", 0x04000, 0x0fb7df8f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_stepper, MSX_stepper, msx_msx) -STD_ROM_FN(MSX_stepper) - -struct BurnDriver BurnDrvMSX_stepper = { - "msx_stepper", NULL, "msx_msx", NULL, "1985", - "Stepper (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_stepperRomInfo, MSX_stepperRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Kenja no Ishi - The Stone of Wisdom (Jpn) - -static struct BurnRomInfo MSX_stonewisRomDesc[] = { - { "stone of wisdom, the (japan).rom", 0x08000, 0x8c7a7435, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_stonewis, MSX_stonewis, msx_msx) -STD_ROM_FN(MSX_stonewis) - -struct BurnDriver BurnDrvMSX_stonewis = { - "msx_stonewis", NULL, "msx_msx", NULL, "1986", - "Kenja no Ishi - The Stone of Wisdom (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_stonewisRomInfo, MSX_stonewisRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Strange Loop (Jpn) - -static struct BurnRomInfo MSX_stranglpRomDesc[] = { - { "strange loop (japan).rom", 0x08000, 0x6554c0c5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_stranglp, MSX_stranglp, msx_msx) -STD_ROM_FN(MSX_stranglp) - -struct BurnDriver BurnDrvMSX_stranglp = { - "msx_stranglp", NULL, "msx_msx", NULL, "1987", - "Strange Loop (Jpn)\0", NULL, "Nihon Dexter", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_stranglpRomInfo, MSX_stranglpRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Street Master (Kor) - -static struct BurnRomInfo MSX_strtmastRomDesc[] = { - { "street master.rom", 0x20000, 0x7269c520, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_strtmast, MSX_strtmast, msx_msx) -STD_ROM_FN(MSX_strtmast) - -struct BurnDriver BurnDrvMSX_strtmast = { - "msx_strtmast", NULL, "msx_msx", NULL, "1992", - "Street Master (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_strtmastRomInfo, MSX_strtmastRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Suparobo (Jpn) - -static struct BurnRomInfo MSX_suparoboRomDesc[] = { - { "suparobo (japan).rom", 0x04000, 0x483eddcc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_suparobo, MSX_suparobo, msx_msx) -STD_ROM_FN(MSX_suparobo) - -struct BurnDriver BurnDrvMSX_suparobo = { - "msx_suparobo", NULL, "msx_msx", NULL, "1984", - "Suparobo (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_suparoboRomInfo, MSX_suparoboRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Billiards (Jpn) - -static struct BurnRomInfo MSX_sbillardRomDesc[] = { - { "super billiards (japan).rom", 0x02000, 0x79bc12b2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sbillard, MSX_sbillard, msx_msx) -STD_ROM_FN(MSX_sbillard) - -struct BurnDriver BurnDrvMSX_sbillard = { - "msx_sbillard", NULL, "msx_msx", NULL, "1983", - "Super Billiards (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_sbillardRomInfo, MSX_sbillardRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Bioman 4 (Kor) - -static struct BurnRomInfo MSX_sbioman4RomDesc[] = { - { "super bioman 4 (korea) (unl).rom", 0x10000, 0x112abf34, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sbioman4, MSX_sbioman4, msx_msx) -STD_ROM_FN(MSX_sbioman4) - -struct BurnDriver BurnDrvMSX_sbioman4 = { - "msx_sbioman4", NULL, "msx_msx", NULL, "199?", - "Super Bioman 4 (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_sbioman4RomInfo, MSX_sbioman4RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Boy 3 (Kor) - -static struct BurnRomInfo MSX_sboy3RomDesc[] = { - { "super boy 3 (korea) (unl).rom", 0x20000, 0x9195c34c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sboy3, MSX_sboy3, msx_msx) -STD_ROM_FN(MSX_sboy3) - -struct BurnDriver BurnDrvMSX_sboy3 = { - "msx_sboy3", NULL, "msx_msx", NULL, "1991", - "Super Boy 3 (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_sboy3RomInfo, MSX_sboy3RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Boy 3 (Kor, Alt) - -static struct BurnRomInfo MSX_sboy3aRomDesc[] = { - { "super boy iii (1991)(zemina).rom", 0x20000, 0xf422ad79, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sboy3a, MSX_sboy3a, msx_msx) -STD_ROM_FN(MSX_sboy3a) - -struct BurnDriver BurnDrvMSX_sboy3a = { - "msx_sboy3a", "msx_sboy3", "msx_msx", NULL, "1991", - "Super Boy 3 (Kor, Alt)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_sboy3aRomInfo, MSX_sboy3aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Boy I (Kor) - -static struct BurnRomInfo MSX_sboy1RomDesc[] = { - { "super boy i (korea) (unl).rom", 0x08000, 0x13b34548, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sboy1, MSX_sboy1, msx_msx) -STD_ROM_FN(MSX_sboy1) - -struct BurnDriver BurnDrvMSX_sboy1 = { - "msx_sboy1", NULL, "msx_msx", NULL, "1989", - "Super Boy I (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sboy1RomInfo, MSX_sboy1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Boy II. (Kor) - -static struct BurnRomInfo MSX_sboy2RomDesc[] = { - { "super boy ii (korea) (unl).rom", 0x08000, 0x09206bfd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sboy2, MSX_sboy2, msx_msx) -STD_ROM_FN(MSX_sboy2) - -struct BurnDriver BurnDrvMSX_sboy2 = { - "msx_sboy2", NULL, "msx_msx", NULL, "1989", - "Super Boy II. (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sboy2RomInfo, MSX_sboy2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Boy II. (Kor, Alt) - -static struct BurnRomInfo MSX_sboy2aRomDesc[] = { - { "super boy ii (1989)(zemina).rom", 0x08000, 0x7de493ab, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sboy2a, MSX_sboy2a, msx_msx) -STD_ROM_FN(MSX_sboy2a) - -struct BurnDriver BurnDrvMSX_sboy2a = { - "msx_sboy2a", "msx_sboy2", "msx_msx", NULL, "1989", - "Super Boy II. (Kor, Alt)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sboy2aRomInfo, MSX_sboy2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Cobra (Jpn) - -static struct BurnRomInfo MSX_scobraRomDesc[] = { - { "super cobra (japan).rom", 0x02000, 0x97425d70, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_scobra, MSX_scobra, msx_msx) -STD_ROM_FN(MSX_scobra) - -struct BurnDriver BurnDrvMSX_scobra = { - "msx_scobra", NULL, "msx_msx", NULL, "1983", - "Super Cobra (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_scobraRomInfo, MSX_scobraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Cobra (Jpn, Alt) - -static struct BurnRomInfo MSX_scobraaRomDesc[] = { - { "super cobra (japan) (alt 1).rom", 0x02000, 0xbfcc181d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_scobraa, MSX_scobraa, msx_msx) -STD_ROM_FN(MSX_scobraa) - -struct BurnDriver BurnDrvMSX_scobraa = { - "msx_scobraa", "msx_scobra", "msx_msx", NULL, "1983", - "Super Cobra (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_scobraaRomInfo, MSX_scobraaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Columns (Kor) - -static struct BurnRomInfo MSX_supercolRomDesc[] = { - { "super columns (japan).rom", 0x08000, 0xf0a030ec, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_supercol, MSX_supercol, msx_msx) -STD_ROM_FN(MSX_supercol) - -struct BurnDriver BurnDrvMSX_supercol = { - "msx_supercol", NULL, "msx_msx", NULL, "1990", - "Super Columns (Kor)\0", NULL, "Hi-Com", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_supercolRomInfo, MSX_supercolRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Cross Force (Euro) - -static struct BurnRomInfo MSX_superxfRomDesc[] = { - { "super cross force (europe).rom", 0x04000, 0xf05a7f4e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_superxf, MSX_superxf, msx_msx) -STD_ROM_FN(MSX_superxf) - -struct BurnDriver BurnDrvMSX_superxf = { - "msx_superxf", NULL, "msx_msx", NULL, "1983", - "Super Cross Force (Euro)\0", NULL, "Spectravideo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_superxfRomInfo, MSX_superxfRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Drinker (Jpn) - -static struct BurnRomInfo MSX_supdrinkRomDesc[] = { - { "super drinker (japan).rom", 0x04000, 0x3254017e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_supdrink, MSX_supdrink, msx_msx) -STD_ROM_FN(MSX_supdrink) - -struct BurnDriver BurnDrvMSX_supdrink = { - "msx_supdrink", NULL, "msx_msx", NULL, "1983", - "Super Drinker (Jpn)\0", NULL, "Ample Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_supdrinkRomInfo, MSX_supdrinkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Golf (Jpn) - -static struct BurnRomInfo MSX_superglfRomDesc[] = { - { "super golf (japan).rom", 0x08000, 0x66aadfa8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_superglf, MSX_superglf, msx_msx) -STD_ROM_FN(MSX_superglf) - -struct BurnDriver BurnDrvMSX_superglf = { - "msx_superglf", NULL, "msx_msx", NULL, "1984", - "Super Golf (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_superglfRomInfo, MSX_superglfRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Laydock - Mission Striker (Kor) - -static struct BurnRomInfo MSX_slaydockkRomDesc[] = { - { "super laydock - mission striker (1988)(zemina).rom", 0x40000, 0xb885a464, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_slaydockk, MSX_slaydockk, msx_msx) -STD_ROM_FN(MSX_slaydockk) - -struct BurnDriver BurnDrvMSX_slaydockk = { - "msx_slaydockk", "msx_slaydock", "msx_msx", NULL, "1988", - "Super Laydock - Mission Striker (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_slaydockkRomInfo, MSX_slaydockkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Pachinko (Jpn) - -static struct BurnRomInfo MSX_suppachiRomDesc[] = { - { "super pachinko (japan).rom", 0x04000, 0x8aebddd2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_suppachi, MSX_suppachi, msx_msx) -STD_ROM_FN(MSX_suppachi) - -struct BurnDriver BurnDrvMSX_suppachi = { - "msx_suppachi", NULL, "msx_msx", NULL, "1985", - "Super Pachinko (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_suppachiRomInfo, MSX_suppachiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Penguin - -static struct BurnRomInfo MSX_spenguinRomDesc[] = { - { "sieco_superpenguin_(sieco).rom", 0x08000, 0x0555a6e9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spenguin, MSX_spenguin, msx_msx) -STD_ROM_FN(MSX_spenguin) - -struct BurnDriver BurnDrvMSX_spenguin = { - "msx_spenguin", NULL, "msx_msx", NULL, "198?", - "Super Penguin\0", NULL, "Sieco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spenguinRomInfo, MSX_spenguinRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Snake (Jpn) - -static struct BurnRomInfo MSX_supsnakeRomDesc[] = { - { "super snake (japan).rom", 0x02000, 0x491c6af0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_supsnake, MSX_supsnake, msx_msx) -STD_ROM_FN(MSX_supsnake) - -struct BurnDriver BurnDrvMSX_supsnake = { - "msx_supsnake", NULL, "msx_msx", NULL, "1983", - "Super Snake (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_supsnakeRomInfo, MSX_supsnakeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Snake (Jpn, Alt) - -static struct BurnRomInfo MSX_supsnakeaRomDesc[] = { - { "super snake (japan) (alt 1).rom", 0x04000, 0xf192f67e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_supsnakea, MSX_supsnakea, msx_msx) -STD_ROM_FN(MSX_supsnakea) - -struct BurnDriver BurnDrvMSX_supsnakea = { - "msx_supsnakea", "msx_supsnake", "msx_msx", NULL, "1983", - "Super Snake (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_supsnakeaRomInfo, MSX_supsnakeaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Snake (Jpn, Alt 2) - -static struct BurnRomInfo MSX_supsnakebRomDesc[] = { - { "super snake (japan) (alt 2).rom", 0x04000, 0xe31a0336, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_supsnakeb, MSX_supsnakeb, msx_msx) -STD_ROM_FN(MSX_supsnakeb) - -struct BurnDriver BurnDrvMSX_supsnakeb = { - "msx_supsnakeb", "msx_supsnake", "msx_msx", NULL, "1983", - "Super Snake (Jpn, Alt 2)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_supsnakebRomInfo, MSX_supsnakebRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Super Soccer (Jpn) - -static struct BurnRomInfo MSX_supsoccrRomDesc[] = { - { "super soccer (japan).rom", 0x08000, 0x6408ed24, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_supsoccr, MSX_supsoccr, msx_msx) -STD_ROM_FN(MSX_supsoccr) - -struct BurnDriver BurnDrvMSX_supsoccr = { - "msx_supsoccr", NULL, "msx_msx", NULL, "1985", - "Super Soccer (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_supsoccrRomInfo, MSX_supsoccrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// MSX Super Tennis (Jpn) - -static struct BurnRomInfo MSX_suptennRomDesc[] = { - { "super tennis (japan).rom", 0x04000, 0xd560d9c0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_suptenn, MSX_suptenn, msx_msx) -STD_ROM_FN(MSX_suptenn) - -struct BurnDriver BurnDrvMSX_suptenn = { - "msx_suptenn", NULL, "msx_msx", NULL, "1984", - "MSX Super Tennis (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_suptennRomInfo, MSX_suptennRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Supertripper (Spa) - -static struct BurnRomInfo MSX_suptripRomDesc[] = { - { "super tripper (spain).rom", 0x08000, 0x0c36f5bd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_suptrip, MSX_suptrip, msx_msx) -STD_ROM_FN(MSX_suptrip) - -struct BurnDriver BurnDrvMSX_suptrip = { - "msx_suptrip", NULL, "msx_msx", NULL, "1985", - "Supertripper (Spa)\0", NULL, "Sony Spain", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_suptripRomInfo, MSX_suptripRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sweet Acorn (Jpn) - -static struct BurnRomInfo MSX_sweetacrRomDesc[] = { - { "sweet acorn (japan).rom", 0x04000, 0x58670a22, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sweetacr, MSX_sweetacr, msx_msx) -STD_ROM_FN(MSX_sweetacr) - -struct BurnDriver BurnDrvMSX_sweetacr = { - "msx_sweetacr", NULL, "msx_msx", NULL, "1984", - "Sweet Acorn (Jpn)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sweetacrRomInfo, MSX_sweetacrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Sweet Acorn (Jpn, Alt) - -static struct BurnRomInfo MSX_sweetacraRomDesc[] = { - { "sweet acorn (japan) (alt 1).rom", 0x04000, 0x54a8bf3c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sweetacra, MSX_sweetacra, msx_msx) -STD_ROM_FN(MSX_sweetacra) - -struct BurnDriver BurnDrvMSX_sweetacra = { - "msx_sweetacra", "msx_sweetacr", "msx_msx", NULL, "1984", - "Sweet Acorn (Jpn, Alt)\0", NULL, "Taito", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sweetacraRomInfo, MSX_sweetacraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Swing (Jpn) - -static struct BurnRomInfo MSX_swingRomDesc[] = { - { "swing (japan).rom", 0x04000, 0xc93fadf4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_swing, MSX_swing, msx_msx) -STD_ROM_FN(MSX_swing) - -struct BurnDriver BurnDrvMSX_swing = { - "msx_swing", NULL, "msx_msx", NULL, "1985", - "Swing (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_swingRomInfo, MSX_swingRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Swing (Jpn, Alt) - -static struct BurnRomInfo MSX_swingaRomDesc[] = { - { "swing (japan) (alt 1).rom", 0x04000, 0x60355c9e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_swinga, MSX_swinga, msx_msx) -STD_ROM_FN(MSX_swinga) - -struct BurnDriver BurnDrvMSX_swinga = { - "msx_swinga", "msx_swing", "msx_msx", NULL, "1985", - "Swing (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_swingaRomInfo, MSX_swingaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Takahashi Meijin no Boukenjima (Jpn) - -static struct BurnRomInfo MSX_takameijRomDesc[] = { - { "wonder boy (japan).rom", 0x08000, 0x892266ca, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_takameij, MSX_takameij, msx_msx) -STD_ROM_FN(MSX_takameij) - -struct BurnDriver BurnDrvMSX_takameij = { - "msx_takameij", NULL, "msx_msx", NULL, "1986", - "Wonder Boy. Takahashi Meijin no Boukenjima (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_takameijRomInfo, MSX_takameijRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Takahashi Meijin no Boukenjima (Jpn, Alt) - -static struct BurnRomInfo MSX_takameijaRomDesc[] = { - { "wonder boy (japan) (alt 1).rom", 0x08000, 0x5130c27b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_takameija, MSX_takameija, msx_msx) -STD_ROM_FN(MSX_takameija) - -struct BurnDriver BurnDrvMSX_takameija = { - "msx_takameija", "msx_takameij", "msx_msx", NULL, "1986", - "Takahashi Meijin no Boukenjima (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_takameijaRomInfo, MSX_takameijaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Takahashi Meijin no Boukenjima (Kor, Star Frontiers) - -static struct BurnRomInfo MSX_takameijk1RomDesc[] = { - { "takahasi meijin no boukenjima. wonder boy (1986)(hudson soft)[cr star frontiers].rom", 0x08000, 0x78ab8fd7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_takameijk1, MSX_takameijk1, msx_msx) -STD_ROM_FN(MSX_takameijk1) - -struct BurnDriver BurnDrvMSX_takameijk1 = { - "msx_takameijk1", "msx_takameij", "msx_msx", NULL, "1988", - "Takahashi Meijin no Boukenjima (Kor, Star Frontiers)\0", NULL, "Star Frontiers", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_takameijk1RomInfo, MSX_takameijk1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Takahashi Meijin no Boukenjima (Kor, Zemina) - -static struct BurnRomInfo MSX_takameijk2RomDesc[] = { - { "wonderboy.rom", 0x08000, 0x9b4fb6c9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_takameijk2, MSX_takameijk2, msx_msx) -STD_ROM_FN(MSX_takameijk2) - -struct BurnDriver BurnDrvMSX_takameijk2 = { - "msx_takameijk2", "msx_takameij", "msx_msx", NULL, "198?", - "Takahashi Meijin no Boukenjima (Kor, Zemina)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_takameijk2RomInfo, MSX_takameijk2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Takeru Densetsu (Jpn) - -static struct BurnRomInfo MSX_takeruRomDesc[] = { - { "fuun takeshijyou (japan).rom", 0x08000, 0xc57272c3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_takeru, MSX_takeru, msx_msx) -STD_ROM_FN(MSX_takeru) - -struct BurnDriver BurnDrvMSX_takeru = { - "msx_takeru", NULL, "msx_msx", NULL, "1987", - "Takeru Densetsu (Jpn)\0", NULL, "Brother Kougyou", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_takeruRomInfo, MSX_takeruRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tank Battalion (Jpn) - -static struct BurnRomInfo MSX_tankbattRomDesc[] = { - { "tank battalion (japan).rom", 0x02000, 0xf48a0c3b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tankbatt, MSX_tankbatt, msx_msx) -STD_ROM_FN(MSX_tankbatt) - -struct BurnDriver BurnDrvMSX_tankbatt = { - "msx_tankbatt", NULL, "msx_msx", NULL, "1984", - "Tank Battalion (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tankbattRomInfo, MSX_tankbattRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tatica (Jpn) - -static struct BurnRomInfo MSX_taticaRomDesc[] = { - { "tatica (japan).rom", 0x04000, 0x7914f7a6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tatica, MSX_tatica, msx_msx) -STD_ROM_FN(MSX_tatica) - -struct BurnDriver BurnDrvMSX_tatica = { - "msx_tatica", NULL, "msx_msx", NULL, "1985", - "Tatica (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_taticaRomInfo, MSX_taticaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tawara-kun (Jpn) - -static struct BurnRomInfo MSX_tawaraknRomDesc[] = { - { "tawara-kun (japan).rom", 0x04000, 0x589ce03e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tawarakn, MSX_tawarakn, msx_msx) -STD_ROM_FN(MSX_tawarakn) - -struct BurnDriver BurnDrvMSX_tawarakn = { - "msx_tawarakn", NULL, "msx_msx", NULL, "1984", - "Tawara-kun (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tawaraknRomInfo, MSX_tawaraknRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tawara-kun (Jpn, Alt) - -static struct BurnRomInfo MSX_tawaraknaRomDesc[] = { - { "tawara-kun (japan) (alt 1).rom", 0x04000, 0xd69e9ea6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tawarakna, MSX_tawarakna, msx_msx) -STD_ROM_FN(MSX_tawarakna) - -struct BurnDriver BurnDrvMSX_tawarakna = { - "msx_tawarakna", "msx_tawarakn", "msx_msx", NULL, "1984", - "Tawara-kun (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tawaraknaRomInfo, MSX_tawaraknaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tawara-kun (Jpn, Alt 2) - -static struct BurnRomInfo MSX_tawaraknbRomDesc[] = { - { "tawara-kun (japan) (alt 2).rom", 0x04000, 0x895cb183, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tawaraknb, MSX_tawaraknb, msx_msx) -STD_ROM_FN(MSX_tawaraknb) - -struct BurnDriver BurnDrvMSX_tawaraknb = { - "msx_tawaraknb", "msx_tawarakn", "msx_msx", NULL, "1984", - "Tawara-kun (Jpn, Alt 2)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tawaraknbRomInfo, MSX_tawaraknbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tear of Nile (Jpn) - -static struct BurnRomInfo MSX_tearnileRomDesc[] = { - { "tear of nile (japan).rom", 0x08000, 0x867ba302, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tearnile, MSX_tearnile, msx_msx) -STD_ROM_FN(MSX_tearnile) - -struct BurnDriver BurnDrvMSX_tearnile = { - "msx_tearnile", NULL, "msx_msx", NULL, "1986", - "Tear of Nile (Jpn)\0", NULL, "Victor", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tearnileRomInfo, MSX_tearnileRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Telebunnie (Jpn) - -static struct BurnRomInfo MSX_telebunnRomDesc[] = { - { "telebunnie (japan).rom", 0x04000, 0x377fefef, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_telebunn, MSX_telebunn, msx_msx) -STD_ROM_FN(MSX_telebunn) - -struct BurnDriver BurnDrvMSX_telebunn = { - "msx_telebunn", NULL, "msx_msx", NULL, "1984", - "Telebunnie (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_telebunnRomInfo, MSX_telebunnRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Telebunnie (Jpn, Alt) - -static struct BurnRomInfo MSX_telebunnaRomDesc[] = { - { "telebunnie (japan) (alt 1).rom", 0x04000, 0x29314400, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_telebunna, MSX_telebunna, msx_msx) -STD_ROM_FN(MSX_telebunna) - -struct BurnDriver BurnDrvMSX_telebunna = { - "msx_telebunna", "msx_telebunn", "msx_msx", NULL, "1984", - "Telebunnie (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_telebunnaRomInfo, MSX_telebunnaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tensai Rabbian Daifunsen (Jpn) - -static struct BurnRomInfo MSX_tensairdRomDesc[] = { - { "tensai rabbian daifunsen (japan).rom", 0x08000, 0xb7322600, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tensaird, MSX_tensaird, msx_msx) -STD_ROM_FN(MSX_tensaird) - -struct BurnDriver BurnDrvMSX_tensaird = { - "msx_tensaird", NULL, "msx_msx", NULL, "1986", - "Tensai Rabbian Daifunsen (Jpn)\0", NULL, "Toshiba EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tensairdRomInfo, MSX_tensairdRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tetra Horror (Jpn) - -static struct BurnRomInfo MSX_tetrahorRomDesc[] = { - { "tetra horror (japan).rom", 0x04000, 0xe2d3377c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tetrahor, MSX_tetrahor, msx_msx) -STD_ROM_FN(MSX_tetrahor) - -struct BurnDriver BurnDrvMSX_tetrahor = { - "msx_tetrahor", NULL, "msx_msx", NULL, "1983", - "Tetra Horror (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tetrahorRomInfo, MSX_tetrahorRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tetra Horror (Jpn, Alt) - -static struct BurnRomInfo MSX_tetrahoraRomDesc[] = { - { "tetra horror (japan) (alt 1).rom", 0x04000, 0x2e1be8b6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tetrahora, MSX_tetrahora, msx_msx) -STD_ROM_FN(MSX_tetrahora) - -struct BurnDriver BurnDrvMSX_tetrahora = { - "msx_tetrahora", "msx_tetrahor", "msx_msx", NULL, "1983", - "Tetra Horror (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tetrahoraRomInfo, MSX_tetrahoraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tetris (Kor) - -static struct BurnRomInfo MSX_tetrisRomDesc[] = { - { "tetris (korea) (unl).rom", 0x08000, 0xadcb026d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tetris, MSX_tetris, msx_msx) -STD_ROM_FN(MSX_tetris) - -struct BurnDriver BurnDrvMSX_tetris = { - "msx_tetris", NULL, "msx_msx", NULL, "19??", - "Tetris (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tetrisRomInfo, MSX_tetrisRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tetris (Kor, Alt) - -static struct BurnRomInfo MSX_tetrisaRomDesc[] = { - { "tetrisa.rom", 0x08000, 0xb358d5a7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tetrisa, MSX_tetrisa, msx_msx) -STD_ROM_FN(MSX_tetrisa) - -struct BurnDriver BurnDrvMSX_tetrisa = { - "msx_tetrisa", "msx_tetris", "msx_msx", NULL, "198?", - "Tetris (Kor, Alt)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tetrisaRomInfo, MSX_tetrisaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tetris II (Kor) - -static struct BurnRomInfo MSX_tetris2RomDesc[] = { - { "tetris2.rom", 0x08000, 0xd1e2f414, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tetris2, MSX_tetris2, msx_msx) -STD_ROM_FN(MSX_tetris2) - -struct BurnDriver BurnDrvMSX_tetris2 = { - "msx_tetris2", NULL, "msx_msx", NULL, "1989", - "Tetris II (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tetris2RomInfo, MSX_tetris2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tetsuman (Jpn) - -static struct BurnRomInfo MSX_tetsumanRomDesc[] = { - { "tetsuman (japan).rom", 0x04000, 0x929d6786, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tetsuman, MSX_tetsuman, msx_msx) -STD_ROM_FN(MSX_tetsuman) - -struct BurnDriver BurnDrvMSX_tetsuman = { - "msx_tetsuman", NULL, "msx_msx", NULL, "1985", - "Tetsuman (Jpn)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tetsumanRomInfo, MSX_tetsumanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Tetsuman (Jpn, Alt) - -static struct BurnRomInfo MSX_tetsumanaRomDesc[] = { - { "tetsuman (japan) (alt 1).rom", 0x04000, 0xb6c02ae7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tetsumana, MSX_tetsumana, msx_msx) -STD_ROM_FN(MSX_tetsumana) - -struct BurnDriver BurnDrvMSX_tetsumana = { - "msx_tetsumana", "msx_tetsuman", "msx_msx", NULL, "1985", - "Tetsuman (Jpn, Alt)\0", NULL, "HAL Kenkyuujo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tetsumanaRomInfo, MSX_tetsumanaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Thexder (Jpn) - -static struct BurnRomInfo MSX_thexderRomDesc[] = { - { "thexder (japan).rom", 0x08000, 0x599aa9ac, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_thexder, MSX_thexder, msx_msx) -STD_ROM_FN(MSX_thexder) - -struct BurnDriver BurnDrvMSX_thexder = { - "msx_thexder", NULL, "msx_msx", NULL, "1986", - "Thexder (Jpn)\0", NULL, "Game Arts?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_thexderRomInfo, MSX_thexderRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Thexder (Jpn, Alt) - -static struct BurnRomInfo MSX_thexderaRomDesc[] = { - { "thexder (japan) (alt 1).rom", 0x08000, 0xda428d4b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_thexdera, MSX_thexdera, msx_msx) -STD_ROM_FN(MSX_thexdera) - -struct BurnDriver BurnDrvMSX_thexdera = { - "msx_thexdera", "msx_thexder", "msx_msx", NULL, "1986", - "Thexder (Jpn, Alt)\0", NULL, "Game Arts?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_thexderaRomInfo, MSX_thexderaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Thexder (Jpn, Alt 2) - -static struct BurnRomInfo MSX_thexderbRomDesc[] = { - { "thexder (japan) (alt 2).rom", 0x08000, 0x61704513, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_thexderb, MSX_thexderb, msx_msx) -STD_ROM_FN(MSX_thexderb) - -struct BurnDriver BurnDrvMSX_thexderb = { - "msx_thexderb", "msx_thexder", "msx_msx", NULL, "1986", - "Thexder (Jpn, Alt 2)\0", NULL, "Game Arts?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_thexderbRomInfo, MSX_thexderbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Three Dragon Story (Kor) - -static struct BurnRomInfo MSX_3dragonRomDesc[] = { - { "thrdrsto.rom", 0x08000, 0xf052e5fb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_3dragon, MSX_3dragon, msx_msx) -STD_ROM_FN(MSX_3dragon) - -struct BurnDriver BurnDrvMSX_3dragon = { - "msx_3dragon", NULL, "msx_msx", NULL, "1989", - "The Three Dragon Story (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_3dragonRomInfo, MSX_3dragonRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Thunder Ball (Jpn) - -static struct BurnRomInfo MSX_thndrbalRomDesc[] = { - { "thunder ball (japan).rom", 0x08000, 0x86f902a9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_thndrbal, MSX_thndrbal, msx_msx) -STD_ROM_FN(MSX_thndrbal) - -struct BurnDriver BurnDrvMSX_thndrbal = { - "msx_thndrbal", NULL, "msx_msx", NULL, "1985", - "Thunder Ball (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_thndrbalRomInfo, MSX_thndrbalRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Thunder Ball (Jpn, Alt) - -static struct BurnRomInfo MSX_thndrbalaRomDesc[] = { - { "thunder ball (japan) (alt 1).rom", 0x08000, 0xb06b8920, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_thndrbala, MSX_thndrbala, msx_msx) -STD_ROM_FN(MSX_thndrbala) - -struct BurnDriver BurnDrvMSX_thndrbala = { - "msx_thndrbala", "msx_thndrbal", "msx_msx", NULL, "1985", - "Thunder Ball (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_thndrbalaRomInfo, MSX_thndrbalaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Thunderbolt (Jpn) - -static struct BurnRomInfo MSX_thndboltRomDesc[] = { - { "thunderbolt (japan).rom", 0x08000, 0xd8739501, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_thndbolt, MSX_thndbolt, msx_msx) -STD_ROM_FN(MSX_thndbolt) - -struct BurnDriver BurnDrvMSX_thndbolt = { - "msx_thndbolt", NULL, "msx_msx", NULL, "1986", - "Thunderbolt (Jpn)\0", NULL, "Pixel", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_thndboltRomInfo, MSX_thndboltRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Thunderbolt (Jpn, Alt) - -static struct BurnRomInfo MSX_thndboltaRomDesc[] = { - { "thunderbolt (japan) (alt 1).rom", 0x08000, 0x6b63047c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_thndbolta, MSX_thndbolta, msx_msx) -STD_ROM_FN(MSX_thndbolta) - -struct BurnDriver BurnDrvMSX_thndbolta = { - "msx_thndbolta", "msx_thndbolt", "msx_msx", NULL, "1986", - "Thunderbolt (Jpn, Alt)\0", NULL, "Pixel", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_thndboltaRomInfo, MSX_thndboltaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Thunderbolt (Jpn, Alt 2) - -static struct BurnRomInfo MSX_thndboltbRomDesc[] = { - { "thunderbolt (japan) (alt 2).rom", 0x08000, 0xde3a82f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_thndboltb, MSX_thndboltb, msx_msx) -STD_ROM_FN(MSX_thndboltb) - -struct BurnDriver BurnDrvMSX_thndboltb = { - "msx_thndboltb", "msx_thndbolt", "msx_msx", NULL, "1986", - "Thunderbolt (Jpn, Alt 2)\0", NULL, "Pixel", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_thndboltbRomInfo, MSX_thndboltbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Time Pilot (Jpn) - -static struct BurnRomInfo MSX_timepltRomDesc[] = { - { "time pilot (japan).rom", 0x04000, 0xe4abe008, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_timeplt, MSX_timeplt, msx_msx) -STD_ROM_FN(MSX_timeplt) - -struct BurnDriver BurnDrvMSX_timeplt = { - "msx_timeplt", NULL, "msx_msx", NULL, "1983", - "Time Pilot (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_timepltRomInfo, MSX_timepltRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Time Pilot (Jpn, Alt) - -static struct BurnRomInfo MSX_timepltaRomDesc[] = { - { "time pilot (japan) (alt 1).rom", 0x04000, 0x23152fc3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_timeplta, MSX_timeplta, msx_msx) -STD_ROM_FN(MSX_timeplta) - -struct BurnDriver BurnDrvMSX_timeplta = { - "msx_timeplta", "msx_timeplt", "msx_msx", NULL, "1983", - "Time Pilot (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_timepltaRomInfo, MSX_timepltaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ti Ti! Pang Pang! (Kor) - -static struct BurnRomInfo MSX_titipangRomDesc[] = { - { "ti ti! pang pang!.rom", 0x08000, 0x2808a3bc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_titipang, MSX_titipang, msx_msx) -STD_ROM_FN(MSX_titipang) - -struct BurnDriver BurnDrvMSX_titipang = { - "msx_titipang", NULL, "msx_msx", NULL, "1989", - "Ti Ti! Pang Pang! (Kor)\0", NULL, "Aproman", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_titipangRomInfo, MSX_titipangRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Top Roller! (Jpn) - -static struct BurnRomInfo MSX_toprollrRomDesc[] = { - { "top roller! (japan).rom", 0x04000, 0xfc609730, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_toprollr, MSX_toprollr, msx_msx) -STD_ROM_FN(MSX_toprollr) - -struct BurnDriver BurnDrvMSX_toprollr = { - "msx_toprollr", NULL, "msx_msx", NULL, "1984", - "Top Roller! (Jpn)\0", NULL, "Jaleco", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_toprollrRomInfo, MSX_toprollrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Topple Zip (Jpn) - -static struct BurnRomInfo MSX_topzipRomDesc[] = { - { "topple zip (japan).rom", 0x08000, 0x190f4ce5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_topzip, MSX_topzip, msx_msx) -STD_ROM_FN(MSX_topzip) - -struct BurnDriver BurnDrvMSX_topzip = { - "msx_topzip", NULL, "msx_msx", NULL, "1986", - "Topple Zip (Jpn)\0", NULL, "Bothtec", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_topzipRomInfo, MSX_topzipRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Tower of Druaga (Jpn) - -static struct BurnRomInfo MSX_druagaRomDesc[] = { - { "tower of druaga, the (japan).rom", 0x08000, 0x47bef309, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_druaga, MSX_druaga, msx_msx) -STD_ROM_FN(MSX_druaga) - -struct BurnDriver BurnDrvMSX_druaga = { - "msx_druaga", NULL, "msx_msx", NULL, "1986", - "The Tower of Druaga (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_druagaRomInfo, MSX_druagaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Track & Field 1 (Euro) - -static struct BurnRomInfo MSX_trackfldRomDesc[] = { - { "track & field 1 (europe).rom", 0x04000, 0xe96b861d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_trackfld, MSX_trackfld, msx_msx) -STD_ROM_FN(MSX_trackfld) - -struct BurnDriver BurnDrvMSX_trackfld = { - "msx_trackfld", NULL, "msx_msx", NULL, "1984", - "Track & Field 1 (Euro)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_trackfldRomInfo, MSX_trackfldRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Track & Field 2 (Euro) - -static struct BurnRomInfo MSX_trackfl2RomDesc[] = { - { "track & field 2 (europe).rom", 0x04000, 0xb1ff5899, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_trackfl2, MSX_trackfl2, msx_msx) -STD_ROM_FN(MSX_trackfl2) - -struct BurnDriver BurnDrvMSX_trackfl2 = { - "msx_trackfl2", NULL, "msx_msx", NULL, "1984", - "Track & Field 2 (Euro)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_trackfl2RomInfo, MSX_trackfl2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Traffic (Jpn) - -static struct BurnRomInfo MSX_trafficRomDesc[] = { - { "traffic (japan).rom", 0x08000, 0xb80ebeb4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_traffic, MSX_traffic, msx_msx) -STD_ROM_FN(MSX_traffic) - -struct BurnDriver BurnDrvMSX_traffic = { - "msx_traffic", NULL, "msx_msx", NULL, "1986", - "Traffic (Jpn)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_trafficRomInfo, MSX_trafficRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Traffic (Jpn, Alt) - -static struct BurnRomInfo MSX_trafficaRomDesc[] = { - { "traffic (japan) (alt 1).rom", 0x08000, 0xf6b87d85, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_traffica, MSX_traffica, msx_msx) -STD_ROM_FN(MSX_traffica) - -struct BurnDriver BurnDrvMSX_traffica = { - "msx_traffica", "msx_traffic", "msx_msx", NULL, "1986", - "Traffic (Jpn, Alt)\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_trafficaRomInfo, MSX_trafficaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Trial Ski (Jpn) - -static struct BurnRomInfo MSX_trialskiRomDesc[] = { - { "trial ski (japan).rom", 0x04000, 0x152bebc2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_trialski, MSX_trialski, msx_msx) -STD_ROM_FN(MSX_trialski) - -struct BurnDriver BurnDrvMSX_trialski = { - "msx_trialski", NULL, "msx_msx", NULL, "1984", - "Trial Ski (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_trialskiRomInfo, MSX_trialskiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Triton (Jpn) - -static struct BurnRomInfo MSX_tritonRomDesc[] = { - { "tritorn (japan).rom", 0x08000, 0xc0a81a48, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_triton, MSX_triton, msx_msx) -STD_ROM_FN(MSX_triton) - -struct BurnDriver BurnDrvMSX_triton = { - "msx_triton", NULL, "msx_msx", NULL, "1986", - "Triton (Jpn)\0", NULL, "Sein Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tritonRomInfo, MSX_tritonRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Turboat (Jpn) - -static struct BurnRomInfo MSX_turboatRomDesc[] = { - { "turboat (japan).rom", 0x04000, 0xc7abc409, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_turboat, MSX_turboat, msx_msx) -STD_ROM_FN(MSX_turboat) - -struct BurnDriver BurnDrvMSX_turboat = { - "msx_turboat", NULL, "msx_msx", NULL, "1984", - "Turboat (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_turboatRomInfo, MSX_turboatRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Turmoil (Jpn) - -static struct BurnRomInfo MSX_turmoilRomDesc[] = { - { "turmoil (japan).rom", 0x04000, 0x17683f42, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_turmoil, MSX_turmoil, msx_msx) -STD_ROM_FN(MSX_turmoil) - -struct BurnDriver BurnDrvMSX_turmoil = { - "msx_turmoil", NULL, "msx_msx", NULL, "1984", - "Turmoil (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_turmoilRomInfo, MSX_turmoilRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Turmoil (Kor) - -static struct BurnRomInfo MSX_turmoilkRomDesc[] = { - { "turmoil (1984)(qnix).rom", 0x04000, 0x2cf9d4ab, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_turmoilk, MSX_turmoilk, msx_msx) -STD_ROM_FN(MSX_turmoilk) - -struct BurnDriver BurnDrvMSX_turmoilk = { - "msx_turmoilk", "msx_turmoil", "msx_msx", NULL, "1984?", - "Turmoil (Kor)\0", NULL, "Qnix", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_turmoilkRomInfo, MSX_turmoilkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Twin Bee (Jpn) - -static struct BurnRomInfo MSX_twinbeeRomDesc[] = { - { "twin bee (japan).rom", 0x08000, 0xc730d4a4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_twinbee, MSX_twinbee, msx_msx) -STD_ROM_FN(MSX_twinbee) - -struct BurnDriver BurnDrvMSX_twinbee = { - "msx_twinbee", NULL, "msx_msx", NULL, "1986", - "Twin Bee (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_twinbeeRomInfo, MSX_twinbeeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Twin Bee (Jpn, Alt) - -static struct BurnRomInfo MSX_twinbeeaRomDesc[] = { - { "twin bee (japan) (alt 1).rom", 0x08000, 0x71309c8f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_twinbeea, MSX_twinbeea, msx_msx) -STD_ROM_FN(MSX_twinbeea) - -struct BurnDriver BurnDrvMSX_twinbeea = { - "msx_twinbeea", "msx_twinbee", "msx_msx", NULL, "1986", - "Twin Bee (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_twinbeeaRomInfo, MSX_twinbeeaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Twin Bee (Jpn, Alt 2) - -static struct BurnRomInfo MSX_twinbeebRomDesc[] = { - { "twin bee (japan) (alt 2).rom", 0x08000, 0x3827a473, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_twinbeeb, MSX_twinbeeb, msx_msx) -STD_ROM_FN(MSX_twinbeeb) - -struct BurnDriver BurnDrvMSX_twinbeeb = { - "msx_twinbeeb", "msx_twinbee", "msx_msx", NULL, "1986", - "Twin Bee (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_twinbeebRomInfo, MSX_twinbeebRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Twin Bee (Jpn, Alt 3) - -static struct BurnRomInfo MSX_twinbeecRomDesc[] = { - { "twin bee (japan) (alt 3).rom", 0x08000, 0x23260108, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_twinbeec, MSX_twinbeec, msx_msx) -STD_ROM_FN(MSX_twinbeec) - -struct BurnDriver BurnDrvMSX_twinbeec = { - "msx_twinbeec", "msx_twinbee", "msx_msx", NULL, "1986", - "Twin Bee (Jpn, Alt 3)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_twinbeecRomInfo, MSX_twinbeecRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Twin Hammer (Euro) - -static struct BurnRomInfo MSX_twinhammRomDesc[] = { - { "twin hammer (europe).rom", 0x08000, 0x28a7cebc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_twinhamm, MSX_twinhamm, msx_msx) -STD_ROM_FN(MSX_twinhamm) - -struct BurnDriver BurnDrvMSX_twinhamm = { - "msx_twinhamm", NULL, "msx_msx", NULL, "1989", - "Twin Hammer (Euro)\0", NULL, "Best", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_twinhammRomInfo, MSX_twinhammRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// TZR - GrandPrix Rider (Jpn) - -static struct BurnRomInfo MSX_tzrRomDesc[] = { - { "tzr - grand prix rider (japan).rom", 0x08000, 0xd792c827, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tzr, MSX_tzr, msx_msx) -STD_ROM_FN(MSX_tzr) - -struct BurnDriver BurnDrvMSX_tzr = { - "msx_tzr", NULL, "msx_msx", NULL, "1986", - "TZR - GrandPrix Rider (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tzrRomInfo, MSX_tzrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Ultraman (Jpn) - -static struct BurnRomInfo MSX_ultramanRomDesc[] = { - { "ultraman (japan).rom", 0x04000, 0x973d816d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ultraman, MSX_ultraman, msx_msx) -STD_ROM_FN(MSX_ultraman) - -struct BurnDriver BurnDrvMSX_ultraman = { - "msx_ultraman", NULL, "msx_msx", NULL, "1984", - "Ultraman (Jpn)\0", NULL, "Bandai", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ultramanRomInfo, MSX_ultramanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Video Hustler (Jpn) - -static struct BurnRomInfo MSX_hustlerRomDesc[] = { - { "video hustler (japan).rom", 0x02000, 0x64853262, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hustler, MSX_hustler, msx_msx) -STD_ROM_FN(MSX_hustler) - -struct BurnDriver BurnDrvMSX_hustler = { - "msx_hustler", "msx_konbill", "msx_msx", NULL, "1984", - "Video Hustler (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hustlerRomInfo, MSX_hustlerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Video Hustler (Jpn, Alt) - -static struct BurnRomInfo MSX_hustleraRomDesc[] = { - { "video hustler (japan) (alt 1).rom", 0x02000, 0x8d99c3b0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hustlera, MSX_hustlera, msx_msx) -STD_ROM_FN(MSX_hustlera) - -struct BurnDriver BurnDrvMSX_hustlera = { - "msx_hustlera", "msx_konbill", "msx_msx", NULL, "1984", - "Video Hustler (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hustleraRomInfo, MSX_hustleraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Vigilante (Kor) - -static struct BurnRomInfo MSX_vigilantRomDesc[] = { - { "vigilante_(clover).rom", 0x08000, 0x2619f221, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_vigilant, MSX_vigilant, msx_msx) -STD_ROM_FN(MSX_vigilant) - -struct BurnDriver BurnDrvMSX_vigilant = { - "msx_vigilant", NULL, "msx_msx", NULL, "1990", - "Vigilante (Kor)\0", NULL, "Clover", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_vigilantRomInfo, MSX_vigilantRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Volguard (Jpn) - -static struct BurnRomInfo MSX_volguardRomDesc[] = { - { "volguard (japan).rom", 0x08000, 0x874e59fb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_volguard, MSX_volguard, msx_msx) -STD_ROM_FN(MSX_volguard) - -struct BurnDriver BurnDrvMSX_volguard = { - "msx_volguard", NULL, "msx_msx", NULL, "1985", - "Volguard (Jpn)\0", NULL, "dB-Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_volguardRomInfo, MSX_volguardRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Warp & Warp (Jpn) - -static struct BurnRomInfo MSX_warpwarpRomDesc[] = { - { "warp & warp (japan).rom", 0x02000, 0x90f5f414, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_warpwarp, MSX_warpwarp, msx_msx) -STD_ROM_FN(MSX_warpwarp) - -struct BurnDriver BurnDrvMSX_warpwarp = { - "msx_warpwarp", NULL, "msx_msx", NULL, "1984", - "Warp & Warp (Jpn)\0", NULL, "Namcot", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_warpwarpRomInfo, MSX_warpwarpRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Warroid (Jpn) - -static struct BurnRomInfo MSX_warroidRomDesc[] = { - { "warroid (japan).rom", 0x08000, 0xa0a19fd5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_warroid, MSX_warroid, msx_msx) -STD_ROM_FN(MSX_warroid) - -struct BurnDriver BurnDrvMSX_warroid = { - "msx_warroid", NULL, "msx_msx", NULL, "1985", - "Warroid (Jpn)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_warroidRomInfo, MSX_warroidRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Warroid (Jpn, Alt) - -static struct BurnRomInfo MSX_warroidaRomDesc[] = { - { "warroid (japan) (alt 1).rom", 0x08000, 0xe621ebc9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_warroida, MSX_warroida, msx_msx) -STD_ROM_FN(MSX_warroida) - -struct BurnDriver BurnDrvMSX_warroida = { - "msx_warroida", "msx_warroid", "msx_msx", NULL, "1985", - "Warroid (Jpn, Alt)\0", NULL, "ASCII", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_warroidaRomInfo, MSX_warroidaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Water Driver (Jpn) - -static struct BurnRomInfo MSX_waterdrvRomDesc[] = { - { "water driver (japan).rom", 0x04000, 0xd5af9e82, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_waterdrv, MSX_waterdrv, msx_msx) -STD_ROM_FN(MSX_waterdrv) - -struct BurnDriver BurnDrvMSX_waterdrv = { - "msx_waterdrv", NULL, "msx_msx", NULL, "1984", - "Water Driver (Jpn)\0", NULL, "Colpax?", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_waterdrvRomInfo, MSX_waterdrvRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Wedding Bells (Jpn) - -static struct BurnRomInfo MSX_wbellsRomDesc[] = { - { "wedding bells (1984)(nippon columbia - colpax - universal).rom", 0x04000, 0x00585f00, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wbells, MSX_wbells, msx_msx) -STD_ROM_FN(MSX_wbells) - -struct BurnDriver BurnDrvMSX_wbells = { - "msx_wbells", NULL, "msx_msx", NULL, "1984", - "Wedding Bells (Jpn)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_wbellsRomInfo, MSX_wbellsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Wedding Bells (Jpn, Alt) - -static struct BurnRomInfo MSX_wbellsaRomDesc[] = { - { "wedding bells (1984)(nippon columbia - colpax - universal)[a].rom", 0x04000, 0xc41c55cb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wbellsa, MSX_wbellsa, msx_msx) -STD_ROM_FN(MSX_wbellsa) - -struct BurnDriver BurnDrvMSX_wbellsa = { - "msx_wbellsa", "msx_wbells", "msx_msx", NULL, "1984", - "Wedding Bells (Jpn, Alt)\0", NULL, "Nihon Columbia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_wbellsaRomInfo, MSX_wbellsaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Wonsiin (Kor) - -static struct BurnRomInfo MSX_wonsiinRomDesc[] = { - { "wonsiin (kr).rom", 0x20000, 0xa05258f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wonsiin, MSX_wonsiin, msx_msx) -STD_ROM_FN(MSX_wonsiin) - -struct BurnDriver BurnDrvMSX_wonsiin = { - "msx_wonsiin", NULL, "msx_msx", NULL, "1991", - "Wonsiin (Kor)\0", NULL, "Zemina", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI, GBF_MISC, 0, - MSXGetZipName, MSX_wonsiinRomInfo, MSX_wonsiinRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Wrangler (Spa) - -static struct BurnRomInfo MSX_wranglerRomDesc[] = { - { "wrangler (spain).rom", 0x04000, 0x7185f5e8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wrangler, MSX_wrangler, msx_msx) -STD_ROM_FN(MSX_wrangler) - -struct BurnDriver BurnDrvMSX_wrangler = { - "msx_wrangler", NULL, "msx_msx", NULL, "1985", - "Wrangler (Spa)\0", NULL, "Sony Spain", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_wranglerRomInfo, MSX_wranglerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// The Wreck (Euro) - -static struct BurnRomInfo MSX_wreckRomDesc[] = { - { "wreck, the (europe).rom", 0x08000, 0x7efde800, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wreck, MSX_wreck, msx_msx) -STD_ROM_FN(MSX_wreck) - -struct BurnDriver BurnDrvMSX_wreck = { - "msx_wreck", NULL, "msx_msx", NULL, "1984", - "The Wreck (Euro)\0", NULL, "Electric Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_wreckRomInfo, MSX_wreckRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Xyzolog (Jpn) - -static struct BurnRomInfo MSX_xyzologRomDesc[] = { - { "xyxolog (japan).rom", 0x04000, 0xc7303910, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_xyzolog, MSX_xyzolog, msx_msx) -STD_ROM_FN(MSX_xyzolog) - -struct BurnDriver BurnDrvMSX_xyzolog = { - "msx_xyzolog", NULL, "msx_msx", NULL, "1984", - "Xyzolog (Jpn)\0", NULL, "Nidecom", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_xyzologRomInfo, MSX_xyzologRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Xyzolog (Jpn, Alt) - -static struct BurnRomInfo MSX_xyzologaRomDesc[] = { - { "xyxolog (japan) (alt 1).rom", 0x04000, 0xc9074b91, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_xyzologa, MSX_xyzologa, msx_msx) -STD_ROM_FN(MSX_xyzologa) - -struct BurnDriver BurnDrvMSX_xyzologa = { - "msx_xyzologa", "msx_xyzolog", "msx_msx", NULL, "1984", - "Xyzolog (Jpn, Alt)\0", NULL, "Nidecom", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_xyzologaRomInfo, MSX_xyzologaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yakyu Kyo (Jpn) - -static struct BurnRomInfo MSX_yakyukyoRomDesc[] = { - { "honkball (japan).rom", 0x08000, 0x24b94274, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_yakyukyo, MSX_yakyukyo, msx_msx) -STD_ROM_FN(MSX_yakyukyo) - -struct BurnDriver BurnDrvMSX_yakyukyo = { - "msx_yakyukyo", NULL, "msx_msx", NULL, "1985", - "Yakyu Kyo (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_yakyukyoRomInfo, MSX_yakyukyoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yami no Ryuuou - Hades no Monshou (Jpn) - -static struct BurnRomInfo MSX_hadesRomDesc[] = { - { "hades no monsho (japan).rom", 0x08000, 0x4d105f57, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hades, MSX_hades, msx_msx) -STD_ROM_FN(MSX_hades) - -struct BurnDriver BurnDrvMSX_hades = { - "msx_hades", NULL, "msx_msx", NULL, "1986", - "Yami no Ryuuou - Hades no Monshou (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hadesRomInfo, MSX_hadesRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yami no Ryuuou - Hades no Monshou (Jpn, Alt) - -static struct BurnRomInfo MSX_hadesaRomDesc[] = { - { "hades no monsho (japan) (alt 1).rom", 0x08000, 0xf42f4a15, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hadesa, MSX_hadesa, msx_msx) -STD_ROM_FN(MSX_hadesa) - -struct BurnDriver BurnDrvMSX_hadesa = { - "msx_hadesa", "msx_hades", "msx_msx", NULL, "1986", - "Yami no Ryuuou - Hades no Monshou (Jpn, Alt)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hadesaRomInfo, MSX_hadesaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yellow Submarine (Jpn) - -static struct BurnRomInfo MSX_yellowsbRomDesc[] = { - { "yellow submarine (japan).rom", 0x04000, 0x71e6605f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_yellowsb, MSX_yellowsb, msx_msx) -STD_ROM_FN(MSX_yellowsb) - -struct BurnDriver BurnDrvMSX_yellowsb = { - "msx_yellowsb", NULL, "msx_msx", NULL, "1987", - "Yellow Submarine (Jpn)\0", NULL, "Brother Kougyou", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_yellowsbRomInfo, MSX_yellowsbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yie Ar Kung-Fu (Jpn) - -static struct BurnRomInfo MSX_yiearRomDesc[] = { - { "yie ar kung-fu (japan).rom", 0x04000, 0x8a12ec4f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_yiear, MSX_yiear, msx_msx) -STD_ROM_FN(MSX_yiear) - -struct BurnDriver BurnDrvMSX_yiear = { - "msx_yiear", NULL, "msx_msx", NULL, "1985", - "Yie Ar Kung-Fu (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_yiearRomInfo, MSX_yiearRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yie Ar Kung-Fu (Jpn, Alt) - -static struct BurnRomInfo MSX_yiearaRomDesc[] = { - { "yie ar kung-fu (japan) (alt 1).rom", 0x04000, 0x0e197b49, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_yieara, MSX_yieara, msx_msx) -STD_ROM_FN(MSX_yieara) - -struct BurnDriver BurnDrvMSX_yieara = { - "msx_yieara", "msx_yiear", "msx_msx", NULL, "1985", - "Yie Ar Kung-Fu (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_yiearaRomInfo, MSX_yiearaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yie Ar Kung-Fu (Kor) - -static struct BurnRomInfo MSX_yiearkRomDesc[] = { - { "yakungfu.rom", 0x08000, 0x372086b5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_yieark, MSX_yieark, msx_msx) -STD_ROM_FN(MSX_yieark) - -struct BurnDriver BurnDrvMSX_yieark = { - "msx_yieark", "msx_yiear", "msx_msx", NULL, "198?", - "Yie Ar Kung-Fu (Kor)\0", NULL, "Unknown", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_yiearkRomInfo, MSX_yiearkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yie Ar Kung-Fu II - The Emperor Yie-Gah (Jpn) - -static struct BurnRomInfo MSX_yiear2RomDesc[] = { - { "yie ar kung-fu ii - the emperor yie-gah (japan).rom", 0x08000, 0xd66034a9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_yiear2, MSX_yiear2, msx_msx) -STD_ROM_FN(MSX_yiear2) - -struct BurnDriver BurnDrvMSX_yiear2 = { - "msx_yiear2", NULL, "msx_msx", NULL, "1985", - "Yie Ar Kung-Fu II - The Emperor Yie-Gah (Jpn)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_yiear2RomInfo, MSX_yiear2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yie Ar Kung-Fu II - The Emperor Yie-Gah (Jpn, Alt) - -static struct BurnRomInfo MSX_yiear2aRomDesc[] = { - { "yie ar kung-fu ii - the emperor yie-gah (japan) (alt 1).rom", 0x08000, 0x8099f5c7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_yiear2a, MSX_yiear2a, msx_msx) -STD_ROM_FN(MSX_yiear2a) - -struct BurnDriver BurnDrvMSX_yiear2a = { - "msx_yiear2a", "msx_yiear2", "msx_msx", NULL, "1985", - "Yie Ar Kung-Fu II - The Emperor Yie-Gah (Jpn, Alt)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_yiear2aRomInfo, MSX_yiear2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Yie Ar Kung-Fu II - The Emperor Yie-Gah (Jpn, Alt 2) - -static struct BurnRomInfo MSX_yiear2bRomDesc[] = { - { "yie ar kung-fu ii - the emperor yie-gah (japan) (alt 2).rom", 0x08000, 0x70e679c3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_yiear2b, MSX_yiear2b, msx_msx) -STD_ROM_FN(MSX_yiear2b) - -struct BurnDriver BurnDrvMSX_yiear2b = { - "msx_yiear2b", "msx_yiear2", "msx_msx", NULL, "1985", - "Yie Ar Kung-Fu II - The Emperor Yie-Gah (Jpn, Alt 2)\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_yiear2bRomInfo, MSX_yiear2bRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Youkai Tantei Chima Chima (Jpn) - -static struct BurnRomInfo MSX_chimaRomDesc[] = { - { "yokai tanken chimachima (japan).rom", 0x08000, 0x8d636963, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chima, MSX_chima, msx_msx) -STD_ROM_FN(MSX_chima) - -struct BurnDriver BurnDrvMSX_chima = { - "msx_chima", NULL, "msx_msx", NULL, "1985", - "Youkai Tantei Chima Chima (Jpn)\0", NULL, "Bothtec", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chimaRomInfo, MSX_chimaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Youkai Yashiki (Jpn) - -static struct BurnRomInfo MSX_youkaiyaRomDesc[] = { - { "haunted boynight (japan).rom", 0x08000, 0x2faf6e26, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_youkaiya, MSX_youkaiya, msx_msx) -STD_ROM_FN(MSX_youkaiya) - -struct BurnDriver BurnDrvMSX_youkaiya = { - "msx_youkaiya", NULL, "msx_msx", NULL, "1986", - "Haunted Boy. Youkai Yashiki (Jpn)\0", NULL, "Casio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_youkaiyaRomInfo, MSX_youkaiyaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Chou Senshi Zaider - Battle of Peguss (Jpn) - -static struct BurnRomInfo MSX_zaiderRomDesc[] = { - { "zaider - battle of peguss (japan).rom", 0x08000, 0xbeccf133, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zaider, MSX_zaider, msx_msx) -STD_ROM_FN(MSX_zaider) - -struct BurnDriver BurnDrvMSX_zaider = { - "msx_zaider", NULL, "msx_msx", NULL, "1986", - "Chou Senshi Zaider - Battle of Peguss (Jpn)\0", NULL, "Cosmos Computer", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zaiderRomInfo, MSX_zaiderRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Chou Senshi Zaider - Battle of Peguss (Jpn, Alt) - -static struct BurnRomInfo MSX_zaideraRomDesc[] = { - { "zaider - battle of peguss (japan) (alt 1).rom", 0x08000, 0x453bcd36, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zaidera, MSX_zaidera, msx_msx) -STD_ROM_FN(MSX_zaidera) - -struct BurnDriver BurnDrvMSX_zaidera = { - "msx_zaidera", "msx_zaider", "msx_msx", NULL, "1986", - "Chou Senshi Zaider - Battle of Peguss (Jpn, Alt)\0", NULL, "Cosmos Computer", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zaideraRomInfo, MSX_zaideraRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zanac 2nd Version (Jpn) - -static struct BurnRomInfo MSX_zanac2RomDesc[] = { - { "zanac (japan) (v2).rom", 0x08000, 0x8f1917d4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zanac2, MSX_zanac2, msx_msx) -STD_ROM_FN(MSX_zanac2) - -struct BurnDriver BurnDrvMSX_zanac2 = { - "msx_zanac2", NULL, "msx_msx", NULL, "1987", - "Zanac 2nd Version (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zanac2RomInfo, MSX_zanac2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zanac 2nd Version (Jpn, Alt) - -static struct BurnRomInfo MSX_zanac2aRomDesc[] = { - { "zanac (japan) (v2) (alt 1).rom", 0x08000, 0x8414ea0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zanac2a, MSX_zanac2a, msx_msx) -STD_ROM_FN(MSX_zanac2a) - -struct BurnDriver BurnDrvMSX_zanac2a = { - "msx_zanac2a", "msx_zanac2", "msx_msx", NULL, "1987", - "Zanac 2nd Version (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zanac2aRomInfo, MSX_zanac2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zanac (Jpn) - -static struct BurnRomInfo MSX_zanacRomDesc[] = { - { "zanac (japan).rom", 0x08000, 0x425e0d34, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zanac, MSX_zanac, msx_msx) -STD_ROM_FN(MSX_zanac) - -struct BurnDriver BurnDrvMSX_zanac = { - "msx_zanac", NULL, "msx_msx", NULL, "1986", - "Zanac (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zanacRomInfo, MSX_zanacRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zanac (Jpn, Alt) - -static struct BurnRomInfo MSX_zanacaRomDesc[] = { - { "zanac (japan) (alt 1).rom", 0x08000, 0x7f95533c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zanaca, MSX_zanaca, msx_msx) -STD_ROM_FN(MSX_zanaca) - -struct BurnDriver BurnDrvMSX_zanaca = { - "msx_zanaca", "msx_zanac", "msx_msx", NULL, "1986", - "Zanac (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zanacaRomInfo, MSX_zanacaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zaxxon (Jpn) - -static struct BurnRomInfo MSX_zaxxonRomDesc[] = { - { "zaxxon (japan).rom", 0x08000, 0x0b3ba595, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zaxxon, MSX_zaxxon, msx_msx) -STD_ROM_FN(MSX_zaxxon) - -struct BurnDriver BurnDrvMSX_zaxxon = { - "msx_zaxxon", NULL, "msx_msx", NULL, "1985", - "Zaxxon (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zaxxonRomInfo, MSX_zaxxonRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zaxxon (Jpn, Alt) - -static struct BurnRomInfo MSX_zaxxonaRomDesc[] = { - { "zaxxon (japan) (alt 1).rom", 0x08000, 0x353dd532, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zaxxona, MSX_zaxxona, msx_msx) -STD_ROM_FN(MSX_zaxxona) - -struct BurnDriver BurnDrvMSX_zaxxona = { - "msx_zaxxona", "msx_zaxxon", "msx_msx", NULL, "1985", - "Zaxxon (Jpn, Alt)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zaxxonaRomInfo, MSX_zaxxonaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zemmix Baduk Gyosil (Kor) - -static struct BurnRomInfo MSX_badukRomDesc[] = { - { "baduk.rom", 0x04000, 0x5ad4442d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_baduk, MSX_baduk, msx_msx) -STD_ROM_FN(MSX_baduk) - -struct BurnDriver BurnDrvMSX_baduk = { - "msx_baduk", NULL, "msx_msx", NULL, "19??", - "Zemmix Baduk Gyosil (Kor)\0", NULL, "Unknown", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_badukRomInfo, MSX_badukRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zenji (Jpn) - -static struct BurnRomInfo MSX_zenjiRomDesc[] = { - { "zenji (japan).rom", 0x04000, 0x77b3b0b9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zenji, MSX_zenji, msx_msx) -STD_ROM_FN(MSX_zenji) - -struct BurnDriver BurnDrvMSX_zenji = { - "msx_zenji", NULL, "msx_msx", NULL, "1984", - "Zenji (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zenjiRomInfo, MSX_zenjiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zexas Limited (Jpn) - -static struct BurnRomInfo MSX_zexasltdRomDesc[] = { - { "zexas limited (japan).rom", 0x08000, 0xefefa02a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zexasltd, MSX_zexasltd, msx_msx) -STD_ROM_FN(MSX_zexasltd) - -struct BurnDriver BurnDrvMSX_zexasltd = { - "msx_zexasltd", NULL, "msx_msx", NULL, "1985", - "Zexas Limited (Jpn)\0", NULL, "dB-Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zexasltdRomInfo, MSX_zexasltdRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zexas Limited (Jpn, Alt) - -static struct BurnRomInfo MSX_zexasltdaRomDesc[] = { - { "zexas limited (japan) (alt 1).rom", 0x08000, 0x01a73292, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zexasltda, MSX_zexasltda, msx_msx) -STD_ROM_FN(MSX_zexasltda) - -struct BurnDriver BurnDrvMSX_zexasltda = { - "msx_zexasltda", "msx_zexasltd", "msx_msx", NULL, "1985", - "Zexas Limited (Jpn, Alt)\0", NULL, "dB-Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zexasltdaRomInfo, MSX_zexasltdaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zexas Limited (Jpn, Alt 2) - -static struct BurnRomInfo MSX_zexasltdbRomDesc[] = { - { "zexas limited (japan) (alt 2).rom", 0x08000, 0x1e48edca, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zexasltdb, MSX_zexasltdb, msx_msx) -STD_ROM_FN(MSX_zexasltdb) - -struct BurnDriver BurnDrvMSX_zexasltdb = { - "msx_zexasltdb", "msx_zexasltd", "msx_msx", NULL, "1985", - "Zexas Limited (Jpn, Alt 2)\0", NULL, "dB-Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zexasltdbRomInfo, MSX_zexasltdbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zoom 909 (Jpn) - -static struct BurnRomInfo MSX_zoom909RomDesc[] = { - { "zoom 909 (japan).rom", 0x08000, 0x64283863, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zoom909, MSX_zoom909, msx_msx) -STD_ROM_FN(MSX_zoom909) - -struct BurnDriver BurnDrvMSX_zoom909 = { - "msx_zoom909", NULL, "msx_msx", NULL, "1986", - "Zoom 909 (Jpn)\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zoom909RomInfo, MSX_zoom909RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Zoom 909 (Kor) - -static struct BurnRomInfo MSX_zoom909kRomDesc[] = { - { "zoom 909 (1985)(sega)[cr prosoft].rom", 0x08000, 0x34b186ad, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zoom909k, MSX_zoom909k, msx_msx) -STD_ROM_FN(MSX_zoom909k) - -struct BurnDriver BurnDrvMSX_zoom909k = { - "msx_zoom909k", "msx_zoom909", "msx_msx", NULL, "19??", - "Zoom 909 (Kor)\0", NULL, "Prosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zoom909kRomInfo, MSX_zoom909kRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mars II (Jpn) - -static struct BurnRomInfo MSX_mars2RomDesc[] = { - { "mars ii (japan).rom", 0x02000, 0x48e9d13b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mars2, MSX_mars2, msx_msx) -STD_ROM_FN(MSX_mars2) - -struct BurnDriver BurnDrvMSX_mars2 = { - "msx_mars2", NULL, "msx_msx", NULL, "1990", - "Mars II (Jpn)\0", NULL, "Nagi-P Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mars2RomInfo, MSX_mars2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Bousou Tokkyuu SOS. Stop the Express (1985)(Hudson Soft)(JP) - -static struct BurnRomInfo MSX_bousousosRomDesc[] = { - { "bousoutokkyuusos.rom", 0x08000, 0x334efc07, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bousousos, MSX_bousousos, msx_msx) -STD_ROM_FN(MSX_bousousos) - -struct BurnDriver BurnDrvMSX_bousousos = { - "msx_bousousos", NULL, "msx_msx", NULL, "1985", - "Stop the Express. Bousou Tokkyuu SOS (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bousousosRomInfo, MSX_bousousosRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bousou Tokkyuu SOS. Stop the Express (1985)(Hudson Soft)(JP) ALT - -static struct BurnRomInfo MSX_bousousosaRomDesc[] = { - { "bousoutokkyuusosa.rom", 0x04000, 0xb6063493, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bousousosa, MSX_bousousosa, msx_msx) -STD_ROM_FN(MSX_bousousosa) - -struct BurnDriver BurnDrvMSX_bousousosa = { - "msx_bousousosa", "msx_bousousos", "msx_msx", NULL, "1985", - "Stop the Express. Bousou Tokkyuu SOS (Jpn, Alt)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bousousosaRomInfo, MSX_bousousosaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Invasion of the Zombie Monsters - -static struct BurnRomInfo MSX_invazmRomDesc[] = { - { "RLV904_Invasion_of_the_Zombie_Monsters.rom", 0x08000, 0xa232351f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_invazm, MSX_invazm, msx_msx) -STD_ROM_FN(MSX_invazm) - -struct BurnDriver BurnDrvMSX_invazm = { - "msx_invazm", NULL, "msx_msx", NULL, "2010", - "Invasion of the Zombie Monsters [RLV904]\0", NULL, "RELEVO", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_invazmRomInfo, MSX_invazmRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Gyruss - -static struct BurnRomInfo MSX_gyrussRomDesc[] = { - { "Gyruss.rom", 0x10000, 0x55335dd3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gyruss, MSX_gyruss, msx_msx) -STD_ROM_FN(MSX_gyruss) - -struct BurnDriver BurnDrvMSX_gyruss = { - "msx_gyruss", NULL, "msx_msx", NULL, "1984", - "Gyruss\0", NULL, "Parker Bros.", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gyrussRomInfo, MSX_gyrussRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Hype - -static struct BurnRomInfo MSX_hypeRomDesc[] = { - { "hype.rom", 0x08000, 0xf9c5977a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hype, MSX_hype, msx_msx) -STD_ROM_FN(MSX_hype) - -struct BurnDriver BurnDrvMSX_hype = { - "msx_hype", NULL, "msx_msx", NULL, "1987", - "Hype\0", NULL, "The Bytebusters", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hypeRomInfo, MSX_hypeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// J.E.T.P.A.C. - -static struct BurnRomInfo MSX_jetpacRomDesc[] = { - { "jetpac.rom", 0x08000, 0x38ad7112, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jetpac, MSX_jetpac, msx_msx) -STD_ROM_FN(MSX_jetpac) - -struct BurnDriver BurnDrvMSX_jetpac = { - "msx_jetpac", NULL, "msx_msx", NULL, "2009", - "J.E.T.P.A.C.\0", NULL, "Imanok", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jetpacRomInfo, MSX_jetpacRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mikie - -static struct BurnRomInfo MSX_mikieRomDesc[] = { - { "mikie.rom", 0x08000, 0xf4567a08, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mikie, MSX_mikie, msx_msx) -STD_ROM_FN(MSX_mikie) - -struct BurnDriver BurnDrvMSX_mikie = { - "msx_mikie", NULL, "msx_msx", NULL, "1984", - "Mikie. Shinnyuushain Tooru-Kun.\0", NULL, "Konami", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mikieRomInfo, MSX_mikieRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Skate Air - -static struct BurnRomInfo MSX_skateairRomDesc[] = { - { "SKATE_AIR_en.rom", 0x20000, 0x6398a569, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skateair, MSX_skateair, msx_msx) -STD_ROM_FN(MSX_skateair) - -struct BurnDriver BurnDrvMSX_skateair = { - "msx_skateair", NULL, "msx_msx", NULL, "2006", - "Skate Air\0", NULL, "Yerami Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skateairRomInfo, MSX_skateairRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Universe Unknown - -static struct BurnRomInfo MSX_univunkRomDesc[] = { - { "UniverseUnknown.rom", 0x0c000, 0xa017f389, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_univunk, MSX_univunk, msx_msx) -STD_ROM_FN(MSX_univunk) - -struct BurnDriver BurnDrvMSX_univunk = { - "msx_univunk", NULL, "msx_msx", NULL, "2005", - "Universe Unknown\0", NULL, "Infinite", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_univunkRomInfo, MSX_univunkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Wonder Kid. Adventure Kid. - -static struct BurnRomInfo MSX_wondkidRomDesc[] = { - { "Adventure_Kid (ASCII 16).rom", 0x20000, 0xcd8b5dd6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wondkid, MSX_wondkid, msx_msx) -STD_ROM_FN(MSX_wondkid) - -struct BurnDriver BurnDrvMSX_wondkid = { - "msx_wondkid", NULL, "msx_msx", NULL, "1993", - "Wonder Kid. Adventure Kid.\0", NULL, "Open", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_wondkidRomInfo, MSX_wondkidRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Zaxxon - Electric Software - -static struct BurnRomInfo MSX_zaxxonesRomDesc[] = { - { "Zaxxon (Electric Software).rom", 0x08000, 0x2ef2142d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zaxxones, MSX_zaxxones, msx_msx) -STD_ROM_FN(MSX_zaxxones) - -struct BurnDriver BurnDrvMSX_zaxxones = { - "msx_zaxxones", NULL, "msx_msx", NULL, "1985", - "Zaxxon (Electric Software)\0", NULL, "Electric Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zaxxonesRomInfo, MSX_zaxxonesRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mecha-8 - -static struct BurnRomInfo MSX_mecha8RomDesc[] = { - { "mecha8.rom", 0x08000, 0xc60e346e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mecha8, MSX_mecha8, msx_msx) -STD_ROM_FN(MSX_mecha8) - -struct BurnDriver BurnDrvMSX_mecha8 = { - "msx_mecha8", NULL, "msx_msx", NULL, "2011", - "Mecha-8\0", NULL, "Oscar Toledo G.", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mecha8RomInfo, MSX_mecha8RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Zombie Incident - -static struct BurnRomInfo MSX_zombieincRomDesc[] = { - { "ZombieIncident.rom", 0x0c000, 0x0d5c497a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zombieinc, MSX_zombieinc, msx_msx) -STD_ROM_FN(MSX_zombieinc) - -struct BurnDriver BurnDrvMSX_zombieinc = { - "msx_zombieinc12", NULL, "msx_msx", NULL, "2013", - "Zombie Incident (v1.2)\0", NULL, "NENEFRANZ", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zombieincRomInfo, MSX_zombieincRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Alter Ego - -static struct BurnRomInfo MSX_alteregoRomDesc[] = { - { "alterego.rom", 0x0c000, 0x41b51564, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alterego, MSX_alterego, msx_msx) -STD_ROM_FN(MSX_alterego) - -struct BurnDriver BurnDrvMSX_alterego = { - "msx_alterego", NULL, "msx_msx", NULL, "2011", - "Alter Ego\0", NULL, "The New Image", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alteregoRomInfo, MSX_alteregoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// M-Tanks - -static struct BurnRomInfo MSX_mtanksRomDesc[] = { - { "mtanks.rom", 0x20000, 0xc0efa4ff, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mtanks, MSX_mtanks, msx_msx) -STD_ROM_FN(MSX_mtanks) - -struct BurnDriver BurnDrvMSX_mtanks = { - "msx_mtanks", NULL, "msx_msx", NULL, "2011", - "M-Tanks\0", NULL, "Assembler Games", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mtanksRomInfo, MSX_mtanksRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// JumpinG - -static struct BurnRomInfo MSX_jumpingRomDesc[] = { - { "DMZ001-JpinG_English.rom", 0x08000, 0x7f492f09, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jumping, MSX_jumping, msx_msx) -STD_ROM_FN(MSX_jumping) - -struct BurnDriver BurnDrvMSX_jumping = { - "msx_jumping", NULL, "msx_msx", NULL, "2011", - "JumpinG (eng)\0", NULL, "DimensionZ", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jumpingRomInfo, MSX_jumpingRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Kill Mice - -static struct BurnRomInfo MSX_killmiceRomDesc[] = { - { "killmice.rom", 0x10000, 0x783afacb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_killmice, MSX_killmice, msx_msx) -STD_ROM_FN(MSX_killmice) - -struct BurnDriver BurnDrvMSX_killmice = { - "msx_killmice", NULL, "msx_msx", NULL, "2011", - "Kill Mice\0", NULL, "Gamecast Entertainment", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_killmiceRomInfo, MSX_killmiceRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Shouganai - -static struct BurnRomInfo MSX_shouganai11RomDesc[] = { - { "shoganai.rom", 0x04000, 0xd27ea890, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_shouganai11, MSX_shouganai11, msx_msx) -STD_ROM_FN(MSX_shouganai11) - -struct BurnDriver BurnDrvMSX_shouganai11 = { - "msx_shouganai11", NULL, "msx_msx", NULL, "2013", - "Shouganai\0", NULL, "Paxanga Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_shouganai11RomInfo, MSX_shouganai11RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Malaika - -static struct BurnRomInfo MSX_malaikaRomDesc[] = { - { "RLV914_MALAIKA.rom", 0x04000, 0x37c13320, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_malaika, MSX_malaika, msx_msx) -STD_ROM_FN(MSX_malaika) - -struct BurnDriver BurnDrvMSX_malaika = { - "msx_malaika12", NULL, "msx_msx", NULL, "2013", - "Malaika (v1.2)\0", NULL, "RELEVO", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_malaikaRomInfo, MSX_malaikaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Shmup! - -static struct BurnRomInfo MSX_shmupRomDesc[] = { - { "shmup!.rom", 0x04000, 0x99cca8a4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_shmup, MSX_shmup, msx_msx) -STD_ROM_FN(MSX_shmup) - -struct BurnDriver BurnDrvMSX_shmup = { - "msx_shmup11", NULL, "msx_msx", NULL, "2013", - "Shmup! (v1.1)\0", NULL, "IMANOK", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_shmupRomInfo, MSX_shmupRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Gommy - -static struct BurnRomInfo MSX_gommyRomDesc[] = { - { "DMZ-004_Gommy MD_msx.rom", 0x04000, 0x66b27261, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gommy, MSX_gommy, msx_msx) -STD_ROM_FN(MSX_gommy) - -struct BurnDriver BurnDrvMSX_gommy = { - "msx_gommy", NULL, "msx_msx", NULL, "2013", - "Gommy\0", NULL, "Retroworks/Dimension Z/NENEFRANZ", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gommyRomInfo, MSX_gommyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Teodoro No Sabe Volar - -static struct BurnRomInfo MSX_teodoroRomDesc[] = { - { "DMZ002 - Teodoro no sabe volar (English).rom", 0x08000, 0xd2d53275, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_teodoro, MSX_teodoro, msx_msx) -STD_ROM_FN(MSX_teodoro) - -struct BurnDriver BurnDrvMSX_teodoro = { - "msx_teodoro", NULL, "msx_msx", NULL, "2012", - "Teodoro No Sabe Volar\0", NULL, "Retroworks/Dimension Z", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_teodoroRomInfo, MSX_teodoroRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Subacuatic - -static struct BurnRomInfo MSX_subacuaticRomDesc[] = { - { "Subacuatic_(2012)_(rlv911).rom", 0x08000, 0x91884cc0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_subacuatic, MSX_subacuatic, msx_msx) -STD_ROM_FN(MSX_subacuatic) - -struct BurnDriver BurnDrvMSX_subacuatic = { - "msx_subacuatic", NULL, "msx_msx", NULL, "2012", - "Subacuatic\0", NULL, "RELEVO / The Mojon Twins", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_subacuaticRomInfo, MSX_subacuaticRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Heroes Arena - -static struct BurnRomInfo MSX_heroesarenaRomDesc[] = { - { "h-arena.rom", 0x08000, 0x3c6c9c72, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_heroesarena, MSX_heroesarena, msx_msx) -STD_ROM_FN(MSX_heroesarena) - -struct BurnDriver BurnDrvMSX_heroesarena = { - "msx_heroesarena", NULL, "msx_msx", NULL, "2010", - "Heroes Arena\0", NULL, "IMANOK", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_heroesarenaRomInfo, MSX_heroesarenaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Zombie Near - -static struct BurnRomInfo MSX_zombienearRomDesc[] = { - { "Zombie Near.rom", 0x20000, 0xedea8c56, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zombienear, MSX_zombienear, msx_msx) -STD_ROM_FN(MSX_zombienear) - -struct BurnDriver BurnDrvMSX_zombienear = { - "msx_zombienear11", NULL, "msx_msx", NULL, "2011", - "Zombie Near\0", NULL, "Oscar Toledo G.", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zombienearRomInfo, MSX_zombienearRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Menace - -static struct BurnRomInfo MSX_menaceRomDesc[] = { - { "menace.rom", 0x08000, 0x500d37ec, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_menace, MSX_menace, msx_msx) -STD_ROM_FN(MSX_menace) - -struct BurnDriver BurnDrvMSX_menace = { - "msx_menace", NULL, "msx_msx", NULL, "2009", - "Menace\0", NULL, "The New Image", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_menaceRomInfo, MSX_menaceRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Stray Cat - -static struct BurnRomInfo MSX_straycatRomDesc[] = { - { "straycat.rom", 0x08000, 0x22a99a44, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_straycat, MSX_straycat, msx_msx) -STD_ROM_FN(MSX_straycat) - -struct BurnDriver BurnDrvMSX_straycat = { - "msx_straycat", NULL, "msx_msx", NULL, "2009", - "Stray Cat\0", NULL, "IMANOK", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_straycatRomInfo, MSX_straycatRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// British Bob - -static struct BurnRomInfo MSX_britishbobRomDesc[] = { - { "rlv903_british_bob.rom", 0x04000, 0x8ab004f9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_britishbob, MSX_britishbob, msx_msx) -STD_ROM_FN(MSX_britishbob) - -struct BurnDriver BurnDrvMSX_britishbob = { - "msx_britishbob", NULL, "msx_msx", NULL, "2009", - "British Bob\0", NULL, "RELEVO", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_britishbobRomInfo, MSX_britishbobRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Cow Abductors - -static struct BurnRomInfo MSX_cowabductRomDesc[] = { - { "cow.rom", 0x04000, 0x790623de, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cowabduct, MSX_cowabduct, msx_msx) -STD_ROM_FN(MSX_cowabduct) - -struct BurnDriver BurnDrvMSX_cowabduct = { - "msx_cow", NULL, "msx_msx", NULL, "2009", - "Cow Abductors\0", NULL, "Paxanga Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cowabductRomInfo, MSX_cowabductRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Deep Dungeon - -static struct BurnRomInfo MSX_deepdunRomDesc[] = { - { "DDUNGEON.ROM", 0x08000, 0x012e13d3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_deepdun, MSX_deepdun, msx_msx) -STD_ROM_FN(MSX_deepdun) - -struct BurnDriver BurnDrvMSX_deepdun = { - "msx_deepdun", NULL, "msx_msx", NULL, "2008", - "Deep Dungeon\0", NULL, "Trilobyte", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_deepdunRomInfo, MSX_deepdunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Tomb of Genghis Khan - -static struct BurnRomInfo MSX_togkRomDesc[] = { - { "togk.rom", 0x08000, 0x903d4e51, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_togk, MSX_togk, msx_msx) -STD_ROM_FN(MSX_togk) - -struct BurnDriver BurnDrvMSX_togk = { - "msx_togk", NULL, "msx_msx", NULL, "2008", - "Tomb of Genghis Khan\0", NULL, "impulse9", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_togkRomInfo, MSX_togkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Caos Begins - -static struct BurnRomInfo MSX_caosRomDesc[] = { - { "caos.rom", 0x08000, 0x44421f97, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_caos, MSX_caos, msx_msx) -STD_ROM_FN(MSX_caos) - -struct BurnDriver BurnDrvMSX_caos = { - "msx_caos", NULL, "msx_msx", NULL, "2007", - "Caos Begins\0", NULL, "Hikaru Games", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_caosRomInfo, MSX_caosRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Txupinazo! - -static struct BurnRomInfo MSX_txupiRomDesc[] = { - { "txupi.rom", 0x08000, 0xe1b66d80, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_txupi, MSX_txupi, msx_msx) -STD_ROM_FN(MSX_txupi) - -struct BurnDriver BurnDrvMSX_txupi = { - "msx_txupi", NULL, "msx_msx", NULL, "2007", - "Txupinazo!\0", NULL, "IMANOK", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_txupiRomInfo, MSX_txupiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Penguin Mind - -static struct BurnRomInfo MSX_pengmindRomDesc[] = { - { "PENGMIND.ROM", 0x10000, 0xd2de6ec4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pengmind, MSX_pengmind, msx_msx) -STD_ROM_FN(MSX_pengmind) - -struct BurnDriver BurnDrvMSX_pengmind = { - "msx_pengmind", NULL, "msx_msx", NULL, "2007", - "Penguin Mind\0", NULL, "MSX Cafe", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pengmindRomInfo, MSX_pengmindRomName, NULL, NULL, MSXInputInfo, MSXJoyCursorDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Monster Hunter - -static struct BurnRomInfo MSX_monsterhunterRomDesc[] = { - { "NLKMSX001ES_MonsterHunter.rom", 0x20000, 0xb876a92f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_monsterhunter, MSX_monsterhunter, msx_msx) -STD_ROM_FN(MSX_monsterhunter) - -struct BurnDriver BurnDrvMSX_monsterhunter = { - "msx_monsterhunter", NULL, "msx_msx", NULL, "2006", - "Monster Hunter\0", NULL, "Nerlaska Studio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_monsterhunterRomInfo, MSX_monsterhunterRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Malaika Prehistoric Quest - -static struct BurnRomInfo MSX_malaikapq13RomDesc[] = { - { "rk711r3.rom", 0x08000, 0x3ddf42ac, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_malaikapq13, MSX_malaikapq13, msx_msx) -STD_ROM_FN(MSX_malaikapq13) - -struct BurnDriver BurnDrvMSX_malaikapq13 = { - "msx_malaikapq13", NULL, "msx_msx", NULL, "2006", - "Malaika Prehistoric Quest (v1.3)\0", NULL, "Karoshi Corporation", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_malaikapq13RomInfo, MSX_malaikapq13RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Penguin Cafe - -static struct BurnRomInfo MSX_penguincafeRomDesc[] = { - { "penguincafe.rom", 0x08000, 0xba41efb1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_penguincafe, MSX_penguincafe, msx_msx) -STD_ROM_FN(MSX_penguincafe) - -struct BurnDriver BurnDrvMSX_penguincafe = { - "msx_penguincafe", NULL, "msx_msx", NULL, "2006", - "Penguin Cafe\0", NULL, "MSX Cafe", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_penguincafeRomInfo, MSX_penguincafeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Grid Wars - -static struct BurnRomInfo MSX_gridwarsRomDesc[] = { - { "GRIDWARS.ROM", 0x08000, 0x03b56d90, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gridwars, MSX_gridwars, msx_msx) -STD_ROM_FN(MSX_gridwars) - -struct BurnDriver BurnDrvMSX_gridwars = { - "msx_gridwars", NULL, "msx_msx", NULL, "2006", - "Grid Wars\0", NULL, "Emma Six", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gridwarsRomInfo, MSX_gridwarsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Night City - -static struct BurnRomInfo MSX_nightcityRomDesc[] = { - { "EN-NIGHT.ROM", 0x10000, 0x7990a7f8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nightcity, MSX_nightcity, msx_msx) -STD_ROM_FN(MSX_nightcity) - -struct BurnDriver BurnDrvMSX_nightcity = { - "msx_nightcity", NULL, "msx_msx", NULL, "2006", - "Night City\0", NULL, "German Gomez Herrera", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_nightcityRomInfo, MSX_nightcityRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// The Cure - -static struct BurnRomInfo MSX_thecureRomDesc[] = { - { "thecure.rom", 0x0c000, 0x7f855276, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_thecure, MSX_thecure, msx_msx) -STD_ROM_FN(MSX_thecure) - -struct BurnDriver BurnDrvMSX_thecure = { - "msx_thecure", NULL, "msx_msx", NULL, "2005", - "The Cure\0", NULL, "XL2S Entertainment", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_thecureRomInfo, MSX_thecureRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Caverns of Titan - -static struct BurnRomInfo MSX_cavernsRomDesc[] = { - { "caverns.rom", 0x04000, 0x9e02db6c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_caverns, MSX_caverns, msx_msx) -STD_ROM_FN(MSX_caverns) - -struct BurnDriver BurnDrvMSX_caverns = { - "msx_caverns", NULL, "msx_msx", NULL, "2005", - "Caverns of Titan\0", NULL, "JLTURSAN", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cavernsRomInfo, MSX_cavernsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Parachuteless Joe - -static struct BurnRomInfo MSX_pjoeRomDesc[] = { - { "pjoe.rom", 0x08000, 0xbff072fe, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pjoe, MSX_pjoe, msx_msx) -STD_ROM_FN(MSX_pjoe) - -struct BurnDriver BurnDrvMSX_pjoe = { - "msx_pjoe", NULL, "msx_msx", NULL, "2005", - "Parachuteless Joe\0", NULL, "Paxanga Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pjoeRomInfo, MSX_pjoeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Crazy Buggy - -static struct BurnRomInfo MSX_crazyRomDesc[] = { - { "crazy.rom", 0x04000, 0xfea00d3b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_crazy, MSX_crazy, msx_msx) -STD_ROM_FN(MSX_crazy) - -struct BurnDriver BurnDrvMSX_crazy = { - "msx_crazy", NULL, "msx_msx", NULL, "2005", - "Crazy Buggy\0", NULL, "Crappysoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_crazyRomInfo, MSX_crazyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Sink King - -static struct BurnRomInfo MSX_sinkkingRomDesc[] = { - { "sinkking.rom", 0x02000, 0xdcd241fa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sinkking, MSX_sinkking, msx_msx) -STD_ROM_FN(MSX_sinkking) - -struct BurnDriver BurnDrvMSX_sinkking = { - "msx_sinkking", NULL, "msx_msx", NULL, "2005", - "Sink King\0", NULL, "Guzuta Raster Leisure", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sinkkingRomInfo, MSX_sinkkingRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Seleniak - -static struct BurnRomInfo MSX_seleniakRomDesc[] = { - { "seleniak.rom", 0x02000, 0x6e8bb5fa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_seleniak, MSX_seleniak, msx_msx) -STD_ROM_FN(MSX_seleniak) - -struct BurnDriver BurnDrvMSX_seleniak = { - "msx_seleniak", NULL, "msx_msx", NULL, "2005", - "Seleniak\0", NULL, "Guzuta Raster Leisure", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_seleniakRomInfo, MSX_seleniakRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// T-Virus - -static struct BurnRomInfo MSX_tvirusRomDesc[] = { - { "tvirus.rom", 0x02000, 0x72b26927, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tvirus, MSX_tvirus, msx_msx) -STD_ROM_FN(MSX_tvirus) - -struct BurnDriver BurnDrvMSX_tvirus = { - "msx_tvirus", NULL, "msx_msx", NULL, "2005", - "T-Virus\0", NULL, "Dioniso (Alfonso D.C.)", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tvirusRomInfo, MSX_tvirusRomName, NULL, NULL, MSXInputInfo, MSXJoyCursorDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Factory Infection - -static struct BurnRomInfo MSX_factoryRomDesc[] = { - { "factory.rom", 0x02000, 0x43f31061, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_factory, MSX_factory, msx_msx) -STD_ROM_FN(MSX_factory) - -struct BurnDriver BurnDrvMSX_factory = { - "msx_factory", NULL, "msx_msx", NULL, "2005", - "Factory Infection\0", NULL, "Karoshi Corporation", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_factoryRomInfo, MSX_factoryRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Ninja Savior - -static struct BurnRomInfo MSX_ninjasavRomDesc[] = { - { "RLV921_Ninja_Savior.rom", 0x04000, 0xc059ffba, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ninjasav, MSX_ninjasav, msx_msx) -STD_ROM_FN(MSX_ninjasav) - -struct BurnDriver BurnDrvMSX_ninjasav = { - "msx_ninjasav", NULL, "msx_msx", NULL, "2015", - "Ninja Savior\0", NULL, "RELEVO", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ninjasavRomInfo, MSX_ninjasavRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mr. Cracksman - -static struct BurnRomInfo MSX_mrcrackRomDesc[] = { - { "RLV917_MR_CRACKSMAN.rom", 0x02000, 0xe8ded848, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrcrack, MSX_mrcrack, msx_msx) -STD_ROM_FN(MSX_mrcrack) - -struct BurnDriver BurnDrvMSX_mrcrack = { - "msx_mrcrack", NULL, "msx_msx", NULL, "2013", - "Mr. Cracksman\0", NULL, "RELEVO", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mrcrackRomInfo, MSX_mrcrackRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// La Corona Encantada - -static struct BurnRomInfo MSX_lacoronaRomDesc[] = { - { "RLV901_La_Corona_Encantada.rom", 0x0c000, 0x71e4252e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lacorona, MSX_lacorona, msx_msx) -STD_ROM_FN(MSX_lacorona) - -struct BurnDriver BurnDrvMSX_lacorona = { - "msx_lacorona", NULL, "msx_msx", NULL, "2009", - "La Corona Encantada\0", NULL, "Karoshi", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lacoronaRomInfo, MSX_lacoronaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Abu Simbel Profanation - -static struct BurnRomInfo MSX_abusimbelRomDesc[] = { - { "abusimbel.rom", 0x20000, 0x603a0c0d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_abusimbel, MSX_abusimbel, msx_msx) -STD_ROM_FN(MSX_abusimbel) - -struct BurnDriver BurnDrvMSX_abusimbel = { - "msx_abusimbel", NULL, "msx_msx", NULL, "1986", - "Abu Simbel Profanation\0", NULL, "Dinamic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_abusimbelRomInfo, MSX_abusimbelRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// 180 Degrees - -static struct BurnRomInfo MSX_180RomDesc[] = { - { "180.rom", 0x20000, 0x1369ca55, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_180, MSX_180, msx_msx) -STD_ROM_FN(MSX_180) - -struct BurnDriver BurnDrvMSX_180 = { - "msx_180", NULL, "msx_msx", NULL, "1986", - "180 Degrees\0", NULL, "MAD", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_180RomInfo, MSX_180RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Auf Wiedersehen Monty v1.7 special rom - -static struct BurnRomInfo MSX_awmontyRomDesc[] = { - { "MONTY.ROM", 0x10000, 0x1306ccca, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_awmonty, MSX_awmonty, msx_msx) -STD_ROM_FN(MSX_awmonty) - -struct BurnDriver BurnDrvMSX_awmonty = { - "msx_awmonty", NULL, "msx_msx", NULL, "1987", - "Auf Wiedersehen Monty (v1.7 special s/l rom)\0", NULL, "Gremlin Graphics", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_awmontyRomInfo, MSX_awmontyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Batman v1.0 special rom - -static struct BurnRomInfo MSX_batman10RomDesc[] = { - { "BATMAN.ROM", 0x10000, 0x21e671f0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_batman10, MSX_batman10, msx_msx) -STD_ROM_FN(MSX_batman10) - -struct BurnDriver BurnDrvMSX_batman10 = { - "msx_batman10", "msx_batman", "msx_msx", NULL, "1987", - "Batman (v1.0 special s/l rom)\0", NULL, "Ocean", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_batman10RomInfo, MSX_batman10RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mutant Monty - -static struct BurnRomInfo MSX_mumontyRomDesc[] = { - { "mumonty.rom", 0x20000, 0x308b71ae, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mumonty, MSX_mumonty, msx_msx) -STD_ROM_FN(MSX_mumonty) - -struct BurnDriver BurnDrvMSX_mumonty = { - "msx_mumonty", NULL, "msx_msx", NULL, "1984", - "Mutant Monty\0", NULL, "artic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_mumontyRomInfo, MSX_mumontyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Dino Sourcers - -static struct BurnRomInfo MSX_dinosourRomDesc[] = { - { "Dino Sourcers.rom", 0x04000, 0x83d44b03, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dinosour, MSX_dinosour, msx_msx) -STD_ROM_FN(MSX_dinosour) - -struct BurnDriver BurnDrvMSX_dinosour = { - "msx_dinosour", NULL, "msx_msx", NULL, "1988", - "Dino Sourcers\0", NULL, "JALECO", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dinosourRomInfo, MSX_dinosourRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Temptations - -static struct BurnRomInfo MSX_temptationsRomDesc[] = { - { "temptati.rom", 0x20000, 0x2d46f211, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_temptations, MSX_temptations, msx_msx) -STD_ROM_FN(MSX_temptations) - -struct BurnDriver BurnDrvMSX_temptations = { - "msx_temptations", NULL, "msx_msx", NULL, "1988", - "Temptations\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_temptationsRomInfo, MSX_temptationsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Griel's Quest for the Sangraal - -static struct BurnRomInfo MSX_grielRomDesc[] = { - { "griel.rom", 0x08000, 0x6cebb29b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_griel, MSX_griel, msx_msx) -STD_ROM_FN(MSX_griel) - -struct BurnDriver BurnDrvMSX_griel = { - "msx_griel", NULL, "msx_msx", NULL, "2005", - "Griel's Quest for the Sangraal\0", NULL, "Karoshi Corporation", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_grielRomInfo, MSX_grielRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Griel's Quest for the Sangraal - -static struct BurnRomInfo MSX_grielexRomDesc[] = { - { "grielex.rom", 0x08000, 0xc9427fe2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_grielex, MSX_grielex, msx_msx) -STD_ROM_FN(MSX_grielex) - -struct BurnDriver BurnDrvMSX_grielex = { - "msx_grielex", "msx_griel", "msx_msx", NULL, "2005", - "Griel's Quest for the Sangraal (Extended Version)\0", NULL, "Karoshi Corporation", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_grielexRomInfo, MSX_grielexRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Saimazoom - -static struct BurnRomInfo MSX_smzoomRomDesc[] = { - { "rk708en.rom", 0x08000, 0xe76bc18e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_smzoom, MSX_smzoom, msx_msx) -STD_ROM_FN(MSX_smzoom) - -struct BurnDriver BurnDrvMSX_smzoom = { - "msx_smzoom", NULL, "msx_msx", NULL, "2005", - "Saimazoom\0", NULL, "Karoshi Corporation", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_smzoomRomInfo, MSX_smzoomRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Magical Stones - -static struct BurnRomInfo MSX_magicalRomDesc[] = { - { "ms16k.rom", 0x04000, 0x0ec3f7a3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_magical, MSX_magical, msx_msx) -STD_ROM_FN(MSX_magical) - -struct BurnDriver BurnDrvMSX_magical = { - "msx_magical", NULL, "msx_msx", NULL, "2005", - "Magical Stones\0", NULL, "Dioniso (Alfonso D.C.)", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_magicalRomInfo, MSX_magicalRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Wing Warriors - -static struct BurnRomInfo MSX_wingwarrRomDesc[] = { - { "WingWarriors.rom", 0x0c000, 0x207d0e62, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wingwarr, MSX_wingwarr, msx_msx) -STD_ROM_FN(MSX_wingwarr) - -struct BurnDriver BurnDrvMSX_wingwarr = { - "msx_wingwarr", NULL, "msx_msx", NULL, "2015", - "Wing Warriors\0", NULL, "Kitmaker", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_wingwarrRomInfo, MSX_wingwarrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// BitLogic - -static struct BurnRomInfo MSX_bitlogicRomDesc[] = { - { "BITLOGIC_v_100.ROM", 0x0c000, 0xfbcd1942, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bitlogic, MSX_bitlogic, msx_msx) -STD_ROM_FN(MSX_bitlogic) - -struct BurnDriver BurnDrvMSX_bitlogic = { - "msx_bitlogic", NULL, "msx_msx", NULL, "2015", - "BitLogic\0", NULL, "OxiAB Studio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bitlogicRomInfo, MSX_bitlogicRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Uridium - -static struct BurnRomInfo MSX_uridiumRomDesc[] = { - { "URDIUM48.rom", 0x0c000, 0xc62d92da, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_uridium, MSX_uridium, msx_msx) -STD_ROM_FN(MSX_uridium) - -struct BurnDriver BurnDrvMSX_uridium = { - "msx_uridium", NULL, "msx_msx", NULL, "2014", - "Uridium\0", NULL, "Trilobyte", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_uridiumRomInfo, MSX_uridiumRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Pretty Kingdom - -static struct BurnRomInfo MSX_prettykngdmRomDesc[] = { - { "NLKMSX006EN_PRETTYKINGDOM.rom", 0x08000, 0xcb2d148c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_prettykngdm, MSX_prettykngdm, msx_msx) -STD_ROM_FN(MSX_prettykngdm) - -struct BurnDriver BurnDrvMSX_prettykngdm = { - "msx_prettykngdm", NULL, "msx_msx", NULL, "2014", - "Pretty Kingdom\0", NULL, "Nerlaska Studio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_prettykngdmRomInfo, MSX_prettykngdmRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Gorgeous Gemma in Escape from the Space Disposal Planet - -static struct BurnRomInfo MSX_ggeftsdpRomDesc[] = { - { "ggeftsdp.rom", 0x08000, 0x818ccade, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ggeftsdp, MSX_ggeftsdp, msx_msx) -STD_ROM_FN(MSX_ggeftsdp) - -struct BurnDriver BurnDrvMSX_ggeftsdp = { - "msx_ggeftsdp", NULL, "msx_msx", NULL, "2013", - "Gorgeous Gemma in Escape from the Space Disposal Planet\0", NULL, "Impulse9", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ggeftsdpRomInfo, MSX_ggeftsdpRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Zambeze - -static struct BurnRomInfo MSX_zambezeRomDesc[] = { - { "zambezefacil.rom", 0x08000, 0x91d07554, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zambeze, MSX_zambeze, msx_msx) -STD_ROM_FN(MSX_zambeze) - -struct BurnDriver BurnDrvMSX_zambeze = { - "msx_zambeze", NULL, "msx_msx", NULL, "2006", - "Zambeze\0", NULL, "Degora", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zambezeRomInfo, MSX_zambezeRomName, NULL, NULL, MSXInputInfo, MSXJoyCursorDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Nayade Resistance - -static struct BurnRomInfo MSX_nayadeRomDesc[] = { - { "nayade.rom", 0x08000, 0x3587844a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nayade, MSX_nayade, msx_msx) -STD_ROM_FN(MSX_nayade) - -struct BurnDriver BurnDrvMSX_nayade = { - "msx_nayade", NULL, "msx_msx", NULL, "2013", - "Nayade Resistance\0", "Control w/ Arrow-keys, M to select weapon", "Pentacour", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_nayadeRomInfo, MSX_nayadeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Princess Quest - -static struct BurnRomInfo MSX_princessquestRomDesc[] = { - { "princess_quest_msx.rom", 0x10000, 0xaa31ac36, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_princessquest, MSX_princessquest, msx_msx) -STD_ROM_FN(MSX_princessquest) - -struct BurnDriver BurnDrvMSX_princessquest = { - "msx_princessquest", NULL, "msx_msx", NULL, "2012", - "Princess Quest\0", NULL, "Oscar Toledo G.", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_princessquestRomInfo, MSX_princessquestRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Baby Dinosaur Dooly - -static struct BurnRomInfo MSX_doolyRomDesc[] = { - { "dooly.rom", 0x08000, 0x71a1b1ec, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dooly, MSX_dooly, msx_msx) -STD_ROM_FN(MSX_dooly) - -struct BurnDriver BurnDrvMSX_dooly = { - "msx_dooly", NULL, "msx_msx", NULL, "1991", - "Baby Dinosaur Dooly\0", NULL, "Daou", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_DOOLY, GBF_MISC, 0, - MSXGetZipName, MSX_doolyRomInfo, MSX_doolyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Xenon (Spa) - -static struct BurnRomInfo MSX_xenonRomDesc[] = { - { "xenon (1988)(dro soft)(es)[run'cas-'].cas", 0x12332, 0x4ad26b8f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_xenon, MSX_xenon, msx_msx) -STD_ROM_FN(MSX_xenon) - -struct BurnDriver BurnDrvMSX_xenon = { - "msx_xenon", NULL, "msx_msx", NULL, "1988", - "Xenon (Spa)\0", NULL, "Dro Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_xenonRomInfo, MSX_xenonRomName, NULL, NULL, MSXInputInfo, MSXEuropeJoyport2DIPInfo, - CasRunSwapButton2DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Genesis: dawn of a new day - -static struct BurnRomInfo MSX_genesisRomDesc[] = { - { "genesis.rom", 0x20000, 0x391e6f9a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_genesis, MSX_genesis, msx_msx) -STD_ROM_FN(MSX_genesis) - -struct BurnDriver BurnDrvMSX_genesis = { - "msx_genesis", NULL, "msx_msx", NULL, "2012", - "Genesis: dawn of a new day\0", NULL, "Retroworks", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_genesisRomInfo, MSX_genesisRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jinj 2 - Belmonte's Revenge - -static struct BurnRomInfo MSX_jinj2RomDesc[] = { - { "jinj2-v2.rom", 0x08000, 0xd43cf107, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jinj2, MSX_jinj2, msx_msx) -STD_ROM_FN(MSX_jinj2) - -struct BurnDriver BurnDrvMSX_jinj2 = { - "msx_jinj2", NULL, "msx_msx", NULL, "2010", - "Jinj 2 - Belmonte's Revenge\0", NULL, "Retroworks", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jinj2RomInfo, MSX_jinj2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Trailblazer (Euro) - -static struct BurnRomInfo MSX_trailblzRomDesc[] = { - { "trailblazer (1986)(gremlin graphics software)(gb)[run'cas-'].cas", 0x095ff, 0x4ace4920, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_trailblz, MSX_trailblz, msx_msx) -STD_ROM_FN(MSX_trailblz) - -struct BurnDriver BurnDrvMSX_trailblz = { - "msx_trailblz", NULL, "msx_msx", NULL, "1986", - "Trailblazer (Euro)\0", NULL, "Gremlin Graphics", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_trailblzRomInfo, MSX_trailblzRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Gauntlet (Euro) - -static struct BurnRomInfo MSX_gauntletRomDesc[] = { - { "gauntlet (1986)(u.s. gold)(gb)(side a)[run'cas-'].cas", 0x0e2f5, 0x7e4c19ec, BRF_PRG | BRF_ESS }, - { "gauntlet (1986)(u.s. gold)(gb)(side b)[run'cas-'].cas", 0x173b5, 0xce0a53a4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gauntlet, MSX_gauntlet, msx_msx) -STD_ROM_FN(MSX_gauntlet) - -struct BurnDriver BurnDrvMSX_gauntlet = { - "msx_gauntlet", NULL, "msx_msx", NULL, "1986", - "Gauntlet (Euro)\0", NULL, "U.S. Gold", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gauntletRomInfo, MSX_gauntletRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Navy Moves (Euro) - -static struct BurnRomInfo MSX_navymoveRomDesc[] = { - { "Navy Moves (1988)(Dinamic Software)(ES)(Side A)[RUN'CAS-'].cas", 0x0c68f, 0xd420952c, BRF_PRG | BRF_ESS }, - { "Navy Moves (1988)(Dinamic Software)(ES)(Side B)[RUN'CAS-'].cas", 0x0b4f5, 0x045a7642, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_navymove, MSX_navymove, msx_msx) -STD_ROM_FN(MSX_navymove) - -struct BurnDriver BurnDrvMSX_navymove = { - "msx_navymove", NULL, "msx_msx", NULL, "1988", - "Navy Moves (Euro)\0", "Select Keyboard mode, and use Joystick!", "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_navymoveRomInfo, MSX_navymoveRomName, NULL, NULL, MSXInputInfo, MSXJoyCursorDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Army Moves (Euro) - -static struct BurnRomInfo MSX_armymoveRomDesc[] = { - { "army moves (1987)(dinamic software)(gb)(side a)[run'cas-'].cas", 0x0c222, 0xd33316dd, BRF_PRG | BRF_ESS }, - { "army moves (1987)(dinamic software)(gb)(side b)[run'cas-'].cas", 0x0c222, 0x8e5fd272, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_armymove, MSX_armymove, msx_msx) -STD_ROM_FN(MSX_armymove) - -struct BurnDriver BurnDrvMSX_armymove = { - "msx_armymove", NULL, "msx_msx", NULL, "1987", - "Army Moves (Euro)\0", "Select Keyboard mode, and use Joystick!", "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_armymoveRomInfo, MSX_armymoveRomName, NULL, NULL, MSXInputInfo, MSXJoyCursorDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Toobin' - -static struct BurnRomInfo MSX_toobinRomDesc[] = { - { "Toobin' (1989)(Domark)(GB).rom", 0x10000, 0x704ec575, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_toobin, MSX_toobin, msx_msx) -STD_ROM_FN(MSX_toobin) - -struct BurnDriver BurnDrvMSX_toobin = { - "msx_toobin", NULL, "msx_msx", NULL, "1989", - "Toobin'\0", NULL, "Domark", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_toobinRomInfo, MSX_toobinRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Tension - -static struct BurnRomInfo MSX_tensionRomDesc[] = { - { "Tension (1988)(System 4)(ES).rom", 0x08000, 0x3d78462c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tension, MSX_tension, msx_msx) -STD_ROM_FN(MSX_tension) - -struct BurnDriver BurnDrvMSX_tension = { - "msx_tension", NULL, "msx_msx", NULL, "1988", - "Tension\0", NULL, "System 4", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tensionRomInfo, MSX_tensionRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Payload - -static struct BurnRomInfo MSX_payloadRomDesc[] = { - { "Payload (1985)(Sony)(JP).rom", 0x08000, 0x165eae6d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_payload, MSX_payload, msx_msx) -STD_ROM_FN(MSX_payload) - -struct BurnDriver BurnDrvMSX_payload = { - "msx_payload", NULL, "msx_msx", NULL, "1985", - "Payload\0", NULL, "Sony", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_payloadRomInfo, MSX_payloadRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Namake's Bridgedrome - -static struct BurnRomInfo MSX_namakeRomDesc[] = { - { "Namake's Bridgedrome (2005)(Buresto Faiya).rom", 0x04000, 0x92aee975, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_namake, MSX_namake, msx_msx) -STD_ROM_FN(MSX_namake) - -struct BurnDriver BurnDrvMSX_namake = { - "msx_namake", NULL, "msx_msx", NULL, "2005", - "Namake's Bridgedrome\0", "Uses joyport #2", "Buresto Faiya", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_namakeRomInfo, MSX_namakeRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mayhem - -static struct BurnRomInfo MSX_mayhemRomDesc[] = { - { "Mayhem (1985)(Mr. Micro)(GB)[cr Magicracks].rom", 0x04000, 0xb0b90a4d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mayhem, MSX_mayhem, msx_msx) -STD_ROM_FN(MSX_mayhem) - -struct BurnDriver BurnDrvMSX_mayhem = { - "msx_mayhem", NULL, "msx_msx", NULL, "1985", - "Mayhem\0", "Uses joyport #2", "Mr. Micro", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mayhemRomInfo, MSX_mayhemRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Kobashi - -static struct BurnRomInfo MSX_kobashiRomDesc[] = { - { "Kobashi (2004)(Desire in Envy)(NL).rom", 0x02000, 0xd137c518, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kobashi, MSX_kobashi, msx_msx) -STD_ROM_FN(MSX_kobashi) - -struct BurnDriver BurnDrvMSX_kobashi = { - "msx_kobashi", NULL, "msx_msx", NULL, "2004", - "Kobashi\0", "Uses joyport #2", "Desire in Envy", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kobashiRomInfo, MSX_kobashiRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jumping Rabbit - -static struct BurnRomInfo MSX_jrabbitRomDesc[] = { - { "Jumping Rabbit (1984)(MIA)(JP).rom", 0x02000, 0x15471ab9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jrabbit, MSX_jrabbit, msx_msx) -STD_ROM_FN(MSX_jrabbit) - -struct BurnDriver BurnDrvMSX_jrabbit = { - "msx_jrabbit", NULL, "msx_msx", NULL, "1984", - "Jumping Rabbit\0", NULL, "MIA", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jrabbitRomInfo, MSX_jrabbitRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jump Land - -static struct BurnRomInfo MSX_jumplandRomDesc[] = { - { "Jump Land (1985)(Nippon Columbia - Colpax - Universal).rom", 0x04000, 0x0f8699ba, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jumpland, MSX_jumpland, msx_msx) -STD_ROM_FN(MSX_jumpland) - -struct BurnDriver BurnDrvMSX_jumpland = { - "msx_jumpland", NULL, "msx_msx", NULL, "1985", - "Jump Land\0", NULL, "Nippon Columbia - Colpax - Universal", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jumplandRomInfo, MSX_jumplandRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Happy Fret - -static struct BurnRomInfo MSX_happyfretRomDesc[] = { - { "Happy Fret (1985)(Micro Cabin)(JP).rom", 0x08000, 0xbe2f3236, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_happyfret, MSX_happyfret, msx_msx) -STD_ROM_FN(MSX_happyfret) - -struct BurnDriver BurnDrvMSX_happyfret = { - "msx_happyfret", NULL, "msx_msx", NULL, "1985", - "Happy Fret\0", "Uses joyport #2", "Micro Cabin", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_happyfretRomInfo, MSX_happyfretRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Gyro Adventure - -static struct BurnRomInfo MSX_gyroadvRomDesc[] = { - { "Gyro Adventure (1984)(Nippon Columbia - Colpax - Universal)(JP)[Martos].rom", 0x04000, 0x05939074, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gyroadv, MSX_gyroadv, msx_msx) -STD_ROM_FN(MSX_gyroadv) - -struct BurnDriver BurnDrvMSX_gyroadv = { - "msx_gyroadv", NULL, "msx_msx", NULL, "1984", - "Gyro Adventure\0", NULL, "Nippon Columbia - Colpax - Universal", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gyroadvRomInfo, MSX_gyroadvRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Eat Blue! - -static struct BurnRomInfo MSX_eatblueRomDesc[] = { - { "Eat Blue! 2004 v2 (2004)(Paxanga Soft).rom", 0x02000, 0x1ac005a0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_eatblue, MSX_eatblue, msx_msx) -STD_ROM_FN(MSX_eatblue) - -struct BurnDriver BurnDrvMSX_eatblue = { - "msx_eatblue", NULL, "msx_msx", NULL, "2004", - "Eat Blue!\0", NULL, "Paxanga Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_BASIC, GBF_MISC, 0, - MSXGetZipName, MSX_eatblueRomInfo, MSX_eatblueRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Driller Tanks - -static struct BurnRomInfo MSX_drillertnkRomDesc[] = { - { "Driller Tanks (1984)(Hudson Soft)(JP).rom", 0x04000, 0xd78da5fc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_drillertnk, MSX_drillertnk, msx_msx) -STD_ROM_FN(MSX_drillertnk) - -struct BurnDriver BurnDrvMSX_drillertnk = { - "msx_drillertnk", NULL, "msx_msx", NULL, "1984", - "Driller Tanks\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_drillertnkRomInfo, MSX_drillertnkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Dip Dip - -static struct BurnRomInfo MSX_dipdipRomDesc[] = { - { "Dip Dip (1985)(Indescomp)(ES).rom", 0x04000, 0x9a2cc849, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dipdip, MSX_dipdip, msx_msx) -STD_ROM_FN(MSX_dipdip) - -struct BurnDriver BurnDrvMSX_dipdip = { - "msx_dipdip", NULL, "msx_msx", NULL, "1985", - "Dip Dip\0", NULL, "Indescomp", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dipdipRomInfo, MSX_dipdipRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Cannon Fighter - -static struct BurnRomInfo MSX_cannonfgtRomDesc[] = { - { "Cannon Fighter (1984)(Policy)(JP).rom", 0x04000, 0x9c7fb01e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cannonfgt, MSX_cannonfgt, msx_msx) -STD_ROM_FN(MSX_cannonfgt) - -struct BurnDriver BurnDrvMSX_cannonfgt = { - "msx_cannonfgt", NULL, "msx_msx", NULL, "1984", - "Cannon Fighter\0", NULL, "Policy", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cannonfgtRomInfo, MSX_cannonfgtRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Death Wish 3 - -static struct BurnRomInfo MSX_deathwish3RomDesc[] = { - { "deathwish3.rom", 0x20000, 0x90ae7ee8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_deathwish3, MSX_deathwish3, msx_msx) -STD_ROM_FN(MSX_deathwish3) - -struct BurnDriver BurnDrvMSX_deathwish3 = { - "msx_deathwish3", NULL, "msx_msx", NULL, "1987", - "Death Wish 3\0", NULL, "Gremlin", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_deathwish3RomInfo, MSX_deathwish3RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Martianoids - -static struct BurnRomInfo MSX_martianoidsRomDesc[] = { - { "martianoids.rom", 0x20000, 0xd796235c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_martianoids, MSX_martianoids, msx_msx) -STD_ROM_FN(MSX_martianoids) - -struct BurnDriver BurnDrvMSX_martianoids = { - "msx_martianoids", NULL, "msx_msx", NULL, "1987", - "Martianoids\0", NULL, "Ultimate Play The Game", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_martianoidsRomInfo, MSX_martianoidsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Gonzzalezz - -static struct BurnRomInfo MSX_gonzzalezzRomDesc[] = { - { "gonzzalezz.rom", 0x40000, 0x8765d1fd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gonzzalezz, MSX_gonzzalezz, msx_msx) -STD_ROM_FN(MSX_gonzzalezz) - -struct BurnDriver BurnDrvMSX_gonzzalezz = { - "msx_gonzzalezz", NULL, "msx_msx", NULL, "1989", - "Gonzzalezz \0", NULL, "Opera Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gonzzalezzRomInfo, MSX_gonzzalezzRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Feud - -static struct BurnRomInfo MSX_feudRomDesc[] = { - { "feud.rom", 0x20000, 0xda665159, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_feud, MSX_feud, msx_msx) -STD_ROM_FN(MSX_feud) - -struct BurnDriver BurnDrvMSX_feud = { - "msx_feud", NULL, "msx_msx", NULL, "1987", - "Feud\0", NULL, "Bulldog", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_feudRomInfo, MSX_feudRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Head over Heels - -static struct BurnRomInfo MSX_headheelsRomDesc[] = { - { "Head over Heels (1987)(Ocean Software)(GB).rom", 0x20000, 0x48b88fbc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_headheels, MSX_headheels, msx_msx) -STD_ROM_FN(MSX_headheels) - -struct BurnDriver BurnDrvMSX_headheels = { - "msx_headheels", NULL, "msx_msx", NULL, "1987", - "Head over Heels\0", NULL, "Ocean Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_headheelsRomInfo, MSX_headheelsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Perspective v1.1 T.Yoshida - -static struct BurnRomInfo MSX_perspectiveRomDesc[] = { - { "perspective.rom", 0x40000, 0x2c4eead6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_perspective, MSX_perspective, msx_msx) -STD_ROM_FN(MSX_perspective) - -struct BurnDriver BurnDrvMSX_perspective = { - "msx_perspective", NULL, "msx_msx", NULL, "1987", - "Perspective (v1.1)\0", NULL, "T.Yoshida", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_perspectiveRomInfo, MSX_perspectiveRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Fruit Panic - -static struct BurnRomInfo MSX_fruitpanicRomDesc[] = { - { "Fruit Panic (1984)(Pony Canyon)(JP).rom", 0x10000, 0x7429eb0e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_fruitpanic, MSX_fruitpanic, msx_msx) -STD_ROM_FN(MSX_fruitpanic) - -struct BurnDriver BurnDrvMSX_fruitpanic = { - "msx_fruitpanic", NULL, "msx_msx", NULL, "1984", - "Fruit Panic\0", NULL, "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_fruitpanicRomInfo, MSX_fruitpanicRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Ale Hop! - -static struct BurnRomInfo MSX_alehopRomDesc[] = { - { "Ale Hop! (1988)(Topo Soft)(ES).rom", 0x20000, 0xc2694922, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alehop, MSX_alehop, msx_msx) -STD_ROM_FN(MSX_alehop) - -struct BurnDriver BurnDrvMSX_alehop = { - "msx_alehop", NULL, "msx_msx", NULL, "1988", - "Ale Hop!\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alehopRomInfo, MSX_alehopRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Blackbeard - -static struct BurnRomInfo MSX_blackbeardRomDesc[] = { - { "Blackbeard (1988)(Topo Soft)(ES).rom", 0x20000, 0x6e566a11, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_blackbeard, MSX_blackbeard, msx_msx) -STD_ROM_FN(MSX_blackbeard) - -struct BurnDriver BurnDrvMSX_blackbeard = { - "msx_blackbeard", NULL, "msx_msx", NULL, "1988", - "Blackbeard\0", "Uses joyport #2", "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_blackbeardRomInfo, MSX_blackbeardRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Capitan Trueno - -static struct BurnRomInfo MSX_ctruenoRomDesc[] = { - { "Capitan Trueno (1989)(Dinamic Software)(ES).rom", 0x20000, 0xb1b434be, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ctrueno, MSX_ctrueno, msx_msx) -STD_ROM_FN(MSX_ctrueno) - -struct BurnDriver BurnDrvMSX_ctrueno = { - "msx_ctrueno", NULL, "msx_msx", NULL, "1989", - "Capitan Trueno\0", "Uses joyport #2", "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ctruenoRomInfo, MSX_ctruenoRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Colt 36 - -static struct BurnRomInfo MSX_colt36RomDesc[] = { - { "Colt 36 (1987)(Topo Soft)(ES).rom", 0x10000, 0x7ce25b7c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_colt36, MSX_colt36, msx_msx) -STD_ROM_FN(MSX_colt36) - -struct BurnDriver BurnDrvMSX_colt36 = { - "msx_colt36", NULL, "msx_msx", NULL, "1987", - "Colt 36\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_colt36RomInfo, MSX_colt36RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Corsarios - -static struct BurnRomInfo MSX_corsariosRomDesc[] = { - { "Corsarios (1989)(Opera Soft)(ES).rom", 0x20000, 0x64005d08, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_corsarios, MSX_corsarios, msx_msx) -STD_ROM_FN(MSX_corsarios) - -struct BurnDriver BurnDrvMSX_corsarios = { - "msx_corsarios", NULL, "msx_msx", NULL, "1989", - "Corsarios\0", "Uses joyport #2", "Opera Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_corsariosRomInfo, MSX_corsariosRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Game Over - -static struct BurnRomInfo MSX_gameoverRomDesc[] = { - { "Game Over (1988)(Dinamic Software)(ES).rom", 0x20000, 0xdfbbdf10, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gameover, MSX_gameover, msx_msx) -STD_ROM_FN(MSX_gameover) - -struct BurnDriver BurnDrvMSX_gameover = { - "msx_gameover", NULL, "msx_msx", NULL, "1988", - "Game Over\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gameoverRomInfo, MSX_gameoverRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Poder Oscuro, El - -static struct BurnRomInfo MSX_poderoRomDesc[] = { - { "Poder Oscuro, El (1988)(Zigurat Software)(ES).rom", 0x20000, 0xdc6eef71, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_podero, MSX_podero, msx_msx) -STD_ROM_FN(MSX_podero) - -struct BurnDriver BurnDrvMSX_podero = { - "msx_podero", NULL, "msx_msx", NULL, "1988", - "Poder Oscuro, El\0", NULL, "Zigurat Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_poderoRomInfo, MSX_poderoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Sorcery - -static struct BurnRomInfo MSX_sorceryRomDesc[] = { - { "Sorcery (1985)(Virgin Games)(GB).rom", 0x20000, 0x4300eaa9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sorcery, MSX_sorcery, msx_msx) -STD_ROM_FN(MSX_sorcery) - -struct BurnDriver BurnDrvMSX_sorcery = { - "msx_sorcery", NULL, "msx_msx", NULL, "1985", - "Sorcery\0", NULL, "Virgin Games", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sorceryRomInfo, MSX_sorceryRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Who Dares Wins II - -static struct BurnRomInfo MSX_whodaresRomDesc[] = { - { "Who Dares Wins II (1986)(Alligata Software)(GB).rom", 0x20000, 0x1d10443f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_whodares, MSX_whodares, msx_msx) -STD_ROM_FN(MSX_whodares) - -struct BurnDriver BurnDrvMSX_whodares = { - "msx_whodares", NULL, "msx_msx", NULL, "1986", - "Who Dares Wins II\0", NULL, "Alligata Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_whodaresRomInfo, MSX_whodaresRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Manic Miner - -static struct BurnRomInfo MSX_manicminerRomDesc[] = { - { "Manic Miner (1984)(Software Projects)(GB).rom", 0x10000, 0x4b5cf16a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_manicminer, MSX_manicminer, msx_msx) -STD_ROM_FN(MSX_manicminer) - -struct BurnDriver BurnDrvMSX_manicminer = { - "msx_manicminer", NULL, "msx_msx", NULL, "1984", - "Manic Miner\0", NULL, "Software Projects", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_manicminerRomInfo, MSX_manicminerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Last Mission - -static struct BurnRomInfo MSX_lastmissionRomDesc[] = { - { "Last Mission, The (1987)(Opera Soft)(ES).rom", 0x20000, 0x494b9bc0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lastmission, MSX_lastmission, msx_msx) -STD_ROM_FN(MSX_lastmission) - -struct BurnDriver BurnDrvMSX_lastmission = { - "msx_lastmission", NULL, "msx_msx", NULL, "1987", - "Last Mission\0", NULL, "Opera Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lastmissionRomInfo, MSX_lastmissionRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Ballblazer - -static struct BurnRomInfo MSX_ballblzrRomDesc[] = { - { "Ballblazer (1988)(Pony Canyon)(JP).rom", 0x20000, 0xbd307546, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ballblzr, MSX_ballblzr, msx_msx) -STD_ROM_FN(MSX_ballblzr) - -struct BurnDriver BurnDrvMSX_ballblzr = { - "msx_ballblzr", NULL, "msx_msx", NULL, "1988", - "Ballblazer\0", "Keyboard control only.", "Pony Canyon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ballblzrRomInfo, MSX_ballblzrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Blow Up - -static struct BurnRomInfo MSX_blowupRomDesc[] = { - { "Blow Up (1988)(Eurosoft)(NL).rom", 0x20000, 0x72ec1918, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_blowup, MSX_blowup, msx_msx) -STD_ROM_FN(MSX_blowup) - -struct BurnDriver BurnDrvMSX_blowup = { - "msx_blowup", NULL, "msx_msx", NULL, "1988", - "Blow Up\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_blowupRomInfo, MSX_blowupRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Buck Rogers - Planet of Zoom - -static struct BurnRomInfo MSX_buckrogRomDesc[] = { - { "Buck Rogers - Planet of Zoom (1983)(Sega)(JP).rom", 0x10000, 0xdaf045ca, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_buckrog, MSX_buckrog, msx_msx) -STD_ROM_FN(MSX_buckrog) - -struct BurnDriver BurnDrvMSX_buckrog = { - "msx_buckrog", NULL, "msx_msx", NULL, "1983", - "Buck Rogers - Planet of Zoom\0", NULL, "Sega", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_buckrogRomInfo, MSX_buckrogRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Camelot Warriors - -static struct BurnRomInfo MSX_camelotwRomDesc[] = { - { "Camelot Warriors (1986)(Dinamic Software)(ES).rom", 0x20000, 0x89a53f23, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_camelotw, MSX_camelotw, msx_msx) -STD_ROM_FN(MSX_camelotw) - -struct BurnDriver BurnDrvMSX_camelotw = { - "msx_camelotw", NULL, "msx_msx", NULL, "1986", - "Camelot Warriors\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_camelotwRomInfo, MSX_camelotwRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Congo Bongo - -static struct BurnRomInfo MSX_congobongoRomDesc[] = { - { "Congo Bongo (1983)(Sega)(JP).rom", 0x10000, 0xcb054111, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_congobongo, MSX_congobongo, msx_msx) -STD_ROM_FN(MSX_congobongo) - -struct BurnDriver BurnDrvMSX_congobongo = { - "msx_congobongo", NULL, "msx_msx", NULL, "1983", - "Congo Bongo\0", NULL, "Sega", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_congobongoRomInfo, MSX_congobongoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Demon Crystal, The - -static struct BurnRomInfo MSX_demoncrystlRomDesc[] = { - { "Demon Crystal, The (1986)(Radio Wave Newspaper Publisher)(JP).rom", 0x10000, 0x3ebf588d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_demoncrystl, MSX_demoncrystl, msx_msx) -STD_ROM_FN(MSX_demoncrystl) - -struct BurnDriver BurnDrvMSX_demoncrystl = { - "msx_demoncrystl", NULL, "msx_msx", NULL, "1986", - "Demon Crystal, The\0", NULL, "Radio Wave Newspaper Publisher", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_demoncrystlRomInfo, MSX_demoncrystlRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Demonia - -static struct BurnRomInfo MSX_demoniaRomDesc[] = { - { "Demonia (1986)(Microids)(GB)(fr).rom", 0x20000, 0x8f1d68a0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_demonia, MSX_demonia, msx_msx) -STD_ROM_FN(MSX_demonia) - -struct BurnDriver BurnDrvMSX_demonia = { - "msx_demonia", NULL, "msx_msx", NULL, "1986", - "Demonia\0", NULL, "Microids", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_demoniaRomInfo, MSX_demoniaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jack the Nipper - -static struct BurnRomInfo MSX_nipperRomDesc[] = { - { "Jack the Nipper (1986)(Gremlin Graphics Software)(GB).rom", 0x20000, 0x666725ec, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nipper, MSX_nipper, msx_msx) -STD_ROM_FN(MSX_nipper) - -struct BurnDriver BurnDrvMSX_nipper = { - "msx_nipper", NULL, "msx_msx", NULL, "1986", - "Jack the Nipper\0", NULL, "Gremlin Graphics Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_nipperRomInfo, MSX_nipperRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jack the Nipper II - In Coconut Capers - -static struct BurnRomInfo MSX_nipper2RomDesc[] = { - { "Jack the Nipper II - In Coconut Capers (1987)(Gremlin Graphics Software)(GB).rom", 0x20000, 0x6b0fd271, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nipper2, MSX_nipper2, msx_msx) -STD_ROM_FN(MSX_nipper2) - -struct BurnDriver BurnDrvMSX_nipper2 = { - "msx_nipper2", NULL, "msx_msx", NULL, "1987", - "Jack the Nipper II - In Coconut Capers\0", NULL, "Gremlin Graphics Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_nipper2RomInfo, MSX_nipper2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Life in the Fast Lane - -static struct BurnRomInfo MSX_lifefastlnRomDesc[] = { - { "Life in the Fast Lane (1987)(Methodic Solutions)(NL).rom", 0x20000, 0x37a8713d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lifefastln, MSX_lifefastln, msx_msx) -STD_ROM_FN(MSX_lifefastln) - -struct BurnDriver BurnDrvMSX_lifefastln = { - "msx_lifefastln", NULL, "msx_msx", NULL, "1987", - "Life in the Fast Lane\0", NULL, "Methodic Solutions", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lifefastlnRomInfo, MSX_lifefastlnRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Livingstone Supongo - -static struct BurnRomInfo MSX_livingstoneRomDesc[] = { - { "Livingstone Supongo (1986)(Opera Soft)(ES).rom", 0x20000, 0xcea7e9bc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_livingstone, MSX_livingstone, msx_msx) -STD_ROM_FN(MSX_livingstone) - -struct BurnDriver BurnDrvMSX_livingstone = { - "msx_livingstone", NULL, "msx_msx", NULL, "1986", - "Livingstone Supongo\0", NULL, "Opera Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_livingstoneRomInfo, MSX_livingstoneRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Livingstone Supongo II - -static struct BurnRomInfo MSX_livingstone2RomDesc[] = { - { "Livingstone Supongo II (1989)(Opera Soft)(ES).rom", 0x20000, 0x5410c622, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_livingstone2, MSX_livingstone2, msx_msx) -STD_ROM_FN(MSX_livingstone2) - -struct BurnDriver BurnDrvMSX_livingstone2 = { - "msx_livingstone2", NULL, "msx_msx", NULL, "1989", - "Livingstone Supongo II\0", NULL, "Opera Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_livingstone2RomInfo, MSX_livingstone2RomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Spooks & Ladders - -static struct BurnRomInfo MSX_spookslRomDesc[] = { - { "Spooks & Ladders (1985)(Kuma Computers)(GB).rom", 0x10000, 0x71df64a8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spooksl, MSX_spooksl, msx_msx) -STD_ROM_FN(MSX_spooksl) - -struct BurnDriver BurnDrvMSX_spooksl = { - "msx_spooksl", NULL, "msx_msx", NULL, "1985", - "Spooks & Ladders\0", NULL, "Kuma Computers", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spookslRomInfo, MSX_spookslRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Star Avenger - -static struct BurnRomInfo MSX_staravngRomDesc[] = { - { "Star Avenger (1984)(Kuma Computers)(GB).rom", 0x10000, 0xd7c545cc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_staravng, MSX_staravng, msx_msx) -STD_ROM_FN(MSX_staravng) - -struct BurnDriver BurnDrvMSX_staravng = { - "msx_staravng", NULL, "msx_msx", NULL, "1984", - "Star Avenger\0", NULL, "Kuma Computers", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_staravngRomInfo, MSX_staravngRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Lazy Jones - -static struct BurnRomInfo MSX_lazyjonesRomDesc[] = { - { "Lazy Jones (1985)(Terminal Software)(GB).rom", 0x10000, 0xa94670f3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lazyjones, MSX_lazyjones, msx_msx) -STD_ROM_FN(MSX_lazyjones) - -struct BurnDriver BurnDrvMSX_lazyjones = { - "msx_lazyjones", NULL, "msx_msx", NULL, "1985", - "Lazy Jones\0", "Crashes... check later", "Terminal Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lazyjonesRomInfo, MSX_lazyjonesRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Afteroids - -static struct BurnRomInfo MSX_afteroidsRomDesc[] = { - { "Afteroids (1988)(Zigurat Software)(ES).rom", 0x20000, 0x8a599dad, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_afteroids, MSX_afteroids, msx_msx) -STD_ROM_FN(MSX_afteroids) - -struct BurnDriver BurnDrvMSX_afteroids = { - "msx_afteroids", NULL, "msx_msx", NULL, "1988", - "Afteroids\0", NULL, "Zigurat Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_afteroidsRomInfo, MSX_afteroidsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bubbler - -static struct BurnRomInfo MSX_bubblerRomDesc[] = { - { "Bubbler (1987)(Ultimate Play The Game)(GB).rom", 0x20000, 0x0150e22e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bubbler, MSX_bubbler, msx_msx) -STD_ROM_FN(MSX_bubbler) - -struct BurnDriver BurnDrvMSX_bubbler = { - "msx_bubbler", NULL, "msx_msx", NULL, "1987", - "Bubbler\0", NULL, "Ultimate Play The Game", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bubblerRomInfo, MSX_bubblerRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Cyberun - -static struct BurnRomInfo MSX_cyberunRomDesc[] = { - { "Cyberun (1985)(Ultimate Play The Game)(GB).rom", 0x20000, 0x12c23b87, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cyberun, MSX_cyberun, msx_msx) -STD_ROM_FN(MSX_cyberun) - -struct BurnDriver BurnDrvMSX_cyberun = { - "msx_cyberun", NULL, "msx_msx", NULL, "1985", - "Cyberun\0", NULL, "Ultimate Play The Game", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cyberunRomInfo, MSX_cyberunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mortadelo y Filemon - -static struct BurnRomInfo MSX_mortadeloRomDesc[] = { - { "Mortadelo y Filemon (1988)(Dro Soft)(ES).rom", 0x20000, 0xff4852f4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mortadelo, MSX_mortadelo, msx_msx) -STD_ROM_FN(MSX_mortadelo) - -struct BurnDriver BurnDrvMSX_mortadelo = { - "msx_mortadelo", NULL, "msx_msx", NULL, "1988", - "Mortadelo y Filemon\0", NULL, "Dro Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mortadeloRomInfo, MSX_mortadeloRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mortadelo y Filemon II - Safari Callejero - -static struct BurnRomInfo MSX_mortadelo2RomDesc[] = { - { "Mortadelo y Filemon II - Safari Callejero (1990)(Dro Soft)(ES).rom", 0x20000, 0x0c6a21b2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mortadelo2, MSX_mortadelo2, msx_msx) -STD_ROM_FN(MSX_mortadelo2) - -struct BurnDriver BurnDrvMSX_mortadelo2 = { - "msx_mortadelo2", NULL, "msx_msx", NULL, "1990", - "Mortadelo y Filemon II - Safari Callejero\0", NULL, "Dro Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mortadelo2RomInfo, MSX_mortadelo2RomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Pentagram - -static struct BurnRomInfo MSX_pentagramRomDesc[] = { - { "Pentagram (1986)(Ultimate Play The Game)(GB).rom", 0x20000, 0x04b90e53, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pentagram, MSX_pentagram, msx_msx) -STD_ROM_FN(MSX_pentagram) - -struct BurnDriver BurnDrvMSX_pentagram = { - "msx_pentagram", NULL, "msx_msx", NULL, "1986", - "Pentagram\0", NULL, "Ultimate Play The Game", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pentagramRomInfo, MSX_pentagramRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Turbo Girl - -static struct BurnRomInfo MSX_turbogirlRomDesc[] = { - { "Turbo Girl (1988)(Dinamic Software)(ES).rom", 0x20000, 0x6fded825, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_turbogirl, MSX_turbogirl, msx_msx) -STD_ROM_FN(MSX_turbogirl) - -struct BurnDriver BurnDrvMSX_turbogirl = { - "msx_turbogirl", NULL, "msx_msx", NULL, "1988", - "Turbo Girl\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_turbogirlRomInfo, MSX_turbogirlRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Super Suwanggi - Super Altered Beast - -static struct BurnRomInfo MSX_suwanggiRomDesc[] = { - { "Super Suwanggi - Super Altered Beast (1990)(Clover)[ASCII16k].rom", 0x10000, 0xe953f2ab, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_suwanggi, MSX_suwanggi, msx_msx) -STD_ROM_FN(MSX_suwanggi) - -struct BurnDriver BurnDrvMSX_suwanggi = { - "msx_suwanggi", NULL, "msx_msx", NULL, "1990", - "Super Suwanggi - Super Altered Beast\0", NULL, "Clover", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII16, GBF_MISC, 0, - MSXGetZipName, MSX_suwanggiRomInfo, MSX_suwanggiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Amurisus - -static struct BurnRomInfo MSX_amurisusRomDesc[] = { - { "amurisus.rom", 0x10000, 0xacf0cab8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_amurisus, MSX_amurisus, msx_msx) -STD_ROM_FN(MSX_amurisus) - -struct BurnDriver BurnDrvMSX_amurisus = { - "msx_amurisus", NULL, "msx_msx", NULL, "2013", - "Amurisus (demo)\0", NULL, "Lieves!Tuore", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_amurisusRomInfo, MSX_amurisusRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Rock 'n Roller - -static struct BurnRomInfo MSX_rocknrollerRomDesc[] = { - { "Rock'nRoller.rom", 0x10000, 0xb0c0e46d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rocknroller, MSX_rocknroller, msx_msx) -STD_ROM_FN(MSX_rocknroller) - -struct BurnDriver BurnDrvMSX_rocknroller = { - "msx_rocknroller", NULL, "msx_msx", NULL, "1988", - "Rock 'n Roller\0", NULL, "RCC", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rocknrollerRomInfo, MSX_rocknrollerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Super Ilevan - -static struct BurnRomInfo MSX_ilevanRomDesc[] = { - { "Super Ilevan (Koichi Nishida, 1987).cas", 0x59a6, 0x87157a8d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ilevan, MSX_ilevan, msx_msx) -STD_ROM_FN(MSX_ilevan) - -struct BurnDriver BurnDrvMSX_ilevan = { - "msx_ilevan", NULL, "msx_msx", NULL, "1987", - "Super Ilevan\0", NULL, "Koichi Nishida", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ilevanRomInfo, MSX_ilevanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Scentipede - -static struct BurnRomInfo MSX_scentipedeRomDesc[] = { - { "Scentipede (1986)(Eaglesoft)(NL)[RUN'CAS-'].cas", 0x93b8, 0x63f02ed5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_scentipede, MSX_scentipede, msx_msx) -STD_ROM_FN(MSX_scentipede) - -struct BurnDriver BurnDrvMSX_scentipede = { - "msx_scentipede", NULL, "msx_msx", NULL, "1986", - "Scentipede\0", NULL, "Aackosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_scentipedeRomInfo, MSX_scentipedeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -static struct BurnRomInfo MSX_zona0RomDesc[] = { - { "zona 0 (1991)(topo soft)(es)[run'cas-'].cas", 0x10f6e, 0x0b919291, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_zona0, MSX_zona0, msx_msx) -STD_ROM_FN(MSX_zona0) - -struct BurnDriver BurnDrvMSX_zona0 = { - "msx_zona0", NULL, "msx_msx", NULL, "1991", - "Zona 0 (Spa)\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_zona0RomInfo, MSX_zona0RomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Wizard's Lair (Euro) - -static struct BurnRomInfo MSX_wizlairRomDesc[] = { - { "wizard's lair (1986)(bubble bus software)(gb)(m3)[cload + run].cas", 0x0c718, 0x8dc78f7b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wizlair, MSX_wizlair, msx_msx) -STD_ROM_FN(MSX_wizlair) - -struct BurnDriver BurnDrvMSX_wizlair = { - "msx_wizlair", NULL, "msx_msx", NULL, "1986", - "Wizard's Lair (Euro)\0", NULL, "Bubble Bus Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_wizlairRomInfo, MSX_wizlairRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasCloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Winterhawk (Euro) - -static struct BurnRomInfo MSX_winthawkRomDesc[] = { - { "winterhawk (1988)(eurosoft)(nl)[run'cas-'].cas", 0x0be12, 0x143c3a53, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_winthawk, MSX_winthawk, msx_msx) -STD_ROM_FN(MSX_winthawk) - -struct BurnDriver BurnDrvMSX_winthawk = { - "msx_winthawk", NULL, "msx_msx", NULL, "1988", - "Winterhawk (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_winthawkRomInfo, MSX_winthawkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Void Runner (Euro) - -static struct BurnRomInfo MSX_voidrunRomDesc[] = { - { "voidrunner (1987)(mastertronic added dimension)(gb)[run'cas-'].cas", 0x05398, 0x7e9b01f8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_voidrun, MSX_voidrun, msx_msx) -STD_ROM_FN(MSX_voidrun) - -struct BurnDriver BurnDrvMSX_voidrun = { - "msx_voidrun", NULL, "msx_msx", NULL, "1987", - "Void Runner (Euro)\0", NULL, "Mastertronic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_voidrunRomInfo, MSX_voidrunRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - VoidrunnerDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Wamp Cola (Spa) - -static struct BurnRomInfo MSX_wampcolaRomDesc[] = { - { "wamp cola (1988)(iber soft)(es)[aka dracula][run'cas-'].cas", 0x04d4b, 0xa6438fe8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wampcola, MSX_wampcola, msx_msx) -STD_ROM_FN(MSX_wampcola) - -struct BurnDriver BurnDrvMSX_wampcola = { - "msx_wampcola", NULL, "msx_msx", NULL, "1988", - "Wamp Cola (Spa)\0", NULL, "Iber Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_wampcolaRomInfo, MSX_wampcolaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Vortex Raider (Euro) - -static struct BurnRomInfo MSX_vortraidRomDesc[] = { - { "vortex raider (1988)(eurosoft)(nl)[run'cas-'].cas", 0x11580, 0x5feacdfe, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_vortraid, MSX_vortraid, msx_msx) -STD_ROM_FN(MSX_vortraid) - -struct BurnDriver BurnDrvMSX_vortraid = { - "msx_vortraid", NULL, "msx_msx", NULL, "1988", - "Vortex Raider (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_vortraidRomInfo, MSX_vortraidRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Vestron (Euro) - -static struct BurnRomInfo MSX_vestronRomDesc[] = { - { "vestron (1986)(players software)(gb)[bload'cas-',r].cas", 0x04e1f, 0xf5e9984d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_vestron, MSX_vestron, msx_msx) -STD_ROM_FN(MSX_vestron) - -struct BurnDriver BurnDrvMSX_vestron = { - "msx_vestron", NULL, "msx_msx", NULL, "1986", - "Vestron (Euro)\0", NULL, "Players Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_vestronRomInfo, MSX_vestronRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Valkyr (Euro) - -static struct BurnRomInfo MSX_valkyrRomDesc[] = { - { "valkyr (1985)(gremlin graphics software)(gb)[bload'cas-',r].cas", 0x0b342, 0x1466df59, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_valkyr, MSX_valkyr, msx_msx) -STD_ROM_FN(MSX_valkyr) - -struct BurnDriver BurnDrvMSX_valkyr = { - "msx_valkyr", NULL, "msx_msx", NULL, "1985", - "Valkyr (Euro)\0", NULL, "Gremlin Graphics", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_valkyrRomInfo, MSX_valkyrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Underground (Spa) - -static struct BurnRomInfo MSX_undergndRomDesc[] = { - { "underground (1988)(system 4)(es)[run'cas-'].cas", 0x0b080, 0x0019e507, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_undergnd, MSX_undergnd, msx_msx) -STD_ROM_FN(MSX_undergnd) - -struct BurnDriver BurnDrvMSX_undergnd = { - "msx_undergnd", NULL, "msx_msx", NULL, "1988", - "Underground (Spa)\0", NULL, "System 4", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_undergndRomInfo, MSX_undergndRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Trantor - The Last Stormtrooper (Euro) - -static struct BurnRomInfo MSX_trantorRomDesc[] = { - { "trantor - the last stormtrooper (1987)(go!)[run'cas-'].cas", 0x09b3e, 0x2cea057a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_trantor, MSX_trantor, msx_msx) -STD_ROM_FN(MSX_trantor) - -struct BurnDriver BurnDrvMSX_trantor = { - "msx_trantor", NULL, "msx_msx", NULL, "1987", - "Trantor - The Last Stormtrooper (Euro)\0", NULL, "Go!", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_trantorRomInfo, MSX_trantorRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Time Trax (Euro) - -static struct BurnRomInfo MSX_timetraxRomDesc[] = { - { "time trax (1986)(bug-byte software)(gb)[run'cas-'].cas", 0x0e2aa, 0x70617478, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_timetrax, MSX_timetrax, msx_msx) -STD_ROM_FN(MSX_timetrax) - -struct BurnDriver BurnDrvMSX_timetrax = { - "msx_timetrax", NULL, "msx_msx", NULL, "1986", - "Time Trax (Euro)\0", NULL, "Bug-Byte Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_timetraxRomInfo, MSX_timetraxRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Titanic (Spa) - -static struct BurnRomInfo MSX_titanicRomDesc[] = { - { "titanic (1988)(topo soft)(es)(side a)[run'cas-'].cas", 0x0c300, 0x7e7a8653, BRF_PRG | BRF_ESS }, - { "titanic (1988)(topo soft)(es)(side b)[run'cas-'].cas", 0x0c91c, 0x45b1c035, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_titanic, MSX_titanic, msx_msx) -STD_ROM_FN(MSX_titanic) - -struct BurnDriver BurnDrvMSX_titanic = { - "msx_titanic", NULL, "msx_msx", NULL, "1988", - "Titanic (Spa)\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_titanicRomInfo, MSX_titanicRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Time Bomb (Euro) - -static struct BurnRomInfo MSX_timebombRomDesc[] = { - { "time bomb (1987)(methodic solutions)(nl)[run'cas-'].cas", 0x07f88, 0x7d364b31, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_timebomb, MSX_timebomb, msx_msx) -STD_ROM_FN(MSX_timebomb) - -struct BurnDriver BurnDrvMSX_timebomb = { - "msx_timebomb", NULL, "msx_msx", NULL, "1987", - "Time Bomb (Euro)\0", NULL, "Methodic Solutions", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_timebombRomInfo, MSX_timebombRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Terramex (Euro) - -static struct BurnRomInfo MSX_terramexRomDesc[] = { - { "terramex (1988)(grandslam entertainments)(gb)[bload'cas-',r].cas", 0x0ff61, 0x5dc6b09a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_terramex, MSX_terramex, msx_msx) -STD_ROM_FN(MSX_terramex) - -struct BurnDriver BurnDrvMSX_terramex = { - "msx_terramex", NULL, "msx_msx", NULL, "1988", - "Terramex (Euro)\0", NULL, "Grandslam Entertainments", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_terramexRomInfo, MSX_terramexRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Terminus - Prison Planet (Euro) - -static struct BurnRomInfo MSX_terminusRomDesc[] = { - { "terminus - prison planet (1987)(mastertronic added dimension)(gb)[run'cas-'][martos].cas", 0x09947, 0xfe2b00e5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_terminus, MSX_terminus, msx_msx) -STD_ROM_FN(MSX_terminus) - -struct BurnDriver BurnDrvMSX_terminus = { - "msx_terminus", NULL, "msx_msx", NULL, "1987", - "Terminus - Prison Planet (Euro)\0", NULL, "Mastertronic Added Dimension", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_terminusRomInfo, MSX_terminusRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Starbuggy (Euro) - -static struct BurnRomInfo MSX_starbuggRomDesc[] = { - { "starbuggy (1988)(eurosoft)(nl)[run'cas-'].cas", 0x0a028, 0x94d525f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starbugg, MSX_starbugg, msx_msx) -STD_ROM_FN(MSX_starbugg) - -struct BurnDriver BurnDrvMSX_starbugg = { - "msx_starbugg", NULL, "msx_msx", NULL, "1988", - "Starbuggy (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starbuggRomInfo, MSX_starbuggRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Moon Rider (Euro) - -static struct BurnRomInfo MSX_moonridrRomDesc[] = { - { "moon rider (1986)(eaglesoft)(nl)[run'cas-'].cas", 0x12468, 0x8f94818c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_moonridr, MSX_moonridr, msx_msx) -STD_ROM_FN(MSX_moonridr) - -struct BurnDriver BurnDrvMSX_moonridr = { - "msx_moonridr", "msx_starbugg", "msx_msx", NULL, "1986", - "Moon Rider (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_moonridrRomInfo, MSX_moonridrRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Spy vs Spy II - The Island Caper (Euro) - -static struct BurnRomInfo MSX_spyvssp2RomDesc[] = { - { "spy vs spy ii - the island caper (1987)(databyte)[run'cas-'].cas", 0x09676, 0x8324d38d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spyvssp2, MSX_spyvssp2, msx_msx) -STD_ROM_FN(MSX_spyvssp2) - -struct BurnDriver BurnDrvMSX_spyvssp2 = { - "msx_spyvssp2", NULL, "msx_msx", NULL, "1987", - "Spy vs Spy II - The Island Caper (Euro)\0", NULL, "Databyte", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spyvssp2RomInfo, MSX_spyvssp2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Splash (Spa) - -static struct BurnRomInfo MSX_splashRomDesc[] = { - { "splash (1986)(mind games espana)(es)[run'cas-'].cas", 0x08293, 0x68943e75, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_splash, MSX_splash, msx_msx) -STD_ROM_FN(MSX_splash) - -struct BurnDriver BurnDrvMSX_splash = { - "msx_splash", NULL, "msx_msx", NULL, "1986", - "Splash (Spa)\0", NULL, "Mind Games España", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_splashRomInfo, MSX_splashRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Space Walk (Euro) - -static struct BurnRomInfo MSX_spacewlkRomDesc[] = { - { "space walk (1985)(mastertronic)(gb)[bload'cas-',r].cas", 0x01977, 0x0b88b07a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spacewlk, MSX_spacewlk, msx_msx) -STD_ROM_FN(MSX_spacewlk) - -struct BurnDriver BurnDrvMSX_spacewlk = { - "msx_spacewlk", NULL, "msx_msx", NULL, "1985", - "Space Walk (Euro)\0", NULL, "Mastertronic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spacewlkRomInfo, MSX_spacewlkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Space Rescue (Euro) - -static struct BurnRomInfo MSX_srescueRomDesc[] = { - { "space rescue (1988)(eurosoft)(nl)[run'cas-'].cas", 0x059a8, 0x12318fd4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_srescue, MSX_srescue, msx_msx) -STD_ROM_FN(MSX_srescue) - -struct BurnDriver BurnDrvMSX_srescue = { - "msx_srescue", NULL, "msx_msx", NULL, "1988", - "Space Rescue (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_srescueRomInfo, MSX_srescueRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Smack Wacker (Euro) - -static struct BurnRomInfo MSX_smackwacRomDesc[] = { - { "smack wacker (1986)(eaglesoft)(nl)[run'cas-'].cas", 0x10638, 0xb1ff3d49, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_smackwac, MSX_smackwac, msx_msx) -STD_ROM_FN(MSX_smackwac) - -struct BurnDriver BurnDrvMSX_smackwac = { - "msx_smackwac", NULL, "msx_msx", NULL, "1986", - "Smack Wacker (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_smackwacRomInfo, MSX_smackwacRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Sky Diver (Jpn) - -static struct BurnRomInfo MSX_skydiverRomDesc[] = { - { "sky diver (1984)(hudson soft - japanese softbank)(jp)(en)[bload'cas-',r][martos].cas", 0x02dd6, 0x93a40a2c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skydiver, MSX_skydiver, msx_msx) -STD_ROM_FN(MSX_skydiver) - -struct BurnDriver BurnDrvMSX_skydiver = { - "msx_skydiver", NULL, "msx_msx", NULL, "1984", - "Sky Diver (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skydiverRomInfo, MSX_skydiverRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Skull Exilon (Spa) - -static struct BurnRomInfo MSX_skulexilRomDesc[] = { - { "skull exilon (1988)(iber soft)(es)[aka safari x][run'cas-'].cas", 0x077e7, 0xec4e2be2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_skulexil, MSX_skulexil, msx_msx) -STD_ROM_FN(MSX_skulexil) - -struct BurnDriver BurnDrvMSX_skulexil = { - "msx_skulexil", NULL, "msx_msx", NULL, "1988", - "Skull Exilon (Spa)\0", NULL, "Iber Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_skulexilRomInfo, MSX_skulexilRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Silent Shadow (Euro?) - -static struct BurnRomInfo MSX_sshadowRomDesc[] = { - { "silent shadow (1988)(topo soft)[run'cas-'].cas", 0x260b2, 0xa995ca1b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sshadow, MSX_sshadow, msx_msx) -STD_ROM_FN(MSX_sshadow) - -struct BurnDriver BurnDrvMSX_sshadow = { - "msx_sshadow", NULL, "msx_msx", NULL, "1988", - "Silent Shadow (Euro?)\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sshadowRomInfo, MSX_sshadowRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Shnax (Euro) - -static struct BurnRomInfo MSX_shnaxRomDesc[] = { - { "shnax (1985)(kuma computers)(gb)[run'cas-',r][martos].cas", 0x063f2, 0xe14a712e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_shnax, MSX_shnax, msx_msx) -STD_ROM_FN(MSX_shnax) - -struct BurnDriver BurnDrvMSX_shnax = { - "msx_shnax", NULL, "msx_msx", NULL, "1985", - "Shnax (Euro)\0", NULL, "Kuma Computers", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_shnaxRomInfo, MSX_shnaxRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Shark Hunter (Euro) - -static struct BurnRomInfo MSX_sharkhRomDesc[] = { - { "shark hunter (1984)(electric software)(gb)[bload'cas-',r].cas", 0x0a875, 0x2066f45b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sharkh, MSX_sharkh, msx_msx) -STD_ROM_FN(MSX_sharkh) - -struct BurnDriver BurnDrvMSX_sharkh = { - "msx_sharkh", NULL, "msx_msx", NULL, "1984", - "Shark Hunter (Euro)\0", NULL, "Electric Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sharkhRomInfo, MSX_sharkhRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Science Fiction (Euro) - -static struct BurnRomInfo MSX_scifiRomDesc[] = { - { "science fiction (1986)(eaglesoft)(nl)[run'cas-'].cas", 0x06820, 0x9bdc6759, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_scifi, MSX_scifi, msx_msx) -STD_ROM_FN(MSX_scifi) - -struct BurnDriver BurnDrvMSX_scifi = { - "msx_scifi", NULL, "msx_msx", NULL, "1986", - "Science Fiction (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_scifiRomInfo, MSX_scifiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Runner (Fra) - -static struct BurnRomInfo MSX_runnerRomDesc[] = { - { "runner (1986)(loriciels)(fr)[run'cas-'].cas", 0x096e8, 0x80a0f4d2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_runner, MSX_runner, msx_msx) -STD_ROM_FN(MSX_runner) - -struct BurnDriver BurnDrvMSX_runner = { - "msx_runner", NULL, "msx_msx", NULL, "1986", - "Runner (Fra)\0", NULL, "Loriciels", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_runnerRomInfo, MSX_runnerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Break Out! - -static struct BurnRomInfo MSX_breakouttRomDesc[] = { - { "Break Out! (1985)(Toshiba-EMI)(JP)[needs 64k in slot 2].rom", 0x20000, 0x784d5f7f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_breakoutt, MSX_breakoutt, msx_msx) -STD_ROM_FN(MSX_breakoutt) - -struct BurnDriver BurnDrvMSX_breakoutt = { - "msx_breakoutt", NULL, "msx_msx", NULL, "1985", - "Break Out!\0", NULL, "Toshiba-EMI", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_breakouttRomInfo, MSX_breakouttRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - SwapRamDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Roboy (Euro) - -static struct BurnRomInfo MSX_roboyRomDesc[] = { - { "roboy (1987)(methodic solutions)(nl)[run'cas-'].cas", 0x06d08, 0xa61c1805, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_roboy, MSX_roboy, msx_msx) -STD_ROM_FN(MSX_roboy) - -struct BurnDriver BurnDrvMSX_roboy = { - "msx_roboy", NULL, "msx_msx", NULL, "1987", - "Roboy (Euro)\0", NULL, "Methodic Solutions", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_roboyRomInfo, MSX_roboyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Rock 'n Roller (Spa) - -static struct BurnRomInfo MSX_rockrollRomDesc[] = { - { "rock 'n roller (1988)(topo soft)(es)[run'cas-'].cas", 0x0cbf1, 0xcc0bc2e0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rockroll, MSX_rockroll, msx_msx) -STD_ROM_FN(MSX_rockroll) - -struct BurnDriver BurnDrvMSX_rockroll = { - "msx_rockroll", NULL, "msx_msx", NULL, "1988", - "Rock 'n Roller (Spa)\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rockrollRomInfo, MSX_rockrollRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Robot Wars (Euro) - -static struct BurnRomInfo MSX_robotwarRomDesc[] = { - { "robot wars (1986)(eaglesoft)(nl)[run'cas-'].cas", 0x0c482, 0x08f5270d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_robotwar, MSX_robotwar, msx_msx) -STD_ROM_FN(MSX_robotwar) - -struct BurnDriver BurnDrvMSX_robotwar = { - "msx_robotwar", NULL, "msx_msx", NULL, "1986", - "Robot Wars (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_robotwarRomInfo, MSX_robotwarRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Rescate Atlantida (Spa) - -static struct BurnRomInfo MSX_rescatlRomDesc[] = { - { "rescate atlantida (1989)(dinamic software)(es)[run'cas-'].cas", 0x1d48a, 0x39411ccb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rescatl, MSX_rescatl, msx_msx) -STD_ROM_FN(MSX_rescatl) - -struct BurnDriver BurnDrvMSX_rescatl = { - "msx_rescatl", NULL, "msx_msx", NULL, "1989", - "Rescate Atlantida (Spa)\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rescatlRomInfo, MSX_rescatlRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Rath-Tha (Spa) - -static struct BurnRomInfo MSX_raththaRomDesc[] = { - { "rath-tha (1989)(positive)(es)[run'cas-'].cas", 0x0e2ef, 0xd804222d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_raththa, MSX_raththa, msx_msx) -STD_ROM_FN(MSX_raththa) - -struct BurnDriver BurnDrvMSX_raththa = { - "msx_raththa", NULL, "msx_msx", NULL, "1989", - "Rath-Tha (Spa)\0", NULL, "Positive", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_raththaRomInfo, MSX_raththaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// R.A.M. (Spa) - -static struct BurnRomInfo MSX_ramRomDesc[] = { - { "r.a.m. (1990)(topo soft)(es)[run'cas-'].cas", 0x10158, 0x497462cc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ram, MSX_ram, msx_msx) -STD_ROM_FN(MSX_ram) - -struct BurnDriver BurnDrvMSX_ram = { - "msx_ram", NULL, "msx_msx", NULL, "1990", - "R.A.M. (Spa)\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ramRomInfo, MSX_ramRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Psychedelia (Euro) - -static struct BurnRomInfo MSX_psychedRomDesc[] = { - { "psychedelia (1984)(aackosoft)(nl)[run'cas-'].cas", 0x01bbe, 0xdb0b5487, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_psyched, MSX_psyched, msx_msx) -STD_ROM_FN(MSX_psyched) - -struct BurnDriver BurnDrvMSX_psyched = { - "msx_psyched", NULL, "msx_msx", NULL, "1984", - "Psychedelia (Euro)\0", NULL, "Aackosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_psychedRomInfo, MSX_psychedRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Polar Star (Jpn) - -static struct BurnRomInfo MSX_polstarRomDesc[] = { - { "polar star (1984)(micro cabin)(jp)[cload + run].cas", 0x05cdb, 0xba314b2c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_polstar, MSX_polstar, msx_msx) -STD_ROM_FN(MSX_polstar) - -struct BurnDriver BurnDrvMSX_polstar = { - "msx_polstar", NULL, "msx_msx", NULL, "1984", - "Polar Star (Jpn)\0", NULL, "Micro Cabin", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_polstarRomInfo, MSX_polstarRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasCloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Pharaoh's Revenge (Euro) - -static struct BurnRomInfo MSX_pharaohRomDesc[] = { - { "pharaoh's revenge (1988)(eurosoft)(nl)[run'cas-'].cas", 0x0d7c0, 0x38a49e2b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pharaoh, MSX_pharaoh, msx_msx) -STD_ROM_FN(MSX_pharaoh) - -struct BurnDriver BurnDrvMSX_pharaoh = { - "msx_pharaoh", NULL, "msx_msx", NULL, "1988", - "Pharaoh's Revenge (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pharaohRomInfo, MSX_pharaohRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Pac-Mania (Euro) - -static struct BurnRomInfo MSX_pacmaniaRomDesc[] = { - { "pac-mania (1988)(grandslam entertainments)(gb)[bload'cas-',r].cas", 0x11b71, 0xfaeb79cd, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_pacmania, MSX_pacmania, msx_msx) -STD_ROM_FN(MSX_pacmania) - -struct BurnDriver BurnDrvMSX_pacmania = { - "msx_pacmania", NULL, "msx_msx", NULL, "1988", - "Pac-Mania (Euro)\0", NULL, "Grandslam Entertainments", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_pacmaniaRomInfo, MSX_pacmaniaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Outroyd (Jpn) - -static struct BurnRomInfo MSX_outroydRomDesc[] = { - { "outroyd (1985)(magical zoo)(jp)[cload + run].cas", 0x08d76, 0x24cb4684, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_outroyd, MSX_outroyd, msx_msx) -STD_ROM_FN(MSX_outroyd) - -struct BurnDriver BurnDrvMSX_outroyd = { - "msx_outroyd", NULL, "msx_msx", NULL, "1985", - "Outroyd (Jpn)\0", NULL, "Magical Zoo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_outroydRomInfo, MSX_outroydRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasCloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Obliterator (Spa) - -static struct BurnRomInfo MSX_obliterRomDesc[] = { - { "obliterator (1989)(dro soft)(es)[run'cas-'].cas", 0x0e297, 0xe9653411, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_obliter, MSX_obliter, msx_msx) -STD_ROM_FN(MSX_obliter) - -struct BurnDriver BurnDrvMSX_obliter = { - "msx_obliter", NULL, "msx_msx", NULL, "1989", - "Obliterator (Spa)\0", NULL, "Dro Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_obliterRomInfo, MSX_obliterRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mythos (Euro) - -static struct BurnRomInfo MSX_mythosRomDesc[] = { - { "mythos (1990)(opera soft)[bload'cas-',r].cas", 0x0e340, 0x36f71cfb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mythos, MSX_mythos, msx_msx) -STD_ROM_FN(MSX_mythos) - -struct BurnDriver BurnDrvMSX_mythos = { - "msx_mythos", NULL, "msx_msx", NULL, "1990", - "Mythos (Euro)\0", NULL, "Opera Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mythosRomInfo, MSX_mythosRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// El Mundo Perdido (Spa) - -static struct BurnRomInfo MSX_mundoperRomDesc[] = { - { "mundo perdido, el (1988)(topo soft)(es)[run'cas-'].cas", 0x0fb47, 0x488a17b0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mundoper, MSX_mundoper, msx_msx) -STD_ROM_FN(MSX_mundoper) - -struct BurnDriver BurnDrvMSX_mundoper = { - "msx_mundoper", NULL, "msx_msx", NULL, "1988", - "El Mundo Perdido (Spa)\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mundoperRomInfo, MSX_mundoperRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mr. Wong's Loopy Laundry (Euro) - -static struct BurnRomInfo MSX_mrwongRomDesc[] = { - { "mr. wong's loopy laundry (1984)(artic computing)(gb)[bload'cas-',r].cas", 0x034d6, 0xe116b37a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrwong, MSX_mrwong, msx_msx) -STD_ROM_FN(MSX_mrwong) - -struct BurnDriver BurnDrvMSX_mrwong = { - "msx_mrwong", NULL, "msx_msx", NULL, "1984", - "Mr. Wong's Loopy Laundry (Euro)\0", NULL, "Artic Computing", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mrwongRomInfo, MSX_mrwongRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// El Motorista Sideral (Spa) - -static struct BurnRomInfo MSX_sideralRomDesc[] = { - { "motorista sideral, el (1986)(anaya multimedia)(es)[run'cas-'].cas", 0x0642f, 0x8b07f4f6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sideral, MSX_sideral, msx_msx) -STD_ROM_FN(MSX_sideral) - -struct BurnDriver BurnDrvMSX_sideral = { - "msx_sideral", NULL, "msx_msx", NULL, "1986", - "El Motorista Sideral (Spa)\0", NULL, "Anaya Multimedia", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sideralRomInfo, MSX_sideralRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Milk Race (Euro) - -static struct BurnRomInfo MSX_milkraceRomDesc[] = { - { "milk race (1987)(mastertronic)(gb)[run'cas-'].cas", 0x0b610, 0x74ce546e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_milkrace, MSX_milkrace, msx_msx) -STD_ROM_FN(MSX_milkrace) - -struct BurnDriver BurnDrvMSX_milkrace = { - "msx_milkrace", NULL, "msx_msx", NULL, "1987", - "Milk Race (Euro)\0", "Press '0' to start", "Mastertronic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_milkraceRomInfo, MSX_milkraceRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Master of the Lamps (Euro) - -static struct BurnRomInfo MSX_mastlampRomDesc[] = { - { "master of the lamps (1985)(activision)(us)[run'cas-'].cas", 0x0a1c7, 0xfc70048f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mastlamp, MSX_mastlamp, msx_msx) -STD_ROM_FN(MSX_mastlamp) - -struct BurnDriver BurnDrvMSX_mastlamp = { - "msx_mastlamp", NULL, "msx_msx", NULL, "1985", - "Master of the Lamps (Euro)\0", NULL, "Activision", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mastlampRomInfo, MSX_mastlampRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mask II (Euro) - -static struct BurnRomInfo MSX_mask2RomDesc[] = { - { "mask ii (1987)(gremlin graphics software)(gb)[bload'cas-',r].cas", 0x13d30, 0x7639c66b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mask2, MSX_mask2, msx_msx) -STD_ROM_FN(MSX_mask2) - -struct BurnDriver BurnDrvMSX_mask2 = { - "msx_mask2", NULL, "msx_msx", NULL, "1987", - "Mask II (Euro)\0", NULL, "Gremlin Graphics", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mask2RomInfo, MSX_mask2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Mask III - Venom Strikes Back (Euro) - -static struct BurnRomInfo MSX_mask3RomDesc[] = { - { "mask iii - venom strikes back (1988)(gremlin graphics software)(gb)[bload'cas-',r].cas", 0x10ef2, 0xc6774b56, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mask3, MSX_mask3, msx_msx) -STD_ROM_FN(MSX_mask3) - -struct BurnDriver BurnDrvMSX_mask3 = { - "msx_mask3", NULL, "msx_msx", NULL, "1988", - "Mask III - Venom Strikes Back (Euro)\0", NULL, "Gremlin Graphics", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mask3RomInfo, MSX_mask3RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// M-Droid (Euro) - -static struct BurnRomInfo MSX_mdroidRomDesc[] = { - { "m-droid (19xx)(blue ribbon software)[run'cas-'].cas", 0x09a96, 0x03869d9e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mdroid, MSX_mdroid, msx_msx) -STD_ROM_FN(MSX_mdroid) - -struct BurnDriver BurnDrvMSX_mdroid = { - "msx_mdroid", NULL, "msx_msx", NULL, "198?", - "M-Droid (Euro)\0", NULL, "Blue Ribbon Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mdroidRomInfo, MSX_mdroidRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Krakout (Euro) - -static struct BurnRomInfo MSX_krakoutRomDesc[] = { - { "krakout (1987)(gremlin graphics software)(gb)[bload'cas-',r].cas", 0x107f3, 0x5a0776f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_krakout, MSX_krakout, msx_msx) -STD_ROM_FN(MSX_krakout) - -struct BurnDriver BurnDrvMSX_krakout = { - "msx_krakout", NULL, "msx_msx", NULL, "1987", - "Krakout (Euro)\0", NULL, "Gremlin Graphics", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_krakoutRomInfo, MSX_krakoutRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Robocop (Euro) - -static struct BurnRomInfo MSX_robocopRomDesc[] = { - { "robocop (1988)(ocean software)(gb)(side a)[bload'cas-',r].cas", 0x13ee2, 0xfb8aa367, BRF_PRG | BRF_ESS }, - { "robocop (1988)(ocean software)(gb)(side b)[bload'cas-',r].cas", 0x0e0f2, 0x8a43b63f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_robocop, MSX_robocop, msx_msx) -STD_ROM_FN(MSX_robocop) - -struct BurnDriver BurnDrvMSX_robocop = { - "msx_robocop", NULL, "msx_msx", NULL, "1988", - "Robocop (Euro)\0", NULL, "Ocean Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_robocopRomInfo, MSX_robocopRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Meganova (Spa) - -static struct BurnRomInfo MSX_meganovaRomDesc[] = { - { "meganova (1988)(dinamic software)(es)[run'cas-'].cas", 0x1264f, 0xa055f596, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_meganova, MSX_meganova, msx_msx) -STD_ROM_FN(MSX_meganova) - -struct BurnDriver BurnDrvMSX_meganova = { - "msx_meganova", NULL, "msx_msx", NULL, "1988", - "Meganova (Spa)\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_meganovaRomInfo, MSX_meganovaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Licence to Kill (Euro) - -static struct BurnRomInfo MSX_lic2killRomDesc[] = { - { "007 - licence to kill (1989)(domark)(gb)[run'cas-'].cas", 0x0cfe2, 0xbb994bbc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lic2kill, MSX_lic2kill, msx_msx) -STD_ROM_FN(MSX_lic2kill) - -struct BurnDriver BurnDrvMSX_lic2kill = { - "msx_lic2kill", NULL, "msx_msx", NULL, "1989", - "Licence to Kill (Euro)\0", NULL, "Domark", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lic2killRomInfo, MSX_lic2killRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Whopper Chase (Spa) - -static struct BurnRomInfo MSX_whopperRomDesc[] = { - { "whopper chase (1987)(erbe software)(es)[run'cas-'][martos].cas", 0x08f43, 0x7c28051b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_whopper, MSX_whopper, msx_msx) -STD_ROM_FN(MSX_whopper) - -struct BurnDriver BurnDrvMSX_whopper = { - "msx_whopper", NULL, "msx_msx", NULL, "1987", - "Whopper Chase (Spa)\0", NULL, "Erbe Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_whopperRomInfo, MSX_whopperRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Klax (Euro) - -static struct BurnRomInfo MSX_klaxRomDesc[] = { - { "klax (1990)(domark)(gb)[bload'cas-',r].cas", 0x11b71, 0x0f06d7a4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_klax, MSX_klax, msx_msx) -STD_ROM_FN(MSX_klax) - -struct BurnDriver BurnDrvMSX_klax = { - "msx_klax", NULL, "msx_msx", NULL, "1990", - "Klax (Euro)\0", NULL, "Domark", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_klaxRomInfo, MSX_klaxRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// King Leonard (Spa) - -static struct BurnRomInfo MSX_kingleonRomDesc[] = { - { "king leonard (1986)(mind games espana)(es)[bload'cas-',r].cas", 0x09a87, 0x0f752c47, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_kingleon, MSX_kingleon, msx_msx) -STD_ROM_FN(MSX_kingleon) - -struct BurnDriver BurnDrvMSX_kingleon = { - "msx_kingleon", NULL, "msx_msx", NULL, "1986", - "King Leonard (Spa)\0", NULL, "Mind Games España", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_kingleonRomInfo, MSX_kingleonRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Khazzad-Dum (Spa) - -static struct BurnRomInfo MSX_khazzadRomDesc[] = { - { "khazzad-dum (1989)(system 4)(es)[run'cas-'].cas", 0x0a2de, 0x27c10ddf, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_khazzad, MSX_khazzad, msx_msx) -STD_ROM_FN(MSX_khazzad) - -struct BurnDriver BurnDrvMSX_khazzad = { - "msx_khazzad", NULL, "msx_msx", NULL, "1989", - "Khazzad-Dum (Spa)\0", NULL, "System 4", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_khazzadRomInfo, MSX_khazzadRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jungle Warrior (Spa) - -static struct BurnRomInfo MSX_jungwarrRomDesc[] = { - { "jungle warrior (1990)(zigurat software)(es)[run'cas-'].cas", 0x0e8d9, 0xdf10a5b8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jungwarr, MSX_jungwarr, msx_msx) -STD_ROM_FN(MSX_jungwarr) - -struct BurnDriver BurnDrvMSX_jungwarr = { - "msx_jungwarr", NULL, "msx_msx", NULL, "1990", - "Jungle Warrior (Spa)\0", NULL, "Zigurat Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jungwarrRomInfo, MSX_jungwarrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jumping Jack (Euro) - -static struct BurnRomInfo MSX_jumpjackRomDesc[] = { - { "jumping jack (1986)(livewire software)(gb)[run'cas-'][martos].cas", 0x056a1, 0xa3e9284f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jumpjack, MSX_jumpjack, msx_msx) -STD_ROM_FN(MSX_jumpjack) - -struct BurnDriver BurnDrvMSX_jumpjack = { - "msx_jumpjack", NULL, "msx_msx", NULL, "1986", - "Jumping Jack (Euro)\0", NULL, "Livewire Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jumpjackRomInfo, MSX_jumpjackRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Joe Blade (Euro) - -static struct BurnRomInfo MSX_joebladeRomDesc[] = { - { "joe blade (1989)(players software)(gb)[bload'cas-',r].cas", 0x068a7, 0xc958dd10, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_joeblade, MSX_joeblade, msx_msx) -STD_ROM_FN(MSX_joeblade) - -struct BurnDriver BurnDrvMSX_joeblade = { - "msx_joeblade", NULL, "msx_msx", NULL, "1989", - "Joe Blade (Euro)\0", NULL, "Players Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_joebladeRomInfo, MSX_joebladeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jet Fighter (Euro, Eurosoft) - -static struct BurnRomInfo MSX_jetfightRomDesc[] = { - { "jet fighter (1988)(eurosoft)(nl)[run'cas-'].cas", 0x08c60, 0x0a788a57, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jetfight, MSX_jetfight, msx_msx) -STD_ROM_FN(MSX_jetfight) - -struct BurnDriver BurnDrvMSX_jetfight = { - "msx_jetfight", NULL, "msx_msx", NULL, "1988", - "Jet Fighter (Euro, Eurosoft)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jetfightRomInfo, MSX_jetfightRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jaws (Spa?) - -static struct BurnRomInfo MSX_jawsRomDesc[] = { - { "jaws (1989)(screen 7)[run'cas-'].cas", 0x0bfda, 0x908478e6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jaws, MSX_jaws, msx_msx) -STD_ROM_FN(MSX_jaws) - -struct BurnDriver BurnDrvMSX_jaws = { - "msx_jaws", NULL, "msx_msx", NULL, "1989", - "Jaws (Spa?)\0", NULL, "A.M.H.", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jawsRomInfo, MSX_jawsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Jackson City (Spa) - -static struct BurnRomInfo MSX_jackcityRomDesc[] = { - { "jackson city (1990)(g.ll. software)(es)[run'cas-'][ctrl][martos].cas", 0x105ae, 0x7cdfa5b3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_jackcity, MSX_jackcity, msx_msx) -STD_ROM_FN(MSX_jackcity) - -struct BurnDriver BurnDrvMSX_jackcity = { - "msx_jackcity", NULL, "msx_msx", NULL, "1990", - "Jackson City (Spa)\0", NULL, "G.LL. Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_jackcityRomInfo, MSX_jackcityRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Indiana Jones and the Temple of Doom (Euro) - -static struct BurnRomInfo MSX_indyRomDesc[] = { - { "indiana jones and the temple of doom (1987)(u.s. gold)(gb)[run'cas-'].cas", 0x0c014, 0x5c70746c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_indy, MSX_indy, msx_msx) -STD_ROM_FN(MSX_indy) - -struct BurnDriver BurnDrvMSX_indy = { - "msx_indy", NULL, "msx_msx", NULL, "1987", - "Indiana Jones and the Temple of Doom (Euro)\0", NULL, "U.S. Gold", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_indyRomInfo, MSX_indyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Inca (Euro) - -static struct BurnRomInfo MSX_incaRomDesc[] = { - { "inca (1987)(eaglesoft)(nl)[run'cas-'].cas", 0x06588, 0xbf667649, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_inca, MSX_inca, msx_msx) -STD_ROM_FN(MSX_inca) - -struct BurnDriver BurnDrvMSX_inca = { - "msx_inca", NULL, "msx_msx", NULL, "1987", - "Inca (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_incaRomInfo, MSX_incaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Ice-Breaker (Spa) - -static struct BurnRomInfo MSX_icebreakRomDesc[] = { - { "ice-breaker (1990)(topo soft)(es)[run'cas-'].cas", 0x12fa4, 0x5079a19c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_icebreak, MSX_icebreak, msx_msx) -STD_ROM_FN(MSX_icebreak) - -struct BurnDriver BurnDrvMSX_icebreak = { - "msx_icebreak", NULL, "msx_msx", NULL, "1990", - "Ice-Breaker (Spa)\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_icebreakRomInfo, MSX_icebreakRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// The Ice King (Euro) - -static struct BurnRomInfo MSX_icekingRomDesc[] = { - { "ice king, the (1986)(cds micro systems)(gb)[run'cas-'][martos].cas", 0x09657, 0x160cad54, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_iceking, MSX_iceking, msx_msx) -STD_ROM_FN(MSX_iceking) - -struct BurnDriver BurnDrvMSX_iceking = { - "msx_iceking", NULL, "msx_msx", NULL, "1986", - "The Ice King (Euro)\0", NULL, "CDS Micro Systems", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_icekingRomInfo, MSX_icekingRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Rambo III (Euro) - -static struct BurnRomInfo MSX_rambo3RomDesc[] = { - { "rambo iii (1988)(ocean software)(gb)[bload'cas-',r].cas", 0x2b5c0, 0x448cce74, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_rambo3, MSX_rambo3, msx_msx) -STD_ROM_FN(MSX_rambo3) - -struct BurnDriver BurnDrvMSX_rambo3 = { - "msx_rambo3", NULL, "msx_msx", NULL, "1988", - "Rambo III (Euro)\0", NULL, "Ocean Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_rambo3RomInfo, MSX_rambo3RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Psycho Pig U.X.B. (Euro) - -static struct BurnRomInfo MSX_psychpigRomDesc[] = { - { "psycho pig u.x.b. (1988)(u.s. gold)(gb)[run'cas-'].cas", 0x0aa67, 0xefe975a0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_psychpig, MSX_psychpig, msx_msx) -STD_ROM_FN(MSX_psychpig) - -struct BurnDriver BurnDrvMSX_psychpig = { - "msx_psychpig", NULL, "msx_msx", NULL, "1988", - "Psycho Pig U.X.B. (Euro)\0", NULL, "U.S. Gold", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_psychpigRomInfo, MSX_psychpigRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Punchy (Euro) - -static struct BurnRomInfo MSX_punchyRomDesc[] = { - { "punchy (1984)(mr. micro)[bload'cas-',r].cas", 0x03d7f, 0x1f389e5d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_punchy, MSX_punchy, msx_msx) -STD_ROM_FN(MSX_punchy) - -struct BurnDriver BurnDrvMSX_punchy = { - "msx_punchy", NULL, "msx_msx", NULL, "1984", - "Punchy (Euro)\0", NULL, "Mr. Micro", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_punchyRomInfo, MSX_punchyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Hundra (Spa) - -static struct BurnRomInfo MSX_hundraRomDesc[] = { - { "hundra (1988)(dinamic software)(es)[run'cas-'].cas", 0x0befd, 0xe0ad7798, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hundra, MSX_hundra, msx_msx) -STD_ROM_FN(MSX_hundra) - -struct BurnDriver BurnDrvMSX_hundra = { - "msx_hundra", NULL, "msx_msx", NULL, "1988", - "Hundra (Spa)\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hundraRomInfo, MSX_hundraRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Hunchback (Euro) - -static struct BurnRomInfo MSX_hnchbackRomDesc[] = { - { "hunchback (1984)(ocean software)(gb)[bload'cas-',r].cas", 0x0402f, 0x42b6c9c5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hnchback, MSX_hnchback, msx_msx) -STD_ROM_FN(MSX_hnchback) - -struct BurnDriver BurnDrvMSX_hnchback = { - "msx_hnchback", NULL, "msx_msx", NULL, "1984", - "Hunchback (Euro)\0", NULL, "Ocean Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hnchbackRomInfo, MSX_hnchbackRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Hot Shoe (Euro) - -static struct BurnRomInfo MSX_hotshoeRomDesc[] = { - { "hot shoe (1984)(longman software)(gb)[bload'cas-',r][martos].cas", 0x03627, 0x582c9afc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hotshoe, MSX_hotshoe, msx_msx) -STD_ROM_FN(MSX_hotshoe) - -struct BurnDriver BurnDrvMSX_hotshoe = { - "msx_hotshoe", NULL, "msx_msx", NULL, "1984", - "Hot Shoe (Euro)\0", NULL, "Longman Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hotshoeRomInfo, MSX_hotshoeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Hostages (Spa, Hacked by Martos) - -static struct BurnRomInfo MSX_hostagesRomDesc[] = { - { "hostages (1990)(erbe)(es)(en)(m martos)[run'cas-'].cas", 0x2234a, 0x1a6e23df, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hostages, MSX_hostages, msx_msx) -STD_ROM_FN(MSX_hostages) - -struct BurnDriver BurnDrvMSX_hostages = { - "msx_hostages", NULL, "msx_msx", NULL, "1990", - "Hostages (Spa, Hacked by Martos)\0", NULL, "Erbe Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hostagesRomInfo, MSX_hostagesRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Highway Encounter (Spa) - -static struct BurnRomInfo MSX_highwayenRomDesc[] = { - { "highway encounter (1985)(dinamic software)(es)[run'cas-'].cas", 0x0a415, 0x1c036ed9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_highwayen, MSX_highwayen, msx_msx) -STD_ROM_FN(MSX_highwayen) - -struct BurnDriver BurnDrvMSX_highwayen = { - "msx_highwayen", NULL, "msx_msx", NULL, "1985", - "Highway Encounter (Spa)\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_highwayenRomInfo, MSX_highwayenRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Hercules - Slayer of the Damned (Euro) - -static struct BurnRomInfo MSX_herculesRomDesc[] = { - { "hercules - slayer of the damned (1988)(gremlin graphics software)(gb)[bload'cas-',r].cas", 0x21daa, 0x2b3fc6f5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hercules, MSX_hercules, msx_msx) -STD_ROM_FN(MSX_hercules) - -struct BurnDriver BurnDrvMSX_hercules = { - "msx_hercules", NULL, "msx_msx", NULL, "1988", - "Hercules - Slayer of the Damned (Euro)\0", NULL, "Gremlin Graphics", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_herculesRomInfo, MSX_herculesRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Heat Seeker - Missil (Spa) - -static struct BurnRomInfo MSX_heatseekRomDesc[] = { - { "heat seeker - missil (1986)(mind games espana)(es)[run'cas-'][martos].cas", 0x08859, 0x7515587f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_heatseek, MSX_heatseek, msx_msx) -STD_ROM_FN(MSX_heatseek) - -struct BurnDriver BurnDrvMSX_heatseek = { - "msx_heatseek", NULL, "msx_msx", NULL, "1986", - "Heat Seeker - Missil (Spa)\0", NULL, "Mind Games España", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_heatseekRomInfo, MSX_heatseekRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Haunted House (Euro) - -static struct BurnRomInfo MSX_hhouseRomDesc[] = { - { "haunted house (1988)(eurosoft)(nl)[run'cas-'].cas", 0x11078, 0x3c4ee5c3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hhouse, MSX_hhouse, msx_msx) -STD_ROM_FN(MSX_hhouse) - -struct BurnDriver BurnDrvMSX_hhouse = { - "msx_hhouse", NULL, "msx_msx", NULL, "1988", - "Haunted House (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hhouseRomInfo, MSX_hhouseRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Harvey Smith's Showjumper (Euro, Hacked Protection) - -static struct BurnRomInfo MSX_showjumphRomDesc[] = { - { "harvey smith's showjumper (1985)(software projects)[run'cas-'].cas", 0x073a8, 0x3dc22773, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_showjumph, MSX_showjumph, msx_msx) -STD_ROM_FN(MSX_showjumph) - -struct BurnDriver BurnDrvMSX_showjumph = { - "msx_showjumph", NULL, "msx_msx", NULL, "1985", - "Harvey Smith's Showjumper (Euro, Hacked Protection)\0", NULL, "Software Projects", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_showjumphRomInfo, MSX_showjumphRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Hard Boiled (Euro) - -static struct BurnRomInfo MSX_hardboilRomDesc[] = { - { "hard boiled (1987)(methodic solutions)(nl)[run'cas-'].cas", 0x0ef38, 0xd7fad1be, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hardboil, MSX_hardboil, msx_msx) -STD_ROM_FN(MSX_hardboil) - -struct BurnDriver BurnDrvMSX_hardboil = { - "msx_hardboil", NULL, "msx_msx", NULL, "1987", - "Hard Boiled (Euro)\0", NULL, "Methodic Solutions", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hardboilRomInfo, MSX_hardboilRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Hammer Boy (Spa) - -static struct BurnRomInfo MSX_hammboyRomDesc[] = { - { "hammer boy (1991)(dinamic software)(es)(side a)[run'cas-'].cas", 0x0da92, 0x907a6931, BRF_PRG | BRF_ESS }, - { "hammer boy (1991)(dinamic software)(es)(side b)[run'cas-'].cas", 0x0da92, 0x2e7eba8e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hammboy, MSX_hammboy, msx_msx) -STD_ROM_FN(MSX_hammboy) - -struct BurnDriver BurnDrvMSX_hammboy = { - "msx_hammboy", NULL, "msx_msx", NULL, "1991", - "Hammer Boy (Spa)\0", "Keyboard control only.", "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hammboyRomInfo, MSX_hammboyRomName, NULL, NULL, MSXInputInfo, MSXJoyCursorDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Habilit (Spa) - -static struct BurnRomInfo MSX_habilitRomDesc[] = { - { "habilit (1988)(iber soft)(es)[run'cas-'].cas", 0x09d77, 0xb48a02de, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_habilit, MSX_habilit, msx_msx) -STD_ROM_FN(MSX_habilit) - -struct BurnDriver BurnDrvMSX_habilit = { - "msx_habilit", NULL, "msx_msx", NULL, "1988", - "Habilit (Spa)\0", NULL, "Iber Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_habilitRomInfo, MSX_habilitRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Guttblaster (Euro) - -static struct BurnRomInfo MSX_guttblstRomDesc[] = { - { "guttblaster (1988)(eurosoft)(nl)[run'cas-'].cas", 0x0f598, 0x221735ed, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_guttblst, MSX_guttblst, msx_msx) -STD_ROM_FN(MSX_guttblst) - -struct BurnDriver BurnDrvMSX_guttblst = { - "msx_guttblst", NULL, "msx_msx", NULL, "1988", - "Guttblaster (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_guttblstRomInfo, MSX_guttblstRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Grid Trap (Euro) - -static struct BurnRomInfo MSX_gridtrapRomDesc[] = { - { "grid trap (1985)(livewire software)(gb)[run'cas-'].cas", 0x026e8, 0x6cacf65f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gridtrap, MSX_gridtrap, msx_msx) -STD_ROM_FN(MSX_gridtrap) - -struct BurnDriver BurnDrvMSX_gridtrap = { - "msx_gridtrap", NULL, "msx_msx", NULL, "1985", - "Grid Trap (Euro)\0", NULL, "Livewire Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gridtrapRomInfo, MSX_gridtrapRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Goody (Spa) - -static struct BurnRomInfo MSX_goodyRomDesc[] = { - { "goody (1987)(opera soft)(es)[bload'cas-',r].cas", 0x0dd40, 0x8ce47b52, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_goody, MSX_goody, msx_msx) -STD_ROM_FN(MSX_goody) - -struct BurnDriver BurnDrvMSX_goody = { - "msx_goody", NULL, "msx_msx", NULL, "1987", - "Goody (Spa)\0", NULL, "Opera Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_goodyRomInfo, MSX_goodyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Glass (Spa) - -static struct BurnRomInfo MSX_glassRomDesc[] = { - { "glass (1985)(quicksilva)(es-gb)[run'cas-'].cas", 0x082d7, 0x9902f154, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_glass, MSX_glass, msx_msx) -STD_ROM_FN(MSX_glass) - -struct BurnDriver BurnDrvMSX_glass = { - "msx_glass", NULL, "msx_msx", NULL, "1985", - "Glass (Spa)\0", NULL, "Quicksilva", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_glassRomInfo, MSX_glassRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Ghostbusters II (Euro) - -static struct BurnRomInfo MSX_ghostbs2RomDesc[] = { - { "ghostbusters ii (1989)(activision)(us)[run'cas-'].cas", 0x29e91, 0x6e8a88f6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ghostbs2, MSX_ghostbs2, msx_msx) -STD_ROM_FN(MSX_ghostbs2) - -struct BurnDriver BurnDrvMSX_ghostbs2 = { - "msx_ghostbs2", NULL, "msx_msx", NULL, "1989", - "Ghostbusters II (Euro)\0", NULL, "Activision", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ghostbs2RomInfo, MSX_ghostbs2RomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Ghost (Spa) - -static struct BurnRomInfo MSX_ghostRomDesc[] = { - { "ghost (1989)(mind games espana)(es)[run'cas-'].cas", 0x0bed7, 0xc3d65cb5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ghost, MSX_ghost, msx_msx) -STD_ROM_FN(MSX_ghost) - -struct BurnDriver BurnDrvMSX_ghost = { - "msx_ghost", NULL, "msx_msx", NULL, "1989", - "Ghost (Spa)\0", NULL, "Mind Games Espana", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ghostRomInfo, MSX_ghostRomName, NULL, NULL, MSXInputInfo, MSXJoyCursorDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Gang Man (Euro) - -static struct BurnRomInfo MSX_gangmanRomDesc[] = { - { "gang man (1988)(armati software)[run'cas-'].cas", 0x02167, 0x39aa53da, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gangman, MSX_gangman, msx_msx) -STD_ROM_FN(MSX_gangman) - -struct BurnDriver BurnDrvMSX_gangman = { - "msx_gangman", NULL, "msx_msx", NULL, "1988", - "Gang Man (Euro)\0", NULL, "Armati Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gangmanRomInfo, MSX_gangmanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Gang Man (Jpn) - -static struct BurnRomInfo MSX_gangmanjRomDesc[] = { - { "gangman (1984)(hudson soft)(jp)[run'cas-'].cas", 0x0228f, 0xe45bc3e0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gangmanj, MSX_gangmanj, msx_msx) -STD_ROM_FN(MSX_gangmanj) - -struct BurnDriver BurnDrvMSX_gangmanj = { - "msx_gangmanj", "msx_gangman", "msx_msx", NULL, "1983", - "Gang Man (Jpn)\0", NULL, "Hudson Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gangmanjRomInfo, MSX_gangmanjRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Forbidden Fruit (Spa) - -static struct BurnRomInfo MSX_ffruitRomDesc[] = { - { "forbidden fruit (1985)(mind games espana)(es)[cload + run].cas", 0x03faf, 0x945a9dd0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ffruit, MSX_ffruit, msx_msx) -STD_ROM_FN(MSX_ffruit) - -struct BurnDriver BurnDrvMSX_ffruit = { - "msx_ffruit", NULL, "msx_msx", NULL, "1985", - "Forbidden Fruit (Spa)\0", NULL, "Mind Games España", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ffruitRomInfo, MSX_ffruitRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasCloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Flash Gordon (Euro) - -static struct BurnRomInfo MSX_flashgorRomDesc[] = { - { "flash gordon (1987)(mastertronic added dimension)(gb)[run'cas-'].cas", 0x12dd8, 0x4acea35f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_flashgor, MSX_flashgor, msx_msx) -STD_ROM_FN(MSX_flashgor) - -struct BurnDriver BurnDrvMSX_flashgor = { - "msx_flashgor", NULL, "msx_msx", NULL, "1987", - "Flash Gordon (Euro)\0", NULL, "Mastertronic Added Dimension", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_flashgorRomInfo, MSX_flashgorRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Firehawk (Euro) - -static struct BurnRomInfo MSX_firehawkRomDesc[] = { - { "firehawk (1987)(players software)(gb)[run'cas-'].cas", 0x0973f, 0xc88425df, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_firehawk, MSX_firehawk, msx_msx) -STD_ROM_FN(MSX_firehawk) - -struct BurnDriver BurnDrvMSX_firehawk = { - "msx_firehawk", NULL, "msx_msx", NULL, "1987", - "Firehawk (Euro)\0", NULL, "Players Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_firehawkRomInfo, MSX_firehawkRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Finders Keepers (Euro) - -static struct BurnRomInfo MSX_findkeepRomDesc[] = { - { "finders keepers (1986)(mastertronic)(gb)[run'cas-'].cas", 0x0a49f, 0x685e2505, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_findkeep, MSX_findkeep, msx_msx) -STD_ROM_FN(MSX_findkeep) - -struct BurnDriver BurnDrvMSX_findkeep = { - "msx_findkeep", NULL, "msx_msx", NULL, "1986", - "Finders Keepers (Euro)\0", NULL, "Mastertronic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_findkeepRomInfo, MSX_findkeepRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Exterminator (Euro) - -static struct BurnRomInfo MSX_exterminRomDesc[] = { - { "exterminator (1987)(eaglesoft)(nl)(en)[run'cas-'][martos].cas", 0x069b0, 0xccec8d53, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_extermin, MSX_extermin, msx_msx) -STD_ROM_FN(MSX_extermin) - -struct BurnDriver BurnDrvMSX_extermin = { - "msx_extermin", NULL, "msx_msx", NULL, "1987", - "Exterminator (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_exterminRomInfo, MSX_exterminRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Dynamite Dan (Euro) - -static struct BurnRomInfo MSX_dynadanRomDesc[] = { - { "dynamite dan (1986)(mirrorsoft)(gb)[bload'cas-',r].cas", 0x0c411, 0x3f349148, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dynadan, MSX_dynadan, msx_msx) -STD_ROM_FN(MSX_dynadan) - -struct BurnDriver BurnDrvMSX_dynadan = { - "msx_dynadan", NULL, "msx_msx", NULL, "1986", - "Dynamite Dan (Euro)\0", NULL, "Mirrorsoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dynadanRomInfo, MSX_dynadanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Drome (Euro) - -static struct BurnRomInfo MSX_dromeRomDesc[] = { - { "drome (1987)(eaglesoft)(nl)[run'cas-'].cas", 0x10040, 0x5d3d2237, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_drome, MSX_drome, msx_msx) -STD_ROM_FN(MSX_drome) - -struct BurnDriver BurnDrvMSX_drome = { - "msx_drome", NULL, "msx_msx", NULL, "1987", - "Drome (Euro)\0", NULL, "Eaglesoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dromeRomInfo, MSX_dromeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Dragon Ninja (Euro) - -static struct BurnRomInfo MSX_dninjaRomDesc[] = { - { "dragon ninja (1988)(imagine software)(gb)[run'cas-'].cas", 0x1a6e4, 0x3c495adc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dninja, MSX_dninja, msx_msx) -STD_ROM_FN(MSX_dninja) - -struct BurnDriver BurnDrvMSX_dninja = { - "msx_dninja", NULL, "msx_msx", NULL, "1988", - "Dragon Ninja (Euro)\0", NULL, "Imagine Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dninjaRomInfo, MSX_dninjaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Dog Fighter (Euro) - -static struct BurnRomInfo MSX_dogfightRomDesc[] = { - { "dog fighter (1986)(kuma computers)(gb)[bload'cas-',r].cas", 0x02196, 0xb2233398, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_dogfight, MSX_dogfight, msx_msx) -STD_ROM_FN(MSX_dogfight) - -struct BurnDriver BurnDrvMSX_dogfight = { - "msx_dogfight", NULL, "msx_msx", NULL, "1986", - "Dog Fighter (Euro)\0", NULL, "Kuma Computers", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_dogfightRomInfo, MSX_dogfightRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Disc Warrior (Euro) - -static struct BurnRomInfo MSX_discwarrRomDesc[] = { - { "disc warrior (1984)(alligata software)(gb)[run'cas-'].cas", 0x0d06f, 0x3999c18f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_discwarr, MSX_discwarr, msx_msx) -STD_ROM_FN(MSX_discwarr) - -struct BurnDriver BurnDrvMSX_discwarr = { - "msx_discwarr", NULL, "msx_msx", NULL, "1984", - "Disc Warrior (Euro)\0", NULL, "Alligata Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_discwarrRomInfo, MSX_discwarrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Destroyer (Spa) - -static struct BurnRomInfo MSX_destroyrRomDesc[] = { - { "destroyer (1986)(mind games espana)(es)[run'cas-'].cas", 0x0c67f, 0xbad9355d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_destroyr, MSX_destroyr, msx_msx) -STD_ROM_FN(MSX_destroyr) - -struct BurnDriver BurnDrvMSX_destroyr = { - "msx_destroyr", NULL, "msx_msx", NULL, "1986", - "Destroyer (Spa)\0", NULL, "Mind Games España", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_destroyrRomInfo, MSX_destroyrRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Desolator (Euro) - -static struct BurnRomInfo MSX_desolatrRomDesc[] = { - { "desolator (1986)(gremlin graphics software)(gb)[bload'cas-',r].cas", 0x06241, 0xb228b187, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_desolatr, MSX_desolatr, msx_msx) -STD_ROM_FN(MSX_desolatr) - -struct BurnDriver BurnDrvMSX_desolatr = { - "msx_desolatr", NULL, "msx_msx", NULL, "1986", - "Desolator (Euro)\0", NULL, "Gremlin Graphics", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_desolatrRomInfo, MSX_desolatrRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Cyberbig (Spa) - -static struct BurnRomInfo MSX_cyberbigRomDesc[] = { - { "cyberbig (1989)(animagic)(es)[run'cas-'].cas", 0x0e72b, 0x99023cf9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cyberbig, MSX_cyberbig, msx_msx) -STD_ROM_FN(MSX_cyberbig) - -struct BurnDriver BurnDrvMSX_cyberbig = { - "msx_cyberbig", NULL, "msx_msx", NULL, "1989", - "Cyberbig (Spa)\0", NULL, "Animagic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cyberbigRomInfo, MSX_cyberbigRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Cosmic Sheriff (Spa) - -static struct BurnRomInfo MSX_csheriffRomDesc[] = { - { "cosmic sheriff (1989)(dinamic software)(es)[run'cas-'].cas", 0x0b7bb, 0xe1984c54, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_csheriff, MSX_csheriff, msx_msx) -STD_ROM_FN(MSX_csheriff) - -struct BurnDriver BurnDrvMSX_csheriff = { - "msx_csheriff", NULL, "msx_msx", NULL, "1989", - "Cosmic Sheriff (Spa)\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_csheriffRomInfo, MSX_csheriffRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Cosa Nostra (Spa) - -static struct BurnRomInfo MSX_cosanostRomDesc[] = { - { "cosa nostra (1986)(opera soft)(es)[bload'cas-',r].cas", 0x0a329, 0xda23ba44, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_cosanost, MSX_cosanost, msx_msx) -STD_ROM_FN(MSX_cosanost) - -struct BurnDriver BurnDrvMSX_cosanost = { - "msx_cosanost", NULL, "msx_msx", NULL, "1986", - "Cosa Nostra (Spa)\0", NULL, "Opera Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_cosanostRomInfo, MSX_cosanostRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Colony (Euro) - -static struct BurnRomInfo MSX_colonyRomDesc[] = { - { "colony (1987)(bulldog)(gb)[run'cas-'].cas", 0x07c22, 0xf6d82b88, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_colony, MSX_colony, msx_msx) -STD_ROM_FN(MSX_colony) - -struct BurnDriver BurnDrvMSX_colony = { - "msx_colony", NULL, "msx_msx", NULL, "1987", - "Colony (Euro)\0", NULL, "Bulldog", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_colonyRomInfo, MSX_colonyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Chuckie Egg (Euro, AandF Software) - -static struct BurnRomInfo MSX_chuckieRomDesc[] = { - { "chuckie egg (1984)(aandf software)[bload'cas-',r].cas", 0x03a54, 0x3c44f316, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chuckie, MSX_chuckie, msx_msx) -STD_ROM_FN(MSX_chuckie) - -struct BurnDriver BurnDrvMSX_chuckie = { - "msx_chuckie", NULL, "msx_msx", NULL, "1984", - "Chuckie Egg (Euro, AandF Software)\0", NULL, "AandF Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chuckieRomInfo, MSX_chuckieRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Chopper One (Euro) - -static struct BurnRomInfo MSX_chopper1RomDesc[] = { - { "chopper one (1988)(eurosoft)(nl)[run'cas-'].cas", 0x0d6d0, 0xefb363a3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chopper1, MSX_chopper1, msx_msx) -STD_ROM_FN(MSX_chopper1) - -struct BurnDriver BurnDrvMSX_chopper1 = { - "msx_chopper1", NULL, "msx_msx", NULL, "1988", - "Chopper One (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chopper1RomInfo, MSX_chopper1RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Chiller (Euro) - -static struct BurnRomInfo MSX_chillerRomDesc[] = { - { "chiller (1985)(mastertronic)(gb)[run'cas-'].cas", 0x0683b, 0xb33086a0, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chiller, MSX_chiller, msx_msx) -STD_ROM_FN(MSX_chiller) - -struct BurnDriver BurnDrvMSX_chiller = { - "msx_chiller", NULL, "msx_msx", NULL, "1985", - "Chiller (Euro)\0", NULL, "Mastertronic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chillerRomInfo, MSX_chillerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Chicken Chase (Euro) - -static struct BurnRomInfo MSX_chickenRomDesc[] = { - { "chicken chase (1986)(bug-byte software)(gb)[run'cas-'].cas", 0x09227, 0x027c7e11, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chicken, MSX_chicken, msx_msx) -STD_ROM_FN(MSX_chicken) - -struct BurnDriver BurnDrvMSX_chicken = { - "msx_chicken", NULL, "msx_msx", NULL, "1986", - "Chicken Chase (Euro)\0", NULL, "Bug-Byte Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chickenRomInfo, MSX_chickenRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Carlos Sainz - Campeonato del Mundo (Spa) - -static struct BurnRomInfo MSX_csainzRomDesc[] = { - { "carlos sainz (1990)(zigurat software)(es)[run'cas-'].cas", 0x1025b, 0xe8eb4c98, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_csainz, MSX_csainz, msx_msx) -STD_ROM_FN(MSX_csainz) - -struct BurnDriver BurnDrvMSX_csainz = { - "msx_csainz", NULL, "msx_msx", NULL, "1990", - "Carlos Sainz - Campeonato del Mundo (Spa)\0", NULL, "Zigurat Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_csainzRomInfo, MSX_csainzRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Buzz Off! (Euro) - -static struct BurnRomInfo MSX_buzzoffRomDesc[] = { - { "buzz off! (1984)(electric software)(gb)[run'cas-'].cas", 0x06cfd, 0x2c76939c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_buzzoff, MSX_buzzoff, msx_msx) -STD_ROM_FN(MSX_buzzoff) - -struct BurnDriver BurnDrvMSX_buzzoff = { - "msx_buzzoff", NULL, "msx_msx", NULL, "1984", - "Buzz Off! (Euro)\0", NULL, "Electric Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_buzzoffRomInfo, MSX_buzzoffRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bumpy (Fra) - -static struct BurnRomInfo MSX_bumpyRomDesc[] = { - { "bumpy (1989)(loriciels)(fr)[run'cas-'].cas", 0x0becb, 0xdc1d5578, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bumpy, MSX_bumpy, msx_msx) -STD_ROM_FN(MSX_bumpy) - -struct BurnDriver BurnDrvMSX_bumpy = { - "msx_bumpy", NULL, "msx_msx", NULL, "1989", - "Bumpy (Fra)\0", NULL, "Loriciels", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bumpyRomInfo, MSX_bumpyRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bronx (Spa) - -static struct BurnRomInfo MSX_bronxRomDesc[] = { - { "bronx (1989)(animagic)(es)[run'cas-'].cas", 0x18fc2, 0x7b6597bf, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bronx, MSX_bronx, msx_msx) -STD_ROM_FN(MSX_bronx) - -struct BurnDriver BurnDrvMSX_bronx = { - "msx_bronx", NULL, "msx_msx", NULL, "1989", - "Bronx (Spa)\0", NULL, "Animagic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bronxRomInfo, MSX_bronxRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Breaker Breaker (Euro) - -static struct BurnRomInfo MSX_breakerRomDesc[] = { - { "breaker breaker (1988)(eurosoft)(nl)[run'cas-'].cas", 0x0e1e8, 0xdeb36e3f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_breaker, MSX_breaker, msx_msx) -STD_ROM_FN(MSX_breaker) - -struct BurnDriver BurnDrvMSX_breaker = { - "msx_breaker", NULL, "msx_msx", NULL, "1988", - "Breaker Breaker (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_breakerRomInfo, MSX_breakerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bounder (Euro) - -static struct BurnRomInfo MSX_bounderRomDesc[] = { - { "bounder (1987)(gremlin graphics software)(gb)[bload'cas-',r].cas", 0x106d2, 0xab5bdc07, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bounder, MSX_bounder, msx_msx) -STD_ROM_FN(MSX_bounder) - -struct BurnDriver BurnDrvMSX_bounder = { - "msx_bounder", NULL, "msx_msx", NULL, "1987", - "Bounder (Euro)\0", NULL, "Gremlin Graphics", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bounderRomInfo, MSX_bounderRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bounce (Euro) - -static struct BurnRomInfo MSX_bounceRomDesc[] = { - { "bounce (1987)(methodic solutions)(nl)[run'cas-'].cas", 0x04c96, 0xddbff717, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bounce, MSX_bounce, msx_msx) -STD_ROM_FN(MSX_bounce) - -struct BurnDriver BurnDrvMSX_bounce = { - "msx_bounce", NULL, "msx_msx", NULL, "1987", - "Bounce (Euro)\0", NULL, "Methodic Solutions", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bounceRomInfo, MSX_bounceRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Boulder Dash II - Rockford's Riot (Euro) - -static struct BurnRomInfo MSX_bdash2RomDesc[] = { - { "boulder dash ii - rockford's riot (1986)(databyte)[run'cas-'].cas", 0x04656, 0xb5bf54a3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bdash2, MSX_bdash2, msx_msx) -STD_ROM_FN(MSX_bdash2) - -struct BurnDriver BurnDrvMSX_bdash2 = { - "msx_bdash2", NULL, "msx_msx", NULL, "1986", - "Boulder Dash II - Rockford's Riot (Euro)\0", NULL, "Databyte", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bdash2RomInfo, MSX_bdash2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bop! (Euro) - -static struct BurnRomInfo MSX_bopRomDesc[] = { - { "bop! (1986)(bug-byte software)(gb)[run'cas-'].cas", 0x0282f, 0xc5463d0c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bop, MSX_bop, msx_msx) -STD_ROM_FN(MSX_bop) - -struct BurnDriver BurnDrvMSX_bop = { - "msx_bop", NULL, "msx_msx", NULL, "1986", - "Bop! (Euro)\0", NULL, "Bug-Byte Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bopRomInfo, MSX_bopRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Booty (Euro) - -static struct BurnRomInfo MSX_bootyRomDesc[] = { - { "booty (1988)(eurosoft)(nl)[run'cas-'].cas", 0x057e8, 0xc20898f4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_booty, MSX_booty, msx_msx) -STD_ROM_FN(MSX_booty) - -struct BurnDriver BurnDrvMSX_booty = { - "msx_booty", NULL, "msx_msx", NULL, "1988", - "Booty (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bootyRomInfo, MSX_bootyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// BMX Simulator (Euro) - -static struct BurnRomInfo MSX_bmxsimRomDesc[] = { - { "bmx simulator (1987)(codemasters)(gb)[run'cas-'].cas", 0x0e69f, 0x234a0f79, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bmxsim, MSX_bmxsim, msx_msx) -STD_ROM_FN(MSX_bmxsim) - -struct BurnDriver BurnDrvMSX_bmxsim = { - "msx_bmxsim", NULL, "msx_msx", NULL, "1987", - "BMX Simulator (Euro)\0", NULL, "Codemasters", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bmxsimRomInfo, MSX_bmxsimRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bloody (Spa) - -static struct BurnRomInfo MSX_bloodyRomDesc[] = { - { "bloody (1987)(p.j. software)(es)[run'cas-'].cas", 0x05b41, 0xeaa520de, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bloody, MSX_bloody, msx_msx) -STD_ROM_FN(MSX_bloody) - -struct BurnDriver BurnDrvMSX_bloody = { - "msx_bloody", NULL, "msx_msx", NULL, "1987", - "Bloody (Spa)\0", NULL, "P.J. Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bloodyRomInfo, MSX_bloodyRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bestial Warrior (Spa) - -static struct BurnRomInfo MSX_bestwarrRomDesc[] = { - { "bestial warrior (1989)(dinamic software)(es)[run'cas-'].cas", 0x100fe, 0x06073712, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bestwarr, MSX_bestwarr, msx_msx) -STD_ROM_FN(MSX_bestwarr) - -struct BurnDriver BurnDrvMSX_bestwarr = { - "msx_bestwarr", NULL, "msx_msx", NULL, "1989", - "Bestial Warrior (Spa)\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_bestwarrRomInfo, MSX_bestwarrRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Barn Stormer (Euro) - -static struct BurnRomInfo MSX_barnstrmRomDesc[] = { - { "barn stormer (1985)(electric software)(gb)[bload'cas-',r].cas", 0x08198, 0x54cf5202, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_barnstrm, MSX_barnstrm, msx_msx) -STD_ROM_FN(MSX_barnstrm) - -struct BurnDriver BurnDrvMSX_barnstrm = { - "msx_barnstrm", NULL, "msx_msx", NULL, "1985", - "Barn Stormer (Euro)\0", NULL, "Electric Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_barnstrmRomInfo, MSX_barnstrmRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Barbarian (Euro) - -static struct BurnRomInfo MSX_barbRomDesc[] = { - { "barbarian (1988)(mastertronic)(es-gb)[run'cas-'].cas", 0x0dfe2, 0xde27937b, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_barb, MSX_barb, msx_msx) -STD_ROM_FN(MSX_barb) - -struct BurnDriver BurnDrvMSX_barb = { - "msx_barb", NULL, "msx_msx", NULL, "1988", - "Barbarian (Euro)\0", NULL, "Mastertronic", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_barbRomInfo, MSX_barbRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - - -// Barbarian II - The Dungeon of Drax (Spa) - -static struct BurnRomInfo MSX_barb2RomDesc[] = { - { "barbarian ii - the dungeon of drax (1988)(erbe software)(es)[run'cas-'].cas", 0x1e162, 0xd557cf7a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_barb2, MSX_barb2, msx_msx) -STD_ROM_FN(MSX_barb2) - -struct BurnDriver BurnDrvMSX_barb2 = { - "msx_barb2", NULL, "msx_msx", NULL, "1988", - "Barbarian II - The Dungeon of Drax (Spa)\0", NULL, "Erbe Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_barb2RomInfo, MSX_barb2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Astro Plumber (Euro) - -static struct BurnRomInfo MSX_astroplmRomDesc[] = { - { "astro plumber (1986)(blue ribbon software)(gb)[run'cas-'][martos].cas", 0x06e97, 0x2e9f6101, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_astroplm, MSX_astroplm, msx_msx) -STD_ROM_FN(MSX_astroplm) - -struct BurnDriver BurnDrvMSX_astroplm = { - "msx_astroplm", NULL, "msx_msx", NULL, "1986", - "Astro Plumber (Euro)\0", NULL, "Blue Ribbon Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_astroplmRomInfo, MSX_astroplmRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Astro Blaster (Euro) - -static struct BurnRomInfo MSX_astroblsRomDesc[] = { - { "astro blaster (1988)(eurosoft)(nl)[run'cas-'].cas", 0x055d8, 0x550da760, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_astrobls, MSX_astrobls, msx_msx) -STD_ROM_FN(MSX_astrobls) - -struct BurnDriver BurnDrvMSX_astrobls = { - "msx_astrobls", NULL, "msx_msx", NULL, "1988", - "Astro Blaster (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_astroblsRomInfo, MSX_astroblsRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Amoto's Puf (Spa) - -static struct BurnRomInfo MSX_amotopufRomDesc[] = { - { "amoto's puf (1988)(spe)(es)[run'cas-'].cas", 0x08248, 0xaa21b91d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_amotopuf, MSX_amotopuf, msx_msx) -STD_ROM_FN(MSX_amotopuf) - -struct BurnDriver BurnDrvMSX_amotopuf = { - "msx_amotopuf", NULL, "msx_msx", NULL, "1988", - "Amoto's Puf (Spa)\0", NULL, "SPE", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_amotopufRomInfo, MSX_amotopufRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Amo del Mundo (Spa) - -static struct BurnRomInfo MSX_amomundoRomDesc[] = { - { "amo del mundo (1990)(positive)(es)[run'cas-'][martos].cas", 0x0bd51, 0x8419ee76, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_amomundo, MSX_amomundo, msx_msx) -STD_ROM_FN(MSX_amomundo) - -struct BurnDriver BurnDrvMSX_amomundo = { - "msx_amomundo", NULL, "msx_msx", NULL, "1990", - "Amo del Mundo (Spa)\0", NULL, "Positive", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_amomundoRomInfo, MSX_amomundoRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Adel (Spa) - -static struct BurnRomInfo MSX_adelRomDesc[] = { - { "adel (1986)(mind games espana)(es)[run'cas-'].cas", 0x0b0c1, 0x62db7bde, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_adel, MSX_adel, msx_msx) -STD_ROM_FN(MSX_adel) - -struct BurnDriver BurnDrvMSX_adel = { - "msx_adel", NULL, "msx_msx", NULL, "1986", - "Adel (Spa)\0", NULL, "Mind Games España", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_adelRomInfo, MSX_adelRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Aaargh! (Spa) - -static struct BurnRomInfo MSX_aaarghRomDesc[] = { - { "aaargh! (1989)(dro soft)(es)[run'cas-'].cas", 0x28364, 0x1cdc6750, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_aaargh, MSX_aaargh, msx_msx) -STD_ROM_FN(MSX_aaargh) - -struct BurnDriver BurnDrvMSX_aaargh = { - "msx_aaargh", NULL, "msx_msx", NULL, "1989", - "Aaargh! (Spa)\0", NULL, "Dro Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_aaarghRomInfo, MSX_aaarghRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// 007 - The Living Daylights (Euro) - -static struct BurnRomInfo MSX_007tldRomDesc[] = { - { "007 - the living daylights (1987)(domark)(gb)[run'cas-'].cas", 0x0b7c6, 0x6eeb8d76, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_007tld, MSX_007tld, msx_msx) -STD_ROM_FN(MSX_007tld) - -struct BurnDriver BurnDrvMSX_007tld = { - "msx_007tld", NULL, "msx_msx", NULL, "1987", - "007 - The Living Daylights (Euro)\0", NULL, "Domark", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_007tldRomInfo, MSX_007tldRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Inspecteur Z - -static struct BurnRomInfo MSX_inspecteurzRomDesc[] = { - { "Buru to Marty Kikiippatsu. Inspecteur Z (1986)(HAL Laboratory)(JP).rom", 0x08000, 0x57a1bfb3, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_inspecteurz, MSX_inspecteurz, msx_msx) -STD_ROM_FN(MSX_inspecteurz) - -struct BurnDriver BurnDrvMSX_inspecteurz = { - "msx_inspecteurz", NULL, "msx_msx", NULL, "1986", - "Buru to Marty Kikiippatsu. Inspecteur Z\0", NULL, "HAL Laboratory", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_inspecteurzRomInfo, MSX_inspecteurzRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Betiled! - -static struct BurnRomInfo MSX_betiledRomDesc[] = { - { "BeTiled!.rom", 0x0c000, 0x4f89a784, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_betiled, MSX_betiled, msx_msx) -STD_ROM_FN(MSX_betiled) - -struct BurnDriver BurnDrvMSX_betiled = { - "msx_betiled", NULL, "msx_msx", NULL, "2007", - "Betiled!\0", NULL, "CEZ GS", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_betiledRomInfo, MSX_betiledRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Lotus F3 - -static struct BurnRomInfo MSX_lotusf3RomDesc[] = { - { "lotusf3.rom", 0x20000, 0x565022a4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lotusf3, MSX_lotusf3, msx_msx) -STD_ROM_FN(MSX_lotusf3) - -struct BurnDriver BurnDrvMSX_lotusf3 = { - "msx_lotusf3", NULL, "msx_msx", NULL, "2007", - "Lotus F3\0", NULL, "dvik & joyrex", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lotusf3RomInfo, MSX_lotusf3RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Mr. Mole - -static struct BurnRomInfo MSX_mrmoleRomDesc[] = { - { "NLKMSX003EN_MrMole_KONAMI5.rom", 0x20000, 0xaa6f2968, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mrmole, MSX_mrmole, msx_msx) -STD_ROM_FN(MSX_mrmole) - -struct BurnDriver BurnDrvMSX_mrmole = { - "msx_mrmole", NULL, "msx_msx", NULL, "2007", - "Mr. Mole\0", NULL, "Nerlaska Studio", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_KONAMI_SCC, GBF_MISC, 0, - MSXGetZipName, MSX_mrmoleRomInfo, MSX_mrmoleRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Altered Beast - -static struct BurnRomInfo MSX_alteredbeastRomDesc[] = { - { "alteredbeast.rom", 0x40000, 0xbb5cd0f1, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alteredbeast, MSX_alteredbeast, msx_msx) -STD_ROM_FN(MSX_alteredbeast) - -struct BurnDriver BurnDrvMSX_alteredbeast = { - "msx_alteredbeast", NULL, "msx_msx", NULL, "1988", - "Altered Beast\0", "Choose 'B' Cursor from menu.", "Activision / Amusement Factory", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alteredbeastRomInfo, MSX_alteredbeastRomName, NULL, NULL, MSXInputInfo, MSXJoyCursorDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Bold - -static struct BurnRomInfo MSX_boldRomDesc[] = { - { "bold.rom", 0x20000, 0x00d02aa4, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_bold, MSX_bold, msx_msx) -STD_ROM_FN(MSX_bold) - -struct BurnDriver BurnDrvMSX_bold = { - "msx_bold", NULL, "msx_msx", NULL, "2009", - "Bold (demo)\0", NULL, "dvik & joyrex", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_boldRomInfo, MSX_boldRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// MSX Unleashed - -static struct BurnRomInfo MSX_unleashedRomDesc[] = { - { "unleashed.rom", 0x40000, 0x10f86aa9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_unleashed, MSX_unleashed, msx_msx) -STD_ROM_FN(MSX_unleashed) - -struct BurnDriver BurnDrvMSX_unleashed = { - "msx_unleashed", NULL, "msx_msx", NULL, "2006", - "MSX Unleashed (demo)\0", NULL, "dvik & joyrex", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX | HARDWARE_MSX_MAPPER_ASCII8, GBF_MISC, 0, - MSXGetZipName, MSX_unleashedRomInfo, MSX_unleashedRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Invasion of the big pixels - -static struct BurnRomInfo MSX_invasionRomDesc[] = { - { "invasion.rom", 0x20000, 0x261c87aa, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_invasion, MSX_invasion, msx_msx) -STD_ROM_FN(MSX_invasion) - -struct BurnDriver BurnDrvMSX_invasion = { - "msx_invasion", NULL, "msx_msx", NULL, "2008", - "Invasion of the big pixels (demo)\0", NULL, "noice", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_invasionRomInfo, MSX_invasionRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Vesikauhu - -static struct BurnRomInfo MSX_vesikauhuRomDesc[] = { - { "Vesikauhu.rom", 0x40000, 0x7392b7c7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_vesikauhu, MSX_vesikauhu, msx_msx) -STD_ROM_FN(MSX_vesikauhu) - -struct BurnDriver BurnDrvMSX_vesikauhu = { - "msx_vesikauhu", NULL, "msx_msx", NULL, "2000", - "Vesikauhu (demo)\0", NULL, "Bandwagon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_vesikauhuRomInfo, MSX_vesikauhuRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Riyadh - -static struct BurnRomInfo MSX_riyadhRomDesc[] = { - { "riyadh.rom", 0x40000, 0x3e207332, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_riyadh, MSX_riyadh, msx_msx) -STD_ROM_FN(MSX_riyadh) - -struct BurnDriver BurnDrvMSX_riyadh = { - "msx_riyadh", NULL, "msx_msx", NULL, "2001", - "Riyadh (demo)\0", NULL, "Bandwagon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_riyadhRomInfo, MSX_riyadhRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Montana John - -static struct BurnRomInfo MSX_montanajohnRomDesc[] = { - { "MJTT.ROM", 0x20000, 0x7b5e126f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_montanajohn, MSX_montanajohn, msx_msx) -STD_ROM_FN(MSX_montanajohn) - -struct BurnDriver BurnDrvMSX_montanajohn = { - "msx_montanajohn", NULL, "msx_msx", NULL, "2008", - "Montana John and the Templar's Treasure\0", NULL, "Infinite", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_montanajohnRomInfo, MSX_montanajohnRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Atsarias - -static struct BurnRomInfo MSX_atsariasRomDesc[] = { - { "atsarias.rom", 0x10000, 0xe7e245de, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_atsarias, MSX_atsarias, msx_msx) -STD_ROM_FN(MSX_atsarias) - -struct BurnDriver BurnDrvMSX_atsarias = { - "msx_atsarias", NULL, "msx_msx", NULL, "2013", - "Atsarias (demo)\0", NULL, "Lieves!Tuore", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_atsariasRomInfo, MSX_atsariasRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Operation Wolf - -static struct BurnRomInfo MSX_opwolfRomDesc[] = { - { "OWMSX1.ROM", 0x08000, 0xe9492c87, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_opwolf, MSX_opwolf, msx_msx) -STD_ROM_FN(MSX_opwolf) - -struct BurnDriver BurnDrvMSX_opwolf = { - "msx_opwolf", NULL, "msx_msx", NULL, "2009", - "Operation Wolf\0", NULL, "TOYBOX", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_opwolfRomInfo, MSX_opwolfRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Lorna (Spa) - -static struct BurnRomInfo MSX_lornaRomDesc[] = { - { "lorna (1990)(topo soft)(es)[run'cas-'].cas", 0x1e3c2, 0x2ae741cc, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_lorna, MSX_lorna, msx_msx) -STD_ROM_FN(MSX_lorna) - -struct BurnDriver BurnDrvMSX_lorna = { - "msx_lorna", NULL, "msx_msx", NULL, "1990", - "Lorna (Spa)\0", NULL, "Topo Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_lornaRomInfo, MSX_lornaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Binary Land - -static struct BurnRomInfo MSX_binarylndRomDesc[] = { - { "Binary Land (1984)(Kuma Computers)(GB).rom", 0x04000, 0xfbacbc7a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_binarylnd, MSX_binarylnd, msx_msx) -STD_ROM_FN(MSX_binarylnd) - -struct BurnDriver BurnDrvMSX_binarylnd = { - "msx_binarylnd", NULL, "msx_msx", NULL, "1984", - "Binary Land\0", NULL, "Kuma Computers", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_binarylndRomInfo, MSX_binarylndRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// WEC Le Mans (Euro) - -static struct BurnRomInfo MSX_weclemanRomDesc[] = { - { "wec le mans (1988)(imagine software)(gb)[run'cas-'].cas", 0x0cc97, 0xb10ac049, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_wecleman, MSX_wecleman, msx_msx) -STD_ROM_FN(MSX_wecleman) - -struct BurnDriver BurnDrvMSX_wecleman = { - "msx_wecleman", NULL, "msx_msx", NULL, "1988", - "WEC Le Mans (Euro)\0", NULL, "Imagine Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_weclemanRomInfo, MSX_weclemanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Nausicaa - -static struct BurnRomInfo MSX_nausicaaRomDesc[] = { - { "nausicaa (japan).rom", 0x04000, 0xe84994f7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_nausicaa, MSX_nausicaa, msx_msx) -STD_ROM_FN(MSX_nausicaa) - -struct BurnDriver BurnDrvMSX_nausicaa = { - "msx_nausicaa", NULL, "msx_msx", NULL, "1984", - "Nausicaa\0", NULL, "Technopolis Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_nausicaaRomInfo, MSX_nausicaaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Invaders Revenge - -static struct BurnRomInfo MSX_invrevengeRomDesc[] = { - { "Invaders Revenge (MMG Software, 19xx).rom", 0x20000, 0x8a899751, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_invrevenge, MSX_invrevenge, msx_msx) -STD_ROM_FN(MSX_invrevenge) - -struct BurnDriver BurnDrvMSX_invrevenge = { - "msx_invrevenge", NULL, "msx_msx", NULL, "19xx", - "Invaders Revenge\0", NULL, "MMG Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_invrevengeRomInfo, MSX_invrevengeRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Hyper Viper - -static struct BurnRomInfo MSX_hyperviperRomDesc[] = { - { "Hyper Viper (1985)(Kuma Computers)[cursorkeys].rom", 0x10000, 0xa88ecd5d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_hyperviper, MSX_hyperviper, msx_msx) -STD_ROM_FN(MSX_hyperviper) - -struct BurnDriver BurnDrvMSX_hyperviper = { - "msx_hyperviper", NULL, "msx_msx", NULL, "1985", - "Hyper Viper\0", NULL, "Kuma Computers", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_hyperviperRomInfo, MSX_hyperviperRomName, NULL, NULL, MSXInputInfo, MSXJoyCursorDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// StratoS (v2) - -static struct BurnRomInfo MSX_stratos2RomDesc[] = { - { "stratos2.rom", 0x04000, 0xe3093554, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_stratos2, MSX_stratos2, msx_msx) -STD_ROM_FN(MSX_stratos2) - -struct BurnDriver BurnDrvMSX_stratos2 = { - "msx_stratos2", NULL, "msx_msx", NULL, "2005", - "StratoS (v2)\0", NULL, "CEZ GS", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_stratos2RomInfo, MSX_stratos2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Addictaball (Euro) - -static struct BurnRomInfo MSX_addictblRomDesc[] = { - { "addictaball (1988)(alligata software)(gb)[run'cas-'].cas", 0x0a54f, 0xa74a1df6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_addictbl, MSX_addictbl, msx_msx) -STD_ROM_FN(MSX_addictbl) - -struct BurnDriver BurnDrvMSX_addictbl = { - "msx_addictbl", NULL, "msx_msx", NULL, "1988", - "Addictaball (Euro)\0", NULL, "Alligata Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_addictblRomInfo, MSX_addictblRomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// The Apeman Strikes Again - -static struct BurnRomInfo MSX_apemanRomDesc[] = { - { "The Apeman Strikes Again (Bytebusters, 1985).rom", 0x10000, 0x395bec07, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_apeman, MSX_apeman, msx_msx) -STD_ROM_FN(MSX_apeman) - -struct BurnDriver BurnDrvMSX_apeman = { - "msx_apeman", NULL, "msx_msx", NULL, "1985", - "The Apeman Strikes Again\0", NULL, "Bytebusters", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_apemanRomInfo, MSX_apemanRomName, NULL, NULL, MSXInputInfo, MSXEuropeDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Balloon Punch - -static struct BurnRomInfo MSX_balloonpunchRomDesc[] = { - { "Balloon Punch (1989)(Satico)(JP).rom", 0x10000, 0xe018a918, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_balloonpunch, MSX_balloonpunch, msx_msx) -STD_ROM_FN(MSX_balloonpunch) - -struct BurnDriver BurnDrvMSX_balloonpunch = { - "msx_balloonpunch", NULL, "msx_msx", NULL, "1989", - "Balloon Punch\0", NULL, "Satico", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_balloonpunchRomInfo, MSX_balloonpunchRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Chubby Gristle - -static struct BurnRomInfo MSX_chubbygristleRomDesc[] = { - { "Chubby Gristle (1988)(Grandslam Entertainments)(GB).rom", 0x20000, 0x28f873f8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chubbygristle, MSX_chubbygristle, msx_msx) -STD_ROM_FN(MSX_chubbygristle) - -struct BurnDriver BurnDrvMSX_chubbygristle = { - "msx_chubbygristle", NULL, "msx_msx", NULL, "1988", - "Chubby Gristle\0", NULL, "Grandslam Entertainments", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chubbygristleRomInfo, MSX_chubbygristleRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Attack Mosquiton - -static struct BurnRomInfo MSX_mosquitonRomDesc[] = { - { "Attack_Mosquiton.cas", 0x33b6, 0xe759ac71, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_mosquiton, MSX_mosquiton, msx_msx) -STD_ROM_FN(MSX_mosquiton) - -struct BurnDriver BurnDrvMSX_mosquiton = { - "msx_mosquiton", NULL, "msx_msx", NULL, "1986", - "Attack Mosquiton\0", NULL, "Shouji Ogawa", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_mosquitonRomInfo, MSX_mosquitonRomName, NULL, NULL, MSXInputInfo, MSXJoyCursor60hzDIPInfo, - CasCloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// The Ghost - -static struct BurnRomInfo MSX_theghostRomDesc[] = { - { "THE_GHOST.CAS", 0x02726, 0x2db14915, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_theghost, MSX_theghost, msx_msx) -STD_ROM_FN(MSX_theghost) - -struct BurnDriver BurnDrvMSX_theghost = { - "msx_theghost", NULL, "msx_msx", NULL, "1987", - "The Ghost\0", NULL, "Teruhiko Matsubara", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_theghostRomInfo, MSX_theghostRomName, NULL, NULL, MSXInputInfo, MSXJoyCursor60hzDIPInfo, - CasCloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Alpha Blaster - -static struct BurnRomInfo MSX_alphablasterRomDesc[] = { - { "Alpha Blaster (1984)(Aackosoft)(NL).rom", 0x10000, 0xf59ce3f6, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alphablaster, MSX_alphablaster, msx_msx) -STD_ROM_FN(MSX_alphablaster) - -struct BurnDriver BurnDrvMSX_alphablaster = { - "msx_alphablaster", NULL, "msx_msx", NULL, "1984", - "Alpha Blaster\0", NULL, "Aackosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alphablasterRomInfo, MSX_alphablasterRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Alpine Ski - -static struct BurnRomInfo MSX_alpineskiRomDesc[] = { - { "Alpine Ski (1987)(Methodic Solutions)(NL).rom", 0x10000, 0x32662af5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_alpineski, MSX_alpineski, msx_msx) -STD_ROM_FN(MSX_alpineski) - -struct BurnDriver BurnDrvMSX_alpineski = { - "msx_alpineski", NULL, "msx_msx", NULL, "1987", - "Alpine Ski\0", NULL, "Methodic Solutions", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_alpineskiRomInfo, MSX_alpineskiRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Chick Fighter. Hiyoko Fighter - -static struct BurnRomInfo MSX_chickfighterRomDesc[] = { - { "Chick Fighter. Hiyoko Fighter (1983)(Honeybee Soft)(JP).rom", 0x10000, 0xd8e1aadb, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_chickfighter, MSX_chickfighter, msx_msx) -STD_ROM_FN(MSX_chickfighter) - -struct BurnDriver BurnDrvMSX_chickfighter = { - "msx_chickfighter", NULL, "msx_msx", NULL, "1983", - "Chick Fighter. Hiyoko Fighter\0", NULL, "Honeybee Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_chickfighterRomInfo, MSX_chickfighterRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Eat It - -static struct BurnRomInfo MSX_eatitRomDesc[] = { - { "Eat It (1986)(Aackosoft)(NL).rom", 0x10000, 0x54851e18, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_eatit, MSX_eatit, msx_msx) -STD_ROM_FN(MSX_eatit) - -struct BurnDriver BurnDrvMSX_eatit = { - "msx_eatit", NULL, "msx_msx", NULL, "1986", - "Eat It\0", NULL, "Aackosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_eatitRomInfo, MSX_eatitRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Galaxia - -static struct BurnRomInfo MSX_galaxiaRomDesc[] = { - { "Galaxia (1985)(Kuma Computers)(GB).rom", 0x10000, 0x180a2b4e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_galaxia, MSX_galaxia, msx_msx) -STD_ROM_FN(MSX_galaxia) - -struct BurnDriver BurnDrvMSX_galaxia = { - "msx_galaxia", NULL, "msx_msx", NULL, "1985", - "Galaxia\0", NULL, "Kuma Computers", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_galaxiaRomInfo, MSX_galaxiaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Infernal Miner - -static struct BurnRomInfo MSX_infernalminerRomDesc[] = { - { "Infernal Miner (1985)(Sprites).rom", 0x10000, 0xa4f88c9e, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_infernalminer, MSX_infernalminer, msx_msx) -STD_ROM_FN(MSX_infernalminer) - -struct BurnDriver BurnDrvMSX_infernalminer = { - "msx_infernalminer", NULL, "msx_msx", NULL, "1985", - "Infernal Miner\0", NULL, "Sprites", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_infernalminerRomInfo, MSX_infernalminerRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Space Mouse - -static struct BurnRomInfo MSX_spacemouseRomDesc[] = { - { "Space Mouse (H. Kobo, 201x).rom", 0x20000, 0xb55702f7, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_spacemouse, MSX_spacemouse, msx_msx) -STD_ROM_FN(MSX_spacemouse) - -struct BurnDriver BurnDrvMSX_spacemouse = { - "msx_spacemouse", NULL, "msx_msx", NULL, "201x", - "Space Mouse\0", NULL, "H. Kobo", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_spacemouseRomInfo, MSX_spacemouseRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Search for Mum - -static struct BurnRomInfo MSX_searchformumRomDesc[] = { - { "Search for Mum (1991)(Triple Soft)[NL].rom", 0x20000, 0xa5ff786f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_searchformum, MSX_searchformum, msx_msx) -STD_ROM_FN(MSX_searchformum) - -struct BurnDriver BurnDrvMSX_searchformum = { - "msx_searchformum", NULL, "msx_msx", NULL, "1991", - "Search for Mum\0", NULL, "Triple Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_searchformumRomInfo, MSX_searchformumRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Tuma 7 - -static struct BurnRomInfo MSX_tuma7RomDesc[] = { - { "Tuma 7 (1990)(Delta Software)(ES).rom", 0x20000, 0x61cb184d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tuma7, MSX_tuma7, msx_msx) -STD_ROM_FN(MSX_tuma7) - -struct BurnDriver BurnDrvMSX_tuma7 = { - "msx_tuma7", NULL, "msx_msx", NULL, "1990", - "Tuma 7\0", NULL, "Delta Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tuma7RomInfo, MSX_tuma7RomName, NULL, NULL, MSXInputInfo, MSXJoyport2DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Perez the Mouse - -static struct BurnRomInfo MSX_perezthemouseRomDesc[] = { - { "Perez the Mouse 1.1 (2011) (theNestruo Wonder).cas", 0x05983, 0xcc8d9d62, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_perezthemouse, MSX_perezthemouse, msx_msx) -STD_ROM_FN(MSX_perezthemouse) - -struct BurnDriver BurnDrvMSX_perezthemouse = { - "msx_perezthemouse", NULL, "msx_msx", NULL, "2011", - "Perez the Mouse\0", NULL, "theNestruo Wonder", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_perezthemouseRomInfo, MSX_perezthemouseRomName, NULL, NULL, MSXInputInfo, MSXJoyCursor60hzDIPInfo, - CasCloadRRDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// La Abadia del Crimen (Spa) - -static struct BurnRomInfo MSX_abadcrimRomDesc[] = { - { "abadia del crimen, la (1988)(opera soft)(es)[bload'cas-',r].cas", 0x195a0, 0x812afd46, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_abadcrim, MSX_abadcrim, msx_msx) -STD_ROM_FN(MSX_abadcrim) - -struct BurnDriver BurnDrvMSX_abadcrim = { - "msx_abadcrim", NULL, "msx_msx", NULL, "1988", - "La Abadia del Crimen (Spa)\0", NULL, "Opera Soft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_abadcrimRomInfo, MSX_abadcrimRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Starquake (Euro) - -static struct BurnRomInfo MSX_starquakRomDesc[] = { - { "starquake (1986)(bubble bus software)(gb)[run'cas-'].cas", 0x0c5c6, 0x2ae2f857, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_starquak, MSX_starquak, msx_msx) -STD_ROM_FN(MSX_starquak) - -struct BurnDriver BurnDrvMSX_starquak = { - "msx_starquak", NULL, "msx_msx", NULL, "1986", - "Starquake (Euro)\0", NULL, "Bubble Bus Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_starquakRomInfo, MSX_starquakRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Batman - The Movie (Euro) - -static struct BurnRomInfo MSX_batmanmvRomDesc[] = { - { "batman - the movie (1989)(ocean software)(gb)(side a)[run'cas-'].cas", 0x1efb5, 0xb51ff961, BRF_PRG | BRF_ESS }, - { "batman - the movie (1989)(ocean software)(gb)(side b)[run'cas-'].cas", 0x195dd, 0x9bf4001d, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_batmanmv, MSX_batmanmv, msx_msx) -STD_ROM_FN(MSX_batmanmv) - -struct BurnDriver BurnDrvMSX_batmanmv = { - "msx_batmanmv", NULL, "msx_msx", NULL, "1989", - "Batman - The Movie (Euro)\0", NULL, "Ocean Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_batmanmvRomInfo, MSX_batmanmvRomName, NULL, NULL, MSXInputInfo, MSXKeyClickDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// International Karate (Euro) - -static struct BurnRomInfo MSX_ikRomDesc[] = { - { "international karate (1986)(endurance games)(gb)[run'cas-'].cas", 0x0ca03, 0xd7eb1d87, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_ik, MSX_ik, msx_msx) -STD_ROM_FN(MSX_ik) - -struct BurnDriver BurnDrvMSX_ik = { - "msx_ik", NULL, "msx_msx", NULL, "1986", - "International Karate (Euro)\0", NULL, "Endurance Games", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_ikRomInfo, MSX_ikRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Quebert (Euro) - -static struct BurnRomInfo MSX_quebertRomDesc[] = { - { "quebert (1988)(eurosoft)(nl)[run'cas-'].cas", 0x08998, 0xf7930f38, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_quebert, MSX_quebert, msx_msx) -STD_ROM_FN(MSX_quebert) - -struct BurnDriver BurnDrvMSX_quebert = { - "msx_quebert", NULL, "msx_msx", NULL, "1988", - "Quebert (Euro)\0", NULL, "Eurosoft", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_quebertRomInfo, MSX_quebertRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Renegade III - The Final Chapter (Euro) - -static struct BurnRomInfo MSX_renegad3RomDesc[] = { - { "renegade iii - the final chapter (1989)(imagine software)(gb)[run'cas-'].cas", 0x184e2, 0x9fc765b8, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_renegad3, MSX_renegad3, msx_msx) -STD_ROM_FN(MSX_renegad3) - -struct BurnDriver BurnDrvMSX_renegad3 = { - "msx_renegad3", NULL, "msx_msx", NULL, "1989", - "Renegade III - The Final Chapter (Euro)\0", NULL, "Imagine Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_renegad3RomInfo, MSX_renegad3RomName, NULL, NULL, MSXInputInfo, MSXKeyClickDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Satan (Euro) - -static struct BurnRomInfo MSX_satanRomDesc[] = { - { "satan (1989)(dinamic software)(es)(en)(side a)[english edition][run'cas-'].cas", 0x0da31, 0x6c16e392, BRF_PRG | BRF_ESS }, - { "satan (1989)(dinamic software)(es)(en)(side b)[english edition][run'cas-'].cas", 0x0da31, 0x10914f8a, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_satan, MSX_satan, msx_msx) -STD_ROM_FN(MSX_satan) - -struct BurnDriver BurnDrvMSX_satan = { - "msx_satan", NULL, "msx_msx", NULL, "1989", - "Satan (Euro)\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_satanRomInfo, MSX_satanRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Speedboat Racer (Euro) - -static struct BurnRomInfo MSX_sbracerRomDesc[] = { - { "speedboat racer (1987)(methodic solutions)(nl)[run'cas-'].cas", 0x0c8d8, 0xa90435f9, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_sbracer, MSX_sbracer, msx_msx) -STD_ROM_FN(MSX_sbracer) - -struct BurnDriver BurnDrvMSX_sbracer = { - "msx_sbracer", NULL, "msx_msx", NULL, "1987", - "Speedboat Racer (Euro)\0", NULL, "Methodic Solutions", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_sbracerRomInfo, MSX_sbracerRomName, NULL, NULL, MSXInputInfo, MSXJoyCursor60hzDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Thunderbirds (Euro) - -static struct BurnRomInfo MSX_tbirds1aRomDesc[] = { - { "thunderbirds (1989)(grandslam entertainments)(gb)(tape 1 of 2 side a)[bload'cas-',r][martos].cas", 0x11b71, 0x04456b16, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tbirds1a, MSX_tbirds1a, msx_msx) -STD_ROM_FN(MSX_tbirds1a) - -struct BurnDriver BurnDrvMSX_tbirds1a = { - "msx_tbirds1a", NULL, "msx_msx", NULL, "1989", - "Thunderbirds Tape 1 Side A (Euro)\0", NULL, "Grandslam Entertainments", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tbirds1aRomInfo, MSX_tbirds1aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Thunderbirds (Euro) - -static struct BurnRomInfo MSX_tbirds1bRomDesc[] = { - { "thunderbirds (1989)(grandslam entertainments)(gb)(tape 1 of 2 side b)[bload'cas-',r][martos].cas", 0x11b71, 0xc4b0130c, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tbirds1b, MSX_tbirds1b, msx_msx) -STD_ROM_FN(MSX_tbirds1b) - -struct BurnDriver BurnDrvMSX_tbirds1b = { - "msx_tbirdst1b", "msx_tbirds1a", "msx_msx", NULL, "1989", - "Thunderbirds Tape 1 Side B (Euro)\0", NULL, "Grandslam Entertainments", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tbirds1bRomInfo, MSX_tbirds1bRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Thunderbirds (Euro) - -static struct BurnRomInfo MSX_tbirds2aRomDesc[] = { - { "thunderbirds (1989)(grandslam entertainments)(gb)(tape 2 of 2 side a)[bload'cas-',r][martos].cas", 0x11b71, 0xc986703f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tbirds2a, MSX_tbirds2a, msx_msx) -STD_ROM_FN(MSX_tbirds2a) - -struct BurnDriver BurnDrvMSX_tbirds2a = { - "msx_tbirdst2a", "msx_tbirds1a", "msx_msx", NULL, "1989", - "Thunderbirds Tape 2 Side A (Euro)\0", NULL, "Grandslam Entertainments", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tbirds2aRomInfo, MSX_tbirds2aRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Thunderbirds (Euro) - -static struct BurnRomInfo MSX_tbirds2bRomDesc[] = { - { "thunderbirds (1989)(grandslam entertainments)(gb)(tape 2 of 2 side b)[bload'cas-',r][martos].cas", 0x11b71, 0x1bcb9d6f, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_tbirds2b, MSX_tbirds2b, msx_msx) -STD_ROM_FN(MSX_tbirds2b) - -struct BurnDriver BurnDrvMSX_tbirds2b = { - "msx_tbirdst2b", "msx_tbirds1a", "msx_msx", NULL, "1989", - "Thunderbirds Tape 2 Side B (Euro)\0", NULL, "Grandslam Entertainments", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_tbirds2bRomInfo, MSX_tbirds2bRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasBloadDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Game Over II (Spa) - -static struct BurnRomInfo MSX_gameovr2RomDesc[] = { - { "game over ii (1988)(dinamic software)(es)(side a)[re-release of phantis][run'cas-'].cas", 0x0c3c3, 0x12de1170, BRF_PRG | BRF_ESS }, - { "game over ii (1988)(dinamic software)(es)(side b)[re-release of phantis][run'cas-'].cas", 0x0bffd, 0x994cd2a2, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_gameovr2, MSX_gameovr2, msx_msx) -STD_ROM_FN(MSX_gameovr2) - -struct BurnDriver BurnDrvMSX_gameovr2 = { - "msx_gameovr2", NULL, "msx_msx", NULL, "1988", - "Game Over II (Spa)\0", NULL, "Dinamic Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_gameovr2RomInfo, MSX_gameovr2RomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Sea King (Euro) - -static struct BurnRomInfo MSX_seakingRomDesc[] = { - { "sea king (1986)(players software)(gb)[run'cas-'].cas", 0x082ff, 0xb29571ed, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_seaking, MSX_seaking, msx_msx) -STD_ROM_FN(MSX_seaking) - -struct BurnDriver BurnDrvMSX_seaking = { - "msx_seaking", NULL, "msx_msx", NULL, "1986", - "Sea King (Euro)\0", NULL, "Players Software", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_seakingRomInfo, MSX_seakingRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - CasRunDrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Maxima (Euro) - -static struct BurnRomInfo MSX_maximaRomDesc[] = { - { "Maxima (1984)(PSS)(GB).rom", 0x10000, 0xc9c5b360, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_maxima, MSX_maxima, msx_msx) -STD_ROM_FN(MSX_maxima) - -struct BurnDriver BurnDrvMSX_maxima = { - "msx_maxima", NULL, "msx_msx", NULL, "1984", - "Maxima (Euro)\0", NULL, "PSS", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_maximaRomInfo, MSX_maximaRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - -// Transball (v1.3.2) - -static struct BurnRomInfo MSX_transballRomDesc[] = { - { "transball-en.rom", 0x08000, 0xcbcf03c5, BRF_PRG | BRF_ESS }, -}; - -STDROMPICKEXT(MSX_transball, MSX_transball, msx_msx) -STD_ROM_FN(MSX_transball) - -struct BurnDriver BurnDrvMSX_transball = { - "msx_transball", NULL, "msx_msx", NULL, "2005", - "Transball (v1.3.2)\0", NULL, "Santiago Ontanon", "MSX", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MSX, GBF_MISC, 0, - MSXGetZipName, MSX_transballRomInfo, MSX_transballRomName, NULL, NULL, MSXInputInfo, MSXDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, 0x10, - 272, 228, 4, 3 -}; - diff --git a/jan/src/burn/drv/neogeo/d_neogeo.cpp b/jan/src/burn/drv/neogeo/d_neogeo.cpp deleted file mode 100644 index 379b8a140..000000000 --- a/jan/src/burn/drv/neogeo/d_neogeo.cpp +++ /dev/null @@ -1,16612 +0,0 @@ -// FB Alpha Neo Geo driver module - -#include "neogeo.h" -#include "bitswap.h" - -#if !defined ROM_VERIFY - // enable to match Neo Geo BIOS to MAME's (also affects dipswitches -- leaves only the MVS BIOS option) - // #define ROM_VERIFY -#endif - -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; - -// ----------------------------------------------------------------------------- -// Common data - -static struct BurnInputInfo neogeoInputList[] = { - {"P1 Coin", BIT_DIGITAL, NeoButton2 + 0, "p1 coin"}, // 0 -// {"P1 Coin 2", BIT_DIGITAL, NeoButton2 + 3, "p1 coin 2"}, - {"P1 Start", BIT_DIGITAL, NeoButton1 + 0, "p1 start"}, // 1 - {"P1 Select", BIT_DIGITAL, NeoButton1 + 1, "p1 select"}, // 2 - - {"P1 Up", BIT_DIGITAL, NeoJoy1 + 0, "p1 up"}, // 3 - {"P1 Down", BIT_DIGITAL, NeoJoy1 + 1, "p1 down"}, // 4 - {"P1 Left", BIT_DIGITAL, NeoJoy1 + 2, "p1 left"}, // 5 - {"P1 Right", BIT_DIGITAL, NeoJoy1 + 3, "p1 right"}, // 6 - {"P1 Button A", BIT_DIGITAL, NeoJoy1 + 4, "p1 fire 1"}, // 7 - {"P1 Button B", BIT_DIGITAL, NeoJoy1 + 5, "p1 fire 2"}, // 8 - {"P1 Button C", BIT_DIGITAL, NeoJoy1 + 6, "p1 fire 3"}, // 9 - {"P1 Button D", BIT_DIGITAL, NeoJoy1 + 7, "p1 fire 4"}, // A - - {"P2 Coin", BIT_DIGITAL, NeoButton2 + 1, "p2 coin"}, // B -// {"P2 Coin 2", BIT_DIGITAL, NeoButton2 + 4, "p2 coin 2"}, - {"P2 Start", BIT_DIGITAL, NeoButton1 + 2, "p2 start"}, // C - {"P2 Select", BIT_DIGITAL, NeoButton1 + 3, "p2 select"}, // D - - {"P2 Up", BIT_DIGITAL, NeoJoy2 + 0, "p2 up"}, // E - {"P2 Down", BIT_DIGITAL, NeoJoy2 + 1, "p2 down"}, // F - {"P2 Left", BIT_DIGITAL, NeoJoy2 + 2, "p2 left"}, // 10 - {"P2 Right", BIT_DIGITAL, NeoJoy2 + 3, "p2 right"}, // 11 - {"P2 Button A", BIT_DIGITAL, NeoJoy2 + 4, "p2 fire 1"}, // 12 - {"P2 Button B", BIT_DIGITAL, NeoJoy2 + 5, "p2 fire 2"}, // 13 - {"P2 Button C", BIT_DIGITAL, NeoJoy2 + 6, "p2 fire 3"}, // 14 - {"P2 Button D", BIT_DIGITAL, NeoJoy2 + 7, "p2 fire 4"}, // 15 - - {"Reset", BIT_DIGITAL, &NeoReset, "reset"}, // 16 - {"Test", BIT_DIGITAL, NeoDiag + 0, "diag"}, // 17 - {"Service", BIT_DIGITAL, NeoButton2 + 2, "service"}, // 18 - {"Dip 1", BIT_DIPSWITCH, NeoInput + 4, "dip"}, // 19 - {"Dip 2", BIT_DIPSWITCH, NeoInput + 5, "dip"}, // 1A - - {"System", BIT_DIPSWITCH, &NeoSystem, "dip"}, // 1B - {"Slots", BIT_DIPSWITCH, &nNeoNumSlots, "dip"}, // 1C - - {"Debug Dip 1", BIT_DIPSWITCH, NeoDebugDip + 0,"dip"}, // 1D - {"Debug Dip 2", BIT_DIPSWITCH, NeoDebugDip + 1,"dip"}, // 1E -}; - -STDINPUTINFO(neogeo) - -static struct BurnInputInfo neoMVSInputList[] = { - {"P1 Coin", BIT_DIGITAL, NeoButton2 + 0, "p1 coin"}, // 0 -// {"P1 Coin 2", BIT_DIGITAL, NeoButton2 + 3, "p1 coin 2"}, - {"P1 Start", BIT_DIGITAL, NeoButton1 + 0, "p1 start"}, // 1 - {"P1 Select", BIT_DIGITAL, NeoButton1 + 1, "p1 select"}, // 2 - - {"P1 Up", BIT_DIGITAL, NeoJoy1 + 0, "p1 up"}, // 3 - {"P1 Down", BIT_DIGITAL, NeoJoy1 + 1, "p1 down"}, // 4 - {"P1 Left", BIT_DIGITAL, NeoJoy1 + 2, "p1 left"}, // 5 - {"P1 Right", BIT_DIGITAL, NeoJoy1 + 3, "p1 right"}, // 6 - {"P1 Button A", BIT_DIGITAL, NeoJoy1 + 4, "p1 fire 1"}, // 7 - {"P1 Button B", BIT_DIGITAL, NeoJoy1 + 5, "p1 fire 2"}, // 8 - {"P1 Button C", BIT_DIGITAL, NeoJoy1 + 6, "p1 fire 3"}, // 9 - {"P1 Button D", BIT_DIGITAL, NeoJoy1 + 7, "p1 fire 4"}, // A - - {"P2 Coin", BIT_DIGITAL, NeoButton2 + 1, "p2 coin"}, // B -// {"P2 Coin 2", BIT_DIGITAL, NeoButton2 + 4, "p2 coin 2"}, - {"P2 Start", BIT_DIGITAL, NeoButton1 + 2, "p2 start"}, // C - {"P2 Select", BIT_DIGITAL, NeoButton1 + 3, "p2 select"}, // D - - {"P2 Up", BIT_DIGITAL, NeoJoy2 + 0, "p2 up"}, // E - {"P2 Down", BIT_DIGITAL, NeoJoy2 + 1, "p2 down"}, // F - {"P2 Left", BIT_DIGITAL, NeoJoy2 + 2, "p2 left"}, // 10 - {"P2 Right", BIT_DIGITAL, NeoJoy2 + 3, "p2 right"}, // 11 - {"P2 Button A", BIT_DIGITAL, NeoJoy2 + 4, "p2 fire 1"}, // 12 - {"P2 Button B", BIT_DIGITAL, NeoJoy2 + 5, "p2 fire 2"}, // 13 - {"P2 Button C", BIT_DIGITAL, NeoJoy2 + 6, "p2 fire 3"}, // 14 - {"P2 Button D", BIT_DIGITAL, NeoJoy2 + 7, "p2 fire 4"}, // 15 - - {"Reset", BIT_DIGITAL, &NeoReset, "reset"}, // 16 - {"Test", BIT_DIGITAL, NeoDiag + 0, "diag"}, // 17 - {"Service", BIT_DIGITAL, NeoButton2 + 2, "service"}, // 18 - {"Dip 1", BIT_DIPSWITCH, NeoInput + 4, "dip"}, // 19 - {"Dip 2", BIT_DIPSWITCH, NeoInput + 5, "dip"}, // 1A - - {"System", BIT_DIPSWITCH, &NeoSystem, "dip"}, // 1B - - {"Debug Dip 1", BIT_DIPSWITCH, NeoDebugDip + 0,"dip"}, // 1C - {"Debug Dip 2", BIT_DIPSWITCH, NeoDebugDip + 1,"dip"}, // 1D -}; - -STDINPUTINFO(neoMVS) - -static struct BurnDIPInfo ms5pcbDIPList[] = { - // Offset - {0x19, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x02, 0xFF, 0xFF, 0x86, NULL}, - - {0, 0xFE, 0, 2, "Autofire"}, - {0x0D, 0x01, 0x04, 0x00, "Off"}, - {0x0D, 0x01, 0x04, 0x04, "On"}, - - // DIP 1 - {0, 0xFE, 0, 2, "Setting mode"}, - {0x00, 0x01, 0x01, 0x00, "Off"}, - {0x00, 0x01, 0x01, 0x01, "On"}, - - // 1 or 2 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x02, 0x02, 0x00, "1"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x02, 0x02, 0x02, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - // 2 or 4 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x82, 0x02, 0x00, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x82, 0x02, 0x02, "4"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - - {0, 0xFE, 0, 5, "Commmunicaton"}, - {0x00, 0x01, 0x38, 0x00, "Disabled"}, - {0x00, 0x01, 0x38, 0x08, "Setting 1"}, - {0x00, 0x01, 0x38, 0x10, "Setting 2"}, - {0x00, 0x01, 0x38, 0x18, "Setting 3"}, - {0x00, 0x01, 0x38, 0x20, "Setting 4"}, - {0x00, 0x01, 0x38, 0x28, "Setting 5"}, - {0x00, 0x01, 0x38, 0x30, "Setting 6"}, - {0x00, 0x01, 0x38, 0x38, "Setting 7"}, - {0, 0xFE, 0, 2, "Free play"}, - {0x00, 0x01, 0x40, 0x00, "Off"}, - {0x00, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Stop mode"}, - {0x00, 0x01, 0x80, 0x00, "Off"}, - {0x00, 0x01, 0x80, 0x80, "On"}, - - // Region - {0, 0xFD, 0, 2, "Region"}, - {0x02, 0x02, 0x03, 0x02, "Asia / Europe"}, - {0x02, 0x00, 0x30, 0x00, NULL}, - {0x02, 0x02, 0x03, 0x03, "Japan"}, - {0x02, 0x00, 0x30, 0x00, NULL}, -}; - -STDDIPINFO(ms5pcb) - -static struct BurnDIPInfo svcpcbDIPList[] = { - // Offset - {0x19, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x02, 0xFF, 0xFF, 0x86, NULL}, - - {0, 0xFE, 0, 2, "Autofire"}, - {0x0D, 0x01, 0x04, 0x00, "Off"}, - {0x0D, 0x01, 0x04, 0x04, "On"}, - - // DIP 1 - {0, 0xFE, 0, 2, "Setting mode"}, - {0x00, 0x01, 0x01, 0x00, "Off"}, - {0x00, 0x01, 0x01, 0x01, "On"}, - - // 1 or 2 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x02, 0x02, 0x00, "1"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x02, 0x02, 0x02, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - // 2 or 4 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x82, 0x02, 0x00, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x82, 0x02, 0x02, "4"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - - {0, 0xFE, 0, 5, "Commmunicaton"}, - {0x00, 0x01, 0x38, 0x00, "Disabled"}, - {0x00, 0x01, 0x38, 0x08, "Setting 1"}, - {0x00, 0x01, 0x38, 0x10, "Setting 2"}, - {0x00, 0x01, 0x38, 0x18, "Setting 3"}, - {0x00, 0x01, 0x38, 0x20, "Setting 4"}, - {0x00, 0x01, 0x38, 0x28, "Setting 5"}, - {0x00, 0x01, 0x38, 0x30, "Setting 6"}, - {0x00, 0x01, 0x38, 0x38, "Setting 7"}, - {0, 0xFE, 0, 2, "Free play"}, - {0x00, 0x01, 0x40, 0x00, "Off"}, - {0x00, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Stop mode"}, - {0x00, 0x01, 0x80, 0x00, "Off"}, - {0x00, 0x01, 0x80, 0x80, "On"}, - - // Region - {0, 0xFD, 0, 2, "Region"}, - {0x02, 0x02, 0x03, 0x02, "Asia / Europe"}, - {0x02, 0x00, 0x30, 0x00, NULL}, - {0x02, 0x02, 0x03, 0x03, "Japan"}, - {0x02, 0x00, 0x30, 0x00, NULL}, -}; - -STDDIPINFO(svcpcb) - -static struct BurnDIPInfo kf2k3pcbDIPList[] = { - // Offset - {0x19, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x02, 0xFF, 0xFF, 0x86, NULL}, - - {0, 0xFE, 0, 2, "Autofire"}, - {0x0D, 0x01, 0x04, 0x00, "Off"}, - {0x0D, 0x01, 0x04, 0x04, "On"}, - - // DIP 1 - {0, 0xFE, 0, 2, "Setting mode"}, - {0x00, 0x01, 0x01, 0x00, "Off"}, - {0x00, 0x01, 0x01, 0x01, "On"}, - - // 1 or 2 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x02, 0x02, 0x00, "1"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x02, 0x02, 0x02, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - // 2 or 4 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x82, 0x02, 0x00, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x82, 0x02, 0x02, "4"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - - {0, 0xFE, 0, 8, "Commmunicaton"}, - {0x00, 0x01, 0x38, 0x00, "Disabled"}, - {0x00, 0x01, 0x38, 0x08, "Setting 1"}, - {0x00, 0x01, 0x38, 0x10, "Setting 2"}, - {0x00, 0x01, 0x38, 0x18, "Setting 3"}, - {0x00, 0x01, 0x38, 0x20, "Setting 4"}, - {0x00, 0x01, 0x38, 0x28, "Setting 5"}, - {0x00, 0x01, 0x38, 0x30, "Setting 6"}, - {0x00, 0x01, 0x38, 0x38, "Setting 7"}, - {0, 0xFE, 0, 2, "Free play"}, - {0x00, 0x01, 0x40, 0x00, "Off"}, - {0x00, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Stop mode"}, - {0x00, 0x01, 0x80, 0x00, "Off"}, - {0x00, 0x01, 0x80, 0x80, "On"}, -}; - -STDDIPINFO(kf2k3pcb) - -static struct BurnInputInfo neoCDInputList[] = { - {"P1 Start", BIT_DIGITAL, NeoButton1 + 0, "p1 start"}, // 0 - {"P1 Select", BIT_DIGITAL, NeoButton1 + 1, "p1 select"}, // 1 - - {"P1 Up", BIT_DIGITAL, NeoJoy1 + 0, "p1 up"}, // 2 - {"P1 Down", BIT_DIGITAL, NeoJoy1 + 1, "p1 down"}, // 3 - {"P1 Left", BIT_DIGITAL, NeoJoy1 + 2, "p1 left"}, // 4 - {"P1 Right", BIT_DIGITAL, NeoJoy1 + 3, "p1 right"}, // 5 - {"P1 Button A", BIT_DIGITAL, NeoJoy1 + 4, "p1 fire 1"}, // 6 - {"P1 Button B", BIT_DIGITAL, NeoJoy1 + 5, "p1 fire 2"}, // 7 - {"P1 Button C", BIT_DIGITAL, NeoJoy1 + 6, "p1 fire 3"}, // 8 - {"P1 Button D", BIT_DIGITAL, NeoJoy1 + 7, "p1 fire 4"}, // 9 - - {"P2 Start", BIT_DIGITAL, NeoButton1 + 2, "p2 start"}, // A - {"P2 Select", BIT_DIGITAL, NeoButton1 + 3, "p2 select"}, // B - - {"P2 Up", BIT_DIGITAL, NeoJoy2 + 0, "p2 up"}, // C - {"P2 Down", BIT_DIGITAL, NeoJoy2 + 1, "p2 down"}, // D - {"P2 Left", BIT_DIGITAL, NeoJoy2 + 2, "p2 left"}, // E - {"P2 Right", BIT_DIGITAL, NeoJoy2 + 3, "p2 right"}, // F - {"P2 Button A", BIT_DIGITAL, NeoJoy2 + 4, "p2 fire 1"}, // 10 - {"P2 Button B", BIT_DIGITAL, NeoJoy2 + 5, "p2 fire 2"}, // 11 - {"P2 Button C", BIT_DIGITAL, NeoJoy2 + 6, "p2 fire 3"}, // 12 - {"P2 Button D", BIT_DIGITAL, NeoJoy2 + 7, "p2 fire 4"}, // 13 - - {"Reset", BIT_DIGITAL, &NeoReset, "reset"}, // 14 - {"Test", BIT_DIGITAL, NeoDiag + 0, "diag"}, // 15 - - {"System", BIT_DIPSWITCH, &NeoSystem, "dip"}, // 16 -}; - -STDINPUTINFO(neoCD) - -#define A(a, b, c, d) { a, b, (UINT8*)(c), d } - -static struct BurnInputInfo neopaddleInputList[] = { - {"P1 Coin", BIT_DIGITAL, NeoButton2 + 0, "p1 coin"}, // 0 - {"P1 Start", BIT_DIGITAL, NeoButton1 + 0, "p1 start"}, // 1 - {"P1 Select", BIT_DIGITAL, NeoButton1 + 1, "p1 select"}, // 2 - - {"P1 Up", BIT_DIGITAL, NeoJoy1 + 0, "p1 up"}, // 3 - {"P1 Down", BIT_DIGITAL, NeoJoy1 + 1, "p1 down"}, // 4 - {"P1 Left", BIT_DIGITAL, NeoJoy1 + 2, "p1 left"}, // 5 - {"P1 Right", BIT_DIGITAL, NeoJoy1 + 3, "p1 right"}, // 6 - {"P1 Button A", BIT_DIGITAL, NeoJoy1 + 4, "p1 fire 1"}, // 7 - {"P1 Button B", BIT_DIGITAL, NeoJoy1 + 5, "p1 fire 2"}, // 8 - {"P1 Button C", BIT_DIGITAL, NeoJoy1 + 6, "p1 fire 3"}, // 9 - {"P1 Button D", BIT_DIGITAL, NeoJoy1 + 7, "mouse button 1"}, // A - A("P1 Paddle", BIT_ANALOG_REL, NeoAxis + 0, "mouse x-axis"), // B - - {"P2 Coin", BIT_DIGITAL, NeoButton2 + 1, "p2 coin"}, // C - {"P2 Start", BIT_DIGITAL, NeoButton1 + 2, "p2 start"}, // D - {"P2 Select", BIT_DIGITAL, NeoButton1 + 3, "p2 select"}, // E - - {"P2 Up", BIT_DIGITAL, NeoJoy2 + 0, "p2 up"}, // F - {"P2 Down", BIT_DIGITAL, NeoJoy2 + 1, "p2 down"}, // 10 - {"P2 Left", BIT_DIGITAL, NeoJoy2 + 2, "p2 left"}, // 11 - {"P2 Right", BIT_DIGITAL, NeoJoy2 + 3, "p2 right"}, // 12 - {"P2 Button A", BIT_DIGITAL, NeoJoy2 + 4, "p2 fire 1"}, // 13 - {"P2 Button B", BIT_DIGITAL, NeoJoy2 + 5, "p2 fire 2"}, // 14 - {"P2 Button C", BIT_DIGITAL, NeoJoy2 + 6, "p2 fire 3"}, // 15 - {"P2 Button D", BIT_DIGITAL, NeoJoy2 + 7, "p2 fire 4"}, // 16 - A("P2 Paddle", BIT_ANALOG_REL, NeoAxis + 1, "p2 x-axis"), // 17 - - {"Reset", BIT_DIGITAL, &NeoReset, "reset"}, // 18 - {"Test", BIT_DIGITAL, NeoDiag + 0, "diag"}, // 19 - {"Service", BIT_DIGITAL, NeoButton2 + 2, "service"}, // 1A - {"Dip 1", BIT_DIPSWITCH, NeoInput + 4, "dip"}, // 1B - {"Dip 2", BIT_DIPSWITCH, NeoInput + 5, "dip"}, // 1C - - {"System", BIT_DIPSWITCH, &NeoSystem, "dip"}, // 1D - {"Slots", BIT_DIPSWITCH, &nNeoNumSlots, "dip"}, // 1E - - {"Debug Dip 1", BIT_DIPSWITCH, NeoDebugDip + 0,"dip"}, // 1F - {"Debug Dip 2", BIT_DIPSWITCH, NeoDebugDip + 1,"dip"}, // 1G -}; - -STDINPUTINFO(neopaddle) - -static struct BurnInputInfo neotrackballInputList[] = { - {"P1 Coin", BIT_DIGITAL, NeoButton2 + 0, "p1 coin"}, // 0 - {"P1 Start", BIT_DIGITAL, NeoButton1 + 0, "p1 start"}, // 1 - - A("P1 X Axis", BIT_ANALOG_REL, NeoAxis + 0, "mouse x-axis"), // 2 - A("P1 Y Axis", BIT_ANALOG_REL, NeoAxis + 1, "mouse y-axis"), // 3 - - {"P1 Button A", BIT_DIGITAL, NeoJoy2 + 4, "mouse button 1"}, // 4 - {"P1 Button B", BIT_DIGITAL, NeoJoy2 + 5, "mouse button 2"}, // 5 - - {"P2 Coin", BIT_DIGITAL, NeoButton2 + 1, "p2 coin"}, // 6 - {"P2 Start", BIT_DIGITAL, NeoButton1 + 2, "p2 start"}, // 7 - - {"P2 Button A", BIT_DIGITAL, NeoJoy2 + 6, "p2 fire 1"}, // 8 - {"P2 Button B", BIT_DIGITAL, NeoJoy2 + 7, "p2 fire 2"}, // 9 - - {"Reset", BIT_DIGITAL, &NeoReset, "reset"}, // A - {"Test", BIT_DIGITAL, NeoDiag + 0, "diag"}, // B - {"Service", BIT_DIGITAL, NeoButton2 + 2, "service"}, // C - {"Dip 1", BIT_DIPSWITCH, NeoInput + 4, "dip"}, // D - {"Dip 2", BIT_DIPSWITCH, NeoInput + 5, "dip"}, // E - - {"System", BIT_DIPSWITCH, &NeoSystem, "dip"}, // F - {"Slots", BIT_DIPSWITCH, &nNeoNumSlots, "dip"}, // 10 - - {"Debug Dip 1", BIT_DIPSWITCH, NeoDebugDip + 0,"dip"}, // 11 - {"Debug Dip 2", BIT_DIPSWITCH, NeoDebugDip + 1,"dip"}, // 12 -}; - -STDINPUTINFO(neotrackball) - -#undef A - -static struct BurnInputInfo neodualInputList[] = { - {"P1 Coin", BIT_DIGITAL, NeoButton2 + 0, "p1 coin"}, // 0 - {"P1 Start", BIT_DIGITAL, NeoButton1 + 0, "p1 start"}, // 1 - {"P1 Select", BIT_DIGITAL, NeoButton1 + 1, "p1 select"}, // 2 - - {"P1 Up", BIT_DIGITAL, NeoJoy1 + 0, "p1 up"}, // 3 - {"P1 Down", BIT_DIGITAL, NeoJoy1 + 1, "p1 down"}, // 4 - {"P1 Left", BIT_DIGITAL, NeoJoy1 + 2, "p1 left"}, // 5 - {"P1 Right", BIT_DIGITAL, NeoJoy1 + 3, "p1 right"}, // 6 - {"P1 Button A", BIT_DIGITAL, NeoJoy1 + 4, "p1 fire 1"}, // 7 - {"P1 Button B", BIT_DIGITAL, NeoJoy1 + 5, "p1 fire 2"}, // 8 - {"P1 Button C", BIT_DIGITAL, NeoJoy1 + 6, "p1 fire 3"}, // 9 - {"P1 Button D", BIT_DIGITAL, NeoJoy1 + 7, "p1 fire 4"}, // A - - {"P2 Coin", BIT_DIGITAL, NeoButton2 + 1, "p2 coin"}, // B - {"P2 Start", BIT_DIGITAL, NeoButton1 + 2, "p2 start"}, // C - {"P2 Select", BIT_DIGITAL, NeoButton1 + 3, "p2 select"}, // D - - {"P2 Up", BIT_DIGITAL, NeoJoy2 + 0, "p2 up"}, // E - {"P2 Down", BIT_DIGITAL, NeoJoy2 + 1, "p2 down"}, // F - {"P2 Left", BIT_DIGITAL, NeoJoy2 + 2, "p2 left"}, // 10 - {"P2 Right", BIT_DIGITAL, NeoJoy2 + 3, "p2 right"}, // 11 - {"P2 Button A", BIT_DIGITAL, NeoJoy2 + 4, "p2 fire 1"}, // 12 - {"P2 Button B", BIT_DIGITAL, NeoJoy2 + 5, "p2 fire 2"}, // 13 - {"P2 Button C", BIT_DIGITAL, NeoJoy2 + 6, "p2 fire 3"}, // 14 - {"P2 Button D", BIT_DIGITAL, NeoJoy2 + 7, "p2 fire 4"}, // 15 - - {"P3 Coin", BIT_DIGITAL, NeoButton4 + 0, "p3 coin"}, // 16 - {"P3 Start", BIT_DIGITAL, NeoButton3 + 0, "p3 start"}, // 17 - {"P3 Select", BIT_DIGITAL, NeoButton3 + 1, "p3 select"}, // 18 - - {"P3 Up", BIT_DIGITAL, NeoJoy3 + 0, "p3 up"}, // 19 - {"P3 Down", BIT_DIGITAL, NeoJoy3 + 1, "p3 down"}, // 1A - {"P3 Left", BIT_DIGITAL, NeoJoy3 + 2, "p3 left"}, // 1B - {"P3 Right", BIT_DIGITAL, NeoJoy3 + 3, "p3 right"}, // 1C - {"P3 Button A", BIT_DIGITAL, NeoJoy3 + 4, "p3 fire 1"}, // 1D - {"P3 Button B", BIT_DIGITAL, NeoJoy3 + 5, "p3 fire 2"}, // 1E - {"P3 Button C", BIT_DIGITAL, NeoJoy3 + 6, "p3 fire 3"}, // 1F - {"P3 Button D", BIT_DIGITAL, NeoJoy3 + 7, "p3 fire 4"}, // 20 - - {"P4 Coin", BIT_DIGITAL, NeoButton4 + 1, "p4 coin"}, // 21 - {"P4 Start", BIT_DIGITAL, NeoButton3 + 2, "p4 start"}, // 22 - {"P4 Select", BIT_DIGITAL, NeoButton3 + 3, "p4 select"}, // 23 - - {"P4 Up", BIT_DIGITAL, NeoJoy4 + 0, "p4 up"}, // 24 - {"P4 Down", BIT_DIGITAL, NeoJoy4 + 1, "p4 down"}, // 25 - {"P4 Left", BIT_DIGITAL, NeoJoy4 + 2, "p4 left"}, // 26 - {"P4 Right", BIT_DIGITAL, NeoJoy4 + 3, "p4 right"}, // 27 - {"P4 Button A", BIT_DIGITAL, NeoJoy4 + 4, "p4 fire 1"}, // 28 - {"P4 Button B", BIT_DIGITAL, NeoJoy4 + 5, "p4 fire 2"}, // 29 - {"P4 Button C", BIT_DIGITAL, NeoJoy4 + 6, "p4 fire 3"}, // 2A - {"P4 Button D", BIT_DIGITAL, NeoJoy4 + 7, "p4 fire 4"}, // 2B - - {"Reset", BIT_DIGITAL, &NeoReset, "reset"}, // 2C - - {"Test 1", BIT_DIGITAL, NeoDiag + 0, "diag"}, // 2D - {"Service 1", BIT_DIGITAL, NeoButton2 + 2, "service"}, // 2E - {"Test 2", BIT_DIGITAL, NeoDiag + 1, ""}, // 2F - {"Service 2", BIT_DIGITAL, NeoButton4 + 2, ""}, // 30 - - {"Dip 1", BIT_DIPSWITCH, NeoInput + 4, "dip"}, // 31 - {"Dip 2", BIT_DIPSWITCH, NeoInput + 5, "dip"}, // 32 - - {"System", BIT_DIPSWITCH, &NeoSystem, "dip"}, // 33 - {"Slots", BIT_DIPSWITCH, &nNeoNumSlots, "dip"}, // 34 - - {"Debug Dip 1", BIT_DIPSWITCH, NeoDebugDip + 0,"dip"}, // 35 - {"Debug Dip 2", BIT_DIPSWITCH, NeoDebugDip + 1,"dip"}, // 36 -}; - -STDINPUTINFO(neodual) - -static struct BurnInputInfo neomahjongInputList[] = { - {"P1 Coin", BIT_DIGITAL, NeoButton2 + 0, "p1 coin"}, // 0 - {"P1 Start", BIT_DIGITAL, NeoButton1 + 0, "p1 start"}, // 1 - {"P1 Select", BIT_DIGITAL, NeoButton1 + 1, "p1 select"}, // 2 - - {"P1 Up", BIT_DIGITAL, NeoJoy1 + 0, "p1 up"}, // 3 - {"P1 Down", BIT_DIGITAL, NeoJoy1 + 1, "p1 down"}, // 4 - {"P1 Left", BIT_DIGITAL, NeoJoy1 + 2, "p1 left"}, // 5 - {"P1 Right", BIT_DIGITAL, NeoJoy1 + 3, "p1 right"}, // 6 - {"P1 Button A", BIT_DIGITAL, NeoJoy1 + 4, "p1 fire 1"}, // 7 - {"P1 Button B", BIT_DIGITAL, NeoJoy1 + 5, "p1 fire 2"}, // 8 - {"P1 Button C", BIT_DIGITAL, NeoJoy1 + 6, "p1 fire 3"}, // 9 - {"P1 Button D", BIT_DIGITAL, NeoJoy1 + 7, "p1 fire 4"}, // A - - {"A", BIT_DIGITAL, NeoButton1 + 8, "key tab"}, // B - {"B", BIT_DIGITAL, NeoButton1 + 9, "key q"}, // C - {"C", BIT_DIGITAL, NeoButton1 + 10, "key w"}, // D - {"D", BIT_DIGITAL, NeoButton1 + 11, "key e"}, // E - {"E", BIT_DIGITAL, NeoButton1 + 12, "key r"}, // F - {"F", BIT_DIGITAL, NeoButton1 + 13, "key t"}, // 10 - {"G", BIT_DIGITAL, NeoButton1 + 14, "key y"}, // 11 - {"H", BIT_DIGITAL, NeoButton1 + 16, "key u"}, // 12 - {"I", BIT_DIGITAL, NeoButton1 + 17, "key i"}, // 13 - {"J", BIT_DIGITAL, NeoButton1 + 18, "key o"}, // 14 - {"K", BIT_DIGITAL, NeoButton1 + 19, "key p"}, // 15 - {"L", BIT_DIGITAL, NeoButton1 + 20, "key ["}, // 16 - {"M", BIT_DIGITAL, NeoButton1 + 21, "key ]"}, // 17 - {"N", BIT_DIGITAL, NeoButton1 + 22, "key backslash"}, // 18 - {"Pon", BIT_DIGITAL, NeoButton1 + 24, "key a"}, // 19 - {"Chi", BIT_DIGITAL, NeoButton1 + 25, "key s"}, // 1A - {"Kan", BIT_DIGITAL, NeoButton1 + 26, "key d"}, // 1B - {"Ron", BIT_DIGITAL, NeoButton1 + 27, "key f"}, // 1C - {"Reach", BIT_DIGITAL, NeoButton1 + 28, "key g"}, // 1D - - {"P2 Coin", BIT_DIGITAL, NeoButton2 + 1, "p2 coin"}, // 1E - {"P2 Start", BIT_DIGITAL, NeoButton1 + 2, "p2 start"}, // 1F - {"P2 Select", BIT_DIGITAL, NeoButton1 + 3, "p2 select"}, // 20 - - {"P2 Up", BIT_DIGITAL, NeoJoy2 + 0, "p2 up"}, // 21 - {"P2 Down", BIT_DIGITAL, NeoJoy2 + 1, "p2 down"}, // 22 - {"P2 Left", BIT_DIGITAL, NeoJoy2 + 2, "p2 left"}, // 23 - {"P2 Right", BIT_DIGITAL, NeoJoy2 + 3, "p2 right"}, // 24 - {"P2 Button A", BIT_DIGITAL, NeoJoy2 + 4, "p2 fire 1"}, // 25 - {"P2 Button B", BIT_DIGITAL, NeoJoy2 + 5, "p2 fire 2"}, // 26 - {"P2 Button C", BIT_DIGITAL, NeoJoy2 + 6, "p2 fire 3"}, // 27 - {"P2 Button D", BIT_DIGITAL, NeoJoy2 + 7, "p2 fire 4"}, // 28 - - {"Reset", BIT_DIGITAL, &NeoReset, "reset"}, // 29 - {"Test", BIT_DIGITAL, NeoDiag + 0, "diag"}, // 2A - {"Service", BIT_DIGITAL, NeoButton2 + 2, "service"}, // 2B - {"Dip 1", BIT_DIPSWITCH, NeoInput + 4, "dip"}, // 2C - {"Dip 2", BIT_DIPSWITCH, NeoInput + 5, "dip"}, // 2D - - {"System", BIT_DIPSWITCH, &NeoSystem, "dip"}, // 2E - {"Slots", BIT_DIPSWITCH, &nNeoNumSlots, "dip"}, // 2F - - {"Debug Dip 1", BIT_DIPSWITCH, NeoDebugDip + 0,"dip"}, // 30 - {"Debug Dip 2", BIT_DIPSWITCH, NeoDebugDip + 1,"dip"}, // 31 -}; - -STDINPUTINFO(neomahjong) - -static struct BurnInputInfo vlinerInputList[] = { - {"P1 Coin", BIT_DIGITAL, NeoButton2 + 0, "p1 coin"}, - {"P1 Payout", BIT_DIGITAL, NeoButton1 + 0, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, NeoJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, NeoJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, NeoJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, NeoJoy1 + 3, "p1 right"}, - {"P1 Big", BIT_DIGITAL, NeoJoy1 + 4, "p1 fire 1"}, - {"P1 Small", BIT_DIGITAL, NeoJoy1 + 5, "p1 fire 2"}, - {"P1 Double Up", BIT_DIGITAL, NeoJoy1 + 6, "p1 fire 3"}, - {"P1 Start/Collect", BIT_DIGITAL, NeoJoy1 + 7, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, NeoButton2 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, NeoButton1 + 2, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, NeoJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, NeoJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, NeoJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, NeoJoy2 + 3, "p2 right"}, - {"P2 Button A", BIT_DIGITAL, NeoJoy2 + 4, "p2 fire 1"}, - {"P2 Button B", BIT_DIGITAL, NeoJoy2 + 5, "p2 fire 2"}, - {"P2 Button C", BIT_DIGITAL, NeoJoy2 + 6, "p2 fire 3"}, - {"P2 Button D", BIT_DIGITAL, NeoJoy2 + 7, "p2 fire 4"}, - - {"Operator Menu", BIT_DIGITAL, NeoButton2 + 4, "op menu"}, - {"Clear Credit", BIT_DIGITAL, NeoButton2 + 5, "clear credit"}, - {"Hopper Out", BIT_DIGITAL, NeoButton2 + 7, "hopper"}, - - {"Reset", BIT_DIGITAL, &NeoReset, "reset"}, - {"Test", BIT_DIGITAL, NeoDiag + 0, "diag"}, - {"Dip 1", BIT_DIPSWITCH, NeoInput + 4, "dip"}, - {"Dip 2", BIT_DIPSWITCH, NeoInput + 5, "dip"}, - - {"System", BIT_DIPSWITCH, &NeoSystem, "dip"}, - {"Slots", BIT_DIPSWITCH, &nNeoNumSlots, "dip"}, - - {"Debug Dip 1", BIT_DIPSWITCH, NeoDebugDip + 0,"dip"}, - {"Debug Dip 2", BIT_DIPSWITCH, NeoDebugDip + 1,"dip"}, -}; - -STDINPUTINFO(vliner) - -static struct BurnDIPInfo neodefaultDIPList[] = { - // Offset - {0x19, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x02, 0xFF, 0xFF, 0x80, NULL}, - {0x03, 0xFF, 0xFF, 0x01, NULL}, - - {0, 0xFE, 0, 2, "Autofire"}, - {0x00, 0x01, 0x04, 0x00, "Off"}, - {0x00, 0x01, 0x04, 0x04, "On"}, -}; - -static struct BurnDIPInfo neousadefaultDIPList[] = { - // Offset - {0x19, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x02, 0xFF, 0xFF, 0x83, NULL}, - {0x03, 0xFF, 0xFF, 0x02, NULL}, - - {0, 0xFE, 0, 2, "Autofire"}, - {0x00, 0x01, 0x04, 0x00, "Off"}, - {0x00, 0x01, 0x04, 0x04, "On"}, -}; - -static struct BurnDIPInfo neounidefaultDIPList[] = { - // Offset - {0x19, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x02, 0xFF, 0xFF, 0x8f, NULL}, - {0x03, 0xFF, 0xFF, 0x02, NULL}, - - {0, 0xFE, 0, 2, "Autofire"}, - {0x00, 0x01, 0x04, 0x00, "Off"}, - {0x00, 0x01, 0x04, 0x04, "On"}, -}; - -static struct BurnDIPInfo neopaddleDIPList[] = { - // Offset - {0x1B, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x02, 0xFF, 0xFF, 0x80, NULL}, - {0x03, 0xFF, 0xFF, 0x01, NULL}, -}; - -static struct BurnDIPInfo neodualDIPList[] = { - // Offset - {0x31, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x02, 0xFF, 0xFF, 0x80, NULL}, - {0x03, 0xFF, 0xFF, 0x01, NULL}, - - {0, 0xFE, 0, 2, "Autofire"}, - {0x00, 0x01, 0x04, 0x00, "Off"}, - {0x00, 0x01, 0x04, 0x04, "On"}, -}; - -static struct BurnDIPInfo neomahjongDIPList[] = { - // Offset - {0x2C, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x02, 0xFF, 0xFF, 0x80, NULL}, - {0x03, 0xFF, 0xFF, 0x01, NULL}, - - {0, 0xFE, 0, 2, "Mahjong control panel"}, - {0x00, 0x01, 0x04, 0x00, "Off"}, - {0x00, 0x01, 0x04, 0x04, "On"}, -}; - -static struct BurnDIPInfo neogeoDIPList[] = { - // DIP 1 - {0, 0xFE, 0, 2, "Setting mode"}, - {0x00, 0x01, 0x01, 0x00, "Off"}, - {0x00, 0x01, 0x01, 0x01, "On"}, - - // 1 or 2 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x02, 0x02, 0x00, "1"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x02, 0x02, 0x02, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - // 2 or 4 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x82, 0x02, 0x00, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x82, 0x02, 0x02, "4"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - - {0, 0xFE, 0, 5, "Commmunicaton"}, - {0x00, 0x01, 0x38, 0x00, "Disabled"}, - {0x00, 0x01, 0x38, 0x08, "Setting 1"}, - {0x00, 0x01, 0x38, 0x10, "Setting 2"}, - {0x00, 0x01, 0x38, 0x18, "Setting 3"}, - {0x00, 0x01, 0x38, 0x20, "Setting 4"}, - {0x00, 0x01, 0x38, 0x28, "Setting 5"}, - {0x00, 0x01, 0x38, 0x30, "Setting 6"}, - {0x00, 0x01, 0x38, 0x38, "Setting 7"}, - {0, 0xFE, 0, 2, "Free play"}, - {0x00, 0x01, 0x40, 0x00, "Off"}, - {0x00, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Stop mode"}, - {0x00, 0x01, 0x80, 0x00, "Off"}, - {0x00, 0x01, 0x80, 0x80, "On"}, - - // Fake DIPs - // BIOS - {0, 0xFD, 0, 29, "BIOS" }, - {0x02, 0x01, 0x1f, 0x00, "MVS Asia/Europe ver. 6 (1 slot)" }, - {0x02, 0x01, 0x1f, 0x01, "MVS Asia/Europe ver. 5 (1 slot)" }, - {0x02, 0x01, 0x1f, 0x02, "MVS Asia/Europe ver. 3 (4 slot)" }, - {0x02, 0x01, 0x1f, 0x03, "MVS USA ver. 5 (2 slot)" }, - {0x02, 0x01, 0x1f, 0x04, "MVS USA ver. 5 (4 slot)" }, - {0x02, 0x01, 0x1f, 0x05, "MVS USA ver. 5 (6 slot)" }, - {0x02, 0x01, 0x1f, 0x06, "MVS Japan ver. 6 (? slot)" }, - {0x02, 0x01, 0x1f, 0x07, "MVS Japan ver. 5 (? slot)" }, - {0x02, 0x01, 0x1f, 0x08, "MVS Japan ver. 3 (4 slot)" }, - {0x02, 0x01, 0x1f, 0x09, "NEO-MVH MV1C" }, - {0x02, 0x01, 0x1f, 0x0a, "MVS Japan (J3)" }, - {0x02, 0x01, 0x1f, 0x0b, "AES Japan" }, - {0x02, 0x01, 0x1f, 0x0c, "AES Asia" }, - {0x02, 0x01, 0x1f, 0x0d, "Development Kit" }, - {0x02, 0x01, 0x1f, 0x0e, "Deck ver. 6 (Git Ver 1.3)" }, - {0x02, 0x01, 0x1f, 0x0f, "Universe BIOS ver. 3.2" }, - {0x02, 0x01, 0x1f, 0x10, "Universe BIOS ver. 3.1" }, - {0x02, 0x01, 0x1f, 0x11, "Universe BIOS ver. 3.0" }, - {0x02, 0x01, 0x1f, 0x12, "Universe BIOS ver. 2.3" }, - {0x02, 0x01, 0x1f, 0x13, "Universe BIOS ver. 2.3 (alt)" }, - {0x02, 0x01, 0x1f, 0x14, "Universe BIOS ver. 2.2" }, - {0x02, 0x01, 0x1f, 0x15, "Universe BIOS ver. 2.1" }, - {0x02, 0x01, 0x1f, 0x16, "Universe BIOS ver. 2.0" }, - {0x02, 0x01, 0x1f, 0x17, "Universe BIOS ver. 1.3" }, - {0x02, 0x01, 0x1f, 0x18, "Universe BIOS ver. 1.2" }, - {0x02, 0x01, 0x1f, 0x19, "Universe BIOS ver. 1.2 (alt)" }, - {0x02, 0x01, 0x1f, 0x1a, "Universe BIOS ver. 1.1" }, - {0x02, 0x01, 0x1f, 0x1b, "Universe BIOS ver. 1.0" }, - {0x02, 0x01, 0x1f, 0x1c, "NeoOpen BIOS v0.1 beta" }, - - // Memory card - {0, 0xFD, 0, 2, "Memory card"}, - {0x02, 0x01, 0x80, 0x80, "Writable"}, - {0x02, 0x01, 0x80, 0x00, "Write-protected"}, - {0, 0xFD, 0, 2, "New card type"}, - {0x02, 0x01, 0x40, 0x40, "1 Megabit"}, - {0x02, 0x01, 0x40, 0x00, "Normal"}, -}; - -STDDIPINFOEXT(neogeo, neodefault, neogeo) -STDDIPINFOEXT(neopaddle, neopaddle, neogeo) -STDDIPINFOEXT(neodual, neodual, neogeo) -STDDIPINFOEXT(neomahjong, neomahjong, neogeo) -STDDIPINFOEXT(neogeousa, neousadefault, neogeo) -STDDIPINFOEXT(neogeouni, neounidefault, neogeo) - -static struct BurnDIPInfo neoKOFDIPList[] = { - // Offset - {0x19, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x00, NULL}, - {0x01, 0xFF, 0x7F, 0x00, NULL}, - - {0, 0xFE, 0, 2, "Autofire"}, - {0x00, 0x01, 0x04, 0x00, "Off"}, - {0x00, 0x01, 0x04, 0x04, "On"}, - - // DIP 1 - {0, 0xFE, 0, 2, "Setting mode"}, - {0x00, 0x01, 0x01, 0x00, "Off"}, - {0x00, 0x01, 0x01, 0x01, "On"}, - - // 1 or 2 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x02, 0x02, 0x00, "1"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x02, 0x02, 0x02, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - // 2 or 4 coin slots - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x00, 0x82, 0x02, 0x00, "2"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - {0x00, 0x82, 0x02, 0x02, "4"}, - {0x02, 0x00, 0x3F, 0x06, NULL}, - - {0, 0xFE, 0, 5, "Commmunicaton"}, - {0x00, 0x01, 0x38, 0x00, "Disabled"}, - {0x00, 0x01, 0x38, 0x08, "Setting 1"}, - {0x00, 0x01, 0x38, 0x10, "Setting 2"}, - {0x00, 0x01, 0x38, 0x18, "Setting 3"}, - {0x00, 0x01, 0x38, 0x20, "Setting 4"}, - {0x00, 0x01, 0x38, 0x28, "Setting 5"}, - {0x00, 0x01, 0x38, 0x30, "Setting 6"}, - {0x00, 0x01, 0x38, 0x38, "Setting 7"}, - {0, 0xFE, 0, 2, "Free play"}, - {0x00, 0x01, 0x40, 0x00, "Off"}, - {0x00, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Stop mode"}, - {0x00, 0x01, 0x80, 0x00, "Off"}, - {0x00, 0x01, 0x80, 0x80, "On"}, -}; - -static struct BurnDIPInfo neoFakeDIPList[] = { - // default - {0x02, 0xFF, 0xFF, 0x80, NULL}, - - // Fake DIPs - // BIOS - {0, 0xFD, 0, 29, "BIOS" }, - {0x02, 0x01, 0x1f, 0x00, "MVS Asia/Europe ver. 6 (1 slot)" }, - {0x02, 0x01, 0x1f, 0x01, "MVS Asia/Europe ver. 5 (1 slot)" }, - {0x02, 0x01, 0x1f, 0x02, "MVS Asia/Europe ver. 3 (4 slot)" }, - {0x02, 0x01, 0x1f, 0x03, "MVS USA ver. 5 (2 slot)" }, - {0x02, 0x01, 0x1f, 0x04, "MVS USA ver. 5 (4 slot)" }, - {0x02, 0x01, 0x1f, 0x05, "MVS USA ver. 5 (6 slot)" }, - {0x02, 0x01, 0x1f, 0x06, "MVS Japan ver. 6 (? slot)" }, - {0x02, 0x01, 0x1f, 0x07, "MVS Japan ver. 5 (? slot)" }, - {0x02, 0x01, 0x1f, 0x08, "MVS Japan ver. 3 (4 slot)" }, - {0x02, 0x01, 0x1f, 0x09, "NEO-MVH MV1C" }, - {0x02, 0x01, 0x1f, 0x0a, "MVS Japan (J3)" }, - {0x02, 0x01, 0x1f, 0x0b, "AES Japan" }, - {0x02, 0x01, 0x1f, 0x0c, "AES Asia" }, - {0x02, 0x01, 0x1f, 0x0d, "Development Kit" }, - {0x02, 0x01, 0x1f, 0x0e, "Deck ver. 6 (Git Ver 1.3)" }, - {0x02, 0x01, 0x1f, 0x0f, "Universe BIOS ver. 3.2" }, - {0x02, 0x01, 0x1f, 0x10, "Universe BIOS ver. 3.1" }, - {0x02, 0x01, 0x1f, 0x11, "Universe BIOS ver. 3.0" }, - {0x02, 0x01, 0x1f, 0x12, "Universe BIOS ver. 2.3" }, - {0x02, 0x01, 0x1f, 0x13, "Universe BIOS ver. 2.3 (alt)" }, - {0x02, 0x01, 0x1f, 0x14, "Universe BIOS ver. 2.2" }, - {0x02, 0x01, 0x1f, 0x15, "Universe BIOS ver. 2.1" }, - {0x02, 0x01, 0x1f, 0x16, "Universe BIOS ver. 2.0" }, - {0x02, 0x01, 0x1f, 0x17, "Universe BIOS ver. 1.3" }, - {0x02, 0x01, 0x1f, 0x18, "Universe BIOS ver. 1.2" }, - {0x02, 0x01, 0x1f, 0x19, "Universe BIOS ver. 1.2 (alt)" }, - {0x02, 0x01, 0x1f, 0x1a, "Universe BIOS ver. 1.1" }, - {0x02, 0x01, 0x1f, 0x1b, "Universe BIOS ver. 1.0" }, - {0x02, 0x01, 0x1f, 0x1c, "NeoOpen BIOS v0.1 beta" }, - - // Memory card - {0, 0xFD, 0, 2, "Memory card"}, - {0x02, 0x01, 0x80, 0x80, "Writable"}, - {0x02, 0x01, 0x80, 0x00, "Write-protected"}, - {0, 0xFD, 0, 2, "New card type"}, - {0x02, 0x01, 0x40, 0x40, "1 Megabit"}, - {0x02, 0x01, 0x40, 0x00, "Normal"}, -}; - -STDDIPINFOEXT(neoMVS, neoKOF, neoFake) - -static struct BurnDIPInfo neoCDDIPList[] = { - // Offset - {0x16, 0xF0, 0x00, 0x00, NULL}, - - // Defaults - {0x00, 0xFF, 0xFF, 0x02, NULL}, - - // Region - {0, 0xFE, 0, 4, "Region"}, - {0x00, 0x01, 0x03, 0x00, "Japan"}, - {0x00, 0x01, 0x03, 0x01, "USA"}, - {0x00, 0x01, 0x03, 0x02, "Europe"}, - {0x00, 0x01, 0x03, 0x03, "Portugese"}, - -#if 0 - - // Memory card - {0, 0xFD, 0, 2, "Memory card"}, - {0x00, 0x01, 0x80, 0x80, "Writable"}, - {0x00, 0x01, 0x80, 0x00, "Write-protected"}, - {0, 0xFD, 0, 2, "New card type"}, - {0x00, 0x01, 0x40, 0x40, "1 Megabit"}, - {0x00, 0x01, 0x40, 0x00, "Normal"}, - -#endif - -}; - -STDDIPINFO(neoCD) - -static struct BurnDIPInfo neotrackballDIPList[] = { - // Defaults - {0x0D, 0xFF, 0xFF, 0x00, NULL}, - {0x0E, 0xFF, 0x7F, 0x00, NULL}, - // Fake DIPs - {0x0F, 0xFF, 0xFF, 0x86, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Setting mode"}, - {0x0D, 0x01, 0x01, 0x00, "Off"}, - {0x0D, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x0D, 0x01, 0x02, 0x00, "1"}, - {0x0D, 0x01, 0x02, 0x02, "2"}, - {0, 0xFE, 0, 2, "Autofire"}, - {0x0D, 0x01, 0x04, 0x00, "Off"}, - {0x0D, 0x01, 0x04, 0x04, "On"}, - {0, 0xFE, 0, 5, "Commmunicaton"}, - {0x0D, 0x01, 0x38, 0x00, "Disabled"}, - {0x0D, 0x01, 0x38, 0x08, "Setting 1"}, - {0x0D, 0x01, 0x38, 0x10, "Setting 2"}, - {0x0D, 0x01, 0x38, 0x18, "Setting 3"}, - {0x0D, 0x01, 0x38, 0x20, "Setting 4"}, - {0x0D, 0x01, 0x38, 0x28, "Setting 5"}, - {0x0D, 0x01, 0x38, 0x30, "Setting 6"}, - {0x0D, 0x01, 0x38, 0x38, "Setting 7"}, - {0, 0xFE, 0, 2, "Free play"}, - {0x0D, 0x01, 0x40, 0x00, "Off"}, - {0x0D, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Stop mode"}, - {0x0D, 0x01, 0x80, 0x00, "Off"}, - {0x0D, 0x01, 0x80, 0x80, "On"}, - - // MVS/AES system - {0, 0xFD, 0, 2, NULL}, - {0x0F, 0x02, 0x04, 0x04, "MVS system"}, - {0x0F, 0x00, 0x30, 0x00, NULL}, - {0x0F, 0x02, 0x04, 0x00, "AES system"}, - {0x0F, 0x00, 0x30, 0x00, NULL}, - // Region - {0, 0xFD, 0, 3, "Region"}, - {0x0F, 0x01, 0x03, 0x00, "Japan"}, - {0x0F, 0x01, 0x03, 0x01, "USA"}, - {0x0F, 0x01, 0x03, 0x02, "Asia / Europe"}, - {0x0F, 0x01, 0x03, 0x03, "Japan"}, - - // Memory card - {0, 0xFD, 0, 2, "Memory card"}, - {0x0F, 0x01, 0x80, 0x80, "Writable"}, - {0x0F, 0x01, 0x80, 0x00, "Write-protected"}, - {0, 0xFD, 0, 2, "Default card type"}, - {0x0F, 0x01, 0x40, 0x40, "1 Megabit"}, - {0x0F, 0x01, 0x40, 0x00, "Normal"}, -}; - -STDDIPINFO(neotrackball) - -// Rom information -static struct BurnRomInfo neogeoRomDesc[] = { - { "asia-s3.rom", 0x20000, 0x91b64be3, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT }, // 0 MVS Asia/Europe ver. 6 (1 slot) - { "sp-s2.sp1", 0x20000, 0x9036d879, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 1 MVS Asia/Europe ver. 5 (1 slot) - { "sp-s.sp1", 0x20000, 0xc7f2fa45, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 2 MVS Asia/Europe ver. 3 (4 slot) - { "sp-u2.sp1", 0x20000, 0xe72943de, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 3 MVS USA ver. 5 (2 slot) - { "v2.bin", 0x20000, 0x62f021f4, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 4 MVS USA ver. 5 (4 slot) - { "sp-e.sp1", 0x20000, 0x2723a5b5, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 5 MVS USA ver. 5 (6 slot) - { "vs-bios.rom", 0x20000, 0xf0e8f27d, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 6 MVS Japan ver. 6 (? slot) - { "sp-j2.sp1", 0x20000, 0xacede59C, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 7 MVS Japan ver. 5 (? slot) - { "sp1.jipan.1024", 0x20000, 0x9fb0abe4, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 8 MVS Japan ver. 3 (4 slot) - { "sp-45.sp1", 0x80000, 0x03cc9f6a, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 9 NEO-MVH MV1C - { "japan-j3.bin", 0x20000, 0xdff6d41f, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 10 MVS Japan (J3) -#if !defined (ROM_VERIFY) - { "neo-po.bin", 0x20000, 0x16d0c132, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 11 AES Japan - { "neo-epo.bin", 0x20000, 0xd27a71f1, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 12 AES Asia - { "neodebug.bin", 0x20000, 0x698ebb7d, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 13 Development Kit -#else - { "", 0x00000, 0x00000000, 0 }, // 11 - { "", 0x00000, 0x00000000, 0 }, // 12 - { "", 0x00000, 0x00000000, 0 }, // 13 -#endif - { "sp-1v1_3db8c.bin", 0x20000, 0x162f0ebe, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 14 Deck ver. 6 (Git Ver 1.3) - { "uni-bios_3_2.rom", 0x20000, 0xa4e8b9b3, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 15 Universe BIOS ver. 3.2 (free) - { "uni-bios_3_1.rom", 0x20000, 0x0c58093f, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 16 Universe BIOS ver. 3.1 (free) - { "uni-bios_3_0.rom", 0x20000, 0xa97c89a9, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 17 Universe BIOS ver. 3.0 (free) - { "uni-bios_2_3.rom", 0x20000, 0x27664eb5, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 18 Universe BIOS ver. 2.3 - { "uni-bios_2_3o.rom", 0x20000, 0x601720ae, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 19 Universe BIOS ver. 2.3 (alt) - { "uni-bios_2_2.rom", 0x20000, 0x2d50996a, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 20 Universe BIOS ver. 2.2 - { "uni-bios_2_1.rom", 0x20000, 0x8dabf76b, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 21 Universe BIOS ver. 2.1 - { "uni-bios_2_0.rom", 0x20000, 0x0c12c2ad, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 22 Universe BIOS ver. 2.0 - { "uni-bios_1_3.rom", 0x20000, 0xb24b44a0, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 23 Universe BIOS ver. 1.3 - { "uni-bios_1_2.rom", 0x20000, 0x4fa698e9, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 24 Universe BIOS ver. 1.2 - { "uni-bios_1_2o.rom", 0x20000, 0xe19d3ce9, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 25 Universe BIOS ver. 1.2 (alt) - { "uni-bios_1_1.rom", 0x20000, 0x5dda0d84, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 26 Universe BIOS ver. 1.1 - { "uni-bios_1_0.rom", 0x20000, 0x0ce453a0, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 27 Universe BIOS ver. 1.0 -#if !defined (ROM_VERIFY) - { "neopen.sp1", 0x20000, 0xcb915e76, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 28 NeoOpen BIOS v0.1 beta -#else - { "", 0x00000, 0x00000000, 0 }, // 28 -#endif - { "", 0x00000, 0x00000000, 0 }, // 29 Trackball BIOS loaded here - { "", 0x00000, 0x00000000, 0 }, // 30 PCB BIOS loaded here - - { "sm1.sm1", 0x20000, 0x94416d67, BRF_ESS | BRF_PRG | BRF_BIOS }, // 31 Z80 BIOS - { "sfix.sfix", 0x20000, 0xc2ea0cfd, BRF_GRA | BRF_BIOS }, // 32 Text layer tiles - { "000-lo.lo", 0x20000, 0x5a86cff2, BRF_ESS | BRF_BIOS }, // 33 Zoom table -}; - -STD_ROM_PICK(neogeo) -STD_ROM_FN(neogeo) - -// Rom information -static struct BurnRomInfo neoMVSRomDesc[] = { - { "asia-s3.rom", 0x20000, 0x91b64be3, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT }, // 0 MVS Asia/Europe ver. 6 (1 slot) - { "sp-s2.sp1", 0x20000, 0x9036d879, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 1 MVS Asia/Europe ver. 5 (1 slot) - { "sp-s.sp1", 0x20000, 0xc7f2fa45, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 2 MVS Asia/Europe ver. 3 (4 slot) - { "usa_2slt.bin", 0x20000, 0xe72943de, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 3 MVS USA ver. 5 (2 slot) - { "v2.bin", 0x20000, 0x62f021f4, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 4 MVS USA ver. 5 (4 slot) - { "sp-e.sp1", 0x20000, 0x2723a5b5, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 5 MVS USA ver. 5 (6 slot) - { "vs-bios.rom", 0x20000, 0xf0e8f27d, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 6 MVS Japan ver. 6 (? slot) - { "sp-j2.sp1", 0x20000, 0xacede59C, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 7 MVS Japan ver. 5 (? slot) - { "sp1.jipan.1024", 0x20000, 0x9fb0abe4, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 8 MVS Japan ver. 3 (4 slot) - { "sp-45.sp1", 0x80000, 0x03cc9f6a, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 9 NEO-MVH MV1C - { "japan-j3.bin", 0x20000, 0xdff6d41f, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 10 MVS Japan (J3) - { "neo-po.bin", 0x20000, 0x16d0c132, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 11 AES Japan - { "neo-epo.bin", 0x20000, 0xd27a71f1, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 12 AES Asia - { "neodebug.bin", 0x20000, 0x698ebb7d, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 13 Development Kit - { "sp-1v1_3db8c.bin", 0x20000, 0x162f0ebe, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 14 Deck ver. 6 (Git Ver 1.3) - { "uni-bios_3_2.rom", 0x20000, 0xa4e8b9b3, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 15 Universe BIOS ver. 3.2 (free) - { "uni-bios_3_1.rom", 0x20000, 0x0c58093f, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 16 Universe BIOS ver. 3.1 (free) - { "uni-bios_3_0.rom", 0x20000, 0xa97c89a9, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 17 Universe BIOS ver. 3.0 (free) - { "uni-bios_2_3.rom", 0x20000, 0x27664eb5, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 18 Universe BIOS ver. 2.3 - { "uni-bios_2_3o.rom", 0x20000, 0x601720ae, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 19 Universe BIOS ver. 2.3 (alt) - { "uni-bios_2_2.rom", 0x20000, 0x2d50996a, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 20 Universe BIOS ver. 2.2 - { "uni-bios_2_1.rom", 0x20000, 0x8dabf76b, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 21 Universe BIOS ver. 2.1 - { "uni-bios_2_0.rom", 0x20000, 0x0c12c2ad, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 22 Universe BIOS ver. 2.0 - { "uni-bios_1_3.rom", 0x20000, 0xb24b44a0, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 23 Universe BIOS ver. 1.3 - { "uni-bios_1_2.rom", 0x20000, 0x4fa698e9, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 24 Universe BIOS ver. 1.2 - { "uni-bios_1_2o.rom", 0x20000, 0xe19d3ce9, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 25 Universe BIOS ver. 1.2 (alt) - { "uni-bios_1_1.rom", 0x20000, 0x5dda0d84, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 26 Universe BIOS ver. 1.1 - { "uni-bios_1_0.rom", 0x20000, 0x0ce453a0, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 27 Universe BIOS ver. 1.0 - { "neopen.sp1", 0x20000, 0xcb915e76, BRF_ESS | BRF_PRG | BRF_BIOS | BRF_SELECT | BRF_OPT }, // 28 NeoOpen BIOS v0.1 beta - { "", 0x00000, 0x00000000, 0 }, // 29 Trackball BIOS loaded here - { "", 0x00000, 0x00000000, 0 }, // 30 PCB BIOS loaded here - - { "sm1.sm1", 0x20000, 0x94416d67, BRF_ESS | BRF_PRG | BRF_BIOS }, // 31 Z80 BIOS - { "sfix.sfix", 0x20000, 0xc2ea0cfd, BRF_GRA | BRF_BIOS }, // 32 Text layer tiles - { "000-lo.lo", 0x20000, 0x5a86cff2, BRF_ESS | BRF_BIOS }, // 33 Zoom table -}; - -STD_ROM_PICK(neoMVS) -STD_ROM_FN(neoMVS) - -static struct BurnRomInfo neotrackballRomDesc[] = { - { "", 0x00000, 0x00000000, 0 }, // 0 - { "", 0x00000, 0x00000000, 0 }, // 1 - { "", 0x00000, 0x00000000, 0 }, // 2 - { "", 0x00000, 0x00000000, 0 }, // 3 - { "", 0x00000, 0x00000000, 0 }, // 4 - { "", 0x00000, 0x00000000, 0 }, // 5 - { "", 0x00000, 0x00000000, 0 }, // 6 - { "", 0x00000, 0x00000000, 0 }, // 7 - { "", 0x00000, 0x00000000, 0 }, // 8 - { "", 0x00000, 0x00000000, 0 }, // 9 - { "", 0x00000, 0x00000000, 0 }, // 10 - { "", 0x00000, 0x00000000, 0 }, // 11 - { "", 0x00000, 0x00000000, 0 }, // 12 - { "", 0x00000, 0x00000000, 0 }, // 13 - { "", 0x00000, 0x00000000, 0 }, // 14 - { "", 0x00000, 0x00000000, 0 }, // 15 - { "", 0x00000, 0x00000000, 0 }, // 16 - { "", 0x00000, 0x00000000, 0 }, // 17 - { "", 0x00000, 0x00000000, 0 }, // 18 - { "", 0x00000, 0x00000000, 0 }, // 19 - { "", 0x00000, 0x00000000, 0 }, // 20 - { "", 0x00000, 0x00000000, 0 }, // 21 - { "", 0x00000, 0x00000000, 0 }, // 22 - { "", 0x00000, 0x00000000, 0 }, // 23 - { "", 0x00000, 0x00000000, 0 }, // 24 - { "", 0x00000, 0x00000000, 0 }, // 25 - { "", 0x00000, 0x00000000, 0 }, // 26 - { "", 0x00000, 0x00000000, 0 }, // 27 - { "", 0x00000, 0x00000000, 0 }, // 28 - { "236-bios.sp1", 0x20000, 0x853e6b96, BRF_ESS | BRF_PRG | BRF_BIOS }, // 29 Trackball BIOS - { "", 0x00000, 0x00000000, 0 }, // 30 - - -// { "sm1.sm1", 0x20000, 0x94416d67, BRF_ESS | BRF_PRG | BRF_BIOS }, // 31 Z80 BIOS - { "", 0x00000, 0x00000000, 0 }, // 31 Z80 BIOS - { "sfix.sfix", 0x20000, 0xc2ea0cfd, BRF_GRA | BRF_BIOS }, // 32 Text layer tiles - { "000-lo.lo", 0x20000, 0x5a86cff2, BRF_ESS | BRF_BIOS }, // 33 Zoom table -}; - -static struct BurnRomInfo ms5pcbBIOSRomDesc[] = { - { "", 0x00000, 0x00000000, 0 }, // 0 - { "", 0x00000, 0x00000000, 0 }, // 1 - { "", 0x00000, 0x00000000, 0 }, // 2 - { "", 0x00000, 0x00000000, 0 }, // 3 - { "", 0x00000, 0x00000000, 0 }, // 4 - { "", 0x00000, 0x00000000, 0 }, // 5 - { "", 0x00000, 0x00000000, 0 }, // 6 - { "", 0x00000, 0x00000000, 0 }, // 7 - { "", 0x00000, 0x00000000, 0 }, // 8 - { "", 0x00000, 0x00000000, 0 }, // 9 - { "", 0x00000, 0x00000000, 0 }, // 10 - { "", 0x00000, 0x00000000, 0 }, // 11 - { "", 0x00000, 0x00000000, 0 }, // 12 - { "", 0x00000, 0x00000000, 0 }, // 13 - { "", 0x00000, 0x00000000, 0 }, // 14 - { "", 0x00000, 0x00000000, 0 }, // 15 - { "", 0x00000, 0x00000000, 0 }, // 16 - { "", 0x00000, 0x00000000, 0 }, // 17 - { "", 0x00000, 0x00000000, 0 }, // 18 - { "", 0x00000, 0x00000000, 0 }, // 19 - { "", 0x00000, 0x00000000, 0 }, // 20 - { "", 0x00000, 0x00000000, 0 }, // 21 - { "", 0x00000, 0x00000000, 0 }, // 22 - { "", 0x00000, 0x00000000, 0 }, // 23 - { "", 0x00000, 0x00000000, 0 }, // 24 - { "", 0x00000, 0x00000000, 0 }, // 25 - { "", 0x00000, 0x00000000, 0 }, // 26 - { "", 0x00000, 0x00000000, 0 }, // 27 - { "", 0x00000, 0x00000000, 0 }, // 28 - { "", 0x00000, 0x00000000, 0 }, // 29 - { "sp-4x.sp1", 0x80000, 0xb4590283, BRF_ESS | BRF_PRG | BRF_BIOS }, // 30 PCB BIOS - - { "", 0x00000, 0x00000000, 0 }, // 31 Z80 BIOS - { "sfix.sfix", 0x20000, 0xc2ea0cfd, BRF_GRA | BRF_BIOS }, // 32 Text layer tiles - { "000-lo.lo", 0x20000, 0x5a86cff2, BRF_ESS | BRF_BIOS }, // 33 Zoom table -}; - -static struct BurnRomInfo svcpcbBIOSRomDesc[] = { - { "", 0x00000, 0x00000000, 0 }, // 0 - { "", 0x00000, 0x00000000, 0 }, // 1 - { "", 0x00000, 0x00000000, 0 }, // 2 - { "", 0x00000, 0x00000000, 0 }, // 3 - { "", 0x00000, 0x00000000, 0 }, // 4 - { "", 0x00000, 0x00000000, 0 }, // 5 - { "", 0x00000, 0x00000000, 0 }, // 6 - { "", 0x00000, 0x00000000, 0 }, // 7 - { "", 0x00000, 0x00000000, 0 }, // 8 - { "", 0x00000, 0x00000000, 0 }, // 9 - { "", 0x00000, 0x00000000, 0 }, // 10 - { "", 0x00000, 0x00000000, 0 }, // 11 - { "", 0x00000, 0x00000000, 0 }, // 12 - { "", 0x00000, 0x00000000, 0 }, // 13 - { "", 0x00000, 0x00000000, 0 }, // 14 - { "", 0x00000, 0x00000000, 0 }, // 15 - { "", 0x00000, 0x00000000, 0 }, // 16 - { "", 0x00000, 0x00000000, 0 }, // 17 - { "", 0x00000, 0x00000000, 0 }, // 18 - { "", 0x00000, 0x00000000, 0 }, // 19 - { "", 0x00000, 0x00000000, 0 }, // 20 - { "", 0x00000, 0x00000000, 0 }, // 21 - { "", 0x00000, 0x00000000, 0 }, // 22 - { "", 0x00000, 0x00000000, 0 }, // 23 - { "", 0x00000, 0x00000000, 0 }, // 24 - { "", 0x00000, 0x00000000, 0 }, // 25 - { "", 0x00000, 0x00000000, 0 }, // 26 - { "", 0x00000, 0x00000000, 0 }, // 27 - { "", 0x00000, 0x00000000, 0 }, // 28 - { "", 0x00000, 0x00000000, 0 }, // 29 - { "sp-4x.sp1", 0x80000, 0xb4590283, BRF_ESS | BRF_PRG | BRF_BIOS }, // 30 PCB BIOS - - { "", 0x00000, 0x00000000, 0 }, // 31 Z80 BIOS - { "sfix.sfix", 0x20000, 0xc2ea0cfd, BRF_GRA | BRF_BIOS }, // 32 Text layer tiles - { "000-lo.lo", 0x20000, 0x5a86cff2, BRF_ESS | BRF_BIOS }, // 33 Zoom table -}; - -static struct BurnRomInfo kf2k3pcbBIOSRomDesc[] = { - { "", 0x00000, 0x00000000, 0 }, // 0 - { "", 0x00000, 0x00000000, 0 }, // 1 - { "", 0x00000, 0x00000000, 0 }, // 2 - { "", 0x00000, 0x00000000, 0 }, // 3 - { "", 0x00000, 0x00000000, 0 }, // 4 - { "", 0x00000, 0x00000000, 0 }, // 5 - { "", 0x00000, 0x00000000, 0 }, // 6 - { "", 0x00000, 0x00000000, 0 }, // 7 - { "", 0x00000, 0x00000000, 0 }, // 8 - { "", 0x00000, 0x00000000, 0 }, // 9 - { "", 0x00000, 0x00000000, 0 }, // 10 - { "", 0x00000, 0x00000000, 0 }, // 11 - { "", 0x00000, 0x00000000, 0 }, // 12 - { "", 0x00000, 0x00000000, 0 }, // 13 - { "", 0x00000, 0x00000000, 0 }, // 14 - { "", 0x00000, 0x00000000, 0 }, // 15 - { "", 0x00000, 0x00000000, 0 }, // 16 - { "", 0x00000, 0x00000000, 0 }, // 17 - { "", 0x00000, 0x00000000, 0 }, // 18 - { "", 0x00000, 0x00000000, 0 }, // 19 - { "", 0x00000, 0x00000000, 0 }, // 20 - { "", 0x00000, 0x00000000, 0 }, // 21 - { "", 0x00000, 0x00000000, 0 }, // 22 - { "", 0x00000, 0x00000000, 0 }, // 23 - { "", 0x00000, 0x00000000, 0 }, // 24 - { "", 0x00000, 0x00000000, 0 }, // 25 - { "", 0x00000, 0x00000000, 0 }, // 26 - { "", 0x00000, 0x00000000, 0 }, // 27 - { "", 0x00000, 0x00000000, 0 }, // 28 - { "", 0x00000, 0x00000000, 0 }, // 29 - { "spj.sp1", 0x80000, 0x148dd727, BRF_ESS | BRF_PRG | BRF_BIOS }, // 30 PCB BIOS - - { "", 0x00000, 0x00000000, 0 }, // 31 Z80 BIOS - { "sfix.sfix", 0x20000, 0xc2ea0cfd, BRF_GRA | BRF_BIOS }, // 32 Text layer tiles - { "000-lo.lo", 0x20000, 0x5a86cff2, BRF_ESS | BRF_BIOS }, // 33 Zoom table -}; - -struct BurnDriver BurnDrvNeoGeo = { - "neogeo", NULL, NULL, NULL, "1990", - "Neo Geo\0", "BIOS only", "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_BOARDROM, 0, HARDWARE_SNK_NEOGEO, 0, 0, - NULL, neogeoRomInfo, neogeoRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNeoGeoMVS = { - "neogeo", NULL, NULL, NULL, "1990", - "Neo Geo MVS system\0", "System - cartridges selected seperately", "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING /*| BDF_SYSTEM_ONLY*/, 2, HARDWARE_SNK_MVS, 0, 0, - NULL, neoMVSRomInfo, neoMVSRomName, NULL, NULL, neoMVSInputInfo, neoMVSDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// ---------------------------------------------------------------------------- -// Neo Geo CDZ system - -static struct BurnRomInfo neocdzRomDesc[] = { - { "neocd.bin", 0x080000, 0xDF9DE490, BRF_ESS | BRF_PRG | BRF_BIOS }, - { "000-lo.lo", 0x020000, 0x5a86cff2, BRF_ESS | BRF_PRG | BRF_BIOS }, -}; - -STD_ROM_PICK(neocdz) -STD_ROM_FN(neocdz) - -struct BurnDriver BurnDrvneocdz = { - "neocdz", NULL, "neogeo", NULL, "1996", - "Neo Geo CDZ system\0", "System - media selected seperately", "SNK", "Neo Geo CDZ", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING /*| BDF_SYSTEM_ONLY*/, 2, HARDWARE_SNK_NEOCD, 0, 0, - NULL, neocdzRomInfo, neocdzRomName, NULL, NULL, neoCDInputInfo, neoCDDIPInfo, - NeoCDInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// ---------------------------------------------------------------------------- -// Extra code for SMA protection - -INT32 nSMARandomNumber[MAX_SLOT]; - -static UINT32 nNeoSMARNGAddress[MAX_SLOT][2] = { 0, 0 }; - -static pSekWriteWordHandler pSMABankswitchHandler[MAX_SLOT] = { NULL, }; - -// Bank in an area of memory -void NeoSMABankswitch() -{ - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2FE3FF, MAP_ROM); - if (nNeoSMARNGAddress[0] > 0 || nNeoSMARNGAddress[1] > 0) { - SekMapMemory(Neo68KROMActive + nNeo68KROMBank + 0x0FE800, 0x2FE800, 0x2FFBFF, MAP_ROM); - } else { - SekMapMemory(Neo68KROMActive + nNeo68KROMBank + 0x0FE800, 0x2FE800, 0x2FFFFF, MAP_ROM); - } -} - -// Extra protection -UINT16 __fastcall neogeoReadWordSMA9A37(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, " -- SMA9A37 0x%08X (word)\n", sekAddress); - - if (sekAddress == 0x2FE446) { - return 0x9A37; - } - - return *((UINT16*)(Neo68KROMActive + nNeo68KROMBank + sekAddress - 0x200000)); -} - -UINT8 __fastcall neogeoReadByteSMA9A37(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, " -- SMA9A37 0x%08X (byte)\n", sekAddress); - - if (sekAddress == 0x2FE446) { - return 0x9A; - } - if (sekAddress == 0x2FE447) { - return 0x37; - } - - return Neo68KROMActive[(nNeo68KROMBank + sekAddress - 0x200000) ^ 1]; -} - -// Random number generator -UINT16 __fastcall neogeoReadWordSMARNG(UINT32 sekAddress) -{ - if (sekAddress == nNeoSMARNGAddress[nNeoActiveSlot][0] || sekAddress == nNeoSMARNGAddress[nNeoActiveSlot][1]) { - INT32 nRandomNumber = nSMARandomNumber[nNeoActiveSlot]; - - INT32 nNewbit = ( - (nSMARandomNumber[nNeoActiveSlot] >> 2) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 3) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 5) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 6) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 7) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 11) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 12) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 15)) & 1; - - nSMARandomNumber[nNeoActiveSlot] = ((nSMARandomNumber[nNeoActiveSlot] << 1) | nNewbit) & 0x0FFFFF; - - return nRandomNumber; - } - - return *((UINT16*)(Neo68KROMActive + nNeo68KROMBank + sekAddress - 0x200000)); -} - -UINT8 __fastcall neogeoReadByteSMARNG(UINT32 sekAddress) -{ - if ((sekAddress & ~1) == nNeoSMARNGAddress[nNeoActiveSlot][0] || (sekAddress & ~1) == nNeoSMARNGAddress[nNeoActiveSlot][1]) { - INT32 nRandomNumber = nSMARandomNumber[nNeoActiveSlot]; - - INT32 nNewbit = ( - (nSMARandomNumber[nNeoActiveSlot] >> 2) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 3) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 5) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 6) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 7) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 11) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 12) ^ - (nSMARandomNumber[nNeoActiveSlot] >> 15)) & 1; - - nSMARandomNumber[nNeoActiveSlot] = ((nSMARandomNumber[nNeoActiveSlot] << 1) | nNewbit) & 0x0FFFFF; - - if (sekAddress & 1) { - return nRandomNumber & 0xFF; - } else { - return nRandomNumber >> 8; - } - } - - return Neo68KROMActive[(nNeo68KROMBank + sekAddress - 0x200000) ^ 1]; -} - -INT32 NeoSMAScan(INT32 nAction, INT32* /*pnMin*/) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nSMARandomNumber); - } - - return 0; -} - -static void NeoSMAInstallHanders() -{ -// bprintf(PRINT_NORMAL, _T(" Installing handlers for slot %i\n"), nNeoActiveSlot); - - SekMapHandler(8, 0x2FFC00, 0x2FFFFF, MAP_WRITE); // Bankswitch - - SekSetWriteWordHandler(8, pSMABankswitchHandler[nNeoActiveSlot]); - - SekMapHandler(6, 0x2FE400, 0x2FE7FF, MAP_ROM); // Protection - - SekSetReadWordHandler(6, neogeoReadWordSMA9A37); - SekSetReadByteHandler(6, neogeoReadByteSMA9A37); - - if (nNeoSMARNGAddress[nNeoActiveSlot][0] > 0 || nNeoSMARNGAddress[nNeoActiveSlot][1] > 0) { - SekMapHandler(7, 0x2FFC00, 0x2FFFFF, MAP_ROM); // Randum number generator - - SekSetReadWordHandler(7, neogeoReadWordSMARNG); - SekSetReadByteHandler(7, neogeoReadByteSMARNG); - } -} - -// Install handlers -static INT32 NeoSMAInit(void (*pInitCallback)(), pSekWriteWordHandler pBankswitchHandler, UINT32 nRNGAddress0, UINT32 nRNGAddress1) -{ - nNeoSMARNGAddress[nNeoActiveSlot][0] = nRNGAddress0; nNeoSMARNGAddress[nNeoActiveSlot][1] = nRNGAddress1; - pSMABankswitchHandler[nNeoActiveSlot] = pBankswitchHandler; - - NeoCallbackActive->pInitialise = pInitCallback; - NeoCallbackActive->pInstallHandlers = NeoSMAInstallHanders; - NeoCallbackActive->pBankswitch = NeoSMABankswitch; - NeoCallbackActive->pScan = NeoSMAScan; - - nSMARandomNumber[nNeoActiveSlot] = 0x2345; - - return NeoInit(); -} - -INT32 NeoSMAExit() -{ - NeoExit(); - - nNeoSMARNGAddress[nNeoActiveSlot][0] = nNeoSMARNGAddress[nNeoActiveSlot][1] = 0; - - return 0; -} - -// ---------------------------------------------------------------------------- -// Extra code for PCM2 protection - -struct PCM2DecryptP2Info { UINT32 nAddressOffset[16]; }; - -struct PCM2DecryptV2Info { INT32 nAddressOffset; INT32 nAddressXor; UINT8 nDataXor[8]; }; - -static void PCM2DecryptP() -{ - // Descamble P-ROMs - - UINT8* pTemp = (UINT8*)BurnMalloc(0x400000); - - if (pTemp) { - memmove(pTemp, Neo68KROMActive + 0x100000, 0x400000); - - for (INT32 i = 0; i < 4; i++) { - memmove(Neo68KROMActive + 0x100000 + i * 0x100000, pTemp + 0x000000 + (((((i + 2) & 1) << 2) | ((i + 2) & 2)) << 19), 0x80000); - memmove(Neo68KROMActive + 0x180000 + i * 0x100000, pTemp + 0x080000 + (((((i + 1) & 1) << 2) | ((i + 1) & 2)) << 19), 0x80000); - } - - BurnFree(pTemp); - } -} - -static void PCM2DecryptV(INT32 size, INT32 bit) -{ - for (INT32 i = 0; i < size / 2; i += (2 << bit)) { - UINT16 buffer[8]; - memmove(buffer, ((UINT16*)(YM2610ADPCMAROM[nNeoActiveSlot])) + i, 16); - for (INT32 j = (2 << bit) - 1; j >= 0; j--) { - ((UINT16*)(YM2610ADPCMAROM[nNeoActiveSlot]))[i + j] = buffer[j ^ (1 << bit)]; - } - } -} - -static void PCM2DecryptV2(const PCM2DecryptV2Info* const pInfo) -{ - // Decrypt V-ROMs - - UINT8* pTemp = (UINT8*)BurnMalloc(0x01000000); - - if (pTemp) { - memmove(pTemp, YM2610ADPCMAROM[nNeoActiveSlot], 0x01000000); - - for (INT32 i = 0; i < 0x01000000; i++) { - INT32 nAddress = ((i & 0x00FEFFFE) | ((i & 0x00010000) >> 16) | ((i & 0x00000001) << 16)) ^ pInfo->nAddressOffset; - - YM2610ADPCMAROM[nNeoActiveSlot][nAddress] = pTemp[(i + pInfo->nAddressXor) & 0xffffff] ^ pInfo->nDataXor[nAddress & 0x07]; - } - - BurnFree(pTemp); - } -} - -static void PCM2DecryptP2(const PCM2DecryptP2Info* const pInfo) -{ - // Descamble P-ROMs - - UINT8* pTemp = (UINT8*)BurnMalloc(0x800000); - - if (pTemp) { - memmove(pTemp, Neo68KROMActive, 0x800000); - - for (INT32 i = 0; i < 16; i++) { - memmove(Neo68KROMActive + i * 0x80000, pTemp + pInfo->nAddressOffset[i], 0x80000); - } - - BurnFree(pTemp); - } -} - -// ---------------------------------------------------------------------------- -// PVC protection - -static UINT8 *PVCRAM = NULL; - -void NeoPVCPallette01() // unpack palette word to RGB dword -{ - UINT8 b1, b2; - b1 = PVCRAM[0x1fe1]; - b2 = PVCRAM[0x1fe0]; - - PVCRAM[0x1fe2] = ((b2 & 0xf) << 1) | ((b1 >> 4) & 1); - PVCRAM[0x1fe3] = (((b2 >> 4) & 0xf) << 1) | ((b1 >> 5) & 1); - PVCRAM[0x1fe4] = ((b1 & 0xf) << 1) | ((b1 >> 6) & 1); - PVCRAM[0x1fe5] = b1 >> 7; -} - -void NeoPVCPallette02() // pack RGB dword to palette word -{ - UINT8 b1, b2, b3, b4; - b1 = PVCRAM[0x1fe9]; - b2 = PVCRAM[0x1fe8]; - b3 = PVCRAM[0x1feb]; - b4 = PVCRAM[0x1fea]; - - PVCRAM[0x1fec] = (b2 >> 1) | ((b1 >> 1) << 4); - PVCRAM[0x1fed] = (b4 >> 1) | ((b2 & 1) << 4) | ((b1 & 1) << 5) | ((b4 & 1) << 6) | ((b3 & 1) << 7); -} - -void NeoPVCBankswitch() -{ - UINT32 nBank = (PVCRAM[0x1ff3] << 16) | (PVCRAM[0x1ff2] << 8) | PVCRAM[0x1ff1]; - nBank += (Neo68KROMActive[0x108] & 0x10) << 16; // for kof2003 (bank 0 is $100000) - - if (nNeo68KROMBank != nBank) - { - nNeo68KROMBank = nBank; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2fdfff, MAP_ROM); - } - - PVCRAM[0x1ff0] = 0xa0; - PVCRAM[0x1ff1] &= 0xfe; - PVCRAM[0x1ff3] &= 0x7f; -} - -void __fastcall PVCWriteByteBankSwitch(UINT32 sekAddress, UINT8 byteValue) -{ - PVCRAM[(sekAddress & 0x1fff) ^ 1] = byteValue; - if (sekAddress >= 0x2fffe0 && sekAddress <= 0x2fffe1) NeoPVCPallette01(); - else if(sekAddress >= 0x2fffe8 && sekAddress <= 0x2fffeb) NeoPVCPallette02(); - else if (sekAddress >= 0x2ffff0 && sekAddress <= 0x2ffff3) NeoPVCBankswitch(); -} - -void __fastcall PVCWriteWordBankSwitch(UINT32 sekAddress, UINT16 wordValue) -{ - *((UINT16 *)(PVCRAM + (sekAddress & 0x1ffe))) = BURN_ENDIAN_SWAP_INT16(wordValue); - if (sekAddress >= 0x2fffe0 && sekAddress <= 0x2fffe1) NeoPVCPallette01(); - else if (sekAddress >= 0x2fffe8 && sekAddress <= 0x2fffeb) NeoPVCPallette02(); - else if (sekAddress >= 0x2ffff0 && sekAddress <= 0x2ffff3) NeoPVCBankswitch(); -} - -static void NeoPVCMapBank() -{ - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2fdfff, MAP_ROM); -} - -static INT32 NeoPVCScan(INT32 nAction, INT32*) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = PVCRAM; - ba.nLen = 0x00002000; - ba.nAddress = 0; - ba.szName = "Neo-PVC 68K RAM"; - BurnAcb(&ba); - } - - return 0; -} - -static void NeoPVCInstallHandlers() -{ - // Install cart PVC protections - SekMapMemory(PVCRAM, 0x2fe000, 0x2fffff, MAP_READ); - - SekMapHandler(6, 0x2fe000, 0x2fffff, MAP_WRITE); - SekSetWriteWordHandler(6, PVCWriteWordBankSwitch); - SekSetWriteByteHandler(6, PVCWriteByteBankSwitch); -} - -static INT32 NeoPVCInit() -{ - PVCRAM = (UINT8*)BurnMalloc(0x2000); - if (!PVCRAM) return 1; - - memset(PVCRAM, 0, 0x2000); - - NeoCallbackActive->pInstallHandlers = NeoPVCInstallHandlers; - NeoCallbackActive->pBankswitch = NeoPVCMapBank; - NeoCallbackActive->pScan = NeoPVCScan; - - return NeoInit(); -} - -static INT32 NeoPVCExit() -{ - BurnFree(PVCRAM); - - return NeoExit(); -} - - -// ---------------------------------------------------------------------------- -// Helper functions - -static void lans2004_sx_decode() -{ - INT32 i, j, n; - for (i = 0; i < 0x20000; i+= 0x10) { - for (j = 0; j < 0x08; j++) { - n = NeoTextROM[nNeoActiveSlot][i + j + 8]; - NeoTextROM[nNeoActiveSlot][i + j + 8] = NeoTextROM[nNeoActiveSlot][i + j]; - NeoTextROM[nNeoActiveSlot][i + j + 0] = n; - } - } -} - -static void lans2004_cx_decode(INT32 nLen) -{ - INT32 i, j, n; - for (i = 0; i < nLen; i+= 0x80) { - for (j = 0; j < 0x40; j++) { - n = NeoSpriteROM[nNeoActiveSlot][i + j + 0x40]; - NeoSpriteROM[nNeoActiveSlot][i + j + 0x40] = NeoSpriteROM[nNeoActiveSlot][i + j]; - NeoSpriteROM[nNeoActiveSlot][i + j] = n; - } - } -} - -static void DoPerm(INT32 g) // 0 - cthd2003, 1 - svcboot -{ - static INT32 idx[ 2 ][ 16 ] = { - { 0, 1, 2, 3, 3, 4, 4, 5, 0, 1, 2, 3, 3, 4, 4, 5 }, // 0 - { 0, 1, 0, 1, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5 }, // 1 - }; - - static INT32 tbl[ 6 ][ 4 ] = { - { 3, 0, 1, 2 }, - { 2, 3, 0, 1 }, - { 1, 2, 3, 0 }, - { 0, 1, 2, 3 }, - { 3, 2, 1, 0 }, - { 3, 0, 2, 1 }, - }; - - INT32 i, j, k, *b; - UINT8 dst[0x800]; - - for (i = 0; i < 0x4000000 >> 11; i++) - { - for(j = 0; j < 0x800 >> 7; j++) - { - b = tbl[idx[g][(i >> (5 ^ g)) & 0x0f]]; - k = BITSWAP08(j, 7, 6, 5, 4, b[3], b[2], b[1], b[0]); - - memmove (dst + (j << 7), NeoSpriteROM[nNeoActiveSlot] + (i << 11) + (k << 7), 0x80); - } - - memmove (NeoSpriteROM[nNeoActiveSlot] + (i << 11), dst, 0x800); - } -} - -// ---------------------------------------------------------------------------- -// Game drivers (games in MAME) - -/* ID range from 100 - 199 is used for Korean (some) and Neo Print carts */ - -/* The following Korean releases use the same ID's as the Japanese and/or US releases - - ID-0080 - Quiz King of Fighters (Korean release) - ID-088 - Stakes Winner (Korean release) - ID-0214 - The King of Fighters '96 (Korean release) - ID-0217 - Ninja Masters (Korean release) - ID-0225 - Waku Waku 7 (Korean release) - ID-0230 - Breakers (Korean release) - ID-0232 - The King of Fighters '97 (Korean release) - ID-0238 - Shock Troopers (Korean release) - ID-0242 - The King of Fighters '98 (Korean release) */ - -/* The following ID's are used by Korean releases: - - ID-0122 - Pae Wang Jeon Seol / Legend of a Warrior (Korean censored Samurai Shodown IV) - ID-0123 - Quiz Daisousa Sen - The Last Count Down (Korean release) - ID-0124 - Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special (Korean release) - ID-0134 - The Last Soldier (Korean release of The Last Blade) - ID-0140 - Real Bout Fatal Fury 2 - The Newcomers (Korean release) - ID-0152 - The King of Fighters '99 - Millennium Battle (Korean release) - ID-0163 - Saulabi Spirits / Jin Saulabi Tu Hon (Korean release of Samurai Shodown II) - ID-0187 - Fighters Swords (Korean release of Samurai Shodown III) - ID-0196 - Art of Fighting 3 - The Path of the Warrior (Korean release) -*/ - - -// NAM-1975 (NGM-001)(NGH-001) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo nam1975RomDesc[] = { - { "001-p1.p1", 0x080000, 0xcc9fc951, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / MB834200 - - { "001-s1.s1", 0x020000, 0x7988ba51, 2 | BRF_GRA }, // 1 Text layer tiles / MB831000 - - { "001-c1.c1", 0x080000, 0x32ea98e1, 3 | BRF_GRA }, // 2 Sprite data / MB834200 - { "001-c2.c2", 0x080000, 0xcbc4064c, 3 | BRF_GRA }, // 3 / MB834200 - { "001-c3.c3", 0x080000, 0x0151054c, 3 | BRF_GRA }, // 4 / MB834200 - { "001-c4.c4", 0x080000, 0x0a32570d, 3 | BRF_GRA }, // 5 / MB834200 - { "001-c5.c5", 0x080000, 0x90b74cc2, 3 | BRF_GRA }, // 6 / MB834200 - { "001-c6.c6", 0x080000, 0xe62bed58, 3 | BRF_GRA }, // 7 / MB834200 - - { "001-m1.m1", 0x040000, 0xba874463, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / MB832000 - - { "001-v11.v11", 0x080000, 0xa7c3d5e5, 5 | BRF_SND }, // 9 Sound data / MB834200 - // AES has different label, data is the same: 001-v1.v1 - { "001-v21.v21", 0x080000, 0x55e670b3, 6 | BRF_SND }, // 10 / MB834200 - // AES has different label, data is the same: 001-v2.v21 - { "001-v22.v22", 0x080000, 0xab0d8368, 6 | BRF_SND }, // 11 / MB834000 - { "001-v23.v23", 0x080000, 0xdf468e28, 6 | BRF_SND }, // 12 / MB834000 -}; - -STDROMPICKEXT(nam1975, nam1975, neogeo) -STD_ROM_FN(nam1975) - -struct BurnDriver BurnDrvNam1975 = { - "nam1975", NULL, "neogeo", NULL, "1990", - "NAM-1975 (NGM-001)(NGH-001)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SHOOT, 0, - NULL, nam1975RomInfo, nam1975RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Baseball Stars Professional (NGM-002) -/* MVS VERSION */ - -static struct BurnRomInfo bstarsRomDesc[] = { - { "002-pg.p1", 0x080000, 0xc100b5f5, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / MB834200 - - { "002-s1.s1", 0x020000, 0x1a7fd0c6, 2 | BRF_GRA }, // 1 Text layer tiles / MB831000 - - { "002-c1.c1", 0x080000, 0xaaff2a45, 3 | BRF_GRA }, // 2 Sprite data / MB834200 - { "002-c2.c2", 0x080000, 0x3ba0f7e4, 3 | BRF_GRA }, // 3 / MB834200 - { "002-c3.c3", 0x080000, 0x96f0fdfa, 3 | BRF_GRA }, // 4 / MB834200 - { "002-c4.c4", 0x080000, 0x5fd87f2f, 3 | BRF_GRA }, // 5 / MB834200 - { "002-c5.c5", 0x080000, 0x807ed83b, 3 | BRF_GRA }, // 6 / MB834200 - { "002-c6.c6", 0x080000, 0x5a3cad41, 3 | BRF_GRA }, // 7 / MB834200 - - { "002-m1.m1", 0x040000, 0x4ecaa4ee, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / MB832000 - - { "002-v11.v11", 0x080000, 0xb7b925bd, 5 | BRF_SND }, // 9 Sound data / MB834000 - { "002-v12.v12", 0x080000, 0x329f26fc, 5 | BRF_SND }, // 10 / MB834000 - { "002-v13.v13", 0x080000, 0x0c39f3c8, 5 | BRF_SND }, // 11 / MB834000 - { "002-v14.v14", 0x080000, 0xc7e11c38, 5 | BRF_SND }, // 12 / MB834000 - { "002-v21.v21", 0x080000, 0x04a733d1, 6 | BRF_SND }, // 13 / MB834000 -}; - -STDROMPICKEXT(bstars, bstars, neogeo) -STD_ROM_FN(bstars) - -struct BurnDriver BurnDrvBstars = { - "bstars", NULL, "neogeo", NULL, "1990", - "Baseball Stars Professional (NGM-002)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, bstarsRomInfo, bstarsRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Baseball Stars Professional (NGH-002) -/* AES VERSION */ - -static struct BurnRomInfo bstarshRomDesc[] = { - { "002-p1.p1", 0x080000, 0x3bc7790e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / MB834200 - - { "002-s1.s1", 0x020000, 0x1a7fd0c6, 2 | BRF_GRA }, // 1 Text layer tiles / MB831000 - - { "002-c1.c1", 0x080000, 0xaaff2a45, 3 | BRF_GRA }, // 2 Sprite data / MB834200 - { "002-c2.c2", 0x080000, 0x3ba0f7e4, 3 | BRF_GRA }, // 3 / MB834200 - { "002-c3.c3", 0x080000, 0x96f0fdfa, 3 | BRF_GRA }, // 4 / MB834200 - { "002-c4.c4", 0x080000, 0x5fd87f2f, 3 | BRF_GRA }, // 5 / MB834200 - { "002-c5.c5", 0x080000, 0x807ed83b, 3 | BRF_GRA }, // 6 / MB834200 - { "002-c6.c6", 0x080000, 0x5a3cad41, 3 | BRF_GRA }, // 7 / MB834200 - - { "002-m1.m1", 0x040000, 0x4ecaa4ee, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / MB832000 - - { "002-v11.v11", 0x080000, 0xb7b925bd, 5 | BRF_SND }, // 9 Sound data / MB834000 - { "002-v12.v12", 0x080000, 0x329f26fc, 5 | BRF_SND }, // 10 / MB834000 - { "002-v13.v13", 0x080000, 0x0c39f3c8, 5 | BRF_SND }, // 11 / MB834000 - { "002-v14.v14", 0x080000, 0xc7e11c38, 5 | BRF_SND }, // 12 / MB834000 - { "002-v21.v21", 0x080000, 0x04a733d1, 6 | BRF_SND }, // 13 / MB834000 -}; - -STDROMPICKEXT(bstarsh, bstarsh, neogeo) -STD_ROM_FN(bstarsh) - -struct BurnDriver BurnDrvBstarsh = { - "bstarsh", "bstars", "neogeo", NULL, "1990", - "Baseball Stars Professional (NGH-002)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, bstarshRomInfo, bstarshRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Top Player's Golf (NGM-003)(NGH-003) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo tpgolfRomDesc[] = { - { "003-p1.p1", 0x080000, 0xf75549ba, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "003-p2.p2", 0x080000, 0xb7809a8f, 1 | BRF_ESS | BRF_PRG }, // 1 / TC534200 - - { "003-s1.s1", 0x020000, 0x7b3eb9b1, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "003-c1.c1", 0x080000, 0x0315fbaf, 3 | BRF_GRA }, // 3 Sprite data / TC534200 - { "003-c2.c2", 0x080000, 0xb4c15d59, 3 | BRF_GRA }, // 4 / TC534200 - { "003-c3.c3", 0x080000, 0x8ce3e8da, 3 | BRF_GRA }, // 5 / TC534200 - { "003-c4.c4", 0x080000, 0x29725969, 3 | BRF_GRA }, // 6 / TC534200 - { "003-c5.c5", 0x080000, 0x9a7146da, 3 | BRF_GRA }, // 7 / TC534200 - { "003-c6.c6", 0x080000, 0x1e63411a, 3 | BRF_GRA }, // 8 / TC534200 - { "003-c7.c7", 0x080000, 0x2886710c, 3 | BRF_GRA }, // 9 / TC534200 - { "003-c8.c8", 0x080000, 0x422af22d, 3 | BRF_GRA }, // 10 / TC534200 - - { "003-m1.m1", 0x020000, 0x4cc545e6, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "003-v11.v11", 0x080000, 0xff97f1cb, 5 | BRF_SND }, // 12 Sound data / TC534000 - // AES has different label, data is the same (also found on MVS): 003-v1.v11 - { "003-v21.v21", 0x080000, 0xd34960c6, 6 | BRF_SND }, // 13 / TC534000 - // AES has different label, data is the same (also found on MVS): 003-v2.v21 - { "003-v22.v22", 0x080000, 0x9a5f58d4, 6 | BRF_SND }, // 14 / TC534000 - { "003-v23.v23", 0x080000, 0x30f53e54, 6 | BRF_SND }, // 15 / TC534000 - { "003-v24.v24", 0x080000, 0x5ba0f501, 6 | BRF_SND }, // 16 / TC534000 -}; - -STDROMPICKEXT(tpgolf, tpgolf, neogeo) -STD_ROM_FN(tpgolf) - -struct BurnDriver BurnDrvTpgolf = { - "tpgolf", NULL, "neogeo", NULL, "1990", - "Top Player's Golf (NGM-003)(NGH-003)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, tpgolfRomInfo, tpgolfRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Mahjong Kyo Retsuden (NGM-004)(NGH-004) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo mahretsuRomDesc[] = { - { "004-p1.p1", 0x080000, 0xfc6f53db, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "004-s1.s1", 0x020000, 0x2bd05a06, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "004-c1.c1", 0x080000, 0xf1ae16bc, 3 | BRF_GRA }, // 2 Sprite data / MB834200 - { "004-c2.c2", 0x080000, 0xbdc13520, 3 | BRF_GRA }, // 3 / MB834200 - { "004-c3.c3", 0x080000, 0x9c571a37, 3 | BRF_GRA }, // 4 / MB834200 - { "004-c4.c4", 0x080000, 0x7e81cb29, 3 | BRF_GRA }, // 5 / MB834200 - - { "004-m1.m1", 0x020000, 0xc71fbb3b, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "004-v11.v11", 0x080000, 0xb2fb2153, 5 | BRF_SND }, // 7 Sound data / CXK384001 - { "004-v12.v12", 0x080000, 0x8503317b, 5 | BRF_SND }, // 8 / CXK384001 - { "004-v21.v21", 0x080000, 0x4999fb27, 6 | BRF_SND }, // 9 / CXK384001 - { "004-v22.v22", 0x080000, 0x776fa2a2, 6 | BRF_SND }, // 10 / CXK384001 - { "004-v23.v23", 0x080000, 0xb3e7eeea, 6 | BRF_SND }, // 11 / CXK384001 -}; - -STDROMPICKEXT(mahretsu, mahretsu, neogeo) -STD_ROM_FN(mahretsu) - -struct BurnDriver BurnDrvMahretsu = { - "mahretsu", NULL, "neogeo", NULL, "1990", - "Mahjong Kyo Retsuden (NGM-004)(NGH-004)\0", NULL, "SNK", "Neo Geo MVS", - L"\u9EBB\u96C0\u72C2\u5217\u4F1D\0Mahjong Kyo Retsuden (NGM-004)(NGH-004)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_MAHJONG, GBF_MAHJONG, 0, - NULL, mahretsuRomInfo, mahretsuRomName, NULL, NULL, neomahjongInputInfo, neomahjongDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Riding Hero (NGM-006)(NGH-006) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo ridheroRomDesc[] = { - { "006-p1.p1", 0x080000, 0xd4aaf597, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / MB834200 - - { "006-s1.s1", 0x020000, 0xeb5189f0, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "006-c1.c1", 0x080000, 0x4a5c7f78, 3 | BRF_GRA }, // 2 Sprite data / CXK384000 - { "006-c2.c2", 0x080000, 0xe0b70ece, 3 | BRF_GRA }, // 3 / CXK384000 - { "006-c3.c3", 0x080000, 0x8acff765, 3 | BRF_GRA }, // 4 / CXK384000 - { "006-c4.c4", 0x080000, 0x205e3208, 3 | BRF_GRA }, // 5 / CXK384000 - - { "006-m1.m1", 0x040000, 0x92e7b4fe, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / MB832000 - - { "006-v11.v11", 0x080000, 0xcdf74a42, 5 | BRF_SND }, // 7 Sound data / MB834000 - { "006-v12.v12", 0x080000, 0xe2fd2371, 5 | BRF_SND }, // 8 / MB834000 - { "006-v21.v21", 0x080000, 0x94092bce, 6 | BRF_SND }, // 9 / MB834000 - { "006-v22.v22", 0x080000, 0x4e2cd7c3, 6 | BRF_SND }, // 10 / MB834000 - { "006-v23.v23", 0x080000, 0x069c71ed, 6 | BRF_SND }, // 11 / MB834000 - { "006-v24.v24", 0x080000, 0x89fbb825, 6 | BRF_SND }, // 12 / MB834000 - - { "rhcom.bin", 0x002000, 0xe5cd6306, BRF_OPT }, - /* dumped from a prototype with external ROM, not 100% confirmed as being the same on a final, or other games (lbowling, trally) */ -}; - -STDROMPICKEXT(ridhero, ridhero, neogeo) -STD_ROM_FN(ridhero) - -struct BurnDriver BurnDrvRidhero = { - "ridhero", NULL, "neogeo", NULL, "1990", - "Riding Hero (NGM-006)(NGH-006)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_RACING, 0, - NULL, ridheroRomInfo, ridheroRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Riding Hero (set 2) - -static struct BurnRomInfo ridherohRomDesc[] = { - { "006-pg1.p1", 0x080000, 0x52445646, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / MB834200 - /* Chip label p1h does not exist, renamed temporarly to pg1, marked BAD_DUMP. - This needs to be verified. */ - { "006-s1.s1", 0x020000, 0xeb5189f0, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "006-c1.c1", 0x080000, 0x4a5c7f78, 3 | BRF_GRA }, // 2 Sprite data / CXK384000 - { "006-c2.c2", 0x080000, 0xe0b70ece, 3 | BRF_GRA }, // 3 / CXK384000 - { "006-c3.c3", 0x080000, 0x8acff765, 3 | BRF_GRA }, // 4 / CXK384000 - { "006-c4.c4", 0x080000, 0x205e3208, 3 | BRF_GRA }, // 5 / CXK384000 - - { "006-m1.m1", 0x040000, 0x92e7b4fe, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / MB832000 - - { "006-v11.v11", 0x080000, 0xcdf74a42, 5 | BRF_SND }, // 7 Sound data / MB834000 - { "006-v12.v12", 0x080000, 0xe2fd2371, 5 | BRF_SND }, // 8 / MB834000 - { "006-v21.v21", 0x080000, 0x94092bce, 6 | BRF_SND }, // 9 / MB834000 - { "006-v22.v22", 0x080000, 0x4e2cd7c3, 6 | BRF_SND }, // 10 / MB834000 - { "006-v23.v23", 0x080000, 0x069c71ed, 6 | BRF_SND }, // 11 / MB834000 - { "006-v24.v24", 0x080000, 0x89fbb825, 6 | BRF_SND }, // 12 / MB834000 - - { "rhcom.bin", 0x002000, 0xe5cd6306, BRF_OPT }, - /* dumped from a prototype with external ROM, not 100% confirmed as being the same on a final, or other games (lbowling, trally) */ -}; - -STDROMPICKEXT(ridheroh, ridheroh, neogeo) -STD_ROM_FN(ridheroh) - -struct BurnDriver BurnDrvRidheroh = { - "ridheroh", "ridhero", "neogeo", NULL, "1990", - "Riding Hero (set 2)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_RACING, 0, - NULL, ridherohRomInfo, ridherohRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Alpha Mission II / ASO II - Last Guardian (NGM-007)(NGH-007) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo alpham2RomDesc[] = { - { "007-p1.p1", 0x080000, 0x5b266f47, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "007-p2.p2", 0x020000, 0xeb9c1044, 1 | BRF_ESS | BRF_PRG }, // 1 / TC531024 - - { "007-s1.s1", 0x020000, 0x85ec9acf, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "007-c1.c1", 0x100000, 0x8fba8ff3, 3 | BRF_GRA }, // 3 Sprite data / TC538200 - { "007-c2.c2", 0x100000, 0x4dad2945, 3 | BRF_GRA }, // 4 / TC538200 - { "007-c3.c3", 0x080000, 0x68c2994e, 3 | BRF_GRA }, // 5 / TC538200 - { "007-c4.c4", 0x080000, 0x7d588349, 3 | BRF_GRA }, // 6 / TC538200 - - { "007-m1.m1", 0x020000, 0x28dfe2cd, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "007-v1.v1", 0x100000, 0xcd5db931, 5 | BRF_SND }, // 8 Sound data / TC538200 - { "007-v2.v2", 0x100000, 0x63e9b574, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(alpham2, alpham2, neogeo) -STD_ROM_FN(alpham2) - -struct BurnDriver BurnDrvAlpham2 = { - "alpham2", NULL, "neogeo", NULL, "1991", - "Alpha Mission II / ASO II - Last Guardian (NGM-007)(NGH-007)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VERSHOOT, 0, - NULL, alpham2RomInfo, alpham2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Alpha Mission II / ASO II - Last Guardian (prototype) -/* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ -/* AES VERSION */ - -static struct BurnRomInfo alpham2pRomDesc[] = { - { "007_p1_faac.p1", 0x080000, 0xc763e52a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "007_p2_1813.p2", 0x080000, 0x7a0b435c, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "007_s1_36f1.s1", 0x020000, 0xefc9ae2e, 2 | BRF_GRA }, // 2 Text layer tiles - - { "007_c1_210e.c11", 0x080000, 0x24841639, 3 | BRF_GRA }, // 3 Sprite data - { "007_c2_29ae.c12", 0x080000, 0x912763ab, 3 | BRF_GRA }, // 4 - { "007_c3_c873.c13", 0x080000, 0x0743bde2, 3 | BRF_GRA }, // 5 - { "007_c4_2462.c14", 0x080000, 0x61240212, 3 | BRF_GRA }, // 6 - { "007_c5_5f16.c15", 0x080000, 0xcf9f4c53, 3 | BRF_GRA }, // 7 - { "007_c6_8abc.c16", 0x080000, 0x3d903b19, 3 | BRF_GRA }, // 8 - { "007_c7_c983.c17", 0x080000, 0xe41e3875, 3 | BRF_GRA }, // 9 - { "007_c8_b599.c18", 0x080000, 0x4483e2cf, 3 | BRF_GRA }, // 10 - - { "007_m1_9384.m1", 0x020000, 0x5976b464, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "007_v11_1bb4.v11", 0x080000, 0x18eaa9e1, 5 | BRF_SND }, // 12 Sound data - { "007_v12_c8e8.v12", 0x080000, 0x2487d495, 5 | BRF_SND }, // 13 - { "007_v13_09fa.v13", 0x080000, 0x25e60f25, 5 | BRF_SND }, // 14 - { "007_v21_28c2.v21", 0x080000, 0xac44b75a, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(alpham2p, alpham2p, neogeo) -STD_ROM_FN(alpham2p) - -static void Alpham2pCallback() -{ - BurnLoadRom(Neo68KROMActive + 0x000000, 0, 2); - BurnLoadRom(Neo68KROMActive + 0x000001, 1, 2); -} - -static INT32 Alpham2pInit() -{ - NeoCallbackActive->pInitialise = Alpham2pCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvAlpham2p = { - "alpham2p", "alpham2", "neogeo", NULL, "1991", - "Alpha Mission II / ASO II - Last Guardian (prototype)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SPRITE32, GBF_VERSHOOT, 0, - NULL, alpham2pRomInfo, alpham2pRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - Alpham2pInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Cyber-Lip (NGM-010) - -static struct BurnRomInfo cyberlipRomDesc[] = { - /* also found AES set on PROG board NEO-AEG PROG-B and CHA board NEO-AEG CHA-32; - same chip labels */ - { "010-p1.p1", 0x080000, 0x69a6b42d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "010-s1.s1", 0x020000, 0x79a35264, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "010-c1.c1", 0x080000, 0x8bba5113, 3 | BRF_GRA }, // 2 Sprite data / TC534200 - { "010-c2.c2", 0x080000, 0xcbf66432, 3 | BRF_GRA }, // 3 / TC534200 - { "010-c3.c3", 0x080000, 0xe4f86efc, 3 | BRF_GRA }, // 4 / TC534200 - { "010-c4.c4", 0x080000, 0xf7be4674, 3 | BRF_GRA }, // 5 / TC534200 - { "010-c5.c5", 0x080000, 0xe8076da0, 3 | BRF_GRA }, // 6 / TC534200 - { "010-c6.c6", 0x080000, 0xc495c567, 3 | BRF_GRA }, // 7 / TC534200 - - { "010-m1.m1", 0x020000, 0x8be3a078, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / TC531001 - - { "010-v11.v11", 0x080000, 0x90224d22, 5 | BRF_SND }, // 9 Sound data / TC534000 - { "010-v12.v12", 0x080000, 0xa0cf1834, 5 | BRF_SND }, // 10 / TC534000 - { "010-v13.v13", 0x080000, 0xae38bc84, 5 | BRF_SND }, // 11 / TC534000 - { "010-v14.v14", 0x080000, 0x70899bd2, 5 | BRF_SND }, // 12 / TC534000 - { "010-v21.v21", 0x080000, 0x586f4cb2, 6 | BRF_SND }, // 13 / TC534000 -}; - -STDROMPICKEXT(cyberlip, cyberlip, neogeo) -STD_ROM_FN(cyberlip) - -struct BurnDriver BurnDrvCyberlip = { - "cyberlip", NULL, "neogeo", NULL, "1990", - "Cyber-Lip (NGM-010)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, 0, - NULL, cyberlipRomInfo, cyberlipRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The Super Spy (NGM-011)(NGH-011) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo superspyRomDesc[] = { - { "011-p1.p1", 0x080000, 0xc7f944b5, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / MB834200 - { "sp2.p2", 0x020000, 0x811a4faf, 1 | BRF_ESS | BRF_PRG }, // 1 / TC531024 - - { "011-s1.s1", 0x020000, 0xec5fdb96, 2 | BRF_GRA }, // 2 Text layer tiles / MB831000 - - { "011-c1.c1", 0x100000, 0xcae7be57, 3 | BRF_GRA }, // 3 Sprite data / MB838200 - { "011-c2.c2", 0x100000, 0x9e29d986, 3 | BRF_GRA }, // 4 / MB838200 - { "011-c3.c3", 0x100000, 0x14832ff2, 3 | BRF_GRA }, // 5 / MB838200 - { "011-c4.c4", 0x100000, 0xb7f63162, 3 | BRF_GRA }, // 6 / MB838200 - - { "011-m1.m1", 0x040000, 0xca661f1b, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / MB832000 - - { "011-v11.v11", 0x100000, 0x5c674d5c, 5 | BRF_SND }, // 8 Sound data / MB838000 - { "011-v12.v12", 0x080000, 0x9f513d5a, 5 | BRF_SND }, // 9 / MB834000 - { "011-v21.v21", 0x080000, 0x426cd040, 6 | BRF_SND }, // 10 / MB834000 -}; - -STDROMPICKEXT(superspy, superspy, neogeo) -STD_ROM_FN(superspy) - -struct BurnDriver BurnDrvSuperspy = { - "superspy", NULL, "neogeo", NULL, "1990", - "The Super Spy (NGM-011)(NGH-011)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, superspyRomInfo, superspyRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Mutation Nation (NGM-014)(NGH-014) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo mutnatRomDesc[] = { - { "014-p1.p1", 0x080000, 0x6f1699c8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / CXK384500 - - { "014-s1.s1", 0x020000, 0x99419733, 2 | BRF_GRA }, // 1 Text layer tiles / CXK381000 - - { "014-c1.c1", 0x100000, 0x5e4381bf, 3 | BRF_GRA }, // 2 Sprite data / CXK388000 - { "014-c2.c2", 0x100000, 0x69ba4e18, 3 | BRF_GRA }, // 3 / CXK388000 - { "014-c3.c3", 0x100000, 0x890327d5, 3 | BRF_GRA }, // 4 / CXK388000 - { "014-c4.c4", 0x100000, 0xe4002651, 3 | BRF_GRA }, // 5 / CXK388000 - - { "014-m1.m1", 0x020000, 0xb6683092, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / CXK381003A - - { "014-v1.v1", 0x100000, 0x25419296, 5 | BRF_SND }, // 7 Sound data / CXK388000 - { "014-v2.v2", 0x100000, 0x0de53d5e, 5 | BRF_SND }, // 8 / CXK388000 -}; - -STDROMPICKEXT(mutnat, mutnat, neogeo) -STD_ROM_FN(mutnat) - -struct BurnDriver BurnDrvMutnat = { - "mutnat", NULL, "neogeo", NULL, "1992", - "Mutation Nation (NGM-014)(NGH-014)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, mutnatRomInfo, mutnatRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// King of the Monsters (set 1) -/* MVS VERSION */ - -static struct BurnRomInfo kotmRomDesc[] = { - { "016-p1.p1", 0x080000, 0x1b818731, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "016-p2.p2", 0x020000, 0x12afdc2b, 1 | BRF_ESS | BRF_PRG }, // 1 / TC531024 - - { "016-s1.s1", 0x020000, 0x1a2eeeb3, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "016-c1.c1", 0x100000, 0x71471c25, 3 | BRF_GRA }, // 3 Sprite data / TC538200 - { "016-c2.c2", 0x100000, 0x320db048, 3 | BRF_GRA }, // 4 / TC538200 - { "016-c3.c3", 0x100000, 0x98de7995, 3 | BRF_GRA }, // 5 / TC538200 - { "016-c4.c4", 0x100000, 0x070506e2, 3 | BRF_GRA }, // 6 / TC538200 - - { "016-m1.m1", 0x020000, 0x9da9ca10, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "016-v1.v1", 0x100000, 0x86c0a502, 5 | BRF_SND }, // 8 Sound data / TC538200 - { "016-v2.v2", 0x100000, 0x5bc23ec5, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(kotm, kotm, neogeo) -STD_ROM_FN(kotm) - -struct BurnDriver BurnDrvKotm = { - "kotm", NULL, "neogeo", NULL, "1991", - "King of the Monsters (set 1)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, kotmRomInfo, kotmRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// King of the Monsters (set 2) -/* AES VERSION */ - -static struct BurnRomInfo kotmhRomDesc[] = { - { "016-hp1.p1", 0x080000, 0xb774621e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "016-p2.p2", 0x020000, 0x12afdc2b, 1 | BRF_ESS | BRF_PRG }, // 1 / TC531024 - - { "016-s1.s1", 0x020000, 0x1a2eeeb3, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "016-c1.c1", 0x100000, 0x71471c25, 3 | BRF_GRA }, // 3 Sprite data / TC538200 - { "016-c2.c2", 0x100000, 0x320db048, 3 | BRF_GRA }, // 4 / TC538200 - { "016-c3.c3", 0x100000, 0x98de7995, 3 | BRF_GRA }, // 5 / TC538200 - { "016-c4.c4", 0x100000, 0x070506e2, 3 | BRF_GRA }, // 6 / TC538200 - - { "016-m1.m1", 0x020000, 0x9da9ca10, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "016-v1.v1", 0x100000, 0x86c0a502, 5 | BRF_SND }, // 8 Sound data / TC538200 - { "016-v2.v2", 0x100000, 0x5bc23ec5, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(kotmh, kotmh, neogeo) -STD_ROM_FN(kotmh) - -struct BurnDriver BurnDrvKotmh = { - "kotmh", "kotm", "neogeo", NULL, "1991", - "King of the Monsters (set 2)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, kotmhRomInfo, kotmhRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Sengoku / Sengoku Denshou (NGM-017)(NGH-017) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo sengokuRomDesc[] = { - { "017-p1.p1", 0x080000, 0xf8a63983, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "017-p2.p2", 0x020000, 0x3024bbb3, 1 | BRF_ESS | BRF_PRG }, // 1 / TC531024 - - { "017-s1.s1", 0x020000, 0xb246204d, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "017-c1.c1", 0x100000, 0xb4eb82a1, 3 | BRF_GRA }, // 3 Sprite data / TC538200 - { "017-c2.c2", 0x100000, 0xd55c550d, 3 | BRF_GRA }, // 4 / TC538200 - { "017-c3.c3", 0x100000, 0xed51ef65, 3 | BRF_GRA }, // 5 / TC538200 - { "017-c4.c4", 0x100000, 0xf4f3c9cb, 3 | BRF_GRA }, // 6 / TC538200 - - { "017-m1.m1", 0x020000, 0x9b4f34c6, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "017-v1.v1", 0x100000, 0x23663295, 5 | BRF_SND }, // 8 Sound data / TC538200 - { "017-v2.v2", 0x100000, 0xf61e6765, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(sengoku, sengoku, neogeo) -STD_ROM_FN(sengoku) - -struct BurnDriver BurnDrvSengoku = { - "sengoku", NULL, "neogeo", NULL, "1991", - "Sengoku / Sengoku Denshou (NGM-017)(NGH-017)\0", NULL, "SNK", "Neo Geo MVS", - L"Sengoku / Sengoku Denshou (NGM-017)(NGH-017)\0\u6226\u56FD\u4F1D\u627F\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, sengokuRomInfo, sengokuRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Sengoku / Sengoku Denshou (NGH-017)(US) -/* AES VERSION (US) */ - -static struct BurnRomInfo sengokuhRomDesc[] = { - { "017-hp1.p1", 0x080000, 0x33eccae0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "017-p2.p2", 0x020000, 0x3024bbb3, 1 | BRF_ESS | BRF_PRG }, // 1 / TC531024 - - { "017-s1.s1", 0x020000, 0xb246204d, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "017-c1.c1", 0x100000, 0xb4eb82a1, 3 | BRF_GRA }, // 3 Sprite data / TC538200 - { "017-c2.c2", 0x100000, 0xd55c550d, 3 | BRF_GRA }, // 4 / TC538200 - { "017-c3.c3", 0x100000, 0xed51ef65, 3 | BRF_GRA }, // 5 / TC538200 - { "017-c4.c4", 0x100000, 0xf4f3c9cb, 3 | BRF_GRA }, // 6 / TC538200 - - { "017-m1.m1", 0x020000, 0x9b4f34c6, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "017-v1.v1", 0x100000, 0x23663295, 5 | BRF_SND }, // 8 Sound data / TC538200 - { "017-v2.v2", 0x100000, 0xf61e6765, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(sengokuh, sengokuh, neogeo) -STD_ROM_FN(sengokuh) - -struct BurnDriver BurnDrvSengokuh = { - "sengokuh", "sengoku", "neogeo", NULL, "1991", - "Sengoku / Sengoku Denshou (NGH-017)(US)\0", NULL, "SNK", "Neo Geo MVS", - L"Sengoku / Sengoku Denshou (NGH-017)(US)\0\u6226\u56FD\u4F1D\u627F\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, sengokuhRomInfo, sengokuhRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Burning Fight (NGM-018)(NGH-018) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo burningfRomDesc[] = { - { "018-p1.p1", 0x080000, 0x4092c8db, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / HN62434 - - { "018-s1.s1", 0x020000, 0x6799ea0d, 2 | BRF_GRA }, // 1 Text layer tiles / HN62321 - - { "018-c1.c1", 0x100000, 0x25a25e9b, 3 | BRF_GRA }, // 2 Sprite data / HN62408 - { "018-c2.c2", 0x100000, 0xd4378876, 3 | BRF_GRA }, // 3 / HN62408 - { "018-c3.c3", 0x100000, 0x862b60da, 3 | BRF_GRA }, // 4 / HN62408 - { "018-c4.c4", 0x100000, 0xe2e0aff7, 3 | BRF_GRA }, // 5 / HN62408 - - { "018-m1.m1", 0x020000, 0x0c939ee2, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / HN62321A - - { "018-v1.v1", 0x100000, 0x508c9ffc, 5 | BRF_SND }, // 7 Sound data / HN62408 - { "018-v2.v2", 0x100000, 0x854ef277, 5 | BRF_SND }, // 8 / HN62408 -}; - -STDROMPICKEXT(burningf, burningf, neogeo) -STD_ROM_FN(burningf) - -struct BurnDriver BurnDrvBurningf = { - "burningf", NULL, "neogeo", NULL, "1991", - "Burning Fight (NGM-018)(NGH-018)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, burningfRomInfo, burningfRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Burning Fight (NGH-018)(US) -/* AES VERSION (US) */ - -static struct BurnRomInfo burningfhRomDesc[] = { - { "018-hp1.p1", 0x080000, 0xddffcbf4, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / HN62434 - - { "018-s1.s1", 0x020000, 0x6799ea0d, 2 | BRF_GRA }, // 1 Text layer tiles / HN62321 - - { "018-c1.c1", 0x100000, 0x25a25e9b, 3 | BRF_GRA }, // 2 Sprite data / HN62408 - { "018-c2.c2", 0x100000, 0xd4378876, 3 | BRF_GRA }, // 3 / HN62408 - { "018-c3.c3", 0x100000, 0x862b60da, 3 | BRF_GRA }, // 4 / HN62408 - { "018-c4.c4", 0x100000, 0xe2e0aff7, 3 | BRF_GRA }, // 5 / HN62408 - - { "018-m1.m1", 0x020000, 0x0c939ee2, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / HN62321A - - { "018-v1.v1", 0x100000, 0x508c9ffc, 5 | BRF_SND }, // 7 Sound data / HN62408 - { "018-v2.v2", 0x100000, 0x854ef277, 5 | BRF_SND }, // 8 / HN62408 -}; - -STDROMPICKEXT(burningfh, burningfh, neogeo) -STD_ROM_FN(burningfh) - -struct BurnDriver BurnDrvBurningfh = { - "burningfh", "burningf", "neogeo", NULL, "1991", - "Burning Fight (NGH-018)(US)\0", NULL, "SNK", "Neo Geo AES", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, burningfhRomInfo, burningfhRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Burning Fight (prototype, older) -/* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ -/* AES VERSION */ - -static struct BurnRomInfo burningfpRomDesc[] = { - { "018_p1_9397.p1", 0x080000, 0x5b4032e7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "018_p2_e335.p2", 0x080000, 0x78762f68, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "018_s1_9899.s1", 0x020000, 0xf3d130e8, 2 | BRF_GRA }, // 2 Text layer tiles - - { "018_c1_ba06.c11", 0x080000, 0x6569018b, 3 | BRF_GRA }, // 3 Sprite data - { "018_c2_d534.c12", 0x080000, 0x6949b501, 3 | BRF_GRA }, // 4 - { "018_c3_9d70.c13", 0x080000, 0x410f653b, 3 | BRF_GRA }, // 5 - { "018_c4_bf9d.c14", 0x080000, 0xd43bf2a5, 3 | BRF_GRA }, // 6 - { "018_c5_ac9d.c15", 0x080000, 0x837d09d3, 3 | BRF_GRA }, // 7 - { "018_c6_d2a5.c16", 0x080000, 0x5fee51e7, 3 | BRF_GRA }, // 8 - { "018_c7_d568.c17", 0x080000, 0x0f3f0823, 3 | BRF_GRA }, // 9 - { "018_c8_d256.c18", 0x080000, 0x67cc9e34, 3 | BRF_GRA }, // 10 - - { "018_m1_4586.m1", 0x020000, 0x470dd5d4, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "018_v11_56ac.v11", 0x080000, 0xdc07ea3c, 5 | BRF_SND }, // 12 Sound data - { "018_v12_db95.v12", 0x080000, 0xf1ae637c, 5 | BRF_SND }, // 13 - { "018_v21_98dd.v21", 0x080000, 0x9f3b4eda, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(burningfp, burningfp, neogeo) -STD_ROM_FN(burningfp) - -static void BurningfpCallback() -{ - BurnLoadRom(Neo68KROMActive + 0x000000, 0, 2); - BurnLoadRom(Neo68KROMActive + 0x000001, 1, 2); -} - -static INT32 BurningfpInit() -{ - NeoCallbackActive->pInitialise = BurningfpCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvBurningfp = { - "burningfp", "burningf", "neogeo", NULL, "1991", - "Burning Fight (prototype, older)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SPRITE32, GBF_SCRFIGHT, 0, - NULL, burningfpRomInfo, burningfpRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - BurningfpInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Burning Fight (prototype, ver 23.3, 910326) -/* later prototype - Sx, Vx and Cx data all matches final game, but with different rom arranagement, Px & Mx unique */ -/* MVS VERSION */ - -static struct BurnRomInfo burningfpaRomDesc[] = { - { "018_p1_1f28.podd", 0x080000, 0xf7d15752, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "018_p2_3217.peven", 0x080000, 0xffae22fb, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "018_s1_4491.s1", 0x020000, 0x6799ea0d, 2 | BRF_GRA }, // 2 Text layer tiles - - { "018_c1_2505.c1", 0x080000, 0x3a441c6a, 3 | BRF_GRA }, // 3 Sprite data - { "018_c2_3f55.c2", 0x080000, 0xbb72404b, 3 | BRF_GRA }, // 4 - { "018_c3_a20d.c3", 0x080000, 0x87bffd2f, 3 | BRF_GRA }, // 5 - { "018_c4_c6e1.c4", 0x080000, 0x33803163, 3 | BRF_GRA }, // 6 - { "018_c5_2cd1.c5", 0x080000, 0x74391952, 3 | BRF_GRA }, // 7 - { "018_c6_8135.c6", 0x080000, 0x95e220e6, 3 | BRF_GRA }, // 8 - { "018_c7_d009.c7", 0x080000, 0x41326c0d, 3 | BRF_GRA }, // 9 - { "018_c8_dc63.c8", 0x080000, 0xed3b1f04, 3 | BRF_GRA }, // 10 - - { "018_m1_d13e.m1", 0x020000, 0x2b0c0415, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "018_v11_6c00.v11", 0x080000, 0xb55b9670, 5 | BRF_SND }, // 12 Sound data - { "018_v12_8146.v12", 0x080000, 0xa0bcf260, 5 | BRF_SND }, // 13 - { "018_v13_b813.v13", 0x080000, 0x270f4707, 5 | BRF_SND }, // 14 - { "018_v24_22ee.v24", 0x080000, 0x924e3d69, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(burningfpa, burningfpa, neogeo) -STD_ROM_FN(burningfpa) - -struct BurnDriver BurnDrvBurningfpa = { - "burningfpa", "burningf", "neogeo", NULL, "1991", - "Burning Fight (prototype, ver 23.3, 910326)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SPRITE32, GBF_SCRFIGHT, 0, - NULL, burningfpaRomInfo, burningfpaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - BurningfpInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// League Bowling (NGM-019)(NGH-019) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo lbowlingRomDesc[] = { - { "019-p1.p1", 0x080000, 0xa2de8445, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "019-s1.s1", 0x020000, 0x5fcdc0ed, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "019-c1.c1", 0x080000, 0x4ccdef18, 3 | BRF_GRA }, // 2 Sprite data / TC534200 - { "019-c2.c2", 0x080000, 0xd4dd0802, 3 | BRF_GRA }, // 3 / TC534200 - - { "019-m1.m1", 0x020000, 0xd568c17d, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / TC531001 - - { "019-v11.v11", 0x080000, 0x0fb74872, 5 | BRF_SND }, // 5 Sound data / TC534000 - { "019-v12.v12", 0x080000, 0x029faa57, 5 | BRF_SND }, // 6 / TC534000 - { "019-v21.v21", 0x080000, 0x2efd5ada, 6 | BRF_SND }, // 7 / TC534000 - - { "hd6301v1p.com", 0x001000, 0x00000000, BRF_OPT | BRF_NODUMP }, // Hitachi HD6301V1 MCU -}; - -STDROMPICKEXT(lbowling, lbowling, neogeo) -STD_ROM_FN(lbowling) - -struct BurnDriver BurnDrvLbowling = { - "lbowling", NULL, "neogeo", NULL, "1990", - "League Bowling (NGM-019)(NGH-019)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, lbowlingRomInfo, lbowlingRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Ghost Pilots (NGM-020)(NGH-020) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo gpilotsRomDesc[] = { - { "020-p1.p1", 0x080000, 0xe6f2fe64, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "020-p2.p2", 0x020000, 0xedcb22ac, 1 | BRF_ESS | BRF_PRG }, // 1 / TC531024 - - { "020-s1.s1", 0x020000, 0xa6d83d53, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "020-c1.c1", 0x100000, 0xbd6fe78e, 3 | BRF_GRA }, // 3 Sprite data / TC538200 - { "020-c2.c2", 0x100000, 0x5f4a925c, 3 | BRF_GRA }, // 4 / TC538200 - { "020-c3.c3", 0x100000, 0xd1e42fd0, 3 | BRF_GRA }, // 5 / TC538200 - { "020-c4.c4", 0x100000, 0xedde439b, 3 | BRF_GRA }, // 6 / TC538200 - - { "020-m1.m1", 0x020000, 0x48409377, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "020-v11.v11", 0x100000, 0x1b526c8b, 5 | BRF_SND }, // 8 Sound data / TC538200 - { "020-v12.v12", 0x080000, 0x4a9e6f03, 5 | BRF_SND }, // 9 / TC534200 - { "020-v21.v21", 0x080000, 0x7abf113d, 6 | BRF_SND }, // 10 / TC534200 -}; - -STDROMPICKEXT(gpilots, gpilots, neogeo) -STD_ROM_FN(gpilots) - -struct BurnDriver BurnDrvGpilots = { - "gpilots", NULL, "neogeo", NULL, "1991", - "Ghost Pilots (NGM-020)(NGH-020)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VERSHOOT, 0, - NULL, gpilotsRomInfo, gpilotsRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Ghost Pilots (NGH-020)(US) -/* AES VERSION (US) */ - -static struct BurnRomInfo gpilotshRomDesc[] = { - { "020-hp1.p1", 0x080000, 0x7cdb01ce, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "020-p2.p2", 0x020000, 0xedcb22ac, 1 | BRF_ESS | BRF_PRG }, // 1 / TC531024 - - { "020-s1.s1", 0x020000, 0xa6d83d53, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "020-c1.c1", 0x100000, 0xbd6fe78e, 3 | BRF_GRA }, // 3 Sprite data / TC538200 - { "020-c2.c2", 0x100000, 0x5f4a925c, 3 | BRF_GRA }, // 4 / TC538200 - { "020-c3.c3", 0x100000, 0xd1e42fd0, 3 | BRF_GRA }, // 5 / TC538200 - { "020-c4.c4", 0x100000, 0xedde439b, 3 | BRF_GRA }, // 6 / TC538200 - - { "020-m1.m1", 0x020000, 0x48409377, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "020-v11.v11", 0x100000, 0x1b526c8b, 5 | BRF_SND }, // 8 Sound data / TC538200 - { "020-v12.v12", 0x080000, 0x4a9e6f03, 5 | BRF_SND }, // 9 / TC534200 - { "020-v21.v21", 0x080000, 0x7abf113d, 6 | BRF_SND }, // 10 / TC534200 -}; - -STDROMPICKEXT(gpilotsh, gpilotsh, neogeo) -STD_ROM_FN(gpilotsh) - -struct BurnDriver BurnDrvGpilotsh = { - "gpilotsh", "gpilots", "neogeo", NULL, "1991", - "Ghost Pilots (NGH-020)(US)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VERSHOOT, 0, - NULL, gpilotshRomInfo, gpilotshRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Puzzled / Joy Joy Kid (NGM-021)(NGH-021) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo joyjoyRomDesc[] = { - { "021-p1.p1", 0x080000, 0x39c3478f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / MB834200 - - { "021-s1.s1", 0x020000, 0x6956d778, 2 | BRF_GRA }, // 1 Text layer tiles / MB831000 - - { "021-c1.c1", 0x080000, 0x509250ec, 3 | BRF_GRA }, // 2 Sprite data / MB834200 - { "021-c2.c2", 0x080000, 0x09ed5258, 3 | BRF_GRA }, // 3 / MB834200 - - { "021-m1.m1", 0x040000, 0x5a4be5e8, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / MB832000 - - { "021-v11.v11", 0x080000, 0x66c1e5c4, 5 | BRF_SND }, // 5 Sound data / MB834200 - { "021-v21.v21", 0x080000, 0x8ed20a86, 6 | BRF_SND }, // 6 / MB834200 -}; - -STDROMPICKEXT(joyjoy, joyjoy, neogeo) -STD_ROM_FN(joyjoy) - -struct BurnDriver BurnDrvJoyjoy = { - "joyjoy", NULL, "neogeo", NULL, "1990", - "Puzzled / Joy Joy Kid (NGM-021)(NGH-021)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, joyjoyRomInfo, joyjoyRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Quiz Daisousa Sen - The Last Count Down (NGM-023)(NGH-023) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo quizdaisRomDesc[] = { - { "023-p1.p1", 0x100000, 0xc488fda3, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "023-s1.s1", 0x020000, 0xac31818a, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "023-c1.c1", 0x100000, 0x2999535a, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "023-c2.c2", 0x100000, 0x876a99e6, 3 | BRF_GRA }, // 3 / TC538200 - - { "023-m1.m1", 0x020000, 0x2a2105e0, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / TC531001 - - { "023-v1.v1", 0x100000, 0xa53e5bd3, 5 | BRF_SND }, // 5 Sound data / TC538200 -}; - -STDROMPICKEXT(quizdais, quizdais, neogeo) -STD_ROM_FN(quizdais) - -struct BurnDriver BurnDrvQuizdais = { - "quizdais", NULL, "neogeo", NULL, "1991", - "Quiz Daisousa Sen - The Last Count Down (NGM-023)(NGH-023)\0", NULL, "SNK", "Neo Geo MVS", - L"\u30AF\u30A4\u30BA\u5927\u635C\u67FB\u7DDA - the last count down\0Quiz Daisousa Sen - The Last Count Down (NGM-023)(NGH-023)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_QUIZ, 0, - NULL, quizdaisRomInfo, quizdaisRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Quiz Daisousa Sen - The Last Count Down (Korean release) -/* KOREAN VERSION */ - -static struct BurnRomInfo quizdaiskRomDesc[] = { - { "123-p1.p1", 0x100000, 0xa6f35eae, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "123-s1.s1", 0x020000, 0x53de938a, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "123-c1.c1", 0x100000, 0xe579a606, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "123-c2.c2", 0x100000, 0xe182c837, 3 | BRF_GRA }, // 3 / TC538200 - - { "123-m1.m1", 0x020000, 0xd67f53f9, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / TC531001 - - { "123-v1.v1", 0x200000, 0x986f4af9, 5 | BRF_SND }, // 5 Sound data / TC5316200 -}; - -STDROMPICKEXT(quizdaisk, quizdaisk, neogeo) -STD_ROM_FN(quizdaisk) - -struct BurnDriver BurnDrvQuizdaisk = { - "quizdaisk", "quizdais", "neogeo", NULL, "1991", - "Quiz Daisousa Sen - The Last Count Down (Korean release)\0", NULL, "SNK", "Neo Geo MVS", - L"\u30AF\u30A4\u30BA\u5927\u635C\u67FB\u7DDA - The Last Count Down\0Quiz Daisousa Sen - The Last Count Down (Korean release)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_QUIZ, 0, - NULL, quizdaiskRomInfo, quizdaiskRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Last Resort - -static struct BurnRomInfo lresortRomDesc[] = { - { "024-p1.p1", 0x080000, 0x89c4ab97, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "024-s1.s1", 0x020000, 0x5cef5cc6, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "024-c1.c1", 0x100000, 0x3617c2dc, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "024-c2.c2", 0x100000, 0x3f0a7fd8, 3 | BRF_GRA }, // 3 / TC538200 - { "024-c3.c3", 0x080000, 0xe9f745f8, 3 | BRF_GRA }, // 4 / TC538200 - { "024-c4.c4", 0x080000, 0x7382fefb, 3 | BRF_GRA }, // 5 / TC538200 - - { "024-m1.m1", 0x020000, 0xcec19742, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "024-v1.v1", 0x100000, 0xefdfa063, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "024-v2.v2", 0x100000, 0x3c7997c0, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(lresort, lresort, neogeo) -STD_ROM_FN(lresort) - -struct BurnDriver BurnDrvLresort = { - "lresort", NULL, "neogeo", NULL, "1992", - "Last Resort\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_HORSHOOT, 0, - NULL, lresortRomInfo, lresortRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Last Resort (prototype) -/* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ -/* MVS VERSION */ - -static struct BurnRomInfo lresortpRomDesc[] = { - { "024_p1_5937.podd", 0x080000, 0x8e6008ee, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "024_p2_8d37.peven", 0x080000, 0x6d9ee90f, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "024_s1_22fe.s1", 0x020000, 0x5cef5cc6, 2 | BRF_GRA }, // 2 Text layer tiles - - { "024_c1_b764.c1", 0x080000, 0x677749ec, 3 | BRF_GRA }, // 3 Sprite data - { "024_c2_1951.c2", 0x080000, 0x104d7b59, 3 | BRF_GRA }, // 4 - { "024_c3_0f63.c3", 0x080000, 0xb0965a74, 3 | BRF_GRA }, // 5 - { "024_c4_c5b5.c4", 0x080000, 0xdcfc3860, 3 | BRF_GRA }, // 6 - { "024_c5_dd03.c5", 0x080000, 0x50322397, 3 | BRF_GRA }, // 7 - { "024_c6_c81a.c6", 0x080000, 0xc3c93894, 3 | BRF_GRA }, // 8 - { "024_c7_5edc.c7", 0x080000, 0x21faf72b, 3 | BRF_GRA }, // 9 - { "024_c8_0850.c8", 0x080000, 0xfb57217b, 3 | BRF_GRA }, // 10 - - { "024_m1_fc7a.m1", 0x020000, 0x22122875, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "024_v11_b085.v11", 0x080000, 0x0722da38, 5 | BRF_SND }, // 12 Sound data - { "024_v12_d3b7.v12", 0x080000, 0x670ce3ec, 5 | BRF_SND }, // 13 - { "024_v13_a31e.v13", 0x080000, 0x2e39462b, 5 | BRF_SND }, // 14 - { "024_v24_2f0f.v24", 0x080000, 0x7944754f, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(lresortp, lresortp, neogeo) -STD_ROM_FN(lresortp) - -static void LresortpCallback() -{ - BurnLoadRom(Neo68KROMActive + 0x000000, 0, 2); - BurnLoadRom(Neo68KROMActive + 0x000001, 1, 2); -} - -static INT32 LresortpInit() -{ - NeoCallbackActive->pInitialise = LresortpCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvLresortp = { - "lresortp", "lresort", "neogeo", NULL, "1992", - "Last Resort (prototype)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SPRITE32, GBF_SCRFIGHT, 0, - NULL, lresortpRomInfo, lresortpRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - LresortpInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Eight Man (NGM-025)(NGH-025) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo eightmanRomDesc[] = { - { "025-p1.p1", 0x080000, 0x43344cb0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC574200 - - { "025-s1.s1", 0x020000, 0xa402202b, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "025-c1.c1", 0x100000, 0x555e16a4, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "025-c2.c2", 0x100000, 0xe1ee51c3, 3 | BRF_GRA }, // 3 / TC538200 - { "025-c3.c3", 0x080000, 0x0923d5b0, 3 | BRF_GRA }, // 4 / TC538200 - { "025-c4.c4", 0x080000, 0xe3eca67b, 3 | BRF_GRA }, // 5 / TC538200 - - { "025-m1.m1", 0x020000, 0x9927034c, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC541000 - - { "025-v1.v1", 0x100000, 0x4558558a, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "025-v2.v2", 0x100000, 0xc5e052e9, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(eightman, eightman, neogeo) -STD_ROM_FN(eightman) - -struct BurnDriver BurnDrvEightman = { - "eightman", NULL, "neogeo", NULL, "1991", - "Eight Man (NGM-025)(NGH-025)\0", NULL, "SNK / Pallas", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, eightmanRomInfo, eightmanRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Legend of Success Joe / Ashitano Joe Densetsu - -static struct BurnRomInfo legendosRomDesc[] = { - { "029-p1.p1", 0x080000, 0x9d563f19, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "029-s1.s1", 0x020000, 0xbcd502f0, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "029-c1.c1", 0x100000, 0x2f5ab875, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "029-c2.c2", 0x100000, 0x318b2711, 3 | BRF_GRA }, // 3 / TC538200 - { "029-c3.c3", 0x100000, 0x6bc52cb2, 3 | BRF_GRA }, // 4 / TC538200 - { "029-c4.c4", 0x100000, 0x37ef298c, 3 | BRF_GRA }, // 5 / TC538200 - - { "029-m1.m1", 0x020000, 0x6f2843f0, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "029-v1.v1", 0x100000, 0x85065452, 5 | BRF_SND }, // 7 Sound data / TC538200 -}; - -STDROMPICKEXT(legendos, legendos, neogeo) -STD_ROM_FN(legendos) - -struct BurnDriver BurnDrvLegendos = { - "legendos", NULL, "neogeo", NULL, "1991", - "Legend of Success Joe / Ashitano Joe Densetsu\0", NULL, "SNK / WAVE", "Neo Geo MVS", - L"Legend of Success Joe / Ashitano Joe Densetsu\0\u3042\u3057\u305F\u306E\u30B8\u30E7\u30FC\u4F1D\u8AAC\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, legendosRomInfo, legendosRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// 2020 Super Baseball (set 1) - -static struct BurnRomInfo bb2020RomDesc[] = { - { "030-p1.p1", 0x080000, 0xd396c9cb, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - /* also found AES set with p1 on TC534200 on board NEO-AEG PROG42G; chip label is 030-p1 - and m1 on TC531001 on board NEO-AEG CHA42G; chip label is 030-M1. Other chip labels are the same */ - - { "030-s1.s1", 0x020000, 0x7015b8fc, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "030-c1.c1", 0x100000, 0x4f5e19bd, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "030-c2.c2", 0x100000, 0xd6314bf0, 3 | BRF_GRA }, // 3 / TC538200 - { "030-c3.c3", 0x100000, 0x47fddfee, 3 | BRF_GRA }, // 4 / TC538200 - { "030-c4.c4", 0x100000, 0x780d1c4e, 3 | BRF_GRA }, // 5 / TC538200 - - { "030-m1.m1", 0x020000, 0x4cf466ec, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC54H1000 - - { "030-v1.v1", 0x100000, 0xd4ca364e, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "030-v2.v2", 0x100000, 0x54994455, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(bb2020, bb2020, neogeo) -STD_ROM_FN(bb2020) - -struct BurnDriver BurnDrvbb2020 = { - "2020bb", NULL, "neogeo", NULL, "1991", - "2020 Super Baseball (set 1)\0", NULL, "SNK / Pallas", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, bb2020RomInfo, bb2020RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// 2020 Super Baseball (set 2) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo bba2020RomDesc[] = { - { "030-epr.p1", 0x080000, 0xc59be3dd, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC754200 - /* P1 on eprom, correct chip label unknown */ - - { "030-s1.s1", 0x020000, 0x7015b8fc, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "030-c1.c1", 0x100000, 0x4f5e19bd, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "030-c2.c2", 0x100000, 0xd6314bf0, 3 | BRF_GRA }, // 3 / TC538200 - { "030-c3.c3", 0x100000, 0x47fddfee, 3 | BRF_GRA }, // 4 / TC538200 - { "030-c4.c4", 0x100000, 0x780d1c4e, 3 | BRF_GRA }, // 5 / TC538200 - - { "030-m1.m1", 0x020000, 0x4cf466ec, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC54H1000 - - { "030-v1.v1", 0x100000, 0xd4ca364e, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "030-v2.v2", 0x100000, 0x54994455, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(bba2020, bba2020, neogeo) -STD_ROM_FN(bba2020) - -struct BurnDriver BurnDrvbba2020 = { - "2020bba", "2020bb", "neogeo", NULL, "1991", - "2020 Super Baseball (set 2)\0", NULL, "SNK / Pallas", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, bba2020RomInfo, bba2020RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// 2020 Super Baseball (set 3) - -static struct BurnRomInfo bbh2020RomDesc[] = { - { "030-pg1.p1", 0x080000, 0x12d048d7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - /* Chip label p1h does not exist, renamed temporarly to pg1, marked BAD_DUMP. This needs to be verified. */ - - { "030-s1.s1", 0x020000, 0x7015b8fc, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "030-c1.c1", 0x100000, 0x4f5e19bd, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "030-c2.c2", 0x100000, 0xd6314bf0, 3 | BRF_GRA }, // 3 / TC538200 - { "030-c3.c3", 0x100000, 0x47fddfee, 3 | BRF_GRA }, // 4 / TC538200 - { "030-c4.c4", 0x100000, 0x780d1c4e, 3 | BRF_GRA }, // 5 / TC538200 - - { "030-m1.m1", 0x020000, 0x4cf466ec, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC54H1000 - - { "030-v1.v1", 0x100000, 0xd4ca364e, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "030-v2.v2", 0x100000, 0x54994455, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(bbh2020, bbh2020, neogeo) -STD_ROM_FN(bbh2020) - -struct BurnDriver BurnDrvbbh2020 = { - "2020bbh", "2020bb", "neogeo", NULL, "1991", - "2020 Super Baseball (set 3)\0", NULL, "SNK / Pallas", "Neo Geo AES", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, bbh2020RomInfo, bbh2020RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Soccer Brawl (NGM-031) -/* MVS VERSION */ - -static struct BurnRomInfo socbrawlRomDesc[] = { - { "031-pg1.p1", 0x080000, 0x17f034a7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "031-s1.s1", 0x020000, 0x4c117174, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "031-c1.c1", 0x100000, 0xbd0a4eb8, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "031-c2.c2", 0x100000, 0xefde5382, 3 | BRF_GRA }, // 3 / TC538200 - { "031-c3.c3", 0x080000, 0x580f7f33, 3 | BRF_GRA }, // 4 / TC538200 - { "031-c4.c4", 0x080000, 0xed297de8, 3 | BRF_GRA }, // 5 / TC538200 - - { "031-m1.m1", 0x020000, 0xcb37427c, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "031-v1.v1", 0x100000, 0xcc78497e, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "031-v2.v2", 0x100000, 0xdda043c6, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(socbrawl, socbrawl, neogeo) -STD_ROM_FN(socbrawl) - -struct BurnDriver BurnDrvSocbrawl = { - "socbrawl", NULL, "neogeo", NULL, "1991", - "Soccer Brawl (NGM-031)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSFOOTBALL, 0, - NULL, socbrawlRomInfo, socbrawlRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Soccer Brawl (NGH-031) -/* AES VERSION */ - -static struct BurnRomInfo socbrawlhRomDesc[] = { - { "031-p1.p1", 0x080000, 0xa2801c24, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "031-s1.s1", 0x020000, 0x4c117174, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "031-c1.c1", 0x100000, 0xbd0a4eb8, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "031-c2.c2", 0x100000, 0xefde5382, 3 | BRF_GRA }, // 3 / TC538200 - { "031-c3.c3", 0x080000, 0x580f7f33, 3 | BRF_GRA }, // 4 / TC534200 - { "031-c4.c4", 0x080000, 0xed297de8, 3 | BRF_GRA }, // 5 / TC534200 - - { "031-m1.m1", 0x020000, 0xcb37427c, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "031-v1.v1", 0x100000, 0xcc78497e, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "031-v2.v2", 0x100000, 0xdda043c6, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(socbrawlh, socbrawlh, neogeo) -STD_ROM_FN(socbrawlh) - -struct BurnDriver BurnDrvSocbrawlh = { - "socbrawlh", "socbrawl", "neogeo", NULL, "1991", - "Soccer Brawl (NGH-031)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSFOOTBALL, 0, - NULL, socbrawlhRomInfo, socbrawlhRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Robo Army (set 1) - -static struct BurnRomInfo roboarmyRomDesc[] = { - { "032-p1.p1", 0x080000, 0xcd11cbd4, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "032-s1.s1", 0x020000, 0xac0daa1b, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "032-c1.c1", 0x100000, 0x97984c6c, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "032-c2.c2", 0x100000, 0x65773122, 3 | BRF_GRA }, // 3 / TC538200 - { "032-c3.c3", 0x080000, 0x40adfccd, 3 | BRF_GRA }, // 4 / TC534200 - { "032-c4.c4", 0x080000, 0x462571de, 3 | BRF_GRA }, // 5 / TC534200 - - { "032-m1.m1", 0x020000, 0x35ec952d, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "032-v1.v1", 0x100000, 0x63791533, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "032-v2.v2", 0x100000, 0xeb95de70, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(roboarmy, roboarmy, neogeo) -STD_ROM_FN(roboarmy) - -struct BurnDriver BurnDrvRoboarmy = { - "roboarmy", NULL, "neogeo", NULL, "1991", - "Robo Army (set 1)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, roboarmyRomInfo, roboarmyRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Robo Army (NGM-032) (NGH-032) -/* MVS AND AES VERSION*/ - -static struct BurnRomInfo roboarmaRomDesc[] = { - /* Found on legitimate Robo Army MVS and AES Carts. Debug code button which check control a sound test has been patched out - because in a multislot situation that code could have been enabled that would stop roboarmy from working, sending it into an infinite loop ; - correct chip label unknown */ - { "032-epr.p1", 0x080000, 0x27c773cb, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / D27C4000 - - { "032-s1.s1", 0x020000, 0xac0daa1b, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "032-c1.c1", 0x100000, 0x97984c6c, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "032-c2.c2", 0x100000, 0x65773122, 3 | BRF_GRA }, // 3 / TC538200 - { "032-c3.c3", 0x080000, 0x40adfccd, 3 | BRF_GRA }, // 4 / TC534200 - { "032-c4.c4", 0x080000, 0x462571de, 3 | BRF_GRA }, // 5 / TC534200 - - { "032-m1.m1", 0x020000, 0x35ec952d, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "032-v1.v1", 0x100000, 0x63791533, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "032-v2.v2", 0x100000, 0xeb95de70, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(roboarma, roboarma, neogeo) -STD_ROM_FN(roboarma) - -struct BurnDriver BurnDrvRoboarma = { - "roboarma", "roboarmy", "neogeo", NULL, "1991", - "Robo Army (set 2)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, roboarmaRomInfo, roboarmaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Fatal Fury - King of Fighters / Garou Densetsu - shukumei no tatakai (NGM-033)(NGH-033) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo fatfury1RomDesc[] = { - { "033-p1.p1", 0x080000, 0x47ebdc2f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "033-p2.p2", 0x020000, 0xc473af1c, 1 | BRF_ESS | BRF_PRG }, // 1 / TC531024 - - { "033-s1.s1", 0x020000, 0x3c3bdf8c, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "033-c1.c1", 0x100000, 0x74317e54, 3 | BRF_GRA }, // 3 Sprite data / TC538200 - { "033-c2.c2", 0x100000, 0x5bb952f3, 3 | BRF_GRA }, // 4 / TC538200 - { "033-c3.c3", 0x100000, 0x9b714a7c, 3 | BRF_GRA }, // 5 / TC538200 - { "033-c4.c4", 0x100000, 0x9397476a, 3 | BRF_GRA }, // 6 / TC538200 - - { "033-m1.m1", 0x020000, 0x5be10ffd, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "033-v1.v1", 0x100000, 0x212fd20d, 5 | BRF_SND }, // 8 Sound data / TC538200 - { "033-v2.v2", 0x100000, 0xfa2ae47f, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(fatfury1, fatfury1, neogeo) -STD_ROM_FN(fatfury1) - -struct BurnDriver BurnDrvFatFury1 = { - "fatfury1", NULL, "neogeo", NULL, "1992", - "Fatal Fury - King of Fighters / Garou Densetsu - shukumei no tatakai (NGM-033)(NGH-033)\0", NULL, "SNK", "Neo Geo MVS", - L"Fatal Fury - King of Fighters\0\u9913\u72FC\u4F1D\u8AAC - \u5BBF\u547D\u306E\u95D8\u3044 (NGM-033)(NGH-033)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, fatfury1RomInfo, fatfury1RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Football Frenzy (NGM-034)(NGH-034) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo fbfrenzyRomDesc[] = { - { "034-p1.p1", 0x080000, 0xcdef6b19, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "034-s1.s1", 0x020000, 0x8472ed44, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "034-c1.c1", 0x100000, 0x91c56e78, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "034-c2.c2", 0x100000, 0x9743ea2f, 3 | BRF_GRA }, // 3 / TC538200 - { "034-c3.c3", 0x080000, 0xe5aa65f5, 3 | BRF_GRA }, // 4 / TC534200 - { "034-c4.c4", 0x080000, 0x0eb138cc, 3 | BRF_GRA }, // 5 / TC534200 - - { "034-m1.m1", 0x020000, 0xf41b16b8, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "034-v1.v1", 0x100000, 0x50c9d0dd, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "034-v2.v2", 0x100000, 0x5aa15686, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(fbfrenzy, fbfrenzy, neogeo) -STD_ROM_FN(fbfrenzy) - -struct BurnDriver BurnDrvFbfrenzy = { - "fbfrenzy", NULL, "neogeo", NULL, "1992", - "Football Frenzy (NGM-034)(NGH-034)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, fbfrenzyRomInfo, fbfrenzyRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// King of the Monsters 2 - The Next Thing(NGM-039)(NGH-039) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo kotm2RomDesc[] = { - { "039-p1.p1", 0x080000, 0xb372d54c, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "039-p2.p2", 0x080000, 0x28661afe, 1 | BRF_ESS | BRF_PRG }, // 1 / TC534200 - - { "039-s1.s1", 0x020000, 0x63ee053a, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "039-c1.c1", 0x200000, 0x6d1c4aa9, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "039-c2.c2", 0x200000, 0xf7b75337, 3 | BRF_GRA }, // 4 / TC5316200 - { "039-c3.c3", 0x080000, 0xbfc4f0b2, 3 | BRF_GRA }, // 5 / TC534200 - { "039-c4.c4", 0x080000, 0x81c9c250, 3 | BRF_GRA }, // 6 / TC534200 - - { "039-m1.m1", 0x020000, 0x0c5b2ad5, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "039-v2.v2", 0x200000, 0x86d34b25, 5 | BRF_SND }, // 8 Sound data / TC5316200 - { "039-v4.v4", 0x100000, 0x8fa62a0b, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(kotm2, kotm2, neogeo) -STD_ROM_FN(kotm2) - -struct BurnDriver BurnDrvKotm2 = { - "kotm2", NULL, "neogeo", NULL, "1992", - "King of the Monsters 2 - The Next Thing (NGM-039)(NGH-039)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, 0, - NULL, kotm2RomInfo, kotm2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// King of the Monsters 2 - The Next Thing (older) -/* MVS VERSION */ - -static struct BurnRomInfo kotm2aRomDesc[] = { - { "039_p1.p1", 0x080000, 0x8d186638, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "039-p2.p2", 0x080000, 0x28661afe, 1 | BRF_ESS | BRF_PRG }, // 1 / TC534200 - - { "039-s1.s1", 0x020000, 0x63ee053a, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "039-c1.c1", 0x200000, 0x6d1c4aa9, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "039-c2.c2", 0x200000, 0xf7b75337, 3 | BRF_GRA }, // 4 / TC5316200 - { "039-c3.c3", 0x080000, 0xbfc4f0b2, 3 | BRF_GRA }, // 5 / TC534200 - { "039-c4.c4", 0x080000, 0x81c9c250, 3 | BRF_GRA }, // 6 / TC534200 - - { "039-m1.m1", 0x020000, 0x0c5b2ad5, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "039-v2.v2", 0x200000, 0x86d34b25, 5 | BRF_SND }, // 8 Sound data / TC5316200 - { "039-v4.v4", 0x100000, 0x8fa62a0b, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(kotm2a, kotm2a, neogeo) -STD_ROM_FN(kotm2a) - -struct BurnDriver BurnDrvKotm2a = { - "kotm2a", "kotm2", "neogeo", NULL, "1992", - "King of the Monsters 2 - The Next Thing (older)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, 0, - NULL, kotm2aRomInfo, kotm2aRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// King of the Monsters 2 - The Next Thing (prototype) -/* fairly late prototype release, only the code differs from the main set */ - -static struct BurnRomInfo kotm2pRomDesc[] = { - { "proto_039-p1.p1", 0x080000, 0x3c1d17e7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "proto_039-p2.p2", 0x080000, 0xbc9691f0, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "039-s1.s1", 0x020000, 0x63ee053a, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - // same data as main set, but prototype board layout - { "proto_039-c1.c1", 0x100000, 0x7192a787, 3 | BRF_GRA }, // 3 Sprite data - { "proto_039-c2.c2", 0x100000, 0x7157eca1, 3 | BRF_GRA }, // 4 - { "proto_039-c3.c3", 0x100000, 0x11d75727, 3 | BRF_GRA }, // 5 - { "proto_039-c4.c4", 0x100000, 0x7ad48b28, 3 | BRF_GRA }, // 6 - { "proto_039-c5.c5", 0x080000, 0x5bdaf9ca, 3 | BRF_GRA }, // 7 - { "proto_039-c6.c6", 0x080000, 0x21d4be8c, 3 | BRF_GRA }, // 8 - { "proto_039-c7.c7", 0x080000, 0xda55fd00, 3 | BRF_GRA }, // 9 - { "proto_039-c8.c8", 0x080000, 0x592e9267, 3 | BRF_GRA }, // 10 - - { "039-m1.m1", 0x020000, 0x0c5b2ad5, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - // same data as main set, but prototype board layout - { "proto_039-v1.v1", 0x080000, 0xdd3566f1, 5 | BRF_SND }, // 12 Sound data - { "proto_039-v2.v2", 0x080000, 0x57f60274, 5 | BRF_SND }, // 13 - { "proto_039-v3.v3", 0x080000, 0x0f008a07, 5 | BRF_SND }, // 14 - { "proto_039-v4.v4", 0x080000, 0x1943d0fe, 5 | BRF_SND }, // 15 - { "proto_039-v5.v5", 0x080000, 0x13be045b, 5 | BRF_SND }, // 16 - { "proto_039-v6.v6", 0x080000, 0xd1dd3fd6, 5 | BRF_SND }, // 17 -}; - -STDROMPICKEXT(kotm2p, kotm2p, neogeo) -STD_ROM_FN(kotm2p) - -static void Kotm2pCallback() -{ - BurnLoadRom(Neo68KROMActive + 0x000000, 0, 2); - BurnLoadRom(Neo68KROMActive + 0x000001, 1, 2); -} - -static INT32 Kotm2pInit() -{ - NeoCallbackActive->pInitialise = Kotm2pCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvKotm2p = { - "kotm2p", "kotm2", "neogeo", NULL, "1992", - "King of the Monsters 2 - The Next Thing (prototype)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SPRITE32, GBF_VSFIGHT, 0, - NULL, kotm2pRomInfo, kotm2pRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - Kotm2pInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Sengoku 2 / Sengoku Denshou 2 - -static struct BurnRomInfo sengoku2RomDesc[] = { - /* also found AES set with PROG board NEO-AEG PROG16 and CHA board NEO-AEG CHA42G-1; - same chip labels */ - { "040-p1.p1", 0x100000, 0x6dde02c2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "040-s1.s1", 0x020000, 0xcd9802a3, 2 | BRF_GRA }, // 1 Text layer tiles / TC531001 - - { "040-c1.c1", 0x200000, 0xfaa8ea99, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "040-c2.c2", 0x200000, 0x87d0ec65, 3 | BRF_GRA }, // 3 / TC5316200 - { "040-c3.c3", 0x080000, 0x24b5ba80, 3 | BRF_GRA }, // 4 / TC534200 - { "040-c4.c4", 0x080000, 0x1c9e9930, 3 | BRF_GRA }, // 5 / TC534200 - - { "040-m1.m1", 0x020000, 0xd4de4bca, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "040-v1.v1", 0x200000, 0x71cb4b5d, 5 | BRF_SND }, // 7 Sound data / TC5316200 - // AES has different chip location, data is the same: 040-v1.v2 / TC5316200 - { "040-v2.v2", 0x100000, 0xc5cece01, 5 | BRF_SND }, // 8 / TC538200 - // AES has different chip location, data is the same: 040-v2.v4 / TC538200 -}; - -STDROMPICKEXT(sengoku2, sengoku2, neogeo) -STD_ROM_FN(sengoku2) - -struct BurnDriver BurnDrvSengoku2 = { - "sengoku2", NULL, "neogeo", NULL, "1993", - "Sengoku 2 / Sengoku Denshou 2\0", NULL, "SNK", "Neo Geo MVS", - L"Sengoku 2\0\u6226\u56FD\u4F1D\u627F\uFF12\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_SCRFIGHT, 0, - NULL, sengoku2RomInfo, sengoku2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Baseball Stars 2 - -static struct BurnRomInfo bstars2RomDesc[] = { - /* also found AES set with PROG board NEO-AEG PROG42G-1 and CHA board NEO-AEG CHA42G-1; - same chip labels */ - { "041-p1.p1", 0x080000, 0x523567fd, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "041-s1.s1", 0x020000, 0x015c5c94, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "041-c1.c1", 0x100000, 0xb39a12e1, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "041-c2.c2", 0x100000, 0x766cfc2f, 3 | BRF_GRA }, // 3 / TC538200 - { "041-c3.c3", 0x100000, 0xfb31339d, 3 | BRF_GRA }, // 4 / TC538200 - { "041-c4.c4", 0x100000, 0x70457a0c, 3 | BRF_GRA }, // 5 / TC538200 - - { "041-m1.m1", 0x020000, 0x15c177a6, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "041-v1.v1", 0x100000, 0xcb1da093, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "041-v2.v2", 0x100000, 0x1c954a9d, 5 | BRF_SND }, // 8 / TC538200 - { "041-v3.v3", 0x080000, 0xafaa0180, 5 | BRF_SND }, // 9 / TC534200 -}; - -STDROMPICKEXT(bstars2, bstars2, neogeo) -STD_ROM_FN(bstars2) - -struct BurnDriver BurnDrvBstars2 = { - "bstars2", NULL, "neogeo", NULL, "1992", - "Baseball Stars 2\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, bstars2RomInfo, bstars2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Quiz Meitantei Neo & Geo - Quiz Daisousa Sen part 2 (NGM-042)(NGH-042) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo quizdai2RomDesc[] = { - { "042-p1.p1", 0x100000, 0xed719dcf, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "042-s1.s1", 0x020000, 0x164fd6e6, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "042-c1.c1", 0x100000, 0xcb5809a1, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "042-c2.c2", 0x100000, 0x1436dfeb, 3 | BRF_GRA }, // 3 / TC538200 - { "042-c3.c3", 0x080000, 0xbcd4a518, 3 | BRF_GRA }, // 4 / TC534200 - { "042-c4.c4", 0x080000, 0xd602219b, 3 | BRF_GRA }, // 5 / TC534200 - - { "042-m1.m1", 0x020000, 0xbb19995d, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "042-v1.v1", 0x100000, 0xaf7f8247, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "042-v2.v2", 0x100000, 0xc6474b59, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(quizdai2, quizdai2, neogeo) -STD_ROM_FN(quizdai2) - -struct BurnDriver BurnDrvQuizdai2 = { - "quizdai2", NULL, "neogeo", NULL, "1992", - "Quiz Meitantei Neo & Geo - Quiz Daisousa Sen part 2 (NGM-042)(NGH-042)\0", NULL, "SNK", "Neo Geo MVS", - L"\u30AF\u30A4\u30BA\u8FF7\u63A2\u5075\u30CD\u30AA\uFF06\u30B8\u30AA - Quiz Daisousa Sen part 2 (NGM-042)(NGH-042)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_QUIZ, 0, - NULL, quizdai2RomInfo, quizdai2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// 3 Count Bout / Fire Suplex (NGM-043)(NGH-043) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo countb3RomDesc[] = { - { "043-p1.p1", 0x100000, 0xffbdd928, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - /* The original p1 is 8mbit; also found MVS sets with p1 / p2 4mbit on eprom. - { "043-epr.ep1", 0x080000, 0xeb2714c4, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C4002 - { "043-epr.ep2", 0x080000, 0x5e764567, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 */ - - { "043-s1.s1", 0x020000, 0xc362d484, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "043-c1.c1", 0x200000, 0xbad2d67f, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "043-c2.c2", 0x200000, 0xa7fbda95, 3 | BRF_GRA }, // 3 / TC5316200 - { "043-c3.c3", 0x200000, 0xf00be011, 3 | BRF_GRA }, // 4 / TC5316200 - { "043-c4.c4", 0x200000, 0x1887e5c0, 3 | BRF_GRA }, // 5 / TC5316200 - - { "043-m1.m1", 0x020000, 0x7eab59cb, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "043-v1.v1", 0x200000, 0x63688ce8, 5 | BRF_SND }, // 7 Sound data / TC5316200 - { "043-v2.v2", 0x200000, 0xc69a827b, 5 | BRF_SND }, // 8 / TC5316200 - /* also found AES set with p1 on TC538200 on PROG board NEO-AEG PROG16; chip label is 043-P1 - and v1 / v2 on different chip location on CHA board NEO-AEG CHA42G-1; - { "043-v1.v2", 0x200000, 0x63688ce8, 5 | BRF_SND }, // 7 Sound data / TC5316200 - { "043-v2.v4", 0x200000, 0xc69a827b, 5 | BRF_SND }, // 8 / TC5316200 */ -}; - -STDROMPICKEXT(countb3, countb3, neogeo) -STD_ROM_FN(countb3) - -struct BurnDriver BurnDrv3Countb = { - "3countb", NULL, "neogeo", NULL, "1993", - "3 Count Bout / Fire Suplex (NGM-043)(NGH-043)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, 0, - NULL, countb3RomInfo, countb3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Art of Fighting / Ryuuko no Ken (NGM-044)(NGH-044) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo aofRomDesc[] = { - { "044-p1.p1", 0x080000, 0xca9f7a6d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "044-s1.s1", 0x020000, 0x89903f39, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "044-c1.c1", 0x200000, 0xddab98a7, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "044-c2.c2", 0x200000, 0xd8ccd575, 3 | BRF_GRA }, // 3 / TC5316200 - { "044-c3.c3", 0x200000, 0x403e898a, 3 | BRF_GRA }, // 4 / TC5316200 - { "044-c4.c4", 0x200000, 0x6235fbaa, 3 | BRF_GRA }, // 5 / TC5316200 - - { "044-m1.m1", 0x020000, 0x0987e4bb, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "044-v2.v2", 0x200000, 0x3ec632ea, 5 | BRF_SND }, // 7 Sound data / TC5316200 - { "044-v4.v4", 0x200000, 0x4b0f8e23, 5 | BRF_SND }, // 8 / TC5316200 - /* also found MVS set with EP1 on M27C4002 eprom on PROG board NEO-MVS PROG4096; correct chip label unknown - and v1 / v2 with different chip location on CHA board NEO-MVS CHA42G-1. - { "044-v2.v1", 0x200000, 0x3ec632ea, 5 | BRF_SND }, // 7 Sound data / TC5316200 - { "044-v4.v2", 0x200000, 0x4b0f8e23, 5 | BRF_SND }, // 8 / TC5316200 */ -}; - -STDROMPICKEXT(aof, aof, neogeo) -STD_ROM_FN(aof) - -struct BurnDriver BurnDrvAof = { - "aof", NULL, "neogeo", NULL, "1992", - "Art of Fighting / Ryuuko no Ken (NGM-044)(NGH-044)\0", NULL, "SNK", "Neo Geo MVS", - L"Art of Fighting\0\u9F8D\u864E\u306E\u62F3 (NGM-044)(NGH-044)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, 0, - NULL, aofRomInfo, aofRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown / Samurai Spirits (NGM-045) -/* MVS VERSION */ - -static struct BurnRomInfo samshoRomDesc[] = { - { "045-p1.p1", 0x100000, 0xdfe51bf0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "045-pg2.sp2", 0x100000, 0x46745b94, 1 | BRF_ESS | BRF_PRG }, // 1 / TC538200 - /* also found MVS set with p1 / p2 on board NEO-MVS PROGGSC; same rom data as samshoh - { "045-p1.p1", 0x100000, 0xdfe51bf0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "045-p2.sp2", 0x080000, 0x38ee9ba9, 1 | BRF_ESS | BRF_PRG }, // 1 / TC534200 */ - - { "045-s1.s1", 0x020000, 0x9142a4d3, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - /* It also exists MVS set with different 6xC layout on board NEO-MVS CHA42G-3; - naming scheme is 045-Cx. - { "045-c1.c1", 0x200000, 0x2e5873a4, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "045-c2.c2", 0x200000, 0x04febb10, 3 | BRF_GRA }, // 4 / TC5316200 - { "045-c3.c3", 0x200000, 0xf3dabd1e, 3 | BRF_GRA }, // 5 / TC5316200 - { "045-c4.c4", 0x200000, 0x935c62f0, 3 | BRF_GRA }, // 6 / TC5316200 - { "045-c5.c5", 0x080000, 0xa2bb8284, 3 | BRF_GRA }, // 7 / TC534200 - { "045-c6.c6", 0x080000, 0x4fa71252, 3 | BRF_GRA }, // 8 / TC534200 */ - { "045-c1.c1", 0x200000, 0x2e5873a4, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "045-c2.c2", 0x200000, 0x04febb10, 3 | BRF_GRA }, // 4 / TC5316200 - { "045-c3.c3", 0x200000, 0xf3dabd1e, 3 | BRF_GRA }, // 5 / TC5316200 - { "045-c4.c4", 0x200000, 0x935c62f0, 3 | BRF_GRA }, // 6 / TC5316200 - { "045-c51.c5", 0x100000, 0x81932894, 3 | BRF_GRA }, // 7 / TC538200 - { "045-c61.c6", 0x100000, 0xbe30612e, 3 | BRF_GRA }, // 8 / TC538200 - - { "045-m1.m1", 0x020000, 0x95170640, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code / TC531001 - - { "045-v1.v1", 0x200000, 0x37f78a9b, 5 | BRF_SND }, // 10 Sound data / TC5316200 - { "045-v2.v2", 0x200000, 0x568b20cf, 5 | BRF_SND }, // 11 / TC5316200 -}; - -STDROMPICKEXT(samsho, samsho, neogeo) -STD_ROM_FN(samsho) - -struct BurnDriver BurnDrvSamsho = { - "samsho", NULL, "neogeo", NULL, "1993", - "Samurai Shodown / Samurai Spirits (NGM-045)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samshoRomInfo, samshoRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Samurai Shodown / Samurai Spirits (NGH-045) -/* AES VERSION */ - -static struct BurnRomInfo samshohRomDesc[] = { - { "045-p1.p1", 0x100000, 0xdfe51bf0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "045-p2.sp2", 0x080000, 0x38ee9ba9, 1 | BRF_ESS | BRF_PRG }, // 1 / TC534200 - - { "045-s1.s1", 0x020000, 0x9142a4d3, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - /* It also exists AES set with different 6xC layout on board NEO-AEG CHA42G-4; - chip labels are 045-C1; 045-C2; 045-C3; 045-C4; 045-C5 and 045-C61 - { "045-c1.c1", 0x200000, 0x2e5873a4, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "045-c2.c2", 0x200000, 0x04febb10, 3 | BRF_GRA }, // 4 / TC5316200 - { "045-c3.c3", 0x200000, 0xf3dabd1e, 3 | BRF_GRA }, // 5 / TC5316200 - { "045-c4.c4", 0x200000, 0x935c62f0, 3 | BRF_GRA }, // 6 / TC5316200 - { "045-c5.c5", 0x080000, 0xa2bb8284, 3 | BRF_GRA }, // 7 / TC534200 - { "045-c61.c6", 0x100000, 0xbe30612e, 3 | BRF_GRA }, // 8 / TC538200 */ - { "045-c1.c1", 0x200000, 0x2e5873a4, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "045-c2.c2", 0x200000, 0x04febb10, 3 | BRF_GRA }, // 4 / TC5316200 - { "045-c3.c3", 0x200000, 0xf3dabd1e, 3 | BRF_GRA }, // 5 / TC5316200 - { "045-c4.c4", 0x200000, 0x935c62f0, 3 | BRF_GRA }, // 6 / TC5316200 - { "045-c5.c5", 0x080000, 0xa2bb8284, 3 | BRF_GRA }, // 7 / TC534200 - { "045-c6.c6", 0x080000, 0x4fa71252, 3 | BRF_GRA }, // 8 / TC534200 - - { "045-m1.m1", 0x020000, 0x95170640, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code / TC531001 - - { "045-v1.v1", 0x200000, 0x37f78a9b, 5 | BRF_SND }, // 10 Sound data / TC5316200 - { "045-v2.v2", 0x200000, 0x568b20cf, 5 | BRF_SND }, // 11 / TC5316200 -}; - -STDROMPICKEXT(samshoh, samshoh, neogeo) -STD_ROM_FN(samshoh) - -struct BurnDriver BurnDrvSamShoh = { - "samshoh", "samsho", "neogeo", NULL, "1993", - "Samurai Shodown / Samurai Spirits (NGH-045)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samshohRomInfo, samshohRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Top Hunter - Roddy & Cathy (NGM-046) -/* MVS VERSION */ - -static struct BurnRomInfo tophuntrRomDesc[] = { - { "046-p1.p1", 0x100000, 0x69fa9e29, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - { "046-p2.sp2", 0x100000, 0xf182cb3e, 1 | BRF_ESS | BRF_PRG }, // 1 / mask rom TC538200 - - { "046-s1.s1", 0x020000, 0x14b01d7b, 2 | BRF_GRA }, // 2 Text layer tiles / mask rom TC531000 - - { "046-c1.c1", 0x100000, 0xfa720a4a, 3 | BRF_GRA }, // 3 Sprite data / mask rom TC538200 - { "046-c2.c2", 0x100000, 0xc900c205, 3 | BRF_GRA }, // 4 / mask rom TC538200 - { "046-c3.c3", 0x100000, 0x880e3c25, 3 | BRF_GRA }, // 5 / mask rom TC538200 - { "046-c4.c4", 0x100000, 0x7a2248aa, 3 | BRF_GRA }, // 6 / mask rom TC538200 - { "046-c5.c5", 0x100000, 0x4b735e45, 3 | BRF_GRA }, // 7 / mask rom TC538200 - { "046-c6.c6", 0x100000, 0x273171df, 3 | BRF_GRA }, // 8 / mask rom TC538200 - { "046-c7.c7", 0x100000, 0x12829c4c, 3 | BRF_GRA }, // 9 / mask rom TC538200 - { "046-c8.c8", 0x100000, 0xc944e03d, 3 | BRF_GRA }, // 10 / mask rom TC538200 - - { "046-m1.m1", 0x020000, 0x3f84bb9f, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / mask rom TC531001 - - { "046-v1.v1", 0x100000, 0xc1f9c2db, 5 | BRF_SND }, // 12 Sound data / mask rom TC538200 - { "046-v2.v2", 0x100000, 0x56254a64, 5 | BRF_SND }, // 13 / mask rom TC538200 - { "046-v3.v3", 0x100000, 0x58113fb1, 5 | BRF_SND }, // 14 / mask rom TC538200 - { "046-v4.v4", 0x100000, 0x4f54c187, 5 | BRF_SND }, // 15 / mask rom TC538200 -}; - -STDROMPICKEXT(tophuntr, tophuntr, neogeo) -STD_ROM_FN(tophuntr) - -struct BurnDriver BurnDrvtophntr = { - "tophuntr", NULL, "neogeo", NULL, "1994", - "Top Hunter - Roddy & Cathy (NGM-046)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, tophuntrRomInfo, tophuntrRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Top Hunter - Roddy & Cathy (NGH-046) -/* AES VERSION */ - -static struct BurnRomInfo tophuntrhRomDesc[] = { - { "046-pg1.p1", 0x100000, 0x771e39bc, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - { "046-p2.sp2", 0x100000, 0xf182cb3e, 1 | BRF_ESS | BRF_PRG }, // 1 / mask rom TC538200 - - { "046-sg1.s1", 0x020000, 0x92e9ac8c, 2 | BRF_GRA }, // 2 Text layer tiles / mask rom TC531000 - - { "046-c1.c1", 0x100000, 0xfa720a4a, 3 | BRF_GRA }, // 3 Sprite data / mask rom TC538200 - { "046-c2.c2", 0x100000, 0xc900c205, 3 | BRF_GRA }, // 4 / mask rom TC538200 - { "046-c3.c3", 0x100000, 0x880e3c25, 3 | BRF_GRA }, // 5 / mask rom TC538200 - { "046-c4.c4", 0x100000, 0x7a2248aa, 3 | BRF_GRA }, // 6 / mask rom TC538200 - { "046-c5.c5", 0x100000, 0x4b735e45, 3 | BRF_GRA }, // 7 / mask rom TC538200 - { "046-c6.c6", 0x100000, 0x273171df, 3 | BRF_GRA }, // 8 / mask rom TC538200 - { "046-c7.c7", 0x100000, 0x12829c4c, 3 | BRF_GRA }, // 9 / mask rom TC538200 - { "046-c8.c8", 0x100000, 0xc944e03d, 3 | BRF_GRA }, // 10 / mask rom TC538200 - - { "046-m1.m1", 0x020000, 0x3f84bb9f, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / mask rom TC531001 - - { "046-v1.v1", 0x100000, 0xc1f9c2db, 5 | BRF_SND }, // 12 Sound data / mask rom TC538200 - { "046-v2.v2", 0x100000, 0x56254a64, 5 | BRF_SND }, // 13 / mask rom TC538200 - { "046-v3.v3", 0x100000, 0x58113fb1, 5 | BRF_SND }, // 14 / mask rom TC538200 - { "046-v4.v4", 0x100000, 0x4f54c187, 5 | BRF_SND }, // 15 / mask rom TC538200 -}; - -STDROMPICKEXT(tophuntrh, tophuntrh, neogeo) -STD_ROM_FN(tophuntrh) - -struct BurnDriver BurnDrvtophntrh = { - "tophuntrh", "tophuntr", "neogeo", NULL, "1994", - "Top Hunter - Roddy & Cathy (NGH-046)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, tophuntrhRomInfo, tophuntrhRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai (NGM-047)(NGH-047) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo fatfury2RomDesc[] = { - { "047-p1.p1", 0x100000, 0xecfdbb69, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - /* The original p1 is 8mbit; also found MVS set with p1 / p2 4mbit on eprom - on PROG board NEO-MVS PROG-G2 (SNK-9201) - { "047-epr.ep1", 0x080000, 0xbe40ea92, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C4002 - { "047-epr.ep2", 0x080000, 0x2a9beac5, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 */ - /* also found AES set with P1 / P3 on emprom on PROG board NEO-AEG PROG-G2 (SNK-9201); - { "047-epr.p1", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC574200 - { "047-epr.p3", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 */ - - { "047-s1.s1", 0x020000, 0xd7dbbf39, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "047-c1.c1", 0x200000, 0xf72a939e, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "047-c2.c2", 0x200000, 0x05119a0d, 3 | BRF_GRA }, // 4 / TC5316200 - { "047-c3.c3", 0x200000, 0x01e00738, 3 | BRF_GRA }, // 5 / TC5316200 - { "047-c4.c4", 0x200000, 0x9fe27432, 3 | BRF_GRA }, // 6 / TC5316200 - - { "047-m1.m1", 0x020000, 0x820b0ba7, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "047-v1.v1", 0x200000, 0xd9d00784, 5 | BRF_SND }, // 8 Sound data / TC5316200 - { "047-v2.v2", 0x200000, 0x2c9a4b33, 5 | BRF_SND }, // 9 / TC5316200 -}; - -STDROMPICKEXT(fatfury2, fatfury2, neogeo) -STD_ROM_FN(fatfury2) - -static INT32 prot_data; - -UINT8 __fastcall fatfury2ReadByteProtection(UINT32 sekAddress) -{ - UINT16 res = (prot_data >> 24) & 0xFF; - -// bprintf(PRINT_NORMAL, _T(" - prot 0x%06X read byte (PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - - switch (sekAddress) { - case 0x255551: - case 0x2FFFF1: - case 0x200001: - case 0x2FF001: - - case 0x236001: - case 0x236009: -// bprintf(PRINT_NORMAL, _T(" - prot read byte: 0x%02X (PC: 0x%06X)\n"), res, SekGetPC(-1)); - return res; - - case 0x236005: - case 0x23600D: -// bprintf(PRINT_NORMAL, _T(" - prot read byte: 0x%02X (PC: 0x%06X)\n"), ((res & 0xF0) >> 4) | ((res & 0x0F) << 4), SekGetPC(-1)); - return ((res & 0xF0) >> 4) | ((res & 0x0F) << 4); - -// default: -// bprintf(PRINT_NORMAL, _T(" - prot 0x%06X read byte (PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - } - - return 0; -} - -UINT16 __fastcall fatfury2ReadWordProtection(UINT32 sekAddress) -{ - UINT16 res = (prot_data >> 24) & 0xFF; - -// bprintf(PRINT_NORMAL, _T(" - prot 0x%06X read word (PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - - switch (sekAddress) { - case 0x255550: - case 0x2FFFF0: - case 0x200000: - case 0x2FF000: - - case 0x236000: - case 0x236008: -// bprintf(PRINT_NORMAL, _T(" - prot read word: 0x%02X (PC: 0x%06X)\n"), res, SekGetPC(-1)); - return res; - - case 0x236004: - case 0x23600C: -// bprintf(PRINT_NORMAL, _T(" - prot read word: 0x%02X (PC: 0x%06X)\n"), ((res & 0xF0) >> 4) | ((res & 0x0F) << 4), SekGetPC(-1)); - return ((res & 0xF0) >> 4) | ((res & 0x0F) << 4); - -// default: -// bprintf(PRINT_NORMAL, _T(" - prot 0x%06X read word (PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - } - - return 0; -} - -void __fastcall fatfury2WriteByteProtection(UINT32 sekAddress, UINT8 /*byteValue*/) -{ -// bprintf(PRINT_NORMAL, _T(" - prot 0x%06X -> 0x%02X (PC: 0x%06X)\n"), sekAddress, byteValue, SekGetPC(-1)); - - switch (sekAddress) { - case 0x255551: - case 0x2FFFF1: - case 0x2FF001: - - case 0x236001: - case 0x236005: - case 0x236009: - case 0x23600D: - prot_data <<= 8; - break; - -// default: -// bprintf(PRINT_NORMAL, _T(" - prot 0x%06X -> 0x%02X\n"), sekAddress, byteValue); - } -} - -void __fastcall fatfury2WriteWordProtection(UINT32 sekAddress, UINT16 /*wordValue*/) -{ -// bprintf(PRINT_NORMAL, _T(" - prot 0x%06X -> 0x%04X (PC: 0x%06X)\n"), sekAddress, wordValue, SekGetPC(-1)); - - switch (sekAddress) { - case 0x211112: // data = 0x1111, expects 0xFF000000 back - prot_data = 0xFF000000; -/* - prot_data = (wordValue & 0x1000) << 19; - prot_data |= (wordValue & 0x0100) << 22; - prot_data |= (wordValue & 0x0010) << 25; - prot_data |= (wordValue & 0x0001) << 28; - - prot_data |= prot_data >> 4; -*/ -// bprintf(PRINT_NORMAL, _T(" prot data -> 0x%08X\n"), prot_data); - break; - - case 0x233332: // data = 0x3333, expects 0x0000FFFF back - prot_data = 0x0000FFFF; -/* - prot_data = wordValue << 0; - prot_data |= wordValue << 2; -*/ -// bprintf(PRINT_NORMAL, _T(" prot data -> 0x%08X\n"), prot_data); - break; - - case 0x244442: // data = 0x4444, expects 0x00FF0000 back - prot_data = 0x00FF0000; -/* - prot_data = (wordValue & 0x4000) << 9; - prot_data |= (wordValue & 0x0400) << 12; - prot_data |= (wordValue & 0x0040) << 15; - prot_data |= (wordValue & 0x0004) << 18; - - prot_data |= prot_data >> 4; -*/ -// bprintf(PRINT_NORMAL, _T(" prot data -> 0x%08X\n"), prot_data); - break; - - case 0x255552: // data == 0x5555; read back from 55550, ffff0, 00000, ff000 - prot_data = 0xFF00FF00; - break; - - case 0x256782: // data == 0x1234; read back from 36000 *or* 36004 - prot_data = 0xF05A3601; - break; - - case 0x242812: // data == 0x1824; read back from 36008 *or* 3600c - prot_data = 0x81422418; - break; - -// default: -// bprintf(PRINT_NORMAL, _T(" - prot 0x%06X -> 0x%02X\n"), sekAddress, wordValue); - } -} - -INT32 fatfury2Scan(INT32 nAction, INT32* /*pnMin*/) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(prot_data); - } - - return 0; -} - -static void fatfury2InstallHanders() -{ - // Install protection handler - SekMapHandler(6, 0x200000, 0x2FFFFF, MAP_WRITE); - SekMapHandler(6, 0x200000, 0x2FFFFF, MAP_READ); - SekSetWriteWordHandler(6, fatfury2WriteWordProtection); - SekSetWriteByteHandler(6, fatfury2WriteByteProtection); - SekSetReadWordHandler(6, fatfury2ReadWordProtection); - SekSetReadByteHandler(6, fatfury2ReadByteProtection); -} - -static INT32 fatfury2Init() -{ - NeoCallbackActive->pInstallHandlers = fatfury2InstallHanders; - NeoCallbackActive->pScan = fatfury2Scan; - - return NeoInit(); -} - -struct BurnDriver BurnDrvFatfury2 = { - "fatfury2", NULL, "neogeo", NULL, "1992", - "Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai (NGM-047)(NGH-047)\0", NULL, "SNK", "Neo Geo MVS", - L"Fatal Fury 2\0\u9913\u72FC\u4F1D\u8AAC\uFF12 - \u65B0\u305F\u306A\u308B\u95D8 (NGM-047)(NGH-047)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, FBF_FATFURY, - NULL, fatfury2RomInfo, fatfury2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - fatfury2Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Super Sidekicks / Tokuten Ou - -static struct BurnRomInfo ssidekiRomDesc[] = { - /* also found AES set on PROG board NEO-AEG PROG-G2 (SNK-9201) and CHA board NEO-AEG CHA42G-2; - same chip labels */ - { "052-p1.p1", 0x080000, 0x9cd97256, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "052-s1.s1", 0x020000, 0x97689804, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "052-c1.c1", 0x200000, 0x53e1c002, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "052-c2.c2", 0x200000, 0x776a2d1f, 3 | BRF_GRA }, // 3 / TC5316200 - - { "052-m1.m1", 0x020000, 0x49f17d2d, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / TC531001 - - { "052-v1.v1", 0x200000, 0x22c097a5, 5 | BRF_SND }, // 5 Sound data / TC5316200 -}; - -STDROMPICKEXT(ssideki, ssideki, neogeo) -STD_ROM_FN(ssideki) - -// This game uses protection similar to Fatal Fury 2 - -struct BurnDriver BurnDrvSsideki = { - "ssideki", NULL, "neogeo", NULL, "1992", - "Super Sidekicks / Tokuten Ou\0", NULL, "SNK", "Neo Geo MVS", - L"Super Sidekicks\0\u5F97\u70B9\u738B\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_SPORTSFOOTBALL, 0, - NULL, ssidekiRomInfo, ssidekiRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - fatfury2Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '94 (NGM-055)(NGH-055) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo kof94RomDesc[] = { - { "055-p1.p1", 0x200000, 0xf10a2042, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - - { "055-s1.s1", 0x020000, 0x825976c1, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "055-c1.c1", 0x200000, 0xb96ef460, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5316200 - { "055-c2.c2", 0x200000, 0x15e096a7, 3 | BRF_GRA }, // 3 / mask rom TC5316200 - { "055-c3.c3", 0x200000, 0x54f66254, 3 | BRF_GRA }, // 4 / mask rom TC5316200 - { "055-c4.c4", 0x200000, 0x0b01765f, 3 | BRF_GRA }, // 5 / mask rom TC5316200 - { "055-c5.c5", 0x200000, 0xee759363, 3 | BRF_GRA }, // 6 / mask rom TC5316200 - { "055-c6.c6", 0x200000, 0x498da52c, 3 | BRF_GRA }, // 7 / mask rom TC5316200 - { "055-c7.c7", 0x200000, 0x62f66888, 3 | BRF_GRA }, // 8 / mask rom TC5316200 - { "055-c8.c8", 0x200000, 0xfe0a235d, 3 | BRF_GRA }, // 9 / mask rom TC5316200 - - { "055-m1.m1", 0x020000, 0xf6e77cf5, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / mask rom TC531001 - - { "055-v1.v1", 0x200000, 0x8889596d, 5 | BRF_SND }, // 11 Sound data / mask rom TC5316200 - { "055-v2.v2", 0x200000, 0x25022b27, 5 | BRF_SND }, // 12 / mask rom TC5316200 - { "055-v3.v3", 0x200000, 0x83cf32c0, 5 | BRF_SND }, // 13 / mask rom TC5316200 -}; - -STDROMPICKEXT(kof94, kof94, neogeo) -STD_ROM_FN(kof94) - -struct BurnDriver BurnDrvKof94 = { - "kof94", NULL, "neogeo", NULL, "1994", - "The King of Fighters '94 (NGM-055)(NGH-055)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, FBF_KOF, - NULL, kof94RomInfo, kof94RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Art of Fighting 2 / Ryuuko no Ken 2 (NGM-056) -/* MVS VERSION */ - -static struct BurnRomInfo aof2RomDesc[] = { - { "056-p1.p1", 0x100000, 0xa3b1d021, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - /* also found MVS set with EP1 / EP2 on eprom on PROG board NEO-MVS PROGGSC; correct chip labels unknown - and CHA board NEO-MVS CHA256 with 8xC; chip labels are the same - { "056-epr.ep1", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / 27C240-12 - { "056-epr.ep2", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 */ - - { "056-s1.s1", 0x020000, 0x8b02638e, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - /* Different layout with 4xC (32mbit) also exists on board NEO-MVS CHA256; - chip labels are 056-C13, 056-C24, 056-C57 and 056-C68 - { "056-c13.c1", 0x400000, 0xbd3aa959, 3 | BRF_GRA }, // 2 Sprite data - { "056-c24.c2", 0x400000, 0xe58297c2, 3 | BRF_GRA }, // 3 - { "056-c57.c3", 0x400000, 0xb4ad87e5, 3 | BRF_GRA }, // 4 - { "056-c68.c4", 0x400000, 0x9d3982c8, 3 | BRF_GRA }, // 5 */ - { "056-c1.c1", 0x200000, 0x17b9cbd2, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "056-c2.c2", 0x200000, 0x5fd76b67, 3 | BRF_GRA }, // 3 / TC5316200 - { "056-c3.c3", 0x200000, 0xd2c88768, 3 | BRF_GRA }, // 4 / TC5316200 - { "056-c4.c4", 0x200000, 0xdb39b883, 3 | BRF_GRA }, // 5 / TC5316200 - { "056-c5.c5", 0x200000, 0xc3074137, 3 | BRF_GRA }, // 6 / TC5316200 - { "056-c6.c6", 0x200000, 0x31de68d3, 3 | BRF_GRA }, // 7 / TC5316200 - { "056-c7.c7", 0x200000, 0x3f36df57, 3 | BRF_GRA }, // 8 / TC5316200 - { "056-c8.c8", 0x200000, 0xe546d7a8, 3 | BRF_GRA }, // 9 / TC5316200 - - { "056-m1.m1", 0x020000, 0xf27e9d52, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "056-v1.v1", 0x200000, 0x4628fde0, 5 | BRF_SND }, // 11 Sound data / TC5316200 - { "056-v2.v2", 0x200000, 0xb710e2f2, 5 | BRF_SND }, // 12 / TC5316200 - { "056-v3.v3", 0x100000, 0xd168c301, 5 | BRF_SND }, // 13 / TC538200 -}; - -STDROMPICKEXT(aof2, aof2, neogeo) -STD_ROM_FN(aof2) - -struct BurnDriver BurnDrvAof2 = { - "aof2", NULL, "neogeo", NULL, "1994", - "Art of Fighting 2 / Ryuuko no Ken 2 (NGM-056)\0", NULL, "SNK", "Neo Geo MVS", - L"Art of Fighting 2\0\u9F8D\u864E\u306E\u62F3\uFF12 (NGM-056)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, aof2RomInfo, aof2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Art of Fighting 2 / Ryuuko no Ken 2 (NGH-056) -/* AES VERSION */ - -static struct BurnRomInfo aof2aRomDesc[] = { - { "056-p1.p1", 0x100000, 0xa3b1d021, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "056-s1.s1", 0x020000, 0x8b02638e, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "056-c1.c1", 0x200000, 0x17b9cbd2, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "056-c2.c2", 0x200000, 0x5fd76b67, 3 | BRF_GRA }, // 3 / TC5316200 - { "056-c3.c3", 0x200000, 0xd2c88768, 3 | BRF_GRA }, // 4 / TC5316200 - { "056-c4.c4", 0x200000, 0xdb39b883, 3 | BRF_GRA }, // 5 / TC5316200 - { "056-c5.c5", 0x200000, 0xc3074137, 3 | BRF_GRA }, // 6 / TC5316200 - { "056-c6.c6", 0x200000, 0x31de68d3, 3 | BRF_GRA }, // 7 / TC5316200 - { "056-c7.c7", 0x200000, 0x3f36df57, 3 | BRF_GRA }, // 8 / TC5316200 - { "056-c8.c8", 0x200000, 0xe546d7a8, 3 | BRF_GRA }, // 9 / TC5316200 - - { "056-m1.m1", 0x020000, 0xf27e9d52, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "056-v1.v1", 0x200000, 0x4628fde0, 5 | BRF_SND }, // 11 Sound data / TC5316200 - { "056-v2.v2", 0x200000, 0xb710e2f2, 5 | BRF_SND }, // 12 / TC5316200 - { "056-v3.v3", 0x100000, 0xd168c301, 5 | BRF_SND }, // 13 / TC538200 - - { "056-epr.ep1", 0x080000, 0x75d6301c, 0 | BRF_ESS | BRF_PRG }, // 14 / M27C4002 -}; - -STDROMPICKEXT(aof2a, aof2a, neogeo) -STD_ROM_FN(aof2a) - -static void aof2aCallback() -{ - BurnLoadRom(Neo68KROMActive, 14, 1); -} - -static INT32 aof2aInit() -{ - NeoCallbackActive->pInitialise = aof2aCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvAof2a = { - "aof2a", "aof2", "neogeo", NULL, "1994", - "Art of Fighting 2 / Ryuuko no Ken 2 (NGH-056)\0", NULL, "SNK", "Neo Geo MVS", - L"Art of Fighting 2\0\u9F8D\u864E\u306E\u62F3\uFF12 (NGH-056)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, aof2aRomInfo, aof2aRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - aof2aInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Fatal Fury Special / Garou Densetsu Special (set 1)(NGM-058)(NGH-058) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo fatfurspRomDesc[] = { - { "058-p1.p1", 0x100000, 0x2f585ba2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - { "058-p2.sp2", 0x080000, 0xd7c71a6b, 1 | BRF_ESS | BRF_PRG }, // 1 / mask rom TC534200 - - { "058-s1.s1", 0x020000, 0x2df03197, 2 | BRF_GRA }, // 2 Text layer tiles / mask rom TC531000 - - { "058-c1.c1", 0x200000, 0x044ab13c, 3 | BRF_GRA }, // 3 Sprite data / mask rom TC5316200 - { "058-c2.c2", 0x200000, 0x11e6bf96, 3 | BRF_GRA }, // 4 / mask rom TC5316200 - { "058-c3.c3", 0x200000, 0x6f7938d5, 3 | BRF_GRA }, // 5 / mask rom TC5316200 - { "058-c4.c4", 0x200000, 0x4ad066ff, 3 | BRF_GRA }, // 6 / mask rom TC5316200 - { "058-c5.c5", 0x200000, 0x49c5e0bf, 3 | BRF_GRA }, // 7 / mask rom TC5316200 - { "058-c6.c6", 0x200000, 0x8ff1f43d, 3 | BRF_GRA }, // 8 / mask rom TC5316200 - - { "058-m1.m1", 0x020000, 0xccc5186e, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code / mask rom TC531001 - - { "058-v1.v1", 0x200000, 0x55d7ce84, 5 | BRF_SND }, // 10 Sound data / mask rom TC5316200 - { "058-v2.v2", 0x200000, 0xee080b10, 5 | BRF_SND }, // 11 / mask rom TC5316200 - { "058-v3.v3", 0x100000, 0xf9eb3d4a, 5 | BRF_SND }, // 12 / mask rom TC538200 -}; - -STDROMPICKEXT(fatfursp, fatfursp, neogeo) -STD_ROM_FN(fatfursp) - -struct BurnDriver BurnDrvFatfursp = { - "fatfursp", NULL, "neogeo", NULL, "1993", - "Fatal Fury Special / Garou Densetsu Special (set 1)(NGM-058)(NGH-058)\0", NULL, "SNK", "Neo Geo MVS", - L"Fatal Fury Special\0\u9913\u72FC\u4F1D\u8AAC Special (set 1)(NGM-058)(NGH-058)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, fatfurspRomInfo, fatfurspRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Fatal Fury Special / Garou Densetsu Special (set 2)(NGM-058)(NGH-058) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo fatfurspaRomDesc[] = { - { "058-p1.p1", 0x100000, 0x2f585ba2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - { "058-p2.sp2", 0x080000, 0xd7c71a6b, 1 | BRF_ESS | BRF_PRG }, // 1 / mask rom TC534200 - - { "058-s1.s1", 0x020000, 0x2df03197, 2 | BRF_GRA }, // 2 Text layer tiles / mask rom TC531000 - - { "058-c1.c1", 0x200000, 0x044ab13c, 3 | BRF_GRA }, // 3 Sprite data / mask rom TC5316200 - { "058-c2.c2", 0x200000, 0x11e6bf96, 3 | BRF_GRA }, // 4 / mask rom TC5316200 - { "058-c3.c3", 0x200000, 0x6f7938d5, 3 | BRF_GRA }, // 5 / mask rom TC5316200 - { "058-c4.c4", 0x200000, 0x4ad066ff, 3 | BRF_GRA }, // 6 / mask rom TC5316200 - { "058-c5.c5", 0x200000, 0x49c5e0bf, 3 | BRF_GRA }, // 7 / mask rom TC5316200 - { "058-c6.c6", 0x200000, 0x8ff1f43d, 3 | BRF_GRA }, // 8 / mask rom TC5316200 - - { "058-m1.m1", 0x020000, 0xccc5186e, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code / mask rom TC531001 - - { "058-v1.v1", 0x200000, 0x55d7ce84, 5 | BRF_SND }, // 10 Sound data / mask rom TC5316200 - { "058-v2.v2", 0x200000, 0xee080b10, 5 | BRF_SND }, // 11 / mask rom TC5316200 - { "058-v3.v3", 0x100000, 0xf9eb3d4a, 5 | BRF_SND }, // 12 / mask rom TC538200 - - /* the rom below acts as a patch to the program rom in the cart, replacing the first 512kb */ - { "058-epr.ep1", 0x080000, 0x9f0c1e1a, 0 | BRF_ESS | BRF_PRG }, // 13 / M27C4002 - /* P is on eprom, correct chip label unknown */ -}; - -STDROMPICKEXT(fatfurspa, fatfurspa, neogeo) -STD_ROM_FN(fatfurspa) - -static void fatfurspaCallback() -{ - BurnLoadRom(Neo68KROMActive, 13, 1); -} - -static INT32 fatfurspaInit() -{ - NeoCallbackActive->pInitialise = fatfurspaCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvFatfurspa = { - "fatfurspa", "fatfursp", "neogeo", NULL, "1993", - "Fatal Fury Special / Garou Densetsu Special (set 2)(NGM-058)(NGH-058)\0", NULL, "SNK", "Neo Geo MVS", - L"Fatal Fury Special\0\u9913\u72FC\u4F1D\u8AAC Special (set 2)(NGM-058)(NGH-058)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, fatfurspaRomInfo, fatfurspaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - fatfurspaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Savage Reign / Fu'un Mokushiroku - kakutou sousei -/* MVS AND AES VERSION? */ - -static struct BurnRomInfo savagereRomDesc[] = { - /* also found MVS set with PROG board NEO-MVS PROG 4096 B and CHA board NEO-MVS CHA 42G-3; - same layouts and chip labels */ - { "059-p1.p1", 0x200000, 0x01d4e9c0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "059-s1.s1", 0x020000, 0xe08978ca, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "059-c1.c1", 0x200000, 0x763ba611, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "059-c2.c2", 0x200000, 0xe05e8ca6, 3 | BRF_GRA }, // 3 / TC5316200 - { "059-c3.c3", 0x200000, 0x3e4eba4b, 3 | BRF_GRA }, // 4 / TC5316200 - { "059-c4.c4", 0x200000, 0x3c2a3808, 3 | BRF_GRA }, // 5 / TC5316200 - { "059-c5.c5", 0x200000, 0x59013f9e, 3 | BRF_GRA }, // 6 / TC5316200 - { "059-c6.c6", 0x200000, 0x1c8d5def, 3 | BRF_GRA }, // 7 / TC5316200 - { "059-c7.c7", 0x200000, 0xc88f7035, 3 | BRF_GRA }, // 8 / TC5316200 - { "059-c8.c8", 0x200000, 0x484ce3ba, 3 | BRF_GRA }, // 9 / TC5316200 - - { "059-m1.m1", 0x020000, 0x29992eba, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "059-v1.v1", 0x200000, 0x530c50fd, 5 | BRF_SND }, // 11 Sound data / TC5316200 - { "059-v2.v2", 0x200000, 0xeb6f1cdb, 5 | BRF_SND }, // 12 / TC5316200 - { "059-v3.v3", 0x200000, 0x7038c2f9, 5 | BRF_SND }, // 13 / TC5316200 -}; - -STDROMPICKEXT(savagere, savagere, neogeo) -STD_ROM_FN(savagere) - -struct BurnDriver BurnDrvSavagere = { - "savagere", NULL, "neogeo", NULL, "1995", - "Savage Reign / Fu'un Mokushiroku - kakutou sousei\0", NULL, "SNK", "Neo Geo MVS", - L"Savage Reign\0\u98A8\u96F2\u9ED9\u793A\u9332 - \u683C\u95D8\u5275\u4E16\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, savagereRomInfo, savagereRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Super Sidekicks 2 - The World Championship / Tokuten Ou 2 - real fight football (NGM-061)(NGH-061) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo ssideki2RomDesc[] = { - { "061-p1.p1", 0x100000, 0x5969e0dc, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - /* also found MVS set with EP1 / EP2 on eprom on PROG board NEO-MVS PROGTOP; correct chip labels unknown. */ - - { "061-s1.s1", 0x020000, 0x226d1b68, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - /* Different layout with 8xC (8 mbit) also exists on board NEO-MVS CHA256 ; naming scheme 061-Cx */ - { "061-c1-16.c1", 0x200000, 0xa626474f, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5316200 - { "061-c2-16.c2", 0x200000, 0xc3be42ae, 3 | BRF_GRA }, // 3 / mask rom TC5316200 - { "061-c3-16.c3", 0x200000, 0x2a7b98b9, 3 | BRF_GRA }, // 4 / mask rom TC5316200 - { "061-c4-16.c4", 0x200000, 0xc0be9a1f, 3 | BRF_GRA }, // 5 / mask rom TC5316200 - - { "061-m1.m1", 0x020000, 0x156f6951, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / mask rom TC531001 - - { "061-v1.v1", 0x200000, 0xf081c8d3, 5 | BRF_SND }, // 7 Sound data / mask rom TC5316200 - { "061-v2.v2", 0x200000, 0x7cd63302, 5 | BRF_SND }, // 8 / mask rom TC5316200 -}; - -STDROMPICKEXT(ssideki2, ssideki2, neogeo) -STD_ROM_FN(ssideki2) - -struct BurnDriver BurnDrvSsideki2 = { - "ssideki2", NULL, "neogeo", NULL, "1994", - "Super Sidekicks 2 - The World Championship / Tokuten Ou 2 - real fight football (NGM-061)(NGH-061)\0", NULL, "SNK", "Neo Geo MVS", - L"Super Sidekicks 2 - the world championship\0\u5F97\u70B9\u738B\uFF12 - \u30EA\u30A2\u30EB\u30D5\u30A1\u30A4\u30C8\u30D5\u30C3\u30C8\u30DC\u30FC\u30EB (NGM-061)(NGH-061)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSFOOTBALL, 0, - NULL, ssideki2RomInfo, ssideki2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Samurai Shodown II / Shin Samurai Spirits - Haohmaru jigokuhen (NGM-063)(NGH-063) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo samsho2RomDesc[] = { - { "063-p1.p1", 0x200000, 0x22368892, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - /* also found MVS set with EP1 / EP2 / P1 / SP2 on eprom on PROG board NEO-MVS PROGTOP; - and CHA board NEO-MVS CHA256 (same layout and chip labels). - { "063-epr.p1", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 0 68k code / D27C4000 NEC JAPAN - { "063-epr.sp2", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 1 / D27C4000 NEC JAPAN - { "063-epr.ep1", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 2 / M27C4002 - { "063-epr.ep2", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 3 / M27C4002 */ - - { "063-s1.s1", 0x020000, 0x64a5cd66, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "063-c1.c1", 0x200000, 0x86cd307c, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "063-c2.c2", 0x200000, 0xcdfcc4ca, 3 | BRF_GRA }, // 3 / TC5316200 - { "063-c3.c3", 0x200000, 0x7a63ccc7, 3 | BRF_GRA }, // 4 / TC5316200 - { "063-c4.c4", 0x200000, 0x751025ce, 3 | BRF_GRA }, // 5 / TC5316200 - { "063-c5.c5", 0x200000, 0x20d3a475, 3 | BRF_GRA }, // 6 / TC5316200 - { "063-c6.c6", 0x200000, 0xae4c0a88, 3 | BRF_GRA }, // 7 / TC5316200 - { "063-c7.c7", 0x200000, 0x2df3cbcf, 3 | BRF_GRA }, // 8 / TC5316200 - { "063-c8.c8", 0x200000, 0x1ffc6dfa, 3 | BRF_GRA }, // 9 / TC5316200 - - { "063-m1.m1", 0x020000, 0x56675098, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "063-v1.v1", 0x200000, 0x37703f91, 5 | BRF_SND }, // 11 Sound data / TC5316200 - { "063-v2.v2", 0x200000, 0x0142bde8, 5 | BRF_SND }, // 12 / TC5316200 - { "063-v3.v3", 0x200000, 0xd07fa5ca, 5 | BRF_SND }, // 13 / TC5316200 - { "063-v4.v4", 0x100000, 0x24aab4bb, 5 | BRF_SND }, // 14 / TC538200 -}; - -STDROMPICKEXT(samsho2, samsho2, neogeo) -STD_ROM_FN(samsho2) - -struct BurnDriver BurnDrvSamsho2 = { - "samsho2", NULL, "neogeo", NULL, "1994", - "Samurai Shodown II / Shin Samurai Spirits - Haohmaru jigokuhen (NGM-063)(NGH-063)\0", NULL, "SNK", "Neo Geo MVS", - L"Samurai Shodown II\0\u771F Samurai Spirits - \u8987\u738B\u4E38\u5730\u7344\u5909 (NGM-063)(NGH-063)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho2RomInfo, samsho2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Saulabi Spirits / Jin Saulabi Tu Hon (Korean release of Samurai Shodown II) -/* KOREAN VERSION */ - -static struct BurnRomInfo samsho2kRomDesc[] = { - // This has corrupt text if used with the Japan bios due to the replacement of the s1 rom to contain the new logo - { "063-p1-kan.p1",0x200000, 0x147cc6d7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "063-s1-kan.s1",0x020000, 0xff08f80b, 2 | BRF_GRA }, // 1 Text layer tiles / - - { "063-c1.c1", 0x200000, 0x86cd307c, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "063-c2.c2", 0x200000, 0xcdfcc4ca, 3 | BRF_GRA }, // 3 / TC5316200 - { "063-c3.c3", 0x200000, 0x7a63ccc7, 3 | BRF_GRA }, // 4 / TC5316200 - { "063-c4.c4", 0x200000, 0x751025ce, 3 | BRF_GRA }, // 5 / TC5316200 - { "063-c5.c5", 0x200000, 0x20d3a475, 3 | BRF_GRA }, // 6 / TC5316200 - { "063-c6.c6", 0x200000, 0xae4c0a88, 3 | BRF_GRA }, // 7 / TC5316200 - { "063-c7.c7", 0x200000, 0x2df3cbcf, 3 | BRF_GRA }, // 8 / TC5316200 - { "063-c8.c8", 0x200000, 0x1ffc6dfa, 3 | BRF_GRA }, // 9 / TC5316200 - - { "063-m1.m1", 0x020000, 0x56675098, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "063-v1.v1", 0x200000, 0x37703f91, 5 | BRF_SND }, // 11 Sound data / TC5316200 - { "063-v2.v2", 0x200000, 0x0142bde8, 5 | BRF_SND }, // 12 / TC5316200 - { "063-v3.v3", 0x200000, 0xd07fa5ca, 5 | BRF_SND }, // 13 / TC5316200 - { "063-v4.v4", 0x100000, 0x24aab4bb, 5 | BRF_SND }, // 14 / TC538200 - - // the roms below apply as patch over the main program - { "063-ep1-kan.ep1", 0x080000, 0xfa32e2d8, 0 | BRF_ESS | BRF_PRG }, // 15 - { "063-ep2-kan.ep2", 0x080000, 0x70b1a4d9, 0 | BRF_ESS | BRF_PRG }, // 16 -}; - -STDROMPICKEXT(samsho2k, samsho2k, neogeo) -STD_ROM_FN(samsho2k) - -static void samsho2kCallback() -{ - BurnLoadRom(Neo68KROMActive + 0x000000, 15, 1); - BurnLoadRom(Neo68KROMActive + 0x080000, 16, 1); -} - -static INT32 samsho2kInit() -{ - NeoCallbackActive->pInitialise = samsho2kCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvsamsho2k = { - "samsho2k", "samsho2", "neogeo", NULL, "1994", - "Saulabi Spirits / Jin Saulabi Tu Hon (Korean release of Samurai Shodown II)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho2kRomInfo, samsho2kRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - samsho2kInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Saulabi Spirits / Jin Saulabi Tu Hon (Korean release of Samurai Shodown II, set 2) -/* KOREAN VERSION */ - -static struct BurnRomInfo samsho2kaRomDesc[] = { - { "063-p1-kan.p1",0x200000, 0x147cc6d7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - // Basically samsho2k without loading ep1 and ep2 over p1-kan ; The game has been confirmed to exist in this state - - { "063-s1-kan.s1",0x020000, 0xff08f80b, 2 | BRF_GRA }, // 1 Text layer tiles - - { "063-c1.c1", 0x200000, 0x86cd307c, 3 | BRF_GRA }, // 2 Sprite data - { "063-c2.c2", 0x200000, 0xcdfcc4ca, 3 | BRF_GRA }, // 3 - { "063-c3.c3", 0x200000, 0x7a63ccc7, 3 | BRF_GRA }, // 4 - { "063-c4.c4", 0x200000, 0x751025ce, 3 | BRF_GRA }, // 5 - { "063-c5.c5", 0x200000, 0x20d3a475, 3 | BRF_GRA }, // 6 - { "063-c6.c6", 0x200000, 0xae4c0a88, 3 | BRF_GRA }, // 7 - { "063-c7.c7", 0x200000, 0x2df3cbcf, 3 | BRF_GRA }, // 8 - { "063-c8.c8", 0x200000, 0x1ffc6dfa, 3 | BRF_GRA }, // 9 - - { "063-m1.m1", 0x020000, 0x56675098, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "063-v1.v1", 0x200000, 0x37703f91, 5 | BRF_SND }, // 11 Sound data - { "063-v2.v2", 0x200000, 0x0142bde8, 5 | BRF_SND }, // 12 - { "063-v3.v3", 0x200000, 0xd07fa5ca, 5 | BRF_SND }, // 13 - { "063-v4.v4", 0x100000, 0x24aab4bb, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(samsho2ka, samsho2ka, neogeo) -STD_ROM_FN(samsho2ka) - -struct BurnDriver BurnDrvsamsho2ka = { - "samsho2ka", "samsho2", "neogeo", NULL, "1994", - "Saulabi Spirits / Jin Saulabi Tu Hon (Korean release of Samurai Shodown II, set 2)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho2kaRomInfo, samsho2kaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai (NGM-069)(NGH-069) -/* MVS AND AES VERSION (95-02-28 13:39) */ - -static struct BurnRomInfo fatfury3RomDesc[] = { - { "069-p1.p1", 0x100000, 0xa8bcfbbc, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "069-sp2.sp2", 0x200000, 0xdbe963ed, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5316200 - - { "069-s1.s1", 0x020000, 0x0b33a800, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "069-c1.c1", 0x400000, 0xe302f93c, 3 | BRF_GRA }, // 3 Sprite data / TC5332205 - { "069-c2.c2", 0x400000, 0x1053a455, 3 | BRF_GRA }, // 4 / TC5332205 - { "069-c3.c3", 0x400000, 0x1c0fde2f, 3 | BRF_GRA }, // 5 / TC5332205 - { "069-c4.c4", 0x400000, 0xa25fc3d0, 3 | BRF_GRA }, // 6 / TC5332205 - { "069-c5.c5", 0x200000, 0xb3ec6fa6, 3 | BRF_GRA }, // 7 / TC5332205 - { "069-c6.c6", 0x200000, 0x69210441, 3 | BRF_GRA }, // 8 / TC5332205 - - { "069-m1.m1", 0x020000, 0xfce72926, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code / TC531001 - - { "069-v1.v1", 0x400000, 0x2bdbd4db, 5 | BRF_SND }, // 10 Sound data / TC5332204 - { "069-v2.v2", 0x400000, 0xa698a487, 5 | BRF_SND }, // 11 / TC5332204 - { "069-v3.v3", 0x200000, 0x581c5304, 5 | BRF_SND }, // 12 / TC5316200 -}; - -STDROMPICKEXT(fatfury3, fatfury3, neogeo) -STD_ROM_FN(fatfury3) - -struct BurnDriver BurnDrvFatfury3 = { - "fatfury3", NULL, "neogeo", NULL, "1995", - "Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai (NGM-069)(NGH-069)\0", NULL, "SNK", "Neo Geo MVS", - L"Fatal Fury 3 - Road to the Final Victory\0\u9913\u72FC\u4F1D\u8AAC\uFF13 (NGM-069)(NGH-069)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, fatfury3RomInfo, fatfury3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Super Sidekicks 3 - The Next Glory / Tokuten Ou 3 - eikou e no michi -/* MVS ANS AES VERSION? */ - -static struct BurnRomInfo ssideki3RomDesc[] = { - /* It also exists MVS Sets with PROG board NEO-MVS PROG 4096 B and CHA board NEO-MVS CHA 42G-3, - and with PROG board NEO-MVS PROGBK1 and CHA board NEO-MVS CHA256B; same chip labels. */ - /* also found AES set with PROG board NEO-AEG PROGTOP2 and CHA board NEO-AEG CHA256B; same chip labels */ - { "081-p1.p1", 0x200000, 0x6bc27a3d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "081-s1.s1", 0x020000, 0x7626da34, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "081-c1.c1", 0x200000, 0x1fb68ebe, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "081-c2.c2", 0x200000, 0xb28d928f, 3 | BRF_GRA }, // 3 / TC5316200 - { "081-c3.c3", 0x200000, 0x3b2572e8, 3 | BRF_GRA }, // 4 / TC5316200 - { "081-c4.c4", 0x200000, 0x47d26a7c, 3 | BRF_GRA }, // 5 / TC5316200 - { "081-c5.c5", 0x200000, 0x17d42f0d, 3 | BRF_GRA }, // 6 / TC5316200 - { "081-c6.c6", 0x200000, 0x6b53fb75, 3 | BRF_GRA }, // 7 / TC5316200 - - { "081-m1.m1", 0x020000, 0x82fcd863, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / TC531001 - - { "081-v1.v1", 0x200000, 0x201fa1e1, 5 | BRF_SND }, // 9 Sound data / TC5316200 - { "081-v2.v2", 0x200000, 0xacf29d96, 5 | BRF_SND }, // 10 / TC5316200 - { "081-v3.v3", 0x200000, 0xe524e415, 5 | BRF_SND }, // 11 / TC5316200 -}; - -STDROMPICKEXT(ssideki3, ssideki3, neogeo) -STD_ROM_FN(ssideki3) - -struct BurnDriver BurnDrvSsideki3 = { - "ssideki3", NULL, "neogeo", NULL, "1995", - "Super Sidekicks 3 - The Next Glory / Tokuten Ou 3 - eikou e no michi\0", NULL, "SNK", "Neo Geo MVS", - L"Super Sidekicks 3 - The Next Glory\0\u5F97\u70B9\u738B\uFF13 - \u6804\u5149\u3078\u306E\u6311\u6226\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_SPORTSFOOTBALL, 0, - NULL, ssideki3RomInfo, ssideki3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// The King of Fighters '95 (NGM-084) -/* MVS VERSION */ - -static struct BurnRomInfo kof95RomDesc[] = { - { "084-p1.p1", 0x200000, 0x2cba2716, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "084-s1.s1", 0x020000, 0xde716f8a, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "084-c1.c1", 0x400000, 0xfe087e32, 3 | BRF_GRA }, // 2 Sprite data / TC5332202 - { "084-c2.c2", 0x400000, 0x07864e09, 3 | BRF_GRA }, // 3 / TC5332202 - { "084-c3.c3", 0x400000, 0xa4e65d1b, 3 | BRF_GRA }, // 4 / TC5332202 - { "084-c4.c4", 0x400000, 0xc1ace468, 3 | BRF_GRA }, // 5 / TC5332202 - { "084-c5.c5", 0x200000, 0x8a2c1edc, 3 | BRF_GRA }, // 6 / TC5316200 - { "084-c6.c6", 0x200000, 0xf593ac35, 3 | BRF_GRA }, // 7 / TC5316200 - { "084-c7.c7", 0x100000, 0x9904025f, 3 | BRF_GRA }, // 8 / TC538200 - { "084-c8.c8", 0x100000, 0x78eb0f9b, 3 | BRF_GRA }, // 9 / TC538200 - - { "084-m1.m1", 0x020000, 0x6f2d7429, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "084-v1.v1", 0x400000, 0x84861b56, 5 | BRF_SND }, // 11 Sound data / TC5332201 - { "084-v2.v2", 0x200000, 0xb38a2803, 5 | BRF_SND }, // 12 / TC5316200 - { "084-v3.v3", 0x100000, 0xd683a338, 5 | BRF_SND }, // 13 / TC538200 -}; - -STDROMPICKEXT(kof95, kof95, neogeo) -STD_ROM_FN(kof95) - -struct BurnDriver BurnDrvKof95 = { - "kof95", NULL, "neogeo", NULL, "1995", - "The King of Fighters '95 (NGM-084)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, FBF_KOF, - NULL, kof95RomInfo, kof95RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '95 (NGH-084, alternate board) -/* MVS VERSION */ - -static struct BurnRomInfo kof95aRomDesc[] = { - /* This set uses NEO-MVS PROGSM board; same rom data as in kof95h is used */ - { "084-epr.ep1", 0x080000, 0x577ca1bb, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C4002 - { "084-epr.ep2", 0x080000, 0x30802a5d, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 - { "084-epr.ep3", 0x080000, 0x21ae248a, 1 | BRF_ESS | BRF_PRG }, // 2 / M27C4002 - { "084-epr.ep4", 0x080000, 0x19d3fbee, 1 | BRF_ESS | BRF_PRG }, // 3 / M27C4002 - /* P's on eprom, correct chip label unknown */ - - { "084-s1.s1", 0x020000, 0xde716f8a, 2 | BRF_GRA }, // 4 Text layer tiles / TC531000 - - { "084-c1.c1", 0x400000, 0xfe087e32, 3 | BRF_GRA }, // 2 Sprite data / TC5332202 - { "084-c2.c2", 0x400000, 0x07864e09, 3 | BRF_GRA }, // 3 / TC5332202 - { "084-c3.c3", 0x400000, 0xa4e65d1b, 3 | BRF_GRA }, // 4 / TC5332202 - { "084-c4.c4", 0x400000, 0xc1ace468, 3 | BRF_GRA }, // 5 / TC5332202 - { "084-c5.c5", 0x200000, 0x8a2c1edc, 3 | BRF_GRA }, // 6 / TC5316200 - { "084-c6.c6", 0x200000, 0xf593ac35, 3 | BRF_GRA }, // 7 / TC5316200 - { "084-c7.c7", 0x100000, 0x9904025f, 3 | BRF_GRA }, // 8 / TC538200 - { "084-c8.c8", 0x100000, 0x78eb0f9b, 3 | BRF_GRA }, // 9 / TC538200 - - { "084-m1.m1", 0x020000, 0x6f2d7429, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "084-v1.v1", 0x400000, 0x84861b56, 5 | BRF_SND }, // 11 Sound data / TC5332201 - { "084-v2.v2", 0x200000, 0xb38a2803, 5 | BRF_SND }, // 12 / TC5316200 - { "084-v3.v3", 0x100000, 0xd683a338, 5 | BRF_SND }, // 13 / TC538200 -}; - -STDROMPICKEXT(kof95a, kof95a, neogeo) -STD_ROM_FN(kof95a) - -struct BurnDriver BurnDrvKof95a = { - "kof95a", "kof95", "neogeo", NULL, "1995", - "The King of Fighters '95 (NGH-084, alternate board)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof95aRomInfo, kof95aRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '95 (NGH-084) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo kof95hRomDesc[] = { - { "084-pg1.p1", 0x200000, 0x5e54cf95, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "084-s1.s1", 0x020000, 0xde716f8a, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "084-c1.c1", 0x400000, 0xfe087e32, 3 | BRF_GRA }, // 2 Sprite data / TC5332202 - { "084-c2.c2", 0x400000, 0x07864e09, 3 | BRF_GRA }, // 3 / TC5332202 - { "084-c3.c3", 0x400000, 0xa4e65d1b, 3 | BRF_GRA }, // 4 / TC5332202 - { "084-c4.c4", 0x400000, 0xc1ace468, 3 | BRF_GRA }, // 5 / TC5332202 - { "084-c5.c5", 0x200000, 0x8a2c1edc, 3 | BRF_GRA }, // 6 / TC5316200 - { "084-c6.c6", 0x200000, 0xf593ac35, 3 | BRF_GRA }, // 7 / TC5316200 - { "084-c7.c7", 0x100000, 0x9904025f, 3 | BRF_GRA }, // 8 / TC538200 - { "084-c8.c8", 0x100000, 0x78eb0f9b, 3 | BRF_GRA }, // 9 / TC538200 - - { "084-m1.m1", 0x020000, 0x6f2d7429, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "084-v1.v1", 0x400000, 0x84861b56, 5 | BRF_SND }, // 11 Sound data / TC5332201 - { "084-v2.v2", 0x200000, 0xb38a2803, 5 | BRF_SND }, // 12 / TC5316200 - { "084-v3.v3", 0x100000, 0xd683a338, 5 | BRF_SND }, // 13 / TC538200 -}; - -STDROMPICKEXT(kof95h, kof95h, neogeo) -STD_ROM_FN(kof95h) - -struct BurnDriver BurnDrvKof95h = { - "kof95h", "kof95", "neogeo", NULL, "1995", - "The King of Fighters '95 (NGH-084)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, FBF_KOF, - NULL, kof95hRomInfo, kof95hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown III / Samurai Spirits - Zankurou Musouken (NGM-087) -/* MVS VERSION */ - -static struct BurnRomInfo samsho3RomDesc[] = { - { "087-epr.ep1", 0x080000, 0x23e09bb8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C4002 - { "087-epr.ep2", 0x080000, 0x256f5302, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 - { "087-epr.ep3", 0x080000, 0xbf2db5dd, 1 | BRF_ESS | BRF_PRG }, // 2 / M27C4002 - { "087-epr.ep4", 0x080000, 0x53e60c58, 1 | BRF_ESS | BRF_PRG }, // 3 / M27C4002 - /* P's on eprom, correct chip label unknown */ - { "087-p5.p5", 0x100000, 0xe86ca4af, 1 | BRF_ESS | BRF_PRG }, // 4 / TC538200 - /* also found MVS set with p1 / sp2 on maskrom on PROG board NEO-MVS PROGBK1; - chip label are 087-PG1 and 087-P2 */ - - { "087-s1.s1", 0x020000, 0x74ec7d9f, 2 | BRF_GRA }, // 5 Text layer tiles / TC531000 - - { "087-c1.c1", 0x400000, 0x07a233bc, 3 | BRF_GRA }, // 6 Sprite data / TC5332202 - { "087-c2.c2", 0x400000, 0x7a413592, 3 | BRF_GRA }, // 7 / TC5332202 - { "087-c3.c3", 0x400000, 0x8b793796, 3 | BRF_GRA }, // 8 / TC533202 - { "087-c4.c4", 0x400000, 0x728fbf11, 3 | BRF_GRA }, // 9 / TC533202 - { "087-c5.c5", 0x400000, 0x172ab180, 3 | BRF_GRA }, // 10 / TC5332202 - { "087-c6.c6", 0x400000, 0x002ff8f3, 3 | BRF_GRA }, // 11 / TC5332202 - { "087-c7.c7", 0x100000, 0xae450e3d, 3 | BRF_GRA }, // 12 / TC538200 - { "087-c8.c8", 0x100000, 0xa9e82717, 3 | BRF_GRA }, // 13 / TC538200 - - { "087-m1.m1", 0x020000, 0x8e6440eb, 4 | BRF_ESS | BRF_PRG }, // 14 Z80 code / TC531001 - - { "087-v1.v1", 0x400000, 0x84bdd9a0, 5 | BRF_SND }, // 15 Sound data / TC5332201 - { "087-v2.v2", 0x200000, 0xac0f261a, 5 | BRF_SND }, // 16 / TC5316200 -}; - -STDROMPICKEXT(samsho3, samsho3, neogeo) -STD_ROM_FN(samsho3) - -struct BurnDriver BurnDrvSamSho3 = { - "samsho3", NULL, "neogeo", NULL, "1995", - "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (NGM-087)\0", NULL, "SNK", "Neo Geo MVS", - L"Samurai Shodown III\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4 - \u65AC\u7D05\u90CE\u7121\u53CC\u5263 (NGM-087)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho3RomInfo, samsho3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown III / Samurai Spirits - Zankurou Musouken (NGH-087) -/* AES VERSION */ - -static struct BurnRomInfo samsho3hRomDesc[] = { - { "087-pg1.p1", 0x100000, 0x282a336e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - { "087-p2.sp2", 0x200000, 0x9bbe27e0, 1 | BRF_ESS | BRF_PRG }, // 1 / mask rom TC5316200 - - { "087-s1.s1", 0x020000, 0x74ec7d9f, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "087-c1.c1", 0x400000, 0x07a233bc, 3 | BRF_GRA }, // 3 Sprite data / TC5332202 - { "087-c2.c2", 0x400000, 0x7a413592, 3 | BRF_GRA }, // 4 / TC5332202 - { "087-c3.c3", 0x400000, 0x8b793796, 3 | BRF_GRA }, // 5 / TC5332202 - { "087-c4.c4", 0x400000, 0x728fbf11, 3 | BRF_GRA }, // 6 / TC5332202 - { "087-c5.c5", 0x400000, 0x172ab180, 3 | BRF_GRA }, // 7 / TC5332202 - { "087-c6.c6", 0x400000, 0x002ff8f3, 3 | BRF_GRA }, // 8 / TC5332202 - { "087-c7.c7", 0x100000, 0xae450e3d, 3 | BRF_GRA }, // 9 / TC538200 - { "087-c8.c8", 0x100000, 0xa9e82717, 3 | BRF_GRA }, // 10 / TC538200 - - { "087-m1.m1", 0x020000, 0x8e6440eb, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "087-v1.v1", 0x400000, 0x84bdd9a0, 5 | BRF_SND }, // 12 Sound data / TC5332201 - { "087-v2.v2", 0x200000, 0xac0f261a, 5 | BRF_SND }, // 13 / TC5316200 -}; - -STDROMPICKEXT(samsho3h, samsho3h, neogeo) -STD_ROM_FN(samsho3h) - -struct BurnDriver BurnDrvSamSho3h = { - "samsho3h", "samsho3", "neogeo", NULL, "1995", - "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (NGH-087)\0", NULL, "SNK", "Neo Geo MVS", - L"Samurai Shodown III\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4 - \u65AC\u7D05\u90CE\u7121\u53CC\u5263 (NGH-087)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho3hRomInfo, samsho3hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Fighters Swords (Korean release of Samurai Shodown III) -/* KOREAN VERSION */ - -static struct BurnRomInfo fswordsRomDesc[] = { - { "187-p1k.p1", 0x100000, 0xc8e7c075, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - { "087-p2.sp2", 0x200000, 0x9bbe27e0, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "087-s1.s1", 0x020000, 0x74ec7d9f, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "087-c1.c1", 0x400000, 0x07a233bc, 3 | BRF_GRA }, // 3 Sprite data / TC5332202 - { "087-c2.c2", 0x400000, 0x7a413592, 3 | BRF_GRA }, // 4 / TC5332202 - { "087-c3.c3", 0x400000, 0x8b793796, 3 | BRF_GRA }, // 5 / TC5332202 - { "087-c4.c4", 0x400000, 0x728fbf11, 3 | BRF_GRA }, // 6 / TC5332202 - { "087-c5.c5", 0x400000, 0x172ab180, 3 | BRF_GRA }, // 7 / TC5332202 - { "087-c6.c6", 0x400000, 0x002ff8f3, 3 | BRF_GRA }, // 8 / TC5332202 - { "087-c7.c7", 0x100000, 0xae450e3d, 3 | BRF_GRA }, // 9 / TC538200 - { "087-c8.c8", 0x100000, 0xa9e82717, 3 | BRF_GRA }, // 10 / TC538200 - - { "087-m1.m1", 0x020000, 0x8e6440eb, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "087-v1.v1", 0x400000, 0x84bdd9a0, 5 | BRF_SND }, // 12 Sound data / TC5332201 - { "087-v2.v2", 0x200000, 0xac0f261a, 5 | BRF_SND }, // 13 / TC5316200 -}; - -STDROMPICKEXT(fswords, fswords, neogeo) -STD_ROM_FN(fswords) - -struct BurnDriver BurnDrvfswords = { - "fswords", "samsho3", "neogeo", NULL, "1995", - "Fighters Swords (Korean release of Samurai Shodown III)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, fswordsRomInfo, fswordsRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Real Bout Fatal Fury / Real Bout Garou Densetsu (NGM-095)(NGH-095) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo rbff1RomDesc[] = { - { "095-p1.p1", 0x100000, 0x63b4d8ae, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "095-p2.sp2", 0x200000, 0xcc15826e, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5316200 - - { "095-s1.s1", 0x020000, 0xb6bf5e08, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "069-c1.c1", 0x400000, 0xe302f93c, 3 | BRF_GRA }, // 3 Sprite data / TC5332205 - { "069-c2.c2", 0x400000, 0x1053a455, 3 | BRF_GRA }, // 4 / TC5332205 - { "069-c3.c3", 0x400000, 0x1c0fde2f, 3 | BRF_GRA }, // 5 / TC5332205 - { "069-c4.c4", 0x400000, 0xa25fc3d0, 3 | BRF_GRA }, // 6 / TC5332205 - { "095-c5.c5", 0x400000, 0x8b9b65df, 3 | BRF_GRA }, // 7 / TC5332202 - { "095-c6.c6", 0x400000, 0x3e164718, 3 | BRF_GRA }, // 8 / TC5332202 - { "095-c7.c7", 0x200000, 0xca605e12, 3 | BRF_GRA }, // 9 / TC5316200 - { "095-c8.c8", 0x200000, 0x4e6beb6c, 3 | BRF_GRA }, // 10 / TC5316200 - - { "095-m1.m1", 0x020000, 0x653492a7, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "069-v1.v1", 0x400000, 0x2bdbd4db, 5 | BRF_SND }, // 12 Sound data / TC5332204 - { "069-v2.v2", 0x400000, 0xa698a487, 5 | BRF_SND }, // 13 / TC5332204 - { "095-v3.v3", 0x400000, 0x189d1c6c, 5 | BRF_SND }, // 14 / TC5332201 -}; - -STDROMPICKEXT(rbff1, rbff1, neogeo) -STD_ROM_FN(rbff1) - -struct BurnDriver BurnDrvrbff1 = { - "rbff1", NULL, "neogeo", NULL, "1995", - "Real Bout Fatal Fury / Real Bout Garou Densetsu (NGM-095)(NGH-095)\0", NULL, "SNK", "Neo Geo MVS", - L"Real Bout Fatal Fury\0Real Bout \u9913\u72FC\u4F1D\u8AAC (NGM-095)(NGH-095)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, rbff1RomInfo, rbff1RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Real Bout Fatal Fury / Real Bout Garou Densetsu (bug fix revision) -/* MVS VERSION */ - -static struct BurnRomInfo rbff1aRomDesc[] = { - /* This is a bug fixed revision applied over the original cart. The original P1 and P2 stayed in the cart and this */ - /* 512k ROM was added to replace the first 512k of P1. */ - { "095-p1.p1", 0x100000, 0x63b4d8ae, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "095-p2.sp2", 0x200000, 0xcc15826e, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5316200 - - { "095-s1.s1", 0x020000, 0xb6bf5e08, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "069-c1.c1", 0x400000, 0xe302f93c, 3 | BRF_GRA }, // 3 Sprite data / TC5332205 - { "069-c2.c2", 0x400000, 0x1053a455, 3 | BRF_GRA }, // 4 / TC5332205 - { "069-c3.c3", 0x400000, 0x1c0fde2f, 3 | BRF_GRA }, // 5 / TC5332205 - { "069-c4.c4", 0x400000, 0xa25fc3d0, 3 | BRF_GRA }, // 6 / TC5332205 - { "095-c5.c5", 0x400000, 0x8b9b65df, 3 | BRF_GRA }, // 7 / TC5332202 - { "095-c6.c6", 0x400000, 0x3e164718, 3 | BRF_GRA }, // 8 / TC5332202 - { "095-c7.c7", 0x200000, 0xca605e12, 3 | BRF_GRA }, // 9 / TC5316200 - { "095-c8.c8", 0x200000, 0x4e6beb6c, 3 | BRF_GRA }, // 10 / TC5316200 - - { "095-m1.m1", 0x020000, 0x653492a7, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "069-v1.v1", 0x400000, 0x2bdbd4db, 5 | BRF_SND }, // 12 Sound data / TC5332204 - { "069-v2.v2", 0x400000, 0xa698a487, 5 | BRF_SND }, // 13 / TC5332204 - { "095-v3.v3", 0x400000, 0x189d1c6c, 5 | BRF_SND }, // 14 / TC5332201 - - /* the rom below acts as a patch to the program rom in the cart, replacing the first 512kb */ - { "095-epr.ep1", 0x080000, 0xbe0060a3, 0 | BRF_ESS | BRF_PRG }, // 15 68k code / M27C4002 - /* P is on eprom, correct chip label unknown */ -}; - -STDROMPICKEXT(rbff1a, rbff1a, neogeo) -STD_ROM_FN(rbff1a) - -static void rbff1aCallback() -{ - BurnLoadRom(Neo68KROMActive, 15, 1); -} - -static INT32 rbff1aInit() -{ - NeoCallbackActive->pInitialise = rbff1aCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvrbff1a = { - "rbff1a", "rbff1", "neogeo", NULL, "1995", - "Real Bout Fatal Fury / Real Bout Garou Densetsu (bug fix revision)\0", NULL, "SNK", "Neo Geo MVS", - L"Real Bout Fatal Fury\0Real Bout \u9913\u72FC\u4F1D\u8AAC (bug fix revision)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, rbff1aRomInfo, rbff1aRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - rbff1aInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Real Bout Fatal Fury / Real Bout Garou Densetsu (Korean release) -/* KOREAN VERSION */ - -static struct BurnRomInfo rbff1kRomDesc[] = { - { "095-p1k.p1", 0x100000, 0xf705364b, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "095-p2.sp2", 0x200000, 0xcc15826e, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5316200 - - { "095-s1.s1", 0x020000, 0xb6bf5e08, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "069-c1.c1", 0x400000, 0xe302f93c, 3 | BRF_GRA }, // 3 Sprite data / TC5332205 - { "069-c2.c2", 0x400000, 0x1053a455, 3 | BRF_GRA }, // 4 / TC5332205 - { "069-c3.c3", 0x400000, 0x1c0fde2f, 3 | BRF_GRA }, // 5 / TC5332205 - { "069-c4.c4", 0x400000, 0xa25fc3d0, 3 | BRF_GRA }, // 6 / TC5332205 - { "095-c5.c5", 0x400000, 0x8b9b65df, 3 | BRF_GRA }, // 7 / TC5332202 - { "095-c6.c6", 0x400000, 0x3e164718, 3 | BRF_GRA }, // 8 / TC5332202 - { "095-c7.c7", 0x200000, 0xca605e12, 3 | BRF_GRA }, // 9 / TC5316200 - { "095-c8.c8", 0x200000, 0x4e6beb6c, 3 | BRF_GRA }, // 10 / TC5316200 - - { "095-m1.m1", 0x020000, 0x653492a7, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "069-v1.v1", 0x400000, 0x2bdbd4db, 5 | BRF_SND }, // 12 Sound data / TC5332204 - { "069-v2.v2", 0x400000, 0xa698a487, 5 | BRF_SND }, // 13 / TC5332204 - { "095-v3.v3", 0x400000, 0x189d1c6c, 5 | BRF_SND }, // 14 / TC5332201 -}; - -STDROMPICKEXT(rbff1k, rbff1k, neogeo) -STD_ROM_FN(rbff1k) - -struct BurnDriver BurnDrvrbff1k = { - "rbff1k", "rbff1", "neogeo", NULL, "1995", - "Real Bout Fatal Fury / Real Bout Garou Densetsu (Korean release)\0", NULL, "SNK", "Neo Geo MVS", - L"Real Bout Fatal Fury\0Real Bout \u9913\u72FC\u4F1D\u8AAC (Korean release)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, rbff1kRomInfo, rbff1kRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Art of Fighting 3 - The Path of the Warrior / Art of Fighting - Ryuuko no Ken Gaiden - -static struct BurnRomInfo aof3RomDesc[] = { - { "096-p1.p1", 0x100000, 0x9edb420d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "096-p2.sp2", 0x200000, 0x4d5a2602, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5316200 - - { "096-s1.s1", 0x020000, 0xcc7fd344, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "096-c1.c1", 0x400000, 0xf17b8d89, 3 | BRF_GRA }, // 3 Sprite data / TC5332205 - { "096-c2.c2", 0x400000, 0x3840c508, 3 | BRF_GRA }, // 4 / TC5332205 - { "096-c3.c3", 0x400000, 0x55f9ee1e, 3 | BRF_GRA }, // 5 / TC5332205 - { "096-c4.c4", 0x400000, 0x585b7e47, 3 | BRF_GRA }, // 6 / TC5332205 - { "096-c5.c5", 0x400000, 0xc75a753c, 3 | BRF_GRA }, // 7 / TC5332205 - { "096-c6.c6", 0x400000, 0x9a9d2f7a, 3 | BRF_GRA }, // 8 / TC5332205 - { "096-c7.c7", 0x200000, 0x51bd8ab2, 3 | BRF_GRA }, // 9 / TC5316200 - { "096-c8.c8", 0x200000, 0x9a34f99c, 3 | BRF_GRA }, // 10 / TC5316200 - - { "096-m1.m1", 0x020000, 0xcb07b659, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "096-v1.v1", 0x200000, 0xe2c32074, 5 | BRF_SND }, // 12 Sound data / TC5316200 - { "096-v2.v2", 0x200000, 0xa290eee7, 5 | BRF_SND }, // 13 / TC5316200 - { "096-v3.v3", 0x200000, 0x199d12ea, 5 | BRF_SND }, // 14 / TC5316200 -}; - -STDROMPICKEXT(aof3, aof3, neogeo) -STD_ROM_FN(aof3) - -struct BurnDriver BurnDrvAof3 = { - "aof3", NULL, "neogeo", NULL, "1996", - "Art of Fighting 3 - The Path of the Warrior / Art of Fighting - Ryuuko no Ken Gaiden\0", NULL, "SNK", "Neo Geo MVS", - L"Art of Fighting 3 - The Path of the Warrior\0Art of Fighting - \u9F8D\u864E\u306E\u62F3\u5916\u4F1D\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, aof3RomInfo, aof3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Art of Fighting 3 - The Path of the Warrior (Korean release) -/* KOREAN VERSION */ - -static struct BurnRomInfo aof3kRomDesc[] = { - { "196-p1k.p1", 0x100000, 0xa0780789, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "096-p2.sp2", 0x200000, 0x4d5a2602, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5316200 - - { "096-s1.s1", 0x020000, 0xcc7fd344, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "096-c1.c1", 0x400000, 0xf17b8d89, 3 | BRF_GRA }, // 3 Sprite data / TC5332205 - { "096-c2.c2", 0x400000, 0x3840c508, 3 | BRF_GRA }, // 4 / TC5332205 - { "096-c3.c3", 0x400000, 0x55f9ee1e, 3 | BRF_GRA }, // 5 / TC5332205 - { "096-c4.c4", 0x400000, 0x585b7e47, 3 | BRF_GRA }, // 6 / TC5332205 - { "096-c5.c5", 0x400000, 0xc75a753c, 3 | BRF_GRA }, // 7 / TC5332205 - { "096-c6.c6", 0x400000, 0x9a9d2f7a, 3 | BRF_GRA }, // 8 / TC5332205 - { "096-c7.c7", 0x200000, 0x51bd8ab2, 3 | BRF_GRA }, // 9 / TC5316200 - { "096-c8.c8", 0x200000, 0x9a34f99c, 3 | BRF_GRA }, // 10 / TC5316200 - - { "096-m1.m1", 0x020000, 0xcb07b659, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "096-v1.v1", 0x200000, 0xe2c32074, 5 | BRF_SND }, // 12 Sound data / TC5316200 - { "096-v2.v2", 0x200000, 0xa290eee7, 5 | BRF_SND }, // 13 / TC5316200 - { "096-v3.v3", 0x200000, 0x199d12ea, 5 | BRF_SND }, // 14 / TC5316200 -}; - -STDROMPICKEXT(aof3k, aof3k, neogeo) -STD_ROM_FN(aof3k) - -struct BurnDriver BurnDrvAof3k = { - "aof3k", "aof3", "neogeo", NULL, "1996", - "Art of Fighting 3 - The Path of the Warrior (Korean release)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, aof3kRomInfo, aof3kRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '96 (NGM-214) -/* MVS VERSION */ - -static struct BurnRomInfo kof96RomDesc[] = { - { "214-p1.p1", 0x100000, 0x52755d74, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "214-p2.sp2", 0x200000, 0x002ccb73, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5316200 - - { "214-s1.s1", 0x020000, 0x1254cbdb, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "214-c1.c1", 0x400000, 0x7ecf4aa2, 3 | BRF_GRA }, // 3 Sprite data / TC5332205 - { "214-c2.c2", 0x400000, 0x05b54f37, 3 | BRF_GRA }, // 4 / TC5332205 - { "214-c3.c3", 0x400000, 0x64989a65, 3 | BRF_GRA }, // 5 / TC5332205 - { "214-c4.c4", 0x400000, 0xafbea515, 3 | BRF_GRA }, // 6 / TC5332205 - { "214-c5.c5", 0x400000, 0x2a3bbd26, 3 | BRF_GRA }, // 7 / TC5332205 - { "214-c6.c6", 0x400000, 0x44d30dc7, 3 | BRF_GRA }, // 8 / TC5332205 - { "214-c7.c7", 0x400000, 0x3687331b, 3 | BRF_GRA }, // 9 / TC5332205 - { "214-c8.c8", 0x400000, 0xfa1461ad, 3 | BRF_GRA }, // 10 / TC5332205 - - { "214-m1.m1", 0x020000, 0xdabc427c, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "214-v1.v1", 0x400000, 0x63f7b045, 5 | BRF_SND }, // 12 Sound data / TC5332204 - { "214-v2.v2", 0x400000, 0x25929059, 5 | BRF_SND }, // 13 / TC5332204 - { "214-v3.v3", 0x200000, 0x92a2257d, 5 | BRF_SND }, // 14 / TC5316200 -}; - -STDROMPICKEXT(kof96, kof96, neogeo) -STD_ROM_FN(kof96) - -struct BurnDriver BurnDrvKof96 = { - "kof96", NULL, "neogeo", NULL, "1996", - "The King of Fighters '96 (NGM-214)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof96RomInfo, kof96RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '96 (NGH-214) -/* AES VERSION */ - -static struct BurnRomInfo kof96hRomDesc[] = { - { "214-pg1.p1", 0x100000, 0xbd3757c9, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "214-p2.sp2", 0x200000, 0x002ccb73, 1 | BRF_ESS | BRF_PRG }, // 1 / mask rom TC5316200 - - { "214-s1.s1", 0x020000, 0x1254cbdb, 2 | BRF_GRA }, // 2 Text layer tiles / mask rom TC531000 - - { "214-c1.c1", 0x400000, 0x7ecf4aa2, 3 | BRF_GRA }, // 3 Sprite data / mask rom TC5332205 - { "214-c2.c2", 0x400000, 0x05b54f37, 3 | BRF_GRA }, // 4 / mask rom TC5332205 - { "214-c3.c3", 0x400000, 0x64989a65, 3 | BRF_GRA }, // 5 / mask rom TC5332205 - { "214-c4.c4", 0x400000, 0xafbea515, 3 | BRF_GRA }, // 6 / mask rom TC5332205 - { "214-c5.c5", 0x400000, 0x2a3bbd26, 3 | BRF_GRA }, // 7 / mask rom TC5332205 - { "214-c6.c6", 0x400000, 0x44d30dc7, 3 | BRF_GRA }, // 8 / mask rom TC5332205 - { "214-c7.c7", 0x400000, 0x3687331b, 3 | BRF_GRA }, // 9 / mask rom TC5332205 - { "214-c8.c8", 0x400000, 0xfa1461ad, 3 | BRF_GRA }, // 10 / mask rom TC5332205 - - { "214-m1.m1", 0x020000, 0xdabc427c, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / mask rom TC531001 - - { "214-v1.v1", 0x400000, 0x63f7b045, 5 | BRF_SND }, // 12 Sound data / mask rom TC5332204 - { "214-v2.v2", 0x400000, 0x25929059, 5 | BRF_SND }, // 13 / mask rom TC5332204 - { "214-v3.v3", 0x200000, 0x92a2257d, 5 | BRF_SND }, // 14 / mask rom TC5316200 -}; - -STDROMPICKEXT(kof96h, kof96h, neogeo) -STD_ROM_FN(kof96h) - -struct BurnDriver BurnDrvKof96h = { - "kof96h", "kof96", "neogeo", NULL, "1996", - "The King of Fighters '96 (NGH-214)\0", NULL, "SNK", "Neo Geo AES", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof96hRomInfo, kof96hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero - -static struct BurnRomInfo ssideki4RomDesc[] = { - { "215-p1.p1", 0x200000, 0x519b4ba3, 1 | BRF_ESS | BRF_PRG }, // 0 68K code /* TC5316200 */ - - { "215-s1.s1", 0x020000, 0xf0fe5c36, 2 | BRF_GRA }, // 1 Text layer tiles /* TC531000 */ - - { "215-c1.c1", 0x400000, 0x8ff444f5, 3 | BRF_GRA }, // 2 Sprite data /* TC5332205 */ - { "215-c2.c2", 0x400000, 0x5b155037, 3 | BRF_GRA }, // 3 /* TC5332205 */ - { "215-c3.c3", 0x400000, 0x456a073a, 3 | BRF_GRA }, // 4 /* TC5332205 */ - { "215-c4.c4", 0x400000, 0x43c182e1, 3 | BRF_GRA }, // 5 /* TC5332205 */ - { "215-c5.c5", 0x200000, 0x0c6f97ec, 3 | BRF_GRA }, // 6 /* TC5332205 */ - { "215-c6.c6", 0x200000, 0x329c5e1b, 3 | BRF_GRA }, // 7 /* TC5332205 */ - - { "215-m1.m1", 0x020000, 0xa932081d, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code /* TC531001 */ - - { "215-v1.v1", 0x400000, 0x877d1409, 5 | BRF_SND }, // 9 Sound data /* TC5332204 */ - { "215-v2.v2", 0x200000, 0x1bfa218b, 5 | BRF_SND }, // 10 /* TC5316200 */ -}; - -STDROMPICKEXT(ssideki4, ssideki4, neogeo) -STD_ROM_FN(ssideki4) - -struct BurnDriver BurnDrvSsideki4 = { - "ssideki4", NULL, "neogeo", NULL, "1996", - "The Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero\0", NULL, "SNK", "Neo Geo MVS", - L"The Ultimate 11 - SNK Football Championship\0\u5F97\u70B9\u738B - \u708E\u306E\u30EA\u30D9\u30ED\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_SPORTSFOOTBALL, 0, - NULL, ssideki4RomInfo, ssideki4RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle - -static struct BurnRomInfo kizunaRomDesc[] = { - { "216-p1.p1", 0x200000, 0x75d2b3de, 1 | BRF_ESS | BRF_PRG }, // 0 68K code /* mask rom TC5316200 */ - - { "216-s1.s1", 0x020000, 0xefdc72d7, 2 | BRF_GRA }, // 1 Text layer tiles /* mask rom TC531000 */ - - { "059-c1.c1", 0x200000, 0x763ba611, 3 | BRF_GRA }, // 2 Sprite data /* TC5316200 */ - { "059-c2.c2", 0x200000, 0xe05e8ca6, 3 | BRF_GRA }, // 3 /* TC5316200 */ - { "216-c3.c3", 0x400000, 0x665c9f16, 3 | BRF_GRA }, // 4 /* mask rom TC5332205 */ - { "216-c4.c4", 0x400000, 0x7f5d03db, 3 | BRF_GRA }, // 5 /* mask rom TC5332205 */ - { "059-c5.c5", 0x200000, 0x59013f9e, 3 | BRF_GRA }, // 6 /* TC5316200 */ - { "059-c6.c6", 0x200000, 0x1c8d5def, 3 | BRF_GRA }, // 7 /* TC5316200 */ - { "059-c7.c7", 0x200000, 0xc88f7035, 3 | BRF_GRA }, // 8 /* TC538200 */ - { "059-c8.c8", 0x200000, 0x484ce3ba, 3 | BRF_GRA }, // 9 /* TC538200 */ - - { "216-m1.m1", 0x020000, 0x1b096820, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "059-v1.v1", 0x200000, 0x530c50fd, 5 | BRF_SND }, // 11 Sound data /* TC5316200 */ - { "216-v2.v2", 0x200000, 0x03667a8d, 5 | BRF_SND }, // 12 /* mask rom TC5316200 */ - { "059-v3.v3", 0x200000, 0x7038c2f9, 5 | BRF_SND }, // 13 /* TC5316200 */ - { "216-v4.v4", 0x200000, 0x31b99bd6, 5 | BRF_SND }, // 14 /* mask rom TC5316200 */ -}; - -STDROMPICKEXT(kizuna, kizuna, neogeo) -STD_ROM_FN(kizuna) - -struct BurnDriver BurnDrvKizuna = { - "kizuna", NULL, "neogeo", NULL, "1996", - "Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle\0", NULL, "SNK", "Neo Geo MVS", - L"Kizuna Encounter - Super Tag Battle\0\u98A8\u96F2 Super Tag Battle\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, kizunaRomInfo, kizunaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin (NGM-222)(NGH-222) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo samsho4RomDesc[] = { - { "222-p1.p1", 0x100000, 0x1a5cb56d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code /* TC538200 */ - { "222-p2.sp2", 0x400000, 0xb023cd8b, 1 | BRF_ESS | BRF_PRG }, // 1 /* TC5332205 */ - - { "222-s1.s1", 0x020000, 0x8d3d3bf9, 2 | BRF_GRA }, // 2 Text layer tiles /* TC531000 */ - - { "222-c1.c1", 0x400000, 0x68f2ed95, 3 | BRF_GRA }, // 3 Sprite data /* TC5332205 */ - { "222-c2.c2", 0x400000, 0xa6e9aff0, 3 | BRF_GRA }, // 4 /* TC5332205 */ - { "222-c3.c3", 0x400000, 0xc91b40f4, 3 | BRF_GRA }, // 5 /* TC5332205 */ - { "222-c4.c4", 0x400000, 0x359510a4, 3 | BRF_GRA }, // 6 /* TC5332205 */ - { "222-c5.c5", 0x400000, 0x9cfbb22d, 3 | BRF_GRA }, // 7 /* TC5332205 */ - { "222-c6.c6", 0x400000, 0x685efc32, 3 | BRF_GRA }, // 8 /* TC5332205 */ - { "222-c7.c7", 0x400000, 0xd0f86f0d, 3 | BRF_GRA }, // 9 /* TC5332205 */ - { "222-c8.c8", 0x400000, 0xadfc50e3, 3 | BRF_GRA }, // 10 /* TC5332205 */ - - { "222-m1.m1", 0x020000, 0x7615bc1b, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code /* TC531001 */ - - { "222-v1.v1", 0x400000, 0x7d6ba95f, 5 | BRF_SND }, // 12 Sound data /* TC5332204 */ - { "222-v2.v2", 0x400000, 0x6c33bb5d, 5 | BRF_SND }, // 13 /* TC5332204 */ - { "222-v3.v3", 0x200000, 0x831ea8c0, 5 | BRF_SND }, // 14 /* TC5316200 */ -}; - -STDROMPICKEXT(samsho4, samsho4, neogeo) -STD_ROM_FN(samsho4) - -struct BurnDriver BurnDrvSamSho4 = { - "samsho4", NULL, "neogeo", NULL, "1996", - "Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin (NGM-222)(NGH-222)\0", NULL, "SNK", "Neo Geo MVS", - L"Samurai Shodown IV - Amakusa's Revenge\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4 - \u5929\u8349\u964D\u81E8 (NGM-222)(NGH-222)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho4RomInfo, samsho4RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Pae Wang Jeon Seol / Legend of a Warrior (Korean censored Samurai Shodown IV) -/* KOREAN VERSION */ - -static struct BurnRomInfo samsho4kRomDesc[] = { - { "222-p1k.p1", 0x100000, 0x06e0a25d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "222-p2.sp2", 0x400000, 0xb023cd8b, 1 | BRF_ESS | BRF_PRG }, // 1 /* TC5332205 */ - - { "222-s1k.s1", 0x020000, 0xd313687d, 2 | BRF_GRA }, // 2 Text layer tiles - - { "222-c1.c1", 0x400000, 0x68f2ed95, 3 | BRF_GRA }, // 3 Sprite data /* TC5332205 */ - { "222-c2.c2", 0x400000, 0xa6e9aff0, 3 | BRF_GRA }, // 4 /* TC5332205 */ - { "222-c3.c3", 0x400000, 0xc91b40f4, 3 | BRF_GRA }, // 5 /* TC5332205 */ - { "222-c4.c4", 0x400000, 0x359510a4, 3 | BRF_GRA }, // 6 /* TC5332205 */ - { "222-c5.c5", 0x400000, 0x9cfbb22d, 3 | BRF_GRA }, // 7 /* TC5332205 */ - { "222-c6.c6", 0x400000, 0x685efc32, 3 | BRF_GRA }, // 8 /* TC5332205 */ - { "222-c7.c7", 0x400000, 0xd0f86f0d, 3 | BRF_GRA }, // 9 /* TC5332205 */ - { "222-c8.c8", 0x400000, 0xadfc50e3, 3 | BRF_GRA }, // 10 /* TC5332205 */ - - { "222-m1.m1", 0x020000, 0x7615bc1b, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code /* TC531001 */ - - { "222-v1.v1", 0x400000, 0x7d6ba95f, 5 | BRF_SND }, // 12 Sound data /* TC5332204 */ - { "222-v2.v2", 0x400000, 0x6c33bb5d, 5 | BRF_SND }, // 13 /* TC5332204 */ - { "222-v3.v3", 0x200000, 0x831ea8c0, 5 | BRF_SND }, // 14 /* TC5316200 */ -}; - -STDROMPICKEXT(samsho4k, samsho4k, neogeo) -STD_ROM_FN(samsho4k) - -struct BurnDriver BurnDrvSamSho4k = { - "samsho4k", "samsho4", "neogeo", NULL, "1996", - "Pae Wang Jeon Seol / Legend of a Warrior (Korean censored Samurai Shodown IV)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho4kRomInfo, samsho4kRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special - -static struct BurnRomInfo rbffspecRomDesc[] = { - { "223-p1.p1", 0x100000, 0xf84a2d1d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "223-p2.sp2", 0x400000, 0xaddd8f08, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "223-s1.s1", 0x020000, 0x7ecd6e8c, 2 | BRF_GRA }, // 2 Text layer tiles - - { "223-c1.c1", 0x400000, 0xebab05e2, 3 | BRF_GRA }, // 3 Sprite data - { "223-c2.c2", 0x400000, 0x641868c3, 3 | BRF_GRA }, // 4 - { "223-c3.c3", 0x400000, 0xca00191f, 3 | BRF_GRA }, // 5 - { "223-c4.c4", 0x400000, 0x1f23d860, 3 | BRF_GRA }, // 6 - { "223-c5.c5", 0x400000, 0x321e362c, 3 | BRF_GRA }, // 7 - { "223-c6.c6", 0x400000, 0xd8fcef90, 3 | BRF_GRA }, // 8 - { "223-c7.c7", 0x400000, 0xbc80dd2d, 3 | BRF_GRA }, // 9 - { "223-c8.c8", 0x400000, 0x5ad62102, 3 | BRF_GRA }, // 10 - - { "223-m1.m1", 0x020000, 0x3fee46bf, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "223-v1.v1", 0x400000, 0x76673869, 5 | BRF_SND }, // 12 Sound data - { "223-v2.v2", 0x400000, 0x7a275acd, 5 | BRF_SND }, // 13 - { "223-v3.v3", 0x400000, 0x5a797fd2, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(rbffspec, rbffspec, neogeo) -STD_ROM_FN(rbffspec) - -struct BurnDriver BurnDrvrbffspec = { - "rbffspec", NULL, "neogeo", NULL, "1996", - "Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, rbffspecRomInfo, rbffspecRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special (Korean release) -/* KOREAN VERSION */ - -static struct BurnRomInfo rbffspeckRomDesc[] = { - { "223-p1k.p1", 0x100000, 0xb78c8391, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - /* Chip label is correct. They used Cart ID 0124 as 0123 was already used by quizdaisk */ - { "223-p2.sp2", 0x400000, 0xaddd8f08, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "223-s1.s1", 0x020000, 0x7ecd6e8c, 2 | BRF_GRA }, // 2 Text layer tiles - - { "223-c1.c1", 0x400000, 0xebab05e2, 3 | BRF_GRA }, // 3 Sprite data - { "223-c2.c2", 0x400000, 0x641868c3, 3 | BRF_GRA }, // 4 - { "223-c3.c3", 0x400000, 0xca00191f, 3 | BRF_GRA }, // 5 - { "223-c4.c4", 0x400000, 0x1f23d860, 3 | BRF_GRA }, // 6 - { "223-c5.c5", 0x400000, 0x321e362c, 3 | BRF_GRA }, // 7 - { "223-c6.c6", 0x400000, 0xd8fcef90, 3 | BRF_GRA }, // 8 - { "223-c7.c7", 0x400000, 0xbc80dd2d, 3 | BRF_GRA }, // 9 - { "223-c8.c8", 0x400000, 0x5ad62102, 3 | BRF_GRA }, // 10 - - { "223-m1.m1", 0x020000, 0x3fee46bf, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "223-v1.v1", 0x400000, 0x76673869, 5 | BRF_SND }, // 12 Sound data - { "223-v2.v2", 0x400000, 0x7a275acd, 5 | BRF_SND }, // 13 - { "223-v3.v3", 0x400000, 0x5a797fd2, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(rbffspeck, rbffspeck, neogeo) -STD_ROM_FN(rbffspeck) - -struct BurnDriver BurnDrvrbffspeck = { - "rbffspeck", "rbffspec", "neogeo", NULL, "1996", - "Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special (Korean release)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, rbffspeckRomInfo, rbffspeckRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// The King of Fighters '97 (NGM-2320) -/* MVS VERSION */ - -static struct BurnRomInfo kof97RomDesc[] = { - { "232-p1.p1", 0x100000, 0x7db81ad9, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "232-p2.sp2", 0x400000, 0x158b23f6, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "232-s1.s1", 0x020000, 0x8514ecf5, 2 | BRF_GRA }, // 2 Text layer tiles - - { "232-c1.c1", 0x800000, 0x5f8bf0a1, 3 | BRF_GRA }, // 3 Sprite data - { "232-c2.c2", 0x800000, 0xe4d45c81, 3 | BRF_GRA }, // 4 - { "232-c3.c3", 0x800000, 0x581d6618, 3 | BRF_GRA }, // 5 - { "232-c4.c4", 0x800000, 0x49bb1e68, 3 | BRF_GRA }, // 6 - { "232-c5.c5", 0x400000, 0x34fc4e51, 3 | BRF_GRA }, // 7 - { "232-c6.c6", 0x400000, 0x4ff4d47b, 3 | BRF_GRA }, // 8 - - { "232-m1.m1", 0x020000, 0x45348747, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "232-v1.v1", 0x400000, 0x22a2b5b5, 5 | BRF_SND }, // 10 Sound data - { "232-v2.v2", 0x400000, 0x2304e744, 5 | BRF_SND }, // 11 - { "232-v3.v3", 0x400000, 0x759eb954, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kof97, kof97, neogeo) -STD_ROM_FN(kof97) - -struct BurnDriver BurnDrvKof97 = { - "kof97", NULL, "neogeo", NULL, "1997", - "The King of Fighters '97 (NGM-2320)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof97RomInfo, kof97RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '97 (NGH-2320) -/* AES VERSION */ - -static struct BurnRomInfo kof97hRomDesc[] = { - { "232-pg1.p1", 0x100000, 0x5c2400b7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "232-p2.sp2", 0x400000, 0x158b23f6, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "232-s1.s1", 0x020000, 0x8514ecf5, 2 | BRF_GRA }, // 2 Text layer tiles - - { "232-c1.c1", 0x800000, 0x5f8bf0a1, 3 | BRF_GRA }, // 3 Sprite data - { "232-c2.c2", 0x800000, 0xe4d45c81, 3 | BRF_GRA }, // 4 - { "232-c3.c3", 0x800000, 0x581d6618, 3 | BRF_GRA }, // 5 - { "232-c4.c4", 0x800000, 0x49bb1e68, 3 | BRF_GRA }, // 6 - { "232-c5.c5", 0x400000, 0x34fc4e51, 3 | BRF_GRA }, // 7 - { "232-c6.c6", 0x400000, 0x4ff4d47b, 3 | BRF_GRA }, // 8 - - { "232-m1.m1", 0x020000, 0x45348747, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "232-v1.v1", 0x400000, 0x22a2b5b5, 5 | BRF_SND }, // 10 Sound data - { "232-v2.v2", 0x400000, 0x2304e744, 5 | BRF_SND }, // 11 - { "232-v3.v3", 0x400000, 0x759eb954, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kof97h, kof97h, neogeo) -STD_ROM_FN(kof97h) - -struct BurnDriver BurnDrvKof97h = { - "kof97h", "kof97", "neogeo", NULL, "1997", - "The King of Fighters '97 (NGH-2320)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof97hRomInfo, kof97hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '97 (Korean release) -/* KOREAN VERSION */ - -static struct BurnRomInfo kof97kRomDesc[] = { - { "232-p1.p1", 0x100000, 0x7db81ad9, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "232-p2.sp2", 0x400000, 0x158b23f6, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "232-s1.s1", 0x020000, 0x8514ecf5, 2 | BRF_GRA }, // 2 Text layer tiles - - { "232-c1.c1", 0x800000, 0x5f8bf0a1, 3 | BRF_GRA }, // 3 Sprite data - { "232-c2.c2", 0x800000, 0xe4d45c81, 3 | BRF_GRA }, // 4 - { "232-c3.c3", 0x800000, 0x581d6618, 3 | BRF_GRA }, // 5 - { "232-c4.c4", 0x800000, 0x49bb1e68, 3 | BRF_GRA }, // 6 - { "232-c5.c5", 0x400000, 0x34fc4e51, 3 | BRF_GRA }, // 7 - { "232-c6.c6", 0x400000, 0x4ff4d47b, 3 | BRF_GRA }, // 8 - - { "232-m1k.m1", 0x020000, 0xbbea9070, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "232-v1.v1", 0x400000, 0x22a2b5b5, 5 | BRF_SND }, // 10 Sound data - { "232-v2.v2", 0x400000, 0x2304e744, 5 | BRF_SND }, // 11 - { "232-v3.v3", 0x400000, 0x759eb954, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kof97k, kof97k, neogeo) -STD_ROM_FN(kof97k) - -struct BurnDriver BurnDrvKof97k = { - "kof97k", "kof97", "neogeo", NULL, "1997", - "The King of Fighters '97 (Korean release)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof97kRomInfo, kof97kRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '97 Plus (bootleg) - -static struct BurnRomInfo kof97plsRomDesc[] = { - { "kf97-p1p.bin", 0x100000, 0xc01fda46, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "kf97-p2p.bin", 0x400000, 0x5502b020, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "kf97-s1p.bin", 0x020000, 0x73254270, 2 | BRF_GRA }, // 2 Text layer tiles - - { "232-c1.c1", 0x800000, 0x5f8bf0a1, 3 | BRF_GRA }, // 3 Sprite data - { "232-c2.c2", 0x800000, 0xe4d45c81, 3 | BRF_GRA }, // 4 - { "232-c3.c3", 0x800000, 0x581d6618, 3 | BRF_GRA }, // 5 - { "232-c4.c4", 0x800000, 0x49bb1e68, 3 | BRF_GRA }, // 6 - { "232-c5.c5", 0x400000, 0x34fc4e51, 3 | BRF_GRA }, // 7 - { "232-c6.c6", 0x400000, 0x4ff4d47b, 3 | BRF_GRA }, // 8 - - { "232-m1.m1", 0x020000, 0x45348747, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "232-v1.v1", 0x400000, 0x22a2b5b5, 5 | BRF_SND }, // 10 Sound data - { "232-v2.v2", 0x400000, 0x2304e744, 5 | BRF_SND }, // 11 - { "232-v3.v3", 0x400000, 0x759eb954, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kof97pls, kof97pls, neogeo) -STD_ROM_FN(kof97pls) - -struct BurnDriver BurnDrvKof97pls = { - "kof97pls", "kof97", "neogeo", NULL, "1997", - "The King of Fighters '97 Plus (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof97plsRomInfo, kof97plsRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// King of Gladiator (The King of Fighters '97 bootleg) - -static struct BurnRomInfo kogRomDesc[] = { - { "5232-p1.bin", 0x200000, 0xd2413ec6, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "232-p2.sp2", 0x400000, 0x158b23f6, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5232-s1.bin", 0x020000, 0x0bef69da, 2 | BRF_GRA }, // 2 Text layer tiles - - { "5232-c1a.bin", 0x800000, 0x4eab9b0a, 3 | BRF_GRA }, // 3 Sprite data - { "5232-c2a.bin", 0x800000, 0x697f8fd0, 3 | BRF_GRA }, // 4 - { "5232-c1b.bin", 0x800000, 0x1143fdf3, 3 | BRF_GRA }, // 5 - { "5232-c2b.bin", 0x800000, 0xea82cf8f, 3 | BRF_GRA }, // 6 - { "5232-c3.bin", 0x400000, 0xabd1be07, 3 | BRF_GRA }, // 7 - { "5232-c4.bin", 0x400000, 0xd2bd967b, 3 | BRF_GRA }, // 8 - - { "232-m1.m1", 0x020000, 0x45348747, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "232-v1.v1", 0x400000, 0x22a2b5b5, 5 | BRF_SND }, // 10 Sound data - { "232-v2.v2", 0x400000, 0x2304e744, 5 | BRF_SND }, // 11 - { "232-v3.v3", 0x400000, 0x759eb954, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kog, kog, neogeo) -STD_ROM_FN(kog) - -// This is actually set by a jumper on the PCB -UINT16 __fastcall KogReadWord(UINT32) -{ - extern INT32 nBIOS; - if (nBIOS == 5 || nBIOS == 6 || nBIOS == 7 || nBIOS == 8 || nBIOS == 10 || nBIOS == 11) { - return 0xff00; - } else { - return 0xff01; - } -} - -static void kogCallback() -{ - INT32 i; - UINT8 *dst = (UINT8 *)BurnMalloc( 0x100000 ); - - if (dst) - { - static const INT32 sec[] = { 0x3, 0x8, 0x7, 0xc, 0x1, 0xa, 0x6, 0xd }; - - for (i = 0; i < 0x100000 / 0x020000; i++) - memmove (dst + i * 0x020000, Neo68KROMActive + sec[i] * 0x020000, 0x020000); - - memmove (dst + 0x090000, Neo68KROMActive + 0x040000, 0x004000); - memmove (Neo68KROMActive, dst, 0x100000); - BurnFree (dst); - } - - for (i = 0x90000; i < 0x94000; i+=2) { - if ((*((UINT16 *)(Neo68KROMActive + i + 0)) & BURN_ENDIAN_SWAP_INT16(0xf2bf)) == BURN_ENDIAN_SWAP_INT16(0x42b9) && *((UINT16 *)(Neo68KROMActive + i + 2)) == 0) - *((UINT16 *)(Neo68KROMActive + i + 2)) = BURN_ENDIAN_SWAP_INT16(0x0009); - - if (*((UINT16 *)(Neo68KROMActive + i + 0)) == BURN_ENDIAN_SWAP_INT16(0x4eb8)) { - *((UINT16 *)(Neo68KROMActive + i + 0)) = BURN_ENDIAN_SWAP_INT16(0x6100); - *((UINT16 *)(Neo68KROMActive + i + 2)) += BURN_ENDIAN_SWAP_INT16(0xfffe - (i & 0xfffe)); - } - } - - memmove (Neo68KROMActive + 0x0007a6, Neo68KROMActive + 0x0907a6, 0x000006); - memmove (Neo68KROMActive + 0x0007c6, Neo68KROMActive + 0x0907c6, 0x000006); - memmove (Neo68KROMActive + 0x0007e6, Neo68KROMActive + 0x0907e6, 0x000006); - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive + 0x200000, 0x400000); - - *((UINT16 *)(Neo68KROMActive + 0x924ac)) = BURN_ENDIAN_SWAP_INT16(0x0009); - *((UINT16 *)(Neo68KROMActive + 0x9251c)) = BURN_ENDIAN_SWAP_INT16(0x0009); - - lans2004_sx_decode(); - lans2004_cx_decode(0x800000 * 5); -} - -static void kogInstallHandlers() -{ - // Install jumper that controls title screen language - SekMapHandler(6, 0x0FFFFE, 0x0FFFFF, MAP_READ); - SekSetReadWordHandler(6, KogReadWord); -} - -static INT32 kogInit() -{ - INT32 nRet; - - nBurnCPUSpeedAdjust = 0x010a; // fix garbage on intro - NeoCallbackActive->pInitialise = kogCallback; - NeoCallbackActive->pInstallHandlers = kogInstallHandlers; - - nRet = NeoInit(); - - return nRet; -} - -struct BurnDriver BurnDrvKog = { - "kog", "kof97", "neogeo", NULL, "1997", - "King of Gladiator (The King of Fighters '97 bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kogRomInfo, kogRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kogInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// King of Gladiator Plus (The King of Fighters '97 bootleg) - -static struct BurnRomInfo kogplusRomDesc[] = { - { "5232-p1p.bin", 0x200000, 0x0338f453, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "5232-p2p.bin", 0x400000, 0x5502b020, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5232-s1p.bin", 0x020000, 0x6271e9ba, 2 | BRF_GRA }, // 2 Text layer tiles - - { "5232-c1a.bin", 0x800000, 0x4eab9b0a, 3 | BRF_GRA }, // 3 Sprite data - { "5232-c2a.bin", 0x800000, 0x697f8fd0, 3 | BRF_GRA }, // 4 - { "5232-c1b.bin", 0x800000, 0x1143fdf3, 3 | BRF_GRA }, // 5 - { "5232-c2b.bin", 0x800000, 0xea82cf8f, 3 | BRF_GRA }, // 6 - { "5232-c3.bin", 0x400000, 0xabd1be07, 3 | BRF_GRA }, // 7 - { "5232-c4.bin", 0x400000, 0xd2bd967b, 3 | BRF_GRA }, // 8 - - { "232-m1.m1", 0x020000, 0x45348747, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "232-v1.v1", 0x400000, 0x22a2b5b5, 5 | BRF_SND }, // 10 Sound data - { "232-v2.v2", 0x400000, 0x2304e744, 5 | BRF_SND }, // 11 - { "232-v3.v3", 0x400000, 0x759eb954, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kogplus, kogplus, neogeo) -STD_ROM_FN(kogplus) - -struct BurnDriver BurnDrvKogplus = { - "kogplus", "kof97", "neogeo", NULL, "1997", - "King of Gladiator Plus (The King of Fighters '97 bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kogplusRomInfo, kogplusRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kogInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The Last Blade / Bakumatsu Roman - Gekka no Kenshi (NGM-2340) -/* MVS VERSION */ - -static struct BurnRomInfo lastbladRomDesc[] = { - { "234-p1.p1", 0x100000, 0xe123a5a3, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "234-p2.sp2", 0x400000, 0x0fdc289e, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "234-s1.s1", 0x020000, 0x95561412, 2 | BRF_GRA }, // 2 Text layer tiles - - { "234-c1.c1", 0x800000, 0x9f7e2bd3, 3 | BRF_GRA }, // 3 Sprite data - { "234-c2.c2", 0x800000, 0x80623d3c, 3 | BRF_GRA }, // 4 - { "234-c3.c3", 0x800000, 0x91ab1a30, 3 | BRF_GRA }, // 5 - { "234-c4.c4", 0x800000, 0x3d60b037, 3 | BRF_GRA }, // 6 - { "234-c5.c5", 0x400000, 0x1ba80cee, 3 | BRF_GRA }, // 7 - { "234-c6.c6", 0x400000, 0xbeafd091, 3 | BRF_GRA }, // 8 - - { "234-m1.m1", 0x020000, 0x087628ea, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "234-v1.v1", 0x400000, 0xed66b76f, 5 | BRF_SND }, // 10 Sound data - { "234-v2.v2", 0x400000, 0xa0e7f6e2, 5 | BRF_SND }, // 11 - { "234-v3.v3", 0x400000, 0xa506e1e2, 5 | BRF_SND }, // 12 - { "234-v4.v4", 0x400000, 0x0e34157f, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(lastblad, lastblad, neogeo) -STD_ROM_FN(lastblad) - -struct BurnDriver BurnDrvlastblad = { - "lastblad", NULL, "neogeo", NULL, "1997", - "The Last Blade / Bakumatsu Roman - Gekka no Kenshi (NGM-2340)\0", NULL, "SNK", "Neo Geo MVS", - L"The Last Blade\0\u5E55\u672B\u6D6A\u6F2B \u6708\u83EF\u306E\u5263\u58EB (NGM-2340)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, lastbladRomInfo, lastbladRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// The Last Blade / Bakumatsu Roman - Gekka no Kenshi (NGH-2340) -/* AES VERSION */ - -static struct BurnRomInfo lastbladhRomDesc[] = { - { "234-pg1.p1", 0x100000, 0xcd01c06d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "234-p2.sp2", 0x400000, 0x0fdc289e, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "234-s1.s1", 0x020000, 0x95561412, 2 | BRF_GRA }, // 2 Text layer tiles - - { "234-c1.c1", 0x800000, 0x9f7e2bd3, 3 | BRF_GRA }, // 3 Sprite data - { "234-c2.c2", 0x800000, 0x80623d3c, 3 | BRF_GRA }, // 4 - { "234-c3.c3", 0x800000, 0x91ab1a30, 3 | BRF_GRA }, // 5 - { "234-c4.c4", 0x800000, 0x3d60b037, 3 | BRF_GRA }, // 6 - { "234-c5.c5", 0x400000, 0x1ba80cee, 3 | BRF_GRA }, // 7 - { "234-c6.c6", 0x400000, 0xbeafd091, 3 | BRF_GRA }, // 8 - - { "234-m1.m1", 0x020000, 0x087628ea, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "234-v1.v1", 0x400000, 0xed66b76f, 5 | BRF_SND }, // 10 Sound data - { "234-v2.v2", 0x400000, 0xa0e7f6e2, 5 | BRF_SND }, // 11 - { "234-v3.v3", 0x400000, 0xa506e1e2, 5 | BRF_SND }, // 12 - { "234-v4.v4", 0x400000, 0x0e34157f, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(lastbladh, lastbladh, neogeo) -STD_ROM_FN(lastbladh) - -struct BurnDriver BurnDrvlastbladh = { - "lastbladh", "lastblad", "neogeo", NULL, "1997", - "The Last Blade / Bakumatsu Roman - Gekka no Kenshi (NGH-2340)\0", NULL, "SNK", "Neo Geo AES", - L"The Last Blade\0\u5E55\u672B\u6D6A\u6F2B \u6708\u83EF\u306E\u5263\u58EB (NGH-2340)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, lastbladhRomInfo, lastbladhRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// The Last Soldier (Korean release of The Last Blade) -/* KOREAN VERSION */ - -static struct BurnRomInfo lastsoldRomDesc[] = { - { "134-p1k.p1", 0x100000, 0x906f3065, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "234-p2.sp2", 0x400000, 0x0fdc289e, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "234-s1.s1", 0x020000, 0x95561412, 2 | BRF_GRA }, // 2 Text layer tiles - - { "234-c1.c1", 0x800000, 0x9f7e2bd3, 3 | BRF_GRA }, // 3 Sprite data - { "234-c2.c2", 0x800000, 0x80623d3c, 3 | BRF_GRA }, // 4 - { "234-c3.c3", 0x800000, 0x91ab1a30, 3 | BRF_GRA }, // 5 - { "234-c4.c4", 0x800000, 0x3d60b037, 3 | BRF_GRA }, // 6 - { "234-c5.c5", 0x400000, 0x1ba80cee, 3 | BRF_GRA }, // 7 - { "234-c6.c6", 0x400000, 0xbeafd091, 3 | BRF_GRA }, // 8 - - { "234-m1.m1", 0x020000, 0x087628ea, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "234-v1.v1", 0x400000, 0xed66b76f, 5 | BRF_SND }, // 10 Sound data - { "234-v2.v2", 0x400000, 0xa0e7f6e2, 5 | BRF_SND }, // 11 - { "234-v3.v3", 0x400000, 0xa506e1e2, 5 | BRF_SND }, // 12 - { "234-v4.v4", 0x400000, 0x0e34157f, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(lastsold, lastsold, neogeo) -STD_ROM_FN(lastsold) - -struct BurnDriver BurnDrvlastsold = { - "lastsold", "lastblad", "neogeo", NULL, "1997", - "The Last Soldier (Korean release of The Last Blade)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, lastsoldRomInfo, lastsoldRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// The Irritating Maze / Ultra Denryu Iraira Bou -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo irrmazeRomDesc[] = { - { "236-p1.p1", 0x200000, 0x4c2ff660, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "236-s1.s1", 0x020000, 0x5d1ca640, 2 | BRF_GRA }, // 1 Text layer tiles - - { "236-c1.c1", 0x400000, 0xc1d47902, 3 | BRF_GRA }, // 2 Sprite data - { "236-c2.c2", 0x400000, 0xe15f972e, 3 | BRF_GRA }, // 3 - - { "236-m1.m1", 0x020000, 0x880a1abd, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "236-v1.v1", 0x200000, 0x5f89c3b4, 5 | BRF_SND }, // 5 Sound data - { "236-v2.v2", 0x100000, 0x72e3add7, 6 | BRF_SND }, // 6 -}; - -STDROMPICKEXT(irrmaze, irrmaze, neotrackball) -STD_ROM_FN(irrmaze) - -struct BurnDriver BurnDrvIrrmaze = { - "irrmaze", NULL, "neogeo", NULL, "1997", - "The Irritating Maze / Ultra Denryu Iraira Bou\0", NULL, "SNK / Saurus", "Neo Geo MVS", - L"The Irritating Maze\0\u30A6\u30EB\u30C8\u30E9\u96FB\u6D41\u30A4\u30E9\u30A4\u30E9\u68D2\0", NULL, NULL, NULL, - BDF_GAME_WORKING /*| BDF_TRACKBALL*/, 1, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_TRACKBALL | HARDWARE_SNK_SWAPP, GBF_MAZE, 0, - NULL, irrmazeRomInfo, irrmazeRomName, NULL, NULL, neotrackballInputInfo, neotrackballDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (NGM-2400) -/* MVS VERSION */ - -static struct BurnRomInfo rbff2RomDesc[] = { - { "240-p1.p1", 0x100000, 0x80e41205, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "240-p2.sp2", 0x400000, 0x960aa88d, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "240-s1.s1", 0x020000, 0xda3b40de, 2 | BRF_GRA }, // 2 Text layer tiles - - { "240-c1.c1", 0x800000, 0xeffac504, 3 | BRF_GRA }, // 3 Sprite data - { "240-c2.c2", 0x800000, 0xed182d44, 3 | BRF_GRA }, // 4 - { "240-c3.c3", 0x800000, 0x22e0330a, 3 | BRF_GRA }, // 5 - { "240-c4.c4", 0x800000, 0xc19a07eb, 3 | BRF_GRA }, // 6 - { "240-c5.c5", 0x800000, 0x244dff5a, 3 | BRF_GRA }, // 7 - { "240-c6.c6", 0x800000, 0x4609e507, 3 | BRF_GRA }, // 8 - - { "240-m1.m1", 0x040000, 0xed482791, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "240-v1.v1", 0x400000, 0xf796265a, 5 | BRF_SND }, // 10 Sound data - { "240-v2.v2", 0x400000, 0x2cb3f3bb, 5 | BRF_SND }, // 11 - { "240-v3.v3", 0x400000, 0x8fe1367a, 5 | BRF_SND }, // 12 - { "240-v4.v4", 0x200000, 0x996704d8, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(rbff2, rbff2, neogeo) -STD_ROM_FN(rbff2) - -struct BurnDriver BurnDrvrbff2 = { - "rbff2", NULL, "neogeo", NULL, "1998", - "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (NGM-2400)\0", NULL, "SNK", "Neo Geo MVS", - L"Real Bout Fatal Fury 2 - The Newcomers\0Real Bout \u9913\u72FC\u4F1D\u8AAC\uFF12 (NGM-2400)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, rbff2RomInfo, rbff2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (NGH-2400) -/* AES VERSION */ - -static struct BurnRomInfo rbff2hRomDesc[] = { - { "240-pg1.p1", 0x100000, 0xb6969780, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "240-p2.sp2", 0x400000, 0x960aa88d, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "240-s1.s1", 0x020000, 0xda3b40de, 2 | BRF_GRA }, // 2 Text layer tiles - - { "240-c1.c1", 0x800000, 0xeffac504, 3 | BRF_GRA }, // 3 Sprite data - { "240-c2.c2", 0x800000, 0xed182d44, 3 | BRF_GRA }, // 4 - { "240-c3.c3", 0x800000, 0x22e0330a, 3 | BRF_GRA }, // 5 - { "240-c4.c4", 0x800000, 0xc19a07eb, 3 | BRF_GRA }, // 6 - { "240-c5.c5", 0x800000, 0x244dff5a, 3 | BRF_GRA }, // 7 - { "240-c6.c6", 0x800000, 0x4609e507, 3 | BRF_GRA }, // 8 - - { "240-m1.m1", 0x040000, 0xed482791, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "240-v1.v1", 0x400000, 0xf796265a, 5 | BRF_SND }, // 10 Sound data - { "240-v2.v2", 0x400000, 0x2cb3f3bb, 5 | BRF_SND }, // 11 - { "240-v3.v3", 0x400000, 0x8fe1367a, 5 | BRF_SND }, // 12 - { "240-v4.v4", 0x200000, 0x996704d8, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(rbff2h, rbff2h, neogeo) -STD_ROM_FN(rbff2h) - -struct BurnDriver BurnDrvrbff2h = { - "rbff2h", "rbff2", "neogeo", NULL, "1998", - "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (NGH-2400)\0", NULL, "SNK", "Neo Geo MVS", - L"Real Bout Fatal Fury 2 - The Newcomers\0Real Bout \u9913\u72FC\u4F1D\u8AAC\uFF12 (NGH-2400)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, rbff2hRomInfo, rbff2hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Real Bout Fatal Fury 2 - The Newcomers (Korean release) -/* KOREAN VERSION */ - -static struct BurnRomInfo rbff2kRomDesc[] = { - { "140-p1k.p1", 0x100000, 0x965edee1, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "240-p2.sp2", 0x400000, 0x960aa88d, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "240-s1.s1", 0x020000, 0xda3b40de, 2 | BRF_GRA }, // 2 Text layer tiles - - { "240-c1.c1", 0x800000, 0xeffac504, 3 | BRF_GRA }, // 3 Sprite data - { "240-c2.c2", 0x800000, 0xed182d44, 3 | BRF_GRA }, // 4 - { "240-c3.c3", 0x800000, 0x22e0330a, 3 | BRF_GRA }, // 5 - { "240-c4.c4", 0x800000, 0xc19a07eb, 3 | BRF_GRA }, // 6 - { "240-c5.c5", 0x800000, 0x244dff5a, 3 | BRF_GRA }, // 7 - { "240-c6.c6", 0x800000, 0x4609e507, 3 | BRF_GRA }, // 8 - - { "240-m1.m1", 0x040000, 0xed482791, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "240-v1.v1", 0x400000, 0xf796265a, 5 | BRF_SND }, // 10 Sound data - { "240-v2.v2", 0x400000, 0x2cb3f3bb, 5 | BRF_SND }, // 11 - { "240-v3.v3", 0x400000, 0x8fe1367a, 5 | BRF_SND }, // 12 - { "240-v4.v4", 0x200000, 0x996704d8, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(rbff2k, rbff2k, neogeo) -STD_ROM_FN(rbff2k) - -struct BurnDriver BurnDrvrbff2k = { - "rbff2k", "rbff2", "neogeo", NULL, "1998", - "Real Bout Fatal Fury 2 - The Newcomers (Korean release)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, rbff2kRomInfo, rbff2kRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Metal Slug 2 - Super Vehicle-001/II (NGM-2410) (NGH-2410) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo mslug2RomDesc[] = { - { "241-p1.p1", 0x100000, 0x2a53c5da, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "241-p2.sp2", 0x200000, 0x38883f44, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "241-s1.s1", 0x020000, 0xf3d32f0f, 2 | BRF_GRA }, // 2 Text layer tiles - - /* Different layout with 8xC (mask rom) also exists on NEO-MVS CHA256; naming scheme is 241-Cx - { "241-c1.c1", 0x400000, 0x00000000, 3 | BRF_GRA | BRF_NODUMP }, // 3 Sprite data / mask rom - { "241-c2.c2", 0x400000, 0x00000000, 3 | BRF_GRA | BRF_NODUMP }, // 4 / mask rom - { "241-c3.c3", 0x400000, 0x00000000, 3 | BRF_GRA | BRF_NODUMP }, // 5 / mask rom - { "241-c4.c4", 0x400000, 0x00000000, 3 | BRF_GRA | BRF_NODUMP }, // 6 / mask rom - { "241-c5.c5", 0x400000, 0x00000000, 3 | BRF_GRA | BRF_NODUMP }, // 7 / mask rom - { "241-c6.c6", 0x400000, 0x00000000, 3 | BRF_GRA | BRF_NODUMP }, // 8 / mask rom - { "241-c7.c7", 0x400000, 0x00000000, 3 | BRF_GRA | BRF_NODUMP }, // 9 / mask rom - { "241-c8.c8", 0x400000, 0x00000000, 3 | BRF_GRA | BRF_NODUMP }, // 10 / mask rom */ - { "241-c1.c1", 0x800000, 0x394b5e0d, 3 | BRF_GRA }, // 3 Sprite data - { "241-c2.c2", 0x800000, 0xe5806221, 3 | BRF_GRA }, // 4 - { "241-c3.c3", 0x800000, 0x9f6bfa6f, 3 | BRF_GRA }, // 5 - { "241-c4.c4", 0x800000, 0x7d3e306f, 3 | BRF_GRA }, // 6 - - { "241-m1.m1", 0x020000, 0x94520ebd, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code - - { "241-v1.v1", 0x400000, 0x99ec20e8, 5 | BRF_SND }, // 8 Sound data - { "241-v2.v2", 0x400000, 0xecb16799, 5 | BRF_SND }, // 9 -}; - -STDROMPICKEXT(mslug2, mslug2, neogeo) -STD_ROM_FN(mslug2) - -struct BurnDriver BurnDrvMSlug2 = { - "mslug2", NULL, "neogeo", NULL, "1998", - "Metal Slug 2 - Super Vehicle-001/II (NGM-2410) (NGH-2410)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug2RomInfo, mslug2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (NGM-2420) -/* encrypted code + protection */ /* MVS VERSION */ - -static struct BurnRomInfo kof98RomDesc[] = { - /* This set uses NEO-MVS PROGSF1 board */ - { "242-p1.p1", 0x200000, 0x8893df89, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "242-p2.sp2", 0x400000, 0x980aba4c, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "242-s1.s1", 0x020000, 0x7f7b4805, 2 | BRF_GRA }, // 2 Text layer tiles - - { "242-c1.c1", 0x800000, 0xe564ecd6, 3 | BRF_GRA }, // 3 Sprite data - { "242-c2.c2", 0x800000, 0xbd959b60, 3 | BRF_GRA }, // 4 - { "242-c3.c3", 0x800000, 0x22127b4f, 3 | BRF_GRA }, // 5 - { "242-c4.c4", 0x800000, 0x0b4fa044, 3 | BRF_GRA }, // 6 - { "242-c5.c5", 0x800000, 0x9d10bed3, 3 | BRF_GRA }, // 7 - { "242-c6.c6", 0x800000, 0xda07b6a2, 3 | BRF_GRA }, // 8 - { "242-c7.c7", 0x800000, 0xf6d7a38a, 3 | BRF_GRA }, // 9 - { "242-c8.c8", 0x800000, 0xc823e045, 3 | BRF_GRA }, // 10 - - { "242-m1.m1", 0x040000, 0x4ef7016b, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "242-v1.v1", 0x400000, 0xb9ea8051, 5 | BRF_SND }, // 12 Sound data - { "242-v2.v2", 0x400000, 0xcc11106e, 5 | BRF_SND }, // 13 - { "242-v3.v3", 0x400000, 0x044ea4e1, 5 | BRF_SND }, // 14 - { "242-v4.v4", 0x400000, 0x7985ea30, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kof98, kof98, neogeo) -STD_ROM_FN(kof98) - -static void kof98Decrypt() -{ - INT32 sec[] = {0x000000, 0x100000, 0x000004, 0x100004, 0x10000a, 0x00000a, 0x10000e, 0x00000e}; - INT32 pos[] = {0x000, 0x004, 0x00a, 0x00e}; - - UINT8* pTemp = (UINT8*)BurnMalloc(0x200000); - - if (pTemp == NULL) { - return; - } - - memmove(pTemp, Neo68KROMActive, 0x200000); - - for (INT32 i = 0x0800; i < 0x100000; i += 0x0200) { - for (INT32 j = 0; j < 0x0100; j += 0x10) { - for (INT32 k = 0; k < 8; k++) { - memmove(&Neo68KROMActive[i + j + k * 2 + 0], &pTemp[i + j + sec[k] + 0x0100], 2); - memmove(&Neo68KROMActive[i + j + k * 2 + 0x0100], &pTemp[i + j + sec[k] + 0], 2); - } - if (i >= 0x080000 && i < 0x0c0000) { - for (INT32 k = 0; k < 4; k++) { - memmove(&Neo68KROMActive[i + j + pos[k] + 0], &pTemp[i + j + pos[k] + 0], 2); - memmove(&Neo68KROMActive[i + j + pos[k] + 0x0100], &pTemp[i + j + pos[k] + 0x0100], 2); - } - } - if (i >= 0x0c0000) { - for (INT32 k = 0; k < 4; k++) { - memmove(&Neo68KROMActive[i + j + pos[k] + 0], &pTemp[i + j + pos[k] + 0x0100], 2); - memmove(&Neo68KROMActive[i + j + pos[k] + 0x0100], &pTemp[i + j + pos[k] + 0], 2); - } - } - } - - memmove(&Neo68KROMActive[i + 0x000000], &pTemp[i + 0x000000], 2); - memmove(&Neo68KROMActive[i + 0x000002], &pTemp[i + 0x100000], 2); - memmove(&Neo68KROMActive[i + 0x000100], &pTemp[i + 0x000100], 2); - memmove(&Neo68KROMActive[i + 0x000102], &pTemp[i + 0x100100], 2); - } - - memmove(&Neo68KROMActive[0x100000], &Neo68KROMActive[0x200000], 0x400000); - - BurnFree(pTemp); -} - -static UINT16 nkof98Protection; - -static void kof98Protection() -{ - // We need two writes because the BIOS vector block is actually 1024 bytes large - switch (nkof98Protection) { - case 0x0090: - *((UINT32*)Neo68KROMActive + 0x0100) = 0x00C200FD; - SekWriteLongROM(0x000100, 0x00C200FD); - break; - case 0x00F0: - *((UINT32*)Neo68KROMActive + 0x0100) = 0x4E454F2D; - SekWriteLongROM(0x000100, 0x4E454F2D); - break; - } -} - -void __fastcall kof98WriteByteProtection(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x20AAAA: { - nkof98Protection &= 0x00FF; - nkof98Protection |= byteValue << 8; - kof98Protection(); - } - case 0x20AAAB: { - nkof98Protection &= 0xFF00; - nkof98Protection |= byteValue; - kof98Protection(); - } - } -} - -void __fastcall kof98WriteWordProtection(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x20AAAA: { - nkof98Protection = wordValue; - kof98Protection(); - } - } -} - -static void kof98InstallHandler() -{ - SekMapHandler(6, 0x200000, 0x2FFBFF, MAP_WRITE); - SekSetWriteWordHandler(6, kof98WriteWordProtection); - SekSetWriteByteHandler(6, kof98WriteByteProtection); - - nkof98Protection = 0; -} - -static INT32 kof98Init() -{ - NeoCallbackActive->pInitialise = kof98Decrypt; - NeoCallbackActive->pInstallHandlers = kof98InstallHandler; -// NeoCallbackActive->pScan = kof98Scan; - - return NeoInit(); - -} - -struct BurnDriver BurnDrvKof98 = { - "kof98", NULL, "neogeo", NULL, "1998", - "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (NGM-2420)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof98RomInfo, kof98RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof98Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (NGM-2420, alternate board) -/* encrypted code + protection */ /* MVS VERSION */ - -static struct BurnRomInfo kof98aRomDesc[] = { - /* This set uses NEO-MVS PROGSF1E board; same rom data as in kof98 is used */ - { "242-p1.p1", 0x200000, 0x8893df89, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "242-ep1.ep1", 0x200000, 0x3f74a000, 1 | BRF_ESS | BRF_PRG }, // 1 - { "242-ep2.ep2", 0x200000, 0x6e474841, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "242-s1.s1", 0x020000, 0x7f7b4805, 2 | BRF_GRA }, // 3 Text layer tiles - - { "242-c1.c1", 0x800000, 0xe564ecd6, 3 | BRF_GRA }, // 4 Sprite data - { "242-c2.c2", 0x800000, 0xbd959b60, 3 | BRF_GRA }, // 5 - { "242-c3.c3", 0x800000, 0x22127b4f, 3 | BRF_GRA }, // 6 - { "242-c4.c4", 0x800000, 0x0b4fa044, 3 | BRF_GRA }, // 7 - { "242-c5.c5", 0x800000, 0x9d10bed3, 3 | BRF_GRA }, // 8 - { "242-c6.c6", 0x800000, 0xda07b6a2, 3 | BRF_GRA }, // 9 - { "242-c7.c7", 0x800000, 0xf6d7a38a, 3 | BRF_GRA }, // 10 - { "242-c8.c8", 0x800000, 0xc823e045, 3 | BRF_GRA }, // 11 - - { "242-m1.m1", 0x040000, 0x4ef7016b, 4 | BRF_ESS | BRF_PRG }, // 12 Z80 code - - { "242-v1.v1", 0x400000, 0xb9ea8051, 5 | BRF_SND }, // 13 Sound data - { "242-v2.v2", 0x400000, 0xcc11106e, 5 | BRF_SND }, // 14 - { "242-v3.v3", 0x400000, 0x044ea4e1, 5 | BRF_SND }, // 15 - { "242-v4.v4", 0x400000, 0x7985ea30, 5 | BRF_SND }, // 16 -}; - -STDROMPICKEXT(kof98a, kof98a, neogeo) -STD_ROM_FN(kof98a) - - -struct BurnDriver BurnDrvKof98a = { - "kof98a", "kof98", "neogeo", NULL, "1998", - "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (NGM-2420, alternate board)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof98aRomInfo, kof98aRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof98Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board, set 1) -/* encrypted code + protection, only z80 rom is different to kof98 */ /* KOREAN VERSION */ - -static struct BurnRomInfo kof98kRomDesc[] = { - { "242-p1.p1", 0x200000, 0x8893df89, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "242-p2.sp2", 0x400000, 0x980aba4c, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "242-s1.s1", 0x020000, 0x7f7b4805, 2 | BRF_GRA }, // 2 Text layer tiles - - { "242-c1.c1", 0x800000, 0xe564ecd6, 3 | BRF_GRA }, // 3 Sprite data - { "242-c2.c2", 0x800000, 0xbd959b60, 3 | BRF_GRA }, // 4 - { "242-c3.c3", 0x800000, 0x22127b4f, 3 | BRF_GRA }, // 5 - { "242-c4.c4", 0x800000, 0x0b4fa044, 3 | BRF_GRA }, // 6 - { "242-c5.c5", 0x800000, 0x9d10bed3, 3 | BRF_GRA }, // 7 - { "242-c6.c6", 0x800000, 0xda07b6a2, 3 | BRF_GRA }, // 8 - { "242-c7.c7", 0x800000, 0xf6d7a38a, 3 | BRF_GRA }, // 9 - { "242-c8.c8", 0x800000, 0xc823e045, 3 | BRF_GRA }, // 10 - - /* Correct chip label */ - { "242-m1k.m1", 0x040000, 0xce12da0c, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "242-v1.v1", 0x400000, 0xb9ea8051, 5 | BRF_SND }, // 12 Sound data - { "242-v2.v2", 0x400000, 0xcc11106e, 5 | BRF_SND }, // 13 - { "242-v3.v3", 0x400000, 0x044ea4e1, 5 | BRF_SND }, // 14 - { "242-v4.v4", 0x400000, 0x7985ea30, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kof98k, kof98k, neogeo) -STD_ROM_FN(kof98k) - -struct BurnDriver BurnDrvKof98k = { - "kof98k", "kof98", "neogeo", NULL, "1998", - "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board, set 1)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof98kRomInfo, kof98kRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof98Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board, set 2) -/* encrypted code + protection, only z80 rom is different to kof98 */ /* KOREAN VERSION */ - -static struct BurnRomInfo kof98kaRomDesc[] = { - { "242-p1.p1", 0x200000, 0x8893df89, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "242-p2.sp2", 0x400000, 0x980aba4c, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "242-s1.s1", 0x020000, 0x7f7b4805, 2 | BRF_GRA }, // 2 Text layer tiles - - { "242-c1.c1", 0x800000, 0xe564ecd6, 3 | BRF_GRA }, // 3 Sprite data - { "242-c2.c2", 0x800000, 0xbd959b60, 3 | BRF_GRA }, // 4 - { "242-c3.c3", 0x800000, 0x22127b4f, 3 | BRF_GRA }, // 5 - { "242-c4.c4", 0x800000, 0x0b4fa044, 3 | BRF_GRA }, // 6 - { "242-c5.c5", 0x800000, 0x9d10bed3, 3 | BRF_GRA }, // 7 - { "242-c6.c6", 0x800000, 0xda07b6a2, 3 | BRF_GRA }, // 8 - { "242-c7.c7", 0x800000, 0xf6d7a38a, 3 | BRF_GRA }, // 9 - { "242-c8.c8", 0x800000, 0xc823e045, 3 | BRF_GRA }, // 10 - - /* Correct chip label */ - { "242-mg1k.m1", 0x040000, 0xce9fb07c, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "242-v1.v1", 0x400000, 0xb9ea8051, 5 | BRF_SND }, // 12 Sound data - { "242-v2.v2", 0x400000, 0xcc11106e, 5 | BRF_SND }, // 13 - { "242-v3.v3", 0x400000, 0x044ea4e1, 5 | BRF_SND }, // 14 - { "242-v4.v4", 0x400000, 0x7985ea30, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kof98ka, kof98ka, neogeo) -STD_ROM_FN(kof98ka) - -struct BurnDriver BurnDrvKof98ka = { - "kof98ka", "kof98", "neogeo", NULL, "1998", - "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board, set 2)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof98kaRomInfo, kof98kaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof98Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (NGH-2420) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo kof98hRomDesc[] = { - { "242-pn1.p1", 0x100000, 0x61ac868a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "242-p2.sp2", 0x400000, 0x980aba4c, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "242-s1.s1", 0x020000, 0x7f7b4805, 2 | BRF_GRA }, // 2 Text layer tiles - - { "242-c1.c1", 0x800000, 0xe564ecd6, 3 | BRF_GRA }, // 3 Sprite data - { "242-c2.c2", 0x800000, 0xbd959b60, 3 | BRF_GRA }, // 4 - { "242-c3.c3", 0x800000, 0x22127b4f, 3 | BRF_GRA }, // 5 - { "242-c4.c4", 0x800000, 0x0b4fa044, 3 | BRF_GRA }, // 6 - { "242-c5.c5", 0x800000, 0x9d10bed3, 3 | BRF_GRA }, // 7 - { "242-c6.c6", 0x800000, 0xda07b6a2, 3 | BRF_GRA }, // 8 - { "242-c7.c7", 0x800000, 0xf6d7a38a, 3 | BRF_GRA }, // 9 - { "242-c8.c8", 0x800000, 0xc823e045, 3 | BRF_GRA }, // 10 - - { "242-mg1.m1", 0x040000, 0x4e7a6b1b, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "242-v1.v1", 0x400000, 0xb9ea8051, 5 | BRF_SND }, // 12 Sound data - { "242-v2.v2", 0x400000, 0xcc11106e, 5 | BRF_SND }, // 13 - { "242-v3.v3", 0x400000, 0x044ea4e1, 5 | BRF_SND }, // 14 - { "242-v4.v4", 0x400000, 0x7985ea30, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kof98h, kof98h, neogeo) -STD_ROM_FN(kof98h) - -struct BurnDriver BurnDrvKof98h = { - "kof98h", "kof98", "neogeo", NULL, "1998", - "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (NGH-2420)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof98hRomInfo, kof98hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi (NGM-2430)(NGH-2430) -/* MVS AND AES VERSION */ /* later revision */ - -static struct BurnRomInfo lastbld2RomDesc[] = { - { "243-pg1.p1", 0x100000, 0xaf1e6554, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "243-pg2.sp2", 0x400000, 0xadd4a30b, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "243-s1.s1", 0x020000, 0xc9cd2298, 2 | BRF_GRA }, // 2 Text layer tiles - - { "243-c1.c1", 0x800000, 0x5839444d, 3 | BRF_GRA }, // 3 Sprite data - { "243-c2.c2", 0x800000, 0xdd087428, 3 | BRF_GRA }, // 4 - { "243-c3.c3", 0x800000, 0x6054cbe0, 3 | BRF_GRA }, // 5 - { "243-c4.c4", 0x800000, 0x8bd2a9d2, 3 | BRF_GRA }, // 6 - { "243-c5.c5", 0x800000, 0x6a503dcf, 3 | BRF_GRA }, // 7 - { "243-c6.c6", 0x800000, 0xec9c36d0, 3 | BRF_GRA }, // 8 - - { "243-m1.m1", 0x020000, 0xacf12d10, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "243-v1.v1", 0x400000, 0xf7ee6fbb, 5 | BRF_SND }, // 10 Sound data - { "243-v2.v2", 0x400000, 0xaa9e4df6, 5 | BRF_SND }, // 11 - { "243-v3.v3", 0x400000, 0x4ac750b2, 5 | BRF_SND }, // 12 - { "243-v4.v4", 0x400000, 0xf5c64ba6, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(lastbld2, lastbld2, neogeo) -STD_ROM_FN(lastbld2) - -struct BurnDriver BurnDrvlastbld2 = { - "lastbld2", NULL, "neogeo", NULL, "1998", - "The Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi (NGM-2430)(NGH-2430)\0", NULL, "SNK", "Neo Geo MVS", - L"The Last Blade 2\0\u5E55\u672B\u6D6A\u6F2B\u7B2C\u4E8C\u5E55 - \u6708\u83EF\u306E\u5263\u58EB - \u6708\u306B\u54B2\u304F\u83EF\u3001\u6563\u308A\u3086\u304F\u82B1 (NGM-2430)(NGH-2430)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, lastbld2RomInfo, lastbld2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Neo-Geo Cup '98 - The Road to the Victory - -static struct BurnRomInfo neocup98RomDesc[] = { - { "244-p1.p1", 0x200000, 0xf8fdb7a5, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "244-s1.s1", 0x020000, 0x9bddb697, 2 | BRF_GRA }, // 1 Text layer tiles - - { "244-c1.c1", 0x800000, 0xc7a62b23, 3 | BRF_GRA }, // 2 Sprite data - { "244-c2.c2", 0x800000, 0x33aa0f35, 3 | BRF_GRA }, // 3 - - { "244-m1.m1", 0x020000, 0xa701b276, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "244-v1.v1", 0x400000, 0x79def46d, 5 | BRF_SND }, // 5 Sound data - { "244-v2.v2", 0x200000, 0xb231902f, 5 | BRF_SND }, // 6 -}; - -STDROMPICKEXT(neocup98, neocup98, neogeo) -STD_ROM_FN(neocup98) - -struct BurnDriver BurnDrvNeocup98 = { - "neocup98", NULL, "neogeo", NULL, "1998", - "Neo-Geo Cup '98 - The Road to the Victory\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_SPORTSFOOTBALL, 0, - NULL, neocup98RomInfo, neocup98RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Metal Slug X - Super Vehicle-001 (NGM-2500)(NGH-2500) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo mslugxRomDesc[] = { - { "250-p1.p1", 0x100000, 0x81f1f60b, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "250-p2.ep1", 0x400000, 0x1fda2e12, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "250-s1.s1", 0x020000, 0xfb6f441d, 2 | BRF_GRA }, // 2 Text layer tiles - - { "250-c1.c1", 0x800000, 0x09a52c6f, 3 | BRF_GRA }, // 3 Sprite data - { "250-c2.c2", 0x800000, 0x31679821, 3 | BRF_GRA }, // 4 - { "250-c3.c3", 0x800000, 0xfd602019, 3 | BRF_GRA }, // 5 - { "250-c4.c4", 0x800000, 0x31354513, 3 | BRF_GRA }, // 6 - { "250-c5.c5", 0x800000, 0xa4b56124, 3 | BRF_GRA }, // 7 - { "250-c6.c6", 0x800000, 0x83e3e69d, 3 | BRF_GRA }, // 8 - - { "250-m1.m1", 0x020000, 0xfd42a842, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "250-v1.v1", 0x400000, 0xc79ede73, 5 | BRF_SND }, // 10 Sound data - { "250-v2.v2", 0x400000, 0xea9aabe1, 5 | BRF_SND }, // 11 - { "250-v3.v3", 0x200000, 0x2ca65102, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(mslugx, mslugx, neogeo) -STD_ROM_FN(mslugx) - -static UINT16 mslugx_command; -static UINT16 mslugx_counter; - -static void mslugx_protection_write(UINT32 SekAddress, UINT16 wordValue) -{ - switch (SekAddress) - { - case 0x2fffe0: // start new read? - mslugx_command = 0; - return; - - case 0x2fffe2: // command? These are pulsed with data and then 0 - case 0x2fffe4: - mslugx_command |= wordValue; - return; - - case 0x2fffe6: // finished? - return; - - case 0x2fffea: // init? - mslugx_counter = 0; - return; - } -} - -static UINT16 __fastcall mslugx_protection_read() -{ - UINT16 ret = 0; - - switch (mslugx_command) - { - case 0x0001: // $3bdc(?) and $3c30 (Register D7) - { - ret = (SekReadByte(0xdedd2 + ((mslugx_counter >> 3) & 0xfff)) >> (~mslugx_counter & 0x07)) & 1; - mslugx_counter++; - } - break; - - case 0x0fff: // All other accesses (Register D2) - { - INT32 select = SekReadWord(0x10f00a) - 1; // Cheat and read calculated offset - ret = (SekReadByte(0xdedd2 + ((select >> 3) & 0x0fff)) >> (~select & 0x07)) & 1; - } - break; - } - - return ret; -} - -static void mslugxMapBank() -{ - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2ffbff, MAP_ROM); -} - -static void mslugxBankswitch(UINT32 nBank) -{ - nBank = ((nBank & 7) + 1) * 0x100000; - - if (nBank != nNeo68KROMBank) { - nNeo68KROMBank = nBank; - mslugxMapBank(); - } -} - -static UINT16 __fastcall mslugx_read_protection_word(UINT32 SekAddress) -{ - if (SekAddress == 0x2fffe8) { - return mslugx_protection_read(); - } - - return *((UINT16*)(Neo68KROMActive + nNeo68KROMBank + (SekAddress & 0xffffe))); -} - -static UINT8 __fastcall mslugx_read_protection_byte(UINT32 SekAddress) -{ - return Neo68KROMActive[(nNeo68KROMBank + (SekAddress & 0xfffff)) ^ 1]; -} - -static void __fastcall mslugx_write_protection_word(UINT32 SekAddress, UINT16 wordValue) -{ - if ((SekAddress & 0xfffff0) == 0x2fffe0) { - mslugx_protection_write(SekAddress, wordValue); - } - - if (SekAddress == 0x2ffff0) { - mslugxBankswitch(wordValue); - } -} - -static void __fastcall mslugx_write_protection_byte(UINT32 SekAddress, UINT8 byteValue) -{ - if (SekAddress == 0x2ffff0) { - mslugxBankswitch(byteValue); - } -} - -static void mslugxInstallBankSwitchHandler() -{ - SekMapHandler(6, 0x2ffc00, 0x2fffff, MAP_WRITE | MAP_READ | MAP_FETCH); - SekSetReadWordHandler(6, mslugx_read_protection_word); - SekSetReadByteHandler(6, mslugx_read_protection_byte); - SekSetWriteWordHandler(6, mslugx_write_protection_word); - SekSetWriteByteHandler(6, mslugx_write_protection_byte); -} - -static INT32 mslugxInit() -{ - NeoCallbackActive->pInstallHandlers = mslugxInstallBankSwitchHandler; - NeoCallbackActive->pBankswitch = mslugxMapBank; - - return NeoInit(); -} - -static INT32 mslugxScan(INT32 nAction, INT32 *pnMin) -{ - if (pnMin) { - *pnMin = 0x029727; - } - - if (nAction & ACB_DRIVER_DATA) - { - SCAN_VAR(mslugx_command); - SCAN_VAR(mslugx_counter); - } - - return NeoScan(nAction,pnMin); -} - -struct BurnDriver BurnDrvMSlugX = { - "mslugx", NULL, "neogeo", NULL, "1999", - "Metal Slug X - Super Vehicle-001 (NGM-2500)(NGH-2500)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, FBF_MSLUG, - NULL, mslugxRomInfo, mslugxRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslugxInit, NeoExit, NeoFrame, NeoRender, mslugxScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '99 - Millennium Battle (NGM-2510) -/* Original Version - Encrypted Code & GFX */ /* MVS VERSION */ - -static struct BurnRomInfo kof99RomDesc[] = { - { "ka.neo-sma", 0x040000, 0x7766d09e, 9 | BRF_ESS | BRF_PRG }, // 0 68K code - { "251-p1.p1", 0x400000, 0x006e4532, 1 | BRF_ESS | BRF_PRG }, // 1 - { "251-p2.p2", 0x400000, 0x90175f15, 1 | BRF_ESS | BRF_PRG }, // 2 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "251-c1.c1", 0x800000, 0x0f9e93fe, 3 | BRF_GRA }, // 3 Sprite data - { "251-c2.c2", 0x800000, 0xe71e2ea3, 3 | BRF_GRA }, // 4 - { "251-c3.c3", 0x800000, 0x238755d2, 3 | BRF_GRA }, // 5 - { "251-c4.c4", 0x800000, 0x438c8b22, 3 | BRF_GRA }, // 6 - { "251-c5.c5", 0x800000, 0x0b0abd0a, 3 | BRF_GRA }, // 7 - { "251-c6.c6", 0x800000, 0x65bbf281, 3 | BRF_GRA }, // 8 - { "251-c7.c7", 0x800000, 0xff65f62e, 3 | BRF_GRA }, // 9 - { "251-c8.c8", 0x800000, 0x8d921c68, 3 | BRF_GRA }, // 10 - - { "251-m1.m1", 0x020000, 0x5e74539c, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "251-v1.v1", 0x400000, 0xef2eecc8, 5 | BRF_SND }, // 12 Sound data - { "251-v2.v2", 0x400000, 0x73e211ca, 5 | BRF_SND }, // 13 - { "251-v3.v3", 0x400000, 0x821901da, 5 | BRF_SND }, // 14 - { "251-v4.v4", 0x200000, 0xb49e6178, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kof99, kof99, neogeo) -STD_ROM_FN(kof99) - -static void kof99SMADecrypt() -{ - for (INT32 i = 0; i < 0x800000 / 2; i++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i] = BITSWAP16(BURN_ENDIAN_SWAP_INT16(((UINT16*)(Neo68KROMActive + 0x100000))[i]), 13, 7, 3, 0, 9, 4, 5, 6, 1, 12, 8, 14, 10, 11, 2, 15); - } - - for (INT32 i = 0; i < 0x0C0000 / 2; i++) { - ((UINT16*)Neo68KROMActive)[i] = BURN_ENDIAN_SWAP_INT16(((UINT16*)Neo68KROMActive)[0x700000 / 2 + BITSWAP24(i, 23, 22, 21, 20, 19, 18, 11, 6, 14, 17, 16, 5, 8, 10, 12, 0, 4, 3, 2, 7, 9, 15, 13, 1)]); - } - - for (INT32 i = 0; i < 0x600000 / 2; i += 0x0800 / 2) { - UINT16 nBuffer[0x0800 / 2]; - memmove(nBuffer, &((UINT16*)(Neo68KROMActive + 0x100000))[i], 0x0800); - for (INT32 j = 0; j < 0x0800 / 2; j++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i + j] = BURN_ENDIAN_SWAP_INT16(nBuffer[BITSWAP24(j, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 6, 2, 4, 9, 8, 3, 1, 7, 0, 5)]); - } - } -} - -void __fastcall kof99WriteWordBankswitch(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress == 0x2FFFF0) { - static UINT32 bankoffset[64] = { - 0x100000, 0x200000, 0x300000, 0x400000, - 0x4cc000, 0x5cc000, 0x4f2000, 0x5f2000, - 0x507800, 0x607800, 0x50d000, 0x60d000, - 0x517800, 0x617800, 0x520800, 0x620800, - 0x524800, 0x624800, 0x529000, 0x629000, - 0x52e800, 0x62e800, 0x531800, 0x631800, - 0x64d000, 0x651000, 0x667000, 0x692800, - 0x688800, 0x681800, 0x699800, 0x694800, - 0x698000, /* rest not used? */ - }; - - // Unscramble bank number - INT32 nBank = - (((wordValue >> 14) & 1) << 0) + - (((wordValue >> 6) & 1) << 1) + - (((wordValue >> 8) & 1) << 2) + - (((wordValue >> 10) & 1) << 3) + - (((wordValue >> 12) & 1) << 4) + - (((wordValue >> 5) & 1) << 5); - - if (bankoffset[nBank] != nNeo68KROMBank) { - nNeo68KROMBank = bankoffset[nBank]; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2FE3FF, MAP_ROM); - SekMapMemory(Neo68KROMActive + nNeo68KROMBank + 0x0FE800, 0x2FE800, 0x2FFBFF, MAP_ROM); - } - } -} - -static INT32 kof99Init() -{ - nNeoProtectionXor = 0x00; - - return NeoSMAInit(kof99SMADecrypt, kof99WriteWordBankswitch, 0x2FFFF8, 0x2FFFFA); -} - -struct BurnDriver BurnDrvkof99 = { - "kof99", NULL, "neogeo", NULL, "1999", - "The King of Fighters '99 - Millennium Battle (NGM-2510)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42 | HARDWARE_SNK_SMA_PROTECTION, GBF_VSFIGHT, FBF_KOF, - NULL, kof99RomInfo, kof99RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof99Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '99 - Millennium Battle (NGH-2510) -/* Original Version - Encrypted Code & GFX */ /* AES VERSION */ - -static struct BurnRomInfo kof99hRomDesc[] = { - { "kc.neo-sma", 0x040000, 0x6c9d0647, 9 | BRF_ESS | BRF_PRG }, // 0 68K code - { "251-p1.p1", 0x400000, 0x006e4532, 1 | BRF_ESS | BRF_PRG }, // 1 - { "251-pg2.p2", 0x400000, 0xd9057f51, 1 | BRF_ESS | BRF_PRG }, // 2 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "251-c1.c1", 0x800000, 0x0f9e93fe, 3 | BRF_GRA }, // 3 Sprite data - { "251-c2.c2", 0x800000, 0xe71e2ea3, 3 | BRF_GRA }, // 4 - { "251-c3.c3", 0x800000, 0x238755d2, 3 | BRF_GRA }, // 5 - { "251-c4.c4", 0x800000, 0x438c8b22, 3 | BRF_GRA }, // 6 - { "251-c5.c5", 0x800000, 0x0b0abd0a, 3 | BRF_GRA }, // 7 - { "251-c6.c6", 0x800000, 0x65bbf281, 3 | BRF_GRA }, // 8 - { "251-c7.c7", 0x800000, 0xff65f62e, 3 | BRF_GRA }, // 9 - { "251-c8.c8", 0x800000, 0x8d921c68, 3 | BRF_GRA }, // 10 - - { "251-m1.m1", 0x020000, 0x5e74539c, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "251-v1.v1", 0x400000, 0xef2eecc8, 5 | BRF_SND }, // 12 Sound data - { "251-v2.v2", 0x400000, 0x73e211ca, 5 | BRF_SND }, // 13 - { "251-v3.v3", 0x400000, 0x821901da, 5 | BRF_SND }, // 14 - { "251-v4.v4", 0x200000, 0xb49e6178, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kof99h, kof99h, neogeo) -STD_ROM_FN(kof99h) - -struct BurnDriver BurnDrvkof99h = { - "kof99h", "kof99", "neogeo", NULL, "1999", - "The King of Fighters '99 - Millennium Battle (NGH-2510)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42 | HARDWARE_SNK_SMA_PROTECTION, GBF_VSFIGHT, FBF_KOF, - NULL, kof99hRomInfo, kof99hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof99Init, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '99 - Millennium Battle (earlier) -/* Original Version - Encrypted Code & GFX */ - -static struct BurnRomInfo kof99eRomDesc[] = { - { "ka.neo-sma", 0x040000, 0x7766d09e, 9 | BRF_ESS | BRF_PRG }, // 0 68K code - /* Is the SMA for this set correct? A set with this layout and a SMA.KB is known */ - { "251-ep1.p1", 0x200000, 0x1e8d692d, 1 | BRF_ESS | BRF_PRG }, // 1 - { "251-ep2.p2", 0x200000, 0xd6206e5a, 1 | BRF_ESS | BRF_PRG }, // 2 - { "251-ep3.p3", 0x200000, 0xd58c3ef8, 1 | BRF_ESS | BRF_PRG }, // 3 - { "251-ep4.p4", 0x200000, 0x52de02ae, 1 | BRF_ESS | BRF_PRG }, // 4 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "251-c1.c1", 0x800000, 0x0f9e93fe, 3 | BRF_GRA }, // 5 Sprite data - { "251-c2.c2", 0x800000, 0xe71e2ea3, 3 | BRF_GRA }, // 6 - { "251-c3.c3", 0x800000, 0x238755d2, 3 | BRF_GRA }, // 7 - { "251-c4.c4", 0x800000, 0x438c8b22, 3 | BRF_GRA }, // 8 - { "251-c5.c5", 0x800000, 0x0b0abd0a, 3 | BRF_GRA }, // 9 - { "251-c6.c6", 0x800000, 0x65bbf281, 3 | BRF_GRA }, // 10 - { "251-c7.c7", 0x800000, 0xff65f62e, 3 | BRF_GRA }, // 11 - { "251-c8.c8", 0x800000, 0x8d921c68, 3 | BRF_GRA }, // 12 - - { "251-m1.m1", 0x020000, 0x5e74539c, 4 | BRF_ESS | BRF_PRG }, // 13 Z80 code - - { "251-v1.v1", 0x400000, 0xef2eecc8, 5 | BRF_SND }, // 14 Sound data - { "251-v2.v2", 0x400000, 0x73e211ca, 5 | BRF_SND }, // 15 - { "251-v3.v3", 0x400000, 0x821901da, 5 | BRF_SND }, // 16 - { "251-v4.v4", 0x200000, 0xb49e6178, 5 | BRF_SND }, // 17 -}; - -STDROMPICKEXT(kof99e, kof99e, neogeo) -STD_ROM_FN(kof99e) - -struct BurnDriver BurnDrvkof99e = { - "kof99e", "kof99", "neogeo", NULL, "1999", - "The King of Fighters '99 - Millennium Battle (earlier)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42 | HARDWARE_SNK_SMA_PROTECTION, GBF_VSFIGHT, FBF_KOF, - NULL, kof99eRomInfo, kof99eRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof99Init, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '99 - Millennium Battle (Korean release) -/* Original Version - Encrypted code & GFX */ /* KOREAN VERSION */ - -static struct BurnRomInfo kof99kRomDesc[] = { - { "kb.neo-sma", 0x040000, 0x9fccc688, 9 | BRF_ESS | BRF_PRG }, // 0 68K code - { "151-pg1k.p1", 0x400000, 0xef259292, 1 | BRF_ESS | BRF_PRG }, // 1 - { "151-pg2k.p2", 0x400000, 0xf3898ec2, 1 | BRF_ESS | BRF_PRG }, // 2 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "251-c1.c1", 0x800000, 0x0f9e93fe, 3 | BRF_GRA }, // 3 Sprite data - { "251-c2.c2", 0x800000, 0xe71e2ea3, 3 | BRF_GRA }, // 4 - { "251-c3.c3", 0x800000, 0x238755d2, 3 | BRF_GRA }, // 5 - { "251-c4.c4", 0x800000, 0x438c8b22, 3 | BRF_GRA }, // 6 - { "251-c5.c5", 0x800000, 0x0b0abd0a, 3 | BRF_GRA }, // 7 - { "251-c6.c6", 0x800000, 0x65bbf281, 3 | BRF_GRA }, // 8 - { "251-c7.c7", 0x800000, 0xff65f62e, 3 | BRF_GRA }, // 9 - { "251-c8.c8", 0x800000, 0x8d921c68, 3 | BRF_GRA }, // 10 - - { "251-m1.m1", 0x020000, 0x5e74539c, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "251-v1.v1", 0x400000, 0xef2eecc8, 5 | BRF_SND }, // 12 Sound data - { "251-v2.v2", 0x400000, 0x73e211ca, 5 | BRF_SND }, // 13 - { "251-v3.v3", 0x400000, 0x821901da, 5 | BRF_SND }, // 14 - { "251-v4.v4", 0x200000, 0xb49e6178, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kof99k, kof99k, neogeo) -STD_ROM_FN(kof99k) - -struct BurnDriver BurnDrvkof99k = { - "kof99k", "kof99", "neogeo", NULL, "1999", - "The King of Fighters '99 - Millennium Battle (Korean release)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42 | HARDWARE_SNK_SMA_PROTECTION, GBF_VSFIGHT, FBF_KOF, - NULL, kof99kRomInfo, kof99kRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof99Init, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '99 - Millennium Battle (Korean release) -/* Original Version - Encrypted GFX */ /* KOREAN VERSION */ - -static struct BurnRomInfo kof99kaRomDesc[] = { - { "152-p1.p1", 0x100000, 0xf2c7ddfa, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "152-p2.sp2", 0x400000, 0x274ef47a, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "251-c1.c1", 0x800000, 0x0f9e93fe, 3 | BRF_GRA }, // 2 Sprite data - { "251-c2.c2", 0x800000, 0xe71e2ea3, 3 | BRF_GRA }, // 3 - { "251-c3.c3", 0x800000, 0x238755d2, 3 | BRF_GRA }, // 4 - { "251-c4.c4", 0x800000, 0x438c8b22, 3 | BRF_GRA }, // 5 - { "251-c5.c5", 0x800000, 0x0b0abd0a, 3 | BRF_GRA }, // 6 - { "251-c6.c6", 0x800000, 0x65bbf281, 3 | BRF_GRA }, // 7 - { "251-c7.c7", 0x800000, 0xff65f62e, 3 | BRF_GRA }, // 8 - { "251-c8.c8", 0x800000, 0x8d921c68, 3 | BRF_GRA }, // 9 - - { "251-m1.m1", 0x020000, 0x5e74539c, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "251-v1.v1", 0x400000, 0xef2eecc8, 5 | BRF_SND }, // 11 Sound data - { "251-v2.v2", 0x400000, 0x73e211ca, 5 | BRF_SND }, // 12 - { "251-v3.v3", 0x400000, 0x821901da, 5 | BRF_SND }, // 13 - { "251-v4.v4", 0x200000, 0xb49e6178, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(kof99ka, kof99ka, neogeo) -STD_ROM_FN(kof99ka) - -INT32 kof99kaInit() -{ - nNeoProtectionXor = 0x00; - return NeoInit(); -} - -struct BurnDriver BurnDrvkof99ka = { - "kof99ka", "kof99", "neogeo", NULL, "1999", - "The King of Fighters '99 - Millennium Battle (Korean release, non-encrypted program)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42, GBF_VSFIGHT, FBF_KOF, - NULL, kof99kaRomInfo, kof99kaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof99kaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '99 - Millennium Battle (prototype) -/* Prototype Version - Possibly Hacked */ - -static struct BurnRomInfo kof99pRomDesc[] = { - { "proto_251-p1.p1", 0x100000, 0xf37929c4, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "proto_251-p2.p2", 0x400000, 0x739742ad, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* This is the S1 from the prototype, the final is different */ - { "proto_251-s1.s1", 0x020000, 0xfb1498ed, 2 | BRF_GRA }, // 2 Text layer tiles - - /* these are probably decrypted versions of the roms found in the final */ - { "proto_251-c1.c1", 0x800000, 0xe5d8ffa4, 3 | BRF_GRA }, // 3 Sprite data - { "proto_251-c2.c2", 0x800000, 0xd822778f, 3 | BRF_GRA }, // 4 - { "proto_251-c3.c3", 0x800000, 0xf20959e8, 3 | BRF_GRA }, // 5 - { "proto_251-c4.c4", 0x800000, 0x54ffbe9f, 3 | BRF_GRA }, // 6 - { "proto_251-c5.c5", 0x800000, 0xd87a3bbc, 3 | BRF_GRA }, // 7 - { "proto_251-c6.c6", 0x800000, 0x4d40a691, 3 | BRF_GRA }, // 8 - { "proto_251-c7.c7", 0x800000, 0xa4479a58, 3 | BRF_GRA }, // 9 - { "proto_251-c8.c8", 0x800000, 0xead513ce, 3 | BRF_GRA }, // 10 - - /* Did the Prototype really use the same sound program / voice roms, sound isn't great .. */ - { "251-m1.m1", 0x020000, 0x5e74539c, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "251-v1.v1", 0x400000, 0xef2eecc8, 5 | BRF_SND }, // 12 Sound data - { "251-v2.v2", 0x400000, 0x73e211ca, 5 | BRF_SND }, // 13 - { "251-v3.v3", 0x400000, 0x821901da, 5 | BRF_SND }, // 14 - { "251-v4.v4", 0x200000, 0xb49e6178, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kof99p, kof99p, neogeo) -STD_ROM_FN(kof99p) - -struct BurnDriver BurnDrvkof99p = { - "kof99p", "kof99", "neogeo", NULL, "1999", - "The King of Fighters '99 - Millennium Battle (prototype)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof99pRomInfo, kof99pRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Garou - Mark of the Wolves (NGM-2530) -/* Original Version - Encrypted GFX */ /* MVS VERSION - later revision */ - -static struct BurnRomInfo garouRomDesc[] = { - { "kf.neo-sma", 0x040000, 0x98bc93dc, 9 | BRF_ESS | BRF_PRG }, // 0 68K code - { "253-ep1.p1", 0x200000, 0xea3171a4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "253-ep2.p2", 0x200000, 0x382f704b, 1 | BRF_ESS | BRF_PRG }, // 2 - { "253-ep3.p3", 0x200000, 0xe395bfdd, 1 | BRF_ESS | BRF_PRG }, // 3 - { "253-ep4.p4", 0x200000, 0xda92c08e, 1 | BRF_ESS | BRF_PRG }, // 4 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "253-c1.c1", 0x800000, 0x0603e046, 3 | BRF_GRA }, // 5 Sprite data - { "253-c2.c2", 0x800000, 0x0917d2a4, 3 | BRF_GRA }, // 6 - { "253-c3.c3", 0x800000, 0x6737c92d, 3 | BRF_GRA }, // 7 - { "253-c4.c4", 0x800000, 0x5ba92ec6, 3 | BRF_GRA }, // 8 - { "253-c5.c5", 0x800000, 0x3eab5557, 3 | BRF_GRA }, // 9 - { "253-c6.c6", 0x800000, 0x308d098b, 3 | BRF_GRA }, // 10 - { "253-c7.c7", 0x800000, 0xc0e995ae, 3 | BRF_GRA }, // 11 - { "253-c8.c8", 0x800000, 0x21a11303, 3 | BRF_GRA }, // 12 - - { "253-m1.m1", 0x040000, 0x36a806be, 4 | BRF_ESS | BRF_PRG }, // 13 Z80 code - - { "253-v1.v1", 0x400000, 0x263e388c, 5 | BRF_SND }, // 14 Sound data - { "253-v2.v2", 0x400000, 0x2c6bc7be, 5 | BRF_SND }, // 15 - { "253-v3.v3", 0x400000, 0x0425b27d, 5 | BRF_SND }, // 16 - { "253-v4.v4", 0x400000, 0xa54be8a9, 5 | BRF_SND }, // 17 -}; - -STDROMPICKEXT(garou, garou, neogeo) -STD_ROM_FN(garou) - -static void garouSMADecrypt() -{ - for (INT32 i = 0; i < 0x800000 / 2; i++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i] = BITSWAP16(BURN_ENDIAN_SWAP_INT16(((UINT16*)(Neo68KROMActive + 0x100000))[i]), 13, 12, 14, 10, 8, 2, 3, 1, 5, 9, 11, 4, 15, 0, 6, 7); - } - - for (INT32 i = 0; i < 0x0C0000 / 2; i++) { - ((UINT16*)Neo68KROMActive)[i] = BURN_ENDIAN_SWAP_INT16(((UINT16*)Neo68KROMActive)[0x710000 / 2 + BITSWAP24(i, 23, 22, 21, 20, 19, 18, 4, 5, 16, 14, 7, 9, 6, 13, 17, 15, 3, 1, 2, 12, 11, 8, 10, 0)]); - } - - for (INT32 i = 0; i < 0x800000 / 2; i += 0x8000 / 2) { - UINT16 nBuffer[0x8000 / 2]; - memmove(nBuffer, &((UINT16*)(Neo68KROMActive + 0x100000))[i], 0x8000); - for (INT32 j = 0; j < 0x8000 / 2; j++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i + j] = BURN_ENDIAN_SWAP_INT16(nBuffer[BITSWAP24(j, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 9, 4, 8, 3, 13, 6, 2, 7, 0, 12, 1, 11, 10, 5)]); - } - } -} - -void __fastcall garouWriteWordBankswitch(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress == 0x2FFFC0) { - static UINT32 bankoffset[64] = { - 0x100000, 0x200000, 0x300000, 0x400000, // 00 - 0x380000, 0x480000, 0x3d0000, 0x4d0000, // 04 - 0x3f0000, 0x4f0000, 0x500000, 0x600000, // 08 - 0x520000, 0x620000, 0x540000, 0x640000, // 12 - 0x598000, 0x698000, 0x5a0000, 0x6a0000, // 16 - 0x5a8000, 0x6a8000, 0x5b0000, 0x6b0000, // 20 - 0x5b8000, 0x6b8000, 0x5c0000, 0x6c0000, // 24 - 0x5c8000, 0x6c8000, 0x5d0000, 0x6d0000, // 28 - 0x558000, 0x658000, 0x560000, 0x660000, // 32 - 0x568000, 0x668000, 0x570000, 0x670000, // 36 - 0x578000, 0x678000, 0x580000, 0x680000, // 40 - 0x588000, 0x688000, 0x590000, 0x690000, // 44 - 0x6d0000, 0x6d8000, 0x6e0000, 0x6e8000, // 48 - 0x6f0000, 0x6f8000, 0x700000, /* rest not used? */ - }; - - // Unscramble bank number - INT32 nBank = - (((wordValue >> 5) & 1) << 0) + - (((wordValue >> 9) & 1) << 1) + - (((wordValue >> 7) & 1) << 2) + - (((wordValue >> 6) & 1) << 3) + - (((wordValue >> 14) & 1) << 4) + - (((wordValue >> 12) & 1) << 5); - - if (bankoffset[nBank] != nNeo68KROMBank) { - nNeo68KROMBank = bankoffset[nBank]; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2FE3FF, MAP_ROM); - SekMapMemory(Neo68KROMActive + nNeo68KROMBank + 0x0FE800, 0x2FE800, 0x2FFBFF, MAP_ROM); - } - } -} - -static INT32 garouInit() -{ - nNeoProtectionXor = 0x06; - - return NeoSMAInit(garouSMADecrypt, garouWriteWordBankswitch, 0x2FFFCC, 0x2FFFF0); -} - -struct BurnDriver BurnDrvGarou = { - "garou", NULL, "neogeo", NULL, "1999", - "Garou - Mark of the Wolves (NGM-2530)\0", NULL, "SNK", "Neo Geo MVS", - L"Garou\0\u9913\u72FC - mark of the wolves (NGM-2530)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42 | HARDWARE_SNK_SMA_PROTECTION, GBF_VSFIGHT, 0, - NULL, garouRomInfo, garouRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - garouInit, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Garou - Mark of the Wolves (NGM-2530) (NGH-2530) -/* Original Version - Encrypted GFX */ /* MVS AND AES VERSION - earlier revision */ - -static struct BurnRomInfo garouhRomDesc[] = { - { "ke.neo-sma", 0x040000, 0x96c72233, 9 | BRF_ESS | BRF_PRG }, // 0 68K code - { "253-p1.p1", 0x400000, 0x18ae5d7e, 1 | BRF_ESS | BRF_PRG }, // 1 - { "253-p2.p2", 0x400000, 0xafffa779, 1 | BRF_ESS | BRF_PRG }, // 2 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "253-c1.c1", 0x800000, 0x0603e046, 3 | BRF_GRA }, // 3 Sprite data - { "253-c2.c2", 0x800000, 0x0917d2a4, 3 | BRF_GRA }, // 4 - { "253-c3.c3", 0x800000, 0x6737c92d, 3 | BRF_GRA }, // 5 - { "253-c4.c4", 0x800000, 0x5ba92ec6, 3 | BRF_GRA }, // 6 - { "253-c5.c5", 0x800000, 0x3eab5557, 3 | BRF_GRA }, // 7 - { "253-c6.c6", 0x800000, 0x308d098b, 3 | BRF_GRA }, // 8 - { "253-c7.c7", 0x800000, 0xc0e995ae, 3 | BRF_GRA }, // 9 - { "253-c8.c8", 0x800000, 0x21a11303, 3 | BRF_GRA }, // 10 - - { "253-m1.m1", 0x040000, 0x36a806be, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "253-v1.v1", 0x400000, 0x263e388c, 5 | BRF_SND }, // 12 Sound data - { "253-v2.v2", 0x400000, 0x2c6bc7be, 5 | BRF_SND }, // 13 - { "253-v3.v3", 0x400000, 0x0425b27d, 5 | BRF_SND }, // 14 - { "253-v4.v4", 0x400000, 0xa54be8a9, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(garouh, garouh, neogeo) -STD_ROM_FN(garouh) - -static void garouhSMADecrypt() -{ - for (INT32 i = 0; i < 0x800000 / 2; i++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i] = BITSWAP16(BURN_ENDIAN_SWAP_INT16(((UINT16*)(Neo68KROMActive + 0x100000))[i]), 14, 5, 1, 11, 7, 4, 10, 15, 3, 12, 8, 13, 0, 2, 9, 6); - } - - for (INT32 i = 0; i < 0x0C0000 / 2; i++) { - ((UINT16*)Neo68KROMActive)[i] = BURN_ENDIAN_SWAP_INT16(((UINT16*)Neo68KROMActive)[0x7F8000 / 2 + BITSWAP24(i, 23, 22, 21, 20, 19, 18, 5, 16, 11, 2, 6, 7, 17, 3, 12, 8, 14, 4, 0, 9, 1, 10, 15, 13)]); - } - - for (INT32 i = 0; i < 0x800000 / 2; i += 0x8000 / 2) { - UINT16 nBuffer[0x8000 / 2]; - memmove(nBuffer, &((UINT16*)(Neo68KROMActive + 0x100000))[i], 0x8000); - for (INT32 j = 0; j < 0x8000 / 2; j++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i + j] = BURN_ENDIAN_SWAP_INT16(nBuffer[BITSWAP24(j, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 12, 8, 1, 7, 11, 3, 13, 10, 6, 9, 5, 4, 0, 2)]); - } - } -} - -void __fastcall garouhWriteWordBankswitch(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress == 0x2FFFC0) { - static UINT32 bankoffset[64] = { - 0x100000, 0x200000, 0x300000, 0x400000, // 00 - 0x380000, 0x480000, 0x3d0000, 0x4d0000, // 04 - 0x3c8000, 0x4c8000, 0x500000, 0x600000, // 08 - 0x520000, 0x620000, 0x540000, 0x640000, // 12 - 0x698000, 0x798000, 0x6a0000, 0x7a0000, // 16 - 0x6a8000, 0x7a8000, 0x6b0000, 0x7b0000, // 20 - 0x6b8000, 0x7b8000, 0x6c0000, 0x7c0000, // 24 - 0x6c8000, 0x7c8000, 0x6d0000, 0x7d0000, // 28 - 0x558000, 0x658000, 0x560000, 0x660000, // 32 - 0x568000, 0x668000, 0x570000, 0x670000, // 36 - 0x578000, 0x678000, 0x580000, 0x680000, // 40 - 0x588000, 0x688000, 0x590000, 0x690000, // 44 - 0x6d8000, 0x7d8000, 0x6e0000, 0x7e0000, // 48 - 0x6e8000, 0x7e8000, 0x7e8000, 0x100000, // 52 - 0x100000, 0x100000, 0x100000, 0x100000, // 56 - 0x100000, 0x100000, 0x100000, 0x100000, // 60 - }; - - // Unscramble bank number - INT32 nBank = - (((wordValue >> 4) & 1) << 0) + - (((wordValue >> 8) & 1) << 1) + - (((wordValue >> 14) & 1) << 2) + - (((wordValue >> 2) & 1) << 3) + - (((wordValue >> 11) & 1) << 4) + - (((wordValue >> 13) & 1) << 5); - - if (bankoffset[nBank] != nNeo68KROMBank) { - nNeo68KROMBank = bankoffset[nBank]; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2FE3FF, MAP_ROM); - SekMapMemory(Neo68KROMActive + nNeo68KROMBank + 0x0FE800, 0x2FE800, 0x2FFBFF, MAP_ROM); - } - } -} - -static INT32 garouhInit() -{ - nNeoProtectionXor = 0x06; - - return NeoSMAInit(garouhSMADecrypt, garouhWriteWordBankswitch, 0x2FFFCC, 0x2FFFF0); -} - -struct BurnDriver BurnDrvgarouh = { - "garouh", "garou", "neogeo", NULL, "1999", - "Garou - Mark of the Wolves (NGM-2530) (NGH-2530)\0", NULL, "SNK", "Neo Geo MVS", - L"Garou\0\u9913\u72FC - mark of the wolves (NGM-2530) (NGH-2530)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42 | HARDWARE_SNK_SMA_PROTECTION, GBF_VSFIGHT, 0, - NULL, garouhRomInfo, garouhRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - garouhInit, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Garou - Mark of the Wolves (prototype) -/* Prototype Version, seems genuine */ - -static struct BurnRomInfo garoupRomDesc[] = { - { "proto_253-p1.p1", 0x100000, 0xc72f0c16, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "proto_253-p2.p2", 0x400000, 0xbf8de565, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "proto_253-s1.s1", 0x020000, 0x779989de, 2 | BRF_GRA }, // 2 Text layer tiles - - { "proto_253-c1.c1", 0x800000, 0x5bb5d137, 3 | BRF_GRA }, // 3 Sprite data - { "proto_253-c2.c2", 0x800000, 0x5c8d2960, 3 | BRF_GRA }, // 4 - { "proto_253-c3.c3", 0x800000, 0x234d16fc, 3 | BRF_GRA }, // 5 - { "proto_253-c4.c4", 0x800000, 0xb9b5b993, 3 | BRF_GRA }, // 6 - { "proto_253-c5.c5", 0x800000, 0x722615d2, 3 | BRF_GRA }, // 7 - { "proto_253-c6.c6", 0x800000, 0x0a6fab38, 3 | BRF_GRA }, // 8 - { "proto_253-c7.c7", 0x800000, 0xd68e806f, 3 | BRF_GRA }, // 9 - { "proto_253-c8.c8", 0x800000, 0xf778fe99, 3 | BRF_GRA }, // 10 - - { "proto_253-m1.m1", 0x040000, 0xbbe464f7, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "proto_253-v1.v1", 0x400000, 0x274f3923, 5 | BRF_SND }, // 12 Sound data - { "proto_253-v2.v2", 0x400000, 0x8f86dabe, 5 | BRF_SND }, // 13 - { "proto_253-v3.v3", 0x400000, 0x05fd06cd, 5 | BRF_SND }, // 14 - { "proto_253-v4.v4", 0x400000, 0x14984063, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(garoup, garoup, neogeo) -STD_ROM_FN(garoup) - -struct BurnDriver BurnDrvGaroup = { - "garoup", "garou", "neogeo", NULL, "1999", - "Garou - Mark of the Wolves (prototype)\0", NULL, "SNK", "Neo Geo MVS", - L"Garou\0\u9913\u72FC - mark of the wolves (prototype)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, garoupRomInfo, garoupRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Garou - Mark of the Wolves (bootleg) - -static struct BurnRomInfo garoublRomDesc[] = { - { "garou-p1.bin", 0x0100000, 0xfd446d59, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "garou-p2.bin", 0x0400000, 0x3fb10a84, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "garou-s1.bin", 0x0020000, 0xdf720e33, 2 | BRF_GRA }, // 2 Text layer tiles - - { "garou-c1.bin", 0x1000000, 0xe2ac83fa, 3 | BRF_GRA }, // 3 Sprite data - { "garou-c2.bin", 0x1000000, 0x7c344b24, 3 | BRF_GRA }, // 4 - { "garou-c3.bin", 0x1000000, 0xd3aec5a6, 3 | BRF_GRA }, // 5 - { "garou-c4.bin", 0x1000000, 0xe02a242d, 3 | BRF_GRA }, // 6 - - { "garou-m1.bin", 0x0080000, 0x7c51d002, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code - - { "garou-v1.bin", 0x0400000, 0x98d736e4, 5 | BRF_SND }, // 8 Sound data - { "garou-v2.bin", 0x0400000, 0xeb43c03f, 5 | BRF_SND }, // 9 - { "garou-v3.bin", 0x0400000, 0x10a0f814, 5 | BRF_SND }, // 10 - { "garou-v4.bin", 0x0400000, 0x8918fdd3, 5 | BRF_SND }, // 11 -}; - -STDROMPICKEXT(garoubl, garoubl, neogeo) -STD_ROM_FN(garoubl) - -static void garoubl_sx_decode() -{ - INT32 i; - for (i = 0; i < 0x020000; i++) - NeoTextROM[nNeoActiveSlot][i] = BITSWAP08(NeoTextROM[nNeoActiveSlot][i], 7, 6, 0, 4, 3, 2, 1, 5); -} - -static void garoublCallback() -{ - garoubl_sx_decode(); - lans2004_cx_decode(0x800000 * 8); -} - -static INT32 garoublInit() -{ - NeoCallbackActive->pInitialise = garoublCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvgaroubl = { - "garoubl", "garou", "neogeo", NULL, "1999", - "Garou - Mark of the Wolves (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - L"Garou\0\u9913\u72FC - mark of the wolves (bootleg)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, garoublRomInfo, garoublRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - garoublInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Metal Slug 3 (NGM-2560) -/* Original Version - Encrypted Code & GFX */ /* revision 2000.4.1 */ /* MVS VERSION */ - -static struct BurnRomInfo mslug3RomDesc[] = { - { "neo-sma", 0x040000, 0x9cd55736, 9 | BRF_ESS | BRF_PRG }, // 0 68K code / stored in the custom chip - /* The SMA for this release has a green colour marking; the older revision has a white colour marking */ - { "256-pg1.p1", 0x400000, 0xb07edfd5, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5332202 - { "256-pg2.p2", 0x400000, 0x6097c26b, 1 | BRF_ESS | BRF_PRG }, // 2 / TC5332202 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "256-c1.c1", 0x800000, 0x5a79c34e, 3 | BRF_GRA }, // 3 Sprite data / TC5364202 - { "256-c2.c2", 0x800000, 0x944c362c, 3 | BRF_GRA }, // 4 / TC5364202 - { "256-c3.c3", 0x800000, 0x6e69d36f, 3 | BRF_GRA }, // 5 / TC5364202 - { "256-c4.c4", 0x800000, 0xb755b4eb, 3 | BRF_GRA }, // 6 / TC5364202 - { "256-c5.c5", 0x800000, 0x7aacab47, 3 | BRF_GRA }, // 7 / TC5364202 - { "256-c6.c6", 0x800000, 0xc698fd5d, 3 | BRF_GRA }, // 8 / TC5364202 - { "256-c7.c7", 0x800000, 0xcfceddd2, 3 | BRF_GRA }, // 9 / TC5364202 - { "256-c8.c8", 0x800000, 0x4d9be34c, 3 | BRF_GRA }, // 10 / TC5364202 - - { "256-m1.m1", 0x080000, 0xeaeec116, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / mask rom TC534000 - - { "256-v1.v1", 0x400000, 0xf2690241, 5 | BRF_SND }, // 12 Sound data / TC5332204 - { "256-v2.v2", 0x400000, 0x7e2a10bd, 5 | BRF_SND }, // 13 / TC5332204 - { "256-v3.v3", 0x400000, 0x0eaec17c, 5 | BRF_SND }, // 14 / TC5332204 - { "256-v4.v4", 0x400000, 0x9b4b22d4, 5 | BRF_SND }, // 15 / TC5332204 -}; - -STDROMPICKEXT(mslug3, mslug3, neogeo) -STD_ROM_FN(mslug3) - -static void mslug3SMADecrypt() -{ - for (INT32 i = 0; i < 0x800000 / 2; i++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i] = BITSWAP16(BURN_ENDIAN_SWAP_INT16(((UINT16*)(Neo68KROMActive + 0x100000))[i]), 4, 11, 14, 3, 1, 13, 0, 7, 2, 8, 12, 15, 10, 9, 5, 6); - } - - for (INT32 i = 0; i < 0x0C0000 / 2; i++) { - ((UINT16*)Neo68KROMActive)[i] = BURN_ENDIAN_SWAP_INT16(((UINT16*)Neo68KROMActive)[0x5D0000 / 2 + BITSWAP24(i, 23, 22, 21, 20, 19, 18, 15, 2, 1, 13, 3, 0, 9, 6, 16, 4, 11, 5, 7, 12, 17, 14, 10, 8)]); - } - - for (INT32 i = 0; i < 0x800000 / 2; i += 0x010000 / 2) { - UINT16 nBuffer[0x010000 / 2]; - memmove(nBuffer, &((UINT16*)(Neo68KROMActive + 0x100000))[i], 0x010000); - for (INT32 j = 0; j < 0x010000 / 2; j++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i + j] = BURN_ENDIAN_SWAP_INT16(nBuffer[BITSWAP24(j, 23, 22, 21, 20, 19, 18, 17, 16, 15, 2, 11, 0, 14, 6, 4, 13, 8, 9, 3, 10, 7, 5, 12, 1)]); - } - } -} - -void __fastcall mslug3WriteWordBankswitch(UINT32 sekAddress, UINT16 wordValue) -{ - -// bprintf(PRINT_NORMAL, " -- bankswitch: 0x%08X -> 0x%04X\n", sekAddress, wordValue); - - if (sekAddress == 0x2FFFE4) { - static UINT32 bankoffset[64] = { - 0x100000, 0x120000, 0x140000, 0x160000, // 00 - 0x170000, 0x190000, 0x1b0000, 0x1d0000, // 04 - 0x1e0000, 0x1f0000, 0x220000, 0x230000, // 08 - 0x240000, 0x250000, 0x280000, 0x290000, // 12 - 0x2a0000, 0x2b0000, 0x2e0000, 0x2f0000, // 16 - 0x300000, 0x310000, 0x340000, 0x350000, // 20 - 0x360000, 0x370000, 0x3a0000, 0x3b0000, // 24 - 0x3c0000, 0x3d0000, 0x400000, 0x410000, // 28 - 0x420000, 0x430000, 0x460000, 0x470000, // 32 - 0x480000, 0x490000, 0x4c0000, 0x4d0000, // 36 - 0x500000, 0x510000, 0x540000, 0x550000, // 40 - 0x560000, 0x570000, 0x5a0000, 0x5b0000, // 44 - 0x5c0000, /* rest not used? */ - }; - - // Unscramble bank number - INT32 nBank = - (((wordValue >> 14) & 1) << 0) + - (((wordValue >> 12) & 1) << 1) + - (((wordValue >> 15) & 1) << 2) + - (((wordValue >> 6) & 1) << 3) + - (((wordValue >> 3) & 1) << 4) + - (((wordValue >> 9) & 1) << 5); - - if (bankoffset[nBank] != nNeo68KROMBank) { - nNeo68KROMBank = bankoffset[nBank]; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2FE3FF, MAP_ROM); - SekMapMemory(Neo68KROMActive + nNeo68KROMBank + 0x0FE800, 0x2FE800, 0x2FFFFF, MAP_ROM); - } - } -} - -static INT32 mslug3Init() -{ - nNeoProtectionXor = 0xAD; - - return NeoSMAInit(mslug3SMADecrypt, mslug3WriteWordBankswitch, 0, 0); -} - -struct BurnDriver BurnDrvmslug3 = { - "mslug3", NULL, "neogeo", NULL, "2000", - "Metal Slug 3 (NGM-2560)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42 | HARDWARE_SNK_SMA_PROTECTION, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug3RomInfo, mslug3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug3Init, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -static INT32 mslug3hInit() -{ - nNeoProtectionXor = 0xAD; - - return NeoInit(); -} - -// Metal Slug 3 (Enhanced Violence Version) - -static struct BurnRomInfo mslug3vRomDesc[] = { - { "256-pg1.p1", 0x100000, 0x47f9aeea, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5332202 - { "256-pg2.p2", 0x400000, 0x1f3d8ce8, 1 | BRF_ESS | BRF_PRG }, // 2 / TC5332202 - - { "256-c1.c1", 0x800000, 0x5a79c34e, 3 | BRF_GRA }, // 3 Sprite data / TC5364202 - { "256-c2.c2", 0x800000, 0x944c362c, 3 | BRF_GRA }, // 4 / TC5364202 - { "256-c3.c3", 0x800000, 0x6e69d36f, 3 | BRF_GRA }, // 5 / TC5364202 - { "256-c4.c4", 0x800000, 0xb755b4eb, 3 | BRF_GRA }, // 6 / TC5364202 - { "256-c5.c5", 0x800000, 0x7aacab47, 3 | BRF_GRA }, // 7 / TC5364202 - { "256-c6.c6", 0x800000, 0xc698fd5d, 3 | BRF_GRA }, // 8 / TC5364202 - { "256-c7.c7", 0x800000, 0xcfceddd2, 3 | BRF_GRA }, // 9 / TC5364202 - { "256-c8.c8", 0x800000, 0x4d9be34c, 3 | BRF_GRA }, // 10 / TC5364202 - - { "256-m1.m1", 0x080000, 0xeaeec116, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / mask rom TC534000 - - { "256-v1.v1", 0x400000, 0xf2690241, 5 | BRF_SND }, // 12 Sound data / TC5332204 - { "256-v2.v2", 0x400000, 0x7e2a10bd, 5 | BRF_SND }, // 13 / TC5332204 - { "256-v3.v3", 0x400000, 0x0eaec17c, 5 | BRF_SND }, // 14 / TC5332204 - { "256-v4.v4", 0x400000, 0x9b4b22d4, 5 | BRF_SND }, // 15 / TC5332204 -}; - -STDROMPICKEXT(mslug3v, mslug3v, neogeo) -STD_ROM_FN(mslug3v) - -struct BurnDriver BurnDrvmslug3v = { - "mslug3v", "mslug3", "neogeo", NULL, "2012", - "Metal Slug 3 (NGH-2560) (Enhanced Violence Version hack by EEZEZY)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug3vRomInfo, mslug3vRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug3hInit, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Metal Slug 3 (NGH-2560) -/* Original Version - Encrypted GFX */ /* revision 2000.3.17 */ /* AES VERSION */ - -static struct BurnRomInfo mslug3hRomDesc[] = { - { "256-ph1.p1", 0x100000, 0x9c42ca85, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "256-ph2.sp2", 0x400000, 0x1f3d8ce8, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "256-c1.c1", 0x800000, 0x5a79c34e, 3 | BRF_GRA }, // 2 Sprite data / TC5364202 - { "256-c2.c2", 0x800000, 0x944c362c, 3 | BRF_GRA }, // 3 / TC5364202 - { "256-c3.c3", 0x800000, 0x6e69d36f, 3 | BRF_GRA }, // 4 / TC5364202 - { "256-c4.c4", 0x800000, 0xb755b4eb, 3 | BRF_GRA }, // 5 / TC5364202 - { "256-c5.c5", 0x800000, 0x7aacab47, 3 | BRF_GRA }, // 6 / TC5364202 - { "256-c6.c6", 0x800000, 0xc698fd5d, 3 | BRF_GRA }, // 7 / TC5364202 - { "256-c7.c7", 0x800000, 0xcfceddd2, 3 | BRF_GRA }, // 8 / TC5364202 - { "256-c8.c8", 0x800000, 0x4d9be34c, 3 | BRF_GRA }, // 9 / TC5364202 - - { "256-m1.m1", 0x080000, 0xeaeec116, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / mask rom TC534000 - - { "256-v1.v1", 0x400000, 0xf2690241, 5 | BRF_SND }, // 11 Sound data / TC5332204 - { "256-v2.v2", 0x400000, 0x7e2a10bd, 5 | BRF_SND }, // 12 / TC5332204 - { "256-v3.v3", 0x400000, 0x0eaec17c, 5 | BRF_SND }, // 13 / TC5332204 - { "256-v4.v4", 0x400000, 0x9b4b22d4, 5 | BRF_SND }, // 14 / TC5332204 -}; - -STDROMPICKEXT(mslug3h, mslug3h, neogeo) -STD_ROM_FN(mslug3h) - -struct BurnDriver BurnDrvmslug3h = { - "mslug3h", "mslug3", "neogeo", NULL, "2000", - "Metal Slug 3 (NGH-2560)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug3hRomInfo, mslug3hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug3hInit, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Metal Slug 6 (Metal Slug 3 bootleg) - -static struct BurnRomInfo mslug3b6RomDesc[] = { - { "299-p1.bin", 0x200000, 0x5f2fe228, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "299-p2.bin", 0x400000, 0x193fa835, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "299-s1.bin", 0x020000, 0x6f8b9635, 2 | BRF_GRA }, // 2 Text layer tiles - - { "256-c1.c1", 0x800000, 0x5a79c34e, 3 | BRF_GRA }, // 3 Sprite data - { "256-c2.c2", 0x800000, 0x944c362c, 3 | BRF_GRA }, // 4 - { "256-c3.c3", 0x800000, 0x6e69d36f, 3 | BRF_GRA }, // 5 - { "256-c4.c4", 0x800000, 0xb755b4eb, 3 | BRF_GRA }, // 6 - { "256-c5.c5", 0x800000, 0x7aacab47, 3 | BRF_GRA }, // 7 - { "256-c6.c6", 0x800000, 0xc698fd5d, 3 | BRF_GRA }, // 8 - { "256-c7.c7", 0x800000, 0xcfceddd2, 3 | BRF_GRA }, // 9 - { "256-c8.c8", 0x800000, 0x4d9be34c, 3 | BRF_GRA }, // 10 - - { "256-m1.m1", 0x080000, 0xeaeec116, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "256-v1.v1", 0x400000, 0xf2690241, 5 | BRF_SND }, // 12 Sound data - { "256-v2.v2", 0x400000, 0x7e2a10bd, 5 | BRF_SND }, // 13 - { "256-v3.v3", 0x400000, 0x0eaec17c, 5 | BRF_SND }, // 14 - { "256-v4.v4", 0x400000, 0x9b4b22d4, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(mslug3b6, mslug3b6, neogeo) -STD_ROM_FN(mslug3b6) - -static void mslug3b6Callback() -{ - memmove(Neo68KROMActive, Neo68KROMActive + 0x100000, 0x500000); - - garoubl_sx_decode(); -} - -static INT32 mslug3b6Init() -{ - NeoCallbackActive->pInitialise = mslug3b6Callback; - nNeoProtectionXor = 0xAD; - - return NeoInit(); -} - -struct BurnDriver BurnDrvmslug3b6 = { - "mslug3b6", "mslug3", "neogeo", NULL, "2000", - "Metal Slug 6 (Metal Slug 3 bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug3b6RomInfo, mslug3b6RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug3b6Init, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2000 (NGM-2570) (NGH-2570) -/* Original Version, Encrypted Code + Sound + GFX Roms */ /* MVS AND AES VERSION */ - -static struct BurnRomInfo kof2000RomDesc[] = { - { "neo-sma", 0x040000, 0x71c6e6bb, 9 | BRF_ESS | BRF_PRG }, // 0 68K code - { "257-p1.p1", 0x400000, 0x60947b4c, 1 | BRF_ESS | BRF_PRG }, // 1 - { "257-p2.p2", 0x400000, 0x1b7ec415, 1 | BRF_ESS | BRF_PRG }, // 2 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "257-c1.c1", 0x800000, 0xcef1cdfa, 3 | BRF_GRA }, // 3 Sprite data - { "257-c2.c2", 0x800000, 0xf7bf0003, 3 | BRF_GRA }, // 4 - { "257-c3.c3", 0x800000, 0x101e6560, 3 | BRF_GRA }, // 5 - { "257-c4.c4", 0x800000, 0xbd2fc1b1, 3 | BRF_GRA }, // 6 - { "257-c5.c5", 0x800000, 0x89775412, 3 | BRF_GRA }, // 7 - { "257-c6.c6", 0x800000, 0xfa7200d5, 3 | BRF_GRA }, // 8 - { "257-c7.c7", 0x800000, 0x7da11fe4, 3 | BRF_GRA }, // 9 - { "257-c8.c8", 0x800000, 0xb1afa60b, 3 | BRF_GRA }, // 10 - - { "257-m1.m1", 0x040000, 0x4b749113, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "257-v1.v1", 0x400000, 0x17cde847, 5 | BRF_SND }, // 12 Sound data - { "257-v2.v2", 0x400000, 0x1afb20ff, 5 | BRF_SND }, // 13 - { "257-v3.v3", 0x400000, 0x4605036a, 5 | BRF_SND }, // 14 - { "257-v4.v4", 0x400000, 0x764bbd6b, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kof2000, kof2000, neogeo) -STD_ROM_FN(kof2000) - -static void kof2000SMADecrypt() -{ - for (INT32 i = 0; i < 0x800000 / 2; i++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i] = BITSWAP16(BURN_ENDIAN_SWAP_INT16(((UINT16*)(Neo68KROMActive + 0x100000))[i]), 12, 8, 11, 3, 15, 14, 7, 0, 10, 13, 6, 5, 9, 2, 1, 4); - } - - for (INT32 i = 0; i < 0x0C0000 / 2; i++) { - ((UINT16*)Neo68KROMActive)[i] = BURN_ENDIAN_SWAP_INT16(((UINT16*)Neo68KROMActive)[0x73A000 / 2 + BITSWAP24(i, 23, 22, 21, 20, 19, 18, 8, 4, 15, 13, 3, 14, 16, 2, 6, 17, 7, 12, 10, 0, 5, 11, 1, 9)]); - } - - for (INT32 i = 0; i < 0x63A000 / 2; i += 0x0800 / 2) { - UINT16 nBuffer[0x0800 / 2]; - memmove(nBuffer, &((UINT16*)(Neo68KROMActive + 0x100000))[i], 0x0800); - for (INT32 j = 0; j < 0x0800 / 2; j++) { - ((UINT16*)(Neo68KROMActive + 0x100000))[i + j] = BURN_ENDIAN_SWAP_INT16(nBuffer[BITSWAP24(j, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 4, 1, 3, 8, 6, 2, 7, 0, 9, 5)]); - } - } -} - -void __fastcall kof2000WriteWordBankswitch(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress == 0x2FFFEC) { - static UINT32 bankoffset[64] = { - 0x100000, 0x200000, 0x300000, 0x400000, // 00 - 0x4f7800, 0x5f7800, 0x4ff800, 0x5ff800, // 04 - 0x507800, 0x607800, 0x50f800, 0x60f800, // 08 - 0x516800, 0x616800, 0x51d800, 0x61d800, // 12 - 0x524000, 0x624000, 0x623800, 0x723800, // 16 - 0x626000, 0x726000, 0x628000, 0x728000, // 20 - 0x62a000, 0x72a000, 0x62b800, 0x72b800, // 24 - 0x62d000, 0x72d000, 0x62e800, 0x72e800, // 28 - 0x718000, 0x719000, 0x71a000, 0x71a800, // 32 - }; - - // Unscramble bank number - INT32 nBank = - (((wordValue >> 15) & 1) << 0) + - (((wordValue >> 14) & 1) << 1) + - (((wordValue >> 7) & 1) << 2) + - (((wordValue >> 3) & 1) << 3) + - (((wordValue >> 10) & 1) << 4) + - (((wordValue >> 5) & 1) << 5); - - if (bankoffset[nBank] != nNeo68KROMBank) { - nNeo68KROMBank = bankoffset[nBank]; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2FE3FF, MAP_ROM); - SekMapMemory(Neo68KROMActive + nNeo68KROMBank + 0x0FE800, 0x2FE800, 0x2FFBFF, MAP_ROM); - } - } -} - -static INT32 kof2000Init() -{ - nNeoProtectionXor = 0x00; - - return NeoSMAInit(kof2000SMADecrypt, kof2000WriteWordBankswitch, 0x2FFFD8, 0x2FFFDA); -} - -struct BurnDriver BurnDrvkof2000 = { - "kof2000", NULL, "neogeo", NULL, "2000", - "The King of Fighters 2000 (NGM-2570) (NGH-2570)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_SMA_PROTECTION | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kof2000RomInfo, kof2000RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2000Init, NeoSMAExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2000 (not encrypted) -/* Original Version, Encrypted Sound + GFX Roms */ - -static struct BurnRomInfo kof2000nRomDesc[] = { - { "257-pg1.p1", 0x100000, 0x5f809dbe, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "257-pg2.sp2", 0x400000, 0x693c2c5e, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "257-c1.c1", 0x800000, 0xcef1cdfa, 3 | BRF_GRA }, // 2 Sprite data - { "257-c2.c2", 0x800000, 0xf7bf0003, 3 | BRF_GRA }, // 3 - { "257-c3.c3", 0x800000, 0x101e6560, 3 | BRF_GRA }, // 4 - { "257-c4.c4", 0x800000, 0xbd2fc1b1, 3 | BRF_GRA }, // 5 - { "257-c5.c5", 0x800000, 0x89775412, 3 | BRF_GRA }, // 6 - { "257-c6.c6", 0x800000, 0xfa7200d5, 3 | BRF_GRA }, // 7 - { "257-c7.c7", 0x800000, 0x7da11fe4, 3 | BRF_GRA }, // 8 - { "257-c8.c8", 0x800000, 0xb1afa60b, 3 | BRF_GRA }, // 9 - - { "257-m1.m1", 0x040000, 0x4b749113, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "257-v1.v1", 0x400000, 0x17cde847, 5 | BRF_SND }, // 11 Sound data - { "257-v2.v2", 0x400000, 0x1afb20ff, 5 | BRF_SND }, // 12 - { "257-v3.v3", 0x400000, 0x4605036a, 5 | BRF_SND }, // 13 - { "257-v4.v4", 0x400000, 0x764bbd6b, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(kof2000n, kof2000n, neogeo) -STD_ROM_FN(kof2000n) - -static INT32 kof2000nInit() -{ - nNeoProtectionXor = 0x00; - return NeoInit(); -} - -struct BurnDriver BurnDrvkof2000n = { - "kof2000n", "kof2000", "neogeo", NULL, "2000", - "The King of Fighters 2000 (not encrypted)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kof2000nRomInfo, kof2000nRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2000nInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Zupapa! -/* Original Version - Encrypted GFX */ /* MVS ONLY RELEASE */ - -static struct BurnRomInfo zupapaRomDesc[] = { - { "070-p1.p1", 0x100000, 0x5a96203e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - - /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */ - { "070-c1.c1", 0x800000, 0xf8ad02d8, 3 | BRF_GRA }, // 1 Sprite data / mask rom TC5364205 - { "070-c2.c2", 0x800000, 0x70156dde, 3 | BRF_GRA }, // 2 / mask rom TC5364205 - - { "070-epr.m1", 0x020000, 0x5a3b3191, 4 | BRF_ESS | BRF_PRG }, // 3 Z80 code / M27C1001 - /* M1 on eprom, correct chip label unknown */ - - { "070-v1.v1", 0x200000, 0xd3a7e1ff, 5 | BRF_SND }, // 4 Sound data / mask rom TC5316200 -}; - -STDROMPICKEXT(zupapa, zupapa, neogeo) -STD_ROM_FN(zupapa) - -static INT32 zupapaInit() -{ - nNeoProtectionXor = 0xBD; - return NeoInit(); -} - -struct BurnDriver BurnDrvZupapa = { - "zupapa", NULL, "neogeo", NULL, "2001", - "Zupapa!\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42, GBF_PLATFORM, 0, - NULL, zupapaRomInfo, zupapaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - zupapaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Sengoku 3 / Sengoku Densho 2001 -/* Original Version - Encrypted GFX */ - -static struct BurnRomInfo sengoku3RomDesc[] = { - /* also found AES set with P1 on maskrom on PROG board NEO-AEG PROGBK1F; chip label is 261-PH1 - and CHA board NEO-AEG CHAFIO (1999.8.10) (NEO-CMC 7042) */ - { "261-ph1.p1", 0x200000, 0xe0d4bc0a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - /* also found MVS set with P1 on maskrom on PROG board NEO-MVS PROGBK1; chip label is 261-PG1 - and CHA board NEO-MVS CHAFIO (1999.6.14) (NEO-CMC 7042) */ - - { "261-c1.c1", 0x800000, 0xded84d9c, 3 | BRF_GRA }, // 1 Sprite data - { "261-c2.c2", 0x800000, 0xb8eb4348, 3 | BRF_GRA }, // 2 - { "261-c3.c3", 0x800000, 0x84e2034a, 3 | BRF_GRA }, // 3 - { "261-c4.c4", 0x800000, 0x0b45ae53, 3 | BRF_GRA }, // 4 - - { "261-m1.m1", 0x080000, 0x7d501c39, 4 | BRF_ESS | BRF_PRG }, // 5 Z80 code - - { "261-v1.v1", 0x400000, 0x64c30081, 5 | BRF_SND }, // 6 Sound data - { "261-v2.v2", 0x400000, 0x392a9c47, 5 | BRF_SND }, // 7 - { "261-v3.v3", 0x400000, 0xc1a7ebe3, 5 | BRF_SND }, // 8 - { "261-v4.v4", 0x200000, 0x9000d085, 5 | BRF_SND }, // 9 -}; - -STDROMPICKEXT(sengoku3, sengoku3, neogeo) -STD_ROM_FN(sengoku3) - -static INT32 sengoku3Init() -{ - nNeoProtectionXor = 0xFE; - return NeoInit(); -} - -struct BurnDriver BurnDrvSengoku3 = { - "sengoku3", NULL, "neogeo", NULL, "2001", - "Sengoku 3 / Sengoku Densho 2001\0", NULL, "SNK / Noise Factory", "Neo Geo MVS", - L"Sengoku 3\0\u6226\u56FD\u4F1D\u627F\uFF12\uFF10\uFF10\uFF11\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42 | HARDWARE_SNK_SWAPP, GBF_SCRFIGHT, 0, - NULL, sengoku3RomInfo, sengoku3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - sengoku3Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// The King of Fighters 2001 (NGM-262?) -/* MVS VERSION */ - -static struct BurnRomInfo kof2001RomDesc[] = { - { "262-p1-08-e0.p1", 0x100000, 0x9381750d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "262-p2-08-e0.sp2", 0x400000, 0x8e0d8329, 1 | BRF_ESS | BRF_PRG }, // 1 - /* The first/early production run sets have proms with above labels. Some later? sets found have eproms instead of proms */ - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "262-c1-08-e0.c1", 0x800000, 0x99cc785a, 3 | BRF_GRA }, // 2 Sprite data - { "262-c2-08-e0.c2", 0x800000, 0x50368cbf, 3 | BRF_GRA }, // 3 - { "262-c3-08-e0.c3", 0x800000, 0xfb14ff87, 3 | BRF_GRA }, // 4 - { "262-c4-08-e0.c4", 0x800000, 0x4397faf8, 3 | BRF_GRA }, // 5 - { "262-c5-08-e0.c5", 0x800000, 0x91f24be4, 3 | BRF_GRA }, // 6 - { "262-c6-08-e0.c6", 0x800000, 0xa31e4403, 3 | BRF_GRA }, // 7 - { "262-c7-08-e0.c7", 0x800000, 0x54d9d1ec, 3 | BRF_GRA }, // 8 - { "262-c8-08-e0.c8", 0x800000, 0x59289a6b, 3 | BRF_GRA }, // 9 - - { "265-262-m1.m1", 0x040000, 0xa7f8119f, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "262-v1-08-e0.v1", 0x400000, 0x83d49ecf, 5 | BRF_SND }, // 11 Sound data - { "262-v2-08-e0.v2", 0x400000, 0x003f1843, 5 | BRF_SND }, // 12 - { "262-v3-08-e0.v3", 0x400000, 0x2ae38dbe, 5 | BRF_SND }, // 13 - { "262-v4-08-e0.v4", 0x400000, 0x26ec4dd9, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(kof2001, kof2001, neogeo) -STD_ROM_FN(kof2001) - -static INT32 kof2001Init() -{ - nNeoProtectionXor = 0x1E; - return NeoInit(); -} - -struct BurnDriver BurnDrvkof2001 = { - "kof2001", NULL, "neogeo", NULL, "2001", - "The King of Fighters 2001 (NGM-262?)\0", NULL, "SNK / Eolith", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kof2001RomInfo, kof2001RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2001Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2001 (NGH-2621) -/* AES VERSION */ - -static struct BurnRomInfo kof2001hRomDesc[] = { - { "262-pg1.p1", 0x100000, 0x2af7e741, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "262-pg2.sp2", 0x400000, 0x91eea062, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "262-c1-08-e0.c1", 0x800000, 0x99cc785a, 3 | BRF_GRA }, // 2 Sprite data - { "262-c2-08-e0.c2", 0x800000, 0x50368cbf, 3 | BRF_GRA }, // 3 - { "262-c3-08-e0.c3", 0x800000, 0xfb14ff87, 3 | BRF_GRA }, // 4 - { "262-c4-08-e0.c4", 0x800000, 0x4397faf8, 3 | BRF_GRA }, // 5 - { "262-c5-08-e0.c5", 0x800000, 0x91f24be4, 3 | BRF_GRA }, // 6 - { "262-c6-08-e0.c6", 0x800000, 0xa31e4403, 3 | BRF_GRA }, // 7 - { "262-c7-08-e0.c7", 0x800000, 0x54d9d1ec, 3 | BRF_GRA }, // 8 - { "262-c8-08-e0.c8", 0x800000, 0x59289a6b, 3 | BRF_GRA }, // 9 - - { "265-262-m1.m1", 0x040000, 0xa7f8119f, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "262-v1-08-e0.v1", 0x400000, 0x83d49ecf, 5 | BRF_SND }, // 11 Sound data - { "262-v2-08-e0.v2", 0x400000, 0x003f1843, 5 | BRF_SND }, // 12 - { "262-v3-08-e0.v3", 0x400000, 0x2ae38dbe, 5 | BRF_SND }, // 13 - { "262-v4-08-e0.v4", 0x400000, 0x26ec4dd9, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(kof2001h, kof2001h, neogeo) -STD_ROM_FN(kof2001h) - -struct BurnDriver BurnDrvkof2001h = { - "kof2001h", "kof2001", "neogeo", NULL, "2001", - "The King of Fighters 2001 (NGH-2621)\0", NULL, "SNK / Eolith", "Neo Geo AES", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kof2001hRomInfo, kof2001hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2001Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Crouching Tiger Hidden Dragon 2003 (The King of Fighters 2001 bootleg) - -static struct BurnRomInfo cthd2003RomDesc[] = { - { "5003-p1.bin", 0x100000, 0xbb7602c1, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "5003-p2.bin", 0x400000, 0xadc1c22b, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5003-s1.bin", 0x020000, 0x5ba29aab, 2 | BRF_GRA }, // 2 Text layer tiles - - { "5003-c1.bin", 0x800000, 0x68f54b67, 3 | BRF_GRA }, // 3 Sprite data - { "5003-c2.bin", 0x800000, 0x2f8849d5, 3 | BRF_GRA }, // 4 - { "5003-c3.bin", 0x800000, 0xac4aff71, 3 | BRF_GRA }, // 5 - { "5003-c4.bin", 0x800000, 0xafef5d66, 3 | BRF_GRA }, // 6 - { "5003-c5.bin", 0x800000, 0xc7c1ae50, 3 | BRF_GRA }, // 7 - { "5003-c6.bin", 0x800000, 0x613197f9, 3 | BRF_GRA }, // 8 - { "5003-c7.bin", 0x800000, 0x64ddfe0f, 3 | BRF_GRA }, // 9 - { "5003-c8.bin", 0x800000, 0x917a1439, 3 | BRF_GRA }, // 10 - - { "5003-m1.bin", 0x020000, 0x1a8c274b, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "262-v1-08-e0.v1", 0x400000, 0x83d49ecf, 5 | BRF_SND }, // 12 Sound data - { "262-v2-08-e0.v2", 0x400000, 0x003f1843, 5 | BRF_SND }, // 13 - { "262-v3-08-e0.v3", 0x400000, 0x2ae38dbe, 5 | BRF_SND }, // 14 - { "262-v4-08-e0.v4", 0x400000, 0x26ec4dd9, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(cthd2003, cthd2003, neogeo) -STD_ROM_FN(cthd2003) - -static void cthd2003Bankswitch(UINT32 nBank) -{ - static UINT32 cthd2003_banks[8] = { - 0x200000, 0x100000, 0x200000, 0x100000, 0x200000, 0x100000, 0x400000, 0x300000, - }; - - nBank = cthd2003_banks[nBank & 7]; - - if (nBank != nNeo68KROMBank) { - nNeo68KROMBank = nBank; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2fffff, MAP_ROM); - } -} - -void __fastcall cthd2003WriteByteBankswitch(UINT32 sekAddress, UINT8 byteValue) -{ - if (sekAddress == 0x2ffff0) { - cthd2003Bankswitch(byteValue); - } -} - -void __fastcall cthd2003WriteWordBankswitch(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress == 0x2ffff0) { - cthd2003Bankswitch(wordValue); - } -} -static void cthd2003_decode() -{ - INT32 i, n; - - // fix garbage on s1 layer over everything - *((UINT16*)(Neo68KROMActive + 0xf415a)) = BURN_ENDIAN_SWAP_INT16(0x4ef9); - *((UINT16*)(Neo68KROMActive + 0xf415c)) = BURN_ENDIAN_SWAP_INT16(0x000f); - *((UINT16*)(Neo68KROMActive + 0xf415e)) = BURN_ENDIAN_SWAP_INT16(0x4cf2); - - // Fix corruption in attract mode before title screen - for (i = 0x1ae290; i < 0x1ae8d0; i+=2) { - *((UINT16*)(Neo68KROMActive + i)) = BURN_ENDIAN_SWAP_INT16(0x0000); - } - - // Fix for title page - for (i = 0x1f8ef0; i < 0x1fa1f0; i += 4) { - *((UINT16*)(Neo68KROMActive + i + 0)) -= BURN_ENDIAN_SWAP_INT16(0x7000); - *((UINT16*)(Neo68KROMActive + i + 2)) -= BURN_ENDIAN_SWAP_INT16(0x0010); - } - - // Fix for green dots on title page - for (i = 0xac500; i < 0xac520; i+=2) { - *((UINT16*)(Neo68KROMActive + i)) = BURN_ENDIAN_SWAP_INT16(0xffff); - } - - // Fix for blanks as screen change level end clear - *((UINT16*)(Neo68KROMActive + 0x991d0)) = BURN_ENDIAN_SWAP_INT16(0xdd03); - *((UINT16*)(Neo68KROMActive + 0x99306)) = BURN_ENDIAN_SWAP_INT16(0xdd03); - *((UINT16*)(Neo68KROMActive + 0x99354)) = BURN_ENDIAN_SWAP_INT16(0xdd03); - *((UINT16*)(Neo68KROMActive + 0x9943e)) = BURN_ENDIAN_SWAP_INT16(0xdd03); - - // Swap bits 15 & 16 in the address of the Z80 ROM - for (i = 0; i < 0x10000 / 2; i++) { - n = NeoZ80ROMActive[0x08000 + i]; - NeoZ80ROMActive[0x08000 + i] = NeoZ80ROMActive[0x10000 + i]; - NeoZ80ROMActive[0x10000 + i] = n; - } - - DoPerm(0); -} - -static void cthd2003Callback() -{ - INT32 i, n; - for (i = 0; i < 0x8000; i++) - { - n = NeoTextROM[nNeoActiveSlot][0x08000 + i]; - NeoTextROM[nNeoActiveSlot][0x08000 + i] = NeoTextROM[nNeoActiveSlot][0x10000 + i]; - NeoTextROM[nNeoActiveSlot][0x10000 + i] = n; - } - - cthd2003_decode(); -} - -static void cthd2003InstallBankSwitchHandler() -{ - SekMapHandler(6, 0x200000, 0x2fffff, MAP_WRITE); - SekSetWriteWordHandler(6, cthd2003WriteWordBankswitch); - SekSetWriteByteHandler(6, cthd2003WriteByteBankswitch); - - cthd2003Bankswitch(0); -} - -static INT32 cthd2003Init() -{ - nBurnCPUSpeedAdjust = 0x010a; - - NeoCallbackActive->pInitialise = cthd2003Callback; - NeoCallbackActive->pInstallHandlers = cthd2003InstallBankSwitchHandler; - NeoCallbackActive->pBankswitch = NeoMapBank; - - return NeoInit(); -} - -struct BurnDriver BurnDrvcthd2003 = { - "cthd2003", "kof2001", "neogeo", NULL, "2003", - "Crouching Tiger Hidden Dragon 2003 (set 1)\0", "Hack of \"The King of Fighters 2001\"", "Phenixsoft", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, cthd2003RomInfo, cthd2003RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - cthd2003Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Crouching Tiger Hidden Dragon 2003 Super Plus (The King of Fighters 2001 bootleg) - -static struct BurnRomInfo ct2k3spRomDesc[] = { - { "5003-p1sp.bin", 0x100000, 0xab5c4de0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "5003-p2.bin", 0x400000, 0xadc1c22b, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5003-s1sp.bin", 0x040000, 0x6c355ab4, 2 | BRF_GRA }, // 2 Text layer tiles - - { "5003-c1.bin", 0x800000, 0x68f54b67, 3 | BRF_GRA }, // 3 Sprite data - { "5003-c2.bin", 0x800000, 0x2f8849d5, 3 | BRF_GRA }, // 4 - { "5003-c3.bin", 0x800000, 0xac4aff71, 3 | BRF_GRA }, // 5 - { "5003-c4.bin", 0x800000, 0xafef5d66, 3 | BRF_GRA }, // 6 - { "5003-c5.bin", 0x800000, 0xc7c1ae50, 3 | BRF_GRA }, // 7 - { "5003-c6.bin", 0x800000, 0x613197f9, 3 | BRF_GRA }, // 8 - { "5003-c7.bin", 0x800000, 0x64ddfe0f, 3 | BRF_GRA }, // 9 - { "5003-c8.bin", 0x800000, 0x917a1439, 3 | BRF_GRA }, // 10 - - { "5003-m1.bin", 0x020000, 0x1a8c274b, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "262-v1-08-e0.v1", 0x400000, 0x83d49ecf, 5 | BRF_SND }, // 12 Sound data - { "262-v2-08-e0.v2", 0x400000, 0x003f1843, 5 | BRF_SND }, // 13 - { "262-v3-08-e0.v3", 0x400000, 0x2ae38dbe, 5 | BRF_SND }, // 14 - { "262-v4-08-e0.v4", 0x400000, 0x26ec4dd9, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(ct2k3sp, ct2k3sp, neogeo) -STD_ROM_FN(ct2k3sp) - -static void ct2k3spCallback() -{ - INT32 i, j; - UINT8 *dst = (UINT8 *)BurnMalloc( 0x040000 ); - if (dst) - { - for (i = 0; i < 0x040000; i++) - { - j = BITSWAP24(i, 23,22,21,20,19,18,17,3,0,1,4,2,13,14,15,16,5,6,11,10,9,8,7,12); - dst[i] = NeoTextROM[nNeoActiveSlot][j]; - } - - memmove (NeoTextROM[nNeoActiveSlot], dst, 0x040000 ); - - BurnFree (dst); - } - - cthd2003_decode(); -} - -static void ct2kspInstallBankSwitchHandler() -{ - SekMapHandler(6, 0x200000, 0x2fffff, MAP_WRITE); - SekSetWriteWordHandler(6, cthd2003WriteWordBankswitch); - SekSetWriteByteHandler(6, cthd2003WriteByteBankswitch); - - cthd2003Bankswitch(0); -} - -static INT32 ct2k3spInit() -{ - nBurnCPUSpeedAdjust = 0x010a; - - NeoCallbackActive->pInitialise = ct2k3spCallback; - NeoCallbackActive->pInstallHandlers = ct2kspInstallBankSwitchHandler; - NeoCallbackActive->pBankswitch = NeoMapBank; - - return NeoInit(); -} - -struct BurnDriver BurnDrvct2k3sp = { - "ct2k3sp", "kof2001", "neogeo", NULL, "2003", - "Crouching Tiger Hidden Dragon 2003 Super Plus\0", NULL, "bootleg", "Neo Geo MVS", - L"Crouching Tiger Hidden Dragon 2003 Super Plus\0\u81E5\u864E\u85CF\u9F8D\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, ct2k3spRomInfo, ct2k3spRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - ct2k3spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Crouching Tiger Hidden Dragon 2003 Super Plus alternate (The King of Fighters 2001 bootleg) - -static struct BurnRomInfo ct2k3saRomDesc[] = { - { "5003-p1sa.bin", 0x100000, 0x013a509d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "5003-p2.bin", 0x400000, 0xadc1c22b, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5003-s1sa.bin", 0x020000, 0x4e1f7eae, 2 | BRF_GRA }, // 2 Text layer tiles - - { "5003-c1.bin", 0x800000, 0x68f54b67, 3 | BRF_GRA }, // 3 Sprite data - { "5003-c2.bin", 0x800000, 0x2f8849d5, 3 | BRF_GRA }, // 4 - { "5003-c3.bin", 0x800000, 0xac4aff71, 3 | BRF_GRA }, // 5 - { "5003-c4.bin", 0x800000, 0xafef5d66, 3 | BRF_GRA }, // 6 - { "5003-c5.bin", 0x800000, 0xc7c1ae50, 3 | BRF_GRA }, // 7 - { "5003-c6.bin", 0x800000, 0x613197f9, 3 | BRF_GRA }, // 8 - { "5003-c7.bin", 0x800000, 0x64ddfe0f, 3 | BRF_GRA }, // 9 - { "5003-c8.bin", 0x800000, 0x917a1439, 3 | BRF_GRA }, // 10 - - { "5003-m1.bin", 0x020000, 0x1a8c274b, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "262-v1-08-e0.v1", 0x400000, 0x83d49ecf, 5 | BRF_SND }, // 12 Sound data - { "262-v2-08-e0.v2", 0x400000, 0x003f1843, 5 | BRF_SND }, // 13 - { "262-v3-08-e0.v3", 0x400000, 0x2ae38dbe, 5 | BRF_SND }, // 14 - { "262-v4-08-e0.v4", 0x400000, 0x26ec4dd9, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(ct2k3sa, ct2k3sa, neogeo) -STD_ROM_FN(ct2k3sa) - -static INT32 ct2k3saInit() -{ - nBurnCPUSpeedAdjust = 0x010d; - NeoCallbackActive->pInitialise = cthd2003_decode; - return NeoInit(); -} - -struct BurnDriver BurnDrvct2k3sa = { - "ct2k3sa", "kof2001", "neogeo", NULL, "2003", - "Crouching Tiger Hidden Dragon 2003 Super Plus alternate\0", NULL, "bootleg", "Neo Geo MVS", - L"Crouching Tiger Hidden Dragon 2003 Super Plus (alternate set)\0\u81E5\u864E\u85CF\u9F8D\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, ct2k3saRomInfo, ct2k3saRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - ct2k3saInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2002 (NGM-2650)(NGH-2650) -/* Encrypted Set */ /* MVS AND AES VERSION */ - -static struct BurnRomInfo kof2002RomDesc[] = { - { "265-p1.p1", 0x100000, 0x9ede7323, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "265-p2.sp2", 0x400000, 0x327266b8, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "265-c1.c1", 0x800000, 0x2b65a656, 3 | BRF_GRA }, // 2 Sprite data - { "265-c2.c2", 0x800000, 0xadf18983, 3 | BRF_GRA }, // 3 - { "265-c3.c3", 0x800000, 0x875e9fd7, 3 | BRF_GRA }, // 4 - { "265-c4.c4", 0x800000, 0x2da13947, 3 | BRF_GRA }, // 5 - { "265-c5.c5", 0x800000, 0x61bd165d, 3 | BRF_GRA }, // 6 - { "265-c6.c6", 0x800000, 0x03fdd1eb, 3 | BRF_GRA }, // 7 - { "265-c7.c7", 0x800000, 0x1a2749d8, 3 | BRF_GRA }, // 8 - { "265-c8.c8", 0x800000, 0xab0bb549, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "265-m1.m1", 0x020000, 0x85aaa632, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "265-v1.v1", 0x800000, 0x15e8f3f5, 5 | BRF_SND }, // 11 Sound data - { "265-v2.v2", 0x800000, 0xda41d6f9, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kof2002, kof2002, neogeo) -STD_ROM_FN(kof2002) - -static INT32 kof2002Init() -{ - INT32 nRet; - - nNeoProtectionXor = 0xEC; - NeoCallbackActive->pInitialise = PCM2DecryptP; - - nRet = NeoInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0xa5000, 0x000000, { 0xf9, 0xe0, 0x5d, 0xf3, 0xea, 0x92, 0xbe, 0xef } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkof2002 = { - "kof2002", NULL, "neogeo", NULL, "2002", - "The King of Fighters 2002 (NGM-2650)(NGH-2650)\0", NULL, "Eolith / Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kof2002RomInfo, kof2002RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2002Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2002 (bootleg) - -static struct BurnRomInfo kof2002bRomDesc[] = { - { "265-p1.p1", 0x100000, 0x9ede7323, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "2k2-p2.bin", 0x400000, 0x6dbee4df, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "2k2-s1.bin", 0x020000, 0x2255f5bf, 2 | BRF_GRA }, // 2 Text data - - { "2k2-c1.bin", 0x800000, 0xf25d3d66, 3 | BRF_GRA }, // 3 Sprite data - { "2k2-c2.bin", 0x800000, 0xe3e66f1d, 3 | BRF_GRA }, // 4 - { "2k2-c3.bin", 0x800000, 0x8732fa30, 3 | BRF_GRA }, // 5 - { "2k2-c4.bin", 0x800000, 0x0989fd40, 3 | BRF_GRA }, // 6 - { "2k2-c5.bin", 0x800000, 0x60635cd2, 3 | BRF_GRA }, // 7 - { "2k2-c6.bin", 0x800000, 0xbd736824, 3 | BRF_GRA }, // 8 - { "2k2-c7.bin", 0x800000, 0x2da8d8cf, 3 | BRF_GRA }, // 9 - { "2k2-c8.bin", 0x800000, 0x2048404a, 3 | BRF_GRA }, // 10 - - { "265-m1.m1", 0x020000, 0x85aaa632, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "265-v1.v1", 0x800000, 0x15e8f3f5, 5 | BRF_SND }, // 12 Sound data - { "265-v2.v2", 0x800000, 0xda41d6f9, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kof2002b, kof2002b, neogeo) -STD_ROM_FN(kof2002b) - -void kof2002b_gfx_decrypt(UINT8 *src, INT32 nLen) -{ - INT32 i, j, k, *m; - INT32 tbl[8][6] = { - { 1, 2, 6, 7, 8, 0 }, - { 2, 6, 7, 8, 0, 1 }, - { 6, 7, 8, 0, 1, 2 }, - { 7, 8, 0, 1, 2, 6 }, - { 8, 0, 1, 2, 6, 7 }, - { 8, 7, 6, 2, 1, 0 }, - { 8, 7, 6, 0, 1, 2 }, - { 1, 2, 6, 7, 0, 8 } - }; - - UINT8 dst[0x10000]; - - for (i = 0; i < nLen; i+= 0x10000) - { - memmove (dst, src + i, 0x10000); - - for (j = 0; j < 0x10000 / 0x80; j++) - { - m = tbl[(j >> 3) & 7]; - k = BITSWAP16(j, 15, 14, 13, 12, 11, 10, 9, m[5], m[4], m[3], 5, 4, 3, m[2], m[1], m[0]); - memmove (src + i + k * 0x80, dst + j * 0x80, 0x80); - } - } -} - -static void kof2002bCallback() -{ - PCM2DecryptP(); - kof2002b_gfx_decrypt(NeoSpriteROM[nNeoActiveSlot], 0x4000000); - kof2002b_gfx_decrypt(NeoTextROM[nNeoActiveSlot], 0x020000); -} - -static INT32 kof2002bInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = kof2002bCallback; - - nRet = NeoInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0xa5000, 0x000000, { 0xf9, 0xe0, 0x5d, 0xf3, 0xea, 0x92, 0xbe, 0xef } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkof2002b = { - "kof2002b", "kof2002", "neogeo", NULL, "2002", - "The King of Fighters 2002 (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kof2002bRomInfo, kof2002bRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2002bInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2002 Plus (bootleg set 1) - -static struct BurnRomInfo kf2k2plsRomDesc[] = { - { "2k2-p1p.bin", 0x100000, 0x3ab03781, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "265-p2.sp2", 0x400000, 0x327266b8, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "2k2-s1p.bin", 0x020000, 0x595e0006, 2 | BRF_GRA }, // 2 Text layer tiles - - { "265-c1.c1", 0x800000, 0x2b65a656, 3 | BRF_GRA }, // 3 Sprite data - { "265-c2.c2", 0x800000, 0xadf18983, 3 | BRF_GRA }, // 4 - { "265-c3.c3", 0x800000, 0x875e9fd7, 3 | BRF_GRA }, // 5 - { "265-c4.c4", 0x800000, 0x2da13947, 3 | BRF_GRA }, // 6 - { "265-c5.c5", 0x800000, 0x61bd165d, 3 | BRF_GRA }, // 7 - { "265-c6.c6", 0x800000, 0x03fdd1eb, 3 | BRF_GRA }, // 8 - { "265-c7.c7", 0x800000, 0x1a2749d8, 3 | BRF_GRA }, // 9 - { "265-c8.c8", 0x800000, 0xab0bb549, 3 | BRF_GRA }, // 10 - - { "265-m1.m1", 0x020000, 0x85aaa632, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "265-v1.v1", 0x800000, 0x15e8f3f5, 5 | BRF_SND }, // 12 Sound data - { "265-v2.v2", 0x800000, 0xda41d6f9, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k2pls, kf2k2pls, neogeo) -STD_ROM_FN(kf2k2pls) - -struct BurnDriver BurnDrvkf2k2pls = { - "kf2k2pls", "kof2002", "neogeo", NULL, "2002", - "The King of Fighters 2002 Plus (bootleg set 1)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k2plsRomInfo, kf2k2plsRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2002Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// The King of Fighters 2002 Plus (bootleg set 2) - -static struct BurnRomInfo kf2k2plaRomDesc[] = { - { "2k2-p1pa.bin", 0x100000, 0x6a3a02f3, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "265-p2.sp2", 0x400000, 0x327266b8, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "2k2-s1pa.bin", 0x020000, 0x1a3ed064, 2 | BRF_GRA }, // 2 Text layer tiles - - { "265-c1.c1", 0x800000, 0x2b65a656, 3 | BRF_GRA }, // 3 Sprite data - { "265-c2.c2", 0x800000, 0xadf18983, 3 | BRF_GRA }, // 4 - { "265-c3.c3", 0x800000, 0x875e9fd7, 3 | BRF_GRA }, // 5 - { "265-c4.c4", 0x800000, 0x2da13947, 3 | BRF_GRA }, // 6 - { "265-c5.c5", 0x800000, 0x61bd165d, 3 | BRF_GRA }, // 7 - { "265-c6.c6", 0x800000, 0x03fdd1eb, 3 | BRF_GRA }, // 8 - { "265-c7.c7", 0x800000, 0x1a2749d8, 3 | BRF_GRA }, // 9 - { "265-c8.c8", 0x800000, 0xab0bb549, 3 | BRF_GRA }, // 10 - - { "265-m1.m1", 0x020000, 0x85aaa632, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "265-v1.v1", 0x800000, 0x15e8f3f5, 5 | BRF_SND }, // 12 Sound data - { "265-v2.v2", 0x800000, 0xda41d6f9, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k2pla, kf2k2pla, neogeo) -STD_ROM_FN(kf2k2pla) - -struct BurnDriver BurnDrvkf2k2pla = { - "kf2k2pla", "kof2002", "neogeo", NULL, "2002", - "The King of Fighters 2002 Plus (bootleg set 2)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k2plaRomInfo, kf2k2plaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2002Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2002 Magic Plus (bootleg) - -static struct BurnRomInfo kf2k2mpRomDesc[] = { - { "kf02m-p1.bin", 0x400000, 0xff7c6ec0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "kf02m-p2.bin", 0x400000, 0x91584716, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "kf02m-s1.bin", 0x020000, 0x348d6f2c, 2 | BRF_GRA }, // 2 Text layer tiles - - { "265-c1.c1", 0x800000, 0x2b65a656, 3 | BRF_GRA }, // 3 Sprite data - { "265-c2.c2", 0x800000, 0xadf18983, 3 | BRF_GRA }, // 4 - { "265-c3.c3", 0x800000, 0x875e9fd7, 3 | BRF_GRA }, // 5 - { "265-c4.c4", 0x800000, 0x2da13947, 3 | BRF_GRA }, // 6 - { "265-c5.c5", 0x800000, 0x61bd165d, 3 | BRF_GRA }, // 7 - { "265-c6.c6", 0x800000, 0x03fdd1eb, 3 | BRF_GRA }, // 8 - { "265-c7.c7", 0x800000, 0x1a2749d8, 3 | BRF_GRA }, // 9 - { "265-c8.c8", 0x800000, 0xab0bb549, 3 | BRF_GRA }, // 10 - - { "265-m1.m1", 0x020000, 0x85aaa632, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "265-v1.v1", 0x800000, 0x15e8f3f5, 5 | BRF_SND }, // 12 Sound data - { "265-v2.v2", 0x800000, 0xda41d6f9, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k2mp, kf2k2mp, neogeo) -STD_ROM_FN(kf2k2mp) - -static void kf2k2mpCallback() -{ - INT32 i, j; - for (i = 0; i < 0x500000; i++) - { - j = (i & 0xffff00) + BITSWAP08(i, 7, 3, 4, 5, 6, 1, 2, 0); - Neo68KROMActive[i] = Neo68KROMActive[0x300000 + j]; - } - - garoubl_sx_decode(); -} - -static INT32 kf2k2mpInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0xEC; - NeoCallbackActive->pInitialise = kf2k2mpCallback; - - nRet = NeoInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0xa5000, 0x000000, { 0xf9, 0xe0, 0x5d, 0xf3, 0xea, 0x92, 0xbe, 0xef } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkf2k2mp = { - "kf2k2mp", "kof2002", "neogeo", NULL, "2002", - "The King of Fighters 2002 Magic Plus (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k2mpRomInfo, kf2k2mpRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k2mpInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// The King of Fighters 2002 Magic Plus II (bootleg) - -static struct BurnRomInfo kf2k2mp2RomDesc[] = { - { "k2k2m2p1.bin", 0x200000, 0x1016806c, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "k2k2m2p2.bin", 0x400000, 0x432fdf53, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "k2k2m2s1.bin", 0x020000, 0x446e74c5, 2 | BRF_GRA }, // 2 Text layer tiles - - { "265-c1.c1", 0x800000, 0x2b65a656, 3 | BRF_GRA }, // 3 Sprite data - { "265-c2.c2", 0x800000, 0xadf18983, 3 | BRF_GRA }, // 4 - { "265-c3.c3", 0x800000, 0x875e9fd7, 3 | BRF_GRA }, // 5 - { "265-c4.c4", 0x800000, 0x2da13947, 3 | BRF_GRA }, // 6 - { "265-c5.c5", 0x800000, 0x61bd165d, 3 | BRF_GRA }, // 7 - { "265-c6.c6", 0x800000, 0x03fdd1eb, 3 | BRF_GRA }, // 8 - { "265-c7.c7", 0x800000, 0x1a2749d8, 3 | BRF_GRA }, // 9 - { "265-c8.c8", 0x800000, 0xab0bb549, 3 | BRF_GRA }, // 10 - - { "265-m1.m1", 0x020000, 0x85aaa632, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "265-v1.v1", 0x800000, 0x15e8f3f5, 5 | BRF_SND }, // 12 Sound data - { "265-v2.v2", 0x800000, 0xda41d6f9, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k2mp2, kf2k2mp2, neogeo) -STD_ROM_FN(kf2k2mp2) - -static void kf2k2mp2Callback() -{ - memmove (Neo68KROMActive + 0x000000, Neo68KROMActive + 0x1c0000, 0x040000); - memmove (Neo68KROMActive + 0x0c0000, Neo68KROMActive + 0x100000, 0x040000); - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive + 0x200000, 0x400000); - - lans2004_sx_decode(); -} - -static INT32 kof2km2Init() -{ - INT32 nRet; - - nNeoProtectionXor = 0xEC; - NeoCallbackActive->pInitialise = kf2k2mp2Callback; - - nRet = NeoInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0xa5000, 0x000000, { 0xf9, 0xe0, 0x5d, 0xf3, 0xea, 0x92, 0xbe, 0xef } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkf2k2mp2 = { - "kf2k2mp2", "kof2002", "neogeo", NULL, "2002", - "The King of Fighters 2002 Magic Plus II (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k2mp2RomInfo, kf2k2mp2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2km2Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 10th Anniversary (bootleg) - -static struct BurnRomInfo kof10thRomDesc[] = { - { "kf10-p1.bin", 0x800000, 0xb1fd0c43, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "kf10-c1a.bin", 0x400000, 0x3bbc0364, 3 | BRF_GRA }, // 1 Sprite data - { "kf10-c2a.bin", 0x400000, 0x91230075, 3 | BRF_GRA }, // 2 - { "kf10-c1b.bin", 0x400000, 0xb5abfc28, 3 | BRF_GRA }, // 3 - { "kf10-c2b.bin", 0x400000, 0x6cc4c6e1, 3 | BRF_GRA }, // 4 - { "kf10-c3a.bin", 0x400000, 0x5b3d4a16, 3 | BRF_GRA }, // 5 - { "kf10-c4a.bin", 0x400000, 0xc6f3419b, 3 | BRF_GRA }, // 6 - { "kf10-c3b.bin", 0x400000, 0x9d2bba19, 3 | BRF_GRA }, // 7 - { "kf10-c4b.bin", 0x400000, 0x5a4050cb, 3 | BRF_GRA }, // 8 - { "kf10-c5a.bin", 0x400000, 0xa289d1e1, 3 | BRF_GRA }, // 9 - { "kf10-c6a.bin", 0x400000, 0xe6494b5d, 3 | BRF_GRA }, // 10 - { "kf10-c5b.bin", 0x400000, 0x404fff02, 3 | BRF_GRA }, // 11 - { "kf10-c6b.bin", 0x400000, 0xf2ccfc9e, 3 | BRF_GRA }, // 12 - { "kf10-c7a.bin", 0x400000, 0xbe79c5a8, 3 | BRF_GRA }, // 13 - { "kf10-c8a.bin", 0x400000, 0xa5952ca4, 3 | BRF_GRA }, // 14 - { "kf10-c7b.bin", 0x400000, 0x3fdb3542, 3 | BRF_GRA }, // 15 - { "kf10-c8b.bin", 0x400000, 0x661b7a52, 3 | BRF_GRA }, // 16 - - { "kf10-m1.bin", 0x020000, 0xf6fab859, 4 | BRF_ESS | BRF_PRG }, // 17 Z80 code - - { "kf10-v1.bin", 0x800000, 0x0fc9a58d, 5 | BRF_SND }, // 18 Sound data - { "kf10-v2.bin", 0x800000, 0xb8c475a4, 5 | BRF_SND }, // 19 -}; - -STDROMPICKEXT(kof10th, kof10th, neogeo) -STD_ROM_FN(kof10th) - -static UINT8* kof10thExtraRAMA, *kof10thExtraRAMB; - -static void kof10thBankswitch(UINT32 nBank) -{ - nBank = 0x100000 + ((nBank & 7) << 20); - if (nBank >= 0x700000) { - nBank = 0x100000; - } - - if (nBank != nNeo68KROMBank) { - nNeo68KROMBank = nBank; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2fdfff, MAP_ROM); - } -} - -// Text data extraction, game does this on the fly! -void __fastcall kof10thWriteWordCustom(UINT32 sekAddress, UINT16 wordValue) -{ - if (kof10thExtraRAMB[0x1ffc]) { - NeoUpdateTextOne(((sekAddress >> 1) & 0x1ffff), BITSWAP08(BURN_ENDIAN_SWAP_INT16(wordValue), 3, 2, 1, 5, 7, 6, 0, 4)); - } else { - *(UINT16*)(kof10thExtraRAMA + (sekAddress & 0x1fffe)) = BURN_ENDIAN_SWAP_INT16(wordValue); - } -} - -// 68K Bankswitch and RAM Handlers -void __fastcall kof10thWriteByteBankswitch(UINT32 sekAddress, UINT8 byteValue) -{ - sekAddress ^= 1; - if (sekAddress == 0x2ffff0) - kof10thBankswitch(byteValue); - - kof10thExtraRAMB[sekAddress & 0x1fff] = byteValue; -} - -void __fastcall kof10thWriteWordBankswitch(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress == 0x2ffff0) - kof10thBankswitch(wordValue); - else if (sekAddress == 0x2ffff8 && *(UINT16*)(kof10thExtraRAMB + 0x1ff8) != BURN_ENDIAN_SWAP_INT16(wordValue)) - SekMapMemory(Neo68KROMActive + ((wordValue & 1) ? 0x710000 : 0x010000) , 0x010000, 0x0dffff, MAP_ROM); - - *(UINT16*)(kof10thExtraRAMB + (sekAddress & 0x01ffe)) = wordValue; -} - -static void kof10thCallback() -{ - INT32 i, j, k; - UINT8 *dst = (UINT8*)BurnMalloc(0x100000); - if (dst) - { - for (i = 0; i < 0x800000; i+=0x100000) - { - for (j = 0; j < 0x100000; j++) - { - k = BITSWAP24(j,23,22,21,20,19,18,17,16,15,14,13,12,11,2,9,8,7,1,5,4,3,10,6,0); - dst[k] = Neo68KROMActive[i + j]; - } - memmove (Neo68KROMActive + i, dst, 0x100000); - } - - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive, 0x700000); - memmove (Neo68KROMActive, dst, 0x100000); - BurnFree (dst); - } - - // Altera protection chip patches these over P ROM - *((UINT16 *)(Neo68KROMActive + 0x0124)) = BURN_ENDIAN_SWAP_INT16(0x000d); // Enables XOR for RAM moves, forces SoftDIPs, and USA region - *((UINT16 *)(Neo68KROMActive + 0x0126)) = BURN_ENDIAN_SWAP_INT16(0xf7a8); - - *((UINT16 *)(Neo68KROMActive + 0x8bf4)) = BURN_ENDIAN_SWAP_INT16(0x4ef9); // Run code to change "S" data - *((UINT16 *)(Neo68KROMActive + 0x8bf6)) = BURN_ENDIAN_SWAP_INT16(0x000d); - *((UINT16 *)(Neo68KROMActive + 0x8bf8)) = BURN_ENDIAN_SWAP_INT16(0xf980); -} - -static void kof10thMapBank() -{ - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2fdfff, MAP_ROM); -} - -static INT32 kof10thScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029713; - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = kof10thExtraRAMA; - ba.nLen = 0x00020000; - ba.nAddress = 0; - ba.szName = "Extra RAM A"; - BurnAcb(&ba); - - ba.Data = kof10thExtraRAMB; - ba.nLen = 0x00002000; - ba.nAddress = 0; - ba.szName = "Extra RAM B"; - BurnAcb(&ba); - } - return 0; -} - -static void kof10thInstallHandlers() -{ - // Install RAM handlers - SekMapMemory(kof10thExtraRAMA, 0x0e0000, 0x0fffff, MAP_ROM); // Text RAM on range 0x0e0000 - 0x0fffff - SekMapMemory(kof10thExtraRAMB, 0x2fe000, 0x2fffff, MAP_ROM); // Extra 68K RAM - - // Install bankswitch and text handlers - SekMapHandler(6, 0x2fe000, 0x2fffff, MAP_WRITE); - SekSetWriteWordHandler(6, kof10thWriteWordBankswitch); - SekSetWriteByteHandler(6, kof10thWriteByteBankswitch); - - SekMapHandler(7, 0x200000, 0x23ffff, MAP_WRITE); - SekSetWriteWordHandler(7, kof10thWriteWordCustom); - - // Set bank - nNeo68KROMBank = 1; - kof10thBankswitch(0); -} - -static INT32 kof10thInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = kof10thCallback; - NeoCallbackActive->pInstallHandlers = kof10thInstallHandlers; - NeoCallbackActive->pBankswitch = kof10thMapBank; - NeoCallbackActive->pScan = kof10thScan; - - nNeoTextROMSize[nNeoActiveSlot] = 0x20000; - - nRet = NeoInit(); - - if (nRet == 0) { - kof10thExtraRAMA = Neo68KROMActive + 0x7e0000; - kof10thExtraRAMB = Neo68KROMActive + 0x1fe000; - memset(kof10thExtraRAMA, 0, 0x20000); - memset(kof10thExtraRAMB, 0, 0x02000); - } - - return nRet; -} - -struct BurnDriver BurnDrvkof10th = { - "kof10th", "kof2002", "neogeo", NULL, "2002", - "The King of Fighters 10th Anniversary (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof10thRomInfo, kof10thRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof10thInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 10th Anniversary Extra Plus (bootleg) - -static struct BurnRomInfo kf10thepRomDesc[] = { - { "5008-p1.bin", 0x200000, 0xbf5469ba, 1 | BRF_PRG | BRF_OPT }, // 0 68K code - { "5008-p2.bin", 0x400000, 0xa649ec38, 1 | BRF_ESS | BRF_PRG }, // 1 - { "5008-p3.bin", 0x200000, 0xe629e13c, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "5008-s1.bin", 0x020000, 0x92410064, 2 | BRF_GRA }, // 3 Text layer tiles - - { "kf10-c1a.bin", 0x400000, 0x3bbc0364, 3 | BRF_GRA }, // 4 Sprite data - { "kf10-c2a.bin", 0x400000, 0x91230075, 3 | BRF_GRA }, // 5 - { "kf10-c1b.bin", 0x400000, 0xb5abfc28, 3 | BRF_GRA }, // 6 - { "kf10-c2b.bin", 0x400000, 0x6cc4c6e1, 3 | BRF_GRA }, // 7 - { "kf10-c3a.bin", 0x400000, 0x5b3d4a16, 3 | BRF_GRA }, // 8 - { "kf10-c4a.bin", 0x400000, 0xc6f3419b, 3 | BRF_GRA }, // 9 - { "kf10-c3b.bin", 0x400000, 0x9d2bba19, 3 | BRF_GRA }, // 10 - { "kf10-c4b.bin", 0x400000, 0x5a4050cb, 3 | BRF_GRA }, // 11 - { "kf10-c5a.bin", 0x400000, 0xa289d1e1, 3 | BRF_GRA }, // 12 - { "kf10-c6a.bin", 0x400000, 0xe6494b5d, 3 | BRF_GRA }, // 13 - { "kf10-c5b.bin", 0x400000, 0x404fff02, 3 | BRF_GRA }, // 14 - { "kf10-c6b.bin", 0x400000, 0xf2ccfc9e, 3 | BRF_GRA }, // 15 - { "kf10-c7a.bin", 0x400000, 0xbe79c5a8, 3 | BRF_GRA }, // 16 - { "kf10-c8a.bin", 0x400000, 0xa5952ca4, 3 | BRF_GRA }, // 17 - { "5008-c7b.bin", 0x400000, 0x33604ef0, 3 | BRF_GRA }, // 18 - { "5008-c8b.bin", 0x400000, 0x51f6a8f8, 3 | BRF_GRA }, // 19 - - { "5008-m1.bin", 0x020000, 0x5a47d9ad, 4 | BRF_ESS | BRF_PRG }, // 20 Z80 code - - { "kf10-v1.bin", 0x800000, 0x0fc9a58d, 5 | BRF_SND }, // 21 Sound data - { "kf10-v2.bin", 0x800000, 0xb8c475a4, 5 | BRF_SND }, // 22 -}; - -STDROMPICKEXT(kf10thep, kf10thep, neogeo) -STD_ROM_FN(kf10thep) - -static void kf10thepCallback() -{ - INT32 i; - UINT8 *dst = (UINT8*)BurnMalloc(0x100000); - if (dst) - { - UINT32 sec[8] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD }; - - for (i = 0; i < 8; i++) - memmove (dst + i * 0x20000, Neo68KROMActive + sec[i] * 0x20000, 0x20000); - - memmove (dst + 0x0002e0, Neo68KROMActive + 0x0402e0, 0x06a); - memmove (dst + 0x0f92bc, Neo68KROMActive + 0x0492bc, 0xb9e); - memmove (Neo68KROMActive, dst, 0x100000); - BurnFree (dst); - } - - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive + 0x200000, 0x600000); - - for (i = 0xf92bc; i < 0xf9e58; i += 2) - { - if ((*((UINT16*)(Neo68KROMActive + i + 0)) & 0xffbf) == BURN_ENDIAN_SWAP_INT16(0x4eb9) && *((UINT16*)(Neo68KROMActive + i + 2)) == BURN_ENDIAN_SWAP_INT16(0x0000)) - { - *((UINT16*)(Neo68KROMActive + i + 2)) = BURN_ENDIAN_SWAP_INT16(0x000f); - } - } - - *((UINT16 *)(Neo68KROMActive + 0x00342)) = BURN_ENDIAN_SWAP_INT16(0x000f); - - lans2004_sx_decode(); -} - -static INT32 kf10thepInit() -{ - NeoCallbackActive->pInitialise = kf10thepCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvkf10thep = { - "kf10thep", "kof2002", "neogeo", NULL, "2005", - "The King of Fighters 10th Anniversary Extra Plus (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kf10thepRomInfo, kf10thepRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf10thepInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 10th Anniversary 2005 Unique (bootleg) - -static struct BurnRomInfo kf2k5uniRomDesc[] = { - { "5006-p2a.bin", 0x400000, 0xced883a2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "5006-p1.bin", 0x400000, 0x72c39c46, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5006-s1.bin", 0x020000, 0x91f8c544, 2 | BRF_GRA }, // 2 Text layer tiles - - { "kf10-c1a.bin", 0x400000, 0x3bbc0364, 3 | BRF_GRA }, // 3 Sprite data - { "kf10-c2a.bin", 0x400000, 0x91230075, 3 | BRF_GRA }, // 4 - { "kf10-c1b.bin", 0x400000, 0xb5abfc28, 3 | BRF_GRA }, // 5 - { "kf10-c2b.bin", 0x400000, 0x6cc4c6e1, 3 | BRF_GRA }, // 6 - { "kf10-c3a.bin", 0x400000, 0x5b3d4a16, 3 | BRF_GRA }, // 7 - { "kf10-c4a.bin", 0x400000, 0xc6f3419b, 3 | BRF_GRA }, // 8 - { "kf10-c3b.bin", 0x400000, 0x9d2bba19, 3 | BRF_GRA }, // 9 - { "kf10-c4b.bin", 0x400000, 0x5a4050cb, 3 | BRF_GRA }, // 10 - { "kf10-c5a.bin", 0x400000, 0xa289d1e1, 3 | BRF_GRA }, // 11 - { "kf10-c6a.bin", 0x400000, 0xe6494b5d, 3 | BRF_GRA }, // 12 - { "kf10-c5b.bin", 0x400000, 0x404fff02, 3 | BRF_GRA }, // 13 - { "kf10-c6b.bin", 0x400000, 0xf2ccfc9e, 3 | BRF_GRA }, // 14 - { "kf10-c7a.bin", 0x400000, 0xbe79c5a8, 3 | BRF_GRA }, // 15 - { "kf10-c8a.bin", 0x400000, 0xa5952ca4, 3 | BRF_GRA }, // 16 - { "kf10-c7b.bin", 0x400000, 0x3fdb3542, 3 | BRF_GRA }, // 17 - { "kf10-c8b.bin", 0x400000, 0x661b7a52, 3 | BRF_GRA }, // 18 - - { "5006-m1.bin", 0x020000, 0x9050bfe7, 4 | BRF_ESS | BRF_PRG }, // 19 Z80 code - - { "kf10-v1.bin", 0x800000, 0x0fc9a58d, 5 | BRF_SND }, // 20 Sound data - { "kf10-v2.bin", 0x800000, 0xb8c475a4, 5 | BRF_SND }, // 21 -}; - -STDROMPICKEXT(kf2k5uni, kf2k5uni, neogeo) -STD_ROM_FN(kf2k5uni) - -static void kf2k5uniCallback() -{ - INT32 i, j, k; - UINT8 dst[0x80]; - - for (i = 0; i < 0x800000; i+=0x80) - { - for (j = 0; j < 0x80; j++) - { - k = BITSWAP08(j, 7, 3, 4, 5, 6, 1, 2, 0); - dst[j] = Neo68KROMActive[i + k]; - } - memmove (Neo68KROMActive + i, dst, 0x80); - } - - memmove(Neo68KROMActive, Neo68KROMActive + 0x600000, 0x100000); - - for (i = 0; i < 0x30000; i++) - NeoZ80ROMActive[i] = BITSWAP08(NeoZ80ROMActive[i], 4, 5, 6, 7, 0, 1, 2, 3); - - for (i = 0; i < 0x20000; i++) - NeoTextROM[nNeoActiveSlot][i] = BITSWAP08(NeoTextROM[nNeoActiveSlot][i], 4, 5, 6, 7, 0, 1, 2, 3); -} - -static INT32 kf2k5uniInit() -{ - NeoCallbackActive->pInitialise = kf2k5uniCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvkf2k5uni = { - "kf2k5uni", "kof2002", "neogeo", NULL, "2004", - "The King of Fighters 10th Anniversary 2005 Unique (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k5uniRomInfo, kf2k5uniRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k5uniInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters Special Edition 2004 (bootleg) - -static struct BurnRomInfo kof2k4seRomDesc[] = { - { "k2k4s-p1.bin", 0x400000, 0xe6c50566, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "k2k4s-p2.bin", 0x080000, 0x21a84084, 1 | BRF_ESS | BRF_PRG }, // 1 - { "k2k4s-p3.bin", 0x080000, 0xfebb484e, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "k2k4s-s1.bin", 0x020000, 0xa3c9b2d8, 2 | BRF_GRA }, // 3 Text layer tiles - - { "k2k4s-c4.bin", 0x800000, 0x7a050288, 3 | BRF_GRA }, // 4 Sprite data - { "k2k4s-c8.bin", 0x800000, 0xe924afcf, 3 | BRF_GRA }, // 5 - { "k2k4s-c3.bin", 0x800000, 0x959fad0b, 3 | BRF_GRA }, // 6 - { "k2k4s-c7.bin", 0x800000, 0xefe6a468, 3 | BRF_GRA }, // 7 - { "k2k4s-c2.bin", 0x800000, 0x74bba7c6, 3 | BRF_GRA }, // 8 - { "k2k4s-c6.bin", 0x800000, 0xe20d2216, 3 | BRF_GRA }, // 9 - { "k2k4s-c1.bin", 0x800000, 0xfa705b2b, 3 | BRF_GRA }, // 10 - { "k2k4s-c5.bin", 0x800000, 0x2c912ff9, 3 | BRF_GRA }, // 11 - - { "k2k4s-m1.bin", 0x020000, 0x5a47d9ad, 4 | BRF_ESS | BRF_PRG }, // 12 Z80 code - - { "k2k4s-v2.bin", 0x800000, 0xe4ddfb3f, 5 | BRF_SND }, // 13 Sound data - { "k2k4s-v1.bin", 0x800000, 0xb887d287, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(kof2k4se, kof2k4se, neogeo) -STD_ROM_FN(kof2k4se) - -static void kof2k4seCallback() -{ - UINT8 *dst = (UINT8*)BurnMalloc(0x100000); - - if (dst) - { - memmove (dst, Neo68KROMActive + 0x000000, 0x100000); - memmove (Neo68KROMActive + 0x000000, Neo68KROMActive + 0x400000, 0x100000); - memmove (Neo68KROMActive + 0x400000, dst, 0x100000); - memmove (dst, Neo68KROMActive + 0x100000, 0x100000); - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive + 0x300000, 0x100000); - memmove (Neo68KROMActive + 0x300000, dst, 0x100000); - - BurnFree (dst); - } -} - -static INT32 kof2k4seInit() -{ - NeoCallbackActive->pInitialise = kof2k4seCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvkof2k4se = { - "kof2k4se", "kof2002", "neogeo", NULL, "2004", - "The King of Fighters Special Edition 2004 (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof2k4seRomInfo, kof2k4seRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2k4seInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Metal Slug 5 (NGM-2680) -/* Encrypted Set */ /* MVS VERSION */ - -static struct BurnRomInfo mslug5RomDesc[] = { - { "268-p1cr.p1", 0x400000, 0xd0466792, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "268-p2cr.p2", 0x400000, 0xfbf6b61e, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "268-c1c.c1", 0x800000, 0xab7c389a, 3 | BRF_GRA }, // 2 Sprite data - { "268-c2c.c2", 0x800000, 0x3560881b, 3 | BRF_GRA }, // 3 - { "268-c3c.c3", 0x800000, 0x3af955ea, 3 | BRF_GRA }, // 4 - { "268-c4c.c4", 0x800000, 0xc329c373, 3 | BRF_GRA }, // 5 - { "268-c5c.c5", 0x800000, 0x959c8177, 3 | BRF_GRA }, // 6 - { "268-c6c.c6", 0x800000, 0x010a831b, 3 | BRF_GRA }, // 7 - { "268-c7c.c7", 0x800000, 0x6d72a969, 3 | BRF_GRA }, // 8 - { "268-c8c.c8", 0x800000, 0x551d720e, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "268-m1.m1", 0x080000, 0x4a5a6e0e, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "268-v1c.v1", 0x800000, 0xae31d60c, 5 | BRF_SND }, // 11 Sound data - { "268-v2c.v2", 0x800000, 0xc40613ed, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(mslug5, mslug5, neogeo) -STD_ROM_FN(mslug5) - -static void mslug5Callback() -{ - INT32 i, j, k; - for (i = 0; i < 0x100000; i++) - Neo68KROMActive[i] ^= Neo68KROMActive[0x0fffe0 + (i & 0x1f)]; - - for (i = 0x100000; i < 0x700000; i++) - Neo68KROMActive[i] ^= ~Neo68KROMActive[0x7fffe0 + (i & 0x1f)]; - - for (i = 0x100000; i < 0x0500000; i += 4) - { - UINT16 rom16 = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(Neo68KROMActive + i + 1))); - rom16 = BITSWAP16(rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0); - *((UINT16 *)(Neo68KROMActive + i + 1)) = BURN_ENDIAN_SWAP_INT16(rom16); - } - - memmove (Neo68KROMActive + 0x700000, Neo68KROMActive, 0x100000); - - for (i = 0; i < 0x100000 / 0x010000; i++) - { - j = BITSWAP08(i, 7, 6, 5, 4, 1, 0, 3, 2) * 0x010000; - memmove (Neo68KROMActive + i * 0x010000, Neo68KROMActive + 0x700000 + j, 0x010000); - } - - for (i = 0x100000; i < 0x700000; i += 0x100000) - { - for (j = 0; j < 0x100000; j+=0x100) - { - k = ((j & 0xf00) ^ 0x700) + (BITSWAP08((j >> 12), 5, 4, 7, 6, 1, 0, 3, 2 ) << 12); - memmove (Neo68KROMActive + 0x700000 + j, Neo68KROMActive + i + k, 0x100); - } - - memmove (Neo68KROMActive + i, Neo68KROMActive + 0x700000, 0x100000); - } -} - -static INT32 mslug5Init() -{ - INT32 nRet; - - nNeoProtectionXor = 0x19; - NeoCallbackActive->pInitialise = mslug5Callback; - - nRet = NeoPVCInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0x4e001, 0xfe2cf6, { 0xc3, 0xfd, 0x81, 0xac, 0x6d, 0xe7, 0xbf, 0x9e } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvmslug5 = { - "mslug5", NULL, "neogeo", NULL, "2003", - "Metal Slug 5 (NGM-2680)\0", NULL, "SNK Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_P32 | HARDWARE_SNK_ENCRYPTED_M1, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug5RomInfo, mslug5RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug5Init, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Metal Slug 5 (NGH-2680) -/* Encrypted Set */ /* AES release of the game but is also found in later MVS carts */ - -static struct BurnRomInfo mslug5hRomDesc[] = { - { "268-p1c.p1", 0x400000, 0x3636690a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "268-p2c.p2", 0x400000, 0x8dfc47a2, 1 | BRF_ESS | BRF_PRG }, // 1 - /* also found AES set with P1 / P2 on mask rom on PROG board NEO-AEG PROGBK3S (2003.6.10); - chip labels are 268-P1CR2 and 268-P2CR2 - and M1 on eprom M27C4001 with label sticker 268-M1 on CHA board NEO-MVS CHAFIO (2003.7.24) (NEO-CMC 7050) */ - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "268-c1c.c1", 0x800000, 0xab7c389a, 3 | BRF_GRA }, // 2 Sprite data - { "268-c2c.c2", 0x800000, 0x3560881b, 3 | BRF_GRA }, // 3 - { "268-c3c.c3", 0x800000, 0x3af955ea, 3 | BRF_GRA }, // 4 - { "268-c4c.c4", 0x800000, 0xc329c373, 3 | BRF_GRA }, // 5 - { "268-c5c.c5", 0x800000, 0x959c8177, 3 | BRF_GRA }, // 6 - { "268-c6c.c6", 0x800000, 0x010a831b, 3 | BRF_GRA }, // 7 - { "268-c7c.c7", 0x800000, 0x6d72a969, 3 | BRF_GRA }, // 8 - { "268-c8c.c8", 0x800000, 0x551d720e, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "268-m1.m1", 0x080000, 0x4a5a6e0e, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "268-v1c.v1", 0x800000, 0xae31d60c, 5 | BRF_SND }, // 11 Sound data - { "268-v2c.v2", 0x800000, 0xc40613ed, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(mslug5h, mslug5h, neogeo) -STD_ROM_FN(mslug5h) - -struct BurnDriver BurnDrvmslug5h = { - "mslug5h", "mslug5", "neogeo", NULL, "2003", - "Metal Slug 5 (NGH-2680)\0", NULL, "SNK Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_P32 | HARDWARE_SNK_ENCRYPTED_M1, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug5hRomInfo, mslug5hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug5Init, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Metal Slug 5 (JAMMA PCB) - -static struct BurnRomInfo ms5pcbRomDesc[] = { - { "268-p1r.p1", 0x400000, 0xd0466792, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "268-p2r.p2", 0x400000, 0xfbf6b61e, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "268-c1.c1", 0x1000000, 0x802042e8, 3 | BRF_GRA }, // 2 Sprite data - { "268-c2.c2", 0x1000000, 0x3b89fb9f, 3 | BRF_GRA }, // 3 - { "268-c3.c3", 0x1000000, 0x0f3f59e3, 3 | BRF_GRA }, // 4 - { "268-c4.c4", 0x1000000, 0x3ad8435a, 3 | BRF_GRA }, // 5 - - { "268-m1.m1", 0x080000, 0x4a5a6e0e, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "268-v1.v1", 0x1000000, 0x8458afe5, 5 | BRF_SND }, // 7 Sound data -}; - -STDROMPICKEXT(ms5pcb, ms5pcb, ms5pcbBIOS) -STD_ROM_FN(ms5pcb) - -struct BurnDriver BurnDrvms5pcb = { - "ms5pcb", NULL, NULL, NULL, "2003", - "Metal Slug 5 (JAMMA PCB)\0", NULL, "SNK Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SNK_DEDICATED_PCB | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_P32 | HARDWARE_SNK_ENCRYPTED_M1, GBF_PLATFORM, FBF_MSLUG, - NULL, ms5pcbRomInfo, ms5pcbRomName, NULL, NULL, neogeoInputInfo, ms5pcbDIPInfo, - mslug5Init, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Metal Slug 5 Plus (bootleg) - -static struct BurnRomInfo ms5plusRomDesc[] = { - { "ms5-p1p.bin", 0x100000, 0x106b276f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "ms5-p2p.bin", 0x200000, 0xd6a458e8, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ms5-p3p.bin", 0x200000, 0x439ec031, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "ms5-s1p.bin", 0x020000, 0x21e04432, 2 | BRF_GRA }, // 3 Text layer tiles - - { "268-c1c.c1", 0x800000, 0xab7c389a, 3 | BRF_GRA }, // 4 Sprite data - { "268-c2c.c2", 0x800000, 0x3560881b, 3 | BRF_GRA }, // 5 - { "268-c3c.c3", 0x800000, 0x3af955ea, 3 | BRF_GRA }, // 6 - { "268-c4c.c4", 0x800000, 0xc329c373, 3 | BRF_GRA }, // 7 - { "268-c5c.c5", 0x800000, 0x959c8177, 3 | BRF_GRA }, // 8 - { "268-c6c.c6", 0x800000, 0x010a831b, 3 | BRF_GRA }, // 9 - { "268-c7c.c7", 0x800000, 0x6d72a969, 3 | BRF_GRA }, // 10 - { "268-c8c.c8", 0x800000, 0x551d720e, 3 | BRF_GRA }, // 11 - - { "268-m1.m1", 0x080000, 0x4a5a6e0e, 4 | BRF_ESS | BRF_PRG }, // 12 Z80 code - - { "268-v1c.v1", 0x800000, 0xae31d60c, 5 | BRF_SND }, // 13 Sound data - { "268-v2c.v2", 0x800000, 0xc40613ed, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(ms5plus, ms5plus, neogeo) -STD_ROM_FN(ms5plus) - -void __fastcall ms5plusWriteWordBankSwitch(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress==0x2ffff4) - { - UINT32 nBank = wordValue << 16; - if (nNeo68KROMBank != nBank) - { - nNeo68KROMBank = nBank; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2fdfff, MAP_ROM); - } - }; -} - -static void ms5plusInstallHandlers() -{ - SekMapHandler(6, 0x2fe000, 0x2fffff, MAP_WRITE); - SekSetWriteWordHandler(6, ms5plusWriteWordBankSwitch); -} - -static INT32 ms5plusInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = lans2004_sx_decode; - NeoCallbackActive->pInstallHandlers = ms5plusInstallHandlers; - NeoCallbackActive->pBankswitch = NeoPVCMapBank; - nNeoProtectionXor = 0x19; - - nRet = NeoInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0x4e001, 0xfe2cf6, { 0xc3, 0xfd, 0x81, 0xac, 0x6d, 0xe7, 0xbf, 0x9e } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvms5plus = { - "ms5plus", "mslug5", "neogeo", NULL, "2003", - "Metal Slug 5 Plus (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_ENCRYPTED_M1, GBF_PLATFORM, FBF_MSLUG, - NULL, ms5plusRomInfo, ms5plusRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - ms5plusInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 1) - -static struct BurnRomInfo svcpcbRomDesc[] = { - { "269-p1.p1", 0x2000000, 0x432cfdfc, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "269-c1.c1", 0x2000000, 0x1b608f9c, 3 | BRF_GRA }, // 1 Sprite data - { "269-c2.c2", 0x2000000, 0x5a95f294, 3 | BRF_GRA }, // 2 - - { "269-m1.m1", 0x080000, 0xf6819d00, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "269-v1.v1", 0x800000, 0xc659b34c, 5 | BRF_SND }, // 5 Sound data - { "269-v2.v2", 0x800000, 0xdd903835, 5 | BRF_SND }, // 6 -}; - -STDROMPICKEXT(svcpcb, svcpcb, svcpcbBIOS) -STD_ROM_FN(svcpcb) - -static void svcCallback() -{ - INT32 i, j, k; - for (i = 0; i < 0x100000; i++) - Neo68KROMActive[i] ^= ~Neo68KROMActive[0x0fffe0 + (i & 0x1f)]; - - for (i = 0x100000; i < 0x800000; i++) - Neo68KROMActive[i] ^= ~Neo68KROMActive[0x7fffe0 + (i & 0x1f)]; - - for (i = 0x100000; i < 0x0600000; i+=4) - { - UINT16 rom16 = *((UINT16 *)(Neo68KROMActive + i + 1)); - rom16 = BITSWAP16(BURN_ENDIAN_SWAP_INT16(rom16), 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0); - *((UINT16 *)(Neo68KROMActive + i + 1)) = BURN_ENDIAN_SWAP_INT16(rom16); - } - - memmove (Neo68KROMActive + 0x700000, Neo68KROMActive, 0x100000); - - for (i = 0; i < 0x0100000 / 0x10000; i++) - { - j = BITSWAP08(i, 7, 6, 5, 4, 2, 3, 0, 1); - memmove (Neo68KROMActive + i * 0x010000, Neo68KROMActive + 0x700000 + j * 0x010000, 0x010000); - } - - for (i = 0x100000; i < 0x700000; i += 0x100000) - { - for (j = 0; j < 0x100000; j+= 0x100) - { - k = BITSWAP08(j >> 12, 4, 5, 6, 7, 1, 0, 3, 2 ) << 12; - k |= (j & 0x00f00) ^ 0x00a00; - - memmove (Neo68KROMActive + 0x700000 + j, Neo68KROMActive + i + k, 0x100); - } - - memmove (Neo68KROMActive + i, Neo68KROMActive + 0x700000, 0x100000); - } -} - -static INT32 svcpcbInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0x57; - NeoCallbackActive->pInitialise = svcCallback; - - nRet = NeoPVCInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0xC2000, 0xFFAC28, { 0xC3, 0xFD, 0x81, 0xAC, 0x6D, 0xE7, 0xBF, 0x9E } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvsvcpcb = { - "svcpcb", NULL, NULL, NULL, "2003", - "SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 1)\0", NULL, "SNK Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SNK_DEDICATED_PCB | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF | FBF_SF, - NULL, svcpcbRomInfo, svcpcbRomName, NULL, NULL, neogeoInputInfo, svcpcbDIPInfo, - svcpcbInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 2) - -static struct BurnRomInfo svcpcbaRomDesc[] = { - /* alt PCB version, this one has the same program roms as the MVS set, and different GFX / Sound rom arrangements */ - { "269-p1a.p1", 0x400000, 0x38e2005e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "269-p2a.p2", 0x400000, 0x6d13797c, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "269-c1a.c1", 0x1000000, 0xe64d2b0c, 3 | BRF_GRA }, // 2 Sprite data - { "269-c2a.c2", 0x1000000, 0x249089c2, 3 | BRF_GRA }, // 3 - { "269-c3a.c3", 0x1000000, 0xd32f2fab, 3 | BRF_GRA }, // 4 - { "269-c4a.c4", 0x1000000, 0xbf77e878, 3 | BRF_GRA }, // 5 - - { "269-m1.m1", 0x080000, 0xf6819d00, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "269-v1a.v1", 0x1000000, 0xa6af4753, 5 | BRF_SND }, // 7 Sound data -}; - -STDROMPICKEXT(svcpcba, svcpcba, svcpcbBIOS) -STD_ROM_FN(svcpcba) - -struct BurnDriver BurnDrvsvcpcba = { - "svcpcba", "svcpcb", NULL, NULL, "2003", - "SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 2)\0", NULL, "SNK Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SNK_DEDICATED_PCB | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_P32 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF | FBF_SF, - NULL, svcpcbaRomInfo, svcpcbaRomName, NULL, NULL, neogeoInputInfo, svcpcbDIPInfo, - svcpcbInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// SNK vs. Capcom - SVC Chaos (NGM-2690)(NGH-2690) -/* Encrypted Set */ /* MVS AND AES VERSION */ - -static struct BurnRomInfo svcRomDesc[] = { - { "269-p1.p1", 0x400000, 0x38e2005e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "269-p2.p2", 0x400000, 0x6d13797c, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "269-c1r.c1", 0x800000, 0x887b4068, 3 | BRF_GRA }, // 2 Sprite data - { "269-c2r.c2", 0x800000, 0x4e8903e4, 3 | BRF_GRA }, // 3 - { "269-c3r.c3", 0x800000, 0x7d9c55b0, 3 | BRF_GRA }, // 4 - { "269-c4r.c4", 0x800000, 0x8acb5bb6, 3 | BRF_GRA }, // 5 - { "269-c5r.c5", 0x800000, 0x097a4157, 3 | BRF_GRA }, // 6 - { "269-c6r.c6", 0x800000, 0xe19df344, 3 | BRF_GRA }, // 7 - { "269-c7r.c7", 0x800000, 0xd8f0340b, 3 | BRF_GRA }, // 8 - { "269-c8r.c8", 0x800000, 0x2570b71b, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "269-m1.m1", 0x080000, 0xf6819d00, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "269-v1.v1", 0x800000, 0xc659b34c, 5 | BRF_SND }, // 11 Sound data - { "269-v2.v2", 0x800000, 0xdd903835, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(svc, svc, neogeo) -STD_ROM_FN(svc) - -struct BurnDriver BurnDrvsvc = { - "svc", NULL, "neogeo", NULL, "2003", - "SNK vs. Capcom - SVC Chaos (NGM-2690)(NGH-2690)\0", NULL, "SNK Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_P32 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF | FBF_SF, - NULL, svcRomInfo, svcRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - svcpcbInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// SNK vs. Capcom - SVC Chaos (bootleg) - -static struct BurnRomInfo svcbootRomDesc[] = { - { "svc-p1.bin", 0x800000, 0x0348f162, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "svc-s1.bin", 0x020000, 0x70b44df1, 2 | BRF_GRA }, // 1 Text layer tiles - - { "svc-c1.bin", 0x800000, 0xa7826b89, 3 | BRF_GRA }, // 2 Sprite data - { "svc-c2.bin", 0x800000, 0xed3c2089, 3 | BRF_GRA }, // 3 - { "svc-c3.bin", 0x800000, 0x71ed8063, 3 | BRF_GRA }, // 4 - { "svc-c4.bin", 0x800000, 0x250bde2d, 3 | BRF_GRA }, // 5 - { "svc-c5.bin", 0x800000, 0x9817c082, 3 | BRF_GRA }, // 6 - { "svc-c6.bin", 0x800000, 0x2bc0307f, 3 | BRF_GRA }, // 7 - { "svc-c7.bin", 0x800000, 0x4358d7b9, 3 | BRF_GRA }, // 8 - { "svc-c8.bin", 0x800000, 0x366deee5, 3 | BRF_GRA }, // 9 - - { "svc-m1.bin", 0x020000, 0x804328c3, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "svc-v2.bin", 0x400000, 0xb5097287, 5 | BRF_SND }, // 11 Sound data - { "svc-v1.bin", 0x400000, 0xbd3a391f, 5 | BRF_SND }, // 12 - { "svc-v4.bin", 0x400000, 0x33fc0b37, 5 | BRF_SND }, // 13 - { "svc-v3.bin", 0x400000, 0xaa9849a0, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(svcboot, svcboot, neogeo) -STD_ROM_FN(svcboot) - -static void svcboot_sx_decode() -{ - for (INT32 i = 0; i < 0x20000 / 2; i++) { - INT32 n = NeoTextROM[nNeoActiveSlot][i]; - NeoTextROM[nNeoActiveSlot][i] = NeoTextROM[nNeoActiveSlot][0x10000 + i]; - NeoTextROM[nNeoActiveSlot][0x10000 + i] = n; - } -} - -static void svcboot_decode() -{ - DoPerm(1); - - for (INT32 i = 0; i < 0x20000 / 2; i++) { - INT32 n = NeoZ80ROMActive[i]; - NeoZ80ROMActive[i] = NeoZ80ROMActive[0x10000 + i]; - NeoZ80ROMActive[0x10000 + i] = n; - } -} - -static void svcbootCallback() -{ - INT32 i, j, k; - for (i = 0x100000; i < 0x800000; i+=0x100000) - { - memmove (Neo68KROMActive, Neo68KROMActive + i, 0x100000); - - for (j = 0; j < 0x100000; j++) - { - k = (j & 0xfff00) + BITSWAP08(j, 7, 2, 1, 4, 3, 6, 5, 0); - Neo68KROMActive[i + j] = Neo68KROMActive[k]; - } - } - - memmove (Neo68KROMActive, Neo68KROMActive + 0x700000, 0x100000); - - svcboot_sx_decode(); - svcboot_decode(); -} - - -static INT32 svcbootInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = svcbootCallback; - - nRet = NeoPVCInit(); - - if (nRet == 0) { - BurnByteswap(YM2610ADPCMAROM[nNeoActiveSlot], 0x1000000); - } - - return nRet; -} - -struct BurnDriver BurnDrvsvcboot = { - "svcboot", "svc", "neogeo", NULL, "2003", - "SNK vs. Capcom - SVC Chaos (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF | FBF_SF, - NULL, svcbootRomInfo, svcbootRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - svcbootInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// SNK vs. Capcom - SVC Chaos Plus (bootleg set 1) - -static struct BurnRomInfo svcplusRomDesc[] = { - { "svc-p2p.bin", 0x200000, 0x50c0e2b7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "svc-p3p.bin", 0x200000, 0x58cdc293, 1 | BRF_ESS | BRF_PRG }, // 1 - { "svc-p1p.bin", 0x200000, 0xa194d842, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "svc-s1p.bin", 0x020000, 0x73344711, 2 | BRF_GRA }, // 3 Text layer tiles - - { "svc-c1.bin", 0x800000, 0xa7826b89, 3 | BRF_GRA }, // 4 Sprite data - { "svc-c2.bin", 0x800000, 0xed3c2089, 3 | BRF_GRA }, // 5 - { "svc-c3.bin", 0x800000, 0x71ed8063, 3 | BRF_GRA }, // 6 - { "svc-c4.bin", 0x800000, 0x250bde2d, 3 | BRF_GRA }, // 7 - { "svc-c5.bin", 0x800000, 0x9817c082, 3 | BRF_GRA }, // 8 - { "svc-c6.bin", 0x800000, 0x2bc0307f, 3 | BRF_GRA }, // 9 - { "svc-c7.bin", 0x800000, 0x4358d7b9, 3 | BRF_GRA }, // 10 - { "svc-c8.bin", 0x800000, 0x366deee5, 3 | BRF_GRA }, // 11 - - { "svc-m1.bin", 0x020000, 0x804328c3, 4 | BRF_ESS | BRF_PRG }, // 12 Z80 code - - { "svc-v2.bin", 0x400000, 0xb5097287, 5 | BRF_SND }, // 13 Sound data - { "svc-v1.bin", 0x400000, 0xbd3a391f, 5 | BRF_SND }, // 14 - { "svc-v4.bin", 0x400000, 0x33fc0b37, 5 | BRF_SND }, // 15 - { "svc-v3.bin", 0x400000, 0xaa9849a0, 5 | BRF_SND }, // 16 -}; - -STDROMPICKEXT(svcplus, svcplus, neogeo) -STD_ROM_FN(svcplus) - -static void svcplusCallback() -{ - INT32 i, j, k; - UINT8 *dst = (UINT8*)BurnMalloc(0x100000); - - if (dst) - { - for (i = 0; i < 0x600000; i+= 0x100000) - { - for (j = 0; j < 0x100000; j++) - { - k = BITSWAP24(j, 23,22,21,20,1,2,3,16,15,14,13,12,11,10,9,8,7,6,5,4,17,18,19,0); - k ^= 0x0e000e; - - dst[j] = Neo68KROMActive[i + k]; - } - - memmove (Neo68KROMActive + i, dst, 0x100000); - } - - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive, 0x500000); - memmove (Neo68KROMActive, dst, 0x100000); - - BurnFree (dst); - } - - *((UINT16*)(Neo68KROMActive + 0xf8016)) = BURN_ENDIAN_SWAP_INT16(0x33c1); // Patch protected address - - lans2004_sx_decode(); - svcboot_decode(); -} - -static INT32 svcplusInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = svcplusCallback; - - nRet = NeoInit(); - - if (nRet == 0) { - BurnByteswap(YM2610ADPCMAROM[nNeoActiveSlot], 0x1000000); - } - - return nRet; -} - -struct BurnDriver BurnDrvsvcplus = { - "svcplus", "svc", "neogeo", NULL, "2003", - "SNK vs. Capcom - SVC Chaos Plus (bootleg set 1)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF | FBF_SF, - NULL, svcplusRomInfo, svcplusRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - svcplusInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// SNK vs. Capcom - SVC Chaos Plus (bootleg set 2) - -static struct BurnRomInfo svcplusaRomDesc[] = { - { "svc-p2pl.bin", 0x400000, 0x7231ace2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "svc-p1pl.bin", 0x200000, 0x16b44144, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "svc-s1pl.bin", 0x020000, 0xca3c735e, 2 | BRF_GRA }, // 2 Text layer tiles - - { "svc-c1.bin", 0x800000, 0xa7826b89, 3 | BRF_GRA }, // 3 Sprite data - { "svc-c2.bin", 0x800000, 0xed3c2089, 3 | BRF_GRA }, // 4 - { "svc-c3.bin", 0x800000, 0x71ed8063, 3 | BRF_GRA }, // 5 - { "svc-c4.bin", 0x800000, 0x250bde2d, 3 | BRF_GRA }, // 6 - { "svc-c5.bin", 0x800000, 0x9817c082, 3 | BRF_GRA }, // 7 - { "svc-c6.bin", 0x800000, 0x2bc0307f, 3 | BRF_GRA }, // 8 - { "svc-c7.bin", 0x800000, 0x4358d7b9, 3 | BRF_GRA }, // 9 - { "svc-c8.bin", 0x800000, 0x366deee5, 3 | BRF_GRA }, // 10 - - { "svc-m1.bin", 0x020000, 0x804328c3, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "svc-v2.bin", 0x400000, 0xb5097287, 5 | BRF_SND }, // 12 Sound data - { "svc-v1.bin", 0x400000, 0xbd3a391f, 5 | BRF_SND }, // 13 - { "svc-v4.bin", 0x400000, 0x33fc0b37, 5 | BRF_SND }, // 14 - { "svc-v3.bin", 0x400000, 0xaa9849a0, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(svcplusa, svcplusa, neogeo) -STD_ROM_FN(svcplusa) - -static void svcplusaCallback() -{ - UINT8 *dst = (UINT8*)BurnMalloc(0x100000); - if (dst) - { - memmove (dst, Neo68KROMActive + 0x500000, 0x100000); - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive, 0x500000); - memmove (Neo68KROMActive, dst, 0x100000); - BurnFree (dst); - dst = NULL; - } - - *((UINT16*)(Neo68KROMActive + 0xf8016)) = BURN_ENDIAN_SWAP_INT16(0x33c1); // Patch protected address - - svcboot_sx_decode(); - svcboot_decode(); -} - -static INT32 svcplusaInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = svcplusaCallback; - - nRet = NeoInit(); - - if (nRet == 0) { - BurnByteswap(YM2610ADPCMAROM[nNeoActiveSlot], 0x1000000); - } - - return nRet; -} - -struct BurnDriver BurnDrvsvcplusa = { - "svcplusa", "svc", "neogeo", NULL, "2003", - "SNK vs. Capcom - SVC Chaos Plus (bootleg set 2)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF | FBF_SF, - NULL, svcplusaRomInfo, svcplusaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - svcplusaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// SNK vs. Capcom - SVC Chaos Super Plus (bootleg) - -static struct BurnRomInfo svcsplusRomDesc[] = { - { "svc-p1sp.bin", 0x400000, 0x2601902f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "svc-p2sp.bin", 0x400000, 0x0ca13305, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "svc-s1sp.bin", 0x020000, 0x233d6439, 2 | BRF_GRA }, // 2 Text layer tiles - - { "svc-c1.bin", 0x800000, 0xa7826b89, 3 | BRF_GRA }, // 3 Sprite data - { "svc-c2.bin", 0x800000, 0xed3c2089, 3 | BRF_GRA }, // 4 - { "svc-c3.bin", 0x800000, 0x71ed8063, 3 | BRF_GRA }, // 5 - { "svc-c4.bin", 0x800000, 0x250bde2d, 3 | BRF_GRA }, // 6 - { "svc-c5.bin", 0x800000, 0x9817c082, 3 | BRF_GRA }, // 7 - { "svc-c6.bin", 0x800000, 0x2bc0307f, 3 | BRF_GRA }, // 8 - { "svc-c7.bin", 0x800000, 0x4358d7b9, 3 | BRF_GRA }, // 9 - { "svc-c8.bin", 0x800000, 0x366deee5, 3 | BRF_GRA }, // 10 - - { "svc-m1.bin", 0x020000, 0x804328c3, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "svc-v2.bin", 0x400000, 0xb5097287, 5 | BRF_SND }, // 12 Sound data - { "svc-v1.bin", 0x400000, 0xbd3a391f, 5 | BRF_SND }, // 13 - { "svc-v4.bin", 0x400000, 0x33fc0b37, 5 | BRF_SND }, // 14 - { "svc-v3.bin", 0x400000, 0xaa9849a0, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(svcsplus, svcsplus, neogeo) -STD_ROM_FN(svcsplus) - -static void svcsplus_sx_decode() -{ - for (INT32 i = 0; i < 0x20000; i++) - NeoTextROM[nNeoActiveSlot][i] = BITSWAP08(NeoTextROM[nNeoActiveSlot][i], 7, 6, 0, 4, 3, 2, 1, 5); -} - -static void svcsplusCallback() -{ - INT32 i, j, k; - for (i = 0x100000; i < 0x800000; i+=0x10000) - { - memmove (Neo68KROMActive, Neo68KROMActive + i, 0x10000); - - for (j = 0; j < 0x10000; j++) - { - k = BITSWAP16(j, 1, 9, 10, 12, 11, 13, 14, 5, 4, 2, 8, 7, 3, 6, 15, 0); - Neo68KROMActive[i + j] = Neo68KROMActive[k]; - } - } - - memmove (Neo68KROMActive, Neo68KROMActive + 0x600000, 0x100000); - - *((UINT16*)(Neo68KROMActive + 0x9e90)) = BURN_ENDIAN_SWAP_INT16(0x000f); // Enable S. Plus - *((UINT16*)(Neo68KROMActive + 0x9e92)) = BURN_ENDIAN_SWAP_INT16(0xc9c0); - *((UINT16*)(Neo68KROMActive + 0xa10c)) = BURN_ENDIAN_SWAP_INT16(0x4eb9); // Enable boss icons - *((UINT16*)(Neo68KROMActive + 0xa10e)) = BURN_ENDIAN_SWAP_INT16(0x000e); - *((UINT16*)(Neo68KROMActive + 0xa110)) = BURN_ENDIAN_SWAP_INT16(0x9750); - - svcsplus_sx_decode(); - svcboot_decode(); -} - -static INT32 svcsplusInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = svcsplusCallback; - - nRet = NeoPVCInit(); - - if (nRet == 0) { - BurnByteswap(YM2610ADPCMAROM[nNeoActiveSlot], 0x1000000); - } - - return nRet; -} - -struct BurnDriver BurnDrvsvcsplus = { - "svcsplus", "svc", "neogeo", NULL, "2003", - "SNK vs. Capcom - SVC Chaos Super Plus (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF | FBF_SF, - NULL, svcsplusRomInfo, svcsplusRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - svcsplusInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown V / Samurai Spirits Zero (NGM-2700) -/* Encrypted Set */ /* MVS VERSION */ - -static struct BurnRomInfo samsho5RomDesc[] = { - { "270-p1.p1", 0x400000, 0x4a2a09e6, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "270-p2.sp2", 0x400000, 0xe0c74c85, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "270-c1.c1", 0x800000, 0x14ffffac, 3 | BRF_GRA }, // 2 Sprite data - { "270-c2.c2", 0x800000, 0x401f7299, 3 | BRF_GRA }, // 3 - { "270-c3.c3", 0x800000, 0x838f0260, 3 | BRF_GRA }, // 4 - { "270-c4.c4", 0x800000, 0x041560a5, 3 | BRF_GRA }, // 5 - { "270-c5.c5", 0x800000, 0xbd30b52d, 3 | BRF_GRA }, // 6 - { "270-c6.c6", 0x800000, 0x86a69c70, 3 | BRF_GRA }, // 7 - { "270-c7.c7", 0x800000, 0xd28fbc3c, 3 | BRF_GRA }, // 8 - { "270-c8.c8", 0x800000, 0x02c530a6, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "270-m1.m1", 0x080000, 0x49c9901a, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "270-v1.v1", 0x800000, 0x62e434eb, 5 | BRF_SND }, // 11 Sound data - { "270-v2.v2", 0x800000, 0x180f3c9a, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(samsho5, samsho5, neogeo) -STD_ROM_FN(samsho5) - -static void samsho5Callback() -{ - PCM2DecryptP2Info Info = { 0x000000, 0x080000, 0x700000, 0x680000, 0x500000, 0x180000, 0x200000, 0x480000, 0x300000, 0x780000, 0x600000, 0x280000, 0x100000, 0x580000, 0x400000, 0x380000 }; - - PCM2DecryptP2(&Info); -} - -static INT32 samsho5Init() -{ - nNeoProtectionXor = 0x0F; - - NeoCallbackActive->pInitialise = samsho5Callback; - - INT32 nRet = NeoInit(); - - if (nRet == 0) { - PCM2DecryptV2Info Info = { 0x0A000, 0xFEB2C0, { 0xCB, 0x29, 0x7D, 0x43, 0xD2, 0x3A, 0xC2, 0xB4 } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvsamsho5 = { - "samsho5", NULL, "neogeo", NULL, "2003", - "Samurai Shodown V / Samurai Spirits Zero (NGM-2700)\0", NULL, "Yuki Enterprise / SNK Playmore", "Neo Geo MVS", - L"Samurai Shodown V\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4\u96F6 (NGM-2700)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho5RomInfo, samsho5RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - samsho5Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown V / Samurai Spirits Zero (NGH-2700) -/* Encrypted Set, Alternate Set */ /* AES VERSION */ - -static struct BurnRomInfo samsho5hRomDesc[] = { - { "270-p1c.p1", 0x400000, 0xbf956089, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "270-p2c.sp2", 0x400000, 0x943a6b1d, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "270-c1.c1", 0x800000, 0x14ffffac, 3 | BRF_GRA }, // 2 Sprite data - { "270-c2.c2", 0x800000, 0x401f7299, 3 | BRF_GRA }, // 3 - { "270-c3.c3", 0x800000, 0x838f0260, 3 | BRF_GRA }, // 4 - { "270-c4.c4", 0x800000, 0x041560a5, 3 | BRF_GRA }, // 5 - { "270-c5.c5", 0x800000, 0xbd30b52d, 3 | BRF_GRA }, // 6 - { "270-c6.c6", 0x800000, 0x86a69c70, 3 | BRF_GRA }, // 7 - { "270-c7.c7", 0x800000, 0xd28fbc3c, 3 | BRF_GRA }, // 8 - { "270-c8.c8", 0x800000, 0x02c530a6, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "270-m1.m1", 0x080000, 0x49c9901a, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "270-v1.v1", 0x800000, 0x62e434eb, 5 | BRF_SND }, // 11 Sound data - { "270-v2.v2", 0x800000, 0x180f3c9a, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(samsho5h, samsho5h, neogeo) -STD_ROM_FN(samsho5h) - -struct BurnDriver BurnDrvsamsho5h = { - "samsho5h", "samsho5", "neogeo", NULL, "2003", - "Samurai Shodown V / Samurai Spirits Zero (NGH-2700)\0", NULL, "Yuki Enterprise / SNK Playmore", "Neo Geo MVS", - L"Samurai Shodown V\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4\u96F6 (NGH-2700)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho5hRomInfo, samsho5hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - samsho5Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown V / Samurai Spirits Zero (bootleg) - -static struct BurnRomInfo samsho5bRomDesc[] = { - { "ssv-p2.bin", 0x400000, 0x5023067f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "ssv-p1.bin", 0x400000, 0xb6cbe386, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "ssv-s1.bin", 0x020000, 0x70f667d0, 2 | BRF_GRA }, // 2 Text layer tiles - - { "ssv-c1.bin", 0x1000000, 0x9c564a01, 3 | BRF_GRA }, // 3 Sprite data - { "ssv-c2.bin", 0x1000000, 0x4b73b8da, 3 | BRF_GRA }, // 4 - { "ssv-c3.bin", 0x1000000, 0x029f9bb5, 3 | BRF_GRA }, // 5 - { "ssv-c4.bin", 0x1000000, 0x75722430, 3 | BRF_GRA }, // 6 - - { "ssv-m1.bin", 0x020000, 0x18114fb1, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code (decrypted) - - { "ssv-v1.bin", 0x400000, 0xa3609761, 5 | BRF_SND }, // 8 Sound data - { "ssv-v2.bin", 0x400000, 0xcbd6ebd5, 5 | BRF_SND }, // 9 - { "ssv-v3.bin", 0x400000, 0x6f1c2703, 5 | BRF_SND }, // 10 - { "ssv-v4.bin", 0x400000, 0x5020c055, 5 | BRF_SND }, // 11 -}; - -STDROMPICKEXT(samsho5b, samsho5b, neogeo) -STD_ROM_FN(samsho5b) - -static void samsho5b_sx_decode() -{ - UINT8 *Buf = (UINT8*)BurnMalloc(0x20000); - if (Buf) { - memmove(Buf, NeoTextROM[nNeoActiveSlot], 0x20000); - - for (INT32 i = 0; i < 0x20000; i += 0x10) { - memmove(&NeoTextROM[nNeoActiveSlot][i + 0], &Buf[i + 8], 8); - memmove(&NeoTextROM[nNeoActiveSlot][i + 8], &Buf[i + 0], 8); - } - - BurnFree(Buf); - } -} - -static void samsho5b_vx_decode() -{ - for (INT32 i = 0; i < 0x400000 * 4; i++) - YM2610ADPCMAROM[nNeoActiveSlot][i] = BITSWAP08(YM2610ADPCMAROM[nNeoActiveSlot][i], 0, 1, 5, 4, 3, 2, 6, 7); -} - -static void samsho5bCallback() -{ - INT32 i, j, k; - UINT8 *dst = (UINT8 *)BurnMalloc(0x100000); - - if (dst) - { - for (i = 0; i < 0x800000; i+=0x100000) - { - for (j = 0; j < 0x100000; j++) - { - k = BITSWAP08((j & 0xff), 7, 6, 5, 4, 1, 2, 3, 0); - k += (j & 0xfffff00); - k ^= 0x0c000a; - - dst[j] = Neo68KROMActive[i + k]; - } - - memmove (Neo68KROMActive + i, dst, 0x100000); - } - - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive, 0x700000); - memmove (Neo68KROMActive, dst, 0x100000); - - BurnFree (dst); - } - - samsho5b_sx_decode(); - lans2004_cx_decode(0x1000000 * 4); - -} - -static INT32 samsho5bInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = samsho5bCallback; - - nRet = NeoInit(); - - if (nRet == 0) { - samsho5b_vx_decode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvsamsho5b = { - "samsho5b", "samsho5", "neogeo", NULL, "2003", - "Samurai Shodown V / Samurai Spirits Zero (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - L"Samurai Shodown V\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4\u96F6 (bootleg)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho5bRomInfo, samsho5bRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - samsho5bInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2003 (Japan, JAMMA PCB) - -static struct BurnRomInfo kf2k3pcbRomDesc[] = { - { "271-p1.p1", 0x0400000, 0xb9da070c, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "271-p2.p2", 0x0400000, 0xda3118c4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "271-p3.p3", 0x0100000, 0x5cefd0d2, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "271-c1.c1", 0x1000000, 0xf5ebb327, 3 | BRF_GRA }, // 3 Sprite data - { "271-c2.c2", 0x1000000, 0x2be21620, 3 | BRF_GRA }, // 4 - { "271-c3.c3", 0x1000000, 0xddded4ff, 3 | BRF_GRA }, // 5 - { "271-c4.c4", 0x1000000, 0xd85521e6, 3 | BRF_GRA }, // 6 - { "271-c5.c5", 0x1000000, 0x18aa3540, 3 | BRF_GRA }, // 7 - { "271-c6.c6", 0x1000000, 0x1c40de87, 3 | BRF_GRA }, // 8 - - { "271-m1.m1", 0x0080000, 0xd6bcf2bc, 4 | BRF_ESS | BRF_ESS }, // 9 Z80 code - - { "271-v1.v1", 0x1000000, 0x1d96154b, 5 | BRF_SND }, // 10 Sound data -}; - -STDROMPICKEXT(kf2k3pcb, kf2k3pcb, kf2k3pcbBIOS) -STD_ROM_FN(kf2k3pcb) - -void kf2k3pcb_bios_decode() -{ - INT32 i, j; - static const INT32 address[0x40] = { - 0x04,0x0a,0x04,0x0a,0x04,0x0a,0x04,0x0a, - 0x0a,0x04,0x0a,0x04,0x0a,0x04,0x0a,0x04, - 0x09,0x07,0x09,0x07,0x09,0x07,0x09,0x07, - 0x09,0x09,0x04,0x04,0x09,0x09,0x04,0x04, - 0x0b,0x0d,0x0b,0x0d,0x03,0x05,0x03,0x05, - 0x0e,0x0e,0x03,0x03,0x0e,0x0e,0x03,0x03, - 0x03,0x05,0x0b,0x0d,0x03,0x05,0x0b,0x0d, - 0x04,0x00,0x04,0x00,0x0e,0x0a,0x0e,0x0a - }; - - extern UINT8 *Neo68KBIOS; - UINT16 *src = (UINT16*)Neo68KBIOS; - UINT16 *dst = (UINT16*)BurnMalloc( 0x80000 ); - - for (i = 0; i < 0x80000 / 2; i++) { - j = i; - if ( i & 0x00020) j ^= 0x0010; - if (~i & 0x00010) j ^= 0x0040; - j ^= 0x00a0; - if ( i & 0x00004) j ^= 0x0080; - if ( i & 0x00200) j ^= 0x0100; - if (~i & 0x02000) j ^= 0x0400; - if (~i & 0x10000) j ^= 0x1000; - if ( i & 0x02000) j ^= 0x8000; - j ^= address[((i >> 1) & 0x38) | (i & 7)]; - - dst[i] = src[j]; - if (BURN_ENDIAN_SWAP_INT16(dst[i]) & 0x0004) dst[i] ^= BURN_ENDIAN_SWAP_INT16(0x0001); - if (BURN_ENDIAN_SWAP_INT16(dst[i]) & 0x0010) dst[i] ^= BURN_ENDIAN_SWAP_INT16(0x0002); - if (BURN_ENDIAN_SWAP_INT16(dst[i]) & 0x0020) dst[i] ^= BURN_ENDIAN_SWAP_INT16(0x0008); - } - - memmove (src, dst, 0x80000); - - BurnFree (dst); -} - -static void kf2k3pcbCallback() -{ - INT32 i, j, k; - for (i = 0; i < 0x100000; i++) - Neo68KROMActive[0x800000 + i] ^= Neo68KROMActive[0x100002 | i]; - - for (i = 0x100000; i < 0x800000; i++) - Neo68KROMActive[i] ^= ~Neo68KROMActive[0x7fffe0 + (i & 0x1f)]; - - for (i = 0x100000; i < 0x700000; i += 4) { - UINT16 rom16 = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(Neo68KROMActive + i + 1))); - rom16 = BITSWAP16(rom16, 15, 14, 13, 12, 4, 5, 6, 7, 8, 9, 10, 11, 3, 2, 1, 0); - *((UINT16 *)(Neo68KROMActive + i + 1)) = BURN_ENDIAN_SWAP_INT16(rom16); - } - - memmove (Neo68KROMActive + 0x700000, Neo68KROMActive, 0x100000); - - for (i = 0; i < 0x0100000 / 0x10000; i++) { - j = BITSWAP08(i, 7, 6, 5, 4, 1, 0, 3, 2); - memmove (Neo68KROMActive + i * 0x010000, Neo68KROMActive + 0x700000 + j * 0x010000, 0x010000); - } - - memmove (Neo68KROMActive + 0x200000, Neo68KROMActive + 0x100000, 0x600000); - - for (i = 0x200000; i < 0x900000; i += 0x100000) - { - for (j = 0; j < 0x100000; j += 0x100) - { - k = (j & 0xf00) ^ 0x00300; - k |= BITSWAP08(j >> 12, 4, 5, 6, 7, 1, 0, 3, 2 ) << 12; - - memmove (Neo68KROMActive + 0x100000 + j, Neo68KROMActive + i + k, 0x100); - } - - memmove (Neo68KROMActive + i, Neo68KROMActive + 0x100000, 0x100000); - } -} - -static INT32 kf2k3pcbInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = kf2k3pcbCallback; - - nNeoTextROMSize[nNeoActiveSlot] = 0x100000; - nNeoProtectionXor = 0x9D; - - nRet = NeoPVCInit(); - - if (nRet == 0) { - PCM2DecryptV2Info Info = { 0xa7001, 0xff14ea, { 0x4b, 0xa4, 0x63, 0x46, 0xf0, 0x91, 0xea, 0x62 } }; - - PCM2DecryptV2(&Info); - - // M1 has additional swap - for (INT32 i = 0; i < 0x80000; i++) { - NeoZ80ROMActive[i] = BITSWAP08(NeoZ80ROMActive[i], 5, 6, 1, 4, 3, 0, 7, 2); - } - } - - return nRet; -} - -struct BurnDriver BurnDrvkf2k3pcb = { - "kf2k3pcb", NULL, NULL, NULL, "2003", - "The King of Fighters 2003 (Japan, JAMMA PCB)\0", NULL, "Playmore / Capcom", "dedicated Neo Geo PCB", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SNK_DEDICATED_PCB | HARDWARE_SNK_CMC50 | HARDWARE_SNK_KOF2K3 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_P32 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k3pcbRomInfo, kf2k3pcbRomName, NULL, NULL, neogeoInputInfo, kf2k3pcbDIPInfo, - kf2k3pcbInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2003 (NGM-2710) -/* Encrypted Code + Sound + GFX Roms */ /* MVS VERSION */ - -static struct BurnRomInfo kof2003RomDesc[] = { - { "271-p1c.p1", 0x400000, 0x530ecc14, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "271-p2c.p2", 0x400000, 0xfd568da9, 1 | BRF_ESS | BRF_PRG }, // 1 - { "271-p3c.p3", 0x100000, 0xaec5b4a9, 1 | BRF_ESS | BRF_PRG }, // 2 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "271-c1c.c1", 0x800000, 0xb1dc25d0, 3 | BRF_GRA }, // 3 Sprite data - { "271-c2c.c2", 0x800000, 0xd5362437, 3 | BRF_GRA }, // 4 - { "271-c3c.c3", 0x800000, 0x0a1fbeab, 3 | BRF_GRA }, // 5 - { "271-c4c.c4", 0x800000, 0x87b19a0c, 3 | BRF_GRA }, // 6 - { "271-c5c.c5", 0x800000, 0x704ea371, 3 | BRF_GRA }, // 7 - { "271-c6c.c6", 0x800000, 0x20a1164c, 3 | BRF_GRA }, // 8 - { "271-c7c.c7", 0x800000, 0x189aba7f, 3 | BRF_GRA }, // 9 - { "271-c8c.c8", 0x800000, 0x20ec4fdc, 3 | BRF_GRA }, // 10 - - /* Encrypted */ - { "271-m1c.m1", 0x080000, 0xf5515629, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - /* Encrypted */ - { "271-v1c.v1", 0x800000, 0xffa3f8c7, 5 | BRF_SND }, // 12 Sound data - { "271-v2c.v2", 0x800000, 0x5382c7d1, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kof2003, kof2003, neogeo) -STD_ROM_FN(kof2003) - -static void kof2003Callback() -{ - INT32 i, j, k; - for (i = 0; i < 0x100000; i++) - Neo68KROMActive[i] ^= ~Neo68KROMActive[0x0fffe0 + (i & 0x1f)]; - - for (i = 0; i < 0x100000; i++) - Neo68KROMActive[0x800000 + i] ^= Neo68KROMActive[0x100002 | i]; - - for (i = 0x100000; i < 0x800000; i++) - Neo68KROMActive[i] ^= ~Neo68KROMActive[0x7fffe0 + (i & 0x1f)]; - - for (i = 0x100000; i < 0x800000; i += 4) { - UINT16 rom16 = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(Neo68KROMActive + i + 1))); - rom16 = BITSWAP16(rom16, 15, 14, 13, 12, 5, 4, 7, 6, 9, 8, 11, 10, 3, 2, 1, 0); - *((UINT16 *)(Neo68KROMActive + i + 1)) = BURN_ENDIAN_SWAP_INT16(rom16); - } - - memmove (Neo68KROMActive + 0x700000, Neo68KROMActive, 0x100000); - - for (i = 0; i < 0x0100000 / 0x10000; i++) { - j = BITSWAP08(i, 7, 6, 5, 4, 0, 1, 2, 3); - memmove (Neo68KROMActive + i * 0x010000, Neo68KROMActive + 0x700000 + j * 0x010000, 0x010000); - } - - memmove (Neo68KROMActive + 0x200000, Neo68KROMActive + 0x100000, 0x600000); - - for (i = 0x200000; i < 0x900000; i += 0x100000) - { - for (j = 0; j < 0x100000; j += 0x100) - { - k = (j & 0xf00) ^ 0x00800; - k |= BITSWAP08(j >> 12, 4, 5, 6, 7, 1, 0, 3, 2 ) << 12; - - memmove (Neo68KROMActive + 0x100000 + j, Neo68KROMActive + i + k, 0x100); - } - - memmove (Neo68KROMActive + i, Neo68KROMActive + 0x100000, 0x100000); - } -} - -static INT32 kof2003Init() -{ - INT32 nRet; - - nNeoProtectionXor = 0x9D; - NeoCallbackActive->pInitialise = kof2003Callback; - - nRet = NeoPVCInit(); - - if (nRet == 0) { - PCM2DecryptV2Info Info = { 0xa7001, 0xff14ea, { 0x4b, 0xa4, 0x63, 0x46, 0xf0, 0x91, 0xea, 0x62 } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkof2003 = { - "kof2003", NULL, "neogeo", NULL, "2003", - "The King of Fighters 2003 (NGM-2710)\0", NULL, "SNK Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_P32 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kof2003RomInfo, kof2003RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2003Init, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2003 (NGH-2710) -/* Encrypted Code + Sound + GFX Roms */ /* AES VERSION */ - -static struct BurnRomInfo kof2003hRomDesc[] = { - /* All chip labels for this set are correct */ - { "271-p1k.p1", 0x400000, 0xd0d0ae3e, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - { "271-p2k.p2", 0x400000, 0xfb3f79d9, 1 | BRF_ESS | BRF_PRG }, // 1 - { "271-p3k.p3", 0x100000, 0x232702ad, 1 | BRF_ESS | BRF_PRG }, // 2 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "271-c1k.c1", 0x800000, 0xefb9dd24, 3 | BRF_GRA }, // 3 Sprite data - { "271-c2k.c2", 0x800000, 0x3fb90447, 3 | BRF_GRA }, // 4 - { "271-c3k.c3", 0x800000, 0x27950f28, 3 | BRF_GRA }, // 5 - { "271-c4k.c4", 0x800000, 0x735177f8, 3 | BRF_GRA }, // 6 - { "271-c5k.c5", 0x800000, 0xa51b7c0f, 3 | BRF_GRA }, // 7 - { "271-c6k.c6", 0x800000, 0xd5cae4e0, 3 | BRF_GRA }, // 8 - { "271-c7k.c7", 0x800000, 0xe65ae2d0, 3 | BRF_GRA }, // 9 - { "271-c8k.c8", 0x800000, 0x312f528c, 3 | BRF_GRA }, // 10 - - /* Encrypted */ - { "271-m1k.m1", 0x080000, 0x48d9affe, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - /* Encrypted */ - { "271-v1c.v1", 0x800000, 0xffa3f8c7, 5 | BRF_SND }, // 12 Sound data - { "271-v2c.v2", 0x800000, 0x5382c7d1, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kof2003h, kof2003h, neogeo) -STD_ROM_FN(kof2003h) - -static void kof2003hCallback() -{ - INT32 i, j, k; - for (i = 0; i < 0x100000; i++) - Neo68KROMActive[i] ^= ~Neo68KROMActive[0x0fffe0 + (i & 0x1f)]; - - for (i = 0; i < 0x100000; i++) - Neo68KROMActive[0x800000 + i] ^= Neo68KROMActive[0x100002 | i]; - - for (i = 0x100000; i < 0x800000; i++) - Neo68KROMActive[i] ^= ~Neo68KROMActive[0x7fffe0 + (i & 0x1f)]; - - for (i = 0x100000; i < 0x800000; i += 4) { - UINT16 rom16 = BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(Neo68KROMActive + i + 1))); - rom16 = BITSWAP16(rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0); - *((UINT16 *)(Neo68KROMActive + i + 1)) = BURN_ENDIAN_SWAP_INT16(rom16); - } - - memmove (Neo68KROMActive + 0x700000, Neo68KROMActive, 0x100000); - - for (i = 0; i < 0x0100000 / 0x10000; i++) { - j = BITSWAP08(i, 7, 6, 5, 4, 1, 0, 3, 2); - memmove (Neo68KROMActive + i * 0x010000, Neo68KROMActive + 0x700000 + j * 0x010000, 0x010000); - } - - memmove (Neo68KROMActive + 0x200000, Neo68KROMActive + 0x100000, 0x600000); - - for (i = 0x200000; i < 0x900000; i += 0x100000) - { - for (j = 0; j < 0x100000; j += 0x100) - { - k = (j & 0xf00) ^ 0x00400; - k |= BITSWAP08(j >> 12, 6, 7, 4, 5, 0, 1, 2, 3) << 12; - - memmove (Neo68KROMActive + 0x100000 + j, Neo68KROMActive + i + k, 0x100); - } - - memmove (Neo68KROMActive + i, Neo68KROMActive + 0x100000, 0x100000); - } -} - -static INT32 kof2003hInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0x9D; - NeoCallbackActive->pInitialise = kof2003hCallback; - - nRet = NeoPVCInit(); - - if (nRet == 0) { - PCM2DecryptV2Info Info = { 0xa7001, 0xff14ea, { 0x4b, 0xa4, 0x63, 0x46, 0xf0, 0x91, 0xea, 0x62 } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkof2003h = { - "kof2003h", "kof2003", "neogeo", NULL, "2003", - "The King of Fighters 2003 (NGH-2710)\0", NULL, "SNK Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_P32 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kof2003hRomInfo, kof2003hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2003hInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2003 (bootleg set 1) - -static struct BurnRomInfo kf2k3blRomDesc[] = { - { "2k3-p1.bin", 0x400000, 0x92ed6ee3, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "2k3-p2.bin", 0x400000, 0x5d3d8bb3, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "2k3-s1.bin", 0x020000, 0x482c48a5, 2 | BRF_GRA }, // 2 Text layer tiles - - { "271-c1c.c1", 0x800000, 0xb1dc25d0, 3 | BRF_GRA }, // 3 Sprite data - { "271-c2c.c2", 0x800000, 0xd5362437, 3 | BRF_GRA }, // 4 - { "271-c3c.c3", 0x800000, 0x0a1fbeab, 3 | BRF_GRA }, // 5 - { "271-c4c.c4", 0x800000, 0x87b19a0c, 3 | BRF_GRA }, // 6 - { "271-c5c.c5", 0x800000, 0x704ea371, 3 | BRF_GRA }, // 7 - { "271-c6c.c6", 0x800000, 0x20a1164c, 3 | BRF_GRA }, // 8 - { "271-c7c.c7", 0x800000, 0x189aba7f, 3 | BRF_GRA }, // 9 - { "271-c8c.c8", 0x800000, 0x20ec4fdc, 3 | BRF_GRA }, // 10 - - { "2k3-m1.bin", 0x020000, 0x3a4969ff, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "271-v1c.v1", 0x800000, 0xffa3f8c7, 5 | BRF_SND }, // 12 Sound data - { "271-v2c.v2", 0x800000, 0x5382c7d1, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k3bl, kf2k3bl, neogeo) -STD_ROM_FN(kf2k3bl) - -UINT8 __fastcall kf2k3blReadByteProtection(UINT32) -{ - return PVCRAM[0x1ff2]; -} - -UINT16 __fastcall kf2k3blReadWordProtection(UINT32) -{ - return PVCRAM[0x1ff2]; -} - -static void kf2k3blCallback() -{ - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive, 0x700000); - memmove (Neo68KROMActive, Neo68KROMActive + 0x700000, 0x100000); - - lans2004_sx_decode(); -} - -static void kf2k3blInstallHandlers() -{ - NeoPVCInstallHandlers(); - - SekMapHandler(7, 0x058196, 0x058197, MAP_READ); - SekSetReadByteHandler(7, kf2k3blReadByteProtection); -} - -static INT32 kf2k3blInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0x9D; - NeoCallbackActive->pInitialise = kf2k3blCallback; - - nRet = NeoPVCInit(); - - NeoCallbackActive->pInstallHandlers = kf2k3blInstallHandlers; - - if (nRet == 0) { - PCM2DecryptV2Info Info = { 0xa7001, 0xff14ea, { 0x4b, 0xa4, 0x63, 0x46, 0xf0, 0x91, 0xea, 0x62 } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkf2k3bl = { - "kf2k3bl", "kof2003", "neogeo", NULL, "2003", - "The King of Fighters 2003 (bootleg set 1)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k3blRomInfo, kf2k3blRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k3blInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2003 (bootleg set 2) - -static struct BurnRomInfo kf2k3blaRomDesc[] = { - { "2k3-p1bl.bin", 0x100000, 0x4ea414dd, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "2k3-p3bl.bin", 0x400000, 0x370acbff, 1 | BRF_ESS | BRF_PRG }, // 1 - { "2k3-p2bl.bin", 0x200000, 0x9c04fc52, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "2k3-s1.bin", 0x020000, 0x482c48a5, 2 | BRF_GRA }, // 2 Text layer tiles - - { "271-c1c.c1", 0x800000, 0xb1dc25d0, 3 | BRF_GRA }, // 3 Sprite data - { "271-c2c.c2", 0x800000, 0xd5362437, 3 | BRF_GRA }, // 4 - { "271-c3c.c3", 0x800000, 0x0a1fbeab, 3 | BRF_GRA }, // 5 - { "271-c4c.c4", 0x800000, 0x87b19a0c, 3 | BRF_GRA }, // 6 - { "271-c5c.c5", 0x800000, 0x704ea371, 3 | BRF_GRA }, // 7 - { "271-c6c.c6", 0x800000, 0x20a1164c, 3 | BRF_GRA }, // 8 - { "271-c7c.c7", 0x800000, 0x189aba7f, 3 | BRF_GRA }, // 9 - { "271-c8c.c8", 0x800000, 0x20ec4fdc, 3 | BRF_GRA }, // 10 - - { "2k3-m1.bin", 0x020000, 0x3a4969ff, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "271-v1c.v1", 0x800000, 0xffa3f8c7, 5 | BRF_SND }, // 12 Sound data - { "271-v2c.v2", 0x800000, 0x5382c7d1, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k3bla, kf2k3bla, neogeo) -STD_ROM_FN(kf2k3bla) - -static void kf2k3blaCallback() -{ - INT32 i, j, k; - UINT8 *dst = (UINT8 *)BurnMalloc(0x100000); - if (dst) - { - for (i = 0; i < 0x700000; i += 0x100000) - { - memmove(dst, Neo68KROMActive + i, 0x100000); - - for (j = 0; j < 0x100000; j++) - { - k = BITSWAP24(j, 23,22,21,20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0); - Neo68KROMActive[i + j] = dst[k]; - } - } - - BurnFree (dst); - } - - // patched by Altera protection chip - *((UINT16*)(Neo68KROMActive + 0x0f38ac)) = BURN_ENDIAN_SWAP_INT16(0x4e75); - - lans2004_sx_decode(); -} - -void __fastcall kf2k3blaWriteWordBankswitch(UINT32 sekAddress, UINT16 wordValue) -{ - *((UINT16*)(PVCRAM + (sekAddress & 0x1ffe))) = BURN_ENDIAN_SWAP_INT16(wordValue); - - if (sekAddress == 0x2ffff2) - { - UINT32 nBank = ((PVCRAM[0x1ff3] << 16) | (PVCRAM[0x1ff2] << 8) | PVCRAM[0x1ff0]) + 0x100000; - - if (nBank != nNeo68KROMBank) - { - nNeo68KROMBank = nBank; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2fdfff, MAP_ROM); - } - } -} - -static void kf2k3blaInstallHandlers() -{ - NeoPVCInstallHandlers(); - - SekMapHandler(7, 0x2ffff0, 0x2fffff, MAP_WRITE); - SekSetWriteWordHandler(7, kf2k3blaWriteWordBankswitch); -} - -static INT32 kf2k3blaInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0x9D; - - NeoCallbackActive->pInitialise = kf2k3blaCallback; - - nRet = NeoPVCInit(); - - NeoCallbackActive->pInstallHandlers = kf2k3blaInstallHandlers; - - if (nRet == 0) { - PCM2DecryptV2Info Info = { 0xa7001, 0xff14ea, { 0x4b, 0xa4, 0x63, 0x46, 0xf0, 0x91, 0xea, 0x62 } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkf2k3bla = { - "kf2k3bla", "kof2003", "neogeo", NULL, "2003", - "The King of Fighters 2003 (bootleg set 2)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k3blaRomInfo, kf2k3blaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k3blaInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2004 Plus / Hero (bootleg) - -static struct BurnRomInfo kf2k3plRomDesc[] = { - { "2k3-p1pl.bin", 0x100000, 0x07b84112, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "2k3-p3bl.bin", 0x400000, 0x370acbff, 1 | BRF_ESS | BRF_PRG }, // 1 - { "2k3-p2bl.bin", 0x200000, 0x9c04fc52, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "2k3-s1pl.bin", 0x020000, 0xad548a36, 2 | BRF_GRA }, // 3 Text layer tiles - - { "271-c1c.c1", 0x800000, 0xb1dc25d0, 3 | BRF_GRA }, // 3 Sprite data - { "271-c2c.c2", 0x800000, 0xd5362437, 3 | BRF_GRA }, // 4 - { "271-c3c.c3", 0x800000, 0x0a1fbeab, 3 | BRF_GRA }, // 5 - { "271-c4c.c4", 0x800000, 0x87b19a0c, 3 | BRF_GRA }, // 6 - { "271-c5c.c5", 0x800000, 0x704ea371, 3 | BRF_GRA }, // 7 - { "271-c6c.c6", 0x800000, 0x20a1164c, 3 | BRF_GRA }, // 8 - { "271-c7c.c7", 0x800000, 0x189aba7f, 3 | BRF_GRA }, // 9 - { "271-c8c.c8", 0x800000, 0x20ec4fdc, 3 | BRF_GRA }, // 10 - - { "2k3-m1.bin", 0x020000, 0x3a4969ff, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "271-v1c.v1", 0x800000, 0xffa3f8c7, 5 | BRF_SND }, // 12 Sound data - { "271-v2c.v2", 0x800000, 0x5382c7d1, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k3pl, kf2k3pl, neogeo) -STD_ROM_FN(kf2k3pl) - -struct BurnDriver BurnDrvkf2k3pl = { - "kf2k3pl", "kof2003", "neogeo", NULL, "2003", - "The King of Fighters 2004 Plus / Hero (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k3plRomInfo, kf2k3plRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k3blaInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// The King of Fighters 2004 Ultra Plus (bootleg) - -static struct BurnRomInfo kf2k3uplRomDesc[] = { - { "2k3-p1up.bin", 0x800000, 0x87294c01, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "2k3-s1up.bin", 0x020000, 0xe5708c0c, 2 | BRF_GRA }, // 1 Text layer tiles - - { "271-c1c.c1", 0x800000, 0xb1dc25d0, 3 | BRF_GRA }, // 2 Sprite data - { "271-c2c.c2", 0x800000, 0xd5362437, 3 | BRF_GRA }, // 3 - { "271-c3c.c3", 0x800000, 0x0a1fbeab, 3 | BRF_GRA }, // 4 - { "271-c4c.c4", 0x800000, 0x87b19a0c, 3 | BRF_GRA }, // 5 - { "271-c5c.c5", 0x800000, 0x704ea371, 3 | BRF_GRA }, // 6 - { "271-c6c.c6", 0x800000, 0x20a1164c, 3 | BRF_GRA }, // 7 - { "271-c7c.c7", 0x800000, 0x189aba7f, 3 | BRF_GRA }, // 8 - { "271-c8c.c8", 0x800000, 0x20ec4fdc, 3 | BRF_GRA }, // 9 - - { "2k3-m1.bin", 0x020000, 0x3a4969ff, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "271-v1c.v1", 0x800000, 0xffa3f8c7, 5 | BRF_SND }, // 11 Sound data - { "271-v2c.v2", 0x800000, 0x5382c7d1, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kf2k3upl, kf2k3upl, neogeo) -STD_ROM_FN(kf2k3upl) - -static void kf2k3uplCallback() -{ - INT32 i, j; - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive, 0x600000); - memmove (Neo68KROMActive, Neo68KROMActive + 0x700000, 0x100000); - - for(i = 0; i < 0x2000; i++) { - j = (i & 0x1f00) | BITSWAP08(i & 0xff, 7, 1, 5, 4, 3, 2, 6, 0) ; - Neo68KROMActive[0xfe000 + i] = Neo68KROMActive[0xd0610 + j]; - } - - garoubl_sx_decode(); -} - -static INT32 kof2k3uplInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0x9D; - NeoCallbackActive->pInitialise = kf2k3uplCallback; - - nRet = NeoPVCInit(); - - NeoCallbackActive->pInstallHandlers = kf2k3blInstallHandlers; - - if (nRet == 0) { - PCM2DecryptV2Info Info = { 0xa7001, 0xff14ea, { 0x4b, 0xa4, 0x63, 0x46, 0xf0, 0x91, 0xea, 0x62 } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkf2k3upl = { - "kf2k3upl", "kof2003", "neogeo", NULL, "2003", - "The King of Fighters 2004 Ultra Plus (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k3uplRomInfo, kf2k3uplRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2k3uplInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown V Special / Samurai Spirits Zero Special (NGM-2720) -/* Encrypted Set */ /* MVS VERSION */ - -static struct BurnRomInfo samsh5spRomDesc[] = { - /* Uncensored */ - { "272-p1.p1", 0x400000, 0xfb7a6bba, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "272-p2.sp2", 0x400000, 0x63492ea6, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "272-c1.c1", 0x800000, 0x4f97661a, 3 | BRF_GRA }, // 2 Sprite data - { "272-c2.c2", 0x800000, 0xa3afda4f, 3 | BRF_GRA }, // 3 - { "272-c3.c3", 0x800000, 0x8c3c7502, 3 | BRF_GRA }, // 4 - { "272-c4.c4", 0x800000, 0x32d5e2e2, 3 | BRF_GRA }, // 5 - { "272-c5.c5", 0x800000, 0x6ce085bc, 3 | BRF_GRA }, // 6 - { "272-c6.c6", 0x800000, 0x05c8dc8e, 3 | BRF_GRA }, // 7 - { "272-c7.c7", 0x800000, 0x1417b742, 3 | BRF_GRA }, // 8 - { "272-c8.c8", 0x800000, 0xd49773cd, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "272-m1.m1", 0x080000, 0xadeebf40, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "272-v1.v1", 0x800000, 0x76a94127, 5 | BRF_SND }, // 11 Sound data - { "272-v2.v2", 0x800000, 0x4ba507f1, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(samsh5sp, samsh5sp, neogeo) -STD_ROM_FN(samsh5sp) - -static void samsh5spCallback() -{ - PCM2DecryptP2Info Info = { 0x000000, 0x080000, 0x500000, 0x480000, 0x600000, 0x580000, 0x700000, 0x280000, 0x100000, 0x680000, 0x400000, 0x780000, 0x200000, 0x380000, 0x300000, 0x180000 }; - - PCM2DecryptP2(&Info); -} - -static INT32 samsh5spInit() -{ - INT32 nRet; - -// nNeoTextROMSize = 0x20000; - nNeoProtectionXor = 0x0D; - NeoCallbackActive->pInitialise = samsh5spCallback; - - nRet = NeoInit(); - - if (nRet == 0) { - PCM2DecryptV2Info Info = { 0x02000, 0xffb440, { 0x4b, 0xa4, 0x63, 0x46, 0xf0, 0x91, 0xea, 0x62 } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvsamsh5sp = { - "samsh5sp", NULL, "neogeo", NULL, "2004", - "Samurai Shodown V Special / Samurai Spirits Zero Special (NGM-2720)\0", NULL, "Yuki Enterprise / SNK Playmore", "Neo Geo MVS", - L"Samurai Shodown V Special\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4\u96F6 Special (NGM-2720)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsh5spRomInfo, samsh5spRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - samsh5spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -/* Some info about the 2nd AES release of Samurai Shodown 5 Special (samsh5sph): - - The fixed carts have a small round neogeo sticker applied to the front side of the cart (top right near cart sticker). - SNK Playmore had authorized a recall of all Samurai Shodown V Special (Samurai Spirits 0 Special) home cartridges. This recall involved bug fixes - and the addition of fatalities. (The fatalities were originally removed at the last minute due to the Nagasaki incident, a murder caused by a child killing her classmate by knife.) - Bug fixes: Improvements on Voice, Back Ground Music, and Practice mode. - Fatalities: SNK PLAYMORE modified the game program by including the removed "Zetumei Ougi" in a modified version. - This new version does not show the complete fatalities, they are instead replaced by what SNK PLAYMORE refers to as "lessened fatalities". -*/ - -// Samurai Shodown V Special / Samurai Spirits Zero Special (NGH-2720) (2nd release, less censored) -/* Encrypted Set */ /* AES VERSION, 2nd bugfix release */ - -static struct BurnRomInfo samsh5sphRomDesc[] = { - /* Less censored */ - { "272-p1ca.p1", 0x400000, 0xc30a08dd, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "272-p2ca.sp2", 0x400000, 0xbd64a518, 1 | BRF_ESS | BRF_PRG }, // 1 - /* Correct chip labels unknown */ - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "272-c1.c1", 0x800000, 0x4f97661a, 3 | BRF_GRA }, // 2 Sprite data - { "272-c2.c2", 0x800000, 0xa3afda4f, 3 | BRF_GRA }, // 3 - { "272-c3.c3", 0x800000, 0x8c3c7502, 3 | BRF_GRA }, // 4 - { "272-c4.c4", 0x800000, 0x32d5e2e2, 3 | BRF_GRA }, // 5 - { "272-c5.c5", 0x800000, 0x6ce085bc, 3 | BRF_GRA }, // 6 - { "272-c6.c6", 0x800000, 0x05c8dc8e, 3 | BRF_GRA }, // 7 - { "272-c7.c7", 0x800000, 0x1417b742, 3 | BRF_GRA }, // 8 - { "272-c8.c8", 0x800000, 0xd49773cd, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "272-m1.m1", 0x080000, 0xadeebf40, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "272-v1.v1", 0x800000, 0x76a94127, 5 | BRF_SND }, // 11 Sound data - { "272-v2.v2", 0x800000, 0x4ba507f1, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(samsh5sph, samsh5sph, neogeo) -STD_ROM_FN(samsh5sph) - -struct BurnDriver BurnDrvsamsh5sph = { - "samsh5sph", "samsh5sp", "neogeo", NULL, "2004", - "Samurai Shodown V Special / Samurai Spirits Zero Special (NGH-2720) (2nd release, less censored)\0", NULL, "Yuki Enterprise / SNK Playmore", "Neo Geo MVS", - L"Samurai Shodown V Special\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4\u96F6 Special (NGH-2720) (2nd release, less censored)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsh5sphRomInfo, samsh5sphRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - samsh5spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown V Special / Samurai Spirits Zero Special (NGH-2720) (1st release, censored) -/* Encrypted Set */ /* AES VERSION, 1st release */ - -static struct BurnRomInfo samsh5sphoRomDesc[] = { - /* Censored */ - { "272-p1c.p1", 0x400000, 0x9291794d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "272-p2c.sp2", 0x400000, 0xfa1a7dd8, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "272-c1.c1", 0x800000, 0x4f97661a, 3 | BRF_GRA }, // 2 Sprite data - { "272-c2.c2", 0x800000, 0xa3afda4f, 3 | BRF_GRA }, // 3 - { "272-c3.c3", 0x800000, 0x8c3c7502, 3 | BRF_GRA }, // 4 - { "272-c4.c4", 0x800000, 0x32d5e2e2, 3 | BRF_GRA }, // 5 - { "272-c5.c5", 0x800000, 0x6ce085bc, 3 | BRF_GRA }, // 6 - { "272-c6.c6", 0x800000, 0x05c8dc8e, 3 | BRF_GRA }, // 7 - { "272-c7.c7", 0x800000, 0x1417b742, 3 | BRF_GRA }, // 8 - { "272-c8.c8", 0x800000, 0xd49773cd, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "272-m1.m1", 0x080000, 0xadeebf40, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "272-v1.v1", 0x800000, 0x76a94127, 5 | BRF_SND }, // 11 Sound data - { "272-v2.v2", 0x800000, 0x4ba507f1, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(samsh5spho, samsh5spho, neogeo) -STD_ROM_FN(samsh5spho) - -struct BurnDriver BurnDrvsamsh5spho = { - "samsh5spho", "samsh5sp", "neogeo", NULL, "2004", - "Samurai Shodown V Special / Samurai Spirits Zero Special (NGH-2720) (1st release, censored)\0", NULL, "Yuki Enterprise / SNK Playmore", "Neo Geo MVS", - L"Samurai Shodown V Special\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4\u96F6 Special (NGH-2720) (1st release, censored)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsh5sphoRomInfo, samsh5sphoRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - samsh5spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Magician Lord (NGM-005) -/* MVS VERSION */ - -static struct BurnRomInfo maglordRomDesc[] = { - { "005-pg1.p1", 0x080000, 0xbd0a492d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / MB834200 - - { "005-s1.s1", 0x020000, 0x1c5369a2, 2 | BRF_GRA }, // 1 Text layer tiles / MB831000 - - { "005-c1.c1", 0x080000, 0x806aee34, 3 | BRF_GRA }, // 2 Sprite data / MB834200 - { "005-c2.c2", 0x080000, 0x34aa9a86, 3 | BRF_GRA }, // 3 / MB834200 - { "005-c3.c3", 0x080000, 0xc4c2b926, 3 | BRF_GRA }, // 4 / MB834200 - { "005-c4.c4", 0x080000, 0x9c46dcf4, 3 | BRF_GRA }, // 5 / MB834200 - { "005-c5.c5", 0x080000, 0x69086dec, 3 | BRF_GRA }, // 6 / MB834200 - { "005-c6.c6", 0x080000, 0xab7ac142, 3 | BRF_GRA }, // 7 / MB834200 - - { "005-m1.m1", 0x040000, 0x26259f0f, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / MB832000 - - { "005-v11.v11", 0x080000, 0xcc0455fd, 5 | BRF_SND }, // 9 Sound data / MB834000 - { "005-v21.v21", 0x080000, 0xf94ab5b7, 6 | BRF_SND }, // 10 / MB834000 - { "005-v22.v22", 0x080000, 0x232cfd04, 6 | BRF_SND }, // 11 / MB834000 -}; - -STDROMPICKEXT(maglord, maglord, neogeo) -STD_ROM_FN(maglord) - -struct BurnDriver BurnDrvmaglord = { - "maglord", NULL, "neogeo", NULL, "1990", - "Magician Lord (NGM-005)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, 0, - NULL, maglordRomInfo, maglordRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Magician Lord (NGH-005) -/* AES VERSION */ - -static struct BurnRomInfo maglordhRomDesc[] = { - { "005-p1.p1", 0x080000, 0x599043c5, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / MB834200 - - { "005-s1.s1", 0x020000, 0x1c5369a2, 2 | BRF_GRA }, // 1 Text layer tiles / MB831000 - - { "005-c1.c1", 0x080000, 0x806aee34, 3 | BRF_GRA }, // 2 Sprite data / MB834200 - { "005-c2.c2", 0x080000, 0x34aa9a86, 3 | BRF_GRA }, // 3 / MB834200 - { "005-c3.c3", 0x080000, 0xc4c2b926, 3 | BRF_GRA }, // 4 / MB834200 - { "005-c4.c4", 0x080000, 0x9c46dcf4, 3 | BRF_GRA }, // 5 / MB834200 - { "005-c5.c5", 0x080000, 0x69086dec, 3 | BRF_GRA }, // 6 / MB834200 - { "005-c6.c6", 0x080000, 0xab7ac142, 3 | BRF_GRA }, // 7 / MB834200 - - { "005-m1.m1", 0x040000, 0x26259f0f, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / MB832000 - - { "005-v11.v11", 0x080000, 0xcc0455fd, 5 | BRF_SND }, // 9 Sound data / MB834000 - { "005-v21.v21", 0x080000, 0xf94ab5b7, 6 | BRF_SND }, // 10 / MB834000 - { "005-v22.v22", 0x080000, 0x232cfd04, 6 | BRF_SND }, // 11 / MB834000 -}; - -STDROMPICKEXT(maglordh, maglordh, neogeo) -STD_ROM_FN(maglordh) - -struct BurnDriver BurnDrvmaglordh = { - "maglordh", "maglord", "neogeo", NULL, "1990", - "Magician Lord (NGH-005)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, 0, - NULL, maglordhRomInfo, maglordhRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Ninja Combat (NGM-009) -/* MVS VERSION */ - -static struct BurnRomInfo ncombatRomDesc[] = { - { "009-p1.p1", 0x080000, 0xb45fcfbf, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "009-s1.s1", 0x020000, 0xd49afee8, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "009-c1.c1", 0x080000, 0x33cc838e, 3 | BRF_GRA }, // 2 Sprite data / TC534200 - { "009-c2.c2", 0x080000, 0x26877feb, 3 | BRF_GRA }, // 3 / TC534200 - { "009-c3.c3", 0x080000, 0x3b60a05d, 3 | BRF_GRA }, // 4 / TC534200 - { "009-c4.c4", 0x080000, 0x39c2d039, 3 | BRF_GRA }, // 5 / TC534200 - { "009-c5.c5", 0x080000, 0x67a4344e, 3 | BRF_GRA }, // 6 / TC534200 - { "009-c6.c6", 0x080000, 0x2eca8b19, 3 | BRF_GRA }, // 7 / TC534200 - - { "009-m1.m1", 0x020000, 0xb5819863, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / TC531001 - - { "009-v11.v11", 0x080000, 0xcf32a59c, 5 | BRF_SND }, // 9 Sound data / TC534000 - { "009-v12.v12", 0x080000, 0x7b3588b7, 5 | BRF_SND }, // 10 / TC534000 - { "009-v13.v13", 0x080000, 0x505a01b5, 5 | BRF_SND }, // 11 / TC534000 - { "009-v21.v21", 0x080000, 0x365f9011, 6 | BRF_SND }, // 12 / TC534000 -}; - -STDROMPICKEXT(ncombat, ncombat, neogeo) -STD_ROM_FN(ncombat) - -struct BurnDriver BurnDrvncombat = { - "ncombat", NULL, "neogeo", NULL, "1990", - "Ninja Combat (NGM-009)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, ncombatRomInfo, ncombatRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Ninja Combat (NGH-009) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo ncombathRomDesc[] = { - { "009-pg1.p1", 0x080000, 0x8e9f0add, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "009-s1.s1", 0x020000, 0xd49afee8, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "009-c1.c1", 0x080000, 0x33cc838e, 3 | BRF_GRA }, // 2 Sprite data / TC534200 - { "009-c2.c2", 0x080000, 0x26877feb, 3 | BRF_GRA }, // 3 / TC534200 - { "009-c3.c3", 0x080000, 0x3b60a05d, 3 | BRF_GRA }, // 4 / TC534200 - { "009-c4.c4", 0x080000, 0x39c2d039, 3 | BRF_GRA }, // 5 / TC534200 - { "009-c5.c5", 0x080000, 0x67a4344e, 3 | BRF_GRA }, // 6 / TC534200 - { "009-c6.c6", 0x080000, 0x2eca8b19, 3 | BRF_GRA }, // 7 / TC534200 - - { "009-m1.m1", 0x020000, 0xb5819863, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / TC531001 - - { "009-v11.v11", 0x080000, 0xcf32a59c, 5 | BRF_SND }, // 9 Sound data / TC534000 - { "009-v12.v12", 0x080000, 0x7b3588b7, 5 | BRF_SND }, // 10 / TC534000 - { "009-v13.v13", 0x080000, 0x505a01b5, 5 | BRF_SND }, // 11 / TC534000 - { "009-v21.v21", 0x080000, 0x365f9011, 6 | BRF_SND }, // 12 / TC534000 -}; - -STDROMPICKEXT(ncombath, ncombath, neogeo) -STD_ROM_FN(ncombath) - -struct BurnDriver BurnDrvncombath = { - "ncombath", "ncombat", "neogeo", NULL, "1990", - "Ninja Combat (NGH-009)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, ncombathRomInfo, ncombathRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Blue's Journey / Raguy (ALM-001)(ALH-001) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo bjourneyRomDesc[] = { - { "022-p1.p1", 0x100000, 0x6a2f6d4a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "022-s1.s1", 0x020000, 0x843c3624, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "022-c1.c1", 0x100000, 0x4d47a48c, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "022-c2.c2", 0x100000, 0xe8c1491a, 3 | BRF_GRA }, // 3 / TC538200 - { "022-c3.c3", 0x080000, 0x66e69753, 3 | BRF_GRA }, // 4 / TC538200 - { "022-c4.c4", 0x080000, 0x71bfd48a, 3 | BRF_GRA }, // 5 / TC538200 - - { "022-m1.m1", 0x020000, 0x8e1d4ab6, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "022-v11.v11", 0x100000, 0x2cb4ad91, 5 | BRF_SND }, // 7 Sound data / TC538200 - { "022-v22.v22", 0x100000, 0x65a54d13, 5 | BRF_SND }, // 8 / TC538200 -}; - -STDROMPICKEXT(bjourney, bjourney, neogeo) -STD_ROM_FN(bjourney) - -struct BurnDriver BurnDrvbjourney = { - "bjourney", NULL, "neogeo", NULL, "1990", - "Blue's Journey / Raguy (ALM-001)(ALH-001)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, 0, - NULL, bjourneyRomInfo, bjourneyRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, 0x1000, - 320, 224, 4, 3 -}; - -// Crossed Swords (ALM-002)(ALH-002) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo crswordRomDesc[] = { - { "037-p1.p1", 0x080000, 0xe7f2553c, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "037-s1.s1", 0x020000, 0x74651f27, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "037-c1.c1", 0x100000, 0x09df6892, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "037-c2.c2", 0x100000, 0xac122a78, 3 | BRF_GRA }, // 3 / TC538200 - { "037-c3.c3", 0x100000, 0x9d7ed1ca, 3 | BRF_GRA }, // 4 / TC538200 - { "037-c4.c4", 0x100000, 0x4a24395d, 3 | BRF_GRA }, // 5 / TC538200 - - { "037-m1.m1", 0x020000, 0x9504b2c6, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "037-v1.v1", 0x100000, 0x61fedf65, 5 | BRF_SND }, // 7 Sound data / TC538200 -}; - -STDROMPICKEXT(crsword, crsword, neogeo) -STD_ROM_FN(crsword) - -struct BurnDriver BurnDrvcrsword = { - "crsword", NULL, "neogeo", NULL, "1991", - "Crossed Swords (ALM-002)(ALH-002)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, crswordRomInfo, crswordRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Thrash Rally (ALM-003)(ALH-003) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo trallyRomDesc[] = { - { "038-p1.p1", 0x080000, 0x1e52a576, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "038-p2.p2", 0x080000, 0xa5193e2f, 1 | BRF_ESS | BRF_PRG }, // 1 / TC534200 - - { "038-s1.s1", 0x020000, 0xfff62ae3, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "038-c1.c1", 0x100000, 0xc58323d4, 3 | BRF_GRA }, // 3 Sprite data / TC538200 - { "038-c2.c2", 0x100000, 0xbba9c29e, 3 | BRF_GRA }, // 4 / TC538200 - { "038-c3.c3", 0x080000, 0x3bb7b9d6, 3 | BRF_GRA }, // 5 / TC534200 - { "038-c4.c4", 0x080000, 0xa4513ecf, 3 | BRF_GRA }, // 6 / TC534200 - - { "038-m1.m1", 0x020000, 0x0908707e, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "038-v1.v1", 0x100000, 0x5ccd9fd5, 5 | BRF_SND }, // 8 Sound data / TC538200 - { "038-v2.v2", 0x080000, 0xddd8d1e6, 5 | BRF_SND }, // 9 / TC534200 - - { "hd6301v1p.hd6301v1", 0x001000, 0x00000000, BRF_OPT | BRF_NODUMP }, // Hitachi HD6301V1 MCU -}; - -STDROMPICKEXT(trally, trally, neogeo) -STD_ROM_FN(trally) - -struct BurnDriver BurnDrvtrally = { - "trally", NULL, "neogeo", NULL, "1991", - "Thrash Rally (ALM-003)(ALH-003)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_RACING, 0, - NULL, trallyRomInfo, trallyRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Ninja Commando - -static struct BurnRomInfo ncommandRomDesc[] = { - { "050-p1.p1", 0x100000, 0x4e097c40, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / CXK388000 - - { "050-s1.s1", 0x020000, 0xdb8f9c8e, 2 | BRF_GRA }, // 1 Text layer tiles / CXK 381000 - - { "050-c1.c1", 0x100000, 0x87421a0a, 3 | BRF_GRA }, // 2 Sprite data / CXK388000 - { "050-c2.c2", 0x100000, 0xc4cf5548, 3 | BRF_GRA }, // 3 / CXK388000 - { "050-c3.c3", 0x100000, 0x03422c1e, 3 | BRF_GRA }, // 4 / CXK388000 - { "050-c4.c4", 0x100000, 0x0845eadb, 3 | BRF_GRA }, // 5 / CXK388000 - - { "050-m1.m1", 0x020000, 0x6fcf07d3, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / CXK381003 - - { "050-v1.v1", 0x100000, 0x23c3ab42, 5 | BRF_SND }, // 7 Sound data / CXK388000 - { "050-v2.v2", 0x080000, 0x80b8a984, 5 | BRF_SND }, // 8 / CXK384000 -}; - -STDROMPICKEXT(ncommand, ncommand, neogeo) -STD_ROM_FN(ncommand) - -struct BurnDriver BurnDrvncommand = { - "ncommand", NULL, "neogeo", NULL, "1992", - "Ninja Commando\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VERSHOOT, 0, - NULL, ncommandRomInfo, ncommandRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// World Heroes (ALM-005) -/* MVS VERSION */ - -static struct BurnRomInfo wh1RomDesc[] = { - { "053-epr.p1", 0x080000, 0xd42e1e9a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / D27C400 - { "053-epr.p2", 0x080000, 0x0e33e8a3, 1 | BRF_ESS | BRF_PRG }, // 1 / D27C400 - /* P's on eprom, correct chip label unknown */ - /* also found MVS set with p1 / p2 on TC534200 on PROG board NEO-MVS PROG16; chip labels are 053-P1 and 053-P2 - and M1 on TC541000 on CHA board NEO-MVS CHA42G-1; 53 is hand written on the chip */ - - { "053-s1.s1", 0x020000, 0x8c2c2d6b, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "053-c1.c1", 0x200000, 0x85eb5bce, 3 | BRF_GRA }, // 3 Sprite data - { "053-c2.c2", 0x200000, 0xec93b048, 3 | BRF_GRA }, // 4 - { "053-c3.c3", 0x100000, 0x0dd64965, 3 | BRF_GRA }, // 5 - { "053-c4.c4", 0x100000, 0x9270d954, 3 | BRF_GRA }, // 6 - - { "053-m1.m1", 0x020000, 0x1bd9d04b, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC54H1000 - - { "053-v2.v2", 0x200000, 0xa68df485, 5 | BRF_SND }, // 8 Sound data - { "053-v4.v4", 0x100000, 0x7bea8f66, 5 | BRF_SND }, // 9 -}; - -STDROMPICKEXT(wh1, wh1, neogeo) -STD_ROM_FN(wh1) - -struct BurnDriver BurnDrvwh1 = { - "wh1", NULL, "neogeo", NULL, "1992", - "World Heroes (ALM-005)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, 0, - NULL, wh1RomInfo, wh1RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - - -// World Heroes (ALH-005) -/* AES VERSION */ - -static struct BurnRomInfo wh1hRomDesc[] = { - /* also found AES set with p1 / p2 on eprom; correct chip label unknown - and v1 / v2 on PROG board NEO-AEG PROG-G2; chip labels are 053-V2 and 053-V4 - also M1 on TC541000 on CHA board NEO-AEG CHA42G-2C; 53 is hand written on the chip */ - - { "053-p1.p1", 0x080000, 0x95b574cb, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - { "053-p2.p2", 0x080000, 0xf198ed45, 1 | BRF_ESS | BRF_PRG }, // 1 / TC534200 - - { "053-s1.s1", 0x020000, 0x8c2c2d6b, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "053-c1.c1", 0x200000, 0x85eb5bce, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "053-c2.c2", 0x200000, 0xec93b048, 3 | BRF_GRA }, // 4 / TC5316200 - { "053-c3.c3", 0x100000, 0x0dd64965, 3 | BRF_GRA }, // 5 / TC538200 - { "053-c4.c4", 0x100000, 0x9270d954, 3 | BRF_GRA }, // 6 / TC538200 - - { "053-m1.m1", 0x020000, 0x1bd9d04b, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "053-v2.v2", 0x200000, 0xa68df485, 5 | BRF_SND }, // 8 Sound data / TC5316200 - { "053-v4.v4", 0x100000, 0x7bea8f66, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(wh1h, wh1h, neogeo) -STD_ROM_FN(wh1h) - -struct BurnDriver BurnDrvwh1h = { - "wh1h", "wh1", "neogeo", NULL, "1992", - "World Heroes (ALH-005)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, 0, - NULL, wh1hRomInfo, wh1hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - - -// World Heroes (set 3) - -static struct BurnRomInfo wh1haRomDesc[] = { - { "053-p1_a.p1", 0x080000, 0xed29fde2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "053-p2_a.p2", 0x080000, 0x98f2b158, 1 | BRF_ESS | BRF_PRG }, // 1 - /* Correct chip labels for p1 and p2 unknown */ - - { "053-s1.s1", 0x020000, 0x8c2c2d6b, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "053-c1.c1", 0x200000, 0x85eb5bce, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "053-c2.c2", 0x200000, 0xec93b048, 3 | BRF_GRA }, // 4 / TC5316200 - { "053-c3.c3", 0x100000, 0x0dd64965, 3 | BRF_GRA }, // 5 / TC538200 - { "053-c4.c4", 0x100000, 0x9270d954, 3 | BRF_GRA }, // 6 / TC538200 - - { "053-m1.m1", 0x020000, 0x1bd9d04b, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "053-v2.v2", 0x200000, 0xa68df485, 5 | BRF_SND }, // 8 Sound data / TC5316200 - { "053-v4.v4", 0x100000, 0x7bea8f66, 5 | BRF_SND }, // 9 / TC538200 -}; - -STDROMPICKEXT(wh1ha, wh1ha, neogeo) -STD_ROM_FN(wh1ha) - -struct BurnDriver BurnDrvwh1ha = { - "wh1ha", "wh1", "neogeo", NULL, "1992", - "World Heroes (set 3)\0", NULL, "Alpha Denshi Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, 0, - NULL, wh1haRomInfo, wh1haRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// World Heroes 2 (ALM-006)(ALH-006) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo wh2RomDesc[] = { - { "057-p1.p1", 0x200000, 0x65a891d9, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "057-s1.s1", 0x020000, 0xfcaeb3a4, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "057-c1.c1", 0x200000, 0x21c6bb91, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "057-c2.c2", 0x200000, 0xa3999925, 3 | BRF_GRA }, // 3 / TC5316200 - { "057-c3.c3", 0x200000, 0xb725a219, 3 | BRF_GRA }, // 4 / TC5316200 - { "057-c4.c4", 0x200000, 0x8d96425e, 3 | BRF_GRA }, // 5 / TC5316200 - { "057-c5.c5", 0x200000, 0xb20354af, 3 | BRF_GRA }, // 6 / TC5316200 - { "057-c6.c6", 0x200000, 0xb13d1de3, 3 | BRF_GRA }, // 7 / TC5316200 - - { "057-m1.m1", 0x020000, 0x8fa3bc77, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / TC531001 - - { "057-v1.v1", 0x200000, 0x8877e301, 5 | BRF_SND }, // 9 Sound data / TC5316200 - { "057-v2.v2", 0x200000, 0xc1317ff4, 5 | BRF_SND }, // 10 / TC5316200 -}; - -STDROMPICKEXT(wh2, wh2, neogeo) -STD_ROM_FN(wh2) - -struct BurnDriver BurnDrvwh2 = { - "wh2", NULL, "neogeo", NULL, "1993", - "World Heroes 2 (ALM-006)(ALH-006)\0", NULL, "ADK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, wh2RomInfo, wh2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// World Heroes 2 Jet (ADM-007)(ADH-007) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo wh2jRomDesc[] = { - /* also found AES set with PROG board NEO-AEG PROGRKB and CHA board NEO-AEG CHA256[B]; - same layouts and chip labels (on maskroms) */ - { "064-p1.p1", 0x200000, 0x385a2e86, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "064-s1.s1", 0x020000, 0x2a03998a, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - /* Different layout with 4xC (32mbit) on mask rom also exists on board NEO-MVS CHA256; - / chip labels are 064-C13, 064-C24, 064-C57 and 064-C68 */ - { "064-c1.c1", 0x200000, 0x2ec87cea, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "064-c2.c2", 0x200000, 0x526b81ab, 3 | BRF_GRA }, // 3 / TC5316200 - { "064-c3.c3", 0x200000, 0x436d1b31, 3 | BRF_GRA }, // 4 / TC5316200 - { "064-c4.c4", 0x200000, 0xf9c8dd26, 3 | BRF_GRA }, // 5 / TC5316200 - { "064-c5.c5", 0x200000, 0x8e34a9f4, 3 | BRF_GRA }, // 6 / TC5316200 - { "064-c6.c6", 0x200000, 0xa43e4766, 3 | BRF_GRA }, // 7 / TC5316200 - { "064-c7.c7", 0x200000, 0x59d97215, 3 | BRF_GRA }, // 8 / TC5316200 - { "064-c8.c8", 0x200000, 0xfc092367, 3 | BRF_GRA }, // 9 / TC5316200 - - { "064-m1.m1", 0x020000, 0xd2eec9d3, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "064-v1.v1", 0x200000, 0xaa277109, 5 | BRF_SND }, // 7 Sound data / TC5316200 - { "064-v2.v2", 0x200000, 0xb6527edd, 5 | BRF_SND }, // 8 / TC5316200 -}; - -STDROMPICKEXT(wh2j, wh2j, neogeo) -STD_ROM_FN(wh2j) - -struct BurnDriver BurnDrvwh2j = { - "wh2j", NULL, "neogeo", NULL, "1994", - "World Heroes 2 Jet (ADM-007)(ADH-007)\0", NULL, "ADK / SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, wh2jRomInfo, wh2jRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Aggressors of Dark Kombat / Tsuukai GANGAN Koushinkyoku (ADM-008)(ADH-008) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo aodkRomDesc[] = { - { "074-p1.p1", 0x200000, 0x62369553, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "074-s1.s1", 0x020000, 0x96148d2b, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "074-c1.c1", 0x200000, 0xa0b39344, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "074-c2.c2", 0x200000, 0x203f6074, 3 | BRF_GRA }, // 3 / TC5316200 - { "074-c3.c3", 0x200000, 0x7fff4d41, 3 | BRF_GRA }, // 4 / TC5316200 - { "074-c4.c4", 0x200000, 0x48db3e0a, 3 | BRF_GRA }, // 5 / TC5316200 - { "074-c5.c5", 0x200000, 0xc74c5e51, 3 | BRF_GRA }, // 6 / TC5316200 - { "074-c6.c6", 0x200000, 0x73e8e7e0, 3 | BRF_GRA }, // 7 / TC5316200 - { "074-c7.c7", 0x200000, 0xac7daa01, 3 | BRF_GRA }, // 8 / TC5316200 - { "074-c8.c8", 0x200000, 0x14e7ad71, 3 | BRF_GRA }, // 9 / TC5316200 - - { "074-m1.m1", 0x020000, 0x5a52a9d1, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "074-v1.v1", 0x200000, 0x7675b8fa, 5 | BRF_SND }, // 11 Sound data / TC5316200 - { "074-v2.v2", 0x200000, 0xa9da86e9, 5 | BRF_SND }, // 12 / TC5316200 -}; - -STDROMPICKEXT(aodk, aodk, neogeo) -STD_ROM_FN(aodk) - -struct BurnDriver BurnDrvaodk = { - "aodk", NULL, "neogeo", NULL, "1994", - "Aggressors of Dark Kombat / Tsuukai GANGAN Koushinkyoku (ADM-008)(ADH-008)\0", NULL, "ADK / SNK", "Neo Geo MVS", - L"Aggressors of Dark Kombat\0\u75DB\u5FEB\uFF27\uFF41\uFF4E\uFF47\uFF41\uFF4E\u884C\u9032\u66F2 (ADM-008)(ADH-008)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, aodkRomInfo, aodkRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// World Heroes Perfect - -static struct BurnRomInfo whpRomDesc[] = { - /* It also exists MVS sets with PROG board NEO-MVS PROGGSC and CHA board NEO-MVS CHA256, - PROG board NEO-MVS PROGGSC and CHA board NEO-MVS CHA256B, PROG board NEO-MVS PROGBK1 - and NEO-MVS CHA256B; same chip labels */ - { "090-p1.p1", 0x200000, 0xafaa4702, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - - { "090-s1.s1", 0x020000, 0x174a880f, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "090-c1.c1", 0x400000, 0xcd30ed9b, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5332205 - { "090-c2.c2", 0x400000, 0x10eed5ee, 3 | BRF_GRA }, // 3 / mask rom TC5332205 - { "064-c3.c3", 0x200000, 0x436d1b31, 3 | BRF_GRA }, // 4 / mask rom TC5316200 - { "064-c4.c4", 0x200000, 0xf9c8dd26, 3 | BRF_GRA }, // 5 / mask rom TC5316200 - { "064-c5.c5", 0x200000, 0x8e34a9f4, 3 | BRF_GRA }, // 6 / mask rom TC5316200 - { "064-c6.c6", 0x200000, 0xa43e4766, 3 | BRF_GRA }, // 7 / mask rom TC5316200 - { "064-c7.c7", 0x200000, 0x59d97215, 3 | BRF_GRA }, // 8 / mask rom TC5316200 - { "064-c8.c8", 0x200000, 0xfc092367, 3 | BRF_GRA }, // 9 / mask rom TC5316200 - - { "090-m1.m1", 0x020000, 0x28065668, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / mask rom TC531001 - - { "090-v1.v1", 0x200000, 0x30cf2709, 5 | BRF_SND }, // 11 Sound data / mask rom TC5316200 - { "064-v2.v2", 0x200000, 0xb6527edd, 5 | BRF_SND }, // 12 / mask rom TC5316200 - { "090-v3.v3", 0x200000, 0x1908a7ce, 5 | BRF_SND }, // 13 / mask rom TC5316200 -}; - -STDROMPICKEXT(whp, whp, neogeo) -STD_ROM_FN(whp) - -struct BurnDriver BurnDrvwhp = { - "whp", NULL, "neogeo", NULL, "1995", - "World Heroes Perfect\0", NULL, "ADK / SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, whpRomInfo, whpRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Syougi No Tatsujin - Master of Syougi - -static struct BurnRomInfo moshougiRomDesc[] = { - { "203-p1.p1", 0x100000, 0x7ba70e2d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "203-s1.s1", 0x020000, 0xbfdc8309, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "203-c1.c1", 0x200000, 0xbba9e8c0, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "203-c2.c2", 0x200000, 0x2574be03, 3 | BRF_GRA }, // 3 / TC5316200 - - { "203-m1.m1", 0x020000, 0xa602c2c2, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / TC531001 - - { "203-v1.v1", 0x200000, 0xbaa2b9a5, 5 | BRF_SND }, // 5 Sound data / TC5316200 -}; - -STDROMPICKEXT(moshougi, moshougi, neogeo) -STD_ROM_FN(moshougi) - -struct BurnDriver BurnDrvmoshougi = { - "moshougi", NULL, "neogeo", NULL, "1995", - "Syougi No Tatsujin - Master of Shougi\0", NULL, "ADK / SNK", "Neo Geo MVS", - L"\u5C06\u68CB\u306E\u9054\u4EBA\0Master of Shougi\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, moshougiRomInfo, moshougiRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Over Top - -static struct BurnRomInfo overtopRomDesc[] = { - { "212-p1.p1", 0x200000, 0x16c063a9, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - - { "212-s1.s1", 0x020000, 0x481d3ddc, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "212-c1.c1", 0x400000, 0x50f43087, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5332205 - { "212-c2.c2", 0x400000, 0xa5b39807, 3 | BRF_GRA }, // 3 / mask rom TC5332205 - { "212-c3.c3", 0x400000, 0x9252ea02, 3 | BRF_GRA }, // 4 / mask rom TC5332205 - { "212-c4.c4", 0x400000, 0x5f41a699, 3 | BRF_GRA }, // 5 / mask rom TC5332205 - { "212-c5.c5", 0x200000, 0xfc858bef, 3 | BRF_GRA }, // 6 / mask rom TC5316200 - { "212-c6.c6", 0x200000, 0x0589c15e, 3 | BRF_GRA }, // 7 / mask rom TC5316200 - - { "212-m1.m1", 0x020000, 0xfcab6191, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / mask rom TC531001 - - { "212-v1.v1", 0x400000, 0x013d4ef9, 5 | BRF_SND }, // 9 Sound data / mask rom TC5332204 -}; - -STDROMPICKEXT(overtop, overtop, neogeo) -STD_ROM_FN(overtop) - -struct BurnDriver BurnDrvovertop = { - "overtop", NULL, "neogeo", NULL, "1996", - "Over Top\0", NULL, "ADK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_RACING, 0, - NULL, overtopRomInfo, overtopRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Ninja Master's - haoh-ninpo-cho -/* MVS AND AES VERSION? */ - -static struct BurnRomInfo ninjamasRomDesc[] = { - /* also found AES set with PROG board NEO-AEG PROGBK1Y and CHA board NEO-AEG CHA256RY - same layouts and chip labels (on mask roms) */ - { "217-p1.p1", 0x100000, 0x3e97ed69, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "217-p2.sp2", 0x200000, 0x191fca88, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5316200 - - { "217-s1.s1", 0x020000, 0x8ff782f0, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "217-c1.c1", 0x400000, 0x5fe97bc4, 3 | BRF_GRA }, // 3 Sprite data / TC5332205 - { "217-c2.c2", 0x400000, 0x886e0d66, 3 | BRF_GRA }, // 4 / TC5332205 - { "217-c3.c3", 0x400000, 0x59e8525f, 3 | BRF_GRA }, // 5 / TC5332205 - { "217-c4.c4", 0x400000, 0x8521add2, 3 | BRF_GRA }, // 6 / TC5332205 - { "217-c5.c5", 0x400000, 0xfb1896e5, 3 | BRF_GRA }, // 7 / TC5332205 - { "217-c6.c6", 0x400000, 0x1c98c54b, 3 | BRF_GRA }, // 8 / TC5332205 - { "217-c7.c7", 0x400000, 0x8b0ede2e, 3 | BRF_GRA }, // 9 / TC5332205 - { "217-c8.c8", 0x400000, 0xa085bb61, 3 | BRF_GRA }, // 10 / TC5332205 - - { "217-m1.m1", 0x020000, 0xd00fb2af, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / TC531001 - - { "217-v1.v1", 0x400000, 0x1c34e013, 5 | BRF_SND }, // 12 Sound data / TC5332204 - { "217-v2.v2", 0x200000, 0x22f1c681, 5 | BRF_SND }, // 13 / TC5316200 -}; - -STDROMPICKEXT(ninjamas, ninjamas, neogeo) -STD_ROM_FN(ninjamas) - -struct BurnDriver BurnDrvninjamas = { - "ninjamas", NULL, "neogeo", NULL, "1996", - "Ninja Master's - haoh-ninpo-cho\0", NULL, "ADK / SNK", "Neo Geo MVS", - L"Ninja master's \u8987\u738B\u5FCD\u6CD5\u5E16\0Ninja Master's haoh ninpo cho\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, ninjamasRomInfo, ninjamasRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Twinkle Star Sprites - -static struct BurnRomInfo twinspriRomDesc[] = { - { "224-p1.p1", 0x200000, 0x7697e445, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "224-s1.s1", 0x020000, 0xeeed5758, 2 | BRF_GRA }, // 1 Text layer tiles - - { "224-c1.c1", 0x400000, 0xf7da64ab, 3 | BRF_GRA }, // 2 Sprite data - { "224-c2.c2", 0x400000, 0x4c09bbfb, 3 | BRF_GRA }, // 3 - { "224-c3.c3", 0x100000, 0xc59e4129, 3 | BRF_GRA }, // 4 - { "224-c4.c4", 0x100000, 0xb5532e53, 3 | BRF_GRA }, // 5 - - { "224-m1.m1", 0x020000, 0x364d6f96, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "224-v1.v1", 0x400000, 0xff57f088, 5 | BRF_SND }, // 7 Sound data - { "224-v2.v2", 0x200000, 0x7ad26599, 5 | BRF_SND }, // 8 -}; - -STDROMPICKEXT(twinspri, twinspri, neogeo) -STD_ROM_FN(twinspri) - -struct BurnDriver BurnDrvtwinspri = { - "twinspri", NULL, "neogeo", NULL, "1996", - "Twinkle Star Sprites\0", NULL, "ADK", "Neo Geo MVS", - L"TwinkleStar Sprites\0\u30C6\u30A3\u30F3\u30AF\u30EB\u30B9\u30BF\u30FC\u30B9\u30D7\u30E9\u30A4\u30C4\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VERSHOOT, 0, - NULL, twinspriRomInfo, twinspriRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Zintrick / Oshidashi Zentrix (hack / bootleg) - -static struct BurnRomInfo zintrckbRomDesc[] = { - { "zin-p1.bin", 0x100000, 0x06c8fca7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "zin-s1.bin", 0x020000, 0xa7ab0e81, 2 | BRF_GRA }, // 1 Text layer tiles - - { "zin-c1.bin", 0x200000, 0x76aee189, 3 | BRF_GRA }, // 2 Sprite data - { "zin-c2.bin", 0x200000, 0x844ed4b3, 3 | BRF_GRA }, // 3 - - { "zin-m1.bin", 0x020000, 0xfd9627ca, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "zin-v1.bin", 0x200000, 0xc09f74f1, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(zintrckb, zintrckb, neogeo) -STD_ROM_FN(zintrckb) - -struct BurnDriver BurnDrvzintrckb = { - "zintrckb", NULL, "neogeo", NULL, "1996", - "Zintrick / Oshidashi Zentrix (hack / bootleg)\0", NULL, "hack / bootleg", "Neo Geo MVS", - L"Zintrick\0\u62BC\u3057\u51FA\u3057\u30B8\u30F3\u30C8\u30EA\u30C3\u30AF (hack / bootleg)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, zintrckbRomInfo, zintrckbRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Viewpoint - -static struct BurnRomInfo viewpoinRomDesc[] = { - { "051-p1.p1", 0x100000, 0x17aa899d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / CXK388002 - - { "051-s1.s1", 0x020000, 0x9fea5758, 2 | BRF_GRA }, // 1 Text layer tiles / CXK381000 - - { "051-c1.c1", 0x200000, 0xd624c132, 3 | BRF_GRA }, // 2 Sprite data / CXK381600 - { "051-c2.c2", 0x200000, 0x40d69f1e, 3 | BRF_GRA }, // 3 / CXK381600 - - { "051-m1.m1", 0x020000, 0x8e69f29a, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / CXK381003 - - /* What board was originally used (labels 051-V2 and 051-V4)? MVS is twice confirmed on NEO-MVS PROG-G2 */ - { "051-v2.v1", 0x200000, 0x019978b6, 5 | BRF_SND }, // 5 Sound data / CXK381600 - { "051-v4.v2", 0x200000, 0x5758f38c, 5 | BRF_SND }, // 6 / CXK381600 -}; - -STDROMPICKEXT(viewpoin, viewpoin, neogeo) -STD_ROM_FN(viewpoin) - -struct BurnDriver BurnDrvviewpoin = { - "viewpoin", NULL, "neogeo", NULL, "1992", - "Viewpoint\0", NULL, "Sammy / Aicom", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_SHOOT, 0, - NULL, viewpoinRomInfo, viewpoinRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Jyanshin Densetsu - Quest of Jongmaster -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo janshinRomDesc[] = { - { "048-p1.p1", 0x100000, 0xfa818cbb, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - - { "048-s1.s1", 0x020000, 0x8285b25a, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "048-c1.c1", 0x200000, 0x3fa890e9, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5316200 - { "048-c2.c1", 0x200000, 0x59c48ad8, 3 | BRF_GRA }, // 3 / mask rom TC5316200 - - { "048-m1.m1", 0x020000, 0x310467c7, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / mask rom TC531001 - - { "048-v1.v1", 0x200000, 0xf1947d2b, 5 | BRF_SND }, // 5 Sound data / mask rom TC5316200 -}; - -STDROMPICKEXT(janshin, janshin, neogeo) -STD_ROM_FN(janshin) - -struct BurnDriver BurnDrvjanshin = { - "janshin", NULL, "neogeo", NULL, "1994", - "Jyanshin Densetsu - Quest of Jongmaster\0", NULL, "Aicom", "Neo Geo MVS", - L"\u96C0\u795E\u4F1D\u8AAC - quest of jongmaster\0Jyanshin Densetsu\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_MAHJONG, GBF_MAHJONG, 0, - NULL, janshinRomInfo, janshinRomName, NULL, NULL, neomahjongInputInfo, neomahjongDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Pulstar - -static struct BurnRomInfo pulstarRomDesc[] = { - { "089-p1.p1", 0x100000, 0x5e5847a2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - { "089-p2.sp2", 0x200000, 0x028b774c, 1 | BRF_ESS | BRF_PRG }, // 1 / mask rom TC5316200 - - { "089-s1.s1", 0x020000, 0xc79fc2c8, 2 | BRF_GRA }, // 2 Text layer tiles / mask rom TC531000 - - { "089-c1.c1", 0x400000, 0xf4e97332, 3 | BRF_GRA }, // 3 Sprite data / mask rom TC5332205 - { "089-c2.c2", 0x400000, 0x836d14da, 3 | BRF_GRA }, // 4 / mask rom TC5332205 - { "089-c3.c3", 0x400000, 0x913611c4, 3 | BRF_GRA }, // 5 / mask rom TC5332205 - { "089-c4.c4", 0x400000, 0x44cef0e3, 3 | BRF_GRA }, // 6 / mask rom TC5332205 - { "089-c5.c5", 0x400000, 0x89baa1d7, 3 | BRF_GRA }, // 7 / mask rom TC5332205 - { "089-c6.c6", 0x400000, 0xb2594d56, 3 | BRF_GRA }, // 8 / mask rom TC5332205 - { "089-c7.c7", 0x200000, 0x6a5618ca, 3 | BRF_GRA }, // 9 / mask rom TC5316200 - { "089-c8.c8", 0x200000, 0xa223572d, 3 | BRF_GRA }, // 10 / mask rom TC5316200 - - { "089-m1.m1", 0x020000, 0xff3df7c7, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / mask rom TC531001 - - { "089-v1.v1", 0x400000, 0x6f726ecb, 5 | BRF_SND }, // 12 Sound data / mask rom TC5332204 - { "089-v2.v2", 0x400000, 0x9d2db551, 5 | BRF_SND }, // 13 / mask rom TC5332204 -}; - -STDROMPICKEXT(pulstar, pulstar, neogeo) -STD_ROM_FN(pulstar) - -struct BurnDriver BurnDrvpulstar = { - "pulstar", NULL, "neogeo", NULL, "1995", - "Pulstar\0", NULL, "Aicom", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_HORSHOOT, 0, - NULL, pulstarRomInfo, pulstarRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Blazing Star - -static struct BurnRomInfo blazstarRomDesc[] = { - { "239-p1.p1", 0x100000, 0x183682f8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "239-p2.sp2", 0x200000, 0x9a9f4154, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "239-s1.s1", 0x020000, 0xd56cb498, 2 | BRF_GRA }, // 2 Text layer tiles - - { "239-c1.c1", 0x400000, 0x84f6d584, 3 | BRF_GRA }, // 3 Sprite data - { "239-c2.c2", 0x400000, 0x05a0cb22, 3 | BRF_GRA }, // 4 - { "239-c3.c3", 0x400000, 0x5fb69c9e, 3 | BRF_GRA }, // 5 - { "239-c4.c4", 0x400000, 0x0be028c4, 3 | BRF_GRA }, // 6 - { "239-c5.c5", 0x400000, 0x74bae5f8, 3 | BRF_GRA }, // 7 - { "239-c6.c6", 0x400000, 0x4e0700d2, 3 | BRF_GRA }, // 8 - { "239-c7.c7", 0x400000, 0x010ff4fd, 3 | BRF_GRA }, // 9 - { "239-c8.c8", 0x400000, 0xdb60460e, 3 | BRF_GRA }, // 10 - - { "239-m1.m1", 0x020000, 0xd31a3aea, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "239-v1.v1", 0x400000, 0x1b8d5bf7, 5 | BRF_SND }, // 12 Sound data - { "239-v2.v2", 0x400000, 0x74cf0a70, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(blazstar, blazstar, neogeo) -STD_ROM_FN(blazstar) - -struct BurnDriver BurnDrvblazstar = { - "blazstar", NULL, "neogeo", NULL, "1998", - "Blazing Star\0", NULL, "Yumekobo", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_HORSHOOT, 0, - NULL, blazstarRomInfo, blazstarRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Prehistoric Isle 2 -/* Original Version, Encrypted GFX */ /* MVS ONLY RELEASE */ - -static struct BurnRomInfo preisle2RomDesc[] = { - { "255-p1.p1", 0x100000, 0xdfa3c0f3, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "255-p2.sp2", 0x400000, 0x42050b80, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "255-c1.c1", 0x800000, 0xea06000b, 3 | BRF_GRA }, // 2 Sprite data - { "255-c2.c2", 0x800000, 0x04e67d79, 3 | BRF_GRA }, // 3 - { "255-c3.c3", 0x800000, 0x60e31e08, 3 | BRF_GRA }, // 4 - { "255-c4.c4", 0x800000, 0x40371d69, 3 | BRF_GRA }, // 5 - { "255-c5.c5", 0x800000, 0x0b2e6adf, 3 | BRF_GRA }, // 6 - { "255-c6.c6", 0x800000, 0xb001bdd3, 3 | BRF_GRA }, // 7 - - { "255-m1.m1", 0x020000, 0x8efd4014, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code - - { "255-v1.v1", 0x400000, 0x5a14543d, 5 | BRF_SND }, // 9 Sound data - { "255-v2.v2", 0x200000, 0x6610d91a, 5 | BRF_SND }, // 10 -}; - -STDROMPICKEXT(preisle2, preisle2, neogeo) -STD_ROM_FN(preisle2) - -INT32 preisle2Init() -{ - nNeoProtectionXor = 0x9F; - return NeoInit(); -} - -struct BurnDriver BurnDrvpreisle2 = { - "preisle2", NULL, "neogeo", NULL, "1999", - "Prehistoric Isle 2\0", NULL, "Yumekobo", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42, GBF_HORSHOOT, 0, - NULL, preisle2RomInfo, preisle2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - preisle2Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Spin Master / Miracle Adventure - -static struct BurnRomInfo spinmastRomDesc[] = { - { "062-p1.p1", 0x100000, 0x37aba1aa, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - { "062-p2.sp2", 0x100000, 0xf025ab77, 1 | BRF_ESS | BRF_PRG }, // 1 / mask rom TC538200 - - { "062-s1.s1", 0x020000, 0x289e2bbe, 2 | BRF_GRA }, // 2 Text layer tiles / mask rom TC531000 - - { "062-c1.c1", 0x100000, 0xa9375aa2, 3 | BRF_GRA }, // 3 Sprite data / mask rom TC538200 - { "062-c2.c2", 0x100000, 0x0e73b758, 3 | BRF_GRA }, // 4 / mask rom TC538200 - { "062-c3.c3", 0x100000, 0xdf51e465, 3 | BRF_GRA }, // 5 / mask rom TC538200 - { "062-c4.c4", 0x100000, 0x38517e90, 3 | BRF_GRA }, // 6 / mask rom TC538200 - { "062-c5.c5", 0x100000, 0x7babd692, 3 | BRF_GRA }, // 7 / mask rom TC538200 - { "062-c6.c6", 0x100000, 0xcde5ade5, 3 | BRF_GRA }, // 8 / mask rom TC538200 - { "062-c7.c7", 0x100000, 0xbb2fd7c0, 3 | BRF_GRA }, // 9 / mask rom TC538200 - { "062-c8.c8", 0x100000, 0x8d7be933, 3 | BRF_GRA }, // 10 / mask rom TC538200 - - { "062-m1.m1", 0x020000, 0x76108b2f, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / mask rom TC531001 - - { "062-v1.v1", 0x100000, 0xcc281aef, 5 | BRF_SND }, // 12 Sound data / mask rom TC538200 -}; - -STDROMPICKEXT(spinmast, spinmast, neogeo) -STD_ROM_FN(spinmast) - -struct BurnDriver BurnDrvspinmast = { - "spinmast", NULL, "neogeo", NULL, "1993", - "Spin Master / Miracle Adventure\0", NULL, "Data East Corporation", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, 0, - NULL, spinmastRomInfo, spinmastRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Windjammers / Flying Power Disc -/* MVS AND AES VERSION? */ - -static struct BurnRomInfo wjammersRomDesc[] = { - /* also found AES set with PROG board NEO-AEG PROG42G-1 and CHA board NEO-AEG CHA42G-1 - same layouts and chip labels */ - { "065-p1.p1", 0x100000, 0x6692c140, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - - { "065-s1.s1", 0x020000, 0x074b5723, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "065-c1.c1", 0x100000, 0xc7650204, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC538200 - { "065-c2.c2", 0x100000, 0xd9f3e71d, 3 | BRF_GRA }, // 3 / mask rom TC538200 - { "065-c3.c3", 0x100000, 0x40986386, 3 | BRF_GRA }, // 4 / mask rom TC538200 - { "065-c4.c4", 0x100000, 0x715e15ff, 3 | BRF_GRA }, // 5 / mask rom TC538200 - - { "065-m1.m1", 0x020000, 0x52c23cfc, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / mask rom TC531001 - - { "065-v1.v1", 0x100000, 0xce8b3698, 5 | BRF_SND }, // 7 Sound data / mask rom TC538200 - { "065-v2.v2", 0x100000, 0x659f9b96, 5 | BRF_SND }, // 8 / mask rom TC538200 - { "065-v3.v3", 0x100000, 0x39f73061, 5 | BRF_SND }, // 9 / mask rom TC538200 - { "065-v4.v4", 0x100000, 0x5dee7963, 5 | BRF_SND }, // 10 / mask rom TC538200 -}; - -STDROMPICKEXT(wjammers, wjammers, neogeo) -STD_ROM_FN(wjammers) - -struct BurnDriver BurnDrvwjammers = { - "wjammers", NULL, "neogeo", NULL, "1994", - "Windjammers / Flying Power Disc\0", NULL, "Data East Corporation", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, wjammersRomInfo, wjammersRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Karnov's Revenge / Fighter's History Dynamite - -static struct BurnRomInfo karnovrRomDesc[] = { - { "066-p1.p1", 0x100000, 0x8c86fd22, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "066-s1.s1", 0x020000, 0xbae5d5e5, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "066-c1.c1", 0x200000, 0x09dfe061, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "066-c2.c2", 0x200000, 0xe0f6682a, 3 | BRF_GRA }, // 3 / TC5316200 - { "066-c3.c3", 0x200000, 0xa673b4f7, 3 | BRF_GRA }, // 4 / TC5316200 - { "066-c4.c4", 0x200000, 0xcb3dc5f4, 3 | BRF_GRA }, // 5 / TC5316200 - { "066-c5.c5", 0x200000, 0x9a28785d, 3 | BRF_GRA }, // 6 / TC5316200 - { "066-c6.c6", 0x200000, 0xc15c01ed, 3 | BRF_GRA }, // 7 / TC5316200 - - { "066-m1.m1", 0x020000, 0x030beae4, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / TC531001 - - { "066-v1.v1", 0x200000, 0x0b7ea37a, 5 | BRF_SND }, // 9 Sound data / TC5316200 -}; - -STDROMPICKEXT(karnovr, karnovr, neogeo) -STD_ROM_FN(karnovr) - -struct BurnDriver BurnDrvkarnovr = { - "karnovr", NULL, "neogeo", NULL, "1994", - "Karnov's Revenge / Fighter's History Dynamite\0", NULL, "Data East Corporation", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, karnovrRomInfo, karnovrRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Street Hoop / Street Slam / Dunk Dream (DEM-004) (DEH-004) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo strhoopRomDesc[] = { - { "079-p1.p1", 0x100000, 0x5e78328e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "079-s1.s1", 0x020000, 0x3ac06665, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "079-c1.c1", 0x200000, 0x0581c72a, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "079-c2.c2", 0x200000, 0x5b9b8fb6, 3 | BRF_GRA }, // 3 / TC5316200 - { "079-c3.c3", 0x200000, 0xcd65bb62, 3 | BRF_GRA }, // 4 / TC5316200 - { "079-c4.c4", 0x200000, 0xa4c90213, 3 | BRF_GRA }, // 5 / TC5316200 - - { "079-m1.m1", 0x020000, 0xbee3455a, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "079-v1.v1", 0x200000, 0x718a2400, 5 | BRF_SND }, // 7 Sound data / TC5316200 - { "079-v2.v2", 0x100000, 0x720774eb, 5 | BRF_SND }, // 8 / TC538200 - /* AES 079-v2 is only 4 mbit (TC534200), data is the same - { "079-v2.v2", 0x080000, 0xb19884f8, 5 | BRF_SND }, // 8 / TC534200 */ -}; - -STDROMPICKEXT(strhoop, strhoop, neogeo) -STD_ROM_FN(strhoop) - -struct BurnDriver BurnDrvstrhoop = { - "strhoop", NULL, "neogeo", NULL, "1994", - "Street Hoop / Street Slam / Dunk Dream (DEM-004) (DEH-004)\0", NULL, "Data East Corporation", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, strhoopRomInfo, strhoopRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Ghostlop (prototype) - -static struct BurnRomInfo ghostlopRomDesc[] = { - { "proto_228-p1.p1", 0x100000, 0x6033172e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "proto_228-s1.s1", 0x020000, 0x83c24e81, 2 | BRF_GRA }, // 1 Text layer tiles - - { "proto_228-c1.c1", 0x400000, 0xbfc99efe, 3 | BRF_GRA }, // 2 Sprite data - { "proto_228-c2.c2", 0x400000, 0x69788082, 3 | BRF_GRA }, // 3 - - { "proto_228-m1.m1", 0x020000, 0xfd833b33, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "proto_228-v1.v1", 0x200000, 0xc603fce6, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(ghostlop, ghostlop, neogeo) -STD_ROM_FN(ghostlop) - -struct BurnDriver BurnDrvghostlop = { - "ghostlop", NULL, "neogeo", NULL, "1996", - "Ghostlop (prototype)\0", NULL, "Data East Corporation", "Neo Geo MVS", - L"Ghostlop \u30B4\u30FC\u30B9\u30C8\u30ED\u30C3\u30D7 (prototype)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, ghostlopRomInfo, ghostlopRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Magical Drop II - -static struct BurnRomInfo magdrop2RomDesc[] = { - { "221-p1.p1", 0x080000, 0x7be82353, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "221-s1.s1", 0x020000, 0x2a4063a3, 2 | BRF_GRA }, // 1 Text layer tiles - - { "221-c1.c1", 0x400000, 0x1f862a14, 3 | BRF_GRA }, // 2 Sprite data - { "221-c2.c2", 0x400000, 0x14b90536, 3 | BRF_GRA }, // 3 - - { "221-m1.m1", 0x020000, 0xbddae628, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "221-v1.v1", 0x200000, 0x7e5e53e4, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(magdrop2, magdrop2, neogeo) -STD_ROM_FN(magdrop2) - -struct BurnDriver BurnDrvmagdrop2 = { - "magdrop2", NULL, "neogeo", NULL, "1996", - "Magical Drop II\0", NULL, "Data East Corporation", "Neo Geo MVS", - L"Magical Drop II\0\u30DE\u30B8\u30AB\u30EB\u30C9\u30ED\u30C3\u30D7\uFF12\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, magdrop2RomInfo, magdrop2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Magical Drop III - -static struct BurnRomInfo magdrop3RomDesc[] = { - { "233-p1.p1", 0x100000, 0x931e17fa, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "233-s1.s1", 0x020000, 0x7399e68a, 2 | BRF_GRA }, // 1 Text layer tiles - - { "233-c1.c1", 0x400000, 0x65e3f4c4, 3 | BRF_GRA }, // 2 Sprite data - { "233-c2.c2", 0x400000, 0x35dea6c9, 3 | BRF_GRA }, // 3 - { "233-c3.c3", 0x400000, 0x0ba2c502, 3 | BRF_GRA }, // 4 - { "233-c4.c4", 0x400000, 0x70dbbd6d, 3 | BRF_GRA }, // 5 - - { "233-m1.m1", 0x020000, 0x5beaf34e, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "233-v1.v1", 0x400000, 0x58839298, 5 | BRF_SND }, // 7 Sound data - { "233-v2.v2", 0x080000, 0xd5e30df4, 5 | BRF_SND }, // 8 -}; - -STDROMPICKEXT(magdrop3, magdrop3, neogeo) -STD_ROM_FN(magdrop3) - -struct BurnDriver BurnDrvmagdrop3 = { - "magdrop3", NULL, "neogeo", NULL, "1997", - "Magical Drop III\0", NULL, "Data East Corporation", "Neo Geo MVS", - L"Magical Drop III\0\u30DE\u30B8\u30AB\u30EB\u30C9\u30ED\u30C3\u30D7III\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, magdrop3RomInfo, magdrop3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Nightmare in the Dark -/* Original Version - Encrypted GFX */ /* MVS ONLY RELEASE */ - -static struct BurnRomInfo nitdRomDesc[] = { - { "260-p1.p1", 0x080000, 0x61361082, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "260-c1.c1", 0x800000, 0x147b0c7f, 3 | BRF_GRA }, // 1 Sprite data - { "260-c2.c2", 0x800000, 0xd2b04b0d, 3 | BRF_GRA }, // 2 - - { "260-m1.m1", 0x080000, 0x6407c5e5, 4 | BRF_ESS | BRF_PRG }, // 3 Z80 code - - { "260-v1.v1", 0x400000, 0x24b0480c, 5 | BRF_SND }, // 4 Sound data -}; - -STDROMPICKEXT(nitd, nitd, neogeo) -STD_ROM_FN(nitd) - -INT32 nitdInit() -{ - nNeoProtectionXor = 0xFF; - return NeoInit(); -} - -struct BurnDriver BurnDrvnitd = { - "nitd", NULL, "neogeo", NULL, "2000", - "Nightmare in the Dark\0", NULL, "Eleven / Gavaking", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42, GBF_PLATFORM, 0, - NULL, nitdRomInfo, nitdRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - nitdInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - - -// Nightmare in the Dark (bootleg) - -static struct BurnRomInfo nitdblRomDesc[] = { - { "nitd-p1.bin", 0x080000, 0x1a05bd1b, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "nitd-s1.bin", 0x020000, 0xdd3bf47c, 2 | BRF_GRA }, // 1 Text layer tiles - - { "nitd-c1.bin", 0x200000, 0xb4353190, 3 | BRF_GRA }, // 2 Sprite data - { "nitd-c2.bin", 0x200000, 0x6e27511f, 3 | BRF_GRA }, // 3 - { "nitd-c3.bin", 0x200000, 0x472cf075, 3 | BRF_GRA }, // 4 - { "nitd-c4.bin", 0x200000, 0x4c3926e6, 3 | BRF_GRA }, // 5 - - { "260-m1.m1", 0x080000, 0x6407c5e5, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "nitd-v1.bin", 0x200000, 0x79008868, 5 | BRF_SND }, // 7 Sound data - { "nitd-v2.bin", 0x200000, 0x728558f9, 5 | BRF_SND }, // 8 -}; - -STDROMPICKEXT(nitdbl, nitdbl, neogeo) -STD_ROM_FN(nitdbl) - -struct BurnDriver BurnDrvnitdbl = { - "nitdbl", "nitd", "neogeo", NULL, "2001", - "Nightmare in the Dark (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, 0, - NULL, nitdblRomInfo, nitdblRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Gururin -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo gururinRomDesc[] = { - /* It also exist MVS set with PROG board NEO-MVS PROG16 and CHA board NEO-MVS CHA256; same chip labels */ - { "067-p1.p1", 0x080000, 0x4cea8a49, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / UM8303B - - { "067-s1.s1", 0x020000, 0xb119e1eb, 2 | BRF_GRA }, // 1 Text layer tiles / UMK300 - - { "067-c1.c1", 0x200000, 0x35866126, 3 | BRF_GRA }, // 2 Sprite data / UMT301B - { "067-c2.c2", 0x200000, 0x9db64084, 3 | BRF_GRA }, // 3 / UMT302B - - { "067-m1.m1", 0x020000, 0x9e3c6328, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / UML359 - - { "067-v1.v1", 0x080000, 0xcf23afd0, 5 | BRF_SND }, // 5 Sound data / UM8302 -}; - -STDROMPICKEXT(gururin, gururin, neogeo) -STD_ROM_FN(gururin) - -struct BurnDriver BurnDrvgururin = { - "gururin", NULL, "neogeo", NULL, "1994", - "Gururin\0", NULL, "Face", "Neo Geo MVS", - L"\u3050\u308B\u308A\u3093\0Gururin\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, gururinRomInfo, gururinRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Money Puzzle Exchanger / Money Idol Exchanger -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo miexchngRomDesc[] = { - { "231-p1.p1", 0x080000, 0x61be1810, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "231-s1.s1", 0x020000, 0xfe0c0c53, 2 | BRF_GRA }, // 1 Text layer tiles - - { "231-c1.c1", 0x200000, 0x6c403ba3, 3 | BRF_GRA }, // 2 Sprite data - { "231-c2.c2", 0x200000, 0x554bcd9b, 3 | BRF_GRA }, // 3 - { "231-c3.c3", 0x100000, 0x4f6f7a63, 3 | BRF_GRA }, // 4 - { "231-c4.c4", 0x100000, 0x2e35e71b, 3 | BRF_GRA }, // 5 - - { "231-m1.m1", 0x020000, 0xde41301b, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "231-v1.v1", 0x400000, 0x113fb898, 5 | BRF_SND }, // 7 Sound data -}; - -STDROMPICKEXT(miexchng, miexchng, neogeo) -STD_ROM_FN(miexchng) - -struct BurnDriver BurnDrvmiexchng = { - "miexchng", NULL, "neogeo", NULL, "1997", - "Money Puzzle Exchanger / Money Idol Exchanger\0", NULL, "Face", "Neo Geo MVS", - L"Money Puzzle Exchanger\0\u30DE\u30CD\u30FC\u30A2\u30A4\u30C9\u30EB\u30A8\u30AF\u30B9\u30C1\u30A7\u30F3\u30B8\u30E3\u30FC\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, miexchngRomInfo, miexchngRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Panic Bomber -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo panicbomRomDesc[] = { - { "073-p1.p1", 0x080000, 0xadc356ad, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC534200 - - { "073-s1.s1", 0x020000, 0xb876de7e, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "073-c1.c1", 0x100000, 0x8582e1b5, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC538200 - { "073-c2.c2", 0x100000, 0xe15a093b, 3 | BRF_GRA }, // 3 / mask rom TC538200 - - { "073-m1.m1", 0x020000, 0x3cdf5d88, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / mask rom TC531001 - - { "073-v1.v1", 0x200000, 0x7fc86d2f, 5 | BRF_SND }, // 5 Sound data / mask rom TC5316200 - { "073-v2.v2", 0x100000, 0x082adfc7, 5 | BRF_SND }, // 6 / mask rom TC538200 -}; - -STDROMPICKEXT(panicbom, panicbom, neogeo) -STD_ROM_FN(panicbom) - -struct BurnDriver BurnDrvpanicbom = { - "panicbom", NULL, "neogeo", NULL, "1994", - "Panic Bomber\0", NULL, "Eighting / Hudson", "Neo Geo MVS", - L"Panic Bomber\0\u3071\u306B\u3063\u304F\u30DC\u30F3\u30D0\u30FC \u30DC\u30F3\u30D0\u30FC\u30DE\u30F3\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, panicbomRomInfo, panicbomRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Far East of Eden - Kabuki Klash / Tengai Makyou - Shin Den - -static struct BurnRomInfo kabukiklRomDesc[] = { - /* also find MVS set with PROG board NEO-MVS PROGTOP and CHA board NOE-MVS CHA256; same chip labels */ - { "092-p1.p1", 0x200000, 0x28ec9b77, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - - { "092-s1.s1", 0x020000, 0xa3d68ee2, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "092-c1.c1", 0x400000, 0x2a9fab01, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5332205 - { "092-c2.c2", 0x400000, 0x6d2bac02, 3 | BRF_GRA }, // 3 / mask rom TC5332205 - { "092-c3.c3", 0x400000, 0x5da735d6, 3 | BRF_GRA }, // 4 / mask rom TC5332205 - { "092-c4.c4", 0x400000, 0xde07f997, 3 | BRF_GRA }, // 5 / mask rom TC5332205 - - { "092-m1.m1", 0x020000, 0x91957ef6, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / mask rom TC531001 - - { "092-v1.v1", 0x200000, 0x69e90596, 5 | BRF_SND }, // 7 Sound data / mask rom TC5316200 - { "092-v2.v2", 0x200000, 0x7abdb75d, 5 | BRF_SND }, // 8 / mask rom TC5316200 - { "092-v3.v3", 0x200000, 0xeccc98d3, 5 | BRF_SND }, // 9 / mask rom TC5316200 - { "092-v4.v4", 0x100000, 0xa7c9c949, 5 | BRF_SND }, // 10 / mask rom TC538200 -}; - -STDROMPICKEXT(kabukikl, kabukikl, neogeo) -STD_ROM_FN(kabukikl) - -struct BurnDriver BurnDrvkabukikl = { - "kabukikl", NULL, "neogeo", NULL, "1995", - "Far East of Eden - Kabuki Klash / Tengai Makyou - Shin Den\0", NULL, "Hudson", "Neo Geo MVS", - L"Kabuki Klash - far east of eden\0\u5929\u5916\u9B54\u5883 - \u771F\u4F1D\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, kabukiklRomInfo, kabukiklRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Neo Bomberman -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo neobombeRomDesc[] = { - { "093-p1.p1", 0x100000, 0xa1a71d0d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "093-s1.s1", 0x020000, 0x4b3fa119, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "093-c1.c1", 0x400000, 0xd1f328f8, 3 | BRF_GRA }, // 2 Sprite data / TC5332205 - { "093-c2.c2", 0x400000, 0x82c49540, 3 | BRF_GRA }, // 3 / TC5332205 - { "093-c3.c3", 0x080000, 0xe37578c5, 3 | BRF_GRA }, // 4 / TC534200 - { "093-c4.c4", 0x080000, 0x59826783, 3 | BRF_GRA }, // 5 / TC534200 - - { "093-m1.m1", 0x020000, 0xe81e780b, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "093-v1.v1", 0x400000, 0x02abd4b0, 5 | BRF_SND }, // 7 Sound data / TC5332204 - { "093-v2.v2", 0x200000, 0xa92b8b3d, 5 | BRF_SND }, // 8 / TC5316200 -}; - -STDROMPICKEXT(neobombe, neobombe, neogeo) -STD_ROM_FN(neobombe) - -struct BurnDriver BurnDrvneobombe = { - "neobombe", NULL, "neogeo", NULL, "1997", - "Neo Bomberman\0", NULL, "Hudson", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_MAZE, 0, - NULL, neobombeRomInfo, neobombeRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Minasanno Okagesamadesu! Daisugorokutaikai (MOM-001)(MOH-001) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo minasanRomDesc[] = { - { "027-p1.p1", 0x080000, 0xc8381327, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / HN62422PC - - { "027-s1.s1", 0x020000, 0xe5824baa, 2 | BRF_GRA }, // 1 Text layer tiles / HN62321BP - - { "027-c1.c1", 0x100000, 0xd0086f94, 3 | BRF_GRA }, // 2 Sprite data / HN62408PD - { "027-c2.c2", 0x100000, 0xda61f5a6, 3 | BRF_GRA }, // 3 / HN62408PD - { "027-c3.c3", 0x100000, 0x08df1228, 3 | BRF_GRA }, // 4 / HN62408PD - { "027-c4.c4", 0x100000, 0x54e87696, 3 | BRF_GRA }, // 5 / HN62408PD - - { "027-m1.m1", 0x020000, 0xadd5a226, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / HN62321AP - - { "027-v11.v11", 0x100000, 0x59ad4459, 5 | BRF_SND }, // 7 Sound data / HN62308BPC - { "027-v21.v21", 0x100000, 0xdf5b4eeb, 6 | BRF_SND }, // 8 / HN62308BPC -}; - -STDROMPICKEXT(minasan, minasan, neogeo) -STD_ROM_FN(minasan) - -struct BurnDriver BurnDrvminasan = { - "minasan", NULL, "neogeo", NULL, "1990", - "Minasanno Okagesamadesu! Daisugorokutaikai (MOM-001)(MOH-001)\0", NULL, "Monolith Corp.", "Neo Geo MVS", - L"\u307F\u306A\u3055\u3093\u306E\u304A\u304B\u3052\u3055\u307E\u3067\u3059\uFF01\0Minnasanno Okagesamadesu (MOM-001)(MOH-001)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_MAHJONG, GBF_MAHJONG, 0, - NULL, minasanRomInfo, minasanRomName, NULL, NULL, neomahjongInputInfo, neomahjongDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Bakatonosama Mahjong Manyuuki (MOM-002)(MOH-002) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo bakatonoRomDesc[] = { - { "036-p1.p1", 0x080000, 0x1c66b6fa, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / CXK384500 - - { "036-s1.s1", 0x020000, 0xf3ef4485, 2 | BRF_GRA }, // 1 Text layer tiles / CXK381000 - - { "036-c1.c1", 0x100000, 0xfe7f1010, 3 | BRF_GRA }, // 2 Sprite data / CXK388000 - { "036-c2.c2", 0x100000, 0xbbf003f5, 3 | BRF_GRA }, // 3 / CXK388000 - { "036-c3.c3", 0x100000, 0x9ac0708e, 3 | BRF_GRA }, // 4 / CXK388000 - { "036-c4.c4", 0x100000, 0xf2577d22, 3 | BRF_GRA }, // 5 / CXK388000 - - { "036-m1.m1", 0x020000, 0xf1385b96, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / CXK381003 - - { "036-v1.v1", 0x100000, 0x1c335dce, 5 | BRF_SND }, // 7 Sound data / CXK388000 - { "036-v2.v2", 0x100000, 0xbbf79342, 5 | BRF_SND }, // 8 / CXK388000 -}; - -STDROMPICKEXT(bakatono, bakatono, neogeo) -STD_ROM_FN(bakatono) - -struct BurnDriver BurnDrvbakatono = { - "bakatono", NULL, "neogeo", NULL, "1991", - "Bakatonosama Mahjong Manyuuki (MOM-002)(MOH-002)\0", NULL, "Monolith Corp.", "Neo Geo MVS", - L"\u30D0\u30AB\u6BBF\u69D8 \u9EBB\u96C0\u6F2B\u904A\u8A18\0Bakatonosama Mahjong Manyuki (MOM-002)(MOH-002)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_MAHJONG, GBF_MAHJONG, 0, - NULL, bakatonoRomInfo, bakatonoRomName, NULL, NULL, neomahjongInputInfo, neomahjongDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo Turf Masters / Big Tournament Golf - -static struct BurnRomInfo turfmastRomDesc[] = { - { "200-p1.p1", 0x200000, 0x28c83048, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - - { "200-s1.s1", 0x020000, 0x9a5402b2, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "200-c1.c1", 0x400000, 0x8e7bf41a, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5332205 - { "200-c2.c2", 0x400000, 0x5a65a8ce, 3 | BRF_GRA }, // 3 / mask rom TC5332205 - - { "200-m1.m1", 0x020000, 0x9994ac00, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / mask rom TC531001 - - { "200-v1.v1", 0x200000, 0x00fd48d2, 5 | BRF_SND }, // 5 Sound data / mask rom TC5316200 - { "200-v2.v2", 0x200000, 0x082acb31, 5 | BRF_SND }, // 6 / mask rom TC5316200 - { "200-v3.v3", 0x200000, 0x7abca053, 5 | BRF_SND }, // 7 / mask rom TC5316200 - { "200-v4.v4", 0x200000, 0x6c7b4902, 5 | BRF_SND }, // 8 / mask rom TC5316200 -}; - -STDROMPICKEXT(turfmast, turfmast, neogeo) -STD_ROM_FN(turfmast) - -struct BurnDriver BurnDrvturfmast = { - "turfmast", NULL, "neogeo", NULL, "1996", - "Neo Turf Masters / Big Tournament Golf\0", NULL, "Nazca", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_SPORTSMISC, 0, - NULL, turfmastRomInfo, turfmastRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Metal Slug - Super Vehicle-001 - -static struct BurnRomInfo mslugRomDesc[] = { - { "201-p1.p1", 0x200000, 0x08d8daa5, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "201-s1.s1", 0x020000, 0x2f55958d, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "201-c1.c1", 0x400000, 0x72813676, 3 | BRF_GRA }, // 2 Sprite data / TC5332205 - { "201-c2.c2", 0x400000, 0x96f62574, 3 | BRF_GRA }, // 3 / TC5332205 - { "201-c3.c3", 0x400000, 0x5121456a, 3 | BRF_GRA }, // 4 / TC5332205 - { "201-c4.c4", 0x400000, 0xf4ad59a3, 3 | BRF_GRA }, // 5 / TC5332205 - - { "201-m1.m1", 0x020000, 0xc28b3253, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "201-v1.v1", 0x400000, 0x23d22ed1, 5 | BRF_SND }, // 7 Sound data / TC5332204 - { "201-v2.v2", 0x400000, 0x472cf9db, 5 | BRF_SND }, // 8 / TC5332204 -}; - -STDROMPICKEXT(mslug, mslug, neogeo) -STD_ROM_FN(mslug) - -struct BurnDriver BurnDrvmslug = { - "mslug", NULL, "neogeo", NULL, "1996", - "Metal Slug - Super Vehicle-001\0", NULL, "Nazca", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_PLATFORM, FBF_MSLUG, - NULL, mslugRomInfo, mslugRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Zed Blade / Operation Ragnarok -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo zedbladeRomDesc[] = { - { "076-p1.p1", 0x080000, 0xd7c1effd, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - - { "076-s1.s1", 0x020000, 0xf4c25dd5, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "076-c1.c1", 0x200000, 0x4d9cb038, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5316200 - { "076-c2.c2", 0x200000, 0x09233884, 3 | BRF_GRA }, // 3 / mask rom TC5316200 - { "076-c3.c3", 0x200000, 0xd06431e3, 3 | BRF_GRA }, // 4 / mask rom TC5316200 - { "076-c4.c4", 0x200000, 0x4b1c089b, 3 | BRF_GRA }, // 5 / mask rom TC5316200 - - { "076-m1.m1", 0x020000, 0x7b5f3d0a, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / mask rom TC531001 - - { "076-v1.v1", 0x200000, 0x1a21d90c, 5 | BRF_SND }, // 7 Sound data / mask rom TC5316200 - { "076-v2.v2", 0x200000, 0xb61686c3, 5 | BRF_SND }, // 8 / mask rom TC5316200 - { "076-v3.v3", 0x100000, 0xb90658fa, 5 | BRF_SND }, // 9 / mask rom TC538200 -}; - -STDROMPICKEXT(zedblade, zedblade, neogeo) -STD_ROM_FN(zedblade) - -struct BurnDriver BurnDrvzedblade = { - "zedblade", NULL, "neogeo", NULL, "1994", - "Zed Blade / Operation Ragnarok\0", NULL, "NMK", "Neo Geo MVS", - L"Zed Blade\0Operation Ragnarok\0\u4F5C\u6226\u540D\uFF02\u30E9\u30B0\u30CA\u30ED\u30AF\uFF02\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_HORSHOOT, 0, - NULL, zedbladeRomInfo, zedbladeRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, - &NeoRecalcPalette, 0x1000, 304, 224, 4, 3 -}; - -// Strikers 1945 Plus -/* Original Version, Encrypted GFX Roms */ /* MVS ONLY RELEASE */ - -static struct BurnRomInfo s1945pRomDesc[] = { - { "254-p1.p1", 0x100000, 0xff8efcff, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "254-p2.sp2", 0x400000, 0xefdfd4dd, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - { "254-c1.c1", 0x800000, 0xae6fc8ef, 3 | BRF_GRA }, // 2 Sprite data - { "254-c2.c2", 0x800000, 0x436fa176, 3 | BRF_GRA }, // 3 - { "254-c3.c3", 0x800000, 0xe53ff2dc, 3 | BRF_GRA }, // 4 - { "254-c4.c4", 0x800000, 0x818672f0, 3 | BRF_GRA }, // 5 - { "254-c5.c5", 0x800000, 0x4580eacd, 3 | BRF_GRA }, // 6 - { "254-c6.c6", 0x800000, 0xe34970fc, 3 | BRF_GRA }, // 7 - { "254-c7.c7", 0x800000, 0xf2323239, 3 | BRF_GRA }, // 8 - { "254-c8.c8", 0x800000, 0x66848c7d, 3 | BRF_GRA }, // 9 - - { "254-m1.m1", 0x020000, 0x994b4487, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "254-v1.v1", 0x400000, 0x844f58fb, 5 | BRF_SND }, // 11 Sound data - { "254-v2.v2", 0x400000, 0xd9a248f0, 5 | BRF_SND }, // 12 - { "254-v3.v3", 0x400000, 0x0b0d2d33, 5 | BRF_SND }, // 13 - { "254-v4.v4", 0x400000, 0x6d13dc91, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(s1945p, s1945p, neogeo) -STD_ROM_FN(s1945p) - -static INT32 s1945pInit() -{ - nNeoProtectionXor = 0x05; - - return NeoInit(); -} - -struct BurnDriver BurnDrvs1945p = { - "s1945p", NULL, "neogeo", NULL, "1999", - "Strikers 1945 Plus\0", NULL, "Psikyo", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC42, GBF_VERSHOOT, 0, - NULL, s1945pRomInfo, s1945pRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - s1945pInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Quiz King of Fighters (SAM-080)(SAH-080) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo quizkofRomDesc[] = { - { "080-p1.p1", 0x100000, 0x4440315e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - - { "080-s1.s1", 0x020000, 0xd7b86102, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "080-c1.c1", 0x200000, 0xea1d764a, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5316200 - { "080-c2.c2", 0x200000, 0xd331d4a4, 3 | BRF_GRA }, // 3 / mask rom TC5316200 - { "080-c3.c3", 0x200000, 0xb4851bfe, 3 | BRF_GRA }, // 4 / mask rom TC5316200 - { "080-c4.c4", 0x200000, 0xca6f5460, 3 | BRF_GRA }, // 5 / mask rom TC5316200 - - { "080-m1.m1", 0x020000, 0xf5f44172, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / mask rom TC531001 - - { "080-v1.v1", 0x200000, 0x0be18f60, 5 | BRF_SND }, // 7 Sound data / mask rom TC5316200 - { "080-v2.v2", 0x200000, 0x4abde3ff, 5 | BRF_SND }, // 8 / mask rom TC5316200 - { "080-v3.v3", 0x200000, 0xf02844e2, 5 | BRF_SND }, // 9 / mask rom TC5316200 -}; - -STDROMPICKEXT(quizkof, quizkof, neogeo) -STD_ROM_FN(quizkof) - -struct BurnDriver BurnDrvquizkof = { - "quizkof", NULL, "neogeo", NULL, "1995", - "Quiz King of Fighters (SAM-080)(SAH-080)\0", NULL, "Saurus", "Neo Geo MVS", - L"\u30AF\u30A4\u30BA\u30AD\u30F3\u30B0\u30AA\u30D6\u30D5\u30A1\u30A4\u30BF\u30FC\u30BA\0Quiz King of Fighters (SAM-080)(SAH-080)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_QUIZ, 0, - NULL, quizkofRomInfo, quizkofRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Quiz King of Fighters (Korean release) -/* KOREAN VERSION */ - -static struct BurnRomInfo quizkofkRomDesc[] = { - /* Made by Viccom Corp.; proms have manufacturer stamp VICxxxxxx-xxx, chip labels same as quizkof; Cart ID 0080 */ - /* Due to parent set naming limitations, roms have been named vic-xxx */ - { "vic-080-p1.p1", 0x100000, 0x2589488e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "vic-080-s1.s1", 0x020000, 0xaf72c30f, 2 | BRF_GRA }, // 1 Text layer tiles - - { "vic-080-c1.c1", 0x200000, 0x94d90170, 3 | BRF_GRA }, // 2 Sprite data - { "vic-080-c2.c2", 0x200000, 0x297f25a1, 3 | BRF_GRA }, // 3 - { "vic-080-c3.c3", 0x200000, 0xcf484c4f, 3 | BRF_GRA }, // 4 - { "vic-080-c4.c4", 0x200000, 0x36e5d997, 3 | BRF_GRA }, // 5 - - { "vic-080-m1.m1", 0x020000, 0x4f157e9a, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "080-v1.v1", 0x200000, 0x0be18f60, 5 | BRF_SND }, // 7 Sound data / mask rom TC5316200 - { "vic-080-v2.v2", 0x200000, 0x719fee5b, 5 | BRF_SND }, // 8 - { "vic-080-v3.v3", 0x200000, 0x64b7efde, 5 | BRF_SND }, // 9 -}; - -STDROMPICKEXT(quizkofk, quizkofk, neogeo) -STD_ROM_FN(quizkofk) - -struct BurnDriver BurnDrvquizkofk = { - "quizkofk", "quizkof", "neogeo", NULL, "1995", - "Quiz King of Fighters (Korean release)\0", NULL, "Saurus", "Neo Geo MVS", - L"\u30AF\u30A4\u30BA\u30AD\u30F3\u30B0\u30AA\u30D6\u30D5\u30A1\u30A4\u30BF\u30FC\u30BA\0Quiz King of Fighters (Korean release)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_QUIZ, 0, - NULL, quizkofkRomInfo, quizkofkRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Stakes Winner / Stakes Winner - GI kinzen seiha e no michi - -static struct BurnRomInfo stakwinRomDesc[] = { - { "088-p1.p1", 0x200000, 0xbd5814f6, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "088-s1.s1", 0x020000, 0x073cb208, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "088-c1.c1", 0x200000, 0x6e733421, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "088-c2.c2", 0x200000, 0x4d865347, 3 | BRF_GRA }, // 3 / TC5316200 - { "088-c3.c3", 0x200000, 0x8fa5a9eb, 3 | BRF_GRA }, // 4 / TC5316200 - { "088-c4.c4", 0x200000, 0x4604f0dc, 3 | BRF_GRA }, // 5 / TC5316200 - - { "088-m1.m1", 0x020000, 0x2fe1f499, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "088-v1.v1", 0x200000, 0xb7785023, 5 | BRF_SND }, // 7 Sound data / TC5316200 -}; - -STDROMPICKEXT(stakwin, stakwin, neogeo) -STD_ROM_FN(stakwin) - -struct BurnDriver BurnDrvstakwin = { - "stakwin", NULL, "neogeo", NULL, "1995", - "Stakes Winner / Stakes Winner - GI kinzen seiha e no michi\0", NULL, "Saurus", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_MISC, 0, - NULL, stakwinRomInfo, stakwinRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Ragnagard / Shin-Oh-Ken - -static struct BurnRomInfo ragnagrdRomDesc[] = { - { "218-p1.p1", 0x200000, 0xca372303, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "218-s1.s1", 0x020000, 0x7d402f9a, 2 | BRF_GRA }, // 1 Text layer tiles - - { "218-c1.c1", 0x400000, 0xc31500a4, 3 | BRF_GRA }, // 2 Sprite data - { "218-c2.c2", 0x400000, 0x98aba1f9, 3 | BRF_GRA }, // 3 - { "218-c3.c3", 0x400000, 0x833c163a, 3 | BRF_GRA }, // 4 - { "218-c4.c4", 0x400000, 0xc1a30f69, 3 | BRF_GRA }, // 5 - { "218-c5.c5", 0x400000, 0x6b6de0ff, 3 | BRF_GRA }, // 6 - { "218-c6.c6", 0x400000, 0x94beefcf, 3 | BRF_GRA }, // 7 - { "218-c7.c7", 0x400000, 0xde6f9b28, 3 | BRF_GRA }, // 8 - { "218-c8.c8", 0x400000, 0xd9b311f6, 3 | BRF_GRA }, // 9 - - { "218-m1.m1", 0x020000, 0x17028bcf, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "218-v1.v1", 0x400000, 0x61eee7f4, 5 | BRF_SND }, // 11 Sound data - { "218-v2.v2", 0x400000, 0x6104e20b, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(ragnagrd, ragnagrd, neogeo) -STD_ROM_FN(ragnagrd) - -struct BurnDriver BurnDrvragnagrd = { - "ragnagrd", NULL, "neogeo", NULL, "1996", - "Ragnagard / Shin-Oh-Ken\0", NULL, "Saurus", "Neo Geo MVS", - L"Operation Ragnagard\0\u795E\u51F0\u62F3\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, ragnagrdRomInfo, ragnagrdRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Pleasure Goal / Futsal - 5 on 5 Mini Soccer (NGM-219) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo pgoalRomDesc[] = { - { "219-p1.p1", 0x200000, 0x6af0e574, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "219-s1.s1", 0x020000, 0x002f3c88, 2 | BRF_GRA }, // 1 Text layer tiles - - { "219-c1.c1", 0x400000, 0x67fec4dc, 3 | BRF_GRA }, // 2 Sprite data - { "219-c2.c2", 0x400000, 0x86ed01f2, 3 | BRF_GRA }, // 3 - { "219-c3.c3", 0x200000, 0x5fdad0a5, 3 | BRF_GRA }, // 4 - { "219-c4.c4", 0x200000, 0xf57b4a1c, 3 | BRF_GRA }, // 5 - - { "219-m1.m1", 0x020000, 0x958efdc8, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "219-v1.v1", 0x400000, 0xd0ae33d9, 5 | BRF_SND }, // 7 Sound data -}; - -STDROMPICKEXT(pgoal, pgoal, neogeo) -STD_ROM_FN(pgoal) - -struct BurnDriver BurnDrvpgoal = { - "pgoal", NULL, "neogeo", NULL, "1996", - "Pleasure Goal / Futsal - 5 on 5 Mini Soccer (NGM-219)\0", NULL, "Saurus", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_SPORTSFOOTBALL, 0, - NULL, pgoalRomInfo, pgoalRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Choutetsu Brikin'ger - Iron clad (Prototype) -/* Prototype - crcs should match the ones of the unreleased dump. */ - -static struct BurnRomInfo ironcladRomDesc[] = { - { "proto_220-p1.p1", 0x200000, 0x62a942c6, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "proto_220-s1.s1", 0x020000, 0x372fe217, 2 | BRF_GRA }, // 1 Text layer tiles - - { "proto_220-c1.c1", 0x400000, 0x9aa2b7dc, 3 | BRF_GRA }, // 2 Sprite data - { "proto_220-c2.c2", 0x400000, 0x8a2ad708, 3 | BRF_GRA }, // 3 - { "proto_220-c3.c3", 0x400000, 0xd67fb15a, 3 | BRF_GRA }, // 4 - { "proto_220-c4.c4", 0x400000, 0xe73ea38b, 3 | BRF_GRA }, // 5 - - { "proto_220-m1.m1", 0x020000, 0x3a08bb63, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "proto_220-v1.v1", 0x400000, 0x8f30a215, 5 | BRF_SND }, // 7 Sound data -}; - -STDROMPICKEXT(ironclad, ironclad, neogeo) -STD_ROM_FN(ironclad) - -struct BurnDriver BurnDrvironclad = { - "ironclad", NULL, "neogeo", NULL, "1996", - "Choutetsu Brikin'ger - Iron clad (Prototype)\0", NULL, "Saurus", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_HORSHOOT, 0, - NULL, ironcladRomInfo, ironcladRomName, NULL, NULL, neogeoInputInfo, neogeousaDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Choutetsu Brikin'ger - Iron clad (Prototype, older) -/* Prototype - bootleg/hack based on later release. */ - -static struct BurnRomInfo ironcladoRomDesc[] = { - { "proto_220-p1o.p1", 0x200000, 0xce37e3a0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "proto_220-s1.s1", 0x020000, 0x372fe217, 2 | BRF_GRA }, // 1 Text layer tiles - - { "proto_220-c1.c1", 0x400000, 0x9aa2b7dc, 3 | BRF_GRA }, // 2 Sprite data - { "proto_220-c2.c2", 0x400000, 0x8a2ad708, 3 | BRF_GRA }, // 3 - { "proto_220-c3.c3", 0x400000, 0xd67fb15a, 3 | BRF_GRA }, // 4 - { "proto_220-c4.c4", 0x400000, 0xe73ea38b, 3 | BRF_GRA }, // 5 - - { "proto_220-m1.m1", 0x020000, 0x3a08bb63, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "proto_220-v1.v1", 0x400000, 0x8f30a215, 5 | BRF_SND }, // 7 Sound data -}; - -STDROMPICKEXT(ironclado, ironclado, neogeo) -STD_ROM_FN(ironclado) - -struct BurnDriver BurnDrvironclado = { - "ironclado", "ironclad", "neogeo", NULL, "1996", - "Choutetsu Brikin'ger - Iron clad (Prototype, older)\0", NULL, "Saurus", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_HORSHOOT, 0, - NULL, ironcladoRomInfo, ironcladoRomName, NULL, NULL, neogeoInputInfo, neogeousaDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Stakes Winner 2 - -static struct BurnRomInfo stakwin2RomDesc[] = { - { "227-p1.p1", 0x200000, 0xdaf101d2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "227-s1.s1", 0x020000, 0x2a8c4462, 2 | BRF_GRA }, // 1 Text layer tiles - - { "227-c1.c1", 0x400000, 0x7d6c2af4, 3 | BRF_GRA }, // 2 Sprite data - { "227-c2.c2", 0x400000, 0x7e402d39, 3 | BRF_GRA }, // 3 - { "227-c3.c3", 0x200000, 0x93dfd660, 3 | BRF_GRA }, // 4 - { "227-c4.c4", 0x200000, 0x7efea43a, 3 | BRF_GRA }, // 5 - - { "227-m1.m1", 0x020000, 0xc8e5e0f9, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "227-v1.v1", 0x400000, 0xb8f24181, 5 | BRF_SND }, // 7 Sound data - { "227-v2.v2", 0x400000, 0xee39e260, 5 | BRF_SND }, // 8 -}; - -STDROMPICKEXT(stakwin2, stakwin2, neogeo) -STD_ROM_FN(stakwin2) - -struct BurnDriver BurnDrvstakwin2 = { - "stakwin2", NULL, "neogeo", NULL, "1996", - "Stakes Winner 2\0", NULL, "Saurus", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_MISC, 0, - NULL, stakwin2RomInfo, stakwin2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Shock Troopers (set 1) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo shocktroRomDesc[] = { - { "238-p1.p1", 0x100000, 0x5677456f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "238-p2.sp2", 0x400000, 0x5b4a09c5, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "238-s1.s1", 0x020000, 0x1f95cedb, 2 | BRF_GRA }, // 2 Text layer tiles - - { "238-c1.c1", 0x400000, 0x90c6a181, 3 | BRF_GRA }, // 3 Sprite data - { "238-c2.c2", 0x400000, 0x888720f0, 3 | BRF_GRA }, // 4 - { "238-c3.c3", 0x400000, 0x2c393aa3, 3 | BRF_GRA }, // 5 - { "238-c4.c4", 0x400000, 0xb9e909eb, 3 | BRF_GRA }, // 6 - { "238-c5.c5", 0x400000, 0xc22c68eb, 3 | BRF_GRA }, // 7 - { "238-c6.c6", 0x400000, 0x119323cd, 3 | BRF_GRA }, // 8 - { "238-c7.c7", 0x400000, 0xa72ce7ed, 3 | BRF_GRA }, // 9 - { "238-c8.c8", 0x400000, 0x1c7c2efb, 3 | BRF_GRA }, // 10 - - { "238-m1.m1", 0x020000, 0x075b9518, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "238-v1.v1", 0x400000, 0x260c0bef, 5 | BRF_SND }, // 12 Sound data - { "238-v2.v2", 0x200000, 0x4ad7d59e, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(shocktro, shocktro, neogeo) -STD_ROM_FN(shocktro) - -struct BurnDriver BurnDrvshocktro = { - "shocktro", NULL, "neogeo", NULL, "1997", - "Shock Troopers (set 1)\0", NULL, "Saurus", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VERSHOOT, 0, - NULL, shocktroRomInfo, shocktroRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Shock Troopers (set 2) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo shocktroaRomDesc[] = { - { "238-pg1.p1", 0x100000, 0xefedf8dc, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "238-p2.sp2", 0x400000, 0x5b4a09c5, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "238-s1.s1", 0x020000, 0x1f95cedb, 2 | BRF_GRA }, // 2 Text layer tiles - - { "238-c1.c1", 0x400000, 0x90c6a181, 3 | BRF_GRA }, // 3 Sprite data - { "238-c2.c2", 0x400000, 0x888720f0, 3 | BRF_GRA }, // 4 - { "238-c3.c3", 0x400000, 0x2c393aa3, 3 | BRF_GRA }, // 5 - { "238-c4.c4", 0x400000, 0xb9e909eb, 3 | BRF_GRA }, // 6 - { "238-c5.c5", 0x400000, 0xc22c68eb, 3 | BRF_GRA }, // 7 - { "238-c6.c6", 0x400000, 0x119323cd, 3 | BRF_GRA }, // 8 - { "238-c7.c7", 0x400000, 0xa72ce7ed, 3 | BRF_GRA }, // 9 - { "238-c8.c8", 0x400000, 0x1c7c2efb, 3 | BRF_GRA }, // 10 - - { "238-m1.m1", 0x020000, 0x075b9518, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "238-v1.v1", 0x400000, 0x260c0bef, 5 | BRF_SND }, // 12 Sound data - { "238-v2.v2", 0x200000, 0x4ad7d59e, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(shocktroa, shocktroa, neogeo) -STD_ROM_FN(shocktroa) - -struct BurnDriver BurnDrvshocktroa = { - "shocktroa", "shocktro", "neogeo", NULL, "1997", - "Shock Troopers (set 2)\0", NULL, "Saurus", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VERSHOOT, 0, - NULL, shocktroaRomInfo, shocktroaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Shock Troopers - 2nd Squad - -static struct BurnRomInfo shocktr2RomDesc[] = { - { "246-p1.p1", 0x100000, 0x6d4b7781, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "246-p2.sp2", 0x400000, 0x72ea04c3, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "246-s1.s1", 0x020000, 0x2a360637, 2 | BRF_GRA }, // 2 Text layer tiles - - { "246-c1.c1", 0x800000, 0x47ac9ec5, 3 | BRF_GRA }, // 3 Sprite data - { "246-c2.c2", 0x800000, 0x7bcab64f, 3 | BRF_GRA }, // 4 - { "246-c3.c3", 0x800000, 0xdb2f73e8, 3 | BRF_GRA }, // 5 - { "246-c4.c4", 0x800000, 0x5503854e, 3 | BRF_GRA }, // 6 - { "246-c5.c5", 0x800000, 0x055b3701, 3 | BRF_GRA }, // 7 - { "246-c6.c6", 0x800000, 0x7e2caae1, 3 | BRF_GRA }, // 8 - - { "246-m1.m1", 0x020000, 0xd0604ad1, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "246-v1.v1", 0x400000, 0x16986fc6, 5 | BRF_SND }, // 10 Sound data - { "246-v2.v2", 0x400000, 0xada41e83, 5 | BRF_SND }, // 11 - { "246-v3.v3", 0x200000, 0xa05ba5db, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(shocktr2, shocktr2, neogeo) -STD_ROM_FN(shocktr2) - -struct BurnDriver BurnDrvshocktr2 = { - "shocktr2", NULL, "neogeo", NULL, "1998", - "Shock Troopers - 2nd Squad\0", NULL, "Saurus", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VERSHOOT, 0, - NULL, shocktr2RomInfo, shocktr2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg) - -static struct BurnRomInfo lans2004RomDesc[] = { - { "lnsq-p1.bin", 0x200000, 0xb40a879a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "lnsq-p21.bin", 0x200000, 0xecdb2d42, 1 | BRF_ESS | BRF_PRG }, // 1 - { "lnsq-p22.bin", 0x200000, 0xfac5e2e7, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "lnsq-s1.bin", 0x020000, 0x39e82897, 2 | BRF_GRA }, // 3 Text layer tiles - - { "lnsq-c1.bin", 0x800000, 0xb83de59f, 3 | BRF_GRA }, // 4 Sprite data - { "lnsq-c2.bin", 0x800000, 0xe08969fd, 3 | BRF_GRA }, // 5 - { "lnsq-c3.bin", 0x800000, 0x013f2cda, 3 | BRF_GRA }, // 6 - { "lnsq-c4.bin", 0x800000, 0xd8c3a758, 3 | BRF_GRA }, // 7 - { "lnsq-c5.bin", 0x800000, 0x75500b82, 3 | BRF_GRA }, // 8 - { "lnsq-c6.bin", 0x800000, 0x670ac13b, 3 | BRF_GRA }, // 9 - - { "246-m1.bin", 0x020000, 0xd0604ad1, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "lnsq-v1.bin", 0x400000, 0x4408ebc3, 5 | BRF_SND }, // 11 Sound data - { "lnsq-v2.bin", 0x400000, 0x3d953975, 5 | BRF_SND }, // 12 - { "lnsq-v3.bin", 0x200000, 0x437d1d8e, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(lans2004, lans2004, neogeo) -STD_ROM_FN(lans2004) - -static void lans2004Callback() -{ - INT32 i; - UINT8 *dst = (UINT8*)BurnMalloc(0x100000); - if (dst) - { - static const INT32 sec[] = { 0x3, 0x8, 0x7, 0xc, 0x1, 0xa, 0x6, 0xd }; - - for (i = 0; i < 8; i++) - memmove (dst + i * 0x20000, Neo68KROMActive + sec[i] * 0x20000, 0x20000); - - memmove (dst + 0x0bbb00, Neo68KROMActive + 0x045b00, 0x001710); - memmove (dst + 0x02fff0, Neo68KROMActive + 0x1a92be, 0x000010); - memmove (Neo68KROMActive, dst, 0x100000); - BurnFree (dst); - } - - memmove (Neo68KROMActive + 0x100000, Neo68KROMActive + 0x200000, 0x400000); - - for (i = 0xbbb00; i < 0xbe000; i+=2) { - if ((BURN_ENDIAN_SWAP_INT16(*((UINT16 *)(Neo68KROMActive + i + 0))) & 0xf2bf) == BURN_ENDIAN_SWAP_INT16(0x42b9) && - *((UINT16 *)(Neo68KROMActive + i + 2)) == 0x0000) - { - *((UINT16 *)(Neo68KROMActive + i + 2)) = BURN_ENDIAN_SWAP_INT16(0x000b); - *((UINT16 *)(Neo68KROMActive + i + 4)) += BURN_ENDIAN_SWAP_INT16(0x6000); - } - } - - *((UINT16 *)(Neo68KROMActive + 0x2d15c)) = BURN_ENDIAN_SWAP_INT16(0x000b); - *((UINT16 *)(Neo68KROMActive + 0x2d15e)) = BURN_ENDIAN_SWAP_INT16(0xbb00); - *((UINT16 *)(Neo68KROMActive + 0x2d1e4)) = BURN_ENDIAN_SWAP_INT16(0x6002); - *((UINT16 *)(Neo68KROMActive + 0x2ea7e)) = BURN_ENDIAN_SWAP_INT16(0x6002); - *((UINT16 *)(Neo68KROMActive + 0xbbcd0)) = BURN_ENDIAN_SWAP_INT16(0x6002); - *((UINT16 *)(Neo68KROMActive + 0xbbdf2)) = BURN_ENDIAN_SWAP_INT16(0x6002); - *((UINT16 *)(Neo68KROMActive + 0xbbe42)) = BURN_ENDIAN_SWAP_INT16(0x6002); - - lans2004_sx_decode(); - lans2004_cx_decode(0x800000 * 6); -} - -static INT32 lans2004Init() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = lans2004Callback; - - nRet = NeoInit(); - - if (nRet == 0) { - for (INT32 i = 0; i < 0xa00000; i++) - YM2610ADPCMAROM[nNeoActiveSlot][i] = BITSWAP08(YM2610ADPCMAROM[nNeoActiveSlot][i], 0, 1, 5, 4, 3, 2, 6, 7); - } - - return nRet; -} - -struct BurnDriver BurnDrvlans2004 = { - "lans2004", "shocktr2", "neogeo", NULL, "1998", - "Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VERSHOOT, 0, - NULL, lans2004RomInfo, lans2004RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - lans2004Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Galaxy Fight - Universal Warriors - -static struct BurnRomInfo galaxyfgRomDesc[] = { - { "078-p1.p1", 0x200000, 0x45906309, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - - { "078-s1.s1", 0x020000, 0x72f8923e, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "078-c1.c1", 0x200000, 0xc890c7c0, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5316200 - { "078-c2.c2", 0x200000, 0xb6d25419, 3 | BRF_GRA }, // 3 / mask rom TC5316200 - { "078-c3.c3", 0x200000, 0x9d87e761, 3 | BRF_GRA }, // 4 / mask rom TC5316200 - { "078-c4.c4", 0x200000, 0x765d7cb8, 3 | BRF_GRA }, // 5 / mask rom TC5316200 - { "078-c5.c5", 0x200000, 0xe6b77e6a, 3 | BRF_GRA }, // 6 / mask rom TC5316200 - { "078-c6.c6", 0x200000, 0xd779a181, 3 | BRF_GRA }, // 7 / mask rom TC5316200 - { "078-c7.c7", 0x100000, 0x4f27d580, 3 | BRF_GRA }, // 8 / mask rom TC5316200 - { "078-c8.c8", 0x100000, 0x0a7cc0d8, 3 | BRF_GRA }, // 9 / mask rom TC5316200 - - { "078-m1.m1", 0x020000, 0x8e9e3b10, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / mask rom TC531001 - - { "078-v1.v1", 0x200000, 0xe3b735ac, 5 | BRF_SND }, // 11 Sound data / mask rom TC5316200 - { "078-v2.v2", 0x200000, 0x6a8e78c2, 5 | BRF_SND }, // 12 / mask rom TC5316200 - { "078-v3.v3", 0x100000, 0x70bca656, 5 | BRF_SND }, // 13 / mask rom TC538200 -}; - -STDROMPICKEXT(galaxyfg, galaxyfg, neogeo) -STD_ROM_FN(galaxyfg) - -struct BurnDriver BurnDrvgalaxyfg = { - "galaxyfg", NULL, "neogeo", NULL, "1995", - "Galaxy Fight - Universal Warriors\0", NULL, "Sunsoft", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, galaxyfgRomInfo, galaxyfgRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Waku Waku 7 - -static struct BurnRomInfo wakuwak7RomDesc[] = { - { "225-p1.p1", 0x100000, 0xb14da766, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "225-p2.sp2", 0x200000, 0xfe190665, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "225-s1.s1", 0x020000, 0x71c4b4b5, 2 | BRF_GRA }, // 2 Text layer tiles - - { "225-c1.c1", 0x400000, 0xee4fea54, 3 | BRF_GRA }, // 3 Sprite data - { "225-c2.c2", 0x400000, 0x0c549e2d, 3 | BRF_GRA }, // 4 - { "225-c3.c3", 0x400000, 0xaf0897c0, 3 | BRF_GRA }, // 5 - { "225-c4.c4", 0x400000, 0x4c66527a, 3 | BRF_GRA }, // 6 - { "225-c5.c5", 0x400000, 0x8ecea2b5, 3 | BRF_GRA }, // 7 - { "225-c6.c6", 0x400000, 0x0eb11a6d, 3 | BRF_GRA }, // 8 - - { "225-m1.m1", 0x020000, 0x0634bba6, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "225-v1.v1", 0x400000, 0x6195c6b4, 5 | BRF_SND }, // 10 Sound data - { "225-v2.v2", 0x400000, 0x6159c5fe, 5 | BRF_SND }, // 11 -}; - -STDROMPICKEXT(wakuwak7, wakuwak7, neogeo) -STD_ROM_FN(wakuwak7) - -struct BurnDriver BurnDrvwakuwak7 = { - "wakuwak7", NULL, "neogeo", NULL, "1996", - "Waku Waku 7\0", NULL, "Sunsoft", "Neo Geo MVS", - L"Waku Waku 7\0\u308F\u304F\u308F\u304F\uFF17\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, wakuwak7RomInfo, wakuwak7RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Puzzle Bobble / Bust-A-Move (Neo-Geo) (NGM-083) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo pbobblenRomDesc[] = { - /* This set uses CHA and PROG board from Power Spikes II. Six Power Spikes II prom's are replaced with - Puzzle Bobble prom's. Confirmed on several original carts. Do other layouts also exist? */ - { "d96-07.ep1", 0x080000, 0x6102ca14, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / 27C240 - - { "d96-04.s1", 0x020000, 0x9caae538, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "068-c1.c1", 0x100000, 0x7f250f76, 3 | BRF_GRA }, // 2 Sprite data / unused / mask rom TC538200 - { "068-c2.c2", 0x100000, 0x20912873, 3 | BRF_GRA }, // 3 / unused / mask rom TC538200 - { "068-c3.c3", 0x100000, 0x4b641ba1, 3 | BRF_GRA }, // 4 / unused / mask rom TC538200 - { "068-c4.c4", 0x100000, 0x35072596, 3 | BRF_GRA }, // 5 / unused / mask rom TC538200 - { "d96-02.c5", 0x080000, 0xe89ad494, 3 | BRF_GRA }, // 6 Sprite data / mask rom TC534200 - { "d96-03.c6", 0x080000, 0x4b42d7eb, 3 | BRF_GRA }, // 7 / mask rom TC534200 - - { "d96-06.m1", 0x020000, 0xf424368a, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / mask rom TC531001 - - { "068-v1.v1", 0x100000, 0x2ced86df, 5 | BRF_SND }, // 9 Sound data / unused / mask rom TC538200 - { "068-v2.v2", 0x100000, 0x970851ab, 5 | BRF_SND }, // 10 / unused / mask rom TC538200 - { "d96-01.v3", 0x100000, 0x0840cbc4, 5 | BRF_SND }, // 11 / mask rom TC538200 - { "d96-05.v4", 0x080000, 0x0a548948, 5 | BRF_SND }, // 12 / mask rom TC534200 -}; - -STDROMPICKEXT(pbobblen, pbobblen, neogeo) -STD_ROM_FN(pbobblen) - -struct BurnDriver BurnDrvpbobblen = { - "pbobblen", NULL, "neogeo", NULL, "1994", - "Puzzle Bobble / Bust-A-Move (Neo-Geo) (NGM-083)\0", NULL, "Taito", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, pbobblenRomInfo, pbobblenRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - - -// Puzzle Bobble / Bust-A-Move (Neo-Geo) (bootleg) - -static struct BurnRomInfo pbobblenbRomDesc[] = { - { "u7", 0x080000, 0xac1e9ef3, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "us1", 0x020000, 0x9caae538, 2 | BRF_GRA }, // 1 Text layer tiles - - { "uc5", 0x080000, 0xe89ad494, 3 | BRF_GRA }, // 2 Sprite data - { "uc6", 0x080000, 0x4b42d7eb, 3 | BRF_GRA }, // 3 - - { "um1", 0x020000, 0xf424368a, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "u8", 0x100000, 0x0840cbc4, 5 | BRF_SND }, // 5 Sound data - { "u9", 0x080000, 0x0a548948, 5 | BRF_SND }, // 6 -}; - -STDROMPICKEXT(pbobblenb, pbobblenb, neogeo) -STD_ROM_FN(pbobblenb) - -struct BurnDriver BurnDrvpbobblenb = { - "pbobblenb", "pbobblen", "neogeo", NULL, "1994", - "Puzzle Bobble / Bust-A-Move (Neo-Geo) (bootleg)\0", NULL, "Taito", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, pbobblenbRomInfo, pbobblenbRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Puzzle Bobble 2 / Bust-A-Move Again (Neo-Geo) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo pbobbl2nRomDesc[] = { - { "248-p1.p1", 0x100000, 0x9d6c0754, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "248-s1.s1", 0x020000, 0x0a3fee41, 2 | BRF_GRA }, // 1 Text layer tiles - - { "248-c1.c1", 0x400000, 0xd9115327, 3 | BRF_GRA }, // 2 Sprite data - { "248-c2.c2", 0x400000, 0x77f9fdac, 3 | BRF_GRA }, // 3 - { "248-c3.c3", 0x100000, 0x8890bf7c, 3 | BRF_GRA }, // 4 - { "248-c4.c4", 0x100000, 0x8efead3f, 3 | BRF_GRA }, // 5 - - { "248-m1.m1", 0x020000, 0x883097a9, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "248-v1.v1", 0x400000, 0x57fde1fa, 5 | BRF_SND }, // 7 Sound data - { "248-v2.v2", 0x400000, 0x4b966ef3, 5 | BRF_SND }, // 8 -}; - -STDROMPICKEXT(pbobbl2n, pbobbl2n, neogeo) -STD_ROM_FN(pbobbl2n) - -struct BurnDriver BurnDrvpbobbl2n = { - "pbobbl2n", NULL, "neogeo", NULL, "1999", - "Puzzle Bobble 2 / Bust-A-Move Again (Neo-Geo)\0", NULL, "Taito (SNK license)", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, pbobbl2nRomInfo, pbobbl2nRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Pochi and Nyaa -/* Encrypted Set */ /* MVS ONLY RELEASE */ - -static struct BurnRomInfo pnyaaRomDesc[] = { - /* also found P1 on eprom with label sticker P N 2.02 on board NEO-MVS PROGBK2 (2000.3.21) - and M1 on eprom with label sticker M1 on board NEO-MVS CHAFIO (1999.6.14) (NEO-CMC 7050) - { "pn2.02.p1", 0x100000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C800 - { "m1.m1", 0x080000, 0x00000000, 4 | BRF_ESS | BRF_PRG }, // 3 Z80 code / M27C4001 */ - { "267-p1.p1", 0x100000, 0x112fe2c0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - { "267-c1.c1", 0x800000, 0x5eebee65, 3 | BRF_GRA }, // 1 Sprite data / mask rom TC534000 - { "267-c2.c2", 0x800000, 0x2b67187b, 3 | BRF_GRA }, // 2 / mask rom TC534000 - - { "267-m1.m1", 0x080000, 0xc7853ccd, 4 | BRF_ESS | BRF_PRG }, // 3 Z80 code / mask rom TC534000 - - { "267-v1.v1", 0x400000, 0xe2e8e917, 5 | BRF_SND }, // 4 Sound data / mask rom TC5332204 -}; - -STDROMPICKEXT(pnyaa, pnyaa, neogeo) -STD_ROM_FN(pnyaa) - -INT32 pnyaaInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0x2E; - - nRet = NeoInit(); - - if (nRet == 0) { - PCM2DecryptV(0x400000, 0); - } - - return nRet; -} - -struct BurnDriver BurnDrvpnyaa = { - "pnyaa", NULL, "neogeo", NULL, "2003", - "Pochi and Nyaa\0", NULL, "Aiky / Taito", "Neo Geo MVS", - L"Pochi and Nyaa\0\u30DD\u30C1\u30C3\u3068\u306B\u3083\uFF5E\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_PUZZLE, 0, - NULL, pnyaaRomInfo, pnyaaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - pnyaaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Chibi Marukochan Deluxe Quiz - -static struct BurnRomInfo marukodqRomDesc[] = { - { "206-p1.p1", 0x100000, 0xc33ed21e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - - { "206-s1.s1", 0x020000, 0xf0b68780, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "206-c1.c1", 0x400000, 0x846e4e8e, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5332205 - { "206-c2.c2", 0x400000, 0x1cba876d, 3 | BRF_GRA }, // 3 / mask rom TC5332205 - { "206-c3.c3", 0x100000, 0x79aa2b48, 3 | BRF_GRA }, // 4 / mask rom TC538200 - { "206-c4.c4", 0x100000, 0x55e1314d, 3 | BRF_GRA }, // 5 / mask rom TC538200 - - { "206-m1.m1", 0x020000, 0x0e22902e, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / mask rom TC531001 - - { "206-v1.v1", 0x200000, 0x5385eca8, 5 | BRF_SND }, // 7 Sound data / mask rom TC5316200 - { "206-v2.v2", 0x200000, 0xf8c55404, 5 | BRF_SND }, // 8 / mask rom TC5316200 -}; - -STDROMPICKEXT(marukodq, marukodq, neogeo) -STD_ROM_FN(marukodq) - -struct BurnDriver BurnDrvmarukodq = { - "marukodq", NULL, "neogeo", NULL, "1995", - "Chibi Marukochan Deluxe Quiz\0", NULL, "Takara", "Neo Geo MVS", - L"\u3061\u3073\u307E\u308B\u5B50\u3061\u3083\u3093 \u307E\u308B\u5B50\u30C7\u30E9\u30C3\u30AF\u30B9\u30AF\u30A4\u30BA\0Chibi Marukochan Deluxe Quiz\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_QUIZ, 0, - NULL, marukodqRomInfo, marukodqRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Double Dragon (Neo-Geo) - -static struct BurnRomInfo doubledrRomDesc[] = { - /* also found MVS set with PROG board NEO-MVS PROG 4096 B and CHA board NEO-MVS CHA 42G-3; same chip labels */ - { "082-p1.p1", 0x200000, 0x34ab832a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "082-s1.s1", 0x020000, 0xbef995c5, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "082-c1.c1", 0x200000, 0xb478c725, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "082-c2.c2", 0x200000, 0x2857da32, 3 | BRF_GRA }, // 3 / TC5316200 - { "082-c3.c3", 0x200000, 0x8b0d378e, 3 | BRF_GRA }, // 4 / TC5316200 - { "082-c4.c4", 0x200000, 0xc7d2f596, 3 | BRF_GRA }, // 5 / TC5316200 - { "082-c5.c5", 0x200000, 0xec87bff6, 3 | BRF_GRA }, // 6 / TC5316200 - { "082-c6.c6", 0x200000, 0x844a8a11, 3 | BRF_GRA }, // 7 / TC5316200 - { "082-c7.c7", 0x100000, 0x727c4d02, 3 | BRF_GRA }, // 8 / TC538200 - { "082-c8.c8", 0x100000, 0x69a5fa37, 3 | BRF_GRA }, // 9 / TC538200 - - { "082-m1.m1", 0x020000, 0x10b144de, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "082-v1.v1", 0x200000, 0xcc1128e4, 5 | BRF_SND }, // 11 Sound data / TC5316200 - { "082-v2.v2", 0x200000, 0xc3ff5554, 5 | BRF_SND }, // 12 / TC5316200 -}; - -STDROMPICKEXT(doubledr, doubledr, neogeo) -STD_ROM_FN(doubledr) - -struct BurnDriver BurnDrvdoubledr = { - "doubledr", NULL, "neogeo", NULL, "1995", - "Double Dragon (Neo-Geo)\0", NULL, "Technos", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, doubledrRomInfo, doubledrRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Voltage Fighter - Gowcaizer / Choujin Gakuen Gowcaizer - -static struct BurnRomInfo gowcaizrRomDesc[] = { - { "094-p1.p1", 0x200000, 0x33019545, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "094-s1.s1", 0x020000, 0x2f8748a2, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "094-c1.c1", 0x200000, 0x042f6af5, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "094-c2.c2", 0x200000, 0x0fbcd046, 3 | BRF_GRA }, // 3 / TC5316200 - { "094-c3.c3", 0x200000, 0x58bfbaa1, 3 | BRF_GRA }, // 4 / TC5316200 - { "094-c4.c4", 0x200000, 0x9451ee73, 3 | BRF_GRA }, // 5 / TC5316200 - { "094-c5.c5", 0x200000, 0xff9cf48c, 3 | BRF_GRA }, // 6 / TC5316200 - { "094-c6.c6", 0x200000, 0x31bbd918, 3 | BRF_GRA }, // 7 / TC5316200 - { "094-c7.c7", 0x200000, 0x2091ec04, 3 | BRF_GRA }, // 8 / TC5316200 - { "094-c8.c8", 0x200000, 0xd80dd241, 3 | BRF_GRA }, // 9 / TC5316200 - - { "094-m1.m1", 0x020000, 0x78c851cb, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "094-v1.v1", 0x200000, 0x6c31223c, 5 | BRF_SND }, // 11 Sound data / TC5316200 - { "094-v2.v2", 0x200000, 0x8edb776c, 5 | BRF_SND }, // 12 / TC5316200 - { "094-v3.v3", 0x100000, 0xc63b9285, 5 | BRF_SND }, // 13 / TC538200 -}; - -STDROMPICKEXT(gowcaizr, gowcaizr, neogeo) -STD_ROM_FN(gowcaizr) - -struct BurnDriver BurnDrvgowcaizr = { - "gowcaizr", NULL, "neogeo", NULL, "1995", - "Voltage Fighter - Gowcaizer / Choujin Gakuen Gowcaizer\0", NULL, "Technos", "Neo Geo MVS", - L"Voltage Fighter - Gowcaizer\0\u8D85\u4EBA\u5B66\u5712\u30B4\u30A6\u30AB\u30A4\u30B6\u30FC\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, gowcaizrRomInfo, gowcaizrRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Super Dodge Ball / Kunio no Nekketsu Toukyuu Densetsu -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo sdodgebRomDesc[] = { - { "208-p1.p1", 0x200000, 0x127f3d32, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "208-s1.s1", 0x020000, 0x64abd6b3, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "208-c1.c1", 0x400000, 0x93d8619b, 3 | BRF_GRA }, // 2 Sprite data / TC5332205 - { "208-c2.c2", 0x400000, 0x1c737bb6, 3 | BRF_GRA }, // 3 / TC5332205 - { "208-c3.c3", 0x200000, 0x14cb1703, 3 | BRF_GRA }, // 4 / TC5332205 - { "208-c4.c4", 0x200000, 0xc7165f19, 3 | BRF_GRA }, // 5 / TC5332205 - - { "208-m1.m1", 0x020000, 0x0a5f3325, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "208-v1.v1", 0x400000, 0xe7899a24, 5 | BRF_SND }, // 7 Sound data / TC5332204 -}; - -STDROMPICKEXT(sdodgeb, sdodgeb, neogeo) -STD_ROM_FN(sdodgeb) - -struct BurnDriver BurnDrvsdodgeb = { - "sdodgeb", NULL, "neogeo", NULL, "1996", - "Super Dodge Ball / Kunio no Nekketsu Toukyuu Densetsu\0", NULL, "Technos", "Neo Geo MVS", - L"Super Dodge Ball\0\u304F\u306B\u304A\u306E\u71B1\u8840\u95D8\u7403\u4F1D\u8AAC\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_SPORTSMISC, 0, - NULL, sdodgebRomInfo, sdodgebRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Dragon's Heaven (development board) -// same ID code as Voltage Fighter Gowkaizer, developed by ex-Technos staff - -static struct BurnRomInfo dragonshRomDesc[] = { - { "EP1.bin", 0x080000, 0xf353448c, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "EP2.bin", 0x080000, 0xf25c71ad, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "s1.s1", 0x020000, 0x706477a7, 2 | BRF_GRA }, // 2 Text layer tiles - - { "no3.bin", 0x1000000, 0x81821826, 3 | BRF_GRA }, // 3 Sprite data - { "no4.bin", 0x1000000, 0x3601d568, 3 | BRF_GRA }, // 4 - - { "sm1.sm1", 0x020000, 0x94416d67, 4 | BRF_ESS | BRF_PRG }, // 5 Z80 code - - { "sram.v1", 0x200000, 0x00000000, 5 | BRF_SND | BRF_NODUMP }, // 6 Sound data -}; - -STDROMPICKEXT(dragonsh, dragonsh, neogeo) -STD_ROM_FN(dragonsh) - -static void DragonshCallback() -{ - BurnLoadRom(Neo68KROMActive + 0x000000, 0, 2); - BurnLoadRom(Neo68KROMActive + 0x000001, 1, 2); -} - -static INT32 DragonshInit() -{ - NeoCallbackActive->pInitialise = DragonshCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvdragonsh = { - "dragonsh", NULL, "neogeo", NULL, "1996", - "Dragon's Heaven (development board)\0", NULL, "Face", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_SPORTSMISC, 0, - NULL, dragonshRomInfo, dragonshRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - DragonshInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Tecmo World Soccer '96 -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo tws96RomDesc[] = { - { "086-p1.p1", 0x100000, 0x03e20ab6, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - - { "086-s1.s1", 0x020000, 0x6f5e2b3a, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "086-c1.c1", 0x400000, 0x2611bc2a, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5332205 - { "086-c2.c2", 0x400000, 0x6b0d6827, 3 | BRF_GRA }, // 3 / mask rom TC5332205 - { "086-c3.c3", 0x100000, 0x750ddc0c, 3 | BRF_GRA }, // 4 / mask rom TC538200 - { "086-c4.c4", 0x100000, 0x7a6e7d82, 3 | BRF_GRA }, // 5 / mask rom TC538200 - - { "086-m1.m1", 0x020000, 0xcb82bc5d, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / mask rom TC531001 - - { "086-v1.v1", 0x200000, 0x97bf1986, 5 | BRF_SND }, // 7 Sound data / mask rom TC5316200 - { "086-v2.v2", 0x200000, 0xb7eb05df, 5 | BRF_SND }, // 8 / mask rom TC5316200 -}; - -STDROMPICKEXT(tws96, tws96, neogeo) -STD_ROM_FN(tws96) - -struct BurnDriver BurnDrvtws96 = { - "tws96", NULL, "neogeo", NULL, "1996", - "Tecmo World Soccer '96\0", NULL, "Tecmo", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSFOOTBALL, 0, - NULL, tws96RomInfo, tws96RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Fight Fever (set 1) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo fightfevRomDesc[] = { - { "060-p1.p1", 0x100000, 0x2a104b50, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - -#if !defined ROM_VERIFY - { "060-s1.s1", 0x020000, 0x7f012104, 2 | BRF_GRA }, // 2 Text layer tiles -#else - { "060-s1.s1", 0x020000, 0xd62a72e9, 2 | BRF_GRA }, // 2 Text layer tiles - // 1 byte diff at offset 0 : 11 ; 00 -#endif - - { "060-c1.c1", 0x200000, 0x8908fff9, 3 | BRF_GRA }, // 2 Sprite data - { "060-c2.c2", 0x200000, 0xc6649492, 3 | BRF_GRA }, // 3 - { "060-c3.c3", 0x200000, 0x0956b437, 3 | BRF_GRA }, // 4 - { "060-c4.c4", 0x200000, 0x026f3b62, 3 | BRF_GRA }, // 5 - - { "060-m1.m1", 0x020000, 0x0b7c4e65, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "060-v1.v1", 0x200000, 0xf417c215, 5 | BRF_SND }, // 7 Sound data - { "060-v2.v2", 0x100000, 0xefcff7cf, 5 | BRF_SND }, // 8 -}; - -STDROMPICKEXT(fightfev, fightfev, neogeo) -STD_ROM_FN(fightfev) - -struct BurnDriver BurnDrvfightfev = { - "fightfev", NULL, "neogeo", NULL, "1994", - "Fight Fever (set 1)\0", NULL, "Viccom", "Neo Geo MVS", - L"Fight Fever\0\uC655\uC911\uC655 (set 1)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, fightfevRomInfo, fightfevRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Fight Fever (set 2) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo fightfevaRomDesc[] = { - { "060-p1.p1", 0x100000, 0x2a104b50, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / VIC940800-101 - /* also found sets with p1/ p2 4mbit on eprom with Viccom sticker labels on board NEO-MVS PROGGSC - { "viccom_1.ep1", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C4002 - { "viccom_2.ep2", 0x080000, 0x00000000, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 */ - -#if !defined ROM_VERIFY - { "060-s1.s1", 0x020000, 0x7f012104, 2 | BRF_GRA }, // 2 Text layer tiles -#else - { "060-s1.s1", 0x020000, 0xd62a72e9, 2 | BRF_GRA }, // 2 Text layer tiles - // 1 byte diff at offset 0 : 11 ; 00 -#endif - - { "060-c1.c1", 0x200000, 0x8908fff9, 3 | BRF_GRA }, // 2 Sprite data / VIC931600 - { "060-c2.c2", 0x200000, 0xc6649492, 3 | BRF_GRA }, // 3 / VIC931600 - { "060-c3.c3", 0x200000, 0x0956b437, 3 | BRF_GRA }, // 4 / VIC931600 - { "060-c4.c4", 0x200000, 0x026f3b62, 3 | BRF_GRA }, // 5 / VIC931600 - - { "060-m1.m1", 0x020000, 0x0b7c4e65, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / VIC930100 - - { "060-v1.v1", 0x200000, 0xf417c215, 5 | BRF_SND }, // 7 Sound data / VIC930800 - { "060-v2.v2", 0x100000, 0xefcff7cf, 5 | BRF_SND }, // 8 / VIC931600 - - { "1.sp2", 0x080000, 0x3032041b, 0 | BRF_ESS | BRF_PRG }, // 9 68K code / TC574200 - /* P is on eprom, has a Viccom logo at the top of the label with a circled '1' in the center */ -}; - -STDROMPICKEXT(fightfeva, fightfeva, neogeo) -STD_ROM_FN(fightfeva) - -static void fightfevaCallback() -{ - BurnLoadRom(Neo68KROMActive, 9, 1); -} - -static INT32 fightfevaInit() -{ - NeoCallbackActive->pInitialise = fightfevaCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvfightfeva = { - "fightfeva", "fightfev", "neogeo", NULL, "1994", - "Fight Fever (set 2)\0", NULL, "Viccom", "Neo Geo MVS", - L"Fight Fever\0\uC655\uC911\uC655 (set 2)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, fightfevaRomInfo, fightfevaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - fightfevaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Power Spikes II (NGM-068) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo pspikes2RomDesc[] = { - { "068-pg1.p1", 0x100000, 0x105a408f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - - { "068-sg1.s1", 0x020000, 0x18082299, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "068-c1.c1", 0x100000, 0x7f250f76, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC538200 - { "068-c2.c2", 0x100000, 0x20912873, 3 | BRF_GRA }, // 3 / mask rom TC538200 - { "068-c3.c3", 0x100000, 0x4b641ba1, 3 | BRF_GRA }, // 4 / mask rom TC538200 - { "068-c4.c4", 0x100000, 0x35072596, 3 | BRF_GRA }, // 5 / mask rom TC538200 - { "068-c5.c5", 0x100000, 0x151dd624, 3 | BRF_GRA }, // 6 / mask rom TC538200 - { "068-c6.c6", 0x100000, 0xa6722604, 3 | BRF_GRA }, // 7 / mask rom TC538200 - - { "068-mg1.m1", 0x020000, 0xb1c7911e, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code / mask rom TC531001 - - { "068-v1.v1", 0x100000, 0x2ced86df, 5 | BRF_SND }, // 9 Sound data / mask rom TC538200 - { "068-v2.v2", 0x100000, 0x970851ab, 5 | BRF_SND }, // 10 / mask rom TC538200 - { "068-v3.v3", 0x100000, 0x81ff05aa, 5 | BRF_SND }, // 11 / mask rom TC538200 -}; - -STDROMPICKEXT(pspikes2, pspikes2, neogeo) -STD_ROM_FN(pspikes2) - -struct BurnDriver BurnDrvpspikes2 = { - "pspikes2", NULL, "neogeo", NULL, "1994", - "Power Spikes II (NGM-068)\0", NULL, "Video System Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SPORTSMISC, 0, - NULL, pspikes2RomInfo, pspikes2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Aero Fighters 2 / Sonic Wings 2 - -static struct BurnRomInfo sonicwi2RomDesc[] = { - { "075-p1.p1", 0x200000, 0x92871738, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - - { "075-s1.s1", 0x020000, 0xc9eec367, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "075-c1.c1", 0x200000, 0x3278e73e, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5316200 - { "075-c2.c2", 0x200000, 0xfe6355d6, 3 | BRF_GRA }, // 3 / mask rom TC5316200 - { "075-c3.c3", 0x200000, 0xc1b438f1, 3 | BRF_GRA }, // 4 / mask rom TC5316200 - { "075-c4.c4", 0x200000, 0x1f777206, 3 | BRF_GRA }, // 5 / mask rom TC5316200 - - { "075-m1.m1", 0x020000, 0xbb828df1, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / mask rom TC531001 - - { "075-v1.v1", 0x200000, 0x7577e949, 5 | BRF_SND }, // 7 Sound data / mask rom TC5316200 - { "075-v2.v2", 0x100000, 0x021760cd, 5 | BRF_SND }, // 8 / mask rom TC538200 -}; - -STDROMPICKEXT(sonicwi2, sonicwi2, neogeo) -STD_ROM_FN(sonicwi2) - -struct BurnDriver BurnDrvsonicwi2 = { - "sonicwi2", NULL, "neogeo", NULL, "1994", - "Aero Fighters 2 / Sonic Wings 2\0", NULL, "Video System Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VERSHOOT, FBF_SONICWI, - NULL, sonicwi2RomInfo, sonicwi2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Aero Fighters 3 / Sonic Wings 3 - -static struct BurnRomInfo sonicwi3RomDesc[] = { - { "097-p1.p1", 0x200000, 0x0547121d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "097-s1.s1", 0x020000, 0x8dd66743, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "097-c1.c1", 0x400000, 0x33d0d589, 3 | BRF_GRA }, // 2 Sprite data / TC5332205 - { "097-c2.c2", 0x400000, 0x186f8b43, 3 | BRF_GRA }, // 3 / TC5332205 - { "097-c3.c3", 0x200000, 0xc339fff5, 3 | BRF_GRA }, // 4 / TC5316200 - { "097-c4.c4", 0x200000, 0x84a40c6e, 3 | BRF_GRA }, // 5 / TC5316200 - - { "097-m1.m1", 0x020000, 0xb20e4291, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "097-v1.v1", 0x400000, 0x6f885152, 5 | BRF_SND }, // 7 Sound data / TC5332201 - { "097-v2.v2", 0x200000, 0x3359e868, 5 | BRF_SND }, // 8 / TC5316200 -}; - -STDROMPICKEXT(sonicwi3, sonicwi3, neogeo) -STD_ROM_FN(sonicwi3) - -struct BurnDriver BurnDrvsonicwi3 = { - "sonicwi3", NULL, "neogeo", NULL, "1995", - "Aero Fighters 3 / Sonic Wings 3\0", NULL, "Video System Co.", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VERSHOOT, FBF_SONICWI, - NULL, sonicwi3RomInfo, sonicwi3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Pop 'n Bounce / Gapporin -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo popbouncRomDesc[] = { - { "237-p1.p1", 0x100000, 0xbe96e44f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "237-s1.s1", 0x020000, 0xb61cf595, 2 | BRF_GRA }, // 1 Text layer tiles - - { "237-c1.c1", 0x200000, 0xeda42d66, 3 | BRF_GRA }, // 2 Sprite data - { "237-c2.c2", 0x200000, 0x5e633c65, 3 | BRF_GRA }, // 3 - - { "237-m1.m1", 0x020000, 0xd4c946dd, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "237-v1.v1", 0x200000, 0xedcb1beb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(popbounc, popbounc, neogeo) -STD_ROM_FN(popbounc) - -struct BurnDriver BurnDrvpopbounc = { - "popbounc", NULL, "neogeo", NULL, "1997", - "Pop 'n Bounce / Gapporin\0", NULL, "Video System Co.", "Neo Geo MVS", - L"Pop 'n Bounce\0\u30AC\u30C3\u30DD\u30EA\u30F3\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_PADDLE, GBF_PUZZLE, 0, - NULL, popbouncRomInfo, popbouncRomName, NULL, NULL, neopaddleInputInfo, neopaddleDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Andro Dunos (NGM-049)(NGH-049) -/* MVS AND AES VERSION */ - -static struct BurnRomInfo androdunRomDesc[] = { - { "049-p1.p1", 0x080000, 0x3b857da2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / CXK384500 - { "049-p2.p2", 0x080000, 0x2f062209, 1 | BRF_ESS | BRF_PRG }, // 1 / CXK384500 - - { "049-s1.s1", 0x020000, 0x6349de5d, 2 | BRF_GRA }, // 2 Text layer tiles / CXK381000 - - { "049-c1.c1", 0x100000, 0x7ace6db3, 3 | BRF_GRA }, // 3 Sprite data / CXK388000 - { "049-c2.c2", 0x100000, 0xb17024f7, 3 | BRF_GRA }, // 4 / CXK388000 - - { "049-m1.m1", 0x020000, 0xedd2acf4, 4 | BRF_ESS | BRF_PRG }, // 5 Z80 code / CXK381003 - - { "049-v1.v1", 0x100000, 0xce43cb89, 5 | BRF_SND }, // 6 Sound data / CXK388000 -}; - -STDROMPICKEXT(androdun, androdun, neogeo) -STD_ROM_FN(androdun) - -struct BurnDriver BurnDrvandrodun = { - "androdun", NULL, "neogeo", NULL, "1992", - "Andro Dunos (NGM-049)(NGH-049)\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_HORSHOOT, 0, - NULL, androdunRomInfo, androdunRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Bang Bang Busters (2010 NCI release) - -static struct BurnRomInfo b2bRomDesc[] = { - { "071.p1", 0x080000, 0x7687197d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "071.s1", 0x020000, 0x44e5f154, 2 | BRF_GRA }, // 1 Text layer tiles - - { "071.c1", 0x200000, 0x23d84a7a, 3 | BRF_GRA }, // 2 Sprite data - { "071.c2", 0x200000, 0xce7b6248, 3 | BRF_GRA }, // 3 - - { "071.m1", 0x020000, 0x6da739ad, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "071.v1", 0x100000, 0x50feffb0, 5 | BRF_SND }, // 7 Sound data - -}; - -STDROMPICKEXT(b2b, b2b, neogeo) -STD_ROM_FN(b2b) - -struct BurnDriver BurnDrvb2b = { - "b2b", NULL, "neogeo", NULL, "2000", - "Bang Bang Busters (2010 NCI release)\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, 0, - NULL, b2bRomInfo, b2bRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Puzzle De Pon! -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo puzzledpRomDesc[] = { - { "202-p1.p1", 0x080000, 0x2b61415b, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC534200 - - { "202-s1.s1", 0x020000, 0xcd19264f, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "202-c1.c1", 0x100000, 0xcc0095ef, 3 | BRF_GRA }, // 2 Sprite data / TC538200 - { "202-c2.c2", 0x100000, 0x42371307, 3 | BRF_GRA }, // 3 / TC538200 - - { "202-m1.m1", 0x020000, 0x9c0291ea, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / TC531001 - - { "202-v1.v1", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data / TC534200 -}; - -STDROMPICKEXT(puzzledp, puzzledp, neogeo) -STD_ROM_FN(puzzledp) - -struct BurnDriver BurnDrvpuzzledp = { - "puzzledp", NULL, "neogeo", NULL, "1995", - "Puzzle De Pon!\0", NULL, "Taito (Visco license)", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, puzzledpRomInfo, puzzledpRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo Mr. Do! -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo neomrdoRomDesc[] = { - /* also found MVS set with PROG Board NEO-MVS PROG 4096 and CHA board NEO-MVS CHA42G-3B; same chip labels */ - { "207-p1.p1", 0x100000, 0x334ea51e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - - { "207-s1.s1", 0x020000, 0x6aebafce, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "207-c1.c1", 0x200000, 0xc7541b9d, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "207-c2.c2", 0x200000, 0xf57166d2, 3 | BRF_GRA }, // 3 / TC5316200 - - { "207-m1.m1", 0x020000, 0xb5b74a95, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / TC531001 - - { "207-v1.v1", 0x200000, 0x4143c052, 5 | BRF_SND }, // 5 Sound data / TC5316200 -}; - -STDROMPICKEXT(neomrdo, neomrdo, neogeo) -STD_ROM_FN(neomrdo) - -struct BurnDriver BurnDrvneomrdo = { - "neomrdo", NULL, "neogeo", NULL, "1996", - "Neo Mr. Do!\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_MAZE, 0, - NULL, neomrdoRomInfo, neomrdoRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Goal! Goal! Goal! -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo goalx3RomDesc[] = { - { "209-p1.p1", 0x200000, 0x2a019a79, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - - { "209-s1.s1", 0x020000, 0xc0eaad86, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "209-c1.c1", 0x400000, 0xb49d980e, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5332205 - { "209-c2.c2", 0x400000, 0x5649b015, 3 | BRF_GRA }, // 3 / mask rom TC5332205 - { "209-c3.c3", 0x100000, 0x5f91bace, 3 | BRF_GRA }, // 4 / mask rom TC538200 - { "209-c4.c4", 0x100000, 0x1e9f76f2, 3 | BRF_GRA }, // 5 / mask rom TC538200 - - { "209-m1.m1", 0x020000, 0xcd758325, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / mask rom TC531001 - - { "209-v1.v1", 0x200000, 0xef214212, 5 | BRF_SND }, // 7 Sound data / mask rom TC5316200 -}; - -STDROMPICKEXT(goalx3, goalx3, neogeo) -STD_ROM_FN(goalx3) - -struct BurnDriver BurnDrvgoalx3 = { - "goalx3", NULL, "neogeo", NULL, "1995", - "Goal! Goal! Goal!\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_SPORTSFOOTBALL, 0, - NULL, goalx3RomInfo, goalx3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo Drift Out - New Technology -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo neodriftRomDesc[] = { - { "213-p1.p1", 0x200000, 0xe397d798, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC5316200 - - { "213-s1.s1", 0x020000, 0xb76b61bc, 2 | BRF_GRA }, // 1 Text layer tiles / mask rom TC531000 - - { "213-c1.c1", 0x400000, 0x3edc8bd3, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5316200 - { "213-c2.c2", 0x400000, 0x46ae5f16, 3 | BRF_GRA }, // 3 / mask rom TC5316200 - - { "213-m1.m1", 0x020000, 0x200045f1, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code / mask rom TC531001 - - { "213-v1.v1", 0x200000, 0xa421c076, 5 | BRF_SND }, // 5 Sound data / mask rom TC5332205 - { "213-v2.v2", 0x200000, 0x233c7dd9, 5 | BRF_SND }, // 6 / mask rom TC5332205 -}; - -STDROMPICKEXT(neodrift, neodrift, neogeo) -STD_ROM_FN(neodrift) - -struct BurnDriver BurnDrvneodrift = { - "neodrift", NULL, "neogeo", NULL, "1996", - "Neo Drift Out - New Technology\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_RACING, 0, - NULL, neodriftRomInfo, neodriftRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Breakers - -static struct BurnRomInfo breakersRomDesc[] = { - { "230-p1.p1", 0x200000, 0xed24a6e6, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "230-s1.s1", 0x020000, 0x076fb64c, 2 | BRF_GRA }, // 1 Text layer tiles - - { "230-c1.c1", 0x400000, 0x68d4ae76, 3 | BRF_GRA }, // 2 Sprite data - { "230-c2.c2", 0x400000, 0xfdee05cd, 3 | BRF_GRA }, // 3 - { "230-c3.c3", 0x400000, 0x645077f3, 3 | BRF_GRA }, // 4 - { "230-c4.c4", 0x400000, 0x63aeb74c, 3 | BRF_GRA }, // 5 - - { "230-m1.m1", 0x020000, 0x3951a1c1, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "230-v1.v1", 0x400000, 0x7f9ed279, 5 | BRF_SND }, // 7 Sound data - { "230-v2.v2", 0x400000, 0x1d43e420, 5 | BRF_SND }, // 8 -}; - -STDROMPICKEXT(breakers, breakers, neogeo) -STD_ROM_FN(breakers) - -struct BurnDriver BurnDrvbreakers = { - "breakers", NULL, "neogeo", NULL, "1996", - "Breakers\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, breakersRomInfo, breakersRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Puzzle De Pon! R! -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo puzzldprRomDesc[] = { - { "235-p1.p1", 0x080000, 0xafed5de2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "235-s1.s1", 0x020000, 0x3b13a22f, 2 | BRF_GRA }, // 1 Text layer tiles - - { "202-c1.c1", 0x100000, 0xcc0095ef, 3 | BRF_GRA }, // 2 Sprite data - { "202-c2.c2", 0x100000, 0x42371307, 3 | BRF_GRA }, // 3 - - { "202-m1.m1", 0x020000, 0x9c0291ea, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "202-v1.v1", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(puzzldpr, puzzldpr, neogeo) -STD_ROM_FN(puzzldpr) - -struct BurnDriver BurnDrvpuzzldpr = { - "puzzldpr", "puzzledp", "neogeo", NULL, "1997", - "Puzzle De Pon! R!\0", NULL, "Taito (Visco license)", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, puzzldprRomInfo, puzzldprRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Breakers Revenge -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo breakrevRomDesc[] = { - { "245-p1.p1", 0x200000, 0xc828876d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "245-s1.s1", 0x020000, 0xe7660a5d, 2 | BRF_GRA }, // 1 Text layer tiles - - /* The chip labels and sizes are correct */ - { "245-c1.c1", 0x400000, 0x68d4ae76, 3 | BRF_GRA }, // 2 Sprite data - { "245-c2.c2", 0x400000, 0xfdee05cd, 3 | BRF_GRA }, // 3 - { "245-c3.c3", 0x400000, 0x645077f3, 3 | BRF_GRA }, // 4 - { "245-c4.c4", 0x400000, 0x63aeb74c, 3 | BRF_GRA }, // 5 - { "245-c5.c5", 0x400000, 0xb5f40e7f, 3 | BRF_GRA }, // 6 - { "245-c6.c6", 0x400000, 0xd0337328, 3 | BRF_GRA }, // 7 - - { "245-m1.m1", 0x020000, 0x00f31c66, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code - - { "245-v1.v1", 0x400000, 0xe255446c, 5 | BRF_SND }, // 9 Sound data - { "245-v2.v2", 0x400000, 0x9068198a, 5 | BRF_SND }, // 10 -}; - -STDROMPICKEXT(breakrev, breakrev, neogeo) -STD_ROM_FN(breakrev) - -struct BurnDriver BurnDrvbreakrev = { - "breakrev", NULL, "neogeo", NULL, "1998", - "Breakers Revenge\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, breakrevRomInfo, breakrevRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Battle Flip Shot -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo flipshotRomDesc[] = { - { "247-p1.p1", 0x100000, 0x95779094, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "247-s1.s1", 0x020000, 0x6300185c, 2 | BRF_GRA }, // 1 Text layer tiles - - { "247-c1.c1", 0x200000, 0xc9eedcb2, 3 | BRF_GRA }, // 2 Sprite data - { "247-c2.c2", 0x200000, 0x7d6d6e87, 3 | BRF_GRA }, // 3 - - { "247-m1.m1", 0x020000, 0xa9fe0144, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "247-v1.v1", 0x200000, 0x42ec743d, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(flipshot, flipshot, neogeo) -STD_ROM_FN(flipshot) - -struct BurnDriver BurnDrvflipshot = { - "flipshot", NULL, "neogeo", NULL, "1998", - "Battle Flip Shot\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_BALLPADDLE, 0, - NULL, flipshotRomInfo, flipshotRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Captain Tomaday -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo ctomadayRomDesc[] = { - { "249-p1.p1", 0x200000, 0xc9386118, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "249-s1.s1", 0x020000, 0xdc9eb372, 2 | BRF_GRA }, // 1 Text layer tiles - - { "249-c1.c1", 0x400000, 0x041fb8ee, 3 | BRF_GRA }, // 2 Sprite data - { "249-c2.c2", 0x400000, 0x74f3cdf4, 3 | BRF_GRA }, // 3 - - { "249-m1.m1", 0x020000, 0x80328a47, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "249-v1.v1", 0x400000, 0xde7c8f27, 5 | BRF_SND }, // 5 Sound data - { "249-v2.v2", 0x100000, 0xc8e40119, 5 | BRF_SND }, // 6 -}; - -STDROMPICKEXT(ctomaday, ctomaday, neogeo) -STD_ROM_FN(ctomaday) - -struct BurnDriver BurnDrvctomaday = { - "ctomaday", NULL, "neogeo", NULL, "1999", - "Captain Tomaday\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VERSHOOT, 0, - NULL, ctomadayRomInfo, ctomadayRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Ganryu / Musashi Ganryuki -/* Original Version - Encrypted GFX */ /* MVS ONLY RELEASE */ - -static struct BurnRomInfo ganryuRomDesc[] = { - { "252-p1.p1", 0x200000, 0x4b8ac4fb, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - { "252-c1.c1", 0x800000, 0x50ee7882, 3 | BRF_GRA }, // 1 Sprite data - { "252-c2.c2", 0x800000, 0x62585474, 3 | BRF_GRA }, // 2 - - { "252-m1.m1", 0x020000, 0x30cc4099, 4 | BRF_ESS | BRF_PRG }, // 3 Z80 code - - { "252-v1.v1", 0x400000, 0xe5946733, 5 | BRF_SND }, // 4 Sound data -}; - -STDROMPICKEXT(ganryu, ganryu, neogeo) -STD_ROM_FN(ganryu) - -static INT32 ganryuInit() -{ - nNeoProtectionXor = 0x07; - return NeoInit(); -} - -struct BurnDriver BurnDrvganryu = { - "ganryu", NULL, "neogeo", NULL, "1999", - "Ganryu / Musashi Ganryuki\0", NULL, "Visco", "Neo Geo MVS", - L"Ganryu\0\u6B66\u8535\u5DCC\u6D41\u8A18\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP | HARDWARE_SNK_CMC42, GBF_PLATFORM, 0, - NULL, ganryuRomInfo, ganryuRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - ganryuInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Bang Bead -/* Original Version - Encrypted GFX */ /* MVS ONLY RELEASE */ - -static struct BurnRomInfo bangbeadRomDesc[] = { - { "259-p1.p1", 0x200000, 0x88a37f8b, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - { "259-c1.c1", 0x800000, 0x1f537f74, 3 | BRF_GRA }, // 1 Sprite data - { "259-c2.c2", 0x800000, 0x0efd98ff, 3 | BRF_GRA }, // 2 - - { "259-m1.m1", 0x020000, 0x85668ee9, 4 | BRF_ESS | BRF_PRG }, // 3 Z80 code - - { "259-v1.v1", 0x400000, 0x088eb8ab, 5 | BRF_SND }, // 4 Sound data - { "259-v2.v2", 0x100000, 0x97528fe9, 5 | BRF_SND }, // 5 -}; - -STDROMPICKEXT(bangbead, bangbead, neogeo) -STD_ROM_FN(bangbead) - -static INT32 bangbeadInit() -{ - nNeoProtectionXor = 0xF8; - return NeoInit(); -} - -struct BurnDriver BurnDrvbangbead = { - "bangbead", NULL, "neogeo", NULL, "2000", - "Bang Bead\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP | HARDWARE_SNK_CMC42, GBF_BALLPADDLE, 0, - NULL, bangbeadRomInfo, bangbeadRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - bangbeadInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Metal Slug 4 (NGM-2630) -/* Original Version - Encrypted GFX */ /* MVS VERSION */ - -static struct BurnRomInfo mslug4RomDesc[] = { - /* There also exist carts where p1 label is pg1; the PG1 revision has a Japanese cart label, SN 02Jxxxxx - The P1 revision has a US/EUR cart label, SN 02Txxxxx ; Rom data on both is identical. - These carts were manufactured by Mega Enterprise, not SNK. */ - { "263-p1.p1", 0x100000, 0x27e4def3, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "263-p2.sp2", 0x400000, 0xfdb7aed8, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "263-c1.c1", 0x800000, 0x84865f8a, 3 | BRF_GRA }, // 2 Sprite data - { "263-c2.c2", 0x800000, 0x81df97f2, 3 | BRF_GRA }, // 3 - { "263-c3.c3", 0x800000, 0x1a343323, 3 | BRF_GRA }, // 4 - { "263-c4.c4", 0x800000, 0x942cfb44, 3 | BRF_GRA }, // 5 - { "263-c5.c5", 0x800000, 0xa748854f, 3 | BRF_GRA }, // 6 - { "263-c6.c6", 0x800000, 0x5c8ba116, 3 | BRF_GRA }, // 7 - - /* Encrypted */ - { "263-m1.m1", 0x020000, 0x46ac8228, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code - - /* Encrypted */ - { "263-v1.v1", 0x800000, 0x01e9b9cd, 5 | BRF_SND }, // 9 Sound data - { "263-v2.v2", 0x800000, 0x4ab2bf81, 5 | BRF_SND }, // 10 -}; - -STDROMPICKEXT(mslug4, mslug4, neogeo) -STD_ROM_FN(mslug4) - -static INT32 mslug4Init() -{ - INT32 nRet; - -// nNeoTextROMSize = 0x080000; - nNeoProtectionXor = 0x31; - - nRet = NeoInit(); - - if (nRet == 0) { - PCM2DecryptV(0x1000000, 1); - } - - return nRet; -} - -struct BurnDriver BurnDrvmslug4 = { - "mslug4", NULL, "neogeo", NULL, "2002", - "Metal Slug 4 (NGM-2630)\0", NULL, "Mega", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug4RomInfo, mslug4RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug4Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Metal Slug 4 (NGH-2630) -/* Original Version - Encrypted GFX */ /* AES VERSION */ - -static struct BurnRomInfo mslug4hRomDesc[] = { - { "263-ph1.p1", 0x100000, 0xc67f5c8d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "263-ph2.sp2", 0x400000, 0xbc3ec89e, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "263-c1.c1", 0x800000, 0x84865f8a, 3 | BRF_GRA }, // 2 Sprite data - { "263-c2.c2", 0x800000, 0x81df97f2, 3 | BRF_GRA }, // 3 - { "263-c3.c3", 0x800000, 0x1a343323, 3 | BRF_GRA }, // 4 - { "263-c4.c4", 0x800000, 0x942cfb44, 3 | BRF_GRA }, // 5 - { "263-c5.c5", 0x800000, 0xa748854f, 3 | BRF_GRA }, // 6 - { "263-c6.c6", 0x800000, 0x5c8ba116, 3 | BRF_GRA }, // 7 - - /* Encrypted */ - { "263-m1.m1", 0x020000, 0x46ac8228, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code - - /* Encrypted */ - { "263-v1.v1", 0x800000, 0x01e9b9cd, 5 | BRF_SND }, // 9 Sound data - { "263-v2.v2", 0x800000, 0x4ab2bf81, 5 | BRF_SND }, // 10 -}; - -STDROMPICKEXT(mslug4h, mslug4h, neogeo) -STD_ROM_FN(mslug4h) - -struct BurnDriver BurnDrvmslug4h = { - "mslug4h", "mslug4", "neogeo", NULL, "2002", - "Metal Slug 4 (NGH-2630)\0", NULL, "Mega", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug4hRomInfo, mslug4hRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug4Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Metal Slug 4 Plus (bootleg) - -static struct BurnRomInfo ms4plusRomDesc[] = { - { "ms4-p1p.bin", 0x100000, 0x806a6e04, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "263-p2.sp2", 0x400000, 0xfdb7aed8, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "ms4-s1p.bin", 0x020000, 0x07ff87ce, 2 | BRF_GRA }, // 2 Text layer tiles - - { "263-c1.c1", 0x800000, 0x84865f8a, 3 | BRF_GRA }, // 3 Sprite data - { "263-c2.c2", 0x800000, 0x81df97f2, 3 | BRF_GRA }, // 4 - { "263-c3.c3", 0x800000, 0x1a343323, 3 | BRF_GRA }, // 5 - { "263-c4.c4", 0x800000, 0x942cfb44, 3 | BRF_GRA }, // 6 - { "263-c5.c5", 0x800000, 0xa748854f, 3 | BRF_GRA }, // 7 - { "263-c6.c6", 0x800000, 0x5c8ba116, 3 | BRF_GRA }, // 8 - - { "263-m1.m1", 0x020000, 0x46ac8228, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code - - { "263-v1.v1", 0x800000, 0x01e9b9cd, 5 | BRF_SND }, // 9 Sound data - { "263-v2.v2", 0x800000, 0x4ab2bf81, 5 | BRF_SND }, // 10 -}; - -STDROMPICKEXT(ms4plus, ms4plus, neogeo) -STD_ROM_FN(ms4plus) - -struct BurnDriver BurnDrvms4plus = { - "ms4plus", "mslug4", "neogeo", NULL, "2002", - "Metal Slug 4 Plus (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_PLATFORM, FBF_MSLUG, - NULL, ms4plusRomInfo, ms4plusRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug4Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Rage of the Dragons (NGM-2640) -/* Encrypted Set */ /* MVS VERSION */ - -static struct BurnRomInfo rotdRomDesc[] = { - { "264-p1.p1", 0x800000, 0xb8cc969d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "264-c1.c1", 0x800000, 0x4f148fee, 3 | BRF_GRA }, // 1 Sprite data - { "264-c2.c2", 0x800000, 0x7cf5ff72, 3 | BRF_GRA }, // 2 - { "264-c3.c3", 0x800000, 0x64d84c98, 3 | BRF_GRA }, // 3 - { "264-c4.c4", 0x800000, 0x2f394a95, 3 | BRF_GRA }, // 4 - { "264-c5.c5", 0x800000, 0x6b99b978, 3 | BRF_GRA }, // 5 - { "264-c6.c6", 0x800000, 0x847d5c7d, 3 | BRF_GRA }, // 6 - { "264-c7.c7", 0x800000, 0x231d681e, 3 | BRF_GRA }, // 7 - { "264-c8.c8", 0x800000, 0xc5edb5c4, 3 | BRF_GRA }, // 8 - - { "264-m1.m1", 0x020000, 0x4dbd7b43, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "264-v1.v1", 0x800000, 0xfa005812, 5 | BRF_SND }, // 10 Sound data - { "264-v2.v2", 0x800000, 0xc3dc8bf0, 5 | BRF_SND }, // 11 -}; - -STDROMPICKEXT(rotd, rotd, neogeo) -STD_ROM_FN(rotd) - -static INT32 rotdInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0x3F; - - nRet = NeoInit(); - - if (nRet == 0) { - PCM2DecryptV(0x1000000, 2); - } - - return nRet; -} - -struct BurnDriver BurnDrvrotd = { - "rotd", NULL, "neogeo", NULL, "2002", - "Rage of the Dragons (NGM-264?)\0", NULL, "Evoga / Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, 0, - NULL, rotdRomInfo, rotdRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - rotdInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Rage of the Dragons (NGH-2640) -/* Encrypted Set */ /* AES VERSION */ - - static struct BurnRomInfo rotdhRomDesc[] = { - { "264-pk1.p1", 0x100000, 0xff2fa719, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / mask rom TC538200 - { "264-pk2.sp2", 0x200000, 0x0df2e112, 1 | BRF_ESS | BRF_PRG }, // 1 / mask rom TC5316200 - - { "264-c1.c1", 0x800000, 0x4f148fee, 3 | BRF_GRA }, // 1 Sprite data / mask rom TC5364205 - { "264-c2.c2", 0x800000, 0x7cf5ff72, 3 | BRF_GRA }, // 2 / mask rom TC5364205 - { "264-c3.c3", 0x800000, 0x64d84c98, 3 | BRF_GRA }, // 3 / mask rom TC5364205 - { "264-c4.c4", 0x800000, 0x2f394a95, 3 | BRF_GRA }, // 4 / mask rom TC5364205 - { "264-c5.c5", 0x800000, 0x6b99b978, 3 | BRF_GRA }, // 5 / mask rom TC5364205 - { "264-c6.c6", 0x800000, 0x847d5c7d, 3 | BRF_GRA }, // 6 / mask rom TC5364205 - { "264-c7.c7", 0x800000, 0x231d681e, 3 | BRF_GRA }, // 7 / mask rom TC5364205 - { "264-c8.c8", 0x800000, 0xc5edb5c4, 3 | BRF_GRA }, // 8 / mask rom TC5364205 - - { "264-m1.m1", 0x020000, 0x4dbd7b43, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code / mask rom 27c010 - - { "264-v1.v1", 0x800000, 0xfa005812, 5 | BRF_SND }, // 10 Sound data / mask rom TC5364205 - { "264-v2.v2", 0x800000, 0xc3dc8bf0, 5 | BRF_SND }, // 11 / mask rom TC5364205 -}; - -STDROMPICKEXT(rotdh, rotdh, neogeo) -STD_ROM_FN(rotdh) - -struct BurnDriver BurnDrvrotdh = { - "rotdh", "rotd", "neogeo", NULL, "2002", - "Rage of the Dragons (NGH-2640)\0", NULL, "Evoga / Playmore", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, 0, - NULL, rotdhRomInfo, rotdhRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - rotdInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - - -// Matrimelee / Shin Gouketsuji Ichizoku Toukon (NGM-2660) (NGH-2660) -/* Encrypted Set */ /* MVS AND AES VERSION */ - -static struct BurnRomInfo matrimRomDesc[] = { - { "266-p1.p1", 0x100000, 0x5d4c2dc7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "266-p2.sp2", 0x400000, 0xa14b1906, 1 | BRF_ESS | BRF_PRG }, // 1 - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "266-c1.c1", 0x800000, 0x505f4e30, 3 | BRF_GRA }, // 2 Sprite data - { "266-c2.c2", 0x800000, 0x3cb57482, 3 | BRF_GRA }, // 3 - { "266-c3.c3", 0x800000, 0xf1cc6ad0, 3 | BRF_GRA }, // 4 - { "266-c4.c4", 0x800000, 0x45b806b7, 3 | BRF_GRA }, // 5 - { "266-c5.c5", 0x800000, 0x9a15dd6b, 3 | BRF_GRA }, // 6 - { "266-c6.c6", 0x800000, 0x281cb939, 3 | BRF_GRA }, // 7 - { "266-c7.c7", 0x800000, 0x4b71f780, 3 | BRF_GRA }, // 8 - { "266-c8.c8", 0x800000, 0x29873d33, 3 | BRF_GRA }, // 9 - - /* Encrypted */ - { "266-m1.m1", 0x020000, 0x456c3e6c, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - /* Encrypted */ - { "266-v1.v1", 0x800000, 0xa4f83690, 5 | BRF_SND }, // 11 Sound data - { "266-v2.v2", 0x800000, 0xd0f69eda, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(matrim, matrim, neogeo) -STD_ROM_FN(matrim) - -static INT32 matrimInit() -{ - INT32 nRet; - -// nNeoTextROMSize = 0x080000; - nNeoProtectionXor = 0x6A; - NeoCallbackActive->pInitialise = PCM2DecryptP; - - nRet = NeoInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0x01000, 0xffce20, { 0xc4, 0x83, 0xa8, 0x5f, 0x21, 0x27, 0x64, 0xaf } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvmatrim = { - "matrim", NULL, "neogeo", NULL, "2002", - "Matrimelee / Shin Gouketsuji Ichizoku Toukon (NGM-2660) (NGH-2660)\0", NULL, "Noise Factory / Atlus", "Neo Geo MVS", - L"\u65B0\u8C6A\u8840\u5BFA\u4E00\u65CF - \u95D8\u5A5A\0Matrimelee (NGM-2660) (NGH-2660)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_PWRINST, - NULL, matrimRomInfo, matrimRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - matrimInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg) - -static struct BurnRomInfo matrimblRomDesc[] = { - { "266-p1.p1", 0x100000, 0x5d4c2dc7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "266-p2.sp2", 0x400000, 0xa14b1906, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "mart-c1.bin", 0x800000, 0xa5595656, 3 | BRF_GRA }, // 2 Sprite data - { "mart-c2.bin", 0x800000, 0xc5f7c300, 3 | BRF_GRA }, // 3 - { "mart-c3.bin", 0x800000, 0x574efd7d, 3 | BRF_GRA }, // 4 - { "mart-c4.bin", 0x800000, 0x109d54d9, 3 | BRF_GRA }, // 5 - { "mart-c5.bin", 0x800000, 0x15c9e882, 3 | BRF_GRA }, // 6 - { "mart-c6.bin", 0x800000, 0x77497b97, 3 | BRF_GRA }, // 7 - { "mart-c7.bin", 0x800000, 0xab481bb6, 3 | BRF_GRA }, // 8 - { "mart-c8.bin", 0x800000, 0x906cf267, 3 | BRF_GRA }, // 9 - - { "mart-m1.bin", 0x020000, 0x3ea96ab1, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "mart-v1.bin", 0x400000, 0x352b0a07, 5 | BRF_SND }, // 11 Sound data - { "mart-v2.bin", 0x400000, 0x1e9bd59e, 5 | BRF_SND }, // 12 - { "mart-v3.bin", 0x400000, 0xe8362fcc, 5 | BRF_SND }, // 13 - { "mart-v4.bin", 0x400000, 0xc8c79b19, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(matrimbl, matrimbl, neogeo) -STD_ROM_FN(matrimbl) - -static void matrimblCallback() -{ - INT32 i, j; - UINT8 *dst = (UINT8 *)BurnMalloc( 0x020000 ); - - if (dst) - { - memmove(dst, NeoZ80ROMActive, 0x020000); - - for(i = 0; i < 0x020000; i++) { - j = i; - if (i & 0x00001) j ^= 0x00800; - if (i & 0x00002) j ^= 0x02000; - if (i & 0x00800) j ^= 0x10800; - if (i & 0x10000) j ^= 0x00800; - NeoZ80ROMActive[j] = dst[i]; - } - BurnFree (dst); - } - - PCM2DecryptP(); - DoPerm(0); - NeoCMCExtractSData(NeoSpriteROM[nNeoActiveSlot], NeoTextROM[nNeoActiveSlot], 0x4000000, 0x080000); -} - -static INT32 matrimblInit() -{ - INT32 nRet; - -// nNeoTextROMSize = 0x080000; - NeoCallbackActive->pInitialise = matrimblCallback; - - nRet = NeoInit(); - - if (nRet == 0) { - BurnByteswap(YM2610ADPCMAROM[nNeoActiveSlot] + 0x400000, 0x400000); - BurnByteswap(YM2610ADPCMAROM[nNeoActiveSlot] + 0xc00000, 0x400000); - } - - return nRet; -} - -struct BurnDriver BurnDrvmatrimbl = { - "matrimbl", "matrim", "neogeo", NULL, "2002", - "Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - L"\u65B0\u8C6A\u8840\u5BFA\u4E00\u65CF - \u95D8\u5A5A\0Matrimelee (bootleg)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ALTERNATE_TEXT, GBF_VSFIGHT, FBF_PWRINST, - NULL, matrimblRomInfo, matrimblRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - matrimblInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Jockey Grand Prix (set 1) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo jockeygpRomDesc[] = { - /* Officially licensed? Cart has a holographic 'SNK' sticker applied */ - { "008-epr.p1", 0x100000, 0x2fb7f388, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - /* P on eprom, correct chip label unknown */ - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "008-c1.c1", 0x800000, 0xa9acbf18, 3 | BRF_GRA }, // 1 Sprite data - { "008-c2.c2", 0x800000, 0x6289eef9, 3 | BRF_GRA }, // 2 - - /* Encrypted */ - { "008-mg1.m1", 0x080000, 0xd163c690, 4 | BRF_ESS | BRF_PRG }, // 3 Z80 code - - { "008-v1.v1", 0x200000, 0x443eadba, 5 | BRF_SND }, // 4 Sound data -}; - -STDROMPICKEXT(jockeygp, jockeygp, neogeo) -STD_ROM_FN(jockeygp) - -INT32 jockeygpInit() -{ - nNeoProtectionXor = 0xAC; - return NeoInit(); -} - -struct BurnDriver BurnDrvjockeygp = { - "jockeygp", NULL, "neogeo", NULL, "2001", - "Jockey Grand Prix (set 1)\0", NULL, "Sun Amusement / BrezzaSoft", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_GAMBLING | HARDWARE_SNK_ENCRYPTED_M1, GBF_MISC, 0, - NULL, jockeygpRomInfo, jockeygpRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - jockeygpInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Jockey Grand Prix (set 2) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo jockeygpaRomDesc[] = { - /* Officially licensed? Cart has a holographic 'SNK' sticker applied */ - { "008-epr_a.p1", 0x100000, 0xb8f35532, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - /* P on eprom, correct chip label unknown */ - - /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ - /* Encrypted */ - { "008-c1.c1", 0x800000, 0xa9acbf18, 3 | BRF_GRA }, // 1 Sprite data - { "008-c2.c2", 0x800000, 0x6289eef9, 3 | BRF_GRA }, // 2 - - /* Encrypted */ - { "008-mg1.m1", 0x080000, 0xd163c690, 4 | BRF_ESS | BRF_PRG }, // 3 Z80 code - - { "008-v1.v1", 0x200000, 0x443eadba, 5 | BRF_SND }, // 4 Sound data -}; - -STDROMPICKEXT(jockeygpa, jockeygpa, neogeo) -STD_ROM_FN(jockeygpa) - -struct BurnDriver BurnDrvjockeygpa = { - "jockeygpa", "jockeygp", "neogeo", NULL, "2001", - "Jockey Grand Prix (set 2)\0", NULL, "Sun Amusement / BrezzaSoft", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_GAMBLING | HARDWARE_SNK_ENCRYPTED_M1, GBF_MISC, 0, - NULL, jockeygpaRomInfo, jockeygpaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - jockeygpInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// V-Liner (set 1) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo vlinerRomDesc[] = { - /* Officially licensed? Cart has a holographic 'SNK' sticker applied */ - { "epr.p1", 0x080000, 0x72a2c043, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - /* P on eprom, correct chip label unknown */ - - { "s-1.s1", 0x020000, 0x972d8c31, 2 | BRF_GRA }, // 1 Text layer tiles - - { "c-1.c1", 0x080000, 0x5118f7c0, 3 | BRF_GRA }, // 2 Sprite data - { "c-2.c2", 0x080000, 0xefe9b33e, 3 | BRF_GRA }, // 3 - - { "m-1.m1", 0x010000, 0x9b92b7d1, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code -}; - -STDROMPICKEXT(vliner, vliner, neogeo) -STD_ROM_FN(vliner) - -struct BurnDriver BurnDrvvliner = { - "vliner", NULL, "neogeo", NULL, "2001", - "V-Liner (set 1)\0", NULL, "Dyna / BreezaSoft", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_GAMBLING, GBF_CASINO, 0, - NULL, vlinerRomInfo, vlinerRomName, NULL, NULL, vlinerInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// V-Liner (set 2) -/* MVS ONLY RELEASE */ - -static struct BurnRomInfo vlineroRomDesc[] = { - /* Officially licensed? Cart has a holographic 'SNK' sticker applied */ - { "epr_54.p1", 0x080000, 0x172efc18, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - /* P on eprom, correct chip label unknown */ - - { "s-1.s1", 0x020000, 0x972d8c31, 2 | BRF_GRA }, // 1 Text layer tiles - - { "c-1.c1", 0x080000, 0x5118f7c0, 3 | BRF_GRA }, // 2 Sprite data - { "c-2.c2", 0x080000, 0xefe9b33e, 3 | BRF_GRA }, // 3 - - { "m-1.m1", 0x010000, 0x9b92b7d1, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code -}; - -STDROMPICKEXT(vlinero, vlinero, neogeo) -STD_ROM_FN(vlinero) - -struct BurnDriver BurnDrvvlinero = { - "vlinero", "vliner", "neogeo", NULL, "2001", - "V-Liner (set 2)\0", NULL, "Dyna / BreezaSoft", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_GAMBLING, GBF_CASINO, 0, - NULL, vlineroRomInfo, vlineroRomName, NULL, NULL, vlinerInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Digger Man - -static struct BurnRomInfo diggermaRomDesc[] = { - { "dig-p1.bin", 0x080000, 0xeda433d7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "dig-s1.bin", 0x020000, 0x9b3168f0, 2 | BRF_GRA }, // 1 Text layer tiles - - { "dig-c1.bin", 0x080000, 0x3db0a4ed, 3 | BRF_GRA }, // 2 Sprite data - { "dig-c2.bin", 0x080000, 0x3e632161, 3 | BRF_GRA }, // 3 - - { "dig-m1.bin", 0x020000, 0xe777a234, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "dig-v1.bin", 0x080000, 0xee15bda4, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(diggerma, diggerma, neogeo) -STD_ROM_FN(diggerma) - -struct BurnDriver BurnDrvdiggerma = { - "diggerma", NULL, "neogeo", NULL, "2000", - "Digger Man\0", NULL, "Kyle Hodgetts", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_MAZE, 0, - NULL, diggermaRomInfo, diggermaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Super Bubble Pop -/* Unlicensed, no official game ID # */ /* MVS ONLY VERSION */ - -static struct BurnRomInfo sbpRomDesc[] = { - { "001-003-02a.u2", 0x080000, 0xd054d264, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "001-003-02b.u2", 0x080000, 0x2fd04b2a, 2 | BRF_GRA }, // 1 Text layer tiles - - { "001-003-03b.u3", 0x200000, 0x44791317, 3 | BRF_GRA }, // 2 Sprite data - { "001-003-04b.u4", 0x200000, 0xa3a1c0df, 3 | BRF_GRA }, // 3 - - { "001-003-01b.u1", 0x080000, 0x7b1f86f7, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "001-003-12a.u12", 0x400000, 0xc96723b9, 5 | BRF_SND }, // 5 Sound data - { "001-003-13a.u13", 0x400000, 0x08c339a5, 5 | BRF_SND }, // 6 -}; - -STDROMPICKEXT(sbp, sbp, neogeo) -STD_ROM_FN(sbp) - -static void sbpCallback() -{ - UINT16* ROM = (UINT16*)Neo68KROMActive; - - for (INT32 i = 0x200 / 2; i < 0x2000 / 2; i++) { - UINT16 OrigData = ROM[i]; - UINT16 Data = BITSWAP16(OrigData, 11, 10, 9, 8, 15, 14, 13, 12, 3, 2, 1, 0, 7, 6, 5, 4); - - if (i == 0xf5e) { - ROM[i] = OrigData; - } else { - ROM[i] = Data; - } - } - - // stop the game overwriting the text layer data - ROM[0x2a6f8 / 2] = 0x4e71; - ROM[0x2a6fa / 2] = 0x4e71; - ROM[0x2a6fc / 2] = 0x4e71; - - nNeoTextROMSize[nNeoActiveSlot] = 0x20000; -} - -static INT32 sbpInit() -{ - NeoCallbackActive->pInitialise = sbpCallback; - - return NeoInit(); -} - -struct BurnDriverD BurnDrvsbp = { - "sbp", NULL, "neogeo", NULL, "2004", - "Super Bubble Pop\0", NULL, "Vektorlogic", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_HOMEBREW, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, sbpRomInfo, sbpRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - sbpInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// ----------------------------------------------------------------------------- -// Games not in MAME - -// 3 Count Bout / Fire Suplex (NGM-043) -/* MVS VERSION */ - -static struct BurnRomInfo countba3RomDesc[] = { - { "043-epr.ep1", 0x080000, 0xeb2714c4, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C4002 - { "043-epr.ep2", 0x080000, 0x5e764567, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 */ - - { "043-s1.s1", 0x020000, 0xc362d484, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "043-c1.c1", 0x200000, 0xbad2d67f, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "043-c2.c2", 0x200000, 0xa7fbda95, 3 | BRF_GRA }, // 3 / TC5316200 - { "043-c3.c3", 0x200000, 0xf00be011, 3 | BRF_GRA }, // 4 / TC5316200 - { "043-c4.c4", 0x200000, 0x1887e5c0, 3 | BRF_GRA }, // 5 / TC5316200 - - { "043-m1.m1", 0x020000, 0x7eab59cb, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "043-v1.v1", 0x200000, 0x63688ce8, 5 | BRF_SND }, // 7 Sound data / TC5316200 - { "043-v2.v2", 0x200000, 0xc69a827b, 5 | BRF_SND }, // 8 / TC5316200 -}; - -STDROMPICKEXT(countba3, countba3, neogeo) -STD_ROM_FN(countba3) - -struct BurnDriver BurnDrv3Countba = { - "3countba", "3countb", "neogeo", NULL, "1993", - "3 Count Bout / Fire Suplex (NGM-043)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, 0, - NULL, countba3RomInfo, countba3RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Bang Bead (Prototype?) - -static struct BurnRomInfo bangbedpRomDesc[] = { - { "259-p1.bin", 0x200000, 0x88a37f8b, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "259-s1p.bin", 0x020000, 0xbb50fb2d, 2 | BRF_GRA }, // 1 Text layer tiles - - { "259-c1p.bin", 0x200000, 0xe3919e44, 3 | BRF_GRA }, // 2 Sprite data - { "259-c2p.bin", 0x200000, 0xbaf5a320, 3 | BRF_GRA }, // 3 - { "259-c3p.bin", 0x100000, 0xc8e52157, 3 | BRF_GRA }, // 4 - { "259-c4p.bin", 0x100000, 0x69fa8e60, 3 | BRF_GRA }, // 5 - - { "259-m1.bin", 0x020000, 0x85668ee9, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "259-v1p.bin", 0x200000, 0xe97b9385, 5 | BRF_SND }, // 7 Sound data - { "259-v2p.bin", 0x200000, 0xb0cbd70a, 5 | BRF_SND }, // 8 - { "259-v3p.bin", 0x100000, 0x97528fe9, 5 | BRF_SND }, // 9 -}; - -STDROMPICKEXT(bangbedp, bangbedp, neogeo) -STD_ROM_FN(bangbedp) - -struct BurnDriver BurnDrvbangbedp = { - "bangbedp", "bangbead", "neogeo", NULL, "2000", - "Bang Bead (Prototype?)\0", NULL, "Visco", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_BALLPADDLE, 0, - NULL, bangbedpRomInfo, bangbedpRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Double Dragon (Special 2017, hack) -// Modified by: GSC2007 -// Version number: Ver 1.0.0311 - -static struct BurnRomInfo doubledrspRomDesc[] = { - { "082-p1sp.p1", 0x100000, 0x8ea8ee3d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "082-p2sp.p2", 0x100000, 0x0e2616ab, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "082-p3sp.p3", 0x020000, 0x8b4839c4, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "082-s1.s1", 0x020000, 0xbef995c5, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "082-c1.c1", 0x200000, 0xb478c725, 3 | BRF_GRA }, // 2 Sprite data / TC5316200 - { "082-c2.c2", 0x200000, 0x2857da32, 3 | BRF_GRA }, // 3 / TC5316200 - { "082-c3.c3", 0x200000, 0x8b0d378e, 3 | BRF_GRA }, // 4 / TC5316200 - { "082-c4.c4", 0x200000, 0xc7d2f596, 3 | BRF_GRA }, // 5 / TC5316200 - { "082-c5sp.c5", 0x200000, 0xb9c799fe, 3 | BRF_GRA }, // 6 / TC5316200 - { "082-c6sp.c6", 0x200000, 0x11569bc9, 3 | BRF_GRA }, // 7 / TC5316200 - { "082-c7.c7", 0x100000, 0x727c4d02, 3 | BRF_GRA }, // 8 / TC538200 - { "082-c8.c8", 0x100000, 0x69a5fa37, 3 | BRF_GRA }, // 9 / TC538200 - - { "082-m1.m1", 0x020000, 0x10b144de, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code / TC531001 - - { "082-v1.v1", 0x200000, 0xcc1128e4, 5 | BRF_SND }, // 11 Sound data / TC5316200 - { "082-v2.v2", 0x200000, 0xc3ff5554, 5 | BRF_SND }, // 12 / TC5316200 -}; - -STDROMPICKEXT(doubledrsp, doubledrsp, neogeo) -STD_ROM_FN(doubledrsp) - -static UINT8 *doubledrspExtraROM; - -static INT32 DoubledrspInit() -{ - INT32 nRet = NeoInit(); - - if (nRet == 0) { - doubledrspExtraROM = (UINT8*)BurnMalloc(0x20000); - - if (BurnLoadRom(doubledrspExtraROM, 2, 1)) return 1; - - UINT16 *rom = (UINT16*)doubledrspExtraROM; - for (INT32 i = 0; i < 0x20000/2; i++) { - if (rom[i] == 0x4e7d) rom[i] = 0x4e71; - if (rom[i] == 0x4e7c) rom[i] = 0x4e75; - } - - rom = (UINT16*)Neo68KROMActive; - - for (INT32 i = 0; i < 0x100000/2; i++) { - if (rom[i] == 0x4e7d) rom[i] = 0x4e71; - if (rom[i] == 0x4e7c) rom[i] = 0x4e75; - } - - rom[0xbff2] = 0x2b7c; // 4ef9 - rom[0xbff3] = 0x0001; // 0091 - rom[0xbff4] = 0x7fee; // 0206 - rom[0xbff5] = 0xa26a; // 4e7d - - SekOpen(0); - SekMapMemory(doubledrspExtraROM, 0x900000, 0x91ffff, MAP_ROM); - SekClose(); - } - - return nRet; -} - -static INT32 DoubledrspExit() -{ - BurnFree (doubledrspExtraROM); - - return NeoExit(); -} - -struct BurnDriverD BurnDrvdoubledrsp = { - "doubledrsp", "doubledr", "neogeo", NULL, "2017", - "Double Dragon (Special 2017, hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, doubledrspRomInfo, doubledrspRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - DoubledrspInit, DoubledrspExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai (NGM-047) -/* MVS VERSION */ - -static struct BurnRomInfo fatfury2aRomDesc[] = { - { "047-epr.ep1", 0x080000, 0xbe40ea92, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C4002 - { "047-epr.ep2", 0x080000, 0x2a9beac5, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 */ - - { "047-s1.s1", 0x020000, 0xd7dbbf39, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "047-c1.c1", 0x200000, 0xf72a939e, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "047-c2.c2", 0x200000, 0x05119a0d, 3 | BRF_GRA }, // 4 / TC5316200 - { "047-c3.c3", 0x200000, 0x01e00738, 3 | BRF_GRA }, // 5 / TC5316200 - { "047-c4.c4", 0x200000, 0x9fe27432, 3 | BRF_GRA }, // 6 / TC5316200 - - { "047-m1.m1", 0x020000, 0x820b0ba7, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code / TC531001 - - { "047-v1.v1", 0x200000, 0xd9d00784, 5 | BRF_SND }, // 8 Sound data / TC5316200 - { "047-v2.v2", 0x200000, 0x2c9a4b33, 5 | BRF_SND }, // 9 / TC5316200 -}; - -STDROMPICKEXT(fatfury2a, fatfury2a, neogeo) -STD_ROM_FN(fatfury2a) - -struct BurnDriver BurnDrvFatfury2a = { - "fatfury2a", "fatfury2", "neogeo", NULL, "1992", - "Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai (NGM-047)\0", NULL, "SNK", "Neo Geo MVS", - L"Fatal Fury 2\0\u9913\u72FC\u4F1D\u8AAC\uFF12 - \u65B0\u305F\u306A\u308B\u95D8 (NGM-047)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC, GBF_VSFIGHT, FBF_FATFURY, - NULL, fatfury2aRomInfo, fatfury2aRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - fatfury2Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai (NGM-069)(NGH-069) (alternate set) -/* MVS AND AES VERSION (95-05-17 16:08) */ - -static struct BurnRomInfo fatfury3aRomDesc[] = { - { "069-p1.bin", 0x100000, 0x4e27bd16, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC538200 - { "069-sp2.sp2", 0x200000, 0xdbe963ed, 1 | BRF_ESS | BRF_PRG }, // 1 / TC5316200 - - { "069-s1.s1", 0x020000, 0x0b33a800, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "069-c1.c1", 0x400000, 0xe302f93c, 3 | BRF_GRA }, // 3 Sprite data / TC5332205 - { "069-c2.c2", 0x400000, 0x1053a455, 3 | BRF_GRA }, // 4 / TC5332205 - { "069-c3.c3", 0x400000, 0x1c0fde2f, 3 | BRF_GRA }, // 5 / TC5332205 - { "069-c4.c4", 0x400000, 0xa25fc3d0, 3 | BRF_GRA }, // 6 / TC5332205 - { "069-c5.c5", 0x200000, 0xb3ec6fa6, 3 | BRF_GRA }, // 7 / TC5332205 - { "069-c6.c6", 0x200000, 0x69210441, 3 | BRF_GRA }, // 8 / TC5332205 - - { "069-m1.m1", 0x020000, 0xfce72926, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code / TC531001 - - { "069-v1.v1", 0x400000, 0x2bdbd4db, 5 | BRF_SND }, // 10 Sound data / TC5332204 - { "069-v2.v2", 0x400000, 0xa698a487, 5 | BRF_SND }, // 11 / TC5332204 - { "069-v3.v3", 0x200000, 0x581c5304, 5 | BRF_SND }, // 12 / TC5316200 -}; - -STDROMPICKEXT(fatfury3a, fatfury3a, neogeo) -STD_ROM_FN(fatfury3a) - -struct BurnDriver BurnDrvFatfury3a = { - "fatfury3a", "fatfury3", "neogeo", NULL, "1995", - "Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai (NGM-069)(NGH-069) (alternate set)\0", NULL, "SNK", "Neo Geo MVS", - L"Fatal Fury 3 - Road to the Final Victory\0\u9913\u72FC\u4F1D\u8AAC\uFF13 (NGM-069)(NGH-069) (alternate set)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_FATFURY, - NULL, fatfury3aRomInfo, fatfury3aRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Crossed Swords 2 (bootleg CD to cartridge conversion) - -static struct BurnRomInfo crswd2blRomDesc[] = { - { "054-p1.p1", 0x200000, 0x64836147, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "054-s1.s1", 0x020000, 0x22e02ddd, 2 | BRF_GRA }, // 1 Text layer tiles - - { "054-c1.c1", 0x400000, 0x8221b712, 3 | BRF_GRA }, // 2 Sprite data - { "054-c2.c2", 0x400000, 0xd6c6183d, 3 | BRF_GRA }, // 3 - - { "054-m1.m1", 0x020000, 0x63e28343, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "054-v1.v1", 0x200000, 0x22d4b93b, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(crswd2bl, crswd2bl, neogeo) -STD_ROM_FN(crswd2bl) - -struct BurnDriver BurnDrvcrswd2bl = { - "crswd2bl", NULL, "neogeo", NULL, "1991", - "Crossed Swords 2 (bootleg CD to cartridge conversion)\0", NULL, "bootleg (Razoola)", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_MISC, 0, - NULL, crswd2blRomInfo, crswd2blRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Crouching Tiger Hidden Dragon 2003 (The King of Fighters 2001 bootleg set 2) - -static struct BurnRomInfo cthd2k3aRomDesc[] = { - { "5003-p1a.bin", 0x100000, 0x1185fe39, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "5003-p2a.bin", 0x400000, 0xea71faf7, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5003-s1a.bin", 0x020000, 0x174ccffd, 2 | BRF_GRA }, // 2 Text layer tiles - - { "5003-c1a.bin", 0x800000, 0xdc90c563, 3 | BRF_GRA }, // 3 Sprite data - { "5003-c2a.bin", 0x800000, 0x7b08d331, 3 | BRF_GRA }, // 4 - { "5003-c3.bin", 0x800000, 0xac4aff71, 3 | BRF_GRA }, // 5 - { "5003-c4.bin", 0x800000, 0xafef5d66, 3 | BRF_GRA }, // 6 - { "5003-c5.bin", 0x800000, 0xc7c1ae50, 3 | BRF_GRA }, // 7 - { "5003-c6.bin", 0x800000, 0x613197f9, 3 | BRF_GRA }, // 8 - { "5003-c7a.bin", 0x800000, 0xad2d72b3, 3 | BRF_GRA }, // 9 - { "5003-c8a.bin", 0x800000, 0x8c3fc1b5, 3 | BRF_GRA }, // 10 - - { "5003-m1a.bin", 0x020000, 0xa37cc447, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "262-v1-08-e0.bin", 0x400000, 0x83d49ecf, 5 | BRF_SND }, // 12 Sound data - { "5003-v2a.bin", 0x400000, 0x2b498449, 5 | BRF_SND }, // 13 - { "262-v3-08-e0.bin", 0x400000, 0x2ae38dbe, 5 | BRF_SND }, // 14 - { "262-v4-08-e0.bin", 0x400000, 0x26ec4dd9, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(cthd2k3a, cthd2k3a, neogeo) -STD_ROM_FN(cthd2k3a) - -static void cthd2k3aCallback() -{ - INT32 i, n; - - // P-ROM Encryption - UINT8 nBank[] = { 0x06, 0x02, 0x04, 0x05, 0x01, 0x03, 0x00, 0x07, 0x27, 0x0E, 0x1C, 0x15, 0x1B, 0x17, 0x0A, 0x0F, 0x16, 0x14, 0x23, 0x0B, 0x22, 0x26, 0x08, 0x24, 0x21, 0x13, 0x1A, 0x0C, 0x19, 0x1D, 0x25, 0x10, 0x09, 0x20, 0x18, 0x1F, 0x1E, 0x12, 0x0D, 0x11 }; - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x500000); - if (pTemp) { - for (i = 0; i < 0x500000 / 0x20000; i++) { - memmove(pTemp + (i * 0x20000), Neo68KROMActive + (nBank[i] * 0x20000), 0x20000); - } - memmove(Neo68KROMActive, pTemp, 0x500000); - BurnFree(pTemp); - } - - UINT16 *Rom = (UINT16*)Neo68KROMActive; - Rom[0xed00e / 2] = BURN_ENDIAN_SWAP_INT16(0x4e71); - Rom[0xed394 / 2] = BURN_ENDIAN_SWAP_INT16(0x4e71); - Rom[0xa2b7e / 2] = BURN_ENDIAN_SWAP_INT16(0x4e71); - - // Text ROM - for (i = 0; i < 0x8000; i++) { - n = NeoTextROM[nNeoActiveSlot][0x08000 + i]; - NeoTextROM[nNeoActiveSlot][0x08000 + i] = NeoTextROM[nNeoActiveSlot][0x10000 + i]; - NeoTextROM[nNeoActiveSlot][0x10000 + i] = n; - } - - // Swap bits 15 & 16 in the address of the Z80 ROM - for (i = 0; i < 0x10000 / 2; i++) { - n = NeoZ80ROMActive[0x08000 + i]; - NeoZ80ROMActive[0x08000 + i] = NeoZ80ROMActive[0x10000 + i]; - NeoZ80ROMActive[0x10000 + i] = n; - } - - DoPerm(0); -} - -static INT32 cthd2k3aInit() -{ - NeoCallbackActive->pInitialise = cthd2k3aCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvcthd2k3a = { - "cthd2k3a", "kof2001", "neogeo", NULL, "2003", - "Crouching Tiger Hidden Dragon 2003 (set 2)\0", NULL, "bootleg", "Neo Geo MVS", - L"Crouching Tiger Hidden Dragon 2003 (set 2)\0\u81E5\u864E\u85CF\u9F8D\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, cthd2k3aRomInfo, cthd2k3aRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - cthd2k3aInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Idol Mahjong - final romance 2 (Neo CD Conversion) - -static struct BurnRomInfo froman2bRomDesc[] = { - { "098.p1", 0x080000, 0x09675541, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "098.s1", 0x020000, 0x0e6a7c73, 2 | BRF_GRA }, // 1 Text layer tiles - - { "098.c1", 0x400000, 0x29148bf7, 3 | BRF_GRA }, // 2 Sprite data - { "098.c2", 0x400000, 0x226b1263, 3 | BRF_GRA }, // 3 - - { "098.m1", 0x020000, 0xda4878cf, 4 | BRF_ESS | BRF_PRG }, // 8 Z80 code - - { "098.v1", 0x100000, 0x6f8ccddc, 5 | BRF_SND }, // 9 Sound data -}; - -STDROMPICKEXT(froman2b, froman2b, neogeo) -STD_ROM_FN(froman2b) - -struct BurnDriver BurnDrvfroman2b = { - "froman2b", NULL, "neogeo", NULL, "1995", - "Idol Mahjong - final romance 2 (Neo CD Conversion)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HACK, 2, HARDWARE_SNK_NEOGEO, GBF_MAHJONG, 0, - NULL, froman2bRomInfo, froman2bRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Treasure of the Caribbean - -static struct BurnRomInfo totcRomDesc[] = { - { "316-p1.p1", 0x100000, 0x99604539, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "316-s1.s1", 0x020000, 0x0a3fee41, 2 | BRF_GRA }, // 1 Text layer tiles - - { "316-c1.c1", 0x200000, 0xcdd6600f, 3 | BRF_GRA }, // 2 Sprite data - { "316-c1.c2", 0x200000, 0xf362c271, 3 | BRF_GRA }, // 3 - - { "316-m1.m1", 0x020000, 0x18b23ace, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "316-v1.v1", 0x200000, 0x15c7f9e6, 5 | BRF_SND }, // 7 Sound data - { "316-v2.v2", 0x200000, 0x1b264559, 5 | BRF_SND }, // 8 - { "316-v3.v3", 0x100000, 0x84b62c5d, 5 | BRF_SND }, // 9 -}; - -STDROMPICKEXT(totc, totc, neogeo) -STD_ROM_FN(totc) - -struct BurnDriver BurnDrvtotc = { - "totc", NULL, "neogeo", NULL, "2011", - "Treasure of the Caribbean\0", NULL, "FACE Corporation / N.C.I - Le Cortex", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, 0, - NULL, totcRomInfo, totcRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2000 (Playstation 2 ver. , EGHT hack) - -static struct BurnRomInfo kof2000ps2RomDesc[] = { - { "257ps2-p1.bin", 0x100000, 0x56941018, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "257ps2-p2.bin", 0x400000, 0x1669a5ad, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "257-c1_decrypted.bin", 0x800000, 0xabcdd424, 3 | BRF_GRA }, // 2 Sprite data - { "257-c2_decrypted.bin", 0x800000, 0xcda33778, 3 | BRF_GRA }, // 3 - { "257-c3_decrypted.bin", 0x800000, 0x087fb15b, 3 | BRF_GRA }, // 4 - { "257-c4_decrypted.bin", 0x800000, 0xfe9dfde4, 3 | BRF_GRA }, // 5 - { "257-c5_decrypted.bin", 0x800000, 0x03ee4bf4, 3 | BRF_GRA }, // 6 - { "257-c6_decrypted.bin", 0x800000, 0x8599cc5b, 3 | BRF_GRA }, // 7 - { "257-c7_decrypted.bin", 0x800000, 0x93c343ec, 3 | BRF_GRA }, // 8 - { "257-c8_decrypted.bin", 0x800000, 0xba92f698, 3 | BRF_GRA }, // 9 - - { "257-m1.m1", 0x040000, 0x4b749113, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "257-v1.v1", 0x400000, 0x17cde847, 5 | BRF_SND }, // 11 Sound data - { "257-v2.v2", 0x400000, 0x1afb20ff, 5 | BRF_SND }, // 12 - { "257-v3.v3", 0x400000, 0x4605036a, 5 | BRF_SND }, // 13 - { "257-v4.v4", 0x400000, 0x764bbd6b, 5 | BRF_SND }, // 14 -}; - -STDROMPICKEXT(kof2000ps2, kof2000ps2, neogeo) -STD_ROM_FN(kof2000ps2) - -struct BurnDriver BurnDrvkof2000ps2 = { - "kof2000ps2", "kof2000", "neogeo", NULL, "2000", - "The King of Fighters 2000 (Playstation 2 ver. , EGHT hack)\0", "hack only enable in AES mode", "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kof2000ps2RomInfo, kof2000ps2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2001 Plus (set 2, bootleg / hack) - -static struct BurnRomInfo kf2k1paRomDesc[] = { - { "2k1-p1a.bin", 0x100000, 0xf8a71b6f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "262-pg2.bin", 0x400000, 0x91eea062, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "2k1-s1a.bin", 0x020000, 0x50986eeb, 2 | BRF_GRA }, // 2 Text layer tiles - - { "262-c1-08-e0.bin", 0x800000, 0x99cc785a, 3 | BRF_GRA }, // 3 Sprite data - { "262-c2-08-e0.bin", 0x800000, 0x50368cbf, 3 | BRF_GRA }, // 4 - { "262-c3-08-e0.bin", 0x800000, 0xfb14ff87, 3 | BRF_GRA }, // 5 - { "262-c4-08-e0.bin", 0x800000, 0x4397faf8, 3 | BRF_GRA }, // 6 - { "262-c5-08-e0.bin", 0x800000, 0x91f24be4, 3 | BRF_GRA }, // 7 - { "262-c6-08-e0.bin", 0x800000, 0xa31e4403, 3 | BRF_GRA }, // 8 - { "262-c7-08-e0.bin", 0x800000, 0x54d9d1ec, 3 | BRF_GRA }, // 9 - { "262-c8-08-e0.bin", 0x800000, 0x59289a6b, 3 | BRF_GRA }, // 10 - - { "265-262-m1.bin", 0x040000, 0xa7f8119f, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "262-v1-08-e0.bin", 0x400000, 0x83d49ecf, 5 | BRF_SND }, // 12 Sound data - { "262-v2-08-e0.bin", 0x400000, 0x003f1843, 5 | BRF_SND }, // 13 - { "262-v3-08-e0.bin", 0x400000, 0x2ae38dbe, 5 | BRF_SND }, // 14 - { "262-v4-08-e0.bin", 0x400000, 0x26ec4dd9, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kf2k1pa, kf2k1pa, neogeo) -STD_ROM_FN(kf2k1pa) - -static void kf2k1paCallback() -{ - for (INT32 i = 0; i < 0x20000; i++) { - NeoTextROM[nNeoActiveSlot][i] = BITSWAP08(NeoTextROM[nNeoActiveSlot][i], 3, 2, 4, 5, 1, 6, 0, 7); - } -} - -static INT32 kf2k1paInit() -{ - nNeoProtectionXor = 0x1e; - NeoCallbackActive->pInitialise = kf2k1paCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvkf2k1pa = { - "kf2k1pa", "kof2001", "neogeo", NULL, "2002", - "The King of Fighters 2001 Plus (set 2, bootleg / hack)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k1paRomInfo, kf2k1paRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k1paInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2001 Plus (set 1, bootleg / hack) - -static struct BurnRomInfo kf2k1plsRomDesc[] = { - { "2k1-p1p.bin", 0x100000, 0x758529a7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "262-pg2.bin", 0x400000, 0x91eea062, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "2k1-s1p.bin", 0x020000, 0x088657e6, 2 | BRF_GRA }, // 2 Text layer tiles - - { "262-c1-08-e0.bin", 0x800000, 0x99cc785a, 3 | BRF_GRA }, // 3 Sprite data - { "262-c2-08-e0.bin", 0x800000, 0x50368cbf, 3 | BRF_GRA }, // 4 - { "262-c3-08-e0.bin", 0x800000, 0xfb14ff87, 3 | BRF_GRA }, // 5 - { "262-c4-08-e0.bin", 0x800000, 0x4397faf8, 3 | BRF_GRA }, // 6 - { "262-c5-08-e0.bin", 0x800000, 0x91f24be4, 3 | BRF_GRA }, // 7 - { "262-c6-08-e0.bin", 0x800000, 0xa31e4403, 3 | BRF_GRA }, // 8 - { "262-c7-08-e0.bin", 0x800000, 0x54d9d1ec, 3 | BRF_GRA }, // 9 - { "262-c8-08-e0.bin", 0x800000, 0x59289a6b, 3 | BRF_GRA }, // 10 - - { "265-262-m1.bin", 0x040000, 0xa7f8119f, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "262-v1-08-e0.bin", 0x400000, 0x83d49ecf, 5 | BRF_SND }, // 12 Sound data - { "262-v2-08-e0.bin", 0x400000, 0x003f1843, 5 | BRF_SND }, // 13 - { "262-v3-08-e0.bin", 0x400000, 0x2ae38dbe, 5 | BRF_SND }, // 14 - { "262-v4-08-e0.bin", 0x400000, 0x26ec4dd9, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kf2k1pls, kf2k1pls, neogeo) -STD_ROM_FN(kf2k1pls) - -static INT32 kf2k1plsInit() -{ - nNeoProtectionXor = 0x1e; - - return NeoInit(); -} - -struct BurnDriver BurnDrvkf2k1pls = { - "kf2k1pls", "kof2001", "neogeo", NULL, "2002", - "The King of Fighters 2001 Plus (set 1, bootleg / hack)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k1plsRomInfo, kf2k1plsRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k1plsInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2002 Plus (bootleg set 3) - -static struct BurnRomInfo kf2k2plbRomDesc[] = { - { "2k2-p1p.bin", 0x100000, 0x3ab03781, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "265-p2.bin", 0x400000, 0x327266b8, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "2k2-s1pb.bin", 0x020000, 0x2072d5e9, 2 | BRF_GRA }, // 2 Text layer tiles - - { "265-c1.bin", 0x800000, 0x2b65a656, 3 | BRF_GRA }, // 3 Sprite data - { "265-c2.bin", 0x800000, 0xadf18983, 3 | BRF_GRA }, // 4 - { "265-c3.bin", 0x800000, 0x875e9fd7, 3 | BRF_GRA }, // 5 - { "265-c4.bin", 0x800000, 0x2da13947, 3 | BRF_GRA }, // 6 - { "265-c5.bin", 0x800000, 0x61bd165d, 3 | BRF_GRA }, // 7 - { "265-c6.bin", 0x800000, 0x03fdd1eb, 3 | BRF_GRA }, // 8 - { "265-c7.bin", 0x800000, 0x1a2749d8, 3 | BRF_GRA }, // 9 - { "265-c8.bin", 0x800000, 0xab0bb549, 3 | BRF_GRA }, // 10 - - { "265-m1.bin", 0x020000, 0x85aaa632, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "265-v1.bin", 0x800000, 0x15e8f3f5, 5 | BRF_SND }, // 12 Sound data - { "265-v2.bin", 0x800000, 0xda41d6f9, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k2plb, kf2k2plb, neogeo) -STD_ROM_FN(kf2k2plb) - -struct BurnDriver BurnDrvkf2k2plb = { - "kf2k2plb", "kof2002", "neogeo", NULL, "2002", - "The King of Fighters 2002 Plus (bootleg set 3)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k2plbRomInfo, kf2k2plbRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof2002Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2002 Super (bootleg) - -static struct BurnRomInfo kf2k2plcRomDesc[] = { - { "2k2-p1pc.bin", 0x100000, 0xebedae17, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "265-p2.bin", 0x400000, 0x327266b8, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "2k2-s1pc.bin", 0x020000, 0xfecbb589, 2 | BRF_GRA }, // 2 Text layer tiles - - { "265-c1.bin", 0x800000, 0x2b65a656, 3 | BRF_GRA }, // 3 Sprite data - { "265-c2.bin", 0x800000, 0xadf18983, 3 | BRF_GRA }, // 4 - { "265-c3.bin", 0x800000, 0x875e9fd7, 3 | BRF_GRA }, // 5 - { "265-c4.bin", 0x800000, 0x2da13947, 3 | BRF_GRA }, // 6 - { "265-c5.bin", 0x800000, 0x61bd165d, 3 | BRF_GRA }, // 7 - { "265-c6.bin", 0x800000, 0x03fdd1eb, 3 | BRF_GRA }, // 8 - { "265-c7.bin", 0x800000, 0x1a2749d8, 3 | BRF_GRA }, // 9 - { "265-c8.bin", 0x800000, 0xab0bb549, 3 | BRF_GRA }, // 10 - - { "265-m1.bin", 0x020000, 0x85aaa632, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "265-v1.bin", 0x800000, 0x15e8f3f5, 5 | BRF_SND }, // 12 Sound data - { "265-v2.bin", 0x800000, 0xda41d6f9, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k2plc, kf2k2plc, neogeo) -STD_ROM_FN(kf2k2plc) - -static void kf2k2plcCallback() -{ - PCM2DecryptP(); - - garoubl_sx_decode(); -} - -static INT32 kf2k2plcInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0xEC; - NeoCallbackActive->pInitialise = kf2k2plcCallback; - - nRet = NeoInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0xa5000, 0x000000, { 0xf9, 0xe0, 0x5d, 0xf3, 0xea, 0x92, 0xbe, 0xef } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkf2k2plc = { - "kf2k2plc", "kof2002", "neogeo", NULL, "2002", - "The King of Fighters 2002 Super (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k2plcRomInfo, kf2k2plcRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k2plcInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters 2002 (PlayStation 2 ver 0.4, EGHT hack) - -static struct BurnRomInfo kf2k2ps2RomDesc[] = { - { "265ps2-p1.bin", 0x100000, 0x336c4ca8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "265ps2-p2.bin", 0x500000, 0xcb0032bf, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "265ps2-s1.bin", 0x020000, 0x714ade47, 2 | BRF_GRA }, // 2 Text layer tiles - - { "265-c1_decrypted.bin", 0x800000, 0x7efa6ef7, 3 | BRF_GRA }, // 3 Sprite data - { "265-c2_decrypted.bin", 0x800000, 0xaa82948b, 3 | BRF_GRA }, // 4 - { "265-c3_decrypted.bin", 0x800000, 0x959fad0b, 3 | BRF_GRA }, // 5 - { "265-c4_decrypted.bin", 0x800000, 0xefe6a468, 3 | BRF_GRA }, // 6 - { "265-c5_decrypted.bin", 0x800000, 0x74bba7c6, 3 | BRF_GRA }, // 7 - { "265-c6_decrypted.bin", 0x800000, 0xe20d2216, 3 | BRF_GRA }, // 8 - { "265ps2-c7.bin", 0x800000, 0x1b1d35fb, 3 | BRF_GRA }, // 9 - { "265ps2-c8.bin", 0x800000, 0xa5e35d11, 3 | BRF_GRA }, // 10 - { "265ps2-c9.bin", 0x800000, 0xaa8bbc97, 3 | BRF_GRA }, // 11 - { "265ps2-c10.bin", 0x800000, 0x9832713d, 3 | BRF_GRA }, // 12 - - { "265-m1.bin", 0x020000, 0x85aaa632, 4 | BRF_ESS | BRF_PRG }, // 13 Z80 code - - { "265-v1.bin", 0x800000, 0x15e8f3f5, 5 | BRF_SND }, // 14 Sound data - { "265-v2.bin", 0x800000, 0xda41d6f9, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(kf2k2ps2, kf2k2ps2, neogeo) -STD_ROM_FN(kf2k2ps2) - -static INT32 kf2k2ps2Init() -{ - INT32 nRet; - - nRet = NeoInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0xa5000, 0x000000, { 0xf9, 0xe0, 0x5d, 0xf3, 0xea, 0x92, 0xbe, 0xef } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvkf2k2ps2 = { - "kf2k2ps2", "kof2002", "neogeo", NULL, "2007", - "The King of Fighters 2002 (PlayStation 2 ver 0.4, EGHT hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_M1, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k2ps2RomInfo, kf2k2ps2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k2ps2Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters Special Edition 2004 Plus (bootleg) - -static struct BurnRomInfo kf2k4plsRomDesc[] = { - { "k2k4s-p1p.bin", 0x200000, 0xed97c684, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "k2k4s-p1.bin", 0x400000, 0xe6c50566, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "k2k4s-s1p.bin", 0x020000, 0xcc0ab564, 2 | BRF_GRA }, // 2 Text layer tiles - - { "k2k4s-c4.bin", 0x800000, 0x7a050288, 3 | BRF_GRA }, // 3 Sprite data - { "k2k4s-c8.bin", 0x800000, 0xe924afcf, 3 | BRF_GRA }, // 4 - { "k2k4s-c3.bin", 0x800000, 0x959fad0b, 3 | BRF_GRA }, // 5 - { "k2k4s-c7.bin", 0x800000, 0xefe6a468, 3 | BRF_GRA }, // 6 - { "k2k4s-c2.bin", 0x800000, 0x74bba7c6, 3 | BRF_GRA }, // 7 - { "k2k4s-c6.bin", 0x800000, 0xe20d2216, 3 | BRF_GRA }, // 8 - { "k2k4s-c1.bin", 0x800000, 0xfa705b2b, 3 | BRF_GRA }, // 9 - { "k2k4s-c5.bin", 0x800000, 0x2c912ff9, 3 | BRF_GRA }, // 10 - - { "k2k4s-m1.bin", 0x020000, 0x5a47d9ad, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "k2k4s-v2.bin", 0x800000, 0xe4ddfb3f, 5 | BRF_SND }, // 12 Sound data - { "k2k4s-v1.bin", 0x800000, 0xb887d287, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kf2k4pls, kf2k4pls, neogeo) -STD_ROM_FN(kf2k4pls) - -static void kf2k4plsCallback() -{ - UINT8 *pTemp = (UINT8*)BurnMalloc(0x600000); - - if (pTemp) { - memmove(pTemp, Neo68KROMActive, 0x600000); - memmove(Neo68KROMActive + 0x000000, pTemp + 0x000000, 0x100000); - memmove(Neo68KROMActive + 0x500000, pTemp + 0x100000, 0x100000); - memmove(Neo68KROMActive + 0x400000, pTemp + 0x200000, 0x100000); - memmove(Neo68KROMActive + 0x300000, pTemp + 0x300000, 0x100000); - memmove(Neo68KROMActive + 0x200000, pTemp + 0x400000, 0x100000); - memmove(Neo68KROMActive + 0x100000, pTemp + 0x500000, 0x100000); - - memset(pTemp, 0, 0x600000); - memmove(pTemp + 0x000000, Neo68KROMActive + 0x000000, 0x100000); - memmove(pTemp + 0x100000, Neo68KROMActive + 0x500000, 0x100000); - memmove(Neo68KROMActive + 0x000000, pTemp + 0x1a0000, 0x020000); - memmove(Neo68KROMActive + 0x020000, pTemp + 0x080000, 0x020000); - memmove(Neo68KROMActive + 0x040000, pTemp + 0x140000, 0x020000); - memmove(Neo68KROMActive + 0x060000, pTemp + 0x000000, 0x020000); - memmove(Neo68KROMActive + 0x080000, pTemp + 0x180000, 0x020000); - memmove(Neo68KROMActive + 0x0a0000, pTemp + 0x0a0000, 0x020000); - memmove(Neo68KROMActive + 0x0c0000, pTemp + 0x100000, 0x020000); - memmove(Neo68KROMActive + 0x0e0000, pTemp + 0x040000, 0x020000); - - BurnFree(pTemp); - } - - lans2004_sx_decode(); -} - -static INT32 kf2k4plsInit() -{ - NeoCallbackActive->pInitialise = kf2k4plsCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvkf2k4pls = { - "kf2k4pls", "kof2002", "neogeo", NULL, "2004", - "The King of Fighters Special Edition 2004 Plus (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kf2k4plsRomInfo, kf2k4plsRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kf2k4plsInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '95 (Special 2017) -// Modified by: GSC2007 -// Version number: Ver 1.0.0613 - -static struct BurnRomInfo kof95spRomDesc[] = { - { "084-p1sp.p1", 0x100000, 0x1dea5b42, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "084-p2sp.p2", 0x100000, 0x5cb1af9e, 1 | BRF_ESS | BRF_PRG }, // 1 - { "084-p3sp.p3", 0x020000, 0x46db6f4a, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "084-s1sp.s1", 0x020000, 0x83cbae60, 2 | BRF_GRA }, // 3 Text layer tiles / TC531000 - - { "084-c1.c1", 0x400000, 0xfe087e32, 3 | BRF_GRA }, // 4 Sprite data / TC5332202 - { "084-c2.c2", 0x400000, 0x07864e09, 3 | BRF_GRA }, // 5 / TC5332202 - { "084-c3.c3", 0x400000, 0xa4e65d1b, 3 | BRF_GRA }, // 6 / TC5332202 - { "084-c4.c4", 0x400000, 0xc1ace468, 3 | BRF_GRA }, // 7 / TC5332202 - { "084-c5.c5", 0x200000, 0x8a2c1edc, 3 | BRF_GRA }, // 8 / TC5316200 - { "084-c6.c6", 0x200000, 0xf593ac35, 3 | BRF_GRA }, // 9 / TC5316200 - { "084-c7.c7", 0x100000, 0x9904025f, 3 | BRF_GRA }, // 10 / TC538200 - { "084-c8.c8", 0x100000, 0x78eb0f9b, 3 | BRF_GRA }, // 11 / TC538200 - - { "084-m1.m1", 0x020000, 0x6f2d7429, 4 | BRF_ESS | BRF_PRG }, // 12 Z80 code / TC531001 - - { "084-v1.v1", 0x400000, 0x84861b56, 5 | BRF_SND }, // 13 Sound data / TC5332201 - { "084-v2.v2", 0x200000, 0xb38a2803, 5 | BRF_SND }, // 14 / TC5316200 - { "084-v3.v3", 0x100000, 0xd683a338, 5 | BRF_SND }, // 15 / TC538200 -}; - -STDROMPICKEXT(kof95sp, kof95sp, neogeo) -STD_ROM_FN(kof95sp) - -static UINT8 *kof95spExtraROM; - -static INT32 Kof95spInit() -{ - INT32 nRet = NeoInit(); - - if (nRet == 0) { - kof95spExtraROM = (UINT8*)BurnMalloc(0x20000); - - if (BurnLoadRom(kof95spExtraROM, 2, 1)) return 1; - - UINT16 *rom = (UINT16*)kof95spExtraROM; - for (INT32 i = 0; i < 0x20000/2; i++) { - if (rom[i] == 0x4e7d) rom[i] = 0x4e71; - if (rom[i] == 0x4e7c) rom[i] = 0x4e75; - } - - rom = (UINT16*)Neo68KROMActive; - - for (INT32 i = 0; i < 0x100000/2; i++) { - if (rom[i] == 0x4e7d) rom[i] = 0x4e71; - if (rom[i] == 0x4e7c) rom[i] = 0x4e75; - } - - rom[0x1f3a8] = 0x2b7c; // 4ef9 - rom[0x1f3a9] = 0x0003; // 0090 - rom[0x1f3aa] = 0xe7fa; // 16be - - SekOpen(0); - SekMapMemory(kof95spExtraROM, 0x900000, 0x91ffff, MAP_ROM); - SekClose(); - } - - return nRet; -} - -static INT32 Kof95spExit() -{ - BurnFree (kof95spExtraROM); - - return NeoExit(); -} - -struct BurnDriver BurnDrvKof95sp = { - "kof95sp", "kof95", "neogeo", NULL, "2017", - "The King of Fighters '95 (Special 2017, hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof95spRomInfo, kof95spRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - Kof95spInit, Kof95spExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '96 (NGM-214, alternate board) -/* MVS VERSION */ - -static struct BurnRomInfo kof96aRomDesc[] = { - /* This set uses NEO-MVS PROGSS3 board; same rom data as in kof96h is used */ - { "214-epr.ep1", 0x080000, 0xa6101486, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / 27C240 / 27C4096 - { "214-epr.ep2", 0x080000, 0x6abc7ae5, 1 | BRF_ESS | BRF_PRG }, // 1 / 27C4096 / 27C4096 - { "214-epr.ep3", 0x080000, 0xa588dff4, 1 | BRF_ESS | BRF_PRG }, // 2 / 27C240 / 27C4096 - { "214-epr.ep4", 0x080000, 0x6d6f17eb, 1 | BRF_ESS | BRF_PRG }, // 3 / 27C240 / 27C4096 - { "214-p5.p5", 0x200000, 0xbf81a853, 1 | BRF_ESS | BRF_PRG }, // 4 / TC5316200CP */ - - { "214-s1.s1", 0x020000, 0x1254cbdb, 2 | BRF_GRA }, // 5 Text layer tiles / TC531000 - - { "214-c1.c1", 0x400000, 0x7ecf4aa2, 3 | BRF_GRA }, // 6 Sprite data / TC5332205 - { "214-c2.c2", 0x400000, 0x05b54f37, 3 | BRF_GRA }, // 7 / TC5332205 - { "214-c3.c3", 0x400000, 0x64989a65, 3 | BRF_GRA }, // 8 / TC5332205 - { "214-c4.c4", 0x400000, 0xafbea515, 3 | BRF_GRA }, // 9 / TC5332205 - { "214-c5.c5", 0x400000, 0x2a3bbd26, 3 | BRF_GRA }, // 10 / TC5332205 - { "214-c6.c6", 0x400000, 0x44d30dc7, 3 | BRF_GRA }, // 11 / TC5332205 - { "214-c7.c7", 0x400000, 0x3687331b, 3 | BRF_GRA }, // 12 / TC5332205 - { "214-c8.c8", 0x400000, 0xfa1461ad, 3 | BRF_GRA }, // 13 / TC5332205 - - { "214-m1.m1", 0x020000, 0xdabc427c, 4 | BRF_ESS | BRF_PRG }, // 14 Z80 code / TC531001 - - { "214-v1.v1", 0x400000, 0x63f7b045, 5 | BRF_SND }, // 15 Sound data / TC5332204 - { "214-v2.v2", 0x400000, 0x25929059, 5 | BRF_SND }, // 16 / TC5332204 - { "214-v3.v3", 0x200000, 0x92a2257d, 5 | BRF_SND }, // 17 / TC5316200 -}; - -STDROMPICKEXT(kof96a, kof96a, neogeo) -STD_ROM_FN(kof96a) - -struct BurnDriver BurnDrvKof96a = { - "kof96a", "kof96", "neogeo", NULL, "1996", - "The King of Fighters '96 (NGM-214, alternate board)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof96aRomInfo, kof96aRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '96 (Anniversary Edition, EGHT hack) - -static struct BurnRomInfo kof96aeRomDesc[] = { - { "214ae-p1.bin", 0x100000, 0x47660e7c, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "214ae-p2.bin", 0x400000, 0x824ff3eb, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "214ae-s1.bin", 0x020000, 0x203b3aaf, 2 | BRF_GRA }, // 2 Text layer tiles - - { "214ae-c1.bin", 0x400000, 0xb308c1f9, 3 | BRF_GRA }, // 3 Sprite data - { "214ae-c2.bin", 0x400000, 0x220a92b2, 3 | BRF_GRA }, // 4 - { "214-c3.bin", 0x400000, 0x64989a65, 3 | BRF_GRA }, // 5 - { "214-c4.bin", 0x400000, 0xafbea515, 3 | BRF_GRA }, // 6 - { "214ae-c5.bin", 0x400000, 0x6e03cb0c, 3 | BRF_GRA }, // 7 - { "214ae-c6.bin", 0x400000, 0xa90bc55d, 3 | BRF_GRA }, // 8 - { "214ae-c7.bin", 0x400000, 0x08021fd6, 3 | BRF_GRA }, // 9 - { "214ae-c8.bin", 0x400000, 0xbbd21b08, 3 | BRF_GRA }, // 10 - { "214ae-c9.bin", 0x400000, 0x57e5bf80, 3 | BRF_GRA }, // 11 - { "214ae-c10.bin",0x400000, 0xcbe44c81, 3 | BRF_GRA }, // 12 - { "214ae-c11.bin",0x400000, 0x5c7ddc8b, 3 | BRF_GRA }, // 13 - { "214ae-c12.bin",0x400000, 0x48d8b574, 3 | BRF_GRA }, // 14 - - { "214ae-m1.bin", 0x020000, 0xc9dd0348, 4 | BRF_ESS | BRF_PRG }, // 15 Z80 code - - { "214-v1.bin", 0x400000, 0x63f7b045, 5 | BRF_SND }, // 16 Sound data - { "214-v2.bin", 0x400000, 0x25929059, 5 | BRF_SND }, // 17 - { "214ae-v3.bin", 0x400000, 0x143923a7, 5 | BRF_SND }, // 18 -}; - -STDROMPICKEXT(kof96ae, kof96ae, neogeo) -STD_ROM_FN(kof96ae) - -struct BurnDriver BurnDrvkof96ae = { - "kof96ae", "kof96", "neogeo", NULL, "2007", - "The King of Fighters '96 (Anniversary Edition, EGHT hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof96aeRomInfo, kof96aeRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '96 (Anniversary Edition 2.0.0430, EGHT hack) - -static struct BurnRomInfo kof96ae20RomDesc[] = { - { "214ae-p1.p1", 0x100000, 0xc038e932, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "214ae-p2.p2", 0x400000, 0x66da868f, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "214ae-s1.s1", 0x020000, 0x0f902790, 2 | BRF_GRA }, // 2 Text layer tiles - - { "214ae-c1.c1", 0x400000, 0xb308c1f9, 3 | BRF_GRA }, // 3 Sprite data - { "214ae-c2.c2", 0x400000, 0x220a92b2, 3 | BRF_GRA }, // 4 - { "214-c3.bin", 0x400000, 0x64989a65, 3 | BRF_GRA }, // 5 - { "214-c4.bin", 0x400000, 0xafbea515, 3 | BRF_GRA }, // 6 - { "214ae-c5.c5", 0x400000, 0x41dbd677, 3 | BRF_GRA }, // 7 - { "214ae-c6.c6", 0x400000, 0x1e6a3961, 3 | BRF_GRA }, // 8 - { "214ae-c7.c7", 0x400000, 0x08021fd6, 3 | BRF_GRA }, // 9 - { "214ae-c8.c8", 0x400000, 0xbbd21b08, 3 | BRF_GRA }, // 10 - { "214ae-c9.c9", 0x400000, 0x2efceab8, 3 | BRF_GRA }, // 11 - { "214ae-c10.c10",0x400000, 0x9f7e1492, 3 | BRF_GRA }, // 12 - { "214ae-c11.c11",0x400000, 0x183cd8fd, 3 | BRF_GRA }, // 13 - { "214ae-c12.c12",0x400000, 0xb3d30499, 3 | BRF_GRA }, // 14 - - { "214ae-m1.m1", 0x020000, 0xc9dd0348, 4 | BRF_ESS | BRF_PRG }, // 15 Z80 code - - { "214-v1.bin", 0x400000, 0x63f7b045, 5 | BRF_SND }, // 16 Sound data - { "214-v2.bin", 0x400000, 0x25929059, 5 | BRF_SND }, // 17 - { "214ae-v3.v3", 0x400000, 0x3cfd1295, 5 | BRF_SND }, // 18 -}; - -STDROMPICKEXT(kof96ae20, kof96ae20, neogeo) -STD_ROM_FN(kof96ae20) - -struct BurnDriver BurnDrvkof96ae20 = { - "kof96ae20", "kof96", "neogeo", NULL, "2009", - "The King of Fighters '96 (Anniversary Edition 2.0.0430, EGHT hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof96ae20RomInfo, kof96ae20RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '96 (Chinese Edition ver 1.0, hack) - -static struct BurnRomInfo kof96cnRomDesc[] = { - { "214cn-p1.bin", 0x100000, 0xa8c25f0a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "214cn-p2.bin", 0x200000, 0x0edface5, 1 | BRF_ESS | BRF_PRG }, // 1 - { "214cn-p3.bin", 0x500000, 0x8724a441, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "214cn-s1.bin", 0x020000, 0xf917527a, 2 | BRF_GRA }, // 3 Text layer tiles - - { "214-c1.bin", 0x400000, 0x7ecf4aa2, 3 | BRF_GRA }, // 4 Sprite data - { "214-c2.bin", 0x400000, 0x05b54f37, 3 | BRF_GRA }, // 5 - { "214-c3.bin", 0x400000, 0x64989a65, 3 | BRF_GRA }, // 6 - { "214-c4.bin", 0x400000, 0xafbea515, 3 | BRF_GRA }, // 7 - { "214-c5.bin", 0x400000, 0x2a3bbd26, 3 | BRF_GRA }, // 8 - { "214-c6.bin", 0x400000, 0x44d30dc7, 3 | BRF_GRA }, // 9 - { "214-c7.bin", 0x400000, 0x3687331b, 3 | BRF_GRA }, // 10 - { "214-c8.bin", 0x400000, 0xfa1461ad, 3 | BRF_GRA }, // 11 - { "214cn-c9.bin", 0x400000, 0xa9f811d2, 3 | BRF_GRA }, // 12 - { "214cn-c10.bin",0x400000, 0x1147406a, 3 | BRF_GRA }, // 13 - - { "214-m1.bin", 0x020000, 0xdabc427c, 4 | BRF_ESS | BRF_PRG }, // 14 Z80 code - - { "214-v1.bin", 0x400000, 0x63f7b045, 5 | BRF_SND }, // 15 Sound data - { "214-v2.bin", 0x400000, 0x25929059, 5 | BRF_SND }, // 16 - { "214-v3.bin", 0x200000, 0x92a2257d, 5 | BRF_SND }, // 17 -}; - -STDROMPICKEXT(kof96cn, kof96cn, neogeo) -STD_ROM_FN(kof96cn) - -struct BurnDriver BurnDrvkof96cn = { - "kof96cn", "kof96", "neogeo", NULL, "200?", - "The King of Fighters '96 (Chinese Edition ver 1.0, hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof96cnRomInfo, kof96cnRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '96 (bootleg / hack) - -static struct BurnRomInfo kof96epRomDesc[] = { - { "214-p1.bin", 0x100000, 0x52755d74, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "214-p2.bin", 0x200000, 0x002ccb73, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "214-s1.bin", 0x020000, 0x1254cbdb, 2 | BRF_GRA }, // 2 Text layer tiles - - { "214-c1.bin", 0x400000, 0x7ecf4aa2, 3 | BRF_GRA }, // 3 Sprite data - { "214-c2.bin", 0x400000, 0x05b54f37, 3 | BRF_GRA }, // 4 - { "214-c3.bin", 0x400000, 0x64989a65, 3 | BRF_GRA }, // 5 - { "214-c4.bin", 0x400000, 0xafbea515, 3 | BRF_GRA }, // 6 - { "214-c5.bin", 0x400000, 0x2a3bbd26, 3 | BRF_GRA }, // 7 - { "214-c6.bin", 0x400000, 0x44d30dc7, 3 | BRF_GRA }, // 8 - { "214-c7.bin", 0x400000, 0x3687331b, 3 | BRF_GRA }, // 9 - { "214-c8.bin", 0x400000, 0xfa1461ad, 3 | BRF_GRA }, // 10 - - { "214-m1.bin", 0x020000, 0xdabc427c, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "214-v1.bin", 0x400000, 0x63f7b045, 5 | BRF_SND }, // 12 Sound data - { "214-v2.bin", 0x400000, 0x25929059, 5 | BRF_SND }, // 13 - { "214-v3.bin", 0x200000, 0x92a2257d, 5 | BRF_SND }, // 14 - - { "kof96m_ep1.rom",0x080000, 0xe5f2fb43, 0 | BRF_ESS | BRF_PRG }, // 15 -}; - -STDROMPICKEXT(kof96ep, kof96ep, neogeo) -STD_ROM_FN(kof96ep) - -static void kof96epCallback() -{ - UINT8 *pTemp = (UINT8*)BurnMalloc(0x80000); - - if (pTemp) { - BurnLoadRom(pTemp, 15, 1); - - for (UINT32 i = 0; i < 0x80000; i++) { - if (pTemp[i] - Neo68KROMActive[i] == 8) pTemp[i] = Neo68KROMActive[i]; - } - - memmove(Neo68KROMActive, pTemp, 0x80000); - - BurnFree(pTemp); - } -} - -static INT32 kof96epInit() -{ - NeoCallbackActive->pInitialise = kof96epCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvkof96ep = { - "kof96ep", "kof96", "neogeo", NULL, "1996", - "The King of Fighters '96 (bootleg / hack)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof96epRomInfo, kof96epRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof96epInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '97 (10th Anniversary Chinese Edition, EGHT hack) - -static struct BurnRomInfo kof97cnRomDesc[] = { - { "232cn-p1.bin", 0x100000, 0x082933c8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "232cn-p2.bin", 0x600000, 0xd22d3ca3, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "232cn-s1.bin", 0x020000, 0xde5ad278, 2 | BRF_GRA }, // 2 Text layer tiles - - { "232cn-c1.bin", 0x800000, 0x8c3d2c0c, 3 | BRF_GRA }, // 3 Sprite data - { "232cn-c2.bin", 0x800000, 0x43ce69ae, 3 | BRF_GRA }, // 4 - { "232-c3.bin", 0x800000, 0x581d6618, 3 | BRF_GRA }, // 5 - { "232-c4.bin", 0x800000, 0x49bb1e68, 3 | BRF_GRA }, // 6 - { "232-c5.bin", 0x400000, 0x34fc4e51, 3 | BRF_GRA }, // 7 - { "232-c6.bin", 0x400000, 0x4ff4d47b, 3 | BRF_GRA }, // 8 - - { "232-m1.bin", 0x020000, 0x45348747, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "232-v1.bin", 0x400000, 0x22a2b5b5, 5 | BRF_SND }, // 10 Sound data - { "232-v2.bin", 0x400000, 0x2304e744, 5 | BRF_SND }, // 11 - { "232-v3.bin", 0x400000, 0x759eb954, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kof97cn, kof97cn, neogeo) -STD_ROM_FN(kof97cn) - -struct BurnDriver BurnDrvkof97cn = { - "kof97cn", "kof97", "neogeo", NULL, "2007", - "The King of Fighters '97 (10th Anniversary Chinese Edition, EGHT hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof97cnRomInfo, kof97cnRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '97 Plus 2003 (bootleg / hack) - -static struct BurnRomInfo kof97plaRomDesc[] = { - { "kf97-p1a.bin", 0x100000, 0x035911c5, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "232-p2.bin", 0x400000, 0x158b23f6, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "kf97-s1a.bin", 0x020000, 0x4ee2149a, 2 | BRF_GRA }, // 2 Text layer tiles - - { "232-c1.bin", 0x800000, 0x5f8bf0a1, 3 | BRF_GRA }, // 3 Sprite data - { "232-c2.bin", 0x800000, 0xe4d45c81, 3 | BRF_GRA }, // 4 - { "232-c3.bin", 0x800000, 0x581d6618, 3 | BRF_GRA }, // 5 - { "232-c4.bin", 0x800000, 0x49bb1e68, 3 | BRF_GRA }, // 6 - { "232-c5.bin", 0x400000, 0x34fc4e51, 3 | BRF_GRA }, // 7 - { "232-c6.bin", 0x400000, 0x4ff4d47b, 3 | BRF_GRA }, // 8 - - { "232-m1.bin", 0x020000, 0x45348747, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "232-v1.bin", 0x400000, 0x22a2b5b5, 5 | BRF_SND }, // 10 Sound data - { "232-v2.bin", 0x400000, 0x2304e744, 5 | BRF_SND }, // 11 - { "232-v3.bin", 0x400000, 0x759eb954, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kof97pla, kof97pla, neogeo) -STD_ROM_FN(kof97pla) - -static void kof97plaCallback() -{ - lans2004_sx_decode(); -} - -static INT32 kof97plaInit() -{ - NeoCallbackActive->pInitialise = kof97plaCallback; - - return NeoInit(); -} - -struct BurnDriver BurnDrvkof97pla = { - "kof97pla", "kof97", "neogeo", NULL, "2003", - "The King of Fighters '97 Plus 2003 (bootleg / hack)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof97plaRomInfo, kof97plaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof97plaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// The King of Fighters '97 oroshi plus 2003 - -static struct BurnRomInfo kof97oroRomDesc[] = { - { "orochi-p1.bin", 0x0100000, 0x6DCB2946, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "orochi-p21.bin", 0x0200000, 0x6E1C4D8C, 1 | BRF_ESS | BRF_PRG }, // 1 - { "orochi-p29.bin", 0x0200000, 0x4C7C0221, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "orochi-s1.bin", 0x0020000, 0x4EE2149A, 2 | BRF_GRA }, // 3 Text layer tiles - - { "orochi-c1.bin", 0x1000000, 0xF13E841C, 3 | BRF_GRA }, // 4 Sprite data - { "orochi-c2.bin", 0x1000000, 0x2DB1F6D3, 3 | BRF_GRA }, // 5 - { "orochi-c51.bin", 0x0200000, 0xA90340CB, 3 | BRF_GRA }, // 6 - { "orochi-c61.bin", 0x0200000, 0x188E351A, 3 | BRF_GRA }, // 7 - { "orochi-c52.bin", 0x0200000, 0xD4EEC50A, 3 | BRF_GRA }, // 8 - { "orochi-c62.bin", 0x0200000, 0x031B1AD5, 3 | BRF_GRA }, // 9 - - { "orochi-m1.bin", 0x0020000, 0x45348747, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "orochi-v1.bin", 0x0400000, 0x22a2b5b5, 5 | BRF_SND }, // 11 Sound data - { "orochi-v2.bin", 0x0400000, 0x2304e744, 5 | BRF_SND }, // 12 - { "orochi-v3.bin", 0x0400000, 0x759eb954, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(kof97oro, kof97oro, neogeo) -STD_ROM_FN(kof97oro) - -static void kof97oro_px_decode() -{ - int i; - UINT16 *tmp = (UINT16*)BurnMalloc(0x500000); - UINT16 *src = (UINT16*)Neo68KROMActive; - - for (i = 0; i < 0x100000/2; i++) { - tmp[i] = src[i ^ 0x7ffef]; - } - - for (i = 0; i < 0x400000/2; i++) { - tmp[i + (0x100000/2)] = src[(i ^ 0xfffef) + (0x100000/2)]; - } - - memmove (src, tmp, 0x500000); - - BurnFree (tmp); -} - -static void kof97oroCallback() -{ - kof97oro_px_decode(); - lans2004_cx_decode(0x2800000); - lans2004_sx_decode(); -} - -static INT32 kof97oroInit() -{ - INT32 nRet; - - NeoCallbackActive->pInitialise = kof97oroCallback; - - nRet = NeoInit(); - - return nRet; -} - -struct BurnDriver BurnDrvKof97oro = { - "kof97oro", "kof97", "neogeo", NULL, "1997", - "The King of Fighters '97 oroshi plus 2003\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof97oroRomInfo, kof97oroRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - kof97oroInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// The King of Fighters '97 - Final Battle (hack) - -static struct BurnRomInfo kof97xtRomDesc[] = { - { "232xt-p1.bin", 0x100000, 0x2e4f4e3b, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "232xt-p2.bin", 0x400000, 0x6d4503ce, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "232xt-s1.bin", 0x020000, 0xd6fe166f, 2 | BRF_GRA }, // 2 Text layer tiles - - { "232xt-c1.bin", 0x800000, 0xd504bf4a, 3 | BRF_GRA }, // 3 Sprite data - { "232xt-c2.bin", 0x800000, 0x942ea708, 3 | BRF_GRA }, // 4 - { "232-c3.bin", 0x800000, 0x581d6618, 3 | BRF_GRA }, // 5 - { "232-c4.bin", 0x800000, 0x49bb1e68, 3 | BRF_GRA }, // 6 - { "232xt-c5.bin", 0x800000, 0xc1bd2375, 3 | BRF_GRA }, // 7 - { "232xt-c6.bin", 0x800000, 0xa7c8506a, 3 | BRF_GRA }, // 8 - - { "232-m1.bin", 0x020000, 0x45348747, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "232-v1.bin", 0x400000, 0x22a2b5b5, 5 | BRF_SND }, // 10 Sound data - { "232-v2.bin", 0x400000, 0x2304e744, 5 | BRF_SND }, // 11 - { "232-v3.bin", 0x400000, 0x759eb954, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(kof97xt, kof97xt, neogeo) -STD_ROM_FN(kof97xt) - -struct BurnDriver BurnDrvkof97xt = { - "kof97xt", "kof97", "neogeo", NULL, "2007", - "The King of Fighters '97 - Final Battle (hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof97xtRomInfo, kof97xtRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '98 (Anniversary Edition, EGHT hack) - -static struct BurnRomInfo kof98aeRomDesc[] = { - // Rom information - /* - 242-p1ae.bin c9188c66 : original P1 - 242-p1ae.bin 23a80b3e : kensou 2624+BD bug[by mhloveke520] - 242-p2ae.bin 609fac6b : original P2 - 242-p2ae.bin 99b3e5cc : squat error fixes[by Bing Yan Dream] - */ -// { "242-p1ae.bin", 0x100000, 0xc9188c66, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "242-p1ae.bin", 0x100000, 0x23a80b3e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code -// { "242-p2ae.bin", 0x600000, 0x609fac6b, 1 | BRF_ESS | BRF_PRG }, // 1 - { "242-p2ae.bin", 0x600000, 0x99b3e5cc, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "242-s1ae.bin", 0x020000, 0xf1fee5c0, 2 | BRF_GRA }, // 2 Text layer tiles - - { "242-c1ae.bin", 0x800000, 0x0319cfc9, 3 | BRF_GRA }, // 3 Sprite data - { "242-c2ae.bin", 0x800000, 0x553f6714, 3 | BRF_GRA }, // 4 - { "242-c3.bin", 0x800000, 0x22127b4f, 3 | BRF_GRA }, // 5 - { "242-c4.bin", 0x800000, 0x0b4fa044, 3 | BRF_GRA }, // 6 - { "242-c5ae.bin", 0x800000, 0x71641718, 3 | BRF_GRA }, // 7 - { "242-c6ae.bin", 0x800000, 0x982ba2b3, 3 | BRF_GRA }, // 8 - { "242-c7ae.bin", 0x800000, 0x8d495552, 3 | BRF_GRA }, // 9 - { "242-c8ae.bin", 0x800000, 0x8bfc3417, 3 | BRF_GRA }, // 10 - { "242-c9ae.bin", 0x800000, 0x128256d1, 3 | BRF_GRA }, // 11 - { "242-c91ae.bin",0x800000, 0x4bd8412d, 3 | BRF_GRA }, // 12 - { "242-c92ae.bin",0x800000, 0xe893277f, 3 | BRF_GRA }, // 13 - { "242-c93ae.bin",0x800000, 0xf165589e, 3 | BRF_GRA }, // 14 - - { "242-m1ae.bin", 0x040000, 0x9ade0528, 4 | BRF_ESS | BRF_PRG }, // 15 Z80 code - - { "242-v1.bin", 0x400000, 0xb9ea8051, 5 | BRF_SND }, // 16 Sound data - { "242-v2.bin", 0x400000, 0xcc11106e, 5 | BRF_SND }, // 17 - { "242-v3.bin", 0x400000, 0x044ea4e1, 5 | BRF_SND }, // 18 - { "242-v4.bin", 0x400000, 0x7985ea30, 5 | BRF_SND }, // 19 - { "242-v5ae.bin", 0x400000, 0xafdd9660, 5 | BRF_SND }, // 20 -}; - -STDROMPICKEXT(kof98ae, kof98ae, neogeo) -STD_ROM_FN(kof98ae) - -struct BurnDriver BurnDrvkof98ae = { - "kof98ae", "kof98", "neogeo", NULL, "2007", - "The King of Fighters '98 (Anniversary Edition, EGHT hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof98aeRomInfo, kof98aeRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '98 (Anniversary Edition build 1.2.0827, EGCG 2016) -// [2016.08.27] version -// Update team : GSC2007 [program], Dream [graphics], Bing Yan Dream [Color] - -static struct BurnRomInfo kof98ae2016RomDesc[] = { -// { "242ae-p1.bin", 0x100000, 0xc7fddbd8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "242ae-p1.p1", 0x100000, 0xd69ecaa9, 1 | BRF_ESS | BRF_PRG }, // 0 68K code -// { "242ae-p2.bin", 0x600000, 0xd84dbe5b, 1 | BRF_ESS | BRF_PRG }, // 1 - { "242ae-p2.sp2", 0x600000, 0xac1e9e79, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "242ae-s1.s1", 0x040000, 0x345c20b0, 2 | BRF_GRA }, // 2 Text layer tiles - - { "242ae-c1.c1", 0x800000, 0x086ec060, 3 | BRF_GRA }, // 3 Sprite data - { "242ae-c2.c2", 0x800000, 0x16b9a9a2, 3 | BRF_GRA }, // 4 - { "242-c3.c3", 0x800000, 0x22127b4f, 3 | BRF_GRA }, // 5 - { "242-c4.c4", 0x800000, 0x0b4fa044, 3 | BRF_GRA }, // 6 - { "242ae-c5.c5", 0x800000, 0x71641718, 3 | BRF_GRA }, // 7 - { "242ae-c6.c6", 0x800000, 0x982ba2b3, 3 | BRF_GRA }, // 8 - { "242ae-c7.c7", 0x800000, 0x8d495552, 3 | BRF_GRA }, // 9 - { "242ae-c8.c8", 0x800000, 0x8bfc3417, 3 | BRF_GRA }, // 10 - { "242ae-c9.c9", 0x800000, 0x128256d1, 3 | BRF_GRA }, // 11 - { "242ae-c10.c10",0x800000, 0x4bd8412d, 3 | BRF_GRA }, // 12 - { "242ae-c11.c11",0x800000, 0x56d361cb, 3 | BRF_GRA }, // 13 - { "242ae-c12.c12",0x800000, 0xf8cb115b, 3 | BRF_GRA }, // 14 - - { "242ae-m1.m1", 0x040000, 0x9ade0528, 4 | BRF_ESS | BRF_PRG }, // 15 Z80 code - - { "242-v1.v1", 0x400000, 0xb9ea8051, 5 | BRF_SND }, // 16 Sound data - { "242-v2.v2", 0x400000, 0xcc11106e, 5 | BRF_SND }, // 17 - { "242-v3.v3", 0x400000, 0x044ea4e1, 5 | BRF_SND }, // 18 - { "242-v4.v4", 0x400000, 0x7985ea30, 5 | BRF_SND }, // 19 - { "242ae-v5.v5", 0x400000, 0xafdd9660, 5 | BRF_SND }, // 20 -}; - -STDROMPICKEXT(kof98ae2016, kof98ae2016, neogeo) -STD_ROM_FN(kof98ae2016) - -struct BurnDriver BurnDrvkof98ae2016 = { - "kof98ae2016", "kof98", "neogeo", NULL, "2016", - "The King of Fighters '98 (Anniversary Edition build 1.2.0827)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof98ae2016RomInfo, kof98ae2016RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '98 (Combo) -/* Ivex hack - 2017/06/01 version */ -static struct BurnRomInfo kof98cbRomDesc[] = { - { "242cb-p1.p1", 0x100000, 0x1faa94ee, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "242cb-p2.sp2", 0x400000, 0x69b7f51c, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "242cb-s1.s1", 0x020000, 0x7333d8b0, 2 | BRF_GRA }, // 2 Text layer tiles - - { "242cb-c1.c1", 0x800000, 0x066db0a6, 3 | BRF_GRA }, // 3 Sprite data - { "242cb-c2.c2", 0x800000, 0x99d0b0fa, 3 | BRF_GRA }, // 4 - { "242cb-c3.c3", 0x800000, 0xea84bdae, 3 | BRF_GRA }, // 5 - { "242cb-c4.c4", 0x800000, 0x2c17ac8e, 3 | BRF_GRA }, // 6 - { "242-c5.c5", 0x800000, 0x9d10bed3, 3 | BRF_GRA }, // 7 - { "242-c6.c6", 0x800000, 0xda07b6a2, 3 | BRF_GRA }, // 8 - { "242-c7.c7", 0x800000, 0xf6d7a38a, 3 | BRF_GRA }, // 9 - { "242-c8.c8", 0x800000, 0xc823e045, 3 | BRF_GRA }, // 10 - - { "242cb-m1.m1", 0x040000, 0xdb046fc4, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code - - { "242-v1.v1", 0x400000, 0xb9ea8051, 5 | BRF_SND }, // 16 Sound data - { "242-v2.v2", 0x400000, 0xcc11106e, 5 | BRF_SND }, // 17 - { "242-v3.v3", 0x400000, 0x044ea4e1, 5 | BRF_SND }, // 18 - { "242-v4.v4", 0x400000, 0x7985ea30, 5 | BRF_SND }, // 19 -}; - -STDROMPICKEXT(kof98cb, kof98cb, neogeo) -STD_ROM_FN(kof98cb) - -struct BurnDriver BurnDrvkof98cb = { - "kof98cb", "kof98", "neogeo", NULL, "2015", - "The King of Fighters '98 (Combo, hack)\0", NULL, "hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof98cbRomInfo, kof98cbRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The King of Fighters '99 (15th Anniversary Edition) -/* Yashional hack - 2016/04/19 Last Ver. 1*/ -static struct BurnRomInfo kof99aeRomDesc[] = { - { "199-p1.bin", 0x100000, 0xc19447eb, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "199-p2.bin", 0x800000, 0x55418995, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "199-s1.bin", 0x020000, 0x3c31ee43, 2 | BRF_GRA }, // 2 Text layer tiles - - { "199-c1.bin", 0x800000, 0x497c2e83, 3 | BRF_GRA }, // 3 Sprite data - { "199-c2.bin", 0x800000, 0x0a13eeb7, 3 | BRF_GRA }, // 4 - { "199-c3.bin", 0x800000, 0xb047c9d5, 3 | BRF_GRA }, // 5 - { "199-c4.bin", 0x800000, 0x6bc8e4b1, 3 | BRF_GRA }, // 6 - { "199-c5.bin", 0x800000, 0x9746268c, 3 | BRF_GRA }, // 7 - { "199-c6.bin", 0x800000, 0x238b3e71, 3 | BRF_GRA }, // 8 - { "199-c7.bin", 0x800000, 0xf22760ad, 3 | BRF_GRA }, // 9 - { "199-c8.bin", 0x800000, 0x396c3a70, 3 | BRF_GRA }, // 10 - { "199-c9.bin", 0x800000, 0x86a3550d, 3 | BRF_GRA }, // 11 - { "199-ca.bin", 0x800000, 0x986bb897, 3 | BRF_GRA }, // 12 - { "199-cb.bin", 0x800000, 0x7fe785c2, 3 | BRF_GRA }, // 13 - { "199-cc.bin", 0x800000, 0xa7541483, 3 | BRF_GRA }, // 14 - - { "199-m1.bin", 0x020000, 0xf847e188, 4 | BRF_ESS | BRF_PRG }, // 15 Z80 code - - { "199-v1.bin", 0x400000, 0xceaa3bae, 5 | BRF_SND }, // 16 Sound data - { "199-v2.bin", 0x400000, 0x07d70650, 5 | BRF_SND }, // 17 - { "199-v3.bin", 0x400000, 0x821901da, 5 | BRF_SND }, // 18 - { "199-v4.bin", 0x200000, 0xb49e6178, 5 | BRF_SND }, // 19 -}; - -STDROMPICKEXT(kof99ae, kof99ae, neogeo) -STD_ROM_FN(kof99ae) - -struct BurnDriver BurnDrvkof99ae = { - "kof99ae", "kof99", "neogeo", NULL, "2015", - "The King of Fighters '99 (15th Anniversary Edition)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_KOF, - NULL, kof99aeRomInfo, kof99aeRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// The Last Blade / Bakumatsu Roman - Gekka no Kenshi (NGM-2340, alternate board) -/* MVS VERSION */ - -static struct BurnRomInfo lastbladaRomDesc[] = { - /* This set uses NEO-MVS PROGBK1 board; same rom data as in lastblad is used */ - { "0234-ep1.ep1", 0x080000, 0x3893d38b, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C4002 - { "0234-ep2.ep2", 0x080000, 0x9470c788, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 - { "0234-p1.p1", 0x200000, 0xb45e631c, 1 | BRF_ESS | BRF_PRG }, // 2 / M27C160 - { "0234-sp2.sp2", 0x200000, 0xaa34e149, 1 | BRF_ESS | BRF_PRG }, // 3 / M27C160 - - { "234-s1.s1", 0x020000, 0x95561412, 2 | BRF_GRA }, // 4 Text layer tiles - - { "234-c1.c1", 0x800000, 0x9f7e2bd3, 3 | BRF_GRA }, // 5 Sprite data - { "234-c2.c2", 0x800000, 0x80623d3c, 3 | BRF_GRA }, // 6 - { "234-c3.c3", 0x800000, 0x91ab1a30, 3 | BRF_GRA }, // 7 - { "234-c4.c4", 0x800000, 0x3d60b037, 3 | BRF_GRA }, // 8 - { "234-c5.c5", 0x400000, 0x1ba80cee, 3 | BRF_GRA }, // 9 - { "234-c6.c6", 0x400000, 0xbeafd091, 3 | BRF_GRA }, // 10 - - { "0234-m1.m1", 0x020000, 0x087628ea, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code / M27C1001 - - { "234-v1.v1", 0x400000, 0xed66b76f, 5 | BRF_SND }, // 12 Sound data - { "234-v2.v2", 0x400000, 0xa0e7f6e2, 5 | BRF_SND }, // 13 - { "234-v3.v3", 0x400000, 0xa506e1e2, 5 | BRF_SND }, // 14 - { "234-v4.v4", 0x400000, 0x0e34157f, 5 | BRF_SND }, // 15 -}; - -STDROMPICKEXT(lastblada, lastblada, neogeo) -STD_ROM_FN(lastblada) - -struct BurnDriver BurnDrvlastblada = { - "lastblada", "lastblad", "neogeo", NULL, "1997", - "The Last Blade / Bakumatsu Roman - Gekka no Kenshi (NGM-2340, alternate board)\0", NULL, "SNK", "Neo Geo MVS", - L"The Last Blade\0\u5E55\u672B\u6D6A\u6F2B \u6708\u83EF\u306E\u5263\u58EB (NGM-2340, alternate board)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, lastbladaRomInfo, lastbladaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// The Last Blade / Bakumatsu Roman - Gekka no Kenshi (Special 2017, hack) -// Modified by: GSC2007 -// Version number: Ver 1.0.0621 - -static struct BurnRomInfo lastbladspRomDesc[] = { - { "234-p1sp.p1", 0x100000, 0x2cbe10af, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "234-p2sp.sp2", 0x600000, 0x8ff3fb6d, 1 | BRF_ESS | BRF_PRG }, // 1 - { "234-p3sp.sp2", 0x020000, 0x88eb8cf5, 0 | BRF_ESS | BRF_PRG }, // 1 - - { "234-s1.s1", 0x020000, 0x95561412, 2 | BRF_GRA }, // 2 Text layer tiles - - { "234-c1.c1", 0x800000, 0x9f7e2bd3, 3 | BRF_GRA }, // 3 Sprite data - { "234-c2.c2", 0x800000, 0x80623d3c, 3 | BRF_GRA }, // 4 - { "234-c3.c3", 0x800000, 0x91ab1a30, 3 | BRF_GRA }, // 5 - { "234-c4.c4", 0x800000, 0x3d60b037, 3 | BRF_GRA }, // 6 - { "234-c5sp.c5", 0x400000, 0x4ea22fe0, 3 | BRF_GRA }, // 7 - { "234-c6sp.c6", 0x400000, 0xa863c882, 3 | BRF_GRA }, // 8 - - { "234-m1.m1", 0x020000, 0x087628ea, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "234-v1.v1", 0x400000, 0xed66b76f, 5 | BRF_SND }, // 10 Sound data - { "234-v2.v2", 0x400000, 0xa0e7f6e2, 5 | BRF_SND }, // 11 - { "234-v3.v3", 0x400000, 0xa506e1e2, 5 | BRF_SND }, // 12 - { "234-v4.v4", 0x400000, 0x0e34157f, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(lastbladsp, lastbladsp, neogeo) -STD_ROM_FN(lastbladsp) - -static UINT8 *lastbladspExtraROM; - -static INT32 LastbladspInit() -{ - INT32 nRet = NeoInit(); - - if (nRet == 0) { - lastbladspExtraROM = (UINT8*)BurnMalloc(0x20000); - - if (BurnLoadRom(lastbladspExtraROM, 2, 1)) return 1; - - UINT16 *rom = (UINT16*)lastbladspExtraROM; - for (INT32 i = 0; i < 0x20000/2; i++) { - if (rom[i] == 0x4e7d) rom[i] = 0x4e71; - if (rom[i] == 0x4e7c) rom[i] = 0x4e75; - } - - rom = (UINT16*)Neo68KROMActive; - - for (INT32 i = 0; i < 0x100000/2; i++) { - if (rom[i] == 0x4e7d) rom[i] = 0x4e71; - if (rom[i] == 0x4e7c) rom[i] = 0x4e75; - } - - rom[0x69c10/2] = 0x303c; // 4ef9 - rom[0x69c12/2] = 0x0b37; // 0091 - rom[0x69c14/2] = 0x323c; // 03c4 - rom[0x69c16/2] = 0x0013; // 4e7d - - SekOpen(0); - SekMapMemory(lastbladspExtraROM, 0x900000, 0x91ffff, MAP_ROM); - SekClose(); - } - - return nRet; -} - -static INT32 LastbladspExit() -{ - BurnFree (lastbladspExtraROM); - - return NeoExit(); -} -struct BurnDriver BurnDrvlastbladsp = { - "lastbladsp", "lastblad", "neogeo", NULL, "2017", - "The Last Soldier (Special 2017, hack)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, lastbladspRomInfo, lastbladspRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - LastbladspInit, LastbladspExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// The Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi (Enhanced Hack) -// Hackers: Dodowang, Eddids -// Unlock "EX" mode (highlight Speed and press C) & Enable hidden characters - -static struct BurnRomInfo lastbld2ehRomDesc[] = { - { "243-p1eh.p1", 0x100000, 0x6c8867d2, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "243-p2eh.p2", 0x400000, 0xeef07572, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "243-s1.s1", 0x020000, 0xc9cd2298, 2 | BRF_GRA }, // 2 Text layer tiles - - { "243-c1.c1", 0x800000, 0x5839444d, 3 | BRF_GRA }, // 3 Sprite data - { "243-c2.c2", 0x800000, 0xdd087428, 3 | BRF_GRA }, // 4 - { "243-c3.c3", 0x800000, 0x6054cbe0, 3 | BRF_GRA }, // 5 - { "243-c4.c4", 0x800000, 0x8bd2a9d2, 3 | BRF_GRA }, // 6 - { "243-c5.c5", 0x800000, 0x6a503dcf, 3 | BRF_GRA }, // 7 - { "243-c6.c6", 0x800000, 0xec9c36d0, 3 | BRF_GRA }, // 8 - - { "243-m1.m1", 0x020000, 0xacf12d10, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "243-v1.v1", 0x400000, 0xf7ee6fbb, 5 | BRF_SND }, // 10 Sound data - { "243-v2.v2", 0x400000, 0xaa9e4df6, 5 | BRF_SND }, // 11 - { "243-v3.v3", 0x400000, 0x4ac750b2, 5 | BRF_SND }, // 12 - { "243-v4.v4", 0x400000, 0xf5c64ba6, 5 | BRF_SND }, // 13 -}; - -STDROMPICKEXT(lastbld2eh, lastbld2eh, neogeo) -STD_ROM_FN(lastbld2eh) - -struct BurnDriver BurnDrvDlastbld2eh = { - "lastbld2eh", "lastbld2", "neogeo", NULL, "1998", - "The Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi (Enhanced Hack)\0", NULL, "SNK", "Neo Geo MVS", - L"The Last Blade 2\0\u5E55\u672B\u6D6A\u6F2B\u7B2C\u4E8C\u5E55 - \u6708\u83EF\u306E\u5263\u58EB - \u6708\u306B\u54B2\u304F\u83EF\u3001\u6563\u308A\u3086\u304F\u82B1 (Enhanced Hack)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, 0, - NULL, lastbld2ehRomInfo, lastbld2ehRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Last Hope (Neo CD conversion) - -static struct BurnRomInfo lhcdbRomDesc[] = { - { "300-p1ch.bin", 0x100000, 0x0f7405d7, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "300-s1ch.bin", 0x020000, 0x298495d6, 2 | BRF_GRA }, // 1 Text data - - { "300-c1ch.bin", 0x400000, 0x554e6b73, 3 | BRF_GRA }, // 2 Sprite data - { "300-c2ch.bin", 0x400000, 0x7c84b0fc, 3 | BRF_GRA }, // 3 - { "300-c3ch.bin", 0x400000, 0x28ec7555, 3 | BRF_GRA }, // 4 - { "300-c4ch.bin", 0x400000, 0x8b7c236b, 3 | BRF_GRA }, // 5 - - { "300-m1ch.bin", 0x020000, 0xd9f6c153, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "300-v1ch.bin", 0x400000, 0xde563ec3, 5 | BRF_SND }, // 7 Sound data - { "300-v2ch.bin", 0x400000, 0x93478033, 5 | BRF_SND }, // 8 - { "300-v3ch.bin", 0x400000, 0xe0fc99ca, 5 | BRF_SND }, // 9 -}; - -STDROMPICKEXT(lhcdb, lhcdb, neogeo) -STD_ROM_FN(lhcdb) - -struct BurnDriver BurnDrvlhcdb = { - "lhcdb", NULL, "neogeo", NULL, "2007", - "Last Hope CD Beta (Neo CD conversion)\0", "Imperfect graphics", "NG:Dev.Team", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HACK, 2, HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, lhcdbRomInfo, lhcdbRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Last Hope (bootleg AES to MVS conversion, no coin support) -// wasn't actually released on MVS but bootleg carts have been sold, this doesn't accept coins, runs like a console game - -static struct BurnRomInfo lasthopeRomDesc[] = { - { "ngdt-300-p1.bin", 0x100000, 0x3776a88f, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "ngdt-300-s1.bin", 0x010000, 0x0c0ff9e6, 2 | BRF_GRA }, // 1 Text data - - { "ngdt-300-c1.bin", 0x400000, 0x53ef41b5, 3 | BRF_GRA }, // 2 Sprite data - { "ngdt-300-c2.bin", 0x400000, 0xf9b15ab3, 3 | BRF_GRA }, // 3 - { "ngdt-300-c3.bin", 0x400000, 0x50cc21cf, 3 | BRF_GRA }, // 4 - { "ngdt-300-c4.bin", 0x400000, 0x8486ad9e, 3 | BRF_GRA }, // 5 - - { "ngdt-300-m1.bin", 0x020000, 0x113c870f, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "ngdt-300-v1.bin", 0x200000, 0xb765bafe, 5 | BRF_SND }, // 7 Sound data - { "ngdt-300-v2.bin", 0x200000, 0x9fd0d559, 5 | BRF_SND }, // 8 - { "ngdt-300-v3.bin", 0x200000, 0x6d5107e2, 5 | BRF_SND }, // 9 -}; - -STDROMPICKEXT(lasthope, lasthope, neogeo) -STD_ROM_FN(lasthope) - -struct BurnDriver BurnDrvlasthope = { - "lasthope", NULL, "neogeo", NULL, "2005", - "Last Hope (bootleg AES to MVS conversion, no coin support)\0", NULL, "NG:Dev.Team", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_HORSHOOT, 0, - NULL, lasthopeRomInfo, lasthopeRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Metal Slug 2 Turbo (NGM-9410) -/* MVS VERSION */ - -static struct BurnRomInfo mslug2tRomDesc[] = { - { "941-p1.p1", 0x100000, 0xdf5d6fbc, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "241-p2.sp2", 0x200000, 0x38883f44, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "241-s1.s1", 0x020000, 0xf3d32f0f, 2 | BRF_GRA }, // 2 Text layer tiles - - { "241-c1.c1", 0x800000, 0x394b5e0d, 3 | BRF_GRA }, // 3 Sprite data - { "241-c2.c2", 0x800000, 0xe5806221, 3 | BRF_GRA }, // 4 - { "241-c3.c3", 0x800000, 0x9f6bfa6f, 3 | BRF_GRA }, // 5 - { "241-c4.c4", 0x800000, 0x7d3e306f, 3 | BRF_GRA }, // 6 - - { "241-m1.m1", 0x020000, 0x94520ebd, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code - - { "241-v1.v1", 0x400000, 0x99ec20e8, 5 | BRF_SND }, // 8 Sound data - { "241-v2.v2", 0x400000, 0xecb16799, 5 | BRF_SND }, // 9 -}; - -STDROMPICKEXT(mslug2t, mslug2t, neogeo) -STD_ROM_FN(mslug2t) - -struct BurnDriver BurnDrvMSlug2t = { - "mslug2t", "mslug2", "neogeo", NULL, "2015", - "Metal Slug 2 Turbo (NGM-9410)\0", NULL, "Hack", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug2tRomInfo, mslug2tRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Metal Slug 5 (bootleg) - -static struct BurnRomInfo mslug5bRomDesc[] = { - { "ms5-p1b.bin", 0x500000, 0xd05853ea, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "268-c1c.bin", 0x800000, 0xab7c389a, 3 | BRF_GRA }, // 1 Sprite data - { "268-c2c.bin", 0x800000, 0x3560881b, 3 | BRF_GRA }, // 2 - { "268-c3c.bin", 0x800000, 0x3af955ea, 3 | BRF_GRA }, // 3 - { "268-c4c.bin", 0x800000, 0xc329c373, 3 | BRF_GRA }, // 4 - { "268-c5c.bin", 0x800000, 0x959c8177, 3 | BRF_GRA }, // 5 - { "268-c6c.bin", 0x800000, 0x010a831b, 3 | BRF_GRA }, // 6 - { "268-c7c.bin", 0x800000, 0x6d72a969, 3 | BRF_GRA }, // 7 - { "268-c8c.bin", 0x800000, 0x551d720e, 3 | BRF_GRA }, // 8 - - { "268-m1h.bin", 0x080000, 0x4a5a6e0e, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "268-v1c.bin", 0x800000, 0xae31d60c, 5 | BRF_SND }, // 10 Sound data - { "268-v2c.bin", 0x800000, 0xc40613ed, 5 | BRF_SND }, // 11 -}; - -STDROMPICKEXT(mslug5b, mslug5b, neogeo) -STD_ROM_FN(mslug5b) - -static void mslug5bCallback() -{ - UINT8 *pTemp = (UINT8*)BurnMalloc(0x500000); - - if (pTemp) { - memmove(pTemp, Neo68KROMActive, 0x500000); - memset(Neo68KROMActive, 0, 0x500000); - memmove(Neo68KROMActive + 0x000000, pTemp + 0x000000, 0x100000); - memmove(Neo68KROMActive + 0x100000, pTemp + 0x100000, 0x100000); - memmove(Neo68KROMActive + 0x300000, pTemp + 0x200000, 0x100000); - memmove(Neo68KROMActive + 0x200000, pTemp + 0x300000, 0x100000); - memmove(Neo68KROMActive + 0x400000, pTemp + 0x400000, 0x100000); - - BurnFree(pTemp); - } -} - -static INT32 mslug5bInit() -{ - INT32 nRet; - - nNeoProtectionXor = 0x19; - NeoCallbackActive->pInitialise = mslug5bCallback; - - nRet = NeoPVCInit(); - - if (nRet == 0) { - const PCM2DecryptV2Info Info = { 0x4e001, 0xfe2cf6, { 0xc3, 0xfd, 0x81, 0xac, 0x6d, 0xe7, 0xbf, 0x9e } }; - - PCM2DecryptV2(&Info); - } - - return nRet; -} - -struct BurnDriver BurnDrvmslug5b = { - "mslug5b", "mslug5", "neogeo", NULL, "2003", - "Metal Slug 5 (bootleg)\0", NULL, "bootleg", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CMC50 | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_ENCRYPTED_M1, GBF_PLATFORM, FBF_MSLUG, - NULL, mslug5bRomInfo, mslug5bRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - mslug5bInit, NeoPVCExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Samurai Shodown / Samurai Spirits (NGM-045, alternate board) -/* MVS VERSION */ - -static struct BurnRomInfo samshoaRomDesc[] = { - /* This set uses NEO-MVS PROGSC board and NEO-MVS CHA 42G-3 board; same rom data as in samshoh is used. */ - { "045-epr.ep1", 0x080000, 0x80aa6c97, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / M27C4002 - { "045-epr.ep2", 0x080000, 0x71768728, 1 | BRF_ESS | BRF_PRG }, // 1 / M27C4002 - { "045-p2.sp2", 0x080000, 0x38ee9ba9, 1 | BRF_ESS | BRF_PRG }, // 2 / TC534200 - - { "045-s1.s1", 0x020000, 0x9142a4d3, 2 | BRF_GRA }, // 2 Text layer tiles / TC531000 - - { "045-c1.c1", 0x200000, 0x2e5873a4, 3 | BRF_GRA }, // 3 Sprite data / TC5316200 - { "045-c2.c2", 0x200000, 0x04febb10, 3 | BRF_GRA }, // 4 / TC5316200 - { "045-c3.c3", 0x200000, 0xf3dabd1e, 3 | BRF_GRA }, // 5 / TC5316200 - { "045-c4.c4", 0x200000, 0x935c62f0, 3 | BRF_GRA }, // 6 / TC5316200 - { "045-c5.c5", 0x080000, 0xa2bb8284, 3 | BRF_GRA }, // 7 / TC534200 - { "045-c6.c6", 0x080000, 0x4fa71252, 3 | BRF_GRA }, // 8 / TC534200 - - { "045-m1.m1", 0x020000, 0x95170640, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code / TC5310001 - - { "045-v1.v1", 0x200000, 0x37f78a9b, 5 | BRF_SND }, // 10 Sound data / TC5316200 - { "045-v2.v2", 0x200000, 0x568b20cf, 5 | BRF_SND }, // 11 / TC5316200 -}; - -STDROMPICKEXT(samshoa, samshoa, neogeo) -STD_ROM_FN(samshoa) - -struct BurnDriver BurnDrvSamShoa = { - "samshoa", "samsho", "neogeo", NULL, "1993", - "Samurai Shodown / Samurai Spirits (NGM-045, alternate board)\0", NULL, "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samshoaRomInfo, samshoaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Samurai Shodown II / Shin Samurai Spirits - Haohmaru jigokuhen (Special 2017, hack) -// Modified by: GSC2007 -// Version number: Ver 1.0.0320 - -static struct BurnRomInfo samsho2spRomDesc[] = { - { "063-p1sp.p1", 0x100000, 0x19260a9a, 1 | BRF_ESS | BRF_PRG }, // 0 68k code - { "063-p2sp.p2", 0x100000, 0x6e1aef70, 1 | BRF_ESS | BRF_PRG }, // 1 - { "063-p3sp.p3", 0x020000, 0x8fabd043, 0 | BRF_ESS | BRF_PRG }, // 2 - - { "063-s1sp.s1", 0x020000, 0x1951a907, 2 | BRF_GRA }, // 3 Text layer tiles / TC531000 - - { "063-c1.c1", 0x200000, 0x86cd307c, 3 | BRF_GRA }, // 4 Sprite data / TC5316200 - { "063-c2.c2", 0x200000, 0xcdfcc4ca, 3 | BRF_GRA }, // 5 / TC5316200 - { "063-c3.c3", 0x200000, 0x7a63ccc7, 3 | BRF_GRA }, // 6 / TC5316200 - { "063-c4.c4", 0x200000, 0x751025ce, 3 | BRF_GRA }, // 7 / TC5316200 - { "063-c5.c5", 0x200000, 0x20d3a475, 3 | BRF_GRA }, // 8 / TC5316200 - { "063-c6.c6", 0x200000, 0xae4c0a88, 3 | BRF_GRA }, // 9 / TC5316200 - { "063-c7sp.c7", 0x200000, 0xdbebced2, 3 | BRF_GRA }, // 10 / TC5316200 - { "063-c8sp.c8", 0x200000, 0xbf70b93c, 3 | BRF_GRA }, // 11 / TC5316200 - - { "063-m1.m1", 0x020000, 0x56675098, 4 | BRF_ESS | BRF_PRG }, // 12 Z80 code / TC531001 - - { "063-v1.v1", 0x200000, 0x37703f91, 5 | BRF_SND }, // 13 Sound data / TC5316200 - { "063-v2.v2", 0x200000, 0x0142bde8, 5 | BRF_SND }, // 14 / TC5316200 - { "063-v3.v3", 0x200000, 0xd07fa5ca, 5 | BRF_SND }, // 15 / TC5316200 - { "063-v4.v4", 0x100000, 0x24aab4bb, 5 | BRF_SND }, // 16 / TC538200 -}; - -STDROMPICKEXT(samsho2sp, samsho2sp, neogeo) -STD_ROM_FN(samsho2sp) - -static UINT8 *samsho2spExtraROM; - -static INT32 Samsho2spInit() -{ - INT32 nRet = NeoInit(); - - if (nRet == 0) { - samsho2spExtraROM = (UINT8*)BurnMalloc(0x20000); - - if (BurnLoadRom(samsho2spExtraROM, 2, 1)) return 1; - - // BurnByteswap(samsho2spExtraROM, 0x20000); // necessary? - - SekOpen(0); - SekMapMemory(samsho2spExtraROM, 0x900000, 0x91ffff, MAP_ROM); - SekClose(); - } - - return nRet; -} - -static INT32 Samsho2spExit() -{ - BurnFree (samsho2spExtraROM); - - return NeoExit(); -} - -struct BurnDriver BurnDrvSamsho2sp = { - "samsho2sp", "samsho2", "neogeo", NULL, "2017", - "Samurai Shodown II / Shin Samurai Spirits - Haohmaru jigokuhen (Special 2017, hack)\0", NULL, "hack", "Neo Geo MVS", - L"Samurai Shodown II\0\u771F Samurai Spirits - \u8987\u738B\u4E38\u5730\u7344\u5909 (Special 2017, hack)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho2spRomInfo, samsho2spRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - Samsho2spInit, Samsho2spExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin (Special 2017, hack) -// Modified by: GSC2007 -// Version number: Ver 1.0.0501 - -static struct BurnRomInfo samsho4spRomDesc[] = { - { "222-p1sp.p1", 0x100000, 0x6e98579a, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "222-p2sp.sp2", 0x400000, 0x2c9c64db, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "222-s1.s1", 0x020000, 0x8d3d3bf9, 2 | BRF_GRA }, // 2 Text layer tiles /* TC531000 */ - - { "222-c1.c1", 0x400000, 0x68f2ed95, 3 | BRF_GRA }, // 3 Sprite data /* TC5332205 */ - { "222-c2.c2", 0x400000, 0xa6e9aff0, 3 | BRF_GRA }, // 4 /* TC5332205 */ - { "222-c3.c3", 0x400000, 0xc91b40f4, 3 | BRF_GRA }, // 5 /* TC5332205 */ - { "222-c4.c4", 0x400000, 0x359510a4, 3 | BRF_GRA }, // 6 /* TC5332205 */ - { "222-c5.c5", 0x400000, 0x9cfbb22d, 3 | BRF_GRA }, // 7 /* TC5332205 */ - { "222-c6.c6", 0x400000, 0x685efc32, 3 | BRF_GRA }, // 8 /* TC5332205 */ - { "222-c7sp.c7", 0x400000, 0xecb13c24, 3 | BRF_GRA }, // 9 - { "222-c8sp.c8", 0x400000, 0x0f9a0bda, 3 | BRF_GRA }, // 10 - - { "222-m1.m1", 0x020000, 0x7615bc1b, 4 | BRF_ESS | BRF_PRG }, // 11 Z80 code /* TC531001 */ - - { "222-v1.v1", 0x400000, 0x7d6ba95f, 5 | BRF_SND }, // 12 Sound data /* TC5332204 */ - { "222-v2.v2", 0x400000, 0x6c33bb5d, 5 | BRF_SND }, // 13 /* TC5332204 */ - { "222-v3.v3", 0x200000, 0x831ea8c0, 5 | BRF_SND }, // 14 /* TC5316200 */ -}; - -STDROMPICKEXT(samsho4sp, samsho4sp, neogeo) -STD_ROM_FN(samsho4sp) - -struct BurnDriver BurnDrvSamSho4sp = { - "samsho4sp", "samsho4", "neogeo", NULL, "1996", - "Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin (Special 2017, hack)\0", NULL, "hack", "Neo Geo MVS", - L"Samurai Shodown IV - Amakusa's Revenge\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4 - \u5929\u8349\u964D\u81E8 (Special 2017, hack)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho4spRomInfo, samsho4spRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// Samurai Shodown V / Samurai Spirits Zero (hack of XBOX version) - -static struct BurnRomInfo samsho5xRomDesc[] = { - { "ssvx_p1.rom", 0x800000, 0x16983af9, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "ssv_s1.rom", 0x020000, 0x2ad6048b, 2 | BRF_GRA }, // 1 Text layer tiles - - { "ssvx_c1.rom", 0x800000, 0x25272e50, 3 | BRF_GRA }, // 2 Sprite data - { "ssvx_c2.rom", 0x800000, 0xba68f2e7, 3 | BRF_GRA }, // 3 - { "ssvx_c3.rom", 0x800000, 0x75883cde, 3 | BRF_GRA }, // 4 - { "ssvx_c4.rom", 0x800000, 0x348540e6, 3 | BRF_GRA }, // 5 - { "ssvx_c5.rom", 0x800000, 0x1fee8dc8, 3 | BRF_GRA }, // 6 - { "ssvx_c6.rom", 0x800000, 0xc300b50d, 3 | BRF_GRA }, // 7 - { "ssvx_c7.rom", 0x800000, 0x5e722b0b, 3 | BRF_GRA }, // 8 - { "ssvx_c8.rom", 0x800000, 0xe2a2c546, 3 | BRF_GRA }, // 9 - - { "ssvx_m1.rom", 0x080000, 0x5218a10a, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "ssv_v1.rom", 0x800000, 0x809c7617, 5 | BRF_SND }, // 11 Sound data - { "ssv_v2.rom", 0x800000, 0x42671607, 5 | BRF_SND }, // 12 -}; - -STDROMPICKEXT(samsho5x, samsho5x, neogeo) -STD_ROM_FN(samsho5x) - -struct BurnDriver BurnDrvsamsho5x = { - "samsho5x", "samsho5", "neogeo", NULL, "2003", - "Samurai Shodown V / Samurai Spirits Zero (hack of XBOX version)\0", NULL, "hack", "Neo Geo MVS", - L"Samurai Shodown V\0\u30B5\u30E0\u30E9\u30A4\u30B9\u30D4\u30EA\u30C3\u30C4\u96F6 (hack of XBOX version)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_VSFIGHT, FBF_SAMSHO, - NULL, samsho5xRomInfo, samsho5xRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Sengoku 3 / Sengoku Densho 2001 (Evolution 1.0, FCHT hack) - -static struct BurnRomInfo sengoku3sRomDesc[] = { - { "261-p1s.bin", 0x200000, 0x5a1b5e85, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "261-s1.bin", 0x020000, 0xc1e27cc7, 2 | BRF_GRA }, // 1 Text layer tiles - - { "261-c1_decrypted.bin", 0x800000, 0x9af7cbca, 3 | BRF_GRA }, // 2 Sprite data - { "261-c2_decrypted.bin", 0x800000, 0x2a1f874d, 3 | BRF_GRA }, // 3 - { "261-c3_decrypted.bin", 0x800000, 0x5403adb5, 3 | BRF_GRA }, // 4 - { "261-c4_decrypted.bin", 0x800000, 0x18926df6, 3 | BRF_GRA }, // 5 - - { "261-m1.m1", 0x080000, 0x7d501c39, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "261-v1.v1", 0x400000, 0x64c30081, 5 | BRF_SND }, // 7 Sound data - { "261-v2.v2", 0x400000, 0x392a9c47, 5 | BRF_SND }, // 8 - { "261-v3.v3", 0x400000, 0xc1a7ebe3, 5 | BRF_SND }, // 9 - { "261-v4.v4", 0x200000, 0x9000d085, 5 | BRF_SND }, // 10 -}; - -STDROMPICKEXT(sengoku3s, sengoku3s, neogeo) -STD_ROM_FN(sengoku3s) - -struct BurnDriver BurnDrvSengoku3s = { - "sengoku3s", "sengoku3", "neogeo", NULL, "2001", - "Sengoku 3 / Sengoku Densho 2001 (Evolution 1.0, FCHT hack)\0", NULL, "SNK / Noise Factory", "Neo Geo MVS", - L"Sengoku 3\0\u6226\u56FD\u4F1D\u627F\uFF12\uFF10\uFF10\uFF11 (Evolution 1.0, FCHT hack)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_SCRFIGHT, 0, - NULL, sengoku3sRomInfo, sengoku3sRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 320, 224, 4, 3 -}; - -// World Heroes 2 Jet (ADM-007) -/* MVS VERSION */ - -static struct BurnRomInfo wh2jaRomDesc[] = { - { "064-p1.p1", 0x200000, 0x385a2e86, 1 | BRF_ESS | BRF_PRG }, // 0 68K code / TC5316200 - - { "064-s1.s1", 0x020000, 0x2a03998a, 2 | BRF_GRA }, // 1 Text layer tiles / TC531000 - - { "064-c13.c1", 0x400000, 0x771a6365, 3 | BRF_GRA }, // 2 Sprite data / mask rom TC5332205 - { "064-c24.c2", 0x400000, 0xe7863a05, 3 | BRF_GRA }, // 3 / mask rom TC5332205 - { "064-c57.c3", 0x400000, 0x64594ed4, 3 | BRF_GRA }, // 4 / mask rom TC5332205 - { "064-c68.c4", 0x400000, 0x6e385398, 3 | BRF_GRA }, // 5 / mask rom TC5332205 */ - - { "064-m1.m1", 0x020000, 0xd2eec9d3, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code / TC531001 - - { "064-v1.v1", 0x200000, 0xaa277109, 5 | BRF_SND }, // 7 Sound data / TC5316200 - { "064-v2.v2", 0x200000, 0xb6527edd, 5 | BRF_SND }, // 8 / TC5316200 -}; - -STDROMPICKEXT(wh2ja, wh2ja, neogeo) -STD_ROM_FN(wh2ja) - -struct BurnDriver BurnDrvwh2ja = { - "wh2ja", "wh2j", "neogeo", NULL, "1994", - "World Heroes 2 Jet (ADM-007)\0", NULL, "ADK / SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPP, GBF_VSFIGHT, 0, - NULL, wh2jaRomInfo, wh2jaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Zintrick / Oshidashi Zentrix (Neo CD conversion) - -static struct BurnRomInfo zintrkcdRomDesc[] = { - { "211-p1.bin", 0x100000, 0x9a0bfe0a, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "211-s1.bin", 0x020000, 0x56d16afa, 2 | BRF_GRA }, // 1 Text data - - { "zin-c1.bin", 0x200000, 0x76aee189, 3 | BRF_GRA }, // 2 Sprite data - { "zin-c2.bin", 0x200000, 0x844ed4b3, 3 | BRF_GRA }, // 3 - - { "211-m1.bin", 0x010000, 0xfcae1407, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "211-v1.bin", 0x100000, 0x781439da, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(zintrkcd, zintrkcd, neogeo) -STD_ROM_FN(zintrkcd) - -struct BurnDriver BurnDrvzintrkcd = { - "zintrkcd", "zintrckb", "neogeo", NULL, "1996", - "Zintrick / Oshidashi Zentrix (Neo CD conversion)\0", NULL, "hack", "Neo Geo MVS", - L"Zintrick\0\u62BC\u3057\u51FA\u3057\u30B8\u30F3\u30C8\u30EA\u30C3\u30AF (Neo CD conversion)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, zintrkcdRomInfo, zintrkcdRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// ----------------------------------------------------------------------------- -// Diagnostic Cartridges - -// Neo Geo 4 player test cartridge - -static struct BurnRomInfo fourplayRomDesc[] = { - { "4play_p1.rom", 0x100000, 0x3C3D741B, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "4play_s1.rom", 0x020000, 0xDE828076, 2 | BRF_GRA }, // 1 Text data - - { "4play_c1.rom", 0x020000, 0x7EE8CDCD, 3 | BRF_GRA }, // 2 Sprite data - { "4play_c2.rom", 0x020000, 0x7EE8CDCD, 3 | BRF_GRA }, // 3 - - { "4play_m1.rom", 0x020000, 0x5132580E, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "4play_v1.rom", 0x020000, 0x7EE8CDCD, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(fourplay, fourplay, neogeo) -STD_ROM_FN(fourplay) - -struct BurnDriver BurnDrv4play = { - "4play", NULL, "neogeo", NULL, "???", - "4 player input test\0", "4 player input test cartridge", "SNK", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 4, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_4_JOYSTICKS, GBF_MISC, 0, - NULL, fourplayRomInfo, fourplayRomName, NULL, NULL, neodualInputInfo, neodualDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// ----------------------------------------------------------------------------- -// Demos and Homebrew - -// Shadow of the Beast (Neo Geo demo) - -static struct BurnRomInfo beastRomDesc[] = { - { "2002-p1.bin", 0x080000, 0x1f9e62a4, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "2002-s1.bin", 0x020000, 0x05a417f5, 2 | BRF_GRA }, // 1 Text layer tiles - - { "2002-c1.bin", 0x080000, 0xe1974741, 3 | BRF_GRA }, // 2 Sprite data - { "2002-c2.bin", 0x080000, 0x9f5b9cf6, 3 | BRF_GRA }, // 3 - - { "nnp-m1.rom", 0x010000, 0x7669de64, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "nnp-v1.rom", 0x080000, 0x504bf849, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(beast, beast, neogeo) -STD_ROM_FN(beast) - -struct BurnDriver BurnDrvbeast = { - "beast", NULL, "neogeo", NULL, "????", - "Shadow of the Beast (Neo Geo demo)\0", NULL, "Jeff Kurtz", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, beastRomInfo, beastRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Codename - Blut Engel (2006-01-19) - -static struct BurnRomInfo cnbeRomDesc[] = { - { "cnbe-p1.bin", 0x080000, 0x7ece4186, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "cnbe-s1.bin", 0x010000, 0x40a4698f, 2 | BRF_GRA }, // 1 Text layer tiles - - { "cnbe-c1.bin", 0x100000, 0x0f4fea6f, 3 | BRF_GRA }, // 2 Sprite data - { "cnbe-c2.bin", 0x100000, 0x3d5fc36f, 3 | BRF_GRA }, // 3 - - { "cnbe-m1.bin", 0x020000, 0xa5821c9c, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "cnbe-v1.bin", 0x080000, 0x70191764, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(cnbe, cnbe, neogeo) -STD_ROM_FN(cnbe) - -struct BurnDriver BurnDrvcnbe = { - "cnbe", NULL, "neogeo", NULL, "2006", - "Codename - Blut Engel (2006-01-19)\0", NULL, "blastar@gmx.net", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_VERSHOOT, 0, - NULL, cnbeRomInfo, cnbeRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Columns (Neo Geo) - -static struct BurnRomInfo columnsnRomDesc[] = { - { "2000-p1.bin", 0x080000, 0xc6c9888d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "2000-s1.bin", 0x020000, 0x089a28a8, 2 | BRF_GRA }, // 1 Text layer tiles - - { "2000-c1.bin", 0x080000, 0x9a579cab, 3 | BRF_GRA }, // 2 Sprite data - { "2000-c2.bin", 0x080000, 0x91d14043, 3 | BRF_GRA }, // 3 - - { "nnp-m1.rom", 0x010000, 0x7669de64, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "nnp-v1.rom", 0x080000, 0x504bf849, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(columnsn, columnsn, neogeo) -STD_ROM_FN(columnsn) - -struct BurnDriver BurnDrvcolumnsn = { - "columnsn", NULL, "neogeo", NULL, "????", - "Columns (Neo Geo)\0", NULL, "homebrew", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, columnsnRomInfo, columnsnRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Jonas Indiana and the Lost Temple of RA (20050717) - -static struct BurnRomInfo ltorb1RomDesc[] = { - { "nnp-p1.rom", 0x040000, 0x353f6b05, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "nnp-s1.rom", 0x010000, 0x8224d8b7, 2 | BRF_GRA }, // 1 Text layer tiles - - { "nnp-c1.rom", 0x080000, 0x8b607198, 3 | BRF_GRA }, // 2 Sprite data - { "nnp-c2.rom", 0x080000, 0x6b96b59c, 3 | BRF_GRA }, // 3 - - { "nnp-m1.rom", 0x010000, 0x6847fd52, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "nnp-v1.rom", 0x080000, 0x0329c2e7, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(ltorb1, ltorb1, neogeo) -STD_ROM_FN(ltorb1) - -struct BurnDriver BurnDrvltorb1 = { - "ltorb1", NULL, "neogeo", NULL, "2005", - "Jonas Indiana and the Lost Temple of RA (20050717)\0", NULL, "blastar@gmx.net", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_PLATFORM, 0, - NULL, ltorb1RomInfo, ltorb1RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo 2500 Demo - -static struct BurnRomInfo neo2500RomDesc[] = { - { "2500-p1.bin", 0x080000, 0x2321c0d8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "2500-s1.bin", 0x010000, 0x1a37925c, 2 | BRF_GRA }, // 1 Text layer tiles - - { "2500-c1.bin", 0x080000, 0x8c304b56, 3 | BRF_GRA }, // 2 Sprite data - { "2500-c2.bin", 0x080000, 0x9a0758d6, 3 | BRF_GRA }, // 3 - - { "202-m1.bin", 0x020000, 0x9c0291ea, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "202-v1.bin", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neo2500, neo2500, neogeo) -STD_ROM_FN(neo2500) - -struct BurnDriver BurnDrvneo2500 = { - "neo2500", NULL, "neogeo", NULL, "2004", - "Neo 2500 Demo\0", NULL, "blastar@gmx.net", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, neo2500RomInfo, neo2500RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo Demo -static struct BurnRomInfo neodemoRomDesc[] = { - { "demo-p1.bin", 0x080000, 0xfbfce2a4, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "demo-s1.bin", 0x020000, 0xcd19264f, 2 | BRF_GRA }, // 1 Text layer tiles - - { "demo-c1.bin", 0x100000, 0x870b28ea, 3 | BRF_GRA }, // 2 Sprite data - { "demo-c2.bin", 0x100000, 0x1ecf8128, 3 | BRF_GRA }, // 3 - - { "202-m1.bin", 0x020000, 0x9c0291ea, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "202-v1.bin", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neodemo, neodemo, neogeo) -STD_ROM_FN(neodemo) - -struct BurnDriver BurnDrvneodemo = { - "neodemo", NULL, "neogeo", NULL, "2002", - "Chaos Demo (Neo Geo)\0", NULL, "Chaos", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, neodemoRomInfo, neodemoRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo No Panepon (beta) - -static struct BurnRomInfo neonoponRomDesc[] = { - { "nnp-p1.rom", 0x080000, 0x8a792271, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "nnp-s1.rom", 0x010000, 0x93e6fe7d, 2 | BRF_GRA }, // 1 Text layer tiles - - { "nnp-c1.rom", 0x100000, 0x4a718ae3, 3 | BRF_GRA }, // 2 Sprite data - { "nnp-c2.rom", 0x100000, 0x0e2cbc25, 3 | BRF_GRA }, // 3 - - { "nnp-m1.rom", 0x010000, 0x7669de64, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "nnp-v1.rom", 0x080000, 0x504bf849, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neonopon, neonopon, neogeo) -STD_ROM_FN(neonopon) - -struct BurnDriver BurnDrvneonopon = { - "neonopon", NULL, "neogeo", NULL, "????", - "Neo No Panepon (beta)\0", NULL, "blastar@gmx.net", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, neonoponRomInfo, neonoponRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo Pong - -static struct BurnRomInfo neopongRomDesc[] = { - { "pong_p1.rom", 0x020000, 0x9f35e29d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "pong_s1.rom", 0x020000, 0xcd19264f, 2 | BRF_GRA }, // 1 Text layer tiles - - { "pong_c1.rom", 0x100000, 0xf5a57d1a, 3 | BRF_GRA }, // 2 Sprite data - { "pong_c2.rom", 0x100000, 0xaffde64e, 3 | BRF_GRA }, // 3 - - { "pong_m1.rom", 0x020000, 0x78c851cb, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "pong_v1.rom", 0x200000, 0x6c31223c, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neopong, neopong, neogeo) -STD_ROM_FN(neopong) - -struct BurnDriver BurnDrvneopong = { - "neopong", NULL, "neogeo", NULL, "2002", - "Neo Pong (ver 1.1)\0", NULL, "Neo Dev Corporation", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_BALLPADDLE, 0, - NULL, neopongRomInfo, neopongRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo Pong (v1.0) - -static struct BurnRomInfo neopongaRomDesc[] = { - { "np10_p1.rom", 0x020000, 0x31b724d7, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "pong_s1.rom", 0x020000, 0xcd19264f, 2 | BRF_GRA }, // 1 Text layer tiles - - { "np10_c1.rom", 0x100000, 0xd7587282, 3 | BRF_GRA }, // 2 Sprite data - { "np10_c2.rom", 0x100000, 0xfefc9d06, 3 | BRF_GRA }, // 3 - - { "np10_m1.rom", 0x020000, 0x9c0291ea, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "np10_v1.rom", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neoponga, neoponga, neogeo) -STD_ROM_FN(neoponga) - -static INT32 neopongaInit() -{ - bDisableNeoWatchdog = true; - - return NeoInit(); -} - -struct BurnDriver BurnDrvneoponga = { - "neoponga", "neopong", "neogeo", NULL, "2002", - "Neo Pong (ver 1.0)\0", NULL, "Neo Dev Corporation", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_BALLPADDLE, 0, - NULL, neopongaRomInfo, neopongaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - neopongaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// NGEM2K (beta 2006-01-18) - -static struct BurnRomInfo ngem2kRomDesc[] = { - { "ngem-p1.bin", 0x080000, 0xf2c42fe3, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "ngem-s1.bin", 0x010000, 0xfb3c02d2, 2 | BRF_GRA }, // 1 Text layer tiles - - { "ngem-c1.bin", 0x100000, 0xa8e2ab47, 3 | BRF_GRA }, // 2 Sprite data - { "ngem-c2.bin", 0x100000, 0xa738ea1c, 3 | BRF_GRA }, // 3 - - { "ngem-m1.bin", 0x020000, 0xb1f44a15, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "ngem-v1.bin", 0x080000, 0xc32199f0, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(ngem2k, ngem2k, neogeo) -STD_ROM_FN(ngem2k) - -struct BurnDriver BurnDrvngem2k = { - "ngem2k", NULL, "neogeo", NULL, "2006", - "NGEM2K (beta 2006-01-18)\0", NULL, "homebrew", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_PUZZLE, 0, - NULL, ngem2kRomInfo, ngem2kRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo Frog Feast - -static struct BurnRomInfo ngfrogRomDesc[] = { - { "frg-p1.bin", 0x080000, 0xc26848da, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "frg-s1.bin", 0x020000, 0x88f4cd13, 2 | BRF_GRA }, // 1 Text layer tiles - - { "frg-c1.bin", 0x100000, 0x7b2f9fb3, 3 | BRF_GRA }, // 2 Sprite data - { "frg-c2.bin", 0x100000, 0xa7f18a6f, 3 | BRF_GRA }, // 3 - { "frg-c3.bin", 0x100000, 0x956bac74, 3 | BRF_GRA }, // 4 - { "frg-c4.bin", 0x100000, 0x956bac74, 3 | BRF_GRA }, // 5 - - { "frg-m1.bin", 0x020000, 0xc825b484, 4 | BRF_ESS | BRF_PRG }, // 6 Z80 code - - { "frg-v1.bin", 0x100000, 0x2639da11, 5 | BRF_SND }, // 7 Sound data - { "frg-v2.bin", 0x100000, 0xe5eda58b, 5 | BRF_SND }, // 8 -}; - -STDROMPICKEXT(ngfrog, ngfrog, neogeo) -STD_ROM_FN(ngfrog) - -struct BurnDriver BurnDrvngfrog = { - "ngfrog", NULL, "neogeo", NULL, "2006", - "Frog Feast (Neo Geo)\0", NULL, "Rastersoft", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, ngfrogRomInfo, ngfrogRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Poker Night - -static struct BurnRomInfo poknightRomDesc[] = { - { "2003-p1.bin", 0x080000, 0x750421ee, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "2003-s1.bin", 0x020000, 0xa26d2f09, 2 | BRF_GRA }, // 1 Text layer tiles - - { "2003-c1.bin", 0x080000, 0x5fb2b761, 3 | BRF_GRA }, // 2 Sprite data - { "2003-c2.bin", 0x080000, 0xf2b570e3, 3 | BRF_GRA }, // 3 - - { "nnp-m1.rom", 0x010000, 0x7669de64, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "nnp-v1.rom", 0x080000, 0x504bf849, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(poknight, poknight, neogeo) -STD_ROM_FN(poknight) - -struct BurnDriver BurnDrvpoknight = { - "poknight", NULL, "neogeo", NULL, "????", - "Poker Night\0", NULL, "Jeff Kurtz", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_CASINO, 0, - NULL, poknightRomInfo, poknightRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Neo System Check (ver 1.0b) - -static struct BurnRomInfo syscheckRomDesc[] = { - { "sys-p1.rom", 0x080000, 0xa4adbe1e, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "sys-s1.rom", 0x010000, 0x4774f28e, 2 | BRF_GRA }, // 1 Text layer tiles - - { "sys-c1.rom", 0x080000, 0x75660aac, 3 | BRF_GRA }, // 2 Sprite data - { "sys-c2.rom", 0x080000, 0x75660aac, 3 | BRF_GRA }, // 3 - - { "sys-m1.rom", 0x010000, 0x7669de64, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "sys-v1.rom", 0x080000, 0x504bf849, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(syscheck, syscheck, neogeo) -STD_ROM_FN(syscheck) - -struct BurnDriver BurnDrvsyscheck = { - "syscheck", NULL, "neogeo", NULL, "????", - "Neo System Check (ver 1.0b)\0", NULL, "blastar@gmx.net", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, syscheckRomInfo, syscheckRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Chip n Dale (Intro demo) - -static struct BurnRomInfo cndiRomDesc[] = { - { "cnd-p1.bin", 0x800000, 0x2df9a41d, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "cnd-s1.bin", 0x010000, 0x63b8b25e, 2 | BRF_GRA }, // 1 Text layer tiles - - { "cnd-c1.bin", 0x400000, 0x55bd32fc, 3 | BRF_GRA }, // 2 Sprite data - { "cnd-c2.bin", 0x400000, 0xbbb43733, 3 | BRF_GRA }, // 3 - { "cnd-c3.bin", 0x400000, 0x715e0318, 3 | BRF_GRA }, // 4 - { "cnd-c4.bin", 0x400000, 0x016f3c7e, 3 | BRF_GRA }, // 5 - { "cnd-c5.bin", 0x400000, 0x28c6cb8c, 3 | BRF_GRA }, // 6 - { "cnd-c6.bin", 0x400000, 0x9c89503f, 3 | BRF_GRA }, // 7 - { "cnd-c7.bin", 0x400000, 0x074dd407, 3 | BRF_GRA }, // 8 - { "cnd-c8.bin", 0x400000, 0x5ddb7db5, 3 | BRF_GRA }, // 9 - - { "cnd-m1.bin", 0x002000, 0xae120a59, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "cnd-v1.bin", 0x092000, 0x91d45537, 5 | BRF_SND }, // 11 Sound data -}; - -STDROMPICKEXT(cndi, cndi, neogeo) -STD_ROM_FN(cndi) - -struct BurnDriver BurnDrvcndi = { - "cndi", NULL, "neogeo", NULL, "2009", - "Chip n Dale (Intro demo)\0", "You must use the Universe BIOS and set region to Japan AES", "Sergi", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, cndiRomInfo, cndiRomName, NULL, NULL, neogeoInputInfo, neogeouniDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// DarkWing Duck (Intro demo) - -static struct BurnRomInfo dwiRomDesc[] = { - { "dwi-p1.bin", 0x800000, 0x8e3f2ea8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "dwi-s1.bin", 0x010000, 0x3dc5c1ef, 2 | BRF_GRA }, // 1 Text layer tiles - - { "dwi-c1.bin", 0x400000, 0x2b8bda94, 3 | BRF_GRA }, // 2 Sprite data - { "dwi-c2.bin", 0x400000, 0x5345e4de, 3 | BRF_GRA }, // 3 - { "dwi-c3.bin", 0x400000, 0xc6185f14, 3 | BRF_GRA }, // 4 - { "dwi-c4.bin", 0x400000, 0xc9e59701, 3 | BRF_GRA }, // 5 - { "dwi-c5.bin", 0x400000, 0x42dd1c90, 3 | BRF_GRA }, // 6 - { "dwi-c6.bin", 0x400000, 0x9fa6d651, 3 | BRF_GRA }, // 7 - { "dwi-c7.bin", 0x400000, 0x5cfa6886, 3 | BRF_GRA }, // 8 - { "dwi-c8.bin", 0x400000, 0x59c37871, 3 | BRF_GRA }, // 9 - - { "dwi-m1.bin", 0x002000, 0x2249e065, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "dwi-v1.bin", 0x09b000, 0x13bb4ce4, 5 | BRF_SND }, // 11 Sound data -}; - -STDROMPICKEXT(dwi, dwi, neogeo) -STD_ROM_FN(dwi) - -struct BurnDriver BurnDrvdwi = { - "dwi", NULL, "neogeo", NULL, "2009", - "DarkWing Duck (Intro demo)\0", "You must use the Universe BIOS and set region to Japan AES", "Sergi", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, dwiRomInfo, dwiRomName, NULL, NULL, neogeoInputInfo, neogeouniDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// DarkWing Duck (Intro demo, alt) - -static struct BurnRomInfo dwiaRomDesc[] = { - { "dwi-p1.bin", 0x800000, 0x8e3f2ea8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "dwi-s1a.bin", 0x010000, 0x63b8b25e, 2 | BRF_GRA }, // 1 Text layer tiles - - { "dwi-c1.bin", 0x400000, 0x2b8bda94, 3 | BRF_GRA }, // 2 Sprite data - { "dwi-c2.bin", 0x400000, 0x5345e4de, 3 | BRF_GRA }, // 3 - { "dwi-c3.bin", 0x400000, 0xc6185f14, 3 | BRF_GRA }, // 4 - { "dwi-c4.bin", 0x400000, 0xc9e59701, 3 | BRF_GRA }, // 5 - { "dwi-c5.bin", 0x400000, 0x42dd1c90, 3 | BRF_GRA }, // 6 - { "dwi-c6.bin", 0x400000, 0x9fa6d651, 3 | BRF_GRA }, // 7 - { "dwi-c7.bin", 0x400000, 0x5cfa6886, 3 | BRF_GRA }, // 8 - { "dwi-c8.bin", 0x400000, 0x59c37871, 3 | BRF_GRA }, // 9 - - { "dwi-m1a.bin", 0x002000, 0xb9f8df96, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "dwi-v1.bin", 0x09b000, 0x13bb4ce4, 5 | BRF_SND }, // 11 Sound data -}; - -STDROMPICKEXT(dwia, dwia, neogeo) -STD_ROM_FN(dwia) - -struct BurnDriver BurnDrvdwia = { - "dwia", "dwi", "neogeo", NULL, "2009", - "DarkWing Duck (Intro demo, alt)\0", "You must use the Universe BIOS and set region to Japan AES", "Sergi", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, dwiaRomInfo, dwiaRomName, NULL, NULL, neogeoInputInfo, neogeouniDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Duck Tales (Intro demo) - -static struct BurnRomInfo duckiRomDesc[] = { - { "duck-p1.bin", 0x800000, 0xf975711c, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "duck-s1.bin", 0x010000, 0x63b8b25e, 2 | BRF_GRA }, // 1 Text layer tiles - - { "duck-c1.bin", 0x400000, 0x02adabba, 3 | BRF_GRA }, // 2 Sprite data - { "duck-c2.bin", 0x400000, 0x00bd87ac, 3 | BRF_GRA }, // 3 - { "duck-c3.bin", 0x400000, 0x263307c8, 3 | BRF_GRA }, // 4 - { "duck-c4.bin", 0x400000, 0xb8330c1e, 3 | BRF_GRA }, // 5 - { "duck-c5.bin", 0x400000, 0xce99fcb8, 3 | BRF_GRA }, // 6 - { "duck-c6.bin", 0x400000, 0xa6d30781, 3 | BRF_GRA }, // 7 - { "duck-c7.bin", 0x400000, 0xeda15323, 3 | BRF_GRA }, // 8 - { "duck-c8.bin", 0x400000, 0x400fd4cd, 3 | BRF_GRA }, // 9 - - { "duck-m1.bin", 0x002000, 0x7761d993, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "duck-v1.bin", 0x090200, 0x24b716ee, 5 | BRF_SND }, // 11 Sound data -}; - -STDROMPICKEXT(ducki, ducki, neogeo) -STD_ROM_FN(ducki) - -struct BurnDriver BurnDrvducki = { - "ducki", NULL, "neogeo", NULL, "2009", - "Duck Tales (Intro demo)\0", "You must use the Universe BIOS and set region to Japan AES", "Sergi", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, duckiRomInfo, duckiRomName, NULL, NULL, neogeoInputInfo, neogeouniDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Ghost Busters (Intro demo) - -static struct BurnRomInfo ghostbiRomDesc[] = { - { "ghostb-p1.bin", 0x100000, 0xaf69ef5f, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "ghostb-p2.bin", 0x400000, 0xf57e393f, 1 | BRF_ESS | BRF_PRG }, // 1 68K code - - { "ghostb-s1.bin", 0x010000, 0x63b8b25e, 2 | BRF_GRA }, // 2 Text layer tiles - - { "ghostb-c1.bin", 0x400000, 0x4281fecd, 3 | BRF_GRA }, // 3 Sprite data - { "ghostb-c2.bin", 0x400000, 0x0f07018c, 3 | BRF_GRA }, // 4 - { "ghostb-c3.bin", 0x400000, 0xa4589b2a, 3 | BRF_GRA }, // 5 - { "ghostb-c4.bin", 0x400000, 0x2a72bd04, 3 | BRF_GRA }, // 6 - { "ghostb-c5.bin", 0x400000, 0xad3b72f9, 3 | BRF_GRA }, // 7 - { "ghostb-c6.bin", 0x400000, 0x963e0941, 3 | BRF_GRA }, // 8 - - { "ghostb-m1.bin", 0x002000, 0x6624e642, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "ghostb-v1.bin", 0x094a00, 0x44864761, 5 | BRF_SND }, // 10 Sound data -}; - -STDROMPICKEXT(ghostbi, ghostbi, neogeo) -STD_ROM_FN(ghostbi) - -struct BurnDriver BurnDrvghostbi = { - "ghostbi", NULL, "neogeo", NULL, "2009", - "Ghost Busters (Intro demo)\0", "You must use the Universe BIOS and set region to Japan AES", "Sergi", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, ghostbiRomInfo, ghostbiRomName, NULL, NULL, neogeoInputInfo, neogeouniDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Robocop (Intro demo) - -static struct BurnRomInfo robocopiRomDesc[] = { - { "robo-p1.bin", 0x800000, 0xadcb4fe0, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "robo-s1.bin", 0x010000, 0x63b8b25e, 2 | BRF_GRA }, // 1 Text layer tiles - - { "robo-c1.bin", 0x400000, 0x8cf565a0, 3 | BRF_GRA }, // 2 Sprite data - { "robo-c2.bin", 0x400000, 0x76ef561d, 3 | BRF_GRA }, // 3 - { "robo-c3.bin", 0x400000, 0x7166790c, 3 | BRF_GRA }, // 4 - { "robo-c4.bin", 0x400000, 0xc0cdcbfc, 3 | BRF_GRA }, // 5 - { "robo-c5.bin", 0x400000, 0xa5ddc363, 3 | BRF_GRA }, // 6 - { "robo-c6.bin", 0x400000, 0x1fcc8fce, 3 | BRF_GRA }, // 7 - { "robo-c7.bin", 0x400000, 0xbe9f9da2, 3 | BRF_GRA }, // 8 - { "robo-c8.bin", 0x400000, 0x7cff633a, 3 | BRF_GRA }, // 9 - - { "robo-m1.bin", 0x002000, 0xc4d35e83, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "robo-v1.bin", 0x096000, 0xecb284a9, 5 | BRF_SND }, // 11 Sound data -}; - -STDROMPICKEXT(robocopi, robocopi, neogeo) -STD_ROM_FN(robocopi) - -struct BurnDriver BurnDrvrobocopi = { - "robocopi", NULL, "neogeo", NULL, "2009", - "Robocop (Intro demo)\0", "You must use the Universe BIOS and set region to Japan AES", "Sergi", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, robocopiRomInfo, robocopiRomName, NULL, NULL, neogeoInputInfo, neogeouniDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Spiderman (Intro demo) - -static struct BurnRomInfo spidermiRomDesc[] = { - { "sman-p1.bin", 0x100000, 0x66b5cfe8, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - { "sman-p2.bin", 0x400000, 0x72082aea, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "sman-s1.bin", 0x010000, 0x63b8b25e, 2 | BRF_GRA }, // 2 Text layer tiles - - { "sman-c1.bin", 0x400000, 0x8e5ccfdd, 3 | BRF_GRA }, // 3 Sprite data - { "sman-c2.bin", 0x400000, 0xa6406f5b, 3 | BRF_GRA }, // 4 - { "sman-c3.bin", 0x400000, 0xadfff926, 3 | BRF_GRA }, // 5 - { "sman-c4.bin", 0x400000, 0x068c307f, 3 | BRF_GRA }, // 6 - { "sman-c5.bin", 0x400000, 0x9a5cf7a6, 3 | BRF_GRA }, // 7 - { "sman-c6.bin", 0x400000, 0x934f03c0, 3 | BRF_GRA }, // 8 - - { "sman-m1.bin", 0x002000, 0x6a02cb1d, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code - - { "sman-v1.bin", 0x096100, 0x95c138da, 5 | BRF_SND }, // 10 Sound data -}; - -STDROMPICKEXT(spidermi, spidermi, neogeo) -STD_ROM_FN(spidermi) - -struct BurnDriver BurnDrvspidermi = { - "spidermi", NULL, "neogeo", NULL, "2009", - "Spiderman (Intro demo)\0", "You must use the Universe BIOS and set region to Japan AES", "Sergi", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, spidermiRomInfo, spidermiRomName, NULL, NULL, neogeoInputInfo, neogeouniDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Teenage Mutant Ninja Turtles (Intro demo) - -static struct BurnRomInfo tmntiRomDesc[] = { - { "tmnt-p1.bin", 0x800000, 0x2d5066ff, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "tmnt-s1.bin", 0x010000, 0x3dc5c1ef, 2 | BRF_GRA }, // 1 Text layer tiles - - { "tmnt-c1.bin", 0x400000, 0xae1735c1, 3 | BRF_GRA }, // 2 Sprite data - { "tmnt-c2.bin", 0x400000, 0x344281b5, 3 | BRF_GRA }, // 3 - { "tmnt-c3.bin", 0x400000, 0x1058a648, 3 | BRF_GRA }, // 4 - { "tmnt-c4.bin", 0x400000, 0x1c6ba1b0, 3 | BRF_GRA }, // 5 - { "tmnt-c5.bin", 0x400000, 0x73a89fb0, 3 | BRF_GRA }, // 6 - { "tmnt-c6.bin", 0x400000, 0xa139246a, 3 | BRF_GRA }, // 7 - { "tmnt-c7.bin", 0x400000, 0xed957842, 3 | BRF_GRA }, // 8 - { "tmnt-c8.bin", 0x400000, 0x8c15d91b, 3 | BRF_GRA }, // 9 - - { "tmnt-m1.bin", 0x002000, 0x953542ef, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "tmnt-v1.bin", 0x094900, 0x273640c3, 5 | BRF_SND }, // 11 Sound data -}; - -STDROMPICKEXT(tmnti, tmnti, neogeo) -STD_ROM_FN(tmnti) - -struct BurnDriver BurnDrvtmnti = { - "tmnti", NULL, "neogeo", NULL, "2009", - "Teenage Mutant Ninja Turtles (Intro demo)\0", "You must use the Universe BIOS and set region to Japan AES", "Sergi", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, tmntiRomInfo, tmntiRomName, NULL, NULL, neogeoInputInfo, neogeouniDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// Teenage Mutant Ninja Turtles (Intro demo, alt) - -static struct BurnRomInfo tmntiaRomDesc[] = { - { "tmnt-p1a.bin", 0x800000, 0xed4f5fec, 1 | BRF_ESS | BRF_PRG }, // 0 68K code - - { "tmnt-s1.bin", 0x010000, 0x3dc5c1ef, 2 | BRF_GRA }, // 1 Text layer tiles - - { "tmnt-c1.bin", 0x400000, 0xae1735c1, 3 | BRF_GRA }, // 2 Sprite data - { "tmnt-c2.bin", 0x400000, 0x344281b5, 3 | BRF_GRA }, // 3 - { "tmnt-c3.bin", 0x400000, 0x1058a648, 3 | BRF_GRA }, // 4 - { "tmnt-c4.bin", 0x400000, 0x1c6ba1b0, 3 | BRF_GRA }, // 5 - { "tmnt-c5.bin", 0x400000, 0x73a89fb0, 3 | BRF_GRA }, // 6 - { "tmnt-c6.bin", 0x400000, 0xa139246a, 3 | BRF_GRA }, // 7 - { "tmnt-c7.bin", 0x400000, 0xed957842, 3 | BRF_GRA }, // 8 - { "tmnt-c8.bin", 0x400000, 0x8c15d91b, 3 | BRF_GRA }, // 9 - - { "tmnt-m1.bin", 0x002000, 0x953542ef, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code - - { "tmnt-v1.bin", 0x094900, 0x273640c3, 5 | BRF_SND }, // 11 Sound data -}; - -STDROMPICKEXT(tmntia, tmntia, neogeo) -STD_ROM_FN(tmntia) - -struct BurnDriver BurnDrvtmntia = { - "tmntia", "tmnti", "neogeo", NULL, "2009", - "Teenage Mutant Ninja Turtles (Intro demo, alt)\0", "You must use the Universe BIOS and set region to Japan AES", "Sergi", "Neo Geo MVS", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_DEMO, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, tmntiaRomInfo, tmntiaRomName, NULL, NULL, neogeoInputInfo, neogeouniDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Neo Thunder - -static struct BurnRomInfo neothndrRomDesc[] = { - { "thund_p1.rom", 0x100000, 0xF7050757, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "thund_s1.rom", 0x020000, 0xA545B593, 2 | BRF_GRA }, // 1 Text data - - { "thund_c1.rom", 0x100000, 0x48B9126E, 3 | BRF_GRA }, // 2 Sprite data - { "thund_c2.rom", 0x100000, 0x214DF62E, 3 | BRF_GRA }, // 3 - - { "thund_m1.rom", 0x020000, 0x9C0291EA, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "thund_v1.rom", 0x080000, 0xDEBEB8FB, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neothndr, neothndr, neogeo) -STD_ROM_FN(neothndr) - -struct BurnDriver BurnDrvneothndr = { - "neothndr", NULL, "neogeo", NULL, "2012", - "Neo Thunder\0", "sebastianmihai.com", "Sebastian Mihai", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_HORSHOOT, 0, - NULL, neothndrRomInfo, neothndrRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// NGF Transparency Demo - -static struct BurnRomInfo ngftdemoRomDesc[] = { - { "ngftd_p1.rom", 0x080000, 0x84d87190, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "ngftd_s1.rom", 0x020000, 0xa545b593, 2 | BRF_GRA }, // 1 Text data - - { "ngftd_c1.rom", 0x200000, 0xb2fba994, 3 | BRF_GRA }, // 2 Sprite data - { "ngftd_c2.rom", 0x200000, 0x37495ab2, 3 | BRF_GRA }, // 3 - - { "ngftd_m1.rom", 0x020000, 0x5ea216be, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "ngftd_v1.rom", 0x200000, 0xd03c87eb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(ngftdemo, ngftdemo, neogeo) -STD_ROM_FN(ngftdemo) - -struct BurnDriver BurnDrvngftdemo = { - "ngftdemo", NULL, "neogeo", NULL, "2012", - "NGF Transparency Demo\0", "redarmor.net", "CeL", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, ngftdemoRomInfo, ngftdemoRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Neo CastleVania Demo - -static struct BurnRomInfo neocstlvRomDesc[] = { - { "cstlv_p1.rom", 0x080000, 0x8d6cd9f2, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "cstlv_s1.rom", 0x040000, 0xbe950195, 2 | BRF_GRA }, // 1 Text data - - { "cstlv_c1.rom", 0x100000, 0x960a7414, 3 | BRF_GRA }, // 2 Sprite data - { "cstlv_c2.rom", 0x100000, 0x24a961d0, 3 | BRF_GRA }, // 3 - - { "cstlv_m1.rom", 0x020000, 0x89c71460, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "cstlv_v1.rom", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neocstlv, neocstlv, neogeo) -STD_ROM_FN(neocstlv) - -struct BurnDriver BurnDrvneocstlv = { - "neocstlv", NULL, "neogeo", NULL, "2004", - "Neo CastleVania Demo\0", NULL, "Barf/BarfHappy", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, neocstlvRomInfo, neocstlvRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - -// NeoGeo 3D! Demo - -static struct BurnRomInfo neo3ddmoRomDesc[] = { - { "neo3d_p1.rom", 0x080000, 0x791f6042, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "neo3d_s1.rom", 0x020000, 0xcd19264f, 2 | BRF_GRA }, // 1 Text data - - { "neo3d_c1.rom", 0x100000, 0xa7eaca76, 3 | BRF_GRA }, // 2 Sprite data - { "neo3d_c2.rom", 0x100000, 0x042f2cde, 3 | BRF_GRA }, // 3 - - { "neo3d_m1.rom", 0x020000, 0x7e74cc1f, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "neo3d_v1.rom", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neo3ddmo, neo3ddmo, neogeo) -STD_ROM_FN(neo3ddmo) - -struct BurnDriver BurnDrvneo3ddmo = { - "neo3ddmo", NULL, "neogeo", NULL, "2012", - "NeoGeo 3D! Demo\0", NULL, "Oxygene", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, neo3ddmoRomInfo, neo3ddmoRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// WW2 Demo - Arcade Development Project - -static struct BurnRomInfo neoww2RomDesc[] = { - { "ww2_p1.rom", 0x080000, 0xd53762ff, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "ww2_s1.rom", 0x010000, 0x3fda5d1a, 2 | BRF_GRA }, // 1 Text data - - { "ww2_c1.rom", 0x100000, 0x955efd3e, 3 | BRF_GRA }, // 2 Sprite data - { "ww2_c2.rom", 0x100000, 0xc213940f, 3 | BRF_GRA }, // 3 - - { "ww2_m1.rom", 0x020000, 0x99c2354e, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "ww2_v1.rom", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neoww2, neoww2, neogeo) -STD_ROM_FN(neoww2) - -struct BurnDriver BurnDrvneoww2 = { - "neoww2", NULL, "neogeo", NULL, "2012", - "WW2 Demo - Arcade Development Project\0", NULL, "Charles DOTY/RasterSoft (USA)", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, neoww2RomInfo, neoww2RomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Time's UP Demo - -static struct BurnRomInfo timesupdRomDesc[] = { - { "tup_p1.rom", 0x200000, 0xbe86adb1, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "tup_s1.rom", 0x020000, 0xa545b593, 2 | BRF_GRA }, // 1 Text data - - { "tup_c1.rom", 0x200000, 0xc19a300a, 3 | BRF_GRA }, // 2 Sprite data - { "tup_c2.rom", 0x200000, 0xfdb3f7ed, 3 | BRF_GRA }, // 3 - - { "tup_m1.rom", 0x020000, 0xfe795d11, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "tup_v1.rom", 0x400000, 0x13b8f47b, 5 | BRF_SND }, // 5 Sound data - { "tup_v2.rom", 0x400000, 0x6fdd663d, 5 | BRF_SND }, // 6 Sound data -}; - -STDROMPICKEXT(timesupd, timesupd, neogeo) -STD_ROM_FN(timesupd) - -struct BurnDriver BurnDrvtimesupd = { - "timesupd", NULL, "neogeo", NULL, "2012", - "Time's Up Demo\0", NULL, "NGF Dev. Inc.", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, timesupdRomInfo, timesupdRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Galaga Demo (set 1) - -static struct BurnRomInfo neogalagRomDesc[] = { - { "gal_p1.rom", 0x100000, 0x7226db5c, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "gal_s1.rom", 0x002000, 0x90557449, 2 | BRF_GRA }, // 1 Text data - - { "gal_c1.rom", 0x100000, 0x6de8c6f6, 3 | BRF_GRA }, // 2 Sprite data - { "gal_c2.rom", 0x100000, 0xfa5f0c1d, 3 | BRF_GRA }, // 3 - - { "gal_m1.rom", 0x020000, 0x9c0291ea, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "gal_v1.rom", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neogalag, neogalag, neogeo) -STD_ROM_FN(neogalag) - -struct BurnDriver BurnDrvneogalag = { - "neogalag", NULL, "neogeo", NULL, "2013", - "Galaga Demo (set 1)\0", NULL, "Cristiano Bei/www.iocerom.com", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, neogalagRomInfo, neogalagRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Galaga Demo (set 2) - -static struct BurnRomInfo neogalagaRomDesc[] = { - { "gal_p1a.rom", 0x100000, 0x01dc85fd, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "gal_s1.rom", 0x002000, 0x90557449, 2 | BRF_GRA }, // 1 Text data - - { "gal_c1a.rom", 0x100000, 0xf8221e34, 3 | BRF_GRA }, // 2 Sprite data - { "gal_c2a.rom", 0x100000, 0xc30cf1fc, 3 | BRF_GRA }, // 3 - - { "gal_m1.rom", 0x020000, 0x9c0291ea, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "gal_v1.rom", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neogalaga, neogalaga, neogeo) -STD_ROM_FN(neogalaga) - -struct BurnDriver BurnDrvneogalaga = { - "neogalaga", "neogalag", "neogeo", NULL, "2013", - "Galaga Demo (set 2)\0", NULL, "Cristiano Bei/www.iocerom.com", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, neogalagaRomInfo, neogalagaRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// NeoGeo 2-Player Tetris - -static struct BurnRomInfo neotetRomDesc[] = { - { "tet_p1.rom", 0x080000, 0x3465569a, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "tet_s1.rom", 0x020000, 0xa545b593, 2 | BRF_GRA }, // 1 Text data - - { "tet_c1.rom", 0x080000, 0xacc6d1d4, 3 | BRF_GRA }, // 2 Sprite data - { "tet_c2.rom", 0x080000, 0x7ec06ab5, 3 | BRF_GRA }, // 3 - - { "tet_m1.rom", 0x020000, 0x6b3703c6, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "tet_v1.rom", 0x080000, 0x2be8e290, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neotet, neotet, neogeo) -STD_ROM_FN(neotet) - -struct BurnDriver BurnDrvneotet = { - "neotet", NULL, "neogeo", NULL, "2013", - "NeoGeo 2-Player Tetris\0", NULL, "Crim/Stephen", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, neotetRomInfo, neotetRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Primo Demo - -static struct BurnRomInfo neoprimoRomDesc[] = { - { "pri_p1.rom", 0x100000, 0xa315fb81, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - - { "pri_s1.rom", 0x020000, 0xa545b593, 2 | BRF_GRA }, // 1 Text data - - { "pri_c1.rom", 0x100000, 0xd68941e1, 3 | BRF_GRA }, // 2 Sprite data - { "pri_c2.rom", 0x100000, 0xdf7e359f, 3 | BRF_GRA }, // 3 - - { "pri_m1.rom", 0x020000, 0x9c0291ea, 4 | BRF_ESS | BRF_PRG }, // 4 Z80 code - - { "pri_v1.rom", 0x080000, 0xdebeb8fb, 5 | BRF_SND }, // 5 Sound data -}; - -STDROMPICKEXT(neoprimo, neoprimo, neogeo) -STD_ROM_FN(neoprimo) - -struct BurnDriver BurnDrvneoprimo = { - "neoprimo", NULL, "neogeo", NULL, "2013", - "Primo Demo\0", NULL, "iocerom.com", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, neoprimoRomInfo, neoprimoRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; - - -// Crouching Poney Hidden Dragon (DEMO) - -static struct BurnRomInfo cphdRomDesc[] = { - { "cphd.p1", 0x100000, 0xde032a95, 1 | BRF_ESS | BRF_PRG }, // 0 68K Code - { "cphd.p2", 0x800000, 0x7a3a2e41, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "cphd.s1", 0x020000, 0x1736099a, 2 | BRF_GRA }, // 2 Text data - - { "cphd.c1", 0x2000000, 0xf3a4b475, 3 | BRF_GRA }, // 3 Sprite data - { "cphd.c2", 0x2000000, 0x05ce93a9, 3 | BRF_GRA }, // 4 - { "cphd.c3", 0x2000000, 0x59450445, 0 | BRF_GRA | BRF_OPT }, // 5 - { "cphd.c4", 0x2000000, 0x59450445, 0 | BRF_GRA | BRF_OPT }, // 6 - - { "cphd.m1", 0x010000, 0x535a7397, 4 | BRF_ESS | BRF_PRG }, // 7 Z80 code - - { "cphd.v1", 0x2000000, 0x04eb9c07, 5 | BRF_SND }, // 8 Sound data - { "cphd.v2", 0x2000000, 0x9c9aec7f, 5 | BRF_SND }, // 8 Sound data - -}; - -STDROMPICKEXT(cphd, cphd, neogeo) -STD_ROM_FN(cphd) - -struct BurnDriver BurnDrvcphd = { - "cphd", NULL, "neogeo", NULL, "2013", - "Crouching Poney Hidden Dragon (DEMO)\0", NULL, "Le Cortex", "Neo Geo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 2, HARDWARE_SNK_NEOGEO, GBF_MISC, 0, - NULL, cphdRomInfo, cphdRomName, NULL, NULL, neogeoInputInfo, neogeoDIPInfo, - NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette, - 0x1000, 304, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/neogeo/neo_decrypt.cpp b/jan/src/burn/drv/neogeo/neo_decrypt.cpp deleted file mode 100644 index 27a8ec150..000000000 --- a/jan/src/burn/drv/neogeo/neo_decrypt.cpp +++ /dev/null @@ -1,673 +0,0 @@ -// This file is based on the MAME source code (see http://www.mame.net/) -// sources by Bryan McPhail,Fuzz,Ernesto Corvi,Andrew Prime,Zsolt Vasvari - -/*************************************************************************** - -NeoGeo 'C' ROM encryption - -Starting with KOF99, all NeoGeo games have encrypted graphics. Additionally -to that, the data for the front text layer, which was previously stored in -a separate ROM, is stored at the end of the tile data. - -The encryption is one of the nastiest implementation of a XOR scheme ever -seen, involving 9 seemingly uncorrelated 256-byte tables. All known games use -the same tables except KOF2000 and MS4 which use a different set. - -The 32 data bits of every longword are decrypted in a single step (one byte at -a time), but the values to use for the xor are determined in a convoluted way. -It's actually so convoluted that it's too difficult to describe - please refer -to the source below. -Suffice to say that bytes are handled in couples (0&3 and 1&2), and the two xor -values are taken from three tables, the indexes inside the tables depending on -bits 0-7 and 8-15 of the address, in one case further xored through the table -used in step 5) below. Additionally, the bytes in a couple can be swapped, -depending either on bit 8 of the address, or on bit 16 xored with the table -used in step 4) below. - -The 24 address bits are encrypted in five steps. Each step xors 8 bits with a -value taken from a different table; the index inside the table depends on 8 -other bits. -0) xor bits 0-7 with a fixed value that changes from game to game -1) xor bits 8-15 depending on bits 16-23 -2) xor bits 8-15 depending on bits 0-7 -3) xor bits 16-23 depending on bits 0-7 -4) xor bits 16-23 depending on bits 8-15 -5) xor bits 0-7 depending on bits 8-15 - -Each step acts on the current value, so e.g. step 4) uses bits 8-15 as modified -by step 2). - -[Note: the table used in step 1) is currently incomplete due to lack of data to -analyze] - - -There are two major weaknesses in this encryption algorithm, that exposed it to -a known plaintext attack. - -The first weakness is that the data xor depends on the address inside the -encrypted ROM instead that on the decrypted address; together with the high -concentration of 0x00 and 0xFF in the decrypted data (more than 60% of the -total), this exposed easily recognizable patterns in the encrypted data, which -could be exploited with some simple statistical checks. The deviousness of the -xor scheme was the major difficulty. - -The second weakness is that the address scrambling works on 32-bit words. Since -there are a large number of 32-bit values that appear only once in the whole -encrypted ROM space, this means that once the xor layer was broken, a large -table of encrypted-decrypted address correspondencies could be built and -analyzed, quickly leading to the algorithm. - -***************************************************************************/ - -#include "neogeo.h" -#include "bitswap.h" - - -const UINT8 *type0_t03; -const UINT8 *type0_t12; -const UINT8 *type1_t03; -const UINT8 *type1_t12; -const UINT8 *address_8_15_xor1; -const UINT8 *address_8_15_xor2; -const UINT8 *address_16_23_xor1; -const UINT8 *address_16_23_xor2; -const UINT8 *address_0_7_xor; - - -const UINT8 kof99_type0_t03[256] = -{ - 0xfb, 0x86, 0x9d, 0xf1, 0xbf, 0x80, 0xd5, 0x43, 0xab, 0xb3, 0x9f, 0x6a, 0x33, 0xd9, 0xdb, 0xb6, - 0x66, 0x08, 0x69, 0x88, 0xcc, 0xb7, 0xde, 0x49, 0x97, 0x64, 0x1f, 0xa6, 0xc0, 0x2f, 0x52, 0x42, - 0x44, 0x5a, 0xf2, 0x28, 0x98, 0x87, 0x96, 0x8a, 0x83, 0x0b, 0x03, 0x61, 0x71, 0x99, 0x6b, 0xb5, - 0x1a, 0x8e, 0xfe, 0x04, 0xe1, 0xf7, 0x7d, 0xdd, 0xed, 0xca, 0x37, 0xfc, 0xef, 0x39, 0x72, 0xda, - 0xb8, 0xbe, 0xee, 0x7f, 0xe5, 0x31, 0x78, 0xf3, 0x91, 0x9a, 0xd2, 0x11, 0x19, 0xb9, 0x09, 0x4c, - 0xfd, 0x6d, 0x2a, 0x4d, 0x65, 0xa1, 0x89, 0xc7, 0x75, 0x50, 0x21, 0xfa, 0x16, 0x00, 0xe9, 0x12, - 0x74, 0x2b, 0x1e, 0x4f, 0x14, 0x01, 0x70, 0x3a, 0x4e, 0x3f, 0xf5, 0xf4, 0x1d, 0x3d, 0x15, 0x27, - 0xa7, 0xff, 0x45, 0xe0, 0x6e, 0xf9, 0x54, 0xc8, 0x48, 0xad, 0xa5, 0x0a, 0xf6, 0x2d, 0x2c, 0xe2, - 0x68, 0x67, 0xd6, 0x85, 0xb4, 0xc3, 0x34, 0xbc, 0x62, 0xd3, 0x5f, 0x84, 0x06, 0x5b, 0x0d, 0x95, - 0xea, 0x5e, 0x9e, 0xd4, 0xeb, 0x90, 0x7a, 0x05, 0x81, 0x57, 0xe8, 0x60, 0x2e, 0x20, 0x25, 0x7c, - 0x46, 0x0c, 0x93, 0xcb, 0xbd, 0x17, 0x7e, 0xec, 0x79, 0xb2, 0xc2, 0x22, 0x41, 0xb1, 0x10, 0xac, - 0xa8, 0xbb, 0x9b, 0x82, 0x4b, 0x9c, 0x8b, 0x07, 0x47, 0x35, 0x24, 0x56, 0x8d, 0xaf, 0xe6, 0x26, - 0x40, 0x38, 0xc4, 0x5d, 0x1b, 0xc5, 0xd1, 0x0f, 0x6c, 0x7b, 0xb0, 0xe3, 0xa3, 0x23, 0x6f, 0x58, - 0xc1, 0xba, 0xcf, 0xd7, 0xa2, 0xe7, 0xd0, 0x63, 0x5c, 0xf8, 0x73, 0xa0, 0x13, 0xdc, 0x29, 0xcd, - 0xc9, 0x76, 0xae, 0x8f, 0xe4, 0x59, 0x30, 0xaa, 0x94, 0x1c, 0x3c, 0x0e, 0x55, 0x92, 0x77, 0x32, - 0xc6, 0xce, 0x18, 0x36, 0xdf, 0xa9, 0x8c, 0xd8, 0xa4, 0xf0, 0x3b, 0x51, 0x4a, 0x02, 0x3e, 0x53, -}; - -const UINT8 kof99_type0_t12[256] = -{ - 0x1f, 0xac, 0x4d, 0xcd, 0xca, 0x70, 0x02, 0x6b, 0x18, 0x40, 0x62, 0xb2, 0x3f, 0x9b, 0x5b, 0xef, - 0x69, 0x68, 0x71, 0x3b, 0xcb, 0xd4, 0x30, 0xbc, 0x47, 0x72, 0x74, 0x5e, 0x84, 0x4c, 0x1b, 0xdb, - 0x6a, 0x35, 0x1d, 0xf5, 0xa1, 0xb3, 0x87, 0x5d, 0x57, 0x28, 0x2f, 0xc4, 0xfd, 0x24, 0x26, 0x36, - 0xad, 0xbe, 0x61, 0x63, 0x73, 0xaa, 0x82, 0xee, 0x29, 0xd0, 0xdf, 0x8c, 0x15, 0xb5, 0x96, 0xf3, - 0xdd, 0x7e, 0x3a, 0x37, 0x58, 0x7f, 0x0c, 0xfc, 0x0b, 0x07, 0xe8, 0xf7, 0xf4, 0x14, 0xb8, 0x81, - 0xb6, 0xd7, 0x1e, 0xc8, 0x85, 0xe6, 0x9d, 0x33, 0x60, 0xc5, 0x95, 0xd5, 0x55, 0x00, 0xa3, 0xb7, - 0x7d, 0x50, 0x0d, 0xd2, 0xc1, 0x12, 0xe5, 0xed, 0xd8, 0xa4, 0x9c, 0x8f, 0x2a, 0x4f, 0xa8, 0x01, - 0x52, 0x83, 0x65, 0xea, 0x9a, 0x6c, 0x44, 0x4a, 0xe2, 0xa5, 0x2b, 0x46, 0xe1, 0x34, 0x25, 0xf8, - 0xc3, 0xda, 0xc7, 0x6e, 0x48, 0x38, 0x7c, 0x78, 0x06, 0x53, 0x64, 0x16, 0x98, 0x3c, 0x91, 0x42, - 0x39, 0xcc, 0xb0, 0xf1, 0xeb, 0x13, 0xbb, 0x05, 0x32, 0x86, 0x0e, 0xa2, 0x0a, 0x9e, 0xfa, 0x66, - 0x54, 0x8e, 0xd3, 0xe7, 0x19, 0x20, 0x77, 0xec, 0xff, 0xbd, 0x6d, 0x43, 0x23, 0x03, 0xab, 0x75, - 0x3d, 0xcf, 0xd1, 0xde, 0x92, 0x31, 0xa7, 0x45, 0x4b, 0xc2, 0x97, 0xf9, 0x7a, 0x88, 0xd9, 0x1c, - 0xe9, 0xe4, 0x10, 0xc9, 0x22, 0x2d, 0x90, 0x76, 0x17, 0x79, 0x04, 0x51, 0x1a, 0x5a, 0x5f, 0x2c, - 0x21, 0x6f, 0x3e, 0xe0, 0xf0, 0xbf, 0xd6, 0x94, 0x0f, 0x80, 0x11, 0xa0, 0x5c, 0xa9, 0x49, 0x2e, - 0xce, 0xaf, 0xa6, 0x9f, 0x7b, 0x99, 0xb9, 0xb4, 0xe3, 0xfb, 0xf6, 0x27, 0xf2, 0x93, 0xfe, 0x08, - 0x67, 0xae, 0x09, 0x89, 0xdc, 0x4e, 0xc6, 0xc0, 0x8a, 0xb1, 0x59, 0x8b, 0x41, 0x56, 0x8d, 0xba, -}; - -const UINT8 kof99_type1_t03[256] = -{ - 0xa9, 0x17, 0xaf, 0x0d, 0x34, 0x6e, 0x53, 0xb6, 0x7f, 0x58, 0xe9, 0x14, 0x5f, 0x55, 0xdb, 0xd4, - 0x42, 0x80, 0x99, 0x59, 0xa8, 0x3a, 0x57, 0x5d, 0xd5, 0x6f, 0x4c, 0x68, 0x35, 0x46, 0xa6, 0xe7, - 0x7b, 0x71, 0xe0, 0x93, 0xa2, 0x1f, 0x64, 0x21, 0xe3, 0xb1, 0x98, 0x26, 0xab, 0xad, 0xee, 0xe5, - 0xbb, 0xd9, 0x1e, 0x2e, 0x95, 0x36, 0xef, 0x23, 0x79, 0x45, 0x04, 0xed, 0x13, 0x1d, 0xf4, 0x85, - 0x96, 0xec, 0xc2, 0x32, 0xaa, 0x7c, 0x15, 0xd8, 0xda, 0x92, 0x90, 0x9d, 0xb7, 0x56, 0x6a, 0x66, - 0x41, 0xfc, 0x00, 0xf6, 0x50, 0x24, 0xcf, 0xfb, 0x11, 0xfe, 0x82, 0x48, 0x9b, 0x27, 0x1b, 0x67, - 0x4e, 0x84, 0x69, 0x97, 0x6d, 0x8c, 0xd2, 0xba, 0x74, 0xf9, 0x8f, 0xa5, 0x54, 0x5c, 0xcd, 0x73, - 0x07, 0xd1, 0x01, 0x09, 0xf1, 0x19, 0x3b, 0x5e, 0x87, 0x30, 0x76, 0xcc, 0xc0, 0x5a, 0xa7, 0x49, - 0x22, 0xfa, 0x16, 0x02, 0xdf, 0xa4, 0xff, 0xb3, 0x75, 0x33, 0xbd, 0x88, 0x2f, 0xcb, 0x2a, 0x44, - 0xb8, 0xbf, 0x1c, 0x0f, 0x81, 0x10, 0x43, 0xb4, 0xc8, 0x7e, 0x9a, 0x25, 0xea, 0x83, 0x4b, 0x38, - 0x7a, 0xd7, 0x3d, 0x1a, 0x4f, 0x62, 0x51, 0xc9, 0x47, 0x0e, 0xce, 0x3f, 0xc7, 0x4d, 0x2c, 0xa1, - 0x86, 0xb9, 0xc5, 0xca, 0xdd, 0x6b, 0x70, 0x6c, 0x91, 0x9c, 0xbe, 0x0a, 0x9f, 0xf5, 0x94, 0xbc, - 0x18, 0x2b, 0x60, 0x20, 0x29, 0xf7, 0xf2, 0x28, 0xc4, 0xa0, 0x0b, 0x65, 0xde, 0x8d, 0x78, 0x12, - 0x3e, 0xd0, 0x77, 0x08, 0x8b, 0xae, 0x05, 0x31, 0x3c, 0xd6, 0xa3, 0x89, 0x06, 0xdc, 0x52, 0x72, - 0xb0, 0xb5, 0x37, 0xd3, 0xc3, 0x8a, 0xc6, 0xf0, 0xc1, 0x61, 0xfd, 0x4a, 0x5b, 0x7d, 0x9e, 0xf3, - 0x63, 0x40, 0x2d, 0xe8, 0xb2, 0xe6, 0x39, 0x03, 0xeb, 0x8e, 0xe1, 0x0c, 0xe4, 0xe2, 0xf8, 0xac, -}; - -const UINT8 kof99_type1_t12[256] = -{ - 0xea, 0xe6, 0x5e, 0xa7, 0x8e, 0xac, 0x34, 0x03, 0x30, 0x97, 0x52, 0x53, 0x76, 0xf2, 0x62, 0x0b, - 0x0a, 0xfc, 0x94, 0xb8, 0x67, 0x36, 0x11, 0xbc, 0xae, 0xca, 0xfa, 0x15, 0x04, 0x2b, 0x17, 0xc4, - 0x3e, 0x5b, 0x59, 0x01, 0x57, 0xe2, 0xba, 0xb7, 0xd1, 0x3f, 0xf0, 0x6a, 0x9c, 0x2a, 0xcb, 0xa9, - 0xe3, 0x2c, 0xc0, 0x0f, 0x46, 0x91, 0x8a, 0xd0, 0x98, 0xc5, 0xa6, 0x1b, 0x96, 0x29, 0x12, 0x09, - 0x63, 0xed, 0xe0, 0xa2, 0x86, 0x77, 0xbe, 0xe5, 0x65, 0xdb, 0xbd, 0x50, 0xb3, 0x9d, 0x1a, 0x4e, - 0x79, 0x0c, 0x00, 0x43, 0xdf, 0x3d, 0x54, 0x33, 0x8f, 0x89, 0xa8, 0x7b, 0xf9, 0xd5, 0x27, 0x82, - 0xbb, 0xc2, 0x8c, 0x47, 0x88, 0x6b, 0xb4, 0xc3, 0xf8, 0xaa, 0x06, 0x1e, 0x83, 0x7d, 0x05, 0x78, - 0x85, 0xf6, 0x6e, 0x2e, 0xec, 0x5a, 0x31, 0x45, 0x38, 0x14, 0x16, 0x8b, 0x02, 0xe4, 0x4f, 0xb0, - 0xbf, 0xab, 0xa4, 0x9e, 0x48, 0x60, 0x19, 0x35, 0x08, 0xde, 0xdd, 0x66, 0x90, 0x51, 0xcc, 0xa3, - 0xaf, 0x70, 0x9b, 0x75, 0x95, 0x49, 0x6c, 0x64, 0x72, 0x7e, 0x44, 0xa0, 0x73, 0x25, 0x68, 0x55, - 0x1f, 0x40, 0x7a, 0x74, 0x0e, 0x8d, 0xdc, 0x1c, 0x71, 0xc8, 0xcf, 0xd7, 0xe8, 0xce, 0xeb, 0x32, - 0x3a, 0xee, 0x07, 0x61, 0x4d, 0xfe, 0x5c, 0x7c, 0x56, 0x2f, 0x2d, 0x5f, 0x6f, 0x9f, 0x81, 0x22, - 0x58, 0x4b, 0xad, 0xda, 0xb9, 0x10, 0x18, 0x23, 0xe1, 0xf3, 0x6d, 0xe7, 0xe9, 0x28, 0xd6, 0xd8, - 0xf4, 0x4c, 0x39, 0x21, 0xb2, 0x84, 0xc1, 0x24, 0x26, 0xf1, 0x93, 0x37, 0xc6, 0x4a, 0xcd, 0x20, - 0xc9, 0xd9, 0xc7, 0xb1, 0xff, 0x99, 0xd4, 0x5d, 0xb5, 0xa1, 0x87, 0x0d, 0x69, 0x92, 0x13, 0x80, - 0xd2, 0xd3, 0xfd, 0x1d, 0xf5, 0x3b, 0xa5, 0x7f, 0xef, 0x9a, 0xb6, 0x42, 0xfb, 0x3c, 0xf7, 0x41, -}; - - - -/* underlined values are wrong (not enough evidence, FF fill in kof99 and garou) */ -/* they correspond to tiles 7d000-7efff */ -const UINT8 kof99_address_8_15_xor1[256] = -{ - 0x00, 0xb1, 0x1e, 0xc5, 0x3d, 0x40, 0x45, 0x5e, 0xf2, 0xf8, 0x04, 0x63, 0x36, 0x87, 0x88, 0xbf, - 0xab, 0xcc, 0x78, 0x08, 0xdd, 0x20, 0xd4, 0x35, 0x09, 0x8e, 0x44, 0xae, 0x33, 0xa9, 0x9e, 0xcd, - 0xb3, 0xe5, 0xad, 0x41, 0xda, 0xbe, 0xf4, 0x16, 0x57, 0x2e, 0x53, 0x67, 0xaf, 0xdb, 0x8a, 0xd8, - 0x34, 0x17, 0x3c, 0x01, 0x55, 0x73, 0xcf, 0xe3, 0xe8, 0xc7, 0x0d, 0xe9, 0xa3, 0x13, 0x0c, 0xf6, - 0x90, 0x4e, 0xfb, 0x97, 0x6d, 0x5f, 0xa8, 0x71, 0x11, 0xfc, 0xd1, 0x95, 0x81, 0xba, 0x8c, 0x1b, - 0x39, 0xfe, 0xa2, 0x15, 0xa6, 0x52, 0x4d, 0x5b, 0x59, 0xa5, 0xe0, 0x96, 0xd9, 0x8f, 0x7b, 0xed, - 0x29, 0xd3, 0x1f, 0x0e, 0xec, 0x23, 0x0f, 0xb8, 0x6c, 0x6f, 0x7d, 0x18, 0x46, 0xd6, 0xe4, 0xb5, - 0x9a, 0x79, 0x02, 0xf5, 0x03, 0xc0, 0x60, 0x66, 0x5c, 0x2f, 0x76, 0x85, 0x9d, 0x54, 0x1a, 0x6a, - 0x28, 0xce, 0x7f, 0x7c, 0x91, 0x99, 0x4c, 0x83, 0x3e, 0xb4, 0x1d, 0x05, 0xc1, 0xc3, 0xd7, 0x47, - 0xde, 0xbc, 0x62, 0x6e, 0x86, 0x14, 0x80, 0x77, 0xeb, 0xf3, 0x07, 0x31, 0x56, 0xd2, 0xc2, 0xc6, - 0x6b, 0xdc, 0xfd, 0x22, 0x92, 0xf0, 0x06, 0x51, 0x2d, 0x38, 0xe6, 0xa0, 0x25, 0xdf, 0xd5, 0x2c, - 0x1c, 0x94, 0x12, 0x9c, 0xb0, 0x9b, 0xc4, 0x0b, 0xc8, 0xd0, 0xf7, 0x30, 0xcb, 0x27, 0xfa, 0x7a, - 0x10, 0x61, 0xaa, 0xa4, 0x70, 0xb7, 0x2a, 0x5a, 0xc9, 0xf1, 0x0a, 0x49, 0x65, 0xee, 0x69, 0x4b, - 0x3a, 0x8d, 0x32, 0x5d, 0x68, 0xb9, 0x9f, 0x75, 0x19, 0x3f, 0xac, 0x37, 0x4f, 0xe7, 0x93, 0x89, - 0x7e, 0x4a, 0x3b, 0xea, 0x74, 0x72, 0x43, 0xbd, 0x24, 0xef, 0xb6, 0xff, 0x64, 0x58, 0x84, 0x8b, - 0xa7, 0xbb, 0xb2, 0xe1, 0x26, 0x2b, 0x50, 0xca, 0x21, 0xf9, 0x98, 0xa1, 0xe2, 0x42, 0x82, 0x48, -// ^^^^ ^^^^ ^^^^ ^^^^ -}; - -const UINT8 kof99_address_8_15_xor2[256] = -{ - 0x9b, 0x9d, 0xc1, 0x3d, 0xa9, 0xb8, 0xf4, 0x6f, 0xf6, 0x25, 0xc7, 0x47, 0xd5, 0x97, 0xdf, 0x6b, - 0xeb, 0x90, 0xa4, 0xb2, 0x5d, 0xf5, 0x66, 0xb0, 0xb9, 0x8b, 0x93, 0x64, 0xec, 0x7b, 0x65, 0x8c, - 0xf1, 0x43, 0x42, 0x6e, 0x45, 0x9f, 0xb3, 0x35, 0x06, 0x71, 0x96, 0xdb, 0xa0, 0xfb, 0x0b, 0x3a, - 0x1f, 0xf8, 0x8e, 0x69, 0xcd, 0x26, 0xab, 0x86, 0xa2, 0x0c, 0xbd, 0x63, 0xa5, 0x7a, 0xe7, 0x6a, - 0x5f, 0x18, 0x9e, 0xbf, 0xad, 0x55, 0xb1, 0x1c, 0x5c, 0x03, 0x30, 0xc6, 0x37, 0x20, 0xe3, 0xc9, - 0x52, 0xe8, 0xee, 0x4f, 0x01, 0x70, 0xc4, 0x77, 0x29, 0x2a, 0xba, 0x53, 0x12, 0x04, 0x7d, 0xaf, - 0x33, 0x8f, 0xa8, 0x4d, 0xaa, 0x5b, 0xb4, 0x0f, 0x92, 0xbb, 0xed, 0xe1, 0x2f, 0x50, 0x6c, 0xd2, - 0x2c, 0x95, 0xd9, 0xf9, 0x98, 0xc3, 0x76, 0x4c, 0xf2, 0xe4, 0xe5, 0x2b, 0xef, 0x9c, 0x49, 0xb6, - 0x31, 0x3b, 0xbc, 0xa1, 0xca, 0xde, 0x62, 0x74, 0xea, 0x81, 0x00, 0xdd, 0xa6, 0x46, 0x88, 0x3f, - 0x39, 0xd6, 0x23, 0x54, 0x24, 0x4a, 0xd8, 0xdc, 0xd7, 0xd1, 0xcc, 0xbe, 0x57, 0x7c, 0xda, 0x44, - 0x61, 0xce, 0xd3, 0xd4, 0xe9, 0x28, 0x80, 0xe0, 0x56, 0x8a, 0x09, 0x05, 0x9a, 0x89, 0x1b, 0xf7, - 0xf3, 0x99, 0x6d, 0x5e, 0x48, 0x91, 0xc0, 0xd0, 0xc5, 0x79, 0x78, 0x41, 0x59, 0x21, 0x2e, 0xff, - 0xc2, 0x4b, 0x38, 0x83, 0x32, 0xe6, 0xe2, 0x7f, 0x1e, 0x17, 0x58, 0x1d, 0x1a, 0xfa, 0x85, 0x82, - 0x94, 0xc8, 0x72, 0x7e, 0xb7, 0xac, 0x0e, 0xfc, 0xfd, 0x16, 0x27, 0x75, 0x8d, 0xcb, 0x08, 0xfe, - 0x0a, 0x02, 0x0d, 0x36, 0x11, 0x22, 0x84, 0x40, 0x34, 0x3e, 0x2d, 0x68, 0x5a, 0xa7, 0x67, 0xae, - 0x87, 0x07, 0x10, 0x60, 0x14, 0x73, 0x3c, 0x51, 0x19, 0xa3, 0xb5, 0xcf, 0x13, 0xf0, 0x15, 0x4e, -}; - -const UINT8 kof99_address_16_23_xor1[256] = -{ - 0x00, 0x5f, 0x03, 0x52, 0xce, 0xe3, 0x7d, 0x8f, 0x6b, 0xf8, 0x20, 0xde, 0x7b, 0x7e, 0x39, 0xbe, - 0xf5, 0x94, 0x18, 0x78, 0x80, 0xc9, 0x7f, 0x7a, 0x3e, 0x63, 0xf2, 0xe0, 0x4e, 0xf7, 0x87, 0x27, - 0x69, 0x6c, 0xa4, 0x1d, 0x85, 0x5b, 0xe6, 0x44, 0x25, 0x0c, 0x98, 0xc7, 0x01, 0x02, 0xa3, 0x26, - 0x09, 0x38, 0xdb, 0xc3, 0x1e, 0xcf, 0x23, 0x45, 0x68, 0x76, 0xd6, 0x22, 0x5d, 0x5a, 0xae, 0x16, - 0x9f, 0xa2, 0xb5, 0xcd, 0x81, 0xea, 0x5e, 0xb8, 0xb9, 0x9d, 0x9c, 0x1a, 0x0f, 0xff, 0xe1, 0xe7, - 0x74, 0xaa, 0xd4, 0xaf, 0xfc, 0xc6, 0x33, 0x29, 0x5c, 0xab, 0x95, 0xf0, 0x19, 0x47, 0x59, 0x67, - 0xf3, 0x96, 0x60, 0x1f, 0x62, 0x92, 0xbd, 0x89, 0xee, 0x28, 0x13, 0x06, 0xfe, 0xfa, 0x32, 0x6d, - 0x57, 0x3c, 0x54, 0x50, 0x2c, 0x58, 0x49, 0xfb, 0x17, 0xcc, 0xef, 0xb2, 0xb4, 0xf9, 0x07, 0x70, - 0xc5, 0xa9, 0xdf, 0xd5, 0x3b, 0x86, 0x2b, 0x0d, 0x6e, 0x4d, 0x0a, 0x90, 0x43, 0x31, 0xc1, 0xf6, - 0x88, 0x0b, 0xda, 0x53, 0x14, 0xdc, 0x75, 0x8e, 0xb0, 0xeb, 0x99, 0x46, 0xa1, 0x15, 0x71, 0xc8, - 0xe9, 0x3f, 0x4a, 0xd9, 0x73, 0xe5, 0x7c, 0x30, 0x77, 0xd3, 0xb3, 0x4b, 0x37, 0x72, 0xc2, 0x04, - 0x97, 0x08, 0x36, 0xb1, 0x3a, 0x61, 0xec, 0xe2, 0x1c, 0x9a, 0x8b, 0xd1, 0x1b, 0x2e, 0x9e, 0x8a, - 0xd8, 0x41, 0xe4, 0xc4, 0x40, 0x2f, 0xad, 0xc0, 0xb6, 0x84, 0x51, 0x66, 0xbb, 0x12, 0xe8, 0xdd, - 0xcb, 0xbc, 0x6f, 0xd0, 0x11, 0x83, 0x56, 0x4c, 0xca, 0xbf, 0x05, 0x10, 0xd7, 0xba, 0xfd, 0xed, - 0x8c, 0x0e, 0x4f, 0x3d, 0x35, 0x91, 0xb7, 0xac, 0x34, 0x64, 0x2a, 0xf1, 0x79, 0x6a, 0x9b, 0x2d, - 0x65, 0xf4, 0x42, 0xa0, 0x8d, 0xa7, 0x48, 0x55, 0x21, 0x93, 0x24, 0xd2, 0xa6, 0xa5, 0xa8, 0x82, -}; - -const UINT8 kof99_address_16_23_xor2[256] = -{ - 0x29, 0x97, 0x1a, 0x2c, 0x0b, 0x94, 0x3e, 0x75, 0x01, 0x0d, 0x1b, 0xe1, 0x4d, 0x38, 0x39, 0x8f, - 0xe7, 0xd0, 0x60, 0x90, 0xb2, 0x0f, 0xbb, 0x70, 0x1f, 0xe6, 0x5b, 0x87, 0xb4, 0x43, 0xfd, 0xf5, - 0xf6, 0xf9, 0xad, 0xc0, 0x98, 0x17, 0x9f, 0x91, 0x15, 0x51, 0x55, 0x64, 0x6c, 0x18, 0x61, 0x0e, - 0xd9, 0x93, 0xab, 0xd6, 0x24, 0x2f, 0x6a, 0x3a, 0x22, 0xb1, 0x4f, 0xaa, 0x23, 0x48, 0xed, 0xb9, - 0x88, 0x8b, 0xa3, 0x6b, 0x26, 0x4c, 0xe8, 0x2d, 0x1c, 0x99, 0xbd, 0x5c, 0x58, 0x08, 0x50, 0xf2, - 0x2a, 0x62, 0xc1, 0x72, 0x66, 0x04, 0x10, 0x37, 0x6e, 0xfc, 0x44, 0xa9, 0xdf, 0xd4, 0x20, 0xdd, - 0xee, 0x41, 0xdb, 0x73, 0xde, 0x54, 0xec, 0xc9, 0xf3, 0x4b, 0x2e, 0xae, 0x5a, 0x4a, 0x5e, 0x47, - 0x07, 0x2b, 0x76, 0xa4, 0xe3, 0x28, 0xfe, 0xb0, 0xf0, 0x02, 0x06, 0xd1, 0xaf, 0x42, 0xc2, 0xa5, - 0xe0, 0x67, 0xbf, 0x16, 0x8e, 0x35, 0xce, 0x8a, 0xe5, 0x3d, 0x7b, 0x96, 0xd7, 0x79, 0x52, 0x1e, - 0xa1, 0xfb, 0x9b, 0xbe, 0x21, 0x9c, 0xe9, 0x56, 0x14, 0x7f, 0xa0, 0xe4, 0xc3, 0xc4, 0x46, 0xea, - 0xf7, 0xd2, 0x1d, 0x31, 0x0a, 0x5f, 0xeb, 0xa2, 0x68, 0x8d, 0xb5, 0xc5, 0x74, 0x0c, 0xdc, 0x82, - 0x80, 0x09, 0x19, 0x95, 0x71, 0x9a, 0x11, 0x57, 0x77, 0x4e, 0xc6, 0xff, 0x12, 0x03, 0xa7, 0xc7, - 0xf4, 0xc8, 0xb6, 0x7a, 0x59, 0x36, 0x3c, 0x53, 0xe2, 0x69, 0x8c, 0x25, 0x05, 0x45, 0x63, 0xf8, - 0x34, 0x89, 0x33, 0x3f, 0x85, 0x27, 0xbc, 0x65, 0xfa, 0xa8, 0x6d, 0x84, 0x5d, 0xba, 0x40, 0x32, - 0x30, 0xef, 0x83, 0x13, 0xa6, 0x78, 0xcc, 0x81, 0x9e, 0xda, 0xca, 0xd3, 0x7e, 0x9d, 0x6f, 0xcd, - 0xb7, 0xb3, 0xd8, 0xcf, 0x3b, 0x00, 0x92, 0xb8, 0x86, 0xac, 0x49, 0x7c, 0xf1, 0xd5, 0xcb, 0x7d, -}; - -const UINT8 kof99_address_0_7_xor[256] = -{ - 0x74, 0xad, 0x5d, 0x1d, 0x9e, 0xc3, 0xfa, 0x4e, 0xf7, 0xdb, 0xca, 0xa2, 0x64, 0x36, 0x56, 0x0c, - 0x4f, 0xcf, 0x43, 0x66, 0x1e, 0x91, 0xe3, 0xa5, 0x58, 0xc2, 0xc1, 0xd4, 0xb9, 0xdd, 0x76, 0x16, - 0xce, 0x61, 0x75, 0x01, 0x2b, 0x22, 0x38, 0x55, 0x50, 0xef, 0x6c, 0x99, 0x05, 0xe9, 0xe8, 0xe0, - 0x2d, 0xa4, 0x4b, 0x4a, 0x42, 0xae, 0xba, 0x8c, 0x6f, 0x93, 0x14, 0xbd, 0x71, 0x21, 0xb0, 0x02, - 0x15, 0xc4, 0xe6, 0x60, 0xd7, 0x44, 0xfd, 0x85, 0x7e, 0x78, 0x8f, 0x00, 0x81, 0xf1, 0xa7, 0x3b, - 0xa0, 0x10, 0xf4, 0x9f, 0x39, 0x88, 0x35, 0x62, 0xcb, 0x19, 0x31, 0x11, 0x51, 0xfb, 0x2a, 0x20, - 0x45, 0xd3, 0x7d, 0x92, 0x1b, 0xf2, 0x09, 0x0d, 0x97, 0xa9, 0xb5, 0x3c, 0xee, 0x5c, 0xaf, 0x7b, - 0xd2, 0x3a, 0x49, 0x8e, 0xb6, 0xcd, 0xd9, 0xde, 0x8a, 0x29, 0x6e, 0xd8, 0x0b, 0xe1, 0x69, 0x87, - 0x1a, 0x96, 0x18, 0xcc, 0xdf, 0xe7, 0xc5, 0xc7, 0xf8, 0x52, 0xc9, 0xf0, 0xb7, 0xe5, 0x33, 0xda, - 0x67, 0x9d, 0xa3, 0x03, 0x0e, 0x72, 0x26, 0x79, 0xe2, 0xb8, 0xfc, 0xaa, 0xfe, 0xb4, 0x86, 0xc8, - 0xd1, 0xbc, 0x12, 0x08, 0x77, 0xeb, 0x40, 0x8d, 0x04, 0x25, 0x4d, 0x5a, 0x6a, 0x7a, 0x2e, 0x41, - 0x65, 0x1c, 0x13, 0x94, 0xb2, 0x63, 0x28, 0x59, 0x5e, 0x9a, 0x30, 0x07, 0xc6, 0xbf, 0x17, 0xf5, - 0x0f, 0x89, 0xf3, 0x1f, 0xea, 0x6d, 0xb3, 0xc0, 0x70, 0x47, 0xf9, 0x53, 0xf6, 0xd6, 0x54, 0xed, - 0x6b, 0x4c, 0xe4, 0x8b, 0x83, 0x24, 0x90, 0xb1, 0x7c, 0xbb, 0x73, 0xab, 0xd5, 0x2f, 0x5f, 0xec, - 0x9c, 0x2c, 0xa8, 0x34, 0x46, 0x37, 0x27, 0xa1, 0x0a, 0x06, 0x80, 0x68, 0x82, 0x32, 0x84, 0xff, - 0x48, 0xac, 0x7f, 0x3f, 0x95, 0xdc, 0x98, 0x9b, 0xbe, 0x23, 0x57, 0x3e, 0x5b, 0xd0, 0x3d, 0xa6, -}; - - - - - - -const UINT8 kof2000_type0_t03[256] = -{ - 0x10, 0x61, 0xf1, 0x78, 0x85, 0x52, 0x68, 0xe3, 0x12, 0x0d, 0xfa, 0xf0, 0xc9, 0x36, 0x5e, 0x3d, - 0xf9, 0xa6, 0x01, 0x2e, 0xc7, 0x84, 0xea, 0x2b, 0x6d, 0x14, 0x38, 0x4f, 0x55, 0x1c, 0x9d, 0xa7, - 0x7a, 0xc6, 0xf8, 0x9a, 0xe6, 0x42, 0xb5, 0xed, 0x7d, 0x3a, 0xb1, 0x05, 0x43, 0x4a, 0x22, 0xfd, - 0xac, 0xa4, 0x31, 0xc3, 0x32, 0x76, 0x95, 0x9e, 0x7e, 0x88, 0x8e, 0xa2, 0x97, 0x18, 0xbe, 0x2a, - 0xf5, 0xd6, 0xca, 0xcc, 0x72, 0x3b, 0x87, 0x6c, 0xde, 0x75, 0xd7, 0x21, 0xcb, 0x0b, 0xdd, 0xe7, - 0xe1, 0x65, 0xaa, 0xb9, 0x44, 0xfb, 0x66, 0x15, 0x1a, 0x3c, 0x98, 0xcf, 0x8a, 0xdf, 0x37, 0xa5, - 0x2f, 0x67, 0xd2, 0x83, 0xb6, 0x6b, 0xfc, 0xe0, 0xb4, 0x7c, 0x08, 0xdc, 0x93, 0x30, 0xab, 0xe4, - 0x19, 0xc2, 0x8b, 0xeb, 0xa0, 0x0a, 0xc8, 0x03, 0xc0, 0x4b, 0x64, 0x71, 0x86, 0x9c, 0x9b, 0x16, - 0x79, 0xff, 0x70, 0x09, 0x8c, 0xd0, 0xf6, 0x53, 0x07, 0x73, 0xd4, 0x89, 0xb3, 0x00, 0xe9, 0xfe, - 0xec, 0x8f, 0xbc, 0xb2, 0x1e, 0x5d, 0x11, 0x35, 0xa9, 0x06, 0x59, 0x9f, 0xc1, 0xd3, 0x7b, 0xf2, - 0xc5, 0x77, 0x4e, 0x39, 0x20, 0xd5, 0x6a, 0x82, 0xda, 0x45, 0xf3, 0x33, 0x81, 0x23, 0xba, 0xe2, - 0x1d, 0x5f, 0x5c, 0x51, 0x49, 0xae, 0x8d, 0xc4, 0xa8, 0xf7, 0x1f, 0x0f, 0x34, 0x28, 0xa1, 0xd9, - 0x27, 0xd8, 0x4c, 0x2c, 0xbf, 0x91, 0x3e, 0x69, 0x57, 0x41, 0x25, 0x0c, 0x5a, 0x90, 0x92, 0xb0, - 0x63, 0x6f, 0x40, 0xaf, 0x74, 0xb8, 0x2d, 0x80, 0xbb, 0x46, 0x94, 0xe5, 0x29, 0xee, 0xb7, 0x1b, - 0x96, 0xad, 0x13, 0x0e, 0x58, 0x99, 0x60, 0x4d, 0x17, 0x26, 0xce, 0xe8, 0xdb, 0xef, 0x24, 0xa3, - 0x6e, 0x7f, 0x54, 0x3f, 0x02, 0xd1, 0x5b, 0x50, 0x56, 0x48, 0xf4, 0xbd, 0x62, 0x47, 0x04, 0xcd, -}; - -const UINT8 kof2000_type0_t12[256] = -{ - 0xf4, 0x28, 0xb4, 0x8f, 0xfa, 0xeb, 0x8e, 0x54, 0x2b, 0x49, 0xd1, 0x76, 0x71, 0x47, 0x8b, 0x57, - 0x92, 0x85, 0x7c, 0xb8, 0x5c, 0x22, 0xf9, 0x26, 0xbc, 0x5b, 0x6d, 0x67, 0xae, 0x5f, 0x6f, 0xf5, - 0x9f, 0x48, 0x66, 0x40, 0x0d, 0x11, 0x4e, 0xb2, 0x6b, 0x35, 0x15, 0x0f, 0x18, 0x25, 0x1d, 0xba, - 0xd3, 0x69, 0x79, 0xec, 0xa8, 0x8c, 0xc9, 0x7f, 0x4b, 0xdb, 0x51, 0xaf, 0xca, 0xe2, 0xb3, 0x81, - 0x12, 0x5e, 0x7e, 0x38, 0xc8, 0x95, 0x01, 0xff, 0xfd, 0xfb, 0xf2, 0x74, 0x62, 0x14, 0xa5, 0x98, - 0xa6, 0xda, 0x80, 0x53, 0xe8, 0x56, 0xac, 0x1b, 0x52, 0xd0, 0xf1, 0x45, 0x42, 0xb6, 0x1a, 0x4a, - 0x3a, 0x99, 0xfc, 0xd2, 0x9c, 0xcf, 0x31, 0x2d, 0xdd, 0x86, 0x2f, 0x29, 0xe1, 0x03, 0x19, 0xa2, - 0x41, 0x33, 0x83, 0x90, 0xc1, 0xbf, 0x0b, 0x08, 0x3d, 0xd8, 0x8d, 0x6c, 0x39, 0xa0, 0xe3, 0x55, - 0x02, 0x50, 0x46, 0xe6, 0xc3, 0x82, 0x36, 0x13, 0x75, 0xab, 0x27, 0xd7, 0x1f, 0x0a, 0xd4, 0x89, - 0x59, 0x4f, 0xc0, 0x5d, 0xc6, 0xf7, 0x88, 0xbd, 0x3c, 0x00, 0xef, 0xcd, 0x05, 0x1c, 0xaa, 0x9b, - 0xed, 0x7a, 0x61, 0x17, 0x93, 0xfe, 0x23, 0xb9, 0xf3, 0x68, 0x78, 0xf6, 0x5a, 0x7b, 0xe0, 0xe4, - 0xa3, 0xee, 0x16, 0x72, 0xc7, 0x3b, 0x8a, 0x37, 0x2a, 0x70, 0xa9, 0x2c, 0x21, 0xf8, 0x24, 0x09, - 0xce, 0x20, 0x9e, 0x06, 0x87, 0xc5, 0x04, 0x64, 0x43, 0x7d, 0x4d, 0x10, 0xd6, 0xa4, 0x94, 0x4c, - 0x60, 0xde, 0xdf, 0x58, 0xb1, 0x44, 0x3f, 0xb0, 0xd9, 0xe5, 0xcb, 0xbb, 0xbe, 0xea, 0x07, 0x34, - 0x73, 0x6a, 0x77, 0xf0, 0x9d, 0x0c, 0x2e, 0x0e, 0x91, 0x9a, 0xcc, 0xc2, 0xb7, 0x63, 0x97, 0xd5, - 0xdc, 0xc4, 0x32, 0xe7, 0x84, 0x3e, 0x30, 0xa1, 0x1e, 0xb5, 0x6e, 0x65, 0xe9, 0xad, 0xa7, 0x96, -}; - -const UINT8 kof2000_type1_t03[256] = -{ - 0x9a, 0x2f, 0xcc, 0x4e, 0x40, 0x69, 0xac, 0xca, 0xa5, 0x7b, 0x0a, 0x61, 0x91, 0x0d, 0x55, 0x74, - 0xcd, 0x8b, 0x0b, 0x80, 0x09, 0x5e, 0x38, 0xc7, 0xda, 0xbf, 0xf5, 0x37, 0x23, 0x31, 0x33, 0xe9, - 0xae, 0x87, 0xe5, 0xfa, 0x6e, 0x5c, 0xad, 0xf4, 0x76, 0x62, 0x9f, 0x2e, 0x01, 0xe2, 0xf6, 0x47, - 0x8c, 0x7c, 0xaa, 0x98, 0xb5, 0x92, 0x51, 0xec, 0x5f, 0x07, 0x5d, 0x6f, 0x16, 0xa1, 0x1d, 0xa9, - 0x48, 0x45, 0xf0, 0x6a, 0x9c, 0x1e, 0x11, 0xa0, 0x06, 0x46, 0xd5, 0xf1, 0x73, 0xed, 0x94, 0xf7, - 0xc3, 0x57, 0x1b, 0xe0, 0x97, 0xb1, 0xa4, 0xa7, 0x24, 0xe7, 0x2b, 0x05, 0x5b, 0x34, 0x0c, 0xb8, - 0x0f, 0x9b, 0xc8, 0x4d, 0x5a, 0xa6, 0x86, 0x3e, 0x14, 0x29, 0x84, 0x58, 0x90, 0xdb, 0x2d, 0x54, - 0x9d, 0x82, 0xd4, 0x7d, 0xc6, 0x67, 0x41, 0x89, 0xc1, 0x13, 0xb0, 0x9e, 0x81, 0x6d, 0xa8, 0x59, - 0xbd, 0x39, 0x8e, 0xe6, 0x25, 0x8f, 0xd9, 0xa2, 0xe4, 0x53, 0xc5, 0x72, 0x7e, 0x36, 0x4a, 0x4f, - 0x52, 0xc2, 0x22, 0x2a, 0xce, 0x3c, 0x21, 0x2c, 0x00, 0xd7, 0x75, 0x8a, 0x27, 0xee, 0x43, 0xfe, - 0xcb, 0x6b, 0xb9, 0xa3, 0x78, 0xb7, 0x85, 0x02, 0x20, 0xd0, 0x83, 0xc4, 0x12, 0xf9, 0xfd, 0xd8, - 0x79, 0x64, 0x3a, 0x49, 0x03, 0xb4, 0xc0, 0xf2, 0xdf, 0x15, 0x93, 0x08, 0x35, 0xff, 0x70, 0xdd, - 0x28, 0x6c, 0x0e, 0x04, 0xde, 0x7a, 0x65, 0xd2, 0xab, 0x42, 0x95, 0xe1, 0x3f, 0x3b, 0x7f, 0x66, - 0xd1, 0x8d, 0xe3, 0xbb, 0x1c, 0xfc, 0x77, 0x1a, 0x88, 0x18, 0x19, 0x68, 0x1f, 0x56, 0xd6, 0xe8, - 0xb6, 0xbc, 0xd3, 0xea, 0x3d, 0x26, 0xb3, 0xc9, 0x44, 0xdc, 0xf3, 0x32, 0x30, 0xef, 0x96, 0x4c, - 0xaf, 0x17, 0xf8, 0xfb, 0x60, 0x50, 0xeb, 0x4b, 0x99, 0x63, 0xba, 0xb2, 0x71, 0xcf, 0x10, 0xbe, -}; - -const UINT8 kof2000_type1_t12[256] = -{ - 0xda, 0xa7, 0xd6, 0x6e, 0x2f, 0x5e, 0xf0, 0x3f, 0xa4, 0xce, 0xd3, 0xfd, 0x46, 0x2a, 0xac, 0xc9, - 0xbe, 0xeb, 0x9f, 0xd5, 0x3c, 0x61, 0x96, 0x11, 0xd0, 0x38, 0xca, 0x06, 0xed, 0x1b, 0x65, 0xe7, - 0x23, 0xdd, 0xd9, 0x05, 0xbf, 0x5b, 0x5d, 0xa5, 0x95, 0x00, 0xec, 0xf1, 0x01, 0xa9, 0xa6, 0xfc, - 0xbb, 0x54, 0xe3, 0x2e, 0x92, 0x58, 0x0a, 0x7b, 0xb6, 0xcc, 0xb1, 0x5f, 0x14, 0x35, 0x72, 0xff, - 0xe6, 0x52, 0xd7, 0x8c, 0xf3, 0x43, 0xaf, 0x9c, 0xc0, 0x4f, 0x0c, 0x42, 0x8e, 0xef, 0x80, 0xcd, - 0x1d, 0x7e, 0x88, 0x3b, 0x98, 0xa1, 0xad, 0xe4, 0x9d, 0x8d, 0x2b, 0x56, 0xb5, 0x50, 0xdf, 0x66, - 0x6d, 0xd4, 0x60, 0x09, 0xe1, 0xee, 0x4a, 0x47, 0xf9, 0xfe, 0x73, 0x07, 0x89, 0xa8, 0x39, 0xea, - 0x82, 0x9e, 0xcf, 0x26, 0xb2, 0x4e, 0xc3, 0x59, 0xf2, 0x3d, 0x9a, 0xb0, 0x69, 0xf7, 0xbc, 0x34, - 0xe5, 0x36, 0x22, 0xfb, 0x57, 0x71, 0x99, 0x6c, 0x83, 0x30, 0x55, 0xc2, 0xbd, 0xf4, 0x77, 0xe9, - 0x76, 0x97, 0xa0, 0xe0, 0xb9, 0x86, 0x6b, 0xa3, 0x84, 0x67, 0x1a, 0x70, 0x02, 0x5a, 0x41, 0x5c, - 0x25, 0x81, 0xaa, 0x28, 0x78, 0x4b, 0xc6, 0x64, 0x53, 0x16, 0x4d, 0x8b, 0x20, 0x93, 0xae, 0x0f, - 0x94, 0x2c, 0x3a, 0xc7, 0x62, 0xe8, 0xc4, 0xdb, 0x04, 0xc5, 0xfa, 0x29, 0x48, 0xd1, 0x08, 0x24, - 0x0d, 0xe2, 0xd8, 0x10, 0xb4, 0x91, 0x8a, 0x13, 0x0e, 0xdc, 0xd2, 0x79, 0xb8, 0xf8, 0xba, 0x2d, - 0xcb, 0xf5, 0x7d, 0x37, 0x51, 0x40, 0x31, 0xa2, 0x0b, 0x18, 0x63, 0x7f, 0xb3, 0xab, 0x9b, 0x87, - 0xf6, 0x90, 0xde, 0xc8, 0x27, 0x45, 0x7c, 0x1c, 0x85, 0x68, 0x33, 0x19, 0x03, 0x75, 0x15, 0x7a, - 0x1f, 0x49, 0x8f, 0x4c, 0xc1, 0x44, 0x17, 0x12, 0x6f, 0x32, 0xb7, 0x3e, 0x74, 0x1e, 0x21, 0x6a, -}; - - - -const UINT8 kof2000_address_8_15_xor1[256] = -{ - 0xfc, 0x9b, 0x1c, 0x35, 0x72, 0x53, 0xd6, 0x7d, 0x84, 0xa4, 0xc5, 0x93, 0x7b, 0xe7, 0x47, 0xd5, - 0x24, 0xa2, 0xfa, 0x19, 0x0c, 0xb1, 0x8c, 0xb9, 0x9d, 0xd8, 0x59, 0x4f, 0x3c, 0xb2, 0x78, 0x4a, - 0x2a, 0x96, 0x9a, 0xf1, 0x1f, 0x22, 0xa8, 0x5b, 0x67, 0xa3, 0x0f, 0x00, 0xfb, 0xdf, 0xeb, 0x0a, - 0x57, 0xb8, 0x25, 0xd7, 0xf0, 0x6b, 0x0b, 0x31, 0x95, 0x23, 0x2d, 0x5c, 0x27, 0xc7, 0xf4, 0x55, - 0x1a, 0xf7, 0x74, 0xbe, 0xd3, 0xac, 0x3d, 0xc1, 0x7f, 0xbd, 0x28, 0x01, 0x10, 0xe5, 0x09, 0x37, - 0x1e, 0x58, 0xaf, 0x17, 0xf2, 0x16, 0x30, 0x92, 0x36, 0x68, 0xe6, 0xd4, 0xea, 0xb7, 0x75, 0x54, - 0x77, 0x41, 0xb4, 0x8d, 0xe0, 0xf3, 0x51, 0x03, 0xa9, 0xe8, 0x66, 0xab, 0x29, 0xa5, 0xed, 0xcb, - 0xd1, 0xaa, 0xf5, 0xdb, 0x4c, 0x42, 0x97, 0x8a, 0xae, 0xc9, 0x6e, 0x04, 0x33, 0x85, 0xdd, 0x2b, - 0x6f, 0xef, 0x12, 0x21, 0x7a, 0xa1, 0x5a, 0x91, 0xc8, 0xcc, 0xc0, 0xa7, 0x60, 0x3e, 0x56, 0x2f, - 0xe4, 0x71, 0x99, 0xc2, 0xa0, 0x45, 0x80, 0x65, 0xbb, 0x87, 0x69, 0x81, 0x73, 0xca, 0xf6, 0x46, - 0x43, 0xda, 0x26, 0x7e, 0x8f, 0xe1, 0x8b, 0xfd, 0x50, 0x79, 0xba, 0xc6, 0x63, 0x4b, 0xb3, 0x8e, - 0x34, 0xe2, 0x48, 0x14, 0xcd, 0xe3, 0xc4, 0x05, 0x13, 0x40, 0x06, 0x6c, 0x88, 0xb0, 0xe9, 0x1b, - 0x4d, 0xf8, 0x76, 0x02, 0x44, 0x94, 0xcf, 0x32, 0xfe, 0xce, 0x3b, 0x5d, 0x2c, 0x89, 0x5f, 0xdc, - 0xd2, 0x9c, 0x6a, 0xec, 0x18, 0x6d, 0x0e, 0x86, 0xff, 0x5e, 0x9e, 0xee, 0x11, 0xd0, 0x49, 0x52, - 0x4e, 0x61, 0x90, 0x0d, 0xc3, 0x39, 0x15, 0x83, 0xb5, 0x62, 0x3f, 0x70, 0x7c, 0xad, 0x20, 0xbf, - 0x2e, 0x08, 0x1d, 0xf9, 0xb6, 0xa6, 0x64, 0x07, 0x82, 0x38, 0x98, 0x3a, 0x9f, 0xde, 0xbc, 0xd9, -}; - -const UINT8 kof2000_address_8_15_xor2[256] = -{ - 0x00, 0xbe, 0x06, 0x5a, 0xfa, 0x42, 0x15, 0xf2, 0x3f, 0x0a, 0x84, 0x93, 0x4e, 0x78, 0x3b, 0x89, - 0x32, 0x98, 0xa2, 0x87, 0x73, 0xdd, 0x26, 0xe5, 0x05, 0x71, 0x08, 0x6e, 0x9b, 0xe0, 0xdf, 0x9e, - 0xfc, 0x83, 0x81, 0xef, 0xb2, 0xc0, 0xc3, 0xbf, 0xa7, 0x6d, 0x1b, 0x95, 0xed, 0xb9, 0x3e, 0x13, - 0xb0, 0x47, 0x9c, 0x7a, 0x24, 0x41, 0x68, 0xd0, 0x36, 0x0b, 0xb5, 0xc2, 0x67, 0xf7, 0x54, 0x92, - 0x1e, 0x44, 0x86, 0x2b, 0x94, 0xcc, 0xba, 0x23, 0x0d, 0xca, 0x6b, 0x4c, 0x2a, 0x9a, 0x2d, 0x8b, - 0xe3, 0x52, 0x29, 0xf0, 0x21, 0xbd, 0xbb, 0x1f, 0xa3, 0xab, 0xf8, 0x46, 0xb7, 0x45, 0x82, 0x5e, - 0xdb, 0x07, 0x5d, 0xe9, 0x9d, 0x1a, 0x48, 0xce, 0x91, 0x12, 0xd4, 0xee, 0xa9, 0x39, 0xf1, 0x18, - 0x2c, 0x22, 0x8a, 0x7e, 0x34, 0x4a, 0x8c, 0xc1, 0x14, 0xf3, 0x20, 0x35, 0xd9, 0x96, 0x33, 0x77, - 0x9f, 0x76, 0x7c, 0x90, 0xc6, 0xd5, 0xa1, 0x5b, 0xac, 0x75, 0xc7, 0x0c, 0xb3, 0x17, 0xd6, 0x99, - 0x56, 0xa6, 0x3d, 0x1d, 0xb1, 0x2e, 0xd8, 0xbc, 0x2f, 0xde, 0x60, 0x55, 0x6c, 0x40, 0xcd, 0x43, - 0xff, 0xad, 0x38, 0x79, 0x51, 0xc8, 0x0e, 0x5f, 0xc4, 0x66, 0xcb, 0xa8, 0x7d, 0xa4, 0x3a, 0xea, - 0x27, 0x7b, 0x70, 0x8e, 0x5c, 0x19, 0x0f, 0x80, 0x6f, 0x8f, 0x10, 0xf9, 0x49, 0x85, 0x69, 0x7f, - 0xeb, 0x1c, 0x01, 0x65, 0x37, 0xa5, 0x28, 0xe4, 0x6a, 0x03, 0x04, 0xd1, 0x31, 0x11, 0x30, 0xfb, - 0x88, 0x97, 0xd3, 0xf6, 0xc5, 0x4d, 0xf5, 0x3c, 0xe8, 0x61, 0xdc, 0xd2, 0xb4, 0xb8, 0xa0, 0xae, - 0x16, 0x25, 0x02, 0x09, 0xfe, 0xcf, 0x53, 0x63, 0xaf, 0x59, 0xf4, 0xe1, 0xec, 0xd7, 0xe7, 0x50, - 0xe2, 0xc9, 0xaa, 0x4b, 0x8d, 0x4f, 0xe6, 0x64, 0xda, 0x74, 0xb6, 0x72, 0x57, 0x62, 0xfd, 0x58, -}; - -const UINT8 kof2000_address_16_23_xor1[256] = -{ - 0x45, 0x9f, 0x6e, 0x2f, 0x28, 0xbc, 0x5e, 0x6d, 0xda, 0xb5, 0x0d, 0xb8, 0xc0, 0x8e, 0xa2, 0x32, - 0xee, 0xcd, 0x8d, 0x48, 0x8c, 0x27, 0x14, 0xeb, 0x65, 0xd7, 0xf2, 0x93, 0x99, 0x90, 0x91, 0xfc, - 0x5f, 0xcb, 0xfa, 0x75, 0x3f, 0x26, 0xde, 0x72, 0x33, 0x39, 0xc7, 0x1f, 0x88, 0x79, 0x73, 0xab, - 0x4e, 0x36, 0x5d, 0x44, 0xd2, 0x41, 0xa0, 0x7e, 0xa7, 0x8b, 0xa6, 0xbf, 0x03, 0xd8, 0x86, 0xdc, - 0x2c, 0xaa, 0x70, 0x3d, 0x46, 0x07, 0x80, 0x58, 0x0b, 0x2b, 0xe2, 0xf0, 0xb1, 0xfe, 0x42, 0xf3, - 0xe9, 0xa3, 0x85, 0x78, 0xc3, 0xd0, 0x5a, 0xdb, 0x1a, 0xfb, 0x9d, 0x8a, 0xa5, 0x12, 0x0e, 0x54, - 0x8f, 0xc5, 0x6c, 0xae, 0x25, 0x5b, 0x4b, 0x17, 0x02, 0x9c, 0x4a, 0x24, 0x40, 0xe5, 0x9e, 0x22, - 0xc6, 0x49, 0x62, 0xb6, 0x6b, 0xbb, 0xa8, 0xcc, 0xe8, 0x81, 0x50, 0x47, 0xc8, 0xbe, 0x5c, 0xa4, - 0xd6, 0x94, 0x4f, 0x7b, 0x9a, 0xcf, 0xe4, 0x59, 0x7a, 0xa1, 0xea, 0x31, 0x37, 0x13, 0x2d, 0xaf, - 0x21, 0x69, 0x19, 0x1d, 0x6f, 0x16, 0x98, 0x1e, 0x08, 0xe3, 0xb2, 0x4d, 0x9b, 0x7f, 0xa9, 0x77, - 0xed, 0xbd, 0xd4, 0xd9, 0x34, 0xd3, 0xca, 0x09, 0x18, 0x60, 0xc9, 0x6a, 0x01, 0xf4, 0xf6, 0x64, - 0xb4, 0x3a, 0x15, 0xac, 0x89, 0x52, 0x68, 0x71, 0xe7, 0x82, 0xc1, 0x0c, 0x92, 0xf7, 0x30, 0xe6, - 0x1c, 0x3e, 0x0f, 0x0a, 0x67, 0x35, 0xba, 0x61, 0xdd, 0x29, 0xc2, 0xf8, 0x97, 0x95, 0xb7, 0x3b, - 0xe0, 0xce, 0xf9, 0xd5, 0x06, 0x76, 0xb3, 0x05, 0x4c, 0x04, 0x84, 0x3c, 0x87, 0x23, 0x63, 0x7c, - 0x53, 0x56, 0xe1, 0x7d, 0x96, 0x1b, 0xd1, 0xec, 0x2a, 0x66, 0xf1, 0x11, 0x10, 0xff, 0x43, 0x2e, - 0xdf, 0x83, 0x74, 0xf5, 0x38, 0x20, 0xfd, 0xad, 0xc4, 0xb9, 0x55, 0x51, 0xb0, 0xef, 0x00, 0x57, -}; - -const UINT8 kof2000_address_16_23_xor2[256] = -{ - 0x00, 0xb8, 0xf0, 0x34, 0xca, 0x21, 0x3c, 0xf9, 0x01, 0x8e, 0x75, 0x70, 0xec, 0x13, 0x27, 0x96, - 0xf4, 0x5b, 0x88, 0x1f, 0xeb, 0x4a, 0x7d, 0x9d, 0xbe, 0x02, 0x14, 0xaf, 0xa2, 0x06, 0xc6, 0xdb, - 0x35, 0x6b, 0x74, 0x45, 0x7b, 0x29, 0xd2, 0xfe, 0xb6, 0x15, 0xd0, 0x8a, 0xa9, 0x2d, 0x19, 0xf6, - 0x5e, 0x5a, 0x90, 0xe9, 0x11, 0x33, 0xc2, 0x47, 0x37, 0x4c, 0x4f, 0x59, 0xc3, 0x04, 0x57, 0x1d, - 0xf2, 0x63, 0x6d, 0x6e, 0x31, 0x95, 0xcb, 0x3e, 0x67, 0xb2, 0xe3, 0x98, 0xed, 0x8d, 0xe6, 0xfb, - 0xf8, 0xba, 0x5d, 0xd4, 0x2a, 0xf5, 0x3b, 0x82, 0x05, 0x16, 0x44, 0xef, 0x4d, 0xe7, 0x93, 0xda, - 0x9f, 0xbb, 0x61, 0xc9, 0x53, 0xbd, 0x76, 0x78, 0x52, 0x36, 0x0c, 0x66, 0xc1, 0x10, 0xdd, 0x7a, - 0x84, 0x69, 0xcd, 0xfd, 0x58, 0x0d, 0x6c, 0x89, 0x68, 0xad, 0x3a, 0xb0, 0x4b, 0x46, 0xc5, 0x03, - 0xb4, 0xf7, 0x30, 0x8c, 0x4e, 0x60, 0x73, 0xa1, 0x8b, 0xb1, 0x62, 0xcc, 0xd1, 0x08, 0xfc, 0x77, - 0x7e, 0xcf, 0x56, 0x51, 0x07, 0xa6, 0x80, 0x92, 0xdc, 0x0b, 0xa4, 0xc7, 0xe8, 0xe1, 0xb5, 0x71, - 0xea, 0xb3, 0x2f, 0x94, 0x18, 0xe2, 0x3d, 0x49, 0x65, 0xaa, 0xf1, 0x91, 0xc8, 0x99, 0x55, 0x79, - 0x86, 0xa7, 0x26, 0xa0, 0xac, 0x5f, 0xce, 0x6a, 0x5c, 0xf3, 0x87, 0x8f, 0x12, 0x1c, 0xd8, 0xe4, - 0x9b, 0x64, 0x2e, 0x1e, 0xd7, 0xc0, 0x17, 0xbc, 0xa3, 0xa8, 0x9a, 0x0e, 0x25, 0x40, 0x41, 0x50, - 0xb9, 0xbf, 0x28, 0xdf, 0x32, 0x54, 0x9e, 0x48, 0xd5, 0x2b, 0x42, 0xfa, 0x9c, 0x7f, 0xd3, 0x85, - 0x43, 0xde, 0x81, 0x0f, 0x24, 0xc4, 0x38, 0xae, 0x83, 0x1b, 0x6f, 0x7c, 0xe5, 0xff, 0x1a, 0xd9, - 0x3f, 0xb7, 0x22, 0x97, 0x09, 0xe0, 0xa5, 0x20, 0x23, 0x2c, 0x72, 0xd6, 0x39, 0xab, 0x0a, 0xee, -}; - -const UINT8 kof2000_address_0_7_xor[256] = -{ - 0x26, 0x48, 0x06, 0x9b, 0x21, 0xa9, 0x1b, 0x76, 0xc9, 0xf8, 0xb4, 0x67, 0xe4, 0xff, 0x99, 0xf7, - 0x15, 0x9e, 0x62, 0x00, 0x72, 0x4d, 0xa0, 0x4f, 0x02, 0xf1, 0xea, 0xef, 0x0b, 0xf3, 0xeb, 0xa6, - 0x93, 0x78, 0x6f, 0x7c, 0xda, 0xd4, 0x7b, 0x05, 0xe9, 0xc6, 0xd6, 0xdb, 0x50, 0xce, 0xd2, 0x01, - 0xb5, 0xe8, 0xe0, 0x2a, 0x08, 0x1a, 0xb8, 0xe3, 0xf9, 0xb1, 0xf4, 0x8b, 0x39, 0x2d, 0x85, 0x9c, - 0x55, 0x73, 0x63, 0x40, 0x38, 0x96, 0xdc, 0xa3, 0xa2, 0xa1, 0x25, 0x66, 0x6d, 0x56, 0x8e, 0x10, - 0x0f, 0x31, 0x1c, 0xf5, 0x28, 0x77, 0x0a, 0xd1, 0x75, 0x34, 0xa4, 0xfe, 0x7d, 0x07, 0x51, 0x79, - 0x41, 0x90, 0x22, 0x35, 0x12, 0xbb, 0xc4, 0xca, 0xb2, 0x1f, 0xcb, 0xc8, 0xac, 0xdd, 0xd0, 0x0d, - 0xfc, 0xc5, 0x9d, 0x14, 0xbc, 0x83, 0xd9, 0x58, 0xc2, 0x30, 0x9a, 0x6a, 0xc0, 0x0c, 0xad, 0xf6, - 0x5d, 0x74, 0x7f, 0x2f, 0xbd, 0x1d, 0x47, 0xd5, 0xe6, 0x89, 0xcf, 0xb7, 0xd3, 0x59, 0x36, 0x98, - 0xf0, 0xfb, 0x3c, 0xf2, 0x3f, 0xa7, 0x18, 0x82, 0x42, 0x5c, 0xab, 0xba, 0xde, 0x52, 0x09, 0x91, - 0xaa, 0x61, 0xec, 0xd7, 0x95, 0x23, 0xcd, 0x80, 0xa5, 0x68, 0x60, 0x27, 0x71, 0xe1, 0x2c, 0x2e, - 0x8d, 0x2b, 0x57, 0x65, 0xbf, 0xc1, 0x19, 0xc7, 0x49, 0x64, 0x88, 0x4a, 0xcc, 0x20, 0x4e, 0xd8, - 0x3b, 0x4c, 0x13, 0x5f, 0x9f, 0xbe, 0x5e, 0x6e, 0xfd, 0xe2, 0xfa, 0x54, 0x37, 0x0e, 0x16, 0x7a, - 0x6c, 0x33, 0xb3, 0x70, 0x84, 0x7e, 0xc3, 0x04, 0xb0, 0xae, 0xb9, 0x81, 0x03, 0x29, 0xdf, 0x46, - 0xe5, 0x69, 0xe7, 0x24, 0x92, 0x5a, 0x4b, 0x5b, 0x94, 0x11, 0x3a, 0x3d, 0x87, 0xed, 0x97, 0xb6, - 0x32, 0x3e, 0x45, 0xaf, 0x1e, 0x43, 0x44, 0x8c, 0x53, 0x86, 0x6b, 0xee, 0xa8, 0x8a, 0x8f, 0x17, -}; - - - - - -void NeoCMCExtractSData(UINT8* rom, UINT8* sdata, INT32 rom_size, INT32 sdata_size) -{ -#if 0 - /* the S data comes from the end fo the C data */ - rom += rom_size - sdata_size; - - for (INT32 i = 0; i < sdata_size; i++) { - sdata[i] = rom[(i & ~0x1F) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)]; - } -#endif - INT32 i; - // the S data comes from the end fo the C data - if (sdata_size == 0x100000) { - // 1 MB of data, special for kf2k3pcb - rom += rom_size - sdata_size /2; - for (i = 0; i < sdata_size / 2; i++) { - sdata[i + 0] = rom[(i & ~0x1F) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) - 0x1000000 ]; - sdata[i + sdata_size / 2] = rom[(i & ~0x1F) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)]; - } - } else { - // Normal data extraction - rom += rom_size - sdata_size; - for (i = 0; i < sdata_size; i++) { - sdata[i] = rom[(i & ~0x1F) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)]; - } - } -} - -inline static void cmc_xor(UINT8 *r0, UINT8 *r1, - const UINT8 *table0hi, - const UINT8 *table0lo, - const UINT8 *table1, - INT32 base, - INT32 invert) - -{ - UINT8 c0, c1, tmp, xor0, xor1; - - tmp = table1[(base & 0xff) ^ address_0_7_xor[(base >> 8) & 0xff]]; - xor0 = (table0hi[(base >> 8) & 0xff] & 0xfe) | (tmp & 0x01); - xor1 = (tmp & 0xfe) | (table0lo[(base >> 8) & 0xff] & 0x01); - - c0 = *r0; - c1 = *r1; - - if (invert) { - *r0 = c1 ^ xor0; - *r1 = c0 ^ xor1; - } else { - *r0 = c0 ^ xor0; - *r1 = c1 ^ xor1; - } -} - -void NeoCMCDecrypt(INT32 extra_xor, UINT8* rom, UINT8* buf, INT32 offset, INT32 block_size, INT32 rom_size) -{ - INT32 clamp_size, rpos; - - if (rom_size > 0x04000000) rom_size = 0x04000000; - - // Adjust variables for addressing 32bit words - rom_size >>= 2; - block_size >>= 2; - offset >>= 2; - - // special handling for games with 6 C ROMs - for (clamp_size = 1 << 30; clamp_size > rom_size; clamp_size >>= 1) { } - - // Data xor - for (rpos = 0; rpos < block_size; rpos++) - { - cmc_xor(buf+4*rpos+0, buf+4*rpos+3, type0_t03, type0_t12, type1_t03, rpos, (rpos>>8) & 1); - cmc_xor(buf+4*rpos+1, buf+4*rpos+2, type0_t12, type0_t03, type1_t12, rpos, (((rpos + offset)>>16) ^ address_16_23_xor2[(rpos>>8) & 0xff]) & 1); - } - - // Address xor - for (rpos = 0; rpos < block_size; rpos++) - { - INT32 baser = rpos + offset; - - baser ^= address_0_7_xor[(baser >> 8) & 0xff]; - baser ^= address_16_23_xor2[(baser >> 8) & 0xff] << 16; - baser ^= address_16_23_xor1[baser & 0xff] << 16; - - if (rpos + offset < clamp_size) - baser &= clamp_size - 1; - else - baser = clamp_size + (baser & ((clamp_size >> 1) - 1)); - - baser ^= address_8_15_xor2[baser & 0xff] << 8; - baser ^= address_8_15_xor1[(baser >> 16) & 0xff] << 8; - - baser ^= extra_xor; - - ((UINT32*)rom)[baser] = ((UINT32*)buf)[rpos]; - } -} - -/* CMC42 protection chip */ -void NeoCMC42Init() -{ - type0_t03 = kof99_type0_t03; - type0_t12 = kof99_type0_t12; - type1_t03 = kof99_type1_t03; - type1_t12 = kof99_type1_t12; - address_8_15_xor1 = kof99_address_8_15_xor1; - address_8_15_xor2 = kof99_address_8_15_xor2; - address_16_23_xor1 = kof99_address_16_23_xor1; - address_16_23_xor2 = kof99_address_16_23_xor2; - address_0_7_xor = kof99_address_0_7_xor; -} - -/* CMC50 protection chip */ -void NeoCMC50Init() -{ - type0_t03 = kof2000_type0_t03; - type0_t12 = kof2000_type0_t12; - type1_t03 = kof2000_type1_t03; - type1_t12 = kof2000_type1_t12; - address_8_15_xor1 = kof2000_address_8_15_xor1; - address_8_15_xor2 = kof2000_address_8_15_xor2; - address_16_23_xor1 = kof2000_address_16_23_xor1; - address_16_23_xor2 = kof2000_address_16_23_xor2; - address_0_7_xor = kof2000_address_0_7_xor; -} - -// M1 Decryption -static const UINT8 m1_address_8_15_xor[256] = { - 0x0a, 0x72, 0xb7, 0xaf, 0x67, 0xde, 0x1d, 0xb1, 0x78, 0xc4, 0x4f, 0xb5, 0x4b, 0x18, 0x76, 0xdd, - 0x11, 0xe2, 0x36, 0xa1, 0x82, 0x03, 0x98, 0xa0, 0x10, 0x5f, 0x3f, 0xd6, 0x1f, 0x90, 0x6a, 0x0b, - 0x70, 0xe0, 0x64, 0xcb, 0x9f, 0x38, 0x8b, 0x53, 0x04, 0xca, 0xf8, 0xd0, 0x07, 0x68, 0x56, 0x32, - 0xae, 0x1c, 0x2e, 0x48, 0x63, 0x92, 0x9a, 0x9c, 0x44, 0x85, 0x41, 0x40, 0x09, 0xc0, 0xc8, 0xbf, - 0xea, 0xbb, 0xf7, 0x2d, 0x99, 0x21, 0xf6, 0xba, 0x15, 0xce, 0xab, 0xb0, 0x2a, 0x60, 0xbc, 0xf1, - 0xf0, 0x9e, 0xd5, 0x97, 0xd8, 0x4e, 0x14, 0x9d, 0x42, 0x4d, 0x2c, 0x5c, 0x2b, 0xa6, 0xe1, 0xa7, - 0xef, 0x25, 0x33, 0x7a, 0xeb, 0xe7, 0x1b, 0x6d, 0x4c, 0x52, 0x26, 0x62, 0xb6, 0x35, 0xbe, 0x80, - 0x01, 0xbd, 0xfd, 0x37, 0xf9, 0x47, 0x55, 0x71, 0xb4, 0xf2, 0xff, 0x27, 0xfa, 0x23, 0xc9, 0x83, - 0x17, 0x39, 0x13, 0x0d, 0xc7, 0x86, 0x16, 0xec, 0x49, 0x6f, 0xfe, 0x34, 0x05, 0x8f, 0x00, 0xe6, - 0xa4, 0xda, 0x7b, 0xc1, 0xf3, 0xf4, 0xd9, 0x75, 0x28, 0x66, 0x87, 0xa8, 0x45, 0x6c, 0x20, 0xe9, - 0x77, 0x93, 0x7e, 0x3c, 0x1e, 0x74, 0xf5, 0x8c, 0x3e, 0x94, 0xd4, 0xc2, 0x5a, 0x06, 0x0e, 0xe8, - 0x3d, 0xa9, 0xb2, 0xe3, 0xe4, 0x22, 0xcf, 0x24, 0x8e, 0x6b, 0x8a, 0x8d, 0x84, 0x4a, 0xd2, 0x91, - 0x88, 0x79, 0x57, 0xa5, 0x0f, 0xcd, 0xb9, 0xac, 0x3b, 0xaa, 0xb3, 0xd1, 0xee, 0x31, 0x81, 0x7c, - 0xd7, 0x89, 0xd3, 0x96, 0x43, 0xc5, 0xc6, 0xc3, 0x69, 0x7f, 0x46, 0xdf, 0x30, 0x5b, 0x6e, 0xe5, - 0x08, 0x95, 0x9b, 0xfb, 0xb8, 0x58, 0x0c, 0x61, 0x50, 0x5d, 0x3a, 0xa2, 0x29, 0x12, 0xfc, 0x51, - 0x7d, 0x1a, 0x02, 0x65, 0x54, 0x5e, 0x19, 0xcc, 0xdc, 0xdb, 0x73, 0xed, 0xad, 0x59, 0x2f, 0xa3, -}; - -static const UINT8 m1_address_0_7_xor[256] = { - 0xf4, 0xbc, 0x02, 0xf7, 0x2c, 0x3d, 0xe8, 0xd9, 0x50, 0x62, 0xec, 0xbd, 0x53, 0x73, 0x79, 0x61, - 0x00, 0x34, 0xcf, 0xa2, 0x63, 0x28, 0x90, 0xaf, 0x44, 0x3b, 0xc5, 0x8d, 0x3a, 0x46, 0x07, 0x70, - 0x66, 0xbe, 0xd8, 0x8b, 0xe9, 0xa0, 0x4b, 0x98, 0xdc, 0xdf, 0xe2, 0x16, 0x74, 0xf1, 0x37, 0xf5, - 0xb7, 0x21, 0x81, 0x01, 0x1c, 0x1b, 0x94, 0x36, 0x09, 0xa1, 0x4a, 0x91, 0x30, 0x92, 0x9b, 0x9a, - 0x29, 0xb1, 0x38, 0x4d, 0x55, 0xf2, 0x56, 0x18, 0x24, 0x47, 0x9d, 0x3f, 0x80, 0x1f, 0x22, 0xa4, - 0x11, 0x54, 0x84, 0x0d, 0x25, 0x48, 0xee, 0xc6, 0x59, 0x15, 0x03, 0x7a, 0xfd, 0x6c, 0xc3, 0x33, - 0x5b, 0xc4, 0x7b, 0x5a, 0x05, 0x7f, 0xa6, 0x40, 0xa9, 0x5d, 0x41, 0x8a, 0x96, 0x52, 0xd3, 0xf0, - 0xab, 0x72, 0x10, 0x88, 0x6f, 0x95, 0x7c, 0xa8, 0xcd, 0x9c, 0x5f, 0x32, 0xae, 0x85, 0x39, 0xac, - 0xe5, 0xd7, 0xfb, 0xd4, 0x08, 0x23, 0x19, 0x65, 0x6b, 0xa7, 0x93, 0xbb, 0x2b, 0xbf, 0xb8, 0x35, - 0xd0, 0x06, 0x26, 0x68, 0x3e, 0xdd, 0xb9, 0x69, 0x2a, 0xb2, 0xde, 0x87, 0x45, 0x58, 0xff, 0x3c, - 0x9e, 0x7d, 0xda, 0xed, 0x49, 0x8c, 0x14, 0x8e, 0x75, 0x2f, 0xe0, 0x6e, 0x78, 0x6d, 0x20, 0xd2, - 0xfa, 0x2d, 0x51, 0xcc, 0xc7, 0xe7, 0x1d, 0x27, 0x97, 0xfc, 0x31, 0xdb, 0xf8, 0x42, 0xe3, 0x99, - 0x5e, 0x83, 0x0e, 0xb4, 0x2e, 0xf6, 0xc0, 0x0c, 0x4c, 0x57, 0xb6, 0x64, 0x0a, 0x17, 0xa3, 0xc1, - 0x77, 0x12, 0xfe, 0xe6, 0x8f, 0x13, 0x71, 0xe4, 0xf9, 0xad, 0x9f, 0xce, 0xd5, 0x89, 0x7e, 0x0f, - 0xc2, 0x86, 0xf3, 0x67, 0xba, 0x60, 0x43, 0xc9, 0x04, 0xb3, 0xb0, 0x1e, 0xb5, 0xc8, 0xeb, 0xa5, - 0x76, 0xea, 0x5c, 0x82, 0x1a, 0x4f, 0xaa, 0xca, 0xe1, 0x0b, 0x4e, 0xcb, 0x6a, 0xef, 0xd1, 0xd6, -}; - -static UINT16 generate_cs16(UINT8 *rom, INT32 size) -{ - UINT16 cs16; - cs16 = 0x0000; - for (INT32 i = 0; i < size; i++) { - cs16 += rom[i]; - } - return cs16 & 0xffff; -} - -static INT32 m1_address_scramble(INT32 address, UINT16 key) -{ - INT32 block; - INT32 aux; - - const INT32 p1[8][16] = { - {15, 14, 10, 7, 1, 2, 3, 8, 0, 12, 11, 13, 6, 9, 5, 4}, - { 7, 1, 8, 11, 15, 9, 2, 3, 5, 13, 4, 14, 10, 0, 6, 12}, - { 8, 6, 14, 3, 10, 7, 15, 1, 4, 0, 2, 5, 13, 11, 12, 9}, - { 2, 8, 15, 9, 3, 4, 11, 7, 13, 6, 0, 10, 1, 12, 14, 5}, - { 1, 13, 6, 15, 14, 3, 8, 10, 9, 4, 7, 12, 5, 2, 0, 11}, - {11, 15, 3, 4, 7, 0, 9, 2, 6, 14, 12, 1, 8, 5, 10, 13}, - {10, 5, 13, 8, 6, 15, 1, 14, 11, 9, 3, 0, 12, 7, 4, 2}, - { 9, 3, 7, 0, 2, 12, 4, 11, 14, 10, 5, 8, 15, 13, 1, 6}, - }; - - block = (address >> 16) & 7; - aux = address & 0xffff; - - aux ^= BITSWAP16(key, 12, 0, 2, 4, 8, 15, 7, 13, 10, 1, 3, 6, 11, 9, 14, 5); - aux = BITSWAP16(aux, - p1[block][15], p1[block][14], p1[block][13], p1[block][12], - p1[block][11], p1[block][10], p1[block][9] , p1[block][8], - p1[block][7] , p1[block][6] , p1[block][5] , p1[block][4], - p1[block][3] , p1[block][2] , p1[block][1] , p1[block][0]); - aux ^= m1_address_0_7_xor[(aux >> 8) & 0xff]; - aux ^= m1_address_8_15_xor[aux & 0xff] << 8; - aux = BITSWAP16(aux, 7, 15, 14, 6, 5, 13, 12, 4, 11, 3, 10, 2, 9, 1, 8, 0); - - return (block << 16) | aux; -} - -void neogeo_cmc50_m1_decrypt() -{ - UINT8 *rom = NeoZ80ROMActive; - UINT8 *buffer = (UINT8*)BurnMalloc(0x80000); - - UINT16 key = generate_cs16(rom, 0x10000); - - for (INT32 i = 0; i < 0x80000; i++) { - buffer[i] = rom[m1_address_scramble(i, key)]; - } - - memcpy(rom, buffer, 0x80000); - BurnFree(buffer); -} diff --git a/jan/src/burn/drv/neogeo/neo_palette.cpp b/jan/src/burn/drv/neogeo/neo_palette.cpp deleted file mode 100644 index fd5b7d564..000000000 --- a/jan/src/burn/drv/neogeo/neo_palette.cpp +++ /dev/null @@ -1,109 +0,0 @@ -#include "neogeo.h" -// Neo Geo -- palette functions - -UINT8* NeoPalSrc[2]; // Pointer to input palettes -UINT32* NeoPalette; -INT32 nNeoPaletteBank; // Selected palette bank - -static UINT32* NeoPaletteData[2] = {NULL, NULL}; -static UINT16* NeoPaletteCopy[2] = {NULL, NULL}; - -UINT8 NeoRecalcPalette; - -INT32 NeoInitPalette() -{ - for (INT32 i = 0; i < 2; i++) { - if (NeoPaletteData[i]) { - BurnFree(NeoPaletteData[i]); - } - if (NeoPaletteCopy[i]) { - BurnFree(NeoPaletteCopy[i]); - } - NeoPaletteData[i] = (UINT32*)BurnMalloc(4096 * sizeof(UINT32)); - NeoPaletteCopy[i] = (UINT16*)BurnMalloc(4096 * sizeof(UINT16)); - } - - NeoRecalcPalette = 1; - - return 0; -} - -void NeoExitPalette() -{ - for (INT32 i = 0; i < 2; i++) { - BurnFree(NeoPaletteData[i]); - BurnFree(NeoPaletteCopy[i]); - } -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r = (nColour & 0x0F00) >> 4; // Red - r |= (nColour >> 11) & 8; - INT32 g = (nColour & 0x00F0); // Green - g |= (nColour >> 10) & 8; - INT32 b = (nColour & 0x000F) << 4; // Blue - b |= (nColour >> 9) & 8; - - r |= r >> 5; - g |= g >> 5; - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -INT32 NeoUpdatePalette() -{ - if (NeoRecalcPalette) { - INT32 i; - UINT16* ps; - UINT16* pc; - UINT32* pd; - - // Update both palette banks - for (INT32 j = 0; j < 2; j++) { - for (i = 0, ps = (UINT16*)NeoPalSrc[j], pc = NeoPaletteCopy[j], pd = NeoPaletteData[j]; i < 4096; i++, ps++, pc++, pd++) { - *pc = *ps; - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*ps)); - } - } - - NeoRecalcPalette = 0; - - } - - return 0; -} - -void NeoSetPalette() -{ - NeoPalette = NeoPaletteData[nNeoPaletteBank]; -} - -// Update the PC copy of the palette on writes to the palette memory -void __fastcall NeoPalWriteByte(UINT32 nAddress, UINT8 byteValue) -{ - nAddress &= 0x1FFF; - nAddress ^= 1; - - NeoPalSrc[nNeoPaletteBank][nAddress] = byteValue; // write byte - - if (*((UINT8*)(NeoPaletteCopy[nNeoPaletteBank] + nAddress)) != byteValue) { - *((UINT8*)(NeoPaletteCopy[nNeoPaletteBank] + nAddress)) = byteValue; - NeoPaletteData[nNeoPaletteBank][nAddress >> 1] = CalcCol(*(UINT16*)(NeoPalSrc[nNeoPaletteBank] + (nAddress & ~0x01))); - } -} - -void __fastcall NeoPalWriteWord(UINT32 nAddress, UINT16 wordValue) -{ - nAddress &= 0x1FFF; - nAddress >>= 1; - - ((UINT16*)NeoPalSrc[nNeoPaletteBank])[nAddress] = BURN_ENDIAN_SWAP_INT16(wordValue); // write word - - if (NeoPaletteCopy[nNeoPaletteBank][nAddress] != BURN_ENDIAN_SWAP_INT16(wordValue)) { - NeoPaletteCopy[nNeoPaletteBank][nAddress] = BURN_ENDIAN_SWAP_INT16(wordValue); - NeoPaletteData[nNeoPaletteBank][nAddress] = CalcCol(wordValue); - } -} - diff --git a/jan/src/burn/drv/neogeo/neo_run.cpp b/jan/src/burn/drv/neogeo/neo_run.cpp deleted file mode 100644 index 16ae0f843..000000000 --- a/jan/src/burn/drv/neogeo/neo_run.cpp +++ /dev/null @@ -1,4893 +0,0 @@ -/* - -struct NeoMediaInfo { - UINT8* p68KROM; - UINT8* pVector; - UINT8* pZ80ROM; - UINT8* pSpriteROM; - UINT8* pTextROM; - UINT8* pADPCMROM; - UINT8* pDeltaTROM; - - INT32 n68KBankOffset; - INT32 nVectorOffset; - - INT32 n68KROMSize; - INT32 nZ80ROMSize; - INT32 nSpriteROMSize; - INT32 nTextROMSize; - INT32 nADPCMROMSize; - INT32 nADeltaROMSize; - - // Function callbacks - - void (*pLoadCallback)(); - void (*pUnloadCallback)(); - void (*pInstallCallback)(); - void (*pUnnstallCallback)(); - void (*pBankswitchCallback)(); - INT32 (*pScan)(int, int*); - - // Private data - - INT32 nSRAMProtectionOffset; - - void* pCustomData; - void* pTextData; -}; - -*/ - -/* - * FB Alpha Neo Geo module - * - * The video frequencies of MVS hardware are: - * hsync: 15625 Hz - * vsync: ~59.18 Hz (264 scanlines make up a single frame) - * The image occupies 224 scanlines, spanning scanlines 24 to 248. - * - * The memory card interface occupies 128KB of memory. There are 2 kinds of - * memory cards that can be used -- 16bit or 8bit. For games, a maximum of 16kB - * data is stored on either, but 16bit cards can be used to transfer bookkeeping - * information. For 8bit cards, only odd bytes are used to address memory and - * the BIOS tests the size of the inserted card by writing to the first byte of - * each 2kB block. The interface used is JEIDA 3.0. - * - * bit 6 of memory location 0x300081 = 0 -> 1/2 slot MVS - * = 1 + bit 5 of 0x320001 = 0 -> 4 slot MVS - * = 1 -> 6 slot MVS - * - * On MVS hardware with multiple slots, address 0x380021 is used to select the - * active slot. - * - * The watchdog timer will reset the system after ~0.13 seconds - * - * On an MV-1F system, the following code was used to test: - * 000100 203C 0001 4F51 MOVE.L #0x14F51,D0 - * 000106 13C0 0030 0001 MOVE.B D0,0x300001 - * 00010C 5380 SUBQ.L #1,D0 - * 00010E 64FC BCC.S *-0x2 [0x10C] - * 000110 13C0 0030 0001 MOVE.B D0,0x300001 - * 000116 60F8 BRA.S *-0x6 [0x110] - * This code loops long enough to sometimes cause a reset, sometimes not. - * The move takes 16 cycles, subq 8, bcc 10 if taken and 8 if not taken, so: - * (0x14F51 * 18 + 14) cycles / 12000000 cycles per second = 0.12876 seconds - * - * Newer games force a reset using the following code (this from kof99): - * 009CDA 203C 0003 0D40 MOVE.L #0x30D40,D0 - * 009CE0 5380 SUBQ.L #1,D0 - * 009CE2 64FC BCC.S *-0x2 [0x9CE0] - * Note however that there is a valid code path after this loop, and indeed - * there are many games that employ the watchdog as a protection device, by - * writing a value to SRAM (usually to 0xD00100) when the watchdog doesn't - * trigger a reset. Later on, the presence of this value can trigger various - * actions, usually a text screen indicating the game is an unlicensed copy. - * - * On AES hardware, reading unmapped memory returns the last value that was on - * the data-bus. - * - * Raster interrupts can be generated by specifying an offset, in pixels. - * This offset can be added to the following (depending on a control register): - * - the position of the electron beam, when setting the offset - * - the position of the electron beam, when interrupt 2 is triggered - * - the position of the electron beam, when interrupt 4 (vblank) is triggered - * - * Note that the offset is *always* relative; when setting the offset from the - * vblank (scanline 248), to trigger an interrupt at scanline 24, you would - * point the offset to 24 scanlines past the screen end at line 264, and set it - * to 15360 (40 scanlines * 384 pixels per scanline). - * - */ - -#include "neogeo.h" -#include "cd_interface.h" -#include "burn_ym2610.h" -#include "bitswap.h" -#include "neocdlist.h" - -// #undef USE_SPEEDHACKS - -// #define LOG_IRQ -// #define LOG_DRAW - -#define NEO_HREFRESH (15625.0) -#define NEO_VREFRESH (NEO_HREFRESH / 264.0) -// #define NEO_VREFRESH (NEO_HREFRESH / 312.0) - -// If defined, enable emulation of the watchdog timer (timing doesn't match real hardware 100%) -#define EMULATE_WATCHDOG - -// If defined, reset the Z80 when switching between the Z80 BIOS/cartridge ROM -//#define Z80_RESET_ON_BANKSWITCH - -// If defined, adjust the Z80 speed along with the 68000 when overclocking -#define Z80_SPEED_ADJUST - -// If defined, use kludges to better align raster effects in some games (e.g. mosyougi) -#define RASTER_KLUDGE - -// If defined, use the bAllowRasters variable to enable/disable raster effects -// #define RASTERS_OPTIONAL - -#if defined Z80_SPEED_ADJUST - static INT32 nZ80Clockspeed; -#else - static const INT32 nZ80Clockspeed = 4000000; -#endif - -#if defined RASTER_KLUDGE - static UINT16 nScanlineOffset; -#else - // 0xF8 is correct as verified on MVS hardware - static const UINT16 nScanlineOffset = 0xF8; -#endif - -#if defined RASTERS_OPTIONAL - static bool bAllowRasters = false; -#endif - -// The number of cartridge slots on the emulated MVS hardware (can be 1, 2, 4, or 6) -UINT8 nNeoNumSlots = 1; - -UINT32 nNeoActiveSlot = 0; - -UINT8 NeoButton1[32] = { 0, }; -UINT8 NeoButton2[8] = { 0, }; -UINT8 NeoButton3[8] = { 0, }; -UINT8 NeoButton4[8] = { 0, }; -UINT8 NeoJoy1[8] = { 0, }; -UINT8 NeoJoy2[8] = { 0, }; -UINT8 NeoJoy3[8] = { 0, }; -UINT8 NeoJoy4[8] = { 0, }; -UINT16 NeoAxis[2] = { 0, }; -UINT8 NeoInput[32] = { 0, }; -UINT8 NeoDiag[2] = { 0, }; -UINT8 NeoDebugDip[2] = { 0, }; -UINT8 NeoReset = 0, NeoSystem = 0; - -static UINT8 OldDebugDip[2]; - -// Which 68K BIOS to use -INT32 nBIOS; - -// Joyports are multiplexed -static INT32 nJoyport0[8] = { 0, }; -static INT32 nJoyport1[8] = { 0, }; - -// Ports always mirror the joystick, except when other controllers are hooked up: -// -// input no. corresponds to -// -// Joyport0: 0x00 : trackball X in irrmaze / p1 paddle in popbounc -// 0x01 : trackball Y in irrmaze -// 0x09 : mahjong controller -// 0x12 : mahjong controller (BIOS controls) -// 0x1B : Always has p1 joystick & buttons -// 0x24 : mahjong controller -// 0x20 & 0x21 : selected by irrmaze instead of 0x00 & 0x01 when you lose a life -// (activates air-jets) -// Joyport1: 0x00 : p2 paddle in popbounc -// 0x1B : Always has p2 joystick & buttons - -// ---------------------------------------------------------------------------- -// Variables that need to be included in savestates - -static INT32 nCyclesExtra[2]; -static INT32 nPrevBurnCPUSpeedAdjust; - -bool bNeoEnableGraphics; - -UINT32 nNeo68KROMBank; - -static INT32 nIRQAcknowledge; - -static INT32 nIRQControl; -static bool bSRAMWritable; - -static bool b68KBoardROMBankedIn; -static bool bZ80BoardROMBankedIn; -static INT32 nZ80Bank0, nZ80Bank1, nZ80Bank2, nZ80Bank3; - -static UINT8* NeoGraphicsRAMBank; -static UINT16 NeoGraphicsRAMPointer; -static INT32 nNeoGraphicsModulo; - -INT32 nNeoSpriteFrame; - -static INT32 nSpriteFrameSpeed; -static INT32 nSpriteFrameTimer; - -static UINT8 nSoundLatch; -static UINT8 nSoundReply; -static UINT32 nSoundStatus; - -#if 1 && defined USE_SPEEDHACKS -static INT32 nSoundPrevReply; -#endif - -static INT32 nInputSelect; -static UINT8* NeoInputBank; -static UINT32 nAnalogAxis[2]; - -static UINT32 nuPD4990ATicks; - -static UINT32 nIRQOffset; - -#define NO_IRQ_PENDING (0x7FFFFFFF) -static INT32 nIRQCycles; - -#if defined EMULATE_WATCHDOG -static INT32 nNeoWatchdog; -#endif - -bool bDisableNeoWatchdog = false; - -static INT32 nNeoCDIRQVector; -static INT32 nNeoCDIRQVectorAck; - -static INT32 nNeoCDZ80ProgWriteWordCancelHack = 0; - -INT32 nNeoScreenWidth; - -UINT8 nLEDLatch, nLED[3]; - -// ---------------------------------------------------------------------------- - -static bool bMemoryCardInserted, bMemoryCardWritable; - -NEO_CALLBACK NeoCallback[MAX_SLOT] = { { NULL, NULL, NULL, NULL, NULL }, }; -NEO_CALLBACK* NeoCallbackActive = &NeoCallback[0]; - -static INT32 nCyclesTotal[2]; -static INT32 nCyclesSegment; -static INT32 nCyclesVBlank; -static INT32 nCycles68KSync; - -UINT8 *Neo68KROM[MAX_SLOT] = { NULL, }, *Neo68KROMActive = NULL; -UINT8 *NeoVector[MAX_SLOT] = { NULL, }, *NeoVectorActive = NULL; -UINT8 *Neo68KFix[MAX_SLOT] = { NULL, }; -UINT8 *NeoZ80ROM[MAX_SLOT] = { NULL, }, *NeoZ80ROMActive = NULL; - -static UINT8 *AllRAM = NULL, *RAMEnd = NULL, *AllROM = NULL, *ROMEnd = NULL; - -UINT8 *NeoSpriteRAM, *NeoTextRAM; - -UINT8 *Neo68KBIOS, *NeoZ80BIOS; -static UINT8 *Neo68KRAM, *NeoZ80RAM, *NeoNVRAM, *NeoNVRAM2, *NeoMemoryCard; - -static UINT32 nSpriteSize[MAX_SLOT] = { 0, }; -static UINT32 nCodeSize[MAX_SLOT] = { 0, }; - -UINT8* NeoGraphicsRAM; - -UINT8* YM2610ADPCMAROM[MAX_SLOT] = { NULL, }; -UINT8* YM2610ADPCMBROM[MAX_SLOT] = { NULL, }; - -static INT32 nYM2610ADPCMASize[MAX_SLOT] = { 0, }; -static INT32 nYM2610ADPCMBSize[MAX_SLOT] = { 0, }; - -static bool bIRQEnabled; -static INT32 nVBLankIRQ; -static INT32 nScanlineIRQ; - -static bool bRenderImage; - -static bool bRenderLineByLine; - -static bool bForcePartialRender; -static bool bForceUpdateOnStatusRead; - -static INT32 nNeoControlConfig; - -static INT32 nNeoSystemType; -static bool bZ80BIOS; - -static INT32 /*nNeoCDCyclesIRQ = 0,*/ nNeoCDCyclesIRQPeriod = 0; - -#ifdef BUILD_A68K -static bool bUseAsm68KCoreOldValue = false; -#endif - -bool IsNeoGeoCD() { - return (nNeoSystemType & NEO_SYS_CD); -} - -// This function is called once to determine how much memory is needed (RAMEnd-(UINT8 *)0), -// then a second time after the memory is allocated to set up all the pointers. -static INT32 RAMIndex() -{ - UINT8* Next = AllRAM; - - NeoPalSrc[0] = Next; Next += 0x002000; // Palette RAM Bank 0 - NeoPalSrc[1] = Next; Next += 0x002000; // Palette RAM Bank 1 - - NeoGraphicsRAM = Next; Next += 0x020000; // Graphics controller RAM (2 64KB banks) - - if (nNeoSystemType & NEO_SYS_CART) { - Neo68KRAM = Next; Next += 0x010000; // 68K work RAM - NeoZ80RAM = Next; Next += 0x000800; // Z80 RAM - - NeoNVRAM = Next; Next += 0x010000; // Battery backed SRAM - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SNK_CONTROLMASK) == HARDWARE_SNK_GAMBLING) { - NeoNVRAM2 = Next; Next += 0x002000; // Extra SRAM for vliner/jockeygp - } - NeoMemoryCard = Next; Next += 0x020000; // Memory card - - if (nNeoSystemType & NEO_SYS_CD) { - NeoSpriteRAM = Next; Next += nSpriteSize[0]; - NeoTextRAM = Next; Next += nNeoTextROMSize[0]; - } - - RAMEnd = Next; - - return 0; -} - -// This function is called once to determine how much memory is needed (ROMEnd-(UINT8*)0), -// then a second time after the memory is allocated to set up all the pointers. -static INT32 ROMIndex() -{ - UINT8* Next = AllROM; - - NeoZ80BIOS = Next; Next += 0x020000; // Z80 boardROM - NeoZoomROM = Next; Next += 0x020000; // Y Zoom table - NeoTextROMBIOS = Next; Next += 0x020000; - - if (nNeoSystemType & NEO_SYS_CART) { - Neo68KBIOS = Next; Next += 0x080000; // 68K boardROM - } else { - Neo68KROM[0] = Next; Next += nCodeSize[0]; - NeoVector[0] = Next; Next += 0x000400; // Copy of 68K cartridge ROM with boardROM vector table - Neo68KBIOS = Next; Next += 0x080000; // 68K boardROM - - NeoZ80ROM[0] = Next; Next += 0x080000; - NeoSpriteROM[0] = Next; Next += nSpriteSize[0]; - NeoTextROM[0] = Next; Next += nNeoTextROMSize[0]; - YM2610ADPCMAROM[0] = Next; Next += nYM2610ADPCMASize[0]; - YM2610ADPCMBROM[0] = Next; Next += nYM2610ADPCMBSize[0]; - } - - ROMEnd = Next; - - return 0; -} - -// ----------------------------------------------------------------------------- -// ROM loading - -static void NeoSetSystemType() -{ - // Neo CD - if (nNeoSystemType & NEO_SYS_CD) { - return; - } - // Dedicated JAMMA PCB - if (nNeoSystemType & NEO_SYS_PCB) { - return; - } - - // See if we're emulating MVS or AES hardware - if (nBIOS == -1 || nBIOS == 11 || nBIOS == 12 || nBIOS == 13 || ((NeoSystem & 0x74) == 0x20)) { - nNeoSystemType = NEO_SYS_CART | NEO_SYS_AES; - return; - } - - nNeoSystemType = NEO_SYS_CART | NEO_SYS_MVS; -} - -static INT32 NeoLoad68KBIOS(INT32 nNewBIOS) -{ - // Neo CD - if (nNeoSystemType & NEO_SYS_CD) { - return 0; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SNK_CONTROLMASK) == HARDWARE_SNK_TRACKBALL) { - nNewBIOS = 29; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_DEDICATED_PCB) { - nNewBIOS = 30; - } - - // The most recent MVS models doesn't have a Z80 BIOS - bZ80BIOS = (nNewBIOS != 0) ? true : false; - - // Check if we need to load a new BIOS - if (nNewBIOS == nBIOS) { - return 0; - } - - nBIOS = nNewBIOS; - - // Load the BIOS ROMs - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_MVS) { - // Load the BIOS ROMs - BurnLoadRom(Neo68KBIOS, 0x00000 + nBIOS, 1); - } else { - if (nBIOS >= 0) { - BurnLoadRom(Neo68KBIOS, 0x00080 + nBIOS, 1); - } else { - BurnLoadRom(Neo68KBIOS, 0x00080 + 0, 1); - } - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "kf2k3pcb") || !strcmp(BurnDrvGetTextA(DRV_NAME), "k2k3pcbd")) kf2k3pcb_bios_decode(); - - NeoUpdateVector(); - - return 0; -} - -static INT32 FindType(const char* pName) -{ - INT32 i = 0; - - while (pName[i] && pName[i] != '-' && pName[i] != '_') { - i++; - } - - return i + 1; -} - -static INT32 FindROMs(UINT32 nType, INT32* pOffset, INT32* pNum) -{ - INT32 nOffset = -1; - INT32 nNum = -1; - - struct BurnRomInfo ri; - ri.nType = 0; - ri.nLen = 0; - - // Invalidate indices - if (pOffset) { - *pOffset = -1; - } - if (pNum) { - *pNum = 0; - } - - do { - if (BurnDrvGetRomInfo(&ri, ++nOffset)) { - return 1; - } - } while ((ri.nType & 7) != nType && nOffset < 0x80); - - if (nOffset >= 0x7F) { - return 1; - } - - do { - if (BurnDrvGetRomInfo(&ri, nOffset + ++nNum)) { - break; - } - } while ((ri.nType & 7) == nType && nOffset < 0x80); - - if (pOffset) { - *pOffset = nOffset; - } - if (pNum) { - *pNum = nNum >= 0 ? nNum : 0; - } - - return 0; -} - -static INT32 LoadRoms() -{ - NeoGameInfo info; - NeoGameInfo* pInfo = &info; - - { - struct BurnRomInfo ri; - - ri.nType = 0; - ri.nLen = 0; - - // Find 'P' ROMs - FindROMs(1, &pInfo->nCodeOffset, &pInfo->nCodeNum); - // Find 'S' ROM - FindROMs(2, &pInfo->nTextOffset, NULL); - // Find 'C' ROMs - FindROMs(3, &pInfo->nSpriteOffset, &pInfo->nSpriteNum); - // Find 'M' ROM - FindROMs(4, &pInfo->nSoundOffset, NULL); - // Find 'V' ROMs - FindROMs(5, &pInfo->nADPCMOffset, &pInfo->nADPCMANum); - FindROMs(6, NULL, &pInfo->nADPCMBNum); - - if (pInfo->nADPCMBNum < 0) { - pInfo->nADPCMBNum = 0; - } - -#if 1 && defined FBA_DEBUG - bprintf(PRINT_IMPORTANT, _T(" - P: %i (%i);"), pInfo->nCodeOffset, pInfo->nCodeNum); - if (pInfo->nTextOffset >= 0) { - bprintf(PRINT_IMPORTANT, _T(" S: %i;"), pInfo->nTextOffset); - } else { - bprintf(PRINT_IMPORTANT, _T(" S: unused;")); - } - bprintf(PRINT_IMPORTANT, _T(" C: %i (%i); M: %i"), pInfo->nSpriteOffset, pInfo->nSpriteNum, pInfo->nSoundOffset); - if (pInfo->nADPCMOffset >= 0) { - bprintf(PRINT_IMPORTANT, _T(" V: %i (%i, %i)"), pInfo->nADPCMOffset, pInfo->nADPCMANum, pInfo->nADPCMBNum); - } else { - bprintf(PRINT_IMPORTANT, _T(" V: unused")); - } - bprintf(PRINT_IMPORTANT,_T("\n")); -#endif - - nCodeSize[nNeoActiveSlot] = 0; - for (INT32 i = 0; i < pInfo->nCodeNum; i++) { - BurnDrvGetRomInfo(&ri, pInfo->nCodeOffset + i); - nCodeSize[nNeoActiveSlot] += ri.nLen; - } - nCodeSize[nNeoActiveSlot] = (nCodeSize[nNeoActiveSlot] + 0x0FFFFF) & ~0x0FFFFF; - - nSpriteSize[nNeoActiveSlot] = 0; - - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_SWAPC) { - BurnDrvGetRomInfo(&ri, pInfo->nSpriteOffset); - // for viewpoin, aof, ssideki - if (pInfo->nSpriteNum == 2) { - nSpriteSize[nNeoActiveSlot] = 0x600000; - } - // for kotm2 - if (pInfo->nSpriteNum == 4) { - BurnDrvGetRomInfo(&ri, pInfo->nSpriteOffset + 2); - if (ri.nLen == 0x080000) { - nSpriteSize[nNeoActiveSlot] = 0x600000; - } - } - } - - if (nSpriteSize[nNeoActiveSlot] == 0) { - - // Compute correct size taking gaps into account (kizuna) - for (INT32 i = 0; i < pInfo->nSpriteNum - 2; i += 2) { - BurnDrvGetRomInfo(&ri, pInfo->nSpriteOffset + i); - if (ri.nLen > nSpriteSize[nNeoActiveSlot]) { - nSpriteSize[nNeoActiveSlot] = ri.nLen; - } - } - nSpriteSize[nNeoActiveSlot] *= pInfo->nSpriteNum - 2; - - if (!strcmp("kof97oro", BurnDrvGetTextA(DRV_NAME))) nSpriteSize[nNeoActiveSlot] = 0x2400000; - - // The final 2 ROMs may have a different size - BurnDrvGetRomInfo(&ri, pInfo->nSpriteOffset + pInfo->nSpriteNum - 2); - nSpriteSize[nNeoActiveSlot] += ri.nLen * 2; - } - - { - UINT32 nSize = nSpriteSize[nNeoActiveSlot]; -// if (nSize > 0x4000000) { -// nSize = 0x4000000; -// } - - for (nNeoTileMask[nNeoActiveSlot] = 1; nNeoTileMask[nNeoActiveSlot] < nSize; nNeoTileMask[nNeoActiveSlot] <<= 1) { } - nNeoTileMask[nNeoActiveSlot] = (nNeoTileMask[nNeoActiveSlot] >> 7) - 1; - nNeoMaxTile[nNeoActiveSlot] = nSize >> 7; - } - - if (nNeoTextROMSize[nNeoActiveSlot] == 0) { - if (pInfo->nTextOffset > 0) { - BurnDrvGetRomInfo(&ri, pInfo->nTextOffset); - nNeoTextROMSize[nNeoActiveSlot] = ri.nLen; - } else { - nNeoTextROMSize[nNeoActiveSlot] = 0x080000; - } - } - - nYM2610ADPCMASize[nNeoActiveSlot] = nYM2610ADPCMBSize[nNeoActiveSlot] = 0; - if (pInfo->nADPCMOffset >= 0) { - char* pName; - BurnDrvGetRomInfo(&ri, pInfo->nADPCMOffset); - BurnDrvGetRomName(&pName, pInfo->nADPCMOffset, 0); - nYM2610ADPCMASize[nNeoActiveSlot] = ri.nLen; - - if (pInfo->nADPCMANum > 1) { - BurnDrvGetRomInfo(&ri, pInfo->nADPCMOffset + pInfo->nADPCMANum - 1); - BurnDrvGetRomName(&pName, pInfo->nADPCMOffset + pInfo->nADPCMANum - 1, 0); - if (pInfo->nADPCMBNum == 0) { - nYM2610ADPCMASize[nNeoActiveSlot] *= pName[FindType(pName) + 1] - '1'; - } else { - nYM2610ADPCMASize[nNeoActiveSlot] *= pName[FindType(pName) + 2] - '1'; - } - nYM2610ADPCMASize[nNeoActiveSlot] += ri.nLen; - } - - if (pInfo->nADPCMBNum) { - BurnDrvGetRomInfo(&ri, pInfo->nADPCMOffset + pInfo->nADPCMANum); - nYM2610ADPCMBSize[nNeoActiveSlot] = ri.nLen * (pInfo->nADPCMBNum - 1); - BurnDrvGetRomInfo(&ri, pInfo->nADPCMOffset + pInfo->nADPCMANum + pInfo->nADPCMBNum - 1); - nYM2610ADPCMBSize[nNeoActiveSlot] += ri.nLen; - } - } - } - - if (!strcmp("kof2k4se", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] += 0x800000; - if (!strcmp("cphd", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] = 0x4000000; - if (!strcmp("kf2k4pls", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] += 0x800000; - if (!strcmp("svcboot", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] += 0x400000; - if (!strcmp("svcplus", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] += 0x400000; - if (!strcmp("svcplusa", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] += 0x400000; - if (!strcmp("svcsplus", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] += 0x400000; - if (!strcmp("pbobblenb", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] = 0x380000; - if (!strcmp("alpham2p", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] = 0x200000; - if (!strcmp("burningfp", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] = 0x180000; - if (!strcmp("burningfpa", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] = 0x200000; - if (!strcmp("lresortp", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] = 0x200000; - if (!strcmp("kotm2p", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] = 0x300000; - if (!strcmp("sbp", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] = 0x800000; - if (!strcmp("lasthope", BurnDrvGetTextA(DRV_NAME))) nYM2610ADPCMASize[nNeoActiveSlot] = 0x600000; - -// bprintf(PRINT_NORMAL, _T("%x\n"), nYM2610ADPCMASize[nNeoActiveSlot]); - - // The kof2k3 PCB has 96MB of graphics ROM, however the last 16MB are unused, and the protection/decryption hardware does not see them -// if (nSpriteSize[nNeoActiveSlot] > 0x4000000) { -// nSpriteSize[nNeoActiveSlot] = 0x5000000; -// } - - NeoSpriteROM[nNeoActiveSlot] = (UINT8*)BurnMalloc(nSpriteSize[nNeoActiveSlot] < (nNeoTileMask[nNeoActiveSlot] << 7) ? ((nNeoTileMask[nNeoActiveSlot] + 1) << 7) : nSpriteSize[nNeoActiveSlot]); - if (NeoSpriteROM[nNeoActiveSlot] == NULL) { - return 1; - } - -/* if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_DEDICATED_PCB) { - BurnSetProgressRange(1.0 / ((double)nSpriteSize[nNeoActiveSlot] / 0x800000 / 12)); - } else if (BurnDrvGetHardwareCode() & (HARDWARE_SNK_CMC42 | HARDWARE_SNK_CMC50)) { - BurnSetProgressRange(1.0 / ((double)nSpriteSize[nNeoActiveSlot] / 0x800000 / 9)); - } else { - BurnSetProgressRange(1.0 / ((double)nSpriteSize[nNeoActiveSlot] / 0x800000 / 3)); - }*/ - - if (BurnDrvGetHardwareCode() & (HARDWARE_SNK_CMC42 | HARDWARE_SNK_CMC50)) { - double fRange = (double)pInfo->nSpriteNum / 4.0; - if (fRange < 1.5) { - fRange = 1.5; - } - BurnSetProgressRange(1.0 / fRange); - } else { - BurnSetProgressRange(1.0 / pInfo->nSpriteNum); - } - - // Load sprite data - NeoLoadSprites(pInfo->nSpriteOffset, pInfo->nSpriteNum, NeoSpriteROM[nNeoActiveSlot], nSpriteSize[nNeoActiveSlot]); - - NeoTextROM[nNeoActiveSlot] = (UINT8*)BurnMalloc(nNeoTextROMSize[nNeoActiveSlot]); - if (NeoTextROM[nNeoActiveSlot] == NULL) { - return 1; - } - - // Load Text layer tiledata - { - if (pInfo->nTextOffset != -1) { - // Load S ROM data - BurnLoadRom(NeoTextROM[nNeoActiveSlot], pInfo->nTextOffset, 1); - } else { - // Extract data from the end of C ROMS - BurnUpdateProgress(0.0, _T("Decrypting text layer graphics...")/*, BST_DECRYPT_TXT*/, 0); - NeoCMCExtractSData(NeoSpriteROM[nNeoActiveSlot], NeoTextROM[nNeoActiveSlot], nSpriteSize[nNeoActiveSlot], nNeoTextROMSize[nNeoActiveSlot]); - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_DEDICATED_PCB) { - for (INT32 i = 0; i < nNeoTextROMSize[nNeoActiveSlot]; i++) { - NeoTextROM[nNeoActiveSlot][i] = BITSWAP08(NeoTextROM[nNeoActiveSlot][i] ^ 0xd2, 4, 0, 7, 2, 5, 1, 6, 3); - } - } - } - } - - Neo68KROM[nNeoActiveSlot] = (UINT8*)BurnMalloc(nCodeSize[nNeoActiveSlot]); // 68K cartridge ROM - if (Neo68KROM[nNeoActiveSlot] == NULL) { - return 1; - } - Neo68KROMActive = Neo68KROM[nNeoActiveSlot]; - Neo68KFix[nNeoActiveSlot] = Neo68KROM[nNeoActiveSlot]; - - // Load the roms into memory - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_SMA_PROTECTION) { - BurnLoadRom(Neo68KROMActive + 0x0C0000, 0, 1); - NeoLoadCode(pInfo->nCodeOffset + 1, pInfo->nCodeNum - 1, Neo68KROMActive + 0x100000); - } else { - NeoLoadCode(pInfo->nCodeOffset, pInfo->nCodeNum, Neo68KROMActive); - } - - NeoZ80ROM[nNeoActiveSlot] = (UINT8*)BurnMalloc(0x080000); // Z80 cartridge ROM - if (NeoZ80ROM[nNeoActiveSlot] == NULL) { - return 1; - } - NeoZ80ROMActive = NeoZ80ROM[nNeoActiveSlot]; - - BurnLoadRom(NeoZ80ROMActive, pInfo->nSoundOffset, 1); - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_ENCRYPTED_M1) { - neogeo_cmc50_m1_decrypt(); - } - - if (NeoCallbackActive && NeoCallbackActive->pInitialise) { - NeoCallbackActive->pInitialise(); - } - - // Decode text data - BurnUpdateProgress(0.0, _T("Preprocessing text layer graphics...")/*, BST_PROCESS_TXT*/, 0); - NeoDecodeText(0, nNeoTextROMSize[nNeoActiveSlot], NeoTextROM[nNeoActiveSlot], NeoTextROM[nNeoActiveSlot]); - - // Decode sprite data - NeoDecodeSprites(NeoSpriteROM[nNeoActiveSlot], nSpriteSize[nNeoActiveSlot]); - - if (pInfo->nADPCMANum) { - char* pName; - struct BurnRomInfo ri; - UINT8* pADPCMData; - - YM2610ADPCMAROM[nNeoActiveSlot] = (UINT8*)BurnMalloc(nYM2610ADPCMASize[nNeoActiveSlot]); - if (YM2610ADPCMAROM[nNeoActiveSlot] == NULL) { - return 1; - } - - ri.nType = 0; - ri.nLen = 0; - BurnDrvGetRomInfo(&ri, pInfo->nADPCMOffset); - BurnDrvGetRomName(&pName, pInfo->nADPCMOffset, 0); - - pADPCMData = YM2610ADPCMAROM[nNeoActiveSlot]; - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "sbp") != 0) { // not for sbp! - // pbobblen needs this (V ROMs are v3 & v4), note aof/wh1/wh1h/kotm2 (V ROMs are v2 & v4) - if (pInfo->nADPCMANum == 2 && pName[FindType(pName) + 1] == '3') { - pADPCMData += ri.nLen * 2; - } - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "pbobblenb")) { - pADPCMData = YM2610ADPCMAROM[nNeoActiveSlot] + 0x200000; - } - - NeoLoadADPCM(pInfo->nADPCMOffset, pInfo->nADPCMANum, pADPCMData); - - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_SWAPV) { - for (INT32 i = 0; i < 0x00200000; i++) { - UINT8 n = YM2610ADPCMAROM[nNeoActiveSlot][i]; - YM2610ADPCMAROM[nNeoActiveSlot][i] = YM2610ADPCMAROM[nNeoActiveSlot][0x00200000 + i]; - YM2610ADPCMAROM[nNeoActiveSlot][0x00200000 + i] = n; - } - } - } - - if (pInfo->nADPCMBNum) { - YM2610ADPCMBROM[nNeoActiveSlot] = (UINT8*)BurnMalloc(nYM2610ADPCMBSize[nNeoActiveSlot]); - if (YM2610ADPCMBROM[nNeoActiveSlot] == NULL) { - return 1; - } - - NeoLoadADPCM(pInfo->nADPCMOffset + pInfo->nADPCMANum, pInfo->nADPCMBNum, YM2610ADPCMBROM[nNeoActiveSlot]); - } else { - YM2610ADPCMBROM[nNeoActiveSlot] = YM2610ADPCMAROM[nNeoActiveSlot]; - nYM2610ADPCMBSize[nNeoActiveSlot] = nYM2610ADPCMASize[nNeoActiveSlot]; - } - - return 0; -} - -// ---------------------------------------------------------------------------- -// Bankswitch / memory map functions - -static void NeoZ80SetBank0(INT32 nBank) -{ - nBank &= 0x0F; - if (nBank != nZ80Bank0) { - UINT8* nStartAddress = NeoZ80ROMActive + (nBank << 14); - ZetMapArea(0x8000, 0xBFFF, 0, nStartAddress); - ZetMapArea(0x8000, 0xBFFF, 2, nStartAddress); - - nZ80Bank0 = nBank; - } - - return; -} - -static void NeoZ80SetBank1(INT32 nBank) -{ - nBank &= 0x1F; - if (nBank != nZ80Bank1) { - UINT8* nStartAddress = NeoZ80ROMActive + (nBank << 13); - ZetMapArea(0xC000, 0xDFFF, 0, nStartAddress); - ZetMapArea(0xC000, 0xDFFF, 2, nStartAddress); - - nZ80Bank1 = nBank; - } - - return; -} - -static void NeoZ80SetBank2(INT32 nBank) -{ - nBank &= 0x3F; - if (nBank != nZ80Bank2) { - UINT8* nStartAddress = NeoZ80ROMActive + (nBank << 12); - ZetMapArea(0xE000, 0xEFFF, 0, nStartAddress); - ZetMapArea(0xE000, 0xEFFF, 2, nStartAddress); - - nZ80Bank2 = nBank; - } - - return; -} - -static void NeoZ80SetBank3(INT32 nBank) -{ - nBank &= 0x7F; - if (nBank != nZ80Bank3) { - UINT8* nStartAddress = NeoZ80ROMActive + (nBank << 11); - ZetMapArea(0xF000, 0xF7FF, 0, nStartAddress); - ZetMapArea(0xF000, 0xF7FF, 2, nStartAddress); - - nZ80Bank3 = nBank; - } - - return; -} - -static void NeoZ80MapROM(bool bMapBoardROM) -{ - if (nNeoSystemType & NEO_SYS_CART) { - if (bMapBoardROM && bZ80BIOS) { - // Bank in the Z80 boardROM - ZetMapArea(0x0000, 0x7FFF, 0, NeoZ80BIOS); - ZetMapArea(0x0000, 0x7FFF, 2, NeoZ80BIOS); - } else { - // Bank in the Z80 cartridge ROM - ZetMapArea(0x0000, 0x7FFF, 0, NeoZ80ROMActive); - ZetMapArea(0x0000, 0x7FFF, 2, NeoZ80ROMActive); - } - } -} - -static void MapVectorTable(bool bMapBoardROM) -{ - if (!bMapBoardROM && Neo68KROMActive) { - SekMapMemory(Neo68KFix[nNeoActiveSlot], 0x000000, 0x0003FF, MAP_ROM); - } else { - SekMapMemory(NeoVectorActive, 0x000000, 0x0003FF, MAP_ROM); - } -} - -inline static void MapPalette(INT32 nBank) -{ - if (nNeoPaletteBank != nBank) { - nNeoPaletteBank = nBank; - SekMapMemory(NeoPalSrc[nBank], 0x400000, 0x401FFF, MAP_ROM); - - NeoSetPalette(); - } -} - -static void Bankswitch(UINT32 nBank) -{ - nBank = 0x100000 + ((nBank & 7) << 20); - if (nBank >= nCodeSize[nNeoActiveSlot]) { - nBank = 0x100000; - } - - if (nBank != nNeo68KROMBank) { -// bprintf(PRINT_NORMAL, "Bankswitched main ROM, new address is 0x%08X.\n", nBank); - nNeo68KROMBank = nBank; - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2FFFFF, MAP_ROM); - } -} - -void NeoMapBank() -{ - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2FFFFF, MAP_ROM); -} - -void NeoMap68KFix() -{ - if ((nNeoSystemType & NEO_SYS_CART) && (nCodeSize[nNeoActiveSlot] > 0x100000)) { - - SekMapMemory(Neo68KFix[nNeoActiveSlot] + 0x0400, 0x000400, 0x0FFFFF, MAP_ROM); - - if (Neo68KROM[nNeoActiveSlot]) { - memcpy(NeoVector[nNeoActiveSlot] + 0x80, Neo68KFix[nNeoActiveSlot] + 0x80, 0x0380); - } - } - - MapVectorTable(b68KBoardROMBankedIn); -} - -void NeoUpdateVector() -{ - // Create copy of 68K with BIOS vector table - for (INT32 i = 0; i < MAX_SLOT; i++) { - if (NeoVector[i]) { - memcpy(NeoVector[i] + 0x00, Neo68KBIOS, 0x0080); - if (Neo68KROM[i]) { - memcpy(NeoVector[i] + 0x80, Neo68KFix[i] + 0x80, 0x0380); - } - } - } -} - -// ---------------------------------------------------------------------------- -// 68K bankswitch for most games without SMA/PVC protection - -void __fastcall neogeoWriteByteBankswitch(UINT32 sekAddress, UINT8 byteValue) -{ - if (sekAddress >= 0x2FFFF0) { - -// bprintf(PRINT_NORMAL, _T(" - Bankswitch: 0x%06X -> 0x%02X\n"), sekAddress, byteValue); - - Bankswitch(byteValue); - return; - } -} - -void __fastcall neogeoWriteWordBankswitch(UINT32 sekAddress, UINT16 wordValue) -{ - if (sekAddress >= 0x2FFFF0) { - -// bprintf(PRINT_NORMAL, _T(" - Bankswitch: 0x%06X -> 0x%04X\n"), sekAddress, wordValue); - - Bankswitch(wordValue); - return; - } -} - -// ---------------------------------------------------------------------------- -// CPU synchronisation - -static inline void neogeoSynchroniseZ80(INT32 nExtraCycles) -{ -#if defined Z80_SPEED_ADJUST - INT32 nCycles = SekTotalCycles() / 3 + nExtraCycles; -#else - INT32 nCycles = ((INT64)SekTotalCycles() * nCyclesTotal[1] / nCyclesTotal[0]) + nExtraCycles; -#endif - - if (nCycles <= ZetTotalCycles()) { - return; - } - - nCycles68KSync = nCycles - nExtraCycles; - - BurnTimerUpdate(nCycles); -} - -// Callbacks for the FM chip - -static void neogeoFMIRQHandler(INT32, INT32 nStatus) -{ -// bprintf(PRINT_NORMAL, _T(" YM2610 IRQ status: 0x%02X (%6i cycles)\n"), nStatus, ZetTotalCycles()); - - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 neogeoSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / nZ80Clockspeed; -} - -static double neogeoGetTime() -{ - return (double)ZetTotalCycles() / nZ80Clockspeed; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall neogeoReadByteGambling(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x280001: { - return 0xff - NeoInput[3]; - } - - case 0x2c0001: { - return 0x03; - } - } - -// bprintf(PRINT_NORMAL, _T("Read Byte 0x%08X.\n"), sekAddress); - - return 0xff; -} - -UINT16 __fastcall neogeoReadWordGambling(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x280000: { - return 0xff - NeoInput[3]; - } - - case 0x2c0000: { - return 0x0003; - } - } - -// bprintf(PRINT_NORMAL, _T("Read Word 0x%08X.\n"), sekAddress); - - return 0xffff; -} - -UINT8 __fastcall vliner_timing(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x320000: { - INT32 nReply = nSoundReply; - -#if 1 && defined USE_SPEEDHACKS - // nSoundStatus: &1 = sound latch read, &2 = response written - if (nSoundStatus != 3) { - neogeoSynchroniseZ80(0x0100); - } -#endif - - if (nSoundStatus & 1) { -// bprintf(PRINT_NORMAL, _T(" - Sound reply read (0x%02X).\n"), nSoundReply); - - return nReply; - } else { -// bprintf(PRINT_NORMAL, _T(" - Sound reply read while sound pending (0x%02X).\n"), nSoundReply); - - return nReply & 0x7F; - } - } - - case 0x320001: { -// if (!bAESBIOS) { - if (nBIOS != 11 && nBIOS != 12 && nBIOS != 13) { - UINT8 nuPD4990AOutput = uPD4990ARead(SekTotalCycles() - nuPD4990ATicks); - nuPD4990ATicks = SekTotalCycles(); - return 0x3F | (nuPD4990AOutput << 6); - } - - return (0x3f) & 0xE7; - } - } - -// bprintf(PRINT_NORMAL, _T("Read Byte 0x%08X.\n"), sekAddress); - return 0xff; -} - -// ----------------------------------------------------------------------------- - -static void NeoMapActiveCartridge() -{ - if (!(nNeoSystemType & NEO_SYS_CART)) { - nNeoActiveSlot = 0; - return; - } - - neogeoSynchroniseZ80(0); - - if (NeoCallbackActive && NeoCallbackActive->pRemoveHandlers) { - NeoCallbackActive->pRemoveHandlers(); - } - - NeoVectorActive = NeoVector[nNeoActiveSlot]; - - if (Neo68KROM[nNeoActiveSlot] == NULL) { - - // If an empty slot is selected, only the vector table is valid - - Neo68KROMActive = NULL; - - SekMapHandler(0, 0x000000, 0x0FFFFF, MAP_RAM); - SekMapHandler(0, 0x200000, 0x2FFFFF, MAP_RAM); - - b68KBoardROMBankedIn = true; - MapVectorTable(b68KBoardROMBankedIn); - - NeoCallbackActive = NULL; - - ZetSetBUSREQLine(1); - - NeoSetSpriteSlot(nNeoActiveSlot); - NeoSetTextSlot(nNeoActiveSlot); - - return; - } - - Neo68KROMActive = Neo68KROM[nNeoActiveSlot]; - NeoZ80ROMActive = NeoZ80ROM[nNeoActiveSlot]; - NeoCallbackActive = &NeoCallback[nNeoActiveSlot]; - - SekSetReadWordHandler(6, NULL); - SekSetWriteWordHandler(6, NULL); - SekSetReadByteHandler(6, NULL); - SekSetWriteByteHandler(6, NULL); - SekSetReadWordHandler(7, NULL); - SekSetWriteWordHandler(7, NULL); - SekSetReadByteHandler(7, NULL); - SekSetWriteByteHandler(7, NULL); - - SekMapHandler(0, 0x000000, 0x0FFFFF, MAP_WRITE); - - if (nCodeSize[nNeoActiveSlot] <= 0x080000) { - SekMapMemory(Neo68KFix[nNeoActiveSlot], 0x000000, 0x07FFFF, MAP_ROM); - SekMapMemory(Neo68KFix[nNeoActiveSlot], 0x080000, 0x0FFFFF, MAP_ROM); - SekMapMemory(Neo68KFix[nNeoActiveSlot], 0x200000, 0x27FFFF, MAP_ROM); - SekMapMemory(Neo68KFix[nNeoActiveSlot], 0x280000, 0x2FFFFF, MAP_ROM); - } - - if (nCodeSize[nNeoActiveSlot] <= 0x100000) { - SekMapMemory(Neo68KFix[nNeoActiveSlot], 0x000000, 0x0FFFFF, MAP_ROM); - SekMapMemory(Neo68KFix[nNeoActiveSlot], 0x200000, 0x2FFFFF, MAP_ROM); - } - - if (nCodeSize[nNeoActiveSlot] > 0x100000) { - SekMapMemory(Neo68KFix[nNeoActiveSlot], 0x000000, 0x0FFFFF, MAP_ROM); - - SekMapHandler(4, 0x200000, 0x2FFFFF, MAP_WRITE); - - SekSetWriteWordHandler(4, neogeoWriteWordBankswitch); - SekSetWriteByteHandler(4, neogeoWriteByteBankswitch); - } - - if (NeoCallbackActive->pInstallHandlers) { - NeoCallbackActive->pInstallHandlers(); - } - - if (nCodeSize[nNeoActiveSlot] > 0x100000) { - nNeo68KROMBank = 0x100000; - - if (NeoCallbackActive->pBankswitch) { - NeoCallbackActive->pBankswitch(); - } else { - if ((BurnDrvGetHardwareCode() & HARDWARE_SNK_CONTROLMASK) != HARDWARE_SNK_GAMBLING) { - NeoMapBank(); - } - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SNK_CONTROLMASK) == HARDWARE_SNK_GAMBLING) { - SekMapMemory(NeoNVRAM2, 0x200000, 0x201FFF, MAP_RAM); // 68K RAM - - SekMapHandler(6, 0x202000, 0x2FFFFF, MAP_READ); - SekSetReadByteHandler(6, neogeoReadByteGambling); - SekSetReadWordHandler(6, neogeoReadWordGambling); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "vliner") || !strcmp(BurnDrvGetTextA(DRV_NAME), "vlinero")) { - SekMapHandler(7, 0x320000, 0x320001, MAP_READ); - SekSetReadByteHandler(7, vliner_timing); - } - } - - if (NeoZ80ROMActive) { - ZetSetBUSREQLine(0); - - nZ80Bank0 = nZ80Bank1 = nZ80Bank2 = nZ80Bank3 = -1; - NeoZ80SetBank0(0x02); - NeoZ80SetBank1(0x06); - NeoZ80SetBank2(0x0E); - NeoZ80SetBank3(0x1E); - } else { - ZetSetBUSREQLine(1); - } - - MapVectorTable(b68KBoardROMBankedIn); - NeoZ80MapROM(bZ80BoardROMBankedIn); - - NeoSetSpriteSlot(nNeoActiveSlot); - NeoSetTextSlot(nNeoActiveSlot); - - // the text rendering code will get confused if we don't do this - memset(NeoGraphicsRAM + 0xEA00, 0, 0x0200); - - BurnYM2610MapADPCMROM(YM2610ADPCMAROM[nNeoActiveSlot], nYM2610ADPCMASize[nNeoActiveSlot], YM2610ADPCMBROM[nNeoActiveSlot], nYM2610ADPCMBSize[nNeoActiveSlot]); - - return; -} - -// ----------------------------------------------------------------------------- -// Savestate support - -INT32 NeoScan(INT32 nAction, INT32* pnMin) -{ - INT32 nOldBIOS = nBIOS; - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029713; - } - - // Make sure we have the correct value for nBIOS - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nBIOS); - // Update the system type immediately - NeoSetSystemType(); - } - - if (nAction & ACB_MEMORY_ROM) { - - if (nNeoSystemType & NEO_SYS_CART) { - ba.Data = Neo68KBIOS; - ba.nLen = 0x80000;//(nNeoSystemType & NEO_SYS_PCB) ? 0x00080000 : 0x00020000; - ba.nAddress = 0; - ba.szName = "68K BIOS"; - BurnAcb(&ba); - - ba.Data = Neo68KROMActive; - ba.nLen = nCodeSize[nNeoActiveSlot]; - ba.nAddress = 0; - ba.szName = "68K ROM"; - BurnAcb(&ba); - - ba.Data = NeoZ80BIOS; - ba.nLen = 0x00020000; - ba.nAddress = 0; - ba.szName = "Z80 BIOS"; - BurnAcb(&ba); - - ba.Data = NeoZ80ROMActive; - ba.nLen = 0x00080000; - ba.nAddress = 0; - ba.szName = "Z80 ROM"; - BurnAcb(&ba); - - ba.Data = YM2610ADPCMAROM[nNeoActiveSlot]; - ba.nLen = nYM2610ADPCMASize[nNeoActiveSlot]; - ba.nAddress = 0; - ba.szName = "ADPCM ROM"; - BurnAcb(&ba); - - ba.Data = YM2610ADPCMBROM[nNeoActiveSlot]; - ba.nLen = nYM2610ADPCMBSize[nNeoActiveSlot]; - ba.nAddress = 0; - ba.szName = "Delta-T ROM"; - BurnAcb(&ba); - } else { - ba.Data = Neo68KBIOS; - ba.nLen = 0x00080000; - ba.nAddress = 0; - ba.szName = "68K BIOS"; - BurnAcb(&ba); - } - } - - if (nAction & ACB_MEMCARD) { - if ((nNeoSystemType & NEO_SYS_CART) && !(nNeoSystemType & NEO_SYS_PCB)) { // Scan memory card - - if (pnMin && (nAction & ACB_TYPEMASK) == ACB_MEMCARD) { // Return minimum compatible version - *pnMin = 0x029713; - } - - ba.Data = NeoMemoryCard; - ba.nLen = 0x020000; - ba.nAddress = 0; - ba.szName = "Memory card"; - - if ((nAction & ACB_TYPEMASK) == ACB_MEMCARD) { - if (nAction & ACB_WRITE) { - bMemoryCardInserted = true; - } - if (nAction & ACB_READ) { - bMemoryCardInserted = false; - - // If a card is inserted, determine the size - if (*((UINT16*)NeoMemoryCard) != 0x8000) { - INT32 nSize = (NeoMemoryCard[21] << 8) | NeoMemoryCard[23]; - if (nSize >= 0x1000) { - ba.nLen = nSize; - } - } - } - } - - BurnAcb(&ba); - } - } - - if ((nNeoSystemType & NEO_SYS_CD) && (nAction & ACB_NVRAM)) { // Scan non-volatile memory (built-in memory card) - - if (pnMin && (nAction & ACB_TYPEMASK) == ACB_NVRAM) { // Return minimum compatible version - *pnMin = 0x029713; - } - - ba.Data = NeoMemoryCard; - ba.nLen = 0x004000; - ba.nAddress = 0; - ba.szName = "Memory card"; - BurnAcb(&ba); - } - - if ((nNeoSystemType & NEO_SYS_MVS) && (nAction & ACB_NVRAM)) { // Scan non-volatile memory - - if (pnMin && (nAction & ACB_TYPEMASK) == ACB_NVRAM) { // Return minimum compatible version - *pnMin = 0x029713; - } - - ba.Data = NeoNVRAM; - ba.nLen = 0x00010000; - ba.nAddress = 0; - ba.szName = "NVRAM"; - BurnAcb(&ba); - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_SNK_CONTROLMASK) == HARDWARE_SNK_GAMBLING) && (nAction & ACB_NVRAM)) { - ba.Data = NeoNVRAM2; - ba.nLen = 0x00002000; - ba.nAddress = 0; - ba.szName = "Extra NVRAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { // Scan RAM - - if (nNeoSystemType & NEO_SYS_CART) { - ba.Data = Neo68KRAM; - ba.nLen = 0x00010000; - ba.nAddress = 0; - ba.szName = "68K RAM"; - BurnAcb(&ba); - - ba.Data = NeoZ80RAM; - ba.nLen = 0x00000800; - ba.nAddress = 0; - ba.szName = "Z80 RAM"; - BurnAcb(&ba); - } - - if (nNeoSystemType & NEO_SYS_CD) { - ba.Data = Neo68KROMActive; - ba.nLen = nCodeSize[0]; - ba.nAddress = 0; - ba.szName = "68K program RAM"; - BurnAcb(&ba); - - ba.Data = NeoZ80ROMActive; - ba.nLen = 0x00080000; - ba.nAddress = 0; - ba.szName = "Z80 program RAM"; - BurnAcb(&ba); - } - - ba.Data = NeoPalSrc[0]; - ba.nLen = 0x000002000; - ba.nAddress = 0; - ba.szName = "Palette 0"; - BurnAcb(&ba); - ba.Data = NeoPalSrc[1]; - ba.nLen = 0x000002000; - ba.nAddress = 0; - ba.szName = "Palette 1"; - BurnAcb(&ba); - - ba.Data = NeoGraphicsRAM; - ba.nLen = 0x00020000; - ba.nAddress = 0; - ba.szName = "Graphics RAM"; - BurnAcb(&ba); - - if (nNeoSystemType & NEO_SYS_CD) { - ba.Data = NeoSpriteRAM; - ba.nLen = nSpriteSize[0]; - ba.nAddress = 0; - ba.szName = "Sprite layer tile RAM"; - BurnAcb(&ba); - - ba.Data = NeoTextRAM; - ba.nLen = nNeoTextROMSize[0]; - ba.nAddress = 0; - ba.szName = "Text layer tile RAM"; - BurnAcb(&ba); - - ba.Data = YM2610ADPCMBROM[0]; - ba.nLen = nYM2610ADPCMBSize[0]; - ba.nAddress = 0; - ba.szName = "ADPCM sample RAM"; - BurnAcb(&ba); - } - - if (NeoCallbackActive && NeoCallbackActive->pScan) { - NeoCallbackActive->pScan(nAction, pnMin); - } - } - - if (nAction & ACB_DRIVER_DATA) { // Scan driver data - - SekScan(nAction); // Scan 68000 state - ZetScan(nAction); // Scan Z80 state - - BurnYM2610Scan(nAction, pnMin); - - if (nNeoSystemType & NEO_SYS_MVS) { - uPD4990AScan(nAction, pnMin); - } - - if (NeoCallbackActive && NeoCallbackActive->pScan) { - NeoCallbackActive->pScan(nAction, pnMin); - } - - SCAN_VAR(nCyclesExtra); - - SCAN_VAR(bNeoEnableGraphics); - SCAN_VAR(nIRQAcknowledge); - - SCAN_VAR(nIRQControl); SCAN_VAR(nIRQOffset); SCAN_VAR(nIRQCycles); - SCAN_VAR(bSRAMWritable); - -#if defined EMULATE_WATCHDOG - SCAN_VAR(nNeoWatchdog); -#endif - - SCAN_VAR(b68KBoardROMBankedIn); - if (nNeoSystemType & NEO_SYS_CART) { - SCAN_VAR(bBIOSTextROMEnabled); - SCAN_VAR(nZ80Bank0); SCAN_VAR(nZ80Bank1); SCAN_VAR(nZ80Bank2); SCAN_VAR(nZ80Bank3); - SCAN_VAR(nNeo68KROMBank); - } - - // -- June 17-19, 2014; savestate crash fix - dink - SCAN_OFF(NeoGraphicsRAMBank, NeoGraphicsRAM, nAction); - SCAN_VAR(NeoGraphicsRAMPointer); - SCAN_VAR(nNeoGraphicsModulo); - // -- end - SCAN_VAR(nNeoSpriteFrame); SCAN_VAR(nSpriteFrameSpeed); SCAN_VAR(nSpriteFrameTimer); - - SCAN_VAR(nNeoPaletteBank); - - SCAN_VAR(nSoundLatch); - SCAN_VAR(nSoundReply); - SCAN_VAR(nSoundStatus); - -#if 1 && defined USE_SPEEDHACKS - SCAN_VAR(nSoundPrevReply); -#endif - - SCAN_VAR(nInputSelect); - - SCAN_OFF(NeoInputBank, NeoInput, nAction); - - SCAN_VAR(nAnalogAxis); - - SCAN_VAR(nuPD4990ATicks); - - SCAN_OFF(Neo68KFix[nNeoActiveSlot], Neo68KROM[nNeoActiveSlot], nAction); - - if (nAction & ACB_WRITE) { - INT32 nNewBIOS = nBIOS; - INT32 nBank; - - SekOpen(0); - NeoMap68KFix(); - SekClose(); - - if (nNeoSystemType & NEO_SYS_CART) { - ZetOpen(0); - NeoZ80MapROM(bZ80BoardROMBankedIn); - - nBank = nZ80Bank0; nZ80Bank0 = -1; - NeoZ80SetBank0(nBank); - nBank = nZ80Bank1; nZ80Bank1 = -1; - NeoZ80SetBank1(nBank); - nBank = nZ80Bank2; nZ80Bank2 = -1; - NeoZ80SetBank2(nBank); - nBank = nZ80Bank3; nZ80Bank3 = -1; - NeoZ80SetBank3(nBank); - ZetClose(); - - if (NeoCallbackActive && NeoCallbackActive->pBankswitch) { - NeoCallbackActive->pBankswitch(); - } else { - if ((BurnDrvGetHardwareCode() & HARDWARE_SNK_CONTROLMASK) != HARDWARE_SNK_GAMBLING) { - SekOpen(0); - SekMapMemory(Neo68KROMActive + nNeo68KROMBank, 0x200000, 0x2FFFFF, MAP_ROM); - SekClose(); - } - } - } - - nBank = nNeoPaletteBank; nNeoPaletteBank = -1; - SekOpen(0); - MapPalette(nBank); - SekClose(); - - NeoRecalcPalette = 1; - - if (nNeoSystemType & NEO_SYS_CART) { - nBIOS = nOldBIOS; - NeoLoad68KBIOS(nNewBIOS); - - NeoSetSystemType(); - } - - nPrevBurnCPUSpeedAdjust = -1; - - SCAN_VAR(nLEDLatch); - SCAN_VAR(nLED); - -// BurnGameFeedback(sizeof(nLED), nLED); - } - } - - return 0; -} - -// ----------------------------------------------------------------------------- -// Z80 handlers - -UINT8 __fastcall neogeoZ80In(UINT16 nAddress) -{ - switch (nAddress & 0xFF) { - case 0x00: // Read sound command -// bprintf(PRINT_NORMAL, _T(" - Sound command received (0x%02X).\n"), nSoundLatch); - nSoundStatus = 1; -#if 1 && defined USE_SPEEDHACKS - nSoundPrevReply = -1; -#endif - return nSoundLatch; - - case 0x04: - return BurnYM2610Read(0); - case 0x05: - return BurnYM2610Read(1); - case 0x06: - return BurnYM2610Read(2); - - case 0x08: -// bprintf(PRINT_NORMAL, " - Z80 bank 3 -> 0x%02X\n", nAddress >> 8); - NeoZ80SetBank3(nAddress >> 8); - break; - case 0x09: -// bprintf(PRINT_NORMAL, " - Z80 bank 2 -> 0x%02X\n", nAddress >> 8); - NeoZ80SetBank2(nAddress >> 8); - break; - case 0x0A: -// bprintf(PRINT_NORMAL, " - Z80 bank 1 -> 0x%02X\n", nAddress >> 8); - NeoZ80SetBank1(nAddress >> 8); - break; - case 0x0B: -// bprintf(PRINT_NORMAL, " - Z80 bank 0 -> 0x%02X\n", nAddress >> 8); - NeoZ80SetBank0(nAddress >> 8); - break; - -// default: { -// bprintf(PRINT_NORMAL, _T)" - Z80 read port 0x%04X.\n"), nAddress); -// } - } - - return 0; -} - -UINT8 __fastcall neogeoZ80InCD(UINT16 nAddress) -{ - switch (nAddress & 0xFF) { - case 0x00: // Read sound command -// bprintf(PRINT_NORMAL, _T(" - Sound command received (0x%02X).\n"), nSoundLatch); - nSoundStatus = 1; -#if 1 && defined USE_SPEEDHACKS - nSoundPrevReply = -1; -#endif - return nSoundLatch; - - case 0x04: - return BurnYM2610Read(0); - case 0x05: - return BurnYM2610Read(1); - case 0x06: - return BurnYM2610Read(2); - - // banskswitch on MVS/AES - case 0x08: - case 0x09: - case 0x0A: - case 0x0B: - break; - - default: { -// bprintf(PRINT_NORMAL, _T(" - Z80 read port 0x%04X.\n"), nAddress); - } - } - - return 0; -} - -void __fastcall neogeoZ80Out(UINT16 nAddress, UINT8 nValue) -{ - switch (nAddress & 0x0FF) { - case 0x00: -// bprintf(PRINT_NORMAL, _T(" - Z80 port 0x00 -> 0x%02X.\n"), nValue); - break; - case 0x04: - case 0x05: - case 0x06: - case 0x07: - BurnYM2610Write(nAddress & 3, nValue); - break; - - case 0x0C: // Write reply to sound commands -// bprintf(PRINT_NORMAL, _T(" - Sound reply sent (0x%02X).\n"), nValue); - nSoundReply = nValue; - -#if 1 && defined USE_SPEEDHACKS - if (nSoundPrevReply != nValue) { - nSoundPrevReply = nValue; - - // s1945p replies a 0x00, then an 0xFF; - // the 68K loops until it has read both - if (nSoundReply == 0) { - nSoundStatus &= ~2; - } else { - nSoundStatus |= 2; - } - } else { - nSoundStatus |= 2; - } - - if (ZetTotalCycles() > nCycles68KSync) { - -// bprintf(PRINT_NORMAL, _T(" %i\n"), ZetTotalCycles()); - BurnTimerUpdateEnd(); -// bprintf(PRINT_NORMAL, _T(" %i - %i\n"), ZetTotalCycles(), nCycles68KSync); - } -#endif - - break; - - case 0x80: - bprintf(PRINT_ERROR, _T(" - Z80 port 0x%04X -> 0x%02X.\n"), nAddress, nValue); - break; - - default: { -// bprintf(PRINT_NORMAL, _T(" - Z80 port 0x%04X -> 0x%02X.\n"), nAddress, nValue); - } - } -} - -// ----------------------------------------------------------------------------- -// 68K handlers - -INT32 __fastcall NeoCDIRQCallback(INT32 /* nIRQ */) -{ -// bprintf(PRINT_NORMAL, _T(" - IRQ Callback %i %2X.\n"), nIRQ, nNeoCDIRQVector); - if (nNeoCDIRQVectorAck) { - nNeoCDIRQVectorAck = 0; - return nNeoCDIRQVector; - } - return M68K_INT_ACK_AUTOVECTOR; -} - -static inline INT32 NeoConvertIRQPosition(INT32 nOffset) -{ - UINT64 nNewPosition = ((UINT64)nOffset * nBurnCPUSpeedAdjust) >> 7; - - return (nNewPosition < NO_IRQ_PENDING) ? nNewPosition : NO_IRQ_PENDING; -} - -static inline void NeoIRQUpdate(UINT16 wordValue) -{ - nIRQAcknowledge |= (wordValue & 7); - -// bprintf(PRINT_NORMAL, _T(" - IRQ Ack -> %02X (at line %3i).\n"), nIRQAcknowledge, SekCurrentScanline()); - - if ((nIRQAcknowledge & 7) == 7) { - SekSetIRQLine(7, CPU_IRQSTATUS_NONE); - } else { - if ((nIRQAcknowledge & 1) == 0) { - SekSetIRQLine(3, CPU_IRQSTATUS_ACK); - } - if ((nIRQAcknowledge & 2) == 0) { - SekSetIRQLine(nScanlineIRQ, CPU_IRQSTATUS_ACK); - } - if ((nIRQAcknowledge & 4) == 0) { - SekSetIRQLine(nVBLankIRQ, CPU_IRQSTATUS_ACK); - } - } -} - -static inline void NeoCDIRQUpdate(UINT8 byteValue) -{ - nIRQAcknowledge |= (byteValue & 0x38); - -// bprintf(PRINT_NORMAL, _T(" - IRQ Ack -> %02X (CD, at line %3i).\n"), nIRQAcknowledge, SekCurrentScanline()); - - if ((nIRQAcknowledge & 0x3F) == 0x3F) { - SekSetIRQLine(7, CPU_IRQSTATUS_NONE); - } else { - if ((nIRQAcknowledge & 0x07) != 7) { - NeoIRQUpdate(0); - return; - } - if ((nIRQAcknowledge & 0x08) == 0) { - nNeoCDIRQVector = 0x17; - nNeoCDIRQVectorAck = 1; - SekSetIRQLine(4, CPU_IRQSTATUS_ACK /*| CPU_IRQSTATUS_CALLBACK*/); - return; - } - if ((nIRQAcknowledge & 0x10) == 0) { - nNeoCDIRQVector = 0x16; - nNeoCDIRQVectorAck = 1; - SekSetIRQLine(4, CPU_IRQSTATUS_ACK /*| CPU_IRQSTATUS_CALLBACK*/); - return; - } - if ((nIRQAcknowledge & 0x20) == 0) { - nNeoCDIRQVector = 0x15; - nNeoCDIRQVectorAck = 1; - SekSetIRQLine(4, CPU_IRQSTATUS_ACK /*| CPU_IRQSTATUS_CALLBACK*/); - return; - } - } -} - -static inline void SendSoundCommand(const UINT8 nCommand) -{ -// bprintf(PRINT_NORMAL, _T(" - Sound command sent (0x%02X).\n"), nCommand); - - neogeoSynchroniseZ80(0); - - nSoundStatus &= ~1; - nSoundLatch = nCommand; - - ZetNmi(); - -#if 1 && defined USE_SPEEDHACKS - neogeoSynchroniseZ80(0x0200); -#endif -} - -static UINT8 ReadInput1(INT32 nOffset) -{ - switch (nOffset) { - case 0x00: -// bprintf(PRINT_NORMAL, _T(" -- bank %d inputP0[0x%02X] read (%i).\n"), 0, nInputSelect, SekTotalCycles()); - return ~NeoInputBank[nJoyport0[nInputSelect & 0x07]]; - - case 0x01: -// bprintf(PRINT_NORMAL, _T(" - 0x%06X read (byte).\n"), sekAddress); - if (nNeoSystemType & NEO_SYS_MVS) { - return ~NeoInputBank[4]; - } - return ~0; - - case 0x81: -// bprintf(PRINT_NORMAL, _T(" - 0x%06X read (byte).\n"), sekAddress); - if (nNeoSystemType & NEO_SYS_MVS) { - return ~NeoInputBank[5]; - } - return ~0; - } - - return ~0; -} - -static UINT8 ReadInput2(INT32 nOffset) -{ - if ((nOffset & 1) == 0) { -// bprintf(PRINT_NORMAL, _T(" -- bank %d inputP1[0x%02X] read.\n"), 0, nInputSelect); - return ~NeoInputBank[nJoyport1[(nInputSelect >> 3) & 0x07]]; - } - - return ~0; -} - -static UINT8 ReadInput3(INT32 nOffset) -{ - if ((nOffset & 1) == 0) { -// bprintf(PRINT_NORMAL, " -- input 2 read.\n"); - return ~NeoInputBank[2]; - } - - return ~0; -} - -UINT8 __fastcall neogeoReadByte(UINT32 sekAddress) -{ - switch (sekAddress & 0xFE0000) { - case 0x300000: - return ReadInput1(sekAddress & 0xFF); - - case 0x320000: { - if ((sekAddress & 1) == 0) { - INT32 nReply = nSoundReply; - -#if 1 && defined USE_SPEEDHACKS - // nSoundStatus: &1 = sound latch read, &2 = response written - if (nSoundStatus != 3) { - neogeoSynchroniseZ80(0x0100); - } -#else - neogeoSynchroniseZ80(0); -#endif - - if ((nSoundStatus & 1) == 0) { -// bprintf(PRINT_NORMAL, _T(" - Sound reply read while sound pending (0x%02X).\n"), nSoundReply); - - return nReply & 0x7F; - } - -// bprintf(PRINT_NORMAL, _T(" - Sound reply read (0x%02X).\n"), nSoundReply); - return nReply; - } - - if (nNeoSystemType & NEO_SYS_MVS) { - UINT8 nuPD4990AOutput = uPD4990ARead(SekTotalCycles() - nuPD4990ATicks); - nuPD4990ATicks = SekTotalCycles(); - return (~NeoInputBank[3] & 0x3F) | (nuPD4990AOutput << 6); - } - - return (~NeoInputBank[3] & 0x7F) & 0xE7; - } - - case 0x340000: - return ReadInput2(sekAddress & 0xFF); - - case 0x380000: - return ReadInput3(sekAddress & 0xFF); - - default: - bprintf(PRINT_NORMAL, _T(" - 0x%08X read (byte, PC: %08X)\n"), sekAddress, SekGetPC(-1)); - } - - return ~0; -} - -UINT16 __fastcall neogeoReadWord(UINT32 sekAddress) -{ - switch (sekAddress & 0xFE0000) { - case 0x300000: - return (ReadInput1(sekAddress & 0xFE) << 8) | ReadInput1((sekAddress & 0xFE) | 1); - - case 0x320000: - SEK_DEF_READ_WORD(0, sekAddress); - - case 0x340000: - return (ReadInput2(sekAddress & 0xFE) << 8) | ReadInput2((sekAddress & 0xFE) | 1); - - case 0x380000: - return (ReadInput3(sekAddress & 0xFE) << 8) | ReadInput3((sekAddress & 0xFE) | 1); - - default: - bprintf(PRINT_NORMAL, _T(" - 0x%08X read (word, PC: %08X)\n"), sekAddress, SekGetPC(-1)); - } - - return ~0; -} - -static void WriteIO1(INT32 nOffset, UINT8 byteValue) -{ - switch (nOffset) { - case 0x01: // Select the input returned at 0x300000 -// bprintf(PRINT_NORMAL, _T(" - InputP0/P1 0x%02X selected (%i).\n"), byteValue, SekTotalCycles()); - nInputSelect = byteValue; - break; - - case 0x21: // Select the active cartridge slot -// bprintf(PRINT_NORMAL, _T(" - Cartridge slot 0x%02X activated.\n"), byteValue); - nNeoActiveSlot = byteValue; - if (nNeoActiveSlot >= nNeoNumSlots) { - nNeoActiveSlot = 0; - } - - NeoMapActiveCartridge(); - break; - - case 0x31: // Send latched output to LEDs (bits 5/4 - numeric displays, bit 3 - marquee lights, one per slot) -// bprintf(PRINT_NORMAL, _T(" - 0x%06X -> 0x%02X.\n"), sekAddress, byteValue); -// if (byteValue != 255) { -// bprintf(PRINT_NORMAL, _T(" - LED %02X -> %02X\n"), ~byteValue & 255, nLEDLatch & 255); -// } - -/* if ((byteValue & 0x20) == 0) { - nLED[0] = nLEDLatch; - } - if ((byteValue & 0x10) == 0) { - nLED[1] = nLEDLatch; - } - if ((byteValue & 0x08) == 0) { - nLED[2] = nLEDLatch; - } - - BurnGameFeedback(sizeof(nLED), nLED);*/ - - break; - - case 0x41: // Latch LED output - // for numeric displays - digits displayed = ~bytevalue - // for start buttons - highlighted marquee = ~bytevalue -// bprintf(PRINT_NORMAL, _T(" - LED output -> 0x%02X.\n"), byteValue); - nLEDLatch = ~byteValue; - break; - - case 0x51: // Send command to RTC -// bprintf(PRINT_NORMAL, _T(" - RTC -> 0x%02X.\n"), byteValue); - if (nNeoSystemType & NEO_SYS_MVS) { - uPD4990AWrite(byteValue & 2, byteValue & 4, byteValue & 1); - } - break; - - case 0x61: // Coin lockout chute 1 & input bank select -// bprintf(PRINT_NORMAL, _T(" - %sInput bank 0 selected (0x%02X).\n"), byteValue ? _T("Chute 1 coin lockout -> High / ") : _T(""), byteValue); - NeoInputBank = NeoInput + 0; - break; - case 0x63: // Coin lockout chute 2 -// bprintf(PRINT_NORMAL, _T(" - Chute 2 coin lockout -> High (0x%02X).\n"), byteValue); - break; - - case 0x65: // Coin counter chute 1 -> High - break; -// bprintf(PRINT_NORMAL, _T(" - Chute 1 coin counter -> High (0x%02X).\n"), byteValue); - case 0x67: // Coin counter chute 2 -> High -// bprintf(PRINT_NORMAL, _T(" - Chute 2 coin counter -> High (0x%02X).\n"), byteValue); - break; - - case 0xD1: // Send command to RTC -// bprintf(PRINT_NORMAL, _T(" - RTC -> 0x%02X.\n"), byteValue); - if (nNeoSystemType & NEO_SYS_MVS) { - uPD4990AWrite(byteValue & 2, byteValue & 4, byteValue & 1); - } - break; - - case 0xE1: -// bprintf(PRINT_NORMAL, _T(" - Chute 2 coin lockout -> Low / Input bank 1 selected (0x%02X).\n"), byteValue); - NeoInputBank = NeoInput + 8; - break; - case 0xE3: -// bprintf(PRINT_NORMAL, _T(" - Chute 2 coin lockout -> Low (0x%02X).\n"), byteValue); - break; - - case 0xE5: // Coin counter chute 1 -> Low -// bprintf(PRINT_NORMAL, _T(" - Chute 1 coin counter -> Low (0x%02X).\n"), byteValue); - break; - case 0xE7: // Coin counter chute 2 -> Low -// bprintf(PRINT_NORMAL, _T(" - Chute 2 coin counter -> Low (0x%02X).\n"), byteValue); - break; - } - - return; -} - -static void WriteIO2(INT32 nOffset, UINT8 /*byteValue*/) -{ - switch (nOffset) { - case 0x01: // Enable display - if (nNeoSystemType & NEO_SYS_CART) { - bNeoEnableGraphics = true; -// bprintf(PRINT_NORMAL, _T(" - Display enabled (0x%02X, at scanline %i).\n"), byteValue, SekCurrentScanline()); - break; - } - - case 0x03: // Select BIOS vector table - if (nNeoSystemType & NEO_SYS_CART) { - if (!b68KBoardROMBankedIn) { - MapVectorTable(true); - b68KBoardROMBankedIn = true; - } -// bprintf(PRINT_NORMAL, _T(" - BIOS vector table banked in (0x%02X).\n"), byteValue); - } - break; - - case 0x0B: // Select BIOS text ROM -// bprintf(PRINT_NORMAL, _T(" - BIOS text/Z80 ROM banked in (0x%02X).\n"), byteValue); - - bBIOSTextROMEnabled = !(nNeoSystemType & (NEO_SYS_PCB | NEO_SYS_AES)); - - if (bZ80BIOS) { - if (!bZ80BoardROMBankedIn) { - bZ80BoardROMBankedIn = true; - NeoZ80MapROM(true); - } - -#if defined Z80_RESET_ON_BANKSWITCH - nSoundStatus |= 1; - ZetReset(); -#endif - } - - break; - - case 0x0D: // Write-protect SRAM - bSRAMWritable = false; -// bprintf(PRINT_NORMAL, _T(" - SRAM write-protected (0x%02X).\n"), byteValue); - break; - - case 0x0F: // Select palette bank 1 -// bprintf(PRINT_NORMAL, _T(" - Palette 1 banked in (0x%02X).\n"), byteValue); - MapPalette(1); - break; - - case 0x11: // Disable display - if (nNeoSystemType & NEO_SYS_CART) { - bNeoEnableGraphics = false; -// bprintf(PRINT_NORMAL, _T(" - Display disabled (0x%02X, at scanline %i).\n"), byteValue, SekCurrentScanline()); - break; - } - - case 0x13: // Select game vector table - if (nNeoSystemType & NEO_SYS_CART) { - if (b68KBoardROMBankedIn) { - MapVectorTable(false); - b68KBoardROMBankedIn = false; - } -// bprintf(PRINT_NORMAL, _T(" - ROM vector table banked in (0x%02X).\n"), byteValue); - } - break; - - case 0x1B: // Select game text ROM -// bprintf(PRINT_NORMAL, _T(" - Cartridge text/Z80 ROM banked in (0x%02X).\n"), byteValue); - - bBIOSTextROMEnabled = false; - - if (bZ80BIOS) { - if (bZ80BoardROMBankedIn) { - bZ80BoardROMBankedIn = false; - NeoZ80MapROM(false); - } - -#if defined Z80_RESET_ON_BANKSWITCH - nSoundStatus |= 1; - ZetReset(); -#endif - } - - break; - - case 0x1D: // Write-enable SRAM - bSRAMWritable = true; -// bprintf(PRINT_NORMAL, _T(" - SRAM writable (0x%02X).\n"), byteValue); - break; - - case 0x1F: // Select palette bank 0 -// bprintf(PRINT_NORMAL, _T(" - Palette 0 banked in (0x%02X).\n"), byteValue); - MapPalette(0); - break; - } - - return; -} - -void __fastcall neogeoWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress & 0xFF0000) { - case 0x300000: - if ((sekAddress & 1) == 1) { -// bprintf(PRINT_NORMAL, " - Watchdog timer reset (%02X, at scanline %i)\n", byteValue, SekCurrentScanline()); - -#if defined EMULATE_WATCHDOG - nNeoWatchdog = -SekTotalCycles(); -#endif - - } - return; - - case 0x320000: - if ((sekAddress & 1) == 0) { - SendSoundCommand(byteValue); - } - return; - - case 0x380000: - WriteIO1(sekAddress & 0xFF, byteValue); - return; - - case 0x3A0000: - WriteIO2(sekAddress & 0x1F, byteValue); - return; - } - -// bprintf(PRINT_NORMAL, _T(" - Attempt to write byte 0x%06X -> 0x%02X\n"), sekAddress, byteValue); - - return; -} - -void __fastcall neogeoWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ -// neogeoWriteByte(sekAddress | 1, wordValue); - - SEK_DEF_WRITE_WORD(0, sekAddress, wordValue); - -// bprintf(PRINT_NORMAL, _T(" - Attempt to write word 0x%06X -> 0x%04X\n"), sekAddress, wordValue); -} - -// ---------------------------------------------------------------------------- -// Video controller reads - -UINT16 __fastcall neogeoReadWordVideo(UINT32 sekAddress) -{ - switch (sekAddress & 6) { - case 0x00: - case 0x02: -// bprintf(PRINT_NORMAL, " - Graphics RAM read (Bank %i, address 0x%04X).\n", NeoGraphicsRAMPointer > 0xFFFF ? 1 : 0, NeoGraphicsRAMPointer & 0xFFFF); - return *((UINT16*)(NeoGraphicsRAMBank + NeoGraphicsRAMPointer)); - - case 0x04: -// bprintf(PRINT_NORMAL, " - Graphics RAM modulo read.\n"); - return (UINT16)(nNeoGraphicsModulo >> 1); - - case 0x06: // Display status -// bprintf(PRINT_NORMAL, " - Display status read, line: %3i, anim: %i\n", SekCurrentScanline(), nNeoSpriteFrame); - -#if 1 && !defined USE_SPEEDHACKS - bForcePartialRender |= bForceUpdateOnStatusRead; -#endif - - return ((SekCurrentScanline() + nScanlineOffset) << 7) | 0 | (nNeoSpriteFrame & 7); - } - - return 0; -} - -UINT8 __fastcall neogeoReadByteVideo(UINT32 sekAddress) -{ - if (sekAddress & 1) { - return 0x0FF; - } else { - return neogeoReadWordVideo(sekAddress) >> 8; - } -} - -void __fastcall neogeoWriteWordVideo(UINT32 sekAddress, UINT16 wordValue) -{ -// if (sekAddress >= 0x3C0010) -// bprintf(PRINT_NORMAL, _T(" - Attempt to write word 0x%06X -> 0x%04X\n"), sekAddress, wordValue); - - switch (sekAddress & 14) { - case 0x00: { - NeoGraphicsRAMPointer = wordValue << 1; - NeoGraphicsRAMBank = NeoGraphicsRAM; - - if (wordValue & 0x8000) { - NeoGraphicsRAMBank += 0x00010000; - } - break; - } - case 0x02: { - *((UINT16*)(NeoGraphicsRAMBank + NeoGraphicsRAMPointer)) = wordValue; - NeoGraphicsRAMPointer += nNeoGraphicsModulo; - -#if 0 - if ((NeoGraphicsRAMBank == NeoGraphicsRAM) && NeoGraphicsRAMPointer >= 0xC000 && NeoGraphicsRAMPointer < 0xE000) { - bprintf(PRINT_NORMAL, _T("VRAM bank 0 + 0x%04X -> %04X\n"), NeoGraphicsRAMPointer, wordValue); - } - if ((NeoGraphicsRAMBank != NeoGraphicsRAM) && NeoGraphicsRAMPointer >= 0x0C00) { - bprintf(PRINT_NORMAL, _T("VRAM bank 1 + 0x%04X -> %04X\n"), NeoGraphicsRAMPointer, wordValue); - } -#endif - -#if 1 && defined USE_SPEEDHACKS - bForcePartialRender |= bForceUpdateOnStatusRead; -#endif - break; - } - case 0x04: { - nNeoGraphicsModulo = ((INT16)wordValue) << 1; - break; - } - - case 0x06: { - nSpriteFrameSpeed = (wordValue >> 8); - - if ((nIRQControl & 0x10) == 0 && wordValue & 0x10) { - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ enabled (at line %3i, IRQControl: 0x%02X).\n"), SekCurrentScanline(), wordValue & 0xFF); -#endif - - if (nIRQCycles < nCyclesSegment) { - SekRunAdjust(nIRQCycles - nCyclesSegment); - } - } - -#if 0 || defined LOG_IRQ - if (nIRQControl & 0x10 && (wordValue & 0x10) == 0) { - bprintf(PRINT_NORMAL, _T(" - IRQ disabled (at line %3i, IRQControl: 0x%02X).\n"), SekCurrentScanline(), wordValue & 0xFF); - } -#endif - - nIRQControl = wordValue; -// bprintf(PRINT_NORMAL, _T(" - Autoanim speed -> 0x%02X\n"), wordValue >> 8); -// bprintf(PRINT_NORMAL, _T(" - IRQ control register -> 0x%02X (at line %3i)\n"), wordValue & 0xFF, SekCurrentScanline()); - break; - } - - case 0x08: { -// bprintf(PRINT_NORMAL, "0x%06X -> 0x%04X\n", sekAddress, wordValue); - // Bit 15 seems to be ignored - nIRQOffset = (nIRQOffset & 0x0000FFFF) | ((wordValue & 0x7FFF) << 16); - break; - } - case 0x0A: { -// bprintf(PRINT_NORMAL, "0x%06X -> 0x%04X\n", sekAddress, wordValue); - nIRQOffset = (nIRQOffset & 0xFFFF0000) | wordValue; - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ offs -> 0x%08X (at line %3i, IRQControl: 0x%02X).\n"), nIRQOffset, SekCurrentScanline(), nIRQControl); -#endif - - if (nIRQControl & 0x20) { - -#if 0 -// nIRQCycles = SekTotalCycles() - 64 + NeoConvertIRQPosition(nIRQOffset); - nIRQCycles = SekTotalCycles() + NeoConvertIRQPosition(nIRQOffset); -#else - // Turfmast uses this to set the timing of the raster interrupts. Using the code below, - // all raster effects in turfmast are correctly aligned and exhibit no flicker. - // (this sets the offset of the IRQ to the start of the current scanline instead of the actual beam position) - - // ssideki2 has some problems with this - nIRQCycles = SekCurrentScanline() * nSekCyclesScanline + NeoConvertIRQPosition(nIRQOffset + 8); -// bprintf(PRINT_NORMAL, _T(" %i - %i\n"), SekCurrentScanline(), SekTotalCycles() % SekCyclesScanline()); -#endif - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" IRQ Line -> %3i (at line %3i, relative).\n"), nIRQCycles / SekCyclesScanline(), SekCurrentScanline()); -#endif - - if (nIRQCycles < 0) { - nIRQCycles = NO_IRQ_PENDING; - } - if (nIRQCycles < nCyclesSegment) { - SekRunAdjust(nIRQCycles - nCyclesSegment); - } - } - - break; - } - - case 0x0C: { - NeoIRQUpdate(wordValue); - break; - } - } -} - -void __fastcall neogeoWriteByteVideo(UINT32 sekAddress, UINT8 byteValue) -{ -// bprintf(PRINT_NORMAL, _T(" - Attempt to write byte 0x%06X -> 0x%02X\n"), sekAddress, byteValue); - -#if 1 - if ((sekAddress & 1) == 0) { - neogeoWriteWordVideo(sekAddress, byteValue); - } -#else - if (sekAddress & 1) { - neogeoWriteWordVideo(sekAddress, byteValue); - } else { - neogeoWriteWordVideo(sekAddress, (byteValue << 8)); - } -#endif - -#if 1 && defined USE_SPEEDHACKS - bForcePartialRender |= bForceUpdateOnStatusRead; -#endif -} - -// ---------------------------------------------------------------------------- -// Backup RAM on MVS hardware - -void __fastcall neogeoWriteByteSRAM(UINT32 sekAddress, UINT8 byteValue) -{ - sekAddress &= 0xFFFF; - - if (bSRAMWritable) { - NeoNVRAM[sekAddress ^ 1] = byteValue; - } -} - -void __fastcall neogeoWriteWordSRAM(UINT32 sekAddress, UINT16 wordValue) -{ - sekAddress &= 0xFFFF; - - if (bSRAMWritable) { - *((UINT16*)(NeoNVRAM + sekAddress)) = BURN_ENDIAN_SWAP_INT16(wordValue); - } -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall neogeoReadByteMemoryCard(UINT32 sekAddress) -{ -// if (sekAddress < 0x800100) -// bprintf(PRINT_NORMAL, _T(" - Memcard 0x%04X read (PC: 0x%06X).\n"), sekAddress & 0x7FFF, SekGetPC(-1)); - - if (bMemoryCardInserted) { - if ((NeoSystem & 0x40) || (sekAddress & 1)) { - return NeoMemoryCard[sekAddress & 0x01FFFF]; - } - } - - return 0xFF; -} - -void __fastcall neogeoWriteByteMemoryCard(UINT32 sekAddress, UINT8 byteValue) -{ -// if (sekAddress < 0x800100) -// bprintf(PRINT_NORMAL, _T(" - Memcard 0x%04X -> 0x%02X (PC: 0x%06X).\n"), sekAddress & 0x7FFF, byteValue, SekGetPC(-1)); - - if (bMemoryCardInserted && bMemoryCardWritable) { - if ((NeoSystem & 0x40) || (sekAddress & 1)) { - NeoMemoryCard[sekAddress & 0x01FFFF] = byteValue; - } - } -} - -UINT8 __fastcall neoCDReadByteMemoryCard(UINT32 sekAddress) -{ - sekAddress &= 0x01FFFF; - if (sekAddress < 0x4000 && sekAddress & 1) { - return NeoMemoryCard[sekAddress]; - } - - return 0xFF; -} - -void __fastcall neoCDWriteByteMemoryCard(UINT32 sekAddress, UINT8 byteValue) -{ - sekAddress &= 0x01FFFF; - if (sekAddress < 0x4000 && sekAddress & 1) { - NeoMemoryCard[sekAddress] = byteValue; - } -} - -// ---------------------------------------------------------------------------- -// NeoCD CD-ROM controller handlers - -#define CD_FRAMES_MINUTE (60 * 75) -#define CD_FRAMES_SECOND ( 75) -#define CD_FRAMES_PREGAP ( 2 * 75) - -static INT32 nLC8951Register = 0; -static INT32 LC8951RegistersR[16]; -static INT32 LC8951RegistersW[16]; - -static INT32 nActiveTransferArea; -static INT32 nSpriteTransferBank; -static INT32 nADPCMTransferBank; - -static UINT8 nTransferWriteEnable; - -static bool NeoCDOBJBankUpdate[4]; - -static bool bNeoCDCommsClock, bNeoCDCommsSend; - -static UINT8 NeoCDCommsCommandFIFO[10] = { 0, }; -static UINT8 NeoCDCommsStatusFIFO[10] = { 0, }; - -static INT32 NeoCDCommsWordCount = 0; - -static INT32 NeoCDAssyStatus = 0; - -static INT32 NeoCDTrack = 0; - -static INT32 NeoCDSectorMin = 0; -static INT32 NeoCDSectorSec = 0; -static INT32 NeoCDSectorFrm = 0; -static INT32 NeoCDSectorLBA = 0; - -static char NeoCDSectorData[2352]; - -static bool bNeoCDLoadSector = false; - -static INT32 NeoCDDMAAddress1 = 0; -static INT32 NeoCDDMAAddress2 = 0; -static INT32 NeoCDDMAValue1 = 0; -static INT32 NeoCDDMAValue2 = 0; -static INT32 NeoCDDMACount = 0; - -static INT32 NeoCDDMAMode = 0; - -// hax0r -static INT32 nNeoCDMode = 0; -static INT32 nff0002 = 0; - -static void NeoCDLBAToMSF(const INT32 LBA) -{ - NeoCDSectorMin = (LBA + CD_FRAMES_PREGAP) / CD_FRAMES_MINUTE; - NeoCDSectorSec = (LBA + CD_FRAMES_PREGAP) % CD_FRAMES_MINUTE / CD_FRAMES_SECOND; - NeoCDSectorFrm = (LBA + CD_FRAMES_PREGAP) % CD_FRAMES_SECOND; -} - -static void NeoCDCommsWrite(UINT8 data) -{ - if (NeoCDCommsWordCount >= 0 && NeoCDCommsWordCount < 10) { - NeoCDCommsCommandFIFO[NeoCDCommsWordCount] = data & 0x0F; - } -} - -static UINT8 NeoCDCommsread() -{ - UINT8 ret = 0; - - if (NeoCDCommsWordCount >= 0 && NeoCDCommsWordCount < 10) { - ret = NeoCDCommsStatusFIFO[NeoCDCommsWordCount] & 0x0F; - } - - if (bNeoCDCommsClock) { - ret |= 0x10; - } - - return ret; -} - -static void NeoCDCommsReset() -{ - bNeoCDCommsSend = false; - bNeoCDCommsClock = true; - - memset(NeoCDCommsCommandFIFO, 0, sizeof(NeoCDCommsCommandFIFO)); - memset(NeoCDCommsStatusFIFO, 0, sizeof(NeoCDCommsStatusFIFO)); - - NeoCDCommsWordCount = 0; - - NeoCDAssyStatus = 9; - - memset(NeoCDSectorData, 0, sizeof(NeoCDSectorData)); - - bNeoCDLoadSector = false; - - nNeoCDMode = 0; -} - -static void LC8951UpdateHeader() -{ - NeoCDLBAToMSF(NeoCDSectorLBA); - - if (LC8951RegistersW[11] & 1) { - - // HEAD registers have sub-header - - LC8951RegistersR[4] = 0; // HEAD0 - LC8951RegistersR[5] = 0; // HEAD1 - LC8951RegistersR[6] = 0; // HEAD2 - LC8951RegistersR[7] = 0; // HEAD3 - - } else { - - // HEAD registers have header - - LC8951RegistersR[4] = ((NeoCDSectorMin / 10) << 4) | (NeoCDSectorMin % 10); // HEAD0 - LC8951RegistersR[5] = ((NeoCDSectorSec / 10) << 4) | (NeoCDSectorSec % 10); // HEAD1 - LC8951RegistersR[6] = ((NeoCDSectorFrm / 10) << 4) | (NeoCDSectorFrm % 10); // HEAD2 - LC8951RegistersR[7] = 1; // HEAD3 - } -} - -static char* LC8915InitTransfer() -{ - if (!LC8951RegistersW[6]) { - bprintf(PRINT_ERROR, _T(" LC8951 DTTRG status invalid\n")); - return NULL; - } - if (!(LC8951RegistersW[1] & 0x02)) { - bprintf(PRINT_ERROR, _T(" LC8951 DOUTEN status invalid\n")); - return NULL; - } - if (((LC8951RegistersW[5] << 8) | LC8951RegistersW[4]) + (NeoCDDMACount << 1) > 2352) { - bprintf(PRINT_ERROR, _T(" DMA transfer exceeds current sector in LC8951 external buffer\n")); - return NULL; - } - - return NeoCDSectorData + ((LC8951RegistersW[5] << 8) | LC8951RegistersW[4]); -} - -static void LC8915EndTransfer() -{ - LC8951RegistersW[6] = 0x00; // reset DTTRG - - LC8951RegistersR[1] |= 0x48; // set DTEI & DTBSY - if (LC8951RegistersW[1] & 0x40) { - - // trigger DTE interrupt - - // the Neo Geo CD doesn't use the DTE interrupt - // nIRQAcknowledge &= ~0x20; - // NeoCDIRQUpdate(0); - - } -} - -static void LC8951Reset() -{ - memset(LC8951RegistersR, 0, sizeof(LC8951RegistersR)); - memset(LC8951RegistersW, 0, sizeof(LC8951RegistersW)); - LC8951RegistersR[0x01] = 0xFF; - LC8951RegistersR[0x0F] = 0x80; - - LC8951UpdateHeader(); -} - -static void NeoCDProcessCommand() -{ - memset(NeoCDCommsStatusFIFO, 0, sizeof(NeoCDCommsStatusFIFO)); - - if (NeoCDCommsCommandFIFO[0]) { - NeoCDCommsStatusFIFO[1] = 15; - } - - switch (NeoCDCommsCommandFIFO[0]) { - case 0: - break; - case 1: -// bprintf(PRINT_ERROR, _T(" CD comms received command %i\n"), NeoCDCommsCommandFIFO[0]); - CDEmuStop(); - - NeoCDAssyStatus = 0x0E; - bNeoCDLoadSector = false; - break; - case 2: -// bprintf(PRINT_ERROR, _T(" CD comms received command %i\n"), NeoCDCommsCommandFIFO[0]); - NeoCDCommsStatusFIFO[1] = NeoCDCommsCommandFIFO[3]; - switch (NeoCDCommsCommandFIFO[3]) { - - case 0: { - UINT8* ChannelData = CDEmuReadQChannel(); - - NeoCDCommsStatusFIFO[2] = ChannelData[1] / 10; - NeoCDCommsStatusFIFO[3] = ChannelData[1] % 10; - - NeoCDCommsStatusFIFO[4] = ChannelData[2] / 10; - NeoCDCommsStatusFIFO[5] = ChannelData[2] % 10; - - NeoCDCommsStatusFIFO[6] = ChannelData[3] / 10; - NeoCDCommsStatusFIFO[7] = ChannelData[3] % 10; - - NeoCDCommsStatusFIFO[8] = ChannelData[7]; - -// bprintf(PRINT_ERROR, _T(" %02i %02i:%02i:%02i %02i:%02i:%02i %02i\n"), ChannelData[0], ChannelData[1], ChannelData[2], ChannelData[3], ChannelData[4], ChannelData[5], ChannelData[6], ChannelData[7]); - - break; - } - case 1: { - UINT8* ChannelData = CDEmuReadQChannel(); - - NeoCDCommsStatusFIFO[2] = ChannelData[4] / 10; - NeoCDCommsStatusFIFO[3] = ChannelData[4] % 10; - - NeoCDCommsStatusFIFO[4] = ChannelData[5] / 10; - NeoCDCommsStatusFIFO[5] = ChannelData[5] % 10; - - NeoCDCommsStatusFIFO[6] = ChannelData[6] / 10; - NeoCDCommsStatusFIFO[7] = ChannelData[6] % 10; - - NeoCDCommsStatusFIFO[8] = ChannelData[7]; - - break; - } - case 2: { - - UINT8* ChannelData = CDEmuReadQChannel(); - - NeoCDCommsStatusFIFO[2] = ChannelData[0] / 10; - NeoCDCommsStatusFIFO[3] = ChannelData[0] % 10; - - - NeoCDCommsStatusFIFO[8] = ChannelData[7]; - - break; - } - case 3: { - UINT8* TOCEntry = CDEmuReadTOC(-2); - - NeoCDCommsStatusFIFO[2] = TOCEntry[0] / 10; - NeoCDCommsStatusFIFO[3] = TOCEntry[0] % 10; - - NeoCDCommsStatusFIFO[4] = TOCEntry[1] / 10; - NeoCDCommsStatusFIFO[5] = TOCEntry[1] % 10; - - NeoCDCommsStatusFIFO[6] = TOCEntry[2] / 10; - NeoCDCommsStatusFIFO[7] = TOCEntry[2] % 10; - - break; - } - case 4: { - UINT8* TOCEntry = CDEmuReadTOC(-1); - - NeoCDCommsStatusFIFO[2] = TOCEntry[0] / 10; - NeoCDCommsStatusFIFO[3] = TOCEntry[0] % 10; - - NeoCDCommsStatusFIFO[4] = TOCEntry[1] / 10; - NeoCDCommsStatusFIFO[5] = TOCEntry[1] % 10; - - break; - } - case 5: { - NeoCDTrack = NeoCDCommsCommandFIFO[4] * 10 + NeoCDCommsCommandFIFO[5]; - - UINT8* TOCEntry = CDEmuReadTOC(NeoCDTrack); - - NeoCDCommsStatusFIFO[2] = TOCEntry[0] / 10; - NeoCDCommsStatusFIFO[3] = TOCEntry[0] % 10; - - NeoCDCommsStatusFIFO[4] = TOCEntry[1] / 10; - NeoCDCommsStatusFIFO[5] = TOCEntry[1] % 10; - - NeoCDCommsStatusFIFO[6] = TOCEntry[2] / 10; - NeoCDCommsStatusFIFO[7] = TOCEntry[2] % 10; - - // bit 3 of the 1st minutes digit indicates a data track - if (TOCEntry[3] & 4) { - NeoCDCommsStatusFIFO[6] |= 8; - } - - NeoCDCommsStatusFIFO[8] = NeoCDTrack % 10; - - break; - } - - case 6: { - - UINT8* ChannelData = CDEmuReadQChannel(); - - NeoCDCommsStatusFIFO[8] = ChannelData[7]; - - break; - } - - case 7: { - - // must be 02, 0E, 0F, or 05 - NeoCDCommsStatusFIFO[2] = 0; - NeoCDCommsStatusFIFO[3] = 5; - - NeoCDCommsStatusFIFO[4] = 0; - NeoCDCommsStatusFIFO[5] = 0; - - NeoCDCommsStatusFIFO[6] = 0; - NeoCDCommsStatusFIFO[7] = 0; - break; - } - } - break; - - case 3: { - - if (LC8951RegistersW[10] & 4) { - - if (CDEmuGetStatus() == playing) { - bprintf(PRINT_ERROR, _T("*** Switching CD mode to CD-ROM while in audio mode!(PC: 0x%06X)\n"), SekGetPC(-1)); - } - - NeoCDSectorLBA = NeoCDCommsCommandFIFO[2] * (10 * CD_FRAMES_MINUTE); - NeoCDSectorLBA += NeoCDCommsCommandFIFO[3] * ( 1 * CD_FRAMES_MINUTE); - NeoCDSectorLBA += NeoCDCommsCommandFIFO[4] * (10 * CD_FRAMES_SECOND); - NeoCDSectorLBA += NeoCDCommsCommandFIFO[5] * ( 1 * CD_FRAMES_SECOND); - NeoCDSectorLBA += NeoCDCommsCommandFIFO[6] * (10 ); - NeoCDSectorLBA += NeoCDCommsCommandFIFO[7] * ( 1 ); - - NeoCDSectorLBA -= CD_FRAMES_PREGAP; - - CDEmuStartRead(); -// LC8951RegistersR[1] |= 0x20; - } else { - - if (CDEmuGetStatus() == reading) { - bprintf(PRINT_ERROR, _T("*** Switching CD mode to audio while in CD-ROM mode!(PC: 0x%06X)\n"), SekGetPC(-1)); - } - - CDEmuPlay((NeoCDCommsCommandFIFO[2] * 10) + NeoCDCommsCommandFIFO[3], (NeoCDCommsCommandFIFO[4] * 10) + NeoCDCommsCommandFIFO[5], (NeoCDCommsCommandFIFO[6] * 10) + NeoCDCommsCommandFIFO[7]); - } - - NeoCDAssyStatus = 1; - bNeoCDLoadSector = true; - - break; - } - case 4: -// bprintf(PRINT_ERROR, _T(" CD comms received command %i\n"), NeoCDCommsCommandFIFO[0]); - CDEmuPause(); - break; - case 5: -// bprintf(PRINT_ERROR, _T(" CD comms received command %i\n"), NeoCDCommsCommandFIFO[0]); -// NeoCDAssyStatus = 9; -// bNeoCDLoadSector = false; - break; - - case 6: -// bprintf(PRINT_ERROR, _T(" CD comms received command %i\n"), NeoCDCommsCommandFIFO[0]); - NeoCDAssyStatus = 4; - bNeoCDLoadSector = false; - break; - case 7: -// bprintf(PRINT_ERROR, _T(" CD comms received command %i\n"), NeoCDCommsCommandFIFO[0]); - NeoCDAssyStatus = 1; - bNeoCDLoadSector = true; - break; - - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: -// bprintf(PRINT_ERROR, _T(" CD comms received command %i\n"), NeoCDCommsCommandFIFO[0]); - NeoCDAssyStatus = 9; - bNeoCDLoadSector = false; - break; - } -} - -static void NeoCDDoDMA() -{ - - // The LC8953 chip has a programmable DMA controller, which is not properly emulated. - // Since the software only uses it in a limited way, we can apply a simple heuristic - // to determnine the requested operation. - - // Additionally, we don't know how many cycles DMA operations take. - // Here, only bus access is used to get a rough approximation -- - // each read/write takes a single cycle, setup and everything else is ignored. - -// bprintf(PRINT_IMPORTANT, _T(" - DMA controller transfer started (PC: 0x%06X)\n"), SekGetPC(-1)); - - switch (NeoCDDMAMode) { - - case 0xCFFD: { -// bprintf(PRINT_NORMAL, _T(" adr : 0x%08X - 0x%08X <- address, skip odd bytes\n"), NeoCDDMAAddress1, NeoCDDMAAddress1 + NeoCDDMACount * 8); - - // - DMA controller 0x7E -> 0xCFFD (PC: 0xC07CE2) - // - DMA controller program[00] -> 0xFCF5 (PC: 0xC07CE8) - // - DMA controller program[02] -> 0xE8DA (PC: 0xC07CEE) - // - DMA controller program[04] -> 0x92DA (PC: 0xC07CF4) - // - DMA controller program[06] -> 0x92DB (PC: 0xC07CFA) - // - DMA controller program[08] -> 0x96DB (PC: 0xC07D00) - // - DMA controller program[10] -> 0x96F6 (PC: 0xC07D06) - // - DMA controller program[12] -> 0x2E02 (PC: 0xC07D0C) - // - DMA controller program[14] -> 0xFDFF (PC: 0xC07D12) - - SekIdle(NeoCDDMACount * 4); - - while (NeoCDDMACount--) { - SekWriteWord(NeoCDDMAAddress1 + 0, NeoCDDMAAddress1 >> 24); - SekWriteWord(NeoCDDMAAddress1 + 2, NeoCDDMAAddress1 >> 16); - SekWriteWord(NeoCDDMAAddress1 + 4, NeoCDDMAAddress1 >> 8); - SekWriteWord(NeoCDDMAAddress1 + 6, NeoCDDMAAddress1 >> 0); - NeoCDDMAAddress1 += 8; - } - - break; - } - - case 0xE2DD: { -// bprintf(PRINT_NORMAL, _T(" copy: 0x%08X - 0x%08X <- 0x%08X - 0x%08X, skip odd bytes\n"), NeoCDDMAAddress2, NeoCDDMAAddress2 + NeoCDDMACount * 2, NeoCDDMAAddress1, NeoCDDMAAddress1 + NeoCDDMACount * 4); - - // - DMA controller 0x7E -> 0xE2DD (PC: 0xC0A190) - // - DMA controller program[00] -> 0xFCF5 (PC: 0xC0A192) - // - DMA controller program[02] -> 0x82BE (PC: 0xC0A194) - // - DMA controller program[04] -> 0x93DA (PC: 0xC0A196) - // - DMA controller program[06] -> 0xBE93 (PC: 0xC0A198) - // - DMA controller program[08] -> 0xDABE (PC: 0xC0A19A) - // - DMA controller program[10] -> 0xF62D (PC: 0xC0A19C) - // - DMA controller program[12] -> 0x02FD (PC: 0xC0A19E) - // - DMA controller program[14] -> 0xFFFF (PC: 0xC0A1A0) - - SekIdle(NeoCDDMACount * 1); - - while (NeoCDDMACount--) { - SekWriteWord(NeoCDDMAAddress2 + 0, SekReadByte(NeoCDDMAAddress1 + 0)); - SekWriteWord(NeoCDDMAAddress2 + 2, SekReadByte(NeoCDDMAAddress1 + 1)); - NeoCDDMAAddress1 += 2; - NeoCDDMAAddress2 += 4; - } - - break; - } - - case 0xFC2D: { -// bprintf(PRINT_NORMAL, _T(" copy: 0x%08X - 0x%08X <- LC8951 external buffer, skip odd bytes\n"), NeoCDDMAAddress1, NeoCDDMAAddress1 + NeoCDDMACount * 4); - - // - DMA controller 0x7E -> 0xFC2D (PC: 0xC0A190) - // - DMA controller program[00] -> 0xFCF5 (PC: 0xC0A192) - // - DMA controller program[02] -> 0x8492 (PC: 0xC0A194) - // - DMA controller program[04] -> 0xDA92 (PC: 0xC0A196) - // - DMA controller program[06] -> 0xDAF6 (PC: 0xC0A198) - // - DMA controller program[08] -> 0x2A02 (PC: 0xC0A19A) - // - DMA controller program[10] -> 0xFDFF (PC: 0xC0A19C) - // - DMA controller program[12] -> 0x48E7 (PC: 0xC0A19E) - // - DMA controller program[14] -> 0xFFFE (PC: 0xC0A1A0) - - char* data = LC8915InitTransfer(); - if (data == NULL) { - break; - } - - SekIdle(NeoCDDMACount * 4); - - while (NeoCDDMACount--) { - SekWriteByte(NeoCDDMAAddress1 + 0, data[0]); - SekWriteByte(NeoCDDMAAddress1 + 2, data[1]); - NeoCDDMAAddress1 += 4; - data += 2; - } - - LC8915EndTransfer(); - - break; - } - - case 0xFE3D: - - // - DMA controller 0x7E -> 0xFE3D (PC: 0xC0A190) - // - DMA controller program[00] -> 0xFCF5 (PC: 0xC0A192) - // - DMA controller program[02] -> 0x82BF (PC: 0xC0A194) - // - DMA controller program[04] -> 0x93BF (PC: 0xC0A196) - // - DMA controller program[06] -> 0xF629 (PC: 0xC0A198) - // - DMA controller program[08] -> 0x02FD (PC: 0xC0A19A) - // - DMA controller program[10] -> 0xFFFF (PC: 0xC0A19C) - // - DMA controller program[12] -> 0xF17D (PC: 0xC0A19E) - // - DMA controller program[14] -> 0xFCF5 (PC: 0xC0A1A0) - - case 0xFE6D: { -// bprintf(PRINT_NORMAL, _T(" copy: 0x%08X - 0x%08X <- 0x%08X - 0x%08X\n"), NeoCDDMAAddress2, NeoCDDMAAddress2 + NeoCDDMACount * 2, NeoCDDMAAddress1, NeoCDDMAAddress1 + NeoCDDMACount * 2); - - // - DMA controller 0x7E -> 0xFE6D (PC: 0xC0FD7A) - // - DMA controller program[00] -> 0xFCF5 (PC: 0xC0FD7C) - // - DMA controller program[02] -> 0x82BF (PC: 0xC0FD7E) - // - DMA controller program[04] -> 0xF693 (PC: 0xC0FD80) - // - DMA controller program[06] -> 0xBF29 (PC: 0xC0FD82) - // - DMA controller program[08] -> 0x02FD (PC: 0xC0FD84) - // - DMA controller program[10] -> 0xFFFF (PC: 0xC0FD86) - // - DMA controller program[12] -> 0xC515 (PC: 0xC0FD88) - // - DMA controller program[14] -> 0xFCF5 (PC: 0xC0FD8A) - - SekIdle(NeoCDDMACount * 1); - - while (NeoCDDMACount--) { - SekWriteWord(NeoCDDMAAddress2, SekReadWord(NeoCDDMAAddress1)); - NeoCDDMAAddress1 += 2; - NeoCDDMAAddress2 += 2; - } - -if (NeoCDDMAAddress2 == 0x0800) { -// MapVectorTable(false); -// bprintf(PRINT_ERROR, _T(" RAM vectors mapped (PC = 0x%08X\n"), SekGetPC(0)); -// extern INT32 bRunPause; -// bRunPause = 1; -} - break; - } - - case 0xFEF5: { -// bprintf(PRINT_NORMAL, _T(" adr : 0x%08X - 0x%08X <- address\n"), NeoCDDMAAddress1, NeoCDDMAAddress1 + NeoCDDMACount * 4); - - // - DMA controller 0x7E -> 0xFEF5 (PC: 0xC07CE2) - // - DMA controller program[00] -> 0xFCF5 (PC: 0xC07CE8) - // - DMA controller program[02] -> 0x92E8 (PC: 0xC07CEE) - // - DMA controller program[04] -> 0xBE96 (PC: 0xC07CF4) - // - DMA controller program[06] -> 0xF629 (PC: 0xC07CFA) - // - DMA controller program[08] -> 0x02FD (PC: 0xC07D00) - // - DMA controller program[10] -> 0xFFFF (PC: 0xC07D06) - // - DMA controller program[12] -> 0xFC3D (PC: 0xC07D0C) - // - DMA controller program[14] -> 0xFCF5 (PC: 0xC07D12) - - SekIdle(NeoCDDMACount * 2); - - while (NeoCDDMACount--) { - SekWriteWord(NeoCDDMAAddress1 + 0, NeoCDDMAAddress1 >> 16); - SekWriteWord(NeoCDDMAAddress1 + 2, NeoCDDMAAddress1 >> 0); - NeoCDDMAAddress1 += 4; - } - - break; - } - - case 0xFFC5: { -// bprintf(PRINT_NORMAL, _T(" copy: 0x%08X - 0x%08X <- LC8951 external buffer\n"), NeoCDDMAAddress1, NeoCDDMAAddress1 + NeoCDDMACount * 2); - - // - DMA controller 0x7E -> 0xFFC5 (PC: 0xC0A190) - // - DMA controller program[00] -> 0xFCF5 (PC: 0xC0A192) - // - DMA controller program[02] -> 0xA6F6 (PC: 0xC0A194) - // - DMA controller program[04] -> 0x2602 (PC: 0xC0A196) - // - DMA controller program[06] -> 0xFDFF (PC: 0xC0A198) - // - DMA controller program[08] -> 0xFC2D (PC: 0xC0A19A) - // - DMA controller program[10] -> 0xFCF5 (PC: 0xC0A19C) - // - DMA controller program[12] -> 0x8492 (PC: 0xC0A19E) - // - DMA controller program[14] -> 0xDA92 (PC: 0xC0A1A0) - - char* data = LC8915InitTransfer(); - if (data == NULL) { - break; - } - - SekIdle(NeoCDDMACount * 4); - - while (NeoCDDMACount--) { - SekWriteByte(NeoCDDMAAddress1 + 0, data[0]); - SekWriteByte(NeoCDDMAAddress1 + 1, data[1]); - NeoCDDMAAddress1 += 2; - data += 2; - } - - LC8915EndTransfer(); - - break; - } - - case 0xFFCD: - - // - DMA controller 0x7E -> 0xFFCD (PC: 0xC0A190) - // - DMA controller program[00] -> 0xFCF5 (PC: 0xC0A192) - // - DMA controller program[02] -> 0x92F6 (PC: 0xC0A194) - // - DMA controller program[04] -> 0x2602 (PC: 0xC0A196) - // - DMA controller program[06] -> 0xFDFF (PC: 0xC0A198) - // - DMA controller program[08] -> 0x7006 (PC: 0xC0A19A) - // - DMA controller program[10] -> 0x6100 (PC: 0xC0A19C) - // - DMA controller program[12] -> 0x2412 (PC: 0xC0A19E) - // - DMA controller program[14] -> 0x13FC (PC: 0xC0A1A0) - - case 0xFFDD: { -// bprintf(PRINT_NORMAL, _T(" Fill: 0x%08X - 0x%08X <- 0x%04X\n"), NeoCDDMAAddress1, NeoCDDMAAddress1 + NeoCDDMACount * 2, NeoCDDMAValue1); - - // - DMA controller 0x7E -> 0xFFDD (PC: 0xC07CE2) - // - DMA controller program[00] -> 0xFCF5 (PC: 0xC07CE8) - // - DMA controller program[02] -> 0x92F6 (PC: 0xC07CEE) - // - DMA controller program[04] -> 0x2602 (PC: 0xC07CF4) - // - DMA controller program[06] -> 0xFDFF (PC: 0xC07CFA) - // - DMA controller program[08] -> 0xFFFF (PC: 0xC07D00) - // - DMA controller program[10] -> 0xFCF5 (PC: 0xC07D06) - // - DMA controller program[12] -> 0x8AF0 (PC: 0xC07D0C) - // - DMA controller program[14] -> 0x1609 (PC: 0xC07D12) - - SekIdle(NeoCDDMACount * 1); - - while (NeoCDDMACount--) { - SekWriteWord(NeoCDDMAAddress1, NeoCDDMAValue1); - NeoCDDMAAddress1 += 2; - } - - break; - } - default: { - bprintf(PRINT_ERROR, _T(" Unknown transfer type 0x%04X (PC: 0x%06X)\n"), NeoCDDMAMode, SekGetPC(-1)); - bprintf(PRINT_NORMAL, _T(" ??? : 0x%08X 0x%08X 0x%04X 0x%04X 0x%08X\n"), NeoCDDMAAddress1, NeoCDDMAAddress2, NeoCDDMAValue1, NeoCDDMAValue2, NeoCDDMACount); - -extern INT32 bRunPause; -bRunPause = 1; - - } - } -} - -static void NeoCDCommsControl(UINT8 clock, UINT8 send) -{ - if (clock && !bNeoCDCommsClock) { - NeoCDCommsWordCount++; - if (NeoCDCommsWordCount >= 10) { - NeoCDCommsWordCount = 0; - - if (send) { - - // command receive complete - - if (NeoCDCommsCommandFIFO[0]) { - INT32 sum = 0; - -// bprintf(PRINT_NORMAL, _T(" - CD mechanism command receive completed : 0x")); - for (INT32 i = 0; i < 9; i++) { -// bprintf(PRINT_NORMAL, _T("%X"), NeoCDCommsCommandFIFO[i]); - sum += NeoCDCommsCommandFIFO[i]; - } - sum = ~(sum + 5) & 0x0F; -// bprintf(PRINT_NORMAL, _T(" (CS 0x%X, %s)\n"), NeoCDCommsCommandFIFO[9], (sum == NeoCDCommsCommandFIFO[9]) ? _T("OK") : _T("NG")); - if (sum == NeoCDCommsCommandFIFO[9]) { - - NeoCDProcessCommand(); - - if (NeoCDCommsCommandFIFO[0]) { - - if (NeoCDAssyStatus == 1) { - if (CDEmuGetStatus() == idle) { - NeoCDAssyStatus = 0x0E; - bNeoCDLoadSector = false; - } - } - - NeoCDCommsStatusFIFO[0] = NeoCDAssyStatus; - -#if 0 - extern INT32 counter; - if (counter) { - NeoCDCommsStatusFIFO[0] = counter & 0x0F; - } -#endif - - // compute checksum - - sum = 0; - - for (INT32 i = 0; i < 9; i++) { - sum += NeoCDCommsStatusFIFO[i]; - } - NeoCDCommsStatusFIFO[9] = ~(sum + 5) & 0x0F; - } - } - } - } else { - - // status send complete - -// if (NeoCDCommsStatusFIFO[0] || NeoCDCommsStatusFIFO[1]) { -// INT32 sum = 0; -// -// bprintf(PRINT_NORMAL, _T(" - CD mechanism status send completed : 0x")); -// for (INT32 i = 0; i < 9; i++) { -// bprintf(PRINT_NORMAL, _T("%X"), NeoCDCommsStatusFIFO[i]); -// sum += NeoCDCommsStatusFIFO[i]; -// } -// sum = ~(sum + 5) & 0x0F; -// bprintf(PRINT_NORMAL, _T(" (CS 0x%X, %s)\n"), NeoCDCommsStatusFIFO[9], (sum == NeoCDCommsStatusFIFO[9]) ? _T("OK") : _T("NG")); -// } - -// if (NeoCDAssyStatus == 0xE) { -// NeoCDAssyStatus = 9; -// } - } - - } - bNeoCDCommsSend = send; - } - bNeoCDCommsClock = clock; -} - -void NeoCDReadSector() -{ - if ((nff0002 & 0x0500)) { - if (NeoCDAssyStatus == 1 && bNeoCDLoadSector) { - -// if (LC8951RegistersW[10] & 0x80) { - NeoCDSectorLBA++; - NeoCDSectorLBA = CDEmuLoadSector(NeoCDSectorLBA, NeoCDSectorData + 4) - 1; -// } - - if (LC8951RegistersW[10] & 0x80) { - LC8951UpdateHeader(); - - LC8951RegistersR[12] = 0x80; // STAT0 - LC8951RegistersR[13] = 0; // STAT1 - LC8951RegistersR[14] = 0x10; // STAT2 - LC8951RegistersR[15] = 0; // STAT3 - -// bprintf(PRINT_IMPORTANT, _T(" Sector %08i (%02i:%02i:%02i) read\n"), NeoCDSectorLBA, NeoCDSectorMin, NeoCDSectorSec, NeoCDSectorFrm); - -#if 1 - if (NeoCDSectorData[4 + 64] == 'g' && !strncmp(NeoCDSectorData + 4, "Copyright by SNK", 16)) { -// printf(PRINT_ERROR, _T(" simulated CDZ protection error\n")); -// bprintf(PRINT_ERROR, _T(" %.70hs\n"), NeoCDSectorData + 4); - - NeoCDSectorData[4 + 64] = 'f'; - - // LC8951RegistersR[12] = 0x00; // STAT0 - } -#endif - - nIRQAcknowledge &= ~0x20; - NeoCDIRQUpdate(0); - - LC8951RegistersR[1] &= ~0x20; - -// bprintf(PRINT_IMPORTANT, _T(" DECI interrupt triggered\n")); - } - } - - bNeoCDLoadSector = true; -// bNeoCDLoadSector = false; - } -} - -UINT8 __fastcall neogeoReadByteCDROM(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, _T(" - CDROM: 0x%06X read (byte, PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - - switch (sekAddress & 0xFFFF) { - - case 0x0017: - return nNeoCDMode; - - // LC8951 registers - case 0x0101: -// bprintf(PRINT_NORMAL, _T(" - LC8951 register read (PC: 0x%06X)\n"), SekGetPC(-1)); - return nLC8951Register; - case 0x0103: { -// bprintf(PRINT_NORMAL, _T(" - LC8951 register 0x%X read (PC: 0x%06X)\n"), nLC8951Register, SekGetPC(-1)); - - INT32 reg = LC8951RegistersR[nLC8951Register]; - - switch (nLC8951Register) { - case 0x03: // DBCH - LC8951RegistersR[3] &= 0x0F; - LC8951RegistersR[3] |= (LC8951RegistersR[1] & 0x40) ? 0x00 : 0xF0; - break; - case 0x0D: // STAT3 - LC8951RegistersR[1] |= 0x20; // reset DECI - // bprintf(PRINT_ERROR, _T(" - DECI (PC: 0x%06X)\n"), SekGetPC(-1)); - break; - } - - nLC8951Register = (nLC8951Register + 1) & 0x0F; - return reg; - } - - // CD mechanism communication - case 0x0161: - return NeoCDCommsread(); - - default: { -// bprintf(PRINT_NORMAL, _T(" - NGCD port 0x%06X read (byte, PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - } - } - - return ~0; -} - -UINT16 __fastcall neogeoReadWordCDROM(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, _T(" - CDROM: 0x%06X read (word, PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - -#if 1 - switch (sekAddress & 0xFFFF) { - case 0x011C: - return ~((0x10 | (NeoSystem & 3)) << 8); - } -#endif - -// bprintf(PRINT_NORMAL, _T(" - NGCD port 0x%06X read (word, PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - - return ~0; -} - -void __fastcall neogeoWriteByteCDROM(UINT32 sekAddress, UINT8 byteValue) -{ -// bprintf(PRINT_NORMAL, _T(" - Neo Geo CD: 0x%06X -> 0x%02X (PC: 0x%06X)\n"), sekAddress, byteValue, SekGetPC(-1)); - - switch (sekAddress & 0xFFFF) { - case 0x000F: - NeoCDIRQUpdate(byteValue); - break; - - case 0x0017: - nNeoCDMode = byteValue; - break; - - case 0x0061: - if (byteValue & 0x40) { - NeoCDDoDMA(); - } - break; - - // LC8951 registers - case 0x0101: - nLC8951Register = byteValue & 0x0F; -// bprintf(PRINT_NORMAL, _T(" - LC8951 register -> 0x%02X (PC: 0x%06X)\n"), nLC8951Register, SekGetPC(-1)); - break; - case 0x0103: -// bprintf(PRINT_NORMAL, _T(" - LC8951 register 0x%X -> 0x%02X (PC: 0x%06X)\n"), nLC8951Register, byteValue, SekGetPC(-1)); - switch (nLC8951Register) { - case 3: // DBCH - LC8951RegistersW[ 3] = byteValue & 0x0F; - break; - case 6: // DTTRG - LC8951RegistersW[ 6] = ~0x00; - LC8951RegistersR[ 1] &= ~0x08; - break; - case 7: // DTACK - LC8951RegistersW[ 7] = ~0x00; - LC8951RegistersR[ 1] &= ~0x40; - break; -// case 10: -// LC8951RegistersW[nLC8951Register] = byteValue; -// bprintf(PRINT_NORMAL, _T(" - CTRL0 -> %02X (PC: 0x%06X)\n"), LC8951RegistersW[nLC8951Register], byteValue, SekGetPC(-1)); -// break; - case 11: - LC8951RegistersW[11] = byteValue; // CTRL1 - LC8951UpdateHeader(); - break; - case 15: - LC8951Reset(); - break; - default: - LC8951RegistersW[nLC8951Register] = byteValue; - } - nLC8951Register = (nLC8951Register + 1) & 0x0F; - break; - - case 0x0105: -// bprintf(PRINT_NORMAL, _T(" - NGCD 0xE00000 area -> 0x%02X (PC: 0x%06X)\n"), byteValue, SekGetPC(-1)); - nActiveTransferArea = byteValue; - break; - - case 0x0121: -// bprintf(PRINT_NORMAL, _T(" - NGCD OBJ BUSREQ -> 1 (PC: 0x%06X)\n"), SekGetPC(-1)); - NeoSetSpriteSlot(1); - memset(NeoCDOBJBankUpdate, 0, sizeof(NeoCDOBJBankUpdate)); - break; - case 0x0123: -// bprintf(PRINT_NORMAL, _T(" - NGCD PCM BUSREQ -> 1 (PC: 0x%06X) %x\n"), SekGetPC(-1), byteValue); - break; - case 0x0127: -// bprintf(PRINT_NORMAL, _T(" - NGCD Z80 BUSREQ -> 1 (PC: 0x%06X)\n"), SekGetPC(-1)); - neogeoSynchroniseZ80(0); - ZetSetBUSREQLine(1); - break; - case 0x0129: -// bprintf(PRINT_NORMAL, _T(" - NGCD FIX BUSREQ -> 1 (PC: 0x%06X)\n"), SekGetPC(-1)); - NeoSetTextSlot(1); - break; - - case 0x0141: -// bprintf(PRINT_NORMAL, _T(" - NGCD OBJ BUSREQ -> 0 (PC: 0x%06X)\n"), SekGetPC(-1)); - NeoSetSpriteSlot(0); - for (INT32 i = 0; i < 4; i++) { - if (NeoCDOBJBankUpdate[i]) { - NeoDecodeSpritesCD(NeoSpriteRAM + (i << 20), NeoSpriteROM[0] + (i << 20), 0x100000); - NeoUpdateSprites((i << 20), 0x100000); - } - } - - break; - case 0x0143: -// bprintf(PRINT_NORMAL, _T(" - NGCD PCM BUSREQ -> 0 (PC: 0x%06X)\n"), SekGetPC(-1)); - break; - case 0x0147: -// bprintf(PRINT_NORMAL, _T(" - NGCD Z80 BUSREQ -> 0 (PC: 0x%06X)\n"), SekGetPC(-1)); - neogeoSynchroniseZ80(0); - ZetSetBUSREQLine(0); - break; - case 0x0149: -// bprintf(PRINT_NORMAL, _T(" - NGCD FIX BUSREQ -> 0 (PC: 0x%06X)\n"), SekGetPC(-1)); - NeoSetTextSlot(0); - NeoUpdateText(0, 0x020000, NeoTextRAM, NeoTextROM[0]); - break; - - // CD mechanism communication - case 0x0163: - NeoCDCommsWrite(byteValue); - break; - case 0x0165: - NeoCDCommsControl(byteValue & 1, byteValue & 2); - break; - - case 0x016D: -// bprintf(PRINT_ERROR, _T(" - NGCD port 0x%06X -> 0x%02X (PC: 0x%06X)\n"), sekAddress, byteValue, SekGetPC(-1)); - - MapVectorTable(!(byteValue == 0xFF)); - -//extern INT32 bRunPause; -//bRunPause = 1; - break; - - case 0x016F: -// bprintf(PRINT_IMPORTANT, _T(" - NGCD 0xE00000 area write access %s (0x%02X, PC: 0x%06X)\n"), byteValue ? _T("enabled") : _T("disabled"), byteValue, SekGetPC(-1)); - - nTransferWriteEnable = byteValue; - break; - - case 0x0181: { - static UINT8 clara = 0; - if (!byteValue && clara) { -// bprintf(PRINT_IMPORTANT, _T(" - NGCD CD communication reset (PC: 0x%06X)\n"), SekGetPC(-1)); -// NeoCDCommsReset(); - } - clara = byteValue; - break; - } - case 0x0183: { - static UINT8 clara = 0; - if (!byteValue && clara) { -// bprintf(PRINT_IMPORTANT, _T(" - NGCD Z80 reset (PC: 0x%06X)\n"), SekGetPC(-1)); - //ZetReset(); - } - clara = byteValue; - break; - } - case 0x01A1: - nSpriteTransferBank = (byteValue & 3) << 20; - break; - case 0x01A3: - nADPCMTransferBank = (byteValue & 1) << 19; - break; - - default: { -// bprintf(PRINT_NORMAL, _T(" - NGCD port 0x%06X -> 0x%02X (PC: 0x%06X)\n"), sekAddress, byteValue, SekGetPC(-1)); - } - } -} - -void __fastcall neogeoWriteWordCDROM(UINT32 sekAddress, UINT16 wordValue) -{ -// bprintf(PRINT_NORMAL, _T(" - NGCD port 0x%06X -> 0x%04X (PC: 0x%06X)\n"), sekAddress, wordValue, SekGetPC(-1)); - - switch (sekAddress & 0xFFFE) { - case 0x0002: -// bprintf(PRINT_IMPORTANT, _T(" - NGCD Interrupt mask -> 0x%04X (PC: 0x%06X)\n"), wordValue, SekGetPC(-1)); - nff0002 = wordValue; - -// LC8951RegistersR[1] |= 0x20; - - if (nff0002 & 0x0500) - nNeoCDCyclesIRQPeriod = (INT32)(12000000.0 * nBurnCPUSpeedAdjust / (256.0 * 75.0)); - else - nNeoCDCyclesIRQPeriod = (INT32)(12000000.0 * nBurnCPUSpeedAdjust / (256.0 * 75.0)); - - break; - - case 0x000E: - NeoCDIRQUpdate(wordValue); - break; - - // DMA controller - - case 0x0064: - NeoCDDMAAddress1 &= 0x0000FFFF; - NeoCDDMAAddress1 |= wordValue << 16; - break; - case 0x0066: - NeoCDDMAAddress1 &= 0xFFFF0000; - NeoCDDMAAddress1 |= wordValue; - break; - case 0x0068: - NeoCDDMAAddress2 &= 0x0000FFFF; - NeoCDDMAAddress2 |= wordValue << 16; - break; - case 0x006A: - NeoCDDMAAddress2 &= 0xFFFF0000; - NeoCDDMAAddress2 |= wordValue; - break; - case 0x006C: - NeoCDDMAValue1 = wordValue; - break; - case 0x006E: - NeoCDDMAValue2 = wordValue; - break; - case 0x0070: - NeoCDDMACount &= 0x0000FFFF; - NeoCDDMACount |= wordValue << 16; - break; - case 0x0072: - NeoCDDMACount &= 0xFFFF0000; - NeoCDDMACount |= wordValue; - break; - - case 0x007E: - NeoCDDMAMode = wordValue; -// bprintf(PRINT_NORMAL, _T(" - DMA controller 0x%2X -> 0x%04X (PC: 0x%06X)\n"), sekAddress & 0xFF, wordValue, SekGetPC(-1)); - break; - - // upload DMA controller program - - case 0x0080: - case 0x0082: - case 0x0084: - case 0x0086: - case 0x0088: - case 0x008A: - case 0x008C: - case 0x008E: -// bprintf(PRINT_NORMAL, _T(" - DMA controller program[%02i] -> 0x%04X (PC: 0x%06X)\n"), sekAddress & 0x0F, wordValue, SekGetPC(-1)); - break; - - default: { -// bprintf(PRINT_NORMAL, _T(" - NGCD port 0x%06X -> 0x%04X (PC: 0x%06X)\n"), sekAddress, wordValue, SekGetPC(-1)); - } - } - -} - -// Reads from / writes to the transfer area - -UINT8 __fastcall neogeoReadByteTransfer(UINT32 sekAddress) -{ -// if ((sekAddress & 0x0FFFFF) < 16) -// printf(PRINT_NORMAL, _T(" - NGCD port 0x%06X read (byte, PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - - sekAddress ^= 1; - - switch (nActiveTransferArea) { - case 0: // Sprites - return NeoSpriteRAM[nSpriteTransferBank + (sekAddress & 0x0FFFFF)]; - break; - case 1: // ADPCM - return YM2610ADPCMAROM[nNeoActiveSlot][nADPCMTransferBank + ((sekAddress & 0x0FFFFF) >> 1)]; - break; - case 4: // Z80 - if ((sekAddress & 0xfffff) >= 0x20000) break; - return NeoZ80ROMActive[(sekAddress & 0x1FFFF) >> 1]; - break; - case 5: // Text - return NeoTextRAM[(sekAddress & 0x3FFFF) >> 1]; - break; - } - - return ~0; -} - -UINT16 __fastcall neogeoReadWordTransfer(UINT32 sekAddress) -{ -// if ((sekAddress & 0x0FFFFF) < 16) -// bprintf(PRINT_NORMAL, _T(" - Transfer: 0x%06X read (word, PC: 0x%06X)\n"), sekAddress, SekGetPC(-1)); - - switch (nActiveTransferArea) { - case 0: // Sprites - return *((UINT16*)(NeoSpriteRAM + nSpriteTransferBank + (sekAddress & 0xFFFFF))); - break; - case 1: // ADPCM - return 0xFF00 | YM2610ADPCMAROM[nNeoActiveSlot][nADPCMTransferBank + ((sekAddress & 0x0FFFFF) >> 1)]; - break; - case 4: // Z80 - if ((sekAddress & 0xfffff) >= 0x20000) break; - return 0xFF00 | NeoZ80ROMActive[(sekAddress & 0x1FFFF) >> 1]; - break; - case 5: // Text - return 0xFF00 | NeoTextRAM[(sekAddress & 0x3FFFF) >> 1]; - break; - } - - return ~0; -} - -void __fastcall neogeoWriteByteTransfer(UINT32 sekAddress, UINT8 byteValue) -{ -// if ((sekAddress & 0x0FFFFF) < 16) -// bprintf(PRINT_NORMAL, _T(" - Transfer: 0x%06X -> 0x%02X (PC: 0x%06X)\n"), sekAddress, byteValue, SekGetPC(-1)); - - if (!nTransferWriteEnable) { -// return; - } - - sekAddress ^= 1; - - switch (nActiveTransferArea) { - case 0: // Sprites - NeoSpriteRAM[nSpriteTransferBank + (sekAddress & 0x0FFFFF)] = byteValue; - NeoCDOBJBankUpdate[nSpriteTransferBank >> 20] = true; - break; - case 1: // ADPCM - YM2610ADPCMAROM[nNeoActiveSlot][nADPCMTransferBank + ((sekAddress & 0x0FFFFF) >> 1)] = byteValue; - break; - case 4: // Z80 - if ((sekAddress & 0xfffff) >= 0x20000) break; - NeoZ80ROMActive[(sekAddress & 0x1FFFF) >> 1] = byteValue; - break; - case 5: // Text - NeoTextRAM[(sekAddress & 0x3FFFF) >> 1] = byteValue; -// NeoUpdateTextOne((sekAddress & 0x3FFFF) >> 1, byteValue); - break; - } -} - -void __fastcall neogeoWriteWordTransfer(UINT32 sekAddress, UINT16 wordValue) -{ -// if ((sekAddress & 0x0FFFFF) < 16) -// bprintf(PRINT_NORMAL, _T(" - Transfer: 0x%06X -> 0x%04X (PC: 0x%06X)\n"), sekAddress, wordValue, SekGetPC(-1)); - - if (!nTransferWriteEnable) { -// return; - } - - switch (nActiveTransferArea) { - case 0: // Sprites - *((UINT16*)(NeoSpriteRAM + nSpriteTransferBank + (sekAddress & 0xFFFFF))) = wordValue; - NeoCDOBJBankUpdate[nSpriteTransferBank >> 20] = true; - break; - case 1: // ADPCM - YM2610ADPCMAROM[nNeoActiveSlot][nADPCMTransferBank + ((sekAddress & 0x0FFFFF) >> 1)] = wordValue; - break; - case 4: // Z80 - // The games that write here, seem to write crap, however the BIOS writes the Z80 code here, and not in the byte area - // So basically, we are allowing writes to here, until the BIOS has finished writing the program, then not allowing any further writes - if (((sekAddress & 0xfffff) >= 0x20000) || nNeoCDZ80ProgWriteWordCancelHack) break; - if (sekAddress == 0xe1fdf2) nNeoCDZ80ProgWriteWordCancelHack = 1; - NeoZ80ROMActive[(sekAddress & 0x1FFFF) >> 1] = wordValue; - break; - case 5: // Text - NeoTextRAM[(sekAddress & 0x3FFFF) >> 1] = wordValue; -// NeoUpdateTextOne((sekAddress & 0x3FFFF) >> 1, wordValue); - break; - } -} - -// 68K memory - -void __fastcall neogeoWriteWord68KProgram(UINT32 sekAddress, UINT16 wordValue) -{ -// if (sekAddress < 16) -// bprintf(PRINT_NORMAL, _T(" - 68K: 0x%06X -> 0x%04X (PC: 0x%06X)\n"), sekAddress, wordValue, SekGetPC(-1)); - - *((UINT16*)(Neo68KROMActive + sekAddress)) = BURN_ENDIAN_SWAP_INT16(wordValue); - if (sekAddress >= 0x0100) { - *((UINT16*)(NeoVectorActive + sekAddress)) = BURN_ENDIAN_SWAP_INT16(wordValue); - } -} - -void __fastcall neogeoWriteByte68KProgram(UINT32 sekAddress, UINT8 byteValue) -{ -// if (sekAddress < 16) -// bprintf(PRINT_NORMAL, _T(" - 68K: 0x%06X -> 0x%02X (PC: 0x%06X)\n"), sekAddress, byteValue, SekGetPC(-1)); - - Neo68KROMActive[sekAddress ^ 1] = byteValue; - if (sekAddress >= 0x0100) { - NeoVectorActive[sekAddress ^ 1] = byteValue; - } -} - -// ---------------------------------------------------------------------------- - -// for NeoGeo CD (WAV playback) -void wav_exit(); - -static INT32 neogeoReset() -{ - if (nNeoSystemType & NEO_SYS_CART) { - NeoLoad68KBIOS(NeoSystem & 0x1f); - - if (nBIOS == -1 || nBIOS == 29) { - // Write system type & region code into BIOS ROM - *((UINT16*)(Neo68KBIOS + 0x000400)) = BURN_ENDIAN_SWAP_INT16(((NeoSystem & 4) << 13) | (NeoSystem & 0x03)); - } - -#if 1 && defined FBA_DEBUG - if (((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) != HARDWARE_SNK_DEDICATED_PCB) && (BurnDrvGetHardwareCode() & HARDWARE_SNK_CONTROLMASK) != HARDWARE_SNK_TRACKBALL) { - switch (NeoSystem & 0x1f) { - case 0x00: { bprintf(PRINT_IMPORTANT, _T("Emulating using MVS Asia/Europe ver. 6 (1 slot) BIOS\n")); break; } - case 0x01: { bprintf(PRINT_IMPORTANT, _T("Emulating using MVS Asia/Europe ver. 5 (1 slot) BIOS\n")); break; } - case 0x02: { bprintf(PRINT_IMPORTANT, _T("Emulating using MVS Asia/Europe ver. 3 (4 slot) BIOS\n")); break; } - case 0x03: { bprintf(PRINT_IMPORTANT, _T("Emulating using MVS USA ver. 5 (2 slot) BIOS\n")); break; } - case 0x04: { bprintf(PRINT_IMPORTANT, _T("Emulating using MVS USA ver. 5 (4 slot) BIOS\n")); break; } - case 0x05: { bprintf(PRINT_IMPORTANT, _T("Emulating using MVS USA ver. 5 (6 slot) BIOS\n")); break; } - case 0x06: { bprintf(PRINT_IMPORTANT, _T("Emulating using MVS Japan ver. 6 (? slot) BIOS\n")); break; } - case 0x07: { bprintf(PRINT_IMPORTANT, _T("Emulating using MVS Japan ver. 5 (? slot) BIOS\n")); break; } - case 0x08: { bprintf(PRINT_IMPORTANT, _T("Emulating using MVS Japan ver. 3 (4 slot) BIOS\n")); break; } - case 0x09: { bprintf(PRINT_IMPORTANT, _T("Emulating using NEO-MVH MV1C BIOS\n")); break; } - case 0x0a: { bprintf(PRINT_IMPORTANT, _T("MVS Japan (J3)\n")); break; } - case 0x0b: { bprintf(PRINT_IMPORTANT, _T("Emulating using AES Japan BIOS\n")); break; } - case 0x0c: { bprintf(PRINT_IMPORTANT, _T("Emulating using AES Asia BIOS\n")); break; } - case 0x0d: { bprintf(PRINT_IMPORTANT, _T("Emulating using Development Kit BIOS\n")); break; } - case 0x0e: { bprintf(PRINT_IMPORTANT, _T("Emulating using Deck ver. 6 (Git Ver 1.3) BIOS\n")); break; } - case 0x0f: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 3.2 BIOS\n")); break; } - case 0x10: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 3.1 BIOS\n")); break; } - case 0x11: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 3.0 BIOS\n")); break; } - case 0x12: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 2.3 BIOS\n")); break; } - case 0x13: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 2.3 (alt) BIOS\n")); break; } - case 0x14: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 2.2 BIOS\n")); break; } - case 0x15: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 2.1 BIOS\n")); break; } - case 0x16: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 2.0 BIOS\n")); break; } - case 0x17: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 1.3 BIOS\n")); break; } - case 0x18: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 1.2 BIOS\n")); break; } - case 0x19: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 1.2 (alt) BIOS\n")); break; } - case 0x1a: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 1.1 BIOS\n")); break; } - case 0x1b: { bprintf(PRINT_IMPORTANT, _T("Emulating using Universe BIOS ver. 1.0 BIOS\n")); break; } - case 0x1c: { bprintf(PRINT_IMPORTANT, _T("Emulating using NeoOpen BIOS v0.1 beta BIOS\n")); break; } - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SNK_CONTROLMASK) == HARDWARE_SNK_TRACKBALL) { - bprintf(PRINT_IMPORTANT, _T("Emulating using custom Trackball BIOS\n")); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_DEDICATED_PCB) { - bprintf(PRINT_IMPORTANT, _T("Emulating using custom PCB BIOS\n")); - } -#endif - - OldDebugDip[0] = NeoDebugDip[0] = 0; - OldDebugDip[1] = NeoDebugDip[1] = 0; - } - -#if 1 && defined FBA_DEBUG - if (nNeoSystemType & NEO_SYS_CD) { - bprintf(PRINT_IMPORTANT, _T(" - Emulating Neo CD system.\n")); - - // exit WAV object if needed - wav_exit(); - - nNeoCDZ80ProgWriteWordCancelHack = 0; - } -#endif - - NeoSetSystemType(); - - bSRAMWritable = false; - - bNeoEnableGraphics = true; - - bBIOSTextROMEnabled = false; - bZ80BoardROMBankedIn = false; - b68KBoardROMBankedIn = true; - - nNeoPaletteBank = -1; - - nSpriteFrameSpeed = 4; - nSpriteFrameTimer = 0; - nNeoSpriteFrame = 0; - - nIRQAcknowledge = ~0; - bIRQEnabled = false; - - nSoundLatch = 0x00; - nSoundReply = 0x00; - nSoundStatus = 1; - -#if 1 && defined USE_SPEEDHACKS - nSoundPrevReply = -1; -#endif - - nIRQOffset = 0; - nIRQControl = 0; - - nInputSelect = 0; - NeoInputBank = NeoInput; - - nCyclesExtra[0] = nCyclesExtra[1] = 0; - - { - SekOpen(0); - ZetOpen(0); - - if (nNeoSystemType & NEO_SYS_MVS) { - for (INT32 a = 0xD00000; a < 0xE00000; a += 0x010000) { - SekMapMemory(NeoNVRAM, a, a + 0xFFFF, MAP_RAM); // 68K RAM - } - SekMapHandler(1, 0xD00000, 0xDFFFFF, MAP_WRITE); // - } else { - SekMapHandler(0, 0xD00000, 0xDFFFFF, MAP_RAM); // AES/NeoCD don't have the SRAM - } - - if (nNeoSystemType & NEO_SYS_CART) { - NeoMapActiveCartridge(); - } - - if (nNeoSystemType & NEO_SYS_PCB) { - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_KOF2K3) { - SekMapMemory(Neo68KBIOS, 0xC00000, 0xC7FFFF, MAP_ROM); - SekMapMemory(Neo68KBIOS, 0xC80000, 0xCFFFFF, MAP_ROM); - } else { - for (INT32 a = 0xC00000; a < 0xD00000; a += 0x020000) { - SekMapMemory(Neo68KBIOS + (NeoSystem & 0x03) * 0x020000, a, a + 0x01FFFF, MAP_ROM); - } - } - } - - // Set by a switch on the PCB - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "svcpcb") || !strcmp(BurnDrvGetTextA(DRV_NAME), "svcpcba") || !strcmp(BurnDrvGetTextA(DRV_NAME), "svcpcbnd") || !strcmp(BurnDrvGetTextA(DRV_NAME), "ms5pcb") || !strcmp(BurnDrvGetTextA(DRV_NAME), "ms5pcbnd")) { - SekMapMemory(Neo68KBIOS + 0x20000 * (~NeoSystem & 1), 0xc00000, 0xc1ffff, MAP_ROM); - } - - MapVectorTable(true); - - if (nNeoSystemType & NEO_SYS_CD) { - nActiveTransferArea = -1; - nSpriteTransferBank = -1; - nADPCMTransferBank = -1; - - NeoCDCommsReset(); - - nTransferWriteEnable = 0; - - NeoSetTextSlot(0); - NeoSetSpriteSlot(0); - - memset(NeoCDOBJBankUpdate, 0, sizeof(NeoCDOBJBankUpdate)); - - LC8951Reset(); - } - - ZetSetBUSREQLine(0); - - SekReset(); - ZetReset(); - - MapPalette(0); - - ZetClose(); - SekClose(); - } - - ZetOpen(0); - BurnYM2610Reset(); - ZetClose(); - -#if defined EMULATE_WATCHDOG - nNeoWatchdog = 0; -#endif - - nIRQCycles = NO_IRQ_PENDING; - - nNeoCDIRQVector = 0; - nNeoCDIRQVectorAck = 0; - nff0002 = 0; - - return 0; -} - -#ifdef BUILD_A68K -static void SwitchToMusashi() -{ - if (bBurnUseASMCPUEmulation) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching to Musashi 68000 core\n")); -#endif - bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation; - bBurnUseASMCPUEmulation = false; - } -} -#endif - -static INT32 NeoInitCommon() -{ - BurnSetRefreshRate(NEO_VREFRESH); - INT32 nNeoScreenHeight; // not used - BurnDrvGetFullSize(&nNeoScreenWidth, &nNeoScreenHeight); - - if (nNeoSystemType & NEO_SYS_CART) { - nVBLankIRQ = 1; - nScanlineIRQ = 2; - } else { - nVBLankIRQ = 2; - nScanlineIRQ = 1; - } - - // Allocate all memory is needed for RAM - { - INT32 nLen; - - RAMIndex(); // Get amount of memory needed - nLen = RAMEnd - (UINT8*)0; - if ((AllRAM = (UINT8*)BurnMalloc(nLen)) == NULL) { // Allocate memory - return 1; - } - memset(AllRAM, 0, nLen); // Initialise memory - RAMIndex(); // Index the allocated memory - } - -#ifdef BUILD_A68K - if (nNeoSystemType & NEO_SYS_CD) { - SwitchToMusashi(); - } -#endif - - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - ZetInit(0); - ZetOpen(0); - - { - if (nNeoSystemType & NEO_SYS_CD) { - SekSetIrqCallback(NeoCDIRQCallback); - } - - SekSetCyclesScanline((INT32)(12000000.0 / NEO_HREFRESH)); - - // Map 68000 memory: - - if (nNeoSystemType & NEO_SYS_CART) { - - for (INT32 a = 0x100000; a < 0x200000; a += 0x010000) { - SekMapMemory(Neo68KRAM, a, a + 0xFFFF, MAP_RAM); // 68K RAM - } - - if (!(nNeoSystemType & NEO_SYS_PCB)) { -// for (INT32 a = 0xC00000; a < 0xD00000; a += 0x020000) { -// SekMapMemory(Neo68KBIOS, a, a + 0x01FFFF, MAP_ROM); // MVS/AES BIOS ROM -// } - SekMapMemory(Neo68KBIOS, 0xC00000, 0xC7FFFF, MAP_ROM); // BIOS ROM - } - - } else { - SekMapMemory(Neo68KFix[0], 0x000000, 0x1FFFFF, MAP_RAM); // Main 68K RAM - SekMapMemory(Neo68KBIOS, 0xC00000, 0xC7FFFF, MAP_ROM); // NeoCD BIOS ROM - SekMapMemory(Neo68KBIOS, 0xC80000, 0xCFFFFF, MAP_ROM); // - } - - SekSetReadWordHandler(0, neogeoReadWord); - SekSetReadByteHandler(0, neogeoReadByte); - SekSetWriteWordHandler(0, neogeoWriteWord); - SekSetWriteByteHandler(0, neogeoWriteByte); - - SekSetWriteWordHandler(1, neogeoWriteWordSRAM); - SekSetWriteByteHandler(1, neogeoWriteByteSRAM); - - if (!(nNeoSystemType & NEO_SYS_PCB)) { - SekMapHandler(2, 0x800000, 0xBFFFFF, MAP_ROM); // Memory card - SekMapHandler(2, 0x800000, 0xBFFFFF, MAP_WRITE); // - - SekSetReadByteHandler(2, neogeoReadByteMemoryCard); - SekSetWriteByteHandler(2, neogeoWriteByteMemoryCard); - } - - SekMapHandler(3, 0x400000, 0x7FFFFF, MAP_WRITE); // Palette - - SekSetWriteWordHandler(3, NeoPalWriteWord); - SekSetWriteByteHandler(3, NeoPalWriteByte); - - // Set up mirrors - for (INT32 a = 0x420000; a < 0x800000; a += 0x2000) { - SekMapMemory(NeoPalSrc[0], a, a + 0x1FFF, MAP_ROM); - } - - SekMapHandler(5, 0x3C0000, 0x3DFFFF, MAP_RAM); // Read Video Controller - SekSetReadWordHandler(5, neogeoReadWordVideo); - SekSetReadByteHandler(5, neogeoReadByteVideo); - SekSetWriteWordHandler(5, neogeoWriteWordVideo); - SekSetWriteByteHandler(5, neogeoWriteByteVideo); - - if (nNeoSystemType & NEO_SYS_CD) { - SekMapHandler(4, 0x000000, 0x0003FF, MAP_WRITE); - - SekSetWriteWordHandler(4, neogeoWriteWord68KProgram); - SekSetWriteByteHandler(4, neogeoWriteByte68KProgram); - - SekMapHandler(6, 0xE00000, 0xEFFFFF, MAP_RAM); - - SekSetReadWordHandler(6, neogeoReadWordTransfer); - SekSetReadByteHandler(6, neogeoReadByteTransfer); - SekSetWriteWordHandler(6, neogeoWriteWordTransfer); - SekSetWriteByteHandler(6, neogeoWriteByteTransfer); - - SekMapHandler(7, 0xF00000, 0xFFFFFF, MAP_RAM); - - SekSetReadWordHandler(7, neogeoReadWordCDROM); - SekSetReadByteHandler(7, neogeoReadByteCDROM); - SekSetWriteWordHandler(7, neogeoWriteWordCDROM); - SekSetWriteByteHandler(7, neogeoWriteByteCDROM); - - SekSetReadByteHandler(2, neoCDReadByteMemoryCard); - SekSetWriteByteHandler(2, neoCDWriteByteMemoryCard); - - } - } - - { - // Z80 setup - - if (nNeoSystemType & NEO_SYS_CART) { - // Work RAM - ZetMapArea(0xF800, 0xFFFF, 0, NeoZ80RAM); - ZetMapArea(0xF800, 0xFFFF, 1, NeoZ80RAM); - ZetMapArea(0xF800, 0xFFFF, 2, NeoZ80RAM); - - - ZetSetInHandler(neogeoZ80In); - ZetSetOutHandler(neogeoZ80Out); - } - - if (nNeoSystemType & NEO_SYS_CD) { - // Main Z80 RAM - ZetMapArea(0x0000, 0xFFFF, 0, NeoZ80ROMActive); - ZetMapArea(0x0000, 0xFFFF, 1, NeoZ80ROMActive); - ZetMapArea(0x0000, 0xFFFF, 2, NeoZ80ROMActive); - - - ZetSetInHandler(neogeoZ80InCD); - ZetSetOutHandler(neogeoZ80Out); - } - } - - ZetClose(); - SekClose(); - -#if defined USE_SPEEDHACKS - bRenderLineByLine = false; -#else - bRenderLineByLine = false; -#endif - -#if defined RASTER_KLUDGE - nScanlineOffset = 0xF8; // correct as verified on MVS hardware -#endif - - // These games rely on reading the line counter for synchronising raster effects - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "mosyougi")) { - bRenderLineByLine = true; - -#if defined RASTER_KLUDGE - nScanlineOffset = 0xFB; -#endif - - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "neodrift")) { - bRenderLineByLine = true; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "zedblade")) { - bRenderLineByLine = true; - } -// if (!strcmp(BurnDrvGetTextA(DRV_NAME), "ssideki2")) { -// bRenderLineByLine = true; -// } - - nNeoControlConfig = BurnDrvGetHardwareCode() & HARDWARE_SNK_CONTROLMASK; - - // Hook up standard joysticks to all ports - for (INT32 i = 0; i < 8; i++) { - nJoyport0[i] = 0; - nJoyport1[i] = 1; - } - - if (nNeoSystemType & NEO_SYS_CD) { - nJoyport0[4] = 16; - nJoyport1[4] = 17; - } else { - // Override for special controllers - switch (nNeoControlConfig) { - case HARDWARE_SNK_PADDLE: // Two Paddles + joysticks - nJoyport0[0] = 6; - nJoyport1[0] = 7; - break; - case HARDWARE_SNK_TRACKBALL: // Trackball controller - nJoyport0[0] = 6; - nJoyport0[1] = 7; - break; - case HARDWARE_SNK_MAHJONG: // Mahjong controller - nJoyport0[1] = 16; - nJoyport0[2] = 17; - nJoyport0[4] = 18; - break; - } - } - -#if defined Z80_SPEED_ADJUST - nZ80Clockspeed = 4000000; -#endif - - if (nNeoSystemType & NEO_SYS_CART) { - BurnYM2610Init(8000000, YM2610ADPCMAROM[0], &nYM2610ADPCMASize[0], YM2610ADPCMBROM[0], &nYM2610ADPCMBSize[0], &neogeoFMIRQHandler, neogeoSynchroniseStream, neogeoGetTime, 0); - } else { - BurnYM2610Init(8000000, YM2610ADPCMBROM[0], &nYM2610ADPCMBSize[0], YM2610ADPCMBROM[0], &nYM2610ADPCMBSize[0], &neogeoFMIRQHandler, neogeoSynchroniseStream, neogeoGetTime, 0); - } - - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - - BurnTimerAttachZet(nZ80Clockspeed); - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_MVS) { - for (nNeoActiveSlot = 0; nNeoActiveSlot < MAX_SLOT; nNeoActiveSlot++) { - if (nBurnDrvSelect[nNeoActiveSlot] < nBurnDrvCount) { -// NeoInitText(nNeoActiveSlot); -// NeoInitSprites(nNeoActiveSlot); - } - } - - NeoInitText(-1); - - } else { - NeoInitText(0); - NeoInitText(-1); - NeoInitSprites(0); - } - - if (nNeoSystemType & NEO_SYS_CART) { - ZetOpen(0); - nZ80Bank0 = nZ80Bank1 = nZ80Bank2 = nZ80Bank3 = -1; - NeoZ80SetBank0(0x02); - NeoZ80SetBank1(0x06); - NeoZ80SetBank2(0x0E); - NeoZ80SetBank3(0x1E); - - NeoZ80MapROM(false); - ZetClose(); - } - - NeoInitPalette(); - - uPD4990AInit(12000000); - nPrevBurnCPUSpeedAdjust = -1; - - if (nNeoSystemType & NEO_SYS_CD) { - bMemoryCardInserted = true; - bMemoryCardWritable = true; - } else { - bMemoryCardInserted = false; - bMemoryCardWritable = false; - } - - nNeoActiveSlot = 0; - neogeoReset(); // Reset machine - - return 0; -} - -static bool recursing = false; - -INT32 NeoInit() -{ - if (recursing) { - if (LoadRoms()) { - return 1; - } - return 0; - } - - recursing = true; - - nNeoSystemType = NEO_SYS_CART; - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_DEDICATED_PCB) { - nNeoSystemType |= NEO_SYS_MVS | NEO_SYS_PCB; - } - - nNeoActiveSlot = 0; - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_MVS) { - UINT32 nDriver = nBurnDrvActive; - -// memset(NeoCallback, 0, sizeof(NeoCallback)); - - for (nNeoActiveSlot = 0; nNeoActiveSlot < MAX_SLOT; nNeoActiveSlot++) { - - if (nBurnDrvSelect[nNeoActiveSlot] < nBurnDrvCount) { - - nBurnDrvActive = nBurnDrvSelect[nNeoActiveSlot]; - NeoCallbackActive = &NeoCallback[nNeoActiveSlot]; - - if (BurnDrvCartridgeSetup(CART_INIT_START)) { - return 1; - } - - NeoInitText(nNeoActiveSlot); - NeoInitSprites(nNeoActiveSlot); - } - } - - for (nNeoNumSlots = 5; nNeoNumSlots > 0 && nBurnDrvSelect[nNeoNumSlots] >= nBurnDrvCount; nNeoNumSlots--) { } - - switch (nNeoNumSlots) { - case 0: - nNeoNumSlots = 1; - break; - case 1: - nNeoNumSlots = 2; - break; - case 2: - case 3: - nNeoNumSlots = 4; - break; - case 4: - case 5: - nNeoNumSlots = 6; - break; - } - - nBurnDrvActive = nDriver; - - if (BurnDrvCartridgeSetup(CART_INIT_END)) { - return 1; - } - - } else { - if (LoadRoms()) { - return 1; - } - } - - recursing = false; - - for (nNeoActiveSlot = 0; nNeoActiveSlot < nNeoNumSlots; nNeoActiveSlot++) { - NeoVector[nNeoActiveSlot] = (UINT8*)BurnMalloc(0x0400); - if (NeoVector[nNeoActiveSlot] == NULL) { - return 1; - } - memset(NeoVector[nNeoActiveSlot], 0, 0x0400); - } - - // Allocate all memory needed for ROM - { - INT32 nLen; - - ROMIndex(); // Get amount of memory needed - nLen = ROMEnd - (UINT8*)0; - if ((AllROM = (UINT8*)BurnMalloc(nLen)) == NULL) { // Allocate memory - return 1; - } - memset(AllROM, 0, nLen); // Initialise memory - ROMIndex(); // Index the allocated memory - } - - if (nNeoSystemType & NEO_SYS_PCB) { - BurnLoadRom(Neo68KBIOS, 0x00080 + 30, 1); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_MVS) { - BurnLoadRom(NeoZ80BIOS, 0x00000 + 31, 1); - BurnLoadRom(NeoTextROMBIOS, 0x00000 + 32, 1); - BurnLoadRom(NeoZoomROM, 0x00000 + 33, 1); - } else { - - // Still load the Z80 BIOS & text layer data for AES systems, since it might be switched to MVS later - - if (nNeoSystemType & NEO_SYS_PCB) { - bZ80BIOS = false; - BurnLoadRom(NeoTextROMBIOS, 0x00080 + 32, 1); - BurnLoadRom(NeoZoomROM, 0x00080 + 33, 1); - } else { - BurnLoadRom(NeoZ80BIOS, 0x00080 + 31, 1); - BurnLoadRom(NeoTextROMBIOS, 0x00080 + 32, 1); - BurnLoadRom(NeoZoomROM, 0x00080 + 33, 1); - } - } - BurnUpdateProgress(0.0, _T("Preprocessing text layer graphics...")/*, BST_PROCESS_TXT*/, 0); - NeoDecodeTextBIOS(0, 0x020000, NeoTextROMBIOS); - - nBIOS = 9999; - if (NeoLoad68KBIOS(NeoSystem & 0x1f)) { - return 1; - } - - return NeoInitCommon(); -} - -INT32 NeoCDInit() -{ - recursing = false; - - nNeoSystemType = NEO_SYS_CD; - - nCodeSize[0] = 0x200000; - nSpriteSize[0] = 0x400000; - nNeoTextROMSize[0] = 0x020000; - nYM2610ADPCMASize[0] = 0; - nYM2610ADPCMBSize[0] = 0x100000; - - // Allocate all memory is needed for ROM - { - INT32 nLen; - - ROMIndex(); // Get amount of memory needed - nLen = ROMEnd - (UINT8*)0; - if ((AllROM = (UINT8*)BurnMalloc(nLen)) == NULL) { // Allocate memory - return 1; - } - memset(AllROM, 0, nLen); // Initialise memory - ROMIndex(); // Index the allocated memory - } - - Neo68KROMActive = Neo68KROM[0]; - NeoVectorActive = NeoVector[0]; - NeoZ80ROMActive = NeoZ80ROM[0]; - - Neo68KFix[0] = Neo68KROM[0]; - - BurnLoadRom(Neo68KBIOS, 0, 1); - BurnLoadRom(NeoZoomROM, 1, 1); - - // Create copy of 68K with BIOS vector table - memcpy(NeoVectorActive + 0x00, Neo68KBIOS, 0x0100); - - // Create a default program for the Z80 - NeoZ80ROMActive[0] = 0xC3; // JP 0 - NeoZ80ROMActive[1] = 0x00; // - NeoZ80ROMActive[2] = 0x00; // - - bZ80BIOS = false; - - for (nNeoTileMask[0] = 1; nNeoTileMask[0] < nSpriteSize[0]; nNeoTileMask[0] <<= 1) { } - nNeoTileMask[0] = (nNeoTileMask[0] >> 7) - 1; - nNeoMaxTile[0] = nSpriteSize[0] >> 7; - - return NeoInitCommon(); -} - -INT32 NeoExit() -{ - if (recursing) { - return 0; - } - - recursing = true; - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_MVS) { - UINT32 nDriver = nBurnDrvActive; - - for (nNeoActiveSlot = 0; nNeoActiveSlot < MAX_SLOT; nNeoActiveSlot++) { - - if (nBurnDrvSelect[nNeoActiveSlot] < nBurnDrvCount) { - - nBurnDrvActive = nBurnDrvSelect[nNeoActiveSlot]; - - if (BurnDrvCartridgeSetup(CART_EXIT)) { - return 1; - } - } - } - - nBurnDrvActive = nDriver; - } - - uPD4990AExit(); - - NeoExitPalette(); - - BurnYM2610Exit(); - - ZetExit(); // Deallocate Z80 - SekExit(); // Deallocate 68000 - - if (nNeoSystemType & NEO_SYS_CART) { - - // Deallocate all used memory - - for (nNeoActiveSlot = 0; nNeoActiveSlot < MAX_SLOT; nNeoActiveSlot++) { - - NeoExitSprites(nNeoActiveSlot); - NeoExitText(nNeoActiveSlot); - - BurnFree(NeoTextROM[nNeoActiveSlot]); // Text ROM - nNeoTextROMSize[nNeoActiveSlot] = 0; - - BurnFree(NeoSpriteROM[nNeoActiveSlot]); // Sprite ROM - BurnFree(Neo68KROM[nNeoActiveSlot]); // 68K ROM - BurnFree(NeoVector[nNeoActiveSlot]); // 68K vectors - BurnFree(NeoZ80ROM[nNeoActiveSlot]); // Z80 ROM - BurnFree(YM2610ADPCMAROM[nNeoActiveSlot]); - BurnFree(YM2610ADPCMBROM[nNeoActiveSlot]); - } - } - - if (nNeoSystemType & NEO_SYS_CD) { - NeoExitSprites(0); - NeoExitText(0); - } - - BurnFree(AllROM); // Misc ROM - BurnFree(AllRAM); // Misc RAM - - memset(NeoCallback, 0, sizeof(NeoCallback)); - NeoCallbackActive = &NeoCallback[0]; - - nNeoTextROMSize[0] = 0; - - nBIOS = 9999; - - nNeoActiveSlot = 0; - NeoVectorActive = NULL; - Neo68KROMActive = NULL; - NeoZ80ROMActive = NULL; - - nCodeSize[0] = 0; - - nNeoCDZ80ProgWriteWordCancelHack = 0; - -#ifdef BUILD_A68K - // Switch back CPU core if needed - if (nNeoSystemType & NEO_SYS_CD) { - if (bUseAsm68KCoreOldValue) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching back to A68K core\n")); -#endif - bUseAsm68KCoreOldValue = false; - bBurnUseASMCPUEmulation = true; - } - } -#endif - - recursing = false; - - bDisableNeoWatchdog = false; - - // release the NeoGeo CD information object if needed - NeoCDInfo_Exit(); - - return 0; -} - -INT32 NeoRender() -{ - NeoUpdatePalette(); // Update the palette - NeoClearScreen(); - - if (bNeoEnableGraphics) { - nSliceStart = 0x10; nSliceEnd = 0xF0; - nSliceSize = nSliceEnd - nSliceStart; - -#if 0 || defined LOG_DRAW - bprintf(PRINT_NORMAL, _T(" -- Drawing slice: %3i - %3i.\n"), nSliceStart, nSliceEnd); -#endif - - NeoRenderSprites(); // Render sprites - NeoRenderText(); // Render text layer - } - - return 0; -} - -inline static void NeoClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0C) == 0x0C) { - *nJoystickInputs &= ~0x0C; - } -} - -static void NeoStandardInputs(INT32 nBank) -{ - if (nBank) { - NeoInput[ 8] = 0x00; // Player 1 - NeoInput[ 9] = 0x00; // Player 2 - NeoInput[10] = 0x00; // Buttons - NeoInput[11] = 0x00; // - for (INT32 i = 0; i < 8; i++) { - NeoInput[ 8] |= (NeoJoy3[i] & 1) << i; - NeoInput[ 9] |= (NeoJoy4[i] & 1) << i; - NeoInput[10] |= (NeoButton3[i] & 1) << i; - NeoInput[11] |= (NeoButton4[i] & 1) << i; - } - NeoClearOpposites(&NeoInput[ 8]); - NeoClearOpposites(&NeoInput[ 9]); - - if (NeoDiag[1]) { - NeoInput[13] |= 0x80; - } - } else { - NeoInput[ 0] = 0x00; // Player 1 - NeoInput[ 1] = 0x00; // Player 2 - NeoInput[ 2] = 0x00; // Buttons - NeoInput[ 3] = 0x00; // - for (INT32 i = 0; i < 8; i++) { - NeoInput[ 0] |= (NeoJoy1[i] & 1) << i; - NeoInput[ 1] |= (NeoJoy2[i] & 1) << i; - NeoInput[ 2] |= (NeoButton1[i] & 1) << i; - NeoInput[ 3] |= (NeoButton2[i] & 1) << i; - } - NeoClearOpposites(&NeoInput[ 0]); - NeoClearOpposites(&NeoInput[ 1]); - - if (NeoDiag[0]) { - NeoInput[ 5] |= 0x80; - } - } -} - -#if 1 -#define NeoSekRun SekRun -#else -static INT32 NeoSekRun(const INT32 nCycles) -{ - INT32 nCyclesExecutedTotal = 0, nOldCyclesSegment = nCyclesSegment; - - if (!(nNeoSystemType & NEO_SYS_CD) || !(nff0002 & 0x0050)) - return SekRun(nCycles); - -//bprintf(PRINT_NORMAL, _T("***\n")); - - while (nCyclesExecutedTotal < nCycles) { - - INT32 nCyclesExecuted; - - if (nNeoCDCyclesIRQ <= 0) { - nNeoCDCyclesIRQ += nNeoCDCyclesIRQPeriod; - - // Trigger CD mechanism communication interrupt -//bprintf(PRINT_NORMAL, _T(" DECI status %i\n"), (LC8951RegistersR[1] & 0x20) >> 5); - - nIRQAcknowledge &= ~0x10; - NeoCDIRQUpdate(0); - - if ((nff0002 & 0x0500) && (LC8951RegistersR[1] & 0x20)) - NeoCDReadSector(); - } - - nCyclesSegment = (nNeoCDCyclesIRQ < (nCycles - nCyclesExecutedTotal)) ? nNeoCDCyclesIRQ : (nCycles - nCyclesExecutedTotal); - nCyclesExecuted = SekRun(nCyclesSegment); - -//bprintf(PRINT_NORMAL, _T("%010i %010i %010i %010i\n"), nCycles, nCyclesExecutedTotal, nCyclesExecuted, nNeoCDCyclesIRQ); - - nCyclesExecutedTotal += nCyclesExecuted; - nNeoCDCyclesIRQ -= nCyclesExecuted; - - } - - nCyclesSegment = nOldCyclesSegment; - - return nCyclesExecutedTotal; -} -#endif - -INT32 NeoFrame() -{ - if (NeoReset) { // Reset machine - if (nNeoSystemType & NEO_SYS_CART) { - memset(Neo68KRAM, 0, 0x010000); - } - - neogeoReset(); - } - - NeoInput[ 5] &= 0x1F; // Clear ports - NeoInput[13] = 0x00; // - - switch (nNeoControlConfig) { - case HARDWARE_SNK_PADDLE: { // Two Paddles + joysticks - - NeoStandardInputs(0); - - // Handle analog controls - nAnalogAxis[0] -= NeoAxis[0]; - nAnalogAxis[1] -= NeoAxis[1]; - NeoInput[6] = (nAnalogAxis[0] >> 8) & 0xFF; - NeoInput[7] = (nAnalogAxis[1] >> 8) & 0xFF; - - break; - } - - case HARDWARE_SNK_TRACKBALL: { // Trackball controller - NeoInput[1] = 0x00; // Buttons - NeoInput[2] = 0x00; // - NeoInput[3] = 0x00; // - for (INT32 i = 0; i < 8; i++) { - NeoInput[1] |= (NeoJoy2[i] & 1) << i; - NeoInput[2] |= (NeoButton1[i] & 1) << i; - NeoInput[3] |= (NeoButton2[i] & 1) << i; - } - // Handle analog controls - nAnalogAxis[0] += NeoAxis[0]; - nAnalogAxis[1] += NeoAxis[1]; - NeoInput[6] = (nAnalogAxis[0] >> 8) & 0xFF; - NeoInput[7] = (nAnalogAxis[1] >> 8) & 0xFF; - - if (NeoDiag[0]) { - NeoInput[5] |= 0x80; - } - - break; - } - - case HARDWARE_SNK_4_JOYSTICKS: { // Four joystick controllers - - NeoStandardInputs(0); - NeoStandardInputs(1); - - break; - } - - case HARDWARE_SNK_MAHJONG: { // Mahjong controller - - NeoStandardInputs(0); - - NeoInput[16] = 0x00; - NeoInput[17] = 0x00; - NeoInput[18] = 0x00; - for (INT32 i = 0; i < 7; i++) { - NeoInput[16] |= (NeoButton1[i + 8] & 1) << i; - NeoInput[17] |= (NeoButton1[i + 16] & 1) << i; - NeoInput[18] |= (NeoButton1[i + 24] & 1) << i; - } - - break; - } - - case HARDWARE_SNK_GAMBLING: { // Gambling configuration - - NeoStandardInputs(0); - -/* NeoInput[16] = 0x00; - for (INT32 i = 0; i < 7; i++) { - NeoInput[16] |= (NeoButton1[i + 16] & 1) << i; - }*/ - - break; - } - - default: { // Two joystick controllers - NeoStandardInputs(0); - } - } - - if (nNeoSystemType & NEO_SYS_CART) { - - bMemoryCardWritable = (NeoSystem & 0x80); - - if (bMemoryCardInserted) { - NeoInput[2] |= 0x30; // JEIDA connector pen /CD1, /READY - if (bMemoryCardWritable) { - NeoInput[2] |= 0x40; // JEIDA connector pen /WP - } - } - - if (nNeoSystemType & NEO_SYS_AES) { // Report the type of hardware - NeoInput[2] |= 0x80; - } - - if (nNeoControlConfig != HARDWARE_SNK_GAMBLING) { - if (nNeoSystemType & NEO_SYS_MVS) { // Report the appropriate number of slots on MVS hardware - switch (nNeoNumSlots) { - case 4: - NeoInput[ 5] &= ~0x40; - NeoInput[ 3] |= 0x20; - break; - case 6: - NeoInput[ 5] &= ~0x40; - NeoInput[ 3] &= ~0x20; - break; - default: - - // Default to 1/2 slot hardware - - NeoInput[ 5] |= 0x40; - NeoInput[ 3] |= 0x20; - } - } - } - - if (OldDebugDip[0] != NeoDebugDip[0]) { - SekOpen(0); - SekWriteByte(SekReadLong(0x010E) + 0, NeoDebugDip[0]); - SekClose(); - OldDebugDip[0] = NeoDebugDip[0]; - } - if (OldDebugDip[1] != NeoDebugDip[1]) { - SekOpen(0); - SekWriteByte(SekReadLong(0x010E) + 1, NeoDebugDip[1]); - SekClose(); - OldDebugDip[1] = NeoDebugDip[1]; - } - } else { - NeoInput[2] |= 0x70; - - NeoInput[16] = 0x00; - NeoInput[17] = 0x00; - - if (NeoDiag[0]) { - NeoInput[16] = (UINT8)~0xDA; - } - } - - if (nPrevBurnCPUSpeedAdjust != nBurnCPUSpeedAdjust) { - // 68K CPU clock is 12MHz, modified by nBurnCPUSpeedAdjust - nCyclesTotal[0] = (INT32)((INT64)12000000 * nBurnCPUSpeedAdjust / (256.0 * NEO_VREFRESH)); - -#if defined Z80_SPEED_ADJUST - // Z80 CPU clock always 68K / 3 - nCyclesTotal[1] = nCyclesTotal[0] / 3; - nZ80Clockspeed = (INT32)((INT64)4000000 * nBurnCPUSpeedAdjust / 256); - BurnTimerAttachZet(nZ80Clockspeed); -#else - // Z80 CPU clock is always 4MHz - nCyclesTotal[1] = 4000000.0 / NEO_VREFRESH; -#endif - // 68K cycles executed each scanline - SekOpen(0); - SekSetCyclesScanline((INT32)(12000000.0 * nBurnCPUSpeedAdjust / (256.0 * NEO_HREFRESH))); - SekClose(); - - // uPD499A ticks per second (same as 68K clock) - uPD499ASetTicks((INT64)12000000 * nBurnCPUSpeedAdjust / 256); - - nPrevBurnCPUSpeedAdjust = nBurnCPUSpeedAdjust; - } - -#if defined EMULATE_WATCHDOG - // If the watchdog isn't reset every 8 frames, reset the system - // This can't be 100% accurate, as the 68000 instruction timings are not 100% - if ((nNeoSystemType & NEO_SYS_CART) && nNeoWatchdog > nCyclesTotal[0] * 8) { - if (bDisableNeoWatchdog == false) { -#if 1 && defined FBA_DEBUG - SekOpen(0); - bprintf(PRINT_IMPORTANT, _T(" ** Watchdog triggered system reset (PC: 0x%06X)\n"), SekGetPC(-1)); - SekClose(); -#endif - neogeoReset(); - } - } -#endif -//bprintf(PRINT_NORMAL, _T("***\n")); - - bRenderImage = false; - bForceUpdateOnStatusRead = false; - - if (pBurnDraw) { - NeoUpdatePalette(); // Update the palette - NeoClearScreen(); - } - nSliceEnd = 0x10; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - // Compensate for extra cycles executed - SekIdle(nCyclesExtra[0]); - ZetIdle(nCyclesExtra[1]); - - nuPD4990ATicks = nCyclesExtra[0]; - - // Run 68000 - - - if ((nNeoSystemType & NEO_SYS_CD) && (nff0002 & 0x0050)) { - nIRQAcknowledge &= ~0x10; - NeoCDIRQUpdate(0); - - if (nff0002 & 0x0500) { - NeoCDReadSector(); - } - } - - - nCyclesSegment = nSekCyclesScanline * 24; - while (SekTotalCycles() < nCyclesSegment) { - - if ((nIRQControl & 0x10) && (nIRQCycles < NO_IRQ_PENDING) && (SekTotalCycles() >= nIRQCycles)) { - - nIRQAcknowledge &= ~2; - SekSetIRQLine(nScanlineIRQ, CPU_IRQSTATUS_ACK); - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ triggered (line %3i + %3i cycles).\n"), SekCurrentScanline(), SekTotalCycles() - SekCurrentScanline() * SekCyclesScanline()); -#endif - - if (nIRQControl & 0x80) { - nIRQCycles += NeoConvertIRQPosition(nIRQOffset + 1); - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ Line -> %3i (at line %3i, autoload).\n"), nIRQCycles / SekCyclesScanline(), SekCurrentScanline()); -#endif - - } - } - - if (nCyclesSegment < nIRQCycles || SekTotalCycles() >= nIRQCycles) { - NeoSekRun(nCyclesSegment - SekTotalCycles()); - } else { - NeoSekRun(nIRQCycles - SekTotalCycles()); - } - } - - bRenderImage = pBurnDraw != NULL && bNeoEnableGraphics; - bForceUpdateOnStatusRead = bRenderImage && bRenderLineByLine; - bForcePartialRender = false; - - // Display starts here - - nCyclesVBlank = nSekCyclesScanline * 248; - if (bRenderLineByLine) { - INT32 nLastIRQ = nIRQCycles - 1; - while (SekTotalCycles() < nCyclesVBlank) { - - if ((nIRQControl & 0x10) && (nIRQCycles < NO_IRQ_PENDING) && (nLastIRQ < nIRQCycles) && (SekTotalCycles() >= nIRQCycles)) { - nLastIRQ = nIRQCycles; - nIRQAcknowledge &= ~2; - SekSetIRQLine(nScanlineIRQ, CPU_IRQSTATUS_ACK); -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ triggered (line %3i + %3i cycles).\n"), SekCurrentScanline(), SekTotalCycles() - SekCurrentScanline() * SekCyclesScanline()); -#endif - - if (nIRQControl & 0x80) { - nIRQCycles += NeoConvertIRQPosition(nIRQOffset + 1); -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ Line -> %3i (at line %3i, autoload).\n"), nIRQCycles / SekCyclesScanline(), SekCurrentScanline()); -#endif - - } - - bForcePartialRender = bRenderImage; - if (bForcePartialRender) { - nSliceStart = nSliceEnd; - nSliceEnd = SekCurrentScanline() - 5; - } - } else { - if (bForcePartialRender) { - nSliceStart = nSliceEnd; - nSliceEnd = SekCurrentScanline() - 6; - } - } - - if (bForcePartialRender) { - - if (nSliceEnd > 240) { - nSliceEnd = 240; - } - nSliceSize = nSliceEnd - nSliceStart; - if (nSliceSize > 0) { - -#if 0 || defined LOG_DRAW - bprintf(PRINT_NORMAL, _T(" -- Drawing slice: %3i - %3i.\n"), nSliceStart, nSliceEnd); -#endif - - NeoRenderSprites(); // Render sprites - } - } - - bForcePartialRender = false; - - if (SekTotalCycles() >= nCyclesSegment) { - nCyclesSegment += nSekCyclesScanline; - } - if (nCyclesSegment < nIRQCycles || SekTotalCycles() >= nIRQCycles) { - NeoSekRun(nCyclesSegment - SekTotalCycles()); - } else { - NeoSekRun(nIRQCycles - SekTotalCycles()); - } - } - } else { - nCyclesSegment = nCyclesVBlank; - while (SekTotalCycles() < nCyclesVBlank) { - - if ((nIRQControl & 0x10) && (nIRQCycles < NO_IRQ_PENDING) && (SekTotalCycles() >= nIRQCycles)) { - nIRQAcknowledge &= ~2; - SekSetIRQLine(nScanlineIRQ, CPU_IRQSTATUS_ACK); - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ triggered (line %3i + %3i cycles).\n"), SekCurrentScanline(), SekTotalCycles() - SekCurrentScanline() * SekCyclesScanline()); -#endif - - if (nIRQControl & 0x80) { - nIRQCycles += NeoConvertIRQPosition(nIRQOffset + 1); - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ Line -> %3i (at line %3i, autoload).\n"), nIRQCycles / SekCyclesScanline(), SekCurrentScanline()); -#endif - - } - - bForcePartialRender = bRenderImage; - } - -#if defined RASTERS_OPTIONAL - if (bAllowRasters) { -#endif - if (bForcePartialRender) { - - nSliceStart = nSliceEnd; - nSliceEnd = SekCurrentScanline() - 5; - - if (nSliceEnd > 240) { - nSliceEnd = 240; - } - nSliceSize = nSliceEnd - nSliceStart; - if (nSliceSize > 0) { - -#if 0 || defined LOG_DRAW - bprintf(PRINT_NORMAL, _T(" -- Drawing slice: %3i - %3i.\n"), nSliceStart, nSliceEnd); -#endif - - NeoRenderSprites(); // Render sprites - } - } - -#if defined RASTERS_OPTIONAL - } -#endif - - bForcePartialRender = false; - - if (nCyclesSegment < nIRQCycles || SekTotalCycles() >= nIRQCycles) { - NeoSekRun(nCyclesSegment - SekTotalCycles()); - } else { - NeoSekRun(nIRQCycles - SekTotalCycles()); - } - } - } - - if (bRenderImage) { - if (nSliceEnd < 240) { - nSliceStart = nSliceEnd; - nSliceEnd = 240; - nSliceSize = nSliceEnd - nSliceStart; - -#if 0 || defined LOG_DRAW - bprintf(PRINT_NORMAL, _T(" -- Drawing slice: %3i - %3i.\n"), nSliceStart, nSliceEnd); -#endif - - NeoRenderSprites(); // Render sprites - } - NeoRenderText(); // Render text layer - } - - nIRQAcknowledge &= ~4; - SekSetIRQLine(nVBLankIRQ, CPU_IRQSTATUS_ACK); - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - VBLank.\n")); -#endif - - // set IRQ scanline at line 248 - if (nIRQControl & 0x40) { - if (NeoConvertIRQPosition(nIRQOffset) < NO_IRQ_PENDING) { - nIRQCycles = nCyclesSegment + NeoConvertIRQPosition(nIRQOffset); - } - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ Line -> %3i (at line %3i, VBlank).\n"), nIRQCycles / SekCyclesScanline(), SekCurrentScanline()); -#endif - - } - - nCyclesSegment = nCyclesTotal[0]; - while (SekTotalCycles() < nCyclesSegment) { - - if ((nIRQControl & 0x10) && (nIRQCycles < NO_IRQ_PENDING) && (SekTotalCycles() >= nIRQCycles)) { - nIRQAcknowledge &= ~2; - SekSetIRQLine(nScanlineIRQ, CPU_IRQSTATUS_ACK); - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ triggered (line %3i + %3i cycles).\n"), SekCurrentScanline(), SekTotalCycles() - SekCurrentScanline() * SekCyclesScanline()); -#endif - - if (nIRQControl & 0x80) { - nIRQCycles += NeoConvertIRQPosition(nIRQOffset + 1); - -#if 0 || defined LOG_IRQ - bprintf(PRINT_NORMAL, _T(" - IRQ Line -> %3i (at line %3i, autoload).\n"), nIRQCycles / SekCyclesScanline(), SekCurrentScanline()); -#endif - - } - } - - if (nCyclesSegment < nIRQCycles || SekTotalCycles() >= nIRQCycles) { - NeoSekRun(nCyclesSegment - SekTotalCycles()); - } else { - NeoSekRun(nIRQCycles - SekTotalCycles()); - } - } - - if (nIRQCycles < NO_IRQ_PENDING) { - nIRQCycles -= nCyclesTotal[0]; - if (nIRQCycles < 0) { - nIRQCycles = NO_IRQ_PENDING; - -#if 0 || defined LOG_IRQ - } else { - bprintf(PRINT_NORMAL, _T(" - IRQ Line past screen end (IRQControl: %02X, line -> %3i).\n"), nIRQControl, nIRQCycles / SekCyclesScanline()); -#endif - - } - } -// bprintf(PRINT_NORMAL, " -- IRQControl: %02X, nIRQCycles / SekCyclesScanline(): %3i.\n", nIRQControl, nIRQCycles / SekCyclesScanline()); - - // Update the sound until the end of the frame - - nCycles68KSync = SekTotalCycles(); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - - // Update the uPD4990 until the end of the frame - uPD4990AUpdate(SekTotalCycles() - nuPD4990ATicks); - -#if defined EMULATE_WATCHDOG - // Handle the watchdog - nNeoWatchdog += SekTotalCycles(); -#endif - - // Remember extra cycles executed - nCyclesExtra[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesExtra[1] = ZetTotalCycles() - nCyclesTotal[1]; - -// bprintf(PRINT_NORMAL, _T(" Z80 PC 0x%04X\n"), Doze.pc); -// bprintf(PRINT_NORMAL, _T(" - %i\n"), SekTotalCycles()); - - ZetClose(); - SekClose(); - - if ((nIRQControl & 8) == 0) { - if (++nSpriteFrameTimer > nSpriteFrameSpeed) { - nSpriteFrameTimer = 0; - nNeoSpriteFrame++; - } - } - - if (pBurnSoundOut) { - CDEmuGetSoundBuffer(pBurnSoundOut, nBurnSoundLen); - } - - return 0; -} diff --git a/jan/src/burn/drv/neogeo/neo_sprite.cpp b/jan/src/burn/drv/neogeo/neo_sprite.cpp deleted file mode 100644 index 3f9473642..000000000 --- a/jan/src/burn/drv/neogeo/neo_sprite.cpp +++ /dev/null @@ -1,242 +0,0 @@ -#include "neogeo.h" - -UINT8* NeoZoomROM; - -UINT8* NeoSpriteROM[MAX_SLOT] = { NULL, }; - -UINT32 nNeoTileMask[MAX_SLOT]; -INT32 nNeoMaxTile[MAX_SLOT]; - -static UINT8* NeoSpriteROMActive; -static UINT32 nNeoTileMaskActive; -static INT32 nNeoMaxTileActive; - -static UINT8* NeoTileAttrib[MAX_SLOT] = { NULL, }; -static UINT8* NeoTileAttribActive; - -INT32 nSliceStart, nSliceEnd, nSliceSize; - -static UINT32* pTileData; -static UINT32* pTilePalette; - -static UINT16* pBank; - -static INT32 nBankSize; -static INT32 nBankXPos, nBankYPos; -static INT32 nBankXZoom, nBankYZoom; - -static INT32 nNeoSpriteFrame04, nNeoSpriteFrame08; - -static INT32 nLastBPP = -1; - -typedef void (*RenderBankFunction)(); -static RenderBankFunction* RenderBank; - -static UINT16 BankAttrib01, BankAttrib02, BankAttrib03; - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s, UINT32 p) -{ - INT32 a = 255 - p; - - return (((((s & 0xff00ff) * p) + ((d & 0xff00ff) * a)) & 0xff00ff00) + - ((((s & 0x00ff00) * p) + ((d & 0x00ff00) * a)) & 0x00ff0000)) >> 8; -} - -// Include the tile rendering functions -#include "neo_sprite_func.h" - -INT32 NeoRenderSprites() -{ - if (nLastBPP != nBurnBpp ) { - nLastBPP = nBurnBpp; - - RenderBank = RenderBankNormal[nBurnBpp - 2]; - } - - if (!NeoSpriteROMActive || !(nBurnLayer & 1)) { - return 0; - } - -// UINT16 BankAttrib01, BankAttrib02, BankAttrib03; - - nNeoSpriteFrame04 = nNeoSpriteFrame & 3; - nNeoSpriteFrame08 = nNeoSpriteFrame & 7; - - // ssrpg hack! - NeoCD/SDL - INT32 nStart = 0; - if (SekReadWord(0x108) == 0x0085) { - UINT16 *vidram = (UINT16*)NeoGraphicsRAM; - - if ((vidram[0x8202] & 0x40) == 0 && (vidram[0x8203] & 0x40) != 0) { - nStart = 3; - - while ((vidram[0x8200 + nStart] & 0x40) != 0) nStart++; - - if (nStart == 3) nStart = 0; - } - } - - for (INT32 nBank = 0; nBank < 0x17D; nBank++) { - INT32 zBank = (nBank + nStart) % 0x17d; - BankAttrib01 = *((UINT16*)(NeoGraphicsRAM + 0x010000 + (zBank << 1))); - BankAttrib02 = *((UINT16*)(NeoGraphicsRAM + 0x010400 + (zBank << 1))); - BankAttrib03 = *((UINT16*)(NeoGraphicsRAM + 0x010800 + (zBank << 1))); - - pBank = (UINT16*)(NeoGraphicsRAM + (zBank << 7)); - - if (BankAttrib02 & 0x40) { - nBankXPos += nBankXZoom + 1; - } else { - nBankYPos = (0x0200 - (BankAttrib02 >> 7)) & 0x01FF; - nBankXPos = (BankAttrib03 >> 7); - if (nNeoScreenWidth == 304) { - nBankXPos -= 8; - } - - nBankYZoom = BankAttrib01 & 0xFF; - nBankSize = BankAttrib02 & 0x3F; - -// if (nBankSize > 0x10 && nSliceStart == 0x10) bprintf(PRINT_NORMAL, _T("bank: %04X, x: %04X, y: %04X, zoom: %02X, size: %02X.\n"), zBank, nBankXPos, nBankYPos, nBankYZoom, nBankSize); - } - - if (nBankSize) { - nBankXZoom = (BankAttrib01 >> 8) & 0x0F; - if (nBankXPos >= 0x01E0) { - nBankXPos -= 0x200; - } - - if (nBankXPos >= 0 && nBankXPos < (nNeoScreenWidth - nBankXZoom - 1)) { - RenderBank[nBankXZoom](); - } else { - if (nBankXPos >= -nBankXZoom && nBankXPos < nNeoScreenWidth) { - RenderBank[nBankXZoom + 16](); - } - } - } - } - -// bprintf(PRINT_NORMAL, _T("\n")); - - return 0; -} - -void NeoUpdateSprites(INT32 nOffset, INT32 nSize) -{ - for (INT32 i = nOffset & ~127; i < nOffset + nSize; i += 128) { - bool bTransparent = true; - for (INT32 j = i; j < i + 128; j++) { - if (NeoSpriteROMActive[j]) { - bTransparent = false; - break; - } - } - if (bTransparent) { - NeoTileAttribActive[i >> 7] = 1; - } else { - NeoTileAttribActive[i >> 7] = 0; - } - } -} - -void NeoSetSpriteSlot(INT32 nSlot) -{ - NeoTileAttribActive = NeoTileAttrib[nSlot]; - NeoSpriteROMActive = NeoSpriteROM[nSlot]; - nNeoTileMaskActive = nNeoTileMask[nSlot]; - nNeoMaxTileActive = nNeoMaxTile[nSlot]; -} - -static void NeoBlendInit(INT32 nSlot) -{ - TCHAR filename[MAX_PATH]; - - _stprintf(filename, _T("%s%s.bld"), szAppBlendPath, BurnDrvGetText(DRV_NAME)); - - FILE *fa = _tfopen(filename, _T("rt")); - - if (fa == NULL) { - _stprintf(filename, _T("%s%s.bld"), szAppBlendPath, BurnDrvGetText(DRV_PARENT)); - - fa = _tfopen(filename, _T("rt")); - - if (fa == NULL) { - return; - } - } - - bprintf (PRINT_IMPORTANT, _T("Using sprite blending (.bld) table!\n")); - - char szLine[64]; - - INT32 table[4] = { 0, 0xff-0x3f, 0xff-0x7f, 0xff-0x7f }; // last one 7f? - - while (1) - { - if (fgets (szLine, 64, fa) == NULL) break; - - if (strncmp ("Game", szLine, 4) == 0) continue; // don't care - if (strncmp ("Name", szLine, 4) == 0) continue; // don't care - if (szLine[0] == ';') continue; // comment (also don't care) - - INT32 type, single_entry = -1; - UINT32 min,max,k; - - for (k = 0; k < strlen(szLine); k++) { - if (szLine[k] == '-') { single_entry = k+1; break; } - } - - if (single_entry < 0) { - sscanf(szLine,"%x %d",&max,&type); - min = max; - } else { - sscanf(szLine,"%x",&min); - sscanf(szLine+single_entry,"%x %d",&max,&type); - } - - for (k = min; k <= max; k++) { - if (k < nNeoTileMask[nSlot] + 1 && NeoTileAttrib[nSlot][k] != 1) // ? - NeoTileAttrib[nSlot][k] = table[type&3]; - } - } - - fclose (fa); -} - -INT32 NeoInitSprites(INT32 nSlot) -{ - // Create a table that indicates if a tile is transparent - NeoTileAttrib[nSlot] = (UINT8*)BurnMalloc(nNeoTileMask[nSlot] + 1); - - for (INT32 i = 0; i < nNeoMaxTile[nSlot]; i++) { - bool bTransparent = true; - for (INT32 j = i << 7; j < (i + 1) << 7; j++) { - if (NeoSpriteROM[nSlot][j]) { - bTransparent = false; - break; - } - } - if (bTransparent) { - NeoTileAttrib[nSlot][i] = 1; - } else { - NeoTileAttrib[nSlot][i] = 0; - } - } - for (UINT32 i = nNeoMaxTile[nSlot]; i < nNeoTileMask[nSlot] + 1; i++) { - NeoTileAttrib[nSlot][i] = 1; - } - - if (bBurnUseBlend) NeoBlendInit(nSlot); - - NeoTileAttribActive = NeoTileAttrib[nSlot]; - NeoSpriteROMActive = NeoSpriteROM[nSlot]; - nNeoTileMaskActive = nNeoTileMask[nSlot]; - nNeoMaxTileActive = nNeoMaxTile[nSlot]; - - return 0; -} - -void NeoExitSprites(INT32 nSlot) -{ - BurnFree(NeoTileAttrib[nSlot]); - NeoTileAttribActive = NULL; -} diff --git a/jan/src/burn/drv/neogeo/neo_sprite_render.h b/jan/src/burn/drv/neogeo/neo_sprite_render.h deleted file mode 100644 index 87600753b..000000000 --- a/jan/src/burn/drv/neogeo/neo_sprite_render.h +++ /dev/null @@ -1,658 +0,0 @@ -// Create a unique name for each of the functions -#define FN(a,b,c,d) RenderBank ## a ## _ZOOM ## b ## c ## d -#define FUNCTIONNAME(a,b,c,d) FN(a,b,c,d) - -#if DOCLIP == 0 - #define CLIP _NOCLIP - #define TESTCLIP(x) 1 -#elif DOCLIP == 1 - #define CLIP _CLIP - #define TESTCLIP(x) (nBankXPos + x) >= 0 && (nBankXPos + x) < nNeoScreenWidth -#else - #error illegal doclip value. -#endif - -#if ISOPAQUE == 0 - #define OPACITY _TRANS - #define TESTCOLOUR(x) x -#else - #error illegal isopaque value -#endif - -#if BPP == 16 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTCLIP(a)) { \ - *((UINT16*)pPixel) = (UINT16)pTilePalette[b]; \ - } -#elif BPP == 24 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTCLIP(a)) { \ - UINT32 nRGB = pTilePalette[b]; \ - if (nTransparent) nRGB = alpha_blend((pPixel[2]<<16)+(pPixel[1]<<8)+pPixel[0], nRGB, nTransparent); \ - pPixel[0] = (UINT8)nRGB; \ - pPixel[1] = (UINT8)(nRGB >> 8); \ - pPixel[2] = (UINT8)(nRGB >> 16); \ - } -#elif BPP == 32 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTCLIP(a)) { \ - if (nTransparent) *((UINT32*)pPixel) = alpha_blend(*((UINT32*)pPixel), (UINT32)pTilePalette[b], nTransparent); \ - else *((UINT32*)pPixel) = (UINT32)pTilePalette[b]; \ - } -#else - #error unsupported bitdepth specified. -#endif - -#if XZOOM == 0 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); -#elif XZOOM == 1 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - nColour >>= 16; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); -#elif XZOOM == 2 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - nColour >>= 16; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 16; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); -#elif XZOOM == 3 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 16; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); -#elif XZOOM == 4 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 16; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); -#elif XZOOM == 5 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 16; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); -#elif XZOOM == 6 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); -#elif XZOOM == 7 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 7),nColour & 0x0F); -#elif XZOOM == 8 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 7),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 8),nColour & 0x0F); -#elif XZOOM == 9 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 7),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 8),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 9),nColour & 0x0F); -#elif XZOOM == 10 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 7),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 8),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 9),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(10),nColour & 0x0F); -#elif XZOOM == 11 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 7),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 8),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 9),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET(10),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(11),nColour & 0x0F); -#elif XZOOM == 12 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 7),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 8),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 9),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(10),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(11),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(12),nColour & 0x0F); -#elif XZOOM == 13 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 7),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 8),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 9),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET(10),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(11),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(12),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(13),nColour & 0x0F); -#elif XZOOM == 14 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 8; \ - PLOTPIXEL(OFFSET(5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 7),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 8),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 9),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(10),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(11),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(12),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(13),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(14),nColour & 0x0F); -#elif XZOOM == 15 - #define PLOTLINE(OFFSET,ADVANCECOLUMN) \ - nColour = pTileData[nLine]; \ - PLOTPIXEL(OFFSET( 0),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 1),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 2),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 3),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 4),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 5),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 6),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 7),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour = pTileData[nLine + 1]; \ - PLOTPIXEL(OFFSET( 8),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET( 9),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(10),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(11),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(12),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(13),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(14),nColour & 0x0F); \ - ADVANCECOLUMN; \ - nColour >>= 4; \ - PLOTPIXEL(OFFSET(15),nColour & 0x0F); -#else - #error unsupported zoom factor specified. -#endif - -#define NORMALOFFSET(x) (x) -#define MIRROROFFSET(x) (XZOOM - x) - -// #undef USE_SPEEDHACKS - -static void FUNCTIONNAME(BPP,XZOOM,CLIP,OPACITY)() -{ - UINT8 *pTileRow, *pPixel; - INT32 nColour = 0, nTransparent = 0; - INT32 nTileNumber, nTileAttrib = 0; - INT32 nTile, nLine; - INT32 nPrevTile; - INT32 nYPos; - - UINT8* pZoomValue = NeoZoomROM + (nBankYZoom << 8); - - INT32 nLinesTotal = (nBankSize >= 0x20) ? 0x01FF : ((nBankSize << 4) - 1); - INT32 nLinesDone = 0; - - while (nLinesDone <= nLinesTotal) { - nLine = (nBankYPos + nLinesDone) & 0x01FF; - nYPos = nLine; - -// bprintf(PRINT_NORMAL, _T(" - s:%i l:%i y:%i %i z:%i\n"), nLinesTotal, nLinesDone, nYPos, nBankYPos, nBankYZoom); - - // Skip everything above the part of the display we need to render - if (nYPos < nSliceStart) { - nLinesDone += nSliceStart - nYPos; - continue; - } - // Skip everything below the part of the display we need to render - if (nYPos >= nSliceEnd) { - nLinesDone += nSliceStart + 512 - nYPos; - continue; - } - - // This part of the sprite strip is in the part of the display we need to render - { - INT32 nStartTile = (nLinesDone >= 0x0100) ? 0x10 : 0; - INT32 nStartLine = nLinesDone & 0xFF; - INT32 nEndLine = (nLinesDone < 0x0100 && nLinesTotal >= 0x0100) ? 0xFF : nLinesTotal & 0xFF; - - INT32 nThisLine; - - // Handle wraparound for full-size sprite strips - if (nBankSize > 0x10 && nBankYZoom != 0xFF) { - - if (nBankSize <= 0x20) { - - // normal wrap - - if (nLinesDone >= 0x0100) { - if (nLinesDone < (0x01FF - nBankYZoom)) { - nLinesDone = (0x01FF - nBankYZoom); - - continue; - } - - nStartLine -= 0xFF - nBankYZoom; - nEndLine -= 0xFF - nBankYZoom; - } - - } else { - - // Full strip, full wrap - - if (nLinesDone >= 0x0100) { - nStartLine -= 0xFF - nBankYZoom; - if (nStartLine < 0) { - -#if 1 && defined USE_SPEEDHACKS - nStartLine += nBankYZoom + 1; - if (nStartLine < 0) { - nLinesDone = 0x200; - continue; - } -#else - nStartLine = nBankYZoom - (-nStartLine - 1) % (nBankYZoom + 1); -#endif - - nStartTile = 0; - } - } else { - if (nStartLine > nBankYZoom) { - -#if 1 && defined USE_SPEEDHACKS - nStartLine -= nBankYZoom + 1; - if (nStartLine > nBankYZoom) { - nLinesDone = 0x0100; - continue; - } -#else - nStartLine %= nBankYZoom + 1; -#endif - - nStartTile = 0x10; - } - } - - nEndLine = nBankYZoom; - } - } - - nLinesDone += nEndLine - nStartLine + 1; - -#if 1 && defined USE_SPEEDHACKS - if (nBankSize <= 0x20 && nEndLine > nBankYZoom) { - nEndLine = nBankYZoom; -// nLinesDone |= 0x00FF; - } -#endif - - // Clip to the part of the screen we need to render - if (nEndLine - nStartLine > nSliceEnd - nYPos - 1) { - nEndLine = nStartLine + nSliceEnd - nYPos - 1; - } - - pTileRow = pBurnDraw + (nYPos - 0x10) * (BPP >> 3) * nNeoScreenWidth + nBankXPos * (BPP >> 3); - nThisLine = nStartLine; - - nPrevTile = ~0; - - while (nThisLine <= nEndLine) { - - nTile = nStartTile + (pZoomValue[nThisLine] >> 4); - - if (nTile != nPrevTile) { - nPrevTile = nTile; - - nTileNumber = pBank[nTile << 1]; - nTileAttrib = pBank[(nTile << 1) + 1]; - - nTileNumber += (nTileAttrib & 0xF0) << 12; - nTileNumber &= nNeoTileMaskActive; - - if (nTileAttrib & 8) { - nTileNumber &= ~7; - nTileNumber |= nNeoSpriteFrame08; - } else { - if (nTileAttrib & 4) { - nTileNumber &= ~3; - nTileNumber |= nNeoSpriteFrame04; - } - } - - nTransparent = NeoTileAttribActive[nTileNumber]; - - if (nTransparent != 1) { - pTileData = (UINT32*)(NeoSpriteROMActive + (nTileNumber << 7)); - pTilePalette = &NeoPalette[(nTileAttrib & 0xFF00) >> 4]; - } - } - - if (nTransparent != 1) { - nLine = (pZoomValue[nThisLine] & 0x0F) << 1; - if (nTileAttrib & 2) { // Flip Y - nLine ^= 0x1E; - } - - if (nTileAttrib & 1) { // Flip X - pPixel = pTileRow + XZOOM * (BPP >> 3); - PLOTLINE(MIRROROFFSET,pPixel -= (BPP >> 3)); - } else { - pPixel = pTileRow; - PLOTLINE(NORMALOFFSET,pPixel += (BPP >> 3)); - } - } - - pTileRow += ((BPP >> 3) * nNeoScreenWidth); - - nThisLine++; - } - } - } -} - -#undef PLOTLINE -#undef OPACITY -#undef PLOTPIXEL -#undef TESTCOLOUR -#undef TESTCLIP -#undef CLIP diff --git a/jan/src/burn/drv/neogeo/neo_text.cpp b/jan/src/burn/drv/neogeo/neo_text.cpp deleted file mode 100644 index 3355ea040..000000000 --- a/jan/src/burn/drv/neogeo/neo_text.cpp +++ /dev/null @@ -1,397 +0,0 @@ -#include "neogeo.h" - -UINT8* NeoTextROMBIOS; -UINT8* NeoTextROM[MAX_SLOT]; - -INT32 nNeoTextROMSize[MAX_SLOT] = { 0, }; -bool bBIOSTextROMEnabled; - -static UINT8* NeoTextROMCurrent; - -static INT8* NeoTextTileAttrib[MAX_SLOT] = { NULL, }; -static INT8* NeoTextTileAttribBIOS = NULL; -static INT8* NeoTextTileAttribActive = NULL; -static INT32 nBankswitch[MAX_SLOT] = { 0, }; - -static INT32 nBankLookupAddress[40]; -static INT32 nBankLookupShift[40]; - -static UINT8* pTile; -static UINT8* pTileData; -static UINT32* pTilePalette; -static UINT32 nTransparent; - -typedef void (*RenderTileFunction)(); -static RenderTileFunction RenderTile; - -static INT32 nLastBPP = 0; - -static INT32 nMinX, nMaxX; - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s, UINT32 p) -{ - INT32 a = 255 - p; - - return (((((s & 0xff00ff) * p) + ((d & 0xff00ff) * a)) & 0xff00ff00) + - ((((s & 0x00ff00) * p) + ((d & 0x00ff00) * a)) & 0x00ff0000)) >> 8; -} - -#define BPP 16 - #include "neo_text_render.h" -#undef BPP - -#define BPP 24 - #include "neo_text_render.h" -#undef BPP - -#define BPP 32 - #include "neo_text_render.h" -#undef BPP - -INT32 NeoRenderText() -{ - INT32 x, y; - UINT8* pTextROM; - INT8* pTileAttrib; - UINT8* pCurrentRow = pBurnDraw; - UINT32* pTextPalette = NeoPalette; - UINT32 nTileDown = nBurnPitch << 3; - UINT32 nTileLeft = nBurnBpp << 3; - UINT16* pTileRow = (UINT16*)(NeoGraphicsRAM + 0xE000); - - if (!(nBurnLayer & 2)) { - return 0; - } - - if (nLastBPP != nBurnBpp ) { - nLastBPP = nBurnBpp; - - switch (nBurnBpp) { - case 2: - RenderTile = *RenderTile16; - break; - case 3: - RenderTile = *RenderTile24; - break; - case 4: - RenderTile = *RenderTile32; - break; - default: - return 1; - } - } - - if (!bBIOSTextROMEnabled && nBankswitch[nNeoActiveSlot]) { - - if (!NeoTextROMCurrent) { - return 0; - } - - if (nBankswitch[nNeoActiveSlot] == 1) { - - // Garou, Metal Slug 3, Metal Slug 4 - - INT32 nOffset[32]; - INT32 nBank = (3 << 12); - INT32 z = 0; - - y = 0; - while (y < 32) { - if (*((UINT16*)(NeoGraphicsRAM + 0xEA00 + z)) == 0x0200 && (*((UINT16*)(NeoGraphicsRAM + 0xEB00 + z)) & 0xFF00) == 0xFF00) { - nBank = ((*((UINT16*)(NeoGraphicsRAM + 0xEB00 + z)) & 3) ^ 3) << 12; - nOffset[y++] = nBank; - } - nOffset[y++] = nBank; - z += 4; - } - - for (y = 2, pTileRow += 2; y < 30; y++, pCurrentRow += nTileDown, pTileRow++) { - pTextROM = NeoTextROMCurrent + (nOffset[y - 2] << 5); - pTileAttrib = NeoTextTileAttribActive + nOffset[y - 2]; - for (x = nMinX, pTile = pCurrentRow; x < nMaxX; x++, pTile += nTileLeft) { - UINT32 nTile = pTileRow[x << 5]; - INT32 nPalette = nTile & 0xF000; - nTile &= 0x0FFF; - nTransparent = (UINT8)pTileAttrib[nTile]; - if (nTransparent != 1) { - pTileData = pTextROM + (nTile << 5); - pTilePalette = &pTextPalette[nPalette >> 8]; - RenderTile(); - } - } - } - } else { - - // KOF2000 - - UINT16* pBankInfo = (UINT16*)(NeoGraphicsRAM + 0xEA00) + 1; - pTextROM = NeoTextROMCurrent; - pTileAttrib = NeoTextTileAttribActive; - - for (y = 2, pTileRow += 2; y < 30; y++, pCurrentRow += nTileDown, pTileRow++, pBankInfo++) { - for (x = nMinX, pTile = pCurrentRow; x < nMaxX; x++, pTile += nTileLeft) { - UINT32 nTile = pTileRow[x << 5]; - INT32 nPalette = nTile & 0xF000; - nTile &= 0x0FFF; - nTile += (((pBankInfo[nBankLookupAddress[x]] >> nBankLookupShift[x]) & 3) ^ 3) << 12; - nTransparent = (UINT8)pTileAttrib[nTile]; - if (nTransparent != 1) { - pTileData = pTextROM + (nTile << 5); - pTilePalette = &pTextPalette[nPalette >> 8]; - RenderTile(); - } - } - } - } - } else { - if (bBIOSTextROMEnabled) { - pTextROM = NeoTextROMBIOS; - pTileAttrib = NeoTextTileAttribBIOS; - } else { - pTextROM = NeoTextROMCurrent; - pTileAttrib = NeoTextTileAttribActive; - } - if (!pTextROM) { - return 0; - } - - for (y = 2, pTileRow += 2; y < 30; y++, pCurrentRow += nTileDown, pTileRow++) { - for (x = nMinX, pTile = pCurrentRow; x < nMaxX; x++, pTile += nTileLeft) { - UINT32 nTile = pTileRow[x << 5]; - INT32 nPalette = nTile & 0xF000; - nTile &= 0xFFF; - nTransparent = (UINT8)pTileAttrib[nTile]; - if (nTransparent != 1) { - pTileData = pTextROM + (nTile << 5); - pTilePalette = &pTextPalette[nPalette >> 8]; - RenderTile(); - } - } - } - } - - return 0; -} - -void NeoExitText(INT32 nSlot) -{ - BurnFree(NeoTextTileAttribBIOS); - BurnFree(NeoTextTileAttrib[nSlot]); - NeoTextTileAttribActive = NULL; -} - -static void NeoUpdateTextAttribBIOS(INT32 nOffset, INT32 nSize) -{ - for (INT32 i = nOffset & ~31; i < nOffset + nSize; i += 32) { - NeoTextTileAttribBIOS[i >> 5] = (((INT64*)NeoTextROMBIOS)[(i >> 3) + 0] || - ((INT64*)NeoTextROMBIOS)[(i >> 3) + 1] || - ((INT64*)NeoTextROMBIOS)[(i >> 3) + 2] || - ((INT64*)NeoTextROMBIOS)[(i >> 3) + 3]) - ? 0 : 1; - } -} - -static inline void NeoUpdateTextAttribOne(const INT32 nOffset) -{ - NeoTextTileAttribActive[nOffset >> 5] = 1; - - for (INT32 i = nOffset; i < nOffset + 32; i += 4) { - if (*((UINT32*)(NeoTextROMCurrent + i))) { - NeoTextTileAttribActive[nOffset >> 5] = 0; - break; - } - } -} - -static void NeoUpdateTextAttrib(INT32 nOffset, INT32 nSize) -{ - nOffset &= ~0x1F; - - for (INT32 i = nOffset; i < nOffset + nSize; i += 32) { - NeoUpdateTextAttribOne(i); - } -} - -void NeoUpdateTextOne(INT32 nOffset, const UINT8 byteValue) -{ - nOffset = (nOffset & ~0x1F) | (((nOffset ^ 0x10) & 0x18) >> 3) | ((nOffset & 0x07) << 2); - - if (byteValue) { - NeoTextTileAttribActive[nOffset >> 5] = 0; - } else { - if (NeoTextTileAttribActive[nOffset >> 5] == 0 && NeoTextROMCurrent[nOffset]) { - NeoTextTileAttribActive[nOffset >> 5] = 1; - NeoUpdateTextAttribOne(nOffset); - } - } - - NeoTextROMCurrent[nOffset] = byteValue; -} - -static inline void NeoTextDecodeTile(const UINT8* pData, UINT8* pDest) -{ - UINT8 nBuffer[32]; - - for (INT32 i = 0; i < 8; i++) { - nBuffer[0 + i * 4] = pData[16 + i]; - nBuffer[1 + i * 4] = pData[24 + i]; - nBuffer[2 + i * 4] = pData[ 0 + i]; - nBuffer[3 + i * 4] = pData[ 8 + i]; - } - - for (INT32 i = 0; i < 32; i++) { - pDest[i] = nBuffer[i] << 4; - pDest[i] |= nBuffer[i] >> 4; - } -} - -void NeoDecodeTextBIOS(INT32 nOffset, const INT32 nSize, UINT8* pData) -{ - UINT8* pEnd = pData + nSize; - - for (UINT8* pDest = NeoTextROMBIOS + (nOffset & ~0x1F); pData < pEnd; pData += 32, pDest += 32) { - NeoTextDecodeTile(pData, pDest); - } - -// if (NeoTextTileAttribBIOS) { -// NeoUpdateTextAttribBIOS(0, nSize); -// } -} - -void NeoDecodeText(INT32 nOffset, const INT32 nSize, UINT8* pData, UINT8* pDest) -{ - UINT8* pEnd = pData + nSize; - - for (pData += (nOffset & ~0x1F); pData < pEnd; pData += 32, pDest += 32) { - NeoTextDecodeTile(pData, pDest); - } -} - -void NeoUpdateText(INT32 nOffset, const INT32 nSize, UINT8* pData, UINT8* pDest) -{ - NeoDecodeText(nOffset, nSize, pData, pDest); - if (NeoTextTileAttribActive) { - NeoUpdateTextAttrib((nOffset & ~0x1F), nSize); - } -} - -void NeoSetTextSlot(INT32 nSlot) -{ - NeoTextROMCurrent = NeoTextROM[nSlot]; - NeoTextTileAttribActive = NeoTextTileAttrib[nSlot]; -} - -static void NeoTextBlendInit(INT32 nSlot) -{ - char filename[256]; - - sprintf (filename, "support/blend/%s.blde", BurnDrvGetTextA(DRV_NAME)); - - FILE *fa = fopen(filename, "rt"); - - if (fa == NULL) { - sprintf (filename, "support/blend/%s.blde", BurnDrvGetTextA(DRV_PARENT)); - - fa = fopen(filename, "rt"); - - if (fa == NULL) { - return; - } - } - - bprintf (PRINT_IMPORTANT, _T("Using text blending (.bld) table!\n")); - - char szLine[64]; - - INT32 table[4] = { 0, 0xff-0x3f, 0xff-0x7f, 0xff-0x7f }; // last one 7f? - - while (1) - { - if (fgets (szLine, 64, fa) == NULL) break; - - if (strncmp ("Game", szLine, 4) == 0) continue; // don't care - if (strncmp ("Name", szLine, 4) == 0) continue; // don't care - if (szLine[0] == ';') continue; // comment (also don't care) - - INT32 type; - UINT32 min,max,k, single_entry = (UINT32)-1; - - for (k = 0; k < strlen(szLine); k++) { - if (szLine[k] == '-') { single_entry = k+1; break; } - } - -/* if (single_entry < 0) { - sscanf(szLine,"%x %d",&max,&type); - min = max; - } else {*/ - sscanf(szLine,"%x",&min); - sscanf(szLine+single_entry,"%x %d",&max,&type); -// } - - for (k = min; k <= max && k < ((UINT32)nNeoTextROMSize[nSlot]/0x20); k++) { - if (NeoTextTileAttrib[nSlot][k] != 1) // ? - NeoTextTileAttrib[nSlot][k] = table[type&3]; - } - } - - fclose (fa); -} - -INT32 NeoInitText(INT32 nSlot) -{ - if (nSlot < 0) { - NeoTextTileAttribBIOS = (INT8*)BurnMalloc(0x1000); - for (INT32 i = 0; i < 0x1000; i++) { - NeoTextTileAttribBIOS[i] = 1; - } - NeoUpdateTextAttribBIOS(0, 0x020000); - - return 0; - } - - INT32 nTileNum = nNeoTextROMSize[nSlot] >> 5; - -// NeoExitText(nSlot); - - NeoTextTileAttrib[nSlot] = (INT8*)BurnMalloc((nTileNum < 0x1000) ? 0x1000 : nTileNum); - - if (nNeoScreenWidth == 304) { - nMinX = 1; - nMaxX = 39; - } else { - nMinX = 0; - nMaxX = 40; - } - - // Set up tile attributes - - NeoTextROMCurrent = NeoTextROM[nSlot]; - NeoTextTileAttribActive = NeoTextTileAttrib[nSlot]; - for (INT32 i = 0; i < ((nTileNum < 0x1000) ? 0x1000 : nTileNum); i++) { - NeoTextTileAttribActive[i] = 1; - } - NeoUpdateTextAttrib(0, nNeoTextROMSize[nSlot]); - - NeoTextBlendInit(nSlot); - - // Set up tile bankswitching - - nBankswitch[nSlot] = 0; - if (nNeoTextROMSize[nSlot] > 0x040000) { -// if (BurnDrvGetHardwareCode() & HARDWARE_SNK_CMC50) { - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_ALTERNATE_TEXT) { - nBankswitch[nSlot] = 2; - - // Precompute lookup-tables - for (INT32 x = nMinX; x < nMaxX; x++) { - nBankLookupAddress[x] = (x / 6) << 5; - nBankLookupShift[x] = (5 - (x % 6)) << 1; - } - - } else { - nBankswitch[nSlot] = 1; - } - } - - return 0; -} diff --git a/jan/src/burn/drv/neogeo/neo_text_render.h b/jan/src/burn/drv/neogeo/neo_text_render.h deleted file mode 100644 index 2dd8a85e2..000000000 --- a/jan/src/burn/drv/neogeo/neo_text_render.h +++ /dev/null @@ -1,81 +0,0 @@ -#define FN(a) RenderTile ## a -#define FUNCTIONNAME(a) FN(a) - -#define ISOPAQUE 0 - -#define ADVANCECOLUMN pPixel += (BPP >> 3) - -#define ADVANCEROW pTileRow += ((BPP >> 3) * nNeoScreenWidth) - -#if ISOPAQUE == 0 - #define OPACITY _TRANS - #define TESTCOLOUR(x) x -#elif ISOPAQUE == 1 - #define OPACITY _OPAQUE - #define TESTCOLOUR(x) 1 -#else - #error illegal isopaque value -#endif - -#if BPP == 16 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b)) { \ - *((UINT16*)pPixel) = (UINT16)pTilePalette[b]; \ - } -#elif BPP == 24 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b)) { \ - UINT32 nRGB = pTilePalette[b]; \ - if (nTransparent) nRGB = alpha_blend((pPixel[2]<<16)+(pPixel[1]<<8)+pPixel[0], nRGB, nTransparent); \ - pPixel[0] = (UINT8)nRGB; \ - pPixel[1] = (UINT8)(nRGB >> 8); \ - pPixel[2] = (UINT8)(nRGB >> 16); \ - } -#elif BPP == 32 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b)) { \ - if (nTransparent) *((UINT32*)pPixel) = alpha_blend(*((UINT32*)pPixel), (UINT32)pTilePalette[b], nTransparent); \ - else *((UINT32*)pPixel) = (UINT32)pTilePalette[b]; \ - } -#else - #error unsupported bitdepth specified. -#endif - -static void FUNCTIONNAME(BPP)() -{ - UINT8 *pTileRow, *pPixel; - INT32 y, nColour; - - for (y = 0, pTileRow = pTile; y < 8; y++, ADVANCEROW) { - pPixel = pTileRow; - - nColour = *pTileData++; - PLOTPIXEL(0,nColour >> 4); - ADVANCECOLUMN; - PLOTPIXEL(1,nColour & 0x0F); - ADVANCECOLUMN; - - nColour = *pTileData++; - PLOTPIXEL(2,nColour >> 4); - ADVANCECOLUMN; - PLOTPIXEL(3,nColour & 0x0F); - ADVANCECOLUMN; - - nColour = *pTileData++; - PLOTPIXEL(4,nColour >> 4); - ADVANCECOLUMN; - PLOTPIXEL(5,nColour & 0x0F); - ADVANCECOLUMN; - - nColour = *pTileData++; - PLOTPIXEL(6,nColour >> 4); - ADVANCECOLUMN; - PLOTPIXEL(7,nColour & 0x0F); - } -} - -#undef PLOTPIXEL -#undef TESTCLIP -#undef TESTCOLOUR -#undef ADVANCEROW -#undef ADVANCECOLUMN -#undef CLIP -#undef FUNCTIONNAME -#undef FN diff --git a/jan/src/burn/drv/neogeo/neo_upd4990a.cpp b/jan/src/burn/drv/neogeo/neo_upd4990a.cpp deleted file mode 100644 index 7831453bd..000000000 --- a/jan/src/burn/drv/neogeo/neo_upd4990a.cpp +++ /dev/null @@ -1,286 +0,0 @@ -// NEC uPD4990A module (real-time clock/calendar) - -#include "neogeo.h" - -static struct { - // The current time - UINT32 nSeconds; UINT32 nMinutes; UINT32 nHours; - UINT32 nDay; UINT32 nMonth; UINT32 nYear; - UINT32 nWeekDay; - - // Modes for both outputs - INT32 nMode; INT32 nTPMode; - - // Shift register and command - UINT32 nRegister[2]; UINT32 nCommand; - - // Counters - UINT32 nCount; UINT32 nTPCount; UINT32 nInterval; - - // Outputs - UINT8 TP; UINT8 nPrevCLK; UINT8 nPrevSTB; -} uPD4990A; - -static UINT32 nOneSecond; - -INT32 uPD4990AInit(UINT32 nTicksPerSecond) -{ - nOneSecond = nTicksPerSecond; - - uPD4990A.nRegister[0] = uPD4990A.nRegister[1] = 0; - - uPD4990A.nCommand = 0; - uPD4990A.nMode = uPD4990A.nTPMode = 0; - - uPD4990A.nCount = uPD4990A.nTPCount = 0; - uPD4990A.nInterval = nOneSecond / 64; - - uPD4990A.nPrevCLK = uPD4990A.nPrevSTB = 0; - - uPD4990A.TP = 0; - - // Set the time of the uPD4990A to the current local time - time_t nLocalTime = time(NULL); - tm* tmLocalTime = localtime(&nLocalTime); - - uPD4990A.nSeconds = tmLocalTime->tm_sec; - uPD4990A.nMinutes = tmLocalTime->tm_min; - uPD4990A.nHours = tmLocalTime->tm_hour; - uPD4990A.nDay = tmLocalTime->tm_mday; - uPD4990A.nWeekDay = tmLocalTime->tm_wday; - uPD4990A.nMonth = tmLocalTime->tm_mon + 1; - uPD4990A.nYear = tmLocalTime->tm_year % 100; - - return 0; -} - -void uPD499ASetTicks(UINT32 nTicksPerSecond) -{ - uPD4990A.nCount = (UINT32)((INT64)uPD4990A.nCount * nTicksPerSecond / nOneSecond); - uPD4990A.nTPCount = (UINT32)((INT64)uPD4990A.nTPCount * nTicksPerSecond / nOneSecond); - uPD4990A.nInterval = (UINT32)((INT64)uPD4990A.nInterval * nTicksPerSecond / nOneSecond); - - nOneSecond = nTicksPerSecond; -} - -void uPD4990AExit() -{ -} - -void uPD4990AUpdate(UINT32 nTicks) -{ - if (uPD4990A.nTPMode != 2) { - uPD4990A.nTPCount += nTicks; - - if (uPD4990A.nTPMode == 1) { - if (uPD4990A.nTPCount >= uPD4990A.nInterval) { - uPD4990A.nTPMode = 0; - uPD4990A.nTPCount %= uPD4990A.nInterval; - uPD4990A.TP = (uPD4990A.nTPCount >= (uPD4990A.nInterval >> 1)); - } - } else { - if (uPD4990A.nTPCount >= uPD4990A.nInterval) { - uPD4990A.nTPCount %= uPD4990A.nInterval; - } - uPD4990A.TP = (uPD4990A.nTPCount >= (uPD4990A.nInterval >> 1)); - } - } - - uPD4990A.nCount += nTicks; - if (uPD4990A.nCount >= nOneSecond) { - uPD4990A.nCount %= uPD4990A.nInterval; - - uPD4990A.nSeconds++; - if (uPD4990A.nSeconds >= 60) { - uPD4990A.nSeconds = 0; - - uPD4990A.nMinutes++; - if (uPD4990A.nMinutes >= 60) { - uPD4990A.nMinutes = 0; - - uPD4990A.nHours++; - if (uPD4990A.nHours >= 24) { - uPD4990A.nHours = 0; - - uPD4990A.nWeekDay++; - if (uPD4990A.nWeekDay >= 7) { - uPD4990A.nWeekDay = 0; - } - - UINT32 nMonthLength[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - if ((uPD4990A.nYear & 3) == 0) { - nMonthLength[2]++; - } - - uPD4990A.nDay++; - if (uPD4990A.nDay > nMonthLength[uPD4990A.nMonth]) { - uPD4990A.nDay = 1; - - uPD4990A.nMonth++; - if (uPD4990A.nMonth > 12) { - uPD4990A.nMonth = 1; - - uPD4990A.nYear++; - if (uPD4990A.nYear >= 100) { - uPD4990A.nYear = 0; - } - } - } - } - } - } - } -} - -void uPD4990AScan(INT32 nAction, INT32* pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { // Scan variables - - if (pnMin && *pnMin < 0x020902) { // Return minimum compatible version - *pnMin = 0x020902; - } - - SCAN_VAR(uPD4990A); - SCAN_VAR(nOneSecond); - } -} - -void uPD4990AWrite(UINT8 CLK, UINT8 STB, UINT8 DATA) -{ -// bprintf(PRINT_NORMAL, _T(" - uPD4990A written: CLK: %i, STB: %i DATA IN: %i (PC: %06X).\n"), CLK ? 1 : 0, STB ? 1 : 0, DATA ? 1 : 0, SekGetPC(-1)); - - if (STB && uPD4990A.nPrevSTB == 0) { // Process command - -// bprintf(PRINT_NORMAL, _T(" - Command sent: %02X.\n"), nCommand & 0x0F); - - switch (uPD4990A.nCommand & 0x0F) { - case 0x00: // Register hold - uPD4990A.nMode = 0; - - uPD4990A.nTPMode = 0; - uPD4990A.nInterval = nOneSecond / 64; - uPD4990A.nTPCount %= uPD4990A.nInterval; - break; - case 0x01: // Register shift - uPD4990A.nMode = 1; - break; - case 0x02: // Time set & counter hold - uPD4990A.nMode = 2; - -// bprintf(PRINT_NORMAL, _T("Time set: %08X %08X.\n"), nRegister[0], nRegister[1]); - - // Convert BCD values to normal numbers - uPD4990A.nSeconds = ((uPD4990A.nRegister[0] >> 0) & 0x0F); - uPD4990A.nSeconds += ((uPD4990A.nRegister[0] >> 4) & 0x0F) * 10; - uPD4990A.nMinutes = ((uPD4990A.nRegister[0] >> 8) & 0x0F); - uPD4990A.nMinutes += ((uPD4990A.nRegister[0] >> 12) & 0x0F) * 10; - uPD4990A.nHours = ((uPD4990A.nRegister[0] >> 16) & 0x0F); - uPD4990A.nHours += ((uPD4990A.nRegister[0] >> 20) & 0x0F) * 10; - uPD4990A.nDay = ((uPD4990A.nRegister[0] >> 24) & 0x0F); - uPD4990A.nDay += ((uPD4990A.nRegister[0] >> 28) & 0x0F) * 10; - uPD4990A.nWeekDay = ((uPD4990A.nRegister[1] >> 0) & 0x0F); - uPD4990A.nMonth = ((uPD4990A.nRegister[1] >> 4) & 0x0F); - uPD4990A.nYear = ((uPD4990A.nRegister[1] >> 8) & 0x0F); - uPD4990A.nYear += ((uPD4990A.nRegister[1] >> 12) & 0x0F) * 10; - break; - case 0x03: // Time read - uPD4990A.nMode = 0; - - // Convert normal numbers to BCD values - uPD4990A.nRegister[0] = (uPD4990A.nSeconds % 10) << 0; - uPD4990A.nRegister[0] |= (uPD4990A.nSeconds / 10) << 4; - uPD4990A.nRegister[0] |= (uPD4990A.nMinutes % 10) << 8; - uPD4990A.nRegister[0] |= (uPD4990A.nMinutes / 10) << 12; - uPD4990A.nRegister[0] |= (uPD4990A.nHours % 10) << 16; - uPD4990A.nRegister[0] |= (uPD4990A.nHours / 10) << 20; - uPD4990A.nRegister[0] |= (uPD4990A.nDay % 10) << 24; - uPD4990A.nRegister[0] |= (uPD4990A.nDay / 10) << 28; - uPD4990A.nRegister[1] = (uPD4990A.nWeekDay ) << 0; - uPD4990A.nRegister[1] |= (uPD4990A.nMonth ) << 4; - uPD4990A.nRegister[1] |= (uPD4990A.nYear % 10) << 8; - uPD4990A.nRegister[1] |= (uPD4990A.nYear / 10) << 12; - break; - - case 0x04: - case 0x05: - case 0x06: - case 0x07: { // TP = nn Hz - INT32 n[4] = { 64, 256, 2048, 4096 }; - - uPD4990A.nTPMode = 0; - uPD4990A.nInterval = nOneSecond / n[uPD4990A.nCommand & 3]; - uPD4990A.nTPCount %= uPD4990A.nInterval; - break; - } - - case 0x08: - case 0x09: - case 0x0A: - case 0x0B: { // TP = nn s interval set (counter reset & start) - INT32 n[4] = { 1, 10, 30, 60 }; - - uPD4990A.nTPMode = 0; - uPD4990A.nInterval = n[uPD4990A.nCommand & 3] * nOneSecond; - uPD4990A.nTPCount = 0; - break; - } - case 0x0C: // Interval reset - uPD4990A.nTPMode = 1; - uPD4990A.TP = 1; - break; - case 0x0D: // interval start - uPD4990A.nTPMode = 0; - break; - case 0x0E: // Interval stop - uPD4990A.nTPMode = 2; - break; - - case 0x0F: // Test mode set (not implemented) - break; - } - } - - if (STB == 0 && CLK && uPD4990A.nPrevCLK == 0) { - - // Shift a new bit into the register - if (uPD4990A.nMode == 1) { - uPD4990A.nRegister[0] >>= 1; - if (uPD4990A.nRegister[1] & 1) { - uPD4990A.nRegister[0] |= (1 << 31); - } - uPD4990A.nRegister[1] >>= 1; - uPD4990A.nRegister[1] &= 0x7FFF; - if (uPD4990A.nCommand & 1) { - uPD4990A.nRegister[1] |= (1 << 15); - } - } - - // Shift a new bit into the command - uPD4990A.nCommand >>= 1; - uPD4990A.nCommand &= 7; - if (DATA) { - uPD4990A.nCommand |= 8; - } - } - - uPD4990A.nPrevCLK = CLK; - uPD4990A.nPrevSTB = STB; -} - -UINT8 uPD4990ARead(UINT32 nTicks) -{ - UINT8 OUT; - - uPD4990AUpdate(nTicks); - - if (uPD4990A.nMode == 0) { // 1Hz pulse appears at output - OUT = (uPD4990A.nCount >= (nOneSecond >> 1)); - } else { // LSB of the shift register appears at output - OUT = uPD4990A.nRegister[0] & 1; - } - -// bprintf(PRINT_NORMAL, _T(" - uPD4990A read: OUT %i, TP %i.\n"), OUT, uPD4990A.TP); - - return (OUT << 1) | uPD4990A.TP; -} - diff --git a/jan/src/burn/drv/neogeo/neogeo.cpp b/jan/src/burn/drv/neogeo/neogeo.cpp deleted file mode 100644 index c25fd0d79..000000000 --- a/jan/src/burn/drv/neogeo/neogeo.cpp +++ /dev/null @@ -1,427 +0,0 @@ -// Neo Geo -- misc. support functions - -#include "neogeo.h" -#include "bitswap.h" - -UINT8 nNeoProtectionXor; - -// This function loads the 68K ROMs -INT32 NeoLoadCode(INT32 nOffset, INT32 nNum, UINT8* pDest) -{ - struct BurnRomInfo ri; - - for (INT32 i = 0; i < nNum; i++) { - ri.nLen = 0; - BurnDrvGetRomInfo(&ri, nOffset + i); - - if ((BurnDrvGetHardwareCode() & HARDWARE_SNK_P32) && (i == 0)) - { - if (BurnLoadRom(pDest + 0, nOffset + i + 0, 2)) return 1; - if (BurnLoadRom(pDest + 1, nOffset + i + 1, 2)) return 1; - - for (UINT32 j = 0; j < ri.nLen << 1; j+=4) - BurnByteswap(pDest + j + 1, 2); - - i++; - pDest += ri.nLen << 1; - continue; - } - - if (BurnLoadRom(pDest, nOffset + i, 1)) { - return 1; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SNK_SWAPP) && (i == 0)) { - for (UINT32 j = 0; j < (ri.nLen / 2); j++) { - INT32 k = pDest[j]; - pDest[j] = pDest[j + (ri.nLen / 2)]; - pDest[j + (ri.nLen / 2)] = k; - } - } - - pDest += ri.nLen; - } - - return 0; -} - -static void NeoSVCAddressDecrypt(UINT8* src, UINT8* dst, INT32 start, INT32 end) -{ - for (INT32 i = start / 4; i < end / 4; i++) { - ((UINT32*)dst)[i] = ((UINT32*)src)[(i & 0xFFE00000) | (0x0C8923 ^ BITSWAP24((i & 0x1FFFFF), 0x17, 0x16, 0x15, 0x04, 0x0B, 0x0E, 0x08, 0x0C, 0x10, 0x00, 0x0a, 0x13, 0x03, 0x06, 0x02, 0x07, 0x0D, 0x01, 0x11, 0x09, 0x14, 0x0f, 0x12, 0x05))]; - } -} - -static void NeoKOFAddressDecrypt(UINT8* src, UINT8* dst, INT32 start, INT32 end) -{ - for (INT32 i = start; i < end; i += 0x100) { - memcpy(dst + i, src + ((i & 0xFF800000) | BURN_ENDIAN_SWAP_INT16((BITSWAP16((i >> 8) & 0x7FFF, 0x0F, 0x0A, 0x0E, 0x0C, 0x0B, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x0D, 0x01, 0x00)) << 8)), 0x100); - } -} - -static void NeoPCBDataDecrypt(UINT8* dst, INT32 size) -{ - for (INT32 i = 0; i < size / 4; i++) { - ((UINT32*)dst)[i] = BURN_ENDIAN_SWAP_INT32(BITSWAP32(0xE9C42134 ^ BURN_ENDIAN_SWAP_INT32(((UINT32*)dst)[i]), 0x09, 0x0D, 0x13, 0x00, 0x17, 0x0F, 0x03, 0x05, 0x04, 0x0C, 0x11, 0x1E, 0x12, 0x15, 0x0B, 0x06, 0x1B, 0x0A, 0x1A, 0x1C, 0x14, 0x02, 0x0e, 0x1D, 0x18, 0x08, 0x01, 0x10, 0x19, 0x1F, 0x07, 0x16)); - } -} - -// This function loads and pre-processes the sprite data -INT32 NeoLoadSprites(INT32 nOffset, INT32 nNum, UINT8* pDest, UINT32 nSpriteSize) -{ - struct BurnRomInfo ri; - - UINT32 nRomSize = 0; - - if (BurnDrvGetHardwareCode() & (HARDWARE_SNK_CMC42 | HARDWARE_SNK_CMC50)) { - - UINT8* pBuf1 = NULL; - UINT8* pBuf2 = NULL; - -// double dProgress = 1.0 / ((double)((nSpriteSize > 0x04000000) ? 0x05000000 : nSpriteSize) / 0x400000 * 1.5); - - BurnDrvGetRomInfo(&ri, nOffset); - nRomSize = ri.nLen; - - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_CMC42) { - NeoCMC42Init(); - } else { - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_CMC50) { - NeoCMC50Init(); - } - } - - pBuf1 = (UINT8*)BurnMalloc(nRomSize * 2); - if (pBuf1 == NULL) { - return 1; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_DEDICATED_PCB) { -// dProgress *= 0.75; - - pBuf2 = (UINT8*)BurnMalloc(nRomSize * 2); - if (pBuf2 == NULL) { - return 1; - } - } - - for (INT32 i = 0; i < (nNum >> 1); i++) { - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_DEDICATED_PCB) { - if (nRomSize == 0x02000000) { - - // The ROM chips are 32-bit - - BurnLoadRom(pBuf2 + 0 * nRomSize, nOffset + (i << 1), 1); - BurnLoadRom(pBuf2 + 1 * nRomSize, nOffset + 1 + (i << 1), 1); - } else { - - // The ROM chips are 16-bit and need to be interleaved - - BurnLoadRom(pBuf1, nOffset + (i << 1), 1); - for (UINT32 j = 0; j < nRomSize / 2; j++) { - ((UINT16*)pBuf2)[(j << 1) + 0] = ((UINT16*)pBuf1)[j]; - } - BurnLoadRom(pBuf1, nOffset + 1 + (i << 1), 1); - for (UINT32 j = 0; j < nRomSize / 2; j++) { - ((UINT16*)pBuf2)[(j << 1) + 1] = ((UINT16*)pBuf1)[j]; - } - } - } else { - BurnLoadRom(pBuf1 + 0, nOffset + (i << 1), 2); - BurnLoadRom(pBuf1 + 1, nOffset + 1 + (i << 1), 2); - } - -// BurnUpdateProgress(0.0, _T("Decrypting graphics...")/*, BST_DECRYPT_GRA*/ , 0); - BurnUpdateProgress(1.0 / ((double)(nSpriteSize/0x800000) * 8.0 / (nRomSize / 0x400000) / 3.0), _T("Decrypting graphics..."), 0); - - if ((i * nRomSize * 2) < 0x04000000) { - for (UINT32 j = 0; j < nRomSize * 2; j += 0x400000) { - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_DEDICATED_PCB) { -// BurnUpdateProgress(dProgress / 2.0, NULL/*, 0*/, 0); - (BurnDrvGetHardwareCode() & HARDWARE_SNK_KOF2K3) ? NeoKOFAddressDecrypt(pBuf2, pBuf1, j, j + 0x400000) : NeoSVCAddressDecrypt(pBuf2, pBuf1, j, j + 0x400000); - NeoPCBDataDecrypt(pBuf1 + j, 0x400000); - } -// BurnUpdateProgress(dProgress, NULL/*, 0*/, 0); - NeoCMCDecrypt(nNeoProtectionXor, pDest, pBuf1 + j, i * (nRomSize * 2) + j, 0x400000, nSpriteSize); - } - } else { - // The kof2k3 PCB has 96MB of graphics ROM, however the last 16MB are unused, and the protection/decryption hardware does not see them - - for (UINT32 j = 0; j < nRomSize; j += 0x400000) { -// BurnUpdateProgress(dProgress / 2.0, NULL/*, 0*/, 0); - NeoKOFAddressDecrypt(pBuf2, pBuf1, j, j + 0x400000); - NeoPCBDataDecrypt(pBuf1 + j, 0x400000); -// BurnUpdateProgress(dProgress, NULL, /*0,*/ 0); - NeoCMCDecrypt(nNeoProtectionXor, pDest + 0x4000000, pBuf1 + j, j, 0x400000, 0x1000000); - } - } - } - - BurnFree(pBuf2); - BurnFree(pBuf1); - } else { - nSpriteSize = 0; - - // Compute correct size to gaps into account (Kizuna) - if (strcmp("kof97oro", BurnDrvGetTextA(DRV_NAME)) != 0) { - for (INT32 i = 0; i < nNum - 2; i++) { - BurnDrvGetRomInfo(&ri, nOffset + i); - if (ri.nLen > nRomSize) { - nRomSize = ri.nLen; - } - } - } - - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_SPRITE32) { - for (INT32 i = 0; i < (nNum >> 2); i++) { - BurnLoadRom(pDest + nSpriteSize + 0, nOffset + 0 + (i << 2), 4); - BurnLoadRom(pDest + nSpriteSize + 2, nOffset + 1 + (i << 2), 4); - BurnLoadRom(pDest + nSpriteSize + 1, nOffset + 2 + (i << 2), 4); - BurnLoadRom(pDest + nSpriteSize + 3, nOffset + 3 + (i << 2), 4); - - BurnDrvGetRomInfo(&ri, nOffset + (i << 2)); - - if (i < (nNum >> 2) - 1) { - nSpriteSize += nRomSize << 2; - } else { - nSpriteSize += ri.nLen << 2; - } - } - } else { - for (INT32 i = 0; i < (nNum >> 1); i++) { - BurnLoadRom(pDest + nSpriteSize + 0, nOffset + (i << 1), 2); - BurnLoadRom(pDest + nSpriteSize + 1, nOffset + 1 + (i << 1), 2); - - BurnDrvGetRomInfo(&ri, nOffset + (i << 1)); - - if ((i < (nNum >> 1) - 1) && strcmp("kof97oro", BurnDrvGetTextA(DRV_NAME)) != 0) { - nSpriteSize += nRomSize << 1; - } else { - nSpriteSize += ri.nLen << 1; - } - } - } - } - - // Swap data for viewpoin, aof, ssideki, kotm2, more - if (BurnDrvGetHardwareCode() & HARDWARE_SNK_SWAPC) { - UINT8* pBuf = (UINT8*)BurnMalloc(0x600000); - - if (pBuf) { - for (INT32 i = 0x200000; i < 0x600000; i++) { - pBuf[i] = pDest[i]; - } - for (INT32 i = 0; i < 0x100000; i++) { - ((INT16*)(pDest + 0x200000))[i] = ((INT16*)(pBuf + 0x400000))[i]; - ((INT16*)(pDest + 0x400000))[i] = ((INT16*)(pBuf + 0x200000))[i]; - } - - BurnFree(pBuf); - } else { - return 1; - } - } - - return 0; -} - -// ---------------------------------------------------------------------------- -// Graphics decoding for MVS/AES - -void NeoDecodeSprites(UINT8* pDest, INT32 nSize) -{ -// double dProgress = 0.0; - -// if (nSize > 0x04000000) { -// nSize = 0x04000000; -// } - -/* if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_DEDICATED_PCB) { - dProgress = 1.0 / 32.0; - } else if (BurnDrvGetHardwareCode() & (HARDWARE_SNK_CMC42 | HARDWARE_SNK_CMC50)) { - dProgress = 1.0 / 24.0; - } else { - dProgress = 1.0 / 8.0; - }*/ - - for (INT32 i = 0; i < 8; i++) { - - UINT8* pStart = pDest + i * (nSize >> 3); - UINT8* pEnd = pStart + (nSize >> 3); - -// BurnUpdateProgress(dProgress, i ? NULL : _T("Preprocessing graphics...")/*, BST_PROCESS_GRA*/, 0); - - INT32 nStep = 8; - if (BurnDrvGetHardwareCode() & (HARDWARE_SNK_CMC42 | HARDWARE_SNK_CMC50)) { - nStep *= 4; - } - BurnUpdateProgress(1.0 / nStep, i ? NULL : _T("Preprocessing graphics..."), 0); - - // Pre-process the sprite graphics - for (UINT8* pTile = pStart; pTile < pEnd; pTile += 128) { - UINT32 data[32]; - - for (INT32 y = 0; y < 16; y++) { - UINT32 n = 0; - for (INT32 x = 0; x < 8; x++) { - UINT32 m = ((pTile[67 + (y << 2)] >> x) & 1) << 3; - m |= ((pTile[65 + (y << 2)] >> x) & 1) << 2; - m |= ((pTile[66 + (y << 2)] >> x) & 1) << 1; - m |= ((pTile[64 + (y << 2)] >> x) & 1) << 0; - - n |= m << (x << 2); - } - data[(y << 1) + 0] = n; - - n = 0; - for (INT32 x = 0; x < 8; x++) { - UINT32 m = ((pTile[3 + (y << 2)] >> x) & 1) << 3; - m |= ((pTile[1 + (y << 2)] >> x) & 1) << 2; - m |= ((pTile[2 + (y << 2)] >> x) & 1) << 1; - m |= ((pTile[0 + (y << 2)] >> x) & 1) << 0; - - n |= m << (x << 2); - } - data[(y << 1) + 1] = n; - } - for (INT32 n = 0; n < 32; n++) { - ((UINT32*)pTile)[n] = data[n]; - } - } - } -} - -/* -void NeoDecodeText(UINT8* pDest, INT32 nSize) -{ - // Pre-process the text layer graphics - for (UINT8* pTile = pDest; pTile < (pDest + nSize); pTile += 32) { - UINT8 data[32]; - for (INT32 n = 0; n < 8; n++) { - data[0 + n * 4] = pTile[16 + n]; - data[1 + n * 4] = pTile[24 + n]; - data[2 + n * 4] = pTile[ 0 + n]; - data[3 + n * 4] = pTile[ 8 + n]; - } - - for (INT32 n = 0; n < 32; n++) { - pTile[n] = data[n] << 4; - pTile[n] |= data[n] >> 4; - } - } -} -*/ - -// ---------------------------------------------------------------------------- -// Graphics decoding for Neo CD - -void NeoDecodeSpritesCD(UINT8* pData, UINT8* pDest, INT32 nSize) -{ - UINT8* pEnd = pData + nSize; - - for (UINT8* pTile = pData; pTile < pEnd; pTile += 128, pDest += 128) { - UINT32 data[32]; - - for (INT32 y = 0; y < 16; y++) { - UINT32 n = 0; - - for (INT32 x = 0; x < 8; x++) { - UINT32 m = ((pTile[67 + (y << 2)] >> x) & 1) << 3; - m |= ((pTile[66 + (y << 2)] >> x) & 1) << 2; - m |= ((pTile[65 + (y << 2)] >> x) & 1) << 1; - m |= ((pTile[64 + (y << 2)] >> x) & 1) << 0; - - n |= m << (x << 2); - } - data[(y << 1) + 0] = n; - - n = 0; - for (INT32 x = 0; x < 8; x++) { - UINT32 m = ((pTile[3 + (y << 2)] >> x) & 1) << 3; - m |= ((pTile[2 + (y << 2)] >> x) & 1) << 2; - m |= ((pTile[1 + (y << 2)] >> x) & 1) << 1; - m |= ((pTile[0 + (y << 2)] >> x) & 1) << 0; - - n |= m << (x << 2); - } - data[(y << 1) + 1] = n; - } - - for (INT32 n = 0; n < 32; n++) { - ((UINT32*)pDest)[n] = data[n]; - } - } -} - -// ---------------------------------------------------------------------------- - -INT32 NeoLoadADPCM(INT32 nOffset, INT32 nNum, UINT8* pDest) -{ - struct BurnRomInfo ri; - ri.nType = 0; - ri.nLen = 0; - - BurnDrvGetRomInfo(&ri, nOffset); - - for (INT32 i = 0; i < nNum; i++) { - BurnLoadRom(pDest + ri.nLen * i, nOffset + i, 1); - } - - return 0; -} - -// This function fills the screen with the first palette entry -void NeoClearScreen() -{ - UINT32 nColour = NeoPalette[0x0FFF]; - - if (nColour) { - switch (nBurnBpp) { - case 4: { - UINT32* pClear = (UINT32*)pBurnDraw; - for (INT32 i = 0; i < nNeoScreenWidth * 224 / 8; i++) { - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - } - break; - } - - case 3: { - UINT8* pClear = pBurnDraw; - UINT8 r = nColour; - UINT8 g = (nColour >> 8) & 0xFF; - UINT8 b = (nColour >> 16) & 0xFF; - for (INT32 i = 0; i < nNeoScreenWidth * 224; i++) { - *pClear++ = r; - *pClear++ = g; - *pClear++ = b; - } - break; - } - - case 2: { - UINT32* pClear = (UINT32*)pBurnDraw; - nColour |= nColour << 16; - for (INT32 i = 0; i < nNeoScreenWidth * 224 / 16; i++) { - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - } - break; - } - } - } else { - memset(pBurnDraw, 0, nNeoScreenWidth * 224 * nBurnBpp); - } -} diff --git a/jan/src/burn/drv/neogeo/neogeo.h b/jan/src/burn/drv/neogeo/neogeo.h deleted file mode 100644 index d221dfef9..000000000 --- a/jan/src/burn/drv/neogeo/neogeo.h +++ /dev/null @@ -1,164 +0,0 @@ -#include "burnint.h" -#include "m68000_intf.h" -#include "z80_intf.h" - -// Uncomment the following line to make the display the full 320 pixels wide -#define NEO_DISPLAY_OVERSCAN - -#if defined NEO_DISPLAY_OVERSCAN - extern INT32 nNeoScreenWidth;// = 320; -#else - extern INT32 nNeoScreenWidth;// = 304; -#endif - -#define MAX_SLOT (8) - -#define NEO_SYS_CD (1 << 4) -#define NEO_SYS_PCB (1 << 3) -#define NEO_SYS_CART (1 << 2) -#define NEO_SYS_AES (1 << 1) -#define NEO_SYS_MVS (1 << 0) - -struct NeoGameInfo { - INT32 nCodeOffset; INT32 nCodeNum; - INT32 nTextOffset; - INT32 nSpriteOffset; INT32 nSpriteNum; - INT32 nSoundOffset; - INT32 nADPCMOffset; INT32 nADPCMANum; INT32 nADPCMBNum; - INT32 nNeoSRAMProtection; -}; - -struct NEO_CALLBACK { - void (*pInitialise)(); - void (*pInstallHandlers)(); - void (*pRemoveHandlers)(); - void (*pBankswitch)(); - INT32 (*pScan)(INT32, INT32*); -}; - -extern NEO_CALLBACK NeoCallback[MAX_SLOT]; -extern NEO_CALLBACK* NeoCallbackActive; - -// neogeo.cpp -void NeoClearScreen(); -INT32 NeoLoadCode(INT32 nOffset, INT32 nNum, UINT8* pDest); -INT32 NeoLoadSprites(INT32 nOffset, INT32 nNum, UINT8* pDest, UINT32 nSpriteSize); -INT32 NeoLoadADPCM(INT32 nOffset, INT32 nNum, UINT8* pDest); - -void NeoDecodeSprites(UINT8* pDest, INT32 nSize); -void NeoDecodeSpritesCD(UINT8* pData, UINT8* pDest, INT32 nSize); - -// neo_run.cpp -extern UINT8* NeoGraphicsRAM; - -extern UINT8 nNeoNumSlots; -extern UINT32 nNeoActiveSlot; - -extern UINT8 NeoButton1[]; -extern UINT8 NeoButton2[]; -extern UINT8 NeoButton3[]; -extern UINT8 NeoButton4[]; -extern UINT8 NeoJoy1[]; -extern UINT8 NeoJoy2[]; -extern UINT8 NeoJoy3[]; -extern UINT8 NeoJoy4[]; -extern UINT16 NeoAxis[]; -extern UINT8 NeoInput[]; -extern UINT8 NeoDiag[]; -extern UINT8 NeoDebugDip[]; -extern UINT8 NeoReset, NeoSystem; - -extern UINT8* Neo68KROMActive; -extern UINT8* NeoVectorActive; -extern UINT8* NeoZ80ROMActive; - -extern UINT8* YM2610ADPCMAROM[MAX_SLOT]; -extern UINT8* Neo68KFix[MAX_SLOT]; - -extern UINT32 nNeo68KROMBank; - -extern UINT8 *NeoSpriteRAM, *NeoTextRAM; - -extern bool bNeoEnableGraphics; - -extern bool bDisableNeoWatchdog; - -INT32 NeoInit(); -INT32 NeoCDInit(); -INT32 NeoExit(); -INT32 NeoScan(INT32 nAction, INT32* pnMin); -INT32 NeoRender(); -INT32 NeoFrame(); - -void NeoMapBank(); -void NeoMap68KFix(); -void NeoUpdateVector(); - -// neo_palette.cpp -extern UINT8* NeoPalSrc[2]; -extern INT32 nNeoPaletteBank; -extern UINT32* NeoPalette; - -extern UINT8 NeoRecalcPalette; - -INT32 NeoInitPalette(); -void NeoExitPalette(); -INT32 NeoUpdatePalette(); -void NeoSetPalette(); - -void __fastcall NeoPalWriteByte(UINT32 nAddress, UINT8 byteValue); -void __fastcall NeoPalWriteWord(UINT32 nAddress, UINT16 wordValue); - -// neo_text.cpp -extern UINT8* NeoTextROMBIOS; -extern UINT8* NeoTextROM[MAX_SLOT]; -extern INT32 nNeoTextROMSize[MAX_SLOT]; -extern bool bBIOSTextROMEnabled; - -INT32 NeoInitText(INT32 nSlot); -void NeoSetTextSlot(INT32 nSlot); -void NeoExitText(INT32 nSlot); -INT32 NeoRenderText(); - -void NeoDecodeTextBIOS(INT32 nOffset, const INT32 nSize, UINT8* pData); -void NeoDecodeText(INT32 nOffset, const INT32 nSize, UINT8* pData, UINT8* pDest); -void NeoUpdateTextOne(INT32 nOffset, const UINT8 byteValue); -void NeoUpdateText(INT32 nOffset, const INT32 nSize, UINT8* pData, UINT8* pDest); - -// neo_sprite.cpp -extern UINT8* NeoSpriteROM[MAX_SLOT]; -extern UINT8* NeoZoomROM; - -extern INT32 nNeoSpriteFrame; -extern UINT32 nNeoTileMask[MAX_SLOT]; -extern INT32 nNeoMaxTile[MAX_SLOT]; - -extern INT32 nSliceStart, nSliceEnd, nSliceSize; - -void NeoUpdateSprites(INT32 nOffset, INT32 nSize); -void NeoSetSpriteSlot(INT32 nSlot); -INT32 NeoInitSprites(INT32 nSlot); -void NeoExitSprites(INT32 nSlot); -INT32 NeoRenderSprites(); - -// neo_decrypt.cpp -extern UINT8 nNeoProtectionXor; - -void NeoCMC42Init(); -void NeoCMC50Init(); -void NeoCMCDecrypt(INT32 extra_xor, UINT8* rom, UINT8* buf, INT32 offset, INT32 block_size, INT32 rom_size); -void NeoCMCExtractSData(UINT8* rom, UINT8* sdata, INT32 rom_size, INT32 sdata_size); - -void neogeo_cmc50_m1_decrypt(); - -// neo_upd4990a.cpp -void uPD4990AExit(); -void uPD499ASetTicks(UINT32 nTicksPerSecond); -INT32 uPD4990AInit(UINT32 nTicksPerSecond); -void uPD4990AScan(INT32 nAction, INT32* pnMin); -void uPD4990AUpdate(UINT32 nTicks); -void uPD4990AWrite(UINT8 CLK, UINT8 STB, UINT8 DATA); -UINT8 uPD4990ARead(UINT32 nTicks); - -// d_neogeo.cpp -void kf2k3pcb_bios_decode(); diff --git a/jan/src/burn/drv/pce/d_pce.cpp b/jan/src/burn/drv/pce/d_pce.cpp deleted file mode 100644 index cbf44c79a..000000000 --- a/jan/src/burn/drv/pce/d_pce.cpp +++ /dev/null @@ -1,8665 +0,0 @@ -#include "burnint.h" -#include "pce.h" - -// Driver generated by database on http://www.barryharris.me.uk - -static struct BurnInputInfo pceInputList[] = { - {"P1 Start", BIT_DIGITAL, PCEJoy1 + 3, "p1 start" }, // 0 - {"P1 Select", BIT_DIGITAL, PCEJoy1 + 2, "p1 select" }, - {"P1 Up", BIT_DIGITAL, PCEJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, PCEJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, PCEJoy1 + 7, "p1 left" }, - {"P1 Right", BIT_DIGITAL, PCEJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, PCEJoy1 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, PCEJoy1 + 0, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, PCEJoy1 + 8, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, PCEJoy1 + 9, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, PCEJoy1 + 10, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, PCEJoy1 + 11, "p1 fire 6" }, - - {"P2 Start", BIT_DIGITAL, PCEJoy2 + 3, "p2 start" }, // 12 - {"P2 Select", BIT_DIGITAL, PCEJoy2 + 2, "p2 select" }, - {"P2 Up", BIT_DIGITAL, PCEJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, PCEJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, PCEJoy2 + 7, "p2 left" }, - {"P2 Right", BIT_DIGITAL, PCEJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, PCEJoy2 + 1, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, PCEJoy2 + 0, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, PCEJoy2 + 8, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, PCEJoy2 + 9, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, PCEJoy2 + 10, "p2 fire 5" }, - {"P2 Button 6", BIT_DIGITAL, PCEJoy2 + 11, "p2 fire 6" }, - - {"P3 Start", BIT_DIGITAL, PCEJoy3 + 3, "p3 start" }, // 24 - {"P3 Select", BIT_DIGITAL, PCEJoy3 + 2, "p3 select" }, - {"P3 Up", BIT_DIGITAL, PCEJoy3 + 4, "p3 up" }, - {"P3 Down", BIT_DIGITAL, PCEJoy3 + 6, "p3 down" }, - {"P3 Left", BIT_DIGITAL, PCEJoy3 + 7, "p3 left" }, - {"P3 Right", BIT_DIGITAL, PCEJoy3 + 5, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, PCEJoy3 + 1, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, PCEJoy3 + 0, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, PCEJoy3 + 8, "p3 fire 3" }, - {"P3 Button 4", BIT_DIGITAL, PCEJoy3 + 9, "p3 fire 4" }, - {"P3 Button 5", BIT_DIGITAL, PCEJoy3 + 10, "p3 fire 5" }, - {"P3 Button 6", BIT_DIGITAL, PCEJoy3 + 11, "p3 fire 6" }, - - {"P4 Start", BIT_DIGITAL, PCEJoy4 + 3, "p4 start" }, // 36 - {"P4 Select", BIT_DIGITAL, PCEJoy4 + 2, "p4 select" }, - {"P4 Up", BIT_DIGITAL, PCEJoy4 + 4, "p4 up" }, - {"P4 Down", BIT_DIGITAL, PCEJoy4 + 6, "p4 down" }, - {"P4 Left", BIT_DIGITAL, PCEJoy4 + 7, "p4 left" }, - {"P4 Right", BIT_DIGITAL, PCEJoy4 + 5, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, PCEJoy4 + 1, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, PCEJoy4 + 0, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, PCEJoy4 + 8, "p4 fire 3" }, - {"P4 Button 4", BIT_DIGITAL, PCEJoy4 + 9, "p4 fire 4" }, - {"P4 Button 5", BIT_DIGITAL, PCEJoy4 + 10, "p4 fire 5" }, - {"P4 Button 6", BIT_DIGITAL, PCEJoy4 + 11, "p4 fire 6" }, - - {"P5 Start", BIT_DIGITAL, PCEJoy5 + 3, "p5 start" }, // 48 - {"P5 Select", BIT_DIGITAL, PCEJoy5 + 2, "p5 select" }, - {"P5 Up", BIT_DIGITAL, PCEJoy5 + 4, "p5 up" }, - {"P5 Down", BIT_DIGITAL, PCEJoy5 + 6, "p5 down" }, - {"P5 Left", BIT_DIGITAL, PCEJoy5 + 7, "p5 left" }, - {"P5 Right", BIT_DIGITAL, PCEJoy5 + 5, "p5 right" }, - {"P5 Button 1", BIT_DIGITAL, PCEJoy5 + 1, "p5 fire 1" }, - {"P5 Button 2", BIT_DIGITAL, PCEJoy5 + 0, "p5 fire 2" }, - {"P5 Button 3", BIT_DIGITAL, PCEJoy5 + 8, "p5 fire 3" }, - {"P5 Button 4", BIT_DIGITAL, PCEJoy5 + 9, "p5 fire 4" }, - {"P5 Button 5", BIT_DIGITAL, PCEJoy5 + 10, "p5 fire 5" }, - {"P5 Button 6", BIT_DIGITAL, PCEJoy5 + 11, "p5 fire 6" }, - - {"Reset", BIT_DIGITAL, &PCEReset, "reset" }, // 60 - {"Dip A", BIT_DIPSWITCH, PCEDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, PCEDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, PCEDips + 2, "dip" }, -}; - -STDINPUTINFO(pce) - -static struct BurnDIPInfo pceDIPList[] = { - {0x3d, 0xff, 0xff, 0x00, NULL }, - {0x3e, 0xff, 0xff, 0x00, NULL }, - {0x3f, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Joystick Type Player 1" }, - {0x3d, 0x01, 0x03, 0x00, "2-buttons" }, - {0x3d, 0x01, 0x03, 0x02, "6-buttons" }, - - {0 , 0xfe, 0 , 2, "Joystick Type Player 2" }, - {0x3d, 0x01, 0x0c, 0x00, "2-buttons" }, - {0x3d, 0x01, 0x0c, 0x08, "6-buttons" }, - - {0 , 0xfe, 0 , 2, "Joystick Type Player 3" }, - {0xdd, 0x01, 0x30, 0x00, "2-buttons" }, - {0x3d, 0x01, 0x30, 0x20, "6-buttons" }, - - {0 , 0xfe, 0 , 2, "Joystick Type Player 4" }, - {0x3d, 0x01, 0xc0, 0x00, "2-buttons" }, - {0x3d, 0x01, 0xc0, 0x80, "6-buttons" }, - - {0 , 0xfe, 0 , 2, "Joystick Type Player 5" }, - {0x3e, 0x01, 0x03, 0x00, "2-buttons" }, - {0x3e, 0x01, 0x03, 0x02, "6-buttons" }, - - {0 , 0xfe, 0 , 2, "Arcade Card" }, - {0x3f, 0x01, 0x01, 0x00, "Off" }, - {0x3f, 0x01, 0x01, 0x01, "On" }, -}; - -STDDIPINFO(pce) - -// 1943 Kai - -static struct BurnRomInfo pce_1943kaiRomDesc[] = { - { "1943 kai (japan).pce", 0x080000, 0xfde08d6d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_1943kai) -STD_ROM_FN(pce_1943kai) - -struct BurnDriver BurnDrvpce_1943kai = { - "pce_1943kai", NULL, NULL, NULL, "1991", - "1943 Kai\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_1943kaiRomInfo, pce_1943kaiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// 21 Emon - Mezase Hotel ou!! - -static struct BurnRomInfo pce_21emonRomDesc[] = { - { "21 emon - mezase hotel ou!! (japan).pce", 0x080000, 0x73614660, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_21emon) -STD_ROM_FN(pce_21emon) - -struct BurnDriver BurnDrvpce_21emon = { - "pce_21emon", NULL, NULL, NULL, "1994", - "21 Emon - Mezase Hotel ou!!\0", NULL, "NEC Home Electronics", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_21emonRomInfo, pce_21emonRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Adventure Island - -static struct BurnRomInfo pce_advislndRomDesc[] = { - { "adventure island (japan).pce", 0x040000, 0x8e71d4f3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_advislnd) -STD_ROM_FN(pce_advislnd) - -struct BurnDriver BurnDrvpce_advislnd = { - "pce_advislnd", NULL, NULL, NULL, "1991", - "Adventure Island\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_advislndRomInfo, pce_advislndRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Aero Blasters - -static struct BurnRomInfo pce_aeroblstRomDesc[] = { - { "aero blasters (japan).pce", 0x080000, 0x25be2b81, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_aeroblst) -STD_ROM_FN(pce_aeroblst) - -struct BurnDriver BurnDrvpce_aeroblst = { - "pce_aeroblst", NULL, NULL, NULL, "1990", - "Aero Blasters\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_aeroblstRomInfo, pce_aeroblstRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// After Burner II - -static struct BurnRomInfo pce_aburner2RomDesc[] = { - { "after burner ii (japan).pce", 0x080000, 0xca72a828, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_aburner2) -STD_ROM_FN(pce_aburner2) - -struct BurnDriver BurnDrvpce_aburner2 = { - "pce_aburner2", NULL, NULL, NULL, "1990", - "After Burner II\0", NULL, "NEC Avenue", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_aburner2RomInfo, pce_aburner2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Alien Crush - -static struct BurnRomInfo pce_acrushRomDesc[] = { - { "alien crush (japan).pce", 0x040000, 0x60edf4e1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_acrush) -STD_ROM_FN(pce_acrush) - -struct BurnDriver BurnDrvpce_acrush = { - "pce_acrush", NULL, NULL, NULL, "1988", - "Alien Crush\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_acrushRomInfo, pce_acrushRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ankoku Densetsu - -static struct BurnRomInfo pce_ankokuRomDesc[] = { - { "ankoku densetsu (japan).pce", 0x040000, 0xcacc06fb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ankoku) -STD_ROM_FN(pce_ankoku) - -struct BurnDriver BurnDrvpce_ankoku = { - "pce_ankoku", NULL, NULL, NULL, "1990", - "Ankoku Densetsu\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ankokuRomInfo, pce_ankokuRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Aoi Blink - -static struct BurnRomInfo pce_aoiblinkRomDesc[] = { - { "aoi blink (japan).pce", 0x060000, 0x08a09b9a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_aoiblink) -STD_ROM_FN(pce_aoiblink) - -struct BurnDriver BurnDrvpce_aoiblink = { - "pce_aoiblink", NULL, NULL, NULL, "1990", - "Aoi Blink\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_aoiblinkRomInfo, pce_aoiblinkRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Appare! Gateball - -static struct BurnRomInfo pce_appgatebRomDesc[] = { - { "appare gateball (japan).pce", 0x040000, 0x2b54cba2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_appgateb) -STD_ROM_FN(pce_appgateb) - -struct BurnDriver BurnDrvpce_appgateb = { - "pce_appgateb", NULL, NULL, NULL, "1988", - "Appare! Gateball\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_appgatebRomInfo, pce_appgatebRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Armed Formation F - -static struct BurnRomInfo pce_armedfRomDesc[] = { - { "armed formation f (japan).pce", 0x040000, 0x20ef87fd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_armedf) -STD_ROM_FN(pce_armedf) - -struct BurnDriver BurnDrvpce_armedf = { - "pce_armedf", NULL, NULL, NULL, "1990", - "Armed Formation F\0", NULL, "Pack-In-Video", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_armedfRomInfo, pce_armedfRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Artist Tool - -static struct BurnRomInfo pce_arttoolRomDesc[] = { - { "artist tool (japan).pce", 0x040000, 0x5e4fa713, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_arttool) -STD_ROM_FN(pce_arttool) - -struct BurnDriver BurnDrvpce_arttool = { - "pce_arttool", NULL, NULL, NULL, "1990", - "Artist Tool\0", NULL, "NEC Home Electronics", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_arttoolRomInfo, pce_arttoolRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Atomic Robo-kid Special - -static struct BurnRomInfo pce_atomroboRomDesc[] = { - { "atomic robo-kid special (japan).pce", 0x080000, 0xdd175efd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_atomrobo) -STD_ROM_FN(pce_atomrobo) - -struct BurnDriver BurnDrvpce_atomrobo = { - "pce_atomrobo", NULL, NULL, NULL, "1990", - "Atomic Robo-kid Special\0", NULL, "UPL", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_atomroboRomInfo, pce_atomroboRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// AV Poker - -static struct BurnRomInfo pce_avpokerRomDesc[] = { - { "av poker (japan).pce", 0x080000, 0xb866d282, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_avpoker) -STD_ROM_FN(pce_avpoker) - -struct BurnDriver BurnDrvpce_avpoker = { - "pce_avpoker", NULL, NULL, NULL, "1992", - "AV Poker\0", NULL, "Games Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_avpokerRomInfo, pce_avpokerRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ballistix - -static struct BurnRomInfo pce_ballistxRomDesc[] = { - { "ballistix (japan).pce", 0x040000, 0x8acfc8aa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ballistx) -STD_ROM_FN(pce_ballistx) - -struct BurnDriver BurnDrvpce_ballistx = { - "pce_ballistx", NULL, NULL, NULL, "1991", - "Ballistix\0", NULL, "Coconuts Japan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ballistxRomInfo, pce_ballistxRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bari Bari Densetsu - -static struct BurnRomInfo pce_baribariRomDesc[] = { - { "bari bari densetsu (japan).pce", 0x060000, 0xc267e25d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_baribari) -STD_ROM_FN(pce_baribari) - -struct BurnDriver BurnDrvpce_baribari = { - "pce_baribari", NULL, NULL, NULL, "1989", - "Bari Bari Densetsu\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_baribariRomInfo, pce_baribariRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Barunba - -static struct BurnRomInfo pce_barunbaRomDesc[] = { - { "barunba (japan).pce", 0x080000, 0x4a3df3ca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_barunba) -STD_ROM_FN(pce_barunba) - -struct BurnDriver BurnDrvpce_barunba = { - "pce_barunba", NULL, NULL, NULL, "1990", - "Barunba\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_barunbaRomInfo, pce_barunbaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Batman - -static struct BurnRomInfo pce_batmanRomDesc[] = { - { "batman (japan).pce", 0x060000, 0x106bb7b2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_batman) -STD_ROM_FN(pce_batman) - -struct BurnDriver BurnDrvpce_batman = { - "pce_batman", NULL, NULL, NULL, "1990", - "Batman\0", NULL, "Sunsoft", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_batmanRomInfo, pce_batmanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Battle Lode Runner - -static struct BurnRomInfo pce_batloderRomDesc[] = { - { "battle lode runner (japan).pce", 0x040000, 0x59e44f45, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_batloder) -STD_ROM_FN(pce_batloder) - -struct BurnDriver BurnDrvpce_batloder = { - "pce_batloder", NULL, NULL, NULL, "1993", - "Battle Lode Runner\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_batloderRomInfo, pce_batloderRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Be Ball - -static struct BurnRomInfo pce_beballRomDesc[] = { - { "be ball (japan).pce", 0x040000, 0xe439f299, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_beball) -STD_ROM_FN(pce_beball) - -struct BurnDriver BurnDrvpce_beball = { - "pce_beball", NULL, NULL, NULL, "1990", - "Be Ball\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_beballRomInfo, pce_beballRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Benkei Gaiden - -static struct BurnRomInfo pce_benkeiRomDesc[] = { - { "benkei gaiden (japan).pce", 0x060000, 0xe1a73797, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_benkei) -STD_ROM_FN(pce_benkei) - -struct BurnDriverD BurnDrvpce_benkei = { - "pce_benkei", NULL, NULL, NULL, "1989", - "Benkei Gaiden\0", NULL, "Sunsoft", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_benkeiRomInfo, pce_benkeiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Benkei Gaiden (Alt) - -static struct BurnRomInfo pce_benkei1RomDesc[] = { - { "benkei gaiden (japan) [a].pce", 0x060000, 0xc9626a43, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_benkei1) -STD_ROM_FN(pce_benkei1) - -struct BurnDriverD BurnDrvpce_benkei1 = { - "pce_benkei1", "pce_benkei", NULL, NULL, "1989", - "Benkei Gaiden (Alt)\0", NULL, "Sunsoft", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_benkei1RomInfo, pce_benkei1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bikkuriman World - -static struct BurnRomInfo pce_bikkuriRomDesc[] = { - { "bikkuriman world (japan).pce", 0x040000, 0x2841fd1e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bikkuri) -STD_ROM_FN(pce_bikkuri) - -struct BurnDriver BurnDrvpce_bikkuri = { - "pce_bikkuri", NULL, NULL, NULL, "1987", - "Bikkuriman World\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bikkuriRomInfo, pce_bikkuriRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bikkuriman World (Alt) - -static struct BurnRomInfo pce_bikkuri1RomDesc[] = { - { "bikkuriman world (japan) [a].pce", 0x040000, 0x34893891, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bikkuri1) -STD_ROM_FN(pce_bikkuri1) - -struct BurnDriver BurnDrvpce_bikkuri1 = { - "pce_bikkuri1", "pce_bikkuri", NULL, NULL, "1987", - "Bikkuriman World (Alt)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bikkuri1RomInfo, pce_bikkuri1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Blodia - -static struct BurnRomInfo pce_blodiaRomDesc[] = { - { "blodia (japan).pce", 0x020000, 0x958bcd09, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_blodia) -STD_ROM_FN(pce_blodia) - -struct BurnDriver BurnDrvpce_blodia = { - "pce_blodia", NULL, NULL, NULL, "1990", - "Blodia\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_blodiaRomInfo, pce_blodiaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Body Conquest II - -static struct BurnRomInfo pce_bodycon2RomDesc[] = { - { "body conquest ii (japan).pce", 0x080000, 0xffd92458, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bodycon2) -STD_ROM_FN(pce_bodycon2) - -struct BurnDriver BurnDrvpce_bodycon2 = { - "pce_bodycon2", NULL, NULL, NULL, "1993", - "Body Conquest II\0", NULL, "Games Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bodycon2RomInfo, pce_bodycon2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bomberman '93 - -static struct BurnRomInfo pce_bombmn93RomDesc[] = { - { "bomberman '93 (japan).pce", 0x080000, 0xb300c5d0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bombmn93) -STD_ROM_FN(pce_bombmn93) - -struct BurnDriver BurnDrvpce_bombmn93 = { - "pce_bombmn93", NULL, NULL, NULL, "1992", - "Bomberman '93\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bombmn93RomInfo, pce_bombmn93RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bomberman '93 (Special Version) - -static struct BurnRomInfo pce_bombmn93sRomDesc[] = { - { "bomberman '93 (special version) (japan).pce", 0x080000, 0x02309aa0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bombmn93s) -STD_ROM_FN(pce_bombmn93s) - -struct BurnDriver BurnDrvpce_bombmn93s = { - "pce_bombmn93s", "pce_bombmn93", NULL, NULL, "1992", - "Bomberman '93 (Special Version)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bombmn93sRomInfo, pce_bombmn93sRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bomberman '94 - -static struct BurnRomInfo pce_bombmn94RomDesc[] = { - { "bomberman '94 (japan).pce", 0x100000, 0x05362516, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bombmn94) -STD_ROM_FN(pce_bombmn94) - -struct BurnDriver BurnDrvpce_bombmn94 = { - "pce_bombmn94", NULL, NULL, NULL, "1993", - "Bomberman '94\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bombmn94RomInfo, pce_bombmn94RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bomberman - -static struct BurnRomInfo pce_bombmanRomDesc[] = { - { "bomberman (japan).pce", 0x040000, 0x9abb4d1f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bombman) -STD_ROM_FN(pce_bombman) - -struct BurnDriver BurnDrvpce_bombman = { - "pce_bombman", NULL, NULL, NULL, "1990", - "Bomberman\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bombmanRomInfo, pce_bombmanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bomberman - Users Battle - -static struct BurnRomInfo pce_bombmnubRomDesc[] = { - { "bomberman - users battle (japan).pce", 0x040000, 0x1489fa51, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bombmnub) -STD_ROM_FN(pce_bombmnub) - -struct BurnDriver BurnDrvpce_bombmnub = { - "pce_bombmnub", NULL, NULL, NULL, "19??", - "Bomberman - Users Battle\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bombmnubRomInfo, pce_bombmnubRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bouken Danshaku Don - The Lost Sunheart - -static struct BurnRomInfo pce_lostsunhRomDesc[] = { - { "bouken danshaku don - the lost sunheart (japan).pce", 0x080000, 0x8f4d9f94, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_lostsunh) -STD_ROM_FN(pce_lostsunh) - -struct BurnDriver BurnDrvpce_lostsunh = { - "pce_lostsunh", NULL, NULL, NULL, "1992", - "Bouken Danshaku Don - The Lost Sunheart\0", "Bad sound", "IMax", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_lostsunhRomInfo, pce_lostsunhRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Break In - -static struct BurnRomInfo pce_breakinRomDesc[] = { - { "break in (japan).pce", 0x040000, 0xc9d7426a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_breakin) -STD_ROM_FN(pce_breakin) - -struct BurnDriver BurnDrvpce_breakin = { - "pce_breakin", NULL, NULL, NULL, "1989", - "Break In\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_breakinRomInfo, pce_breakinRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bubblegum Crash! - Knight Sabers 2034 - -static struct BurnRomInfo pce_bubblegmRomDesc[] = { - { "bubblegum crash! - knight sabers 2034 (japan).pce", 0x080000, 0x0d766139, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bubblegm) -STD_ROM_FN(pce_bubblegm) - -struct BurnDriver BurnDrvpce_bubblegm = { - "pce_bubblegm", NULL, NULL, NULL, "1991", - "Bubblegum Crash! - Knight Sabers 2034\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bubblegmRomInfo, pce_bubblegmRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bull Fight - Ring no Haja - -static struct BurnRomInfo pce_bullfghtRomDesc[] = { - { "bull fight - ring no haja (japan).pce", 0x060000, 0x5c4d1991, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bullfght) -STD_ROM_FN(pce_bullfght) - -struct BurnDriver BurnDrvpce_bullfght = { - "pce_bullfght", NULL, NULL, NULL, "1989", - "Bull Fight - Ring no Haja\0", NULL, "Cream", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bullfghtRomInfo, pce_bullfghtRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Burning Angels - -static struct BurnRomInfo pce_burnanglRomDesc[] = { - { "burning angels (japan).pce", 0x060000, 0xd233c05a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_burnangl) -STD_ROM_FN(pce_burnangl) - -struct BurnDriver BurnDrvpce_burnangl = { - "pce_burnangl", NULL, NULL, NULL, "1990", - "Burning Angels\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_burnanglRomInfo, pce_burnanglRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Busou Keiji - Cyber Cross - -static struct BurnRomInfo pce_cyberxRomDesc[] = { - { "busou keiji - cyber cross (japan).pce", 0x060000, 0xd0c250ca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_cyberx) -STD_ROM_FN(pce_cyberx) - -struct BurnDriver BurnDrvpce_cyberx = { - "pce_cyberx", NULL, NULL, NULL, "1989", - "Busou Keiji - Cyber Cross\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_cyberxRomInfo, pce_cyberxRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Cadash - -static struct BurnRomInfo pce_cadashRomDesc[] = { - { "cadash (japan).pce", 0x060000, 0x8dc0d85f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_cadash) -STD_ROM_FN(pce_cadash) - -struct BurnDriver BurnDrvpce_cadash = { - "pce_cadash", NULL, NULL, NULL, "1991", - "Cadash\0", "Bad graphics", "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_cadashRomInfo, pce_cadashRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Champion Wrestler - -static struct BurnRomInfo pce_champwrsRomDesc[] = { - { "champion wrestler (japan).pce", 0x060000, 0x9edc0aea, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_champwrs) -STD_ROM_FN(pce_champwrs) - -struct BurnDriver BurnDrvpce_champwrs = { - "pce_champwrs", NULL, NULL, NULL, "1990", - "Champion Wrestler\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_champwrsRomInfo, pce_champwrsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Chibi Maruko Chan - Quiz de Piihyara - -static struct BurnRomInfo pce_chibimRomDesc[] = { - { "chibi maruko chan - quiz de piihyara (japan).pce", 0x080000, 0x951ed380, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_chibim) -STD_ROM_FN(pce_chibim) - -struct BurnDriver BurnDrvpce_chibim = { - "pce_chibim", NULL, NULL, NULL, "1992", - "Chibi Maruko Chan - Quiz de Piihyara\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_chibimRomInfo, pce_chibimRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Chikudenya Toubei - Kubikiri Yakata Yori - -static struct BurnRomInfo pce_chikudenRomDesc[] = { - { "chikudenya toubei - kubikiri yakata yori (japan).pce", 0x080000, 0xcab21b2e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_chikuden) -STD_ROM_FN(pce_chikuden) - -struct BurnDriver BurnDrvpce_chikuden = { - "pce_chikuden", NULL, NULL, NULL, "1990", - "Chikudenya Toubei - Kubikiri Yakata Yori\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_chikudenRomInfo, pce_chikudenRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Chikudenya Toubei - Kubikiri Yakata Yori (Alt) - -static struct BurnRomInfo pce_chikuden1RomDesc[] = { - { "chikudenya toubei - kubikiri yakata yori (japan) [a].pce", 0x080000, 0x84098884, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_chikuden1) -STD_ROM_FN(pce_chikuden1) - -struct BurnDriver BurnDrvpce_chikuden1 = { - "pce_chikuden1", "pce_chikuden", NULL, NULL, "1990", - "Chikudenya Toubei - Kubikiri Yakata Yori (Alt)\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_chikuden1RomInfo, pce_chikuden1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Chouzetsu Rinjin - Bravoman - -static struct BurnRomInfo pce_bravomanRomDesc[] = { - { "chouzetsu rinjin - bravoman (japan).pce", 0x080000, 0x0df57c90, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_bravoman) -STD_ROM_FN(pce_bravoman) - -struct BurnDriver BurnDrvpce_bravoman = { - "pce_bravoman", NULL, NULL, NULL, "1990", - "Chouzetsu Rinjin - Bravoman\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_bravomanRomInfo, pce_bravomanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Circus Lido - -static struct BurnRomInfo pce_circusldRomDesc[] = { - { "circus lido (japan).pce", 0x040000, 0xc3212c24, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_circusld) -STD_ROM_FN(pce_circusld) - -struct BurnDriver BurnDrvpce_circusld = { - "pce_circusld", NULL, NULL, NULL, "1991", - "Circus Lido\0", NULL, "Yuni Post", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_circusldRomInfo, pce_circusldRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// City Hunter - -static struct BurnRomInfo pce_cityhuntRomDesc[] = { - { "city hunter (japan).pce", 0x060000, 0xf91b055f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_cityhunt) -STD_ROM_FN(pce_cityhunt) - -struct BurnDriver BurnDrvpce_cityhunt = { - "pce_cityhunt", NULL, NULL, NULL, "1990", - "City Hunter\0", NULL, "Sunsoft", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_cityhuntRomInfo, pce_cityhuntRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Columns - -static struct BurnRomInfo pce_columnsRomDesc[] = { - { "columns (japan).pce", 0x020000, 0x99f7a572, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_columns) -STD_ROM_FN(pce_columns) - -struct BurnDriver BurnDrvpce_columns = { - "pce_columns", NULL, NULL, NULL, "1991", - "Columns\0", NULL, "Nihon Telenet", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_columnsRomInfo, pce_columnsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Coryoon - Child of Dragon - -static struct BurnRomInfo pce_coryoonRomDesc[] = { - { "coryoon - child of dragon (japan).pce", 0x080000, 0xb4d29e3b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_coryoon) -STD_ROM_FN(pce_coryoon) - -struct BurnDriver BurnDrvpce_coryoon = { - "pce_coryoon", NULL, NULL, NULL, "1991", - "Coryoon - Child of Dragon\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_coryoonRomInfo, pce_coryoonRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Coryoon - Child of Dragon (Alt) - -static struct BurnRomInfo pce_coryoon1RomDesc[] = { - { "coryoon - child of dragon (japan) [a].pce", 0x080000, 0xd5389889, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_coryoon1) -STD_ROM_FN(pce_coryoon1) - -struct BurnDriver BurnDrvpce_coryoon1 = { - "pce_coryoon1", "pce_coryoon", NULL, NULL, "1991", - "Coryoon - Child of Dragon (Alt)\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_coryoon1RomInfo, pce_coryoon1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Cross Wiber - Cyber Combat Police - -static struct BurnRomInfo pce_xwiberRomDesc[] = { - { "cross wiber - cyber combat police (japan).pce", 0x080000, 0x2df97bd0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_xwiber) -STD_ROM_FN(pce_xwiber) - -struct BurnDriver BurnDrvpce_xwiber = { - "pce_xwiber", NULL, NULL, NULL, "1990", - "Cross Wiber - Cyber Combat Police\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_xwiberRomInfo, pce_xwiberRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Cyber Core - -static struct BurnRomInfo pce_cybrcoreRomDesc[] = { - { "cyber core (japan).pce", 0x060000, 0xa98d276a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_cybrcore) -STD_ROM_FN(pce_cybrcore) - -struct BurnDriver BurnDrvpce_cybrcore = { - "pce_cybrcore", NULL, NULL, NULL, "1990", - "Cyber Core\0", NULL, "IGS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_cybrcoreRomInfo, pce_cybrcoreRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Cyber Dodge - -static struct BurnRomInfo pce_cyberdodRomDesc[] = { - { "cyber dodge (japan).pce", 0x080000, 0xb5326b16, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_cyberdod) -STD_ROM_FN(pce_cyberdod) - -struct BurnDriver BurnDrvpce_cyberdod = { - "pce_cyberdod", NULL, NULL, NULL, "1992", - "Cyber Dodge\0", NULL, "Tonkin House", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_cyberdodRomInfo, pce_cyberdodRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Cyber Knight - -static struct BurnRomInfo pce_cyknightRomDesc[] = { - { "cyber knight (japan).pce", 0x080000, 0xa594fac0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_cyknight) -STD_ROM_FN(pce_cyknight) - -struct BurnDriver BurnDrvpce_cyknight = { - "pce_cyknight", NULL, NULL, NULL, "1990", - "Cyber Knight\0", NULL, "Tonkin House", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_cyknightRomInfo, pce_cyknightRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dai Senpu - -static struct BurnRomInfo pce_daisenpuRomDesc[] = { - { "dai senpu (japan).pce", 0x080000, 0x9107bcc8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_daisenpu) -STD_ROM_FN(pce_daisenpu) - -struct BurnDriver BurnDrvpce_daisenpu = { - "pce_daisenpu", NULL, NULL, NULL, "1990", - "Dai Senpu\0", NULL, "NEC Avenue", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_daisenpuRomInfo, pce_daisenpuRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Daichi Kun Crisis - Do Natural - -static struct BurnRomInfo pce_donaturlRomDesc[] = { - { "daichi kun crisis - do natural (japan).pce", 0x060000, 0x61a2935f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_donaturl) -STD_ROM_FN(pce_donaturl) - -struct BurnDriver BurnDrvpce_donaturl = { - "pce_donaturl", NULL, NULL, NULL, "1989", - "Daichi Kun Crisis - Do Natural\0", NULL, "Salio", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_donaturlRomInfo, pce_donaturlRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Darius Alpha - -static struct BurnRomInfo pce_dariusaRomDesc[] = { - { "darius alpha (japan).pce", 0x060000, 0xb0ba689f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dariusa) -STD_ROM_FN(pce_dariusa) - -struct BurnDriver BurnDrvpce_dariusa = { - "pce_dariusa", NULL, NULL, NULL, "1990", - "Darius Alpha\0", NULL, "NEC Avenue", "SuperGrafx Enhanced", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_dariusaRomInfo, pce_dariusaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - SGXInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Darius Plus - -static struct BurnRomInfo pce_dariuspRomDesc[] = { - { "darius plus (japan).pce", 0x0c0000, 0xbebfe042, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dariusp) -STD_ROM_FN(pce_dariusp) - -struct BurnDriver BurnDrvpce_dariusp = { - "pce_dariusp", NULL, NULL, NULL, "1990", - "Darius Plus\0", NULL, "NEC Avenue", "SuperGrafx Enhanced", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_dariuspRomInfo, pce_dariuspRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - SGXInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dead Moon - Tsuki Sekai no Akumu - -static struct BurnRomInfo pce_deadmoonRomDesc[] = { - { "dead moon (japan).pce", 0x080000, 0x56739bc7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_deadmoon) -STD_ROM_FN(pce_deadmoon) - -struct BurnDriver BurnDrvpce_deadmoon = { - "pce_deadmoon", NULL, NULL, NULL, "1990", - "Dead Moon - Tsuki Sekai no Akumu\0", NULL, "B.S.S.", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_deadmoonRomInfo, pce_deadmoonRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Deep Blue - Kaitei Shinwa - -static struct BurnRomInfo pce_deepblueRomDesc[] = { - { "deep blue - kaitei shinwa (japan).pce", 0x040000, 0x053a0f83, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_deepblue) -STD_ROM_FN(pce_deepblue) - -struct BurnDriver BurnDrvpce_deepblue = { - "pce_deepblue", NULL, NULL, NULL, "1989", - "Deep Blue - Kaitei Shinwa\0", NULL, "Pack-In-Video", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_deepblueRomInfo, pce_deepblueRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Detana!! Twinbee - -static struct BurnRomInfo pce_twinbeeRomDesc[] = { - { "detana!! twinbee (japan).pce", 0x080000, 0x5cf59d80, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_twinbee) -STD_ROM_FN(pce_twinbee) - -struct BurnDriver BurnDrvpce_twinbee = { - "pce_twinbee", NULL, NULL, NULL, "1992", - "Detana!! Twinbee\0", NULL, "Konami", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_twinbeeRomInfo, pce_twinbeeRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Devil Crash - Naxat Pinball - -static struct BurnRomInfo pce_devlcrshRomDesc[] = { - { "devil crash - naxat pinball (japan).pce", 0x060000, 0x4ec81a80, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_devlcrsh) -STD_ROM_FN(pce_devlcrsh) - -struct BurnDriver BurnDrvpce_devlcrsh = { - "pce_devlcrsh", NULL, NULL, NULL, "1990", - "Devil Crash - Naxat Pinball\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_devlcrshRomInfo, pce_devlcrshRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Die Hard - -static struct BurnRomInfo pce_diehardRomDesc[] = { - { "die hard (japan).pce", 0x080000, 0x1b5b1cb1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_diehard) -STD_ROM_FN(pce_diehard) - -struct BurnDriver BurnDrvpce_diehard = { - "pce_diehard", NULL, NULL, NULL, "1990", - "Die Hard\0", NULL, "Pack-In-Video", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_diehardRomInfo, pce_diehardRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Digital Champ - -static struct BurnRomInfo pce_digichmpRomDesc[] = { - { "digital champ (japan).pce", 0x040000, 0x17ba3032, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_digichmp) -STD_ROM_FN(pce_digichmp) - -struct BurnDriver BurnDrvpce_digichmp = { - "pce_digichmp", NULL, NULL, NULL, "1989", - "Digital Champ\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_digichmpRomInfo, pce_digichmpRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Don Doko Don! - -static struct BurnRomInfo pce_dondokoRomDesc[] = { - { "don doko don! (japan).pce", 0x060000, 0xf42aa73e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dondoko) -STD_ROM_FN(pce_dondoko) - -struct BurnDriver BurnDrvpce_dondoko = { - "pce_dondoko", NULL, NULL, NULL, "1990", - "Don Doko Don!\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_dondokoRomInfo, pce_dondokoRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Doraemon - Meikyuu Dai Sakusen - -static struct BurnRomInfo pce_doramsRomDesc[] = { - { "doraemon - meikyuu dai sakusen (japan).pce", 0x040000, 0xdc760a07, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dorams) -STD_ROM_FN(pce_dorams) - -struct BurnDriver BurnDrvpce_dorams = { - "pce_dorams", NULL, NULL, NULL, "1989", - "Doraemon - Meikyuu Dai Sakusen\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_doramsRomInfo, pce_doramsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Doraemon - Nobita no Dorabian Night - -static struct BurnRomInfo pce_dorandnRomDesc[] = { - { "doraemon - nobita no dorabian night (japan).pce", 0x080000, 0x013a747f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dorandn) -STD_ROM_FN(pce_dorandn) - -struct BurnDriver BurnDrvpce_dorandn = { - "pce_dorandn", NULL, NULL, NULL, "1991", - "Doraemon - Nobita no Dorabian Night\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_dorandnRomInfo, pce_dorandnRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Double Dungeons - W - -static struct BurnRomInfo pce_ddungwRomDesc[] = { - { "double dungeons - w (japan).pce", 0x040000, 0x86087b39, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ddungw) -STD_ROM_FN(pce_ddungw) - -struct BurnDriver BurnDrvpce_ddungw = { - "pce_ddungw", NULL, NULL, NULL, "1989", - "Double Dungeons - W\0", NULL, "NCS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ddungwRomInfo, pce_ddungwRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Download - -static struct BurnRomInfo pce_downloadRomDesc[] = { - { "download (japan).pce", 0x080000, 0x85101c20, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_download) -STD_ROM_FN(pce_download) - -struct BurnDriver BurnDrvpce_download = { - "pce_download", NULL, NULL, NULL, "1990", - "Download\0", NULL, "NEC Avenue", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_downloadRomInfo, pce_downloadRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Download (Alt) - -static struct BurnRomInfo pce_download1RomDesc[] = { - { "download (japan) [a].pce", 0x080000, 0x4e0de488, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_download1) -STD_ROM_FN(pce_download1) - -struct BurnDriver BurnDrvpce_download1 = { - "pce_download1", "pce_download", NULL, NULL, "1990", - "Download (Alt)\0", NULL, "NEC Avenue", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_download1RomInfo, pce_download1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dragon Egg! - -static struct BurnRomInfo pce_dragneggRomDesc[] = { - { "dragon egg! (japan).pce", 0x080000, 0x442405d5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dragnegg) -STD_ROM_FN(pce_dragnegg) - -struct BurnDriver BurnDrvpce_dragnegg = { - "pce_dragnegg", NULL, NULL, NULL, "1991", - "Dragon Egg!\0", NULL, "Masiya", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_dragneggRomInfo, pce_dragneggRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dragon Saber - After Story of Dragon Spirit - -static struct BurnRomInfo pce_dsaberRomDesc[] = { - { "dragon saber - after story of dragon spirit (japan).pce", 0x080000, 0x3219849c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dsaber) -STD_ROM_FN(pce_dsaber) - -struct BurnDriver BurnDrvpce_dsaber = { - "pce_dsaber", NULL, NULL, NULL, "1991", - "Dragon Saber - After Story of Dragon Spirit\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_dsaberRomInfo, pce_dsaberRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dragon Saber - After Story of Dragon Spirit (Alt) - -static struct BurnRomInfo pce_dsaber1RomDesc[] = { - { "dragon saber - after story of dragon spirit (japan) [a].pce", 0x080000, 0xc89ce75a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dsaber1) -STD_ROM_FN(pce_dsaber1) - -struct BurnDriver BurnDrvpce_dsaber1 = { - "pce_dsaber1", "pce_dsaber", NULL, NULL, "1991", - "Dragon Saber - After Story of Dragon Spirit (Alt)\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_dsaber1RomInfo, pce_dsaber1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dragon Spirit - -static struct BurnRomInfo pce_dspiritRomDesc[] = { - { "dragon spirit (japan).pce", 0x040000, 0x01a76935, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dspirit) -STD_ROM_FN(pce_dspirit) - -struct BurnDriver BurnDrvpce_dspirit = { - "pce_dspirit", NULL, NULL, NULL, "1988", - "Dragon Spirit\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_dspiritRomInfo, pce_dspiritRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Drop Rock Hora Hora - -static struct BurnRomInfo pce_droprockRomDesc[] = { - { "drop rock hora hora (japan).pce", 0x040000, 0x67ec5ec4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_droprock) -STD_ROM_FN(pce_droprock) - -struct BurnDriver BurnDrvpce_droprock = { - "pce_droprock", NULL, NULL, NULL, "1990", - "Drop Rock Hora Hora\0", NULL, "Data East", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_droprockRomInfo, pce_droprockRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Drop Rock Hora Hora (Alt) - -static struct BurnRomInfo pce_droprock1RomDesc[] = { - { "drop rock hora hora (japan) [a].pce", 0x040000, 0x8e81fcac, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_droprock1) -STD_ROM_FN(pce_droprock1) - -struct BurnDriver BurnDrvpce_droprock1 = { - "pce_droprock1", "pce_droprock", NULL, NULL, "1990", - "Drop Rock Hora Hora (Alt)\0", NULL, "Data East", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_droprock1RomInfo, pce_droprock1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dungeon Explorer - -static struct BurnRomInfo pce_dungexplRomDesc[] = { - { "dungeon explorer (japan).pce", 0x060000, 0x1b1a80a2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_dungexpl) -STD_ROM_FN(pce_dungexpl) - -struct BurnDriver BurnDrvpce_dungexpl = { - "pce_dungexpl", NULL, NULL, NULL, "1989", - "Dungeon Explorer\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_dungexplRomInfo, pce_dungexplRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Energy - -static struct BurnRomInfo pce_energyRomDesc[] = { - { "energy (japan).pce", 0x040000, 0xca68ff21, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_energy) -STD_ROM_FN(pce_energy) - -struct BurnDriver BurnDrvpce_energy = { - "pce_energy", NULL, NULL, NULL, "1989", - "Energy\0", NULL, "NCS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_energyRomInfo, pce_energyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// F-1 Dream - -static struct BurnRomInfo pce_f1dreamRomDesc[] = { - { "f-1 dream (japan).pce", 0x040000, 0xd50ff730, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_f1dream) -STD_ROM_FN(pce_f1dream) - -struct BurnDriver BurnDrvpce_f1dream = { - "pce_f1dream", NULL, NULL, NULL, "1989", - "F-1 Dream\0", NULL, "NEC", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_f1dreamRomInfo, pce_f1dreamRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// F-1 Pilot - You're King of Kings - -static struct BurnRomInfo pce_f1pilotRomDesc[] = { - { "f-1 pilot - you're king of kings (japan).pce", 0x060000, 0x09048174, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_f1pilot) -STD_ROM_FN(pce_f1pilot) - -struct BurnDriver BurnDrvpce_f1pilot = { - "pce_f1pilot", NULL, NULL, NULL, "1989", - "F-1 Pilot - You're King of Kings\0", NULL, "Pack-In-Video", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_f1pilotRomInfo, pce_f1pilotRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// F1 Circus '91 - World Championship - -static struct BurnRomInfo pce_f1circ91RomDesc[] = { - { "f1 circus '91 - world championship (japan).pce", 0x080000, 0xd7cfd70f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_f1circ91) -STD_ROM_FN(pce_f1circ91) - -struct BurnDriver BurnDrvpce_f1circ91 = { - "pce_f1circ91", NULL, NULL, NULL, "1991", - "F1 Circus '91 - World Championship\0", NULL, "Nihon Bussan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_f1circ91RomInfo, pce_f1circ91RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// F1 Circus '92 - The Speed of Sound - -static struct BurnRomInfo pce_f1circ92RomDesc[] = { - { "f1 circus '92 - the speed of sound (japan).pce", 0x0c0000, 0xb268f2a2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_f1circ92) -STD_ROM_FN(pce_f1circ92) - -struct BurnDriver BurnDrvpce_f1circ92 = { - "pce_f1circ92", NULL, NULL, NULL, "1992", - "F1 Circus '92 - The Speed of Sound\0", NULL, "Nihon Bussan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_f1circ92RomInfo, pce_f1circ92RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// F1 Circus - -static struct BurnRomInfo pce_f1circusRomDesc[] = { - { "f1 circus (japan).pce", 0x080000, 0xe14dee08, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_f1circus) -STD_ROM_FN(pce_f1circus) - -struct BurnDriver BurnDrvpce_f1circus = { - "pce_f1circus", NULL, NULL, NULL, "1990", - "F1 Circus\0", NULL, "Nihon Bussan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_f1circusRomInfo, pce_f1circusRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// F1 Circus (Alt) - -static struct BurnRomInfo pce_f1circus1RomDesc[] = { - { "f1 circus (japan) [a].pce", 0x080000, 0x79705779, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_f1circus1) -STD_ROM_FN(pce_f1circus1) - -struct BurnDriver BurnDrvpce_f1circus1 = { - "pce_f1circus1", "pce_f1circus", NULL, NULL, "1990", - "F1 Circus (Alt)\0", NULL, "Nihon Bussan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_f1circus1RomInfo, pce_f1circus1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// F1 Triple Battle - -static struct BurnRomInfo pce_f1tbRomDesc[] = { - { "f1 triple battle (japan).pce", 0x060000, 0x13bf0409, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_f1tb) -STD_ROM_FN(pce_f1tb) - -struct BurnDriver BurnDrvpce_f1tb = { - "pce_f1tb", NULL, NULL, NULL, "1989", - "F1 Triple Battle\0", NULL, "Human", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_f1tbRomInfo, pce_f1tbRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Fantasy Zone - -static struct BurnRomInfo pce_fantzoneRomDesc[] = { - { "fantasy zone (japan).pce", 0x040000, 0x72cb0f9d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_fantzone) -STD_ROM_FN(pce_fantzone) - -struct BurnDriver BurnDrvpce_fantzone = { - "pce_fantzone", NULL, NULL, NULL, "1988", - "Fantasy Zone\0", NULL, "NEC", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_fantzoneRomInfo, pce_fantzoneRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Fighting Run - -static struct BurnRomInfo pce_fightrunRomDesc[] = { - { "fighting run (japan).pce", 0x080000, 0x1828d2e5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_fightrun) -STD_ROM_FN(pce_fightrun) - -struct BurnDriver BurnDrvpce_fightrun = { - "pce_fightrun", NULL, NULL, NULL, "1991", - "Fighting Run\0", NULL, "Nihon Bussan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_fightrunRomInfo, pce_fightrunRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Final Blaster - -static struct BurnRomInfo pce_finlblstRomDesc[] = { - { "final blaster (japan).pce", 0x060000, 0xc90971ba, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_finlblst) -STD_ROM_FN(pce_finlblst) - -struct BurnDriver BurnDrvpce_finlblst = { - "pce_finlblst", NULL, NULL, NULL, "1990", - "Final Blaster\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_finlblstRomInfo, pce_finlblstRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Final Lap Twin - -static struct BurnRomInfo pce_finallapRomDesc[] = { - { "final lap twin (japan).pce", 0x060000, 0xc8c084e3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_finallap) -STD_ROM_FN(pce_finallap) - -struct BurnDriver BurnDrvpce_finallap = { - "pce_finallap", NULL, NULL, NULL, "1989", - "Final Lap Twin\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_finallapRomInfo, pce_finallapRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Final Match Tennis - -static struct BurnRomInfo pce_finalmtRomDesc[] = { - { "final match tennis (japan).pce", 0x040000, 0x560d2305, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_finalmt) -STD_ROM_FN(pce_finalmt) - -struct BurnDriver BurnDrvpce_finalmt = { - "pce_finalmt", NULL, NULL, NULL, "1991", - "Final Match Tennis\0", NULL, "Human", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_finalmtRomInfo, pce_finalmtRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Final Soldier - -static struct BurnRomInfo pce_finalsolRomDesc[] = { - { "final soldier (japan).pce", 0x080000, 0xaf2dd2af, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_finalsol) -STD_ROM_FN(pce_finalsol) - -struct BurnDriver BurnDrvpce_finalsol = { - "pce_finalsol", NULL, NULL, NULL, "1991", - "Final Soldier\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_finalsolRomInfo, pce_finalsolRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Final Soldier (Special Version) - -static struct BurnRomInfo pce_finalsolsRomDesc[] = { - { "final soldier (special version) (japan).pce", 0x080000, 0x02a578c5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_finalsols) -STD_ROM_FN(pce_finalsols) - -struct BurnDriver BurnDrvpce_finalsols = { - "pce_finalsols", "pce_finalsol", NULL, NULL, "19??", - "Final Soldier (Special Version)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_finalsolsRomInfo, pce_finalsolsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Fire Pro Wrestling - Combination Tag - -static struct BurnRomInfo pce_fireprowRomDesc[] = { - { "fire pro wrestling - combination tag (japan).pce", 0x060000, 0x90ed6575, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_fireprow) -STD_ROM_FN(pce_fireprow) - -struct BurnDriver BurnDrvpce_fireprow = { - "pce_fireprow", NULL, NULL, NULL, "1989", - "Fire Pro Wrestling - Combination Tag\0", NULL, "Human", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_fireprowRomInfo, pce_fireprowRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Fire Pro Wrestling 2 - 2nd Bout - -static struct BurnRomInfo pce_fireprw2RomDesc[] = { - { "fire pro wrestling 2 - 2nd bout (japan).pce", 0x080000, 0xe88987bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_fireprw2) -STD_ROM_FN(pce_fireprw2) - -struct BurnDriver BurnDrvpce_fireprw2 = { - "pce_fireprw2", NULL, NULL, NULL, "1991", - "Fire Pro Wrestling 2 - 2nd Bout\0", NULL, "Human", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_fireprw2RomInfo, pce_fireprw2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Fire Pro Wrestling 3 - Legend Bout - -static struct BurnRomInfo pce_fireprw3RomDesc[] = { - { "fire pro wrestling 3 - legend bout (japan).pce", 0x100000, 0x534e8808, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_fireprw3) -STD_ROM_FN(pce_fireprw3) - -struct BurnDriver BurnDrvpce_fireprw3 = { - "pce_fireprw3", NULL, NULL, NULL, "1992", - "Fire Pro Wrestling 3 - Legend Bout\0", NULL, "Human", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_fireprw3RomInfo, pce_fireprw3RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Formation Soccer - Human Cup '90 - -static struct BurnRomInfo pce_fsoccr90RomDesc[] = { - { "formation soccer - human cup '90 (japan).pce", 0x040000, 0x85a1e7b6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_fsoccr90) -STD_ROM_FN(pce_fsoccr90) - -struct BurnDriver BurnDrvpce_fsoccr90 = { - "pce_fsoccr90", NULL, NULL, NULL, "1990", - "Formation Soccer - Human Cup '90\0", NULL, "Human", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_fsoccr90RomInfo, pce_fsoccr90RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Formation Soccer - On J. League - -static struct BurnRomInfo pce_fsoccerRomDesc[] = { - { "formation soccer - on j. league (japan).pce", 0x080000, 0x7146027c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_fsoccer) -STD_ROM_FN(pce_fsoccer) - -struct BurnDriver BurnDrvpce_fsoccer = { - "pce_fsoccer", NULL, NULL, NULL, "1994", - "Formation Soccer - On J. League\0", NULL, "Human", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_fsoccerRomInfo, pce_fsoccerRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Fushigi no Yume no Alice - -static struct BurnRomInfo pce_aliceRomDesc[] = { - { "fushigi no yume no alice (japan).pce", 0x060000, 0x12c4e6fd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_alice) -STD_ROM_FN(pce_alice) - -struct BurnDriver BurnDrvpce_alice = { - "pce_alice", NULL, NULL, NULL, "1990", - "Fushigi no Yume no Alice\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_aliceRomInfo, pce_aliceRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Gai Flame - -static struct BurnRomInfo pce_gaiflameRomDesc[] = { - { "gai flame (japan).pce", 0x060000, 0x95f90dec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_gaiflame) -STD_ROM_FN(pce_gaiflame) - -struct BurnDriver BurnDrvpce_gaiflame = { - "pce_gaiflame", NULL, NULL, NULL, "1990", - "Gai Flame\0", NULL, "NCS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_gaiflameRomInfo, pce_gaiflameRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Gaia no Monshou - -static struct BurnRomInfo pce_gaiamonsRomDesc[] = { - { "gaia no monshou (japan).pce", 0x040000, 0x6fd6827c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_gaiamons) -STD_ROM_FN(pce_gaiamons) - -struct BurnDriver BurnDrvpce_gaiamons = { - "pce_gaiamons", NULL, NULL, NULL, "1988", - "Gaia no Monshou\0", NULL, "NCS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_gaiamonsRomInfo, pce_gaiamonsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Galaga '88 - -static struct BurnRomInfo pce_galaga88RomDesc[] = { - { "galaga '88 (japan).pce", 0x040000, 0x1a8393c6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_galaga88) -STD_ROM_FN(pce_galaga88) - -struct BurnDriver BurnDrvpce_galaga88 = { - "pce_galaga88", NULL, NULL, NULL, "1988", - "Galaga '88\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_galaga88RomInfo, pce_galaga88RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ganbare! Golf Boys - -static struct BurnRomInfo pce_ganbgolfRomDesc[] = { - { "ganbare! golf boys (japan).pce", 0x040000, 0x27a4d11a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ganbgolf) -STD_ROM_FN(pce_ganbgolf) - -struct BurnDriver BurnDrvpce_ganbgolf = { - "pce_ganbgolf", NULL, NULL, NULL, "1989", - "Ganbare! Golf Boys\0", NULL, "NCS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ganbgolfRomInfo, pce_ganbgolfRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Gekisha Boy - -static struct BurnRomInfo pce_gekisboyRomDesc[] = { - { "gekisha boy (japan).pce", 0x080000, 0xe8702d51, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_gekisboy) -STD_ROM_FN(pce_gekisboy) - -struct BurnDriver BurnDrvpce_gekisboy = { - "pce_gekisboy", NULL, NULL, NULL, "1992", - "Gekisha Boy\0", NULL, "Irem", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_gekisboyRomInfo, pce_gekisboyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Genji Tsuushin Agedama - -static struct BurnRomInfo pce_genjitsuRomDesc[] = { - { "genji tsuushin agedama (japan).pce", 0x080000, 0xad450dfc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_genjitsu) -STD_ROM_FN(pce_genjitsu) - -struct BurnDriver BurnDrvpce_genjitsu = { - "pce_genjitsu", NULL, NULL, NULL, "1991", - "Genji Tsuushin Agedama\0", NULL, "NEC Home Electronics", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_genjitsuRomInfo, pce_genjitsuRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Genpei Toumaden - -static struct BurnRomInfo pce_genpeiRomDesc[] = { - { "genpei toumaden (japan).pce", 0x080000, 0xb926c682, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_genpei) -STD_ROM_FN(pce_genpei) - -struct BurnDriver BurnDrvpce_genpei = { - "pce_genpei", NULL, NULL, NULL, "1990", - "Genpei Toumaden\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_genpeiRomInfo, pce_genpeiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Genpei Toumaden ni no Maki - -static struct BurnRomInfo pce_genpemakRomDesc[] = { - { "genpei toumaden ni no maki (japan).pce", 0x080000, 0x8793758c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_genpemak) -STD_ROM_FN(pce_genpemak) - -struct BurnDriver BurnDrvpce_genpemak = { - "pce_genpemak", NULL, NULL, NULL, "1992", - "Genpei Toumaden ni no Maki\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_genpemakRomInfo, pce_genpemakRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Gokuraku! Chuka Taisen - -static struct BurnRomInfo pce_chukataiRomDesc[] = { - { "gokuraku! chuuka taisen (japan).pce", 0x060000, 0xe749a22c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_chukatai) -STD_ROM_FN(pce_chukatai) - -struct BurnDriver BurnDrvpce_chukatai = { - "pce_chukatai", NULL, NULL, NULL, "1992", - "Gokuraku! Chuka Taisen\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_chukataiRomInfo, pce_chukataiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Gomola Speed - -static struct BurnRomInfo pce_gomolaRomDesc[] = { - { "gomola speed (japan).pce", 0x060000, 0x9a353afd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_gomola) -STD_ROM_FN(pce_gomola) - -struct BurnDriver BurnDrvpce_gomola = { - "pce_gomola", NULL, NULL, NULL, "1990", - "Gomola Speed\0", NULL, "UPL", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_gomolaRomInfo, pce_gomolaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Gradius - -static struct BurnRomInfo pce_gradiusRomDesc[] = { - { "gradius (japan).pce", 0x040000, 0x0517da65, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_gradius) -STD_ROM_FN(pce_gradius) - -struct BurnDriver BurnDrvpce_gradius = { - "pce_gradius", NULL, NULL, NULL, "1991", - "Gradius\0", NULL, "Konami", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_gradiusRomInfo, pce_gradiusRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// GunHed - -static struct BurnRomInfo pce_gunhedRomDesc[] = { - { "gunhed (japan).pce", 0x060000, 0xa17d4d7e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_gunhed) -STD_ROM_FN(pce_gunhed) - -struct BurnDriver BurnDrvpce_gunhed = { - "pce_gunhed", NULL, NULL, NULL, "1989", - "GunHed\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_gunhedRomInfo, pce_gunhedRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// GunHed - Hudson GunHed Taikai - -static struct BurnRomInfo pce_gunhedhtRomDesc[] = { - { "gunhed - hudson gunhed taikai (japan).pce", 0x040000, 0x57f183ae, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_gunhedht) -STD_ROM_FN(pce_gunhedht) - -struct BurnDriver BurnDrvpce_gunhedht = { - "pce_gunhedht", NULL, NULL, NULL, "1989", - "GunHed - Hudson GunHed Taikai\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_gunhedhtRomInfo, pce_gunhedhtRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Hana Taaka Daka!? - -static struct BurnRomInfo pce_hanatakaRomDesc[] = { - { "hana taaka daka! (japan).pce", 0x080000, 0xba4d0dd4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_hanataka) -STD_ROM_FN(pce_hanataka) - -struct BurnDriver BurnDrvpce_hanataka = { - "pce_hanataka", NULL, NULL, NULL, "1991", - "Hana Taaka Daka!?\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_hanatakaRomInfo, pce_hanatakaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Hanii in the Sky - -static struct BurnRomInfo pce_haniiskyRomDesc[] = { - { "hanii in the sky (japan).pce", 0x040000, 0xbf3e2cc7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_haniisky) -STD_ROM_FN(pce_haniisky) - -struct BurnDriver BurnDrvpce_haniisky = { - "pce_haniisky", NULL, NULL, NULL, "1989", - "Hanii in the Sky\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_haniiskyRomInfo, pce_haniiskyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Hanii on the Road - -static struct BurnRomInfo pce_haniirodRomDesc[] = { - { "hanii on the road (japan).pce", 0x060000, 0x9897fa86, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_haniirod) -STD_ROM_FN(pce_haniirod) - -struct BurnDriver BurnDrvpce_haniirod = { - "pce_haniirod", NULL, NULL, NULL, "1990", - "Hanii on the Road\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_haniirodRomInfo, pce_haniirodRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Hatris - -static struct BurnRomInfo pce_hatrisRomDesc[] = { - { "hatris (japan).pce", 0x020000, 0x44e7df53, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_hatris) -STD_ROM_FN(pce_hatris) - -struct BurnDriver BurnDrvpce_hatris = { - "pce_hatris", NULL, NULL, NULL, "1991", - "Hatris\0", NULL, "Tengen", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_hatrisRomInfo, pce_hatrisRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Heavy Unit - -static struct BurnRomInfo pce_hvyunitRomDesc[] = { - { "heavy unit (japan).pce", 0x060000, 0xeb923de5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_hvyunit) -STD_ROM_FN(pce_hvyunit) - -struct BurnDriver BurnDrvpce_hvyunit = { - "pce_hvyunit", NULL, NULL, NULL, "1989", - "Heavy Unit\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_hvyunitRomInfo, pce_hvyunitRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Hisou Kihei - Xserd - -static struct BurnRomInfo pce_xserdRomDesc[] = { - { "hisou kihei - xserd (japan).pce", 0x060000, 0x1cab1ee6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_xserd) -STD_ROM_FN(pce_xserd) - -struct BurnDriverD BurnDrvpce_xserd = { - "pce_xserd", NULL, NULL, NULL, "1990", - "Hisou Kihei - Xserd\0", NULL, "Masiya", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_xserdRomInfo, pce_xserdRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Hit the Ice - VHL - The Official Video Hockey League - -static struct BurnRomInfo pce_hiticeRomDesc[] = { - { "hit the ice - vhl the official video hockey league (japan).pce", 0x060000, 0x7acb60c8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_hitice) -STD_ROM_FN(pce_hitice) - -struct BurnDriver BurnDrvpce_hitice = { - "pce_hitice", NULL, NULL, NULL, "1991", - "Hit the Ice - VHL - The Official Video Hockey League\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_hiticeRomInfo, pce_hiticeRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Honoo no Toukyuuji - Dodge Danpei - -static struct BurnRomInfo pce_ddanpeiRomDesc[] = { - { "honoo no toukyuuji dodge danpei (japan).pce", 0x080000, 0xb01ee703, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ddanpei) -STD_ROM_FN(pce_ddanpei) - -struct BurnDriver BurnDrvpce_ddanpei = { - "pce_ddanpei", NULL, NULL, NULL, "1992", - "Honoo no Toukyuuji - Dodge Danpei\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ddanpeiRomInfo, pce_ddanpeiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Idol Hanafuda Fan Club - -static struct BurnRomInfo pce_idolhanaRomDesc[] = { - { "idol hanafuda fan club (japan).pce", 0x080000, 0x9ec6fc6c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_idolhana) -STD_ROM_FN(pce_idolhana) - -struct BurnDriver BurnDrvpce_idolhana = { - "pce_idolhana", NULL, NULL, NULL, "1991", - "Idol Hanafuda Fan Club\0", NULL, "Game Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_idolhanaRomInfo, pce_idolhanaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Image Fight - -static struct BurnRomInfo pce_imagefgtRomDesc[] = { - { "image fight (japan).pce", 0x080000, 0xa80c565f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_imagefgt) -STD_ROM_FN(pce_imagefgt) - -struct BurnDriver BurnDrvpce_imagefgt = { - "pce_imagefgt", NULL, NULL, NULL, "1990", - "Image Fight\0", NULL, "Irem", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_imagefgtRomInfo, pce_imagefgtRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// J. League Greatest Eleven - -static struct BurnRomInfo pce_jleag11RomDesc[] = { - { "j. league greatest eleven (japan).pce", 0x080000, 0x0ad97b04, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_jleag11) -STD_ROM_FN(pce_jleag11) - -struct BurnDriver BurnDrvpce_jleag11 = { - "pce_jleag11", NULL, NULL, NULL, "1993", - "J. League Greatest Eleven\0", NULL, "Nihon Bussan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_jleag11RomInfo, pce_jleag11RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Jack Nicklaus' Greatest 18 Holes of Major Championship Golf - -static struct BurnRomInfo pce_nicklausRomDesc[] = { - { "jack nicklaus' greatest 18 holes of major championship golf (japan).pce", 0x040000, 0xea751e82, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_nicklaus) -STD_ROM_FN(pce_nicklaus) - -struct BurnDriver BurnDrvpce_nicklaus = { - "pce_nicklaus", NULL, NULL, NULL, "1989", - "Jack Nicklaus' Greatest 18 Holes of Major Championship Golf\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_nicklausRomInfo, pce_nicklausRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Jackie Chan - -static struct BurnRomInfo pce_jchanRomDesc[] = { - { "jackie chan (japan).pce", 0x080000, 0xc6fa6373, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_jchan) -STD_ROM_FN(pce_jchan) - -struct BurnDriver BurnDrvpce_jchan = { - "pce_jchan", NULL, NULL, NULL, "1991", - "Jackie Chan\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_jchanRomInfo, pce_jchanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Jigoku Meguri - -static struct BurnRomInfo pce_jigomeguRomDesc[] = { - { "jigoku meguri (japan).pce", 0x060000, 0xcc7d3eeb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_jigomegu) -STD_ROM_FN(pce_jigomegu) - -struct BurnDriver BurnDrvpce_jigomegu = { - "pce_jigomegu", NULL, NULL, NULL, "1990", - "Jigoku Meguri\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_jigomeguRomInfo, pce_jigomeguRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Jinmu Denshou - -static struct BurnRomInfo pce_jinmuRomDesc[] = { - { "jinmu denshou (japan).pce", 0x080000, 0xc150637a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_jinmu) -STD_ROM_FN(pce_jinmu) - -struct BurnDriver BurnDrvpce_jinmu = { - "pce_jinmu", NULL, NULL, NULL, "1989", - "Jinmu Denshou\0", NULL, "Big Club", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_jinmuRomInfo, pce_jinmuRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Jinmu Denshou (Alt) - -static struct BurnRomInfo pce_jinmu1RomDesc[] = { - { "jinmu denshou (japan) [a].pce", 0x080000, 0x84240ef9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_jinmu1) -STD_ROM_FN(pce_jinmu1) - -struct BurnDriver BurnDrvpce_jinmu1 = { - "pce_jinmu1", "pce_jinmu", NULL, NULL, "1989", - "Jinmu Denshou (Alt)\0", NULL, "Big Club", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_jinmu1RomInfo, pce_jinmu1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Juuouki - -static struct BurnRomInfo pce_juuoukiRomDesc[] = { - { "juuouki (japan).pce", 0x080000, 0xc8c7d63e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_juuouki) -STD_ROM_FN(pce_juuouki) - -struct BurnDriver BurnDrvpce_juuouki = { - "pce_juuouki", NULL, NULL, NULL, "1989", - "Juuouki\0", NULL, "NEC", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_juuoukiRomInfo, pce_juuoukiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Juuouki (Alt) - -static struct BurnRomInfo pce_juuouki1RomDesc[] = { - { "juuouki (japan) [a].pce", 0x080000, 0x6a628982, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_juuouki1) -STD_ROM_FN(pce_juuouki1) - -struct BurnDriver BurnDrvpce_juuouki1 = { - "pce_juuouki1", "pce_juuouki", NULL, NULL, "1989", - "Juuouki (Alt)\0", NULL, "NEC", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_juuouki1RomInfo, pce_juuouki1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kaizou Choujin Shubibinman - -static struct BurnRomInfo pce_shubibiRomDesc[] = { - { "kaizou choujin shubibinman (japan).pce", 0x040000, 0xa9084d6e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_shubibi) -STD_ROM_FN(pce_shubibi) - -struct BurnDriver BurnDrvpce_shubibi = { - "pce_shubibi", NULL, NULL, NULL, "1989", - "Kaizou Choujin Shubibinman\0", NULL, "NCS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_shubibiRomInfo, pce_shubibiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kaizou Choujin Shubibinman 2 - Aratanaru Teki - -static struct BurnRomInfo pce_shubibi2RomDesc[] = { - { "kaizou choujin shubibinman 2 - aratanaru teki (japan).pce", 0x080000, 0x109ba474, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_shubibi2) -STD_ROM_FN(pce_shubibi2) - -struct BurnDriver BurnDrvpce_shubibi2 = { - "pce_shubibi2", NULL, NULL, NULL, "1991", - "Kaizou Choujin Shubibinman 2 - Aratanaru Teki\0", NULL, "Masiya", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_shubibi2RomInfo, pce_shubibi2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kato Chan & Ken Chan - -static struct BurnRomInfo pce_katochanRomDesc[] = { - { "kato chan & ken chan (japan).pce", 0x040000, 0x6069c5e7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_katochan) -STD_ROM_FN(pce_katochan) - -struct BurnDriver BurnDrvpce_katochan = { - "pce_katochan", NULL, NULL, NULL, "1987", - "Kato Chan & Ken Chan\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_katochanRomInfo, pce_katochanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kattobi! Takuhai Kun - -static struct BurnRomInfo pce_kattobiRomDesc[] = { - { "kattobi! takuhai kun (japan).pce", 0x060000, 0x4f2844b0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_kattobi) -STD_ROM_FN(pce_kattobi) - -struct BurnDriver BurnDrvpce_kattobi = { - "pce_kattobi", NULL, NULL, NULL, "1990", - "Kattobi! Takuhai Kun\0", NULL, "Tonkin House", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_kattobiRomInfo, pce_kattobiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kickball - -static struct BurnRomInfo pce_kickballRomDesc[] = { - { "kickball (japan).pce", 0x060000, 0x7e3c367b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_kickball) -STD_ROM_FN(pce_kickball) - -struct BurnDriver BurnDrvpce_kickball = { - "pce_kickball", NULL, NULL, NULL, "1990", - "Kickball\0", NULL, "Masiya", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_kickballRomInfo, pce_kickballRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kiki KaiKai - -static struct BurnRomInfo pce_kikikaiRomDesc[] = { - { "kiki kaikai (japan).pce", 0x060000, 0xc0cb5add, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_kikikai) -STD_ROM_FN(pce_kikikai) - -struct BurnDriver BurnDrvpce_kikikai = { - "pce_kikikai", NULL, NULL, NULL, "1990", - "Kiki KaiKai\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_kikikaiRomInfo, pce_kikikaiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// King of Casino - -static struct BurnRomInfo pce_kingcasnRomDesc[] = { - { "king of casino (japan).pce", 0x040000, 0xbf52788e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_kingcasn) -STD_ROM_FN(pce_kingcasn) - -struct BurnDriver BurnDrvpce_kingcasn = { - "pce_kingcasn", NULL, NULL, NULL, "1990", - "King of Casino\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_kingcasnRomInfo, pce_kingcasnRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Klax - -static struct BurnRomInfo pce_klaxRomDesc[] = { - { "klax (japan).pce", 0x040000, 0xc74ffbc9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_klax) -STD_ROM_FN(pce_klax) - -struct BurnDriver BurnDrvpce_klax = { - "pce_klax", NULL, NULL, NULL, "1990", - "Klax\0", NULL, "Tengen", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_klaxRomInfo, pce_klaxRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Knight Rider Special - -static struct BurnRomInfo pce_knightrsRomDesc[] = { - { "knight rider special (japan).pce", 0x040000, 0xc614116c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_knightrs) -STD_ROM_FN(pce_knightrs) - -struct BurnDriver BurnDrvpce_knightrs = { - "pce_knightrs", NULL, NULL, NULL, "1989", - "Knight Rider Special\0", NULL, "Pack-In-Video", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_knightrsRomInfo, pce_knightrsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kore Ga Pro Yakyuu '89 - -static struct BurnRomInfo pce_proyak89RomDesc[] = { - { "kore ga pro yakyuu '89 (japan).pce", 0x040000, 0x44f60137, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_proyak89) -STD_ROM_FN(pce_proyak89) - -struct BurnDriver BurnDrvpce_proyak89 = { - "pce_proyak89", NULL, NULL, NULL, "1989", - "Kore Ga Pro Yakyuu '89\0", NULL, "Intec", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_proyak89RomInfo, pce_proyak89RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kore Ga Pro Yakyuu '90 - -static struct BurnRomInfo pce_proyak90RomDesc[] = { - { "kore ga pro yakyuu '90 (japan).pce", 0x040000, 0x1772b229, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_proyak90) -STD_ROM_FN(pce_proyak90) - -struct BurnDriver BurnDrvpce_proyak90 = { - "pce_proyak90", NULL, NULL, NULL, "1990", - "Kore Ga Pro Yakyuu '90\0", NULL, "Intec", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_proyak90RomInfo, pce_proyak90RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// The Kung Fu - -static struct BurnRomInfo pce_kungfuRomDesc[] = { - { "kung fu, the (japan).pce", 0x040000, 0xb552c906, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_kungfu) -STD_ROM_FN(pce_kungfu) - -struct BurnDriver BurnDrvpce_kungfu = { - "pce_kungfu", NULL, NULL, NULL, "1987", - "The Kung Fu\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_kungfuRomInfo, pce_kungfuRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kyuukyoku Mahjong - Idol Graphics - -static struct BurnRomInfo pce_kyukyomjRomDesc[] = { - { "kyuukyoku mahjong - idol graphics (japan).pce", 0x080000, 0x02dde03e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_kyukyomj) -STD_ROM_FN(pce_kyukyomj) - -struct BurnDriver BurnDrvpce_kyukyomj = { - "pce_kyukyomj", NULL, NULL, NULL, "1992", - "Kyuukyoku Mahjong - Idol Graphics\0", NULL, "Game Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_kyukyomjRomInfo, pce_kyukyomjRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kyuukyoku Mahjong II - -static struct BurnRomInfo pce_kyukyom2RomDesc[] = { - { "kyuukyoku mahjong ii (japan).pce", 0x080000, 0xe5b6b3e5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_kyukyom2) -STD_ROM_FN(pce_kyukyom2) - -struct BurnDriver BurnDrvpce_kyukyom2 = { - "pce_kyukyom2", NULL, NULL, NULL, "1993", - "Kyuukyoku Mahjong II\0", NULL, "Game Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_kyukyom2RomInfo, pce_kyukyom2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Kyuukyoku Tiger - -static struct BurnRomInfo pce_ktigerRomDesc[] = { - { "kyuukyoku tiger (japan).pce", 0x040000, 0x09509315, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ktiger) -STD_ROM_FN(pce_ktiger) - -struct BurnDriver BurnDrvpce_ktiger = { - "pce_ktiger", NULL, NULL, NULL, "1989", - "Kyuukyoku Tiger\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ktigerRomInfo, pce_ktigerRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Lady Sword - -static struct BurnRomInfo pce_ladyswrdRomDesc[] = { - { "lady sword (japan).pce", 0x100000, 0xc6f764ec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ladyswrd) -STD_ROM_FN(pce_ladyswrd) - -struct BurnDriver BurnDrvpce_ladyswrd = { - "pce_ladyswrd", NULL, NULL, NULL, "19??", - "Lady Sword\0", NULL, "Game Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ladyswrdRomInfo, pce_ladyswrdRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Lady Sword (Alt) - -static struct BurnRomInfo pce_ladyswrd1RomDesc[] = { - { "lady sword (japan) [a].pce", 0x100000, 0xeb833d15, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ladyswrd1) -STD_ROM_FN(pce_ladyswrd1) - -struct BurnDriver BurnDrvpce_ladyswrd1 = { - "pce_ladyswrd1", "pce_ladyswrd", NULL, NULL, "19??", - "Lady Sword (Alt)\0", NULL, "Game Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ladyswrd1RomInfo, pce_ladyswrd1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Legend of Hero Tonma - -static struct BurnRomInfo pce_lohtRomDesc[] = { - { "legend of hero tonma (japan).pce", 0x080000, 0xc28b0d8a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_loht) -STD_ROM_FN(pce_loht) - -struct BurnDriver BurnDrvpce_loht = { - "pce_loht", NULL, NULL, NULL, "1991", - "Legend of Hero Tonma\0", NULL, "Irem", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_lohtRomInfo, pce_lohtRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Lode Runner - Lost Labyrinth - -static struct BurnRomInfo pce_ldrunRomDesc[] = { - { "lode runner - lost labyrinth (japan).pce", 0x040000, 0xe6ee1468, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ldrun) -STD_ROM_FN(pce_ldrun) - -struct BurnDriver BurnDrvpce_ldrun = { - "pce_ldrun", NULL, NULL, NULL, "1990", - "Lode Runner - Lost Labyrinth\0", NULL, "Pack-In-Video", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ldrunRomInfo, pce_ldrunRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mrchen Maze - -static struct BurnRomInfo pce_marchenRomDesc[] = { - { "maerchen maze (japan).pce", 0x040000, 0xa15a1f37, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_marchen) -STD_ROM_FN(pce_marchen) - -struct BurnDriver BurnDrvpce_marchen = { - "pce_marchen", NULL, NULL, NULL, "1990", - "Marchen Maze\0", NULL, "Namcot", "PC Engine", - L"M\u00E4rchen Maze\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_marchenRomInfo, pce_marchenRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Magical Chase - -static struct BurnRomInfo pce_magchaseRomDesc[] = { - { "magical chase (japan).pce", 0x080000, 0xdd0ebf8c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_magchase) -STD_ROM_FN(pce_magchase) - -struct BurnDriver BurnDrvpce_magchase = { - "pce_magchase", NULL, NULL, NULL, "1991", - "Magical Chase\0", NULL, "Palsoft", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_magchaseRomInfo, pce_magchaseRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mahjong Gakuen - Touma Soushirou Toujou - -static struct BurnRomInfo pce_mjgakuenRomDesc[] = { - { "mahjong gakuen - touma soushirou toujou (japan).pce", 0x080000, 0xf5b90d55, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mjgakuen) -STD_ROM_FN(pce_mjgakuen) - -struct BurnDriver BurnDrvpce_mjgakuen = { - "pce_mjgakuen", NULL, NULL, NULL, "1990", - "Mahjong Gakuen - Touma Soushirou Toujou\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mjgakuenRomInfo, pce_mjgakuenRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mahjong Gakuen Mild - Touma Soushirou Toujou - -static struct BurnRomInfo pce_mjgakmldRomDesc[] = { - { "mahjong gakuen mild - touma soushirou toujou (japan).pce", 0x080000, 0xf4148600, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mjgakmld) -STD_ROM_FN(pce_mjgakmld) - -struct BurnDriver BurnDrvpce_mjgakmld = { - "pce_mjgakmld", NULL, NULL, NULL, "1990", - "Mahjong Gakuen Mild - Touma Soushirou Toujou\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mjgakmldRomInfo, pce_mjgakmldRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mahjong Gakuen Mild - Touma Soushirou Toujou (Alt) - -static struct BurnRomInfo pce_mjgakmld1RomDesc[] = { - { "mahjong gakuen mild - touma soushirou toujou (japan) [a].pce", 0x080000, 0x3e4d432a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mjgakmld1) -STD_ROM_FN(pce_mjgakmld1) - -struct BurnDriver BurnDrvpce_mjgakmld1 = { - "pce_mjgakmld1", "pce_mjgakmld", NULL, NULL, "1990", - "Mahjong Gakuen Mild - Touma Soushirou Toujou (Alt)\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mjgakmld1RomInfo, pce_mjgakmld1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mahjong Gokuu Special - -static struct BurnRomInfo pce_mjgokuspRomDesc[] = { - { "mahjong gokuu special (japan).pce", 0x060000, 0xf8861456, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mjgokusp) -STD_ROM_FN(pce_mjgokusp) - -struct BurnDriver BurnDrvpce_mjgokusp = { - "pce_mjgokusp", NULL, NULL, NULL, "1990", - "Mahjong Gokuu Special\0", NULL, "Sunsoft", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mjgokuspRomInfo, pce_mjgokuspRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mahjong Haou Den - Kaiser's Quest - -static struct BurnRomInfo pce_mjkaiserRomDesc[] = { - { "mahjong haou den - kaiser's quest (japan).pce", 0x080000, 0xdf10c895, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mjkaiser) -STD_ROM_FN(pce_mjkaiser) - -struct BurnDriver BurnDrvpce_mjkaiser = { - "pce_mjkaiser", NULL, NULL, NULL, "1992", - "Mahjong Haou Den - Kaiser's Quest\0", NULL, "UPL", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mjkaiserRomInfo, pce_mjkaiserRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mahjong Shikyaku Retsuden - Mahjong Wars - -static struct BurnRomInfo pce_mjwarsRomDesc[] = { - { "mahjong shikyaku retsuden - mahjong wars (japan).pce", 0x040000, 0x6c34aaea, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mjwars) -STD_ROM_FN(pce_mjwars) - -struct BurnDriver BurnDrvpce_mjwars = { - "pce_mjwars", NULL, NULL, NULL, "1990", - "Mahjong Shikyaku Retsuden - Mahjong Wars\0", NULL, "Nihon Bussan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mjwarsRomInfo, pce_mjwarsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Maison Ikkoku - -static struct BurnRomInfo pce_mikkokuRomDesc[] = { - { "maison ikkoku (japan).pce", 0x040000, 0x5c78fee1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mikkoku) -STD_ROM_FN(pce_mikkoku) - -struct BurnDriver BurnDrvpce_mikkoku = { - "pce_mikkoku", NULL, NULL, NULL, "1989", - "Maison Ikkoku\0", NULL, "Micro Cabin", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mikkokuRomInfo, pce_mikkokuRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Majin Eiyuu Den Wataru - -static struct BurnRomInfo pce_wataruRomDesc[] = { - { "majin eiyuu den wataru (japan).pce", 0x040000, 0x2f8935aa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_wataru) -STD_ROM_FN(pce_wataru) - -struct BurnDriver BurnDrvpce_wataru = { - "pce_wataru", NULL, NULL, NULL, "1988", - "Majin Eiyuu Den Wataru\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_wataruRomInfo, pce_wataruRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Makai Hakken Den Shada - -static struct BurnRomInfo pce_makaihakRomDesc[] = { - { "makai hakken den shada (japan).pce", 0x040000, 0xbe62eef5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_makaihak) -STD_ROM_FN(pce_makaihak) - -struct BurnDriver BurnDrvpce_makaihak = { - "pce_makaihak", NULL, NULL, NULL, "1989", - "Makai Hakken Den Shada\0", NULL, "Data East", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_makaihakRomInfo, pce_makaihakRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Makai Prince Dorabocchan - -static struct BurnRomInfo pce_makaipriRomDesc[] = { - { "makai prince dorabocchan (japan).pce", 0x060000, 0xb101b333, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_makaipri) -STD_ROM_FN(pce_makaipri) - -struct BurnDriver BurnDrvpce_makaipri = { - "pce_makaipri", NULL, NULL, NULL, "1990", - "Makai Prince Dorabocchan\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_makaipriRomInfo, pce_makaipriRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Makyou Densetsu - -static struct BurnRomInfo pce_makyodenRomDesc[] = { - { "makyou densetsu (japan).pce", 0x040000, 0xd4c5af46, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_makyoden) -STD_ROM_FN(pce_makyoden) - -struct BurnDriver BurnDrvpce_makyoden = { - "pce_makyoden", NULL, NULL, NULL, "1988", - "Makyou Densetsu\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_makyodenRomInfo, pce_makyodenRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Maniac Pro Wres - Asu e no Tatakai - -static struct BurnRomInfo pce_maniacpwRomDesc[] = { - { "maniac puroresu - asu e no tatakai (japan).pce", 0x080000, 0x99f2865c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_maniacpw) -STD_ROM_FN(pce_maniacpw) - -struct BurnDriver BurnDrvpce_maniacpw = { - "pce_maniacpw", NULL, NULL, NULL, "1990", - "Maniac Pro Wres - Asu e no Tatakai\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_maniacpwRomInfo, pce_maniacpwRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mesopotamia - -static struct BurnRomInfo pce_mesopotRomDesc[] = { - { "mesopotamia (japan).pce", 0x080000, 0xe87190f1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mesopot) -STD_ROM_FN(pce_mesopot) - -struct BurnDriver BurnDrvpce_mesopot = { - "pce_mesopot", NULL, NULL, NULL, "1991", - "Mesopotamia\0", NULL, "Atlus", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mesopotRomInfo, pce_mesopotRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Metal Stoker - -static struct BurnRomInfo pce_metlstokRomDesc[] = { - { "metal stoker (japan).pce", 0x080000, 0x25a02bee, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_metlstok) -STD_ROM_FN(pce_metlstok) - -struct BurnDriver BurnDrvpce_metlstok = { - "pce_metlstok", NULL, NULL, NULL, "1991", - "Metal Stoker\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_metlstokRomInfo, pce_metlstokRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mizubaku Dai Bouken - -static struct BurnRomInfo pce_mizubakuRomDesc[] = { - { "mizubaku dai bouken (japan).pce", 0x080000, 0xb2ef558d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mizubaku) -STD_ROM_FN(pce_mizubaku) - -struct BurnDriver BurnDrvpce_mizubaku = { - "pce_mizubaku", NULL, NULL, NULL, "1992", - "Mizubaku Dai Bouken\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mizubakuRomInfo, pce_mizubakuRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Momotarou Densetsu Gaiden Dai 1 Shuu - -static struct BurnRomInfo pce_momogdnRomDesc[] = { - { "momotarou densetsu gaiden dai 1 shuu (japan).pce", 0x080000, 0xf860455c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_momogdn) -STD_ROM_FN(pce_momogdn) - -struct BurnDriver BurnDrvpce_momogdn = { - "pce_momogdn", NULL, NULL, NULL, "1992", - "Momotarou Densetsu Gaiden Dai 1 Shuu\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_momogdnRomInfo, pce_momogdnRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Momotarou Densetsu II - -static struct BurnRomInfo pce_momo2RomDesc[] = { - { "momotarou densetsu ii (japan).pce", 0x0c0000, 0xd9e1549a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_momo2) -STD_ROM_FN(pce_momo2) - -struct BurnDriver BurnDrvpce_momo2 = { - "pce_momo2", NULL, NULL, NULL, "1990", - "Momotarou Densetsu II\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_momo2RomInfo, pce_momo2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Momotarou Densetsu Turbo - -static struct BurnRomInfo pce_momotrboRomDesc[] = { - { "momotarou densetsu turbo (japan).pce", 0x060000, 0x625221a6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_momotrbo) -STD_ROM_FN(pce_momotrbo) - -struct BurnDriver BurnDrvpce_momotrbo = { - "pce_momotrbo", NULL, NULL, NULL, "1990", - "Momotarou Densetsu Turbo\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_momotrboRomInfo, pce_momotrboRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Momotarou Katsugeki - -static struct BurnRomInfo pce_momoktsgRomDesc[] = { - { "momotarou katsugeki (japan).pce", 0x080000, 0x345f43e9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_momoktsg) -STD_ROM_FN(pce_momoktsg) - -struct BurnDriver BurnDrvpce_momoktsg = { - "pce_momoktsg", NULL, NULL, NULL, "1990", - "Momotarou Katsugeki\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_momoktsgRomInfo, pce_momoktsgRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Monster Pro Wres - -static struct BurnRomInfo pce_mnstprowRomDesc[] = { - { "monster puroresu (japan).pce", 0x080000, 0xf2e46d25, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mnstprow) -STD_ROM_FN(pce_mnstprow) - -struct BurnDriver BurnDrvpce_mnstprow = { - "pce_mnstprow", NULL, NULL, NULL, "1991", - "Monster Pro Wres\0", NULL, "ASK", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mnstprowRomInfo, pce_mnstprowRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Morita Shougi PC - -static struct BurnRomInfo pce_moritashRomDesc[] = { - { "morita shougi pc (japan).pce", 0x080000, 0x2546efe0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_moritash) -STD_ROM_FN(pce_moritash) - -struct BurnDriver BurnDrvpce_moritash = { - "pce_moritash", NULL, NULL, NULL, "1991", - "Morita Shougi PC\0", NULL, "NEC Avenue", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_moritashRomInfo, pce_moritashRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Moto Roader - -static struct BurnRomInfo pce_motoroadRomDesc[] = { - { "moto roader (japan).pce", 0x040000, 0x428f36cd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_motoroad) -STD_ROM_FN(pce_motoroad) - -struct BurnDriver BurnDrvpce_motoroad = { - "pce_motoroad", NULL, NULL, NULL, "1989", - "Moto Roader\0", NULL, "NCS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_motoroadRomInfo, pce_motoroadRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Moto Roader II - -static struct BurnRomInfo pce_motorod2RomDesc[] = { - { "moto roader ii (japan).pce", 0x060000, 0x0b7f6e5f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_motorod2) -STD_ROM_FN(pce_motorod2) - -struct BurnDriver BurnDrvpce_motorod2 = { - "pce_motorod2", NULL, NULL, NULL, "1991", - "Moto Roader II\0", NULL, "Masiya", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_motorod2RomInfo, pce_motorod2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Moto Roader II (Alt) - -static struct BurnRomInfo pce_motorod2aRomDesc[] = { - { "moto roader ii (japan) [a].pce", 0x060000, 0x4ba525ba, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_motorod2a) -STD_ROM_FN(pce_motorod2a) - -struct BurnDriver BurnDrvpce_motorod2a = { - "pce_motorod2a", "pce_motorod2", NULL, NULL, "1991", - "Moto Roader II (Alt)\0", NULL, "Masiya", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_motorod2aRomInfo, pce_motorod2aRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mr. Heli no Daibouken - -static struct BurnRomInfo pce_mrheliRomDesc[] = { - { "mr. heli no daibouken (japan).pce", 0x080000, 0x2cb92290, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mrheli) -STD_ROM_FN(pce_mrheli) - -struct BurnDriver BurnDrvpce_mrheli = { - "pce_mrheli", NULL, NULL, NULL, "1989", - "Mr. Heli no Daibouken\0", NULL, "Irem", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mrheliRomInfo, pce_mrheliRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Mr. Heli no Daibouken (Alt) - -static struct BurnRomInfo pce_mrheli1RomDesc[] = { - { "mr. heli no daibouken (japan) [a].pce", 0x080000, 0xac0cd796, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_mrheli1) -STD_ROM_FN(pce_mrheli1) - -struct BurnDriver BurnDrvpce_mrheli1 = { - "pce_mrheli1", "pce_mrheli", NULL, NULL, "1989", - "Mr. Heli no Daibouken (Alt)\0", NULL, "Irem", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_mrheli1RomInfo, pce_mrheli1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Narazumono Sentai Butai - Bloody Wolf - -static struct BurnRomInfo pce_blodwolfRomDesc[] = { - { "narazumono sentai butai - bloody wolf (japan).pce", 0x080000, 0xb01f70c2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_blodwolf) -STD_ROM_FN(pce_blodwolf) - -struct BurnDriver BurnDrvpce_blodwolf = { - "pce_blodwolf", NULL, NULL, NULL, "1989", - "Narazumono Sentai Butai - Bloody Wolf\0", NULL, "Data East", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_blodwolfRomInfo, pce_blodwolfRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Naxat Open - -static struct BurnRomInfo pce_naxopenRomDesc[] = { - { "naxat open (japan).pce", 0x060000, 0x60ecae22, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_naxopen) -STD_ROM_FN(pce_naxopen) - -struct BurnDriver BurnDrvpce_naxopen = { - "pce_naxopen", NULL, NULL, NULL, "1989", - "Naxat Open\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_naxopenRomInfo, pce_naxopenRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Naxat Stadium - -static struct BurnRomInfo pce_naxstadRomDesc[] = { - { "naxat stadium (japan).pce", 0x080000, 0x20a7d128, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_naxstad) -STD_ROM_FN(pce_naxstad) - -struct BurnDriver BurnDrvpce_naxstad = { - "pce_naxstad", NULL, NULL, NULL, "1990", - "Naxat Stadium\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_naxstadRomInfo, pce_naxstadRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Nazo no Masquerade - -static struct BurnRomInfo pce_nazomasqRomDesc[] = { - { "nazo no mascarade (japan).pce", 0x060000, 0x0441d85a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_nazomasq) -STD_ROM_FN(pce_nazomasq) - -struct BurnDriver BurnDrvpce_nazomasq = { - "pce_nazomasq", NULL, NULL, NULL, "1990", - "Nazo no Masquerade\0", NULL, "Masiya", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_nazomasqRomInfo, pce_nazomasqRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Necromancer - -static struct BurnRomInfo pce_necromcrRomDesc[] = { - { "necromancer (japan).pce", 0x040000, 0x53109ae6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_necromcr) -STD_ROM_FN(pce_necromcr) - -struct BurnDriver BurnDrvpce_necromcr = { - "pce_necromcr", NULL, NULL, NULL, "1988", - "Necromancer\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_necromcrRomInfo, pce_necromcrRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Necros no Yousai - -static struct BurnRomInfo pce_necrosRomDesc[] = { - { "necros no yousai (japan).pce", 0x080000, 0xfb0fdcfe, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_necros) -STD_ROM_FN(pce_necros) - -struct BurnDriver BurnDrvpce_necros = { - "pce_necros", NULL, NULL, NULL, "1990", - "Necros no Yousai\0", NULL, "ASK", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_necrosRomInfo, pce_necrosRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Nectaris - -static struct BurnRomInfo pce_nectarisRomDesc[] = { - { "nectaris (japan).pce", 0x060000, 0x0243453b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_nectaris) -STD_ROM_FN(pce_nectaris) - -struct BurnDriver BurnDrvpce_nectaris = { - "pce_nectaris", NULL, NULL, NULL, "1990", - "Nectaris\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_nectarisRomInfo, pce_nectarisRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Nekketsu Koukou Dodgeball Bu - PC Bangai Hen - -static struct BurnRomInfo pce_nekdodgeRomDesc[] = { - { "nekketsu koukou dodgeball bu - pc bangai hen (japan).pce", 0x040000, 0x65fdb863, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_nekdodge) -STD_ROM_FN(pce_nekdodge) - -struct BurnDriver BurnDrvpce_nekdodge = { - "pce_nekdodge", NULL, NULL, NULL, "1990", - "Nekketsu Koukou Dodgeball Bu - PC Bangai Hen\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_nekdodgeRomInfo, pce_nekdodgeRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Nekketsu Koukou Dodgeball Bu - Soccer PC Hen - -static struct BurnRomInfo pce_neksoccrRomDesc[] = { - { "nekketsu koukou dodgeball bu - soccer pc hen (japan).pce", 0x080000, 0xf2285c6d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_neksoccr) -STD_ROM_FN(pce_neksoccr) - -struct BurnDriver BurnDrvpce_neksoccr = { - "pce_neksoccr", NULL, NULL, NULL, "1992", - "Nekketsu Koukou Dodgeball Bu - Soccer PC Hen\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_neksoccrRomInfo, pce_neksoccrRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Neutopia - -static struct BurnRomInfo pce_neutopiaRomDesc[] = { - { "neutopia (japan).pce", 0x060000, 0x9c49ef11, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_neutopia) -STD_ROM_FN(pce_neutopia) - -struct BurnDriver BurnDrvpce_neutopia = { - "pce_neutopia", NULL, NULL, NULL, "1989", - "Neutopia\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_neutopiaRomInfo, pce_neutopiaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Neutopia II - -static struct BurnRomInfo pce_neutopi2RomDesc[] = { - { "neutopia ii (japan).pce", 0x0c0000, 0x2b94aedc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_neutopi2) -STD_ROM_FN(pce_neutopi2) - -struct BurnDriver BurnDrvpce_neutopi2 = { - "pce_neutopi2", NULL, NULL, NULL, "1991", - "Neutopia II\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_neutopi2RomInfo, pce_neutopi2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// The New Zealand Story - -static struct BurnRomInfo pce_tnzsRomDesc[] = { - { "new zealand story, the (japan).pce", 0x060000, 0x8e4d75a8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tnzs) -STD_ROM_FN(pce_tnzs) - -struct BurnDriver BurnDrvpce_tnzs = { - "pce_tnzs", NULL, NULL, NULL, "1990", - "The New Zealand Story\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tnzsRomInfo, pce_tnzsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// NHK Taiga Drama - Taiheiki - -static struct BurnRomInfo pce_nhktaidrRomDesc[] = { - { "nhk taiga drama - taiheiki (japan).pce", 0x080000, 0xa32430d5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_nhktaidr) -STD_ROM_FN(pce_nhktaidr) - -struct BurnDriver BurnDrvpce_nhktaidr = { - "pce_nhktaidr", NULL, NULL, NULL, "1992", - "NHK Taiga Drama - Taiheiki\0", NULL, "NHK Enterprise", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_nhktaidrRomInfo, pce_nhktaidrRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Niko Niko, Pun - -static struct BurnRomInfo pce_nikopunRomDesc[] = { - { "niko niko pun (japan).pce", 0x080000, 0x82def9ee, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_nikopun) -STD_ROM_FN(pce_nikopun) - -struct BurnDriverD BurnDrvpce_nikopun = { - "pce_nikopun", NULL, NULL, NULL, "1991", - "Niko Niko, Pun\0", "Locks up in-game?", "NHK Enterprise", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_nikopunRomInfo, pce_nikopunRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ninja Ryukenden - -static struct BurnRomInfo pce_nryukendRomDesc[] = { - { "ninja ryuuken den (japan).pce", 0x080000, 0x67573bac, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_nryukend) -STD_ROM_FN(pce_nryukend) - -struct BurnDriver BurnDrvpce_nryukend = { - "pce_nryukend", NULL, NULL, NULL, "1992", - "Ninja Ryukenden\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_nryukendRomInfo, pce_nryukendRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// The Ninja Warriors - -static struct BurnRomInfo pce_ninjawarRomDesc[] = { - { "ninja warriors, the (japan).pce", 0x060000, 0x96e0cd9d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ninjawar) -STD_ROM_FN(pce_ninjawar) - -struct BurnDriver BurnDrvpce_ninjawar = { - "pce_ninjawar", NULL, NULL, NULL, "1989", - "The Ninja Warriors\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ninjawarRomInfo, pce_ninjawarRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Obocchama-kun - -static struct BurnRomInfo pce_obocchaRomDesc[] = { - { "obocchama kun (japan).pce", 0x080000, 0x4d3b0bc9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_oboccha) -STD_ROM_FN(pce_oboccha) - -struct BurnDriver BurnDrvpce_oboccha = { - "pce_oboccha", NULL, NULL, NULL, "1991", - "Obocchama-kun\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_obocchaRomInfo, pce_obocchaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Operation Wolf - -static struct BurnRomInfo pce_opwolfRomDesc[] = { - { "operation wolf (japan).pce", 0x080000, 0xff898f87, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_opwolf) -STD_ROM_FN(pce_opwolf) - -struct BurnDriver BurnDrvpce_opwolf = { - "pce_opwolf", NULL, NULL, NULL, "1990", - "Operation Wolf\0", NULL, "NEC Avenue", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_opwolfRomInfo, pce_opwolfRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ordyne - -static struct BurnRomInfo pce_ordyneRomDesc[] = { - { "ordyne (japan).pce", 0x080000, 0x8c565cb6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ordyne) -STD_ROM_FN(pce_ordyne) - -struct BurnDriver BurnDrvpce_ordyne = { - "pce_ordyne", NULL, NULL, NULL, "1989", - "Ordyne\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ordyneRomInfo, pce_ordyneRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Out Live - -static struct BurnRomInfo pce_outliveRomDesc[] = { - { "out live (japan).pce", 0x040000, 0x5cdb3f5b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_outlive) -STD_ROM_FN(pce_outlive) - -struct BurnDriver BurnDrvpce_outlive = { - "pce_outlive", NULL, NULL, NULL, "1989", - "Out Live\0", NULL, "Sunsoft", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_outliveRomInfo, pce_outliveRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Out Run - -static struct BurnRomInfo pce_outrunRomDesc[] = { - { "out run (japan).pce", 0x080000, 0xe203f223, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_outrun) -STD_ROM_FN(pce_outrun) - -struct BurnDriver BurnDrvpce_outrun = { - "pce_outrun", NULL, NULL, NULL, "1990", - "Out Run\0", NULL, "NEC Avenue", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_outrunRomInfo, pce_outrunRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Override - -static struct BurnRomInfo pce_overrideRomDesc[] = { - { "override (japan).pce", 0x040000, 0xb74ec562, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_override) -STD_ROM_FN(pce_override) - -struct BurnDriver BurnDrvpce_override = { - "pce_override", NULL, NULL, NULL, "1991", - "Override\0", NULL, "Data East", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_overrideRomInfo, pce_overrideRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// P-47 - The Freedom Fighter - -static struct BurnRomInfo pce_p47RomDesc[] = { - { "p-47 - the freedom fighter (japan).pce", 0x040000, 0x7632db90, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_p47) -STD_ROM_FN(pce_p47) - -struct BurnDriver BurnDrvpce_p47 = { - "pce_p47", NULL, NULL, NULL, "1989", - "P-47 - The Freedom Fighter\0", NULL, "Aicom", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_p47RomInfo, pce_p47RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Pac-land - -static struct BurnRomInfo pce_paclandRomDesc[] = { - { "pac-land (japan).pce", 0x040000, 0x14fad3ba, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pacland) -STD_ROM_FN(pce_pacland) - -struct BurnDriver BurnDrvpce_pacland = { - "pce_pacland", NULL, NULL, NULL, "1989", - "Pac-land\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_paclandRomInfo, pce_paclandRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Pachio Kun - Juuban Shoubu - -static struct BurnRomInfo pce_pachikunRomDesc[] = { - { "pachio kun - juuban shoubu (japan).pce", 0x080000, 0x4148fd7c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pachikun) -STD_ROM_FN(pce_pachikun) - -struct BurnDriver BurnDrvpce_pachikun = { - "pce_pachikun", NULL, NULL, NULL, "1992", - "Pachio Kun - Juuban Shoubu\0", NULL, "Coconuts Japan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pachikunRomInfo, pce_pachikunRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Paranoia - -static struct BurnRomInfo pce_paranoiaRomDesc[] = { - { "paranoia (japan).pce", 0x040000, 0x9893e0e6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_paranoia) -STD_ROM_FN(pce_paranoia) - -struct BurnDriver BurnDrvpce_paranoia = { - "pce_paranoia", NULL, NULL, NULL, "1990", - "Paranoia\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_paranoiaRomInfo, pce_paranoiaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Parasol Stars - The Story of Bubble Bobble III - -static struct BurnRomInfo pce_parasolRomDesc[] = { - { "parasol stars - the story of bubble bobble iii (japan).pce", 0x060000, 0x51e86451, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_parasol) -STD_ROM_FN(pce_parasol) - -struct BurnDriver BurnDrvpce_parasol = { - "pce_parasol", NULL, NULL, NULL, "1991", - "Parasol Stars - The Story of Bubble Bobble III\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_parasolRomInfo, pce_parasolRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Parodius da! - Shinwa Kara Owarai He - -static struct BurnRomInfo pce_parodiusRomDesc[] = { - { "parodius da! - shinwa kara owarai he (japan).pce", 0x100000, 0x647718f9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_parodius) -STD_ROM_FN(pce_parodius) - -struct BurnDriver BurnDrvpce_parodius = { - "pce_parodius", NULL, NULL, NULL, "1992", - "Parodius da! - Shinwa Kara Owarai He\0", NULL, "Konami", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_parodiusRomInfo, pce_parodiusRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// PC Denjin - Punkic Cyborgs - -static struct BurnRomInfo pce_pcdenjRomDesc[] = { - { "pc denjin - punkic cyborgs (japan).pce", 0x080000, 0x740491c2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pcdenj) -STD_ROM_FN(pce_pcdenj) - -struct BurnDriverD BurnDrvpce_pcdenj = { - "pce_pcdenj", NULL, NULL, NULL, "1992", - "PC Denjin - Punkic Cyborgs\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pcdenjRomInfo, pce_pcdenjRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// PC Denjin - Punkic Cyborgs (Alt) - -static struct BurnRomInfo pce_pcdenjaRomDesc[] = { - { "pc denjin - punkic cyborgs (japan) [a].pce", 0x080000, 0x8fb4f228, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pcdenja) -STD_ROM_FN(pce_pcdenja) - -struct BurnDriverD BurnDrvpce_pcdenja = { - "pce_pcdenja", "pce_pcdenj", NULL, NULL, "1992", - "PC Denjin - Punkic Cyborgs (Alt)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pcdenjaRomInfo, pce_pcdenjaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// PC Genjin - Pithecanthropus Computerurus - -static struct BurnRomInfo pce_pcgenjRomDesc[] = { - { "pc genjin - pithecanthropus computerurus (japan).pce", 0x060000, 0x2cb5cd55, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pcgenj) -STD_ROM_FN(pce_pcgenj) - -struct BurnDriver BurnDrvpce_pcgenj = { - "pce_pcgenj", NULL, NULL, NULL, "1989", - "PC Genjin - Pithecanthropus Computerurus\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pcgenjRomInfo, pce_pcgenjRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// PC Genjin - Pithecanthropus Computerurus (Alt) - -static struct BurnRomInfo pce_pcgenjaRomDesc[] = { - { "pc genjin - pithecanthropus computerurus (japan) [a].pce", 0x060000, 0x67b35e6e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pcgenja) -STD_ROM_FN(pce_pcgenja) - -struct BurnDriver BurnDrvpce_pcgenja = { - "pce_pcgenja", "pce_pcgenj", NULL, NULL, "1989", - "PC Genjin - Pithecanthropus Computerurus (Alt)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pcgenjaRomInfo, pce_pcgenjaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// PC Genjin 2 - Pithecanthropus Computerurus - -static struct BurnRomInfo pce_pcgenj2RomDesc[] = { - { "pc genjin 2 - pithecanthropus computerurus (japan).pce", 0x080000, 0x3028f7ca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pcgenj2) -STD_ROM_FN(pce_pcgenj2) - -struct BurnDriver BurnDrvpce_pcgenj2 = { - "pce_pcgenj2", NULL, NULL, NULL, "1991", - "PC Genjin 2 - Pithecanthropus Computerurus\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pcgenj2RomInfo, pce_pcgenj2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// PC Genjin 3 - Pithecanthropus Computerurus - -static struct BurnRomInfo pce_pcgenj3RomDesc[] = { - { "pc genjin 3 - pithecanthropus computerurus (japan).pce", 0x100000, 0xa170b60e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pcgenj3) -STD_ROM_FN(pce_pcgenj3) - -struct BurnDriver BurnDrvpce_pcgenj3 = { - "pce_pcgenj3", NULL, NULL, NULL, "1993", - "PC Genjin 3 - Pithecanthropus Computerurus\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pcgenj3RomInfo, pce_pcgenj3RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// PC Genjin 3 - Pithecanthropus Computerurus (Taikenban) - -static struct BurnRomInfo pce_pcgenj3tRomDesc[] = { - { "pc genjin 3 - pithecanthropus computerurus (taikenban) (japan).pce", 0x0c0000, 0x6f6ed301, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pcgenj3t) -STD_ROM_FN(pce_pcgenj3t) - -struct BurnDriver BurnDrvpce_pcgenj3t = { - "pce_pcgenj3t", NULL, NULL, NULL, "1993", - "PC Genjin 3 - Pithecanthropus Computerurus (Taikenban)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pcgenj3tRomInfo, pce_pcgenj3tRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// PC Pachi-slot - -static struct BurnRomInfo pce_pcpachiRomDesc[] = { - { "pc pachi-slot (japan).pce", 0x080000, 0x0aa88f33, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pcpachi) -STD_ROM_FN(pce_pcpachi) - -struct BurnDriver BurnDrvpce_pcpachi = { - "pce_pcpachi", NULL, NULL, NULL, "1992", - "PC Pachi-slot\0", NULL, "Game Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pcpachiRomInfo, pce_pcpachiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Populous - -static struct BurnRomInfo pce_populousRomDesc[] = { - { "populous (japan).pce", 0x080000, 0x083c956a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_populous) -STD_ROM_FN(pce_populous) - -struct BurnDriver BurnDrvpce_populous = { - "pce_populous", NULL, NULL, NULL, "1991", - "Populous\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_populousRomInfo, pce_populousRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - populousInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Populous (Alt) - -static struct BurnRomInfo pce_populous1RomDesc[] = { - { "populous (japan) [a].pce", 0x080000, 0x0a9ade99, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_populous1) -STD_ROM_FN(pce_populous1) - -struct BurnDriver BurnDrvpce_populous1 = { - "pce_populous1", "pce_populous", NULL, NULL, "1991", - "Populous (Alt)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_populous1RomInfo, pce_populous1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - populousInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power Drift - -static struct BurnRomInfo pce_pdriftRomDesc[] = { - { "power drift (japan).pce", 0x080000, 0x25e0f6e9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pdrift) -STD_ROM_FN(pce_pdrift) - -struct BurnDriver BurnDrvpce_pdrift = { - "pce_pdrift", NULL, NULL, NULL, "1990", - "Power Drift\0", NULL, "Asmik", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pdriftRomInfo, pce_pdriftRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power Drift (Alt) - -static struct BurnRomInfo pce_pdrift1RomDesc[] = { - { "power drift (japan) [a].pce", 0x080000, 0x99e6d988, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pdrift1) -STD_ROM_FN(pce_pdrift1) - -struct BurnDriver BurnDrvpce_pdrift1 = { - "pce_pdrift1", "pce_pdrift", NULL, NULL, "1990", - "Power Drift (Alt)\0", NULL, "Asmik", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pdrift1RomInfo, pce_pdrift1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power Eleven - -static struct BurnRomInfo pce_power11RomDesc[] = { - { "power eleven (japan).pce", 0x060000, 0x3e647d8b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_power11) -STD_ROM_FN(pce_power11) - -struct BurnDriver BurnDrvpce_power11 = { - "pce_power11", NULL, NULL, NULL, "1991", - "Power Eleven\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_power11RomInfo, pce_power11RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power Gate - -static struct BurnRomInfo pce_powergatRomDesc[] = { - { "power gate (japan).pce", 0x040000, 0xbe8b6e3b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_powergat) -STD_ROM_FN(pce_powergat) - -struct BurnDriver BurnDrvpce_powergat = { - "pce_powergat", NULL, NULL, NULL, "1991", - "Power Gate\0", NULL, "Pack-In-Video", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_powergatRomInfo, pce_powergatRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power Golf - -static struct BurnRomInfo pce_pgolfRomDesc[] = { - { "power golf (japan).pce", 0x060000, 0xea324f07, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pgolf) -STD_ROM_FN(pce_pgolf) - -struct BurnDriver BurnDrvpce_pgolf = { - "pce_pgolf", NULL, NULL, NULL, "1989", - "Power Golf\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pgolfRomInfo, pce_pgolfRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power League '93 - -static struct BurnRomInfo pce_pleag93RomDesc[] = { - { "power league '93 (japan).pce", 0x0c0000, 0x7d3e6f33, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pleag93) -STD_ROM_FN(pce_pleag93) - -struct BurnDriver BurnDrvpce_pleag93 = { - "pce_pleag93", NULL, NULL, NULL, "1993", - "Power League '93\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pleag93RomInfo, pce_pleag93RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power League (All Star Version) - -static struct BurnRomInfo pce_pleagasRomDesc[] = { - { "power league (all star version) (japan).pce", 0x040000, 0x04a85769, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pleagas) -STD_ROM_FN(pce_pleagas) - -struct BurnDriver BurnDrvpce_pleagas = { - "pce_pleagas", NULL, NULL, NULL, "19??", - "Power League (All Star Version)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pleagasRomInfo, pce_pleagasRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power League - -static struct BurnRomInfo pce_pleagueRomDesc[] = { - { "power league (japan).pce", 0x040000, 0x69180984, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pleague) -STD_ROM_FN(pce_pleague) - -struct BurnDriver BurnDrvpce_pleague = { - "pce_pleague", NULL, NULL, NULL, "1988", - "Power League\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pleagueRomInfo, pce_pleagueRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power League II - -static struct BurnRomInfo pce_pleag2RomDesc[] = { - { "power league ii (japan).pce", 0x060000, 0xc5fdfa89, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pleag2) -STD_ROM_FN(pce_pleag2) - -struct BurnDriver BurnDrvpce_pleag2 = { - "pce_pleag2", NULL, NULL, NULL, "1989", - "Power League II\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pleag2RomInfo, pce_pleag2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power League III - -static struct BurnRomInfo pce_pleag3RomDesc[] = { - { "power league iii (japan).pce", 0x060000, 0x8aa4b220, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pleag3) -STD_ROM_FN(pce_pleag3) - -struct BurnDriver BurnDrvpce_pleag3 = { - "pce_pleag3", NULL, NULL, NULL, "1990", - "Power League III\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pleag3RomInfo, pce_pleag3RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power League IV - -static struct BurnRomInfo pce_pleag4RomDesc[] = { - { "power league iv (japan).pce", 0x080000, 0x30cc3563, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pleag4) -STD_ROM_FN(pce_pleag4) - -struct BurnDriver BurnDrvpce_pleag4 = { - "pce_pleag4", NULL, NULL, NULL, "1991", - "Power League IV\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pleag4RomInfo, pce_pleag4RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power League V - -static struct BurnRomInfo pce_pleag5RomDesc[] = { - { "power league v (japan).pce", 0x0c0000, 0x8b61e029, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_pleag5) -STD_ROM_FN(pce_pleag5) - -struct BurnDriver BurnDrvpce_pleag5 = { - "pce_pleag5", NULL, NULL, NULL, "1992", - "Power League V\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_pleag5RomInfo, pce_pleag5RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power Sports - -static struct BurnRomInfo pce_psportsRomDesc[] = { - { "power sports (japan).pce", 0x080000, 0x29eec024, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_psports) -STD_ROM_FN(pce_psports) - -struct BurnDriver BurnDrvpce_psports = { - "pce_psports", NULL, NULL, NULL, "1992", - "Power Sports\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_psportsRomInfo, pce_psportsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power Tennis - -static struct BurnRomInfo pce_ptennisRomDesc[] = { - { "power tennis (japan).pce", 0x080000, 0x8def5aa1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ptennis) -STD_ROM_FN(pce_ptennis) - -struct BurnDriverD BurnDrvpce_ptennis = { - "pce_ptennis", NULL, NULL, NULL, "1993", - "Power Tennis\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ptennisRomInfo, pce_ptennisRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Pro Tennis World Court - -static struct BurnRomInfo pce_ptennwcRomDesc[] = { - { "pro tennis world court (japan).pce", 0x040000, 0x11a36745, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ptennwc) -STD_ROM_FN(pce_ptennwc) - -struct BurnDriver BurnDrvpce_ptennwc = { - "pce_ptennwc", NULL, NULL, NULL, "1988", - "Pro Tennis World Court\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ptennwcRomInfo, pce_ptennwcRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Pro Yakyuu World Stadium '91 - -static struct BurnRomInfo pce_proyak91RomDesc[] = { - { "pro yakyuu world stadium '91 (japan).pce", 0x040000, 0x66b167a9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_proyak91) -STD_ROM_FN(pce_proyak91) - -struct BurnDriver BurnDrvpce_proyak91 = { - "pce_proyak91", NULL, NULL, NULL, "1991", - "Pro Yakyuu World Stadium '91\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_proyak91RomInfo, pce_proyak91RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Pro Yakyuu World Stadium - -static struct BurnRomInfo pce_proyakRomDesc[] = { - { "pro yakyuu world stadium (japan).pce", 0x040000, 0x34e089a9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_proyak) -STD_ROM_FN(pce_proyak) - -struct BurnDriver BurnDrvpce_proyak = { - "pce_proyak", NULL, NULL, NULL, "1988", - "Pro Yakyuu World Stadium\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_proyakRomInfo, pce_proyakRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Psycho Chaser - -static struct BurnRomInfo pce_psychasRomDesc[] = { - { "psycho chaser (japan).pce", 0x040000, 0x03883ee8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_psychas) -STD_ROM_FN(pce_psychas) - -struct BurnDriver BurnDrvpce_psychas = { - "pce_psychas", NULL, NULL, NULL, "1990", - "Psycho Chaser\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_psychasRomInfo, pce_psychasRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Puzzle Boy - -static struct BurnRomInfo pce_puzzlboyRomDesc[] = { - { "puzzle boy (japan).pce", 0x040000, 0xfaa6e187, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_puzzlboy) -STD_ROM_FN(pce_puzzlboy) - -struct BurnDriver BurnDrvpce_puzzlboy = { - "pce_puzzlboy", NULL, NULL, NULL, "1991", - "Puzzle Boy\0", NULL, "Nihon Telenet", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_puzzlboyRomInfo, pce_puzzlboyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Puzznic - -static struct BurnRomInfo pce_puzznicRomDesc[] = { - { "puzznic (japan).pce", 0x040000, 0x965c95b3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_puzznic) -STD_ROM_FN(pce_puzznic) - -struct BurnDriver BurnDrvpce_puzznic = { - "pce_puzznic", NULL, NULL, NULL, "1990", - "Puzznic\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_puzznicRomInfo, pce_puzznicRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Quiz Toukou Shashin - -static struct BurnRomInfo pce_quiztsRomDesc[] = { - { "quiz toukou shashin (japan).pce", 0x100000, 0xf2e6856d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_quizts) -STD_ROM_FN(pce_quizts) - -struct BurnDriver BurnDrvpce_quizts = { - "pce_quizts", NULL, NULL, NULL, "19??", - "Quiz Toukou Shashin\0", NULL, "Game Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_quiztsRomInfo, pce_quiztsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// R-Type Part-1 - -static struct BurnRomInfo pce_rtypep1RomDesc[] = { - { "r-type part-1 (japan).pce", 0x040000, 0xcec3d28a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_rtypep1) -STD_ROM_FN(pce_rtypep1) - -struct BurnDriver BurnDrvpce_rtypep1 = { - "pce_rtypep1", NULL, NULL, NULL, "1988", - "R-Type Part-1\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_rtypep1RomInfo, pce_rtypep1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// R-Type Part-2 - -static struct BurnRomInfo pce_rtypep2RomDesc[] = { - { "r-type part-2 (japan).pce", 0x040000, 0xf207ecae, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_rtypep2) -STD_ROM_FN(pce_rtypep2) - -struct BurnDriver BurnDrvpce_rtypep2 = { - "pce_rtypep2", NULL, NULL, NULL, "1988", - "R-Type Part-2\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_rtypep2RomInfo, pce_rtypep2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Rabio Lepus Special - -static struct BurnRomInfo pce_rabiolepRomDesc[] = { - { "rabio lepus special (japan).pce", 0x060000, 0xd8373de6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_rabiolep) -STD_ROM_FN(pce_rabiolep) - -struct BurnDriver BurnDrvpce_rabiolep = { - "pce_rabiolep", NULL, NULL, NULL, "1990", - "Rabio Lepus Special\0", NULL, "Video System", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_rabiolepRomInfo, pce_rabiolepRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Racing Damashii - -static struct BurnRomInfo pce_racindamRomDesc[] = { - { "racing damashii (japan).pce", 0x080000, 0x3e79734c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_racindam) -STD_ROM_FN(pce_racindam) - -struct BurnDriver BurnDrvpce_racindam = { - "pce_racindam", NULL, NULL, NULL, "1991", - "Racing Damashii\0", NULL, "Irem", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_racindamRomInfo, pce_racindamRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Raiden - -static struct BurnRomInfo pce_raidenRomDesc[] = { - { "raiden (japan).pce", 0x0c0000, 0x850829f2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_raiden) -STD_ROM_FN(pce_raiden) - -struct BurnDriver BurnDrvpce_raiden = { - "pce_raiden", NULL, NULL, NULL, "1991", - "Raiden\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_raidenRomInfo, pce_raidenRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Rastan Saga II - -static struct BurnRomInfo pce_rastan2RomDesc[] = { - { "rastan saga ii (japan).pce", 0x060000, 0x00c38e69, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_rastan2) -STD_ROM_FN(pce_rastan2) - -struct BurnDriver BurnDrvpce_rastan2 = { - "pce_rastan2", NULL, NULL, NULL, "1990", - "Rastan Saga II\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_rastan2RomInfo, pce_rastan2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Rock-on - -static struct BurnRomInfo pce_rockonRomDesc[] = { - { "rock-on (japan).pce", 0x060000, 0x2fd65312, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_rockon) -STD_ROM_FN(pce_rockon) - -struct BurnDriver BurnDrvpce_rockon = { - "pce_rockon", NULL, NULL, NULL, "1989", - "Rock-on\0", NULL, "Big Club", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_rockonRomInfo, pce_rockonRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ryuukyuu - -static struct BurnRomInfo pce_ryukyuRomDesc[] = { - { "ryukyu (japan).pce", 0x040000, 0x91e6896f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_ryukyu) -STD_ROM_FN(pce_ryukyu) - -struct BurnDriver BurnDrvpce_ryukyu = { - "pce_ryukyu", NULL, NULL, NULL, "1990", - "Ryuukyuu\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_ryukyuRomInfo, pce_ryukyuRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Sadakichi 7 Series - Hideyoshi no Ougon - -static struct BurnRomInfo pce_sadaki7RomDesc[] = { - { "sadakichi 7 series - hideyoshi no ougon (japan).pce", 0x040000, 0xf999356f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sadaki7) -STD_ROM_FN(pce_sadaki7) - -struct BurnDriver BurnDrvpce_sadaki7 = { - "pce_sadaki7", NULL, NULL, NULL, "1988", - "Sadakichi 7 Series - Hideyoshi no Ougon\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sadaki7RomInfo, pce_sadaki7RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Saigo no Nindou - Ninja Spirit - -static struct BurnRomInfo pce_saigoninRomDesc[] = { - { "saigo no nindou - ninja spirit (japan).pce", 0x080000, 0x0590a156, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_saigonin) -STD_ROM_FN(pce_saigonin) - -struct BurnDriver BurnDrvpce_saigonin = { - "pce_saigonin", NULL, NULL, NULL, "1990", - "Saigo no Nindou - Ninja Spirit\0", NULL, "Irem", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_saigoninRomInfo, pce_saigoninRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Salamander - -static struct BurnRomInfo pce_salamandRomDesc[] = { - { "salamander (japan).pce", 0x040000, 0xfaecce20, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_salamand) -STD_ROM_FN(pce_salamand) - -struct BurnDriver BurnDrvpce_salamand = { - "pce_salamand", NULL, NULL, NULL, "1991", - "Salamander\0", NULL, "Konami", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_salamandRomInfo, pce_salamandRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Sekigahara - -static struct BurnRomInfo pce_sekigahaRomDesc[] = { - { "sekigahara (japan).pce", 0x080000, 0x2e955051, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sekigaha) -STD_ROM_FN(pce_sekigaha) - -struct BurnDriver BurnDrvpce_sekigaha = { - "pce_sekigaha", NULL, NULL, NULL, "1990", - "Sekigahara\0", NULL, "Tonkin House", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sekigahaRomInfo, pce_sekigahaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Sengoku Mahjong - -static struct BurnRomInfo pce_sengokmjRomDesc[] = { - { "sengoku mahjong (japan).pce", 0x040000, 0x90e6bf49, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sengokmj) -STD_ROM_FN(pce_sengokmj) - -struct BurnDriver BurnDrvpce_sengokmj = { - "pce_sengokmj", NULL, NULL, NULL, "1988", - "Sengoku Mahjong\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sengokmjRomInfo, pce_sengokmjRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Shanghai - -static struct BurnRomInfo pce_shanghaiRomDesc[] = { - { "shanghai (japan).pce", 0x020000, 0x6923d736, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_shanghai) -STD_ROM_FN(pce_shanghai) - -struct BurnDriver BurnDrvpce_shanghai = { - "pce_shanghai", NULL, NULL, NULL, "1987", - "Shanghai\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_shanghaiRomInfo, pce_shanghaiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Shinobi - -static struct BurnRomInfo pce_shinobiRomDesc[] = { - { "shinobi (japan).pce", 0x060000, 0xbc655cf3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_shinobi) -STD_ROM_FN(pce_shinobi) - -struct BurnDriver BurnDrvpce_shinobi = { - "pce_shinobi", NULL, NULL, NULL, "1989", - "Shinobi\0", NULL, "Asmik", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_shinobiRomInfo, pce_shinobiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Shiryou Sensen - -static struct BurnRomInfo pce_shiryoRomDesc[] = { - { "shiryou sensen (japan).pce", 0x040000, 0x469a0fdf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_shiryo) -STD_ROM_FN(pce_shiryo) - -struct BurnDriver BurnDrvpce_shiryo = { - "pce_shiryo", NULL, NULL, NULL, "1989", - "Shiryou Sensen\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_shiryoRomInfo, pce_shiryoRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Shougi Shodan Icchokusen - -static struct BurnRomInfo pce_shogisiRomDesc[] = { - { "shougi shodan icchokusen (japan).pce", 0x040000, 0x23ec8970, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_shogisi) -STD_ROM_FN(pce_shogisi) - -struct BurnDriver BurnDrvpce_shogisi = { - "pce_shogisi", NULL, NULL, NULL, "1990", - "Shougi Shodan Icchokusen\0", NULL, "Home Data", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_shogisiRomInfo, pce_shogisiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Shougi Shoshinsha Muyou - -static struct BurnRomInfo pce_shogismRomDesc[] = { - { "shougi shoshinsha muyou (japan).pce", 0x040000, 0x457f2bc4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_shogism) -STD_ROM_FN(pce_shogism) - -struct BurnDriver BurnDrvpce_shogism = { - "pce_shogism", NULL, NULL, NULL, "1991", - "Shougi Shoshinsha Muyou\0", NULL, "Home Data", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_shogismRomInfo, pce_shogismRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Sidearms - Hyper Dyne - -static struct BurnRomInfo pce_sidearmsRomDesc[] = { - { "sidearms - hyper dyne (japan).pce", 0x040000, 0xe5e7b8b7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sidearms) -STD_ROM_FN(pce_sidearms) - -struct BurnDriver BurnDrvpce_sidearms = { - "pce_sidearms", NULL, NULL, NULL, "1989", - "Sidearms - Hyper Dyne\0", NULL, "NEC", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sidearmsRomInfo, pce_sidearmsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 242, 4, 3 -}; - - -// Silent Debuggers - -static struct BurnRomInfo pce_silentdRomDesc[] = { - { "silent debuggers (japan).pce", 0x080000, 0x616ea179, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_silentd) -STD_ROM_FN(pce_silentd) - -struct BurnDriver BurnDrvpce_silentd = { - "pce_silentd", NULL, NULL, NULL, "1991", - "Silent Debuggers\0", NULL, "Data East", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_silentdRomInfo, pce_silentdRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Sindibad Chitei no Dai Makyuu - -static struct BurnRomInfo pce_sindibadRomDesc[] = { - { "sindibad chitei no dai makyuu (japan).pce", 0x060000, 0xb5c4eebd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sindibad) -STD_ROM_FN(pce_sindibad) - -struct BurnDriver BurnDrvpce_sindibad = { - "pce_sindibad", NULL, NULL, NULL, "1990", - "Sindibad Chitei no Dai Makyuu\0", NULL, "IGS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sindibadRomInfo, pce_sindibadRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Skweek - -static struct BurnRomInfo pce_skweekRomDesc[] = { - { "skweek (japan).pce", 0x040000, 0x4d539c9f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_skweek) -STD_ROM_FN(pce_skweek) - -struct BurnDriver BurnDrvpce_skweek = { - "pce_skweek", NULL, NULL, NULL, "1991", - "Skweek\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_skweekRomInfo, pce_skweekRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Soldier Blade - -static struct BurnRomInfo pce_soldbladRomDesc[] = { - { "soldier blade (japan).pce", 0x080000, 0x8420b12b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_soldblad) -STD_ROM_FN(pce_soldblad) - -struct BurnDriver BurnDrvpce_soldblad = { - "pce_soldblad", NULL, NULL, NULL, "1992", - "Soldier Blade\0", "Hangs at first boss", "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_soldbladRomInfo, pce_soldbladRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Soldier Blade Special - Caravan Stage - -static struct BurnRomInfo pce_soldblasRomDesc[] = { - { "soldier blade special - caravan stage (japan).pce", 0x080000, 0xf39f38ed, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_soldblas) -STD_ROM_FN(pce_soldblas) - -struct BurnDriver BurnDrvpce_soldblas = { - "pce_soldblas", NULL, NULL, NULL, "19??", - "Soldier Blade Special - Caravan Stage\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_soldblasRomInfo, pce_soldblasRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Son Son II - -static struct BurnRomInfo pce_sonson2RomDesc[] = { - { "son son ii (japan).pce", 0x040000, 0xd7921df2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sonson2) -STD_ROM_FN(pce_sonson2) - -struct BurnDriver BurnDrvpce_sonson2 = { - "pce_sonson2", NULL, NULL, NULL, "1989", - "Son Son II\0", NULL, "NEC", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sonson2RomInfo, pce_sonson2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Sokoban World - -static struct BurnRomInfo pce_sokobanRomDesc[] = { - { "soukoban world (japan).pce", 0x020000, 0xfb37ddc4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sokoban) -STD_ROM_FN(pce_sokoban) - -struct BurnDriver BurnDrvpce_sokoban = { - "pce_sokoban", NULL, NULL, NULL, "1990", - "Sokoban World\0", NULL, "Media Rings Corporation", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sokobanRomInfo, pce_sokobanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Space Harrier - -static struct BurnRomInfo pce_sharrierRomDesc[] = { - { "space harrier (japan).pce", 0x080000, 0x64580427, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sharrier) -STD_ROM_FN(pce_sharrier) - -struct BurnDriver BurnDrvpce_sharrier = { - "pce_sharrier", NULL, NULL, NULL, "1988", - "Space Harrier\0", NULL, "NEC", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sharrierRomInfo, pce_sharrierRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Space Invaders - Fukkatsu no Hi - -static struct BurnRomInfo pce_spaceinvRomDesc[] = { - { "space invaders - fukkatsu no hi (japan).pce", 0x040000, 0x99496db3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_spaceinv) -STD_ROM_FN(pce_spaceinv) - -struct BurnDriver BurnDrvpce_spaceinv = { - "pce_spaceinv", NULL, NULL, NULL, "1990", - "Space Invaders - Fukkatsu no Hi\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_spaceinvRomInfo, pce_spaceinvRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Special Criminal Investigation - -static struct BurnRomInfo pce_sciRomDesc[] = { - { "special criminal investigation (japan).pce", 0x080000, 0x09a0bfcc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sci) -STD_ROM_FN(pce_sci) - -struct BurnDriver BurnDrvpce_sci = { - "pce_sci", NULL, NULL, NULL, "1991", - "Special Criminal Investigation\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sciRomInfo, pce_sciRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Spin Pair - -static struct BurnRomInfo pce_spinpairRomDesc[] = { - { "spin pair (japan).pce", 0x040000, 0x1c6ff459, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_spinpair) -STD_ROM_FN(pce_spinpair) - -struct BurnDriver BurnDrvpce_spinpair = { - "pce_spinpair", NULL, NULL, NULL, "1990", - "Spin Pair\0", NULL, "Media Rings Corporation", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_spinpairRomInfo, pce_spinpairRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Spiral Wave - -static struct BurnRomInfo pce_spirwaveRomDesc[] = { - { "spiral wave (japan).pce", 0x080000, 0xa5290dd0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_spirwave) -STD_ROM_FN(pce_spirwave) - -struct BurnDriver BurnDrvpce_spirwave = { - "pce_spirwave", NULL, NULL, NULL, "1991", - "Spiral Wave\0", NULL, "Media Rings Corporation", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_spirwaveRomInfo, pce_spirwaveRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Splatterhouse - -static struct BurnRomInfo pce_splatthRomDesc[] = { - { "splatterhouse (japan).pce", 0x080000, 0x6b319457, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_splatth) -STD_ROM_FN(pce_splatth) - -struct BurnDriver BurnDrvpce_splatth = { - "pce_splatth", NULL, NULL, NULL, "1990", - "Splatterhouse\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_splatthRomInfo, pce_splatthRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Stratego - -static struct BurnRomInfo pce_strategoRomDesc[] = { - { "stratego (japan).pce", 0x040000, 0x727f4656, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_stratego) -STD_ROM_FN(pce_stratego) - -struct BurnDriver BurnDrvpce_stratego = { - "pce_stratego", NULL, NULL, NULL, "1992", - "Stratego\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_strategoRomInfo, pce_strategoRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Street Fighter II' - Champion Edition - -static struct BurnRomInfo pce_sf2ceRomDesc[] = { - { "street fighter ii' - champion edition (japan).pce", 0x280000, 0xd15cb6bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sf2ce) -STD_ROM_FN(pce_sf2ce) - -struct BurnDriver BurnDrvpce_sf2ce = { - "pce_sf2ce", NULL, NULL, NULL, "1993", - "Street Fighter II' - Champion Edition\0", NULL, "NEC Home Electronics", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sf2ceRomInfo, pce_sf2ceRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Strip Fighter II - -static struct BurnRomInfo pce_stripf2RomDesc[] = { - { "strip fighter ii (japan).pce", 0x100000, 0xd6fc51ce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_stripf2) -STD_ROM_FN(pce_stripf2) - -struct BurnDriver BurnDrvpce_stripf2 = { - "pce_stripf2", NULL, NULL, NULL, "19??", - "Strip Fighter II\0", NULL, "Game Express", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_stripf2RomInfo, pce_stripf2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Super Metal Crusher - -static struct BurnRomInfo pce_smcrushRomDesc[] = { - { "super metal crusher (japan).pce", 0x040000, 0x56488b36, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_smcrush) -STD_ROM_FN(pce_smcrush) - -struct BurnDriver BurnDrvpce_smcrush = { - "pce_smcrush", NULL, NULL, NULL, "1991", - "Super Metal Crusher\0", NULL, "Pack-In-Video", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_smcrushRomInfo, pce_smcrushRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Super Momotarou Dentetsu - -static struct BurnRomInfo pce_smomoRomDesc[] = { - { "super momotarou dentetsu (japan).pce", 0x060000, 0x3eb5304a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_smomo) -STD_ROM_FN(pce_smomo) - -struct BurnDriver BurnDrvpce_smomo = { - "pce_smomo", NULL, NULL, NULL, "1989", - "Super Momotarou Dentetsu\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_smomoRomInfo, pce_smomoRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Super Momotarou Dentetsu II - -static struct BurnRomInfo pce_smomo2RomDesc[] = { - { "super momotarou dentetsu ii (japan).pce", 0x0c0000, 0x2bc023fc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_smomo2) -STD_ROM_FN(pce_smomo2) - -struct BurnDriver BurnDrvpce_smomo2 = { - "pce_smomo2", NULL, NULL, NULL, "1991", - "Super Momotarou Dentetsu II\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_smomo2RomInfo, pce_smomo2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Super Star Soldier - -static struct BurnRomInfo pce_sssoldrRomDesc[] = { - { "super star soldier (japan).pce", 0x080000, 0x5d0e3105, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sssoldr) -STD_ROM_FN(pce_sssoldr) - -struct BurnDriver BurnDrvpce_sssoldr = { - "pce_sssoldr", NULL, NULL, NULL, "1990", - "Super Star Soldier\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sssoldrRomInfo, pce_sssoldrRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Super Volleyball - -static struct BurnRomInfo pce_svolleyRomDesc[] = { - { "super volleyball (japan).pce", 0x040000, 0xce2e4f9f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_svolley) -STD_ROM_FN(pce_svolley) - -struct BurnDriver BurnDrvpce_svolley = { - "pce_svolley", NULL, NULL, NULL, "1990", - "Super Volleyball\0", NULL, "Video System", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_svolleyRomInfo, pce_svolleyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Susanoo Densetsu - -static struct BurnRomInfo pce_susanoRomDesc[] = { - { "susanoo densetsu (japan).pce", 0x080000, 0xcf73d8fc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_susano) -STD_ROM_FN(pce_susano) - -struct BurnDriver BurnDrvpce_susano = { - "pce_susano", NULL, NULL, NULL, "1989", - "Susanoo Densetsu\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_susanoRomInfo, pce_susanoRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Taito Chase H.Q. - -static struct BurnRomInfo pce_chasehqRomDesc[] = { - { "taito chase h.q. (japan).pce", 0x060000, 0x6f4fd790, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_chasehq) -STD_ROM_FN(pce_chasehq) - -struct BurnDriver BurnDrvpce_chasehq = { - "pce_chasehq", NULL, NULL, NULL, "1990", - "Taito Chase H.Q.\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_chasehqRomInfo, pce_chasehqRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Takahashi Meijin no Shin Boukenjima - -static struct BurnRomInfo pce_takameibRomDesc[] = { - { "takahashi meijin no shin boukenjima (japan).pce", 0x080000, 0xe415ea19, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_takameib) -STD_ROM_FN(pce_takameib) - -struct BurnDriver BurnDrvpce_takameib = { - "pce_takameib", NULL, NULL, NULL, "1992", - "Takahashi Meijin no Shin Boukenjima\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_takameibRomInfo, pce_takameibRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Takeda Shingen - -static struct BurnRomInfo pce_shingenRomDesc[] = { - { "takeda shingen (japan).pce", 0x040000, 0xf022be13, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_shingen) -STD_ROM_FN(pce_shingen) - -struct BurnDriver BurnDrvpce_shingen = { - "pce_shingen", NULL, NULL, NULL, "1989", - "Takeda Shingen\0", NULL, "Aicom", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_shingenRomInfo, pce_shingenRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Takeda Shingen (Alt) - -static struct BurnRomInfo pce_shingen1RomDesc[] = { - { "takeda shingen (japan) [a].pce", 0x040000, 0xdf7af71c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_shingen1) -STD_ROM_FN(pce_shingen1) - -struct BurnDriver BurnDrvpce_shingen1 = { - "pce_shingen1", "pce_shingen", NULL, NULL, "1989", - "Takeda Shingen (Alt)\0", NULL, "Aicom", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_shingen1RomInfo, pce_shingen1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tatsujin - -static struct BurnRomInfo pce_tatsujinRomDesc[] = { - { "tatsujin (japan).pce", 0x080000, 0xa6088275, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tatsujin) -STD_ROM_FN(pce_tatsujin) - -struct BurnDriver BurnDrvpce_tatsujin = { - "pce_tatsujin", NULL, NULL, NULL, "1992", - "Tatsujin\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tatsujinRomInfo, pce_tatsujinRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tatsujin (Prototype) - -static struct BurnRomInfo pce_tatsujinpRomDesc[] = { - { "tatsujin (japan) (proto).pce", 0x080000, 0xc1b26659, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tatsujinp) -STD_ROM_FN(pce_tatsujinp) - -struct BurnDriver BurnDrvpce_tatsujinp = { - "pce_tatsujinp", "pce_tatsujin", NULL, NULL, "1992", - "Tatsujin (Prototype)\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tatsujinpRomInfo, pce_tatsujinpRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tatsu No Ko Fighter - -static struct BurnRomInfo pce_tatsunokRomDesc[] = { - { "tatsunoko fighter (japan).pce", 0x040000, 0xeeb6dd43, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tatsunok) -STD_ROM_FN(pce_tatsunok) - -struct BurnDriver BurnDrvpce_tatsunok = { - "pce_tatsunok", NULL, NULL, NULL, "1989", - "Tatsu No Ko Fighter\0", NULL, "Tonkin House", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tatsunokRomInfo, pce_tatsunokRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tennokoe Bank - -static struct BurnRomInfo pce_tennokoeRomDesc[] = { - { "tennokoe bank (japan).pce", 0x020000, 0x3b3808bd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tennokoe) -STD_ROM_FN(pce_tennokoe) - -struct BurnDriverD BurnDrvpce_tennokoe = { - "pce_tennokoe", NULL, NULL, NULL, "1991", - "Tennokoe Bank\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tennokoeRomInfo, pce_tennokoeRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tenseiryuu - Saint Dragon - -static struct BurnRomInfo pce_sdragonRomDesc[] = { - { "tenseiryuu - saint dragon (japan).pce", 0x060000, 0x2e278ccb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_sdragon) -STD_ROM_FN(pce_sdragon) - -struct BurnDriver BurnDrvpce_sdragon = { - "pce_sdragon", NULL, NULL, NULL, "1990", - "Tenseiryuu - Saint Dragon\0", NULL, "Irem", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_sdragonRomInfo, pce_sdragonRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Terra Cresta II - Mandoraa no Gyakushuu - -static struct BurnRomInfo pce_terracr2RomDesc[] = { - { "terra cresta ii - mandoraa no gyakushuu (japan).pce", 0x080000, 0x1b2d0077, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_terracr2) -STD_ROM_FN(pce_terracr2) - -struct BurnDriver BurnDrvpce_terracr2 = { - "pce_terracr2", NULL, NULL, NULL, "1992", - "Terra Cresta II - Mandoraa no Gyakushuu\0", NULL, "Nihon Bussan", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_terracr2RomInfo, pce_terracr2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Thunder Blade - -static struct BurnRomInfo pce_tbladeRomDesc[] = { - { "thunder blade (japan).pce", 0x080000, 0xddc3e809, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tblade) -STD_ROM_FN(pce_tblade) - -struct BurnDriver BurnDrvpce_tblade = { - "pce_tblade", NULL, NULL, NULL, "1990", - "Thunder Blade\0", NULL, "NEC Avenue", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tbladeRomInfo, pce_tbladeRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Time Cruise II - -static struct BurnRomInfo pce_timcrus2RomDesc[] = { - { "time cruise ii (japan).pce", 0x080000, 0xcfec1d6a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_timcrus2) -STD_ROM_FN(pce_timcrus2) - -struct BurnDriver BurnDrvpce_timcrus2 = { - "pce_timcrus2", NULL, NULL, NULL, "1991", - "Time Cruise II\0", NULL, "Face", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_timcrus2RomInfo, pce_timcrus2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Titan - -static struct BurnRomInfo pce_titanRomDesc[] = { - { "titan (japan).pce", 0x040000, 0xd20f382f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_titan) -STD_ROM_FN(pce_titan) - -struct BurnDriver BurnDrvpce_titan = { - "pce_titan", NULL, NULL, NULL, "1991", - "Titan\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_titanRomInfo, pce_titanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Toilet Kids - -static struct BurnRomInfo pce_toiletkRomDesc[] = { - { "toilet kids (japan).pce", 0x080000, 0x53b7784b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_toiletk) -STD_ROM_FN(pce_toiletk) - -struct BurnDriver BurnDrvpce_toiletk = { - "pce_toiletk", NULL, NULL, NULL, "1992", - "Toilet Kids\0", NULL, "Media Rings Corporation", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_toiletkRomInfo, pce_toiletkRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tora e no Michi - -static struct BurnRomInfo pce_toramichRomDesc[] = { - { "tora e no michi (japan).pce", 0x060000, 0x82ae3b16, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_toramich) -STD_ROM_FN(pce_toramich) - -struct BurnDriver BurnDrvpce_toramich = { - "pce_toramich", NULL, NULL, NULL, "1990", - "Tora e no Michi\0", NULL, "Victor Entertainment", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_toramichRomInfo, pce_toramichRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Toshi Tensou Keikaku - Eternal City - -static struct BurnRomInfo pce_etercityRomDesc[] = { - { "toshi tensou keikaku - eternal city (japan).pce", 0x060000, 0xb18d102d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_etercity) -STD_ROM_FN(pce_etercity) - -struct BurnDriver BurnDrvpce_etercity = { - "pce_etercity", NULL, NULL, NULL, "1991", - "Toshi Tensou Keikaku - Eternal City\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_etercityRomInfo, pce_etercityRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// The Tower of Druaga - -static struct BurnRomInfo pce_druagaRomDesc[] = { - { "tower of druaga, the (japan).pce", 0x080000, 0x72e00bc4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_druaga) -STD_ROM_FN(pce_druaga) - -struct BurnDriver BurnDrvpce_druaga = { - "pce_druaga", NULL, NULL, NULL, "1992", - "The Tower of Druaga\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_druagaRomInfo, pce_druagaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Toy Shop Boys - -static struct BurnRomInfo pce_toyshopbRomDesc[] = { - { "toy shop boys (japan).pce", 0x040000, 0x97c5ee9a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_toyshopb) -STD_ROM_FN(pce_toyshopb) - -struct BurnDriver BurnDrvpce_toyshopb = { - "pce_toyshopb", NULL, NULL, NULL, "1990", - "Toy Shop Boys\0", NULL, "Victor", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_toyshopbRomInfo, pce_toyshopbRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tricky - -static struct BurnRomInfo pce_trickyRomDesc[] = { - { "tricky (japan).pce", 0x040000, 0x3aea2f8f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tricky) -STD_ROM_FN(pce_tricky) - -struct BurnDriver BurnDrvpce_tricky = { - "pce_tricky", NULL, NULL, NULL, "1991", - "Tricky\0", NULL, "IGS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_trickyRomInfo, pce_trickyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tsuppari Oozumou - Heisei Ban - -static struct BurnRomInfo pce_tsuppariRomDesc[] = { - { "tsuppari oozumou - heisei ban (japan).pce", 0x040000, 0x61a6e210, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tsuppari) -STD_ROM_FN(pce_tsuppari) - -struct BurnDriver BurnDrvpce_tsuppari = { - "pce_tsuppari", NULL, NULL, NULL, "1993", - "Tsuppari Oozumou - Heisei Ban\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tsuppariRomInfo, pce_tsuppariRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tsuru Teruhito no Jissen Kabushiki Bai Bai Game - -static struct BurnRomInfo pce_baibaiRomDesc[] = { - { "tsuru teruhito no jissen kabushiki bai bai game (japan).pce", 0x040000, 0xf70112e5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_baibai) -STD_ROM_FN(pce_baibai) - -struct BurnDriver BurnDrvpce_baibai = { - "pce_baibai", NULL, NULL, NULL, "1989", - "Tsuru Teruhito no Jissen Kabushiki Bai Bai Game\0", NULL, "Intec", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_baibaiRomInfo, pce_baibaiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// TV Sports Basketball - -static struct BurnRomInfo pce_tvbasketRomDesc[] = { - { "tv sports basketball (japan).pce", 0x080000, 0x10b60601, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tvbasket) -STD_ROM_FN(pce_tvbasket) - -struct BurnDriver BurnDrvpce_tvbasket = { - "pce_tvbasket", NULL, NULL, NULL, "1993", - "TV Sports Basketball\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tvbasketRomInfo, pce_tvbasketRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// TV Sports Football - -static struct BurnRomInfo pce_tvfootblRomDesc[] = { - { "tv sports football (japan).pce", 0x060000, 0x968d908a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tvfootbl) -STD_ROM_FN(pce_tvfootbl) - -struct BurnDriver BurnDrvpce_tvfootbl = { - "pce_tvfootbl", NULL, NULL, NULL, "1991", - "TV Sports Football\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tvfootblRomInfo, pce_tvfootblRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// TV Sports Hockey - -static struct BurnRomInfo pce_tvhockeyRomDesc[] = { - { "tv sports hockey (japan).pce", 0x060000, 0xe7529890, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_tvhockey) -STD_ROM_FN(pce_tvhockey) - -struct BurnDriver BurnDrvpce_tvhockey = { - "pce_tvhockey", NULL, NULL, NULL, "1993", - "TV Sports Hockey\0", NULL, "Victor Interactive Software", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_tvhockeyRomInfo, pce_tvhockeyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// USA Pro Basketball - -static struct BurnRomInfo pce_usaprobsRomDesc[] = { - { "usa pro basketball (japan).pce", 0x040000, 0x1cad4b7f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_usaprobs) -STD_ROM_FN(pce_usaprobs) - -struct BurnDriver BurnDrvpce_usaprobs = { - "pce_usaprobs", NULL, NULL, NULL, "1989", - "USA Pro Basketball\0", NULL, "Aicom", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_usaprobsRomInfo, pce_usaprobsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Veigues - Tactical Gladiator - -static struct BurnRomInfo pce_veiguesRomDesc[] = { - { "veigues - tactical gladiator (japan).pce", 0x060000, 0x04188c5c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_veigues) -STD_ROM_FN(pce_veigues) - -struct BurnDriver BurnDrvpce_veigues = { - "pce_veigues", NULL, NULL, NULL, "1990", - "Veigues - Tactical Gladiator\0", NULL, "Victor Entertainment", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_veiguesRomInfo, pce_veiguesRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Victory Run - -static struct BurnRomInfo pce_victoryrRomDesc[] = { - { "victory run (japan).pce", 0x040000, 0x03e28cff, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_victoryr) -STD_ROM_FN(pce_victoryr) - -struct BurnDriver BurnDrvpce_victoryr = { - "pce_victoryr", NULL, NULL, NULL, "1987", - "Victory Run\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_victoryrRomInfo, pce_victoryrRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Vigilante - -static struct BurnRomInfo pce_vigilantRomDesc[] = { - { "vigilante (japan).pce", 0x060000, 0xe4124fe0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_vigilant) -STD_ROM_FN(pce_vigilant) - -struct BurnDriver BurnDrvpce_vigilant = { - "pce_vigilant", NULL, NULL, NULL, "1989", - "Vigilante\0", NULL, "Irem", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_vigilantRomInfo, pce_vigilantRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Violent Soldier - -static struct BurnRomInfo pce_violentsRomDesc[] = { - { "violent soldier (japan).pce", 0x060000, 0x1bc36b36, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_violents) -STD_ROM_FN(pce_violents) - -struct BurnDriver BurnDrvpce_violents = { - "pce_violents", NULL, NULL, NULL, "1990", - "Violent Soldier\0", NULL, "IGS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_violentsRomInfo, pce_violentsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Volfied - -static struct BurnRomInfo pce_volfiedRomDesc[] = { - { "volfied (japan).pce", 0x060000, 0xad226f30, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_volfied) -STD_ROM_FN(pce_volfied) - -struct BurnDriver BurnDrvpce_volfied = { - "pce_volfied", NULL, NULL, NULL, "1989", - "Volfied\0", NULL, "Taito", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_volfiedRomInfo, pce_volfiedRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// W-ring - The Double Rings - -static struct BurnRomInfo pce_wringRomDesc[] = { - { "w-ring - the double rings (japan).pce", 0x060000, 0xbe990010, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_wring) -STD_ROM_FN(pce_wring) - -struct BurnDriver BurnDrvpce_wring = { - "pce_wring", NULL, NULL, NULL, "1990", - "W-ring - The Double Rings\0", NULL, "Naxat", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_wringRomInfo, pce_wringRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Wai Wai Mahjong - Yukaina Janyuu Tachi - -static struct BurnRomInfo pce_waiwaimjRomDesc[] = { - { "wai wai mahjong - yukaina janyuu tachi (japan).pce", 0x040000, 0xa2a0776e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_waiwaimj) -STD_ROM_FN(pce_waiwaimj) - -struct BurnDriver BurnDrvpce_waiwaimj = { - "pce_waiwaimj", NULL, NULL, NULL, "1989", - "Wai Wai Mahjong - Yukaina Janyuu Tachi\0", NULL, "Video System", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_waiwaimjRomInfo, pce_waiwaimjRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Walkuere no Densetsu - -static struct BurnRomInfo pce_valkyrieRomDesc[] = { - { "walkuere no densetsu (japan).pce", 0x080000, 0xa3303978, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_valkyrie) -STD_ROM_FN(pce_valkyrie) - -struct BurnDriver BurnDrvpce_valkyrie = { - "pce_valkyrie", NULL, NULL, NULL, "1990", - "Walkuere no Densetsu\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_valkyrieRomInfo, pce_valkyrieRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Wallaby!! - Usagi no Kuni no Kangaroo Race - -static struct BurnRomInfo pce_wallabyRomDesc[] = { - { "wallaby!! - usagi no kuni no kangaroo race (japan).pce", 0x060000, 0x0112d0c7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_wallaby) -STD_ROM_FN(pce_wallaby) - -struct BurnDriver BurnDrvpce_wallaby = { - "pce_wallaby", NULL, NULL, NULL, "1990", - "Wallaby!! - Usagi no Kuni no Kangaroo Race\0", NULL, "Masiya", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_wallabyRomInfo, pce_wallabyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Winning Shot - -static struct BurnRomInfo pce_winshotRomDesc[] = { - { "winning shot (japan).pce", 0x040000, 0x9b5ebc58, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_winshot) -STD_ROM_FN(pce_winshot) - -struct BurnDriver BurnDrvpce_winshot = { - "pce_winshot", NULL, NULL, NULL, "1989", - "Winning Shot\0", NULL, "Data East", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_winshotRomInfo, pce_winshotRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Wonder Momo - -static struct BurnRomInfo pce_wondermRomDesc[] = { - { "wonder momo (japan).pce", 0x040000, 0x59d07314, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_wonderm) -STD_ROM_FN(pce_wonderm) - -struct BurnDriver BurnDrvpce_wonderm = { - "pce_wonderm", NULL, NULL, NULL, "1989", - "Wonder Momo\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_wondermRomInfo, pce_wondermRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - wondermomoInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// World Beach Volley - -static struct BurnRomInfo pce_wbeachRomDesc[] = { - { "world beach volley (japan).pce", 0x040000, 0xbe850530, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_wbeach) -STD_ROM_FN(pce_wbeach) - -struct BurnDriver BurnDrvpce_wbeach = { - "pce_wbeach", NULL, NULL, NULL, "1990", - "World Beach Volley\0", NULL, "IGS", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_wbeachRomInfo, pce_wbeachRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// World Circuit - -static struct BurnRomInfo pce_wcircuitRomDesc[] = { - { "world circuit (japan).pce", 0x040000, 0xb3eeea2e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_wcircuit) -STD_ROM_FN(pce_wcircuit) - -struct BurnDriver BurnDrvpce_wcircuit = { - "pce_wcircuit", NULL, NULL, NULL, "1991", - "World Circuit\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_wcircuitRomInfo, pce_wcircuitRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// World Jockey - -static struct BurnRomInfo pce_wjockeyRomDesc[] = { - { "world jockey (japan).pce", 0x040000, 0xa9ab2954, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_wjockey) -STD_ROM_FN(pce_wjockey) - -struct BurnDriver BurnDrvpce_wjockey = { - "pce_wjockey", NULL, NULL, NULL, "1991", - "World Jockey\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_wjockeyRomInfo, pce_wjockeyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Xevious - Fardraut Densetsu - -static struct BurnRomInfo pce_xeviousRomDesc[] = { - { "xevious - fardraut densetsu (japan).pce", 0x040000, 0xf8f85eec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_xevious) -STD_ROM_FN(pce_xevious) - -struct BurnDriver BurnDrvpce_xevious = { - "pce_xevious", NULL, NULL, NULL, "1990", - "Xevious - Fardraut Densetsu\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_xeviousRomInfo, pce_xeviousRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Youkai Douchuuki - -static struct BurnRomInfo pce_youkaidRomDesc[] = { - { "youkai douchuuki (japan).pce", 0x040000, 0xf131b706, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_youkaid) -STD_ROM_FN(pce_youkaid) - -struct BurnDriver BurnDrvpce_youkaid = { - "pce_youkaid", NULL, NULL, NULL, "1988", - "Youkai Douchuuki\0", NULL, "Namcot", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_youkaidRomInfo, pce_youkaidRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Yuu Yuu Jinsei - Victory Life - -static struct BurnRomInfo pce_yuyuRomDesc[] = { - { "yuu yuu jinsei - victory life (japan).pce", 0x040000, 0xc0905ca9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_yuyu) -STD_ROM_FN(pce_yuyu) - -struct BurnDriver BurnDrvpce_yuyu = { - "pce_yuyu", NULL, NULL, NULL, "1988", - "Yuu Yuu Jinsei - Victory Life\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_yuyuRomInfo, pce_yuyuRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Zero 4 Champ - -static struct BurnRomInfo pce_zero4caRomDesc[] = { - { "zero 4 champ (japan).pce", 0x080000, 0xee156721, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_zero4ca) -STD_ROM_FN(pce_zero4ca) - -struct BurnDriver BurnDrvpce_zero4ca = { - "pce_zero4ca", "pce_zero4c", NULL, NULL, "1991", - "Zero 4 Champ\0", NULL, "Media Rings Corporation", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_zero4caRomInfo, pce_zero4caRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Zero 4 Champ (v1.5) - -static struct BurnRomInfo pce_zero4cRomDesc[] = { - { "zero 4 champ (japan) (v1.5).pce", 0x080000, 0xb77f2e2f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_zero4c) -STD_ROM_FN(pce_zero4c) - -struct BurnDriver BurnDrvpce_zero4c = { - "pce_zero4c", NULL, NULL, NULL, "1991", - "Zero 4 Champ (v1.5)\0", NULL, "Media Rings Corporation", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_zero4cRomInfo, pce_zero4cRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Zipang - -static struct BurnRomInfo pce_zipangRomDesc[] = { - { "zipang (japan).pce", 0x040000, 0x67aab7a1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_zipang) -STD_ROM_FN(pce_zipang) - -struct BurnDriver BurnDrvpce_zipang = { - "pce_zipang", NULL, NULL, NULL, "1990", - "Zipang\0", NULL, "Pack-In-Video", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_zipangRomInfo, pce_zipangRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// CD-Rom System Card (v1.0) - -static struct BurnRomInfo pce_cdsysbRomDesc[] = { - { "[cd] cd-rom system (japan) (v1.0).pce", 0x040000, 0x3f9f95a4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_cdsysb) -STD_ROM_FN(pce_cdsysb) - -struct BurnDriverD BurnDrvpce_cdsysb = { - "pce_cdsysb", "pce_cdsys", NULL, NULL, "19??", - "CD-Rom System Card (v1.0)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_cdsysbRomInfo, pce_cdsysbRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// CD-Rom System Card (v2.0) - -static struct BurnRomInfo pce_cdsysaRomDesc[] = { - { "[cd] cd-rom system (japan) (v2.0).pce", 0x040000, 0x52520bc6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_cdsysa) -STD_ROM_FN(pce_cdsysa) - -struct BurnDriverD BurnDrvpce_cdsysa = { - "pce_cdsysa", "pce_cdsys", NULL, NULL, "19??", - "CD-Rom System Card (v2.0)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_CLONE, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_cdsysaRomInfo, pce_cdsysaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// CD-Rom System Card (v2.1) - -static struct BurnRomInfo pce_cdsysRomDesc[] = { - { "[cd] cd-rom system (japan) (v2.1).pce", 0x040000, 0x283b74e0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_cdsys) -STD_ROM_FN(pce_cdsys) - -struct BurnDriverD BurnDrvpce_cdsys = { - "pce_cdsys", NULL, NULL, NULL, "19??", - "CD-Rom System Card (v2.1)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_cdsysRomInfo, pce_cdsysRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Games Express CD Card - -static struct BurnRomInfo pce_gecdRomDesc[] = { - { "[cd] games express cd card (japan).pce", 0x008000, 0x51a12d90, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_gecd) -STD_ROM_FN(pce_gecd) - -struct BurnDriverD BurnDrvpce_gecd = { - "pce_gecd", NULL, NULL, NULL, "19??", - "Games Express CD Card\0", NULL, "Games Express", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_gecdRomInfo, pce_gecdRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Super CD-Rom System Card (v3.0) - -static struct BurnRomInfo pce_scdsysRomDesc[] = { - { "[cd] super cd-rom system (japan) (v3.0).pce", 0x040000, 0x6d9a73ef, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_scdsys) -STD_ROM_FN(pce_scdsys) - -struct BurnDriverD BurnDrvpce_scdsys = { - "pce_scdsys", NULL, NULL, NULL, "19??", - "Super CD-Rom System Card (v3.0)\0", NULL, "Hudson", "PC Engine", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_scdsysRomInfo, pce_scdsysRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Aero Blasters - -static struct BurnRomInfo tg_aeroblstRomDesc[] = { - { "aero blasters (usa).pce", 0x080000, 0xb03e0b32, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_aeroblst) -STD_ROM_FN(tg_aeroblst) - -struct BurnDriver BurnDrvtg_aeroblst = { - "tg_aeroblst", NULL, NULL, NULL, "1990", - "Aero Blasters\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_aeroblstRomInfo, tg_aeroblstRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Air Zonk - -static struct BurnRomInfo tg_airzonkRomDesc[] = { - { "air zonk (usa).pce", 0x080000, 0x933d5bcc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_airzonk) -STD_ROM_FN(tg_airzonk) - -struct BurnDriverD BurnDrvtg_airzonk = { - "tg_airzonk", NULL, NULL, NULL, "1992", - "Air Zonk\0", NULL, "Hudson Soft", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_airzonkRomInfo, tg_airzonkRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Alien Crush - -static struct BurnRomInfo tg_acrushRomDesc[] = { - { "alien crush (usa).pce", 0x040000, 0xea488494, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_acrush) -STD_ROM_FN(tg_acrush) - -struct BurnDriver BurnDrvtg_acrush = { - "tg_acrush", NULL, NULL, NULL, "1989", - "Alien Crush\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_acrushRomInfo, tg_acrushRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ballistix - -static struct BurnRomInfo tg_ballistxRomDesc[] = { - { "ballistix (usa).pce", 0x040000, 0x420fa189, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_ballistx) -STD_ROM_FN(tg_ballistx) - -struct BurnDriver BurnDrvtg_ballistx = { - "tg_ballistx", NULL, NULL, NULL, "1992", - "Ballistix\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_ballistxRomInfo, tg_ballistxRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Battle Royale - -static struct BurnRomInfo tg_batlroylRomDesc[] = { - { "battle royale (usa).pce", 0x080000, 0xe70b01af, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_batlroyl) -STD_ROM_FN(tg_batlroyl) - -struct BurnDriver BurnDrvtg_batlroyl = { - "tg_batlroyl", NULL, NULL, NULL, "1990", - "Battle Royale\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_batlroylRomInfo, tg_batlroylRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Blazing Lazers - -static struct BurnRomInfo tg_blazlazrRomDesc[] = { - { "blazing lazers (usa).pce", 0x060000, 0xb4a1b0f6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_blazlazr) -STD_ROM_FN(tg_blazlazr) - -struct BurnDriver BurnDrvtg_blazlazr = { - "tg_blazlazr", NULL, NULL, NULL, "1989", - "Blazing Lazers\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_blazlazrRomInfo, tg_blazlazrRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bloody Wolf - -static struct BurnRomInfo tg_blodwolfRomDesc[] = { - { "bloody wolf (usa).pce", 0x080000, 0x37baf6bc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_blodwolf) -STD_ROM_FN(tg_blodwolf) - -struct BurnDriver BurnDrvtg_blodwolf = { - "tg_blodwolf", NULL, NULL, NULL, "1990", - "Bloody Wolf\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_blodwolfRomInfo, tg_blodwolfRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bomberman '93 - -static struct BurnRomInfo tg_bombmn93RomDesc[] = { - { "bomberman '93 (usa).pce", 0x080000, 0x56171c1c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_bombmn93) -STD_ROM_FN(tg_bombmn93) - -struct BurnDriver BurnDrvtg_bombmn93 = { - "tg_bombmn93", NULL, NULL, NULL, "1990", - "Bomberman '93\0", NULL, "Hudson Soft", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_bombmn93RomInfo, tg_bombmn93RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bomberman - -static struct BurnRomInfo tg_bombmanRomDesc[] = { - { "bomberman (usa).pce", 0x040000, 0x5f6f3c2a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_bombman) -STD_ROM_FN(tg_bombman) - -struct BurnDriver BurnDrvtg_bombman = { - "tg_bombman", NULL, NULL, NULL, "1991", - "Bomberman\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_bombmanRomInfo, tg_bombmanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bonk III - Bonk's Big Adventure - -static struct BurnRomInfo tg_bonk3RomDesc[] = { - { "bonk iii - bonk's big adventure (usa).pce", 0x100000, 0x5a3f76d8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_bonk3) -STD_ROM_FN(tg_bonk3) - -struct BurnDriver BurnDrvtg_bonk3 = { - "tg_bonk3", NULL, NULL, NULL, "1993", - "Bonk III - Bonk's Big Adventure\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_bonk3RomInfo, tg_bonk3RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bonk's Adventure - -static struct BurnRomInfo tg_bonkRomDesc[] = { - { "bonk's adventure (usa).pce", 0x060000, 0x599ead9b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_bonk) -STD_ROM_FN(tg_bonk) - -struct BurnDriver BurnDrvtg_bonk = { - "tg_bonk", NULL, NULL, NULL, "1990", - "Bonk's Adventure\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_bonkRomInfo, tg_bonkRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bonk's Revenge - -static struct BurnRomInfo tg_bonk2RomDesc[] = { - { "bonk's revenge (usa).pce", 0x080000, 0x14250f9a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_bonk2) -STD_ROM_FN(tg_bonk2) - -struct BurnDriver BurnDrvtg_bonk2 = { - "tg_bonk2", NULL, NULL, NULL, "1991", - "Bonk's Revenge\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_bonk2RomInfo, tg_bonk2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Boxyboy - -static struct BurnRomInfo tg_boxyboyRomDesc[] = { - { "boxyboy (usa).pce", 0x020000, 0x605be213, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_boxyboy) -STD_ROM_FN(tg_boxyboy) - -struct BurnDriver BurnDrvtg_boxyboy = { - "tg_boxyboy", NULL, NULL, NULL, "1990", - "Boxyboy\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_boxyboyRomInfo, tg_boxyboyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Bravoman - -static struct BurnRomInfo tg_bravomanRomDesc[] = { - { "bravoman (usa).pce", 0x080000, 0xcca08b02, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_bravoman) -STD_ROM_FN(tg_bravoman) - -struct BurnDriver BurnDrvtg_bravoman = { - "tg_bravoman", NULL, NULL, NULL, "1990", - "Bravoman\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_bravomanRomInfo, tg_bravomanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Cadash - -static struct BurnRomInfo tg_cadashRomDesc[] = { - { "cadash (usa).pce", 0x080000, 0xbb0b3aef, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_cadash) -STD_ROM_FN(tg_cadash) - -struct BurnDriver BurnDrvtg_cadash = { - "tg_cadash", NULL, NULL, NULL, "1991", - "Cadash\0", "Bad graphics", "Working Designs", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_cadashRomInfo, tg_cadashRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Champions Forever Boxing - -static struct BurnRomInfo tg_forevboxRomDesc[] = { - { "champions forever boxing (usa).pce", 0x080000, 0x15ee889a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_forevbox) -STD_ROM_FN(tg_forevbox) - -struct BurnDriver BurnDrvtg_forevbox = { - "tg_forevbox", NULL, NULL, NULL, "1991", - "Champions Forever Boxing\0", "Bad sound", "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_forevboxRomInfo, tg_forevboxRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Chew Man Fu - -static struct BurnRomInfo tg_chewmanRomDesc[] = { - { "chew man fu (usa).pce", 0x040000, 0x8cd13e9a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_chewman) -STD_ROM_FN(tg_chewman) - -struct BurnDriver BurnDrvtg_chewman = { - "tg_chewman", NULL, NULL, NULL, "1990", - "Chew Man Fu\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_chewmanRomInfo, tg_chewmanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// China Warrior - -static struct BurnRomInfo tg_chinawarRomDesc[] = { - { "china warrior (usa).pce", 0x040000, 0xa2ee361d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_chinawar) -STD_ROM_FN(tg_chinawar) - -struct BurnDriver BurnDrvtg_chinawar = { - "tg_chinawar", NULL, NULL, NULL, "1989", - "China Warrior\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_chinawarRomInfo, tg_chinawarRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Cratermaze - -static struct BurnRomInfo tg_cratermzRomDesc[] = { - { "cratermaze (usa).pce", 0x040000, 0x9033e83a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_cratermz) -STD_ROM_FN(tg_cratermz) - -struct BurnDriver BurnDrvtg_cratermz = { - "tg_cratermz", NULL, NULL, NULL, "1990", - "Cratermaze\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_cratermzRomInfo, tg_cratermzRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Cyber Core - -static struct BurnRomInfo tg_cybrcoreRomDesc[] = { - { "cyber core (usa).pce", 0x060000, 0x4cfb6e3e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_cybrcore) -STD_ROM_FN(tg_cybrcore) - -struct BurnDriver BurnDrvtg_cybrcore = { - "tg_cybrcore", NULL, NULL, NULL, "1990", - "Cyber Core\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_cybrcoreRomInfo, tg_cybrcoreRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Darkwing Duck - -static struct BurnRomInfo tg_darkwingRomDesc[] = { - { "darkwing duck (usa).pce", 0x080000, 0x4ac97606, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_darkwing) -STD_ROM_FN(tg_darkwing) - -struct BurnDriver BurnDrvtg_darkwing = { - "tg_darkwing", NULL, NULL, NULL, "1992", - "Darkwing Duck\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_darkwingRomInfo, tg_darkwingRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Davis Cup Tennis - -static struct BurnRomInfo tg_daviscupRomDesc[] = { - { "davis cup tennis (usa).pce", 0x080000, 0x9edab596, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_daviscup) -STD_ROM_FN(tg_daviscup) - -struct BurnDriver BurnDrvtg_daviscup = { - "tg_daviscup", NULL, NULL, NULL, "1991", - "Davis Cup Tennis\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_daviscupRomInfo, tg_daviscupRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dead Moon - -static struct BurnRomInfo tg_deadmoonRomDesc[] = { - { "dead moon (usa).pce", 0x080000, 0xf5d98b0b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_deadmoon) -STD_ROM_FN(tg_deadmoon) - -struct BurnDriver BurnDrvtg_deadmoon = { - "tg_deadmoon", NULL, NULL, NULL, "1992", - "Dead Moon\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_deadmoonRomInfo, tg_deadmoonRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Deep Blue - -static struct BurnRomInfo tg_deepblueRomDesc[] = { - { "deep blue (usa).pce", 0x040000, 0x16b40b44, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_deepblue) -STD_ROM_FN(tg_deepblue) - -struct BurnDriver BurnDrvtg_deepblue = { - "tg_deepblue", NULL, NULL, NULL, "1989", - "Deep Blue\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_deepblueRomInfo, tg_deepblueRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Devil's Crush - Naxat Pinball - -static struct BurnRomInfo tg_devlcrshRomDesc[] = { - { "devil's crush - naxat pinball (usa).pce", 0x060000, 0x157b4492, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_devlcrsh) -STD_ROM_FN(tg_devlcrsh) - -struct BurnDriver BurnDrvtg_devlcrsh = { - "tg_devlcrsh", NULL, NULL, NULL, "1990", - "Devil's Crush - Naxat Pinball\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_devlcrshRomInfo, tg_devlcrshRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Double Dungeons - W - -static struct BurnRomInfo tg_ddungwRomDesc[] = { - { "double dungeons - w (usa).pce", 0x040000, 0x4a1a8c60, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_ddungw) -STD_ROM_FN(tg_ddungw) - -struct BurnDriver BurnDrvtg_ddungw = { - "tg_ddungw", NULL, NULL, NULL, "1990", - "Double Dungeons - W\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_ddungwRomInfo, tg_ddungwRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dragon Spirit - -static struct BurnRomInfo tg_dspiritRomDesc[] = { - { "dragon spirit (usa).pce", 0x040000, 0x086f148c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_dspirit) -STD_ROM_FN(tg_dspirit) - -struct BurnDriver BurnDrvtg_dspirit = { - "tg_dspirit", NULL, NULL, NULL, "1989", - "Dragon Spirit\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_dspiritRomInfo, tg_dspiritRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dragon's Curse - -static struct BurnRomInfo tg_dragcrseRomDesc[] = { - { "dragon's curse (usa).pce", 0x040000, 0x7d2c4b09, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_dragcrse) -STD_ROM_FN(tg_dragcrse) - -struct BurnDriver BurnDrvtg_dragcrse = { - "tg_dragcrse", NULL, NULL, NULL, "1990", - "Dragon's Curse\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_dragcrseRomInfo, tg_dragcrseRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Drop.Off - -static struct BurnRomInfo tg_dropoffRomDesc[] = { - { "drop.off (usa).pce", 0x040000, 0xfea27b32, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_dropoff) -STD_ROM_FN(tg_dropoff) - -struct BurnDriver BurnDrvtg_dropoff = { - "tg_dropoff", NULL, NULL, NULL, "1990", - "Drop.Off\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_dropoffRomInfo, tg_dropoffRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dungeon Explorer - -static struct BurnRomInfo tg_dungexplRomDesc[] = { - { "dungeon explorer (usa).pce", 0x060000, 0x4ff01515, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_dungexpl) -STD_ROM_FN(tg_dungexpl) - -struct BurnDriver BurnDrvtg_dungexpl = { - "tg_dungexpl", NULL, NULL, NULL, "1989", - "Dungeon Explorer\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_dungexplRomInfo, tg_dungexplRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Falcon - -static struct BurnRomInfo tg_falconRomDesc[] = { - { "falcon (usa).pce", 0x080000, 0x0bc0a12b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_falcon) -STD_ROM_FN(tg_falcon) - -struct BurnDriver BurnDrvtg_falcon = { - "tg_falcon", NULL, NULL, NULL, "1992", - "Falcon\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_falconRomInfo, tg_falconRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Fantasy Zone - -static struct BurnRomInfo tg_fantzoneRomDesc[] = { - { "fantasy zone (usa).pce", 0x040000, 0xe8c3573d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_fantzone) -STD_ROM_FN(tg_fantzone) - -struct BurnDriver BurnDrvtg_fantzone = { - "tg_fantzone", NULL, NULL, NULL, "1989", - "Fantasy Zone\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_fantzoneRomInfo, tg_fantzoneRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Final Lap Twin - -static struct BurnRomInfo tg_finallapRomDesc[] = { - { "final lap twin (usa).pce", 0x060000, 0x26408ea3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_finallap) -STD_ROM_FN(tg_finallap) - -struct BurnDriver BurnDrvtg_finallap = { - "tg_finallap", NULL, NULL, NULL, "1990", - "Final Lap Twin\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_finallapRomInfo, tg_finallapRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Galaga '90 - -static struct BurnRomInfo tg_galaga90RomDesc[] = { - { "galaga '90 (usa).pce", 0x040000, 0x2909dec6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_galaga90) -STD_ROM_FN(tg_galaga90) - -struct BurnDriver BurnDrvtg_galaga90 = { - "tg_galaga90", NULL, NULL, NULL, "1989", - "Galaga '90\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_galaga90RomInfo, tg_galaga90RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ghost Manor - -static struct BurnRomInfo tg_ghostmanRomDesc[] = { - { "ghost manor (usa).pce", 0x080000, 0x2db4c1fd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_ghostman) -STD_ROM_FN(tg_ghostman) - -struct BurnDriver BurnDrvtg_ghostman = { - "tg_ghostman", NULL, NULL, NULL, "1992", - "Ghost Manor\0", "game randomly locks up", "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_ghostmanRomInfo, tg_ghostmanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Gunboat - -static struct BurnRomInfo tg_gunboatRomDesc[] = { - { "gunboat (usa).pce", 0x080000, 0xf370b58e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_gunboat) -STD_ROM_FN(tg_gunboat) - -struct BurnDriver BurnDrvtg_gunboat = { - "tg_gunboat", NULL, NULL, NULL, "1992", - "Gunboat\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_gunboatRomInfo, tg_gunboatRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Hit the Ice - VHL - The Official Video Hockey League - -static struct BurnRomInfo tg_hiticeRomDesc[] = { - { "hit the ice - vhl the official video hockey league (usa).pce", 0x060000, 0x8b29c3aa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_hitice) -STD_ROM_FN(tg_hitice) - -struct BurnDriver BurnDrvtg_hitice = { - "tg_hitice", NULL, NULL, NULL, "1992", - "Hit the Ice - VHL - The Official Video Hockey League\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_hiticeRomInfo, tg_hiticeRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Impossamole - -static struct BurnRomInfo tg_impossamRomDesc[] = { - { "impossamole (usa).pce", 0x080000, 0xe2470f5f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_impossam) -STD_ROM_FN(tg_impossam) - -struct BurnDriver BurnDrvtg_impossam = { - "tg_impossam", NULL, NULL, NULL, "1991", - "Impossamole\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_impossamRomInfo, tg_impossamRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// J.J. & Jeff - -static struct BurnRomInfo tg_jjnjeffRomDesc[] = { - { "j.j. & jeff (usa).pce", 0x040000, 0xe01c5127, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_jjnjeff) -STD_ROM_FN(tg_jjnjeff) - -struct BurnDriver BurnDrvtg_jjnjeff = { - "tg_jjnjeff", NULL, NULL, NULL, "1990", - "J.J. & Jeff\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_jjnjeffRomInfo, tg_jjnjeffRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Jack Nicklaus' Turbo Golf - -static struct BurnRomInfo tg_nicklausRomDesc[] = { - { "jack nicklaus' turbo golf (usa).pce", 0x040000, 0x83384572, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_nicklaus) -STD_ROM_FN(tg_nicklaus) - -struct BurnDriver BurnDrvtg_nicklaus = { - "tg_nicklaus", NULL, NULL, NULL, "1990", - "Jack Nicklaus' Turbo Golf\0", NULL, "Accolade", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_nicklausRomInfo, tg_nicklausRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Jackie Chan's Action Kung Fu - -static struct BurnRomInfo tg_jchanRomDesc[] = { - { "jackie chan's action kung fu (usa).pce", 0x080000, 0x9d2f6193, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_jchan) -STD_ROM_FN(tg_jchan) - -struct BurnDriver BurnDrvtg_jchan = { - "tg_jchan", NULL, NULL, NULL, "1992", - "Jackie Chan's Action Kung Fu\0", NULL, "Hudson Soft", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_jchanRomInfo, tg_jchanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Keith Courage in Alpha Zones - -static struct BurnRomInfo tg_keithcorRomDesc[] = { - { "keith courage in alpha zones (usa).pce", 0x040000, 0x474d7a72, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_keithcor) -STD_ROM_FN(tg_keithcor) - -struct BurnDriver BurnDrvtg_keithcor = { - "tg_keithcor", NULL, NULL, NULL, "1989", - "Keith Courage in Alpha Zones\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_keithcorRomInfo, tg_keithcorRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// King of Casino - -static struct BurnRomInfo tg_kingcasnRomDesc[] = { - { "king of casino (usa).pce", 0x040000, 0x2f2e2240, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_kingcasn) -STD_ROM_FN(tg_kingcasn) - -struct BurnDriver BurnDrvtg_kingcasn = { - "tg_kingcasn", NULL, NULL, NULL, "1990", - "King of Casino\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_kingcasnRomInfo, tg_kingcasnRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Klax - -static struct BurnRomInfo tg_klaxRomDesc[] = { - { "klax (usa).pce", 0x040000, 0x0f1b59b4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_klax) -STD_ROM_FN(tg_klax) - -struct BurnDriver BurnDrvtg_klax = { - "tg_klax", NULL, NULL, NULL, "1990", - "Klax\0", NULL, "Tengen", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_klaxRomInfo, tg_klaxRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Legend of Hero Tonma - -static struct BurnRomInfo tg_lohtRomDesc[] = { - { "legend of hero tonma (usa).pce", 0x080000, 0x3c131486, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_loht) -STD_ROM_FN(tg_loht) - -struct BurnDriver BurnDrvtg_loht = { - "tg_loht", NULL, NULL, NULL, "1991", - "Legend of Hero Tonma\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_lohtRomInfo, tg_lohtRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// The Legendary Axe II - -static struct BurnRomInfo tg_legaxe2RomDesc[] = { - { "legendary axe ii, the (usa).pce", 0x040000, 0x220ebf91, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_legaxe2) -STD_ROM_FN(tg_legaxe2) - -struct BurnDriver BurnDrvtg_legaxe2 = { - "tg_legaxe2", NULL, NULL, NULL, "1990", - "The Legendary Axe II\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_legaxe2RomInfo, tg_legaxe2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// The Legendary Axe - -static struct BurnRomInfo tg_legaxeRomDesc[] = { - { "legendary axe, the (usa).pce", 0x040000, 0x2d211007, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_legaxe) -STD_ROM_FN(tg_legaxe) - -struct BurnDriver BurnDrvtg_legaxe = { - "tg_legaxe", NULL, NULL, NULL, "1989", - "The Legendary Axe\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_legaxeRomInfo, tg_legaxeRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Magical Chase - -static struct BurnRomInfo tg_magchaseRomDesc[] = { - { "magical chase (usa).pce", 0x080000, 0x95cd2979, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_magchase) -STD_ROM_FN(tg_magchase) - -struct BurnDriver BurnDrvtg_magchase = { - "tg_magchase", NULL, NULL, NULL, "1991", - "Magical Chase\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_magchaseRomInfo, tg_magchaseRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Military Madness - -static struct BurnRomInfo tg_miltrymdRomDesc[] = { - { "military madness (usa).pce", 0x060000, 0x93f316f7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_miltrymd) -STD_ROM_FN(tg_miltrymd) - -struct BurnDriver BurnDrvtg_miltrymd = { - "tg_miltrymd", NULL, NULL, NULL, "1989", - "Military Madness\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_miltrymdRomInfo, tg_miltrymdRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Moto Roader - -static struct BurnRomInfo tg_motoroadRomDesc[] = { - { "moto roader (usa).pce", 0x040000, 0xe2b0d544, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_motoroad) -STD_ROM_FN(tg_motoroad) - -struct BurnDriver BurnDrvtg_motoroad = { - "tg_motoroad", NULL, NULL, NULL, "1989", - "Moto Roader\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_motoroadRomInfo, tg_motoroadRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Neutopia - -static struct BurnRomInfo tg_neutopiaRomDesc[] = { - { "neutopia (usa).pce", 0x060000, 0xa9a94e1b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_neutopia) -STD_ROM_FN(tg_neutopia) - -struct BurnDriver BurnDrvtg_neutopia = { - "tg_neutopia", NULL, NULL, NULL, "1990", - "Neutopia\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_neutopiaRomInfo, tg_neutopiaRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Neutopia II - -static struct BurnRomInfo tg_neutopi2RomDesc[] = { - { "neutopia ii (usa).pce", 0x0c0000, 0xc4ed4307, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_neutopi2) -STD_ROM_FN(tg_neutopi2) - -struct BurnDriver BurnDrvtg_neutopi2 = { - "tg_neutopi2", NULL, NULL, NULL, "1992", - "Neutopia II\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_neutopi2RomInfo, tg_neutopi2RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// New Adventure Island - -static struct BurnRomInfo tg_advislndRomDesc[] = { - { "new adventure island (usa).pce", 0x080000, 0x756a1802, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_advislnd) -STD_ROM_FN(tg_advislnd) - -struct BurnDriver BurnDrvtg_advislnd = { - "tg_advislnd", NULL, NULL, NULL, "1992", - "New Adventure Island\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_advislndRomInfo, tg_advislndRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Night Creatures - -static struct BurnRomInfo tg_nightcrRomDesc[] = { - { "night creatures (usa).pce", 0x080000, 0xc159761b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_nightcr) -STD_ROM_FN(tg_nightcr) - -struct BurnDriver BurnDrvtg_nightcr = { - "tg_nightcr", NULL, NULL, NULL, "1992", - "Night Creatures\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_nightcrRomInfo, tg_nightcrRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ninja Spirit - -static struct BurnRomInfo tg_nspiritRomDesc[] = { - { "ninja spirit (usa).pce", 0x080000, 0xde8af1c1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_nspirit) -STD_ROM_FN(tg_nspirit) - -struct BurnDriver BurnDrvtg_nspirit = { - "tg_nspirit", NULL, NULL, NULL, "1990", - "Ninja Spirit\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_nspiritRomInfo, tg_nspiritRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Order of the Griffon - -static struct BurnRomInfo tg_griffonRomDesc[] = { - { "order of the griffon (usa).pce", 0x080000, 0xfae0fc60, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_griffon) -STD_ROM_FN(tg_griffon) - -struct BurnDriver BurnDrvtg_griffon = { - "tg_griffon", NULL, NULL, NULL, "1992", - "Order of the Griffon\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_griffonRomInfo, tg_griffonRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Ordyne - -static struct BurnRomInfo tg_ordyneRomDesc[] = { - { "ordyne (usa).pce", 0x080000, 0xe7bf2a74, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_ordyne) -STD_ROM_FN(tg_ordyne) - -struct BurnDriver BurnDrvtg_ordyne = { - "tg_ordyne", NULL, NULL, NULL, "1989", - "Ordyne\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_ordyneRomInfo, tg_ordyneRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Pac-Land - -static struct BurnRomInfo tg_paclandRomDesc[] = { - { "pac-land (usa).pce", 0x040000, 0xd6e30ccd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_pacland) -STD_ROM_FN(tg_pacland) - -struct BurnDriver BurnDrvtg_pacland = { - "tg_pacland", NULL, NULL, NULL, "1990", - "Pac-Land\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_paclandRomInfo, tg_paclandRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Panza Kick Boxing - -static struct BurnRomInfo tg_panzakbRomDesc[] = { - { "panza kick boxing (usa).pce", 0x080000, 0xa980e0e9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_panzakb) -STD_ROM_FN(tg_panzakb) - -struct BurnDriver BurnDrvtg_panzakb = { - "tg_panzakb", NULL, NULL, NULL, "1990", - "Panza Kick Boxing\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_panzakbRomInfo, tg_panzakbRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Parasol Stars - The Story of Bubble Bobble III - -static struct BurnRomInfo tg_parasolRomDesc[] = { - { "parasol stars - the story of bubble bobble iii (usa).pce", 0x060000, 0xe6458212, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_parasol) -STD_ROM_FN(tg_parasol) - -struct BurnDriver BurnDrvtg_parasol = { - "tg_parasol", NULL, NULL, NULL, "1991", - "Parasol Stars - The Story of Bubble Bobble III\0", NULL, "Working Designs", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_parasolRomInfo, tg_parasolRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Power Golf - -static struct BurnRomInfo tg_pgolfRomDesc[] = { - { "power golf (usa).pce", 0x060000, 0xed1d3843, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_pgolf) -STD_ROM_FN(tg_pgolf) - -struct BurnDriver BurnDrvtg_pgolf = { - "tg_pgolf", NULL, NULL, NULL, "1989", - "Power Golf\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_pgolfRomInfo, tg_pgolfRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Psychosis - -static struct BurnRomInfo tg_psychosRomDesc[] = { - { "psychosis (usa).pce", 0x040000, 0x6cc10824, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_psychos) -STD_ROM_FN(tg_psychos) - -struct BurnDriver BurnDrvtg_psychos = { - "tg_psychos", NULL, NULL, NULL, "1990", - "Psychosis\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_psychosRomInfo, tg_psychosRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// R-Type - -static struct BurnRomInfo tg_rtypeRomDesc[] = { - { "r-type (usa).pce", 0x080000, 0x91ce5156, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_rtype) -STD_ROM_FN(tg_rtype) - -struct BurnDriver BurnDrvtg_rtype = { - "tg_rtype", NULL, NULL, NULL, "1989", - "R-Type\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_rtypeRomInfo, tg_rtypeRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Raiden - -static struct BurnRomInfo tg_raidenRomDesc[] = { - { "raiden (usa).pce", 0x0c0000, 0xbc59c31e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_raiden) -STD_ROM_FN(tg_raiden) - -struct BurnDriver BurnDrvtg_raiden = { - "tg_raiden", NULL, NULL, NULL, "1990", - "Raiden\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_raidenRomInfo, tg_raidenRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Samurai-Ghost - -static struct BurnRomInfo tg_samuraigRomDesc[] = { - { "samurai-ghost (usa).pce", 0x080000, 0x77a924b7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_samuraig) -STD_ROM_FN(tg_samuraig) - -struct BurnDriver BurnDrvtg_samuraig = { - "tg_samuraig", NULL, NULL, NULL, "1992", - "Samurai-Ghost\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_samuraigRomInfo, tg_samuraigRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Shockman - -static struct BurnRomInfo tg_shockmanRomDesc[] = { - { "shockman (usa).pce", 0x080000, 0x2774462c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_shockman) -STD_ROM_FN(tg_shockman) - -struct BurnDriver BurnDrvtg_shockman = { - "tg_shockman", NULL, NULL, NULL, "1992", - "Shockman\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_shockmanRomInfo, tg_shockmanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Sidearms - Hyper Dyne - -static struct BurnRomInfo tg_sidearmsRomDesc[] = { - { "sidearms - hyper dyne (usa).pce", 0x040000, 0xd1993c9f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_sidearms) -STD_ROM_FN(tg_sidearms) - -struct BurnDriver BurnDrvtg_sidearms = { - "tg_sidearms", NULL, NULL, NULL, "1989", - "Sidearms - Hyper Dyne\0", NULL, "Radiance Software", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_sidearmsRomInfo, tg_sidearmsRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 242, 4, 3 -}; - - -// Silent Debuggers - -static struct BurnRomInfo tg_silentdRomDesc[] = { - { "silent debuggers (usa).pce", 0x080000, 0xfa7e5d66, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_silentd) -STD_ROM_FN(tg_silentd) - -struct BurnDriver BurnDrvtg_silentd = { - "tg_silentd", NULL, NULL, NULL, "1991", - "Silent Debuggers\0", NULL, "Hudson Soft", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_silentdRomInfo, tg_silentdRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Sinistron - -static struct BurnRomInfo tg_sinistrnRomDesc[] = { - { "sinistron (usa).pce", 0x060000, 0x4f6e2dbd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_sinistrn) -STD_ROM_FN(tg_sinistrn) - -struct BurnDriver BurnDrvtg_sinistrn = { - "tg_sinistrn", NULL, NULL, NULL, "1991", - "Sinistron\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_sinistrnRomInfo, tg_sinistrnRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Soldier Blade - -static struct BurnRomInfo tg_soldbladRomDesc[] = { - { "soldier blade (usa).pce", 0x080000, 0x4bb68b13, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_soldblad) -STD_ROM_FN(tg_soldblad) - -struct BurnDriver BurnDrvtg_soldblad = { - "tg_soldblad", NULL, NULL, NULL, "1992", - "Soldier Blade\0", "Hangs at first boss", "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_soldbladRomInfo, tg_soldbladRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Somer Assault - -static struct BurnRomInfo tg_somerassRomDesc[] = { - { "somer assault (usa).pce", 0x080000, 0x8fcaf2e9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_somerass) -STD_ROM_FN(tg_somerass) - -struct BurnDriver BurnDrvtg_somerass = { - "tg_somerass", NULL, NULL, NULL, "1992", - "Somer Assault\0", NULL, "Atlus", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_somerassRomInfo, tg_somerassRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Sonic Spike - World Championship Beach Volleyball - -static struct BurnRomInfo tg_wbeachRomDesc[] = { - { "sonic spike - world championship beach volleyball (usa).pce", 0x040000, 0xf74e5eb3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_wbeach) -STD_ROM_FN(tg_wbeach) - -struct BurnDriver BurnDrvtg_wbeach = { - "tg_wbeach", NULL, NULL, NULL, "1990", - "Sonic Spike - World Championship Beach Volleyball\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_wbeachRomInfo, tg_wbeachRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Space Harrier - -static struct BurnRomInfo tg_sharrierRomDesc[] = { - { "space harrier (usa).pce", 0x080000, 0x43b05eb8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_sharrier) -STD_ROM_FN(tg_sharrier) - -struct BurnDriver BurnDrvtg_sharrier = { - "tg_sharrier", NULL, NULL, NULL, "1989", - "Space Harrier\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_sharrierRomInfo, tg_sharrierRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Splatterhouse - -static struct BurnRomInfo tg_splatthRomDesc[] = { - { "splatterhouse (usa).pce", 0x080000, 0xd00ca74f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_splatth) -STD_ROM_FN(tg_splatth) - -struct BurnDriver BurnDrvtg_splatth = { - "tg_splatth", NULL, NULL, NULL, "1990", - "Splatterhouse\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_splatthRomInfo, tg_splatthRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Super Star Soldier - -static struct BurnRomInfo tg_sssoldrRomDesc[] = { - { "super star soldier (usa).pce", 0x080000, 0xdb29486f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_sssoldr) -STD_ROM_FN(tg_sssoldr) - -struct BurnDriver BurnDrvtg_sssoldr = { - "tg_sssoldr", NULL, NULL, NULL, "1990", - "Super Star Soldier\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_sssoldrRomInfo, tg_sssoldrRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Super Volleyball - -static struct BurnRomInfo tg_svolleyRomDesc[] = { - { "super volleyball (usa).pce", 0x040000, 0x245040b3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_svolley) -STD_ROM_FN(tg_svolley) - -struct BurnDriver BurnDrvtg_svolley = { - "tg_svolley", NULL, NULL, NULL, "1990", - "Super Volleyball\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_svolleyRomInfo, tg_svolleyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Taito Chase H.Q. - -static struct BurnRomInfo tg_chasehqRomDesc[] = { - { "taito chase h.q. (usa).pce", 0x060000, 0x9298254c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_chasehq) -STD_ROM_FN(tg_chasehq) - -struct BurnDriver BurnDrvtg_chasehq = { - "tg_chasehq", NULL, NULL, NULL, "1992", - "Taito Chase H.Q.\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_chasehqRomInfo, tg_chasehqRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Takin' It to the Hoop - -static struct BurnRomInfo tg_taknhoopRomDesc[] = { - { "takin' it to the hoop (usa).pce", 0x040000, 0xe9d51797, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_taknhoop) -STD_ROM_FN(tg_taknhoop) - -struct BurnDriver BurnDrvtg_taknhoop = { - "tg_taknhoop", NULL, NULL, NULL, "1989", - "Takin' It to the Hoop\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_taknhoopRomInfo, tg_taknhoopRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// TaleSpin - -static struct BurnRomInfo tg_talespinRomDesc[] = { - { "talespin (usa).pce", 0x080000, 0xbae9cecc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_talespin) -STD_ROM_FN(tg_talespin) - -struct BurnDriver BurnDrvtg_talespin = { - "tg_talespin", NULL, NULL, NULL, "1991", - "TaleSpin\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_talespinRomInfo, tg_talespinRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tiger Road - -static struct BurnRomInfo tg_tigerrodRomDesc[] = { - { "tiger road (usa).pce", 0x060000, 0x985d492d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_tigerrod) -STD_ROM_FN(tg_tigerrod) - -struct BurnDriver BurnDrvtg_tigerrod = { - "tg_tigerrod", NULL, NULL, NULL, "1990", - "Tiger Road\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_tigerrodRomInfo, tg_tigerrodRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Time Cruise - -static struct BurnRomInfo tg_timcrusRomDesc[] = { - { "time cruise (usa).pce", 0x080000, 0x02c39660, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_timcrus) -STD_ROM_FN(tg_timcrus) - -struct BurnDriver BurnDrvtg_timcrus = { - "tg_timcrus", NULL, NULL, NULL, "1992", - "Time Cruise\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_timcrusRomInfo, tg_timcrusRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Timeball - -static struct BurnRomInfo tg_timeballRomDesc[] = { - { "timeball (usa).pce", 0x020000, 0x5d395019, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_timeball) -STD_ROM_FN(tg_timeball) - -struct BurnDriver BurnDrvtg_timeball = { - "tg_timeball", NULL, NULL, NULL, "1990", - "Timeball\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_timeballRomInfo, tg_timeballRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Tricky Kick - -static struct BurnRomInfo tg_trickyRomDesc[] = { - { "tricky kick (usa).pce", 0x040000, 0x48e6fd34, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_tricky) -STD_ROM_FN(tg_tricky) - -struct BurnDriver BurnDrvtg_tricky = { - "tg_tricky", NULL, NULL, NULL, "1990", - "Tricky Kick\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_trickyRomInfo, tg_trickyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Turrican - -static struct BurnRomInfo tg_turricanRomDesc[] = { - { "turrican (usa).pce", 0x040000, 0xeb045edf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_turrican) -STD_ROM_FN(tg_turrican) - -struct BurnDriver BurnDrvtg_turrican = { - "tg_turrican", NULL, NULL, NULL, "1991", - "Turrican\0", NULL, "Ballistic", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_turricanRomInfo, tg_turricanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// TV Sports Basketball - -static struct BurnRomInfo tg_tvbasketRomDesc[] = { - { "tv sports basketball (usa).pce", 0x080000, 0xea54d653, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_tvbasket) -STD_ROM_FN(tg_tvbasket) - -struct BurnDriver BurnDrvtg_tvbasket = { - "tg_tvbasket", NULL, NULL, NULL, "1991", - "TV Sports Basketball\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_tvbasketRomInfo, tg_tvbasketRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// TV Sports Football - -static struct BurnRomInfo tg_tvfootblRomDesc[] = { - { "tv sports football (usa).pce", 0x060000, 0x5e25b557, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_tvfootbl) -STD_ROM_FN(tg_tvfootbl) - -struct BurnDriver BurnDrvtg_tvfootbl = { - "tg_tvfootbl", NULL, NULL, NULL, "1990", - "TV Sports Football\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_tvfootblRomInfo, tg_tvfootblRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// TV Sports Hockey - -static struct BurnRomInfo tg_tvhockeyRomDesc[] = { - { "tv sports hockey (usa).pce", 0x060000, 0x97fe5bcf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_tvhockey) -STD_ROM_FN(tg_tvhockey) - -struct BurnDriver BurnDrvtg_tvhockey = { - "tg_tvhockey", NULL, NULL, NULL, "1991", - "TV Sports Hockey\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_tvhockeyRomInfo, tg_tvhockeyRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Veigues - Tactical Gladiator - -static struct BurnRomInfo tg_veiguesRomDesc[] = { - { "veigues - tactical gladiator (usa).pce", 0x060000, 0x99d14fb7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_veigues) -STD_ROM_FN(tg_veigues) - -struct BurnDriver BurnDrvtg_veigues = { - "tg_veigues", NULL, NULL, NULL, "1990", - "Veigues - Tactical Gladiator\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_veiguesRomInfo, tg_veiguesRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Victory Run - -static struct BurnRomInfo tg_victoryrRomDesc[] = { - { "victory run (usa).pce", 0x040000, 0x85cbd045, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_victoryr) -STD_ROM_FN(tg_victoryr) - -struct BurnDriver BurnDrvtg_victoryr = { - "tg_victoryr", NULL, NULL, NULL, "1989", - "Victory Run\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_victoryrRomInfo, tg_victoryrRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Vigilante - -static struct BurnRomInfo tg_vigilantRomDesc[] = { - { "vigilante (usa).pce", 0x060000, 0x79d49a0d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_vigilant) -STD_ROM_FN(tg_vigilant) - -struct BurnDriver BurnDrvtg_vigilant = { - "tg_vigilant", NULL, NULL, NULL, "1989", - "Vigilante\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_vigilantRomInfo, tg_vigilantRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// World Class Baseball - -static struct BurnRomInfo tg_wcbaseblRomDesc[] = { - { "world class baseball (usa).pce", 0x040000, 0x4186d0c0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_wcbasebl) -STD_ROM_FN(tg_wcbasebl) - -struct BurnDriver BurnDrvtg_wcbasebl = { - "tg_wcbasebl", NULL, NULL, NULL, "1989", - "World Class Baseball\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_wcbaseblRomInfo, tg_wcbaseblRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// World Court Tennis - -static struct BurnRomInfo tg_wctennisRomDesc[] = { - { "world court tennis (usa).pce", 0x040000, 0xa4457df0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_wctennis) -STD_ROM_FN(tg_wctennis) - -struct BurnDriver BurnDrvtg_wctennis = { - "tg_wctennis", NULL, NULL, NULL, "1989", - "World Court Tennis\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_wctennisRomInfo, tg_wctennisRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// World Sports Competition - -static struct BurnRomInfo tg_wscompRomDesc[] = { - { "world sports competition (usa).pce", 0x080000, 0x4b93f0ac, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_wscomp) -STD_ROM_FN(tg_wscomp) - -struct BurnDriver BurnDrvtg_wscomp = { - "tg_wscomp", NULL, NULL, NULL, "1992", - "World Sports Competition\0", NULL, "TTI", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_wscompRomInfo, tg_wscompRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Yo, Bro - -static struct BurnRomInfo tg_yobroRomDesc[] = { - { "yo, bro (usa).pce", 0x080000, 0x3ca7db48, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_yobro) -STD_ROM_FN(tg_yobro) - -struct BurnDriver BurnDrvtg_yobro = { - "tg_yobro", NULL, NULL, NULL, "1991", - "Yo, Bro\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_yobroRomInfo, tg_yobroRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Turbografx CD Super System Card (v3.0) - -static struct BurnRomInfo tg_scdsysRomDesc[] = { - { "[cd] turbografx cd super system card (usa) (v3.0).pce", 0x040000, 0x2b5b75fe, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_scdsys) -STD_ROM_FN(tg_scdsys) - -struct BurnDriverD BurnDrvtg_scdsys = { - "tg_scdsys", NULL, NULL, NULL, "19??", - "Turbografx CD Super System Card (v3.0)\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_scdsysRomInfo, tg_scdsysRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Turbografx CD System Card (v2.0) - -static struct BurnRomInfo tg_cdsysRomDesc[] = { - { "[cd] turbografx cd system card (usa) (v2.0).pce", 0x040000, 0xff2a5ec3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(tg_cdsys) -STD_ROM_FN(tg_cdsys) - -struct BurnDriverD BurnDrvtg_cdsys = { - "tg_cdsys", NULL, NULL, NULL, "19??", - "Turbografx CD System Card (v2.0)\0", NULL, "NEC", "TurboGrafx 16", - NULL, NULL, NULL, NULL, - 0, 5, HARDWARE_PCENGINE_TG16, GBF_MISC, 0, - TgGetZipName, tg_cdsysRomInfo, tg_cdsysRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - TG16Init, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// 1941 - Counter Attack - -static struct BurnRomInfo sgx_1941RomDesc[] = { - { "1941 - counter attack (japan).pce", 0x100000, 0x8c4588e2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sgx_1941) -STD_ROM_FN(sgx_1941) - -struct BurnDriver BurnDrvsgx_1941 = { - "sgx_1941", NULL, NULL, NULL, "1991", - "1941 - Counter Attack\0", NULL, "Hudson", "SuperGrafx", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_SGX, GBF_MISC, 0, - SgxGetZipName, sgx_1941RomInfo, sgx_1941RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - SGXInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Aldynes - -static struct BurnRomInfo sgx_aldynesRomDesc[] = { - { "aldynes (japan).pce", 0x100000, 0x4c2126b0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sgx_aldynes) -STD_ROM_FN(sgx_aldynes) - -struct BurnDriver BurnDrvsgx_aldynes = { - "sgx_aldynes", NULL, NULL, NULL, "1991", - "Aldynes\0", NULL, "Hudson", "SuperGrafx", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_SGX, GBF_MISC, 0, - SgxGetZipName, sgx_aldynesRomInfo, sgx_aldynesRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - SGXInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Battle Ace - -static struct BurnRomInfo sgx_battlaceRomDesc[] = { - { "battle ace (japan).pce", 0x080000, 0x3b13af61, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sgx_battlace) -STD_ROM_FN(sgx_battlace) - -struct BurnDriver BurnDrvsgx_battlace = { - "sgx_battlace", NULL, NULL, NULL, "1989", - "Battle Ace\0", NULL, "Hudson", "SuperGrafx", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_SGX, GBF_MISC, 0, - SgxGetZipName, sgx_battlaceRomInfo, sgx_battlaceRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - SGXInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Dai Makaimura - -static struct BurnRomInfo sgx_daimakaiRomDesc[] = { - { "daimakai mura (japan).pce", 0x100000, 0xb486a8ed, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sgx_daimakai) -STD_ROM_FN(sgx_daimakai) - -struct BurnDriver BurnDrvsgx_daimakai = { - "sgx_daimakai", NULL, NULL, NULL, "1990", - "Dai Makaimura\0", NULL, "NEC Avenue", "SuperGrafx", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_SGX, GBF_MISC, 0, - SgxGetZipName, sgx_daimakaiRomInfo, sgx_daimakaiRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - SGXInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - -// Dai Makaimura (Alt) - -static struct BurnRomInfo sgx_daimakai1RomDesc[] = { - { "daimakai mura (japan)[a].pce", 0x100200, 0x8e961f63, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sgx_daimakai1) -STD_ROM_FN(sgx_daimakai1) - -struct BurnDriver BurnDrvsgx_daimakai1 = { - "sgx_daimakai1", "sgx_daimakai", NULL, NULL, "1990", - "Dai Makaimura (Alt)\0", NULL, "NEC Avenue", "SuperGrafx", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_SGX, GBF_MISC, 0, - SgxGetZipName, sgx_daimakai1RomInfo, sgx_daimakai1RomName, NULL, NULL, pceInputInfo, pceDIPInfo, - SGXInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - -// Dai Makaimura (Chris Covell's Debug Menu Hack) - -static struct BurnRomInfo sgx_daimakaidRomDesc[] = { - { "daimakai mura (japan)[debug].pce", 0x100000, 0xd6722c04, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sgx_daimakaid) -STD_ROM_FN(sgx_daimakaid) - -struct BurnDriver BurnDrvsgx_daimakaid = { - "sgx_daimakaid", "sgx_daimakai", NULL, NULL, "1990", - "Dai Makaimura (Chris Covell's Debug Menu Hack)\0", NULL, "NEC Avenue", "SuperGrafx", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 5, HARDWARE_PCENGINE_SGX, GBF_MISC, 0, - SgxGetZipName, sgx_daimakaidRomInfo, sgx_daimakaidRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - SGXInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - -// Madou Ou Granzort - -static struct BurnRomInfo sgx_granzortRomDesc[] = { - { "madou ou granzort (japan).pce", 0x080000, 0x1f041166, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sgx_granzort) -STD_ROM_FN(sgx_granzort) - -struct BurnDriver BurnDrvsgx_granzort = { - "sgx_granzort", NULL, NULL, NULL, "1990", - "Madou Ou Granzort\0", NULL, "Hudson", "SuperGrafx", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_SGX, GBF_MISC, 0, - SgxGetZipName, sgx_granzortRomInfo, sgx_granzortRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - SGXInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - - -// Aetherbyte Reflectron - -static struct BurnRomInfo pce_reflectronRomDesc[] = { - { "reflectron.pce", 0x040000, 0x6a3727e2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_reflectron) -STD_ROM_FN(pce_reflectron) - -struct BurnDriver BurnDrvpce_reflectron = { - "pce_reflectron", NULL, NULL, NULL, "2013", - "Reflectron\0", NULL, "Aetherbyte", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_reflectronRomInfo, pce_reflectronRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; - -// Aetherbyte Santatlantean - -static struct BurnRomInfo pce_santatlanteanRomDesc[] = { - { "Santatlantean.pce", 0x080200, 0xe6b38af1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(pce_santatlantean) -STD_ROM_FN(pce_santatlantean) - -struct BurnDriver BurnDrvpce_santatlantean = { - "pce_santatlantean", NULL, NULL, NULL, "2014", - "Santatlantean\0", NULL, "Aetherbyte", "PC Engine", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 5, HARDWARE_PCENGINE_PCENGINE, GBF_MISC, 0, - PceGetZipName, pce_santatlanteanRomInfo, pce_santatlanteanRomName, NULL, NULL, pceInputInfo, pceDIPInfo, - PCEInit, PCEExit, PCEFrame, PCEDraw, PCEScan, - &PCEPaletteRecalc, 0x400, 512, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pce/pce.cpp b/jan/src/burn/drv/pce/pce.cpp deleted file mode 100644 index 07e719ed9..000000000 --- a/jan/src/burn/drv/pce/pce.cpp +++ /dev/null @@ -1,702 +0,0 @@ -// FB Alpha PC-Engine / TurboGrafx 16 / SuperGrafx driver module -// Based on MESS driver by Charles MacDonald - -#include "tiles_generic.h" -#include "pce.h" -#include "h6280_intf.h" -#include "vdc.h" -#include "c6280.h" -#include "bitswap.h" - -/* -Notes: - - There is no CD emulation at all. - As this driver is based on MESS emulation, compatibility *should* be the same. - - Known emulation issues - also present in MESS unless noted. - SOUND PROBLEMS - Bouken Danshaku Don - The Lost Sunheart (not present in mess) - - GRAPHICS PROBLEMS - Cadash - graphics shaking - - OTHER PROBLEMS - Niko Niko Pun - hangs in-game - Benkei Gaiden - hangs after sunsoft logo - Power Tennis - frozen - Tennokoe Bank - ?? - Air Zonk / PC Denjin - Punkic Cyborgs - hangs in-game - Hisou Kihei - Xserd: black screen -*/ - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *PCECartROM; -static UINT8 *PCECartRAM; -static UINT8 *PCEUserRAM; -static UINT8 *PCECDBRAM; - -static UINT32 *DrvPalette; -UINT8 PCEPaletteRecalc; - -static UINT8 joystick_port_select; -static UINT8 joystick_data_select; -static UINT8 joystick_6b_select[5]; - -static void (*interrupt)(); - -static UINT16 PCEInputs[5]; -UINT8 PCEReset; -UINT8 PCEJoy1[12]; -UINT8 PCEJoy2[12]; -UINT8 PCEJoy3[12]; -UINT8 PCEJoy4[12]; -UINT8 PCEJoy5[12]; -UINT8 PCEDips[3]; - -static UINT8 system_identify; -static INT32 pce_sf2 = 0; -static INT32 pce_sf2_bank; -static UINT8 bram_locked = 1; -static INT32 wondermomohack = 0; - -INT32 PceGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = BurnDrvGetTextA(DRV_NAME); - } else { - pszGameName = BurnDrvGetTextA(DRV_PARENT); - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - - // remove the "pce_" - for (UINT32 j = 0; j < strlen(pszGameName); j++) { - szFilename[j] = pszGameName[j + 4]; - } - - *pszName = szFilename; - - return 0; -} - -INT32 TgGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = BurnDrvGetTextA(DRV_NAME); - } else { - pszGameName = BurnDrvGetTextA(DRV_PARENT); - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - - // remove the "tg_" - for (UINT32 j = 0; j < strlen(pszGameName); j++) { - szFilename[j] = pszGameName[j + 3]; - } - - *pszName = szFilename; - - return 0; -} - -INT32 SgxGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = BurnDrvGetTextA(DRV_NAME); - } else { - pszGameName = BurnDrvGetTextA(DRV_PARENT); - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - - // remove the "sgx_" - for (UINT32 j = 0; j < strlen(pszGameName); j++) { - szFilename[j] = pszGameName[j + 4]; - } - - *pszName = szFilename; - - return 0; -} - -static void sf2_bankswitch(UINT8 offset) -{ - pce_sf2_bank = offset; - - h6280MapMemory(PCECartROM + (offset * 0x80000) + 0x080000, 0x080000, 0x0fffff, MAP_ROM); -} - -static void pce_write(UINT32 address, UINT8 data) -{ - address &= 0x1fffff; - - if ((address & 0x1ffff0) == 0x001ff0) { - if (pce_sf2) sf2_bankswitch(address & 3); - return; - } - - switch (address & ~0x3ff) - { - case 0x1fe000: - vdc_write(0, address, data); - return; - - case 0x1fe400: - vce_write(address, data); - return; - - case 0x1fe800: - c6280_write(address, data); - return; - - case 0x1fec00: - h6280_timer_w(address & 0x3ff, data); - return; - - case 0x1ff000: - { - h6280io_set_buffer(data); - - INT32 type = (PCEDips[1] << 8) | (PCEDips[0] << 0); - - type = type; - - if (joystick_data_select == 0 && (data & 0x01)) { - joystick_port_select = (joystick_port_select + 1) & 0x07; - } - - joystick_data_select = data & 0x01; - - if (data & 0x02) { - joystick_port_select = 0; - - for (int i = 0; i < 5; i++) { - if (((type >> (i*2)) & 3) == 2) { - joystick_6b_select[i] ^= 1; - } - } - } - } - return; - - case 0x1ff400: - h6280_irq_status_w(address & 0x3ff, data); - return; - - case 0x1ff800: // cd system - { - switch( address & 0xf ) - { - case 0x07: /* BRAM unlock / CD status */ - { - if (data & 0x80) - { - bram_locked = 0; - } - } - break; - } - - bprintf(0,_T("CD write %x:%x\n"), address, data ); - } - return; - } - - if ((address >= 0x1ee000) && (address <= 0x1ee7ff)) { -// bprintf(0,_T("bram write %x:%x\n"), address & 0x7ff, data ); - if (!bram_locked) - { - PCECDBRAM[address & 0x7FF] = data; - } - return; - } - - - bprintf(0,_T("unknown write %x:%x\n"), address, data ); -} - -static UINT8 pce_read(UINT32 address) -{ - address &= 0x1fffff; - - switch (address & ~0x3ff) - { - case 0x1fe000: - return vdc_read(0, address); - - case 0x1fe400: - return vce_read(address); - - case 0x1fe800: - return c6280_read(); - - case 0x1fec00: - return h6280_timer_r(address & 0x3ff); - - case 0x1ff000: - { - INT32 type = (PCEDips[1] << 8) | (PCEDips[0] << 0); - UINT16 ret = 0; - - type = (type >> (joystick_port_select << 1)) & 0x03; - - if (joystick_port_select <= 4) { - if (type == 0) { - ret = PCEInputs[joystick_port_select] & 0x0ff; - } else { - ret = PCEInputs[joystick_port_select] & 0xfff; - ret >>= joystick_6b_select[joystick_port_select] * 8; - } - - if (joystick_data_select) ret >>= 4; - } else { - ret = 0xff; - } - - ret &= 0x0f; - ret |= 0x30; // ? - ret |= 0x80; // no cd! - ret |= system_identify; // 0x40 pce, sgx, 0x00 tg16 - - return ret; - } - - case 0x1ff400: - return h6280_irq_status_r(address & 0x3ff); - - case 0x1ff800: - switch( address & 0xf ) - { - case 0x03: /* BRAM lock / CD status */ - bram_locked = 1; - break; - } - bprintf(0,_T("CD read %x\n"), address ); - return 0; // cd system - } - - if ((address >= 0x1ee000) && (address <= 0x1ee7ff)) { - // bprintf(0,_T("bram read %x:%x\n"), address,address & 0x7ff ); - return PCECDBRAM[address & 0x7ff]; - } - - bprintf(0,_T("Unknown read %x\n"), address ); - - return 0; -} - -static UINT8 sgx_read(UINT32 address) -{ - address &= 0x1fffff; - - switch (address & ~0x3e7) - { - case 0x1fe000: - return vdc_read(0, address & 0x07); - - case 0x1fe008: - return vpc_read(address & 0x07); - - case 0x1fe010: - return vdc_read(1, address & 0x07); - } - - return pce_read(address); -} - -static void sgx_write(UINT32 address, UINT8 data) -{ - address &= 0x1fffff; - - switch (address & ~0x3e7) - { - case 0x1fe000: - vdc_write(0, address & 0x07, data); - return; - - case 0x1fe008: - vpc_write(address & 0x07, data); - return; - - case 0x1fe010: - vdc_write(1, address & 0x07, data); - return; - } - - pce_write(address, data); -} - -static void pce_write_port(UINT8 port, UINT8 data) -{ - if (port < 4) { - vdc_write(0, port, data); - } -} - -static void sgx_write_port(UINT8 port, UINT8 data) -{ - if (port < 4) { - sgx_vdc_write(port, data); - } -} - -static INT32 MemIndex(UINT32 cart_size, INT32 type) -{ - UINT8 *Next; Next = AllMem; - - PCECartROM = Next; Next += (cart_size <= 0x100000) ? 0x100000 : cart_size; - - DrvPalette = (UINT32*)Next; Next += 0x0401 * sizeof(UINT32); - - AllRam = Next; - - PCEUserRAM = Next; Next += (type == 2) ? 0x008000 : 0x002000; // pce/tg16 0x2000, sgx 0x8000 - - PCECartRAM = Next; Next += 0x008000; // populous - PCECDBRAM = Next; Next += 0x00800; // Bram thingy - vce_data = (UINT16*)Next; Next += 0x200 * sizeof(UINT16); - - vdc_vidram[0] = Next; Next += 0x010000; - vdc_vidram[1] = Next; Next += 0x010000; // sgx - - RamEnd = Next; - - vdc_tmp_draw = (UINT16*)Next; Next += 684 * 262 * sizeof(UINT16); - - MemEnd = Next; - - return 0; -} - -static INT32 PCEDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - h6280Open(0); - h6280Reset(); - h6280Close(); - - vdc_reset(); - vce_reset(); - vpc_reset(); - - c6280_reset(); - - memset (joystick_6b_select, 0, 5); - joystick_port_select = 0; - joystick_data_select = 0; - - pce_sf2_bank = 0; - - return 0; -} - -static INT32 CommonInit(int type) -{ - struct BurnRomInfo ri; - BurnDrvGetRomInfo(&ri, 0); - UINT32 length = ri.nLen; - - AllMem = NULL; - MemIndex(length, type); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(length, type); - - { - memset (PCECartROM, 0xff, length); - - if (BurnLoadRom(PCECartROM, 0, 1)) return 1; - - if (ri.nLen & 0x200) { // remove header - memcpy (PCECartROM, PCECartROM + 0x200, ri.nLen - 0x200); - length -= 0x200; - } - - if (PCECartROM[0x1fff] < 0xe0) { // decrypt japanese card - for (UINT32 i = 0; i < length; i++) { - PCECartROM[i] = BITSWAP08(PCECartROM[i], 0,1,2,3,4,5,6,7); - } - } - - if (length == 0x280000) pce_sf2 = 1; - - if (length == 0x60000) - { - memcpy (PCECartROM + 0x60000, PCECartROM + 0x40000, 0x20000); - memcpy (PCECartROM + 0x80000, PCECartROM + 0x40000, 0x40000); - memcpy (PCECartROM + 0xc0000, PCECartROM + 0x40000, 0x40000); - memcpy (PCECartROM + 0x40000, PCECartROM + 0x00000, 0x40000); - } - else - { - if (length <= 0x40000) - { - memcpy (PCECartROM + 0x40000, PCECartROM + 0x00000, 0x40000); - } - - if (length <= 0x80000) - { - memcpy (PCECartROM + 0x80000, PCECartROM + 0x00000, 0x80000); - } - } - } - - if (type == 0 || type == 1) // pce / tg-16 - { - h6280Init(0); - h6280Open(0); - h6280MapMemory(PCECartROM + 0x000000, 0x000000, 0x0fffff, MAP_ROM); - h6280MapMemory(PCEUserRAM + 0x000000, 0x1f0000, 0x1f1fff, MAP_RAM); // mirrored - h6280MapMemory(PCEUserRAM + 0x000000, 0x1f2000, 0x1f3fff, MAP_RAM); - h6280MapMemory(PCEUserRAM + 0x000000, 0x1f4000, 0x1f5fff, MAP_RAM); - h6280MapMemory(PCEUserRAM + 0x000000, 0x1f6000, 0x1f7fff, MAP_RAM); - h6280SetWritePortHandler(pce_write_port); - h6280SetWriteHandler(pce_write); - h6280SetReadHandler(pce_read); - h6280Close(); - - interrupt = pce_interrupt; - - if (type == 0) { // pce - system_identify = 0x40; - } else { // tg16 - system_identify = 0x00; - } - } - else if (type == 2) // sgx - { - h6280Init(0); - h6280Open(0); - h6280MapMemory(PCECartROM, 0x000000, 0x0fffff, MAP_ROM); - h6280MapMemory(PCEUserRAM, 0x1f0000, 0x1f7fff, MAP_RAM); - h6280SetWritePortHandler(sgx_write_port); - h6280SetWriteHandler(sgx_write); - h6280SetReadHandler(sgx_read); - h6280Close(); - - interrupt = sgx_interrupt; - system_identify = 0x40; - } - - bram_locked = 1; - - vdc_init(); - vce_palette_init(DrvPalette); - - c6280_init(3579545, 0); - c6280_set_route(BURN_SND_C6280_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - c6280_set_route(BURN_SND_C6280_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - PCEDoReset(); - - return 0; -} - -INT32 PCEInit() -{ -// bprintf (0, _T("booting PCE!\n")); - return CommonInit(0); -} - -INT32 TG16Init() -{ -// bprintf (0, _T("booting TG16!\n")); - return CommonInit(1); -} - -INT32 SGXInit() -{ -// bprintf (0, _T("booting SGX!\n")); - return CommonInit(2); -} - -INT32 populousInit() -{ - int nRet = PCEInit(); - - if (nRet == 0) { - h6280Open(0); - h6280MapMemory(PCECartRAM, 0x080000, 0x087fff, MAP_RAM); - h6280Close(); - } - - return nRet; -} - -INT32 wondermomoInit() -{ - wondermomohack = 1; - return PCEInit(); -} - -INT32 PCEExit() -{ - GenericTilesExit(); - - c6280_exit(); - vdc_exit(); - - h6280Exit(); - - BurnFree (AllMem); - - pce_sf2 = 0; - wondermomohack = 0; - - return 0; -} - -INT32 PCEDraw() -{ - if (PCEPaletteRecalc) { - vce_palette_init(DrvPalette); - PCEPaletteRecalc = 0; - } - - { - UINT16 *src = vdc_tmp_draw + ((14+2) * 684) + 86; - UINT16 *dst = pTransDraw; - - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = 0; x < nScreenWidth; x++) { - dst[x] = src[x]; - } - dst += nScreenWidth; - src += 684; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void PCECompileInputs() -{ - memset (PCEInputs, 0xff, 5 * sizeof(UINT16)); - - for (INT32 i = 0; i < 12; i++) { - PCEInputs[0] ^= (PCEJoy1[i] & 1) << i; - PCEInputs[1] ^= (PCEJoy2[i] & 1) << i; - PCEInputs[2] ^= (PCEJoy3[i] & 1) << i; - PCEInputs[3] ^= (PCEJoy4[i] & 1) << i; - PCEInputs[4] ^= (PCEJoy5[i] & 1) << i; - } -} - -INT32 PCEFrame() -{ - if (PCEReset) { - PCEDoReset(); - } - - h6280NewFrame(); // needed for c6280 - - PCECompileInputs(); - - INT32 nCyclesTotal = (INT32)((INT64)7159090 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - if (wondermomohack) nCyclesTotal += 1000; - INT32 nCyclesDone = 0; - INT32 nCyclesSegment = 0; - - h6280Open(0); - - for (INT32 i = 0; i < 262; i++) - { - INT32 nNext; - nNext = (i + 1) * nCyclesTotal / 262; - nCyclesSegment = nNext - nCyclesDone; - nCyclesDone += h6280Run(nCyclesSegment); - interrupt(); - } - - if (pBurnSoundOut) { - c6280_update(pBurnSoundOut, nBurnSoundLen); - } - - h6280Close(); - - if (pBurnDraw) { - PCEDraw(); - } - - return 0; -} - -INT32 PCEScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - h6280CpuScan(nAction); - - vdc_scan(nAction, pnMin); - c6280_scan(nAction, pnMin); - - SCAN_VAR(joystick_port_select); - SCAN_VAR(joystick_data_select); - SCAN_VAR(joystick_6b_select[0]); - SCAN_VAR(joystick_6b_select[1]); - SCAN_VAR(joystick_6b_select[2]); - SCAN_VAR(joystick_6b_select[3]); - SCAN_VAR(joystick_6b_select[4]); - SCAN_VAR(bram_locked); - - if (pce_sf2) { - SCAN_VAR(pce_sf2_bank); - sf2_bankswitch(pce_sf2_bank); - } - } - - return 0; -} diff --git a/jan/src/burn/drv/pce/pce.h b/jan/src/burn/drv/pce/pce.h deleted file mode 100644 index d63f76a3e..000000000 --- a/jan/src/burn/drv/pce/pce.h +++ /dev/null @@ -1,24 +0,0 @@ -extern UINT8 PCEPaletteRecalc; - -extern UINT8 PCEReset; -extern UINT8 PCEJoy1[12]; -extern UINT8 PCEJoy2[12]; -extern UINT8 PCEJoy3[12]; -extern UINT8 PCEJoy4[12]; -extern UINT8 PCEJoy5[12]; -extern UINT8 PCEDips[3]; - -INT32 PceGetZipName(char** pszName, UINT32 i); -INT32 TgGetZipName(char** pszName, UINT32 i); -INT32 SgxGetZipName(char** pszName, UINT32 i); - -INT32 PCEInit(); -INT32 TG16Init(); -INT32 SGXInit(); -INT32 populousInit(); -INT32 wondermomoInit(); - -INT32 PCEExit(); -INT32 PCEDraw(); -INT32 PCEFrame(); -INT32 PCEScan(INT32 nAction, INT32 *pnMin); diff --git a/jan/src/burn/drv/pgm/d_pgm.cpp b/jan/src/burn/drv/pgm/d_pgm.cpp deleted file mode 100644 index e4097233e..000000000 --- a/jan/src/burn/drv/pgm/d_pgm.cpp +++ /dev/null @@ -1,5701 +0,0 @@ -// FB Alpha IGS PolyGameMaster driver module -// Original FB Alpha port by OopsWare -// Based on information from ElSemi, Haze (David Haywood), and XingXing - -#include "pgm.h" -#include "ics2115.h" - -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; - -static struct BurnInputInfo pgmInputList[] = { - {"P1 Coin", BIT_DIGITAL, PgmBtn1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, PgmJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, PgmJoy1 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, PgmJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, PgmJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, PgmJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, PgmJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, PgmJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, PgmJoy1 + 7, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, PgmBtn2 + 0, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, PgmBtn1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, PgmJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, PgmJoy2 + 1, "p2 up" }, - {"P2 Down", BIT_DIGITAL, PgmJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, PgmJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, PgmJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, PgmJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, PgmJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, PgmJoy2 + 7, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, PgmBtn2 + 1, "p2 fire 4" }, - - {"P3 Coin", BIT_DIGITAL, PgmBtn1 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, PgmJoy3 + 0, "p3 start" }, - {"P3 Up", BIT_DIGITAL, PgmJoy3 + 1, "p3 up" }, - {"P3 Down", BIT_DIGITAL, PgmJoy3 + 2, "p3 down" }, - {"P3 Left", BIT_DIGITAL, PgmJoy3 + 3, "p3 left" }, - {"P3 Right", BIT_DIGITAL, PgmJoy3 + 4, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, PgmJoy3 + 5, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, PgmJoy3 + 6, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, PgmJoy3 + 7, "p3 fire 3" }, - {"P3 Button 4", BIT_DIGITAL, PgmBtn2 + 2, "p3 fire 4" }, - - {"P4 Coin", BIT_DIGITAL, PgmBtn1 + 3, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, PgmJoy4 + 0, "p4 start" }, - {"P4 Up", BIT_DIGITAL, PgmJoy4 + 1, "p4 up" }, - {"P4 Down", BIT_DIGITAL, PgmJoy4 + 2, "p4 down" }, - {"P4 Left", BIT_DIGITAL, PgmJoy4 + 3, "p4 left" }, - {"P4 Right", BIT_DIGITAL, PgmJoy4 + 4, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, PgmJoy4 + 5, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, PgmJoy4 + 6, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, PgmJoy4 + 7, "p4 fire 3" }, - {"P4 Button 4", BIT_DIGITAL, PgmBtn2 + 3, "p4 fire 4" }, - - {"Reset", BIT_DIGITAL, &PgmReset, "reset" }, - {"Diagnostics 1", BIT_DIGITAL, PgmBtn1 + 4, "diag" }, - {"Diagnostics 2", BIT_DIGITAL, PgmBtn1 + 6, "" }, - {"Service 1", BIT_DIGITAL, PgmBtn1 + 5, "service" }, - {"Service 2", BIT_DIGITAL, PgmBtn1 + 7, "service2" }, - - {"Dip A", BIT_DIPSWITCH, PgmInput + 6, "dip" }, - {"Dip B", BIT_DIPSWITCH, PgmInput + 7, "dip" }, - {"Dip C", BIT_DIPSWITCH, PgmInput + 8, "dip" }, -}; - -STDINPUTINFO(pgm) - -static struct BurnDIPInfo pgmDIPList[] = { - {0x2D, 0xFF, 0xFF, 0x00, NULL }, - {0x2F, 0xFF, 0x01, 0x01, NULL }, - - {0, 0xFE, 0, 2, "Test mode" }, - {0x2D, 0x01, 0x01, 0x00, "Off" }, - {0x2D, 0x01, 0x01, 0x01, "On" }, - - {0, 0xFE, 0, 2, "Music" }, - {0x2D, 0x01, 0x02, 0x02, "Off" }, - {0x2D, 0x01, 0x02, 0x00, "On" }, - - {0, 0xFE, 0, 2, "Voice" }, - {0x2D, 0x01, 0x04, 0x04, "Off" }, - {0x2D, 0x01, 0x04, 0x00, "On" }, - - {0, 0xFE, 0, 2, "Free play" }, - {0x2D, 0x01, 0x08, 0x00, "Off" }, - {0x2D, 0x01, 0x08, 0x08, "On" }, - - {0, 0xFE, 0, 2, "Stop mode" }, - {0x2D, 0x01, 0x10, 0x00, "Off" }, - {0x2D, 0x01, 0x10, 0x10, "On" }, - - {0, 0xFE, 0, 4, "Bios select (Fake)" }, - {0x2F, 0x01, 0x0f, 0x00, "Older" }, - {0x2F, 0x01, 0x0f, 0x01, "Newer" }, - {0x2F, 0x01, 0x0f, 0x02, "Newer (no intro, calendar)" }, - {0x2F, 0x01, 0x0f, 0x03, "Newer (no intro)" }, -}; - -STDDIPINFO(pgm) - -static struct BurnDIPInfo jammaDIPList[] = { - {0x2D, 0xFF, 0xFF, 0x00, NULL }, - {0x2F, 0xFF, 0x01, 0x00, NULL }, - - {0, 0xFE, 0, 2, "Test mode" }, - {0x2D, 0x01, 0x01, 0x00, "Off" }, - {0x2D, 0x01, 0x01, 0x01, "On" }, - - {0, 0xFE, 0, 2, "Music" }, - {0x2D, 0x01, 0x02, 0x02, "Off" }, - {0x2D, 0x01, 0x02, 0x00, "On" }, - - {0, 0xFE, 0, 2, "Voice" }, - {0x2D, 0x01, 0x04, 0x04, "Off" }, - {0x2D, 0x01, 0x04, 0x00, "On" }, - - {0, 0xFE, 0, 2, "Free play" }, - {0x2D, 0x01, 0x08, 0x00, "Off" }, - {0x2D, 0x01, 0x08, 0x08, "On" }, - - {0, 0xFE, 0, 2, "Stop mode" }, - {0x2D, 0x01, 0x10, 0x00, "Off" }, - {0x2D, 0x01, 0x10, 0x10, "On" }, -}; - -STDDIPINFO(jamma) - -static struct BurnDIPInfo orlegendDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x00, NULL }, - - {0, 0xFE, 0, 2, "Disable Ba-Chieh" }, - {0x2E, 0x02, 0x01, 0x00, "Off" }, - {0x2E, 0x02, 0x01, 0x01, "On" }, - - {0, 0xFE, 0, 3, "Region (Fake)" }, - {0x2E, 0x01, 0x03, 0x00, "World" }, - {0x2E, 0x01, 0x03, 0x02, "Korea" }, - {0x2E, 0x01, 0x03, 0x03, "China" }, -}; - -static struct BurnDIPInfo orld111cDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x02, NULL }, - - {0, 0xFE, 0, 2, "Region (Fake)" }, - {0x2E, 0x01, 0x03, 0x00, "Hong Kong" }, - {0x2E, 0x01, 0x03, 0x02, "China" }, -}; - -static struct BurnDIPInfo orld111tDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x04, NULL }, -}; - -static struct BurnDIPInfo orld105kDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x02, NULL }, -}; - -static struct BurnDIPInfo orld112cDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x03, NULL }, - - {0, 0xFE, 0, 3, "Region (Fake)" }, - {0x2E, 0x01, 0x03, 0x00, "World" }, - {0x2E, 0x01, 0x03, 0x02, "Korea" }, - {0x2E, 0x01, 0x03, 0x03, "China" }, -}; - -static struct BurnDIPInfo killbldDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x17, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0xFF, 0x16, "Taiwan" }, - {0x2E, 0x01, 0xFF, 0x17, "China" }, - {0x2E, 0x01, 0xFF, 0x18, "Hong Kong" }, - {0x2E, 0x01, 0xFF, 0x19, "Japan" }, - {0x2E, 0x01, 0xFF, 0x20, "Korea" }, - {0x2E, 0x01, 0xFF, 0x21, "World" }, -}; - -static struct BurnDIPInfo killbld104DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x21, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0xFF, 0x16, "Taiwan" }, - {0x2E, 0x01, 0xFF, 0x17, "China" }, - {0x2E, 0x01, 0xFF, 0x18, "Hong Kong" }, - {0x2E, 0x01, 0xFF, 0x19, "Japan" }, - {0x2E, 0x01, 0xFF, 0x20, "Korea" }, - {0x2E, 0x01, 0xFF, 0x21, "World" }, -}; - -static struct BurnDIPInfo photoy2kDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x03, NULL }, - - {0, 0xFE, 0, 7, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x01, "China" }, - {0x2E, 0x01, 0x0F, 0x02, "Japan" }, - {0x2E, 0x01, 0x0F, 0x03, "World" }, - {0x2E, 0x01, 0x0F, 0x04, "Korea" }, - {0x2E, 0x01, 0x0F, 0x05, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x06, "Singapore / Malaysia" }, -}; - -static struct BurnDIPInfo py2k2DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x00, NULL }, - - {0, 0xFE, 0, 7, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x01, "China" }, - {0x2E, 0x01, 0x0F, 0x02, "Japan" }, - {0x2E, 0x01, 0x0F, 0x03, "World" }, - {0x2E, 0x01, 0x0F, 0x04, "Korea" }, - {0x2E, 0x01, 0x0F, 0x05, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x06, "Singapore / Malaysia" }, -}; - -static struct BurnDIPInfo oldsDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x04, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x02, "China" }, - {0x2E, 0x01, 0x0F, 0x03, "Japan" }, - {0x2E, 0x01, 0x0F, 0x04, "Korea" }, - {0x2E, 0x01, 0x0F, 0x05, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x06, "World" }, -}; - -static struct BurnDIPInfo olds100DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x06, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x02, "China" }, - {0x2E, 0x01, 0x0F, 0x03, "Japan" }, - {0x2E, 0x01, 0x0F, 0x04, "Korea" }, - {0x2E, 0x01, 0x0F, 0x05, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x06, "World" }, -}; - -static struct BurnDIPInfo olds103tDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x02, NULL }, -}; - -static struct BurnDIPInfo puzzli2DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x05, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x01, "China" }, - {0x2E, 0x01, 0x0F, 0x02, "Japan" }, - {0x2E, 0x01, 0x0F, 0x03, "Korea" }, - {0x2E, 0x01, 0x0F, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x05, "World" }, -}; - -static struct BurnDIPInfo kovDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x05, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "China" }, - {0x2E, 0x01, 0x0F, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x02, "Japan" }, - {0x2E, 0x01, 0x0F, 0x03, "Korea" }, - {0x2E, 0x01, 0x0F, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x05, "World" }, -}; - -static struct BurnDIPInfo kov111DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x02, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "China" }, - {0x2E, 0x01, 0x0F, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x02, "Japan" }, - {0x2E, 0x01, 0x0F, 0x03, "Korea" }, - {0x2E, 0x01, 0x0F, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x05, "World" }, -}; - -static struct BurnDIPInfo kov114DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x04, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "China" }, - {0x2E, 0x01, 0x0F, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x02, "Japan" }, - {0x2E, 0x01, 0x0F, 0x03, "Korea" }, - {0x2E, 0x01, 0x0F, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x05, "World" }, -}; - -static struct BurnDIPInfo kov2DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x04, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "China" }, - {0x2E, 0x01, 0x0F, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x02, "Japan" }, - {0x2E, 0x01, 0x0F, 0x03, "Korea" }, - {0x2E, 0x01, 0x0F, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x05, "World" }, -}; - -static struct BurnDIPInfo martmastDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x06, NULL }, - - {0, 0xFE, 0, 7, "Region (Fake)" }, - {0x2E, 0x01, 0x07, 0x00, "China" }, - {0x2E, 0x01, 0x07, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x07, 0x02, "Japan" }, - {0x2E, 0x01, 0x07, 0x03, "Korea" }, - {0x2E, 0x01, 0x07, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x07, 0x05, "World" }, - {0x2E, 0x01, 0x07, 0x06, "USA" }, -}; - -static struct BurnDIPInfo martmastc102DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x00, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x07, 0x00, "China" }, - {0x2E, 0x01, 0x07, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x07, 0x02, "Japan" }, - {0x2E, 0x01, 0x07, 0x03, "Korea" }, - {0x2E, 0x01, 0x07, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x07, 0x05, "World" }, -// {0x2E, 0x01, 0x07, 0x06, "USA" }, -}; - -static struct BurnDIPInfo thegladDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x06, NULL }, - - {0, 0xFE, 0, 7, "Region (Fake)" }, - {0x2E, 0x01, 0x07, 0x00, "China" }, - {0x2E, 0x01, 0x07, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x07, 0x02, "Japan" }, - {0x2E, 0x01, 0x07, 0x03, "Korea" }, - {0x2E, 0x01, 0x07, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x07, 0x05, "Spanish Territories" }, - {0x2E, 0x01, 0x07, 0x06, "World" }, -}; - -static struct BurnDIPInfo theglad100DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x01, NULL }, - - {0, 0xFE, 0, 7, "Region (Fake)" }, - {0x2E, 0x01, 0x07, 0x00, "China" }, - {0x2E, 0x01, 0x07, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x07, 0x02, "Japan" }, - {0x2E, 0x01, 0x07, 0x03, "Korea" }, - {0x2E, 0x01, 0x07, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x07, 0x05, "Spanish Territories" }, - {0x2E, 0x01, 0x07, 0x06, "World" }, -}; - -static struct BurnDIPInfo thegladpcbDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x02, NULL }, - - {0, 0xFE, 0, 7, "Region (Fake)" }, - {0x2E, 0x01, 0x07, 0x00, "China" }, - {0x2E, 0x01, 0x07, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x07, 0x02, "Japan" }, - {0x2E, 0x01, 0x07, 0x03, "Korea" }, - {0x2E, 0x01, 0x07, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x07, 0x05, "Spanish Territories" }, - {0x2E, 0x01, 0x07, 0x06, "World" }, -}; - -static struct BurnDIPInfo dmnfrntpcbDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x03, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "China" }, - {0x2E, 0x01, 0x0F, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x02, "Japan" }, - {0x2E, 0x01, 0x0F, 0x03, "Korea" }, - {0x2E, 0x01, 0x0F, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x05, "World" }, -}; - -static struct BurnDIPInfo ddp2DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x05, NULL }, -}; - -static struct BurnDIPInfo ddp2hkDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x04, NULL }, -}; - -static struct BurnDIPInfo ddp2kDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x03, NULL }, -}; - -static struct BurnDIPInfo ddp2jDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x02, NULL }, -}; - -static struct BurnDIPInfo ddp2tDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x01, NULL }, -}; - -static struct BurnDIPInfo ddp2cDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x00, NULL }, -}; - -static struct BurnDIPInfo kovshxasDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x00, NULL }, - - {0, 0xFE, 0, 6, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "China" }, - {0x2E, 0x01, 0x0F, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x02, "Japan" }, - {0x2E, 0x01, 0x0F, 0x03, "Korea" }, - {0x2E, 0x01, 0x0F, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x05, "World" }, -}; - -static struct BurnDIPInfo happy6DIPList[] = { - {0x2E, 0xFF, 0xFF, 0x00, NULL }, - - {0, 0xFE, 0, 5, "Region (Fake)" }, - {0x2E, 0x01, 0x0F, 0x00, "China" }, - {0x2E, 0x01, 0x0F, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x0F, 0x02, "Hong Kong" }, - {0x2E, 0x01, 0x0F, 0x03, "Singapore" }, - {0x2E, 0x01, 0x0F, 0x04, "World" }, -}; - -static struct BurnDIPInfo svgDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x00, NULL }, - - {0, 0xFE, 0, 7, "Region (Fake)" }, - {0x2E, 0x01, 0x07, 0x00, "China" }, - {0x2E, 0x01, 0x07, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x07, 0x02, "Japan" }, - {0x2E, 0x01, 0x07, 0x03, "Korea" }, - {0x2E, 0x01, 0x07, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x07, 0x05, "Spanish Territories" }, - {0x2E, 0x01, 0x07, 0x06, "World" }, -}; - -static struct BurnDIPInfo svgtwDIPList[] = { - {0x2E, 0xFF, 0xFF, 0x01, NULL }, - - {0, 0xFE, 0, 8, "Region (Fake)" }, - {0x2E, 0x01, 0x07, 0x00, "China" }, - {0x2E, 0x01, 0x07, 0x01, "Taiwan" }, - {0x2E, 0x01, 0x07, 0x02, "Japan" }, - {0x2E, 0x01, 0x07, 0x03, "Korea" }, - {0x2E, 0x01, 0x07, 0x04, "Hong Kong" }, - {0x2E, 0x01, 0x07, 0x05, "Spanish Territories" }, - {0x2E, 0x01, 0x07, 0x06, "World" }, - {0x2E, 0x01, 0x07, 0xff, "Don't Change" }, -}; - -STDDIPINFOEXT(orlegend, pgm, orlegend ) -STDDIPINFOEXT(orld111c, pgm, orld111c ) -STDDIPINFOEXT(orld111t, pgm, orld111t ) -STDDIPINFOEXT(orld105k, pgm, orld105k ) -STDDIPINFOEXT(orld112c, pgm, orld112c ) -STDDIPINFOEXT(kov, pgm, kov ) -STDDIPINFOEXT(kov111, pgm, kov111 ) -STDDIPINFOEXT(kov114, pgm, kov114 ) -STDDIPINFOEXT(kov2, pgm, kov2 ) -STDDIPINFOEXT(kovshxas, pgm, kovshxas ) -STDDIPINFOEXT(killbld, pgm, killbld ) -STDDIPINFOEXT(killbld104, pgm, killbld104 ) -STDDIPINFOEXT(photoy2k, pgm, photoy2k ) -STDDIPINFOEXT(py2k2, pgm, py2k2 ) -STDDIPINFOEXT(puzzli2, pgm, puzzli2 ) -STDDIPINFOEXT(martmast, pgm, martmast ) -STDDIPINFOEXT(martmastc102, pgm, martmastc102 ) -STDDIPINFOEXT(olds, pgm, olds ) -STDDIPINFOEXT(olds100, pgm, olds100 ) -STDDIPINFOEXT(olds103t, pgm, olds103t ) -STDDIPINFOEXT(ddp2, pgm, ddp2 ) -STDDIPINFOEXT(ddp2hk, pgm, ddp2hk ) -STDDIPINFOEXT(ddp2k, pgm, ddp2k ) -STDDIPINFOEXT(ddp2j, pgm, ddp2j ) -STDDIPINFOEXT(ddp2t, pgm, ddp2t ) -STDDIPINFOEXT(ddp2c, pgm, ddp2c ) -STDDIPINFOEXT(theglad, pgm, theglad ) -STDDIPINFOEXT(theglad100, pgm, theglad100 ) -STDDIPINFOEXT(happy6, pgm, happy6 ) -STDDIPINFOEXT(svg, pgm, svg ) -STDDIPINFOEXT(svgtw, pgm, svgtw ) -STDDIPINFOEXT(dmnfrntpcb, jamma, dmnfrntpcb ) -STDDIPINFOEXT(thegladpcb, jamma, thegladpcb ) - -// ----------------------------------------------------------------------------- -// BIOS - - -// PGM (Polygame Master) System BIOS - -static struct BurnRomInfo pgmRomDesc[] = { - { "pgm_t01s.rom", 0x200000, 0x1a7123a0, BRF_GRA | BRF_BIOS }, // 0x80 - 8x8 Text Layer Tiles - { "pgm_m01s.rom", 0x200000, 0x45ae7159, BRF_SND | BRF_BIOS }, // 0x81 - Samples - - { "pgm_p01s.u20", 0x020000, 0xe42b166e, BRF_PRG | BRF_BIOS }, // 0x82 - 68K BIOS (V0001, older - 02/26/97 - 11:14:09) - { "pgm_p02s.u20", 0x020000, 0x78c15fa2, BRF_PRG | BRF_BIOS }, // 0x83 - 68K BIOS (V0001, newer - 07/10/97 - 16:36:08) -#if !defined (ROM_VERIFY) - { "ddp3_bios.u37", 0x080000, 0xb3cc5c8f, BRF_PRG | BRF_BIOS }, // 0x84 - 68K BIOS (V0001, custom - 07/17/97 - 19:44:59) - { "bios.u42", 0x020000, 0x517cf7a2, BRF_PRG | BRF_BIOS }, // 0x85 - 68K BIOS (V0001-01J, custom - 02/25/03 - 17:51:01) -#else - { "", 0x000000, 0x00000000, 0 }, // 0x84 - { "", 0x000000, 0x00000000, 0 }, // 0x85 -#endif -}; - -STD_ROM_PICK(pgm) -STD_ROM_FN(pgm) - -struct BurnDriver BurnDrvPgm = { - "pgm", NULL, NULL, NULL, "1997", - "PGM (Polygame Master) System BIOS\0", "BIOS only", "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_BOARDROM, 0, HARDWARE_IGS_PGM, GBF_BIOS, 0, - NULL, pgmRomInfo, pgmRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - pgmInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - -static struct BurnRomInfo thegladBIOSRomDesc[] = { - { "pgm_t01s.u72", 0x200000, 0x1a7123a0, BRF_GRA | BRF_BIOS }, // 0x80 - 8x8 Text Layer Tiles - - { "pgm_m01s.u4", 0x200000, 0x45ae7159, BRF_SND | BRF_BIOS }, // 0x81 - Samples - - { "bios.42", 0x020000, 0x517cf7a2, BRF_PRG | BRF_BIOS }, // 0x82 - 68K BIOS (V0001-01J, custom 02/25/03 17:51:01) -}; - -static struct BurnRomInfo dmnfrntBIOSRomDesc[] = { - { "pgm_t01s.rom", 0x200000, 0x1a7123a0, BRF_GRA | BRF_BIOS }, // 0x80 - 8x8 Text Layer Tiles - - { "pgm_m01s.rom", 0x200000, 0x45ae7159, BRF_SND | BRF_BIOS }, // 0x81 - Samples - - { "pgm_p02s.u42", 0x020000, 0x78c15fa2, BRF_PRG | BRF_BIOS }, // 0x82 - 68K BIOS (V0001, newer - 07/10/97 - 16:36:08) -}; - -static struct BurnRomInfo svgpcbBIOSRomDesc[] = { - { "pgm_t01s.rom", 0x200000, 0x1a7123a0, BRF_GRA | BRF_BIOS }, // 0x80 - 8x8 Text Layer Tiles - - { "pgm_m01s.rom", 0x200000, 0x45ae7159, BRF_SND | BRF_BIOS }, // 0x81 - Samples - - { "svg_bios.u49", 0x020000, 0x3346401f, BRF_PRG | BRF_BIOS }, // 0x82 - 68K BIOS (V0001, custom 05/13/05 16:00:00) -}; - -static struct BurnRomInfo ketsuiBiosRomDesc[] = { - { "pgm_t01s.rom", 0x200000, 0x1a7123a0, BRF_GRA | BRF_BIOS }, // 0x80 - 8x8 Text Layer Tiles - { "", 0, 0, 0 }, // 0x81 - Samples - - { "", 0, 0, 0 }, // 0x82 - 68K BIOS - { "", 0, 0, 0 }, // 0x83 - 68K BIOS -}; - -static struct BurnRomInfo espgalBiosRomDesc[] = { - { "t01s.u18", 0x200000, 0x1a7123a0, BRF_GRA | BRF_BIOS }, // 0x80 - 8x8 Text Layer Tiles - { "", 0, 0, 0 }, // 0x81 - Samples - - { "", 0, 0, 0 }, // 0x82 - 68K BIOS - { "", 0, 0, 0 }, // 0x83 - 68K BIOS -}; - -static struct BurnRomInfo ddp3BiosRomDesc[] = { - { "pgm_t01s.rom", 0x200000, 0x1a7123a0, BRF_GRA | BRF_BIOS }, // 0x80 - 8x8 Text Layer Tiles - - { "pgm_m01s.rom", 0x200000, 0x45ae7159, BRF_SND | BRF_BIOS }, // 0x81 - Samples - - { "ddp3_bios.u37", 0x080000, 0xb3cc5c8f, BRF_PRG | BRF_BIOS }, // 0x82 - 68K BIOS (V0001, custom? 07/17/97 19:44:59) -}; - - -// ----------------------------------------------------------------------------- -// Normal Games - - -// Oriental Legend / Xi Yo Gi Shi Re Zuang (V126) - -static struct BurnRomInfo orlegendRomDesc[] = { - { "p0103.rom", 0x200000, 0xd5e93543, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0100.u8", 0x400000, 0x61425e1e, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.u5", 0x400000, 0x8b3bd88a, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0101.u6", 0x400000, 0x3b9e9644, 3 | BRF_GRA }, // 3 - { "a0102.u7", 0x400000, 0x069e2c38, 3 | BRF_GRA }, // 4 - { "a0103.u8", 0x400000, 0x4460a3fd, 3 | BRF_GRA }, // 5 - { "a0104.u11", 0x400000, 0x5f8abb56, 3 | BRF_GRA }, // 6 - { "a0105.u12", 0x400000, 0xa17a7147, 3 | BRF_GRA }, // 7 - - { "b0100.u9", 0x400000, 0x69d2e48c, 4 | BRF_GRA }, // 8 Sprite Masks & Color Indexes - { "b0101.u10", 0x400000, 0x0d587bf3, 4 | BRF_GRA }, // 9 - { "b0102.u15", 0x400000, 0x43823c1e, 4 | BRF_GRA }, // 10 - - { "m0100.u1", 0x200000, 0xe5c36c83, 5 | BRF_SND }, // 11 Samples -}; - -STDROMPICKEXT(orlegend, orlegend, pgm) -STD_ROM_FN(orlegend) - -static INT32 orlegendInit() -{ - pPgmProtCallback = install_protection_asic3_orlegend; - - return pgmInit(); -} - -struct BurnDriver BurnDrvOrlegend = { - "orlegend", NULL, "pgm", NULL, "1997", - "Oriental Legend - Xi Yo Gi Shi Re Zuang (V126)\0", NULL, "IGS", "PolyGameMaster", - L"Oriental Legend\0\u897F\u6E38\u91CA\u5384\u4F20 (V126)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, orlegendRomInfo, orlegendRomName, NULL, NULL, pgmInputInfo, orlegendDIPInfo, - orlegendInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend / Xi Yo Gi Shi Re Zuang (V112) - -static struct BurnRomInfo orlegend112eRomDesc[] = { - { "p0102.rom", 0x200000, 0x4d0f6cc5, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0100.u8", 0x400000, 0x61425e1e, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.u5", 0x400000, 0x8b3bd88a, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0101.u6", 0x400000, 0x3b9e9644, 3 | BRF_GRA }, // 3 - { "a0102.u7", 0x400000, 0x069e2c38, 3 | BRF_GRA }, // 4 - { "a0103.u8", 0x400000, 0x4460a3fd, 3 | BRF_GRA }, // 5 - { "a0104.u11", 0x400000, 0x5f8abb56, 3 | BRF_GRA }, // 6 - { "a0105.u12", 0x400000, 0xa17a7147, 3 | BRF_GRA }, // 7 - - { "b0100.u9", 0x400000, 0x69d2e48c, 4 | BRF_GRA }, // 8 Sprite Masks & Color Indexes - { "b0101.u10", 0x400000, 0x0d587bf3, 4 | BRF_GRA }, // 9 - { "b0102.u15", 0x400000, 0x43823c1e, 4 | BRF_GRA }, // 10 - - { "m0100.u1", 0x200000, 0xe5c36c83, 5 | BRF_SND }, // 11 Samples -}; - -STDROMPICKEXT(orlegend112e, orlegend112e, pgm) -STD_ROM_FN(orlegend112e) - -struct BurnDriver BurnDrvOrlegend112e = { - "orlegende", "orlegend", "pgm", NULL, "1997", - "Oriental Legend - Xi Yo Gi Shi Re Zuang (V112)\0", NULL, "IGS", "PolyGameMaster", - L"Oriental Legend\0\u897F\u6E38\u91CA\u5384\u4F20 (V112)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, orlegend112eRomInfo, orlegend112eRomName, NULL, NULL, pgmInputInfo, orlegendDIPInfo, - orlegendInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend / Xi Yo Gi Shi Re Zuang (V112, China) - -static struct BurnRomInfo orlegend112cRomDesc[] = { - { "p0101.160", 0x200000, 0xb24f0c1e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0100.u8", 0x400000, 0x61425e1e, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.u5", 0x400000, 0x8b3bd88a, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0101.u6", 0x400000, 0x3b9e9644, 3 | BRF_GRA }, // 3 - { "a0102.u7", 0x400000, 0x069e2c38, 3 | BRF_GRA }, // 4 - { "a0103.u8", 0x400000, 0x4460a3fd, 3 | BRF_GRA }, // 5 - { "a0104.u11", 0x400000, 0x5f8abb56, 3 | BRF_GRA }, // 6 - { "a0105.u12", 0x400000, 0xa17a7147, 3 | BRF_GRA }, // 7 - - { "b0100.u9", 0x400000, 0x69d2e48c, 4 | BRF_GRA }, // 8 Sprite Masks & Color Indexes - { "b0101.u10", 0x400000, 0x0d587bf3, 4 | BRF_GRA }, // 9 - { "b0102.u15", 0x400000, 0x43823c1e, 4 | BRF_GRA }, // 10 - - { "m0100.u1", 0x200000, 0xe5c36c83, 5 | BRF_SND }, // 11 Samples -}; - -STDROMPICKEXT(orlegend112c, orlegend112c, pgm) -STD_ROM_FN(orlegend112c) - -struct BurnDriver BurnDrvOrlegend112c = { - "orlegendc", "orlegend", "pgm", NULL, "1997", - "Oriental Legend - Xi Yo Gi Shi Re Zuang (V112, China)\0", NULL, "IGS", "PolyGameMaster", - L"Oriental Legend\0\u897F\u6E38\u91CA\u5384\u4F20 (V112, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, orlegend112cRomInfo, orlegend112cRomName, NULL, NULL, pgmInputInfo, orld112cDIPInfo, - orlegendInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend / Xi Yo Gi Shi Re Zuang (V112 alt,China) - -static struct BurnRomInfo orlegend112caRomDesc[] = { - { "p0101.102", 0x200000, 0x7a22e1cb, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0100.u8", 0x400000, 0x61425e1e, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.u5", 0x400000, 0x8b3bd88a, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0101.u6", 0x400000, 0x3b9e9644, 3 | BRF_GRA }, // 3 - { "a0102.u7", 0x400000, 0x069e2c38, 3 | BRF_GRA }, // 4 - { "a0103.u8", 0x400000, 0x4460a3fd, 3 | BRF_GRA }, // 5 - { "a0104.u11", 0x400000, 0x5f8abb56, 3 | BRF_GRA }, // 6 - { "a0105.u12", 0x400000, 0xa17a7147, 3 | BRF_GRA }, // 7 - - { "b0100.u9", 0x400000, 0x69d2e48c, 4 | BRF_GRA }, // 8 Sprite Masks & Color Indexes - { "b0101.u10", 0x400000, 0x0d587bf3, 4 | BRF_GRA }, // 9 - { "b0102.u15", 0x400000, 0x43823c1e, 4 | BRF_GRA }, // 10 - - { "m0100.u1", 0x200000, 0xe5c36c83, 5 | BRF_SND }, // 11 Samples -}; - -STDROMPICKEXT(orlegend112ca, orlegend112ca, pgm) -STD_ROM_FN(orlegend112ca) - -struct BurnDriver BurnDrvOrlegend112ca = { - "orlegendca", "orlegend", "pgm", NULL, "1997", - "Oriental Legend - Xi Yo Gi Shi Re Zuang (V112 alt, China)\0", NULL, "IGS", "PolyGameMaster", - L"Oriental Legend\0\u897F\u6E38\u91CA\u5384\u4F20 (V112 alt, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, orlegend112caRomInfo, orlegend112caRomName, NULL, NULL, pgmInputInfo, orld111cDIPInfo, - orlegendInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend / Xi Yo Gi Shi Re Zuang (V111, China) - -static struct BurnRomInfo orlegend111cRomDesc[] = { - { "olv111ch.u6", 0x080000, 0x5fb86373, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "olv111ch.u9", 0x080000, 0x83cf09c8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "olv111ch.u7", 0x080000, 0x6ee79faf, 1 | BRF_PRG | BRF_ESS }, // 2 - { "olv111ch.u11", 0x080000, 0xb80ddd3c, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "t0100.u8", 0x400000, 0x61425e1e, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.u5", 0x400000, 0x8b3bd88a, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0101.u6", 0x400000, 0x3b9e9644, 3 | BRF_GRA }, // 3 - { "a0102.u7", 0x400000, 0x069e2c38, 3 | BRF_GRA }, // 4 - { "a0103.u8", 0x400000, 0x4460a3fd, 3 | BRF_GRA }, // 5 - { "a0104.u11", 0x400000, 0x5f8abb56, 3 | BRF_GRA }, // 6 - { "a0105.u12", 0x400000, 0xa17a7147, 3 | BRF_GRA }, // 7 - - { "b0100.u9", 0x400000, 0x69d2e48c, 4 | BRF_GRA }, // 8 Sprite Masks & Color Indexes - { "b0101.u10", 0x400000, 0x0d587bf3, 4 | BRF_GRA }, // 9 - { "b0102.u15", 0x400000, 0x43823c1e, 4 | BRF_GRA }, // 10 - - { "m0100.u1", 0x200000, 0xe5c36c83, 5 | BRF_SND }, // 11 Samples -}; - -STDROMPICKEXT(orlegend111c, orlegend111c, pgm) -STD_ROM_FN(orlegend111c) - -struct BurnDriver BurnDrvOrlegend111c = { - "orlegend111c", "orlegend", "pgm", NULL, "1997", - "Oriental Legend - Xi Yo Gi Shi Re Zuang (V111, China)\0", NULL, "IGS", "PolyGameMaster", - L"Oriental Legend\0\u897F\u6E38\u91CA\u5384\u4F20 (V111, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, orlegend111cRomInfo, orlegend111cRomName, NULL, NULL, pgmInputInfo, orld111cDIPInfo, - orlegendInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend / Xi Yo Gi Shi Re Zuang (V111, Taiwan) - -static struct BurnRomInfo orlegend111tRomDesc[] = { - { "olv111tw.u6", 0x080000, 0xb205a733, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "olv111tw.u9", 0x080000, 0x6d9d29b4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "olv111tw.u7", 0x080000, 0x27628e87, 1 | BRF_PRG | BRF_ESS }, // 2 - { "olv111tw.u11", 0x080000, 0x23f33bc9, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "t0100.u8", 0x400000, 0x61425e1e, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.u5", 0x400000, 0x8b3bd88a, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0101.u6", 0x400000, 0x3b9e9644, 3 | BRF_GRA }, // 3 - { "a0102.u7", 0x400000, 0x069e2c38, 3 | BRF_GRA }, // 4 - { "a0103.u8", 0x400000, 0x4460a3fd, 3 | BRF_GRA }, // 5 - { "a0104.u11", 0x400000, 0x5f8abb56, 3 | BRF_GRA }, // 6 - { "a0105.u12", 0x400000, 0xa17a7147, 3 | BRF_GRA }, // 7 - - { "b0100.u9", 0x400000, 0x69d2e48c, 4 | BRF_GRA }, // 8 Sprite Masks & Color Indexes - { "b0101.u10", 0x400000, 0x0d587bf3, 4 | BRF_GRA }, // 9 - { "b0102.u15", 0x400000, 0x43823c1e, 4 | BRF_GRA }, // 10 - - { "m0100.u1", 0x200000, 0xe5c36c83, 5 | BRF_SND }, // 11 Samples -}; - -STDROMPICKEXT(orlegend111t, orlegend111t, pgm) -STD_ROM_FN(orlegend111t) - -struct BurnDriver BurnDrvOrlegend111t = { - "orlegend111t", "orlegend", "pgm", NULL, "1997", - "Oriental Legend - Xi Yo Gi Shi Re Zuang (V111, Taiwan)\0", NULL, "IGS", "PolyGameMaster", - L"Oriental Legend\0\u897F\u6E38\u91CA\u5384\u4F20 (V111, Taiwan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, orlegend111tRomInfo, orlegend111tRomName, NULL, NULL, pgmInputInfo, orld111tDIPInfo, - orlegendInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend / Xi Yo Gi Shi Re Zuang (V111, Korea) - -static struct BurnRomInfo orlegend111kRomDesc[] = { - { "olv111ko.u6", 0x080000, 0x1ff35baa, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "olv111ko.u9", 0x080000, 0x87b6d202, 1 | BRF_PRG | BRF_ESS }, // 1 - { "olv111ko.u7", 0x080000, 0x27628e87, 1 | BRF_PRG | BRF_ESS }, // 2 - { "olv111ko.u11", 0x080000, 0x23f33bc9, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "t0100.u8", 0x400000, 0x61425e1e, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.u5", 0x400000, 0x8b3bd88a, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0101.u6", 0x400000, 0x3b9e9644, 3 | BRF_GRA }, // 3 - { "a0102.u7", 0x400000, 0x069e2c38, 3 | BRF_GRA }, // 4 - { "a0103.u8", 0x400000, 0x4460a3fd, 3 | BRF_GRA }, // 5 - { "a0104.u11", 0x400000, 0x5f8abb56, 3 | BRF_GRA }, // 6 - { "a0105.u12", 0x400000, 0xa17a7147, 3 | BRF_GRA }, // 7 - - { "b0100.u9", 0x400000, 0x69d2e48c, 4 | BRF_GRA }, // 8 Sprite Masks & Color Indexes - { "b0101.u10", 0x400000, 0x0d587bf3, 4 | BRF_GRA }, // 9 - { "b0102.u15", 0x400000, 0x43823c1e, 4 | BRF_GRA }, // 10 - - { "m0100.u1", 0x200000, 0xe5c36c83, 5 | BRF_SND }, // 11 Samples -}; - -STDROMPICKEXT(orlegend111k, orlegend111k, pgm) -STD_ROM_FN(orlegend111k) - -struct BurnDriver BurnDrvOrlegend111k = { - "orlegend111k", "orlegend", "pgm", NULL, "1997", - "Oriental Legend - Xi Yo Gi Shi Re Zuang (V111, Korea)\0", NULL, "IGS", "PolyGameMaster", - L"Oriental Legend\0\u897F\u6E38\u91CA\u5384\u4F20 (V111, Korea)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, orlegend111kRomInfo, orlegend111kRomName, NULL, NULL, pgmInputInfo, orld105kDIPInfo, - orlegendInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend (V105, Korea) - -static struct BurnRomInfo orlegend105kRomDesc[] = { - { "olv105ko.u6", 0x080000, 0xb86703fe, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "olv105ko.u9", 0x080000, 0x5a108e39, 1 | BRF_PRG | BRF_ESS }, // 1 - { "olv105ko.u7", 0x080000, 0x5712facc, 1 | BRF_PRG | BRF_ESS }, // 2 - { "olv105ko.u11", 0x080000, 0x40ae4d9e, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "t0100.u8", 0x400000, 0x61425e1e, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.u5", 0x400000, 0x8b3bd88a, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0101.u6", 0x400000, 0x3b9e9644, 3 | BRF_GRA }, // 3 - { "a0102.u7", 0x400000, 0x069e2c38, 3 | BRF_GRA }, // 4 - { "a0103.u8", 0x400000, 0x4460a3fd, 3 | BRF_GRA }, // 5 - { "a0104.u11", 0x400000, 0x5f8abb56, 3 | BRF_GRA }, // 6 - { "a0105.u12", 0x400000, 0xa17a7147, 3 | BRF_GRA }, // 7 - - { "b0100.u9", 0x400000, 0x69d2e48c, 4 | BRF_GRA }, // 8 Sprite Masks & Color Indexes - { "b0101.u10", 0x400000, 0x0d587bf3, 4 | BRF_GRA }, // 9 - { "b0102.u15", 0x400000, 0x43823c1e, 4 | BRF_GRA }, // 10 - - { "m0100.u1", 0x200000, 0xe5c36c83, 5 | BRF_SND }, // 11 Samples -}; - -STDROMPICKEXT(orlegend105k, orlegend105k, pgm) -STD_ROM_FN(orlegend105k) - -struct BurnDriver BurnDrvOrlegend105k = { - "orlegend105k", "orlegend", "pgm", NULL, "1997", - "Oriental Legend (V105, Korea)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, orlegend105kRomInfo, orlegend105kRomName, NULL, NULL, pgmInputInfo, orld105kDIPInfo, - orlegendInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Dragon World II (V110X, World) - -static struct BurnRomInfo drgw2RomDesc[] = { - { "v-110x.u2", 0x080000, 0x1978106b, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "pgmt0200.u7", 0x400000, 0xb0f6534d, 2 | BRF_GRA }, // 1 Tile data - - { "pgma0200.u5", 0x400000, 0x13b95069, 3 | BRF_GRA }, // 2 Sprite Color Data - - { "pgmb0200.u9", 0x400000, 0x932d0f13, 4 | BRF_GRA }, // 3 Sprite Masks & Color Indexes -}; - -STDROMPICKEXT(drgw2, drgw2, pgm) -STD_ROM_FN(drgw2) - -static void drgw2_patch() -{ - pgm_decrypt_dw2(); - - UINT16 *mem16 = (UINT16*)PGM68KROM; - - // This is not a hack! The protection chip actually applies patches at three specific locations. - for (INT32 i = 0; i < 0x80000/2; i++) { - if (mem16[i] == 0x4e90 && mem16[i+1] == 0x207c && (mem16[i+2] & 0xfff8) == 0x0010) { - mem16[i] = 0x4e93; - } - } -} - -static INT32 drgw2Init() -{ - pPgmInitCallback = drgw2_patch; - pPgmProtCallback = install_protection_asic25_asic12_dw2; - - return pgmInit(); -} - -struct BurnDriver BurnDrvDrgw2 = { - "drgw2", NULL, "pgm", NULL, "1997", - "Dragon World II (V110X, World)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, drgw2RomInfo, drgw2RomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Zhong Guo Long II (V100C, China) - -static struct BurnRomInfo drgw2cRomDesc[] = { - { "v-100c.u2", 0x080000, 0x67467981, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "pgmt0200.u7", 0x400000, 0xb0f6534d, 2 | BRF_GRA }, // 1 Tile data - - { "pgma0200.u5", 0x400000, 0x13b95069, 3 | BRF_GRA }, // 2 Sprite Color Data - - { "pgmb0200.u9", 0x400000, 0x932d0f13, 4 | BRF_GRA }, // 3 Sprite Masks & Color Indexes -}; - -STDROMPICKEXT(drgw2c, drgw2c, pgm) -STD_ROM_FN(drgw2c) - -struct BurnDriver BurnDrvDrgw2c = { - "drgw2c", "drgw2", "pgm", NULL, "1997", - "Zhong Guo Long II (V100C, China)\0", NULL, "IGS", "PolyGameMaster", - L"\u4E2D\u570B\u9F8D II (V100C, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, drgw2cRomInfo, drgw2cRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Chuugokuryuu II (V100J, Japan) - -static struct BurnRomInfo drgw2jRomDesc[] = { - { "v-100j.u2", 0x080000, 0xf8f8393e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "pgmt0200.u7", 0x400000, 0xb0f6534d, 2 | BRF_GRA }, // 1 Tile data - - { "pgma0200.u5", 0x400000, 0x13b95069, 3 | BRF_GRA }, // 2 Sprite Color Data - - { "pgmb0200.u9", 0x400000, 0x932d0f13, 4 | BRF_GRA }, // 3 Sprite Masks & Color Indexes -}; - -STDROMPICKEXT(drgw2j, drgw2j, pgm) -STD_ROM_FN(drgw2j) - -struct BurnDriver BurnDrvDrgw2j = { - "drgw2j", "drgw2", "pgm", NULL, "1997", - "Chuugokuryuu II (V100J, Japan)\0", NULL, "IGS", "PolyGameMaster", - L"\u4E2D\u570B\u9F8D II (V100J, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, drgw2jRomInfo, drgw2jRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Dragon World II (V100X, World) - -static struct BurnRomInfo drgw2xRomDesc[] = { - { "dragonv100x.bin", 0x080000, 0x5e71851d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "pgmt0200.u7", 0x400000, 0xb0f6534d, 2 | BRF_GRA }, // 1 Tile data - - { "pgma0200.u5", 0x400000, 0x13b95069, 3 | BRF_GRA }, // 2 Sprite Color Data - - { "pgmb0200.u9", 0x400000, 0x932d0f13, 4 | BRF_GRA }, // 3 Sprite Masks & Color Indexes -}; - -STDROMPICKEXT(drgw2x, drgw2x, pgm) -STD_ROM_FN(drgw2x) - -struct BurnDriver BurnDrvDrgw2x = { - "dw2v100x", "drgw2", "pgm", NULL, "1997", - "Dragon World II (V100X, World)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, drgw2xRomInfo, drgw2xRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Dragon World II (V100H, Hong Kong) - -static struct BurnRomInfo drgw2hkRomDesc[] = { - { "dragon_ii_v-100-h.u2", 0x080000, 0xc6e2e6ec, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "pgmt0200.u7", 0x400000, 0xb0f6534d, 2 | BRF_GRA }, // 1 Tile data - - { "pgma0200.u5", 0x400000, 0x13b95069, 3 | BRF_GRA }, // 2 Sprite Color Data - - { "pgmb0200.u9", 0x400000, 0x932d0f13, 4 | BRF_GRA }, // 3 Sprite Masks & Color Indexes -}; - -STDROMPICKEXT(drgw2hk, drgw2hk, pgm) -STD_ROM_FN(drgw2hk) - -struct BurnDriver BurnDrvDrgw2hk = { - "drgw2hk", "drgw2", "pgm", NULL, "1997", - "Dragon World II (V100H, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, drgw2hkRomInfo, drgw2hkRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// The Killing Blade (V109, China) - -static struct BurnRomInfo killbldRomDesc[] = { - { "p0300_v109.u9", 0x200000, 0x2fcee215, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0300.u14", 0x400000, 0x0922f7d9, 2 | BRF_GRA }, // 1 Tile data - - { "a0300.u9", 0x400000, 0x3f9455d3, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0301.u10", 0x400000, 0x92776889, 3 | BRF_GRA }, // 3 - { "a0303.u11", 0x400000, 0x33f5cc69, 3 | BRF_GRA }, // 4 - { "a0306.u12", 0x400000, 0xcc018a8e, 3 | BRF_GRA }, // 5 - { "a0307.u2", 0x400000, 0xbc772e39, 3 | BRF_GRA }, // 6 - - { "b0300.u13", 0x400000, 0x7f876981, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b0302.u14", 0x400000, 0xeea9c502, 4 | BRF_GRA }, // 8 - { "b0303.u15", 0x200000, 0x77a9652e, 4 | BRF_GRA }, // 9 - - { "m0300.u1", 0x400000, 0x93159695, 5 | BRF_SND }, // 10 Samples - - { "kb_u2.rom", 0x010000, 0xde3eae63, 9 | BRF_PRG | BRF_ESS }, // 11 Protection Data -}; - -STDROMPICKEXT(killbld, killbld, pgm) -STD_ROM_FN(killbld) - -static INT32 killbldInit() -{ - pPgmInitCallback = pgm_decrypt_killbld; - pPgmProtCallback = install_protection_asic25_asic22_killbld; - - return pgmInit(); -} - -struct BurnDriver BurnDrvKillbld = { - "killbld", NULL, "pgm", NULL, "1998", - "The Killing Blade (V109, China)\0", NULL, "IGS", "PolyGameMaster", - L"The Killing Blade\0\u50B2\u5251\u72C2\u5200 (V109, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM, GBF_VSFIGHT, 0, - NULL, killbldRomInfo, killbldRomName, NULL, NULL, pgmInputInfo, killbldDIPInfo, - killbldInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// The Killing Blade (V104) - -static struct BurnRomInfo killbld104RomDesc[] = { - { "kb_u3_v104.u3", 0x080000, 0x6db1d719, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "kb_u6_v104.u6", 0x080000, 0x31ecc978, 1 | BRF_PRG | BRF_ESS }, // 1 - { "kb_u4_v104.u4", 0x080000, 0x1ed8b2e7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "kb_u5_v104.u5", 0x080000, 0xa0bafc29, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "t0300.u14", 0x400000, 0x0922f7d9, 2 | BRF_GRA }, // 4 Tile data - - { "a0300.u9", 0x400000, 0x3f9455d3, 3 | BRF_GRA }, // 5 Sprite Color Data - { "a0301.u10", 0x400000, 0x92776889, 3 | BRF_GRA }, // 6 - { "a0303.u11", 0x400000, 0x33f5cc69, 3 | BRF_GRA }, // 7 - { "a0306.u12", 0x400000, 0xcc018a8e, 3 | BRF_GRA }, // 8 - { "a0307.u2", 0x400000, 0xbc772e39, 3 | BRF_GRA }, // 9 - - { "b0300.u13", 0x400000, 0x7f876981, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "b0302.u14", 0x400000, 0xeea9c502, 4 | BRF_GRA }, // 11 - { "b0303.u15", 0x200000, 0x77a9652e, 4 | BRF_GRA }, // 12 - - { "m0300.u1", 0x400000, 0x93159695, 5 | BRF_SND }, // 13 Samples - - { "kb_u2_v104.u2", 0x010000, 0xc970f6d5, 9 | BRF_PRG | BRF_ESS }, // 14 Protection Data -}; - -STDROMPICKEXT(killbld104, killbld104, pgm) -STD_ROM_FN(killbld104) - -struct BurnDriver BurnDrvKillbld104 = { - "killbld104", "killbld", "pgm", NULL, "1998", - "The Killing Blade (V104)\0", NULL, "IGS", "PolyGameMaster", - L"The Killing Blade\0\u50B2\u5251\u72C2\u5200 (V104)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_VSFIGHT, 0, - NULL, killbld104RomInfo, killbld104RomName, NULL, NULL, pgmInputInfo, killbld104DIPInfo, - killbldInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Dragon World 3 (V106, Korea) - -static struct BurnRomInfo drgw3RomDesc[] = { - { "dw3_v106.u12", 0x080000, 0xc3f6838b, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "dw3_v106.u13", 0x080000, 0x28284e22, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "dw3t0400.u18", 0x400000, 0xb70f3357, 2 | BRF_GRA }, // 2 Tile data - - { "dw3a0400.u9", 0x400000, 0xdd7bfd40, 3 | BRF_GRA }, // 3 Sprite Color Data - { "dw3a0401.u10", 0x400000, 0xcab6557f, 3 | BRF_GRA }, // 4 - - { "dw3b0400.u13", 0x400000, 0x4bb87cc0, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "dw3m0400.u1", 0x400000, 0x031eb9ce, 5 | BRF_SND }, // 6 Samples - - { "dw3_v100.u15", 0x010000, 0x03dc4fdf, 9 | BRF_PRG | BRF_ESS }, // 7 Protection data -}; - -STDROMPICKEXT(drgw3, drgw3, pgm) -STD_ROM_FN(drgw3) - -static INT32 drgw3Init() -{ - pPgmInitCallback = pgm_decrypt_dw3; - pPgmProtCallback = install_protection_asic25_asic22_drgw3; - - return pgmInit(); -} - -struct BurnDriverD BurnDrvDrgw3 = { - "drgw3", NULL, "pgm", NULL, "1998", - "Dragon World 3 (V106, Korea)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - 0, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, drgw3RomInfo, drgw3RomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw3Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Dragon World 3 (ver. 105) - -static struct BurnRomInfo drgw3105RomDesc[] = { - { "dw3_v105.u12", 0x080000, 0xc5e24318, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "dw3_v105.u13", 0x080000, 0x8d6c9d39, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "dw3t0400.u18", 0x400000, 0xb70f3357, 2 | BRF_GRA }, // 2 Tile data - - { "dw3a0400.u9", 0x400000, 0xdd7bfd40, 3 | BRF_GRA }, // 3 Sprite Color Data - { "dw3a0401.u10", 0x400000, 0xcab6557f, 3 | BRF_GRA }, // 4 - - { "dw3b0400.u13", 0x400000, 0x4bb87cc0, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "dw3m0400.u1", 0x400000, 0x031eb9ce, 5 | BRF_SND }, // 6 Samples - - { "dw3_v100.u15", 0x010000, 0x03dc4fdf, 9 | BRF_PRG | BRF_ESS }, // 7 Protection data -}; - -STDROMPICKEXT(drgw3105, drgw3105, pgm) -STD_ROM_FN(drgw3105) - -struct BurnDriverD BurnDrvDrgw3105 = { - "drgw3105", "drgw3", "pgm", NULL, "1998", - "Dragon World 3 (ver. 105)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, drgw3105RomInfo, drgw3105RomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw3Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Chuugokuryuu 3 Special (ver. 103, Japan) -// Japan only, has an extra game mode option! - -static struct BurnRomInfo drgw3103RomDesc[] = { - { "dw3_v103j.u12", 0x080000, 0x275b39a2, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "dw3_v103j.u13", 0x080000, 0x9aa56e8f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "dw3t0400.u18", 0x400000, 0xb70f3357, 2 | BRF_GRA }, // 2 Tile data - - { "dw3a0400.u9", 0x400000, 0xdd7bfd40, 3 | BRF_GRA }, // 3 Sprite Color Data - { "dw3a0401.u10", 0x400000, 0xcab6557f, 3 | BRF_GRA }, // 4 - - { "dw3b0400.u13", 0x400000, 0x4bb87cc0, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "dw3m0400.u1", 0x400000, 0x031eb9ce, 5 | BRF_SND }, // 6 Samples - - { "dw3_v100.u15", 0x010000, 0x03dc4fdf, 9 | BRF_PRG | BRF_ESS }, // 7 Protection data -}; - -STDROMPICKEXT(drgw3103, drgw3103, pgm) -STD_ROM_FN(drgw3103) - -struct BurnDriverD BurnDrvDrgw3103 = { - "drgw3103", "drgw3", "pgm", NULL, "1998", - "Chuugokuryuu 3 Special (ver. 103, japan)\0", NULL, "IGS (Alta Co., LTD License)", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, drgw3103RomInfo, drgw3103RomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw3Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Chuugokuryuu 3 Special (ver. 100, Japan) -// Japan only, has an extra game mode option! - -static struct BurnRomInfo drgw3100RomDesc[] = { - { "dw3_v100.u12", 0x080000, 0x47243906, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "dw3_v100.u13", 0x080000, 0xb7cded21, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "dw3t0400.u18", 0x400000, 0xb70f3357, 2 | BRF_GRA }, // 2 Tile data - - { "dw3a0400.u9", 0x400000, 0xdd7bfd40, 3 | BRF_GRA }, // 3 Sprite Color Data - { "dw3a0401.u10", 0x400000, 0xcab6557f, 3 | BRF_GRA }, // 4 - - { "dw3b0400.u13", 0x400000, 0x4bb87cc0, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "dw3m0400.u1", 0x400000, 0x031eb9ce, 5 | BRF_SND }, // 6 Samples - - { "dw3_v100.u15", 0x010000, 0x03dc4fdf, 9 | BRF_PRG | BRF_ESS }, // 7 Protection data -}; - -STDROMPICKEXT(drgw3100, drgw3100, pgm) -STD_ROM_FN(drgw3100) - -struct BurnDriverD BurnDrvDrgw3100 = { - "drgw3100", "drgw3", "pgm", NULL, "1998", - "Chuugokuryuu 3 Special (ver. 100, Japan)\0", NULL, "IGS (Alta Co., LTD License)", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, drgw3100RomInfo, drgw3100RomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw3Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Dragon World 3 EX (ver. 100) - -static struct BurnRomInfo dwexRomDesc[] = { - { "ex_v100.u12", 0x080000, 0xbc171799, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "ex_v100.u13", 0x080000, 0x7afe6322, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ex_t0400.u18", 0x200000, 0x9ecc950d, 2 | BRF_GRA }, // 2 Tile data - - { "ex_a0400.u9", 0x400000, 0xdd7bfd40, 3 | BRF_GRA }, // 3 Sprite Color Data - { "ex_a0401.u10", 0x200000, 0xd36c06a4, 3 | BRF_GRA }, // 4 - - { "ex_b0400.u13", 0x400000, 0x4bb87cc0, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "ex_m0400.u1", 0x200000, 0x42d54fd5, 5 | BRF_SND }, // 6 Samples - - { "ex_data.u15", 0x010000, 0x03dc4fdf, 9 | BRF_PRG | BRF_ESS }, // 7 Protection data -}; - -STDROMPICKEXT(dwex, dwex, pgm) -STD_ROM_FN(dwex) - -struct BurnDriverD BurnDrvDwex = { - "dwex", NULL, "pgm", NULL, "1998", - "Dragon World 3 EX (ver. 100)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - 0, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, dwexRomInfo, dwexRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - drgw3Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend Super (V101, Korea) - -static struct BurnRomInfo oldsRomDesc[] = { - { "sp_v101.u2", 0x080000, 0x08eb9661, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "sp_v101.u3", 0x080000, 0x0a358c1e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sp_v101.u4", 0x080000, 0x766570e0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sp_v101.u5", 0x080000, 0x58662e12, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sp_v101.u1", 0x080000, 0x2b2f4f1e, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "t0500.rom", 0x400000, 0xd881726c, 2 | BRF_GRA }, // 5 Tile data - { "t0501.rom", 0x200000, 0xd2106864, 2 | BRF_GRA }, // 6 - - { "a0500.rom", 0x400000, 0x80a59197, 3 | BRF_GRA }, // 7 Sprite Color Data - { "a0501.rom", 0x400000, 0x98c931b1, 3 | BRF_GRA }, // 8 - { "a0502.rom", 0x400000, 0xc3fcdf1d, 3 | BRF_GRA }, // 9 - { "a0503.rom", 0x400000, 0x066dffec, 3 | BRF_GRA }, // 10 - { "a0504.rom", 0x400000, 0x45337583, 3 | BRF_GRA }, // 11 - { "a0505.rom", 0x400000, 0x5b8cf3a5, 3 | BRF_GRA }, // 12 - { "a0506.rom", 0x400000, 0x087ac60c, 3 | BRF_GRA }, // 13 - - { "b0500.rom", 0x400000, 0xcde07f74, 4 | BRF_GRA }, // 14 Sprite Masks & Color Indexes - { "b0501.rom", 0x400000, 0x1546c2e9, 4 | BRF_GRA }, // 15 - { "b0502.rom", 0x400000, 0xe97b31c3, 4 | BRF_GRA }, // 16 - { "b0503.u16", 0x400000, 0xe41d98e4, 4 | BRF_GRA }, // 17 - - { "m0500.rom", 0x200000, 0x37928cdd, 5 | BRF_SND }, // 18 Samples - - { "sp_v101.u6", 0x010000, 0x097046bc, 9 | BRF_PRG | BRF_ESS }, // 19 Protection Rom - -#if defined (ROM_VERIFY) - { "ram_dump", 0x040000, 0x280cfb4e, 0 | BRF_OPT }, -#endif -}; - -STDROMPICKEXT(olds, olds, pgm) -STD_ROM_FN(olds) - -static INT32 oldsInit() -{ - pPgmProtCallback = install_protection_asic25_asic28_olds; - - return pgmInit(); -} - -struct BurnDriver BurnDrvOlds = { - "olds", NULL, "pgm", NULL, "1999", - "Oriental Legend Super (V101, Korea)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, oldsRomInfo, oldsRomName, NULL, NULL, pgmInputInfo, oldsDIPInfo, - oldsInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend Special / Xi Yo Gi Shi Re Zuang Super (V100) - -static struct BurnRomInfo olds100RomDesc[] = { - { "v100-u2.040", 0x080000, 0x517c2a06, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "v100-u3.040", 0x080000, 0xd0e2b741, 1 | BRF_PRG | BRF_ESS }, // 1 - { "v100-u4.040", 0x080000, 0x32a6bdbd, 1 | BRF_PRG | BRF_ESS }, // 2 - { "v100-u5.040", 0x080000, 0xb4a1cafb, 1 | BRF_PRG | BRF_ESS }, // 3 - { "v100-u1.040", 0x080000, 0x37ea4e75, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "t0500.rom", 0x400000, 0xd881726c, 2 | BRF_GRA }, // 5 Tile data - { "t0501.rom", 0x200000, 0xd2106864, 2 | BRF_GRA }, // 6 - - { "a0500.rom", 0x400000, 0x80a59197, 3 | BRF_GRA }, // 7 Sprite Color Data - { "a0501.rom", 0x400000, 0x98c931b1, 3 | BRF_GRA }, // 8 - { "a0502.rom", 0x400000, 0xc3fcdf1d, 3 | BRF_GRA }, // 9 - { "a0503.rom", 0x400000, 0x066dffec, 3 | BRF_GRA }, // 10 - { "a0504.rom", 0x400000, 0x45337583, 3 | BRF_GRA }, // 11 - { "a0505.rom", 0x400000, 0x5b8cf3a5, 3 | BRF_GRA }, // 12 - { "a0506.rom", 0x400000, 0x087ac60c, 3 | BRF_GRA }, // 13 - - { "b0500.rom", 0x400000, 0xcde07f74, 4 | BRF_GRA }, // 14 Sprite Masks & Color Indexes - { "b0501.rom", 0x400000, 0x1546c2e9, 4 | BRF_GRA }, // 15 - { "b0502.rom", 0x400000, 0xe97b31c3, 4 | BRF_GRA }, // 16 - { "b0503.u16", 0x400000, 0xe41d98e4, 4 | BRF_GRA }, // 17 - - { "m0500.rom", 0x200000, 0x37928cdd, 5 | BRF_SND }, // 18 Samples - - { "kd-u6.512", 0x010000, 0xe7613dda, 9 | BRF_PRG | BRF_ESS }, // 19 Protection Rom - -#if defined (ROM_VERIFY) - { "ram_dump", 0x040000, 0x280cfb4e, 0 | BRF_OPT }, -#endif -}; - -STDROMPICKEXT(olds100, olds100, pgm) -STD_ROM_FN(olds100) - -struct BurnDriver BurnDrvOlds100 = { - "olds100", "olds", "pgm", NULL, "1998", - "Oriental Legend Special - Xi Yo Gi Shi Re Zuang Super (V100)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster", - L"Oriental Legend Super\0\u897F\u6E38\u91CA\u5384\u4F20 Super (V100)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, olds100RomInfo, olds100RomName, NULL, NULL, pgmInputInfo, olds100DIPInfo, - oldsInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend Special / Xi Yo Gi Shi Re Zuang Super (V100 alt) - -static struct BurnRomInfo olds100aRomDesc[] = { - { "p0500.v10", 0x400000, 0x8981fc87, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0500.rom", 0x400000, 0xd881726c, 2 | BRF_GRA }, // 1 Tile data - { "t0501.rom", 0x200000, 0xd2106864, 2 | BRF_GRA }, // 2 - - { "a0500.rom", 0x400000, 0x80a59197, 3 | BRF_GRA }, // 3 Sprite Color Data - { "a0501.rom", 0x400000, 0x98c931b1, 3 | BRF_GRA }, // 4 - { "a0502.rom", 0x400000, 0xc3fcdf1d, 3 | BRF_GRA }, // 5 - { "a0503.rom", 0x400000, 0x066dffec, 3 | BRF_GRA }, // 6 - { "a0504.rom", 0x400000, 0x45337583, 3 | BRF_GRA }, // 7 - { "a0505.rom", 0x400000, 0x5b8cf3a5, 3 | BRF_GRA }, // 8 - { "a0506.rom", 0x400000, 0x087ac60c, 3 | BRF_GRA }, // 9 - - { "b0500.rom", 0x400000, 0xcde07f74, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "b0501.rom", 0x400000, 0x1546c2e9, 4 | BRF_GRA }, // 11 - { "b0502.rom", 0x400000, 0xe97b31c3, 4 | BRF_GRA }, // 12 - { "b0503.u16", 0x400000, 0xe41d98e4, 4 | BRF_GRA }, // 13 - - { "m0500.rom", 0x200000, 0x37928cdd, 5 | BRF_SND }, // 14 Samples - -#if !defined (ROM_VERIFY) - { "kd-u6.512", 0x010000, 0xe7613dda, 9 | BRF_PRG | BRF_ESS }, // 15 Protection Rom -#else - { "ram_dump", 0x040000, 0x280cfb4e, 0 | BRF_OPT }, -#endif -}; - -STDROMPICKEXT(olds100a, olds100a, pgm) -STD_ROM_FN(olds100a) - -struct BurnDriver BurnDrvOlds100a = { - "olds100a", "olds", "pgm", NULL, "1998", - "Oriental Legend Special - Xi Yo Gi Shi Re Zuang Super (V100 alt)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster", - L"Oriental Legend Super\0\u897F\u6E38\u91CA\u5384\u4F20 Super (V100 alt)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, olds100aRomInfo, olds100aRomName, NULL, NULL, pgmInputInfo, olds100DIPInfo, - oldsInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend Special / Xi Yo Gi Shi Re Zuang Super (V103, China, Tencent) (unprotected) - -static struct BurnRomInfo olds103tRomDesc[] = { - { "p0500.v103", 0x400000, 0x17e32e14, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0500.rom", 0x400000, 0xd881726c, 2 | BRF_GRA }, // 1 Tile data - { "t0501.rom", 0x200000, 0xd2106864, 2 | BRF_GRA }, // 2 - - { "a0500.rom", 0x400000, 0x80a59197, 3 | BRF_GRA }, // 3 Sprite Color Data - { "a0501.rom", 0x400000, 0x98c931b1, 3 | BRF_GRA }, // 4 - { "a0502.rom", 0x400000, 0xc3fcdf1d, 3 | BRF_GRA }, // 5 - { "a0503.rom", 0x400000, 0x066dffec, 3 | BRF_GRA }, // 6 - { "a0504.rom", 0x400000, 0x45337583, 3 | BRF_GRA }, // 7 - { "a0505.rom", 0x400000, 0x5b8cf3a5, 3 | BRF_GRA }, // 8 - { "a0506.rom", 0x400000, 0x087ac60c, 3 | BRF_GRA }, // 9 - - { "b0500.rom", 0x400000, 0xcde07f74, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "b0501.rom", 0x400000, 0x1546c2e9, 4 | BRF_GRA }, // 11 - { "b0502.rom", 0x400000, 0xe97b31c3, 4 | BRF_GRA }, // 12 - { "b0503.u16", 0x400000, 0xe41d98e4, 4 | BRF_GRA }, // 13 - - { "m0500.rom", 0x200000, 0x37928cdd, 5 | BRF_SND }, // 14 Samples -}; - -STDROMPICKEXT(olds103t, olds103t, pgm) -STD_ROM_FN(olds103t) - -struct BurnDriver BurnDrvOlds103t = { - "olds103t", "olds", "pgm", NULL, "2003", - "Oriental Legend Special - Xi Yo Gi Shi Re Zuang Super (V103, China, Tencent) (unprotected)\0", NULL, "IGS", "PolyGameMaster", - L"Oriental Legend Super\0\u897F\u6E38\u91CA\u5384\u4F20 Super (V103, China, Tencent) (unprotected)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM, GBF_SCRFIGHT, 0, - NULL, olds103tRomInfo, olds103tRomName, NULL, NULL, pgmInputInfo, olds103tDIPInfo, - pgmInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour / Sangoku Senki (V117) - -static struct BurnRomInfo kovRomDesc[] = { - { "p0600.117", 0x400000, 0xc4d19fe6, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 7 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 8 Samples - - { "kov_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(kov, kov, pgm) -STD_ROM_FN(kov) - -static INT32 kovInit() -{ - pPgmInitCallback = pgm_decrypt_kov; - pPgmProtCallback = install_protection_asic27_kov; // simulation - - return pgmInit(); -} - -struct BurnDriver BurnDrvKov = { - "kov", NULL, "pgm", NULL, "1999", - "Knights of Valour - Sangoku Senki (V117)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour\0\u4E09\u56FD\u6226\u7D00\0\u4E09\u56FD\u6218\u7EAA (V117)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kovRomInfo, kovRomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour / Sangoku Senki (V115) - -static struct BurnRomInfo kov115RomDesc[] = { - { "p0600.115", 0x400000, 0x527a2924, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 7 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 8 Samples - - { "kov_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(kov115, kov115, pgm) -STD_ROM_FN(kov115) - -struct BurnDriver BurnDrvKov115 = { - "kov115", "kov", "pgm", NULL, "1999", - "Knights of Valour - Sangoku Senki (V115)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour\0\u4E09\u56FD\u6226\u7D00\0\u4E09\u56FD\u6218\u7EAA (V115)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kov115RomInfo, kov115RomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Plus / Sangoku Senki (V114, Hong Kong) - -static struct BurnRomInfo kov114RomDesc[] = { - { "sav114.u4", 0x080000, 0x4db3d4d3, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "sav114.u7", 0x080000, 0xb8d12b0c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sav114.u5", 0x080000, 0x9e586dab, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sav114.u8", 0x080000, 0xab129997, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sav114.u10", 0x080000, 0x8f84ecfd, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 5 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 6 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 7 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 8 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 9 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 11 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 12 Samples - - // IGS 027 55857E 100 9901 HONG KONG - { "kov_igs027.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 13 Internal ARM7 Rom -}; - -STDROMPICKEXT(kov114, kov114, pgm) -STD_ROM_FN(kov114) - -struct BurnDriver BurnDrvKov114 = { - "kov114", "kov", "pgm", NULL, "1999", - "Knights of Valour - Sangoku Senki (V114, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour\0\u4E09\u56FD\u6226\u7D00\0\u4E09\u56FD\u6218\u7EAA (V114, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kov114RomInfo, kov114RomName, NULL, NULL, pgmInputInfo, kov114DIPInfo, - kovInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Plus / Sangoku Senki (V111, Japan) - -static struct BurnRomInfo kov111RomDesc[] = { - { "sav111.u4", 0x080000, 0xae2f1b4e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "sav111.u7", 0x080000, 0x95eedf0e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sav111.u5", 0x080000, 0x5fdd4aa8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sav111.u8", 0x080000, 0x003cbf49, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sav111.u10", 0x080000, 0xd5536107, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 5 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 6 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 7 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 8 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 9 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 11 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 12 Samples - - { "kov_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 13 Internal ARM7 Rom -}; - -STDROMPICKEXT(kov111, kov111, pgm) -STD_ROM_FN(kov111) - -struct BurnDriver BurnDrvKov111 = { - "kov111", "kov", "pgm", NULL, "1999", - "Knights of Valour - Sangoku Senki (V111, Japan)\0", NULL, "IGS (Alta Co., LTD License)", "PolyGameMaster", - L"Knights of Valour\0\u4E09\u56FD\u6226\u7D00\0\u4E09\u56FD\u6218\u7EAA (V111, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kov111RomInfo, kov111RomName, NULL, NULL, pgmInputInfo, kov111DIPInfo, - kovInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Plus / Sangoku Senki Plus (V119) - -static struct BurnRomInfo kovplusRomDesc[] = { - { "p0600.119", 0x400000, 0xe4b0875d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 7 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 8 Samples - - { "kov_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovplus, kovplus, pgm) -STD_ROM_FN(kovplus) - -struct BurnDriver BurnDrvKovplus = { - "kovplus", NULL, "pgm", NULL, "1999", - "Knights of Valour Plus - Sangoku Senki Plus (V119)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour Plus\0\u4E09\u56FD\u6226\u7D00 Plus\0\u4E09\u56FD\u6218\u7EAA Plus (V119)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kovplusRomInfo, kovplusRomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Plus / Sangoku Senki Plus (V119 alt) - -static struct BurnRomInfo kovplusaRomDesc[] = { - { "v119.u3", 0x080000, 0x6750388f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "v119.u5", 0x080000, 0xd4101ffd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "v119.u4", 0x080000, 0x8200ece6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "v119.u6", 0x080000, 0x71e28f27, 1 | BRF_PRG | BRF_ESS }, // 3 - { "v119.u2", 0x080000, 0x29588ef2, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 5 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 6 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 7 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 8 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 9 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 11 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 12 Samples - - { "kov_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 13 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovplusa, kovplusa, pgm) -STD_ROM_FN(kovplusa) - -struct BurnDriver BurnDrvKovplusa = { - "kovplusa", "kovplus", "pgm", NULL, "1999", - "Knights of Valour Plus - Sangoku Senki Plus (V119 alt)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour Plus\0\u4E09\u56FD\u6226\u7D00 Plus\0\u4E09\u56FD\u6218\u7EAA Plus (V119 alt)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kovplusaRomInfo, kovplusaRomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Superheroes / Sangoku Senki Superheroes (V104, China) - -static struct BurnRomInfo kovshRomDesc[] = { - { "p0600.322", 0x400000, 0x7c78e5f3, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code -// This is the same as above, but with the last 1mb 0-filled. -// { "p0600.322", 0x400000, 0x4e2ba39b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 5 - { "a0604.rom", 0x400000, 0x26b59fd3, 3 | BRF_GRA }, // 6 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 8 - { "b0602.rom", 0x100000, 0x9df77934, 4 | BRF_GRA }, // 9 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 10 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovsh, kovsh, pgm) -STD_ROM_FN(kovsh) - -static INT32 kovshInit() -{ - pPgmInitCallback = pgm_decrypt_kovsh; - pPgmProtCallback = install_protection_asic27a_kovsh; - - nPgmAsicRegionHackAddress = 0x3f0d; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x00000260); - - return nRet; -} - -struct BurnDriver BurnDrvKovsh = { - "kovsh", NULL, "pgm", NULL, "1999", - "Knights of Valour Superheroes / Sangoku Senki Superheroes (V104, China)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour Superheroes\0\u4E09\u56FD\u6218\u7EAA\0\u98CE\u4E91\u518D\u8D77 (V104, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovshRomInfo, kovshRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovshInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Superheroes / Sangoku Senki Superheroes (V103) - -static struct BurnRomInfo kovsh103RomDesc[] = { - { "p0600.103", 0x400000, 0xf0b3da82, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 5 - { "a0604.rom", 0x400000, 0x26b59fd3, 3 | BRF_GRA }, // 6 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 8 - { "b0602.rom", 0x100000, 0x9df77934, 4 | BRF_GRA }, // 9 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 10 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovsh103, kovsh103, pgm) -STD_ROM_FN(kovsh103) - -struct BurnDriver BurnDrvKovsh103 = { - "kovsh103", "kovsh", "pgm", NULL, "1999", - "Knights of Valour Superheroes / Sangoku Senki Superheroes (V103)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovsh103RomInfo, kovsh103RomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovshInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Superheroes / Sangoku Senki Superheroes (V102) - -static struct BurnRomInfo kovsh102RomDesc[] = { - { "p0600.102", 0x400000, 0xfdd4fb0f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 5 - { "a0604.rom", 0x400000, 0x26b59fd3, 3 | BRF_GRA }, // 6 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 8 - { "b0602.rom", 0x100000, 0x9df77934, 4 | BRF_GRA }, // 9 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 10 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovsh102, kovsh102, pgm) -STD_ROM_FN(kovsh102) - -struct BurnDriver BurnDrvKovsh102 = { - "kovsh102", "kovsh", "pgm", NULL, "1999", - "Knights of Valour Superheroes / Sangoku Senki Superheroes (V102)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovsh102RomInfo, kovsh102RomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovshInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Superheroes / Sangoku Senki Superheroes (V101) - -static struct BurnRomInfo kovsh101RomDesc[] = { - { "p0600.101", 0x400000, 0x517a9bcf, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 5 - { "a0604.rom", 0x400000, 0x26b59fd3, 3 | BRF_GRA }, // 6 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 8 - { "b0602.rom", 0x100000, 0x9df77934, 4 | BRF_GRA }, // 9 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 10 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovsh101, kovsh101, pgm) -STD_ROM_FN(kovsh101) - -struct BurnDriver BurnDrvKovsh101 = { - "kovsh101", "kovsh", "pgm", NULL, "1999", - "Knights of Valour Superheroes / Sangoku Senki Superheroes (V101)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovsh101RomInfo, kovsh101RomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovshInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Superheroes / Sangoku Senki Superheroes (V100) - -static struct BurnRomInfo kovsh100RomDesc[] = { - { "kovsh-v0100-u1.bin", 0x400000, 0xd145c1ca, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 5 - { "a0604.rom", 0x400000, 0x26b59fd3, 3 | BRF_GRA }, // 6 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 8 - { "b0602.rom", 0x100000, 0x9df77934, 4 | BRF_GRA }, // 9 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 10 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovsh100, kovsh100, pgm) -STD_ROM_FN(kovsh100) - -struct BurnDriver BurnDrvKovsh100 = { - "kovsh100", "kovsh", "pgm", NULL, "1999", - "Knights of Valour Superheroes / Sangoku Senki Superheroes (V100)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovsh100RomInfo, kovsh100RomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovshInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Photo Y2K (ver. 105) - -static struct BurnRomInfo photoy2kRomDesc[] = { - { "p0701_v105.u2", 0x200000, 0xfab142e0, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0700.rom", 0x080000, 0x93943b4d, 2 | BRF_GRA }, // 1 Tile data - - { "a0700.l", 0x400000, 0x26a9ae9c, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0700.h", 0x400000, 0x79bc1fc1, 3 | BRF_GRA }, // 3 - { "a0701.l", 0x400000, 0x23607f81, 3 | BRF_GRA }, // 4 - { "a0701.h", 0x400000, 0x5f2efd37, 3 | BRF_GRA }, // 5 - { "a0702.rom", 0x080000, 0x42239e1b, 3 | BRF_GRA }, // 6 - - { "b0700.l", 0x400000, 0xaf096904, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b0700.h", 0x400000, 0x6d53de26, 4 | BRF_GRA }, // 8 - { "cgv101.rom", 0x020000, 0xda02ec3e, 4 | BRF_GRA }, // 9 - - { "m0700.rom", 0x080000, 0xacc7afce, 5 | BRF_SND }, // 10 Samples - - { "igs027a_photoy2k_v100_china.asic", 0x004000, 0x1a0b68f6, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom -}; - -STDROMPICKEXT(photoy2k, photoy2k, pgm) -STD_ROM_FN(photoy2k) - -static INT32 photoy2kInit() -{ - pPgmInitCallback = pgm_decrypt_photoy2k; - pPgmProtCallback = install_protection_asic27a_kovsh; - - nPgmAsicRegionHackAddress = 0x17b1; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x000001f4); - - return nRet; -} - -struct BurnDriver BurnDrvPhotoy2k = { - "photoy2k", NULL, "pgm", NULL, "1999", - "Photo Y2K / Real and Fake (V105)\0", NULL, "IGS", "PolyGameMaster", - L"Photo Y2K\0\u30EA\u30A2\u30EB\u30A2\u30F3\u30C9 \u30D5\u30A7\u30A4\u30AF\0\u5927\u5BB6\u6765 \u627E\u78B4\0\u8D85\u7EA7 \u6BD4\u4E00\u6BD4 (V105)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_PUZZLE, 0, - NULL, photoy2kRomInfo, photoy2kRomName, NULL, NULL, pgmInputInfo, photoy2kDIPInfo, - photoy2kInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Photo Y2K / Real and Fake (V104) - -static struct BurnRomInfo photoy2k104RomDesc[] = { - { "v104.16m", 0x200000, 0xe051070f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0700.rom", 0x080000, 0x93943b4d, 2 | BRF_GRA }, // 1 Tile data - - { "a0700.l", 0x400000, 0x26a9ae9c, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0700.h", 0x400000, 0x79bc1fc1, 3 | BRF_GRA }, // 3 - { "a0701.l", 0x400000, 0x23607f81, 3 | BRF_GRA }, // 4 - { "a0701.h", 0x400000, 0x5f2efd37, 3 | BRF_GRA }, // 5 - { "a0702.rom", 0x080000, 0x42239e1b, 3 | BRF_GRA }, // 6 - - { "b0700.l", 0x400000, 0xaf096904, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b0700.h", 0x400000, 0x6d53de26, 4 | BRF_GRA }, // 8 - { "cgv101.rom", 0x020000, 0xda02ec3e, 4 | BRF_GRA }, // 9 - - { "m0700.rom", 0x080000, 0xacc7afce, 5 | BRF_SND }, // 10 Samples - - { "igs027a_photoy2k_v100_china_alt.asic", 0x004000, 0x6dd7f257, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom -}; - -STDROMPICKEXT(photoy2k104, photoy2k104, pgm) -STD_ROM_FN(photoy2k104) - -struct BurnDriver BurnDrvPhotoy2k104 = { - "photoy2k104", "photoy2k", "pgm", NULL, "1999", - "Photo Y2K / Real and Fake (V104)\0", NULL, "IGS", "PolyGameMaster", - L"Photo Y2K\0\u30EA\u30A2\u30EB\u30A2\u30F3\u30C9 \u30D5\u30A7\u30A4\u30AF\0\u5927\u5BB6\u6765 \u627E\u78B4\0\u8D85\u7EA7 \u6BD4\u4E00\u6BD4 (V104)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_PUZZLE, 0, - NULL, photoy2k104RomInfo, photoy2k104RomName, NULL, NULL, pgmInputInfo, photoy2kDIPInfo, - photoy2kInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Real and Fake / Photo Y2K (V102, Japan) - -static struct BurnRomInfo photoy2k102RomDesc[] = { - { "v102.u4", 0x080000, 0xa65eda9f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "v102.u6", 0x080000, 0xb9ca5504, 1 | BRF_PRG | BRF_ESS }, // 1 - { "v102.u5", 0x080000, 0x9201621b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "v102.u8", 0x080000, 0x3be22b8f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "t0700.rom", 0x080000, 0x93943b4d, 2 | BRF_GRA }, // 4 Tile data - - { "a0700.l", 0x400000, 0x26a9ae9c, 3 | BRF_GRA }, // 5 Sprite Color Data - { "a0700.h", 0x400000, 0x79bc1fc1, 3 | BRF_GRA }, // 6 - { "a0701.l", 0x400000, 0x23607f81, 3 | BRF_GRA }, // 7 - { "a0701.h", 0x400000, 0x5f2efd37, 3 | BRF_GRA }, // 8 - { "a0702.rom", 0x080000, 0x42239e1b, 3 | BRF_GRA }, // 9 - - { "b0700.l", 0x400000, 0xaf096904, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "b0700.h", 0x400000, 0x6d53de26, 4 | BRF_GRA }, // 11 - { "cgv101.rom", 0x020000, 0xda02ec3e, 4 | BRF_GRA }, // 12 - - { "m0700.rom", 0x080000, 0xacc7afce, 5 | BRF_SND }, // 13 Samples - - { "igs027a_photoy2k_v100_china_alt.asic", 0x0004000, 0x6dd7f257, 7 | BRF_PRG | BRF_ESS }, // 14 Internal ARM7 Rom -}; - -STDROMPICKEXT(photoy2k102, photoy2k102, pgm) -STD_ROM_FN(photoy2k102) - -struct BurnDriver BurnDrvphotoy2k102 = { - "photoy2k102", "photoy2k", "pgm", NULL, "1999", - "Real and Fake\0Photo Y2K (V102, Japan)\0", NULL, "IGS", "PolyGameMaster", - L"\u30EA\u30A2\u30EB\u30A2\u30F3\u30C9 \u30D5\u30A7\u30A4\u30AF\0Photo Y2K\0\u5927\u5BB6\u6765 \u627E\u78B4\0\u8D85\u7EA7 \u6BD4\u4E00\u6BD4 (V102, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_PUZZLE, 0, - NULL, photoy2k102RomInfo, photoy2k102RomName, NULL, NULL, pgmInputInfo, photoy2kDIPInfo, - photoy2kInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Puzzle Star (V100MG) - -static struct BurnRomInfo puzlstarRomDesc[] = { - { "v100mg.u2", 0x080000, 0x4c79d979, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "v100mg.u1", 0x080000, 0x5788b77d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "t0800.u5", 0x200000, 0xf9d84e59, 2 | BRF_GRA }, // 2 Tile data - - { "a0800.u1", 0x400000, 0xe1e6ec40, 3 | BRF_GRA }, // 3 Sprite Color Data - - { "b0800.u3", 0x200000, 0x52e7bef5, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m0800.u2", 0x400000, 0xe1a46541, 5 | BRF_SND }, // 5 Samples - - { "puzlstar_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom -}; - -STDROMPICKEXT(puzlstar, puzlstar, pgm) -STD_ROM_FN(puzlstar) - -static INT32 puzlstarInit() -{ - pPgmInitCallback = pgm_decrypt_puzlstar; - pPgmProtCallback = install_protection_asic27a_puzlstar; // simulation -// pPgmProtCallback = install_protection_asic27a_kovsh; - - return pgmInit(); -} - -struct BurnDriver BurnDrvPuzlstar = { - "puzlstar", NULL, "pgm", NULL, "1999", - "Puzzle Star (V100MG)\0", "Incomplete dump", "IGS", "PolyGameMaster", - L"Puzzle Star\0\u30D1\u30BA\u30EB\u30B9\u30BF\u30FC\0\u9B54\u5E7B\u661F\u5EA7 (V100MG)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_PUZZLE, 0, - NULL, puzlstarRomInfo, puzlstarRomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - puzlstarInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Puzzli 2 (V100) - -static struct BurnRomInfo puzzli2RomDesc[] = { - { "v100.u5", 0x200000, 0x1abb4595, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0900.u9", 0x200000, 0x70615611, 2 | BRF_GRA }, // 1 Tile data - - { "a0900.u3", 0x400000, 0x14911251, 3 | BRF_GRA }, // 2 Sprite Color Data - - { "b0900.u4", 0x200000, 0x6f0638b6, 4 | BRF_GRA }, // 3 Sprite Masks & Color Indexes - - { "m0900.u2", 0x400000, 0x9ea7af2e, 5 | BRF_SND }, // 4 Samples - - { "puzzli2_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 5 Internal ARM7 Rom -}; - -STDROMPICKEXT(puzzli2, puzzli2, pgm) -STD_ROM_FN(puzzli2) - -static INT32 puzzli2Init() -{ - nPGMDisableIRQ4 = 1; - pPgmInitCallback = pgm_decrypt_puzzli2; - pPgmProtCallback = install_protection_asic27a_puzzli2; // simulation -// pPgmProtCallback = install_protection_asic27a_kovsh; - - return pgmInit(); -} - -struct BurnDriver BurnDrvPuzzli2 = { - "puzzli2", NULL, "pgm", NULL, "1999", - "Puzzli 2 (V100)\0", "Incomplete dump", "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_PUZZLE, 0, - NULL, puzzli2RomInfo, puzzli2RomName, NULL, NULL, pgmInputInfo, puzzli2DIPInfo, - puzzli2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Puzzli 2 Super (V200) - -static struct BurnRomInfo puzzli2sRomDesc[] = { - { "2sp_v200.u4", 0x080000, 0xfa5c86c1, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "2sp_v200.u3", 0x080000, 0x2a5ba8a6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "t0900.u9", 0x200000, 0x70615611, 2 | BRF_GRA }, // 2 Tile data - - { "a0900.u3", 0x400000, 0x14911251, 3 | BRF_GRA }, // 3 Sprite Color Data - - { "b0900.u4", 0x200000, 0x6f0638b6, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m0900.u2", 0x400000, 0x9ea7af2e, 5 | BRF_SND }, // 5 Samples - - { "puzzli2_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom -}; - -STDROMPICKEXT(puzzli2s, puzzli2s, pgm) -STD_ROM_FN(puzzli2s) - -struct BurnDriver BurnDrvPuzzli2s = { - "puzzli2s", "puzzli2", "pgm", NULL, "2001", - "Puzzli 2 Super (V200)\0", "Incomplete dump", "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_PUZZLE, 0, - NULL, puzzli2sRomInfo, puzzli2sRomName, NULL, NULL, pgmInputInfo, puzzli2DIPInfo, - puzzli2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Martial Masters / Xing Yi (V104, 102, 102, USA) - -static struct BurnRomInfo martmastRomDesc[] = { - { "v104_32m.u9", 0x400000, 0xcfd9dff4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1000.u3", 0x800000, 0xbbf879b5, 2 | BRF_GRA }, // 1 Tile data - - { "a1000.u3", 0x800000, 0x43577ac8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1001.u4", 0x800000, 0xfe7a476f, 3 | BRF_GRA }, // 3 - { "a1002.u6", 0x800000, 0x62e33d38, 3 | BRF_GRA }, // 4 - { "a1003.u8", 0x800000, 0xb2c4945a, 3 | BRF_GRA }, // 5 - { "a1004.u10", 0x400000, 0x9fd3f5fd, 3 | BRF_GRA }, // 6 - - { "b1000.u9", 0x800000, 0xc5961f6f, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1001.u11", 0x800000, 0x0b7e1c06, 4 | BRF_GRA }, // 8 - - { "m1000.u5", 0x800000, 0xed407ae8, 5 | BRF_SND }, // 9 Samples - { "m1001.u7", 0x400000, 0x662d2d48, 5 | BRF_SND }, // 10 - - { "martial_masters_v102_usa.asic", 0x004000, 0xa6c0828c, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom - - { "v102_16m.u10", 0x200000, 0x18b745e6, 8 | BRF_PRG | BRF_ESS }, // 12 External ARM7 Rom -}; - -STDROMPICKEXT(martmast, martmast, pgm) -STD_ROM_FN(martmast) - -static INT32 martmastInit() -{ - pPgmInitCallback = pgm_decrypt_martmast; - pPgmProtCallback = install_protection_asic27a_martmast; - - nPgmAsicRegionHackAddress = 0x37c1; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x800039e); - - return nRet; -} - -struct BurnDriver BurnDrvMartmast = { - "martmast", NULL, "pgm", NULL, "2001", - "Martial Masters (V104, 102, 102, USA)\0", NULL, "IGS", "PolyGameMaster", - L"Martial Masters\0\u5f62\u610f\u62f3 (V104, 102, 102, USA)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VSFIGHT, 0, - NULL, martmastRomInfo, martmastRomName, NULL, NULL, pgmInputInfo, martmastDIPInfo, - martmastInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Martial Masters / Xing Yi (V104, 102, 101, China) - -static struct BurnRomInfo martmastcRomDesc[] = { - { "v104_32m.u9", 0x400000, 0xcfd9dff4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1000.u3", 0x800000, 0xbbf879b5, 2 | BRF_GRA }, // 1 Tile data - - { "a1000.u3", 0x800000, 0x43577ac8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1001.u4", 0x800000, 0xfe7a476f, 3 | BRF_GRA }, // 3 - { "a1002.u6", 0x800000, 0x62e33d38, 3 | BRF_GRA }, // 4 - { "a1003.u8", 0x800000, 0xb2c4945a, 3 | BRF_GRA }, // 5 - { "a1004.u10", 0x400000, 0x9fd3f5fd, 3 | BRF_GRA }, // 6 - - { "b1000.u9", 0x800000, 0xc5961f6f, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1001.u11", 0x800000, 0x0b7e1c06, 4 | BRF_GRA }, // 8 - - { "m1000.u5", 0x800000, 0xed407ae8, 5 | BRF_SND }, // 9 Samples - { "m1001.u7", 0x400000, 0x662d2d48, 5 | BRF_SND }, // 10 - - { "martial_masters_v101_cn.asic", 0x004000, 0xb3e25b7d, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom - - { "v102_16m.u10", 0x200000, 0x18b745e6, 8 | BRF_PRG | BRF_ESS }, // 12 External ARM7 Rom -}; - -STDROMPICKEXT(martmastc, martmastc, pgm) -STD_ROM_FN(martmastc) - -static INT32 martmastcInit() -{ - pPgmInitCallback = pgm_decrypt_martmast; - pPgmProtCallback = install_protection_asic27a_martmast; - - nPgmAsicRegionHackAddress = 0x2cb5; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x800039e); - - return nRet; -} - -struct BurnDriver BurnDrvmartmastc = { - "martmastc", "martmast", "pgm", NULL, "2001", - "Martial Masters (V104, 102, 101, China)\0", NULL, "IGS", "PolyGameMaster", - L"Martial Masters\0\u5f62\u610f\u62f3 (V104, 102, 101, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VSFIGHT, 0, - NULL, martmastcRomInfo, martmastcRomName, NULL, NULL, pgmInputInfo, martmastDIPInfo, - martmastcInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Martial Masters / Xing Yi (V103, 102, 101, China) -// Needs proper martial_masters_v102_cn.asic to be dumped - -static struct BurnRomInfo martmastc103RomDesc[] = { - { "v103_32m.u9", 0x400000, 0xdf5ffbe9, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1000.u3", 0x800000, 0xbbf879b5, 2 | BRF_GRA }, // 1 Tile data - - { "a1000.u3", 0x800000, 0x43577ac8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1001.u4", 0x800000, 0xfe7a476f, 3 | BRF_GRA }, // 3 - { "a1002.u6", 0x800000, 0x62e33d38, 3 | BRF_GRA }, // 4 - { "a1003.u8", 0x800000, 0xb2c4945a, 3 | BRF_GRA }, // 5 - { "a1004.u10", 0x400000, 0x9fd3f5fd, 3 | BRF_GRA }, // 6 - - { "b1000.u9", 0x800000, 0xc5961f6f, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1001.u11", 0x800000, 0x0b7e1c06, 4 | BRF_GRA }, // 8 - - { "m1000.u5", 0x800000, 0xed407ae8, 5 | BRF_SND }, // 9 Samples - { "m1001.u7", 0x400000, 0x662d2d48, 5 | BRF_SND }, // 10 - - { "martial_masters_v101_cn.asic", 0x004000, 0xb3e25b7d, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom - - { "v102_16m.u10", 0x200000, 0x18b745e6, 8 | BRF_PRG | BRF_ESS }, // 12 External ARM7 Rom -}; - -STDROMPICKEXT(martmastc103, martmastc103, pgm) -STD_ROM_FN(martmastc103) - -struct BurnDriver BurnDrvmartmastc103 = { - "martmastc103", "martmast", "pgm", NULL, "2001", - "Martial Masters (V103, 102, 101, China)\0", NULL, "IGS", "PolyGameMaster", - L"Martial Masters\0\u5f62\u610f\u62f3 (V103, 102, 101, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VSFIGHT, 0, - NULL, martmastc103RomInfo, martmastc103RomName, NULL, NULL, pgmInputInfo, martmastc102DIPInfo, - martmastInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Martial Masters / Xing Yi (V102, 101, 101, China) - -static struct BurnRomInfo martmastc102RomDesc[] = { - { "martmast_u9-v102.322", 0x400000, 0xbb24b92a, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1000.u3", 0x800000, 0xbbf879b5, 2 | BRF_GRA }, // 1 Tile data - - { "a1000.u3", 0x800000, 0x43577ac8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1001.u4", 0x800000, 0xfe7a476f, 3 | BRF_GRA }, // 3 - { "a1002.u6", 0x800000, 0x62e33d38, 3 | BRF_GRA }, // 4 - { "a1003.u8", 0x800000, 0xb2c4945a, 3 | BRF_GRA }, // 5 - { "a1004.u10", 0x400000, 0x9fd3f5fd, 3 | BRF_GRA }, // 6 - - { "b1000.u9", 0x800000, 0xc5961f6f, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1001.u11", 0x800000, 0x0b7e1c06, 4 | BRF_GRA }, // 8 - - { "m1000.u5", 0x800000, 0xed407ae8, 5 | BRF_SND }, // 9 Samples - { "m1001.u7", 0x400000, 0x662d2d48, 5 | BRF_SND }, // 10 - - { "martial_masters_v101_cn.asic", 0x004000, 0xb3e25b7d, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom - - { "martmast_u10-v101.160", 0x200000, 0xd5d93294, 8 | BRF_PRG | BRF_ESS }, // 12 External ARM7 Rom -}; - -STDROMPICKEXT(martmastc102, martmastc102, pgm) -STD_ROM_FN(martmastc102) - -struct BurnDriver BurnDrvmartmastc102 = { - "martmastc102", "martmast", "pgm", NULL, "2001", - "Martial Masters (V102, 101, 101, China)\0", NULL, "IGS", "PolyGameMaster", - L"Martial Masters\0\u5f62\u610f\u62f3 (V102, 101, 101, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VSFIGHT, 0, - NULL, martmastc102RomInfo, martmastc102RomName, NULL, NULL, pgmInputInfo, martmastc102DIPInfo, - martmastcInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Photo Y2K 2 (VM101XX, Taiwan) - -static struct BurnRomInfo py2k2RomDesc[] = { - { "y2k2_m-101xx.u1", 0x200000, 0xc47795f1, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "y2k2_a1100.u6", 0x800000, 0xe32ce499, 3 | BRF_GRA }, // 1 Sprite Color Data - { "y2k2_a1101.u7", 0x800000, 0x4e7568bc, 3 | BRF_GRA }, // 2 - { "y2k2_a1102.u8", 0x800000, 0x6da7c143, 3 | BRF_GRA }, // 3 - { "y2k2_a1103.u9", 0x800000, 0x0ebebfdc, 3 | BRF_GRA }, // 4 - - { "y2k2_b1100.u4", 0x800000, 0xfa53d6f6, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - { "y2k2_b1101.u5", 0x800000, 0x001e4c81, 4 | BRF_GRA }, // 6 - - { "y2k2_m1100.u3", 0x200000, 0xfb1515f8, 5 | BRF_SND }, // 7 Samples - - { "igs027a_photoy2k2.asic", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom -}; - -STDROMPICKEXT(py2k2, py2k2, pgm) -STD_ROM_FN(py2k2) - -static INT32 py2k2Init() -{ - pPgmInitCallback = pgm_decrypt_py2k2; - pPgmProtCallback = install_protection_asic27a_py2k2; -// pPgmProtCallback = install_protection_asic27a_kovsh; - - return pgmInit(); -} - -struct BurnDriverD BurnDrvPy2k2 = { - "py2k2", NULL, "pgm", NULL, "2001", - "Photo Y2K 2 (VM101XX, Taiwan)\0", "Incomplete dump", "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_PUZZLE, 0, - NULL, py2k2RomInfo, py2k2RomName, NULL, NULL, pgmInputInfo, py2k2DIPInfo, - py2k2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour 2 (V107, 102, 100, Hong Kong) - -static struct BurnRomInfo kov2RomDesc[] = { - { "u18.107", 0x400000, 0x661a5b2c, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1200.rom", 0x800000, 0xd7e26609, 2 | BRF_GRA }, // 1 Tile data - - { "a1200.rom", 0x800000, 0xceeb81d8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1201.rom", 0x800000, 0x21063ca7, 3 | BRF_GRA }, // 3 - { "a1202.rom", 0x800000, 0x4bb92fae, 3 | BRF_GRA }, // 4 - { "a1203.rom", 0x800000, 0xe73cb627, 3 | BRF_GRA }, // 5 - { "a1204.rom", 0x200000, 0x14b4b5bb, 3 | BRF_GRA }, // 6 - - { "b1200.rom", 0x800000, 0xbed7d994, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1201.rom", 0x800000, 0xf251eb57, 4 | BRF_GRA }, // 8 - - { "m1200.rom", 0x800000, 0xb0d88720, 5 | BRF_SND }, // 9 Samples - - { "kov2_v100_hongkong.asic", 0x004000, 0xe0d7679f, 7 | BRF_PRG | BRF_ESS }, // 10 Internal ARM7 Rom - - { "u19.102", 0x200000, 0x462e2980, 8 | BRF_PRG | BRF_ESS }, // 11 External ARM7 Rom -}; - -STDROMPICKEXT(kov2, kov2, pgm) -STD_ROM_FN(kov2) - -static INT32 kov2Init() -{ - pPgmInitCallback = pgm_decrypt_kov2; - pPgmProtCallback = install_protection_asic27a_martmast; - - nPgmAsicRegionHackAddress = 0x23e5; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x80000ae); - - return nRet; -} - -struct BurnDriver BurnDrvKov2 = { - "kov2", NULL, "pgm", NULL, "2000", - "Knights of Valour 2 (V107, 102, 100, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour 2\0\u4e09\u56fd\u6218\u7eaa 2 (V107, 102, 100, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kov2RomInfo, kov2RomName, NULL, NULL, pgmInputInfo, kov2DIPInfo, - kov2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour 2 (V106, 102, 100 Hong Kong) - -static struct BurnRomInfo kov2106RomDesc[] = { - { "u18.106", 0x400000, 0x40051ad9, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1200.rom", 0x800000, 0xd7e26609, 2 | BRF_GRA }, // 1 Tile data - - { "a1200.rom", 0x800000, 0xceeb81d8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1201.rom", 0x800000, 0x21063ca7, 3 | BRF_GRA }, // 3 - { "a1202.rom", 0x800000, 0x4bb92fae, 3 | BRF_GRA }, // 4 - { "a1203.rom", 0x800000, 0xe73cb627, 3 | BRF_GRA }, // 5 - { "a1204.rom", 0x200000, 0x14b4b5bb, 3 | BRF_GRA }, // 6 - - { "b1200.rom", 0x800000, 0xbed7d994, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1201.rom", 0x800000, 0xf251eb57, 4 | BRF_GRA }, // 8 - - { "m1200.rom", 0x800000, 0xb0d88720, 5 | BRF_SND }, // 9 Samples - - { "kov2_v100_hongkong.asic", 0x004000, 0xe0d7679f, 7 | BRF_PRG | BRF_ESS }, // 10 Internal ARM7 Rom - - { "u19.102", 0x200000, 0x462e2980, 8 | BRF_PRG | BRF_ESS }, // 11 External ARM7 Rom -}; - -STDROMPICKEXT(kov2106, kov2106, pgm) -STD_ROM_FN(kov2106) - -struct BurnDriver BurnDrvKov2106 = { - "kov2106", "kov2", "pgm", NULL, "2000", - "Knights of Valour 2 (V106, 102, 100 Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour 2\0\u4e09\u56fd\u6218\u7eaa 2 (V106, 102, 100 Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kov2106RomInfo, kov2106RomName, NULL, NULL, pgmInputInfo, kov2DIPInfo, - kov2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour 2 (V103, 101, 100, Hong Kong) - -static struct BurnRomInfo kov2103RomDesc[] = { - { "u18.103", 0x400000, 0x98c32f76, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1200.rom", 0x800000, 0xd7e26609, 2 | BRF_GRA }, // 1 Tile data - - { "a1200.rom", 0x800000, 0xceeb81d8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1201.rom", 0x800000, 0x21063ca7, 3 | BRF_GRA }, // 3 - { "a1202.rom", 0x800000, 0x4bb92fae, 3 | BRF_GRA }, // 4 - { "a1203.rom", 0x800000, 0xe73cb627, 3 | BRF_GRA }, // 5 - { "a1204.rom", 0x200000, 0x14b4b5bb, 3 | BRF_GRA }, // 6 - - { "b1200.rom", 0x800000, 0xbed7d994, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1201.rom", 0x800000, 0xf251eb57, 4 | BRF_GRA }, // 8 - - { "m1200.rom", 0x800000, 0xb0d88720, 5 | BRF_SND }, // 9 Samples - - { "kov2_v100_hongkong.asic", 0x004000, 0xe0d7679f, 7 | BRF_PRG | BRF_ESS }, // 10 Internal ARM7 Rom - - { "u19.101", 0x200000, 0x8c35f2fe, 8 | BRF_PRG | BRF_ESS }, // 11 External ARM7 Rom -}; - -STDROMPICKEXT(kov2103, kov2103, pgm) -STD_ROM_FN(kov2103) - -struct BurnDriver BurnDrvKov2103 = { - "kov2103", "kov2", "pgm", NULL, "2000", - "Knights of Valour 2 (V103, 101, 100, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour 2\0\u4e09\u56fd\u6218\u7eaa 2 (V103, 101, 100, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kov2103RomInfo, kov2103RomName, NULL, NULL, pgmInputInfo, kov2DIPInfo, - kov2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour 2 (V102, 101, 100, Hong Kong) - -static struct BurnRomInfo kov2102RomDesc[] = { - { "u18.102", 0x400000, 0xa2489c37, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1200.rom", 0x800000, 0xd7e26609, 2 | BRF_GRA }, // 1 Tile data - - { "a1200.rom", 0x800000, 0xceeb81d8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1201.rom", 0x800000, 0x21063ca7, 3 | BRF_GRA }, // 3 - { "a1202.rom", 0x800000, 0x4bb92fae, 3 | BRF_GRA }, // 4 - { "a1203.rom", 0x800000, 0xe73cb627, 3 | BRF_GRA }, // 5 - { "a1204.rom", 0x200000, 0x14b4b5bb, 3 | BRF_GRA }, // 6 - - { "b1200.rom", 0x800000, 0xbed7d994, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1201.rom", 0x800000, 0xf251eb57, 4 | BRF_GRA }, // 8 - - { "m1200.rom", 0x800000, 0xb0d88720, 5 | BRF_SND }, // 9 Samples - - { "kov2_v100_hongkong.asic", 0x004000, 0xe0d7679f, 7 | BRF_PRG | BRF_ESS }, // 10 Internal ARM7 Rom - - { "u19.101", 0x200000, 0x8c35f2fe, 8 | BRF_PRG | BRF_ESS }, // 11 External ARM7 Rom -}; - -STDROMPICKEXT(kov2102, kov2102, pgm) -STD_ROM_FN(kov2102) - -struct BurnDriver BurnDrvKov2102 = { - "kov2102", "kov2", "pgm", NULL, "2000", - "Knights of Valour 2 (V102, 101, 100, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour 2\0\u4e09\u56fd\u6218\u7eaa 2 (V102, 101, 100, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kov2102RomInfo, kov2102RomName, NULL, NULL, pgmInputInfo, kov2DIPInfo, - kov2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour 2 (V101, 101, 100, Hong Kong) - -static struct BurnRomInfo kov2101RomDesc[] = { - { "u18.101", 0x400000, 0xc9926f35, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1200.rom", 0x800000, 0xd7e26609, 2 | BRF_GRA }, // 1 Tile data - - { "a1200.rom", 0x800000, 0xceeb81d8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1201.rom", 0x800000, 0x21063ca7, 3 | BRF_GRA }, // 3 - { "a1202.rom", 0x800000, 0x4bb92fae, 3 | BRF_GRA }, // 4 - { "a1203.rom", 0x800000, 0xe73cb627, 3 | BRF_GRA }, // 5 - { "a1204.rom", 0x200000, 0x14b4b5bb, 3 | BRF_GRA }, // 6 - - { "b1200.rom", 0x800000, 0xbed7d994, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1201.rom", 0x800000, 0xf251eb57, 4 | BRF_GRA }, // 8 - - { "m1200.rom", 0x800000, 0xb0d88720, 5 | BRF_SND }, // 9 Samples - - { "kov2_v100_hongkong.asic", 0x004000, 0xe0d7679f, 7 | BRF_PRG | BRF_ESS }, // 10 Internal ARM7 Rom - - { "u19.101", 0x200000, 0x8c35f2fe, 8 | BRF_PRG | BRF_ESS }, // 11 External ARM7 Rom -}; - -STDROMPICKEXT(kov2101, kov2101, pgm) -STD_ROM_FN(kov2101) - -struct BurnDriver BurnDrvKov2101 = { - "kov2101", "kov2", "pgm", NULL, "2000", - "Knights of Valour 2 (V101, 101, 100, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour 2\0\u4e09\u56fd\u6218\u7eaa 2 (V101, 101, 100, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kov2101RomInfo, kov2101RomName, NULL, NULL, pgmInputInfo, kov2DIPInfo, - kov2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour 2 (V100, 100, 100, Hong Kong) - -static struct BurnRomInfo kov2100RomDesc[] = { - { "igs_u18.rom", 0x400000, 0x86205879, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1200.rom", 0x800000, 0xd7e26609, 2 | BRF_GRA }, // 1 Tile data - - { "a1200.rom", 0x800000, 0xceeb81d8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1201.rom", 0x800000, 0x21063ca7, 3 | BRF_GRA }, // 3 - { "a1202.rom", 0x800000, 0x4bb92fae, 3 | BRF_GRA }, // 4 - { "a1203.rom", 0x800000, 0xe73cb627, 3 | BRF_GRA }, // 5 - { "a1204.rom", 0x200000, 0x14b4b5bb, 3 | BRF_GRA }, // 6 - - { "b1200.rom", 0x800000, 0xbed7d994, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1201.rom", 0x800000, 0xf251eb57, 4 | BRF_GRA }, // 8 - - { "m1200.rom", 0x800000, 0xb0d88720, 5 | BRF_SND }, // 9 Samples - - { "kov2_v100_hongkong.asic", 0x004000, 0xe0d7679f, 7 | BRF_PRG | BRF_ESS }, // 10 Internal ARM7 Rom - - { "u19.100", 0x200000, 0xedd59922, 8 | BRF_PRG | BRF_ESS }, // 11 External ARM7 Rom -}; - -STDROMPICKEXT(kov2100, kov2100, pgm) -STD_ROM_FN(kov2100) - -struct BurnDriver BurnDrvKov2100 = { - "kov2100", "kov2", "pgm", NULL, "2000", - "Knights of Valour 2 (V100, 100, 100, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour 2\0\u4e09\u56fd\u6218\u7eaa 2 (V100, 100, 100, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kov2100RomInfo, kov2100RomName, NULL, NULL, pgmInputInfo, kov2DIPInfo, - kov2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour 2 Plus - Nine Dragons (VM205XX, China) - -static struct BurnRomInfo kov2pRomDesc[] = { - { "u8-27322.rom", 0x400000, 0x3a2cc0de, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1200.rom", 0x800000, 0xd7e26609, 2 | BRF_GRA }, // 1 Tile data - - { "a1200.rom", 0x800000, 0xceeb81d8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1201.rom", 0x800000, 0x21063ca7, 3 | BRF_GRA }, // 3 - { "a1202.rom", 0x800000, 0x4bb92fae, 3 | BRF_GRA }, // 4 - { "a1203.rom", 0x800000, 0xe73cb627, 3 | BRF_GRA }, // 5 - { "a1204.rom", 0x200000, 0x14b4b5bb, 3 | BRF_GRA }, // 6 - - { "b1200.rom", 0x800000, 0xbed7d994, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1201.rom", 0x800000, 0xf251eb57, 4 | BRF_GRA }, // 8 - - { "m1200.rom", 0x800000, 0xb0d88720, 5 | BRF_SND }, // 9 Samples - - { "kov2p_igs027a_china.bin", 0x004000, 0x19a0bd95, 7 | BRF_PRG | BRF_ESS }, // 10 Internal ARM7 Rom - - { "v200-16.rom", 0x200000, 0x16a0c11f, 8 | BRF_PRG | BRF_ESS }, // 11 External ARM7 Rom -}; - -STDROMPICKEXT(kov2p, kov2p, pgm) -STD_ROM_FN(kov2p) - -static INT32 kov2pInit() -{ - pPgmInitCallback = pgm_decrypt_kov2p; - pPgmProtCallback = install_protection_asic27a_martmast; - - nPgmAsicRegionHackAddress = 0x26ed; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x80000a6); - - return nRet; -} - -struct BurnDriver BurnDrvKov2p = { - "kov2p", NULL, "pgm", NULL, "2001", - "Knights of Valour 2 Plus - Nine Dragons (VM205XX, China)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour 2 Plus\0\u4e09\u56fd\u6218\u7eaa 2 - \u7fa4\u96c4\u4e89\u9738 (VM205XX, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kov2pRomInfo, kov2pRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kov2pInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour 2 Plus - Nine Dragons (VM204XX) - -static struct BurnRomInfo kov2p204RomDesc[] = { - { "v204-32m.rom", 0x400000, 0x583e0650, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1200.rom", 0x800000, 0xd7e26609, 2 | BRF_GRA }, // 1 Tile data - - { "a1200.rom", 0x800000, 0xceeb81d8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1201.rom", 0x800000, 0x21063ca7, 3 | BRF_GRA }, // 3 - { "a1202.rom", 0x800000, 0x4bb92fae, 3 | BRF_GRA }, // 4 - { "a1203.rom", 0x800000, 0xe73cb627, 3 | BRF_GRA }, // 5 - { "a1204.rom", 0x200000, 0x14b4b5bb, 3 | BRF_GRA }, // 6 - - { "b1200.rom", 0x800000, 0xbed7d994, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1201.rom", 0x800000, 0xf251eb57, 4 | BRF_GRA }, // 8 - - { "m1200.rom", 0x800000, 0xb0d88720, 5 | BRF_SND }, // 9 Samples - - { "kov2p_igs027a_china.bin", 0x004000, 0x19a0bd95, 7 | BRF_PRG | BRF_ESS }, // 10 Internal ARM7 Rom - - { "v200-16.rom", 0x200000, 0x16a0c11f, 8 | BRF_PRG | BRF_ESS }, // 11 External ARM7 Rom -}; - -STDROMPICKEXT(kov2p204, kov2p204, pgm) -STD_ROM_FN(kov2p204) - -struct BurnDriver BurnDrvKov2p204 = { - "kov2p204", "kov2p", "pgm", NULL, "2001", - "Knights of Valour 2 Plus - Nine Dragons (VM204XX)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour 2 Plus\0\u4e09\u56fd\u6218\u7eaa 2 - \u7fa4\u96c4\u4e89\u9738 (VM204XX)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kov2p204RomInfo, kov2p204RomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kov2pInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour 2 Plus - Nine Dragons (VM202XX) - -static struct BurnRomInfo kov2p202RomDesc[] = { - { "v202.bin", 0x400000, 0xe9b5aa0c, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t1200.rom", 0x800000, 0xd7e26609, 2 | BRF_GRA }, // 1 Tile data - - { "a1200.rom", 0x800000, 0xceeb81d8, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a1201.rom", 0x800000, 0x21063ca7, 3 | BRF_GRA }, // 3 - { "a1202.rom", 0x800000, 0x4bb92fae, 3 | BRF_GRA }, // 4 - { "a1203.rom", 0x800000, 0xe73cb627, 3 | BRF_GRA }, // 5 - { "a1204.rom", 0x200000, 0x14b4b5bb, 3 | BRF_GRA }, // 6 - - { "b1200.rom", 0x800000, 0xbed7d994, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b1201.rom", 0x800000, 0xf251eb57, 4 | BRF_GRA }, // 8 - - { "m1200.rom", 0x800000, 0xb0d88720, 5 | BRF_SND }, // 9 Samples - - { "kov2p_igs027a_china.bin", 0x004000, 0x19a0bd95, 7 | BRF_PRG | BRF_ESS }, // 10 Internal ARM7 Rom - - { "v200-16.rom", 0x200000, 0x16a0c11f, 8 | BRF_PRG | BRF_ESS }, // 11 External ARM7 Rom -}; - -STDROMPICKEXT(kov2p202, kov2p202, pgm) -STD_ROM_FN(kov2p202) - -struct BurnDriver BurnDrvKov2p202 = { - "kov2p202", "kov2p", "pgm", NULL, "2001", - "Knights of Valour 2 Plus - Nine Dragons (VM202XX)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour 2 Plus\0\u4e09\u56fd\u6218\u7eaa 2 - \u7fa4\u96c4\u4e89\u9738 (VM202XX)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kov2p202RomInfo, kov2p202RomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kov2pInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Bee Storm - DoDonPachi II definitions - -#define DDP2_ASIC027_CHINA \ - { "ddp2_igs027a_china.bin", 0x004000, 0x8c566319, 7 | BRF_PRG | BRF_ESS }, - -#define DDP2_ASIC027_TAIWAN \ - { "ddp2_igs027a_taiwan.bin", 0x004000, 0x1dd34bdc, 7 | BRF_PRG | BRF_ESS }, - -#define DDP2_ASIC027_JAPAN \ - { "ddp2_igs027a_japan.bin", 0x004000, 0x742d34d2, 7 | BRF_PRG | BRF_ESS }, - -#define DDP2_ASIC027_KOREA \ - { "ddp2_igs027a_korea.bin", 0x004000, 0xe5a81c17, 7 | BRF_PRG | BRF_ESS }, - -#define DDP2_ASIC027_HONG_KONG \ - { "ddp2_igs027a_hong_kong.bin", 0x004000, 0xa7d1cace, 7 | BRF_PRG | BRF_ESS }, - -#define DDP2_ASIC027_WORLD \ - { "ddp2_igs027a_world.bin", 0x004000, 0x3654e20b, 7 | BRF_PRG | BRF_ESS }, - -#define DDP2_COMMON_ROMS \ - { "t1300.u21", 0x800000, 0xe748f0cb, 2 | BRF_GRA }, \ - \ - { "a1300.u1", 0x800000, 0xfc87a405, 3 | BRF_GRA }, \ - { "a1301.u2", 0x800000, 0x0c8520da, 3 | BRF_GRA }, \ - \ - { "b1300.u7", 0x800000, 0xef646604, 4 | BRF_GRA }, \ - \ - { "m1300.u5", 0x400000, 0x82d4015d, 5 | BRF_SND }, \ - \ - { "v100.u23", 0x020000, 0x06c3dd29, 8 | BRF_PRG | BRF_ESS }, - -#define DDP2_PROGRAM_102 \ - { "v102.u8", 0x200000, 0x5a9ea040, 1 | BRF_PRG | BRF_ESS }, - -#define DDP2_PROGRAM_101 \ - { "v101_16m.u8", 0x200000, 0x5e5786fd, 1 | BRF_PRG | BRF_ESS }, - -#define DDP2_PROGRAM_100 \ - { "v100.u8", 0x200000, 0x0c8aa8ea, 1 | BRF_PRG | BRF_ESS }, - -// Bee Storm - DoDonPachi II (V102, World) - -static struct BurnRomInfo ddp2RomDesc[] = { - DDP2_PROGRAM_102 - DDP2_ASIC027_WORLD - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2, ddp2, pgm) -STD_ROM_FN(ddp2) - -static INT32 ddp2Init() -{ - pPgmInitCallback = pgm_decrypt_ddp2; - pPgmProtCallback = install_protection_asic27a_martmast; - -// nPgmAsicRegionHackAddress = 0x2882; // 2883? - - INT32 nRet = pgmInit(); - - if (!nRet) { - ICS2115_ddp2beestormmode = 1; // hack to fix volume fadeouts in ddp2 bee storm - - Arm7SetIdleLoopAddress(0x8010998); - } - - return nRet; -} - -struct BurnDriver BurnDrvDdp2 = { - "ddp2", NULL, "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V102, World)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V102, World)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2RomInfo, ddp2RomName, NULL, NULL, pgmInputInfo, ddp2DIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V101, World) - -static struct BurnRomInfo ddp2101RomDesc[] = { - DDP2_PROGRAM_101 - DDP2_ASIC027_WORLD - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2101, ddp2101, pgm) -STD_ROM_FN(ddp2101) - -struct BurnDriver BurnDrvDdp2101 = { - "ddp2101", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V101, World)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V101, World)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2101RomInfo, ddp2101RomName, NULL, NULL, pgmInputInfo, ddp2DIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V100, World) - -static struct BurnRomInfo ddp2100RomDesc[] = { - DDP2_PROGRAM_100 - DDP2_ASIC027_WORLD - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2100, ddp2100, pgm) -STD_ROM_FN(ddp2100) - -struct BurnDriver BurnDrvDdp2100 = { - "ddp2100", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V100, World)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V100, World)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2100RomInfo, ddp2100RomName, NULL, NULL, pgmInputInfo, ddp2DIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V102, Hong Kong) - -static struct BurnRomInfo ddp2hkRomDesc[] = { - DDP2_PROGRAM_102 - DDP2_ASIC027_HONG_KONG - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2hk, ddp2hk, pgm) -STD_ROM_FN(ddp2hk) - -struct BurnDriver BurnDrvDdp2hk = { - "ddp2hk", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V102, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V102, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2hkRomInfo, ddp2hkRomName, NULL, NULL, pgmInputInfo, ddp2hkDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V101, Hong Kong) - -static struct BurnRomInfo ddp2101hkRomDesc[] = { - DDP2_PROGRAM_101 - DDP2_ASIC027_HONG_KONG - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2101hk, ddp2101hk, pgm) -STD_ROM_FN(ddp2101hk) - -struct BurnDriver BurnDrvDdp2101hk = { - "ddp2101hk", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V101, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V101, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2101hkRomInfo, ddp2101hkRomName, NULL, NULL, pgmInputInfo, ddp2hkDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V100, Hong Kong) - -static struct BurnRomInfo ddp2100hkRomDesc[] = { - DDP2_PROGRAM_100 - DDP2_ASIC027_HONG_KONG - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2100hk, ddp2100hk, pgm) -STD_ROM_FN(ddp2100hk) - -struct BurnDriver BurnDrvDdp2100hk = { - "ddp2100hk", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V100, Hong Kong)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V100, Hong Kong)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2100hkRomInfo, ddp2100hkRomName, NULL, NULL, pgmInputInfo, ddp2hkDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V102, Korea) - -static struct BurnRomInfo ddp2kRomDesc[] = { - DDP2_PROGRAM_102 - DDP2_ASIC027_KOREA - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2k, ddp2k, pgm) -STD_ROM_FN(ddp2k) - -struct BurnDriver BurnDrvDdp2k = { - "ddp2k", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V102, Korea)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V102, Korea)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2kRomInfo, ddp2kRomName, NULL, NULL, pgmInputInfo, ddp2kDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V101, Korea) - -static struct BurnRomInfo ddp2101kRomDesc[] = { - DDP2_PROGRAM_101 - DDP2_ASIC027_KOREA - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2101k, ddp2101k, pgm) -STD_ROM_FN(ddp2101k) - -struct BurnDriver BurnDrvDdp2101k = { - "ddp2101k", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V101, Korea)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V101, Korea)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2101kRomInfo, ddp2101kRomName, NULL, NULL, pgmInputInfo, ddp2kDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V100, Korea) - -static struct BurnRomInfo ddp2100kRomDesc[] = { - DDP2_PROGRAM_100 - DDP2_ASIC027_KOREA - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2100k, ddp2100k, pgm) -STD_ROM_FN(ddp2100k) - -struct BurnDriver BurnDrvDdp2100k = { - "ddp2100k", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V100, Korea)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V100, Korea)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2100kRomInfo, ddp2100kRomName, NULL, NULL, pgmInputInfo, ddp2kDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V102, Japan) - -static struct BurnRomInfo ddp2jRomDesc[] = { - DDP2_PROGRAM_102 - DDP2_ASIC027_JAPAN - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2j, ddp2j, pgm) -STD_ROM_FN(ddp2j) - -struct BurnDriver BurnDrvDdp2j = { - "ddp2j", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V102, Japan)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V102, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2jRomInfo, ddp2jRomName, NULL, NULL, pgmInputInfo, ddp2jDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V101, Japan) - -static struct BurnRomInfo ddp2101jRomDesc[] = { - DDP2_PROGRAM_101 - DDP2_ASIC027_JAPAN - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2101j, ddp2101j, pgm) -STD_ROM_FN(ddp2101j) - -struct BurnDriver BurnDrvDdp2101j = { - "ddp2101j", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V101, Japan)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V101, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2101jRomInfo, ddp2101jRomName, NULL, NULL, pgmInputInfo, ddp2jDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V100, Japan) - -static struct BurnRomInfo ddp2100jRomDesc[] = { - DDP2_PROGRAM_100 - DDP2_ASIC027_JAPAN - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2100j, ddp2100j, pgm) -STD_ROM_FN(ddp2100j) - -struct BurnDriver BurnDrvDdp2100j = { - "ddp2100j", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V100, Japan)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V100, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2100jRomInfo, ddp2100jRomName, NULL, NULL, pgmInputInfo, ddp2jDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V102, Taiwan) - -static struct BurnRomInfo ddp2tRomDesc[] = { - DDP2_PROGRAM_102 - DDP2_ASIC027_TAIWAN - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2t, ddp2t, pgm) -STD_ROM_FN(ddp2t) - -struct BurnDriver BurnDrvDdp2t = { - "ddp2t", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V102, Taiwan)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V102, Taiwan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2tRomInfo, ddp2tRomName, NULL, NULL, pgmInputInfo, ddp2tDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V101, Taiwan) - -static struct BurnRomInfo ddp2101tRomDesc[] = { - DDP2_PROGRAM_101 - DDP2_ASIC027_TAIWAN - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2101t, ddp2101t, pgm) -STD_ROM_FN(ddp2101t) - -struct BurnDriver BurnDrvDdp2101t = { - "ddp2101t", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V101, Taiwan)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V101, Taiwan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2101tRomInfo, ddp2101tRomName, NULL, NULL, pgmInputInfo, ddp2tDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V100, Taiwan) - -static struct BurnRomInfo ddp2100tRomDesc[] = { - DDP2_PROGRAM_100 - DDP2_ASIC027_TAIWAN - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2100t, ddp2100t, pgm) -STD_ROM_FN(ddp2100t) - -struct BurnDriver BurnDrvDdp2100t = { - "ddp2100t", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V100, Taiwan)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V100, Taiwan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2100tRomInfo, ddp2100tRomName, NULL, NULL, pgmInputInfo, ddp2tDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V102, China) - -static struct BurnRomInfo ddp2cRomDesc[] = { - DDP2_PROGRAM_102 - DDP2_ASIC027_CHINA - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2c, ddp2c, pgm) -STD_ROM_FN(ddp2c) - -struct BurnDriver BurnDrvDdp2c = { - "ddp2c", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V102, China)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V102, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2cRomInfo, ddp2cRomName, NULL, NULL, pgmInputInfo, ddp2cDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V101, China) - -static struct BurnRomInfo ddp2101cRomDesc[] = { - DDP2_PROGRAM_101 - DDP2_ASIC027_CHINA - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2101c, ddp2101c, pgm) -STD_ROM_FN(ddp2101c) - -struct BurnDriver BurnDrvDdp2101c = { - "ddp2101c", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V101, China)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V101, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2101cRomInfo, ddp2101cRomName, NULL, NULL, pgmInputInfo, ddp2cDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Bee Storm - DoDonPachi II (V100, Taiwan) - -static struct BurnRomInfo ddp2100cRomDesc[] = { - DDP2_PROGRAM_100 - DDP2_ASIC027_CHINA - DDP2_COMMON_ROMS -}; - -STDROMPICKEXT(ddp2100c, ddp2100c, pgm) -STD_ROM_FN(ddp2100c) - -struct BurnDriver BurnDrvDdp2100c = { - "ddp2100c", "ddp2", "pgm", NULL, "2001", - "Bee Storm - DoDonPachi II (V100, China)\0", NULL, "IGS", "PolyGameMaster", - L"Bee Storm - DoDonPachi II\0\u6012\u9996\u9886\u8702\uff0d\u8702\u66b4 (V100, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddp2100cRomInfo, ddp2100cRomName, NULL, NULL, pgmInputInfo, ddp2cDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224,448,3,4 -}; - - -// Dragon World 2001 (V100, Japan) - -static struct BurnRomInfo dw2001RomDesc[] = { - { "2001.u22", 0x080000, 0x5cabed92, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "2001.u11", 0x200000, 0xb27cf093, 2 | BRF_GRA }, // 1 Tile data - - { "2001.u2", 0x200000, 0xd11c733c, 3 | BRF_GRA }, // 2 Sprite Color Data - { "2001.u3", 0x200000, 0x1435aef2, 3 | BRF_GRA }, // 4 - - { "2001.u9", 0x200000, 0xccbca572, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "2001.u7", 0x200000, 0x4ea62f21, 5 | BRF_SND }, // 6 Samples - - { "dw2001_igs027a_japan.bin", 0x004000, 0x3a79159b, 7 | BRF_PRG }, // 7 Internal ARM7 rom - - { "2001.u12", 0x080000, 0x973db1ab, 8 | BRF_PRG | BRF_ESS }, // 8 External ARM7 rom -}; - -STDROMPICKEXT(dw2001, dw2001, pgm) -STD_ROM_FN(dw2001) - -static void dw2001Callback() -{ - pgm_decrypt_martmast(); - - // add proper fix to rom loading routines at a later date - memcpy (ICSSNDROM + 0x200000, ICSSNDROM + 0x400000, 0x200000); -} - -static INT32 dw2001Init() -{ - pPgmInitCallback = dw2001Callback; - pPgmProtCallback = install_protection_asic27a_martmast; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x8000228); - - return nRet; -} - -struct BurnDriver BurnDrvDw2001 = { - "dw2001", NULL, "pgm", NULL, "2001", - "Dragon World 2001 (V100, Japan)\0", "Bad sound?", "IGS (Alta Co., LTD License)", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_PUZZLE, 0, - NULL, dw2001RomInfo, dw2001RomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - dw2001Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Dragon World Pretty Chance (V101, Japan) - -static struct BurnRomInfo dwpcRomDesc[] = { - { "dwpc_v101jp.u22", 0x080000, 0xb93027c0, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "dwpc_v100jp.u11", 0x400000, 0x3aa5a787, 2 | BRF_GRA }, // 1 Tile data - - { "dwpc_v100jp.u2", 0x200000, 0xe7115763, 3 | BRF_GRA }, // 2 Sprite Color Data - { "dwpc_v100jp.u3", 0x200000, 0x49c184a4, 3 | BRF_GRA }, // 4 - - { "dwpc_v100jp.u9", 0x200000, 0x412b9913, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "dwpc_v100jp.u7", 0x200000, 0x5cf9bada, 5 | BRF_SND }, // 6 Samples - - { "dw2001_igs027a_japan.bin", 0x004000, 0x3a79159b, 7 | BRF_PRG }, // 7 Internal ARM7 rom - - { "dwpc_v100jp.u12", 0x080000, 0x0d112126, 8 | BRF_PRG | BRF_ESS }, // 8 External ARM7 rom -}; - -STDROMPICKEXT(dwpc, dwpc, pgm) -STD_ROM_FN(dwpc) - -struct BurnDriver BurnDrvdwpc = { - "dwpc", NULL, "pgm", NULL, "2001", - "Dragon World Pretty Chance (V101, Japan)\0", "Bad sound?", "IGS (Alta Co., LTD License)", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_PUZZLE, 0, - NULL, dwpcRomInfo, dwpcRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - dw2001Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Demon Front (V105) - -static struct BurnRomInfo dmnfrntRomDesc[] = { - // 1st dump (01/01/2006) : v105_32m.u26 size 4 194 304 crc 877cac84 - // - 1st and 2nd half identical crc 7c0690e1 - // 2nd dump (15/04/2009) : v105_32m.u26 size 4 194 304 crc d200ee63 - // - 1st half crc 341f0f22 - // - 2nd half crc 3ce2fe8a - // 3rd dump (21/11/2009) : chinese-v105.u62 size 4 194 304 crc c798c2ef - // - 1st half crc 7c0690e1 - // - 2nd half crc 3ce2fe8a - // Regarding these 3 dumps, only the 3rd is correct. Others are confirmed bad dumps. - { "v105_16m.u5", 0x200000, 0xbda083bd, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04501.u29", 0x800000, 0x900eaaac, 2 | BRF_GRA }, // 1 Tile data - - { "a04501.u3", 0x800000, 0x9741bea6, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04502.u4", 0x800000, 0xe104f405, 3 | BRF_GRA }, // 3 - { "a04503.u6", 0x800000, 0xbfd5cfe3, 3 | BRF_GRA }, // 4 - - { "b04501.u9", 0x800000, 0x29320b7d, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - { "b04502.u11", 0x200000, 0x578c00e9, 4 | BRF_GRA }, // 6 - - { "w04501.u5", 0x800000, 0x3ab58137, 5 | BRF_SND }, // 7 Samples - - { "dmnfrnt_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - - { "v105_32m.u26", 0x400000, 0xc798c2ef, 8 | BRF_PRG | BRF_ESS }, // 9 External ARM7 Rom -}; - -STDROMPICKEXT(dmnfrnt, dmnfrnt, pgm) -STD_ROM_FN(dmnfrnt) - -static void pgm_fake_internal_asic() -{ - UINT16 *mem16 = (UINT16 *)PGMARMROM; - - for (INT32 i = 0; i < 0x4000/2; i+=2) { - mem16[i + 0] = BURN_ENDIAN_SWAP_INT16(0xff1e); - mem16[i + 1] = BURN_ENDIAN_SWAP_INT16(0xe12f); - } - - mem16[0x000000 / 2] = BURN_ENDIAN_SWAP_INT16(0xd088); - mem16[0x000002 / 2] = BURN_ENDIAN_SWAP_INT16(0xe59f); - mem16[0x000004 / 2] = BURN_ENDIAN_SWAP_INT16(0x0680); - mem16[0x000006 / 2] = BURN_ENDIAN_SWAP_INT16(0xe3a0); - mem16[0x000008 / 2] = BURN_ENDIAN_SWAP_INT16(0xff10); - mem16[0x00000a / 2] = BURN_ENDIAN_SWAP_INT16(0xe12f); - mem16[0x000090 / 2] = BURN_ENDIAN_SWAP_INT16(0x0400); - mem16[0x000092 / 2] = BURN_ENDIAN_SWAP_INT16(0x1000); -} - -static void dmfrntCallback() -{ - pgm_decrypt_dfront(); - pgm_fake_internal_asic(); -} - -static INT32 dmnfrntInit() -{ - pPgmInitCallback = dmfrntCallback; //pgm_decrypt_dfront; - pPgmProtCallback = install_protection_asic27a_svg; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x8000fb4); - - return nRet; -} - -struct BurnDriver BurnDrvDmnfrnt = { - "dmnfrnt", NULL, "pgm", NULL, "2002", - "Demon Front (V105)\0", NULL, "IGS", "PolyGameMaster", - L"Demon Front\0\u9B54\u57DF\u6218\u7EBF\0\u9B54\u57DF\u6230\u7DDA (V105)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_PLATFORM, 0, - NULL, dmnfrntRomInfo, dmnfrntRomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - dmnfrntInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Demon Front (V103) - -static struct BurnRomInfo dmnfrntbRomDesc[] = { - { "v103_16m.u5", 0x200000, 0x2ddafb3d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04501.u29", 0x800000, 0x900eaaac, 2 | BRF_GRA }, // 1 Tile data - - { "a04501.u3", 0x800000, 0x9741bea6, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04502.u4", 0x800000, 0xe104f405, 3 | BRF_GRA }, // 3 - { "a04503.u6", 0x800000, 0xbfd5cfe3, 3 | BRF_GRA }, // 4 - - { "b04501.u9", 0x800000, 0x29320b7d, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - { "b04502.u11", 0x200000, 0x578c00e9, 4 | BRF_GRA }, // 6 - - { "w04501.u5", 0x800000, 0x3ab58137, 5 | BRF_SND }, // 7 Samples - - { "dmnfrnt_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - - { "v103_32m.u26", 0x400000, 0xe78383a3, 8 | BRF_PRG | BRF_ESS }, // 9 External ARM7 Rom -}; - -STDROMPICKEXT(dmnfrntb, dmnfrntb, pgm) -STD_ROM_FN(dmnfrntb) - -struct BurnDriver BurnDrvdmnfrntb = { - "dmnfrntb", "dmnfrnt", "pgm", NULL, "2002", - "Demon Front (V103)\0", NULL, "IGS", "PolyGameMaster", - L"Demon Front\0\u9B54\u57DF\u6218\u7EBF\0\u9B54\u57DF\u6230\u7DDA (V103)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_PLATFORM, 0, - NULL, dmnfrntbRomInfo, dmnfrntbRomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - dmnfrntInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Demon Front (V102, China) - -static struct BurnRomInfo dmnfrntaRomDesc[] = { - { "v102_16m.u5", 0x200000, 0x3d4d481a, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04501.u29", 0x800000, 0x900eaaac, 2 | BRF_GRA }, // 1 Tile data - - { "a04501.u3", 0x800000, 0x9741bea6, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04502.u4", 0x800000, 0xe104f405, 3 | BRF_GRA }, // 3 - { "a04503.u6", 0x800000, 0xbfd5cfe3, 3 | BRF_GRA }, // 4 - - { "b04501.u9", 0x800000, 0x29320b7d, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - { "b04502.u11", 0x200000, 0x578c00e9, 4 | BRF_GRA }, // 6 - - { "w04501.u5", 0x800000, 0x3ab58137, 5 | BRF_SND }, // 7 Samples - - { "dmnfrnt_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - - { "v101_32m.u26", 0x400000, 0x93965281, 8 | BRF_PRG | BRF_ESS }, // 9 External ARM7 Rom -}; - -STDROMPICKEXT(dmnfrnta, dmnfrnta, pgm) -STD_ROM_FN(dmnfrnta) - -struct BurnDriver BurnDrvdmnfrnta = { - "dmnfrnta", "dmnfrnt", "pgm", NULL, "2002", - "Demon Front (V102, China)\0", NULL, "IGS", "PolyGameMaster", - L"Demon Front\0\u9B54\u57DF\u6218\u7EBF\0\u9B54\u57DF\u6230\u7DDA (V102, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_PLATFORM, 0, - NULL, dmnfrntaRomInfo, dmnfrntaRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - dmnfrntInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// The Gladiator - Road Of The Sword / Shen Jian (V101) - -static struct BurnRomInfo thegladRomDesc[] = { - { "v101.u6", 0x080000, 0xf799e866, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04601.u33", 0x800000, 0xe5dab371, 2 | BRF_GRA }, // 1 Tile data - - { "a04601.u2", 0x800000, 0xd9b2e004, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04602.u4", 0x800000, 0x14f22308, 3 | BRF_GRA }, // 3 - { "a04603.u6", 0x800000, 0x8f621e17, 3 | BRF_GRA }, // 4 - - { "b04601.u11", 0x800000, 0xee72bccf, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - { "b04602.u12", 0x400000, 0x7dba9c38, 4 | BRF_GRA }, // 6 - - { "w04601.u1", 0x800000, 0x5f15ddb3, 5 | BRF_SND }, // 7 Samples - -// { "theglad_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "theglad_igs027a_execute_only_area", 0x000188, 0x00000000, 0 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "theglad_igs027a_v100_overseas.bin", 0x003e78, 0x02fe6f52, 7 | BRF_PRG | BRF_ESS }, // 9 - - { "v107.u26", 0x200000, 0xf7c61357, 8 | BRF_PRG | BRF_ESS }, // 10 External ARM7 Rom -}; - -STDROMPICKEXT(theglad, theglad, pgm) -STD_ROM_FN(theglad) - -static void pgm_create_theglad_EO_data() -{ - // Replace undumpable area of the arm7 internal rom with a custom-built - // version created by David Haywood in order to make game playable - static UINT16 thegladEOHackData[0x188/2] = { - 0x000a, 0xea00, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xf000, 0xe59f, - 0x0010, 0x0800, 0x0010, 0x0800, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0x00d2, 0xe3a0, 0xf000, 0xe121, 0x4001, 0xe3a0, 0x4b06, 0xe284, - 0x0cfa, 0xe3a0, 0xd804, 0xe080, 0x00d1, 0xe3a0, 0xf000, 0xe121, - 0x0cf6, 0xe3a0, 0xd804, 0xe080, 0x00d7, 0xe3a0, 0xf000, 0xe121, - 0x0cff, 0xe3a0, 0xd804, 0xe080, 0x00db, 0xe3a0, 0xf000, 0xe121, - 0x4140, 0xe1c4, 0x0cfe, 0xe3a0, 0xd804, 0xe080, 0x00d3, 0xe3a0, - 0xf000, 0xe121, 0x4a01, 0xe3a0, 0x0b01, 0xe3a0, 0xd804, 0xe080, - 0x5a0f, 0xe3a0, 0x0008, 0xe3a0, 0x8805, 0xe080, 0x0010, 0xe3a0, - 0x0000, 0xe5c8, 0x7805, 0xe1a0, 0x6a01, 0xe3a0, 0x0012, 0xe3a0, - 0x0a02, 0xe280, 0x6806, 0xe080, 0x6000, 0xe587, 0x00d3, 0xe3a0, - 0xf000, 0xe121, 0x4001, 0xe3a0, 0x4b06, 0xe284, 0x0cf2, 0xe3a0, - 0xd804, 0xe080, 0x0013, 0xe3a0, 0xf000, 0xe121, 0x0028, 0xea00, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xe004, 0xe52d, 0x00d3, 0xe3a0, - 0xf000, 0xe121, 0xe004, 0xe49d, 0xff1e, 0xe12f, 0xe004, 0xe52d, - 0x0013, 0xe3a0, 0xf000, 0xe121, 0xe004, 0xe49d, 0xff1e, 0xe12f, - 0x00d1, 0xe3a0, 0xf000, 0xe121, 0xd0b8, 0xe59f, 0x00d3, 0xe3a0, - 0xf000, 0xe121, 0xd0b0, 0xe59f, 0x10b8, 0xe59f, 0x0000, 0xe3a0, - 0x0000, 0xe581, 0xf302, 0xe3a0, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xff1e, 0xe12f, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0x105c, 0xe59f - }; - - for (int i = 0; i < 0x188/2; i++) { - thegladEOHackData[i] = BURN_ENDIAN_SWAP_INT16(thegladEOHackData[i]); - } - - memcpy (PGMARMROM, thegladEOHackData, 0x188); -} - -static void thegladPatch() -{ - pgm_decrypt_theglad(); - pgm_create_theglad_EO_data(); -} - -static INT32 thegladInit() -{ - nPgmAsicRegionHackAddress = 0x3316; - pPgmInitCallback = thegladPatch; - pPgmProtCallback = install_protection_asic27a_svg; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x000007c4); - - return nRet; -} - -struct BurnDriver BurnDrvTheglad = { - "theglad", NULL, "pgm", NULL, "2003", - "The Gladiator - Road Of The Sword / Shen Jian (V101)\0", "Incomplete Dump", "IGS", "PolyGameMaster", - L"The Gladiator - Road of The Sword\0\u795E\u5251\u98CE\u4E91\0\u795E\u528D\u98A8\u96F2 (V101)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, thegladRomInfo, thegladRomName, NULL, NULL, pgmInputInfo, thegladDIPInfo, - thegladInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// The Gladiator - Road Of The Sword / Shen Jian (V100) - -static struct BurnRomInfo theglad101RomDesc[] = { - { "v100.u6", 0x080000, 0xbcf3b172, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04601.u33", 0x800000, 0xe5dab371, 2 | BRF_GRA }, // 1 Tile data - - { "a04601.u2", 0x800000, 0xd9b2e004, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04602.u4", 0x800000, 0x14f22308, 3 | BRF_GRA }, // 3 - { "a04603.u6", 0x800000, 0x8f621e17, 3 | BRF_GRA }, // 4 - - { "b04601.u11", 0x800000, 0xee72bccf, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - { "b04602.u12", 0x400000, 0x7dba9c38, 4 | BRF_GRA }, // 6 - - { "w04601.u1", 0x800000, 0x5f15ddb3, 5 | BRF_SND }, // 7 Samples - -// { "theglad_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "theglad_igs027a_execute_only_area", 0x000188, 0x00000000, 0 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "theglad_igs027a_v100_overseas.bin", 0x003e78, 0x02fe6f52, 7 | BRF_PRG | BRF_ESS }, // 9 - - { "v101.u26", 0x200000, 0x23faec02, 8 | BRF_PRG | BRF_ESS }, // 10 External ARM7 Rom -}; - -STDROMPICKEXT(theglad101, theglad101, pgm) -STD_ROM_FN(theglad101) - -struct BurnDriver BurnDrvTheglad101 = { - "theglad101", "theglad", "pgm", NULL, "2003", - "The Gladiator - Road Of The Sword / Shen Jian (V100)\0", "Incomplete Dump", "IGS", "PolyGameMaster", - L"The Gladiator - Road of The Sword\0\u795E\u5251\u98CE\u4E91\0\u795E\u528D\u98A8\u96F2 (V100)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, theglad101RomInfo, theglad101RomName, NULL, NULL, pgmInputInfo, thegladDIPInfo, - thegladInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// The Gladiator - Road of The Sword / Shen Jian (V100, Taiwan) - -static struct BurnRomInfo theglad100RomDesc[] = { - { "u6.rom", 0x080000, 0x14c85212, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04601.u33", 0x800000, 0xe5dab371, 2 | BRF_GRA }, // 1 Tile data - - { "a04601.u2", 0x800000, 0xd9b2e004, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04602.u4", 0x800000, 0x14f22308, 3 | BRF_GRA }, // 3 - { "a04603.u6", 0x800000, 0x8f621e17, 3 | BRF_GRA }, // 4 - - { "b04601.u11", 0x800000, 0xee72bccf, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - { "b04602.u12", 0x400000, 0x7dba9c38, 4 | BRF_GRA }, // 6 - - { "w04601.u1", 0x800000, 0x5f15ddb3, 5 | BRF_SND }, // 7 Samples - -// { "theglad_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "theglad_igs027a_execute_only_area", 0x000188, 0x00000000, 0 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "theglad_igs027a_older.bin", 0x003e78, 0x02fe6f52, 7 | BRF_PRG | BRF_ESS }, // 9 - - { "u2.rom", 0x200000, 0xc7bcf2ae, 8 | BRF_PRG | BRF_ESS }, // 9 External ARM7 Rom -}; - -STDROMPICKEXT(theglad100, theglad100, pgm) -STD_ROM_FN(theglad100) - -static void theglad100Patch() -{ - pgm_decrypt_theglad(); - pgm_create_theglad_EO_data(); - - // Hack the jump table in the external rom to work correctly with the internal rom we have... - static const UINT16 subroutine_addresses[] = { - 0x00FC, 0x00E8, 0x0110, 0x0150, 0x0194, 0x06C8, 0x071C, 0x0728, - 0x0734, 0x0740, 0x0784, 0x0794, 0x07FC, 0x0840, 0x086C, 0x0988, - 0x0A54, 0x0AA8, 0x0AD4, 0x0EB8, 0x0EF8, 0x0F2C, 0x0F3C, 0x0F78, - 0x0FA8, 0x0FD8, 0x1028, 0x1038, 0x1048, 0x1058, 0x1068, 0x1070, - 0x1090, 0x10B0, 0x10D4, 0x1100, 0x113C, 0x1198, 0x1234, 0x1258, - 0x127C, 0x12A8, 0x12E4, 0x1368, 0x142C, 0x0B10, 0x0B54, 0x0B74, - 0x0C08, 0x0C90, 0x0D18, 0x0D90, 0x1570, 0x1600, 0x1640, 0x1694, - 0x1730, 0x176C, 0x17AC, 0x17D8, 0x18C4, 0x18E0, 0x1904, 0x1930, - 0x19D8, 0x1A38, 0x1950, 0x1970, 0x1990, 0x19B8, 0x19C8, 0x1A9C, - 0x1AC4, 0x1AE8, 0x1B20, 0x1B48, 0x1B70, 0x1B8C, 0x1BB4, 0x1BD8, - 0x1BFC, 0x1C10, 0x1C24, 0x1CA0, 0x1D5C, 0x1D7C, 0x1D8C, 0x1DAC, - 0x1DCC, 0x1DE0, 0x1DF4, 0x1E1C, 0x1E2C, 0x1E60, 0x1E94, 0x1EA4, - 0x1ECC, 0x1ED8, 0x1EE4, 0x1F14, 0x1F44, 0x1FB4, 0x1FC4, 0x2040, - 0x20BC, 0x2140, 0x21C4, 0x2240, 0x22BC, 0x2340, 0x23C4, 0x23D0, - 0x2400, 0x2430, 0x244C, 0x245C, 0x246C, 0x2FCC, 0x3000, 0x3028, - 0x3050, 0x30A4, 0x30F8, 0x3120, 0x249C, 0x24C0, 0x27BC, 0x2B40, - 0x2BF4, 0x2CD8, 0x2E2C - }; - - UINT16 *extprot = (UINT16 *)PGMUSER0; - - for (int i = 0; i < 131; i++) - { - extprot[((0x82078 + (i * 4)) / 2)] = (subroutine_addresses[i]); - } -} - -static INT32 theglad100Init() -{ - nPgmAsicRegionHackAddress = 0x3316; - pPgmInitCallback = theglad100Patch; - pPgmProtCallback = install_protection_asic27a_svg; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x000007c4); - - return nRet; -} - -struct BurnDriver BurnDrvtheglada = { - "theglad100", "theglad", "pgm", NULL, "2003", - "The Gladiator - Road Of The Sword / Shen Jian (V100, Taiwan)\0", "Incomplete Dump", "IGS", "PolyGameMaster", - L"The Gladiator - Road Of The Sword\0\u795E\u5251\u98CE\u4E91\0\u795E\u528D\u98A8\u96F2 (V100, Taiwan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, theglad100RomInfo, theglad100RomName, NULL, NULL, pgmInputInfo, theglad100DIPInfo, - theglad100Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Photo Y2K 2 (3-in-1) - -static struct BurnRomInfo pgm3in1RomDesc[] = { - { "v-100cn.u3", 0x200000, 0xa39f59b4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "u5.u5", 0x200000, 0xda375a50, 2 | BRF_GRA }, // 1 Tile data - - { "pgm_a1100.u4", 0x800000, 0xe32ce499, 3 | BRF_GRA }, // 2 Sprite Color Data - { "pgm_a1101.u5", 0x800000, 0x4e7568bc, 3 | BRF_GRA }, // 3 - { "pgm_a1102.u6", 0x800000, 0x6da7c143, 3 | BRF_GRA }, // 4 - { "pgm_a1103.u7", 0x800000, 0x0ebebfdc, 3 | BRF_GRA }, // 4 - { "ext_bit_cg.u20", 0x400000, 0xfe314754, 3 | BRF_GRA }, // 6 - - { "pgm_b1100.u8", 0x800000, 0xfa53d6f6, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "pgm_b1101.u9", 0x800000, 0x001e4c81, 4 | BRF_GRA }, // 8 - { "ext_bit_map.u21", 0x200000, 0xfe31dca6, 4 | BRF_GRA }, // 9 - - { "pgm_m1100.u17", 0x200000, 0xfb1515f8, 5 | BRF_SND }, // 10 Samples - { "u16.u16", 0x800000, 0x714c33e5, 5 | BRF_SND }, // 11 - - { "igs027a_pgm3in1.asic", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 12 Internal ARM7 Rom -}; - -STDROMPICKEXT(pgm3in1, pgm3in1, pgm) -STD_ROM_FN(pgm3in1) - -static INT32 pgm3in1Init() -{ - pPgmInitCallback = pgm_decrypt_pgm3in1; - pPgmProtCallback = install_protection_asic27a_py2k2; -// pPgmProtCallback = install_protection_asic27a_kovsh; - - return pgmInit(); -} - -struct BurnDriverD BurnDrvPgm3in1 = { - "pgm3in1", NULL, "pgm", NULL, "2001", - "Photo Y2K 2 (3-in-1)\0", "Incomplete dump", "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_PUZZLE, 0, - NULL, pgm3in1RomInfo, pgm3in1RomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - pgm3in1Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Happy 6-in-1 (V102 - V101MK, China) - -static struct BurnRomInfo happy6RomDesc[] = { - { "v101cn.u5", 0x080000, 0xaa4646e3, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t01w64m.u29", 0x800000, 0x2d3feb8b, 2 | BRF_GRA }, // 1 Tile data - - { "a01w64m.u5", 0x800000, 0xbbaa3df3, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a02w64m.u6", 0x800000, 0xf8c9cd36, 3 | BRF_GRA }, // 3 - - { "b01w64m.u19", 0x800000, 0x73f5f225, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "w01w64m.u17", 0x800000, 0x7e23e2be, 5 | BRF_SND }, // 5 Samples - -// { "happy6_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "happy6_igs027a_execute_only_area", 0x000188, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - { "happy6_igs027a_v100_china.bin", 0x003e78, 0xed530445, 7 | BRF_PRG | BRF_ESS }, // 7 - - { "v102cn.u26", 0x400000, 0x310510fb, 8 | BRF_PRG | BRF_ESS }, // 8 External ARM7 Rom -}; - -STDROMPICKEXT(happy6, happy6, pgm) -STD_ROM_FN(happy6) - -static void happy6Patch() -{ - pgm_decrypt_happy6(); - pgm_create_theglad_EO_data(); - pgm_descramble_happy6_data(PGMSPRMaskROM, 0x800000); - pgm_descramble_happy6_data(ICSSNDROM + 0x400000, 0x800000); -} - -static INT32 happy6in1Init() -{ - pPgmInitCallback = happy6Patch; - pPgmProtCallback = install_protection_asic27a_svg; - - nPgmAsicRegionHackAddress = 0x3586; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x00000a08); - - return nRet; -} - -struct BurnDriver BurnDrvhappy6 = { - "happy6", NULL, "pgm", NULL, "2004", - "Happy 6-in-1 (V102 - V101MK, China)\0", NULL, "IGS", "PolyGameMaster", - L"Happy 6-in-1\0\u6B22\u4E50\u516D\u5408\u4E00 (V102 - V101MK, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_MISC, 0, - NULL, happy6RomInfo, happy6RomName, NULL, NULL, pgmInputInfo, happy6DIPInfo, - happy6in1Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Happy 6-in-1 (V101 - V100MK, China) - -static struct BurnRomInfo happy6101RomDesc[] = { - { "happy6in1_v100cn.u5", 0x080000, 0xa25418e8, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t01w64m.u29", 0x800000, 0x2d3feb8b, 2 | BRF_GRA }, // 1 Tile data - - { "a01w64m.u5", 0x800000, 0xbbaa3df3, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a02w64m.u6", 0x800000, 0xf8c9cd36, 3 | BRF_GRA }, // 3 - - { "b01w64m.u19", 0x800000, 0x73f5f225, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "w01w64m.u17", 0x800000, 0x7e23e2be, 5 | BRF_SND }, // 5 Samples - -// { "happy6_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "happy6_igs027a_execute_only_area", 0x000188, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - { "happy6_igs027a_v100_china.bin", 0x003e78, 0xed530445, 7 | BRF_PRG | BRF_ESS }, // 7 - - { "happy6in1_v101cn.u26", 0x400000, 0x4a48ca1c, 8 | BRF_PRG | BRF_ESS }, // 8 External ARM7 Rom -}; - -STDROMPICKEXT(happy6101, happy6101, pgm) -STD_ROM_FN(happy6101) - -struct BurnDriver BurnDrvhappy6101 = { - "happy6101", "happy6", "pgm", NULL, "2004", - "Happy 6-in-1 (V101 - V100MK, China)\0", "Incomplete Dump", "IGS", "PolyGameMaster", - L"Happy 6-in-1\0\u6B22\u4E50\u516D\u5408\u4E00 (V101 - V100MK, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_MISC, 0, - NULL, happy6101RomInfo, happy6101RomName, NULL, NULL, pgmInputInfo, happy6DIPInfo, - happy6in1Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Super Heroes Plus / Sangoku Senki Super Heroes Plus (ver. 101) - -static struct BurnRomInfo kovshpRomDesc[] = { - { "p0600h_101.rom", 0x400000, 0xe1d89a19, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0540.rom", 0x800000, 0x4fd3413e, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b0540.rom", 0x800000, 0x60999757, 4 | BRF_GRA }, // 7 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 8 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovshp, kovshp, pgm) -STD_ROM_FN(kovshp) - -static void kovshp_asic_patch() -{ - *((UINT16*)(PGMARMROM + 0x2892)) = BURN_ENDIAN_SWAP_INT16(0x0101); - *((UINT16*)(PGMARMROM + 0x289e)) = BURN_ENDIAN_SWAP_INT16(0x0107); - *((UINT16*)(PGMARMROM + 0x28a4)) = BURN_ENDIAN_SWAP_INT16(0x0108); - *((UINT16*)(PGMARMROM + 0x28a8)) = BURN_ENDIAN_SWAP_INT16(0x0101); - *((UINT16*)(PGMARMROM + 0x2bf2)) = BURN_ENDIAN_SWAP_INT16(0x4810); - *((UINT16*)(PGMARMROM + 0x2bf4)) = BURN_ENDIAN_SWAP_INT16(0x800e); - *((UINT16*)(PGMARMROM + 0x2c92)) = BURN_ENDIAN_SWAP_INT16(0x400f); - *((UINT16*)(PGMARMROM + 0x2ce0)) = BURN_ENDIAN_SWAP_INT16(0x6c1e); - *((UINT16*)(PGMARMROM + 0x2ce2)) = BURN_ENDIAN_SWAP_INT16(0x0048); - - for (INT32 i = 0x2ce8; i < 0x2e48; i+=8) { // fix z80 data offsets (offset - 0x9e000) - UINT16 d = ((PGMARMROM[i+4] << 8) + (PGMARMROM[i+7] << 0)) - 0x09e0; - - PGMARMROM[i+4] = d >> 8; - PGMARMROM[i+7] = d & 0xff; - }; -} - -static void kovshpCallback() -{ - pgm_decrypt_kovshp(); - kovshp_asic_patch(); -} - -static INT32 kovshpInit() -{ - pPgmInitCallback = kovshpCallback; // pgm_decrypt_kovshp; - pPgmProtCallback = install_protection_asic27a_kovshp; - - nPgmAsicRegionHackAddress = 0x3f0d; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x00000260); - - return nRet; -} - -struct BurnDriver BurnDrvkovshp = { - "kovshp", NULL, "pgm", NULL, "2004", - "Knights of Valour Super Heroes Plus / Sangoku Senki Super Heroes Plus (ver. 101)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster", - L"Knights of Valour Super Heroes Plus\0\u4E09\u56FD\u6218\u7EAA\0\u4E71\u4E16\u67AD\u96C4 (ver. 101)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovshpRomInfo, kovshpRomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovshpInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Super Heroes Plus / Sangoku Senki Super Heroes Plus (ver. 100) - -static struct BurnRomInfo kovshpaRomDesc[] = { - { "p0600h.rom", 0x400000, 0xe251e8e4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0540.rom", 0x800000, 0x4fd3413e, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b0540.rom", 0x800000, 0x60999757, 4 | BRF_GRA }, // 7 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 8 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovshpa, kovshpa, pgm) -STD_ROM_FN(kovshpa) - -struct BurnDriver BurnDrvkovshpa = { - "kovshpa", "kovshp", "pgm", NULL, "2004", - "Knights of Valour Super Heroes Plus / Sangoku Senki Super Heroes Plus (ver. 100)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster", - L"Knights of Valour Super Heroes Plus\0\u4E09\u56FD\u6218\u7EAA\0\u4E71\u4E16\u67AD\u96C4 (ver. 100)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovshpaRomInfo, kovshpaRomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovshpInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Yi Tong Zhong Yuan / Sangoku Senki: Yi Tong Zhong Yuan (ver. 201, China) - -static struct BurnRomInfo kovytzyRomDesc[] = { - { "ytzy_v201cn.rom", 0x400000, 0xf3705ea0, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0540.rom", 0x800000, 0x4fd3413e, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b0540.rom", 0x800000, 0x60999757, 4 | BRF_GRA }, // 7 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 8 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovytzy, kovytzy, pgm) -STD_ROM_FN(kovytzy) - -struct BurnDriver BurnDrvkovytzy = { - "kovytzy", NULL, "pgm", NULL, "1999", - "Knights of Valour: Yi Tong Zhong Yuan / Sangoku Senki: Yi Tong Zhong Yuan (ver. 201, China)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster", - L"Knights of Valour: Yi Tong Zhong Yuan\0\u4E09\u56FD\u6218\u7EAA\0\u4E00\u7EDF\u4E2D\u539F (ver. 201, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovytzyRomInfo, kovytzyRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovshpInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Oriental Legend Special Plus / Xi You Shi E Zhuan Super Plus (ver. 205) - -static struct BurnRomInfo oldsplusRomDesc[] = { - { "p05301.rom", 0x400000, 0x923f7246, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t05301.rom", 0x800000, 0x8257bbb0, 2 | BRF_GRA }, // 1 Tile data - - { "a05301.rom", 0x800000, 0x57946fd2, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a05302.rom", 0x800000, 0x3459a0b8, 3 | BRF_GRA }, // 3 - { "a05303.rom", 0x800000, 0x13475d85, 3 | BRF_GRA }, // 4 - { "a05304.rom", 0x800000, 0xf03ef7a6, 3 | BRF_GRA }, // 5 - - { "b05301.rom", 0x800000, 0xfd98f503, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b05302.rom", 0x800000, 0x9f6094a8, 4 | BRF_GRA }, // 7 - - { "m05301.rom", 0x400000, 0x86ec83bc, 5 | BRF_SND }, // 8 Samples - - { "oldsplus_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(oldsplus, oldsplus, pgm) -STD_ROM_FN(oldsplus) - -static INT32 oldsplusInit() -{ - pPgmInitCallback = pgm_decrypt_oldsplus; - pPgmProtCallback = install_protection_asic27a_oldsplus; // simulation -// pPgmProtCallback = install_protection_asic27a_kovsh; - - return pgmInit(); -} - -struct BurnDriver BurnDrvoldsplus = { - "oldsplus", NULL, "pgm", NULL, "2004", - "Oriental Legend Special Plus / Xi You Shi E Zhuan Super Plus (ver. 205)\0", "Incomplete Dump", "IGS", "PolyGameMaster", - L"Oriental Legend Special Plus\0\u897F\u6E38\u91CA\u5384\u4F20\0\u7FA4\u9B54\u4E71\u821E (ver. 205)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, oldsplusRomInfo, oldsplusRomName, NULL, NULL, pgmInputInfo, puzzli2DIPInfo, - oldsplusInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// The Killing Blade Plus (V300) - -static struct BurnRomInfo killbldpRomDesc[] = { - { "v300x.u6", 0x080000, 0xb7fb8ec9, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t05701w032.bin", 0x400000, 0x567c714f, 2 | BRF_GRA }, // 1 Tile data - - { "a05701w064.bin", 0x800000, 0x8c0c992c, 3 | BRF_GRA }, // 3 Sprite Color Data - { "a05702w064.bin", 0x800000, 0x7e5b0f27, 3 | BRF_GRA }, // 4 - { "a05703w064.bin", 0x800000, 0xaccbdb44, 3 | BRF_GRA }, // 5 - - { "b05701w064.bin", 0x800000, 0xa20cdcef, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b05702w016.bin", 0x200000, 0xfe7457df, 4 | BRF_GRA }, // 7 - - { "w05701b032.bin", 0x400000, 0x2d3ae593, 5 | BRF_SND }, // 8 Samples - -// this is the original rom with the first 0x268 bytes from the bootleg - but it doesn't work? -// { "killbldp_igs027a.bin", 0x004000, 0xc7868d90, 7 | BRF_PRG }, // 9 Internal ARM7 Rom -// from a bootleg - { "killbldp_igs027a_alt.bin", 0x004000, 0x98316b06, 7 | BRF_PRG }, // 9 Internal ARM7 Rom - - { "v300x.u26", 0x200000, 0x144388c8, 8 | BRF_PRG | BRF_ESS }, // 10 External ARM7 Rom -}; - -STDROMPICKEXT(killbldp, killbldp, pgm) -STD_ROM_FN(killbldp) - -INT32 killbldpInit() -{ - pPgmInitCallback = pgm_decrypt_killbldp; - pPgmProtCallback = install_protection_asic27a_svg; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x00007c4); - - return nRet; -} - -struct BurnDriver BurnDrvKillbldp = { - "killbldp", NULL, "pgm", NULL, "2005", - "The Killing Blade Plus (V300)\0", NULL, "IGS", "PolyGameMaster", - L"The Killing Blade Plus \0\u50B2\u5251\u72C2\u5200\u00A0\u52A0\u5F3A\u7248 (V300)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VSFIGHT, 0, - NULL, killbldpRomInfo, killbldpRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - killbldpInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// S.V.G. - Spectral vs Generation (V200, China) - -static struct BurnRomInfo svgRomDesc[] = { - { "u30.bin", 0x080000, 0x34c18f3f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t05601w016.bin", 0x200000, 0x03e110dc, 2 | BRF_GRA }, // 1 Tile data - - { "a05601w064.bin", 0x800000, 0xea6453e4, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a05602w064.bin", 0x800000, 0x6d00621b, 3 | BRF_GRA }, // 3 - { "a05603w064.bin", 0x800000, 0x7b71c64f, 3 | BRF_GRA }, // 4 - { "a05604w032.bin", 0x400000, 0x9452a567, 3 | BRF_GRA }, // 5 - - { "b05601w064.bin", 0x800000, 0x35c0a489, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b05602w064.bin", 0x800000, 0x8aad3f85, 4 | BRF_GRA }, // 7 - - { "w05601b064.bin", 0x800000, 0xbfe61a71, 5 | BRF_SND }, // 8 Samples - { "w05602b032.bin", 0x400000, 0x0685166d, 5 | BRF_SND }, // 9 - -// { "svg_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 10 Internal ARM7 Rom - { "svg_igs027a_execute_only_area", 0x000188, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, // 10 Internal ARM7 Rom - { "svg_igs027a_v200_china.bin", 0x003e78, 0x72b73169, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom - - { "u26.bin", 0x400000, 0x46826ec8, 8 | BRF_PRG | BRF_ESS }, // 12 External ARM7 Rom - { "u29.bin", 0x400000, 0xfa5f3901, 8 | BRF_PRG | BRF_ESS }, // 13 -}; - -STDROMPICKEXT(svg, svg, pgm) -STD_ROM_FN(svg) - -static void pgm_create_svg_EO_data() -{ - // Replace undumpable area of the arm7 internal rom with a custom-built - // version created by David Haywood in order to make game playable - static UINT16 svgEOHackData[0x188/2] = { - 0x000a, 0xea00, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xf000, 0xe59f, - 0x0038, 0x0800, 0x0038, 0x0800, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0x00d2, 0xe3a0, 0xf000, 0xe121, 0x4001, 0xe3a0, 0x4b06, 0xe284, - 0x0cfa, 0xe3a0, 0xd804, 0xe080, 0x00d1, 0xe3a0, 0xf000, 0xe121, - 0x0cf6, 0xe3a0, 0xd804, 0xe080, 0x00d7, 0xe3a0, 0xf000, 0xe121, - 0x0cff, 0xe3a0, 0xd804, 0xe080, 0x00db, 0xe3a0, 0xf000, 0xe121, - 0x4140, 0xe1c4, 0x0cfe, 0xe3a0, 0xd804, 0xe080, 0x00d3, 0xe3a0, - 0xf000, 0xe121, 0x4a01, 0xe3a0, 0x0b01, 0xe3a0, 0xd804, 0xe080, - 0x5a0f, 0xe3a0, 0x0008, 0xe3a0, 0x8805, 0xe080, 0x0010, 0xe3a0, - 0x0000, 0xe5c8, 0x7805, 0xe1a0, 0x6a01, 0xe3a0, 0x0012, 0xe3a0, - 0x0a02, 0xe280, 0x6806, 0xe080, 0x6000, 0xe587, 0x00d3, 0xe3a0, - 0xf000, 0xe121, 0x4001, 0xe3a0, 0x4b06, 0xe284, 0x0cf2, 0xe3a0, - 0xd804, 0xe080, 0x0013, 0xe3a0, 0xf000, 0xe121, 0x0028, 0xea00, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xe004, 0xe52d, 0x00d3, 0xe3a0, - 0xf000, 0xe121, 0xe004, 0xe49d, 0xff1e, 0xe12f, 0xe004, 0xe52d, - 0x0013, 0xe3a0, 0xf000, 0xe121, 0xe004, 0xe49d, 0xff1e, 0xe12f, - 0x00d1, 0xe3a0, 0xf000, 0xe121, 0xd0b8, 0xe59f, 0x00d3, 0xe3a0, - 0xf000, 0xe121, 0xd0b0, 0xe59f, 0x10b8, 0xe59f, 0x0000, 0xe3a0, - 0x0000, 0xe581, 0xf0b0, 0xe59f, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xff1e, 0xe12f, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, 0xfffe, 0xeaff, - 0xfffe, 0xeaff, 0x105c, 0xe59f - }; - - for (int i = 0; i < 0x188/2; i++) { - svgEOHackData[i] = BURN_ENDIAN_SWAP_INT16(svgEOHackData[i]); - } - - memcpy (PGMARMROM, svgEOHackData, 0x188); -} - -static void svgPatch() -{ - pgm_decrypt_svg(); - pgm_create_svg_EO_data(); -} - -static INT32 svgInit() -{ - pPgmInitCallback = svgPatch; - pPgmProtCallback = install_protection_asic27a_svg; - - nPgmAsicRegionHackAddress = 0x3c3e; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x0000B90); - - return nRet; -} - -struct BurnDriver BurnDrvSvg = { - "svg", NULL, "pgm", NULL, "2005", - "S.V.G. - Spectral vs Generation (V200, China)\0", NULL, "IGS", "PolyGameMaster", - L"S.V.G. - Spectral vs Generation\0\u5723\u9B54\u4E16\u7EAA (V200, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, svgRomInfo, svgRomName, NULL, NULL, pgmInputInfo, svgDIPInfo, - svgInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// S.V.G. - Spectral vs Generation (V100, Taiwan) - -static struct BurnRomInfo svgtwRomDesc[] = { - { "v101tw.u30", 0x080000, 0x8d0405e4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t05601w016.bin", 0x200000, 0x03e110dc, 2 | BRF_GRA }, // 1 Tile data - - { "a05601w064.bin", 0x800000, 0xea6453e4, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a05602w064.bin", 0x800000, 0x6d00621b, 3 | BRF_GRA }, // 3 - { "a05603w064.bin", 0x800000, 0x7b71c64f, 3 | BRF_GRA }, // 4 - { "a05604w032.bin", 0x400000, 0x9452a567, 3 | BRF_GRA }, // 5 - - { "b05601w064.bin", 0x800000, 0x35c0a489, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b05602w064.bin", 0x800000, 0x8aad3f85, 4 | BRF_GRA }, // 7 - - { "w05601b064.bin", 0x800000, 0xbfe61a71, 5 | BRF_SND }, // 8 Samples - { "w05602b032.bin", 0x400000, 0x0685166d, 5 | BRF_SND }, // 9 - -// { "svg_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 10 Internal ARM7 Rom - { "svgpcb_igs027a_execute_only_area", 0x000188, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, // 10 Internal ARM7 Rom - { "svgcpb_igs027a_v100_japan.bin", 0x003e78, 0x7a59da5d, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom - - { "v101tw.u26", 0x400000, 0xcc24f542, 8 | BRF_PRG | BRF_ESS }, // 12 External ARM7 Rom - { "v101tw.u36", 0x400000, 0xf18283e2, 8 | BRF_PRG | BRF_ESS }, // 13 -}; - -STDROMPICKEXT(svgtw, svgtw, pgm) -STD_ROM_FN(svgtw) - -static void svgtwPatch() -{ - pgm_decrypt_svgpcb(); - pgm_create_theglad_EO_data(); -} - -static INT32 svgtwInit() -{ - pPgmInitCallback = svgtwPatch; - pPgmProtCallback = install_protection_asic27a_svg; - - nPgmAsicRegionHackAddress = 0x3a8e; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x00009e0); - - return nRet; -} - -struct BurnDriverD BurnDrvSvgtw = { - "svgtw", "svg", "pgm", NULL, "2005", - "S.V.G. - Spectral vs Generation (V100, Taiwan)\0", "Incomplete dump", "IGS", "PolyGameMaster", - L"S.V.G. - Spectral vs Generation\0\u5723\u9B54\u4E16\u7EAA (V100, Taiwan)\0", NULL, NULL, NULL, - BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, svgtwRomInfo, svgtwRomName, NULL, NULL, pgmInputInfo, svgtwDIPInfo, - svgtwInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// ----------------------------------------------------------------------------- -// PCB Versions - - -// DoDonPachi Dai-Ou-Jou (V101, Japan) - -static struct BurnRomInfo ddp3RomDesc[] = { - { "ddp3_v101.u36", 0x200000, 0x195b5c1e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04401w064.u19", 0x800000, 0x3a95f19c, 2 | BRF_GRA }, // 1 Tile data - - { "a04401w064.u7", 0x800000, 0xed229794, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04402w064.u8", 0x800000, 0x752167b0, 3 | BRF_GRA }, // 3 - - { "b04401w064.u1", 0x800000, 0x8cbff066, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04401b032.u17", 0x400000, 0x5a0dbd76, 5 | BRF_SND }, // 5 Samples - - { "ddp3_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ddp3_defaults.nv", 0x020000, 0x571e96c0, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ddp3, ddp3, ddp3Bios) // custom bios -STD_ROM_FN(ddp3) - -static INT32 ddp3Init() -{ - pPgmInitCallback = pgm_decrypt_py2k2; - pPgmProtCallback = install_protection_asic27a_ddp3; // simulation - - return pgmInit(); -} - -struct BurnDriver BurnDrvDdp3 = { - "ddpdoj", NULL, NULL, NULL, "2002", - "DoDonPachi Dai-Ou-Jou (V101, Japan)\0", NULL, "Cave / AMI", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_IGS_PGM /* | HARDWARE_IGS_USE_ARM_CPU */, GBF_VERSHOOT, 0, - NULL, ddp3RomInfo, ddp3RomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ddp3Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// DoDonPachi Dai-Ou-Jou (V100 (second version), Japan) - -static struct BurnRomInfo ddp3aRomDesc[] = { - { "ddp3_d_d_1_0.u36", 0x200000, 0x5D3F85BA, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04401w064.u19", 0x800000, 0x3a95f19c, 2 | BRF_GRA }, // 1 Tile data - - { "a04401w064.u7", 0x800000, 0xed229794, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04402w064.u8", 0x800000, 0x752167b0, 3 | BRF_GRA }, // 3 - - { "b04401w064.u1", 0x800000, 0x8cbff066, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04401b032.u17", 0x400000, 0x5a0dbd76, 5 | BRF_SND }, // 5 Samples - - { "ddp3_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ddp3_defaults.nv", 0x020000, 0x571e96c0, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ddp3a, ddp3a, ddp3Bios) // custom bios -STD_ROM_FN(ddp3a) - -struct BurnDriver BurnDrvDdp3a = { - "ddpdoja", "ddpdoj", NULL, NULL, "2002", - "DoDonPachi Dai-Ou-Jou (V100 (second version), Japan)\0", NULL, "Cave / AMI", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_IGS_PGM /* | HARDWARE_IGS_USE_ARM_CPU */, GBF_VERSHOOT, 0, - NULL, ddp3aRomInfo, ddp3aRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ddp3Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// DoDonPachi Dai-Ou-Jou (V100 (first version), Japan) - -static struct BurnRomInfo ddp3bRomDesc[] = { - { "dd v100.bin", 0x200000, 0x7da0c1e4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04401w064.u19", 0x800000, 0x3a95f19c, 2 | BRF_GRA }, // 1 Tile data - - { "a04401w064.u7", 0x800000, 0xed229794, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04402w064.u8", 0x800000, 0x752167b0, 3 | BRF_GRA }, // 3 - - { "b04401w064.u1", 0x800000, 0x8cbff066, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04401b032.u17", 0x400000, 0x5a0dbd76, 5 | BRF_SND }, // 5 Samples - - { "ddp3_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ddp3_defaults.nv", 0x020000, 0x571e96c0, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ddp3b, ddp3b, ddp3Bios) // custom bios -STD_ROM_FN(ddp3b) - -struct BurnDriver BurnDrvDdp3b = { - "ddpdojb", "ddpdoj", NULL, NULL, "2002", - "DoDonPachi Dai-Ou-Jou (V100 (first version), Japan)\0", NULL, "Cave / AMI", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_IGS_PGM /* | HARDWARE_IGS_USE_ARM_CPU */, GBF_VERSHOOT, 0, - NULL, ddp3bRomInfo, ddp3bRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ddp3Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// DoDonPachi Dai-Ou-Jou Black Label (V100 (2002.10.07.Black Ver), Japan) - -static struct BurnRomInfo ddp3blkRomDesc[] = { - { "ddb_1dot.u45", 0x200000, 0x265f26cd, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04401w064.u19", 0x800000, 0x3a95f19c, 2 | BRF_GRA }, // 1 Tile data - - { "a04401w064.u7", 0x800000, 0xed229794, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04402w064.u8", 0x800000, 0x752167b0, 3 | BRF_GRA }, // 3 - - { "b04401w064.u1", 0x800000, 0x8cbff066, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04401b032.u17", 0x400000, 0x5a0dbd76, 5 | BRF_SND }, // 5 Samples - - { "ddp3_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ddp3blk_defaults.nv", 0x020000, 0xa1651904, 0 | BRF_OPT }, // 7 NV RAM (patch below instead) -}; - -STDROMPICKEXT(ddp3blk, ddp3blk, ddp3Bios) // custom bios -STD_ROM_FN(ddp3blk) - -static void ddp3blkPatchRAM() -{ - SekOpen(0); - SekWriteLong(0x803800, 0x95804803); - SekWriteLong(0x803804, 0x23879065); - SekClose(); - - // enable asic test -// *((UINT16*)(PGM68KROM + 0x03c0f4)) = BURN_ENDIAN_SWAP_INT16(0x0012); -} - -static INT32 ddp3blkInit() -{ - pPgmInitCallback = pgm_decrypt_py2k2; - pPgmProtCallback = install_protection_asic27a_ddp3; // simulation - - INT32 nRet = pgmInit(); - - if (nRet == 0) { - ddp3blkPatchRAM(); - } - - return nRet; -} - -struct BurnDriver BurnDrvDdp3blk = { - "ddpdojblk", "ddpdoj", NULL, NULL, "2002", - "DoDonPachi Dai-Ou-Jou Black Label (V100, (2002.10.07.Black Ver), Japan)\0", NULL, "Cave / AMI", "PolyGameMaster", - L"DoDonPachi Dai-Ou-Jou Black Label\0\u6012\u9996\u9818\u8702 \u5927\u5F80\u751F Black Label (V100 (2002.10.07.Black Ver), Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM /* | HARDWARE_IGS_USE_ARM_CPU */, GBF_VERSHOOT, 0, - NULL, ddp3blkRomInfo, ddp3blkRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ddp3blkInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// DoDonPachi Dai-Ou-Jou Black Label (V100 (2002.10.07 Black Ver), Japan) - -static struct BurnRomInfo ddp3blkaRomDesc[] = { - { "ddb10.u45", 0x200000, 0x72b35510, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04401w064.u19", 0x800000, 0x3a95f19c, 2 | BRF_GRA }, // 1 Tile data - - { "a04401w064.u7", 0x800000, 0xed229794, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04402w064.u8", 0x800000, 0x752167b0, 3 | BRF_GRA }, // 3 - - { "b04401w064.u1", 0x800000, 0x8cbff066, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04401b032.u17", 0x400000, 0x5a0dbd76, 5 | BRF_SND }, // 5 Samples - - { "ddp3_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ddp3blk_defaults.nv", 0x020000, 0xa1651904, 0 | BRF_OPT }, // 7 NV RAM (patch below instead) -}; - -STDROMPICKEXT(ddp3blka, ddp3blka, ddp3Bios) // custom bios -STD_ROM_FN(ddp3blka) - -struct BurnDriver BurnDrvDdp3blka = { - "ddpdojblka", "ddpdoj", NULL, NULL, "2002", - "DoDonPachi Dai-Ou-Jou Black Label (V100 (2002.10.07 Black Ver), Japan)\0", NULL, "Cave / AMI", "PolyGameMaster", - L"DoDonPachi Dai-Ou-Jou Black Label\0\u6012\u9996\u9818\u8702 \u5927\u5F80\u751F Black Label (V100 (2002.10.07 Black Ver), Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_IGS_PGM /* | HARDWARE_IGS_USE_ARM_CPU */, GBF_VERSHOOT, 0, - NULL, ddp3blkaRomInfo, ddp3blkaRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ddp3blkInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (Revision 2?, Japan) - -static struct BurnRomInfo ketRomDesc[] = { - { "ketsui_v100.u38", 0x200000, 0xdfe62f3b, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ket, ket, ketsuiBios) // custom bios -STD_ROM_FN(ket) - -static INT32 ketsuiInit() -{ - pPgmInitCallback = pgm_decrypt_ketsui; - pPgmProtCallback = install_protection_asic27a_ketsui; // simulation - - return pgmInit(); -} - -struct BurnDriver BurnDrvKet = { - "ket", NULL, NULL, NULL, "2002", - "Ketsui Kizuna Jigoku Tachi (Revision 2?, Japan)\0", NULL, "CAVE / AMI", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (Revision 2?, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketRomInfo, ketRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (Revision 2? alt, Japan) - -static struct BurnRomInfo ket1RomDesc[] = { - // alt version with 0xff fill in the unused area after 0x1443bc rather than random data, there are no code changes. - { "ketsui_v100_alt_fill.u38", 0x200000, 0xe140f8a4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ket1, ket1, ketsuiBios) // custom bios -STD_ROM_FN(ket1) - -struct BurnDriver BurnDrvKet1 = { - "ket1", "ket", NULL, NULL, "2002", - "Ketsui Kizuna Jigoku Tachi (Revision 2? alt, Japan)\0", NULL, "CAVE / AMI", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (Revision 2? alt, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ket1RomInfo, ket1RomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (Revision 1?, Japan) - -static struct BurnRomInfo ketaRomDesc[] = { - { "ketsui_prg_revised.bin", 0x200000, 0x69fcf5eb, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(keta, keta, ketsuiBios) // custom bios -STD_ROM_FN(keta) - -struct BurnDriver BurnDrvKeta = { - "keta", "ket", NULL, NULL, "2002", - "Ketsui Kizuna Jigoku Tachi (Revision 1?, Japan)\0", NULL, "CAVE / AMI", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (Revision 1?, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketaRomInfo, ketaRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (Original?, Japan) - -static struct BurnRomInfo ketbRomDesc[] = { - { "ketsui_prg_original.bin", 0x200000, 0xcca5e153, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ketb, ketb, ketsuiBios) // custom bios -STD_ROM_FN(ketb) - -struct BurnDriver BurnDrvKetb = { - "ketb", "ket", NULL, NULL, "2002", - "Ketsui Kizuna Jigoku Tachi (Original?, Japan)\0", NULL, "CAVE / AMI", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (Original?, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketbRomInfo, ketbRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (Arrange Mode version 1.7, hack by Trap15) - -static struct BurnRomInfo ketarrRomDesc[] = { - { "ketarr17_v100.u38", 0x200000, 0x2cb80b89, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ketarr, ketarr, ketsuiBios) // custom bios -STD_ROM_FN(ketarr) - -struct BurnDriver BurnDrvketarr = { - "ketarr", "ket", NULL, NULL, "2014", - "Ketsui Kizuna Jigoku Tachi (Arrange Mode version 1.7, hack by Trap15)\0", NULL, "hack / Trap15", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (Arrange Mode version 1.7, hack by Trap15)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HACK, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketarrRomInfo, ketarrRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (Arrange Mode version 1.0, hack by Trap15) - -static struct BurnRomInfo ketarr10RomDesc[] = { - { "ketarr_v100.u38", 0x200000, 0xd4c7a8ab, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ketarr10, ketarr10, ketsuiBios) // custom bios -STD_ROM_FN(ketarr10) - -struct BurnDriver BurnDrvketarr10 = { - "ketarr10", "ket", NULL, NULL, "2012", - "Ketsui Kizuna Jigoku Tachi (Arrange Mode version 1.0, hack by Trap15)\0", NULL, "hack / Trap15", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (Arrange Mode version 1.0, hack by Trap15)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HACK, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketarr10RomInfo, ketarr10RomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (Arrange Mode version 1.5, hack by Trap15) - -static struct BurnRomInfo ketarr15RomDesc[] = { - { "ketarr15_v100.u38", 0x200000, 0x552a7d95, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ketarr15, ketarr15, ketsuiBios) // custom bios -STD_ROM_FN(ketarr15) - -struct BurnDriver BurnDrvketarr15 = { - "ketarr15", "ket", NULL, NULL, "2012", - "Ketsui Kizuna Jigoku Tachi (Arrange Mode version 1.5, hack by Trap15)\0", NULL, "hack / Trap15", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (Arrange Mode version 1.5, hack by Trap15)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HACK, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketarr15RomInfo, ketarr15RomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (Arrange Mode version 1.51, hack by Trap15) - -static struct BurnRomInfo ketarr151RomDesc[] = { - { "ketarr151_v100.u38", 0x200000, 0x2b7c030d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ketarr151, ketarr151, ketsuiBios) // custom bios -STD_ROM_FN(ketarr151) - -struct BurnDriver BurnDrvketarr151 = { - "ketarr151", "ket", NULL, NULL, "2012", - "Ketsui Kizuna Jigoku Tachi (Arrange Mode version 1.51, hack by Trap15)\0", NULL, "hack / Trap15", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (Arrange Mode version 1.51, hack by Trap15)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HACK, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketarr151RomInfo, ketarr151RomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (MR. Stoic version 1.5, hack by Trap15) - -static struct BurnRomInfo ketarrs15RomDesc[] = { - { "ketarrs15_v100.u38", 0x200000, 0xa95e71e0, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ketarrs15, ketarrs15, ketsuiBios) // custom bios -STD_ROM_FN(ketarrs15) - -struct BurnDriver BurnDrvketarrs15 = { - "ketarrs15", "ket", NULL, NULL, "2012", - "Ketsui Kizuna Jigoku Tachi (MR. Stoic version 1.5, hack by Trap15)\0", NULL, "hack / Trap15", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (MR. Stoic version 1.5, hack by Trap15)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HACK, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketarrs15RomInfo, ketarrs15RomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (MR. Stoic version 1.51, hack by Trap15) - -static struct BurnRomInfo ketarrs151RomDesc[] = { - { "ketarrs151_v100.u38", 0x200000, 0x35c984e4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ketarrs151, ketarrs151, ketsuiBios) // custom bios -STD_ROM_FN(ketarrs151) - -struct BurnDriver BurnDrvketarrs151 = { - "ketarrs151", "ket", NULL, NULL, "2012", - "Ketsui Kizuna Jigoku Tachi (MR. Stoic version 1.51, hack by Trap15)\0", NULL, "hack / Trap15", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (MR. Stoic version 1.51, hack by Trap15)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HACK, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketarrs151RomInfo, ketarrs151RomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui Kizuna Jigoku Tachi (Fast version, hack by Trap15) - -static struct BurnRomInfo ketarrfRomDesc[] = { - { "ketarrf_v100.u38", 0x200000, 0x6ad17aa4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ket_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom - - { "ket_defaults.nv", 0x020000, 0x3ca892d8, 0 | BRF_OPT }, // 7 NV RAM -}; - -STDROMPICKEXT(ketarrf, ketarrf, ketsuiBios) // custom bios -STD_ROM_FN(ketarrf) - -struct BurnDriver BurnDrvketarrf = { - "ketarrf", "ket", NULL, NULL, "2012", - "Ketsui Kizuna Jigoku Tachi (Fast version, hack by Trap15)\0", NULL, "hack / Trap15", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (Fast version, hack by Trap15)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HACK, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, ketarrfRomInfo, ketarrfRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketsuiInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Espgaluda (V100, Japan) - -static struct BurnRomInfo espgalRomDesc[] = { - { "espgaluda_v100.u38", 0x200000, 0x08ecec34, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04801w064.u19", 0x800000, 0x6021c79e, 2 | BRF_GRA }, // 1 Tile data - - { "a04801w064.u7", 0x800000, 0x26dd4932, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04802w064.u8", 0x800000, 0x0e6bf7a9, 3 | BRF_GRA }, // 3 - - { "b04801w064.u1", 0x800000, 0x98dce13a, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "w04801b032.u17", 0x400000, 0x60298536, 5 | BRF_SND }, // 5 Samples - - { "espgal_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 6 Internal ARM7 Rom -}; - -STDROMPICKEXT(espgal, espgal, espgalBios) // custom bios -STD_ROM_FN(espgal) - -static INT32 espgalInit() -{ - pPgmInitCallback = pgm_decrypt_espgaluda; - pPgmProtCallback = install_protection_asic27a_ketsui; // simulation - - return pgmInit(); -} - -struct BurnDriver BurnDrvEspgal = { - "espgal", NULL, NULL, NULL, "2003", - "Espgaluda (V100, Japan)\0", NULL, "CAVE / AMI", "PolyGameMaster based", - L"Espgaluda\0\u30A8\u30B9\u30D7\u30AC\u30EB\u30FC\u30C0 (V100, Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_VERSHOOT, 0, - NULL, espgalRomInfo, espgalRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - espgalInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// The Gladiator - Road Of The Sword / Shen Jian (V100, Japan, PCB Version) - -static struct BurnRomInfo thegladpcbRomDesc[] = { - { "glad_v100.43", 0x080000, 0xbcf3b172, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04601.u71", 0x800000, 0xe5dab371, 2 | BRF_GRA }, // 1 Tile data - - { "a04601.u30", 0x800000, 0xd9b2e004, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04602.u31", 0x800000, 0x14f22308, 3 | BRF_GRA }, // 3 - { "a04603.u32", 0x800000, 0x8f621e17, 3 | BRF_GRA }, // 4 - - { "b04601.u40", 0x800000, 0xee72bccf, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - { "b04602.u41", 0x400000, 0x7dba9c38, 4 | BRF_GRA }, // 6 - - { "w04601.u8", 0x800000, 0x5f15ddb3, 5 | BRF_SND }, // 7 Samples - // these contain samples for the japan region - { "igs29.bin", 0x200000, 0x51acb395, 5 | BRF_SND }, // 8 - -// { "thegladpcb_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "thegladpcb_igs027a_execute_only_area", 0x000188, 0x00000000, 0 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - { "thegladpcb_igs027a_v100_japan.bin", 0x003e78, 0xd7f06e2d, 7 | BRF_PRG | BRF_ESS }, // 9 - - { "igs_v100.62", 0x200000, 0x0f3f511e, 8 | BRF_PRG | BRF_ESS }, // 10 External ARM7 Rom -}; - -STDROMPICKEXT(thegladpcb, thegladpcb, thegladBIOS) // custom bios -STD_ROM_FN(thegladpcb) - -struct BurnDriver BurnDrvThegladpcb = { - "thegladpcb", "theglad", NULL, NULL, "2003", - "The Gladiator - Road Of The Sword / Shen Jian (V100, Japan, Single PCB Version)\0", NULL, "IGS", "PolyGameMaster", - L"The Gladiator - Road Of The Sword\0\u795E\u5251\u98CE\u4E91\0\u795E\u528D\u98A8\u96F2 (V100, Japan, PCB Version)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, thegladpcbRomInfo, thegladpcbRomName, NULL, NULL, pgmInputInfo, thegladpcbDIPInfo, - thegladInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Demon Front (V107, Korea, PCB Version) - -static struct BurnRomInfo dmnfrntpcbRomDesc[] = { - { "demonfront_v107-u43.bin", 0x200000, 0x671d8a31, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04501.u29", 0x800000, 0x900eaaac, 2 | BRF_GRA }, // 1 Tile data - - { "a04501.u3", 0x800000, 0x9741bea6, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04502.u4", 0x800000, 0xe104f405, 3 | BRF_GRA }, // 3 - { "a04503.u6", 0x800000, 0xbfd5cfe3, 3 | BRF_GRA }, // 4 - - { "b04501.u9", 0x800000, 0x29320b7d, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - { "b04502.u11", 0x200000, 0x578c00e9, 4 | BRF_GRA }, // 6 - - { "w04501.u5", 0x800000, 0x3ab58137, 5 | BRF_SND }, // 7 Samples - - { "dmnfrnt_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 8 Internal ARM7 Rom - - { "demonfront_v107-u62.bin", 0x400000, 0xcb94772e, 8 | BRF_PRG | BRF_ESS }, // 9 External ARM7 Rom -}; - -STDROMPICKEXT(dmnfrntpcb, dmnfrntpcb, dmnfrntBIOS) // custom bios -STD_ROM_FN(dmnfrntpcb) - -struct BurnDriver BurnDrvDmnfrntpcb = { - "dmnfrntpcb", "dmnfrnt", NULL, NULL, "2002", - "Demon Front (V107, Korea, Single PCB Version)\0", "Insert coin to get past ERROR", "IGS", "PolyGameMaster", - L"Demon Front\0\u9B54\u57DF\u6218\u7EBF\0\u9B54\u57DF\u6230\u7DDA (V107, Korea, Single PCB Version)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_PLATFORM, 0, - NULL, dmnfrntpcbRomInfo, dmnfrntpcbRomName, NULL, NULL, pgmInputInfo, dmnfrntpcbDIPInfo, - dmnfrntInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// S.V.G. - Spectral vs Generation (V100, Japan, Single PCB Version) - -static struct BurnRomInfo svgpcbRomDesc[] = { - { "svg_v100jp.u50", 0x080000, 0x8d0405e4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t05601w016.bin", 0x200000, 0x03e110dc, 2 | BRF_GRA }, // 1 Tile data - - { "a05601w064.bin", 0x800000, 0xea6453e4, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a05602w064.bin", 0x800000, 0x6d00621b, 3 | BRF_GRA }, // 3 - { "a05603w064.bin", 0x800000, 0x7b71c64f, 3 | BRF_GRA }, // 4 - { "a05604w032.bin", 0x400000, 0x9452a567, 3 | BRF_GRA }, // 5 - - { "b05601w064.bin", 0x800000, 0x35c0a489, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b05602w064.bin", 0x800000, 0x8aad3f85, 4 | BRF_GRA }, // 7 - - { "w05601b064.bin", 0x800000, 0xbfe61a71, 5 | BRF_SND }, // 8 Samples - { "w05602b032.bin", 0x400000, 0x0685166d, 5 | BRF_SND }, // 9 - -// { "svgpcb_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 10 Internal ARM7 Rom - { "svgpcb_igs027a_execute_only_area", 0x000188, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, // 10 Internal ARM7 Rom - { "svgcpb_igs027a_v100_japan.bin", 0x003e78, 0x7a59da5d, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom - - { "svg_v100jp.u64", 0x400000, 0x399d4a8b, 8 | BRF_PRG | BRF_ESS }, // 12 External ARM7 Rom - { "svg_v100jp.u65", 0x400000, 0x6e1c33b1, 8 | BRF_PRG | BRF_ESS }, // 13 -}; - -STDROMPICKEXT(svgpcb, svgpcb, svgpcbBIOS) // custom bios -STD_ROM_FN(svgpcb) - -static void svgpcbPatch() -{ - pgm_decrypt_svgpcb(); - pgm_create_theglad_EO_data(); -} - -static INT32 svgpcbInit() -{ - pPgmInitCallback = svgpcbPatch; - pPgmProtCallback = install_protection_asic27a_svg; - - nPgmAsicRegionHackAddress = 0x3a8e; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x00009e0); - - return nRet; -} - -struct BurnDriver BurnDrvSvgpcb = { - "svgpcb", "svg", NULL, NULL, "2005", - "S.V.G. - Spectral vs Generation (V100, Japan, Single PCB Version)\0", NULL, "IGS", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, svgpcbRomInfo, svgpcbRomName, NULL, NULL, pgmInputInfo, thegladpcbDIPInfo, - svgpcbInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// ----------------------------------------------------------------------------- -// Homebrew - - -// Chaos (PGM Demo) - -static struct BurnRomInfo pgmdemoRomDesc[] = { - { "p0103.rom", 0x200000, 0xd3f6ec45, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0100.rom", 0x400000, 0x0596a59a, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.rom", 0x400000, 0x5d0e8fa1, 3 | BRF_GRA }, // 2 Sprite Color Data - - { "b0100.rom", 0x400000, 0x15dd191f, 4 | BRF_GRA }, // 3 Sprite Masks & Color Indexes - - { "m0100.rom", 0x200000, 0x8d89877e, 5 | BRF_SND }, // 4 Samples -}; - -STDROMPICKEXT(pgmdemo, pgmdemo, pgm) -STD_ROM_FN(pgmdemo) - -struct BurnDriver BurnDrvPgmdemo = { - "pgmdemo", NULL, "pgm", NULL, "2005", - "Chaos (PGM Demo)\0", "Demo Game", "Raster", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_DEMO, 4, HARDWARE_IGS_PGM, GBF_MISC, 0, - NULL, pgmdemoRomInfo, pgmdemoRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - pgmInit,pgmExit,pgmFrame,pgmDraw,NULL, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Frog Feast (PGM) - -static struct BurnRomInfo pgmfrogRomDesc[] = { - { "p0103.rom", 0x200000, 0xcdec9e8d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0100.rom", 0x400000, 0x8f58b6d8, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.rom", 0x400000, 0xdc1eafe6, 3 | BRF_GRA }, // 2 Sprite Color Data - - { "b0100.rom", 0x400000, 0x3d44b66f, 4 | BRF_GRA }, // 3 Sprite Masks & Color Indexes - - { "m0100.rom", 0x200000, 0x05e2f761, 5 | BRF_SND }, // 4 Samples -}; - -STDROMPICKEXT(pgmfrog, pgmfrog, pgm) -STD_ROM_FN(pgmfrog) - -struct BurnDriver BurnDrvPgmfrog = { - "pgmfrog", NULL, "pgm", NULL, "2006", - "Frog Feast (PGM)\0", NULL, "RasterSoft", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 4, HARDWARE_IGS_PGM, GBF_MISC, 0, - NULL, pgmfrogRomInfo, pgmfrogRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - pgmInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// P-GeMeni (060123) - -static struct BurnRomInfo pgemeniRomDesc[] = { - { "p0103.rom", 0x200000, 0x6cafa56b, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0100.rom", 0x400000, 0x42b979dd, 2 | BRF_GRA }, // 1 Tile data - - { "a0100.rom", 0x400000, 0x105d7cee, 3 | BRF_GRA }, // 2 Sprite Color Data - - { "b0100.rom", 0x400000, 0xb4127373, 4 | BRF_GRA }, // 3 Sprite Masks & Color Indexes - - { "m0100.rom", 0x200000, 0x8d89877e, 5 | BRF_SND }, // 4 Samples -}; - -STDROMPICKEXT(pgemeni, pgemeni, pgm) -STD_ROM_FN(pgemeni) - -struct BurnDriver BurnDrvPgemeni = { - "pgemeni", NULL, "pgm", NULL, "2006", - "P-GeMeni (060123)\0", NULL, "blastar@gmx.net", "PolyGameMaster", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HOMEBREW, 4, HARDWARE_IGS_PGM, GBF_PUZZLE, 0, - NULL, pgemeniRomInfo, pgemeniRomName, NULL, NULL, pgmInputInfo, pgmDIPInfo, - pgmInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -//----------------------------------------------------------------------------------------------------------------- -// Bootlegs & hacks - - -// Knights of Valour: Quan Huang San Guo Special / Sangoku Senki: Quan Huang San Guo Special (ver. 303CN) - -static struct BurnRomInfo kovqhsgsRomDesc[] = { - { "qhsg_c51.rom", 0x0400000, 0xe5cbac85, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "lsqh2_t01.rom", 0x1000000, 0xd498d97f, 2 | BRF_GRA }, // 1 Tile data - - { "lsqh2_a01.rom", 0x1000000, 0x25ae3efd, 3 | BRF_GRA }, // 2 Sprite Color Data - { "lsqh2_a23.rom", 0x1000000, 0x7a779112, 3 | BRF_GRA }, // 3 - { "lsqh2_a45.rom", 0x1000000, 0x5d7de052, 3 | BRF_GRA }, // 4 - - { "lsqh2_b01.rom", 0x1000000, 0xdf7ca696, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "lsqh2_m01.rom", 0x1000000, 0x01af1b65, 5 | BRF_SND }, // 6 Samples - - { "qhsg_prot.c51", 0x0004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 7 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovqhsgs, kovqhsgs, pgm) -STD_ROM_FN(kovqhsgs) - -static INT32 kovqhsgsInit() -{ - pPgmInitCallback = pgm_decrypt_kovqhsgs; - pPgmProtCallback = install_protection_asic27a_kovsh; - - nPgmAsicRegionHackAddress = 0x3f0d; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x00000260); - - return nRet; -} - -struct BurnDriver BurnDrvkovqhsgs = { - "kovqhsgs", "kovsh", "pgm", NULL, "1999", - "Knights of Valour: Quan Huang San Guo Special / Sangoku Senki: Quan Huang San Guo Special (ver. 303CN)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour: Quan Huang San Guo Special\0\u4E09\u56FD\u6218\u7EAA\0\u62F3\u7687\u4E09\u56FD\u7279\u522B\u7248 (ver. 303CN)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovqhsgsRomInfo, kovqhsgsRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovqhsgsInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Quan Huang San Guo Special / Sangoku Senki: Quan Huang San Guo Special (alt ver. 303CN) - -static struct BurnRomInfo kovqhsgsaRomDesc[] = { - { "qhsga_c51.rom", 0x0400000, 0x4c5ea070, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "lsqh2_t01.rom", 0x1000000, 0xd498d97f, 2 | BRF_GRA }, // 1 Tile data - - { "lsqh2_a01.rom", 0x1000000, 0x25ae3efd, 3 | BRF_GRA }, // 2 Sprite Color Data - { "lsqh2_a23.rom", 0x1000000, 0x7a779112, 3 | BRF_GRA }, // 3 - { "lsqh2_a45.rom", 0x1000000, 0x5d7de052, 3 | BRF_GRA }, // 4 - - { "lsqh2_b01.rom", 0x1000000, 0xdf7ca696, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "lsqh2_m01.rom", 0x1000000, 0x01af1b65, 5 | BRF_SND }, // 6 Samples - - { "qhsg_prot.c51", 0x0004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 7 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovqhsgsa, kovqhsgsa, pgm) -STD_ROM_FN(kovqhsgsa) - -struct BurnDriver BurnDrvkovqhsgsa = { - "kovqhsgsa", "kovsh", "pgm", NULL, "1999", - "Knights of Valour: Quan Huang San Guo Special / Sangoku Senki: Quan Huang San Guo Special (alt ver. 303CN)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour: Quan Huang San Guo Special\0\u4E09\u56FD\u6218\u7EAA\0\u62F3\u7687\u4E09\u56FD\u7279\u522B\u7248 (alt ver. 303CN)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovqhsgsaRomInfo, kovqhsgsaRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovqhsgsInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Luan Shi Quan Huang 2 / Sangoku Senki: Luan Shi Quan Huang 2 (ver. 200CN) - -static struct BurnRomInfo kovlsqh2RomDesc[] = { - { "lsqh2_prg.rom", 0x0400000, 0xd71e3d50, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "lsqh2_t01.rom", 0x1000000, 0xd498d97f, 2 | BRF_GRA }, // 1 Tile data - - { "lsqh2_a01.rom", 0x1000000, 0x25ae3efd, 3 | BRF_GRA }, // 2 Sprite Color Data - { "lsqh2_a23.rom", 0x1000000, 0x7a779112, 3 | BRF_GRA }, // 3 - { "lsqh2_a45.rom", 0x1000000, 0x5d7de052, 3 | BRF_GRA }, // 4 - - { "lsqh2_b01.rom", 0x1000000, 0xdf7ca696, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "lsqh2_m01.rom", 0x1000000, 0x01af1b65, 5 | BRF_SND }, // 6 Samples - -#if !defined ROM_VERIFY - { "lsqh2_prot.c51", 0x0010000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 7 Internal ARM7 Rom -#else - { "kovsh_v100_china.asic", 0x0004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 7 Internal ARM7 Rom -#endif -}; - -STDROMPICKEXT(kovlsqh2, kovlsqh2, pgm) -STD_ROM_FN(kovlsqh2) - -static INT32 kovlsqh2Init() -{ - pPgmInitCallback = pgm_decrypt_kovlsqh2; -// pPgmProtCallback = install_protection_asic27a_kovsh; - - INT32 nRet = pgmInit(); - -// Arm7SetIdleLoopAddress(~0); - - return nRet; -} - -struct BurnDriverD BurnDrvkovlsqh2 = { - "kovlsqh2", "kovshp", "pgm", NULL, "2009", - "Knights of Valour: Luan Shi Quan Huang II / Sangoku Senki: Luan Shi Quan Huang II (ver. 200CN)\0", "Incomplete dump", "IGS", "PolyGameMaster", - L"Knights of Valour: Luan Shi Quan Huang II\0\u4E09\u56FD\u6218\u7EAA\0\u4E71\u4E16\u62F3\u7687II (ver. 200CN)\0", NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU */, GBF_SCRFIGHT, 0, - NULL, kovlsqh2RomInfo, kovlsqh2RomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovlsqh2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Luan Shi Quan Huang / Sangoku Senki: Luan Shi Quan Huang (ver. 200CN) - -static struct BurnRomInfo kovlsqhRomDesc[] = { - { "lsqh_v200cn.rom", 0x0400000, 0x9935a27a, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "lsqh2_t01.rom", 0x1000000, 0xd498d97f, 2 | BRF_GRA }, // 1 Tile data - - { "lsqh2_a01.rom", 0x1000000, 0x25ae3efd, 3 | BRF_GRA }, // 2 Sprite Color Data - { "lsqh2_a23.rom", 0x1000000, 0x7a779112, 3 | BRF_GRA }, // 3 - { "lsqh2_a45.rom", 0x1000000, 0x5d7de052, 3 | BRF_GRA }, // 4 - - { "lsqh2_b01.rom", 0x1000000, 0xdf7ca696, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "lsqh2_m01.rom", 0x1000000, 0x01af1b65, 5 | BRF_SND }, // 6 Samples - -#if !defined ROM_VERIFY - { "lsqh_prot.c51", 0x0010000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 7 Internal ARM7 Rom -#else - { "kovsh_v100_china.asic", 0x0004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 7 Internal ARM7 Rom -#endif -}; - -STDROMPICKEXT(kovlsqh, kovlsqh, pgm) -STD_ROM_FN(kovlsqh) - -static INT32 kovlsqhInit() -{ - pPgmInitCallback = pgm_decrypt_kovlsqh2; -// pPgmProtCallback = install_protection_asic27a_kovsh; - - INT32 nRet = pgmInit(); - -// Arm7SetIdleLoopAddress(~0); - - return nRet; -} - -struct BurnDriverD BurnDrvkovlsqh = { - "kovlsqh", "kovshp", "pgm", NULL, "2009", - "Knights of Valour: Luan Shi Quan Huang / Sangoku Senki: Luan Shi Quan Huang (ver. 200CN)\0", "Incomplete dump", "IGS", "PolyGameMaster", - L"Knights of Valour: Luan Shi Quan Huang\0\u4E09\u56FD\u6218\u7EAA\0\u4E71\u4E16\u62F3\u7687 (ver. 200CN)\0", NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU */, GBF_SCRFIGHT, 0, - NULL, kovlsqhRomInfo, kovlsqhRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovlsqhInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (ver. 200CN) - -static struct BurnRomInfo kovlsjbRomDesc[] = { - { "lsjb_prg.rom", 0x0400000, 0xadf06b37, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "lsqh2_t01.rom", 0x1000000, 0xd498d97f, 2 | BRF_GRA }, // 1 Tile data - - { "lsqh2_a01.rom", 0x1000000, 0x25ae3efd, 3 | BRF_GRA }, // 2 Sprite Color Data - { "lsqh2_a23.rom", 0x1000000, 0x7a779112, 3 | BRF_GRA }, // 3 - { "lsqh2_a45.rom", 0x1000000, 0x5d7de052, 3 | BRF_GRA }, // 4 - - { "lsqh2_b01.rom", 0x1000000, 0xdf7ca696, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "lsqh2_m01.rom", 0x1000000, 0x01af1b65, 5 | BRF_SND }, // 6 Samples - -#if !defined ROM_VERIFY - { "lsjb_prot.c51", 0x0010000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 7 Internal ARM7 Rom -#else - { "kovsh_v100_china.asic", 0x0004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 7 Internal ARM7 Rom -#endif -}; - -STDROMPICKEXT(kovlsjb, kovlsjb, pgm) -STD_ROM_FN(kovlsjb) - -struct BurnDriverD BurnDrvkovlsjb = { - "kovlsjb", "kovshp", "pgm", NULL, "2009", - "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (ver. 200CN)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour: Luan Shi Jie Ba\0\u4E09\u56FD\u6218\u7EAA\0\u4E71\u4E16\u8857\u9738 (ver. 200CN)\0", NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kovlsjbRomInfo, kovlsjbRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovlsqh2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (alt ver. 200CN) - -static struct BurnRomInfo kovlsjbaRomDesc[] = { - { "lsjba_prg.rom", 0x0400000, 0x8b42f456, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "lsqh2_t01.rom", 0x1000000, 0xd498d97f, 2 | BRF_GRA }, // 1 Tile data - - { "lsqh2_a01.rom", 0x1000000, 0x25ae3efd, 3 | BRF_GRA }, // 2 Sprite Color Data - { "lsqh2_a23.rom", 0x1000000, 0x7a779112, 3 | BRF_GRA }, // 3 - { "lsqh2_a45.rom", 0x1000000, 0x5d7de052, 3 | BRF_GRA }, // 4 - - { "lsqh2_b01.rom", 0x1000000, 0xdf7ca696, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "lsqh2_m01.rom", 0x1000000, 0x01af1b65, 5 | BRF_SND }, // 6 Samples - -#if !defined ROM_VERIFY - { "lsjba_prot.c51", 0x0010000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 7 Internal ARM7 Rom -#else - { "kovsh_v100_china.asic", 0x0004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 7 Internal ARM7 Rom -#endif -}; - -STDROMPICKEXT(kovlsjba, kovlsjba, pgm) -STD_ROM_FN(kovlsjba) - -struct BurnDriverD BurnDrvkovlsjba = { - "kovlsjba", "kovshp", "pgm", NULL, "2009", - "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (alt ver. 200CN)\0", "Incomplete dump", "IGS", "PolyGameMaster", - L"Knights of Valour: Luan Shi Jie Ba\0\u4E09\u56FD\u6218\u7EAA\0\u4E71\u4E16\u8857\u9738 (alt ver. 200CN)\0", NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kovlsjbaRomInfo, kovlsjbaRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovlsqh2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Ao Shi San Guo / Sangoku Senki: Ao Shi San Guo (ver. 315CN) - -static struct BurnRomInfo kovassgRomDesc[] = { - { "assg_v315cn.rom", 0x0400000, 0xb9885d5c, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "lsqh2_t01.rom", 0x1000000, 0xd498d97f, 2 | BRF_GRA }, // 1 Tile data - - { "lsqh2_a01.rom", 0x1000000, 0x25ae3efd, 3 | BRF_GRA }, // 2 Sprite Color Data - { "lsqh2_a23.rom", 0x1000000, 0x7a779112, 3 | BRF_GRA }, // 3 - { "lsqh2_a45.rom", 0x1000000, 0x5d7de052, 3 | BRF_GRA }, // 4 - - { "lsqh2_b01.rom", 0x1000000, 0xdf7ca696, 4 | BRF_GRA }, // 5 Sprite Masks & Color Indexes - - { "lsqh2_m01.rom", 0x1000000, 0x01af1b65, 5 | BRF_SND }, // 6 Samples - - { "assg_prot.c51", 0x0010000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 7 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovassg, kovassg, pgm) -STD_ROM_FN(kovassg) - -static INT32 kovassgInit() -{ - pPgmInitCallback = pgm_decrypt_kovassg; // incomplete... -// pPgmProtCallback = install_protection_asic27a_kovsh; - - INT32 nRet = pgmInit(); - -// Arm7SetIdleLoopAddress(~0); - - return nRet; -} - -struct BurnDriverD BurnDrvkovassg = { - "kovassg", "kovshp", "pgm", NULL, "2008", - "Knights of Valour: Ao Shi San Guo / Sangoku Senki: Ao Shi San Guo (ver. 315CN)\0", "Incomplete dump", "IGS", "PolyGameMaster", - L"Knights of Valour: Ao Shi San Guo\0\u4E09\u56FD\u6218\u7EAA\0\u50B2\u4E16\u4E09\u56FD (ver. 315CN)\0", NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM /* | HARDWARE_IGS_USE_ARM_CPU */, GBF_SCRFIGHT, 0, - NULL, kovassgRomInfo, kovassgRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovassgInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Ao Shi San Guo / Sangoku Senki: Ao Shi San Guo (ver. 202CN) - -static struct BurnRomInfo kovshxasRomDesc[] = { - { "de_p0609.322", 0x400000, 0x3b7b627f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603xas.rom", 0x800000, 0x7057b37e, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b0601xas.rom", 0x800000, 0x3784fb49, 4 | BRF_GRA }, // 7 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 8 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovshxas, kovshxas, pgm) -STD_ROM_FN(kovshxas) - -static INT32 kovshxasInit() -{ - pPgmInitCallback = kovshp_asic_patch; // hack - pPgmProtCallback = install_protection_asic27a_kovshp; - - nPgmAsicRegionHackAddress = 0x3f0d; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x00000260); - - return nRet; -} - -struct BurnDriver BurnDrvkovshxas = { - "kovshxas", "kovshp", "pgm", NULL, "2008", - "Knights of Valour: Ao Shi San Guo / Sangoku Senki: Ao shi San Guo (ver. 202CN)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster", - L"Knights of Valour: Ao Shi San Guo\0\u4E09\u56FD\u6218\u7EAA\0\u50B2\u4E16\u4E09\u56FD (ver. 202CN)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovshxasRomInfo, kovshxasRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovshxasInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: SanGuo QunYingZhuan / Sangoku Senki: SanGuo QunYingZhuan (set 1) - -static struct BurnRomInfo kovsgqyzRomDesc[] = { - { "pgm_sgqyz.rom", 0x400000, 0x18e1eed9, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "qyza0603.rom", 0x800000, 0xc8b92220, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "qyzb0601.rom", 0x800000, 0x64f55882, 4 | BRF_GRA }, // 11 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 12 Samples - - { "kovsgqyz_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 13 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovsgqyz, kovsgqyz, pgm) -STD_ROM_FN(kovsgqyz) - -static INT32 kovsgqyzInit() -{ - pPgmProtCallback = install_protection_asic27_kov; // simulation - - return pgmInit(); -} - -struct BurnDriver BurnDrvKovsgqyz = { - "kovsgqyz", "kovplus", "pgm", NULL, "1999", - "Knights of Valour: SanGuo QunYingZhuan / Sangoku Senki: SanGuo QunYingZhuan (set 1)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour: SanGuo QunYingZhuan\0\u4E09\u56FD\u6218\u7EAA\0\u4E09\u56FD\u7FA4\u82F1\u4F20 (set 1)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kovsgqyzRomInfo, kovsgqyzRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovsgqyzInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: SanGuo QunYingZhuan / Sangoku Senki: SanGuo QunYingZhuan (set 2) - -static struct BurnRomInfo kovsgqyzaRomDesc[] = { - { "pgm_sgqyza.rom", 0x400000, 0x5a30dcb7, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "qyza0603.rom", 0x800000, 0xc8b92220, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "qyzb0601.rom", 0x800000, 0x64f55882, 4 | BRF_GRA }, // 11 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 12 Samples - - { "kovsgqyza_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 13 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovsgqyza, kovsgqyza, pgm) -STD_ROM_FN(kovsgqyza) - -struct BurnDriver BurnDrvKovsgqyza = { - "kovsgqyza", "kovplus", "pgm", NULL, "1999", - "Knights of Valour: SanGuo QunYingZhuan / Sangoku Senki: SanGuo QunYingZhuan (set 2)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour: SanGuo QunYingZhuan\0\u4E09\u56FD\u6218\u7EAA\0\u4E09\u56FD\u7FA4\u82F1\u4F20 (set 2)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kovsgqyzaRomInfo, kovsgqyzaRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovsgqyzInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: SanGuo QunYingZhuan / Sangoku Senki: SanGuo QunYingZhuan (set 3) - -static struct BurnRomInfo kovsgqyzbRomDesc[] = { - { "pgm_sgqyzb.rom", 0x400000, 0x18b8b9c0, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "qyza0603.rom", 0x800000, 0xc8b92220, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "qyzb0601.rom", 0x800000, 0x64f55882, 4 | BRF_GRA }, // 11 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 12 Samples - - { "kovsgqyzb_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 13 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovsgqyzb, kovsgqyzb, pgm) -STD_ROM_FN(kovsgqyzb) - -struct BurnDriver BurnDrvKovsgqyzb = { - "kovsgqyzb", "kovplus", "pgm", NULL, "1999", - "Knights of Valour: SanGuo QunYingZhuan / Sangoku Senki: SanGuo QunYingZhuan (set 3)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour: SanGuo QunYingZhuan\0\u4E09\u56FD\u6218\u7EAA\0\u4E09\u56FD\u7FA4\u82F1\u4F20 (set 3)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kovsgqyzbRomInfo, kovsgqyzbRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovsgqyzInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: SanGuo QunYingZhuan / Sangoku Senki: SanGuo QunYingZhuan (set 4) - -static struct BurnRomInfo kovsgqyzcRomDesc[] = { - { "pgm_sgqyzc.rom", 0x400000, 0x09774a3e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "qyza0603.rom", 0x800000, 0xc8b92220, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 10 Sprite Masks & Color Indexes - { "qyzb0601.rom", 0x800000, 0x64f55882, 4 | BRF_GRA }, // 11 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 12 Samples - - { "kovsgqyzb_igs027a.bin", 0x004000, 0x00000000, 7 | BRF_PRG | BRF_ESS | BRF_NODUMP }, // 13 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovsgqyzc, kovsgqyzc, pgm) -STD_ROM_FN(kovsgqyzc) - -struct BurnDriver BurnDrvKovsgqyzc = { - "kovsgqyzc", "kovplus", "pgm", NULL, "1999", - "Knights of Valour: SanGuo QunYingZhuan / Sangoku Senki: SanGuo QunYingZhuan (set 4)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour: SanGuo QunYingZhuan\0\u4E09\u56FD\u6218\u7EAA\0\u4E09\u56FD\u7FA4\u82F1\u4F20 (set 4)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM/* | HARDWARE_IGS_USE_ARM_CPU*/, GBF_SCRFIGHT, 0, - NULL, kovsgqyzcRomInfo, kovsgqyzcRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovsgqyzInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour Superheroes / Sangoku Senki Superheroes (bootleg, V104, China) - -static struct BurnRomInfo kovshbRomDesc[] = { - { "u0706.rom", 0x400000, 0x57c75b34, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a0603.rom", 0x400000, 0xec31abda, 3 | BRF_GRA }, // 5 - { "a0604.rom", 0x400000, 0x26b59fd3, 3 | BRF_GRA }, // 6 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 7 Sprite Masks & Color Indexes - { "b0601.rom", 0x400000, 0xa0bb1c2f, 4 | BRF_GRA }, // 8 - { "b0602.rom", 0x100000, 0x9df77934, 4 | BRF_GRA }, // 9 - - { "m0600.rom", 0x400000, 0x3ada4fd6, 5 | BRF_SND }, // 10 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 11 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovshb, kovshb, pgm) -STD_ROM_FN(kovshb) - -static INT32 kovshbInit() -{ - pPgmProtCallback = install_protection_asic27a_kovsh; - - nPgmAsicRegionHackAddress = 0x3f0d; - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x00000260); - - return nRet; -} - -struct BurnDriver BurnDrvKovshb = { - "kovshb", "kovsh", "pgm", NULL, "1999", - "Knights of Valour Superheroes / Sangoku Senki Superheroes (bootleg, V104, China)\0", NULL, "IGS", "PolyGameMaster", - L"Knights of Valour Superheroes\0\u4E09\u56FD\u6218\u7EAA\0\u98CE\u4E91\u518D\u8D77 (bootleg, V104, China)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovshbRomInfo, kovshbRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovshbInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Luan Shi Quan Huang / Sangoku Senki: Luan Shi Quan Huang (ver. 203CN) - -static struct BurnRomInfo kovlsqhdRomDesc[] = { - { "p0600kof.203", 0x400000, 0x54f6c5d9, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a603kof.rom", 0x800000, 0xfe74e90a, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b601kof.rom", 0x800000, 0x188406ee, 4 | BRF_GRA }, // 7 - - { "m0600kof.rom", 0x400000, 0xeae5bf80, 5 | BRF_SND }, // 8 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovlsqhd, kovlsqhd, pgm) -STD_ROM_FN(kovlsqhd) - -struct BurnDriverD BurnDrvkovlsqhd = { - "kovlsqhd", "kovshp", "pgm", NULL, "2008", - "Knights of Valour: Luan Shi Quan Huang / Sangoku Senki: Luan Shi Quan Huang (ver. 203CN)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster", - L"Knights of Valour: Luan Shi Quan Huang\0\u4E09\u56FD\u6218\u7EAA\0\u4E71\u4E16\u62F3\u7687 (ver. 203CN)\0", NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovlsqhdRomInfo, kovlsqhdRomName, NULL, NULL, pgmInputInfo, kovshxasDIPInfo, - kovshxasInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// Knights of Valour: Luan Shi Quan Huang / Sangoku Senki: Luan Shi Quan Huang II (ver. 200CN, alt) - -static struct BurnRomInfo kovlsqh2dRomDesc[] = { - { "p0600kof2.rom", 0x400000, 0x6c61f80f, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t0600.rom", 0x800000, 0x4acc1ad6, 2 | BRF_GRA }, // 1 Tile data - - { "a0600.rom", 0x800000, 0xd8167834, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a0601.rom", 0x800000, 0xff7a4373, 3 | BRF_GRA }, // 3 - { "a0602.rom", 0x800000, 0xe7a32959, 3 | BRF_GRA }, // 4 - { "a603as.rom", 0x800000, 0xeadc7955, 3 | BRF_GRA }, // 5 - - { "b0600.rom", 0x800000, 0x7d3cd059, 4 | BRF_GRA }, // 6 Sprite Masks & Color Indexes - { "b601as.rom", 0x800000, 0xbf30ea67, 4 | BRF_GRA }, // 7 - - { "m0600kof.rom", 0x400000, 0xeae5bf80, 5 | BRF_SND }, // 8 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 9 Internal ARM7 Rom -}; - -STDROMPICKEXT(kovlsqh2d, kovlsqh2d, pgm) -STD_ROM_FN(kovlsqh2d) - -struct BurnDriverD BurnDrvkovlsqh2d = { - "kovlsqh2d", "kovshp", "pgm", NULL, "2008", - "Knights of Valour: Luan Shi Quan Huang / Sangoku Senki: Luan Shi Quan Huang II (ver. 200CN, alt)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster", - L"Knights of Valour: Luan Shi Quan Huang\0\u4E09\u56FD\u6218\u7EAA\0\u4E71\u4E16\u62F3\u7687II (ver. 200CN, alt )\0", NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0, - NULL, kovlsqh2dRomInfo, kovlsqh2dRomName, NULL, NULL, pgmInputInfo, kovDIPInfo, - kovshxasInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 448, 224, 4, 3 -}; - - -// DoDonPachi Dai-Ou-Jou Black Label (2002.10.07 Black Ver., bootleg Knights of Valour Super Heroes conversion) - -static struct BurnRomInfo ddpdojblkblRomDesc[] = { - // bootleg on a converted KOVSH cart - { "ddp_doj_u1.bin", 0x400000, 0xeb4ab06a, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04401w064.u19", 0x800000, 0x3a95f19c, 2 | BRF_GRA }, // 1 Tile data - - { "a04401w064.u7", 0x800000, 0xed229794, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04402w064.u8", 0x800000, 0x752167b0, 3 | BRF_GRA }, // 3 - - { "b04401w064.u1", 0x800000, 0x8cbff066, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04401b032.u17", 0x400000, 0x5a0dbd76, 5 | BRF_SND }, // 5 Samples - - { "kovsh_v100_china.asic", 0x004000, 0x0f09a5c1, 7 | BRF_PRG | BRF_ESS }, // 6 Internal ARM7 Rom -}; - -STDROMPICKEXT(ddpdojblkbl, ddpdojblkbl, pgm) // custom bios -STD_ROM_FN(ddpdojblkbl) - -struct BurnDriver BurnDrvDdpdojblkbl = { - "ddpdojblkbl", "ddpdoj", NULL, NULL, "2002", - "DoDonPachi Dai-Ou-Jou Black Label (2002.10.07 Black Ver., bootleg Knights of Valour Super Heroes conversion)\0", NULL, "bootleg", "PolyGameMaster", - L"DoDonPachi Dai-Ou-Jou Black Label\0\u6012\u9996\u9818\u8702 \u5927\u5F80\u751F Black Label (2002.10.07 Black Ver., bootleg Knights of Valour Super Heroes conversion)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ddpdojblkblRomInfo, ddpdojblkblRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - kovshInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Ketsui: Kizuna Jigoku Tachi (2003/01/01. Master Ver., bootleg cartridge conversion) - -static struct BurnRomInfo ketblRomDesc[] = { - // this assumes a Dodonpachi 2 Bee Storm cart was used - { "ketsui_u1.bin", 0x400000, 0x391767b4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04701w064.u19", 0x800000, 0x2665b041, 2 | BRF_GRA }, // 1 Tile data - - { "a04701w064.u7", 0x800000, 0x5ef1b94b, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04702w064.u8", 0x800000, 0x26d6da7f, 3 | BRF_GRA }, // 3 - - { "b04701w064.u1", 0x800000, 0x1bec008d, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "m04701b032.u17", 0x400000, 0xb46e22d1, 5 | BRF_SND }, // 5 Samples - - { "ddp2_igs027a_japan.bin", 0x004000, 0x742d34d2, 7 | BRF_PRG | BRF_ESS }, // 6 Internal ARM7 Rom - - { "v100.u23", 0x020000, 0x06c3dd29, 8 | BRF_PRG | BRF_ESS }, // 7 External ARM7 Rom -}; - -STDROMPICKEXT(ketbl, ketbl, pgm) // custom bios -STD_ROM_FN(ketbl) - -static void ketblCallback() -{ - memcpy (PGM68KROM, PGM68KROM + 0x200000, 0x200000); -} - -static INT32 ketblInit() -{ - pPgmInitCallback = pgm_decrypt_ddp2; - pPgmProtCallback = install_protection_asic27a_martmast; - pPgmInitCallback = ketblCallback; - -// nPgmAsicRegionHackAddress = 0x2882; // 2883? - - INT32 nRet = pgmInit(); - - Arm7SetIdleLoopAddress(0x8010998); - - return nRet; -} - -struct BurnDriver BurnDrvKetbl = { - "ketbl", "ket", NULL, NULL, "2003", - "Ketsui Kizuna Jigoku Tachi (2003/01/01. Master Ver., bootleg cartridge conversion)\0", NULL, "CAVE / AMI", "PolyGameMaster based", - L"Ketsui Kizuna Jigoku Tachi\0\u30B1\u30C4\u30A4~\u7D46\u5730\u7344\u305F\u3061 (2003/01/01. Master Ver., bootleg cartridge conversion)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, ketblRomInfo, ketblRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ketblInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; - - -// Espgaluda (2003/10/15 Master Ver, bootleg cartridge conversion) - -static struct BurnRomInfo espgalblRomDesc[] = { - // this assumes a Dodonpachi 2 Bee Storm cart was used - { "espgaluda_u8.bin", 0x400000, 0x6a92dd52, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - - { "t04801w064.u19", 0x800000, 0x6021c79e, 2 | BRF_GRA }, // 1 Tile data - - { "a04801w064.u7", 0x800000, 0x26dd4932, 3 | BRF_GRA }, // 2 Sprite Color Data - { "a04802w064.u8", 0x800000, 0x0e6bf7a9, 3 | BRF_GRA }, // 3 - - { "b04801w064.u1", 0x800000, 0x98dce13a, 4 | BRF_GRA }, // 4 Sprite Masks & Color Indexes - - { "w04801b032.u17", 0x400000, 0x60298536, 5 | BRF_SND }, // 5 Samples - - { "ddp2_igs027a_japan.bin", 0x004000, 0x742d34d2, 7 | BRF_PRG | BRF_ESS }, // 6 Internal ARM7 Rom - - { "v100.u23", 0x020000, 0x06c3dd29, 8 | BRF_PRG | BRF_ESS }, // 7 External ARM7 Rom -}; - -STDROMPICKEXT(espgalbl, espgalbl, pgm) // custom bios -STD_ROM_FN(espgalbl) - -struct BurnDriver BurnDrvEspgalbl = { - "espgalbl", "espgal", NULL, NULL, "2003", - "Espgaluda (2003/10/15 Master Ver, bootleg cartridge conversion)\0", NULL, "bootleg", "PolyGameMaster based", - L"Espgaluda\0\u30A8\u30B9\u30D7\u30AC\u30EB\u30FC\u30C0 (2003/10/15 Master Ver, bootleg cartridge conversion)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_JAMMAPCB | HARDWARE_IGS_USE_ARM_CPU, GBF_VERSHOOT, 0, - NULL, espgalblRomInfo, espgalblRomName, NULL, NULL, pgmInputInfo, jammaDIPInfo, - ddp2Init, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900, - 224, 448, 3, 4 -}; diff --git a/jan/src/burn/drv/pgm/pgm.h b/jan/src/burn/drv/pgm/pgm.h deleted file mode 100644 index 5927233ee..000000000 --- a/jan/src/burn/drv/pgm/pgm.h +++ /dev/null @@ -1,119 +0,0 @@ -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "arm7_intf.h" - - -#define HARDWARE_IGS_JAMMAPCB 0x0002 - -// pgm_run -extern INT32 nPGM68KROMLen; -extern INT32 nPGMSPRColMaskLen; -extern INT32 nPGMSPRMaskMaskLen; -extern INT32 nPGMTileROMLen; -extern INT32 nPGMExternalARMLen; - -extern UINT8 *PGM68KRAM; -extern UINT8 *PGM68KROM; -extern UINT8 *PGMTileROM; -extern UINT8 *PGMTileROMExp; -extern UINT8 *PGMSPRColROM; -extern UINT8 *PGMSPRMaskROM; -extern UINT8 *PGMARMROM; -extern UINT8 *PGMUSER0; -extern UINT8 *PGMProtROM; -extern UINT8 *ICSSNDROM; -extern UINT8 *PGMARMRAM0; -extern UINT8 *PGMARMRAM1; -extern UINT8 *PGMARMRAM2; -extern UINT8 *PGMARMShareRAM; -extern UINT8 *PGMARMShareRAM2; -extern UINT16 *PGMRowRAM; -extern UINT16 *PGMPalRAM; -extern UINT16 *PGMVidReg; -extern UINT16 *PGMSprBuf; -extern UINT32 *PGMBgRAM; -extern UINT32 *PGMTxtRAM; -extern UINT32 *RamCurPal; -extern UINT8 nPgmPalRecalc; - -extern UINT8 PgmJoy1[]; -extern UINT8 PgmJoy2[]; -extern UINT8 PgmJoy3[]; -extern UINT8 PgmJoy4[]; -extern UINT8 PgmBtn1[]; -extern UINT8 PgmBtn2[]; -extern UINT8 PgmInput[]; -extern UINT8 PgmReset; - -extern void (*pPgmInitCallback)(); -extern void (*pPgmResetCallback)(); -extern INT32 (*pPgmScanCallback)(INT32, INT32*); -extern void (*pPgmProtCallback)(); - -extern INT32 nPGMDisableIRQ4; -extern INT32 nPGMArm7Type; -extern UINT32 nPgmAsicRegionHackAddress; - -INT32 pgmInit(); -INT32 pgmExit(); -INT32 pgmFrame(); -INT32 pgmScan(INT32 nAction, INT32 *pnMin); - -// pgm_draw -void pgmInitDraw(); -void pgmExitDraw(); -INT32 pgmDraw(); - -// pgm_prot -void install_protection_asic3_orlegend(); -void install_protection_asic25_asic12_dw2(); -void install_protection_asic25_asic22_killbld(); -void install_protection_asic25_asic22_drgw3(); -void install_protection_asic25_asic28_olds(); -void install_protection_asic27_kov(); -void install_protection_asic27a_kovsh(); -void install_protection_asic27a_martmast(); -void install_protection_asic27a_oldsplus(); -void install_protection_asic27a_puzlstar(); -void install_protection_asic27a_svg(); -void install_protection_asic27a_ketsui(); -void install_protection_asic27a_ddp3(); -void install_protection_asic27a_puzzli2(); -void install_protection_asic27a_kovshp(); -void install_protection_asic27a_py2k2(); - -// pgm_crypt -void pgm_decrypt_kov(); -void pgm_decrypt_kovsh(); -void pgm_decrypt_kovshp(); -void pgm_decrypt_puzzli2(); -void pgm_decrypt_dw2(); -void pgm_decrypt_photoy2k(); -void pgm_decrypt_puzlstar(); -void pgm_decrypt_dw3(); -void pgm_decrypt_killbld(); -void pgm_decrypt_dfront(); -void pgm_decrypt_ddp2(); -void pgm_decrypt_martmast(); -void pgm_decrypt_kov2(); -void pgm_decrypt_kov2p(); -void pgm_decrypt_theglad(); -void pgm_decrypt_killbldp(); -void pgm_decrypt_oldsplus(); -void pgm_decrypt_svg(); -void pgm_decrypt_svgpcb(); -void pgm_decrypt_happy6(); -void pgm_decrypt_dw2001(); -void pgm_decrypt_py2k2(); -void pgm_decrypt_espgaluda(); -void pgm_decrypt_ketsui(); -void pgm_decrypt_pgm3in1(); - -void pgm_decode_kovqhsgs_gfx_block(UINT8 *src); -void pgm_decode_kovqhsgs_tile_data(UINT8 *source); -void pgm_decrypt_kovqhsgs(); -void pgm_decrypt_kovlsqh2(); -void pgm_decrypt_kovassg(); - -void pgm_descramble_happy6_data(UINT8 *src, INT32 len); diff --git a/jan/src/burn/drv/pgm/pgm_asic25.cpp b/jan/src/burn/drv/pgm/pgm_asic25.cpp deleted file mode 100644 index 6a8c5ac8c..000000000 --- a/jan/src/burn/drv/pgm/pgm_asic25.cpp +++ /dev/null @@ -1,1351 +0,0 @@ -/* - IGS Asic25 + (Asic12, Asic22, or Asic28) emulation - - Used by: - Oriental Legends Special (Asic25 + Asic28) - The Killing Blade (Asic25 + Asic22) - Dragon World 2 (Asic25 + Asic12) - Dragon World 3 (Asic25 + Asic22) -*/ - -#include "pgm.h" -#include "bitswap.h" - -static const UINT8 source_data[0x22][0xec] = -{ - { 0, }, // Region 0, not used - { // region 1, $14c21a - 0x67, 0x51, 0xf3, 0x19, 0xa0, 0x09, 0xb1, 0x21, 0xb0, 0xee, 0xe3, 0xf6, 0xbe, 0x81, 0x35, 0xe3, - 0xfb, 0xe6, 0xef, 0xdf, 0x61, 0x01, 0xfa, 0x22, 0x5d, 0x43, 0x01, 0xa5, 0x3b, 0x17, 0xd4, 0x74, - 0xf0, 0xf4, 0xf3, 0x43, 0xb5, 0x19, 0x04, 0xd5, 0x84, 0xce, 0x87, 0xfe, 0x35, 0x3e, 0xc4, 0x3c, - 0xc7, 0x85, 0x2a, 0x33, 0x00, 0x86, 0xd0, 0x4d, 0x65, 0x4b, 0xf9, 0xe9, 0xc0, 0xba, 0xaa, 0x77, - 0x9e, 0x66, 0xf6, 0x0f, 0x4f, 0x3a, 0xb6, 0xf1, 0x64, 0x9a, 0xe9, 0x25, 0x1a, 0x5f, 0x22, 0xa3, - 0xa2, 0xbf, 0x4b, 0x77, 0x3f, 0x34, 0xc9, 0x6e, 0xdb, 0x12, 0x5c, 0x33, 0xa5, 0x8b, 0x6c, 0xb1, - 0x74, 0xc8, 0x40, 0x4e, 0x2f, 0xe7, 0x46, 0xae, 0x99, 0xfc, 0xb0, 0x55, 0x54, 0xdf, 0xa7, 0xa1, - 0x0f, 0x5e, 0x49, 0xcf, 0x56, 0x3c, 0x90, 0x2b, 0xac, 0x65, 0x6e, 0xdb, 0x58, 0x3e, 0xc9, 0x00, - 0xae, 0x53, 0x4d, 0x92, 0xfa, 0x40, 0xb2, 0x6b, 0x65, 0x4b, 0x90, 0x8a, 0x0c, 0xe2, 0xa5, 0x9a, - 0xd0, 0x20, 0x29, 0x55, 0xa4, 0x44, 0xac, 0x51, 0x87, 0x54, 0x53, 0x34, 0x24, 0x4b, 0x81, 0x67, - 0x34, 0x4c, 0x5f, 0x31, 0x4e, 0xf2, 0xf1, 0x19, 0x18, 0x1c, 0x34, 0x38, 0xe1, 0x81, 0x17, 0xcf, - 0x24, 0xb9, 0x9a, 0xcb, 0x34, 0x51, 0x50, 0x59, 0x44, 0xb1, 0x0b, 0x50, 0x95, 0x6c, 0x48, 0x7e, - 0x14, 0xa4, 0xc6, 0xd9, 0xd3, 0xa5, 0xd6, 0xd0, 0xc5, 0x97, 0xf0, 0x45, 0xd0, 0x98, 0x51, 0x91, - 0x9f, 0xa3, 0x43, 0x51, 0x05, 0x90, 0xee, 0xca, 0x7e, 0x5f, 0x72, 0x53, 0xb1, 0xd3, 0xaf, 0x36, - 0x08, 0x75, 0xb0, 0x9b, 0xe0, 0x0d, 0x43, 0x88, 0xaa, 0x27, 0x44, 0x11 - }, - { // region 2, $14c126 - 0xf9, 0x19, 0xf3, 0x09, 0xa0, 0x09, 0xb0, 0x21, 0xb0, 0x22, 0xfd, 0x8e, 0xd3, 0xc8, 0x31, 0x67, - 0xc0, 0x10, 0x3c, 0xc2, 0x03, 0xf2, 0x6a, 0x0a, 0x54, 0x49, 0xca, 0xb5, 0x4b, 0xe0, 0x94, 0xe8, - 0x8d, 0xc8, 0x90, 0xee, 0x6b, 0x6f, 0xfa, 0x09, 0x76, 0x84, 0x6f, 0x55, 0xd1, 0x94, 0xca, 0x9c, - 0xe1, 0x22, 0xc6, 0x02, 0xb5, 0x8c, 0xf9, 0x3a, 0x52, 0x10, 0xf0, 0x22, 0xe4, 0x11, 0x15, 0x73, - 0x5e, 0x9e, 0xde, 0xc4, 0x5a, 0xbd, 0xa3, 0x89, 0xe7, 0x9b, 0x95, 0x5d, 0x75, 0xf6, 0xc3, 0x9f, - 0xe4, 0xcf, 0x65, 0x73, 0x90, 0xd0, 0x75, 0x56, 0xfa, 0xcc, 0xe4, 0x3e, 0x9c, 0x41, 0x81, 0x62, - 0xb1, 0xd3, 0x28, 0xbd, 0x6c, 0xed, 0x60, 0x28, 0x27, 0xee, 0xf2, 0xa1, 0xb4, 0x2c, 0x6c, 0xbb, - 0x42, 0xd7, 0x1d, 0x62, 0xc0, 0x33, 0x7d, 0xf9, 0xe4, 0x5c, 0xe2, 0x41, 0xa4, 0x1c, 0x98, 0xa1, - 0x87, 0x95, 0xad, 0x61, 0x56, 0x96, 0x40, 0x08, 0x6b, 0xe2, 0x4b, 0x95, 0x7b, 0x1b, 0xd8, 0x64, - 0xb3, 0xee, 0x9d, 0x79, 0x69, 0xea, 0x5d, 0xcf, 0x01, 0x91, 0xea, 0x3f, 0x70, 0x29, 0xdc, 0xe0, - 0x08, 0x20, 0xbf, 0x46, 0x90, 0xa8, 0xfc, 0x29, 0x14, 0xd1, 0x0d, 0x20, 0x79, 0xd2, 0x2c, 0xe9, - 0x52, 0xa6, 0x8c, 0xbd, 0xa3, 0x3e, 0x88, 0x2d, 0xb8, 0x4e, 0xf2, 0x74, 0x50, 0xcc, 0x12, 0xde, - 0xd3, 0x5a, 0xa4, 0x7b, 0xa2, 0x8d, 0x91, 0x68, 0x12, 0x0c, 0x9c, 0xb9, 0x6d, 0x26, 0x66, 0x60, - 0xc3, 0x6d, 0xd0, 0x11, 0x33, 0x05, 0x1d, 0xa8, 0xb6, 0x51, 0xe6, 0xe0, 0x58, 0x61, 0x74, 0x37, - 0xcc, 0x3a, 0x4d, 0x6a, 0x0a, 0x09, 0x71, 0xe3, 0x7e, 0xa5, 0x3b, 0xe9 - }, - { // region 3, $14E5BE - 0x73, 0x59, 0xf3, 0x09, 0xa0, 0x09, 0xb1, 0x21, 0xb0, 0x55, 0x18, 0x0d, 0xe8, 0x29, 0x2d, 0x04, - 0x85, 0x39, 0x88, 0xbe, 0x8b, 0xcb, 0xd9, 0x0b, 0x32, 0x36, 0x94, 0xac, 0x74, 0xc3, 0x3b, 0x5d, - 0x2a, 0x83, 0x46, 0xb3, 0x3a, 0xac, 0xd8, 0x55, 0x68, 0x21, 0x57, 0xab, 0x6e, 0xd1, 0xd0, 0xfc, - 0xe2, 0xbe, 0x63, 0xd0, 0x6b, 0x79, 0x23, 0x40, 0x58, 0xd4, 0xe7, 0x73, 0x22, 0x67, 0x7f, 0x88, - 0x05, 0xbd, 0xdf, 0x7a, 0x65, 0x41, 0x90, 0x3a, 0x52, 0x83, 0x28, 0xae, 0xe9, 0x8e, 0x65, 0x82, - 0x0e, 0xdf, 0x98, 0x88, 0xe1, 0x86, 0x21, 0x3e, 0x1a, 0x87, 0x6d, 0x62, 0x7a, 0xf6, 0xaf, 0x2c, - 0xd5, 0xc5, 0x10, 0x2d, 0xa9, 0xda, 0x93, 0xa1, 0x9b, 0xc7, 0x35, 0xd4, 0x15, 0x78, 0x18, 0xd5, - 0x75, 0x6a, 0xd7, 0xdb, 0x12, 0x2a, 0x6a, 0xc8, 0x36, 0x53, 0x57, 0xa6, 0xf0, 0x13, 0x67, 0x43, - 0x79, 0xf0, 0x0e, 0x49, 0xb1, 0xec, 0xcd, 0xa4, 0x8a, 0x61, 0x06, 0xb9, 0xea, 0x53, 0xf2, 0x47, - 0x7d, 0xd6, 0xf8, 0x9d, 0x2e, 0xaa, 0x27, 0x35, 0x61, 0xce, 0x9b, 0x63, 0xbc, 0x07, 0x51, 0x5a, - 0xc2, 0x0d, 0x39, 0x42, 0xd2, 0x5e, 0x21, 0x20, 0x10, 0xa0, 0xe5, 0x08, 0xf7, 0x3d, 0x28, 0x04, - 0x99, 0x93, 0x97, 0xaf, 0xf9, 0x12, 0xc0, 0x01, 0x2d, 0xea, 0xf3, 0x98, 0x0b, 0x46, 0xc2, 0x26, - 0x93, 0x10, 0x69, 0x1d, 0x71, 0x8e, 0x33, 0x00, 0x5e, 0x80, 0x2f, 0x47, 0x0a, 0xcc, 0x94, 0x16, - 0xe7, 0x37, 0x45, 0xd0, 0x61, 0x79, 0x32, 0x86, 0x08, 0x2a, 0x5b, 0x55, 0xfe, 0xee, 0x52, 0x38, - 0xaa, 0x18, 0xe9, 0x39, 0x1a, 0x1e, 0xb8, 0x26, 0x6b, 0x3d, 0x4b, 0xa9 - }, - { // region 4, $14d500 - 0x06, 0x01, 0xf3, 0x39, 0xa0, 0x09, 0xa0, 0x21, 0xb0, 0x6f, 0x32, 0x8b, 0xfd, 0x89, 0x29, 0xa0, - 0x4a, 0x62, 0xed, 0xa1, 0x2d, 0xa4, 0x49, 0xf2, 0x10, 0x3c, 0x77, 0xa3, 0x84, 0x8d, 0xfa, 0xd1, - 0xc6, 0x57, 0xe2, 0x78, 0xef, 0xe9, 0xb6, 0xa1, 0x5a, 0xbd, 0x3f, 0x02, 0x0b, 0x28, 0xd6, 0x76, - 0xfc, 0x5b, 0x19, 0x9f, 0x21, 0x66, 0x4c, 0x2d, 0x45, 0x99, 0xde, 0xab, 0x46, 0xbd, 0xe9, 0x84, - 0xc4, 0xdc, 0xc7, 0x30, 0x70, 0xdd, 0x64, 0xea, 0xbc, 0x6b, 0xd3, 0xe6, 0x45, 0x3f, 0x07, 0x7e, - 0x50, 0xef, 0xb2, 0x84, 0x33, 0x3c, 0xcc, 0x3f, 0x39, 0x5b, 0xf5, 0x6d, 0x71, 0xc5, 0xdd, 0xf5, - 0xf9, 0xd0, 0xf7, 0x9c, 0xe6, 0xc7, 0xad, 0x1b, 0x29, 0xb9, 0x90, 0x08, 0x75, 0xc4, 0xc3, 0xef, - 0xa8, 0xfc, 0xab, 0x55, 0x7c, 0x21, 0x57, 0x97, 0x87, 0x4a, 0xcb, 0x0c, 0x56, 0x0a, 0x4f, 0xcb, - 0x52, 0x33, 0x87, 0x31, 0xf3, 0x43, 0x5b, 0x41, 0x90, 0xf8, 0xc0, 0xdd, 0x5a, 0xa4, 0x26, 0x2a, - 0x60, 0xa5, 0x6d, 0xda, 0xf2, 0x6a, 0xf0, 0xb3, 0xda, 0x25, 0x33, 0x87, 0x22, 0xe4, 0xac, 0xd3, - 0x96, 0xe0, 0x99, 0x3e, 0xfb, 0x14, 0x45, 0x17, 0x25, 0x56, 0xbe, 0xef, 0x8f, 0x8e, 0x3d, 0x1e, - 0xc7, 0x99, 0xa2, 0xa1, 0x50, 0xfe, 0xdf, 0xd4, 0xa1, 0x87, 0xf4, 0xd5, 0xde, 0xa6, 0x8c, 0x6d, - 0x6c, 0xde, 0x47, 0xbe, 0x59, 0x8f, 0xd4, 0x97, 0xc3, 0xf4, 0xda, 0xbb, 0xa6, 0x73, 0xa9, 0xcb, - 0xf2, 0x01, 0xb9, 0x90, 0x8f, 0xed, 0x60, 0x64, 0x40, 0x1c, 0xb6, 0xc9, 0xa5, 0x7c, 0x17, 0x52, - 0x6f, 0xdc, 0x6d, 0x08, 0x2a, 0x1a, 0xe6, 0x68, 0x3f, 0xd4, 0x42, 0x69 - }, - { // region 5, $14bfb2 - 0x7f, 0x41, 0xf3, 0x39, 0xa0, 0x09, 0xa1, 0x21, 0xb0, 0xa2, 0x4c, 0x23, 0x13, 0xe9, 0x25, 0x3d, - 0x0f, 0x72, 0x3a, 0x9d, 0xb5, 0x96, 0xd1, 0xda, 0x07, 0x29, 0x41, 0x9a, 0xad, 0x70, 0xba, 0x46, - 0x63, 0x2b, 0x7f, 0x3d, 0xbe, 0x40, 0xad, 0xd4, 0x4c, 0x73, 0x27, 0x58, 0xa7, 0x65, 0xdc, 0xd6, - 0xfd, 0xde, 0xb5, 0x6e, 0xd6, 0x6c, 0x75, 0x1a, 0x32, 0x45, 0xd5, 0xe3, 0x6a, 0x14, 0x6d, 0x80, - 0x84, 0x15, 0xaf, 0xcc, 0x7b, 0x61, 0x51, 0x82, 0x40, 0x53, 0x7f, 0x38, 0xa0, 0xd6, 0x8f, 0x61, - 0x79, 0x19, 0xe5, 0x99, 0x84, 0xd8, 0x78, 0x27, 0x3f, 0x16, 0x97, 0x78, 0x4f, 0x7b, 0x0c, 0xa6, - 0x37, 0xdb, 0xc6, 0x0c, 0x24, 0xb4, 0xc7, 0x94, 0x9d, 0x92, 0xd2, 0x3b, 0xd5, 0x11, 0x6f, 0x0a, - 0xdb, 0x76, 0x66, 0xe7, 0xcd, 0x18, 0x2b, 0x66, 0xd8, 0x41, 0x40, 0x58, 0xa2, 0x01, 0x1e, 0x6d, - 0x44, 0x75, 0xe7, 0x19, 0x4f, 0xb2, 0xe8, 0xc4, 0x96, 0x77, 0x62, 0x02, 0xc9, 0xdc, 0x59, 0xf3, - 0x43, 0x8d, 0xc8, 0xfe, 0x9e, 0x2a, 0xba, 0x32, 0x3b, 0x62, 0xe3, 0x92, 0x6e, 0xc2, 0x08, 0x4d, - 0x51, 0xcd, 0xf9, 0x3a, 0x3e, 0xc9, 0x50, 0x27, 0x21, 0x25, 0x97, 0xd7, 0x0e, 0xf8, 0x39, 0x38, - 0xf5, 0x86, 0x94, 0x93, 0xbf, 0xeb, 0x18, 0xa8, 0xfc, 0x24, 0xf5, 0xf9, 0x99, 0x20, 0x3d, 0xcd, - 0x2c, 0x94, 0x25, 0x79, 0x28, 0x77, 0x8f, 0x2f, 0x10, 0x69, 0x86, 0x30, 0x43, 0x01, 0xd7, 0x9a, - 0x17, 0xe3, 0x47, 0x37, 0xbd, 0x62, 0x75, 0x42, 0x78, 0xf4, 0x2b, 0x57, 0x4c, 0x0a, 0xdb, 0x53, - 0x4d, 0xa1, 0x0a, 0xd6, 0x3a, 0x16, 0x15, 0xaa, 0x2c, 0x6c, 0x39, 0x42 - }, - { // region 6, $14cd82 - 0x12, 0x09, 0xf3, 0x29, 0xa0, 0x09, 0xa0, 0x21, 0xb0, 0xd5, 0x66, 0xa1, 0x28, 0x4a, 0x21, 0xc0, - 0xd3, 0x9b, 0x86, 0x80, 0x57, 0x6f, 0x41, 0xc2, 0xe4, 0x2f, 0x0b, 0x91, 0xbd, 0x3a, 0x7a, 0xba, - 0x00, 0xe5, 0x35, 0x02, 0x74, 0x7d, 0x8b, 0x21, 0x57, 0x10, 0x0f, 0xae, 0x44, 0xbb, 0xe2, 0x37, - 0x18, 0x7b, 0x52, 0x3d, 0x8c, 0x59, 0x9e, 0x20, 0x1f, 0x0a, 0xcc, 0x1c, 0x8e, 0x6a, 0xd7, 0x95, - 0x2b, 0x34, 0xb0, 0x82, 0x6d, 0xfd, 0x25, 0x33, 0xaa, 0x3b, 0x2b, 0x70, 0x15, 0x87, 0x31, 0x5d, - 0xbb, 0x29, 0x19, 0x95, 0xd5, 0x8e, 0x24, 0x28, 0x5e, 0xd0, 0x20, 0x83, 0x46, 0x4a, 0x21, 0x70, - 0x5b, 0xcd, 0xae, 0x7b, 0x61, 0xa1, 0xfa, 0xf4, 0x2b, 0x84, 0x15, 0x6e, 0x36, 0x5d, 0x1b, 0x24, - 0x0f, 0x09, 0x3a, 0x61, 0x38, 0x0f, 0x18, 0x35, 0x11, 0x38, 0xb4, 0xbd, 0xee, 0xf7, 0xec, 0x0f, - 0x1d, 0xb7, 0x48, 0x01, 0xaa, 0x09, 0x8f, 0x61, 0xb5, 0x0f, 0x1d, 0x26, 0x39, 0x2e, 0x8c, 0xd6, - 0x26, 0x5c, 0x3d, 0x23, 0x63, 0xe9, 0x6b, 0x97, 0xb4, 0x9f, 0x7b, 0xb6, 0xba, 0xa0, 0x7c, 0xc6, - 0x25, 0xa1, 0x73, 0x36, 0x67, 0x7f, 0x74, 0x1e, 0x1d, 0xda, 0x70, 0xbf, 0xa5, 0x63, 0x35, 0x39, - 0x24, 0x8c, 0x9f, 0x85, 0x16, 0xd8, 0x50, 0x95, 0x71, 0xc0, 0xf6, 0x1e, 0x6d, 0x80, 0xed, 0x15, - 0xeb, 0x63, 0xe9, 0x1b, 0xf6, 0x78, 0x31, 0xc6, 0x5c, 0xdd, 0x19, 0xbd, 0xdf, 0xa7, 0xec, 0x50, - 0x22, 0xad, 0xbb, 0xf6, 0xeb, 0xd6, 0xa3, 0x20, 0xc9, 0xe6, 0x9f, 0xcb, 0xf2, 0x97, 0xb9, 0x54, - 0x12, 0x66, 0xa6, 0xbe, 0x4a, 0x12, 0x43, 0xec, 0x00, 0xea, 0x49, 0x02 - }, - { // region 7, $14ce76 - 0xa4, 0x49, 0xf3, 0x29, 0xa0, 0x09, 0xa1, 0x21, 0xb0, 0xef, 0x80, 0x20, 0x3d, 0xaa, 0x36, 0x5d, - 0x98, 0xc4, 0xd2, 0x63, 0xdf, 0x61, 0xb0, 0xc3, 0xc2, 0x35, 0xd4, 0x88, 0xe6, 0x1d, 0x3a, 0x2f, - 0x9c, 0xb9, 0xd1, 0xc6, 0x43, 0xba, 0x69, 0x6d, 0x49, 0xac, 0xdd, 0x05, 0xe0, 0xf8, 0xe8, 0x97, - 0x19, 0x18, 0x08, 0x0c, 0x42, 0x46, 0xc7, 0x0d, 0x25, 0xce, 0xc3, 0x54, 0xb2, 0xd9, 0x42, 0x91, - 0xea, 0x53, 0x98, 0x38, 0x78, 0x81, 0x12, 0xca, 0x15, 0x23, 0xbd, 0xc1, 0x70, 0x1f, 0xd2, 0x40, - 0xfd, 0x39, 0x33, 0xaa, 0x27, 0x2b, 0xe8, 0x10, 0x7d, 0xa4, 0xa8, 0x8e, 0x3d, 0x00, 0x4f, 0x3a, - 0x7f, 0xd8, 0x96, 0xea, 0x9e, 0x8e, 0x15, 0x6e, 0x9f, 0x76, 0x57, 0xba, 0x7d, 0xc2, 0xdf, 0x57, - 0x42, 0x82, 0xf4, 0xda, 0x89, 0x06, 0x05, 0x04, 0x62, 0x2f, 0x29, 0x23, 0x54, 0xd5, 0xbb, 0x97, - 0xf5, 0xf9, 0xc1, 0xcf, 0xec, 0x5f, 0x1d, 0xfd, 0xbb, 0xa6, 0xd7, 0x4a, 0xa8, 0x66, 0xbf, 0xb9, - 0x09, 0x44, 0xb1, 0x60, 0x28, 0xa9, 0x35, 0x16, 0x15, 0xf5, 0x13, 0xc1, 0x07, 0x7e, 0xd7, 0x40, - 0xdf, 0x8e, 0xd3, 0x32, 0xa9, 0x35, 0x98, 0x15, 0x32, 0xa9, 0x49, 0xc0, 0x24, 0xb4, 0x4a, 0x53, - 0x6b, 0x79, 0xaa, 0x77, 0x6c, 0xc5, 0x88, 0x69, 0xe5, 0x5d, 0xde, 0x42, 0x28, 0xf9, 0xb7, 0x5c, - 0xab, 0x19, 0xc7, 0xbc, 0xc5, 0x60, 0xeb, 0x5e, 0xa8, 0x52, 0xc4, 0x32, 0x7c, 0x35, 0x02, 0x06, - 0x46, 0x77, 0x30, 0xb6, 0x33, 0x4b, 0xb8, 0xfd, 0x02, 0xd8, 0x14, 0x40, 0x99, 0x25, 0x7e, 0x55, - 0xd6, 0x44, 0x43, 0x8d, 0x73, 0x0e, 0x71, 0x48, 0xd3, 0x82, 0x40, 0xda - }, - { 0, }, // unused region 08 - { 0, }, // unused region 09 - { 0, }, // unused region 0a - { 0, }, // unused region 0b - { 0, }, // unused region 0c - { 0, }, // unused region 0d - { 0, }, // unused region 0e - { 0, }, // unused region 0f - { 0, }, // unused region 10 - { 0, }, // unused region 11 - { 0, }, // unused region 12 - { 0, }, // unused region 13 - { 0, }, // unused region 14 - { 0, }, // unused region 15 - { // region 16, $178772 - 0x5e, 0x09, 0xb3, 0x39, 0x60, 0x71, 0x71, 0x53, 0x11, 0xe5, 0x26, 0x34, 0x4c, 0x8c, 0x90, 0xee, - 0xed, 0xb5, 0x05, 0x95, 0x9e, 0x6b, 0xdd, 0x87, 0x0e, 0x7b, 0xed, 0x33, 0xaf, 0xc2, 0x62, 0x98, - 0xec, 0xc8, 0x2c, 0x2b, 0x57, 0x3d, 0x00, 0xbd, 0x12, 0xac, 0xba, 0x64, 0x81, 0x99, 0x16, 0x29, - 0xb4, 0x63, 0xa8, 0xd9, 0xc9, 0x5f, 0xfe, 0x21, 0xbb, 0xbf, 0x9b, 0xd1, 0x7b, 0x93, 0xc4, 0x82, - 0xef, 0x2b, 0xe8, 0xa6, 0xdc, 0x68, 0x3a, 0xd9, 0xc9, 0x23, 0xc7, 0x7b, 0x98, 0x5b, 0xe1, 0xc7, - 0xa3, 0xd4, 0x51, 0x0a, 0x86, 0x30, 0x20, 0x51, 0x6e, 0x04, 0x1c, 0xd4, 0xfb, 0xf5, 0x22, 0x8f, - 0x16, 0x6f, 0xb9, 0x59, 0x30, 0xcf, 0xab, 0x32, 0x1d, 0x6c, 0x84, 0xab, 0x23, 0x90, 0x94, 0xb1, - 0xe7, 0x4b, 0x6d, 0xc1, 0x84, 0xba, 0x32, 0x68, 0xa3, 0xf2, 0x47, 0x28, 0xe5, 0xcb, 0xbb, 0x47, - 0x14, 0x2c, 0xad, 0x4d, 0xa1, 0xd7, 0x18, 0x53, 0xf7, 0x6f, 0x05, 0x81, 0x8f, 0xbb, 0x29, 0xdc, - 0xbd, 0x17, 0x61, 0x92, 0x9b, 0x1d, 0x4e, 0x7a, 0x83, 0x14, 0x9f, 0x7b, 0x7a, 0x6a, 0xe1, 0x27, - 0x62, 0x52, 0x7e, 0x82, 0x45, 0xda, 0xed, 0xf1, 0x0a, 0x3b, 0x6c, 0x02, 0x5b, 0x6e, 0x45, 0x4e, - 0xf2, 0x65, 0x87, 0x1d, 0x80, 0xed, 0x6a, 0xc3, 0x77, 0xcb, 0xe8, 0x8d, 0x5a, 0xb8, 0xda, 0x89, - 0x88, 0x4b, 0x27, 0xd5, 0x57, 0x29, 0x91, 0x86, 0x12, 0xbb, 0xd3, 0x8c, 0xc7, 0x49, 0x84, 0x9c, - 0x96, 0x59, 0x30, 0x93, 0x92, 0xeb, 0x59, 0x2b, 0x93, 0x5b, 0x5f, 0xf9, 0x67, 0xac, 0x97, 0x8c, - 0x04, 0xda, 0x1b, 0x65, 0xd7, 0xef, 0x44, 0xca, 0xc4, 0x87, 0x18, 0x2b - }, - { // region 17, $178a36 - 0xd7, 0x49, 0xb3, 0x39, 0x60, 0x71, 0x70, 0x53, 0x11, 0x00, 0x27, 0xb2, 0x61, 0xd3, 0x8c, 0x8b, - 0xb2, 0xde, 0x6a, 0x78, 0x40, 0x5d, 0x4d, 0x88, 0xeb, 0x81, 0xd0, 0x2a, 0xbf, 0x8c, 0x22, 0x0d, - 0x89, 0x83, 0xc8, 0xef, 0x0d, 0x7a, 0xf6, 0xf0, 0x1d, 0x49, 0xa2, 0xd3, 0x1e, 0xef, 0x1c, 0xa2, - 0xce, 0x00, 0x5e, 0xa8, 0x7f, 0x4c, 0x41, 0x27, 0xa8, 0x6b, 0x92, 0x0a, 0xb8, 0x03, 0x2f, 0x7e, - 0xaf, 0x4a, 0xd0, 0x5c, 0xce, 0xeb, 0x0e, 0x8a, 0x4d, 0x0b, 0x73, 0xb3, 0xf3, 0x0c, 0x83, 0xaa, - 0xe5, 0xe4, 0x84, 0x06, 0xd7, 0xcc, 0xcb, 0x52, 0x8d, 0xbe, 0xa4, 0xdf, 0xd9, 0xab, 0x50, 0x59, - 0x53, 0x61, 0xa1, 0xc8, 0x6d, 0xbc, 0xde, 0xab, 0xaa, 0x5e, 0xc6, 0xf7, 0x83, 0xdc, 0x40, 0xcb, - 0x1b, 0xdd, 0x28, 0x3b, 0xee, 0xb1, 0x1f, 0x37, 0xdb, 0xe9, 0xbb, 0x74, 0x4b, 0xc2, 0x8a, 0xe8, - 0xec, 0x6e, 0x0e, 0x35, 0xe3, 0x2e, 0xbe, 0xef, 0xfd, 0x07, 0xbf, 0x8c, 0xfe, 0xf3, 0x5c, 0xbf, - 0x87, 0xe5, 0xbc, 0xcf, 0x60, 0xdc, 0x18, 0xf8, 0xfc, 0x51, 0x50, 0x86, 0xc6, 0x48, 0x3d, 0xb9, - 0x1d, 0x26, 0xf7, 0x7e, 0x87, 0x90, 0x12, 0xe8, 0x06, 0x0a, 0x45, 0xe9, 0xd9, 0xd8, 0x41, 0x68, - 0x21, 0x52, 0x92, 0x0f, 0xd6, 0xda, 0xa2, 0x97, 0xeb, 0x68, 0xd0, 0xb1, 0x15, 0x19, 0x8b, 0xd0, - 0x48, 0x1a, 0xeb, 0x90, 0x3f, 0x2a, 0x33, 0x1e, 0x5e, 0x30, 0x66, 0x01, 0x64, 0xef, 0x99, 0x52, - 0xba, 0x23, 0xbd, 0x53, 0xc0, 0x60, 0x87, 0x09, 0xcb, 0x4d, 0xd3, 0x87, 0x0e, 0x3a, 0x5c, 0x8d, - 0xc8, 0xb8, 0xb7, 0x34, 0x01, 0xeb, 0x72, 0x0d, 0xb1, 0x1f, 0x0f, 0xea - }, - { // region 18, $17dac4 - 0x6a, 0x13, 0xb3, 0x09, 0x60, 0x79, 0x61, 0x53, 0x11, 0x33, 0x41, 0x31, 0x76, 0x34, 0x88, 0x0f, - 0x77, 0x08, 0xb6, 0x74, 0xc8, 0x36, 0xbc, 0x70, 0xe2, 0x87, 0x9a, 0x21, 0xe8, 0x56, 0xe1, 0x9a, - 0x26, 0x57, 0x7e, 0x9b, 0xdb, 0xb7, 0xd4, 0x3d, 0x0f, 0xfe, 0x8a, 0x2a, 0xba, 0x2d, 0x22, 0x03, - 0xcf, 0x9c, 0xfa, 0x77, 0x35, 0x39, 0x6a, 0x14, 0xae, 0x30, 0x89, 0x42, 0xdc, 0x59, 0xb2, 0x93, - 0x6f, 0x82, 0xd1, 0x12, 0xd9, 0x88, 0xfa, 0x3b, 0xb7, 0x0c, 0x1f, 0x05, 0x68, 0xa3, 0x0c, 0xa6, - 0x0f, 0xf4, 0x9e, 0x1b, 0x29, 0x82, 0x77, 0x3a, 0xac, 0x92, 0x2d, 0x04, 0xd0, 0x61, 0x65, 0x0a, - 0x77, 0x6c, 0x89, 0x38, 0xaa, 0xa9, 0xf8, 0x0c, 0x1f, 0x37, 0x09, 0x2b, 0xca, 0x29, 0x05, 0xe5, - 0x4e, 0x57, 0xfb, 0xcd, 0x40, 0xa8, 0x0c, 0x06, 0x2d, 0xe0, 0x30, 0xd9, 0x97, 0xb9, 0x59, 0x8a, - 0xde, 0xc9, 0x87, 0x1d, 0x3f, 0x84, 0x4c, 0x73, 0x04, 0x85, 0x61, 0xb0, 0x6e, 0x2c, 0x8f, 0xa2, - 0x6a, 0xcd, 0x31, 0xf3, 0x25, 0x83, 0xe1, 0x5e, 0x5d, 0xa7, 0xe7, 0xaa, 0x13, 0x26, 0xb1, 0x33, - 0xf0, 0x13, 0x58, 0x7a, 0xb0, 0x46, 0x1d, 0xdf, 0x02, 0xbf, 0x1e, 0xd1, 0x71, 0x43, 0x56, 0x82, - 0x4f, 0x58, 0x9d, 0x01, 0x2d, 0xc7, 0xda, 0x6b, 0x47, 0x05, 0xd1, 0xd5, 0xe8, 0x92, 0x3c, 0x18, - 0x21, 0xcf, 0xc9, 0x32, 0x0e, 0x12, 0xed, 0xb5, 0xaa, 0xa4, 0x12, 0x75, 0x01, 0x7d, 0xc7, 0x21, - 0xde, 0xec, 0x32, 0x13, 0xee, 0xd4, 0x9c, 0xe6, 0x04, 0x3f, 0x48, 0xfb, 0xb4, 0xc7, 0x21, 0x8e, - 0x8d, 0x7d, 0x54, 0x03, 0x11, 0xe7, 0xb9, 0x4f, 0x85, 0xb6, 0x1f, 0xaa - }, - { // region 19, $178eee - 0xe3, 0x53, 0xb3, 0x09, 0x60, 0x79, 0x60, 0x53, 0x11, 0x66, 0x5b, 0xc8, 0x8b, 0x94, 0x84, 0xab, - 0x3c, 0x18, 0x03, 0x57, 0x6a, 0x0f, 0x45, 0x58, 0xc0, 0x74, 0x64, 0x18, 0xf8, 0x39, 0xa1, 0x0f, - 0xc2, 0x2b, 0x1b, 0x60, 0xaa, 0x0e, 0xb2, 0x89, 0x01, 0x9b, 0x72, 0x80, 0x57, 0x83, 0x28, 0x63, - 0xe9, 0x39, 0x97, 0x46, 0xea, 0x3f, 0x93, 0x01, 0x9b, 0xf4, 0x80, 0x93, 0x01, 0xaf, 0x1d, 0x8f, - 0x16, 0xa1, 0xb9, 0xc7, 0xe4, 0x0c, 0xe7, 0xd2, 0x3b, 0xf3, 0xca, 0x3d, 0xc3, 0x54, 0xad, 0x89, - 0x51, 0x1e, 0xd1, 0x17, 0x7a, 0x1f, 0x23, 0x22, 0xcb, 0x4d, 0xce, 0x0f, 0xae, 0x30, 0x93, 0xd3, - 0x9b, 0x77, 0x71, 0xa7, 0xe7, 0x96, 0x2c, 0x85, 0xac, 0x29, 0x4b, 0x5e, 0x2b, 0x75, 0xb0, 0x00, - 0x81, 0xe9, 0xb6, 0x47, 0xaa, 0x9f, 0xdf, 0xd4, 0x7e, 0xd7, 0xa4, 0x3f, 0xe3, 0xb0, 0x41, 0x2c, - 0xb7, 0x0c, 0xe7, 0xeb, 0x9a, 0xda, 0xd9, 0x10, 0x23, 0x1d, 0x1c, 0xd4, 0xdd, 0x7d, 0xc2, 0x6c, - 0x4d, 0x9c, 0xa5, 0x18, 0xd0, 0x43, 0xab, 0xdc, 0xbd, 0xe4, 0x7f, 0xb5, 0x5f, 0x04, 0x0d, 0xac, - 0xab, 0xe6, 0xb8, 0x76, 0xf2, 0x15, 0x41, 0xef, 0x17, 0x8e, 0xf6, 0xb9, 0xef, 0x94, 0x52, 0x83, - 0x96, 0x45, 0x8f, 0xf2, 0x9c, 0xb4, 0x13, 0x3f, 0xbb, 0xa1, 0xd2, 0xf9, 0xa3, 0xf2, 0x06, 0x78, - 0xe0, 0x9e, 0xa7, 0xd3, 0xdc, 0x13, 0x8f, 0x4d, 0xf6, 0x19, 0xbd, 0x03, 0x9d, 0x24, 0xdc, 0xd6, - 0xe9, 0xcf, 0xa6, 0xd2, 0x1d, 0x49, 0xca, 0xc4, 0x55, 0x18, 0xbc, 0x70, 0x5b, 0x55, 0xfe, 0x8f, - 0x6b, 0x42, 0xf0, 0xd1, 0x21, 0xe3, 0xe7, 0x91, 0x59, 0x4e, 0x16, 0x83 - }, - { 0, }, // unused region 1a - { 0, }, // unused region 1b - { 0, }, // unused region 1c - { 0, }, // unused region 1d - { 0, }, // unused region 1e - { 0, }, // unused region 1f - { // region 20, $17a322 - 0xb3, 0x10, 0xf3, 0x0b, 0xe0, 0x71, 0x60, 0x53, 0x11, 0x9a, 0x12, 0x70, 0x1f, 0x1e, 0x81, 0xda, - 0x9d, 0x1f, 0x4b, 0xd6, 0x71, 0x48, 0x83, 0xe1, 0x04, 0x6c, 0x1b, 0xf1, 0xcd, 0x09, 0xdf, 0x3e, - 0x0b, 0xaa, 0x95, 0xc1, 0x07, 0xec, 0x0f, 0x54, 0xd0, 0x16, 0xb0, 0xdc, 0x86, 0x7b, 0x52, 0x38, - 0x3c, 0x68, 0x2b, 0xed, 0xe2, 0xeb, 0xb3, 0xc6, 0x48, 0x24, 0x41, 0x36, 0x17, 0x25, 0x1f, 0xa5, - 0x22, 0xc6, 0x5c, 0xa6, 0x19, 0xef, 0x17, 0x5c, 0x56, 0x4b, 0x4a, 0x2b, 0x75, 0xab, 0xe6, 0x22, - 0xd5, 0xc0, 0xd3, 0x46, 0xcc, 0xe4, 0xd4, 0xc4, 0x8c, 0x9a, 0x8a, 0x75, 0x24, 0x73, 0xa4, 0x26, - 0xca, 0x79, 0xaf, 0xb3, 0x94, 0x2a, 0x15, 0xbe, 0x40, 0x7b, 0x4d, 0xf6, 0xb4, 0xa4, 0x7b, 0xcf, - 0xce, 0xa0, 0x1d, 0xcb, 0x2f, 0x60, 0x28, 0x63, 0x85, 0x98, 0xd3, 0xd2, 0x45, 0x3f, 0x02, 0x65, - 0xd7, 0xf4, 0xbc, 0x2a, 0xe7, 0x50, 0xd1, 0x3f, 0x7f, 0xf6, 0x05, 0xb8, 0xe9, 0x39, 0x10, 0x6e, - 0x68, 0xa8, 0x89, 0x60, 0x00, 0x68, 0xfd, 0x20, 0xc4, 0xdc, 0xef, 0x67, 0x75, 0xfb, 0xbe, 0xfe, - 0x2b, 0x16, 0xa6, 0x5a, 0x77, 0x0d, 0x0c, 0xe2, 0x2d, 0xd1, 0xe4, 0x11, 0xc9, 0x4b, 0x81, 0x3a, - 0x0c, 0x24, 0xaa, 0x77, 0x2b, 0x2f, 0x83, 0x23, 0xd1, 0xe9, 0xa7, 0x29, 0x0a, 0xf9, 0x26, 0x9d, - 0x51, 0xc8, 0x6d, 0x71, 0x9d, 0xce, 0x46, 0x72, 0x26, 0x48, 0x3d, 0x64, 0xe5, 0x67, 0xbb, 0x1a, - 0xb4, 0x6d, 0x21, 0x11, 0x79, 0x78, 0xc2, 0xd5, 0x11, 0x6a, 0xd2, 0xea, 0x03, 0x4d, 0x92, 0xaf, - 0x18, 0xd5, 0x07, 0x79, 0xaa, 0xf9, 0x44, 0x93, 0x6f, 0x41, 0x22, 0x0d - }, - { // region 21, $17b3b4 - 0x2d, 0x50, 0xf3, 0x0b, 0xe0, 0x71, 0x61, 0x53, 0x11, 0xb4, 0x2c, 0xee, 0x34, 0x7e, 0x7d, 0x5e, - 0x62, 0x48, 0x97, 0xd2, 0xf9, 0x3a, 0xf2, 0xc9, 0xfa, 0x59, 0xe4, 0xe8, 0xf6, 0xd2, 0x9f, 0xb2, - 0xa7, 0x7e, 0x32, 0x86, 0xbc, 0x43, 0xec, 0xa0, 0xc2, 0xcb, 0x98, 0x33, 0x23, 0xd1, 0x58, 0x98, - 0x56, 0x05, 0xc7, 0xbc, 0x98, 0xd8, 0xdc, 0xb3, 0x35, 0xe8, 0x51, 0x6e, 0x3b, 0x7b, 0x89, 0xba, - 0xe1, 0xe5, 0x44, 0x5c, 0x24, 0x73, 0x04, 0x0d, 0xd9, 0x33, 0xf5, 0x63, 0xe9, 0x5c, 0x88, 0x05, - 0x18, 0xd0, 0x07, 0x5b, 0x1e, 0x81, 0x80, 0xac, 0x92, 0x6e, 0x13, 0x80, 0x1b, 0x29, 0xd2, 0xef, - 0x08, 0x84, 0x97, 0x23, 0xd1, 0x17, 0x2f, 0x38, 0xb4, 0x6d, 0x8f, 0x2a, 0x15, 0xf0, 0x40, 0xe9, - 0x02, 0x33, 0xd7, 0x5e, 0x99, 0x57, 0x15, 0x32, 0xbd, 0x8f, 0x48, 0x38, 0x91, 0x36, 0xe9, 0x07, - 0xc9, 0x37, 0x1d, 0x12, 0x2a, 0xbf, 0x5f, 0xdb, 0x85, 0x75, 0xbf, 0xdc, 0x59, 0x8a, 0x43, 0x51, - 0x4b, 0x77, 0xfd, 0x84, 0xc4, 0x28, 0xc7, 0x85, 0x25, 0x1a, 0x87, 0x8b, 0xc1, 0xd9, 0x1a, 0x78, - 0xe5, 0x03, 0x20, 0x56, 0xa0, 0xc2, 0x17, 0xf2, 0x29, 0xa0, 0xbd, 0xf8, 0x61, 0x9c, 0x7d, 0x54, - 0x3a, 0x11, 0xb5, 0x69, 0x9a, 0x1c, 0xbb, 0xf6, 0x2d, 0x86, 0xa8, 0x4d, 0xdd, 0x5a, 0xd6, 0xe4, - 0x11, 0x7e, 0x4b, 0x13, 0x6c, 0xb6, 0x01, 0x0a, 0x72, 0xbc, 0xe8, 0xf1, 0x82, 0x0e, 0xd0, 0xcf, - 0xbf, 0x50, 0x95, 0xb7, 0xa7, 0xec, 0xd7, 0xb3, 0x49, 0x5c, 0x47, 0x5f, 0xa9, 0xda, 0x70, 0xb0, - 0xdc, 0x9a, 0xa3, 0x48, 0xd3, 0xf5, 0x72, 0xd5, 0x43, 0xd8, 0x19, 0xcc - } -}; - -static UINT16 *sharedprotram; - -static UINT32 kb_regs[0x100]; -static UINT16 kb_prot_hold; -static UINT16 kb_prot_hilo; -static UINT32 kb_ptr; -static UINT8 kb_region; -static UINT8 kb_cmd; -static UINT8 kb_reg; -static UINT8 kb_swap; -static UINT8 kb_cmd3; -static UINT8 olds_bs; -static UINT32 kb_prot_hilo_select; -static UINT32 kb_game_id; - -static void IGS022_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mode) -{ - UINT16 param = mode >> 8; - - bprintf (0, _T("src: %4.4x, dst: %4.4x, size: %4.4x, mode: %4.4x\n"), src,dst,size,mode); - - mode &= 0x7; // what are the other bits? - - if ((mode == 0) || (mode == 1) || (mode == 2) || (mode == 3) || (mode == 4)) - { - UINT16 *PROTROM = (UINT16*)PGMProtROM; - for (INT32 x = 0; x < size; x++) - { - UINT16 dat2 = BURN_ENDIAN_SWAP_INT16(PROTROM[src + x]); - - UINT8 extraoffset = param&0xff; - UINT8* dectable = PGMProtROM; - UINT8 taboff = ((x*2)+extraoffset) & 0xff; - UINT16 extraxor = ((dectable[taboff+0]) << 8) | (dectable[taboff+1] << 0); - - dat2 = ((dat2 & 0x00ff)<<8) | ((dat2 & 0xff00)>>8); - - if (mode==4) - { - extraxor = 0; - if ((x & 0x003) == 0x000) extraxor |= 0x0049; // 'I' - if ((x & 0x003) == 0x001) extraxor |= 0x0047; // 'G' - if ((x & 0x003) == 0x002) extraxor |= 0x0053; // 'S' - if ((x & 0x003) == 0x003) extraxor |= 0x0020; // ' ' - if ((x & 0x300) == 0x000) extraxor |= 0x4900; // 'I' - if ((x & 0x300) == 0x100) extraxor |= 0x4700; // 'G' - if ((x & 0x300) == 0x200) extraxor |= 0x5300; // 'S' - if ((x & 0x300) == 0x300) extraxor |= 0x2000; // ' ' - - // extraxor = (extraxor << 8) | (extraxor >> 8); // - } - - // mode==0 plain - if (mode==3) dat2 ^= extraxor; - if (mode==2) dat2 += extraxor; - if (mode==1) dat2 -= extraxor; - - if (mode==4) - { - dat2 -= extraxor; - } - - sharedprotram[dst + x] = BURN_ENDIAN_SWAP_INT16(dat2); - } - } - else if (mode == 5) - { - UINT16 *PROTROM = (UINT16*)PGMProtROM; - - for (INT32 x = 0; x < size; x++) - { - UINT16 dat2 = BURN_ENDIAN_SWAP_INT16(PROTROM[src + x]); - - sharedprotram[dst + x] = dat2; - } - } - else if (mode == 6) - { - UINT16 *PROTROM = (UINT16*)PGMProtROM; - for (INT32 x = 0; x < size; x++) - { - UINT16 dat2 = PROTROM[src + x]; - - dat2 = ((dat2 & 0xf000) >> 12)| - ((dat2 & 0x0f00) >> 4)| - ((dat2 & 0x00f0) << 4)| - ((dat2 & 0x000f) << 12); - - sharedprotram[dst + x] = dat2; - } - } -} - -static void IGS022_reset() -{ - INT32 i; - UINT16 *PROTROM = (UINT16*)PGMProtROM; - UINT16 tmp; - - // fill ram with A5 patern - for (i = 0; i < 0x4000/2; i++) - sharedprotram[i] = BURN_ENDIAN_SWAP_INT16(0xa55a); - - // the auto-dma - UINT16 src = BURN_ENDIAN_SWAP_INT16(PROTROM[0x100 / 2]); - UINT32 dst = BURN_ENDIAN_SWAP_INT16(PROTROM[0x102 / 2]); - UINT16 size = BURN_ENDIAN_SWAP_INT16(PROTROM[0x104/ 2]); - UINT16 mode = BURN_ENDIAN_SWAP_INT16(PROTROM[0x106 / 2]); - - src = ((src & 0xff00) >> 8) | ((src & 0x00ff) << 8); - dst = ((dst & 0xff00) >> 8) | ((dst & 0x00ff) << 8); - size = ((size & 0xff00) >> 8) | ((size & 0x00ff) << 8); - mode &= 0xff; - - src >>= 1; - - IGS022_do_dma(src,dst,size,mode); - - // there is also a version ID? (or is it some kind of checksum) that is stored in the data rom, and gets copied.. - // Dragon World 3 checks it - tmp = BURN_ENDIAN_SWAP_INT16(PROTROM[0x114/2]); - tmp = ((tmp & 0xff00) >> 8) | ((tmp & 0x00ff) << 8); - sharedprotram[0x2a2/2] = BURN_ENDIAN_SWAP_INT16(tmp); -} - -static void IGS022_handle_command() -{ - UINT16 cmd = sharedprotram[0x200/2]; - - if (cmd == 0x6d) // Store values to asic ram - { - UINT32 p1 = (sharedprotram[0x298/2] << 16) | sharedprotram[0x29a/2]; - UINT32 p2 = (sharedprotram[0x29c/2] << 16) | sharedprotram[0x29e/2]; - - if ((p2 & 0xffff) == 0x9) // Set value - { - INT32 reg = (p2 >> 16) & 0xffff; - - if (reg & 0x300) { // 300?? killbld expects 0x200, drgw3 expects 0x100? - kb_regs[reg & 0xff] = p1; - } - } - - if ((p2 & 0xffff) == 0x6) // Add value - { - INT32 src1 = (p1 >> 16) & 0xff; - INT32 src2 = (p1 >> 0) & 0xff; - INT32 dst = (p2 >> 16) & 0xff; - - kb_regs[dst] = kb_regs[src2] - kb_regs[src1]; - } - - if ((p2 & 0xffff) == 0x1) // Add Imm? - { - INT32 reg = (p2 >> 16) & 0xff; - INT32 imm = (p1 >> 0) & 0xffff; - - kb_regs[reg] += imm; - } - - if ((p2 & 0xffff) == 0xa) // Get value - { - INT32 reg = (p1 >> 16) & 0xFF; - - sharedprotram[0x29c/2] = (kb_regs[reg] >> 16) & 0xffff; - sharedprotram[0x29e/2] = kb_regs[reg] & 0xffff; - } - - sharedprotram[0x202 / 2] = 0x7c; // this mode complete? - } - - // Is this actually what this is suppose to do? Complete guess. - if (cmd == 0x12) // copy?? - { - sharedprotram[0x28c / 2] = sharedprotram[0x288 / 2]; - sharedprotram[0x28e / 2] = sharedprotram[0x28a / 2]; - - sharedprotram[0x202 / 2] = 0x23; // this mode complete? - } - - // what do these do? write the completion byte for now... - if (cmd == 0x45) sharedprotram[0x202 / 2] = 0x56; - if (cmd == 0x5a) sharedprotram[0x202 / 2] = 0x4b; - if (cmd == 0x2d) sharedprotram[0x202 / 2] = 0x3c; - - if (cmd == 0x4f) // memcpy with encryption / scrambling - { - UINT16 src = sharedprotram[0x290 / 2] >> 1; - UINT32 dst = sharedprotram[0x292 / 2]; - UINT16 size = sharedprotram[0x294 / 2]; - UINT16 mode = sharedprotram[0x296 / 2]; - - IGS022_do_dma(src,dst,size,mode); - - sharedprotram[0x202 / 2] = 0x5e; // this mode complete? - } -} - -#if 0 -static UINT32 olds_prot_addr(UINT16 addr) -{ - switch (addr & 0xff) - { - case 0x0: - case 0x5: - case 0xa: return 0x402a00 + ((addr >> 8) << 2); - case 0x2: - case 0x8: return 0x402e00 + ((addr >> 8) << 2); - case 0x1: return 0x40307e; - case 0x3: return 0x403090; - case 0x4: return 0x40309a; - case 0x6: return 0x4030a4; - case 0x7: return 0x403000; - case 0x9: return 0x40306e; - case 0xb: return 0x403044; - } - - return 0; -} - -static UINT32 olds_read_reg(UINT16 addr) -{ - UINT32 protaddr = (olds_prot_addr(addr) - 0x400000) / 2; - return sharedprotram[protaddr] << 16 | sharedprotram[protaddr + 1]; -} - -static void olds_write_reg( UINT16 addr, UINT32 val ) -{ - sharedprotram[((olds_prot_addr(addr) - 0x400000) / 2) + 0] = val >> 16; - sharedprotram[((olds_prot_addr(addr) - 0x400000) / 2) + 1] = val & 0xffff; -} - -static void IGS028_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mode) -{ - UINT16 param = mode >> 8; - UINT16 *PROTROM = (UINT16*)(PGMUSER0 + 0x10000); - - mode &= 0x0f; - - switch (mode & 0x7) - { - case 0x00: // -= encryption - case 0x01: // swap nibbles - case 0x02: // ^= encryption - case 0x03: // unused? - case 0x04: // unused? - case 0x05: // swap bytes - case 0x06: // += encryption (correct?) - case 0x07: // unused? - { - UINT8 extraoffset = param & 0xff; - UINT8 *dectable = (UINT8 *)(PGMProtROM + (0x100 / 2)); - - for (INT32 x = 0; x < size; x++) - { - UINT16 dat2 = PROTROM[src + x]; - - int taboff = ((x*2)+extraoffset) & 0xff; // must allow for overflow in instances of odd offsets - unsigned short extraxor = ((dectable[taboff + 0]) << 0) | (dectable[taboff + 1] << 8); - - if (mode==0) dat2 -= extraxor; - else if (mode==1) dat2 = ((dat2 & 0xf0f0) >> 4)|((dat2 & 0x0f0f) << 4); - else if (mode==2) dat2 ^= extraxor; - else if (mode==5) dat2 = ((dat2 &0x00ff) << 8) | ((dat2 &0xff00) >> 8); - else if (mode==6) dat2 += extraxor; - else - { - UINT16 extraxor2 = 0; - if ((x & 0x003) == 0x000) extraxor2 |= 0x0049; // 'I' - if ((x & 0x003) == 0x001) extraxor2 |= 0x0047; // 'G' - if ((x & 0x003) == 0x002) extraxor2 |= 0x0053; // 'S' - if ((x & 0x003) == 0x003) extraxor2 |= 0x0020; // ' ' - if ((x & 0x300) == 0x000) extraxor2 |= 0x4900; // 'I' - if ((x & 0x300) == 0x100) extraxor2 |= 0x4700; // 'G' - if ((x & 0x300) == 0x200) extraxor2 |= 0x5300; // 'S' - if ((x & 0x300) == 0x300) extraxor2 |= 0x2000; // ' ' - - dat2 = 0x4e75; // hack - } - - sharedprotram[dst + x] = dat2; - } - } - break; - } -} - -static void IGS028_handle() -{ - UINT16 cmd = sharedprotram[0x3026 / 2]; - - switch (cmd) - { - case 0x12: - { - UINT16 mode = sharedprotram[0x303e / 2]; // ? - UINT16 src = sharedprotram[0x306a / 2] >> 1; // ? - UINT16 dst = sharedprotram[0x3084 / 2] & 0x1fff; - UINT16 size = sharedprotram[0x30a2 / 2] & 0x1fff; - - IGS028_do_dma(src, dst, size, mode); - } - break; - - case 0x64: // incomplete? - { - UINT16 p1 = sharedprotram[0x3050 / 2]; - UINT16 p2 = sharedprotram[0x3082 / 2]; - UINT16 p3 = sharedprotram[0x3054 / 2]; - UINT16 p4 = sharedprotram[0x3088 / 2]; - - if (p2 == 0x02) - olds_write_reg(p1, olds_read_reg(p1) + 0x10000); - - switch (p4) - { - case 0xd: - olds_write_reg(p1,olds_read_reg(p3)); - break; - case 0x0: - olds_write_reg(p3,(olds_read_reg(p2))^(olds_read_reg(p1))); - break; - case 0xe: - olds_write_reg(p3,olds_read_reg(p3)+0x10000); - break; - case 0x2: - olds_write_reg(p1,(olds_read_reg(p2))+(olds_read_reg(p3))); - break; - case 0x6: - olds_write_reg(p3,(olds_read_reg(p2))&(olds_read_reg(p1))); - break; - case 0x1: - olds_write_reg(p2,olds_read_reg(p1)+0x10000); - break; - case 0x7: - olds_write_reg(p3,olds_read_reg(p1)); - break; - } - } - break; - } -} -#endif - -static void killbld_protection_calculate_hold(INT32 y, INT32 z) -{ - UINT16 old = kb_prot_hold; - - kb_prot_hold = ((old << 1) | (old >> 15)); - - kb_prot_hold ^= 0x2bad; - kb_prot_hold ^= BIT(z, y); - kb_prot_hold ^= BIT(old, 7) << 0; - kb_prot_hold ^= BIT(~old, 13) << 4; - kb_prot_hold ^= BIT(old, 3) << 11; - - kb_prot_hold ^= (kb_prot_hilo & ~0x0408) << 1; -} - -static void killbld_protection_calculate_hilo() -{ - kb_prot_hilo_select++; - - if (kb_prot_hilo_select > 0xeb) { - kb_prot_hilo_select = 0; - } - - UINT8 source = source_data[kb_region][kb_prot_hilo_select]; - - if (kb_prot_hilo_select & 1) - { - kb_prot_hilo = (kb_prot_hilo & 0x00ff) | (source << 8); - } - else - { - kb_prot_hilo = (kb_prot_hilo & 0xff00) | (source << 0); - } -} - -static void __fastcall killbld_igs025_prot_write(UINT32 address, UINT16 data) -{ - bprintf (0, _T("PRTW: %5.5x %4.4x\n"), address, data); - - if ((address & 0xf0000f) == 0xd00000) { - kb_cmd = data; - return; - } - - switch (kb_cmd) - { - case 0x00: - kb_reg = data; - break; - - case 0x01: // drgw3 - { - if (data == 0x0002) { // Execute command - IGS022_handle_command(); - } - } - break; - - case 0x02: // killbld - { - if (data == 0x0001) { // Execute command - IGS022_handle_command(); - kb_reg++; - } - } - break; - - case 0x03: - kb_swap = data; - break; - - case 0x04: - // kb_ptr = data; // Suspect. Not good for drgw3 - break; - - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - kb_ptr++; - killbld_protection_calculate_hold(kb_cmd & 0x0f, data & 0xff); - break; - } -} - -#if 0 -static void __fastcall olds_igs025_prot_write(UINT32 address, UINT16 data) -{ - bprintf (0, _T("PRTW: %5.5x %4.4x\n"), address, data); - - if (address == 0xdcb400) { - kb_cmd = data; - return; - } - - switch (kb_cmd) - { - case 0x00: - kb_reg = data; - break; - - case 0x02: - olds_bs = ((data & 0x03) << 6) | ((data & 0x04) << 3) | ((data & 0x08) << 1); - break; - - case 0x03: - { - IGS028_handle(); - kb_cmd3 = ((data >> 4) + 1) & 0x3; - } - break; - - case 0x04: - kb_ptr = data; - break; - - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - kb_ptr++; - killbld_protection_calculate_hold(kb_cmd & 0x0f, data & 0xff); - break; - } -} -#endif - -static void __fastcall drgw2_igs025_prot_write(UINT32 address, UINT16 data) -{ - bprintf (0, _T("PRTW: %5.5x %4.4x\n"), address, data); - - if (address == 0xd80000) { - kb_cmd = data; - return; - } - - switch (kb_cmd) - { - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - kb_ptr++; - killbld_protection_calculate_hold(kb_cmd & 0x0f, data & 0xff); - break; - } -} - -static UINT16 __fastcall igs025_prot_read(UINT32 address) -{ - bprintf (0, _T("PRTR: %5.5x\n"), address); - - switch (kb_cmd) - { - case 0x00: - return BITSWAP08((kb_swap + 1) & 0x7f, 0, 1, 2, 3, 4, 5, 6, 7); // drgw3 - - case 0x01: - return kb_reg & 0x7f; - - case 0x02: - return olds_bs | 0x80; - - case 0x03: - return kb_cmd3; - - case 0x05: - { - switch (kb_ptr) - { - case 1: - return 0x3f00 | ((kb_game_id >> 0) & 0xff); - - case 2: - return 0x3f00 | ((kb_game_id >> 8) & 0xff); - - case 3: - return 0x3f00 | ((kb_game_id >> 16) & 0xff); - - case 4: - return 0x3f00 | ((kb_game_id >> 24) & 0xff); - - default: // >= 5 - return 0x3f00 | BITSWAP08(kb_prot_hold, 5, 2, 9, 7, 10, 13, 12, 15); - } - } - - case 0x40: - killbld_protection_calculate_hilo(); - return 0; - } - - return 0; -} - -static void common_reset() -{ - kb_region = PgmInput[7]; - - kb_prot_hold = 0; - kb_prot_hilo = 0; - kb_prot_hilo_select = 0; - kb_cmd = 0; - kb_reg = 0; - kb_ptr = 0; - kb_swap = 0; - olds_bs = 0; - kb_cmd3 = 0; - - memset(kb_regs, 0, 0x100 * sizeof(UINT32)); -} - -static void drgw2_reset() -{ - if (strcmp(BurnDrvGetTextA(DRV_NAME), "drgw2") == 0) kb_region = 6; - if (strcmp(BurnDrvGetTextA(DRV_NAME), "dw2v100x") == 0) kb_region = 6; - if (strcmp(BurnDrvGetTextA(DRV_NAME), "drgw2c") == 0) kb_region = 5; - if (strcmp(BurnDrvGetTextA(DRV_NAME), "drgw2j") == 0) kb_region = 1; - - common_reset(); -} - -static void killbld_reset() -{ - common_reset(); - - kb_game_id = 0x89911400 | kb_region; - - IGS022_reset(); -} - -static void drgw3_reset() -{ - common_reset(); - - kb_game_id = 0x00060000 | kb_region; - - IGS022_reset(); -} - -static INT32 CommonScan(INT32 nAction, INT32 *) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = PGMUSER0; - ba.nLen = 0x0004000; - ba.nAddress = 0x400000; - ba.szName = "ProtRAM"; - BurnAcb(&ba); - - ba.Data = (UINT8*)kb_regs; - ba.nLen = 0x00100 * sizeof(INT32); - ba.nAddress = 0xfffffc00; - ba.szName = "Protection Registers"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(kb_prot_hold); - SCAN_VAR(kb_prot_hilo); - SCAN_VAR(kb_ptr); - SCAN_VAR(kb_region); - SCAN_VAR(kb_cmd); - SCAN_VAR(kb_reg); - SCAN_VAR(kb_swap); - SCAN_VAR(kb_cmd3); - SCAN_VAR(olds_bs); - SCAN_VAR(kb_prot_hilo_select); - SCAN_VAR(kb_game_id); - } - - return 0; -} - -#if 0 -static void olds_reset() -{ - common_reset(); - - kb_game_id = 0x00900000 | kb_region; - - sharedprotram[0x1000/2] = 0x4749; // 'IGS.28' - sharedprotram[0x1002/2] = 0x2E53; - sharedprotram[0x1004/2] = 0x3832; - - sharedprotram[0x3064/2] = 0xB315; // crc? -} -#endif - -void install_protection_asic25_asic22_killbld() -{ - BurnByteswap(PGMProtROM, 0x10000); - - pPgmScanCallback = CommonScan; - pPgmResetCallback = killbld_reset; - - sharedprotram = (UINT16*)PGMUSER0; - - SekOpen(0); - SekMapMemory(PGMUSER0, 0x300000, 0x303fff, MAP_RAM); - SekMapHandler(4, 0xd40000, 0xd40003, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, igs025_prot_read); - SekSetWriteWordHandler(4, killbld_igs025_prot_write); - SekClose(); -} - -void install_protection_asic25_asic22_drgw3() -{ - BurnByteswap(PGMProtROM, 0x10000); - - pPgmScanCallback = CommonScan; - pPgmResetCallback = drgw3_reset; - - sharedprotram = (UINT16*)PGMUSER0; - - SekOpen(0); - SekMapMemory(PGMUSER0, 0x300000, 0x303fff, MAP_RAM); - SekMapHandler(4, 0xda5610, 0xda5613, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, igs025_prot_read); - SekSetWriteWordHandler(4, killbld_igs025_prot_write); - SekClose(); -} - -void install_protection_asic25_asic12_dw2() -{ - pPgmScanCallback = CommonScan; - pPgmResetCallback = drgw2_reset; - - SekOpen(0); - SekMapHandler(4, 0xd80000, 0xd80003, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, igs025_prot_read); - SekSetWriteWordHandler(4, drgw2_igs025_prot_write); - SekClose(); -} - -#if 0 -void install_protection_asic25_asic28_olds() -{ - pPgmScanCallback = CommonScan; - pPgmResetCallback = olds_reset; - - sharedprotram = (UINT16*)PGMUSER0; - - SekOpen(0); - SekMapMemory(PGMUSER0, 0x400000, 0x403fff, MAP_RAM); - SekMapHandler(4, 0xdcb400, 0xdcb403, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, igs025_prot_read); - SekSetWriteWordHandler(4, olds_igs025_prot_write); - SekClose(); -} -#endif - - - -static INT32 m_olds_cmd; -static INT32 m_olds_reg; -static INT32 m_olds_ptr; -static UINT16 m_olds_bs; -static UINT16 m_olds_cmd3; -static UINT16 m_olds_prot_hold; -static UINT16 m_olds_prot_hilo; -static UINT16 m_olds_prot_hilo_select; - -static UINT32 olds_prot_addr(UINT16 addr) -{ - switch (addr & 0xff) - { - case 0x0: - case 0x5: - case 0xa: return 0x402a00 + ((addr >> 8) << 2); - case 0x2: - case 0x8: return 0x402e00 + ((addr >> 8) << 2); - case 0x1: return 0x40307e; - case 0x3: return 0x403090; - case 0x4: return 0x40309a; - case 0x6: return 0x4030a4; - case 0x7: return 0x403000; - case 0x9: return 0x40306e; - } - - return 0; -} - -static UINT32 olds_read_reg(UINT16 addr) -{ - UINT32 protaddr = (olds_prot_addr(addr) - 0x400000) / 2; - return sharedprotram[protaddr] << 16 | sharedprotram[protaddr + 1]; -} - -static void olds_write_reg( UINT16 addr, UINT32 val ) -{ - sharedprotram[(olds_prot_addr(addr) - 0x400000) / 2] = val >> 16; - sharedprotram[(olds_prot_addr(addr) - 0x400000) / 2 + 1] = val & 0xffff; -} - -static void IGS028_do_dma(UINT16 src, UINT16 dst, UINT16 size, UINT16 mode) -{ - UINT16 param = mode >> 8; - UINT16 *PROTROM = (UINT16*)(PGMUSER0 + 0x10000); - - mode &= 0x0f; - -// bprintf (0, _T("SRC: %4.4x, DST: %4.4x, SIZE: %4.4x, PARAM: %2.2x, MODE: %x\n"), src, dst*2, size*2, param, mode); - - switch (mode & 0x7) - { - case 0x00: // -= encryption - case 0x01: // swap nibbles - case 0x02: // ^= encryption - case 0x03: // unused? - case 0x04: // unused? - case 0x05: // swap bytes - case 0x06: // += encryption (correct?) - case 0x07: // unused? - { - UINT8 extraoffset = param & 0xff; - UINT8 *dectable = PGMUSER0 + 0x10100; - - for (INT32 x = 0; x < size; x++) - { - UINT16 dat2 = PROTROM[src + x]; - - int taboff = ((x*2)+extraoffset) & 0xff; // must allow for overflow in instances of odd offsets - unsigned short extraxor = ((dectable[taboff + 0]) << 0) | (dectable[taboff + 1] << 8); - - if (mode==0) dat2 -= extraxor; - else if (mode==1) dat2 = ((dat2 & 0xf0f0) >> 4)|((dat2 & 0x0f0f) << 4); - else if (mode==2) dat2 ^= extraxor; - else if (mode==5) dat2 = ((dat2 &0x00ff) << 8) | ((dat2 &0xff00) >> 8); - else if (mode==6) dat2 += extraxor; - else - { - UINT16 extraxor2 = 0; - if ((x & 0x003) == 0x000) extraxor2 |= 0x0049; // 'I' - if ((x & 0x003) == 0x001) extraxor2 |= 0x0047; // 'G' - if ((x & 0x003) == 0x002) extraxor2 |= 0x0053; // 'S' - if ((x & 0x003) == 0x003) extraxor2 |= 0x0020; // ' ' - if ((x & 0x300) == 0x000) extraxor2 |= 0x4900; // 'I' - if ((x & 0x300) == 0x100) extraxor2 |= 0x4700; // 'G' - if ((x & 0x300) == 0x200) extraxor2 |= 0x5300; // 'S' - if ((x & 0x300) == 0x300) extraxor2 |= 0x2000; // ' ' - - dat2 = 0x4e75; // hack - } - - sharedprotram[dst + x] = dat2; - } - } - break; - } -} - -static void olds_protection_calculate_hold(int y, int z) // calculated in routine $12dbc2 in olds -{ - unsigned short old = m_olds_prot_hold; - - m_olds_prot_hold = ((old << 1) | (old >> 15)); - - m_olds_prot_hold ^= 0x2bad; - m_olds_prot_hold ^= BIT(z, y); - m_olds_prot_hold ^= BIT( old, 7) << 0; - m_olds_prot_hold ^= BIT(~old, 13) << 4; - m_olds_prot_hold ^= BIT( old, 3) << 11; - - m_olds_prot_hold ^= (m_olds_prot_hilo & ~0x0408) << 1; // $81790c -} - -static void olds_protection_calculate_hilo() // calculated in routine $12dbc2 in olds -{ - UINT8 source; - - m_olds_prot_hilo_select++; - if (m_olds_prot_hilo_select > 0xeb) { - m_olds_prot_hilo_select = 0; - } - - source = source_data[PgmInput[7]][m_olds_prot_hilo_select]; - - if (m_olds_prot_hilo_select & 1) // $8178fa - { - m_olds_prot_hilo = (m_olds_prot_hilo & 0x00ff) | (source << 8); // $8178d8 - } - else - { - m_olds_prot_hilo = (m_olds_prot_hilo & 0xff00) | (source << 0); // $8178d8 - } -} - -static void __fastcall olds_protection_w(UINT32 offset, UINT16 data) -{ - offset &= 2; - - if (offset == 0) - { - m_olds_cmd = data; - } - else - { - switch (m_olds_cmd) - { - case 0x00: - m_olds_reg = data; - break; - - case 0x02: - m_olds_bs = ((data & 0x03) << 6) | ((data & 0x04) << 3) | ((data & 0x08) << 1); - break; - - case 0x03: - { - UINT16 cmd = sharedprotram[0x3026 / 2]; - - switch (cmd) - { - case 0x12: - { - UINT16 mode = sharedprotram[0x303e / 2]; // ? - UINT16 src = sharedprotram[0x306a / 2] >> 1; // ? - UINT16 dst = sharedprotram[0x3084 / 2] & 0x1fff; - UINT16 size = sharedprotram[0x30a2 / 2] & 0x1fff; - - IGS028_do_dma(src, dst, size, mode); - } - break; - - case 0x64: // incomplete... - { - UINT16 p1 = sharedprotram[0x3050 / 2]; - UINT16 p2 = sharedprotram[0x3082 / 2]; - UINT16 p3 = sharedprotram[0x3054 / 2]; - UINT16 p4 = sharedprotram[0x3088 / 2]; - - if (p2 == 0x02) - olds_write_reg(p1, olds_read_reg(p1) + 0x10000); - - switch (p4) - { - case 0xd: - olds_write_reg(p1,olds_read_reg(p3)); - break; - case 0x0: - olds_write_reg(p3,(olds_read_reg(p2))^(olds_read_reg(p1))); - break; - case 0xe: - olds_write_reg(p3,olds_read_reg(p3)+0x10000); - break; - case 0x2: - olds_write_reg(p1,(olds_read_reg(p2))+(olds_read_reg(p3))); - break; - case 0x6: - olds_write_reg(p3,(olds_read_reg(p2))&(olds_read_reg(p1))); - break; - case 0x1: - olds_write_reg(p2,olds_read_reg(p1)+0x10000); - break; - case 0x7: - olds_write_reg(p3,olds_read_reg(p1)); - break; - default: - break; - } - } - } - - m_olds_cmd3 = ((data >> 4) + 1) & 0x3; - } - break; - - case 0x04: - m_olds_ptr = data; - break; - - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - m_olds_ptr++; - olds_protection_calculate_hold(m_olds_cmd & 0x0f, data & 0xff); - break; - } - } -} - -static UINT16 __fastcall olds_protection_r(UINT32 offset) -{ - offset &= 2; - - if (offset) - { - switch (m_olds_cmd) - { - case 0x01: - return m_olds_reg & 0x7f; - - case 0x02: - return m_olds_bs | 0x80; - - case 0x03: - return m_olds_cmd3; - - case 0x05: - { - switch (m_olds_ptr) - { - case 1: return 0x3f00 | PgmInput[7]; - - case 2: - return 0x3f00 | 0x00; - - case 3: - return 0x3f00 | 0x90; - - case 4: - return 0x3f00 | 0x00; - - case 5: - default: // >= 5 - return 0x3f00 | BITSWAP08(m_olds_prot_hold, 5,2,9,7,10,13,12,15); // $817906 - } - } - - case 0x40: - olds_protection_calculate_hilo(); - return 0; // unused? - } - } - - return 0; -} - -static void reset_olds() -{ -// written by protection device -// there seems to be an auto-dma that writes from $401000-402573? - sharedprotram[0x1000/2] = 0x4749; // 'IGS.28' - sharedprotram[0x1002/2] = 0x2E53; - sharedprotram[0x1004/2] = 0x3832; - sharedprotram[0x3064/2] = 0xB315; // crc or status check? - -// Should these be written by command 64?? -// sharedprotram[0x2a00/2] = 0x0000; // ? -// sharedprotram[0x2a02/2] = 0x0000; // ? - sharedprotram[0x2a04/2] = 0x0002; // ? -// sharedprotram[0x2a06/2] = 0x0000; // ? -// sharedprotram[0x2ac0/2] = 0x0000; // ? - sharedprotram[0x2ac2/2] = 0x0001; // ? -// sharedprotram[0x2e00/2] = 0x0000; // ? -// sharedprotram[0x2e02/2] = 0x0000; // ? -// sharedprotram[0x2e04/2] = 0x0000; // ? - sharedprotram[0x2e06/2] = 0x0009; // seconds on char. select timer -// sharedprotram[0x2e08/2] = 0x0000; // ? - sharedprotram[0x2e0a/2] = 0x0006; // ? - - m_olds_prot_hold = 0; - m_olds_prot_hilo = 0; - m_olds_prot_hilo_select = 0; - m_olds_cmd = 0; - m_olds_reg = 0; - m_olds_ptr = 0; - m_olds_bs = 0; - m_olds_cmd3 = 0; -} - -static INT32 oldsScan(INT32 nAction, INT32 *) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = PGMUSER0 + 0x000000; - ba.nLen = 0x0004000; - ba.nAddress = 0x400000; - ba.szName = "ProtRAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(m_olds_prot_hold); - SCAN_VAR(m_olds_prot_hilo); - SCAN_VAR(m_olds_prot_hilo_select); - SCAN_VAR(m_olds_cmd); - SCAN_VAR(m_olds_reg); - SCAN_VAR(m_olds_ptr); - SCAN_VAR(m_olds_bs); - SCAN_VAR(m_olds_cmd3); - } - - return 0; -} - -// hack... -static UINT16 __fastcall olds_mainram_read_word(UINT32 address) -{ - if (SekGetPC(-1) >= 0x100000 && address != 0x8178d8) SekWriteWord(0x8178f4, SekReadWord(0x8178D8)); - - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(PGM68KRAM + (address & 0x1fffe)))); -} - -static UINT8 __fastcall olds_mainram_read_byte(UINT32 address) -{ - return PGM68KRAM[(address & 0x1ffff)^1]; -} - -void install_protection_asic25_asic28_olds() -{ - pPgmScanCallback = oldsScan; - pPgmResetCallback = reset_olds; - - sharedprotram = (UINT16*)PGMUSER0; - - // no protection rom and different offset for olds100a - if (strcmp(BurnDrvGetTextA(DRV_NAME), "olds100a") == 0) { - BurnLoadRom(PGMUSER0 + 0x10000, 15, 1); - } else { - BurnLoadRom(PGMUSER0 + 0x10000, 19, 1); - } - - SekOpen(0); - - SekMapMemory(PGMUSER0, 0x400000, 0x403fff, MAP_RAM); - - SekMapHandler(4, 0xdcb400, 0xdcb403, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, olds_protection_r); - SekSetWriteWordHandler(4, olds_protection_w); - - SekMapHandler(5, 0x8178f4, 0x8178f5, MAP_ROM); - SekSetReadWordHandler(5, olds_mainram_read_word); - SekSetReadByteHandler(5, olds_mainram_read_byte); - - SekClose(); -} - diff --git a/jan/src/burn/drv/pgm/pgm_asic27a_type1.cpp b/jan/src/burn/drv/pgm/pgm_asic27a_type1.cpp deleted file mode 100644 index 28e44686f..000000000 --- a/jan/src/burn/drv/pgm/pgm_asic27a_type1.cpp +++ /dev/null @@ -1,1451 +0,0 @@ -#include "pgm.h" - -/* - IGS Asic27a (type 1) proper emulation - - Used by: - Knights of Valour Superheroes - Photo Y2K - Knights of Valour Super Heroes Plus (Using a small hack) - Various Knights of Valour bootlegs - - Simulations - - Used by: - Oriental Legends Super Plus - ----------------------------------------------------------- - DoDonPachi Dai-Ou-Jou / DoDonPachi Dai-Ou-Jou Black Label - Ketsui Kizuna Jigoku Tachi - Espgaluda - ----------------------------------------------------------- - Knights of Valour - ----------------------------------------------------------- - Puzzli 2 - ----------------------------------------------------------- - Photo Y2K2 - NOT WORKING! - ----------------------------------------------------------- - Puzzle Star - NOT WORKING! -*/ - -static UINT16 kovsh_highlatch_arm_w; -static UINT16 kovsh_lowlatch_arm_w; -static UINT16 kovsh_highlatch_68k_w; -static UINT16 kovsh_lowlatch_68k_w ; -static UINT32 kovsh_counter; - -static inline void pgm_cpu_sync() -{ - INT32 nCycles = SekTotalCycles() - Arm7TotalCycles(); - - if (nCycles > 100) { - Arm7Run(nCycles); - } -} - -static void __fastcall kovsh_asic27a_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x500000: - case 0x600000: - kovsh_lowlatch_68k_w = data; - return; - - case 0x500002: - case 0x600002: - kovsh_highlatch_68k_w = data; - return; - } -} - -static UINT16 __fastcall kovsh_asic27a_read_word(UINT32 address) -{ - if ((address & 0xffffc0) == 0x4f0000) { - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(PGMARMShareRAM + (address & 0x3e)))); - } - - switch (address) - { - case 0x500000: - case 0x600000: - pgm_cpu_sync(); - return kovsh_lowlatch_arm_w; - - case 0x500002: - case 0x600002: - pgm_cpu_sync(); - return kovsh_highlatch_arm_w; - } - - return 0; -} - -static void kovsh_asic27a_arm7_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffff80) == 0x50800000) { // written... but never read? - *((UINT16*)(PGMARMShareRAM + ((address>>1) & 0x3e))) = BURN_ENDIAN_SWAP_INT16(data); - return; - } -} - -static void kovsh_asic27a_arm7_write_long(UINT32 address, UINT32 data) -{ - switch (address) - { - case 0x40000000: - { - kovsh_highlatch_arm_w = data >> 16; - kovsh_lowlatch_arm_w = data; - - kovsh_highlatch_68k_w = 0; - kovsh_lowlatch_68k_w = 0; - } - return; - } -} - -static UINT32 kovsh_asic27a_arm7_read_long(UINT32 address) -{ - switch (address) - { - case 0x40000000: - return (kovsh_highlatch_68k_w << 16) | (kovsh_lowlatch_68k_w); - - case 0x4000000c: - return kovsh_counter++; - } - - return 0; -} - -static void reset_kovsh_asic27a() -{ - kovsh_highlatch_arm_w = 0; - kovsh_lowlatch_arm_w = 0; - kovsh_highlatch_68k_w = 0; - kovsh_lowlatch_68k_w = 0; - kovsh_counter = 1; -} - -static INT32 kovsh_asic27aScan(INT32 nAction, INT32 *) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = PGMARMShareRAM; - ba.nLen = 0x0000040; - ba.nAddress = 0x400000; - ba.szName = "ARM SHARE RAM"; - BurnAcb(&ba); - - ba.Data = PGMARMRAM0; - ba.nLen = 0x0000400; - ba.nAddress = 0; - ba.szName = "ARM RAM 0"; - BurnAcb(&ba); - - ba.Data = PGMARMRAM2; - ba.nLen = 0x0000400; - ba.nAddress = 0; - ba.szName = "ARM RAM 1"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - Arm7Scan(nAction); - - SCAN_VAR(kovsh_highlatch_arm_w); - SCAN_VAR(kovsh_lowlatch_arm_w); - SCAN_VAR(kovsh_highlatch_68k_w); - SCAN_VAR(kovsh_lowlatch_68k_w); - SCAN_VAR(kovsh_counter); - } - - return 0; -} - -void install_protection_asic27a_kovsh() -{ - nPGMArm7Type = 1; - pPgmScanCallback = kovsh_asic27aScan; - pPgmResetCallback = reset_kovsh_asic27a; - - SekOpen(0); - SekMapMemory(PGMARMShareRAM, 0x4f0000, 0x4f003f, MAP_RAM); - - SekMapHandler(4, 0x500000, 0x600005, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, kovsh_asic27a_read_word); - SekSetWriteWordHandler(4, kovsh_asic27a_write_word); - SekClose(); - - Arm7Init(0); - Arm7Open(0); - Arm7MapMemory(PGMARMROM, 0x00000000, 0x00003fff, MAP_ROM); - Arm7MapMemory(PGMARMRAM0, 0x10000000, 0x100003ff, MAP_RAM); - Arm7MapMemory(PGMARMRAM2, 0x50000000, 0x500003ff, MAP_RAM); - Arm7SetWriteWordHandler(kovsh_asic27a_arm7_write_word); - Arm7SetWriteLongHandler(kovsh_asic27a_arm7_write_long); - Arm7SetReadLongHandler(kovsh_asic27a_arm7_read_long); - Arm7Close(); -} - -//------------------------------- -// Knights of Valour Super Heroes Plus Hack - -void __fastcall kovshp_asic27a_write_word(UINT32 address, UINT16 data) -{ - switch (address & 6) - { - case 0: - kovsh_lowlatch_68k_w = data; - return; - - case 2: - { - unsigned char asic_key = data >> 8; - unsigned char asic_cmd = (data & 0xff) ^ asic_key; - - switch (asic_cmd) // Intercept commands and translate them to those used by kovsh - { - case 0x9a: asic_cmd = 0x99; break; // kovassga - case 0xa6: asic_cmd = 0xa9; break; // kovassga - case 0xaa: asic_cmd = 0x56; break; // kovassga - case 0xf8: asic_cmd = 0xf3; break; // kovassga - - case 0x38: asic_cmd = 0xad; break; - case 0x43: asic_cmd = 0xca; break; - case 0x56: asic_cmd = 0xac; break; - case 0x73: asic_cmd = 0x93; break; - case 0x84: asic_cmd = 0xb3; break; - case 0x87: asic_cmd = 0xb1; break; - case 0x89: asic_cmd = 0xb6; break; - case 0x93: asic_cmd = 0x73; break; - case 0xa5: asic_cmd = 0xa9; break; - case 0xac: asic_cmd = 0x56; break; - case 0xad: asic_cmd = 0x38; break; - case 0xb1: asic_cmd = 0x87; break; - case 0xb3: asic_cmd = 0x84; break; - case 0xb4: asic_cmd = 0x90; break; - case 0xb6: asic_cmd = 0x89; break; - case 0xc5: asic_cmd = 0x8c; break; - case 0xca: asic_cmd = 0x43; break; - case 0xcc: asic_cmd = 0xf0; break; - case 0xd0: asic_cmd = 0xe0; break; - case 0xe0: asic_cmd = 0xd0; break; - case 0xe7: asic_cmd = 0x70; break; - case 0xed: asic_cmd = 0xcb; break; - case 0xf0: asic_cmd = 0xcc; break; - case 0xf1: asic_cmd = 0xf5; break; - case 0xf2: asic_cmd = 0xf1; break; - case 0xf4: asic_cmd = 0xf2; break; - case 0xf5: asic_cmd = 0xf4; break; - case 0xfc: asic_cmd = 0xc0; break; - case 0xfe: asic_cmd = 0xc3; break; - } - - kovsh_highlatch_68k_w = asic_cmd ^ (asic_key | (asic_key << 8)); - } - return; - } -} - -void install_protection_asic27a_kovshp() -{ - nPGMArm7Type = 1; - pPgmScanCallback = kovsh_asic27aScan; - - SekOpen(0); - SekMapMemory(PGMARMShareRAM, 0x4f0000, 0x4f003f, MAP_RAM); - - SekMapHandler(4, 0x500000, 0x600005, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, kovsh_asic27a_read_word); - SekSetWriteWordHandler(4, kovshp_asic27a_write_word); - SekClose(); - - Arm7Init(0); - Arm7Open(0); - Arm7MapMemory(PGMARMROM, 0x00000000, 0x00003fff, MAP_ROM); - Arm7MapMemory(PGMARMRAM0, 0x10000000, 0x100003ff, MAP_RAM); - Arm7MapMemory(PGMARMRAM2, 0x50000000, 0x500003ff, MAP_RAM); - Arm7SetWriteWordHandler(kovsh_asic27a_arm7_write_word); - Arm7SetWriteLongHandler(kovsh_asic27a_arm7_write_long); - Arm7SetReadLongHandler(kovsh_asic27a_arm7_read_long); - Arm7Close(); -} - - - -//------------------------------------------ -// Common asic27a (type 1) simulation functions - - -static UINT16 asic27a_sim_value; -static UINT16 asic27a_sim_key; -static UINT32 asic27a_sim_response; -static UINT32 asic27a_sim_slots[0x100]; -static UINT16 asic27a_sim_regs[0x100]; -static UINT8 asic27a_sim_internal_slot; - -static void (*asic27a_sim_command)(UINT8); - -void __fastcall asic27a_sim_write(UINT32 offset, UINT16 data) -{ - switch (offset & 0x06) - { - case 0: asic27a_sim_value = data; return; - - case 2: - { - if ((data >> 8) == 0xff) asic27a_sim_key = 0xffff; - - asic27a_sim_value ^= asic27a_sim_key; - - UINT8 command = (data ^ asic27a_sim_key) & 0xff; - - asic27a_sim_regs[command] = asic27a_sim_value; - - // bprintf (0, _T("Command: %2.2x, Data: %2.2x\n"), command, asic27a_sim_value); - - asic27a_sim_command(command); - - asic27a_sim_key = (asic27a_sim_key + 0x0100) & 0xff00; - if (asic27a_sim_key == 0xff00) asic27a_sim_key = 0x0100; - asic27a_sim_key |= asic27a_sim_key >> 8; - } - return; - - case 4: return; - } -} - -static UINT16 __fastcall asic27a_sim_read(UINT32 offset) -{ - switch (offset & 0x02) - { - case 0: return (asic27a_sim_response >> 0) ^ asic27a_sim_key; - case 2: return (asic27a_sim_response >> 16) ^ asic27a_sim_key; - } - - return 0; -} - -static void asic27a_sim_reset() -{ - // The ASIC27a writes this to shared RAM - UINT8 ram_string[16] = { - 'I', 'G', 'S', 'P', 'G', 'M', 0, 0, 0, 0/*REGION*/, 'C', 'H', 'I', 'N', 'A', 0 - }; - - memset (PGMUSER0, 0, 0x400); - - ram_string[9] = PgmInput[7]; // region - - memcpy (PGMUSER0, ram_string, 16); - - BurnByteswap(PGMUSER0, 0x10); - - memset (asic27a_sim_slots, 0, 0x100 * sizeof(INT32)); - memset (asic27a_sim_regs, 0, 0x100 * sizeof(INT16)); - - asic27a_sim_value = 0; - asic27a_sim_key = 0; - asic27a_sim_response = 0; - asic27a_sim_internal_slot = 0; -} - -static INT32 asic27a_sim_scan(INT32 nAction, INT32 *) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = (UINT8*)asic27a_sim_slots; - ba.nLen = 0x0000100 * sizeof(INT32); - ba.nAddress = 0xff00000; - ba.szName = "ASIC27a Slots"; - BurnAcb(&ba); - - ba.Data = (UINT8*)asic27a_sim_regs; - ba.nLen = 0x0000100 * sizeof(INT16); - ba.nAddress = 0xff01000; - ba.szName = "ASIC27a Regs"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(asic27a_sim_value); - SCAN_VAR(asic27a_sim_key); - SCAN_VAR(asic27a_sim_response); - SCAN_VAR(asic27a_sim_internal_slot); - } - - return 0; -} - - -//--------------------------------- -// Simulation used by DoDonPachi Dai-Ou-Jou, Ketsui Kizuna Jigoku Tachi, and Espgaluda - -static void ddp3_asic27a_sim_command(UINT8 command) -{ - switch (command) - { - case 0x40: // Combine slot values - asic27a_sim_slots[(asic27a_sim_value >> 10) & 0x1f] = (asic27a_sim_slots[(asic27a_sim_value >> 5) & 0x1f] + asic27a_sim_slots[(asic27a_sim_value >> 0) & 0x1f]) & 0xffffff; - asic27a_sim_response = 0x880000; - break; - - case 0x67: // Select slot & write (high) - asic27a_sim_internal_slot = asic27a_sim_value >> 8; - asic27a_sim_slots[asic27a_sim_internal_slot] = (asic27a_sim_value & 0x00ff) << 16; - asic27a_sim_response = 0x880000; - break; - - case 0xe5: // Write slot (low) - asic27a_sim_slots[asic27a_sim_internal_slot] |= asic27a_sim_value; - asic27a_sim_response = 0x880000; - break; - - case 0x8e: // Read slot - asic27a_sim_response = asic27a_sim_slots[asic27a_sim_value & 0xff]; - break; - - case 0x99: // Reset? - asic27a_sim_key = 0; - asic27a_sim_response = 0x880000 | (PgmInput[7] << 8); - break; - - default: - asic27a_sim_response = 0x880000; - break; - } -} - -void install_protection_asic27a_ketsui() -{ - pPgmResetCallback = asic27a_sim_reset; - pPgmScanCallback = asic27a_sim_scan; - asic27a_sim_command = ddp3_asic27a_sim_command; - - SekOpen(0); - SekMapHandler(4, 0x400000, 0x400005, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, asic27a_sim_read); - SekSetWriteWordHandler(4, asic27a_sim_write); - SekClose(); -} - -void install_protection_asic27a_ddp3() -{ - pPgmResetCallback = asic27a_sim_reset; - pPgmScanCallback = asic27a_sim_scan; - asic27a_sim_command = ddp3_asic27a_sim_command; - - SekOpen(0); - SekMapHandler(4, 0x500000, 0x500005, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, asic27a_sim_read); - SekSetWriteWordHandler(4, asic27a_sim_write); - SekClose(); -} - - -//-------------------------- -// Simulation for Oriental Legends Super Plus - -static const UINT8 oldsplus_fc[0x20]={ - 0x00,0x00,0x0a,0x3a,0x4e,0x2e,0x03,0x40,0x33,0x43,0x26,0x2c,0x00,0x00,0x00,0x00, - 0x00,0x00,0x44,0x4d,0x0b,0x27,0x3d,0x0f,0x37,0x2b,0x02,0x2f,0x15,0x45,0x0e,0x30 -}; - -static const UINT16 oldsplus_90[0x7]={ - 0x50,0xa0,0xc8,0xf0,0x190,0x1f4,0x258 -}; - -static const UINT8 oldsplus_5e[0x20]={ - 0x04,0x04,0x04,0x04,0x04,0x03,0x03,0x03,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -static const UINT8 oldsplus_b0[0xe0]={ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04, - 0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, - 0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18, - 0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c, - 0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c, - 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, - 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f, - 0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13, - 0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x1f,0x1f,0x1f,0x1f -}; - -static const UINT8 oldsplus_ae[0xe0]={ - 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, - 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, - 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, - 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, - 0x1E,0x1F,0x20,0x21,0x22,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23, - 0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23, - 0x1F,0x20,0x21,0x22,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23, - 0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23, - 0x20,0x21,0x22,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23, - 0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23, - 0x21,0x22,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23, - 0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23, - 0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23, - 0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23 -}; - -static const UINT16 oldsplus_ba[0x4]={ - 0x3138,0x2328,0x1C20,0x1518 -}; - -static const UINT16 oldsplus_8c[0x20]={ - 0x0032,0x0032,0x0064,0x0096,0x0096,0x00fa,0x012c,0x015e,0x0032,0x0064,0x0096,0x00c8,0x00c8,0x012c,0x015e,0x0190, - 0x0064,0x0096,0x00c8,0x00fa,0x00fa,0x015e,0x0190,0x01c2,0x0096,0x00c8,0x00fa,0x012c,0x012c,0x0190,0x01c2,0x01f4 -}; - -static inline UINT16 oldsplus_9d(UINT16 a) -{ - const UINT8 tab[8] = { 0x3c, 0x46, 0x5a, 0x6e, 0x8c, 0xc8, 0x50, }; - - if ((a % 0x27) <= 0x07) return (a % 0x27) * 0x64; - if ((a % 0x27) >= 0x17) return 0x6bc; - - return 0x2bc + (tab[a / 0x27] * ((a % 0x27) - 7)); -} - -static void oldsplus_asic27a_sim_command(UINT8 command) -{ - switch (command) - { - case 0x88: // Reset? - asic27a_sim_key = 0; - asic27a_sim_response = 0x990000 | (PgmInput[7] << 8); - break; - - case 0xa0: - asic27a_sim_response = ((asic27a_sim_value >= 0x0f) ? 0x0f : asic27a_sim_value) * 0x23; - break; - - case 0xd0: // Text palette offset - asic27a_sim_response = 0xa01000 + (asic27a_sim_value << 5); - break; - - case 0xc0: // Sprite palette offset - asic27a_sim_response = 0xa00000 + (asic27a_sim_value << 6); - break; - - case 0xc3: // Background palette offset - asic27a_sim_response = 0xa00800 + (asic27a_sim_value << 6); - break; - - case 0x33: // Store regs - asic27a_sim_response = 0x990000; - break; - - case 0x35: // Add '36' reg - asic27a_sim_regs[0x36] += asic27a_sim_value; - asic27a_sim_response = 0x990000; - break; - - case 0x36: // Store regs - asic27a_sim_response = 0x990000; - break; - - case 0x37: // Add '33' reg - asic27a_sim_regs[0x33] += asic27a_sim_value; - asic27a_sim_response = 0x990000; - break; - - case 0x34: // Read '36' reg - asic27a_sim_response = asic27a_sim_regs[0x36]; - break; - - case 0x38: // Read '33' reg - asic27a_sim_response = asic27a_sim_regs[0x33]; - break; - - case 0xe7: // Select slot - { - asic27a_sim_response = 0x990000; - - asic27a_sim_internal_slot = (asic27a_sim_value >> 12) & 0x0f; - } - break; - - case 0xe5: // Write slot - { - asic27a_sim_response = 0x990000; - - asic27a_sim_slots[asic27a_sim_internal_slot] = asic27a_sim_value; - - if (asic27a_sim_internal_slot == 0x0b) asic27a_sim_slots[0xc] = 0; // ?? - } - break; - - case 0xf8: // Read slot - asic27a_sim_response = asic27a_sim_slots[asic27a_sim_value]; - break; - - case 0xc5: // Increment slot 'd' - asic27a_sim_slots[0xd]--; - asic27a_sim_response = 0x990000; - break; - - case 0xd6: // Increment slot 'b' - asic27a_sim_slots[0xb]++; - asic27a_sim_response = 0x990000; - break; - - case 0x3a: // Clear slot 'f' - asic27a_sim_slots[0xf] = 0; - asic27a_sim_response = 0x990000; - break; - - case 0xf0: // Background layer 'x' select - asic27a_sim_response = 0x990000; - break; - - case 0xed: // Background layer offset - if (asic27a_sim_value & 0x400) asic27a_sim_value = -(0x400 - (asic27a_sim_value & 0x3ff)); - asic27a_sim_response = 0x900000 + ((asic27a_sim_regs[0xf0] + (asic27a_sim_value * 0x40)) * 4); - break; - - case 0xe0: // Text layer 'x' select - asic27a_sim_response = 0x990000; - break; - - case 0xdc: // Text layer offset - asic27a_sim_response = 0x904000 + ((asic27a_sim_regs[0xe0] + (asic27a_sim_value * 0x40)) * 4); - break; - - case 0xcb: // Some sort of status read? - asic27a_sim_response = 0x00c000; - break; - - case 0x5e: // Read from data table - asic27a_sim_response = oldsplus_5e[asic27a_sim_value]; - break; - - case 0x80: // Read from data table - asic27a_sim_response = (asic27a_sim_value < 4) ? ((asic27a_sim_value + 1) * 0xbb8) : 0xf4240; - break; - - case 0x8c: // Read from data table - asic27a_sim_response = oldsplus_8c[asic27a_sim_value]; - break; - - case 0x90: // Read from data table - asic27a_sim_response = oldsplus_90[asic27a_sim_value]; - break; - - case 0x9d: // Read from data table - asic27a_sim_response = oldsplus_9d(asic27a_sim_value); - break; - - case 0xae: // Read from data table - asic27a_sim_response = oldsplus_ae[asic27a_sim_value]; - break; - - case 0xb0: // Read from data table - asic27a_sim_response = oldsplus_b0[asic27a_sim_value]; - break; - - case 0xba: // Read from data table - asic27a_sim_response = oldsplus_ba[asic27a_sim_value]; - break; - - case 0xfc: // Read from data table - asic27a_sim_response = oldsplus_fc[asic27a_sim_value]; - break; - - default: - asic27a_sim_response = 0x990000; - break; - } -} - -void install_protection_asic27a_oldsplus() -{ - pPgmResetCallback = asic27a_sim_reset; - pPgmScanCallback = asic27a_sim_scan; - asic27a_sim_command = oldsplus_asic27a_sim_command; - - SekOpen(0); - SekMapMemory(PGMUSER0, 0x4f0000, 0x4f003f | 0x3ff, MAP_READ); // ram - - SekMapHandler(4, 0x500000, 0x500003, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, asic27a_sim_read); - SekSetWriteWordHandler(4, asic27a_sim_write); - SekClose(); -} - - - -//----------------------------------------------------------------------------------------------------- -// Simulation used by Knights of Valour - - -static const UINT8 B0TABLE[8] = { 2, 0, 1, 4, 3 }; // Maps char portraits to tables - -static const UINT8 BATABLE[0x40] = { - 0x00,0x29,0x2c,0x35,0x3a,0x41,0x4a,0x4e,0x57,0x5e,0x77,0x79,0x7a,0x7b,0x7c,0x7d, - 0x7e,0x7f,0x80,0x81,0x82,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x90, - 0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9e,0xa3,0xd4,0xa9,0xaf,0xb5,0xbb,0xc1 -}; - -static void kov_asic27a_sim_command(UINT8 command) -{ - switch (command) - { - case 0x67: // unknown or status check? - case 0x8e: - case 0xa3: - case 0x33: // kovsgqyz (a3) - case 0x3a: // kovplus - case 0xc5: // kovplus - asic27a_sim_response = 0x880000; - break; - - case 0x99: // Reset - asic27a_sim_key = 0; - asic27a_sim_response = 0x880000 | (PgmInput[7] << 8); - break; - - case 0x9d: // Sprite palette offset - asic27a_sim_response = 0xa00000 + ((asic27a_sim_value & 0x1f) * 0x40); - break; - - case 0xb0: // Read from data table - asic27a_sim_response = B0TABLE[asic27a_sim_value & 0x07]; - break; - - case 0xb4: // Copy slot 'a' to slot 'b' - case 0xb7: // kovsgqyz (b4) - { - asic27a_sim_response = 0x880000; - - if (asic27a_sim_value == 0x0102) asic27a_sim_value = 0x0100; // why? - - asic27a_sim_slots[(asic27a_sim_value >> 8) & 0x0f] = asic27a_sim_slots[(asic27a_sim_value >> 0) & 0x0f]; - } - break; - - case 0xba: // Read from data table - asic27a_sim_response = BATABLE[asic27a_sim_value & 0x3f]; - break; - - case 0xc0: // Text layer 'x' select - asic27a_sim_response = 0x880000; - break; - - case 0xc3: // Text layer offset - asic27a_sim_response = 0x904000 + ((asic27a_sim_regs[0xc0] + (asic27a_sim_value * 0x40)) * 4); - break; - - case 0xcb: // Background layer 'x' select - asic27a_sim_response = 0x880000; - break; - - case 0xcc: // Background layer offset - { - INT32 y = asic27a_sim_value; - if (y & 0x400) y = -(0x400 - (y & 0x3ff)); - asic27a_sim_response = 0x900000 + (((asic27a_sim_regs[0xcb] + y * 64) * 4)); - } - break; - - case 0xd0: // Text palette offset - case 0xcd: // kovsgqyz (d0) - asic27a_sim_response = 0xa01000 + (asic27a_sim_value * 0x20); - break; - - case 0xd6: // Copy slot to slot 0 - asic27a_sim_response = 0x880000; - asic27a_sim_slots[0] = asic27a_sim_slots[asic27a_sim_value & 0x0f]; - break; - - case 0xdc: // Background palette offset - case 0x11: // kovsgqyz (dc) - asic27a_sim_response = 0xa00800 + (asic27a_sim_value * 0x40); - break; - - case 0xe0: // Sprite palette offset - case 0x9e: // kovsgqyz (e0) - asic27a_sim_response = 0xa00000 + ((asic27a_sim_value & 0x1f) * 0x40); - break; - - case 0xe5: // Write slot (low) - { - asic27a_sim_response = 0x880000; - - asic27a_sim_slots[asic27a_sim_internal_slot] = (asic27a_sim_slots[asic27a_sim_internal_slot] & 0x00ff0000) | ((asic27a_sim_value & 0xffff) << 0); - } - break; - - case 0xe7: // Write slot (and slot select) (high) - { - asic27a_sim_response = 0x880000; - asic27a_sim_internal_slot = (asic27a_sim_value >> 12) & 0x0f; - - asic27a_sim_slots[asic27a_sim_internal_slot] = (asic27a_sim_slots[asic27a_sim_internal_slot] & 0x0000ffff) | ((asic27a_sim_value & 0x00ff) << 16); - } - break; - - case 0xf0: // Some sort of status read? - asic27a_sim_response = 0x00c000; - break; - - case 0xf8: // Read slot - case 0xab: // kovsgqyz (f8) - asic27a_sim_response = asic27a_sim_slots[asic27a_sim_value & 0x0f] & 0x00ffffff; - break; - - case 0xfc: // Adjust damage level to char experience level - asic27a_sim_response = (asic27a_sim_value * asic27a_sim_regs[0xfe]) >> 6; - break; - - case 0xfe: // Damage level adjust - asic27a_sim_response = 0x880000; - break; - - default: - asic27a_sim_response = 0x880000; - break; - } -} - -void install_protection_asic27_kov() -{ - pPgmResetCallback = asic27a_sim_reset; - pPgmScanCallback = asic27a_sim_scan; - asic27a_sim_command = kov_asic27a_sim_command; - - SekOpen(0); - SekMapMemory(PGMUSER0, 0x4f0000, 0x4f003f | 0x3ff, MAP_READ); - - SekMapHandler(4, 0x500000, 0x500003, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, asic27a_sim_read); - SekSetWriteWordHandler(4, asic27a_sim_write); - SekClose(); -} - - -//-------------------- -// Simulation used by Puzzli 2 - -static int stage; -static int tableoffs; -static int tableoffs2; -static int entries_left; -static int currentcolumn; -static int currentrow; -static int num_entries; -static int full_entry; -static int prev_tablloc; -static int numbercolumns; -static int depth; -static UINT16 m_row_bitmask; -static int hackcount; -static int hackcount2; -static int hack_47_value; -static int hack_31_table_offset; -static int p2_31_retcounter; -static int command_31_write_type; -static UINT16 level_structure[8][10]; - -static const UINT8 puzzli2_level_decode[256] = { - 0x32, 0x3e, 0xb2, 0x37, 0x31, 0x22, 0xd6, 0x0d, 0x35, 0x5c, 0x8d, 0x3c, 0x7a, 0x5f, 0xd7, 0xac, // 0x0 - 0x53, 0xff, 0xeb, 0x44, 0xe8, 0x11, 0x69, 0x77, 0xd9, 0x34, 0x36, 0x45, 0xa6, 0xe9, 0x1c, 0xc6, // 0x1 - 0x3b, 0xbd, 0xad, 0x2e, 0x18, 0xdf, 0xa1, 0xab, 0xdd, 0x52, 0x57, 0xc2, 0xe5, 0x0a, 0x00, 0x6d, // 0x2 - 0x67, 0x64, 0x15, 0x70, 0xb6, 0x39, 0x27, 0x78, 0x82, 0xd2, 0x71, 0xb9, 0x13, 0xf5, 0x93, 0x92, // 0x3 - 0xfa, 0xe7, 0x5e, 0xb0, 0xf6, 0xaf, 0x95, 0x8a, 0x7c, 0x73, 0xf9, 0x63, 0x86, 0xcb, 0x1a, 0x56, // 0x4 - 0xf1, 0x3a, 0xae, 0x61, 0x01, 0x29, 0x97, 0x23, 0x8e, 0x5d, 0x9a, 0x65, 0x74, 0x21, 0x20, 0x40, // 0x5 - 0xd3, 0x05, 0xa2, 0xe1, 0xbc, 0x9e, 0x1e, 0x10, 0x14, 0x0c, 0x88, 0x9c, 0xec, 0x38, 0xb5, 0x9d, // 0x6 - 0x2d, 0xf7, 0x17, 0x0e, 0x84, 0xc7, 0x7d, 0xce, 0x94, 0x16, 0x48, 0xa8, 0x81, 0x6e, 0x7b, 0xd8, // 0x7 - 0xa7, 0x7f, 0x42, 0xe6, 0xa0, 0x2a, 0xef, 0xee, 0x24, 0xba, 0xb8, 0x7e, 0xc9, 0x2b, 0x90, 0xcc, // 0x8 - 0x5b, 0xd1, 0xf3, 0xe2, 0x6f, 0xed, 0x9f, 0xf0, 0x4b, 0x54, 0x8c, 0x08, 0xf8, 0x51, 0x68, 0xc8, // 0x9 - 0x03, 0x0b, 0xbb, 0xc1, 0xe3, 0x4d, 0x04, 0xc5, 0x8f, 0x09, 0x0f, 0xbf, 0x62, 0x49, 0x76, 0x59, // 0xa - 0x1d, 0x80, 0xde, 0x60, 0x07, 0xe0, 0x1b, 0x66, 0xa5, 0xbe, 0xcd, 0x87, 0xdc, 0xc3, 0x6b, 0x4e, // 0xb - 0xd0, 0xfd, 0xd4, 0x3f, 0x98, 0x96, 0x2f, 0x4c, 0xb3, 0xea, 0x2c, 0x75, 0xe4, 0xc0, 0x6c, 0x6a, // 0xc - 0x9b, 0xb7, 0x43, 0x8b, 0x41, 0x47, 0x02, 0xdb, 0x99, 0x3d, 0xa3, 0x79, 0x50, 0x4f, 0xb4, 0x55, // 0xd - 0x5a, 0x25, 0xf4, 0xca, 0x58, 0x30, 0xc4, 0x12, 0xa9, 0x46, 0xda, 0x91, 0xa4, 0xaa, 0xfc, 0x85, // 0xe - 0xfb, 0x89, 0x06, 0xcf, 0xfe, 0x33, 0xd5, 0x28, 0x1f, 0x19, 0x4a, 0xb1, 0x83, 0xf2, 0x72, 0x26, // 0xf -}; - -static int get_position_of_bit(UINT16 value, int bit_wanted) -{ - int count = 0; - for (int i=0;i<16;i++) - { - int bit = (value >> i) & 1; - - if (bit) count++; - - if (count==(bit_wanted+1)) - return i; - } - - return -1; -} - -static int puzzli2_take_leveldata_value(UINT8 datvalue) -{ - if (stage==-1) - { - tableoffs = 0; - tableoffs2 = 0; - entries_left = 0; - currentcolumn = 0; - currentrow = 0; - num_entries = 0; - full_entry = 0; - prev_tablloc = 0; - numbercolumns = 0; - depth = 0; - m_row_bitmask = 0; - - tableoffs = datvalue; - tableoffs2 = 0; - stage = 0; - } - else - { - UINT8 rawvalue = datvalue; - UINT8 tableloc = (tableoffs+tableoffs2)&0xff; - rawvalue ^= puzzli2_level_decode[tableloc]; - - tableoffs2++; - tableoffs2&=0xf; - - if (stage==0) - { - stage = 1; - depth = (rawvalue & 0xf0); - numbercolumns = (rawvalue & 0x0f); - numbercolumns++; - } - else if (stage==1) - { - stage = 2; - entries_left = (rawvalue >> 4); - m_row_bitmask = (rawvalue & 0x0f)<<8; - full_entry = rawvalue; - prev_tablloc = tableloc; - num_entries = entries_left; - } - else if (stage==2) - { - stage = 3; - m_row_bitmask |= rawvalue; - - if (entries_left == 0) - { - stage = 1; - currentcolumn++; - currentrow = 0; - m_row_bitmask = 0; - - if (currentcolumn==numbercolumns) - { - return 1; - } - } - } - else if (stage==3) - { - UINT16 object_value; - - if (rawvalue<=0x10) object_value = 0x0100 + rawvalue; - else if (rawvalue<=0x21) object_value = 0x0120 + (rawvalue - 0x11); - else if (rawvalue<=0x32) object_value = 0x0140 + (rawvalue - 0x22); - else if (rawvalue<=0x43) object_value = 0x0180 + (rawvalue - 0x33); - else if (rawvalue==0xd0) object_value = 0x0200; - else if (rawvalue==0xe0) object_value = 0x8000; - else if (rawvalue==0xe1) object_value = 0x8020; // solid slant top down - else if (rawvalue==0xe2) object_value = 0x8040; // solid slant top up - else if (rawvalue==0xe3) object_value = 0x8060; - else if (rawvalue==0xe4) object_value = 0x8080; // sold slant bottom up - else object_value = 0x0110; - - int realrow = get_position_of_bit(m_row_bitmask, currentrow); - - if (realrow != -1) - level_structure[currentcolumn][realrow] = object_value; - - currentrow++; - - entries_left--; - if (entries_left == 0) - { - stage = 1; - currentcolumn++; - currentrow = 0; - m_row_bitmask = 0; - - if (currentcolumn==numbercolumns) - { - return 1; - } - } - } - } - - return 0; -} - -static void puzzli2_asic27a_sim_command(UINT8 command) -{ - switch (command) - { - case 0x31: - { - if (command_31_write_type==2) - { - if (hackcount2==0) - { - puzzli2_take_leveldata_value(asic27a_sim_value&0xff); - - hack_31_table_offset = asic27a_sim_value & 0xff; - hackcount2++; - asic27a_sim_response = 0x00d20000; - } - else - { - int end = puzzli2_take_leveldata_value(asic27a_sim_value&0xff); - - if (!end) - { - asic27a_sim_response = 0x00d20000; - hackcount2++; - } - else - { - hackcount2=0; - asic27a_sim_response = 0x00630000 | numbercolumns; - } - } - } - else - { - asic27a_sim_response = 0x00d20000 | p2_31_retcounter; - p2_31_retcounter++; - } - } - break; - - case 0x13: - { - UINT16* leveldata = &level_structure[0][0]; - if (hackcount==0) - { - asic27a_sim_response = 0x002d0000 | ((depth>>4)+1); - } - else if (hackcount<((10*numbercolumns)+1)) - { - asic27a_sim_response = 0x002d0000 | leveldata[hackcount-1]; - } - else - { - hackcount=0; - asic27a_sim_response = 0x00740054; - } - - hackcount++; - } - break; - - case 0x38: // Reset - { - asic27a_sim_response = 0x780000 | (PgmInput[7] << 8); - asic27a_sim_key = 0x100; - } - break; - - case 0x47: - hack_47_value = asic27a_sim_value; - asic27a_sim_response = 0x00740047; - break; - - case 0x52: - { - int val = ((hack_47_value & 0x0f00)>>8) * 0x19; - if (asic27a_sim_value!=0x0000) - { - val +=((hack_47_value & 0x000f)>>0) * 0x05; - } - val += asic27a_sim_value & 0x000f; - asic27a_sim_response = 0x00740000 | (val & 0xffff); - } - break; - - case 0x61: - command_31_write_type = 1; - asic27a_sim_response = 0x360000; - p2_31_retcounter = 0xc; - break; - - case 0x41: // ASIC status? - command_31_write_type = 0; - asic27a_sim_response = 0x740061; - break; - - case 0x54: // ?? - { - command_31_write_type = 2; - stage = -1; - hackcount2 = 0; - hackcount = 0; - asic27a_sim_response = 0x360000; - - // clear the return structure - for (int columns=0;columns<8;columns++) - for (int rows=0;rows<10;rows++) - level_structure[columns][rows] = 0x0000; - } - break; - - case 0x63: - { - UINT32 z80table[2][8] = { - { 0x1694a8, 0x16cfae, 0x16ebf2, 0x16faa8, 0x174416, 0x600000, 0x600000, 0x600000 }, // puzzli2 - { 0x19027a, 0x193D80, 0x1959c4, 0x19687a, 0x19b1e8, 0x600000, 0x600000, 0x600000 } // puzzli2s - }; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME),"puzzli2")) - { - asic27a_sim_response = z80table[0][asic27a_sim_value & 7]; - } - else {// puzzli2 super - asic27a_sim_response = z80table[1][asic27a_sim_value & 7]; - } - } - break; - - case 0x67: - { - UINT32 z80table[2][8] = { - { 0x166178, 0x166178, 0x166178, 0x166178, 0x166e72, 0x600000, 0x600000, 0x600000 }, // puzzli2 - { 0x18cf4a, 0x18cf4a, 0x18cf4a, 0x18cf4a, 0x18dc44, 0x600000, 0x600000, 0x600000 } // puzzli2s - }; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME),"puzzli2")) - { - asic27a_sim_response = z80table[0][asic27a_sim_value & 7]; - } - else {// puzzli2 super - asic27a_sim_response = z80table[1][asic27a_sim_value & 7]; - } - } - break; - - default: - asic27a_sim_response = 0x740000; - break; - } -} - -void install_protection_asic27a_puzzli2() -{ - pPgmResetCallback = asic27a_sim_reset; - pPgmScanCallback = asic27a_sim_scan; - asic27a_sim_command = puzzli2_asic27a_sim_command; - - SekOpen(0); - SekMapMemory(PGMUSER0, 0x4f0000, 0x4f003f | 0x3ff, MAP_READ); - - SekMapHandler(4, 0x500000, 0x500003, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, asic27a_sim_read); - SekSetWriteWordHandler(4, asic27a_sim_write); - SekClose(); -} - - -//------------------------------------------------------------------------------------------- -// Simulation used by Photo Y2k2 (not working!) - - -static void py2k2_asic27a_sim_command(UINT8 command) -{ - switch (command) - { - case 0x30: // Sprite sequence, advance to next sprite - break; - - case 0x32: // Sprite sequence, decode offset - break; - - // case 0x33: - // case 0x34: - // case 0x35: // table? - // case 0x38: // ? - // break; - - // "CCHANGE.C 285 ( TIME >= VALUE1 ) && TIME <= ALL_LEV_TIME ) - case 0xba: // ?? - asic27a_sim_response = asic27a_sim_value + 1; // gets us in-game - break; - - case 0x99: // Reset? - asic27a_sim_key = 0x100; - asic27a_sim_response = 0x880000 | (PgmInput[7] << 8); - break; - - case 0xc0: - asic27a_sim_response = 0x880000; - break; - - case 0xc3: - asic27a_sim_response = 0x904000 + ((asic27a_sim_regs[0xc0] + (asic27a_sim_value * 0x40)) * 4); - break; - - case 0xd0: - asic27a_sim_response = 0xa01000 + (asic27a_sim_value * 0x20); - break; - - case 0xdc: - asic27a_sim_response = 0xa00800 + (asic27a_sim_value * 0x40); - break; - - case 0xe0: - asic27a_sim_response = 0xa00000 + ((asic27a_sim_value & 0x1f) * 0x40); - break; - - case 0xcb: // Background layer 'x' select (pgm3in1, same as kov) - asic27a_sim_response = 0x880000; - break; - - case 0xcc: // Background layer offset (pgm3in1, same as kov) - { - INT32 y = asic27a_sim_value; - if (y & 0x400) y = -(0x400 - (y & 0x3ff)); - asic27a_sim_response = 0x900000 + ((asic27a_sim_regs[0xcb] + (y * 0x40)) * 4); - } - break; - - default: - asic27a_sim_response = 0x880000; - bprintf (0, _T("Unknown ASIC Command %2.2x Value: %4.4x\n"), command, asic27a_sim_value); - break; - } -} - -void install_protection_asic27a_py2k2() -{ - pPgmResetCallback = asic27a_sim_reset; - pPgmScanCallback = asic27a_sim_scan; - asic27a_sim_command = py2k2_asic27a_sim_command; - - SekOpen(0); - SekMapMemory(PGMUSER0, 0x4f0000, 0x4f003f | 0x3ff, MAP_READ); - - SekMapHandler(4, 0x500000, 0x500003, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, asic27a_sim_read); - SekSetWriteWordHandler(4, asic27a_sim_write); - SekClose(); -} - - - -//------------------------------------------------------------------------- -// Simulation used by Puzzle Star - - -static const UINT8 Pstar_ba[0x1e]={ - 0x02,0x00,0x00,0x01,0x00,0x03,0x00,0x00,0x02,0x00,0x06,0x00,0x22,0x04,0x00,0x03, - 0x00,0x00,0x06,0x00,0x20,0x07,0x00,0x03,0x00,0x21,0x01,0x00,0x00,0x63 -}; - -static const UINT8 Pstar_b0[0x10]={ - 0x09,0x0A,0x0B,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x00,0x00,0x00,0x00 -}; - -static const UINT16 Pstar_ae[0x10]={ - 0x5D,0x86,0x8C,0x8B,0xE0,0x8B,0x62,0xAF,0xB6,0xAF,0x10A,0xAF,0x00,0x00,0x00,0x00 -}; - -static const UINT8 Pstar_a0[0x10]={ - 0x02,0x03,0x04,0x05,0x06,0x01,0x0A,0x0B,0x0C,0x0D,0x0E,0x09,0x00,0x00,0x00,0x00 -}; - -static const UINT8 Pstar_9d[0x10]={ - 0x05,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -static const UINT8 Pstar_90[0x10]={ - 0x0C,0x10,0x0E,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -static const UINT8 Pstar_8c[0x23]={ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01, - 0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x04,0x04,0x04, - 0x03,0x03,0x03 -}; - -static const UINT8 Pstar_80[0x1a3]={ - 0x03,0x03,0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x03,0x03,0x04,0x04, - 0x05,0x05,0x05,0x05,0x06,0x06,0x07,0x07,0x03,0x03,0x04,0x04,0x05,0x05,0x05,0x05, - 0x06,0x06,0x07,0x07,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07,0x07, - 0x06,0x06,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07,0x08,0x08,0x05,0x05,0x05,0x05, - 0x05,0x05,0x05,0x06,0x06,0x06,0x07,0x07,0x06,0x06,0x06,0x07,0x07,0x07,0x08,0x08, - 0x09,0x09,0x09,0x09,0x07,0x07,0x07,0x07,0x07,0x08,0x08,0x08,0x08,0x09,0x09,0x09, - 0x06,0x06,0x07,0x07,0x07,0x08,0x08,0x08,0x08,0x08,0x09,0x09,0x05,0x05,0x06,0x06, - 0x06,0x07,0x07,0x08,0x08,0x08,0x08,0x09,0x07,0x07,0x07,0x07,0x07,0x08,0x08,0x08, - 0x08,0x09,0x09,0x09,0x06,0x06,0x07,0x03,0x07,0x06,0x07,0x07,0x08,0x07,0x05,0x04, - 0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,0x06,0x06,0x06,0x03,0x04,0x04,0x04, - 0x04,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x04,0x04,0x05,0x05,0x06,0x06,0x06,0x06, - 0x06,0x07,0x07,0x08,0x05,0x05,0x06,0x07,0x07,0x08,0x08,0x08,0x08,0x08,0x08,0x08, - 0x05,0x05,0x05,0x07,0x07,0x07,0x07,0x07,0x07,0x08,0x08,0x08,0x08,0x08,0x09,0x09, - 0x09,0x09,0x03,0x04,0x04,0x05,0x05,0x05,0x06,0x06,0x07,0x07,0x07,0x07,0x08,0x08, - 0x08,0x09,0x09,0x09,0x03,0x04,0x05,0x05,0x04,0x03,0x04,0x04,0x04,0x05,0x05,0x04, - 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x04, - 0x04,0x04,0x04,0x04,0x04,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00, - 0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00 -}; - -static UINT16 __fastcall puzlstar_protram_read_word(UINT32 offset) -{ - if ((offset & 0x3e) == 0x08) return PgmInput[7]; // Region - if ((offset & 0x38) == 0x20) return asic27a_sim_slots[((offset & 0x06)/2)+0x10]--; // Timer - - return 0; -} - -static UINT8 __fastcall puzlstar_protram_read_byte(UINT32 offset) -{ - if ((offset & 0x3e) == 0x08) return PgmInput[7]; // Region - - return 0; -} - -static void puzlstar_asic27a_sim_command(UINT8 command) -{ - switch (command) - { - case 0x99: // Reset? - asic27a_sim_key = 0x100; - asic27a_sim_response = 0x880000 | (PgmInput[7] << 8); - break; - - case 0xb1: - asic27a_sim_response = 0x890000; - break; - - case 0xbf: - asic27a_sim_response = asic27a_sim_regs[0xb1] * asic27a_sim_value; - break; - - case 0xc1: // TODO: TIMER 0,1,2,FIX TO 0 should be OK? - asic27a_sim_response = 0; - break; - - case 0xce: // TODO: TIMER 0,1,2 - asic27a_sim_response = 0x890000; - break; - - case 0xcf: // TODO:TIMER 0,1,2 - asic27a_sim_slots[asic27a_sim_regs[0xce] + 0x10] = asic27a_sim_value; - asic27a_sim_response = 0x890000; - break; - - case 0xd0: // Text palette offset - asic27a_sim_response = 0xa01000 + (asic27a_sim_value << 5); - break; - - case 0xdc: // Background palette offset - asic27a_sim_response = 0xa00800 + (asic27a_sim_value << 6); - break; - - case 0xe0: // Sprite palette offset - asic27a_sim_response = 0xa00000 + (asic27a_sim_value << 6); - break; - - case 0xe5: // Write slot (low) - { - asic27a_sim_response = 0x890000; - - asic27a_sim_slots[asic27a_sim_internal_slot] = (asic27a_sim_slots[asic27a_sim_internal_slot] & 0xff0000) | (asic27a_sim_value); - } - break; - - case 0xe7: // Write slot (and slot select) (high) - { - asic27a_sim_response = 0x890000; - - asic27a_sim_internal_slot = (asic27a_sim_value >> 12) & 0xf; - asic27a_sim_slots[asic27a_sim_internal_slot] = (asic27a_sim_slots[asic27a_sim_internal_slot] & 0x00ffff) | ((asic27a_sim_value & 0xff) << 16); - } - break; - - case 0xf8: // Read slot - asic27a_sim_response = asic27a_sim_slots[asic27a_sim_value]; - break; - - case 0x80: // Read from data table - asic27a_sim_response = Pstar_80[asic27a_sim_value]; - break; - - case 0x8c: // Read from data table - asic27a_sim_response = Pstar_8c[asic27a_sim_value]; - break; - - case 0x90: // Read from data table - asic27a_sim_response = Pstar_90[asic27a_sim_value]; - break; - - case 0x9d: // Read from data table - asic27a_sim_response = Pstar_9d[asic27a_sim_value]; - break; - - case 0xa0: // Read from data table - asic27a_sim_response = Pstar_a0[asic27a_sim_value]; - break; - - case 0xae: // Read from data table - asic27a_sim_response = Pstar_ae[asic27a_sim_value]; - break; - - case 0xb0: // Read from data table - asic27a_sim_response = Pstar_b0[asic27a_sim_value]; - break; - - case 0xba: // Read from data table - asic27a_sim_response = Pstar_ba[asic27a_sim_value]; - break; - - default: - asic27a_sim_response = 0x890000; - break; - } -} - -void install_protection_asic27a_puzlstar() -{ - pPgmResetCallback = asic27a_sim_reset; - pPgmScanCallback = asic27a_sim_scan; - - asic27a_sim_command = puzlstar_asic27a_sim_command; - - SekOpen(0); - SekMapHandler(4, 0x500000, 0x500003, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, asic27a_sim_read); - SekSetWriteWordHandler(4, asic27a_sim_write); - - SekMapHandler(5, 0x4f0000, 0x4f03ff, MAP_READ); - SekSetReadWordHandler(5, puzlstar_protram_read_word); - SekSetReadByteHandler(5, puzlstar_protram_read_byte); - SekClose(); -} - diff --git a/jan/src/burn/drv/pgm/pgm_asic27a_type2.cpp b/jan/src/burn/drv/pgm/pgm_asic27a_type2.cpp deleted file mode 100644 index 6716ca9a3..000000000 --- a/jan/src/burn/drv/pgm/pgm_asic27a_type2.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include "pgm.h" - -/* - IGS Asic27a (type 2) proper emulation - - Used by: - Martial Masters - Bee Storm - DoDonPachi II - Dragon World 2001 - Dragon World Pretty Chance - Knights of Valour 2 - Knights of Valour 2 Plus - Nine Dragons -*/ - -static UINT8 asic27a_to_arm = 0; -static UINT8 asic27a_to_68k = 0; - -static inline void pgm_cpu_sync() -{ - INT32 nCycles = SekTotalCycles() - Arm7TotalCycles(); - - if (nCycles > 100) { - Arm7Run(nCycles); - } -} - -static void __fastcall asic27a_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffffe) == 0xd10000) { // ddp2 - pgm_cpu_sync(); - asic27a_to_arm = data; - Arm7SetIRQLine(ARM7_FIRQ_LINE, CPU_IRQSTATUS_ACK); - return; - } -} - -static void __fastcall asic27a_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffffe) == 0xd10000) { - pgm_cpu_sync(); - asic27a_to_arm = data & 0xff; - Arm7SetIRQLine(ARM7_FIRQ_LINE, CPU_IRQSTATUS_ACK); - return; - } -} - -static UINT8 __fastcall asic27a_read_byte(UINT32 address) -{ - if ((address & 0xfffffc) == 0xd10000) { - pgm_cpu_sync(); - return asic27a_to_68k; - } - - return 0; -} - -static UINT16 __fastcall asic27a_read_word(UINT32 address) -{ - if ((address & 0xfffffc) == 0xd10000) { - pgm_cpu_sync(); - return asic27a_to_68k; - } - - return 0; -} - -static void asic27a_arm7_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x38000000: - asic27a_to_68k = data; - return; - } -} - -static UINT8 asic27a_arm7_read_byte(UINT32 address) -{ - switch (address) - { - case 0x38000000: - Arm7SetIRQLine(ARM7_FIRQ_LINE, CPU_IRQSTATUS_NONE); - return asic27a_to_arm; - } - - return 0; -} - -static INT32 asic27aScan(INT32 nAction,INT32 *) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = PGMARMShareRAM; - ba.nLen = 0x0010000; - ba.nAddress = 0xd00000; - ba.szName = "ARM SHARE RAM"; - BurnAcb(&ba); - - ba.Data = PGMARMRAM0; - ba.nLen = 0x0000400; - ba.nAddress = 0; - ba.szName = "ARM RAM 0"; - BurnAcb(&ba); - - ba.Data = PGMARMRAM1; - ba.nLen = 0x0010000; - ba.nAddress = 0; - ba.szName = "ARM RAM 1"; - BurnAcb(&ba); - - ba.Data = PGMARMRAM2; - ba.nLen = 0x0000400; - ba.nAddress = 0; - ba.szName = "ARM RAM 2"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - Arm7Scan(nAction); - - SCAN_VAR(asic27a_to_arm); - SCAN_VAR(asic27a_to_68k); - } - - return 0; -} - -void install_protection_asic27a_martmast() -{ - nPGMArm7Type = 2; - pPgmScanCallback = asic27aScan; - - SekOpen(0); - - SekMapMemory(PGMARMShareRAM, 0xd00000, 0xd0ffff, MAP_RAM); - - SekMapHandler(4, 0xd10000, 0xd10003, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, asic27a_read_word); - SekSetReadByteHandler(4, asic27a_read_byte); - SekSetWriteWordHandler(4, asic27a_write_word); - SekSetWriteByteHandler(4, asic27a_write_byte); - SekClose(); - - Arm7Init(0); - Arm7Open(0); - Arm7MapMemory(PGMARMROM, 0x00000000, 0x00003fff, MAP_ROM); - Arm7MapMemory(PGMUSER0, 0x08000000, 0x08000000+(nPGMExternalARMLen-1), MAP_ROM); - Arm7MapMemory(PGMARMRAM0, 0x10000000, 0x100003ff, MAP_RAM); - Arm7MapMemory(PGMARMRAM1, 0x18000000, 0x1800ffff, MAP_RAM); - Arm7MapMemory(PGMARMShareRAM, 0x48000000, 0x4800ffff, MAP_RAM); - Arm7MapMemory(PGMARMRAM2, 0x50000000, 0x500003ff, MAP_RAM); - Arm7SetWriteByteHandler(asic27a_arm7_write_byte); - Arm7SetReadByteHandler(asic27a_arm7_read_byte); - Arm7Close(); -} diff --git a/jan/src/burn/drv/pgm/pgm_asic27a_type3.cpp b/jan/src/burn/drv/pgm/pgm_asic27a_type3.cpp deleted file mode 100644 index 6a93e1f3c..000000000 --- a/jan/src/burn/drv/pgm/pgm_asic27a_type3.cpp +++ /dev/null @@ -1,177 +0,0 @@ -#include "pgm.h" - -/* - IGS Asic27a (type 3) proper emulation - - Used by: - Demon Front - The Gladiator - The Killing Blade Plus - Spectral VS Generation - Happy 6in1 -*/ - -static UINT8 svg_ram_sel = 0; -static UINT8 *svg_ram[2]; -static UINT8 asic27a_68k_to_arm = 0; -static UINT8 asic27a_arm_to_68k = 0; - -static inline void pgm_cpu_sync() -{ - INT32 nCycles = SekTotalCycles() - Arm7TotalCycles(); - - if (nCycles > 100) { - Arm7Run(nCycles); - } -} - -static void svg_set_ram_bank(INT32 data) -{ - svg_ram_sel = data & 1; - Arm7MapMemory(svg_ram[svg_ram_sel], 0x38000000, 0x3800ffff, MAP_RAM); - SekMapMemory(svg_ram[svg_ram_sel^1], 0x500000, 0x50ffff, MAP_RAM); -} - -static void __fastcall svg_write_byte(UINT32 address, UINT8 /*data*/) -{ - pgm_cpu_sync(); - - switch (address) - { - case 0x5c0000: - Arm7SetIRQLine(ARM7_FIRQ_LINE, CPU_IRQSTATUS_AUTO); - return; - } -} - -static void __fastcall svg_write_word(UINT32 address, UINT16 data) -{ - pgm_cpu_sync(); - - switch (address) - { - case 0x5c0300: - asic27a_68k_to_arm = data; // byte - return; - } -} - -static UINT16 __fastcall svg_read_word(UINT32 address) -{ - switch (address) - { - case 0x5c0300: - pgm_cpu_sync(); - return asic27a_arm_to_68k; - } - - return 0; -} - -static void svg_arm7_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x40000018: - svg_set_ram_bank(data); - return; - - case 0x48000000: - asic27a_arm_to_68k = data; - return; - } -} - -static UINT8 svg_arm7_read_byte(UINT32 address) -{ - switch (address) - { - case 0x48000000: - return asic27a_68k_to_arm; - } - - return 0; -} - -static INT32 svg_asic27aScan(INT32 nAction,INT32 *) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = PGMARMShareRAM; - ba.nLen = 0x0020000; - ba.nAddress = 0x400000; - ba.szName = "ARM SHARE RAM #0 (address 500000)"; - BurnAcb(&ba); - - ba.Data = PGMARMShareRAM2; - ba.nLen = 0x0020000; - ba.nAddress = 0x500000; - ba.szName = "ARM SHARE RAM #1"; - BurnAcb(&ba); - - ba.Data = PGMARMRAM0; - ba.nLen = 0x0000400; - ba.nAddress = 0; - ba.szName = "ARM RAM 0"; - BurnAcb(&ba); - - ba.Data = PGMARMRAM1; - ba.nLen = 0x0040000; - ba.nAddress = 0; - ba.szName = "ARM RAM 1"; - BurnAcb(&ba); - - ba.Data = PGMARMRAM2; - ba.nLen = 0x0000400; - ba.nAddress = 0; - ba.szName = "ARM RAM 2"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - Arm7Scan(nAction); - SCAN_VAR(asic27a_68k_to_arm); - SCAN_VAR(asic27a_arm_to_68k); - - SCAN_VAR(svg_ram_sel); - } - - if (nAction & ACB_WRITE) { - SekOpen(0); - svg_set_ram_bank(svg_ram_sel); - SekClose(); - } - - return 0; -} - -void install_protection_asic27a_svg() -{ - nPGMArm7Type = 3; - - pPgmScanCallback = svg_asic27aScan; - - svg_ram_sel = 0; - svg_ram[0] = PGMARMShareRAM; - svg_ram[1] = PGMARMShareRAM2; - - SekOpen(0); - SekMapHandler(5, 0x500000, 0x5fffff, MAP_RAM); - SekSetReadWordHandler(5, svg_read_word); - SekSetWriteWordHandler(5, svg_write_word); - SekSetWriteByteHandler(5, svg_write_byte); - SekClose(); - - Arm7Init(0); - Arm7Open(0); - Arm7MapMemory(PGMARMROM, 0x00000000, 0x00003fff, MAP_ROM); - Arm7MapMemory(PGMUSER0, 0x08000000, 0x08000000 | (nPGMExternalARMLen-1), MAP_ROM); - Arm7MapMemory(PGMARMRAM0, 0x10000000, 0x100003ff, MAP_RAM); - Arm7MapMemory(PGMARMRAM1, 0x18000000, 0x1803ffff, MAP_RAM); - Arm7MapMemory(svg_ram[1], 0x38000000, 0x3800ffff, MAP_RAM); - Arm7MapMemory(PGMARMRAM2, 0x50000000, 0x500003ff, MAP_RAM); - Arm7SetWriteByteHandler(svg_arm7_write_byte); - Arm7SetReadByteHandler(svg_arm7_read_byte); - Arm7Close(); -} diff --git a/jan/src/burn/drv/pgm/pgm_asic3.cpp b/jan/src/burn/drv/pgm/pgm_asic3.cpp deleted file mode 100644 index 2e053b405..000000000 --- a/jan/src/burn/drv/pgm/pgm_asic3.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include "pgm.h" -#include "bitswap.h" - -/* - IGS Asic3 emulation - - Used by: - Oriental Legends -*/ - -static UINT8 asic3_latch[3]; -static UINT8 asic3_x; -static UINT8 asic3_reg; -static UINT16 asic3_hold; -static UINT16 asic3_hilo; - -static void asic3_compute_hold(INT32 y, INT32 z) -{ - UINT16 old = asic3_hold; - - asic3_hold = ((old << 1) | (old >> 15)); - asic3_hold ^= 0x2bad; - asic3_hold ^= BIT(z, y); - asic3_hold ^= BIT(asic3_x, 2) << 10; - asic3_hold ^= BIT(old, 5); - - static INT32 modes[8] = { 1, 1, 3, 2, 4, 4, 4, 4 }; - - switch (modes[PgmInput[7] & 7]) // The mode is dependent on the region - { - case 1: - asic3_hold ^= BIT(old, 10) ^ BIT(old, 8) ^ (BIT(asic3_x, 0) << 1) ^ (BIT(asic3_x, 1) << 6) ^ (BIT(asic3_x, 3) << 14); - break; - - case 2: - asic3_hold ^= BIT(old, 7) ^ BIT(old, 6) ^ (BIT(asic3_x, 0) << 4) ^ (BIT(asic3_x, 1) << 6) ^ (BIT(asic3_x, 3) << 12); - break; - - case 3: - asic3_hold ^= BIT(old, 10) ^ BIT(old, 8) ^ (BIT(asic3_x, 0) << 4) ^ (BIT(asic3_x, 1) << 6) ^ (BIT(asic3_x, 3) << 12); - break; - - case 4: - asic3_hold ^= BIT(old, 7) ^ BIT(old, 6) ^ (BIT(asic3_x, 0) << 3) ^ (BIT(asic3_x, 1) << 8) ^ (BIT(asic3_x, 3) << 14); - break; - } -} - -static UINT16 __fastcall asic3_read_word(UINT32 ) -{ - switch (asic3_reg) - { - case 0x00: - return (asic3_latch[0] & 0xf7) | ((PgmInput[7] << 3) & 0x08); - - case 0x01: - return (asic3_latch[1]); - - case 0x02: - return (asic3_latch[2] & 0x7f) | ((PgmInput[7] << 6) & 0x80); - - case 0x03: - return BITSWAP08(asic3_hold, 5,2,9,7,10,13,12,15); - - case 0x20: return 0x49; - case 0x21: return 0x47; - case 0x22: return 0x53; - - case 0x24: return 0x41; - case 0x25: return 0x41; - case 0x26: return 0x7f; - case 0x27: return 0x41; - case 0x28: return 0x41; - - case 0x2a: return 0x3e; - case 0x2b: return 0x41; - case 0x2c: return 0x49; - case 0x2d: return 0xf9; - case 0x2e: return 0x0a; - - case 0x30: return 0x26; - case 0x31: return 0x49; - case 0x32: return 0x49; - case 0x33: return 0x49; - case 0x34: return 0x32; - } - - return 0; -} - -static void __fastcall asic3_write_word(UINT32 address, UINT16 data) -{ - if (address == 0xc04000) { - asic3_reg = data; - return; - } - - switch (asic3_reg) - { - case 0x00: - case 0x01: - case 0x02: - asic3_latch[asic3_reg] = data << 1; - break; - - case 0x40: - asic3_hilo = (asic3_hilo << 8) | data; - break; - - case 0x48: - { - asic3_x = 0; - if ((asic3_hilo & 0x0090) == 0) asic3_x |= 0x01; - if ((asic3_hilo & 0x0006) == 0) asic3_x |= 0x02; - if ((asic3_hilo & 0x9000) == 0) asic3_x |= 0x04; - if ((asic3_hilo & 0x0a00) == 0) asic3_x |= 0x08; - } - break; - - case 0x80: - case 0x81: - case 0x82: - case 0x83: - case 0x84: - case 0x85: - case 0x86: - case 0x87: - asic3_compute_hold(asic3_reg & 0x07, data); - break; - - case 0xa0: - asic3_hold = 0; - break; - } -} - -static void reset_asic3() -{ - memset (asic3_latch, 0, 3 * sizeof(UINT8)); - - asic3_hold = 0; - asic3_reg = 0; - asic3_x = 0; - asic3_hilo = 0; -} - -static INT32 asic3Scan(INT32 nAction, INT32 *) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(asic3_reg); - SCAN_VAR(asic3_latch[0]); - SCAN_VAR(asic3_latch[1]); - SCAN_VAR(asic3_latch[2]); - SCAN_VAR(asic3_x); - SCAN_VAR(asic3_hilo); - SCAN_VAR(asic3_hold); - } - - return 0; -} - -void install_protection_asic3_orlegend() -{ - pPgmScanCallback = asic3Scan; - pPgmResetCallback = reset_asic3; - - SekOpen(0); - SekMapHandler(4, 0xc04000, 0xc0400f, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(4, asic3_read_word); - SekSetWriteWordHandler(4, asic3_write_word); - SekClose(); -} diff --git a/jan/src/burn/drv/pgm/pgm_crypt.cpp b/jan/src/burn/drv/pgm/pgm_crypt.cpp deleted file mode 100644 index 44d50e063..000000000 --- a/jan/src/burn/drv/pgm/pgm_crypt.cpp +++ /dev/null @@ -1,1045 +0,0 @@ -// IGS PGM System Encryptions - -#include "pgm.h" -#include "bitswap.h" - -void pgm_decrypt_dw2() -{ - UINT16 *src = (UINT16 *)PGM68KROM; - - for (INT32 i = 0; i> 1) & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -static UINT8 dfront_tab[256] = { - 0x51, 0xc4, 0xe3, 0x10, 0x1c, 0xad, 0x8a, 0x39, 0x8c, 0xe0, 0xa5, 0x04, 0x0f, 0xe4, 0x35, 0xc3, - 0x2d, 0x6b, 0x32, 0xe2, 0x60, 0x54, 0x63, 0x06, 0xa3, 0xf1, 0x0b, 0x5f, 0x6c, 0x5c, 0xb3, 0xec, - 0x77, 0x61, 0x69, 0xe7, 0x3c, 0xb7, 0x42, 0x72, 0x1a, 0x70, 0xb0, 0x96, 0xa4, 0x28, 0xc0, 0xfb, - 0x0a, 0x00, 0xcb, 0x15, 0x49, 0x48, 0xd3, 0x94, 0x58, 0xcf, 0x41, 0x86, 0x17, 0x71, 0xb1, 0xbd, - 0x21, 0x01, 0x37, 0x1e, 0xba, 0xeb, 0xf3, 0x59, 0xf6, 0xa7, 0x29, 0x4f, 0xb5, 0xca, 0x4c, 0x34, - 0x20, 0xa2, 0x62, 0x4b, 0x93, 0x9e, 0x47, 0x9f, 0x8d, 0x0e, 0x1b, 0xb6, 0x4d, 0x82, 0xd5, 0xf4, - 0x85, 0x79, 0x53, 0x92, 0x9b, 0xf7, 0xea, 0x44, 0x76, 0x1f, 0x22, 0x45, 0xed, 0xbe, 0x11, 0x55, - 0xaf, 0xf5, 0xf8, 0x50, 0x07, 0xe6, 0xc7, 0x5e, 0xd7, 0xde, 0xe5, 0x26, 0x2b, 0xf2, 0x6a, 0x8b, - 0xb8, 0x98, 0x89, 0xdb, 0x14, 0x5b, 0xc5, 0x78, 0xdc, 0xd0, 0x87, 0x5d, 0xc1, 0x0d, 0x95, 0x97, - 0x7e, 0xa8, 0x24, 0x3d, 0xe1, 0xd1, 0x19, 0xa6, 0x99, 0xd8, 0x83, 0x1d, 0xff, 0x30, 0x9d, 0x05, - 0xd4, 0x02, 0x27, 0x7b, 0x13, 0xb2, 0x7f, 0x40, 0x12, 0xa0, 0x68, 0x67, 0x4e, 0x3a, 0x46, 0xb9, - 0xee, 0xdf, 0x66, 0xd6, 0x8f, 0xa9, 0x0c, 0x91, 0x65, 0x18, 0x52, 0x56, 0xd9, 0x74, 0x09, 0x6e, - 0xc6, 0x73, 0xc9, 0xfc, 0x03, 0x43, 0xef, 0xaa, 0x7c, 0xbb, 0x2c, 0x90, 0xcc, 0xce, 0xe8, 0xae, - 0x2a, 0xf9, 0x57, 0x88, 0xc8, 0xe9, 0x5a, 0xdd, 0x2e, 0x7d, 0x64, 0xc2, 0x6d, 0x3e, 0xfa, 0x80, - 0x16, 0xcd, 0x6f, 0x84, 0x8e, 0x9c, 0xf0, 0xac, 0xb4, 0x9a, 0x2f, 0xbc, 0x31, 0x23, 0xfe, 0x38, - 0x08, 0x75, 0xa1, 0x33, 0xab, 0xd2, 0xda, 0x81, 0xbf, 0x7a, 0x3b, 0x3f, 0x4a, 0xfd, 0x25, 0x36 -}; - -void pgm_decrypt_dfront() -{ - UINT16 *src = (UINT16 *)PGMUSER0; - - for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]); - - if ((i & 0x040080) != 0x000080) x ^= 0x0001; - if ((i & 0x104008) == 0x104008) x ^= 0x0002; - if ((i & 0x080030) == 0x080010) x ^= 0x0004; - if ((i & 0x000042) != 0x000042) x ^= 0x0008; - if ((i & 0x008100) == 0x008000) x ^= 0x0010; - if ((i & 0x002004) != 0x000004) x ^= 0x0020; - if ((i & 0x011800) != 0x010000) x ^= 0x0040; - if ((i & 0x004820) == 0x004820) x ^= 0x0080; - - x ^= dfront_tab[(i >> 1) & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -static UINT8 ddp2_tab[256] = { - 0x2a, 0x4a, 0x39, 0x98, 0xac, 0x39, 0xb2, 0x55, 0x72, 0xf3, 0x7b, 0x3c, 0xee, 0x94, 0x6e, 0xd5, - 0xcd, 0xbc, 0x9a, 0xd0, 0x45, 0x7d, 0x49, 0x68, 0xb1, 0x61, 0x54, 0xef, 0xa2, 0x84, 0x29, 0x20, - 0x32, 0x52, 0x82, 0x04, 0x38, 0x69, 0x9f, 0x24, 0x46, 0xf4, 0x3f, 0xc2, 0xf1, 0x25, 0xac, 0x2d, - 0xdf, 0x2d, 0xb4, 0x51, 0xc7, 0xb5, 0xe5, 0x88, 0xbd, 0x3b, 0x5a, 0x25, 0x5b, 0xc7, 0xae, 0x5f, - 0x43, 0xcf, 0x89, 0xd9, 0xe2, 0x63, 0xc6, 0x76, 0x21, 0x2b, 0x77, 0xc0, 0x27, 0x98, 0xfd, 0x09, - 0xe1, 0x8c, 0x26, 0x2e, 0x92, 0x99, 0xbc, 0xbe, 0x0e, 0xba, 0xbf, 0x70, 0xe7, 0xb7, 0xe9, 0x37, - 0x5c, 0xd1, 0x5e, 0xad, 0x22, 0x17, 0xc5, 0x67, 0x9d, 0xc6, 0xfb, 0x53, 0xc7, 0x4d, 0x32, 0xb4, - 0xf2, 0x43, 0x53, 0x7c, 0x01, 0xfe, 0xd2, 0x91, 0x40, 0x85, 0xa3, 0xe8, 0xdf, 0xdb, 0xff, 0x6c, - 0x64, 0x15, 0xcd, 0x8e, 0x07, 0x82, 0x78, 0x8d, 0x4e, 0x2d, 0x66, 0x8a, 0x62, 0x6f, 0xd3, 0x6a, - 0xae, 0x16, 0x44, 0x1e, 0xed, 0xc4, 0x12, 0x7a, 0xbe, 0x05, 0x06, 0xce, 0x9b, 0x8a, 0xf7, 0xf8, - 0x74, 0x23, 0x73, 0x74, 0xb8, 0x13, 0xc2, 0x42, 0xea, 0xf9, 0x7f, 0xa9, 0xaf, 0x56, 0xd6, 0xb3, - 0xb7, 0xc4, 0x47, 0x31, 0x67, 0xaa, 0x58, 0x8b, 0x47, 0x1b, 0xf5, 0x75, 0x95, 0x8f, 0xf0, 0x3a, - 0x85, 0x76, 0x59, 0x24, 0x0c, 0xd7, 0x00, 0xb3, 0xdc, 0xfc, 0x65, 0x34, 0xde, 0xfa, 0xd8, 0xc3, - 0xc3, 0x5e, 0xe3, 0x9e, 0x02, 0x28, 0x50, 0x81, 0x95, 0x2f, 0xe4, 0xb5, 0xa0, 0x4d, 0xa1, 0x36, - 0x9d, 0x18, 0x6d, 0x79, 0x19, 0x3b, 0x1d, 0xb8, 0xe1, 0xcc, 0x61, 0x1a, 0xe2, 0x31, 0x4c, 0x3f, - 0xdc, 0xca, 0xd4, 0xda, 0xcd, 0xd2, 0x83, 0xca, 0xeb, 0x4f, 0xf2, 0x2f, 0x2d, 0x2a, 0xec, 0x1f -}; - -void pgm_decrypt_ddp2() -{ - UINT16 *src = (UINT16 *)PGMUSER0; - - for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]); - - if ((i & 0x0480) != 0x0080) x ^= 0x0001; - if ((i & 0x0042) != 0x0042) x ^= 0x0008; - if ((i & 0x8100) == 0x8000) x ^= 0x0010; - if ((i & 0x2004) != 0x0004) x ^= 0x0020; - if ((i & 0x1800) != 0x0000) x ^= 0x0040; - if ((i & 0x0820) == 0x0820) x ^= 0x0080; - - x ^= ddp2_tab[(i >> 1) & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -static UINT8 mm_tab[256] = { - 0xd0, 0x45, 0xbc, 0x84, 0x93, 0x60, 0x7d, 0x49, 0x68, 0xb1, 0x54, 0xa2, 0x05, 0x29, 0x41, 0x20, - 0x04, 0x08, 0x52, 0x25, 0x89, 0xf4, 0x69, 0x9f, 0x24, 0x46, 0x3d, 0xf1, 0xf9, 0xab, 0xa6, 0x2d, - 0x18, 0x19, 0x6d, 0x33, 0x79, 0x23, 0x3b, 0x1d, 0xe0, 0xb8, 0x61, 0x1a, 0xe1, 0x4c, 0x5d, 0x3f, - 0x5e, 0x02, 0xe3, 0x4d, 0x9e, 0x80, 0x28, 0x50, 0xa0, 0x81, 0xe4, 0xa5, 0x97, 0xa1, 0x86, 0x36, - 0x1e, 0xed, 0x16, 0x8a, 0x44, 0x06, 0x64, 0x12, 0x9a, 0x7e, 0xce, 0x9b, 0xef, 0xf7, 0x3e, 0xf8, - 0x15, 0x07, 0xcb, 0x6f, 0x8e, 0x3c, 0x82, 0x70, 0x62, 0x8d, 0x66, 0x7a, 0x4e, 0xd3, 0xb6, 0x6a, - 0x51, 0xa7, 0x2c, 0xc7, 0xa4, 0x0b, 0xb5, 0xe5, 0x88, 0xbd, 0x5a, 0x5b, 0x1b, 0xae, 0xe6, 0x5f, - 0x2e, 0x92, 0x8c, 0xb7, 0x96, 0xba, 0x99, 0xbb, 0xbe, 0x0e, 0xbf, 0xe7, 0x2f, 0xe9, 0x30, 0x37, - 0x98, 0xac, 0x4a, 0x94, 0x38, 0xf3, 0x39, 0xb2, 0x55, 0x72, 0x7b, 0xee, 0xdd, 0x6e, 0x11, 0xd5, - 0x26, 0xa8, 0x71, 0xd6, 0x74, 0x7f, 0x13, 0xc2, 0x56, 0xea, 0xa9, 0xaf, 0xc3, 0x42, 0x03, 0xb3, - 0xc4, 0x6b, 0x47, 0xf0, 0x31, 0xf5, 0xaa, 0x58, 0x8f, 0x48, 0x75, 0x95, 0x35, 0x8b, 0x57, 0x3a, - 0x73, 0x0c, 0x59, 0xd8, 0x14, 0x65, 0xd7, 0x00, 0xfa, 0xdc, 0x34, 0xde, 0xc0, 0xb0, 0x87, 0xc1, - 0xc8, 0xcd, 0xd4, 0x2a, 0xda, 0xe8, 0xd2, 0x83, 0x0d, 0xca, 0xf2, 0x0f, 0xeb, 0xec, 0x9c, 0x1f, - 0xad, 0x22, 0xd1, 0x4b, 0x5c, 0xf6, 0x17, 0xc5, 0x67, 0x9d, 0xfb, 0xc9, 0xcc, 0x32, 0x1c, 0xb4, - 0xd9, 0xe2, 0xcf, 0x90, 0xb9, 0x2b, 0x63, 0xc6, 0x76, 0x21, 0x77, 0x27, 0xfc, 0xfd, 0x0a, 0x09, - 0x7c, 0x01, 0x43, 0xdb, 0x53, 0x85, 0xfe, 0x78, 0x91, 0x40, 0xa3, 0xdf, 0x4f, 0xff, 0x10, 0x6c -}; - -void pgm_decrypt_martmast() // and dw2001 -{ - UINT16 *src = (UINT16 *)PGMUSER0; - - for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]); - - if ((i & 0x040480) != 0x000080) x ^= 0x0001; - if ((i & 0x004008) == 0x004008) x ^= 0x0002; - if ((i & 0x000030) == 0x000010) x ^= 0x0004; - if ((i & 0x000242) != 0x000042) x ^= 0x0008; - if ((i & 0x008100) == 0x008000) x ^= 0x0010; - if ((i & 0x022004) != 0x000004) x ^= 0x0020; - if ((i & 0x011800) != 0x010000) x ^= 0x0040; - if ((i & 0x000820) == 0x000820) x ^= 0x0080; - - x ^= mm_tab[(i >> 1) & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -static const UINT8 kov2_tab[256] = { - 0x11, 0x4a, 0x38, 0x98, 0xac, 0x39, 0xb2, 0x55, 0x72, 0xf3, 0x7b, 0x3c, 0xee, 0x94, 0x6e, 0xd5, - 0x41, 0xbc, 0x93, 0xd0, 0x45, 0x7d, 0x49, 0x68, 0xb1, 0x60, 0x54, 0xef, 0xa2, 0x84, 0x29, 0x20, - 0xa6, 0x52, 0x89, 0x04, 0x08, 0x69, 0x9f, 0x24, 0x46, 0xf4, 0x3d, 0xc3, 0xf1, 0x25, 0xab, 0x2d, - 0xe6, 0x2c, 0xa4, 0x51, 0xa7, 0xb5, 0xe5, 0x88, 0xbd, 0x0b, 0x5a, 0x35, 0x5b, 0xc7, 0xae, 0x5f, - 0x0a, 0xcf, 0xb9, 0xd9, 0xe2, 0x63, 0xc6, 0x76, 0x21, 0x2b, 0x77, 0xc0, 0x27, 0x90, 0xfd, 0x09, - 0x30, 0x8c, 0x96, 0x2e, 0x92, 0x99, 0xbb, 0xbe, 0x0e, 0xba, 0xbf, 0x80, 0xe7, 0xb7, 0xe9, 0x37, - 0x1c, 0xd1, 0x5c, 0xad, 0x22, 0x17, 0xc5, 0x67, 0x9d, 0xf6, 0xfb, 0x23, 0xc9, 0x4b, 0x32, 0xb4, - 0x10, 0x43, 0x53, 0x7c, 0x01, 0xfe, 0x78, 0x91, 0x40, 0x85, 0xa3, 0xe8, 0xdf, 0xdb, 0xff, 0x6c, - 0xb6, 0x15, 0xcb, 0x8e, 0x07, 0x82, 0x70, 0x8d, 0x4e, 0xdd, 0x66, 0x7a, 0x62, 0x6f, 0xd3, 0x6a, - 0x3e, 0x16, 0x44, 0x1e, 0xed, 0x64, 0x12, 0x9a, 0x7e, 0x05, 0x06, 0xce, 0x9b, 0x8a, 0xf7, 0xf8, - 0x03, 0x26, 0x71, 0x74, 0xa8, 0x13, 0xc2, 0x42, 0xea, 0xf9, 0x7f, 0xa9, 0xaf, 0x56, 0xd6, 0xb3, - 0x57, 0xc4, 0x47, 0x31, 0x6b, 0xaa, 0x58, 0x8b, 0x48, 0x1b, 0xf5, 0x75, 0x95, 0x8f, 0xf0, 0x3a, - 0x87, 0x73, 0x59, 0x14, 0x0c, 0xd7, 0x00, 0xb0, 0xdc, 0xfc, 0x65, 0x34, 0xde, 0xfa, 0xd8, 0xc1, - 0x86, 0x5e, 0xe3, 0x9e, 0x02, 0x28, 0x50, 0x81, 0x97, 0x2f, 0xe4, 0xa5, 0xa0, 0x4d, 0xa1, 0x36, - 0x5d, 0x18, 0x6d, 0x79, 0x19, 0x3b, 0x1d, 0xb8, 0xe1, 0xcc, 0x61, 0x1a, 0xe0, 0x33, 0x4c, 0x3f, - 0x9c, 0xc8, 0xd4, 0xda, 0xcd, 0xd2, 0x83, 0xca, 0xeb, 0x4f, 0xf2, 0x0f, 0x0d, 0x2a, 0xec, 0x1f -}; - -void pgm_decrypt_kov2() -{ - UINT16 *src = (UINT16 *)PGMUSER0; - - for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]); - - if ((i & 0x40080) != 0x00080) x ^= 0x0001; - if ((i & 0x80030) == 0x80010) x ^= 0x0004; - if ((i & 0x00042) != 0x00042) x ^= 0x0008; - if ((i & 0x48100) == 0x48000) x ^= 0x0010; - if ((i & 0x22004) != 0x00004) x ^= 0x0020; - if ((i & 0x01800) != 0x00000) x ^= 0x0040; - if ((i & 0x00820) == 0x00820) x ^= 0x0080; - - x ^= kov2_tab[(i >> 1) & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -static const UINT8 kov2p_tab[256] = { - 0x44, 0x47, 0xb8, 0x28, 0x03, 0xa2, 0x21, 0xbc, 0x17, 0x32, 0x4e, 0xe2, 0xdf, 0x69, 0x35, 0xc7, - 0xa2, 0x06, 0xec, 0x36, 0xd2, 0x44, 0x12, 0x6a, 0x8d, 0x51, 0x6b, 0x20, 0x69, 0x01, 0xca, 0xf0, - 0x71, 0xc4, 0x34, 0xdc, 0x6b, 0xd6, 0x42, 0x2a, 0x5d, 0xb5, 0xc7, 0x6f, 0x4f, 0xd8, 0xb3, 0xed, - 0x51, 0x9e, 0x37, 0x1e, 0xc0, 0x85, 0x2a, 0x91, 0xc6, 0x9c, 0xac, 0xf5, 0x20, 0x3b, 0x09, 0x74, - 0x24, 0xf1, 0xe0, 0x42, 0x02, 0xbe, 0x84, 0x75, 0x4a, 0x82, 0xa2, 0x17, 0xae, 0xb6, 0x24, 0x79, - 0x0a, 0x5a, 0x56, 0xcb, 0xa1, 0x2e, 0x47, 0xea, 0xa9, 0x25, 0x73, 0x79, 0x0b, 0x17, 0x9e, 0x33, - 0x64, 0xb6, 0x03, 0x7f, 0x4f, 0xc3, 0xae, 0x45, 0xe6, 0x82, 0x27, 0x01, 0x86, 0x6b, 0x50, 0x16, - 0xd3, 0x22, 0x90, 0x64, 0xfc, 0xa9, 0x31, 0x1c, 0x41, 0xd5, 0x07, 0xd3, 0xb2, 0xfe, 0x53, 0xd6, - 0x39, 0xfb, 0xe6, 0xbe, 0xda, 0x4d, 0x8a, 0x44, 0x3a, 0x9b, 0x9d, 0x56, 0x5e, 0x5f, 0xff, 0x6a, - 0xb6, 0xde, 0x2f, 0x12, 0x5a, 0x5d, 0xb0, 0xd0, 0x93, 0x92, 0xb2, 0x2c, 0x9d, 0x59, 0xee, 0x05, - 0xab, 0xa8, 0xd2, 0x25, 0x2c, 0xc5, 0xde, 0x18, 0x4d, 0xb6, 0x4e, 0x3d, 0xbf, 0xfa, 0xf9, 0x1d, - 0xba, 0x76, 0x79, 0xfc, 0x42, 0xb2, 0x8c, 0xae, 0xa9, 0x45, 0xba, 0xac, 0x55, 0x8e, 0x38, 0x67, - 0xc3, 0xa5, 0x0d, 0xdc, 0xcc, 0x91, 0x73, 0x69, 0x27, 0xbc, 0x80, 0xdf, 0x30, 0xa4, 0x05, 0xd8, - 0xe7, 0xd2, 0xb7, 0x4b, 0x3c, 0x10, 0x8c, 0x5d, 0x8a, 0xd7, 0x68, 0x7a, 0x61, 0x07, 0xf9, 0xa5, - 0x88, 0xda, 0xdf, 0x0c, 0x42, 0x1b, 0x11, 0xe0, 0xd1, 0x93, 0x7c, 0x63, 0x39, 0xc5, 0xed, 0x43, - 0x46, 0xdb, 0x30, 0x26, 0xd0, 0xdf, 0x7a, 0x86, 0x3e, 0x2e, 0x04, 0xbf, 0x49, 0x2a, 0xf9, 0x66 -}; - -void pgm_decrypt_kov2p() -{ - UINT16 *src = (UINT16*)PGMUSER0; - - for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]); - - if ((i & 0x040080) != 0x000080) x ^= 0x0001; - if ((i & 0x004008) == 0x004008) x ^= 0x0002; - if ((i & 0x080030) == 0x080010) x ^= 0x0004; - if ((i & 0x000242) != 0x000042) x ^= 0x0008; - if ((i & 0x008100) == 0x008000) x ^= 0x0010; - if ((i & 0x002004) != 0x000004) x ^= 0x0020; - if ((i & 0x011800) != 0x010000) x ^= 0x0040; - if ((i & 0x000820) == 0x000820) x ^= 0x0080; - - x ^= kov2p_tab[(i >> 1) & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -static const UINT8 theglad_tab[256] = { - 0x49, 0x47, 0x53, 0x30, 0x30, 0x30, 0x35, 0x52, 0x44, 0x31, 0x30, 0x32, 0x31, 0x32, 0x30, 0x33, - 0xc4, 0xa3, 0x46, 0x78, 0x30, 0xb3, 0x8b, 0xd5, 0x2f, 0xc4, 0x44, 0xbf, 0xdb, 0x76, 0xdb, 0xea, - 0xb4, 0xeb, 0x95, 0x4d, 0x15, 0x21, 0x99, 0xa1, 0xd7, 0x8c, 0x40, 0x1d, 0x43, 0xf3, 0x9f, 0x71, - 0x3d, 0x8c, 0x52, 0x01, 0xaf, 0x5b, 0x8b, 0x63, 0x34, 0xc8, 0x5c, 0x1b, 0x06, 0x7f, 0x41, 0x96, - 0x2a, 0x8d, 0xf1, 0x64, 0xda, 0xb8, 0x67, 0xba, 0x33, 0x1f, 0x2b, 0x28, 0x20, 0x13, 0xe6, 0x96, - 0x86, 0x34, 0x25, 0x85, 0xb0, 0xd0, 0x6d, 0x85, 0xfe, 0x78, 0x81, 0xf1, 0xca, 0xe4, 0xef, 0xf2, - 0x9b, 0x09, 0xe1, 0xb4, 0x8d, 0x79, 0x22, 0xe2, 0x00, 0xfb, 0x6f, 0x68, 0x80, 0x6a, 0x00, 0x69, - 0xf5, 0xd3, 0x57, 0x7e, 0x0c, 0xca, 0x48, 0x31, 0xe5, 0x0d, 0x4a, 0xb9, 0xfd, 0x5c, 0xfd, 0xf8, - 0x5f, 0x98, 0xfb, 0xb3, 0x07, 0x1a, 0xe3, 0x10, 0x96, 0x56, 0xa3, 0x56, 0x3d, 0xb1, 0x07, 0xe0, - 0xe3, 0x9f, 0x7f, 0x62, 0x99, 0x01, 0x35, 0x60, 0x40, 0xbe, 0x4f, 0xeb, 0x79, 0xa0, 0x82, 0x9f, - 0xcd, 0x71, 0xd8, 0xda, 0x1e, 0x56, 0xc2, 0x3e, 0x4e, 0x6b, 0x60, 0x69, 0x2d, 0x9f, 0x10, 0xf4, - 0xa9, 0xd3, 0x36, 0xaa, 0x31, 0x2e, 0x4c, 0x0a, 0x69, 0xc3, 0x2a, 0xff, 0x15, 0x67, 0x96, 0xde, - 0x3f, 0xcc, 0x0f, 0xa1, 0xac, 0xe2, 0xd6, 0x62, 0x7e, 0x6f, 0x3e, 0x1b, 0x2a, 0xed, 0x36, 0x9c, - 0x9d, 0xa4, 0x14, 0xcd, 0xaa, 0x08, 0xa4, 0x26, 0xb7, 0x55, 0x70, 0x6c, 0xa9, 0x69, 0x52, 0xae, - 0x0c, 0xe1, 0x38, 0x7f, 0x87, 0x78, 0x38, 0x75, 0x80, 0x9c, 0xd4, 0xe2, 0x0b, 0x52, 0x8f, 0xd2, - 0x19, 0x4c, 0xb0, 0x45, 0xde, 0x48, 0x55, 0xae, 0x82, 0xab, 0xbc, 0xab, 0x0c, 0x5e, 0xce, 0x07 -}; - -void pgm_decrypt_theglad() -{ - UINT16 *src = (UINT16*)PGMUSER0; - - for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]); - - if ((i & 0x040080) != 0x000080) x ^= 0x0001; - if ((i & 0x104008) == 0x104008) x ^= 0x0002; - if ((i & 0x080030) == 0x080010) x ^= 0x0004; - if ((i & 0x000042) != 0x000042) x ^= 0x0008; - if ((i & 0x008100) == 0x008000) x ^= 0x0010; - if ((i & 0x022004) != 0x000004) x ^= 0x0020; - if ((i & 0x011800) != 0x010000) x ^= 0x0040; - if ((i & 0x000820) == 0x000820) x ^= 0x0080; - - x ^= theglad_tab[(i >> 1) & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -static const UINT8 killbldp_tab[] = { - 0x49, 0x47, 0x53, 0x30, 0x30, 0x32, 0x34, 0x52, 0x44, 0x31, 0x30, 0x35, 0x30, 0x39, 0x30, 0x38, - 0x12, 0xa0, 0xd1, 0x9e, 0xb1, 0x8a, 0xfb, 0x1f, 0x50, 0x51, 0x4b, 0x81, 0x28, 0xda, 0x5f, 0x41, - 0x78, 0x6c, 0x7a, 0xf0, 0xcd, 0x6b, 0x69, 0x14, 0x94, 0x55, 0xb6, 0x42, 0xdf, 0xfe, 0x10, 0x79, - 0x74, 0x08, 0xfa, 0xc0, 0x1c, 0xa5, 0xb4, 0x03, 0x2a, 0x91, 0x67, 0x2b, 0x49, 0x4a, 0x94, 0x7d, - 0x8b, 0x92, 0xbe, 0x35, 0xaf, 0x28, 0x56, 0x63, 0xb3, 0xc2, 0xe8, 0x06, 0x9b, 0x4e, 0x85, 0x66, - 0x7f, 0x6b, 0x70, 0xb7, 0xdb, 0x22, 0x0c, 0xeb, 0x13, 0xe9, 0x06, 0xd7, 0x45, 0xda, 0xbe, 0x8b, - 0x54, 0x30, 0xfc, 0xeb, 0x32, 0x02, 0xd0, 0x92, 0x6d, 0x44, 0xca, 0xe8, 0xfd, 0xfb, 0x5b, 0x81, - 0x4c, 0xc0, 0x8b, 0xb9, 0x87, 0x78, 0xdd, 0x8e, 0x24, 0x52, 0x80, 0xbe, 0xb4, 0x01, 0xb7, 0x21, - 0xeb, 0x3c, 0x8a, 0x49, 0xed, 0x73, 0xae, 0x58, 0xdb, 0xd2, 0xb2, 0x21, 0x9e, 0x7c, 0x6c, 0x82, - 0xf3, 0x01, 0xa3, 0x00, 0xb7, 0x21, 0xfe, 0xa5, 0x75, 0xc4, 0x2d, 0x17, 0x2d, 0x39, 0x56, 0xf9, - 0x67, 0xae, 0xc2, 0x87, 0x79, 0xf1, 0xc8, 0x6d, 0x15, 0x66, 0xfa, 0xe8, 0x16, 0x48, 0x8f, 0x1f, - 0x8b, 0x24, 0x10, 0xc4, 0x04, 0x93, 0x47, 0xe6, 0x1d, 0x37, 0x65, 0x1a, 0x49, 0xf8, 0x72, 0xcb, - 0xe1, 0x80, 0xfa, 0xdd, 0x6d, 0xf5, 0xf6, 0x89, 0x32, 0xf6, 0xf8, 0x75, 0xfc, 0xd8, 0x9b, 0x12, - 0x2d, 0x22, 0x2a, 0x3b, 0x06, 0x46, 0x90, 0x0c, 0x35, 0xa2, 0x80, 0xff, 0xa0, 0xb7, 0xe5, 0x4d, - 0x71, 0xa9, 0x8c, 0x84, 0x62, 0xf7, 0x10, 0x65, 0x4a, 0x7b, 0x06, 0x00, 0xe8, 0xa4, 0x6a, 0x13, - 0xf0, 0xf3, 0x4a, 0x9f, 0x54, 0xb4, 0xb1, 0xcc, 0xd4, 0xff, 0xd6, 0xff, 0xc9, 0xee, 0x86, 0x39 -}; - -void pgm_decrypt_killbldp() -{ - UINT16 *src = (UINT16*)PGMUSER0; - - for (INT32 i = 0; i< nPGMExternalARMLen/2; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]); - - if ((i & 0x040480) != 0x000080) x ^= 0x0001; - if ((i & 0x104008) == 0x104008) x ^= 0x0002; - if ((i & 0x080030) == 0x080010) x ^= 0x0004; - if ((i & 0x000242) != 0x000042) x ^= 0x0008; - if ((i & 0x008100) == 0x008000) x ^= 0x0010; - if ((i & 0x002004) != 0x000004) x ^= 0x0020; - if ((i & 0x011800) != 0x010000) x ^= 0x0040; - if ((i & 0x000820) == 0x000820) x ^= 0x0080; - - x ^= killbldp_tab[(i >> 1) & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -static const UINT8 happy6in1_tab[256] = { - 0x49, 0x47, 0x53, 0x30, 0x30, 0x30, 0x38, 0x52, 0x44, 0x31, 0x30, 0x33, 0x31, 0x32, 0x31, 0x35, - 0x14, 0xd6, 0x37, 0x5c, 0x5e, 0xc3, 0xd3, 0x62, 0x96, 0x3d, 0xfb, 0x47, 0xf0, 0xcb, 0xbf, 0xb0, - 0x60, 0xa1, 0xc2, 0x3d, 0x90, 0xd0, 0x58, 0x56, 0x22, 0xac, 0xdd, 0x39, 0x27, 0x7e, 0x58, 0x44, - 0xe0, 0x6b, 0x51, 0x80, 0xb4, 0xa4, 0xf0, 0x6f, 0x71, 0xd0, 0x57, 0x18, 0xc7, 0xb6, 0x41, 0x50, - 0x02, 0x2f, 0xdb, 0x4a, 0x08, 0x4b, 0xe3, 0x62, 0x92, 0xc3, 0xff, 0x26, 0xaf, 0x9f, 0x60, 0xa5, - 0x76, 0x28, 0x97, 0xfd, 0x0b, 0x10, 0xb7, 0x1f, 0xd5, 0xe0, 0xac, 0xe6, 0xfd, 0xa3, 0xdb, 0x58, - 0x2a, 0xd1, 0xfc, 0x3b, 0x7c, 0x7e, 0x34, 0xdc, 0xc7, 0xc4, 0x76, 0x1b, 0x11, 0x6d, 0x1b, 0xbb, - 0x4e, 0xe5, 0xc0, 0xe8, 0x5a, 0x60, 0x60, 0x0a, 0x38, 0x47, 0xb3, 0xc9, 0x89, 0xe9, 0xc6, 0x61, - 0x50, 0x5f, 0xdb, 0x28, 0xe5, 0xc0, 0x83, 0x5c, 0x37, 0x86, 0xfa, 0x32, 0x46, 0x40, 0xc3, 0x1d, - 0xdf, 0x7a, 0x85, 0x5c, 0x9a, 0xea, 0x24, 0xc7, 0x12, 0xdc, 0x23, 0xda, 0x65, 0xdf, 0x39, 0x02, - 0xeb, 0xb1, 0x32, 0x28, 0x3a, 0x69, 0x09, 0x7c, 0x5a, 0xe3, 0x44, 0x83, 0x45, 0x71, 0x8f, 0x64, - 0xa3, 0xbf, 0x9c, 0x6f, 0xc4, 0x07, 0x3a, 0xee, 0xdd, 0x77, 0xb4, 0x31, 0x87, 0xdf, 0x6d, 0xd4, - 0x75, 0x9f, 0xb9, 0x53, 0x75, 0xd0, 0xfe, 0xd1, 0xaa, 0xb2, 0x0b, 0x25, 0x08, 0x56, 0xb8, 0x27, - 0x10, 0x8c, 0xbf, 0x39, 0xce, 0x0f, 0xdb, 0x18, 0x10, 0xf0, 0x1f, 0xe5, 0xe8, 0x40, 0x98, 0x6f, - 0x64, 0x02, 0x27, 0xc3, 0x8c, 0x4f, 0x98, 0xf6, 0x9d, 0xcb, 0x07, 0x31, 0x85, 0x48, 0x75, 0xff, - 0x9f, 0xba, 0xa6, 0xd3, 0xb0, 0x5b, 0x3d, 0xdd, 0x22, 0x1f, 0x1b, 0x0e, 0x7f, 0x5a, 0xf4, 0x6a -}; - -void pgm_decrypt_happy6() -{ - UINT16 *src = (UINT16*)PGMUSER0; - - for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]); - - if ((i & 0x040480) != 0x000080) x ^= 0x0001; - if ((i & 0x104008) == 0x104008) x ^= 0x0002; - if ((i & 0x080030) == 0x080010) x ^= 0x0004; - if ((i & 0x000242) != 0x000042) x ^= 0x0008; - if ((i & 0x048100) == 0x048000) x ^= 0x0010; - if ((i & 0x002004) != 0x000004) x ^= 0x0020; - if ((i & 0x011800) != 0x010000) x ^= 0x0040; - if ((i & 0x000820) == 0x000820) x ^= 0x0080; - - x ^= happy6in1_tab[(i >> 1) & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -static const UINT8 pgm3in1_tab[256] = { - 0x49, 0x47, 0x53, 0x30, 0x30, 0x31, 0x31, 0x72, 0x64, 0x31, 0x30, 0x34, 0x30, 0x36, 0x33, 0x30, - 0xc2, 0xbe, 0xde, 0x8b, 0x80, 0x8f, 0x04, 0xbb, 0xd2, 0xd6, 0x11, 0x4a, 0x54, 0xa9, 0x8d, 0x27, - 0xf1, 0x74, 0x88, 0xc2, 0xa3, 0xdd, 0x73, 0x97, 0x6c, 0xf8, 0x41, 0xf9, 0x95, 0xac, 0xbe, 0x20, - 0x26, 0x65, 0x2f, 0x76, 0xa6, 0xfc, 0x2b, 0x1f, 0x15, 0xe3, 0xb9, 0xc7, 0x27, 0x95, 0xab, 0xaf, - 0xc2, 0x3d, 0x3a, 0xfb, 0xba, 0xa5, 0xe3, 0x35, 0xcb, 0x62, 0x81, 0x26, 0xd7, 0x3e, 0xac, 0xd7, - 0x62, 0xe6, 0x51, 0xe2, 0x4b, 0xd5, 0x92, 0xfe, 0xcd, 0x80, 0xe0, 0xca, 0xb6, 0xc3, 0x57, 0xda, - 0xe6, 0x8b, 0x59, 0x00, 0x0a, 0xc5, 0x6f, 0xdc, 0x9a, 0x87, 0x5c, 0xa6, 0x11, 0x7e, 0x83, 0x3b, - 0x6c, 0x98, 0x7b, 0x66, 0xe6, 0xf2, 0xf0, 0x71, 0xf2, 0x04, 0xbd, 0xed, 0x78, 0x0b, 0x47, 0xbd, - 0x54, 0xb6, 0x1d, 0x69, 0x0d, 0x15, 0xcd, 0xa2, 0xd2, 0xc0, 0x09, 0x11, 0xbb, 0x44, 0xfb, 0x64, - 0x3d, 0xd3, 0xe5, 0x9b, 0xee, 0x2b, 0xfd, 0x90, 0x7b, 0xc6, 0x88, 0xc5, 0xe7, 0x44, 0x35, 0x73, - 0x06, 0x17, 0xbc, 0xcf, 0x39, 0x6e, 0xb7, 0x9f, 0x6b, 0x63, 0xc1, 0xfe, 0x4c, 0x68, 0xcd, 0x6c, - 0xcd, 0xee, 0xc8, 0x19, 0xdc, 0x58, 0x72, 0x72, 0x62, 0x20, 0x7a, 0xed, 0x79, 0x48, 0xd8, 0x12, - 0xf2, 0x04, 0x70, 0xca, 0x07, 0xa6, 0xe5, 0xec, 0x5d, 0xc9, 0xba, 0x05, 0x3e, 0xc2, 0xb0, 0x68, - 0x14, 0x43, 0x5b, 0x77, 0x28, 0x51, 0x06, 0x30, 0x9d, 0x69, 0xc9, 0xfb, 0xa8, 0xee, 0xe9, 0xb2, - 0x11, 0xd7, 0x70, 0xf2, 0xef, 0x96, 0x0d, 0xa1, 0xa0, 0x4b, 0x2e, 0xc0, 0x07, 0x2a, 0x5c, 0x72, - 0x09, 0x29, 0xd6, 0x4d, 0x4a, 0xef, 0x71, 0xe1, 0x25, 0xf9, 0xb0, 0x87, 0xea, 0x0f, 0x1f, 0x6c, -}; - -void pgm_decrypt_pgm3in1() -{ - UINT16 *src = (UINT16 *)PGM68KROM; - - for (INT32 i = 0; i < nPGM68KROMLen/2; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]); - - if ((i & 0x040480) != 0x000080) x ^= 0x0001; - if ((i & 0x104008) == 0x104008) x ^= 0x0002; - if ((i & 0x000030) == 0x000010) x ^= 0x0004; - if ((i & 0x000042) != 0x000042) x ^= 0x0008; - if ((i & 0x008100) == 0x008000) x ^= 0x0010; - if ((i & 0x002004) != 0x000004) x ^= 0x0020; - if ((i & 0x011800) != 0x010000) x ^= 0x0040; - if ((i & 0x000820) == 0x000820) x ^= 0x0080; - - x ^= pgm3in1_tab[i & 0xff] << 8; - - src[i] = BURN_ENDIAN_SWAP_INT16(x); - } -} - -// ------------------------------------------------------------------------------------------------------------ -// Bootleg decryption routines - -void pgm_decode_kovqhsgs_gfx_block(UINT8 *src) -{ - INT32 i, j; - UINT8 *dec = (UINT8*)BurnMalloc(0x800000); - - for (i = 0; i < 0x800000; i++) - { - j = BITSWAP24(i, 23, 10, 9, 22, 19, 18, 20, 21, 17, 16, 15, 14, 13, 12, 11, 8, 7, 6, 5, 4, 3, 2, 1, 0); - - dec[j] = src[i]; - } - - memcpy (src, dec, 0x800000); - - BurnFree (dec); -} - -void pgm_decode_kovqhsgs_tile_data(UINT8 *source) -{ - INT32 i, j; - UINT16 *src = (UINT16*)source; - UINT16 *dst = (UINT16*)BurnMalloc(0x800000); - - for (i = 0; i < 0x800000 / 2; i++) - { - j = BITSWAP24(i, 23, 22, 9, 8, 21, 18, 0, 1, 2, 3, 16, 15, 14, 13, 12, 11, 10, 19, 20, 17, 7, 6, 5, 4); - - dst[j] = BURN_ENDIAN_SWAP_INT16(BITSWAP16(BURN_ENDIAN_SWAP_INT16(src[i]), 1, 14, 8, 7, 0, 15, 6, 9, 13, 2, 5, 10, 12, 3, 4, 11)); - } - - memcpy (src, dst, 0x800000); - - BurnFree (dst); -} - -static void pgm_decode_kovqhsgs_samples() -{ - INT32 i; - for (i = 0; i < 0x400000; i+=2) { - ICSSNDROM[i + 0x400001] = ICSSNDROM[i + 0xc00001]; - } -} - -static void pgm_decode_kovqhsgs_program() -{ - INT32 i, j; - UINT16 *src = (UINT16*)PGM68KROM; - UINT16 *dst = (UINT16*)BurnMalloc(0x400000); - - for (i = 0; i < 0x400000 / 2; i++) - { - j = BITSWAP24(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 6, 7, 5, 4, 3, 2, 1, 0); - - dst[j] = BURN_ENDIAN_SWAP_INT16(BITSWAP16(BURN_ENDIAN_SWAP_INT16(src[i]), 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 4, 5, 3, 2, 1, 0)); - } - - memcpy (src, dst, 0x400000); - - BurnFree (dst); -} - -void pgm_decrypt_kovqhsgs() -{ - pgm_decode_kovqhsgs_program(); - - pgm_decode_kovqhsgs_gfx_block(PGMSPRMaskROM + 0x000000); - pgm_decode_kovqhsgs_gfx_block(PGMSPRMaskROM + 0x800000); - - // sprite colors are decoded in pgm_run - - pgm_decode_kovqhsgs_samples(); -} - -static void pgm_decode_kovlsqh2_program() -{ - INT32 i, j; - UINT16 *src = (UINT16*)PGM68KROM; - UINT16 *dst = (UINT16*)BurnMalloc(0x400000); - - for (i = 0; i < 0x400000 / 2; i++) - { - j = BITSWAP24(i, 23, 22, 21, 20, 19, 16, 15, 14, 13, 12, 11, 10, 9, 8, 0, 1, 2, 3, 4, 5, 6, 18, 17, 7); - - dst[j] = BURN_ENDIAN_SWAP_INT16(src[i]); - } - - memcpy (src, dst, 0x400000); - - BurnFree (dst); -} - -void pgm_decrypt_kovlsqh2() -{ - pgm_decode_kovlsqh2_program(); - - pgm_decode_kovqhsgs_gfx_block(PGMSPRMaskROM + 0x000000); - pgm_decode_kovqhsgs_gfx_block(PGMSPRMaskROM + 0x800000); - - // sprite colors are decoded in pgm_run.cpp - - pgm_decode_kovqhsgs_samples(); -} - -static void pgm_decode_kovassg_program() -{ - INT32 i, j; - UINT16 *src = (UINT16 *)PGM68KROM; - UINT16 *dst = (UINT16 *)BurnMalloc(0x400000); - - for (i = 0; i < 0x400000/2; i++) - { - j = (i & ~0xffff) | (BITSWAP16(i, 15, 14, 13, 12, 11, 10, 7, 3, 1, 9, 4, 8, 6, 0, 2, 5) ^ 0x019c); - - dst[i] = BITSWAP16(src[j], 13, 9, 10, 11, 2, 0, 12 ,5, 4, 1, 14, 8, 15, 6, 3, 7) ^ 0x9d05; - } - - memcpy (src, dst, 0x400000); - - BurnFree (dst); -} - -void pgm_decrypt_kovassg() -{ - pgm_decode_kovassg_program(); - - pgm_decode_kovqhsgs_gfx_block(PGMSPRMaskROM + 0x000000); - pgm_decode_kovqhsgs_gfx_block(PGMSPRMaskROM + 0x800000); - - // sprite colors are decoded in pgm_run.cpp - - pgm_decode_kovqhsgs_samples(); -} - -void pgm_descramble_happy6_data(UINT8 *src, INT32 len) -{ - INT32 x, i, j; - UINT8 *buffer = (UINT8*)BurnMalloc(0x800000); - - for (x = 0; x < len; x += 0x800000) - { - for (i = 0; i < 0x800000; i++) //=0x200) - { - j = (i & 0xf8c01ff) | ((i >> 12) & 0x600) | ((i << 2) & 0x43f800) | ((i << 4) & 0x300000); - - buffer[i] = src[j + x]; - } - - memcpy (src + x, buffer, 0x800000); - } - - BurnFree (buffer); -} diff --git a/jan/src/burn/drv/pgm/pgm_draw.cpp b/jan/src/burn/drv/pgm/pgm_draw.cpp deleted file mode 100644 index bbf070c52..000000000 --- a/jan/src/burn/drv/pgm/pgm_draw.cpp +++ /dev/null @@ -1,1220 +0,0 @@ -#include "pgm.h" -#include "pgm_sprite.h" - -//#define DUMP_SPRITE_BITMAPS -//#define DRAW_SPRITE_NUMBER - -static INT32 enable_blending = 0; - -static INT32 nTileMask = 0; -static UINT8 sprmsktab[0x100]; -static UINT8 *SpritePrio; // sprite priorities -static UINT16 *pTempScreen; // sprites -static UINT16 *pTempDraw; // pre-zoomed sprites -static UINT8 *tiletrans; // tile transparency table -static UINT8 *texttrans; // text transparency table -static UINT32 *pTempDraw32; // 32 bit temporary bitmap (blending!) -static UINT8 *pSpriteBlendTable; // if blending is available, allocate this. - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s, UINT32 p) -{ - INT32 a = 255 - p; - - return (((((s & 0xff00ff) * p) + ((d & 0xff00ff) * a)) & 0xff00ff00) + - ((((s & 0x00ff00) * p) + ((d & 0x00ff00) * a)) & 0x00ff0000)) >> 8; -} - -#ifdef DRAW_SPRITE_NUMBER - -static UINT8 font_pixels[16][7*5] = { - { 0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,1,1,0,0,0,0,0,0,},// 0 - { 0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,},// 1 - { 0,0,0,0,0,0,0,1,1,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,0,},// 2 - { 0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,1,1,1,0,0,0,0,1,0,0,1,1,1,0,0,0,0,0,0,},// 3 - { 0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,},// 4 - { 0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,0,0,0,0,0,1,0,0,1,1,1,0,0,0,0,0,0,},// 5 - { 0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,0,0,0,0,0,},// 6 - { 0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,},// 7 - { 0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,0,0,0,0,0,},// 8 - { 0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,},// 9 - { 0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,},// A -// { 0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,0,1,1,0,0,0,1,0,1,0,0,1,1,1,0,0,0,0,0,0,},// B (looks like '8') - { 0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,0,0,0,0,0,},// b - { 0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,},// C -// { 0,0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,0,},// D (looks like '0') - { 0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,0,0,0,0,0,},// d - { 0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,},// E - { 0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,} // F -}; - -static void draw_font(INT32 sx, INT32 sy, UINT32 code) -{ - INT32 enable1 = 0; - - for (INT32 z = 7; z >= 0; z--) - { - INT32 chr = (code >> (z*4))&0xf; - - if (enable1 == 0 && chr == 0) continue; // skip leading 0's - enable1 = 1; - - UINT8 *gfx = font_pixels[chr]; - - if (enable_blending) { - for (INT32 y = 0; y < 7; y++) { - if ((sy+y)<0 || (sy+y)>=nScreenHeight) continue; // clip - - UINT32 *dst = pTempDraw32 + (sy + y) * nScreenWidth; - - for (INT32 x = 0; x < 5; x++) { - if ((sx+x)<0 || (sx+x)>=nScreenWidth) continue; // clip - - INT32 pxl = gfx[(y*5)+x]; - if (pxl) { - dst[(sx+x)] = 0xffffff; - } else { - dst[(sx+x)] = 0x000000; - } - } - } - } else { - for (INT32 y = 0; y < 7; y++) { - if ((sy+y)<0 || (sy+y)>=nScreenHeight) continue; // clip - - UINT16 *dst = pTransDraw + (sy + y) * nScreenWidth; - - for (INT32 x = 0; x < 5; x++) { - if ((sx+x)<0 || (sx+x)>=nScreenWidth) continue; // clip - - INT32 pxl = gfx[(y*5)+x]; - if (pxl) { - dst[(sx+x)] = 0x901; - } else { - dst[(sx+x)] = 0x900; - } - } - } - } - - sx += 5; - } -} - -static void pgm_drawsprites_fonts(INT32 priority) -{ - UINT16 *source = PGMSprBuf; - UINT16 *finish = PGMSprBuf + 0xa00/2; - - while (finish > source) - { - if (source[4] == 0) break; - - INT32 xpos = BURN_ENDIAN_SWAP_INT16(source[0]) & 0x07ff; - INT32 ypos = BURN_ENDIAN_SWAP_INT16(source[1]) & 0x03ff; - INT32 prio = (BURN_ENDIAN_SWAP_INT16(source[2]) & 0x0080) >> 7; - INT32 boff =((BURN_ENDIAN_SWAP_INT16(source[2]) & 0x007f) << 16) | (BURN_ENDIAN_SWAP_INT16(source[3]) & 0xffff); - - if (priority==prio) - draw_font(xpos, ypos, boff); - - source += 5; - } -} -#endif - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x7C00) >> 7; // Red - r |= r >> 5; - g = (nColour & 0x03E0) >> 2; // Green - g |= g >> 5; - b = (nColour & 0x001F) << 3; // Blue - b |= b >> 5; - - if (enable_blending) return (r<<16)|(g<<8)|(b<<0); - - return BurnHighCol(r, g, b, 0); -} - -static void pgm_prepare_sprite(INT32 wide, INT32 high, INT32 palt, INT32 boffset) -{ - UINT16* dest = pTempDraw; - UINT8 * bdata = PGMSPRMaskROM; - INT32 bdatasize = nPGMSPRMaskMaskLen; - - wide *= 16; - palt *= 32; - - UINT32 aoffset = (bdata[(boffset+3) & bdatasize] << 24) | (bdata[(boffset+2) & bdatasize] << 16) | (bdata[(boffset+1) & bdatasize] << 8) | (bdata[(boffset) & bdatasize]); - aoffset = (aoffset >> 2) * 3; - - boffset += 4; - - for (INT32 ycnt = 0; ycnt < high; ycnt++) - { - for (INT32 xcnt = 0; xcnt < wide; xcnt+=8) - { - aoffset+=zoom_draw_table[bdata[boffset & bdatasize]](dest + xcnt, PGMSPRColROM + (aoffset & nPGMSPRColMaskLen), palt); - - boffset++; - } - - dest += wide; - } -} - -static inline void draw_sprite_line(INT32 wide, UINT16* dest, UINT8 *pdest, INT32 xzoom, INT32 xgrow, INT32 yoffset, INT32 flip, INT32 xpos, INT32 prio) -{ - INT32 xzoombit; - INT32 xoffset; - INT32 xcnt = 0, xcntdraw = 0; - INT32 xdrawpos = 0; - - wide *= 16; - flip &= 1; - - while (xcnt < wide) - { - if (flip) xoffset = wide - xcnt - 1; - else xoffset = xcnt; - - UINT32 srcdat = pTempDraw[yoffset + xoffset]; - xzoombit = (xzoom >> (xcnt & 0x1f)) & 1; - - if (xzoombit == 1 && xgrow == 1) - { - xdrawpos = xpos + xcntdraw; - - if (!(srcdat & 0x8000)) - { - if ((xdrawpos >= 0) && (xdrawpos < nScreenWidth)) { - dest[xdrawpos] = srcdat; - pdest[xdrawpos] = prio; - } - - xdrawpos = xpos + xcntdraw + 1; - - if ((xdrawpos >= 0) && (xdrawpos < nScreenWidth)) { - dest[xdrawpos] = srcdat; - pdest[xdrawpos] = prio; - } - } - - xcntdraw+=2; - } - else if (xzoombit == 1 && xgrow == 0) - { - // skip this column - } - else //normal column - { - xdrawpos = xpos + xcntdraw; - - if (!(srcdat & 0x8000)) - { - if ((xdrawpos >= 0) && (xdrawpos < nScreenWidth)) { - dest[xdrawpos] = srcdat; - pdest[xdrawpos] = prio; - } - } - - xcntdraw++; - } - - xcnt++; - - if (xdrawpos == nScreenWidth) break; - } -} - -static void pgm_draw_sprite_nozoom(INT32 wide, INT32 high, INT32 palt, INT32 boffset, INT32 xpos, INT32 ypos, INT32 flipx, INT32 flipy, INT32 prio) -{ - UINT16 *dest = pTempScreen; - UINT8 *pdest = SpritePrio; - UINT8 * bdata = PGMSPRMaskROM; - UINT8 * adata = PGMSPRColROM; - INT32 bdatasize = nPGMSPRMaskMaskLen; - INT32 adatasize = nPGMSPRColMaskLen; - INT32 yoff, xoff; - - UINT16 msk; - - UINT32 aoffset = (bdata[(boffset+3) & bdatasize] << 24) | (bdata[(boffset+2) & bdatasize] << 16) | (bdata[(boffset+1) & bdatasize] << 8) | (bdata[boffset & bdatasize]); - aoffset = (aoffset >> 2) * 3; - aoffset &= adatasize; - - boffset += 4; - wide <<= 4; - - palt <<= 5; - - sprite_draw_nozoom_function *drawsprite = nozoom_draw_table[flipx ? 1 : 0]; - - for (INT32 ycnt = 0; ycnt < high; ycnt++) { - if (flipy) { - yoff = ypos + ((high-1) - ycnt); - if (yoff < 0) break; - if (yoff < nScreenHeight) { - dest = pTempScreen + (yoff * nScreenWidth); - pdest = SpritePrio + (yoff * nScreenWidth); - } - } else { - yoff = ypos + ycnt; - if (yoff >= nScreenHeight) break; - if (yoff >= 0) { - dest = pTempScreen + (yoff * nScreenWidth); - pdest = SpritePrio + (yoff * nScreenWidth); - } - } - - if (yoff >= 0 && yoff < nScreenHeight && xpos >= 0 && (xpos + wide) < nScreenWidth) - { - for (INT32 xcnt = 0; xcnt < wide; xcnt+=8) - { - if (flipx) { - xoff = xpos + ((wide - 8) - xcnt); - } else { - xoff = xpos + xcnt; - } - - aoffset += drawsprite[bdata[boffset & bdatasize]](dest + xoff, pdest + xoff, PGMSPRColROM + (aoffset & nPGMSPRColMaskLen), palt, prio); - boffset++; - } - } else { - for (INT32 xcnt = 0; xcnt < wide; xcnt+=8) - { - msk = bdata[boffset & bdatasize] ^ 0xff; - boffset++; - aoffset &= adatasize; - - if (yoff < 0 || yoff >= nScreenHeight || msk == 0) { - aoffset += sprmsktab[msk]; - - continue; - } - - if (flipx) { - xoff = xpos + (wide - xcnt) - 1; - - if (xoff < -7 || xoff >= nScreenWidth+8) { - aoffset += sprmsktab[msk]; - continue; - } - - for (INT32 x = 0; x < 8; x++, xoff--) - { - if (msk & 0x0001) - { - if (xoff >= 0 && xoff < nScreenWidth) { - dest[xoff] = adata[aoffset] | palt; - pdest[xoff] = prio; - } - - aoffset++; - } - - msk >>= 1; - if (!msk) break; - } - } else { - xoff = xpos + xcnt; - - if (xoff < -7 || xoff >= nScreenWidth) { - aoffset += sprmsktab[msk]; - continue; - } - - for (INT32 x = 0; x < 8; x++, xoff++) - { - if (msk & 0x0001) - { - if (xoff >= 0 && xoff < nScreenWidth) { - dest[xoff] = adata[aoffset] | palt; - pdest[xoff] = prio; - } - - aoffset++; - } - - msk >>= 1; - if (!msk) break; - } - } - } - } - } -} - -#ifdef DUMP_SPRITE_BITMAPS -static void pgm_dump_sprite(INT32 wide, INT32 high, INT32 palt, INT32 boffset, INT32 xpos, INT32 ypos, INT32 flipx, INT32 flipy, INT32 prio) -{ - if (nBurnBPP < 3) return; - - UINT32 *dest = pTempDraw32; - UINT8 * bdata = PGMSPRMaskROM; - UINT8 * adata = PGMSPRColROM; - INT32 bdatasize = nPGMSPRMaskMaskLen; - INT32 adatasize = nPGMSPRColMaskLen; - INT32 yoff, xoff; - - UINT16 msk; - - UINT32 boffset_initial = boffset/2; - - UINT32 aoffset = (bdata[(boffset+3) & bdatasize] << 24) | (bdata[(boffset+2) & bdatasize] << 16) | (bdata[(boffset+1) & bdatasize] << 8) | (bdata[boffset & bdatasize]); - aoffset = (aoffset >> 2) * 3; - aoffset &= adatasize; - - xpos = 0; - ypos = 0; - - boffset += 4; - wide <<= 4; - - palt <<= 5; - - UINT32 tcolor = BurnHighCol(0xff,0,0xff,0); - - for (INT32 y = 0; y < high; y++) { - for (INT32 x = 0; x < wide; x++) { - dest[y*1024+x] = tcolor; - } - } - - for (INT32 ycnt = 0; ycnt < high; ycnt++) { - if (flipy) { - yoff = ypos + ((high-1) - ycnt); - if (yoff < 0) break; - if (yoff < 512) { - dest = pTempDraw32 + (yoff * 1024); - } - } else { - yoff = ypos + ycnt; - if (yoff >= 512) break; - if (yoff >= 0) { - dest = pTempDraw32 + (yoff * 1024); - } - } - - { - for (INT32 xcnt = 0; xcnt < wide; xcnt+=8) - { - msk = bdata[boffset & bdatasize] ^ 0xff; - boffset++; - aoffset &= adatasize; - - if (yoff < 0 || yoff >= 512 || msk == 0) { - aoffset += sprmsktab[msk]; - - continue; - } - - if (flipx) { - xoff = xpos + (wide - xcnt) - 1; - - if (xoff < -7 || xoff >= 1024+8) { - aoffset += sprmsktab[msk]; - continue; - } - - for (INT32 x = 0; x < 8; x++, xoff--) - { - if (msk & 0x0001) - { - if (xoff >= 0 && xoff < 1024) { - dest[xoff] = RamCurPal[adata[aoffset] | palt]; - } - - aoffset++; - } - - msk >>= 1; - if (!msk) break; - } - } else { - xoff = xpos + xcnt; - - if (xoff < -7 || xoff >= 1024) { - aoffset += sprmsktab[msk]; - continue; - } - - for (INT32 x = 0; x < 8; x++, xoff++) - { - if (msk & 0x0001) - { - if (xoff >= 0 && xoff < 1024) { - dest[xoff] = RamCurPal[adata[aoffset] | palt]; - } - - aoffset++; - } - - msk >>= 1; - if (!msk) break; - } - } - } - } - } - -#define SET_FILE_SIZE(x) \ - bmp_data[2] = (x); \ - bmp_data[3] = (x)>>8; \ - bmp_data[4] = (x)>>16 - -#define SET_BITMAP_SIZE(x) \ - bmp_data[0x22] = (x); \ - bmp_data[0x23] = (x)>>8; \ - bmp_data[0x24] = (x)>>16 - -#define SET_BITMAP_WIDTH(x) \ - bmp_data[0x12] = (x); \ - bmp_data[0x13] = (x)>>8; \ - bmp_data[0x14] = (x)>>16 - -#define SET_BITMAP_HEIGHT(x) \ - bmp_data[0x16] = (x); \ - bmp_data[0x17] = (x)>>8; \ - bmp_data[0x18] = (x)>>16 - - UINT8 bmp_data[0x36] = { - 0x42, 0x4D, // 'BM' (leave alone) - 0x00, 0x00, 0x00, 0x00, // file size - 0x00, 0x00, 0x00, 0x00, // padding - 0x36, 0x00, 0x00, 0x00, // offset to data (leave alone) - 0x28, 0x00, 0x00, 0x00, // windows mode (leave alone) - 0x00, 0x00, 0x00, 0x00, // bitmap width - 0x00, 0x00, 0x00, 0x00, // bitmap height - 0x01, 0x00, // planes (1) always! - 0x20, 0x00, // bits per pixel (let's do 32 so no conversion!) - 0x00, 0x00, 0x00, 0x00, // compression (none) - 0x00, 0x00, 0x00, 0x00, // size of bitmap data - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 - }; - - SET_FILE_SIZE((wide*high*4)+54); - SET_BITMAP_SIZE(wide*high*4); - SET_BITMAP_WIDTH(wide); - SET_BITMAP_HEIGHT(high); - - char output[256]; - sprintf (output, "blendbmp/%8.8x_%dx%d.bmp", boffset_initial,wide,high); - FILE *fa; - fa = fopen(output, "rb"); - if (fa) { - fclose (fa); - return; - } - fa = fopen(output, "wb"); - fwrite (bmp_data,0x36,1,fa); - for (INT32 y = high-1; y >= 0; y--) { // bitmap format is flipped - fwrite (pTempDraw32 + 1024 * y,wide*4,1,fa); - } - fclose (fa); -} -#endif - -static void draw_sprite_new_zoomed(INT32 wide, INT32 high, INT32 xpos, INT32 ypos, INT32 palt, INT32 boffset, INT32 flip, UINT32 xzoom, INT32 xgrow, UINT32 yzoom, INT32 ygrow, INT32 prio ) -{ - if (!wide) return; - -#ifdef DUMP_SPRITE_BITMAPS - pgm_dump_sprite(wide, high, palt, boffset, xpos, ypos, flip & 1, flip & 2, prio); -#endif - - if (yzoom == 0 && xzoom == 0) { - pgm_draw_sprite_nozoom(wide, high, palt, boffset, xpos, ypos, flip & 1, flip & 2, prio); - return; - } - - INT32 ycnt; - INT32 ydrawpos; - UINT16 *dest; - UINT8 *pdest; - INT32 yoffset; - INT32 ycntdraw; - INT32 yzoombit; - - pgm_prepare_sprite(wide, high, palt, boffset); - - ycnt = 0; - ycntdraw = 0; - while (ycnt < high) - { - yzoombit = (yzoom >> (ycnt&0x1f))&1; - - if (yzoombit == 1 && ygrow == 1) // double this line - { - ydrawpos = ypos + ycntdraw; - - if (!(flip&0x02)) yoffset = (ycnt*(wide*16)); - else yoffset = ( (high-ycnt-1)*(wide*16)); - if ((ydrawpos >= 0) && (ydrawpos < 224)) - { - dest = pTempScreen + ydrawpos * nScreenWidth; - pdest = SpritePrio + ydrawpos * nScreenWidth; - draw_sprite_line(wide, dest, pdest, xzoom, xgrow, yoffset, flip, xpos, prio); - } - ycntdraw++; - - ydrawpos = ypos + ycntdraw; - if (!(flip&0x02)) yoffset = (ycnt*(wide*16)); - else yoffset = ( (high-ycnt-1)*(wide*16)); - if ((ydrawpos >= 0) && (ydrawpos < 224)) - { - dest = pTempScreen + ydrawpos * nScreenWidth; - pdest = SpritePrio + ydrawpos * nScreenWidth; - draw_sprite_line(wide, dest, pdest, xzoom, xgrow, yoffset, flip, xpos, prio); - } - ycntdraw++; - - if (ydrawpos == 224) ycnt = high; - } - else if (yzoombit ==1 && ygrow == 0) - { - // skip this line - // we should process anyway if we don't do the pre-decode... - } - else // normal line - { - ydrawpos = ypos + ycntdraw; - - if (!(flip&0x02)) yoffset = (ycnt*(wide*16)); - else yoffset = ( (high-ycnt-1)*(wide*16)); - if ((ydrawpos >= 0) && (ydrawpos < 224)) - { - dest = pTempScreen + ydrawpos * nScreenWidth; - pdest = SpritePrio + ydrawpos * nScreenWidth; - draw_sprite_line(wide, dest, pdest, xzoom, xgrow, yoffset, flip, xpos, prio); - } - ycntdraw++; - - if (ydrawpos == 224) ycnt = high; - } - - ycnt++; - } -} - -static void pgm_drawsprites() -{ - UINT16 *source = PGMSprBuf; - UINT16 *finish = PGMSprBuf + 0xa00/2; - UINT16 *zoomtable = &PGMVidReg[0x1000/2]; - - while (finish > source) - { - if (source[4] == 0) break; // right? - - INT32 xpos = BURN_ENDIAN_SWAP_INT16(source[0]) & 0x07ff; - INT32 ypos = BURN_ENDIAN_SWAP_INT16(source[1]) & 0x03ff; - INT32 xzom = (BURN_ENDIAN_SWAP_INT16(source[0]) & 0x7800) >> 11; - INT32 xgrow= (BURN_ENDIAN_SWAP_INT16(source[0]) & 0x8000) >> 15; - INT32 yzom = (BURN_ENDIAN_SWAP_INT16(source[1]) & 0x7800) >> 11; - INT32 ygrow= (BURN_ENDIAN_SWAP_INT16(source[1]) & 0x8000) >> 15; - INT32 palt = (BURN_ENDIAN_SWAP_INT16(source[2]) & 0x1f00) >> 8; - INT32 flip = (BURN_ENDIAN_SWAP_INT16(source[2]) & 0x6000) >> 13; - INT32 boff =((BURN_ENDIAN_SWAP_INT16(source[2]) & 0x007f) << 16) | (BURN_ENDIAN_SWAP_INT16(source[3]) & 0xffff); - INT32 wide = (BURN_ENDIAN_SWAP_INT16(source[4]) & 0x7e00) >> 9; - INT32 prio = (BURN_ENDIAN_SWAP_INT16(source[2]) & 0x0080) >> 7; - INT32 high = BURN_ENDIAN_SWAP_INT16(source[4]) & 0x01ff; - - if (xgrow) xzom = 0x10-xzom; - if (ygrow) yzom = 0x10-yzom; - - UINT32 xzoom = (zoomtable[xzom*2]<<16)|zoomtable[xzom*2+1]; - UINT32 yzoom = (zoomtable[yzom*2]<<16)|zoomtable[yzom*2+1]; - - if (xpos > 0x3ff) xpos -=0x800; - if (ypos > 0x1ff) ypos -=0x400; - - if (enable_blending) { - palt|= pSpriteBlendTable[boff] << 7; - } - - draw_sprite_new_zoomed(wide, high, xpos, ypos, palt, boff * 2, flip, xzoom, xgrow, yzoom, ygrow, prio); - - source += 5; - } -} - -static void copy_sprite_priority(INT32 prio) -{ - UINT16 *src = pTempScreen; - UINT8 *pri = SpritePrio; - - if (enable_blending) { - UINT32 *dest = pTempDraw32; - INT32 blend_levels[16] = { 0x00, 0x1f, 0x2f, 0x3f, 0x4f, 0x5f, 0x6f, 0x7f, 0x8f, 0x9f, 0xaf, 0xbf, 0xcf, 0xdf, 0xef, 0xff }; - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) - { - if (pri[i] == prio) { - if (src[i]&0xf000) { - dest[i] = alpha_blend(dest[i], RamCurPal[src[i]&0xfff], blend_levels[src[i]/0x1000]); - } else { - dest[i] = RamCurPal[src[i]]; - } - } - } - } else { - UINT16 *dest = pTransDraw; - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) - { - if (pri[i] == prio) { - dest[i] = src[i]; - } - } - } -} - -static void draw_text() -{ - UINT16 *vram = (UINT16*)PGMTxtRAM; - - INT32 scrollx = ((INT16)BURN_ENDIAN_SWAP_INT16(PGMVidReg[0x6000 / 2])) & 0x1ff; - INT32 scrolly = ((INT16)BURN_ENDIAN_SWAP_INT16(PGMVidReg[0x5000 / 2])) & 0x0ff; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2]); - if (texttrans[code] == 0) continue; // transparent - - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 1]); - INT32 color = ((attr & 0x3e) >> 1) | 0x80; - INT32 flipx = (attr & 0x40); - INT32 flipy = (attr & 0x80); - - if (enable_blending) - { - UINT8 *gfx = PGMTileROM + (code * 0x40); - INT32 flip = (flipx ? 0x07 : 0) | (flipy ? 0x38 : 0); - UINT32 *pal = RamCurPal + color * 0x10; - UINT32 *dst = pTempDraw32 + (sy * nScreenWidth) + sx; - - for (INT32 y = 0; y < 8; y++, dst += nScreenWidth) { - if ((sy+y) >= 0 && (sy+y)=0 && (sx+x)= nScreenWidth - 8 || sy >= nScreenHeight - 8) - { - if (texttrans[code] & 2) { // opaque - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, PGMTileROM); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, PGMTileROM); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, PGMTileROM); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, PGMTileROM); - } - } - } else { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, PGMTileROM); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, PGMTileROM); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, PGMTileROM); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, PGMTileROM); - } - } - } - } - else - { - if (texttrans[code] & 2) { // opaque - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, PGMTileROM); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy, color, 4, 0, PGMTileROM); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy, color, 4, 0, PGMTileROM); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, 0, PGMTileROM); - } - } - } else { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 15, 0, PGMTileROM); - } else { - Render8x8Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 4, 15, 0, PGMTileROM); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 4, 15, 0, PGMTileROM); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 15, 0, PGMTileROM); - } - } - } - } - } - } -} - -static void draw_background() -{ - UINT16 *vram = (UINT16*)PGMBgRAM; - - UINT16 *rowscroll = PGMRowRAM; - INT32 yscroll = (INT16)BURN_ENDIAN_SWAP_INT16(PGMVidReg[0x2000 / 2]); - INT32 xscroll = (INT16)BURN_ENDIAN_SWAP_INT16(PGMVidReg[0x3000 / 2]); - - // check to see if we need to do line scroll - INT32 t = 0; - { - UINT16 *rs = rowscroll; - for (INT32 i = 0; i < 224; i++) { - if (BURN_ENDIAN_SWAP_INT16(rs[0]) != BURN_ENDIAN_SWAP_INT16(rs[i])) { - t = 1; - break; - } - } - } - - // no line scroll (fast) - if (t == 0) - { - yscroll &= 0x1ff; - xscroll &= 0x7ff; - - for (INT32 offs = 0; offs < 64 * 16; offs++) - { - INT32 sx = (offs & 0x3f) << 5; - INT32 sy = (offs >> 6) << 5; - - sx -= xscroll; - if (sx < -31) sx += 2048; - sy -= yscroll; - if (sy < -31) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2]); - if (code >= nTileMask) continue; - if (tiletrans[code] == 0) continue; // transparent - INT32 color = ((BURN_ENDIAN_SWAP_INT16(vram[offs*2+1]) & 0x3e) >> 1) | 0x20; - INT32 flipy = BURN_ENDIAN_SWAP_INT16(vram[offs*2+1]) & 0x80; - INT32 flipx = BURN_ENDIAN_SWAP_INT16(vram[offs*2+1]) & 0x40; - - if (enable_blending) - { - UINT8 *gfx = PGMTileROMExp + (code * 0x400); - INT32 flip = (flipx ? 0x1f : 0) | (flipy ? 0x3e0 : 0); - UINT32 *pal = RamCurPal + color * 0x20; - UINT32 *dst = pTempDraw32 + (sy * nScreenWidth) + sx; - - for (INT32 y = 0; y < 32; y++, dst += nScreenWidth) { - if ((sy+y) >= 0 && (sy+y)=0 && (sx+x)= nScreenWidth - 32 || sy >= nScreenHeight - 32) - { - if (tiletrans[code] & 2) { // opaque - if (flipy) { - if (flipx) { - Render32x32Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 5, 0, PGMTileROMExp); - } else { - Render32x32Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 5, 0, PGMTileROMExp); - } - } else { - if (flipx) { - Render32x32Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 5, 0, PGMTileROMExp); - } else { - Render32x32Tile_Clip(pTransDraw, code, sx, sy, color, 5, 0, PGMTileROMExp); - } - } - } else { - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 5, 0x1f, 0, PGMTileROMExp); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 5, 0x1f, 0, PGMTileROMExp); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 5, 0x1f, 0, PGMTileROMExp); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 5, 0x1f, 0, PGMTileROMExp); - } - } - } - } - else - { - if (tiletrans[code] & 2) { // opaque - if (flipy) { - if (flipx) { - Render32x32Tile_FlipXY(pTransDraw, code, sx, sy, color, 5, 0, PGMTileROMExp); - } else { - Render32x32Tile_FlipY(pTransDraw, code, sx, sy, color, 5, 0, PGMTileROMExp); - } - } else { - if (flipx) { - Render32x32Tile_FlipX(pTransDraw, code, sx, sy, color, 5, 0, PGMTileROMExp); - } else { - Render32x32Tile(pTransDraw, code, sx, sy, color, 5, 0, PGMTileROMExp); - } - } - } else { - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 5, 0x1f, 0, PGMTileROMExp); - } else { - Render32x32Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 5, 0x1f, 0, PGMTileROMExp); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 5, 0x1f, 0, PGMTileROMExp); - } else { - Render32x32Tile_Mask(pTransDraw, code, sx, sy, color, 5, 0x1f, 0, PGMTileROMExp); - } - } - } - } - } - } - - return; - } - - // do line scroll (slow) - for (INT32 y = 0; y < 224; y++) - { - INT32 scrollx = (xscroll + BURN_ENDIAN_SWAP_INT16(rowscroll[y])) & 0x7ff; - INT32 scrolly = (yscroll + y) & 0x7ff; - - for (INT32 x = 0; x < 480; x+=32) - { - INT32 sx = x - (scrollx & 0x1f); - if (sx >= nScreenWidth) break; - - INT32 offs = ((scrolly & 0x1e0) << 2) | (((scrollx + x) & 0x7e0) >> 4); - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - if (code >= nTileMask) continue; - if (tiletrans[code] == 0) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs + 1]); - INT32 color = ((attr & 0x3e) << 4) | 0x400; - INT32 flipx = ((attr & 0x40) >> 6) * 0x1f; - INT32 flipy = ((attr & 0x80) >> 7) * 0x1f; - - UINT8 *src = PGMTileROMExp + (code * 1024) + (((scrolly ^ flipy) & 0x1f) << 5); - - if (enable_blending) - { - UINT32 *dst = pTempDraw32 + (y * nScreenWidth); - UINT32 *pal = RamCurPal + color; - - if (sx >= 0 && sx <= 415) { - for (INT32 xx = 0; xx < 32; xx++, sx++) { - INT32 pxl = src[xx^flipx]; - - if (pxl != 0x1f) { - dst[sx] = pal[pxl]; - } - } - } else { - for (INT32 xx = 0; xx < 32; xx++, sx++) { - if (sx < 0) continue; - if (sx >= nScreenWidth) break; - - INT32 pxl = src[xx^flipx]; - - if (pxl != 0x1f) { - dst[sx] = pal[pxl]; - } - } - } - } else { - UINT16 *dst = pTransDraw + (y * nScreenWidth); - - if (sx >= 0 && sx <= 415) { - for (INT32 xx = 0; xx < 32; xx++, sx++) { - INT32 pxl = src[xx^flipx]; - - if (pxl != 0x1f) { - dst[sx] = pxl | color; - } - } - } else { - for (INT32 xx = 0; xx < 32; xx++, sx++) { - if (sx < 0) continue; - if (sx >= nScreenWidth) break; - - INT32 pxl = src[xx^flipx]; - - if (pxl != 0x1f) { - dst[sx] = pxl | color; - } - } - } - } - } - } -} - -static void pgmBlendCopy() -{ - pBurnDrvPalette = RamCurPal; - - UINT32 *bmp = pTempDraw32; - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - PutPix(pBurnDraw + (i * nBurnBpp), BurnHighCol(bmp[i]>>16, (bmp[i]>>8)&0xff, bmp[i]&0xff, 0)); - } -} - -INT32 pgmDraw() -{ - if (enable_blending) nPgmPalRecalc = 1; // force recalc. - - if (nPgmPalRecalc) { - for (INT32 i = 0; i < 0x1200 / 2; i++) { - RamCurPal[i] = CalcCol(BURN_ENDIAN_SWAP_INT16(PGMPalRAM[i])); - } - nPgmPalRecalc = 0; - } - - { - // black / magenta - RamCurPal[0x1200/2] = (nBurnLayer & 1) ? RamCurPal[0x3ff] : BurnHighCol(0xff, 0, 0xff, 0); - RamCurPal[0x1202/2] = BurnHighCol(0xff,0x00,0xff,0); - } - - // Fill in background color (0x1200/2) - // also, clear buffers - { - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTempDraw32[i] = RamCurPal[0x900]; - pTransDraw[i] = 0x900; - pTempScreen[i] = 0; - SpritePrio[i] = 0xff; - } - } - - pgm_drawsprites(); - if (nSpriteEnable & 1) copy_sprite_priority(1); -#ifdef DRAW_SPRITE_NUMBER - pgm_drawsprites_fonts(1); -#endif - if (nBurnLayer & 1) draw_background(); - if (nSpriteEnable & 2) copy_sprite_priority(0); -#ifdef DRAW_SPRITE_NUMBER - pgm_drawsprites_fonts(0); -#endif - if (nBurnLayer & 2) draw_text(); - - if (enable_blending) { - pgmBlendCopy(); - } else { - BurnTransferCopy(RamCurPal); - } - - return 0; -} - -static void pgmBlendInit() -{ - enable_blending = 0; - - TCHAR filename[MAX_PATH]; - - _stprintf(filename, _T("%s%s.bld"), szAppBlendPath, BurnDrvGetText(DRV_NAME)); - - FILE *fa = _tfopen(filename, _T("rt")); - - if (fa == NULL) { - bprintf (0, _T("can't find: %s\n"), filename); - _stprintf(filename, _T("%s%s.bld"), szAppBlendPath, BurnDrvGetText(DRV_PARENT)); - - fa = _tfopen(filename, _T("rt")); - - if (fa == NULL) { - bprintf (0, _T("can't find: %s\n"), filename); - return; - } - } - - if (pSpriteBlendTable == NULL) { - pSpriteBlendTable = (UINT8*)BurnMalloc(0x800000); - if (pSpriteBlendTable == NULL) { - bprintf (0, _T("can't allocate blend table\n")); - return; - } - } - - bprintf (PRINT_IMPORTANT, _T("Using sprite blending (.bld) table!\n")); - - char szLine[64]; - - while (1) - { - if (fgets (szLine, 64, fa) == NULL) break; - - if (strncmp ("Game", szLine, 4) == 0) continue; // don't care - if (strncmp ("Name", szLine, 4) == 0) continue; // don't care - if (szLine[0] == ';') continue; // comment (also don't care) - - INT32 single_entry = -1; - UINT32 type,min,max,k; - - for (k = 0; k < strlen(szLine); k++) { - if (szLine[k] == '-') { single_entry = k+1; break; } - } - - if (single_entry < 0) { - sscanf(szLine,"%x %x",&max,&type); - min = max; - } else { - sscanf(szLine,"%x",&min); - sscanf(szLine+single_entry,"%x %x",&max,&type); - } - - for (k = min; k <= max && k < 0x800000; k++) { - pSpriteBlendTable[k] = type&0xf; - } - } - - fclose (fa); - - enable_blending = 1; -} - -void pgmInitDraw() // preprocess some things... -{ - GenericTilesInit(); - - pTempDraw32 = (UINT32*)BurnMalloc(0x448 * 0x224 * 4); - pTempDraw = (UINT16*)BurnMalloc(0x400 * 0x200 * sizeof(INT16)); - SpritePrio = (UINT8*)BurnMalloc(nScreenWidth * nScreenHeight); - pTempScreen = (UINT16*)BurnMalloc(nScreenWidth * nScreenHeight * sizeof(INT16)); - - if (bBurnUseBlend) pgmBlendInit(); - - // Find transparent tiles so we can skip them - { - nTileMask = ((nPGMTileROMLen / 5) * 8) / 0x400; // also used to set max. tile - - // background tiles - tiletrans = (UINT8*)BurnMalloc(nTileMask); - memset (tiletrans, 0, nTileMask); - - for (INT32 i = 0; i < nTileMask << 10; i += 0x400) - { - INT32 k = 0x1f; - for (INT32 j = 0; j < 0x400; j++) - { - if (PGMTileROMExp[i+j] != 0x1f) { - tiletrans[i/0x400] = 1; - } - k &= (PGMTileROMExp[i+j] ^ 0x1f); - } - if (k) tiletrans[i/0x400] |= 2; - } - - // character tiles - texttrans = (UINT8*)BurnMalloc(0x10000); - memset (texttrans, 0, 0x10000); - - for (INT32 i = 0; i < 0x400000; i += 0x40) - { - INT32 k = 0xf; - for (INT32 j = 0; j < 0x40; j++) - { - if (PGMTileROM[i+j] != 0xf) { - texttrans[i/0x40] = 1; - } - k &= (PGMTileROM[i+j] ^ 0xf); - } - if (k) texttrans[i/0x40] |= 2; - } - } - - // set up table to count bits in sprite mask data - // gives a good speedup in sprite drawing. ^^ - { - memset (sprmsktab, 0, 0x100); - for (INT32 i = 0; i < 0x100; i++) { - for (INT32 j = 0; j < 8; j++) { - if (i & (1 << j)) { - sprmsktab[i]++; - } - } - } - } -} - -void pgmExitDraw() -{ - nTileMask = 0; - - BurnFree (pTempDraw32); - BurnFree (pTempDraw); - BurnFree (tiletrans); - BurnFree (texttrans); - BurnFree (pTempScreen); - BurnFree (SpritePrio); - - if (pSpriteBlendTable) { - BurnFree(pSpriteBlendTable); - } - - enable_blending = 0; - - GenericTilesExit(); -} diff --git a/jan/src/burn/drv/pgm/pgm_run.cpp b/jan/src/burn/drv/pgm/pgm_run.cpp deleted file mode 100644 index 9c3d4c34d..000000000 --- a/jan/src/burn/drv/pgm/pgm_run.cpp +++ /dev/null @@ -1,1019 +0,0 @@ - -#include "pgm.h" -#include "arm7_intf.h" -#include "v3021.h" -#include "ics2115.h" - -UINT8 PgmJoy1[8] = {0,0,0,0,0,0,0,0}; -UINT8 PgmJoy2[8] = {0,0,0,0,0,0,0,0}; -UINT8 PgmJoy3[8] = {0,0,0,0,0,0,0,0}; -UINT8 PgmJoy4[8] = {0,0,0,0,0,0,0,0}; -UINT8 PgmBtn1[8] = {0,0,0,0,0,0,0,0}; -UINT8 PgmBtn2[8] = {0,0,0,0,0,0,0,0}; -UINT8 PgmInput[9] = {0,0,0,0,0,0,0,0,0}; -UINT8 PgmReset = 0; - -INT32 nPGM68KROMLen = 0; -INT32 nPGMTileROMLen = 0; -INT32 nPGMSPRColROMLen = 0; -INT32 nPGMSPRMaskROMLen = 0; -INT32 nPGMSNDROMLen = 0; -INT32 nPGMSPRColMaskLen = 0; -INT32 nPGMSPRMaskMaskLen = 0; -INT32 nPGMExternalARMLen = 0; - -UINT32 *PGMBgRAM; -UINT32 *PGMTxtRAM; -UINT32 *RamCurPal; -UINT16 *PGMRowRAM; -UINT16 *PGMPalRAM; -UINT16 *PGMVidReg; -UINT16 *PGMSprBuf; -static UINT8 *RamZ80; -UINT8 *PGM68KRAM; - -static UINT16 nSoundlatch[3] = {0, 0, 0}; -static UINT8 bSoundlatchRead[3] = {0, 0, 0}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; - -UINT8 *PGM68KBIOS, *PGM68KROM, *PGMTileROM, *PGMTileROMExp, *PGMSPRColROM, *PGMSPRMaskROM, *PGMARMROM; -UINT8 *PGMARMRAM0, *PGMUSER0, *PGMARMRAM1, *PGMARMRAM2, *PGMARMShareRAM, *PGMARMShareRAM2, *PGMProtROM; - -UINT8 *ICSSNDROM; - -UINT8 nPgmPalRecalc = 0; -static UINT8 nPgmZ80Work = 0; -static INT32 nPgmCurrentBios = -1; - -void (*pPgmResetCallback)() = NULL; -void (*pPgmInitCallback)() = NULL; -void (*pPgmProtCallback)() = NULL; -INT32 (*pPgmScanCallback)(INT32, INT32*) = NULL; - -static INT32 nEnableArm7 = 0; -INT32 nPGMDisableIRQ4 = 0; -INT32 nPGMArm7Type = 0; -UINT32 nPgmAsicRegionHackAddress = 0; - -#define M68K_CYCS_PER_FRAME ((20000000 * 100) / nBurnFPS) -#define ARM7_CYCS_PER_FRAME ((20000000 * 100) / nBurnFPS) -#define Z80_CYCS_PER_FRAME (( 8468000 * 100) / nBurnFPS) - -#define PGM_INTER_LEAVE 200 - -#define M68K_CYCS_PER_INTER (M68K_CYCS_PER_FRAME / PGM_INTER_LEAVE) -#define ARM7_CYCS_PER_INTER (ARM7_CYCS_PER_FRAME / PGM_INTER_LEAVE) -#define Z80_CYCS_PER_INTER (Z80_CYCS_PER_FRAME / PGM_INTER_LEAVE) - -static INT32 nCyclesDone[3]; -static INT32 nExtraCycles; - -static INT32 pgmMemIndex() -{ - UINT8 *Next; Next = Mem; - PGM68KBIOS = Next; Next += 0x0080000; - PGM68KROM = Next; Next += nPGM68KROMLen; - - PGMUSER0 = Next; Next += nPGMExternalARMLen; - - PGMProtROM = PGMUSER0 + 0x10000; // Olds, Killbld, drgw3 - - if (BurnDrvGetHardwareCode() & HARDWARE_IGS_USE_ARM_CPU) { - PGMARMROM = Next; Next += 0x0004000; - } - - RamStart = Next; - - PGM68KRAM = Next; Next += 0x0020000; - RamZ80 = Next; Next += 0x0010000; - - if (BurnDrvGetHardwareCode() & HARDWARE_IGS_USE_ARM_CPU) { - PGMARMShareRAM = Next; Next += 0x0010000; - PGMARMShareRAM2 = Next; Next += 0x0010000; - PGMARMRAM0 = Next; Next += 0x0001000; // minimum map is 0x1000 - should be 0x400 - PGMARMRAM1 = Next; Next += 0x0040000; - PGMARMRAM2 = Next; Next += 0x0001000; // minimum map is 0x1000 - should be 0x400 - } - - PGMBgRAM = (UINT32 *) Next; Next += 0x0001000; - PGMTxtRAM = (UINT32 *) Next; Next += 0x0002000; - - PGMRowRAM = (UINT16 *) Next; Next += 0x0001000; // Row Scroll - PGMPalRAM = (UINT16 *) Next; Next += 0x0001400; // Palette R5G5B5 - PGMVidReg = (UINT16 *) Next; Next += 0x0010000; // Video Regs inc. Zoom Table - PGMSprBuf = (UINT16 *) Next; Next += 0x0000a00; - - RamEnd = Next; - - RamCurPal = (UINT32 *) Next; Next += (0x0001204 / 2) * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 pgmGetRoms(bool bLoad) -{ - INT32 kov2 = (strncmp(BurnDrvGetTextA(DRV_NAME), "kov2", 4) == 0) ? 1 : 0; - - char* pRomName; - struct BurnRomInfo ri; - struct BurnRomInfo pi; - - UINT8 *PGMUSER0Load = PGMUSER0; - UINT8 *PGM68KROMLoad = PGM68KROM; - UINT8 *PGMTileROMLoad = PGMTileROM + 0x180000; - UINT8 *PGMSPRMaskROMLoad = PGMSPRMaskROM; - UINT8 *PGMSNDROMLoad = ICSSNDROM + 0x400000; - UINT8 *PGMARMROMLoad = PGMARMROM; - - if (kov2 && bLoad) { - PGMSNDROMLoad += 0x400000; - } - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 1) - { - if (bLoad) { - BurnDrvGetRomInfo(&pi, i+1); - - if (ri.nLen == 0x80000 && pi.nLen == 0x80000) - { - BurnLoadRom(PGM68KROMLoad + 0, i + 0, 2); - BurnLoadRom(PGM68KROMLoad + 1, i + 1, 2); - PGM68KROMLoad += pi.nLen; - i += 1; - } - else - { - BurnLoadRom(PGM68KROMLoad, i, 1); - } - PGM68KROMLoad += ri.nLen; - } else { - nPGM68KROMLen += ri.nLen; - } - continue; - } - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 2) - { - if (bLoad) { - BurnLoadRom(PGMTileROMLoad, i, 1); - PGMTileROMLoad += ri.nLen; - } else { - nPGMTileROMLen += ri.nLen; - } - continue; - } - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 3) - { - if (bLoad) { - } else { - nPGMSPRColROMLen += ri.nLen; - } - continue; - } - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 4) - { - if (bLoad) { - if (strcmp(BurnDrvGetTextA(DRV_NAME), "pgm3in1") == 0) { - if ((PGMSPRMaskROMLoad - PGMSPRMaskROM) == 0x1000000) PGMSPRMaskROMLoad -= 0x100000; - } - - BurnLoadRom(PGMSPRMaskROMLoad, i, 1); - PGMSPRMaskROMLoad += ri.nLen; - } else { - nPGMSPRMaskROMLen += ri.nLen; - } - continue; - } - - if ((ri.nType & BRF_SND) && (ri.nType & 0x0f) == 5) - { - if (bLoad) { - BurnLoadRom(PGMSNDROMLoad, i, 1); - PGMSNDROMLoad += ri.nLen; - } else { - nPGMSNDROMLen += ri.nLen; - } - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 7) - { - if (bLoad) { - if (BurnDrvGetHardwareCode() & HARDWARE_IGS_USE_ARM_CPU) { - if (ri.nLen == 0x3e78) PGMARMROMLoad += 0x188; - BurnLoadRom(PGMARMROMLoad, i, 1); - } - } - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 8) - { - if (BurnDrvGetHardwareCode() & HARDWARE_IGS_USE_ARM_CPU) { - if (bLoad) { - BurnLoadRom(PGMUSER0Load, i, 1); - PGMUSER0Load += ri.nLen; - } else { - nPGMExternalARMLen += ri.nLen; - } - } - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 9) - { - if (bLoad) { - BurnLoadRom(PGMProtROM, i, 1); - } - } - } - - if (!bLoad) { - nPGMTileROMLen += 0x180000; - if (nPGMTileROMLen < 0x400000) nPGMTileROMLen = 0x400000; - - nPGMSNDROMLen += 0x400000; - - if (kov2) nPGMSNDROMLen += 0x400000; - - nPGMSNDROMLen = ((nPGMSNDROMLen-1) | 0xfffff) + 1; - // nICSSNDROMLen = nPGMSNDROMLen; // iq_132 - - if (nPGMExternalARMLen == 0) nPGMExternalARMLen = 0x200000; - } - - return 0; -} - -static UINT16 ics2115_soundlatch_r(INT32 i) -{ - bSoundlatchRead[i] = 1; - return nSoundlatch[i]; -} - -static void ics2115_soundlatch_w(INT32 i, UINT16 d) -{ - nSoundlatch[i] = d; - bSoundlatchRead[i] = 0; -} - -UINT8 __fastcall PgmReadByte(UINT32 sekAddress) -{ - switch (sekAddress) - { - case 0xC00007: - return v3021Read(); - - case 0xC08007: // dipswitches - (ddp2) - return ~(PgmInput[6]) | 0xe0; - - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x (PC: %5.5x)\n"), sekAddress, SekGetPC(-1)); - } - - return 0; -} - -UINT16 __fastcall PgmReadWord(UINT32 sekAddress) -{ - switch (sekAddress) - { - case 0xC00004: - return ics2115_soundlatch_r(1); - - case 0xC00006: // ketsui wants this - return v3021Read(); - - case 0xC08000: // p1+p2 controls - return ~(PgmInput[0] | (PgmInput[1] << 8)); - - case 0xC08002: // p3+p4 controls - return ~(PgmInput[2] | (PgmInput[3] << 8)); - - case 0xC08004: // extra controls - return ~(PgmInput[4] | (PgmInput[5] << 8)); - - case 0xC08006: // dipswitches - return ~(PgmInput[6]) | 0xffe0; - - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x (PC: %5.5x)\n"), sekAddress, SekGetPC(-1)); - } - - return 0; -} - -void __fastcall PgmWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - byteValue=byteValue; // fix warning - - switch (sekAddress) - { - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x (PC: %5.5x)\n"), byteValue, sekAddress, SekGetPC(-1)); - } -} - -void __fastcall PgmWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - static INT32 coin_counter_previous; - - switch (sekAddress) - { - case 0x700006: // Watchdog? - break; - - case 0xC00002: - ics2115_soundlatch_w(0, wordValue); - if (nPgmZ80Work) ZetNmi(); - break; - - case 0xC00004: - ics2115_soundlatch_w(1, wordValue); - break; - - case 0xC00006: - v3021Write(wordValue); - break; - - case 0xC00008: - if (wordValue == 0x5050) { - ics2115_reset(); - nPgmZ80Work = 1; - - ZetReset(); - } else { - nPgmZ80Work = 0; - } - break; - - case 0xC0000A: // z80_ctrl_w - break; - - case 0xC0000C: - ics2115_soundlatch_w(2, wordValue); - break; - - case 0xC08006: // coin counter - if (coin_counter_previous == 0xf && wordValue == 0) { - // bprintf (0, _T("increment coin counter!\n")); - } - coin_counter_previous = wordValue & 0x0f; - break; - - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x (PC: %5.5x)\n"), wordValue, sekAddress, SekGetPC(-1)); - } -} - -UINT8 __fastcall PgmZ80ReadByte(UINT32 sekAddress) -{ - switch (sekAddress) - { - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - - return 0; -} - -UINT16 __fastcall PgmZ80ReadWord(UINT32 sekAddress) -{ - sekAddress &= 0xffff; - return (RamZ80[sekAddress] << 8) | RamZ80[sekAddress+1]; -} - -void __fastcall PgmZ80WriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - sekAddress &= 0xffff; - RamZ80[sekAddress] = wordValue >> 8; - RamZ80[sekAddress+1] = wordValue & 0xFF; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x7C00) >> 7; // Red - r |= r >> 5; - g = (nColour & 0x03E0) >> 2; // Green - g |= g >> 5; - b = (nColour & 0x001F) << 3; // Blue - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -void __fastcall PgmPaletteWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - sekAddress = (sekAddress - 0xa00000) >> 1; - PGMPalRAM[sekAddress] =BURN_ENDIAN_SWAP_INT16(wordValue); - RamCurPal[sekAddress] = CalcCol(wordValue); -} - -void __fastcall PgmPaletteWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - sekAddress -= 0xa00000; - UINT8 *pal = (UINT8*)PGMPalRAM; - pal[sekAddress ^ 1] = byteValue; - - RamCurPal[sekAddress >> 1] = CalcCol(PGMPalRAM[sekAddress >> 1]); -} - -UINT8 __fastcall PgmZ80PortRead(UINT16 port) -{ - switch (port >> 8) - { - case 0x80: - return ics2115read(port); - - case 0x81: - return ics2115_soundlatch_r(2) & 0xff; - - case 0x82: - return ics2115_soundlatch_r(0) & 0xff; - - case 0x84: - return ics2115_soundlatch_r(1) & 0xff; - -// default: -// bprintf(PRINT_NORMAL, _T("Z80 Attempt to read port %04x\n"), port); - } - return 0; -} - -void __fastcall PgmZ80PortWrite(UINT16 port, UINT8 data) -{ - switch (port >> 8) - { - case 0x80: - ics2115write(port, data); - break; - - case 0x81: - ics2115_soundlatch_w(2, data); - break; - - case 0x82: - ics2115_soundlatch_w(0, data); - break; - - case 0x84: - ics2115_soundlatch_w(1, data); - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Z80 Attempt to write %02x to port %04x\n"), data, port); - } -} - -INT32 PgmDoReset() -{ - if (nPgmCurrentBios != PgmInput[8]) { // Load the 68k bios - if (!(BurnDrvGetHardwareCode() & HARDWARE_IGS_JAMMAPCB)) { - nPgmCurrentBios = PgmInput[8]; - BurnLoadRom(PGM68KBIOS, 0x00082 + nPgmCurrentBios, 1); // 68k bios - } - } - - SekOpen(0); - SekReset(); - SekClose(); - nExtraCycles = 0; - - if (nEnableArm7) { - Arm7Open(0); - Arm7Reset(); - Arm7Close(); - } - - ZetOpen(0); - nPgmZ80Work = 0; - ZetReset(); - ZetClose(); - - ics2115_reset(); - - if (pPgmResetCallback) { - pPgmResetCallback(); - } - - return 0; -} - -static void expand_tile_gfx() -{ - UINT8 *src = PGMTileROM; - UINT8 *dst = PGMTileROMExp; - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "kovqhsgs") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovqhsgsa") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovlsqh2") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovlsjb") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovlsjba") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovassg") == 0) { - pgm_decode_kovqhsgs_tile_data(PGMTileROM + 0x180000); - } - - if (strncmp(BurnDrvGetTextA(DRV_NAME), "happy6", 6) == 0) { - pgm_descramble_happy6_data(PGMTileROM + 0x180000, 0x800000); - } - - for (INT32 i = nPGMTileROMLen/5-1; i >= 0 ; i --) { - dst[0+8*i] = ((src[0+5*i] >> 0) & 0x1f); - dst[1+8*i] = ((src[0+5*i] >> 5) & 0x07) | ((src[1+5*i] << 3) & 0x18); - dst[2+8*i] = ((src[1+5*i] >> 2) & 0x1f ); - dst[3+8*i] = ((src[1+5*i] >> 7) & 0x01) | ((src[2+5*i] << 1) & 0x1e); - dst[4+8*i] = ((src[2+5*i] >> 4) & 0x0f) | ((src[3+5*i] << 4) & 0x10); - dst[5+8*i] = ((src[3+5*i] >> 1) & 0x1f ); - dst[6+8*i] = ((src[3+5*i] >> 6) & 0x03) | ((src[4+5*i] << 2) & 0x1c); - dst[7+8*i] = ((src[4+5*i] >> 3) & 0x1f ); - } - - for (INT32 i = 0x200000-1; i >= 0; i--) { - INT32 d = PGMTileROM[i]; - PGMTileROM[i * 2 + 0] = d & 0x0f; - PGMTileROM[i * 2 + 1] = d >> 4; - } - - PGMTileROM = (UINT8*)realloc(PGMTileROM, 0x400000); -} - -static void expand_colourdata() -{ - // allocate - { - INT32 needed = (nPGMSPRColROMLen / 2) * 3; - nPGMSPRColMaskLen = 1; - while (nPGMSPRColMaskLen < needed) - nPGMSPRColMaskLen <<= 1; - - needed = nPGMSPRMaskROMLen; - nPGMSPRMaskMaskLen = 1; - while (nPGMSPRMaskMaskLen < needed) - nPGMSPRMaskMaskLen <<= 1; - nPGMSPRMaskMaskLen-=1; - - PGMSPRColROM = (UINT8*)BurnMalloc(nPGMSPRColMaskLen); - nPGMSPRColMaskLen -= 1; - } - - UINT8 *tmp = (UINT8*)BurnMalloc(nPGMSPRColROMLen); - if (tmp == NULL) return; - - // load sprite color roms - { - char* pRomName; - struct BurnRomInfo ri; - - UINT8 *PGMSPRColROMLoad = tmp; - INT32 prev_len = 0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 3) - { - // Fix for kovsh a0603 rom overlap - if (ri.nLen == 0x400000 && prev_len == 0x400000 && nPGMSPRColROMLen == 0x2000000) { - PGMSPRColROMLoad -= 0x200000; - } - - BurnLoadRom(PGMSPRColROMLoad, i, 1); - PGMSPRColROMLoad += ri.nLen; - prev_len = ri.nLen; - - continue; - } - } - } - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "kovqhsgs") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovqhsgsa") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovlsqh2") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovlsjb") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovlsjba") == 0 || - strcmp(BurnDrvGetTextA(DRV_NAME), "kovassg") == 0) { - pgm_decode_kovqhsgs_gfx_block(tmp + 0x0000000); - pgm_decode_kovqhsgs_gfx_block(tmp + 0x0800000); - pgm_decode_kovqhsgs_gfx_block(tmp + 0x1000000); - pgm_decode_kovqhsgs_gfx_block(tmp + 0x1800000); - pgm_decode_kovqhsgs_gfx_block(tmp + 0x2000000); - pgm_decode_kovqhsgs_gfx_block(tmp + 0x2800000); - } - - if (strncmp(BurnDrvGetTextA(DRV_NAME), "happy6", 6) == 0) { - pgm_descramble_happy6_data(tmp, 0x800000 * 2); - } - - // convert from 3bpp packed - for (INT32 cnt = 0; cnt < nPGMSPRColROMLen / 2; cnt++) - { - UINT16 colpack = ((tmp[cnt*2]) | (tmp[cnt*2+1] << 8)); - PGMSPRColROM[cnt*3+0] = (colpack >> 0 ) & 0x1f; - PGMSPRColROM[cnt*3+1] = (colpack >> 5 ) & 0x1f; - PGMSPRColROM[cnt*3+2] = (colpack >> 10) & 0x1f; - } - - BurnFree (tmp); -} - -static void ics2115_sound_irq(INT32 nState) -{ - ZetSetIRQLine(0, (nState) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -INT32 pgmInit() -{ - BurnSetRefreshRate((BurnDrvGetHardwareCode() & HARDWARE_IGS_JAMMAPCB) ? 59.17 : 60.00); // different? - - Mem = NULL; - - pgmGetRoms(false); - - expand_colourdata(); - - PGMTileROM = (UINT8*)BurnMalloc(nPGMTileROMLen); // 8x8 Text Tiles + 32x32 BG Tiles - PGMTileROMExp = (UINT8*)BurnMalloc((nPGMTileROMLen / 5) * 8); // Expanded 8x8 Text Tiles and 32x32 BG Tiles - PGMSPRMaskROM = (UINT8*)BurnMalloc(nPGMSPRMaskROMLen); - ICSSNDROM = (UINT8*)BurnMalloc(nPGMSNDROMLen); - - pgmMemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - pgmMemIndex(); - - // load bios roms (68k bios loaded in reset routine) - if (BurnLoadRom(PGMTileROM, 0x80, 1)) return 1; // Bios Text and Tiles - BurnLoadRom(ICSSNDROM, 0x81, 1); // Bios Intro Sounds - - pgmGetRoms(true); - - expand_tile_gfx(); // expand graphics - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // ketsui and espgaluda - if (BurnDrvGetHardwareCode() & HARDWARE_IGS_JAMMAPCB) - { - SekMapMemory(PGM68KROM, 0x000000, (nPGM68KROMLen-1), MAP_ROM); // 68000 ROM (no bios) - } - else - { - SekMapMemory(PGM68KBIOS, 0x000000, 0x07ffff, MAP_ROM); // 68000 BIOS - SekMapMemory(PGM68KROM, 0x100000, (nPGM68KROMLen-1)+0x100000, MAP_ROM); // 68000 ROM - } - - for (INT32 i = 0; i < 0x100000; i+=0x20000) { // Main Ram + Mirrors... - SekMapMemory(PGM68KRAM, 0x800000 | i, 0x81ffff | i, MAP_RAM); - } - - // Ripped from FBA Shuffle. - for (INT32 i = 0; i < 0x100000; i+=0x08000) { // Video Ram + Mirrors... - SekMapMemory((UINT8 *)PGMBgRAM, 0x900000 | i, 0x900fff | i, MAP_RAM); - SekMapMemory((UINT8 *)PGMBgRAM, 0x901000 | i, 0x901fff | i, MAP_RAM); // mirror - SekMapMemory((UINT8 *)PGMBgRAM, 0x902000 | i, 0x902fff | i, MAP_RAM); // mirror - SekMapMemory((UINT8 *)PGMBgRAM, 0x903000 | i, 0x904fff | i, MAP_RAM); // mirror - - SekMapMemory((UINT8 *)PGMTxtRAM, 0x904000 | i, 0x905fff | i, MAP_RAM); - SekMapMemory((UINT8 *)PGMTxtRAM, 0x906000 | i, 0x906fff | i, MAP_RAM); // mirror - - SekMapMemory((UINT8 *)PGMRowRAM, 0x907000 | i, 0x907fff | i, MAP_RAM); - } - - SekMapMemory((UINT8 *)PGMPalRAM, 0xa00000, 0xa013ff, MAP_ROM); // palette - SekMapMemory((UINT8 *)PGMVidReg, 0xb00000, 0xb0ffff, MAP_RAM); // should be mirrored? - - SekMapHandler(1, 0xa00000, 0xa013ff, MAP_WRITE); - SekMapHandler(2, 0xc10000, 0xc1ffff, MAP_READ | MAP_WRITE); - - SekSetReadWordHandler(0, PgmReadWord); - SekSetReadByteHandler(0, PgmReadByte); - SekSetWriteWordHandler(0, PgmWriteWord); - SekSetWriteByteHandler(0, PgmWriteByte); - - SekSetWriteByteHandler(1, PgmPaletteWriteByte); - SekSetWriteWordHandler(1, PgmPaletteWriteWord); - - SekSetReadWordHandler(2, PgmZ80ReadWord); - SekSetWriteWordHandler(2, PgmZ80WriteWord); - - SekClose(); - } - - { - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xffff, 0, RamZ80); - ZetMapArea(0x0000, 0xffff, 1, RamZ80); - ZetMapArea(0x0000, 0xffff, 2, RamZ80); - ZetSetOutHandler(PgmZ80PortWrite); - ZetSetInHandler(PgmZ80PortRead); - ZetClose(); - } - - if (BurnDrvGetHardwareCode() & HARDWARE_IGS_USE_ARM_CPU) { - nEnableArm7 = 1; - } - - pgmInitDraw(); - - v3021Init(); - ics2115_init(8468000, ics2115_sound_irq, ICSSNDROM, nPGMSNDROMLen); - - pBurnDrvPalette = (UINT32*)PGMPalRAM; - - if (pPgmInitCallback) { - pPgmInitCallback(); - } - - if (pPgmProtCallback) { - pPgmProtCallback(); - } - - PgmDoReset(); - - return 0; -} - -INT32 pgmExit() -{ - pgmExitDraw(); - - SekExit(); - ZetExit(); - - if (nEnableArm7) { - Arm7Exit(); - } - - if (ICSSNDROM) { - BurnFree(ICSSNDROM); - } - - BurnFree(Mem); - - v3021Exit(); - ics2115_exit(); - - BurnFree (PGMTileROM); - BurnFree (PGMTileROMExp); - BurnFree (PGMSPRColROM); - BurnFree (PGMSPRMaskROM); - - nPGM68KROMLen = 0; - nPGMTileROMLen = 0; - nPGMSPRColROMLen = 0; - nPGMSPRMaskROMLen = 0; - nPGMSNDROMLen = 0; - nPGMExternalARMLen = 0; - - pPgmInitCallback = NULL; - pPgmProtCallback = NULL; - pPgmScanCallback = NULL; - pPgmResetCallback = NULL; - - nEnableArm7 = 0; - nPGMDisableIRQ4 = 0; - nPGMArm7Type = 0; - nPgmAsicRegionHackAddress = 0; - - nPgmCurrentBios = -1; - - return 0; -} - -INT32 pgmFrame() -{ - if (PgmReset) { - PgmDoReset(); - } - - // compile inputs - { - memset (PgmInput, 0, 6); - for (INT32 i = 0; i < 8; i++) { - PgmInput[0] |= (PgmJoy1[i] & 1) << i; - PgmInput[1] |= (PgmJoy2[i] & 1) << i; - PgmInput[2] |= (PgmJoy3[i] & 1) << i; - PgmInput[3] |= (PgmJoy4[i] & 1) << i; - PgmInput[4] |= (PgmBtn1[i] & 1) << i; - PgmInput[5] |= (PgmBtn2[i] & 1) << i; - } - - // clear opposites - if ((PgmInput[0] & 0x06) == 0x06) PgmInput[0] &= 0xf9; // up/down - if ((PgmInput[0] & 0x18) == 0x18) PgmInput[0] &= 0xe7; // left/right - if ((PgmInput[1] & 0x06) == 0x06) PgmInput[1] &= 0xf9; - if ((PgmInput[1] & 0x18) == 0x18) PgmInput[1] &= 0xe7; - if ((PgmInput[2] & 0x06) == 0x06) PgmInput[2] &= 0xf9; - if ((PgmInput[2] & 0x18) == 0x18) PgmInput[2] &= 0xe7; - if ((PgmInput[3] & 0x06) == 0x06) PgmInput[3] &= 0xf9; - if ((PgmInput[3] & 0x18) == 0x18) PgmInput[3] &= 0xe7; - } - - INT32 nCyclesNext[3] = {0, 0, 0}; - nCyclesDone[0] = 0; - nCyclesDone[1] = 0; - nCyclesDone[2] = 0; - - SekNewFrame(); - ZetNewFrame(); - - if (nEnableArm7) - { - Arm7NewFrame(); - - // region hacks - { - if (strncmp(BurnDrvGetTextA(DRV_NAME), "dmnfrnt", 7) == 0) { - PGMARMShareRAM[0x158] = PgmInput[7]; - } else { - if (nPgmAsicRegionHackAddress) { - PGMARMROM[nPgmAsicRegionHackAddress] = PgmInput[7]; - } - } - } - } - - SekOpen(0); - ZetOpen(0); - if (nEnableArm7) Arm7Open(0); - - for (INT32 i = 0; i < PGM_INTER_LEAVE; i++) - { - nCyclesNext[0] += M68K_CYCS_PER_INTER; - nCyclesNext[1] += Z80_CYCS_PER_INTER; - nCyclesNext[2] += ARM7_CYCS_PER_INTER; - - INT32 cycles = M68K_CYCS_PER_INTER; - - INT32 nSegmentS = (M68K_CYCS_PER_FRAME - nCyclesDone[0]) / (PGM_INTER_LEAVE - i); - nCyclesDone[0] += SekRun(nSegmentS + nExtraCycles); - nExtraCycles = 0; - - if (nEnableArm7) { - cycles = SekTotalCycles() - Arm7TotalCycles(); - - if (cycles > 0) { - nCyclesDone[2] += Arm7Run(cycles); - } - } - - // run sound cpu - { - INT32 nSegment = nCyclesNext[1] - nCyclesDone[1]; - - if (nPgmZ80Work) { - nCyclesDone[1] += ZetRun( nSegment ); - } else { - nCyclesDone[1] += nSegment; - } - - ics2115_adjust_timer(nSegment); - } - - if (i == ((PGM_INTER_LEAVE / 2)-1) && !nPGMDisableIRQ4) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - ics2115_update(pBurnSoundOut, nBurnSoundLen); - } - - if (nEnableArm7) Arm7Close(); - - nExtraCycles = SekTotalCycles() - M68K_CYCS_PER_FRAME; - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - pgmDraw(); - } - - memcpy (PGMSprBuf, PGM68KRAM /* Sprite RAM 0-bff */, 0xa00); // buffer sprites - - return 0; -} - -INT32 pgmScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - nPgmPalRecalc = 1; - - if (nAction & ACB_MEMORY_ROM) { - if (BurnDrvGetHardwareCode() & HARDWARE_IGS_JAMMAPCB) { - ba.Data = PGM68KROM; - ba.nLen = nPGM68KROMLen; - ba.nAddress = 0; - ba.szName = "68K ROM"; - BurnAcb(&ba); - } else { - ba.Data = PGM68KBIOS; - ba.nLen = 0x0020000; - ba.nAddress = 0; - ba.szName = "BIOS ROM"; - BurnAcb(&ba); - - ba.Data = PGM68KROM; - ba.nLen = nPGM68KROMLen; - ba.nAddress = 0x100000; - ba.szName = "68K ROM"; - BurnAcb(&ba); - } - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = PGMBgRAM; - ba.nLen = 0x0004000; - ba.nAddress = 0x900000; - ba.szName = "Bg RAM"; - BurnAcb(&ba); - - ba.Data = PGMTxtRAM; - ba.nLen = 0x0003000; - ba.nAddress = 0x904000; - ba.szName = "Tx RAM"; - BurnAcb(&ba); - - ba.Data = PGMRowRAM; - ba.nLen = 0x0001000; - ba.nAddress = 0x907000; - ba.szName = "Row Scroll"; - BurnAcb(&ba); - - ba.Data = PGMPalRAM; - ba.nLen = 0x0001400; - ba.nAddress = 0xA00000; - ba.szName = "Palette"; - BurnAcb(&ba); - - ba.Data = PGMVidReg; - ba.nLen = 0x0010000; - ba.nAddress = 0xB00000; - ba.szName = "Video Regs"; - BurnAcb(&ba); - - ba.Data = RamZ80; - ba.nLen = 0x0010000; - ba.nAddress = 0xC10000; - ba.szName = "Z80 RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_NVRAM) { - ba.Data = PGM68KRAM; - ba.nLen = 0x020000; - ba.nAddress = 0x800000; - ba.szName = "68K RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); - ZetScan(nAction); - - v3021Scan(); - - SCAN_VAR(PgmInput); - - SCAN_VAR(nPgmZ80Work); - - SCAN_VAR(nPgmCurrentBios); - - SCAN_VAR(nSoundlatch); - SCAN_VAR(bSoundlatchRead); - - ics2115_scan(nAction, pnMin); - } - - if (pPgmScanCallback) { - pPgmScanCallback(nAction, pnMin); - } - - return 0; -} diff --git a/jan/src/burn/drv/pgm/pgm_sprite_create.cpp b/jan/src/burn/drv/pgm/pgm_sprite_create.cpp deleted file mode 100644 index 1ed65462b..000000000 --- a/jan/src/burn/drv/pgm/pgm_sprite_create.cpp +++ /dev/null @@ -1,128 +0,0 @@ -#include - -int main() -{ - printf ("typedef INT32 (*sprite_draw_function)(UINT16 *dest, UINT8 *adata, INT32 pal);\n"); - printf ("typedef INT32 (*sprite_draw_nozoom_function)(UINT16 *dest, UINT8 *pdest, UINT8 *adata, INT32 pal, INT32 pri);\n\n"); - - int i,j; - for (i = 0; i < 0x100; i++) - { - if (i == 0xff) - printf ("static INT32 zoom_draw_%2.2x(UINT16 *dest, UINT8 *, INT32 )\n", i); - else - printf ("static INT32 zoom_draw_%2.2x(UINT16 *dest, UINT8 *adata, INT32 pal)\n", i); - - printf ("{\n"); - - int cntr = 0; - - for (j = 0; j < 8; j++) - { - if (i & (1 << j)) - { - printf ("\tdest[%d] = 0x8000;\n", j); - } - else - { - printf ("\tdest[%d] = adata[%d] + pal;\n", j, cntr); - cntr++; - } - } - - printf ("\n\treturn 0x%2.2x;\n}\n\n", cntr); - } - - for (i = 0; i < 0x100; i++) - { - if (i == 0xff) - printf ("static INT32 nozoom_draw_%2.2x(UINT16 *, UINT8 *, UINT8 *, INT32 , INT32)\n", i); - else - printf ("static INT32 nozoom_draw_%2.2x(UINT16 *dest, UINT8 *pdest, UINT8 *adata, INT32 pal, INT32 prio)\n", i); - - printf ("{\n"); - - int cntr = 0; - - for (j = 0; j < 8; j++) - { - if (~i & (1 << j)) - { - printf ("\tdest[%d] = adata[%d] + pal;\n", j, cntr); - printf ("\tpdest[%d] = prio;\n", j); - cntr++; - } - } - - printf ("\n\treturn 0x%2.2x;}\n\n\n", cntr); - } - - for (i = 0; i < 0x100; i++) - { - if (i == 0xff) - printf ("static INT32 nozoom_draw_flipx_%2.2x(UINT16 *, UINT8 *, UINT8 *, INT32 , INT32)\n", i); - else - printf ("static INT32 nozoom_draw_flipx_%2.2x(UINT16 *dest, UINT8 *pdest, UINT8 *adata, INT32 pal, INT32 prio)\n", i); - - printf ("{\n"); - - int cntr = 0; - - for (j = 0; j < 8; j++) - { - if (~i & (1 << j)) - { - printf ("\tdest[%d] = adata[%d] + pal;\n", 7-j, cntr); - printf ("\tpdest[%d] = prio;\n", 7-j); - cntr++; - } - } - - printf ("\n\treturn 0x%2.2x;\n}\n\n", cntr); - } - - printf ("static sprite_draw_function zoom_draw_table[0x100] = {\n"); - for (i = 0; i < 0x100; i++) - { - if ((i & 0x0f) == 0) printf ("\t"); - printf ("&zoom_draw_%2.2x", i); - if (i != 0xff) printf (","); - if ((i & 0x0f)==0x0f) { - printf ("\n"); - } else { - printf (" "); - } - } - printf ("};\n\n"); - - printf ("static sprite_draw_nozoom_function nozoom_draw_table[2][0x100] =\n{\n"); - printf ("\t{\t\n"); - for (i = 0; i < 0x100; i++) - { - if ((i & 0x0f) == 0) printf ("\t\t"); - printf ("&nozoom_draw_%2.2x", i); - if (i != 0xff) printf (","); - if ((i & 0x0f)==0x0f) { - printf ("\n"); - } else { - printf (" "); - } - } - printf ("\t},\n"); - - printf ("\t{\t\n"); - for (i = 0; i < 0x100; i++) - { - if ((i & 0x0f) == 0) printf ("\t\t"); - printf ("&nozoom_draw_flipx_%2.2x", i); - if (i != 0xff) printf (","); - if ((i & 0x0f)==0x0f) { - printf ("\n"); - } else { - printf (" "); - } - } - printf ("\t}\n};\n\n"); - - return 0; -} diff --git a/jan/src/burn/drv/pre90s/d_1942.cpp b/jan/src/burn/drv/pre90s/d_1942.cpp deleted file mode 100644 index 5f5e7f332..000000000 --- a/jan/src/burn/drv/pre90s/d_1942.cpp +++ /dev/null @@ -1,1161 +0,0 @@ -// FB Alpha 1942 driver module -// Based on MAME driver by Paul Leaman, Couriersud -#include "tiles_generic.h" -#include "z80_intf.h" - -#include "driver.h" -extern "C" { - #include "ay8910.h" -} - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80Rom1 = NULL; -static UINT8 *DrvZ80Rom2 = NULL; -static UINT8 *DrvZ80Ram1 = NULL; -static UINT8 *DrvZ80Ram2 = NULL; -static UINT8 *DrvFgVideoRam = NULL; -static UINT8 *DrvBgVideoRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPromRed = NULL; -static UINT8 *DrvPromGreen = NULL; -static UINT8 *DrvPromBlue = NULL; -static UINT8 *DrvPromCharLookup = NULL; -static UINT8 *DrvPromTileLookup = NULL; -static UINT8 *DrvPromSpriteLookup = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; -static INT16* pFMBuffer; -static INT16* pAY8910Buffer[6]; - -static UINT8 DrvRomBank; -static UINT8 DrvPaletteBank; -static UINT8 DrvBgScroll[2]; -static UINT8 DrvFlipScreen; -static UINT8 DrvSoundLatch; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 4, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - - -STDINPUTINFO(Drv) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xf7, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Play" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Play" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Play" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 3 Plays" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 4 Plays" }, - {0x12, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x08, 0x00, "Upright" }, - {0x12, 0x01, 0x08, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x12, 0x01, 0x30, 0x30, "20k 80k 80k+" }, - {0x12, 0x01, 0x30, 0x20, "20k 100k 100k+" }, - {0x12, 0x01, 0x30, 0x10, "30k 80k 80k+" }, - {0x12, 0x01, 0x30, 0x00, "30k 100k 100k+" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0xc0, 0x80, "1" }, - {0x12, 0x01, 0xc0, 0x40, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x00, "5" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x04, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 3 Plays" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x60, 0x40, "Easy" }, - {0x13, 0x01, 0x60, 0x60, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2 , "Screen Stop" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static struct BurnRomInfo DrvRomDesc[] = { - { "srb-03.m3", 0x04000, 0xd9dafcc3, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "srb-04.m4", 0x04000, 0xda0cf924, BRF_ESS | BRF_PRG }, // 1 - { "srb-05.m5", 0x04000, 0xd102911c, BRF_ESS | BRF_PRG }, // 2 - { "srb-06.m6", 0x02000, 0x466f8248, BRF_ESS | BRF_PRG }, // 3 - { "srb-07.m7", 0x04000, 0x0d31038c, BRF_ESS | BRF_PRG }, // 4 - - { "sr-01.c11", 0x04000, 0xbd87f06b, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program - - { "sr-02.f2", 0x02000, 0x6ebca191, BRF_GRA }, // 6 Characters - - { "sr-08.a1", 0x02000, 0x3884d9eb, BRF_GRA }, // 7 Tiles - { "sr-09.a2", 0x02000, 0x999cf6e0, BRF_GRA }, // 8 - { "sr-10.a3", 0x02000, 0x8edb273a, BRF_GRA }, // 9 - { "sr-11.a4", 0x02000, 0x3a2726c3, BRF_GRA }, // 10 - { "sr-12.a5", 0x02000, 0x1bd3d8bb, BRF_GRA }, // 11 - { "sr-13.a6", 0x02000, 0x658f02c4, BRF_GRA }, // 12 - - { "sr-14.l1", 0x04000, 0x2528bec6, BRF_GRA }, // 13 Sprites - { "sr-15.l2", 0x04000, 0xf89287aa, BRF_GRA }, // 14 - { "sr-16.n1", 0x04000, 0x024418f8, BRF_GRA }, // 15 - { "sr-17.n2", 0x04000, 0xe2c7e489, BRF_GRA }, // 16 - - { "sb-5.e8", 0x00100, 0x93ab8153, BRF_GRA }, // 17 PROMs - { "sb-6.e9", 0x00100, 0x8ab44f7d, BRF_GRA }, // 18 - { "sb-7.e10", 0x00100, 0xf4ade9a4, BRF_GRA }, // 19 - { "sb-0.f1", 0x00100, 0x6047d91b, BRF_GRA }, // 20 - { "sb-4.d6", 0x00100, 0x4858968d, BRF_GRA }, // 21 - { "sb-8.k3", 0x00100, 0xf6fad943, BRF_GRA }, // 22 - { "sb-2.d1", 0x00100, 0x8bb8b3df, BRF_GRA }, // 23 - { "sb-3.d2", 0x00100, 0x3b0c99af, BRF_GRA }, // 24 - { "sb-1.k6", 0x00100, 0x712ac508, BRF_GRA }, // 25 - { "sb-9.m11", 0x00100, 0x4921635c, BRF_GRA }, // 26 -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvaRomDesc[] = { - { "sra-03.m3", 0x04000, 0x40201bab, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "sr-04.m4", 0x04000, 0xa60ac644, BRF_ESS | BRF_PRG }, // 1 - { "sr-05.m5", 0x04000, 0x835f7b24, BRF_ESS | BRF_PRG }, // 2 - { "sr-06.m6", 0x02000, 0x821c6481, BRF_ESS | BRF_PRG }, // 3 - { "sr-07.m7", 0x04000, 0x5df525e1, BRF_ESS | BRF_PRG }, // 4 - - { "sr-01.c11", 0x04000, 0xbd87f06b, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program - - { "sr-02.f2", 0x02000, 0x6ebca191, BRF_GRA }, // 6 Characters - - { "sr-08.a1", 0x02000, 0x3884d9eb, BRF_GRA }, // 7 Tiles - { "sr-09.a2", 0x02000, 0x999cf6e0, BRF_GRA }, // 8 - { "sr-10.a3", 0x02000, 0x8edb273a, BRF_GRA }, // 9 - { "sr-11.a4", 0x02000, 0x3a2726c3, BRF_GRA }, // 10 - { "sr-12.a5", 0x02000, 0x1bd3d8bb, BRF_GRA }, // 11 - { "sr-13.a6", 0x02000, 0x658f02c4, BRF_GRA }, // 12 - - { "sr-14.l1", 0x04000, 0x2528bec6, BRF_GRA }, // 13 Sprites - { "sr-15.l2", 0x04000, 0xf89287aa, BRF_GRA }, // 14 - { "sr-16.n1", 0x04000, 0x024418f8, BRF_GRA }, // 15 - { "sr-17.n2", 0x04000, 0xe2c7e489, BRF_GRA }, // 16 - - { "sb-5.e8", 0x00100, 0x93ab8153, BRF_GRA }, // 17 PROMs - { "sb-6.e9", 0x00100, 0x8ab44f7d, BRF_GRA }, // 18 - { "sb-7.e10", 0x00100, 0xf4ade9a4, BRF_GRA }, // 19 - { "sb-0.f1", 0x00100, 0x6047d91b, BRF_GRA }, // 20 - { "sb-4.d6", 0x00100, 0x4858968d, BRF_GRA }, // 21 - { "sb-8.k3", 0x00100, 0xf6fad943, BRF_GRA }, // 22 - { "sb-2.d1", 0x00100, 0x8bb8b3df, BRF_GRA }, // 23 - { "sb-3.d2", 0x00100, 0x3b0c99af, BRF_GRA }, // 24 - { "sb-1.k6", 0x00100, 0x712ac508, BRF_GRA }, // 25 - { "sb-9.m11", 0x00100, 0x4921635c, BRF_GRA }, // 26 -}; - -STD_ROM_PICK(Drva) -STD_ROM_FN(Drva) - -static struct BurnRomInfo DrvablRomDesc[] = { - { "3.bin", 0x08000, 0xf3184f5a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "5.bin", 0x04000, 0x835f7b24, BRF_ESS | BRF_PRG }, // 1 - { "7.bin", 0x08000, 0x2f456c6e, BRF_ESS | BRF_PRG }, // 2 - - { "1.bin", 0x04000, 0xbd87f06b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "2.bin", 0x02000, 0x6ebca191, BRF_GRA }, // 4 Characters - - { "9.bin", 0x04000, 0x60329fa4, BRF_GRA }, // 5 Tiles - { "11.bin", 0x04000, 0x66bac116, BRF_GRA }, // 6 - { "13.bin", 0x04000, 0x623fcec1, BRF_GRA }, // 7 - - { "14.bin", 0x08000, 0xdf2345ef, BRF_GRA }, // 8 Sprites - { "16.bin", 0x08000, 0xc106b1ed, BRF_GRA }, // 9 - - { "sb-5.e8", 0x00100, 0x93ab8153, BRF_GRA }, // 10 PROMs - { "sb-6.e9", 0x00100, 0x8ab44f7d, BRF_GRA }, // 11 - { "sb-7.e10", 0x00100, 0xf4ade9a4, BRF_GRA }, // 12 - { "sb-0.f1", 0x00100, 0x6047d91b, BRF_GRA }, // 13 - { "sb-4.d6", 0x00100, 0x4858968d, BRF_GRA }, // 14 - { "sb-8.k3", 0x00100, 0xf6fad943, BRF_GRA }, // 15 - { "sb-2.d1", 0x00100, 0x8bb8b3df, BRF_GRA }, // 16 - { "sb-3.d2", 0x00100, 0x3b0c99af, BRF_GRA }, // 17 - { "sb-1.k6", 0x00100, 0x712ac508, BRF_GRA }, // 18 - { "sb-9.m11", 0x00100, 0x4921635c, BRF_GRA }, // 19 -}; - -STD_ROM_PICK(Drvabl) -STD_ROM_FN(Drvabl) - -static struct BurnRomInfo DrvbRomDesc[] = { - { "sr-03.m3", 0x04000, 0x612975f2, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "sr-04.m4", 0x04000, 0xa60ac644, BRF_ESS | BRF_PRG }, // 1 - { "sr-05.m5", 0x04000, 0x835f7b24, BRF_ESS | BRF_PRG }, // 2 - { "sr-06.m6", 0x02000, 0x821c6481, BRF_ESS | BRF_PRG }, // 3 - { "sr-07.m7", 0x04000, 0x5df525e1, BRF_ESS | BRF_PRG }, // 4 - - { "sr-01.c11", 0x04000, 0xbd87f06b, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program - - { "sr-02.f2", 0x02000, 0x6ebca191, BRF_GRA }, // 6 Characters - - { "sr-08.a1", 0x02000, 0x3884d9eb, BRF_GRA }, // 7 Tiles - { "sr-09.a2", 0x02000, 0x999cf6e0, BRF_GRA }, // 8 - { "sr-10.a3", 0x02000, 0x8edb273a, BRF_GRA }, // 9 - { "sr-11.a4", 0x02000, 0x3a2726c3, BRF_GRA }, // 10 - { "sr-12.a5", 0x02000, 0x1bd3d8bb, BRF_GRA }, // 11 - { "sr-13.a6", 0x02000, 0x658f02c4, BRF_GRA }, // 12 - - { "sr-14.l1", 0x04000, 0x2528bec6, BRF_GRA }, // 13 Sprites - { "sr-15.l2", 0x04000, 0xf89287aa, BRF_GRA }, // 14 - { "sr-16.n1", 0x04000, 0x024418f8, BRF_GRA }, // 15 - { "sr-17.n2", 0x04000, 0xe2c7e489, BRF_GRA }, // 16 - - { "sb-5.e8", 0x00100, 0x93ab8153, BRF_GRA }, // 17 PROMs - { "sb-6.e9", 0x00100, 0x8ab44f7d, BRF_GRA }, // 18 - { "sb-7.e10", 0x00100, 0xf4ade9a4, BRF_GRA }, // 19 - { "sb-0.f1", 0x00100, 0x6047d91b, BRF_GRA }, // 20 - { "sb-4.d6", 0x00100, 0x4858968d, BRF_GRA }, // 21 - { "sb-8.k3", 0x00100, 0xf6fad943, BRF_GRA }, // 22 - { "sb-2.d1", 0x00100, 0x8bb8b3df, BRF_GRA }, // 23 - { "sb-3.d2", 0x00100, 0x3b0c99af, BRF_GRA }, // 24 - { "sb-1.k6", 0x00100, 0x712ac508, BRF_GRA }, // 25 - { "sb-9.m11", 0x00100, 0x4921635c, BRF_GRA }, // 26 -}; - -STD_ROM_PICK(Drvb) -STD_ROM_FN(Drvb) - -static struct BurnRomInfo DrvwRomDesc[] = { - { "sw-03.m3", 0x04000, 0xafd79770, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "sw-04.m4", 0x04000, 0x933d9910, BRF_ESS | BRF_PRG }, // 1 - { "sw-05.m5", 0x04000, 0xe9a71bb6, BRF_ESS | BRF_PRG }, // 2 - { "sw-06.m6", 0x02000, 0x466f8248, BRF_ESS | BRF_PRG }, // 3 - { "sw-07.m7", 0x04000, 0xec41655e, BRF_ESS | BRF_PRG }, // 4 - - { "sr-01.c11", 0x04000, 0xbd87f06b, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program - - { "sw-02.f2", 0x02000, 0xf8e9ada2, BRF_GRA }, // 6 Characters - - { "sr-08.a1", 0x02000, 0x3884d9eb, BRF_GRA }, // 7 Tiles - { "sr-09.a2", 0x02000, 0x999cf6e0, BRF_GRA }, // 8 - { "sr-10.a3", 0x02000, 0x8edb273a, BRF_GRA }, // 9 - { "sr-11.a4", 0x02000, 0x3a2726c3, BRF_GRA }, // 10 - { "sr-12.a5", 0x02000, 0x1bd3d8bb, BRF_GRA }, // 11 - { "sr-13.a6", 0x02000, 0x658f02c4, BRF_GRA }, // 12 - - { "sr-14.l1", 0x04000, 0x2528bec6, BRF_GRA }, // 13 Sprites - { "sr-15.l2", 0x04000, 0xf89287aa, BRF_GRA }, // 14 - { "sr-16.n1", 0x04000, 0x024418f8, BRF_GRA }, // 15 - { "sr-17.n2", 0x04000, 0xe2c7e489, BRF_GRA }, // 16 - - { "sb-5.e8", 0x00100, 0x93ab8153, BRF_GRA }, // 17 PROMs - { "sb-6.e9", 0x00100, 0x8ab44f7d, BRF_GRA }, // 18 - { "sb-7.e10", 0x00100, 0xf4ade9a4, BRF_GRA }, // 19 - { "sb-0.f1", 0x00100, 0x6047d91b, BRF_GRA }, // 20 - { "sb-4.d6", 0x00100, 0x4858968d, BRF_GRA }, // 21 - { "sb-8.k3", 0x00100, 0xf6fad943, BRF_GRA }, // 22 - { "sb-2.d1", 0x00100, 0x8bb8b3df, BRF_GRA }, // 23 - { "sb-3.d2", 0x00100, 0x3b0c99af, BRF_GRA }, // 24 - { "sb-1.k6", 0x00100, 0x712ac508, BRF_GRA }, // 25 - { "sb-9.m11", 0x00100, 0x4921635c, BRF_GRA }, // 26 -}; - -STD_ROM_PICK(Drvw) -STD_ROM_FN(Drvw) - -static struct BurnRomInfo DrvhRomDesc[] = { - { "Supercharger_1942_#3.m3", 0x04000, 0xec70785f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "Supercharger_1942_#4.m4", 0x04000, 0xcc11355f, BRF_ESS | BRF_PRG }, // 1 - { "Supercharger_1942_#5.m5", 0x04000, 0x42746d75, BRF_ESS | BRF_PRG }, // 2 - { "srb-06.m6", 0x02000, 0x466f8248, BRF_ESS | BRF_PRG }, // 3 - { "srb-07.m7", 0x04000, 0x0d31038c, BRF_ESS | BRF_PRG }, // 4 - - { "sr-01.c11", 0x04000, 0xbd87f06b, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program - - { "sr-02.f2", 0x02000, 0x6ebca191, BRF_GRA }, // 6 Characters - - { "sr-08.a1", 0x02000, 0x3884d9eb, BRF_GRA }, // 7 Tiles - { "sr-09.a2", 0x02000, 0x999cf6e0, BRF_GRA }, // 8 - { "sr-10.a3", 0x02000, 0x8edb273a, BRF_GRA }, // 9 - { "sr-11.a4", 0x02000, 0x3a2726c3, BRF_GRA }, // 10 - { "sr-12.a5", 0x02000, 0x1bd3d8bb, BRF_GRA }, // 11 - { "sr-13.a6", 0x02000, 0x658f02c4, BRF_GRA }, // 12 - - { "sr-14.l1", 0x04000, 0x2528bec6, BRF_GRA }, // 13 Sprites - { "sr-15.l2", 0x04000, 0xf89287aa, BRF_GRA }, // 14 - { "sr-16.n1", 0x04000, 0x024418f8, BRF_GRA }, // 15 - { "sr-17.n2", 0x04000, 0xe2c7e489, BRF_GRA }, // 16 - - { "sb-5.e8", 0x00100, 0x93ab8153, BRF_GRA }, // 17 PROMs - { "sb-6.e9", 0x00100, 0x8ab44f7d, BRF_GRA }, // 18 - { "sb-7.e10", 0x00100, 0xf4ade9a4, BRF_GRA }, // 19 - { "sb-0.f1", 0x00100, 0x6047d91b, BRF_GRA }, // 20 - { "sb-4.d6", 0x00100, 0x4858968d, BRF_GRA }, // 21 - { "sb-8.k3", 0x00100, 0xf6fad943, BRF_GRA }, // 22 - { "sb-2.d1", 0x00100, 0x8bb8b3df, BRF_GRA }, // 23 - { "sb-3.d2", 0x00100, 0x3b0c99af, BRF_GRA }, // 24 - { "sb-1.k6", 0x00100, 0x712ac508, BRF_GRA }, // 25 - { "sb-9.m11", 0x00100, 0x4921635c, BRF_GRA }, // 26 -}; - -STD_ROM_PICK(Drvh) -STD_ROM_FN(Drvh) - -// 1942 (C64 Music) - -static struct BurnRomInfo Drvc64RomDesc[] = { - { "srb-03.m3", 0x4000, 0xd9dafcc3, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "srb-04.m4", 0x4000, 0xda0cf924, 1 | BRF_PRG | BRF_ESS }, // 1 - { "srb-05.m5", 0x4000, 0xd102911c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "srb-06.m6", 0x2000, 0x466f8248, 1 | BRF_PRG | BRF_ESS }, // 3 - { "srb-07.m7", 0x4000, 0x0d31038c, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "sr-01.c11", 0x4000, 0x4ee7ab6b, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "sr-02.f2", 0x2000, 0x6ebca191, 3 | BRF_GRA }, // 6 gfx1 - - { "sr-08.a1", 0x2000, 0x3884d9eb, 4 | BRF_GRA }, // 7 gfx2 - { "sr-09.a2", 0x2000, 0x999cf6e0, 4 | BRF_GRA }, // 8 - { "sr-10.a3", 0x2000, 0x8edb273a, 4 | BRF_GRA }, // 9 - { "sr-11.a4", 0x2000, 0x3a2726c3, 4 | BRF_GRA }, // 10 - { "sr-12.a5", 0x2000, 0x1bd3d8bb, 4 | BRF_GRA }, // 11 - { "sr-13.a6", 0x2000, 0x658f02c4, 4 | BRF_GRA }, // 12 - - { "sr-14.l1", 0x4000, 0x2528bec6, 5 | BRF_GRA }, // 13 gfx3 - { "sr-15.l2", 0x4000, 0xf89287aa, 5 | BRF_GRA }, // 14 - { "sr-16.n1", 0x4000, 0x024418f8, 5 | BRF_GRA }, // 15 - { "sr-17.n2", 0x4000, 0xe2c7e489, 5 | BRF_GRA }, // 16 - - { "sb-5.e8", 0x0100, 0x93ab8153, 6 | BRF_GRA }, // 17 proms - { "sb-6.e9", 0x0100, 0x8ab44f7d, 6 | BRF_GRA }, // 18 - { "sb-7.e10", 0x0100, 0xf4ade9a4, 6 | BRF_GRA }, // 19 - { "sb-0.f1", 0x0100, 0x6047d91b, 6 | BRF_GRA }, // 20 - { "sb-4.d6", 0x0100, 0x4858968d, 6 | BRF_GRA }, // 21 - { "sb-8.k3", 0x0100, 0xf6fad943, 6 | BRF_GRA }, // 22 - { "sb-2.d1", 0x0100, 0x8bb8b3df, 6 | BRF_GRA }, // 23 - { "sb-3.d2", 0x0100, 0x3b0c99af, 6 | BRF_GRA }, // 24 - { "sb-1.k6", 0x0100, 0x712ac508, 6 | BRF_GRA }, // 25 - { "sb-9.m11", 0x0100, 0x4921635c, 6 | BRF_GRA }, // 26 -}; - -STD_ROM_PICK(Drvc64) -STD_ROM_FN(Drvc64) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom1 = Next; Next += 0x1c000; - DrvZ80Rom2 = Next; Next += 0x04000; - DrvPromRed = Next; Next += 0x00100; - DrvPromGreen = Next; Next += 0x00100; - DrvPromBlue = Next; Next += 0x00100; - DrvPromCharLookup = Next; Next += 0x00100; - DrvPromTileLookup = Next; Next += 0x00100; - DrvPromSpriteLookup = Next; Next += 0x00100; - - RamStart = Next; - - DrvZ80Ram1 = Next; Next += 0x01000; - DrvZ80Ram2 = Next; Next += 0x00800; - DrvSpriteRam = Next; Next += 0x00080; - DrvFgVideoRam = Next; Next += 0x00800; - DrvBgVideoRam = Next; Next += 0x00400; - - RamEnd = Next; - - DrvChars = Next; Next += 0x200 * 8 * 8; - DrvTiles = Next; Next += 0x200 * 16 * 16; - DrvSprites = Next; Next += 0x200 * 16 * 16; - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 6 * sizeof(INT16); - DrvPalette = (UINT32*)Next; Next += 0x00600 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - for (INT32 i = 0; i < 2; i++) { - AY8910Reset(i); - } - - DrvPaletteBank = 0; - DrvBgScroll[0] = 0; - DrvBgScroll[1] = 0; - DrvFlipScreen = 0; - DrvSoundLatch = 0; - DrvRomBank = 0; - - HiscoreReset(); - - return 0; -} - -UINT8 __fastcall Drv1942Read1(UINT16 a) -{ - switch (a) { - case 0xc000: { - return 0xff - DrvInput[0]; - } - - case 0xc001: { - return 0xff - DrvInput[1]; - } - - case 0xc002: { - return 0xff - DrvInput[2]; - } - - case 0xc003: { - return DrvDip[0]; - } - - case 0xc004: { - return DrvDip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Drv1942Write1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xc800: { - DrvSoundLatch = d; - return; - } - - case 0xc802: { - DrvBgScroll[0] = d; - return; - } - - case 0xc803: { - DrvBgScroll[1] = d; - return; - } - - case 0xc804: { - DrvFlipScreen = d & 0x80; - if (d & 0x10) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - return; - } - - case 0xc805: { - DrvPaletteBank = d; - return; - } - - case 0xc806: { - d &= 0x03; - DrvRomBank = d; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + DrvRomBank * 0x4000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + DrvRomBank * 0x4000 ); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Drv1942Read2(UINT16 a) -{ - switch (a) { - case 0x6000: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Drv1942Write2(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x8000: { - AY8910Write(0, 0, d); - return; - } - - case 0x8001: { - AY8910Write(0, 1, d); - return; - } - - case 0xc000: { - AY8910Write(1, 0, d); - return; - } - - case 0xc001: { - AY8910Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - - -static INT32 CharPlaneOffsets[2] = { 4, 0 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 8, 9, 10, 11 }; -static INT32 CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 TilePlaneOffsets[3] = { 0, 0x20000, 0x40000 }; -static INT32 TileXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 TileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 SpritePlaneOffsets[4] = { 0x40004, 0x40000, 4, 0 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 8, 9, 10, 11, 256, 257, 258, 259, 264, 265, 266, 267 }; -static INT32 SpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; - -static void MachineInit() -{ - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Drv1942Read1); - ZetSetWriteHandler(Drv1942Write1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xcc00, 0xcc7f, 0, DrvSpriteRam ); - ZetMapArea(0xcc00, 0xcc7f, 1, DrvSpriteRam ); - ZetMapArea(0xcc00, 0xcc7f, 2, DrvSpriteRam ); - ZetMapArea(0xd000, 0xd7ff, 0, DrvFgVideoRam ); - ZetMapArea(0xd000, 0xd7ff, 1, DrvFgVideoRam ); - ZetMapArea(0xd000, 0xd7ff, 2, DrvFgVideoRam ); - ZetMapArea(0xd800, 0xdbff, 0, DrvBgVideoRam ); - ZetMapArea(0xd800, 0xdbff, 1, DrvBgVideoRam ); - ZetMapArea(0xd800, 0xdbff, 2, DrvBgVideoRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram1 ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(Drv1942Read2); - ZetSetWriteHandler(Drv1942Write2); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80Rom2 ); - ZetMapArea(0x4000, 0x47ff, 0, DrvZ80Ram2 ); - ZetMapArea(0x4000, 0x47ff, 1, DrvZ80Ram2 ); - ZetMapArea(0x4000, 0x47ff, 2, DrvZ80Ram2 ); - ZetClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); // Plane Noise/Bass/Shot - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); // Whistle/Snare - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); -} - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x10000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x14000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x18000, 4, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x02000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x06000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0a000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 3, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 16, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromRed, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromGreen, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBlue, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromCharLookup, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromTileLookup, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpriteLookup, 22, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - MachineInit(); - - return 0; -} - -static INT32 DrvablInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x14000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 4, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 3, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x04000, DrvTempRom + 0x10000, 0x4000); - memcpy(DrvTempRom + 0x00000, DrvTempRom + 0x14000, 0x4000); - nRet = BurnLoadRom(DrvTempRom + 0x10000, 9, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x0c000, DrvTempRom + 0x10000, 0x4000); - memcpy(DrvTempRom + 0x08000, DrvTempRom + 0x14000, 0x4000); - GfxDecode(0x200, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromRed, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromGreen, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBlue, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromCharLookup, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromTileLookup, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpriteLookup, 15, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - MachineInit(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - - for (INT32 i = 0; i < 2; i++) { - AY8910Exit(i); - } - - GenericTilesExit(); - - DrvPaletteBank = 0; - DrvBgScroll[0] = 0; - DrvBgScroll[1] = 0; - DrvFlipScreen = 0; - DrvSoundLatch = 0; - DrvRomBank = 0; - - BurnFree(Mem); - - return 0; -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT32 Palette[256]; - - for (i = 0; i < 256; i++) { - INT32 bit0, bit1, bit2, bit3, r, g, b; - - bit0 = (DrvPromRed[i] >> 0) & 0x01; - bit1 = (DrvPromRed[i] >> 1) & 0x01; - bit2 = (DrvPromRed[i] >> 2) & 0x01; - bit3 = (DrvPromRed[i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvPromGreen[i] >> 0) & 0x01; - bit1 = (DrvPromGreen[i] >> 1) & 0x01; - bit2 = (DrvPromGreen[i] >> 2) & 0x01; - bit3 = (DrvPromGreen[i] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvPromBlue[i] >> 0) & 0x01; - bit1 = (DrvPromBlue[i] >> 1) & 0x01; - bit2 = (DrvPromBlue[i] >> 2) & 0x01; - bit3 = (DrvPromBlue[i] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - Palette[i] = BurnHighCol(r, g, b, 0); - } - - for (i = 0; i < 256; i++) { - DrvPalette[i] = Palette[0x80 | DrvPromCharLookup[i]]; - } - - for (i = 0; i < 256; i++) { - DrvPalette[256 + i + 0] = Palette[0x00 | DrvPromTileLookup[i]]; - DrvPalette[256 + i + 256] = Palette[0x10 | DrvPromTileLookup[i]]; - DrvPalette[256 + i + 512] = Palette[0x20 | DrvPromTileLookup[i]]; - DrvPalette[256 + i + 768] = Palette[0x30 | DrvPromTileLookup[i]]; - } - - for (i = 0; i < 256; i++) { - DrvPalette[1280 + i] = Palette[0x40 | DrvPromSpriteLookup[i]]; - } -} - -static void DrvRenderBgLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex, xScroll, Flip, xFlip, yFlip; - - xScroll = DrvBgScroll[0] | (DrvBgScroll[1] << 8); - xScroll &= 0x1ff; - - for (mx = 0; mx < 16; mx++) { - for (my = 0; my < 32; my++) { - TileIndex = (my * 16) + mx; - TileIndex = (TileIndex & 0x0f) | ((TileIndex & 0x01f0) << 1); - - Code = DrvBgVideoRam[TileIndex]; - Colour = DrvBgVideoRam[TileIndex + 0x10]; - Code += (Colour & 0x80) << 1; - Flip = (Colour & 0x60) >> 5; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - Colour &= 0x1f; - - y = 16 * mx; - x = 16 * my; - x -= xScroll; - if (x < -16) x += 512; - y -= 16; - - if (x > 0 && x < 240 && y > 0 && y < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY(pTransDraw, Code, x, y, Colour, 3, 256 + (0x100 * DrvPaletteBank), DrvTiles); - } else { - Render16x16Tile_FlipX(pTransDraw, Code, x, y, Colour, 3, 256 + (0x100 * DrvPaletteBank), DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY(pTransDraw, Code, x, y, Colour, 3, 256 + (0x100 * DrvPaletteBank), DrvTiles); - } else { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 3, 256 + (0x100 * DrvPaletteBank), DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 3, 256 + (0x100 * DrvPaletteBank), DrvTiles); - } else { - Render16x16Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 3, 256 + (0x100 * DrvPaletteBank), DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 3, 256 + (0x100 * DrvPaletteBank), DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 3, 256 + (0x100 * DrvPaletteBank), DrvTiles); - } - } - } - } - } -} - -static void DrvRenderSpriteLayer() -{ - INT32 Offset; - - for (Offset = 0x80 - 4; Offset >= 0; Offset -= 4) { - INT32 i, Code, Colour, sx, sy, Dir; - - Code = (DrvSpriteRam[Offset] & 0x7f) + (4 * (DrvSpriteRam[Offset + 1] & 0x20)) + (2 * (DrvSpriteRam[Offset] & 0x80)); - Colour = DrvSpriteRam[Offset + 1] & 0x0f; - sx = DrvSpriteRam[Offset + 3] - (0x10 * (DrvSpriteRam[Offset + 1] & 0x10)); - sy = DrvSpriteRam[Offset + 2]; - Dir = 1; - - i = (DrvSpriteRam[Offset + 1] & 0xc0) >> 6; - if (i == 2) i = 3; - - do { - Render16x16Tile_Mask_Clip(pTransDraw, Code + i, sx, (sy + (16 * i) * Dir) - 16, Colour, 4, 15, 1280, DrvSprites); - - i--; - } while (i >= 0); - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Code = DrvFgVideoRam[TileIndex]; - Colour = DrvFgVideoRam[TileIndex + 0x400]; - Code += (Colour & 0x80) << 1; - Colour &= 0x3f; - - x = 8 * mx; - y = 8 * my; - - y -= 16; - - if (x > 0 && x < 248 && y > 0 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 2, 0, 0, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, DrvChars); - } - - TileIndex++; - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - DrvRenderBgLayer(); - DrvRenderSpriteLayer(); - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 8; - INT32 nSoundBufferPos = 0; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 4000000 / 60; - nCyclesTotal[1] = 3000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 0 || i == 7) { - ZetSetVector((i == 0) ? 0xcf : 0xd7); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i & 1) { // 4 times per frame - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029672; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); // Scan Z80 - AY8910Scan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(DrvRomBank); - SCAN_VAR(DrvPaletteBank); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvBgScroll); - SCAN_VAR(DrvFlipScreen); - SCAN_VAR(DrvDip); - SCAN_VAR(DrvInput); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + DrvRomBank * 0x4000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + DrvRomBank * 0x4000 ); - ZetClose(); - } - - return 0; -} - -struct BurnDriver BurnDrvNineteen42 = { - "1942", NULL, NULL, NULL, "1984", - "1942 (Revision B)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen42a = { - "1942a", "1942", NULL, NULL, "1984", - "1942 (Revision A)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvaRomInfo, DrvaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen42abl = { - "1942abl", "1942", NULL, NULL, "1984", - "1942 (Revision A, bootleg)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvablRomInfo, DrvablRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvablInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen42b = { - "1942b", "1942", NULL, NULL, "1984", - "1942 (First Version)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvbRomInfo, DrvbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen42w = { - "1942w", "1942", NULL, NULL, "1985", - "1942 (Williams Electronics license)\0", NULL, "Capcom (Williams Electronics license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvwRomInfo, DrvwRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen42h = { - "1942h", "1942", NULL, NULL, "1991", - "Supercharger 1942\0", NULL, "hack (Two Bit Score)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvhRomInfo, DrvhRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen42c64 = { - "1942c64", "1942", NULL, NULL, "2015", - "1942 (C64 Music)\0", NULL, "hack by Minwah", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, Drvc64RomInfo, Drvc64RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_1943.cpp b/jan/src/burn/drv/pre90s/d_1943.cpp deleted file mode 100644 index 1646f8836..000000000 --- a/jan/src/burn/drv/pre90s/d_1943.cpp +++ /dev/null @@ -1,2150 +0,0 @@ -// FB Alpha 1943 driver module -// Based on MAME driver by Paul Leaman - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80Rom1 = NULL; -static UINT8 *DrvZ80Rom2 = NULL; -static UINT8 *DrvZ80Ram1 = NULL; -static UINT8 *DrvZ80Ram2 = NULL; -static UINT8 *DrvVideoRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPromRed = NULL; -static UINT8 *DrvPromGreen = NULL; -static UINT8 *DrvPromBlue = NULL; -static UINT8 *DrvPromCharLookup = NULL; -static UINT8 *DrvPromBg2Lookup = NULL; -static UINT8 *DrvPromBg2PalBank = NULL; -static UINT8 *DrvPromBgLookup = NULL; -static UINT8 *DrvPromBgPalBank = NULL; -static UINT8 *DrvPromSpriteLookup = NULL; -static UINT8 *DrvPromSpritePalBank = NULL; -static UINT8 *DrvBgTilemap = NULL; -static UINT8 *DrvBg2Tilemap = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvBg2Tiles = NULL; -static UINT8 *DrvBgTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvSoundLatch; -static UINT8 DrvRomBank; -static UINT8 DrvBg2ScrollX[2]; -static UINT8 DrvBgScrollX[2]; -static UINT8 DrvBgScrollY; -static UINT8 DrvBg2On; -static UINT8 DrvBg1On; -static UINT8 DrvSpritesOn; -static UINT8 DrvCharsOn; -static UINT8 DrvProtValue; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xf8, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Difficulty" }, - {0x11, 0x01, 0x0f, 0x0f, "1 (Easy)" }, - {0x11, 0x01, 0x0f, 0x0e, "2" }, - {0x11, 0x01, 0x0f, 0x0d, "3" }, - {0x11, 0x01, 0x0f, 0x0c, "4" }, - {0x11, 0x01, 0x0f, 0x0b, "5" }, - {0x11, 0x01, 0x0f, 0x0a, "6" }, - {0x11, 0x01, 0x0f, 0x09, "7" }, - {0x11, 0x01, 0x0f, 0x08, "8 (Normal)" }, - {0x11, 0x01, 0x0f, 0x07, "9" }, - {0x11, 0x01, 0x0f, 0x06, "10" }, - {0x11, 0x01, 0x0f, 0x05, "11" }, - {0x11, 0x01, 0x0f, 0x04, "12" }, - {0x11, 0x01, 0x0f, 0x03, "13" }, - {0x11, 0x01, 0x0f, 0x02, "14" }, - {0x11, 0x01, 0x0f, 0x01, "15" }, - {0x11, 0x01, 0x0f, 0x00, "16 (Difficult)" }, - - {0 , 0xfe, 0 , 2 , "2 Player Game" }, - {0x11, 0x01, 0x10, 0x00, "1 Credit / 2 Players" }, - {0x11, 0x01, 0x10, 0x10, "2 Credits / 2 Players" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "4 Coins 1 Play" }, - {0x12, 0x01, 0x07, 0x01, "3 Coins 1 Play" }, - {0x12, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "4 Coins 1 Play" }, - {0x12, 0x01, 0x38, 0x08, "3 Coins 1 Play" }, - {0x12, 0x01, 0x38, 0x10, "2 Coins 1 Play" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Plays" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x12, 0x01, 0x40, 0x00, "No" }, - {0x12, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x00, "Off" }, - {0x12, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Drv) - -static struct BurnRomInfo DrvRomDesc[] = { - { "bme01.12d", 0x08000, 0x55fd447e, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bme02.13d", 0x10000, 0x073fc57c, BRF_ESS | BRF_PRG }, // 1 - { "bme03.14d", 0x10000, 0x835822c2, BRF_ESS | BRF_PRG }, // 2 - - { "bm05.4k", 0x08000, 0xee2bd2d7, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "bm04.5h", 0x08000, 0x46cb9d3d, BRF_GRA }, // 4 Characters - - { "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - { "bm16.11f", 0x08000, 0x23c908c2, BRF_GRA }, // 6 - { "bm17.12f", 0x08000, 0x46bcdd07, BRF_GRA }, // 7 - { "bm18.14f", 0x08000, 0xe6ae7ba0, BRF_GRA }, // 8 - { "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - { "bm20.11j", 0x08000, 0x0917e5d4, BRF_GRA }, // 10 - { "bm21.12j", 0x08000, 0x9bfb0d89, BRF_GRA }, // 11 - { "bm22.14j", 0x08000, 0x04f3c274, BRF_GRA }, // 12 - - { "bm24.14k", 0x08000, 0x11134036, BRF_GRA }, // 13 BG2 Tiles - { "bm25.14l", 0x08000, 0x092cf9c1, BRF_GRA }, // 14 - - { "bm06.10a", 0x08000, 0x97acc8af, BRF_GRA }, // 15 Sprites - { "bm07.11a", 0x08000, 0xd78f7197, BRF_GRA }, // 16 - { "bm08.12a", 0x08000, 0x1a626608, BRF_GRA }, // 17 - { "bm09.14a", 0x08000, 0x92408400, BRF_GRA }, // 18 - { "bm10.10c", 0x08000, 0x8438a44a, BRF_GRA }, // 19 - { "bm11.11c", 0x08000, 0x6c69351d, BRF_GRA }, // 20 - { "bm12.12c", 0x08000, 0x5e7efdb7, BRF_GRA }, // 21 - { "bm13.14c", 0x08000, 0x1143829a, BRF_GRA }, // 22 - - { "bm14.5f", 0x08000, 0x4d3c6401, BRF_GRA }, // 23 Tilemaps - { "bm23.8k", 0x08000, 0xa52aecbd, BRF_GRA }, // 24 - - { "bm1.12a", 0x00100, 0x74421f18, BRF_GRA }, // 25 PROMs - { "bm2.13a", 0x00100, 0xac27541f, BRF_GRA }, // 26 - { "bm3.14a", 0x00100, 0x251fb6ff, BRF_GRA }, // 27 - { "bm5.7f", 0x00100, 0x206713d0, BRF_GRA }, // 28 - { "bm10.7l", 0x00100, 0x33c2491c, BRF_GRA }, // 29 - { "bm9.6l", 0x00100, 0xaeea4af7, BRF_GRA }, // 30 - { "bm12.12m", 0x00100, 0xc18aa136, BRF_GRA }, // 31 - { "bm11.12l", 0x00100, 0x405aae37, BRF_GRA }, // 32 - { "bm8.8c", 0x00100, 0xc2010a9e, BRF_GRA }, // 33 - { "bm7.7c", 0x00100, 0xb56f30c3, BRF_GRA }, // 34 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 35 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 36 - - { "bm.7k", 0x10000, 0x00000000, BRF_NODUMP }, // 37 MCU -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvuRomDesc[] = { - { "bmu01c.12d", 0x08000, 0xc686cc5c, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bmu02c.13d", 0x10000, 0xd8880a41, BRF_ESS | BRF_PRG }, // 1 - { "bmu03c.14d", 0x10000, 0x3f0ee26c, BRF_ESS | BRF_PRG }, // 2 - - { "bm05.4k", 0x08000, 0xee2bd2d7, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "bm04.5h", 0x08000, 0x46cb9d3d, BRF_GRA }, // 4 Characters - - { "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - { "bm16.11f", 0x08000, 0x23c908c2, BRF_GRA }, // 6 - { "bm17.12f", 0x08000, 0x46bcdd07, BRF_GRA }, // 7 - { "bm18.14f", 0x08000, 0xe6ae7ba0, BRF_GRA }, // 8 - { "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - { "bm20.11j", 0x08000, 0x0917e5d4, BRF_GRA }, // 10 - { "bm21.12j", 0x08000, 0x9bfb0d89, BRF_GRA }, // 11 - { "bm22.14j", 0x08000, 0x04f3c274, BRF_GRA }, // 12 - - { "bm24.14k", 0x08000, 0x11134036, BRF_GRA }, // 13 BG2 Tiles - { "bm25.14l", 0x08000, 0x092cf9c1, BRF_GRA }, // 14 - - { "bm06.10a", 0x08000, 0x97acc8af, BRF_GRA }, // 15 Sprites - { "bm07.11a", 0x08000, 0xd78f7197, BRF_GRA }, // 16 - { "bm08.12a", 0x08000, 0x1a626608, BRF_GRA }, // 17 - { "bm09.14a", 0x08000, 0x92408400, BRF_GRA }, // 18 - { "bm10.10c", 0x08000, 0x8438a44a, BRF_GRA }, // 19 - { "bm11.11c", 0x08000, 0x6c69351d, BRF_GRA }, // 20 - { "bm12.12c", 0x08000, 0x5e7efdb7, BRF_GRA }, // 21 - { "bm13.14c", 0x08000, 0x1143829a, BRF_GRA }, // 22 - - { "bm14.5f", 0x08000, 0x4d3c6401, BRF_GRA }, // 23 Tilemaps - { "bm23.8k", 0x08000, 0xa52aecbd, BRF_GRA }, // 24 - - { "bm1.12a", 0x00100, 0x74421f18, BRF_GRA }, // 25 PROMs - { "bm2.13a", 0x00100, 0xac27541f, BRF_GRA }, // 26 - { "bm3.14a", 0x00100, 0x251fb6ff, BRF_GRA }, // 27 - { "bm5.7f", 0x00100, 0x206713d0, BRF_GRA }, // 28 - { "bm10.7l", 0x00100, 0x33c2491c, BRF_GRA }, // 29 - { "bm9.6l", 0x00100, 0xaeea4af7, BRF_GRA }, // 30 - { "bm12.12m", 0x00100, 0xc18aa136, BRF_GRA }, // 31 - { "bm11.12l", 0x00100, 0x405aae37, BRF_GRA }, // 32 - { "bm8.8c", 0x00100, 0xc2010a9e, BRF_GRA }, // 33 - { "bm7.7c", 0x00100, 0xb56f30c3, BRF_GRA }, // 34 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 35 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 36 - - { "bm.7k", 0x10000, 0x00000000, BRF_NODUMP }, // 37 MCU -}; - -STD_ROM_PICK(Drvu) -STD_ROM_FN(Drvu) - -static struct BurnRomInfo DrvuaRomDesc[] = { - { "bmu01.12d", 0x08000, 0x793cf15f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bmu02.13d", 0x10000, 0x6f1353d5, BRF_ESS | BRF_PRG }, // 1 - { "bmu03.14d", 0x10000, 0x9e7c07f7, BRF_ESS | BRF_PRG }, // 2 - - { "bm05.4k", 0x08000, 0xee2bd2d7, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "bm04.5h", 0x08000, 0x46cb9d3d, BRF_GRA }, // 4 Characters - - { "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - { "bm16.11f", 0x08000, 0x23c908c2, BRF_GRA }, // 6 - { "bm17.12f", 0x08000, 0x46bcdd07, BRF_GRA }, // 7 - { "bm18.14f", 0x08000, 0xe6ae7ba0, BRF_GRA }, // 8 - { "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - { "bm20.11j", 0x08000, 0x0917e5d4, BRF_GRA }, // 10 - { "bm21.12j", 0x08000, 0x9bfb0d89, BRF_GRA }, // 11 - { "bm22.14j", 0x08000, 0x04f3c274, BRF_GRA }, // 12 - - { "bm24.14k", 0x08000, 0x11134036, BRF_GRA }, // 13 BG2 Tiles - { "bm25.14l", 0x08000, 0x092cf9c1, BRF_GRA }, // 14 - - { "bm06.10a", 0x08000, 0x97acc8af, BRF_GRA }, // 15 Sprites - { "bm07.11a", 0x08000, 0xd78f7197, BRF_GRA }, // 16 - { "bm08.12a", 0x08000, 0x1a626608, BRF_GRA }, // 17 - { "bm09.14a", 0x08000, 0x92408400, BRF_GRA }, // 18 - { "bm10.10c", 0x08000, 0x8438a44a, BRF_GRA }, // 19 - { "bm11.11c", 0x08000, 0x6c69351d, BRF_GRA }, // 20 - { "bm12.12c", 0x08000, 0x5e7efdb7, BRF_GRA }, // 21 - { "bm13.14c", 0x08000, 0x1143829a, BRF_GRA }, // 22 - - { "bm14.5f", 0x08000, 0x4d3c6401, BRF_GRA }, // 23 Tilemaps - { "bm23.8k", 0x08000, 0xa52aecbd, BRF_GRA }, // 24 - - { "bm1.12a", 0x00100, 0x74421f18, BRF_GRA }, // 25 PROMs - { "bm2.13a", 0x00100, 0xac27541f, BRF_GRA }, // 26 - { "bm3.14a", 0x00100, 0x251fb6ff, BRF_GRA }, // 27 - { "bm5.7f", 0x00100, 0x206713d0, BRF_GRA }, // 28 - { "bm10.7l", 0x00100, 0x33c2491c, BRF_GRA }, // 29 - { "bm9.6l", 0x00100, 0xaeea4af7, BRF_GRA }, // 30 - { "bm12.12m", 0x00100, 0xc18aa136, BRF_GRA }, // 31 - { "bm11.12l", 0x00100, 0x405aae37, BRF_GRA }, // 32 - { "bm8.8c", 0x00100, 0xc2010a9e, BRF_GRA }, // 33 - { "bm7.7c", 0x00100, 0xb56f30c3, BRF_GRA }, // 34 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 35 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 36 - - { "bm.7k", 0x10000, 0x00000000, BRF_NODUMP }, // 37 MCU -}; - -STD_ROM_PICK(Drvua) -STD_ROM_FN(Drvua) - -static struct BurnRomInfo DrvjRomDesc[] = { - { "bm01b.12d", 0x08000, 0x363f9f3d, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bm02b.13d", 0x10000, 0x7f0d7edc, BRF_ESS | BRF_PRG }, // 1 - { "bm03b.14d", 0x10000, 0x7093da2a, BRF_ESS | BRF_PRG }, // 2 - - { "bm05.4k", 0x08000, 0xee2bd2d7, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "bm04.5h", 0x08000, 0x46cb9d3d, BRF_GRA }, // 4 Characters - - { "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - { "bm16.11f", 0x08000, 0x23c908c2, BRF_GRA }, // 6 - { "bm17.12f", 0x08000, 0x46bcdd07, BRF_GRA }, // 7 - { "bm18.14f", 0x08000, 0xe6ae7ba0, BRF_GRA }, // 8 - { "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - { "bm20.11j", 0x08000, 0x0917e5d4, BRF_GRA }, // 10 - { "bm21.12j", 0x08000, 0x9bfb0d89, BRF_GRA }, // 11 - { "bm22.14j", 0x08000, 0x04f3c274, BRF_GRA }, // 12 - - { "bm24.14k", 0x08000, 0x11134036, BRF_GRA }, // 13 BG2 Tiles - { "bm25.14l", 0x08000, 0x092cf9c1, BRF_GRA }, // 14 - - { "bm06.10a", 0x08000, 0x97acc8af, BRF_GRA }, // 15 Sprites - { "bm07.11a", 0x08000, 0xd78f7197, BRF_GRA }, // 16 - { "bm08.12a", 0x08000, 0x1a626608, BRF_GRA }, // 17 - { "bm09.14a", 0x08000, 0x92408400, BRF_GRA }, // 18 - { "bm10.10c", 0x08000, 0x8438a44a, BRF_GRA }, // 19 - { "bm11.11c", 0x08000, 0x6c69351d, BRF_GRA }, // 20 - { "bm12.12c", 0x08000, 0x5e7efdb7, BRF_GRA }, // 21 - { "bm13.14c", 0x08000, 0x1143829a, BRF_GRA }, // 22 - - { "bm14.5f", 0x08000, 0x4d3c6401, BRF_GRA }, // 23 Tilemaps - { "bm23.8k", 0x08000, 0xa52aecbd, BRF_GRA }, // 24 - - { "bm1.12a", 0x00100, 0x74421f18, BRF_GRA }, // 25 PROMs - { "bm2.13a", 0x00100, 0xac27541f, BRF_GRA }, // 26 - { "bm3.14a", 0x00100, 0x251fb6ff, BRF_GRA }, // 27 - { "bm5.7f", 0x00100, 0x206713d0, BRF_GRA }, // 28 - { "bm10.7l", 0x00100, 0x33c2491c, BRF_GRA }, // 29 - { "bm9.6l", 0x00100, 0xaeea4af7, BRF_GRA }, // 30 - { "bm12.12m", 0x00100, 0xc18aa136, BRF_GRA }, // 31 - { "bm11.12l", 0x00100, 0x405aae37, BRF_GRA }, // 32 - { "bm8.8c", 0x00100, 0xc2010a9e, BRF_GRA }, // 33 - { "bm7.7c", 0x00100, 0xb56f30c3, BRF_GRA }, // 34 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 35 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 36 - - { "bm.7k", 0x10000, 0x00000000, BRF_NODUMP }, // 37 MCU -}; - -STD_ROM_PICK(Drvj) -STD_ROM_FN(Drvj) - -static struct BurnRomInfo DrvjaRomDesc[] = { - { "bm01.12d", 0x08000, 0xf6935937, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bm02.13d", 0x10000, 0xaf971575, BRF_ESS | BRF_PRG }, // 1 - { "bm03.14d", 0x10000, 0x300ec713, BRF_ESS | BRF_PRG }, // 2 - - { "bm05.4k", 0x08000, 0xee2bd2d7, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "bm04.5h", 0x08000, 0x46cb9d3d, BRF_GRA }, // 4 Characters - - { "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - { "bm16.11f", 0x08000, 0x23c908c2, BRF_GRA }, // 6 - { "bm17.12f", 0x08000, 0x46bcdd07, BRF_GRA }, // 7 - { "bm18.14f", 0x08000, 0xe6ae7ba0, BRF_GRA }, // 8 - { "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - { "bm20.11j", 0x08000, 0x0917e5d4, BRF_GRA }, // 10 - { "bm21.12j", 0x08000, 0x9bfb0d89, BRF_GRA }, // 11 - { "bm22.14j", 0x08000, 0x04f3c274, BRF_GRA }, // 12 - - { "bm24.14k", 0x08000, 0x11134036, BRF_GRA }, // 13 BG2 Tiles - { "bm25.14l", 0x08000, 0x092cf9c1, BRF_GRA }, // 14 - - { "bm06.10a", 0x08000, 0x97acc8af, BRF_GRA }, // 15 Sprites - { "bm07.11a", 0x08000, 0xd78f7197, BRF_GRA }, // 16 - { "bm08.12a", 0x08000, 0x1a626608, BRF_GRA }, // 17 - { "bm09.14a", 0x08000, 0x92408400, BRF_GRA }, // 18 - { "bm10.10c", 0x08000, 0x8438a44a, BRF_GRA }, // 19 - { "bm11.11c", 0x08000, 0x6c69351d, BRF_GRA }, // 20 - { "bm12.12c", 0x08000, 0x5e7efdb7, BRF_GRA }, // 21 - { "bm13.14c", 0x08000, 0x1143829a, BRF_GRA }, // 22 - - { "bm14.5f", 0x08000, 0x4d3c6401, BRF_GRA }, // 23 Tilemaps - { "bm23.8k", 0x08000, 0xa52aecbd, BRF_GRA }, // 24 - - { "bm1.12a", 0x00100, 0x74421f18, BRF_GRA }, // 25 PROMs - { "bm2.13a", 0x00100, 0xac27541f, BRF_GRA }, // 26 - { "bm3.14a", 0x00100, 0x251fb6ff, BRF_GRA }, // 27 - { "bm5.7f", 0x00100, 0x206713d0, BRF_GRA }, // 28 - { "bm10.7l", 0x00100, 0x33c2491c, BRF_GRA }, // 29 - { "bm9.6l", 0x00100, 0xaeea4af7, BRF_GRA }, // 30 - { "bm12.12m", 0x00100, 0xc18aa136, BRF_GRA }, // 31 - { "bm11.12l", 0x00100, 0x405aae37, BRF_GRA }, // 32 - { "bm8.8c", 0x00100, 0xc2010a9e, BRF_GRA }, // 33 - { "bm7.7c", 0x00100, 0xb56f30c3, BRF_GRA }, // 34 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 35 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 36 - - { "bm.7k", 0x10000, 0x00000000, BRF_NODUMP }, // 37 MCU -}; - -STD_ROM_PICK(Drvja) -STD_ROM_FN(Drvja) - -static struct BurnRomInfo Drvja2RomDesc[] = { - { "bm01.12d", 0x08000, 0x232df705, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bm02.13d", 0x10000, 0xaf971575, BRF_ESS | BRF_PRG }, // 1 - { "bm03.14d", 0x10000, 0x300ec713, BRF_ESS | BRF_PRG }, // 2 - - { "bm05.4k", 0x08000, 0xee2bd2d7, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "4.5h", 0x08000, 0x0aba2096, BRF_GRA }, // 4 Characters - - { "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - { "bm16.11f", 0x08000, 0x23c908c2, BRF_GRA }, // 6 - { "bm17.12f", 0x08000, 0x46bcdd07, BRF_GRA }, // 7 - { "bm18.14f", 0x08000, 0xe6ae7ba0, BRF_GRA }, // 8 - { "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - { "bm20.11j", 0x08000, 0x0917e5d4, BRF_GRA }, // 10 - { "bm21.12j", 0x08000, 0x9bfb0d89, BRF_GRA }, // 11 - { "bm22.14j", 0x08000, 0x04f3c274, BRF_GRA }, // 12 - - { "bm24.14k", 0x08000, 0x11134036, BRF_GRA }, // 13 BG2 Tiles - { "bm25.14l", 0x08000, 0x092cf9c1, BRF_GRA }, // 14 - - { "bm06.10a", 0x08000, 0x97acc8af, BRF_GRA }, // 15 Sprites - { "bm07.11a", 0x08000, 0xd78f7197, BRF_GRA }, // 16 - { "bm08.12a", 0x08000, 0x1a626608, BRF_GRA }, // 17 - { "bm09.14a", 0x08000, 0x92408400, BRF_GRA }, // 18 - { "bm10.10c", 0x08000, 0x8438a44a, BRF_GRA }, // 19 - { "bm11.11c", 0x08000, 0x6c69351d, BRF_GRA }, // 20 - { "bm12.12c", 0x08000, 0x5e7efdb7, BRF_GRA }, // 21 - { "bm13.14c", 0x08000, 0x1143829a, BRF_GRA }, // 22 - - { "bm14.5f", 0x08000, 0x4d3c6401, BRF_GRA }, // 23 Tilemaps - { "bm23.8k", 0x08000, 0xa52aecbd, BRF_GRA }, // 24 - - { "bm1.12a", 0x00100, 0x74421f18, BRF_GRA }, // 25 PROMs - { "bm2.13a", 0x00100, 0xac27541f, BRF_GRA }, // 26 - { "bm3.14a", 0x00100, 0x251fb6ff, BRF_GRA }, // 27 - { "bm5.7f", 0x00100, 0x206713d0, BRF_GRA }, // 28 - { "bm10.7l", 0x00100, 0x33c2491c, BRF_GRA }, // 29 - { "bm9.6l", 0x00100, 0xaeea4af7, BRF_GRA }, // 30 - { "bm12.12m", 0x00100, 0xc18aa136, BRF_GRA }, // 31 - { "bm11.12l", 0x00100, 0x405aae37, BRF_GRA }, // 32 - { "bm8.8c", 0x00100, 0xc2010a9e, BRF_GRA }, // 33 - { "bm7.7c", 0x00100, 0xb56f30c3, BRF_GRA }, // 34 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 35 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 36 - - { "bm.7k", 0x10000, 0x00000000, BRF_NODUMP }, // 37 MCU -}; - -STD_ROM_PICK(Drvja2) -STD_ROM_FN(Drvja2) - -static struct BurnRomInfo DrvbRomDesc[] = { - { "1.12d", 0x08000, 0x9a2d70ab, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bm02.13d", 0x10000, 0xaf971575, BRF_ESS | BRF_PRG }, // 1 - { "bm03.14d", 0x10000, 0x300ec713, BRF_ESS | BRF_PRG }, // 2 - - { "bm05.4k", 0x08000, 0xee2bd2d7, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "4.5h", 0x08000, 0x0aba2096, BRF_GRA }, // 4 Characters - - { "15.12f", 0x10000, 0x622b4fba, BRF_GRA }, // 5 BG Tiles - { "16.14f", 0x10000, 0x25471a8d, BRF_GRA }, // 6 - { "17.12j", 0x10000, 0x9da79653, BRF_GRA }, // 7 - { "18.14j", 0x10000, 0x1f3aced8, BRF_GRA }, // 8 - - { "bm24.14k", 0x08000, 0x11134036, BRF_GRA }, // 9 BG2 Tiles - { "bm25.14l", 0x08000, 0x092cf9c1, BRF_GRA }, // 10 - - { "bm06.10a", 0x08000, 0x97acc8af, BRF_GRA }, // 11 Sprites - { "bm07.11a", 0x08000, 0xd78f7197, BRF_GRA }, // 12 - { "bm08.12a", 0x08000, 0x1a626608, BRF_GRA }, // 13 - { "bm09.14a", 0x08000, 0x92408400, BRF_GRA }, // 14 - { "bm10.10c", 0x08000, 0x8438a44a, BRF_GRA }, // 15 - { "bm11.11c", 0x08000, 0x6c69351d, BRF_GRA }, // 16 - { "bm12.12c", 0x08000, 0x5e7efdb7, BRF_GRA }, // 17 - { "bm13.14c", 0x08000, 0x1143829a, BRF_GRA }, // 18 - - { "bm14.5f", 0x08000, 0x4d3c6401, BRF_GRA }, // 19 Tilemaps - { "bm23.8k", 0x08000, 0xa52aecbd, BRF_GRA }, // 20 - - { "bm1.12a", 0x00100, 0x74421f18, BRF_GRA }, // 21 PROMs - { "bm2.13a", 0x00100, 0xac27541f, BRF_GRA }, // 22 - { "bm3.14a", 0x00100, 0x251fb6ff, BRF_GRA }, // 23 - { "bm5.7f", 0x00100, 0x206713d0, BRF_GRA }, // 24 - { "bm10.7l", 0x00100, 0x33c2491c, BRF_GRA }, // 25 - { "bm9.6l", 0x00100, 0xaeea4af7, BRF_GRA }, // 26 - { "bm12.12m", 0x00100, 0xc18aa136, BRF_GRA }, // 27 - { "bm11.12l", 0x00100, 0x405aae37, BRF_GRA }, // 28 - { "bm8.8c", 0x00100, 0xc2010a9e, BRF_GRA }, // 29 - { "bm7.7c", 0x00100, 0xb56f30c3, BRF_GRA }, // 30 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 31 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 32 -}; - -STD_ROM_PICK(Drvb) -STD_ROM_FN(Drvb) - -static struct BurnRomInfo Drvb2RomDesc[] = { - { "u28.bin", 0x08000, 0xb3b7c7cd, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "u27.bin", 0x10000, 0xaf971575, BRF_ESS | BRF_PRG }, // 1 - { "u26.bin", 0x10000, 0x300ec713, BRF_ESS | BRF_PRG }, // 2 - - { "u88.bin", 0x08000, 0xee2bd2d7, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "u62.bin", 0x08000, 0x0aba2096, BRF_GRA }, // 4 Characters - - { "u66.bin", 0x10000, 0x075e9a7f, BRF_GRA }, // 5 BG Tiles - { "u65.bin", 0x10000, 0x05aca09a, BRF_GRA }, // 6 - { "u79.bin", 0x10000, 0x0f4b7e0e, BRF_GRA }, // 7 - { "u70.bin", 0x10000, 0x61a90c0a, BRF_GRA }, // 8 - - { "u102.bin", 0x08000, 0x11134036, BRF_GRA }, // 9 BG2 Tiles - { "u116.bin", 0x08000, 0x092cf9c1, BRF_GRA }, // 10 - - { "u9.bin", 0x08000, 0x97acc8af, BRF_GRA }, // 11 Sprites - { "u10.bin", 0x08000, 0xd78f7197, BRF_GRA }, // 12 - { "u8.bin", 0x10000, 0xed5c788a, BRF_GRA }, // 13 - { "u18.bin", 0x08000, 0x8438a44a, BRF_GRA }, // 14 - { "u19.bin", 0x08000, 0x6c69351d, BRF_GRA }, // 15 - { "u17.bin", 0x10000, 0x4b42445e, BRF_GRA }, // 16 - - { "u58.bin", 0x08000, 0x4d3c6401, BRF_GRA }, // 17 Tilemaps - { "u96.bin", 0x08000, 0x254c881d, BRF_GRA }, // 18 - - { "bm1.12a", 0x00100, 0x74421f18, BRF_GRA }, // 19 PROMs - { "bm2.13a", 0x00100, 0xac27541f, BRF_GRA }, // 20 - { "bm3.14a", 0x00100, 0x251fb6ff, BRF_GRA }, // 21 - { "bm5.7f", 0x00100, 0x206713d0, BRF_GRA }, // 22 - { "bm10.7l", 0x00100, 0x33c2491c, BRF_GRA }, // 23 - { "bm9.6l", 0x00100, 0xaeea4af7, BRF_GRA }, // 24 - { "bm12.12m", 0x00100, 0xc18aa136, BRF_GRA }, // 25 - { "bm11.12l", 0x00100, 0x405aae37, BRF_GRA }, // 26 - { "bm8.8c", 0x00100, 0xc2010a9e, BRF_GRA }, // 27 - { "bm7.7c", 0x00100, 0xb56f30c3, BRF_GRA }, // 28 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 29 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 30 -}; - -STD_ROM_PICK(Drvb2) -STD_ROM_FN(Drvb2) - -static struct BurnRomInfo DrvbjRomDesc[] = { - { "mkb03.12d", 0x08000, 0xb3b7c7cd, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bm02.13d", 0x10000, 0xaf971575, BRF_ESS | BRF_PRG }, // 1 - { "bm03.14d", 0x10000, 0x300ec713, BRF_ESS | BRF_PRG }, // 2 - - { "bm05.4k", 0x08000, 0xee2bd2d7, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "bm04.5h", 0x08000, 0x46cb9d3d, BRF_GRA }, // 4 Characters - - { "mkb12.12f", 0x10000, 0x075e9a7f, BRF_GRA }, // 5 BG Tiles - { "mkb11.14f", 0x10000, 0x05aca09a, BRF_GRA }, // 6 - { "mkb09.12j", 0x10000, 0x0f4b7e0e, BRF_GRA }, // 7 - { "mkb10.14j", 0x10000, 0x61a90c0a, BRF_GRA }, // 8 - - { "mkb08.14k", 0x08000, 0x798215e3, BRF_GRA }, // 9 BG2 Tiles - { "bm25.14l", 0x08000, 0x092cf9c1, BRF_GRA }, // 10 - - { "bm06.10a", 0x08000, 0x97acc8af, BRF_GRA }, // 11 Sprites - { "bm07.11a", 0x08000, 0xd78f7197, BRF_GRA }, // 12 - { "bm08.12a", 0x08000, 0x1a626608, BRF_GRA }, // 13 - { "bm09.14a", 0x08000, 0x92408400, BRF_GRA }, // 14 - { "bm10.10c", 0x08000, 0x8438a44a, BRF_GRA }, // 15 - { "bm11.11c", 0x08000, 0x6c69351d, BRF_GRA }, // 16 - { "bm12.12c", 0x08000, 0x5e7efdb7, BRF_GRA }, // 17 - { "bm13.14c", 0x08000, 0x1143829a, BRF_GRA }, // 18 - - { "bm14.5f", 0x08000, 0x4d3c6401, BRF_GRA }, // 19 Tilemaps - { "mkb07.8k", 0x08000, 0xae1b317f, BRF_GRA }, // 20 - - { "bm1.12a", 0x00100, 0x74421f18, BRF_GRA }, // 21 PROMs - { "bm2.13a", 0x00100, 0xac27541f, BRF_GRA }, // 22 - { "bm3.14a", 0x00100, 0x251fb6ff, BRF_GRA }, // 23 - { "bm5.7f", 0x00100, 0x206713d0, BRF_GRA }, // 24 - { "bm10.7l", 0x00100, 0x33c2491c, BRF_GRA }, // 25 - { "bm9.6l", 0x00100, 0xaeea4af7, BRF_GRA }, // 26 - { "bm12.12m", 0x00100, 0xc18aa136, BRF_GRA }, // 27 - { "bm11.12l", 0x00100, 0x405aae37, BRF_GRA }, // 28 - { "bm8.8c", 0x00100, 0xc2010a9e, BRF_GRA }, // 29 - { "bm7.7c", 0x00100, 0xb56f30c3, BRF_GRA }, // 30 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 31 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 32 -}; - -STD_ROM_PICK(Drvbj) -STD_ROM_FN(Drvbj) - -static struct BurnRomInfo DrvkaiRomDesc[] = { - { "bmk01.12d", 0x08000, 0x7d2211db, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bmk02.13d", 0x10000, 0x2ebbc8c5, BRF_ESS | BRF_PRG }, // 1 - { "bmk03.14d", 0x10000, 0x475a6ac5, BRF_ESS | BRF_PRG }, // 2 - - { "bmk05.4k", 0x08000, 0x25f37957, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "bmk04.5h", 0x08000, 0x884a8692, BRF_GRA }, // 4 Characters - - { "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - { "bmk16.11f", 0x08000, 0x9416fe0d, BRF_GRA }, // 6 - { "bmk17.12f", 0x08000, 0x3d5acab9, BRF_GRA }, // 7 - { "bmk18.14f", 0x08000, 0x7b62da1d, BRF_GRA }, // 8 - { "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - { "bmk20.11j", 0x08000, 0xb90364c1, BRF_GRA }, // 10 - { "bmk21.12j", 0x08000, 0x8c7fe74a, BRF_GRA }, // 11 - { "bmk22.14j", 0x08000, 0xd5ef8a0e, BRF_GRA }, // 12 - - { "bmk24.14k", 0x08000, 0xbf186ef2, BRF_GRA }, // 13 BG2 Tiles - { "bmk25.14l", 0x08000, 0xa755faf1, BRF_GRA }, // 14 - - { "bmk06.10a", 0x08000, 0x5f7e38b3, BRF_GRA }, // 15 Sprites - { "bmk07.11a", 0x08000, 0xff3751fd, BRF_GRA }, // 16 - { "bmk08.12a", 0x08000, 0x159d51bd, BRF_GRA }, // 17 - { "bmk09.14a", 0x08000, 0x8683e3d2, BRF_GRA }, // 18 - { "bmk10.10c", 0x08000, 0x1e0d9571, BRF_GRA }, // 19 - { "bmk11.11c", 0x08000, 0xf1fc5ee1, BRF_GRA }, // 20 - { "bmk12.12c", 0x08000, 0x0f50c001, BRF_GRA }, // 21 - { "bmk13.14c", 0x08000, 0xfd1acf8e, BRF_GRA }, // 22 - - { "bmk14.5f", 0x08000, 0xcf0f5a53, BRF_GRA }, // 23 Tilemaps - { "bmk23.8k", 0x08000, 0x17f77ef9, BRF_GRA }, // 24 - - { "bmk1.12a", 0x00100, 0xe001ea33, BRF_GRA }, // 25 PROMs - { "bmk2.13a", 0x00100, 0xaf34d91a, BRF_GRA }, // 26 - { "bmk3.14a", 0x00100, 0x43e9f6ef, BRF_GRA }, // 27 - { "bmk5.7f", 0x00100, 0x41878934, BRF_GRA }, // 28 - { "bmk10.7l", 0x00100, 0xde44b748, BRF_GRA }, // 29 - { "bmk9.6l", 0x00100, 0x59ea57c0, BRF_GRA }, // 30 - { "bmk12.12m", 0x00100, 0x8765f8b0, BRF_GRA }, // 31 - { "bmk11.12l", 0x00100, 0x87a8854e, BRF_GRA }, // 32 - { "bmk8.8c", 0x00100, 0xdad17e2d, BRF_GRA }, // 33 - { "bmk7.7c", 0x00100, 0x76307f8d, BRF_GRA }, // 34 - { "bm4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 35 - { "bm6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 36 - - { "bm.7k", 0x10000, 0x00000000, BRF_NODUMP }, // 37 MCU -}; - -STD_ROM_PICK(Drvkai) -STD_ROM_FN(Drvkai) - -static struct BurnRomInfo DrvmiiRomDesc[] = { - /* Prototype, location test or limited release? - PCB had genuine CAPCOM labels on the roms */ - { "01.12d", 0x08000, 0x8ba22485, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "02.13d", 0x10000, 0x659a5455, BRF_ESS | BRF_PRG }, // 1 - { "03.14d", 0x10000, 0x159ea771, BRF_ESS | BRF_PRG }, // 2 - - { "05.4k", 0x08000, 0x25f37957, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "04.5h", 0x08000, 0x8190e092, BRF_GRA }, // 4 Characters - - { "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - { "bm16.11f", 0x08000, 0x23c908c2, BRF_GRA }, // 6 - { "17.12f", 0x08000, 0x3d5acab9, BRF_GRA }, // 7 - { "18.14f", 0x08000, 0x7b62da1d, BRF_GRA }, // 8 - { "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - { "bm20.11j", 0x08000, 0x0917e5d4, BRF_GRA }, // 10 - { "21.12j", 0x08000, 0x8c7fe74a, BRF_GRA }, // 11 - { "22.14j", 0x08000, 0xd5ef8a0e, BRF_GRA }, // 12 - - { "24.14k", 0x08000, 0xa0074c68, BRF_GRA }, // 13 BG2 Tiles - { "25.14l", 0x08000, 0xf979b2f2, BRF_GRA }, // 14 - - { "06.10a", 0x08000, 0xb261d5d7, BRF_GRA }, // 15 Sprites - { "07.11a", 0x08000, 0x2af8a6f2, BRF_GRA }, // 16 - { "08.12a", 0x08000, 0x159d51bd, BRF_GRA }, // 17 - { "09.14a", 0x08000, 0x70d9f9a7, BRF_GRA }, // 18 - { "10.10c", 0x08000, 0xde539920, BRF_GRA }, // 19 - { "11.11c", 0x08000, 0xa6abf183, BRF_GRA }, // 20 - { "12.12c", 0x08000, 0x0f50c001, BRF_GRA }, // 21 - { "13.14c", 0x08000, 0xf065f619, BRF_GRA }, // 22 - - { "14.5f", 0x08000, 0x02a899f1, BRF_GRA }, // 23 Tilemaps - { "23.8k", 0x08000, 0xb6dfdf85, BRF_GRA }, // 24 - - // PCB had standard BM0x for bproms 1 through 3, but clearly these should use the Kai BPROMs for correct colors - // BPROMs 4 through 8 macth the Kai set - labels were a non descript yellow dot with prom number - // BPROMs 9 through 12 are unique - labels were a non descript yellow dot with prom number - { "bmk1.12a", 0x00100, 0xe001ea33, BRF_GRA }, // 25 PROMs - { "bmk2.13a", 0x00100, 0xaf34d91a, BRF_GRA }, // 26 - { "bmk3.14a", 0x00100, 0x43e9f6ef, BRF_GRA }, // 27 - { "5.7f", 0x00100, 0x41878934, BRF_GRA }, // 28 - { "10.7l", 0x00100, 0xdb53adf0, BRF_GRA }, // 29 - { "9.6l", 0x00100, 0x75d5cc90, BRF_GRA }, // 30 - { "12.12m", 0x00100, 0x784bdf33, BRF_GRA }, // 31 - { "11.12l", 0x00100, 0x6fb2e170, BRF_GRA }, // 32 - { "8.8c", 0x00100, 0xdad17e2d, BRF_GRA }, // 33 - { "7.7c", 0x00100, 0x76307f8d, BRF_GRA }, // 34 - { "4.12c", 0x00100, 0x91a8a2e1, BRF_GRA }, // 35 - { "6.4b", 0x00100, 0x0eaf5158, BRF_GRA }, // 36 - - { "bm.7k", 0x10000, 0x00000000, BRF_NODUMP }, // 37 MCU -}; - -STD_ROM_PICK(Drvmii) -STD_ROM_FN(Drvmii) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom1 = Next; Next += 0x30000; - DrvZ80Rom2 = Next; Next += 0x08000; - DrvPromRed = Next; Next += 0x00100; - DrvPromGreen = Next; Next += 0x00100; - DrvPromBlue = Next; Next += 0x00100; - DrvPromCharLookup = Next; Next += 0x00100; - DrvPromBg2Lookup = Next; Next += 0x00100; - DrvPromBg2PalBank = Next; Next += 0x00100; - DrvPromBgLookup = Next; Next += 0x00100; - DrvPromBgPalBank = Next; Next += 0x00100; - DrvPromSpriteLookup = Next; Next += 0x00100; - DrvPromSpritePalBank = Next; Next += 0x00100; - DrvBgTilemap = Next; Next += 0x08000; - DrvBg2Tilemap = Next; Next += 0x08000; - - RamStart = Next; - - DrvZ80Ram1 = Next; Next += 0x01000; - DrvZ80Ram2 = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x00400; - DrvPaletteRam = Next; Next += 0x00400; - DrvSpriteRam = Next; Next += 0x01000; - - RamEnd = Next; - - DrvChars = Next; Next += 2048 * 8 * 8; - DrvBg2Tiles = Next; Next += 128 * 32 * 32; - DrvBgTiles = Next; Next += 512 * 32 * 32; - DrvSprites = Next; Next += 2048 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00380 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - BurnYM2203Reset(); - - DrvRomBank = 0; - DrvSoundLatch = 0; - DrvBg2ScrollX[0] = 0; - DrvBg2ScrollX[1] = 0; - DrvBgScrollX[0] = 0; - DrvBgScrollX[1] = 0; - DrvBgScrollY = 0; - DrvBg2On = 0; - DrvBg1On = 0; - DrvSpritesOn = 0; - DrvCharsOn = 0; - DrvProtValue = 0; - - HiscoreReset(); - - return 0; -} - -static UINT8 Drv1943ProtRead() -{ - // This data comes from a table at $21a containing 64 entries, even is "case", odd is return value. - switch (DrvProtValue) { - case 0x24: return 0x1d; - case 0x60: return 0xf7; - case 0x01: return 0xac; - case 0x55: return 0x50; - case 0x56: return 0xe2; - case 0x2a: return 0x58; - case 0xa8: return 0x13; - case 0x22: return 0x3e; - case 0x3b: return 0x5a; - case 0x1e: return 0x1b; - case 0xe9: return 0x41; - case 0x7d: return 0xd5; - case 0x43: return 0x54; - case 0x37: return 0x6f; - case 0x4c: return 0x59; - case 0x5f: return 0x56; - case 0x3f: return 0x2f; - case 0x3e: return 0x3d; - case 0xfb: return 0x36; - case 0x1d: return 0x3b; - case 0x27: return 0xae; - case 0x26: return 0x39; - case 0x58: return 0x3c; - case 0x32: return 0x51; - case 0x1a: return 0xa8; - case 0xbc: return 0x33; - case 0x30: return 0x4a; - case 0x64: return 0x12; - case 0x11: return 0x40; - case 0x33: return 0x35; - case 0x09: return 0x17; - case 0x25: return 0x04; - } - - return 0; -} - -UINT8 __fastcall Drv1943Read1(UINT16 a) -{ - switch (a) { - case 0xc000: { - return 0xff - DrvInput[0]; - } - - case 0xc001: { - return 0xff - DrvInput[1]; - } - - case 0xc002: { - return 0xff - DrvInput[2]; - } - - case 0xc003: { - return DrvDip[0]; - } - - case 0xc004: { - return DrvDip[1]; - } - - case 0xc007: { - return Drv1943ProtRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall Drvb1943Read1(UINT16 a) -{ - switch (a) { - case 0xc000: { - return 0xff - DrvInput[0]; - } - - case 0xc001: { - return 0xff - DrvInput[1]; - } - - case 0xc002: { - return 0xff - DrvInput[2]; - } - - case 0xc003: { - return DrvDip[0]; - } - - case 0xc004: { - return DrvDip[1]; - } - - case 0xc007: { // Always return 0 for protection reads - return 0x00; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Drv1943Write1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xc800: { - DrvSoundLatch = d; - return; - } - - case 0xc804: { - DrvRomBank = d & 0x1c; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + DrvRomBank * 0x1000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + DrvRomBank * 0x1000 ); - - if (d & 0x40) bprintf(PRINT_NORMAL, _T("c804 write %x\n"), d); - - DrvCharsOn = d & 0x80; - return; - } - - case 0xc806: { - // Watchdog - return; - } - - case 0xc807: { - DrvProtValue = d; - return; - } - - case 0xd800: { - DrvBgScrollX[0] = d; - return; - } - - case 0xd801: { - DrvBgScrollX[1] = d; - return; - } - - case 0xd802: { - DrvBgScrollY = d; - return; - } - - case 0xd803: { - DrvBg2ScrollX[0] = d; - return; - } - - case 0xd804: { - DrvBg2ScrollX[1] = d; - return; - } - - case 0xd806: { - DrvBg1On = d & 0x10; - DrvBg2On = d & 0x20; - DrvSpritesOn = d & 0x40; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Drv1943PortRead1(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall Drv1943PortWrite1(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Drv1943Read2(UINT16 a) -{ - switch (a) { - case 0xc800: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Drv1943Write2(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0xe001: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xe002: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0xe003: { - BurnYM2203Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Drv1943PortRead2(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall Drv1943PortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[2] = { 4, 0 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 8, 9, 10, 11 }; -static INT32 CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 Bg2TilePlaneOffsets[4] = { 0x40004, 0x40000, 4, 0 }; -static INT32 BgTilePlaneOffsets[4] = { 0x100004, 0x100000, 4, 0 }; -static INT32 TileXOffsets[32] = { 0, 1, 2, 3, 8, 9, 10, 11, 512, 513, 514, 515, 520, 521, 522, 523, 1024, 1025, 1026, 1027, 1032, 1033, 1034, 1035, 1536, 1537, 1538, 1539, 1544, 1545, 1546, 1547 }; -static INT32 TileYOffsets[32] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, 496 }; -static INT32 SpritePlaneOffsets[4] = { 0x100004, 0x100000, 4, 0 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 8, 9, 10, 11, 256, 257, 258, 259, 264, 265, 266, 267 }; -static INT32 SpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 3000000); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3000000; -} - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x40000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x20000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 4, 1); if (nRet != 0) return 1; - GfxDecode(2048, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg2 tiles - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 14, 1); if (nRet != 0) return 1; - GfxDecode(128, 4, 32, 32, Bg2TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x800, DrvTempRom, DrvBg2Tiles); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 12, 1); if (nRet != 0) return 1; - GfxDecode(512, 4, 32, 32, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x800, DrvTempRom, DrvBgTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 22, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the Tilemaps - nRet = BurnLoadRom(DrvBgTilemap, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvBg2Tilemap, 24, 1); if (nRet != 0) return 1; - - // Load the PROMs - nRet = BurnLoadRom(DrvPromRed, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromGreen, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBlue, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromCharLookup, 28, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBgLookup, 29, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBgPalBank, 30, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBg2Lookup, 31, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBg2PalBank, 32, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpriteLookup, 33, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpritePalBank, 34, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Drv1943Read1); - ZetSetWriteHandler(Drv1943Write1); - ZetSetInHandler(Drv1943PortRead1); - ZetSetOutHandler(Drv1943PortWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xd000, 0xd3ff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 2, DrvVideoRam ); - ZetMapArea(0xd400, 0xd7ff, 0, DrvPaletteRam ); - ZetMapArea(0xd400, 0xd7ff, 1, DrvPaletteRam ); - ZetMapArea(0xd400, 0xd7ff, 2, DrvPaletteRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram1 ); - ZetMapArea(0xf000, 0xffff, 0, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 1, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 2, DrvSpriteRam ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(Drv1943Read2); - ZetSetWriteHandler(Drv1943Write2); - ZetSetInHandler(Drv1943PortRead2); - ZetSetOutHandler(Drv1943PortWrite2); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom2 ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvbInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x40000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x20000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 4, 1); if (nRet != 0) return 1; - GfxDecode(2048, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg2 tiles - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - GfxDecode(128, 4, 32, 32, Bg2TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x800, DrvTempRom, DrvBg2Tiles); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 8, 1); if (nRet != 0) return 1; - GfxDecode(512, 4, 32, 32, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x800, DrvTempRom, DrvBgTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 18, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the Tilemaps - nRet = BurnLoadRom(DrvBgTilemap, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvBg2Tilemap, 20, 1); if (nRet != 0) return 1; - - // Load the PROMs - nRet = BurnLoadRom(DrvPromRed, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromGreen, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBlue, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromCharLookup, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBgLookup, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBgPalBank, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBg2Lookup, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBg2PalBank, 28, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpriteLookup, 29, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpritePalBank, 30, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Drvb1943Read1); - ZetSetWriteHandler(Drv1943Write1); - ZetSetInHandler(Drv1943PortRead1); - ZetSetOutHandler(Drv1943PortWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xd000, 0xd3ff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 2, DrvVideoRam ); - ZetMapArea(0xd400, 0xd7ff, 0, DrvPaletteRam ); - ZetMapArea(0xd400, 0xd7ff, 1, DrvPaletteRam ); - ZetMapArea(0xd400, 0xd7ff, 2, DrvPaletteRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram1 ); - ZetMapArea(0xf000, 0xffff, 0, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 1, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 2, DrvSpriteRam ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(Drv1943Read2); - ZetSetWriteHandler(Drv1943Write2); - ZetSetInHandler(Drv1943PortRead2); - ZetSetOutHandler(Drv1943PortWrite2); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom2 ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvbjInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x40000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x20000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 4, 1); if (nRet != 0) return 1; - GfxDecode(2048, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg2 tiles - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - GfxDecode(128, 4, 32, 32, Bg2TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x800, DrvTempRom, DrvBg2Tiles); - - // Load and decode the bg tiles - - //{ "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - //{ "bm16.11f", 0x08000, 0x23c908c2, BRF_GRA }, // 6 - //{ "bm17.12f", 0x08000, 0x46bcdd07, BRF_GRA }, // 7 - //{ "bm18.14f", 0x08000, 0xe6ae7ba0, BRF_GRA }, // 8 - //{ "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - //{ "bm20.11j", 0x08000, 0x0917e5d4, BRF_GRA }, // 10 - //{ "bm21.12j", 0x08000, 0x9bfb0d89, BRF_GRA }, // 11 - //{ "bm22.14j", 0x08000, 0x04f3c274, BRF_GRA }, // 12 - - // 0x00000, 0x10000 - // 0x08000, 0x18000 - // 0x20000, 0x30000 - // 0x28000, 0x38000 - - memset(DrvTempRom, 0, 0x40000); - UINT8 *pTemp = (UINT8*)BurnMalloc(0x40000); - nRet = BurnLoadRom(pTemp + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x10000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x20000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x30000, 8, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x00000, pTemp + 0x00000, 0x8000); - memcpy(DrvTempRom + 0x10000, pTemp + 0x08000, 0x8000); - memcpy(DrvTempRom + 0x08000, pTemp + 0x10000, 0x8000); - memcpy(DrvTempRom + 0x18000, pTemp + 0x18000, 0x8000); - memcpy(DrvTempRom + 0x20000, pTemp + 0x20000, 0x8000); - memcpy(DrvTempRom + 0x30000, pTemp + 0x28000, 0x8000); - memcpy(DrvTempRom + 0x28000, pTemp + 0x30000, 0x8000); - memcpy(DrvTempRom + 0x38000, pTemp + 0x38000, 0x8000); - BurnFree(pTemp); - GfxDecode(512, 4, 32, 32, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x800, DrvTempRom, DrvBgTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 18, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the Tilemaps - nRet = BurnLoadRom(DrvBgTilemap, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom, 20, 1); if (nRet != 0) return 1; - memcpy(DrvBg2Tilemap + 0x6000, DrvTempRom + 0x0000, 0x2000); - memcpy(DrvBg2Tilemap + 0x4000, DrvTempRom + 0x2000, 0x2000); - memcpy(DrvBg2Tilemap + 0x2000, DrvTempRom + 0x4000, 0x2000); - memcpy(DrvBg2Tilemap + 0x0000, DrvTempRom + 0x6000, 0x2000); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromRed, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromGreen, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBlue, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromCharLookup, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBgLookup, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBgPalBank, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBg2Lookup, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBg2PalBank, 28, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpriteLookup, 29, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpritePalBank, 30, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Drvb1943Read1); - ZetSetWriteHandler(Drv1943Write1); - ZetSetInHandler(Drv1943PortRead1); - ZetSetOutHandler(Drv1943PortWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xd000, 0xd3ff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 2, DrvVideoRam ); - ZetMapArea(0xd400, 0xd7ff, 0, DrvPaletteRam ); - ZetMapArea(0xd400, 0xd7ff, 1, DrvPaletteRam ); - ZetMapArea(0xd400, 0xd7ff, 2, DrvPaletteRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram1 ); - ZetMapArea(0xf000, 0xffff, 0, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 1, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 2, DrvSpriteRam ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(Drv1943Read2); - ZetSetWriteHandler(Drv1943Write2); - ZetSetInHandler(Drv1943PortRead2); - ZetSetOutHandler(Drv1943PortWrite2); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom2 ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 Drvb2Init() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x40000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x20000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 4, 1); if (nRet != 0) return 1; - GfxDecode(2048, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg2 tiles - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - GfxDecode(128, 4, 32, 32, Bg2TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x800, DrvTempRom, DrvBg2Tiles); - - // Load and decode the bg tiles - - //{ "bm15.10f", 0x08000, 0x6b1a0443, BRF_GRA }, // 5 BG Tiles - //{ "bm16.11f", 0x08000, 0x23c908c2, BRF_GRA }, // 6 - //{ "bm17.12f", 0x08000, 0x46bcdd07, BRF_GRA }, // 7 - //{ "bm18.14f", 0x08000, 0xe6ae7ba0, BRF_GRA }, // 8 - //{ "bm19.10j", 0x08000, 0x868ababc, BRF_GRA }, // 9 - //{ "bm20.11j", 0x08000, 0x0917e5d4, BRF_GRA }, // 10 - //{ "bm21.12j", 0x08000, 0x9bfb0d89, BRF_GRA }, // 11 - //{ "bm22.14j", 0x08000, 0x04f3c274, BRF_GRA }, // 12 - - // 0x00000, 0x10000 - // 0x08000, 0x18000 - // 0x20000, 0x30000 - // 0x28000, 0x38000 - - memset(DrvTempRom, 0, 0x40000); - UINT8 *pTemp = (UINT8*)BurnMalloc(0x40000); - nRet = BurnLoadRom(pTemp + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x10000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x20000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(pTemp + 0x30000, 8, 1); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x00000, pTemp + 0x00000, 0x8000); - memcpy(DrvTempRom + 0x10000, pTemp + 0x08000, 0x8000); - memcpy(DrvTempRom + 0x08000, pTemp + 0x10000, 0x8000); - memcpy(DrvTempRom + 0x18000, pTemp + 0x18000, 0x8000); - memcpy(DrvTempRom + 0x20000, pTemp + 0x20000, 0x8000); - memcpy(DrvTempRom + 0x30000, pTemp + 0x28000, 0x8000); - memcpy(DrvTempRom + 0x28000, pTemp + 0x30000, 0x8000); - memcpy(DrvTempRom + 0x38000, pTemp + 0x38000, 0x8000); - BurnFree(pTemp); - GfxDecode(512, 4, 32, 32, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x800, DrvTempRom, DrvBgTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x40000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 16, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the Tilemaps - nRet = BurnLoadRom(DrvBgTilemap, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom, 18, 1); if (nRet != 0) return 1; - memcpy(DrvBg2Tilemap + 0x6000, DrvTempRom + 0x0000, 0x2000); - memcpy(DrvBg2Tilemap + 0x4000, DrvTempRom + 0x2000, 0x2000); - memcpy(DrvBg2Tilemap + 0x2000, DrvTempRom + 0x4000, 0x2000); - memcpy(DrvBg2Tilemap + 0x0000, DrvTempRom + 0x6000, 0x2000); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromRed, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromGreen, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBlue, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromCharLookup, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBgLookup, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBgPalBank, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBg2Lookup, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBg2PalBank, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpriteLookup, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpritePalBank, 28, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Drvb1943Read1); - ZetSetWriteHandler(Drv1943Write1); - ZetSetInHandler(Drv1943PortRead1); - ZetSetOutHandler(Drv1943PortWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xd000, 0xd3ff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 2, DrvVideoRam ); - ZetMapArea(0xd400, 0xd7ff, 0, DrvPaletteRam ); - ZetMapArea(0xd400, 0xd7ff, 1, DrvPaletteRam ); - ZetMapArea(0xd400, 0xd7ff, 2, DrvPaletteRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram1 ); - ZetMapArea(0xf000, 0xffff, 0, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 1, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 2, DrvSpriteRam ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(Drv1943Read2); - ZetSetWriteHandler(Drv1943Write2); - ZetSetInHandler(Drv1943PortRead2); - ZetSetOutHandler(Drv1943PortWrite2); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom2 ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - BurnYM2203Exit(); - - GenericTilesExit(); - - DrvRomBank = 0; - DrvSoundLatch = 0; - DrvBg2ScrollX[0] = 0; - DrvBg2ScrollX[1] = 0; - DrvBgScrollX[0] = 0; - DrvBgScrollX[1] = 0; - DrvBgScrollY = 0; - DrvBg2On = 0; - DrvBg1On = 0; - DrvSpritesOn = 0; - DrvCharsOn = 0; - DrvProtValue = 0; - - BurnFree(Mem); - - return 0; -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT32 Palette[256]; - - for (i = 0; i < 256; i++) { - INT32 bit0, bit1, bit2, bit3, r, g, b; - - bit0 = (DrvPromRed[i] >> 0) & 0x01; - bit1 = (DrvPromRed[i] >> 1) & 0x01; - bit2 = (DrvPromRed[i] >> 2) & 0x01; - bit3 = (DrvPromRed[i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvPromGreen[i] >> 0) & 0x01; - bit1 = (DrvPromGreen[i] >> 1) & 0x01; - bit2 = (DrvPromGreen[i] >> 2) & 0x01; - bit3 = (DrvPromGreen[i] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvPromBlue[i] >> 0) & 0x01; - bit1 = (DrvPromBlue[i] >> 1) & 0x01; - bit2 = (DrvPromBlue[i] >> 2) & 0x01; - bit3 = (DrvPromBlue[i] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - Palette[i] = BurnHighCol(r, g, b, 0); - } - - for (i = 0; i < 0x80; i++) { - DrvPalette[i] = Palette[(DrvPromCharLookup[i] & 0x0f) | 0x40]; - } - - for (i = 0x80; i < 0x180; i++) { - DrvPalette[i] = Palette[((DrvPromBgPalBank[i - 0x80] & 0x03) << 4) | (DrvPromBgLookup[i - 0x80] & 0x0f)]; - } - - for (i = 0x180; i < 0x280; i++) { - DrvPalette[i] = Palette[((DrvPromBg2PalBank[i - 0x180] & 0x03) << 4) | (DrvPromBg2Lookup[i - 0x180] & 0x0f)]; - } - - for (i = 0x280; i < 0x380; i++) { - DrvPalette[i] = Palette[((DrvPromSpritePalBank[i - 0x280] & 0x07) << 4) | (DrvPromSpriteLookup[i - 0x280] & 0x0f) | 0x80]; - } -} - -static void DrvRenderBg2Layer() -{ - INT32 mx, my, Offs, Attr, Code, Colour, x, y, TileIndex, xScroll, Flip, xFlip, yFlip; - - xFlip = 0; - yFlip = 0; - - xScroll = DrvBg2ScrollX[0] + (256 * DrvBg2ScrollX[1]); - - for (mx = 0; mx < 8; mx++) { - for (my = 0; my < 2048; my++) { - TileIndex = (my * 8) + mx; - - Offs = TileIndex * 2; - Attr = DrvBg2Tilemap[Offs + 1]; - Code = DrvBg2Tilemap[Offs] & 0x7f; - Colour = ((Attr & 0x3c) >> 2) + 0x18; - Flip = (Attr & 0xc0) >> 6; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - y = 32 * mx; - x = 32 * my; - - x -= xScroll; - y -= 16; - - if (x < -31) x += 65536; - - if (x > 256) continue; - if (y > 240) continue; - - if (x > 0 && x < 224 && y > 0 && y < 192) { - if (xFlip) { - if (yFlip) { - Render32x32Tile_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, DrvBg2Tiles); - } else { - Render32x32Tile_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, DrvBg2Tiles); - } - } else { - if (yFlip) { - Render32x32Tile_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, DrvBg2Tiles); - } else { - Render32x32Tile(pTransDraw, Code, x, y, Colour, 4, 0, DrvBg2Tiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render32x32Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, DrvBg2Tiles); - } else { - Render32x32Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, DrvBg2Tiles); - } - } else { - if (yFlip) { - Render32x32Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, DrvBg2Tiles); - } else { - Render32x32Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0, DrvBg2Tiles); - } - } - } - } - } -} - -static void DrvRenderBgLayer() -{ - INT32 mx, my, Offs, Attr, Code, Colour, x, y, TileIndex, xScroll, yScroll, Flip, xFlip, yFlip; - - xFlip = 0; - yFlip = 0; - - yScroll = (DrvBgScrollY + 16) & 0xff; - xScroll = DrvBgScrollX[0] + (256 * DrvBgScrollX[1]); - - for (mx = 0; mx < 8; mx++) { - for (my = 0; my < 2048; my++) { - TileIndex = (my * 8) + mx; - - Offs = TileIndex * 2; - Attr = DrvBgTilemap[Offs + 1]; - Code = DrvBgTilemap[Offs] + ((Attr & 0x01) << 8); - Colour = ((Attr & 0x3c) >> 2) + 0x08; - Flip = (Attr & 0xc0) >> 6; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - y = 32 * mx; - x = 32 * my; - - x -= xScroll; - y -= yScroll; - - if (x < -31) x += 65536; - if (y < -31) y += 256; - - if (x > 256) continue; - if (y > 240) continue; - - if (x > 0 && x < 224 && y > 0 && y < 192) { - if (xFlip) { - if (yFlip) { - Render32x32Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvBgTiles); - } else { - Render32x32Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvBgTiles); - } - } else { - if (yFlip) { - Render32x32Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvBgTiles); - } else { - Render32x32Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvBgTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvBgTiles); - } else { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvBgTiles); - } - } else { - if (yFlip) { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvBgTiles); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvBgTiles); - } - } - } - } - } -} - -static void DrvRenderSprites(INT32 Priority) -{ - INT32 Offs; - - for (Offs = 0x1000 - 32; Offs >= 0; Offs -= 32) { - INT32 Attr = DrvSpriteRam[Offs + 1]; - INT32 Code = DrvSpriteRam[Offs + 0] + ((Attr & 0xe0) << 3); - INT32 Colour = Attr & 0x0f; - INT32 sx = DrvSpriteRam[Offs + 3] - ((Attr & 0x10) << 4); - INT32 sy = DrvSpriteRam[Offs + 2]; - - sy -= 16; - - if (Priority) { - if (Colour != 0x0a && Colour != 0x0b) { - if (sx > 0 && sx < 240 && sy > 0 && sy < 208) { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour + 0x28, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour + 0x28, 4, 0, 0, DrvSprites); - } - } - } else { - if (Colour == 0x0a || Colour == 0x0b) { - if (sx > 0 && sx < 240 && sy > 0 && sy < 208) { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour + 0x28, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour + 0x28, 4, 0, 0, DrvSprites); - } - } - - } - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Attr = DrvPaletteRam[TileIndex]; - Code = DrvVideoRam[TileIndex] + ((Attr & 0xe0) << 3); - Colour = Attr & 0x1f; - - x = 8 * mx; - y = 8 * my; - - y -= 16; - - if (x > 0 && x < 248 && y > 0 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 2, 0, 0, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, DrvChars); - } - - TileIndex++; - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - if (DrvBg2On && nBurnLayer & 1) DrvRenderBg2Layer(); - if (DrvSpritesOn) DrvRenderSprites(0); - if (DrvBg1On && nBurnLayer & 2) DrvRenderBgLayer(); - if (DrvSpritesOn) DrvRenderSprites(1); - if (DrvCharsOn && nBurnLayer & 4) DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 100; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 6000000 / 60; - nCyclesTotal[1] = 3000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 95) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == 96) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - if (i == 20 || i == 40 || i == 60 || i == 80) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == 21 || i == 41 || i == 61 || i == 81) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - ZetClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - ZetOpen(1); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029672; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvRomBank); - SCAN_VAR(DrvBg2ScrollX[0]); - SCAN_VAR(DrvBg2ScrollX[1]); - SCAN_VAR(DrvBgScrollX[0]); - SCAN_VAR(DrvBgScrollX[1]); - SCAN_VAR(DrvBgScrollY); - SCAN_VAR(DrvBg2On); - SCAN_VAR(DrvBg1On); - SCAN_VAR(DrvSpritesOn); - SCAN_VAR(DrvCharsOn); - SCAN_VAR(DrvProtValue); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + DrvRomBank * 0x1000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + DrvRomBank * 0x1000 ); - ZetClose(); - } - - return 0; -} - -struct BurnDriver BurnDrvNineteen43 = { - "1943", NULL, NULL, NULL, "1987", - "1943: The Battle of Midway (Euro)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43u = { - "1943u", "1943", NULL, NULL, "1987", - "1943: The Battle of Midway (US, Rev C)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvuRomInfo, DrvuRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43ua = { - "1943ua", "1943", NULL, NULL, "1987", - "1943: The Battle of Midway (US)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvuaRomInfo, DrvuaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43j = { - "1943j", "1943", NULL, NULL, "1987", - "1943: Midway Kaisen (Japan, Rev B)\0", NULL, "Capcom", "Miscellaneous", - L"1943: \u30DF\u30C3\u30C9\u30A6\u30A7\u30A4\u6D77\u6226 (Japan, Rev B)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvjRomInfo, DrvjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43ja = { - "1943ja", "1943", NULL, NULL, "1987", - "1943: Midway Kaisen (Japan)\0", NULL, "Capcom", "Miscellaneous", - L"1943: \u30DF\u30C3\u30C9\u30A6\u30A7\u30A4\u6D77\u6226 (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvjaRomInfo, DrvjaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43ja2 = { - "1943ja2", "1943", NULL, NULL, "1987", - "1943: The Battle of Midway (hack of Japan set)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, Drvja2RomInfo, Drvja2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43b = { - "1943b", "1943", NULL, NULL, "1987", - "1943: The Battle of Midway (bootleg set 1, hack of Japan set)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvbRomInfo, DrvbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvbInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43b2 = { - "1943b2", "1943", NULL, NULL, "1987", - "1943: The Battle of Midway (bootleg set 2, hack of Japan set)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, Drvb2RomInfo, Drvb2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - Drvb2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43bj = { - "1943bj", "1943", NULL, NULL, "1987", - "1943: Midway Kaisen (bootleg)\0", NULL, "bootleg", "Miscellaneous", - L"1943: \u30DF\u30C3\u30C9\u30A6\u30A7\u30A4\u6D77\u6226 (bootleg)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvbjRomInfo, DrvbjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvbjInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43kai = { - "1943kai", NULL, NULL, NULL, "1987", - "1943 Kai: Midway Kaisen (Japan)\0", NULL, "Capcom", "Miscellaneous", - L"1943 \u6539: \u30DF\u30C3\u30C9\u30A6\u30A7\u30A4\u6D77\u6226 (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvkaiRomInfo, DrvkaiRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNineteen43mii = { - "1943mii", NULL, NULL, NULL, "1988", - "1943: The Battle of Midway Mark II (US)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvmiiRomInfo, DrvmiiRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x380, 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_4enraya.cpp b/jan/src/burn/drv/pre90s/d_4enraya.cpp deleted file mode 100644 index 3df7cd9d4..000000000 --- a/jan/src/burn/drv/pre90s/d_4enraya.cpp +++ /dev/null @@ -1,546 +0,0 @@ -// FB Alpha 4 Enraya driver module -// Based on MAME driver by Tomasz Slanina - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static UINT8 *soundlatch; -static UINT8 *soundcontrol; -static UINT32 sound_bit; - -static struct BurnInputInfo Enraya4InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 6, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 5, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Enraya4) - -static struct BurnInputInfo UnkpacgInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"Coin 3", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 1, "dips" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 0, "dips" }, -}; - -STDINPUTINFO(Unkpacg) - -static struct BurnDIPInfo Enraya4DIPList[]= -{ - {0x0d, 0xff, 0xff, 0xfd, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0d, 0x01, 0x01, 0x01, "Easy" }, - {0x0d, 0x01, 0x01, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0d, 0x01, 0x02, 0x02, "Off" }, - {0x0d, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Pieces" }, - {0x0d, 0x01, 0x04, 0x04, "30" }, - {0x0d, 0x01, 0x04, 0x00, "16" }, - - {0 , 0xfe, 0 , 2, "Speed" }, - {0x0d, 0x01, 0x08, 0x08, "Slow" }, - {0x0d, 0x01, 0x08, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0x30, 0x10, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0x30, 0x20, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, -}; - -STDDIPINFO(Enraya4) - -static struct BurnDIPInfo UnkpacgDIPList[]= -{ - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "DIP8" }, - {0x09, 0x01, 0x80, 0x00, "Off" }, - {0x09, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "0-0" }, - {0x0a, 0x01, 0x01, 0x00, "Off" }, - {0x0a, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "0-1" }, - {0x0a, 0x01, 0x02, 0x00, "Off" }, - {0x0a, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "0-2" }, - {0x0a, 0x01, 0x04, 0x00, "Off" }, - {0x0a, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "0-3" }, - {0x0a, 0x01, 0x08, 0x00, "Off" }, - {0x0a, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "0-4" }, - {0x0a, 0x01, 0x10, 0x00, "Off" }, - {0x0a, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "0-5" }, - {0x0a, 0x01, 0x20, 0x00, "Off" }, - {0x0a, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "0-6" }, - {0x0a, 0x01, 0x40, 0x00, "Off" }, - {0x0a, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "0-7" }, - {0x0a, 0x01, 0x80, 0x00, "Off" }, - {0x0a, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Unkpacg) - -void __fastcall enraya4_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xd000 || (address & 0xf000) == 0x7000) { - DrvVidRAM[((address & 0x3ff) << 1) + 0] = data; - DrvVidRAM[((address & 0x3ff) << 1) + 1] = (address >> 10) & 3; - - return; - } -} - -static void sound_control(UINT8 data) -{ - if ((*soundcontrol & sound_bit) == sound_bit && (data & sound_bit) == 0) { - AY8910Write(0, ~*soundcontrol & 1, *soundlatch); - } - - *soundcontrol = data; -} - -void __fastcall enraya4_out_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x20: - case 0x23: - *soundlatch = data; - break; - - case 0x30: - case 0x33: - sound_control(data); - break; - } -} - -UINT8 __fastcall enraya4_in_port(UINT16 port) -{ - static UINT8 nRet = 0; - - switch (port & 0xff) - { - case 0x00: - return DrvDips[0]; - - case 0x01: - return DrvInputs[0]; - - case 0x02: - return DrvInputs[1]; - } - - return nRet; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x00c000; - - DrvGfxROM = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x0008 * sizeof(UINT32); - - DrvNVRAM = Next; Next += 0x001000; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - soundcontrol = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 8; i++) { - DrvPalette[i] = BurnHighCol((i & 1) * 0xff, ((i & 2)/2) * 0xff, ((i & 4)/4) * 0xff, 0); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { 0x10000, 0x20000, 0x00000 }; - INT32 XOffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM, 0x6000); - - GfxDecode(0x0400, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM); - - BurnFree(tmp); - - return 0; -} - -static void DrvPrgDecode() -{ - for (INT32 i = 0x8000; i < 0xa000; i++) { - DrvZ80ROM[i] = (DrvZ80ROM[i] & 0xfc) | ((DrvZ80ROM[i] & 0x02) >> 1) | ((DrvZ80ROM[i] & 0x01) << 1); - } -} - -static INT32 DrvInit(INT32 game, INT32 sbit) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1); - BurnLoadRom(DrvZ80ROM + 0x08000, 1, 1); - - BurnLoadRom(DrvGfxROM + 0x00000, 2, 1); - BurnLoadRom(DrvGfxROM + 0x02000, 3, 1); - BurnLoadRom(DrvGfxROM + 0x04000, 4, 1); - - if (game) DrvPrgDecode(); - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - - if (game == 0) // 4enraya - { - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xcfff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xcfff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xcfff, 2, DrvZ80RAM); - // ZetMapArea(0xd000, 0xdfff, 1, DrvVidRAM); - } - else // unkpacg - { - ZetMapArea(0x0000, 0x1fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x1fff, 2, DrvZ80ROM); - ZetMapArea(0x6000, 0x6fff, 0, DrvNVRAM); - ZetMapArea(0x6000, 0x6fff, 1, DrvNVRAM); - ZetMapArea(0x6000, 0x6fff, 2, DrvNVRAM); - // ZetMapArea(0xd000, 0xdfff, 1, DrvVidRAM); - ZetMapArea(0x8000, 0x9fff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0x9fff, 2, DrvZ80ROM + 0x8000); - } - - ZetSetOutHandler(enraya4_out_port); - ZetSetInHandler(enraya4_in_port); - ZetSetWriteHandler(enraya4_write); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - sound_bit = sbit; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - - BurnFree(AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 offs = 0x40; offs < 0x3c0; offs++) { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 code = DrvVidRAM[(offs << 1) + 0] | (DrvVidRAM[(offs << 1) + 1] << 8); - - Render8x8Tile(pTransDraw, code, sx, sy - 16, 0, 0, 0, DrvGfxROM); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = DrvDips[1]; - DrvInputs[1] = 0xff; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 4; - INT32 nCyclesTotal = 4000000 / 60; - INT32 nCyclesDone = 0; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal / nInterleave; - - nCyclesDone += ZetRun(nSegment); - - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNVRAM; - ba.nLen = 0x01000; - ba.nAddress = 0; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - return 0; -} - - -// 4 En Raya (set 1) - -static struct BurnRomInfo enraya4RomDesc[] = { - { "5.bin", 0x8000, 0xcf1cd151, BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "4.bin", 0x4000, 0xf9ec1be7, BRF_ESS | BRF_PRG }, // 1 - - { "1.bin", 0x2000, 0x0e5072fd, BRF_GRA }, // 2 Graphics - { "2.bin", 0x2000, 0x2b0a3793, BRF_GRA }, // 3 - { "3.bin", 0x2000, 0xf6940836, BRF_GRA }, // 4 - - { "1.bpr", 0x0020, 0xdcbd2352, BRF_GRA }, // 5 Address control prom - not used -}; - -STD_ROM_PICK(enraya4) -STD_ROM_FN(enraya4) - -static INT32 enraya4Init() -{ - return DrvInit(0, 4); -} - -struct BurnDriver BurnDrvEnraya4 = { - "4enraya", NULL, NULL, NULL, "1990", - "4 En Raya (set 1)\0", NULL, "IDSA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, enraya4RomInfo, enraya4RomName, NULL, NULL, Enraya4InputInfo, Enraya4DIPInfo, - enraya4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8, - 256, 224, 4, 3 -}; - - -// 4 En Raya (set 2) - -static struct BurnRomInfo enrayaa4RomDesc[] = { - { "5.bin", 0x8000, 0x76e8656c, BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "4.bin", 0x4000, 0xf9ec1be7, BRF_ESS | BRF_PRG }, // 1 - - { "1.bin", 0x2000, 0x0e5072fd, BRF_GRA }, // 2 Graphics - { "2.bin", 0x2000, 0x2b0a3793, BRF_GRA }, // 3 - { "3.bin", 0x2000, 0xf6940836, BRF_GRA }, // 4 - - { "1.bpr", 0x0020, 0xdcbd2352, BRF_GRA }, // 5 Address control prom - not used -}; - -STD_ROM_PICK(enrayaa4) -STD_ROM_FN(enrayaa4) - -struct BurnDriver BurnDrvEnrayaa4 = { - "4enrayaa", "4enraya", NULL, NULL, "1990", - "4 En Raya (set 2)\0", NULL, "IDSA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, enrayaa4RomInfo, enrayaa4RomName, NULL, NULL, Enraya4InputInfo, Enraya4DIPInfo, - enraya4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8, - 256, 224, 4, 3 -}; - - -// unknown Pac-Man gambling game - -static struct BurnRomInfo unkpacgRomDesc[] = { - { "1.u14", 0x2000, 0x848c4143, BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "2.u46", 0x2000, 0x9e6e0bd3, BRF_ESS | BRF_PRG }, // 1 - - { "3.u20", 0x2000, 0xd00b04ea, BRF_GRA }, // 2 Graphics - { "4.u19", 0x2000, 0x4a123a3d, BRF_GRA }, // 3 - { "5.u18", 0x2000, 0x44f272d2, BRF_GRA }, // 4 -}; - -STD_ROM_PICK(unkpacg) -STD_ROM_FN(unkpacg) - -static INT32 unkpacgInit() -{ - return DrvInit(1, 2); -} - -struct BurnDriver BurnDrvUnkpacg = { - "unkpacg", NULL, NULL, NULL, "199?", - "unknown Pac-Man gambling game\0", NULL, "unknown", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, unkpacgRomInfo, unkpacgRomName, NULL, NULL, UnkpacgInputInfo, UnkpacgDIPInfo, - unkpacgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_aeroboto.cpp b/jan/src/burn/drv/pre90s/d_aeroboto.cpp deleted file mode 100644 index 18ef44f11..000000000 --- a/jan/src/burn/drv/pre90s/d_aeroboto.cpp +++ /dev/null @@ -1,751 +0,0 @@ -// FB Alpha Formation Z driver module -// Based on MAME driver by Carlos A. Lozano - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvM6809RAM0; -static UINT8 *DrvM6809RAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvScrRAM; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[9]; - -static UINT8 *soundlatch; -static UINT8 counter201; -static UINT8 disable_irq; -static UINT8 starx; -static UINT8 stary; -static UINT8 scrolly; -static UINT8 bgcolor; -static UINT8 coin_timer; -static UINT8 flipscreen; -static UINT8 characterbank; -static UINT8 stardisable; -static INT32 m_sx, m_sy, m_ox, m_oy; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static struct BurnInputInfo FormatzInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 3, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 4, "dip" }, -}; - -STDINPUTINFO(Formatz) - -static struct BurnDIPInfo FormatzDIPList[]= -{ - {0x10, 0xff, 0xff, 0x6c, NULL }, - {0x11, 0xff, 0xff, 0x08, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x00, "3" }, - {0x10, 0x01, 0x03, 0x01, "4" }, - {0x10, 0x01, 0x03, 0x02, "5" }, - {0x10, 0x01, 0x03, 0x03, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x0c, 0x0c, "30000" }, - {0x10, 0x01, 0x0c, 0x08, "40000" }, - {0x10, 0x01, 0x0c, 0x04, "70000" }, - {0x10, 0x01, 0x0c, 0x00, "100000" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x20, 0x00, "Off" }, - {0x10, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x40, 0x40, "Upright" }, - {0x10, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x07, 0x07, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x05, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x18, 0x00, "Easy" }, - {0x11, 0x01, 0x18, 0x08, "Normal" }, - {0x11, 0x01, 0x18, 0x10, "Medium" }, - {0x11, 0x01, 0x18, 0x18, "Hard" }, -}; - -STDDIPINFO(Formatz) - -static UINT8 aeroboto_main_read(UINT16 address) -{ - switch (address) - { - case 0x2973: - DrvM6809RAM0[0x02be] = 0; - return 0xff; - - case 0x3000: - return DrvInputs[flipscreen]; - - case 0x3001: - return (DrvInputs[2] & 0x80) | (DrvInputs[3] & 0x7f); - - case 0x3002: - return DrvInputs[4]; - - case 0x3004: - return (0x031b9fff >> (((counter201 - 1) & 3) * 8)) & 0xff; - - case 0x3800: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return 0xff; - } - - return 0; -} - -static void aeroboto_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff00) == 0x0100) - { - if (address == 0x01a2) - { - disable_irq = 1; - } - - DrvM6809RAM0[address] = data; - return; - } - - if (address < 0x3000) return; // 0x900, 0x1800, 0x2000 - - switch (address) - { - case 0x3000: - flipscreen = data & 0x01; - characterbank = (data & 0x02) >> 1; - stardisable = data & 0x04; - return; - - case 0x3001: - soundlatch[0] = data; - return; - - case 0x3002: - soundlatch[1] = data; - return; - - case 0x3003: - scrolly = data; - return; - - case 0x3004: - starx = data; - return; - - case 0x3005: - stary = data; - return; - - case 0x3006: - bgcolor = data * 4; - return; - } -} - -static void aeroboto_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - case 0x9001: - case 0xa000: - case 0xa001: - AY8910Write((address / 0x2000) & 1, address & 1, data); - return; - } -} - -static UINT8 aeroboto_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9002: - case 0xa002: - return AY8910Read((address / 0x2000) & 1); - } - - return 0; -} - -static UINT8 aeroboto_AY8910_0_portA(UINT32) -{ - return soundlatch[0]; -} - -static UINT8 aeroboto_AY8910_0_portB(UINT32) -{ - return soundlatch[1]; -} - -static INT32 DrvDoReset() -{ - memset(AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - M6809Close(); - - AY8910Reset(0); - AY8910Reset(1); - - counter201 = 0; - disable_irq = 0; - starx = 0; - stary = 0; - scrolly = 0; - bgcolor = 0; - coin_timer = 0; - flipscreen = 0; - characterbank = 0; - stardisable = 0; - m_sx = m_sy = m_ox = m_oy = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x010000; - DrvM6809ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x002000; - DrvGfxROM2 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM0 = Next; Next += 0x000900; - DrvM6809RAM1 = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000100; - DrvColRAM = Next; Next += 0x000100; - DrvScrRAM = Next; Next += 0x000100; - DrvVidRAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000002; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - static INT32 Plane0[2] = { 4, 0 }; - static INT32 Plane1[3] = { 0x2000*8, 0x1000*8, 0 }; - static INT32 XOffs0[8] = { STEP4(0,1), STEP4((0x2000/2)*8,1) }; - static INT32 XOffs1[16] = { STEP8(0,1) }; - static INT32 YOffs[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8 *)BurnMalloc(0x3000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Plane0, XOffs0, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x2000); - - for (INT32 i = 0; i < 0x2000; i++) { - DrvGfxROM1[(i & ~0xff) + ((i << 5) & 0xe0) + ((i >> 3) & 0x1f)] = tmp[i]; - } - - memcpy (tmp, DrvGfxROM2, 0x3000); - - GfxDecode(0x0100, 3, 8, 16, Plane1, XOffs1, YOffs, 0x080, tmp, DrvGfxROM2); - - BurnFree (tmp); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x8000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0xc000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0xf000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x1000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x2000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 11, 1)) return 1; - - DrvGfxDecode(); - } - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvM6809RAM0, 0x0000, 0x00ff, MAP_RAM); - M6809MapMemory(DrvM6809RAM0 + 0x0100, 0x0100, 0x01ff, MAP_ROM); // handler - M6809MapMemory(DrvM6809RAM0 + 0x0200, 0x0200, 0x08ff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x1000, 0x17ff, MAP_RAM); - M6809MapMemory(DrvScrRAM, 0x1800, 0x18ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x2000, 0x20ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2800, 0x28ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0 + 0x4000, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(aeroboto_main_write); - M6809SetReadHandler(aeroboto_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809RAM1, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM1 + 0xf000, 0xf000, 0xffff, MAP_ROM); - M6809SetWriteHandler(aeroboto_sound_write); - M6809SetReadHandler(aeroboto_sound_read); - M6809Close(); - - AY8910Init(0, 1250000, nBurnSoundRate, &aeroboto_AY8910_0_portA, &aeroboto_AY8910_0_portB, NULL, NULL); - AY8910Init(1, 625000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x200] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x200] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x200] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x200] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_layer(INT32 miny, INT32 maxy, INT32 yscroll) -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sx -= DrvScrRAM[sy/8]; - if (sx < -7) sx += 256; - - sy -= yscroll; - if (sy < -7) sy += 512; - - INT32 code = DrvVidRAM[offs] + (characterbank * 256); - INT32 color = DrvColRAM[code&0xff] & 0x3f; - - INT32 category = (color >= 0x33) ? 0 : 0xff; - - if (sy < miny || sy >= maxy) continue; - - if (flipscreen) - { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, (248 - sx) - 8, (248 - sy) - 16, color, 2, category, 0, DrvGfxROM0); - } - else - { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 2, category, 0, DrvGfxROM0); - } - } -} - -static void draw_stars() // copied directly from MAME -{ -#define SCROLL_SPEED 1 - - INT32 sky_color = bgcolor, star_color = bgcolor; - - // the star field is supposed to be seen through tile pen 0 when active - if (!stardisable) - { - if (star_color < 0xd0) - { - star_color = 0xd0; - sky_color = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = sky_color; - } - - star_color += 2; - - // actual scroll speed is unknown but it can be adjusted by changing the SCROLL_SPEED constant - m_sx += (char)(starx - m_ox); - m_ox = starx; - INT32 x = m_sx / SCROLL_SPEED; - - if (scrolly != 0xff) - m_sy += (char)(stary - m_oy); - m_oy = stary; - INT32 y = m_sy / SCROLL_SPEED; - - UINT8 *src_base = DrvGfxROM1; - - for (INT32 i = 0; i < 248; i++) - { - INT32 src_offsx = (x + i) & 0xff; - INT32 src_colmask = 1 << (src_offsx & 7); - src_offsx >>= 3; - UINT8 *src_colptr = src_base + src_offsx; - INT32 pen = star_color + ((i + 8) >> 4 & 1); - - for (INT32 j = 16; j < 240; j++) - { - UINT8 *src_rowptr = src_colptr + (((y + j) & 0xff) << 5 ); - if (!((unsigned)*src_rowptr & src_colmask)) - pTransDraw[((j-16)*nScreenWidth)+i] = pen; - } - } - } - else - { - m_sx = m_ox = starx; - m_sy = m_oy = stary; - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = bgcolor; - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = 240 - DrvSprRAM[offs]; - - INT32 code = DrvSprRAM[offs + 1]; - INT32 color = DrvSprRAM[offs + 2] & 0x07; - - if (flipscreen) - { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 8, 16, code, (((248 - sx) + 8) & 0xff) - 8, (240 - sy) - 16, color, 3, 0, 0, DrvGfxROM2); - } - else - { - RenderCustomTile_Mask_Clip(pTransDraw, 8, 16, code, ((sx + 8) & 0xff) - 8, sy - 16, color, 3, 0, 0, DrvGfxROM2); - - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_stars(); - draw_layer(40, 255, scrolly); - draw_sprites(); - draw_layer(0, 39, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - INT32 coin_enable = 0; - if (coin_timer == 1) { - coin_enable = 1; - coin_timer = 0; - } else { - if ((DrvInputs[2] & 0x80) == 0) { - coin_timer = 1; - coin_enable = 1; - } - } - if (coin_enable) DrvInputs[2] &= ~0x80; - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 1250000 / 60, 1250000 / 2 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1)) - { - if (disable_irq == 0 || i & 1) - { - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - else - { - disable_irq = 0; - } - } - M6809Close(); - - M6809Open(1); - nCyclesDone[1] += M6809Run(nCyclesTotal[1] / nInterleave); - if (i == (nInterleave - 1)) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(counter201); - SCAN_VAR(disable_irq); - SCAN_VAR(starx); - SCAN_VAR(stary); - SCAN_VAR(scrolly); - SCAN_VAR(bgcolor); - SCAN_VAR(coin_timer); - SCAN_VAR(flipscreen); - SCAN_VAR(characterbank); - SCAN_VAR(stardisable); - SCAN_VAR(m_sx); - SCAN_VAR(m_sy); - SCAN_VAR(m_ox); - SCAN_VAR(m_oy); - } - - return 0; -} - - -// Formation Z - -static struct BurnRomInfo formatzRomDesc[] = { - { "format_z.8", 0x4000, 0x81a2416c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "format_z.7", 0x4000, 0x986e6052, 1 | BRF_PRG | BRF_ESS }, // 1 - { "format_z.6", 0x4000, 0xbaa0d745, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "format_z.9", 0x1000, 0x6b9215ad, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "format_z.5", 0x2000, 0xba50be57, 3 | BRF_GRA }, // 4 Background Tiles - - { "format_z.4", 0x2000, 0x910375a0, 4 | BRF_GRA }, // 5 Star Data - - { "format_z.1", 0x1000, 0x5739afd2, 5 | BRF_GRA }, // 6 Sprites - { "format_z.2", 0x1000, 0x3a821391, 5 | BRF_GRA }, // 7 - { "format_z.3", 0x1000, 0x7d1aec79, 5 | BRF_GRA }, // 8 - - { "10c", 0x0100, 0xb756dd6d, 6 | BRF_GRA }, // 9 Color PROMs - { "10b", 0x0100, 0x00df8809, 6 | BRF_GRA }, // 10 - { "10a", 0x0100, 0xe8733c8f, 6 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(formatz) -STD_ROM_FN(formatz) - -struct BurnDriver BurnDrvFormatz = { - "formatz", NULL, NULL, NULL, "1984", - "Formation Z\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, formatzRomInfo, formatzRomName, NULL, NULL, FormatzInputInfo, FormatzDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 248, 224, 4, 3 -}; - - -// Aeroboto - -static struct BurnRomInfo aerobotoRomDesc[] = { - { "aeroboto.8", 0x4000, 0x4d3fc049, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "aeroboto.7", 0x4000, 0x522f51c1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "aeroboto.6", 0x4000, 0x1a295ffb, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "format_z.9", 0x1000, 0x6b9215ad, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "aeroboto.5", 0x2000, 0x32fc00f9, 3 | BRF_GRA }, // 4 Background Tiles - - { "format_z.4", 0x2000, 0x910375a0, 4 | BRF_GRA }, // 5 Star Data - - { "aeroboto.1", 0x1000, 0x7820eeaf, 5 | BRF_GRA }, // 6 Sprites - { "aeroboto.2", 0x1000, 0xc7f81a3c, 5 | BRF_GRA }, // 7 - { "aeroboto.3", 0x1000, 0x5203ad04, 5 | BRF_GRA }, // 8 - - { "10c", 0x0100, 0xb756dd6d, 6 | BRF_GRA }, // 9 Color PROMs - { "10b", 0x0100, 0x00df8809, 6 | BRF_GRA }, // 10 - { "10a", 0x0100, 0xe8733c8f, 6 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(aeroboto) -STD_ROM_FN(aeroboto) - -struct BurnDriver BurnDrvAeroboto = { - "aeroboto", "formatz", NULL, NULL, "1984", - "Aeroboto\0", NULL, "Jaleco (Williams license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, aerobotoRomInfo, aerobotoRomName, NULL, NULL, FormatzInputInfo, FormatzDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 248, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_alinvade.cpp b/jan/src/burn/drv/pre90s/d_alinvade.cpp deleted file mode 100644 index 1804e4722..000000000 --- a/jan/src/burn/drv/pre90s/d_alinvade.cpp +++ /dev/null @@ -1,305 +0,0 @@ -// FB Alpha Alien Invaders driver module -// Based on MAME driver by David Haywood, Mariusz Wojcieszek - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv6502ROM; -static UINT8 *DrvProtPROM; -static UINT8 *Drv6502RAM; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 previrqmask; -static UINT8 irqmask; - -static UINT8 DrvJoy1[6]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; - -static struct BurnInputInfo AlinvadeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dips", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Alinvade) - -static struct BurnDIPInfo AlinvadeDIPList[]= -{ - {0x06, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x06, 0x01, 0x03, 0x00, "2" }, - {0x06, 0x01, 0x03, 0x01, "3" }, - {0x06, 0x01, 0x03, 0x02, "4" }, - {0x06, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 2, "" }, - {0x06, 0x01, 0x04, 0x00, "Off" }, - {0x06, 0x01, 0x04, 0x04, "On" }, -}; - -STDDIPINFO(Alinvade) - -static UINT8 alinvade_read(UINT16 address) -{ - switch (address) - { - case 0x4000: return (~DrvJoy1[0] & 1) * 0x10; - case 0x6000: return DrvDips[0]; - case 0x8000: return ( DrvJoy1[1] & 1) * 0x20; - case 0x8001: return ( DrvJoy1[2] & 1) * 0x20; - case 0x8002: return ( DrvJoy1[3] & 1) * 0x20; - case 0x8003: return ( DrvJoy1[4] & 1) * 0x20; - case 0x8004: return ( DrvJoy1[5] & 1) * 0x20; - - case 0xe800: return 0; - } - - return 0; -} - -static void alinvade_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: // definitely sound writes of some sort - DACWrite(0, data); - return; - - case 0xa000: - return; // nop - - case 0xe400: - return; // nop - - case 0xe800: - if (previrqmask == 0 && (data & 1) == 1) - irqmask ^= 1; - previrqmask = data & 1; - return; - } -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (M6502TotalCycles() / (2000000.000 / 60))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - DACReset(); - - previrqmask = 0; - irqmask = 1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv6502ROM = Next; Next += 0x002000; - - DrvProtPROM = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0002 * sizeof(UINT32); - - AllRam = Next; - - Drv6502RAM = Next; Next += 0x000200; - DrvVidRAM = Next; Next += 0x000c00; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv6502ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x0c00, 1, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x1000, 2, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x1400, 3, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x1800, 4, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x1c00, 5, 1)) return 1; - } - - // Protection hack, since prom isn't dumped we replace it with this - { - for (INT32 i = 0; i < 0x100; i++) { - DrvProtPROM[i] = ((i & 0xf) == 0x0f) ? 0x60 : 0xea; - } - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Drv6502RAM, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x0400, 0x0fff, MAP_RAM); - for (INT32 i = 0; i < 0x1000; i+=0x100) - M6502MapMemory(DrvProtPROM, 0xc000+i, 0xc0ff+i, MAP_ROM); // mirrored - M6502MapMemory(Drv6502ROM, 0xe000, 0xffff, MAP_ROM); - M6502SetWriteHandler(alinvade_write); - M6502SetReadHandler(alinvade_read); - M6502Close(); - - DACInit(0, 0, 0, DrvSyncDAC); - DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - DACExit(); - - M6502Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void draw_bitmap() -{ - for (INT32 offs = 0; offs < (128 * 128)/8; offs++) - { - UINT8 sx = (offs << 3) & 0x78; - INT32 sy = (offs >> 4) & 0x7f; - UINT8 data = DrvVidRAM[offs]; - UINT16 *dst = pTransDraw + (sy * nScreenWidth) + sx; - - for (INT32 x = 0; x < 8; x++) - { - dst[x] = data & 1; - data >>= 1; - } - } -} - -static INT32 DrvDraw() -{ - DrvPalette[0] = BurnHighCol(0x00,0x00,0x00, 0); - DrvPalette[1] = BurnHighCol(0xff,0xff,0xff, 0); - - draw_bitmap(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6502NewFrame(); - - INT32 nTotalCycles = 2000000 / 60; - - M6502Open(0); - M6502Run(nTotalCycles); - if (irqmask) M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6502Close(); - - if (pBurnSoundOut) { - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029722; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - - DACScan(nAction,pnMin); - - SCAN_VAR(previrqmask); - SCAN_VAR(irqmask); - } - - return 0; -} - - -// Alien Invaders - -static struct BurnRomInfo alinvadeRomDesc[] = { - { "alien28.708", 0x0400, 0xde376295, 1 | BRF_PRG | BRF_ESS }, // 0 m6502 Code - { "alien29.708", 0x0400, 0x20212977, 1 | BRF_PRG | BRF_ESS }, // 1 - { "alien30.708", 0x0400, 0x734b691c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "alien31.708", 0x0400, 0x5a70535c, 1 | BRF_PRG | BRF_ESS }, // 3 - { "alien32.708", 0x0400, 0x332dd234, 1 | BRF_PRG | BRF_ESS }, // 4 - { "alien33.708", 0x0400, 0xe0d57fc7, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "prom", 0x0010, 0x00000000, 2 | BRF_NODUMP }, // 6 Protection prom -}; - -STD_ROM_PICK(alinvade) -STD_ROM_FN(alinvade) - -struct BurnDriver BurnDrvAlinvade = { - "alinvade", NULL, NULL, NULL, "198?", - "Alien Invaders\0", "preliminary sound", "Forbes?", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, alinvadeRomInfo, alinvadeRomName, NULL, NULL, AlinvadeInputInfo, AlinvadeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 2, - 128, 128, 1, 1 -}; diff --git a/jan/src/burn/drv/pre90s/d_alpha68k.cpp b/jan/src/burn/drv/pre90s/d_alpha68k.cpp deleted file mode 100644 index 31755b821..000000000 --- a/jan/src/burn/drv/pre90s/d_alpha68k.cpp +++ /dev/null @@ -1,1232 +0,0 @@ -// FB Alpha SNK / Alpha 68k based driver module -// Based on MAME driver by Pierpaolo Prazzoli, Bryan McPhail,Stephane Humbert - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "dac.h" - -static UINT8 DrvInputPort0[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvInputPort1[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvInputPort2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvDip[2] = { 0, 0 }; -static UINT8 DrvInput[3] = { 0, 0, 0 }; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvZ80Rom = NULL; -static UINT8 *DrvZ80Ram = NULL; -static UINT8 *DrvProms = NULL; -static UINT8 *DrvColourProm = NULL; -static UINT8 *DrvVideoRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvSharedRam = NULL; -static UINT8 *DrvGfxData[8] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT32 DrvCredits = 0; -static UINT32 DrvTrigState = 0; -static UINT32 DrvDeposits1 = 0; -static UINT32 DrvDeposits2 = 0; -static UINT32 DrvCoinValue = 0; -static UINT32 DrvMicroControllerData = 0; -static INT32 DrvLatch = 0; -static INT32 DrvCoinID = 0; -static INT32 DrvMicroControllerID = 0; -static INT32 DrvFlipScreen = 0; -static UINT8 DrvSoundLatch = 0; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static INT32 nDrvTotal68KCycles = 0; -static INT32 nDrvTotalZ80Cycles = 0; - -typedef void (*DrvRender)(); -static DrvRender DrvDrawFunction = NULL; -static void SstingryDraw(); -static void KyrosDraw(); - -static struct BurnInputInfo SstingryInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, -}; - -STDINPUTINFO(Sstingry) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - DrvInput[0] = DrvInput[1] = 0x00; - DrvInput[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] -= (DrvInputPort2[i] & 1) << i; - } - - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[1]); -} - -static struct BurnDIPInfo SstingryDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x0f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x01, 0x00, "Off" }, - {0x11, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x11, 0x01, 0x0e, 0x0e, "A 1C/1C B 1C/1C" }, - {0x11, 0x01, 0x0e, 0x06, "A 1C/2C B 2C/1C" }, - {0x11, 0x01, 0x0e, 0x0a, "A 1C/3C B 3C/1C" }, - {0x11, 0x01, 0x0e, 0x02, "A 1C/4C B 4C/1C" }, - {0x11, 0x01, 0x0e, 0x0c, "A 1C/5C B 5C/1C" }, - {0x11, 0x01, 0x0e, 0x04, "A 1C/6C B 6C/1C" }, - {0x11, 0x01, 0x0e, 0x08, "A 2C/3C B 7C/1C" }, - {0x11, 0x01, 0x0e, 0x00, "A 3C/2C B 8C/1C" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x30, 0x00, "3" }, - {0x11, 0x01, 0x30, 0x10, "4" }, - {0x11, 0x01, 0x30, 0x20, "5" }, - {0x11, 0x01, 0x30, 0x30, "6" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x80, 0x00, "Upright" }, - {0x11, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Sstingry) - -static struct BurnDIPInfo KyrosDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x8e, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x11, 0x01, 0x0e, 0x0e, "A 1C/1C B 1C/1C" }, - {0x11, 0x01, 0x0e, 0x06, "A 1C/2C B 2C/1C" }, - {0x11, 0x01, 0x0e, 0x0a, "A 1C/3C B 3C/1C" }, - {0x11, 0x01, 0x0e, 0x02, "A 1C/4C B 4C/1C" }, - {0x11, 0x01, 0x0e, 0x0c, "A 1C/5C B 5C/1C" }, - {0x11, 0x01, 0x0e, 0x04, "A 1C/6C B 6C/1C" }, - {0x11, 0x01, 0x0e, 0x08, "A 2C/3C B 7C/1C" }, - {0x11, 0x01, 0x0e, 0x00, "A 3C/2C B 8C/1C" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x30, 0x00, "3" }, - {0x11, 0x01, 0x30, 0x10, "4" }, - {0x11, 0x01, 0x30, 0x20, "5" }, - {0x11, 0x01, 0x30, 0x30, "6" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x11, 0x01, 0x40, 0x00, "Easy" }, - {0x11, 0x01, 0x40, 0x40, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x80, 0x80, "Upright" }, - {0x11, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Kyros) - -static struct BurnRomInfo SstingryRomDesc[] = { - { "ss_05.rom", 0x004000, 0xbfb28d53, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ss_07.rom", 0x004000, 0xeb1b65c5, BRF_ESS | BRF_PRG }, // 1 - { "ss_04.rom", 0x004000, 0x2e477a79, BRF_ESS | BRF_PRG }, // 2 - { "ss_06.rom", 0x004000, 0x597620cb, BRF_ESS | BRF_PRG }, // 3 - - { "ss_01.rom", 0x004000, 0xfef09a92, BRF_ESS | BRF_PRG }, // 4 Z80 Program - { "ss_02.rom", 0x004000, 0xab4e8c01, BRF_ESS | BRF_PRG }, // 5 - - { "d8748.bin", 0x000400, 0x7fcbfc30, BRF_OPT | BRF_PRG }, // 6 MCU (not used) - - { "ss_12.rom", 0x004000, 0x74caa9e9, BRF_GRA }, // 7 Sprites - { "ss_08.rom", 0x004000, 0x32368925, BRF_GRA }, // 8 - { "ss_13.rom", 0x004000, 0x13da6203, BRF_GRA }, // 9 - { "ss_10.rom", 0x004000, 0x2903234a, BRF_GRA }, // 10 - { "ss_11.rom", 0x004000, 0xd134302e, BRF_GRA }, // 11 - { "ss_09.rom", 0x004000, 0x6f9d938a, BRF_GRA }, // 12 - - { "ic92", 0x000100, 0xe7ce1179, BRF_GRA }, // 13 PROMs - { "ic93", 0x000100, 0x9af8a375, BRF_GRA }, // 14 - { "ic91", 0x000100, 0xc3965079, BRF_GRA }, // 15 - { "ssprom2.bin", 0x000100, 0xc2205b71, BRF_GRA }, // 16 - { "ssprom1.bin", 0x000100, 0x1003186c, BRF_GRA }, // 17 -}; - -STD_ROM_PICK(Sstingry) -STD_ROM_FN(Sstingry) - -static struct BurnRomInfo KyrosRomDesc[] = { - { "2.10c", 0x008000, 0x4bd030b1, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "1.13c", 0x008000, 0x75cfbc5e, BRF_ESS | BRF_PRG }, // 1 - { "4.10b", 0x008000, 0xbe2626c2, BRF_ESS | BRF_PRG }, // 2 - { "3.13b", 0x008000, 0xfb25e71a, BRF_ESS | BRF_PRG }, // 3 - - { "2s.1f", 0x004000, 0x800ceb27, BRF_ESS | BRF_PRG }, // 4 Z80 Program - { "1s.1d", 0x008000, 0x87d3e719, BRF_ESS | BRF_PRG }, // 5 - - { "kyros_68705u3.bin", 0x001000, 0xc20880b7, BRF_OPT | BRF_PRG }, // 6 MCU (not used) - { "kyros_mcu.bin", 0x000800, 0x3a902a19, BRF_OPT | BRF_PRG }, // 7 - - { "8.9pr", 0x008000, 0xc5290944, BRF_GRA }, // 8 Graphics Data - { "11.11m", 0x008000, 0xfbd44f1e, BRF_GRA }, // 9 - { "12.11n", 0x008000, 0x10fed501, BRF_GRA }, // 10 - { "9.9s", 0x008000, 0xdd40ca33, BRF_GRA }, // 11 - { "13.11p", 0x008000, 0xe6a02030, BRF_GRA }, // 12 - { "14.11r", 0x008000, 0x722ad23a, BRF_GRA }, // 13 - { "15.3t", 0x008000, 0x045fdda4, BRF_GRA }, // 14 - { "17.7t", 0x008000, 0x7618ec00, BRF_GRA }, // 15 - { "18.9t", 0x008000, 0x0ee74171, BRF_GRA }, // 16 - { "16.5t", 0x008000, 0x2cf14824, BRF_GRA }, // 17 - { "19.11t", 0x008000, 0x4f336306, BRF_GRA }, // 18 - { "20.13t", 0x008000, 0xa165d06b, BRF_GRA }, // 19 - - { "mb7114l.5r", 0x000100, 0x3628bf36, BRF_GRA }, // 20 PROMs - { "mb7114l.4r", 0x000100, 0x850704e4, BRF_GRA }, // 21 - { "mb7114l.6r", 0x000100, 0xa54f60d7, BRF_GRA }, // 22 - { "mb7114l.5p", 0x000100, 0x1cc53765, BRF_GRA }, // 23 - { "mb7114l.6p", 0x000100, 0xb0d6971f, BRF_GRA }, // 24 - - { "0.1t", 0x002000, 0x5d0acb4c, BRF_GRA }, // 25 Colour PROM -}; - -STD_ROM_PICK(Kyros) -STD_ROM_FN(Kyros) - -static struct BurnRomInfo KyrosjRomDesc[] = { - { "2j.10c", 0x008000, 0xb324c11b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "1j.13c", 0x008000, 0x8496241b, BRF_ESS | BRF_PRG }, // 1 - { "4.10a", 0x008000, 0x0187f59d, BRF_ESS | BRF_PRG }, // 2 - { "3.13a", 0x008000, 0xab97941d, BRF_ESS | BRF_PRG }, // 3 - - { "2s.1f", 0x004000, 0x800ceb27, BRF_ESS | BRF_PRG }, // 4 Z80 Program - { "1s.1d", 0x008000, 0x87d3e719, BRF_ESS | BRF_PRG }, // 5 - - { "kyros_68705u3.bin", 0x001000, 0xc20880b7, BRF_OPT | BRF_PRG }, // 6 MCU (not used) - { "kyros_mcu.bin", 0x000800, 0x3a902a19, BRF_OPT | BRF_PRG }, // 7 - - { "8.9r", 0x008000, 0xd8203284, BRF_GRA }, // 8 Graphics Data - { "11.12m", 0x008000, 0xa2f9738c, BRF_GRA }, // 9 - { "12.11n", 0x008000, 0x10fed501, BRF_GRA }, // 10 - { "9j.9s", 0x008000, 0x3e725349, BRF_GRA }, // 11 - { "13.11p", 0x008000, 0xe6a02030, BRF_GRA }, // 12 - { "14.12r", 0x008000, 0x39d07db9, BRF_GRA }, // 13 - { "15.3t", 0x008000, 0x045fdda4, BRF_GRA }, // 14 - { "17.7t", 0x008000, 0x7618ec00, BRF_GRA }, // 15 - { "18.9t", 0x008000, 0x0ee74171, BRF_GRA }, // 16 - { "16j.5t", 0x008000, 0xe1566679, BRF_GRA }, // 17 - { "19.11t", 0x008000, 0x4f336306, BRF_GRA }, // 18 - { "20j.13t", 0x008000, 0x0624b4c0, BRF_GRA }, // 19 - - { "mb7114l.5r", 0x000100, 0x3628bf36, BRF_GRA }, // 20 PROMs - { "mb7114l.4r", 0x000100, 0x850704e4, BRF_GRA }, // 21 - { "mb7114l.6r", 0x000100, 0xa54f60d7, BRF_GRA }, // 22 - { "mb7114l.5p", 0x000100, 0x1cc53765, BRF_GRA }, // 23 - { "mb7114l.6p", 0x000100, 0xb0d6971f, BRF_GRA }, // 24 - - { "0j.1t", 0x002000, 0xa34ecb29, BRF_OPT }, // 25 -}; - -STD_ROM_PICK(Kyrosj) -STD_ROM_FN(Kyrosj) - -static INT32 SstingryMemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x20000; - DrvZ80Rom = Next; Next += 0x08000; - DrvProms = Next; Next += 0x00500; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x04000; - DrvZ80Ram = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x01000; - DrvSharedRam = Next; Next += 0x01000; - DrvSpriteRam = Next; Next += 0x02000; - - RamEnd = Next; - - DrvGfxData[0] = Next; Next += 0x00400 * 8 * 8; - DrvGfxData[1] = Next; Next += 0x00400 * 8 * 8; - DrvGfxData[2] = Next; Next += 0x00400 * 8 * 8; - DrvGfxData[3] = Next; Next += 0x00400 * 8 * 8; - DrvPalette = (UINT32*)Next; Next += 0x00101 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 KyrosMemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x20000; - DrvZ80Rom = Next; Next += 0x0c000; - DrvProms = Next; Next += 0x00500; - DrvColourProm = Next; Next += 0x02000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x04000; - DrvZ80Ram = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x01000; - DrvSharedRam = Next; Next += 0x01000; - DrvSpriteRam = Next; Next += 0x02000; - - RamEnd = Next; - - DrvGfxData[0] = Next; Next += 0x00800 * 8 * 8; - DrvGfxData[1] = Next; Next += 0x00800 * 8 * 8; - DrvGfxData[2] = Next; Next += 0x00800 * 8 * 8; - DrvGfxData[3] = Next; Next += 0x00800 * 8 * 8; - DrvGfxData[4] = Next; Next += 0x00800 * 8 * 8; - DrvGfxData[5] = Next; Next += 0x00800 * 8 * 8; - DrvGfxData[6] = Next; Next += 0x00800 * 8 * 8; - DrvGfxData[7] = Next; Next += 0x00800 * 8 * 8; - DrvPalette = (UINT32*)Next; Next += 0x00101 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - DACReset(); - - DrvCredits = 0; - DrvTrigState = 0; - DrvDeposits1 = 0; - DrvDeposits2 = 0; - DrvCoinValue = 0; - DrvMicroControllerData = 0; - DrvLatch = 0; - DrvFlipScreen = 0; - DrvSoundLatch = 0; - - return 0; -} - -static UINT16 kyros_alpha_trigger_r(UINT32 Offset) -{ - static const UINT8 coinage1[8][2] = {{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}}; - static const UINT8 coinage2[8][2] = {{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}}; - UINT16 * RAM = (UINT16*)DrvSharedRam; - INT32 Source = RAM[Offset]; - -// bprintf(PRINT_NORMAL, _T("kyros_alpha_trigger_r %x\n"), Offset); - - switch (Offset) { - case 0x22: { - RAM[0x22] = (Source & 0xff00) | (DrvCredits & 0x00ff); - return 0; - } - - case 0x29: { - DrvTrigState++; - if ((DrvInput[2] & 0x03) == 0x03) DrvLatch = 0; - - if ((DrvInput[2] & 0x01) == 0x00 && !DrvLatch) { - RAM[0x29] = (Source & 0xff00) | (DrvCoinID & 0xff); - RAM[0x22] = (Source & 0xff00) | 0x00; - DrvLatch = 1; - - DrvCoinValue = (~DrvDip[0] >> 1) & 0x07; - DrvDeposits1++; - if (DrvDeposits1 == coinage1[DrvCoinValue][0]) { - DrvCredits = coinage1[DrvCoinValue][1]; - DrvDeposits1 = 0; - } else { - DrvCredits = 0; - } - } else if ((DrvInput[2] & 0x02) == 0x00 && !DrvLatch) { - RAM[0x29] = (Source & 0xff00) | (DrvCoinID >> 8); - RAM[0x22] = (Source & 0xff00) | 0x0; - DrvLatch = 1; - - DrvCoinValue = (~DrvDip[0] >> 1) & 0x07; - DrvDeposits2++; - if (DrvDeposits2 == coinage2[DrvCoinValue][0]) { - DrvCredits = coinage2[DrvCoinValue][1]; - DrvDeposits2 = 0; - } else { - DrvCredits = 0; - } - } else { - if (DrvMicroControllerID == 0x00ff) { - if (DrvTrigState >= 12 /*|| m_game_id == ALPHA68K_JONGBOU*/) { - DrvTrigState = 0; - DrvMicroControllerData = 0x21; - } else { - DrvMicroControllerData = 0x00; - } - } else { - DrvMicroControllerData = 0x00; - } - - RAM[0x29] = (Source & 0xff00) | DrvMicroControllerData; - } - return 0; - } - - case 0xff: { - RAM[0xff] = (Source & 0xff00) | DrvMicroControllerID; - break; - } - } - - return 0; -} - -static void kyros_alpha_trigger_w(UINT32 Offset, UINT16 Data) -{ - if (Offset == 0x5b) DrvFlipScreen = Data & 0x01; -} - -UINT8 __fastcall Kyros68KReadByte(UINT32 a) -{ - if (a >= 0x080000 && a <= 0x0801ff) { - return kyros_alpha_trigger_r((a - 0x080000) >> 1); - } - - switch (a) { - case 0x060000: { - return DrvVideoRam[0 ^ 1]; - } - - case 0x0c0000: { - return DrvInput[1]; - } - - case 0x0c0001: { - return DrvInput[0]; - } - - case 0x0e0000: { - return DrvDip[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall Kyros68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Kyros68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x080000 && a <= 0x0801ff) { - return kyros_alpha_trigger_w(a - 0x080000, d); - } - - switch (a) { - case 0x060001: { - DrvVideoRam[1 ^ 1] = d; - return; - } - - case 0x0e0000: { - DrvSoundLatch = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -void __fastcall Kyros68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall SstingryZ80Read(UINT16 a) -{ - switch (a) { - case 0xc100: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall SstingryZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xc102: { - DrvSoundLatch = 0; - return; - } - - case 0xc104: { - DACSignedWrite(0, d); - return; - } - - case 0xc106: - case 0xc108: - case 0xc10a: - case 0xc10c: - case 0xc10e: { - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KyrosZ80Read(UINT16 a) -{ - switch (a) { - case 0xe000: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall KyrosZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe002: { - DrvSoundLatch = 0; - return; - } - - case 0xe004: { - DACSignedWrite(0, d); - return; - } - - case 0xe006: - case 0xe008: - case 0xe00a: - case 0xe00c: - case 0xe00e: { - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KyrosZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall KyrosZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x10: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x11: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0x80: { - BurnYM2203Write(1, 1, d); - return; - } - - case 0x81: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0x90: { - BurnYM2203Write(2, 1, d); - return; - } - - case 0x91: { - BurnYM2203Write(2, 0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static INT32 Sstingry1PlaneOffsets[3] = { 4, 0x40000, 0x40004 }; -static INT32 Sstingry1XOffsets[8] = { 67, 66, 65, 64, 3, 2, 1, 0 }; -static INT32 Sstingry1Offsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 Sstingry2PlaneOffsets[3] = { 0, 0x140000, 0x140004 }; -static INT32 Sstingry2XOffsets[8] = { 67, 66, 65, 64, 3, 2, 1, 0 }; -static INT32 Sstingry2Offsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 Sstingry3PlaneOffsets[3] = { 0, 0x80000, 0x80004 }; -static INT32 Sstingry3XOffsets[8] = { 67, 66, 65, 64, 3, 2, 1, 0 }; -static INT32 Sstingry3Offsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 Kyros1PlaneOffsets[3] = { 4, 0x40000, 0x40004 }; -static INT32 Kyros1XOffsets[8] = { 67, 66, 65, 64, 3, 2, 1, 0 }; -static INT32 Kyros1Offsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 Kyros2PlaneOffsets[3] = { 0, 0x80000, 0x80004 }; -static INT32 Kyros2XOffsets[8] = { 67, 66, 65, 64, 3, 2, 1, 0 }; -static INT32 Kyros2Offsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / nDrvTotalZ80Cycles); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / nDrvTotalZ80Cycles; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / ((double)nDrvTotalZ80Cycles / (nBurnFPS / 100.000)))); -} - -static INT32 SstingryInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - SstingryMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - SstingryMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x60000); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x08001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x08000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x04000, 5, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0, 0x60000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 3, 8, 8, Sstingry1PlaneOffsets, Sstingry1XOffsets, Sstingry1Offsets, 0x80, DrvTempRom + 0x00000, DrvGfxData[0]); - GfxDecode(0x400, 3, 8, 8, Sstingry2PlaneOffsets, Sstingry2XOffsets, Sstingry2Offsets, 0x80, DrvTempRom + 0x00000, DrvGfxData[1]); - GfxDecode(0x400, 3, 8, 8, Sstingry1PlaneOffsets, Sstingry1XOffsets, Sstingry1Offsets, 0x80, DrvTempRom + 0x10000, DrvGfxData[2]); - GfxDecode(0x400, 3, 8, 8, Sstingry3PlaneOffsets, Sstingry3XOffsets, Sstingry3Offsets, 0x80, DrvTempRom + 0x10000, DrvGfxData[3]); - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvProms + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00100, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00200, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00300, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00400, 17, 1); if (nRet != 0) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(DrvSharedRam , 0x020000, 0x020fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x040000, 0x041fff, MAP_RAM); - SekSetReadByteHandler(0, Kyros68KReadByte); - SekSetWriteByteHandler(0, Kyros68KWriteByte); - SekSetReadWordHandler(0, Kyros68KReadWord); - SekSetWriteWordHandler(0, Kyros68KWriteWord); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80Ram ); - ZetSetReadHandler(SstingryZ80Read); - ZetSetWriteHandler(SstingryZ80Write); - ZetSetInHandler(KyrosZ80PortRead); - ZetSetOutHandler(KyrosZ80PortWrite); - ZetClose(); - - nDrvTotal68KCycles = 6000000; - nDrvTotalZ80Cycles = 3579545; - - BurnYM2203Init(3, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3579545); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(2, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(2, BURN_SND_YM2203_AY8910_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(2, BURN_SND_YM2203_AY8910_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(2, BURN_SND_YM2203_AY8910_ROUTE_3, 0.50, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - DrvDrawFunction = SstingryDraw; - - DrvMicroControllerID = 0x00ff; - DrvCoinID = 0x22 | (0x22 << 8); - - DrvDoReset(); - - return 0; -} - -static INT32 KyrosInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - KyrosMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - KyrosMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x60000); - - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x10001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x10000, 3, 2); if (nRet != 0) return 1; - memset(DrvTempRom, 0, 0x60000); - memcpy(DrvTempRom, Drv68KRom, 0x20000); - memcpy(Drv68KRom + 0x00000, DrvTempRom + 0x00000, 0x8000); - memcpy(Drv68KRom + 0x10000, DrvTempRom + 0x08000, 0x8000); - memcpy(Drv68KRom + 0x08000, DrvTempRom + 0x10000, 0x8000); - memcpy(Drv68KRom + 0x18000, DrvTempRom + 0x18000, 0x8000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x04000, 5, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0, 0x60000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x48000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x58000, 19, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 3, 8, 8, Kyros1PlaneOffsets, Kyros1XOffsets, Kyros1Offsets, 0x80, DrvTempRom + 0x00000, DrvGfxData[0]); - GfxDecode(0x800, 3, 8, 8, Kyros2PlaneOffsets, Kyros2XOffsets, Kyros2Offsets, 0x80, DrvTempRom + 0x00000, DrvGfxData[1]); - GfxDecode(0x800, 3, 8, 8, Kyros1PlaneOffsets, Kyros1XOffsets, Kyros1Offsets, 0x80, DrvTempRom + 0x18000, DrvGfxData[2]); - GfxDecode(0x800, 3, 8, 8, Kyros2PlaneOffsets, Kyros2XOffsets, Kyros2Offsets, 0x80, DrvTempRom + 0x18000, DrvGfxData[3]); - GfxDecode(0x800, 3, 8, 8, Kyros1PlaneOffsets, Kyros1XOffsets, Kyros1Offsets, 0x80, DrvTempRom + 0x30000, DrvGfxData[4]); - GfxDecode(0x800, 3, 8, 8, Kyros2PlaneOffsets, Kyros2XOffsets, Kyros2Offsets, 0x80, DrvTempRom + 0x30000, DrvGfxData[5]); - GfxDecode(0x800, 3, 8, 8, Kyros1PlaneOffsets, Kyros1XOffsets, Kyros1Offsets, 0x80, DrvTempRom + 0x48000, DrvGfxData[6]); - GfxDecode(0x800, 3, 8, 8, Kyros2PlaneOffsets, Kyros2XOffsets, Kyros2Offsets, 0x80, DrvTempRom + 0x48000, DrvGfxData[7]); - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvProms + 0x00000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00100, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00200, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00300, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00400, 24, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvColourProm + 0x00000, 25, 1); if (nRet != 0) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(DrvSharedRam , 0x020000, 0x020fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x040000, 0x041fff, MAP_RAM); - SekSetReadByteHandler(0, Kyros68KReadByte); - SekSetWriteByteHandler(0, Kyros68KWriteByte); - SekSetReadWordHandler(0, Kyros68KReadWord); - SekSetWriteWordHandler(0, Kyros68KWriteWord); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram ); - ZetSetReadHandler(KyrosZ80Read); - ZetSetWriteHandler(KyrosZ80Write); - ZetSetInHandler(KyrosZ80PortRead); - ZetSetOutHandler(KyrosZ80PortWrite); - ZetClose(); - - nDrvTotal68KCycles = 6000000; - nDrvTotalZ80Cycles = 4000000; - - BurnYM2203Init(3, 2000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(2, BURN_SND_YM2203_YM2203_ROUTE, 0.90, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(2, BURN_SND_YM2203_AY8910_ROUTE_1, 0.90, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(2, BURN_SND_YM2203_AY8910_ROUTE_2, 0.90, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(2, BURN_SND_YM2203_AY8910_ROUTE_3, 0.90, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - DrvDrawFunction = KyrosDraw; - - DrvMicroControllerID = 0x0012; - DrvCoinID = 0x22 | (0x22 << 8); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - ZetExit(); - BurnYM2203Exit(); - DACExit(); - - GenericTilesExit(); - - BurnFree(Mem); - - DrvCredits = 0; - DrvTrigState = 0; - DrvDeposits1 = 0; - DrvDeposits2 = 0; - DrvCoinValue = 0; - DrvMicroControllerData = 0; - DrvLatch = 0; - DrvCoinID = 0; - DrvMicroControllerID = 0; - DrvFlipScreen = 0; - DrvSoundLatch = 0; - - DrvDrawFunction = NULL; - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -static void KyrosCalcPalette() -{ - INT32 i; - UINT32 Palette[256]; - - for (i = 0; i < 256; i++) { - INT32 r = pal4bit(DrvProms[i + 0x000]); - INT32 g = pal4bit(DrvProms[i + 0x100]); - INT32 b = pal4bit(DrvProms[i + 0x200]); - - Palette[i] = BurnHighCol(r, g, b, 0); - } - - for (i = 0; i < 256; i++) { - UINT8 CTabEntry = ((DrvProms[i + 0x300] & 0x0f) << 4) | (DrvProms[i + 0x400] & 0x0f); - DrvPalette[i] = Palette[CTabEntry]; - } - - UINT16 *RAM = (UINT16*)DrvVideoRam; - DrvPalette[0x100] = Palette[RAM[0] & 0xff]; -} - -static void SstingryDrawSprites(INT32 c, INT32 d) -{ - UINT16 *RAM = (UINT16*)DrvSpriteRam; - INT32 Data, Offs, mx, my, Colour, Tile, i, Bank, yFlip, xFlip; - - for (Offs = 0; Offs < 0x400; Offs += 0x20) { - mx = RAM[Offs + c]; - my = -(mx >> 8) & 0xff; - mx &= 0xff; - if (mx > 0xf8) mx -= 0x100; - - if (DrvFlipScreen) my = 249 - my; - - for (i = 0; i < 0x20; i++) { - Data = RAM[Offs + d + i]; - if (Data != 0x40) { - yFlip = Data & 0x1000; - xFlip = 0; - - if (DrvFlipScreen) { - if (yFlip) { - yFlip = 0; - } else { - yFlip = 1; - } - xFlip = 1; - } - - Colour = (Data >> 7 & 0x18) | (Data >> 13 & 7); - Tile = Data & 0x3ff; - Bank = Data >> 10 & 3; - - if (mx > 0 && mx < 248 && (my - 16) > 0 && (my - 16) < 216) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } else { - Render8x8Tile_Mask(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } - } - } - } - - if (DrvFlipScreen) { - my = (my - 8) & 0xff; - } else { - my = (my + 8) & 0xff; - } - } - } -} - -static void KyrosVideoBanking(INT32 *Bank, INT32 Data) -{ - *Bank = (Data >> 13 & 4) | (Data >> 10 & 3); -} - -static void KyrosDrawSprites(INT32 c, INT32 d) -{ - UINT16 *RAM = (UINT16*)DrvSpriteRam; - INT32 Data, Offs, mx, my, Colour, Tile, i, Bank, yFlip, xFlip; - - for (Offs = 0; Offs < 0x400; Offs += 0x20) { - mx = RAM[Offs + c]; - my = -(mx >> 8) & 0xff; - mx &= 0xff; - - if (DrvFlipScreen) my = 249 - my; - - for (i = 0; i < 0x20; i++) { - Data = RAM[Offs + d + i]; - if (Data != 0x20) { - Colour = DrvColourProm[(Data >> 1 & 0x1000) | (Data & 0xffc) | (Data >> 14 & 3)]; - if (Colour != 0xff) { - yFlip = Data & 0x1000; - xFlip = 0; - - if(DrvFlipScreen) { - if (yFlip) { - yFlip = 0; - } else { - yFlip = 1; - } - xFlip = 1; - } - - Tile = (Data >> 3 & 0x400) | (Data & 0x3ff); -// if (m_game_id == ALPHA68K_KYROS) - KyrosVideoBanking(&Bank, Data); -// else -// jongbou_video_banking(&bank, data); - - if (mx > 0 && mx < 248 && (my - 16) > 0 && (my - 16) < 216) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } else { - Render8x8Tile_Mask(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Tile, mx, my - 16, Colour, 3, 0, 0, DrvGfxData[Bank]); - } - } - } - } - } - - if (DrvFlipScreen) { - my = (my - 8) & 0xff; - } else { - my = (my + 8) & 0xff; - } - } - } -} - -static void SstingryDraw() -{ - BurnTransferClear(); - KyrosCalcPalette(); - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0x100; - } - SstingryDrawSprites(2, 0x0800); - SstingryDrawSprites(3, 0x0c00); - SstingryDrawSprites(1, 0x0400); - BurnTransferCopy(DrvPalette); -} - -static void KyrosDraw() -{ - BurnTransferClear(); - KyrosCalcPalette(); - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0x100; - } - KyrosDrawSprites(2, 0x0800); - KyrosDrawSprites(3, 0x0c00); - KyrosDrawSprites(1, 0x0400); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 132; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = nDrvTotal68KCycles / 60; - nCyclesTotal[1] = nDrvTotalZ80Cycles / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesDone[0] += SekRun(nCyclesSegment); - if (i == 125) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - if (i == 66) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - if (i == 44 || i == 88) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - if (i & 1) ZetNmi(); - } - - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - ZetClose(); - - if (pBurnDraw) DrvDrawFunction(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029735; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - } - - return 0; -} - -struct BurnDriver BurnDrvSstingry = { - "sstingry", NULL, NULL, NULL, "1986", - "Super Stingray (Japan)\0", NULL, "Alpha Denshi Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, SstingryRomInfo, SstingryRomName, NULL, NULL, SstingryInputInfo, SstingryDIPInfo, - SstingryInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x101, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvKyros = { - "kyros", NULL, NULL, NULL, "1987", - "Kyros\0", NULL, "Alpha Denshi Co. (World Games Inc. license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, KyrosRomInfo, KyrosRomName, NULL, NULL, SstingryInputInfo, KyrosDIPInfo, - KyrosInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x101, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvKyrosj = { - "kyrosj", "kyros", NULL, NULL, "1986", - "Kyros No Yakata (Japan)\0", NULL, "Alpha Denshi Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, KyrosjRomInfo, KyrosjRomName, NULL, NULL, SstingryInputInfo, KyrosDIPInfo, - KyrosInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x101, 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_alpha68k1.cpp b/jan/src/burn/drv/pre90s/d_alpha68k1.cpp deleted file mode 100644 index c174e553c..000000000 --- a/jan/src/burn/drv/pre90s/d_alpha68k1.cpp +++ /dev/null @@ -1,978 +0,0 @@ -// FB Alpha Alpha Denshi Co 68k Type I driver module -// Based on MAME driver by Pierpaolo Prazzoli, Bryan McPhail, and Stephane Humbert - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "burn_pal.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvColPROM; -static UINT8 *DrvLutROM; -static UINT8 *DrvZ80RAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 port_fc; - -static INT32 cpu_clock; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT16 DrvInputs[3]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static UINT32 tnextspc2mode = 0; - -static struct BurnInputInfo PaddlemaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 8, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 9, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - - {"P4 Up", BIT_DIGITAL, DrvJoy3 + 8, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy3 + 9, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy3 + 10, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy3 + 11, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy3 + 12, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy3 + 13, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 14, "service" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 13, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Paddlema) - -static struct BurnInputInfo TnextspcInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Tnextspc) - -static struct BurnDIPInfo PaddlemaDIPList[]= -{ - {0x1e, 0xff, 0xff, 0x73, NULL }, - {0x1f, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x1e, 0x01, 0x03, 0x03, "1 Coin 2 Credits" }, - {0x1e, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - {0x1e, 0x01, 0x03, 0x02, "1 Coin 4 Credits" }, - {0x1e, 0x01, 0x03, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x1e, 0x01, 0x0c, 0x0c, "4 Coins 1 Credits" }, - {0x1e, 0x01, 0x0c, 0x04, "3 Coins 1 Credits" }, - {0x1e, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x1e, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Game Time" }, - {0x1e, 0x01, 0x30, 0x00, "Default Time" }, - {0x1e, 0x01, 0x30, 0x20, "+10 Seconds" }, - {0x1e, 0x01, 0x30, 0x10, "+20 Seconds" }, - {0x1e, 0x01, 0x30, 0x30, "+30 Seconds" }, - - {0 , 0xfe, 0 , 3, "Match Type" }, - {0x1e, 0x01, 0xc0, 0x80, "A to B" }, - {0x1e, 0x01, 0xc0, 0x00, "A to C" }, - {0x1e, 0x01, 0xc0, 0x40, "A to E" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1f, 0x01, 0x01, 0x00, "Off" }, - {0x1f, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x1f, 0x01, 0x30, 0x20, "Demo Sounds Off" }, - {0x1f, 0x01, 0x30, 0x00, "Demo Sounds On" }, - {0x1f, 0x01, 0x30, 0x10, "Win Match Against CPU (Cheat)"}, - {0x1f, 0x01, 0x30, 0x30, "Freeze" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x1f, 0x01, 0x40, 0x00, "English" }, - {0x1f, 0x01, 0x40, 0x40, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x1f, 0x01, 0x80, 0x80, "No" }, - {0x1f, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Paddlema) - -static struct BurnDIPInfo TnextspcDIPList[]= -{ - {0x11, 0xff, 0xff, 0xbf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Additional Bonus Life" }, - {0x11, 0x01, 0x04, 0x04, "2nd Extend ONLY" }, - {0x11, 0x01, 0x04, 0x00, "Every Extend" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x30, 0x30, "A 1C/1C B 1C/2C" }, - {0x11, 0x01, 0x30, 0x20, "A 2C/1C B 1C/3C" }, - {0x11, 0x01, 0x30, 0x10, "A 3C/1C B 1C/5C" }, - {0x11, 0x01, 0x30, 0x00, "A 4C/1C B 1C/6C" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0xc0, "2" }, - {0x11, 0x01, 0xc0, 0x80, "3" }, - {0x11, 0x01, 0xc0, 0x40, "4" }, - {0x11, 0x01, 0xc0, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Game Mode" }, - {0x12, 0x01, 0x04, 0x00, "Freeze" }, - {0x12, 0x01, 0x04, 0x04, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Demo Sound/Game Mode" }, - {0x12, 0x01, 0x08, 0x08, "Demo Sounds" }, - {0x12, 0x01, 0x08, 0x00, "Game Mode" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x30, 0x30, "100000 200000" }, - {0x12, 0x01, 0x30, 0x20, "150000 300000" }, - {0x12, 0x01, 0x30, 0x10, "300000 500000" }, - {0x12, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x40, 0x00, "No" }, - {0x12, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Tnextspc) - -static void __fastcall alpha68k_i_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x180000: - case 0x180001: - return; // nop - - case 0x380001: - soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -static UINT8 __fastcall alpha68k_i_read_byte(UINT32 address) -{ - switch (address) - { - case 0x180000: - return 0; - - case 0x180001: - return DrvDips[0]; - - case 0x180008: - return 0; - - case 0x180009: - return DrvDips[1]; - - case 0x300000: - return DrvInputs[0] >> 8; - - case 0x300001: - return DrvInputs[0]; - - case 0x340000: - return DrvInputs[1] >> 8; - - case 0x340001: - return DrvInputs[1]; - - case 0x380000: - return DrvInputs[2] >> 8; - - case 0x380001: - return DrvInputs[2]; - } - - return 0; -} - -static void __fastcall tnextspc_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x0d0001: - case 0x0e0007: - case 0x0e000f: - return; // nop - - case 0x0f0003: - case 0x0f0005: - // coin counters - return; - - case 0x0f0009: - soundlatch = data; - ZetSetIRQLine(0x20, CPU_IRQSTATUS_ACK); - return; - } -} - -static UINT8 __fastcall tnextspc_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0e0009: - return DrvDips[0]; - - case 0x0e000b: - return DrvDips[1]; - - case 0x0e0001: - return DrvInputs[0]; - - case 0x0e0003: - return DrvInputs[1]; - - case 0x0e0005: - return DrvInputs[2]; - - case 0x0e0019: - return 1; // sound status? - } - - return 0; -} - -static void __fastcall alpha68k_i_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - soundlatch = 0; - return; - - case 0xe800: - BurnYM3812Write(0, 0, data); // control - return; - - case 0xec00: - BurnYM3812Write(0, 1, data); // write - return; - - case 0xfc00: - port_fc = data; // what is this??? - return; - } -} - -static UINT8 __fastcall alpha68k_i_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - - case 0xe800: - return BurnYM3812Read(0, 0); - - case 0xfc00: // nop? - return port_fc; - } - - return 0; -} - -static void __fastcall tnextspc_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf800: - soundlatch = 0; - return; - } - - if (data) return; // kill warnings -} - -static UINT8 __fastcall tnextspc_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static void __fastcall tnextspc_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM3812Write(0, 0, data); // control - return; - - case 0x20: - BurnYM3812Write(0, 1, data); // write - return; - } -} - -static UINT8 __fastcall tnextspc_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return BurnYM3812Read(0, 0); - - case 0x3b: // nop? - case 0x3d: // nop? - case 0x7b: // nop? - return 0; - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_HOLD : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM3812Reset(); - ZetClose(); - - soundlatch = 0; - flipscreen = 0; - port_fc = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - - DrvColPROM = Next; Next += 0x001000; - - DrvLutROM = Next; Next += 0x008000; - - DrvPalette = (UINT32*)Next; Next += 0x000401 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - Drv68KRAM = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x004000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { STEP4(0,4) }; - INT32 XOffs[8] = { 8*16+3, 8*16+2, 8*16+1, 8*16+0, 3, 2, 1, 0 }; - INT32 YOffs[8] = { STEP8(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x80000); - - GfxDecode(((0x80000 * 8) / 4) / (8 * 8), 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - BurnFree(tmp); - - // merge color prom nibbles - for (INT32 i = 0; i < 0x400; i++) { - DrvColPROM[0x300 + i] = (DrvColPROM[0x300 + i] & 0xf) | (DrvColPROM[0x700 + i] << 4); - } - - return 0; -} - -static INT32 PaddlemaInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - // if (BurnLoadRom(DrvMCUROM + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x060001, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x060000, 13, 2)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000100, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000200, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000300, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000700, 18, 1)) return 1; - - if (BurnLoadRom(DrvLutROM + 0x000000, 19, 1)) return 1; - - DrvGfxDecode(); - } - - cpu_clock = 6000000; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x083fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x100000, 0x103fff, MAP_RAM); - SekSetWriteByteHandler(0, alpha68k_i_write_byte); - SekSetReadByteHandler(0, alpha68k_i_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(alpha68k_i_sound_write); - ZetSetReadHandler(alpha68k_i_sound_read); - ZetClose(); - - BurnYM3812Init(1, 4000000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 TnextspcInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (tnextspc2mode) - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x060001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x060000, 10, 2)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000100, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000200, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000300, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000700, 15, 1)) return 1; - - if (BurnLoadRom(DrvLutROM + 0x000000, 16, 1)) return 1; - - DrvGfxDecode(); - } - else - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - BurnByteswap(DrvGfxROM0, 0x80000); - - if (BurnLoadRom(DrvColPROM + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000100, 5, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000200, 6, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000300, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000700, 8, 1)) return 1; - - if (BurnLoadRom(DrvLutROM + 0x000000, 9, 1)) return 1; - - DrvGfxDecode(); - } - - cpu_clock = 9000000; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x070000, 0x073fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x0a0000, 0x0a3fff, MAP_RAM); - SekSetWriteByteHandler(0, tnextspc_write_byte); - SekSetReadByteHandler(0, tnextspc_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xefff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(tnextspc_sound_write); - ZetSetReadHandler(tnextspc_sound_read); - ZetSetOutHandler(tnextspc_sound_write_port); - ZetSetInHandler(tnextspc_sound_read_port); - ZetClose(); - - BurnYM3812Init(1, 4000000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 Tnextspc2Init() -{ - tnextspc2mode = 1; - - return TnextspcInit(); -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM3812Exit(); - - SekExit(); - ZetExit(); - - BurnFree(AllMem); - - tnextspc2mode = 0; - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pal[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 r = pal4bit(DrvColPROM[i + 0x000]); - UINT8 g = pal4bit(DrvColPROM[i + 0x100]); - UINT8 b = pal4bit(DrvColPROM[i + 0x200]); - - pal[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x400; i++) { - DrvPalette[i] = pal[DrvColPROM[0x300 + i]]; - } - - DrvPalette[0x400] = BurnHighCol(0,0,0,0); // black -} - -static void draw_sprites(INT32 c, INT32 d, INT32 yshift) -{ - UINT8 *color_prom = DrvLutROM; - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x400; offs += 0x20) - { - INT32 sx = ram[offs + c]; - INT32 sy = (yshift - (sx >> 8)) & 0xff; - sx &= 0xff; - - for (INT32 i = 0; i < 0x20; i++) - { - UINT16 attr = ram[offs + d + i]; - UINT16 code = attr & 0x3fff; - UINT16 flipy = attr & 0x4000; - UINT8 color = color_prom[(code << 1) | (attr >> 15)]; - - if (flipy) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0, DrvGfxROM0); - } - - sy = (sy + 8) & 0xff; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x400; - } - - INT32 shift = (cpu_clock == 9000000) ? 1 : 0; - - draw_sprites(2, 0x800, shift); - draw_sprites(3, 0xc00, shift); - draw_sprites(1, 0x400, shift); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3 * sizeof(INT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - } - - INT32 nInterleave = 253; - INT32 nCyclesTotal[2] = { cpu_clock / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - if (i == 248) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029682; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(port_fc); - } - - return 0; -} - - -// Paddle Mania - -static struct BurnRomInfo paddlemaRomDesc[] = { - { "padlem.6g", 0x10000, 0xc227a6e8, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "padlem.3g", 0x10000, 0xf11a21aa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "padlem.6h", 0x10000, 0x8897555f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "padlem.3h", 0x10000, 0xf0fe9b9d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "padlem.18c", 0x10000, 0x9269778d, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "alpha.mcu", 0x01000, 0 , 3 | BRF_NODUMP | BRF_OPT }, // 5 MCU Code (not used) - - { "padlem.9m", 0x10000, 0x4ee4970d, 4 | BRF_GRA }, // 6 Graphics - { "padlem.16m", 0x10000, 0x0984fb4d, 4 | BRF_GRA }, // 7 - { "padlem.9n", 0x10000, 0xa1756f15, 4 | BRF_GRA }, // 8 - { "padlem.16n", 0x10000, 0x4249e047, 4 | BRF_GRA }, // 9 - { "padlem.6m", 0x10000, 0x3f47910c, 4 | BRF_GRA }, // 10 - { "padlem.13m", 0x10000, 0xfd9dbc27, 4 | BRF_GRA }, // 11 - { "padlem.6n", 0x10000, 0xfe337655, 4 | BRF_GRA }, // 12 - { "padlem.13n", 0x10000, 0x1d460486, 4 | BRF_GRA }, // 13 - - { "padlem.a", 0x00100, 0xcae6bcd6, 5 | BRF_GRA }, // 14 Palette Data - { "padlem.b", 0x00100, 0xb6df8dcb, 5 | BRF_GRA }, // 15 - { "padlem.c", 0x00100, 0x39ca9b86, 5 | BRF_GRA }, // 16 - - { "padlem.17j", 0x00400, 0x86170069, 6 | BRF_GRA }, // 17 Palette Look-up Data - { "padlem.16j", 0x00400, 0x8da58e2c, 6 | BRF_GRA }, // 18 - - { "padlem.18n", 0x08000, 0x06506200, 7 | BRF_GRA }, // 19 Color Look-up Data -}; - -STD_ROM_PICK(paddlema) -STD_ROM_FN(paddlema) - -struct BurnDriver BurnDrvPaddlema = { - "paddlema", NULL, NULL, NULL, "1988", - "Paddle Mania\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_BALLPADDLE, 0, - NULL, paddlemaRomInfo, paddlemaRomName, NULL, NULL, PaddlemaInputInfo, PaddlemaDIPInfo, - PaddlemaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; - - -// The Next Space (set 1) - -static struct BurnRomInfo tnextspcRomDesc[] = { - { "ns_4.bin", 0x20000, 0x4617cba3, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "ns_3.bin", 0x20000, 0xa6c47fef, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ns_1.bin", 0x10000, 0xfc26853c, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ns_5678.bin", 0x80000, 0x22756451, 3 | BRF_GRA }, // 3 Graphics - - { "2.p2", 0x00100, 0x1f388d48, 4 | BRF_GRA }, // 4 Palette Data - { "3.p3", 0x00100, 0x0254533a, 4 | BRF_GRA }, // 5 - { "1.p1", 0x00100, 0x488fd0e9, 4 | BRF_GRA }, // 6 - - { "5.p5", 0x00400, 0x9c8527bf, 5 | BRF_GRA }, // 7 Palette Look-up Data - { "4.p4", 0x00400, 0xcc9ff769, 5 | BRF_GRA }, // 8 - - { "ns_2.bin", 0x08000, 0x05771d48, 6 | BRF_GRA }, // 9 Color Look-up Data -}; - -STD_ROM_PICK(tnextspc) -STD_ROM_FN(tnextspc) - -struct BurnDriver BurnDrvTnextspc = { - "tnextspc", NULL, NULL, NULL, "1989", - "The Next Space (set 1)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, tnextspcRomInfo, tnextspcRomName, NULL, NULL, TnextspcInputInfo, TnextspcDIPInfo, - TnextspcInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; - - -// The Next Space (set 2) - -static struct BurnRomInfo tnextspc2RomDesc[] = { - { "ns_4.bin", 0x20000, 0x4617cba3, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "ns_3.bin", 0x20000, 0xa6c47fef, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ns_1.bin", 0x10000, 0xfc26853c, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "b3.ic49", 0x10000, 0x2bddf94d, 3 | BRF_GRA }, // 3 Graphics - { "b7.ic53", 0x10000, 0xa8b13a9a, 3 | BRF_GRA }, // 4 - { "b4.ic50", 0x10000, 0x80c6c841, 3 | BRF_GRA }, // 5 - { "b8.ic54", 0x10000, 0xbf0762a0, 3 | BRF_GRA }, // 6 - { "b5.ic51", 0x10000, 0xe487750b, 3 | BRF_GRA }, // 7 - { "b9.ic55", 0x10000, 0x45d730b9, 3 | BRF_GRA }, // 8 - { "b6.ic52", 0x10000, 0x0618cf49, 3 | BRF_GRA }, // 9 - { "b10.ic56", 0x10000, 0xf48819df, 3 | BRF_GRA }, // 10 - - { "2.p2", 0x00100, 0x1f388d48, 4 | BRF_GRA }, // 11 Palette Data - { "3.p3", 0x00100, 0x0254533a, 4 | BRF_GRA }, // 12 - { "1.p1", 0x00100, 0x488fd0e9, 4 | BRF_GRA }, // 13 - - { "5.p5", 0x00400, 0x9c8527bf, 5 | BRF_GRA }, // 14 Palette Look-up Data - { "4.p4", 0x00400, 0xcc9ff769, 5 | BRF_GRA }, // 15 - - { "ns_2.bin", 0x08000, 0x05771d48, 6 | BRF_GRA }, // 16 Color Look-up Data -}; - -STD_ROM_PICK(tnextspc2) -STD_ROM_FN(tnextspc2) - -struct BurnDriver BurnDrvTnextspc2 = { - "tnextspc2", "tnextspc", NULL, NULL, "1989", - "The Next Space (set 2)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, tnextspc2RomInfo, tnextspc2RomName, NULL, NULL, TnextspcInputInfo, TnextspcDIPInfo, - Tnextspc2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; - - -// The Next Space (Japan) - -static struct BurnRomInfo tnextspcjRomDesc[] = { - { "ns_ver1_j4.bin", 0x20000, 0x5cdf710d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "ns_ver1_j3.bin", 0x20000, 0xcd9532d0, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ns_1.bin", 0x10000, 0xfc26853c, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ns_5678.bin", 0x80000, 0x22756451, 3 | BRF_GRA }, // 3 Graphics - - { "2.p2", 0x00100, 0x1f388d48, 4 | BRF_GRA }, // 4 Palette Data - { "3.p3", 0x00100, 0x0254533a, 4 | BRF_GRA }, // 5 - { "1.p1", 0x00100, 0x488fd0e9, 4 | BRF_GRA }, // 6 - - { "5.p5", 0x00400, 0x9c8527bf, 5 | BRF_GRA }, // 7 Palette Look-up Data - { "4.p4", 0x00400, 0xcc9ff769, 5 | BRF_GRA }, // 8 - - { "ns_2.bin", 0x08000, 0x05771d48, 6 | BRF_GRA }, // 9 Color Look-up Data -}; - -STD_ROM_PICK(tnextspcj) -STD_ROM_FN(tnextspcj) - -struct BurnDriver BurnDrvTnextspcj = { - "tnextspcj", "tnextspc", NULL, NULL, "1989", - "The Next Space (Japan)\0", NULL, "SNK (Pasadena International Corp. license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, tnextspcjRomInfo, tnextspcjRomName, NULL, NULL, TnextspcInputInfo, TnextspcDIPInfo, - TnextspcInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_alpha68k2.cpp b/jan/src/burn/drv/pre90s/d_alpha68k2.cpp deleted file mode 100644 index d100ce6f1..000000000 --- a/jan/src/burn/drv/pre90s/d_alpha68k2.cpp +++ /dev/null @@ -1,3448 +0,0 @@ -// FB Alpha Alpha68k II & V driver module -// Based on MAME driver by Pierpaolo Prazzoli, Bryan McPhail,Stephane Humbert - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "burn_ym2413.h" -#include "dac.h" -#include "burn_pal.h" - -// Todo: -// fix goldmedl color issue(s) - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvShareRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 bank_base; -static UINT8 buffer_28; -static UINT8 buffer_60; -static UINT8 buffer_68; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 sound_nmi_enable; -static UINT8 sound_nmi_previous; -static UINT8 bankdata; - -#define ALPHA68K_BTLFIELDB 0xff - -// these are configured (static) -static INT32 invert_controls = 0; -static UINT16 game_id; // 5 denotes alpha68k sys. V -static UINT16 coin_id; -static UINT16 microcontroller_id; - -// these are variable -static UINT16 credits; -static UINT16 coinvalue; -static UINT16 deposits2; -static UINT16 deposits1; -static UINT16 coin_latch; -static UINT16 microcontroller_data; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvSrv[1]; -static UINT8 DrvInputs[6]; -static UINT8 DrvReset; - -// Rotation stuff! -dink -static UINT8 DrvFakeInput[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 nRotateHoldInput[2] = {0, 0}; -static INT32 nRotate[2] = {0, 0}; -static INT32 nRotateTarget[2] = {0, 0}; -static INT32 nRotateTry[2] = {0, 0}; -static UINT32 nRotateTime[2] = {0, 0}; -static UINT8 game_rotates = 0; - -static struct BurnInputInfo TimesoldInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 0, "service" }, - {"Service Mode",BIT_DIGITAL, DrvSrv + 0, "diag" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Timesold) - -static struct BurnInputInfo BtlfieldInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 0, "service" }, - {"Service Mode",BIT_DIGITAL, DrvSrv + 0, "diag" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Btlfield) - -static struct BurnInputInfo BtlfieldbInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 0, "service" }, - {"Service Mode",BIT_DIGITAL, DrvSrv + 0, "diag" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Btlfieldb) - -static struct BurnInputInfo GoldmedlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 3" }, - - {"P3 Start", BIT_DIGITAL, DrvJoy4 + 4, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p3 fire 3" }, - - {"P4 Start", BIT_DIGITAL, DrvJoy2 + 6, "p4 start" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 0, "service" }, - {"Service Mode",BIT_DIGITAL, DrvSrv + 0, "diag" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Goldmedl) - -static struct BurnInputInfo SkysoldrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 0, "service" }, - {"Service Mode",BIT_DIGITAL, DrvSrv + 0, "diag" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Skysoldr) - -static struct BurnInputInfo GangwarsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 0, "service" }, - {"Service Mode",BIT_DIGITAL, DrvSrv + 0, "diag" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Gangwars) - -static struct BurnInputInfo SbasebalInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 0, "service" }, - {"Service Mode",BIT_DIGITAL, DrvSrv + 0, "diag" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Sbasebal) - -static struct BurnDIPInfo TimesoldDIPList[]= -{ - {0x15, 0xff, 0xff, 0xdc, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Difficulty" }, - {0x15, 0x01, 0x18, 0x00, "Easy" }, - {0x15, 0x01, 0x18, 0x18, "Normal" }, - {0x15, 0x01, 0x18, 0x10, "Hard" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x15, 0x01, 0x20, 0x00, "English" }, - {0x15, 0x01, 0x20, 0x20, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x16, 0x01, 0x07, 0x07, "A 1C/1C B 1C/1C" }, - {0x16, 0x01, 0x07, 0x06, "A 1C/2C B 2C/1C" }, - {0x16, 0x01, 0x07, 0x05, "A 1C/3C B 3C/1C" }, - {0x16, 0x01, 0x07, 0x04, "A 1C/4C B 4C/1C" }, - {0x16, 0x01, 0x07, 0x03, "A 1C/5C B 5C/1C" }, - {0x16, 0x01, 0x07, 0x02, "A 1C/6C B 6C/1C" }, - {0x16, 0x01, 0x07, 0x01, "A 2C/3C B 7C/1C" }, - {0x16, 0x01, 0x07, 0x00, "A 3C/2C B 8C/1C" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x20, "4" }, - {0x16, 0x01, 0x30, 0x10, "5" }, - {0x16, 0x01, 0x30, 0x00, "6" }, -}; - -STDDIPINFO(Timesold) - -static struct BurnDIPInfo BtlfieldDIPList[]= -{ - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Difficulty" }, - {0x15, 0x01, 0x18, 0x00, "Easy" }, - {0x15, 0x01, 0x18, 0x18, "Normal" }, - {0x15, 0x01, 0x18, 0x10, "Hard" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x15, 0x01, 0x20, 0x00, "English" }, - {0x15, 0x01, 0x20, 0x20, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x16, 0x01, 0x07, 0x07, "A 1C/1C B 1C/1C" }, - {0x16, 0x01, 0x07, 0x06, "A 1C/2C B 2C/1C" }, - {0x16, 0x01, 0x07, 0x05, "A 1C/3C B 3C/1C" }, - {0x16, 0x01, 0x07, 0x04, "A 1C/4C B 4C/1C" }, - {0x16, 0x01, 0x07, 0x03, "A 1C/5C B 5C/1C" }, - {0x16, 0x01, 0x07, 0x02, "A 1C/6C B 6C/1C" }, - {0x16, 0x01, 0x07, 0x01, "A 2C/3C B 7C/1C" }, - {0x16, 0x01, 0x07, 0x00, "A 3C/2C B 8C/1C" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x20, "4" }, - {0x16, 0x01, 0x30, 0x10, "5" }, - {0x16, 0x01, 0x30, 0x00, "6" }, -}; - -STDDIPINFO(Btlfield) - -static struct BurnDIPInfo BtlfieldbDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xf8, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Difficulty" }, - {0x13, 0x01, 0x18, 0x00, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x10, "Hard" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x13, 0x01, 0x20, 0x00, "English" }, - {0x13, 0x01, 0x20, 0x20, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x07, 0x00, "A 1C/1C B 1C/1C" }, - {0x14, 0x01, 0x07, 0x01, "A 1C/2C B 2C/1C" }, - {0x14, 0x01, 0x07, 0x02, "A 1C/3C B 3C/1C" }, - {0x14, 0x01, 0x07, 0x03, "A 1C/4C B 4C/1C" }, - {0x14, 0x01, 0x07, 0x04, "A 1C/5C B 5C/1C" }, - {0x14, 0x01, 0x07, 0x05, "A 1C/6C B 6C/1C" }, - {0x14, 0x01, 0x07, 0x06, "A 2C/3C B 7C/1C" }, - {0x14, 0x01, 0x07, 0x07, "A 3C/2C B 8C/1C" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, -}; - -STDDIPINFO(Btlfieldb) - -static struct BurnDIPInfo GoldmedlDIPList[]= -{ - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xdf, NULL }, - - {0 , 0xfe, 0 , 2, "Event Select" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x15, 0x01, 0x88, 0x00, "Upright 2 Players" }, - {0x15, 0x01, 0x88, 0x80, "Upright 4 Players" }, - {0x15, 0x01, 0x88, 0x88, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Speed For 100M Dash" }, - {0x15, 0x01, 0x20, 0x00, "10 Beats For Max Speed" }, - {0x15, 0x01, 0x20, 0x20, "14 Beats For Max Speed" }, - - {0 , 0xfe, 0 , 2, "Computer Demonstration" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x03, "Easy" }, - {0x16, 0x01, 0x03, 0x02, "Normal" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x16, 0x01, 0x1c, 0x1c, "A 1C/1C B 1C/1C" }, - {0x16, 0x01, 0x1c, 0x18, "A 1C/2C B 2C/1C" }, - {0x16, 0x01, 0x1c, 0x14, "A 1C/3C B 3C/1C" }, - {0x16, 0x01, 0x1c, 0x10, "A 1C/4C B 4C/1C" }, - {0x16, 0x01, 0x1c, 0x0c, "A 1C/5C B 5C/1C" }, - {0x16, 0x01, 0x1c, 0x08, "A 1C/6C B 6C/1C" }, - {0x16, 0x01, 0x1c, 0x04, "A 2C/3C B 7C/1C" }, - {0x16, 0x01, 0x1c, 0x00, "A 3C/2C B 8C/1C" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Goldmedl) - -static struct BurnDIPInfo SkysoldrDIPList[]= -{ - {0x13, 0xff, 0xff, 0xd4, NULL }, - {0x14, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x08, "Easy" }, - {0x13, 0x01, 0x18, 0x10, "Normal" }, - {0x13, 0x01, 0x18, 0x18, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x13, 0x01, 0x20, 0x00, "English" }, - {0x13, 0x01, 0x20, 0x20, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Manufacturer" }, - {0x13, 0x01, 0x40, 0x40, "SNK" }, - {0x13, 0x01, 0x40, 0x00, "Romstar" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x07, 0x07, "A 1C/1C B 1C/1C" }, - {0x14, 0x01, 0x07, 0x06, "A 1C/2C B 2C/1C" }, - {0x14, 0x01, 0x07, 0x05, "A 1C/3C B 3C/1C" }, - {0x14, 0x01, 0x07, 0x04, "A 1C/4C B 4C/1C" }, - {0x14, 0x01, 0x07, 0x03, "A 1C/5C B 5C/1C" }, - {0x14, 0x01, 0x07, 0x02, "A 1C/6C B 6C/1C" }, - {0x14, 0x01, 0x07, 0x01, "A 2C/3C B 7C/1C" }, - {0x14, 0x01, 0x07, 0x00, "A 3C/2C B 8C/1C" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, -}; - -STDDIPINFO(Skysoldr) - - -static struct BurnDIPInfo SkyadvntDIPList[]= -{ - {0x15, 0xff, 0xff, 0xfc, NULL }, - {0x16, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x0c, 0x08, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x04, "4" }, - {0x15, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x40, "Easy" }, - {0x15, 0x01, 0x60, 0x60, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x16, 0x01, 0x0e, 0x0e, "A 1C/1C B 1C/1C" }, - {0x16, 0x01, 0x0e, 0x06, "A 1C/2C B 2C/1C" }, - {0x16, 0x01, 0x0e, 0x0a, "A 1C/3C B 3C/1C" }, - {0x16, 0x01, 0x0e, 0x02, "A 1C/4C B 4C/1C" }, - {0x16, 0x01, 0x0e, 0x0c, "A 1C/5C B 5C/1C" }, - {0x16, 0x01, 0x0e, 0x04, "A 1C/6C B 6C/1C" }, - {0x16, 0x01, 0x0e, 0x08, "A 2C/3C B 7C/1C" }, - {0x16, 0x01, 0x0e, 0x00, "A 3C/2C B 8C/1C" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x10, 0x10, "Off" }, - {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Skyadvnt) - -static struct BurnDIPInfo SkyadvntuDIPList[]= -{ - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x0c, 0x08, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x04, "4" }, - {0x15, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x40, "Easy" }, - {0x15, 0x01, 0x60, 0x60, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Price to Continue" }, - {0x16, 0x01, 0x01, 0x01, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x01, 0x00, "Same as Start" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x02, 0x00, "No" }, - {0x16, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x16, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x0c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x10, 0x10, "Off" }, - {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Skyadvntu) - -static struct BurnDIPInfo GangwarsuDIPList[]= -{ - {0x15, 0xff, 0xff, 0xed, NULL }, - {0x16, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x0c, 0x08, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x04, "4" }, - {0x15, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Timer Speed" }, - {0x15, 0x01, 0x10, 0x00, "Slow" }, - {0x15, 0x01, 0x10, 0x10, "Normal" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x40, "Easy" }, - {0x15, 0x01, 0x60, 0x60, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Price to Continue" }, - {0x16, 0x01, 0x01, 0x01, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x01, 0x00, "Same as Start" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x02, 0x00, "No" }, - {0x16, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x16, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x0c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x10, 0x10, "Off" }, - {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Gangwarsu) - -static struct BurnDIPInfo GangwarsDIPList[]= -{ - {0x15, 0xff, 0xff, 0xed, NULL }, - {0x16, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x15, 0x01, 0x08, 0x08, "3" }, - {0x15, 0x01, 0x08, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Timer Speed" }, - {0x15, 0x01, 0x10, 0x00, "Slow" }, - {0x15, 0x01, 0x10, 0x10, "Normal" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x40, "Easy" }, - {0x15, 0x01, 0x60, 0x60, "Normal" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x16, 0x01, 0x01, 0x00, "1" }, - {0x16, 0x01, 0x01, 0x01, "2" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x16, 0x01, 0x0e, 0x00, "5 Coins 1 Credits" }, - {0x16, 0x01, 0x0e, 0x02, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x0e, 0x04, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0e, 0x0e, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0e, 0x0c, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x0e, 0x0a, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x0e, 0x08, "1 Coin 4 Credits" }, - {0x16, 0x01, 0x0e, 0x06, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x10, 0x10, "Off" }, - {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Gangwars) - -static struct BurnDIPInfo SbasebalDIPList[]= -{ - {0x14, 0xff, 0xff, 0xfd, NULL }, - {0x15, 0xff, 0xff, 0xcf, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Game Time" }, - {0x14, 0x01, 0xc0, 0x00, "3:30" }, - {0x14, 0x01, 0xc0, 0x80, "3:00" }, - {0x14, 0x01, 0xc0, 0x40, "2:30" }, - {0x14, 0x01, 0xc0, 0xc0, "2:00" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x15, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Price to Continue" }, - {0x15, 0x01, 0x10, 0x10, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x10, 0x00, "Same as Start" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Sbasebal) - -// Rotation-handler code - -static void RotateReset() { - for (INT32 playernum = 0; playernum < 2; playernum++) { - nRotate[playernum] = 0; // start out pointing straight up (0=up) - nRotateTarget[playernum] = -1; - nRotateTime[playernum] = 0; - nRotateHoldInput[0] = nRotateHoldInput[1] = 0; - } -} - -static void RotateStateload() { - for (INT32 playernum = 0; playernum < 2; playernum++) { - nRotateTarget[playernum] = -1; - } -} - -static UINT32 RotationTimer(void) { - return nCurrentFrame; -} - -static void RotateRight(INT32 *v) { - (*v)--; - if (*v < 0) *v = 11; -} - -static void RotateLeft(INT32 *v) { - (*v)++; - if (*v > 11) *v = 0; -} - -static UINT8 Joy2Rotate(UINT8 *joy) { // ugly code, but the effect is awesome. -dink - if (joy[0] && joy[2]) return 11; // up left - if (joy[0] && joy[3]) return 1; // up right - - if (joy[1] && joy[2]) return 7; // down left - if (joy[1] && joy[3]) return 4; // down right - - if (joy[0]) return 0; // up - if (joy[1]) return 6; // down - if (joy[2]) return 9; // left - if (joy[3]) return 3; // right - - return 0xff; -} - -static int dialRotation(INT32 playernum) { - // p1 = 0, p2 = 1 - UINT8 player[2] = { 0, 0 }; - static UINT8 lastplayer[2][2] = { { 0, 0 }, { 0, 0 } }; - - if ((playernum != 0) && (playernum != 1)) { - bprintf(PRINT_NORMAL, _T("Strange Rotation address => %06X\n"), playernum); - return 0; - } - if (playernum == 0) { - player[0] = DrvFakeInput[0]; player[1] = DrvFakeInput[1]; - } - if (playernum == 1) { - player[0] = DrvFakeInput[2]; player[1] = DrvFakeInput[3]; - } - - if (player[0] && (player[0] != lastplayer[playernum][0] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateLeft(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Left => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - if (player[1] && (player[1] != lastplayer[playernum][1] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateRight(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Right => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - lastplayer[playernum][0] = player[0]; - lastplayer[playernum][1] = player[1]; - - return (nRotate[playernum]); -} - -static UINT8 *rotate_gunpos[2] = {NULL, NULL}; -static UINT8 rotate_gunpos_multiplier = 1; - -// Gun-rotation memory locations - do not remove this tag. - dink :) -// game p1 p2 clockwise value in memory multiplier -// timesold 0x40017 0x40016 0 1 2 3 4 5 6 7 8 9 a b - -static void RotateSetGunPosRAM(UINT8 *p1, UINT8 *p2, UINT8 multiplier) { - rotate_gunpos[0] = p1; - rotate_gunpos[1] = p2; - rotate_gunpos_multiplier = multiplier; -} - -static INT32 get_distance(INT32 from, INT32 to) { -// this function finds the easiest way to get from "from" to "to", wrapping at 0 and 7 - INT32 countA = 0; - INT32 countB = 0; - INT32 fromtmp = from / rotate_gunpos_multiplier; - INT32 totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp++; - countA++; - if(fromtmp>0xb) fromtmp = 0; - if(fromtmp == totmp || countA > 32) break; - } - - fromtmp = from / rotate_gunpos_multiplier; - totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp--; - countB++; - if(fromtmp<0) fromtmp = 0xb; - if(fromtmp == totmp || countB > 32) break; - } - - if (countA > countB) { - return 1; // go negative - } else { - return 0; // go positive - } -} - -static void RotateDoTick() { - // since the game only allows for 1 rotation every other frame, we have to - // do this. - if (nCurrentFrame&1) return; - - for (INT32 i = 0; i < 2; i++) { - if (rotate_gunpos[i] && (nRotateTarget[i] != -1) && (nRotateTarget[i] != (*rotate_gunpos[i] & 0xff))) { - if (get_distance(nRotateTarget[i], *rotate_gunpos[i] & 0xff)) { - RotateRight(&nRotate[i]); // -- - } else { - RotateLeft(&nRotate[i]); // ++ - } - bprintf(0, _T("p%X target %X mempos %X nRotate %X.\n"), i, nRotateTarget[i], *rotate_gunpos[i] & 0xff, nRotate[i]); - nRotateTry[i]++; - if (nRotateTry[i] > 10) nRotateTarget[i] = -1; // don't get stuck in a loop if something goes horribly wrong here. - } else { - nRotateTarget[i] = -1; - } - } -} - -static void SuperJoy2Rotate() { - for (INT32 i = 0; i < 2; i++) { // p1 = 0, p2 = 1 - if (DrvFakeInput[4 + i]) { // rotate-button had been pressed - UINT8 rot = Joy2Rotate(((!i) ? &DrvJoy1[0] : &DrvJoy2[0])); - if (rot != 0xff) { - nRotateTarget[i] = rot * rotate_gunpos_multiplier; - } - //DrvInput[i] &= ~0xf; // cancel out directionals since they are used to rotate here. - DrvInputs[i] = (DrvInputs[i] & ~0xf) | (nRotateHoldInput[i] & 0xf); // for midnight resistance! be able to duck + change direction of gun. - nRotateTry[i] = 0; - } else { // cache joystick UDLR if the rotate button isn't pressed. - // This feature is for Midnight Resistance, if you are crawling on the - // ground and need to rotate your gun WITHOUT getting up. - nRotateHoldInput[i] = DrvInputs[i]; - } - } - - RotateDoTick(); -} - -// end Rotation-handler - -static void alpha68k_II_video_bank_write(UINT8 offset) -{ - switch (offset) - { - case 0x10: // Reset - bank_base = buffer_28 = buffer_60 = buffer_68 = 0; - return; - - case 0x14: - if (buffer_60) bank_base=1; else bank_base=0; - buffer_28 = 1; - return; - - case 0x18: - if (buffer_68) {if (buffer_60) bank_base = 3; else bank_base = 2; } - if (buffer_28) {if (buffer_60) bank_base = 1; else bank_base = 0; } - return; - - case 0x30: - buffer_28 = buffer_68 = 0; bank_base = 1; - buffer_60 = 1; - return; - - case 0x34: - if (buffer_60) bank_base = 3; else bank_base = 2; - buffer_68 = 1; - return; - - case 0x38: - if (buffer_68) {if (buffer_60) bank_base = 7; else bank_base = 6; } - if (buffer_28) {if (buffer_60) bank_base = 5; else bank_base = 4; } - return; - } -} - -static UINT16 alpha_II_trigger_r(INT32 offset) -{ - offset = (offset / 2) & 0xff; - UINT16 *m_shared_ram = (UINT16*)DrvShareRAM; - static const UINT8 coinage1[8][2] = {{1,1}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {2,3}, {3,2}}; - static const UINT8 coinage2[8][2] = {{1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}}; - UINT16 source = m_shared_ram[offset]; - - switch (offset) - { - case 0: /* Dipswitch 2 */ - m_shared_ram[0] = (source & 0xff00) | DrvDips[1]; - return 0; - - case 0x22: /* Coin value */ - m_shared_ram[0x22] = (source & 0xff00) | (credits & 0x00ff); - return 0; - - case 0x29: /* Query microcontroller for coin insert */ - if ((DrvInputs[2] & 0x3) == 3) - coin_latch = 0; - if ((DrvInputs[2] & 0x1) == 0 && !coin_latch) - { - m_shared_ram[0x29] = (source & 0xff00) | (coin_id & 0xff); // coinA - m_shared_ram[0x22] = (source & 0xff00) | 0x0; - coin_latch = 1; - - if ((coin_id & 0xff) == 0x22) - { - if (game_id == ALPHA68K_BTLFIELDB) - coinvalue = (DrvDips[1] >> 0) & 7; - else - coinvalue = (~DrvDips[1] >> 0) & 7; - - deposits1++; - if (deposits1 == coinage1[coinvalue][0]) - { - credits = coinage1[coinvalue][1]; - deposits1 = 0; - } - else - credits = 0; - } - } - else if ((DrvInputs[2] & 0x2) == 0 && !coin_latch) - { - m_shared_ram[0x29] = (source & 0xff00) | (coin_id >> 8); // coinB - m_shared_ram[0x22] = (source & 0xff00) | 0x0; - coin_latch = 1; - - if ((coin_id >> 8) == 0x22) - { - if (game_id == ALPHA68K_BTLFIELDB) - coinvalue = (DrvDips[1] >> 0) & 7; - else - coinvalue = (~DrvDips[1] >> 0) & 7; - - deposits2++; - if (deposits2 == coinage2[coinvalue][0]) - { - credits = coinage2[coinvalue][1]; - deposits2 = 0; - } - else - credits = 0; - } - } - else - { - if (microcontroller_id == 0x8803) /* Gold Medalist */ - microcontroller_data = 0x21; // timer - else - microcontroller_data = 0x00; - m_shared_ram[0x29] = (source & 0xff00) | microcontroller_data; - } - return 0; - - case 0xfe: /* Custom ID check, same for all games */ - m_shared_ram[0xfe] = (source & 0xff00) | 0x87; - break; - - case 0xff: /* Custom ID check, same for all games */ - m_shared_ram[0xff] = (source & 0xff00) | 0x13; - break; - } - - return 0; /* Values returned don't matter */ -} - -static INT32 alpha_V_trigger_r(UINT16 offset) -{ - offset = (offset / 2) & 0x1fff; - UINT16 *m_shared_ram = (UINT16*)DrvShareRAM; - - static const UINT8 coinage1[8][2] = {{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}}; - static const UINT8 coinage2[8][2] = {{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}}; - int source = m_shared_ram[offset]; - - switch (offset) - { - case 0: /* Dipswitch 1 */ - m_shared_ram[0] = (source & 0xff00) | DrvDips[1]; - return 0; - case 0x22: /* Coin value */ - m_shared_ram[0x22] = (source & 0xff00) | (credits & 0x00ff); - return 0; - case 0x29: /* Query microcontroller for coin insert */ - if ((DrvInputs[2] & 0x3) == 3) - coin_latch = 0; - if ((DrvInputs[2] & 0x1) == 0 && !coin_latch) - { - m_shared_ram[0x29] = (source & 0xff00) | (coin_id & 0xff); // coinA - m_shared_ram[0x22] = (source & 0xff00) | 0x0; - coin_latch = 1; - - if ((coin_id & 0xff) == 0x22) - { - coinvalue = (~DrvDips[1] >> 1) & 7; - deposits1++; - if (deposits1 == coinage1[coinvalue][0]) - { - credits = coinage1[coinvalue][1]; - deposits1 = 0; - } - else - credits = 0; - } - } - else if ((DrvInputs[2] & 0x2) == 0 && !coin_latch) - { - m_shared_ram[0x29] = (source & 0xff00) | (coin_id>>8); // coinB - m_shared_ram[0x22] = (source & 0xff00) | 0x0; - coin_latch = 1; - - if ((coin_id >> 8) == 0x22) - { - coinvalue = (~DrvDips[1] >> 1) & 7; - deposits2++; - if (deposits2 == coinage2[coinvalue][0]) - { - credits = coinage2[coinvalue][1]; - deposits2 = 0; - } - else - credits = 0; - } - } - else - { - microcontroller_data = 0x00; - m_shared_ram[0x29] = (source & 0xff00) | microcontroller_data; - } - - return 0; - case 0xfe: /* Custom ID check */ - m_shared_ram[0xfe] = (source & 0xff00) | (microcontroller_id >> 8); - break; - case 0xff: /* Custom ID check */ - m_shared_ram[0xff] = (source & 0xff00) | (microcontroller_id & 0xff); - break; - - case 0x1f00: /* Dipswitch 1 */ - m_shared_ram[0x1f00] = (source & 0xff00) | DrvDips[1]; - return 0; - case 0x1f29: /* Query microcontroller for coin insert */ - if ((DrvInputs[2] & 0x3) == 3) - coin_latch = 0; - if ((DrvInputs[2] & 0x1) == 0 && !coin_latch) - { - m_shared_ram[0x1f29] = (source & 0xff00) | (coin_id & 0xff); // coinA - m_shared_ram[0x1f22] = (source & 0xff00) | 0x0; - coin_latch = 1; - - if ((coin_id & 0xff) == 0x22) - { - coinvalue = (~DrvDips[1] >> 1) & 7; - deposits1++; - if (deposits1 == coinage1[coinvalue][0]) - { - credits = coinage1[coinvalue][1]; - deposits1 = 0; - } - else - credits = 0; - } - } - else if ((DrvInputs[2] & 0x2) == 0 && !coin_latch) - { - m_shared_ram[0x1f29] = (source & 0xff00) | (coin_id >> 8); // coinB - m_shared_ram[0x1f22] = (source & 0xff00) | 0x0; - coin_latch = 1; - - if ((coin_id >> 8) == 0x22) - { - coinvalue = (~DrvDips[1] >> 1) & 7; - deposits2++; - if (deposits2 == coinage2[coinvalue][0]) - { - credits = coinage2[coinvalue][1]; - deposits2 = 0; - } - else - credits = 0; - } - } - else - { - microcontroller_data = 0x00; - m_shared_ram[0x1f29] = (source & 0xff00) | microcontroller_data; - } - - source = m_shared_ram[0x0163]; - m_shared_ram[0x0163] = (source & 0x00ff) | (DrvDips[1] << 8); - - return 0; - case 0x1ffe: /* Custom ID check */ - m_shared_ram[0x1ffe] = (source & 0xff00) | (microcontroller_id >> 8); - break; - case 0x1fff: /* Custom ID check */ - m_shared_ram[0x1fff] = (source & 0xff00) | (microcontroller_id & 0xff); - break; - } - - return 0; -} - -static void __fastcall alpha68k_ii_write_word(UINT32 address, UINT16 data) -{ -// bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); - - // video ram is written byte-wise - if ((address & 0xfff000) == 0x100000) { - DrvVidRAM[(address / 2) & 0x7ff] = data; - return; - } - - if ((address & 0xfffe00) == 0x300000) { - // microcontroller_w - if (address == 0x30005a) flipscreen = data & 1; - return; - } - - if ((address & 0xffff00) == 0x0c0000) { - alpha68k_II_video_bank_write(address / 2); - return; - } - - switch (address) - { - case 0x080000: - soundlatch = data; - return; - } -} - -static void __fastcall alpha68k_ii_write_byte(UINT32 address, UINT8 data) -{ - // video ram is written byte-wise - if ((address & 0xfff000) == 0x100000) { - DrvVidRAM[(address / 2) & 0x7ff] = data; - return; - } - - if ((address & 0xfffe00) == 0x300000) { - // microcontroller_w - if (address == 0x30005a) flipscreen = data & 1; - return; - } - - if ((address & 0xffff00) == 0x0c0000) { - alpha68k_II_video_bank_write(address / 2); - return; - } - - switch (address) - { - case 0x080001: - soundlatch = data; - return; - } -} - -static UINT16 __fastcall alpha68k_ii_read_word(UINT32 address) -{ - if ((address & 0xfff000) == 0x100000) { - return DrvVidRAM[(address / 2) & 0x7ff]; - } - - if ((address & 0xfffe00) == 0x300000) { - alpha_II_trigger_r(address); - return 0; - } - - switch (address) - { - case 0x080000: - return (DrvInputs[0] + (DrvInputs[1] * 256)); - - case 0x0c0000: { - UINT16 ret = ((~(1 << dialRotation(0))) << 8); - if (invert_controls) ret = ~ret & 0xff00; - return (DrvInputs[3] + ret); - } - - case 0x0c8000: { - UINT16 ret = (((~(1 << dialRotation(1))) << 8) & 0xff00); - if (invert_controls) ret = ~ret; - return ret; - } - - case 0x0d0000: { - UINT16 ret = ((((~(1 << dialRotation(1))) << 4) & 0xf000) - + (((~(1 << dialRotation(0)))) & 0x0f00)); - if (invert_controls) ret = ~ret; - return ret; - } - - case 0x0d8000: - case 0x0e0000: - case 0x0e8000: - return 0; - } - - return 0; -} - -static UINT8 __fastcall alpha68k_ii_read_byte(UINT32 address) -{ - if ((address & 0xfff000) == 0x100000) { - return DrvVidRAM[(address / 2) & 0x7ff]; - } - - if ((address & 0xfffe00) == 0x300000) { - alpha_II_trigger_r(address); - return 0; - } - - switch (address) - { - case 0x080000: - case 0x080001: - case 0x0c0000: - case 0x0c0001: - case 0x0c8000: - case 0x0c8001: - case 0x0d0000: - case 0x0d0001: { - UINT16 ret = alpha68k_ii_read_word(address & ~1); - - return (address & 1) ? (ret & 0xff) : ((ret >> 8) & 0xff); - } - - case 0x0d8000: - case 0x0d8001: - case 0x0e0000: - case 0x0e0001: - case 0x0e8001: - case 0x0e8000: - return 0; - } - - return 0; -} - - -static void __fastcall alpha68k_v_write_word(UINT32 address, UINT16 data) -{ -// bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); - - // video ram is written byte-wise - if ((address & 0xfff000) == 0x100000) { - DrvVidRAM[(address / 2) & 0x7ff] = data; - return; - } - - if ((address & 0xffc000) == 0x300000) { - address &= 0x1ff; - // microcontroller_w - if (address == 0x00005a) flipscreen = data & 1; - return; - } - - if ((address & 0xffff00) == 0x0c0000) { - // not used - return; - } - - switch (address) - { - case 0x080000: - bank_base = data >> 8; - soundlatch = data & 0xff; - return; - } -} - -static void __fastcall alpha68k_v_write_byte(UINT32 address, UINT8 data) -{ -// bprintf (0, _T("WB: %5.5x, %2.2x\n"), address, data); - - // video ram is written byte-wise - if ((address & 0xfff000) == 0x100000) { - DrvVidRAM[(address / 2) & 0x7ff] = data; - return; - } - - if ((address & 0xffc000) == 0x300000) { - address &= 0x1ff; - // microcontroller_w - if (address == 0x00005a) flipscreen = data & 1; - return; - } - - if ((address & 0xffff00) == 0x0c0000) { - // not used - return; - } - - switch (address) - { - case 0x080000: - bank_base = data; - return; - - case 0x080001: - soundlatch = data; - return; - - } -} - -static UINT16 __fastcall alpha68k_v_read_word(UINT32 address) -{ -// bprintf (0, _T("RW: %5.5x\n"), address); - - if ((address & 0xfff000) == 0x100000) { - return DrvVidRAM[(address / 2) & 0x7ff]; - } - - if ((address & 0xffc000) == 0x300000) { - alpha_V_trigger_r(address); - return 0; - } - - switch (address) - { - case 0x080000: - return (DrvInputs[0] + (DrvInputs[1] * 256)); - - case 0x0c0000: - return DrvInputs[3]; - - case 0x0d8000: - case 0x0e0000: - case 0x0e8000: - return 0; - } - - return 0; -} - -static UINT8 __fastcall alpha68k_v_read_byte(UINT32 address) -{ -// if (address != 0x0e8000) bprintf (0, _T("RB: %5.5x\n"), address); - - if ((address & 0xfff000) == 0x100000) { - return DrvVidRAM[(address / 2) & 0x7ff]; - } - - if ((address & 0xffc000) == 0x300000) { - alpha_V_trigger_r(address); - return 0; - } - - switch (address) - { - case 0x080000: - return DrvInputs[1]; - - case 0x080001: - return DrvInputs[0]; - - case 0x0c0000: - return 0; - - case 0x0c0001: - return DrvInputs[3]; - - case 0x0d8000: - case 0x0d8001: - case 0x0e0000: - case 0x0e0001: - case 0x0e8001: - case 0x0e8000: - return 0; - } - - return 0; -} - -static void bankswitch(INT32 data) -{ - if ((data & 0x1f) >= 28) return; - - bankdata = data & 0x1f; - - ZetMapMemory(DrvZ80ROM + (0x10000 + (bankdata * 0x4000)), 0xc000, 0xffff, MAP_ROM); -} - -static void __fastcall alpha68k_ii_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - soundlatch = 0; - return; - - case 0x08: - DACSignedWrite(0, data); - return; - - case 0x0a: - case 0x0b: - BurnYM2413Write(port & 1, data); - return; - - case 0x0c: - case 0x0d: - BurnYM2203Write(0, port & 1, data); - return; - - case 0x0e: - bankswitch(data); - return; - } -} - -static UINT8 __fastcall alpha68k_ii_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return soundlatch; - } - - return 0; -} - -static tilemap_callback( character ) -{ - INT32 tile = DrvVidRAM[offs * 2 + 0] | (bank_base * 256); - INT32 color = DrvVidRAM[offs * 2 + 1] & 0x0f; - - TILE_SET_INFO(0, tile, color, 0); -} - -static UINT8 DrvYM2203ReadPortA(UINT32) -{ - return soundlatch; -} - -static void DrvYM2203WritePortA(UINT32, UINT32 data) -{ - if (data == 0xff) return; - - if (data == 0 && sound_nmi_previous != 0) - sound_nmi_enable = 1; - - if (data != 0 && sound_nmi_previous == 0) - sound_nmi_enable = 0; - - sound_nmi_previous = data & 1; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / ((3579545.00 * 2) / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / (3579545 * 2); -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / (3579545.0 * 2); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM2413Reset(); - BurnYM2203Reset(); - DACReset(); - ZetClose(); - - soundlatch = 0; - flipscreen = 0; - sound_nmi_enable = 0; - sound_nmi_previous = 0; - bank_base = 0; - buffer_28 = 0; - buffer_60 = 0; - buffer_68 = 0; - credits = 0; - coinvalue = 0; - deposits2 = 0; - deposits1 = 0; - coin_latch = 0; - microcontroller_data = 0; - - RotateReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x080000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x800000; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - DrvShareRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x002000; - DrvVidRAM = Next; Next += 0x001000; // 800 - DrvSprRAM = Next; Next += 0x008000; - DrvZ80RAM = Next; Next += 0x001000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(INT32 chartype, INT32 len) -{ - INT32 Plane0[4] = { STEP4(0,4) }; - INT32 XOffs0[8] = { 8*16+3, 8*16+2, 8*16+1, 8*16+0, 3, 2, 1, 0 }; - INT32 YOffs0[8] = { STEP8(0,16) }; - INT32 Plane1[4] = { ((len)/4)*8*0, ((len)/4)*8*1, ((len)/4)*8*2, ((len)/4)*8*3 }; - INT32 XOffs1[16] = { STEP8(128+7,-1), STEP8(7,-1) }; - INT32 YOffs1[16] = { STEP16(0,8) }; - INT32 Plane2[4] = { STEP4(0,1) }; - INT32 XOffs2[8] = { 16*8+4, 16*8+0, 24*8+4, 24*8+0, 4, 0, 8*8+4, 8*8+0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x10000); - - if (chartype == 0) - { - GfxDecode(((0x010000/4)*8)/(8 * 8), 4, 8, 8, Plane0, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - } - else - { - GfxDecode(((0x010000/4)*8)/(8 * 8), 4, 8, 8, Plane2, XOffs2, YOffs1, 0x100, tmp, DrvGfxROM0); - } - - memcpy (tmp, DrvGfxROM1, len); - - GfxDecode((((len)/4)*8)/(16*16), 4, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 Drv2Init(INT32 (*pLoadCb)(), UINT8 invert, UINT16 mc_id, UINT16 coin, UINT8 game) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (pLoadCb) { - if (pLoadCb()) return 1; - } - - DrvGfxDecode(0, 0x200000); - } - - invert_controls = invert; - microcontroller_id = mc_id; - coin_id = coin; - game_id = game; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvShareRAM, 0x040000, 0x040fff, MAP_RAM); -// SekMapMemory(DrvVidRAM, 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x200000, 0x207fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x400000, 0x400fff, MAP_RAM); - SekMapMemory(Drv68KROM + 0x40000, 0x800000, 0x83ffff, MAP_ROM); // data rom - SekSetWriteWordHandler(0, alpha68k_ii_write_word); - SekSetWriteByteHandler(0, alpha68k_ii_write_byte); - SekSetReadWordHandler(0, alpha68k_ii_read_word); - SekSetReadByteHandler(0, alpha68k_ii_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvZ80ROM, 0xc000, 0xffff, MAP_ROM); - ZetSetOutHandler(alpha68k_ii_sound_write_port); - ZetSetInHandler(alpha68k_ii_sound_read_port); - ZetClose(); - - BurnYM2413Init(3579545); - BurnYM2413SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 1); - BurnYM2203SetPorts(0, &DrvYM2203ReadPortA, NULL, &DrvYM2203WritePortA, NULL); - BurnTimerAttachZet(3579545*2); - BurnYM2203SetAllRoutes(0, 0.65, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 0.10); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_COLS, character_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 4, 8, 8, 0x20000, 0, 0xf); - GenericTilemapSetTransparent(0,0); - GenericTilemapSetOffsets(0, 0, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 Drv5Init(INT32 (*pLoadCb)(), UINT8 invert, UINT16 mc_id, UINT16 coin, UINT8 game) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (pLoadCb) { - if (pLoadCb()) return 1; - } - - DrvGfxDecode(1, 0x400000); - } - - invert_controls = invert; - microcontroller_id = mc_id; - coin_id = coin; - game_id = game; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvShareRAM, 0x040000, 0x043fff, MAP_RAM); -// SekMapMemory(DrvVidRAM, 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x200000, 0x207fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(Drv68KROM + 0x40000, 0x800000, 0x83ffff, MAP_ROM); // data rom - SekSetWriteWordHandler(0, alpha68k_v_write_word); - SekSetWriteByteHandler(0, alpha68k_v_write_byte); - SekSetReadWordHandler(0, alpha68k_v_read_word); - SekSetReadByteHandler(0, alpha68k_v_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvZ80ROM, 0xc000, 0xffff, MAP_ROM); - ZetSetOutHandler(alpha68k_ii_sound_write_port); - ZetSetInHandler(alpha68k_ii_sound_read_port); - ZetClose(); - - BurnYM2413Init(3579545); - BurnYM2413SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 1); - BurnYM2203SetPorts(0, &DrvYM2203ReadPortA, NULL, &DrvYM2203WritePortA, NULL); - BurnTimerAttachZet(3579545*2); - BurnYM2203SetAllRoutes(0, 0.65, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 0.10); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_COLS, character_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 4, 8, 8, 0x20000, 0, 0xf); - GenericTilemapSetTransparent(0,0); - GenericTilemapSetOffsets(0, 0, -16); - - DrvDoReset(); - - return 0; -} - - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2203Exit(); - BurnYM2413Exit(); - SekExit(); - ZetExit(); - DACExit(); - - BurnFree (AllMem); - - game_rotates = 0; - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++) - { - UINT16 p = pal[i]; - UINT8 r = pal5bit(((p >> 7) & 0x1e) | ((p >> 14) & 0x01)); - UINT8 g = pal5bit(((p >> 3) & 0x1e) | ((p >> 13) & 0x01)); - UINT8 b = pal5bit(((p << 1) & 0x1e) | ((p >> 12) & 0x01)); - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_sprites(INT32 j, INT32 s, INT32 e, INT32 fx_mask, INT32 fy_mask, INT32 sprite_mask, INT32 color_mask) -{ - UINT16 *spriteram = (UINT16*)DrvSprRAM; - - for (INT32 offs = s; offs < e; offs += 0x40) - { - INT32 my = spriteram[offs + 3 + (j << 1)]; - INT32 mx =(spriteram[offs + 2 + (j << 1)] << 1) | (my >> 15); - my = -my & 0x1ff; - mx = ((mx + 0x100) & 0x1ff) - 0x100; - if (j == 0 && s == 0x7c0) - my++; - - if (flipscreen) - { - mx = 240 - mx; - my = 240 - my; - } - - for (INT32 i = 0; i < 0x40; i += 2) - { - INT32 tile = spriteram[offs + 1 + i + (0x800 * j) + 0x800]; - INT32 color = spriteram[offs + i + (0x800 * j) + 0x800] & color_mask; - - INT32 fx = tile & fx_mask; - INT32 fy = tile & fy_mask; - tile &= sprite_mask; - - if (tile > 0x4fff) continue; - - if (flipscreen) - { - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - } - - if (color) - { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, tile, mx, my - 16, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, tile, mx, my - 16, color, 4, 0, 0, DrvGfxROM1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, tile, mx, my - 16, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, tile, mx, my - 16, color, 4, 0, 0, DrvGfxROM1); - } - } - } - - if (flipscreen) - my = (my - 16) & 0x1ff; - else - my = (my + 16) & 0x1ff; - } - } -} - -static INT32 Alpha68KIIDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; - } - - { - INT32 last_color = BurnDrvGetPaletteEntries() - 1; - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = last_color; - } - } - - GenericTilemapSetFlip(0, flipscreen ? TMAP_FLIPXY : 0); - - if (nBurnLayer & 1) - { - draw_sprites(0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff, 0x7f); - draw_sprites(1, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff, 0x7f); - draw_sprites(2, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff, 0x7f); - draw_sprites(0, 0x0000, 0x07c0, 0x4000, 0x8000, 0x3fff, 0x7f); - } - - if (nBurnLayer & 2) - { - GenericTilemapDraw(0, pTransDraw, 0); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 GangwarsDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; - } - - { - INT32 last_color = BurnDrvGetPaletteEntries() - 1; - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = last_color; - } - } - - GenericTilemapSetFlip(0, flipscreen ? TMAP_FLIPXY : 0); - - if (nBurnLayer & 2) - { - draw_sprites(0, 0x07c0, 0x0800, 0x8000, 0, 0x7fff, 0xff); - draw_sprites(1, 0x0000, 0x0800, 0x8000, 0, 0x7fff, 0xff); - draw_sprites(2, 0x0000, 0x0800, 0x8000, 0, 0x7fff, 0xff); - draw_sprites(0, 0x0000, 0x07c0, 0x8000, 0, 0x7fff, 0xff); - } - - if (nBurnLayer & 2) - { - GenericTilemapDraw(0, pTransDraw, 0); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 SkyadvntDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; - } - - { - INT32 last_color = BurnDrvGetPaletteEntries() - 1; - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = last_color; - } - } - - GenericTilemapSetFlip(0, flipscreen ? TMAP_FLIPXY : 0); - - UINT16 *spriteram = (UINT16*)DrvSprRAM; - - if (nBurnLayer & 1) - { - draw_sprites(0, 0x07c0, 0x0800, 0, 0x8000, 0x7fff, 0xff); - draw_sprites(1, 0x0000, 0x0800, 0, 0x8000, 0x7fff, 0xff); - - if (spriteram[0x1bde] == 0x24 && (spriteram[0x1bdf] >> 8) == 0x3b) - { - draw_sprites(2, 0x03c0, 0x0800, 0, 0x8000, 0x7fff, 0xff); - draw_sprites(2, 0x0000, 0x03c0, 0, 0x8000, 0x7fff, 0xff); - } - else - { - draw_sprites(2, 0x0000, 0x0800, 0, 0x8000, 0x7fff, 0xff); - } - - draw_sprites(0, 0x0000, 0x07c0, 0, 0x8000, 0x7fff, 0xff); - } - - if (nBurnLayer & 2) - { - GenericTilemapDraw(0, pTransDraw, 0); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 SbasebalDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; - } - - { - INT32 last_color = BurnDrvGetPaletteEntries() - 1; - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = last_color; - } - } - - GenericTilemapSetFlip(0, flipscreen ? TMAP_FLIPXY : 0); - - if (nBurnLayer & 1) - { - draw_sprites(0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff, 0xff); - draw_sprites(1, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff, 0xff); - draw_sprites(2, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff, 0xff); - draw_sprites(0, 0x0000, 0x07c0, 0x4000, 0x8000, 0x3fff, 0xff); - } - - if (nBurnLayer & 2) - { - GenericTilemapDraw(0, pTransDraw, 0); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - // 0 p1 inputs - // 1 p2 inputs - // 2 coins -> mcu - // 3 dips 0 - // 4 dips 1 - - DrvInputs[0] = (invert_controls) ? 0 : 0xff; - DrvInputs[1] = (invert_controls) ? 0 : 0xff; - DrvInputs[2] = 0x03; // read by mcu-sim, no inversion - DrvInputs[3] =((DrvSrv[0] ? 0x00 : 0x02) | 0x01 | (DrvDips[0] & 0xfc)) ^ ((invert_controls) ? 0xff : 0x00); - DrvInputs[4] = DrvDips[1]; // read by mcu-sim, no inversion - - for (INT32 i = 0; i < 8; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - if (game_rotates) { - SuperJoy2Rotate(); - } - } - - INT32 nSegment; - INT32 nInterleave = (game_id == 5) ? 141 : 125; // sound nmi - INT32 nTotalCycles[2] = { ((game_id == 5) ? 10000000 : 8000000) / 60, (3579545 * 2) / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nSegment); - if (microcontroller_id == 0x8803) { // goldmedl - - if (i == (nInterleave - 1)) { - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - - if (i == 41 || i == 83 || i == 123) { - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - } else { - if (i == nInterleave - 1) { - SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - } - } - - nSegment = nTotalCycles[1] / nInterleave; - BurnTimerUpdate((i + 1) * nSegment); - if (sound_nmi_enable) ZetNmi(); - } - - BurnTimerEndFrame(nTotalCycles[1]); - - if (pBurnSoundOut) { - BurnYM2413Render(pBurnSoundOut, nBurnSoundLen); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029703; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - BurnYM2413Scan(nAction); - DACScan(nAction, pnMin); - - SCAN_VAR(bankdata); - SCAN_VAR(bank_base); - SCAN_VAR(buffer_28); - SCAN_VAR(buffer_60); - SCAN_VAR(buffer_68); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(sound_nmi_enable); - SCAN_VAR(sound_nmi_previous); - SCAN_VAR(bankdata); - SCAN_VAR(credits); - SCAN_VAR(coinvalue); - SCAN_VAR(deposits2); - SCAN_VAR(deposits1); - SCAN_VAR(coin_latch); - SCAN_VAR(microcontroller_data); - } - - if (nAction & ACB_WRITE) - { - ZetOpen(0); - bankswitch(bankdata); - ZetClose(); - - RotateStateload(); - } - - return 0; -} - - - -// Time Soldiers (US Rev 3) - -static struct BurnRomInfo timesoldRomDesc[] = { - { "bf.3", 0x10000, 0xa491e533, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "bf.4", 0x10000, 0x34ebaccc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bf.1", 0x10000, 0x158f4cb3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bf.2", 0x10000, 0xaf01a718, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bf.7", 0x10000, 0xf8b293b5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "bf.8", 0x10000, 0x8a43497b, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bf.9", 0x10000, 0x1408416f, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_PRG | BRF_ESS }, // 7 MCU Code - - { "bf.6", 0x08000, 0x086a364d, 4 | BRF_GRA }, // 8 Characters - { "bf.5", 0x08000, 0x3cec2f55, 4 | BRF_GRA }, // 9 - - { "bf.10", 0x20000, 0x613313ba, 5 | BRF_GRA }, // 10 Sprites - { "bf.14", 0x20000, 0xefda5c45, 5 | BRF_GRA }, // 11 - { "bf.18", 0x20000, 0xe886146a, 5 | BRF_GRA }, // 12 - { "bf.11", 0x20000, 0x92b42eba, 5 | BRF_GRA }, // 13 - { "bf.15", 0x20000, 0xba3b9f5a, 5 | BRF_GRA }, // 14 - { "bf.19", 0x20000, 0x8994bf10, 5 | BRF_GRA }, // 15 - { "bf.12", 0x20000, 0x7ca8bb32, 5 | BRF_GRA }, // 16 - { "bf.16", 0x20000, 0x2aa74125, 5 | BRF_GRA }, // 17 - { "bf.20", 0x20000, 0xbab6a7c5, 5 | BRF_GRA }, // 18 - { "bf.13", 0x20000, 0x56a3a26a, 5 | BRF_GRA }, // 19 - { "bf.17", 0x20000, 0x6b37d048, 5 | BRF_GRA }, // 20 - { "bf.21", 0x20000, 0xbc3b3944, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(timesold) -STD_ROM_FN(timesold) - -static INT32 TimesoldRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x030000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x050000, 6, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a0000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x120000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1a0000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c0000, 21, 1)) return 1; - - return 0; -} - -static INT32 TimesoldInit() -{ - INT32 rc = Drv2Init(TimesoldRomCb, 0, 0, 0x2222, 0); - - if (!rc) { - game_rotates = 1; - RotateSetGunPosRAM(DrvShareRAM + (0x17), DrvShareRAM + (0x16), 1); - } - - return rc; -} - -struct BurnDriver BurnDrvTimesold = { - "timesold", NULL, NULL, NULL, "1987", - "Time Soldiers (US Rev 3)\0", NULL, "Alpha Denshi Co. (SNK/Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, timesoldRomInfo, timesoldRomName, NULL, NULL, TimesoldInputInfo, TimesoldDIPInfo, - TimesoldInit, DrvExit, DrvFrame, Alpha68KIIDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Time Soldiers (US Rev 1) - -static struct BurnRomInfo timesold1RomDesc[] = { - { "3", 0x10000, 0xbc069a29, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "4", 0x10000, 0xac7dca56, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bf.1", 0x10000, 0x158f4cb3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bf.2", 0x10000, 0xaf01a718, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bf.7", 0x10000, 0xf8b293b5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "bf.8", 0x10000, 0x8a43497b, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bf.9", 0x10000, 0x1408416f, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_PRG | BRF_ESS }, // 7 MCU Code - - { "bf.6", 0x08000, 0x086a364d, 4 | BRF_GRA }, // 8 Characters - { "bf.5", 0x08000, 0x3cec2f55, 4 | BRF_GRA }, // 9 - - { "bf.10", 0x20000, 0x613313ba, 5 | BRF_GRA }, // 10 Sprites - { "bf.14", 0x20000, 0xefda5c45, 5 | BRF_GRA }, // 11 - { "bf.18", 0x20000, 0xe886146a, 5 | BRF_GRA }, // 12 - { "bf.11", 0x20000, 0x92b42eba, 5 | BRF_GRA }, // 13 - { "bf.15", 0x20000, 0xba3b9f5a, 5 | BRF_GRA }, // 14 - { "bf.19", 0x20000, 0x8994bf10, 5 | BRF_GRA }, // 15 - { "bf.12", 0x20000, 0x7ca8bb32, 5 | BRF_GRA }, // 16 - { "bf.16", 0x20000, 0x2aa74125, 5 | BRF_GRA }, // 17 - { "bf.20", 0x20000, 0xbab6a7c5, 5 | BRF_GRA }, // 18 - { "bf.13", 0x20000, 0x56a3a26a, 5 | BRF_GRA }, // 19 - { "bf.17", 0x20000, 0x6b37d048, 5 | BRF_GRA }, // 20 - { "bf.21", 0x20000, 0xbc3b3944, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(timesold1) -STD_ROM_FN(timesold1) - -static INT32 Timesold1Init() -{ - INT32 rc = Drv2Init(TimesoldRomCb, 1, 0, 0x2222, 0); - - if (!rc) { - game_rotates = 1; - RotateSetGunPosRAM(DrvShareRAM + (0x17), DrvShareRAM + (0x16), 1); - } - - return rc; -} - -struct BurnDriver BurnDrvTimesold1 = { - "timesold1", "timesold", NULL, NULL, "1987", - "Time Soldiers (US Rev 1)\0", NULL, "Alpha Denshi Co. (SNK/Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_FLIPPED | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, timesold1RomInfo, timesold1RomName, NULL, NULL, TimesoldInputInfo, TimesoldDIPInfo, - Timesold1Init, DrvExit, DrvFrame, Alpha68KIIDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Battle Field (Japan) - -static struct BurnRomInfo btlfieldRomDesc[] = { - { "bfv1_03.bin", 0x10000, 0x8720af0d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "bfv1_04.bin", 0x10000, 0x7dcccbe6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bf.1", 0x10000, 0x158f4cb3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bf.2", 0x10000, 0xaf01a718, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bf.7", 0x10000, 0xf8b293b5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "bf.8", 0x10000, 0x8a43497b, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bf.9", 0x10000, 0x1408416f, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "bfv1_06.bin", 0x08000, 0x022b9de9, 3 | BRF_GRA }, // 7 Characters - { "bfv1_05.bin", 0x08000, 0xbe269dbf, 3 | BRF_GRA }, // 8 - - { "bf.10", 0x20000, 0x613313ba, 4 | BRF_GRA }, // 9 Sprites - { "bf.14", 0x20000, 0xefda5c45, 4 | BRF_GRA }, // 10 - { "bf.18", 0x20000, 0xe886146a, 4 | BRF_GRA }, // 11 - { "bf.11", 0x20000, 0x92b42eba, 4 | BRF_GRA }, // 12 - { "bf.15", 0x20000, 0xba3b9f5a, 4 | BRF_GRA }, // 13 - { "bf.19", 0x20000, 0x8994bf10, 4 | BRF_GRA }, // 14 - { "bf.12", 0x20000, 0x7ca8bb32, 4 | BRF_GRA }, // 15 - { "bf.16", 0x20000, 0x2aa74125, 4 | BRF_GRA }, // 16 - { "bf.20", 0x20000, 0xbab6a7c5, 4 | BRF_GRA }, // 17 - { "bf.13", 0x20000, 0x56a3a26a, 4 | BRF_GRA }, // 18 - { "bf.17", 0x20000, 0x6b37d048, 4 | BRF_GRA }, // 19 - { "bf.21", 0x20000, 0xbc3b3944, 4 | BRF_GRA }, // 20 -}; - -STD_ROM_PICK(btlfield) -STD_ROM_FN(btlfield) - -static INT32 BtlfieldRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x030000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x050000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a0000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x120000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1a0000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c0000, 20, 1)) return 1; - - return 0; -} - -static INT32 BtlfieldInit() -{ - INT32 rc = Drv2Init(BtlfieldRomCb, 1, 0, 0x2222, 0); - - if (!rc) { - game_rotates = 1; - RotateSetGunPosRAM(DrvShareRAM + (0x17), DrvShareRAM + (0x16), 1); - } - - return rc; -} - -struct BurnDriver BurnDrvBtlfield = { - "btlfield", "timesold", NULL, NULL, "1987", - "Battle Field (Japan)\0", NULL, "Alpha Denshi Co. (SNK license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_FLIPPED | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, btlfieldRomInfo, btlfieldRomName, NULL, NULL, BtlfieldInputInfo, BtlfieldDIPInfo, - BtlfieldInit, DrvExit, DrvFrame, Alpha68KIIDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Battle Field (bootleg) - -static struct BurnRomInfo btlfieldbRomDesc[] = { - { "3.bin", 0x10000, 0x141f10ca, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "1.bin", 0x10000, 0xcaa09adf, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bf.1", 0x10000, 0x158f4cb3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bf.2", 0x10000, 0xaf01a718, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bf.7", 0x10000, 0xf8b293b5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "bf.8", 0x10000, 0x8a43497b, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bf.9", 0x10000, 0x1408416f, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_PRG | BRF_ESS }, // 7 MCU Code - - { "bfv1_06.bin", 0x08000, 0x022b9de9, 4 | BRF_GRA }, // 8 Character - { "bfv1_05.bin", 0x08000, 0xbe269dbf, 4 | BRF_GRA }, // 9 - - { "12.bin", 0x10000, 0x8cab60f2, 5 | BRF_GRA }, // 10 Sprites - { "11.bin", 0x10000, 0xe296581e, 5 | BRF_GRA }, // 11 - { "8.bin", 0x10000, 0x54462294, 5 | BRF_GRA }, // 12 - { "7.bin", 0x10000, 0x03b18a1d, 5 | BRF_GRA }, // 13 - { "5.bin", 0x10000, 0xd6f3d746, 5 | BRF_GRA }, // 14 - { "6.bin", 0x10000, 0x07714f39, 5 | BRF_GRA }, // 15 - { "16.bin", 0x10000, 0x6166553a, 5 | BRF_GRA }, // 16 - { "15.bin", 0x10000, 0x805439d7, 5 | BRF_GRA }, // 17 - { "13.bin", 0x10000, 0x5622cb93, 5 | BRF_GRA }, // 18 - { "14.bin", 0x10000, 0x67860390, 5 | BRF_GRA }, // 19 - { "9.bin", 0x10000, 0x02f73dc5, 5 | BRF_GRA }, // 20 - { "10.bin", 0x10000, 0xe5de7eb8, 5 | BRF_GRA }, // 21 - { "21.bin", 0x10000, 0x81b75cdc, 5 | BRF_GRA }, // 22 - { "22.bin", 0x10000, 0x5231e4df, 5 | BRF_GRA }, // 23 - { "20.bin", 0x10000, 0x5a944f3e, 5 | BRF_GRA }, // 24 - { "19.bin", 0x10000, 0xdb1dcd5e, 5 | BRF_GRA }, // 25 - { "17.bin", 0x10000, 0x69210ee6, 5 | BRF_GRA }, // 26 - { "18.bin", 0x10000, 0x40bf0b3d, 5 | BRF_GRA }, // 27 - { "28.bin", 0x10000, 0x3399e86e, 5 | BRF_GRA }, // 28 - { "27.bin", 0x10000, 0x86529c8a, 5 | BRF_GRA }, // 29 - { "25.bin", 0x10000, 0x6764d81b, 5 | BRF_GRA }, // 30 - { "26.bin", 0x10000, 0x335b7b50, 5 | BRF_GRA }, // 31 - { "24.bin", 0x10000, 0x2e78684a, 5 | BRF_GRA }, // 32 - { "23.bin", 0x10000, 0x500e0dbc, 5 | BRF_GRA }, // 33 -}; - -STD_ROM_PICK(btlfieldb) -STD_ROM_FN(btlfieldb) - -static INT32 BtlfieldbRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x030000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x050000, 6, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x030000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x050000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x090000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a0000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0b0000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0d0000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x110000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x120000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x130000, 25, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140000, 26, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x150000, 27, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 28, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x190000, 29, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1a0000, 30, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1b0000, 31, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c0000, 32, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1d0000, 33, 1)) return 1; - - return 0; -} - -static INT32 BtlfieldbInit() -{ - return Drv2Init(BtlfieldbRomCb, 1, 0, 0x2222, ALPHA68K_BTLFIELDB); -} - -struct BurnDriver BurnDrvBtlfieldb = { - "btlfieldb", "timesold", NULL, NULL, "1987", - "Battle Field (bootleg)\0", "no-rotation joystick ver", "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_FLIPPED | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, btlfieldbRomInfo, btlfieldbRomName, NULL, NULL, BtlfieldbInputInfo, BtlfieldbDIPInfo, - BtlfieldbInit, DrvExit, DrvFrame, Alpha68KIIDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Sky Soldiers (US) - -static struct BurnRomInfo skysoldrRomDesc[] = { - { "ss.3", 0x20000, 0x7b88aa2e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "ss.4", 0x20000, 0xf0283d43, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ss.1", 0x20000, 0x20e9dbc7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ss.2", 0x20000, 0x486f3432, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ss.7", 0x10000, 0xb711fad4, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "ss.8", 0x10000, 0xe5cf7b37, 2 | BRF_PRG | BRF_ESS }, // 5 - { "ss.9", 0x10000, 0x76124ca2, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_PRG | BRF_ESS }, // 7 MCU Code - - { "ss.6", 0x08000, 0x93b30b55, 4 | BRF_GRA }, // 8 Characters - { "ss.5", 0x08000, 0x928ba287, 4 | BRF_GRA }, // 9 - - { "ss.10", 0x20000, 0xe48c1623, 5 | BRF_GRA }, // 10 Sprites - { "ss.14", 0x20000, 0x190c8704, 5 | BRF_GRA }, // 11 - { "ss.18", 0x20000, 0xcb6ff33a, 5 | BRF_GRA }, // 12 - { "ss.22", 0x20000, 0xe69b4485, 5 | BRF_GRA }, // 13 - { "ss.11", 0x20000, 0x6c63e9c5, 5 | BRF_GRA }, // 14 - { "ss.15", 0x20000, 0x55f71ab1, 5 | BRF_GRA }, // 15 - { "ss.19", 0x20000, 0x312a21f5, 5 | BRF_GRA }, // 16 - { "ss.23", 0x20000, 0x923c19c2, 5 | BRF_GRA }, // 17 - { "ss.12", 0x20000, 0x63bb4e89, 5 | BRF_GRA }, // 18 - { "ss.16", 0x20000, 0x138179f7, 5 | BRF_GRA }, // 19 - { "ss.20", 0x20000, 0x268cc7b4, 5 | BRF_GRA }, // 20 - { "ss.24", 0x20000, 0xf63b8417, 5 | BRF_GRA }, // 21 - { "ss.13", 0x20000, 0x3506c06b, 5 | BRF_GRA }, // 22 - { "ss.17", 0x20000, 0xa7f524e0, 5 | BRF_GRA }, // 23 - { "ss.21", 0x20000, 0xcb7bf5fe, 5 | BRF_GRA }, // 24 - { "ss.25", 0x20000, 0x65138016, 5 | BRF_GRA }, // 25 -}; - -STD_ROM_PICK(skysoldr) -STD_ROM_FN(skysoldr) - -static INT32 SkysoldrRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - memcpy (DrvZ80ROM, Drv68KROM + 0x20000, 0x20000); - memcpy (Drv68KROM + 0x20000, Drv68KROM + 0x40000, 0x20000); - memcpy (Drv68KROM + 0x40000, DrvZ80ROM, 0x20000); - memset (DrvZ80ROM, 0, 0x20000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x030000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x050000, 6, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a0000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0e0000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x120000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x160000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1a0000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c0000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1e0000, 25, 1)) return 1; - - return 0; -} - -static INT32 SkysoldrInit() -{ - return Drv2Init(SkysoldrRomCb, 0, 0, 0x2222, 0); -} - -struct BurnDriver BurnDrvSkysoldr = { - "skysoldr", NULL, NULL, NULL, "1988", - "Sky Soldiers (US)\0", NULL, "Alpha Denshi Co. (SNK of America/Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, skysoldrRomInfo, skysoldrRomName, NULL, NULL, SkysoldrInputInfo, SkysoldrDIPInfo, - SkysoldrInit, DrvExit, DrvFrame, Alpha68KIIDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Sky Soldiers (bootleg) - -static struct BurnRomInfo skysoldrblRomDesc[] = { - { "g.bin", 0x10000, 0x4d3273e9, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "c.bin", 0x10000, 0x86c7af62, 1 | BRF_PRG | BRF_ESS }, // 1 - { "e.bin", 0x10000, 0x03115b75, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a.bin", 0x10000, 0x7aa103c7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "h-gtop.bin", 0x10000, 0xf41dfeab, 1 | BRF_PRG | BRF_ESS }, // 4 - { "d-ctop.bin", 0x10000, 0x56560a3c, 1 | BRF_PRG | BRF_ESS }, // 5 - { "f-etop.bin", 0x10000, 0x60a52583, 1 | BRF_PRG | BRF_ESS }, // 6 - { "b-atop.bin", 0x10000, 0x028fd31b, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "33.ic11", 0x10000, 0xb711fad4, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - { "34.ic12", 0x10000, 0xe5cf7b37, 2 | BRF_PRG | BRF_ESS }, // 9 - { "35.ic13", 0x10000, 0x76124ca2, 2 | BRF_PRG | BRF_ESS }, // 10 - - { "68705r3p.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_OPT }, // 11 MCU Code - - { "xx.ic1", 0x08000, 0x93b30b55, 4 | BRF_GRA }, // 12 Characters - { "xx.ic2", 0x08000, 0x928ba287, 4 | BRF_GRA }, // 13 - - { "26.ica9", 0x10000, 0x2aad8c4d, 5 | BRF_GRA }, // 14 Sprites - { "25.ica8", 0x10000, 0x7bca633e, 5 | BRF_GRA }, // 15 - { "28.ic41", 0x10000, 0xda94809d, 5 | BRF_GRA }, // 16 - { "27.ica10", 0x10000, 0xdd1e56c0, 5 | BRF_GRA }, // 17 - { "30.ic43", 0x10000, 0x9eb10d3d, 5 | BRF_GRA }, // 18 - { "31.ic44", 0x10000, 0x6b6c4e56, 5 | BRF_GRA }, // 19 - { "32.ic45", 0x10000, 0xfdf55eca, 5 | BRF_GRA }, // 20 - { "29.ic42", 0x10000, 0xcf888369, 5 | BRF_GRA }, // 21 - { "18.ica1", 0x10000, 0x08419273, 5 | BRF_GRA }, // 22 - { "17.ic30", 0x10000, 0x6258a61b, 5 | BRF_GRA }, // 23 - { "20.ica3", 0x10000, 0x5e716c62, 5 | BRF_GRA }, // 24 - { "19.ica2", 0x10000, 0xf3922f1e, 5 | BRF_GRA }, // 25 - { "22.ica5", 0x10000, 0x1a7c2f20, 5 | BRF_GRA }, // 26 - { "23.ica6", 0x10000, 0x3155aca2, 5 | BRF_GRA }, // 27 - { "24.ica7", 0x10000, 0x8fc95590, 5 | BRF_GRA }, // 28 - { "21.ica4", 0x10000, 0xf7ea25b0, 5 | BRF_GRA }, // 29 - { "10.ic23", 0x10000, 0x8e67a39e, 5 | BRF_GRA }, // 30 - { "9.ic22", 0x10000, 0x6f6d2593, 5 | BRF_GRA }, // 31 - { "12.ic25", 0x10000, 0x549182ba, 5 | BRF_GRA }, // 32 - { "11.ic24", 0x10000, 0xb5b06e28, 5 | BRF_GRA }, // 33 - { "14.ic27", 0x10000, 0x1498a515, 5 | BRF_GRA }, // 34 - { "15.ic28", 0x10000, 0x34545c01, 5 | BRF_GRA }, // 35 - { "16.ic29", 0x10000, 0xea5c20a1, 5 | BRF_GRA }, // 36 - { "13.ic26", 0x10000, 0x962a3e28, 5 | BRF_GRA }, // 37 - { "2.ic15", 0x10000, 0x022bcdc1, 5 | BRF_GRA }, // 38 - { "1.ic14", 0x10000, 0x129a58b5, 5 | BRF_GRA }, // 39 - { "4.ic17", 0x10000, 0xccaf1968, 5 | BRF_GRA }, // 40 - { "3.ic16", 0x10000, 0x796999ba, 5 | BRF_GRA }, // 41 - { "6.ic19", 0x10000, 0x45b1ab8a, 5 | BRF_GRA }, // 42 - { "7.ic20", 0x10000, 0x052247d1, 5 | BRF_GRA }, // 43 - { "8.ic21", 0x10000, 0xf670ce4b, 5 | BRF_GRA }, // 44 - { "5.ic18", 0x10000, 0xfe34cd89, 5 | BRF_GRA }, // 45 -}; - -STD_ROM_PICK(skysoldrbl) -STD_ROM_FN(skysoldrbl) - -static INT32 SkysoldrblRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x060001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x060000, 7, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 8, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x030000, 9, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x050000, 10, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 13, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x030000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x050000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x070000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x090000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a0000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0b0000, 25, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 26, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0d0000, 27, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0e0000, 28, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0f0000, 29, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 30, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x110000, 31, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x120000, 32, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x130000, 33, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140000, 34, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x150000, 35, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x160000, 36, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x170000, 37, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 38, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x190000, 39, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1a0000, 40, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1b0000, 41, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c0000, 42, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1d0000, 43, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1e0000, 44, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1f0000, 45, 1)) return 1; - - return 0; -} - -static INT32 SkysoldrblInit() -{ - return Drv2Init(SkysoldrblRomCb, 0, 0, 0x2222, 0); -} - -struct BurnDriver BurnDrvSkysoldrbl = { - "skysoldrbl", "skysoldr", NULL, NULL, "1988", - "Sky Soldiers (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_FLIPPED | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, skysoldrblRomInfo, skysoldrblRomName, NULL, NULL, SkysoldrInputInfo, SkysoldrDIPInfo, - SkysoldrblInit, DrvExit, DrvFrame, Alpha68KIIDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Gold Medalist (set 1) - -static struct BurnRomInfo goldmedlRomDesc[] = { - { "gm.3", 0x10000, 0xddf0113c, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "gm.4", 0x10000, 0x16db4326, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gm.1", 0x10000, 0x54a11e28, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gm.2", 0x10000, 0x4b6a13e4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "38.bin", 0x10000, 0x4bf251b8, 2 | BRF_PRG | BRF_ESS }, // 4 Z080 Code - { "39.bin", 0x10000, 0x1d92be86, 2 | BRF_PRG | BRF_ESS }, // 5 - { "40.bin", 0x10000, 0x8dafc4e8, 2 | BRF_PRG | BRF_ESS }, // 6 - { "1.bin", 0x10000, 0x1e78062c, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_OPT }, // 8 MCU Code - - { "gm.6", 0x08000, 0x56020b13, 4 | BRF_GRA }, // 9 Characters - { "gm.5", 0x08000, 0x667f33f1, 4 | BRF_GRA }, // 10 - - { "goldchr3.c46", 0x80000, 0x6faaa07a, 5 | BRF_GRA }, // 11 Sprites - { "goldchr2.c45", 0x80000, 0xe6b0aa2c, 5 | BRF_GRA }, // 12 - { "goldchr1.c44", 0x80000, 0x55db41cd, 5 | BRF_GRA }, // 13 - { "goldchr0.c43", 0x80000, 0x76572c3f, 5 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(goldmedl) -STD_ROM_FN(goldmedl) - -static INT32 GoldmedlRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - // goldmedla - memcpy (Drv68KROM + 0x40000, Drv68KROM + 0x20000, 0x20000); - memcpy (Drv68KROM + 0x60000, Drv68KROM + 0x20000, 0x20000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x020000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x030000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x040000, 7, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 10, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 24, 1)) return 1; - - return 0; -} - -static INT32 GoldmedlInit() -{ - return Drv2Init(GoldmedlRomCb, 0, 0x8803, 0x2423, 0); -} - -struct BurnDriver BurnDrvGoldmedl = { - "goldmedl", NULL, NULL, NULL, "1988", - "Gold Medalist (set 1)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, goldmedlRomInfo, goldmedlRomName, NULL, NULL, GoldmedlInputInfo, GoldmedlDIPInfo, - GoldmedlInit, DrvExit, DrvFrame, Alpha68KIIDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Gold Medalist (set 2) - -static struct BurnRomInfo goldmedlaRomDesc[] = { - { "gm3-7.bin", 0x10000, 0x11a63f4c, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "gm4-7.bin", 0x10000, 0xe19966af, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gm1-7.bin", 0x10000, 0x6d87b8a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gm2-7.bin", 0x10000, 0x8d579505, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "38.bin", 0x10000, 0x4bf251b8, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "39.bin", 0x10000, 0x1d92be86, 2 | BRF_PRG | BRF_ESS }, // 5 - { "40.bin", 0x10000, 0x8dafc4e8, 2 | BRF_PRG | BRF_ESS }, // 6 - { "1.bin", 0x10000, 0x1e78062c, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_OPT }, // 8 MCU Code - - { "gm.6", 0x08000, 0x56020b13, 4 | BRF_GRA }, // 9 Characters - { "gm.5", 0x08000, 0x667f33f1, 4 | BRF_GRA }, // 10 - - { "goldchr3.c46", 0x80000, 0x6faaa07a, 5 | BRF_GRA }, // 11 Sprites - { "goldchr2.c45", 0x80000, 0xe6b0aa2c, 5 | BRF_GRA }, // 12 - { "goldchr1.c44", 0x80000, 0x55db41cd, 5 | BRF_GRA }, // 13 - { "goldchr0.c43", 0x80000, 0x76572c3f, 5 | BRF_GRA }, // 14 - - { "gm5-1.bin", 0x10000, 0x77c601a3, 0 | BRF_OPT }, // 15 Unknown? -}; - -STD_ROM_PICK(goldmedla) -STD_ROM_FN(goldmedla) - -static INT32 GoldmedlaRomCb() -{ - memset (Drv68KROM, 0xff, 0x80000); - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x020000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x030000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x040000, 7, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 10, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 24, 1)) return 1; - - return 0; -} - -static INT32 GoldmedlaInit() -{ - return Drv2Init(GoldmedlaRomCb, 0, 0x8803, 0x2423, 0); -} - -struct BurnDriver BurnDrvGoldmedla = { - "goldmedla", "goldmedl", NULL, NULL, "1988", - "Gold Medalist (set 2)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, goldmedlaRomInfo, goldmedlaRomName, NULL, NULL, GoldmedlInputInfo, GoldmedlDIPInfo, - GoldmedlaInit, DrvExit, DrvFrame, Alpha68KIIDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Gold Medalist (bootleg) - -static struct BurnRomInfo goldmedlbRomDesc[] = { - { "l_3.bin", 0x10000, 0x5e106bcf, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "l_4.bin", 0x10000, 0xe19966af, 1 | BRF_PRG | BRF_ESS }, // 1 - { "l_1.bin", 0x08000, 0x7eec7ee5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "l_2.bin", 0x08000, 0xbf59e4f9, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "l_5.bin", 0x10000, 0x77c601a3, 0 | BRF_OPT }, // 4 Unknown? - - { "38.bin", 0x10000, 0x4bf251b8, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "39.bin", 0x10000, 0x1d92be86, 2 | BRF_PRG | BRF_ESS }, // 6 - { "40.bin", 0x10000, 0x8dafc4e8, 2 | BRF_PRG | BRF_ESS }, // 7 - { "1.bin", 0x10000, 0x1e78062c, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "gm.6", 0x08000, 0x56020b13, 3 | BRF_GRA }, // 9 Characters - { "gm.5", 0x08000, 0x667f33f1, 3 | BRF_GRA }, // 10 - - { "goldchr3.c46", 0x80000, 0x6faaa07a, 4 | BRF_GRA }, // 11 Sprites - { "goldchr2.c45", 0x80000, 0xe6b0aa2c, 4 | BRF_GRA }, // 12 - { "goldchr1.c44", 0x80000, 0x55db41cd, 4 | BRF_GRA }, // 13 - { "goldchr0.c43", 0x80000, 0x76572c3f, 4 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(goldmedlb) -STD_ROM_FN(goldmedlb) - -struct BurnDriver BurnDrvGoldmedlb = { - "goldmedlb", "goldmedl", NULL, NULL, "1988", - "Gold Medalist (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, goldmedlbRomInfo, goldmedlbRomName, NULL, NULL, GoldmedlInputInfo, GoldmedlDIPInfo, - GoldmedlaInit, DrvExit, DrvFrame, Alpha68KIIDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Sky Adventure (World) - -static struct BurnRomInfo skyadvntRomDesc[] = { - { "sa1.bin", 0x20000, 0xc2b23080, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "sa2.bin", 0x20000, 0x06074e72, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sa.3", 0x10000, 0x3d0b32e0, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - { "sa.4", 0x10000, 0xc2e3c30c, 2 | BRF_PRG | BRF_ESS }, // 3 - { "sa.5", 0x10000, 0x11cdb868, 2 | BRF_PRG | BRF_ESS }, // 4 - { "sa.6", 0x08000, 0x237d93fd, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_OPT }, // 6 MCU Code - - { "sa.7", 0x08000, 0xea26e9c5, 4 | BRF_GRA }, // 7 Characters - - { "sachr3", 0x80000, 0xa986b8d5, 5 | BRF_GRA }, // 8 Sprites - { "sachr2", 0x80000, 0x504b07ae, 5 | BRF_GRA }, // 9 - { "sachr1", 0x80000, 0xe734dccd, 5 | BRF_GRA }, // 10 - { "sachr0", 0x80000, 0xe281b204, 5 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(skyadvnt) -STD_ROM_FN(skyadvnt) - -static INT32 SkyadvntRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x030000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x050000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x070000, 5, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 11, 1)) return 1; - - memcpy (DrvGfxROM1 + 0x080000, DrvGfxROM1 + 0x000000, 0x080000); - memcpy (DrvGfxROM1 + 0x180000, DrvGfxROM1 + 0x100000, 0x080000); - memcpy (DrvGfxROM1 + 0x280000, DrvGfxROM1 + 0x200000, 0x080000); - memcpy (DrvGfxROM1 + 0x380000, DrvGfxROM1 + 0x300000, 0x080000); - - return 0; -} - -static INT32 SkyadvntInit() -{ - return Drv5Init(SkyadvntRomCb, 0, 0x8814, 0x2222, 5); -} - -struct BurnDriver BurnDrvSkyadvnt = { - "skyadvnt", NULL, NULL, NULL, "1989", - "Sky Adventure (World)\0", NULL, "Alpha Denshi Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, skyadvntRomInfo, skyadvntRomName, NULL, NULL, GangwarsInputInfo, SkyadvntDIPInfo, - SkyadvntInit, DrvExit, DrvFrame, SkyadvntDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; - - -// Sky Adventure (US) - -static struct BurnRomInfo skyadvntuRomDesc[] = { - { "sa_v3.1", 0x20000, 0x862393b5, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "sa_v3.2", 0x20000, 0xfa7a14d1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sa.3", 0x10000, 0x3d0b32e0, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - { "sa.4", 0x10000, 0xc2e3c30c, 2 | BRF_PRG | BRF_ESS }, // 3 - { "sa.5", 0x10000, 0x11cdb868, 2 | BRF_PRG | BRF_ESS }, // 4 - { "sa.6", 0x08000, 0x237d93fd, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_OPT }, // 6 MCU Code - - { "sa.7", 0x08000, 0xea26e9c5, 4 | BRF_GRA }, // 7 Characters - - { "sachr3", 0x80000, 0xa986b8d5, 5 | BRF_GRA }, // 8 Sprites - { "sachr2", 0x80000, 0x504b07ae, 5 | BRF_GRA }, // 9 - { "sachr1", 0x80000, 0xe734dccd, 5 | BRF_GRA }, // 10 - { "sachr0", 0x80000, 0xe281b204, 5 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(skyadvntu) -STD_ROM_FN(skyadvntu) - -static INT32 SkyadvntuInit() -{ - return Drv5Init(SkyadvntRomCb, 0, 0x8814, 0x2423, 5); -} - -struct BurnDriver BurnDrvSkyadvntu = { - "skyadvntu", "skyadvnt", NULL, NULL, "1989", - "Sky Adventure (US)\0", NULL, "Alpha Denshi Co. (SNK of America license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, skyadvntuRomInfo, skyadvntuRomName, NULL, NULL, GangwarsInputInfo, SkyadvntuDIPInfo, - SkyadvntuInit, DrvExit, DrvFrame, SkyadvntDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; - - -// Sky Adventure (Japan) - -static struct BurnRomInfo skyadvntjRomDesc[] = { - { "saj1.c19", 0x20000, 0x662cb4b8, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "saj2.e19", 0x20000, 0x06d6130a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sa.3", 0x10000, 0x3d0b32e0, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - { "sa.4", 0x10000, 0xc2e3c30c, 2 | BRF_PRG | BRF_ESS }, // 3 - { "sa.5", 0x10000, 0x11cdb868, 2 | BRF_PRG | BRF_ESS }, // 4 - { "sa.6", 0x08000, 0x237d93fd, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_OPT }, // 6 MCU Code - - { "sa.7", 0x08000, 0xea26e9c5, 4 | BRF_GRA }, // 7 Characters - - { "sachr3", 0x80000, 0xa986b8d5, 5 | BRF_GRA }, // 8 Sprites - { "sachr2", 0x80000, 0x504b07ae, 5 | BRF_GRA }, // 9 - { "sachr1", 0x80000, 0xe734dccd, 5 | BRF_GRA }, // 10 - { "sachr0", 0x80000, 0xe281b204, 5 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(skyadvntj) -STD_ROM_FN(skyadvntj) - -struct BurnDriver BurnDrvSkyadvntj = { - "skyadvntj", "skyadvnt", NULL, NULL, "1989", - "Sky Adventure (Japan)\0", NULL, "Alpha Denshi Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, skyadvntjRomInfo, skyadvntjRomName, NULL, NULL, GangwarsInputInfo, SkyadvntDIPInfo, - SkyadvntInit, DrvExit, DrvFrame, SkyadvntDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 256, 3, 4 -}; - - -// Gang Wars - -static struct BurnRomInfo gangwarsRomDesc[] = { - { "gw-ver1-e1.19c", 0x20000, 0x7752478e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "gw-ver1-e2.19d", 0x20000, 0xc2f3b85e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gw-ver1-e3.18c", 0x20000, 0x2a5fe86e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gw-ver1-e4.18d", 0x20000, 0xc8b60c53, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gw-12.10f", 0x10000, 0xe6d6c9cf, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "gw-11.11f", 0x10000, 0x7b9f2608, 2 | BRF_PRG | BRF_ESS }, // 5 - { "gw-10.13f", 0x10000, 0xeb305d42, 2 | BRF_PRG | BRF_ESS }, // 6 - { "gw-9.15f", 0x10000, 0x84e5c946, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "alpha.mcu", 0x01000, 0x00000000, 3 | BRF_NODUMP | BRF_OPT }, // 8 MCU Code - - { "gw-13.4l", 0x10000, 0xb75bf1d0, 4 | BRF_GRA }, // 9 Characters - - { "guernica-c3.17h", 0x80000, 0x281a4138, 5 | BRF_GRA }, // 10 Sprites - { "gw-5.21f", 0x20000, 0x9ef36031, 5 | BRF_GRA }, // 11 - { "guernica-c2.18h", 0x80000, 0x2fcbea97, 5 | BRF_GRA }, // 12 - { "gw-6.20f", 0x20000, 0xddbbcda7, 5 | BRF_GRA }, // 13 - { "guernica-c1.20h", 0x80000, 0xb0fd1c23, 5 | BRF_GRA }, // 14 - { "gw-7.18f", 0x20000, 0x4656d377, 5 | BRF_GRA }, // 15 - { "guernica-c0.21h", 0x80000, 0xe60c9882, 5 | BRF_GRA }, // 16 - { "gw-8.17f", 0x20000, 0x798ed82a, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(gangwars) -STD_ROM_FN(gangwars) - -static INT32 GangwarsRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x030000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x050000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x070000, 7, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x280000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x380000, 17, 1)) return 1; - - return 0; -} - -static INT32 GangwarsInit() -{ - return Drv5Init(GangwarsRomCb, 0, 0x8512, 0x2423, 5); -} - -struct BurnDriver BurnDrvGangwars = { - "gangwars", NULL, NULL, NULL, "1989", - "Gang Wars\0", NULL, "Alpha Denshi Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, gangwarsRomInfo, gangwarsRomName, NULL, NULL, GangwarsInputInfo, GangwarsDIPInfo, - GangwarsInit, DrvExit, DrvFrame, GangwarsDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Gang Wars (bootleg) - -static struct BurnRomInfo gangwarsbRomDesc[] = { - { "gwb_ic.m15", 0x20000, 0x7752478e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "gwb_ic.m16", 0x20000, 0xc2f3b85e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gwb_ic.m17", 0x20000, 0x2a5fe86e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gwb_ic.m18", 0x20000, 0xc8b60c53, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gwb_ic.380", 0x10000, 0xe6d6c9cf, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "gwb_ic.421", 0x10000, 0x7b9f2608, 2 | BRF_PRG | BRF_ESS }, // 5 - { "gwb_ic.420", 0x10000, 0xeb305d42, 2 | BRF_PRG | BRF_ESS }, // 6 - { "gwb_ic.419", 0x10000, 0x84e5c946, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "68705.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP | BRF_OPT }, // 8 MCU Code - - { "gwb_ic.m19", 0x10000, 0xb75bf1d0, 3 | BRF_GRA }, // 9 Characters - - { "gwb_ic.308", 0x10000, 0x321a2fdd, 4 | BRF_GRA }, // 10 Sprites - { "gwb_ic.309", 0x10000, 0x4d908f65, 4 | BRF_GRA }, // 11 - { "gwb_ic.310", 0x10000, 0xfc888541, 4 | BRF_GRA }, // 12 - { "gwb_ic.311", 0x10000, 0x181b128b, 4 | BRF_GRA }, // 13 - { "gwb_ic.312", 0x10000, 0x930665f3, 4 | BRF_GRA }, // 14 - { "gwb_ic.313", 0x10000, 0xc18f4ca8, 4 | BRF_GRA }, // 15 - { "gwb_ic.314", 0x10000, 0xdfc44b60, 4 | BRF_GRA }, // 16 - { "gwb_ic.307", 0x10000, 0x28082a7f, 4 | BRF_GRA }, // 17 - { "gwb_ic.280", 0x10000, 0x222b3dcd, 4 | BRF_GRA }, // 18 - { "gwb_ic.321", 0x10000, 0x6b421c7b, 4 | BRF_GRA }, // 19 - { "gwb_ic.300", 0x10000, 0xf3fa0877, 4 | BRF_GRA }, // 20 - { "gwb_ic.301", 0x10000, 0xf8c866de, 4 | BRF_GRA }, // 21 - { "gwb_ic.302", 0x10000, 0x5b0d587d, 4 | BRF_GRA }, // 22 - { "gwb_ic.303", 0x10000, 0xd8c0e102, 4 | BRF_GRA }, // 23 - { "gwb_ic.304", 0x10000, 0xb02bc9d8, 4 | BRF_GRA }, // 24 - { "gwb_ic.305", 0x10000, 0x5e04a9aa, 4 | BRF_GRA }, // 25 - { "gwb_ic.306", 0x10000, 0xe2172955, 4 | BRF_GRA }, // 26 - { "gwb_ic.299", 0x10000, 0xe39f5599, 4 | BRF_GRA }, // 27 - { "gwb_ic.320", 0x10000, 0x9a7b51d8, 4 | BRF_GRA }, // 28 - { "gwb_ic.319", 0x10000, 0xc5b862b7, 4 | BRF_GRA }, // 29 - { "gwb_ic.292", 0x10000, 0xc125f7be, 4 | BRF_GRA }, // 30 - { "gwb_ic.293", 0x10000, 0xc04fce8e, 4 | BRF_GRA }, // 31 - { "gwb_ic.294", 0x10000, 0x4eda3df5, 4 | BRF_GRA }, // 32 - { "gwb_ic.295", 0x10000, 0x6e60c475, 4 | BRF_GRA }, // 33 - { "gwb_ic.296", 0x10000, 0x99b2a557, 4 | BRF_GRA }, // 34 - { "gwb_ic.297", 0x10000, 0x10373f63, 4 | BRF_GRA }, // 35 - { "gwb_ic.298", 0x10000, 0xdf37ec4d, 4 | BRF_GRA }, // 36 - { "gwb_ic.291", 0x10000, 0xbeb07a2e, 4 | BRF_GRA }, // 37 - { "gwb_ic.318", 0x10000, 0x9aeaddf9, 4 | BRF_GRA }, // 38 - { "gwb_ic.317", 0x10000, 0x1622fadd, 4 | BRF_GRA }, // 39 - { "gwb_ic.284", 0x10000, 0x4aa95d66, 4 | BRF_GRA }, // 40 - { "gwb_ic.285", 0x10000, 0x3a1f3ce0, 4 | BRF_GRA }, // 41 - { "gwb_ic.286", 0x10000, 0x886e298b, 4 | BRF_GRA }, // 42 - { "gwb_ic.287", 0x10000, 0xb9542e6a, 4 | BRF_GRA }, // 43 - { "gwb_ic.288", 0x10000, 0x8e620056, 4 | BRF_GRA }, // 44 - { "gwb_ic.289", 0x10000, 0xc754d69f, 4 | BRF_GRA }, // 45 - { "gwb_ic.290", 0x10000, 0x306d1963, 4 | BRF_GRA }, // 46 - { "gwb_ic.283", 0x10000, 0xb46e5761, 4 | BRF_GRA }, // 47 - { "gwb_ic.316", 0x10000, 0x655b1518, 4 | BRF_GRA }, // 48 - { "gwb_ic.315", 0x10000, 0xe7c9b103, 4 | BRF_GRA }, // 49 -}; - -STD_ROM_PICK(gangwarsb) -STD_ROM_FN(gangwarsb) - -static INT32 GangwarsbRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x030000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x050000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x070000, 7, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x030000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x050000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x070000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x090000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x110000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x120000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x130000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x150000, 25, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x160000, 26, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x170000, 27, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 28, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x190000, 29, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 30, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x210000, 31, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x220000, 32, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x230000, 33, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x240000, 34, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x250000, 35, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x260000, 36, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x270000, 37, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x280000, 38, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x290000, 39, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 40, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x310000, 41, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x320000, 42, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x330000, 43, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x340000, 44, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x350000, 45, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x360000, 46, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x370000, 47, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x380000, 48, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x390000, 49, 1)) return 1; - return 0; -} - -static INT32 GangwarsbInit() -{ - return Drv5Init(GangwarsbRomCb, 0, 0x8512, 0x2423, 5); -} - -struct BurnDriver BurnDrvGangwarsb = { - "gangwarsb", "gangwars", NULL, NULL, "1989", - "Gang Wars (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, gangwarsbRomInfo, gangwarsbRomName, NULL, NULL, GangwarsInputInfo, GangwarsDIPInfo, - GangwarsbInit, DrvExit, DrvFrame, GangwarsDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Gang Wars (Japan) - -static struct BurnRomInfo gangwarsjRomDesc[] = { - { "gw-ver1-j1.19c", 0x20000, 0x98bf9668, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "gw-ver1-j2.19d", 0x20000, 0x41868606, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gw-ver1-j3.18c", 0x20000, 0x6e6b7e1f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gw-ver1-j4.18d", 0x20000, 0x1f13eb20, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gw-12.10f", 0x10000, 0xe6d6c9cf, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "gw-11.11f", 0x10000, 0x7b9f2608, 2 | BRF_PRG | BRF_ESS }, // 5 - { "gw-10.13f", 0x10000, 0xeb305d42, 2 | BRF_PRG | BRF_ESS }, // 6 - { "gw-9.15f", 0x10000, 0x84e5c946, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "alpha.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP | BRF_OPT }, // 8 MCU Code - - { "gw-13.4l", 0x10000, 0xb75bf1d0, 3 | BRF_GRA }, // 9 Characters - - { "guernica-c3.17h", 0x80000, 0x281a4138, 4 | BRF_GRA }, // 10 Sprites - { "gw-5.21f", 0x20000, 0x9ef36031, 4 | BRF_GRA }, // 11 - { "guernica-c2.18h", 0x80000, 0x2fcbea97, 4 | BRF_GRA }, // 12 - { "gw-6.20f", 0x20000, 0xddbbcda7, 4 | BRF_GRA }, // 13 - { "guernica-c1.20h", 0x80000, 0xb0fd1c23, 4 | BRF_GRA }, // 14 - { "gw-7.18f", 0x20000, 0x4656d377, 4 | BRF_GRA }, // 15 - { "guernica-c0.21h", 0x80000, 0xe60c9882, 4 | BRF_GRA }, // 16 - { "gw-8.17f", 0x20000, 0x798ed82a, 4 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(gangwarsj) -STD_ROM_FN(gangwarsj) - -struct BurnDriver BurnDrvGangwarsj = { - "gangwarsj", "gangwars", NULL, NULL, "1989", - "Gang Wars (Japan)\0", NULL, "Alpha Denshi Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, gangwarsjRomInfo, gangwarsjRomName, NULL, NULL, GangwarsInputInfo, GangwarsDIPInfo, - GangwarsInit, DrvExit, DrvFrame, GangwarsDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Gang Wars (US) - -static struct BurnRomInfo gangwarsuRomDesc[] = { - { "u1", 0x20000, 0x11433507, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "u2", 0x20000, 0x44cc375f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "u3", 0x20000, 0xde6fd3c0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "u4", 0x20000, 0x43f7f5d3, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "u12", 0x10000, 0x2620caa1, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "u11", 0x10000, 0x2218ceb9, 2 | BRF_PRG | BRF_ESS }, // 5 - { "u10", 0x10000, 0x636978ae, 2 | BRF_PRG | BRF_ESS }, // 6 - { "u9", 0x10000, 0x9136745e, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "alpha.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP | BRF_OPT }, // 8 MCU Code - - { "gw-13.4l", 0x10000, 0xb75bf1d0, 3 | BRF_GRA }, // 9 Characters - - { "guernica-c3.17h", 0x80000, 0x281a4138, 4 | BRF_GRA }, // 10 Sprites - { "u5", 0x20000, 0x94612190, 4 | BRF_GRA }, // 11 - { "guernica-c2.18h", 0x80000, 0x2fcbea97, 4 | BRF_GRA }, // 12 - { "u6", 0x20000, 0x5a4ea0f0, 4 | BRF_GRA }, // 13 - { "guernica-c1.20h", 0x80000, 0xb0fd1c23, 4 | BRF_GRA }, // 14 - { "u7", 0x20000, 0x33f324cb, 4 | BRF_GRA }, // 15 - { "guernica-c0.21h", 0x80000, 0xe60c9882, 4 | BRF_GRA }, // 16 - { "u8", 0x20000, 0xc1995c2c, 4 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(gangwarsu) -STD_ROM_FN(gangwarsu) - -struct BurnDriver BurnDrvGangwarsu = { - "gangwarsu", "gangwars", NULL, NULL, "1989", - "Gang Wars (US)\0", NULL, "Alpha Denshi Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, gangwarsuRomInfo, gangwarsuRomName, NULL, NULL, GangwarsInputInfo, GangwarsuDIPInfo, - GangwarsInit, DrvExit, DrvFrame, GangwarsDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Super Champion Baseball (US) - -static struct BurnRomInfo sbasebalRomDesc[] = { - { "snksb1.c19", 0x20000, 0x304fef2d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "snksb2.e19", 0x20000, 0x35821339, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sb-3.g9", 0x10000, 0x89e12f25, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - { "sb-4.g11", 0x10000, 0xcca2555d, 2 | BRF_PRG | BRF_ESS }, // 3 - { "sb-5.g13", 0x10000, 0xf45ee36f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "sb-6.g15", 0x10000, 0x651c9472, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "alpha.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP | BRF_OPT }, // 6 MCU Code - - { "sb-7.l3", 0x10000, 0x8f3c2e25, 3 | BRF_GRA }, // 7 Characters - - { "kcb-chr3.h21", 0x80000, 0x719071c7, 4 | BRF_GRA }, // 8 Sprites - { "kcb-chr2.h19", 0x80000, 0x014f0f90, 4 | BRF_GRA }, // 9 - { "kcb-chr1.h18", 0x80000, 0xa5ce1e10, 4 | BRF_GRA }, // 10 - { "kcb-chr0.h16", 0x80000, 0xb8a1a088, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(sbasebal) -STD_ROM_FN(sbasebal) - -static INT32 SbasebalRomCb() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - if (BurnLoadRom(DrvZ80ROM + 0x030000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x050000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x070000, 5, 1)) return 1; - -// if (BurnLoadRom(DrvMCUROM + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 11, 1)) return 1; - - return 0; -} - -static INT32 SbasebalInit() -{ - INT32 rc = Drv5Init(SbasebalRomCb, 0, 0x8512, 0x2423, 5); - if (!rc) { - UINT16 *rom = (UINT16*)Drv68KROM; - rom[0xb672/2] = 0x4e71; - rom[0x44e/2] = 0x4e71; - rom[0x450/2] = 0x4e71; - rom[0x458/2] = 0x4e71; - rom[0x45a/2] = 0x4e71; - } - return rc; -} - -struct BurnDriver BurnDrvSbasebal = { - "sbasebal", NULL, NULL, NULL, "1989", - "Super Champion Baseball (US)\0", NULL, "Alpha Denshi Co. (SNK of America license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, sbasebalRomInfo, sbasebalRomName, NULL, NULL, SbasebalInputInfo, SbasebalDIPInfo, - SbasebalInit, DrvExit, DrvFrame, SbasebalDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Super Champion Baseball (Japan) - -static struct BurnRomInfo sbasebaljRomDesc[] = { - { "sb-j-1.c19", 0x20000, 0xc46a3c03, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "sb-j-2.e19", 0x20000, 0xa8ec2287, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sb-3.g9", 0x10000, 0x89e12f25, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - { "sb-4.g11", 0x10000, 0xcca2555d, 2 | BRF_PRG | BRF_ESS }, // 3 - { "sb-5.g13", 0x10000, 0xf45ee36f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "sb-6.g15", 0x10000, 0x651c9472, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "alpha.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP | BRF_OPT }, // 6 MCU Code - - { "sb-7.l3", 0x10000, 0x8f3c2e25, 3 | BRF_GRA }, // 7 Characters - - { "kcb-chr3.h21", 0x80000, 0x719071c7, 4 | BRF_GRA }, // 8 Sprites - { "kcb-chr2.h19", 0x80000, 0x014f0f90, 4 | BRF_GRA }, // 9 - { "kcb-chr1.h18", 0x80000, 0xa5ce1e10, 4 | BRF_GRA }, // 10 - { "kcb-chr0.h16", 0x80000, 0xb8a1a088, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(sbasebalj) -STD_ROM_FN(sbasebalj) - -static INT32 SbasebaljInit() -{ - return Drv5Init(SbasebalRomCb, 0, 0x8512, 0x2423, 5); -} - -struct BurnDriver BurnDrvSbasebalj = { - "sbasebalj", "sbasebal", NULL, NULL, "1989", - "Super Champion Baseball (Japan)\0", NULL, "Alpha Denshi Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, sbasebaljRomInfo, sbasebaljRomName, NULL, NULL, SbasebalInputInfo, SbasebalDIPInfo /*wrong*/, - SbasebaljInit, DrvExit, DrvFrame, SbasebalDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_ambush.cpp b/jan/src/burn/drv/pre90s/d_ambush.cpp deleted file mode 100644 index 93244dac9..000000000 --- a/jan/src/burn/drv/pre90s/d_ambush.cpp +++ /dev/null @@ -1,648 +0,0 @@ -// FB Alpha Ambush driver module -// Based on MAME driver by Zsolt Vasvari - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvScrRAM; -static INT16 *pAY8910Buffer[6]; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static UINT8 *color_bank; -static UINT8 *flipscreen; - -static struct BurnInputInfo AmbushInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Ambush) - -static struct BurnDIPInfo AmbushDIPList[]= -{ - {0x11, 0xff, 0xff, 0xc0, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x00, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x11, 0x01, 0x1c, 0x14, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x1c, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x1c, 0x00, "1 Coins 1 Credit" }, - {0x11, 0x01, 0x1c, 0x04, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x1c, 0x18, "2 Coins 5 Credits" }, - {0x11, 0x01, 0x1c, 0x08, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x1c, 0x0c, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x1c, 0x1c, "Free Play / Service" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x11, 0x01, 0x20, 0x00, "Easy" }, - {0x11, 0x01, 0x20, 0x20, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x11, 0x01, 0x40, 0x40, "80000" }, - {0x11, 0x01, 0x40, 0x00, "120000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x80, 0x80, "Upright" }, - {0x11, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Ambush) - -UINT8 __fastcall ambush_read_byte(UINT16 address) -{ - switch (address) - { - case 0xc800: - return DrvDips[0]; - } - - return 0; -} - -void __fastcall ambush_write_byte(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xcc04: - *flipscreen = data; - break; - - case 0xcc05: - *color_bank = (data & 3) << 4; - break; - } -} - -UINT8 __fastcall ambush_in_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return AY8910Read(0); - - case 0x80: - return AY8910Read(1); - } - - return 0; -} - -void __fastcall ambush_out_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - AY8910Write(0, 0, data); - break; - - case 0x01: - AY8910Write(0, 1, data); - break; - - case 0x80: - AY8910Write(1, 0, data); - break; - - case 0x81: - AY8910Write(1, 1, data); - break; - } -} - -UINT8 AY8910_0_port0(UINT32) -{ - return DrvInputs[0]; -} - -UINT8 AY8910_1_port0(UINT32) -{ - return DrvInputs[1]; -} - -static INT32 DrvDoReset() -{ - memset(AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0;i < 0x100; i++) - { - INT32 bit0,bit1,bit2,r,g,b; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - b = 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void DrvGfxDecode() -{ - static INT32 Plane[2] = { 0, 0x10000 }; - static INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71 }; - static INT32 YOffs[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 128, 136, 144, 152, 160, 168, 176, 184 }; - - UINT8 *tmp = (UINT8 *)BurnMalloc(0x4000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x0400, 2, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - GfxDecode(0x0100, 2, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000200; - DrvColRAM = Next; Next += 0x000100; - DrvScrRAM = Next; Next += 0x000100; - - flipscreen = Next; Next += 0x000001; - color_bank = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 5, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 6, 1)) return 1; - - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetMapArea(0xc000, 0xc0ff, 0, DrvScrRAM); - ZetMapArea(0xc000, 0xc0ff, 1, DrvScrRAM); - ZetMapArea(0xc000, 0xc0ff, 2, DrvScrRAM); - ZetMapArea(0xc100, 0xc1ff, 0, DrvColRAM); - ZetMapArea(0xc100, 0xc1ff, 1, DrvColRAM); - ZetMapArea(0xc100, 0xc1ff, 2, DrvColRAM); - ZetMapArea(0xc200, 0xc3ff, 0, DrvSprRAM); - ZetMapArea(0xc200, 0xc3ff, 1, DrvSprRAM); - ZetMapArea(0xc200, 0xc3ff, 2, DrvSprRAM); - ZetMapArea(0xc400, 0xc7ff, 0, DrvVidRAM); - ZetMapArea(0xc400, 0xc7ff, 1, DrvVidRAM); - ZetMapArea(0xc400, 0xc7ff, 2, DrvVidRAM); - ZetSetWriteHandler(ambush_write_byte); - ZetSetReadHandler(ambush_read_byte); - ZetSetOutHandler(ambush_out_port); - ZetSetInHandler(ambush_in_port); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, &AY8910_0_port0, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, &AY8910_1_port0, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.33, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.33, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(INT32 priority) -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 attr = DrvColRAM[(sy & 0xe0) | (sx >> 3)]; - if ((attr & 0x10) != priority) continue; - - INT32 code = DrvVidRAM[offs] | ((attr & 0x60) << 3); - INT32 color = (attr & 0x0f) | *color_bank; - - sy = (sy + (~DrvScrRAM[(sx >> 3) + 0x80])) & 0xff; - sy -= 16; - - INT32 flip = 0; - - if (*flipscreen) { - flip = 1; - sx = 248 - sx; - sy = (248 - sy) - 16; - } - - if (priority) { - if (flip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM0); - } - } else { - if (flip) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x200 - 4; offs >= 0; offs -= 4) - { - INT32 sy = DrvSprRAM[offs + 0]; - INT32 sx = DrvSprRAM[offs + 3]; - - if (sy == 0 || sy == 0xff || (sx < 0x40 && DrvSprRAM[offs + 2] & 0x10) || (sx >= 0xc0 && ~DrvSprRAM[offs + 2] & 0x10)) - continue; - - INT32 code = (DrvSprRAM[offs + 1] & 0x3f) | ((DrvSprRAM[offs + 2] & 0x60) << 1); - - INT32 color =(DrvSprRAM[offs + 2] & 0x0f) | *color_bank; - INT32 flipx = DrvSprRAM[offs + 1] & 0x40; - INT32 flipy = DrvSprRAM[offs + 1] & 0x80; - - if (*flipscreen) - { - flipx = !flipx; - flipy = !flipy; - sy -= 16; - } - sy += 16; // O.o .. this actually functions as -= 16, because of the calculation below .. - - if (DrvSprRAM[offs + 2] & 0x80) - { - if (*flipscreen) { - sx = 240 - sx; - } else { - sy = 240 - sy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } - } else { - code <<= 2; - - if (*flipscreen) { - sx = 248 - sx; - } else { - sy = 248 - sy; - } - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM0); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - draw_layer(0x00); - draw_sprites(); - draw_layer(0x10); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - ZetOpen(0); - ZetRun(4000000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - } - - return 0; -} - - -// Ambush - -static struct BurnRomInfo ambushRomDesc[] = { - { "a1.i7", 0x2000, 0x31b85d9d, BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "a2.g7", 0x2000, 0x8328d88a, BRF_ESS | BRF_PRG }, // 1 - { "a3.f7", 0x2000, 0x8db57ab5, BRF_ESS | BRF_PRG }, // 2 - { "a4.e7", 0x2000, 0x4a34d2a4, BRF_ESS | BRF_PRG }, // 3 - - { "fa2.n4", 0x2000, 0xe7f134ba, BRF_GRA }, // 4 Graphics tiles - { "fa1.m4", 0x2000, 0xad10969e, BRF_GRA }, // 5 - - { "a.bpr", 0x0100, 0x5f27f511, BRF_GRA }, // 6 color PROMs - - { "b.bpr", 0x0100, 0x1b03fd3b, BRF_OPT }, // 7 Proms - Not used - { "13.bpr", 0x0100, 0x547e970f, BRF_OPT }, // 8 - { "14.bpr", 0x0100, 0x622a8ce7, BRF_OPT }, // 9 -}; - -STD_ROM_PICK(ambush) -STD_ROM_FN(ambush) - -struct BurnDriver BurnDrvAmbush = { - "ambush", NULL, NULL, NULL, "1983", - "Ambush\0", NULL, "Tecfri", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, ambushRomInfo, ambushRomName, NULL, NULL, AmbushInputInfo, AmbushDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - -// Ambush - -static struct BurnRomInfo ambushjRomDesc[] = { - { "ambush.h7", 0x2000, 0xce306563, BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ambush.g7", 0x2000, 0x90291409, BRF_ESS | BRF_PRG }, // 1 - { "ambush.f7", 0x2000, 0xd023ca29, BRF_ESS | BRF_PRG }, // 2 - { "ambush.e7", 0x2000, 0x6cc2d3ee, BRF_ESS | BRF_PRG }, // 3 - - { "ambush.n4", 0x2000, 0xecc0dc85, BRF_GRA }, // 4 Graphics tiles - { "ambush.m4", 0x2000, 0xe86ca98a, BRF_GRA }, // 5 - - { "a.bpr", 0x0100, 0x5f27f511, BRF_GRA }, // 6 color PROMs - - { "b.bpr", 0x0100, 0x1b03fd3b, BRF_OPT }, // 7 Proms - Not used - { "13.bpr", 0x0100, 0x547e970f, BRF_OPT }, // 8 - { "14.bpr", 0x0100, 0x622a8ce7, BRF_OPT }, // 9 -}; - -STD_ROM_PICK(ambushj) -STD_ROM_FN(ambushj) - -struct BurnDriver BurnDrvAmbushj = { - "ambushj", "ambush", NULL, NULL, "1983", - "Ambush (Japan)\0", NULL, "Nippon Amuse Co-Ltd", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, ambushjRomInfo, ambushjRomName, NULL, NULL, AmbushInputInfo, AmbushDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Ambush (hack?) - -static struct BurnRomInfo ambushhRomDesc[] = { - { "a1_hack.i7", 0x2000, 0xa7cd149d, BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "a2.g7", 0x2000, 0x8328d88a, BRF_ESS | BRF_PRG }, // 1 - { "a3.f7", 0x2000, 0x8db57ab5, BRF_ESS | BRF_PRG }, // 2 - { "a4.e7", 0x2000, 0x4a34d2a4, BRF_ESS | BRF_PRG }, // 3 - - { "fa2.n4", 0x2000, 0xe7f134ba, BRF_GRA }, // 4 Graphics tiles - { "fa1.m4", 0x2000, 0xad10969e, BRF_GRA }, // 5 - - { "a.bpr", 0x0100, 0x5f27f511, BRF_GRA }, // 6 color PROMs - - { "b.bpr", 0x0100, 0x1b03fd3b, BRF_OPT }, // 7 Proms - Not used - { "13.bpr", 0x0100, 0x547e970f, BRF_OPT }, // 8 - { "14.bpr", 0x0100, 0x622a8ce7, BRF_OPT }, // 9 -}; - -STD_ROM_PICK(ambushh) -STD_ROM_FN(ambushh) - -struct BurnDriver BurnDrvAmbushh = { - "ambushh", "ambush", NULL, NULL, "1983", - "Ambush (hack?)\0", NULL, "Tecfri", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, ambushhRomInfo, ambushhRomName, NULL, NULL, AmbushInputInfo, AmbushDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Ambush (Volt Elec co-ltd) - -static struct BurnRomInfo ambushvRomDesc[] = { - { "n1.h7", 0x2000, 0x3c0833b4, BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "n2.g7", 0x2000, 0x90291409, BRF_ESS | BRF_PRG }, // 1 - { "n3.f7", 0x2000, 0xd023ca29, BRF_ESS | BRF_PRG }, // 2 - { "n4.e7", 0x2000, 0x6cc2d3ee, BRF_ESS | BRF_PRG }, // 3 - - { "f2.n4", 0x2000, 0xecc0dc85, BRF_GRA }, // 4 Graphics tiles - { "f1.m4", 0x2000, 0xe86ca98a, BRF_GRA }, // 5 - - { "a.bpr", 0x0100, 0x5f27f511, BRF_GRA }, // 6 color PROMs - - { "b.bpr", 0x0100, 0x1b03fd3b, BRF_OPT }, // 7 Proms - Not used - { "13.bpr", 0x0100, 0x547e970f, BRF_OPT }, // 8 - { "14.bpr", 0x0100, 0x622a8ce7, BRF_OPT }, // 9 -}; - -STD_ROM_PICK(ambushv) -STD_ROM_FN(ambushv) - -struct BurnDriver BurnDrvAmbushv = { - "ambushv", "ambush", NULL, NULL, "1983", - "Ambush (Volt Elec co-ltd)\0", NULL, "Volt Elec co-ltd", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, ambushvRomInfo, ambushvRomName, NULL, NULL, AmbushInputInfo, AmbushDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - diff --git a/jan/src/burn/drv/pre90s/d_arabian.cpp b/jan/src/burn/drv/pre90s/d_arabian.cpp deleted file mode 100644 index 12bea5fc6..000000000 --- a/jan/src/burn/drv/pre90s/d_arabian.cpp +++ /dev/null @@ -1,693 +0,0 @@ -// FB Alpha Arabian driver module -// Based on MAME driver by Jarek Burczynski and various others - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvBlitRAM; -static UINT8 *DrvTempBmp; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 *arabian_color; -static UINT8 *flipscreen; - -static INT32 custom_cpu_reset; -static INT32 custom_cpu_busy; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvJoy6[8]; -static UINT8 DrvJoy7[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[8]; -static UINT8 DrvReset; - -static struct BurnInputInfo ArabianInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy4 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy4 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy4 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy4 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy5 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 2, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy6 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy6 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy6 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy6 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy7 + 0, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Arabian) - -static struct BurnDIPInfo ArabianDIPList[]= -{ - {0x10, 0xff, 0xff, 0x06, NULL }, - {0x11, 0xff, 0xff, 0x0d, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x01, 0x00, "3" }, - {0x10, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x02, 0x02, "Upright" }, - {0x10, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x10, 0x01, 0x04, 0x04, "Off" }, - {0x10, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x10, 0x01, 0x08, 0x00, "Easy" }, - {0x10, 0x01, 0x08, 0x08, "Hard" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x10, 0x01, 0xf0, 0x10, "A 2/1 B 2/1" }, - {0x10, 0x01, 0xf0, 0x20, "A 2/1 B 1/3" }, - {0x10, 0x01, 0xf0, 0x00, "A 1/1 B 1/1" }, - {0x10, 0x01, 0xf0, 0x30, "A 1/1 B 1/2" }, - {0x10, 0x01, 0xf0, 0x40, "A 1/1 B 1/3" }, - {0x10, 0x01, 0xf0, 0x50, "A 1/1 B 1/4" }, - {0x10, 0x01, 0xf0, 0x60, "A 1/1 B 1/5" }, - {0x10, 0x01, 0xf0, 0x70, "A 1/1 B 1/6" }, - {0x10, 0x01, 0xf0, 0x80, "A 1/2 B 1/2" }, - {0x10, 0x01, 0xf0, 0x90, "A 1/2 B 1/4" }, - {0x10, 0x01, 0xf0, 0xa0, "A 1/2 B 1/5" }, - {0x10, 0x01, 0xf0, 0xe0, "A 1/2 B 1/6" }, - {0x10, 0x01, 0xf0, 0xb0, "A 1/2 B 1/10" }, - {0x10, 0x01, 0xf0, 0xc0, "A 1/2 B 1/11" }, - {0x10, 0x01, 0xf0, 0xd0, "A 1/2 B 1/12" }, - {0x10, 0x01, 0xf0, 0xf0, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Coin Counters" }, - {0x11, 0x01, 0x01, 0x01, "1" }, - {0x11, 0x01, 0x01, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x0c, 0x0c, "30k 70k 40k+" }, - {0x11, 0x01, 0x0c, 0x04, "20k only" }, - {0x11, 0x01, 0x0c, 0x08, "40k only" }, - {0x11, 0x01, 0x0c, 0x00, "None" }, -}; - -STDDIPINFO(Arabian) - -static struct BurnDIPInfo ArabianaDIPList[]= -{ - {0x10, 0xff, 0xff, 0x06, NULL }, - {0x11, 0xff, 0xff, 0x0d, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x01, 0x00, "3" }, - {0x10, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x02, 0x02, "Upright" }, - {0x10, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x10, 0x01, 0x04, 0x04, "Off" }, - {0x10, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x10, 0x01, 0x08, 0x00, "Easy" }, - {0x10, 0x01, 0x08, 0x08, "Hard" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x10, 0x01, 0xf0, 0x10, "A 2/1 B 2/1" }, - {0x10, 0x01, 0xf0, 0x20, "A 2/1 B 1/3" }, - {0x10, 0x01, 0xf0, 0x00, "A 1/1 B 1/1" }, - {0x10, 0x01, 0xf0, 0x30, "A 1/1 B 1/2" }, - {0x10, 0x01, 0xf0, 0x40, "A 1/1 B 1/3" }, - {0x10, 0x01, 0xf0, 0x50, "A 1/1 B 1/4" }, - {0x10, 0x01, 0xf0, 0x60, "A 1/1 B 1/5" }, - {0x10, 0x01, 0xf0, 0x70, "A 1/1 B 1/6" }, - {0x10, 0x01, 0xf0, 0x80, "A 1/2 B 1/2" }, - {0x10, 0x01, 0xf0, 0x90, "A 1/2 B 1/4" }, - {0x10, 0x01, 0xf0, 0xa0, "A 1/2 B 1/5" }, - {0x10, 0x01, 0xf0, 0xe0, "A 1/2 B 1/6" }, - {0x10, 0x01, 0xf0, 0xb0, "A 1/2 B 1/10" }, - {0x10, 0x01, 0xf0, 0xc0, "A 1/2 B 1/11" }, - {0x10, 0x01, 0xf0, 0xd0, "A 1/2 B 1/12" }, - {0x10, 0x01, 0xf0, 0xf0, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Coin Counters" }, - {0x11, 0x01, 0x01, 0x01, "1" }, - {0x11, 0x01, 0x01, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x0c, 0x0c, "20k 50k 150k 100k+" }, - {0x11, 0x01, 0x0c, 0x04, "20k only" }, - {0x11, 0x01, 0x0c, 0x08, "40k only" }, - {0x11, 0x01, 0x0c, 0x00, "None" }, -}; - -STDDIPINFO(Arabiana) - -static UINT8 custom_cpu_r(UINT16 offset) -{ - if (custom_cpu_reset || offset < 0x7f0) - return DrvZ80RAM[offset]; - - switch (offset & 0x0f) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - return DrvInputs[(offset & 0x0f)+2]; - - case 6: - return custom_cpu_busy ^= 1; - - case 8: - return DrvZ80RAM[offset - 1]; - - default: - return 0; - } - return 0; -} - -static void blit_area(UINT8 plane, UINT16 src, UINT8 x, UINT8 y, UINT8 sx, UINT8 sy) -{ - UINT8 *srcdata = DrvGfxROM + src * 4; - - for (INT32 i = 0; i <= sx; i++, x += 4) - { - for (INT32 j = 0; j <= sy; j++) - { - UINT8 p1 = *srcdata++; - UINT8 p2 = *srcdata++; - UINT8 p3 = *srcdata++; - UINT8 p4 = *srcdata++; - UINT8 *base = DrvTempBmp + (((y + j) & 0xff) * 256 + (x & 0xff)); - - if (plane & 0x01) - { - if (p4 != 8) base[0] = (base[0] & ~0xf0) | (p4 << 4); - if (p3 != 8) base[1] = (base[1] & ~0xf0) | (p3 << 4); - if (p2 != 8) base[2] = (base[2] & ~0xf0) | (p2 << 4); - if (p1 != 8) base[3] = (base[3] & ~0xf0) | (p1 << 4); - } - - if (plane & 0x04) - { - if (p4 != 8) base[0] = (base[0] & ~0x0f) | p4; - if (p3 != 8) base[1] = (base[1] & ~0x0f) | p3; - if (p2 != 8) base[2] = (base[2] & ~0x0f) | p2; - if (p1 != 8) base[3] = (base[3] & ~0x0f) | p1; - } - } - } -} - -static void arabian_blitter_w(INT32 offset, UINT8 data) -{ - DrvBlitRAM[offset] = data; - - if (offset == 0x0006) - { - INT32 plane = DrvBlitRAM[offset - 6]; - INT32 src = DrvBlitRAM[offset - 5] | (DrvBlitRAM[offset - 4] << 8); - INT32 x = DrvBlitRAM[offset - 2] << 2; - INT32 y = DrvBlitRAM[offset - 3]; - INT32 sx = DrvBlitRAM[offset - 0]; - INT32 sy = DrvBlitRAM[offset - 1]; - - blit_area(plane, src, x, y, sx, sy); - } -} - -void __fastcall arabian_videoram_w(UINT16 offset, UINT8 data) -{ - UINT8 *base; - UINT8 x, y; - - x = (offset >> 8) << 2; - y = offset & 0xff; - - DrvVidRAM[offset & 0x3fff] = data; - - base = &DrvTempBmp[y * 256 + x]; - - if (DrvBlitRAM[0] & 0x08) - { - base[0] = (base[0] & ~0x03) | ((data & 0x10) >> 3) | ((data & 0x01) >> 0); - base[1] = (base[1] & ~0x03) | ((data & 0x20) >> 4) | ((data & 0x02) >> 1); - base[2] = (base[2] & ~0x03) | ((data & 0x40) >> 5) | ((data & 0x04) >> 2); - base[3] = (base[3] & ~0x03) | ((data & 0x80) >> 6) | ((data & 0x08) >> 3); - } - - if (DrvBlitRAM[0] & 0x04) - { - base[0] = (base[0] & ~0x0c) | ((data & 0x10) >> 1) | ((data & 0x01) << 2); - base[1] = (base[1] & ~0x0c) | ((data & 0x20) >> 2) | ((data & 0x02) << 1); - base[2] = (base[2] & ~0x0c) | ((data & 0x40) >> 3) | ((data & 0x04) << 0); - base[3] = (base[3] & ~0x0c) | ((data & 0x80) >> 4) | ((data & 0x08) >> 1); - } - - if (DrvBlitRAM[0] & 0x02) - { - base[0] = (base[0] & ~0x30) | ((data & 0x10) << 1) | ((data & 0x01) << 4); - base[1] = (base[1] & ~0x30) | ((data & 0x20) << 0) | ((data & 0x02) << 3); - base[2] = (base[2] & ~0x30) | ((data & 0x40) >> 1) | ((data & 0x04) << 2); - base[3] = (base[3] & ~0x30) | ((data & 0x80) >> 2) | ((data & 0x08) << 1); - } - - if (DrvBlitRAM[0] & 0x01) - { - base[0] = (base[0] & ~0xc0) | ((data & 0x10) << 3) | ((data & 0x01) << 6); - base[1] = (base[1] & ~0xc0) | ((data & 0x20) << 2) | ((data & 0x02) << 5); - base[2] = (base[2] & ~0xc0) | ((data & 0x40) << 1) | ((data & 0x04) << 4); - base[3] = (base[3] & ~0xc0) | ((data & 0x80) << 0) | ((data & 0x08) << 3); - } -} - -void __fastcall arabian_write(UINT16 address, UINT8 data) -{ - if ((address & 0xc000) == 0x8000) { - arabian_videoram_w(address & 0x3fff, data); - return; - } - - if ((address & 0xf000) == 0xe000) { - arabian_blitter_w(address & 0x0007, data); - return; - } -} - -UINT8 __fastcall arabian_read(UINT16 address) -{ - if ((address & 0xfe00) == 0xc000) { - return DrvInputs[0]; - } - - if ((address & 0xfe00) == 0xc200) { - return DrvDips[0]; - } - - if ((address & 0xff00) == 0xd700) { - return custom_cpu_r(address & 0x7ff); - } - - return 0; -} - -void __fastcall arabian_out(UINT16 port, UINT8 data) -{ - switch (port) - { - case 0xc800: - AY8910Write(0, 0, data); - break; - - case 0xca00: - AY8910Write(0, 1, data); - break; - } -} - -void ay8910_porta_w(UINT32, UINT32 data) -{ - *arabian_color = data >> 3; -} - -void ay8910_portb_w(UINT32, UINT32 data) -{ - custom_cpu_reset = ~data & 0x10; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - HiscoreReset(); - - custom_cpu_reset = 0; - custom_cpu_busy = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x004000; - DrvBlitRAM = Next; Next += 0x001000; - - DrvTempBmp = Next; Next += 256 * 256; - - flipscreen = Next; Next += 0x000001; - arabian_color = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 tpal[0x40]; - - for (INT32 i = 0; i < 64; i++) - { - INT32 r, b, g; - r = ((i >> 5) & 1) * (153*192/255) + ((i >> 4) & 1) * (102*192/255) + ((i & 0x30) ? 63 : 0); - g = ((i >> 3) & 1) * (156*192/255) + ((i >> 2) & 1) * (99*192/255) + ((i & 0x0c) ? 63 : 0); - b = ((i >> 1) & 1) * 192 + ((i >> 0) & 1) * 63; - tpal[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < (1 << 13); i++) - { - INT32 ena = (i >> 12) & 1; - INT32 enb = (i >> 11) & 1; - INT32 abhf = (~i >> 10) & 1; - INT32 aghf = (~i >> 9) & 1; - INT32 arhf = (~i >> 8) & 1; - INT32 az = (i >> 7) & 1; - INT32 ar = (i >> 6) & 1; - INT32 ag = (i >> 5) & 1; - INT32 ab = (i >> 4) & 1; - INT32 bz = (i >> 3) & 1; - INT32 br = (i >> 2) & 1; - INT32 bg = (i >> 1) & 1; - INT32 bb = (i >> 0) & 1; - - INT32 planea = (az | ar | ag | ab) & ena; - - INT32 rhi = planea ? ar : enb ? bz : 0; - INT32 rlo = planea ? (((!arhf) & az) ? 0 : ar) : enb ? br : 0; - - INT32 ghi = planea ? ag : enb ? bb : 0; - INT32 glo = planea ? (((!aghf) & az) ? 0 : ag) : enb ? bg : 0; - - INT32 bhi = ab; - INT32 bbase = ((!abhf) & az) ? 0 : ab; - - INT32 t = (rhi << 5) | (rlo << 4) | (ghi << 3) | (glo << 2) | (bhi << 1) | bbase; - - DrvPalette[i] = tpal[t]; - } -} - -static void DrvGfxDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - - for (INT32 offs = 0; offs < 0x4000 * 4; offs+=4) - { - INT32 v1 = DrvGfxROM[(offs / 4) + 0x0000]; - INT32 v2 = DrvGfxROM[(offs / 4) + 0x4000]; - - for (INT32 j = 0; j < 4; j++, v1>>=1, v2>>=1) { - tmp[offs + 3 - j] = (v1 & 1) | ((v1 >> 3) & 2) | ((v2 << 2) & 4) | ((v2 >> 1) & 8); - } - } - - memcpy (DrvGfxROM, tmp, 0x10000); - BurnFree (tmp); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x4000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x6000, 7, 1)) return 1; - - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xd000, 0xd6ff, 0, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(arabian_write); - ZetSetReadHandler(arabian_read); - ZetSetOutHandler(arabian_out); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, ay8910_porta_w, ay8910_portb_w); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - - BurnFree (AllMem); - - return 0; -} - -static inline void update_flip_state() -{ - *flipscreen = DrvZ80RAM[0x034b]; - - if (DrvZ80RAM[0x0400] != 0 && !(DrvZ80RAM[0x0401] & 0x02)) - *flipscreen = !*flipscreen; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - update_flip_state(); - - UINT16 *pDst = pTransDraw; - UINT8 *pSrc = DrvTempBmp + (11 * 256); - - if (*flipscreen) { - pDst += nScreenWidth * (nScreenHeight - 1); - for (INT32 y = 11; y < 256-11; y++) { - for (INT32 x = 0; x < 256; x++) { - pDst[x] = pSrc[x ^ 0xff]; - } - pDst -= nScreenWidth; - pSrc += 256; - } - } else { - for (INT32 y = 11; y < 256-11; y++) { - for (INT32 x = 0; x < 256; x++) { - pDst[x] = pSrc[x]; - } - pDst += nScreenWidth; - pSrc += 256; - } - } - - BurnTransferCopy(DrvPalette + (*arabian_color << 8)); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 8); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy6[i] & 1) << i; - DrvInputs[6] ^= (DrvJoy7[i] & 1) << i; - } - DrvInputs[1] = DrvDips[0]; - DrvInputs[2] |= 1; - DrvInputs[7] = DrvDips[1]; - } - - ZetOpen(0); - ZetRun(3000000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(custom_cpu_reset); - SCAN_VAR(custom_cpu_busy); - } - - return 0; -} - - -// Arabian - -static struct BurnRomInfo arabianRomDesc[] = { - { "ic1rev2.87", 0x2000, 0x5e1c98b8, BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ic2rev2.88", 0x2000, 0x092f587e, BRF_ESS | BRF_PRG }, // 1 - { "ic3rev2.89", 0x2000, 0x15145f23, BRF_ESS | BRF_PRG }, // 2 - { "ic4rev2.90", 0x2000, 0x32b77b44, BRF_ESS | BRF_PRG }, // 3 - - { "tvg-91.ic84",0x2000, 0xc4637822, BRF_GRA }, // 4 Graphics - { "tvg-92.ic85",0x2000, 0xf7c6866d, BRF_GRA }, // 5 - { "tvg-93.ic86",0x2000, 0x71acd48d, BRF_GRA }, // 6 - { "tvg-94.ic87",0x2000, 0x82160b9a, BRF_GRA }, // 7 - - { "sun-8212.ic3",0x0800, 0x8869611e, BRF_OPT }, // 8 MCU -}; - -STD_ROM_PICK(arabian) -STD_ROM_FN(arabian) - -struct BurnDriver BurnDrvarabian = { - "arabian", NULL, NULL, NULL, "1983", - "Arabian\0", NULL, "Sun Electronics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, arabianRomInfo, arabianRomName, NULL, NULL, ArabianInputInfo, ArabianDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 234, 256, 3, 4 -}; - -// Arabian (Atari) - -static struct BurnRomInfo arabianaRomDesc[] = { - { "tvg-87.ic1", 0x2000, 0x51e9a6b1, BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "tvg-88.ic2", 0x2000, 0x1cdcc1ab, BRF_ESS | BRF_PRG }, // 1 - { "tvg-89.ic3", 0x2000, 0xb7b7faa0, BRF_ESS | BRF_PRG }, // 2 - { "tvg-90.ic4", 0x2000, 0xdbded961, BRF_ESS | BRF_PRG }, // 3 - - { "tvg-91.ic84",0x2000, 0xc4637822, BRF_GRA }, // 4 Graphics - { "tvg-92.ic85",0x2000, 0xf7c6866d, BRF_GRA }, // 5 - { "tvg-93.ic86",0x2000, 0x71acd48d, BRF_GRA }, // 6 - { "tvg-94.ic87",0x2000, 0x82160b9a, BRF_GRA }, // 7 - - { "sun-8212.ic3",0x0800, 0x8869611e, BRF_OPT }, // 8 MCU -}; - -STD_ROM_PICK(arabiana) -STD_ROM_FN(arabiana) - -struct BurnDriver BurnDrvarabiana = { - "arabiana", "arabian", NULL, NULL, "1983", - "Arabian (Atari)\0", NULL, "[Sun Electronics] (Atari license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, arabianaRomInfo, arabianaRomName, NULL, NULL, ArabianInputInfo, ArabianaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 234, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_armedf.cpp b/jan/src/burn/drv/pre90s/d_armedf.cpp deleted file mode 100644 index 30b764f95..000000000 --- a/jan/src/burn/drv/pre90s/d_armedf.cpp +++ /dev/null @@ -1,2350 +0,0 @@ -// FB Alpha Armed Formation driver module -// Based on MAME driver by Carlos A. Lozano, Phil Stroffolino, and Takahiro Nogi -// -// nb1414m4 hooked up to Kozure Ookami July 8 2015 -dink -// sprite colour lookup table support added July 15 2015 -dink -// - July 16 2015 - -// text layer priorities added, fixes certain/cutscene text effects in legion & terraf -// fix fg layer scrolling in terraf/terrafu/terrafj -// fix chaotic music tempo & dac sound clarity in all games -dink -// -// - dec 27, 2016 - -// added Tatakae! Big Fighter / SkyRobo, biiiiiig thanks to Caps0ff.blogspot.com -// for dumping the impossible / badly damaged & protected i8751 protection mcu -dink -// - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "mcs51.h" -#include "burn_ym3812.h" -#include "dac.h" -#include "nb1414m4.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *Drv68KRAM2; -static UINT8 *DrvShareRAM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvTxRAM; -static UINT32 *DrvPalette; - -static UINT16*DrvSprClut; -static UINT16*DrvMcuCmd; -static UINT16*DrvScroll; -static UINT8 *DrvVidRegs; -static UINT8 *soundlatch; -static UINT8 *flipscreen; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[3]; -static UINT16 DrvInputs[4]; -static UINT8 DrvReset; - -static INT32 scroll_type; -static INT32 sprite_offy; -static INT32 yoffset; -static INT32 xoffset; -static INT32 irqline; - -static UINT32 fg_scrolly = 0; -static UINT32 fg_scrollx = 0; -static UINT32 waiting_msb = 0; -static UINT32 scroll_msb = 0; - -static INT32 usemcu = 0; - -static INT32 Terrafjb = 0; -static INT32 Kozuremode = 0; -static INT32 Skyrobo = 0; -static INT32 fiftysevenhertz = 0; - -static struct BurnInputInfo ArmedfInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 10, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 8, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 9, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 8, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 10, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Armedf) - -static struct BurnInputInfo Cclimbr2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 10, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 8, "p1 start" }, - {"P1 Up 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Up 2", BIT_DIGITAL, DrvJoy1 + 4, "p3 up" }, - {"P1 Down 2", BIT_DIGITAL, DrvJoy1 + 5, "p3 down" }, - {"P1 Left 2", BIT_DIGITAL, DrvJoy1 + 6, "p3 left" }, - {"P1 Right 2", BIT_DIGITAL, DrvJoy1 + 7, "p3 right" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 9, "p2 start" }, - {"P2 Up 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down 1", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left 1", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Up 2", BIT_DIGITAL, DrvJoy2 + 4, "p4 up" }, - {"P2 Down 2", BIT_DIGITAL, DrvJoy2 + 5, "p4 down" }, - {"P2 Left 2", BIT_DIGITAL, DrvJoy2 + 6, "p4 left" }, - {"P2 Right 2", BIT_DIGITAL, DrvJoy2 + 7, "p4 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 8, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 10, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Cclimbr2) - -static struct BurnInputInfo BigfghtrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 10, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 8, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 9, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 8, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Bigfghtr) - - -static struct BurnDIPInfo BigfghtrDIPList[]= -{ - {0x14, 0xff, 0xff, 0xdf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x02, "4" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "80k then every 80k" }, - {0x14, 0x01, 0x0c, 0x04, "80k then every 100k" }, - {0x14, 0x01, 0x0c, 0x08, "100k then every 80k" }, - {0x14, 0x01, 0x0c, 0x00, "100k then every 100k" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x20, 0x00, "Upright" }, - {0x14, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0xc0, 0xc0, "Easy" }, - {0x14, 0x01, 0xc0, 0x80, "Normal" }, - {0x14, 0x01, 0xc0, 0x40, "Hard" }, - {0x14, 0x01, 0xc0, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, -}; - -STDDIPINFO(Bigfghtr) - -static struct BurnDIPInfo ArmedfDIPList[]= -{ - {0x15, 0xff, 0xff, 0xdf, NULL }, - {0x16, 0xff, 0xff, 0xcf, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "1st Bonus Life" }, - {0x15, 0x01, 0x04, 0x04, "20k" }, - {0x15, 0x01, 0x04, 0x00, "40k" }, - - {0 , 0xfe, 0 , 2, "2nd Bonus Life" }, - {0x15, 0x01, 0x08, 0x08, "60k" }, - {0x15, 0x01, 0x08, 0x00, "80k" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x0c, "20k then every 60k" }, - {0x15, 0x01, 0x0c, 0x04, "20k then every 80k" }, - {0x15, 0x01, 0x0c, 0x08, "40k then every 60k" }, - {0x15, 0x01, 0x0c, 0x00, "40k then every 80k" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x10, 0x00, "Off" }, - {0x15, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x20, 0x00, "Upright" }, - {0x15, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0xc0, 0xc0, "Easy" }, - {0x15, 0x01, 0xc0, 0x80, "Normal" }, - {0x15, 0x01, 0xc0, 0x40, "Hard" }, - {0x15, 0x01, 0xc0, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x16, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x16, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x16, 0x01, 0x30, 0x30, "No" }, - {0x16, 0x01, 0x30, 0x20, "3 Times" }, - {0x16, 0x01, 0x30, 0x10, "5 Times" }, - {0x16, 0x01, 0x30, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Armedf) - -static struct BurnDIPInfo KozureDIPList[]= -{ - {0x15, 0xff, 0xff, 0xcf, NULL }, - {0x16, 0xff, 0xff, 0xcf, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "1st Bonus Life" }, - {0x15, 0x01, 0x04, 0x04, "None" }, - {0x15, 0x01, 0x04, 0x00, "50k" }, - - {0 , 0xfe, 0 , 2, "2nd Bonus Life" }, - {0x15, 0x01, 0x08, 0x08, "60k" }, - {0x15, 0x01, 0x08, 0x00, "90k" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x08, "50k then every 60k" }, - {0x15, 0x01, 0x0c, 0x00, "50k then every 90k" }, - {0x15, 0x01, 0x0c, 0x0c, "Every 60k" }, - {0x15, 0x01, 0x0c, 0x04, "Every 90k" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x15, 0x01, 0x40, 0x40, "Easy" }, - {0x15, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x16, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x16, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x16, 0x01, 0x0c, 0x00, "3 Coins 1 Credit" }, - {0x16, 0x01, 0x0c, 0x04, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x0c, 0x0c, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x0c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x16, 0x01, 0x30, 0x30, "No" }, - {0x16, 0x01, 0x30, 0x20, "3 Times" }, - {0x16, 0x01, 0x30, 0x10, "5 Times" }, - {0x16, 0x01, 0x30, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x40, 0x00, "No" }, - {0x16, 0x01, 0x40, 0x40, "Yes" }, -}; - -STDDIPINFO(Kozure) - -static struct BurnDIPInfo Cclimbr2DIPList[]= -{ - {0x17, 0xff, 0xff, 0xcf, NULL }, - {0x18, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x17, 0x01, 0x03, 0x03, "3" }, - {0x17, 0x01, 0x03, 0x02, "4" }, - {0x17, 0x01, 0x03, 0x01, "5" }, - {0x17, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "1st Bonus Life" }, - {0x17, 0x01, 0x04, 0x04, "30k" }, - {0x17, 0x01, 0x04, 0x00, "60k" }, - - {0 , 0xfe, 0 , 2, "2nd Bonus Life" }, - {0x17, 0x01, 0x08, 0x08, "70k" }, - {0x17, 0x01, 0x08, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x17, 0x01, 0x0c, 0x0c, "30K and 100k" }, - {0x17, 0x01, 0x0c, 0x08, "60k and 130k" }, - {0x17, 0x01, 0x0c, 0x04, "30k only" }, - {0x17, 0x01, 0x0c, 0x00, "60k only" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x17, 0x01, 0x40, 0x40, "Easy" }, - {0x17, 0x01, 0x40, 0x00, "Normal" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x18, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x18, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x18, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x18, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x18, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x18, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x18, 0x01, 0x10, 0x00, "No" }, - {0x18, 0x01, 0x10, 0x10, "3 Times" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x18, 0x01, 0x20, 0x20, "Off" }, - {0x18, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Partial Invulnerability (Cheat)" }, - {0x18, 0x01, 0x40, 0x40, "Off" }, - {0x18, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Cclimbr2) - -static struct BurnDIPInfo LegionDIPList[]= -{ - {0x15, 0xff, 0xff, 0xf7, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x15, 0x01, 0x04, 0x04, "30k Then Every 100k" }, - {0x15, 0x01, 0x04, 0x00, "50k Only" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Invulnerability (Cheat)" }, - {0x15, 0x01, 0x80, 0x80, "No" }, - {0x15, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x16, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x16, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x16, 0x01, 0x10, 0x10, "Common" }, - {0x16, 0x01, 0x10, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x16, 0x01, 0x20, 0x20, "Easy" }, - {0x16, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "P1 Invulnerability (Cheat)" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "P2 Invulnerability (Cheat)" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Legion) - -static struct BurnDIPInfo TerrafDIPList[]= -{ - {0x15, 0xff, 0xff, 0x0f, NULL }, - {0x16, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - {0x15, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "1st Bonus Life" }, - {0x15, 0x01, 0x04, 0x04, "20k" }, - {0x15, 0x01, 0x04, 0x00, "50k" }, - - {0 , 0xfe, 0 , 2, "2nd Bonus Life" }, - {0x15, 0x01, 0x08, 0x08, "60k" }, - {0x15, 0x01, 0x08, 0x00, "90k" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x0c, "20k then every 60k" }, - {0x15, 0x01, 0x0c, 0x04, "20k then every 90k" }, - {0x15, 0x01, 0x0c, 0x08, "50k then every 60k" }, - {0x15, 0x01, 0x0c, 0x00, "50k then every 90k" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x16, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x16, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x16, 0x01, 0xc0, 0xc0, "No" }, - {0x16, 0x01, 0xc0, 0x80, "Only 3 Times" }, - {0x16, 0x01, 0xc0, 0x40, "Only 5 Times" }, - {0x16, 0x01, 0xc0, 0x00, "Yes" }, -}; - -STDDIPINFO(Terraf) - -static void __fastcall armedf_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x06d000: - *DrvVidRegs = data >> 8; - *flipscreen = (data >> 12) & 1; - return; - - case 0x06d002: - DrvScroll[0] = data & 0x3ff; - return; - - case 0x06d004: - DrvScroll[1] = data & 0x1ff; - return; - - case 0x06d006: - DrvScroll[2] = data & 0x3ff; - return; - - case 0x06d008: - DrvScroll[3] = data & 0x1ff; - return; - - case 0x06d00a: - *soundlatch = ((data & 0x7f) << 1) | 1; - return; - } -} - -static UINT16 __fastcall bigfghtr_read_word(UINT32 address) -{ - switch (address) - { - case 0x8c000: - return DrvInputs[0]; - - case 0x8c002: - return (DrvInputs[1] & ~0x0200) | ((DrvDips[2] << 8) & 0x0200); - - case 0x8c004: - return DrvInputs[2]; - - case 0x8c006: - return DrvInputs[3]; - - case 0x400000: - mcs51_set_irq_line(MCS51_INT0_LINE, CPU_IRQSTATUS_HOLD); - SekRunEnd(); - return 0; - } - - return 0; -} - -static void __fastcall bigfghtr_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x08d000: - *DrvVidRegs = data >> 8; - *flipscreen = (data >> 12) & 1; - return; - - case 0x08d002: - DrvScroll[0] = data & 0x3ff; - return; - - case 0x08d004: - DrvScroll[1] = data & 0x1ff; - return; - - case 0x08d006: - DrvScroll[2] = data & 0x3ff; - return; - - case 0x08d008: - DrvScroll[3] = data & 0x1ff; - return; - - case 0x08d00a: - *soundlatch = ((data & 0x7f) << 1) | 1; - return; - - case 0x08d00c: - // NOP - return; - - case 0x08d00e: - SekSetIRQLine(irqline, CPU_IRQSTATUS_NONE); - return; - } -} - -static void __fastcall cclimbr2_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x7c006: // scroll_x - DrvMcuCmd[11] = data; - DrvMcuCmd[31] = 1; - fg_scrolly = ((data >> 8) & 0xff) | (fg_scrolly & 0x300); - waiting_msb = 1; - return; - - case 0x7c008: // scroll_y - if (DrvMcuCmd[31]) { - DrvMcuCmd[14] = data >> 4; - DrvMcuCmd[12] = data; - } else { - DrvMcuCmd[13] = data; - } - if (waiting_msb) { - scroll_msb = data >> 8; - fg_scrollx = (fg_scrollx & 0xff) | (((scroll_msb >> 4) & 3) << 8); - fg_scrolly = (fg_scrolly & 0xff) | (((scroll_msb >> 0) & 3) << 8); - } else { - fg_scrollx = ((data >> 8) & 0xff) | (fg_scrollx & 0x300); - } - return; - - case 0xc0000: // msb_arm_w - DrvMcuCmd[31] = 0; - waiting_msb = 0; - return; - } -} - -static void __fastcall cclimbr2_write_word(UINT32 address, UINT16 data) -{ - if (scroll_type == 6 && (address & 0xffffc0) == 0x040000) { - DrvMcuCmd[(address >> 1) & 0x1f] = data; - return; - } - - switch (address) - { - case 0x7c000: - { - if (nb1414_blit_data) { - if(data & 0x4000 && ((*DrvVidRegs & 0x40) == 0)) { //0 -> 1 transition - UINT16 *ram = (UINT16*)DrvTxRAM; - nb_1414m4_exec((ram[0] << 8) | (ram[1] & 0xff),(UINT16*)DrvTxRAM,&DrvScroll[2],&DrvScroll[3]); - } - } - - *DrvVidRegs = data >> 8; - *flipscreen = (data >> 12) & 1; - } - return; - - case 0x7c002: - DrvScroll[0] = data & 0x3ff; - return; - - case 0x7c004: - DrvScroll[1] = data & 0x1ff; - return; - - case 0x7c006: //scrolly_w - DrvMcuCmd[11] = data; - DrvMcuCmd[31] = 1; - fg_scrolly = ((data >> 8) & 0xff) | (fg_scrolly & 0x300); - waiting_msb = 1; - return; - - case 0x7c008: // scrollx_w - if (DrvMcuCmd[31]) { - DrvMcuCmd[14] = data >> 4; - DrvMcuCmd[12] = data; - } else { - DrvMcuCmd[13] = data; - } - if (waiting_msb) { - scroll_msb = data >> 8; - fg_scrollx = (fg_scrollx & 0xff) | (((scroll_msb >> 4) & 3) << 8); - fg_scrolly = (fg_scrolly & 0xff) | (((scroll_msb >> 0) & 3) << 8); - } else { - fg_scrollx = ((data >> 8) & 0xff) | (fg_scrollx & 0x300); - } - return; - - case 0xc0000: // msb_arm_w - DrvMcuCmd[31] = 0; - waiting_msb = 0; - return; - - case 0x7c00a: - *soundlatch = ((data & 0x7f) << 1) | 1; - return; - - case 0x7c00c: - //NOP. - return; - - case 0x7c00e: - SekSetIRQLine(irqline, CPU_IRQSTATUS_NONE); - - if (scroll_type == 0 || scroll_type == 3 || scroll_type == 5) { - *DrvMcuCmd = data; - } - return; - } -} - -static UINT16 __fastcall cclimbr2_read_word(UINT32 address) -{ - switch (address) - { - case 0x78000: - return DrvInputs[0]; - - case 0x78002: - return DrvInputs[1]; - - case 0x78004: - return DrvInputs[2]; - - case 0x78006: - return DrvInputs[3]; - } - - return 0; -} - -static void __fastcall armedf_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM3812Write(0, 0, data); - return; - - case 0x01: - BurnYM3812Write(0, 1, data); - return; - - case 0x02: - DACSignedWrite(0, data); - return; - - case 0x03: - DACSignedWrite(1, data); - return; - } -} - -static UINT8 __fastcall armedf_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x04: - *soundlatch = 0; - return 0; - - case 0x06: - return *soundlatch; - } - - return 0; -} - -static void __fastcall terrafjbextra_write(UINT16 address, UINT8 data) -{ - if (address >= 0x4000 && address <= 0x5fff) { - DrvTxRAM[(address ^ 1) - 0x4000] = data; - return; - } -} - -static UINT8 __fastcall terrafjbextra_read(UINT16 address) -{ - if (address >= 0x4000 && address <= 0x5fff) { - return DrvTxRAM[(address ^ 1) - 0x4000]; - } - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (6000000.000 / (nBurnFPS / 100.000)))); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - if (usemcu) { - mcs51_reset(); - } - - if (Terrafjb) { - ZetOpen(1); - ZetReset(); - ZetClose(); - } - - BurnYM3812Reset(); - DACReset(); - - fg_scrolly = 0; - fg_scrollx = 0; - waiting_msb = 0; - scroll_msb = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x010000; - DrvZ80ROM2 = Next; Next += 0x004000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - nb1414_blit_data = Next; Next += 0x004000; // nb1414m4 blitter data - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x001000; - DrvSprClut = (UINT16*)Next; Next += 0x002000; - DrvSprBuf = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x001000; - DrvFgRAM = Next; Next += 0x001000; - DrvTxRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x001000; - Drv68KRAM0 = Next; Next += 0x005000; - Drv68KRAM1 = Next; Next += 0x001000; - Drv68KRAM2 = Next; Next += 0x001000; - DrvShareRAM = Next; Next += 0x004000; - - flipscreen = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - DrvVidRegs = Next; Next += 0x000001; - DrvScroll = (UINT16*)Next; Next += 0x000004 * sizeof(UINT16); - DrvMcuCmd = (UINT16*)Next; Next += 0x000020 * sizeof(UINT16); - - DrvZ80RAM = Next; Next += 0x004000; - - if (Terrafjb) { - DrvZ80RAM2 = Next; Next += 0x001800; - } - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0x000, 0x001, 0x002, 0x003 }; - INT32 XOffs0[16] = { 0x004, 0x000, 0x00c, 0x008, 0x014, 0x010, 0x01c, 0x018, - 0x024, 0x020, 0x02c, 0x028, 0x034, 0x030, 0x03c, 0x038 }; - INT32 YOffs0[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 }; - INT32 XOffs1[16] = { 0x000004, 0x000000, 0x100004, 0x100000, 0x00000c, 0x000008, 0x10000c, 0x100008, - 0x000014, 0x000010, 0x100014, 0x100010, 0x00001c, 0x000018, 0x10001c, 0x100018 }; - INT32 YOffs1[16] = { 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, - 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 4, 8, 8, Plane, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane, XOffs0, YOffs1, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x20000); - - GfxDecode(0x0400, 4, 16, 16, Plane, XOffs0, YOffs1, 0x400, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane, XOffs1, YOffs0, 0x200, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static void Armedf68KInit() -{ - SekMapMemory(Drv68KROM, 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x060000, 0x060fff, MAP_RAM); - SekMapMemory((UINT8 *)DrvSprClut, 0x06b000, 0x06bfff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x061000, 0x065fff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x066000, 0x066fff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x067000, 0x067fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x068000, 0x069fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x06a000, 0x06afff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x06c000, 0x06c7ff, MAP_RAM); - SekSetWriteWordHandler(0, armedf_write_word); -} - -static UINT8 mcu_read_data(INT32 address) // skyrobo, bigfghtr -{ - if (address >= 0x0600 && address <= 0x3fff) { - return DrvShareRAM[(address&0x3fff)^1]; - } - - return 0; -} - -static void mcu_write_data(INT32 address, UINT8 data) -{ - if (address >= 0x0600 && address <= 0x3fff) { - DrvShareRAM[(address&0x3fff)^1] = data; - return; - } -} - -static void Bigfghtr68KInit() -{ - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - //SekMapMemory(DrvSprRAM, 0x080000, 0x0805ff, MAP_RAM); // copied from shareram - SekMapMemory(DrvShareRAM, 0x080000, 0x083fff, MAP_RAM); - DrvSprRAM = DrvShareRAM; // Sprites 0x80000 - 0x805ff, Share 0x80600 - 0x803ff - SekMapMemory((UINT8 *)DrvSprClut, 0x08b000, 0x08bfff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x084000, 0x085fff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x086000, 0x086fff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x087000, 0x087fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x088000, 0x089fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x08a000, 0x08afff, MAP_RAM); - SekSetWriteWordHandler(0, bigfghtr_write_word); - SekSetReadWordHandler(0, bigfghtr_read_word); - - usemcu = 1; - mcs51_program_data = DrvZ80ROM2; - mcs51_init (); - mcs51_set_write_handler(mcu_write_data); - mcs51_set_read_handler(mcu_read_data); - -} - -static void Cclimbr268KInit() -{ - SekMapMemory(Drv68KROM, 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x060000, 0x060fff, MAP_RAM); - SekMapMemory((UINT8 *)DrvSprClut, 0x06c000, 0x06cfff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x061000, 0x063fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x064000, 0x064fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x068000, 0x069fff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x06a000, 0x06a9ff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x070000, 0x070fff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x074000, 0x074fff, MAP_RAM); - SekSetWriteWordHandler(0, cclimbr2_write_word); - SekSetWriteByteHandler(0, cclimbr2_write_byte); - SekSetReadWordHandler(0, cclimbr2_read_word); -} - -static INT32 DrvInit(INT32 (*pLoadRoms)(), void (*p68KInit)(), INT32 zLen) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pLoadRoms) { - if (pLoadRoms()) return 1; - } - - DrvGfxDecode(); - - SekInit(0, 0x68000); - SekOpen(0); - - if (p68KInit) - { - p68KInit(); - } - - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, zLen-1, MAP_ROM); - ZetMapMemory(DrvZ80RAM, zLen+0, 0xffff, MAP_RAM); - ZetSetOutHandler(armedf_write_port); - ZetSetInHandler(armedf_read_port); - ZetClose(); - - if (Terrafjb) { - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(terrafjbextra_write); - ZetSetReadHandler(terrafjbextra_read); - ZetClose(); - } - - BurnYM3812Init(1, 4000000, NULL, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(6000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACInit(1, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - if (nScreenWidth == 320) { - xoffset = 96; - yoffset = 8; - } else { - xoffset = 112; - yoffset = 16; - } - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - DACExit(); - BurnYM3812Exit(); - SekExit(); - ZetExit(); - - if (usemcu) { - mcs51_exit(); - usemcu = 0; - } - - BurnFree (AllMem); - - Terrafjb = 0; - Kozuremode = 0; - Skyrobo = 0; - fiftysevenhertz = 0; - - BurnSetRefreshRate(60.00); - - return 0; -} - -static inline void DrvPaletteRecalc() -{ - UINT8 r,g,b; - UINT16 *pal = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x1000 / 2; i++) { - INT32 d = pal[i]; - - r = (d >> 4) & 0xf0; - g = (d & 0xf0); - b = (d & 0x0f); - - r |= r >> 4; - g |= g >> 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static inline void AssembleInputs() -{ - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - DrvInputs[2] = DrvDips[0] | 0xff00; - DrvInputs[3] = DrvDips[1] | 0xff00; - - if (scroll_type == 1) { - UINT16 *ptr = (UINT16*)Drv68KRAM2; - ptr[0] = DrvInputs[0]; - ptr[1] = DrvInputs[1]; - ptr[2] = DrvInputs[2]; - ptr[3] = DrvInputs[3]; - } -} - -static void draw_layer(UINT8 *ram, UINT8 *gfxbase, INT32 scrollx, INT32 scrolly, INT32 coloff, INT32 code_and) -{ - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sy = (offs & 0x1f) << 4; - INT32 sx = (offs >> 5) << 4; - sy -= scrolly + yoffset; - sx -= scrollx + xoffset; - if (sy < -15) sy += 512; - if (sx < -15) sx += 1024; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 code = vram[offs] & code_and; - INT32 color = vram[offs] >> 11; - - if (*flipscreen) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, (nScreenWidth - 16) - sx, (nScreenHeight - 16) - sy, color, 4, 15, coloff, gfxbase); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, coloff, gfxbase); - } - } -} - -static void draw_txt_layer(INT32 transp, INT32 priority) -{ - UINT16 *vram = (UINT16*)DrvTxRAM; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 ofst = 0; - INT32 ofsta = 0x400; - INT32 sx = offs & 0x3f; - INT32 sy = offs >> 6; - - if (scroll_type == 1) { - ofst = (sx << 5) | sy; - ofsta = 0x800; - } else if (scroll_type == 3 || scroll_type == 6) { // legion, legionjb - ofst = ((sx & 0x1f) << 5) | sy | ((sx >> 5) << 11); - } else { - ofst = ((sy ^ 0x1f) << 5) | (sx & 0x1f) | ((sx >> 5) << 11); - } - - sx = (sx << 3) - xoffset; - sy = (sy << 3) - yoffset; - if (scroll_type != 1) sx += 128; - - if (sx >= 512) sx -= 512; // fix for left-most characters in Kozure - //sx &= 0xff; // (instead of the line above) causes breakage in Legion. - - if (sx < -7 || sy < -7 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = vram[ofst+ofsta] & 0xff; - INT32 category = (attr & 0x8) >> 3; - INT32 code = (vram[ofst] & 0xff) | ((attr & 3) << 8); - if (scroll_type == 3 && ofst < 0x12) continue; // ignore nb1414m4 params/fix text-garbage at the bottom of legion - if (category != priority) continue; - - if (transp) { - if (*flipscreen) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, (nScreenWidth - 8) - sx, (nScreenHeight - 8) - sy, attr >> 4, 4, 15, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, attr >> 4, 4, 15, 0, DrvGfxROM0); - } - } else { - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, (nScreenWidth - 8) - sx, (nScreenHeight - 8) -sy, attr >> 4, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, attr >> 4, 4, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites(INT32 priority) -{ - UINT16 *spr = (UINT16*)DrvSprBuf; - - INT32 sprlen = 0x1000; - if (scroll_type == 0 || scroll_type == 5) sprlen = 0x400; - if (Skyrobo) sprlen = 0x600; - - for (INT32 offs = 0; offs < sprlen / 2; offs+=4) - { - INT32 attr = spr[offs + 0]; - if (((attr & 0x3000) >> 12) != priority) continue; - - INT32 code = spr[offs + 1]; - INT32 flipx = code & 0x2000; - INT32 flipy = code & 0x1000; - INT32 color =(spr[offs + 2] >> 8) & 0x1f; - INT32 clut = spr[offs + 2] & 0x7f; - INT32 sx = spr[offs + 3]; - INT32 sy = sprite_offy + 240 - (attr & 0x1ff); - code &= 0xfff; - - if (*flipscreen) { - sx = 320 - sx + 176; - sy = 240 - sy + 1; - flipx = !flipx; - flipy = !flipy; - } - - sy -= yoffset; - sx -= xoffset; - - if (sx < -15 || sy < -15 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - // Render sprites with CLUT - if (flipy) flipy = 0x0f; - if (flipx) flipx = 0x0f; - UINT8 mask = 0xf; - UINT8 *src = DrvGfxROM3 + (code * 16 * 16); - UINT16 *dst; - - for (INT32 y = 0; y < 16; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - dst = pTransDraw + sy * nScreenWidth; - - for (INT32 x = 0; x < 16; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - //INT32 pxl = src[((y^flipy << 4) | x^flipx)]; <- neat mosaic effect, save/use for tshingen & p-47 (dink) - INT32 pxl = src[(((y^flipy) << 4) | (x^flipx))]; - UINT32 nColor = (color << 4) | 0x200; - UINT32 clutpxl = (pxl & ~0xf) | ((DrvSprClut[clut*0x10+(pxl & 0xf)]) & 0xf); - if (mask == clutpxl) continue; - dst[sx] = clutpxl | nColor; - } - - sx -= 16; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc(); - } - - for (INT32 offs = 0; offs < nScreenWidth * nScreenHeight; offs++) - pTransDraw[offs] = 0x00ff; - - INT32 txt_transp = 1; - - if (scroll_type == 0 || scroll_type == 5) { - if ((*DrvMcuCmd & 0x000f) == 0x000f) txt_transp = 0; - } - - if (scroll_type != 1) { - UINT16 *ram = (UINT16*)DrvTxRAM; - if (scroll_type == 0 || scroll_type == 6) ram = DrvMcuCmd; - - DrvScroll[2] = (ram[13] & 0xff) | ((ram[14] & 3) << 8); - DrvScroll[3] = (ram[11] & 0xff) | ((ram[12] & 1) << 8); - } - - if (scroll_type == 0) { // terraf - DrvScroll[2] = fg_scrollx; - DrvScroll[3] = fg_scrolly; - } - - if ((*DrvMcuCmd & 0x30) == 0x30 && *DrvVidRegs & 0x01) draw_txt_layer(txt_transp, 1); - if (*DrvVidRegs & 0x08) draw_layer(DrvBgRAM, DrvGfxROM2, DrvScroll[0], DrvScroll[1], 0x600, 0x3ff); - if (*DrvVidRegs & 0x02) draw_sprites(2); - if (*DrvVidRegs & 0x04) draw_layer(DrvFgRAM, DrvGfxROM1, DrvScroll[2], DrvScroll[3], 0x400, 0x7ff); - if (*DrvVidRegs & 0x02) draw_sprites(1); - if ((*DrvMcuCmd & 0x30) == 0x00 && *DrvVidRegs & 0x01) draw_txt_layer(txt_transp, 0); - if (*DrvVidRegs & 0x02) draw_sprites(0); - - BurnTransferCopy(DrvPalette); - - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - AssembleInputs(); - - INT32 nSegment; - INT32 nInterleave = 262; - INT32 nTotalCycles[3] = { 8000000 / ((fiftysevenhertz) ? 57 : 60), 6000000 / ((fiftysevenhertz) ? 57 : 60), 4000000 / ((fiftysevenhertz) ? 57 : 60) }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - if (usemcu) nTotalCycles[2] /= 12; // i8751 internal divider (12) - - SekOpen(0); - ZetOpen(0); - nb1414_frame++; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nNext = (i + 1) * nTotalCycles[0] / nInterleave; - nSegment = nNext - nCyclesDone[0]; - nCyclesDone[0] += SekRun(nSegment); - - BurnTimerUpdateYM3812((i + 1) * (nTotalCycles[1] / nInterleave)); - - if (i & 1) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); // 130 per frame (based on nInterleave = 262) - - if (usemcu) { - mcs51Run((nTotalCycles[2] / nInterleave)); - } - - if (Terrafjb) { - ZetClose(); - ZetOpen(1); - nNext = (i + 1) * nTotalCycles[2] / nInterleave; - nSegment = nNext - nCyclesDone[2]; - nCyclesDone[2] += ZetRun(nSegment); - ZetClose(); - ZetOpen(0); - } - } - - BurnTimerEndFrameYM3812(nTotalCycles[1]); - - SekSetIRQLine(irqline, (usemcu) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - if (usemcu) { - mcs51_scan(nAction); - } - - BurnYM3812Scan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(fg_scrolly); - SCAN_VAR(fg_scrollx); - SCAN_VAR(waiting_msb); - SCAN_VAR(scroll_msb); - } - - return 0; -} - - -// Armed Formation - -static struct BurnRomInfo armedfRomDesc[] = { - { "06.3d", 0x10000, 0x0f9015e2, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "01.3f", 0x10000, 0x816ff7c5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "07.5d", 0x10000, 0x5b3144a5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "02.4f", 0x10000, 0xfa10c29d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "af_08.rom", 0x10000, 0xd1d43600, 1 | BRF_PRG | BRF_ESS }, // 4 - { "af_03.rom", 0x10000, 0xbbe1fe2d, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "af_10.rom", 0x10000, 0xc5eacb87, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 code - - { "09.11c", 0x08000, 0x5c6993d5, 3 | BRF_GRA }, // 7 Characters - - { "af_04.rom", 0x10000, 0x44d3af4f, 4 | BRF_GRA }, // 8 Foreground Tiles - { "af_05.rom", 0x10000, 0x92076cab, 4 | BRF_GRA }, // 9 - - { "af_14.rom", 0x10000, 0x8c5dc5a7, 5 | BRF_GRA }, // 10 Background Tiles - { "af_13.rom", 0x10000, 0x136a58a3, 5 | BRF_GRA }, // 11 - - { "af_11.rom", 0x20000, 0xb46c473c, 6 | BRF_GRA }, // 12 Sprites - { "af_12.rom", 0x20000, 0x23cb6bfe, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(armedf) -STD_ROM_FN(armedf) - -static struct BurnRomInfo armedffRomDesc[] = { - { "af_06.rom", 0x10000, 0xc5326603, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "af_01.rom", 0x10000, 0x458e9542, 1 | BRF_PRG | BRF_ESS }, // 1 - { "af_07.rom", 0x10000, 0xcc8517f5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "af_02.rom", 0x10000, 0x214ef220, 1 | BRF_PRG | BRF_ESS }, // 3 - { "af_08.rom", 0x10000, 0xd1d43600, 1 | BRF_PRG | BRF_ESS }, // 4 - { "af_03.rom", 0x10000, 0xbbe1fe2d, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "af_10.rom", 0x10000, 0xc5eacb87, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 code - - { "af_09.rom", 0x08000, 0x7025e92d, 3 | BRF_GRA }, // 7 Characters - - { "af_04.rom", 0x10000, 0x44d3af4f, 4 | BRF_GRA }, // 8 Foreground Tiles - { "af_05.rom", 0x10000, 0x92076cab, 4 | BRF_GRA }, // 9 - - { "af_14.rom", 0x10000, 0x8c5dc5a7, 5 | BRF_GRA }, // 10 Background Tiles - { "af_13.rom", 0x10000, 0x136a58a3, 5 | BRF_GRA }, // 11 - - { "af_11.rom", 0x20000, 0xb46c473c, 6 | BRF_GRA }, // 12 Sprites - { "af_12.rom", 0x20000, 0x23cb6bfe, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(armedff) -STD_ROM_FN(armedff) - -static INT32 ArmedfLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 5, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 13, 1)) return 1; - - return 0; -} - -static INT32 ArmedfInit() -{ - scroll_type = 1; - sprite_offy = 128; - irqline = 1; - - INT32 nRet = DrvInit(ArmedfLoadRoms, Armedf68KInit, 0xf800); - - if (nRet == 0) { - DACSetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.40, BURN_SND_ROUTE_BOTH); - BurnSetRefreshRate(57.00); - fiftysevenhertz = 1; - } - - return nRet; -} - -struct BurnDriver BurnDrvArmedf = { - "armedf", NULL, NULL, NULL, "1988", - "Armed Formation\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, armedfRomInfo, armedfRomName, NULL, NULL, ArmedfInputInfo, ArmedfDIPInfo, - ArmedfInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvArmedff = { - "armedff", "armedf", NULL, NULL, "1988", - "Armed Formation (Fillmore license)\0", NULL, "Nichibutsu (Fillmore license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, armedffRomInfo, armedffRomName, NULL, NULL, ArmedfInputInfo, ArmedfDIPInfo, - ArmedfInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - -// Crazy Climber 2 (Japan) - -static struct BurnRomInfo cclimbr2RomDesc[] = { - { "4.bin", 0x10000, 0x7922ea14, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "1.bin", 0x10000, 0x2ac7ed67, 1 | BRF_PRG | BRF_ESS }, // 1 - { "6.bin", 0x10000, 0x7905c992, 1 | BRF_PRG | BRF_ESS }, // 2 - { "5.bin", 0x10000, 0x47be6c1e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "3.bin", 0x10000, 0x1fb110d6, 1 | BRF_PRG | BRF_ESS }, // 4 - { "2.bin", 0x10000, 0x0024c15b, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "11.bin", 0x04000, 0xfe0175be, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 code - { "12.bin", 0x08000, 0x5ddf18f2, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "10.bin", 0x08000, 0x7f475266, 3 | BRF_GRA }, // 8 Characters - - { "7.bin", 0x10000, 0xcbdd3906, 4 | BRF_GRA }, // 9 Foreground Tiles - { "8.bin", 0x10000, 0xb2a613c0, 4 | BRF_GRA }, // 10 - - { "17.bin", 0x10000, 0xe24bb2d7, 5 | BRF_GRA }, // 11 Background Tiles - { "18.bin", 0x10000, 0x56834554, 5 | BRF_GRA }, // 12 - - { "15.bin", 0x10000, 0x4bf838be, 6 | BRF_GRA }, // 13 Sprites - { "16.bin", 0x10000, 0x21a265c5, 6 | BRF_GRA }, // 14 - { "13.bin", 0x10000, 0x6b6ec999, 6 | BRF_GRA }, // 15 - { "14.bin", 0x10000, 0xf426a4ad, 6 | BRF_GRA }, // 16 - - { "9.bin", 0x04000, 0x740d260f, 7 | BRF_GRA | BRF_OPT }, // 17 MCU data -}; - -STD_ROM_PICK(cclimbr2) -STD_ROM_FN(cclimbr2) - -static INT32 Cclimbr2LoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 5, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x004000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x010000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x030000, 16, 1)) return 1; - - return 0; -} - -static INT32 Cclimbr2Init() -{ - scroll_type = 4; - sprite_offy = 0; - irqline = 2; - - return DrvInit(Cclimbr2LoadRoms, Cclimbr268KInit, 0xc000); -} - -struct BurnDriver BurnDrvCclimbr2 = { - "cclimbr2", NULL, NULL, NULL, "1988", - "Crazy Climber 2 (Japan)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, cclimbr2RomInfo, cclimbr2RomName, NULL, NULL, Cclimbr2InputInfo, Cclimbr2DIPInfo, - Cclimbr2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Crazy Climber 2 (Japan, Harder) - -static struct BurnRomInfo cclmbr2aRomDesc[] = { - { "4a.bin", 0x10000, 0xe1d3192c, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "1a.bin", 0x10000, 0x3ef84974, 1 | BRF_PRG | BRF_ESS }, // 1 - { "6.bin", 0x10000, 0x7905c992, 1 | BRF_PRG | BRF_ESS }, // 2 - { "5.bin", 0x10000, 0x47be6c1e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "3.bin", 0x10000, 0x1fb110d6, 1 | BRF_PRG | BRF_ESS }, // 4 - { "2.bin", 0x10000, 0x0024c15b, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "11.bin", 0x04000, 0xfe0175be, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 code - { "12.bin", 0x08000, 0x5ddf18f2, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "10.bin", 0x08000, 0x7f475266, 3 | BRF_GRA }, // 8 Characters - - { "7.bin", 0x10000, 0xcbdd3906, 4 | BRF_GRA }, // 9 Foreground Tiles - { "8.bin", 0x10000, 0xb2a613c0, 4 | BRF_GRA }, // 10 - - { "17.bin", 0x10000, 0xe24bb2d7, 5 | BRF_GRA }, // 11 Background Tiles - { "18.bin", 0x10000, 0x56834554, 5 | BRF_GRA }, // 12 - - { "15.bin", 0x10000, 0x4bf838be, 6 | BRF_GRA }, // 13 Sprites - { "16.bin", 0x10000, 0x21a265c5, 6 | BRF_GRA }, // 14 - { "13.bin", 0x10000, 0x6b6ec999, 6 | BRF_GRA }, // 15 - { "14.bin", 0x10000, 0xf426a4ad, 6 | BRF_GRA }, // 16 - - { "9.bin", 0x04000, 0x740d260f, 7 | BRF_GRA | BRF_OPT }, // 17 MCU data -}; - -STD_ROM_PICK(cclmbr2a) -STD_ROM_FN(cclmbr2a) - -struct BurnDriver BurnDrvCclmbr2a = { - "cclimbr2a", "cclimbr2", NULL, NULL, "1988", - "Crazy Climber 2 (Japan, Harder)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, cclmbr2aRomInfo, cclmbr2aRomName, NULL, NULL, Cclimbr2InputInfo, Cclimbr2DIPInfo, - Cclimbr2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Kozure Ookami (Japan) - -static struct BurnRomInfo kozureRomDesc[] = { - { "kozure8.6e", 0x10000, 0x6bbfb1e6, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "kozure3.6h", 0x10000, 0xf9178ec8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "kozure7.5e", 0x10000, 0xa7ee09bb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "kozure2.5h", 0x10000, 0x236d820f, 1 | BRF_PRG | BRF_ESS }, // 3 - { "kozure6.3e", 0x10000, 0x9120e728, 1 | BRF_PRG | BRF_ESS }, // 4 - { "kozure1.3h", 0x10000, 0x345fe7a5, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "kozure11.17k", 0x10000, 0xdba51e2d, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 code - - { "kozure9.11e", 0x08000, 0xe041356e, 3 | BRF_GRA }, // 7 Characters - - { "kozure5.15h", 0x20000, 0x0b510258, 4 | BRF_GRA }, // 8 Foreground Tiles - { "kozure4.14h", 0x10000, 0xfb8e13e6, 4 | BRF_GRA }, // 9 - - { "kozure14.8a", 0x10000, 0x94a9c3d0, 5 | BRF_GRA }, // 10 Background Tiles - - { "kozure12.8d", 0x20000, 0x15f4021d, 6 | BRF_GRA }, // 11 Sprites - { "kozure13.9d", 0x20000, 0xb3b6c753, 6 | BRF_GRA }, // 12 - - { "kozure10.11c", 0x04000, 0xf48be21d, 7 | BRF_GRA }, // 13 MCU data - - { "n82s129an.11j", 0x00100, 0x81244757, 8 | BRF_OPT }, // 14 Proms -}; - -STD_ROM_PICK(kozure) -STD_ROM_FN(kozure) - -static INT32 KozureLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 5, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 12, 1)) return 1; - if (BurnLoadRom(nb1414_blit_data, 13, 1)) return 1; - - return 0; -} - -static INT32 KozureInit() -{ - scroll_type = 2; - sprite_offy = 128; - irqline = 1; - Kozuremode = 1; - - INT32 nRet = DrvInit(KozureLoadRoms, Cclimbr268KInit, 0xf800); - - if (nRet == 0) { - *((UINT16*)(Drv68KROM + 0x1016c)) = 0x4e71; // patch "time over" bug. - *((UINT16*)(Drv68KROM + 0x04fc6)) = 0x4e71; // ROM check at POST. - - DACSetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - } - - return nRet; -} - -struct BurnDriver BurnDrvKozure = { - "kozure", NULL, NULL, NULL, "1987", - "Kozure Ookami (Japan)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, kozureRomInfo, kozureRomName, NULL, NULL, ArmedfInputInfo, KozureDIPInfo, - KozureInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Legion - Spinner-87 (World ver 2.03) - -static struct BurnRomInfo legionRomDesc[] = { - { "lg3.bin", 0x10000, 0x777e4935, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "lg1.bin", 0x10000, 0xc4aeb724, 1 | BRF_PRG | BRF_ESS }, // 1 - { "legion.1d", 0x10000, 0xc2e45e1e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "legion.1b", 0x10000, 0xc306660a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "legion.1h", 0x04000, 0x2ca4f7f0, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "lg8.bin", 0x08000, 0xe0596570, 3 | BRF_GRA }, // 5 Characters - - { "legion.1e", 0x10000, 0xa9d70faf, 4 | BRF_GRA }, // 6 Foreground Tiles - { "legion.1f", 0x08000, 0xf018313b, 4 | BRF_GRA }, // 7 - - { "legion.1l", 0x10000, 0x29b8adaa, 5 | BRF_GRA }, // 8 Background Tiles - - { "legion.1k", 0x10000, 0xff5a0db9, 6 | BRF_GRA }, // 9 Sprites - { "legion.1j", 0x10000, 0xbae220c8, 6 | BRF_GRA }, // 10 - - { "lg7.bin", 0x04000, 0x533e2b58, 7 | BRF_GRA }, // 11 MCU data - - { "legion.1i", 0x08000, 0x79f4a827, 2 | BRF_OPT }, // 12 Unknown -}; - -STD_ROM_PICK(legion) -STD_ROM_FN(legion) - -static INT32 LegionLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x04000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x018000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 10, 1)) return 1; - - return 0; -} - -static INT32 LegionInit() -{ - scroll_type = 3; - sprite_offy = 0; - irqline = 2; - - INT32 nRet = DrvInit(LegionLoadRoms, Cclimbr268KInit, 0xc000); - - if (nRet == 0) { // hack - if (BurnLoadRom(nb1414_blit_data, 11, 1)) return 1; - *((UINT16*)(Drv68KROM + 0x001d6)) = 0x0001; - *((UINT16*)(Drv68KROM + 0x00488)) = 0x4e71; - } - - return nRet; -} - -struct BurnDriver BurnDrvLegion = { - "legion", NULL, NULL, NULL, "1987", - "Legion - Spinner-87 (World ver 2.03)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, legionRomInfo, legionRomName, NULL, NULL, ArmedfInputInfo, LegionDIPInfo, - LegionInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 288, 3, 4 -}; - - -// Chouji Meikyuu Legion (Japan ver 1.05) - -static struct BurnRomInfo legionjRomDesc[] = { - { "legion.e5", 0x10000, 0x49e8e1b7, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code1 - { "legion.e1", 0x10000, 0x977fa324, 1 | BRF_PRG | BRF_ESS }, // 1 - { "legion.1d", 0x10000, 0xc2e45e1e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "legion.1b", 0x10000, 0xc306660a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "legion.1h", 0x04000, 0x2ca4f7f0, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "legion.1g", 0x08000, 0xc50b0125, 3 | BRF_GRA }, // 5 Characters - - { "legion.1e", 0x10000, 0xa9d70faf, 4 | BRF_GRA }, // 6 Foreground Tiles - { "legion.1f", 0x08000, 0xf018313b, 4 | BRF_GRA }, // 7 - - { "legion.1l", 0x10000, 0x29b8adaa, 5 | BRF_GRA }, // 8 Background Tiles - - { "legion.1k", 0x10000, 0xff5a0db9, 6 | BRF_GRA }, // 9 Sprites - { "legion.1j", 0x10000, 0xbae220c8, 6 | BRF_GRA }, // 10 - - { "lg7.bin", 0x04000, 0x533e2b58, 7 | BRF_GRA }, // 11 MCU data - - { "legion.1i", 0x08000, 0x79f4a827, 2 | BRF_OPT }, // 12 Unknown -}; - -STD_ROM_PICK(legionj) -STD_ROM_FN(legionj) - -struct BurnDriver BurnDrvLegionj = { - "legionj", "legion", NULL, NULL, "1987", - "Chouji Meikyuu Legion (Japan ver 1.05)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, legionjRomInfo, legionjRomName, NULL, NULL, ArmedfInputInfo, LegionDIPInfo, - LegionInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 288, 3, 4 -}; - - -// Chouji Meikyuu Legion (Japan ver 1.05, bootleg) -/* blitter protection removed */ - -static struct BurnRomInfo legionjbRomDesc[] = { - { "legion.1c", 0x10000, 0x21226660, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "legion.1a", 0x10000, 0x8c0cda1d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "legion.1d", 0x10000, 0xc2e45e1e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "legion.1b", 0x10000, 0xc306660a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "legion.1h", 0x04000, 0x2ca4f7f0, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "legion.1g", 0x08000, 0xc50b0125, 3 | BRF_GRA }, // 5 Characters - - { "legion.1e", 0x10000, 0xa9d70faf, 4 | BRF_GRA }, // 6 Foreground Tiles - { "legion.1f", 0x08000, 0xf018313b, 4 | BRF_GRA }, // 7 - - { "legion.1l", 0x10000, 0x29b8adaa, 5 | BRF_GRA }, // 8 Background Tiles - - { "legion.1k", 0x10000, 0xff5a0db9, 6 | BRF_GRA }, // 9 Sprites - { "legion.1j", 0x10000, 0xbae220c8, 6 | BRF_GRA }, // 10 - - { "legion.1i", 0x08000, 0x79f4a827, 0 | BRF_OPT }, // 11 Unknown -}; - -STD_ROM_PICK(legionjb) -STD_ROM_FN(legionjb) - -static INT32 LegionjbLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x04000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x018000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 10, 1)) return 1; - - return 0; -} - -static INT32 LegionjbInit() -{ - scroll_type = 6; - sprite_offy = 0; - irqline = 2; - - INT32 nRet = DrvInit(LegionjbLoadRoms, Cclimbr268KInit, 0xc000); - - if (nRet == 0) { // hack - *((UINT16*)(Drv68KROM + 0x001d6)) = 0x0001; - } - - return nRet; -} - -struct BurnDriver BurnDrvLegionjb = { - "legionjb", "legion", NULL, NULL, "1987", - "Chouji Meikyuu Legion (Japan ver 1.05, bootleg)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, legionjbRomInfo, legionjbRomName, NULL, NULL, ArmedfInputInfo, LegionDIPInfo, - LegionjbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 288, 3, 4 -}; - - -// Terra Force - -static struct BurnRomInfo terrafRomDesc[] = { - { "8.6e", 0x10000, 0xfd58fa06, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "3.6h", 0x10000, 0x54823a7d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "7.4e", 0x10000, 0xfde8de7e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "2.4h", 0x10000, 0xdb987414, 1 | BRF_PRG | BRF_ESS }, // 3 - { "6.3e", 0x10000, 0xa5bb8c3b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "1.3h", 0x10000, 0xd2de6d28, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "11.17k", 0x10000, 0x4407d475, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 code - - { "9.11e", 0x08000, 0xbc6f7cbc, 3 | BRF_GRA }, // 7 Characters - - { "5.15h", 0x10000, 0x25d23dfd, 4 | BRF_GRA }, // 8 Foreground Tiles - { "4.13h", 0x10000, 0xb9b0fe27, 4 | BRF_GRA }, // 9 - - { "15.8a", 0x10000, 0x2144d8e0, 5 | BRF_GRA }, // 10 Background Tiles - { "14.6a", 0x10000, 0x744f5c9e, 5 | BRF_GRA }, // 11 - - { "12.7d", 0x10000, 0x2d1f2ceb, 6 | BRF_GRA }, // 12 Sprites - { "13.9d", 0x10000, 0x1d2f92d6, 6 | BRF_GRA }, // 13 - - { "10.11c", 0x04000, 0xac705812, 7 | BRF_GRA }, // 14 MCU data - - { "n82s129an.11j", 0x00100, 0x81244757, 8 | BRF_OPT }, // 15 Proms -}; - -STD_ROM_PICK(terraf) -STD_ROM_FN(terraf) - -static INT32 TerrafInit() -{ - scroll_type = 5; - sprite_offy = 128; - irqline = 1; - - INT32 nRet = DrvInit(ArmedfLoadRoms, Cclimbr268KInit, 0xf800); - - if (nRet == 0) { - if (BurnLoadRom(nb1414_blit_data, 14, 1)) return 1; - - DACSetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.30, BURN_SND_ROUTE_BOTH); - BurnSetRefreshRate(57.00); - fiftysevenhertz = 1; - } - - return nRet; -} - -struct BurnDriver BurnDrvTerraf = { - "terraf", NULL, NULL, NULL, "1987", - "Terra Force\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, terrafRomInfo, terrafRomName, NULL, NULL, ArmedfInputInfo, TerrafDIPInfo, - TerrafInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Terra Force (US) - -static struct BurnRomInfo terrafuRomDesc[] = { - { "tf-8.6e", 0x10000, 0xfea6dd64, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tf-3.6h", 0x10000, 0x02f9d05a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tf-7.4e", 0x10000, 0xfde8de7e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tf-2.4h", 0x10000, 0xdb987414, 1 | BRF_PRG | BRF_ESS }, // 3 - { "tf-6.3e", 0x08000, 0xb91e9ba3, 1 | BRF_PRG | BRF_ESS }, // 4 - { "tf-1.3h", 0x08000, 0xd6e22375, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "tf-001.17k", 0x10000, 0xeb6b4138, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 code - - { "9.11e", 0x08000, 0xbc6f7cbc, 3 | BRF_GRA }, // 7 Characters - - { "5.15h", 0x10000, 0x25d23dfd, 4 | BRF_GRA }, // 8 Foreground Tiles - { "4.13h", 0x10000, 0xb9b0fe27, 4 | BRF_GRA }, // 9 - - { "15.8a", 0x10000, 0x2144d8e0, 5 | BRF_GRA }, // 10 Background Tiles - { "14.6a", 0x10000, 0x744f5c9e, 5 | BRF_GRA }, // 11 - - { "tf-003.7d", 0x10000, 0xd74085a1, 6 | BRF_GRA }, // 12 Sprites - { "tf-002.9d", 0x10000, 0x148aa0c5, 6 | BRF_GRA }, // 13 - - { "10.11c", 0x04000, 0xac705812, 7 | BRF_GRA }, // 14 MCU data - - { "n82s129an.11j", 0x00100, 0x81244757, 8 | BRF_OPT }, // 15 Proms -}; - -STD_ROM_PICK(terrafu) -STD_ROM_FN(terrafu) - -static INT32 TerrafbInit() -{ - scroll_type = 5; - sprite_offy = 128; - irqline = 1; - - INT32 nRet = DrvInit(ArmedfLoadRoms, Cclimbr268KInit, 0xf800); - - if (nRet == 0) { - DACSetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.80, BURN_SND_ROUTE_BOTH); - } - - return nRet; -} - -struct BurnDriver BurnDrvTerrafu = { - "terrafu", "terraf", NULL, NULL, "1987", - "Terra Force (US)\0", NULL, "Nichibutsu USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, terrafuRomInfo, terrafuRomName, NULL, NULL, ArmedfInputInfo, TerrafDIPInfo, - TerrafInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Terra Force (Japan) - -static struct BurnRomInfo terrafjRomDesc[] = { - { "tfj-8.bin", 0x10000, 0xb11a6fa7, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tfj-3.bin", 0x10000, 0x6c6aa7ed, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tfj-7.bin", 0x10000, 0xfde8de7e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tfj-2.bin", 0x10000, 0xdb987414, 1 | BRF_PRG | BRF_ESS }, // 3 - { "tfj-6.bin", 0x10000, 0x4911dfbf, 1 | BRF_PRG | BRF_ESS }, // 4 - { "tfj-1.bin", 0x10000, 0x93063d9a, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "11.17k", 0x10000, 0x4407d475, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 code - - { "9.11e", 0x08000, 0xbc6f7cbc, 3 | BRF_GRA }, // 7 Characters - - { "5.15h", 0x10000, 0x25d23dfd, 4 | BRF_GRA }, // 8 Foreground Tiles - { "4.13h", 0x10000, 0xb9b0fe27, 4 | BRF_GRA }, // 9 - - { "15.8a", 0x10000, 0x2144d8e0, 5 | BRF_GRA }, // 10 Background Tiles - { "14.6a", 0x10000, 0x744f5c9e, 5 | BRF_GRA }, // 11 - - { "tfj-12.7d", 0x10000, 0xd74085a1, 6 | BRF_GRA }, // 12 Sprites - { "tfj-13.9d", 0x10000, 0x148aa0c5, 6 | BRF_GRA }, // 13 - - { "10.11c", 0x04000, 0xac705812, 7 | BRF_GRA }, // 14 MCU data - - { "n82s129an.11j", 0x00100, 0x81244757, 8 | BRF_OPT }, // 15 Proms -}; - -STD_ROM_PICK(terrafj) -STD_ROM_FN(terrafj) - -struct BurnDriver BurnDrvTerrafj = { - "terrafj", "terraf", NULL, NULL, "1987", - "Terra Force (Japan)\0", NULL, "Nichibutsu Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, terrafjRomInfo, terrafjRomName, NULL, NULL, ArmedfInputInfo, TerrafDIPInfo, - TerrafInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Terra Force (Japan, bootleg with additional Z80) - -static struct BurnRomInfo terrafjbRomDesc[] = { - { "tfj-8.bin", 0x10000, 0xb11a6fa7, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tfj-3.bin", 0x10000, 0x6c6aa7ed, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tfj-7.bin", 0x10000, 0xfde8de7e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tfj-2.bin", 0x10000, 0xdb987414, 1 | BRF_PRG | BRF_ESS }, // 3 - { "tfb-6.bin", 0x08000, 0x552c3c63, 1 | BRF_PRG | BRF_ESS }, // 4 - { "tfb-1.bin", 0x08000, 0x6a0b94c7, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "tf-001.17k", 0x10000, 0xeb6b4138, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "tfb-10.bin", 0x04000, 0x3f9aa367, 9 | BRF_PRG | BRF_ESS }, // 7 Z80 Code (Mcu replacement) - - { "9.11e", 0x08000, 0xbc6f7cbc, 3 | BRF_GRA }, // 8 Characters - - { "5.15h", 0x10000, 0x25d23dfd, 4 | BRF_GRA }, // 9 Foreground Tiles - { "4.13h", 0x10000, 0xb9b0fe27, 4 | BRF_GRA }, // 10 - - { "15.8a", 0x10000, 0x2144d8e0, 5 | BRF_GRA }, // 11 Background Tiles - { "14.6a", 0x10000, 0x744f5c9e, 5 | BRF_GRA }, // 12 - - { "tfj-12.7d", 0x10000, 0xd74085a1, 6 | BRF_GRA | BRF_OPT }, // 13 Sprites - { "tfj-13.9d", 0x10000, 0x148aa0c5, 6 | BRF_GRA | BRF_OPT }, // 14 - - { "n82s129an.11j", 0x00100, 0x81244757, 7 | BRF_OPT }, // 15 proms -}; - -STD_ROM_PICK(terrafjb) -STD_ROM_FN(terrafjb) - -static INT32 TerrafjbLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 5, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 6, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 14, 1)) return 1; - - return 0; -} - -static INT32 TerrafjbInit() -{ - scroll_type = 5; - sprite_offy = 128; - irqline = 1; - - Terrafjb = 1; - - INT32 nRet = DrvInit(TerrafjbLoadRoms, Cclimbr268KInit, 0xf800); - - if (nRet == 0) { - DACSetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.80, BURN_SND_ROUTE_BOTH); - } - - return nRet; -} - -struct BurnDriver BurnDrvTerrafjb = { - "terrafjb", "terraf", NULL, NULL, "1987", - "Terra Force (Japan, bootleg with additional Z80)\0", "imperfect graphics", "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, terrafjbRomInfo, terrafjbRomName, NULL, NULL, ArmedfInputInfo, TerrafDIPInfo, - TerrafjbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Terra Force (Japan, bootleg set 2) - -static struct BurnRomInfo terrafbRomDesc[] = { - { "f-14.4s", 0x10000, 0x8e5f557f, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "f-11.3s", 0x10000, 0x5320162a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "f-13.4p", 0x10000, 0xa86951e0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "f-9.3p", 0x10000, 0x58b5f43b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "f-12.4m", 0x08000, 0x4f0e1d76, 1 | BRF_PRG | BRF_ESS }, // 4 - { "f-8.3m", 0x08000, 0xd1014280, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "f-1.1a", 0x10000, 0xeb6b4138, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 code - - { "f-11.4g", 0x08000, 0xbc6f7cbc, 3 | BRF_GRA }, // 7 Characters - - { "f-6.3c", 0x10000, 0x25d23dfd, 4 | BRF_GRA }, // 8 Foreground Tiles - { "f-7.3e", 0x10000, 0xb9b0fe27, 4 | BRF_GRA }, // 9 - - { "f-4.9k", 0x10000, 0x2144d8e0, 5 | BRF_GRA }, // 10 Background Tiles - { "f-5.9m", 0x10000, 0x744f5c9e, 5 | BRF_GRA }, // 11 - - { "f-3.6l", 0x10000, 0xd74085a1, 6 | BRF_GRA }, // 12 Sprites - { "f-2.6j", 0x10000, 0x148aa0c5, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(terrafb) -STD_ROM_FN(terrafb) - -struct BurnDriver BurnDrvTerrafb = { - "terrafb", "terraf", NULL, NULL, "1987", - "Terra Force (Japan, bootleg set 2)\0", "imperfect graphics", "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, terrafbRomInfo, terrafbRomName, NULL, NULL, ArmedfInputInfo, TerrafDIPInfo, - TerrafbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - -static INT32 SkyroboLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 12, 1)) return 1; - - return 0; -} - -static INT32 SkyRoboInit() -{ - scroll_type = 1; - sprite_offy = 128; - irqline = 1; - - Skyrobo = 1; - - INT32 nRet = DrvInit(SkyroboLoadRoms, Bigfghtr68KInit, 0xf800); - - if (nRet == 0) { - DACSetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.80, BURN_SND_ROUTE_BOTH); - } - - return nRet; -} - - -// Sky Robo - -static struct BurnRomInfo skyroboRomDesc[] = { - { "3", 0x20000, 0x02d8ba9f, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "1", 0x20000, 0xfcfd9e2e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4", 0x20000, 0x37ced4b7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "2", 0x20000, 0x88d52f8e, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8.17k", 0x10000, 0x0aeab61e, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - - { "i8751.bin", 0x01000, 0x64a0d225, 3 | BRF_PRG | BRF_ESS }, // 5 mcu - - { "7", 0x08000, 0xf556ef28, 4 | BRF_GRA }, // 6 gfx1 - - { "5.13f", 0x20000, 0xd440a29f, 5 | BRF_GRA }, // 7 gfx2 - { "6.15f", 0x10000, 0x27469a76, 5 | BRF_GRA }, // 8 - - { "12.8a", 0x10000, 0xa5694ea9, 6 | BRF_GRA }, // 9 gfx3 - { "11.6a", 0x10000, 0x10b74e2c, 6 | BRF_GRA }, // 10 - - { "9.8d", 0x20000, 0xfe67800e, 7 | BRF_GRA }, // 11 gfx4 - { "10.9d", 0x20000, 0xdcb828c4, 7 | BRF_GRA }, // 12 - - { "tf.13h", 0x00100, 0x81244757, 8 | BRF_GRA }, // 13 proms -}; - -STD_ROM_PICK(skyrobo) -STD_ROM_FN(skyrobo) - -struct BurnDriver BurnDrvSkyrobo = { - "skyrobo", NULL, NULL, NULL, "1989", - "Sky Robo\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, skyroboRomInfo, skyroboRomName, NULL, NULL, BigfghtrInputInfo, BigfghtrDIPInfo, - SkyRoboInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; - - -// Tatakae! Big Fighter (Japan) - -static struct BurnRomInfo bigfghtrRomDesc[] = { - { "3.ic3", 0x20000, 0xe1e1f291, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "1.ic2", 0x20000, 0x1100d991, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4.ic5", 0x20000, 0x2464a83b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "2.ic4", 0x20000, 0xb47bbcd5, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8.17k", 0x10000, 0x0aeab61e, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - - { "i8751.bin", 0x01000, 0x64a0d225, 3 | BRF_PRG | BRF_ESS }, // 5 mcu - - { "7.11c", 0x08000, 0x1809e79f, 4 | BRF_GRA }, // 6 gfx1 - - { "5.13f", 0x20000, 0xd440a29f, 5 | BRF_GRA }, // 7 gfx2 - { "6.15f", 0x10000, 0x27469a76, 5 | BRF_GRA }, // 8 - - { "12.8a", 0x10000, 0xa5694ea9, 6 | BRF_GRA }, // 9 gfx3 - { "11.6a", 0x10000, 0x10b74e2c, 6 | BRF_GRA }, // 10 - - { "9.8d", 0x20000, 0xfe67800e, 7 | BRF_GRA }, // 11 gfx4 - { "10.9d", 0x20000, 0xdcb828c4, 7 | BRF_GRA }, // 12 - - { "tf.13h", 0x00100, 0x81244757, 8 | BRF_GRA }, // 13 proms -}; - -STD_ROM_PICK(bigfghtr) -STD_ROM_FN(bigfghtr) - -struct BurnDriver BurnDrvBigfghtr = { - "bigfghtr", "skyrobo", NULL, NULL, "1989", - "Tatakae! Big Fighter (Japan)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, bigfghtrRomInfo, bigfghtrRomName, NULL, NULL, BigfghtrInputInfo, BigfghtrDIPInfo, - SkyRoboInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_atetris.cpp b/jan/src/burn/drv/pre90s/d_atetris.cpp deleted file mode 100644 index af0ff2dc0..000000000 --- a/jan/src/burn/drv/pre90s/d_atetris.cpp +++ /dev/null @@ -1,647 +0,0 @@ -// FB Alpha driver module Atari Tetris driver module -// Based on MAME driver by Zsolt Vasvari - -// To do: -// figure out why it needs to be overclocked for the music to sound right. -// verify bootleg set 2 sound - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "slapstic.h" -#include "sn76496.h" -#include "pokey.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv6502ROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvNVRAM; -static UINT8 *Drv6502RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvPalRAM; - -static INT32 nvram_enable; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 watchdog; -static INT32 master_clock; -static INT32 vblank; -static INT32 is_Bootleg; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo AtetrisInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p1 coin" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 2, "p1 right" }, - {"P1 Button", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p2 coin" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 7, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 6, "p2 right" }, - {"P2 Button", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dips", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Atetris) - -static struct BurnDIPInfo AtetrisDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x0b, 0x01, 0x04, 0x00, "Off" }, - {0x0b, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze Step" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x80, 0x00, "Off" }, - {0x0b, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Atetris) - -static struct BurnDIPInfo AtetriscDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x0b, 0x01, 0x04, 0x00, "Off" }, - {0x0b, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze Step" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 0, "Flip Controls"}, - {0x0b, 0x01, 0x20, 0x00, "Off" }, - {0x0b, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x80, 0x00, "Off" }, - {0x0b, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Atetrisc) - -static inline UINT8 atetris_slapstic_read(UINT16 offset) -{ - UINT8 ret = Drv6502ROM[((SlapsticBank() & 1) * 0x4000) + (offset & 0x3fff)]; - - if (offset & 0x2000) SlapsticTweak(offset & 0x1fff); - - return ret; -} - -static inline void DrvPaletteUpdate(UINT16 offset) -{ - INT32 r = (DrvPalRAM[offset] >> 5) & 7; - INT32 g = (DrvPalRAM[offset] >> 2) & 7; - INT32 b = (DrvPalRAM[offset] >> 0) & 3; - - r = (r << 5) | (r << 2) | (r >> 1); - g = (g << 5) | (g << 2) | (g >> 1); - b = (b << 6) | (b << 4) | (b << 2) | (b << 0); - - DrvPalette[offset] = BurnHighCol(r, g, b, 0); -} - -static UINT8 atetris_read(UINT16 address) -{ - if ((address & 0xc000) == 0x4000) { - return atetris_slapstic_read(address); - } - -// The following should be read through the Pokey, but.. not for now. -#if 0 - if (is_Bootleg) -#endif - { - switch (address & ~0x03e0) - { - case 0x2808: - return DrvInputs[0] | vblank; - - case 0x2818: - return DrvInputs[1]; - } - } -#if 0 - else - { - switch (address & ~0x03ef) - { - case 0x2800: - return 0; // pokey1 - - case 0x2810: - return 0; // pokey2 - } - } -#endif - return 0; -} - -static void atetris_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x2000) { - DrvPalRAM[address & 0x00ff] = data; - DrvPaletteUpdate(address & 0x00ff); - return; - } - - if ((address & 0xfc00) == 0x2400) { - if (nvram_enable) { - DrvNVRAM[address & 0x01ff] = data; - } - nvram_enable = 0; - return; - } - - if (is_Bootleg) // Bootleg set 2 sound system - { - switch (address) - { - case 0x2802: - SN76496Write(0, data); - return; - - case 0x2804: - SN76496Write(1, data); - return; - - case 0x2806: - SN76496Write(2, data); - return; - } - } - else - { - switch (address & ~0x03ef) - { - case 0x2800: // pokey1 - pokey1_w(address - 0x2800, data); - return; - - case 0x2810: // pokey2 - pokey2_w(address - 0x2800, data); - return; - } - } - - switch (address & ~0x03ff) - { - case 0x3000: - watchdog = 0; - return; - - case 0x3400: - nvram_enable = 1; - return; - - case 0x3800: - M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0x3c00: - // coin counter - (data & 0x20) -> 0, (data & 0x10) -> 1 - return; - } - bprintf(0, _T("unmapped %X data %X\n"), address, data); -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset(AllRam, 0, RamEnd - AllRam); - } - - M6502Open(0); - M6502Reset(); - M6502Close(); - - SlapsticReset(); - - HiscoreReset(); - - watchdog = 0; - nvram_enable = 0; - - return 0; -} - -static tilemap_callback( atetris ) -{ - INT32 attr = DrvVidRAM[offs * 2 + 1]; - - TILE_SET_INFO(0, DrvVidRAM[offs * 2 + 0] | ((attr & 0x07) << 8), attr >> 4, 0); -} - -static void DrvGfxExpand() -{ - for (INT32 i = (0x10000 - 1) * 2; i >= 0; i-=2) { - DrvGfxROM[i + 1] = DrvGfxROM[i/2] & 0x0f; - DrvGfxROM[i + 0] = DrvGfxROM[i/2] >> 4; - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv6502ROM = Next; Next += 0x010000; - - DrvGfxROM = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - DrvNVRAM = Next; Next += 0x000200; - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x001000; - Drv6502RAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x000100; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 CommonInit(INT32 boot) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv6502ROM, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM , 1, 1)) return 1; - - DrvGfxExpand(); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Drv6502RAM, 0x0000, 0x0fff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x1000, 0x1fff, MAP_RAM); - M6502MapMemory(DrvPalRAM, 0x2000, 0x20ff, MAP_ROM); - M6502MapMemory(DrvPalRAM, 0x2100, 0x21ff, MAP_ROM); - M6502MapMemory(DrvPalRAM, 0x2200, 0x22ff, MAP_ROM); - M6502MapMemory(DrvPalRAM, 0x2300, 0x23ff, MAP_ROM); - M6502MapMemory(DrvNVRAM, 0x2400, 0x25ff, MAP_ROM); - M6502MapMemory(DrvNVRAM, 0x2600, 0x27ff, MAP_ROM); - M6502MapMemory(Drv6502ROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6502SetReadHandler(atetris_read); - M6502SetReadOpHandler(atetris_read); - M6502SetReadOpArgHandler(atetris_read); - M6502SetWriteHandler(atetris_write); - M6502Close(); - - SlapsticInit(101); - - is_Bootleg = boot; - master_clock = boot ? (14745600 / 8) : (14318180 / 8); - - if (is_Bootleg) { // Bootleg set 2 sound system - SN76496Init(0, master_clock, 0); - SN76496Init(1, master_clock, 1); - SN76496Init(2, master_clock, 1); - SN76496SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(2, 0.50, BURN_SND_ROUTE_BOTH); - } else { - PokeyInit(0, 2, 1.00, 0); - } - - GenericTilesInit(); - GenericTilemapInit(0, scan_rows_map_scan, atetris_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(0, DrvGfxROM, 4, 8, 8, 0x20000, 0, 0xf); - - memset (DrvNVRAM, 0xff, 0x200); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - - if (is_Bootleg) { // Bootleg set 2 sound system - SN76496Exit(); - } else { - PokeyExit(); - } - SlapsticExit(); - - BurnFree (AllMem); - - return 0; -} - -#if 0 -static void DrawLayer() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = DrvVidRAM[offs * 2 + 0] | ((DrvVidRAM[offs * 2 + 1] & 0x07) << 8); - INT32 color = DrvVidRAM[offs * 2 + 1] >> 4; - - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM); - } -} -#endif - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x100; i++) { - DrvPaletteUpdate(i); - } - - DrvRecalc = 0; - } - - GenericTilemapDraw(0, pTransDraw, -1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - { - DrvInputs[0] = DrvDips[0] & 0xbc; - DrvInputs[1] = 0; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 262; - INT32 nCyclesTotal[1] = { master_clock*8 / 60 }; - INT32 nCyclesDone[1] = { 0 }; - - M6502Open(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6502Run(nCyclesTotal[0] / nInterleave); - - if (i%6==0) { - M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - if (i == 240) vblank = 0x40; - } - - M6502Close(); - - if (pBurnSoundOut) { - if (is_Bootleg) { // Bootleg set 2 sound system - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - SN76496Update(2, pBurnSoundOut, nBurnSoundLen); - } else { - pokey_update(0, pBurnSoundOut, nBurnSoundLen); - pokey_update(1, pBurnSoundOut, nBurnSoundLen); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029727; - } - - if (nAction & ACB_NVRAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvNVRAM; - ba.nLen = 0x000200; - ba.szName = "Nonvolatile RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - SlapsticScan(nAction); - - if (is_Bootleg) // Bootleg set 2 sound system - { - SN76496Scan(nAction, pnMin); - } else { - pokey_scan(nAction, pnMin); - } - - SCAN_VAR(nvram_enable); - } - - if (nAction & ACB_WRITE) { - DrvRecalc = 1; - } - - return 0; -} - - -// Tetris (set 1) - -static struct BurnRomInfo atetrisRomDesc[] = { - { "136066-1100.45f", 0x10000, 0x2acbdb09, 1 | BRF_ESS | BRF_PRG }, // 0 6502 Code - - { "136066-1101.35a", 0x10000, 0x84a1939f, 2 | BRF_GRA }, // 1 Graphics Tiles -}; - -STD_ROM_PICK(atetris) -STD_ROM_FN(atetris) - -static INT32 DrvInit() -{ - return CommonInit(0); -} - -struct BurnDriver BurnDrvAtetris = { - "atetris", NULL, NULL, NULL, "1988", - "Tetris (set 1)\0", "No sound", "Atari Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, atetrisRomInfo, atetrisRomName, NULL, NULL, AtetrisInputInfo, AtetrisDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 336, 240, 4, 3 -}; - - -// Tetris (set 2) - -static struct BurnRomInfo atetrisaRomDesc[] = { - { "d1", 0x10000, 0x2bcab107, 1 | BRF_ESS | BRF_PRG }, // 0 6502 Code - - { "136066-1101.35a", 0x10000, 0x84a1939f, 2 | BRF_GRA }, // 1 Graphics Tiles -}; - -STD_ROM_PICK(atetrisa) -STD_ROM_FN(atetrisa) - -struct BurnDriver BurnDrvAtetrisa = { - "atetrisa", "atetris", NULL, NULL, "1988", - "Tetris (set 2)\0", "No sound", "Atari Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, atetrisaRomInfo, atetrisaRomName, NULL, NULL, AtetrisInputInfo, AtetrisDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 336, 240, 4, 3 -}; - - -// Tetris (bootleg set 1) - -static struct BurnRomInfo atetrisbRomDesc[] = { - { "tetris.01", 0x10000, 0x944d15f6, 1 | BRF_ESS | BRF_PRG }, // 0 6502 Code - - { "tetris.02", 0x10000, 0x5c4e7258, 2 | BRF_GRA }, // 1 Graphics Tiles - - { "tetris.03", 0x00800, 0x26618c0b, 0 | BRF_OPT }, // 2 Unknown Prom -}; - -STD_ROM_PICK(atetrisb) -STD_ROM_FN(atetrisb) - -struct BurnDriver BurnDrvAtetrisb = { - "atetrisb", "atetris", NULL, NULL, "1988", - "Tetris (bootleg set 1)\0", "No sound", "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, atetrisbRomInfo, atetrisbRomName, NULL, NULL, AtetrisInputInfo, AtetrisDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 336, 240, 4, 3 -}; - - -// Tetris (bootleg set 2) - -static struct BurnRomInfo atetrisb2RomDesc[] = { - { "k1-01", 0x10000, 0xfa056809, 1 | BRF_ESS | BRF_PRG }, // 0 6502 Code - - { "136066-1101.35a", 0x10000, 0x84a1939f, 2 | BRF_GRA }, // 1 Graphics Tiles -}; - -STD_ROM_PICK(atetrisb2) -STD_ROM_FN(atetrisb2) - -static INT32 BootInit() -{ - return CommonInit(1); -} - -struct BurnDriver BurnDrvAtetrisb2 = { - "atetrisb2", "atetris", NULL, NULL, "1988", - "Tetris (bootleg set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, atetrisb2RomInfo, atetrisb2RomName, NULL, NULL, AtetrisInputInfo, AtetrisDIPInfo, - BootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 336, 240, 4, 3 -}; - - -// Tetris (cocktail set 1) - -static struct BurnRomInfo atetriscRomDesc[] = { - { "tetcktl1.rom", 0x10000, 0x9afd1f4a, 1 | BRF_ESS | BRF_PRG }, // 0 6502 Code - - { "136066-1103.35a", 0x10000, 0xec2a7f93, 2 | BRF_GRA }, // 1 Graphics Tiles -}; - -STD_ROM_PICK(atetrisc) -STD_ROM_FN(atetrisc) - -struct BurnDriver BurnDrvAtetrisc = { - "atetrisc", "atetris", NULL, NULL, "1989", - "Tetris (cocktail set 1)\0", "No sound", "Atari Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, atetriscRomInfo, atetriscRomName, NULL, NULL, AtetrisInputInfo, AtetriscDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 336, 3, 4 -}; - - -// Tetris (cocktail set 2) - -static struct BurnRomInfo atetrisc2RomDesc[] = { - { "136066-1102.45f", 0x10000, 0x1bd28902, 1 | BRF_ESS | BRF_PRG }, // 0 6502 Code - - { "136066-1103.35a", 0x10000, 0xec2a7f93, 2 | BRF_GRA }, // 1 Graphics Tiles -}; - -STD_ROM_PICK(atetrisc2) -STD_ROM_FN(atetrisc2) - -struct BurnDriver BurnDrvAtetrisc2 = { - "atetrisc2", "atetris", NULL, NULL, "1989", - "Tetris (cocktail set 2)\0", "No sound", "Atari Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, atetrisc2RomInfo, atetrisc2RomName, NULL, NULL, AtetrisInputInfo, AtetriscDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 336, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_aztarac.cpp b/jan/src/burn/drv/pre90s/d_aztarac.cpp deleted file mode 100644 index 2bb2e73bc..000000000 --- a/jan/src/burn/drv/pre90s/d_aztarac.cpp +++ /dev/null @@ -1,640 +0,0 @@ -// FB Alpha Aztarac driver module -// Based on MAME driver by Mathis Rosenhauer - -#include "burnint.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "vector.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVecRAM; -static UINT8 *DrvNVRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static INT32 sound_irq_timer; -static INT32 sound_status; - -static INT32 sound_initialized = 0; -static INT16 *pFMBuffer[12]; - -static INT32 xcenter; -static INT32 ycenter; - -static INT32 watchdog; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvInputs[1]; -static UINT8 DrvReset; - -static INT16 DrvAnalogPort0; -static INT16 DrvAnalogPort1; - -static UINT8 xAxis = 0; -static UINT8 yAxis = 0; -static UINT8 Dial = 0; -static UINT8 DialInputs[2]; - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo AztaracInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 2" }, - - A("Left/Right", BIT_ANALOG_REL, &DrvAnalogPort0, "p1 x-axis" ), - A("Up/Down", BIT_ANALOG_REL, &DrvAnalogPort1, "p1 y-axis" ), - {"Aim Left", BIT_DIGITAL, DialInputs + 0, "p1 fire 3" }, - {"Aim Right", BIT_DIGITAL, DialInputs + 1, "p1 fire 4" }, - - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, -}; - -STDINPUTINFO(Aztarac) - -#undef A - -static inline void read_vectorram (INT32 addr, INT32 *x, INT32 *y, INT32 *c) -{ - *c = SekReadWord(0xff8000 + addr); - *x = SekReadWord(0xff9000 + addr) & 0x03ff; - *y = SekReadWord(0xffa000 + addr) & 0x03ff; - if (*x & 0x200) *x |= 0xfffffc00; // signed - if (*y & 0x200) *y |= 0xfffffc00; // signed -} - -static void aztarac_process_vector_list() -{ - INT32 x, y, c, intensity, xoffset, yoffset, color; - INT32 defaddr, objaddr, ndefs; - - vector_reset(); - - for (objaddr = 0; objaddr < 0x800; objaddr++) - { - read_vectorram (objaddr * 2, &xoffset, &yoffset, &c); - - if (c & 0x4000) break; - - if ((c & 0x2000) == 0) - { - defaddr = (c >> 1) & 0x7ff; - - vector_add_point((xcenter + (xoffset << 16)), (ycenter - (yoffset << 16)), 0, 0); - - read_vectorram (defaddr * 2, &x, &ndefs, &c); - ndefs++; - - if (c & 0xff00) - { - intensity = (c >> 8); - color = c & 0x3f; - - while (ndefs--) - { - defaddr++; - read_vectorram (defaddr * 2, &x, &y, &c); - - if ((c & 0xff00) == 0) - vector_add_point((xcenter + ((x + xoffset) << 16)), (ycenter - ((y + yoffset) << 16)), 0, 0); - else - vector_add_point((xcenter + ((x + xoffset) << 16)), (ycenter - ((y + yoffset) << 16)), color, intensity); - } - } - else - { - while (ndefs--) - { - defaddr++; - read_vectorram (defaddr * 2, &x, &y, &c); - - color = c & 0x3f; - vector_add_point((xcenter + ((x + xoffset) << 16)), (ycenter - ((y + yoffset) << 16)), color, c >> 8); - } - } - } - } -} - -static inline void sync_cpu() -{ - INT32 cycles = (SekTotalCycles() / 4) - ZetTotalCycles(); - - if (cycles > 0) ZetRun(cycles); -} - -void __fastcall aztarac_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff00) == 0x022000) { - *((UINT16*)(DrvNVRAM + (address & 0xfe))) = data | 0xfff0; - return; - } - - if (address == 0xffb000) { - if (data) aztarac_process_vector_list(); // used once? - return; - } -} - -void __fastcall aztarac_write_byte(UINT32 address, UINT8 data) -{ - if (address == 0x027009) { - sync_cpu(); - *soundlatch = data; - sound_status ^= 0x21; - - if (sound_status & 0x20) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - - return; - } - - if (address == 0xffb001) { - if (data) aztarac_process_vector_list(); - return; - } -} - -UINT16 __fastcall aztarac_read_word(UINT32 address) -{ - switch (address) - { - case 0x027004: - return 0xff00 | DrvInputs[0]; - - case 0x02700e: - watchdog = 0; - return 0; - } - - return 0; -} - -UINT8 __fastcall aztarac_read_byte(UINT32 address) -{ - switch (address) - { - case 0x027000: - return xAxis - 0x0f; - - case 0x027001: - return yAxis - 0x0f; - - case 0x027005: - return DrvInputs[0]; // inputs - - case 0x027009: - sync_cpu(); - return sound_status & 0x01; - - case 0x02700d: - return Dial; - } - - return 0; -} - -void __fastcall aztarac_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8c00: - case 0x8c01: - case 0x8c02: - case 0x8c03: - case 0x8c04: - case 0x8c05: - case 0x8c06: - case 0x8c07: - AY8910Write((address & 6) / 2, ~address & 1, data); - return; - - case 0x9000: - sound_status &= ~0x10; - return; - } -} - -UINT8 __fastcall aztarac_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8800: - sound_status = (sound_status | 0x01) & ~0x20; - return *soundlatch; - - case 0x8c00: - case 0x8c01: - case 0x8c02: - case 0x8c03: - case 0x8c04: - case 0x8c05: - case 0x8c06: - case 0x8c07: - return AY8910Read((address & 6) / 2); - - case 0x9000: - return sound_status & ~0x01; - } - - return 0; -} - -static INT32 __fastcall aztarac_irq_callback(INT32) -{ - return 0x0c; -} - -static INT32 DrvDoReset(INT32 reset_ram) -{ - if (reset_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - AY8910Reset(2); - AY8910Reset(3); - - sound_status = 0; - sound_irq_timer = 0; - - watchdog = 0; - - vector_reset(); - - return 0; -} - -static void sound_init() // Changed refresh rate causes crashes -{ - for (INT32 i = 0; i < 12; i++) { - pFMBuffer[i] = (INT16*)BurnMalloc(nBurnSoundLen * sizeof(INT16)); - } - - sound_initialized = 1; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x010000; - DrvZ80ROM = Next; Next += 0x002000; - - DrvNVRAM = Next; Next += 0x000400; - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x002000; - DrvZ80RAM = Next; Next += 0x000800; - DrvVecRAM = Next; Next += 0x003000; - - soundlatch = Next; Next += 0x000004; // 1 - - RamEnd = Next; - - DrvPalette = (UINT32*)Next; Next += 0x0040 * 256 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x40; i++) // color - { - for (INT32 j = 0; j < 256; j++) // intensity - { - INT32 r = (i >> 4) & 3; - r = (r << 6) | (r << 4) | (r << 2) | (r << 0); - - INT32 g = (i >> 2) & 3; - g = (g << 6) | (g << 4) | (g << 2) | (g << 0); - - INT32 b = (i >> 0) & 3; - b = (b << 6) | (b << 4) | (b << 2) | (b << 0); - - r = (r * j) / 255; - g = (g * j) / 255; - b = (b * j) / 255; - - DrvPalette[i * 256 + j] = (r << 16) | (g << 8) | b; - } - } -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(40.0); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x02001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x02000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x04001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x04000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x06001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x06000, 7, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x08001, 8, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x08000, 9, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0a001, 10, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0a000, 11, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x01000, 13, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekSetIrqCallback(aztarac_irq_callback); - SekMapMemory(Drv68KROM, 0x000000, 0x00bfff, MAP_ROM); - SekMapMemory(DrvNVRAM, 0x022000, 0x0223ff, MAP_ROM); - SekMapMemory(DrvVecRAM, 0xff8000, 0xffafff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xffe000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, aztarac_write_word); - SekSetWriteByteHandler(0, aztarac_write_byte); - SekSetReadWordHandler(0, aztarac_read_word); - SekSetReadByteHandler(0, aztarac_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x1fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x1fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(aztarac_sound_write); - ZetSetReadHandler(aztarac_sound_read); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(3, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(2, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(3, 0.15, BURN_SND_ROUTE_BOTH); - - DrvPaletteInit(); - - vector_init(); - - xcenter = (1024 / 2) << 16; - ycenter = ( 768 / 2) << 16; - - memset (DrvNVRAM, 0xff, 0x100); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - vector_exit(); - - SekExit(); - ZetExit(); - - AY8910Exit(0); - AY8910Exit(1); - AY8910Exit(2); - AY8910Exit(3); - - BurnFree (AllMem); - - sound_initialized = 0; - for (INT32 i = 0; i < 12; i++) { - BurnFree (pFMBuffer[i]); - } - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_vector(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (sound_initialized == 0) { - if (pBurnSoundOut) { - sound_init(); - } - } - - if (DrvReset) { - DrvDoReset(1); - } - - watchdog++; - if (watchdog == 180) { // 3 seconds? - DrvDoReset(0); - } - - SekNewFrame(); - ZetNewFrame(); - - { - DrvInputs[0] = 0xff; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - - xAxis = (DrvAnalogPort0 >> 7) + 0x0f; - if (xAxis > 0x80) xAxis = 0; - - yAxis = (~DrvAnalogPort1 >> 7) + 0x10; - if (yAxis > 0x1d) yAxis = 0x1d; - - if (DialInputs[0]) { - Dial += 0x04; - } else { - if (DialInputs[1]) { - Dial -= 0x04; - } - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 8000000 / 40, 2000000 / 40 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++, sound_irq_timer++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1)) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - //nCyclesDone[1] += ZetRun((SekTotalCycles() / 4) - ZetTotalCycles()); - sync_cpu(); - - if ((sound_irq_timer % 40) == 39) { // every 20000 cycles, 50000 / frame - sound_status ^= 0x10; - if (sound_status & 0x10) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - } - - SekClose(); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pFMBuffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_ROM) { - ba.Data = Drv68KROM; - ba.nLen = 0x000c000; - ba.nAddress = 0x0000000; - ba.szName = "68K ROM"; - BurnAcb(&ba); - - ba.Data = DrvZ80ROM; - ba.nLen = 0x0002000; - ba.nAddress = 0x0000000; - ba.szName = "Z80 ROM"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = Drv68KRAM; - ba.nLen = 0x0002000; - ba.nAddress = 0x0ffe000; - ba.szName = "68K RAM"; - BurnAcb(&ba); - - ba.Data = DrvVecRAM; - ba.nLen = 0x0003000; - ba.nAddress = 0x0ff8000; - ba.szName = "Vector RAM"; - BurnAcb(&ba); - - ba.Data = DrvZ80RAM; - ba.nLen = 0x0000800; - ba.nAddress = 0x0000000; - ba.szName = "Z80 RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNVRAM; - ba.nLen = 0x000100; - ba.nAddress = 0x022000; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(*soundlatch); - SCAN_VAR(sound_irq_timer); - SCAN_VAR(sound_status); - } - - vector_scan(nAction); - - return 0; -} - - -// Aztarac - -static struct BurnRomInfo aztaracRomDesc[] = { - { "6.l8", 0x1000, 0x25f8da18, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "0.n8", 0x1000, 0x04e20626, 1 | BRF_PRG | BRF_ESS }, // 1 - { "7.l7", 0x1000, 0x230e244c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "1.n7", 0x1000, 0x37b12697, 1 | BRF_PRG | BRF_ESS }, // 3 - { "8.l6", 0x1000, 0x1293fb9d, 1 | BRF_PRG | BRF_ESS }, // 4 - { "2.n6", 0x1000, 0x712c206a, 1 | BRF_PRG | BRF_ESS }, // 5 - { "9.l5", 0x1000, 0x743a6501, 1 | BRF_PRG | BRF_ESS }, // 6 - { "3.n5", 0x1000, 0xa65cbf99, 1 | BRF_PRG | BRF_ESS }, // 7 - { "a.l4", 0x1000, 0x9cf1b0a1, 1 | BRF_PRG | BRF_ESS }, // 8 - { "4.n4", 0x1000, 0x5f0080d5, 1 | BRF_PRG | BRF_ESS }, // 9 - { "b.l3", 0x1000, 0x8cc7f7fa, 1 | BRF_PRG | BRF_ESS }, // 10 - { "5.n3", 0x1000, 0x40452376, 1 | BRF_PRG | BRF_ESS }, // 11 - - { "c.j4", 0x1000, 0xe897dfcd, 2 | BRF_PRG | BRF_ESS }, // 12 Z80 Code - { "d.j3", 0x1000, 0x4016de77, 2 | BRF_PRG | BRF_ESS }, // 13 - - /* not hooked up */ - { "l5.l5", 0x00020, 0x317fb438, 0 | BRF_OPT }, // 14 Proms - { "k8.k8", 0x01000, 0x596ad8d9, 0 | BRF_OPT }, // 15 - { "k9.k9", 0x01000, 0xb8544823, 0 | BRF_OPT }, // 16 -}; - -STD_ROM_PICK(aztarac) -STD_ROM_FN(aztarac) - -struct BurnDriver BurnDrvAztarac = { - "aztarac", NULL, NULL, NULL, "1983", - "Aztarac\0", "Vector graphics", "Centuri", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, aztaracRomInfo, aztaracRomName, NULL, NULL, AztaracInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40 * 256, - 1024, 768, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_baraduke.cpp b/jan/src/burn/drv/pre90s/d_baraduke.cpp deleted file mode 100644 index 94b60b5b5..000000000 --- a/jan/src/burn/drv/pre90s/d_baraduke.cpp +++ /dev/null @@ -1,971 +0,0 @@ -// FB Alpha Baraduke driver module -// Based on MAME driver by Manuel Abadia and various others - -#include "tiles_generic.h" -#include "m6800_intf.h" -#include "m6809_intf.h" -#include "namco_snd.h" -#include "burn_led.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvHD63701ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvHD63701RAM1; -static UINT8 *DrvHD63701RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; -static UINT8 *buffer_sprites; -static UINT8 *coin_lockout; -static UINT8 *scroll; -static UINT8 *ip_select; -static INT32 *kludge1105; - -static INT32 watchdog; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[8]; - -static struct BurnInputInfo BaradukeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Baraduke) - -static struct BurnDIPInfo BaradukeDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x10, 0x01, 0x18, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x18, 0x08, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x18, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x60, 0x40, "2" }, - {0x10, 0x01, 0x60, 0x60, "3" }, - {0x10, 0x01, 0x60, 0x20, "4" }, - {0x10, 0x01, 0x60, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Round Select" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x30, 0x20, "Easy" }, - {0x11, 0x01, 0x30, 0x30, "Normal" }, - {0x11, 0x01, 0x30, 0x10, "Hard" }, - {0x11, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0xc0, 0x80, "Every 10k" }, - {0x11, 0x01, 0xc0, 0xc0, "10k And Every 20k" }, - {0x11, 0x01, 0xc0, 0x40, "Every 20k" }, - {0x11, 0x01, 0xc0, 0x00, "None" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x12, 0x01, 0x02, 0x02, "Upright" }, -// {0x12, 0x01, 0x02, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Baraduke) - -static struct BurnDIPInfo MetrocrsDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x10, 0x01, 0x04, 0x00, "No" }, - {0x10, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x18, 0x10, "Easy" }, - {0x10, 0x01, 0x18, 0x18, "Normal" }, - {0x10, 0x01, 0x18, 0x08, "Hard" }, - {0x10, 0x01, 0x18, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x10, 0x01, 0x60, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x60, 0x20, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x60, 0x60, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x60, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Round Select" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x12, 0x01, 0x02, 0x02, "Upright" }, -// {0x12, 0x01, 0x02, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Metrocrs) - -void baraduke_main_write(UINT16 address, UINT8 data) -{ - if (address < 0x2000) { - DrvSprRAM[address & 0x1fff] = data; - if (address == 0x1ff2) buffer_sprites[0] = 1; - return; - } - - if ((address & 0xfc00) == 0x4000) { - namcos1_custom30_write(address & 0x3ff, data); - return; - } - - switch (address) - { - case 0x8000: - watchdog = 0; - return; - - case 0x8800: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0xb000: - case 0xb001: - case 0xb002: - case 0xb004: - case 0xb005: - case 0xb006: - scroll[address & 0x07] = data; - return; - } -} - -UINT8 baraduke_main_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x4000) { - return namcos1_custom30_read(address & 0x3ff); - } - - return 0; -} - -void baraduke_mcu_write(UINT16 address, UINT8 data) -{ - if ((address & 0xffe0) == 0x0000) { - m6803_internal_registers_w(address & 0x1f, data); - return; - } - - if ((address & 0xff80) == 0x0080) { - DrvHD63701RAM1[address & 0x7f] = data; - return; - } - - if ((address & 0xfc00) == 0x1000) { - namcos1_custom30_write(address & 0x3ff, data); - return; - } -} - -UINT8 baraduke_mcu_read(UINT16 address) -{ - if ((address & 0xffe0) == 0x0000) { - return m6803_internal_registers_r(address & 0x1f); - } - - if ((address & 0xff80) == 0x0080) { - return DrvHD63701RAM1[address & 0x7f]; - } - - if (address == 0x1105) { - return ((*kludge1105)++ >> 4) & 0xff; - } - - if ((address & 0xfc00) == 0x1000) { - return namcos1_custom30_read(address & 0x3ff); - } - - return 0; -} - -void baraduke_mcu_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: - { - switch (data & 0xe0) { - case 0x60: - *ip_select = data & 0x07; - return; - - case 0xc0: - *coin_lockout = ~data & 0x01; - // coin counters 0 -> data & 0x02, 1 -> data & 0x04 - return; - } - } - return; - - case HD63701_PORT2: - BurnLEDSetStatus(0, data & 0x08); - BurnLEDSetStatus(1, data & 0x10); - return; - } -} - -UINT8 baraduke_mcu_read_port(UINT16 port) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: - return DrvInputs[*ip_select]; - - case HD63701_PORT2: - return 0xff; - } - - return 0; -} - -static INT32 DrvDoReset(INT32 ClearRAM) -{ - if (ClearRAM) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - -// HD63701Open(0); - HD63701Reset(); -// HD63701Close(); - - NamcoSoundReset(); - - BurnLEDReset(); - - BurnLEDSetFlipscreen(1); - - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x010000; - DrvHD63701ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x001000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - DrvHD63701RAM1 = Next; Next += 0x000080; - DrvHD63701RAM = Next; Next += 0x000800; - - DrvVidRAM = Next; Next += 0x002000; - DrvTxtRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x002000; - - coin_lockout = Next; Next += 0x000001; - kludge1105 = (INT32*)Next; Next += 0x000004; - ip_select = Next; Next += 0x000001; - buffer_sprites = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - scroll = Next; Next += 0x000008; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x800; i++) - { - INT32 bit0 = (DrvColPROM[0x800 + i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[0x800 + i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[0x800 + i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[0x800 + i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[0x000 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[0x000 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[0x000 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[0x000 + i] >> 3) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[0x000 + i] >> 4) & 0x01; - bit1 = (DrvColPROM[0x000 + i] >> 5) & 0x01; - bit2 = (DrvColPROM[0x000 + i] >> 6) & 0x01; - bit3 = (DrvColPROM[0x000 + i] >> 7) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void DrvGfxExpand() -{ - for (INT32 i = 0; i < 0x2000; i++) { - DrvGfxROM1[0xa000 + i] = DrvGfxROM1[0x8000 + i] << 4; - DrvGfxROM1[0xc000 + i] = DrvGfxROM1[0x8000 + i]; - DrvGfxROM1[0xe000 + i] = DrvGfxROM1[0x8000 + 1] << 4; - } - - for (INT32 i = 0x10000 - 1; i >= 0; i--) { - DrvGfxROM2[i * 2 + 1] = DrvGfxROM2[i] & 0x0f; - DrvGfxROM2[i * 2 + 0] = DrvGfxROM2[i] >> 4; - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { 0x8000 * 8, 0, 4 }; - INT32 XOffs0[8] = { 8*8, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 }; - INT32 XOffs1[8] = { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 }; - INT32 YOffs0[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }; - INT32 YOffs1[8] = { 0*8, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Plane0 + 1, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x10000); - - GfxDecode(0x0400, 3, 8, 8, Plane0 + 0, XOffs1, YOffs1, 0x080, tmp + 0x0000, DrvGfxROM1 + 0x00000); - GfxDecode(0x0400, 3, 8, 8, Plane0 + 0, XOffs1, YOffs1, 0x080, tmp + 0x4000, DrvGfxROM1 + 0x10000); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(INT32 type) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x06000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 2, 1)) return 1; - - if (BurnLoadRom(DrvHD63701ROM + 0x08000, 3, 1)) return 1; - if (BurnLoadRom(DrvHD63701ROM + 0x0f000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 7, 1)) return 1; - - if (type == 0) { - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 14, 1)) return 1; - } else { - memset (DrvGfxROM1 + 0x08000, 0xff, 0x4000); - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 11, 1)) return 1; - } - - DrvGfxExpand(); - DrvGfxDecode(); - DrvPaletteInit(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvSprRAM, 0x0000, 0x1fff, MAP_READ | MAP_FETCH); - M6809MapMemory(DrvSprRAM, 0x0000, 0x1eff, MAP_WRITE); - M6809MapMemory(DrvVidRAM, 0x2000, 0x3fff, MAP_RAM); - M6809MapMemory(DrvTxtRAM, 0x4800, 0x4fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x06000, 0x6000, 0xffff, MAP_ROM); - M6809SetWriteHandler(baraduke_main_write); - M6809SetReadHandler(baraduke_main_read); - M6809Close(); - - HD63701Init(1); -// HD63701Open(0); - HD63701MapMemory(DrvHD63701ROM + 0x8000, 0x8000, 0xbfff, MAP_ROM); - HD63701MapMemory(DrvHD63701RAM, 0xc000, 0xc7ff, MAP_RAM); - HD63701MapMemory(DrvHD63701ROM + 0xf000, 0xf000, 0xffff, MAP_ROM); - HD63701SetReadHandler(baraduke_mcu_read); - HD63701SetWriteHandler(baraduke_mcu_write); - HD63701SetReadPortHandler(baraduke_mcu_read_port); - HD63701SetWritePortHandler(baraduke_mcu_write_port); -// HD63701Close(); - - NamcoSoundInit(49152000/2048, 8, 0); - NacmoSoundSetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - - BurnLEDInit(2, LED_POSITION_BOTTOM_RIGHT, LED_SIZE_5x5, LED_COLOR_GREEN, 100); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnLEDExit(); - - NamcoSoundExit(); - - M6809Exit(); - HD63701Exit(); - - BurnFree (AllMem); - - NamcoSoundProm = NULL; - - return 0; -} - -static void draw_fg_layer() -{ - for (INT32 y = 0; y < 28; y++) - { - for (INT32 x = 0; x < 36; x++) - { - INT32 col = x - 2; - INT32 row = y + 2; - - INT32 offs = 0; - if (col & 0x20) { - offs = row + ((col & 0x1f) << 5); - } else { - offs = col + (row << 5); - } - - INT32 code = DrvTxtRAM[offs + 0x000]; - INT32 color =(DrvTxtRAM[offs + 0x400] & 0x7f) << 2; - - if (*flipscreen) { - Render8x8Tile_Mask_Clip(pTransDraw, code, 280 - (x * 8), 216 - (y * 8), color, 2, 3, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, x * 8, y * 8, color, 2, 3, 0, DrvGfxROM0); - } - } - } -} - -static void draw_bg_layer(INT32 bank, INT32 prio) -{ - UINT8 *src = DrvVidRAM + bank * 0x1000; - INT32 scrollx = (scroll[bank * 4 + 1] + ((scroll[bank * 4 + 0] & 0x01) << 8) + (bank ? 24 : 26)) & 0x1ff; - INT32 scrolly = (scroll[bank * 4 + 2] + 9) & 0xff; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 color = src[offs * 2 + 1]; - INT32 code = src[offs * 2 + 0] + ((color & 0x03) << 8) + bank * 0x400; - - if (prio) { - if (*flipscreen) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, 280 - sx, 216 - sy, color, 3, 7, 0, DrvGfxROM1); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 7, 0, DrvGfxROM1); - } - } else { - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, 280 - sx, 216 - sy, color, 3, 0, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM1); - } - } - } -} - -static void draw_sprites(INT32 prio) -{ - UINT8 *src = DrvSprRAM + 0x1800; - INT32 sprite_xoffs = src[0x07f5] - ((src[0x07f4] & 0x01) << 8); - INT32 sprite_yoffs = src[0x07f7]; - - for (INT32 offs = 0; offs < 0x800 - 16; offs += 16, src += 16) - { - INT32 priority = src[10] & 0x01; - - if (priority == prio) - { - INT32 attr1 = src[10]; - INT32 sprite = src[11] << 2; - INT32 color = src[12]; - INT32 sx = src[13] + ((color & 0x01) << 8) + sprite_xoffs; - INT32 attr2 = src[14]; - INT32 sy = (240 - src[15]) - sprite_yoffs; - INT32 flipx = (attr1 & 0x20) >> 5; - INT32 flipy = (attr2 & 0x01) >> 0; - INT32 sizex = (attr1 & 0x80) >> 7; - INT32 sizey = (attr2 & 0x04) >> 2; - - if ((attr1 & 0x10) && !sizex) sprite += 1; - if ((attr2 & 0x10) && !sizey) sprite += 2; - - sy -= 16 * sizey; - - if (*flipscreen) - { - sx = 499 - 16 * sizex - sx; - sy = 240 - 16 * sizey - sy; - flipx ^= 1; - flipy ^= 1; - } - - for (INT32 y = 0;y <= sizey;y++) - { - for (INT32 x = 0;x <= sizex;x++) - { - INT32 code = sprite + (y ^ (sizey * flipy)) * 2 + (x ^ (sizex * flipx)); - code &= 0x1ff; - - if (flipy) { - if(flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, -71 + ((sx + 16 * x) & 0x1ff), 1 + ((sy + 16 * y) & 0xff), color >> 1, 4, 0x0f, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, -71 + ((sx + 16 * x) & 0x1ff), 1 + ((sy + 16 * y) & 0xff), color >> 1, 4, 0x0f, 0, DrvGfxROM2); - } - } else { - if(flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, -71 + ((sx + 16 * x) & 0x1ff), 1 + ((sy + 16 * y) & 0xff), color >> 1, 4, 0x0f, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, -71 + ((sx + 16 * x) & 0x1ff), 1 + ((sy + 16 * y) & 0xff), color >> 1, 4, 0x0f, 0, DrvGfxROM2); - } - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - *flipscreen = DrvSprRAM[0x1ff6] & 0x01; - - BurnLEDSetFlipscreen(*flipscreen); - - INT32 priority = ((scroll[0] & 0x0e) == 0x0c) ? 1 : 0; - - draw_bg_layer(priority ^ 0, 0); - draw_sprites(0); - draw_bg_layer(priority ^ 1, 1); - draw_sprites(1); - - draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - BurnLEDRender(); - - return 0; -} - -static void DrvSpriteBuffer() -{ - if (buffer_sprites[0] == 0) return; - - for (INT32 i = 0; i < 0x800; i += 16) { - memcpy (DrvSprRAM + 0x180a + i, DrvSprRAM + 0x1804 + i, 6); - } - - buffer_sprites[0] = 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - watchdog++; - if (watchdog > 180) { - DrvDoReset(0); - } - - { - memset (DrvInputs, 0xff, 8); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[4] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[6] ^= (DrvJoy2[i] & 1) << i; - } - - DrvInputs[0] = ((DrvDips[0] & 0xf8) >> 3); - DrvInputs[1] = ((DrvDips[0] & 0x07) << 2) | ((DrvDips[1] & 0xc0) >> 6); - DrvInputs[2] = ((DrvDips[1] & 0x3e) >> 1); - DrvInputs[3] = (DrvDips[2] & 0x0f) | ((DrvDips[0] & 0x01) << 4); - - if (*coin_lockout) DrvInputs[4] |= 0x06; - } - - M6809NewFrame(); - HD63701NewFrame(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 1536000 / 60, 1536000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nNext; - - M6809Open(0); - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += M6809Run(nNext - nCyclesDone[0]); - if (i == (nInterleave - 1)) { - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - M6809Close(); - - // HD63701Open(0); - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += HD63701Run(nNext - nCyclesDone[1]); - if (i == (nInterleave - 1)) { - HD63701SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - // HD63701Close(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - } - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - DrvSpriteBuffer(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - HD63701Scan(nAction); - - NamcoSoundScan(nAction, pnMin); - - BurnLEDScan(nAction, pnMin); - } - - return 0; -} - - -// Alien Sector - -static struct BurnRomInfo aliensecRomDesc[] = { - { "bd1_3.9c", 0x2000, 0xea2ea790, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "bd2_1.9a", 0x4000, 0x9a0a9a87, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bd2_2.9b", 0x4000, 0x383e5458, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "bd1_4.3b", 0x4000, 0xabda0fe7, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "bd1_5.3j", 0x2000, 0x706b7fee, 3 | BRF_GRA }, // 5 Characters - - { "bd2_8.4p", 0x4000, 0x432bd7d9, 4 | BRF_GRA }, // 6 Background Tiles - { "bd1_7.4n", 0x4000, 0x0d7ebec9, 4 | BRF_GRA }, // 7 - { "bd2_6.4m", 0x4000, 0xf4c1df60, 4 | BRF_GRA }, // 8 - - { "bd1_9.8k", 0x4000, 0x87a29acc, 5 | BRF_GRA }, // 9 Sprites - { "bd1_10.8l", 0x4000, 0x72b6d20c, 5 | BRF_GRA }, // 10 - { "bd1_11.8m", 0x4000, 0x3076af9c, 5 | BRF_GRA }, // 11 - { "bd1_12.8n", 0x4000, 0x8b4c09a3, 5 | BRF_GRA }, // 12 - - { "bd1-1.1n", 0x0800, 0x0d78ebc6, 6 | BRF_GRA }, // 13 Color PROMs - { "bd1-2.2m", 0x0800, 0x03f7241f, 6 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(aliensec) -STD_ROM_FN(aliensec) - -static INT32 AlienInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvAliensec = { - "aliensec", NULL, NULL, NULL, "1985", - "Alien Sector\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, aliensecRomInfo, aliensecRomName, NULL, NULL, BaradukeInputInfo, BaradukeDIPInfo, - AlienInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Baraduke - -static struct BurnRomInfo baradukeRomDesc[] = { - { "bd1_3.9c", 0x2000, 0xea2ea790, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "bd1_1.9a", 0x4000, 0x4e9f2bdc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bd1_2.9b", 0x4000, 0x40617fcd, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "bd1_4b.3b", 0x4000, 0xa47ecd32, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "bd1_5.3j", 0x2000, 0x706b7fee, 3 | BRF_GRA }, // 5 Characters - - { "bd1_8.4p", 0x4000, 0xb0bb0710, 4 | BRF_GRA }, // 6 Background Tiles - { "bd1_7.4n", 0x4000, 0x0d7ebec9, 4 | BRF_GRA }, // 7 - { "bd1_6.4m", 0x4000, 0xe5da0896, 4 | BRF_GRA }, // 8 - - { "bd1_9.8k", 0x4000, 0x87a29acc, 5 | BRF_GRA }, // 9 Sprites - { "bd1_10.8l", 0x4000, 0x72b6d20c, 5 | BRF_GRA }, // 10 - { "bd1_11.8m", 0x4000, 0x3076af9c, 5 | BRF_GRA }, // 11 - { "bd1_12.8n", 0x4000, 0x8b4c09a3, 5 | BRF_GRA }, // 12 - - { "bd1-1.1n", 0x0800, 0x0d78ebc6, 6 | BRF_GRA }, // 13 Color PROMs - { "bd1-2.2m", 0x0800, 0x03f7241f, 6 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(baraduke) -STD_ROM_FN(baraduke) - -struct BurnDriver BurnDrvBaraduke = { - "baraduke", "aliensec", NULL, NULL, "1985", - "Baraduke\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, baradukeRomInfo, baradukeRomName, NULL, NULL, BaradukeInputInfo, BaradukeDIPInfo, - AlienInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Metro-Cross (set 1) - -static struct BurnRomInfo metrocrsRomDesc[] = { - { "mc1-3.9c", 0x2000, 0x3390b33c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "mc1-1.9a", 0x4000, 0x10b0977e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mc1-2.9b", 0x4000, 0x5c846f35, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "mc1-4.3b", 0x2000, 0x9c88f898, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "mc1-5.3j", 0x2000, 0x9b5ea33a, 3 | BRF_GRA }, // 5 Characters - - { "mc1-7.4p", 0x4000, 0xc9dfa003, 4 | BRF_GRA }, // 6 Background Tiles - { "mc1-6.4n", 0x4000, 0x9686dc3c, 4 | BRF_GRA }, // 7 - - { "mc1-8.8k", 0x4000, 0x265b31fa, 5 | BRF_GRA }, // 8 Sprites - { "mc1-9.8l", 0x4000, 0x541ec029, 5 | BRF_GRA }, // 9 - - { "mc1-1.1n", 0x0800, 0x32a78a8b, 6 | BRF_GRA }, // 10 Color PROMs - { "mc1-2.2m", 0x0800, 0x6f4dca7b, 6 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(metrocrs) -STD_ROM_FN(metrocrs) - -static INT32 MetroInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvMetrocrs = { - "metrocrs", NULL, NULL, NULL, "1985", - "Metro-Cross (set 1)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, metrocrsRomInfo, metrocrsRomName, NULL, NULL, BaradukeInputInfo, MetrocrsDIPInfo, - MetroInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; - - -// Metro-Cross (set 2) - -static struct BurnRomInfo metrocrsaRomDesc[] = { - { "mc2-3.9b", 0x2000, 0xffe08075, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "mc2-1.9a", 0x4000, 0x05a239ea, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mc2-2.9a", 0x4000, 0xdb9b0e6d, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "mc1-4.3b", 0x2000, 0x9c88f898, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "mc1-5.3j", 0x2000, 0x9b5ea33a, 3 | BRF_GRA }, // 5 Characters - - { "mc1-7.4p", 0x4000, 0xc9dfa003, 4 | BRF_GRA }, // 6 Background Tiles - { "mc1-6.4n", 0x4000, 0x9686dc3c, 4 | BRF_GRA }, // 7 - - { "mc1-8.8k", 0x4000, 0x265b31fa, 5 | BRF_GRA }, // 8 Sprites - { "mc1-9.8l", 0x4000, 0x541ec029, 5 | BRF_GRA }, // 9 - - { "mc1-1.1n", 0x0800, 0x32a78a8b, 6 | BRF_GRA }, // 10 Color PROMs - { "mc1-2.2m", 0x0800, 0x6f4dca7b, 6 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(metrocrsa) -STD_ROM_FN(metrocrsa) - -struct BurnDriver BurnDrvMetrocrsa = { - "metrocrsa", "metrocrs", NULL, NULL, "1985", - "Metro-Cross (set 2)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, metrocrsaRomInfo, metrocrsaRomName, NULL, NULL, BaradukeInputInfo, MetrocrsDIPInfo, - MetroInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_battlane.cpp b/jan/src/burn/drv/pre90s/d_battlane.cpp deleted file mode 100644 index e740e9ca5..000000000 --- a/jan/src/burn/drv/pre90s/d_battlane.cpp +++ /dev/null @@ -1,711 +0,0 @@ -// FB Alpha Battle Lane driver module -// Based on MAME driver by Paul Leaman (paul@vortexcomputing.demon.co.uk) - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "burn_ym3526.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvShareRAM; -static UINT8 *DrvTileRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvBmpRAM; -static UINT8 *bgbitmap; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvInputs[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static UINT16 scrollx; -static UINT8 scrollxhi; -static UINT16 scrolly; -static UINT8 scrollyhi; -static UINT8 flipscreen; -static UINT8 cpu_ctrl; -static UINT8 video_ctrl; -static UINT8 vblank; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x12, 0xff, 0xff, 0xdf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x0c, 0x00, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x20, 0x00, "Upright" }, - {0x12, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0xc0, 0xc0, "Easy" }, - {0x12, 0x01, 0xc0, 0x80, "Normal" }, - {0x12, 0x01, 0xc0, 0x40, "Hard" }, - {0x12, 0x01, 0xc0, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "Free Play" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x0c, "20k and 50k" }, - {0x13, 0x01, 0x0c, 0x08, "20k and 70k" }, - {0x13, 0x01, 0x0c, 0x04, "20k and 90k" }, - {0x13, 0x01, 0x0c, 0x00, "None" }, -}; - -STDDIPINFO(Drv) - -static void bitmap_w(UINT16 offset, UINT8 data) -{ - INT32 i, orval; - - orval = (~video_ctrl >> 1) & 0x07; - - if (!orval) - orval = 7; - - for (i = 0; i < 8; i++) - { - INT32 y = offset % 0x100; - INT32 x = (offset / 0x100) * 8 + i; - - if (data & 1 << i) - { - bgbitmap[(y * 256) + x] |= orval; - } - else - { - bgbitmap[(y * 256) + x] &= ~orval; - } - } -} - - -static void battlane_write(UINT16 address, UINT8 data) -{ - if (address >= 0x2000 && address <= 0x3fff) { - bitmap_w(address - 0x2000, data); - return; - } - - switch (address) - { - case 0x1c00: - video_ctrl = data; - scrollxhi = data & 0x01; - return; - - case 0x1c01: - scrollx = data | (scrollxhi << 8); - return; - - case 0x1c02: - scrolly = data | (scrollyhi << 8); - return; - - case 0x1c03: - { - cpu_ctrl = data; - scrollyhi = data & 0x01; - flipscreen = data & 0x80; - - UINT8 activecpu = M6809GetActive(); - - M6809Close(); - M6809Open(0); - M6809SetIRQLine(0, (data & 0x04) ? CPU_IRQSTATUS_NONE : CPU_IRQSTATUS_ACK); - M6809Close(); - - M6809Open(1); - M6809SetIRQLine(0, (data & 0x02) ? CPU_IRQSTATUS_NONE : CPU_IRQSTATUS_ACK); - M6809Close(); - M6809Open(activecpu); - } - return; - - case 0x1c04: - case 0x1c05: - BurnYM3526Write(address & 1, data); - return; - } -} - -static UINT8 battlane_read(UINT16 address) -{ - switch (address) - { - case 0x1c00: - return DrvInputs[0]; - - case 0x1c01: - return (DrvInputs[1] & 0x7f) | ((vblank) ? 0x80 : 0); - - case 0x1c02: - return DrvDips[0]; - - case 0x1c03: - return (DrvDips[1] & 0xf) | (DrvInputs[2] & 0xf0); - - case 0x1c04: - case 0x1c05: - return BurnYM3526Read(address & 1); - } - - return 0; -} - -inline static void DrvYM3526IRQHandler(INT32, INT32 nStatus) -{ - M6809SetIRQLine(1/*FIRQ*/, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static INT32 DrvYM3526SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / 1500000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - BurnYM3526Reset(); - M6809Close(); - - scrollx = 0; - scrollxhi = 0; - scrolly = 0; - scrollyhi = 0; - flipscreen = 0; - cpu_ctrl = 0; - video_ctrl = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x010000; - DrvM6809ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x0040 * sizeof(UINT32); - - AllRam = Next; - - DrvShareRAM = Next; Next += 0x001000; - DrvTileRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000100; - DrvSprRAM = Next; Next += 0x000100; - DrvBmpRAM = Next; Next += 0x002000; - - bgbitmap = (UINT8*)Next; Next += 256 * 256 * sizeof(UINT8); // background bitmap (RAM section) - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Planes0[3] = { 0x8000 * 8 * 0 + 0, 0x8000 * 8 * 1 + 0, 0x8000 * 8 * 2 + 0 }; - INT32 Planes1[3] = { 0x4000 * 8 * 2 + 4, 0x4000 * 8 * 0 + 4, 0x4000 * 8 * 0 + 0 }; - INT32 Planes2[3] = { 0x4000 * 8 * 2 + 0, 0x4000 * 8 * 1 + 4, 0x4000 * 8 * 1 + 0 }; - INT32 XOffs0[16] = { STEP8(7,-1), STEP8(128+7,-1) }; - INT32 YOffs0[16] = { STEP16(128 - 8, -8) }; - INT32 XOffs1[16] = { STEP4(3,-1), STEP4(8+3,-1), STEP4(16+3,-1), STEP4(24+3,-1) }; - INT32 YOffs1[16] = { STEP16(0,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x18000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x18000); - - GfxDecode(0x0400, 3, 16, 16, Planes0, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x0c000); - - GfxDecode(0x0100, 3, 16, 16, Planes1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM1 + 0x00000); - GfxDecode(0x0100, 3, 16, 16, Planes2, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM1 + 0x10000); - - BurnFree(tmp); - - return 0; -} - -static void DrvCpuMap(INT32 cpu) -{ - UINT8 *rom = (cpu) ? DrvM6809ROM1 : DrvM6809ROM0; - - M6809Open(cpu); - M6809MapMemory(DrvShareRAM, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvTileRAM, 0x1000, 0x17ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1800, 0x18ff, MAP_RAM); - M6809MapMemory(DrvPalRAM, 0x1e00, 0x1e3f|0xff, MAP_RAM); - //M6809MapMemory(DrvBmpRAM, 0x2000, 0x3fff, MAP_RAM); - M6809MapMemory(rom + 0x4000, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(battlane_write); - M6809SetReadHandler(battlane_read); - M6809Close(); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM1 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM1 + 0x08000, 2, 1)) return 1; - memcpy (DrvM6809ROM0 + 0x4000, DrvM6809ROM1 + 0x0000, 0x4000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 7, 1)) return 1; - - DrvGfxDecode(); - } - - M6809Init(2); - DrvCpuMap(0); - DrvCpuMap(1); - - BurnYM3526Init(3000000, DrvYM3526IRQHandler, &DrvYM3526SynchroniseStream, 0); - BurnTimerAttachM6809YM3526(1500000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - BurnYM3526Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteUpdate(INT32 offset) -{ - INT32 d = DrvPalRAM[offset]; - - INT32 b0 = (~d >> 0) & 0x01; - INT32 b1 = (~d >> 1) & 0x01; - INT32 b2 = (~d >> 2) & 0x01; - INT32 r = 0x21 * b0 + 0x47 * b1 + 0x97 * b2; - - b0 = (~d >> 3) & 0x01; - b1 = (~d >> 4) & 0x01; - b2 = (~d >> 5) & 0x01; - INT32 g = 0x21 * b0 + 0x47 * b1 + 0x97 * b2; - - b0 = (~video_ctrl >> 7) & 0x01; - b1 = (~d >> 6) & 0x01; - b2 = (~d >> 7) & 0x01; - INT32 b = 0x21 * b0 + 0x47 * b1 + 0x97 * b2; - - DrvPalette[offset] = BurnHighCol(r,g,b,0); -} - -static void draw_bmp_layer() -{ - INT32 x, y, data; - - for (y = 0; y < 32 * 8; y++) - { - for (x = 0; x < 32 * 8; x++) - { - data = bgbitmap[(y * 256) + x]; - - if (data) - { - INT32 sx = x; - INT32 sy = y; - if (flipscreen) { - sy = 255 - y; - sx = 255 - x; - } - - UINT16 *dst = pTransDraw + (sy * nScreenWidth) + sx; - *dst = data; - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - INT32 attr = DrvSprRAM[offs + 1]; - //INT32 code = DrvSprRAM[offs + 3] + ((attr & 0x60) << 3); - INT32 code = DrvSprRAM[offs + 3]; - code += 256 * ((attr >> 6) & 0x02); - code += 256 * ((attr >> 5) & 0x01); - - - if (attr & 0x01) - { - INT32 color = (attr >> 3) & 0x01; - - INT32 sx = DrvSprRAM[offs + 2] + 8; - INT32 sy = DrvSprRAM[offs]; - - INT32 flipx = attr & 0x04; - INT32 flipy = attr & 0x02; - - if (!flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } - } - - if (attr & 0x10) - { - INT32 dy = flipy ? 16 : -16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code+1, sx, sy+dy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code+1, sx, sy+dy, color, 3, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code+1, sx, sy+dy, color, 3, 0, 0, DrvGfxROM0); - - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code+1, sx, sy+dy, color, 3, 0, 0, DrvGfxROM0); - } - } - } - } - } -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 16; - INT32 sy = (offs / 0x20) * 16; - - sx -= (scrollx + 8) & 0x1ff; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 ofst = ((offs & 0x1e0)>>1) + (offs & 0x20f) + ((offs & 0x10)<<4); - - INT32 attr = DrvTileRAM[ofst + 0x400]; - INT32 code = DrvTileRAM[ofst + 0x000] + ((attr & 0x01) << 8); - INT32 color = (attr >> 1) & 3; - - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0x20, DrvGfxROM1); - } -} - -static INT32 DrvDraw() -{ - for (INT32 i = 0; i < 0x40; i++) { - DrvPaletteUpdate(i); - } - BurnTransferClear(); - - if (nBurnLayer & 1) draw_bg_layer(); - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 4) draw_bmp_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) DrvDoReset(); - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 1500000 / 60, 1500000 / 60 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[0] / nInterleave)); - if (i == 240 && (~cpu_ctrl & 0x08)) M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - M6809Close(); - - M6809Open(1); - M6809Run(nCyclesTotal[1] / nInterleave); - if (i == 240 && (~cpu_ctrl & 0x08)) M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - M6809Close(); - - if (i == 240) vblank = 1; - } - - M6809Open(0); - - BurnTimerEndFrameYM3526(nCyclesTotal[0]); - - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - BurnYM3526Scan(nAction, pnMin); - - SCAN_VAR(scrollx); - SCAN_VAR(scrollxhi); - SCAN_VAR(scrolly); - SCAN_VAR(scrollyhi); - SCAN_VAR(flipscreen); - SCAN_VAR(cpu_ctrl); - SCAN_VAR(video_ctrl); - } - - return 0; -} - - -// Battle Lane! Vol. 5 (set 1) - -static struct BurnRomInfo battlaneRomDesc[] = { - { "da00-5", 0x8000, 0x85b4ed73, 0 | BRF_PRG | BRF_ESS }, // 0 M6809 Shared Code - - { "da01-5", 0x8000, 0x7a6c3f02, 1 | BRF_PRG | BRF_ESS }, // 1 M6809 0 Code - - { "da02-2", 0x8000, 0x69d8dafe, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 1 Code - - { "da05", 0x8000, 0x834829d4, 3 | BRF_GRA }, // 3 Sprite Tiles - { "da04", 0x8000, 0xf083fd4c, 3 | BRF_GRA }, // 4 - { "da03", 0x8000, 0xcf187f25, 3 | BRF_GRA }, // 5 - - { "da06", 0x8000, 0x9c6a51b3, 4 | BRF_GRA }, // 6 Background Tiles - { "da07", 0x4000, 0x56df4077, 4 | BRF_GRA }, // 7 - - { "82s123.7h", 0x0020, 0xb9933663, 5 | BRF_OPT }, // 8 PROMs (unused) - { "82s123.9n", 0x0020, 0x06491e53, 5 | BRF_OPT }, // 9 -}; - -STD_ROM_PICK(battlane) -STD_ROM_FN(battlane) - -struct BurnDriver BurnDrvBattlane = { - "battlane", NULL, NULL, NULL, "1986", - "Battle Lane! Vol. 5 (set 1)\0", NULL, "Technos Japan (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, battlaneRomInfo, battlaneRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 256, 3, 4 -}; - - -// Battle Lane! Vol. 5 (set 2) - -static struct BurnRomInfo battlane2RomDesc[] = { - { "da00-3", 0x8000, 0x7a0a5d58, 0 | BRF_PRG | BRF_ESS }, // 0 M6809 Shared Code - - { "da01-3", 0x8000, 0xd9e40800, 1 | BRF_PRG | BRF_ESS }, // 1 M6809 0 Code - - { "da02-2", 0x8000, 0x69d8dafe, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 1 Code - - { "da05", 0x8000, 0x834829d4, 3 | BRF_GRA }, // 3 Sprite Tiles - { "da04", 0x8000, 0xf083fd4c, 3 | BRF_GRA }, // 4 - { "da03", 0x8000, 0xcf187f25, 3 | BRF_GRA }, // 5 - - { "da06", 0x8000, 0x9c6a51b3, 4 | BRF_GRA }, // 6 Background Tiles - { "da07", 0x4000, 0x56df4077, 4 | BRF_GRA }, // 7 - - { "82s123.7h", 0x0020, 0xb9933663, 5 | BRF_OPT }, // 8 PROMs (unused) - { "82s123.9n", 0x0020, 0x06491e53, 5 | BRF_OPT }, // 9 -}; - -STD_ROM_PICK(battlane2) -STD_ROM_FN(battlane2) - -struct BurnDriver BurnDrvBattlane2 = { - "battlane2", "battlane", NULL, NULL, "1986", - "Battle Lane! Vol. 5 (set 2)\0", NULL, "Technos Japan (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, battlane2RomInfo, battlane2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 256, 3, 4 -}; - - -// Battle Lane! Vol. 5 (set 3) - -static struct BurnRomInfo battlane3RomDesc[] = { - { "bl_04.rom", 0x8000, 0x5681564c, 0 | BRF_PRG | BRF_ESS }, // 0 M6809 Shared Code - - { "bl_05.rom", 0x8000, 0x001c4bbe, 1 | BRF_PRG | BRF_ESS }, // 1 M6809 0 Code - - { "da02-2", 0x8000, 0x69d8dafe, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 1 Code - - { "da05", 0x8000, 0x834829d4, 3 | BRF_GRA }, // 3 Sprite Tiles - { "da04", 0x8000, 0xf083fd4c, 3 | BRF_GRA }, // 4 - { "da03", 0x8000, 0xcf187f25, 3 | BRF_GRA }, // 5 - - { "da06", 0x8000, 0x9c6a51b3, 4 | BRF_GRA }, // 6 Background Tiles - { "da07", 0x4000, 0x56df4077, 4 | BRF_GRA }, // 7 - - { "82s123.7h", 0x0020, 0xb9933663, 5 | BRF_OPT }, // 8 PROMs (unused) - { "82s123.9n", 0x0020, 0x06491e53, 5 | BRF_OPT }, // 9 -}; - -STD_ROM_PICK(battlane3) -STD_ROM_FN(battlane3) - -struct BurnDriver BurnDrvBattlane3 = { - "battlane3", "battlane", NULL, NULL, "1986", - "Battle Lane! Vol. 5 (set 3)\0", NULL, "Technos Japan (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, battlane3RomInfo, battlane3RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_battlex.cpp b/jan/src/burn/drv/pre90s/d_battlex.cpp deleted file mode 100644 index 3534ff6f7..000000000 --- a/jan/src/burn/drv/pre90s/d_battlex.cpp +++ /dev/null @@ -1,717 +0,0 @@ -// FB Alpha Battle Cross / Dodge Man driver module -// Based on MAME driver by David Haywood - -// Notes: -// Dodge Man tiles and colors are really like that (bad rom data?) -// -// Todo: -// Palette in handler, update as data comes in instead of every frame. - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; - -static UINT8 *tmpbitmap; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 flipscreen; -static UINT8 scroll[2]; -static UINT8 previous_irq_flip; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo BattlexInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 7, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Battlex) - -static struct BurnInputInfo DodgemanInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 7, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dodgeman) - -static struct BurnDIPInfo BattlexDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xac, NULL }, - {0x10, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x03, 0x03, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0f, 0x01, 0x04, 0x00, "No" }, - {0x0f, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x20, 0x20, "Upright" }, - {0x0f, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 0, "Coin B" }, - {0x10, 0x01, 0x07, 0x07, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x05, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x07, 0x06, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x07, 0x04, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 8, "Lives" }, - {0x10, 0x01, 0x18, 0x00, "1" }, - {0x10, 0x01, 0x18, 0x08, "2" }, - {0x10, 0x01, 0x18, 0x10, "3" }, - {0x10, 0x01, 0x18, 0x18, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x60, 0x00, "5000" }, - {0x10, 0x01, 0x60, 0x20, "10000" }, - {0x10, 0x01, 0x60, 0x40, "15000" }, - {0x10, 0x01, 0x60, 0x60, "20000" }, - - {0 , 0xfe, 0 , 4, "Free Play" }, - {0x10, 0x01, 0x80, 0x00, "Off" }, - {0x10, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Battlex) - -static struct BurnDIPInfo DodgemanDIPList[]= -{ - {0x11, 0xff, 0xff, 0xac, NULL }, - {0x12, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x03, 0x03, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x04, 0x00, "No" }, - {0x11, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x20, 0x20, "Upright" }, - {0x11, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 0, "Coin B" }, - {0x12, 0x01, 0x07, 0x07, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x05, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 8, "Lives" }, - {0x12, 0x01, 0x18, 0x00, "1" }, - {0x12, 0x01, 0x18, 0x08, "2" }, - {0x12, 0x01, 0x18, 0x10, "3" }, - {0x12, 0x01, 0x18, 0x18, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x60, 0x00, "5000" }, - {0x12, 0x01, 0x60, 0x20, "10000" }, - {0x12, 0x01, 0x60, 0x40, "15000" }, - {0x12, 0x01, 0x60, 0x60, "20000" }, - - {0 , 0xfe, 0 , 4, "Free Play" }, - {0x12, 0x01, 0x80, 0x00, "Off" }, - {0x12, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Dodgeman) - -static void __fastcall battlex_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x10: - flipscreen = data & 0x80; - return; - - case 0x22: - case 0x23: - AY8910Write(0, ~port & 1, data); - return; - - case 0x30: - // starfield (not emulated) - return; - - case 0x32: - case 0x33: - scroll[port & 1] = data; - return; - - case 0x26: - case 0x27: - AY8910Write(1, ~port & 1, data); - return; - } -} - -static UINT8 __fastcall battlex_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: { - UINT8 ret = previous_irq_flip; - if (previous_irq_flip) { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - previous_irq_flip = 0; - } - return (DrvDips[0] & ~0x10) | (ret ? 0x10 : 0); - } - - case 0x01: - return DrvInputs[0]; // system - - case 0x02: - return DrvInputs[1]; // inputs - - case 0x03: - return DrvDips[1]; - } - - return 0; -} - -static tilemap_callback( battlex ) -{ - UINT16 code = DrvVidRAM[offs * 2] | (((DrvVidRAM[offs * 2 + 1] & 0x01)) << 8); - UINT8 color = (DrvVidRAM[offs * 2 + 1] & 0x0e) >> 1; - - TILE_SET_INFO(0, code, color, 0); -} - -static tilemap_callback( dodgeman ) -{ - UINT16 code = DrvVidRAM[offs * 2] | (((DrvVidRAM[offs * 2 + 1] & 0x03)) << 8); - UINT8 color = (DrvVidRAM[offs * 2 + 1] & 0x0c) >> 2; - - TILE_SET_INFO(0, code, color, 0); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - scroll[0] = scroll[1] = 0; - flipscreen = 0; - previous_irq_flip = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x006000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x0042 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000200; - DrvPalRAM = Next; Next += 0x000100; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - tmpbitmap = Next; Next += 256 * 224; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(INT32 select) -{ - INT32 size = (select) ? 0x6000 : 0x3000; - INT32 Plane0[3] = { RGN_FRAC(size, 0, 3), RGN_FRAC(size, 1, 3), RGN_FRAC(size, 2, 3) }; - INT32 Plane1[3] = { RGN_FRAC(size, 0, 3), RGN_FRAC(size, 1, 3), RGN_FRAC(size, 2, 3) }; - INT32 XOffs[16] = { STEP8(7,-1), STEP8(15,-1) }; - INT32 YOffs0[8] = { STEP8(0,8) }; - INT32 YOffs1[16] = { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x6000); - - GfxDecode(0x0400, 3, 8, 8, Plane0, XOffs, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x6000); - - GfxDecode(0x0080, 3, 16, 16, Plane1, XOffs, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static void DrvGfxExpand(INT32 len, INT32 game_select) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - - memcpy (tmp, DrvGfxROM0, 0x4000); - memset (DrvGfxROM0, 0, 0x10000); - - UINT8 *colormask = tmp; - UINT8 *gfxdata = tmp + ((game_select) ? 0x2000 : 0x1000); - UINT8 *dest = DrvGfxROM0; - INT32 tile_size = len / 24; - INT32 tile_shift = (tile_size / 512) + 11; - - for (INT32 tile = 0; tile < tile_size; tile++) - { - for (INT32 line = 0; line < 8; line ++) - { - for (INT32 bit = 0; bit < 8 ; bit ++) - { - INT32 color = colormask[tile << 3 | line]; - INT32 data = gfxdata[tile << 3 | line] >> bit & 1; - if (!data) color >>= 4; - - for (INT32 plane = 2; plane >= 0; plane--) - { - dest[tile << 3 | line | (plane << tile_shift)] |= (color & 1) << bit; - color >>= 1; - } - } - } - } - - BurnFree(tmp); -} - -static void init_stars() // hack -{ - UINT8 *dst = tmpbitmap; - - for (INT32 y = 0; y < 224; y++) - { - for (INT32 x = 0; x < 256; x++) - { - UINT16 z = rand() & 0x1ff; - - if (z==0xf6) dst[x] = 0x41; - } - - dst += 256; - } -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x3000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x5000, 5, 1)) return 1; - - if (select) { - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 8, 1)) return 1; - } else { - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 8, 1)) return 1; - } - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + ((select) ? 0x2000 : 0x1000), 10, 1)) return 1; - - DrvGfxExpand(((select) ? 0x6000 : 0x3000), select); - DrvGfxDecode(select); - if (select == 0) init_stars(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0x8000, 0x8fff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x9000, 0x91ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0xa000, 0xa3ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xe000, 0xe0ff, MAP_RAM); - ZetSetOutHandler(battlex_write_port); - ZetSetInHandler(battlex_read_port); - ZetClose(); - - AY8910Init(0, 1250000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1250000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, select ? dodgeman_map_callback : battlex_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 3, 8, 8, 0x10000, 0, 7); - GenericTilemapSetTransparent(0,0); - GenericTilemapSetOffsets(0, 0, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 0x40; i++) { - INT32 r = (DrvPalRAM[i] & 1) ? 0xff : 0; - INT32 g = (DrvPalRAM[i] & 4) ? 0xff : 0; - INT32 b = (DrvPalRAM[i] & 2) ? 0xff : 0; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } - - DrvPalette[0x40] = BurnHighCol(0xff, 0xff, 0xff, 0); - DrvPalette[0x41] = BurnHighCol(0x2c, 0x2c, 0x2c, 0); // stars! -} - -static void draw_sprites() -{ - for (INT32 i = 0; i < 0x200; i+=4) - { - INT32 sx =(DrvSprRAM[i] & 0x7f) * 2 - (DrvSprRAM[i] & 0x80) * 2; - INT32 sy = DrvSprRAM[i+3]; - INT32 code = DrvSprRAM[i+2] & 0x7f; - INT32 color = DrvSprRAM[i+1] & 0x07; - INT32 flipy = DrvSprRAM[i+1] & 0x80; - INT32 flipx = DrvSprRAM[i+1] & 0x40; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy-16, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy-16, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy-16, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy-16, color, 3, 0, 0, DrvGfxROM1); - } - } - } -} - -static void draw_stars() -{ - UINT8 *src = tmpbitmap; - UINT16 *dst = pTransDraw; - - for (INT32 y = 0; y < 224; y++) - { - for (INT32 x = 0; x < 256; x++) - { - dst[x] = src[x]; - } - - dst += 256; - src += 256; - } -} - -static INT32 DrvDraw() -{ - //if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; - //} - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_stars(); - - if (flipscreen) - GenericTilemapSetScrollX(0, scroll[0] | (scroll[1] << 3)); - else - GenericTilemapSetScrollX(0, scroll[0] | (scroll[1] << 8)); - - if (nBurnLayer & 2) GenericTilemapDraw(0, pTransDraw, 0); - - if (nSpriteEnable & 1) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 6; - INT32 nCyclesTotal = 2500000 / 60; - INT32 nCyclesDone = 0; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal / nInterleave; - - nCyclesDone += ZetRun(nSegment); - - previous_irq_flip = 1; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - SCAN_VAR(scroll); - SCAN_VAR(previous_irq_flip); - } - - return 0; -} - -// Battle Cross - -static struct BurnRomInfo battlexRomDesc[] = { - { "p-rom1.6", 0x1000, 0xb00ae551, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "p-rom2.5", 0x1000, 0xe765bb11, 1 | BRF_PRG | BRF_ESS }, // 1 - { "p-rom3.4", 0x1000, 0x21675a91, 1 | BRF_PRG | BRF_ESS }, // 2 - { "p-rom4.3", 0x1000, 0xfff1ccc4, 1 | BRF_PRG | BRF_ESS }, // 3 - { "p-rom5.2", 0x1000, 0xceb63d38, 1 | BRF_PRG | BRF_ESS }, // 4 - { "p-rom6.1", 0x1000, 0x6923f601, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "1a_f.6f", 0x1000, 0x2b69287a, 2 | BRF_GRA }, // 6 Sprites - { "1a_h.6h", 0x1000, 0x9f4c3bdd, 2 | BRF_GRA }, // 7 - { "1a_j.6j", 0x1000, 0xc1345b05, 2 | BRF_GRA }, // 8 - - { "1a_d.6d", 0x1000, 0x750a46ef, 3 | BRF_GRA }, // 9 Characters - { "1a_e.6e", 0x1000, 0x126842b7, 3 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(battlex) -STD_ROM_FN(battlex) - -static INT32 battlexInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvBattlex = { - "battlex", NULL, NULL, NULL, "1982", - "Battle Cross\0", NULL, "Omori Electric Co., Ltd.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, battlexRomInfo, battlexRomName, NULL, NULL, BattlexInputInfo, BattlexDIPInfo, - battlexInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x42, - 256, 224, 4, 3 -}; - - -// Dodge Man - -static struct BurnRomInfo dodgemanRomDesc[] = { - { "dg0.7f", 0x1000, 0x1219b5db, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "dg1.5f", 0x1000, 0xfff9a086, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dg2.4f", 0x1000, 0x2ca9ac99, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dg3.3f", 0x1000, 0x55a51c0e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "dg4.2f", 0x1000, 0x14169361, 1 | BRF_PRG | BRF_ESS }, // 4 - { "dg5.1f", 0x1000, 0x8f83ae2f, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "f.6f", 0x2000, 0xdfaaf4c8, 2 | BRF_GRA }, // 6 Sprites - { "h.6h", 0x2000, 0xe2525ffe, 2 | BRF_GRA }, // 7 - { "j.6j", 0x2000, 0x2731ee46, 2 | BRF_GRA }, // 8 - - { "d.6d", 0x2000, 0x451c1c3a, 3 | BRF_GRA }, // 9 Characters - { "e.6e", 0x2000, 0xc9a515df, 3 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(dodgeman) -STD_ROM_FN(dodgeman) - -static INT32 dodgemanInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvDodgeman = { - "dodgeman", NULL, NULL, NULL, "1983", - "Dodge Man\0", NULL, "Omori Electric Co., Ltd.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, dodgemanRomInfo, dodgemanRomName, NULL, NULL, DodgemanInputInfo, DodgemanDIPInfo, - dodgemanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_bbusters.cpp b/jan/src/burn/drv/pre90s/d_bbusters.cpp deleted file mode 100644 index 21c30afe3..000000000 --- a/jan/src/burn/drv/pre90s/d_bbusters.cpp +++ /dev/null @@ -1,1784 +0,0 @@ -// FB Alpha Beast Busters and Mechanized Attack driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2610.h" -#include "burn_ym2608.h" -#include "burn_gun.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvZoomTab; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvEeprom; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvPfRAM0; -static UINT8 *DrvPfRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPfScroll0; -static UINT8 *DrvPfScroll1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 sound_status; -static UINT8 soundlatch; -static UINT8 gun_select; -static INT32 LethalGun0 = 0; -static INT32 LethalGun1 = 0; -static INT32 LethalGun2 = 0; -static INT32 LethalGun3 = 0; -static INT32 LethalGun4 = 0; -static INT32 LethalGun5 = 0; - -static INT32 game_select = 0; // bbuster = 0, mechatt = 1 - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT16 DrvInputs[3]; -static UINT8 DrvReset; - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo BbustersInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - A("P1 Gun X", BIT_ANALOG_REL, &LethalGun0, "mouse x-axis" ), - A("P1 Gun Y", BIT_ANALOG_REL, &LethalGun1, "mouse y-axis" ), - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 fire 2" }, - A("P2 Gun X", BIT_ANALOG_REL, &LethalGun2, "p2 x-axis" ), - A("P2 Gun Y", BIT_ANALOG_REL, &LethalGun3, "p2 y-axis" ), - - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy2 + 0, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 1, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p3 fire 2" }, - A("P3 Gun X", BIT_ANALOG_REL, &LethalGun4, "p2 x-axis" ), - A("P3 Gun Y", BIT_ANALOG_REL,&LethalGun5, "p2 y-axis" ), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bbusters) - -static struct BurnInputInfo Bbusters2pInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - A("P1 Gun X", BIT_ANALOG_REL, &LethalGun0, "mouse x-axis" ), - A("P1 Gun Y", BIT_ANALOG_REL, &LethalGun1, "mouse y-axis" ), - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 fire 2" }, - A("P2 Gun X", BIT_ANALOG_REL, &LethalGun2, "p2 x-axis" ), - A("P2 Gun Y", BIT_ANALOG_REL, &LethalGun3, "p2 y-axis" ), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bbusters2p) - -static struct BurnInputInfo MechattInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 8, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 9, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 10, "p1 fire 2" }, - A("P1 Gun X", BIT_ANALOG_REL, &LethalGun0, "mouse x-axis" ), - A("P1 Gun Y", BIT_ANALOG_REL, &LethalGun1, "mouse y-axis" ), - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 12, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 2" }, - A("P2 Gun X", BIT_ANALOG_REL, &LethalGun2, "p2 x-axis" ), - A("P2 Gun Y", BIT_ANALOG_REL, &LethalGun3, "p2 y-axis" ), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Mechatt) -#undef A - -static struct BurnDIPInfo BbustersDIPList[]= -{ - {0x14, 0xff, 0xff, 0xf9, NULL }, - {0x15, 0xff, 0xff, 0x8f, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x01, 0x00, "No" }, - {0x14, 0x01, 0x01, 0x01, "Yes" }, - - {0 , 0xfe, 0 , 4, "Magazine / Grenade" }, - {0x14, 0x01, 0x06, 0x04, "5 / 2" }, - {0x14, 0x01, 0x06, 0x06, "7 / 3" }, - {0x14, 0x01, 0x06, 0x02, "9 / 4" }, - {0x14, 0x01, 0x06, 0x00, "12 / 5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x18, 0x00, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x18, 0x08, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x60, 0x60, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x60, 0x40, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x60, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x60, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x14, 0x01, 0x80, 0x80, "Common" }, - {0x14, 0x01, 0x80, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x15, 0x01, 0x0c, 0x08, "Demo Sounds Off" }, - {0x15, 0x01, 0x0c, 0x0c, "Demo Sounds On" }, - {0x15, 0x01, 0x0c, 0x04, "Infinite Energy (Cheat)" }, - {0x15, 0x01, 0x0c, 0x00, "Freeze" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Bbusters) - -static struct BurnDIPInfo Bbusters2pDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xf9, NULL }, - {0x0f, 0xff, 0xff, 0x8f, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0e, 0x01, 0x01, 0x00, "No" }, - {0x0e, 0x01, 0x01, 0x01, "Yes" }, - - {0 , 0xfe, 0 , 4, "Magazine / Grenade" }, - {0x0e, 0x01, 0x06, 0x04, "5 / 2" }, - {0x0e, 0x01, 0x06, 0x06, "7 / 3" }, - {0x0e, 0x01, 0x06, 0x02, "9 / 4" }, - {0x0e, 0x01, 0x06, 0x00, "12 / 5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0e, 0x01, 0x18, 0x00, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x18, 0x08, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0e, 0x01, 0x60, 0x60, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x60, 0x40, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x60, 0x20, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x60, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x0e, 0x01, 0x80, 0x80, "Common" }, - {0x0e, 0x01, 0x80, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0f, 0x01, 0x03, 0x02, "Easy" }, - {0x0f, 0x01, 0x03, 0x03, "Normal" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x0f, 0x01, 0x0c, 0x08, "Demo Sounds Off" }, - {0x0f, 0x01, 0x0c, 0x0c, "Demo Sounds On" }, - {0x0f, 0x01, 0x0c, 0x04, "Infinite Energy (Cheat)" }, - {0x0f, 0x01, 0x0c, 0x00, "Freeze" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Bbusters2p) - -static struct BurnDIPInfo MechattDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x0e, 0x01, 0x01, 0x01, "Common" }, - {0x0e, 0x01, 0x01, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0e, 0x01, 0x02, 0x00, "No" }, - {0x0e, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 4, "Magazine / Grenade" }, - {0x0e, 0x01, 0x0c, 0x08, "5 / 2" }, - {0x0e, 0x01, 0x0c, 0x0c, "6 / 3" }, - {0x0e, 0x01, 0x0c, 0x04, "7 / 4" }, - {0x0e, 0x01, 0x0c, 0x00, "8 / 5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0e, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0e, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0xc0, 0x00, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0f, 0x01, 0x03, 0x02, "Easy" }, - {0x0f, 0x01, 0x03, 0x03, "Normal" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x0f, 0x01, 0x0c, 0x08, "Demo Sounds Off" }, - {0x0f, 0x01, 0x0c, 0x0c, "Demo Sounds On" }, - {0x0f, 0x01, 0x0c, 0x04, "Infinite Energy (Cheat)" }, - {0x0f, 0x01, 0x0c, 0x00, "Freeze" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Mechatt) - -static struct BurnDIPInfo MechattuDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x0e, 0x01, 0x01, 0x01, "Common" }, - {0x0e, 0x01, 0x01, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0e, 0x01, 0x02, 0x00, "No" }, - {0x0e, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 4, "Magazine / Grenade" }, - {0x0e, 0x01, 0x0c, 0x08, "5 / 2" }, - {0x0e, 0x01, 0x0c, 0x0c, "6 / 3" }, - {0x0e, 0x01, 0x0c, 0x04, "7 / 4" }, - {0x0e, 0x01, 0x0c, 0x00, "8 / 5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0e, 0x01, 0x30, 0x00, "Free_Play" }, - {0x0e, 0x01, 0x30, 0x10, "1 Coin/2 Credits first, then 1 Coin/1 Credit" }, - {0x0e, 0x01, 0x30, 0x20, "2 Coins/1 Credit first, then 1 Coin/1 Credit" }, - {0x0e, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0e, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0xc0, 0x00, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0f, 0x01, 0x03, 0x02, "Easy" }, - {0x0f, 0x01, 0x03, 0x03, "Normal" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x0f, 0x01, 0x0c, 0x08, "Demo Sounds Off" }, - {0x0f, 0x01, 0x0c, 0x0c, "Demo Sounds On" }, - {0x0f, 0x01, 0x0c, 0x04, "Infinite Energy (Cheat)" }, - {0x0f, 0x01, 0x0c, 0x00, "Freeze" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Mechattu) - -static UINT16 control_3_r() -{ - UINT16 retdata = 0; - // Dink's method of maddness for dealing with the creepage AKA. the farther the crosshair - // goes in a + direction, the more it creeps away from the crosshair. - // NOTE: each gun needs different offsets _and_ has different creepage. odd? - if (gun_select >> 1 == 0) { - if (gun_select & 1) { // Player 1 - retdata = (BurnGunReturnX(gun_select >> 1) + 0xa0) + (BurnGunReturnX(gun_select >> 1) >> 4); - } else { - retdata = (BurnGunReturnY(gun_select >> 1) + 0x60+0x1a) - (BurnGunReturnY(gun_select >> 1) >> 2); - } - } else if (gun_select >> 1 == 1) { - if (gun_select & 1) { // Player 2 - retdata = (BurnGunReturnX(gun_select >> 1) + 0xa0-0x1a) - (BurnGunReturnX(gun_select >> 1) >> 3); - } else { - retdata = (BurnGunReturnY(gun_select >> 1) + 0x60) + (0x40 - (BurnGunReturnY(gun_select >> 1) >> 2)); - } - } else if (gun_select >> 1 == 2) { - if (gun_select & 1) { // Player 3 - retdata = (BurnGunReturnX(gun_select >> 1) + 0xa0-0x8) - (BurnGunReturnX(gun_select >> 1) >> 5); - } else { - retdata = (BurnGunReturnY(gun_select >> 1) + 0x60+0x1a) + (0x40 - (BurnGunReturnY(gun_select >> 1) >> 2)); - } - } - - return retdata >> 1; -} - -static UINT16 mechatt_gun_r(UINT16 offset) -{ - INT32 x = BurnGunReturnX((offset) ? 1 : 0) + 0x18; - INT32 y = BurnGunReturnY((offset) ? 1 : 0); - - //if (x > 0xff) x = 0xff; - if (y > 0xef) y = 0xef; - - return x | (y << 8); -} - -static UINT16 __fastcall bbusters_main_read_word(UINT32 address) -{ - if ((address & 0xffff00) == 0x0f8000) { - return (DrvEeprom[(address >> 1) & 0x7f] | (DrvEeprom[(address >> 1) & 0x7f] << 8)); - } - - switch (address) - { - case 0x0e0000: - return DrvInputs[2]; - - case 0x0e0002: - return DrvInputs[0]; - - case 0x0e0004: - return DrvInputs[1]; - - case 0x0e0008: - return DrvDips[0]; - - case 0x0e000a: - return DrvDips[1]; - - case 0x0e0018: - return sound_status; - - case 0x0e8000: - return 0; - - case 0x0e8002: - return control_3_r(); - } - - return 0; -} - -static UINT8 __fastcall bbusters_main_read_byte(UINT32 address) -{ - if ((address & 0xffff00) == 0x0f8000) { - return (DrvEeprom[(address >> 1) & 0x7f]); - } - - return 0; -} - -static void __fastcall bbusters_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffff00) == 0x0f8000) { - DrvEeprom[(address & 0xfe)>>1] = data; - return; - } - - switch (address) - { - case 0x0b8000: - case 0x0b8002: - *((UINT16*)(DrvPfScroll0 + (address & 2))) = data; - return; - - case 0x0b8008: - case 0x0b800a: - *((UINT16*)(DrvPfScroll1 + (address & 2))) = data; - return; - - case 0x0e8000: { - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - gun_select = data & 0xff; - } - return; - - case 0x0f0008: - // three_gun_output - return; - - case 0x0f0018: { - soundlatch = data; - ZetNmi(); - } - return; - } -} - -static void __fastcall bbusters_main_write_byte(UINT32 /*address*/, UINT8 /*data*/) -{ - //bprintf (0, _T("MWB: %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall mechatt_main_read_word(UINT32 address) -{ - //bprintf (0, _T("MRW: %5.5x\n"), address); - - switch (address) - { - case 0x0e0000: - return DrvInputs[0]; - - case 0x0e0002: - return DrvDips[0] | (DrvDips[1] << 8); - - case 0x0e0004: - case 0x0e0006: - return mechatt_gun_r(address - 0xe0004); - - case 0x0e8000: - return sound_status; - } - - return 0; -} - -static UINT8 __fastcall mechatt_main_read_byte(UINT32 /*address*/) -{ - //bprintf (0, _T("MRB: %5.5x\n"), address); - - return 0; -} - -static void __fastcall mechatt_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xf0000) == 0xa0000) return; // nop - - switch (address) - { - case 0x0b8000: - case 0x0b8002: - *((UINT16*)(DrvPfScroll0 + (address & 2))) = data; - return; - - case 0x0c8000: - case 0x0c8002: - *((UINT16*)(DrvPfScroll1 + (address & 2))) = data; - return; - - case 0x0e4002: - // two_gun_output - return; - - case 0x0e8000: { - soundlatch = data; - ZetNmi(); - } - return; - } -} - -static void __fastcall mechatt_main_write_byte(UINT32 /*address*/, UINT8 /*data*/) -{ - //bprintf (0, _T("MWB: %5.5x, %2.2x\n"), address, data); -} - -static void __fastcall bbusters_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf800: - sound_status = data; - return; - } -} - -static UINT8 __fastcall bbusters_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return soundlatch; - } - - return 0; -} - -static void __fastcall bbusters_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - if (game_select) { - BurnYM2608Write(port & 3, data); - } else { - BurnYM2610Write(port & 3, data); - } - return; - } -} - -static UINT8 __fastcall bbusters_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - if (game_select) { - return BurnYM2608Read(port & 2); - } else { - return BurnYM2610Read(port & 2); - } - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - // Sometimes loading a savestate needs to kick off an irq, but since this - // happens outside of DrvScan(), we have to handle opening of the cpu here. - INT32 fromFMPostLoad = (ZetGetActive() == -1); - - if (fromFMPostLoad) { - bprintf(0, _T("FM-PostLoad kicking irq!!! %X\n"), nStatus); - ZetOpen(0); - } - - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - - if (fromFMPostLoad) - ZetClose(); - -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - if (game_select) { - BurnYM2608Reset(); - } else { - BurnYM2610Reset(); - } - ZetClose(); - - HiscoreReset(); - - sound_status = 0; - soundlatch = 0; - gun_select = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROM2 = Next; Next += 0x400000; - DrvGfxROM3 = Next; Next += 0x100000; - DrvGfxROM4 = Next; Next += 0x100000; - - DrvZoomTab = Next; Next += 0x010000; - - DrvSndROM0 = Next; Next += 0x080000; - DrvSndROM1 = Next; Next += 0x080000; - - DrvEeprom = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvZ80RAM = Next; Next += 0x000800; - - DrvVidRAM = Next; Next += 0x001000; - DrvPfRAM0 = Next; Next += 0x004000; - DrvPfRAM1 = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x010000; - DrvSprBuf = Next; Next += 0x002000; - - DrvPfScroll0 = Next; Next += 0x000004; - DrvPfScroll1 = Next; Next += 0x000004; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Planes0[4] = { STEP4(0,1) }; - INT32 XOffs0[16] = { STEP8(0,4), STEP8(512, 4) }; - INT32 YOffs0[16] = { STEP16(0,32) }; - - INT32 Planes1[4] = { 8, 12, 0, 4 }; - INT32 XOffs1[16] = { STEP4(0,1), STEP4(16,1), STEP4(256,1), STEP4(272,1) }; - INT32 YOffs1[16] = { STEP8(0,32), STEP8(512,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x020000); - - GfxDecode(((0x020000/4)*8)/( 8 * 8), 4, 8, 8, Planes0, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(((0x200000/4)*8)/(16 * 16), 4, 16, 16, Planes1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x200000); - - GfxDecode(((0x200000/4)*8)/(16 * 16), 4, 16, 16, Planes1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x080000); - - GfxDecode(((0x080000/4)*8)/(16 * 16), 4, 16, 16, Planes0, XOffs0, YOffs0, 0x400, tmp, DrvGfxROM3); - - memcpy (tmp, DrvGfxROM4, 0x080000); - - GfxDecode(((0x080000/4)*8)/(16 * 16), 4, 16, 16, Planes0, XOffs0, YOffs0, 0x400, tmp, DrvGfxROM4); - - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - game_select = 0; - - BurnSetRefreshRate(56.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x180000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 15, 1)) return 1; - - if (BurnLoadRom(DrvZoomTab + 0x000000, 16, 1)) return 1; - // if (BurnLoadRom(DrvZoomTab + 0x000000, 17, 1)) return 1; - // if (BurnLoadRom(DrvZoomTab + 0x000000, 18, 1)) return 1; - // if (BurnLoadRom(DrvZoomTab + 0x000000, 19, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 20, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 21, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 22, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x08ffff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x090000, 0x090fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x0a0000, 0x0affff, MAP_RAM); - SekMapMemory(DrvPfRAM0, 0x0b0000, 0x0b1fff, MAP_RAM); - SekMapMemory(DrvPfRAM1, 0x0b2000, 0x0b5fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0d0000, 0x0d0fff, MAP_RAM); - SekSetWriteWordHandler(0, bbusters_main_write_word); - SekSetWriteByteHandler(0, bbusters_main_write_byte); - SekSetReadWordHandler(0, bbusters_main_read_word); - SekSetReadByteHandler(0, bbusters_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xefff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(bbusters_sound_write); - ZetSetReadHandler(bbusters_sound_read); - ZetSetOutHandler(bbusters_sound_write_port); - ZetSetInHandler(bbusters_sound_read_port); - ZetClose(); - - INT32 nSoundROMLen = 0x80000; - BurnYM2610Init(8000000, DrvSndROM0, &nSoundROMLen, DrvSndROM1, &nSoundROMLen, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 2.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 2.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - BurnGunInit(3, true); - - DrvDoReset(); - - return 0; -} - -static INT32 MechattInit() -{ - game_select = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 9, 1)) return 1; - - memset (DrvGfxROM2, 0xff, 0x200000); - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 12, 1)) return 1; - - if (BurnLoadRom(DrvZoomTab + 0x000000, 13, 1)) return 1; - // if (BurnLoadRom(DrvZoomTab + 0x000000, 14, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1, 0x80, 1)) return 1; // ym2608 rom - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x06ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x070000, 0x07ffff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x090000, 0x090fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x0a0000, 0x0a0fff, MAP_RAM); - SekMapMemory(DrvPfRAM0, 0x0b0000, 0x0b3fff, MAP_RAM); - SekMapMemory(DrvPfRAM1, 0x0c0000, 0x0c3fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0d0000, 0x0d07ff, MAP_RAM); - SekSetWriteWordHandler(0, mechatt_main_write_word); - SekSetWriteByteHandler(0, mechatt_main_write_byte); - SekSetReadWordHandler(0, mechatt_main_read_word); - SekSetReadByteHandler(0, mechatt_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xefff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(bbusters_sound_write); - ZetSetReadHandler(bbusters_sound_read); - ZetSetOutHandler(bbusters_sound_write_port); - ZetSetInHandler(bbusters_sound_read_port); - ZetClose(); - - INT32 nSndROMLen = 0x20000; - BurnYM2608Init(8000000, DrvSndROM0, &nSndROMLen, DrvSndROM1, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_1, 0.45, BURN_SND_ROUTE_BOTH); - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_2, 0.45, BURN_SND_ROUTE_BOTH); - BurnYM2608SetRoute(BURN_SND_YM2608_AY8910_ROUTE, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - BurnGunInit(3, true); - - DrvDoReset(); - - return 0; -} - -static INT32 MechattjInit() -{ - game_select = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140001, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180001, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c0000, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c0001, 21, 2)) return 1; - - memset (DrvGfxROM2, 0xff, 0x200000); - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x040000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x060000, 25, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 26, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x020000, 27, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x040000, 28, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x060000, 29, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 30, 1)) return 1; - - if (BurnLoadRom(DrvZoomTab + 0x000000, 31, 1)) return 1; - // if (BurnLoadRom(DrvZoomTab + 0x000000, 32, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1, 0x80, 1)) return 1; // ym2608 rom - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x06ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x070000, 0x07ffff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x090000, 0x090fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x0a0000, 0x0a0fff, MAP_RAM); - SekMapMemory(DrvPfRAM0, 0x0b0000, 0x0b3fff, MAP_RAM); - SekMapMemory(DrvPfRAM1, 0x0c0000, 0x0c3fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0d0000, 0x0d07ff, MAP_RAM); - SekSetWriteWordHandler(0, mechatt_main_write_word); - SekSetWriteByteHandler(0, mechatt_main_write_byte); - SekSetReadWordHandler(0, mechatt_main_read_word); - SekSetReadByteHandler(0, mechatt_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xefff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(bbusters_sound_write); - ZetSetReadHandler(bbusters_sound_read); - ZetSetOutHandler(bbusters_sound_write_port); - ZetSetInHandler(bbusters_sound_read_port); - ZetClose(); - - INT32 nSndROMLen = 0x20000; - BurnYM2608Init(8000000, DrvSndROM0, &nSndROMLen, DrvSndROM1, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_1, 0.45, BURN_SND_ROUTE_BOTH); - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_2, 0.45, BURN_SND_ROUTE_BOTH); - BurnYM2608SetRoute(BURN_SND_YM2608_AY8910_ROUTE, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - BurnGunInit(3, true); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - if (game_select) { - BurnYM2608Exit(); - } else { - BurnYM2610Exit(); - } - BurnGunExit(); - - BurnFree (AllMem); - - game_select = 0; - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT16 *ram = (UINT16*)DrvPalRAM; - - for (INT32 offs = 0; offs < BurnDrvGetPaletteEntries(); offs++) - { - INT32 r = ram[offs] >> 12; - INT32 g = (ram[offs] >> 8) & 0xf; - INT32 b = (ram[offs] >> 4) & 0xf; - - DrvPalette[offs] = BurnHighCol(r*16+r, g*16+g, b*16+b, 0); - } -} - -static void draw_text_layer() -{ - UINT16 *ram = (UINT16*)DrvVidRAM; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - Render8x8Tile_Mask_Clip(pTransDraw, ram[offs] & 0xfff, sx, sy - 16, ram[offs] >> 12, 4, 0xf, 0, DrvGfxROM0); - } -} - -static void draw_layer(UINT8 *rambase, UINT8 *gfx, INT32 color_offset, INT32 transp, UINT8 *scroll, INT32 wide) -{ - UINT16 *scr = (UINT16*)scroll; - UINT16 *ram = (UINT16*)rambase; - - INT32 width = (wide) ? 256 : 128; - - INT32 scrollx = scr[0] & ((width * 16)-1); - INT32 scrolly = (scr[1] + 16) & 0x1ff; - - for (INT32 offs = 0; offs < width * 32; offs++) - { - INT32 sx = (offs / 0x20) * 16; - INT32 sy = (offs & 0x1f) * 16; - - sx -= scrollx; - if (sx < -15) sx += width * 16; - sy -= scrolly; - if (sy < -15) sy += 0x200; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (transp) { - Render16x16Tile_Mask_Clip(pTransDraw, ram[offs] & 0xfff, sx, sy, ram[offs]>>12, 4, 0xf, color_offset, gfx); - } else { - Render16x16Tile_Clip(pTransDraw, ram[offs] & 0xfff, sx, sy, ram[offs]>>12, 4, color_offset, gfx); - } - } -} - -#define ADJUST_4x4 \ - if ((dx&0x10) && (dy&0x10)) code+=3; \ - else if (dy&0x10) code+=2; \ - else if (dx&0x10) code+=1 - -#define ADJUST_8x8 \ - if ((dx&0x20) && (dy&0x20)) code+=12; \ - else if (dy&0x20) code+=8; \ - else if (dx&0x20) code+=4 - -#define ADJUST_16x16 \ - if ((dx&0x40) && (dy&0x40)) code+=48; \ - else if (dy&0x40) code+=32; \ - else if (dx&0x40) code+=16 - -inline const UINT8 *get_source_ptr(UINT8 *gfx, UINT32 sprite, INT32 dx, INT32 dy, INT32 block) -{ - int code=0; - - switch (block) - { - case 0: - break; - - case 1: - ADJUST_4x4; - break; - - case 2: - ADJUST_4x4; - ADJUST_8x8; - break; - - case 3: - ADJUST_4x4; - ADJUST_8x8; - ADJUST_16x16; - break; - } - - return gfx + (((sprite + code) & 0x3fff) * 0x100) + ((dy & 0xf) * 0x10); -} - -static void draw_block(const UINT8 *scale_table_ptr,INT32 scale_line_count,INT32 x,INT32 y,INT32 size,INT32 flipx,INT32 flipy,UINT32 sprite,INT32 color,INT32 bank,INT32 block) -{ - UINT8 *gfx = (bank == 2) ? DrvGfxROM2 : DrvGfxROM1; - INT32 pen_base = ((bank == 2) ? 0x200 : 0x100) + ((color & 0xf) << 4); - UINT32 xinc=(scale_line_count * 0x10000 ) / size; - UINT8 pixel; - INT32 x_index; - INT32 dy=y; - INT32 sx, ex = scale_line_count; - - while (scale_line_count) { - if (dy>=16 && dy<240) { - UINT16 *destline = pTransDraw + (dy - 16) * nScreenWidth; - UINT8 srcline=*scale_table_ptr; - const UINT8 *srcptr=NULL; - - if (!flipy) - srcline=size-srcline-1; - - if (flipx) - x_index=(ex-1)*0x10000; - else - x_index=0; - - for (sx=0; sx>16)) & 0x1ff) < nScreenWidth) - destline[(x+(x_index>>16)) & 0x1ff]= pen_base + pixel; - - if (flipx) - x_index-=xinc; - else - x_index+=xinc; - } - } - - dy++; - scale_table_ptr--; - scale_line_count--; - } -} - -static void draw_sprites(UINT8 *source8, INT32 bank, INT32 colval, INT32 colmask) -{ - UINT16 *source = (UINT16*)source8; - const UINT8 *scale_table=DrvZoomTab; - - for (INT32 offs = 0; offs < 0x800; offs += 4) { - INT32 scale; - - INT32 sprite=source[offs+1]; - INT32 colour=source[offs+0]; - - if ((colour==0xf7 || colour==0xffff || colour == 0x43f9) && (sprite==0x3fff || sprite==0xffff || sprite==0x0001)) - continue; // sprite 1, color 0x43f9 is the dead sprite in the top-right of the screen in Mechanized Attack's High Score table. - - INT16 y=source[offs+3]; - INT32 x=source[offs+2]; - - if (x&0x200) x=-(0x100-(x&0xff)); - - if (y > 320 || y < -256) y &= 0x1ff; // fix for bbusters ending & "Zing!" attract-mode fullscreen zombie & Helicopter on the 3rd rotation of the attractmode sequence - - colour>>=12; - INT32 block=(source[offs+0]>>8)&0x3; - INT32 fy=source[offs+0]&0x400; - INT32 fx=source[offs+0]&0x800; - sprite&=0x3fff; - - if ((colour&colmask)!=colval) - continue; - - switch ((source[offs+0]>>8)&0x3) - { - case 0: { - scale=source[offs+0]&0x7; - const UINT8 *scale_table_ptr = scale_table+0x387f+(0x80*scale); - INT32 scale_line_count = 0x10-scale; - draw_block(scale_table_ptr,scale_line_count,x,y,16,fx,fy,sprite,colour,bank,block); - } - break; - case 1: { // 2 x 2 - scale=source[offs+0]&0xf; - const UINT8 *scale_table_ptr = scale_table+0x707f+(0x80*scale); - INT32 scale_line_count = 0x20-scale; - draw_block(scale_table_ptr,scale_line_count,x,y,32,fx,fy,sprite,colour,bank,block); - } - break; - case 2: { // 64 by 64 block (2 x 2) x 2 - scale=source[offs+0]&0x1f; - const UINT8 *scale_table_ptr = scale_table+0xa07f+(0x80*scale); - INT32 scale_line_count = 0x40-scale; - draw_block(scale_table_ptr,scale_line_count,x,y,64,fx,fy,sprite,colour,bank,block); - } - break; - case 3: { // 2 x 2 x 2 x 2 - scale=source[offs+0]&0x3f; - const UINT8 *scale_table_ptr = scale_table+0xc07f+(0x80*scale); - INT32 scale_line_count = 0x80-scale; - draw_block(scale_table_ptr,scale_line_count,x,y,128,fx,fy,sprite,colour,bank,block); - } - break; - } - } -} - -static INT32 BbustersDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(DrvPfRAM1, DrvGfxROM4, 0x500, 0, DrvPfScroll1, 0); - if (nBurnLayer & 2) draw_layer(DrvPfRAM0, DrvGfxROM3, 0x300, 1, DrvPfScroll0, 0); - if (nSpriteEnable & 1) draw_sprites(DrvSprBuf + 0x1000, 2, 0, 0); - if (nSpriteEnable & 2) draw_sprites(DrvSprBuf + 0x0000, 1, 0, 0); - if (nBurnLayer & 4) draw_text_layer(); - - BurnTransferCopy(DrvPalette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } - - return 0; -} - -static INT32 MechattDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(DrvPfRAM1, DrvGfxROM4, 0x300, 0, DrvPfScroll1, 1); - if (nBurnLayer & 2) draw_layer(DrvPfRAM0, DrvGfxROM3, 0x200, 1, DrvPfScroll0, 1); - if (nSpriteEnable & 2) draw_sprites(DrvSprBuf + 0x0000, 1, 0, 0); - if (nBurnLayer & 4) draw_text_layer(); - - BurnTransferCopy(DrvPalette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset(DrvInputs, 0xff, 3 * sizeof(INT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - BurnGunMakeInputs(0, (INT16)LethalGun0, (INT16)LethalGun1); - BurnGunMakeInputs(1, (INT16)LethalGun2, (INT16)LethalGun3); - BurnGunMakeInputs(2, (INT16)LethalGun4, (INT16)LethalGun5); - - } - - INT32 nInterleave = 30; - INT32 nCyclesTotal[2] = { 12000000 / 56, 4000000 / 56 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - SekRun(nCyclesTotal[0] / nInterleave); - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - SekSetIRQLine((game_select) ? 4 : 6, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - if (game_select) { - BurnYM2608Update(pBurnSoundOut, nBurnSoundLen); - } else { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf + 0x00000, DrvSprRAM + 0x00000, 0x01000); - memcpy (DrvSprBuf + 0x01000, DrvSprRAM + 0x08000, 0x01000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); - ZetScan(nAction); - BurnGunScan(); - - ZetOpen(0); - if (game_select) { - BurnYM2608Scan(nAction, pnMin); - } else { - BurnYM2610Scan(nAction, pnMin); - } - ZetClose(); - - SCAN_VAR(sound_status); - SCAN_VAR(soundlatch); - SCAN_VAR(gun_select); - - DrvRecalc = 1; - } - - return 0; -} - - -// Beast Busters (World) - -static struct BurnRomInfo bbustersRomDesc[] = { - { "bb-3.k10", 0x20000, 0x04da1820, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bb-5.k12", 0x20000, 0x777e0611, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bb-2.k8", 0x20000, 0x20141805, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bb-4.k11", 0x20000, 0xd482e0e9, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bb-1.e6", 0x10000, 0x4360f2ee, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "bb-10.l9", 0x20000, 0x490c0d9b, 3 | BRF_GRA }, // 5 Characters - - { "bb-f11.m16", 0x80000, 0x39fdf9c0, 4 | BRF_GRA }, // 6 Sprite Chip 0 - { "bb-f12.m13", 0x80000, 0x69ee046b, 4 | BRF_GRA }, // 7 - { "bb-f13.m12", 0x80000, 0xf5ef840e, 4 | BRF_GRA }, // 8 - { "bb-f14.m11", 0x80000, 0x1a7df3bb, 4 | BRF_GRA }, // 9 - - { "bb-f21.l10", 0x80000, 0x530f595b, 5 | BRF_GRA }, // 10 Sprite Chip 1 - { "bb-f22.l12", 0x80000, 0x889c562e, 5 | BRF_GRA }, // 11 - { "bb-f23.l13", 0x80000, 0xc89fe0da, 5 | BRF_GRA }, // 12 - { "bb-f24.l15", 0x80000, 0xe0d81359, 5 | BRF_GRA }, // 13 - - { "bb-back1.m4", 0x80000, 0xb5445313, 6 | BRF_GRA }, // 14 Background Tiles - - { "bb-back2.m6", 0x80000, 0x8be996f6, 7 | BRF_GRA }, // 15 Foreground Tiles - - { "bb-6.e7", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 16 Zoom Tables - { "bb-7.h7", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 17 - { "bb-8.a14", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 18 - { "bb-9.c14", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 19 - - { "bb-pcma.l5", 0x80000, 0x44cd5bfe, 9 | BRF_GRA }, // 20 YM2610 Samples - - { "bb-pcmb.l3", 0x80000, 0xc8d5dd53, 10 | BRF_GRA }, // 21 YM2610 Deltat Samples - - { "bbusters-eeprom.bin",0x00100, 0xa52ebd66, 11 | BRF_GRA }, // 22 EEPROM -}; - -STD_ROM_PICK(bbusters) -STD_ROM_FN(bbusters) - -struct BurnDriver BurnDrvBbusters = { - "bbusters", NULL, NULL, NULL, "1989", - "Beast Busters (World)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, bbustersRomInfo, bbustersRomName, NULL, NULL, BbustersInputInfo, BbustersDIPInfo, - DrvInit, DrvExit, DrvFrame, BbustersDraw, DrvScan, &DrvRecalc, 0x600, - 256, 224, 4, 3 -}; - -// Beast Busters (US, Version 3) - -static struct BurnRomInfo bbustersuRomDesc[] = { - { "bb-ver3-u3.k10", 0x20000, 0xc80ec3bc, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bb-ver3-u5.k12", 0x20000, 0x5ded86d1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bb-2.k8", 0x20000, 0x20141805, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bb-4.k11", 0x20000, 0xd482e0e9, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bb-1.e6", 0x10000, 0x4360f2ee, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "bb-10.l9", 0x20000, 0x490c0d9b, 3 | BRF_GRA }, // 5 Characters - - { "bb-f11.m16", 0x80000, 0x39fdf9c0, 4 | BRF_GRA }, // 6 Sprite Chip 0 - { "bb-f12.m13", 0x80000, 0x69ee046b, 4 | BRF_GRA }, // 7 - { "bb-f13.m12", 0x80000, 0xf5ef840e, 4 | BRF_GRA }, // 8 - { "bb-f14.m11", 0x80000, 0x1a7df3bb, 4 | BRF_GRA }, // 9 - - { "bb-f21.l10", 0x80000, 0x530f595b, 5 | BRF_GRA }, // 10 Sprite Chip 1 - { "bb-f22.l12", 0x80000, 0x889c562e, 5 | BRF_GRA }, // 11 - { "bb-f23.l13", 0x80000, 0xc89fe0da, 5 | BRF_GRA }, // 12 - { "bb-f24.l15", 0x80000, 0xe0d81359, 5 | BRF_GRA }, // 13 - - { "bb-back1.m4", 0x80000, 0xb5445313, 6 | BRF_GRA }, // 14 Background Tiles - - { "bb-back2.m6", 0x80000, 0x8be996f6, 7 | BRF_GRA }, // 15 Foreground Tiles - - { "bb-6.e7", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 16 Zoom Tables - { "bb-7.h7", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 17 - { "bb-8.a14", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 18 - { "bb-9.c14", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 19 - - { "bb-pcma.l5", 0x80000, 0x44cd5bfe, 9 | BRF_GRA }, // 20 YM2610 Samples - - { "bb-pcma.l5", 0x80000, 0x44cd5bfe, 10 | BRF_GRA }, // 21 YM2610 Deltat Samples - - { "bbusters-eeprom.bin",0x00100, 0xa52ebd66, 11 | BRF_GRA }, // 22 EEPROM -}; - -STD_ROM_PICK(bbustersu) -STD_ROM_FN(bbustersu) - -struct BurnDriver BurnDrvBbustersu = { - "bbustersu", "bbusters", NULL, NULL, "1989", - "Beast Busters (US, Version 3)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, bbustersuRomInfo, bbustersuRomName, NULL, NULL, BbustersInputInfo, BbustersDIPInfo, - DrvInit, DrvExit, DrvFrame, BbustersDraw, DrvScan, &DrvRecalc, 0x600, - 256, 224, 4, 3 -}; - -// Beast Busters (Japan, Version 2) - -static struct BurnRomInfo bbustersjRomDesc[] = { - { "bb3_ver2_j2.k10", 0x20000, 0x605eb62f, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bb5_ver2_j2.k12", 0x20000, 0x9deea26f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bb-2.k8", 0x20000, 0x20141805, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bb-4.k11", 0x20000, 0xd482e0e9, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bb-1.e6", 0x10000, 0x4360f2ee, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "bb-10.l9", 0x20000, 0x490c0d9b, 3 | BRF_GRA }, // 5 Characters - - { "bb-f11.m16", 0x80000, 0x39fdf9c0, 4 | BRF_GRA }, // 6 Sprite Chip 0 - { "bb-f12.m13", 0x80000, 0x69ee046b, 4 | BRF_GRA }, // 7 - { "bb-f13.m12", 0x80000, 0xf5ef840e, 4 | BRF_GRA }, // 8 - { "bb-f14.m11", 0x80000, 0x1a7df3bb, 4 | BRF_GRA }, // 9 - - { "bb-f21.l10", 0x80000, 0x530f595b, 5 | BRF_GRA }, // 10 Sprite Chip 1 - { "bb-f22.l12", 0x80000, 0x889c562e, 5 | BRF_GRA }, // 11 - { "bb-f23.l13", 0x80000, 0xc89fe0da, 5 | BRF_GRA }, // 12 - { "bb-f24.l15", 0x80000, 0xe0d81359, 5 | BRF_GRA }, // 13 - - { "bb-back1.m4", 0x80000, 0xb5445313, 6 | BRF_GRA }, // 14 Background Tiles - - { "bb-back2.m6", 0x80000, 0x8be996f6, 7 | BRF_GRA }, // 15 Foreground Tiles - - { "bb-6.e7", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 16 Zoom Tables - { "bb-7.h7", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 17 - { "bb-8.a14", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 18 - { "bb-9.c14", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 19 - - { "bb-pcma.l5", 0x80000, 0x44cd5bfe, 9 | BRF_GRA }, // 20 YM2610 Samples - - { "bb-pcmb.l3", 0x80000, 0xc8d5dd53, 10 | BRF_GRA }, // 21 YM2610 Deltat Samples - - { "bbusters-eeprom.bin",0x00100, 0xa52ebd66, 11 | BRF_GRA }, // 22 EEPROM -}; - -STD_ROM_PICK(bbustersj) -STD_ROM_FN(bbustersj) - -struct BurnDriver BurnDrvBbustersj = { - "bbustersj", "bbusters", NULL, NULL, "1989", - "Beast Busters (Japan, Version 2)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, bbustersjRomInfo, bbustersjRomName, NULL, NULL, Bbusters2pInputInfo, Bbusters2pDIPInfo, - DrvInit, DrvExit, DrvFrame, BbustersDraw, DrvScan, &DrvRecalc, 0x600, - 256, 224, 4, 3 -}; - -// Beast Busters (US, Version 2) - -static struct BurnRomInfo bbustersuaRomDesc[] = { - { "bb-ver2-u3.k10", 0x20000, 0x6930088b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bb-ver2-u5.k12", 0x20000, 0xcfdb2c6c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bb-2.k8", 0x20000, 0x20141805, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bb-4.k11", 0x20000, 0xd482e0e9, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bb-1.e6", 0x10000, 0x4360f2ee, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "bb-10.l9", 0x20000, 0x490c0d9b, 3 | BRF_GRA }, // 5 Characters - - { "bb-f11.m16", 0x80000, 0x39fdf9c0, 4 | BRF_GRA }, // 6 Sprite Chip 0 - { "bb-f12.m13", 0x80000, 0x69ee046b, 4 | BRF_GRA }, // 7 - { "bb-f13.m12", 0x80000, 0xf5ef840e, 4 | BRF_GRA }, // 8 - { "bb-f14.m11", 0x80000, 0x1a7df3bb, 4 | BRF_GRA }, // 9 - - { "bb-f21.l10", 0x80000, 0x530f595b, 5 | BRF_GRA }, // 10 Sprite Chip 1 - { "bb-f22.l12", 0x80000, 0x889c562e, 5 | BRF_GRA }, // 11 - { "bb-f23.l13", 0x80000, 0xc89fe0da, 5 | BRF_GRA }, // 12 - { "bb-f24.l15", 0x80000, 0xe0d81359, 5 | BRF_GRA }, // 13 - - { "bb-back1.m4", 0x80000, 0xb5445313, 6 | BRF_GRA }, // 14 Background Tiles - - { "bb-back2.m6", 0x80000, 0x8be996f6, 7 | BRF_GRA }, // 15 Foreground Tiles - - { "bb-6.e7", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 16 Zoom Tables - { "bb-7.h7", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 17 - { "bb-8.a14", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 18 - { "bb-9.c14", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 19 - - { "bb-pcma.l5", 0x80000, 0x44cd5bfe, 9 | BRF_GRA }, // 20 YM2610 Samples - - { "bb-pcma.l5", 0x80000, 0x44cd5bfe, 10 | BRF_GRA }, // 21 YM2610 Deltat Samples - - { "bbusters-eeprom.bin",0x00100, 0xa52ebd66, 11 | BRF_GRA }, // 22 EEPROM -}; - -STD_ROM_PICK(bbustersua) -STD_ROM_FN(bbustersua) - -struct BurnDriver BurnDrvBbustersua = { - "bbustersua", "bbusters", NULL, NULL, "1989", - "Beast Busters (US, Version 2)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, bbustersuaRomInfo, bbustersuaRomName, NULL, NULL, BbustersInputInfo, BbustersDIPInfo, - DrvInit, DrvExit, DrvFrame, BbustersDraw, DrvScan, &DrvRecalc, 0x600, - 256, 224, 4, 3 -}; - -// YM2608 ROM for Mechanized Attack -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; - -static struct BurnRomInfo Ym2608RomDesc[] = { -#if !defined (ROM_VERIFY) - { "ym2608_adpcm_rom.bin", 0x002000, 0x23c9e0d8, BRF_ESS | BRF_PRG | BRF_BIOS }, -#else - { "", 0x000000, 0x00000000, BRF_ESS | BRF_PRG | BRF_BIOS }, -#endif -}; - -// Mechanized Attack (World) - -static struct BurnRomInfo mechattRomDesc[] = { - { "ma5-e.n12", 0x20000, 0x9bbb852a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ma4.l12", 0x20000, 0x0d414918, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ma7.n13", 0x20000, 0x61d85e1b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ma6-f.l13", 0x20000, 0x4055fe8d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ma_3.e13", 0x10000, 0xc06cc8e1, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ma_1.l2", 0x10000, 0x24766917, 3 | BRF_GRA }, // 5 Characters - - { "mao89p13.bin", 0x80000, 0x8bcb16cf, 4 | BRF_GRA }, // 6 Sprites - { "ma189p15.bin", 0x80000, 0xb84d9658, 4 | BRF_GRA }, // 7 - { "ma289p17.bin", 0x80000, 0x6cbe08ac, 4 | BRF_GRA }, // 8 - { "ma389m15.bin", 0x80000, 0x34d4585e, 4 | BRF_GRA }, // 9 - - { "mab189a2.bin", 0x80000, 0xe1c8b4d0, 5 | BRF_GRA }, // 10 Background Tiles - - { "mab289c2.bin", 0x80000, 0x14f97ceb, 6 | BRF_GRA }, // 11 Foreground Tiles - - { "ma_2.d10", 0x20000, 0xea4cc30d, 7 | BRF_GRA }, // 12 YM2608 Samples - - { "ma_8.f10", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 13 Zoom Tables - { "ma_9.f12", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 14 -}; - -STDROMPICKEXT(mechatt, mechatt, Ym2608) -STD_ROM_FN(mechatt) - -struct BurnDriver BurnDrvMechatt = { - "mechatt", NULL, "ym2608", NULL, "1989", - "Mechanized Attack (World)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, mechattRomInfo, mechattRomName, NULL, NULL, MechattInputInfo, MechattDIPInfo, - MechattInit, DrvExit, DrvFrame, MechattDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - -// Mechanized Attack (Japan) - -static struct BurnRomInfo mechattjRomDesc[] = { - { "ma5j.n12", 0x20000, 0xe6bb5952, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ma4j.l12", 0x20000, 0xc78baa62, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ma7j.n13", 0x20000, 0x12a68fc2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ma6j.l13", 0x20000, 0x332b2f54, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ma_3.e13", 0x10000, 0xc06cc8e1, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ma_1.l2", 0x10000, 0x24766917, 3 | BRF_GRA }, // 5 Characters - - { "s_9.a1", 0x20000, 0x6e8e194c, 4 | BRF_GRA }, // 6 Sprites - { "s_1.b1", 0x20000, 0xfd9161ed, 4 | BRF_GRA }, // 7 - { "s_10.a2", 0x20000, 0xfad6a1ab, 4 | BRF_GRA }, // 8 - { "s_2.b2", 0x20000, 0x549056f0, 4 | BRF_GRA }, // 9 - { "s_11.a3", 0x20000, 0x3887a382, 4 | BRF_GRA }, // 10 - { "s_3.b3", 0x20000, 0xcb99f565, 4 | BRF_GRA }, // 11 - { "s_12.a4", 0x20000, 0x63417b49, 4 | BRF_GRA }, // 12 - { "s_4.b4", 0x20000, 0xd739d48a, 4 | BRF_GRA }, // 13 - { "s_13.a5", 0x20000, 0xeccd47b6, 4 | BRF_GRA }, // 14 - { "s_5.b5", 0x20000, 0xe15244da, 4 | BRF_GRA }, // 15 - { "s_14.a6", 0x20000, 0xbbbf0461, 4 | BRF_GRA }, // 16 - { "s_6.b6", 0x20000, 0x4ee89f75, 4 | BRF_GRA }, // 17 - { "s_15.a7", 0x20000, 0xcde29bad, 4 | BRF_GRA }, // 18 - { "s_7.b7", 0x20000, 0x065ed221, 4 | BRF_GRA }, // 19 - { "s_16.a8", 0x20000, 0x70f28040, 4 | BRF_GRA }, // 20 - { "s_8.b8", 0x20000, 0xa6f8574f, 4 | BRF_GRA }, // 21 - - { "s_21.b3", 0x20000, 0x701a0072, 5 | BRF_GRA }, // 22 Background Tiles - { "s_22.b4", 0x20000, 0x34e6225c, 5 | BRF_GRA }, // 23 - { "s_23.b5", 0x20000, 0x9a7399d3, 5 | BRF_GRA }, // 24 - { "s_24.b6", 0x20000, 0xf097459d, 5 | BRF_GRA }, // 25 - - { "s_17.a3", 0x20000, 0xcc47c4a3, 6 | BRF_GRA }, // 26 Foreground Tiles - { "s_18.a4", 0x20000, 0xa04377e8, 6 | BRF_GRA }, // 27 - { "s_19.a5", 0x20000, 0xb07f5289, 6 | BRF_GRA }, // 28 - { "s_20.a6", 0x20000, 0xa9bb4fa9, 6 | BRF_GRA }, // 29 - - { "ma_2.d10", 0x20000, 0xea4cc30d, 7 | BRF_GRA }, // 30 YM2608 Samples - - { "ma_8.f10", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 31 Zoom Tables - { "ma_9.f12", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 32 -}; - -STDROMPICKEXT(mechattj, mechattj, Ym2608) -STD_ROM_FN(mechattj) - -struct BurnDriver BurnDrvMechattj = { - "mechattj", "mechatt", "ym2608", NULL, "1989", - "Mechanized Attack (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, mechattjRomInfo, mechattjRomName, NULL, NULL, MechattInputInfo, MechattDIPInfo, - MechattjInit, DrvExit, DrvFrame, MechattDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - -// Mechanized Attack (US) - -static struct BurnRomInfo mechattuRomDesc[] = { - { "ma5u.n12", 0x20000, 0x485ea606, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ma4u.l12", 0x20000, 0x09fa31ec, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ma7u.n13", 0x20000, 0xf45b2c70, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ma6u.l13", 0x20000, 0xd5d68ce6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ma_3.e13", 0x10000, 0xc06cc8e1, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ma_1.l2", 0x10000, 0x24766917, 3 | BRF_GRA }, // 5 Characters - - { "mao89p13.bin", 0x80000, 0x8bcb16cf, 4 | BRF_GRA }, // 6 Sprites - { "ma189p15.bin", 0x80000, 0xb84d9658, 4 | BRF_GRA }, // 7 - { "ma289p17.bin", 0x80000, 0x6cbe08ac, 4 | BRF_GRA }, // 8 - { "ma389m15.bin", 0x80000, 0x34d4585e, 4 | BRF_GRA }, // 9 - - { "mab189a2.bin", 0x80000, 0xe1c8b4d0, 5 | BRF_GRA }, // 10 Background Tiles - - { "mab289c2.bin", 0x80000, 0x14f97ceb, 6 | BRF_GRA }, // 11 Foreground Tiles - - { "ma_2.d10", 0x20000, 0xea4cc30d, 7 | BRF_GRA }, // 12 YM2608 Samples - - { "ma_8.f10", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 13 Zoom Tables - { "ma_9.f12", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 14 -}; - -STDROMPICKEXT(mechattu, mechattu, Ym2608) -STD_ROM_FN(mechattu) - -struct BurnDriver BurnDrvMechattu = { - "mechattu", "mechatt", "ym2608", NULL, "1989", - "Mechanized Attack (US)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, mechattuRomInfo, mechattuRomName, NULL, NULL, MechattInputInfo, MechattuDIPInfo, - MechattInit, DrvExit, DrvFrame, MechattDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - -// Mechanized Attack (US, Version 1, Single Player) - -static struct BurnRomInfo mechattu1RomDesc[] = { - { "ma_ver1_5u.n12", 0x20000, 0xdcd2e971, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ma_ver1_4u.l12", 0x20000, 0x69c8a85b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ma7u.n13", 0x20000, 0xf45b2c70, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ma6u.l13", 0x20000, 0xd5d68ce6, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ma_3.e13", 0x10000, 0xc06cc8e1, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ma_1.l2", 0x10000, 0x24766917, 3 | BRF_GRA }, // 5 Characters - - { "s_9.a1", 0x20000, 0x6e8e194c, 4 | BRF_GRA }, // 6 Sprites - { "s_1.b1", 0x20000, 0xfd9161ed, 4 | BRF_GRA }, // 7 - { "s_10.a2", 0x20000, 0xfad6a1ab, 4 | BRF_GRA }, // 8 - { "s_2.b2", 0x20000, 0x549056f0, 4 | BRF_GRA }, // 9 - { "s_11.a3", 0x20000, 0x3887a382, 4 | BRF_GRA }, // 10 - { "s_3.b3", 0x20000, 0xcb99f565, 4 | BRF_GRA }, // 11 - { "s_12.a4", 0x20000, 0x63417b49, 4 | BRF_GRA }, // 12 - { "s_4.b4", 0x20000, 0xd739d48a, 4 | BRF_GRA }, // 13 - { "s_13.a5", 0x20000, 0xeccd47b6, 4 | BRF_GRA }, // 14 - { "s_5.b5", 0x20000, 0xe15244da, 4 | BRF_GRA }, // 15 - { "s_14.a6", 0x20000, 0xbbbf0461, 4 | BRF_GRA }, // 16 - { "s_6.b6", 0x20000, 0x4ee89f75, 4 | BRF_GRA }, // 17 - { "s_15.a7", 0x20000, 0xcde29bad, 4 | BRF_GRA }, // 18 - { "s_7.b7", 0x20000, 0x065ed221, 4 | BRF_GRA }, // 19 - { "s_16.a8", 0x20000, 0x70f28040, 4 | BRF_GRA }, // 20 - { "s_8.b8", 0x20000, 0xa6f8574f, 4 | BRF_GRA }, // 21 - - { "s_21.b3", 0x20000, 0x701a0072, 5 | BRF_GRA }, // 22 Background Tiles - { "s_22.b4", 0x20000, 0x34e6225c, 5 | BRF_GRA }, // 23 - { "s_23.b5", 0x20000, 0x9a7399d3, 5 | BRF_GRA }, // 24 - { "s_24.b6", 0x20000, 0xf097459d, 5 | BRF_GRA }, // 25 - - { "s_17.a3", 0x20000, 0xcc47c4a3, 6 | BRF_GRA }, // 26 Foreground Tiles - { "s_18.a4", 0x20000, 0xa04377e8, 6 | BRF_GRA }, // 27 - { "s_19.a5", 0x20000, 0xb07f5289, 6 | BRF_GRA }, // 28 - { "s_20.a6", 0x20000, 0xa9bb4fa9, 6 | BRF_GRA }, // 29 - - { "ma_2.d10", 0x20000, 0xea4cc30d, 7 | BRF_GRA }, // 30 YM2608 Samples - - { "ma_8.f10", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 31 Zoom Tables - { "ma_9.f12", 0x10000, 0x61f3de03, 8 | BRF_GRA }, // 32 -}; - -STDROMPICKEXT(mechattu1, mechattu1, Ym2608) -STD_ROM_FN(mechattu1) - -struct BurnDriver BurnDrvMechattu1 = { - "mechattu1", "mechatt", "ym2608", NULL, "1989", - "Mechanized Attack (US, Version 1, Single Player)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, mechattu1RomInfo, mechattu1RomName, NULL, NULL, MechattInputInfo, MechattuDIPInfo, - MechattjInit, DrvExit, DrvFrame, MechattDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_bionicc.cpp b/jan/src/burn/drv/pre90s/d_bionicc.cpp deleted file mode 100644 index 375d76329..000000000 --- a/jan/src/burn/drv/pre90s/d_bionicc.cpp +++ /dev/null @@ -1,1080 +0,0 @@ -// FB Alpha Bionic Commando driver module -// Based on MAME driver by Steven Frew, Phil Stroffolino, and Paul Leaman - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; -static UINT8 DrvDips[2]; - -static UINT8 *Mem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM0; -static UINT8 *DrvTextRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprBuf; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; - -static INT32 flipscreen; - -static INT32 fg_scroll_x; -static INT32 fg_scroll_y; -static INT32 bg_scroll_x; -static INT32 bg_scroll_y; - -static INT32 fg_enable; -static INT32 bg_enable; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 7, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 5, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p1 right" }, - {"P1 Down", BIT_DIGITAL , DrvJoy2 + 4, "p1 down", }, - {"P1 Up", BIT_DIGITAL , DrvJoy2 + 5, "p1 up", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 1, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 0, "p1 fire 2"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 4, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 2, "p2 right" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 4, "p2 down", }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 5, "p2 up", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 1, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 0, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8 , "Coin_A" }, - {0x11, 0x01, 0x07, 0x00, "4 Coins 1 Credit " }, - {0x11, 0x01, 0x07, 0x01, "3 Coins 1 Credit " }, - {0x11, 0x01, 0x07, 0x02, "2 Coins 1 Credit " }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credit " }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin_B" }, - {0x11, 0x01, 0x38, 0x00, "4 Coins 1 Credit " }, - {0x11, 0x01, 0x38, 0x08, "3 Coins 1 Credit " }, - {0x11, 0x01, 0x38, 0x10, "2 Coins 1 Credit " }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credit " }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x04, 0x04, "Upright" }, - {0x12, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Bonus_Life" }, - {0x12, 0x01, 0x18, 0x18, "20K, 40K, every 60K" }, - {0x12, 0x01, 0x18, 0x10, "30K, 50K, every 70K" }, - {0x12, 0x01, 0x18, 0x08, "20K and 60K only" }, - {0x12, 0x01, 0x18, 0x00, "30K and 70K only" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x60, 0x40, "Easy" }, - {0x12, 0x01, 0x60, 0x60, "Medium" }, - {0x12, 0x01, 0x60, 0x20, "Hard" }, - {0x12, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static void bionicc_palette_write(INT32 offset) -{ - offset >>= 1; - - INT32 r, g, b, bright; - INT32 data = *((UINT16*)(DrvPalRAM + (offset << 1))); - - bright = (data&0x0f); - - r = ((data>>12)&0x0f) * 0x11; - g = ((data>>8 )&0x0f) * 0x11; - b = ((data>>4 )&0x0f) * 0x11; - - if ((bright & 0x08) == 0) - { - r = r * (0x07 + bright) / 0x0e; - g = g * (0x07 + bright) / 0x0e; - b = b * (0x07 + bright) / 0x0e; - } - - DrvPalette[offset] = BurnHighCol(r, g, b, 0); -} - -void __fastcall bionicc_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffff800) == 0xff8000) { - address &= 0x7ff; - DrvPalRAM[address ^ 1] = data; - bionicc_palette_write(address); - return; - } - - switch (address) - { - case 0xfe4000: - case 0xfe4001: - flipscreen = data & 0x01; - fg_enable = data & 0x10; - bg_enable = data & 0x20; - return; - } -} - -void __fastcall bionicc_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff800) == 0xff8000) { - address &= 0x7ff; - - *((UINT16*)(DrvPalRAM + address)) = data; - - bionicc_palette_write(address); - - return; - } - - switch (address) - { - case 0xfe8010: - fg_scroll_x = data & 0x3ff; - return; - - case 0xfe8012: - fg_scroll_y = data & 0x3ff; - return; - - case 0xfe8014: - bg_scroll_x = data & 0x1ff; - return; - - case 0xfe8016: - bg_scroll_y = data & 0x1ff; - return; - - case 0xfe801a: - UINT16 *inp = (UINT16*)(Drv68KRAM1 + 0x3ffa); - inp[0] = (DrvInputs[0] >> 4) ^ 0x0f; - inp[1] = DrvInputs[2] ^ 0xff; - inp[2] = DrvInputs[1] ^ 0xff; - return; - } -} - -UINT8 __fastcall bionicc_read_byte(UINT32 address) -{ - switch (address) - { - case 0xfe4000: - return DrvInputs[0]; - - case 0xfe4001: - return 0xff; - - case 0xfe4002: - return DrvDips[0]; - - case 0xfe4003: - return DrvDips[1]; - } - - return 0; -} - -UINT16 __fastcall bionicc_read_word(UINT32 address) -{ - switch (address) - { - case 0xfe4000: - return 0x00ff | (DrvInputs[0] << 8); - - case 0xfe4002: - return DrvDips[0] | (DrvDips[1] << 8); - } - - return 0; -} - -UINT8 __fastcall bionicc_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8001: - return BurnYM2151ReadStatus(); - - case 0xa000: - return *soundlatch; - } - - return 0; -} - -void __fastcall bionicc_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8000: - BurnYM2151SelectRegister(data); - return; - - case 0x8001: - BurnYM2151WriteRegister(data); - return; - } -} - -static tilemap_callback( background ) -{ - UINT16 *ram = (UINT16*)DrvVidRAM1; - - INT32 attr = ram[(offs * 2) + 1]; - INT32 code = (ram[offs * 2] & 0xff) | ((attr & 0x07) * 256); - - TILE_SET_INFO(0, code, attr >> 3, TILE_FLIPXY(attr >> 6)); -} - -static tilemap_callback( foreground ) -{ - UINT16 *ram = (UINT16*)DrvVidRAM0; - - INT32 attr = ram[(offs * 2) + 1]; - INT32 code = (ram[offs * 2] & 0xff) | ((attr & 0x07) * 256); - - INT32 flags = TILE_FLIPXY(attr >> 6); - INT32 group = (attr >> 5) & 1; - - if (attr >= 0xc0) { - flags ^= 3; - group = 2; - } - - TILE_SET_INFO(1, code, attr >> 3, flags | TILE_GROUP(group)); -} - -static tilemap_callback( text ) -{ - UINT16 *ram = (UINT16*)DrvTextRAM; - - INT32 attr = ram[offs + 0x400]; - INT32 code = (ram[offs] & 0xff) | ((attr & 0xc0) << 2); - - TILE_SET_INFO(2, code, attr, 0); -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KROM = Next; Next += 0x0040000; - DrvZ80ROM = Next; Next += 0x0008000; - - DrvGfxROM0 = Next; Next += 0x0020000; - DrvGfxROM1 = Next; Next += 0x0020000; - DrvGfxROM2 = Next; Next += 0x0080000; - DrvGfxROM3 = Next; Next += 0x0080000; - - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x0004000; - Drv68KRAM1 = Next; Next += 0x0004000; - DrvPalRAM = Next; Next += 0x0000800; - DrvTextRAM = Next; Next += 0x0001000; - DrvVidRAM0 = Next; Next += 0x0004000; - DrvVidRAM1 = Next; Next += 0x0004000; - - DrvSprBuf = Next; Next += 0x0000500; - - DrvZ80RAM = Next; Next += 0x0000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - HiscoreReset(); - - fg_scroll_x = 0; - fg_scroll_y = 0; - bg_scroll_x = 0; - bg_scroll_y = 0; - - soundlatch = Drv68KRAM1 + 0x3ff8; - flipscreen = 0; - - fg_enable = 0; - bg_enable = 0; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - static INT32 CharPlanes[2] = { 0x000004, 0x000000 }; - static INT32 Tile0Planes[4] = { 0x040004, 0x040000, 0x000004, 0x000000 }; - static INT32 Tile1Planes[4] = { 0x100004, 0x100000, 0x000004, 0x000000 }; - static INT32 SpriPlanes[4] = { 0x180000, 0x100000, 0x080000, 0x000000 }; - static INT32 CharXOffsets[16] = { STEP4(0,1), STEP4(8,1), STEP4(256,1), STEP4(256+8,1) }; - static INT32 SpriXOffsets[16] = { STEP8(0,1), STEP8(128,1) }; - static INT32 CharYOffsets[16] = { STEP16(0,16) }; - static INT32 SpriYOffsets[16] = { STEP16(0,8) }; - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x00400, 2, 8, 8, CharPlanes, CharXOffsets, CharYOffsets, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x10000); - - GfxDecode(0x00800, 4, 8, 8, Tile0Planes, CharXOffsets, CharYOffsets, 0x080, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x00800, 4, 16, 16, Tile1Planes, CharXOffsets, CharYOffsets, 0x200, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x40000); - - GfxDecode(0x00800, 4, 16, 16, SpriPlanes, SpriXOffsets, SpriYOffsets, 0x100, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x20001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x20000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x8000, 7, 1)) return 1; - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(DrvGfxROM2 + i * 0x8000, i + 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + i * 0x8000, i + 16, 1)) return 1; - } - - if (DrvGfxDecode()) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0xfe0000, 0xfe3fff, MAP_RAM); - SekMapMemory(DrvTextRAM, 0xfec000, 0xfecfff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0xff0000, 0xff3fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0xff4000, 0xff7fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xff8000, 0xff87ff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0xffc000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, bionicc_read_byte); - SekSetReadWordHandler(0, bionicc_read_word); - SekSetWriteByteHandler(0, bionicc_write_byte); - SekSetWriteWordHandler(0, bionicc_write_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(bionicc_sound_write); - ZetSetReadHandler(bionicc_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 8, 8, 64, 64); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, foreground_map_callback, 16, 16, 64, 64); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, text_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM1, 4, 8, 8, 0x20000, 0x000, 0x03); - GenericTilemapSetGfx(1, DrvGfxROM2, 4, 16, 16, 0x80000, 0x100, 0x03); - GenericTilemapSetGfx(2, DrvGfxROM0, 2, 8, 8, 0x20000, 0x300, 0x3f); - GenericTilemapSetTransparent(0, 0x0f); - GenericTilemapSetTransparent(1, 0x0f); - GenericTilemapSetTransparent(2, 0x03); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvbInit() -{ - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x20001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x20000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x28000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x38000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x10000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x30000, 19, 1)) return 1; - - if (DrvGfxDecode()) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0xfe0000, 0xfe3fff, MAP_RAM); - SekMapMemory(DrvTextRAM, 0xfec000, 0xfecfff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0xff0000, 0xff3fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0xff4000, 0xff7fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xff8000, 0xff87ff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0xffc000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, bionicc_read_byte); - SekSetReadWordHandler(0, bionicc_read_word); - SekSetWriteByteHandler(0, bionicc_write_byte); - SekSetWriteWordHandler(0, bionicc_write_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(bionicc_sound_write); - ZetSetReadHandler(bionicc_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 8, 8, 64, 64); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, foreground_map_callback, 16, 16, 64, 64); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, text_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM1, 4, 8, 8, 0x20000, 0x000, 0x03); - GenericTilemapSetGfx(1, DrvGfxROM2, 4, 16, 16, 0x80000, 0x100, 0x03); - GenericTilemapSetGfx(2, DrvGfxROM0, 2, 8, 8, 0x20000, 0x300, 0x3f); - GenericTilemapSetTransparent(0, 0x0f); - GenericTilemapSetTransparent(1, 0x0f); - GenericTilemapSetTransparent(2, 0x03); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2151Exit(); - SekExit(); - ZetExit(); - - BurnFree (Mem); - - GenericTilesExit(); - - return 0; -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprBuf; - - for (INT32 offs = (0x500-8)/2; offs >= 0; offs -= 4) - { - INT32 code = ram[offs] & 0x7ff; - - if (code != 0x7ff) - { - INT32 attr = ram[offs+1]; - INT32 color = (attr & 0x3c) >> 2; - INT32 flipx = attr & 0x02; - INT32 flipy = 0; - INT32 sx = (INT16)ram[offs+3]; - INT32 sy = (INT16)ram[offs+2]; - if (sy > 496) sy -= 512; - - if (sx < -15 || sx > 255 || sy < 1 || sy > 239) continue; - - if (flipscreen) { - flipx ^= 2; - flipy = 1; - sx = (256 - 16) - sx; - sy = (256 - 16) - sy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 15, 0x200, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 15, 0x200, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 15, 0x200, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 15, 0x200, DrvGfxROM3); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - bionicc_palette_write(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - GenericTilemapSetFlip(TMAP_GLOBAL, flipscreen ? (TMAP_FLIPY | TMAP_FLIPX) : 0); - - GenericTilemapSetScrollX(0, bg_scroll_x); - GenericTilemapSetScrollY(0, bg_scroll_y); - GenericTilemapSetScrollX(1, fg_scroll_x); - GenericTilemapSetScrollY(1, fg_scroll_y); - - GenericTilemapSetEnable(0, bg_enable); - GenericTilemapSetEnable(1, fg_enable); - - GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(2)); - GenericTilemapDraw(0, pTransDraw, 0); - GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(0)); - - draw_sprites(); - - GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(1)); - GenericTilemapDraw(2, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = DrvInputs[1] = DrvInputs[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 8; - INT32 nTotalCycles[2] = { 12000000 / 60, 3579545 / 60 }; - - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nTotalCycles[0] -= SekRun(nTotalCycles[0] / (nInterleave - i)); - if (i != (nInterleave - 1)) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - nTotalCycles[1] -= ZetRun(nTotalCycles[1] / (nInterleave - i)); - if ((i & 1) == 1) ZetNmi(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - // Lag sprites 1 frame - memcpy (DrvSprBuf, Drv68KRAM0 + 0x800, 0x500); - - return 0; -} - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029682; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - - SCAN_VAR(fg_scroll_x); - SCAN_VAR(fg_scroll_y); - SCAN_VAR(bg_scroll_x); - SCAN_VAR(bg_scroll_y); - SCAN_VAR(fg_enable); - SCAN_VAR(bg_enable); - SCAN_VAR(flipscreen); - } - - return 0; -} - -// Bionic Commando (Euro) - -static struct BurnRomInfo bioniccRomDesc[] = { - { "tse_02.1a", 0x10000, 0xe4aeefaa, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tse_04.1b", 0x10000, 0xd0c8ec75, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tse_03.2a", 0x10000, 0xb2ac0a45, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tse_05.2b", 0x10000, 0xa79cb406, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ts_01b.4e", 0x08000, 0xa9a6cafa, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "tsu_08.8l", 0x08000, 0x9bf0b7a2, 3 | BRF_GRA }, // 5 Characters - - { "tsu_07.5l", 0x08000, 0x9469efa4, 4 | BRF_GRA }, // 6 Background Tiles - { "tsu_06.4l", 0x08000, 0x40bf0eb4, 4 | BRF_GRA }, // 7 - - { "ts_12.17f", 0x08000, 0xe4b4619e, 5 | BRF_GRA }, // 8 Foreground Tiles - { "ts_11.15f", 0x08000, 0xab30237a, 5 | BRF_GRA }, // 9 - { "ts_17.17g", 0x08000, 0xdeb657e4, 5 | BRF_GRA }, // 10 - { "ts_16.15g", 0x08000, 0xd363b5f9, 5 | BRF_GRA }, // 11 - { "ts_13.18f", 0x08000, 0xa8f5a004, 5 | BRF_GRA }, // 12 - { "ts_18.18g", 0x08000, 0x3b36948c, 5 | BRF_GRA }, // 13 - { "ts_23.18j", 0x08000, 0xbbfbe58a, 5 | BRF_GRA }, // 14 - { "ts_24.18k", 0x08000, 0xf156e564, 5 | BRF_GRA }, // 15 - - { "tse_10.13f", 0x08000, 0xd28eeacc, 6 | BRF_GRA }, // 16 Sprites - { "tsu_09.11f", 0x08000, 0x6a049292, 6 | BRF_GRA }, // 17 - { "tse_15.13g", 0x08000, 0x9b5593c0, 6 | BRF_GRA }, // 18 - { "tsu_14.11g", 0x08000, 0x46b2ad83, 6 | BRF_GRA }, // 19 - { "tse_20.13j", 0x08000, 0xb03db778, 6 | BRF_GRA }, // 20 - { "tsu_19.11j", 0x08000, 0xb5c82722, 6 | BRF_GRA }, // 21 - { "tse_22.17j", 0x08000, 0xd4dedeb3, 6 | BRF_GRA }, // 22 - { "tsu_21.15j", 0x08000, 0x98777006, 6 | BRF_GRA }, // 23 - - { "63s141.18f", 0x00100, 0xb58d0023, 0 | BRF_OPT }, // 24 Priority (not used) - - { "c8751h-88", 0x01000, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(bionicc) -STD_ROM_FN(bionicc) - -struct BurnDriver BurnDrvbionicc = { - "bionicc", NULL, NULL, NULL, "1987", - "Bionic Commando (Euro)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, bioniccRomInfo, bioniccRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Bionic Commando (US set 1) - -static struct BurnRomInfo bionicc1RomDesc[] = { - { "tsu_02b.1a", 0x10000, 0xcf965a0a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tsu_04b.1b", 0x10000, 0xc9884bfb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tsu_03b.2a", 0x10000, 0x4e157ae2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tsu_05b.2b", 0x10000, 0xe66ca0f9, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ts_01b.4e", 0x08000, 0xa9a6cafa, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "tsu_08.8l", 0x08000, 0x9bf0b7a2, 3 | BRF_GRA }, // 5 Characters - - { "tsu_07.5l", 0x08000, 0x9469efa4, 4 | BRF_GRA }, // 6 Background Tiles - { "tsu_06.4l", 0x08000, 0x40bf0eb4, 4 | BRF_GRA }, // 7 - - { "ts_12.17f", 0x08000, 0xe4b4619e, 5 | BRF_GRA }, // 8 Foreground Tiles - { "ts_11.15f", 0x08000, 0xab30237a, 5 | BRF_GRA }, // 9 - { "ts_17.17g", 0x08000, 0xdeb657e4, 5 | BRF_GRA }, // 10 - { "ts_16.15g", 0x08000, 0xd363b5f9, 5 | BRF_GRA }, // 11 - { "ts_13.18f", 0x08000, 0xa8f5a004, 5 | BRF_GRA }, // 12 - { "ts_18.18g", 0x08000, 0x3b36948c, 5 | BRF_GRA }, // 13 - { "ts_23.18j", 0x08000, 0xbbfbe58a, 5 | BRF_GRA }, // 14 - { "ts_24.18k", 0x08000, 0xf156e564, 5 | BRF_GRA }, // 15 - - { "tsu_10.13f", 0x08000, 0xf1180d02, 6 | BRF_GRA }, // 16 Sprites - { "tsu_09.11f", 0x08000, 0x6a049292, 6 | BRF_GRA }, // 17 - { "tsu_15.13g", 0x08000, 0xea912701, 6 | BRF_GRA }, // 18 - { "tsu_14.11g", 0x08000, 0x46b2ad83, 6 | BRF_GRA }, // 19 - { "tsu_20.13j", 0x08000, 0x17857ad2, 6 | BRF_GRA }, // 20 - { "tsu_19.11j", 0x08000, 0xb5c82722, 6 | BRF_GRA }, // 21 - { "tsu_22.17j", 0x08000, 0x5ee1ae6a, 6 | BRF_GRA }, // 22 - { "tsu_21.15j", 0x08000, 0x98777006, 6 | BRF_GRA }, // 23 - - { "63s141.18f", 0x00100, 0xb58d0023, 0 | BRF_OPT }, // 24 Priority (not used) - - { "c8751h-88", 0x01000, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(bionicc1) -STD_ROM_FN(bionicc1) - -struct BurnDriver BurnDrvbionicc1 = { - "bionicc1", "bionicc", NULL, NULL, "1987", - "Bionic Commando (US set 1)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, bionicc1RomInfo, bionicc1RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Bionic Commando (US set 2) - -static struct BurnRomInfo bionicc2RomDesc[] = { - { "tsu_02.1a", 0x10000, 0xf2528f08, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tsu_04.1b", 0x10000, 0x38b1c7e4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tsu_03.2a", 0x10000, 0x72c3b76f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tsu_05.2b", 0x10000, 0x70621f83, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ts_01b.4e", 0x08000, 0xa9a6cafa, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "tsu_08.8l", 0x08000, 0x9bf0b7a2, 3 | BRF_GRA }, // 5 Characters - - { "tsu_07.5l", 0x08000, 0x9469efa4, 4 | BRF_GRA }, // 6 Background Tiles - { "tsu_06.4l", 0x08000, 0x40bf0eb4, 4 | BRF_GRA }, // 7 - - { "ts_12.17f", 0x08000, 0xe4b4619e, 5 | BRF_GRA }, // 8 Foreground Tiles - { "ts_11.15f", 0x08000, 0xab30237a, 5 | BRF_GRA }, // 9 - { "ts_17.17g", 0x08000, 0xdeb657e4, 5 | BRF_GRA }, // 10 - { "ts_16.15g", 0x08000, 0xd363b5f9, 5 | BRF_GRA }, // 11 - { "ts_13.18f", 0x08000, 0xa8f5a004, 5 | BRF_GRA }, // 12 - { "ts_18.18g", 0x08000, 0x3b36948c, 5 | BRF_GRA }, // 13 - { "ts_23.18j", 0x08000, 0xbbfbe58a, 5 | BRF_GRA }, // 14 - { "ts_24.18k", 0x08000, 0xf156e564, 5 | BRF_GRA }, // 15 - - { "tsu_10.13f", 0x08000, 0xf1180d02, 6 | BRF_GRA }, // 16 Sprites - { "tsu_09.11f", 0x08000, 0x6a049292, 6 | BRF_GRA }, // 17 - { "tsu_15.13g", 0x08000, 0xea912701, 6 | BRF_GRA }, // 18 - { "tsu_14.11g", 0x08000, 0x46b2ad83, 6 | BRF_GRA }, // 19 - { "tsu_20.13j", 0x08000, 0x17857ad2, 6 | BRF_GRA }, // 20 - { "tsu_19.11j", 0x08000, 0xb5c82722, 6 | BRF_GRA }, // 21 - { "tsu_22.17j", 0x08000, 0x5ee1ae6a, 6 | BRF_GRA }, // 22 - { "tsu_21.15j", 0x08000, 0x98777006, 6 | BRF_GRA }, // 23 - - { "63s141.18f", 0x00100, 0xb58d0023, 0 | BRF_OPT }, // 24 Priority (not used) - - { "c8751h-88", 0x01000, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(bionicc2) -STD_ROM_FN(bionicc2) - -struct BurnDriver BurnDrvbionicc2 = { - "bionicc2", "bionicc", NULL, NULL, "1987", - "Bionic Commando (US set 2)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, bionicc2RomInfo, bionicc2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Top Secret (Japan) - -static struct BurnRomInfo topsecrtRomDesc[] = { - { "ts_02.1a", 0x10000, 0xb2fe1ddb, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ts_04.1b", 0x10000, 0x427a003d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ts_03.2a", 0x10000, 0x27f04bb6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ts_05.2b", 0x10000, 0xc01547b1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ts_01.4e", 0x08000, 0x8ea07917, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ts_08.8l", 0x08000, 0x96ad379e, 3 | BRF_GRA }, // 5 Characters - - { "ts_07.5l", 0x08000, 0x25cdf8b2, 4 | BRF_GRA }, // 6 Background Tiles - { "ts_06.4l", 0x08000, 0x314fb12d, 4 | BRF_GRA }, // 7 - - { "ts_12.17f", 0x08000, 0xe4b4619e, 5 | BRF_GRA }, // 8 Foreground Tiles - { "ts_11.15f", 0x08000, 0xab30237a, 5 | BRF_GRA }, // 9 - { "ts_17.17g", 0x08000, 0xdeb657e4, 5 | BRF_GRA }, // 10 - { "ts_16.15g", 0x08000, 0xd363b5f9, 5 | BRF_GRA }, // 11 - { "ts_13.18f", 0x08000, 0xa8f5a004, 5 | BRF_GRA }, // 12 - { "ts_18.18g", 0x08000, 0x3b36948c, 5 | BRF_GRA }, // 13 - { "ts_23.18j", 0x08000, 0xbbfbe58a, 5 | BRF_GRA }, // 14 - { "ts_24.18k", 0x08000, 0xf156e564, 5 | BRF_GRA }, // 15 - - { "ts_10.13f", 0x08000, 0xc3587d05, 6 | BRF_GRA }, // 16 Sprites - { "ts_09.11f", 0x08000, 0x6b63eef2, 6 | BRF_GRA }, // 17 - { "ts_15.13g", 0x08000, 0xdb8cebb0, 6 | BRF_GRA }, // 18 - { "ts_14.11g", 0x08000, 0xe2e41abf, 6 | BRF_GRA }, // 19 - { "ts_20.13j", 0x08000, 0xbfd1a695, 6 | BRF_GRA }, // 20 - { "ts_19.11j", 0x08000, 0x928b669e, 6 | BRF_GRA }, // 21 - { "ts_22.17j", 0x08000, 0x3fe05d9a, 6 | BRF_GRA }, // 22 - { "ts_21.15j", 0x08000, 0x27a9bb7c, 6 | BRF_GRA }, // 23 - - { "63s141.18f", 0x00100, 0xb58d0023, 0 | BRF_OPT }, // 24 Priority (not used) - -// { "c8751h-88", 0x01000, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, - { "d8751h.bin", 0x01000, 0x3ed7f0be, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(topsecrt) -STD_ROM_FN(topsecrt) - -struct BurnDriver BurnDrvtopsecrt = { - "topsecrt", "bionicc", NULL, NULL, "1987", - "Top Secret (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, topsecrtRomInfo, topsecrtRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Bionic Commandos (bootleg, set 1) - -static struct BurnRomInfo bioniccblRomDesc[] = { - { "02l.bin", 0x10000, 0xb2fe1ddb, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "03l.bin", 0x10000, 0x427a003d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "02u.bin", 0x10000, 0x27f04bb6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "03u.bin", 0x10000, 0xc01547b1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "01.bin", 0x08000, 0x8ea07917, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "06.bin", 0x04000, 0x4e6b81d9, 3 | BRF_GRA }, // 5 Characters - - { "05.bin", 0x08000, 0x9bf8dc7f, 4 | BRF_GRA }, // 6 Background Tiles - { "04.bin", 0x08000, 0x1b43bf63, 4 | BRF_GRA }, // 7 - - { "ts_12.17f", 0x08000, 0xe4b4619e, 5 | BRF_GRA }, // 8 Foreground Tiles - { "ts_11.15f", 0x08000, 0xab30237a, 5 | BRF_GRA }, // 9 - { "ts_17.17g", 0x08000, 0xdeb657e4, 5 | BRF_GRA }, // 10 - { "ts_16.15g", 0x08000, 0xd363b5f9, 5 | BRF_GRA }, // 11 - { "ts_13.18f", 0x08000, 0xa8f5a004, 5 | BRF_GRA }, // 12 - { "ts_18.18g", 0x08000, 0x3b36948c, 5 | BRF_GRA }, // 13 - { "ts_23.18j", 0x08000, 0xbbfbe58a, 5 | BRF_GRA }, // 14 - { "ts_24.18k", 0x08000, 0xf156e564, 5 | BRF_GRA }, // 15 - - { "07.bin", 0x10000, 0xa0e78996, 6 | BRF_GRA }, // 16 Sprites - { "11.bin", 0x10000, 0x37cb11c2, 6 | BRF_GRA }, // 17 - { "15.bin", 0x10000, 0x4e0354ce, 6 | BRF_GRA }, // 18 - { "16.bin", 0x10000, 0xac89e5cc, 6 | BRF_GRA }, // 19 - - { "63s141.18f", 0x00100, 0xb58d0023, 0 | BRF_OPT }, // 20 Priority (not used) - - { "c8751h-88", 0x01000, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(bioniccbl) -STD_ROM_FN(bioniccbl) - -struct BurnDriver BurnDrvbioniccbl = { - "bioniccbl", "bionicc", NULL, NULL, "1987", - "Bionic Commandos (bootleg, set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, bioniccblRomInfo, bioniccblRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Bionic Commandos (bootleg, set 2) -/* only the 4 maincpu ROMs differ, they came from an original, not working, Capcom board, -but the title screen is Bionic Commandos like a bootleg? The other ROMs match topsecrt */ - -static struct BurnRomInfo bioniccbl2RomDesc[] = { - { "tsu_02.1a", 0x10000, 0xc03d3424, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tsu_04.1b", 0x10000, 0x9f13eb9d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3", 0x10000, 0xa909ec2c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tsu_05.1d", 0x10000, 0x4e6b75ce, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ts_01.4e", 0x08000, 0x8ea07917, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ts_08.8l", 0x08000, 0x96ad379e, 3 | BRF_GRA }, // 5 Characters - - { "ts_07.5l", 0x08000, 0x25cdf8b2, 4 | BRF_GRA }, // 6 Background Tiles - { "ts_06.4l", 0x08000, 0x314fb12d, 4 | BRF_GRA }, // 7 - - { "ts_12.17f", 0x08000, 0xe4b4619e, 5 | BRF_GRA }, // 8 Foreground Tiles - { "ts_11.15f", 0x08000, 0xab30237a, 5 | BRF_GRA }, // 9 - { "ts_17.17g", 0x08000, 0xdeb657e4, 5 | BRF_GRA }, // 10 - { "ts_16.15g", 0x08000, 0xd363b5f9, 5 | BRF_GRA }, // 11 - { "ts_13.18f", 0x08000, 0xa8f5a004, 5 | BRF_GRA }, // 12 - { "ts_18.18g", 0x08000, 0x3b36948c, 5 | BRF_GRA }, // 13 - { "ts_23.18j", 0x08000, 0xbbfbe58a, 5 | BRF_GRA }, // 14 - { "ts_24.18k", 0x08000, 0xf156e564, 5 | BRF_GRA }, // 15 - - { "tse_10.13f", 0x08000, 0xd28eeacc, 6 | BRF_GRA }, // 16 Sprites - { "tsu_09.11f", 0x08000, 0x6a049292, 6 | BRF_GRA }, // 17 - { "tse_15.13g", 0x08000, 0x9b5593c0, 6 | BRF_GRA }, // 18 - { "tsu_14.11g", 0x08000, 0x46b2ad83, 6 | BRF_GRA }, // 19 - { "tse_20.13j", 0x08000, 0xb03db778, 6 | BRF_GRA }, // 20 - { "tsu_19.11j", 0x08000, 0xb5c82722, 6 | BRF_GRA }, // 21 - { "tse_22.17j", 0x08000, 0xd4dedeb3, 6 | BRF_GRA }, // 22 - { "tsu_21.15j", 0x08000, 0x98777006, 6 | BRF_GRA }, // 23 - - { "63s141.18f", 0x00100, 0xb58d0023, 0 | BRF_OPT }, // 24 Priority (not used) - - { "c8751h-88", 0x01000, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(bioniccbl2) -STD_ROM_FN(bioniccbl2) - -struct BurnDriver BurnDrvbioniccbl2 = { - "bioniccbl2", "bionicc", NULL, NULL, "1987", - "Bionic Commandos (bootleg, set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, bioniccbl2RomInfo, bioniccbl2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; \ No newline at end of file diff --git a/jan/src/burn/drv/pre90s/d_blktiger.cpp b/jan/src/burn/drv/pre90s/d_blktiger.cpp deleted file mode 100644 index b0993a57d..000000000 --- a/jan/src/burn/drv/pre90s/d_blktiger.cpp +++ /dev/null @@ -1,1164 +0,0 @@ -// FB Alpha Black Tiger driver module -// Based on MAME driver by Paul Leaman - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPalRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvTxRAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *DrvScreenLayout; -static UINT8 *DrvBgEnable; -static UINT8 *DrvFgEnable; -static UINT8 *DrvSprEnable; -static UINT8 *DrvVidBank; -static UINT8 *DrvRomBank; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *coin_lockout; -static INT32 watchdog; - -static UINT16 *DrvScrollx; -static UINT16 *DrvScrolly; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 nCyclesTotal[2]; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 7, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvJoy2 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy2 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Service", BIT_DIGITAL , DrvJoy1 + 5, "service" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0x01, 0x01, NULL }, - - {0x12, 0xfe, 0, 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "4 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "3 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "2 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - - {0x12, 0xfe, 0, 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "4 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "3 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "2 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - - {0x12, 0xfe, 0, 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0x12, 0xfe, 0, 2, "Test" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0x13, 0xfe, 0, 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0x13, 0xfe, 0, 8, "Difficulty" }, - {0x13, 0x01, 0x1c, 0x1c, "1 (Easiest)" }, - {0x13, 0x01, 0x1c, 0x18, "2" }, - {0x13, 0x01, 0x1c, 0x14, "3" }, - {0x13, 0x01, 0x1c, 0x10, "4" }, - {0x13, 0x01, 0x1c, 0x0c, "5 (Normal)" }, - {0x13, 0x01, 0x1c, 0x08, "6" }, - {0x13, 0x01, 0x1c, 0x04, "7" }, - {0x13, 0x01, 0x1c, 0x00, "8 (Hardest)" }, - - {0x13, 0xfe, 0, 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0x13, 0xfe, 0, 2, "Allow Continue" }, - {0x13, 0x01, 0x40, 0x00, "No" }, - {0x13, 0x01, 0x40, 0x40, "Yes" }, - - {0x13, 0xfe, 0, 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, - - {0x14, 0xfe, 0, 2, "Coin Lockout Present?"}, - {0x14, 0x01, 0x01, 0x01, "Yes" }, - {0x14, 0x01, 0x01, 0x00, "No" }, -}; - -STDDIPINFO(Drv) - -static void palette_write(INT32 offset) -{ - UINT8 r,g,b; - UINT16 data = (DrvPalRAM[offset]) | (DrvPalRAM[offset | 0x400] << 8); - - r = (data >> 4) & 0x0f; - g = (data >> 0) & 0x0f; - b = (data >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[offset] = BurnHighCol(r, g, b, 0); -} - -static void DrvRomBankswitch(INT32 bank) -{ - *DrvRomBank = bank & 0x0f; - - INT32 nBank = 0x10000 + (bank & 0x0f) * 0x4000; - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + nBank); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM0 + nBank); -} - -static void DrvVidRamBankswitch(INT32 bank) -{ - *DrvVidBank = bank & 0x03; - - INT32 nBank = (bank & 3) * 0x1000; - - ZetMapArea(0xc000, 0xcfff, 0, DrvBgRAM + nBank); - ZetMapArea(0xc000, 0xcfff, 1, DrvBgRAM + nBank); - ZetMapArea(0xc000, 0xcfff, 2, DrvBgRAM + nBank); -} - -void __fastcall blacktiger_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xd800) { - DrvPalRAM[address & 0x7ff] = data; - - palette_write(address & 0x3ff); - - return; - } - - return; -} - -UINT8 __fastcall blacktiger_read(UINT16 /*address*/) -{ - return 0; -} - -void __fastcall blacktiger_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - { - // INT64 cycles = ZetTotalCycles(); - // ZetClose(); - // ZetOpen(1); - - // INT32 nCycles = ((INT64)cycles * nCyclesTotal[1] / nCyclesTotal[0]); - // if (nCycles <= ZetTotalCycles()) return; - - // BurnTimerUpdate(nCycles); - // ZetClose(); - // ZetOpen(0); - - *soundlatch = data; - } - return; - - case 0x01: - DrvRomBankswitch(data); - return; - - case 0x03: - if (DrvDips[2] & 1) { - *coin_lockout = ~data << 6; - } - return; - - case 0x04: - if (data & 0x20) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - - *flipscreen = data & 0x40; - *DrvFgEnable = ~data & 0x80; - - return; - - case 0x06: - watchdog = 0; - return; - - case 0x08: - *DrvScrollx = (*DrvScrollx & 0xff00) | data; - return; - - case 0x09: - *DrvScrollx = (*DrvScrollx & 0x00ff) | (data << 8); - return; - - case 0x0a: - *DrvScrolly = (*DrvScrolly & 0xff00) | data; - return; - - case 0x0b: - *DrvScrolly = (*DrvScrolly & 0x00ff) | (data << 8); - return; - - case 0x0c: - *DrvSprEnable = ~data & 0x02; - *DrvBgEnable = ~data & 0x04; - return; - - case 0x0d: - DrvVidRamBankswitch(data); - return; - - case 0x0e: - *DrvScreenLayout = data ? 1 : 0; - return; - } -} - -UINT8 __fastcall blacktiger_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - return DrvInputs[port & 3]; - - case 0x03: - case 0x04: - return DrvDips[~port & 1]; - - case 0x05: - return 0x01; - - case 0x07: - return ZetDe(-1) >> 8; - } - - return 0; -} - -void __fastcall blacktiger_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - BurnYM2203Write(0, 0, data); - return; - - case 0xe001: - BurnYM2203Write(0, 1, data); - return; - - case 0xe002: - BurnYM2203Write(1, 0, data); - return; - - case 0xe003: - BurnYM2203Write(1, 1, data); - return; - } -} - -UINT8 __fastcall blacktiger_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc800: - return *soundlatch; - - case 0xe000: - return BurnYM2203Read(0, 0); - - case 0xe001: - return BurnYM2203Read(0, 1); - - case 0xe002: - return BurnYM2203Read(1, 0); - - case 0xe003: - return BurnYM2203Read(1, 1); - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x050000; - DrvZ80ROM1 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001e00; - DrvZ80RAM1 = Next; Next += 0x000800; - - DrvPalRAM = Next; Next += 0x000800; - DrvTxRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x001200; - DrvSprBuf = Next; Next += 0x001200; - - DrvScreenLayout = Next; Next += 0x000001; - DrvBgEnable = Next; Next += 0x000001; - DrvFgEnable = Next; Next += 0x000001; - DrvSprEnable = Next; Next += 0x000001; - - DrvVidBank = Next; Next += 0x000001; - DrvRomBank = Next; Next += 0x000001; - - DrvScrollx = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - DrvScrolly = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - coin_lockout = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - DrvRomBankswitch(1); - DrvVidRamBankswitch(1); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { ((0x40000 * 8) / 2) + 4, ((0x40000 * 8) / 2) + 0, 4, 0 }; - INT32 XOffs[16] = { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3, - 16*16+0, 16*16+1, 16*16+2, 16*16+3, 16*16+8+0, 16*16+8+1, 16*16+8+2, 16*16+8+3 }; - INT32 YOffs[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0800, 2, 8, 8, Plane + 2, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane + 0, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane + 0, XOffs, YOffs, 0x200, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3579545; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvZ80ROM0 + i * 0x10000, 0 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvZ80ROM1, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 6, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x10000, 7 + i, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + i * 0x10000, 11 + i, 1)) return 1; - } - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0xd000, 0xd7ff, 0, DrvTxRAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvTxRAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvTxRAM); - ZetMapArea(0xd800, 0xdfff, 0, DrvPalRAM); -// ZetMapArea(0xd800, 0xdfff, 1, DrvPalRAM); - ZetMapArea(0xd800, 0xdfff, 2, DrvPalRAM); - ZetMapArea(0xe000, 0xfdff, 0, DrvZ80RAM0); - ZetMapArea(0xe000, 0xfdff, 1, DrvZ80RAM0); - ZetMapArea(0xe000, 0xfdff, 2, DrvZ80RAM0); - ZetMapArea(0xfe00, 0xffff, 0, DrvSprRAM); - ZetMapArea(0xfe00, 0xffff, 1, DrvSprRAM); - ZetMapArea(0xfe00, 0xffff, 2, DrvSprRAM); - ZetSetWriteHandler(blacktiger_write); - ZetSetReadHandler(blacktiger_read); - ZetSetInHandler(blacktiger_in); - ZetSetOutHandler(blacktiger_out); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM1); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM1); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM1); - ZetSetWriteHandler(blacktiger_sound_write); - ZetSetReadHandler(blacktiger_sound_read); - ZetClose(); - - GenericTilesInit(); - - BurnYM2203Init(2, 3579545, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3579545); - BurnYM2203SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 0.05); - BurnYM2203SetPSGVolume(1, 0.05); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2203Exit(); - ZetExit(); - GenericTilesExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_bg(INT32 type, INT32 layer) -{ -// Priority masks should be enabled, but I don't see anywhere that they are used? -//#define USE_MASKS - -#ifdef USE_MASKS - UINT16 masks[2][4] = { { 0xffff, 0xfff0, 0xff00, 0xf000 }, { 0x8000, 0x800f, 0x80ff, 0x8fff } }; -#else - if (layer == 0) return; -#endif - - INT32 scrollx = (*DrvScrollx) & (0x3ff | (0x200 << type)); - INT32 scrolly = ((*DrvScrolly)+16) & (0x7ff >> type); - - for (INT32 offs = 0; offs < 0x2000; offs++) - { - INT32 sx, sy, ofst; - - if (type) { // 1 = 128x64, 0 = 64x128 - sx = (offs & 0x7f); - sy = (offs >> 7); - - ofst = (sx & 0x0f) + ((sy & 0x0f) << 4) + ((sx & 0x70) << 4) + ((sy & 0x30) << 7); - } else { - sx = (offs & 0x3f); - sy = (offs >> 6); - - ofst = (sx & 0x0f) + ((sy & 0x0f) << 4) + ((sx & 0x30) << 4) + ((sy & 0x70) << 6); - } - - sx = (sx * 16) - scrollx; - sy = (sy * 16) - scrolly; - - if (sx < -15) sx += (0x400 << type); - if (sy < -15) sy += (0x800 >> type); - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvBgRAM[(ofst << 1) | 1]; - INT32 color = (attr >> 3) & 0x0f; - INT32 code = DrvBgRAM[ofst << 1] | ((attr & 0x07) << 8); - INT32 flipx = attr & 0x80; - INT32 flipy = 0; - - if (*flipscreen) { - flipx ^= 0x80; - flipy = 1; - - sx = 240 - sx; - sy = 208 - sy; - } - -#ifdef USE_MASKS - INT32 colmask = masks[layer][(color < 2) ? 3 : 0]; - - { - UINT8 *gfx = DrvGfxROM1 + (code * 0x100); - color <<= 4; - - INT32 flip = (flipx ? 0x0f : 0) + (flipy ? 0xf0 : 0); - - for (INT32 y = 0; y < 16; y++, sy++, sx-=16) { - for (INT32 x = 0; x < 16; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth || sy < 0 || sy >= nScreenHeight) continue; - - INT32 pxl = gfx[(y*16+x)^flip]; - - if (colmask & (1 << pxl)) continue; // right? - - pTransDraw[sy * nScreenWidth + sx] = pxl + color; - } - } - } -#else - if (*flipscreen) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } - } -#endif - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x1200 - 4; offs >= 0; offs -= 4) - { - INT32 attr = DrvSprBuf[offs+1]; - INT32 sx = DrvSprBuf[offs + 3] - ((attr & 0x10) << 4); - INT32 sy = DrvSprBuf[offs + 2]; - INT32 code = DrvSprBuf[offs] | ((attr & 0xe0) << 3); - INT32 color = attr & 0x07; - INT32 flipx = attr & 0x08; - - if (*flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - } - - sy -= 16; - - if (sy < -15 || sy > 239 || sx < -15 || sx > 255) continue; - - if (*flipscreen) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x200, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x200, DrvGfxROM2); - } - } - } -} - -static void draw_text_layer() -{ - for (INT32 offs = 0x40; offs < 0x3c0; offs++) - { - INT32 attr = DrvTxRAM[offs | 0x400]; - INT32 code = DrvTxRAM[offs] | ((attr & 0xe0) << 3); - - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - if (*flipscreen) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, 248 - sx, 216 - (sy - 16), (attr & 0x1f)/*color*/, 2, 3, 0x300, DrvGfxROM0); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy - 16, (attr & 0x1f)/*color*/, 2, 3, 0x300, DrvGfxROM0); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i++) { - palette_write(i); - } - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x3ff; - } - - if (*DrvBgEnable) { - if (nSpriteEnable & 1) draw_bg(*DrvScreenLayout, 1); - } - - if (*DrvSprEnable) { - if (nSpriteEnable & 2) draw_sprites(); - } - - if (*DrvBgEnable) { - if (nSpriteEnable & 4) draw_bg(*DrvScreenLayout, 0); - } - - if (*DrvFgEnable) { - if (nSpriteEnable & 8) draw_text_layer(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - if (watchdog >= 180) { - DrvDoReset(0); - } - watchdog++; - - { - DrvInputs[0] = DrvInputs[1] = DrvInputs[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[0] |= *coin_lockout; - } - - ZetNewFrame(); - - INT32 nInterleave = 100; - nCyclesTotal[0] = 6000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 98) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == 99) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - BurnTimerUpdate(i * (nCyclesTotal[nCurrentCPU] / nInterleave)); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x1200); - - return 0; -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - } - - ZetOpen(0); - DrvRomBankswitch(*DrvRomBank); - DrvVidRamBankswitch(*DrvVidBank); - ZetClose(); - - return 0; -} - - -// Black Tiger - -static struct BurnRomInfo blktigerRomDesc[] = { - { "bdu-01a.5e", 0x08000, 0xa8f98f22, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "bdu-02a.6e", 0x10000, 0x7bef96e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bdu-03a.8e", 0x10000, 0x4089e157, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bd-04.9e", 0x10000, 0xed6af6ec, 1 | BRF_PRG | BRF_ESS }, // 3 - { "bd-05.10e", 0x10000, 0xae59b72e, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "bd-06.1l", 0x08000, 0x2cf54274, 2 | BRF_PRG | BRF_ESS }, // 5 - Z80 #0 Code - - { "bd-15.2n", 0x08000, 0x70175d78, 3 | BRF_GRA }, // 6 - Characters - - { "bd-12.5b", 0x10000, 0xc4524993, 4 | BRF_GRA }, // 7 - Background Tiles - { "bd-11.4b", 0x10000, 0x7932c86f, 4 | BRF_GRA }, // 8 - { "bd-14.9b", 0x10000, 0xdc49593a, 4 | BRF_GRA }, // 9 - { "bd-13.8b", 0x10000, 0x7ed7a122, 4 | BRF_GRA }, // 10 - - { "bd-08.5a", 0x10000, 0xe2f17438, 5 | BRF_GRA }, // 11 - Sprites - { "bd-07.4a", 0x10000, 0x5fccbd27, 5 | BRF_GRA }, // 12 - { "bd-10.9a", 0x10000, 0xfc33ccc6, 5 | BRF_GRA }, // 13 - { "bd-09.8a", 0x10000, 0xf449de01, 5 | BRF_GRA }, // 14 - - { "bd01.8j", 0x00100, 0x29b459e5, 6 | BRF_OPT }, // 15 - Proms (not used) - { "bd02.9j", 0x00100, 0x8b741e66, 6 | BRF_OPT }, // 16 - { "bd03.11k", 0x00100, 0x27201c75, 6 | BRF_OPT }, // 17 - { "bd04.11l", 0x00100, 0xe5490b68, 6 | BRF_OPT }, // 18 - - { "bd.6k", 0x01000, 0xac7d14f1, 7 | BRF_PRG | BRF_OPT }, // 19 I8751 Mcu Code -}; - -STD_ROM_PICK(blktiger) -STD_ROM_FN(blktiger) - -struct BurnDriver BurnDrvBlktiger = { - "blktiger", NULL, NULL, NULL, "1987", - "Black Tiger\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, blktigerRomInfo, blktigerRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Black Tiger (older) - -static struct BurnRomInfo blktigeraRomDesc[] = { - { "bdu-01.5e", 0x08000, 0x47b13922, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "bdu-02.6e", 0x10000, 0x2e0daf1b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bdu-03.8e", 0x10000, 0x3b67dfec, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bd-04.9e", 0x10000, 0xed6af6ec, 1 | BRF_PRG | BRF_ESS }, // 3 - { "bd-05.10e", 0x10000, 0xae59b72e, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "bd-06.1l", 0x08000, 0x2cf54274, 2 | BRF_PRG | BRF_ESS }, // 5 - Z80 #0 Code - - { "bd-15.2n", 0x08000, 0x70175d78, 3 | BRF_GRA }, // 6 - Characters - - { "bd-12.5b", 0x10000, 0xc4524993, 4 | BRF_GRA }, // 7 - Background Tiles - { "bd-11.4b", 0x10000, 0x7932c86f, 4 | BRF_GRA }, // 8 - { "bd-14.9b", 0x10000, 0xdc49593a, 4 | BRF_GRA }, // 9 - { "bd-13.8b", 0x10000, 0x7ed7a122, 4 | BRF_GRA }, // 10 - - { "bd-08.5a", 0x10000, 0xe2f17438, 5 | BRF_GRA }, // 11 - Sprites - { "bd-07.4a", 0x10000, 0x5fccbd27, 5 | BRF_GRA }, // 12 - { "bd-10.9a", 0x10000, 0xfc33ccc6, 5 | BRF_GRA }, // 13 - { "bd-09.8a", 0x10000, 0xf449de01, 5 | BRF_GRA }, // 14 - - { "bd01.8j", 0x00100, 0x29b459e5, 6 | BRF_OPT }, // 15 - Proms (not used) - { "bd02.9j", 0x00100, 0x8b741e66, 6 | BRF_OPT }, // 16 - { "bd03.11k", 0x00100, 0x27201c75, 6 | BRF_OPT }, // 17 - { "bd04.11l", 0x00100, 0xe5490b68, 6 | BRF_OPT }, // 18 - - { "bd.6k", 0x01000, 0xac7d14f1, 7 | BRF_PRG | BRF_OPT }, // 19 I8751 Mcu Code -}; - -STD_ROM_PICK(blktigera) -STD_ROM_FN(blktigera) - -struct BurnDriver BurnDrvBlktigera = { - "blktigera", "blktiger", NULL, NULL, "1987", - "Black Tiger (older)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, blktigeraRomInfo, blktigeraRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Black Tiger (bootleg) - -static struct BurnRomInfo blktigerb1RomDesc[] = { - { "btiger1.f6", 0x08000, 0x9d8464e8, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "bdu-02a.6e", 0x10000, 0x7bef96e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "btiger3.j6", 0x10000, 0x52c56ed1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bd-04.9e", 0x10000, 0xed6af6ec, 1 | BRF_PRG | BRF_ESS }, // 3 - { "bd-05.10e", 0x10000, 0xae59b72e, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "bd-06.1l", 0x08000, 0x2cf54274, 2 | BRF_PRG | BRF_ESS }, // 5 - Z80 #0 Code - - { "bd-15.2n", 0x08000, 0x70175d78, 3 | BRF_GRA }, // 6 - Characters - - { "bd-12.5b", 0x10000, 0xc4524993, 4 | BRF_GRA }, // 7 - Background Tiles - { "bd-11.4b", 0x10000, 0x7932c86f, 4 | BRF_GRA }, // 8 - { "bd-14.9b", 0x10000, 0xdc49593a, 4 | BRF_GRA }, // 9 - { "bd-13.8b", 0x10000, 0x7ed7a122, 4 | BRF_GRA }, // 10 - - { "bd-08.5a", 0x10000, 0xe2f17438, 5 | BRF_GRA }, // 11 - Sprites - { "bd-07.4a", 0x10000, 0x5fccbd27, 5 | BRF_GRA }, // 12 - { "bd-10.9a", 0x10000, 0xfc33ccc6, 5 | BRF_GRA }, // 13 - { "bd-09.8a", 0x10000, 0xf449de01, 5 | BRF_GRA }, // 14 - - { "bd01.8j", 0x00100, 0x29b459e5, 6 | BRF_OPT }, // 15 - Proms (not used) - { "bd02.9j", 0x00100, 0x8b741e66, 6 | BRF_OPT }, // 16 - { "bd03.11k", 0x00100, 0x27201c75, 6 | BRF_OPT }, // 17 - { "bd04.11l", 0x00100, 0xe5490b68, 6 | BRF_OPT }, // 18 -}; - -STD_ROM_PICK(blktigerb1) -STD_ROM_FN(blktigerb1) - -struct BurnDriver BurnDrvBlktigerb1 = { - "blktigerb1", "blktiger", NULL, NULL, "1987", - "Black Tiger (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, blktigerb1RomInfo, blktigerb1RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Black Tiger (bootleg set 2) - -static struct BurnRomInfo blktigerb2RomDesc[] = { - { "1.bin", 0x08000, 0x47E2B21E, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "bdu-02a.6e", 0x10000, 0x7bef96e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.bin", 0x10000, 0x52c56ed1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bd-04.9e", 0x10000, 0xed6af6ec, 1 | BRF_PRG | BRF_ESS }, // 3 - { "bd-05.10e", 0x10000, 0xae59b72e, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "bd-06.1l", 0x08000, 0x2cf54274, 2 | BRF_PRG | BRF_ESS }, // 5 - Z80 #0 Code - - { "bd-15.2n", 0x08000, 0x70175d78, 3 | BRF_GRA }, // 6 - Characters - - { "bd-12.5b", 0x10000, 0xc4524993, 4 | BRF_GRA }, // 7 - Background Tiles - { "bd-11.4b", 0x10000, 0x7932c86f, 4 | BRF_GRA }, // 8 - { "bd-14.9b", 0x10000, 0xdc49593a, 4 | BRF_GRA }, // 9 - { "bd-13.8b", 0x10000, 0x7ed7a122, 4 | BRF_GRA }, // 10 - - { "bd-08.5a", 0x10000, 0xe2f17438, 5 | BRF_GRA }, // 11 - Sprites - { "bd-07.4a", 0x10000, 0x5fccbd27, 5 | BRF_GRA }, // 12 - { "bd-10.9a", 0x10000, 0xfc33ccc6, 5 | BRF_GRA }, // 13 - { "bd-09.8a", 0x10000, 0xf449de01, 5 | BRF_GRA }, // 14 - - { "bd01.8j", 0x00100, 0x29b459e5, 6 | BRF_OPT }, // 15 - Proms (not used) - { "bd02.9j", 0x00100, 0x8b741e66, 6 | BRF_OPT }, // 16 - { "bd03.11k", 0x00100, 0x27201c75, 6 | BRF_OPT }, // 17 - { "bd04.11l", 0x00100, 0xe5490b68, 6 | BRF_OPT }, // 18 -}; - -STD_ROM_PICK(blktigerb2) -STD_ROM_FN(blktigerb2) - -struct BurnDriver BurnDrvblktigerb2 = { - "blktigerb2", "blktiger", NULL, NULL, "1987", - "Black Tiger (bootleg set 2)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, blktigerb2RomInfo, blktigerb2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Black Tiger / Black Dragon (mixed bootleg?) - -static struct BurnRomInfo blktigerb3RomDesc[] = { - { "1.5e", 0x08000, 0x47e2b21e, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "2.6e", 0x10000, 0x7bef96e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.8e", 0x10000, 0x52c56ed1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.9e", 0x10000, 0xed6af6ec, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.10e", 0x10000, 0xae59b72e, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "6.1l", 0x08000, 0x6dfab115, 2 | BRF_PRG | BRF_ESS }, // 5 - Z80 #0 Code - - { "15.2n", 0x08000, 0x3821ab29, 3 | BRF_GRA }, // 6 - Characters - - { "12.5b", 0x10000, 0xc4524993, 4 | BRF_GRA }, // 7 - Background Tiles - { "11.4b", 0x10000, 0x7932c86f, 4 | BRF_GRA }, // 8 - { "14.9b", 0x10000, 0xdc49593a, 4 | BRF_GRA }, // 9 - { "13.8b", 0x10000, 0x7ed7a122, 4 | BRF_GRA }, // 10 - - { "8.5a", 0x10000, 0xe2f17438, 5 | BRF_GRA }, // 11 - Sprites - { "7.4a", 0x10000, 0x5fccbd27, 5 | BRF_GRA }, // 12 - { "10.9a", 0x10000, 0xfc33ccc6, 5 | BRF_GRA }, // 13 - { "9.8a", 0x10000, 0xf449de01, 5 | BRF_GRA }, // 14 - - { "bd01.8j", 0x00100, 0x29b459e5, 6 | BRF_OPT }, // 15 - Proms (not used) - { "bd02.9j", 0x00100, 0x8b741e66, 6 | BRF_OPT }, // 16 - { "bd03.11k", 0x00100, 0x27201c75, 6 | BRF_OPT }, // 17 - { "bd04.11l", 0x00100, 0xe5490b68, 6 | BRF_OPT }, // 18 -}; - -STD_ROM_PICK(blktigerb3) -STD_ROM_FN(blktigerb3) - -static void blktigerb3SoundDecode() -{ - UINT8 *buf = (UINT8*)BurnMalloc(0x8000); - - memcpy (buf, DrvZ80ROM1, 0x8000); - - for (INT32 i = 0; i < 0x8000; i++) - { - DrvZ80ROM1[i] = buf[BITSWAP16(i, 15,14,13,12,11,10,9,8, 3,4,5,6, 7,2,1,0)]; - } - - BurnFree(buf); -} - -static INT32 blktigerb3Init() -{ - INT32 nRet = DrvInit(); - - if (nRet == 0) - { - blktigerb3SoundDecode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvBlktigerb3 = { - "blktigerb3", "blktiger", NULL, NULL, "1987", - "Black Tiger / Black Dragon (mixed bootleg?)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, blktigerb3RomInfo, blktigerb3RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - blktigerb3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Black Dragon (Japan) - -static struct BurnRomInfo blkdrgonRomDesc[] = { - { "bd_01.5e", 0x08000, 0x27ccdfbc, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "bd_02.6e", 0x10000, 0x7d39c26f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bd_03.8e", 0x10000, 0xd1bf3757, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bd_04.9e", 0x10000, 0x4d1d6680, 1 | BRF_PRG | BRF_ESS }, // 3 - { "bd_05.10e", 0x10000, 0xc8d0c45e, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "bd_06.1l", 0x08000, 0x2cf54274, 2 | BRF_PRG | BRF_ESS }, // 5 - Z80 #0 Code - - { "bd_15.2n", 0x08000, 0x3821ab29, 3 | BRF_GRA }, // 6 - Characters - - { "bd_12.5b", 0x10000, 0x22d0a4b0, 4 | BRF_GRA }, // 7 - Background Tiles - { "bd_11.4b", 0x10000, 0xc8b5fc52, 4 | BRF_GRA }, // 8 - { "bd_14.9b", 0x10000, 0x9498c378, 4 | BRF_GRA }, // 9 - { "bd_13.8b", 0x10000, 0x5b0df8ce, 4 | BRF_GRA }, // 10 - - { "bd_08.5a", 0x10000, 0xe2f17438, 5 | BRF_GRA }, // 11 - Sprites - { "bd_07.4a", 0x10000, 0x5fccbd27, 5 | BRF_GRA }, // 12 - { "bd_10.9a", 0x10000, 0xfc33ccc6, 5 | BRF_GRA }, // 13 - { "bd_09.8a", 0x10000, 0xf449de01, 5 | BRF_GRA }, // 14 - - { "bd01.8j", 0x00100, 0x29b459e5, 6 | BRF_OPT }, // 15 - Proms (not used) - { "bd02.9j", 0x00100, 0x8b741e66, 6 | BRF_OPT }, // 16 - { "bd03.11k", 0x00100, 0x27201c75, 6 | BRF_OPT }, // 17 - { "bd04.11l", 0x00100, 0xe5490b68, 6 | BRF_OPT }, // 18 - - { "bd.6k", 0x01000, 0xac7d14f1, 7 | BRF_PRG | BRF_OPT }, // 19 I8751 Mcu Code -}; - -STD_ROM_PICK(blkdrgon) -STD_ROM_FN(blkdrgon) - -struct BurnDriver BurnDrvBlkdrgon = { - "blkdrgon", "blktiger", NULL, NULL, "1987", - "Black Dragon (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, blkdrgonRomInfo, blkdrgonRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Black Dragon (bootleg) - -static struct BurnRomInfo blkdrgonbRomDesc[] = { - { "a1", 0x08000, 0x7caf2ba0, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "blkdrgon.6e", 0x10000, 0x7d39c26f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a3", 0x10000, 0xf4cd0f39, 1 | BRF_PRG | BRF_ESS }, // 2 - { "blkdrgon.9e", 0x10000, 0x4d1d6680, 1 | BRF_PRG | BRF_ESS }, // 3 - { "blkdrgon.10e", 0x10000, 0xc8d0c45e, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "bd-06.1l", 0x08000, 0x2cf54274, 2 | BRF_PRG | BRF_ESS }, // 5 - Z80 #0 Code - - { "b5", 0x08000, 0x852ad2b7, 3 | BRF_GRA }, // 6 - Characters - - { "blkdrgon.5b", 0x10000, 0x22d0a4b0, 4 | BRF_GRA }, // 7 - Background Tiles - { "b1", 0x10000, 0x053ab15c, 4 | BRF_GRA }, // 8 - { "blkdrgon.9b", 0x10000, 0x9498c378, 4 | BRF_GRA }, // 9 - { "b3", 0x10000, 0x9dc6e943, 4 | BRF_GRA }, // 10 - - { "bd-08.5a", 0x10000, 0xe2f17438, 5 | BRF_GRA }, // 11 - Sprites - { "bd-07.4a", 0x10000, 0x5fccbd27, 5 | BRF_GRA }, // 12 - { "bd-10.9a", 0x10000, 0xfc33ccc6, 5 | BRF_GRA }, // 13 - { "bd-09.8a", 0x10000, 0xf449de01, 5 | BRF_GRA }, // 14 - - { "bd01.8j", 0x00100, 0x29b459e5, 6 | BRF_OPT }, // 15 - Proms (not used) - { "bd02.9j", 0x00100, 0x8b741e66, 6 | BRF_OPT }, // 16 - { "bd03.11k", 0x00100, 0x27201c75, 6 | BRF_OPT }, // 17 - { "bd04.11l", 0x00100, 0xe5490b68, 6 | BRF_OPT }, // 18 -}; - -STD_ROM_PICK(blkdrgonb) -STD_ROM_FN(blkdrgonb) - -struct BurnDriver BurnDrvBlkdrgonb = { - "blkdrgonb", "blktiger", NULL, NULL, "1987", - "Black Dragon (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, blkdrgonbRomInfo, blkdrgonbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_blockout.cpp b/jan/src/burn/drv/pre90s/d_blockout.cpp deleted file mode 100644 index 10834ea20..000000000 --- a/jan/src/burn/drv/pre90s/d_blockout.cpp +++ /dev/null @@ -1,749 +0,0 @@ -// FB Alpha Block Out driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *Drv68KRAM2; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT16*DrvTmpBmp; -static UINT32 *DrvPalette; - -static UINT8 *soundlatch; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy5[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[5]; - -static struct BurnInputInfo BlockoutInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy3 + 1, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy3 + 2, "p2 coin" }, - {"Coin 3", BIT_DIGITAL, DrvJoy3 + 3, "p3 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy5 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 4"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy5 + 7, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Blockout) - -static struct BurnInputInfo BlckoutjInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy3 + 1, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy3 + 2, "p2 coin" }, - {"Coin 3", BIT_DIGITAL, DrvJoy3 + 3, "p3 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy5 + 6, "p1 fire 4"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy5 + 7, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Blckoutj) - -static struct BurnDIPInfo BlockoutDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x16, 0x01, 0x03, 0x00, "3 Coins 1 Credits " }, - {0x16, 0x01, 0x03, 0x01, "2 Coins 1 Credits " }, - {0x16, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - {0x16, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "1 Coin to Continue" }, - {0x16, 0x01, 0x10, 0x10, "Off" }, - {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x20, 0x00, "Off" }, - {0x16, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x17, 0x01, 0x03, 0x02, "Easy" }, - {0x17, 0x01, 0x03, 0x03, "Normal" }, - {0x17, 0x01, 0x03, 0x01, "Hard" }, - {0x17, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Rotate Buttons" }, - {0x17, 0x01, 0x04, 0x00, "2" }, - {0x17, 0x01, 0x04, 0x04, "3" }, -}; - -STDDIPINFO(Blockout) - -static struct BurnDIPInfo AgressDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x16, 0x01, 0x03, 0x00, "3 Coins 1 Credits " }, - {0x16, 0x01, 0x03, 0x01, "2 Coins 1 Credits " }, - {0x16, 0x01, 0x03, 0x03, "1 Coin 1 Credits " }, - {0x16, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "Opening Cut" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x20, 0x00, "Off" }, - {0x16, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x17, 0x01, 0x03, 0x02, "Easy" }, - {0x17, 0x01, 0x03, 0x03, "Normal" }, - {0x17, 0x01, 0x03, 0x01, "Hard" }, - {0x17, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Players" }, - {0x17, 0x01, 0x04, 0x04, "1" }, - {0x17, 0x01, 0x04, 0x00, "2" }, -}; - -STDDIPINFO(Agress) - -static void palette_write(INT32 offset) -{ - UINT16 rgb = *((UINT16*)(DrvPalRAM + offset)); - - INT32 bit0,bit1,bit2,bit3; - INT32 r,g,b; - - bit0 = (rgb >> 0) & 0x01; - bit1 = (rgb >> 1) & 0x01; - bit2 = (rgb >> 2) & 0x01; - bit3 = (rgb >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (rgb >> 4) & 0x01; - bit1 = (rgb >> 5) & 0x01; - bit2 = (rgb >> 6) & 0x01; - bit3 = (rgb >> 7) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (rgb >> 8) & 0x01; - bit1 = (rgb >> 9) & 0x01; - bit2 = (rgb >> 10) & 0x01; - bit3 = (rgb >> 11) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -static void update_pixels(INT32 offset) -{ - INT32 x = (offset & 0xff); - INT32 y = (offset >> 8) & 0xff; - if (x >= 320 || y < 8 || y > 247) return; - - UINT16 *src = (UINT16*)DrvVidRAM0 + ((y << 8) | x); - UINT16 *dst = DrvTmpBmp + (y-8) * 320 + x * 2; - - INT32 front = src[0x00000]; - INT32 back = src[0x10000]; - - if (front >> 8) dst[0] = front >> 8; - else dst[0] = (back >> 8) | 0x100; - - if (front & 0xff) dst[1] = front & 0xff; - else dst[1] = (back & 0xff) | 0x100; -} - -void __fastcall blockout_write_byte(UINT32 address, UINT8 data) -{ - if (address >= 0x180000 && address <= 0x1bffff) { - address = (address & 0x3ffff) ^ 1; - DrvVidRAM0[address] = data; - update_pixels(address>>1); - return; - } - - switch (address ^ 1) - { - case 0x100014: - *soundlatch = data & 0xff; - ZetNmi(); - return; - } - - return; -} - -void __fastcall blockout_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0x280200 && address <= 0x2805ff) { - *((UINT16*)(DrvPalRAM + (address - 0x280200))) = data; - palette_write(address & 0x3fe); - return; - } - - if (address >= 0x180000 && address <= 0x1bffff) { - address &= 0x3fffe; - *((UINT16*)(DrvVidRAM0 + address)) = data; - update_pixels(address>>1); - return; - } - - switch (address) - { - case 0x100014: - *soundlatch = data & 0xff; - ZetNmi(); - return; - - case 0x280002: // front color - *((UINT16*)(DrvPalRAM + 0x400)) = data; - palette_write(0x400); - return; - } - - return; -} - -UINT8 __fastcall blockout_read_byte(UINT32 address) -{ - switch (address^1) - { - case 0x100000: - return DrvInputs[0]; - - case 0x100002: - return DrvInputs[1]; - - case 0x100004: - return DrvInputs[2] & 0x0e; - - case 0x100006: - return DrvDips[0]; - - case 0x100008: - return ((DrvDips[1] & 0x3f) | (DrvInputs[4] & 0xc0)); - } - - return 0; -} - -UINT16 __fastcall blockout_read_word(UINT32 address) -{ - switch (address) - { - case 0x100000: - return DrvInputs[0]; - - case 0x100002: - return DrvInputs[1]; - - case 0x100004: - return DrvInputs[2] & 0x0e; - - case 0x100006: - return DrvDips[0]; - - case 0x100008: - return ((DrvDips[1] & 0x3f) | (DrvInputs[4] & 0xc0)); - } - - return 0; -} - -void __fastcall blockout_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8800: - BurnYM2151SelectRegister(data); - return; - - case 0x8801: - BurnYM2151WriteRegister(data); - return; - - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall blockout_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8801: - return BurnYM2151ReadStatus(); - - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - return *soundlatch; - } - - return 0; -} - -void BlockoutYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x008000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0201 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x00c000; - Drv68KRAM1 = Next; Next += 0x00c000; - Drv68KRAM2 = Next; Next += 0x018000; - DrvVidRAM0 = Next; Next += 0x040000; - DrvVidRAM1 = Next; Next += 0x008000; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - DrvTmpBmp = (UINT16*)Next; Next += (320 * 240) * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.0); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 3, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvVidRAM0, 0x180000, 0x1bffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x1d4000, 0x1dffff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x1f4000, 0x1fffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x200000, 0x207fff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x208000, 0x21ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x280200, 0x2805ff, MAP_ROM); // maps 280000 - 2707ff - SekSetWriteByteHandler(0, blockout_write_byte); - SekSetWriteWordHandler(0, blockout_write_word); - SekSetReadByteHandler(0, blockout_read_byte); - SekSetReadWordHandler(0, blockout_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(blockout_sound_write); - ZetSetReadHandler(blockout_sound_read); - ZetClose(); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&BlockoutYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.60, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.60, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - BurnYM2151Exit(); - - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x402; i+=2) { - palette_write(i); - } - } - - memcpy (pTransDraw, DrvTmpBmp, 320 * 240 * sizeof(UINT16)); - - { - UINT16 *vram = (UINT16*)DrvVidRAM1; - - for (INT32 y = 0; y < 240;y++) - { - for (INT32 x = 0; x < 320; x+=8) - { - INT32 d = vram[((y + 8) << 6) + (x >> 3)]; - - if (d) { - for (INT32 v = 0x80, c = 0; v > 0; v >>= 1, c++) - if (d & v) pTransDraw[(y * 320) + x + c] = 512; - } - } - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - INT32 nTotalCycles[2] = { 10000000 / 58, 3579545 / 58 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - - nSegment = nTotalCycles[0] / nInterleave; - - SekRun(nSegment); - - nSegment = nTotalCycles[1] / nInterleave; - - ZetRun(nSegment); - nSegment = nBurnSoundLen / nInterleave; - - if (pBurnSoundOut) { - INT16 *pSoundBuf = pBurnSoundOut + nSoundBufferPos * 2; - BurnYM2151Render(pSoundBuf, nSegment); - MSM6295Render(0, pSoundBuf, nSegment); - nSoundBufferPos += nSegment; - } - - if (i == (nInterleave / 2)-1) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - - if (pBurnSoundOut) { - INT16 *pSoundBuf = pBurnSoundOut + nSoundBufferPos * 2; - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment) { - BurnYM2151Render(pSoundBuf, nSegment); - MSM6295Render(0, pSoundBuf, nSegment); - } - } - - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - } - - return 0; -} - - -// Block Out (set 1) - -static struct BurnRomInfo blockoutRomDesc[] = { - { "bo29a0-2.bin", 0x20000, 0xb0103427, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bo29a1-2.bin", 0x20000, 0x5984d5a2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bo29e3-0.bin", 0x08000, 0x3ea01f78, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bo29e2-0.bin", 0x20000, 0x15c5a99d, 3 | BRF_SND }, // 3 Samples - - { "mb7114h.25", 0x00100, 0xb25bbda7, 0 | BRF_OPT }, // 4 Unused Prom -}; - -STD_ROM_PICK(blockout) -STD_ROM_FN(blockout) - -struct BurnDriver BurnDrvBlockout = { - "blockout", NULL, NULL, NULL, "1989", - "Block Out (set 1)\0", NULL, "Technos + California Dreams", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TECHNOS, GBF_PUZZLE, 0, - NULL, blockoutRomInfo, blockoutRomName, NULL, NULL, BlockoutInputInfo, BlockoutDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x201, - 320, 240, 4, 3 -}; - - -// Block Out (set 2) - -static struct BurnRomInfo blckout2RomDesc[] = { - { "29a0", 0x20000, 0x605f931e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "29a1", 0x20000, 0x38f07000, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bo29e3-0.bin", 0x08000, 0x3ea01f78, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bo29e2-0.bin", 0x20000, 0x15c5a99d, 3 | BRF_SND }, // 3 Samples - - { "mb7114h.25", 0x00100, 0xb25bbda7, 0 | BRF_OPT }, // 4 Unused Prom -}; - -STD_ROM_PICK(blckout2) -STD_ROM_FN(blckout2) - -struct BurnDriver BurnDrvBlckout2 = { - "blockout2", "blockout", NULL, NULL, "1989", - "Block Out (set 2)\0", NULL, "Technos + California Dreams", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_PUZZLE, 0, - NULL, blckout2RomInfo, blckout2RomName, NULL, NULL, BlockoutInputInfo, BlockoutDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x201, - 320, 240, 4, 3 -}; - - -// Block Out (Japan) - -static struct BurnRomInfo blckoutjRomDesc[] = { - { "2.bin", 0x20000, 0xe16cf065, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "1.bin", 0x20000, 0x950b28a3, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bo29e3-0.bin", 0x08000, 0x3ea01f78, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bo29e2-0.bin", 0x20000, 0x15c5a99d, 3 | BRF_SND }, // 3 Samples - - { "mb7114h.25", 0x00100, 0xb25bbda7, 0 | BRF_OPT }, // 4 Unused Prom -}; - -STD_ROM_PICK(blckoutj) -STD_ROM_FN(blckoutj) - -struct BurnDriver BurnDrvBlckoutj = { - "blockoutj", "blockout", NULL, NULL, "1989", - "Block Out (Japan)\0", NULL, "Technos + California Dreams", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_PUZZLE, 0, - NULL, blckoutjRomInfo, blckoutjRomName, NULL, NULL, BlckoutjInputInfo, BlockoutDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x201, - 320, 240, 4, 3 -}; - - -// Agress - -static struct BurnRomInfo agressRomDesc[] = { - { "palco1.81", 0x20000, 0x3acc917a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "palco2.91", 0x20000, 0xabfd5bcc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "palco3.73", 0x08000, 0x2a21c97d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "palco4.78", 0x20000, 0x9dfd9cfe, 3 | BRF_SND }, // 3 Samples - - { "82s129pr.25", 0x00100, 0xb25bbda7, 0 | BRF_OPT }, // 4 Unused Prom -}; - -STD_ROM_PICK(agress) -STD_ROM_FN(agress) - -struct BurnDriver BurnDrvAgress = { - "agress", NULL, NULL, NULL, "1991", - "Agress\0", NULL, "Palco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TECHNOS, GBF_PUZZLE, 0, - NULL, agressRomInfo, agressRomName, NULL, NULL, BlockoutInputInfo, AgressDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x201, - 320, 240, 4, 3 -}; - - -// Agress (English bootleg) - -static struct BurnRomInfo agressbRomDesc[] = { - { "palco1.ic81", 0x20000, 0xa1875175, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "palco2.ic91", 0x20000, 0xab3182c3, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "palco3.ic73", 0x08000, 0x2a21c97d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "palco4.ic78", 0x20000, 0x9dfd9cfe, 3 | BRF_SND }, // 3 Samples - - { "prom29-mb7114h.ic25", 0x00100, 0xb25bbda7, 0 | BRF_OPT }, // 4 Unused Prom -}; - -STD_ROM_PICK(agressb) -STD_ROM_FN(agressb) - -struct BurnDriver BurnDrvAgressb = { - "agressb", "agress", NULL, NULL, "2003", - "Agress (English bootleg)\0", NULL, "Palco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_PUZZLE, 0, - NULL, agressbRomInfo, agressbRomName, NULL, NULL, BlockoutInputInfo, AgressDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x201, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_blueprnt.cpp b/jan/src/burn/drv/pre90s/d_blueprnt.cpp deleted file mode 100644 index a9ba6e82d..000000000 --- a/jan/src/burn/drv/pre90s/d_blueprnt.cpp +++ /dev/null @@ -1,838 +0,0 @@ -// FB Alpha Blue Print driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *RamEnd; -static UINT8 *AllRam; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvScrollRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT32 *DrvPalette; -static INT16 *pAY8910Buffer[6]; - -static UINT8 *watchdog; -static UINT8 *dipsw; -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *gfx_bank; - -static UINT8 Grasspin; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; - -static UINT8 DrvRecalc; - -static struct BurnInputInfo BlueprntInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 2, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Blueprnt) - -static struct BurnDIPInfo BlueprntDIPList[]= -{ - {0x11, 0xff, 0xff, 0xc3, NULL }, - {0x12, 0xff, 0xff, 0xd5, NULL }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x06, 0x00, "20K" }, - {0x11, 0x01, 0x06, 0x02, "30K" }, - {0x11, 0x01, 0x06, 0x04, "40K" }, - {0x11, 0x01, 0x06, 0x06, "50K" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Maze Monster Appears In" }, - {0x11, 0x01, 0x10, 0x00, "2nd Maze" }, - {0x11, 0x01, 0x10, 0x10, "3rd Maze" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x11, 0x01, 0x20, 0x20, "2 Coins 1 Credits " }, - {0x11, 0x01, 0x20, 0x00, "1 Coin 1 Credits " }, - - {0 , 0xfe, 0 , 2, "Coin B" }, - {0x11, 0x01, 0x40, 0x40, "1 Coin 3 Credits " }, - {0x11, 0x01, 0x40, 0x00, "1 Coin 5 Credits " }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "2" }, - {0x12, 0x01, 0x03, 0x01, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x08, 0x00, "Upright" }, - {0x12, 0x01, 0x08, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x00, "Level 1" }, - {0x12, 0x01, 0x30, 0x10, "Level 2" }, - {0x12, 0x01, 0x30, 0x20, "Level 3" }, - {0x12, 0x01, 0x30, 0x30, "Level 4" }, -}; - -STDDIPINFO(Blueprnt) - -static struct BurnInputInfo SaturnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Saturn) - -static struct BurnDIPInfo SaturnDIPList[]= -{ - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x04, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x02, 0x00, "Upright" }, - {0x11, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0x00, "3" }, - {0x11, 0x01, 0xc0, 0x40, "4" }, - {0x11, 0x01, 0xc0, 0x80, "5" }, - {0x11, 0x01, 0xc0, 0xc0, "6" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x12, 0x01, 0x02, 0x02, "A 2/1 B 1/3" }, - {0x12, 0x01, 0x02, 0x00, "A 1/1 B 1/6" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, -}; - -STDDIPINFO(Saturn) - -static struct BurnInputInfo GrasspinInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Grasspin) - - -static struct BurnDIPInfo GrasspinDIPList[]= -{ - {0x11, 0xff, 0xff, 0x61, NULL }, - {0x12, 0xff, 0xff, 0x83, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x60, 0x00, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x60, 0x40, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x60, 0x60, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x60, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x20, 0x00, "Upright" }, - {0x12, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Grasspin) - -void __fastcall blueprint_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xd000: - { - *soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xe000: - { - *flipscreen = ~data & 2; - *gfx_bank = ((data & 0x04) >> 2); //(data >> 2) & 1; - } - - return; - } -} - -UINT8 __fastcall blueprint_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - return DrvInputs[address & 1]; - - case 0xc003: - return (Grasspin) ? (*dipsw & 0x7f) | 0x80 : *dipsw; - - case 0xe000: - *watchdog = 0; - return 0; - } - - return 0; -} - -void __fastcall blueprint_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x6000: - AY8910Write(0, 0, data); - return; - - case 0x6001: - AY8910Write(0, 1, data); - return; - - case 0x8000: - AY8910Write(1, 0, data); - return; - - case 0x8001: - AY8910Write(1, 1, data); - return; - } -} - -UINT8 __fastcall blueprint_sound_read(UINT16 address) -{ - switch (address) - { - case 0x6002: - return AY8910Read(0); - - case 0x8002: - return AY8910Read(1); - } - - return 0; -} - -UINT8 ay8910_0_read_port_1(UINT32) -{ - return *soundlatch; -} - -void ay8910_0_write_port_0(UINT32, UINT32 data) -{ - *dipsw = data & 0xff; -} - -UINT8 ay8910_1_read_port_0(UINT32) -{ - return DrvDips[0]; -} - -UINT8 ay8910_1_read_port_1(UINT32) -{ - return DrvDips[1]; -} - -static void palette_init() -{ - for (INT32 i = 0; i < 512 + 8; i++) - { - UINT8 pen; - - if (i < 0x200) - pen = ((i & 0x100) >> 5) | ((i & 0x002) ? ((i & 0x0e0) >> 5) : 0) | ((i & 0x001) ? ((i & 0x01c) >> 2) : 0); - else - pen = i - 0x200; - - INT32 r = ((pen >> 0) & 1) * (((pen & 8) >> 1) ^ 0xff); - INT32 g = ((pen >> 2) & 1) * (((pen & 8) >> 1) ^ 0xff); - INT32 b = ((pen >> 1) & 1) * (((pen & 8) >> 1) ^ 0xff); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { (0x1000 * 8) * 2, (0x1000 * 8) * 1, (0x1000 * 8) * 0 }; - INT32 XOffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x03000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x02000); - - GfxDecode(0x0200, 2, 8, 8, Plane + 1, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x03000); - - GfxDecode(0x0100, 3, 8, 16, Plane + 0, XOffs, YOffs, 0x080, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x008000; - - DrvPalette = (UINT32*)Next; Next += 0x0208 * sizeof(UINT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - AllRam = Next; - - DrvColRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvScrollRAM = Next; Next += 0x000100; - DrvSprRAM = Next; Next += 0x000100; - - DrvZ80RAM0 = Next; Next += 0x000800; - DrvZ80RAM1 = Next; Next += 0x000800; - - dipsw = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - gfx_bank = Next; Next += 0x000001; - watchdog = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - INT32 lofst = 0; - - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x3000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x4000, 4, 1)) return 1; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "saturnzi")) { - if (BurnLoadRom(DrvZ80ROM0 + 0x5000, 5, 1)) return 1; - lofst = 1; - } - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 5+lofst, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x2000, 6+lofst, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 7+lofst, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 8+lofst, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 9+lofst, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 10+lofst,1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 11+lofst,1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM0); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM0); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM0); - ZetMapArea(0x9000, 0x93ff, 0, DrvVidRAM); - ZetMapArea(0x9000, 0x93ff, 1, DrvVidRAM); - ZetMapArea(0x9000, 0x93ff, 2, DrvVidRAM); - ZetMapArea(0x9400, 0x97ff, 0, DrvVidRAM); - ZetMapArea(0x9400, 0x97ff, 1, DrvVidRAM); - ZetMapArea(0x9400, 0x97ff, 2, DrvVidRAM); - ZetMapArea(0xa000, 0xa0ff, 0, DrvScrollRAM); - ZetMapArea(0xa000, 0xa0ff, 1, DrvScrollRAM); - ZetMapArea(0xa000, 0xa0ff, 2, DrvScrollRAM); - ZetMapArea(0xb000, 0xb0ff, 0, DrvSprRAM); - ZetMapArea(0xb000, 0xb0ff, 1, DrvSprRAM); - ZetMapArea(0xb000, 0xb0ff, 2, DrvSprRAM); - ZetMapArea(0xf000, 0xf3ff, 0, DrvColRAM); - ZetMapArea(0xf000, 0xf3ff, 1, DrvColRAM); - ZetMapArea(0xf000, 0xf3ff, 2, DrvColRAM); - ZetSetWriteHandler(blueprint_write); - ZetSetReadHandler(blueprint_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x2fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x2fff, 2, DrvZ80ROM1); - ZetMapArea(0x4000, 0x43ff, 0, DrvZ80RAM1); - ZetMapArea(0x4000, 0x43ff, 1, DrvZ80RAM1); - ZetMapArea(0x4000, 0x43ff, 2, DrvZ80RAM1); - ZetSetWriteHandler(blueprint_sound_write); - ZetSetReadHandler(blueprint_sound_read); - ZetClose(); - - AY8910Init(0, 1250000, nBurnSoundRate, NULL, &ay8910_0_read_port_1, &ay8910_0_write_port_0, NULL); - AY8910Init(1, 625000, nBurnSoundRate, &ay8910_1_read_port_0, &ay8910_1_read_port_1, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - Grasspin = 0; - - return 0; -} - -static void draw_layer(INT32 prio) -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 attr = DrvColRAM[offs]; - if ((attr >> 7) != prio) continue; - INT32 bank = (*flipscreen) ? DrvColRAM[(offs+32)&0x3ff] & 0x40 : DrvColRAM[(offs-32)&0x3ff] & 0x40; - INT32 code = DrvVidRAM[offs]; - if (bank) code += *gfx_bank << 8; - INT32 color = attr & 0x7f; - - INT32 sx = (~offs & 0x3e0) >> 2; - INT32 sy = (offs & 0x1f) << 3; - - sy -= DrvScrollRAM[(30 + *flipscreen) - (sx >> 3)]; - if (sy < -7) sy += 0x100; - - if (*flipscreen) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx ^ 0xf8, (248 - sy) - 16, color, 2, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM0); - } - } -} - -static void draw_8x16_tile(INT32 code, INT32 sx, INT32 sy, INT32 fx, INT32 fy) -{ - UINT8 *src = DrvGfxROM1 + (code << 7); - - for (INT32 y = 0; y < 16; y++) - { - INT32 yy = sy + y; - - for (INT32 x = 0; x < 8; x++) - { - INT32 xx = sx + x; - INT32 d = src[((y ^ fy) << 3) | (x ^ fx)]; - - if (yy < 0 || xx < 0 || yy >= nScreenHeight || xx >= nScreenWidth || !d) continue; - - pTransDraw[(yy * nScreenWidth) + xx] = d | 0x200; - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - INT32 code = DrvSprRAM[offs + 1]; - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = 240 - DrvSprRAM[offs]; - INT32 flipx = (DrvSprRAM[offs + 2] >> 6) & 1; - INT32 flipy = (DrvSprRAM[offs + 2 - 4] >> 7) & 1; - - if (*flipscreen) - { - sx = 248 - sx; - sy = 240 - sy; - flipx ^= 1; - flipy ^= 1; - } - - draw_8x16_tile(code, sx+2, sy-17, flipx * 0x07, flipy * 0x0f); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - palette_init(); - DrvRecalc = 0; - } - - memset (pTransDraw, 0, nScreenWidth * nScreenHeight * 2); - - draw_layer(0); - draw_sprites(); - draw_layer(1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - if (*watchdog > 180) { - DrvDoReset(); - } - - *watchdog = *watchdog + 1; - } - - { - DrvInputs[0] = DrvInputs[1] = 0; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] |= (DrvJoy1[i] & 1) << i; - DrvInputs[1] |= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nTotalCycles[2] = { 3500000 / 60, 1250000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i); - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == 255) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - nSegment = (nTotalCycles[1] - nCyclesDone[1]) / (nInterleave - i); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment); - if ((i & 0x3f) == 0x3f) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - } - - return 0; -} - - -// Blue Print (Midway) - -static struct BurnRomInfo blueprntRomDesc[] = { - { "bp-1.1m", 0x1000, 0xb20069a6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "bp-2.1n", 0x1000, 0x4a30302e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bp-3.1p", 0x1000, 0x6866ca07, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bp-4.1r", 0x1000, 0x5d3cfac3, 1 | BRF_PRG | BRF_ESS }, // 3 - { "bp-5.1s", 0x1000, 0xa556cac4, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "snd-1.3u", 0x1000, 0xfd38777a, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "snd-2.3v", 0x1000, 0x33d5bf5b, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "bg-1.3c", 0x1000, 0xac2a61bc, 3 | BRF_GRA }, // 7 Background Tiles - { "bg-2.3d", 0x1000, 0x81fe85d7, 3 | BRF_GRA }, // 8 - - { "red.17d", 0x1000, 0xa73b6483, 4 | BRF_GRA }, // 9 Sprites - { "blue.18d", 0x1000, 0x7d622550, 4 | BRF_GRA }, // 10 - { "green.20d", 0x1000, 0x2fcb4f26, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(blueprnt) -STD_ROM_FN(blueprnt) - -struct BurnDriver BurnDrvBlueprnt = { - "blueprnt", NULL, NULL, NULL, "1982", - "Blue Print (Midway)\0", NULL, "[Zilec Electronics] Bally Midway", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, blueprntRomInfo, blueprntRomName, NULL, NULL, BlueprntInputInfo, BlueprntDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x208, - 224, 256, 3, 4 -}; - - -// Blue Print (Jaleco) - -static struct BurnRomInfo blueprnjRomDesc[] = { - { "bp-1j.1m", 0x1000, 0x2e746693, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "bp-2j.1n", 0x1000, 0xa0eb0b8e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bp-3j.1p", 0x1000, 0xc34981bb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bp-4j.1r", 0x1000, 0x525e77b5, 1 | BRF_PRG | BRF_ESS }, // 3 - { "bp-5j.1s", 0x1000, 0x431a015f, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "snd-1.3u", 0x1000, 0xfd38777a, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - { "snd-2.3v", 0x1000, 0x33d5bf5b, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "bg-1j.3c", 0x0800, 0x43718c34, 3 | BRF_GRA }, // 7 Background Tiles - { "bg-2j.3d", 0x0800, 0xd3ce077d, 3 | BRF_GRA }, // 8 - - { "redj.17d", 0x1000, 0x83da108f, 4 | BRF_GRA }, // 9 Sprites - { "bluej.18d", 0x1000, 0xb440f32f, 4 | BRF_GRA }, // 10 - { "greenj.20d", 0x1000, 0x23026765, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(blueprnj) -STD_ROM_FN(blueprnj) - -struct BurnDriver BurnDrvBlueprnj = { - "blueprntj", "blueprnt", NULL, NULL, "1982", - "Blue Print (Jaleco)\0", NULL, "[Zilec Electronics] Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, blueprnjRomInfo, blueprnjRomName, NULL, NULL, BlueprntInputInfo, BlueprntDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x208, - 224, 256, 3, 4 -}; - - -// Saturn - -static struct BurnRomInfo saturnziRomDesc[] = { - { "r1", 0x1000, 0x18a6d68e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "r2", 0x1000, 0xa7dd2665, 1 | BRF_PRG | BRF_ESS }, // 1 - { "r3", 0x1000, 0xb9cfa791, 1 | BRF_PRG | BRF_ESS }, // 2 - { "r4", 0x1000, 0xc5a997e7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "r5", 0x1000, 0x43444d00, 1 | BRF_PRG | BRF_ESS }, // 4 - { "r6", 0x1000, 0x4d4821f6, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "r7", 0x1000, 0xdd43e02f, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - { "r8", 0x1000, 0x7f9d0877, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "r10", 0x1000, 0x35987d61, 3 | BRF_GRA }, // 8 Background Tiles - { "r9", 0x1000, 0xca6a7fda, 3 | BRF_GRA }, // 9 - - { "r11", 0x1000, 0x6e4e6e5d, 4 | BRF_GRA }, // 10 Sprites - { "r12", 0x1000, 0x46fc049e, 4 | BRF_GRA }, // 11 - { "r13", 0x1000, 0x8b3e8c32, 4 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(saturnzi) -STD_ROM_FN(saturnzi) - -struct BurnDriver BurnDrvSaturnzi = { - "saturnzi", NULL, NULL, NULL, "1983", - "Saturn\0", NULL, "[Zilec Electronics] Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, saturnziRomInfo, saturnziRomName, NULL, NULL, SaturnInputInfo, SaturnDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x208, - 224, 256, 3, 4 -}; - - -// Grasspin - -static struct BurnRomInfo grasspinRomDesc[] = { - { "prom_1.4b", 0x1000, 0x6fd50509, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code (maincpu) - { "jaleco-2.4c", 0x1000, 0xcd319007, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jaleco-3.4d", 0x1000, 0xac73ccc2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jaleco-4.4f", 0x1000, 0x41f6279d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jaleco-5.4h", 0x1000, 0xd20aead9, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "jaleco-6.4j", 0x1000, 0xf58bf3b0, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 Code (audiocpu) - { "jaleco-7.4l", 0x1000, 0x2d587653, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "jaleco-9.4p", 0x1000, 0xbccca24c, 3 | BRF_GRA }, // 7 Background Tiles - { "jaleco-8.3p", 0x1000, 0x9d6185ca, 3 | BRF_GRA }, // 8 - - { "jaleco-10.5p", 0x1000, 0x3a0765c6, 4 | BRF_GRA }, // 9 Sprites - { "jaleco-11.6p", 0x1000, 0xcccfbeb4, 4 | BRF_GRA }, // 10 - { "jaleco-12.7p", 0x1000, 0x615b3299, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(grasspin) -STD_ROM_FN(grasspin) - -static INT32 GrasspinInit() -{ - Grasspin = 1; - return DrvInit(); -} - -struct BurnDriver BurnDrvGrasspin = { - "grasspin", NULL, NULL, NULL, "1983", - "Grasspin\0", NULL, "[Zilec Electronics] Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, grasspinRomInfo, grasspinRomName, NULL, NULL, GrasspinInputInfo, GrasspinDIPInfo, - GrasspinInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_bogeyman.cpp b/jan/src/burn/drv/pre90s/d_bogeyman.cpp deleted file mode 100644 index 34846efc6..000000000 --- a/jan/src/burn/drv/pre90s/d_bogeyman.cpp +++ /dev/null @@ -1,612 +0,0 @@ -// FB Alpha Bogey Manor Driver Module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6502ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvM6502RAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 color_bank; -static UINT8 flipscreen; -static UINT8 ay8910_last; -static UINT8 ay8910_psg_latch; - -static INT32 vblank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo BogeymanInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bogeyman) - -static struct BurnDIPInfo BogeymanDIPList[]= -{ - {0x12, 0xff, 0xff, 0xdf, NULL }, - {0x13, 0xff, 0xff, 0x0f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - // flip screen not fully supported - {0 , 0xfe, 0 , 1, "Cabinet" }, - {0x12, 0x01, 0x20, 0x00, "Upright" }, -// {0x12, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x80, 0x00, "No" }, - {0x12, 0x01, 0x80, 0x80, "Yes" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x01, 0x01, "3" }, - {0x13, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x13, 0x01, 0x02, 0x02, "50K" }, - {0x13, 0x01, 0x02, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, -}; - -STDDIPINFO(Bogeyman) - -static void bogeyman_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3800: - { - flipscreen = data & 0x01; - - if ((ay8910_last & 0x20) == 0x20 && (data & 0x20) == 0) { - AY8910Write(0, (ay8910_last & 0x10) ? 0 : 1, ay8910_psg_latch); - } - - if ((ay8910_last & 0x80) == 0x80 && (data & 0x80) == 0) { - AY8910Write(1, (ay8910_last & 0x40) ? 0 : 1, ay8910_psg_latch); - } - - ay8910_last = data; - } - return; - - case 0x3801: - ay8910_psg_latch = data; - return; - - case 0x3803: - return; //nop - } -} - -static UINT8 bogeyman_read(UINT16 address) -{ - switch (address) - { - case 0x3800: - return DrvInputs[0]; - - case 0x3801: - return (DrvInputs[1] & 0x7f) | (vblank ? 0x80 : 0); - - case 0x3802: - return DrvDips[0]; - - case 0x3803: - return (DrvDips[1] & 0xf) | (DrvInputs[2] & 0xf0); - } - - return 0; -} - -static void color_bank_write(UINT32, UINT32 data) -{ - color_bank = data & 0x01; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - AY8910Reset(0); - AY8910Reset(1); - - ay8910_last = 0; - ay8910_psg_latch = 0; - color_bank = 0; - flipscreen = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6502ROM = Next; Next += 0x00c000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x0110 * sizeof(UINT32); - - AllRam = Next; - - DrvM6502RAM = Next; Next += 0x001800; - DrvFgRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x000200; - DrvPalRAM = Next; Next += 0x000100; - DrvSprRAM = Next; Next += 0x000400; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { 0x8000*8+4, 0, 4 }; - INT32 Plane1[3] = { 0x8000*8+0, 0x1000*8+0, 0x1000*8+4 }; - INT32 Plane2[3] = { 0x8000*8, 0x4000*8, 0 }; - INT32 XOffs0[8] = { STEP4(0x2000*8+3, -1), STEP4(3,-1) }; - INT32 YOffs0[16] = { STEP16(0,8) }; - INT32 XOffs2[16] = { STEP8(16*8,1), STEP8(0,1) }; - INT32 YOffs2[16] = { STEP16(0,8) }; - INT32 XOffs3[16] = { STEP4(1024*8*8+3, -1), STEP4(3,-1), STEP4(1024*8*8+3+64, -1), STEP4(3+64,-1) }; - INT32 YOffs3[16] = { STEP8(0,8), STEP8(128, 8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x10000); - - GfxDecode(0x0200, 3, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp + 0x0000, DrvGfxROM0 + 0x00000); - GfxDecode(0x0200, 3, 8, 8, Plane1, XOffs0, YOffs0, 0x040, tmp + 0x0000, DrvGfxROM0 + 0x08000); - - memcpy (tmp, DrvGfxROM1, 0x10000); - - GfxDecode(0x0200, 3, 16, 16, Plane2, XOffs2, YOffs2, 0x100, tmp + 0x0000, DrvGfxROM1 + 0x00000); - - memcpy (tmp, DrvGfxROM2, 0x10000); - - GfxDecode(0x0080, 3, 16, 16, Plane0, XOffs3, YOffs3, 0x100, tmp + 0x0000, DrvGfxROM2 + 0x00000); - GfxDecode(0x0080, 3, 16, 16, Plane1, XOffs3, YOffs3, 0x100, tmp + 0x0000, DrvGfxROM2 + 0x08000); - GfxDecode(0x0080, 3, 16, 16, Plane0, XOffs3, YOffs3, 0x100, tmp + 0x4000, DrvGfxROM2 + 0x10000); - GfxDecode(0x0080, 3, 16, 16, Plane1, XOffs3, YOffs3, 0x100, tmp + 0x4000, DrvGfxROM2 + 0x18000); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6502ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 4, 1)) return 1; - memcpy (DrvGfxROM0 + 0xa000, DrvGfxROM0 + 0x9000, 0x1000); - memset (DrvGfxROM0 + 0x9000, 0, 0x1000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 9, 1)) return 1; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (BurnLoadRom(tmp, 10, 1)) return 1; - - memcpy (DrvGfxROM2 + 0x8000, tmp + 0x0000, 0x1000); - memcpy (DrvGfxROM2 + 0xa000, tmp + 0x1000, 0x1000); - memcpy (DrvGfxROM2 + 0xc000, tmp + 0x2000, 0x1000); - memcpy (DrvGfxROM2 + 0xe000, tmp + 0x3000, 0x1000); - - BurnFree(tmp); - - if (BurnLoadRom(DrvColPROM + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 12, 1)) return 1; - - DrvGfxDecode(); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x17ff, MAP_RAM); - M6502MapMemory(DrvFgRAM, 0x1800, 0x1fff, MAP_RAM); - M6502MapMemory(DrvBgRAM, 0x2000, 0x21ff, MAP_RAM); - M6502MapMemory(DrvSprRAM, 0x2800, 0x2bff, MAP_RAM); - M6502MapMemory(DrvPalRAM, 0x3000, 0x30ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM, 0x4000, 0xffff, MAP_ROM); - M6502SetWriteHandler(bogeyman_write); - M6502SetReadHandler(bogeyman_read); - M6502Close(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &color_bank_write, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 256; i++) - { - INT32 bit0 = (DrvColPROM[i+0] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i+0] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i+0] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i+0] >> 3) & 0x01; - bit1 = (DrvColPROM[i+256] >> 0) & 0x01; - bit2 = (DrvColPROM[i+256] >> 1) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit1 = (DrvColPROM[i+256] >> 2) & 0x01; - bit2 = (DrvColPROM[i+256] >> 3) & 0x01; - INT32 b = 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i+0x10] = BurnHighCol(r,g,b,0); - } -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 0x10; i++) - { - UINT8 r = (~DrvPalRAM[i] >> 0) & 7; - UINT8 g = (~DrvPalRAM[i] >> 3) & 7; - UINT8 b = (~DrvPalRAM[i] >> 6) & 3; - - r = (r << 5) | (r << 2) | (r >> 1); - g = (g << 5) | (g << 2) | (g >> 1); - b = (b << 6) | (b << 4) | (b << 2) | b; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 16 * 16; offs++) - { - INT32 sx = (offs & 0x0f) * 16; - INT32 sy = (offs / 0x10) * 16; - - INT32 attr = DrvBgRAM[offs+0x100]; - INT32 code = DrvBgRAM[offs] + ((attr & 1) << 8); - - INT32 color = ((attr >> 1) & 7); - - if (sx >= nScreenWidth || sy > nScreenHeight) continue; - - Render16x16Tile_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0x90, DrvGfxROM2); - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < (32 * 32); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvFgRAM[offs+0x400]; - INT32 code = DrvFgRAM[offs] + ((attr & 3) << 8); - - if (sx >= nScreenWidth || sy > nScreenHeight) continue; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color_bank, 3, 0, 16, DrvGfxROM0); - } -} - -static inline void draw_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM1); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 attr = DrvSprRAM[offs]; - - if (attr & 0x01) - { - INT32 code = DrvSprRAM[offs + 1] + ((attr & 0x40) << 2); - INT32 color = (attr & 0x08) >> 3; - INT32 flipx = !(attr & 0x04); - INT32 flipy = attr & 0x02; - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = (240 - DrvSprRAM[offs + 2]) & 0xff; - INT32 multi = attr & 0x10; - - if (multi) sy -= 16; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - draw_sprite(code, color, sx, sy, flipx, flipy); - - if (multi) - { - draw_sprite(code+1, color, sx, sy + (flipscreen ? -16 : 16), flipx, flipy); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - DrvPaletteUpdate(); - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_bg_layer(); - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 4) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 272; - INT32 nCyclesTotal = 1500000 / 60; - INT32 nCyclesDone = 0; - INT32 nSoundBufferPos = 0; - - vblank = 1; - - M6502Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone += M6502Run(nCyclesTotal / nInterleave); - - if (i == 8) vblank = 0; - if (i == 248) vblank = 1; - if ((i & 0x0f) == 0xf) M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - M6502Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029722; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(ay8910_last); - SCAN_VAR(ay8910_psg_latch); - SCAN_VAR(flipscreen); - SCAN_VAR(color_bank); - } - - return 0; -} - - -// Bogey Manor - -static struct BurnRomInfo bogeymanRomDesc[] = { - { "j20.c14", 0x4000, 0xea90d637, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 Code - { "j10.c15", 0x4000, 0x0a8f218d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "j00.c17", 0x4000, 0x5d486de9, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "j70.h15", 0x4000, 0xfdc787bf, 2 | BRF_GRA }, // 3 Foreground Tiles - { "j60.c17", 0x2000, 0xcc03ceb2, 2 | BRF_GRA }, // 4 - - { "j30.c9", 0x4000, 0x41af81c0, 3 | BRF_GRA }, // 5 Sprites - { "j40.c7", 0x4000, 0x8b438421, 3 | BRF_GRA }, // 6 - { "j50.c5", 0x4000, 0xb507157f, 3 | BRF_GRA }, // 7 - - { "j90.h12", 0x4000, 0x46b2d4d0, 4 | BRF_GRA }, // 8 Background Tiles - { "j80.h13", 0x4000, 0x77ebd0a4, 4 | BRF_GRA }, // 9 - { "ja0.h10", 0x4000, 0xf2aa05ed, 4 | BRF_GRA }, // 10 - - { "82s129.5k", 0x0100, 0x4a7c5367, 5 | BRF_GRA }, // 11 Color Data - { "82s129.6k", 0x0100, 0xb6127713, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(bogeyman) -STD_ROM_FN(bogeyman) - -struct BurnDriver BurnDrvBogeyman = { - "bogeyman", NULL, NULL, NULL, "1985", - "Bogey Manor\0", "NULL", "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, bogeymanRomInfo, bogeymanRomName, NULL, NULL, BogeymanInputInfo, BogeymanDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 272, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_bombjack.cpp b/jan/src/burn/drv/pre90s/d_bombjack.cpp deleted file mode 100644 index 6e96eb5ff..000000000 --- a/jan/src/burn/drv/pre90s/d_bombjack.cpp +++ /dev/null @@ -1,987 +0,0 @@ -// FB Alpha Bomb Jack driver moduule -// Based on MAME driver by Mirko Buffoni - -#include "tiles_generic.h" -#include "z80_intf.h" - -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -UINT8 DrvJoy1[7] = {0, 0, 0, 0, 0, 0, 0}; -UINT8 DrvJoy2[7] = {0, 0, 0, 0, 0, 0, 0}; -UINT8 BjDip[2] = {0, 0}; -static UINT8 DrvReset = 0; -static INT32 bombjackIRQ = 0; -static INT32 latch; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *BjGfx = NULL; -static UINT8 *BjMap = NULL; -static UINT8 *BjRom = NULL; -static UINT8 *BjRam = NULL; -static UINT8 *BjColRam = NULL; -static UINT8 *BjVidRam = NULL; -static UINT8 *BjSprRam = NULL; - -// sound cpu -static UINT8 *SndRom = NULL; -static UINT8 *SndRam = NULL; - -// graphics tiles -static UINT8 *text = NULL; -static UINT8 *sprites = NULL; -static UINT8 *tiles = NULL; - -// pallete -static UINT8 *BjPalSrc = NULL; -static UINT32 *BjPalReal = NULL; - -static INT16* pFMBuffer; -static INT16* pAY8910Buffer[9]; - -static UINT8 BjIsBombjackt = 0; - -// Dip Switch and Input Definitions -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p1 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 4, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 6, "p1 fire 1"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy2 + 0, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 1, "p2 start" }, - - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy2 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 4, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 6, "p2 fire 1"}, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip Sw(1)" , BIT_DIPSWITCH, BjDip + 0 , "dip" }, - {"Dip Sw(2)" , BIT_DIPSWITCH, BjDip + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo BjDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xc0, NULL}, - {0x10, 0xff, 0xff, 0x00, NULL}, - - // Dip Sw(1) - {0, 0xfe, 0, 4, "Coin A"}, - {0x0f, 0x01, 0x03, 0x00, "1 coin 1 credit"}, - {0x0f, 0x01, 0x03, 0x01, "1 coin 2 credits"}, - {0x0f, 0x01, 0x03, 0x02, "1 coin 3 credits"}, - {0x0f, 0x01, 0x03, 0x03, "1 coin 6 credits"}, - - {0, 0xfe, 0, 4, "Coin B"}, - {0x0f, 0x01, 0x0c, 0x04, "2 coins 1 credit"}, - {0x0f, 0x01, 0x0c, 0x00, "1 coin 1 credit"}, - {0x0f, 0x01, 0x0c, 0x08, "1 coin 2 credits"}, - {0x0f, 0x01, 0x0c, 0x0c, "1 coin 3 credits"}, - - {0, 0xfe, 0, 4, "Lives"}, - {0x0f, 0x01, 0x30, 0x30, "2"}, - {0x0f, 0x01, 0x30, 0x00, "3"}, - {0x0f, 0x01, 0x30, 0x10, "4"}, - {0x0f, 0x01, 0x30, 0x20, "5"}, - - {0, 0xfe, 0, 2, "Cabinet"}, - {0x0f, 0x01, 0x40, 0x40, "Upright"}, - {0x0f, 0x01, 0x40, 0x00, "Cocktail"}, - - {0, 0xfe, 0, 2, "Demo sounds"}, - {0x0f, 0x01, 0x80, 0x00, "Off"}, - {0x0f, 0x01, 0x80, 0x80, "On"}, - - // Dip Sw(2) - {0, 0xfe, 0, 4, "Initial high score"}, - {0x10, 0x01, 0x07, 0x00, "10000"}, - {0x10, 0x01, 0x07, 0x01, "100000"}, - {0x10, 0x01, 0x07, 0x02, "30000"}, - {0x10, 0x01, 0x07, 0x03, "50000"}, - {0x10, 0x01, 0x07, 0x04, "100000"}, - {0x10, 0x01, 0x07, 0x05, "50000"}, - {0x10, 0x01, 0x07, 0x06, "100000"}, - {0x10, 0x01, 0x07, 0x07, "50000"}, - - {0, 0xfe, 0, 4, "Bird speed"}, - {0x10, 0x01, 0x18, 0x00, "Easy"}, - {0x10, 0x01, 0x18, 0x08, "Medium"}, - {0x10, 0x01, 0x18, 0x10, "Hard"}, - {0x10, 0x01, 0x18, 0x18, "Hardest"}, - - {0, 0xfe, 0, 4, "Enemies number & speed"}, - {0x10, 0x01, 0x60, 0x20, "Easy"}, - {0x10, 0x01, 0x60, 0x00, "Medium"}, - {0x10, 0x01, 0x60, 0x40, "Hard"}, - {0x10, 0x01, 0x60, 0x60, "Hardest"}, - - {0, 0xfe, 0, 2, "Special coin"}, - {0x10, 0x01, 0x80, 0x00, "Easy"}, - {0x10, 0x01, 0x80, 0x80, "Hard"}, -}; - -STDDIPINFO(Bj) - -// Bomb Jack (set 1) -static struct BurnRomInfo BombjackRomDesc[] = { - { "09_j01b.bin", 0x2000, 0xc668dc30, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "10_l01b.bin", 0x2000, 0x52a1e5fb, BRF_ESS | BRF_PRG }, // 1 - { "11_m01b.bin", 0x2000, 0xb68a062a, BRF_ESS | BRF_PRG }, // 2 - { "12_n01b.bin", 0x2000, 0x1d3ecee5, BRF_ESS | BRF_PRG }, // 3 - { "13.1r", 0x2000, 0x70e0244d, BRF_ESS | BRF_PRG }, // 4 - - // graphics 3 bit planes: - { "03_e08t.bin", 0x1000, 0x9f0470d5, BRF_GRA }, // chars - { "04_h08t.bin", 0x1000, 0x81ec12e6, BRF_GRA }, - { "05_k08t.bin", 0x1000, 0xe87ec8b1, BRF_GRA }, - - { "14_j07b.bin", 0x2000, 0x101c858d, BRF_GRA }, // sprites - { "15_l07b.bin", 0x2000, 0x013f58f2, BRF_GRA }, - { "16_m07b.bin", 0x2000, 0x94694097, BRF_GRA }, - - { "06_l08t.bin", 0x2000, 0x51eebd89, BRF_GRA }, // background tiles - { "07_n08t.bin", 0x2000, 0x9dd98e9d, BRF_GRA }, - { "08_r08t.bin", 0x2000, 0x3155ee7d, BRF_GRA }, - - { "02_p04t.bin", 0x1000, 0x398d4a02, BRF_GRA }, // background tilemaps - - { "01_h03t.bin", 0x2000, 0x8407917d, BRF_ESS | BRF_SND }, // sound CPU -}; - -STD_ROM_PICK(Bombjack) -STD_ROM_FN(Bombjack) - - -// Bomb Jack (set 2) -static struct BurnRomInfo Bombjac2RomDesc[] = { - { "09_j01b.bin", 0x2000, 0xc668dc30, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "10_l01b.bin", 0x2000, 0x52a1e5fb, BRF_ESS | BRF_PRG }, // 1 - { "11_m01b.bin", 0x2000, 0xb68a062a, BRF_ESS | BRF_PRG }, // 2 - { "12_n01b.bin", 0x2000, 0x1d3ecee5, BRF_ESS | BRF_PRG }, // 3 - { "13_r01b.bin", 0x2000, 0xbcafdd29, BRF_ESS | BRF_PRG }, // 4 - - // graphics 3 bit planes: - { "03_e08t.bin", 0x1000, 0x9f0470d5, BRF_GRA }, // chars - { "04_h08t.bin", 0x1000, 0x81ec12e6, BRF_GRA }, - { "05_k08t.bin", 0x1000, 0xe87ec8b1, BRF_GRA }, - - { "14_j07b.bin", 0x2000, 0x101c858d, BRF_GRA }, // sprites - { "15_l07b.bin", 0x2000, 0x013f58f2, BRF_GRA }, - { "16_m07b.bin", 0x2000, 0x94694097, BRF_GRA }, - - { "06_l08t.bin", 0x2000, 0x51eebd89, BRF_GRA }, // background tiles - { "07_n08t.bin", 0x2000, 0x9dd98e9d, BRF_GRA }, - { "08_r08t.bin", 0x2000, 0x3155ee7d, BRF_GRA }, - - { "02_p04t.bin", 0x1000, 0x398d4a02, BRF_GRA }, // background tilemaps - - { "01_h03t.bin", 0x2000, 0x8407917d, BRF_ESS | BRF_SND }, // sound CPU -}; - -STD_ROM_PICK(Bombjac2) -STD_ROM_FN(Bombjac2) - - -// Bomb Jack (Tecfri, Spain) -static struct BurnRomInfo BombjacktRomDesc[] = { - { "9.1j", 0x4000, 0x4b59a3bb, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "12.1n", 0x4000, 0x0a32506a, BRF_ESS | BRF_PRG }, // 1 - { "13.1r", 0x2000, 0x964ac5c5, BRF_ESS | BRF_PRG }, // 2 - - // graphics 3 bit planes: - { "3.1e", 0x2000, 0x54e1dac1, BRF_GRA }, // chars - { "4.1h", 0x2000, 0x05e428ab, BRF_GRA }, - { "5.1k", 0x2000, 0xf282f29a, BRF_GRA }, - - { "14.7j", 0x2000, 0x101c858d, BRF_GRA }, // sprites - { "15.7k", 0x2000, 0x013f58f2, BRF_GRA }, - { "16.7m", 0x2000, 0x94694097, BRF_GRA }, - - { "6.1l", 0x2000, 0x51eebd89, BRF_GRA }, // background tiles - { "7.1n", 0x2000, 0x9dd98e9d, BRF_GRA }, - { "8.1r", 0x2000, 0x3155ee7d, BRF_GRA }, - - { "2.5n", 0x2000, 0xde796158, BRF_GRA }, // background tilemaps - - { "1.6h", 0x2000, 0x8407917d, BRF_ESS | BRF_SND }, // sound CPU -}; - -STD_ROM_PICK(Bombjackt) -STD_ROM_FN(Bombjackt) - - -static INT32 DrvDoReset() -{ - bombjackIRQ = 0; - latch = 0; - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - for (INT32 i = 0; i < 3; i++) { - AY8910Reset(i); - } - - HiscoreReset(); - - return 0; -} - - -UINT8 __fastcall BjMemRead(UINT16 addr) -{ - UINT8 inputs=0; - - if (addr >= 0x9820 && addr <= 0x987f) return BjSprRam[addr - 0x9820]; - - if (addr==0xb000) { - if (DrvJoy1[5]) - inputs|=0x01; - if (DrvJoy1[4]) - inputs|=0x02; - if (DrvJoy1[2]) - inputs|=0x04; - if (DrvJoy1[3]) - inputs|=0x08; - if (DrvJoy1[6]) - inputs|=0x10; - return inputs; - } - if (addr==0xb001) { - if (DrvJoy2[5]) - inputs|=0x01; - if (DrvJoy2[4]) - inputs|=0x02; - if (DrvJoy2[2]) - inputs|=0x04; - if (DrvJoy2[3]) - inputs|=0x08; - if (DrvJoy2[6]) - inputs|=0x10; - return inputs; - } - if (addr==0xb002) { - if (DrvJoy1[0]) - inputs|=0x01; - if (DrvJoy1[1]) - inputs|=0x04; - if (DrvJoy2[0]) - inputs|=0x02; - if (DrvJoy2[1]) - inputs|=0x08; - return inputs; - } - if (addr==0xb004) { - return BjDip[0]; // Dip Sw(1) - } - if (addr==0xb005) { - return BjDip[1]; // Dip Sw(2) - } - return 0; -} - -void __fastcall BjMemWrite(UINT16 addr,UINT8 val) -{ - if (addr >= 0x9820 && addr <= 0x987f) { BjSprRam[addr - 0x9820] = val; return; } - - if (addr==0xb000) - { - bombjackIRQ = val; - } - if(addr==0xb800) - { - latch=val; - return; - } - BjRam[addr]=val; -} - -UINT8 __fastcall SndMemRead(UINT16 a) -{ - if (a==0xFF00) - { - return 0x7f; - } - if(a==0x6000) - { - INT32 res; - res = latch; - latch = 0; - return res; - } - return 0; -} - - - -void __fastcall SndPortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - switch (a) { - case 0x00: { - AY8910Write(0, 0, d); - return; - } - case 0x01: { - AY8910Write(0, 1, d); - return; - } - case 0x10: { - AY8910Write(1, 0, d); - return; - } - case 0x11: { - AY8910Write(1, 1, d); - return; - } - case 0x80: { - AY8910Write(2, 0, d); - return; - } - case 0x81: { - AY8910Write(2, 1, d); - return; - } - } -} - -static INT32 BjZInit() -{ - // Init the z80 - ZetInit(0); - // Main CPU setup - ZetOpen(0); - - ZetMapArea (0x0000,0x7fff,0,BjRom+0x0000); // Direct Read from ROM - ZetMapArea (0x0000,0x7fff,2,BjRom+0x0000); // Direct Fetch from ROM - ZetMapArea (0xc000,0xdfff,0,BjRom+0x8000); // Direct Read from ROM - ZetMapArea (0xc000,0xdfff,2,BjRom+0x8000); // Direct Fetch from ROM - - ZetMapArea (0x8000,0x8fff,0,BjRam+0x8000); - ZetMapArea (0x8000,0x8fff,1,BjRam+0x8000); - - ZetMapArea (0x9000,0x93ff,0,BjVidRam); - ZetMapArea (0x9000,0x93ff,1,BjVidRam); - - ZetMapArea (0x9400,0x97ff,0,BjColRam); - ZetMapArea (0x9400,0x97ff,1,BjColRam); - -// ZetMapArea (0x9820,0x987f,0,BjSprRam); -// ZetMapArea (0x9820,0x987f,1,BjSprRam); - - ZetMapArea (0x9c00,0x9cff,0,BjPalSrc); - ZetMapArea (0x9c00,0x9cff,1,BjPalSrc); - - ZetMapArea (0x9e00,0x9e00,0,BjRam+0x9e00); - ZetMapArea (0x9e00,0x9e00,1,BjRam+0x9e00); - - // ZetMapArea (0xb000,0xb000,0,BjRam+0xb000); - // ZetMapArea (0xb000,0xb000,1,BjRam+0xb000); - - // ZetMapArea (0xb800,0xb800,0,BjRam+0xb800); - // ZetMapArea (0xb800,0xb800,1,BjRam+0xb800); - - ZetSetReadHandler(BjMemRead); - ZetSetWriteHandler(BjMemWrite); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea (0x0000,0x1fff,0,SndRom); // Direct Read from ROM - ZetMapArea (0x0000,0x1fff,2,SndRom); // Direct Fetch from ROM - ZetMapArea (0x4000,0x43ff,0,SndRam); - ZetMapArea (0x4000,0x43ff,1,SndRam); - ZetMapArea (0x4000,0x43ff,2,SndRam); // fetch from ram? - ZetMapArea (0xff00,0xffff,0,SndRam); - ZetMapArea (0xff00,0xffff,1,SndRam); - ZetMapArea (0xff00,0xffff,2,SndRam); // more fetch from ram? What the hell . . - - // ZetMapArea (0x6000,0x6000,0,BjRam+0xb800); - // ZetMapArea (0x6000,0x6000,1,BjRam+0xb800); - ZetSetReadHandler(SndMemRead); - ZetSetOutHandler(SndPortWrite); - ZetClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - pAY8910Buffer[6] = pFMBuffer + nBurnSoundLen * 6; - pAY8910Buffer[7] = pFMBuffer + nBurnSoundLen * 7; - pAY8910Buffer[8] = pFMBuffer + nBurnSoundLen * 8; - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.13, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.13, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(2, 0.13, BURN_SND_ROUTE_BOTH); - - // remember to do ZetReset() in main driver - - DrvDoReset(); - return 0; -} - - - -static void DecodeTiles(UINT8 *TilePointer, INT32 num,INT32 off1,INT32 off2, INT32 off3) -{ - INT32 c,y,x,dat1,dat2,dat3,col; - for (c=0;c>=1; - dat2>>=1; - dat3>>=1; - } - } - } -} - - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - BjRom = Next; Next += 0x10000; - BjGfx = Next; Next += 0x0F000; - BjMap = Next; Next += 0x02000; - SndRom = Next; Next += 0x02000; - RamStart = Next; - BjRam = Next; Next += 0x10000; - SndRam = Next; Next += 0x01000; - BjPalSrc = Next; Next += 0x00100; - BjVidRam = Next; Next += 0x00400; - BjColRam = Next; Next += 0x00400; - BjSprRam = Next; Next += 0x00060; - RamEnd = Next; - text = Next; Next += 512 * 8 * 8; - sprites = Next; Next += 1024 * 8 * 8; - tiles = Next; Next += 1024 * 8 * 8; - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 9 * sizeof(INT16); - BjPalReal = (UINT32*)Next; Next += 0x0080 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - - -static INT32 BjInit() -{ - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - INT32 RomOffset = 0; - - if (BjIsBombjackt) { - for (INT32 i = 0; i < 3; i++) { - BurnLoadRom(BjRom + (0x4000 * i), i, 1); - } - - RomOffset = 3; - } else { - for (INT32 i = 0; i < 5; i++) { - BurnLoadRom(BjRom + (0x2000 * i), i, 1); - } - - RomOffset = 5; - } - - for (INT32 i = 0; i < 3; i++) { - BurnLoadRom(BjGfx + (0x1000 * i), i + RomOffset, 1); - } - - BurnLoadRom(BjGfx + 0x3000, RomOffset + 3, 1); - BurnLoadRom(BjGfx + 0x5000, RomOffset + 4, 1); - BurnLoadRom(BjGfx + 0x7000, RomOffset + 5, 1); - - BurnLoadRom(BjGfx + 0x9000, RomOffset + 6, 1); - BurnLoadRom(BjGfx + 0xB000, RomOffset + 7, 1); - BurnLoadRom(BjGfx + 0xD000, RomOffset + 8, 1); - - BurnLoadRom(BjMap, RomOffset + 9, 1); // load Background tile maps - BurnLoadRom(SndRom, RomOffset + 10, 1); // load Sound CPU - - // Set memory access & Init - BjZInit(); - - DecodeTiles(text,512,0,0x1000,0x2000); - DecodeTiles(sprites,1024,0x7000,0x5000,0x3000); - DecodeTiles(tiles,1024,0x9000,0xB000,0xD000); - // done - - GenericTilesInit(); - - DrvDoReset(); - return 0; -} - -static INT32 BjtInit() -{ - BjIsBombjackt = 1; - - return BjInit(); -} - -static INT32 BjExit() -{ - ZetExit(); - - for (INT32 i = 0; i < 3; i++) { - AY8910Exit(i); - } - - GenericTilesExit(); - BurnFree(Mem); - - BjIsBombjackt = 0; - - return 0; -} - -static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 0) & 0x0f; - g = (nColour >> 4) & 0x0f; - b = (nColour >> 8) & 0x0f; - - r = (r << 4) | r; - g = (g << 4) | g; - b = (b << 4) | b; - - return BurnHighCol(r, g, b, 0); -} - -static INT32 CalcAll() -{ - for (INT32 i = 0; i < 0x100; i++) { - BjPalReal[i / 2] = CalcCol(BjPalSrc[i & ~1] | (BjPalSrc[i | 1] << 8)); - } - - return 0; -} - -static void BjRenderFgLayer() -{ - for (INT32 tileCount = 0; tileCount < 1024 ;tileCount++) - { - INT32 code = BjVidRam[tileCount] + 16 * (BjColRam[tileCount] & 0x10); - INT32 color = BjColRam[tileCount] & 0x0f; - INT32 sy = (tileCount % 32); - INT32 sx = 31 - (tileCount / 32); - - sx<<=3; - sx-=16; - sy<<=3; - if (sx >= 0 && sx < 215 && sy >= 0 && sy < 246) - { - Render8x8Tile_Mask(pTransDraw, code,sx,sy,color, 3, 0, 0, text); - } - else - { - Render8x8Tile_Mask_Clip(pTransDraw, code,sx,sy,color, 3, 0, 0, text); - } - } -} - - -static void BjRenderBgLayer() -{ - for (INT32 tileCount = 0; tileCount < 256;tileCount++) { - INT32 FlipX; - - INT32 BgSel=BjRam[0x9e00]; - - INT32 offs = (BgSel & 0x07) * 0x200 + tileCount; - INT32 Code = (BgSel & 0x10) ? BjMap[offs] : 0; - - INT32 attr = BjMap[offs + 0x100]; - INT32 Colour = attr & 0x0f; - //INT32 flags = (attr & 0x80) ? TILE_FLIPY : 0; - - - INT32 sy = (tileCount % 16); - INT32 sx = 15 - (tileCount / 16); - FlipX = attr & 0x80; - - /*if (SolomonFlipScreen) { - sx = 31 - sx; - sy = 31 - sy; - FlipX = !FlipX; - FlipY = !FlipY; - }*/ - - sx <<= 4; - sx -=16; - sy <<= 4; - Code <<= 2; - if (sx >= 0 && sx < 215 && sy >= 0 && sy < 246) { - - if (FlipX&0x80) - { - Render8x8Tile_Mask(pTransDraw, Code+0,sx+8,sy+0, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask(pTransDraw, Code+1,sx+8,sy+8, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask(pTransDraw, Code+2,sx+0,sy+0, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask(pTransDraw, Code+3,sx+0,sy+8, Colour, 3, 0, 0, tiles); - - } - else - { - Render8x8Tile_Mask(pTransDraw, Code+0,sx+8,sy+0, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask(pTransDraw, Code+1,sx+8,sy+8, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask(pTransDraw, Code+2,sx+0,sy+0, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask(pTransDraw, Code+3,sx+0,sy+8, Colour, 3, 0, 0, tiles); - } - - } else { - - if (FlipX&0x80) - { - Render8x8Tile_Mask_Clip(pTransDraw, Code+0,sx+8,sy+0, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask_Clip(pTransDraw, Code+1,sx+8,sy+8, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask_Clip(pTransDraw, Code+2,sx+0,sy+0, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask_Clip(pTransDraw, Code+3,sx+0,sy+8, Colour, 3, 0, 0, tiles); - - } - else - { - Render8x8Tile_Mask_Clip(pTransDraw, Code+0,sx+8,sy+0, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask_Clip(pTransDraw, Code+1,sx+8,sy+8, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask_Clip(pTransDraw, Code+2,sx+0,sy+0, Colour, 3, 0, 0, tiles); - Render8x8Tile_Mask_Clip(pTransDraw, Code+3,sx+0,sy+8, Colour, 3, 0, 0, tiles); - } - - } - } -} - - -static void BjDrawSprites() -{ - INT32 offs; - - for (offs = 0x60 - 4; offs >= 0; offs -= 4) - { - - /* - abbbbbbb cdefgggg hhhhhhhh iiiiiiii - - a use big sprites (32x32 instead of 16x16) - bbbbbbb sprite code - c x flip - d y flip (used only in death sequence?) - e ? (set when big sprites are selected) - f ? (set only when the bonus (B) materializes?) - gggg color - hhhhhhhh x position - iiiiiiii y position - */ - INT32 sx,sy,flipx,flipy, code, colour, big; - - - sy = BjSprRam[offs+3]; - if (BjSprRam[offs] & 0x80) - sx = BjSprRam[offs+2]; - else - sx = BjSprRam[offs+2]; - flipx = BjSprRam[offs+1] & 0x80; - flipy = BjSprRam[offs+1] & 0x40; - - code = BjSprRam[offs] & 0x7f; - colour = (BjSprRam[offs+1] & 0x0f); - big = (BjSprRam[offs] & 0x80); - - //sy -= 32; - - sx -=16; - if (!big) - { - code <<= 2; - if (sx >= 0 && sx < 215 && sy >= 0 && sy < 246) { - if (!flipy) { - if (!flipx) { - Render8x8Tile_Mask(pTransDraw, code + 0, sx + 8, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code + 1, sx + 8, sy + 8, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code + 2, sx + 0, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code + 3, sx + 0, sy + 8, colour, 3, 0, 0, sprites); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, code + 2, sx + 8, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipX(pTransDraw, code + 3, sx + 8, sy + 8, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipX(pTransDraw, code + 0, sx + 0, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipX(pTransDraw, code + 1, sx + 0, sy + 8, colour, 3, 0, 0, sprites); - } - } else { - if (!flipx) { - Render8x8Tile_Mask_FlipY(pTransDraw, code + 1, sx + 8, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipY(pTransDraw, code + 0, sx + 8, sy + 8, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipY(pTransDraw, code + 3, sx + 0, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipY(pTransDraw, code + 2, sx + 0, sy + 8, colour, 3, 0, 0, sprites); - } else { - Render8x8Tile_Mask_FlipXY(pTransDraw, code + 3, sx + 8, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipXY(pTransDraw, code + 2, sx + 8, sy + 8, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipXY(pTransDraw, code + 1, sx + 0, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipXY(pTransDraw, code + 0, sx + 0, sy + 8, colour, 3, 0, 0, sprites); - } - } - } else { - if (!flipy) { - if (!flipx) { - Render8x8Tile_Mask_Clip(pTransDraw, code + 0, sx + 8, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code + 1, sx + 8, sy + 8, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code + 2, sx + 0, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code + 3, sx + 0, sy + 8, colour, 3, 0, 0, sprites); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code + 2, sx + 8, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code + 3, sx + 8, sy + 8, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code + 0, sx + 0, sy + 0, colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code + 1, sx + 0, sy + 8, colour, 3, 0, 0, sprites); - } - } else { - if (!flipx) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code + 1, sx + 0, sy + 0, colour, 4, 0, 0, sprites); - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code + 0, sx + 0, sy + 8, colour, 4, 0, 0, sprites); - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code + 3, sx + 8, sy + 0, colour, 4, 0, 0, sprites); - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code + 2, sx + 8, sy + 8, colour, 4, 0, 0, sprites); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code + 3, sx + 8, sy + 0, colour, 4, 0, 0, sprites); - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code + 2, sx + 8, sy + 8, colour, 4, 0, 0, sprites); - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code + 1, sx + 0, sy + 0, colour, 4, 0, 0, sprites); - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code + 0, sx + 0, sy + 8, colour, 4, 0, 0, sprites); - } - } - } - } - else - { - code&=31; - code <<= 4; - sx-=1; - if (sx >= 0 && sx < 215 && sy >= 0 && sy < 246) - { - if (!flipy) - { - if (!flipx) { - Render8x8Tile_Mask(pTransDraw, code+512,sx+8+16,sy,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+513,sx+8+16,sy+8,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+514,sx+16,sy,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+515,sx+16,sy+8,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+516,sx+8+16,sy+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+517,sx+8+16,sy+8+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+518,sx+16,sy+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+519,sx+16,sy+8+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+520,sx+8,sy,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+521,sx+8,sy+8,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+522,sx,sy,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+523,sx,sy+8,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+524,sx+8,sy+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+525,sx+8,sy+8+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+526,sx,sy+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask(pTransDraw, code+527,sx,sy+8+16,colour, 3, 0, 0, sprites); - } - } - } - else - { - if (!flipy) - { - if (!flipx) { - Render8x8Tile_Mask_Clip(pTransDraw, code+512,sx+8+16,sy,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+513,sx+8+16,sy+8,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+514,sx+16,sy,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+515,sx+16,sy+8,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+516,sx+8+16,sy+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+517,sx+8+16,sy+8+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+518,sx+16,sy+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+519,sx+16,sy+8+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+520,sx+8,sy,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+521,sx+8,sy+8,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+522,sx,sy,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+523,sx,sy+8,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+524,sx+8,sy+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+525,sx+8,sy+8+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+526,sx,sy+16,colour, 3, 0, 0, sprites); - Render8x8Tile_Mask_Clip(pTransDraw, code+527,sx,sy+8+16,colour, 3, 0, 0, sprites); - } - } - } - } - } -} - -static INT32 BjFrame() -{ - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - nCyclesTotal[0] = 4000000 / 60; - nCyclesTotal[1] = 3000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 1) - { - if(bombjackIRQ) - { - ZetNmi(); - } - } - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - /*ZetOpen(0); - if (BjRam[0xb000]) - ZetNmi(); - ZetClose();*/ - - ZetOpen(1); - ZetNmi(); - ZetClose(); - - - if (pBurnDraw != NULL) - { - BurnTransferClear(); - CalcAll(); - - BjRenderBgLayer(); - BjRenderFgLayer(); - BjDrawSprites(); - BurnTransferCopy(BjPalReal); - } - return 0; -} - -static INT32 BjScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); // Scan Z80 - - // Scan critical driver variables - SCAN_VAR(bombjackIRQ); - SCAN_VAR(latch); - SCAN_VAR(DrvJoy1); - SCAN_VAR(DrvJoy2); - SCAN_VAR(BjDip); - } - - return 0; -} - -struct BurnDriver BurnDrvBombjack = { - "bombjack", NULL, NULL, NULL, "1984", - "Bomb Jack (set 1)\0", NULL, "Tehkan", "Bomb Jack", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED,2,HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, BombjackRomInfo,BombjackRomName, NULL, NULL,DrvInputInfo,BjDIPInfo, - BjInit,BjExit,BjFrame,NULL,BjScan, - NULL,0x80,224,256,3,4 -}; - -struct BurnDriver BurnDrvBombjac2 = { - "bombjack2", "bombjack", NULL, NULL, "1984", - "Bomb Jack (set 2)\0", NULL, "Tehkan", "Bomb Jack", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED,2,HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, Bombjac2RomInfo,Bombjac2RomName, NULL, NULL,DrvInputInfo,BjDIPInfo, - BjInit,BjExit,BjFrame,NULL,BjScan, - NULL,0x80,224,256,3,4 -}; - -struct BurnDriver BurnDrvBombjackt = { - "bombjackt", "bombjack", NULL, NULL, "1984", - "Bomb Jack (Tecfri, Spain)\0", NULL, "Tehkan (Tecfri License)", "Bomb Jack", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED,2,HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, BombjacktRomInfo,BombjacktRomName, NULL, NULL,DrvInputInfo,BjDIPInfo, - BjtInit,BjExit,BjFrame,NULL,BjScan, - NULL,0x80,224,256,3,4 -}; diff --git a/jan/src/burn/drv/pre90s/d_btime.cpp b/jan/src/burn/drv/pre90s/d_btime.cpp deleted file mode 100644 index a527784bd..000000000 --- a/jan/src/burn/drv/pre90s/d_btime.cpp +++ /dev/null @@ -1,2869 +0,0 @@ -// BurgerTime emu-layer for FB Alpha by dink & iq_132, based on the MAME driver by Zsolt Vasvari. - -// Todo: -// Zoar - Sound and Input issues, after coining-up it starts automatically. -// Also missing sounds in some places... - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "bitswap.h" -#include "driver.h" -#include "flt_rc.h" - -extern "C" { - #include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvMainROMdec; -static UINT8 *DrvSoundROM; -static UINT8 *DrvColPROM; - -static UINT8 *DrvMainRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvBGRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvCharRAM; // disco -static UINT8 *DrvSpriteRAM; // disco -static UINT8 *DrvScrollRAM; -static UINT8 *DrvSoundRAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *DrvBgMapROM; -static UINT16 *DrvBGBitmap; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static INT32 gfx0len; -static INT32 gfx1len; - -static INT16 *pAY8910Buffer[6]; -static INT16 *hpfiltbuffer; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static UINT8 vblank; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 audio_nmi_type; -static UINT8 audio_nmi_enable; -static UINT8 audio_nmi_state; -static UINT8 bnj_scroll1; -static UINT8 bnj_scroll2; -static UINT8 lnc_charbank; -static UINT8 btime_palette; // disco, zoar - -// feature: speed up the sound processor init, since it takes several seconds -// after the game boots. with this, it inits instantly by overclocking the sound -// processor for 10 frames. -#define ZIPPYSOUNDFRAMES 10 -static UINT8 zippysoundinit; - -// mmonkey protection stuff -INT32 protection_command; -INT32 protection_status; -INT32 protection_value; -INT32 protection_ret; - -static UINT8 btimemode = 0; -static UINT8 btime3mode = 0; -static UINT8 brubbermode = 0; -static UINT8 discomode = 0; -static UINT8 lncmode = 0; -static UINT8 zoarmode = 0; -static UINT8 mmonkeymode = 0; - -static UINT8 bnjskew = 0; - -enum -{ - AUDIO_ENABLE_NONE, - AUDIO_ENABLE_DIRECT, /* via direct address in memory map */ - AUDIO_ENABLE_AY8910 /* via ay-8910 port A */ -}; - - -static struct BurnInputInfo BtimeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 2, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Btime) - - -static struct BurnDIPInfo BtimeDIPList[]= -{ - {0x10, 0xff, 0xff, 0x3f, NULL }, - {0x11, 0xff, 0xff, 0x0b, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x10, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x10, 0x10, "Off" }, - {0x10, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cross Hatch Pattern" }, - {0x10, 0x01, 0x20, 0x20, "Off" }, - {0x10, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Control Panel" }, - {0x10, 0x01, 0x40, 0x00, "Upright" }, - {0x10, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x11, 0x01, 0x01, 0x01, "3" }, - {0x11, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x06, 0x06, "10000" }, - {0x11, 0x01, 0x06, 0x04, "15000" }, - {0x11, 0x01, 0x06, 0x02, "20000" }, - {0x11, 0x01, 0x06, 0x00, "30000" }, - - {0 , 0xfe, 0 , 2, "Enemies" }, - {0x11, 0x01, 0x08, 0x08, "4" }, - {0x11, 0x01, 0x08, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "End of Level Pepper" }, - {0x11, 0x01, 0x10, 0x10, "No" }, - {0x11, 0x01, 0x10, 0x00, "Yes" }, -}; - -STDDIPINFO(Btime) - -static struct BurnInputInfo MmonkeyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Mmonkey) - - -static struct BurnDIPInfo MmonkeyDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x1f, NULL }, - {0x10, 0xff, 0xff, 0x89, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0f, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Control Panel" }, - {0x0f, 0x01, 0x40, 0x00, "Upright" }, - {0x0f, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x01, 0x01, "3" }, - {0x10, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x06, 0x02, "Every 15000" }, - {0x10, 0x01, 0x06, 0x04, "Every 30000" }, - {0x10, 0x01, 0x06, 0x00, "20000" }, - {0x10, 0x01, 0x06, 0x06, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x18, 0x18, "Easy" }, - {0x10, 0x01, 0x18, 0x08, "Medium" }, - {0x10, 0x01, 0x18, 0x10, "Hard" }, - {0x10, 0x01, 0x18, 0x00, "Level Skip Mode (Cheat)" }, -}; - -STDDIPINFO(Mmonkey) - -static struct BurnInputInfo BnjInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 0, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Bnj) - - -static struct BurnDIPInfo BnjDIPList[]= -{ - {0x10, 0xff, 0xff, 0x1f, NULL }, - {0x11, 0xff, 0xff, 0x17, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x10, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x10, 0x10, "Off" }, - {0x10, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x40, 0x00, "Upright" }, - {0x10, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x11, 0x01, 0x01, 0x01, "3" }, - {0x11, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x06, 0x06, "Every 30000" }, - {0x11, 0x01, 0x06, 0x04, "Every 70000" }, - {0x11, 0x01, 0x06, 0x02, "20000 Only" }, - {0x11, 0x01, 0x06, 0x00, "30000 Only" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x08, 0x08, "No" }, - {0x11, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x10, 0x10, "Easy" }, - {0x11, 0x01, 0x10, 0x00, "Hard" }, -}; - -STDDIPINFO(Bnj) - -static struct BurnInputInfo DiscoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Disco) - - -static struct BurnDIPInfo DiscoDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xc0, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0x03, 0x03, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0f, 0x01, 0x0c, 0x0c, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x0c, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Control Panel" }, - {0x0f, 0x01, 0x40, 0x40, "Upright" }, - {0x0f, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x80, 0x80, "Upright" }, - {0x0f, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x01, 0x00, "3" }, - {0x10, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x06, 0x00, "10000" }, - {0x10, 0x01, 0x06, 0x02, "20000" }, - {0x10, 0x01, 0x06, 0x04, "30000" }, - {0x10, 0x01, 0x06, 0x06, "None" }, - - {0 , 0xfe, 0 , 2, "Music Weapons" }, - {0x10, 0x01, 0x08, 0x00, "5" }, - {0x10, 0x01, 0x08, 0x08, "8" }, - - {0 , 0xfe, 0 , 2, "Game Speed" }, - {0x10, 0x01, 0x10, 0x00, "Slow" }, - {0x10, 0x01, 0x10, 0x10, "Fast" }, - - {0 , 0xfe, 0 , 6, "Country Code" }, - {0x10, 0x01, 0xe0, 0x00, "A" }, - {0x10, 0x01, 0xe0, 0x20, "B" }, - {0x10, 0x01, 0xe0, 0x40, "C" }, - {0x10, 0x01, 0xe0, 0x60, "D" }, - {0x10, 0x01, 0xe0, 0x80, "E" }, - {0x10, 0x01, 0xe0, 0xa0, "F" }, -}; - -STDDIPINFO(Disco) - -static struct BurnInputInfo LncInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Lnc) - - -static struct BurnDIPInfo LncDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x3f, NULL }, - {0x10, 0xff, 0xff, 0x0f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0f, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Test Mode" }, - {0x0f, 0x01, 0x30, 0x30, "Off" }, - {0x0f, 0x01, 0x30, 0x00, "RAM Test Only" }, - {0x0f, 0x01, 0x30, 0x20, "Watchdog Test Only" }, - {0x0f, 0x01, 0x30, 0x10, "All Tests" }, - - {0 , 0xfe, 0 , 2, "Control Panel" }, - {0x0f, 0x01, 0x40, 0x00, "Upright" }, - {0x0f, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x01, 0x01, "3" }, - {0x10, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x06, 0x06, "15000" }, - {0x10, 0x01, 0x06, 0x04, "20000" }, - {0x10, 0x01, 0x06, 0x02, "30000" }, - {0x10, 0x01, 0x06, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Game Speed" }, - {0x10, 0x01, 0x08, 0x08, "Slow" }, - {0x10, 0x01, 0x08, 0x00, "Hard" }, -}; - -STDDIPINFO(Lnc) - -static struct BurnInputInfo ZoarInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 2, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Zoar) - - -static struct BurnDIPInfo ZoarDIPList[]= -{ - {0x13, 0xff, 0xff, 0x2f, NULL }, - {0x14, 0xff, 0xff, 0x1f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Control Panel" }, - {0x13, 0x01, 0x40, 0x00, "Upright" }, - {0x13, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x01, 0x01, "3" }, - {0x14, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x06, 0x06, "5000" }, - {0x14, 0x01, 0x06, 0x04, "10000" }, - {0x14, 0x01, 0x06, 0x02, "15000" }, - {0x14, 0x01, 0x06, 0x00, "20000" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x14, 0x01, 0x08, 0x08, "Easy" }, - {0x14, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Weapon Select" }, - {0x14, 0x01, 0x10, 0x00, "Manual" }, - {0x14, 0x01, 0x10, 0x10, "Auto" }, -}; - -STDDIPINFO(Zoar) - - -#define WB(a1,a2,dest) if (address >= a1 && address <= a2) { \ - dest[address - a1] = data; \ - return; \ - } -#define RB(a1,a2,dest) if (address >= a1 && address <= a2) \ - return dest[address - a1]; - - -#define mmonkeyBASE 0xb000 - -static UINT8 mmonkey_protection_r(UINT16 offset) -{ - UINT8 *RAM = DrvMainRAM; - INT32 ret = 0; - - if (offset == 0x0000) - ret = protection_status; - else if (offset == 0x0e00) - ret = protection_ret; - else if (offset >= 0x0d00 && offset <= 0x0d02) - ret = RAM[mmonkeyBASE + offset]; // addition result - - return ret; -} - -static void mmonkey_protection_w(UINT16 offset, UINT8 data) -{ - UINT8 *RAM = DrvMainRAM; - - if (offset == 0) - { - /* protection trigger */ - if (data == 0) - { - int i, s1, s2, r; - - switch (protection_command) - { - case 0: /* score addition */ - - s1 = (1 * (RAM[mmonkeyBASE + 0x0d00] & 0x0f)) + (10 * (RAM[mmonkeyBASE + 0x0d00] >> 4)) + - (100 * (RAM[mmonkeyBASE + 0x0d01] & 0x0f)) + (1000 * (RAM[mmonkeyBASE + 0x0d01] >> 4)) + - (10000 * (RAM[mmonkeyBASE + 0x0d02] & 0x0f)) + (100000 * (RAM[mmonkeyBASE + 0x0d02] >> 4)); - - s2 = (1 * (RAM[mmonkeyBASE + 0x0d03] & 0x0f)) + (10 * (RAM[mmonkeyBASE + 0x0d03] >> 4)) + - (100 * (RAM[mmonkeyBASE + 0x0d04] & 0x0f)) + (1000 * (RAM[mmonkeyBASE + 0x0d04] >> 4)) + - (10000 * (RAM[mmonkeyBASE + 0x0d05] & 0x0f)) + (100000 * (RAM[mmonkeyBASE + 0x0d05] >> 4)); - - r = s1 + s2; - - RAM[mmonkeyBASE + 0x0d00] = (r % 10); r /= 10; - RAM[mmonkeyBASE + 0x0d00] |= ((r % 10) << 4); r /= 10; - RAM[mmonkeyBASE + 0x0d01] = (r % 10); r /= 10; - RAM[mmonkeyBASE + 0x0d01] |= ((r % 10) << 4); r /= 10; - RAM[mmonkeyBASE + 0x0d02] = (r % 10); r /= 10; - RAM[mmonkeyBASE + 0x0d02] |= ((r % 10) << 4); - - break; - - case 1: /* decryption */ - - /* Compute return value by searching the decryption table. */ - /* During the search the status should be 2, but we're done */ - /* instanteniously in emulation time */ - for (i = 0; i < 0x100; i++) - { - if (RAM[mmonkeyBASE + 0x0f00 + i] == protection_value) - { - protection_ret = i; - break; - } - } - break; - - default: - // Uhoh. - break; - } - - protection_status = 0; - } - } - else if (offset == 0x0c00) - protection_command = data; - else if (offset == 0x0e00) - protection_value = data; - else if (offset >= 0x0f00) - RAM[mmonkeyBASE + offset] = data; /* decrypt table */ - else if (offset >= 0x0d00 && offset <= 0x0d05) - RAM[mmonkeyBASE + offset] = data; /* source table */ -} - -static void lncpaletteupdate() -{ - const UINT8 *color_prom = DrvColPROM; - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0, bit1, bit2, r, g, b; - - /* red component */ - bit0 = (color_prom[i] >> 7) & 0x01; - bit1 = (color_prom[i] >> 6) & 0x01; - bit2 = (color_prom[i] >> 5) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* green component */ - bit0 = (color_prom[i] >> 4) & 0x01; - bit1 = (color_prom[i] >> 3) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* blue component */ - bit0 = 0; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 0) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void discopaletteupdate() -{ - const UINT8 *color_prom = DrvColPROM; - - for (INT32 i = 0; i < 0x40; i++) - { - INT32 bit0, bit1, bit2, r, g, b; - - /* red component */ - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* green component */ - bit0 = (color_prom[i] >> 3) & 0x01; - bit1 = (color_prom[i] >> 4) & 0x01; - bit2 = (color_prom[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* blue component */ - bit0 = 0; - bit1 = (color_prom[i] >> 6) & 0x01; - bit2 = (color_prom[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void btimepalettewrite(UINT16 offset, UINT8 data) -{ - INT32 bit0, bit1, bit2; - - bit0 = (data >> 0) & 0x01; - bit1 = (data >> 1) & 0x01; - bit2 = (data >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (data >> 3) & 0x01; - bit1 = (data >> 4) & 0x01; - bit2 = (data >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (data >> 6) & 0x01; - bit2 = (data >> 7) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - if (offset == 3 && bnjskew) { // hack to make some stuff readable in bnj. - r = 0xff; - g = 0xb8; - b = 0x00; - } - - DrvPalette[offset] = BurnHighCol(r, g, b, 0); -} - -static UINT8 btime_main_read(UINT16 address) -{ - RB(0x0000, 0x07ff, DrvMainRAM); - RB(0x0c00, 0x0c1f, DrvPalRAM); - RB(0x1000, 0x13ff, DrvVidRAM); - RB(0x1400, 0x17ff, DrvColRAM); - - if (address >= 0xb000 && address <= 0xffff) { - return DrvMainROM[address]; - } - - if (address >= 0x1800 && address <= 0x1bff) { - INT32 offset = address & 0x3ff; - return DrvVidRAM[(((offset % 32) * 32) + (offset / 32))]; - } - - if (address >= 0x1c00 && address <= 0x1fff) { - INT32 offset = address & 0x3ff; - return DrvColRAM[(((offset % 32) * 32) + (offset / 32))]; - } - - switch (address) - { - case 0x4000: - return DrvInputs[0]; - - case 0x4001: - return DrvInputs[1]; - - case 0x4002: - return DrvInputs[2]; - - case 0x4003: - return (DrvDips[0] & 0x7f) | vblank; - - case 0x4004: - return DrvDips[1]; - } - return 0; -} - -static UINT8 bnj_main_read(UINT16 address) -{ - RB(0x0000, 0x07ff, DrvMainRAM); - RB(0x5c00, 0x5c1f, DrvPalRAM); - RB(0x4000, 0x43ff, DrvVidRAM); - RB(0x4400, 0x47ff, DrvColRAM); - - if (address >= 0xa000 && address <= 0xffff) { - return DrvMainROM[address]; - } - - if (address >= 0x4800 && address <= 0x4bff) { - INT32 offset = address & 0x3ff; - return DrvVidRAM[(((offset % 32) * 32) + (offset / 32))]; - } - - if (address >= 0x4c00 && address <= 0x4fff) { - INT32 offset = address & 0x3ff; - return DrvColRAM[(((offset % 32) * 32) + (offset / 32))]; - } - - switch (address) - { - case 0x1002: - return DrvInputs[0]; - - case 0x1003: - return DrvInputs[1]; - - case 0x1004: - return DrvInputs[2]; - - case 0x1000: - return (DrvDips[0] & 0x7f) | vblank; - - case 0x1001: - return DrvDips[1]; - } - return 0; -} - -static UINT8 zoar_main_read(UINT16 address) -{ - RB(0x0000, 0x07ff, DrvMainRAM); - RB(0x8000, 0x83ff, DrvVidRAM); - RB(0x8400, 0x87ff, DrvColRAM); - - if (address >= 0xd000 && address <= 0xffff) { - return DrvMainROM[address]; - } - - if (address >= 0x8800 && address <= 0x8bff) { - INT32 offset = address & 0x3ff; - return DrvVidRAM[(((offset % 32) * 32) + (offset / 32))]; - } - - if (address >= 0x8c00 && address <= 0x8fff) { - INT32 offset = address & 0x3ff; - return DrvColRAM[(((offset % 32) * 32) + (offset / 32))]; - } - - switch (address) - { - case 0x9800: - return ((vblank) ? 0x00 : 0x80) | (DrvDips[0] & 0x7f); - - case 0x9801: - return DrvDips[1]; - - case 0x9802: - return DrvInputs[0]; - - case 0x9803: - return DrvInputs[1]; - } - return 0; -} - -static UINT8 disco_main_read(UINT16 address) -{ - RB(0x0000, 0x07ff, DrvMainRAM); - RB(0x2000, 0x7fff, DrvCharRAM); - RB(0x8000, 0x83ff, DrvVidRAM); - RB(0x8400, 0x87ff, DrvColRAM); - RB(0x8800, 0x881f, DrvSpriteRAM); - - if (address >= 0xa000 && address <= 0xffff) { - return DrvMainROM[address]; - } - - switch (address) - { - case 0x9200: - return DrvInputs[0]; - - case 0x9400: - return DrvInputs[1]; - - case 0x9000: - return 0x1f + (DrvInputs[2] & 0xc0); - - case 0x9800: - return DrvDips[0]; - - case 0x9a00: - return DrvDips[1]; - - case 0x9c00: - return 0x7f | vblank; - } - return 0; -} - -static UINT8 mmonkeyop_main_read(UINT16 address) -{ - return DrvMainROMdec[address]; -} - -static UINT8 mmonkey_main_read(UINT16 address) -{ - RB(0x0000, 0x3bff, DrvMainRAM); - RB(0x3c00, 0x3fff, DrvVidRAM); - - if (address >= 0xb000 && address <= 0xbfff) { - if (lncmode) { - return DrvCharRAM[address - 0xb000]; - } else { - return mmonkey_protection_r(address - 0xb000); - } - } - - if (address >= 0xc000) { - return DrvMainROM[address]; - } - - if (address >= 0x7c00 && address <= 0x7fff) { - INT32 offset = address & 0x3ff; - return DrvVidRAM[(((offset % 32) * 32) + (offset / 32))]; - } - - switch (address) - { - case 0x9000: - return DrvInputs[0]; - - case 0x9001: - return DrvInputs[1]; - - case 0x9002: - return DrvInputs[2]; - - case 0x8000: - return (DrvDips[0] & 0x7f) | vblank; - - case 0x8001: - return DrvDips[1]; - } - return 0; -} - -static void mmonkey_main_write(UINT16 address, UINT8 data) -{ - DrvMainRAM[address] = data; - DrvMainROMdec[address] = data; - - if (address >= 0x3c00 && address <= 0x3fff) { - DrvVidRAM[address - 0x3c00] = data; - DrvColRAM[address - 0x3c00] = lnc_charbank; - return; - } - - if (address >= 0x7c00 && address <= 0x7fff) { - INT32 offset = address & 0x3ff; - DrvVidRAM[(((offset % 32) * 32) + (offset / 32))] = data; - DrvColRAM[(((offset % 32) * 32) + (offset / 32))] = lnc_charbank; - return; - } - - if (address >= 0xb000 && address <= 0xbfff) { - if (lncmode) { - DrvCharRAM[address - 0xb000] = data; - } else { - mmonkey_protection_w(address - 0xb000, data); - } - return; - } - - switch (address) - { - case 0x8003: - lnc_charbank = data; - return; - - case 0x9002: - soundlatch = data; - M6502Close(); - M6502Open(1); - M6502SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6502Close(); - M6502Open(0); - return; - } -} - -static void btime_main_write(UINT16 address, UINT8 data) -{ - WB(0x0000, 0x07ff, DrvMainRAM); - WB(0x1000, 0x13ff, DrvVidRAM); - WB(0x1400, 0x17ff, DrvColRAM); - - if (address >= 0xc00 && address <= 0xc1f) { - DrvPalRAM[address - 0xc00] = data; - if (address <= 0xc0f) btimepalettewrite(address - 0xc00, ~data); - return; - } - - if (address >= 0x1800 && address <= 0x1bff) { - INT32 offset = address & 0x3ff; - DrvVidRAM[(((offset % 32) * 32) + (offset / 32))] = data; - return; - } - - if (address >= 0x1c00 && address <= 0x1fff) { - INT32 offset = address & 0x3ff; - DrvColRAM[(((offset % 32) * 32) + (offset / 32))] = data; - return; - } - - switch (address) - { - case 0x4000: - return; // nop - - case 0x4002: - // video control (flipscreen) - return; - - case 0x4003: - soundlatch = data; - M6502Close(); - M6502Open(1); - M6502SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6502Close(); - M6502Open(0); - return; - - case 0x4004: - bnj_scroll1 = data; - return; - } -} - -static void zoar_main_write(UINT16 address, UINT8 data) -{ - WB(0x0000, 0x07ff, DrvMainRAM); - WB(0x8000, 0x83ff, DrvVidRAM); - WB(0x8400, 0x87ff, DrvColRAM); - WB(0x9800, 0x9803, DrvScrollRAM); - - if (address >= 0x8800 && address <= 0x8bff) { - INT32 offset = address & 0x3ff; - DrvVidRAM[(((offset % 32) * 32) + (offset / 32))] = data; - return; - } - - if (address >= 0x8c00 && address <= 0x8fff) { - INT32 offset = address & 0x3ff; - DrvColRAM[(((offset % 32) * 32) + (offset / 32))] = data; - return; - } - - switch (address) - { - case 0x9804: - bnj_scroll2 = data; - return; - - case 0x9805: - bnj_scroll1 = data; - return; - - case 0x9000: - btime_palette = (data & 0x30) >> 3; - return; - - case 0x9806: - soundlatch = data; - M6502Close(); - M6502Open(1); - M6502SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6502Close(); - M6502Open(0); - return; - } -} - -static void disco_main_write(UINT16 address, UINT8 data) -{ - WB(0x0000, 0x07ff, DrvMainRAM); - WB(0x2000, 0x7fff, DrvCharRAM); - WB(0x8000, 0x83ff, DrvVidRAM); - WB(0x8400, 0x87ff, DrvColRAM); - WB(0x8800, 0x881f, DrvSpriteRAM); - - switch (address) - { - case 0x9c00: - btime_palette = (data >> 2) & 0x03; - return; - - case 0x9a00: - soundlatch = data; - M6502Close(); - M6502Open(1); - M6502SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6502Close(); - M6502Open(0); - return; - } -} - -static void bnj_main_write(UINT16 address, UINT8 data) -{ - - WB(0x0000, 0x07ff, DrvMainRAM); - WB(0x4000, 0x43ff, DrvVidRAM); - WB(0x4400, 0x47ff, DrvColRAM); - WB(0x5000, 0x51ff, DrvBGRAM); - - if (address >= 0x5c00 && address <= 0x5c1f) { - DrvPalRAM[address - 0x5c00] = data; - if (address <= 0x5c0f) btimepalettewrite(address - 0x5c00, ~data); - return; - } - - if (address >= 0x4800 && address <= 0x4bff) { - INT32 offset = address & 0x3ff; - DrvVidRAM[(((offset % 32) * 32) + (offset / 32))] = data; - return; - } - - if (address >= 0x4c00 && address <= 0x4fff) { - INT32 offset = address & 0x3ff; - DrvColRAM[(((offset % 32) * 32) + (offset / 32))] = data; - return; - } - - switch (address) - { - case 0x5400: - bnj_scroll1 = data; - return; - - case 0x5800: - bnj_scroll2 = data; - return; - - case 0x1002: - soundlatch = data; - M6502Close(); - M6502Open(1); - M6502SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6502Close(); - M6502Open(0); - return; - } -} - -static UINT8 btime_sound_read(UINT16 address) -{ - if (address <= 0x1fff) { - return DrvSoundRAM[address & 0x3ff]; - } - - RB(0xe000, 0xefff, DrvSoundROM); - RB(0xf000, 0xffff, DrvSoundROM); - - switch (address >> 13) - { - case 0x05: - M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -/* - dink's notes on the horrible migraine-inducing high-pitched hissing noise - for a note-off, burgertime's audiocpu sends a command with fine/coarse tuning - set to 0 to each channel. Right after this, it sends a volume command for - that channel. The ay8910 soundcore (old and recent) treats a tuning command - of 0 as a very high pitched noise. theres also a funny bug in the 8910 - emulator: if you remove the check for a 0 fine/coarse tuning - to actually - allow for a tune of 0 - it will actually lock up while rendering the samples. - see: if (PSG->PeriodA == 0) PSG->PeriodA = PSG->UpdateStep; - - what I do to get around making any changes to the ay8910 core is look for the - fine/coarse tuning value of 0 being sent to each of the first ay's 3 channels - and set the volume down to 0. The next command is always a volume, so we just - change the next data command to 0. - -0x02: 0. 0x01: 0. AF: 0 AC: 0. -0x02: 1. 0x01: 0. AF: 0 AC: 0. - -0x02: 2. 0x01: 0. BF: 0 BC: 0. -0x02: 3. 0x01: 0. BF: 0 BC: 0. - -0x02: 4. 0x01: 0. CF: 0 CC: 0. -0x02: 5. 0x01: 0. CF: 0 CC: 0. -*/ - -static UINT8 last01[3] = {0xff,0xff}; -static UINT8 last02[3] = {0xff,0xff}; -static UINT8 ignext = 0; - -static void checkhiss_add02(UINT8 data) -{ - last02[1] = last02[0]; - last02[0] = data; -} - -static void checkhiss_and_add01(UINT8 data) -{ - last01[1] = last01[0]; - last01[0] = data; - - if (last01[0] == 0 && last02[0] == 1 && last01[1] == 0 && last02[1] == 0) - { - ignext = 1; // next command will be VolA - } - if (last01[0] == 0 && last02[0] == 3 && last01[1] == 0 && last02[1] == 2) - { - ignext = 1; // next command will be VolB - } - if (last01[0] == 0 && last02[0] == 5 && last01[1] == 0 && last02[1] == 4) - { - ignext = 1; // next command will be VolC - } -} - -static void btime_sound_write(UINT16 address, UINT8 data) -{ - if (address <= 0x1fff) { - DrvSoundRAM[address & 0x3ff] = data; - } - switch (address >> 13) - { - case 0x01: - //bprintf(0, _T("0x01: %X. "), data); - if (ignext) { - data = 0; // set volume to 0 - ignext = 0; - } - AY8910Write(0, ~((address>>13)-1) & 1, data); - checkhiss_and_add01(data); - return; - case 0x02: - //bprintf(0, _T("0x02: %X. "), data); - AY8910Write(0, ~((address>>13)-1) & 1, data); - checkhiss_add02(data); - return; - case 0x03: - AY8910Write(1, ~((address>>13)-1) & 1, data); - return; - case 0x04: - AY8910Write(1, ~((address>>13)-1) & 1, data); - return; - - case 0x06: { - if (audio_nmi_type == AUDIO_ENABLE_DIRECT) { - audio_nmi_enable = data & 1; - M6502SetIRQLine(0x20, (audio_nmi_enable && audio_nmi_state) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - } - } - return; - } -} - -static UINT8 disco_sound_read(UINT16 address) -{ - RB(0x0000, 0x03ff, DrvSoundRAM); - - RB(0xf000, 0xffff, DrvSoundROM); - - switch (address & 0xf000) - { - case 0x8000: - return soundlatch; - } - - return 0; -} - -static void disco_sound_write(UINT16 address, UINT8 data) -{ - WB(0x0000, 0x03ff, DrvSoundRAM); - - switch (address & 0xf000) - { - case 0x4000: - AY8910Write(0, 1, data); - return; - case 0x5000: - AY8910Write(0, 0, data); - return; - case 0x6000: - AY8910Write(1, 1, data); - return; - case 0x7000: - AY8910Write(1, 0, data); - return; - } -} - -static void ay8910_0_portA_write(UINT32, UINT32 data) -{ - if (M6502GetActive() == -1) return; // prevent crash. - - if (audio_nmi_type == AUDIO_ENABLE_AY8910) - { - audio_nmi_enable = ~data & 1; - M6502SetIRQLine(0x20, (audio_nmi_enable && audio_nmi_state) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - } - -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x010000; - DrvMainROMdec = Next; Next += 0x010000; // for mmonkey's readop - DrvSoundROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x020000; - DrvGfxROM3 = Next; Next += 0x020000; - DrvBgMapROM = Next; Next += 0x020000; - DrvBGBitmap = (UINT16*)Next; Next += (512 * 512) * sizeof(UINT16); - DrvColPROM = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(INT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - AllRam = Next; - - DrvMainRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x001000; - DrvBGRAM = Next; Next += 0x001000; - DrvColRAM = Next; Next += 0x001000; - DrvCharRAM = Next; Next += 0x008000; - DrvSpriteRAM= Next; Next += 0x001000; - DrvScrollRAM= Next; Next += 0x000100; - DrvSoundRAM = Next; Next += 0x001000; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - M6502Open(1); - M6502Reset(); - AY8910Reset(0); - AY8910Reset(1); - M6502Close(); - - HiscoreReset(); - - flipscreen = 0; - soundlatch = 0; - bnj_scroll1 = 0; - bnj_scroll2 = 0; - btime_palette = 0; - - audio_nmi_enable = 0; - audio_nmi_state = 0; - - protection_command = 0; - protection_status = 0; - protection_value = 0; - protection_ret = 0; - - zippysoundinit = ZIPPYSOUNDFRAMES; - - return 0; -} - -static INT32 DrvBnjGfxDecode() -{ - INT32 Plane_t8[3] = { RGN_FRAC(gfx0len, 2,3), RGN_FRAC(gfx0len, 1,3), RGN_FRAC(gfx0len, 0,3) }; - INT32 Plane_t16spr[3] = { RGN_FRAC(gfx0len, 2,3), RGN_FRAC(gfx0len, 1,3), RGN_FRAC(gfx0len, 0,3) }; - INT32 Plane_t16bnj[3] = { RGN_FRAC(gfx1len, 1,2)+4, RGN_FRAC(gfx1len, 0,2)+0, RGN_FRAC(gfx1len, 0,2)+4 }; - - INT32 t8XOffs[8] = { STEP8(0,1) }; - INT32 t8YOffs[8] = { STEP8(0,8) }; - - INT32 t16bnjXOffs[16] = { STEP4(3*16*8,1), STEP4(2*16*8,1), STEP4(1*16*8,1), STEP4(0*16*8,1) }; - INT32 t16bnjYOffs[16] = { STEP16(0,8) }; - - INT32 t16XOffs[16] = { STEP8(16*8,1), STEP8(0,1) }; - INT32 t16YOffs[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(gfx0len + gfx1len); // more = more happy-fun. yay! - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, gfx0len); - - GfxDecode(0x0400, 3, 8, 8, Plane_t8, t8XOffs, t8YOffs, 0x40, tmp, DrvGfxROM0); - GfxDecode(0x00ff, 3, 16, 16, Plane_t16spr, t16XOffs, t16YOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, gfx1len); - - GfxDecode(0x0040, 3, 16, 16, Plane_t16bnj, t16bnjXOffs, t16bnjYOffs, 0x200, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvDiscoGfxDecode() // Decoded from Disco's RAM -{ - INT32 Plane_t8[3] = { 0x4000*8, 0x2000*8, 0x0000*8 }; - INT32 Plane_t16[3] = { 0x4000*8, 0x2000*8, 0x0000*8 }; - - INT32 t8XOffs[8] = { STEP8(0,1) }; - INT32 t8YOffs[8] = { STEP8(0,8) }; - - INT32 t16XOffs[16] = { STEP8(16*8,1), STEP8(0,1) }; - INT32 t16YOffs[16] = { STEP16(0,8) }; - - GfxDecode(0x0400, 3, 8, 8, Plane_t8, t8XOffs, t8YOffs, 0x40, DrvCharRAM, DrvGfxROM0); - GfxDecode(0x00ff, 3, 16, 16, Plane_t16, t16XOffs, t16YOffs, 0x100, DrvCharRAM, DrvGfxROM1); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane_t8[3] = { RGN_FRAC(gfx0len, 2,3), RGN_FRAC(gfx0len, 1,3), RGN_FRAC(gfx0len, 0,3) }; - INT32 Plane_t16spr[3] = { RGN_FRAC(gfx0len, 2,3), RGN_FRAC(gfx0len, 1,3), RGN_FRAC(gfx0len, 0,3) }; - INT32 Plane_t16[3] = { RGN_FRAC(gfx1len, 2,3), RGN_FRAC(gfx1len, 1,3), RGN_FRAC(gfx1len, 0,3) }; - - INT32 t8XOffs[8] = { STEP8(0,1) }; - INT32 t8YOffs[8] = { STEP8(0,8) }; - - INT32 t16XOffs[16] = { STEP8(16*8,1), STEP8(0,1) }; - INT32 t16YOffs[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(gfx0len + gfx1len); // more = more happy-fun. yay! - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, gfx0len); - - GfxDecode(0x0400, 3, 8, 8, Plane_t8, t8XOffs, t8YOffs, 0x40, tmp, DrvGfxROM0); - GfxDecode(0x00ff, 3, 16, 16, Plane_t16spr, t16XOffs, t16YOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, gfx1len); - - GfxDecode(0x0040, 3, 16, 16, Plane_t16, t16XOffs, t16YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 ZoarGfxDecode() -{ - INT32 Plane_t8[3] = { RGN_FRAC(gfx0len, 2,3), RGN_FRAC(gfx0len, 1,3), RGN_FRAC(gfx0len, 0,3) }; - INT32 Plane_t16spr[3] = { RGN_FRAC(0x3000, 2,3), RGN_FRAC(0x3000, 1,3), RGN_FRAC(0x3000, 0,3) }; - INT32 Plane_t16[3] = { RGN_FRAC(gfx1len, 2,3), RGN_FRAC(gfx1len, 1,3), RGN_FRAC(gfx1len, 0,3) }; - - INT32 t8XOffs[8] = { STEP8(0,1) }; - INT32 t8YOffs[8] = { STEP8(0,8) }; - - INT32 t16XOffs[16] = { STEP8(16*8,1), STEP8(0,1) }; - INT32 t16YOffs[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(gfx0len + gfx1len + 0x3000); // more = more happy-fun. yay! - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, gfx0len); - - GfxDecode(0x0400, 3, 8, 8, Plane_t8, t8XOffs, t8YOffs, 0x40, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x3000); - - GfxDecode(0x0080, 3, 16, 16, Plane_t16spr, t16XOffs, t16YOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, gfx1len); - - GfxDecode(0x0040, 3, 16, 16, Plane_t16, t16XOffs, t16YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 MmonkeyInit() // and lnc -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x0c000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0d000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0e000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0f000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSoundROM + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x001000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x002000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x003000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x004000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x005000, 10, 1)) return 1; - gfx0len = 0x6000; - - if (BurnLoadRom(DrvColPROM + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000020, 12, 1)) return 1; - gfx1len = 0x00; - - DrvGfxDecode(); - - } - - memcpy(DrvMainROMdec, DrvMainROM, 0x10000); - - M6502Init(0, TYPE_DECOC10707); - M6502Open(0); - M6502SetWriteHandler(mmonkey_main_write); - M6502SetReadHandler(mmonkey_main_read); - M6502SetReadOpArgHandler(mmonkey_main_read); - M6502SetReadOpHandler(mmonkeyop_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502SetWriteHandler(btime_sound_write); - M6502SetReadHandler(btime_sound_read); - M6502SetReadOpArgHandler(btime_sound_read); - M6502SetReadOpHandler(btime_sound_read); - M6502Close(); - - M6502Open(1); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &ay8910_0_portA_write, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - M6502Close(); - - audio_nmi_type = AUDIO_ENABLE_AY8910; - - GenericTilesInit(); - - // first ay, pass-thru mixer only (CAP_P(0) = passthru) - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - - // second ay, apply a slight bit of lpf to match - filter_rc_init(3, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x15), 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - - filter_rc_set_route(0, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, (lncmode) ? 0.20 : 0.10, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, (lncmode) ? 0.20 : 0.10, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, (lncmode) ? 0.20 : 0.10, BURN_SND_ROUTE_BOTH); - - mmonkeymode = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 DiscoInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x0a000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0b000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0c000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0d000, 3, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0e000, 4, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0f000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSoundROM + 0x0000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x000000, 7, 1)) return 1; - - // Graphics are decoded from RAM. - gfx0len = 0x6000; // DrvCharRAM mapped-size - gfx1len = 0x00; - } - - M6502Init(0, TYPE_DECOCPU7); - M6502Open(0); - M6502SetWriteHandler(disco_main_write); - M6502SetReadHandler(disco_main_read); - M6502SetReadOpArgHandler(disco_main_read); - M6502SetReadOpHandler(disco_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502SetWriteHandler(disco_sound_write); - M6502SetReadHandler(disco_sound_read); - M6502SetReadOpArgHandler(disco_sound_read); - M6502SetReadOpHandler(disco_sound_read); - M6502Close(); - - M6502Open(1); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &ay8910_0_portA_write, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - M6502Close(); - - audio_nmi_type = AUDIO_ENABLE_AY8910; - - discomode = 1; - - GenericTilesInit(); - - // first ay, pass-thru mixer only (CAP_P(0) = passthru) - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - - // second ay, apply a slight bit of lpf to match - filter_rc_init(3, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x15), 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - - filter_rc_set_route(0, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, 0.20, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 BnjInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (brubbermode) - { - if (BurnLoadRom(DrvMainROM + 0xc000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0xe000, 1, 1)) return 1; - - if (BurnLoadRom(DrvSoundROM + 0x0000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x002000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x004000, 5, 1)) return 1; - gfx0len = 0x6000; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x001000, 7, 1)) return 1; - gfx1len = 0x2000; - - DrvBnjGfxDecode(); - } - else - { // bnj - if (BurnLoadRom(DrvMainROM + 0xa000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0xc000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0xe000, 2, 1)) return 1; - - if (BurnLoadRom(DrvSoundROM + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x002000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x004000, 6, 1)) return 1; - gfx0len = 0x6000; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x001000, 8, 1)) return 1; - gfx1len = 0x2000; - - DrvBnjGfxDecode(); - } - - M6502Init(0, TYPE_DECOC10707); - M6502Open(0); - M6502SetWriteHandler(bnj_main_write); - M6502SetReadHandler(bnj_main_read); - M6502SetReadOpArgHandler(bnj_main_read); - M6502SetReadOpHandler(bnj_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502SetWriteHandler(btime_sound_write); - M6502SetReadHandler(btime_sound_read); - M6502SetReadOpArgHandler(btime_sound_read); - M6502SetReadOpHandler(btime_sound_read); - M6502Close(); - - M6502Open(1); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &ay8910_0_portA_write, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - M6502Close(); - - audio_nmi_type = AUDIO_ENABLE_DIRECT; - - bnjskew = 1; - - GenericTilesInit(); - - // first ay, pass-thru mixer only (CAP_P(0) = passthru) - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - - // second ay, apply a slight bit of lpf to match - filter_rc_init(3, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x15), 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - - filter_rc_set_route(0, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, 0.25, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, 0.25, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, 0.25, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 BtimeInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - INT32 base = (btime3mode) ? 0xb000 : 0xc000; - - if (BurnLoadRom(DrvMainROM + base + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + base + 0x01000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + base + 0x02000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + base + 0x03000, 3, 1)) return 1; - - if (btime3mode) { - if (BurnLoadRom(DrvMainROM + base + 0x04000, 4, 1)) return 1; // btime3mode - } - - if (BurnLoadRom(DrvSoundROM + 0x0000, 4+btime3mode, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5+btime3mode, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x001000, 6+btime3mode, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x002000, 7+btime3mode, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x003000, 8+btime3mode, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x004000, 9+btime3mode, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x005000, 10+btime3mode, 1)) return 1; - gfx0len = 0x6000; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11+btime3mode, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000800, 12+btime3mode, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x001000, 13+btime3mode, 1)) return 1; - gfx1len = 0x1800; - - if (BurnLoadRom(DrvBgMapROM + 0x000000, 14+btime3mode, 1)) return 1; - - DrvGfxDecode(); - - } - - btimemode = 1; - - M6502Init(0, TYPE_DECOCPU7); - M6502Open(0); - M6502SetWriteHandler(btime_main_write); - M6502SetReadHandler(btime_main_read); - M6502SetReadOpArgHandler(btime_main_read); - M6502SetReadOpHandler(btime_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502SetWriteHandler(btime_sound_write); - M6502SetReadHandler(btime_sound_read); - M6502SetReadOpArgHandler(btime_sound_read); - M6502SetReadOpHandler(btime_sound_read); - M6502Close(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &ay8910_0_portA_write, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - audio_nmi_type = AUDIO_ENABLE_DIRECT; - - GenericTilesInit(); - - // first ay, lots of lowpass hiss-killer. - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(0x330), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(0x330), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(0x330), 1); - filter_rc_set_src_gain(0, 0.55); - filter_rc_set_src_gain(1, 0.55); - filter_rc_set_src_gain(2, 0.55); - - // second ay, apply a slight bit of lpf to match - filter_rc_init(3, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x25), 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - - // #6 takes mixed #0,1,2 and highpasses it a little to get rid of the dc offset - filter_rc_init(6, FLT_RC_HIGHPASS, 3846, 0, 0, CAP_N(0x310), 0); - filter_rc_set_src_stereo(6); - - hpfiltbuffer = (INT16*)BurnMalloc(nBurnSoundLen*8); // for #6 - - filter_rc_set_route(0, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 1.00, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, 0.35, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, 0.15, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, 0.15, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 ZoarInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x0d000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0e000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x0f000, 2, 1)) return 1; - - memset(&DrvMainROM[0xd50a], 0xea, 8); // patch bad rom with nops (othewise freezes @ boot) - - if (BurnLoadRom(DrvSoundROM + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x001000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x002000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x003000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x004000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x005000, 9, 1)) return 1; - gfx0len = 0x6000; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000800, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x001000, 12, 1)) return 1; - gfx1len = 0x1800; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x001000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x002000, 15, 1)) return 1; - - if (BurnLoadRom(DrvBgMapROM + 0x00000, 16, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x000000, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000020, 18, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000040, 19, 1)) return 1; - - ZoarGfxDecode(); - - } - - M6502Init(0, TYPE_DECOCPU7); - M6502Open(0); - M6502SetWriteHandler(zoar_main_write); - M6502SetReadHandler(zoar_main_read); - M6502SetReadOpArgHandler(zoar_main_read); - M6502SetReadOpHandler(zoar_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502SetWriteHandler(btime_sound_write); - M6502SetReadHandler(btime_sound_read); - M6502SetReadOpArgHandler(btime_sound_read); - M6502SetReadOpHandler(btime_sound_read); - M6502Close(); - - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, &ay8910_0_portA_write, NULL); - AY8910Init(1, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - audio_nmi_type = AUDIO_ENABLE_AY8910; - zoarmode = 1; - - GenericTilesInit(); - - // first ay, pass-thru mixer only (CAP_P(0) = passthru) - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 0); - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 1); - - // second ay, apply a slight bit of lpf to match - filter_rc_init(3, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x15), 1); - filter_rc_init(4, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - filter_rc_init(5, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(10*0x10), 1); - - filter_rc_set_route(0, 0.25, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 0.25, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 0.25, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(3, 0.25, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(4, 0.25, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(5, 0.25, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - - AY8910Exit(0); - AY8910Exit(1); - - filter_rc_exit(); - - BurnFree(AllMem); - - if (btimemode) { - BurnFree(hpfiltbuffer); - hpfiltbuffer = NULL; - } - - btimemode = 0; - btime3mode = 0; - brubbermode = 0; - discomode = 0; - lncmode = 0; - zoarmode = 0; - mmonkeymode = 0; - bnjskew = 0; - zippysoundinit = 0; - - audio_nmi_type = AUDIO_ENABLE_NONE; - - return 0; -} - -static void BtimePaletteRecalc() -{ - for (INT32 i = 0; i < 0x10; i++) { - btimepalettewrite(i, ~DrvPalRAM[i]); - } -} - -static void draw_background(UINT8 *tmap, INT32 color) -{ - const UINT8 *gfx = DrvBgMapROM; - int scroll = -(bnj_scroll2 | ((bnj_scroll1 & 0x03) << 8)); - - for (INT32 i = 0; i < 5; i++, scroll += 256) - { - INT32 tileoffset = tmap[i & 3] * 0x100; - - if (scroll > 256) break; - if (scroll < -256) continue; - - for (INT32 offs = 0; offs < 0x100; offs++) - { - int x = 240 - (16 * (offs / 16) + scroll) - 1; - int y = 16 * (offs % 16); - - if (flipscreen) - { - x = 240 - x; - y = 240 - y; - } - - y -= 8; - x -= 8; - - if (x < -15 || x >= 256 || y < -15 || y >= 256) continue; - - INT32 code = gfx[tileoffset + offs] & 0x7f; - - Render16x16Tile_Clip(pTransDraw, code, x, y, color, 3, (zoarmode) ? 0 : 8, DrvGfxROM2); - } - } -} - -static void draw_chars(UINT8 transparency, UINT8 color, int priority) -{ - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 x = 31 - (offs / 32); - INT32 y = offs % 32; - - UINT16 code = DrvVidRAM[offs] + 256 * (DrvColRAM[offs] & 3); - - if ((priority != -1) && (priority != ((code >> 7) & 0x01))) - continue; - - if (flipscreen) - { - x = 31 - x; - y = 31 - y; - } - - y -= 1; - x -= (bnjskew) ? 0 : 1; - - if (transparency) { - Render8x8Tile_Mask_Clip(pTransDraw, code, x * 8, y * 8, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, x * 8, y * 8, color, 3, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites(UINT8 color, UINT8 sprite_y_adjust, UINT8 sprite_y_adjust_flip_screen, UINT8 *sprite_ram, INT32 interleave) -{ - for (INT32 i = 0, offs = 0; i < 8; i++, offs += 4 * interleave) - { - INT32 x, y; - UINT8 flipx, flipy; - - if (!(sprite_ram[offs + 0] & 0x01)) continue; - - x = 240 - sprite_ram[offs + 3 * interleave]; - y = 240 - sprite_ram[offs + 2 * interleave]; - - flipx = sprite_ram[offs + 0] & 0x04; - flipy = sprite_ram[offs + 0] & 0x02; - - if (flipscreen) - { - x = 240 - x; - y = 240 - y + sprite_y_adjust_flip_screen; - - flipx = !flipx; - flipy = !flipy; - } - - - INT32 code = sprite_ram[offs + interleave]; - - y -= 8; - x -= (bnjskew) ? 0 : 8; - - y = y - sprite_y_adjust; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, 3, 0, 0, DrvGfxROM1); - } - } - - y = y + (flipscreen ? -256 : 256); - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, 3, 0, 0, DrvGfxROM1); - } - } - } -} - -static INT32 BtimeDraw() -{ - if (DrvRecalc) { - BtimePaletteRecalc(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (bnj_scroll1 & 0x10) { - INT32 start = 0; - UINT8 tmap[5]; - - if (flipscreen) - start = 0; - else - start = 1; - - for (INT32 i = 0; i < 4; i++) - { - tmap[i] = start | (bnj_scroll1 & 0x04); - start = (start + 1) & 0x03; - } - - if (nBurnLayer & 1) draw_background(&tmap[0], 0); - if (nBurnLayer & 2) draw_chars(1, 0, -1); - } else { - if (nBurnLayer & 2) draw_chars(0, 0, -1); - } - - if (nBurnLayer & 4) draw_sprites(0, 1, 0, DrvVidRAM, 0x20); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 ZoarDraw() -{ - if (DrvRecalc) { - discopaletteupdate(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (bnj_scroll1 & 0x04) { - if (nBurnLayer & 1) draw_background(DrvScrollRAM, btime_palette); - if (nBurnLayer & 2) draw_chars(1, btime_palette + 1, -1); - } else { - if (nBurnLayer & 2) draw_chars(0, btime_palette + 1, -1); - } - - if (nBurnLayer & 4) draw_sprites(btime_palette + 1, 1, 2, DrvVidRAM + 0x1f, 0x20); - if (nBurnLayer & 8) draw_sprites(btime_palette + 1, 1, 2, DrvVidRAM, 0x20); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 BnjDraw() -{ - if (DrvRecalc) { - BtimePaletteRecalc(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (bnj_scroll1) { - GenericTilesSetClipRaw(0,512,0,256); - - for (INT32 offs = 0x200 - 1; offs >= 0; offs--) - { - INT32 sx = 16 * ((offs < 0x100) ? ((offs % 0x80) / 8) : ((offs % 0x80) / 8) + 16); - INT32 sy = 16 * (((offs % 0x100) < 0x80) ? offs % 8 : (offs % 8) + 8); - sx = 496 - sx; - - if (flipscreen) - { - sx = 496 - sx; - sy = 240 - sy; - } - INT32 code = (DrvBGRAM[offs] >> 4) + ((offs & 0x80) >> 3) + 32; - - sy -= 8; - - Render16x16Tile_Clip(DrvBGBitmap, code, sx, sy, 0, 3, 8, DrvGfxROM2); - } - - GenericTilesClearClipRaw(); - - /* copy the background bitmap to the screen */ - INT32 scroll = (bnj_scroll1 & 0x02) * 128 + 511 - bnj_scroll2; - if (!flipscreen) - scroll = 767 - scroll; - - //copyscrollbitmap(bitmap, *m_background_bitmap, 1, &scroll, 0, 0, cliprect); - // copy the BGBitmap to pTransDraw - for (INT32 sy = 0; sy < nScreenHeight; sy++) { - - UINT16 *src = DrvBGBitmap + sy * 512; - UINT16 *dst = pTransDraw + sy * nScreenWidth; - - for (INT32 sx = 0; sx < nScreenWidth; sx++) { - dst[sx] = src[(sx-scroll)&0x1ff]; - } - } - - /* copy the low priority characters followed by the sprites - then the high priority characters */ - - if (nBurnLayer & 2) draw_chars(1, 0, 1); - if (nBurnLayer & 4) draw_sprites(0, 1, 0, DrvVidRAM, 0x20); - if (nBurnLayer & 8) draw_chars(1, 0, 0); - } - else - { - if (nBurnLayer & 2) draw_chars(0, 0, -1); - if (nBurnLayer & 4) draw_sprites(0, 0, 0, DrvVidRAM, 0x20); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 eggsDraw() -{ - if (DrvRecalc) { - lncpaletteupdate(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 2) draw_chars(0, 0, -1); - if (nBurnLayer & 4) draw_sprites(0, 0, 0, DrvVidRAM, 0x20); // for eggs - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 LncDraw() -{ - if (DrvRecalc) { - lncpaletteupdate(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 2) draw_chars(0, 0, -1); - if (nBurnLayer & 4) draw_sprites(0, 1, 2, DrvVidRAM, 0x20); // for eggs - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DiscoDraw() -{ - if (DrvRecalc) { - discopaletteupdate(); - DrvRecalc = 0; - } - - DrvDiscoGfxDecode(); // decode from RAM - - BurnTransferClear(); - - if (nBurnLayer & 2) draw_chars(0, btime_palette, -1); - if (nBurnLayer & 4) draw_sprites(btime_palette, 0, 0, DrvSpriteRAM, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -#define FILTERDEBUG 0 - -#if FILTERDEBUG -extern int counter; // save for later debugging/tweaking. -dink -int lastctr = 0; -#endif - -static INT32 BtimeFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6502NewFrame(); - - { - static UINT8 prevcoin = 0; - - memset(DrvInputs, ((discomode) ? 0x00 : 0xff), 3); - - if (btimemode) { - DrvInputs[0] = DrvInputs[1] = 0; - DrvInputs[2] = 0x3f; - } - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - if (btimemode) { - ProcessJoystick(&DrvInputs[0], 0, 2,3,1,0, INPUT_4WAY | INPUT_CLEAROPPOSITES | INPUT_MAKEACTIVELOW ); - ProcessJoystick(&DrvInputs[1], 1, 2,3,1,0, INPUT_4WAY | INPUT_CLEAROPPOSITES | INPUT_MAKEACTIVELOW ); - } - - UINT8 thiscoin = (DrvJoy3[6] << 6) | (DrvJoy3[7] << 7); - - if (thiscoin && (prevcoin != thiscoin)) { - M6502Open(0); - if (discomode || zoarmode || btime3mode) - M6502SetIRQLine(0, CPU_IRQSTATUS_HOLD); - else - M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - M6502Close(); - } - prevcoin = thiscoin; - } - - INT32 nInterleave = 272; - - INT32 nCyclesTotal[2] = { ((discomode) ? 750000 : 1500000) / 60, ((zippysoundinit) ? 6500000 : 500000) / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - if (zippysoundinit) zippysoundinit--; - - vblank = 0x80; - -#if FILTERDEBUG - if (counter != lastctr) { // save this block for tweaking filters etc. -dink - lastctr = counter; - - //btimepalettewrite(3, 0x3f); - //filter_rc_set_RC(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(0x4a0 + (counter * 0x10))); - //filter_rc_set_RC(7, FLT_RC_LOWPASS, 1000+counter*100, 5100, 0, CAP_N(0x310/* + (counter * 0x10)*/ )); - //filter_rc_set_RC(6, FLT_RC_HIGHPASS, 3846, 0, 0, CAP_N(0x310+counter*0x10)); - //filter_rc_set_RC(7, FLT_RC_LOWPASS, 3846, 0, 0, CAP_N(0x310 + (counter * 0x10))); - } -#endif - - for (INT32 i = 0; i < nInterleave; i++) - { - M6502Open(0); - INT32 nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += M6502Run(nSegment); - M6502Close(); - - if (i == 248) vblank = 0x80; - if (i == 8) { - vblank = 0x00; - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - } - - M6502Open(1); - nSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - nCyclesDone[1] += M6502Run(nSegment); - - audio_nmi_state = (i + 1) & 8; - M6502SetIRQLine(0x20, (audio_nmi_enable && audio_nmi_state) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - - M6502Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - - if (btimemode) { - filter_rc_update(6, pSoundBuf, hpfiltbuffer, nSegmentLength); - memmove(pSoundBuf, hpfiltbuffer, nSegmentLength*4); - } - - filter_rc_update(3, pAY8910Buffer[3], pSoundBuf, nSegmentLength); - filter_rc_update(4, pAY8910Buffer[4], pSoundBuf, nSegmentLength); - filter_rc_update(5, pAY8910Buffer[5], pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - - filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); - filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); - filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); - - if (btimemode) { - filter_rc_update(6, pSoundBuf, hpfiltbuffer, nSegmentLength); - memmove(pSoundBuf, hpfiltbuffer, nSegmentLength*4); - } - - filter_rc_update(3, pAY8910Buffer[3], pSoundBuf, nSegmentLength); - filter_rc_update(4, pAY8910Buffer[4], pSoundBuf, nSegmentLength); - filter_rc_update(5, pAY8910Buffer[5], pSoundBuf, nSegmentLength); - } - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - if (mmonkeymode) { - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvMainROMdec; - ba.nLen = 0x10000; - ba.szName = "decROMops"; - BurnAcb(&ba); - } - } - - if (nAction & ACB_DRIVER_DATA) { - M6502Scan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(vblank); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(audio_nmi_type); - SCAN_VAR(audio_nmi_enable); - SCAN_VAR(audio_nmi_state); - SCAN_VAR(bnj_scroll1); - SCAN_VAR(bnj_scroll2); - } - - return 0; -} - -// Burger Time (Data East set 1) - -static struct BurnRomInfo btimeRomDesc[] = { - { "aa04.9b", 0x1000, 0x368a25b5, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "aa06.13b", 0x1000, 0xb4ba400d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "aa05.10b", 0x1000, 0x8005bffa, 1 | BRF_PRG | BRF_ESS }, // 2 - { "aa07.15b", 0x1000, 0x086440ad, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ab14.12h", 0x1000, 0xf55e5211, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - - { "aa12.7k", 0x1000, 0xc4617243, 3 | BRF_GRA }, // 5 gfx1 - { "ab13.9k", 0x1000, 0xac01042f, 3 | BRF_GRA }, // 6 - { "ab10.10k", 0x1000, 0x854a872a, 3 | BRF_GRA }, // 7 - { "ab11.12k", 0x1000, 0xd4848014, 3 | BRF_GRA }, // 8 - { "aa8.13k", 0x1000, 0x8650c788, 3 | BRF_GRA }, // 9 - { "ab9.15k", 0x1000, 0x8dec15e6, 3 | BRF_GRA }, // 10 - - { "ab00.1b", 0x0800, 0xc7a14485, 4 | BRF_GRA }, // 11 gfx2 - { "ab01.3b", 0x0800, 0x25b49078, 4 | BRF_GRA }, // 12 - { "ab02.4b", 0x0800, 0xb8ef56c3, 4 | BRF_GRA }, // 13 - - { "ab03.6b", 0x0800, 0xd26bc1f3, 5 | BRF_GRA }, // 14 bg_map -}; - -STD_ROM_PICK(btime) -STD_ROM_FN(btime) - -struct BurnDriver BurnDrvBtime = { - "btime", NULL, NULL, NULL, "1982", - "Burger Time (Data East set 1)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, btimeRomInfo, btimeRomName, NULL, NULL, BtimeInputInfo, BtimeDIPInfo, - BtimeInit, DrvExit, BtimeFrame, BtimeDraw, DrvScan, &DrvRecalc, 16, - 240, 242, 3, 4 -}; - -// Burger Time (Data East set 2) - -static struct BurnRomInfo btime2RomDesc[] = { - { "aa04.9b2", 0x1000, 0xa041e25b, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "aa06.13b", 0x1000, 0xb4ba400d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "aa05.10b", 0x1000, 0x8005bffa, 1 | BRF_PRG | BRF_ESS }, // 2 - { "aa07.15b", 0x1000, 0x086440ad, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ab14.12h", 0x1000, 0xf55e5211, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - - { "aa12.7k", 0x1000, 0xc4617243, 3 | BRF_GRA }, // 5 gfx1 - { "ab13.9k", 0x1000, 0xac01042f, 3 | BRF_GRA }, // 6 - { "ab10.10k", 0x1000, 0x854a872a, 3 | BRF_GRA }, // 7 - { "ab11.12k", 0x1000, 0xd4848014, 3 | BRF_GRA }, // 8 - { "aa8.13k", 0x1000, 0x8650c788, 3 | BRF_GRA }, // 9 - { "ab9.15k", 0x1000, 0x8dec15e6, 3 | BRF_GRA }, // 10 - - { "ab00.1b", 0x0800, 0xc7a14485, 4 | BRF_GRA }, // 11 gfx2 - { "ab01.3b", 0x0800, 0x25b49078, 4 | BRF_GRA }, // 12 - { "ab02.4b", 0x0800, 0xb8ef56c3, 4 | BRF_GRA }, // 13 - - { "ab03.6b", 0x0800, 0xd26bc1f3, 5 | BRF_GRA }, // 14 bg_map -}; - -STD_ROM_PICK(btime2) -STD_ROM_FN(btime2) - -struct BurnDriver BurnDrvBtime2 = { - "btime2", "btime", NULL, NULL, "1982", - "Burger Time (Data East set 2)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, btime2RomInfo, btime2RomName, NULL, NULL, BtimeInputInfo, BtimeDIPInfo, - BtimeInit, DrvExit, BtimeFrame, BtimeDraw, DrvScan, &DrvRecalc, 16, - 240, 242, 3, 4 -}; - -INT32 Btime3Init() -{ - btime3mode = 1; - return BtimeInit(); -} - -// Burger Time (Data East USA) - -static struct BurnRomInfo btime3RomDesc[] = { - { "ab05a-3.12b", 0x1000, 0x12e9f58c, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "ab04-3.9b", 0x1000, 0x5d90c696, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ab06-3.13b", 0x1000, 0xe0b993ad, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ab05-3.10b", 0x1000, 0xc2b44b7f, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ab07-3.15b", 0x1000, 0x91986594, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "ab14-1.12h", 0x1000, 0xf55e5211, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "ab12-1.7k", 0x1000, 0x6c79f79f, 3 | BRF_GRA }, // 6 gfx1 - { "ab13-1.9k", 0x1000, 0xac01042f, 3 | BRF_GRA }, // 7 - { "ab10-1.10k", 0x1000, 0x854a872a, 3 | BRF_GRA }, // 8 - { "ab11-1.12k", 0x1000, 0xd4848014, 3 | BRF_GRA }, // 9 - { "ab8-1.13k", 0x1000, 0x70b35bbe, 3 | BRF_GRA }, // 10 - { "ab9-1.15k", 0x1000, 0x8dec15e6, 3 | BRF_GRA }, // 11 - - { "ab00-1.1b", 0x0800, 0xc7a14485, 4 | BRF_GRA }, // 12 gfx2 - { "ab01-1.3b", 0x0800, 0x25b49078, 4 | BRF_GRA }, // 13 - { "ab02-1.4b", 0x0800, 0xb8ef56c3, 4 | BRF_GRA }, // 14 - - { "ab03-3.6b", 0x0800, 0xf699d797, 5 | BRF_GRA }, // 15 bg_map -}; - -STD_ROM_PICK(btime3) -STD_ROM_FN(btime3) - -struct BurnDriver BurnDrvBtime3 = { - "btime3", "btime", NULL, NULL, "1982", - "Burger Time (Data East USA)\0", "graphics issues, use parent romset!", "Data East USA Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, btime3RomInfo, btime3RomName, NULL, NULL, BtimeInputInfo, BtimeDIPInfo, - Btime3Init, DrvExit, BtimeFrame, BtimeDraw, DrvScan, &DrvRecalc, 16, - 240, 242, 3, 4 -}; - -// Burger Time (Midway) - -static struct BurnRomInfo btimemRomDesc[] = { - { "ab05a1.12b", 0x1000, 0x0a98b230, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "ab04.9b", 0x1000, 0x797e5f75, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ab06.13b", 0x1000, 0xc77f3f64, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ab05.10b", 0x1000, 0xb0d3640f, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ab07.15b", 0x1000, 0xa142f862, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "ab14.12h", 0x1000, 0xf55e5211, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "ab12.7k", 0x1000, 0x6c79f79f, 3 | BRF_GRA }, // 6 gfx1 - { "ab13.9k", 0x1000, 0xac01042f, 3 | BRF_GRA }, // 7 - { "ab10.10k", 0x1000, 0x854a872a, 3 | BRF_GRA }, // 8 - { "ab11.12k", 0x1000, 0xd4848014, 3 | BRF_GRA }, // 9 - { "ab8.13k", 0x1000, 0x70b35bbe, 3 | BRF_GRA }, // 10 - { "ab9.15k", 0x1000, 0x8dec15e6, 3 | BRF_GRA }, // 11 - - { "ab00.1b", 0x0800, 0xc7a14485, 4 | BRF_GRA }, // 12 gfx2 - { "ab01.3b", 0x0800, 0x25b49078, 4 | BRF_GRA }, // 13 - { "ab02.4b", 0x0800, 0xb8ef56c3, 4 | BRF_GRA }, // 14 - - { "ab03.6b", 0x0800, 0xd26bc1f3, 5 | BRF_GRA }, // 15 bg_map -}; - -STD_ROM_PICK(btimem) -STD_ROM_FN(btimem) - -struct BurnDriver BurnDrvBtimem = { - "btimem", "btime", NULL, NULL, "1982", - "Burger Time (Midway)\0", NULL, "Data East (Bally Midway license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, btimemRomInfo, btimemRomName, NULL, NULL, BtimeInputInfo, BtimeDIPInfo, - Btime3Init, DrvExit, BtimeFrame, BtimeDraw, DrvScan, &DrvRecalc, 16, - 240, 242, 3, 4 -}; - - -// Minky Monkey - -static struct BurnRomInfo mmonkeyRomDesc[] = { - { "mmonkey.e4", 0x1000, 0x8d31bf6a, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "mmonkey.d4", 0x1000, 0xe54f584a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mmonkey.b4", 0x1000, 0x399a161e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mmonkey.a4", 0x1000, 0xf7d3d1e3, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mmonkey.h1", 0x1000, 0x5bcb2e81, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - - { "mmonkey.l11", 0x1000, 0xb6aa8566, 3 | BRF_GRA }, // 5 gfx1 - { "mmonkey.m11", 0x1000, 0x6cc4d0c4, 3 | BRF_GRA }, // 6 - { "mmonkey.l13", 0x1000, 0x2a343b7e, 3 | BRF_GRA }, // 7 - { "mmonkey.m13", 0x1000, 0x0230b50d, 3 | BRF_GRA }, // 8 - { "mmonkey.l14", 0x1000, 0x922bb3e1, 3 | BRF_GRA }, // 9 - { "mmonkey.m14", 0x1000, 0xf943e28c, 3 | BRF_GRA }, // 10 - - { "mmi6331.m5", 0x0020, 0x55e28b32, 4 | BRF_GRA }, // 11 proms - { "sb-4c", 0x0020, 0xa29b4204, 4 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(mmonkey) -STD_ROM_FN(mmonkey) - -struct BurnDriver BurnDrvMmonkey = { - "mmonkey", NULL, NULL, NULL, "1982", - "Minky Monkey\0", NULL, "Technos Japan / Roller Tron", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, mmonkeyRomInfo, mmonkeyRomName, NULL, NULL, MmonkeyInputInfo, MmonkeyDIPInfo, - MmonkeyInit, DrvExit, BtimeFrame, eggsDraw, DrvScan, &DrvRecalc, 16, - 240, 242, 3, 4 -}; - -INT32 brubberInit() -{ - brubbermode = 1; - return BnjInit(); -} - -// Burnin' Rubber - -static struct BurnRomInfo brubberRomDesc[] = { - { "brubber.12c", 0x2000, 0xb5279c70, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "brubber.12d", 0x2000, 0xb2ce51f5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bnj6c.bin", 0x1000, 0x8c02f662, 2 | BRF_PRG | BRF_ESS }, // 2 audiocpu - - { "bnj4e.bin", 0x2000, 0xb864d082, 3 | BRF_GRA }, // 3 gfx1 - { "bnj4f.bin", 0x2000, 0x6c31d77a, 3 | BRF_GRA }, // 4 - { "bnj4h.bin", 0x2000, 0x5824e6fb, 3 | BRF_GRA }, // 5 - - { "bnj10e.bin", 0x1000, 0xf4e9eb49, 4 | BRF_GRA }, // 6 gfx2 - { "bnj10f.bin", 0x1000, 0xa9ffacb4, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(brubber) -STD_ROM_FN(brubber) - -struct BurnDriver BurnDrvBrubber = { - "brubber", NULL, NULL, NULL, "1982", - "Burnin' Rubber\0", NULL, "Data East", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, brubberRomInfo, brubberRomName, NULL, NULL, BnjInputInfo, BnjDIPInfo, - brubberInit, DrvExit, BtimeFrame, BnjDraw, DrvScan, &DrvRecalc, 16, - 240, 256, 3, 4 -}; - - -// Bump 'n' Jump - -static struct BurnRomInfo bnjRomDesc[] = { - { "ad08.12b", 0x2000, 0x8d649bd5, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "ad07.12c", 0x2000, 0x7a27f5f4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ad06.12d", 0x2000, 0xf855a2d2, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ad05.6c", 0x1000, 0x8c02f662, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "ad00.4e", 0x2000, 0xb864d082, 3 | BRF_GRA }, // 4 gfx1 - { "ad01.4f", 0x2000, 0x6c31d77a, 3 | BRF_GRA }, // 5 - { "ad02.4h", 0x2000, 0x5824e6fb, 3 | BRF_GRA }, // 6 - - { "ad03.10e", 0x1000, 0xf4e9eb49, 4 | BRF_GRA }, // 7 gfx2 - { "ad04.10f", 0x1000, 0xa9ffacb4, 4 | BRF_GRA }, // 8 - - { "pb-5.10k.bin", 0x002c, 0xdc72a65f, 5 | BRF_OPT }, // 9 plds - { "pb-4.2d.bin", 0x0001, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 10 -}; - -STD_ROM_PICK(bnj) -STD_ROM_FN(bnj) - -struct BurnDriver BurnDrvBnj = { - "bnj", "brubber", NULL, NULL, "1982", - "Bump 'n' Jump\0", NULL, "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, bnjRomInfo, bnjRomName, NULL, NULL, BnjInputInfo, BnjDIPInfo, - BnjInit, DrvExit, BtimeFrame, BnjDraw, DrvScan, &DrvRecalc, 16, - 240, 256, 3, 4 -}; - -// Disco No.1 - -static struct BurnRomInfo discoRomDesc[] = { - { "disco.w5", 0x1000, 0xb2c87b78, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "disco.w4", 0x1000, 0xad7040ee, 1 | BRF_PRG | BRF_ESS }, // 1 - { "disco.w3", 0x1000, 0x12fb4f08, 1 | BRF_PRG | BRF_ESS }, // 2 - { "disco.w2", 0x1000, 0x73f6fb2f, 1 | BRF_PRG | BRF_ESS }, // 3 - { "disco.w1", 0x1000, 0xee7b536b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "disco.w0", 0x1000, 0x7c26e76b, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "disco.w6", 0x1000, 0xd81e781e, 2 | BRF_PRG | BRF_ESS }, // 6 audiocpu - - { "disco.clr", 0x0020, 0xa393f913, 3 | BRF_GRA }, // 7 proms -}; - -STD_ROM_PICK(disco) -STD_ROM_FN(disco) - -struct BurnDriver BurnDrvDisco = { - "disco", NULL, NULL, NULL, "1982", - "Disco No.1\0", NULL, "Data East", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, discoRomInfo, discoRomName, NULL, NULL, DiscoInputInfo, DiscoDIPInfo, - DiscoInit, DrvExit, BtimeFrame, DiscoDraw, DrvScan, &DrvRecalc, 32, - 240, 242, 3, 4 -}; - - -// Disco No.1 (Rev.F) - -static struct BurnRomInfo discofRomDesc[] = { - { "w5-f.1a", 0x1000, 0x9d53c71c, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "w4-f.2a", 0x1000, 0xc1f8d747, 1 | BRF_PRG | BRF_ESS }, // 1 - { "w3-f.4a", 0x1000, 0x9aadd252, 1 | BRF_PRG | BRF_ESS }, // 2 - { "w2-f.6a", 0x1000, 0xf131a5bb, 1 | BRF_PRG | BRF_ESS }, // 3 - { "w1-f.9a", 0x1000, 0xa6ce9a19, 1 | BRF_PRG | BRF_ESS }, // 4 - { "w0-f.9a", 0x1000, 0xb3787a92, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "w6-.1b", 0x1000, 0xd81e781e, 2 | BRF_PRG | BRF_ESS }, // 6 audiocpu - - { "disco.clr", 0x0020, 0xa393f913, 3 | BRF_GRA }, // 7 proms -}; - -STD_ROM_PICK(discof) -STD_ROM_FN(discof) - -struct BurnDriver BurnDrvDiscof = { - "discof", "disco", NULL, NULL, "1982", - "Disco No.1 (Rev.F)\0", NULL, "Data East", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, discofRomInfo, discofRomName, NULL, NULL, DiscoInputInfo, DiscoDIPInfo, - DiscoInit, DrvExit, BtimeFrame, DiscoDraw, DrvScan, &DrvRecalc, 32, - 240, 242, 3, 4 -}; - -INT32 LncInit() -{ - lncmode = 1; - return MmonkeyInit(); -} - -// Lock'n'Chase - -static struct BurnRomInfo lncRomDesc[] = { - { "s3-3d", 0x1000, 0x1ab4f2c2, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "s2-3c", 0x1000, 0x5e46b789, 1 | BRF_PRG | BRF_ESS }, // 1 - { "s1-3b", 0x1000, 0x1308a32e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "s0-3a", 0x1000, 0xbeb4b1fc, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sa-1h", 0x1000, 0x379387ec, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - - { "s4-11l", 0x1000, 0xa2162a9e, 3 | BRF_GRA }, // 5 gfx1 - { "s5-11m", 0x1000, 0x12f1c2db, 3 | BRF_GRA }, // 6 - { "s6-13l", 0x1000, 0xd21e2a57, 3 | BRF_GRA }, // 7 - { "s7-13m", 0x1000, 0xc4f247cd, 3 | BRF_GRA }, // 8 - { "s8-15l", 0x1000, 0x672a92d0, 3 | BRF_GRA }, // 9 - { "s9-15m", 0x1000, 0x87c8ee9a, 3 | BRF_GRA }, // 10 - - { "sc-5m", 0x0020, 0x2a976ebe, 4 | BRF_GRA }, // 11 proms - { "sb-4c", 0x0020, 0xa29b4204, 4 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(lnc) -STD_ROM_FN(lnc) - -struct BurnDriver BurnDrvLnc = { - "lnc", NULL, NULL, NULL, "1981", - "Lock'n'Chase\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, lncRomInfo, lncRomName, NULL, NULL, LncInputInfo, LncDIPInfo, - LncInit, DrvExit, BtimeFrame, LncDraw, DrvScan, &DrvRecalc, 16, - 240, 242, 3, 4 -}; - -// Zoar - -static struct BurnRomInfo zoarRomDesc[] = { - { "z15.12b", 0x1000, 0x1f0cfdb7, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "z16.13b", 0x1000, 0x7685999c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "z17.15b", 0x1000, 0x619ea867, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "z09.13c", 0x1000, 0x18d96ff1, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "z00.3l", 0x1000, 0xfd2dcb64, 3 | BRF_GRA }, // 4 gfx1 - { "z01.5l", 0x1000, 0x74d3ca48, 3 | BRF_GRA }, // 5 - { "z03.8l", 0x1000, 0x77b7df14, 3 | BRF_GRA }, // 6 - { "z04.9l", 0x1000, 0x9be786de, 3 | BRF_GRA }, // 7 - { "z06.12l", 0x1000, 0x07638c71, 3 | BRF_GRA }, // 8 - { "z07.14l", 0x1000, 0xf4710f25, 3 | BRF_GRA }, // 9 - - { "z10.1b", 0x0800, 0xaa8bcab8, 4 | BRF_GRA }, // 10 gfx2 - { "z11.3b", 0x0800, 0xdcdad357, 4 | BRF_GRA }, // 11 - { "z12.4b", 0x0800, 0xed317e40, 4 | BRF_GRA }, // 12 - - { "z02.6l", 0x1000, 0xd8c3c122, 5 | BRF_GRA }, // 13 gfx3 - { "z05.14l", 0x1000, 0x05dc6b09, 5 | BRF_GRA }, // 14 - { "z08.15l", 0x1000, 0x9a148551, 5 | BRF_GRA }, // 15 - - { "z13.6b", 0x1000, 0x8fefa960, 6 | BRF_GRA }, // 16 bg_map - - { "z20.1l", 0x0020, 0xa63f0a07, 7 | BRF_GRA }, // 17 proms - { "z21.2l", 0x0020, 0x5e1e5788, 7 | BRF_GRA }, // 18 - { "z19.7b", 0x0020, 0x03ee3a96, 7 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(zoar) -STD_ROM_FN(zoar) - -struct BurnDriver BurnDrvZoar = { - "zoar", NULL, NULL, NULL, "1982", - "Zoar\0", "Sound issues..", "Data East USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, zoarRomInfo, zoarRomName, NULL, NULL, ZoarInputInfo, ZoarDIPInfo, - ZoarInit, DrvExit, BtimeFrame, ZoarDraw, DrvScan, &DrvRecalc, 64, - 240, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_cabal.cpp b/jan/src/burn/drv/pre90s/d_cabal.cpp deleted file mode 100644 index cb19dbe9c..000000000 --- a/jan/src/burn/drv/pre90s/d_cabal.cpp +++ /dev/null @@ -1,957 +0,0 @@ -// FB Alpha Cabal driver module -// Based on MAME driver by Carlos A. Lozano - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "seibusnd.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvMainRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 flipscreen; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT16 DrvInputs[5]; -static UINT16 DrvPrvInputs[5]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 15, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 13, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 14, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xdf, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage (Mode 1)" }, - {0x13, 0x01, 0x0f, 0x0a, "6 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x0b, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x0c, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x0d, "3 Coin 1 Credit" }, - {0x13, 0x01, 0x0f, 0x01, "8 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "2 Coin 1 Credit" }, - {0x13, 0x01, 0x0f, 0x02, "5 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x0f, 0x04, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin A (Mode 2)" }, - {0x13, 0x01, 0x03, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x03, 0x01, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x03, 0x02, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4, "Coin B (Mode 2)" }, - {0x13, 0x01, 0x0c, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0c, 0x04, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0c, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x10, 0x10, "Mode 1" }, - {0x13, 0x01, 0x10, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2, "Invert Buttons" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Trackball" }, - {0x13, 0x01, 0x80, 0x80, "Small" }, - {0x13, 0x01, 0x80, 0x00, "Large" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "121 (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "150k 650k 500k+" }, - {0x14, 0x01, 0x0c, 0x08, "200k 800k 600k+" }, - {0x14, 0x01, 0x0c, 0x04, "300k 1000k 700k+" }, - {0x14, 0x01, 0x0c, 0x00, "300k Only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x30, "Easy" }, - {0x14, 0x01, 0x30, 0x20, "Normal" }, - {0x14, 0x01, 0x30, 0x10, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "On" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, -}; - -STDDIPINFO(Drv) - -static void cabal_audiocpu_irq_trigger() -{ - //ZetIdle(100); -} - -static void __fastcall cabal_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x0c0000: - case 0x0c0001: - memcpy (DrvPrvInputs, DrvInputs, 4 * sizeof(UINT16)); - return; - - case 0x0c0080: - case 0x0c0081: - flipscreen = data & 0x20; - return; - - case 0x0e8008: - case 0x0e8009: - cabal_audiocpu_irq_trigger(); // no break! - case 0x0e8000: - case 0x0e8001: - case 0x0e8002: - case 0x0e8003: - case 0x0e8004: - case 0x0e8005: - case 0x0e8006: - case 0x0e8007: - case 0x0e800a: - case 0x0e800b: - case 0x0e800c: - case 0x0e800d: - seibu_main_word_write(address & 0xf, data); - return; - } -} - -static void __fastcall cabal_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x0c0000: - case 0x0c0001: - memcpy (DrvPrvInputs, DrvInputs, 4 * sizeof(UINT16)); - return; - - case 0x0c0040: - case 0x0c0041: - return; // nop - - case 0x0c0080: - case 0x0c0081: - flipscreen = data & 0x20; - return; - - case 0x0e8008: - case 0x0e8009: - cabal_audiocpu_irq_trigger(); // no break! - case 0x0e8000: - case 0x0e8001: - case 0x0e8002: - case 0x0e8003: - case 0x0e8004: - case 0x0e8005: - case 0x0e8006: - case 0x0e8007: - case 0x0e800a: - case 0x0e800b: - case 0x0e800c: - case 0x0e800d: - seibu_main_word_write(address & 0xf, data); - return; - } -} - -static UINT16 trackball_read(INT32 offset) -{ - switch (offset & 3) - { - case 0: - return (( DrvInputs[0] - DrvPrvInputs[0]) & 0x00ff) | (((DrvInputs[2] - DrvPrvInputs[2]) & 0x00ff) << 8); - case 1: - return (((DrvInputs[0] - DrvPrvInputs[0]) & 0xff00) >> 8) | (( DrvInputs[2] - DrvPrvInputs[2]) & 0xff00); - case 2: - return (( DrvInputs[0] - DrvPrvInputs[1]) & 0x00ff) | (((DrvInputs[3] - DrvPrvInputs[3]) & 0x00ff) << 8); - case 3: - return (((DrvInputs[0] - DrvPrvInputs[1]) & 0xff00) >> 8) | (( DrvInputs[3] - DrvPrvInputs[3]) & 0xff00); - } - - return 0; -} - -static UINT16 __fastcall cabal_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x0a0000: - case 0x0a0001: - return (DrvDips[0] | (DrvDips[1] << 8)); - - case 0x0a0008: - case 0x0a0009: - case 0x0a000a: - case 0x0a000b: - case 0x0a000c: - case 0x0a000d: - case 0x0a000e: - case 0x0a000f: - return trackball_read((address/2)&3); - - case 0x0a0010: - case 0x0a0011: - return DrvInputs[4]; - - case 0x0e8000: - case 0x0e8001: - case 0x0e8002: - case 0x0e8003: - case 0x0e8004: - case 0x0e8005: - case 0x0e8006: - case 0x0e8007: - case 0x0e8008: - case 0x0e8009: - case 0x0e800a: - case 0x0e800b: - case 0x0e800c: - case 0x0e800d: - return seibu_main_word_read(address & 0xf); - } - return 0; -} - -static UINT8 __fastcall cabal_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0a0000: - case 0x0a0001: - return (DrvDips[0] | (DrvDips[1] << 8)) >> ((~address & 1) * 8); - - case 0x0a0008: - case 0x0a0009: - case 0x0a000a: - case 0x0a000b: - case 0x0a000c: - case 0x0a000d: - case 0x0a000e: - case 0x0a000f: - return trackball_read((address/2)&3); - - case 0x0a0010: - case 0x0a0011: - return DrvInputs[4] >> ((~address & 1) * 8); - - case 0x0e8000: - case 0x0e8001: - case 0x0e8002: - case 0x0e8003: - case 0x0e8004: - case 0x0e8005: - case 0x0e8006: - case 0x0e8007: - case 0x0e8008: - case 0x0e8009: - case 0x0e800a: - case 0x0e800b: - case 0x0e800c: - case 0x0e800d: - return seibu_main_word_read(address & 0xf); - } - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - seibu_sound_reset(); - - flipscreen = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x050000; - SeibuZ80DecROM = Next; Next += 0x010000; - SeibuZ80ROM = Next; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x100000; - - SeibuADPCMData[0] = Next; - DrvSndROM0 = Next; Next += 0x010000; - SeibuADPCMData[1] = Next; - DrvSndROM1 = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvMainRAM = Next; Next += 0x010000; - - DrvPalRAM = Next; Next += 0x000800; - DrvColRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - - SeibuZ80RAM = Next; - DrvZ80RAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0, 4 }; - INT32 XOffs0[8] = { 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0 }; - INT32 YOffs0[8] = { STEP8(0,16) }; - - INT32 Plane1[4] = { 8, 12, 0, 4 }; - INT32 XOffs1[16] = { STEP4(3,-1), STEP4(16+3,-1), STEP4(32*16+3,-1), STEP4(33*16+3,-1) }; - INT32 YOffs1[16] = { STEP16(0,32) }; - - INT32 XOffs2[16] = { STEP4(3,-1), STEP4(16+3,-1), STEP4(32+3,-1), STEP4(48+3,-1) }; - INT32 YOffs2[16] = { 30*32, 28*32, 26*32, 24*32, 22*32, 20*32, 18*32, 16*32, 14*32, 12*32, 10*32, 8*32, 6*32, 4*32, 2*32, 0*32 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x008000); - - GfxDecode(0x0400, 2, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs2, YOffs2, 0x400, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static void adpcm_decode(UINT8 *rom) -{ - for (INT32 i = 0; i < 0x10000; i++) { - rom[i] = BITSWAP08(rom[i], 7, 5, 3, 1, 6, 4, 2, 0); - } -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - // joystick version - if (select == 0) - { - if (BurnLoadRom(DrvMainROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(DrvMainROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(DrvMainROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x010000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060000, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060001, 14, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020000, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020001, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040001, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x060000, 21, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x060001, 22, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 23, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 24, 1)) return 1; - } - - if (select == 1 || select == 2) - { - if (BurnLoadRom(DrvMainROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(DrvMainROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(DrvMainROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x010000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 10, 1)) return 1; - - if (select == 1) { - memcpy (DrvMainROM + 0x30000, DrvMainROM + 0x20000, 0x10000); - } - } - - DrvGfxDecode(); - adpcm_decode(DrvSndROM0); - adpcm_decode(DrvSndROM1); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(DrvMainROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvMainRAM, 0x040000, 0x04ffff, MAP_RAM); - SekMapMemory(DrvColRAM, 0x060000, 0x0607ff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x080000, 0x0803ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0e0000, 0x0e07ff, MAP_RAM); - SekSetWriteWordHandler(0, cabal_main_write_word); - SekSetWriteByteHandler(0, cabal_main_write_byte); - SekSetReadWordHandler(0, cabal_main_read_word); - SekSetReadByteHandler(0, cabal_main_read_byte); - SekClose(); - - SeibuADPCMDataLen[0] = 0x10000; - SeibuADPCMDataLen[1] = 0x10000; - seibu_sound_init(1|8, 0x2000, 3579545, 3579545, 8000); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - - seibu_sound_exit(); - - BurnFree (AllMem); - - return 0; -} - -static inline void DrvRecalcPalette() -{ - UINT16 *ram = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x800/2; i++) - { - INT32 c = BURN_ENDIAN_SWAP_INT16(ram[i]); - - UINT8 r = c & 0x0f; - UINT8 g = c & 0xf0; - UINT8 b = (c >> 8) & 0x0f; - - DrvPalette[i] = BurnHighCol(r+(r*16), g+(g/16), b+(b*16), 0); - } -} - -static void draw_bg_layer() -{ - UINT16 *ram = (UINT16*)DrvVidRAM; - - for (INT32 offs = 0; offs < 16 * 16; offs++) - { - INT32 sx = (offs & 0xf) * 16; - INT32 sy = offs & 0xf0; - - INT32 code = ram[offs] & 0xfff; - INT32 color = ram[offs] >> 12; - - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x200, DrvGfxROM1); - } -} - -static void draw_tx_layer() -{ - UINT16 *ram = (UINT16*)DrvColRAM; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 code = ram[offs] & 0x1ff; - INT32 color = ram[offs] >> 10; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 3, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)(DrvMainRAM + 0x3800); - - for (INT32 offs = 0x800/2 - 4; offs >= 0; offs -= 4) - { - INT32 data0 = ram[offs+0]; - INT32 data1 = ram[offs+1]; - INT32 data2 = ram[offs+2]; - - if (data0 & 0x0100) - { - int code = data1 & 0x0fff; - int color =(data2 & 0x7800) >> 11; - int sy = data0 & 0x00ff; - int sx = data2 & 0x01ff; - int flipx = data2 & 0x0400; - int flipy = 0; - - if (sx > 256) sx -= 512; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x100, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x100, DrvGfxROM2); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - draw_bg_layer(); - draw_sprites(); - draw_tx_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - DrvInputs[0] = 0xff; - DrvInputs[1] = 0xff; - DrvInputs[2] = 0xff; - DrvInputs[3] = 0xff; - DrvInputs[4] = 0xffff; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[2] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy1[i] & 1) << i; - } - - seibu_coin_input = 0xfc | (DrvJoy3[1] << 1) | DrvJoy3[0]; - } - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nTotalCycles[2] = { 10000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nTotalCycles[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - - nSegment = nTotalCycles[1] / nInterleave; - nCyclesDone[1] += ZetRun(nSegment); - - if (i == 240) - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - seibu_sound_update(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength > 0) { - seibu_sound_update(pSoundBuf, nSegmentLength); - } - seibu_sound_update_cabal(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); - - seibu_sound_scan(pnMin, nAction); - - DrvRecalc = 1; - } - - return 0; -} - - -// Cabal (World, Joystick) - -static struct BurnRomInfo cabalRomDesc[] = { - { "13.7h", 0x10000, 0x00abbe0c, 1 | BRF_PRG | BRF_ESS }, // 0 M68k Codc - { "11.6h", 0x10000, 0x44736281, 1 | BRF_PRG | BRF_ESS }, // 1 - { "12.7j", 0x10000, 0xd763a47c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "10.6j", 0x10000, 0x96d5e8af, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "4-3n", 0x02000, 0x4038eff2, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "3-3p", 0x08000, 0xd9defcbf, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "5-6s", 0x04000, 0x6a76955a, 3 | BRF_GRA }, // 6 Characters - - { "bg_rom1.bin", 0x10000, 0x1023319b, 4 | BRF_GRA }, // 7 Background Tiles - { "bg_rom2.bin", 0x10000, 0x3b6d2b09, 4 | BRF_GRA }, // 8 - { "bg_rom3.bin", 0x10000, 0x420b0801, 4 | BRF_GRA }, // 9 - { "bg_rom4.bin", 0x10000, 0x77bc7a60, 4 | BRF_GRA }, // 10 - { "bg_rom5.bin", 0x10000, 0x543fcb37, 4 | BRF_GRA }, // 11 - { "bg_rom6.bin", 0x10000, 0x0bc50075, 4 | BRF_GRA }, // 12 - { "bg_rom7.bin", 0x10000, 0xd28d921e, 4 | BRF_GRA }, // 13 - { "bg_rom8.bin", 0x10000, 0x67e4fe47, 4 | BRF_GRA }, // 14 - - { "sp_rom1.bin", 0x10000, 0x34d3cac8, 5 | BRF_GRA }, // 15 Sprites - { "sp_rom2.bin", 0x10000, 0x4e49c28e, 5 | BRF_GRA }, // 16 - { "sp_rom3.bin", 0x10000, 0x7065e840, 5 | BRF_GRA }, // 17 - { "sp_rom4.bin", 0x10000, 0x6a0e739d, 5 | BRF_GRA }, // 18 - { "sp_rom5.bin", 0x10000, 0x0e1ec30e, 5 | BRF_GRA }, // 19 - { "sp_rom6.bin", 0x10000, 0x581a50c1, 5 | BRF_GRA }, // 20 - { "sp_rom7.bin", 0x10000, 0x55c44764, 5 | BRF_GRA }, // 21 - { "sp_rom8.bin", 0x10000, 0x702735c9, 5 | BRF_GRA }, // 22 - - { "2-1s", 0x10000, 0x850406b4, 6 | BRF_SND }, // 23 ADPCM #0 Code - - { "1-1u", 0x10000, 0x8b3e0789, 7 | BRF_SND }, // 24 ADPCM #1 Code -}; - -STD_ROM_PICK(cabal) -STD_ROM_FN(cabal) - -static INT32 CabalInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvCabal = { - "cabal", NULL, NULL, NULL, "1988", - "Cabal (World, Joystick)\0", NULL, "TAD Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, cabalRomInfo, cabalRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - CabalInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 256, 4, 3 -}; - - -// Cabal (Korea?, Joystick) - -static struct BurnRomInfo cabalaRomDesc[] = { - { "epr-a-9.7h", 0x10000, 0x00abbe0c, 1 | BRF_PRG | BRF_ESS }, // 0 M68k Codc - { "epr-a-7.6h", 0x10000, 0xc89608db, 1 | BRF_PRG | BRF_ESS }, // 1 - { "epr-a-8.7k", 0x08000, 0xfe84788a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "epr-a-6.6k", 0x08000, 0x81eb1355, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "epr-a-4.3n", 0x02000, 0x4038eff2, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "epr-a-3.3p", 0x04000, 0xc0097c55, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "epr-a-5.6s", 0x08000, 0x189033fd, 3 | BRF_GRA }, // 6 Characters - - { "tad-2.7s", 0x80000, 0x13ca7ae1, 4 | BRF_GRA }, // 7 Background Tiles - - { "tad-1.5e", 0x80000, 0x8324a7fe, 5 | BRF_GRA }, // 15 Sprites - - { "epr-a-2.1s", 0x10000, 0x850406b4, 6 | BRF_SND }, // 23 ADPCM #0 Code - - { "epr-a-1.1u", 0x10000, 0x8b3e0789, 7 | BRF_SND }, // 24 ADPCM #1 Code -}; - -STD_ROM_PICK(cabala) -STD_ROM_FN(cabala) - -static INT32 CabalaInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvCabala = { - "cabala", "cabal", NULL, NULL, "1988", - "Cabal (korea?, Joystick)\0", NULL, "TAD Corporation (Alpha Trading license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, cabalaRomInfo, cabalaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - CabalaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 256, 4, 3 -}; - - -// Cabal (UK, Trackball) - -static struct BurnRomInfo cabalukRomDesc[] = { - { "9-7H.BIN", 0x10000, 0xf66378e5, 1 | BRF_PRG | BRF_ESS }, // 0 M68k Codc - { "7-6H.BIN", 0x10000, 0x960991ac, 1 | BRF_PRG | BRF_ESS }, // 1 - { "8-7K.BIN", 0x10000, 0x82160ab0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "6-6K.BIN", 0x10000, 0x7ef2ecc7, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "4-3n", 0x02000, 0x4038eff2, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "3-3p", 0x08000, 0xd9defcbf, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "5-6s", 0x04000, 0x6a76955a, 3 | BRF_GRA }, // 6 Characters - - { "tad-2.7s", 0x80000, 0x13ca7ae1, 4 | BRF_GRA }, // 7 Background Tiles - - { "tad-1.5e", 0x80000, 0x8324a7fe, 5 | BRF_GRA }, // 15 Sprites - - { "2-1s", 0x10000, 0x850406b4, 6 | BRF_SND }, // 23 ADPCM #0 Code - - { "1-1u", 0x10000, 0x8b3e0789, 7 | BRF_SND }, // 24 ADPCM #1 Code -}; - -STD_ROM_PICK(cabaluk) -STD_ROM_FN(cabaluk) - -static INT32 CabalukInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvCabaluk = { - "cabaluk", "cabal", NULL, NULL, "1988", - "Cabal (UK, Trackball)\0", "Needs Trackball Support", "TAD Corporation (Electrocoin license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, cabalukRomInfo, cabalukRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - CabalukInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 256, 4, 3 -}; - - -// Cabal (US set 1, Trackball) - -static struct BurnRomInfo cabalusRomDesc[] = { - { "h7_512.bin", 0x10000, 0x8fe16fb4, 1 | BRF_PRG | BRF_ESS }, // 0 M68k Codc - { "h6_512.bin", 0x10000, 0x6968101c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "k7_512.bin", 0x10000, 0x562031a2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "k6_512.bin", 0x10000, 0x4fda2856, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "4-3n", 0x02000, 0x4038eff2, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "3-3p", 0x08000, 0xd9defcbf, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "t6_128.bin", 0x04000, 0x1ccee214, 3 | BRF_GRA }, // 6 Characters - - { "tad-2.7s", 0x80000, 0x13ca7ae1, 4 | BRF_GRA }, // 7 Background Tiles - - { "tad-1.5e", 0x80000, 0x8324a7fe, 5 | BRF_GRA }, // 15 Sprites - - { "2-1s", 0x10000, 0x850406b4, 6 | BRF_SND }, // 23 ADPCM #0 Code - - { "1-1u", 0x10000, 0x8b3e0789, 7 | BRF_SND }, // 24 ADPCM #1 Code - - { "prom05.8e", 0x00100, 0xa94b18c2, 8 | BRF_OPT }, // 25 Proms - { "prom10.4j", 0x00100, 0x261c93bc, 8 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(cabalus) -STD_ROM_FN(cabalus) - -static INT32 CabalusInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvCabalus = { - "cabalus", "cabal", NULL, NULL, "1988", - "Cabal (US set 1, Trackball)\0", "Needs Trackball Support", "TAD Corporation (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, cabalusRomInfo, cabalusRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - CabalusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 256, 4, 3 -}; - - -// Cabal (US set 2, Trackball) - -static struct BurnRomInfo cabalus2RomDesc[] = { - { "9-7h", 0x10000, 0xebbb9484, 1 | BRF_PRG | BRF_ESS }, // 0 M68k Codc - { "7-6h", 0x10000, 0x51aeb49e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "8-7k", 0x10000, 0x4c24ed9a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "6-6k", 0x10000, 0x681620e8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "4-3n", 0x02000, 0x4038eff2, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - { "3-3p", 0x08000, 0xd9defcbf, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "5-6s", 0x04000, 0x6a76955a, 3 | BRF_GRA }, // 6 Characters - - { "tad-2.7s", 0x80000, 0x13ca7ae1, 4 | BRF_GRA }, // 7 Background Tiles - - { "tad-1.5e", 0x80000, 0x8324a7fe, 5 | BRF_GRA }, // 15 Sprites - - { "2-1s", 0x10000, 0x850406b4, 6 | BRF_SND }, // 23 ADPCM #0 Code - - { "1-1u", 0x10000, 0x8b3e0789, 7 | BRF_SND }, // 24 ADPCM #1 Code - - { "prom05.8e", 0x00100, 0xa94b18c2, 8 | BRF_OPT }, // 25 Proms - { "prom10.4j", 0x00100, 0x261c93bc, 8 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(cabalus2) -STD_ROM_FN(cabalus2) - -static INT32 Cabalus2Init() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvCabalus2 = { - "cabalus2", "cabal", NULL, NULL, "1988", - "Cabal (US set 2, Trackball)\0", "Needs Trackball Support", "TAD Corporation (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, cabalus2RomInfo, cabalus2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - Cabalus2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_calorie.cpp b/jan/src/burn/drv/pre90s/d_calorie.cpp deleted file mode 100644 index cd89603c0..000000000 --- a/jan/src/burn/drv/pre90s/d_calorie.cpp +++ /dev/null @@ -1,818 +0,0 @@ -// Zodiack emu-layer for FB Alpha by dink/iq_132, based on the MAME driver by David Haywood and Pierpaolo Prazzoli. - -#include "tiles_generic.h" -#include "driver.h" -#include "bitswap.h" -#include "z80_intf.h" -extern "C" { - #include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvDecROM0; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *calorie_bg; - -static UINT8 UpdatePal; - -static struct BurnInputInfo CalorieInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Calorie) - -static struct BurnDIPInfo CalorieDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x30, NULL }, - {0x12, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x03, 0x00, "1 Coin 1 Credits " }, - {0x11, 0x01, 0x03, 0x01, "1 Coin 2 Credits " }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 3 Credits " }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 6 Credits " }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x0c, 0x0c, "2 Coins 1 Credits " }, - {0x11, 0x01, 0x0c, 0x00, "1 Coin 1 Credits " }, - {0x11, 0x01, 0x0c, 0x04, "1 Coin 2 Credits " }, - {0x11, 0x01, 0x0c, 0x08, "1 Coin 3 Credits " }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x10, 0x10, "Upright" }, - {0x11, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0xc0, "2" }, - {0x11, 0x01, 0xc0, 0x00, "3" }, - {0x11, 0x01, 0xc0, 0x40, "4" }, - {0x11, 0x01, 0xc0, 0x80, "5" }, - - {0 , 0xfe, 0 , 3, "Bonus Life" }, - {0x12, 0x01, 0x03, 0x00, "None" }, - {0x12, 0x01, 0x03, 0x01, "20,000 Only" }, - {0x12, 0x01, 0x03, 0x03, "20,000 and 60,000" }, - - {0 , 0xfe, 0 , 2, "Number of Bombs" }, - {0x12, 0x01, 0x04, 0x00, "3" }, - {0x12, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2, "Difficulty - Mogura Nian" }, - {0x12, 0x01, 0x08, 0x00, "Normal" }, - {0x12, 0x01, 0x08, 0x08, "Hard" }, - - {0 , 0xfe, 0 , 4, "Difficulty - Select of Mogura" }, - {0x12, 0x01, 0x30, 0x00, "Easy" }, - {0x12, 0x01, 0x30, 0x20, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x30, "Hardest" }, - - {0 , 0xfe, 0 , 0, "Infinite Lives" }, - {0x12, 0x01, 0x80, 0x00, "Off" }, - {0x12, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Calorie) - -void __fastcall calorie_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff00) == 0xdc00) { - DrvPalRAM[address & 0x0ff] = data; - UpdatePal = 1; - return; - } - - switch (address) - { - case 0xde00: - *calorie_bg = data; - return; - - case 0xf004: - *flipscreen = data & 1; - return; - - case 0xf800: - *soundlatch = data; - return; - } -} - -UINT8 __fastcall calorie_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - return DrvInputs[0]; - - case 0xf001: - return DrvInputs[1]; - - case 0xf002: - return DrvInputs[2]; - - case 0xf004: - return DrvDips[0]; - - case 0xf005: - return DrvDips[1]; - } - - return 0; -} - -UINT8 __fastcall calorie_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - UINT8 latch = *soundlatch; - *soundlatch = 0; - return latch; - } - - return 0; -} - -UINT8 __fastcall calorie_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x01: - return AY8910Read(0); - - case 0x11: - return AY8910Read(1); - } - - return 0; -} - -void __fastcall calorie_sound_out(UINT16 port, UINT8 data) -{ - port &= 0xff; - switch (port) - { - case 0x00: - case 0x01: - case 0x10: - case 0x11: - AY8910Write(port >> 4, port & 1, data); - return; - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvDecROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM4 = Next; Next += 0x002000; - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x020000; - DrvGfxROM3 = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(INT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x000400; - DrvPalRAM = Next; Next += 0x000100; - DrvVidRAM = Next; Next += 0x000800; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - calorie_bg = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { RGN_FRAC(0xc000, 0, 3), RGN_FRAC(0xc000, 1, 3), RGN_FRAC(0xc000, 2, 3) }; - INT32 Plane6000[3] = { RGN_FRAC(0x6000, 0, 3), RGN_FRAC(0x6000, 1, 3), RGN_FRAC(0x6000, 2, 3) }; - - INT32 XOffs[32] = { 0, 1, 2, 3, 4, 5, 6, 7, - 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7, - 32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7, - 40*8+0, 40*8+1, 40*8+2, 40*8+3, 40*8+4, 40*8+5, 40*8+6, 40*8+7 }; - INT32 YOffs[32] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, - 64*8, 65*8, 66*8, 67*8, 68*8, 69*8, 70*8, 71*8, - 80*8, 81*8, 82*8, 83*8, 84*8, 85*8, 86*8, 87*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0xc000); - - GfxDecode(0x0200, 3, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - GfxDecode(0x0080, 3, 32, 32, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0xc000); - - GfxDecode(0x0400, 3, 8, 8, Plane6000, XOffs, YOffs, 0x040, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0xc000); - - GfxDecode(0x0200, 3, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(void (*pInitCallback)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x4000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x8000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x4000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x0000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x4000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x8000, 13, 1)) return 1; - - DrvGfxDecode(); - } - - if (pInitCallback) { - pInitCallback(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvDecROM0, DrvZ80ROM0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM0 + 0x8000); - ZetMapArea(0xc000, 0xcfff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 2, DrvZ80RAM0); - ZetMapArea(0xd000, 0xd7ff, 0, DrvVidRAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvVidRAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvVidRAM); - ZetMapArea(0xd800, 0xdbff, 0, DrvSprRAM); - ZetMapArea(0xd800, 0xdbff, 1, DrvSprRAM); - ZetMapArea(0xd800, 0xdbff, 2, DrvSprRAM); - ZetSetWriteHandler(calorie_write); - ZetSetReadHandler(calorie_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); - ZetSetReadHandler(calorie_sound_read); - ZetSetOutHandler(calorie_sound_out); - ZetSetInHandler(calorie_sound_in); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - return 0; -} - -static void draw_bg_layer() -{ - INT32 bg_base = (*calorie_bg & 0x0f) * 0x200; - - for (INT32 offs = 0; offs < 16 * 16; offs++) - { - INT32 sx = (offs & 0x0f) << 4; - INT32 sy = offs & 0xf0; - - INT32 attr = DrvGfxROM4[bg_base + offs + 0x100]; - INT32 code = DrvGfxROM4[bg_base + offs] | ((attr & 0x10) << 4); - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x40; - - sy -= 16; - - if (*flipscreen) { - if (!flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM3); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM3); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM3); - } - } - } -} - - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 attr = DrvVidRAM[offs + 0x400]; - INT32 code = ((attr & 0x30) << 4) | DrvVidRAM[offs]; - INT32 color = attr & 0x0f; - INT32 flipy = attr & 0x80; - INT32 flipx = attr & 0x40; - - sy -= 16; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 x = 0x400; x >= 0; x -= 4) - { - INT32 code = DrvSprRAM[x+0]; - INT32 color = DrvSprRAM[x+1] & 0x0f; - INT32 flipx = DrvSprRAM[x+1] & 0x40; - INT32 flipy = 0; - INT32 sy = 0xff - DrvSprRAM[x+2]; - INT32 sx = DrvSprRAM[x+3]; - - if(*flipscreen) - { - if (DrvSprRAM[x+1] & 0x10 ) - sy = 0xff - sy + 32; - else - sy = 0xff - sy + 16; - - sx = 0xff - sx - 16; - flipx = !flipx; - flipy = !flipy; - } - sy -= 16; - if(DrvSprRAM[x+1] & 0x10 ) - { - code |= 0x40; - sy -= 31; - - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } - } - } - else - { - sy -= 15; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } - } - } - } -} - - -static INT32 DrvDraw() -{ - if (DrvRecalc || UpdatePal) { - for (INT32 i = 0; i < 0x100; i+=2) { - INT32 p = (DrvPalRAM[i+0] << 0) | (DrvPalRAM[i+1] << 8); - - INT32 r = (p >> 0) & 0x0f; - INT32 g = (p >> 4) & 0x0f; - INT32 b = (p >> 8) & 0x0f; - - DrvPalette[i/2] = BurnHighCol((r << 4) | r, (g << 4) | g, (b << 4) | b, 0); - } - DrvRecalc = UpdatePal = 0; - } - - if (*calorie_bg & 0x10) - { - draw_bg_layer(); - draw_fg_layer(); - } - else - { - BurnTransferClear(); - draw_fg_layer(); - } - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 256; - INT32 nTotalCycles[2] = { 4000000 / 60, 3000000 / 60 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - ZetRun(nTotalCycles[0] / nInterleave); - if (i == nInterleave - 1) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - ZetRun(nTotalCycles[1] / nInterleave); - if (i == nInterleave - 1) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - } - - return 0; -} - - -static void calorie_decode() -{ - static const UINT8 swaptable[24][4] = - { - { 6,4,2,0 }, { 4,6,2,0 }, { 2,4,6,0 }, { 0,4,2,6 }, - { 6,2,4,0 }, { 6,0,2,4 }, { 6,4,0,2 }, { 2,6,4,0 }, - { 4,2,6,0 }, { 4,6,0,2 }, { 6,0,4,2 }, { 0,6,4,2 }, - { 4,0,6,2 }, { 0,4,6,2 }, { 6,2,0,4 }, { 2,6,0,4 }, - { 0,6,2,4 }, { 2,0,6,4 }, { 0,2,6,4 }, { 4,2,0,6 }, - { 2,4,0,6 }, { 4,0,2,6 }, { 2,0,4,6 }, { 0,2,4,6 }, - }; - - static const UINT8 data_xor[1+64] = - { - 0x54, - 0x14,0x15,0x41,0x14,0x50,0x55,0x05,0x41,0x01,0x10,0x51,0x05,0x11,0x05,0x14,0x55, - 0x41,0x05,0x04,0x41,0x14,0x10,0x45,0x50,0x00,0x45,0x00,0x00,0x00,0x45,0x00,0x00, - 0x54,0x04,0x15,0x10,0x04,0x05,0x11,0x44,0x04,0x01,0x05,0x00,0x44,0x15,0x40,0x45, - 0x10,0x15,0x51,0x50,0x00,0x15,0x51,0x44,0x15,0x04,0x44,0x44,0x50,0x10,0x04,0x04, - }; - - static const UINT8 opcode_xor[2+64] = - { - 0x04, - 0x44, - 0x15,0x51,0x41,0x10,0x15,0x54,0x04,0x51,0x05,0x55,0x05,0x54,0x45,0x04,0x10,0x01, - 0x51,0x55,0x45,0x55,0x45,0x04,0x55,0x40,0x11,0x15,0x01,0x40,0x01,0x11,0x45,0x44, - 0x40,0x05,0x15,0x15,0x01,0x50,0x00,0x44,0x04,0x50,0x51,0x45,0x50,0x54,0x41,0x40, - 0x14,0x40,0x50,0x45,0x10,0x05,0x50,0x01,0x40,0x01,0x50,0x50,0x50,0x44,0x40,0x10, - }; - - static const INT32 data_swap_select[1+64] = - { - 7, - 1,11,23,17,23, 0,15,19, - 20,12,10, 0,18,18, 5,20, - 13, 0,18,14, 5, 6,10,21, - 1,11, 9, 3,21, 4, 1,17, - 5, 7,16,13,19,23,20, 2, - 10,23,23,15,10,12, 0,22, - 14, 6,15,11,17,15,21, 0, - 6, 1, 1,18, 5,15,15,20, - }; - - static const INT32 opcode_swap_select[2+64] = - { - 7, - 12, - 18, 8,21, 0,22,21,13,21, - 20,13,20,14, 6, 3, 5,20, - 8,20, 4, 8,17,22, 0, 0, - 6,17,17, 9, 0,16,13,21, - 3, 2,18, 6,11, 3, 3,18, - 18,19, 3, 0, 5, 0,11, 8, - 8, 1, 7, 2,10, 8,10, 2, - 1, 3,12,16, 0,17,10, 1, - }; - - for (INT32 A = 0x0000; A < 0x8000; A++) - { - INT32 row = BITSWAP16(A, 15, 13, 11, 10, 8, 7, 5, 4, 2, 1, 14, 12, 9, 6, 3, 0) & 0x3f; - - const UINT8 *tbl = swaptable[opcode_swap_select[row]]; - DrvDecROM0[A] = BITSWAP08(DrvZ80ROM0[A],7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ opcode_xor[row]; - - tbl = swaptable[data_swap_select[row]]; - DrvZ80ROM0[A] = BITSWAP08(DrvZ80ROM0[A],7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ data_xor[row]; - } -} - -static INT32 CalorieInit() -{ - return DrvInit(calorie_decode); -} - -static void calorieb_decode() -{ - memset (DrvZ80ROM0, 0x00, 0x10000); - - BurnLoadRom(DrvDecROM0 + 0x0000, 0, 1); - memcpy (DrvZ80ROM0 + 0x0000, DrvDecROM0 + 0x4000, 0x4000); - - BurnLoadRom(DrvDecROM0 + 0x4000, 1, 1); - memcpy (DrvZ80ROM0 + 0x4000, DrvDecROM0 + 0x8000, 0x4000); - - BurnLoadRom(DrvZ80ROM0 + 0x8000, 2, 1); - - memset (DrvDecROM0 + 0x8000, 0x00, 0x4000); -} - -static INT32 CaloriebInit() -{ - return DrvInit(calorieb_decode); -} - -// Calorie Kun vs Moguranian - -static struct BurnRomInfo calorieRomDesc[] = { - { "epr10072.1j", 0x4000, 0xade792c1, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "epr10073.1k", 0x4000, 0xb53e109f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "epr10074.1m", 0x4000, 0xa08da685, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "epr10075.4d", 0x4000, 0xca547036, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "epr10079.8d", 0x2000, 0x3c61a42c, 3 | BRF_GRA }, // 4 user1 - - { "epr10071.7m", 0x4000, 0x5f55527a, 4 | BRF_GRA }, // 5 gfx1 - { "epr10070.7k", 0x4000, 0x97f35a23, 4 | BRF_GRA }, // 6 - { "epr10069.7j", 0x4000, 0xc0c3deaf, 4 | BRF_GRA }, // 7 - - { "epr10082.5r", 0x2000, 0x5984ea44, 5 | BRF_GRA }, // 8 gfx2 - { "epr10081.4r", 0x2000, 0xe2d45dd8, 5 | BRF_GRA }, // 9 - { "epr10080.3r", 0x2000, 0x42edfcfe, 5 | BRF_GRA }, // 10 - - { "epr10078.7d", 0x4000, 0x5b8eecce, 6 | BRF_GRA }, // 11 gfx3 - { "epr10077.6d", 0x4000, 0x01bcb609, 6 | BRF_GRA }, // 12 - { "epr10076.5d", 0x4000, 0xb1529782, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(calorie) -STD_ROM_FN(calorie) - -struct BurnDriver BurnDrvCalorie = { - "calorie", NULL, NULL, NULL, "1986", - "Calorie Kun vs Moguranian\0", NULL, "Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, calorieRomInfo, calorieRomName, NULL, NULL, CalorieInputInfo, CalorieDIPInfo, - CalorieInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 256, 224, 4, 3 -}; - - -// Calorie Kun vs Moguranian (bootleg) - -static struct BurnRomInfo caloriebRomDesc[] = { - { "12.bin", 0x8000, 0xcf5fa69e, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "13.bin", 0x8000, 0x52e7263f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "epr10074.1m", 0x4000, 0xa08da685, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "epr10075.4d", 0x4000, 0xca547036, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "epr10079.8d", 0x2000, 0x3c61a42c, 3 | BRF_GRA }, // 4 user1 - - { "epr10071.7m", 0x4000, 0x5f55527a, 4 | BRF_GRA }, // 5 gfx1 - { "epr10070.7k", 0x4000, 0x97f35a23, 4 | BRF_GRA }, // 6 - { "epr10069.7j", 0x4000, 0xc0c3deaf, 4 | BRF_GRA }, // 7 - - { "epr10082.5r", 0x2000, 0x5984ea44, 5 | BRF_GRA }, // 8 gfx2 - { "epr10081.4r", 0x2000, 0xe2d45dd8, 5 | BRF_GRA }, // 9 - { "epr10080.3r", 0x2000, 0x42edfcfe, 5 | BRF_GRA }, // 10 - - { "epr10078.7d", 0x4000, 0x5b8eecce, 6 | BRF_GRA }, // 11 gfx3 - { "epr10077.6d", 0x4000, 0x01bcb609, 6 | BRF_GRA }, // 12 - { "epr10076.5d", 0x4000, 0xb1529782, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(calorieb) -STD_ROM_FN(calorieb) - -struct BurnDriver BurnDrvCalorieb = { - "calorieb", "calorie", NULL, NULL, "1986", - "Calorie Kun vs Moguranian (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, caloriebRomInfo, caloriebRomName, NULL, NULL, CalorieInputInfo, CalorieDIPInfo, - CaloriebInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 256, 224, 4, 3 -}; - diff --git a/jan/src/burn/drv/pre90s/d_canyon.cpp b/jan/src/burn/drv/pre90s/d_canyon.cpp deleted file mode 100644 index 90f8a8605..000000000 --- a/jan/src/burn/drv/pre90s/d_canyon.cpp +++ /dev/null @@ -1,486 +0,0 @@ -// FB Alpha Canyon Bomber driver module -// Based on MAME driver by Mike Balfour - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "burn_led.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6502ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvM6502RAM; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 watchdog; -static UINT8 vblank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo CanyonInputList[] = { - {"Highscore Reset", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 7" }, - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 3, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 7, "tilt" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 5, "service 1" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Canyon) - -static struct BurnDIPInfo CanyonDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 4, "Language" }, - {0x0a, 0x01, 0x03, 0x00, "English" }, - {0x0a, 0x01, 0x03, 0x01, "Spanish" }, - {0x0a, 0x01, 0x03, 0x02, "French" }, - {0x0a, 0x01, 0x03, 0x03, "German" }, - - {0 , 0xfe, 0 , 4, "Misses Per Play" }, - {0x0a, 0x01, 0x30, 0x00, "3" }, - {0x0a, 0x01, 0x30, 0x10, "4" }, - {0x0a, 0x01, 0x30, 0x20, "5" }, - {0x0a, 0x01, 0x30, 0x30, "6" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0a, 0x01, 0xc0, 0xc0, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0xc0, 0x80, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0xc0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Canyon) - -static void canyon_write(UINT16 address, UINT8 /*data*/) -{ - address &= 0x3fff; - - switch (address & 0x3fff) - { - case 0x0400: - case 0x0401: - // motor - return; - - case 0x0500: - // explode - return; - - case 0x0501: - watchdog = 0; - return; - - case 0x0600: - case 0x0601: - case 0x0602: - case 0x0603: - // whistle - return; - - case 0x0680: - case 0x0681: - case 0x0682: - case 0x0683: - BurnLEDSetStatus(address & 1, address & 2); - return; - - case 0x0700: - case 0x0701: - case 0x0702: - case 0x0703: - // attract - return; - } -} - -static UINT8 canyon_inputs(UINT8 offset) -{ - UINT8 val = 0; - UINT8 p2 = (DrvInputs[1] & 0xdf) | (vblank << 5); - - if ((p2 >> (offset & 7)) & 1) - val |= 0x80; - - if ((DrvInputs[0] >> (offset & 3)) & 1) - val |= 0x01; - - return val; -} - - - -static UINT8 canyon_read(UINT16 address) -{ - if ((address & 0xf800) == 0x1000) { - return canyon_inputs(address); - } - - if ((address & 0xf800) == 0x1800) { - return (DrvDips[0] >> (2 * (~address & 3))) & 3; - } - - return 0; -} - -static tilemap_callback( background ) -{ - TILE_SET_INFO(0, DrvVidRAM[offs], DrvVidRAM[offs] >> 7, 0); -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6502Open(0); - M6502Reset(); - M6502Close(); - - BurnLEDReset(); - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6502ROM = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x001000; - DrvGfxROM1 = Next; Next += 0x000800; - DrvGfxROM2 = Next; Next += 0x000004; - - DrvPalette = (UINT32*)Next; Next += 0x0004 * sizeof(UINT32); - - AllRam = Next; - - DrvM6502RAM = Next; Next += 0x000100; - DrvVidRAM = Next; Next += 0x000400; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[1] = { 0 }; - INT32 XOffs0[8] = { STEP4(4,1), STEP4(12,1) }; - INT32 XOffs1[32] = { STEP8(7,-1), STEP8(15,-1), STEP8(256+7,-1), STEP8(256+15,-1) }; - INT32 YOffs[16] = { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x0400); - - GfxDecode(0x40, 1, 8, 8, Plane, XOffs0, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x0100); - - GfxDecode(0x04, 1, 32, 16, Plane, XOffs1, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static void FixNibbles(UINT8 *rom, INT32 len) -{ - for (INT32 i = 0; i < len; i+=2) { - rom[i/2] = (rom[i+0] & 0xf) | (rom[i+1] << 4); - } -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (select == 0) - { - if (BurnLoadRom(DrvM6502ROM + 0x0000, 0, 2)) return 1; - if (BurnLoadRom(DrvM6502ROM + 0x0001, 1, 2)) return 1; - if (BurnLoadRom(DrvM6502ROM + 0x0800, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0001, 5, 2)) return 1; - - FixNibbles(DrvM6502ROM, 0x800); - } - - if (select == 1) - { - if (BurnLoadRom(DrvM6502ROM + 0x0000, 0, 2)) return 1; - if (BurnLoadRom(DrvM6502ROM + 0x0001, 1, 2)) return 1; - if (BurnLoadRom(DrvM6502ROM + 0x1000, 2, 2)) return 1; - if (BurnLoadRom(DrvM6502ROM + 0x1001, 3, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0001, 6, 2)) return 1; - - FixNibbles(DrvM6502ROM, 0x2000); - } - - memset (DrvGfxROM2, 1, 4); // bombs - FixNibbles(DrvGfxROM1, 0x200); - DrvGfxDecode(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x00ff, MAP_RAM); - M6502MapMemory(DrvM6502RAM, 0x0100, 0x01ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x0800, 0x0bff, MAP_RAM); - M6502MapMemory(DrvM6502ROM, 0x3000, 0x3fff, MAP_ROM); - M6502MapMemory(DrvM6502ROM, 0xf000, 0xffff, MAP_ROM); - M6502SetWriteHandler(canyon_write); - M6502SetReadHandler(canyon_read); - M6502Close(); - - BurnLEDInit(2, LED_POSITION_BOTTOM_RIGHT, LED_SIZE_2x2, LED_COLOR_GREEN, 50); - - // descrete sound - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 1, 8, 8, 0x1000, 0, 1); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - BurnLEDExit(); - - // descrete sound - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - DrvPalette[0] = BurnHighCol(0x80,0x80,0x80,0); - DrvPalette[1] = BurnHighCol(0x00,0x00,0x00,0); - DrvPalette[2] = DrvPalette[0]; - DrvPalette[3] = BurnHighCol(0xff,0xff,0xff,0); -} - -static void draw_sprites() -{ - for (INT32 i = 0; i < 2; i++) - { - INT32 sx = DrvVidRAM[0x3d1 + 2 * i]; - INT32 sy = DrvVidRAM[0x3d8 + 2 * i]; - INT32 code = DrvVidRAM[0x3d9 + 2 * i]; - INT32 flipx = ~code & 0x80; - - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(pTransDraw, 32, 16, (code >> 3) & 3, 224 - sx, 240 - sy, i, 1, 0, 0, DrvGfxROM1); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 32, 16, (code >> 3) & 3, 224 - sx, 240 - sy, i, 1, 0, 0, DrvGfxROM1); - } - } -} - -static void draw_bombs() -{ - for (INT32 i = 0; i < 2; i++) - { - INT32 sx = 254 - DrvVidRAM[0x3d5 + 2 * i]; - INT32 sy = 246 - DrvVidRAM[0x3dc + 2 * i]; - - RenderCustomTile_Clip(pTransDraw, 4, 4, 0, sx, sy, i, 1, 0, DrvGfxROM2); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - GenericTilemapDraw(0, pTransDraw, 0); - - draw_sprites(); - draw_bombs(); - - BurnTransferCopy(DrvPalette); - BurnLEDRender(); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nCyclesTotal = 756000 / 60; - - M6502Open(0); - vblank = 0; - M6502Run((nCyclesTotal * 240)/256); - vblank = 1; - M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - M6502Run((nCyclesTotal * 16)/256); - M6502Close(); - - if (pBurnSoundOut) { - - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - } - - return 0; -} - - -// Canyon Bomber - -static struct BurnRomInfo canyonRomDesc[] = { - { "9499-01.j1", 0x0400, 0x31800767, 1 | BRF_PRG | BRF_ESS }, // 0 m6502 Code - { "9503-01.p1", 0x0400, 0x1eddbe28, 1 | BRF_PRG | BRF_ESS }, // 1 - { "9496-01.d1", 0x0800, 0x8be15080, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "9492-01.n8", 0x0400, 0x7449f754, 2 | BRF_GRA }, // 3 Background Tiles - - { "9506-01.m5", 0x0100, 0x0d63396a, 3 | BRF_GRA }, // 4 Sprites - { "9505-01.n5", 0x0100, 0x60507c07, 3 | BRF_GRA }, // 5 - - { "9491-01.j6", 0x0100, 0xb8094b4c, 0 | BRF_OPT }, // 6 Unused proms -}; - -STD_ROM_PICK(canyon) -STD_ROM_FN(canyon) - -static INT32 CanyonInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvCanyon = { - "canyon", NULL, NULL, NULL, "1977", - "Canyon Bomber\0", "No sound", "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, canyonRomInfo, canyonRomName, NULL, NULL, CanyonInputInfo, CanyonDIPInfo, - CanyonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 4, - 256, 240, 4, 3 -}; - - -// Canyon Bomber (prototype) - -static struct BurnRomInfo canyonpRomDesc[] = { - { "cbp3000l.j1", 0x0800, 0x49cf29a0, 1 | BRF_PRG | BRF_ESS }, // 0 m6502 Code - { "cbp3000m.p1", 0x0800, 0xb4385c23, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cbp3800l.h1", 0x0800, 0xc7ee4431, 1 | BRF_PRG | BRF_ESS }, // 2 - { "cbp3800m.r1", 0x0800, 0x94246a9a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "9492-01.n8", 0x0400, 0x7449f754, 2 | BRF_GRA }, // 4 Background Tiles - - { "9506-01.m5", 0x0100, 0x0d63396a, 3 | BRF_GRA }, // 5 Sprites - { "9505-01.n5", 0x0100, 0x60507c07, 3 | BRF_GRA }, // 6 - - { "9491-01.j6", 0x0100, 0xb8094b4c, 0 | BRF_OPT }, // 7 Unused proms -}; - -STD_ROM_PICK(canyonp) -STD_ROM_FN(canyonp) - -static INT32 CanyonpInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvCanyonp = { - "canyonp", "canyon", NULL, NULL, "1977", - "Canyon Bomber (prototype)\0", "No sound", "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, canyonpRomInfo, canyonpRomName, NULL, NULL, CanyonInputInfo, CanyonDIPInfo, - CanyonpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 4, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_capbowl.cpp b/jan/src/burn/drv/pre90s/d_capbowl.cpp deleted file mode 100644 index be15e3ed0..000000000 --- a/jan/src/burn/drv/pre90s/d_capbowl.cpp +++ /dev/null @@ -1,774 +0,0 @@ -// FB Alpha Coors Light Bowling/Bowl-O-Rama driver module -// Based on MAME driver by Zsolt Vasvari - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "dac.h" -#include "burn_ym2203.h" -#include "tms34061.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvSoundROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvSoundRAM; - -static UINT8 *rowaddress; -static UINT8 *soundlatch; -static UINT8 *bankselect; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT32 blitter_addr; - -static INT32 watchdog; -static INT32 game_select; -static INT32 previous_scanline; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static INT32 DrvAnalogPort0 = 0; -static INT32 DrvAnalogPort1 = 0; -static INT32 track_x_last = 0; -static INT32 track_y_last = 0; - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo CapbowlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 6, "p1 start" }, - A("P1 Trackball X", BIT_ANALOG_REL, &DrvAnalogPort0,"p1 x-axis"), - A("P1 Trackball Y", BIT_ANALOG_REL, &DrvAnalogPort1,"p1 y-axis"), - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; -#undef A - -STDINPUTINFO(Capbowl) - -static struct BurnDIPInfo CapbowlDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x40, NULL }, - {0x0b, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0a, 0x01, 0x40, 0x40, "Upright" }, - {0x0a, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x01, 0x00, "Off" }, - {0x0b, 0x01, 0x01, 0x01, "On" }, -}; - -STDDIPINFO(Capbowl) - -static void bankswitch(INT32 d) -{ - if (game_select != 0) return; // capbowl only - - *bankselect = d; - - int bank = 0x08000 + (((d & 0x0c) >> 1) | (d & 1)) * 0x4000; - - M6809MapMemory(DrvMainROM + bank, 0x0000, 0x3fff, MAP_ROM); -} - -static void TrackReset() -{ - track_x_last = 0; - track_y_last = 0; -} - -static UINT8 ananice(INT16 anaval) -{ - if (anaval > 1024) anaval = 1024; - if (anaval < -1024) anaval = -1024; // clamp huge values so don't overflow INT8 conversion (mouse) - - return (anaval >> 4) & 0xff; -} - -static UINT8 ProcessTrack(UINT8 pad) -{ - if ((pad & 0xf0) == 0xf0 || pad < 0x10) pad = 0; - pad = (pad>>4); - if (pad & 0x10) pad = 0x15-pad; - - return pad; -} - -static UINT8 TrackY() -{ - UINT8 pad = ananice(DrvAnalogPort1); - - pad = ProcessTrack(0xff - pad) & 0xf; // reversed - if (pad) track_y_last = pad; - - return ((pad) ? pad : track_y_last); -} - -static UINT8 TrackX() -{ - UINT8 pad = ananice(DrvAnalogPort0); - - pad = ProcessTrack(pad) & 0xf; - if (pad) track_x_last = pad; - - return ((pad) ? pad : track_x_last); -} - -static void TrackTick() -{ // executes once every 8th frame to simulate linear deceleration - if (!(nCurrentFrame & 8)) return; - if (track_y_last !=0) { - if (track_y_last>0 && track_y_last < 9) track_y_last--; - else if (track_y_last > 9) { track_y_last++; if (track_y_last>0xf) track_y_last = 0; } - } - - if (track_x_last !=0) { - if (track_x_last>0 && track_x_last < 9) track_x_last--; - else if (track_x_last > 9) { track_x_last++; if (track_x_last>0xf) track_x_last = 0; } - } -} - -static void main_write(UINT16 a, UINT8 d) -{ - if ((a & 0xf800) == 0x5800) { - tms34061_write((a & 0xff) ^ ((~a & 0x100) >> 7), *rowaddress, (a >> 8) & 3, d); - return; - } - - switch (a) - { - case 0x0008: - blitter_addr = (blitter_addr & 0x00ffff) | (d << 16); - return; - - case 0x0017: - blitter_addr = (blitter_addr & 0xff00ff) | (d << 8); - return; - - case 0x0018: - blitter_addr = (blitter_addr & 0xffff00) | (d << 0); - return; - - case 0x4000: - *rowaddress = d; - return; - - case 0x4800: - bankswitch(d); - return; - - case 0x6000: - { - *soundlatch = d; - M6809Close(); - M6809Open(1); - M6809SetIRQLine(M6809_IRQ_LINE, CPU_IRQSTATUS_AUTO); - M6809Close(); - M6809Open(0); - } - return; - - case 0x6800: - watchdog = 0; - TrackReset(); - return; - } -} - -static UINT8 main_read(UINT16 a) -{ - if ((a & 0xf800) == 0x5800) { - return tms34061_read((a & 0xff) ^ ((~a & 0x100) >> 7), *rowaddress, (a >> 8) & 3); - } - - switch (a) - { - case 0x0000: - { - UINT8 data = DrvGfxROM[blitter_addr]; - if ((data & 0xf0) == 0x00) data |= 0xf0; - if ((data & 0x0f) == 0x00) data |= 0x0f; - return data; - } - - case 0x0004: - { - UINT8 data = DrvGfxROM[(blitter_addr & 0x3ffff)]; - blitter_addr = (blitter_addr + 1) & 0x3ffff; - return data; - } - - case 0x6800: // nop - return 0; - - case 0x7000: - return (DrvInputs[0] & 0xb0) | (DrvDips[0] & 0x40) | TrackY(); // track Y - - case 0x7800: - return (DrvInputs[1] & 0xf0) | TrackX(); // track X - } - - return 0; -} - -static void sound_write(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0x1000: - case 0x1001: - BurnYM2203Write(0, a & 1, d); - return; - - case 0x2000: - return; // nop - - case 0x6000: - DACSignedWrite(0, d); - return; - } -} - -static UINT8 sound_read(UINT16 a) -{ - switch (a) - { - case 0x1000: - case 0x1001: - return BurnYM2203Read(0, a & 1); - - case 0x7000: - return *soundlatch; - } - - return 0; -} - -static UINT8 capbowl_ym2203_portA(UINT32) -{ - // ticket handling - return 0; -} - -static void capbowl_ym2203_write_portB(UINT32, UINT32 ) -{ - // ticket handling -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (M6809TotalCycles() / (2000000.000 / (nBurnFPS / 100.000)))); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / 2000000; -} - -static double DrvGetTime() -{ - return (double)M6809TotalCycles() / 2000000; -} - -static void DrvFMIRQCallback(INT32 , INT32 state) -{ - M6809SetIRQLine(M6809_FIRQ_LINE, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void tms34061_interrupt(INT32 state) -{ - M6809SetIRQLine(M6809_FIRQ_LINE, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void draw_layer() -{ - INT32 current_scanline = tms34061_current_scanline + 1; - - if (tms34061_display_blanked()) - { - for (INT32 y = previous_scanline; y < current_scanline && y < nScreenHeight; y++) { - memset (pTransDraw + y * nScreenWidth, 0, nScreenWidth * sizeof(UINT16)); - } - } - else - { - for (INT32 y = previous_scanline; y < current_scanline && y < nScreenHeight; y++) - { - UINT8 *src = tms34061_get_vram_pointer() + y * 256; - UINT16 *dest = pTransDraw + y * nScreenWidth; - - for (INT32 x = 0; x < nScreenWidth; x += 2) - { - UINT8 pix = src[32 + (x / 2)]; - *dest++ = ((src[((pix >> 4) << 1) + 0] << 8) + src[((pix >> 4) << 1) + 1]) & 0xfff; - *dest++ = ((src[((pix & 15) << 1) + 0] << 8) + src[((pix & 15) << 1) + 1]) & 0xfff; - } - } - } - - previous_scanline = current_scanline; - if (previous_scanline == 256) previous_scanline = 0; -} - -static INT32 DrvDoReset(int clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - BurnYM2203Reset(); - DACReset(); - M6809Close(); - - tms34061_reset(); - - memset (DrvNVRAM, 0x01, 0x800); - - watchdog = 0; - blitter_addr = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x020000; - DrvSoundROM = Next; Next += 0x008000; - - DrvGfxROM = Next; Next += 0x040000; - - DrvNVRAM = Next; Next += 0x000800; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(INT32); - - AllRam = Next; - - DrvSoundRAM = Next; Next += 0x000800; - - rowaddress = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - bankselect = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x1000; i++) { - DrvPalette[i] = BurnHighCol((i>>8)|((i>>4)&0xf0), (i&0xf0)|((i>>4)&0x0f), (i&0x0f)|((i&0x0f)<<4), 0); - } -} - -static INT32 DrvInit(INT32 game) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - game_select = game; - - if (game == 0) // capbowl - { - if (BurnLoadRom(DrvMainROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x18000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSoundROM + 0x0000, 4, 1)) return 1; - } - else - { - if (BurnLoadRom(DrvMainROM + 0x0000, 0, 1)) return 1; - - if (BurnLoadRom(DrvSoundROM + 0x0000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000, 2, 1)) return 1; - } - - DrvPaletteInit(); - } - - BurnSetRefreshRate(57.00); - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvNVRAM, 0x5000, 0x57ff, MAP_RAM); - M6809MapMemory(DrvMainROM, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(main_write); - M6809SetReadHandler(main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvSoundRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvSoundROM, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(sound_write); - M6809SetReadHandler(sound_read); - M6809Close(); - - BurnYM2203Init(1, 4000000, DrvFMIRQCallback, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachM6809(2000000); - BurnYM2203SetPorts(0, &capbowl_ym2203_portA, NULL, NULL, &capbowl_ym2203_write_portB); - - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - - tms34061_init(8, 0x10000, draw_layer, tms34061_interrupt); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - DACExit(); - - BurnYM2203Exit(); - - M6809Exit(); - - tms34061_exit(); - - BurnFree(AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog > 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xf0, 2); - - for (INT32 i = 4 ; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - TrackTick(); - - M6809NewFrame(); - - INT32 nInterleave = 256; // scanlines - INT32 nCyclesSegment = 0; - INT32 nCyclesTotal[2] = { 4000000 / 57, 2000000 / 57 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - tms34061_current_scanline = i; - - nCurrentCPU = 0; - M6809Open(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += M6809Run(nCyclesSegment); - - tms34061_interrupt(); - - if (((i + ((game_select) ? 0x10 : 0x00)) & 0x1f) == 0x1f) { // force draw every 32 scanlines - draw_layer(); - } - - M6809Close(); - - nCurrentCPU = 1; - M6809Open(nCurrentCPU); - BurnTimerUpdate((i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave); - M6809Close(); - } - - M6809Open(0); - if (DrvDips[1] & 0x01) { - M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // NMI - } - M6809Close(); - - M6809Open(1); - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029695; - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNVRAM; - ba.nLen = 0x000800; - ba.nAddress = 0; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - - tms34061_scan(nAction, pnMin); - - BurnYM2203Scan(nAction, pnMin); - BurnTimerScan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(blitter_addr); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(*bankselect); - M6809Close(); - } - - return 0; -} - - - -// Capcom Bowling (set 1) - -static struct BurnRomInfo capbowlRomDesc[] = { - { "u6", 0x8000, 0x14924c96, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gr0", 0x8000, 0xef53ca7a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gr1", 0x8000, 0x27ede6ce, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gr2", 0x8000, 0xe49238f4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sound.u30", 0x8000, 0x8c9c3b8a, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code -}; - -STD_ROM_PICK(capbowl) -STD_ROM_FN(capbowl) - -static INT32 CapbowlInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvCapbowl = { - "capbowl", NULL, NULL, NULL, "1988", - "Capcom Bowling (set 1)\0", NULL, "Incredible Technologies / Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, capbowlRomInfo, capbowlRomName, NULL, NULL, CapbowlInputInfo, CapbowlDIPInfo, - CapbowlInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 244, 360, 3, 4 -}; - - -// Capcom Bowling (set 2) - -static struct BurnRomInfo capbowl2RomDesc[] = { - { "program_rev_3_u6.u6", 0x8000, 0x9162934a, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gr0", 0x8000, 0xef53ca7a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gr1", 0x8000, 0x27ede6ce, 1 | BRF_PRG | BRF_ESS }, // 2 - { "gr2", 0x8000, 0xe49238f4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sound.u30", 0x8000, 0x8c9c3b8a, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code -}; - -STD_ROM_PICK(capbowl2) -STD_ROM_FN(capbowl2) - -struct BurnDriver BurnDrvCapbowl2 = { - "capbowl2", "capbowl", NULL, NULL, "1988", - "Capcom Bowling (set 2)\0", NULL, "Incredible Technologies / Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, capbowl2RomInfo, capbowl2RomName, NULL, NULL, CapbowlInputInfo, CapbowlDIPInfo, - CapbowlInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 244, 360, 3, 4 -}; - - -// Capcom Bowling (set 3) - -static struct BurnRomInfo capbowl3RomDesc[] = { - { "3.0_bowl.u6", 0x8000, 0x32e30928, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "grom0-gr0.gr0", 0x8000, 0x2b5eb091, 1 | BRF_PRG | BRF_ESS }, // 1 - { "grom1-gr1.gr1", 0x8000, 0x880e4e1c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "grom2-gr2.gr2", 0x8000, 0xf3d2468d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sound_r2_u30.u30", 0x8000, 0x43ac1658, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code -}; - -STD_ROM_PICK(capbowl3) -STD_ROM_FN(capbowl3) - -struct BurnDriver BurnDrvCapbowl3 = { - "capbowl3", "capbowl", NULL, NULL, "1988", - "Capcom Bowling (set 3)\0", NULL, "Incredible Technologies / Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, capbowl3RomInfo, capbowl3RomName, NULL, NULL, CapbowlInputInfo, CapbowlDIPInfo, - CapbowlInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 244, 360, 3, 4 -}; - - -// Capcom Bowling (set 4) - -static struct BurnRomInfo capbowl4RomDesc[] = { - { "bfb.u6", 0x8000, 0x79f1d083, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "grom0-gr0.gr0", 0x8000, 0x2b5eb091, 1 | BRF_PRG | BRF_ESS }, // 1 - { "grom1-gr1.gr1", 0x8000, 0x880e4e1c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "grom2-gr2.gr2", 0x8000, 0xf3d2468d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bfb.u30", 0x8000, 0x6fe2c4ff, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code -}; - -STD_ROM_PICK(capbowl4) -STD_ROM_FN(capbowl4) - -struct BurnDriver BurnDrvCapbowl4 = { - "capbowl4", "capbowl", NULL, NULL, "1988", - "Capcom Bowling (set 4)\0", NULL, "Incredible Technologies / Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, capbowl4RomInfo, capbowl4RomName, NULL, NULL, CapbowlInputInfo, CapbowlDIPInfo, - CapbowlInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 244, 360, 3, 4 -}; - - -// Coors Light Bowling - -static struct BurnRomInfo clbowlRomDesc[] = { - { "cb8_prg.u6", 0x8000, 0x91e06bc4, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "coors_bowling_grom0.gr0", 0x8000, 0x899c8f15, 1 | BRF_PRG | BRF_ESS }, // 1 - { "coors_bowling_grom1.gr1", 0x8000, 0x0ac0dc4c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "coors_bowling_grom2.gr2", 0x8000, 0x251f5da5, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "coors_bowling_sound.u30", 0x8000, 0x1eba501e, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code -}; - -STD_ROM_PICK(clbowl) -STD_ROM_FN(clbowl) - -struct BurnDriver BurnDrvClbowl = { - "clbowl", "capbowl", NULL, NULL, "1989", - "Coors Light Bowling\0", NULL, "Incredible Technologies / Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, clbowlRomInfo, clbowlRomName, NULL, NULL, CapbowlInputInfo, CapbowlDIPInfo, - CapbowlInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 244, 360, 3, 4 -}; - - -// Bowl-O-Rama - -static struct BurnRomInfo bowlramaRomDesc[] = { - { "bowl-o-rama_rev_1.0_u6.u6", 0x08000, 0x7103ad55, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "bowl-o-rama_rev_1.0_u30.u30", 0x08000, 0xf3168834, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - - { "bowl-o-rama_rev_1.0_ux7.ux7", 0x40000, 0x8727432a, 3 | BRF_GRA }, // 2 Graphics Data -}; - -STD_ROM_PICK(bowlrama) -STD_ROM_FN(bowlrama) - -static INT32 BowlramaInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvBowlrama = { - "bowlrama", NULL, NULL, NULL, "1991", - "Bowl-O-Rama\0", NULL, "P&P Marketing", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, bowlramaRomInfo, bowlramaRomName, NULL, NULL, CapbowlInputInfo, CapbowlDIPInfo, - BowlramaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 240, 360, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_cclimber.cpp b/jan/src/burn/drv/pre90s/d_cclimber.cpp deleted file mode 100644 index f8bf6373c..000000000 --- a/jan/src/burn/drv/pre90s/d_cclimber.cpp +++ /dev/null @@ -1,2065 +0,0 @@ -// Crazy Climber FBA Driver -// Based on MAME driver by Nicola Salmoria - -// Todo: -// 1: hook up samples -// 2: fix Crazy Kong pt. II offsets and bigsprite flipping issues - -#include "tiles_generic.h" -#include "driver.h" -#include "z80_intf.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80OPS; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvUser1; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvZ80RAM1_0; -static UINT8 *DrvBGSprRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - -static INT32 DrvGfxROM0Len; -static INT32 DrvGfxROM1Len; - -static INT32 flipscreen[2]; -static INT32 interrupt_enable; -static UINT8 yamato_p0; -static UINT8 yamato_p1; -static UINT8 swimmer_background_color; -static UINT8 swimmer_sidebg; -static UINT8 swimmer_palettebank; -static UINT8 soundlatch; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvInputs[4]; -static UINT8 DrvDips[2]; - -// per-game constants -static INT32 game_select; -static INT32 silvland = 0; -static INT32 gfx0_cont800 = 0; -static INT32 uses_sub; -static UINT8 bigsprite_index; - -static struct BurnInputInfo CclimberInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy3 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy3 + 2, "p1 start" }, - - {"P1 Up (left)" , BIT_DIGITAL , DrvJoy1 + 0, "p1 up" }, - {"P1 Down (left)" , BIT_DIGITAL , DrvJoy1 + 1, "p1 down" }, - {"P1 Left (left)" , BIT_DIGITAL , DrvJoy1 + 2, "p1 left" }, - {"P1 Right (left)" , BIT_DIGITAL , DrvJoy1 + 3, "p1 right" }, - {"P1 Up (right)" , BIT_DIGITAL , DrvJoy1 + 4, "p3 up" }, - {"P1 Down (right)" , BIT_DIGITAL , DrvJoy1 + 5, "p3 down" }, - {"P1 Left (right)" , BIT_DIGITAL , DrvJoy1 + 6, "p3 left" }, - {"P1 Right (right)" , BIT_DIGITAL , DrvJoy1 + 7, "p3 right" }, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy3 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy3 + 3, "p2 start" }, - - {"P2 Up (left)" , BIT_DIGITAL , DrvJoy2 + 0, "p2 up" }, - {"P2 Down (left)" , BIT_DIGITAL , DrvJoy2 + 1, "p2 down" }, - {"P2 Left (left)" , BIT_DIGITAL , DrvJoy2 + 2, "p2 left" }, - {"P2 Right (left)" , BIT_DIGITAL , DrvJoy2 + 3, "p2 right" }, - {"P2 Up (right)" , BIT_DIGITAL , DrvJoy2 + 4, "p4 up" }, - {"P2 Down (right)" , BIT_DIGITAL , DrvJoy2 + 5, "p4 down" }, - {"P2 Left (right)" , BIT_DIGITAL , DrvJoy2 + 6, "p4 left" }, - {"P2 Right (right)" , BIT_DIGITAL , DrvJoy2 + 7, "p4 right" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip" , BIT_DIPSWITCH, DrvDips + 0 , "dip" }, -}; - -STDINPUTINFO(Cclimber) - -static struct BurnDIPInfo CclimberDIPList[]= -{ - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x00, "3" }, - {0x15, 0x01, 0x03, 0x01, "4" }, - {0x15, 0x01, 0x03, 0x02, "5" }, - {0x15, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2, "Rack Test (Cheat)" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x16, 0x01, 0x10, 0x10, "Upright" }, - {0x16, 0x01, 0x10, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Cclimber) - -static struct BurnInputInfo RpatrolInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 6, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 7, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 7, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Rpatrol) - -static struct BurnDIPInfo RpatrolDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x90, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0a, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x03, 0x03, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0a, 0x01, 0x0c, 0x00, "3" }, - {0x0a, 0x01, 0x0c, 0x04, "4" }, - {0x0a, 0x01, 0x0c, 0x08, "5" }, - {0x0a, 0x01, 0x0c, 0x0c, "6" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0a, 0x01, 0x10, 0x10, "Upright" }, - {0x0a, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unknown 1" }, - {0x0a, 0x01, 0x20, 0x00, "Off" }, - {0x0a, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown 2" }, - {0x0a, 0x01, 0x40, 0x00, "Off" }, - {0x0a, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Memory Test" }, - {0x0a, 0x01, 0x80, 0x00, "Retry on Error" }, - {0x0a, 0x01, 0x80, 0x80, "Stop on Error" }, -}; - -STDDIPINFO(Rpatrol) - -static struct BurnInputInfo CkongInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 6, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 7, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Ckong) - - -static struct BurnDIPInfo CkongDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x03, 0x00, "3" }, - {0x0f, 0x01, 0x03, 0x01, "4" }, - {0x0f, 0x01, 0x03, 0x02, "5" }, - {0x0f, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0f, 0x01, 0x0c, 0x00, "7000" }, - {0x0f, 0x01, 0x0c, 0x04, "10000" }, - {0x0f, 0x01, 0x0c, 0x08, "15000" }, - {0x0f, 0x01, 0x0c, 0x0c, "20000" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0f, 0x01, 0x70, 0x70, "5 Coins 1 Credits" }, - {0x0f, 0x01, 0x70, 0x50, "4 Coins 1 Credits" }, - {0x0f, 0x01, 0x70, 0x30, "3 Coins 1 Credits" }, - {0x0f, 0x01, 0x70, 0x10, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x70, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x70, 0x20, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x70, 0x40, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0x70, 0x60, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x80, 0x80, "Upright" }, - {0x0f, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Ckong) - -static struct BurnInputInfo GuzzlerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy4 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Guzzler) - - -static struct BurnDIPInfo GuzzlerDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x03, 0x00, "3" }, - {0x0f, 0x01, 0x03, 0x01, "4" }, - {0x0f, 0x01, 0x03, 0x02, "5" }, - {0x0f, 0x01, 0x03, 0x03, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0f, 0x01, 0x0c, 0x04, "20K, every 50K" }, - {0x0f, 0x01, 0x0c, 0x00, "30K, every 100K" }, - {0x0f, 0x01, 0x0c, 0x08, "30K only" }, - {0x0f, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0f, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x10, 0x10, "Upright" }, - {0x10, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "High Score Names" }, - {0x10, 0x01, 0x20, 0x20, "3 Letters" }, - {0x10, 0x01, 0x20, 0x00, "10 Letters" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0xc0, 0x00, "Easy" }, - {0x10, 0x01, 0xc0, 0x40, "Medium" }, - {0x10, 0x01, 0xc0, 0x80, "Hard" }, - {0x10, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Guzzler) - - -static struct BurnInputInfo YamatoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy4 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 6, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 7, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Yamato) - - -static struct BurnDIPInfo YamatoDIPList[]= -{ - {0x11, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x00, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x1c, 0x0c, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x04, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x1c, 0x18, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x1c, 0x10, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x1c, 0x1c, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x20, 0x00, "Every 30000" }, - {0x11, 0x01, 0x20, 0x20, "Every 50000" }, - - {0 , 0xfe, 0 , 2, "Speed" }, - {0x11, 0x01, 0x40, 0x00, "Slow" }, - {0x11, 0x01, 0x40, 0x40, "Fast" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x80, 0x80, "Upright" }, - {0x11, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Yamato) - -static struct BurnInputInfo SwimmerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Swimmer) - - -static struct BurnDIPInfo SwimmerDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x30, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x03, 0x00, "3" }, - {0x0f, 0x01, 0x03, 0x01, "4" }, - {0x0f, 0x01, 0x03, 0x02, "5" }, - {0x0f, 0x01, 0x03, 0x03, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0f, 0x01, 0x0c, 0x00, "10000" }, - {0x0f, 0x01, 0x0c, 0x04, "20000" }, - {0x0f, 0x01, 0x0c, 0x08, "30000" }, - {0x0f, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0f, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x10, 0x10, "Upright" }, - {0x10, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x20, 0x00, "Off" }, - {0x10, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0xc0, 0x00, "Easy" }, - {0x10, 0x01, 0xc0, 0x40, "Hard" }, - {0x10, 0x01, 0xc0, 0x80, "Harder" }, - {0x10, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Swimmer) - -static void __fastcall cclimber_write(UINT16 address, UINT8 data) -{ - if (address >= 0x9c00 && address <= 0x9fff) { - INT32 offset = (address - 0x9c00) & 0x0fdf; - DrvColRAM[offset] = data; - DrvColRAM[offset + 0x20] = data; - return; - } - - switch (address) - { - case 0xa000: - interrupt_enable = data; - return; - - case 0xa001: - case 0xa002: - flipscreen[address & 1] = data & 1; - return; - - case 0xa003: - // cclimber_sample_trigger_w - if (game_select == 6) { - swimmer_sidebg = data; - } - return; - - case 0xa004: - if (game_select == 6) { - swimmer_palettebank = data; - } - return; - - case 0xa800: - // cclimber_sample_rate_W - if (game_select == 6) { - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xb000: - // cclimber_sample_volume_w - return; - - case 0xb800: - if (game_select == 6) { - swimmer_background_color = data; - } - return; - } - - return; -} - -static UINT8 __fastcall cclimber_read(UINT16 address) -{ - if (game_select == 6) { // swimmer hack for lazy. - switch (address) - { - case 0xa000: - return DrvInputs[1]; - case 0xa800: - return DrvInputs[0]; - case 0xb000: - return DrvDips[0]; - case 0xb800: - return DrvDips[1] | DrvInputs[2]; - case 0xb880: - return DrvInputs[3]; - } - - return 0; - } - - switch (address) - { - case 0xa000: - return DrvInputs[0]; - case 0xa800: - return DrvInputs[1]; - case 0xb000: - return DrvDips[0]; - case 0xb800: - return DrvInputs[2]; - case 0xba00: - return DrvInputs[3]; - - } - - return 0; -} - -static UINT8 __fastcall swimmer_sub_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static void __fastcall cclimber_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x08: - case 0x09: - if (game_select != 5) AY8910Write(0, port & 1, data); - return; - case 0x00: - yamato_p0 = data; - return; - case 0x01: - yamato_p1 = data; - return; - } - - return; -} - -static UINT8 __fastcall cclimber_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x0c: - return AY8910Read(0); - } - - return 0; -} - -static void __fastcall sub_out(UINT16 port, UINT8 data) -{ - port &= 0xff; - - if (game_select == 6) { // swimmer / guzzler - switch (port) - { - case 0x00: - case 0x01: - case 0x80: - case 0x81: - AY8910Write((port)>>7, ~port & 1, data); - return; - } - - return; - } - - switch (port) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - AY8910Write((port&2)>>1, port & 1, data); - return; - } - - return; -} - -static UINT8 __fastcall sub_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x04: - return yamato_p0; - case 0x08: - return yamato_p1; - } - - return 0; -} - - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset(AllRam, 0, RamEnd - AllRam); - - flipscreen[0] = flipscreen[1] = 0; - interrupt_enable = 0; - - bigsprite_index = (game_select == 6) ? 0xfc : 0xdc; - - yamato_p0 = yamato_p1 = 0; - swimmer_background_color = swimmer_sidebg = swimmer_palettebank = soundlatch = 0; - - ZetOpen(0); - ZetReset(); - ZetClose(); - - if (uses_sub) { - ZetOpen(1); - ZetReset(); - ZetClose(); - } - - AY8910Reset(0); - AY8910Reset(1); - - return 0; -} - -static void cclimber_sample_select_w(UINT32, UINT32) -{ -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x0010000; - DrvZ80OPS = Next; Next += 0x0010000; - - DrvGfxROM0 = Next; Next += 0x0060000; - DrvGfxROM1 = Next; Next += 0x0060000; - DrvGfxROM2 = Next; Next += 0x0060000; - - DrvColPROM = Next; Next += 0x0000300; - - DrvSndROM = Next; Next += 0x0012000; - DrvUser1 = Next; Next += 0x0010000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x0000c00; - DrvZ80RAM1 = Next; Next += 0x0000800; - DrvZ80RAM2 = Next; Next += 0x0000800; - DrvZ80RAM1_0 = Next; Next += 0x0001000; - DrvBGSprRAM = Next; Next += 0x0000100; - DrvSprRAM = Next; Next += 0x0000400; - DrvColRAM = Next; Next += 0x0000400; - DrvVidRAM = Next; Next += 0x0000400; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(UINT8 *gfx_base, UINT8 *gfx_dest, INT32 len, INT32 size) -{ - INT32 Plane[2] = { 0, (len / 2) * 8 }; - INT32 PlaneSwimmer[3] = { 0, RGN_FRAC(len, 1, 3), RGN_FRAC(len, 2, 3) }; - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, - 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, gfx_base, len); - if (game_select == 6) { // swimmer, guzzler - GfxDecode(((len * 8) / 3) / (size * size), 3, size, size, PlaneSwimmer, XOffs, YOffs, (size * size), tmp, gfx_dest); - } else { - GfxDecode(((len * 8) / 2) / (size * size), 2, size, size, Plane, XOffs, YOffs, (size * size), tmp, gfx_dest); - } - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0;i < 96; i++) - { - INT32 bit0, bit1, bit2; - INT32 r, g, b; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = bit0 * 33 + bit1 * 71 + bit2 * 151; - r = (int)(r + 0.5); - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - g = bit0 * 33 + bit1 * 71 + bit2 * 151; - g = (int)(g + 0.5); - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - b = bit0 * 71 + bit1 * 151; - b = (int)(b + 0.5); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - if (silvland) { - bprintf(0, _T("silvlandpalette")); - DrvPalette[0x42] = BurnHighCol(0xff, 0xce, 0xce, 0); - } -} - -static void YamatoPaletteInit() -{ - const UINT8 *color_prom = DrvColPROM; - int i; - - /* chars - 12 bits RGB */ - for (i = 0; i < 0x40; i++) - { - int bit0, bit1, bit2, bit3; - int r, g, b; - - /* red component */ - bit0 = (color_prom[i + 0x00] >> 0) & 0x01; - bit1 = (color_prom[i + 0x00] >> 1) & 0x01; - bit2 = (color_prom[i + 0x00] >> 2) & 0x01; - bit3 = (color_prom[i + 0x00] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - /* green component */ - bit0 = (color_prom[i + 0x00] >> 4) & 0x01; - bit1 = (color_prom[i + 0x00] >> 5) & 0x01; - bit2 = (color_prom[i + 0x00] >> 6) & 0x01; - bit3 = (color_prom[i + 0x00] >> 7) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - /* blue component */ - bit0 = (color_prom[i + 0x40] >> 0) & 0x01; - bit1 = (color_prom[i + 0x40] >> 1) & 0x01; - bit2 = (color_prom[i + 0x40] >> 2) & 0x01; - bit3 = (color_prom[i + 0x40] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - - /* big sprite - 8 bits RGB */ - for (i = 0; i < 0x20; i++) - { - int bit0, bit1, bit2; - int r, g, b; - - /* red component */ - bit0 = (color_prom[i + 0x80] >> 0) & 0x01; - bit1 = (color_prom[i + 0x80] >> 1) & 0x01; - bit2 = (color_prom[i + 0x80] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* green component */ - bit0 = (color_prom[i + 0x80] >> 3) & 0x01; - bit1 = (color_prom[i + 0x80] >> 4) & 0x01; - bit2 = (color_prom[i + 0x80] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* blue component */ - bit0 = 0; - bit1 = (color_prom[i + 0x80] >> 6) & 0x01; - bit2 = (color_prom[i + 0x80] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i + 0x40] = BurnHighCol(r, g, b, 0); - } - - /* fake colors for bg gradient */ - for (i = 0; i < 0x100; i++) - DrvPalette[i + 0x60] = BurnHighCol(0, 0, i, 0); -} - -void swimmer_set_background_pen() -{ - int bit0, bit1, bit2; - int r, g, b; - - /* red component */ - bit0 = 0; - bit1 = (swimmer_background_color >> 6) & 0x01; - bit2 = (swimmer_background_color >> 7) & 0x01; - r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2; - - /* green component */ - bit0 = (swimmer_background_color >> 3) & 0x01; - bit1 = (swimmer_background_color >> 4) & 0x01; - bit2 = (swimmer_background_color >> 5) & 0x01; - g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2; - - /* blue component */ - bit0 = (swimmer_background_color >> 0) & 0x01; - bit1 = (swimmer_background_color >> 1) & 0x01; - bit2 = (swimmer_background_color >> 2) & 0x01; - b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2; - - DrvPalette[0x00] = BurnHighCol(r, g, b, 0); -} - -static void SwimmerPaletteInit() -{ - const UINT8 *color_prom = DrvColPROM; - int i; - - for (i = 0; i < 0x100; i++) - { - int bit0, bit1, bit2; - int r, g, b; - - /* red component */ - bit0 = (color_prom[i + 0x000] >> 0) & 0x01; - bit1 = (color_prom[i + 0x000] >> 1) & 0x01; - bit2 = (color_prom[i + 0x000] >> 2) & 0x01; - r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2; - - /* green component */ - bit0 = (color_prom[i + 0x000] >> 3) & 0x01; - bit1 = (color_prom[i + 0x100] >> 0) & 0x01; - bit2 = (color_prom[i + 0x100] >> 1) & 0x01; - g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2; - - /* blue component */ - bit0 = 0; - bit1 = (color_prom[i + 0x100] >> 2) & 0x01; - bit2 = (color_prom[i + 0x100] >> 3) & 0x01; - b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - - color_prom += 0x200; - - /* big sprite */ - for (i = 0; i < 0x20; i++) - { - int bit0, bit1, bit2; - int r, g, b; - - /* red component */ - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2; - - /* green component */ - bit0 = (color_prom[i] >> 3) & 0x01; - bit1 = (color_prom[i] >> 4) & 0x01; - bit2 = (color_prom[i] >> 5) & 0x01; - g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2; - - /* blue component */ - bit0 = 0; - bit1 = (color_prom[i] >> 6) & 0x01; - bit2 = (color_prom[i] >> 7) & 0x01; - b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2; - - DrvPalette[i + 0x100] = BurnHighCol(r, g, b, 0); - } - - /* side panel backgrond pen */ - DrvPalette[0x120] = BurnHighCol(0x20, 0x98, 0x79, 0); - - swimmer_set_background_pen(); -} - - -static void cclimber_decode(const INT8 convtable[8][16]) -{ - UINT8 *rom = DrvZ80ROM; - UINT8 *decrypt = DrvZ80OPS; - INT32 A; - - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80OPS, DrvZ80ROM); - ZetClose(); - - for (A = 0x0000;A < 0x10000;A++) - { - INT32 i,j; - UINT8 src; - - src = rom[A]; - - /* pick the translation table from bit 0 of the address */ - /* and from bits 1 7 of the source data */ - i = (A & 1) | (src & 0x02) | ((src & 0x80) >> 5); - - /* pick the offset in the table from bits 0 2 4 6 of the source data */ - j = (src & 0x01) | ((src & 0x04) >> 1) | ((src & 0x10) >> 2) | ((src & 0x40) >> 3); - - /* decode the opcodes */ - decrypt[A] = (src & 0xaa) | convtable[i][j]; - } -} - - -static INT32 GetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *Load0 = DrvZ80ROM; - UINT8 *Loadg0 = DrvGfxROM0; - UINT8 *Loadg1 = DrvGfxROM2; - UINT8 *Loadc = DrvColPROM; - UINT8 *Loads = DrvSndROM; - UINT8 *LoadU = DrvUser1; - DrvGfxROM0Len = 0; - DrvGfxROM1Len = 0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(Load0, i, 1)) return 1; - Load0 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(Loadg0, i, 1)) return 1; - if (gfx0_cont800) { // loads 0x800 bytes at 0x0000 and 0x1000 - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - memmove(tmp, Loadg0, 0x1000); - memset(Loadg0, 0, 0x1000); - memmove(Loadg0 + 0x00000, tmp + 0x00000, 0x800); - memmove(Loadg0 + 0x01000, tmp + 0x00800, 0x800); - BurnFree(tmp); - Loadg0 += 0x2000; - DrvGfxROM0Len += 0x2000; - } else { - Loadg0 += (game_select == 1) ? 0x1000 : ri.nLen; - DrvGfxROM0Len += (game_select == 1) ? 0x1000 : ri.nLen; - } - - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(Loadg1, i, 1)) return 1; - Loadg1 += ri.nLen; - DrvGfxROM1Len += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(LoadU, i, 1)) return 1; - LoadU += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 6) { - if (BurnLoadRom(Loadc, i, 1)) return 1; - Loadc += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 7) { - if (BurnLoadRom(Loads, i, 1)) return 1; - Loads += ri.nLen; - - continue; - } - } - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (GetRoms()) return 1; - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, DrvGfxROM0Len, 16); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, DrvGfxROM0Len, 8); - DrvGfxDecode(DrvGfxROM2, DrvGfxROM2, DrvGfxROM1Len, 8); - - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - - if (game_select == 6) { // swimmer, guzzler - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80ROM + 0x8000,0xe000, 0xffff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvBGSprRAM, 0x8800, 0x88ff, MAP_RAM); - ZetMapMemory(DrvBGSprRAM, 0x8900, 0x89ff, MAP_RAM); // mirror - } else { - ZetMapMemory(DrvZ80ROM, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x6000, 0x6bff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0x8000, 0x83ff, MAP_RAM); - ZetMapMemory(DrvBGSprRAM, 0x8800, 0x88ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM2, 0x8900, 0x8bff, MAP_RAM); - } - ZetMapMemory(DrvVidRAM, 0x9000, 0x93ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x9400, 0x97ff, MAP_RAM); // mirror - ZetMapMemory(DrvSprRAM, 0x9800, 0x9bff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0x9c00, 0x9fff, MAP_READ); // special write in handler - - ZetSetWriteHandler(cclimber_write); - ZetSetReadHandler(cclimber_read); - ZetSetOutHandler(cclimber_out); - ZetSetInHandler(cclimber_in); - ZetClose(); - - if (uses_sub) { - ZetInit(1); - ZetOpen(1); - if (game_select == 5) { // yamato - ZetMapMemory(DrvSndROM, 0x0000, 0x07ff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1_0, 0x5000, 0x53ff, MAP_RAM); - ZetSetOutHandler(sub_out); - ZetSetInHandler(sub_in); - } - if (game_select == 6) { // swimmer/guzzler - ZetMapMemory(DrvSndROM, 0x0000, 0x0fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1_0, 0x2000, 0x23ff, MAP_RAM); - ZetMapMemory(DrvSndROM + 0x1000,0x4000, 0xffff, MAP_RAM); - ZetSetReadHandler(swimmer_sub_read); - ZetSetOutHandler(sub_out); - } - ZetClose(); - } - - AY8910Init(0, (game_select == 6) ? 2000000 : 1536000, nBurnSoundRate, NULL, NULL, &cclimber_sample_select_w, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910Init(1, (game_select == 6) ? 2000000 : 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - game_select = 0; - uses_sub = 0; - silvland = 0; - gfx0_cont800 = 0; - - return 0; -} - -static void cclimber_draw_bigsprite() -{ - UINT8 x = 136 - DrvSprRAM[bigsprite_index + 3]; - UINT8 y = 128 - DrvSprRAM[bigsprite_index + 2]; - INT32 flipx = (DrvSprRAM[bigsprite_index + 1] & 0x10) >> 4; - INT32 flipy = (DrvSprRAM[bigsprite_index + 1] & 0x20) >> 5; - INT32 bits = (game_select == 6) ? 3 : 2; - INT32 palindex = (game_select == 6) ? 0x100 : 0x40; - - if (flipscreen[0]) { // flipx - flipx = !flipx; - } - - if (flipscreen[1]) { // flipy - y = 128 - y; - flipy = !flipy; - } - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - if ((offs & 0x210) != 0x210) continue; // everything else is transparent, apparently - - INT32 ofst = ((offs & 0x1e0) >> 1) | (offs & 0x0f); - - INT32 sx = ofst % 0x10; - INT32 sy = ofst / 0x10; - if (flipx) sx = 15 - sx; - if (flipy) sy = 15 - sy; - - sx = (x+8*sx) & 0xff; - sy = (y+8*sy) & 0xff; - - sy -= 16; //offsets - - INT32 code = ((DrvSprRAM[bigsprite_index + 1] & 0x08) << 5) | DrvBGSprRAM[ofst]; - code &= 0x3ff; - INT32 color = DrvSprRAM[bigsprite_index + 1] & 0x07; - color &= 0x1ff; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, bits, 0, palindex, DrvGfxROM2); - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx-256, sy, color, bits, 0, palindex, DrvGfxROM2); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, bits, 0, palindex, DrvGfxROM2); - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx-256, sy, color, bits, 0, palindex, DrvGfxROM2); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, bits, 0, palindex, DrvGfxROM2); - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx-256, sy, color, bits, 0, palindex, DrvGfxROM2); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, bits, 0, palindex, DrvGfxROM2); - Render8x8Tile_Mask_Clip(pTransDraw, code, sx-256, sy, color, bits, 0, palindex, DrvGfxROM2); - } - } - - } -} - -static void draw_playfield() -{ - INT32 bits = (game_select == 6) ? 3 : 2; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= DrvSprRAM[sx >> 3]; // col scroll - sy -= 16; //offsets - if (sy < -7) sy += 256; - if (sx < -7) sx += 256; - - INT32 flipy = (DrvColRAM[offs] & 0x80) >> 7; - INT32 flipx = (DrvColRAM[offs] & 0x40) >> 6; - - INT32 tile_offs = offs ^ (flipy << 5); - - if (flipscreen[0]) { // flipx - sx = 248 - sx; - flipx ^= 1; - } - - if (flipscreen[1]) { // flipy - sy = 248 - sy; - flipy ^= 1; - } - - INT32 code = ((DrvColRAM[tile_offs] & 0x10) << 5) + ((DrvColRAM[tile_offs] & 0x20) << 3) + DrvVidRAM[tile_offs]; - INT32 color = DrvColRAM[tile_offs] & 0x0f; - - if (game_select == 6) { - code = ((DrvColRAM[tile_offs] & 0x10) << 4) | DrvVidRAM[tile_offs]; - color = ((swimmer_palettebank & 0x01) << 4) | (DrvColRAM[tile_offs] & 0x0f); - } - - if (sx > nScreenWidth || sy > nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, bits, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, bits, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, bits, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, bits, 0, 0, DrvGfxROM0); - } - } - } -} - -#if 0 -extern int counter; -static void draw_debug() -{ - INT32 code = 0; - INT32 color = counter; - for (INT32 sy = 0; sy<31; sy++) - for (INT32 sx = 0; sx<31; sx++) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx*8, sy*8, color, 2, 0, 0, DrvGfxROM0); - code++; - } -} -#endif - -static void draw_sprites() -{ - INT32 bits = (game_select == 6) ? 3 : 2; - - for (INT32 offs = 0x9c; offs >= 0x80; offs -= 4) - { - INT32 x = DrvSprRAM[offs + 3]; - INT32 y = 240 - DrvSprRAM[offs + 2]; - y -= 16; //offsets - - INT32 code = ((DrvSprRAM[offs + 1] & 0x10) << 3) | - ((DrvSprRAM[offs + 1] & 0x20) << 1) | - (DrvSprRAM[offs + 0] & 0x3f); - - INT32 color = DrvSprRAM[offs + 1] & 0x0f; - - if (game_select == 6) { - code = ((DrvSprRAM[offs + 1] & 0x10) << 2) | - (DrvSprRAM[offs + 0] & 0x3f); - - color = ((swimmer_palettebank & 0x01) << 4) | - (DrvSprRAM[offs + 1] & 0x0f); - - } - - INT32 flipx = DrvSprRAM[offs + 0] & 0x40; - INT32 flipy = DrvSprRAM[offs + 0] & 0x80; - - if (flipscreen[0] & 1) - { - x = 240 - x; - flipx = !flipx; - } - - if (flipscreen[1] & 1) - { - y = 240 - y; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, color, bits, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, color, bits, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, bits, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, bits, 0, 0, DrvGfxROM1); - } - } - } -} - -#define SWIMMER_SIDE_BG_PEN (0x120) -#define SWIMMER_BG_PEN (0x00) -#define SWIMMER_BG_SPLIT (0x18 * 8) - -void swimmer_draw_backdrop() // background effects for swimmer/guzzler -{ - swimmer_set_background_pen(); - - if (swimmer_sidebg & 1) { - for (INT32 y = 0; y < nScreenHeight; y++) - for (INT32 x = 0; x < nScreenWidth; x++) { - if (flipscreen[0] & 1) { - if (x <= 0xff - SWIMMER_BG_SPLIT) { - pTransDraw[(y*nScreenWidth) + x] = SWIMMER_SIDE_BG_PEN; - } else { - pTransDraw[(y*nScreenWidth) + x] = SWIMMER_BG_PEN; - } - } else { - if (x <= SWIMMER_BG_SPLIT - 1) { - pTransDraw[(y*nScreenWidth) + x] = SWIMMER_BG_PEN; - } else { - pTransDraw[(y*nScreenWidth) + x] = SWIMMER_SIDE_BG_PEN; - } - } - } - } else { // just fill bg - for (INT32 y = 0; y < nScreenHeight; y++) - for (INT32 x = 0; x < nScreenWidth; x++) { - pTransDraw[(y*nScreenWidth) + x] = SWIMMER_BG_PEN; - } - } -} - -void yamato_draw_backdrop() // synth yamato backdrop -{ - UINT8 *sky_rom = DrvUser1 + 0x1200; - - for (INT32 i = 0; i < 0x100; i++) { - INT32 pen = 0x60 + sky_rom[(flipscreen[0] ? 0x80 : 0) + (i >> 1)]; - - for (INT32 j = 0; j < 0x100; j++) { - INT32 coord = (j * nScreenWidth) + ((i - 8) & 0xff); - - if (coord < (nScreenHeight * nScreenWidth)) - pTransDraw[coord] = pen; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - if (game_select == 6) { - SwimmerPaletteInit(); - } else - if (game_select == 5) { - YamatoPaletteInit(); - } else { - DrvPaletteInit(); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (game_select == 6) { - swimmer_draw_backdrop(); - } - - if (game_select == 5) { - yamato_draw_backdrop(); - } - - if (nBurnLayer & 1) draw_playfield(); - - if (DrvSprRAM[bigsprite_index] & 1) { - if (nBurnLayer & 2) cclimber_draw_bigsprite(); - if (nBurnLayer & 4) draw_sprites(); - } else { - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 2) cclimber_draw_bigsprite(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - { - UINT32 JoyInit[4] = { 0x00, 0x00, 0x00, 0x00 }; - UINT8 *DrvJoys[4] = { DrvJoy1, DrvJoy2, DrvJoy3, DrvJoy4 }; - - CompileInput(DrvJoys, (void*)DrvInputs, 4, 8, JoyInit); - - if (game_select == 2) - DrvInputs[2] = 0xff - DrvInputs[2]; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 3072000 / 60, ((game_select == 6) ? 2000000 : 3072000) / 60 }; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - ZetRun(nCyclesTotal[0] / nInterleave); - if (i == nInterleave - 1 && interrupt_enable) - ZetNmi(); - ZetClose(); - - if (uses_sub) { - ZetOpen(1); - ZetRun(nCyclesTotal[1] / nInterleave); - if (game_select == 6 && (i%63==0)) // 4x per frame - ZetNmi(); - ZetClose(); - } - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - SCAN_VAR(interrupt_enable); - SCAN_VAR(yamato_p0); - SCAN_VAR(yamato_p1); - SCAN_VAR(swimmer_background_color); - SCAN_VAR(swimmer_sidebg); - SCAN_VAR(swimmer_palettebank); - SCAN_VAR(soundlatch); - } - - return 0; -} - - -// Crazy Climber (US) - -static struct BurnRomInfo cclimberRomDesc[] = { - { "cc11", 0x1000, 0x217ec4ff, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "cc10", 0x1000, 0xb3c26cef, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cc09", 0x1000, 0x6db0879c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "cc08", 0x1000, 0xf48c5fe3, 1 | BRF_PRG | BRF_ESS }, // 3 - { "cc07", 0x1000, 0x3e873baf, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "cc06", 0x0800, 0x481b64cc, 2 | BRF_GRA }, // 5 - Sprites & Tiles - { "cc05", 0x0800, 0x2c33b760, 2 | BRF_GRA }, // 6 - { "cc04", 0x0800, 0x332347cb, 2 | BRF_GRA }, // 7 - { "cc03", 0x0800, 0x4e4b3658, 2 | BRF_GRA }, // 8 - - { "cc02", 0x0800, 0x14f3ecc9, 3 | BRF_GRA }, // 9 - Big Sprites - { "cc01", 0x0800, 0x21c0f9fb, 3 | BRF_GRA }, // 10 - - { "cclimber.pr1", 0x0020, 0x751c3325, 6 | BRF_GRA }, // 11 - Color Proms - { "cclimber.pr2", 0x0020, 0xab1940fa, 6 | BRF_GRA }, // 12 - { "cclimber.pr3", 0x0020, 0x71317756, 6 | BRF_GRA }, // 13 - - { "cc13", 0x1000, 0xe0042f75, 7 | BRF_SND }, // 14 - Samples - { "cc12", 0x1000, 0x5da13aaa, 7 | BRF_SND }, // 15 -}; - -STD_ROM_PICK(cclimber) -STD_ROM_FN(cclimber) - -static void cclimber_decrypt() -{ - static const INT8 convtable[8][16] = - { - /* -1 marks spots which are unused and therefore unknown */ - { 0x44,0x14,0x54,0x10,0x11,0x41,0x05,0x50,0x51,0x00,0x40,0x55,0x45,0x04,0x01,0x15 }, - { 0x44,0x10,0x15,0x55,0x00,0x41,0x40,0x51,0x14,0x45,0x11,0x50,0x01,0x54,0x04,0x05 }, - { 0x45,0x10,0x11,0x44,0x05,0x50,0x51,0x04,0x41,0x14,0x15,0x40,0x01,0x54,0x55,0x00 }, - { 0x04,0x51,0x45,0x00,0x44,0x10, -1,0x55,0x11,0x54,0x50,0x40,0x05, -1,0x14,0x01 }, - { 0x54,0x51,0x15,0x45,0x44,0x01,0x11,0x41,0x04,0x55,0x50, -1,0x00,0x10,0x40, -1 }, - { -1,0x54,0x14,0x50,0x51,0x01, -1,0x40,0x41,0x10,0x00,0x55,0x05,0x44,0x11,0x45 }, - { 0x51,0x04,0x10, -1,0x50,0x40,0x00, -1,0x41,0x01,0x05,0x15,0x11,0x14,0x44,0x54 }, - { -1, -1,0x54,0x01,0x15,0x40,0x45,0x41,0x51,0x04,0x50,0x05,0x11,0x44,0x10,0x14 } - }; - - cclimber_decode(convtable); -} - -static INT32 cclimberInit() -{ - INT32 nRet; - - game_select = 1; - - nRet = DrvInit(); - - if (nRet == 0) { - cclimber_decrypt(); - } - - return nRet; -} - -struct BurnDriver BurnDrvCclimber = { - "cclimber", NULL, NULL, NULL, "1980", - "Crazy Climber (US)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, cclimberRomInfo, cclimberRomName, NULL, NULL, CclimberInputInfo, CclimberDIPInfo, - cclimberInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 256, 224, 4, 3 -}; - -static INT32 ckongInit() -{ - game_select = 2; - uses_sub = 0; - - INT32 rc = DrvInit(); - - if (rc == 0) { - //save for later maybe - } - - return rc; -} - -// Crazy Kong Part II (set 1) - -static struct BurnRomInfo ckongpt2RomDesc[] = { - { "7.5d", 0x1000, 0xb27df032, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "8.5e", 0x1000, 0x5dc1aaba, 1 | BRF_PRG | BRF_ESS }, // 1 - { "9.5h", 0x1000, 0xc9054c94, 1 | BRF_PRG | BRF_ESS }, // 2 - { "10.5k", 0x1000, 0x069c4797, 1 | BRF_PRG | BRF_ESS }, // 3 - { "11.5l", 0x1000, 0xae159192, 1 | BRF_PRG | BRF_ESS }, // 4 - { "12.5n", 0x1000, 0x966bc9ab, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "6.11n", 0x1000, 0x2dcedd12, 2 | BRF_GRA }, // 6 gfx1 - { "5.11l", 0x1000, 0xfa7cbd91, 2 | BRF_GRA }, // 7 - { "4.11k", 0x1000, 0x3375b3bd, 2 | BRF_GRA }, // 8 - { "3.11h", 0x1000, 0x5655cc11, 2 | BRF_GRA }, // 9 - - { "2.11c", 0x0800, 0xd1352c31, 3 | BRF_GRA }, // 10 gfx2 - { "1.11a", 0x0800, 0xa7a2fdbd, 3 | BRF_GRA }, // 11 - - { "prom.v6", 0x0020, 0xb3fc1505, 6 | BRF_GRA }, // 12 proms - { "prom.u6", 0x0020, 0x26aada9e, 6 | BRF_GRA }, // 13 - { "prom.t6", 0x0020, 0x676b3166, 6 | BRF_GRA }, // 14 - - { "14.5s", 0x1000, 0x5f0bcdfb, 7 | BRF_GRA }, // 15 samples - { "13.5p", 0x1000, 0x9003ffbd, 7 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(ckongpt2) -STD_ROM_FN(ckongpt2) - -struct BurnDriverD BurnDrvCkongpt2 = { - "ckongpt2", NULL, NULL, NULL, "1981", - "Crazy Kong Part II (set 1)\0", NULL, "Falcon", "Miscellaneous", - NULL, NULL, NULL, NULL, - /*BDF_GAME_WORKING*/ 0 | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, ckongpt2RomInfo, ckongpt2RomName, NULL, NULL, CkongInputInfo, CkongDIPInfo, - ckongInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 224, 256, 3, 4 -}; - - -// Crazy Kong (not working but needed as parent) - -static struct BurnRomInfo ckongRomDesc[] = { - { "falcon7", 0x1000, 0x2171cac3, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "falcon8", 0x1000, 0x88b83ff7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "falcon9", 0x1000, 0xcff2af47, 1 | BRF_PRG | BRF_ESS }, // 2 - { "falcon10", 0x1000, 0x6b2ecf23, 1 | BRF_PRG | BRF_ESS }, // 3 - { "falcon11", 0x1000, 0x327dcadf, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "falcon6", 0x1000, 0xa8916dc8, 2 | BRF_GRA }, // 6 gfx1 - { "falcon5", 0x1000, 0xcd3b5dde, 2 | BRF_GRA }, // 7 - { "falcon4", 0x1000, 0xb62a0367, 2 | BRF_GRA }, // 8 - { "falcon3", 0x1000, 0x61122c5e, 2 | BRF_GRA }, // 9 - - { "falcon2", 0x0800, 0xf67c80f1, 3 | BRF_GRA }, // 10 gfx2 - { "falcon1", 0x0800, 0x80eb517d, 3 | BRF_GRA }, // 11 - - { "ck6v.bin", 0x0020, 0x751c3325, 6 | BRF_GRA }, // 12 proms - { "ck6u.bin", 0x0020, 0xab1940fa, 6 | BRF_GRA }, // 13 - { "ck6t.bin", 0x0020, 0xb4e827a5, 6 | BRF_GRA }, // 14 - - { "falcon13", 0x1000, 0x5f0bcdfb, 7 | BRF_GRA }, // 15 samples - { "falcon12", 0x1000, 0x9003ffbd, 7 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(ckong) -STD_ROM_FN(ckong) - -struct BurnDriver BurnDrvCkong = { - "ckong", NULL, NULL, NULL, "1981", - "Crazy Kong\0", NULL, "Kyoei / Falcon", "Miscellaneous", - NULL, NULL, NULL, NULL, - /*BDF_GAME_WORKING*/ 0 | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, ckongRomInfo, ckongRomName, NULL, NULL, CkongInputInfo, CkongDIPInfo, - ckongInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 224, 256, 3, 4 -}; - - - -void cclimbrj_decode() -{ - static const INT8 convtable[8][16] = - { - { 0x41,0x54,0x51,0x14,0x05,0x10,0x01,0x55,0x44,0x11,0x00,0x50,0x15,0x40,0x04,0x45 }, - { 0x50,0x11,0x40,0x55,0x51,0x14,0x45,0x04,0x54,0x15,0x10,0x05,0x44,0x01,0x00,0x41 }, - { 0x44,0x11,0x00,0x50,0x41,0x54,0x04,0x14,0x15,0x40,0x51,0x55,0x05,0x10,0x01,0x45 }, - { 0x10,0x50,0x54,0x55,0x01,0x44,0x40,0x04,0x14,0x11,0x00,0x41,0x45,0x15,0x51,0x05 }, - { 0x14,0x41,0x01,0x44,0x04,0x50,0x51,0x45,0x11,0x40,0x54,0x15,0x10,0x00,0x55,0x05 }, - { 0x01,0x05,0x41,0x45,0x54,0x50,0x55,0x10,0x11,0x15,0x51,0x14,0x44,0x40,0x04,0x00 }, - { 0x05,0x55,0x00,0x50,0x11,0x40,0x54,0x14,0x45,0x51,0x10,0x04,0x44,0x01,0x41,0x15 }, - { 0x55,0x50,0x15,0x10,0x01,0x04,0x41,0x44,0x45,0x40,0x05,0x00,0x11,0x14,0x51,0x54 }, - }; - - cclimber_decode(convtable); -} - -static void sega_decode(const UINT8 convtable[32][4]) -{ - INT32 A; - - INT32 length = 0x10000; - INT32 cryptlen = 0x8000; - UINT8 *rom = DrvZ80ROM; - UINT8 *decrypted = DrvZ80OPS; - - for (A = 0x0000;A < cryptlen;A++) - { - INT32 xorval = 0; - - UINT8 src = rom[A]; - - /* pick the translation table from bits 0, 4, 8 and 12 of the address */ - INT32 row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2) + (((A >> 12) & 1) << 3); - - /* pick the offset in the table from bits 3 and 5 of the source data */ - INT32 col = ((src >> 3) & 1) + (((src >> 5) & 1) << 1); - /* the bottom half of the translation table is the mirror image of the top */ - if (src & 0x80) - { - col = 3 - col; - xorval = 0xa8; - } - - /* decode the opcodes */ - decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval); - - /* decode the data */ - rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval); - - if (convtable[2*row][col] == 0xff) /* table incomplete! (for development) */ - decrypted[A] = 0xee; - if (convtable[2*row+1][col] == 0xff) /* table incomplete! (for development) */ - rom[A] = 0xee; - } - - /* this is a kludge to catch anyone who has code that crosses the encrypted/ */ - /* decrypted boundary. ssanchan does it */ - if (length > 0x8000) - { - INT32 bytes = 0x4000; - memcpy(&decrypted[0x8000], &rom[0x8000], bytes); - } -} - - -static INT32 yamatoInit() -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...0 */ - { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...0...1...1 */ - { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...0...1...0...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...0...1 */ - { 0x20,0xa0,0x28,0xa8 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...1...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */ - { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...0...0...0 */ - { 0x20,0xa0,0x28,0xa8 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */ - { 0xa0,0x20,0x80,0x00 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...0 */ - { 0x28,0x20,0xa8,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...1 */ - { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...0 */ - { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...1 */ - { 0xa0,0x20,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...1...1...1...0 */ - { 0x20,0xa0,0x28,0xa8 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */ - }; - - game_select = 5; - uses_sub = 1; - - INT32 rc = DrvInit(); - if (rc == 0) { - memmove(DrvZ80ROM+0x7000, DrvZ80ROM+0x6000, 0x1000); - memset(DrvZ80ROM+0x6000, 0, 0x1000); - sega_decode(convtable); - - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80OPS, DrvZ80ROM); - ZetMapMemory(DrvZ80ROM+0x7000, 0x7000, 0x7fff, MAP_ROM); - ZetMapArea(0x7000, 0x7fff, 2, DrvZ80OPS+0x7000, DrvZ80ROM+0x7000); - - ZetClose(); - } - - return rc; -} - -// Yamato (US) - -static struct BurnRomInfo yamatoRomDesc[] = { - { "2.5de", 0x2000, 0x20895096, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "3.5f", 0x2000, 0x57a696f9, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4.5jh", 0x2000, 0x59a468e8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "11.5a", 0x1000, 0x35987485, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "1.5v", 0x0800, 0x3aad9e3c, 7 | BRF_PRG | BRF_ESS }, // 4 audiocpu - - { "10.11k", 0x2000, 0x161121f5, 2 | BRF_GRA }, // 5 gfx1 - { "9.11h", 0x2000, 0x56e84cc4, 2 | BRF_GRA }, // 6 - - { "8.11c", 0x1000, 0x28024d9a, 3 | BRF_GRA }, // 7 gfx2 - { "7.11a", 0x1000, 0x4a179790, 3 | BRF_GRA }, // 8 - - { "5.5lm", 0x1000, 0x7761ad24, 4 | BRF_GRA }, // 9 user1 - { "6.5n", 0x1000, 0xda48444c, 4 | BRF_GRA }, // 10 - - { "1.bpr", 0x0020, 0xef2053ab, 6 | BRF_GRA }, // 11 proms - { "2.bpr", 0x0020, 0x2281d39f, 6 | BRF_GRA }, // 12 - { "3.bpr", 0x0020, 0x9e6341e3, 6 | BRF_GRA }, // 13 - { "4.bpr", 0x0020, 0x1c97dc0b, 6 | BRF_GRA }, // 14 - { "5.bpr", 0x0020, 0xedd6c05f, 6 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(yamato) -STD_ROM_FN(yamato) - -struct BurnDriver BurnDrvYamato = { - "yamato", NULL, NULL, NULL, "1983", - "Yamato (US)\0", NULL, "Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, yamatoRomInfo, yamatoRomName, NULL, NULL, YamatoInputInfo, YamatoDIPInfo, - yamatoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Yamato (World?) - -static struct BurnRomInfo yamato2RomDesc[] = { - { "2-2.5de",0x2000, 0x93da1d52, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "3-2.5f", 0x2000, 0x31e73821, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4-2.5jh",0x2000, 0xfd7bcfc3, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "1.5v", 0x0800, 0x3aad9e3c, 7 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "10.11k", 0x2000, 0x161121f5, 2 | BRF_GRA }, // 4 gfx1 - { "9.11h", 0x2000, 0x56e84cc4, 2 | BRF_GRA }, // 5 - - { "8.11c", 0x1000, 0x28024d9a, 3 | BRF_GRA }, // 6 gfx2 - { "7.11a", 0x1000, 0x4a179790, 3 | BRF_GRA }, // 7 - - { "5.5lm", 0x1000, 0x7761ad24, 4 | BRF_GRA }, // 8 user1 - { "6.5n", 0x1000, 0xda48444c, 4 | BRF_GRA }, // 9 - - { "1.bpr", 0x0020, 0xef2053ab, 6 | BRF_GRA }, // 10 proms - { "2.bpr", 0x0020, 0x2281d39f, 6 | BRF_GRA }, // 11 - { "3.bpr", 0x0020, 0x9e6341e3, 6 | BRF_GRA }, // 12 - { "4.bpr", 0x0020, 0x1c97dc0b, 6 | BRF_GRA }, // 13 - { "5.bpr", 0x0020, 0xedd6c05f, 6 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(yamato2) -STD_ROM_FN(yamato2) - -struct BurnDriver BurnDrvYamato2 = { - "yamato2", "yamato", NULL, NULL, "1983", - "Yamato (World?)\0", NULL, "Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, yamato2RomInfo, yamato2RomName, NULL, NULL, YamatoInputInfo, YamatoDIPInfo, - yamatoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - -static INT32 guzzlerInit() -{ - game_select = 6; - uses_sub = 1; - - INT32 rc = DrvInit(); - - if (rc == 0) { - //save for later maybe - } - - return rc; -} - -// Guzzler - -static struct BurnRomInfo guzzlerRomDesc[] = { - { "guzz-01.bin", 0x2000, 0x58aaa1e9, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "guzz-02.bin", 0x2000, 0xf80ceb17, 1 | BRF_PRG | BRF_ESS }, // 1 - { "guzz-03.bin", 0x2000, 0xe63c65a2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "guzz-04.bin", 0x2000, 0x45be42f5, 1 | BRF_PRG | BRF_ESS }, // 3 - { "guzz-16.bin", 0x2000, 0x61ee00b7, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "guzz-12.bin", 0x1000, 0xf3754d9e, 7 | BRF_PRG | BRF_ESS }, // 5 audiocpu - - { "guzz-13.bin", 0x1000, 0xafc464e2, 2 | BRF_GRA }, // 6 gfx1 - { "guzz-14.bin", 0x1000, 0xacbdfe1f, 2 | BRF_GRA }, // 7 - { "guzz-15.bin", 0x1000, 0x66978c05, 2 | BRF_GRA }, // 8 - - { "guzz-11.bin", 0x1000, 0xec2e9d86, 3 | BRF_GRA }, // 9 gfx2 - { "guzz-10.bin", 0x1000, 0xbd3f0bf7, 3 | BRF_GRA }, // 10 - { "guzz-09.bin", 0x1000, 0x18927579, 3 | BRF_GRA }, // 11 - - { "guzzler.003", 0x0100, 0xf86930c1, 6 | BRF_GRA }, // 12 proms - { "guzzler.002", 0x0100, 0xb566ea9e, 6 | BRF_GRA }, // 13 - { "guzzler.001", 0x0020, 0x69089495, 6 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(guzzler) -STD_ROM_FN(guzzler) - -struct BurnDriver BurnDrvGuzzler = { - "guzzler", NULL, NULL, NULL, "1983", - "Guzzler\0", NULL, "Tehkan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, guzzlerRomInfo, guzzlerRomName, NULL, NULL, GuzzlerInputInfo, GuzzlerDIPInfo, - guzzlerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - -// Swimmer (set 1) - -static struct BurnRomInfo swimmerRomDesc[] = { - { "sw1", 0x1000, 0xf12481e7, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "sw2", 0x1000, 0xa0b6fdd2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sw3", 0x1000, 0xec93d7de, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sw4", 0x1000, 0x0107927d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sw5", 0x1000, 0xebd8a92c, 1 | BRF_PRG | BRF_ESS }, // 4 - { "sw6", 0x1000, 0xf8539821, 1 | BRF_PRG | BRF_ESS }, // 5 - { "sw7", 0x1000, 0x37efb64e, 1 | BRF_PRG | BRF_ESS }, // 6 - { "sw8", 0x1000, 0x33d6001e, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "sw12.4k", 0x1000, 0x2eee9bcb, 7 | BRF_PRG | BRF_ESS }, // 8 audiocpu - - { "sw15.18k", 0x1000, 0x4f3608cb, 2 | BRF_GRA }, // 9 gfx1 - { "sw14.18l", 0x1000, 0x7181c8b4, 2 | BRF_GRA }, // 10 - { "sw13.18m", 0x1000, 0x2eb1af5c, 2 | BRF_GRA }, // 11 - - { "sw23.6c", 0x0800, 0x9ca67e24, 3 | BRF_GRA }, // 12 gfx2 - { "sw22.5c", 0x0800, 0x02c10992, 3 | BRF_GRA }, // 13 - { "sw21.4c", 0x0800, 0x7f4993c1, 3 | BRF_GRA }, // 14 - - { "24s10.13b", 0x0100, 0x8e35b97d, 6 | BRF_GRA }, // 15 proms - { "24s10.13a", 0x0100, 0xc5f24909, 6 | BRF_GRA }, // 16 - { "18s030.12c", 0x0020, 0x3b2deb3a, 6 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(swimmer) -STD_ROM_FN(swimmer) - -struct BurnDriver BurnDrvSwimmer = { - "swimmer", NULL, NULL, NULL, "1982", - "Swimmer (set 1)\0", NULL, "Tehkan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, swimmerRomInfo, swimmerRomName, NULL, NULL, SwimmerInputInfo, SwimmerDIPInfo, - guzzlerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - -static INT32 rpatrolInit() -{ - game_select = 1; - uses_sub = 0; - gfx0_cont800 = 1; - - INT32 rc = DrvInit(); - - if (rc == 0) { // decryption - for (INT32 i = 0x0000; i < 0x5000; i++) { - DrvZ80ROM[i] = DrvZ80ROM[i] ^ 0x79; - i++; - DrvZ80ROM[i] = DrvZ80ROM[i] ^ 0x5b; - } - } - - return rc; -} - -static INT32 rpatrolbInit() -{ - game_select = 1; - uses_sub = 0; - - INT32 rc = DrvInit(); - - return rc; -} - -static INT32 silvlandInit() -{ - game_select = 1; - uses_sub = 0; - silvland = 1; - - INT32 rc = DrvInit(); - - return rc; -} - -// River Patrol (Orca) - -static struct BurnRomInfo rpatrolRomDesc[] = { - { "1.1h", 0x1000, 0x065197f0, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "2.1f", 0x1000, 0x3614b820, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.1d", 0x1000, 0xba428bbf, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.1c", 0x1000, 0x41497a94, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.1a", 0x1000, 0xe20ee7e7, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "6.6l.2732", 0x1000, 0xb38d8aca, 2 | BRF_GRA }, // 5 gfx1 - { "7.6p.2732", 0x1000, 0xbc2bddf9, 2 | BRF_GRA }, // 6 - - { "9.2t", 0x0800, 0xd373fc48, 3 | BRF_GRA }, // 7 gfx2 - { "8.2s", 0x0800, 0x59747c31, 3 | BRF_GRA }, // 8 - - { "bprom1.9n", 0x0020, 0xf9a2383b, 6 | BRF_GRA }, // 9 proms - { "bprom2.9p", 0x0020, 0x1743bd26, 6 | BRF_GRA }, // 10 - { "bprom3.9c", 0x0020, 0xee03bc96, 6 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(rpatrol) -STD_ROM_FN(rpatrol) - -struct BurnDriver BurnDrvRpatrol = { - "rpatrol", NULL, NULL, NULL, "1981", - "River Patrol (Orca)\0", NULL, "Orca", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, rpatrolRomInfo, rpatrolRomName, NULL, NULL, RpatrolInputInfo, RpatrolDIPInfo, - rpatrolInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// River Patrol (bootleg) - -static struct BurnRomInfo rpatrolbRomDesc[] = { - { "rp1.4l", 0x1000, 0xbfd7ae7a, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "rp2.4j", 0x1000, 0x03f53340, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rp3.4f", 0x1000, 0x8fa300df, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rp4.4e", 0x1000, 0x74a8f1f4, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rp5.4c", 0x1000, 0xd7ef6c87, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "rp6.6n", 0x0800, 0x19f18e9e, 2 | BRF_GRA }, // 5 gfx1 - { "rp7.6l", 0x0800, 0x07f2070d, 2 | BRF_GRA }, // 6 - { "rp8.6k", 0x0800, 0x008738c7, 2 | BRF_GRA }, // 7 - { "rp9.6h", 0x0800, 0xea5aafca, 2 | BRF_GRA }, // 8 - - { "rp11.6c", 0x0800, 0x065651a5, 3 | BRF_GRA }, // 9 gfx2 - { "rp10.6a", 0x0800, 0x59747c31, 3 | BRF_GRA }, // 10 - - { "bprom1.9n", 0x0020, 0xf9a2383b, 6 | BRF_GRA }, // 11 proms - { "bprom2.9p", 0x0020, 0x1743bd26, 6 | BRF_GRA }, // 12 - { "bprom3.9c", 0x0020, 0xee03bc96, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(rpatrolb) -STD_ROM_FN(rpatrolb) - -struct BurnDriver BurnDrvRpatrolb = { - "rpatrolb", "rpatrol", NULL, NULL, "1981", - "River Patrol (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, rpatrolbRomInfo, rpatrolbRomName, NULL, NULL, RpatrolInputInfo, RpatrolDIPInfo, - rpatrolbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Silver Land - -static struct BurnRomInfo silvlandRomDesc[] = { - { "7.2r", 0x1000, 0x57e6be62, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "8.1n", 0x1000, 0xbbb2b287, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rp3.4f", 0x1000, 0x8fa300df, 1 | BRF_PRG | BRF_ESS }, // 2 - { "10.2n", 0x1000, 0x5536a65d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "11.1r", 0x1000, 0x6f23f66f, 1 | BRF_PRG | BRF_ESS }, // 4 - { "12.2k", 0x1000, 0x26f1537c, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "6.6n", 0x0800, 0xaffb804f, 2 | BRF_GRA }, // 6 gfx1 - { "5.6l", 0x0800, 0xad4642e5, 2 | BRF_GRA }, // 7 - { "4.6k", 0x0800, 0xe487579d, 2 | BRF_GRA }, // 8 - { "3.6h", 0x0800, 0x59125a1a, 2 | BRF_GRA }, // 9 - - { "2.6c", 0x0800, 0xc8d32b8e, 3 | BRF_GRA }, // 10 gfx2 - { "1.6a", 0x0800, 0xee333daf, 3 | BRF_GRA }, // 11 - - { "mb7051.1v", 0x0020, 0x1d2343b1, 6 | BRF_GRA }, // 12 proms - { "mb7051.1u", 0x0020, 0xc174753c, 6 | BRF_GRA }, // 13 - { "mb7051.1t", 0x0020, 0x04a1be01, 6 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(silvland) -STD_ROM_FN(silvland) - -struct BurnDriver BurnDrvSilvland = { - "silvland", "rpatrol", NULL, NULL, "1981", - "Silver Land\0", NULL, "Falcon", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, silvlandRomInfo, silvlandRomName, NULL, NULL, RpatrolInputInfo, RpatrolDIPInfo, - silvlandInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_cheekyms.cpp b/jan/src/burn/drv/pre90s/d_cheekyms.cpp deleted file mode 100644 index 8a611bf44..000000000 --- a/jan/src/burn/drv/pre90s/d_cheekyms.cpp +++ /dev/null @@ -1,554 +0,0 @@ -// FB Alpha Mr. Do! driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "dac.h" -#define USE_SAMPLE_HACK // allow use of sampled SFX. - -#ifdef USE_SAMPLE_HACK -#include "samples.h" -#endif - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; - -static UINT8 *DrvROM; -static UINT8 *DrvRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSpriteRAM; -static UINT8 *Gfx0; -static UINT8 *Gfx1; -static UINT8 *Gfx2; -static UINT8 *Prom; -static UINT32 *Palette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvReset; -static UINT8 DrvDip[2]; - -static INT32 palettebnk, scrolly, flip; -static INT32 prevcoin; -static INT32 irqmask; - -static UINT32 bHasSamples = 0; - -static struct BurnInputInfo CheekymsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 6, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, -}; - -STDINPUTINFO(Cheekyms) - - -static struct BurnDIPInfo CheekymsDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x75, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0a, 0x01, 0x03, 0x00, "2" }, - {0x0a, 0x01, 0x03, 0x01, "3" }, - {0x0a, 0x01, 0x03, 0x02, "4" }, - {0x0a, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 3, "Coinage" }, - {0x0a, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x0c, 0x04, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x0c, 0x00, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0a, 0x01, 0x10, 0x10, "Upright" }, - {0x0a, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0a, 0x01, 0x20, 0x00, "Off" }, - {0x0a, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0a, 0x01, 0xc0, 0x40, "3000" }, - {0x0a, 0x01, 0xc0, 0x80, "4500" }, - {0x0a, 0x01, 0xc0, 0xc0, "6000" }, - {0x0a, 0x01, 0xc0, 0x00, "None" }, -}; - -STDDIPINFO(Cheekyms) - -static void __fastcall port_write(UINT16 port, UINT8 data) -{ - static UINT8 lastdata = 0; - - port &= 0xff; - - if (port >= 0x20 && port <= 0x3f) { // sprite ram - DrvSpriteRAM[port - 0x20] = data; - return; - } - - switch (port) - { - case 0x40: - if (data != lastdata) - { - //if (data != 0x80 && data != 0x00) - // bprintf(0, _T("%X,"), data & ~0x80); - - if (data & 0x02) // short squeek / mouse counter - BurnSamplePlay(0); - if (data & 0x04) // squeak - BurnSamplePlay(4); - if (data & 0x10) // dead. - BurnSamplePlay(0); - if (data & 0x20) // - BurnSamplePlay(3); - if (data & 0x30) // dead. - BurnSamplePlay(2); - if (data & 0x40) // - BurnSamplePlay(1); - } - lastdata = data; - DACWrite(0, (data ? 0x80 : 0)); - return; - - case 0x80: - palettebnk = (data >> 2) & 0x10; - scrolly = ((data >> 3) & 0x07); - flip = data & 0x80; - irqmask = data & 0x04; - return; - } -} - -static UINT8 __fastcall port_read(UINT16 port) -{ - UINT8 ret = 0xff; - - switch (port & 0xff) - { - case 0x00: - return DrvDip[0]; - - case 0x01: - for (INT32 i = 0; i < 8; i++) ret ^= DrvJoy1[i] << i; - return ret; - } - - return 0; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (2500000.000 / (nBurnFPS / 100.000)))); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - palettebnk = scrolly = flip = 0; - prevcoin = 0; - - ZetOpen(0); - ZetReset(); - ZetClose(); - DACReset(); - -#ifdef USE_SAMPLE_HACK - BurnSampleReset(); -#endif - - HiscoreReset(); - - return 0; -} - -static void palette_init() -{ - const UINT8 *color_prom = Prom; - int i, j, bit, r, g, b; - - for (i = 0; i < 6; i++) - { - for (j = 0; j < 0x20; j++) - { - /* red component */ - bit = (color_prom[0x20 * (i / 2) + j] >> ((4 * (i & 1)) + 0)) & 0x01; - r = 0xff * bit; - /* green component */ - bit = (color_prom[0x20 * (i / 2) + j] >> ((4 * (i & 1)) + 1)) & 0x01; - g = 0xff * bit; - /* blue component */ - bit = (color_prom[0x20 * (i / 2) + j] >> ((4 * (i & 1)) + 2)) & 0x01; - b = 0xff * bit; - - Palette[(i * 0x20) + j] = BurnHighCol(r, g, b, 0); - } - } -} - -static void gfx_decode() -{ - static INT32 CharPlane[2] = { 0, RGN_FRAC(0x1000, 1, 2) }; - static INT32 CharXOffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - static INT32 CharYOffs[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }; - - static INT32 SpriPlane[2] = { RGN_FRAC(0x1000, 1, 2), 0 }; - static INT32 SpriXOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; - static INT32 SpriYOffs[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - if (!tmp) return; - - memcpy (tmp, Gfx0, 0x1000); - - GfxDecode(0x100, 2, 8, 8, CharPlane, CharXOffs, CharYOffs, 0x040, tmp, Gfx0); - - memcpy (tmp, Gfx1, 0x1000); - - GfxDecode(0x040, 2, 16, 16, SpriPlane, SpriXOffs, SpriYOffs, 0x100, tmp, Gfx1); - - BurnFree (tmp); -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvROM = Next; Next += 0x10000; - - Gfx0 = Next; Next += 0x08000; - Gfx1 = Next; Next += 0x08000; - Gfx2 = Next; Next += 0x08000; - - Prom = Next; Next += 0x00080; - - Palette = (UINT32 *)Next; Next += 0x00140 * sizeof(UINT32); - - AllRam = Next; - - DrvRAM = Next; Next += 0x01000; - DrvVidRAM = Next; Next += 0x00800; - DrvSpriteRAM = Next; Next += 0x00100; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if(BurnLoadRom(DrvROM + 0x0000, 0, 1)) return 1; - if(BurnLoadRom(DrvROM + 0x0800, 1, 1)) return 1; - if(BurnLoadRom(DrvROM + 0x1000, 2, 1)) return 1; - if(BurnLoadRom(DrvROM + 0x1800, 3, 1)) return 1; - - if(BurnLoadRom(Gfx0 + 0x0000, 4, 1)) return 1; - if(BurnLoadRom(Gfx0 + 0x0800, 5, 1)) return 1; - - if(BurnLoadRom(Gfx1 + 0x0000, 6, 1)) return 1; - if(BurnLoadRom(Gfx1 + 0x0800, 7, 1)) return 1; - - if(BurnLoadRom(Prom + 0x0000, 8, 1)) return 1; - if(BurnLoadRom(Prom + 0x0020, 9, 1)) return 1; - if(BurnLoadRom(Prom + 0x0040, 10, 1)) return 1; - - palette_init(); - gfx_decode(); - } - - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(port_read); - ZetSetOutHandler(port_write); - ZetMapMemory(DrvROM, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvRAM, 0x3000, 0x33ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x3800, 0x3bff, MAP_RAM); - ZetClose(); - - DACInit(0, 0, 0, DrvSyncDAC); - DACSetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - -#ifdef USE_SAMPLE_HACK - BurnUpdateProgress(0.0, _T("Loading samples..."), 0); - bBurnSampleTrimSampleEnd = 1; - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.40, BURN_SND_ROUTE_BOTH); - bHasSamples = BurnSampleGetStatus(0) != -1; - - if (!bHasSamples) { // Samples not found - BurnSampleSetAllRoutesAllSamples(0.00, BURN_SND_ROUTE_BOTH); - } else { - bprintf(0, _T("Using Cheeky Mouse SFX samples!\n")); - } -#endif - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - DACExit(); -#ifdef USE_SAMPLE_HACK - BurnSampleExit(); -#endif - GenericTilesExit(); - - BurnFree(AllMem); - - flip = scrolly = palettebnk = 0; - - return 0; -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x20; offs += 4) - { - INT32 x, y, code, color; - UINT8 poffset = 0x10; - - if ((DrvSpriteRAM[offs + 3] & 0x08) == 0x00) continue; - - x = 256 - DrvSpriteRAM[offs + 2]; - y = DrvSpriteRAM[offs + 1] - 32; - code = (~DrvSpriteRAM[offs + 0] & 0x0f) << 1; - color = (~DrvSpriteRAM[offs + 3] & 0x07); - - if (x < 0 || y < -7 || x >= nScreenWidth || y >= nScreenHeight) continue; - - if (DrvSpriteRAM[offs + 0] & 0x80) - { - if (!flip) - code++; - - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, 2, 0, poffset, Gfx1); - } - else - { - if (DrvSpriteRAM[offs + 0] & 0x02) - { - Render16x16Tile_Mask_Clip(pTransDraw, code | 0x20, x, y, color, 2, 0, poffset, Gfx1); - Render16x16Tile_Mask_Clip(pTransDraw, code | 0x21, x + 0x10, y, color, 2, 0, poffset, Gfx1); - } - else - { - Render16x16Tile_Mask_Clip(pTransDraw, code | 0x20, x, y, color, 2, 0, poffset, Gfx1); - Render16x16Tile_Mask_Clip(pTransDraw, code | 0x21, x, y + 0x10, color, 2, 0, poffset, Gfx1); - } - } - } -} - -static void draw_tiles() -{ - for (INT32 offs = 0x3ff; offs >= 0; offs--) { - INT32 sx, sy, man_area; - - sx = offs % 32; - sy = offs / 32; - - if (flip) - { - man_area = ((sy >= 5) && (sy <= 25) && (sx >= 8) && (sx <= 12)); - } - else - { - man_area = ((sy >= 6) && (sy <= 26) && (sx >= 8) && (sx <= 12)); - } - - if (flip) { - sx = 31 - sx; - sy = 31 - sy; - } - - INT32 code = DrvVidRAM[offs]; - INT32 color = palettebnk; - - if (sx >= 0x1e) { - if (sy < 0x0c) - color = 0x15; - else if (sy < 0x14) - color = 0x16; - else - color = 0x14; - } - else - { - if ((sy == 0x04) || (sy == 0x1b)) - color = palettebnk | 0x0c; - else - color = palettebnk | (sx >> 1); - } - - sx *= 8; - sy = (sy * 8) - (man_area ? scrolly : 0); - sy -= 32; //offset - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, Gfx0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - palette_init(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 1) draw_tiles(); - - BurnTransferCopy(Palette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal = 2500000 / 60; - - ZetNewFrame(); - ZetOpen(0); - - if ((DrvJoy2[0]) && (prevcoin != DrvJoy2[0])) { - ZetNmi(); - } - prevcoin = DrvJoy2[0] & 1; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetRun(nCyclesTotal / nInterleave); - - if ((i == nInterleave-1) && irqmask) - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - if (pBurnSoundOut) { - DACUpdate(pBurnSoundOut, nBurnSoundLen); -#ifdef USE_SAMPLE_HACK - if(bHasSamples) - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); -#endif - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029736; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - DACScan(nAction, pnMin); - - SCAN_VAR(flip); - SCAN_VAR(palettebnk); - SCAN_VAR(scrolly); - SCAN_VAR(irqmask); - } - - return 0; -} - -static struct BurnSampleInfo CheekymsSampleDesc[] = { -#ifdef USE_SAMPLE_HACK -#if !defined ROM_VERIFY - { "squeek", SAMPLE_NOLOOP }, - { "hammer", SAMPLE_NOLOOP }, - { "squeekdead", SAMPLE_NOLOOP }, - { "two", SAMPLE_NOLOOP }, - { "squeek2", SAMPLE_NOLOOP }, -#endif -#endif - { "", 0 } -}; - -STD_SAMPLE_PICK(Cheekyms) -STD_SAMPLE_FN(Cheekyms) - -// Cheeky Mouse - -static struct BurnRomInfo cheekymsRomDesc[] = { - { "cm03.c5", 0x0800, 0x1ad0cb40, 1 }, // 0 maincpu - { "cm04.c6", 0x0800, 0x2238f607, 1 }, // 1 - { "cm05.c7", 0x0800, 0x4169eba8, 1 }, // 2 - { "cm06.c8", 0x0800, 0x7031660c, 1 }, // 3 - - { "cm01.c1", 0x0800, 0x26f73bd7, 2 }, // 4 gfx1 - { "cm02.c2", 0x0800, 0x885887c3, 2 }, // 5 - - { "cm07.n5", 0x0800, 0x2738c88d, 3 }, // 6 gfx2 - { "cm08.n6", 0x0800, 0xb3fbd4ac, 3 }, // 7 - - { "cm.m9", 0x0020, 0xdb9c59a5, 4 }, // 8 proms - { "cm.m8", 0x0020, 0x2386bc68, 4 }, // 9 - { "cm.p3", 0x0020, 0x6ac41516, 4 }, // 10 -}; - -STD_ROM_PICK(cheekyms) -STD_ROM_FN(cheekyms) - -struct BurnDriver BurnDrvCheekyms = { - "cheekyms", NULL, NULL, "cheekyms", "1980", - "Cheeky Mouse\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, cheekymsRomInfo, cheekymsRomName, CheekymsSampleInfo, CheekymsSampleName, CheekymsInputInfo, CheekymsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 192, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_chinagat.cpp b/jan/src/burn/drv/pre90s/d_chinagat.cpp deleted file mode 100644 index e7cc936e8..000000000 --- a/jan/src/burn/drv/pre90s/d_chinagat.cpp +++ /dev/null @@ -1,1097 +0,0 @@ -// FB Alpha China Gate driver module -// Based on MAME driver by Paul Hampson - -#include "tiles_generic.h" -#include "hd6309_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "burn_ym2203.h" -#include "msm6295.h" -#include "msm5205.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvSubROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 bankdata[2]; -static UINT8 soundlatch; -static INT32 flipscreen; -static UINT16 scrollx; -static UINT16 scrolly; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 is_bootleg = 0; -static INT32 vblank; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 2, "p2 coin" }, - {"Coin 3", BIT_DIGITAL, DrvJoy1 + 3, "p3 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x14, 0xff, 0xff, 0xbf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x07, 0x01, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x07, 0x02, "2 Coin 1 Credit" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coins 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x38, 0x08, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x38, 0x10, "2 Coin 1 Credit" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coins 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x14, 0x01, 0x40, 0x40, "Cocktail" }, -// {0x14, 0x01, 0x40, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x01, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x02, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Timer" }, - {0x15, 0x01, 0x30, 0x00, "50" }, - {0x15, 0x01, 0x30, 0x20, "55" }, - {0x15, 0x01, 0x30, 0x30, "60" }, - {0x15, 0x01, 0x30, 0x10, "70" }, - - {0 , 0xfe, 0 , 4, "Lifes" }, - {0x15, 0x01, 0xc0, 0x00, "1" }, - {0x15, 0x01, 0xc0, 0xc0, "2" }, - {0x15, 0x01, 0xc0, 0x80, "3" }, - {0x15, 0x01, 0xc0, 0x40, "4" }, -}; - -STDDIPINFO(Drv) - -static inline void palette_write(INT32 offset) -{ - INT32 r = DrvPalRAM[offset + 0x000] & 0xf; - INT32 g = DrvPalRAM[offset + 0x000] >> 4; - INT32 b = DrvPalRAM[offset + 0x200] & 0xf; - - DrvPalette[offset] = BurnHighCol(r+r*16, g+g*16, b+b*16,0); -} - -static void bankswitch1(INT32 data) -{ - bankdata[0] = data; - - HD6309MapMemory(DrvMainROM + (data & 0x07) * 0x4000, 0x4000, 0x7fff, MAP_ROM); -} - -static void chinagat_main_write(UINT16 address, UINT8 data) -{ - if (address >= 0x3000 && address <= 0x317f) { - DrvPalRAM[(address & 0x1ff) + 0x000] = data; - palette_write(address & 0x1ff); - return; - } - - if (address >= 0x3400 && address <= 0x357f) { - DrvPalRAM[(address & 0x1ff) + 0x200] = data; - palette_write(address & 0x1ff); - return; - } - - switch (address) - { - case 0x3e00: - soundlatch = data; - ZetSetIRQLine(0x20, CPU_IRQSTATUS_ACK); - return; - - case 0x3e01: // clear NMI - HD6309SetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0x3e02: // clear FIRQ - HD6309SetIRQLine(0x01, CPU_IRQSTATUS_NONE); - return; - - case 0x3e03: // clear IRQ - HD6309SetIRQLine(0x00, CPU_IRQSTATUS_NONE); - return; - - case 0x3e04: // set sub irq - HD6309Close(); - HD6309Open(1); - HD6309SetIRQLine(0x00, CPU_IRQSTATUS_AUTO); - HD6309Close(); - HD6309Open(0); - return; - - case 0x3e06: - scrolly = (scrolly & 0x0100) | data; - return; - - case 0x3e07: - scrollx = (scrollx & 0x0100) | data; - return; - - case 0x3f00: - scrolly = (scrolly & 0x00ff) | ((data & 0x02) << 7); - scrollx = (scrollx & 0x00ff) | ((data & 0x01) << 8); - flipscreen = ~data & 0x04; - return; - - case 0x3f01: - bankswitch1(data); - return; - } -} - -static UINT8 chinagat_main_read(UINT16 address) -{ - switch (address) - { - case 0x3f00: - return (DrvInputs[0] & 0x0e) | (vblank ? 0x01 : 0); - - case 0x3f01: - return DrvDips[0]; - - case 0x3f02: - return DrvDips[1]; - - case 0x3f03: - return DrvInputs[1]; - - case 0x3f04: - return DrvInputs[2]; - } - - return 0; -} - -static void bankswitch2(INT32 data) -{ - bankdata[1] = data; - - HD6309MapMemory(DrvSubROM + (data & 0x07) * 0x4000, 0x4000, 0x7fff, MAP_ROM); -} - -static void chinagat_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - bankswitch2(data); - return; - - case 0x2800: - return; // nop - } -} - -static void __fastcall chinagat_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8800: - BurnYM2151SelectRegister(data); - return; - - case 0x8801: - BurnYM2151WriteRegister(data); - return; - - case 0x9800: - if (BurnDrvGetFlags() & BDF_BOOTLEG) { - // bprintf (0, _T("Bootleg MCU Command: %2.2x\n"), data); - } else { - MSM6295Command(0, data); - } - return; - } -} - -static UINT8 __fastcall chinagat_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8800: - case 0x8801: - return BurnYM2151ReadStatus(); - - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static void __fastcall chinagat_bootleg2_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8800: - case 0x8801: - BurnYM2203Write(0, address & 1, data); - return; - - case 0x8804: - case 0x8805: - BurnYM2203Write(1, address & 1, data); - return; - } -} - -static UINT8 __fastcall chinagat_bootleg2_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8800: - case 0x8801: - return BurnYM2203Read(0, address & 1); - - case 0x8804: - case 0x8805: - return BurnYM2203Read(1, address & 1); - - case 0xa000: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - - -static void DrvYM2151IrqHandler(INT32 nStatus) -{ - ZetSetIRQLine(0, nStatus ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, nStatus ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3579545; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - HD6309Open(1); - HD6309Reset(); - HD6309Close(); - - ZetOpen(0); - ZetReset(); - - if (is_bootleg == 2) { - BurnYM2203Reset(); - } else { - MSM6295Reset(0); - BurnYM2151Reset(); - } - - ZetClose(); - - bankdata[0] = 0; - bankdata[1] = 0; - scrollx = 0; - scrolly = 0; - soundlatch = 0; - flipscreen = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x020000; - DrvSubROM = Next; Next += 0x020000; - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x080000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0180 * sizeof(UINT32); - - AllRam = Next; - - DrvShareRAM = Next; Next += 0x002000; - DrvBgRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000200; - DrvPalRAM = Next; Next += 0x000400; - DrvZ80RAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Plane0[4] = { STEP4(0,2) }; - INT32 XOffs0[8] = { 1, 0, 65, 64, 129, 128, 193, 192 }; - INT32 YOffs[16] = { STEP16(0,8) }; - - INT32 Plane1[4] = { 0x40000*8+0, 0x40000*8+4, 0, 4 }; - INT32 XOffs1[16] = { STEP4(3,-1), STEP4(128+3,-1), STEP4(256+3,-1), STEP4(384+3,-1) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x20000); - - GfxDecode(0x1000, 4, 8, 8, Plane0, XOffs0, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs1, YOffs, 0x200, tmp, DrvGfxROM2); - - BurnFree(tmp); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvSubROM + 0x00000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x50000, 11, 1)) return 1; - - if (BurnDrvGetFlags() & BDF_BOOTLEG) { - if (BurnLoadRom(DrvSndROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x10000, 13, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x20000, 14, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x30000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x80000, 18, 1)) return 1; // check for mcu - is_bootleg = DrvGfxROM1[0x80000] ? 1 : 2; - } else { - if (BurnLoadRom(DrvSndROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x20000, 13, 1)) return 1; - } - - DrvGfxDecode(); - } - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvShareRAM, 0x0000, 0x1fff, MAP_RAM); - HD6309MapMemory(DrvFgRAM, 0x2000, 0x27ff, MAP_RAM); - HD6309MapMemory(DrvBgRAM, 0x2800, 0x2fff, MAP_RAM); - HD6309MapMemory(DrvPalRAM, 0x3000, 0x31ff, MAP_ROM); - HD6309MapMemory(DrvPalRAM + 0x00200, 0x3400, 0x35ff, MAP_ROM); - HD6309MapMemory(DrvSprRAM, 0x3800, 0x39ff, MAP_RAM); - HD6309MapMemory(DrvMainROM + 0x00000, 0x4000, 0x7fff, MAP_ROM); - HD6309MapMemory(DrvMainROM + 0x18000, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(chinagat_main_write); - HD6309SetReadHandler(chinagat_main_read); - HD6309Close(); - - HD6309Init(1); - HD6309Open(1); - HD6309MapMemory(DrvShareRAM, 0x0000, 0x1fff, MAP_RAM); - HD6309MapMemory(DrvSubROM + 0x00000, 0x4000, 0x7fff, MAP_ROM); - HD6309MapMemory(DrvSubROM + 0x18000, 0x8000, 0xffff, MAP_ROM); - HD6309SetWriteHandler(chinagat_sub_write); - HD6309Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(chinagat_sound_write); - ZetSetReadHandler(chinagat_sound_read); - ZetClose(); - - if (is_bootleg == 2) { - ZetOpen(0); - ZetSetWriteHandler(chinagat_bootleg2_sound_write); - ZetSetReadHandler(chinagat_bootleg2_sound_read); - ZetClose(); - - BurnYM2203Init(2, 3579545, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3579545); - BurnYM2203SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.50, BURN_SND_ROUTE_BOTH); - } - else - { - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.80, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.80, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1065000 / 132, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - } - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - HD6309Exit(); - ZetExit(); - - if (is_bootleg == 2) { - BurnYM2203Exit(); - } else { - BurnYM2151Exit(); - MSM6295Exit(0); - } - - GenericTilesExit(); - - BurnFree(AllMem); - - is_bootleg = 0; - - return 0; -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 col = offs & 0x1f; - INT32 row = offs / 32; - INT32 ofst = (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5); - - INT32 sx = (col * 16) - scrollx; - INT32 sy = ((row * 16) - scrolly) - 8; - if (sx < -15) sx += 512; - if (sy < -15) sy += 512; - - INT32 attr = DrvBgRAM[ofst * 2 + 0]; - INT32 code = DrvBgRAM[ofst * 2 + 1] + ((attr & 0x07) << 8); - INT32 color = (attr >> 3) & 0x07; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM2); - } - } - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = ((offs & 0x1f) * 8); - INT32 sy = ((offs / 0x20) * 8) - 8; - - INT32 attr = DrvFgRAM[offs * 2 + 0]; - INT32 code = DrvFgRAM[offs * 2 + 1] + ((attr & 0x0f) << 8); - INT32 color = attr >> 4; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x000, DrvGfxROM0); - } -} - -#define DRAW_SPRITE( order, sx, sy ) \ - if (flipy) { \ - if (flipx) { \ - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, which+order, sx, sy, color, 4, 0, 0x080, DrvGfxROM1); \ - } else { \ - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, which+order, sx, sy, color, 4, 0, 0x080, DrvGfxROM1); \ - } \ - } else { \ - if (flipx) { \ - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, which+order, sx, sy, color, 4, 0, 0x080, DrvGfxROM1); \ - } else { \ - Render16x16Tile_Mask_Clip(pTransDraw, which+order, sx, sy, color, 4, 0, 0x080, DrvGfxROM1); \ - } \ - } - -static void draw_sprites() -{ - for (INT32 i = 0; i < 0x180; i += 5) - { - INT32 attr = DrvSprRAM[i + 1]; - - if (attr & 0x80) - { - INT32 sx = 240 - DrvSprRAM[i + 4] + ((attr & 2) << 7); - INT32 sy = 232 - DrvSprRAM[i + 0] + ((attr & 1) << 8); - INT32 size = (attr & 0x30) >> 4; - INT32 flipx = attr & 8; - INT32 flipy = attr & 4; - INT32 dx = -16, dy = -16; - INT32 color = DrvSprRAM[i + 2] >> 4; - INT32 which = DrvSprRAM[i + 3] + ((DrvSprRAM[i + 2] & 0x0f) << 8); - - if ((sx < -7) && (sx > -16)) sx += 256; - if ((sy < -7) && (sy > -16)) sy += 256; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - 16 - sy; - flipx = !flipx; - flipy = !flipy; - dx = -dx; - dy = -dy; - } - - which &= ~size; - - switch (size) - { - case 0: // 1x1 - DRAW_SPRITE(0, sx, sy); - break; - - case 1: // 1x2 - DRAW_SPRITE(0, sx, sy + dy); - DRAW_SPRITE(1, sx, sy); - break; - - case 2: // 2x1 - DRAW_SPRITE(0, sx + dx, sy); - DRAW_SPRITE(2, sx, sy); - break; - - case 3: // 2x2 - DRAW_SPRITE(0, sx + dx, sy + dy); - DRAW_SPRITE(1, sx + dx, sy); - DRAW_SPRITE(2, sx, sy + dy); - DRAW_SPRITE(3, sx, sy); - break; - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x180; i++) { - palette_write(i); - } - DrvRecalc = 0; - } - - //BurnTransferClear(); - - if (nBurnLayer & 2) draw_bg_layer(); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static inline INT32 scanline_to_vcount(INT32 scanline) // ripped directly from MAME -{ - INT32 vcount = scanline + 8; - - if (vcount < 0x100) - return vcount; - else - return (vcount - 0x18) | 0x100; -} - -static void scanline_timer(INT32 param) -{ - int scanline = param; - int screen_height = 240; - int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1); - int vcount = scanline_to_vcount(scanline); - - if (vcount == 0xf8) { - HD6309SetIRQLine(0x20, CPU_IRQSTATUS_ACK); - vblank = 1; - } - - if (!(vcount_old & 8) && (vcount & 8)) - HD6309SetIRQLine(0x01, CPU_IRQSTATUS_ACK); -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[3] = { 1500000 * 4 / 60, 1500000 * 4 / 60, 3579545 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - HD6309NewFrame(); - ZetNewFrame(); - - ZetOpen(0); - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nCyclesTotal[0] / nInterleave; - - HD6309Open(0); - nCyclesDone[0] += HD6309Run(nSegment); - scanline_timer(i); - HD6309Close(); - - nSegment = nCyclesTotal[1] / nInterleave; - - HD6309Open(1); - nCyclesDone[1] += HD6309Run(nSegment); - HD6309Close(); - - nSegment = nCyclesTotal[2] / nInterleave; - nCyclesDone[2] += ZetRun(nSegment); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - } - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvBoot2Frame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 1500000 * 4 / 60, 1500000 * 4 / 60, 3579545 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - HD6309NewFrame(); - ZetNewFrame(); - - ZetOpen(0); - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nCyclesTotal[0] / nInterleave; - - HD6309Open(0); - nCyclesDone[0] += HD6309Run(nSegment); - scanline_timer(i); - HD6309Close(); - - nSegment = nCyclesTotal[1] / nInterleave; - - HD6309Open(1); - nCyclesDone[1] += HD6309Run(nSegment); - HD6309Close(); - - BurnTimerUpdate(i * (nCyclesTotal[2] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - HD6309Scan(nAction); - ZetScan(nAction); - - if (is_bootleg == 2) { - BurnYM2203Scan(nAction, pnMin); - } else { - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - } - - SCAN_VAR(bankdata[0]); - SCAN_VAR(bankdata[1]); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - } - - if (nAction & ACB_WRITE) - { - HD6309Open(0); - bankswitch1(bankdata[0]); - HD6309Close(); - - HD6309Open(1); - bankswitch2(bankdata[1]); - HD6309Close(); - } - - return 0; -} - - - -// China Gate (US) - -static struct BurnRomInfo chinagatRomDesc[] = { - { "cgate51.bin", 0x20000, 0x439a3b19, 0 | BRF_PRG | BRF_ESS }, // 0 HD6309 #0 Code - - { "23j4-0.48", 0x20000, 0x2914af38, 1 | BRF_PRG | BRF_ESS }, // 1 HD6309 #1 Code - - { "23j0-0.40", 0x08000, 0x9ffcadb6, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "cgate18.bin", 0x20000, 0x8d88d64d, 3 | BRF_GRA }, // 3 Foreground Tiles - - { "23j7-0.103", 0x20000, 0x2f445030, 4 | BRF_GRA }, // 4 Sprites - { "23j8-0.102", 0x20000, 0x237f725a, 4 | BRF_GRA }, // 5 - { "23j9-0.101", 0x20000, 0x8caf6097, 4 | BRF_GRA }, // 6 - { "23ja-0.100", 0x20000, 0xf678594f, 4 | BRF_GRA }, // 7 - - { "chinagat_a-13", 0x10000, 0xb745cac4, 5 | BRF_GRA }, // 8 Background Tiles - { "chinagat_a-12", 0x10000, 0x3c864299, 5 | BRF_GRA }, // 9 - { "chinagat_a-15", 0x10000, 0x2f268f37, 5 | BRF_GRA }, // 10 - { "chinagat_a-14", 0x10000, 0xaef814c8, 5 | BRF_GRA }, // 11 - - { "23j1-0.53", 0x20000, 0xf91f1001, 6 | BRF_SND }, // 12 MSM6295 Samples - { "23j2-0.52", 0x20000, 0x8b6f26e9, 6 | BRF_SND }, // 13 - - { "23jb-0.16", 0x00200, 0x46339529, 7 | BRF_OPT }, // 14 Proms (unused) - { "23j5-0.45", 0X00100, 0xfdb130a9, 7 | BRF_OPT }, // 15 -}; - -STD_ROM_PICK(chinagat) -STD_ROM_FN(chinagat) - -struct BurnDriver BurnDrvChinagat = { - "chinagat", NULL, NULL, NULL, "1988", - "China Gate (US)\0", NULL, "Technos Japan (Taito Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, chinagatRomInfo, chinagatRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 256, 240, 4, 3 -}; - - -// Sai Yu Gou Ma Roku (Japan) - -static struct BurnRomInfo saiyugouRomDesc[] = { - { "23j3-0.51", 0x20000, 0xaa8132a2, 0 | BRF_PRG | BRF_ESS }, // 0 HD6309 #0 Code - - { "23j4-0.48", 0x20000, 0x2914af38, 1 | BRF_PRG | BRF_ESS }, // 1 HD6309 #1 Code - - { "23j0-0.40", 0x08000, 0x9ffcadb6, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "23j6-0.18", 0x20000, 0x86d33df0, 3 | BRF_GRA }, // 3 Foreground Tiles - - { "23j7-0.103", 0x20000, 0x2f445030, 4 | BRF_GRA }, // 4 Sprites - { "23j8-0.102", 0x20000, 0x237f725a, 4 | BRF_GRA }, // 5 - { "23j9-0.101", 0x20000, 0x8caf6097, 4 | BRF_GRA }, // 6 - { "23ja-0.100", 0x20000, 0xf678594f, 4 | BRF_GRA }, // 7 - - { "saiyugou_a-13", 0x10000, 0xb745cac4, 5 | BRF_GRA }, // 8 Background Tiles set instead - { "saiyugou_a-12", 0x10000, 0x3c864299, 5 | BRF_GRA }, // 9 - { "saiyugou_a-15", 0x10000, 0x2f268f37, 5 | BRF_GRA }, // 10 - { "saiyugou_a-14", 0x10000, 0xaef814c8, 5 | BRF_GRA }, // 11 - - { "23j1-0.53", 0x20000, 0xf91f1001, 6 | BRF_SND }, // 12 MSM6295 Samples - { "23j2-0.52", 0x20000, 0x8b6f26e9, 6 | BRF_SND }, // 13 - - { "23jb-0.16", 0x00200, 0x46339529, 7 | BRF_OPT }, // 14 Proms (unused) - { "23j5-0.45", 0x00100, 0xfdb130a9, 7 | BRF_OPT }, // 15 -}; - -STD_ROM_PICK(saiyugou) -STD_ROM_FN(saiyugou) - -struct BurnDriver BurnDrvSaiyugou = { - "saiyugou", "chinagat", NULL, NULL, "1988", - "Sai Yu Gou Ma Roku (Japan)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, saiyugouRomInfo, saiyugouRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 256, 240, 4, 3 -}; - - -// Sai Yu Gou Ma Roku (Japan bootleg 1) - -static struct BurnRomInfo saiyugoub1RomDesc[] = { - { "23j3-0.51", 0x20000, 0xaa8132a2, 0 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "23j4-0.48", 0x20000, 0x2914af38, 1 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - - { "a-1.bin", 0x08000, 0x46e5a6d4, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "23j6-0.18", 0x20000, 0x86d33df0, 3 | BRF_GRA }, // 3 Foreground Tiles - - { "23j7-0.103", 0x20000, 0x2f445030, 4 | BRF_GRA }, // 4 Sprites - { "23j8-0.102", 0x20000, 0x237f725a, 4 | BRF_GRA }, // 5 - { "23j9-0.101", 0x20000, 0x8caf6097, 4 | BRF_GRA }, // 6 - { "23ja-0.100", 0x20000, 0xf678594f, 4 | BRF_GRA }, // 7 - - { "a-13", 0x10000, 0xb745cac4, 5 | BRF_GRA }, // 8 gfx3 - { "a-12", 0x10000, 0x3c864299, 5 | BRF_GRA }, // 9 - { "a-15", 0x10000, 0x2f268f37, 5 | BRF_GRA }, // 10 - { "a-14", 0x10000, 0xaef814c8, 5 | BRF_GRA }, // 11 - - { "a-6.bin", 0x10000, 0x4da4e935, 6 | BRF_SND }, // 12 MSM5205 Samples - { "a-7.bin", 0x10000, 0x6284c254, 6 | BRF_SND }, // 13 - { "a-10.bin", 0x10000, 0xb728ec6e, 6 | BRF_SND }, // 14 - { "a-11.bin", 0x10000, 0xa50d1895, 6 | BRF_SND }, // 15 - - { "23jb-0.16", 0x00200, 0x46339529, 7 | BRF_OPT }, // 16 Proms (unused) - { "23j5-0.45", 0x00100, 0xfdb130a9, 7 | BRF_OPT }, // 17 - - { "mcu8748.bin", 0x00400, 0x6d28d6c5, 8 | BRF_PRG | BRF_ESS }, // 18 I8748 Code -}; - -STD_ROM_PICK(saiyugoub1) -STD_ROM_FN(saiyugoub1) - -struct BurnDriver BurnDrvSaiyugoub1 = { - "saiyugoub1", "chinagat", NULL, NULL, "1988", - "Sai Yu Gou Ma Roku (Japan bootleg 1)\0", "missing some sounds", "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, saiyugoub1RomInfo, saiyugoub1RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 256, 240, 4, 3 -}; - - -// Sai Yu Gou Ma Roku (Japan bootleg 2) - -static struct BurnRomInfo saiyugoub2RomDesc[] = { - { "23j3-0.51", 0x20000, 0xaa8132a2, 0 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "23j4-0.48", 0x20000, 0x2914af38, 1 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - - { "sai-alt1.bin", 0x08000, 0x8d397a8d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "23j6-0.18", 0x20000, 0x86d33df0, 3 | BRF_GRA }, // 3 Foreground Tiles - - { "23j7-0.103", 0x20000, 0x2f445030, 4 | BRF_GRA }, // 4 Sprites - { "23j8-0.102", 0x20000, 0x237f725a, 4 | BRF_GRA }, // 5 - { "23j9-0.101", 0x20000, 0x8caf6097, 4 | BRF_GRA }, // 6 - { "23ja-0.100", 0x20000, 0xf678594f, 4 | BRF_GRA }, // 7 - - { "a-13", 0x10000, 0xb745cac4, 5 | BRF_GRA }, // 8 gfx3 - { "a-12", 0x10000, 0x3c864299, 5 | BRF_GRA }, // 9 - { "a-15", 0x10000, 0x2f268f37, 5 | BRF_GRA }, // 10 - { "a-14", 0x10000, 0xaef814c8, 5 | BRF_GRA }, // 11 - - { "a-6.bin", 0x10000, 0x4da4e935, 6 | BRF_SND }, // 12 MSM5205 Samples - { "a-7.bin", 0x10000, 0x6284c254, 6 | BRF_SND }, // 13 - { "a-10.bin", 0x10000, 0xb728ec6e, 6 | BRF_SND }, // 14 - { "a-11.bin", 0x10000, 0xa50d1895, 6 | BRF_SND }, // 15 - - { "23jb-0.16", 0x00200, 0x46339529, 7 | BRF_OPT }, // 16 Proms (unused) - { "23j5-0.45", 0x00100, 0xfdb130a9, 7 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(saiyugoub2) -STD_ROM_FN(saiyugoub2) - -struct BurnDriver BurnDrvSaiyugoub2 = { - "saiyugoub2", "chinagat", NULL, NULL, "1988", - "Sai Yu Gou Ma Roku (Japan bootleg 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, saiyugoub2RomInfo, saiyugoub2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvBoot2Frame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_citycon.cpp b/jan/src/burn/drv/pre90s/d_citycon.cpp deleted file mode 100644 index cd7ab7ac1..000000000 --- a/jan/src/burn/drv/pre90s/d_citycon.cpp +++ /dev/null @@ -1,702 +0,0 @@ -// FB Alpha City Connection driver module -// Based on MAME driver by Mirko Buffoni - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvMapROM; -static UINT8 *DrvM6809RAM0; -static UINT8 *DrvVidRAM; -static UINT8 *DrvLineRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvM6809RAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 bgimage; -static UINT8 flipscreen; -static UINT16 scrollx; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvReset; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo CityconInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Citycon) - -static struct BurnDIPInfo CityconDIPList[]= -{ - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x00, "3" }, - {0x10, 0x01, 0x03, 0x01, "4" }, - {0x10, 0x01, 0x03, 0x02, "5" }, - {0x10, 0x01, 0x03, 0x03, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x20, 0x20, "Off" }, - {0x10, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x40, 0x00, "Upright" }, - {0x10, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x07, 0x07, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x08, 0x00, "Easy" }, - {0x11, 0x01, 0x08, 0x08, "Hard" }, -}; - -STDDIPINFO(Citycon) - -static void citycon_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0x2800) return; - - switch (address) - { - case 0x3000: - bgimage = (data >> 4) & 0xf; - flipscreen = data & 0x01; - return; - - case 0x3001: - soundlatch[0] = data; - return; - - case 0x3002: - soundlatch[1] = data; - return; - - case 0x3004: - scrollx = (scrollx & 0x00ff) | (data * 256); - return; - - case 0x3005: - scrollx = (scrollx & 0xff00) | data; - return; - } -} - -static UINT8 citycon_main_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - return DrvInputs[flipscreen & 1]; - - case 0x3001: - return (DrvDips[0] & 0x7f) | (DrvInputs[2] & 0x80); - - case 0x3002: - return DrvDips[1]; - - case 0x3007: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return 0; - } - - return 0; -} - -static void citycon_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x4000: - case 0x4001: - BurnYM2203Write(1, address & 1, data); - return; - - case 0x6000: - case 0x6001: - BurnYM2203Write(0, address & 1, data); - return; - } -} - -static UINT8 citycon_sound_read(UINT16 address) -{ - switch (address) - { - case 0x6000: - case 0x6001: - return BurnYM2203Read(0, address & 1); - } - - return 0; -} - -static UINT8 citycon_ym2203_portA(UINT32 ) -{ - return soundlatch[0]; -} - -static UINT8 citycon_ym2203_portB(UINT32 ) -{ - return soundlatch[1]; -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / 640000; -} - -inline static double DrvGetTime() -{ - return (double)M6809TotalCycles() / 640000.0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - M6809Close(); - - BurnYM2203Reset(); - - bgimage = 0; - flipscreen = 0; - scrollx = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x00c000; - DrvM6809ROM1 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x0004000; - DrvGfxROM1 = Next; Next += 0x0008000; - DrvGfxROM2 = Next; Next += 0x0040000; - - DrvMapROM = Next; Next += 0x00e0000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM0 = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x001000; - DrvLineRAM = Next; Next += 0x000100; - DrvSprRAM = Next; Next += 0x000100; - DrvPalRAM = Next; Next += 0x000500; - DrvM6809RAM1 = Next; Next += 0x001000; - - soundlatch = Next; Next += 0x000002; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfx0Expand() -{ - UINT8 *rom = DrvGfxROM0; - - for (INT32 i = 0x0fff; i >= 0; i--) - { - rom[3 * i] = rom[i]; - rom[3 * i + 1] = 0; - rom[3 * i + 2] = 0; - INT32 mask = rom[i] | (rom[i] << 4) | (rom[i] >> 4); - if (i & 0x01) rom[3 * i + 1] |= mask & 0xf0; - if (i & 0x02) rom[3 * i + 1] |= mask & 0x0f; - if (i & 0x04) rom[3 * i + 2] |= mask & 0xf0; - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[5] = { 16, 12, 8, 4, 0 }; - INT32 Plane1[4] = { 4, 0, 0x10004, 0x10000 }; - INT32 Plane2[4] = { 4, 0, 0x60004, 0x60000 }; - INT32 XOffs0[8] = { STEP4(0,1), STEP4(0xc000,1) }; - INT32 YOffs0[8] = { STEP8(0,24) }; - INT32 XOffs1[8] = { STEP4(0,1), STEP4(0x4000,1) }; - INT32 YOffs1[16]= { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return 1; - } - - DrvGfx0Expand(); - - memcpy (tmp, DrvGfxROM0, 0x03000); - - GfxDecode(0x0100, 5, 8, 8, Plane0, XOffs0, YOffs0, 0x0c0, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x04000); - - GfxDecode(0x080, 4, 8, 16, Plane1, XOffs1, YOffs1, 0x080, tmp, DrvGfxROM1); - GfxDecode(0x080, 4, 8, 16, Plane1, XOffs1, YOffs1, 0x080, tmp + 0x1000, DrvGfxROM1 + (8 * 16 * 0x80)); - - memcpy (tmp, DrvGfxROM2, 0x20000); - - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x00000, DrvGfxROM2 + (8 * 8 * 0x100 * 0)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x01000, DrvGfxROM2 + (8 * 8 * 0x100 * 1)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x02000, DrvGfxROM2 + (8 * 8 * 0x100 * 2)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x03000, DrvGfxROM2 + (8 * 8 * 0x100 * 3)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x04000, DrvGfxROM2 + (8 * 8 * 0x100 * 4)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x05000, DrvGfxROM2 + (8 * 8 * 0x100 * 5)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x06000, DrvGfxROM2 + (8 * 8 * 0x100 * 6)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x07000, DrvGfxROM2 + (8 * 8 * 0x100 * 7)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x08000, DrvGfxROM2 + (8 * 8 * 0x100 * 8)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x09000, DrvGfxROM2 + (8 * 8 * 0x100 * 9)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x0a000, DrvGfxROM2 + (8 * 8 * 0x100 * 10)); - GfxDecode(0x0100, 4, 8, 8, Plane2, XOffs1, YOffs1, 0x040, tmp + 0x0b000, DrvGfxROM2 + (8 * 8 * 0x100 * 11)); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x04000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x14000, 9, 1)) return 1; - - if (BurnLoadRom(DrvMapROM + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvMapROM + 0x08000, 11, 1)) return 1; - if (BurnLoadRom(DrvMapROM + 0x0c000, 12, 1)) return 1; - - DrvGfxDecode(); - } - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvM6809RAM0, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x1000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvLineRAM, 0x2000, 0x20ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2800, 0x28ff, MAP_RAM); - M6809MapMemory(DrvPalRAM, 0x3800, 0x3cff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(citycon_main_write); - M6809SetReadHandler(citycon_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809RAM1, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM1, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(citycon_sound_write); - M6809SetReadHandler(citycon_sound_read); - M6809Close(); - - BurnYM2203Init(2, 1250000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, &citycon_ym2203_portA, &citycon_ym2203_portB, NULL, NULL); - BurnTimerAttachM6809(640000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - - BurnYM2203Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - for (INT32 i = 0; i < 0x500 / 2; i++) { - INT32 b = DrvPalRAM[i*2+1] >> 4; - INT32 g = DrvPalRAM[i*2+0] & 0x0f; - INT32 r = DrvPalRAM[i*2+0] >> 4; - - DrvPalette[i] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); - } - - for (INT32 i = 0; i < 0x100; i++) { - INT32 index = DrvLineRAM[i]; - - for (INT32 j = 0; j < 4; j++) { - DrvPalette[0x400 + (i * 4) + j] = DrvPalette[0x200 + ((index*4+j)&0x7f)]; - } - } -} - -static void draw_fg_layer() -{ - UINT16 xscroll = scrollx & 0x3ff; - - for (INT32 offs = 0; offs < 128 * 32; offs++) - { - INT32 sx = (offs & 0x7f) * 8; - INT32 sy = (offs / 0x80) * 8; - - sy -= 16; // offsets - sx -= 8; - - if (sy >= (6 * 8)) sx -= xscroll; - if (sx < -7) sx += 1024; - if (sx >= nScreenWidth) continue; - - INT32 ofst = (offs & 0x1f) + (((offs/0x80) + (offs & 0x60)) * 0x20); - INT32 code = DrvVidRAM[ofst]; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, ofst & 0x3e0, 0/*5*/, 0, 0x400, DrvGfxROM0); - } -} - -static void draw_bg_layer() -{ - UINT16 xscroll = (scrollx / 2) & 0x3ff; - - for (INT32 offs = 0; offs < 128 * 32; offs++) - { - INT32 sx = (offs & 0x7f) * 8; - INT32 sy = (offs / 0x80) * 8; - - sy -= 16; - - sx -= xscroll; - if (sx < -7) sx += 1024; - if (sx >= nScreenWidth) continue; - - INT32 ofst = (offs & 0x1f) + (((offs/0x80) + (offs & 0x60)) * 0x20); - - INT32 code = DrvMapROM[0x1000 * bgimage + ofst] + (bgimage * 0x100); - INT32 color = DrvMapROM[0xc000 + code] & 0x0f; - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM2); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x100 - 4; offs >= 0; offs -= 4) - { - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = 239 - DrvSprRAM[offs]; - INT32 flipx = ~DrvSprRAM[offs + 2] & 0x10; - - sy -= (16 - 2); - sx -= 8; - - if (flipscreen) - { - sx = 240 - sx; - sy = 238 - sy; - flipx = !flipx; - } - - INT32 code = DrvSprRAM[offs + 1]; - INT32 color = DrvSprRAM[offs + 2] & 0x0f; - - if (flipscreen) { - if (flipx) { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } else { - RenderCustomTile_Mask_FlipY_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - draw_bg_layer(); - draw_fg_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 2048000 / 60, 640000 / 60 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - M6809Run(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1)) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - - M6809Open(1); - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - if (i == (nInterleave - 1)) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809Close(); - } - - M6809Open(1); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029706; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(bgimage); - SCAN_VAR(flipscreen); - SCAN_VAR(scrollx); - } - - return 0; -} - - -// City Connection (set 1) - -static struct BurnRomInfo cityconRomDesc[] = { - { "c10", 0x4000, 0xae88b53c, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "c11", 0x8000, 0x139eb1aa, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "c1", 0x8000, 0x1fad7589, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "c4", 0x2000, 0xa6b32fc6, 3 | BRF_GRA }, // 3 Characters - - { "c12", 0x2000, 0x08eaaccd, 4 | BRF_GRA }, // 4 Background Tiles - { "c13", 0x2000, 0x1819aafb, 4 | BRF_GRA }, // 5 - - { "c9", 0x8000, 0x8aeb47e6, 5 | BRF_GRA }, // 6 Sprites - { "c8", 0x4000, 0x0d7a1eeb, 5 | BRF_GRA }, // 7 - { "c6", 0x8000, 0x2246fe9d, 5 | BRF_GRA }, // 8 - { "c7", 0x4000, 0xe8b97de9, 5 | BRF_GRA }, // 9 - - { "c2", 0x8000, 0xf2da4f23, 6 | BRF_GRA }, // 10 Background Tile Map - { "c3", 0x4000, 0x7ef3ac1b, 6 | BRF_GRA }, // 11 - { "c5", 0x2000, 0xc03d8b1b, 6 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(citycon) -STD_ROM_FN(citycon) - -struct BurnDriver BurnDrvCitycon = { - "citycon", NULL, NULL, NULL, "1985", - "City Connection (set 1)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, cityconRomInfo, cityconRomName, NULL, NULL, CityconInputInfo, CityconDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 224, 4, 3 -}; - - -// City Connection (set 2) - -static struct BurnRomInfo cityconaRomDesc[] = { - { "c10", 0x4000, 0xae88b53c, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "c11b", 0x8000, 0xd64af468, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "c1", 0x8000, 0x1fad7589, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "c4", 0x2000, 0xa6b32fc6, 3 | BRF_GRA }, // 3 Characters - - { "c12", 0x2000, 0x08eaaccd, 4 | BRF_GRA }, // 4 Background Tiles - { "c13", 0x2000, 0x1819aafb, 4 | BRF_GRA }, // 5 - - { "c9", 0x8000, 0x8aeb47e6, 5 | BRF_GRA }, // 6 Sprites - { "c8", 0x4000, 0x0d7a1eeb, 5 | BRF_GRA }, // 7 - { "c6", 0x8000, 0x2246fe9d, 5 | BRF_GRA }, // 8 - { "c7", 0x4000, 0xe8b97de9, 5 | BRF_GRA }, // 9 - - { "c2", 0x8000, 0xf2da4f23, 6 | BRF_GRA }, // 10 Background Tile Map - { "c3", 0x4000, 0x7ef3ac1b, 6 | BRF_GRA }, // 11 - { "c5", 0x2000, 0xc03d8b1b, 6 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(citycona) -STD_ROM_FN(citycona) - -struct BurnDriver BurnDrvCitycona = { - "citycona", "citycon", NULL, NULL, "1985", - "City Connection (set 2)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, cityconaRomInfo, cityconaRomName, NULL, NULL, CityconInputInfo, CityconDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 224, 4, 3 -}; - - -// Cruisin - -static struct BurnRomInfo cruisinRomDesc[] = { - { "cr10", 0x4000, 0xcc7c52f3, 1 | BRF_PRG | BRF_ESS }, // 0 m6809 #0 Code - { "cr11", 0x8000, 0x5422f276, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "c1", 0x8000, 0x1fad7589, 2 | BRF_PRG | BRF_ESS }, // 2 m6809 #1 Code - - { "cr4", 0x2000, 0x8cd0308e, 3 | BRF_GRA }, // 3 Characters - - { "c12", 0x2000, 0x08eaaccd, 4 | BRF_GRA }, // 4 Background Tiles - { "c13", 0x2000, 0x1819aafb, 4 | BRF_GRA }, // 5 - - { "c9", 0x8000, 0x8aeb47e6, 5 | BRF_GRA }, // 6 Sprites - { "c8", 0x4000, 0x0d7a1eeb, 5 | BRF_GRA }, // 7 - { "c6", 0x8000, 0x2246fe9d, 5 | BRF_GRA }, // 8 - { "c7", 0x4000, 0xe8b97de9, 5 | BRF_GRA }, // 9 - - { "c2", 0x8000, 0xf2da4f23, 6 | BRF_GRA }, // 10 Background Tile Map - { "c3", 0x4000, 0x7ef3ac1b, 6 | BRF_GRA }, // 11 - { "c5", 0x2000, 0xc03d8b1b, 6 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(cruisin) -STD_ROM_FN(cruisin) - -struct BurnDriver BurnDrvCruisin = { - "cruisin", "citycon", NULL, NULL, "1985", - "Cruisin\0", NULL, "Jaleco (Kitkorp license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, cruisinRomInfo, cruisinRomName, NULL, NULL, CityconInputInfo, CityconDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_cloak.cpp b/jan/src/burn/drv/pre90s/d_cloak.cpp deleted file mode 100644 index 2cc499a5c..000000000 --- a/jan/src/burn/drv/pre90s/d_cloak.cpp +++ /dev/null @@ -1,1105 +0,0 @@ -// FB Alpha Cloak and Dagger driver module -// Based on MAME driver by Dan Boris and Mirko Buffoni - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "pokey.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6502ROM0; -static UINT8 *DrvM6502ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvM6502RAM0; -static UINT8 *DrvM6502RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvSprRAM; -static UINT16 *DrvPalRAM; -static UINT8 *bitmap[2]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 flipscreen; -static UINT8 nvram_enable; -static UINT8 video_selected; -static UINT8 video_address_x; -static UINT8 video_address_y; - -static INT32 watchdog; -static UINT8 vblank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[4]; -static UINT8 DrvReset; - -static struct BurnInputInfo CloakInputList[] = { - {"Coin A", BIT_DIGITAL, DrvJoy3 + 3, "p1 coin" }, - {"Coin B", BIT_DIGITAL, DrvJoy3 + 2, "p2 coin" }, - {"Start 1", BIT_DIGITAL, DrvJoy4 + 7, "p1 start" }, - {"Start 2", BIT_DIGITAL, DrvJoy4 + 6, "p2 start" }, - {"P1 Left Up", BIT_DIGITAL, DrvJoy1 + 5, "p1 up" }, - {"P1 Left Down", BIT_DIGITAL, DrvJoy1 + 4, "p1 down" }, - {"P1 Left Left", BIT_DIGITAL, DrvJoy1 + 7, "p1 left" }, - {"P1 Left Right", BIT_DIGITAL, DrvJoy1 + 6, "p1 right" }, - - {"P1 Right Up", BIT_DIGITAL, DrvJoy1 + 1, "p2 up" }, - {"P1 Right Down", BIT_DIGITAL, DrvJoy1 + 0, "p2 down" }, - {"P1 Right Left", BIT_DIGITAL, DrvJoy1 + 3, "p2 left" }, - {"P1 Right Right", BIT_DIGITAL, DrvJoy1 + 2, "p2 right" }, - - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 7, "p1 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Cloak) - -static struct BurnDIPInfo CloakDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 4, "Credits" }, - {0x0f, 0x01, 0x03, 0x02, "1 Credit/1 Game" }, - {0x0f, 0x01, 0x03, 0x01, "1 Credit/2 Games" }, - {0x0f, 0x01, 0x03, 0x03, "2 Credits/1 Game" }, - {0x0f, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0f, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x04, "1 Coin 4 Credits" }, - {0x0f, 0x01, 0x0c, 0x08, "1 Coin 5 Credits" }, - {0x0f, 0x01, 0x0c, 0x0c, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x0f, 0x01, 0x10, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x10, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 0, "Demo Freeze Mode" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Cloak) - -static UINT8 adjust_xy_r(INT32 offset) -{ - UINT8 pxl = bitmap[video_selected][(video_address_y * 256) | video_address_x]; - - switch (offset & 7) - { - case 0: - video_address_x--; - video_address_y++; - break; - - case 1: - video_address_y--; - break; - - case 2: - video_address_x--; - break; - - case 4: - video_address_x++; - video_address_y++; - break; - - case 5: - video_address_y++; - break; - - case 6: - video_address_x++; - break; - } - - return pxl; -} - -static void adjust_xy_w(INT32 offset, INT32 data) -{ - switch (offset & 7) - { - case 3: - video_address_x = data; - break; - - case 7: - video_address_y = data; - break; - - default: - bitmap[video_selected^1][(video_address_y * 256) | video_address_x] = data & 0xf; - adjust_xy_r(offset); - break; - } -} - -static void cloak_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff80) == 0x3200) { - UINT16 offset = address - 0x3200; - DrvPalRAM[offset & 0x3f] = ((offset & 0x40) << 2) | data; - return; - } - - if ((address & 0xff00) == 0x2f00) { - return; // nop - } - - if ((address & 0xfff0) == 0x1000) { - pokey1_w(address & 0xf, data); - return; - } - - if ((address & 0xfff0) == 0x1800) { - pokey2_w(address & 0xf, data); - return; - } - -#if 0 - if ((address & 0xfe00) == 0x2800) { - if (nvram_enable) { - DrvNVRAM[address & 0x1ff] = data; - } - return; - } -#endif - - switch (address) - { - case 0x2600: - // custom (unused) - return; - - case 0x3800: - case 0x3801: - // coin counter - return; - - case 0x3803: - flipscreen = data & 0x80; - return; - - case 0x3805: - return; // nop - - case 0x3806: - case 0x3807: - // leds - return; - - case 0x3a00: - watchdog = 0; - return; - - case 0x3c00: - M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0x3e00: - nvram_enable = data & 1; - return; - } -} - -static UINT8 cloak_main_read(UINT16 address) -{ - if ((address & 0xff00) == 0x2f00) { - return 0; // nop - } - - if ((address & 0xfff0) == 0x1000) { // pokey 1 - switch (address&0xf) { - case ALLPOT_C: return DrvInputs[3] ^ 0xf0; - default: return pokey1_r(address&0xf); - } - } - - if ((address & 0xfff0) == 0x1800) { // pokey 2 - switch (address&0xf) { - case ALLPOT_C: return DrvDips[0]; - default: return pokey2_r(address&0xf); - } - } - - switch (address) - { - case 0x2000: - return DrvInputs[0]; // p1 - - case 0x2200: - return 0xff; - - case 0x2400: - return (DrvInputs[2] & 0xfe) | ((vblank) ? 0x00 : 0x01); - } - - return 0; -} - -static void cloak_sub_write(UINT16 address, UINT8 data) -{ - if (address < 0x0008 || (address >= 0x0010 && address <= 0x07ff)) { - DrvM6502RAM1[address & 0x7ff] = data; - return; - } - - if ((address & 0xfff8) == 0x0008) { - adjust_xy_w(address, data); - return; - } - - switch (address) - { - case 0x1000: - M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0x1200: - { - video_selected = data & 1; - - if (data & 2) { - memset (bitmap[video_selected^1], 0, 256 * 256); - } - } - return; - - case 0x1400: - // custom (unused) - return; - } -} - -static UINT8 cloak_sub_read(UINT16 address) -{ - if (address < 0x0008 || (address >= 0x0010 && address <= 0x07ff)) { - return DrvM6502RAM1[address & 0x7ff]; - } - - if ((address & 0xfff8) == 0x0008) { - return adjust_xy_r(address); - } - - return 0; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset(AllRam, 0, RamEnd - AllRam); - } - - M6502Open(0); - M6502Reset(); - M6502Close(); - - M6502Open(1); - M6502Reset(); - M6502Close(); - - watchdog = 0; - - flipscreen = 0; - nvram_enable = 0; - video_selected = 0; - video_address_x = 0; - video_address_y = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6502ROM0 = Next; Next += 0x010000; - DrvM6502ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x004000; - DrvGfxROM1 = Next; Next += 0x004000; - - DrvNVRAM = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x0040 * sizeof(UINT32); - - AllRam = Next; - - DrvM6502RAM0 = Next; Next += 0x000800; - DrvM6502RAM1 = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - DrvShareRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000100; - - DrvPalRAM = (UINT16*)Next; Next += 0x0040 * 2; - - bitmap[0] = Next; Next += 256 * 256; - bitmap[1] = Next; Next += 256 * 256; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { STEP4(0,1) }; - INT32 XOffs[8] = { 0x1000*8+0, 0x1000*8+4, 0, 4, 0x1000*8+8, 0x1000*8+12, 8, 12 }; - INT32 YOffs[16]= { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0100, 4, 8, 8, Plane, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x2000); - - GfxDecode(0x0080, 4, 8, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6502ROM0 + 0x4000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x6000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x8000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0xc000, 3, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM1 + 0x2000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x4000, 5, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x6000, 6, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x8000, 7, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0xa000, 8, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0xc000, 9, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0xe000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 14, 1)) return 1; - - DrvGfxDecode(); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM0, 0x0000, 0x03ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x0400, 0x07ff, MAP_RAM); - M6502MapMemory(DrvShareRAM, 0x0800, 0x0fff, MAP_RAM); - M6502MapMemory(DrvNVRAM, 0x2800, 0x29ff, MAP_RAM); - M6502MapMemory(DrvSprRAM, 0x3000, 0x30ff, MAP_RAM); -// M6502MapMemory(DrvPalRAM, 0x3200, 0x32ff, MAP_RAM); // handler - M6502MapMemory(DrvM6502ROM0 + 0x4000, 0x4000, 0xffff, MAP_ROM); - M6502SetWriteHandler(cloak_main_write); - M6502SetReadHandler(cloak_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502MapMemory(DrvM6502RAM1, 0x0000, 0x00ff, MAP_FETCH); - M6502MapMemory(DrvM6502RAM1 + 0x0100, 0x0100, 0x07ff, MAP_RAM); - M6502MapMemory(DrvShareRAM, 0x0800, 0x0fff, MAP_RAM); - M6502MapMemory(DrvM6502ROM1 + 0x2000, 0x2000, 0xffff, MAP_ROM); - M6502SetWriteHandler(cloak_sub_write); - M6502SetReadHandler(cloak_sub_read); - M6502Close(); - - PokeyInit(1250000, 2, 1.00, 0); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - PokeyExit(); - - BurnFree(AllMem); - - return 0; -} - -#define MAX_NETS 3 -#define MAX_RES_PER_NET 18 -#define Combine2Weights(tab,w0,w1) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5)) -#define Combine3Weights(tab,w0,w1,w2) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5)) - -static double ComputeResistorWeights(INT32 MinVal, INT32 MaxVal, double Scaler, INT32 Count1, const INT32 *Resistances1, double *Weights1, INT32 PullDown1, INT32 PullUp1, INT32 Count2, const INT32 *Resistances2, double *Weights2, INT32 PullDown2, INT32 PullUp2, INT32 Count3, const INT32 *Resistances3, double *Weights3, INT32 PullDown3, INT32 PullUp3) -{ - INT32 NetworksNum; - - INT32 ResCount[MAX_NETS]; - double r[MAX_NETS][MAX_RES_PER_NET]; - double w[MAX_NETS][MAX_RES_PER_NET]; - double ws[MAX_NETS][MAX_RES_PER_NET]; - INT32 r_pd[MAX_NETS]; - INT32 r_pu[MAX_NETS]; - - double MaxOut[MAX_NETS]; - double *Out[MAX_NETS]; - - INT32 i, j, n; - double Scale; - double Max; - - NetworksNum = 0; - for (n = 0; n < MAX_NETS; n++) { - INT32 Count, pd, pu; - const INT32 *Resistances; - double *Weights; - - switch (n) { - case 0: { - Count = Count1; - Resistances = Resistances1; - Weights = Weights1; - pd = PullDown1; - pu = PullUp1; - break; - } - - case 1: { - Count = Count2; - Resistances = Resistances2; - Weights = Weights2; - pd = PullDown2; - pu = PullUp2; - break; - } - - case 2: - default: { - Count = Count3; - Resistances = Resistances3; - Weights = Weights3; - pd = PullDown3; - pu = PullUp3; - break; - } - } - - if (Count > 0) { - ResCount[NetworksNum] = Count; - for (i = 0; i < Count; i++) { - r[NetworksNum][i] = 1.0 * Resistances[i]; - } - Out[NetworksNum] = Weights; - r_pd[NetworksNum] = pd; - r_pu[NetworksNum] = pu; - NetworksNum++; - } - } - - for (i = 0; i < NetworksNum; i++) { - double R0, R1, Vout, Dst; - - for (n = 0; n < ResCount[i]; n++) { - R0 = (r_pd[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pd[i]; - R1 = (r_pu[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pu[i]; - - for (j = 0; j < ResCount[i]; j++) { - if (j == n) { - if (r[i][j] != 0.0) R1 += 1.0 / r[i][j]; - } else { - if (r[i][j] != 0.0) R0 += 1.0 / r[i][j]; - } - } - - R0 = 1.0/R0; - R1 = 1.0/R1; - Vout = (MaxVal - MinVal) * R0 / (R1 + R0) + MinVal; - - Dst = (Vout < MinVal) ? MinVal : (Vout > MaxVal) ? MaxVal : Vout; - - w[i][n] = Dst; - } - } - - j = 0; - Max = 0.0; - for (i = 0; i < NetworksNum; i++) { - double Sum = 0.0; - - for (n = 0; n < ResCount[i]; n++) Sum += w[i][n]; - - MaxOut[i] = Sum; - if (Max < Sum) { - Max = Sum; - j = i; - } - } - - if (Scaler < 0.0) { - Scale = ((double)MaxVal) / MaxOut[j]; - } else { - Scale = Scaler; - } - - for (i = 0; i < NetworksNum; i++) { - for (n = 0; n < ResCount[i]; n++) { - ws[i][n] = w[i][n] * Scale; - (Out[i])[n] = ws[i][n]; - } - } - - return Scale; -} - -static void palette_update() -{ - static const int resistances_rgb[3] = { 10000, 4700, 2200 }; - double weights_rgb[3]; - - ComputeResistorWeights(0, 0xff, -1.0, - 3, &resistances_rgb[0], weights_rgb, 0, 1000, - 0,0,0,0,0, - 0,0,0,0,0); - - for (INT32 i = 0; i < 0x40; i++) - { - INT32 bit0 = (~DrvPalRAM[i] >> 6) & 0x01; - INT32 bit1 = (~DrvPalRAM[i] >> 7) & 0x01; - INT32 bit2 = (~DrvPalRAM[i] >> 8) & 0x01; - INT32 r = Combine3Weights(weights_rgb, bit0, bit1, bit2); - - bit0 = (~DrvPalRAM[i] >> 3) & 0x01; - bit1 = (~DrvPalRAM[i] >> 4) & 0x01; - bit2 = (~DrvPalRAM[i] >> 5) & 0x01; - INT32 g = Combine3Weights(weights_rgb, bit0, bit1, bit2); - - bit0 = (~DrvPalRAM[i] >> 0) & 0x01; - bit1 = (~DrvPalRAM[i] >> 1) & 0x01; - bit2 = (~DrvPalRAM[i] >> 2) & 0x01; - INT32 b = Combine3Weights(weights_rgb, bit0, bit1, bit2); - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} -#undef MAX_NETS -#undef MAX_RES_PER_NET -#undef Combine2Weights -#undef Combine3Weights - -static void draw_layer() -{ - for (INT32 offs = /*3 * 32*/0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 code = DrvVidRAM[offs]; - - Render8x8Tile_Clip(pTransDraw, code, sx, sy - 24, 0, 4, 0, DrvGfxROM0); - } -} - -static void draw_bitmap() -{ - for (INT32 y = 24; y < 256; y++) - { - for (INT32 x = 0; x < 256; x++) - { - UINT8 pen = bitmap[video_selected][(y * 256) | x] & 0x07; - - if (pen) { - pTransDraw[((y - 24) * nScreenWidth) + ((x - 6) & 0xff)] = 0x10 | ((x & 0x80) >> 4) | pen; - //0x10 | ((x >> 4) & 8) | pen; - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = (0x100 / 4) - 1; offs >= 0; offs--) - { - INT32 code = DrvSprRAM[offs + 64] & 0x7f; - INT32 color = 0; - INT32 flipx = DrvSprRAM[offs + 64] & 0x80; - INT32 flipy = 0; - INT32 sx = DrvSprRAM[offs + 192]; - INT32 sy = 240 - DrvSprRAM[offs]; - - if (flipscreen) - { - sx -= 9; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } else { - sy -= 24; - } - - if (flipy) { - if (flipx) { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0x20, DrvGfxROM1); - } else { - RenderCustomTile_Mask_FlipY_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0x20, DrvGfxROM1); - } - } else { - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0x20, DrvGfxROM1); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0x20, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - //if (DrvRecalc) { - palette_update(); - DrvRecalc = 0; - //} - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(); - if (nBurnLayer & 2) draw_bitmap(); - if (nBurnLayer & 4) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - { - memset (DrvInputs, 0xff, 4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nInterleave = 262; - INT32 nCyclesTotal[2] = { 1000000 / 60, 1250000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6502Open(0); - nCyclesDone[0] += M6502Run(nCyclesTotal[0] / nInterleave); - if ((i & 0x3f) == 0x3f) M6502SetIRQLine(0, CPU_IRQSTATUS_HOLD); - M6502Close(); - - M6502Open(1); - nCyclesDone[1] += M6502Run(nCyclesTotal[1] / nInterleave); - if ((i & 0x7f) == 0x7f) M6502SetIRQLine(0, CPU_IRQSTATUS_HOLD); - M6502Close(); - - if (i == 240) vblank = 1; - } - - if (pBurnSoundOut) { - pokey_update(0, pBurnSoundOut, nBurnSoundLen); - pokey_update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029727; - } - - if (nAction & ACB_NVRAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvNVRAM; - ba.nLen = 0x000200; - ba.szName = "Nonvolatile RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - - pokey_scan(nAction, pnMin); - - SCAN_VAR(nvram_enable); - SCAN_VAR(flipscreen); - SCAN_VAR(video_selected); - SCAN_VAR(video_address_x); - SCAN_VAR(video_address_y); - } - - return 0; -} - - -// Cloak & Dagger (rev 5) - -static struct BurnRomInfo cloakRomDesc[] = { - { "136023-501.bin", 0x2000, 0xc2dbef1b, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 code - { "136023-502.bin", 0x2000, 0x316d0c7b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136023-503.bin", 0x4000, 0xb9c291a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136023-504.bin", 0x4000, 0xd014a1c0, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136023-509.bin", 0x2000, 0x46c021a4, 2 | BRF_GRA }, // 4 M6502 #1 code - { "136023-510.bin", 0x2000, 0x8c9cf017, 2 | BRF_GRA }, // 5 - { "136023-511.bin", 0x2000, 0x66fd8a34, 2 | BRF_GRA }, // 6 - { "136023-512.bin", 0x2000, 0x48c8079e, 2 | BRF_GRA }, // 7 - { "136023-513.bin", 0x2000, 0x13f1cbab, 2 | BRF_GRA }, // 8 - { "136023-514.bin", 0x2000, 0x6f8c7991, 2 | BRF_GRA }, // 9 - { "136023-515.bin", 0x2000, 0x835438a0, 2 | BRF_GRA }, // 10 - - { "136023-105.bin", 0x1000, 0xee443909, 3 | BRF_GRA }, // 11 Background tiles - { "136023-106.bin", 0x1000, 0xd708b132, 3 | BRF_GRA }, // 12 - - { "136023-107.bin", 0x1000, 0xc42c84a4, 4 | BRF_GRA }, // 13 Sprites - { "136023-108.bin", 0x1000, 0x4fe13d58, 4 | BRF_GRA }, // 14 - - { "136023-116.3n", 0x0100, 0xef2668e5, 5 | BRF_OPT }, // 15 Timing prom -}; - -STD_ROM_PICK(cloak) -STD_ROM_FN(cloak) - -struct BurnDriver BurnDrvCloak = { - "cloak", NULL, NULL, NULL, "1983", - "Cloak & Dagger (rev 5)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, cloakRomInfo, cloakRomName, NULL, NULL, CloakInputInfo, CloakDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 232, 4, 3 -}; - - -// Cloak & Dagger (Spanish) - -static struct BurnRomInfo cloakspRomDesc[] = { - { "136023-501.bin", 0x2000, 0xc2dbef1b, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 code - { "136023-502.bin", 0x2000, 0x316d0c7b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136023-503.bin", 0x4000, 0xb9c291a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136023-804.bin", 0x4000, 0x994899c7, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136023-509.bin", 0x2000, 0x46c021a4, 2 | BRF_GRA }, // 4 M6502 #1 code - { "136023-510.bin", 0x2000, 0x8c9cf017, 2 | BRF_GRA }, // 5 - { "136023-511.bin", 0x2000, 0x66fd8a34, 2 | BRF_GRA }, // 6 - { "136023-512.bin", 0x2000, 0x48c8079e, 2 | BRF_GRA }, // 7 - { "136023-513.bin", 0x2000, 0x13f1cbab, 2 | BRF_GRA }, // 8 - { "136023-514.bin", 0x2000, 0x6f8c7991, 2 | BRF_GRA }, // 9 - { "136023-515.bin", 0x2000, 0x835438a0, 2 | BRF_GRA }, // 10 - - { "136023-105.bin", 0x1000, 0xee443909, 3 | BRF_GRA }, // 11 Background tiles - { "136023-106.bin", 0x1000, 0xd708b132, 3 | BRF_GRA }, // 12 - - { "136023-107.bin", 0x1000, 0xc42c84a4, 4 | BRF_GRA }, // 13 Sprites - { "136023-108.bin", 0x1000, 0x4fe13d58, 4 | BRF_GRA }, // 14 - - { "136023-116.3n", 0x0100, 0xef2668e5, 5 | BRF_OPT }, // 15 Timing prom -}; - -STD_ROM_PICK(cloaksp) -STD_ROM_FN(cloaksp) - -struct BurnDriver BurnDrvCloaksp = { - "cloaksp", "cloak", NULL, NULL, "1983", - "Cloak & Dagger (Spanish)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, cloakspRomInfo, cloakspRomName, NULL, NULL, CloakInputInfo, CloakDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 232, 4, 3 -}; - - -// Cloak & Dagger (French) - -static struct BurnRomInfo cloakfrRomDesc[] = { - { "136023-501.bin", 0x2000, 0xc2dbef1b, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 code - { "136023-502.bin", 0x2000, 0x316d0c7b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136023-503.bin", 0x4000, 0xb9c291a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136023-704.bin", 0x4000, 0xbf225ea0, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136023-509.bin", 0x2000, 0x46c021a4, 2 | BRF_GRA }, // 4 M6502 #1 code - { "136023-510.bin", 0x2000, 0x8c9cf017, 2 | BRF_GRA }, // 5 - { "136023-511.bin", 0x2000, 0x66fd8a34, 2 | BRF_GRA }, // 6 - { "136023-512.bin", 0x2000, 0x48c8079e, 2 | BRF_GRA }, // 7 - { "136023-513.bin", 0x2000, 0x13f1cbab, 2 | BRF_GRA }, // 8 - { "136023-514.bin", 0x2000, 0x6f8c7991, 2 | BRF_GRA }, // 9 - { "136023-515.bin", 0x2000, 0x835438a0, 2 | BRF_GRA }, // 10 - - { "136023-105.bin", 0x1000, 0xee443909, 3 | BRF_GRA }, // 11 Background tiles - { "136023-106.bin", 0x1000, 0xd708b132, 3 | BRF_GRA }, // 12 - - { "136023-107.bin", 0x1000, 0xc42c84a4, 4 | BRF_GRA }, // 13 Sprites - { "136023-108.bin", 0x1000, 0x4fe13d58, 4 | BRF_GRA }, // 14 - - { "136023-116.3n", 0x0100, 0xef2668e5, 5 | BRF_OPT }, // 15 Timing prom -}; - -STD_ROM_PICK(cloakfr) -STD_ROM_FN(cloakfr) - -struct BurnDriver BurnDrvCloakfr = { - "cloakfr", "cloak", NULL, NULL, "1983", - "Cloak & Dagger (French)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, cloakfrRomInfo, cloakfrRomName, NULL, NULL, CloakInputInfo, CloakDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 232, 4, 3 -}; - - -// Cloak & Dagger (German) - -static struct BurnRomInfo cloakgrRomDesc[] = { - { "136023-501.bin", 0x2000, 0xc2dbef1b, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 code - { "136023-502.bin", 0x2000, 0x316d0c7b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136023-503.bin", 0x4000, 0xb9c291a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136023-604.bin", 0x4000, 0x7ac66aea, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136023-509.bin", 0x2000, 0x46c021a4, 2 | BRF_GRA }, // 4 M6502 #1 code - { "136023-510.bin", 0x2000, 0x8c9cf017, 2 | BRF_GRA }, // 5 - { "136023-511.bin", 0x2000, 0x66fd8a34, 2 | BRF_GRA }, // 6 - { "136023-512.bin", 0x2000, 0x48c8079e, 2 | BRF_GRA }, // 7 - { "136023-513.bin", 0x2000, 0x13f1cbab, 2 | BRF_GRA }, // 8 - { "136023-514.bin", 0x2000, 0x6f8c7991, 2 | BRF_GRA }, // 9 - { "136023-515.bin", 0x2000, 0x835438a0, 2 | BRF_GRA }, // 10 - - { "136023-105.bin", 0x1000, 0xee443909, 3 | BRF_GRA }, // 11 Background tiles - { "136023-106.bin", 0x1000, 0xd708b132, 3 | BRF_GRA }, // 12 - - { "136023-107.bin", 0x1000, 0xc42c84a4, 4 | BRF_GRA }, // 13 Sprites - { "136023-108.bin", 0x1000, 0x4fe13d58, 4 | BRF_GRA }, // 14 - - { "136023-116.3n", 0x0100, 0xef2668e5, 5 | BRF_OPT }, // 15 Timing prom -}; - -STD_ROM_PICK(cloakgr) -STD_ROM_FN(cloakgr) - -struct BurnDriver BurnDrvCloakgr = { - "cloakgr", "cloak", NULL, NULL, "1983", - "Cloak & Dagger (German)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, cloakgrRomInfo, cloakgrRomName, NULL, NULL, CloakInputInfo, CloakDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 232, 4, 3 -}; - - -// Agent X (prototype, rev 4) - -static struct BurnRomInfo agentx4RomDesc[] = { - { "136401-023.bin", 0x2000, 0xf7edac86, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 code - { "136402-023.bin", 0x2000, 0xdb5e2382, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136403-023.bin", 0x4000, 0x87de01b4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136404-023.bin", 0x4000, 0xb97219dc, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136409-023.bin", 0x2000, 0xadd4a749, 2 | BRF_GRA }, // 4 M6502 #1 code - { "136410-023.bin", 0x2000, 0xb1e1c074, 2 | BRF_GRA }, // 5 - { "136411-023.bin", 0x2000, 0x6d0c1ee5, 2 | BRF_GRA }, // 6 - { "136412-023.bin", 0x2000, 0x815af543, 2 | BRF_GRA }, // 7 - { "136413-023.bin", 0x2000, 0x2ad9e622, 2 | BRF_GRA }, // 8 - { "136414-023.bin", 0x2000, 0xcadf9ab0, 2 | BRF_GRA }, // 9 - { "136415-023.bin", 0x2000, 0xf5024961, 2 | BRF_GRA }, // 10 - - { "136105-023.bin", 0x1000, 0xee443909, 3 | BRF_GRA }, // 11 Background tiles - { "136106-023.bin", 0x1000, 0xd708b132, 3 | BRF_GRA }, // 12 - - { "136107-023.bin", 0x1000, 0xc42c84a4, 4 | BRF_GRA }, // 13 Sprites - { "136108-023.bin", 0x1000, 0x4fe13d58, 4 | BRF_GRA }, // 14 - - { "136023-116.3n", 0x0100, 0xef2668e5, 5 | BRF_OPT }, // 15 Timing prom -}; - -STD_ROM_PICK(agentx4) -STD_ROM_FN(agentx4) - -struct BurnDriver BurnDrvAgentx4 = { - "agentx4", "cloak", NULL, NULL, "1983", - "Agent X (prototype, rev 4)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, agentx4RomInfo, agentx4RomName, NULL, NULL, CloakInputInfo, CloakDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 232, 4, 3 -}; - - -// Agent X (prototype, rev 3) - -static struct BurnRomInfo agentx3RomDesc[] = { - { "136301-023.bin", 0x2000, 0xfba1d9de, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 code - { "136302-023.bin", 0x2000, 0xe5694c72, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136303-023.bin", 0x4000, 0x70ef51c5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136304-023.bin", 0x4000, 0xf4a86cda, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136309-023.bin", 0x2000, 0x1c04282d, 2 | BRF_GRA }, // 4 M6502 #1 code - { "136310-023.bin", 0x2000, 0xa61eaa88, 2 | BRF_GRA }, // 5 - { "136311-023.bin", 0x2000, 0xa670f4b4, 2 | BRF_GRA }, // 6 - { "136312-023.bin", 0x2000, 0xe955af62, 2 | BRF_GRA }, // 7 - { "136313-023.bin", 0x2000, 0xb4b46d9d, 2 | BRF_GRA }, // 8 - { "136314-023.bin", 0x2000, 0x3138a3b2, 2 | BRF_GRA }, // 9 - { "136315-023.bin", 0x2000, 0xd12f5523, 2 | BRF_GRA }, // 10 - - { "136105-023.bin", 0x1000, 0xee443909, 3 | BRF_GRA }, // 11 Background tiles - { "136106-023.bin", 0x1000, 0xd708b132, 3 | BRF_GRA }, // 12 - - { "136107-023.bin", 0x1000, 0xc42c84a4, 4 | BRF_GRA }, // 13 Sprites - { "136108-023.bin", 0x1000, 0x4fe13d58, 4 | BRF_GRA }, // 14 - - { "136023-116.3n", 0x0100, 0xef2668e5, 5 | BRF_OPT }, // 15 Timing prom -}; - -STD_ROM_PICK(agentx3) -STD_ROM_FN(agentx3) - -struct BurnDriver BurnDrvAgentx3 = { - "agentx3", "cloak", NULL, NULL, "1983", - "Agent X (prototype, rev 3)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, agentx3RomInfo, agentx3RomName, NULL, NULL, CloakInputInfo, CloakDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 232, 4, 3 -}; - - -// Agent X (prototype, rev 2) - -static struct BurnRomInfo agentx2RomDesc[] = { - { "136201-023.bin", 0x2000, 0xe6c7041f, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 code - { "136202-023.bin", 0x2000, 0x4c94929e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136203-023.bin", 0x4000, 0xc7a59697, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136204-023.bin", 0x4000, 0xe6e06a9c, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136209-023.bin", 0x2000, 0x319772d8, 2 | BRF_GRA }, // 4 M6502 #1 code - { "136210-023.bin", 0x2000, 0x6e95f628, 2 | BRF_GRA }, // 5 - { "136211-023.bin", 0x2000, 0x8d936132, 2 | BRF_GRA }, // 6 - { "136212-023.bin", 0x2000, 0x9a3074c8, 2 | BRF_GRA }, // 7 - { "136213-023.bin", 0x2000, 0x15984981, 2 | BRF_GRA }, // 8 - { "136214-023.bin", 0x2000, 0xdba311ec, 2 | BRF_GRA }, // 9 - { "136215-023.bin", 0x2000, 0xdc20c185, 2 | BRF_GRA }, // 10 - - { "136105-023.bin", 0x1000, 0xee443909, 3 | BRF_GRA }, // 11 Background tiles - { "136106-023.bin", 0x1000, 0xd708b132, 3 | BRF_GRA }, // 12 - - { "136107-023.bin", 0x1000, 0xc42c84a4, 4 | BRF_GRA }, // 13 Sprites - { "136108-023.bin", 0x1000, 0x4fe13d58, 4 | BRF_GRA }, // 14 - - { "136023-116.3n", 0x0100, 0xef2668e5, 5 | BRF_OPT }, // 15 Timing prom -}; - -STD_ROM_PICK(agentx2) -STD_ROM_FN(agentx2) - -struct BurnDriver BurnDrvAgentx2 = { - "agentx2", "cloak", NULL, NULL, "1983", - "Agent X (prototype, rev 2)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, agentx2RomInfo, agentx2RomName, NULL, NULL, CloakInputInfo, CloakDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 232, 4, 3 -}; - - -// Agent X (prototype, rev 1) - -static struct BurnRomInfo agentx1RomDesc[] = { - { "136101-023.bin", 0x2000, 0xa12b9c22, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 code - { "136102-023.bin", 0x2000, 0xe65d30df, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136103-023.bin", 0x4000, 0xc6f8a128, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136104-023.bin", 0x4000, 0xdb002945, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136109-023.bin", 0x2000, 0x31487f5d, 2 | BRF_GRA }, // 4 M6502 #1 code - { "136110-023.bin", 0x2000, 0x1ee38ecb, 2 | BRF_GRA }, // 5 - { "136111-023.bin", 0x2000, 0xca6a6b0c, 2 | BRF_GRA }, // 6 - { "136112-023.bin", 0x2000, 0x933051bc, 2 | BRF_GRA }, // 7 - { "136113-023.bin", 0x2000, 0x1706a674, 2 | BRF_GRA }, // 8 - { "136114-023.bin", 0x2000, 0x7c7c905d, 2 | BRF_GRA }, // 9 - { "136115-023.bin", 0x2000, 0x7f36710c, 2 | BRF_GRA }, // 10 - - { "136105-023.bin", 0x1000, 0xee443909, 3 | BRF_GRA }, // 11 Background tiles - { "136106-023.bin", 0x1000, 0xd708b132, 3 | BRF_GRA }, // 12 - - { "136107-023.bin", 0x1000, 0xc42c84a4, 4 | BRF_GRA }, // 13 Sprites - { "136108-023.bin", 0x1000, 0x4fe13d58, 4 | BRF_GRA }, // 14 - - { "136023-116.3n", 0x0100, 0xef2668e5, 5 | BRF_OPT }, // 15 Timing prom -}; - -STD_ROM_PICK(agentx1) -STD_ROM_FN(agentx1) - -struct BurnDriver BurnDrvAgentx1 = { - "agentx1", "cloak", NULL, NULL, "1983", - "Agent X (prototype, rev 1)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, agentx1RomInfo, agentx1RomName, NULL, NULL, CloakInputInfo, CloakDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 232, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_commando.cpp b/jan/src/burn/drv/pre90s/d_commando.cpp deleted file mode 100644 index 115048d31..000000000 --- a/jan/src/burn/drv/pre90s/d_commando.cpp +++ /dev/null @@ -1,1331 +0,0 @@ -// FB Alpha Commando driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80Rom1 = NULL; -static UINT8 *DrvZ80Rom1Op = NULL; -static UINT8 *DrvZ80Rom2 = NULL; -static UINT8 *DrvZ80Ram1 = NULL; -static UINT8 *DrvZ80Ram2 = NULL; -static UINT8 *DrvFgVideoRam = NULL; -static UINT8 *DrvFgColourRam = NULL; -static UINT8 *DrvBgVideoRam = NULL; -static UINT8 *DrvBgColourRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvSpriteRamBuffer = NULL; -static UINT8 *DrvPromRed = NULL; -static UINT8 *DrvPromGreen = NULL; -static UINT8 *DrvPromBlue = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvBgScrollX[2]; -static UINT8 DrvBgScrollY[2]; -static UINT8 DrvFlipScreen; -static UINT8 DrvSoundLatch; - -static bool bFirstOpCodeEncrypted = false; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - - -STDINPUTINFO(Drv) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x1f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Starting Area" }, - {0x11, 0x01, 0x03, 0x03, "0 (Forest 1)" }, - {0x11, 0x01, 0x03, 0x01, "2 (Forest 1)" }, - {0x11, 0x01, 0x03, 0x02, "4 (Forest 2)" }, - {0x11, 0x01, 0x03, 0x00, "6 (Forest 2)" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x0c, 0x04, "2" }, - {0x11, 0x01, 0x0c, 0x0c, "3" }, - {0x11, 0x01, 0x0c, 0x08, "4" }, - {0x11, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0xc0, 0x00, "2 Coins 1 Play" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Play" }, - {0x11, 0x01, 0xc0, 0x40, "1 Coin 2 Plays" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0x30, 0x00, "4 Coins 1 Play" }, - {0x11, 0x01, 0x30, 0x20, "3 Coins 1 Play" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Play" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Play" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x12, 0x01, 0x07, 0x07, "10k 50k+" }, - {0x12, 0x01, 0x07, 0x03, "10k 60k+" }, - {0x12, 0x01, 0x07, 0x05, "20k 60k+" }, - {0x12, 0x01, 0x07, 0x01, "20k 70k+" }, - {0x12, 0x01, 0x07, 0x06, "30k 70k+" }, - {0x12, 0x01, 0x07, 0x02, "30k 80k+" }, - {0x12, 0x01, 0x07, 0x04, "40k 100k+" }, - {0x12, 0x01, 0x07, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x12, 0x01, 0x10, 0x10, "Normal" }, - {0x12, 0x01, 0x10, 0x00, "Difficult" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x12, 0x01, 0xc0, 0x00, "Upright" }, - {0x12, 0x01, 0xc0, 0x40, "Upright 2 Players" }, - {0x12, 0x01, 0xc0, 0xc0, "Cocktail" }, -}; - -STDDIPINFO(Drv) - -static struct BurnRomInfo DrvRomDesc[] = { - { "cm04.9m", 0x08000, 0x8438b694, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "cm03.8m", 0x04000, 0x35486542, BRF_ESS | BRF_PRG }, // 1 - - { "cm02.9f", 0x04000, 0xf9cc4a74, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "vt01.5d", 0x04000, 0x505726e0, BRF_GRA }, // 3 Characters - - { "vt11.5a", 0x04000, 0x7b2e1b48, BRF_GRA }, // 4 Tiles - { "vt12.6a", 0x04000, 0x81b417d3, BRF_GRA }, // 5 - { "vt13.7a", 0x04000, 0x5612dbd2, BRF_GRA }, // 6 - { "vt14.8a", 0x04000, 0x2b2dee36, BRF_GRA }, // 7 - { "vt15.9a", 0x04000, 0xde70babf, BRF_GRA }, // 8 - { "vt16.10a", 0x04000, 0x14178237, BRF_GRA }, // 9 - - { "vt05.7e", 0x04000, 0x79f16e3d, BRF_GRA }, // 10 Sprites - { "vt06.8e", 0x04000, 0x26fee521, BRF_GRA }, // 11 - { "vt07.9e", 0x04000, 0xca88bdfd, BRF_GRA }, // 12 - { "vt08.7h", 0x04000, 0x2019c883, BRF_GRA }, // 13 - { "vt09.8h", 0x04000, 0x98703982, BRF_GRA }, // 14 - { "vt10.9h", 0x04000, 0xf069d2f8, BRF_GRA }, // 15 - - { "vtb1.1d", 0x00100, 0x3aba15a1, BRF_GRA }, // 16 PROMs - { "vtb2.2d", 0x00100, 0x88865754, BRF_GRA }, // 17 - { "vtb3.3d", 0x00100, 0x4c14c3f6, BRF_GRA }, // 18 - { "vtb4.1h", 0x00100, 0xb388c246, BRF_GRA }, // 19 - { "vtb5.6l", 0x00100, 0x712ac508, BRF_GRA }, // 20 - { "vtb6.6e", 0x00100, 0x0eaf5158, BRF_GRA }, // 21 -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvuRomDesc[] = { - { "u4-f.9m", 0x08000, 0xa6118935, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "u3-f.8m", 0x04000, 0x24f49684, BRF_ESS | BRF_PRG }, // 1 - - { "cm02.9f", 0x04000, 0xf9cc4a74, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "vt01.5d", 0x04000, 0x505726e0, BRF_GRA }, // 3 Characters - - { "vt11.5a", 0x04000, 0x7b2e1b48, BRF_GRA }, // 4 Tiles - { "vt12.6a", 0x04000, 0x81b417d3, BRF_GRA }, // 5 - { "vt13.7a", 0x04000, 0x5612dbd2, BRF_GRA }, // 6 - { "vt14.8a", 0x04000, 0x2b2dee36, BRF_GRA }, // 7 - { "vt15.9a", 0x04000, 0xde70babf, BRF_GRA }, // 8 - { "vt16.10a", 0x04000, 0x14178237, BRF_GRA }, // 9 - - { "vt05.7e", 0x04000, 0x79f16e3d, BRF_GRA }, // 10 Sprites - { "vt06.8e", 0x04000, 0x26fee521, BRF_GRA }, // 11 - { "vt07.9e", 0x04000, 0xca88bdfd, BRF_GRA }, // 12 - { "vt08.7h", 0x04000, 0x2019c883, BRF_GRA }, // 13 - { "vt09.8h", 0x04000, 0x98703982, BRF_GRA }, // 14 - { "vt10.9h", 0x04000, 0xf069d2f8, BRF_GRA }, // 15 - - { "vtb1.1d", 0x00100, 0x3aba15a1, BRF_GRA }, // 16 PROMs - { "vtb2.2d", 0x00100, 0x88865754, BRF_GRA }, // 17 - { "vtb3.3d", 0x00100, 0x4c14c3f6, BRF_GRA }, // 18 - { "vtb4.1h", 0x00100, 0xb388c246, BRF_GRA }, // 19 - { "vtb5.6l", 0x00100, 0x712ac508, BRF_GRA }, // 20 - { "vtb6.6e", 0x00100, 0x0eaf5158, BRF_GRA }, // 21 -}; - -STD_ROM_PICK(Drvu) -STD_ROM_FN(Drvu) - -static struct BurnRomInfo Drvu2RomDesc[] = { - { "uc4.9m", 0x08000, 0x89ee8e17, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "uc3.8m", 0x04000, 0x72a1a529, BRF_ESS | BRF_PRG }, // 1 - - { "cd02.9f", 0x04000, 0xf9cc4a74, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "vt01.5d", 0x04000, 0x505726e0, BRF_GRA }, // 3 Characters - - { "vt11.5a", 0x04000, 0x7b2e1b48, BRF_GRA }, // 4 Tiles - { "vt12.6a", 0x04000, 0x81b417d3, BRF_GRA }, // 5 - { "vt13.7a", 0x04000, 0x5612dbd2, BRF_GRA }, // 6 - { "vt14.8a", 0x04000, 0x2b2dee36, BRF_GRA }, // 7 - { "vt15.9a", 0x04000, 0xde70babf, BRF_GRA }, // 8 - { "vt16.10a", 0x04000, 0x14178237, BRF_GRA }, // 9 - - { "vt05.7e", 0x04000, 0x79f16e3d, BRF_GRA }, // 10 Sprites - { "vt06.8e", 0x04000, 0x26fee521, BRF_GRA }, // 11 - { "vt07.9e", 0x04000, 0xca88bdfd, BRF_GRA }, // 12 - { "vt08.7h", 0x04000, 0x2019c883, BRF_GRA }, // 13 - { "vt09.8h", 0x04000, 0x98703982, BRF_GRA }, // 14 - { "vt10.9h", 0x04000, 0xf069d2f8, BRF_GRA }, // 15 - - { "vtb-1.1d", 0x00100, 0x3aba15a1, BRF_GRA }, // 16 PROMs - { "vtb-2.2d", 0x00100, 0x88865754, BRF_GRA }, // 17 - { "vtb-3.3d", 0x00100, 0x4c14c3f6, BRF_GRA }, // 18 - { "vtb-4.1h", 0x00100, 0xb388c246, BRF_GRA }, // 19 - { "vtb-5.6l", 0x00100, 0x712ac508, BRF_GRA }, // 20 - { "vtb-6.6e", 0x00100, 0x0eaf5158, BRF_GRA }, // 21 -}; - -STD_ROM_PICK(Drvu2) -STD_ROM_FN(Drvu2) - -static struct BurnRomInfo DrvjRomDesc[] = { - { "so04.9m", 0x08000, 0xd3f2bfb3, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "so03.8m", 0x04000, 0xed01f472, BRF_ESS | BRF_PRG }, // 1 - - { "so02.9f", 0x04000, 0xca20aca5, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "vt01.5d", 0x04000, 0x505726e0, BRF_GRA }, // 3 Characters - - { "vt11.5a", 0x04000, 0x7b2e1b48, BRF_GRA }, // 4 Tiles - { "vt12.6a", 0x04000, 0x81b417d3, BRF_GRA }, // 5 - { "vt13.7a", 0x04000, 0x5612dbd2, BRF_GRA }, // 6 - { "vt14.8a", 0x04000, 0x2b2dee36, BRF_GRA }, // 7 - { "vt15.9a", 0x04000, 0xde70babf, BRF_GRA }, // 8 - { "vt16.10a", 0x04000, 0x14178237, BRF_GRA }, // 9 - - { "vt05.7e", 0x04000, 0x79f16e3d, BRF_GRA }, // 10 Sprites - { "vt06.8e", 0x04000, 0x26fee521, BRF_GRA }, // 11 - { "vt07.9e", 0x04000, 0xca88bdfd, BRF_GRA }, // 12 - { "vt08.7h", 0x04000, 0x2019c883, BRF_GRA }, // 13 - { "vt09.8h", 0x04000, 0x98703982, BRF_GRA }, // 14 - { "vt10.9h", 0x04000, 0xf069d2f8, BRF_GRA }, // 15 - - { "vtb1.1d", 0x00100, 0x3aba15a1, BRF_GRA }, // 16 PROMs - { "vtb2.2d", 0x00100, 0x88865754, BRF_GRA }, // 17 - { "vtb3.3d", 0x00100, 0x4c14c3f6, BRF_GRA }, // 18 - { "vtb4.1h", 0x00100, 0xb388c246, BRF_GRA }, // 19 - { "vtb5.6l", 0x00100, 0x712ac508, BRF_GRA }, // 20 - { "vtb6.6e", 0x00100, 0x0eaf5158, BRF_GRA }, // 21 -}; - -STD_ROM_PICK(Drvj) -STD_ROM_FN(Drvj) - -static struct BurnRomInfo DrvbRomDesc[] = { - { "commandob_04_9m_27256.bin", 0x08000, 0x348a7654, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "cm03.8m", 0x04000, 0x35486542, BRF_ESS | BRF_PRG }, // 1 - - { "cm02.9f", 0x04000, 0xf9cc4a74, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "vt01.5d", 0x04000, 0x505726e0, BRF_GRA }, // 3 Characters - - { "vt11.5a", 0x04000, 0x7b2e1b48, BRF_GRA }, // 4 Tiles - { "vt12.6a", 0x04000, 0x81b417d3, BRF_GRA }, // 5 - { "vt13.7a", 0x04000, 0x5612dbd2, BRF_GRA }, // 6 - { "vt14.8a", 0x04000, 0x2b2dee36, BRF_GRA }, // 7 - { "vt15.9a", 0x04000, 0xde70babf, BRF_GRA }, // 8 - { "vt16.10a", 0x04000, 0x14178237, BRF_GRA }, // 9 - - { "vt05.7e", 0x04000, 0x79f16e3d, BRF_GRA }, // 10 Sprites - { "vt06.8e", 0x04000, 0x26fee521, BRF_GRA }, // 11 - { "vt07.9e", 0x04000, 0xca88bdfd, BRF_GRA }, // 12 - { "vt08.7h", 0x04000, 0x2019c883, BRF_GRA }, // 13 - { "vt09.8h", 0x04000, 0x98703982, BRF_GRA }, // 14 - { "vt10.9h", 0x04000, 0xf069d2f8, BRF_GRA }, // 15 - - { "vtb1.1d", 0x00100, 0x3aba15a1, BRF_GRA }, // 16 PROMs - { "vtb2.2d", 0x00100, 0x88865754, BRF_GRA }, // 17 - { "vtb3.3d", 0x00100, 0x4c14c3f6, BRF_GRA }, // 18 - { "vtb4.1h", 0x00100, 0xb388c246, BRF_GRA }, // 19 - { "vtb5.6l", 0x00100, 0x712ac508, BRF_GRA }, // 20 - { "vtb6.6e", 0x00100, 0x0eaf5158, BRF_GRA }, // 21 - - { "commandob_pal16l8a.bin", 0x00104, 0x00000000, BRF_OPT | BRF_NODUMP }, // 22 PLDs -}; - -STD_ROM_PICK(Drvb) -STD_ROM_FN(Drvb) - -static struct BurnRomInfo Drvb2RomDesc[] = { - { "10", 0x08000, 0xab5d1469, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "11", 0x04000, 0xd1a43ba1, BRF_ESS | BRF_PRG }, // 1 - - { "8(so02.9f)", 0x04000, 0xca20aca5, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "7(vt01.5d)", 0x04000, 0x505726e0, BRF_GRA }, // 3 Characters - - { "17(vt11.5a)", 0x04000, 0x7b2e1b48, BRF_GRA }, // 4 Tiles - { "16(vt12.6a)", 0x04000, 0x81b417d3, BRF_GRA }, // 5 - { "15(vt13.7a)", 0x04000, 0x5612dbd2, BRF_GRA }, // 6 - { "14(vt14.8a)", 0x04000, 0x2b2dee36, BRF_GRA }, // 7 - { "13(vt15.9a)", 0x04000, 0xde70babf, BRF_GRA }, // 8 - { "12(vt16.10a)", 0x04000, 0x14178237, BRF_GRA }, // 9 - - { "3(vt05.7e)", 0x04000, 0x79f16e3d, BRF_GRA }, // 10 Sprites - { "2(vt06.8e)", 0x04000, 0x26fee521, BRF_GRA }, // 11 - { "1(vt07.9e)", 0x04000, 0xca88bdfd, BRF_GRA }, // 12 - { "6(vt08.7h)", 0x04000, 0x2019c883, BRF_GRA }, // 13 - { "5(vt09.8h)", 0x04000, 0x98703982, BRF_GRA }, // 14 - { "4(vt10.9h)", 0x04000, 0xf069d2f8, BRF_GRA }, // 15 - - { "vtb1.1d", 0x00100, 0x3aba15a1, BRF_GRA }, // 16 PROMs - { "vtb2.2d", 0x00100, 0x88865754, BRF_GRA }, // 17 - { "vtb3.3d", 0x00100, 0x4c14c3f6, BRF_GRA }, // 18 - { "vtb4.1h", 0x00100, 0xb388c246, BRF_GRA }, // 19 - { "vtb5.6l", 0x00100, 0x712ac508, BRF_GRA }, // 20 - { "vtb6.6e", 0x00100, 0x0eaf5158, BRF_GRA }, // 21 - - { "commandob2_pal16l8.bin", 0x00104, 0xbdbcaf02, BRF_OPT }, // 22 PLDs -}; - -STD_ROM_PICK(Drvb2) -STD_ROM_FN(Drvb2) - -static struct BurnRomInfo SinvasnRomDesc[] = { - { "sp04.9m", 0x08000, 0x33f9601e, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "sp03.8m", 0x04000, 0xc7fb43b3, BRF_ESS | BRF_PRG }, // 1 - - { "u2.9f", 0x04000, 0xcbf8c40e, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "u1.5d", 0x04000, 0xf477e13a, BRF_GRA }, // 3 Characters - - { "vt11.5a", 0x04000, 0x7b2e1b48, BRF_GRA }, // 4 Tiles - { "vt12.6a", 0x04000, 0x81b417d3, BRF_GRA }, // 5 - { "vt13.7a", 0x04000, 0x5612dbd2, BRF_GRA }, // 6 - { "vt14.8a", 0x04000, 0x2b2dee36, BRF_GRA }, // 7 - { "vt15.9a", 0x04000, 0xde70babf, BRF_GRA }, // 8 - { "vt16.10a", 0x04000, 0x14178237, BRF_GRA }, // 9 - - { "u5.e7", 0x04000, 0x2a97c933, BRF_GRA }, // 10 Sprites - { "sp06.e8", 0x04000, 0xd7887212, BRF_GRA }, // 11 - { "sp07.e9", 0x04000, 0x9abe7a20, BRF_GRA }, // 12 - { "u8.h7", 0x04000, 0xd6b4aa2e, BRF_GRA }, // 13 - { "sp09.h8", 0x04000, 0x3985b318, BRF_GRA }, // 14 - { "sp10.h9", 0x04000, 0x3c131b0f, BRF_GRA }, // 15 - - { "vtb1.1d", 0x00100, 0x3aba15a1, BRF_GRA }, // 16 PROMs - { "vtb2.2d", 0x00100, 0x88865754, BRF_GRA }, // 17 - { "vtb3.3d", 0x00100, 0x4c14c3f6, BRF_GRA }, // 18 - { "vtb4.1h", 0x00100, 0xb388c246, BRF_GRA }, // 19 - { "vtb5.6l", 0x00100, 0x712ac508, BRF_GRA }, // 20 - { "vtb6.6e", 0x00100, 0x0eaf5158, BRF_GRA }, // 21 -}; - -STD_ROM_PICK(Sinvasn) -STD_ROM_FN(Sinvasn) - -static struct BurnRomInfo SinvasnbRomDesc[] = { - { "u4", 0x08000, 0x834ba0de, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "u3", 0x04000, 0x07e4ee3a, BRF_ESS | BRF_PRG }, // 1 - - { "u2", 0x04000, 0xcbf8c40e, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "u1", 0x04000, 0xf477e13a, BRF_GRA }, // 3 Characters - - { "vt11.5a", 0x04000, 0x7b2e1b48, BRF_GRA }, // 4 Tiles - { "vt12.6a", 0x04000, 0x81b417d3, BRF_GRA }, // 5 - { "vt13.7a", 0x04000, 0x5612dbd2, BRF_GRA }, // 6 - { "vt14.8a", 0x04000, 0x2b2dee36, BRF_GRA }, // 7 - { "vt15.9a", 0x04000, 0xde70babf, BRF_GRA }, // 8 - { "vt16.10a", 0x04000, 0x14178237, BRF_GRA }, // 9 - - { "u5", 0x04000, 0x2a97c933, BRF_GRA }, // 10 Sprites - { "vt06.e8", 0x04000, 0x26fee521, BRF_GRA }, // 11 - { "vt07.e9", 0x04000, 0xca88bdfd, BRF_GRA }, // 12 - { "u8", 0x04000, 0xd6b4aa2e, BRF_GRA }, // 13 - { "vt09.h8", 0x04000, 0x98703982, BRF_GRA }, // 14 - { "vt10.h9", 0x04000, 0xf069d2f8, BRF_GRA }, // 15 - - { "vtb1.1d", 0x00100, 0x3aba15a1, BRF_GRA }, // 16 PROMs - { "vtb2.2d", 0x00100, 0x88865754, BRF_GRA }, // 17 - { "vtb3.3d", 0x00100, 0x4c14c3f6, BRF_GRA }, // 18 - { "vtb4.1h", 0x00100, 0xb388c246, BRF_GRA }, // 19 - { "vtb5.6l", 0x00100, 0x712ac508, BRF_GRA }, // 20 - { "vtb6.6e", 0x00100, 0x0eaf5158, BRF_GRA }, // 21 -}; - -STD_ROM_PICK(Sinvasnb) -STD_ROM_FN(Sinvasnb) - -static struct BurnRomInfo MercenarioRomDesc[] = { - { "4ac.bin", 0x04000, 0x59ebf408, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "4bc.bin", 0x04000, 0xaca99905, BRF_ESS | BRF_PRG }, // 1 - { "3c.8m", 0x04000, 0xf998d08a, BRF_ESS | BRF_PRG }, // 1 - - { "cm02.9f", 0x04000, 0xf9cc4a74, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program // 2c.9f - - { "1c.5d", 0x04000, 0xfe3ebe35, BRF_GRA }, // 3 Characters - - { "vt11.5a", 0x04000, 0x7b2e1b48, BRF_GRA }, // 4 Tiles // 11c.5a - { "vt12.6a", 0x04000, 0x81b417d3, BRF_GRA }, // 5 // 12c.6a - { "vt13.7a", 0x04000, 0x5612dbd2, BRF_GRA }, // 6 // 13c.7a - { "vt14.8a", 0x04000, 0x2b2dee36, BRF_GRA }, // 7 // 14c.8a - { "vt15.9a", 0x04000, 0xde70babf, BRF_GRA }, // 8 // 15c.9a - { "vt16.10a", 0x04000, 0x14178237, BRF_GRA }, // 9 // 16c.10a - - { "vt05.7e", 0x04000, 0x79f16e3d, BRF_GRA }, // 10 Sprites // 5c.7e - { "vt06.8e", 0x04000, 0x26fee521, BRF_GRA }, // 11 // 6c.8e - { "vt07.9e", 0x04000, 0xca88bdfd, BRF_GRA }, // 12 // 7c.9e - { "vt08.7h", 0x04000, 0x2019c883, BRF_GRA }, // 13 // 8c.7h - { "vt09.8h", 0x04000, 0x98703982, BRF_GRA }, // 14 // 9c.8h - { "vt10.9h", 0x04000, 0xf069d2f8, BRF_GRA }, // 15 // 10c.9h - - { "vtb1.1d", 0x00100, 0x3aba15a1, BRF_GRA }, // 16 PROMs - { "vtb2.2d", 0x00100, 0x88865754, BRF_GRA }, // 17 - { "vtb3.3d", 0x00100, 0x4c14c3f6, BRF_GRA }, // 18 - { "vtb4.1h", 0x00100, 0xb388c246, BRF_GRA }, // 19 - { "vtb5.6l", 0x00100, 0x712ac508, BRF_GRA }, // 20 - { "vtb6.6e", 0x00100, 0x0eaf5158, BRF_GRA }, // 21 -}; - -STD_ROM_PICK(Mercenario) -STD_ROM_FN(Mercenario) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom1 = Next; Next += 0x0c000; - DrvZ80Rom1Op = Next; Next += 0x0c000; - DrvZ80Rom2 = Next; Next += 0x04000; - DrvPromRed = Next; Next += 0x00100; - DrvPromGreen = Next; Next += 0x00100; - DrvPromBlue = Next; Next += 0x00100; - - RamStart = Next; - - DrvZ80Ram1 = Next; Next += 0x01e00; - DrvZ80Ram2 = Next; Next += 0x00800; - DrvSpriteRam = Next; Next += 0x00180; - DrvSpriteRamBuffer = Next; Next += 0x00180; - DrvBgVideoRam = Next; Next += 0x00400; - DrvBgColourRam = Next; Next += 0x00400; - DrvFgVideoRam = Next; Next += 0x00400; - DrvFgColourRam = Next; Next += 0x00400; - - RamEnd = Next; - - DrvChars = Next; Next += 0x400 * 8 * 8; - DrvTiles = Next; Next += 0x400 * 16 * 16; - DrvSprites = Next; Next += 0x300 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00100 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - BurnYM2203Reset(); - - DrvBgScrollX[0] = DrvBgScrollX[1] = 0; - DrvBgScrollY[0] = DrvBgScrollY[1] = 0; - DrvFlipScreen = 0; - DrvSoundLatch = 0; - - HiscoreReset(); - - return 0; -} - -UINT8 __fastcall CommandoRead1(UINT16 a) -{ - switch (a) { - case 0xc000: { - return 0xff - DrvInput[0]; - } - - case 0xc001: { - return 0xff - DrvInput[1]; - } - - case 0xc002: { - return 0xff - DrvInput[2]; - } - - case 0xc003: { - return DrvDip[0]; - } - - case 0xc004: { - return DrvDip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall CommandoWrite1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xc800: { - DrvSoundLatch = d; - return; - } - - case 0xc804: { - DrvFlipScreen = d & 0x80; - - if (d & 0x10) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - - return; - } - - case 0xc806: { - // ??? - return; - } - - case 0xc808: { - DrvBgScrollX[0] = d; - return; - } - - case 0xc809: { - DrvBgScrollX[1] = d; - return; - } - - case 0xc80a: { - DrvBgScrollY[0] = d; - return; - } - - case 0xc80b: { - DrvBgScrollY[1] = d; - return; - } - - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall CommandoRead2(UINT16 a) -{ - switch (a) { - case 0x6000: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall CommandoWrite2(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x8000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x8001: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0x8002: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0x8003: { - BurnYM2203Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 3000000); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3000000; -} - -static INT32 CharPlaneOffsets[2] = { 4, 0 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 8, 9, 10, 11 }; -static INT32 CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 TilePlaneOffsets[3] = { 0, 0x40000, 0x80000 }; -static INT32 TileXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 TileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 SpritePlaneOffsets[4] = { 0x60004, 0x60000, 4, 0 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 8, 9, 10, 11, 256, 257, 258, 259, 264, 265, 266, 267 }; -static INT32 SpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x08000, 1, 1); if (nRet != 0) return 1; - - if (bFirstOpCodeEncrypted) { - for (INT32 A = 0; A < 0xc000; A++) { - INT32 src; - - src = DrvZ80Rom1[A]; - DrvZ80Rom1Op[A] = (src & 0x11) | ((src & 0xe0) >> 4) | ((src & 0x0e) << 4); - } - } else { - DrvZ80Rom1Op[0] = DrvZ80Rom1[0]; - for (INT32 A = 1; A < 0xc000; A++) { - INT32 src; - - src = DrvZ80Rom1[A]; - DrvZ80Rom1Op[A] = (src & 0x11) | ((src & 0xe0) >> 4) | ((src & 0x0e) << 4); - } - } - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 2, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 3, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x18000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x14000, 9, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 3, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x18000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x14000, 15, 1); if (nRet != 0) return 1; - GfxDecode(0x300, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromRed, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromGreen, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBlue, 18, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(CommandoRead1); - ZetSetWriteHandler(CommandoWrite1); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom1Op, DrvZ80Rom1 ); - ZetMapArea(0xd000, 0xd3ff, 0, DrvFgVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 1, DrvFgVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 2, DrvFgVideoRam ); - ZetMapArea(0xd400, 0xd7ff, 0, DrvFgColourRam ); - ZetMapArea(0xd400, 0xd7ff, 1, DrvFgColourRam ); - ZetMapArea(0xd400, 0xd7ff, 2, DrvFgColourRam ); - ZetMapArea(0xd800, 0xdbff, 0, DrvBgVideoRam ); - ZetMapArea(0xd800, 0xdbff, 1, DrvBgVideoRam ); - ZetMapArea(0xd800, 0xdbff, 2, DrvBgVideoRam ); - ZetMapArea(0xdc00, 0xdfff, 0, DrvBgColourRam ); - ZetMapArea(0xdc00, 0xdfff, 1, DrvBgColourRam ); - ZetMapArea(0xdc00, 0xdfff, 2, DrvBgColourRam ); - ZetMapArea(0xe000, 0xfdff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xfdff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xfdff, 2, DrvZ80Ram1 ); - ZetMapArea(0xfe00, 0xff7f, 0, DrvSpriteRam ); - ZetMapArea(0xfe00, 0xff7f, 1, DrvSpriteRam ); - ZetMapArea(0xfe00, 0xff7f, 2, DrvSpriteRam ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(CommandoRead2); - ZetSetWriteHandler(CommandoWrite2); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80Rom2 ); - ZetMapArea(0x4000, 0x47ff, 0, DrvZ80Ram2 ); - ZetMapArea(0x4000, 0x47ff, 1, DrvZ80Ram2 ); - ZetMapArea(0x4000, 0x47ff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 MercenarioInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x08000, 2, 1); if (nRet != 0) return 1; - - for (INT32 A = 0; A < 0xc000; A++) - { - INT32 src = DrvZ80Rom1[A]; - DrvZ80Rom1Op[A] = (src & 0x11) | ((src & 0xe0) >> 4) | ((src & 0x0e) << 4); - } - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 4, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x18000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x14000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 3, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x18000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x14000, 16, 1); if (nRet != 0) return 1; - GfxDecode(0x300, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromRed, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromGreen, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromBlue, 19, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(CommandoRead1); - ZetSetWriteHandler(CommandoWrite1); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom1Op, DrvZ80Rom1 ); - ZetMapArea(0xd000, 0xd3ff, 0, DrvFgVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 1, DrvFgVideoRam ); - ZetMapArea(0xd000, 0xd3ff, 2, DrvFgVideoRam ); - ZetMapArea(0xd400, 0xd7ff, 0, DrvFgColourRam ); - ZetMapArea(0xd400, 0xd7ff, 1, DrvFgColourRam ); - ZetMapArea(0xd400, 0xd7ff, 2, DrvFgColourRam ); - ZetMapArea(0xd800, 0xdbff, 0, DrvBgVideoRam ); - ZetMapArea(0xd800, 0xdbff, 1, DrvBgVideoRam ); - ZetMapArea(0xd800, 0xdbff, 2, DrvBgVideoRam ); - ZetMapArea(0xdc00, 0xdfff, 0, DrvBgColourRam ); - ZetMapArea(0xdc00, 0xdfff, 1, DrvBgColourRam ); - ZetMapArea(0xdc00, 0xdfff, 2, DrvBgColourRam ); - ZetMapArea(0xe000, 0xfdff, 0, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xfdff, 1, DrvZ80Ram1 ); - ZetMapArea(0xe000, 0xfdff, 2, DrvZ80Ram1 ); - ZetMapArea(0xfe00, 0xff7f, 0, DrvSpriteRam ); - ZetMapArea(0xfe00, 0xff7f, 1, DrvSpriteRam ); - ZetMapArea(0xfe00, 0xff7f, 2, DrvSpriteRam ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(CommandoRead2); - ZetSetWriteHandler(CommandoWrite2); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80Rom2 ); - ZetMapArea(0x4000, 0x47ff, 0, DrvZ80Ram2 ); - ZetMapArea(0x4000, 0x47ff, 1, DrvZ80Ram2 ); - ZetMapArea(0x4000, 0x47ff, 2, DrvZ80Ram2 ); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 BootlegInit() -{ - bFirstOpCodeEncrypted = true; - - return DrvInit(); -} - -static INT32 DrvExit() -{ - ZetExit(); - BurnYM2203Exit(); - - GenericTilesExit(); - - BurnFree(Mem); - - DrvBgScrollX[0] = DrvBgScrollX[1] = 0; - DrvBgScrollY[0] = DrvBgScrollY[1] = 0; - DrvFlipScreen = 0; - DrvSoundLatch = 0; - - bFirstOpCodeEncrypted = false; - - return 0; -} - -static void DrvCalcPalette() -{ - for (INT32 i = 0; i < 256; i++) { - INT32 bit0, bit1, bit2, bit3, r, g, b; - - bit0 = (DrvPromRed[i] >> 0) & 0x01; - bit1 = (DrvPromRed[i] >> 1) & 0x01; - bit2 = (DrvPromRed[i] >> 2) & 0x01; - bit3 = (DrvPromRed[i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvPromGreen[i] >> 0) & 0x01; - bit1 = (DrvPromGreen[i] >> 1) & 0x01; - bit2 = (DrvPromGreen[i] >> 2) & 0x01; - bit3 = (DrvPromGreen[i] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvPromBlue[i] >> 0) & 0x01; - bit1 = (DrvPromBlue[i] >> 1) & 0x01; - bit2 = (DrvPromBlue[i] >> 2) & 0x01; - bit3 = (DrvPromBlue[i] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void DrvRenderBgLayer() -{ - INT32 mx, my, Code, Colour, Attr, x, y, TileIndex, xScroll, yScroll, Flip, xFlip, yFlip; - - xScroll = DrvBgScrollX[0] | (DrvBgScrollX[1] << 8); - xScroll &= 0x3ff; - - yScroll = DrvBgScrollY[0] | (DrvBgScrollY[1] << 8); - yScroll &= 0x3ff; - - for (mx = 0; mx < 32; mx++) { - for (my = 0; my < 32; my++) { - TileIndex = (my * 32) + mx; - - Attr = DrvBgColourRam[TileIndex]; - Code = DrvBgVideoRam[TileIndex] + ((Attr & 0xc0) << 2); - Colour = Attr & 0x0f; - Code &= 0x3ff; - Flip = (Attr & 0x30) >> 4; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - y = 16 * mx; - x = 16 * my; - - y -= 16; - - x -= xScroll; - y -= yScroll; - if (x < -16) x += 512; - if (y < -16) y += 512; - - if (DrvFlipScreen) { - x = 240 - x; - y = 208 - y; - xFlip = !xFlip; - yFlip = !yFlip; - } - - if (x > 0 && x < 240 && y > 0 && y < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } else { - Render16x16Tile_FlipX(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } else { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } else { - Render16x16Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } - } - } - } - } -} - -static void DrvRenderSprites() -{ - for (INT32 Offset = 0x180 - 4; Offset >= 0; Offset -= 4) { - INT32 Attr = DrvSpriteRamBuffer[Offset + 1]; - INT32 Bank = (Attr & 0xc0) >> 6; - INT32 Code = DrvSpriteRamBuffer[Offset + 0] + (Bank << 8); - INT32 Colour = (Attr & 0x30) >> 4; - INT32 xFlip = Attr & 0x04; - INT32 yFlip = Attr & 0x08; - INT32 x = DrvSpriteRamBuffer[Offset + 3] - ((Attr & 0x01) << 8); - INT32 y = DrvSpriteRamBuffer[Offset + 2]; - - y -= 16; - - if (DrvFlipScreen) { - x = 240 - x; - y = 208 - y; - xFlip = !xFlip; - yFlip = !yFlip; - } - - if (Bank < 3) { - if (x > 0 && x < 240 && y > 0 && y < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0x0f, 128, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0x0f, 128, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0x0f, 128, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0x0f, 128, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 128, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 128, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 128, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 128, DrvSprites); - } - } - } - } - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Code, Colour, Attr, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Attr = DrvFgColourRam[TileIndex]; - Code = DrvFgVideoRam[TileIndex] + ((Attr & 0xc0) << 2); - Colour = Attr & 0x0f; - Code &= 0x3ff; - Flip = (Attr & 0x30) >> 4; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - y -= 16; - - if (DrvFlipScreen) { - x = 248 - x; - y = 216 - y; - xFlip = !xFlip; - yFlip = !yFlip; - } - - if (x > 0 && x < 248 && y > 0 && y < 216) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 2, 3, 192, DrvChars); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 2, 3, 192, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 2, 3, 192, DrvChars); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 2, 3, 192, DrvChars); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 192, DrvChars); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 192, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 192, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 192, DrvChars); - } - } - } - - TileIndex++; - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - DrvRenderBgLayer(); - DrvRenderSprites(); - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 278; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 4000000 / 60; - nCyclesTotal[1] = 3000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 274) { // vblank rising edge - memcpy(DrvSpriteRamBuffer, DrvSpriteRam, 0x180); - ZetSetVector(0xd7); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - if (i == 276) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - BurnTimerUpdate((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - // execute IRQ quarterly 68.5 (or 69) is 25% of 278 (nInterleave) - if (i%69 == 0 && i>0) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - // execute CPU_IRQSTATUS_NONE 1 interleave past the last one - if ((i-1)%69 == 0 && i>1) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) DrvDraw(); - - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029693; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); // Scan Z80 - BurnYM2203Scan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvBgScrollX); - SCAN_VAR(DrvBgScrollY); - SCAN_VAR(DrvFlipScreen); - SCAN_VAR(DrvDip); - SCAN_VAR(DrvInput); - } - - return 0; -} - -struct BurnDriver BurnDrvCommando = { - "commando", NULL, NULL, NULL, "1985", - "Commando (World)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCommandu = { - "commandou", "commando", NULL, NULL, "1985", - "Commando (US, set 1)\0", NULL, "Capcom (Data East USA license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvuRomInfo, DrvuRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCommandu2 = { - "commandou2", "commando", NULL, NULL, "1985", - "Commando (US, set 2)\0", NULL, "Capcom (Data East USA license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, Drvu2RomInfo, Drvu2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCommandj = { - "commandoj", "commando", NULL, NULL, "1985", - "Senjou no Ookami\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvjRomInfo, DrvjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCommandb = { - "commandob", "commando", NULL, NULL, "1985", - "Commando (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, DrvbRomInfo, DrvbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - BootlegInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvCommandb2 = { - "commandob2", "commando", NULL, NULL, "1985", - "Commando (bootleg 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, Drvb2RomInfo, Drvb2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSinvasn = { - "sinvasn", "commando", NULL, NULL, "1985", - "Space Invasion (Europe)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, SinvasnRomInfo, SinvasnRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSinvasnb = { - "sinvasnb", "commando", NULL, NULL, "1985", - "Space Invasion (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, SinvasnbRomInfo, SinvasnbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - BootlegInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMercenario = { - "mercenario", "commando", NULL, NULL, "1985", - "Mercenario (Commando bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, MercenarioRomInfo, MercenarioRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - MercenarioInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_cybertnk.cpp b/jan/src/burn/drv/pre90s/d_cybertnk.cpp deleted file mode 100644 index 3ad8d4e96..000000000 --- a/jan/src/burn/drv/pre90s/d_cybertnk.cpp +++ /dev/null @@ -1,1092 +0,0 @@ -// FB Alpha Cyber Tank driver module -// Based on MAME driver by Angelo Salese and David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_y8950.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM0; -static UINT8 *Drv68KROM1; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM0; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvVidRAM2; -static UINT8 *DrvPalRAM; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvRoadRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvZ80RAM; - -static UINT8 *DrvTransTab0; -static UINT8 *DrvTransTab1; -static UINT8 *DrvTransTab2; -static UINT8 *DrvTransTab3; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 *DrvScroll0; -static UINT16 *DrvScroll1; -static UINT16 *DrvScroll2; -static UINT8 *soundlatch; - -static UINT8 mux_data; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[5]; -static UINT8 DrvInputs[2]; -static UINT16 DrvAnalog0; -static UINT16 DrvAnalog1; -static UINT16 DrvAnalog2; -static UINT8 DrvAccel; // fake input for accel control - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo CybertnkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start" }, - - A("P1 Handle", BIT_ANALOG_REL, &DrvAnalog0, "p1 x-axis" ), - {"P1 Accel", BIT_DIGITAL, &DrvAccel, "p1 fire 3" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - - A("P2 Gun L-R", BIT_ANALOG_REL, &DrvAnalog1, "p2 x-axis" ), - A("P2 Gun U-D", BIT_ANALOG_REL, &DrvAnalog2, "p2 y-axis" ), - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, - {"Dip E", BIT_DIPSWITCH, DrvDips + 4, "dip" }, -}; - -STDINPUTINFO(Cybertnk) - -#undef A - -static struct BurnDIPInfo CybertnkDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x08, NULL }, - {0x0f, 0xff, 0xff, 0xe4, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x08, 0x08, "Off" }, - {0x0e, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0f, 0x01, 0x01, 0x01, "Off" }, - {0x0f, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0f, 0x01, 0x0c, 0x0c, "Very Easy" }, - {0x0f, 0x01, 0x0c, 0x04, "Easy" }, - {0x0f, 0x01, 0x0c, 0x08, "Hard" }, - {0x0f, 0x01, 0x0c, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Coin B Value" }, - {0x0f, 0x01, 0x10, 0x10, "Set by Dipswitches" }, - {0x0f, 0x01, 0x10, 0x00, "Same Value as Coin A" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Credits to Start" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "5 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, -}; - -STDDIPINFO(Cybertnk) - -static inline void DrvPaletteUpdate(INT32 offset) -{ - UINT16 p = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + offset))); - - INT32 r = (p >> 0) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset / 2] = BurnHighCol(r, g, b, 0); -} - -static void __fastcall cybertnk_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffc000) == 0x100000) { - DrvPalRAM[(address & 0x3fff) ^ 1] = data; - DrvPaletteUpdate(address & 0x3ffe); - return; - } - - switch (address) - { - case 0x110001: - *soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x110003: // watchdog? - return; - - case 0x110007: - mux_data = (data & 0x60) >> 5; - return; - - case 0x11000d: - SekSetIRQLine(1, CPU_IRQSTATUS_NONE); - return; - } -} - -static void __fastcall cybertnk_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffc000) == 0x100000) { - *(UINT16*)(DrvPalRAM + (address & 0x3ffe)) = BURN_ENDIAN_SWAP_INT16(data); - DrvPaletteUpdate(address & 0x3ffe); - return; - } - - switch (address) - { - case 0x110040: - case 0x110042: - case 0x110044: - DrvScroll0[(address / 2) & 3] = BURN_ENDIAN_SWAP_INT16(data); - return; - - case 0x110048: - case 0x11004a: - case 0x11004c: - DrvScroll1[(address / 2) & 3] = BURN_ENDIAN_SWAP_INT16(data); - return; - - case 0x110080: - case 0x110082: - case 0x110084: - DrvScroll2[(address / 2) & 3] = BURN_ENDIAN_SWAP_INT16(data); - return; - } -} - -static UINT8 __fastcall cybertnk_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x110002: - return DrvDips[2]; - - case 0x110003: - return DrvDips[1]; - - case 0x110004: - return 0; // i/o status - - case 0x110006: - return (DrvInputs[0] & ~0x08) | (DrvDips[0] & 0x08); - - case 0x110007: - return ~0; - - case 0x110008: - return ~0; - - case 0x110009: - return DrvInputs[1]; - - case 0x11000a: - return DrvDips[4]; - - case 0x11000b: - return DrvDips[3]; - - case 0x1100d5: { - switch (mux_data) { - case 0x00: { - UINT8 Temp = DrvAnalog1 >> 4; - Temp += 0x7f; - return ~Temp - 1; - } - - case 0x01: { - UINT8 Temp = DrvAnalog2 >> 4; - Temp += 0x7f; - return ~Temp - 1; - } - - case 0x02: { - if (DrvAccel) return 0xff; - return 0x00; - } - - case 0x03: { - UINT8 Temp = DrvAnalog0 >> 4; - Temp += 0x7f; - return ~Temp - 1; - } - } - return 0; - } - } - - return 0; -} - -static UINT16 __fastcall cybertnk_main_read_word(UINT32 /*address*/) -{ - return 0; -} - -static void __fastcall cybertnk_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - BurnY8950Write(0, address & 1, data); - return; - - case 0xc000: - case 0xc001: - BurnY8950Write(1, address & 1, data); - return; - } -} - -static UINT8 __fastcall cybertnk_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return BurnY8950Read(0, address & 1); - - case 0xa001: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xc000: - case 0xc001: - return BurnY8950Read(1, address & 1); - } - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM0 = Next; Next += 0x040000; - Drv68KROM1 = Next; Next += 0x020000; - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x080000; - DrvGfxROM4 = Next; Next += 0x200000; - - DrvTransTab0 = Next; Next += 0x080000 / (8 * 8); - DrvTransTab1 = Next; Next += 0x080000 / (8 * 8); - DrvTransTab2 = Next; Next += 0x080000 / (8 * 8); - DrvTransTab3 = Next; Next += 0x080000 / (1 * 1024); - - DrvSndROM0 = Next; Next += 0x040000; - DrvSndROM1 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x2002 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x008000; - DrvSprRAM = Next; Next += 0x001000; - DrvVidRAM0 = Next; Next += 0x002000; - DrvVidRAM1 = Next; Next += 0x002000; - DrvVidRAM2 = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x008000; - - DrvScroll0 = (UINT16*)Next; Next += 0x0004 * sizeof(UINT16); - DrvScroll1 = (UINT16*)Next; Next += 0x0004 * sizeof(UINT16); - DrvScroll2 = (UINT16*)Next; Next += 0x0004 * sizeof(UINT16); - - Drv68KRAM1 = Next; Next += 0x004000; - DrvRoadRAM = Next; Next += 0x001000; - - DrvShareRAM = Next; Next += 0x001000; - - DrvZ80RAM = Next; Next += 0x002000; - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset(AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - SekOpen(1); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnY8950Reset(); - - mux_data = 0; - - return 0; -} - -static void DrvGfxExpandPlanar(UINT8 *gfx) -{ - static INT32 Planes[4] = { 0x30000 * 8, 0x10000 * 8, 0x20000 * 8, 0x00000 * 8 }; - static INT32 XOffs[8] = { STEP8(0,1) }; - static INT32 YOffs[8] = { STEP8(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - - memcpy (tmp, gfx, 0x40000); - - GfxDecode((0x40000 * (8 / 4)) / (8 * 8), 4, 8, 8, Planes, XOffs, YOffs, 8 * 8, tmp, gfx); - - BurnFree (tmp); -} - -static void DrvGfxExpandPacked(UINT8 *gfx) -{ - for (INT32 i = 0x80000 - 2; i >= 0; i -= 2) { - gfx[i + 0] = gfx[i / 2] >> 4; - gfx[i + 1] = gfx[i / 2] & 0x0f; - } -} - -static void DrvSpriteReorder() -{ - UINT32 *spr = (UINT32*)DrvGfxROM4; - - for (INT32 x = 0; x< 0x200000/4;x++) { - spr[x] = BURN_ENDIAN_SWAP_INT32(BITSWAP32(BURN_ENDIAN_SWAP_INT32(spr[x]), 27,26,25,24, 19,18,17,16, 11,10,9,8, 3,2,1,0, 31,30,29,28, 23,22,21,20, 15,14,13,12, 7,6,5,4 )); - } -} - -static void DrvTranspTabConfig(UINT8 *gfx, UINT8 *tab, INT32 len, INT32 size) -{ - memset (tab, 0, len / size); - - for (INT32 i = 0; i < len; i+= size) - { - INT32 opaque = 0; - tab[i/size] = 0; // transparent - - for (INT32 j = 0; j < size; j++) - { - if (gfx[i+j]) { - tab[i/size] |= 1; - opaque++; - } - } - - if (opaque == size) tab[i/size] |= 2; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM0 + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(Drv68KROM1 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x000000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x020000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x020000, 8, 1)) return 1; - memset (DrvSndROM1 + 0x40000, 0xff, 0x40000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x010000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x030000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x030000, 16, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x030000, 20, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 21, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 22, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x180001, 23, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x180000, 24, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x180003, 25, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x180002, 26, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x100001, 27, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x100000, 28, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x100003, 29, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x100002, 30, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x080001, 31, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x080000, 32, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x080003, 33, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x080002, 34, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000001, 35, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 36, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000003, 37, 4)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000002, 38, 4)) return 1; - - DrvGfxExpandPlanar(DrvGfxROM0); - DrvGfxExpandPlanar(DrvGfxROM1); - DrvGfxExpandPlanar(DrvGfxROM2); - DrvGfxExpandPacked(DrvGfxROM3); - DrvSpriteReorder(); - - DrvTranspTabConfig(DrvGfxROM0, DrvTransTab0, 0x80000, 8*8); - DrvTranspTabConfig(DrvGfxROM1, DrvTransTab1, 0x80000, 8*8); - DrvTranspTabConfig(DrvGfxROM2, DrvTransTab2, 0x80000, 8*8); - DrvTranspTabConfig(DrvGfxROM3, DrvTransTab3, 0x80000, 1024*1); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x080000, 0x087fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x0a0000, 0x0a0fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x0c0000, 0x0c1fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x0c4000, 0x0c5fff, MAP_RAM); - SekMapMemory(DrvVidRAM2, 0x0c8000, 0x0c9fff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x0e0000, 0x0e0fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x100000, 0x103fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x4000,0x104000, 0x107fff, MAP_RAM); // Copy of first half - SekSetWriteByteHandler(0, cybertnk_main_write_byte); - SekSetWriteWordHandler(0, cybertnk_main_write_word); - SekSetReadByteHandler(0, cybertnk_main_read_byte); - SekSetReadWordHandler(0, cybertnk_main_read_word); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Drv68KROM1, 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0x080000, 0x083fff, MAP_RAM); - SekMapMemory(DrvRoadRAM, 0x0c0000, 0x0c0fff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x100000, 0x100fff, MAP_RAM); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x9fff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x9fff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x9fff, 2, DrvZ80RAM); - ZetSetWriteHandler(cybertnk_sound_write); - ZetSetReadHandler(cybertnk_sound_read); - ZetClose(); - - BurnY8950Init(2, 3579545, DrvSndROM0, 0x40000, DrvSndROM1, 0x80000, NULL, &DrvSynchroniseStream, 0); - BurnTimerAttachZetY8950(3579545); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - BurnY8950SetRoute(1, BURN_SND_Y8950_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - - BurnY8950Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(UINT8 *ram_base, UINT8 *gfx_base, UINT16 *scroll_base, UINT8 *transtab, INT32 color_base) -{ - UINT16 *vram = (UINT16*)ram_base; - INT32 scrollx = BURN_ENDIAN_SWAP_INT16(scroll_base[0]) & 0x03ff; - INT32 scrolly = BURN_ENDIAN_SWAP_INT16(scroll_base[2]) & 0x00ff; - - for (INT32 offs = 0; offs < 128 * 32; offs++) - { - INT32 sx = (offs & 0x7f) * 8; - INT32 sy = (offs >> 7) * 8; - - sx -= scrollx; - if (sx < -7) sx += 1024; - sy -= scrolly; - if (sy < -7) sy += 256; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 code = attr & 0x1fff; - INT32 color = ((attr & 0xe000) >> 13) | ((attr & 0x1c00) >> 7); - - INT32 clip = (sy >= 0 && sy < (nScreenHeight - 7) && sx >= 0 && sx < (nScreenWidth - 7)) ? 4: 0; - - switch (transtab[code] + clip) { - case 0: break; - case 4: break; - case 1: Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_base, gfx_base); break; - case 5: Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, color_base, gfx_base); break; - case 3: Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, color_base, gfx_base); break; - case 7: Render8x8Tile(pTransDraw, code, sx, sy, color, 4, color_base, gfx_base); break; - } - } -} - -static void draw_road(INT32 priority) -{ - UINT16 *ram = (UINT16*)DrvRoadRAM; - - for (INT32 i = 0; i < (nScreenHeight * 4); i+=4) - { - INT32 attr = BURN_ENDIAN_SWAP_INT16(ram[i + 1]); - - if ((attr & 0x80) != priority) continue; - - INT32 scroll = BURN_ENDIAN_SWAP_INT16(ram[i + 0]) & 0x03ff; - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[i + 2]) & 0x01ff; - INT32 color = ((attr & 0x3f) << 4) | 0x1000; - - UINT8 *gfx = DrvGfxROM3 + (code * 1024); - UINT16 *dst = pTransDraw + (i / 4) * nScreenWidth; - - if (DrvTransTab3[code] == 0) continue; - - if (scroll <= 0x200) { - gfx += scroll; - - if (DrvTransTab3[code] == 3) { - for (INT32 x = 0; x < nScreenWidth; x++) { - dst[x] = gfx[x] + color; - } - } else { - for (INT32 x = 0; x < nScreenWidth; x++) { - INT32 pxl = gfx[x]; - - if (pxl) { - dst[x] = pxl + color; - } - } - } - } else { - if (DrvTransTab3[code] == 3) { - for (INT32 x = 0; x < nScreenWidth; x++) { - dst[x] = gfx[(x + scroll) & 0x3ff] + color; - } - } else { - for (INT32 x = 0; x < nScreenWidth; x++) { - INT32 pxl = gfx[(x + scroll) & 0x3ff]; - - if (pxl) { - dst[x] = pxl + color; - } - } - } - } - } -} - -static void draw_sprites() // Could probaby be more optimized -{ - UINT16 *spr_ram = (UINT16*)DrvSprRAM; - UINT32 *sprrom = (UINT32*)DrvGfxROM4; - - for (INT32 offs = 0; offs < 0x1000/2; offs+=8) - { - if ((BURN_ENDIAN_SWAP_INT16(spr_ram[offs+0]) & 0x0008) == 0) - continue; - - INT32 spr_offs =((BURN_ENDIAN_SWAP_INT16(spr_ram[offs+0]) & 0x0007) << 16) + BURN_ENDIAN_SWAP_INT16(spr_ram[offs+1]); - INT32 col_bank = (BURN_ENDIAN_SWAP_INT16(spr_ram[offs+0]) & 0xff00) >> 4; - INT32 y = (BURN_ENDIAN_SWAP_INT16(spr_ram[offs+2]) & 0x01ff); - INT32 ysize = (BURN_ENDIAN_SWAP_INT16(spr_ram[offs+4]) & 0x00ff)+1; - INT32 x = (BURN_ENDIAN_SWAP_INT16(spr_ram[offs+5]) & 0x03ff); - INT32 fx = (BURN_ENDIAN_SWAP_INT16(spr_ram[offs+5]) & 0x8000) >> 15; - INT32 xsize =((BURN_ENDIAN_SWAP_INT16(spr_ram[offs+6]) & 0x000f)+1) << 3; - INT32 zoom = (BURN_ENDIAN_SWAP_INT16(spr_ram[offs+6]) & 0xff00) >> 8; - - INT32 xf = 0, yf = 0, xz = 0, yz = 0; - - if (x & 0x200) x -= 0x400; - if (y & 0x100) y -= 0x200; - - for (INT32 yi = 0; yi < ysize; yi++, xf = xz = 0) - { - INT32 yy = y + yz; - - if (yy >= 0 && yy < nScreenHeight) - { - INT32 start, end, inc; - UINT16 *dest = pTransDraw + yy * nScreenWidth; - - if (!fx) - { - start = 0; - end = xsize; - inc = 8; - } - else - { - start = xsize-8; - end = -8; - inc = -8; - } - - for (INT32 xi = start; xi != end; xi+=inc) - { - UINT16 dot; - UINT32 color = BURN_ENDIAN_SWAP_INT32(sprrom[spr_offs+xi/8]); - INT32 shift_pen = 0, x_dec = 0; - - while (x_dec < 8) - { - if (!fx) - { - dot = (color >> shift_pen) & 0xf; - } - else - { - dot = (color >> (28-shift_pen)) & 0xf; - } - - if (dot) - { - INT32 xx = x + xz; - - if (xx >= 0 && xx < nScreenWidth) - { - dest[xx] = col_bank + dot; - } - } - - xf += zoom; - - if (xf >= 0x100) - { - xz++; - xf-=0x100; - } - else - { - shift_pen += 4; - x_dec++; - if (xf >= 0x80) { xz++; xf-=0x80; } - } - } - } - } - - yf += zoom; - - if (yf >= 0x100) - { - yi--; - yz++; - yf -= 0x100; - } - else - { - spr_offs += xsize/8; - if (yf >= 0x80) { yz++; yf-=0x80; } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x4000; i+=2) { - DrvPaletteUpdate(i); - } - DrvRecalc = 0; - } - - DrvPalette[0x2000] = ((nSpriteEnable & 0x3f) == 0x3f) ? BurnHighCol(0x00, 0x00, 0x00, 0) : BurnHighCol(0xff, 0x00, 0xff, 0); // black / magenta - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x2000; - } - - if (nSpriteEnable & 1) draw_road(0x00); - if (nSpriteEnable & 2) draw_layer(DrvVidRAM2, DrvGfxROM2, DrvScroll2, DrvTransTab2, 0x1c00); - if (nSpriteEnable & 4) draw_layer(DrvVidRAM1, DrvGfxROM1, DrvScroll1, DrvTransTab1, 0x1800); - if (nSpriteEnable & 8) draw_road(0x80); - if (nSpriteEnable & 16) draw_sprites(); - if (nSpriteEnable & 32) draw_layer(DrvVidRAM0, DrvGfxROM0, DrvScroll0, DrvTransTab0, 0x1400); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT8)); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[3] = { 10000000 / 60, 10000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekOpen(0); - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - INT32 nCycles = SekTotalCycles(); - if (i == ((nScreenHeight * 100) / 256)) SekSetIRQLine(1, CPU_IRQSTATUS_ACK); - SekClose(); - - SekOpen(1); - nCyclesDone[1] += SekRun(nCycles - SekTotalCycles()); - if (i == ((nScreenHeight * 100) / 256)) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - SekClose(); - - BurnTimerUpdateY8950(i * (nCyclesTotal[2] / nInterleave)); - } - - BurnTimerEndFrameY8950(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnY8950Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029727; - } - - if (nAction & ACB_MEMORY_ROM) { - ba.Data = Drv68KROM0; - ba.nLen = 0x0040000; - ba.nAddress = 0x000000; - ba.szName = "68K #0 ROM"; - BurnAcb(&ba); - - ba.Data = Drv68KROM1; - ba.nLen = 0x020000; - ba.nAddress = 0x800000; - ba.szName = "68K #1 ROM (CPU #1)"; - BurnAcb(&ba); - - ba.Data = DrvZ80ROM; - ba.nLen = 0x008000; - ba.nAddress = 0xf00000; - ba.szName = "Z80 ROM (CPU #2)"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = Drv68KRAM0; - ba.nLen = 0x008000; - ba.nAddress = 0x080000; - ba.szName = "68k #0 Ram"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvSprRAM; - ba.nLen = 0x001000; - ba.nAddress = 0x0a0000; - ba.szName = "Sprite Ram"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvVidRAM0; - ba.nLen = 0x002000; - ba.nAddress = 0x0c0000; - ba.szName = "Video Ram #0"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvVidRAM1; - ba.nLen = 0x002000; - ba.nAddress = 0x0c4000; - ba.szName = "Video Ram #1"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvVidRAM0; - ba.nLen = 0x002000; - ba.nAddress = 0x0c8000; - ba.szName = "Video Ram #2"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvShareRAM; - ba.nLen = 0x001000; - ba.nAddress = 0x0e0000; - ba.szName = "Shared RAM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvPalRAM; - ba.nLen = 0x008000; - ba.nAddress = 0x100000; - ba.szName = "Palette RAM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvVidRAM0; - ba.nLen = 0x004000; - ba.nAddress = 0x880000; - ba.szName = "68K #1 RAM (CPU #1)"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvRoadRAM; - ba.nLen = 0x001000; - ba.nAddress = 0x8c0000; - ba.szName = "Road RAM (CPU #1)"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvZ80RAM; - ba.nLen = 0x002000; - ba.nAddress = 0xf08000; - ba.szName = "Z80 RAM (CPU #2)"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnY8950Scan(nAction, pnMin); - - SCAN_VAR(mux_data); - SCAN_VAR(soundlatch[0]); - SCAN_VAR(DrvScroll0[0]); - SCAN_VAR(DrvScroll0[2]); - SCAN_VAR(DrvScroll1[0]); - SCAN_VAR(DrvScroll1[2]); - SCAN_VAR(DrvScroll2[0]); - SCAN_VAR(DrvScroll2[2]); - } - - if (nAction & ACB_WRITE) { - DrvRecalc = 1; - } - - return 0; -} - - -// Cyber Tank (v1.4) - -static struct BurnRomInfo cybertnkRomDesc[] = { - { "p1a.37", 0x20000, 0xbe1abd16, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "p2a.36", 0x20000, 0x5290c89a, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "subl", 0x10000, 0x3814a2eb, 0x02 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "subh", 0x10000, 0x1af7ad58, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "ss5.37", 0x08000, 0xc3ba160b, 0x03 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ss1.10", 0x20000, 0x27d1cf94, 0x04 | BRF_SND }, // 5 Y8950 #0 Samples - { "ss3.11", 0x20000, 0xa327488e, 0x04 | BRF_SND }, // 6 - - { "ss2.31", 0x20000, 0x27d1cf94, 0x05 | BRF_SND }, // 7 Y8950 #1 Samples - { "ss4.32", 0x20000, 0xa327488e, 0x05 | BRF_SND }, // 8 - - { "s09", 0x10000, 0x69e6470c, 0x06 | BRF_GRA }, // 9 Layer 0 Tiles - { "s10", 0x10000, 0x77230f44, 0x06 | BRF_GRA }, // 10 - { "s11", 0x10000, 0xbfda980d, 0x06 | BRF_GRA }, // 11 - { "s12", 0x10000, 0x8a11fcfa, 0x06 | BRF_GRA }, // 12 - - { "s05", 0x10000, 0xbddb6008, 0x07 | BRF_GRA }, // 13 Layer 1 Tiles - { "s06", 0x10000, 0xd65b0fa5, 0x07 | BRF_GRA }, // 14 - { "s07", 0x10000, 0x70220567, 0x07 | BRF_GRA }, // 15 - { "s08", 0x10000, 0x988c4fcb, 0x07 | BRF_GRA }, // 16 - - { "s01", 0x10000, 0x6513452c, 0x08 | BRF_GRA }, // 17 Layer 2 Tiles - { "s02", 0x10000, 0x3a270e3b, 0x08 | BRF_GRA }, // 18 - { "s03", 0x10000, 0x584eff66, 0x08 | BRF_GRA }, // 19 - { "s04", 0x10000, 0x51ba5402, 0x08 | BRF_GRA }, // 20 - - { "road_chl", 0x20000, 0x862b109c, 0x09 | BRF_GRA }, // 21 Road Lines - { "road_chh", 0x20000, 0x9dedc988, 0x09 | BRF_GRA }, // 22 - - { "c01.93", 0x20000, 0xb5ee3de2, 0x0a | BRF_GRA }, // 23 Sprite data - { "c02.92", 0x20000, 0x1f857d79, 0x0a | BRF_GRA }, // 24 - { "c03.91", 0x20000, 0xd70a93e2, 0x0a | BRF_GRA }, // 25 - { "c04.90", 0x20000, 0x04d6fdc2, 0x0a | BRF_GRA }, // 26 - { "c05.102", 0x20000, 0x3f537490, 0x0a | BRF_GRA }, // 27 - { "c06.101", 0x20000, 0xff69c6a4, 0x0a | BRF_GRA }, // 28 - { "c07.100", 0x20000, 0x5e8eba75, 0x0a | BRF_GRA }, // 29 - { "c08.98", 0x20000, 0xf0820ddd, 0x0a | BRF_GRA }, // 30 - { "c09.109", 0x20000, 0x080f87c3, 0x0a | BRF_GRA }, // 31 - { "c10.108", 0x20000, 0x777c6a62, 0x0a | BRF_GRA }, // 32 - { "c11.107", 0x20000, 0x330ca5a1, 0x0a | BRF_GRA }, // 33 - { "c12.106", 0x20000, 0xc1ec8e61, 0x0a | BRF_GRA }, // 34 - { "c13.119", 0x20000, 0x4e22a7e0, 0x0a | BRF_GRA }, // 35 - { "c14.118", 0x20000, 0xbdbd6232, 0x0a | BRF_GRA }, // 36 - { "c15.117", 0x20000, 0xf163d768, 0x0a | BRF_GRA }, // 37 - { "c16.116", 0x20000, 0x5e5017c4, 0x0a | BRF_GRA }, // 38 - - { "t1", 0x08000, 0x24890512, 0x0b | BRF_OPT }, // 39 Unknown? - { "t2", 0x08000, 0x5a10480d, 0x0b | BRF_OPT }, // 40 - { "t3", 0x08000, 0x454af4dc, 0x0b | BRF_OPT }, // 41 - { "t4", 0x08000, 0x0e1ef6a9, 0x0b | BRF_OPT }, // 42 - { "t5", 0x08000, 0x12eb51bc, 0x0c | BRF_OPT }, // 43 - { "t6", 0x08000, 0x12eb51bc, 0x0c | BRF_OPT }, // 44 - - { "ic2", 0x00100, 0xaad2a447, 0x0d | BRF_OPT }, // 45 Unknown Proms - { "ic15", 0x00100, 0x5f8c2c00, 0x0d | BRF_OPT }, // 46 - { "ic19", 0x00020, 0xbd15cd71, 0x0d | BRF_OPT }, // 47 - { "ic20", 0x00020, 0x2f237563, 0x0d | BRF_OPT }, // 48 - { "ic29", 0x00020, 0x95b32c0f, 0x0d | BRF_OPT }, // 49 - { "ic30", 0x00020, 0x2bb6033f, 0x0d | BRF_OPT }, // 50 -}; - -STD_ROM_PICK(cybertnk) -STD_ROM_FN(cybertnk) - -struct BurnDriver BurnDrvCybertnk = { - "cybertnk", NULL, NULL, NULL, "1988", - "Cyber Tank (v1.4)\0", NULL, "Coreland", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, cybertnkRomInfo, cybertnkRomName, NULL, NULL, CybertnkInputInfo, CybertnkDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 512, 224, 8, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_dacholer.cpp b/jan/src/burn/drv/pre90s/d_dacholer.cpp deleted file mode 100644 index a1c763d3b..000000000 --- a/jan/src/burn/drv/pre90s/d_dacholer.cpp +++ /dev/null @@ -1,1000 +0,0 @@ -// FB Alpha Kick Boy / Dacholer / Itazura Tenshi driver module -// Based on MAME driver by Pierpaolo Prazzoli - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "msm5205.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; - -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[9]; - -static UINT8 bgbank; -static UINT8 flipscreen; -static UINT8 soundlatch; -static UINT8 scrollx; -static UINT8 scrolly; -static UINT8 music_interrupt_enable; -static UINT8 sound_interrupt_enable; -static UINT8 msm_toggle; -static UINT8 msm_data; -static UINT8 sound_ack; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 itaten = 0; -static INT32 dacholer = 0; - -static struct BurnInputInfo DacholerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dacholer) - -static struct BurnInputInfo ItatenInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Itaten) - -static struct BurnDIPInfo DacholerDIPList[]= -{ - {0x12, 0xff, 0xff, 0x0f, NULL }, - {0x13, 0xff, 0xff, 0x3d, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x00, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x01, "3" }, - {0x13, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 13, "Bonus Life" }, - {0x13, 0x01, 0x3c, 0x3c, "20k 70k then every 50k" }, - {0x13, 0x01, 0x3c, 0x38, "30k 80k then every 50k" }, - {0x13, 0x01, 0x3c, 0x34, "40k 90k then every 50k" }, - {0x13, 0x01, 0x3c, 0x2c, "20k 90k then every 70k" }, - {0x13, 0x01, 0x3c, 0x28, "30k 100k then every 70k" }, - {0x13, 0x01, 0x3c, 0x24, "40k 110k then every 70k" }, - {0x13, 0x01, 0x3c, 0x1c, "20k 120k then every 100k" }, - {0x13, 0x01, 0x3c, 0x18, "30k 130k then every 100k" }, - {0x13, 0x01, 0x3c, 0x14, "40k 140k then every 100k" }, - {0x13, 0x01, 0x3c, 0x0c, "20k only" }, - {0x13, 0x01, 0x3c, 0x08, "30k only" }, - {0x13, 0x01, 0x3c, 0x04, "40k only" }, - {0x13, 0x01, 0x3c, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Dacholer) - -static struct BurnDIPInfo KickboyDIPList[]= -{ - {0x12, 0xff, 0xff, 0x0f, NULL }, - {0x13, 0xff, 0xff, 0x7d, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "99 (Cheat)" }, - - {0 , 0xfe, 0 , 13, "Bonus Life" }, - {0x13, 0x01, 0x3c, 0x3c, "20k 50k then every 30k" }, - {0x13, 0x01, 0x3c, 0x38, "30k 60k then every 30k" }, - {0x13, 0x01, 0x3c, 0x34, "40k 70k then every 30k" }, - {0x13, 0x01, 0x3c, 0x2c, "20k 70k then every 50k" }, - {0x13, 0x01, 0x3c, 0x28, "30k 80k then every 50k" }, - {0x13, 0x01, 0x3c, 0x24, "40k 90k then every 50k" }, - {0x13, 0x01, 0x3c, 0x1c, "20k 90k then every 70k" }, - {0x13, 0x01, 0x3c, 0x18, "30k 100k then every 70k" }, - {0x13, 0x01, 0x3c, 0x14, "40k 110k then every 70k" }, - {0x13, 0x01, 0x3c, 0x0c, "20k only" }, - {0x13, 0x01, 0x3c, 0x08, "30k only" }, - {0x13, 0x01, 0x3c, 0x04, "40k only" }, - {0x13, 0x01, 0x3c, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x40, 0x40, "Easy" }, - {0x13, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Kickboy) - -static struct BurnDIPInfo ItatenDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x10, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0x0c, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0c, 0x04, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x0c, 0x0c, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 0, "Difficulty" }, - {0x11, 0x01, 0x03, 0x03, "Easy" }, - {0x11, 0x01, 0x03, 0x02, "Medium" }, - {0x11, 0x01, 0x03, 0x01, "Hard" }, - {0x11, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x0c, 0x0c, "3" }, - {0x11, 0x01, 0x0c, 0x08, "4" }, - {0x11, 0x01, 0x0c, 0x04, "5" }, - {0x11, 0x01, 0x0c, 0x00, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x30, 0x30, "30k then every 50k" }, - {0x11, 0x01, 0x30, 0x20, "60k then every 50k" }, - {0x11, 0x01, 0x30, 0x10, "30k then every 90k" }, - {0x11, 0x01, 0x30, 0x00, "60k then every 90k" }, - - {0 , 0xfe, 0 , 4, "Demo Sounds" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x80, 0x00, "Upright" }, - {0x11, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Itaten) - -static void __fastcall dacholer_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x20: - // coins & leds - return; - - case 0x21: - bgbank = data & 3; - flipscreen = data & 0x0c; - return; - - case 0x22: - scrollx = data; - return; - - case 0x23: - scrolly = data + 16; - return; - - case 0x24: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0x27: - { - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - } - return; - } -} - -static UINT8 __fastcall dacholer_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - return DrvInputs[port & 3]; - - case 0x03: - return (DrvDips[0] & 0xef) | (sound_ack ? 0x10 : 0); // correct??? - - case 0x04: - return DrvDips[1]; - - case 0x05: - return 0; // nop - } - - return 0; -} - -static void __fastcall dacholer_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - soundlatch = 0; - return; - - case 0x04: - music_interrupt_enable = data; - return; - - case 0x08: - sound_interrupt_enable = data; - if (data) MSM5205ResetWrite(0, 0); - return; - - case 0x0c: - sound_ack = data; - return; - - case 0x80: - msm_data = data; - msm_toggle = 0; - return; - - case 0x86: - case 0x87: - AY8910Write(0, ~port & 1, data); - return; - - case 0x8a: - case 0x8b: - AY8910Write(1, ~port & 1, data); - return; - - case 0x8e: - case 0x8f: - AY8910Write(2, ~port & 1, data); - return; - } -} - -static UINT8 __fastcall dacholer_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return soundlatch; - } - - return 0; -} - -static void adpcm_int() -{ - if (sound_interrupt_enable == 1 || (sound_interrupt_enable == 0 && msm_toggle == 1)) - { - MSM5205DataWrite(0, msm_data >> 4); - - msm_data <<= 4; - msm_toggle ^= 1; - - if (msm_toggle == 0) - { - ZetSetVector(0x38); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - } else { - MSM5205ResetWrite(0, 1); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - if (ZetGetActive() == -1) return 0; - - return (INT64)(double)ZetTotalCycles() * nSoundRate / 2496000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - AY8910Reset(0); - AY8910Reset(1); - AY8910Reset(2); - MSM5205Reset(); - ZetClose(); - - bgbank = 0; - flipscreen = 0; - scrollx = 0; - scrolly = 0; - soundlatch = 0; - music_interrupt_enable = 0; - sound_interrupt_enable = 0; - msm_toggle = 0; - msm_data = 0; - sound_ack = 0; - MSM5205ResetWrite(0, 1); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x00a000; - DrvZ80ROM1 = Next; Next += 0x006000; - - DrvGfxROM0 = Next; Next += 0x004000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x000100; - DrvFgRAM = Next; Next += 0x000400; - DrvZ80RAM0 = Next; Next += 0x001800; - DrvZ80RAM1 = Next; Next += 0x001800; - DrvBgRAM = Next; Next += 0x000400; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[6] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[7] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[8] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { STEP4(0,1) }; - INT32 XOffs[16] = { 4,0,12,8,20,16,28,24,36,32,44,40,52,48,60,56 }; - INT32 YOffs0[8] = { STEP8(0,32) }; - INT32 YOffs1[16]= { STEP16(0,64) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0100, 4, 8, 8, Plane, XOffs, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x8000); - - GfxDecode(0x0400, 4, 8, 8, Plane, XOffs, YOffs0, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x8000); - - GfxDecode(0x0100, 4, 16, 16, Plane, XOffs, YOffs1, 0x400, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit(INT32 type) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (type == 0) - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 13, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 14, 1)) return 1; - - dacholer = 1; - } - else if (type == 1) - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 13, 1)) return 1; - - dacholer = 1; // kickboy (dacholer clone) - } - else if (type == 2) - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x06000, 15, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 16, 1)) return 1; - // if (BurnLoadRom(DrvColPROM + 0x00020, 17, 1)) return 1; - // if (BurnLoadRom(DrvColPROM + 0x00040, 18, 1)) return 1; - - itaten = 1; - } - - DrvGfxDecode(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvBgRAM, 0xc000, 0xc3ff, MAP_RAM); - ZetMapMemory(DrvBgRAM, 0xc400, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvFgRAM, 0xd000, 0xd3ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xe0ff, MAP_RAM); - - if (itaten) - { - ZetMapMemory(DrvZ80ROM0 + 0x8000, 0x8000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xa000, 0xb7ff, MAP_RAM); - } - else - { - ZetMapMemory(DrvZ80RAM0, 0x8800, 0x97ff, MAP_RAM); - } - - ZetSetOutHandler(dacholer_main_write_port); - ZetSetInHandler(dacholer_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xd000, 0xe7ff, MAP_RAM); - ZetSetOutHandler(dacholer_sound_write_port); - ZetSetInHandler(dacholer_sound_read_port); - ZetClose(); - - AY8910Init(0, 1248000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1248000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 1248000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(2, 0.10, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, DrvSynchroniseStream, 384000, adpcm_int, MSM5205_S96_4B, 1); - MSM5205SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - AY8910Exit(2); - MSM5205Exit(); - - BurnFree(AllMem); - - itaten = 0; - dacholer = 0; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0;i < 0x20; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = bit0 * 33 + bit1 * 71 + bit2 * 151; //bit0 * 151 + bit1 * 71 + bit2 * 33; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = bit0 * 33 + bit1 * 71 + bit2 * 151; //bit0 * 151 + bit1 * 71 + bit2 * 33; - - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = bit0 * 81 + bit1 * 174; //bit0 * 174 + bit1 * 81; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_bg_layer() -{ - INT32 color = (itaten) ? 0 : 0x10; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sx -= scrollx; - if (sx < -7) sx += 256; - sy -= scrolly; - if (sy < -7) sy += 256; - - INT32 code = DrvBgRAM[offs] + (bgbank * 0x100); - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 0, 0, DrvGfxROM1); - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = (32 * 2); offs < (32 * 32) - (32 * 2); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 code = DrvFgRAM[offs]; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy - 16, 0, 0, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - INT32 code = DrvSprRAM[offs + 1]; - INT32 attr = DrvSprRAM[offs + 2]; - - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - - INT32 sx = (DrvSprRAM[offs + 3] - 128) + 256 * (attr & 0x01); - INT32 sy = 255 - DrvSprRAM[offs]; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, 0, 4, 0, 0x10, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, 0, 4, 0, 0x10, DrvGfxROM2); - } - } else { - - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, 0, 4, 0, 0x10, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, 0, 4, 0, 0x10, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if ((nBurnLayer & 1) == 0) BurnTransferClear(); - if ((nBurnLayer & 1) == 1) draw_bg_layer(); - if ((nBurnLayer & 2) == 2) draw_sprites(); - if ((nBurnLayer & 4) == 4) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - UINT8 *DrvJoy[3] = { DrvJoy1, DrvJoy2, DrvJoy3 }; - UINT32 DrvJoyInit[3] = { 0x00, 0x00, 0xff }; - - CompileInput(DrvJoy, (void*)DrvInputs, 3, 8, DrvJoyInit); - - if (dacholer) { - // Convert to 4-way for Dacholer - ProcessJoystick(&DrvInputs[0], 0, 0,1,2,3, INPUT_4WAY | INPUT_MAKEACTIVELOW); - ProcessJoystick(&DrvInputs[1], 1, 0,1,2,3, INPUT_4WAY | INPUT_MAKEACTIVELOW); - } else { - ProcessJoystick(&DrvInputs[0], 0, 0,1,2,3, INPUT_MAKEACTIVELOW); - ProcessJoystick(&DrvInputs[1], 1, 0,1,2,3, INPUT_MAKEACTIVELOW); - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 4000000 / 60, 2496000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - MSM5205NewFrame(0, 2496000, nInterleave); - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == 240) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - if (i == 240 && music_interrupt_enable == 1) { - ZetSetVector(0x30); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - MSM5205UpdateScanline(i); - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - - SCAN_VAR(bgbank); - SCAN_VAR(flipscreen); - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - SCAN_VAR(soundlatch); - SCAN_VAR(music_interrupt_enable); - SCAN_VAR(sound_interrupt_enable); - SCAN_VAR(msm_toggle); - SCAN_VAR(msm_data); - SCAN_VAR(sound_ack); - } - - return 0; -} - - -// Dacholer - -static struct BurnRomInfo dacholerRomDesc[] = { - { "dacholer8.rom", 0x2000, 0x8b73a441, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "dacholer9.rom", 0x2000, 0x9499289f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dacholer10.rom", 0x2000, 0x39d37281, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dacholer11.rom", 0x2000, 0xbb781ea4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "dacholer12.rom", 0x2000, 0xcc3a4b68, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - { "dacholer13.rom", 0x2000, 0xaa18e126, 2 | BRF_PRG | BRF_ESS }, // 5 - { "dacholer14.rom", 0x2000, 0x3b0131c7, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "dacholer7.rom", 0x2000, 0xfd649d36, 3 | BRF_GRA }, // 7 Characters - - { "dacholer1.rom", 0x2000, 0x9cca0fd2, 4 | BRF_GRA }, // 8 Background tiles - { "dacholer2.rom", 0x2000, 0xc1322b27, 4 | BRF_GRA }, // 9 - { "dacholer3.rom", 0x2000, 0x9e1e7198, 4 | BRF_GRA }, // 10 - - { "dacholer5.rom", 0x2000, 0xdd4818f0, 5 | BRF_GRA }, // 11 Sprites - { "dacholer4.rom", 0x2000, 0x7f338ae0, 5 | BRF_GRA }, // 12 - { "dacholer6.rom", 0x2000, 0x0a6d4ec4, 5 | BRF_GRA }, // 13 - - { "k.13d", 0x0020, 0x82f87a36, 6 | BRF_GRA }, // 14 Color data -}; - -STD_ROM_PICK(dacholer) -STD_ROM_FN(dacholer) - -static INT32 DacholerInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvDacholer = { - "dacholer", NULL, NULL, NULL, "1983", - "Dacholer\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, dacholerRomInfo, dacholerRomName, NULL, NULL, DacholerInputInfo, DacholerDIPInfo, - DacholerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 256, 224, 4, 3 -}; - - -// Kick Boy - -static struct BurnRomInfo kickboyRomDesc[] = { - { "k_1.5k", 0x2000, 0x525746f1, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "k_2.5l", 0x2000, 0x9d091725, 1 | BRF_PRG | BRF_ESS }, // 1 - { "k_3.5m", 0x2000, 0xd61b6ff6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "k_4.5n", 0x2000, 0xa8985bfe, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "k_1.6g", 0x2000, 0xcc3a4b68, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - { "k_2.6h", 0x2000, 0xaa18e126, 2 | BRF_PRG | BRF_ESS }, // 5 - { "k_3.6j", 0x2000, 0x3b0131c7, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "k_7.12j", 0x2000, 0x22be46e8, 3 | BRF_GRA }, // 7 Characters - - { "k_3.13a", 0x2000, 0x7eac2a64, 4 | BRF_GRA }, // 8 Background tiles - { "k_2.12a", 0x2000, 0xb8829572, 4 | BRF_GRA }, // 9 - - { "k_5.2d", 0x2000, 0x4b769a1c, 5 | BRF_GRA }, // 10 Sprites - { "k_4.1d", 0x2000, 0x45199750, 5 | BRF_GRA }, // 11 - { "k_6.3d", 0x2000, 0xd1795506, 5 | BRF_GRA }, // 12 - - { "k.13d", 0x0020, 0x82f87a36, 6 | BRF_GRA }, // 13 Color data -}; - -STD_ROM_PICK(kickboy) -STD_ROM_FN(kickboy) - -static INT32 KickboyInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvKickboy = { - "kickboy", NULL, NULL, NULL, "1983", - "Kick Boy\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, kickboyRomInfo, kickboyRomName, NULL, NULL, DacholerInputInfo, KickboyDIPInfo, - KickboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 256, 224, 4, 3 -}; - - -// Itazura Tenshi (Japan) - -static struct BurnRomInfo itatenRomDesc[] = { - { "1.5k", 0x2000, 0x84c8a010, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.5l", 0x2000, 0x19946038, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.5m", 0x2000, 0x4f9e26fd, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.1f", 0x2000, 0x35f85aeb, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.1e", 0x2000, 0x6cf30924, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "6.6g", 0x2000, 0xdfcb1a3e, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - { "7.6h", 0x1000, 0x844e78d6, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "16.12j", 0x2000, 0x8af2bfb8, 3 | BRF_GRA }, // 7 Characters - - { "11.13a", 0x2000, 0xed3279d5, 4 | BRF_GRA }, // 8 Background tiles - { "10.12a", 0x2000, 0xd2b60e5d, 4 | BRF_GRA }, // 9 - { "9.11a", 0x2000, 0x919cac5e, 4 | BRF_GRA }, // 10 - { "8.10a", 0x2000, 0xc32b0859, 4 | BRF_GRA }, // 11 - - { "13.2d", 0x2000, 0xd32559f5, 5 | BRF_GRA }, // 12 Sprites - { "12.1d", 0x2000, 0xf0f64636, 5 | BRF_GRA }, // 13 - { "14.3d", 0x2000, 0x8c532c74, 5 | BRF_GRA }, // 14 - { "15.4d", 0x2000, 0xd119b483, 5 | BRF_GRA }, // 15 - - { "af-3.13d", 0x0020, 0x875429ba, 6 | BRF_GRA }, // 16 Color data - - { "af-2.1h", 0x0020, 0xe1cac297, 0 | BRF_OPT }, // 17 Uknown data - { "af-1.3n", 0x0020, 0x5638e485, 0 | BRF_OPT }, // 18 -}; - -STD_ROM_PICK(itaten) -STD_ROM_FN(itaten) - -static INT32 ItatenInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvItaten = { - "itaten", NULL, NULL, NULL, "1984", - "Itazura Tenshi (Japan)\0", NULL, "Nichibutsu / Alice", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, itatenRomInfo, itatenRomName, NULL, NULL, ItatenInputInfo, ItatenDIPInfo, - ItatenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_ddragon.cpp b/jan/src/burn/drv/pre90s/d_ddragon.cpp deleted file mode 100644 index c05af5559..000000000 --- a/jan/src/burn/drv/pre90s/d_ddragon.cpp +++ /dev/null @@ -1,2823 +0,0 @@ -// FB Alpha Double Dragon driver module -// Based on MAME driver by Philip Bennett,Carlos A. Lozano, Rob Rosenbrock, -// Phil Stroffolino, Ernesto Corvi, David Haywood, and R. Belmont - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "hd6309_intf.h" -#include "m6800_intf.h" -#include "m6805_intf.h" -#include "m6809_intf.h" -#include "burn_ym2151.h" -#include "msm5205.h" -#include "msm6295.h" -#include "bitswap.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvHD6309Rom = NULL; -static UINT8 *DrvSubCPURom = NULL; -static UINT8 *DrvSoundCPURom = NULL; -static UINT8 *DrvMCURom = NULL; -static UINT8 *DrvMSM5205Rom = NULL; -static UINT8 *DrvHD6309Ram = NULL; -static UINT8 *DrvSubCPURam = NULL; -static UINT8 *DrvSoundCPURam = NULL; -static UINT8 *DrvMCURam = NULL; -static UINT8 *DrvMCUPorts = NULL; -static UINT8 *DrvFgVideoRam = NULL; -static UINT8 *DrvBgVideoRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPaletteRam1 = NULL; -static UINT8 *DrvPaletteRam2 = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvRomBank; -static UINT8 DrvVBlank; -static UINT8 DrvSubCPUBusy; -static UINT8 DrvSoundLatch; -static UINT8 DrvADPCMIdle[2]; -static UINT32 DrvADPCMPos[2]; -static UINT32 DrvADPCMEnd[2]; -static INT32 DrvADPCMData[2]; - -static UINT16 DrvScrollXHi; -static UINT16 DrvScrollYHi; -static UINT8 DrvScrollXLo; -static UINT8 DrvScrollYLo; - -static INT32 nCyclesDone[4], nCyclesTotal[4]; -static INT32 nCyclesSegment; - -#define DD_CPU_TYPE_NONE 0 -#define DD_CPU_TYPE_HD63701 1 -#define DD_CPU_TYPE_HD6309 2 -#define DD_CPU_TYPE_M6803 3 -#define DD_CPU_TYPE_Z80 4 -#define DD_CPU_TYPE_M6809 5 -static INT32 DrvSubCPUType; -static INT32 DrvSoundCPUType; - -#define DD_VID_TYPE_DD2 1 -static INT32 DrvVidHardwareType; - -#define DD_GAME_DARKTOWR 1 -static INT32 DrvGameType; - -static struct BurnInputInfo DrvInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort1 + 6, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort2 + 1, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort0 + 7, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 0, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = 0xff; - DrvInput[2] = 0xe7; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] -= (DrvInputPort0[i] & 1) << i; - DrvInput[1] -= (DrvInputPort1[i] & 1) << i; - DrvInput[2] -= (DrvInputPort2[i] & 1) << i; - } -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "4 Coins 1 Play" }, - {0x14, 0x01, 0x07, 0x01, "3 Coins 1 Play" }, - {0x14, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "4 Coins 1 Play" }, - {0x14, 0x01, 0x38, 0x08, "3 Coins 1 Play" }, - {0x14, 0x01, 0x38, 0x10, "2 Coins 1 Play" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Plays" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x40, 0x40, "Upright" }, - {0x14, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x03, 0x01, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Medium" }, - {0x15, 0x01, 0x03, 0x02, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x30, 0x10, "20k" }, - {0x15, 0x01, 0x30, 0x00, "40k" }, - {0x15, 0x01, 0x30, 0x30, "30k and every 60k" }, - {0x15, 0x01, 0x30, 0x20, "40k and every 80k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0xc0, 0xc0, "2" }, - {0x15, 0x01, 0xc0, 0x80, "3" }, - {0x15, 0x01, 0xc0, 0x40, "4" }, - {0x15, 0x01, 0xc0, 0x00, "Infinite" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo Drv2DIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "4 Coins 1 Play" }, - {0x14, 0x01, 0x07, 0x01, "3 Coins 1 Play" }, - {0x14, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "4 Coins 1 Play" }, - {0x14, 0x01, 0x38, 0x08, "3 Coins 1 Play" }, - {0x14, 0x01, 0x38, 0x10, "2 Coins 1 Play" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Plays" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x40, 0x40, "Upright" }, - {0x14, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Hurricane Kick" }, - {0x15, 0x01, 0x08, 0x00, "Easy" }, - {0x15, 0x01, 0x08, 0x08, "Normal" }, - - {0 , 0xfe, 0 , 4 , "Timer" }, - {0x15, 0x01, 0x30, 0x00, "60" }, - {0x15, 0x01, 0x30, 0x10, "65" }, - {0x15, 0x01, 0x30, 0x30, "70" }, - {0x15, 0x01, 0x30, 0x20, "80" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0xc0, 0xc0, "1" }, - {0x15, 0x01, 0xc0, 0x80, "2" }, - {0x15, 0x01, 0xc0, 0x40, "3" }, - {0x15, 0x01, 0xc0, 0x00, "4" }, -}; - -STDDIPINFO(Drv2) - -static struct BurnDIPInfo DdungeonDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x9d, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x14, 0x01, 0x0f, 0x03, "4 Coins 1 Play" }, - {0x14, 0x01, 0x0f, 0x02, "3 Coins 1 Play" }, - {0x14, 0x01, 0x0f, 0x07, "4 Coins 2 Plays" }, - {0x14, 0x01, 0x0f, 0x01, "2 Coins 1 Play" }, - {0x14, 0x01, 0x0f, 0x06, "3 Coins 2 Plays" }, - {0x14, 0x01, 0x0f, 0x0b, "4 Coins 3 Plays" }, - {0x14, 0x01, 0x0f, 0x0f, "4 Coins 4 Plays" }, - {0x14, 0x01, 0x0f, 0x0a, "3 Coins 3 Plays" }, - {0x14, 0x01, 0x0f, 0x05, "2 Coins 2 Plays" }, - {0x14, 0x01, 0x0f, 0x00, "1 Coin 1 Play" }, - {0x14, 0x01, 0x0f, 0x0e, "3 Coins 4 Plays" }, - {0x14, 0x01, 0x0f, 0x09, "2 Coins 3 Plays" }, - {0x14, 0x01, 0x0f, 0x0d, "2 Coins 4 Plays" }, - {0x14, 0x01, 0x0f, 0x04, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x0f, 0x08, "1 Coin 3 Plays" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x14, 0x01, 0xf0, 0x30, "4 Coins 1 Play" }, - {0x14, 0x01, 0xf0, 0x20, "3 Coins 1 Play" }, - {0x14, 0x01, 0xf0, 0x70, "4 Coins 2 Plays" }, - {0x14, 0x01, 0xf0, 0x10, "2 Coins 1 Play" }, - {0x14, 0x01, 0xf0, 0x60, "3 Coins 2 Plays" }, - {0x14, 0x01, 0xf0, 0xb0, "4 Coins 3 Plays" }, - {0x14, 0x01, 0xf0, 0xf0, "4 Coins 4 Plays" }, - {0x14, 0x01, 0xf0, 0xa0, "3 Coins 3 Plays" }, - {0x14, 0x01, 0xf0, 0x50, "2 Coins 2 Plays" }, - {0x14, 0x01, 0xf0, 0x00, "1 Coin 1 Play" }, - {0x14, 0x01, 0xf0, 0xe0, "3 Coins 4 Plays" }, - {0x14, 0x01, 0xf0, 0x90, "2 Coins 3 Plays" }, - {0x14, 0x01, 0xf0, 0xd0, "2 Coins 4 Plays" }, - {0x14, 0x01, 0xf0, 0x40, "1 Coin 2 Plays" }, - {0x14, 0x01, 0xf0, 0x80, "1 Coin 3 Plays" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Plays" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x03, 0x00, "1" }, - {0x15, 0x01, 0x03, 0x01, "2" }, - {0x15, 0x01, 0x03, 0x02, "3" }, - {0x15, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0xf0, 0xf0, "Easy" }, - {0x15, 0x01, 0xf0, 0x90, "Medium" }, - {0x15, 0x01, 0xf0, 0x70, "Hard" }, - {0x15, 0x01, 0xf0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Ddungeon) - -static struct BurnDIPInfo DarktowrDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x14, 0x01, 0x0f, 0x03, "4 Coins 1 Play" }, - {0x14, 0x01, 0x0f, 0x02, "3 Coins 1 Play" }, - {0x14, 0x01, 0x0f, 0x07, "4 Coins 2 Plays" }, - {0x14, 0x01, 0x0f, 0x01, "2 Coins 1 Play" }, - {0x14, 0x01, 0x0f, 0x06, "3 Coins 2 Plays" }, - {0x14, 0x01, 0x0f, 0x0b, "4 Coins 3 Plays" }, - {0x14, 0x01, 0x0f, 0x0f, "4 Coins 4 Plays" }, - {0x14, 0x01, 0x0f, 0x0a, "3 Coins 3 Plays" }, - {0x14, 0x01, 0x0f, 0x05, "2 Coins 2 Plays" }, - {0x14, 0x01, 0x0f, 0x00, "1 Coin 1 Play" }, - {0x14, 0x01, 0x0f, 0x0e, "3 Coins 4 Plays" }, - {0x14, 0x01, 0x0f, 0x09, "2 Coins 3 Plays" }, - {0x14, 0x01, 0x0f, 0x0d, "2 Coins 4 Plays" }, - {0x14, 0x01, 0x0f, 0x04, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x0f, 0x08, "1 Coin 3 Plays" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x14, 0x01, 0xf0, 0x30, "4 Coins 1 Play" }, - {0x14, 0x01, 0xf0, 0x20, "3 Coins 1 Play" }, - {0x14, 0x01, 0xf0, 0x70, "4 Coins 2 Plays" }, - {0x14, 0x01, 0xf0, 0x10, "2 Coins 1 Play" }, - {0x14, 0x01, 0xf0, 0x60, "3 Coins 2 Plays" }, - {0x14, 0x01, 0xf0, 0xb0, "4 Coins 3 Plays" }, - {0x14, 0x01, 0xf0, 0xf0, "4 Coins 4 Plays" }, - {0x14, 0x01, 0xf0, 0xa0, "3 Coins 3 Plays" }, - {0x14, 0x01, 0xf0, 0x50, "2 Coins 2 Plays" }, - {0x14, 0x01, 0xf0, 0x00, "1 Coin 1 Play" }, - {0x14, 0x01, 0xf0, 0xe0, "3 Coins 4 Plays" }, - {0x14, 0x01, 0xf0, 0x90, "2 Coins 3 Plays" }, - {0x14, 0x01, 0xf0, 0xd0, "2 Coins 4 Plays" }, - {0x14, 0x01, 0xf0, 0x40, "1 Coin 2 Plays" }, - {0x14, 0x01, 0xf0, 0x80, "1 Coin 3 Plays" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Plays" }, -}; - -STDDIPINFO(Darktowr) - -static struct BurnRomInfo DrvRomDesc[] = { - { "21j-1-5.26", 0x08000, 0x42045dfd, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "21j-2-3.25", 0x08000, 0x5779705e, BRF_ESS | BRF_PRG }, // 1 - { "21j-3.24", 0x08000, 0x3bdea613, BRF_ESS | BRF_PRG }, // 2 - { "21j-4-1.23", 0x08000, 0x728f87b9, BRF_ESS | BRF_PRG }, // 3 - - { "21jm-0.ic55", 0x04000, 0xf5232d03, BRF_ESS | BRF_PRG }, // 4 HD63701 Program Code - - { "21j-0-1", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 5 M6809 Program Code - - { "21j-5", 0x08000, 0x7a8b8db4, BRF_GRA }, // 6 Characters - - { "21j-a", 0x10000, 0x574face3, BRF_GRA }, // 7 Sprites - { "21j-b", 0x10000, 0x40507a76, BRF_GRA }, // 8 - { "21j-c", 0x10000, 0xbb0bc76f, BRF_GRA }, // 9 - { "21j-d", 0x10000, 0xcb4f231b, BRF_GRA }, // 10 - { "21j-e", 0x10000, 0xa0a0c261, BRF_GRA }, // 11 - { "21j-f", 0x10000, 0x6ba152f6, BRF_GRA }, // 12 - { "21j-g", 0x10000, 0x3220a0b6, BRF_GRA }, // 13 - { "21j-h", 0x10000, 0x65c7517d, BRF_GRA }, // 14 - - { "21j-8", 0x10000, 0x7c435887, BRF_GRA }, // 15 Tiles - { "21j-9", 0x10000, 0xc6640aed, BRF_GRA }, // 16 - { "21j-i", 0x10000, 0x5effb0a0, BRF_GRA }, // 17 - { "21j-j", 0x10000, 0x5fb42e7c, BRF_GRA }, // 18 - - { "21j-6", 0x10000, 0x34755de3, BRF_GRA }, // 19 Samples - { "21j-7", 0x10000, 0x904de6f8, BRF_GRA }, // 20 - - { "21j-k-0", 0x00100, 0xfdb130a9, BRF_GRA }, // 21 PROMs - { "21j-l-0", 0x00200, 0x46339529, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvwRomDesc[] = { - { "21j-1.26", 0x08000, 0xae714964, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "21j-2-3.25", 0x08000, 0x5779705e, BRF_ESS | BRF_PRG }, // 1 - { "21a-3.24", 0x08000, 0xdbf24897, BRF_ESS | BRF_PRG }, // 2 - { "21j-4.23", 0x08000, 0x6c9f46fa, BRF_ESS | BRF_PRG }, // 3 - - { "21jm-0.ic55", 0x04000, 0xf5232d03, BRF_ESS | BRF_PRG }, // 4 HD63701 Program Code - - { "21j-0-1", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 5 M6809 Program Code - - { "21j-5", 0x08000, 0x7a8b8db4, BRF_GRA }, // 6 Characters - - { "21j-a", 0x10000, 0x574face3, BRF_GRA }, // 7 Sprites - { "21j-b", 0x10000, 0x40507a76, BRF_GRA }, // 8 - { "21j-c", 0x10000, 0xbb0bc76f, BRF_GRA }, // 9 - { "21j-d", 0x10000, 0xcb4f231b, BRF_GRA }, // 10 - { "21j-e", 0x10000, 0xa0a0c261, BRF_GRA }, // 11 - { "21j-f", 0x10000, 0x6ba152f6, BRF_GRA }, // 12 - { "21j-g", 0x10000, 0x3220a0b6, BRF_GRA }, // 13 - { "21j-h", 0x10000, 0x65c7517d, BRF_GRA }, // 14 - - { "21j-8", 0x10000, 0x7c435887, BRF_GRA }, // 15 Tiles - { "21j-9", 0x10000, 0xc6640aed, BRF_GRA }, // 16 - { "21j-i", 0x10000, 0x5effb0a0, BRF_GRA }, // 17 - { "21j-j", 0x10000, 0x5fb42e7c, BRF_GRA }, // 18 - - { "21j-6", 0x10000, 0x34755de3, BRF_GRA }, // 19 Samples - { "21j-7", 0x10000, 0x904de6f8, BRF_GRA }, // 20 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 21 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Drvw) -STD_ROM_FN(Drvw) - -static struct BurnRomInfo Drvw1RomDesc[] = { - { "e1-1.26", 0x08000, 0x4b951643, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "21a-2-4.25", 0x08000, 0x5cd67657, BRF_ESS | BRF_PRG }, // 1 - { "21a-3.24", 0x08000, 0xdbf24897, BRF_ESS | BRF_PRG }, // 2 - { "e4-1.23", 0x08000, 0xb1e26935, BRF_ESS | BRF_PRG }, // 3 - - { "21jm-0.ic55", 0x04000, 0xf5232d03, BRF_ESS | BRF_PRG }, // 4 HD63701 Program Code - - { "21j-0-1", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 5 M6809 Program Code - - { "21j-5", 0x08000, 0x7a8b8db4, BRF_GRA }, // 6 Characters - - { "21j-a", 0x10000, 0x574face3, BRF_GRA }, // 7 Sprites - { "21j-b", 0x10000, 0x40507a76, BRF_GRA }, // 8 - { "21j-c", 0x10000, 0xbb0bc76f, BRF_GRA }, // 9 - { "21j-d", 0x10000, 0xcb4f231b, BRF_GRA }, // 10 - { "21j-e", 0x10000, 0xa0a0c261, BRF_GRA }, // 11 - { "21j-f", 0x10000, 0x6ba152f6, BRF_GRA }, // 12 - { "21j-g", 0x10000, 0x3220a0b6, BRF_GRA }, // 13 - { "21j-h", 0x10000, 0x65c7517d, BRF_GRA }, // 14 - - { "21j-8", 0x10000, 0x7c435887, BRF_GRA }, // 15 Tiles - { "21j-9", 0x10000, 0xc6640aed, BRF_GRA }, // 16 - { "21j-i", 0x10000, 0x5effb0a0, BRF_GRA }, // 17 - { "21j-j", 0x10000, 0x5fb42e7c, BRF_GRA }, // 18 - - { "21j-6", 0x10000, 0x34755de3, BRF_GRA }, // 19 Samples - { "21j-7", 0x10000, 0x904de6f8, BRF_GRA }, // 20 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 21 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Drvw1) -STD_ROM_FN(Drvw1) - -static struct BurnRomInfo DrvuRomDesc[] = { - { "21a-1-5.26", 0x08000, 0xe24a6e11, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "21j-2-3.25", 0x08000, 0x5779705e, BRF_ESS | BRF_PRG }, // 1 - { "21a-3.24", 0x08000, 0xdbf24897, BRF_ESS | BRF_PRG }, // 2 - { "21a-4.23", 0x08000, 0x6ea16072, BRF_ESS | BRF_PRG }, // 3 - - { "21jm-0.ic55", 0x04000, 0xf5232d03, BRF_ESS | BRF_PRG }, // 4 HD63701 Program Code - - { "21j-0-1", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 5 M6809 Program Code - - { "21j-5", 0x08000, 0x7a8b8db4, BRF_GRA }, // 6 Characters - - { "21j-a", 0x10000, 0x574face3, BRF_GRA }, // 7 Sprites - { "21j-b", 0x10000, 0x40507a76, BRF_GRA }, // 8 - { "21j-c", 0x10000, 0xbb0bc76f, BRF_GRA }, // 9 - { "21j-d", 0x10000, 0xcb4f231b, BRF_GRA }, // 10 - { "21j-e", 0x10000, 0xa0a0c261, BRF_GRA }, // 11 - { "21j-f", 0x10000, 0x6ba152f6, BRF_GRA }, // 12 - { "21j-g", 0x10000, 0x3220a0b6, BRF_GRA }, // 13 - { "21j-h", 0x10000, 0x65c7517d, BRF_GRA }, // 14 - - { "21j-8", 0x10000, 0x7c435887, BRF_GRA }, // 15 Tiles - { "21j-9", 0x10000, 0xc6640aed, BRF_GRA }, // 16 - { "21j-i", 0x10000, 0x5effb0a0, BRF_GRA }, // 17 - { "21j-j", 0x10000, 0x5fb42e7c, BRF_GRA }, // 18 - - { "21j-6", 0x10000, 0x34755de3, BRF_GRA }, // 19 Samples - { "21j-7", 0x10000, 0x904de6f8, BRF_GRA }, // 20 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 21 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Drvu) -STD_ROM_FN(Drvu) - -static struct BurnRomInfo DrvuaRomDesc[] = { - { "21a-1", 0x08000, 0x1d625008, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "21a-2_4", 0x08000, 0x5cd67657, BRF_ESS | BRF_PRG }, // 1 - { "21a-3", 0x08000, 0xdbf24897, BRF_ESS | BRF_PRG }, // 2 - { "21a-4_2", 0x08000, 0x9b019598, BRF_ESS | BRF_PRG }, // 3 - - { "21jm-0.ic55", 0x04000, 0xf5232d03, BRF_ESS | BRF_PRG }, // 4 HD63701 Program Code - - { "21j-0-1", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 5 M6809 Program Code - - { "21j-5", 0x08000, 0x7a8b8db4, BRF_GRA }, // 6 Characters - - { "21j-a", 0x10000, 0x574face3, BRF_GRA }, // 7 Sprites - { "21j-b", 0x10000, 0x40507a76, BRF_GRA }, // 8 - { "21j-c", 0x10000, 0xbb0bc76f, BRF_GRA }, // 9 - { "21j-d", 0x10000, 0xcb4f231b, BRF_GRA }, // 10 - { "21j-e", 0x10000, 0xa0a0c261, BRF_GRA }, // 11 - { "21j-f", 0x10000, 0x6ba152f6, BRF_GRA }, // 12 - { "21j-g", 0x10000, 0x3220a0b6, BRF_GRA }, // 13 - { "21j-h", 0x10000, 0x65c7517d, BRF_GRA }, // 14 - - { "21j-8", 0x10000, 0x7c435887, BRF_GRA }, // 15 Tiles - { "21j-9", 0x10000, 0xc6640aed, BRF_GRA }, // 16 - { "21j-i", 0x10000, 0x5effb0a0, BRF_GRA }, // 17 - { "21j-j", 0x10000, 0x5fb42e7c, BRF_GRA }, // 18 - - { "21j-6", 0x10000, 0x34755de3, BRF_GRA }, // 19 Samples - { "21j-7", 0x10000, 0x904de6f8, BRF_GRA }, // 20 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 21 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Drvua) -STD_ROM_FN(Drvua) - -static struct BurnRomInfo DrvubRomDesc[] = { - { "21a-1_6.bin", 0x08000, 0xf354b0e1, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "21a-2_4", 0x08000, 0x5cd67657, BRF_ESS | BRF_PRG }, // 1 - { "21a-3", 0x08000, 0xdbf24897, BRF_ESS | BRF_PRG }, // 2 - { "21a-4_2", 0x08000, 0x9b019598, BRF_ESS | BRF_PRG }, // 3 - - { "21jm-0.ic55", 0x04000, 0xf5232d03, BRF_ESS | BRF_PRG }, // 4 HD63701 Program Code - - { "21j-0-1", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 5 M6809 Program Code - - { "21j-5", 0x08000, 0x7a8b8db4, BRF_GRA }, // 6 Characters - - { "21j-a", 0x10000, 0x574face3, BRF_GRA }, // 7 Sprites - { "21j-b", 0x10000, 0x40507a76, BRF_GRA }, // 8 - { "21j-c", 0x10000, 0xbb0bc76f, BRF_GRA }, // 9 - { "21j-d", 0x10000, 0xcb4f231b, BRF_GRA }, // 10 - { "21j-e", 0x10000, 0xa0a0c261, BRF_GRA }, // 11 - { "21j-f", 0x10000, 0x6ba152f6, BRF_GRA }, // 12 - { "21j-g", 0x10000, 0x3220a0b6, BRF_GRA }, // 13 - { "21j-h", 0x10000, 0x65c7517d, BRF_GRA }, // 14 - - { "21j-8", 0x10000, 0x7c435887, BRF_GRA }, // 15 Tiles - { "21j-9", 0x10000, 0xc6640aed, BRF_GRA }, // 16 - { "21j-i", 0x10000, 0x5effb0a0, BRF_GRA }, // 17 - { "21j-j", 0x10000, 0x5fb42e7c, BRF_GRA }, // 18 - - { "21j-6", 0x10000, 0x34755de3, BRF_GRA }, // 19 Samples - { "21j-7", 0x10000, 0x904de6f8, BRF_GRA }, // 20 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 21 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Drvub) -STD_ROM_FN(Drvub) - -static struct BurnRomInfo Drvb2RomDesc[] = { - { "b2_4.bin", 0x08000, 0x668dfa19, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "b2_5.bin", 0x08000, 0x5779705e, BRF_ESS | BRF_PRG }, // 1 - { "b2_6.bin", 0x08000, 0x3bdea613, BRF_ESS | BRF_PRG }, // 2 - { "b2_7.bin", 0x08000, 0x728f87b9, BRF_ESS | BRF_PRG }, // 3 - - { "63701.bin", 0x04000, 0xf5232d03, BRF_ESS | BRF_PRG }, // 4 HD63701 Program Code - - { "b2_3.bin", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 5 M6809 Program Code - - { "b2_8.bin", 0x08000, 0x7a8b8db4, BRF_GRA }, // 6 Characters - - { "11.bin", 0x10000, 0x574face3, BRF_GRA }, // 7 Sprites - { "12.bin", 0x10000, 0x40507a76, BRF_GRA }, // 8 - { "13.bin", 0x10000, 0xc8b91e17, BRF_GRA }, // 9 - { "14.bin", 0x10000, 0xcb4f231b, BRF_GRA }, // 10 - { "15.bin", 0x10000, 0xa0a0c261, BRF_GRA }, // 11 - { "16.bin", 0x10000, 0x6ba152f6, BRF_GRA }, // 12 - { "17.bin", 0x10000, 0x3220a0b6, BRF_GRA }, // 13 - { "18.bin", 0x10000, 0x65c7517d, BRF_GRA }, // 14 - - { "9.bin", 0x10000, 0x7c435887, BRF_GRA }, // 15 Tiles - { "10.bin", 0x10000, 0xc6640aed, BRF_GRA }, // 16 - { "19.bin", 0x10000, 0x22d65df2, BRF_GRA }, // 17 - { "20.bin", 0x10000, 0x5fb42e7c, BRF_GRA }, // 18 - - { "b2_1.bin", 0x10000, 0x34755de3, BRF_GRA }, // 19 Samples - { "2.bin", 0x10000, 0x904de6f8, BRF_GRA }, // 20 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 21 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Drvb2) -STD_ROM_FN(Drvb2) - -static struct BurnRomInfo DrvbRomDesc[] = { - { "21j-1.26", 0x08000, 0xae714964, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "21j-2-3.25", 0x08000, 0x5779705e, BRF_ESS | BRF_PRG }, // 1 - { "21a-3.24", 0x08000, 0xdbf24897, BRF_ESS | BRF_PRG }, // 2 - { "21j-4.23", 0x08000, 0x6c9f46fa, BRF_ESS | BRF_PRG }, // 3 - - { "ic38", 0x04000, 0x6a6a0325, BRF_ESS | BRF_PRG }, // 4 HD6309 Program Code - - { "21j-0-1", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 5 M6809 Program Code - - { "21j-5", 0x08000, 0x7a8b8db4, BRF_GRA }, // 6 Characters - - { "21j-a", 0x10000, 0x574face3, BRF_GRA }, // 7 Sprites - { "21j-b", 0x10000, 0x40507a76, BRF_GRA }, // 8 - { "21j-c", 0x10000, 0xbb0bc76f, BRF_GRA }, // 9 - { "21j-d", 0x10000, 0xcb4f231b, BRF_GRA }, // 10 - { "21j-e", 0x10000, 0xa0a0c261, BRF_GRA }, // 11 - { "21j-f", 0x10000, 0x6ba152f6, BRF_GRA }, // 12 - { "21j-g", 0x10000, 0x3220a0b6, BRF_GRA }, // 13 - { "21j-h", 0x10000, 0x65c7517d, BRF_GRA }, // 14 - - { "21j-8", 0x10000, 0x7c435887, BRF_GRA }, // 15 Tiles - { "21j-9", 0x10000, 0xc6640aed, BRF_GRA }, // 16 - { "21j-i", 0x10000, 0x5effb0a0, BRF_GRA }, // 17 - { "21j-j", 0x10000, 0x5fb42e7c, BRF_GRA }, // 18 - - { "21j-6", 0x10000, 0x34755de3, BRF_GRA }, // 19 Samples - { "21j-7", 0x10000, 0x904de6f8, BRF_GRA }, // 20 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 21 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Drvb) -STD_ROM_FN(Drvb) - -static struct BurnRomInfo DrvbaRomDesc[] = { - { "5.bin", 0x08000, 0xae714964, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "4.bin", 0x10000, 0x48045762, BRF_ESS | BRF_PRG }, // 1 - { "3.bin", 0x08000, 0xdbf24897, BRF_ESS | BRF_PRG }, // 2 - - { "2_32.bin", 0x04000, 0x67875473, BRF_ESS | BRF_PRG }, // 3 M6803 Program Code - - { "6.bin", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 4 M6809 Program Code - - { "1.bin", 0x08000, 0x7a8b8db4, BRF_GRA }, // 5 Characters - - { "21j-a", 0x10000, 0x574face3, BRF_GRA }, // 6 Sprites - { "21j-b", 0x10000, 0x40507a76, BRF_GRA }, // 7 - { "21j-c", 0x10000, 0xbb0bc76f, BRF_GRA }, // 8 - { "21j-d", 0x10000, 0xcb4f231b, BRF_GRA }, // 9 - { "21j-e", 0x10000, 0xa0a0c261, BRF_GRA }, // 10 - { "21j-f", 0x10000, 0x6ba152f6, BRF_GRA }, // 11 - { "21j-g", 0x10000, 0x3220a0b6, BRF_GRA }, // 12 - { "21j-h", 0x10000, 0x65c7517d, BRF_GRA }, // 13 - - { "21j-8", 0x10000, 0x7c435887, BRF_GRA }, // 14 Tiles - { "21j-9", 0x10000, 0xc6640aed, BRF_GRA }, // 15 - { "21j-i", 0x10000, 0x5effb0a0, BRF_GRA }, // 16 - { "21j-j", 0x10000, 0x5fb42e7c, BRF_GRA }, // 17 - - { "8.bin", 0x10000, 0x34755de3, BRF_GRA }, // 18 Samples - { "7.bin", 0x10000, 0xf9311f72, BRF_GRA }, // 19 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 20 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 21 -}; - -STD_ROM_PICK(Drvba) -STD_ROM_FN(Drvba) - -static struct BurnRomInfo Drv2RomDesc[] = { - { "26a9-04.bin", 0x08000, 0xf2cfc649, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "26aa-03.bin", 0x08000, 0x44dd5d4b, BRF_ESS | BRF_PRG }, // 1 - { "26ab-0.bin", 0x08000, 0x49ddddcd, BRF_ESS | BRF_PRG }, // 2 - { "26ac-0e.63", 0x08000, 0x57acad2c, BRF_ESS | BRF_PRG }, // 3 - - { "26ae-0.bin", 0x10000, 0xea437867, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - - { "26ad-0.bin", 0x08000, 0x75e36cd6, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program Code - - { "26a8-0e.19", 0x10000, 0x4e80cd36, BRF_GRA }, // 6 Characters - - { "26j0-0.bin", 0x20000, 0xdb309c84, BRF_GRA }, // 7 Sprites - { "26j1-0.bin", 0x20000, 0xc3081e0c, BRF_GRA }, // 8 - { "26af-0.bin", 0x20000, 0x3a615aad, BRF_GRA }, // 9 - { "26j2-0.bin", 0x20000, 0x589564ae, BRF_GRA }, // 10 - { "26j3-0.bin", 0x20000, 0xdaf040d6, BRF_GRA }, // 11 - { "26a10-0.bin", 0x20000, 0x6d16d889, BRF_GRA }, // 12 - - { "26j4-0.bin", 0x20000, 0xa8c93e76, BRF_GRA }, // 13 Tiles - { "26j5-0.bin", 0x20000, 0xee555237, BRF_GRA }, // 14 - - { "26j6-0.bin", 0x20000, 0xa84b2a29, BRF_GRA }, // 15 Samples - { "26j7-0.bin", 0x20000, 0xbc6a48d5, BRF_GRA }, // 16 - - { "prom.16", 0x00200, 0x46339529, BRF_GRA }, // 17 PROMs -}; - -STD_ROM_PICK(Drv2) -STD_ROM_FN(Drv2) - -static struct BurnRomInfo Drv2uRomDesc[] = { - { "26a9-04.bin", 0x08000, 0xf2cfc649, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "26aa-03.bin", 0x08000, 0x44dd5d4b, BRF_ESS | BRF_PRG }, // 1 - { "26ab-0.bin", 0x08000, 0x49ddddcd, BRF_ESS | BRF_PRG }, // 2 - { "26ac-02.bin", 0x08000, 0x097eaf26, BRF_ESS | BRF_PRG }, // 3 - - { "26ae-0.bin", 0x10000, 0xea437867, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - - { "26ad-0.bin", 0x08000, 0x75e36cd6, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program Code - - { "26a8-0.bin", 0x10000, 0x3ad1049c, BRF_GRA }, // 6 Characters - - { "26j0-0.bin", 0x20000, 0xdb309c84, BRF_GRA }, // 7 Sprites - { "26j1-0.bin", 0x20000, 0xc3081e0c, BRF_GRA }, // 8 - { "26af-0.bin", 0x20000, 0x3a615aad, BRF_GRA }, // 9 - { "26j2-0.bin", 0x20000, 0x589564ae, BRF_GRA }, // 10 - { "26j3-0.bin", 0x20000, 0xdaf040d6, BRF_GRA }, // 11 - { "26a10-0.bin", 0x20000, 0x6d16d889, BRF_GRA }, // 12 - - { "26j4-0.bin", 0x20000, 0xa8c93e76, BRF_GRA }, // 13 Tiles - { "26j5-0.bin", 0x20000, 0xee555237, BRF_GRA }, // 14 - - { "26j6-0.bin", 0x20000, 0xa84b2a29, BRF_GRA }, // 15 Samples - { "26j7-0.bin", 0x20000, 0xbc6a48d5, BRF_GRA }, // 16 - - { "prom.16", 0x00200, 0x46339529, BRF_GRA }, // 17 PROMs -}; - -STD_ROM_PICK(Drv2u) -STD_ROM_FN(Drv2u) - -static struct BurnRomInfo Drv2bRomDesc[] = { - { "3", 0x08000, 0x5cc38bad, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "4", 0x08000, 0x78750947, BRF_ESS | BRF_PRG }, // 1 - { "5", 0x08000, 0x49ddddcd, BRF_ESS | BRF_PRG }, // 2 - { "6", 0x08000, 0x097eaf26, BRF_ESS | BRF_PRG }, // 3 - - { "2", 0x10000, 0xea437867, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - - { "11", 0x08000, 0x75e36cd6, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program Code - - { "1", 0x10000, 0x3ad1049c, BRF_GRA }, // 6 Characters - - { "27", 0x10000, 0xfe42df5d, BRF_GRA }, // 7 Sprites - { "26", 0x10000, 0x42f582c6, BRF_GRA }, // 8 - { "23", 0x10000, 0xe157319f, BRF_GRA }, // 9 - { "22", 0x10000, 0x82e952c9, BRF_GRA }, // 10 - { "25", 0x10000, 0x4a4a085d, BRF_GRA }, // 11 - { "24", 0x10000, 0xc9d52536, BRF_GRA }, // 12 - { "21", 0x10000, 0x32ab0897, BRF_GRA }, // 13 - { "20", 0x10000, 0xa68e168f, BRF_GRA }, // 14 - { "17", 0x10000, 0x882f99b1, BRF_GRA }, // 15 - { "16", 0x10000, 0xe2fe3eca, BRF_GRA }, // 16 - { "18", 0x10000, 0x0e1c6c63, BRF_GRA }, // 17 - { "19", 0x10000, 0x0e21eae0, BRF_GRA }, // 18 - - { "15", 0x10000, 0x3c3f16f6, BRF_GRA }, // 19 Tiles - { "13", 0x10000, 0x7c21be72, BRF_GRA }, // 20 - { "14", 0x10000, 0xe92f91f4, BRF_GRA }, // 21 - { "12", 0x10000, 0x6896e2f7, BRF_GRA }, // 22 - - { "7", 0x10000, 0x6d9e3f0f, BRF_GRA }, // 23 Samples - { "9", 0x10000, 0x0c15dec9, BRF_GRA }, // 24 - { "8", 0x10000, 0x151b22b4, BRF_GRA }, // 25 - { "10", 0x10000, 0xae2fc028, BRF_GRA }, // 26 - - { "prom.16", 0x00200, 0x46339529, BRF_GRA }, // 27 PROMs -}; - -STD_ROM_PICK(Drv2b) -STD_ROM_FN(Drv2b) - -static struct BurnRomInfo Drv2b2RomDesc[] = { - // f205v id 1182 - { "dd2ub-3.3g", 0x08000, 0xf5bd19d2, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "dd2ub-4.4g", 0x08000, 0x78750947, BRF_ESS | BRF_PRG }, // 1 - { "26ab-0.bin", 0x08000, 0x49ddddcd, BRF_ESS | BRF_PRG }, // 2 - { "dd2ub-6.5g", 0x08000, 0x097eaf26, BRF_ESS | BRF_PRG }, // 3 - - { "26ae-0.bin", 0x10000, 0xea437867, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - - { "26ad-0.bin", 0x08000, 0x75e36cd6, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program Code - -// { "dd2ub-1.2r", 0x10000, 0xadd7ffc6, BRF_GRA }, // 6 Characters - BAD DUMP - { "26a8-0.bin", 0x10000, 0x3ad1049c, BRF_GRA }, // 6 Characters - using US one due to Winners Don't Use Drugs screen - - { "dd2ub-27.8n", 0x10000, 0xfe42df5d, BRF_GRA }, // 7 Sprites - { "dd2ub-26.7n", 0x10000, 0xd2d9a400, BRF_GRA }, // 8 - { "dd2ub-23.8k", 0x10000, 0xe157319f, BRF_GRA }, // 9 - { "dd2ub-22.7k", 0x10000, 0x9f10018c, BRF_GRA }, // 10 - { "dd2ub-25.6n", 0x10000, 0x4a4a085d, BRF_GRA }, // 11 - { "dd2ub-24.5n", 0x10000, 0xc9d52536, BRF_GRA }, // 12 - { "dd2ub-21.8g", 0x10000, 0x32ab0897, BRF_GRA }, // 13 - { "dd2ub-20.7g", 0x10000, 0xf564bd18, BRF_GRA }, // 14 - { "dd2ub-17.8d", 0x10000, 0x882f99b1, BRF_GRA }, // 15 - { "dd2ub-16.7d", 0x10000, 0xcf3c34d5, BRF_GRA }, // 16 - { "dd2ub-18.9d", 0x10000, 0x0e1c6c63, BRF_GRA }, // 17 - { "dd2ub-19.10d", 0x10000, 0x0e21eae0, BRF_GRA }, // 18 - - { "dd2ub-15.5d", 0x10000, 0x3c3f16f6, BRF_GRA }, // 19 Tiles - { "dd2ub-13.4d", 0x10000, 0x7c21be72, BRF_GRA }, // 20 - { "dd2ub-14.5b", 0x10000, 0xe92f91f4, BRF_GRA }, // 21 - { "dd2ub-12.4b", 0x10000, 0x6896e2f7, BRF_GRA }, // 22 - - { "dd2ub-7.3f", 0x10000, 0x6d9e3f0f, BRF_GRA }, // 23 Samples - { "dd2ub-9.5c", 0x10000, 0x0c15dec9, BRF_GRA }, // 24 - { "dd2ub-8.3d", 0x10000, 0x151b22b4, BRF_GRA }, // 25 - { "dd2ub-10.5b", 0x10000, 0x95885e12, BRF_GRA }, // 26 -}; - -STD_ROM_PICK(Drv2b2) -STD_ROM_FN(Drv2b2) - -static struct BurnRomInfo DdungeonRomDesc[] = { - { "dd26.26", 0x08000, 0xa6e7f608, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "dd25.25", 0x08000, 0x922e719c, BRF_ESS | BRF_PRG }, // 1 - - { "63701.bin", 0x04000, 0xf5232d03, BRF_ESS | BRF_PRG }, // 2 HD63701 Program Code - - { "dd30.30", 0x08000, 0xef1af99a, BRF_ESS | BRF_PRG }, // 3 M6809 Program Code - - { "dd_mcu.bin", 0x00800, 0x34cbb2d3, BRF_ESS | BRF_PRG }, // 4 M68705 MCU Program Code - - { "dd20.20", 0x08000, 0xd976b78d, BRF_GRA }, // 5 Characters - - { "dd117.117", 0x08000, 0xe912ca81, BRF_GRA }, // 6 Sprites - { "dd113.113", 0x08000, 0x43264ad8, BRF_GRA }, // 7 - - { "dd78.78", 0x08000, 0x3deacae9, BRF_GRA }, // 8 Tiles - { "dd109.109", 0x08000, 0x5a2f31eb, BRF_GRA }, // 9 - - { "21j-6", 0x10000, 0x34755de3, BRF_GRA }, // 10 Samples - { "21j-7", 0x10000, 0x904de6f8, BRF_GRA }, // 11 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 12 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 13 -}; - -STD_ROM_PICK(Ddungeon) -STD_ROM_FN(Ddungeon) - -static struct BurnRomInfo DarktowrRomDesc[] = { - { "dt.26", 0x08000, 0x8134a472, BRF_ESS | BRF_PRG }, // 0 HD6309 Program Code - { "21j-2-3.25", 0x08000, 0x5779705e, BRF_ESS | BRF_PRG }, // 1 - { "dt.24", 0x08000, 0x523a5413, BRF_ESS | BRF_PRG }, // 2 - - { "63701.bin", 0x04000, 0xf5232d03, BRF_ESS | BRF_PRG }, // 3 HD63701 Program Code - - { "21j-0-1", 0x08000, 0x9efa95bb, BRF_ESS | BRF_PRG }, // 4 M6809 Program Code - - { "68705prt.mcu", 0x00800, 0x34cbb2d3, BRF_ESS | BRF_PRG }, // 5 M68705 MCU Program Code - - { "dt.20", 0x08000, 0x860b0298, BRF_GRA }, // 6 Characters - - { "dt.117", 0x10000, 0x750dd0fa, BRF_GRA }, // 7 Sprites - { "dt.116", 0x10000, 0x22cfa87b, BRF_GRA }, // 8 - { "dt.115", 0x10000, 0x8a9f1c34, BRF_GRA }, // 9 - { "21j-d", 0x10000, 0xcb4f231b, BRF_GRA }, // 10 - { "dt.113", 0x10000, 0x7b4bbf9c, BRF_GRA }, // 11 - { "dt.112", 0x10000, 0xdf3709d4, BRF_GRA }, // 12 - { "dt.111", 0x10000, 0x59032154, BRF_GRA }, // 13 - { "21j-h", 0x10000, 0x65c7517d, BRF_GRA }, // 14 - - { "dt.78", 0x10000, 0x72c15604, BRF_GRA }, // 15 Tiles - { "21j-9", 0x10000, 0xc6640aed, BRF_GRA }, // 16 - { "dt.109", 0x10000, 0x15bdcb62, BRF_GRA }, // 17 - { "21j-j", 0x10000, 0x5fb42e7c, BRF_GRA }, // 18 - - { "21j-6", 0x10000, 0x34755de3, BRF_GRA }, // 19 Samples - { "21j-7", 0x10000, 0x904de6f8, BRF_GRA }, // 20 - - { "21j-k-0.101", 0x00100, 0xfdb130a9, BRF_GRA }, // 21 PROMs - { "21j-l-0.16", 0x00200, 0x46339529, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Darktowr) -STD_ROM_FN(Darktowr) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvHD6309Rom = Next; Next += 0x30000; - DrvSubCPURom = Next; Next += 0x04000; - DrvSoundCPURom = Next; Next += 0x08000; - DrvMSM5205Rom = Next; Next += 0x20000; - - RamStart = Next; - - DrvHD6309Ram = Next; Next += 0x01000; - DrvSubCPURam = Next; Next += 0x00fd0; - DrvSoundCPURam = Next; Next += 0x01000; - DrvFgVideoRam = Next; Next += 0x00800; - DrvSpriteRam = Next; Next += 0x01000; - DrvBgVideoRam = Next; Next += 0x00800; - DrvPaletteRam1 = Next; Next += 0x00200; - DrvPaletteRam2 = Next; Next += 0x00200; - - RamEnd = Next; - - DrvChars = Next; Next += 0x0400 * 8 * 8; - DrvTiles = Next; Next += 0x0800 * 16 * 16; - DrvSprites = Next; Next += 0x1000 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00180 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 Drv2MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvHD6309Rom = Next; Next += 0x30000; - DrvSubCPURom = Next; Next += 0x10000; - DrvSoundCPURom = Next; Next += 0x08000; - MSM6295ROM = Next; Next += 0x40000; - - RamStart = Next; - - DrvHD6309Ram = Next; Next += 0x01800; - DrvSoundCPURam = Next; Next += 0x00800; - DrvFgVideoRam = Next; Next += 0x00800; - DrvSpriteRam = Next; Next += 0x01000; - DrvBgVideoRam = Next; Next += 0x00800; - DrvPaletteRam1 = Next; Next += 0x00200; - DrvPaletteRam2 = Next; Next += 0x00200; - - RamEnd = Next; - - DrvChars = Next; Next += 0x0800 * 8 * 8; - DrvTiles = Next; Next += 0x0800 * 16 * 16; - DrvSprites = Next; Next += 0x1800 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00180 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DarktowrMemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvHD6309Rom = Next; Next += 0x30000; - DrvSubCPURom = Next; Next += 0x04000; - DrvSoundCPURom = Next; Next += 0x08000; - DrvMCURom = Next; Next += 0x00800; - DrvMSM5205Rom = Next; Next += 0x20000; - - RamStart = Next; - - DrvHD6309Ram = Next; Next += 0x01000; - DrvSubCPURam = Next; Next += 0x00fd0; - DrvSoundCPURam = Next; Next += 0x01000; - DrvMCURam = Next; Next += 0x00078; - DrvMCUPorts = Next; Next += 0x00008; - DrvFgVideoRam = Next; Next += 0x00800; - DrvSpriteRam = Next; Next += 0x01000; - DrvBgVideoRam = Next; Next += 0x00800; - DrvPaletteRam1 = Next; Next += 0x00200; - DrvPaletteRam2 = Next; Next += 0x00200; - - RamEnd = Next; - - DrvChars = Next; Next += 0x0400 * 8 * 8; - DrvTiles = Next; Next += 0x0800 * 16 * 16; - DrvSprites = Next; Next += 0x1000 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00180 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - HD6309Open(0); - HD6309Reset(); - HD6309Close(); - - if (DrvSubCPUType == DD_CPU_TYPE_HD63701) { - HD63701Reset(); - } - - if (DrvSubCPUType == DD_CPU_TYPE_HD6309) { - HD6309Open(1); - HD6309Reset(); - HD6309Close(); - } - - if (DrvSubCPUType == DD_CPU_TYPE_M6803) { - M6803Reset(); - } - - if (DrvSubCPUType == DD_CPU_TYPE_Z80) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } - - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) { - M6809Open(0); - M6809Reset(); - M6809Close(); - - MSM5205Reset(); - } - - if (DrvSoundCPUType == DD_CPU_TYPE_Z80) { - ZetOpen(1); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - } - - if (DrvGameType == DD_GAME_DARKTOWR) { - m68705Reset(); - } - - BurnYM2151Reset(); - - DrvRomBank = 0; - DrvVBlank = 0; - DrvSubCPUBusy = 1; - DrvSoundLatch = 0; - DrvScrollXHi = 0; - DrvScrollYHi = 0; - DrvScrollXLo = 0; - DrvScrollYLo = 0; - - DrvADPCMIdle[0] = 1; - DrvADPCMIdle[1] = 1; - DrvADPCMPos[0] = 0; - DrvADPCMPos[1] = 0; - DrvADPCMEnd[0] = 0; - DrvADPCMEnd[1] = 0; - DrvADPCMData[0] = -1; - DrvADPCMData[1] = -1; - - return 0; -} - -UINT8 DrvDdragonHD6309ReadByte(UINT16 Address) -{ - if (Address >= 0x2000 && Address <= 0x2fff) { - if (Address == 0x2049 && HD6309GetPC(0) == 0x6261 && DrvSpriteRam[0x0049] == 0x1f) return 0x01; - return DrvSpriteRam[Address - 0x2000]; - } - - if (DrvGameType == DD_GAME_DARKTOWR && Address >= 0x4000 && Address <= 0x7fff) { - UINT32 Offset = Address - 0x4000; - - if (Offset == 0x1401 || Offset == 0x0001) return DrvMCUPorts[0]; - return 0xff; - } - - switch (Address) { - case 0x3800: { - return DrvInput[0]; - } - - case 0x3801: { - return DrvInput[1]; - } - - case 0x3802: { - return DrvInput[2] | ((DrvVBlank) ? 0x08 : 0) | (DrvSubCPUBusy ? 0x10 : 0); - } - - case 0x3803: { - return DrvDip[0]; - } - - case 0x3804: { - return DrvDip[1]; - } - - case 0x380a: - case 0x380b: { - // ??? - return 0; - } - } - - bprintf(PRINT_NORMAL, _T("HD6309 Read Byte -> %04X\n"), Address); - - return 0; -} - -void DrvDdragonHD6309WriteByte(UINT16 Address, UINT8 Data) -{ - if (DrvGameType == DD_GAME_DARKTOWR && Address >= 0x4000 && Address <= 0x7fff) { - UINT32 Offset = Address - 0x4000; - - if (Offset == 0x1400 || Offset == 0x0000) { - DrvMCUPorts[1] = BITSWAP08(Data, 0, 1, 2, 3, 4, 5, 6, 7); - } - return; - } - - switch (Address) { - case 0x3808: { - UINT8 DrvOldRomBank = DrvRomBank; - DrvRomBank = (Data & 0xe0) >> 5; - HD6309MapMemory(DrvHD6309Rom + 0x8000 + (DrvRomBank * 0x4000), 0x4000, 0x7fff, MAP_ROM); - - DrvScrollXHi = (Data & 0x01) << 8; - DrvScrollYHi = (Data & 0x02) << 7; - - if (Data & 0x10) { - DrvSubCPUBusy = 0; - } else { - if (DrvSubCPUBusy == 0) { - if (DrvSubCPUType == DD_CPU_TYPE_HD63701) { - HD63701SetIRQLine(HD63701_INPUT_LINE_NMI, CPU_IRQSTATUS_ACK); - } - - if (DrvSubCPUType == DD_CPU_TYPE_HD6309) { - HD6309Close(); - HD6309Open(1); - HD6309SetIRQLine(HD6309_INPUT_LINE_NMI, CPU_IRQSTATUS_ACK); - HD6309Close(); - HD6309Open(0); - } - - if (DrvSubCPUType == DD_CPU_TYPE_M6803) { - M6803SetIRQLine(M6803_INPUT_LINE_NMI, CPU_IRQSTATUS_ACK); - } - - if (DrvSubCPUType == DD_CPU_TYPE_Z80) { - ZetOpen(0); - ZetNmi(); - ZetClose(); - } - } - } - - if (DrvGameType == DD_GAME_DARKTOWR) { - if (DrvRomBank == 4 && DrvOldRomBank != 4) { - HD6309MemCallback(0x4000, 0x7fff, MAP_RAM); - } else { - if (DrvRomBank != 4 && DrvOldRomBank == 4) { - HD6309MapMemory(DrvHD6309Rom + 0x8000 + (DrvRomBank * 0x4000), 0x4000, 0x7fff, MAP_ROM); - } - } - } - - return; - } - - case 0x3809: { - DrvScrollXLo = Data; - return; - } - - case 0x380a: { - DrvScrollYLo = Data; - return; - } - - case 0x380b: { - HD6309SetIRQLine(HD6309_INPUT_LINE_NMI, CPU_IRQSTATUS_NONE); - return; - } - - case 0x380c: { - HD6309SetIRQLine(HD6309_FIRQ_LINE, CPU_IRQSTATUS_NONE); - return; - } - - case 0x380d: { - HD6309SetIRQLine(HD6309_IRQ_LINE, CPU_IRQSTATUS_NONE); - return; - } - - case 0x380e: { - DrvSoundLatch = Data; - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) { - M6809Open(0); - M6809SetIRQLine(M6809_IRQ_LINE, CPU_IRQSTATUS_ACK); - M6809Close(); - } - - if (DrvSoundCPUType == DD_CPU_TYPE_Z80) { - ZetOpen(1); - ZetNmi(); - ZetClose(); - } - return; - } - - case 0x380f: { - // ??? - return; - } - } - -// bprintf(PRINT_NORMAL, _T("HD6309 Write Byte -> %04X, %02X\n"), Address, Data); -} - -UINT8 DrvDdragonHD63701ReadByte(UINT16 Address) -{ - if (Address >= 0x0020 && Address <= 0x0fff) { - return DrvSubCPURam[Address - 0x0020]; - } - - if (Address >= 0x8000 && Address <= 0x8fff) { - if (Address == 0x8049 && HD63701GetPC(0) == 0x6261 && DrvSpriteRam[0x0049] == 0x1f) return 0x01; - return DrvSpriteRam[Address - 0x8000]; - } - - bprintf(PRINT_NORMAL, _T("M6800 Read Byte -> %04X\n"), Address); - - return 0; -} - -void DrvDdragonHD63701WriteByte(UINT16 Address, UINT8 Data) -{ - if (Address <= 0x001f) { - if (Address == 0x17) { - if (Data & 3) { - HD6309Open(0); - HD6309SetIRQLine(HD6309_IRQ_LINE, CPU_IRQSTATUS_ACK); - HD6309Close(); - - HD63701SetIRQLine(HD63701_INPUT_LINE_NMI, CPU_IRQSTATUS_NONE); - } - } - return; - } - - if (Address >= 0x0020 && Address <= 0x0fff) { - DrvSubCPURam[Address - 0x0020] = Data; - return; - } - - if (Address >= 0x8000 && Address <= 0x8fff) { - if (Address == 0x8000) DrvSubCPUBusy = 1; - DrvSpriteRam[Address - 0x8000] = Data; - return; - } - - bprintf(PRINT_NORMAL, _T("M6800 Write Byte -> %04X, %02X\n"), Address, Data); -} - -UINT8 DrvDdragonbSubHD6309ReadByte(UINT16 Address) -{ - if (Address >= 0x0020 && Address <= 0x0fff) { - return DrvSubCPURam[Address - 0x0020]; - } - - if (Address >= 0x8000 && Address <= 0x8fff) { - return DrvSpriteRam[Address - 0x8000]; - } - - bprintf(PRINT_NORMAL, _T("Sub HD6309 Read Byte -> %04X\n"), Address); - - return 0; -} - -void DrvDdragonbSubHD6309WriteByte(UINT16 Address, UINT8 Data) -{ - if (Address <= 0x001f) { - if (Address == 0x17) { - if (Data & 3) { - HD6309Close(); - - HD6309Open(0); - HD6309SetIRQLine(HD6309_IRQ_LINE, CPU_IRQSTATUS_ACK); - HD6309Close(); - - HD6309Open(1); - HD6309SetIRQLine(HD6309_INPUT_LINE_NMI, CPU_IRQSTATUS_NONE); - } - } - return; - } - - if (Address >= 0x0020 && Address <= 0x0fff) { - DrvSubCPURam[Address - 0x0020] = Data; - return; - } - - if (Address >= 0x8000 && Address <= 0x8fff) { - if (Address == 0x8000) DrvSubCPUBusy = 1; - DrvSpriteRam[Address - 0x8000] = Data; - return; - } - - bprintf(PRINT_NORMAL, _T("Sub HD6309 Write Byte -> %04X, %02X\n"), Address, Data); -} - -UINT8 DrvDdragonbaM6803ReadByte(UINT16 Address) -{ - if (Address >= 0x0020 && Address <= 0x0fff) { - return DrvSubCPURam[Address - 0x0020]; - } - - if (Address >= 0x8000 && Address <= 0x8fff) { - return DrvSpriteRam[Address - 0x8000]; - } - - bprintf(PRINT_NORMAL, _T("M6803 Read Byte -> %04X\n"), Address); - - return 0; -} - -void DrvDdragonbaM6803WriteByte(UINT16 Address, UINT8 Data) -{ - if (Address >= 0x0020 && Address <= 0x0fff) { - DrvSubCPURam[Address - 0x0020] = Data; - return; - } - - if (Address >= 0x8000 && Address <= 0x8fff) { - if (Address == 0x8000) DrvSubCPUBusy = 1; - DrvSpriteRam[Address - 0x8000] = Data; - return; - } - - if (Address <= 0x001f) { - m6803_internal_registers_w(Address, Data); - return; - } - - bprintf(PRINT_NORMAL, _T("M6803 Write Byte -> %04X, %02X\n"), Address, Data); -} - -void DrvDdragonbaM6803WritePort(UINT16, UINT8) -{ - M6803SetIRQLine(M6803_INPUT_LINE_NMI, CPU_IRQSTATUS_NONE); - - HD6309Open(0); - HD6309SetIRQLine(HD6309_IRQ_LINE, CPU_IRQSTATUS_ACK); - HD6309Close(); -} - -void __fastcall Ddragon2SubZ80Write(UINT16 Address, UINT8 Data) -{ - if (Address >= 0xc000 && Address <= 0xc3ff) { - if (Address == 0xc000) DrvSubCPUBusy = 1; - DrvSpriteRam[Address - 0xc000] = Data; - return; - } - - switch (Address) { - case 0xd000: { - // Lower NMI - return; - } - - case 0xe000: { - HD6309Open(0); - HD6309SetIRQLine(HD6309_IRQ_LINE, CPU_IRQSTATUS_ACK); - HD6309Close(); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Sub Z80 Write => %04X, %02X\n"), Address, Data); - } - } -} - -UINT8 DrvDdragonM6809ReadByte(UINT16 Address) -{ - switch (Address) { - case 0x1000: { - M6809SetIRQLine(M6809_IRQ_LINE, CPU_IRQSTATUS_NONE); - return DrvSoundLatch; - } - - case 0x1800: { - return DrvADPCMIdle[0] + (DrvADPCMIdle[1] << 1); - } - - case 0x2801: { - return BurnYM2151ReadStatus(); - } - } - - bprintf(PRINT_NORMAL, _T("M6809 Read Byte -> %04X\n"), Address); - - return 0; -} - - -void DrvDdragonM6809WriteByte(UINT16 Address, UINT8 Data) -{ - switch (Address) { - case 0x2800: { - BurnYM2151SelectRegister(Data); - return; - } - - case 0x2801: { - BurnYM2151WriteRegister(Data); - return; - } - - case 0x3800: { - DrvADPCMIdle[0] = 0; - MSM5205ResetWrite(0, 0); - return; - } - - case 0x3801: { - DrvADPCMIdle[1] = 0; - MSM5205ResetWrite(1, 0); - return; - } - - case 0x3802: { - DrvADPCMEnd[0] = (Data & 0x7f) * 0x200; - return; - } - - case 0x3803: { - DrvADPCMEnd[1] = (Data & 0x7f) * 0x200; - return; - } - - case 0x3804: { - DrvADPCMPos[0] = (Data & 0x7f) * 0x200; - return; - } - - case 0x3805: { - DrvADPCMPos[1] = (Data & 0x7f) * 0x200; - return; - } - - case 0x3806: { - DrvADPCMIdle[0] = 1; - MSM5205ResetWrite(0, 1); - return; - } - - case 0x3807: { - DrvADPCMIdle[1] = 1; - MSM5205ResetWrite(1, 1); - return; - } - } - - bprintf(PRINT_NORMAL, _T("M6809 Write Byte -> %04X, %02X\n"), Address, Data); -} - -UINT8 __fastcall Ddragon2SoundZ80Read(UINT16 Address) -{ - switch (Address) { - case 0x8801: { - return BurnYM2151ReadStatus(); - } - - case 0x9800: { - return MSM6295ReadStatus(0); - } - - case 0xa000: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Sound Z80 Read => %04X\n"), Address); - } - } - - return 0; -} - -void __fastcall Ddragon2SoundZ80Write(UINT16 Address, UINT8 Data) -{ - switch (Address) { - case 0x8800: { - BurnYM2151SelectRegister(Data); - return; - } - - case 0x8801: { - BurnYM2151WriteRegister(Data); - return; - } - - case 0x9800: { - MSM6295Command(0, Data); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Sound Z80 Write => %04X, %02X\n"), Address, Data); - } - } -} - -UINT8 DrvMCUReadByte(UINT16 Address) -{ - if (Address <= 0x0007) { - return DrvMCUPorts[Address]; - } - - bprintf(PRINT_NORMAL, _T("M68705 Read Byte -> %04X\n"), Address); - - return 0; -} - -void DrvMCUWriteByte(UINT16 Address, UINT8 Data) -{ - if (Address <= 0x0007) { - DrvMCUPorts[Address] = Data; - return; - } - - bprintf(PRINT_NORMAL, _T("M68705 Write Byte -> %04X, %02X\n"), Address, Data); -} - -static INT32 CharPlaneOffsets[4] = { 0, 2, 4, 6 }; -static INT32 CharXOffsets[8] = { 1, 0, 65, 64, 129, 128, 193, 192 }; -static INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 TilePlaneOffsets[4] = { 0x100000, 0x100004, 0, 4 }; -static INT32 DdungeonTilePlaneOffsets[4] = { 0x080000, 0x080004, 0, 4 }; -static INT32 TileXOffsets[16] = { 3, 2, 1, 0, 131, 130, 129, 128, 259, 258, 257, 256, 387, 386, 385, 384 }; -static INT32 TileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 SpritePlaneOffsets[4] = { 0x200000, 0x200004, 0, 4 }; -static INT32 Dd2SpritePlaneOffsets[4] = { 0x300000, 0x300004, 0, 4 }; - -static void DrvYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - M6809SetIRQLine(M6809_FIRQ_LINE, CPU_IRQSTATUS_ACK); -#if 1 - // This fixes music tempo but breaks MSM5205 sound if we use the M6809 for the MSM5205 timing, - // because the interleave run count is 190 cycles - nCyclesDone[2] += M6809Run(1000); -#endif - } else { - M6809SetIRQLine(M6809_FIRQ_LINE, CPU_IRQSTATUS_NONE); - } -} - -static void Ddragon2YM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)HD6309TotalCycles() * nSoundRate / ((INT32)(nCyclesTotal[0] * 57.444853))); -} - -static void DrvMSM5205Vck0() -{ - if (DrvADPCMPos[0] >= DrvADPCMEnd[0] || DrvADPCMPos[0] >= 0x10000) { - DrvADPCMIdle[0] = 1; - MSM5205ResetWrite(0, 1); - } else { - if (DrvADPCMData[0] != -1) { - MSM5205DataWrite(0, DrvADPCMData[0] & 0x0f); - DrvADPCMData[0] = -1; - } else { - UINT8 *ROM = DrvMSM5205Rom + 0x00000; - - DrvADPCMData[0] = ROM[(DrvADPCMPos[0]++) & 0xffff]; - MSM5205DataWrite(0, DrvADPCMData[0] >> 4); - } - } -} - -static void DrvMSM5205Vck1() -{ - if (DrvADPCMPos[1] >= DrvADPCMEnd[1] || DrvADPCMPos[1] >= 0x10000) { - DrvADPCMIdle[1] = 1; - MSM5205ResetWrite(1, 1); - } else { - if (DrvADPCMData[1] != -1) { - MSM5205DataWrite(1, DrvADPCMData[1] & 0x0f); - DrvADPCMData[1] = -1; - } else { - UINT8 *ROM = DrvMSM5205Rom + 0x10000; - - DrvADPCMData[1] = ROM[(DrvADPCMPos[1]++) & 0xffff]; - MSM5205DataWrite(1, DrvADPCMData[1] >> 4); - } - } -} - -static INT32 DrvMemInit() -{ - INT32 nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - return 0; -} - -static INT32 Drv2MemInit() -{ - INT32 nLen; - - // Allocate and Blank all required memory - Mem = NULL; - Drv2MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - Drv2MemIndex(); - - return 0; -} - -static INT32 DarktowrMemInit() -{ - INT32 nLen; - - // Allocate and Blank all required memory - Mem = NULL; - DarktowrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - DarktowrMemIndex(); - - return 0; -} - -static INT32 DrvLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load HD6309 Program Roms - nRet = BurnLoadRom(DrvHD6309Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x08000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x10000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x18000, 3, 1); if (nRet != 0) return 1; - - // Load HD63701 Program Roms - nRet = BurnLoadRom(DrvSubCPURom + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load M6809 Program Roms - nRet = BurnLoadRom(DrvSoundCPURom + 0x00000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 14, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 18, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load samples - nRet = BurnLoadRom(DrvMSM5205Rom + 0x00000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvMSM5205Rom + 0x10000, 20, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 DrvbaLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load HD6309 Program Roms - nRet = BurnLoadRom(DrvHD6309Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x08000, 1, 1); if (nRet != 0) return 1; - memcpy(DrvHD6309Rom + 0x18000, DrvHD6309Rom + 0x10000, 0x8000); - nRet = BurnLoadRom(DrvHD6309Rom + 0x10000, 2, 1); if (nRet != 0) return 1; - - // Load M6803 Program Roms - nRet = BurnLoadRom(DrvSubCPURom + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load M6809 Program Roms - nRet = BurnLoadRom(DrvSoundCPURom + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 13, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 17, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load samples - nRet = BurnLoadRom(DrvMSM5205Rom + 0x00000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvMSM5205Rom + 0x10000, 19, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 Drv2LoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0xc0000); - - // Load HD6309 Program Roms - nRet = BurnLoadRom(DrvHD6309Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x08000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x10000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x18000, 3, 1); if (nRet != 0) return 1; - - // Load HD63701 Program Roms - nRet = BurnLoadRom(DrvSubCPURom + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load M6809 Program Roms - nRet = BurnLoadRom(DrvSoundCPURom + 0x00000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0xc0000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x1800, 4, 16, 16, Dd2SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0xc0000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 14, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load samples - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x20000, 16, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 Drv2bLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0xc0000); - - // Load HD6309 Program Roms - nRet = BurnLoadRom(DrvHD6309Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x08000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x10000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x18000, 3, 1); if (nRet != 0) return 1; - - // Load HD63701 Program Roms - nRet = BurnLoadRom(DrvSubCPURom + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load M6809 Program Roms - nRet = BurnLoadRom(DrvSoundCPURom + 0x00000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0xc0000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x90000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xb0000, 18, 1); if (nRet != 0) return 1; - GfxDecode(0x1800, 4, 16, 16, Dd2SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0xc0000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 22, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load samples - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x10000, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x20000, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x30000, 26, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 DdungeonLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load HD6309 Program Roms - nRet = BurnLoadRom(DrvHD6309Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x08000, 1, 1); if (nRet != 0) return 1; - - // Load HD63701 Program Roms - nRet = BurnLoadRom(DrvSubCPURom + 0x00000, 2, 1); if (nRet != 0) return 1; - - // Load M6809 Program Roms - nRet = BurnLoadRom(DrvSoundCPURom + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load M68705 MCU Program Roms - nRet = BurnLoadRom(DrvMCURom + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 9, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, DdungeonTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load samples - nRet = BurnLoadRom(DrvMSM5205Rom + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvMSM5205Rom + 0x10000, 11, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 DarktowrLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load HD6309 Program Roms - nRet = BurnLoadRom(DrvHD6309Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x08000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvHD6309Rom + 0x10000, 2, 1); if (nRet != 0) return 1; - - // Load HD63701 Program Roms - nRet = BurnLoadRom(DrvSubCPURom + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load M6809 Program Roms - nRet = BurnLoadRom(DrvSoundCPURom + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load M68705 MCU Program Roms - nRet = BurnLoadRom(DrvMCURom + 0x00000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 14, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 18, 1); if (nRet != 0) return 1; - GfxDecode(0x800, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load samples - nRet = BurnLoadRom(DrvMSM5205Rom + 0x00000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvMSM5205Rom + 0x10000, 20, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 DrvMachineInit() -{ - BurnSetRefreshRate(57.444853); - - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvHD6309Ram , 0x0000, 0x0fff, MAP_RAM); - HD6309MapMemory(DrvPaletteRam1 , 0x1000, 0x11ff, MAP_RAM); - HD6309MapMemory(DrvPaletteRam2 , 0x1200, 0x13ff, MAP_RAM); - HD6309MapMemory(DrvFgVideoRam , 0x1800, 0x1fff, MAP_RAM); - HD6309MapMemory(DrvSpriteRam , 0x2000, 0x2fff, MAP_WRITE); - HD6309MapMemory(DrvBgVideoRam , 0x3000, 0x37ff, MAP_RAM); - HD6309MapMemory(DrvHD6309Rom + 0x8000, 0x4000, 0x7fff, MAP_ROM); - HD6309MapMemory(DrvHD6309Rom , 0x8000, 0xffff, MAP_ROM); - HD6309SetReadHandler(DrvDdragonHD6309ReadByte); - HD6309SetWriteHandler(DrvDdragonHD6309WriteByte); - HD6309Close(); - - if (DrvSubCPUType == DD_CPU_TYPE_HD63701) { - HD63701Init(1); - HD63701MapMemory(DrvSubCPURom , 0xc000, 0xffff, MAP_ROM); - HD63701SetReadHandler(DrvDdragonHD63701ReadByte); - HD63701SetWriteHandler(DrvDdragonHD63701WriteByte); - } - - if (DrvSubCPUType == DD_CPU_TYPE_HD6309) { - HD6309Init(1); - HD6309Open(1); - HD6309MapMemory(DrvSubCPURom , 0xc000, 0xffff, MAP_ROM); - HD6309SetReadHandler(DrvDdragonbSubHD6309ReadByte); - HD6309SetWriteHandler(DrvDdragonbSubHD6309WriteByte); - HD6309Close(); - } - - if (DrvSubCPUType == DD_CPU_TYPE_M6803) { - M6803Init(1); - M6803MapMemory(DrvSubCPURom , 0xc000, 0xffff, MAP_ROM); - M6803SetReadHandler(DrvDdragonbaM6803ReadByte); - M6803SetWriteHandler(DrvDdragonbaM6803WriteByte); - M6803SetWritePortHandler(DrvDdragonbaM6803WritePort); - } - - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) { - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvSoundCPURam , 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvSoundCPURom , 0x8000, 0xffff, MAP_ROM); - M6809SetReadHandler(DrvDdragonM6809ReadByte); - M6809SetWriteHandler(DrvDdragonM6809WriteByte); - M6809Close(); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, DrvSynchroniseStream, 375000, DrvMSM5205Vck0, MSM5205_S48_4B, 1); - MSM5205Init(1, DrvSynchroniseStream, 375000, DrvMSM5205Vck1, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - MSM5205SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - } - - if (DrvGameType == DD_GAME_DARKTOWR) { - m6805Init(1, 0x800); - m6805MapMemory(DrvMCURom + 0x80, 0x080, 0x7ff, MAP_ROM); - m6805MapMemory(DrvMCURom, 0x008, 0x07f, MAP_RAM); - m6805SetReadHandler(DrvMCUReadByte); - m6805SetWriteHandler(DrvMCUWriteByte); - } - - nCyclesTotal[0] = (INT32)((double)4000000 / 57.44853); - nCyclesTotal[1] = (INT32)((double)4000000 / 57.44853); - nCyclesTotal[2] = (INT32)((double)1500000 / 57.44853); - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 Drv2MachineInit() -{ - // Setup the HD6309 emulation - HD6309Init(0); - HD6309Open(0); - HD6309MapMemory(DrvHD6309Ram , 0x0000, 0x17ff, MAP_RAM); - HD6309MapMemory(DrvFgVideoRam , 0x1800, 0x1fff, MAP_RAM); - HD6309MapMemory(DrvSpriteRam , 0x2000, 0x2fff, MAP_WRITE); - HD6309MapMemory(DrvBgVideoRam , 0x3000, 0x37ff, MAP_RAM); - HD6309MapMemory(DrvPaletteRam1 , 0x3c00, 0x3dff, MAP_RAM); - HD6309MapMemory(DrvPaletteRam2 , 0x3e00, 0x3fff, MAP_RAM); - HD6309MapMemory(DrvHD6309Rom + 0x8000, 0x4000, 0x7fff, MAP_ROM); - HD6309MapMemory(DrvHD6309Rom , 0x8000, 0xffff, MAP_ROM); - HD6309SetReadHandler(DrvDdragonHD6309ReadByte); - HD6309SetWriteHandler(DrvDdragonHD6309WriteByte); - HD6309Close(); - - ZetInit(0); - ZetOpen(0); - ZetSetWriteHandler(Ddragon2SubZ80Write); - ZetMapArea(0x0000, 0xbfff, 0, DrvSubCPURom); - ZetMapArea(0x0000, 0xbfff, 2, DrvSubCPURom); - ZetMapArea(0xc000, 0xc3ff, 0, DrvSpriteRam); - ZetMapArea(0xc000, 0xc3ff, 2, DrvSpriteRam); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(Ddragon2SoundZ80Read); - ZetSetWriteHandler(Ddragon2SoundZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvSoundCPURom); - ZetMapArea(0x0000, 0x7fff, 2, DrvSoundCPURom); - ZetMapArea(0x8000, 0x87ff, 0, DrvSoundCPURam); - ZetMapArea(0x8000, 0x87ff, 1, DrvSoundCPURam); - ZetMapArea(0x8000, 0x87ff, 2, DrvSoundCPURam); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&Ddragon2YM2151IrqHandler); - BurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - - BurnSetRefreshRate(57.444853); - - nCyclesTotal[0] = (INT32)((double)4000000 / 57.44853); - nCyclesTotal[1] = (INT32)((double)4000000 / 57.44853); - nCyclesTotal[2] = (INT32)((double)3579545 / 57.44853); - nCyclesTotal[3] = (INT32)((double)4000000 / 57.44853); - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvInit() -{ - DrvSubCPUType = DD_CPU_TYPE_HD63701; - DrvSoundCPUType = DD_CPU_TYPE_M6809; - - if (DrvMemInit()) return 1; - if (DrvLoadRoms()) return 1; - if (DrvMachineInit()) return 1; - - return 0; -} - -static INT32 DrvbInit() -{ - DrvSubCPUType = DD_CPU_TYPE_HD6309; - DrvSoundCPUType = DD_CPU_TYPE_M6809; - - if (DrvMemInit()) return 1; - if (DrvLoadRoms()) return 1; - if (DrvMachineInit()) return 1; - - nCyclesTotal[1] = (INT32)((double)1500000 / 57.44853); - - return 0; -} - -static INT32 DrvbaInit() -{ - DrvSubCPUType = DD_CPU_TYPE_M6803; - DrvSoundCPUType = DD_CPU_TYPE_M6809; - - if (DrvMemInit()) return 1; - if (DrvbaLoadRoms()) return 1; - if (DrvMachineInit()) return 1; - - return 0; -} - -static INT32 Drv2Init() -{ - DrvSubCPUType = DD_CPU_TYPE_Z80; - DrvSoundCPUType = DD_CPU_TYPE_Z80; - DrvVidHardwareType = DD_VID_TYPE_DD2; - - if (Drv2MemInit()) return 1; - if (Drv2LoadRoms()) return 1; - if (Drv2MachineInit()) return 1; - - return 0; -} - -static INT32 Drv2bInit() -{ - DrvSubCPUType = DD_CPU_TYPE_Z80; - DrvSoundCPUType = DD_CPU_TYPE_Z80; - DrvVidHardwareType = DD_VID_TYPE_DD2; - - if (Drv2MemInit()) return 1; - if (Drv2bLoadRoms()) return 1; - if (Drv2MachineInit()) return 1; - - return 0; -} - -static INT32 DdungeonInit() -{ - DrvSubCPUType = DD_CPU_TYPE_HD63701; - DrvSoundCPUType = DD_CPU_TYPE_M6809; - DrvGameType = DD_GAME_DARKTOWR; - - if (DarktowrMemInit()) return 1; - if (DdungeonLoadRoms()) return 1; - if (DrvMachineInit()) return 1; - - return 0; -} - -static INT32 DarktowrInit() -{ - DrvSubCPUType = DD_CPU_TYPE_HD63701; - DrvSoundCPUType = DD_CPU_TYPE_M6809; - DrvGameType = DD_GAME_DARKTOWR; - - if (DarktowrMemInit()) return 1; - if (DarktowrLoadRoms()) return 1; - if (DrvMachineInit()) return 1; - - return 0; -} - -static INT32 DrvExit() -{ - HD6309Exit(); - if (DrvSubCPUType == DD_CPU_TYPE_M6803 || DrvSubCPUType == DD_CPU_TYPE_HD63701) M6800Exit(); - if (DrvGameType == DD_GAME_DARKTOWR) m6805Exit(); - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) M6809Exit(); - if (DrvSubCPUType == DD_CPU_TYPE_Z80 || DrvSoundCPUType == DD_CPU_TYPE_Z80) ZetExit(); - - BurnYM2151Exit(); - if (DrvSoundCPUType == DD_CPU_TYPE_Z80) { - MSM6295Exit(0); - } else { - MSM5205Exit(); - } - - GenericTilesExit(); - - BurnFree(Mem); - - DrvRomBank = 0; - DrvVBlank = 0; - DrvSubCPUBusy = 0; - DrvSoundLatch = 0; - DrvScrollXHi = 0; - DrvScrollYHi = 0; - DrvScrollXLo = 0; - DrvScrollYLo = 0; - - DrvADPCMIdle[0] = 0; - DrvADPCMIdle[1] = 0; - DrvADPCMPos[0] = 0; - DrvADPCMPos[1] = 0; - DrvADPCMEnd[0] = 0; - DrvADPCMEnd[1] = 0; - DrvADPCMData[0] = 0; - DrvADPCMData[1] = 0; - - DrvSubCPUType = DD_CPU_TYPE_NONE; - DrvSoundCPUType = DD_CPU_TYPE_NONE; - DrvVidHardwareType = 0; - DrvGameType = 0; - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 0); - g = pal4bit(nColour >> 4); - b = pal4bit(nColour >> 8); - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - for (INT32 i = 0; i < 0x180; i++) { - INT32 Val = DrvPaletteRam1[i] + (DrvPaletteRam2[i] << 8); - - DrvPalette[i] = CalcCol(Val); - } -} - -static void DrvRenderBgLayer() -{ - INT32 mx, my, Code, Attr, Colour, x, y, TileIndex, xScroll, yScroll, Flip, xFlip, yFlip; - - xScroll = DrvScrollXHi + DrvScrollXLo; - xScroll &= 0x1ff; - - yScroll = DrvScrollYHi + DrvScrollYLo; - yScroll &= 0x1ff; - - for (mx = 0; mx < 32; mx++) { - for (my = 0; my < 32; my++) { - TileIndex = (my & 0x0f) + ((mx & 0x0f) << 4) + ((my & 0x10) << 4) + ((mx & 0x10) << 5); - - Attr = DrvBgVideoRam[(2 * TileIndex) + 0]; - Code = DrvBgVideoRam[(2 * TileIndex) + 1] + ((Attr & 0x07) << 8); - Colour = (Attr >> 3) & 0x07; - Flip = (Attr & 0xc0) >> 6; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - y = 16 * mx; - x = 16 * my; - - x -= xScroll; - if (x < -16) x += 512; - - y -= yScroll; - if (y < -16) y += 512; - - y -= 8; - - if (x > 16 && x < 240 && y > 16 && y < 224) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } else { - Render16x16Tile_FlipX(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } else { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } else { - Render16x16Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } - } - } - } - } -} - -#define DRAW_SPRITE(Order, sx, sy) \ - if (sx > 16 && sx < 240 && sy > 16 && sy < 224) { \ - if (xFlip) { \ - if (yFlip) { \ - Render16x16Tile_Mask_FlipXY(pTransDraw, Code + Order, sx, sy, Colour, 4, 0, 128, DrvSprites); \ - } else { \ - Render16x16Tile_Mask_FlipX(pTransDraw, Code + Order, sx, sy, Colour, 4, 0, 128, DrvSprites); \ - } \ - } else { \ - if (yFlip) { \ - Render16x16Tile_Mask_FlipY(pTransDraw, Code + Order, sx, sy, Colour, 4, 0, 128, DrvSprites); \ - } else { \ - Render16x16Tile_Mask(pTransDraw, Code + Order, sx, sy, Colour, 4, 0, 128, DrvSprites); \ - } \ - } \ - } else { \ - if (xFlip) { \ - if (yFlip) { \ - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code + Order, sx, sy, Colour, 4, 0, 128, DrvSprites); \ - } else { \ - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code + Order, sx, sy, Colour, 4, 0, 128, DrvSprites); \ - } \ - } else { \ - if (yFlip) { \ - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code + Order, sx, sy, Colour, 4, 0, 128, DrvSprites); \ - } else { \ - Render16x16Tile_Mask_Clip(pTransDraw, Code + Order, sx, sy, Colour, 4, 0, 128, DrvSprites); \ - } \ - } \ - } - -static void DrvRenderSpriteLayer() -{ - UINT8 *Src = &DrvSpriteRam[0x800]; - - for (INT32 i = 0; i < (64 * 5); i += 5) { - INT32 Attr = Src[i + 1]; - - if (Attr & 0x80) { - INT32 sx = 240 - Src[i + 4] + ((Attr & 2) << 7); - INT32 sy = 232 - Src[i + 0] + ((Attr & 1) << 8); - INT32 Size = (Attr & 0x30) >> 4; - INT32 xFlip = Attr & 0x08; - INT32 yFlip = Attr & 0x04; - INT32 dx = -16; - INT32 dy = -16; - - INT32 Colour; - INT32 Code; - - if (DrvVidHardwareType == DD_VID_TYPE_DD2) { - Colour = (Src[i + 2] >> 5); - Code = Src[i + 3] + ((Src[i + 2] & 0x1f) << 8); - } else { - Colour = (Src[i + 2] >> 4) & 0x07; - Code = Src[i + 3] + ((Src[i + 2] & 0x0f) << 8); - } - - Code &= ~Size; - - switch (Size) { - case 0: { - DRAW_SPRITE(0, sx, sy) - break; - } - - case 1: { - DRAW_SPRITE(0, sx, sy + dy) - DRAW_SPRITE(1, sx, sy) - break; - } - - case 2: { - DRAW_SPRITE(0, sx + dx, sy) - DRAW_SPRITE(2, sx, sy) - break; - } - - case 3: { - DRAW_SPRITE(0, sx + dx, sy + dy) - DRAW_SPRITE(1, sx + dx, sy) - DRAW_SPRITE(2, sx, sy + dy) - DRAW_SPRITE(3, sx, sy) - break; - } - } - } - } -} - -#undef DRAW_SPRITE - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Code, Attr, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Attr = DrvFgVideoRam[(2 * TileIndex) + 0]; - Code = DrvFgVideoRam[(2 * TileIndex) + 1] + ((Attr & 0x07) << 8); - if (DrvVidHardwareType != DD_VID_TYPE_DD2) Code &= 0x3ff; - - Colour = Attr >> 5; - - x = 8 * mx; - y = 8 * my; - - y -= 8; - - if (x > 0 && x < 248 && y > 0 && y < 232) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvChars); - } - - TileIndex++; - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - DrvRenderBgLayer(); - DrvRenderSpriteLayer(); - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 272; - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) nInterleave = MSM5205CalcInterleave(0, (INT32)(nCyclesTotal[0] * 57.444853)); - INT32 nSoundBufferPos = 0; - - INT32 VBlankSlice = (INT32)((double)(nInterleave * 240) / 272); - INT32 FIRQFireSlice[16]; - for (INT32 i = 0; i < 16; i++) { - FIRQFireSlice[i] = (INT32)((double)((nInterleave * (i + 1)) / 17)); - } - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - UINT32 nCyclesToDo[2]; - nCyclesToDo[0] = (INT32)((double)nCyclesTotal[0] * nBurnCPUSpeedAdjust / 0x0100); - nCyclesToDo[1] = (INT32)((double)nCyclesTotal[1] * nBurnCPUSpeedAdjust / 0x0100); - - nCyclesDone[0] = nCyclesDone[1] = nCyclesDone[2] = nCyclesDone[3] = 0; - - HD6309NewFrame(); - if (DrvSubCPUType == DD_CPU_TYPE_HD63701) HD63701NewFrame(); - if (DrvSubCPUType == DD_CPU_TYPE_M6803) M6803NewFrame(); - if (DrvSubCPUType == DD_CPU_TYPE_Z80 || DrvSoundCPUType == DD_CPU_TYPE_Z80) ZetNewFrame(); - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) M6809NewFrame(); - if (DrvGameType == DD_GAME_DARKTOWR) m6805NewFrame(); - - DrvVBlank = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - HD6309Open(0); - nNext = (i + 1) * nCyclesToDo[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += HD6309Run(nCyclesSegment); - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) MSM5205Update(); - HD6309Close(); - - if (DrvSubCPUType == DD_CPU_TYPE_HD63701) { - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesToDo[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = HD63701Run(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - } - - if (DrvSubCPUType == DD_CPU_TYPE_HD6309) { - nCurrentCPU = 1; - HD6309Open(1); - nNext = (i + 1) * nCyclesToDo[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = HD6309Run(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - HD6309Close(); - } - - if (DrvSubCPUType == DD_CPU_TYPE_M6803) { - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesToDo[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = M6803Run(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - } - - if (DrvSubCPUType == DD_CPU_TYPE_Z80) { - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesToDo[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - } - - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) { - nCurrentCPU = 2; - M6809Open(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += M6809Run(nCyclesSegment); - M6809Close(); - } - - if (DrvSoundCPUType == DD_CPU_TYPE_Z80) { - nCurrentCPU = 2; - ZetOpen(1); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - } - - if (DrvGameType == DD_GAME_DARKTOWR) { - nCurrentCPU = 3; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = m6805Run(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - } - - if (i == VBlankSlice) { - DrvVBlank = 1; - HD6309Open(0); - HD6309SetIRQLine(HD6309_INPUT_LINE_NMI, CPU_IRQSTATUS_ACK); - HD6309Close(); - } - - for (INT32 j = 0; j < 16; j++) { - if (i == FIRQFireSlice[j]) { - HD6309Open(0); - HD6309SetIRQLine(HD6309_FIRQ_LINE, CPU_IRQSTATUS_ACK); - HD6309Close(); - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) { - M6809Open(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - M6809Close(); - } - - if (DrvSoundCPUType == DD_CPU_TYPE_Z80) { - ZetOpen(1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) { - M6809Open(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - M6809Close(); - } - - if (DrvSoundCPUType == DD_CPU_TYPE_Z80) { - ZetOpen(1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - } - - if (DrvSoundCPUType == DD_CPU_TYPE_M6809 && pBurnSoundOut) { - M6809Open(0); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - MSM5205Render(1, pBurnSoundOut, nBurnSoundLen); - M6809Close(); - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - HD6309Scan(nAction); - - if (DrvSubCPUType == DD_CPU_TYPE_HD63701) HD63701Scan(nAction); - if (DrvSubCPUType == DD_CPU_TYPE_M6803) M6803Scan(nAction); - if (DrvSubCPUType == DD_CPU_TYPE_Z80 || DrvSoundCPUType == DD_CPU_TYPE_Z80) ZetScan(nAction); - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) M6809Scan(nAction); - if (DrvGameType == DD_GAME_DARKTOWR) m6805Scan(nAction); // m68705 - - BurnYM2151Scan(nAction); - if (DrvSoundCPUType == DD_CPU_TYPE_Z80) MSM6295Scan(0, nAction); - if (DrvSoundCPUType == DD_CPU_TYPE_M6809) MSM5205Scan(nAction, pnMin); - - SCAN_VAR(DrvRomBank); - SCAN_VAR(DrvVBlank); - SCAN_VAR(DrvSubCPUBusy); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvScrollXHi); - SCAN_VAR(DrvScrollYHi); - SCAN_VAR(DrvScrollXLo); - SCAN_VAR(DrvScrollYLo); - SCAN_VAR(DrvADPCMIdle); - SCAN_VAR(DrvADPCMPos); - SCAN_VAR(DrvADPCMEnd); - SCAN_VAR(DrvADPCMData); - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - - if (nAction & ACB_WRITE) { - HD6309Open(0); - HD6309MapMemory(DrvHD6309Rom + 0x8000 + (DrvRomBank * 0x4000), 0x4000, 0x7fff, MAP_ROM); - HD6309Close(); - - if (DrvSubCPUBusy == 0) { - if (DrvSubCPUType == DD_CPU_TYPE_HD63701) { - HD63701SetIRQLine(HD63701_INPUT_LINE_NMI, CPU_IRQSTATUS_ACK); - } - - if (DrvSubCPUType == DD_CPU_TYPE_M6803) { - M6803SetIRQLine(M6803_INPUT_LINE_NMI, CPU_IRQSTATUS_ACK); - } - } - } - } - - return 0; -} - -struct BurnDriver BurnDrvDdragon = { - "ddragon", NULL, NULL, NULL, "1987", - "Double Dragon (Japan)\0", NULL, "Technos", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragonw = { - "ddragonw", "ddragon", NULL, NULL, "1987", - "Double Dragon (World set 1)\0", NULL, "[Technos] (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvwRomInfo, DrvwRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragnw1 = { - "ddragonw1", "ddragon", NULL, NULL, "1987", - "Double Dragon (World set 2)\0", NULL, "[Technos] (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, Drvw1RomInfo, Drvw1RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragonu = { - "ddragonu", "ddragon", NULL, NULL, "1987", - "Double Dragon (US set 1)\0", NULL, "[Technos] (Taito America license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvuRomInfo, DrvuRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragoua = { - "ddragonua", "ddragon", NULL, NULL, "1987", - "Double Dragon (US set 2)\0", NULL, "[Technos] (Taito America license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvuaRomInfo, DrvuaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragoub = { - "ddragonub", "ddragon", NULL, NULL, "1987", - "Double Dragon (US set 3)\0", NULL, "[Technos] (Taito America license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvubRomInfo, DrvubRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragob2 = { - "ddragonb2", "ddragon", NULL, NULL, "1987", - "Double Dragon (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, Drvb2RomInfo, Drvb2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragonb = { - "ddragonb", "ddragon", NULL, NULL, "1987", - "Double Dragon (bootleg with HD6309)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvbRomInfo, DrvbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvbInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragnba = { - "ddragonba", "ddragon", NULL, NULL, "1987", - "Double Dragon (bootleg with M6803)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvbaRomInfo, DrvbaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvbaInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragon2 = { - "ddragon2", NULL, NULL, NULL, "1988", - "Double Dragon II - The Revenge (World)\0", NULL, "Technos", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, Drv2RomInfo, Drv2RomName, NULL, NULL, DrvInputInfo, Drv2DIPInfo, - Drv2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragon2u = { - "ddragon2u", "ddragon2", NULL, NULL, "1988", - "Double Dragon II - The Revenge (US)\0", NULL, "Technos", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, Drv2uRomInfo, Drv2uRomName, NULL, NULL, DrvInputInfo, Drv2DIPInfo, - Drv2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragon2b = { - "ddragon2b", "ddragon2", NULL, NULL, "1988", - "Double Dragon II - The Revenge (US bootleg, set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, Drv2bRomInfo, Drv2bRomName, NULL, NULL, DrvInputInfo, Drv2DIPInfo, - Drv2bInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdragon2b2 = { - "ddragon2b2", "ddragon2", NULL, NULL, "1988", - "Double Dragon II - The Revenge (US bootleg, set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, Drv2b2RomInfo, Drv2b2RomName, NULL, NULL, DrvInputInfo, Drv2DIPInfo, - Drv2bInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriverD BurnDrvDdungeon = { - "ddungeon", NULL, NULL, NULL, "1992", - "Dangerous Dungeons\0", NULL, "Game Room", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DdungeonRomInfo, DdungeonRomName, NULL, NULL, DrvInputInfo, DdungeonDIPInfo, - DdungeonInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDarktowr = { - "darktowr", NULL, NULL, NULL, "1992", - "Dark Tower\0", NULL, "Game Room", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DarktowrRomInfo, DarktowrRomName, NULL, NULL, DrvInputInfo, DarktowrDIPInfo, - DarktowrInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x180, 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_djboy.cpp b/jan/src/burn/drv/pre90s/d_djboy.cpp deleted file mode 100644 index bbdb4561d..000000000 --- a/jan/src/burn/drv/pre90s/d_djboy.cpp +++ /dev/null @@ -1,821 +0,0 @@ -// FB Alpha DJ Boy driver module -// Based on MAME driver by (Phil Bennette?) - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "mermaid.h" -#include "msm6295.h" -#include "burn_ym2203.h" -#include "pandora.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvMCUROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvShareRAM0; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPandoraRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM2; - -static UINT8 *soundlatch; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 bankxor; - -static UINT8 nBankAddress0; -static UINT8 nBankAddress1; -static UINT8 nBankAddress2; - -static INT32 videoreg = 0; -static UINT8 scrollx = 0; -static UINT8 scrolly = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[6]; -static UINT8 DrvReset; - -static struct BurnInputInfo DjboyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 5, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 4, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 5, "dip" }, -}; - -STDINPUTINFO(Djboy) - -static struct BurnDIPInfo DjboyDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Levels (in thousands)" }, - {0x15, 0x01, 0x0c, 0x0c, "10,30,50,70,90" }, - {0x15, 0x01, 0x0c, 0x08, "10,20,30,40,50,60,70,80,90" }, - {0x15, 0x01, 0x0c, 0x04, "20,50" }, - {0x15, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x30, 0x20, "3" }, - {0x15, 0x01, 0x30, 0x30, "5" }, - {0x15, 0x01, 0x30, 0x10, "7" }, - {0x15, 0x01, 0x30, 0x00, "9" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Stereo Sound" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Djboy) - -static void cpu0_bankswitch(INT32 data) -{ - nBankAddress0 = data; - - ZetMapMemory(DrvZ80ROM0 + ((nBankAddress0 ^ bankxor) * 0x2000), 0xc000, 0xdfff, MAP_ROM); -} - -static void __fastcall djboy_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xb000) { - DrvSprRAM[address & 0xfff] = data; - address = (address & 0x800) | ((address & 0xff) << 3) | ((address & 0x700) >> 8); - DrvPandoraRAM[address] = data; - return; - } -} - -static void __fastcall djboy_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - cpu0_bankswitch(data); - return; - } -} - -static inline void palette_update(INT32 offs) -{ - INT32 p = (DrvPalRAM[offs+1] + (DrvPalRAM[offs+0] * 256)); - - INT32 r = (p >> 8) & 0x0f; - INT32 g = (p >> 4) & 0x0f; - INT32 b = (p >> 0) & 0x0f; - - DrvPalette[offs/2] = BurnHighCol((r*16)+r,(g*16)+g,(b*16)+b,0); -} - -static void __fastcall djboy_cpu1_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0xd000) { - DrvPalRAM[address & 0x3ff] = data; - if (address & 1) palette_update(address & 0x3fe); - return; - } - - if ((address & 0xf000) == 0xd000) { - DrvPalRAM[address & 0xfff] = data; - return; - } -} - -static void cpu1_bankswitch(INT32 data) -{ - INT32 bankdata[16] = { 0,1,2,3,-1,-1,-1,-1,4,5,6,7,8,9,10,11 }; - - if (bankdata[data & 0x0f] == -1) return; - - nBankAddress1 = bankdata[data & 0x0f]; - - ZetMapMemory(DrvZ80ROM1 + (nBankAddress1 * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall djboy_cpu1_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - videoreg = data; - cpu1_bankswitch(data); - return; - - case 0x02: - { - *soundlatch = data; - ZetClose(); - ZetOpen(2); - ZetNmi(); - ZetClose(); - ZetOpen(1); - } - return; - - case 0x04: - mermaidWrite(data); - return; - - case 0x06: - scrolly = data; - return; - - case 0x08: - scrollx = data; - return; - - case 0x0a: - { - ZetClose(); - ZetOpen(0); - ZetNmi(); - ZetClose(); - ZetOpen(1); - } - return; - - case 0x0e: - // coin counter - return; - } -} - -static UINT8 __fastcall djboy_cpu1_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x04: - return mermaidRead(); - - case 0x0c: - return mermaidStatus(); - } - - return 0; -} - -static void cpu2_bankswitch(INT32 data) -{ - nBankAddress2 = data; - - ZetMapMemory(DrvZ80ROM2 + (data * 0x04000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall djboy_cpu2_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - cpu2_bankswitch(data); - return; - - case 0x02: - case 0x03: - BurnYM2203Write(0, port & 1, data); - return; - - case 0x06: - MSM6295Command(0, data); - return; - - case 0x07: - MSM6295Command(1, data); - return; - } -} - -static UINT8 __fastcall djboy_cpu2_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x02: - case 0x03: - return BurnYM2203Read(0, port & 1); - - case 0x04: - return *soundlatch; - - case 0x06: - return MSM6295ReadStatus(0); - - case 0x07: - return MSM6295ReadStatus(1); - } - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 6000000; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - ZetOpen(2); - ZetReset(); - BurnYM2203Reset(); - ZetClose(); - - mermaidReset(); - - MSM6295Reset(0); - MSM6295Reset(1); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - static INT32 Plane[4] = { STEP4(0,1) }; - static INT32 XOffs[16] = { STEP8(0,4), STEP8(256, 4) }; - static INT32 YOffs[16] = { STEP8(0,32), STEP8(512, 32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x040000; - DrvZ80ROM1 = Next; Next += 0x030000; - DrvZ80ROM2 = Next; Next += 0x020000; - DrvMCUROM = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x001000; - - DrvShareRAM0 = Next; Next += 0x002000; - - DrvPandoraRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x000900; - DrvZ80RAM2 = Next; Next += 0x002000; - - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(57.50); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x000000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x020000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x010000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvMCUROM + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x180000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1f0000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 12, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 14, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xafff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xb000, 0xbfff, MAP_ROM); // handler... - ZetMapMemory(DrvShareRAM0, 0xe000, 0xffff, MAP_RAM); - ZetSetWriteHandler(djboy_main_write); - ZetSetOutHandler(djboy_main_write_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd000, 0xd8ff, MAP_ROM); // handler - ZetMapMemory(DrvShareRAM0, 0xe000, 0xffff, MAP_RAM); - ZetSetWriteHandler(djboy_cpu1_write); - ZetSetOutHandler(djboy_cpu1_write_port); - ZetSetInHandler(djboy_cpu1_read_port); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xdfff, MAP_RAM); - ZetSetOutHandler(djboy_cpu2_write_port); - ZetSetInHandler(djboy_cpu2_read_port); - ZetClose(); - - mermaidInit(DrvMCUROM, DrvInputs); - - BurnYM2203Init(1, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(6000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.50, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1500000 / 165, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - MSM6295Init(1, 1500000 / 165, 1); - MSM6295SetRoute(1, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - pandora_init(DrvPandoraRAM, DrvGfxROM0, (0x400000/0x100)-1, 0x100, 0, -16); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - pandora_exit(); - - GenericTilesExit(); - - ZetExit(); - mermaidExit(); - - MSM6295Exit(0); - MSM6295Exit(1); - BurnYM2203Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void draw_layer() -{ - INT32 xscroll = ((scrollx + ((videoreg & 0xc0) << 2)) - 0x391) & 0x3ff; - INT32 yscroll = (scrolly + ((videoreg & 0x20) << 3) + 16) & 0x1ff; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 16; - INT32 sy = (offs / 0x40) * 16; - - sx -= xscroll; - if (sx < -15) sx += 1024; - sy -= yscroll; - if (sy < -15) sy += 512; - - if (sy >= nScreenHeight || sy >= nScreenWidth) continue; - - INT32 attr = DrvVidRAM[offs + 0x800]; - INT32 code = DrvVidRAM[offs + 0x000] + ((attr & 0x0f) * 256) + ((attr & 0x80) << 5); - INT32 color = attr >> 4; - - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM1); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 offs = 0; offs < 0x400; offs+=2) { - palette_update(offs); - } - DrvRecalc = 0; - } - - draw_layer(); - - pandora_update(pTransDraw); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 4); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[2] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[0] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { (6000000 * 10) / 575, (6000000 * 10) / 575,(6000000 * 10) / 575 }; // 57.5 fps - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - - INT32 nSegment = (nCyclesTotal[0] / nInterleave); - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == 64 || i == 240) { - if (i == 64) ZetSetVector(0xff); - if (i == 240) ZetSetVector(0xfd); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - nSegment = ZetTotalCycles(); - ZetClose(); - - ZetOpen(1); - nSegment -= ZetTotalCycles(); - if (mermaid_sub_z80_reset) { - nCyclesDone[1] += nSegment; - ZetIdle(nSegment); - } else { - nCyclesDone[1] += ZetRun(nSegment); - if (i == 255) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - nSegment = ZetTotalCycles(); - ZetClose(); - - ZetOpen(2); - BurnTimerUpdate(nSegment /*sync with sub cpu*/); - if (i == 255) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - nCyclesDone[2] += mermaidRun(nSegment - nCyclesDone[2]); - - if (i == 239) - pandora_buffer_sprites(); - } - - ZetOpen(2); - - BurnTimerEndFrame(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - mermaidScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - SCAN_VAR(nBankAddress0); - SCAN_VAR(nBankAddress1); - SCAN_VAR(nBankAddress2); - SCAN_VAR(videoreg); - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - } - - if (nAction & ACB_WRITE) - { - ZetOpen(0); - cpu0_bankswitch(nBankAddress0); - ZetClose(); - - ZetOpen(1); - cpu1_bankswitch(nBankAddress1); - ZetClose(); - - ZetOpen(2); - cpu2_bankswitch(nBankAddress2); - ZetClose(); - } - - return 0; -} - - -// DJ Boy (set 1) - -static struct BurnRomInfo djboyRomDesc[] = { - { "bs64.4b", 0x20000, 0xb77aacc7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "bs100.4d", 0x20000, 0x081e8af8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bs65.5y", 0x10000, 0x0f1456eb, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - { "bs101.6w", 0x20000, 0xa7c85577, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "bs200.8c", 0x20000, 0xf6c19e51, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "beast.9s", 0x01000, 0xebe0f5f3, 4 | BRF_PRG | BRF_ESS }, // 5 Kaneko Beast MCU - - { "bs000.1h", 0x80000, 0xbe4bf805, 5 | BRF_GRA }, // 6 Sprites - { "bs001.1f", 0x80000, 0xfdf36e6b, 5 | BRF_GRA }, // 7 - { "bs002.1d", 0x80000, 0xc52fee7f, 5 | BRF_GRA }, // 8 - { "bs003.1k", 0x80000, 0xed89acb4, 5 | BRF_GRA }, // 9 - { "bs07.1b", 0x10000, 0xd9b7a220, 5 | BRF_GRA }, // 10 - - { "bs004.1s", 0x80000, 0x2f1392c3, 6 | BRF_GRA }, // 11 Tiles - { "bs005.1u", 0x80000, 0x46b400c4, 6 | BRF_GRA }, // 12 - - { "bs203.5j", 0x40000, 0x805341fb, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "bs203.5j", 0x40000, 0x805341fb, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(djboy) -STD_ROM_FN(djboy) - -static INT32 DjboyInit() -{ - bankxor = 0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvDjboy = { - "djboy", NULL, NULL, NULL, "1989", - "DJ Boy (set 1)\0", NULL, "Kaneko (American Sammy license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO_MISC, GBF_SCRFIGHT, 0, - NULL, djboyRomInfo, djboyRomName, NULL, NULL, DjboyInputInfo, DjboyDIPInfo, - DjboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// DJ Boy (set 2) - -static struct BurnRomInfo djboyaRomDesc[] = { - { "bs19s.rom", 0x20000, 0x17ce9f6c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "bs100.4d", 0x20000, 0x081e8af8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bs15s.rom", 0x10000, 0xe6f966b2, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - { "bs101.6w", 0x20000, 0xa7c85577, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "bs200.8c", 0x20000, 0xf6c19e51, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "beast.9s", 0x01000, 0xebe0f5f3, 4 | BRF_PRG | BRF_ESS }, // 5 Kaneko Beast MCU - - { "bs000.1h", 0x80000, 0xbe4bf805, 5 | BRF_GRA }, // 6 Sprites - { "bs001.1f", 0x80000, 0xfdf36e6b, 5 | BRF_GRA }, // 7 - { "bs002.1d", 0x80000, 0xc52fee7f, 5 | BRF_GRA }, // 8 - { "bs003.1k", 0x80000, 0xed89acb4, 5 | BRF_GRA }, // 9 - { "bs07.1b", 0x10000, 0xd9b7a220, 5 | BRF_GRA }, // 10 - - { "bs004.1s", 0x80000, 0x2f1392c3, 6 | BRF_GRA }, // 11 Tiles - { "bs005.1u", 0x80000, 0x46b400c4, 6 | BRF_GRA }, // 12 - - { "bs203.5j", 0x40000, 0x805341fb, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "bs203.5j", 0x40000, 0x805341fb, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(djboya) -STD_ROM_FN(djboya) - -struct BurnDriver BurnDrvDjboya = { - "djboya", "djboy", NULL, NULL, "1989", - "DJ Boy (set 2)\0", NULL, "Kaneko (American Sammy license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO_MISC, GBF_SCRFIGHT, 0, - NULL, djboyaRomInfo, djboyaRomName, NULL, NULL, DjboyInputInfo, DjboyDIPInfo, - DjboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 244, 4, 3 -}; - - -// DJ Boy (Japan) - -static struct BurnRomInfo djboyjRomDesc[] = { - { "bs12.4b", 0x20000, 0x0971523e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "bs100.4d", 0x20000, 0x081e8af8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bs13.5y", 0x10000, 0x5c3f2f96, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - { "bs101.6w", 0x20000, 0xa7c85577, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "bs200.8c", 0x20000, 0xf6c19e51, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "beast.9s", 0x01000, 0xebe0f5f3, 4 | BRF_PRG | BRF_ESS }, // 5 Kaneko Beast MCU - - { "bs000.1h", 0x80000, 0xbe4bf805, 5 | BRF_GRA }, // 6 Sprites - { "bs001.1f", 0x80000, 0xfdf36e6b, 5 | BRF_GRA }, // 7 - { "bs002.1d", 0x80000, 0xc52fee7f, 5 | BRF_GRA }, // 8 - { "bs003.1k", 0x80000, 0xed89acb4, 5 | BRF_GRA }, // 9 - { "bsxx.1b", 0x10000, 0x22c8aa08, 5 | BRF_GRA }, // 10 - - { "bs004.1s", 0x80000, 0x2f1392c3, 6 | BRF_GRA }, // 11 Tiles - { "bs005.1u", 0x80000, 0x46b400c4, 6 | BRF_GRA }, // 12 - - { "bs-204.5j", 0x40000, 0x510244f0, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "bs-204.5j", 0x40000, 0x510244f0, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(djboyj) -STD_ROM_FN(djboyj) - -static INT32 DjboyjInit() -{ - bankxor = 0x1f; - - return DrvInit(); -} - -struct BurnDriver BurnDrvDjboyj = { - "djboyj", "djboy", NULL, NULL, "1989", - "DJ Boy (Japan)\0", NULL, "Kaneko (Sega license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO_MISC, GBF_SCRFIGHT, 0, - NULL, djboyjRomInfo, djboyjRomName, NULL, NULL, DjboyInputInfo, DjboyDIPInfo, - DjboyjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_dkong.cpp b/jan/src/burn/drv/pre90s/d_dkong.cpp deleted file mode 100644 index 2072da1c9..000000000 --- a/jan/src/burn/drv/pre90s/d_dkong.cpp +++ /dev/null @@ -1,3912 +0,0 @@ -// Fb Alpha Donkey Kong driver module -// Based on MAME driver by Couriersud - -// still need: - -// sbdk -// 8ballact -// 8ballact2 -// shootgal -// splforc -// splfrcii -// strtheat - - - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "s2650_intf.h" -#include "m6502_intf.h" -#include "samples.h" -#include "eeprom.h" -#include "bitswap.h" -#include "8257dma.h" -#include "i8039.h" -#include "dac.h" -#include "nes_apu.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv2650ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvMapROM; -static UINT8 *DrvZ80RAM; -static UINT8 *Drv2650RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; -static INT32 *DrvRevMap; -static UINT8 *DrvSndRAM0; -static UINT8 *DrvSndRAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *gfx_bank; -static UINT8 *sprite_bank; -static UINT8 *palette_bank; -static UINT8 *grid_enable; -static UINT8 *grid_color; -static UINT8 *flipscreen; -static UINT8 *nmi_mask; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 vblank; -static INT32 sound_cpu_in_reset; -static void (*DrvPaletteUpdate)(); - -static INT32 s2650_protection = 0; -static int dkongjr_walk = 0; -static int page = 0,mcustatus; -static int p[8] = { 255,255,255,255,255,255,255,255 }; -static int t[2] = { 1,1 }; -static UINT8 radarscp1 = 0; - -static struct BurnInputInfo DkongInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Dkong) - -static struct BurnInputInfo Dkong3InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Dkong3) - -static struct BurnInputInfo RadarscpInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Radarscp) - -static struct BurnInputInfo PestplceInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Pestplce) - -static struct BurnInputInfo HerodkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Herodk) - -static struct BurnDIPInfo DkongDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "3" }, - {0x0e, 0x01, 0x03, 0x01, "4" }, - {0x0e, 0x01, 0x03, 0x02, "5" }, - {0x0e, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0e, 0x01, 0x0c, 0x00, "7000" }, - {0x0e, 0x01, 0x0c, 0x04, "10000" }, - {0x0e, 0x01, 0x0c, 0x08, "15000" }, - {0x0e, 0x01, 0x0c, 0x0c, "20000" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x70, 0x70, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x50, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x30, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x10, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x70, 0x20, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x70, 0x40, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x70, 0x60, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x80, 0x80, "Upright" }, - {0x0e, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Dkong) - -static struct BurnDIPInfo DkongfDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "3" }, - {0x0e, 0x01, 0x03, 0x01, "4" }, - {0x0e, 0x01, 0x03, 0x02, "5" }, - {0x0e, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0e, 0x01, 0x0c, 0x00, "7000" }, - {0x0e, 0x01, 0x0c, 0x04, "10000" }, - {0x0e, 0x01, 0x0c, 0x08, "15000" }, - {0x0e, 0x01, 0x0c, 0x0c, "20000" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x70, 0x70, "Free Play" }, - {0x0e, 0x01, 0x70, 0x50, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x30, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x10, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x70, 0x20, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x70, 0x40, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x70, 0x60, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x80, 0x80, "Upright" }, - {0x0e, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Dkongf) - -static struct BurnDIPInfo Dkong3bDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x07, 0x02, "3 Coins 1 Credit" }, - {0x0e, 0x01, 0x07, 0x04, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x07, 0x01, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x07, 0x05, "1 Coin 5 Credits" }, - {0x0e, 0x01, 0x07, 0x07, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x08, 0x00, "Upright" }, - {0x0e, 0x01, 0x08, 0x08, "Cocktail" }, -}; - -STDDIPINFO(Dkong3b) - -static struct BurnDIPInfo Dkong3DIPList[]= -{ - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0f, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x07, 0x01, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x0f, 0x01, 0x07, 0x05, "1 Coin 5 Credits" }, - {0x0f, 0x01, 0x07, 0x07, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x80, 0x00, "Upright" }, - {0x0f, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x00, "3" }, - {0x10, 0x01, 0x03, 0x01, "4" }, - {0x10, 0x01, 0x03, 0x02, "5" }, - {0x10, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x0c, 0x00, "30000" }, - {0x10, 0x01, 0x0c, 0x04, "40000" }, - {0x10, 0x01, 0x0c, 0x08, "50000" }, - {0x10, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Additional Bonus" }, - {0x10, 0x01, 0x30, 0x00, "30000" }, - {0x10, 0x01, 0x30, 0x10, "40000" }, - {0x10, 0x01, 0x30, 0x20, "50000" }, - {0x10, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0xc0, 0x00, "Easy" }, - {0x10, 0x01, 0xc0, 0x40, "Medium" }, - {0x10, 0x01, 0xc0, 0x80, "Hard" }, - {0x10, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Dkong3) - -static struct BurnDIPInfo RadarscpDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0a, 0x01, 0x03, 0x00, "3" }, - {0x0a, 0x01, 0x03, 0x01, "4" }, - {0x0a, 0x01, 0x03, 0x02, "5" }, - {0x0a, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0a, 0x01, 0x0c, 0x00, "7000" }, - {0x0a, 0x01, 0x0c, 0x04, "10000" }, - {0x0a, 0x01, 0x0c, 0x08, "15000" }, - {0x0a, 0x01, 0x0c, 0x0c, "20000" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0a, 0x01, 0x70, 0x70, "5 Coins 1 Credits" }, - {0x0a, 0x01, 0x70, 0x50, "4 Coins 1 Credits" }, - {0x0a, 0x01, 0x70, 0x30, "3 Coins 1 Credits" }, - {0x0a, 0x01, 0x70, 0x10, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x70, 0x00, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x70, 0x20, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x70, 0x40, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0x70, 0x60, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0a, 0x01, 0x80, 0x80, "Upright" }, - {0x0a, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Radarscp) - -static struct BurnDIPInfo PestplceDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "3" }, - {0x0e, 0x01, 0x03, 0x01, "4" }, - {0x0e, 0x01, 0x03, 0x02, "5" }, - {0x0e, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x1c, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x1c, 0x18, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x1c, 0x04, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x1c, 0x0c, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x1c, 0x14, "1 Coin 5 Credits" }, - {0x0e, 0x01, 0x1c, 0x1c, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x0e, 0x01, 0x20, 0x00, "1 Credit" }, - {0x0e, 0x01, 0x20, 0x20, "2 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0e, 0x01, 0xc0, 0x00, "20000" }, - {0x0e, 0x01, 0xc0, 0x40, "30000" }, - {0x0e, 0x01, 0xc0, 0x80, "40000" }, - {0x0e, 0x01, 0xc0, 0xc0, "" }, -}; - -STDDIPINFO(Pestplce) - -static struct BurnDIPInfo HerbiedkDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x70, 0x70, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x50, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x30, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x10, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x70, 0x20, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x70, 0x40, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x70, 0x60, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x80, 0x80, "Upright" }, - {0x0e, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Herbiedk) - -static struct BurnDIPInfo HunchbkdDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0e, 0x01, 0x02, 0x00, "3" }, - {0x0e, 0x01, 0x02, 0x02, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0e, 0x01, 0x0c, 0x00, "10000" }, - {0x0e, 0x01, 0x0c, 0x04, "20000" }, - {0x0e, 0x01, 0x0c, 0x08, "40000" }, - {0x0e, 0x01, 0x0c, 0x0c, "80000" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x70, 0x70, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x50, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x30, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x10, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x70, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x70, 0x20, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x70, 0x40, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x70, 0x60, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x80, 0x80, "Upright" }, - {0x0e, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Hunchbkd) - -static struct BurnDIPInfo HerodkDIPList[]= -{ - {0x10, 0xff, 0xff, 0x81, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x02, 0x00, "3" }, - {0x10, 0x01, 0x02, 0x02, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty?" }, - {0x10, 0x01, 0x0c, 0x00, "0" }, - {0x10, 0x01, 0x0c, 0x04, "1" }, - {0x10, 0x01, 0x0c, 0x08, "2" }, - {0x10, 0x01, 0x0c, 0x0c, "3" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x10, 0x01, 0x70, 0x70, "5 Coins 1 Credits" }, - {0x10, 0x01, 0x70, 0x50, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x70, 0x30, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x70, 0x10, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x70, 0x00, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x70, 0x20, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x70, 0x40, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x70, 0x60, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Herodk) - -static struct BurnDIPInfo DraktonDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x1d, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0e, 0x01, 0x01, 0x00, "Off" }, - {0x0e, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0e, 0x01, 0x06, 0x00, "3" }, - {0x0e, 0x01, 0x06, 0x02, "4" }, - {0x0e, 0x01, 0x06, 0x04, "5" }, - {0x0e, 0x01, 0x06, 0x06, "6" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0e, 0x01, 0x08, 0x00, "Easy" }, - {0x0e, 0x01, 0x08, 0x08, "Normal" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x0e, 0x01, 0x70, 0x00, "10000" }, - {0x0e, 0x01, 0x70, 0x10, "20000" }, - {0x0e, 0x01, 0x70, 0x20, "30000" }, - {0x0e, 0x01, 0x70, 0x30, "40000" }, - {0x0e, 0x01, 0x70, 0x40, "50000" }, - {0x0e, 0x01, 0x70, 0x50, "60000" }, - {0x0e, 0x01, 0x70, 0x60, "70000" }, - {0x0e, 0x01, 0x70, 0x70, "80000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x80, 0x00, "Upright" }, - {0x0e, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Drakton) - - -static void dkong_sh1_write(INT32 offset, UINT8 data) -{ - static INT32 state[8]; - static INT32 count = 0; - INT32 sample_order[7] = {1,2,1,2,0,1,0}; - - if (state[offset] != data) - { - if (data) { - if (offset) { - BurnSamplePlay(offset+2); - } else { - BurnSamplePlay(sample_order[count]); - count++; - if (count == 7) count = 0; - } - } - - state[offset] = data; - } -} - -void __fastcall dkong_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0x7800) { - i8257Write(address,data); - return; - } - - switch (address) - { - case 0x7c00: // AM_LATCH8_WRITE("ls175.3d") - *soundlatch = data ^ 0x0f; - return; - - case 0x7c80: - *gfx_bank = data & 1; // inverted for dkong3 - return; - -#if 0 - case 0x7d00: - case 0x7d01: - case 0x7d02: - case 0x7d03: - case 0x7d04: - case 0x7d05: - case 0x7d06: - case 0x7d07: // AM_DEVWRITE("ls259.6h", latch8_bit0_w) /* Sound signals */ - return; -#else - case 0x7d00: - case 0x7d01: - case 0x7d02: - dkong_sh1_write(address & 3, data); - return; - - case 0x7d03: - p[2] = (p[2] & ~0x20) | ((~data & 1) << 5); - return; - - case 0x7d04: - t[1] = ~data & 1; - return; - - case 0x7d05: - t[0] = ~data & 1; - return; -#endif - - case 0x7d80: - I8039SetIrqState(data ? 1 : 0); - return; - - case 0x7d82: - *flipscreen = ~data & 0x01; - return; - - case 0x7d83: - *sprite_bank = data & 0x01; - return; - - case 0x7d84: - *nmi_mask = data & 0x01; - return; - - case 0x7d85: - i8257_drq_write(0, data & 0x01); - i8257_drq_write(1, data & 0x01); - i8257_do_transfer(data & 0x01); - return; - - case 0x7d86: - case 0x7d87: - if (data & 0x01) { - *palette_bank |= (1 << (address & 1)); - } else { - *palette_bank &= ~(1 << (address & 1)); - } - return; - } -} - -UINT8 __fastcall dkong_main_read(UINT16 address) -{ - if ((address & 0xfff0) == 0x7800) { - return i8257Read(address); - } - - switch (address) - { - case 0x7c00: - return DrvInputs[0]; - - case 0x7c80: - return DrvInputs[1]; - - case 0x7d00: - { - UINT8 ret = DrvInputs[2] & 0xbf; - if (ret & 0x10) ret = (ret & ~0x10) | 0x80; - ret |= mcustatus << 6; - return ret; - } - return 0; - - case 0x7d80: - return DrvDips[0]; - } - - return 0; -} - -static inline void dkongjr_climb_write(UINT8 data) -{ - static INT32 climb = 0; - static INT32 count; - INT32 sample_order[7] = {1,2,1,2,0,1,0}; - - if (climb != data) - { - if (data && dkongjr_walk == 0) - { - BurnSamplePlay(sample_order[count]+3); - count++; - if (count == 7) count = 0; - } - else if (data && dkongjr_walk == 1) - { - BurnSamplePlay(sample_order[count]+8); - count++; - if (count == 7) count = 0; - } - climb = data; - } -} - -static inline void dkongjr_sample_play(INT32 offs, UINT8 data, INT32 stop) // jump, land[s], roar, snapjaw[s], death[s], drop -{ - static INT32 select[8]; - UINT8 sample[8] = { 0, 1, 2, 11, 6, 7 }; - - if (select[offs] != data) - { - if (stop) { - if (data) BurnSampleStop(7); - BurnSamplePlay(sample[offs]); - } else { - if (data) BurnSamplePlay(sample[offs]); - } - - select[offs] = data; - } -} - -void __fastcall dkongjr_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x7c00: - *soundlatch = data; - return; - - case 0x7c81: - p[2] = (p[2] & ~0x40) | ((~data & 1) << 6); - return; - - case 0x7d00: - dkongjr_climb_write(data); - return; - - case 0x7d01: - dkongjr_sample_play(0, data, 0); - return; - - case 0x7d02: - dkongjr_sample_play(1, data, 1); - return; - - case 0x7d03: - dkongjr_sample_play(2, data, 0); - return; - - case 0x7d06: - dkongjr_sample_play(3, data, 1); - return; - - case 0x7d07: - dkongjr_walk = data; - return; - - case 0x7d80: - dkongjr_sample_play(4, data, 1); - return; - - case 0x7d81: - dkongjr_sample_play(5, data, 0); - return; - } - - dkong_main_write(address, data); -} - -void __fastcall radarscp_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x7c80: - *grid_color = data; // ? - return; - - case 0x7d81: - *grid_enable = data & 0x01; - return; - } - - dkong_main_write(address, data); -} - -void __fastcall dkong3_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x7c00: - soundlatch[0] = data; - return; - - case 0x7c80: - soundlatch[1] = data; - return; - - case 0x7d00: - soundlatch[2] = data; - return; - - case 0x7d80: - if (data & 1) { - sound_cpu_in_reset = 0; - M6502Open(0); - M6502Reset(); - M6502Close(); - - M6502Open(1); - M6502Reset(); - M6502Close(); - } else { - sound_cpu_in_reset = 1; - } - return; - - case 0x7e80: - // coin_counter - return; - - case 0x7e81: - *gfx_bank = data & 0x01; - return; - - case 0x7e82: - *flipscreen = ~data & 0x01; - return; - - case 0x7e83: - *sprite_bank = data & 0x01; - return; - - case 0x7e84: - *nmi_mask = data & 0x01; - return; - - case 0x7e85: // dma - return; - - case 0x7e86: - case 0x7e87: - if (data & 0x01) { - *palette_bank |= (1 << (address & 1)); - } else { - *palette_bank &= ~(1 << (address & 1)); - } - return; - } -} - -UINT8 __fastcall dkong3_main_read(UINT16 address) -{ - switch (address) - { - case 0x7c00: - return DrvInputs[0]; - - case 0x7c80: - return DrvInputs[1]; - - case 0x7d00: - return DrvDips[0]; - - case 0x7d80: - return DrvDips[1]; - } - - return 0; -} - - -static INT32 braze_bank = 0; - -static void braze_bankswitch(INT32 data) -{ - braze_bank = (data & 0x01) * 0x8000; - - ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM + braze_bank); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM + braze_bank); - - // work-around for eeprom reading - ZetMapArea(0x8000, 0xc7ff, 0, DrvZ80ROM + braze_bank); - ZetMapArea(0xc900, 0xffff, 0, DrvZ80ROM + 0x4900 + braze_bank); - - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + braze_bank); -} - -void __fastcall braze_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc800: - EEPROMWrite((data & 0x02), (data & 0x04), (data & 0x01)); - return; - - case 0xe000: - braze_bankswitch(data); - return; - } - - dkong_main_write(address, data); -} - -UINT8 __fastcall braze_main_read(UINT16 address) -{ - // work-around for eeprom reading - if ((address & 0xff00) == 0xc800) - { - if (address == 0xc800) return (EEPROMRead() & 1); - - return DrvZ80ROM[braze_bank + (address & 0x7fff)]; - } - - return dkong_main_read(address); -} - -static const eeprom_interface braze_eeprom_intf = -{ - 7, // address bits - 8, // data bits - "*110", // read command - "*101", // write command - 0, // erase command - "*10000xxxxx", // lock command - "*10011xxxxx", // unlock command - 0,0 -}; - -static void braze_decrypt_rom() -{ - UINT8 *tmp = BurnMalloc(0x10000); - - for (INT32 i = 0; i < 0x10000; i++) { - tmp[(BITSWAP08(i >> 8, 7,2,3,1,0,6,4,5) << 8) | (i & 0xff)] = BITSWAP08(DrvZ80ROM[i], 1,4,5,7,6,0,3,2); - } - - memcpy (DrvZ80ROM, tmp, 0x10000); - - BurnFree (tmp); -} - - - -static INT32 hunch_prot_ctr = 0; -static UINT8 hunchloopback = 0; -static UINT8 main_fo = 0; - -static void s2650_main_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("mw %4.4x, %2.2x\n"), address, data); - - if (address >= 0x2000) { // mirrors - s2650Write(address & 0x1fff, data); - return; - } - - if ((address & 0xff80) == 0x1f00) { - DrvSprRAM[0x400 + (address & 0x3ff)] = data; - return; - } - - if ((address & 0xfff0) == 0x1f80) { - i8257Write(address,data); - return; - } - - switch (address) - { - case 0x1400: - *soundlatch = data ^ 0x0f; // ? - return; - - case 0x1500: - case 0x1501: - case 0x1502: - case 0x1503: - case 0x1504: - case 0x1505: - case 0x1506: - case 0x1507: - return; // latch8_bit0_w - - case 0x1580: - I8039SetIrqState(data ? 1 : 0); - return; - - case 0x1582: - *flipscreen = ~data & 0x01; - return; - - case 0x1583: - *sprite_bank = data & 0x01; - return; - - case 0x1584: - return; // nop - - case 0x1585: - i8257_drq_write(0, data & 0x01); - i8257_drq_write(1, data & 0x01); - i8257_do_transfer(data & 0x01); - return; - - case 0x1586: - case 0x1587: - if (data & 0x01) { - *palette_bank |= (1 << (address & 1)); - } else { - *palette_bank &= ~(1 << (address & 1)); - } - return; - } -} - -static UINT8 s2650_main_read(UINT16 address) -{ -// bprintf (0, _T("mr %4.4x\n"), address); - - if (address >= 0x2000) { // mirrors - return s2650Read(address & 0x1fff); - } - - if ((address & 0xff80) == 0x1f00) { - return DrvSprRAM[0x400 + (address & 0x3ff)]; - } - - if ((address & 0xfff0) == 0x1f80) { - return i8257Read(address); - } - - if ((address & 0xfe80) == 0x1400) address &= ~0x7f; // mirrored - - switch (address) - { - case 0x1400: - return DrvInputs[0]; - - case 0x1480: - return DrvInputs[1]; - - case 0x1500: - { - UINT8 ret = DrvInputs[2] & 0xbf; - if (ret & 0x10) ret = (ret & ~0x10) | 0x80; - ret |= mcustatus << 6; - return ret; - } - return 0; - - case 0x1580: - return DrvDips[0]; - } - - return 0; -} - -static void s2650_main_write_port(UINT16 port, UINT8 data) -{ -// bprintf (0, _T("pw %4.4x, %2.2x\n"), port, data); - - switch (port) - { - case 0x101: - hunchloopback = data; - return; - - case 0x0103: - { - main_fo = data; - - if (data) hunchloopback = 0xfb; - } - return; - } -} - -static UINT8 s2650_main_read_port(UINT16 port) -{ -// bprintf (0, _T("pr %4.4x\n"), port); - - switch (port) - { - case 0x00: - switch (s2650_protection) - { - case 0x02: - if (main_fo) - return hunchloopback; - else - return hunchloopback--; - - default: - if (!main_fo) - return hunchloopback; - else - return hunchloopback--; - } - - case 0x01: - switch (s2650_protection) - { - case 0x01: - if (hunchloopback & 0x80) - return hunch_prot_ctr; - else - return ++hunch_prot_ctr; - - case 0x02: - return hunchloopback--; - } - - case S2650_SENSE_PORT: - return vblank^0x80; - } - - return 0; -} - -UINT8 __fastcall i8039_sound_read(UINT32 address) -{ - return DrvSndROM0[address & 0x0fff]; -} - -UINT8 __fastcall i8039_sound_read_port(UINT32 port) -{ - if (port < 0x100) { - if ((page & 0x40) && port == 0x20) return *soundlatch; - - return DrvSndROM0[0x1000 + (page & 7) * 0x100 + (port & 0xff)]; - } - - switch (port) - { - case I8039_p1: - return p[1]; - - case I8039_p2: - return p[2]; - - case I8039_t0: - return t[0]; - - case I8039_t1: - return t[1]; - } - - return 0; -} - -static INT32 DkongDACSync() -{ - return (INT32)(float)(nBurnSoundLen * (I8039TotalCycles() / ((6000000.000 / 15) / (nBurnFPS / 100.000)))); -} - -#if 1 -#include - -static double envelope,tt; -static INT32 decay; - -static void dkong_sh_p1_write(UINT8 data) -{ - envelope=exp(-tt); - DACWrite(0,(INT32)(data*envelope)); - if (decay) tt+=0.001; - else tt=0; -} -#endif - -static void __fastcall i8039_sound_write_port(UINT32 port, UINT8 data) -{ -//bprintf (0, _T("i8039 wp %x %x\n"), port,data); - - switch (port) - { - case I8039_p1: - dkong_sh_p1_write(data); - return; - - case I8039_p2: - decay = !(data & 0x80); - page = (data & 0x47); - mcustatus = ((~data & 0x10) >> 4); - return; - } -} - -static void dkong3_sound0_write(UINT16 a, UINT8 d) -{ - if (a <= 0x1ff) { - DrvSndRAM0[a] = d; - return; - } - - if (a >= 0x4000 && a <= 0x4017) { - nesapuWrite(0, a - 0x4000, d); - return; - } -} - -static UINT8 dkong3_sound0_read(UINT16 a) -{ - if (a <= 0x1ff) { - return DrvSndRAM0[a]; - } - if (a >= 0xe000) { - return DrvSndROM0[a - 0xe000]; - } - switch (a) { - case 0x4016: return soundlatch[0]; - case 0x4017: return soundlatch[1]; - } - if (a >= 0x4000 && a <= 0x4015) { - return nesapuRead(0, a - 0x4000); - } - - return 0; -} - -static void dkong3_sound1_write(UINT16 a, UINT8 d) -{ - if (a <= 0x1ff) { - DrvSndRAM1[a] = d; - return; - } - if (a >= 0x4000 && a <= 0x4017) { - nesapuWrite(1, a - 0x4000, d); - return; - } -} - -static UINT8 dkong3_sound1_read(UINT16 a) -{ - if (a <= 0x1ff) { - return DrvSndRAM1[a]; - } - if (a >= 0xe000) { - return DrvSndROM1[a - 0xe000]; - } - if (a >= 0x4000 && a <= 0x4017) { - if (a == 0x4016) return soundlatch[2]; - - return nesapuRead(1, a - 0x4000); - } - - return 0; -} - - -static UINT8 dma_latch = 0; - -static void p8257ControlWrite(UINT16,UINT8 data) -{ - dma_latch = data; -} - -static UINT8 p8257ControlRead(UINT16) -{ - return dma_latch; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - I8039Reset(); - - BurnSampleReset(); - DACReset(); - - i8257Reset(); - - EEPROMReset(); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv2650ROM = Next; - DrvZ80ROM = Next; Next += 0x020000; - DrvSndROM0 = Next; Next += 0x002000; - DrvSndROM1 = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x000800; - - DrvColPROM = Next; Next += 0x000300; - DrvMapROM = Next; Next += 0x000200; // for s2650 sets - - DrvRevMap = (INT32*)Next; Next += 0x000200 * sizeof(INT32); - - DrvPalette = (UINT32*)Next; Next += 0x0102 * sizeof(UINT32); - - AllRam = Next; - - Drv2650RAM = Next; - DrvZ80RAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000b00; - DrvVidRAM = Next; Next += 0x000400; - - DrvSndRAM0 = Next; Next += 0x000200; - DrvSndRAM1 = Next; Next += 0x000200; - - soundlatch = Next; Next += 0x000005; - gfx_bank = Next; Next += 0x000001; - sprite_bank = Next; Next += 0x000001; - palette_bank = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - nmi_mask = Next; Next += 0x000001; - - grid_color = Next; Next += 0x000001; - grid_enable = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void dkongPaletteInit() -{ - for (INT32 i = 0; i < 256; i++) - { - INT32 bit0 = (DrvColPROM[i+256] >> 1) & 1; - INT32 bit1 = (DrvColPROM[i+256] >> 2) & 1; - INT32 bit2 = (DrvColPROM[i+256] >> 3) & 1; - INT32 r = 255 - (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); - - bit0 = (DrvColPROM[i+0] >> 2) & 1; - bit1 = (DrvColPROM[i+0] >> 3) & 1; - bit2 = (DrvColPROM[i+256] >> 0) & 1; - INT32 g = 255 - (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); - - bit0 = (DrvColPROM[i+0] >> 0) & 1; - bit1 = (DrvColPROM[i+0] >> 1) & 1; - INT32 b = 255 - (0x55 * bit0 + 0xaa * bit1); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void dkong3PaletteInit() -{ - for (INT32 i = 0; i < 256; i++) - { - INT32 bit0 = (DrvColPROM[i+0] >> 4) & 0x01; - INT32 bit1 = (DrvColPROM[i+0] >> 5) & 0x01; - INT32 bit2 = (DrvColPROM[i+0] >> 6) & 0x01; - INT32 bit3 = (DrvColPROM[i+0] >> 7) & 0x01; - INT32 r = 255 - (0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3); - - bit0 = (DrvColPROM[i+0] >> 0) & 0x01; - bit1 = (DrvColPROM[i+0] >> 1) & 0x01; - bit2 = (DrvColPROM[i+0] >> 2) & 0x01; - bit3 = (DrvColPROM[i+0] >> 3) & 0x01; - INT32 g = 255 - (0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3); - - bit0 = (DrvColPROM[i+256] >> 0) & 0x01; - bit1 = (DrvColPROM[i+256] >> 1) & 0x01; - bit2 = (DrvColPROM[i+256] >> 2) & 0x01; - bit3 = (DrvColPROM[i+256] >> 3) & 0x01; - INT32 b = 255 - (0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0x2000/2*8, 0 }; - INT32 Plane1[2] = { 0x4000/2*8, 0 }; - INT32 XOffs0[16] = { STEP8(0,1), STEP8((0x2000/4)*8,1) }; - INT32 XOffs1[16] = { STEP8(0,1), STEP8((0x4000/4)*8,1) }; - INT32 YOffs[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Plane0, XOffs0, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x4000); - - GfxDecode(0x0100, 2, 16, 16, Plane1, XOffs1, YOffs, 0x080, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static ior_in_functs dkong_dma_read_functions[4] = { NULL, p8257ControlRead, NULL, NULL }; -static ior_out_functs dkong_dma_write_functions[4] = { p8257ControlWrite, NULL, NULL, NULL }; - -static INT32 DrvInit(INT32 (*pRomLoadCallback)(), void (*pPaletteUpdate)(), UINT32 map_flags) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM); - - if (map_flags & 2) { // hack - ZetMapArea(0x6000, 0x68ff, 0, DrvZ80RAM); - ZetMapArea(0x6000, 0x68ff, 1, DrvZ80RAM); - ZetMapArea(0x6000, 0x68ff, 2, DrvZ80RAM); - ZetMapArea(0x6900, 0x73ff, 0, DrvSprRAM); // 900-a7f - ZetMapArea(0x6900, 0x73ff, 1, DrvSprRAM); - ZetMapArea(0x6900, 0x73ff, 2, DrvSprRAM); - } else { - ZetMapArea(0x6000, 0x6fff, 0, DrvZ80RAM); - ZetMapArea(0x6000, 0x6fff, 1, DrvZ80RAM); - ZetMapArea(0x6000, 0x6fff, 2, DrvZ80RAM); - ZetMapArea(0x7000, 0x73ff, 0, DrvSprRAM); - ZetMapArea(0x7000, 0x73ff, 1, DrvSprRAM); - ZetMapArea(0x7000, 0x73ff, 2, DrvSprRAM); - } - - ZetMapArea(0x7400, 0x77ff, 0, DrvVidRAM); - ZetMapArea(0x7400, 0x77ff, 1, DrvVidRAM); - ZetMapArea(0x7400, 0x77ff, 2, DrvVidRAM); - - if (map_flags & 1) { - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + 0x8000); - } - - ZetSetWriteHandler(dkong_main_write); - ZetSetReadHandler(dkong_main_read); - ZetClose(); - - I8039Init(NULL); - I8039SetIOReadHandler(i8039_sound_read_port); - I8039SetIOWriteHandler(i8039_sound_write_port); - I8039SetProgramReadHandler(i8039_sound_read); - I8039SetCPUOpReadHandler(i8039_sound_read); - I8039SetCPUOpReadArgHandler(i8039_sound_read); - - DACInit(0, 0, 0, DkongDACSync); - DACSetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.75, BURN_SND_ROUTE_BOTH); - - i8257Init(); - i8257Config(ZetReadByte, ZetWriteByte, ZetIdle, dkong_dma_read_functions, dkong_dma_write_functions); - - EEPROMInit(&braze_eeprom_intf); - - { - if (pRomLoadCallback) { - if (pRomLoadCallback()) return 1; - } - - if (pPaletteUpdate) { - DrvPaletteUpdate = pPaletteUpdate; - - DrvPaletteUpdate(); - } - - DrvGfxDecode(); - } - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - I8039Exit(); - i8257Exit(); - - BurnSampleExit(); - DACExit(); - - EEPROMExit(); - - BurnFree(AllMem); - - radarscp1 = 0; - - return 0; -} - -static INT32 Dkong3DoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - M6502Open(1); - M6502Reset(); - M6502Close(); - - nesapuReset(); // necessary? - - sound_cpu_in_reset = 0; - - return 0; -} - -static UINT32 dkong3_nesapu_sync(INT32 samples_rate) -{ - return (samples_rate * M6502TotalCycles()) / 29830 /* 1789773 / 60 */; -} - -static INT32 Dkong3Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x8000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 7, 1)) return 1; - - memcpy (DrvGfxROM0 + 0x0000, DrvGfxROM1 + 0x0800, 0x0800); - memcpy (DrvGfxROM0 + 0x0800, DrvGfxROM1 + 0x0000, 0x0800); - memcpy (DrvGfxROM0 + 0x1000, DrvGfxROM1 + 0x1800, 0x0800); - memcpy (DrvGfxROM0 + 0x1800, DrvGfxROM1 + 0x1000, 0x0800); - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 14, 1)) return 1; - - DrvPaletteUpdate = dkong3PaletteInit; - DrvPaletteUpdate(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM); - ZetMapArea(0x6000, 0x68ff, 0, DrvZ80RAM); - ZetMapArea(0x6000, 0x68ff, 1, DrvZ80RAM); - ZetMapArea(0x6000, 0x68ff, 2, DrvZ80RAM); - ZetMapArea(0x6900, 0x73ff, 0, DrvSprRAM); // 900-a7f - ZetMapArea(0x6900, 0x73ff, 1, DrvSprRAM); - ZetMapArea(0x6900, 0x73ff, 2, DrvSprRAM); - ZetMapArea(0x7400, 0x77ff, 0, DrvVidRAM); - ZetMapArea(0x7400, 0x77ff, 1, DrvVidRAM); - ZetMapArea(0x7400, 0x77ff, 2, DrvVidRAM); - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + 0x8000); - ZetSetWriteHandler(dkong3_main_write); - ZetSetReadHandler(dkong3_main_read); - ZetClose(); - - M6502Init(0, TYPE_N2A03); - M6502Open(0); - //M6502MapMemory(DrvSndRAM0, 0x0000, 0x01ff, MAP_RAM); // handled below - //M6502MapMemory(DrvSndROM0, 0xe000, 0xffff, MAP_ROM); - M6502SetReadOpArgHandler(dkong3_sound0_read); - M6502SetReadOpHandler(dkong3_sound0_read); - M6502SetWriteHandler(dkong3_sound0_write); - M6502SetReadHandler(dkong3_sound0_read); - M6502Close(); - - M6502Init(1, TYPE_N2A03); - M6502Open(1); - //M6502MapMemory(DrvSndRAM1, 0x0000, 0x01ff, MAP_RAM); // handled below - //M6502MapMemory(DrvSndROM1, 0xe000, 0xffff, MAP_ROM); - M6502SetReadOpArgHandler(dkong3_sound1_read); - M6502SetReadOpHandler(dkong3_sound1_read); - M6502SetWriteHandler(dkong3_sound1_write); - M6502SetReadHandler(dkong3_sound1_read); - M6502Close(); - - nesapuInit(0, 1789773, dkong3_nesapu_sync, 0); - nesapuSetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - nesapuInit(1, 1789773, dkong3_nesapu_sync, 1); - nesapuSetAllRoutes(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - Dkong3DoReset(); - - return 0; -} - -static INT32 Dkong3Exit() -{ - GenericTilesExit(); - - ZetExit(); - M6502Exit(); - nesapuExit(); - - BurnFree(AllMem); - - return 0; -} - -static INT32 s2650DkongDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - s2650Open(0); - s2650Reset(); - s2650Close(); - - I8039Reset(); - - BurnSampleReset(); - DACReset(); - - i8257Reset(); - - hunchloopback = 0; - - return 0; -} - -static UINT8 hb_dma_read_byte(UINT16 offset) -{ - offset = ((DrvRevMap[(offset >> 10) & 0x1ff] << 7) & 0x7c00) | (offset & 0x3ff); - - return s2650Read(offset); -} - -static void hb_dma_write_byte(UINT16 offset, UINT8 data) -{ - offset = ((DrvRevMap[(offset >> 10) & 0x1ff] << 7) & 0x7c00) | (offset & 0x3ff); - - s2650Write(offset, data); -} - -static INT32 s2650_irq_callback(INT32) -{ - return 0x03; -} - -static void s2650RevMapConvert() -{ - for (INT32 i = 0; i < 0x200; i++) { - DrvRevMap[DrvMapROM[i]] = i; - } -} - -static INT32 s2650DkongInit(INT32 (*pRomLoadCallback)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (pRomLoadCallback) { - if (pRomLoadCallback()) return 1; - } - - DrvPaletteUpdate = dkongPaletteInit; - - s2650RevMapConvert(); - DrvGfxDecode(); - } - - s2650Init(1); - s2650Open(0); - s2650MapMemory(Drv2650ROM + 0x0000, 0x0000, 0x0fff, MAP_ROM); - s2650MapMemory(Drv2650RAM + 0x0000, 0x1000, 0x13ff, MAP_RAM); // sprite ram (after dma) - s2650MapMemory(DrvSprRAM + 0x0000, 0x1600, 0x17ff, MAP_RAM); - s2650MapMemory(DrvVidRAM + 0x0000, 0x1800, 0x1bff, MAP_RAM); - s2650MapMemory(DrvSprRAM + 0x0400, 0x1c00, 0x1eff, MAP_RAM); - s2650MapMemory(Drv2650ROM + 0x2000, 0x2000, 0x2fff, MAP_ROM); - s2650MapMemory(Drv2650ROM + 0x4000, 0x4000, 0x4fff, MAP_ROM); - s2650MapMemory(Drv2650ROM + 0x6000, 0x6000, 0x6fff, MAP_ROM); - s2650SetIrqCallback(s2650_irq_callback); - s2650SetWriteHandler(s2650_main_write); - s2650SetReadHandler(s2650_main_read); - s2650SetOutHandler(s2650_main_write_port); - s2650SetInHandler(s2650_main_read_port); - s2650Close(); - - I8039Init(NULL); - I8039SetIOReadHandler(i8039_sound_read_port); - I8039SetIOWriteHandler(i8039_sound_write_port); - I8039SetProgramReadHandler(i8039_sound_read); - I8039SetCPUOpReadHandler(i8039_sound_read); - I8039SetCPUOpReadArgHandler(i8039_sound_read); - - DACInit(0, 0, 0, DkongDACSync); - DACSetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.75, BURN_SND_ROUTE_BOTH); - - i8257Init(); - i8257Config(hb_dma_read_byte, hb_dma_write_byte, /*s2650Idle*/NULL, dkong_dma_read_functions, dkong_dma_write_functions); - - GenericTilesInit(); - - s2650DkongDoReset(); - - return 0; -} - -static INT32 s2650DkongExit() -{ - GenericTilesExit(); - - s2650Exit(); - I8039Exit(); - i8257Exit(); - - BurnSampleExit(); - DACExit(); - - BurnFree(AllMem); - - s2650_protection = 0; - - return 0; -} - -static void draw_grid() -{ - DrvPalette[0x100] = BurnHighCol(0xff, 0, 0, 0); // red - DrvPalette[0x101] = BurnHighCol(0, 0, 0xff, 0); // blue - - const UINT8 *table = DrvGfxROM2; - INT32 x,y,counter; - - counter = (radarscp1) ? 0x000 : 0x400; //flip_screen ? 0x000 : 0x400; - - x = 0; - y = 16; - - while (y <= 240) - { - x = 4 * (table[counter] & 0x7f); - - if (x >= 0 && x <= 255) - { - if (table[counter] & 0x80) /* star */ - { - if (rand() & 1) /* noise coming from sound board */ - pTransDraw[(y - 16) * nScreenWidth + x] = 0x100; - } - else if (*grid_enable) /* radar */ - pTransDraw[(y - 16) * nScreenWidth + x] = 0x101; - } - - counter++; - - if (x >= 4 * (table[counter] & 0x7f)) - y++; - } -} - -static void draw_sprites(UINT32 code_mask, UINT32 mask_bank, UINT32 shift_bits, UINT32 swap) -{ - INT32 bank = *sprite_bank * 0x200; - INT32 yoffset = (swap) ? -15 : -16; - - for (INT32 offs = bank; offs < bank + 0x200; offs += 4) - { - if (DrvSprRAM[offs + 0]) - { - INT32 sx = DrvSprRAM[offs + 3] - 8; - INT32 attr = DrvSprRAM[offs + ((swap) ? 1 : 2)]; - INT32 code = (DrvSprRAM[offs + ((swap) ? 2 : 1)] & code_mask) + ((attr & mask_bank) << shift_bits); - INT32 sy =(240 - DrvSprRAM[offs + 0] + 7) + yoffset; - INT32 color = (attr & 0x0f) + (*palette_bank * 0x10); - INT32 flipx = attr & 0x80; - INT32 flipy = DrvSprRAM[offs + 1] & ((swap) ? 0x40 : 0x80); - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } - - // wraparound - if (sx < 0) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx+256, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx+256, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx+256, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx+256, sy, color, 2, 0, 0, DrvGfxROM1); - } - } - } - } - } -} - -static void draw_layer() -{ - for (INT32 offs = (32 * 2); offs < (32 * 32) - (32 * 2); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 code = DrvVidRAM[offs] + (*gfx_bank * 256); - INT32 color =(DrvColPROM[0x200 + (offs & 0x1f) + ((offs / 0x80) * 0x20)] & 0x0f) + (*palette_bank * 0x10); - - Render8x8Tile(pTransDraw, code, sx, sy - 16, color, 2, 0, DrvGfxROM0); - } -} - -static INT32 dkongDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(0x7f, 0x40, 1, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 radarscpDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; - } - - draw_layer(); - draw_grid(); - draw_sprites(0x7f, 0x40, 1, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 pestplceDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(0xff, 0x00, 0, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - I8039NewFrame(); - - { - memset (DrvInputs, 0, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - ZetOpen(0); - - for (INT32 i = 0; i < 10; i++) { - ZetRun(3072000 / 60 / 10); - - I8039Run(6000000 / 15 / 60 / 10); - } - - if (*nmi_mask) ZetNmi(); - ZetClose(); - - if (pBurnSoundOut) { - DACUpdate(pBurnSoundOut, nBurnSoundLen); - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 Dkong3Frame() -{ - if (DrvReset) { - Dkong3DoReset(); - } - - M6502NewFrame(); - - { - memset (DrvInputs, 0, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 400; // ? - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - ZetRun(4000000 / 60 / nInterleave); - if (i == (nInterleave - 1) && *nmi_mask) ZetNmi(); - ZetClose(); - - M6502Open(0); - M6502Run(1789773 / 60 / nInterleave); - if (i == (nInterleave - 1)) M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - M6502Close(); - - M6502Open(1); - M6502Run(1789773 / 60 / nInterleave); - if (i == (nInterleave - 1)) M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - M6502Close(); - } - - if (pBurnSoundOut) { - nesapuUpdate(0, pBurnSoundOut, nBurnSoundLen); - nesapuUpdate(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 s2650DkongFrame() -{ - if (DrvReset) { - s2650DkongDoReset(); - } - - I8039NewFrame(); - - { - memset (DrvInputs, 0, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - s2650Open(0); - - vblank = 0; - - for (INT32 i = 0; i < 32; i++) - { - s2650Run(3072000 / 2 / 60 / 32); - - I8039Run(6000000 / 15 / 60 / 32); - - if (i == 30) { - vblank = 0x80; - - s2650SetIRQLine(0, CPU_IRQSTATUS_ACK); - s2650Run(10); - s2650SetIRQLine(0, CPU_IRQSTATUS_NONE); - } - } - - s2650Close(); - - if (pBurnSoundOut) { - DACUpdate(pBurnSoundOut, nBurnSoundLen); - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - - - -// Radar Scope - -static struct BurnRomInfo radarscpRomDesc[] = { - { "trs2c5fc", 0x1000, 0x40949e0d, 1 }, // 0 maincpu - { "trs2c5gc", 0x1000, 0xafa8c49f, 1 }, // 1 - { "trs2c5hc", 0x1000, 0x51b8263d, 1 }, // 2 - { "trs2c5kc", 0x1000, 0x1f0101f7, 1 }, // 3 - - { "trs2s3i", 0x0800, 0x78034f14, 2 }, // 4 soundcpu - - { "trs2v3gc", 0x0800, 0xf095330e, 3 }, // 5 gfx1 - { "trs2v3hc", 0x0800, 0x15a316f0, 3 }, // 6 - - { "trs2v3dc", 0x0800, 0xe0bb0db9, 4 }, // 7 gfx2 - { "trs2v3cc", 0x0800, 0x6c4e7dad, 4 }, // 8 - { "trs2v3bc", 0x0800, 0x6fdd63f1, 4 }, // 9 - { "trs2v3ac", 0x0800, 0xbbf62755, 4 }, // 10 - - { "rs2-x.xxx", 0x0100, 0x54609d61, 6 }, // 11 proms - { "rs2-c.xxx", 0x0100, 0x79a7d831, 6 }, // 12 - { "rs2-v.1hc", 0x0100, 0x1b828315, 6 }, // 13 - - { "trs2v3ec", 0x0800, 0x0eca8d6b, 5 }, // 14 gfx3 -}; - -STD_ROM_PICK(radarscp) -STD_ROM_FN(radarscp) - -static INT32 radarscpRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x3000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x0000, 4, 1)) return 1; - memcpy (DrvSndROM0 + 0x0800, DrvSndROM0 + 0x0000, 0x0800); // re-load - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 14, 1)) return 1; - - return 0; -} - -static INT32 radarscpInit() -{ - INT32 ret = DrvInit(radarscpRomLoad, dkongPaletteInit, 0); - - if (ret == 0) - { - ZetOpen(0); - ZetSetWriteHandler(radarscp_main_write); - ZetClose(); - } - - return ret; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - if (s2650_protection) { - s2650Scan(nAction); - } else { - ZetScan(nAction); - } - i8257Scan(); - I8039Scan(nAction, pnMin); - BurnSampleScan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(vblank); - SCAN_VAR(s2650_protection); - SCAN_VAR(dkongjr_walk); - SCAN_VAR(page); - SCAN_VAR(mcustatus); - SCAN_VAR(p); - SCAN_VAR(t); - - DrvRecalc = 1; - - if (nAction & ACB_WRITE) { - } - } - - return 0; -} - -static INT32 Dkong3Scan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - ZetScan(nAction); - M6502Scan(nAction); - - SCAN_VAR(vblank); - SCAN_VAR(s2650_protection); - SCAN_VAR(dkongjr_walk); - SCAN_VAR(page); - SCAN_VAR(mcustatus); - SCAN_VAR(p); - SCAN_VAR(t); - - DrvRecalc = 1; - - if (nAction & ACB_WRITE) { - } - } - - return 0; -} - - -struct BurnDriver BurnDrvRadarscp = { - "radarscp", NULL, NULL, NULL, "1980", - "Radar Scope\0", "No sound", "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, radarscpRomInfo, radarscpRomName, NULL, NULL, RadarscpInputInfo, RadarscpDIPInfo, - radarscpInit, DrvExit, DrvFrame, radarscpDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Radar Scope (TRS01) - -static struct BurnRomInfo radarscp1RomDesc[] = { - { "trs01_5f", 0x1000, 0x40949e0d, 1 }, // 0 maincpu - { "trs01_5g", 0x1000, 0xafa8c49f, 1 }, // 1 - { "trs01_5h", 0x1000, 0x51b8263d, 1 }, // 2 - { "trs01_5k", 0x1000, 0x1f0101f7, 1 }, // 3 - - { "trs-s__5a.5a", 0x0800, 0x5166554c, 2 }, // 4 soundcpu - - { "trs01v3f", 0x0800, 0xf095330e, 4 }, // 5 gfx1 - { "trs01v3g", 0x0800, 0x15a316f0, 4 }, // 6 - - { "trs01v3d", 0x0800, 0xe0bb0db9, 5 }, // 7 gfx2 - { "trs01v3c", 0x0800, 0x6c4e7dad, 5 }, // 8 - { "trs01v3b", 0x0800, 0x6fdd63f1, 5 }, // 9 - { "trs01v3a", 0x0800, 0xbbf62755, 5 }, // 10 - - { "trs01c2j.bin", 0x0100, 0x2a087c87, 8 }, // 11 proms - { "trs01c2k.bin", 0x0100, 0x650c5daf, 8 }, // 12 - { "trs01c2l.bin", 0x0100, 0x23087910, 8 }, // 13 - - { "trs011ha.bin", 0x0800, 0xdbcc50c2, 6 }, // 14 gfx3 - - { "trs01e3k.bin", 0x0100, 0x6c6f989c, 7 }, // 15 gfx4 - - { "trs-s__4h.4h", 0x0800, 0xd1f1b48c, 3 }, // 16 m58819 speech - - { "trs01v1d.bin", 0x0100, 0x1b828315, 8 }, // 17 unused proms -}; - -STD_ROM_PICK(radarscp1) -STD_ROM_FN(radarscp1) - -static INT32 radarscp1RomLoad() -{ - if (radarscpRomLoad()) return 1; - - // load gfx4 - // load speech - - return 0; -} - -static INT32 radarscp1Init() -{ - INT32 ret = DrvInit(radarscp1RomLoad, dkongPaletteInit, 0); - - if (ret == 0) - { - ZetOpen(0); - ZetSetWriteHandler(radarscp_main_write); - ZetClose(); - radarscp1 = 1; - } - - return ret; -} - -struct BurnDriver BurnDrvRadarscp1 = { - "radarscp1", "radarscp", NULL, NULL, "1980", - "Radar Scope (TRS01)\0", "No sound / Gfx Issues", "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, radarscp1RomInfo, radarscp1RomName, NULL, NULL, RadarscpInputInfo, RadarscpDIPInfo, - radarscp1Init, DrvExit, DrvFrame, radarscpDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong (US set 1) - -static struct BurnRomInfo dkongRomDesc[] = { - { "c_5et_g.bin", 0x1000, 0xba70b88b, 1 }, // 0 maincpu - { "c_5ct_g.bin", 0x1000, 0x5ec461ec, 1 }, // 1 - { "c_5bt_g.bin", 0x1000, 0x1c97d324, 1 }, // 2 - { "c_5at_g.bin", 0x1000, 0xb9005ac0, 1 }, // 3 - - { "s_3i_b.bin", 0x0800, 0x45a4ed06, 2 }, // 4 soundcpu - { "s_3j_b.bin", 0x0800, 0x4743fe92, 2 }, // 5 - - { "v_5h_b.bin", 0x0800, 0x12c8c95d, 3 }, // 6 gfx1 - { "v_3pt.bin", 0x0800, 0x15e9c5e9, 3 }, // 7 - - { "l_4m_b.bin", 0x0800, 0x59f8054d, 4 }, // 8 gfx2 - { "l_4n_b.bin", 0x0800, 0x672e4714, 4 }, // 9 - { "l_4r_b.bin", 0x0800, 0xfeaa59ee, 4 }, // 10 - { "l_4s_b.bin", 0x0800, 0x20f2ef7e, 4 }, // 11 - - { "c-2k.bpr", 0x0100, 0xe273ede5, 5 }, // 12 proms - { "c-2j.bpr", 0x0100, 0xd6412358, 5 }, // 13 - { "v-5e.bpr", 0x0100, 0xb869b8f5, 5 }, // 14 -}; - -STD_ROM_PICK(dkong) -STD_ROM_FN(dkong) - -static struct BurnSampleInfo DkongSampleDesc[] = { -#if !defined (ROM_VERIFY) - { "run01", SAMPLE_NOLOOP }, - { "run02", SAMPLE_NOLOOP }, - { "run03", SAMPLE_NOLOOP }, - { "jump", SAMPLE_NOLOOP }, - { "dkstomp", SAMPLE_NOLOOP }, -#endif - { "", 0 } -}; - -STD_SAMPLE_PICK(Dkong) -STD_SAMPLE_FN(Dkong) - -static INT32 dkongRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x3000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x0000, 4, 1)) return 1; - memcpy (DrvSndROM0 + 0x0800, DrvSndROM0 + 0x0000, 0x0800); // re-load - if (BurnLoadRom(DrvSndROM0 + 0x1000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 14, 1)) return 1; - - return 0; -} - -static INT32 dkongInit() -{ - return DrvInit(dkongRomLoad, dkongPaletteInit, 0); -} - -struct BurnDriver BurnDrvDkong = { - "dkong", NULL, NULL, "dkong", "1981", - "Donkey Kong (US set 1)\0", NULL, "Nintendo of America", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongRomInfo, dkongRomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, DkongDIPInfo, - dkongInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong (US set 1) with Hard Kit - -static struct BurnRomInfo dkonghrdRomDesc[] = { - { "dk5ehard.bin", 0x1000, 0xa9445215, 1 }, // 0 maincpu - { "c_5ct_g.bin", 0x1000, 0x5ec461ec, 1 }, // 1 - { "c_5bt_g.bin", 0x1000, 0x1c97d324, 1 }, // 2 - { "dk5ahard.bin", 0x1000, 0xa990729b, 1 }, // 3 - - { "s_3i_b.bin", 0x0800, 0x45a4ed06, 2 }, // 4 soundcpu - { "s_3j_b.bin", 0x0800, 0x4743fe92, 2 }, // 5 - - { "v_5h_b.bin", 0x0800, 0x12c8c95d, 3 }, // 6 gfx1 - { "v_3pt.bin", 0x0800, 0x15e9c5e9, 3 }, // 7 - - { "l_4m_b.bin", 0x0800, 0x59f8054d, 4 }, // 8 gfx2 - { "l_4n_b.bin", 0x0800, 0x672e4714, 4 }, // 9 - { "l_4r_b.bin", 0x0800, 0xfeaa59ee, 4 }, // 10 - { "l_4s_b.bin", 0x0800, 0x20f2ef7e, 4 }, // 11 - - { "c-2k.bpr", 0x0100, 0xe273ede5, 5 }, // 12 proms - { "c-2j.bpr", 0x0100, 0xd6412358, 5 }, // 13 - { "v-5e.bpr", 0x0100, 0xb869b8f5, 5 }, // 14 -}; - -STD_ROM_PICK(dkonghrd) -STD_ROM_FN(dkonghrd) - -struct BurnDriver BurnDrvDkonghrd = { - "dkonghrd", "dkong", NULL, "dkong", "1981", - "Donkey Kong (US set 1) with Hard kit\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkonghrdRomInfo, dkonghrdRomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, DkongDIPInfo, - dkongInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong (US set 2) - -static struct BurnRomInfo dkongoRomDesc[] = { - { "c_5f_b.bin", 0x1000, 0x424f2b11, 1 }, // 0 maincpu - { "c_5ct_g.bin", 0x1000, 0x5ec461ec, 1 }, // 1 - { "c_5h_b.bin", 0x1000, 0x1d28895d, 1 }, // 2 - { "tkg3c.5k", 0x1000, 0x553b89bb, 1 }, // 3 - - { "s_3i_b.bin", 0x0800, 0x45a4ed06, 2 }, // 4 soundcpu - { "s_3j_b.bin", 0x0800, 0x4743fe92, 2 }, // 5 - - { "v_5h_b.bin", 0x0800, 0x12c8c95d, 3 }, // 6 gfx1 - { "v_3pt.bin", 0x0800, 0x15e9c5e9, 3 }, // 7 - - { "l_4m_b.bin", 0x0800, 0x59f8054d, 4 }, // 8 gfx2 - { "l_4n_b.bin", 0x0800, 0x672e4714, 4 }, // 9 - { "l_4r_b.bin", 0x0800, 0xfeaa59ee, 4 }, // 10 - { "l_4s_b.bin", 0x0800, 0x20f2ef7e, 4 }, // 11 - - { "c-2k.bpr", 0x0100, 0xe273ede5, 5 }, // 12 proms - { "c-2j.bpr", 0x0100, 0xd6412358, 5 }, // 13 - { "v-5e.bpr", 0x0100, 0xb869b8f5, 5 }, // 14 -}; - -STD_ROM_PICK(dkongo) -STD_ROM_FN(dkongo) - -struct BurnDriver BurnDrvDkongo = { - "dkongo", "dkong", NULL, "dkong", "1981", - "Donkey Kong (US set 2)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongoRomInfo, dkongoRomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, DkongDIPInfo, - dkongInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong (Japan set 1) - -static struct BurnRomInfo dkongjRomDesc[] = { - { "c_5f_b.bin", 0x1000, 0x424f2b11, 1 }, // 0 maincpu - { "5g.cpu", 0x1000, 0xd326599b, 1 }, // 1 - { "5h.cpu", 0x1000, 0xff31ac89, 1 }, // 2 - { "c_5k_b.bin", 0x1000, 0x394d6007, 1 }, // 3 - - { "s_3i_b.bin", 0x0800, 0x45a4ed06, 2 }, // 4 soundcpu - { "s_3j_b.bin", 0x0800, 0x4743fe92, 2 }, // 5 - - { "v_5h_b.bin", 0x0800, 0x12c8c95d, 3 }, // 6 gfx1 - { "v_5k_b.bin", 0x0800, 0x3684f914, 3 }, // 7 - - { "l_4m_b.bin", 0x0800, 0x59f8054d, 4 }, // 8 gfx2 - { "l_4n_b.bin", 0x0800, 0x672e4714, 4 }, // 9 - { "l_4r_b.bin", 0x0800, 0xfeaa59ee, 4 }, // 10 - { "l_4s_b.bin", 0x0800, 0x20f2ef7e, 4 }, // 11 - - { "c-2k.bpr", 0x0100, 0xe273ede5, 5 }, // 12 proms - { "c-2j.bpr", 0x0100, 0xd6412358, 5 }, // 13 - { "v-5e.bpr", 0x0100, 0xb869b8f5, 5 }, // 14 -}; - -STD_ROM_PICK(dkongj) -STD_ROM_FN(dkongj) - -struct BurnDriver BurnDrvDkongj = { - "dkongj", "dkong", NULL, "dkong", "1981", - "Donkey Kong (Japan set 1)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongjRomInfo, dkongjRomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, DkongDIPInfo, - dkongInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong (Japan set 2) - -static struct BurnRomInfo dkongjoRomDesc[] = { - { "c_5f_b.bin", 0x1000, 0x424f2b11, 1 }, // 0 maincpu - { "c_5g_b.bin", 0x1000, 0x3b2a6635, 1 }, // 1 - { "c_5h_b.bin", 0x1000, 0x1d28895d, 1 }, // 2 - { "c_5k_b.bin", 0x1000, 0x394d6007, 1 }, // 3 - - { "s_3i_b.bin", 0x0800, 0x45a4ed06, 2 }, // 4 soundcpu - { "s_3j_b.bin", 0x0800, 0x4743fe92, 2 }, // 5 - - { "v_5h_b.bin", 0x0800, 0x12c8c95d, 3 }, // 6 gfx1 - { "v_5k_b.bin", 0x0800, 0x3684f914, 3 }, // 7 - - { "l_4m_b.bin", 0x0800, 0x59f8054d, 4 }, // 8 gfx2 - { "l_4n_b.bin", 0x0800, 0x672e4714, 4 }, // 9 - { "l_4r_b.bin", 0x0800, 0xfeaa59ee, 4 }, // 10 - { "l_4s_b.bin", 0x0800, 0x20f2ef7e, 4 }, // 11 - - { "c-2k.bpr", 0x0100, 0xe273ede5, 5 }, // 12 proms - { "c-2j.bpr", 0x0100, 0xd6412358, 5 }, // 13 - { "v-5e.bpr", 0x0100, 0xb869b8f5, 5 }, // 14 -}; - -STD_ROM_PICK(dkongjo) -STD_ROM_FN(dkongjo) - -struct BurnDriver BurnDrvDkongjo = { - "dkongjo", "dkong", NULL, "dkong", "1981", - "Donkey Kong (Japan set 2)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongjoRomInfo, dkongjoRomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, DkongDIPInfo, - dkongInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong (Japan set 3) - -static struct BurnRomInfo dkongjo1RomDesc[] = { - { "c_5f_b.bin", 0x1000, 0x424f2b11, 1 }, // 0 maincpu - { "5g.cpu", 0x1000, 0xd326599b, 1 }, // 1 - { "c_5h_b.bin", 0x1000, 0x1d28895d, 1 }, // 2 - { "5k.bin", 0x1000, 0x7961599c, 1 }, // 3 - - { "s_3i_b.bin", 0x0800, 0x45a4ed06, 2 }, // 4 soundcpu - { "s_3j_b.bin", 0x0800, 0x4743fe92, 2 }, // 5 - - { "v_5h_b.bin", 0x0800, 0x12c8c95d, 3 }, // 6 gfx1 - { "v_5k_b.bin", 0x0800, 0x3684f914, 3 }, // 7 - - { "l_4m_b.bin", 0x0800, 0x59f8054d, 4 }, // 8 gfx2 - { "l_4n_b.bin", 0x0800, 0x672e4714, 4 }, // 9 - { "l_4r_b.bin", 0x0800, 0xfeaa59ee, 4 }, // 10 - { "l_4s_b.bin", 0x0800, 0x20f2ef7e, 4 }, // 11 - - { "c-2k.bpr", 0x0100, 0xe273ede5, 5 }, // 12 proms - { "c-2j.bpr", 0x0100, 0xd6412358, 5 }, // 13 - { "v-5e.bpr", 0x0100, 0xb869b8f5, 5 }, // 14 -}; - -STD_ROM_PICK(dkongjo1) -STD_ROM_FN(dkongjo1) - -struct BurnDriver BurnDrvDkongjo1 = { - "dkongjo1", "dkong", NULL, "dkong", "1981", - "Donkey Kong (Japan set 3)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongjo1RomInfo, dkongjo1RomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, DkongDIPInfo, - dkongInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong Foundry (hack) - -static struct BurnRomInfo dkongfRomDesc[] = { - { "dk_f.5et", 0x1000, 0x00b7efaf, 1 }, // 0 maincpu - { "dk_f.5ct", 0x1000, 0x88af9b69, 1 }, // 1 - { "dk_f.5bt", 0x1000, 0xde74ad91, 1 }, // 2 - { "dk_f.5at", 0x1000, 0x6a6bd420, 1 }, // 3 - - { "s_3i_b.bin", 0x0800, 0x45a4ed06, 2 }, // 4 soundcpu - { "s_3j_b.bin", 0x0800, 0x4743fe92, 2 }, // 5 - - { "v_5h_b.bin", 0x0800, 0x12c8c95d, 3 }, // 6 gfx1 - { "v_3pt.bin", 0x0800, 0x15e9c5e9, 3 }, // 7 - - { "l_4m_b.bin", 0x0800, 0x59f8054d, 4 }, // 8 gfx2 - { "l_4n_b.bin", 0x0800, 0x672e4714, 4 }, // 9 - { "l_4r_b.bin", 0x0800, 0xfeaa59ee, 4 }, // 10 - { "l_4s_b.bin", 0x0800, 0x20f2ef7e, 4 }, // 11 - - { "c-2k.bpr", 0x0100, 0xe273ede5, 5 }, // 12 proms - { "c-2j.bpr", 0x0100, 0xd6412358, 5 }, // 13 - { "v-5e.bpr", 0x0100, 0xb869b8f5, 5 }, // 14 -}; - -STD_ROM_PICK(dkongf) -STD_ROM_FN(dkongf) - -struct BurnDriver BurnDrvDkongf = { - "dkongf", "dkong", NULL, "dkong", "2004", - "Donkey Kong Foundry (hack)\0", NULL, "hack (Jeff Kulczycki)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongfRomInfo, dkongfRomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, DkongfDIPInfo, - dkongInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong - Pauline Edition (hack, rev 5) -// "Pauline Edition" hack (rev 5, 4-22-2013), by Clay Cowgill based on Mike Mika's NES version - -static struct BurnRomInfo dkongpeRomDesc[] = { - { "c_5et_g.bin", 0x1000, 0xba70b88b, 1 }, // 0 maincpu - { "c_5ct_gp.bin", 0x1000, 0x45af403e, 1 }, // 1 - { "c_5bt_gp.bin", 0x1000, 0x3a9783b7, 1 }, // 2 - { "c_5at_gp.bin", 0x1000, 0x32bc20ff, 1 }, // 3 - - { "s_3i_b.bin", 0x0800, 0x45a4ed06, 2 }, // 4 soundcpu - { "s_3j_b.bin", 0x0800, 0x4743fe92, 2 }, // 5 - - { "v_5h_bp.bin", 0x0800, 0x007aa348, 3 }, // 6 gfx1 - { "v_3ptp.bin", 0x0800, 0xa967aff0, 3 }, // 7 - - { "l_4m_bp.bin", 0x0800, 0x766ae006, 4 }, // 8 gfx2 - { "l_4n_bp.bin", 0x0800, 0x39e7ca4b, 4 }, // 9 - { "l_4r_bp.bin", 0x0800, 0x012f2f25, 4 }, // 10 - { "l_4s_bp.bin", 0x0800, 0x84eb5bfb, 4 }, // 11 - - { "c-2k.bpr", 0x0100, 0xe273ede5, 5 }, // 12 proms - { "c-2j.bpr", 0x0100, 0xd6412358, 5 }, // 13 - { "v-5e.bpr", 0x0100, 0xb869b8f5, 5 }, // 14 -}; - -STD_ROM_PICK(dkongpe) -STD_ROM_FN(dkongpe) - -struct BurnDriver BurnDrvDkongpe = { - "dkongpe", "dkong", NULL, "dkong", "2013", - "Donkey Kong - Pauline Edition (hack, rev 5)\0", NULL, "hack (Clay Cowgill)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongpeRomInfo, dkongpeRomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, DkongfDIPInfo, - dkongInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong - Arcade Rainbow (hack) -// 6-29-2015 John Kowalski - -static struct BurnRomInfo dkrainbowRomDesc[] = { - { "c_5et_g.bin", 0x1000, 0xba70b88b, 1 }, // 0 maincpu - { "c_5ct_g.bin", 0x1000, 0x5ec461ec, 1 }, // 1 - { "c_5bt_g.bin", 0x1000, 0x1c97d324, 1 }, // 2 - { "c_5at_g.bin", 0x1000, 0xb9005ac0, 1 }, // 3 - - { "s_3i_b.bin", 0x0800, 0x45a4ed06, 2 }, // 4 soundcpu - { "s_3j_b.bin", 0x0800, 0x4743fe92, 2 }, // 5 - - { "v_5h_b.bin", 0x0800, 0x12c8c95d, 3 }, // 6 gfx1 - { "v_3pt.bin", 0x0800, 0x15e9c5e9, 3 }, // 7 - - { "l_4m_b.bin", 0x0800, 0x59f8054d, 4 }, // 8 gfx2 - { "l_4n_b.bin", 0x0800, 0x672e4714, 4 }, // 9 - { "l_4r_b.bin", 0x0800, 0xfeaa59ee, 4 }, // 10 - { "l_4s_b.bin", 0x0800, 0x20f2ef7e, 4 }, // 11 - - { "dkr_c-2k.bpr", 0x0100, 0xc0dce2f5, 5 }, // 12 proms - { "dkr_c-2j.bpr", 0x0100, 0x03c3153f, 5 }, // 13 - { "dkr_v-5e.bpr", 0x0100, 0xd9f3005a, 5 }, // 14 -}; - -STD_ROM_PICK(dkrainbow) -STD_ROM_FN(dkrainbow) - -struct BurnDriver BurnDrvDkrainbow = { - "dkrainbow", "dkong", NULL, "dkong", "2015", - "Donkey Kong - Arcade Rainbow (hack)\0", NULL, "hack (john Kowalski)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkrainbowRomInfo, dkrainbowRomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, DkongfDIPInfo, - dkongInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong II - Jumpman Returns (hack, V1.2) - -static struct BurnRomInfo dkongxRomDesc[] = { - { "c_5et_g.bin", 0x01000, 0xba70b88b, 1 }, // 0 maincpu - { "c_5ct_g.bin", 0x01000, 0x5ec461ec, 1 }, // 1 - { "c_5bt_g.bin", 0x01000, 0x1c97d324, 1 }, // 2 - { "c_5at_g.bin", 0x01000, 0xb9005ac0, 1 }, // 3 - - { "d2k12.bin", 0x10000, 0x6e95ca0d, 2 }, // 4 braze - - { "s_3i_b.bin", 0x00800, 0x45a4ed06, 3 }, // 5 soundcpu - { "s_3j_b.bin", 0x00800, 0x4743fe92, 3 }, // 6 - - { "v_5h_b.bin", 0x00800, 0x12c8c95d, 4 }, // 7 gfx1 - { "v_3pt.bin", 0x00800, 0x15e9c5e9, 4 }, // 8 - - { "l_4m_b.bin", 0x00800, 0x59f8054d, 5 }, // 9 gfx2 - { "l_4n_b.bin", 0x00800, 0x672e4714, 5 }, // 10 - { "l_4r_b.bin", 0x00800, 0xfeaa59ee, 5 }, // 11 - { "l_4s_b.bin", 0x00800, 0x20f2ef7e, 5 }, // 12 - - { "c-2k.bpr", 0x00100, 0xe273ede5, 6 }, // 13 proms - { "c-2j.bpr", 0x00100, 0xd6412358, 6 }, // 14 - { "v-5e.bpr", 0x00100, 0xb869b8f5, 6 }, // 15 -}; - -STD_ROM_PICK(dkongx) -STD_ROM_FN(dkongx) - -static INT32 dkongxRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM + 0x00000, 4, 1)) return 1; // "braze" - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 5, 1)) return 1; - memcpy (DrvSndROM0 + 0x0800, DrvSndROM0 + 0x0000, 0x0800); // re-load - if (BurnLoadRom(DrvSndROM0 + 0x01000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 15, 1)) return 1; - - braze_decrypt_rom(); - - return 0; -} - -static INT32 dkongxInit() -{ - INT32 ret = DrvInit(dkongxRomLoad, dkongPaletteInit, 0); - - if (ret == 0) - { - ZetOpen(0); - ZetSetWriteHandler(braze_main_write); - ZetSetReadHandler(braze_main_read); - braze_bankswitch(0); - ZetClose(); - } - - return ret; -} - -struct BurnDriver BurnDrvDkongx = { - "dkongx", "dkong", NULL, "dkong", "2006", - "Donkey Kong II - Jumpman Returns (hack, V1.2)\0", NULL, "hack (Braze Technologies)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongxRomInfo, dkongxRomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, NULL, - dkongxInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong II - Jumpman Returns (hack, V1.1) - -static struct BurnRomInfo dkongx11RomDesc[] = { - { "c_5et_g.bin", 0x01000, 0xba70b88b, 1 }, // 0 maincpu - { "c_5ct_g.bin", 0x01000, 0x5ec461ec, 1 }, // 1 - { "c_5bt_g.bin", 0x01000, 0x1c97d324, 1 }, // 2 - { "c_5at_g.bin", 0x01000, 0xb9005ac0, 1 }, // 3 - - { "d2k11.bin", 0x10000, 0x2048fc42, 2 }, // 4 braze - - { "s_3i_b.bin", 0x00800, 0x45a4ed06, 3 }, // 5 soundcpu - { "s_3j_b.bin", 0x00800, 0x4743fe92, 3 }, // 6 - - { "v_5h_b.bin", 0x00800, 0x12c8c95d, 4 }, // 7 gfx1 - { "v_3pt.bin", 0x00800, 0x15e9c5e9, 4 }, // 8 - - { "l_4m_b.bin", 0x00800, 0x59f8054d, 5 }, // 9 gfx2 - { "l_4n_b.bin", 0x00800, 0x672e4714, 5 }, // 10 - { "l_4r_b.bin", 0x00800, 0xfeaa59ee, 5 }, // 11 - { "l_4s_b.bin", 0x00800, 0x20f2ef7e, 5 }, // 12 - - { "c-2k.bpr", 0x00100, 0xe273ede5, 6 }, // 13 proms - { "c-2j.bpr", 0x00100, 0xd6412358, 6 }, // 14 - { "v-5e.bpr", 0x00100, 0xb869b8f5, 6 }, // 15 -}; - -STD_ROM_PICK(dkongx11) -STD_ROM_FN(dkongx11) - -struct BurnDriver BurnDrvDkongx11 = { - "dkongx11", "dkong", NULL, "dkong", "2006", - "Donkey Kong II - Jumpman Returns (hack, V1.1)\0", NULL, "hack (Braze Technologies)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongx11RomInfo, dkongx11RomName, DkongSampleInfo, DkongSampleName, DkongInputInfo, NULL, - dkongxInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong Junior (US set F-2) - -static struct BurnRomInfo dkongjrRomDesc[] = { - { "djr1-c_5b_f-2.5b", 0x2000, 0xdea28158, 1 }, // 0 maincpu - { "djr1-c_5c_f-2.5c", 0x2000, 0x6fb5faf6, 1 }, // 1 - { "djr1-c_5e_f-2.5e", 0x2000, 0xd042b6a8, 1 }, // 2 - - { "djr1-c_3h.3h", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "djr1-v.3n", 0x1000, 0x8d51aca9, 3 }, // 4 gfx1 - { "djr1-v.3p", 0x1000, 0x4ef64ba5, 3 }, // 5 - - { "djr1-v_7c.7c", 0x0800, 0xdc7f4164, 4 }, // 6 gfx2 - { "djr1-v_7d.7d", 0x0800, 0x0ce7dcf6, 4 }, // 7 - { "djr1-v_7e.7e", 0x0800, 0x24d1ff17, 4 }, // 8 - { "djr1-v_7f.7f", 0x0800, 0x0f8c083f, 4 }, // 9 - - { "djr1-c-2e.2e", 0x0100, 0x463dc7ad, 5 }, // 10 proms - { "djr1-c-2f.2f", 0x0100, 0x47ba0042, 5 }, // 11 - { "djr1-v-2n.2n", 0x0100, 0xdbf185bf, 5 }, // 12 -}; - -STD_ROM_PICK(dkongjr) -STD_ROM_FN(dkongjr) - -static struct BurnSampleInfo DkongjrSampleDesc[] = { -#if !defined (ROM_VERIFY) - { "jump", SAMPLE_NOLOOP }, - { "land", SAMPLE_NOLOOP }, - { "roar", SAMPLE_NOLOOP }, - { "climb0", SAMPLE_NOLOOP }, - { "climb1", SAMPLE_NOLOOP }, - { "climb2", SAMPLE_NOLOOP }, - { "death", SAMPLE_NOLOOP }, - { "drop", SAMPLE_NOLOOP }, - { "walk0", SAMPLE_NOLOOP }, - { "walk1", SAMPLE_NOLOOP }, - { "walk2", SAMPLE_NOLOOP }, - { "snapjaw", SAMPLE_NOLOOP }, -#endif - { "", 0 } -}; - -STD_SAMPLE_PICK(Dkongjr) -STD_SAMPLE_FN(Dkongjr) - -static INT32 dkongjrRomLoad() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - - if (BurnLoadRom(tmp, 0, 1)) return 1; - - memcpy (DrvZ80ROM + 0x0000, tmp + 0x0000, 0x1000); - memcpy (DrvZ80ROM + 0x3000, tmp + 0x1000, 0x1000); - - if (BurnLoadRom(tmp, 1, 1)) return 1; - - memcpy (DrvZ80ROM + 0x2000, tmp + 0x0000, 0x0800); - memcpy (DrvZ80ROM + 0x4800, tmp + 0x0800, 0x0800); - memcpy (DrvZ80ROM + 0x1000, tmp + 0x1000, 0x0800); - memcpy (DrvZ80ROM + 0x5800, tmp + 0x1800, 0x0800); - - if (BurnLoadRom(tmp, 2, 1)) return 1; - - memcpy (DrvZ80ROM + 0x4000, tmp + 0x0000, 0x0800); - memcpy (DrvZ80ROM + 0x2800, tmp + 0x0800, 0x0800); - memcpy (DrvZ80ROM + 0x5000, tmp + 0x1000, 0x0800); - memcpy (DrvZ80ROM + 0x1800, tmp + 0x1800, 0x0800); - - BurnFree (tmp); - - if (BurnLoadRom(DrvSndROM0 + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 12, 1)) return 1; - - ZetOpen(0); - ZetSetWriteHandler(dkongjr_main_write); - ZetClose(); - - return 0; -} - -static void dkongjrsamplevol(INT32 sam, double vol) -{ - BurnSampleSetRoute(sam, BURN_SND_SAMPLE_ROUTE_1, vol, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(sam, BURN_SND_SAMPLE_ROUTE_2, vol, BURN_SND_ROUTE_BOTH); -} - -static INT32 dkongjrInit() -{ - INT32 rc = DrvInit(dkongjrRomLoad, dkongPaletteInit, 0); - if (!rc) { - dkongjrsamplevol(1, 0.35); // land - dkongjrsamplevol(2, 0.35); // roar - dkongjrsamplevol(3, 0.25); // climb - dkongjrsamplevol(4, 0.25); - dkongjrsamplevol(5, 0.25); - dkongjrsamplevol(6, 0.25); // death - dkongjrsamplevol(7, 0.35); // fall - dkongjrsamplevol(8, 0.20); // walk - dkongjrsamplevol(9, 0.20); - dkongjrsamplevol(10, 0.20); - } - return rc; -} - -struct BurnDriver BurnDrvDkongjr = { - "dkongjr", NULL, NULL, "dkongjr", "1982", - "Donkey Kong Junior (US set F-2)\0", NULL, "Nintendo of America", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongjrRomInfo, dkongjrRomName, DkongjrSampleInfo, DkongjrSampleName, DkongInputInfo, DkongDIPInfo, - dkongjrInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong Jr. (Japan) - -static struct BurnRomInfo dkongjrjRomDesc[] = { - { "c_5ba.bin", 0x2000, 0x50a015ce, 1 }, // 0 maincpu - { "c_5ca.bin", 0x2000, 0xc0a18f0d, 1 }, // 1 - { "c_5ea.bin", 0x2000, 0xa81dd00c, 1 }, // 2 - - { "c_3h.bin", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "v_3na.bin", 0x1000, 0xa95c4c63, 3 }, // 4 gfx1 - { "v_3pa.bin", 0x1000, 0x4974ffef, 3 }, // 5 - - { "v_7c.bin", 0x0800, 0xdc7f4164, 4 }, // 6 gfx2 - { "v_7d.bin", 0x0800, 0x0ce7dcf6, 4 }, // 7 - { "v_7e.bin", 0x0800, 0x24d1ff17, 4 }, // 8 - { "v_7f.bin", 0x0800, 0x0f8c083f, 4 }, // 9 - - { "c-2e.bpr", 0x0100, 0x463dc7ad, 5 }, // 10 proms - { "c-2f.bpr", 0x0100, 0x47ba0042, 5 }, // 11 - { "v-2n.bpr", 0x0100, 0xdbf185bf, 5 }, // 12 -}; - -STD_ROM_PICK(dkongjrj) -STD_ROM_FN(dkongjrj) - -struct BurnDriver BurnDrvDkongjrj = { - "dkongjrj", "dkongjr", NULL, "dkongjr", "1982", - "Donkey Kong Jr. (Japan)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongjrjRomInfo, dkongjrjRomName, DkongjrSampleInfo, DkongjrSampleName, DkongInputInfo, DkongDIPInfo, - dkongjrInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong Junior (Japan?) - -static struct BurnRomInfo dkongjnrjRomDesc[] = { - { "dkjp.5b", 0x2000, 0x7b48870b, 1 }, // 0 maincpu - { "dkjp.5c", 0x2000, 0x12391665, 1 }, // 1 - { "dkjp.5e", 0x2000, 0x6c9f9103, 1 }, // 2 - - { "c_3h.bin", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "dkj.3n", 0x1000, 0x8d51aca9, 3 }, // 4 gfx1 - { "dkj.3p", 0x1000, 0x4ef64ba5, 3 }, // 5 - - { "v_7c.bin", 0x0800, 0xdc7f4164, 4 }, // 6 gfx2 - { "v_7d.bin", 0x0800, 0x0ce7dcf6, 4 }, // 7 - { "v_7e.bin", 0x0800, 0x24d1ff17, 4 }, // 8 - { "v_7f.bin", 0x0800, 0x0f8c083f, 4 }, // 9 - - { "c-2e.bpr", 0x0100, 0x463dc7ad, 5 }, // 10 proms - { "c-2f.bpr", 0x0100, 0x47ba0042, 5 }, // 11 - { "v-2n.bpr", 0x0100, 0xdbf185bf, 5 }, // 12 -}; - -STD_ROM_PICK(dkongjnrj) -STD_ROM_FN(dkongjnrj) - -struct BurnDriver BurnDrvDkongjnrj = { - "dkongjnrj", "dkongjr", NULL, "dkongjr", "1982", - "Donkey Kong Junior (Japan?)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongjnrjRomInfo, dkongjnrjRomName, DkongjrSampleInfo, DkongjrSampleName, DkongInputInfo, DkongDIPInfo, - dkongjrInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong Jr. (bootleg) - -static struct BurnRomInfo dkongjrbRomDesc[] = { - { "dkjr1", 0x2000, 0xec7e097f, 1 }, // 0 maincpu - { "c_5ca.bin", 0x2000, 0xc0a18f0d, 1 }, // 1 - { "c_5ea.bin", 0x2000, 0xa81dd00c, 1 }, // 2 - - { "c_3h.bin", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "v_3na.bin", 0x1000, 0xa95c4c63, 3 }, // 4 gfx1 - { "dkjr10", 0x1000, 0xadc11322, 3 }, // 5 - - { "v_7c.bin", 0x0800, 0xdc7f4164, 4 }, // 6 gfx2 - { "v_7d.bin", 0x0800, 0x0ce7dcf6, 4 }, // 7 - { "v_7e.bin", 0x0800, 0x24d1ff17, 4 }, // 8 - { "v_7f.bin", 0x0800, 0x0f8c083f, 4 }, // 9 - - { "c-2e.bpr", 0x0100, 0x463dc7ad, 5 }, // 10 proms - { "c-2f.bpr", 0x0100, 0x47ba0042, 5 }, // 11 - { "v-2n.bpr", 0x0100, 0xdbf185bf, 5 }, // 12 -}; - -STD_ROM_PICK(dkongjrb) -STD_ROM_FN(dkongjrb) - -struct BurnDriver BurnDrvDkongjrb = { - "dkongjrb", "dkongjr", NULL, "dkongjr", "1982", - "Donkey Kong Jr. (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongjrbRomInfo, dkongjrbRomName, DkongjrSampleInfo, DkongjrSampleName, DkongInputInfo, DkongDIPInfo, - dkongjrInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Junior King (bootleg of Donkey Kong Jr.) - -static struct BurnRomInfo jrkingRomDesc[] = { - { "b5.bin", 0x2000, 0xec7e097f, 1 }, // 0 maincpu - { "c5.bin", 0x2000, 0xc0a18f0d, 1 }, // 1 - { "e5.bin", 0x2000, 0xa81dd00c, 1 }, // 2 - - { "h3.bin", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "n3.bin", 0x1000, 0x7110715d, 3 }, // 4 gfx1 - { "p3.bin", 0x1000, 0x46476016, 3 }, // 5 - - { "c7.bin", 0x1000, 0x9f531527, 4 }, // 6 gfx2 - { "d7.bin", 0x1000, 0x32fbd41b, 4 }, // 7 - { "e7.bin", 0x1000, 0x2286bf8e, 4 }, // 8 - { "f7.bin", 0x1000, 0x627007a0, 4 }, // 9 - - { "c-2e.bpr", 0x0100, 0x463dc7ad, 5 }, // 10 proms - { "c-2f.bpr", 0x0100, 0x47ba0042, 5 }, // 11 - { "v-2n.bpr", 0x0100, 0xdbf185bf, 5 }, // 12 -}; - -STD_ROM_PICK(jrking) -STD_ROM_FN(jrking) - -struct BurnDriver BurnDrvJrking = { - "jrking", "dkongjr", NULL, "dkongjr", "1982", - "Junior King (bootleg of Donkey Kong Jr.)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, jrkingRomInfo, jrkingRomName, DkongjrSampleInfo, DkongjrSampleName, DkongInputInfo, DkongDIPInfo, - dkongjrInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey King Jr. (bootleg of Donkey Kong Jr.) - -static struct BurnRomInfo dkingjrRomDesc[] = { - { "1.7g", 0x2000, 0xbd07bb8d, 1 }, // 0 maincpu - { "2.7h", 0x2000, 0x01fbec11, 1 }, // 1 - { "3.7k", 0x2000, 0xa81dd00c, 1 }, // 2 - - { "4.7l", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "5.6g", 0x1000, 0xcf14669d, 3 }, // 4 gfx1 - { "6.6e", 0x1000, 0xcefed15e, 3 }, // 5 - - { "7.2t", 0x0800, 0xdc7f4164, 4 }, // 6 gfx2 - { "8.2r", 0x0800, 0x0ce7dcf6, 4 }, // 7 - { "9.2p", 0x0800, 0x24d1ff17, 4 }, // 8 - { "10.2m", 0x0800, 0x0f8c083f, 4 }, // 9 - - { "mb7052.9k", 0x0100, 0x49f2d444, 5 }, // 10 proms - { "mb7052.9l", 0x0100, 0x487513ab, 5 }, // 11 - { "mb7052.6b", 0x0100, 0xdbf185bf, 5 }, // 12 - - { "mb7051.8j", 0x0020, 0xa5a6f2ca, 5 }, // 13 -}; - -STD_ROM_PICK(dkingjr) -STD_ROM_FN(dkingjr) - -static INT32 dkingjrRomLoad() -{ - INT32 ret = dkongjrRomLoad(); - - for (INT32 i = 0; i < 0x200; i++) { - DrvColPROM[i] ^= 0xff; - } - - return ret; -} - -static INT32 dkingjrInit() -{ - return DrvInit(dkingjrRomLoad, dkongPaletteInit, 0); -} - -struct BurnDriver BurnDrvDkingjr = { - "dkingjr", "dkongjr", NULL, "dkongjr", "1982", - "Donkey King Jr. (bootleg of Donkey Kong Jr.)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkingjrRomInfo, dkingjrRomName, DkongjrSampleInfo, DkongjrSampleName, DkongInputInfo, DkongDIPInfo, - dkingjrInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong Junior (E Kit) - -static struct BurnRomInfo dkongjreRomDesc[] = { - { "djr1-c.5b", 0x2000, 0xffe9e1a5, 1 }, // 0 maincpu - { "djr1-c.5c", 0x2000, 0x982e30e8, 1 }, // 1 - { "djr1-c.5e", 0x2000, 0x24c3d325, 1 }, // 2 - - { "c_3h.bin", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "dkj.3n", 0x1000, 0x8d51aca9, 3 }, // 4 gfx1 - { "dkj.3p", 0x1000, 0x4ef64ba5, 3 }, // 5 - - { "v_7c.bin", 0x0800, 0xdc7f4164, 4 }, // 6 gfx2 - { "v_7d.bin", 0x0800, 0x0ce7dcf6, 4 }, // 7 - { "v_7e.bin", 0x0800, 0x24d1ff17, 4 }, // 8 - { "v_7f.bin", 0x0800, 0x0f8c083f, 4 }, // 9 - - { "c-2e.bpr", 0x0100, 0x463dc7ad, 5 }, // 10 proms - { "c-2f.bpr", 0x0100, 0x47ba0042, 5 }, // 11 - { "v-2n.bpr", 0x0100, 0xdbf185bf, 5 }, // 12 - - { "djr1-c.5a", 0x1000, 0xbb5f5180, 1 }, // 13 extra cpu rom -}; - -STD_ROM_PICK(dkongjre) -STD_ROM_FN(dkongjre) - -static INT32 dkongjreRomLoad() -{ - INT32 ret = dkongjrRomLoad(); - - if (BurnLoadRom(DrvZ80ROM + 0x8000, 13, 1)) return 1; - - return ret; -} - -static INT32 dkongjreInit() -{ - return DrvInit(dkongjreRomLoad, dkongPaletteInit, 0); -} - -struct BurnDriverD BurnDrvDkongjre = { - "dkongjre", "dkongjr", NULL, "dkongjr", "1982", - "Donkey Kong Junior (E Kit)\0", NULL, "Nintendo of America", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongjreRomInfo, dkongjreRomName, DkongjrSampleInfo, DkongjrSampleName, DkongInputInfo, DkongDIPInfo, - dkongjreInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong Junior (P Kit, bootleg) - -static struct BurnRomInfo dkongjrpbRomDesc[] = { - { "dkjr1-c.5b-p", 0x2000, 0x8d99b3e0, 1 }, // 0 maincpu - { "dkjr1-c.5c-p", 0x2000, 0xb92d258c, 1 }, // 1 - { "dkjr1-c.5e", 0x2000, 0xd042b6a8, 1 }, // 2 - - { "c_3h.bin", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "dkj.3n", 0x1000, 0x8d51aca9, 3 }, // 4 gfx1 - { "dkj.3p", 0x1000, 0x4ef64ba5, 3 }, // 5 - - { "v_7c.bin", 0x0800, 0xdc7f4164, 4 }, // 6 gfx2 - { "v_7d.bin", 0x0800, 0x0ce7dcf6, 4 }, // 7 - { "v_7e.bin", 0x0800, 0x24d1ff17, 4 }, // 8 - { "v_7f.bin", 0x0800, 0x0f8c083f, 4 }, // 9 - - { "c-2e.bpr", 0x0100, 0x463dc7ad, 5 }, // 10 proms - { "c-2f.bpr", 0x0100, 0x47ba0042, 5 }, // 11 - { "v-2n.bpr", 0x0100, 0xdbf185bf, 5 }, // 12 -}; - -STD_ROM_PICK(dkongjrpb) -STD_ROM_FN(dkongjrpb) - -struct BurnDriverD BurnDrvDkongjrpb = { - "dkongjrpb", "dkongjr", NULL, "dkongjr", "1982", - "Donkey Kong Junior (P kit, bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkongjrpbRomInfo, dkongjrpbRomName, DkongjrSampleInfo, DkongjrSampleName, DkongInputInfo, DkongDIPInfo, - dkongjrInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Pest Place - -static struct BurnRomInfo pestplceRomDesc[] = { - { "pest.1p", 0x2000, 0x80d50721, 1 }, // 0 maincpu - { "pest.2p", 0x2000, 0x9c3681cc, 1 }, // 1 - { "pest.3p", 0x2000, 0x49853922, 1 }, // 2 - - { "pest.4", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "pest.o", 0x1000, 0x03939ece, 3 }, // 4 gfx1 - { "pest.k", 0x1000, 0x2acacedf, 3 }, // 5 - - { "pest.b", 0x1000, 0xe760073e, 4 }, // 6 gfx2 - { "pest.a", 0x1000, 0x1958346e, 4 }, // 7 - { "pest.d", 0x1000, 0x3a993c17, 4 }, // 8 - { "pest.c", 0x1000, 0xbf08f2a3, 4 }, // 9 - - { "n82s129a.bin", 0x0100, 0x0330f35f, 5 }, // 10 proms - { "n82s129b.bin", 0x0100, 0xba88311b, 5 }, // 11 - { "sn74s288n.bin", 0x0020, 0xa5a6f2ca, 5 }, // 12 - - { "pest.0", 0x1000, 0x28952b56, 1 }, // 13 -}; - -STD_ROM_PICK(pestplce) -STD_ROM_FN(pestplce) - -static INT32 pestplceRomLoad() -{ - INT32 ret = dkongjrRomLoad(); - - if (BurnLoadRom(DrvZ80ROM + 0xb000, 13, 1)) return 1; - - for (INT32 i = 0; i < 0x300; i++) { // invert colors - DrvColPROM[i] ^= 0xff; - } - - return ret; -} - -static INT32 pestplceInit() -{ - return DrvInit(pestplceRomLoad, dkongPaletteInit, 1); -} - -struct BurnDriver BurnDrvPestplce = { - "pestplce", "mario", NULL, NULL, "1983", - "Pest Place\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, pestplceRomInfo, pestplceRomName, NULL, NULL, PestplceInputInfo, PestplceDIPInfo, - pestplceInit, DrvExit, DrvFrame, pestplceDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Donkey Kong 3 (US) - -static struct BurnRomInfo dkong3RomDesc[] = { - { "dk3c.7b", 0x2000, 0x38d5f38e, 1 }, // 0 maincpu - { "dk3c.7c", 0x2000, 0xc9134379, 1 }, // 1 - { "dk3c.7d", 0x2000, 0xd22e2921, 1 }, // 2 - { "dk3c.7e", 0x2000, 0x615f14b7, 1 }, // 3 - - { "dk3c.5l", 0x2000, 0x7ff88885, 2 }, // 4 n2a03a - - { "dk3c.6h", 0x2000, 0x36d7200c, 3 }, // 5 n2a03b - - { "dk3v.3n", 0x1000, 0x415a99c7, 4 }, // 6 gfx1 - { "dk3v.3p", 0x1000, 0x25744ea0, 4 }, // 7 - - { "dk3v.7c", 0x1000, 0x8ffa1737, 5 }, // 8 gfx2 - { "dk3v.7d", 0x1000, 0x9ac84686, 5 }, // 9 - { "dk3v.7e", 0x1000, 0x0c0af3fb, 5 }, // 10 - { "dk3v.7f", 0x1000, 0x55c58662, 5 }, // 11 - - { "dkc1-c.1d", 0x0200, 0xdf54befc, 6 }, // 12 proms - { "dkc1-c.1c", 0x0200, 0x66a77f40, 6 }, // 13 - { "dkc1-v.2n", 0x0100, 0x50e33434, 6 }, // 14 - - { "dkc1-v.5e", 0x0020, 0xd3e2eaf8, 7 }, // 15 adrdecode -}; - -STD_ROM_PICK(dkong3) -STD_ROM_FN(dkong3) - -struct BurnDriver BurnDrvDkong3 = { - "dkong3", NULL, NULL, NULL, "1983", - "Donkey Kong 3 (US)\0", NULL, "Nintendo of America", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkong3RomInfo, dkong3RomName, NULL, NULL, Dkong3InputInfo, Dkong3DIPInfo, - Dkong3Init, Dkong3Exit, Dkong3Frame, dkongDraw, Dkong3Scan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong 3 (Japan) - -static struct BurnRomInfo dkong3jRomDesc[] = { - { "dk3c.7b", 0x2000, 0x38d5f38e, 1 }, // 0 maincpu - { "dk3c.7c", 0x2000, 0xc9134379, 1 }, // 1 - { "dk3c.7d", 0x2000, 0xd22e2921, 1 }, // 2 - { "dk3cj.7e", 0x2000, 0x25b5be23, 1 }, // 3 - - { "dk3c.5l", 0x2000, 0x7ff88885, 2 }, // 4 n2a03a - - { "dk3c.6h", 0x2000, 0x36d7200c, 3 }, // 5 n2a03b - - { "dk3v.3n", 0x1000, 0x415a99c7, 4 }, // 6 gfx1 - { "dk3v.3p", 0x1000, 0x25744ea0, 4 }, // 7 - - { "dk3v.7c", 0x1000, 0x8ffa1737, 5 }, // 8 gfx2 - { "dk3v.7d", 0x1000, 0x9ac84686, 5 }, // 9 - { "dk3v.7e", 0x1000, 0x0c0af3fb, 5 }, // 10 - { "dk3v.7f", 0x1000, 0x55c58662, 5 }, // 11 - - { "dkc1-c.1d", 0x0200, 0xdf54befc, 6 }, // 12 proms - { "dkc1-c.1c", 0x0200, 0x66a77f40, 6 }, // 13 - { "dkc1-v.2n", 0x0100, 0x50e33434, 6 }, // 14 - - { "dkc1-v.5e", 0x0020, 0xd3e2eaf8, 7 }, // 15 adrdecode -}; - -STD_ROM_PICK(dkong3j) -STD_ROM_FN(dkong3j) - -struct BurnDriver BurnDrvDkong3j = { - "dkong3j", "dkong3", NULL, NULL, "1983", - "Donkey Kong 3 (Japan)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkong3jRomInfo, dkong3jRomName, NULL, NULL, Dkong3InputInfo, Dkong3DIPInfo, - Dkong3Init, Dkong3Exit, Dkong3Frame, dkongDraw, Dkong3Scan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Donkey Kong 3 (bootleg on Donkey Kong Jr. hardware) - -static struct BurnRomInfo dkong3bRomDesc[] = { - { "5b.bin", 0x2000, 0x549979bc, 1 }, // 0 maincpu - { "5c-2.bin", 0x2000, 0xb9dcbae6, 1 }, // 1 - { "5e-2.bin", 0x2000, 0x5a61868f, 1 }, // 2 - - { "3h.bin", 0x1000, 0x715da5f8, 2 }, // 3 soundcpu - - { "3n.bin", 0x1000, 0xfed67d35, 3 }, // 4 gfx1 - { "3p.bin", 0x1000, 0x3d1b87ce, 3 }, // 5 - - { "7c.bin", 0x1000, 0x8ffa1737, 4 }, // 6 gfx2 - { "7d.bin", 0x1000, 0x9ac84686, 4 }, // 7 - { "7e.bin", 0x1000, 0x0c0af3fb, 4 }, // 8 - { "7f.bin", 0x1000, 0x55c58662, 4 }, // 9 - - { "dk3b-c.1d", 0x0200, 0xdf54befc, 5 }, // 10 proms - { "dk3b-c.1c", 0x0200, 0x66a77f40, 5 }, // 11 - { "dk3b-v.2n", 0x0100, 0x50e33434, 5 }, // 12 - - { "5c-1.bin", 0x1000, 0x77a012d6, 1 }, // 13 - { "5e-1.bin", 0x1000, 0x745ed767, 1 }, // 14 -}; - -STD_ROM_PICK(dkong3b) -STD_ROM_FN(dkong3b) - -static INT32 dkong3bRomLoad() -{ - INT32 ret = dkongjrRomLoad(); - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 9, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x9000, 13, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0xd000, 14, 1)) return 1; - - return ret; -} - -static INT32 dkong3bInit() -{ - return DrvInit(dkong3bRomLoad, dkong3PaletteInit, 1); -} - -struct BurnDriver BurnDrvDkong3b = { - "dkong3b", "dkong3", NULL, NULL, "1984", - "Donkey Kong 3 (bootleg on Donkey Kong Jr. hardware)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, dkong3bRomInfo, dkong3bRomName, NULL, NULL, DkongInputInfo, Dkong3bDIPInfo, - dkong3bInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - - - -// Herbie at the Olympics (DK conversion) - -static struct BurnRomInfo herbiedkRomDesc[] = { - { "5f.cpu", 0x1000, 0xc7ab3ac6, 1 }, // 0 maincpu - { "5g.cpu", 0x1000, 0xd1031aa6, 1 }, // 1 - { "5h.cpu", 0x1000, 0xc0daf551, 1 }, // 2 - { "5k.cpu", 0x1000, 0x67442242, 1 }, // 3 - - { "3i.snd", 0x0800, 0x20e30406, 2 }, // 4 soundcpu - - { "5h.vid", 0x0800, 0xea2a2547, 3 }, // 5 gfx1 - { "5k.vid", 0x0800, 0xa8d421c9, 3 }, // 6 - - { "7c.clk", 0x0800, 0xaf646166, 4 }, // 7 gfx2 - { "7d.clk", 0x0800, 0xd8e15832, 4 }, // 8 - { "7e.clk", 0x0800, 0x2f7e65fa, 4 }, // 9 - { "7f.clk", 0x0800, 0xad32d5ae, 4 }, // 10 - - { "74s287.2k", 0x0100, 0x7dc0a381, 5 }, // 11 proms - { "74s287.2j", 0x0100, 0x0a440c00, 5 }, // 12 - { "74s287.vid", 0x0100, 0x5a3446cc, 5 }, // 13 - - { "82s147.hh", 0x0200, 0x46e5bc92, 6 }, // 14 user1 - - { "pls153h.bin", 0x00eb, 0xd6a04bcc, 7 }, // 15 plds -}; - -STD_ROM_PICK(herbiedk) -STD_ROM_FN(herbiedk) - -static INT32 herbiedkRomLoad() -{ - if (BurnLoadRom(Drv2650ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(Drv2650ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(Drv2650ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(Drv2650ROM + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x0000, 4, 1)) return 1; - memcpy (DrvSndROM0 + 0x0800, DrvSndROM0 + 0x0000, 0x0800); // re-load - memset (DrvSndROM0 + 0x1000, 0xff, 0x0800); - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 13, 1)) return 1; - - if (BurnLoadRom(DrvMapROM + 0x0000, 14, 1)) return 1; - - return 0; -} - -static INT32 herbiedkInit() -{ - s2650_protection = 1; - return s2650DkongInit(herbiedkRomLoad); -} - -struct BurnDriver BurnDrvHerbiedk = { - "herbiedk", "huncholy", NULL, NULL, "1984", - "Herbie at the Olympics (DK conversion)\0", "No sound", "Century Electronics / Seatongrove Ltd", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, herbiedkRomInfo, herbiedkRomName, NULL, NULL, DkongInputInfo, HerbiedkDIPInfo, - herbiedkInit, s2650DkongExit, s2650DkongFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Hunchback (DK conversion) - -static struct BurnRomInfo hunchbkdRomDesc[] = { - { "hb.5e", 0x1000, 0x4c3ac070, 1 }, // 0 maincpu - { "hbsc-1.5c", 0x1000, 0x9b0e6234, 1 }, // 1 - { "hb.5b", 0x1000, 0x4cde80f3, 1 }, // 2 - { "hb.5a", 0x1000, 0xd60ef5b2, 1 }, // 3 - - { "hb.3h", 0x0800, 0xa3c240d4, 2 }, // 4 soundcpu - - { "hb.3n", 0x0800, 0x443ed5ac, 3 }, // 5 gfx1 - { "hb.3p", 0x0800, 0x073e7b0c, 3 }, // 6 - - { "hb.7c", 0x0800, 0x3ba71686, 4 }, // 7 gfx2 - { "hb.7d", 0x0800, 0x5786948d, 4 }, // 8 - { "hb.7e", 0x0800, 0xf845e8ca, 4 }, // 9 - { "hb.7f", 0x0800, 0x52d20fea, 4 }, // 10 - - { "hbprom.2e", 0x0100, 0x37aab98f, 5 }, // 11 proms - { "hbprom.2f", 0x0100, 0x845b8dcc, 5 }, // 12 - { "hbprom.2n", 0x0100, 0xdff9070a, 5 }, // 13 - - { "82s147.prm", 0x0200, 0x46e5bc92, 6 }, // 14 user1 - - { "pls153h.bin", 0x00eb, 0x00000000, 7 | BRF_NODUMP }, // 15 plds -}; - -STD_ROM_PICK(hunchbkd) -STD_ROM_FN(hunchbkd) - -static INT32 hunchbkdInit() -{ - s2650_protection = 2; - return s2650DkongInit(herbiedkRomLoad); -} - -struct BurnDriverD BurnDrvHunchbkd = { - "hunchbkd", "hunchbak", NULL, NULL, "1983", - "Hunchback (DK conversion)\0", "No sound", "Century Electronics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, hunchbkdRomInfo, hunchbkdRomName, NULL, NULL, DkongInputInfo, HunchbkdDIPInfo, - hunchbkdInit, s2650DkongExit, s2650DkongFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - -/* - -// Super Bike (DK conversion) - -static struct BurnRomInfo sbdkRomDesc[] = { - { "sb-dk.ap", 0x1000, 0xfef0ef9c, 1 }, // 0 maincpu - { "sb-dk.ay", 0x1000, 0x2e9dade2, 1 }, // 1 - { "sb-dk.as", 0x1000, 0xe6d200f3, 1 }, // 2 - { "sb-dk.5a", 0x1000, 0xca41ca56, 1 }, // 3 - - { "sb-dk.3h", 0x0800, 0x13e60b6e, 2 }, // 4 soundcpu - - { "sb-dk.3n", 0x0800, 0xb1d76b59, 3 }, // 5 gfx1 - { "sb-dk.3p", 0x0800, 0xea5f9f88, 3 }, // 6 - - { "sb-dk.7c", 0x0800, 0xc12c18f2, 4 }, // 7 gfx2 - { "sb-dk.7d", 0x0800, 0xf7a32d23, 4 }, // 8 - { "sb-dk.7e", 0x0800, 0x8e48b13e, 4 }, // 9 - { "sb-dk.7f", 0x0800, 0x989969f3, 4 }, // 10 - - { "sb.2e", 0x0100, 0x4f06f789, 5 }, // 11 proms - { "sb.2f", 0x0100, 0x2c15b1b2, 5 }, // 12 - { "sb.2n", 0x0100, 0xdff9070a, 5 }, // 13 - - { "82s147.prm", 0x0200, 0x46e5bc92, 6 }, // 14 user1 - - { "pls153h.bin", 0x00eb, 0x00000000, 7 | BRF_NODUMP }, // 15 plds -}; - -STD_ROM_PICK(sbdk) -STD_ROM_FN(sbdk) - -struct BurnDriverD BurnDrvSbdk = { - "sbdk", "superbik", NULL, NULL, "1984", - "Super Bike (DK conversion)\0", NULL, "Century Electronics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, sbdkRomInfo, sbdkRomName, NULL, NULL, SbdkInputInfo, SbdkDIPInfo, - hunchbkdInit, s2650DkongExit, s2650DkongFrame, dkongDraw, NULL, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; -*/ - -// Hero in the Castle of Doom (DK conversion) - -static struct BurnRomInfo herodkRomDesc[] = { - { "red-dot.rgt", 0x2000, 0x9c4af229, 1 }, // 0 maincpu - { "wht-dot.lft", 0x2000, 0xc10f9235, 1 }, // 1 - - { "silver.3h", 0x0800, 0x67863ce9, 2 }, // 2 soundcpu - - { "pnk.3n", 0x0800, 0x574dfd7a, 3 }, // 3 gfx1 - { "blk.3p", 0x0800, 0x16f7c040, 3 }, // 4 - - { "gold.7c", 0x0800, 0x5f5282ed, 4 }, // 5 gfx2 - { "orange.7d", 0x0800, 0x075d99f5, 4 }, // 6 - { "yellow.7e", 0x0800, 0xf6272e96, 4 }, // 7 - { "violet.7f", 0x0800, 0xca020685, 4 }, // 8 - - { "82s129.2e", 0x0100, 0xda4b47e6, 5 }, // 9 proms - { "82s129.2f", 0x0100, 0x96e213a4, 5 }, // 10 - { "82s126.2n", 0x0100, 0x37aece4b, 5 }, // 11 - - { "82s147.prm", 0x0200, 0x46e5bc92, 6 }, // 12 user1 - - { "pls153h.bin", 0x00eb, 0x00000000, 7 | BRF_NODUMP }, // 13 plds -}; - -STD_ROM_PICK(herodk) -STD_ROM_FN(herodk) - -static INT32 herodkRomLoad() -{ - if (BurnLoadRom(Drv2650ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(Drv2650ROM + 0x2000, 1, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x0000, 2, 1)) return 1; - memcpy (DrvSndROM0 + 0x0800, DrvSndROM0 + 0x0000, 0x0800); // re-load - memset (DrvSndROM0 + 0x1000, 0xff, 0x0800); - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 11, 1)) return 1; - - if (BurnLoadRom(DrvMapROM + 0x0000, 12, 1)) return 1; - - return 0; -} - -static INT32 herodkLoad() -{ - if (herodkRomLoad()) return 1; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - - memcpy (tmp, Drv2650ROM, 0x4000); - - memcpy (Drv2650ROM + 0x0c00, tmp + 0x0000, 0x0400); - memcpy (Drv2650ROM + 0x0800, tmp + 0x0400, 0x0400); - memcpy (Drv2650ROM + 0x0400, tmp + 0x0800, 0x0400); - memcpy (Drv2650ROM + 0x0000, tmp + 0x0c00, 0x0400); - memcpy (Drv2650ROM + 0x2000, tmp + 0x1000, 0x0e00); - memcpy (Drv2650ROM + 0x6e00, tmp + 0x1e00, 0x0200); - memcpy (Drv2650ROM + 0x4000, tmp + 0x2000, 0x1000); - memcpy (Drv2650ROM + 0x6000, tmp + 0x3000, 0x0e00); - memcpy (Drv2650ROM + 0x2e00, tmp + 0x3e00, 0x0200); - - BurnFree (tmp); - - for (INT32 i = 0; i < 0x8000; i++) - { - if ((i & 0x1000) == 0) - { - INT32 v = Drv2650ROM[i]; - Drv2650ROM[i] = (v & 0xe7) | ((v & 0x10) >> 1) | ((v & 0x08) << 1); - } - } - - return 0; -} - -static INT32 herodkInit() -{ - s2650_protection = 2; - - return s2650DkongInit(herodkLoad); -} - -struct BurnDriver BurnDrvHerodk = { - "herodk", "hero", NULL, NULL, "1984", - "Hero in the Castle of Doom (DK conversion)\0", "No sound", "Seatongrove Ltd (Crown license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, herodkRomInfo, herodkRomName, NULL, NULL, HerodkInputInfo, HerodkDIPInfo, - herodkInit, s2650DkongExit, s2650DkongFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Hero in the Castle of Doom (DK conversion not encrypted) - -static struct BurnRomInfo herodkuRomDesc[] = { - { "2764.8h", 0x2000, 0x989ce053, 1 }, // 0 maincpu - { "2764.8f", 0x2000, 0x835e0074, 1 }, // 1 - - { "2716.3h", 0x0800, 0xcaf57bef, 2 }, // 2 soundcpu - - { "pnk.3n", 0x0800, 0x574dfd7a, 3 }, // 3 gfx1 - { "blk.3p", 0x0800, 0x16f7c040, 3 }, // 4 - - { "gold.7c", 0x0800, 0x5f5282ed, 4 }, // 5 gfx2 - { "orange.7d", 0x0800, 0x075d99f5, 4 }, // 6 - { "yellow.7e", 0x0800, 0xf6272e96, 4 }, // 7 - { "violet.7f", 0x0800, 0xca020685, 4 }, // 8 - - { "82s129.2e", 0x0100, 0xda4b47e6, 5 }, // 9 proms - { "82s129.2f", 0x0100, 0x96e213a4, 5 }, // 10 - { "82s126.2n", 0x0100, 0x37aece4b, 5 }, // 11 - - { "82s147.prm", 0x0200, 0x46e5bc92, 6 }, // 12 user1 - - { "pls153h.bin", 0x00eb, 0x00000000, 7 | BRF_NODUMP }, // 13 plds -}; - -STD_ROM_PICK(herodku) -STD_ROM_FN(herodku) - -static INT32 herodkuLoad() -{ - if (herodkRomLoad()) return 1; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - - memcpy (tmp, Drv2650ROM, 0x4000); - - memcpy (Drv2650ROM + 0x0c00, tmp + 0x0000, 0x0400); - memcpy (Drv2650ROM + 0x0800, tmp + 0x0400, 0x0400); - memcpy (Drv2650ROM + 0x0400, tmp + 0x0800, 0x0400); - memcpy (Drv2650ROM + 0x0000, tmp + 0x0c00, 0x0400); - memcpy (Drv2650ROM + 0x2000, tmp + 0x1000, 0x1000); - memcpy (Drv2650ROM + 0x4000, tmp + 0x2000, 0x1000); - memcpy (Drv2650ROM + 0x6000, tmp + 0x3000, 0x1000); - - BurnFree (tmp); - - return 0; -} - -static INT32 herodkuInit() -{ - s2650_protection = 2; - - return s2650DkongInit(herodkuLoad); -} - -struct BurnDriver BurnDrvHerodku = { - "herodku", "hero", NULL, NULL, "1984", - "Hero in the Castle of Doom (DK conversion not encrypted)\0", NULL, "Seatongrove Ltd (Crown license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, herodkuRomInfo, herodkuRomName, NULL, NULL, HerodkInputInfo, HerodkDIPInfo, - herodkuInit, s2650DkongExit, s2650DkongFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - - -static UINT8 decrypt_counter = 0; - -static void epos_bankswitch(INT32 bank) -{ - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM + 0x10000 + (bank * 0x4000)); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM + 0x10000 + (bank * 0x4000)); -} - -UINT8 __fastcall epos_main_read_port(UINT16 port) -{ - if (port & 0x01) - { - decrypt_counter = (decrypt_counter - 1) & 0x0f; - } - else - { - decrypt_counter = (decrypt_counter + 1) & 0x0f; - } - - if (decrypt_counter >= 8 && decrypt_counter <= 0x0b) { - epos_bankswitch(decrypt_counter & 3); - } - - return 0; -} - - -static void epos_decrypt_rom(UINT8 mod, INT32 offs, INT32 *bs) -{ - UINT8 oldbyte,newbyte; - UINT8 *ROM; - INT32 mem; - - ROM = DrvZ80ROM; - - for (mem=0;mem<0x4000;mem++) - { - oldbyte = ROM[mem]; - - newbyte = (oldbyte & mod) | (~oldbyte & ~mod); - newbyte = BITSWAP08(newbyte, bs[0], bs[1], bs[2], bs[3], bs[4], bs[5], bs[6], bs[7]); - - ROM[mem + offs] = newbyte; - } -} - - -static INT32 eposRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x0000, 2, 1)) return 1; - memcpy (DrvSndROM0 + 0x0800, DrvSndROM0 + 0x0000, 0x0800); // re-load - memset (DrvSndROM0 + 0x1000, 0x00, 0x0800); - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 4, 1)) return 1; - memcpy (DrvGfxROM0 + 0x0800, DrvGfxROM0 + 0x0000, 0x0800); // re-load - memcpy (DrvGfxROM0 + 0x1800, DrvGfxROM0 + 0x1000, 0x0800); - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 11, 1)) return 1; - - return 0; -} - - - - -// Drakton (DK conversion) - -static struct BurnRomInfo draktonRomDesc[] = { - { "2764.u2", 0x2000, 0xd9a33205, 1 }, // 0 maincpu - { "2764.u3", 0x2000, 0x69583a35, 1 }, // 1 - - { "2716.3h", 0x0800, 0x3489a35b, 2 }, // 2 soundcpu - - { "2716.3n", 0x0800, 0xea0e7f9a, 3 }, // 3 gfx1 - { "2716.3p", 0x0800, 0x46f51b68, 3 }, // 4 - - { "2716.7c", 0x0800, 0x2925dc2d, 4 }, // 5 gfx2 - { "2716.7d", 0x0800, 0xbdf6b1b4, 4 }, // 6 - { "2716.7e", 0x0800, 0x4d62e62f, 4 }, // 7 - { "2716.7f", 0x0800, 0x81d200e5, 4 }, // 8 - - { "82s126.2e", 0x0100, 0x3ff45f76, 5 }, // 9 proms - { "82s126.2f", 0x0100, 0x38f905be, 5 }, // 10 - { "82s126.2n", 0x0100, 0x3c343b9b, 5 }, // 11 -}; - -STD_ROM_PICK(drakton) -STD_ROM_FN(drakton) - -static INT32 draktonLoad() -{ - INT32 bs[4][8] = { - {7,6,1,3,0,4,2,5}, - {7,1,4,3,0,6,2,5}, - {7,6,1,0,3,4,2,5}, - {7,1,4,0,3,6,2,5}, - }; - - if (eposRomLoad()) return 1; - - epos_decrypt_rom(0x02, 0x10000, bs[0]); - epos_decrypt_rom(0x40, 0x14000, bs[1]); - epos_decrypt_rom(0x8a, 0x18000, bs[2]); - epos_decrypt_rom(0xc8, 0x1c000, bs[3]); - - return 0; -} - -static INT32 draktonInit() -{ - decrypt_counter = 0x09; - - INT32 ret = DrvInit(draktonLoad, dkongPaletteInit, 0); - - if (ret == 0) - { - ZetOpen(0); - ZetSetInHandler(epos_main_read_port); - epos_bankswitch(1); - ZetReset(); // bankswitch changed vectors - ZetClose(); - } - - return ret; -} - -struct BurnDriver BurnDrvDrakton = { - "drakton", NULL, NULL, NULL, "1984", - "Drakton (DK conversion)\0", "No sound", "Epos Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, draktonRomInfo, draktonRomName, NULL, NULL, DkongInputInfo, DraktonDIPInfo, - draktonInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Drakton (DKJr conversion) - -static struct BurnRomInfo drktnjrRomDesc[] = { - { "2764.u2", 0x2000, 0xd9a33205, 1 }, // 0 maincpu - { "2764.u3", 0x2000, 0x69583a35, 1 }, // 1 - - { "2716.3h1", 0x0800, 0x2a6ec016, 2 }, // 2 soundcpu - - { "2716.3n", 0x0800, 0xea0e7f9a, 3 }, // 3 gfx1 - { "2716.3p", 0x0800, 0x46f51b68, 3 }, // 4 - - { "2716.7c", 0x0800, 0x2925dc2d, 4 }, // 5 gfx2 - { "2716.7d", 0x0800, 0xbdf6b1b4, 4 }, // 6 - { "2716.7e", 0x0800, 0x4d62e62f, 4 }, // 7 - { "2716.7f", 0x0800, 0x81d200e5, 4 }, // 8 - - { "82s126.2e", 0x0100, 0x3ff45f76, 5 }, // 9 proms - { "82s126.2f", 0x0100, 0x38f905be, 5 }, // 10 - { "82s126.2n", 0x0100, 0x3c343b9b, 5 }, // 11 -}; - -STD_ROM_PICK(drktnjr) -STD_ROM_FN(drktnjr) - -static INT32 drktnjrInit() -{ - decrypt_counter = 0x09; - - INT32 ret = DrvInit(draktonLoad, dkongPaletteInit, 0); - - if (ret == 0) - { - ZetOpen(0); - ZetSetWriteHandler(dkongjr_main_write); - ZetSetInHandler(epos_main_read_port); - epos_bankswitch(1); - ZetReset(); // bankswitch changed vectors - ZetClose(); - } - - return ret; -} - -struct BurnDriver BurnDrvDrktnjr = { - "drktnjr", "drakton", NULL, NULL, "1984", - "Drakton (DKJr conversion)\0", "No sound", "Epos Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, drktnjrRomInfo, drktnjrRomName, NULL, NULL, DkongInputInfo, DraktonDIPInfo, - drktnjrInit, DrvExit, DrvFrame, dkongDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_docastle.cpp b/jan/src/burn/drv/pre90s/d_docastle.cpp deleted file mode 100644 index fa641abe4..000000000 --- a/jan/src/burn/drv/pre90s/d_docastle.cpp +++ /dev/null @@ -1,1227 +0,0 @@ -// Mr. Do's Castle emu-layer for FB Alpha by dink, based on the MAME driver by Brad Oliver. -// -// Todo: -// fix DrvDip[0] -// figure out why CPU_IRQSTATUS_HOLD screws up the timing in Do! Run Run - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvRom0; -static UINT8 *DrvRom1; -static UINT8 *DrvRom2; -static UINT8 *DrvGfx0; -static UINT8 *DrvGfx1; -static UINT8 *DrvProm; - -static UINT8 *DrvZ80RAM; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvSharedRAM0; -static UINT8 *DrvSharedRAM1; - -static UINT8 *DrvVidRAM; -static UINT8 *DrvSpriteRAM; - -static UINT32 *Palette, *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDip[3] = {0, 0, 0}; -static UINT8 DrvInput[3]; -static UINT8 DrvReset; - -static INT32 flipscreen = 0; - -static UINT8 cpu0idle = 0; -static UINT8 dorunrunmode = 0; - -static struct BurnInputInfo DocastleInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 1, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 5, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 7, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 4, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 0, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip"}, -}; - -STDINPUTINFO(Docastle) - - -static struct BurnDIPInfo DocastleDIPList[]= -{ - {0x13, 0xff, 0xff, 0x08, NULL }, - {0x14, 0xff, 0xff, 0xdf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "1 (Beginner)" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x00, "4 (Advanced)" }, - - {0 , 0xfe, 0 , 2, "Rack Test" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Advance Level on Getting Diamond" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty of EXTRA" }, - {0x14, 0x01, 0x10, 0x10, "Easy" }, - {0x14, 0x01, 0x10, 0x00, "Difficult" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x20, 0x00, "Upright" }, - {0x14, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0xc0, 0x00, "2" }, - {0x14, 0x01, 0xc0, 0xc0, "3" }, - {0x14, 0x01, 0xc0, 0x80, "4" }, - {0x14, 0x01, 0xc0, 0x40, "5" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x15, 0x01, 0x0f, 0x06, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x15, 0x01, 0xf0, 0x60, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Docastle) - -static struct BurnDIPInfo DorunrunDIPList[]= -{ - {0x13, 0xff, 0xff, 0x08, NULL }, - {0x14, 0xff, 0xff, 0xdf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "1 (Beginner)" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x00, "4 (Advanced)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x04, 0x00, "Off" }, - {0x14, 0x01, 0x04, 0x04, "On" }, -#if 0 - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, -#endif - {0 , 0xfe, 0 , 2, "Difficulty of EXTRA" }, - {0x14, 0x01, 0x10, 0x10, "Easy" }, - {0x14, 0x01, 0x10, 0x00, "Difficult" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x20, 0x00, "Upright" }, - {0x14, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Special" }, - {0x14, 0x01, 0x40, 0x40, "Given" }, - {0x14, 0x01, 0x40, 0x00, "Not Given" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x80, 0x80, "3" }, - {0x14, 0x01, 0x80, 0x00, "5" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x15, 0x01, 0x0f, 0x06, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x15, 0x01, 0xf0, 0x60, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Dorunrun) - -static struct BurnDIPInfo DowildDIPList[]= -{ - {0x13, 0xff, 0xff, 0x08, NULL }, - {0x14, 0xff, 0xff, 0xdf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "1 (Beginner)" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x00, "4 (Advanced)" }, - - {0 , 0xfe, 0 , 2, "Rack Test" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -#if 0 - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, -#endif - {0 , 0xfe, 0 , 2, "Difficulty of EXTRA" }, - {0x14, 0x01, 0x10, 0x10, "Easy" }, - {0x14, 0x01, 0x10, 0x00, "Difficult" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x20, 0x00, "Upright" }, - {0x14, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Special" }, - {0x14, 0x01, 0x40, 0x40, "Given" }, - {0x14, 0x01, 0x40, 0x00, "Not Given" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x80, 0x80, "3" }, - {0x14, 0x01, 0x80, 0x00, "5" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x15, 0x01, 0x0f, 0x06, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x15, 0x01, 0xf0, 0x60, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Dowild) - -static struct BurnDIPInfo JjackDIPList[]= -{ - {0x13, 0xff, 0xff, 0x08, NULL }, - {0x14, 0xff, 0xff, 0xdf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty?" }, - {0x14, 0x01, 0x03, 0x03, "Easy" }, - {0x14, 0x01, 0x03, 0x02, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Rack Test" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -#if 0 - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, -#endif - {0 , 0xfe, 0 , 2, "Extra?" }, - {0x14, 0x01, 0x10, 0x10, "Easy" }, - {0x14, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x20, 0x00, "Upright" }, - {0x14, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0xc0, 0x00, "2" }, - {0x14, 0x01, 0xc0, 0xc0, "3" }, - {0x14, 0x01, 0xc0, 0x80, "4" }, - {0x14, 0x01, 0xc0, 0x40, "5" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x15, 0x01, 0x0f, 0x06, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x15, 0x01, 0xf0, 0x60, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Jjack) - -static struct BurnDIPInfo KickridrDIPList[]= -{ - {0x13, 0xff, 0xff, 0x08, NULL }, - {0x14, 0xff, 0xff, 0xdf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty?" }, - {0x14, 0x01, 0x03, 0x03, "Easy" }, - {0x14, 0x01, 0x03, 0x02, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Rack Test" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, -#if 0 - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, -#endif - {0 , 0xfe, 0 , 2, "DSW4" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x20, 0x00, "Upright" }, - {0x14, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "DSW2" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "DSW1" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x15, 0x01, 0x0f, 0x06, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x15, 0x01, 0xf0, 0x60, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Kickridr) - -static void DrvMakeInputs() -{ - UINT8 *DrvJoy[3] = { DrvJoy1, DrvJoy2, DrvJoy3 }; - UINT32 DrvJoyInit[3] = { 0, 0xff, 0xff }; - - CompileInput(DrvJoy, (void*)DrvInput, 3, 8, DrvJoyInit); - - ProcessJoystick(&DrvInput[0], 0, 1,3,2,0, INPUT_4WAY); - ProcessJoystick(&DrvInput[0], 1, 5,7,6,4, INPUT_4WAY | INPUT_MAKEACTIVELOW); -} - -static UINT8 shared0r(UINT8 offs) -{ - return DrvSharedRAM0[offs]; -} - -static UINT8 shared1r(UINT8 offs) -{ - return DrvSharedRAM1[offs]; -} - -static void shared0w(UINT8 offs, UINT8 data) -{ - if (offs == 8) { - cpu0idle = 0; - } - DrvSharedRAM0[offs] = data; -} - -static void shared1w(UINT8 offs, UINT8 data) -{ - if (offs == 8) { - cpu0idle = 1; - } - DrvSharedRAM1[offs] = data; -} - -static UINT8 __fastcall docastle_cpu0_read(UINT16 address) -{ - if (address >= 0xa000 && address <= 0xa008) - return shared0r(address & 0xf); - - return 0; -} - -static void __fastcall docastle_cpu0_write(UINT16 address, UINT8 data) -{ - if (address >= 0xa000 && address <= 0xa008) { - shared1w(address & 0xf, data); - return; - } - - switch (address) - { - case 0xa800: - // watchdog - return; - - case 0xb800: - case 0xe000: - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - } -} - -static void __fastcall dorunrun_cpu1_write(UINT16 address, UINT8 data) -{ - if (address >= 0xe000 && address <= 0xe008) { - shared0w(address & 0xf, data); - return; - } - - switch (address) - { - case 0xc004: - case 0xc084: - flipscreen = (address >> 7) & 1; - return; - - case 0xa000: - case 0xa400: - case 0xa800: - case 0xac00: - SN76496Write((address >> 10) & 3, data); - return; - } -} - -static void __fastcall docastle_cpu1_write(UINT16 address, UINT8 data) -{ - if (address >= 0xa000 && address <= 0xa008) { - shared0w(address & 0xf, data); - return; - } - - switch (address) - { - case 0xc004: - case 0xc084: - flipscreen = (address >> 7) & 1; - return; - - case 0xe000: - case 0xe400: - case 0xe800: - case 0xec00: - SN76496Write((address >> 10) & 3, data); - return; - } -} - - -static UINT8 __fastcall docastle_cpu1_read(UINT16 address) -{ - if ((address & 0xff70) == 0xc000) { // 0xc08x mirror - address &= 0xff7f; - } - - if (address >= 0xa000 && address <= 0xa008) - return shared1r(address & 0xf); - - if (address >= 0xe000 && address <= 0xe008) // dorunrun+ - return shared1r(address & 0xf); - - switch (address) - { - case 0xc001: return DrvDip[2]; - case 0xc002: return DrvDip[1]; - - case 0xc003: return DrvInput[0]; - case 0xc005: return DrvInput[1]; - case 0xc007: return DrvInput[2] | DrvDip[0]; // wont work because its active low, revisit. - - case 0xc004: - flipscreen = (address & 0x80) ? 1 : 0; - return flipscreen; - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvRom0 = Next; Next += 0x10000; - DrvRom1 = Next; Next += 0x10000; - DrvRom2 = Next; Next += 0x10000; - - DrvGfx0 = Next; Next += 0x08000; - DrvGfx1 = Next; Next += 0x10000; - - DrvProm = Next; Next += 0x00200; - - Palette = (UINT32 *)Next; Next += 0x00800 * sizeof(UINT32); - DrvPalette = (UINT32 *)Next; Next += 0x00800 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x01800; - DrvZ80RAM1 = Next; Next += 0x00800; - DrvZ80RAM2 = Next; Next += 0x00800; - DrvVidRAM = Next; Next += 0x00800; - DrvSpriteRAM = Next; Next += 0x00200; - DrvSharedRAM0 = Next; Next += 0x00010; - DrvSharedRAM1 = Next; Next += 0x00010; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - for (INT32 i = 0; i < 3; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - SN76496Reset(); - HiscoreReset(); - - flipscreen = 0; - cpu0idle = 0; - - return 0; -} - -static INT32 DrvPaletteInit() -{ - UINT8 *color_prom = DrvProm; - UINT8 priority = dorunrunmode; // set 0 for Mr. Do's Castle, 1 for Do's Wild Ride/Do Run Run - - for (INT32 i = 0; i < 256;i++) - { - INT32 bit0,bit1,bit2,r,g,b; - - /* red component */ - bit0 = (*color_prom >> 5) & 0x01; - bit1 = (*color_prom >> 6) & 0x01; - bit2 = (*color_prom >> 7) & 0x01; - r = 0x23 * bit0 + 0x4b * bit1 + 0x91 * bit2; - /* green component */ - bit0 = (*color_prom >> 2) & 0x01; - bit1 = (*color_prom >> 3) & 0x01; - bit2 = (*color_prom >> 4) & 0x01; - g = 0x23 * bit0 + 0x4b * bit1 + 0x91 * bit2; - /* blue component */ - bit0 = 0; - bit1 = (*color_prom >> 0) & 0x01; - bit2 = (*color_prom >> 1) & 0x01; - b = 0x23 * bit0 + 0x4b * bit1 + 0x91 * bit2; - - Palette[i] = BurnHighCol(r, g, b, 0); - color_prom++; - } - - Palette[256] = BurnHighCol(1, 1, 1, 0); - Palette[257] = BurnHighCol(2, 2, 2, 0); - - for (INT32 i = 0;i < 32;i++) - { - for (INT32 j = 0;j < 8;j++) - { - DrvPalette[16*i+j] = Palette[8*i+j]; - DrvPalette[16*i+j+8] = Palette[8*i+j]; - } - } - /* now create a table with only the colors which have priority over sprites, used */ - /* to draw the foreground. */ - for (INT32 i = 0;i < 32;i++) - { - for (INT32 j = 0;j < 8;j++) - { - if (priority == 0) /* Do's Castle */ - { - DrvPalette[32*16+16*i+j] = Palette[256]; /* high bit clear means less priority than sprites */ - DrvPalette[32*16+16*i+j+8] = Palette[8*i+j]; - } - else /* Do Wild Ride, Do Run Run, Kick Rider */ - { - DrvPalette[32*16+16*i+j] = Palette[8*i+j]; - DrvPalette[32*16+16*i+j+8] = Palette[256]; /* high bit set means less priority than sprites */ - } - } - } - - /* sprites */ - /* sprites have 4 bitplanes, but they actually have only 8 colors. The fourth */ - /* plane is used for transparency. */ - for (INT32 i = 0;i < 32;i++) - { - /* build two versions of the colortable, one with the covering color - mapped to transparent, and one with all colors but the covering one - mapped to transparent. */ - for (INT32 j = 0;j < 16;j++) - { - if (j < 8) - DrvPalette[64*16+16*i+j] = Palette[256]; /* high bit clear means transparent */ - else if (j == 15) - DrvPalette[64*16+16*i+j] = Palette[256]; /* sprite covering color */ - else - DrvPalette[64*16+16*i+j] = Palette[8*i+(j&7)]; - } - for (INT32 j = 0;j < 16;j++) - { - if (j == 15) - DrvPalette[64*16+32*16+16*i+j] = Palette[257]; /* sprite covering color */ - else - DrvPalette[64*16+32*16+16*i+j] = Palette[256]; - } - } - - return 0; -} - -static INT32 GraphicsDecode() -{ - static INT32 TilePlanes[4] = { 0, 1, 2, 3 }; - static INT32 TileYOffs[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; - static INT32 SpriXOffs[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60 }; - static INT32 SpriYOffs[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704,768, 832, 896, 960 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfx0, 0x04000); - - GfxDecode(0x200, 4, 8, 8, TilePlanes, SpriXOffs, TileYOffs, 0x100, tmp, DrvGfx0); - - memcpy (tmp, DrvGfx1, 0x08000); - - GfxDecode(0x100, 4, 16, 16, TilePlanes, SpriXOffs, SpriYOffs, 0x400, tmp, DrvGfx1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (dorunrunmode) { - if (BurnLoadRom(DrvRom0 + 0 * 0x2000, 0, 1)) return 1; - if (BurnLoadRom(DrvRom0 + 2 * 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvRom0 + 3 * 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvRom0 + 4 * 0x2000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfx1 + 0 * 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfx1 + 1 * 0x2000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfx1 + 2 * 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfx1 + 3 * 0x2000,10, 1)) return 1; - - if (BurnLoadRom(DrvRom1, 4, 1)) return 1; - if (BurnLoadRom(DrvRom2, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfx0, 6, 1)) return 1; - if (BurnLoadRom(DrvProm, 11, 1)) return 1; - - if (GraphicsDecode()) return 1; - DrvPaletteInit(); - } else { - if (BurnLoadRom(DrvRom0 + 0 * 0x2000, 0, 1)) return 1; - if (BurnLoadRom(DrvRom0 + 1 * 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvRom0 + 2 * 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvRom0 + 3 * 0x2000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfx1 + 0 * 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfx1 + 1 * 0x2000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfx1 + 2 * 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfx1 + 3 * 0x2000,10, 1)) return 1; - - if (BurnLoadRom(DrvRom1, 4, 1)) return 1; - if (BurnLoadRom(DrvRom2, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfx0, 6, 1)) return 1; - if (BurnLoadRom(DrvProm, 11, 1)) return 1; - - if (GraphicsDecode()) return 1; - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - if (dorunrunmode) { - ZetMapMemory(DrvRom0, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvRom0 + 0x4000, 0x4000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x2000, 0x37ff, MAP_RAM); - ZetMapMemory(DrvSpriteRAM, 0x3800, 0x39ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xb000, 0xb7ff, MAP_RAM); - } else { // mr. do's castle - ZetMapMemory(DrvRom0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x97ff, MAP_RAM); - ZetMapMemory(DrvSpriteRAM, 0x9800, 0x99ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xb000, 0xb7ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xb800, 0xbfff, MAP_RAM); /* mirror */ - } - ZetSetWriteHandler(docastle_cpu0_write); - ZetSetReadHandler(docastle_cpu0_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvRom1, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(docastle_cpu1_write); - ZetSetReadHandler(docastle_cpu1_read); - if (dorunrunmode) { - ZetSetWriteHandler(dorunrun_cpu1_write); - } - - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvRom2, 0x0000, 0x00ff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0x4000, 0x47ff, MAP_RAM); - ZetClose(); - - SN76489AInit(0, 4000000, 0); - SN76496SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - SN76489AInit(1, 4000000, 1); - SN76496SetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - SN76489AInit(2, 4000000, 1); - SN76496SetRoute(2, 0.20, BURN_SND_ROUTE_BOTH); - SN76489AInit(3, 4000000, 1); - SN76496SetRoute(3, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SN76496Exit(); - ZetExit(); - GenericTilesExit(); - - BurnFree(AllMem); - - dorunrunmode = 0; - - return 0; -} - -extern int counter; - -static void RenderTileCPMP(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, INT32 offset, INT32 mode, UINT8 *gfxrom) -{ - UINT16 *dest = pTransDraw; - UINT8 *gfx = gfxrom; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - //if (counter>0) bprintf(0, _T("%X,"), pxl); // debug - leave in. - - // in Jumping Jack(dorunrunmode), pxl's that are 0xf leave black crap on the screen which should be transparent, fix: (pxl == 0xf && dorunrunmode) for mode 2 - // in Mr.Do's Wild Ride, bonus text with a black background is covered up by sprites, fix: display pxl==0 - if (mode == 2 && (/*!pxl || */!(pxl & 0x08) || (pxl == 0xf && dorunrunmode))) continue; // Do's Castle fg, Do! RunRun sprites - if (mode == 1 && (/*!pxl || */(pxl & 0x08))) continue; // Do! Run Run fg - - dest[sy * nScreenWidth + sx] = pxl | (color << 4) | offset; - } - sx -= width; - } -} - -static void draw_chars(INT32 front) { - for (int offs = 0x380; offs > 0; offs--) { - INT32 sx = 8 * (offs % 32); - INT32 sy = 8 * (offs / 32); - - sy -= 32; - sx -= 8; - - INT32 code = DrvVidRAM[0x0000 + offs] + 8 * (DrvVidRAM[0x0400 + offs] & 0x20); - INT32 color = DrvVidRAM[0x0400 + offs] & 0x1f; - - if (sx < 0 || sy < 0 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (front) - RenderTileCPMP(code, color, sx, sy, 0, 0, 8, 8, 0x200, ((dorunrunmode) ? 1 : 2), DrvGfx0); - else - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, 0, DrvGfx0); - - } -} - -static void draw_sprites() -{ - UINT8 *spriteram = DrvSpriteRAM; - - for (INT32 offs = 0; offs < 0x200; offs += 4) - { - INT32 code,color,flipx,flipy,sx,sy; - - code = spriteram[offs + 3] & 0x1ff; - color = spriteram[offs + 2] & 0x1f; - sx = ((spriteram[offs + 1] + 8) & 0xff) - 8; - sy = spriteram[offs]; - flipx = spriteram[offs + 2] & 0x40; - flipy = spriteram[offs + 2] & 0x80; - - sy -= 32; - sx -= 8; - - if (dorunrunmode) { - // Games on DoRunRun hardware need kludges and other weird and wonderful things - RenderTileCPMP(code, color, sx, sy, flipx, flipy, 16, 16, 64*16 /* == 0x400 */, 2, DrvGfx1); - } else { - // use regular mask rendering for Mr. Do's Castle hardware - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 64*16, DrvGfx1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 64*16, DrvGfx1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 64*16, DrvGfx1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 64*16, DrvGfx1); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 2) draw_chars(0); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) draw_chars(1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - DrvMakeInputs(); - - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - // we need a very high interleave here to sync the cpu's -or- dips & music/sfx won't work - INT32 nInterleave = 256*16; // why don't we just go single-cycle? -dink *kidding* - INT32 nCyclesTotal[3] = { 4000000 / 60, 4000000 / 60, 4000000 / 60 }; - INT32 nIdleCycles = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - if (cpu0idle) { - nIdleCycles += nCyclesTotal[0] / nInterleave; - ZetIdle(nCyclesTotal[0] / nInterleave); - } else { - ZetRun((nCyclesTotal[0] / nInterleave) + nIdleCycles); - nIdleCycles = 0; - } - if (i == ( nInterleave - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetRun(100); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - ZetClose(); - - ZetOpen(1); - ZetRun(nCyclesTotal[1] / nInterleave); - if ((i % (nInterleave / 8)) == ((nInterleave / 8) - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetRun(100); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - ZetClose(); - -#if 0 - ZetOpen(2); // this z80 drives the crt controller, useless for emulation - ZetRun(nCyclesTotal[2] / nInterleave); - if (i == (nInterleave - 1)) ZetNmi(); - ZetClose(); -#endif - } - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - SN76496Update(2, pBurnSoundOut, nBurnSoundLen); - SN76496Update(3, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - SN76496Scan(nAction, pnMin); - - SCAN_VAR(cpu0idle); - } - - return 0; -} - - -// Mr. Do's Castle (set 1) - -static struct BurnRomInfo docastleRomDesc[] = { - { "01p_a1.bin", 0x2000, 0x17c6fc24, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "01n_a2.bin", 0x2000, 0x1d2fc7f4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "01l_a3.bin", 0x2000, 0x71a70ba9, 1 | BRF_PRG | BRF_ESS }, // 2 - { "01k_a4.bin", 0x2000, 0x479a745e, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "07n_a0.bin", 0x4000, 0xf23b5cdb, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "01d.bin", 0x0200, 0x2747ca77, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 #2 Code - - { "03a_a5.bin", 0x4000, 0x0636b8f4, 4 | BRF_GRA }, // 6 Tiles - - { "04m_a6.bin", 0x2000, 0x3bbc9b26, 5 | BRF_GRA }, // 7 Sprites - { "04l_a7.bin", 0x2000, 0x3dfaa9d1, 5 | BRF_GRA }, // 8 - { "04j_a8.bin", 0x2000, 0x9afb16e9, 5 | BRF_GRA }, // 9 - { "04h_a9.bin", 0x2000, 0xaf24bce0, 5 | BRF_GRA }, // 10 - - { "09c.bin", 0x0200, 0x066f52bc, 6 | BRF_GRA }, // 11 Color DrvProm -}; - -STD_ROM_PICK(docastle) -STD_ROM_FN(docastle) - -struct BurnDriver BurnDrvdocastle = { - "docastle", NULL, NULL, NULL, "1983", - "Mr. Do\'s Castle (set 1)\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, docastleRomInfo, docastleRomName, NULL, NULL, DocastleInputInfo, DocastleDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 192, 240, 3, 4 -}; - -static INT32 DorunrunDrvInit() -{ - dorunrunmode = 1; - - return DrvInit(); -} - -// Do! Run Run (set 1) - -static struct BurnRomInfo dorunrunRomDesc[] = { - { "2764.p1", 0x2000, 0x95c86f8e, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "2764.l1", 0x2000, 0xe9a65ba7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2764.k1", 0x2000, 0xb1195d3d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "2764.n1", 0x2000, 0x6a8160d1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "27128.p7", 0x4000, 0x8b06d461, 2 | BRF_PRG | BRF_ESS }, // 4 slave - - { "bprom2.bin", 0x0200, 0x2747ca77, 3 | BRF_PRG | BRF_ESS }, // 5 cpu3 - - { "27128.a3", 0x4000, 0x4be96dcf, 4 | BRF_GRA }, // 6 gfx1 - - { "2764.m4", 0x2000, 0x4bb231a0, 5 | BRF_GRA }, // 7 gfx2 - { "2764.l4", 0x2000, 0x0c08508a, 5 | BRF_GRA }, // 8 - { "2764.j4", 0x2000, 0x79287039, 5 | BRF_GRA }, // 9 - { "2764.h4", 0x2000, 0x523aa999, 5 | BRF_GRA }, // 10 - - { "dorunrun.clr", 0x0100, 0xd5bab5d5, 6 | BRF_GRA }, // 11 proms -}; - -STD_ROM_PICK(dorunrun) -STD_ROM_FN(dorunrun) - -struct BurnDriver BurnDrvDorunrun = { - "dorunrun", NULL, NULL, NULL, "1984", - "Do! Run Run (set 1)\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, dorunrunRomInfo, dorunrunRomName, NULL, NULL, DocastleInputInfo, DorunrunDIPInfo, - DorunrunDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 192, 4, 3 -}; - -// Mr. Do's Wild Ride - -static struct BurnRomInfo dowildRomDesc[] = { - { "w1", 0x2000, 0x097de78b, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "w3", 0x2000, 0xfc6a1cbb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "w4", 0x2000, 0x8aac1d30, 1 | BRF_PRG | BRF_ESS }, // 2 - { "w2", 0x2000, 0x0914ab69, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "w10", 0x4000, 0xd1f37fba, 2 | BRF_PRG | BRF_ESS }, // 4 slave - - { "8300b-2", 0x0200, 0x2747ca77, 3 | BRF_PRG | BRF_ESS }, // 5 cpu3 - - { "w5", 0x4000, 0xb294b151, 4 | BRF_GRA }, // 6 gfx1 - - { "w6", 0x2000, 0x57e0208b, 5 | BRF_GRA }, // 7 gfx2 - { "w7", 0x2000, 0x5001a6f7, 5 | BRF_GRA }, // 8 - { "w8", 0x2000, 0xec503251, 5 | BRF_GRA }, // 9 - { "w9", 0x2000, 0xaf7bd7eb, 5 | BRF_GRA }, // 10 - - { "dowild.clr", 0x0100, 0xa703dea5, 6 | BRF_GRA }, // 11 proms -}; - -STD_ROM_PICK(dowild) -STD_ROM_FN(dowild) - -struct BurnDriver BurnDrvDowild = { - "dowild", NULL, NULL, NULL, "1984", - "Mr. Do's Wild Ride\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, dowildRomInfo, dowildRomName, NULL, NULL, DocastleInputInfo, DowildDIPInfo, - DorunrunDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 192, 4, 3 -}; - -// Jumping Jack - -static struct BurnRomInfo jjackRomDesc[] = { - { "j1.bin", 0x2000, 0x87f29bd2, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "j3.bin", 0x2000, 0x35b0517e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "j4.bin", 0x2000, 0x35bb316a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "j2.bin", 0x2000, 0xdec52e80, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "j0.bin", 0x4000, 0xab042f04, 2 | BRF_PRG | BRF_ESS }, // 4 slave - - { "bprom2.bin", 0x0200, 0x2747ca77, 3 | BRF_GRA }, // 5 cpu3 - - { "j5.bin", 0x4000, 0x75038ff9, 4 | BRF_GRA }, // 6 gfx1 - - { "j6.bin", 0x2000, 0x5937bd7b, 5 | BRF_GRA }, // 7 gfx2 - { "j7.bin", 0x2000, 0xcf8ae8e7, 5 | BRF_GRA }, // 8 - { "j8.bin", 0x2000, 0x84f6fc8c, 5 | BRF_GRA }, // 9 - { "j9.bin", 0x2000, 0x3f9bb09f, 5 | BRF_GRA }, // 10 - - { "bprom1.bin", 0x0200, 0x2f0955f2, 6 | BRF_GRA }, // 11 proms -}; - -STD_ROM_PICK(jjack) -STD_ROM_FN(jjack) - -struct BurnDriver BurnDrvJjack = { - "jjack", NULL, NULL, NULL, "1984", - "Jumping Jack\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, jjackRomInfo, jjackRomName, NULL, NULL, DocastleInputInfo, JjackDIPInfo, - DorunrunDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 192, 240, 3, 4 -}; - - -// Kick Rider - -static struct BurnRomInfo kickridrRomDesc[] = { - { "k1", 0x2000, 0xdfdd1ab4, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "k3", 0x2000, 0x412244da, 1 | BRF_PRG | BRF_ESS }, // 1 - { "k4", 0x2000, 0xa67dd2ec, 1 | BRF_PRG | BRF_ESS }, // 2 - { "k2", 0x2000, 0xe193fb5c, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "k10", 0x4000, 0x6843dbc0, 2 | BRF_PRG | BRF_ESS }, // 4 slave - - { "8300b-2", 0x0200, 0x2747ca77, 3 | BRF_PRG | BRF_ESS }, // 5 cpu3 - - { "k5", 0x4000, 0x3f7d7e49, 4 | BRF_GRA }, // 6 gfx1 - - { "k6", 0x2000, 0x94252ed3, 5 | BRF_GRA }, // 7 gfx2 - { "k7", 0x2000, 0x7ef2420e, 5 | BRF_GRA }, // 8 - { "k8", 0x2000, 0x29bed201, 5 | BRF_GRA }, // 9 - { "k9", 0x2000, 0x847584d3, 5 | BRF_GRA }, // 10 - - { "kickridr.clr", 0x0100, 0x73ec281c, 6 | BRF_GRA }, // 11 proms -}; - -STD_ROM_PICK(kickridr) -STD_ROM_FN(kickridr) - -struct BurnDriver BurnDrvKickridr = { - "kickridr", NULL, NULL, NULL, "1984", - "Kick Rider\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, kickridrRomInfo, kickridrRomName, NULL, NULL, DocastleInputInfo, KickridrDIPInfo, - DorunrunDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 192, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_dogfgt.cpp b/jan/src/burn/drv/pre90s/d_dogfgt.cpp deleted file mode 100644 index 172dddb30..000000000 --- a/jan/src/burn/drv/pre90s/d_dogfgt.cpp +++ /dev/null @@ -1,743 +0,0 @@ -// FB Alpha Acrobatic Dog-Fight driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6502ROM0; -static UINT8 *DrvM6502ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvBMPRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvM6502RAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 bankdata; -static UINT8 flipscreen; -static UINT8 pixelcolor; -static UINT8 soundlatch; -static UINT8 last_sound_control; -static UINT8 scroll[4]; - -static INT32 vblank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; // button 1 -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DogfgtInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dogfgt) - -static struct BurnDIPInfo DogfgtDIPList[]= -{ - {0x13, 0xff, 0xff, 0x3b, NULL }, - {0x14, 0xff, 0xff, 0x7c, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x01, 0x01, "3" }, - {0x13, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x02, 0x02, "Normal" }, - {0x13, 0x01, 0x02, 0x00, "Difficult" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x08, 0x00, "No" }, - {0x13, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x13, 0x01, 0xc0, 0x00, "Upright 1 Player" }, - {0x13, 0x01, 0xc0, 0x80, "Upright 2 Players" }, - {0x13, 0x01, 0xc0, 0xc0, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x30, 0x10, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Dogfgt) - -static void bitmap_bankswitch(INT32 data) -{ - if (data > 2) return; - - bankdata = data; - - M6502MapMemory(DrvBMPRAM + (data * 0x2000), 0x2000, 0x3fff, MAP_RAM); -} - -static void dogfgt_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0x1870) { - DrvPalRAM[address & 0xf] = data; - return; - } - - switch (address) - { - case 0x1800: - flipscreen = data & 0x80; - pixelcolor = ((data << 1) & 2) | ((data & 2) >> 1); - // coin counter data & 0x30 - return; - - case 0x1810: - if (data & 0x04) { - M6502Close(); - M6502Open(1); - M6502SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6502Close(); - M6502Open(0); - } - return; - - case 0x1820: - case 0x1821: - case 0x1822: - case 0x1823: - scroll[address & 3] = data; - return; - - case 0x1824: - bitmap_bankswitch(data); - return; - - case 0x1830: - soundlatch = data; - return; - - case 0x1840: - { - if ((last_sound_control & 0x20) == 0x20 && !(data & 0x20)) - AY8910Write(0, (~last_sound_control >> 4) & 1, soundlatch); - - if ((last_sound_control & 0x80) == 0x80 && !(data & 0x80)) - AY8910Write(1, (~last_sound_control >> 6) & 1, soundlatch); - - last_sound_control = data; - } - } -} - -static UINT8 dogfgt_main_read(UINT16 address) -{ - switch (address) - { - case 0x1800: - return DrvInputs[0]; - - case 0x1810: - return DrvInputs[1]; - - case 0x1820: - return DrvDips[0]; - - case 0x1830: - return (((DrvDips[1] & ~3) | (DrvInputs[2] & 3)) & 0x7f) | (vblank ? 0x80 : 0); - } - - return 0; -} - -static void dogfgt_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x4000: - M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static tilemap_callback( background ) -{ - TILE_SET_INFO(0, DrvVidRAM[offs], (DrvVidRAM[offs+0x400] & 3) + (0x10 >> 3), 0); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6502Open(0); - M6502Reset(); - bitmap_bankswitch(0); - M6502Close(); - - M6502Open(1); - M6502Reset(); - M6502Close(); - - AY8910Reset(0); - AY8910Reset(1); - - memset (scroll, 0, 4); - - last_sound_control = 0; - flipscreen = 0; - pixelcolor = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6502ROM0 = Next; Next += 0x008000; - DrvM6502ROM1 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x030000; - - DrvColPROM = Next; Next += 0x000040; - - DrvPalette = (UINT32*)Next; Next += 0x0050 * sizeof(UINT32); - - AllRam = Next; - - DrvPalRAM = Next; Next += 0x000010; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000100; - DrvBMPRAM = Next; Next += 0x008000; - DrvShareRAM = Next; Next += 0x000800; - DrvM6502RAM1 = Next; Next += 0x000800; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { RGN_FRAC(0x6000, 2, 3), RGN_FRAC(0x6000, 1, 3), RGN_FRAC(0x6000, 0, 3) }; - INT32 PlaneS[3] = { RGN_FRAC(0x12000, 2, 3), RGN_FRAC(0x12000, 1, 3), RGN_FRAC(0x12000, 0, 3) }; - INT32 XOffs[16] = { STEP8(128+7,-1), STEP8(7,-1) }; - INT32 YOffs[16] = { STEP16(0,8) }; - INT32 XOffsS[16] = { STEP8(7,-1), STEP8(128+7,-1) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x12000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x0e000); - - GfxDecode(0x0100, 3, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x12000); - - GfxDecode(0x0300, 3, 16, 16, PlaneS, XOffsS, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6502ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x06000, 3, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x02000, 5, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x04000, 6, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x06000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0e000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 19, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 21, 1)) return 1; - - DrvGfxDecode(); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvShareRAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvSprRAM, 0x0f00, 0x0fff, MAP_RAM); // 80-df - M6502MapMemory(DrvVidRAM, 0x1000, 0x17ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM0, 0x8000, 0xffff, MAP_ROM); - M6502SetWriteHandler(dogfgt_main_write); - M6502SetReadHandler(dogfgt_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502MapMemory(DrvM6502RAM1, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvShareRAM, 0x2000, 0x27ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM1, 0x8000, 0xffff, MAP_ROM); - M6502SetWriteHandler(dogfgt_sub_write); - M6502Close(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 16, 16, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 3, 16, 16, 0x10000, 0, 7); // offset and mask weird due to | bug in rendering system - GenericTilemapSetOffsets(0, 0, -8); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 64; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i+0x10] = BurnHighCol(r,g,b,0); - } -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 0x10; i++) - { - INT32 b = (DrvPalRAM[i] >> 6) & 3; - INT32 g = (DrvPalRAM[i] >> 3) & 7; - INT32 r = (DrvPalRAM[i] >> 0) & 7; - - r = (r << 5) + (r << 2) + (r >> 1); - g = (g << 5) + (g << 2) + (g >> 1); - b += (b << 6) + (b << 4) + (b << 2); - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void copy_bitmap() -{ - INT32 color = (pixelcolor * 8) + 0x30; - - for (INT32 offs = 0; offs < 0x2000; offs++) - { - INT32 sy = offs & 0xff; - if (sy < 8 || sy >= 248) continue; - sy -= 8; - INT32 sx = (offs / 0x100) * 8; - - UINT16 *dst = pTransDraw + (sy * nScreenWidth) + sx; - UINT8 src0 = DrvBMPRAM[0x0000 + offs]; - UINT8 src1 = DrvBMPRAM[0x2000 + offs]; - UINT8 src2 = DrvBMPRAM[0x4000 + offs]; - - for (INT32 x = 0; x < 8; x++, src0>>=1, src1>>=1, src2>>=1) - { - INT32 pxl = ((src0 & 1) | ((src1 & 1) << 1) | ((src2 & 1) << 2)); - if (pxl) dst[x] = color + pxl; - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x80; offs < 0xe0; offs += 4) - { - if (DrvSprRAM[offs] & 0x01) - { - INT32 attr = DrvSprRAM[offs]; - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = (240 - DrvSprRAM[offs + 2]) & 0xff; - INT32 code = DrvSprRAM[offs + 1] | ((attr & 0x30) << 4); - INT32 color = ((attr & 0x08) >> 3); - INT32 flipx = attr & 0x04; - INT32 flipy = attr & 0x02; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM1); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - // update ram-based palette - DrvPaletteUpdate(); - - BurnTransferClear(); - - GenericTilemapSetFlip(0, (flipscreen) ? TMAP_FLIPXY : 0); - GenericTilemapSetScrollX(0, scroll[0] + (scroll[1] * 256) + 256); - GenericTilemapSetScrollY(0, scroll[2] + (scroll[3] * 256)); - - if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, 0); - - if (nSpriteEnable & 1) draw_sprites(); - - if (nBurnLayer & 2) copy_bitmap(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 128; - INT32 nCyclesTotal[2] = { 1500000 / 60, 1500000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6502Open(0); - INT32 nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += M6502Run(nSegment); - if ((i & 7) == 7) M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); // 16x per frame - nSegment = M6502TotalCycles(); - M6502Close(); - - M6502Open(1); - nCyclesDone[1] += M6502Run(nSegment - M6502TotalCycles()); - M6502Close(); - - if (i == 119) vblank = 1; // (240 / 256) * 128 - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(bankdata); - SCAN_VAR(flipscreen); - SCAN_VAR(pixelcolor); - SCAN_VAR(soundlatch); - SCAN_VAR(last_sound_control); - SCAN_VAR(scroll); - } - - if (nAction & ACB_WRITE) { - M6502Open(0); - bitmap_bankswitch(bankdata); - M6502Close(); - } - - return 0; -} - - -// Acrobatic Dog-Fight - -static struct BurnRomInfo dogfgtRomDesc[] = { - { "bx00.52", 0x2000, 0xe602a21c, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 Code - { "bx01.37", 0x2000, 0x4921c4fb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bx02-5.36", 0x2000, 0xd11b50c3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bx03-5.22", 0x2000, 0x0e4813fb, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bx04.117", 0x2000, 0xf8945f9d, 2 | BRF_PRG | BRF_ESS }, // 4 M6502 #1 Code - { "bx05.118", 0x2000, 0x3ade57ad, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bx06.119", 0x2000, 0x4a3b34cf, 2 | BRF_PRG | BRF_ESS }, // 6 - { "bx07.120", 0x2000, 0xae21f907, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "bx17.56", 0x2000, 0xfd3245d7, 3 | BRF_GRA }, // 8 Background Tiles - { "bx18.57", 0x2000, 0x03a5ef06, 3 | BRF_GRA }, // 9 - { "bx19.58", 0x2000, 0xf62a16f4, 3 | BRF_GRA }, // 10 - - { "bx08.128", 0x2000, 0x8bf41b27, 4 | BRF_GRA }, // 11 Sprites - { "bx09.127", 0x2000, 0xc3ea6509, 4 | BRF_GRA }, // 12 - { "bx10.126", 0x2000, 0x474a1c64, 4 | BRF_GRA }, // 13 - { "bx11.125", 0x2000, 0xba67e382, 4 | BRF_GRA }, // 14 - { "bx12.124", 0x2000, 0x102c0e1c, 4 | BRF_GRA }, // 15 - { "bx13.123", 0x2000, 0xca47de34, 4 | BRF_GRA }, // 16 - { "bx14.122", 0x2000, 0x51b95bb4, 4 | BRF_GRA }, // 17 - { "bx15.121", 0x2000, 0xcf45d025, 4 | BRF_GRA }, // 18 - { "bx16.120", 0x2000, 0xd1933837, 4 | BRF_GRA }, // 19 - - { "bx20.52", 0x0020, 0x4e475f05, 5 | BRF_GRA }, // 20 proms - { "bx21.64", 0x0020, 0x5de4319f, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(dogfgt) -STD_ROM_FN(dogfgt) - -struct BurnDriver BurnDrvDogfgt = { - "dogfgt", NULL, NULL, NULL, "1984", - "Acrobatic Dog-Fight\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, dogfgtRomInfo, dogfgtRomName, NULL, NULL, DogfgtInputInfo, DogfgtDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x50, - 256, 240, 4, 3 -}; - - -// Acrobatic Dog-Fight (USA) - -static struct BurnRomInfo dogfgtuRomDesc[] = { - { "bx00.52", 0x2000, 0xe602a21c, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 Code - { "bx01-6.37", 0x2000, 0x8bb66399, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bx02-7.36", 0x2000, 0xafaf10e6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bx03-6.33", 0x2000, 0x51b20e8b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bx04-7.117", 0x2000, 0xc4c2183b, 2 | BRF_PRG | BRF_ESS }, // 4 M6502 #1 Code - { "bx05-7.118", 0x2000, 0xd9a705ab, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bx06.119", 0x2000, 0x4a3b34cf, 2 | BRF_PRG | BRF_ESS }, // 6 - { "bx07-7.120", 0x2000, 0x868df3dd, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "bx17.56", 0x2000, 0xfd3245d7, 3 | BRF_GRA }, // 8 Background Tiles - { "bx18.57", 0x2000, 0x03a5ef06, 3 | BRF_GRA }, // 9 - { "bx19.58", 0x2000, 0xf62a16f4, 3 | BRF_GRA }, // 10 - - { "bx08.128", 0x2000, 0x8bf41b27, 4 | BRF_GRA }, // 11 Sprites - { "bx09.127", 0x2000, 0xc3ea6509, 4 | BRF_GRA }, // 12 - { "bx10.126", 0x2000, 0x474a1c64, 4 | BRF_GRA }, // 13 - { "bx11.125", 0x2000, 0xba67e382, 4 | BRF_GRA }, // 14 - { "bx12.124", 0x2000, 0x102c0e1c, 4 | BRF_GRA }, // 15 - { "bx13.123", 0x2000, 0xca47de34, 4 | BRF_GRA }, // 16 - { "bx14.122", 0x2000, 0x51b95bb4, 4 | BRF_GRA }, // 17 - { "bx15.121", 0x2000, 0xcf45d025, 4 | BRF_GRA }, // 18 - { "bx16.120", 0x2000, 0xd1933837, 4 | BRF_GRA }, // 19 - - { "bx20.52", 0x0020, 0x4e475f05, 5 | BRF_GRA }, // 20 Color data - { "bx21.64", 0x0020, 0x5de4319f, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(dogfgtu) -STD_ROM_FN(dogfgtu) - -struct BurnDriver BurnDrvDogfgtu = { - "dogfgtu", "dogfgt", NULL, NULL, "1985", - "Acrobatic Dog-Fight (USA)\0", NULL, "Technos Japan (Data East USA, Inc. license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, dogfgtuRomInfo, dogfgtuRomName, NULL, NULL, DogfgtInputInfo, DogfgtDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x50, - 256, 240, 4, 3 -}; - - -// Dog-Fight (Japan) - -static struct BurnRomInfo dogfgtjRomDesc[] = { - { "bx00.52", 0x2000, 0xe602a21c, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 Code - { "bx01.37", 0x2000, 0x4921c4fb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bx02.36", 0x2000, 0x91f1b9b3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bx03.22", 0x2000, 0x959ebf93, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bx04.117", 0x2000, 0xf8945f9d, 2 | BRF_PRG | BRF_ESS }, // 4 M6502 #1 Code - { "bx05.118", 0x2000, 0x3ade57ad, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bx06.119", 0x2000, 0x4a3b34cf, 2 | BRF_PRG | BRF_ESS }, // 6 - { "bx07.120", 0x2000, 0xae21f907, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "bx17.56", 0x2000, 0xfd3245d7, 3 | BRF_GRA }, // 8 Background Tiles - { "bx18.57", 0x2000, 0x03a5ef06, 3 | BRF_GRA }, // 9 - { "bx19.58", 0x2000, 0xf62a16f4, 3 | BRF_GRA }, // 10 - - { "bx08.128", 0x2000, 0x8bf41b27, 4 | BRF_GRA }, // 11 Sprites - { "bx09.127", 0x2000, 0xc3ea6509, 4 | BRF_GRA }, // 12 - { "bx10.126", 0x2000, 0x474a1c64, 4 | BRF_GRA }, // 13 - { "bx11.125", 0x2000, 0xba67e382, 4 | BRF_GRA }, // 14 - { "bx12.124", 0x2000, 0x102c0e1c, 4 | BRF_GRA }, // 15 - { "bx13.123", 0x2000, 0xca47de34, 4 | BRF_GRA }, // 16 - { "bx14.122", 0x2000, 0x51b95bb4, 4 | BRF_GRA }, // 17 - { "bx15.121", 0x2000, 0xcf45d025, 4 | BRF_GRA }, // 18 - { "bx16.120", 0x2000, 0xd1933837, 4 | BRF_GRA }, // 19 - - { "bx20.52", 0x0020, 0x4e475f05, 5 | BRF_GRA }, // 20 Color data - { "bx21.64", 0x0020, 0x5de4319f, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(dogfgtj) -STD_ROM_FN(dogfgtj) - -struct BurnDriver BurnDrvDogfgtj = { - "dogfgtj", "dogfgt", NULL, NULL, "1984", - "Dog-Fight (Japan)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, dogfgtjRomInfo, dogfgtjRomName, NULL, NULL, DogfgtInputInfo, DogfgtDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x50, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_drmicro.cpp b/jan/src/burn/drv/pre90s/d_drmicro.cpp deleted file mode 100644 index ef998850c..000000000 --- a/jan/src/burn/drv/pre90s/d_drmicro.cpp +++ /dev/null @@ -1,684 +0,0 @@ -// Dr. Micro emu-layer for FB Alpha by dink, based on the MAME driver by Uki. - -#include "tiles_generic.h" -#include "driver.h" -#include "z80_intf.h" -#include "bitswap.h" -#include "sn76496.h" -#include "msm5205.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColorPROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvChar4GFX; -static UINT8 *DrvChar8GFX; -static UINT8 *DrvSprite4GFX; -static UINT8 *DrvSprite8GFX; - -static INT32 DrvGfxROM0Len; - -static UINT8 *nmi_mask; -static INT32 pcm_adr; - -static UINT8 flipscreen = 0; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2] = { 0, 0 }; -static UINT8 DrvInput[2]; -static UINT8 DrvReset; - -static INT32 nCyclesTotal = 3072000; - - -static struct BurnInputInfo DrmicroInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Drmicro) - - -static struct BurnDIPInfo DrmicroDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x4d, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x03, 0x00, "2" }, - {0x0f, 0x01, 0x03, 0x01, "3" }, - {0x0f, 0x01, 0x03, 0x02, "4" }, - {0x0f, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x04, 0x00, "Off" }, - {0x0f, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0f, 0x01, 0x18, 0x00, "30000 100000" }, - {0x0f, 0x01, 0x18, 0x08, "50000 150000" }, - {0x0f, 0x01, 0x18, 0x10, "70000 200000" }, - {0x0f, 0x01, 0x18, 0x18, "100000 300000" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x20, 0x00, "Off" }, - {0x0f, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x40, 0x40, "Upright" }, - {0x0f, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x80, 0x00, "Off" }, - {0x0f, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x10, 0x01, 0x07, 0x07, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x06, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x05, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x07, 0x04, "1 Coin 5 Credits" }, -}; - -STDDIPINFO(Drmicro) - -static void DrvPaletteInit() -{ - const UINT8 *color_prom = DrvColorPROM; - - INT32 pal[0x100]; - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0, bit1, bit2, r, g, b; - - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (color_prom[i] >> 3) & 0x01; - bit1 = (color_prom[i] >> 4) & 0x01; - bit2 = (color_prom[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (color_prom[i] >> 6) & 0x01; - bit2 = (color_prom[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - pal[i] = BurnHighCol(r, g, b, 0); - } - - color_prom += 0x20; - - for (INT32 i = 0; i < 0x200; i++) - { - DrvPalette[i] = pal[color_prom[i] & 0x0f]; - } -} - -inline static INT32 DrvMSM5205SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate / nCyclesTotal); -} - -static void pcm_w() -{ - UINT8 *PCM = DrvSndROM; - - int data = PCM[pcm_adr / 2]; - - if (data != 0x70) - { - if (~pcm_adr & 1) - data >>= 4; - - MSM5205DataWrite(0, data & 0x0f); - MSM5205ResetWrite(0, 0); - MSM5205VCLKWrite(0, 1); - MSM5205VCLKWrite(0, 0); - - pcm_adr = (pcm_adr + 1) & 0x7fff; - } - else - { - MSM5205ResetWrite(0, 1); - } - -} - -static void __fastcall main_out(UINT16 port, UINT8 data) -{ - port &= 0xff; - switch (port) - { - case 0x00: - case 0x01: - case 0x02: - SN76496Write(port & 1, data); - return; - - case 0x03: - pcm_adr = ((data & 0x3f) << 9); - pcm_w(); - return; - - case 0x04: - *nmi_mask = data & 1; - flipscreen = (data & 2) ? 1 : 0; - return; - } - - return; -} - -static UINT8 __fastcall main_in(UINT16 port) -{ - port &= 0xff; - switch (port) - { - case 0x00: - return DrvInput[0]; - case 0x01: - return DrvInput[1]; - case 0x03: - return DrvDips[0]; - case 0x04: - return DrvDips[1]; - } - - return 0; -} - - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - pcm_adr = 0; - flipscreen = 0; - - MSM5205Reset(); - SN76496Reset(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x10000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - DrvChar4GFX = Next; Next += 0x10000; - DrvChar8GFX = Next; Next += 0x10000; - DrvSprite4GFX = Next; Next += 0x10000; - DrvSprite8GFX = Next; Next += 0x10000; - DrvColorPROM = Next; Next += 0x00400; - DrvSndROM = Next; Next += 0x100000; - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x01000; - DrvZ80RAM1 = Next; Next += 0x01000; - DrvVidRAM = Next; Next += 0x01000; - - nmi_mask = Next; Next += 0x00001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 GetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *Load0 = DrvZ80ROM; // 1 main - UINT8 *Loadg4 = DrvChar4GFX; // 2 gfx4 - UINT8 *Loadg8 = DrvChar8GFX; // 3 gfx8 - UINT8 *Loads = DrvSndROM; // 4 sound samples rom - UINT8 *Loadc = DrvColorPROM; // 5 prom - - DrvGfxROM0Len = 0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(Load0, i, 1)) return 1; - Load0 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(Loadg4, i, 1)) return 1; - Loadg4 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(Loadg8, i, 1)) return 1; - Loadg8 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(Loads, i, 1)) return 1; - Loads += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 5) { - if (BurnLoadRom(Loadc, i, 1)) return 1; - Loadc += ri.nLen; - - continue; - } - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 charPlane4[2] = { 0,0x2000*8 }; - INT32 charPlane8[3] = { 0x2000*16,0x2000*8,0 }; - INT32 spritePlane4[2] = { 0,0x2000*8 }; - INT32 spritePlane8[3] = { 0x2000*16,0x2000*8,0 }; - - INT32 sprXOffs[16] = { STEP8(7,-1),STEP8(71,-1) }; - INT32 sprYOffs[16] = { STEP8(0,8),STEP8(128,8) }; - - INT32 charXOffs[8] = { STEP8(7,-1) }; - INT32 charYOffs[8] = { STEP8(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return 1; - } - memset(tmp, 0, 0x20000); - memcpy(tmp, DrvChar4GFX, 0x4000); - - GfxDecode(0x100, 2, 16, 16, spritePlane4, sprXOffs, sprYOffs, 0x100, tmp + 0x0000, DrvSprite4GFX); - GfxDecode(0x400, 2, 8, 8, charPlane4, charXOffs, charYOffs, 0x040, tmp + 0x0000, DrvChar4GFX); - - memset(tmp, 0, 0x20000); - memcpy(tmp, DrvChar8GFX, 0x6000); - - GfxDecode(0x100, 3, 16, 16, spritePlane8, sprXOffs, sprYOffs, 0x100, tmp + 0x0000, DrvSprite8GFX); - GfxDecode(0x400, 3, 8, 8, charPlane8, charXOffs, charYOffs, 0x040, tmp + 0x0000, DrvChar8GFX); - - BurnFree (tmp); - - return 0; -} - - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (GetRoms()) return 1; - - DrvGfxDecode(); - - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0xf000, 0xffff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xe000, 0xefff, MAP_RAM); - ZetSetOutHandler(main_out); - ZetSetInHandler(main_in); - ZetClose(); - - SN76496Init(0, 4608000, 0); - SN76496SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - SN76496Init(1, 4608000, 1); - SN76496SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - SN76496Init(2, 4608000, 1); - SN76496SetRoute(2, 0.50, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, DrvMSM5205SynchroniseStream, 384000, pcm_w, MSM5205_S64_4B, 1); - MSM5205SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - SN76496Exit(); - MSM5205Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void draw_bg(INT32 layer) -{ - UINT8 bits = (layer == 0) ? 2 : 3; - INT32 palind = (layer == 0) ? 0 : 0x100; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= 16; //offsets - if (sy < -7) sy += 256; - if (sx < -7) sx += 256; - - INT32 flipy = 0; - INT32 flipx = 0; - - INT32 code = DrvVidRAM[offs + 0x0800]; - INT32 color = DrvVidRAM[offs + 0x0c00]; - - if (layer == 1) { - code = DrvVidRAM[offs + 0x0000]; - color = DrvVidRAM[offs + 0x0400]; - } - - code += (color & 0xc0) << 2; - code &= 0x3ff; - flipy = color & 0x20; - flipx = color & 0x10; - color &= 0x0f; - - if (sx > nScreenWidth || sy > nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (layer == 0) ? DrvChar4GFX : DrvChar8GFX); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (layer == 0) ? DrvChar4GFX : DrvChar8GFX); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (layer == 0) ? DrvChar4GFX : DrvChar8GFX); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (layer == 0) ? DrvChar4GFX : DrvChar8GFX); - } - } - } -} - - -static void draw_sprites() -{ - for (INT32 g = 0; g < 2; g++) - { - UINT8 bits = (g != 0) ? 2 : 3; - INT32 palind = (g != 0) ? 0 : 0x100; - INT32 adr = 0x800 * g; - - for (INT32 offs = 0; offs < 0x20; offs += 4) - { - INT32 sx = DrvVidRAM[offs + adr + 3]; - INT32 sy = DrvVidRAM[offs + adr + 0]; - INT32 attr = DrvVidRAM[offs + adr + 2]; - INT32 code = DrvVidRAM[offs + adr + 1]; - - INT32 flipx = (code & 0x01) ^ flipscreen; - INT32 flipy = ((code & 0x02) >> 1) ^ flipscreen; - - code = (code >> 2) | (attr & 0xc0); - - INT32 color = (attr & 0x0f) + 0x00; - - if (!flipscreen) - sy = (240 - sy) & 0xff; - else - sx = (240 - sx) & 0xff; - - sy -= 16; // offsets - - if (sy < -15) sy += 256; - if (sx < -15) sx += 256; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (g == 0) ? DrvSprite8GFX : DrvSprite4GFX); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (g == 0) ? DrvSprite8GFX : DrvSprite4GFX); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (g == 0) ? DrvSprite8GFX : DrvSprite4GFX); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (g == 0) ? DrvSprite8GFX : DrvSprite4GFX); - } - } - - if (sx > 240) { - sx -= 256; - if (flipy) { // again! yay! - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (g == 0) ? DrvSprite8GFX : DrvSprite4GFX); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (g == 0) ? DrvSprite8GFX : DrvSprite4GFX); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (g == 0) ? DrvSprite8GFX : DrvSprite4GFX); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, bits, 0, palind, (g == 0) ? DrvSprite8GFX : DrvSprite4GFX); - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_bg(0); - if (nBurnLayer & 2) draw_bg(1); - if (nBurnLayer & 4) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvMakeInputs() -{ - // Reset Inputs (all active HIGH) - DrvInput[0] = 0; - DrvInput[1] = 0; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvMakeInputs(); - - INT32 nInterleave = MSM5205CalcInterleave(0, nCyclesTotal); - ZetNewFrame(); - ZetOpen(0); - - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetRun(nCyclesTotal / 60 / nInterleave); - - if (*nmi_mask && i == (nInterleave - 1)) - ZetNmi(); - - MSM5205Update(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - SN76496Update(2, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - SN76496Update(2, pSoundBuf, nSegmentLength); - } - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - SN76496Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - - SCAN_VAR(pcm_adr); - } - - return 0; -} - -// Dr. Micro - -static struct BurnRomInfo drmicroRomDesc[] = { - { "dm-00.13b", 0x2000, 0x270f2145, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "dm-01.14b", 0x2000, 0xbba30c80, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dm-02.15b", 0x2000, 0xd9e4ca6b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dm-03.13d", 0x2000, 0xb7bcb45b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "dm-04.14d", 0x2000, 0x071db054, 1 | BRF_PRG | BRF_ESS }, // 4 - { "dm-05.15d", 0x2000, 0xf41b8d8a, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "dm-23.5l", 0x2000, 0x279a76b8, 2 | BRF_GRA }, // 6 gfx1 - { "dm-24.5n", 0x2000, 0xee8ed1ec, 2 | BRF_GRA }, // 7 - - { "dm-20.4a", 0x2000, 0x6f5dbf22, 3 | BRF_GRA }, // 8 gfx2 - { "dm-21.4c", 0x2000, 0x8b17ff47, 3 | BRF_GRA }, // 9 - { "dm-22.4d", 0x2000, 0x84daf771, 3 | BRF_GRA }, // 10 - - { "dm-40.12m", 0x2000, 0x3d080af9, 4 | BRF_SND }, // 11 adpcm - { "dm-41.13m", 0x2000, 0xddd7bda2, 4 | BRF_SND }, // 12 - - { "dm-62.9h", 0x0020, 0xe3e36eaf, 5 | BRF_GRA }, // 13 proms - { "dm-61.4m", 0x0100, 0x0dd8e365, 5 | BRF_GRA }, // 14 - { "dm-60.6e", 0x0100, 0x540a3953, 5 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(drmicro) -STD_ROM_FN(drmicro) - -struct BurnDriver BurnDrvDrmicro = { - "drmicro", NULL, NULL, NULL, "1983", - "Dr. Micro\0", NULL, "Sanritsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, drmicroRomInfo, drmicroRomName, NULL, NULL, DrmicroInputInfo, DrmicroDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - diff --git a/jan/src/burn/drv/pre90s/d_dynduke.cpp b/jan/src/burn/drv/pre90s/d_dynduke.cpp deleted file mode 100644 index e12cd4cc2..000000000 --- a/jan/src/burn/drv/pre90s/d_dynduke.cpp +++ /dev/null @@ -1,1175 +0,0 @@ -// FB Alpha Dynamite Duke driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "seibusnd.h" -#include "nec_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvV30ROM0; -static UINT8 *DrvV30ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM; -static UINT8 *DrvV30RAM0; -static UINT8 *DrvV30RAM1; -static UINT8 *DrvShareRAM; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvScrRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPalRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *bg_bankbase; -static UINT8 *fg_bankbase; -static UINT8 *bg_enable; -static UINT8 *fg_enable; -static UINT8 *txt_enable; -static UINT8 *sprite_enable; -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[2]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static const INT32 nInterleave = 256; -static const INT32 nCyclesTotal[3] = { 8000000 / 60, 8000000 / 60, 3579545 / 60 }; -static INT32 nCyclesDone[3] = { 0, 0, 0 }; - -static struct BurnInputInfo DyndukeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dynduke) - -static struct BurnDIPInfo DyndukeDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x01, 0x01, "Mode 1" }, - {0x13, 0x01, 0x01, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x06, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x06, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x06, 0x04, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x06, 0x06, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 5, "Coin B" }, - {0x13, 0x01, 0x18, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x18, 0x10, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x18, 0x08, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x18, 0x00, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x18, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 5, "Coinage" }, - {0x13, 0x01, 0x1e, 0x18, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1e, 0x1a, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1e, 0x1c, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1e, 0x1e, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1e, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Starting Coin" }, - {0x13, 0x01, 0x20, 0x20, "Normal" }, - {0x13, 0x01, 0x20, 0x00, "X 2" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x40, 0x40, "Upright" }, - {0x13, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "80K 100K+" }, - {0x14, 0x01, 0x0c, 0x08, "100K 100K+" }, - {0x14, 0x01, 0x0c, 0x04, "120K 100K+" }, - {0x14, 0x01, 0x0c, 0x00, "120K 120K+" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - {0x14, 0x01, 0x30, 0x20, "Easy" }, - {0x14, 0x01, 0x30, 0x10, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Dynduke) - -void __fastcall master_write(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x0b004: - case 0x0b005: - case 0x0f004: - case 0x0f005: // nop - return; - - case 0x0b006: - // case 0x0b007: - case 0x0f006: - // case 0x0f007: - *bg_enable = ~data & 0x01; - *fg_enable = ~data & 0x02; - *txt_enable = ~data & 0x04; - *sprite_enable = ~data & 0x08; - *flipscreen = data & 0x40; - return; - } - - if ((address & 0xffff0) == 0x0d000 || (address & 0xffff0) == 0x09000) { - seibu_main_word_write(address, data); - return; - } -} - -UINT8 __fastcall master_read(UINT32 address) -{ - switch (address) - { - case 0xb000: - case 0xf000: - return DrvInputs[0]; - - case 0xb001: - case 0xf001: - return DrvInputs[1]; - - case 0xb002: - case 0xf002: - return DrvDips[0]; - - case 0xb003: - case 0xf003: - return DrvDips[1]; - } - - if ((address & 0xffff0) == 0x0d000 || (address & 0xffff0) == 0x09000) { - return seibu_main_word_read(address); - } - - return 0; -} - -static inline void palette_update_entry(INT32 entry) -{ - UINT16 p = *((UINT16*)(DrvPalRAM + (entry * 2))); - - INT32 r = (p >> 0) & 0x0f; - INT32 g = (p >> 4) & 0x0f; - INT32 b = (p >> 8) & 0x0f; - - DrvPalette[entry] = BurnHighCol((r<<4)|r, (g<<4)|g, (b<<4)|b, 0); -} - -void __fastcall slave_write(UINT32 address, UINT8 data) -{ - if ((address & 0xff000) == 0x07000) { - DrvPalRAM[(address & 0xfff)] = data; - palette_update_entry((address & 0xfff)/2); - return; - } - - switch (address) - { - case 0x0a000: - // case 0x0a001: - *bg_bankbase = (data & 0x01) >> 0; - *fg_bankbase = (data & 0x10) >> 4; - return; - - case 0x0c000: - case 0x0c001: // nop - return; - } -} - -static void map_master_cpu() -{ - VezOpen(0); - VezMapArea(0x00000, 0x06fff, 0, DrvV30RAM0); - VezMapArea(0x00000, 0x06fff, 1, DrvV30RAM0); - VezMapArea(0x00000, 0x06fff, 2, DrvV30RAM0); - VezMapArea(0x07000, 0x07fff, 0, DrvSprRAM); - VezMapArea(0x07000, 0x07fff, 1, DrvSprRAM); - VezMapArea(0x07000, 0x07fff, 2, DrvSprRAM); - VezMapArea(0x08000, 0x087ff, 0, DrvScrRAM); // scroll ram (8000-80ff) - VezMapArea(0x08000, 0x087ff, 1, DrvScrRAM); - VezMapArea(0x08000, 0x087ff, 2, DrvScrRAM); - VezMapArea(0x0a000, 0x0afff, 0, DrvShareRAM); - VezMapArea(0x0a000, 0x0afff, 1, DrvShareRAM); - VezMapArea(0x0a000, 0x0afff, 2, DrvShareRAM); - VezMapArea(0x0c000, 0x0c7ff, 0, DrvTxtRAM); - VezMapArea(0x0c000, 0x0c7ff, 1, DrvTxtRAM); - VezMapArea(0x0c000, 0x0c7ff, 2, DrvTxtRAM); - VezMapArea(0xa0000, 0xfffff, 0, DrvV30ROM0 + 0xa0000); - VezMapArea(0xa0000, 0xfffff, 2, DrvV30ROM0 + 0xa0000); - VezSetWriteHandler(master_write); - VezSetReadHandler(master_read); - VezClose(); -} - -static void map_masterj_cpu() -{ - VezOpen(0); - VezMapArea(0x00000, 0x06fff, 0, DrvV30RAM0); - VezMapArea(0x00000, 0x06fff, 1, DrvV30RAM0); - VezMapArea(0x00000, 0x06fff, 2, DrvV30RAM0); - VezMapArea(0x07000, 0x07fff, 0, DrvSprRAM); - VezMapArea(0x07000, 0x07fff, 1, DrvSprRAM); - VezMapArea(0x07000, 0x07fff, 2, DrvSprRAM); - VezMapArea(0x08000, 0x087ff, 0, DrvTxtRAM); - VezMapArea(0x08000, 0x087ff, 1, DrvTxtRAM); - VezMapArea(0x08000, 0x087ff, 2, DrvTxtRAM); - VezMapArea(0x0c000, 0x0c7ff, 0, DrvScrRAM); // scroll ram (8000-80ff) - VezMapArea(0x0c000, 0x0c7ff, 1, DrvScrRAM); - VezMapArea(0x0c000, 0x0c7ff, 2, DrvScrRAM); - VezMapArea(0x0e000, 0x0efff, 0, DrvShareRAM); - VezMapArea(0x0e000, 0x0efff, 1, DrvShareRAM); - VezMapArea(0x0e000, 0x0efff, 2, DrvShareRAM); - VezMapArea(0xa0000, 0xfffff, 0, DrvV30ROM0 + 0xa0000); - VezMapArea(0xa0000, 0xfffff, 2, DrvV30ROM0 + 0xa0000); - VezSetWriteHandler(master_write); - VezSetReadHandler(master_read); - VezClose(); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - VezOpen(0); - VezReset(); - VezClose(); - - VezOpen(1); - VezReset(); - VezClose(); - - seibu_sound_reset(); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 4,0,(0x10000*8)+4,0x10000*8 }; - INT32 Plane1[6] = { ((0x80000*8)*2)+4, ((0x80000*8)*2)+0, ((0x80000*8)*1)+4, ((0x80000*8)*1)+0, ((0x80000*8)*0)+4, ((0x80000*8)*0)+0}; - INT32 Plane2[4] = { 12, 8, 4, 0 }; - INT32 Plane3[4] = { 0x80000*8+4, 0x80000*8, 4, 0 }; - INT32 XOffs0[16] = { 0,1,2,3,8,9,10,11,256+0,256+1,256+2,256+3,256+8,256+9,256+10,256+11 }; - INT32 XOffs2[16] = { 0,1,2,3, 16,17,18,19,512+0,512+1,512+2,512+3,512+8+8,512+9+8,512+10+8,512+11+8 }; - INT32 YOffs0[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16,9*16,10*16,11*16,12*16,13*16,14*16,15*16 }; - INT32 YOffs2[16] = { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x020000); - - GfxDecode(0x0400, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x180000); - - GfxDecode(0x2000, 6, 16, 16, Plane1, XOffs0, YOffs0, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane3, XOffs0, YOffs0, 0x200, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane2, XOffs2, YOffs2, 0x400, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvV30ROM0 = Next; Next += 0x100000; - DrvV30ROM1 = Next; Next += 0x100000; - - SeibuZ80ROM = Next; Next += 0x020000; - SeibuZ80DecROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x200000; - DrvGfxROM3 = Next; Next += 0x400000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - DrvV30RAM0 = Next; Next += 0x007000; - DrvV30RAM1 = Next; Next += 0x006000; - DrvShareRAM = Next; Next += 0x001000; - - DrvTxtRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x000800; - DrvScrRAM = Next; Next += 0x000800; - - DrvSprRAM = Next; Next += 0x001000; - DrvSprBuf = Next; Next += 0x001000; - - DrvPalRAM = Next; Next += 0x001000; - - SeibuZ80RAM = Next; Next += 0x000800; - - bg_bankbase = Next; Next += 0x000001; - fg_bankbase = Next; Next += 0x000001; - bg_enable = Next; Next += 0x000001; - fg_enable = Next; Next += 0x000001; - txt_enable = Next; Next += 0x000001; - sprite_enable = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(void (*pV30MapCallback)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvV30ROM0 + 0x0a0000, 0, 2)) return 1; - if (BurnLoadRom(DrvV30ROM0 + 0x0a0001, 1, 2)) return 1; - if (BurnLoadRom(DrvV30ROM0 + 0x0c0000, 2, 2)) return 1; - if (BurnLoadRom(DrvV30ROM0 + 0x0c0001, 3, 2)) return 1; - - if (BurnLoadRom(DrvV30ROM1 + 0x0e0000, 4, 2)) return 1; - if (BurnLoadRom(DrvV30ROM1 + 0x0e0001, 5, 2)) return 1; - - if (BurnLoadRom(SeibuZ80ROM + 0x00000, 6, 1)) return 1; - memcpy (SeibuZ80ROM + 0x10000, SeibuZ80ROM + 0x08000, 0x08000); - memcpy (SeibuZ80ROM + 0x18000, SeibuZ80ROM + 0x00000, 0x08000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x010000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c0000, 18, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x080000, 21, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x080001, 22, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 23, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100001, 24, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x180000, 25, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x180001, 26, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 27, 1)) return 1; - - DrvGfxDecode(); - } - - VezInit(0, V30_TYPE); - VezInit(1, V30_TYPE); - - pV30MapCallback(); - - VezOpen(1); - VezMapArea(0x00000, 0x05fff, 0, DrvV30RAM1); - VezMapArea(0x00000, 0x05fff, 1, DrvV30RAM1); - VezMapArea(0x00000, 0x05fff, 2, DrvV30RAM1); - VezMapArea(0x06000, 0x067ff, 0, DrvBgRAM); - VezMapArea(0x06000, 0x067ff, 1, DrvBgRAM); - VezMapArea(0x06000, 0x067ff, 2, DrvBgRAM); - VezMapArea(0x06800, 0x06fff, 0, DrvFgRAM); - VezMapArea(0x06800, 0x06fff, 1, DrvFgRAM); - VezMapArea(0x06800, 0x06fff, 2, DrvFgRAM); - VezMapArea(0x07000, 0x07fff, 0, DrvPalRAM); -// VezMapArea(0x07000, 0x07fff, 1, DrvPalRAM); - VezMapArea(0x07000, 0x07fff, 2, DrvPalRAM); - VezMapArea(0x08000, 0x08fff, 0, DrvShareRAM); - VezMapArea(0x08000, 0x08fff, 1, DrvShareRAM); - VezMapArea(0x08000, 0x08fff, 2, DrvShareRAM); - VezMapArea(0xc0000, 0xfffff, 0, DrvV30ROM1 + 0xc0000); - VezMapArea(0xc0000, 0xfffff, 2, DrvV30ROM1 + 0xc0000); - VezSetWriteHandler(slave_write); - VezClose(); - - seibu_sound_init(0, 0x20000, 3579545, 3579545, 1320000 / 132); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - VezExit(); - - seibu_sound_exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites(INT32 pri) -{ - if (*sprite_enable == 0) return; - - UINT16 *spr = (UINT16*)DrvSprBuf; - - for (INT32 offs = 0x800-4; offs >= 0; offs -= 4) - { - INT32 attr = spr[offs + 0]; - INT32 code = spr[offs + 1]; - INT32 sx = spr[offs + 2]; - INT32 skip = spr[offs + 3]; - - INT32 prio = (sx >> 13) & 3; - - if ((skip & 0x0f00) != 0x0f00 || prio != pri) continue; - - INT32 flipx = attr & 0x2000; - INT32 flipy = attr & 0x4000; - INT32 sy = attr & 0x00ff; - INT32 color =((attr >> 8) & 0x1f) + 0x30; - - if (sx & 0x100) { - sx = 0 - (0x100 - (sx & 0xff)); - } else { - sx = sx & 0xff; - } - - code &= 0x3fff; - - if (*flipscreen) { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 15, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 15, 0, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 15, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 15, 0, DrvGfxROM3); - } - } - } -} - -static void draw_bg_layer(INT32 priority) -{ - if (*bg_enable == 0) { - if (priority == 0) BurnTransferClear(); - return; - } - - UINT16 *scrl = (UINT16*)DrvScrRAM; - UINT16 *vram = (UINT16*)DrvBgRAM; - - INT32 scrolly = (((scrl[0x01] & 0x30) << 4) | ((scrl[0x02] & 0x7f) << 1) | ((scrl[0x02] & 0x80) >> 7)) & 0x1ff; - INT32 scrollx = (((scrl[0x09] & 0x30) << 4) | ((scrl[0x0a] & 0x7f) << 1) | ((scrl[0x0a] & 0x80) >> 7)) & 0x1ff; - - UINT16 *dest = pTransDraw; - - for (INT32 sy = 0; sy < nScreenHeight; sy++, dest += nScreenWidth) - { - INT32 scrolly_0 = (scrolly+sy+16) & 0x1ff; - - for (INT32 sx = 0; sx < nScreenWidth + 16; sx+=16) - { - INT32 scrollx_0 = (scrollx+sx) & 0x1ff; - - INT32 offs = ((scrollx_0 >> 4) << 5) | (scrolly_0 >> 4); - - INT32 code = vram[offs]; - INT32 color = code >> 12; - code = (code & 0x0fff) | (*bg_bankbase * 0x1000); - - { - INT32 romoff = ((scrolly_0 & 0x0f) << 4); - - UINT8 *rom = DrvGfxROM1 + (code * 0x100) + romoff; - - color <<= 6; - - INT32 xx = sx - (scrollx_0 & 0x0f); - - for (INT32 x = 0; x < 16; x++, xx++) - { - if (xx < 0 || xx >= nScreenWidth) continue; - - INT32 pxl = rom[x]; - - if ((pxl & 0x20) == priority) { - pxl |= color; - if (pxl & 0x10) pxl += 0x400; - pxl = (pxl & 0x000f) | ((pxl & 0xffc0) >> 2); - - dest[xx] = pxl; - } - } - } - } - } -} - -static void draw_fg_layer() -{ - if (*fg_enable == 0) return; - - UINT16 *scrl = (UINT16*)DrvScrRAM; - UINT16 *vram = (UINT16*)DrvFgRAM; - - INT32 scrolly = (((scrl[0x11] & 0x30) << 4) | ((scrl[0x12] & 0x7f) << 1) | ((scrl[0x12] & 0x80) >> 7)) & 0x1ff; - INT32 scrollx = (((scrl[0x19] & 0x30) << 4) | ((scrl[0x1a] & 0x7f) << 1) | ((scrl[0x1a] & 0x80) >> 7)) & 0x1ff; - - scrolly += 16; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs & 0x1f) << 4; - INT32 sx = (offs >> 5) << 4; - - sx -= scrollx; - if (sx < -15) sx += 512; - sy -= scrolly; - if (sy < -15) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = vram[offs]; - INT32 color = code >> 12; - code = (code & 0xfff) | (*fg_bankbase * 0x1000); - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x200, DrvGfxROM2); - } -} - -static void draw_tx_layer() -{ - UINT16 *vram = (UINT16*)DrvTxtRAM; - - for (INT32 offs = (32 * 2); offs < (32 * 32) - (32 * 2); offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = ((offs >> 5) << 3) - 16; - - INT32 code = vram[offs]; - INT32 color = (code >> 8) & 0x0f; - code = (code & 0x00ff) | ((code & 0xc000) >> 6); - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 15, 0x500, DrvGfxROM0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000 / 2; i++) { - palette_update_entry(i); - } - DrvRecalc = 0; - } - - if ((nBurnLayer & 1) == 0) { - BurnTransferClear(); - } - - if (nSpriteEnable & 1) draw_sprites(0); // ? - if (nBurnLayer & 1) draw_bg_layer(0x00); - if (nSpriteEnable & 2) draw_sprites(1); - if (nBurnLayer & 2) draw_bg_layer(0x20); - if (nSpriteEnable & 4) draw_sprites(2); - if (nBurnLayer & 4) draw_fg_layer(); - if (nSpriteEnable & 8) draw_sprites(3); - if (nBurnLayer & 8) draw_tx_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - VezNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - seibu_coin_input = (DrvJoy3[0] & 1) | ((DrvJoy3[1] & 1) << 1); - } - - nCyclesDone[0] = nCyclesDone[1] = nCyclesDone[2] = 0; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - VezOpen(0); - nCyclesDone[0] += VezRun(nSegment); - if (i == 240) VezSetIRQLineAndVector(0, 0xc8/4, CPU_IRQSTATUS_ACK); - - VezClose(); - - VezOpen(1); - nCyclesDone[1] += VezRun(nSegment); - if (i == 240) VezSetIRQLineAndVector(0, 0xc8/4, CPU_IRQSTATUS_ACK); - VezClose(); - - //nSegment = nCyclesTotal[2] / nInterleave; - //nCyclesDone[2] += nSegment; - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[2] / nInterleave)); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[2]); - - if (pBurnSoundOut) { - seibu_sound_update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - VezScan(nAction); - ZetScan(nAction); - seibu_sound_scan(pnMin, nAction); - - DrvRecalc = 1; - } - - return 0; -} - - - -// Dynamite Duke (Europe, 03SEP89) - -static struct BurnRomInfo dyndukeRomDesc[] = { - { "1.cd8", 0x10000, 0xa5e2a95a, 1 | BRF_PRG | BRF_ESS }, // 0 V30 #0 Code - { "2.cd7", 0x10000, 0x7e51af22, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dde3.e8", 0x20000, 0x95336279, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dde4.e7", 0x20000, 0xeb2d8fea, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "5.p8", 0x10000, 0x883d319c, 2 | BRF_PRG | BRF_ESS }, // 4 V30 #1 Code - { "6.p7", 0x10000, 0xd94cb4ff, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "8.w8", 0x10000, 0x3c29480b, 3 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "9.5k", 0x04000, 0xf2bc9af4, 4 | BRF_GRA }, // 7 Character Tiles - { "10.34k", 0x04000, 0xc2a9f19b, 4 | BRF_GRA }, // 8 - - { "dd.a2", 0x40000, 0x598f343f, 5 | BRF_GRA }, // 9 Background Tiles - { "dd.b2", 0x40000, 0x41a9088d, 5 | BRF_GRA }, // 10 - { "dd.c2", 0x40000, 0xcc341b42, 5 | BRF_GRA }, // 11 - { "dd.d2", 0x40000, 0x4752b4d7, 5 | BRF_GRA }, // 12 - { "dd.de3", 0x40000, 0x44a4cb62, 5 | BRF_GRA }, // 13 - { "dd.ef3", 0x40000, 0xaa8aee1a, 5 | BRF_GRA }, // 14 - - { "dd.mn3", 0x40000, 0x2ee0ca98, 6 | BRF_GRA }, // 15 Foreground Tiles - { "dd.mn4", 0x40000, 0x6c71e2df, 6 | BRF_GRA }, // 16 - { "dd.n45", 0x40000, 0x85d918e1, 6 | BRF_GRA }, // 17 - { "dd.mn5", 0x40000, 0xe71e34df, 6 | BRF_GRA }, // 18 - - { "dd.n1", 0x40000, 0xcf1db927, 7 | BRF_GRA }, // 19 Sprites - { "dd.n2", 0x40000, 0x5328150f, 7 | BRF_GRA }, // 20 - { "dd.m1", 0x40000, 0x80776452, 7 | BRF_GRA }, // 21 - { "dd.m2", 0x40000, 0xff61a573, 7 | BRF_GRA }, // 22 - { "dd.e1", 0x40000, 0x84a0b87c, 7 | BRF_GRA }, // 23 - { "dd.e2", 0x40000, 0xa9585df2, 7 | BRF_GRA }, // 24 - { "dd.f1", 0x40000, 0x9aed24ba, 7 | BRF_GRA }, // 25 - { "dd.f2", 0x40000, 0x3eb5783f, 7 | BRF_GRA }, // 26 - - { "7.x10", 0x10000, 0x9cbc7b41, 8 | BRF_SND }, // 27 Samples - - { "26.n2", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, - { "61-d.u3", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(dynduke) -STD_ROM_FN(dynduke) - -static INT32 dyndukeInit() -{ - return DrvInit(map_master_cpu); -} - -struct BurnDriver BurnDrvDynduke = { - "dynduke", NULL, NULL, NULL, "1989", - "Dynamite Duke (Europe, 03SEP89)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, dyndukeRomInfo, dyndukeRomName, NULL, NULL, DyndukeInputInfo, DyndukeDIPInfo, - dyndukeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Dynamite Duke (Europe, 25JUL89) - -static struct BurnRomInfo dyndukeaRomDesc[] = { - { "1.cd8", 0x10000, 0xa5e2a95a, 1 | BRF_PRG | BRF_ESS }, // 0 V30 #0 Code - { "2.cd7", 0x10000, 0x7e51af22, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.e8", 0x20000, 0xa56f8692, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4e.e7", 0x20000, 0x384c0635, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "5.p8", 0x10000, 0x883d319c, 2 | BRF_PRG | BRF_ESS }, // 4 V30 #1 Code - { "6.p7", 0x10000, 0xd94cb4ff, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "8.w8", 0x10000, 0x3c29480b, 3 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "9.5k", 0x04000, 0xf2bc9af4, 4 | BRF_GRA }, // 7 Character Tiles - { "10.34k", 0x04000, 0xc2a9f19b, 4 | BRF_GRA }, // 8 - - { "dd.a2", 0x40000, 0x598f343f, 5 | BRF_GRA }, // 9 Background Tiles - { "dd.b2", 0x40000, 0x41a9088d, 5 | BRF_GRA }, // 10 - { "dd.c2", 0x40000, 0xcc341b42, 5 | BRF_GRA }, // 11 - { "dd.d2", 0x40000, 0x4752b4d7, 5 | BRF_GRA }, // 12 - { "dd.de3", 0x40000, 0x44a4cb62, 5 | BRF_GRA }, // 13 - { "dd.ef3", 0x40000, 0xaa8aee1a, 5 | BRF_GRA }, // 14 - - { "dd.mn3", 0x40000, 0x2ee0ca98, 6 | BRF_GRA }, // 15 Foreground Tiles - { "dd.mn4", 0x40000, 0x6c71e2df, 6 | BRF_GRA }, // 16 - { "dd.n45", 0x40000, 0x85d918e1, 6 | BRF_GRA }, // 17 - { "dd.mn5", 0x40000, 0xe71e34df, 6 | BRF_GRA }, // 18 - - { "dd.n1", 0x40000, 0xcf1db927, 7 | BRF_GRA }, // 19 Sprites - { "dd.n2", 0x40000, 0x5328150f, 7 | BRF_GRA }, // 20 - { "dd.m1", 0x40000, 0x80776452, 7 | BRF_GRA }, // 21 - { "dd.m2", 0x40000, 0xff61a573, 7 | BRF_GRA }, // 22 - { "dd.e1", 0x40000, 0x84a0b87c, 7 | BRF_GRA }, // 23 - { "dd.e2", 0x40000, 0xa9585df2, 7 | BRF_GRA }, // 24 - { "dd.f1", 0x40000, 0x9aed24ba, 7 | BRF_GRA }, // 25 - { "dd.f2", 0x40000, 0x3eb5783f, 7 | BRF_GRA }, // 26 - - { "7.x10", 0x10000, 0x9cbc7b41, 8 | BRF_SND }, // 27 Samples - - { "26.n2", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, - { "61-d.u3", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(dyndukea) -STD_ROM_FN(dyndukea) - -struct BurnDriver BurnDrvDyndukea = { - "dyndukea", "dynduke", NULL, NULL, "1989", - "Dynamite Duke (Europe, 25JUL89)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, dyndukeaRomInfo, dyndukeaRomName, NULL, NULL, DyndukeInputInfo, DyndukeDIPInfo, - dyndukeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Dynamite Duke (Japan, 03SEP89) - -static struct BurnRomInfo dyndukejRomDesc[] = { - { "1.cd8", 0x10000, 0xa5e2a95a, 1 | BRF_PRG | BRF_ESS }, // 0 V30 #0 Code - { "2.cd7", 0x10000, 0x7e51af22, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.e8", 0x20000, 0x98b9d243, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.e7", 0x20000, 0x4f575177, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "5.p8", 0x10000, 0x883d319c, 2 | BRF_PRG | BRF_ESS }, // 4 V30 #1 Code - { "6.p7", 0x10000, 0xd94cb4ff, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "8.w8", 0x10000, 0x3c29480b, 3 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "9.5k", 0x04000, 0xf2bc9af4, 4 | BRF_GRA }, // 7 Character Tiles - { "10.34k", 0x04000, 0xc2a9f19b, 4 | BRF_GRA }, // 8 - - { "dd.a2", 0x40000, 0x598f343f, 5 | BRF_GRA }, // 9 Background Tiles - { "dd.b2", 0x40000, 0x41a9088d, 5 | BRF_GRA }, // 10 - { "dd.c2", 0x40000, 0xcc341b42, 5 | BRF_GRA }, // 11 - { "dd.d2", 0x40000, 0x4752b4d7, 5 | BRF_GRA }, // 12 - { "dd.de3", 0x40000, 0x44a4cb62, 5 | BRF_GRA }, // 13 - { "dd.ef3", 0x40000, 0xaa8aee1a, 5 | BRF_GRA }, // 14 - - { "dd.mn3", 0x40000, 0x2ee0ca98, 6 | BRF_GRA }, // 15 Foreground Tiles - { "dd.mn4", 0x40000, 0x6c71e2df, 6 | BRF_GRA }, // 16 - { "dd.n45", 0x40000, 0x85d918e1, 6 | BRF_GRA }, // 17 - { "dd.mn5", 0x40000, 0xe71e34df, 6 | BRF_GRA }, // 18 - - { "dd.n1", 0x40000, 0xcf1db927, 7 | BRF_GRA }, // 19 Sprites - { "dd.n2", 0x40000, 0x5328150f, 7 | BRF_GRA }, // 20 - { "dd.m1", 0x40000, 0x80776452, 7 | BRF_GRA }, // 21 - { "dd.m2", 0x40000, 0xff61a573, 7 | BRF_GRA }, // 22 - { "dd.e1", 0x40000, 0x84a0b87c, 7 | BRF_GRA }, // 23 - { "dd.e2", 0x40000, 0xa9585df2, 7 | BRF_GRA }, // 24 - { "dd.f1", 0x40000, 0x9aed24ba, 7 | BRF_GRA }, // 25 - { "dd.f2", 0x40000, 0x3eb5783f, 7 | BRF_GRA }, // 26 - - { "7.x10", 0x10000, 0x9cbc7b41, 8 | BRF_SND }, // 27 Samples - - { "26.n2", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, - { "61-d.u3", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(dyndukej) -STD_ROM_FN(dyndukej) - -struct BurnDriver BurnDrvDyndukej = { - "dyndukej", "dynduke", NULL, NULL, "1989", - "Dynamite Duke (Japan, 03SEP89)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, dyndukejRomInfo, dyndukejRomName, NULL, NULL, DyndukeInputInfo, DyndukeDIPInfo, - dyndukeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Dynamite Duke (Japan, 25JUL89) - -static struct BurnRomInfo dyndukejaRomDesc[] = { - { "1.cd8", 0x10000, 0xa5e2a95a, 1 | BRF_PRG | BRF_ESS }, // 0 V30 #0 Code - { "2.cd7", 0x10000, 0x7e51af22, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.e8", 0x20000, 0x2f06ddce, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4j.e7", 0x20000, 0x63092078, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "5.p8", 0x10000, 0x883d319c, 2 | BRF_PRG | BRF_ESS }, // 4 V30 #1 Code - { "6.p7", 0x10000, 0xd94cb4ff, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "8.w8", 0x10000, 0x3c29480b, 3 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "9.5k", 0x04000, 0xf2bc9af4, 4 | BRF_GRA }, // 7 Character Tiles - { "10.34k", 0x04000, 0xc2a9f19b, 4 | BRF_GRA }, // 8 - - { "dd.a2", 0x40000, 0x598f343f, 5 | BRF_GRA }, // 9 Background Tiles - { "dd.b2", 0x40000, 0x41a9088d, 5 | BRF_GRA }, // 10 - { "dd.c2", 0x40000, 0xcc341b42, 5 | BRF_GRA }, // 11 - { "dd.d2", 0x40000, 0x4752b4d7, 5 | BRF_GRA }, // 12 - { "dd.de3", 0x40000, 0x44a4cb62, 5 | BRF_GRA }, // 13 - { "dd.ef3", 0x40000, 0xaa8aee1a, 5 | BRF_GRA }, // 14 - - { "dd.mn3", 0x40000, 0x2ee0ca98, 6 | BRF_GRA }, // 15 Foreground Tiles - { "dd.mn4", 0x40000, 0x6c71e2df, 6 | BRF_GRA }, // 16 - { "dd.n45", 0x40000, 0x85d918e1, 6 | BRF_GRA }, // 17 - { "dd.mn5", 0x40000, 0xe71e34df, 6 | BRF_GRA }, // 18 - - { "dd.n1", 0x40000, 0xcf1db927, 7 | BRF_GRA }, // 19 Sprites - { "dd.n2", 0x40000, 0x5328150f, 7 | BRF_GRA }, // 20 - { "dd.m1", 0x40000, 0x80776452, 7 | BRF_GRA }, // 21 - { "dd.m2", 0x40000, 0xff61a573, 7 | BRF_GRA }, // 22 - { "dd.e1", 0x40000, 0x84a0b87c, 7 | BRF_GRA }, // 23 - { "dd.e2", 0x40000, 0xa9585df2, 7 | BRF_GRA }, // 24 - { "dd.f1", 0x40000, 0x9aed24ba, 7 | BRF_GRA }, // 25 - { "dd.f2", 0x40000, 0x3eb5783f, 7 | BRF_GRA }, // 26 - - { "7.x10", 0x10000, 0x9cbc7b41, 8 | BRF_SND }, // 27 Samples - - { "26.n2", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, - { "61-d.u3", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(dyndukeja) -STD_ROM_FN(dyndukeja) - -struct BurnDriver BurnDrvDyndukeja = { - "dyndukeja", "dynduke", NULL, NULL, "1989", - "Dynamite Duke (Japan, 25JUL89)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, dyndukejaRomInfo, dyndukejaRomName, NULL, NULL, DyndukeInputInfo, DyndukeDIPInfo, - dyndukeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Dynamite Duke (US, 25JUL89) - -static struct BurnRomInfo dyndukeuRomDesc[] = { - { "1.cd8", 0x10000, 0xa5e2a95a, 1 | BRF_PRG | BRF_ESS }, // 0 V30 #0 Code - { "2.cd7", 0x10000, 0x7e51af22, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dd3.ef8", 0x20000, 0xa56f8692, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dd4.ef7", 0x20000, 0xee4b87b3, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "5.p8", 0x10000, 0x883d319c, 2 | BRF_PRG | BRF_ESS }, // 4 V30 #1 Code - { "6.p7", 0x10000, 0xd94cb4ff, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "8.w8", 0x10000, 0x3c29480b, 3 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "9.5k", 0x04000, 0xf2bc9af4, 4 | BRF_GRA }, // 7 Character Tiles - { "10.34k", 0x04000, 0xc2a9f19b, 4 | BRF_GRA }, // 8 - - { "dd.a2", 0x40000, 0x598f343f, 5 | BRF_GRA }, // 9 Background Tiles - { "dd.b2", 0x40000, 0x41a9088d, 5 | BRF_GRA }, // 10 - { "dd.c2", 0x40000, 0xcc341b42, 5 | BRF_GRA }, // 11 - { "dd.d2", 0x40000, 0x4752b4d7, 5 | BRF_GRA }, // 12 - { "dd.de3", 0x40000, 0x44a4cb62, 5 | BRF_GRA }, // 13 - { "dd.ef3", 0x40000, 0xaa8aee1a, 5 | BRF_GRA }, // 14 - - { "dd.mn3", 0x40000, 0x2ee0ca98, 6 | BRF_GRA }, // 15 Foreground Tiles - { "dd.mn4", 0x40000, 0x6c71e2df, 6 | BRF_GRA }, // 16 - { "dd.n45", 0x40000, 0x85d918e1, 6 | BRF_GRA }, // 17 - { "dd.mn5", 0x40000, 0xe71e34df, 6 | BRF_GRA }, // 18 - - { "dd.n1", 0x40000, 0xcf1db927, 7 | BRF_GRA }, // 19 Sprites - { "dd.n2", 0x40000, 0x5328150f, 7 | BRF_GRA }, // 20 - { "dd.m1", 0x40000, 0x80776452, 7 | BRF_GRA }, // 21 - { "dd.m2", 0x40000, 0xff61a573, 7 | BRF_GRA }, // 22 - { "dd.e1", 0x40000, 0x84a0b87c, 7 | BRF_GRA }, // 23 - { "dd.e2", 0x40000, 0xa9585df2, 7 | BRF_GRA }, // 24 - { "dd.f1", 0x40000, 0x9aed24ba, 7 | BRF_GRA }, // 25 - { "dd.f2", 0x40000, 0x3eb5783f, 7 | BRF_GRA }, // 26 - - { "7.x10", 0x10000, 0x9cbc7b41, 8 | BRF_SND }, // 27 Samples - - { "26.n2", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, - { "61-d.u3", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(dyndukeu) -STD_ROM_FN(dyndukeu) - -struct BurnDriver BurnDrvDyndukeu = { - "dyndukeu", "dynduke", NULL, NULL, "1989", - "Dynamite Duke (US, 25JUL89)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, dyndukeuRomInfo, dyndukeuRomName, NULL, NULL, DyndukeInputInfo, DyndukeDIPInfo, - dyndukeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// The Double Dynamites (Japan, 13NOV89) - -static struct BurnRomInfo dbldynjRomDesc[] = { - { "1.cd8", 0x10000, 0xa5e2a95a, 1 | BRF_PRG | BRF_ESS }, // 0 V30 #0 Code - { "2.cd7", 0x10000, 0x7e51af22, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3x.e8", 0x20000, 0x633db1fe, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4x.e7", 0x20000, 0xdc9ee263, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "5x.p8", 0x10000, 0xea56d719, 2 | BRF_PRG | BRF_ESS }, // 4 V30 #1 Code - { "6x.p7", 0x10000, 0x9ffa0ecd, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "8x.w8", 0x10000, 0xf4066081, 3 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "9x.5k", 0x04000, 0x913709e3, 4 | BRF_GRA }, // 7 Character Tiles - { "10x.34k", 0x04000, 0x405daacb, 4 | BRF_GRA }, // 8 - - { "dd.a2", 0x40000, 0x598f343f, 5 | BRF_GRA }, // 9 Background Tiles - { "dd.b2", 0x40000, 0x41a9088d, 5 | BRF_GRA }, // 10 - { "dd.c2", 0x40000, 0xcc341b42, 5 | BRF_GRA }, // 11 - { "dd.d2", 0x40000, 0x4752b4d7, 5 | BRF_GRA }, // 12 - { "dd.de3", 0x40000, 0x44a4cb62, 5 | BRF_GRA }, // 13 - { "dd.ef3", 0x40000, 0xaa8aee1a, 5 | BRF_GRA }, // 14 - - { "dd.mn3", 0x40000, 0x2ee0ca98, 6 | BRF_GRA }, // 15 Foreground Tiles - { "dd.mn4", 0x40000, 0x6c71e2df, 6 | BRF_GRA }, // 16 - { "dd.n45", 0x40000, 0x85d918e1, 6 | BRF_GRA }, // 17 - { "dd.mn5", 0x40000, 0xe71e34df, 6 | BRF_GRA }, // 18 - - { "dd.n1", 0x40000, 0xcf1db927, 7 | BRF_GRA }, // 19 Sprites - { "dd.n2", 0x40000, 0x5328150f, 7 | BRF_GRA }, // 20 - { "dd.m1", 0x40000, 0x80776452, 7 | BRF_GRA }, // 21 - { "dd.m2", 0x40000, 0xff61a573, 7 | BRF_GRA }, // 22 - { "dd.e1", 0x40000, 0x84a0b87c, 7 | BRF_GRA }, // 23 - { "dd.e2", 0x40000, 0xa9585df2, 7 | BRF_GRA }, // 24 - { "dd.f1", 0x40000, 0x9aed24ba, 7 | BRF_GRA }, // 25 - { "dd.f2", 0x40000, 0x3eb5783f, 7 | BRF_GRA }, // 26 - - { "7.x10", 0x10000, 0x9cbc7b41, 8 | BRF_SND }, // 27 Samples - - { "26.n2", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, - { "61-d.u3", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(dbldynj) -STD_ROM_FN(dbldynj) - -static INT32 dbldynjInit() -{ - return DrvInit(map_masterj_cpu); -} - -struct BurnDriver BurnDrvDbldynj = { - "dbldynj", NULL, NULL, NULL, "1989", - "The Double Dynamites (Japan, 13NOV89)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, dbldynjRomInfo, dbldynjRomName, NULL, NULL, DyndukeInputInfo, DyndukeDIPInfo, - dbldynjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// The Double Dynamites (US, 13NOV89) - -static struct BurnRomInfo dbldynuRomDesc[] = { - { "1.cd8", 0x10000, 0xa5e2a95a, 1 | BRF_PRG | BRF_ESS }, // 0 V30 #0 Code - { "2.cd7", 0x10000, 0x7e51af22, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dd3x.8e", 0x20000, 0x9b785028, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dd4x.7e", 0x20000, 0x0d0f6350, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "5x.p8", 0x10000, 0xea56d719, 2 | BRF_PRG | BRF_ESS }, // 4 V30 #1 Code - { "6x.p7", 0x10000, 0x9ffa0ecd, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "8x.w8", 0x10000, 0xf4066081, 3 | BRF_PRG | BRF_ESS }, // 6 Z80 Code - - { "9x.5k", 0x04000, 0x913709e3, 4 | BRF_GRA }, // 7 Character Tiles - { "10x.34k", 0x04000, 0x405daacb, 4 | BRF_GRA }, // 8 - - { "dd.a2", 0x40000, 0x598f343f, 5 | BRF_GRA }, // 9 Background Tiles - { "dd.b2", 0x40000, 0x41a9088d, 5 | BRF_GRA }, // 10 - { "dd.c2", 0x40000, 0xcc341b42, 5 | BRF_GRA }, // 11 - { "dd.d2", 0x40000, 0x4752b4d7, 5 | BRF_GRA }, // 12 - { "dd.de3", 0x40000, 0x44a4cb62, 5 | BRF_GRA }, // 13 - { "dd.ef3", 0x40000, 0xaa8aee1a, 5 | BRF_GRA }, // 14 - - { "dd.mn3", 0x40000, 0x2ee0ca98, 6 | BRF_GRA }, // 15 Foreground Tiles - { "dd.mn4", 0x40000, 0x6c71e2df, 6 | BRF_GRA }, // 16 - { "dd.n45", 0x40000, 0x85d918e1, 6 | BRF_GRA }, // 17 - { "dd.mn5", 0x40000, 0xe71e34df, 6 | BRF_GRA }, // 18 - - { "dd.n1", 0x40000, 0xcf1db927, 7 | BRF_GRA }, // 19 Sprites - { "dd.n2", 0x40000, 0x5328150f, 7 | BRF_GRA }, // 20 - { "dd.m1", 0x40000, 0x80776452, 7 | BRF_GRA }, // 21 - { "dd.m2", 0x40000, 0xff61a573, 7 | BRF_GRA }, // 22 - { "dd.e1", 0x40000, 0x84a0b87c, 7 | BRF_GRA }, // 23 - { "dd.e2", 0x40000, 0xa9585df2, 7 | BRF_GRA }, // 24 - { "dd.f1", 0x40000, 0x9aed24ba, 7 | BRF_GRA }, // 25 - { "dd.f2", 0x40000, 0x3eb5783f, 7 | BRF_GRA }, // 26 - - { "7.x10", 0x10000, 0x9cbc7b41, 8 | BRF_SND }, // 27 Samples - - { "26.n2", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, - { "61-d.u3", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(dbldynu) -STD_ROM_FN(dbldynu) - -struct BurnDriver BurnDrvDbldynu = { - "dbldynu", "dbldynj", NULL, NULL, "1989", - "The Double Dynamites (US, 13NOV89)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, dbldynuRomInfo, dbldynuRomName, NULL, NULL, DyndukeInputInfo, DyndukeDIPInfo, - dyndukeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_epos.cpp b/jan/src/burn/drv/pre90s/d_epos.cpp deleted file mode 100644 index 8ea1cdec1..000000000 --- a/jan/src/burn/drv/pre90s/d_epos.cpp +++ /dev/null @@ -1,1042 +0,0 @@ -// FB Alpha Epos Tristar Hardware driver module -// Based on MAME driver by Zsolt Vasvari - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "8255ppi.h" -#include "bitswap.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; - -static INT16* pAY8910Buffer[3]; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static UINT8 *DrvPaletteBank; -static UINT8 *DealerZ80Bank; -static UINT8 *DealerZ80Bank2; -static UINT8 *DealerInputMultiplex; - -static UINT8 dealer_hw = 0; - -static int watchdog; - -static struct BurnInputInfo MegadonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Megadon) - -static struct BurnInputInfo SuprglobInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Suprglob) - -static struct BurnInputInfo Revngr84InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - - {"Service Mode", BIT_DIGITAL, DrvJoy3 + 7, "diag"}, - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Revngr84) - -static struct BurnInputInfo DealerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p1 coin" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dealer) - - -static struct BurnDIPInfo MegadonDIPList[]= -{ - {0x07, 0xff, 0xff, 0x28, NULL }, - {0x08, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x07, 0x01, 0x01, 0x00, "1 Coin 1 Credits " }, - {0x07, 0x01, 0x01, 0x01, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "Fuel Consumption" }, - {0x07, 0x01, 0x02, 0x00, "Slow" }, - {0x07, 0x01, 0x02, 0x02, "Fast" }, - - {0 , 0xfe, 0 , 2, "Rotation" }, - {0x07, 0x01, 0x04, 0x04, "Slow" }, - {0x07, 0x01, 0x04, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2, "ERG" }, - {0x07, 0x01, 0x08, 0x08, "Easy" }, - {0x07, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Enemy Fire Rate" }, - {0x07, 0x01, 0x20, 0x20, "Slow" }, - {0x07, 0x01, 0x20, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x07, 0x01, 0x50, 0x00, "3" }, - {0x07, 0x01, 0x50, 0x10, "4" }, - {0x07, 0x01, 0x50, 0x40, "5" }, - {0x07, 0x01, 0x50, 0x50, "6" }, - - {0 , 0xfe, 0 , 2, "Game Mode" }, - {0x07, 0x01, 0x80, 0x00, "Arcade" }, - {0x07, 0x01, 0x80, 0x80, "Contest" }, -}; - -STDDIPINFO(Megadon) - -static struct BurnDIPInfo SuprglobDIPList[]= -{ - // Default Values - {0x09, 0xff, 0xff, 0x00, NULL }, - {0x0A, 0xff, 0xff, 0xbe, NULL }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x09, 0x01, 0x01, 0x00, "1 Coin 1 Credits " }, - {0x09, 0x01, 0x01, 0x01, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x09, 0x01, 0x08, 0x00, "10000 + Difficulty * 10000" }, - {0x09, 0x01, 0x08, 0x08, "90000 + Difficulty * 10000" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x09, 0x01, 0x26, 0x00, "1" }, - {0x09, 0x01, 0x26, 0x02, "2" }, - {0x09, 0x01, 0x26, 0x20, "3" }, - {0x09, 0x01, 0x26, 0x22, "4" }, - {0x09, 0x01, 0x26, 0x04, "5" }, - {0x09, 0x01, 0x26, 0x06, "6" }, - {0x09, 0x01, 0x26, 0x24, "7" }, - {0x09, 0x01, 0x26, 0x26, "8" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x09, 0x01, 0x50, 0x00, "3" }, - {0x09, 0x01, 0x50, 0x10, "4" }, - {0x09, 0x01, 0x50, 0x40, "5" }, - {0x09, 0x01, 0x50, 0x50, "6" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x09, 0x01, 0x80, 0x80, "Off" }, - {0x09, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Suprglob) - -static struct BurnDIPInfo IgmoDIPList[]= -{ - {0x09, 0xff, 0xff, 0x00, NULL }, - {0x0A, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x09, 0x01, 0x01, 0x00, "1 Coin 1 Credits " }, - {0x09, 0x01, 0x01, 0x01, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x09, 0x01, 0x22, 0x00, "20000" }, - {0x09, 0x01, 0x22, 0x02, "40000" }, - {0x09, 0x01, 0x22, 0x20, "60000" }, - {0x09, 0x01, 0x22, 0x22, "80000" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x09, 0x01, 0x50, 0x00, "3" }, - {0x09, 0x01, 0x50, 0x10, "4" }, - {0x09, 0x01, 0x50, 0x40, "5" }, - {0x09, 0x01, 0x50, 0x50, "6" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x09, 0x01, 0x8c, 0x00, "1" }, - {0x09, 0x01, 0x8c, 0x04, "2" }, - {0x09, 0x01, 0x8c, 0x08, "3" }, - {0x09, 0x01, 0x8c, 0x0c, "4" }, - {0x09, 0x01, 0x8c, 0x80, "5" }, - {0x09, 0x01, 0x8c, 0x84, "6" }, - {0x09, 0x01, 0x8c, 0x88, "7" }, - {0x09, 0x01, 0x8c, 0x8c, "8" }, -}; - -STDDIPINFO(Igmo) - -static struct BurnDIPInfo CatapultDIPList[]= -{ - {0x09, 0xff, 0xff, 0x00, NULL }, - {0x0A, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x09, 0x01, 0x01, 0x00, "1 Coin 1 Credits " }, - {0x09, 0x01, 0x01, 0x01, "1 Coin 2 Credits " }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x09, 0x01, 0x0c, 0x00, "20000" }, - {0x09, 0x01, 0x0c, 0x04, "40000" }, - {0x09, 0x01, 0x0c, 0x08, "60000" }, - {0x09, 0x01, 0x0c, 0x0c, "80000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x09, 0x01, 0x22, 0x00, "1" }, - {0x09, 0x01, 0x22, 0x02, "2" }, - {0x09, 0x01, 0x22, 0x20, "3" }, - {0x09, 0x01, 0x22, 0x22, "4" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x09, 0x01, 0x50, 0x00, "3" }, - {0x09, 0x01, 0x50, 0x10, "4" }, - {0x09, 0x01, 0x50, 0x40, "5" }, - {0x09, 0x01, 0x50, 0x50, "6" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x09, 0x01, 0x80, 0x80, "Off" }, - {0x09, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Catapult) - -static struct BurnDIPInfo DealerDIPList[]= -{ - {0x08, 0xff, 0xff, 0xfe, NULL }, - {0x09, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x08, 0x01, 0x01, 0x01, "Off" }, - {0x08, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x08, 0x01, 0x02, 0x02, "Off" }, - {0x08, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x08, 0x01, 0x40, 0x40, "Upright" }, - {0x08, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x08, 0x01, 0x80, 0x80, "Off" }, - {0x08, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dealer) - -static struct BurnDIPInfo Revngr84DIPList[]= -{ - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x40, "Upright" }, - {0x11, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Revngr84) - -UINT8 __fastcall epos_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return DrvDips[0]; - - case 0x01: - return DrvInputs[0]; - - case 0x02: - return DrvInputs[1]; - - case 0x03: - return 0; - } - - return 0; -} - -void __fastcall epos_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - watchdog = 0; - return; - - case 0x01: - *DrvPaletteBank = (data << 1) & 0x10; - return; - - case 0x02: - AY8910Write(0, 1, data); - return; - - case 0x06: - AY8910Write(0, 0, data); - return; - } -} - -static void dealer_set_bank() -{ - ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM + (*DealerZ80Bank << 16)); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM + (*DealerZ80Bank << 16)); -} - -static void dealer_bankswitch(INT32 offset) -{ - INT32 nBank = *DealerZ80Bank; - - if (offset & 4) { - nBank = (nBank + 1) & 3; - } else { - nBank = (nBank - 1) & 3; - } - - *DealerZ80Bank = nBank; - - dealer_set_bank(); -} - -static void dealer_bankswitch2(INT32 data) -{ - *DealerZ80Bank2 = data & 1; - - INT32 nBank = 0x6000 + ((data & 1) << 12); - ZetMapArea(0x6000, 0x6fff, 0, DrvZ80ROM + nBank); - ZetMapArea(0x6000, 0x6fff, 2, DrvZ80ROM + nBank); -} - -UINT8 __fastcall dealer_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x10: - case 0x11: - case 0x12: - case 0x13: - return ppi8255_r(0, port & 3); - - case 0x38: - return AY8910Read(0); //DrvDips[0]; - } - bprintf(0, _T("unmapped port %X. "), port); - return 0; -} - -static void set_pal(UINT8 offs, UINT8 value); - -void __fastcall dealer_write_port(UINT16 port, UINT8 data) -{ - port &= 0xff; - - if (port < 0x10) { // ram pal writes 0 - 0x0f - set_pal(port, data); - } - - switch (port & 0xff) - { - case 0x10: - case 0x11: - case 0x12: - case 0x13: - ppi8255_w(0, port & 3, data); - return; - - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - dealer_bankswitch(port & 7); - return; - - case 0x34: - AY8910Write(0, 1, data); - return; - - case 0x3c: - AY8910Write(0, 0, data); - return; - - case 0x40: - watchdog = 0; - return; - } -} - -UINT8 DealerPPIReadA() -{ - if (!(*DealerInputMultiplex & 1)) - return DrvInputs[1]; - - if (!(*DealerInputMultiplex & 2)) - return DrvInputs[2]; - - return 0xff; -} - -void DealerPPIWriteC(UINT8 data) -{ - dealer_bankswitch2(data); - *DealerInputMultiplex = (data >> 5) & 3; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - if (dealer_hw) { - BurnLoadRom(DrvZ80RAM + 0x0000, 5, 1); // NVRAM? nofail. - } - - ZetOpen(0); - ZetReset(); - dealer_set_bank(); - dealer_bankswitch2(0); - ZetClose(); - - AY8910Reset(0); - - watchdog = 0; - - return 0; -} - -static void DrvColPromInit(INT32 num) -{ - UINT8 prom[32] = { // in case the set lacks a prom dump - 0x00, 0xE1, 0xC3, 0xFC, 0xEC, 0xF8, 0x34, 0xFF, - 0x17, 0xF0, 0xEE, 0xEF, 0xAC, 0xC2, 0x1C, 0x07, - 0x00, 0xE1, 0xC3, 0xFC, 0xEC, 0xF8, 0x34, 0xFF, - 0x17, 0xF0, 0xEE, 0xEF, 0xAC, 0xC2, 0x1C, 0x07 - }; - - memcpy (DrvColPROM, prom, 32); - - BurnLoadRom(DrvColPROM, num, 1); -} - -static void set_pal(UINT8 offs, UINT8 value) -{ - UINT32 p = BITSWAP24(value, 7,6,5,7,6,6,7,5,4,3,2,4,3,3,4,2,1,0,1,0,1,1,0,1); - DrvPalette[offs & 0x0f] = BurnHighCol((p >> 16) & 0xff, (p >> 8) & 0xff, p & 0xff, 0); -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x20; i++) { - UINT32 p = BITSWAP24(DrvColPROM[i], 7,6,5,7,6,6,7,5,4,3,2,4,3,3,4,2,1,0,1,0,1,1,0,1); - DrvPalette[i] = BurnHighCol((p >> 16) & 0xff, (p >> 8) & 0xff, p & 0xff, 0); - } -} - -static void DealerDecode() -{ - for (INT32 i = 0;i < 0x8000;i++) - DrvZ80ROM[i + 0x00000] = BITSWAP08(DrvZ80ROM[i] ^ 0xbd, 2,6,4,0,5,7,1,3); - - for (INT32 i = 0;i < 0x8000;i++) - DrvZ80ROM[i + 0x10000] = BITSWAP08(DrvZ80ROM[i] ^ 0x00, 7,5,4,6,3,2,1,0); - - for (INT32 i = 0;i < 0x8000;i++) - DrvZ80ROM[i + 0x20000] = BITSWAP08(DrvZ80ROM[i] ^ 0x01, 7,6,5,4,3,0,2,1); - - for (INT32 i = 0;i < 0x8000;i++) - DrvZ80ROM[i + 0x30000] = BITSWAP08(DrvZ80ROM[i] ^ 0x01, 7,5,4,6,3,0,2,1); -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32); - - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x008000; - - DrvPaletteBank = Next; Next += 0x000001; - DealerZ80Bank = Next; Next += 0x000001; - DealerZ80Bank2 = Next; Next += 0x000001; - DealerInputMultiplex = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x3000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x5000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x6000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x7000, 7, 1)) return 1; - - DrvColPromInit(8); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x77ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x77ff, 2, DrvZ80ROM); - ZetMapArea(0x7800, 0x7fff, 0, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 1, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 2, DrvZ80RAM); - ZetMapArea(0x8000, 0xffff, 0, DrvVidRAM); - ZetMapArea(0x8000, 0xffff, 1, DrvVidRAM); - ZetMapArea(0x8000, 0xffff, 2, DrvVidRAM); - ZetSetInHandler(epos_read_port); - ZetSetOutHandler(epos_write_port); - ZetClose(); - - AY8910Init(0, 2750000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.35, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static UINT8 AY8910_0_portA(UINT32) -{ - return DrvDips[0]; -} - -static INT32 DealerInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x6000, 3, 1)) return 1; - BurnLoadRom(DrvZ80RAM + 0x0000, 5, 1); // NVRAM? nofail. - - DrvColPromInit(4); - DrvPaletteInit(); - DealerDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x6fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x7000, 0x7fff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x8000, 0xffff, MAP_RAM); - ZetSetInHandler(dealer_read_port); - ZetSetOutHandler(dealer_write_port); - ZetClose(); - - AY8910Init(0, 2750000, nBurnSoundRate, AY8910_0_portA, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - - ppi8255_init(1); - PPI0PortReadA = DealerPPIReadA; - PPI0PortWriteC = DealerPPIWriteC; - - GenericTilesInit(); - - dealer_hw = 1; - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - AY8910Exit(0); - ZetExit(); - - if (PPI0PortReadA) { - ppi8255_exit(); - } - - BurnFree(AllMem); - - dealer_hw = 0; - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 0; i < 0x8000; i++) - { - INT32 x = (i % 136) << 1; - INT32 y = (i / 136); - if (y > 235) break; - - pTransDraw[(y * nScreenWidth) + x + 0] = *DrvPaletteBank | ((DrvVidRAM[i] >> 0) & 0x0f); - pTransDraw[(y * nScreenWidth) + x + 1] = *DrvPaletteBank | ((DrvVidRAM[i] >> 4) & 0x0f); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - DrvInputs[0] = DrvDips[1]; - DrvInputs[1] = 0xff; - DrvInputs[2] = 0xff; - for (INT32 i = 0; i < 8; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - ZetOpen(0); - ZetRun(2750000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - if (PPI0PortReadA) { - ppi8255_scan(); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - dealer_set_bank(); - dealer_bankswitch2(*DealerZ80Bank2); - ZetClose(); - } - } - } - - return 0; -} - - -// Megadon - -static struct BurnRomInfo megadonRomDesc[] = { - { "2732u10b.bin", 0x1000, 0xaf8fbe80, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "2732u09b.bin", 0x1000, 0x097d1e73, BRF_ESS | BRF_PRG }, // 1 - { "2732u08b.bin", 0x1000, 0x526784da, BRF_ESS | BRF_PRG }, // 2 - { "2732u07b.bin", 0x1000, 0x5b060910, BRF_ESS | BRF_PRG }, // 3 - { "2732u06b.bin", 0x1000, 0x8ac8af6d, BRF_ESS | BRF_PRG }, // 4 - { "2732u05b.bin", 0x1000, 0x052bb603, BRF_ESS | BRF_PRG }, // 5 - { "2732u04b.bin", 0x1000, 0x9b8b7e92, BRF_ESS | BRF_PRG }, // 6 - { "2716u11b.bin", 0x0800, 0x599b8b61, BRF_ESS | BRF_PRG }, // 7 - - { "74s288.bin", 0x0020, 0xc779ea99, BRF_GRA }, // 8 Color PROM -}; - -STD_ROM_PICK(megadon) -STD_ROM_FN(megadon) - -struct BurnDriver BurnDrvMegadon = { - "megadon", NULL, NULL, NULL, "1982", - "Megadon\0", NULL, "Epos Corporation (Photar Industries License)", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 1, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, megadonRomInfo, megadonRomName, NULL, NULL, MegadonInputInfo, MegadonDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; - - -// Catapult - -static struct BurnRomInfo catapultRomDesc[] = { - { "co3223.u10", 0x1000, 0x50abcfd2, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "co3223.u09", 0x1000, 0xfd5a9a1c, BRF_ESS | BRF_PRG }, // 1 - { "co3223.u08", 0x1000, 0x4bfc36f3, BRF_ESS | BRF_PRG }, // 2 - { "co3223.u07", 0x1000, 0x4113bb99, BRF_ESS | BRF_PRG }, // 3 - { "co3223.u06", 0x1000, 0x966bb9f5, BRF_ESS | BRF_PRG }, // 4 - { "co3223.u05", 0x1000, 0x65f9fb9a, BRF_ESS | BRF_PRG }, // 5 - { "co3223.u04", 0x1000, 0x648453bc, BRF_ESS | BRF_PRG }, // 6 - { "co3223.u11", 0x0800, 0x08fb8c28, BRF_ESS | BRF_PRG }, // 7 - - { "co3223.u66", 0x0020, 0xe7de76a7, BRF_GRA }, // 8 Color PROM -}; - -STD_ROM_PICK(catapult) -STD_ROM_FN(catapult) - -struct BurnDriverD BurnDrvCatapult = { - "catapult", NULL, NULL, NULL, "1982", - "Catapult\0", "Bad dump", "Epos Corporation", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_ORIENTATION_VERTICAL, 1, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, catapultRomInfo, catapultRomName, NULL, NULL, SuprglobInputInfo, CatapultDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; - - -// Super Glob - -static struct BurnRomInfo suprglobRomDesc[] = { - { "u10", 0x1000, 0xc0141324, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "u9", 0x1000, 0x58be8128, BRF_ESS | BRF_PRG }, // 1 - { "u8", 0x1000, 0x6d088c16, BRF_ESS | BRF_PRG }, // 2 - { "u7", 0x1000, 0xb2768203, BRF_ESS | BRF_PRG }, // 3 - { "u6", 0x1000, 0x976c8f46, BRF_ESS | BRF_PRG }, // 4 - { "u5", 0x1000, 0x340f5290, BRF_ESS | BRF_PRG }, // 5 - { "u4", 0x1000, 0x173bd589, BRF_ESS | BRF_PRG }, // 6 - { "u11", 0x0800, 0xd45b740d, BRF_ESS | BRF_PRG }, // 7 - - { "82s123.u66", 0x0020, 0xf4f6ddc5, BRF_GRA }, // 8 Color PROM -}; - -STD_ROM_PICK(suprglob) -STD_ROM_FN(suprglob) - -struct BurnDriver BurnDrvSuprglob = { - "suprglob", NULL, NULL, NULL, "1983", - "Super Glob\0", NULL, "Epos Corporation", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 1, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, suprglobRomInfo, suprglobRomName, NULL, NULL, SuprglobInputInfo, SuprglobDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; - - -// The Glob - -static struct BurnRomInfo theglobRomDesc[] = { - { "globu10.bin", 0x1000, 0x08fdb495, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "globu9.bin", 0x1000, 0x827cd56c, BRF_ESS | BRF_PRG }, // 1 - { "globu8.bin", 0x1000, 0xd1219966, BRF_ESS | BRF_PRG }, // 2 - { "globu7.bin", 0x1000, 0xb1649da7, BRF_ESS | BRF_PRG }, // 3 - { "globu6.bin", 0x1000, 0xb3457e67, BRF_ESS | BRF_PRG }, // 4 - { "globu5.bin", 0x1000, 0x89d582cd, BRF_ESS | BRF_PRG }, // 5 - { "globu4.bin", 0x1000, 0x7ee9fdeb, BRF_ESS | BRF_PRG }, // 6 - { "globu11.bin", 0x0800, 0x9e05dee3, BRF_ESS | BRF_PRG }, // 7 - - { "82s123.u66", 0x0020, 0xf4f6ddc5, BRF_GRA }, // 8 Color PROM -}; - -STD_ROM_PICK(theglob) -STD_ROM_FN(theglob) - -struct BurnDriver BurnDrvTheglob = { - "theglob", "suprglob", NULL, NULL, "1983", - "The Glob\0", NULL, "Epos Corporation", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 1, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, theglobRomInfo, theglobRomName, NULL, NULL, SuprglobInputInfo, SuprglobDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; - - -// The Glob (earlier) - -static struct BurnRomInfo theglob2RomDesc[] = { - { "611293.u10", 0x1000, 0x870af7ce, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "611293.u9", 0x1000, 0xa3679782, BRF_ESS | BRF_PRG }, // 1 - { "611293.u8", 0x1000, 0x67499d1a, BRF_ESS | BRF_PRG }, // 2 - { "611293.u7", 0x1000, 0x55e53aac, BRF_ESS | BRF_PRG }, // 3 - { "611293.u6", 0x1000, 0xc64ad743, BRF_ESS | BRF_PRG }, // 4 - { "611293.u5", 0x1000, 0xf93c3203, BRF_ESS | BRF_PRG }, // 5 - { "611293.u4", 0x1000, 0xceea0018, BRF_ESS | BRF_PRG }, // 6 - { "611293.u11", 0x0800, 0x6ac83f9b, BRF_ESS | BRF_PRG }, // 7 - - { "82s123.u66", 0x0020, 0xf4f6ddc5, BRF_GRA }, // 8 Color PROM -}; - -STD_ROM_PICK(theglob2) -STD_ROM_FN(theglob2) - -struct BurnDriver BurnDrvTheglob2 = { - "theglob2", "suprglob", NULL, NULL, "1983", - "The Glob (earlier)\0", NULL, "Epos Corporation", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 1, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, theglob2RomInfo, theglob2RomName, NULL, NULL, SuprglobInputInfo, SuprglobDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; - - -// The Glob (set 3) - -static struct BurnRomInfo theglob3RomDesc[] = { - { "theglob3.u10", 0x1000, 0x969cfaf6, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "theglob3.u9", 0x1000, 0x8e6c010a, BRF_ESS | BRF_PRG }, // 1 - { "theglob3.u8", 0x1000, 0x1c1ca5c8, BRF_ESS | BRF_PRG }, // 2 - { "theglob3.u7", 0x1000, 0xa54b9d22, BRF_ESS | BRF_PRG }, // 3 - { "theglob3.u6", 0x1000, 0x5a6f82a9, BRF_ESS | BRF_PRG }, // 4 - { "theglob3.u5", 0x1000, 0x72f935db, BRF_ESS | BRF_PRG }, // 5 - { "theglob3.u4", 0x1000, 0x81db53ad, BRF_ESS | BRF_PRG }, // 6 - { "theglob3.u11", 0x0800, 0x0e2e6359, BRF_ESS | BRF_PRG }, // 7 - - { "82s123.u66", 0x0020, 0xf4f6ddc5, BRF_GRA }, // 8 Color PROM -}; - -STD_ROM_PICK(theglob3) -STD_ROM_FN(theglob3) - -struct BurnDriver BurnDrvTheglob3 = { - "theglob3", "suprglob", NULL, NULL, "1983", - "The Glob (set 3)\0", NULL, "Epos Corporation", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 1, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, theglob3RomInfo, theglob3RomName, NULL, NULL, SuprglobInputInfo, SuprglobDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; - - -// IGMO - -static struct BurnRomInfo igmoRomDesc[] = { - { "igmo-u10.732", 0x1000, 0xa9f691a4, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "igmo-u9.732", 0x1000, 0x3c133c97, BRF_ESS | BRF_PRG }, // 1 - { "igmo-u8.732", 0x1000, 0x5692f8d8, BRF_ESS | BRF_PRG }, // 2 - { "igmo-u7.732", 0x1000, 0x630ae2ed, BRF_ESS | BRF_PRG }, // 3 - { "igmo-u6.732", 0x1000, 0xd3f20e1d, BRF_ESS | BRF_PRG }, // 4 - { "igmo-u5.732", 0x1000, 0xe26bb391, BRF_ESS | BRF_PRG }, // 5 - { "igmo-u4.732", 0x1000, 0x762a4417, BRF_ESS | BRF_PRG }, // 6 - { "igmo-u11.716", 0x0800, 0x8c675837, BRF_ESS | BRF_PRG }, // 7 - - { "82s123.u66", 0x0020, 0x00000000, BRF_GRA | BRF_NODUMP }, // 8 Color Prom (missing) -}; - -STD_ROM_PICK(igmo) -STD_ROM_FN(igmo) - -struct BurnDriver BurnDrvIgmo = { - "igmo", NULL, NULL, NULL, "1984", - "IGMO\0", "Incorrect Colors", "Epos Corporation", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 1, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, igmoRomInfo, igmoRomName, NULL, NULL, SuprglobInputInfo, IgmoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; - - -// The Dealer - -static struct BurnRomInfo dealerRomDesc[] = { - { "u1.bin", 0x2000, 0xe06f3563, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "u2.bin", 0x2000, 0x726bbbd6, BRF_ESS | BRF_PRG }, // 1 - { "u3.bin", 0x2000, 0xab721455, BRF_ESS | BRF_PRG }, // 2 - { "u4.bin", 0x2000, 0xddb903e4, BRF_ESS | BRF_PRG }, // 3 - - //{ "82s123.u66", 0x0020, 0x00000000, BRF_GRA | BRF_NODUMP }, // 4 Color Prom (missing) - { "dealer.nv", 0x1000, 0xa6f88459, BRF_GRA }, // 5 NVRAM -}; - -STD_ROM_PICK(dealer) -STD_ROM_FN(dealer) - -struct BurnDriver BurnDrvDealer = { - "dealer", NULL, NULL, NULL, "198?", - "The Dealer\0", "Incorrect Colors", "Epos Corporation", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 1, HARDWARE_MISC_PRE90S, GBF_CASINO, 0, - NULL, dealerRomInfo, dealerRomName, NULL, NULL, DealerInputInfo, DealerDIPInfo, - DealerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; - - -// Revenger '84 (set 1) - -static struct BurnRomInfo revngr84RomDesc[] = { - { "u_1__revenger__r06254__(c)_epos_corp.m5l2764k.u1", 0x2000, 0x308f231f, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "u_2__revenger__r06254__(c)_epos_corp.m5l2764k.u2", 0x2000, 0xe80bbfb4, BRF_ESS | BRF_PRG }, // 1 - { "u_3__revenger__r06254__(c)_epos_corp.m5l2764k.u3", 0x2000, 0xd9270929, BRF_ESS | BRF_PRG }, // 2 - { "u_4__revenger__r06254__(c)_epos_corp.m5l2764k.u4", 0x2000, 0xd6e6cfa8, BRF_ESS | BRF_PRG }, // 3 - - { "dm74s288n.u60", 0x0020, 0xbe2b0641, BRF_GRA }, // 4 Color Prom - { "revngr84.nv", 0x1000, 0xa4417770, BRF_GRA }, // 5 NVRAM -}; - -STD_ROM_PICK(revngr84) -STD_ROM_FN(revngr84) - -struct BurnDriver BurnDrvRevngr84 = { - "revngr84", NULL, NULL, NULL, "1984", - "Revenger '84 (set 1)\0", NULL, "Epos Corporation", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 1, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, revngr84RomInfo, revngr84RomName, NULL, NULL, Revngr84InputInfo, Revngr84DIPInfo, - DealerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; - -// Revenger '84 (set 2) - -static struct BurnRomInfo revengerRomDesc[] = { - { "r06124.u1", 0x2000, 0xfad1a2a5, BRF_ESS | BRF_PRG }, // 0 Z80 code - { "r06124.u2", 0x2000, 0xa8e0ee7b, BRF_ESS | BRF_PRG }, // 1 - { "r06124.u3", 0x2000, 0xcca414a5, BRF_ESS | BRF_PRG }, // 2 - { "r06124.u4", 0x2000, 0x0b81c303, BRF_ESS | BRF_PRG }, // 3 - - { "dm74s288n.u60", 0x0020, 0xbe2b0641, BRF_GRA }, // 4 Color Prom - { "revngr84.nv", 0x1000, 0xa4417770, BRF_GRA }, // 5 NVRAM -}; - -STD_ROM_PICK(revenger) -STD_ROM_FN(revenger) - -struct BurnDriver BurnDrvRevenger = { - "revenger", "revngr84", NULL, NULL, "1984", - "Revenger '84 (set 2)\0", "Bad dump", "Epos Corporation", "EPOS Tristar", - NULL, NULL, NULL, NULL, - BDF_ORIENTATION_VERTICAL | BDF_CLONE, 1, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, revengerRomInfo, revengerRomName, NULL, NULL, Revngr84InputInfo, Revngr84DIPInfo, - DealerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 236, 272, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_exedexes.cpp b/jan/src/burn/drv/pre90s/d_exedexes.cpp deleted file mode 100644 index f1ae90a75..000000000 --- a/jan/src/burn/drv/pre90s/d_exedexes.cpp +++ /dev/null @@ -1,757 +0,0 @@ -// FB Alpha Exed Exes driver module -// Based on MAME driver by Richard Davies, Paul Swan, and various others - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvTransTable; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 soundlatch; -static UINT8 txt_enable; -static UINT8 bg_enable; -static UINT8 fg_enable; -static UINT8 spr_enable; -static UINT16 fg_scrolly; -static UINT16 fg_scrollx; -static UINT16 bg_scrollx; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 7, "p2 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 0, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 1, "p1 left" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy2 + 2, "p1 down" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy2 + 3, "p1 up" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 0, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 1, "p2 left" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 2, "p2 down" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 3, "p2 up" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p2 fire 2"}, - - {"Service" , BIT_DIGITAL , DrvJoy1 + 5, "service" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDips + 0, "dip 1" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDips + 1, "dip 2" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x12, 0xff, 0xff, 0xdf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "1" }, - {0x12, 0x01, 0x0c, 0x04, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "2 Players Game" }, - {0x12, 0x01, 0x10, 0x00, "1 Credit" }, - {0x12, 0x01, 0x10, 0x10, "2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x12, 0x01, 0x20, 0x00, "English" }, - {0x12, 0x01, 0x20, 0x20, "Japanese" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x00, "4 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x08, "3 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 5 Plays" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x40, 0x00, "No" }, - {0x13, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Drv) - -static UINT8 __fastcall exedexes_main_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - case 0xc002: - return DrvInputs[address & 3]; - - case 0xc003: - case 0xc004: - return DrvDips[~address & 1]; - } - - return 0; -} - -static void __fastcall exedexes_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc800: - soundlatch = data; - break; - - case 0xc804: - txt_enable = data & 0x80; - break; - - case 0xc806: - break; - - case 0xd800: - fg_scrolly = (fg_scrolly & 0xff00) | (data << 0); - break; - - case 0xd801: - fg_scrolly = (fg_scrolly & 0x00ff) | (data << 8); - break; - - case 0xd802: - fg_scrollx = (fg_scrollx & 0xff00) | (data << 0); - break; - - case 0xd803: - fg_scrollx = (fg_scrollx & 0x00ff) | (data << 8); - break; - - case 0xd804: - bg_scrollx = (bg_scrollx & 0xff00) | (data << 0); - break; - - case 0xd805: - bg_scrollx = (bg_scrollx & 0x00ff) | (data << 8); - break; - - case 0xd807: - bg_enable = data & 0x10; - fg_enable = data & 0x20; - spr_enable = data & 0x40; - break; - } -} - -static UINT8 __fastcall exedexes_sound_read(UINT16 address) -{ - switch (address) - { - case 0x6000: - return soundlatch; - } - - return 0; -} - -static void __fastcall exedexes_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8000: - case 0x8001: - AY8910Write(0, address & 1, data); - break; - - case 0x8002: - case 0x8003: - SN76496Write(address & 1, data); - break; - } -} - -static tilemap_callback( background ) -{ - INT32 attr = DrvGfxROM4[offs]; - - TILE_SET_INFO(1, attr & 0x3f, DrvGfxROM4[offs + 0x40], TILE_FLIPYX(attr >> 6)); -} - -static tilemap_callback( foreground ) -{ - TILE_SET_INFO(2, DrvGfxROM4[offs], 0, 0); -} - -static tilemap_callback( text ) -{ - INT32 attr = DrvColRAM[offs]; - - TILE_SET_INFO(0, DrvVidRAM[offs] + ((attr & 0x80) << 1), attr & 0x3f, 0); - - // hacky - attr = (attr & 0x3f) << 2; - GenericTilemapSetTransTable(2, 0, DrvTransTable[attr+0]); - GenericTilemapSetTransTable(2, 1, DrvTransTable[attr+1]); - GenericTilemapSetTransTable(2, 2, DrvTransTable[attr+2]); - GenericTilemapSetTransTable(2, 3, DrvTransTable[attr+3]); -} - -static tilemap_scan( background ) -{ - return ((col * 32 & 0xe0) >> 5) + ((row * 32 & 0xe0) >> 2) + ((col * 32 & 0x3f00) >> 1) + 0x4000; -} - -static tilemap_scan( foreground ) -{ - return ((col * 16 & 0xf0) >> 4) + (row * 16 & 0xf0) + (col * 16 & 0x700) + ((row * 16 & 0x700) << 3); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - soundlatch = 0; - txt_enable = 0; - spr_enable = 0; - bg_enable = 0; - fg_enable = 0; - fg_scrollx = 0; - fg_scrolly = 0; - bg_scrollx = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x00c000; - DrvZ80ROM1 = Next; Next += 0x004000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x020000; - DrvGfxROM3 = Next; Next += 0x010000; - DrvGfxROM4 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000800; - - DrvTransTable = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x001000; - DrvSprBuf = Next; Next += 0x001000; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - static INT32 TilePlanes[2] = { 0x004, 0x000 }; - static INT32 SpriPlanes[4] = { 0x20004, 0x20000, 0x00004, 0x00000 }; - static INT32 TileXOffs[32] = { STEP4(0,1), STEP4(8,1), STEP4(512,1), STEP4(520,1), - STEP4(1024, 1), STEP4(1032, 1), STEP4(1536,1), STEP4(1544,1) }; - static INT32 SpriXOffs[16] = { STEP4(0,1), STEP4(8,1), STEP4(256,1), STEP4(256+8,1) }; - static INT32 TileYOffs[32] = { STEP32(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x02000); - - GfxDecode(0x200, 2, 8, 8, TilePlanes, TileXOffs, TileYOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x04000); - - GfxDecode(0x040, 2, 32, 32, TilePlanes, TileXOffs, TileYOffs, 0x800, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x08000); - - GfxDecode(0x100, 4, 16, 16, SpriPlanes, SpriXOffs, TileYOffs, 0x200, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x08000); - - GfxDecode(0x100, 4, 16, 16, SpriPlanes, SpriXOffs, TileYOffs, 0x200, tmp, DrvGfxROM3); - - BurnFree (tmp); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x04000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x04000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00500, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00600, 18, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00700, 19, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0xd000, 0xd3ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0xd400, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xf000, 0xffff, MAP_RAM); - ZetSetWriteHandler(exedexes_main_write); - ZetSetReadHandler(exedexes_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x4000, 0x47ff, MAP_RAM); - ZetSetWriteHandler(exedexes_sound_write); - ZetSetReadHandler(exedexes_sound_read); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - - SN76489Init(0, 3000000, 0); - SN76489Init(1, 3000000, 1); - SN76496SetRoute(0, 0.36, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.36, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, background_map_scan, background_map_callback, 32, 32, 64, 64); - GenericTilemapInit(1, foreground_map_scan, foreground_map_callback, 16, 16, 128, 128); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, text_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x08000, 0x000, 0x3f); - GenericTilemapSetGfx(1, DrvGfxROM1, 2, 32, 32, 0x10000, 0x100, 0x3f); - GenericTilemapSetGfx(2, DrvGfxROM2, 4, 16, 16, 0x20000, 0x200, 0x0f); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -16); - GenericTilemapSetTransparent(1, 0); -// GenericTilemapSetTransparent(2, 0); // wrong - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - AY8910Exit(0); - SN76496Exit(); - - ZetExit(); - - GenericTilesExit(); - - BurnFree(AllMem); - - return 0; -} - -static INT32 DrvPaletteInit() -{ - UINT32 tmp[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 r = DrvColPROM[i + 0x000] & 0xf; - UINT8 g = DrvColPROM[i + 0x100] & 0xf; - UINT8 b = DrvColPROM[i + 0x200] & 0xf; - - tmp[i] = BurnHighCol((r*16)+r,(g*16)+g,(b*16)+b, 0); - } - - for (INT32 i = 0; i < 0x100; i++) - { - DrvPalette[i + 0x000] = tmp[DrvColPROM[i + 0x300] | 0xc0]; - DrvPalette[i + 0x100] = tmp[DrvColPROM[i + 0x400]]; - DrvPalette[i + 0x200] = tmp[DrvColPROM[i + 0x500] | 0x40]; - DrvPalette[i + 0x300] = tmp[DrvColPROM[i + 0x600] | (DrvColPROM[i + 0x700] << 4) | 0x80]; - - DrvTransTable[i] = (DrvColPROM[0x300 + i] == 0xf) ? 1 : 0; - } - - return 0; -} - -static void draw_sprites(INT32 priority) -{ - priority = priority ? 0x40 : 0x00; - - for (INT32 offs = 0x1000 - 32; offs >= 0; offs -= 32) - { - if ((DrvSprBuf[offs + 1] & 0x40) == priority) - { - INT32 code = DrvSprBuf[offs]; - INT32 color = DrvSprBuf[offs + 1] & 0x0f; - INT32 flipx = DrvSprBuf[offs + 1] & 0x10; - INT32 flipy = DrvSprBuf[offs + 1] & 0x20; - INT32 sx = DrvSprBuf[offs + 3] - ((DrvSprBuf[offs + 1] & 0x80) << 1); - INT32 sy = DrvSprBuf[offs + 2] - 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x300, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x300, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x300, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x300, DrvGfxROM3); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (bg_enable) { - GenericTilemapSetScrollX(0, bg_scrollx); - - GenericTilemapDraw(0, pTransDraw, 0); - } else { - BurnTransferClear(); - } - - if (spr_enable) { - draw_sprites(1); - } - - if (fg_enable) { - GenericTilemapSetScrollX(1, fg_scrolly); // Swapped! - GenericTilemapSetScrollY(1, fg_scrollx); - - GenericTilemapDraw(1, pTransDraw, 0); - } - - if (spr_enable) { - draw_sprites(0); - } - - if (txt_enable) { - GenericTilemapDraw(2, pTransDraw, 0); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 16; - INT32 nCyclesTotal[2] = { 4000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == 0) { - ZetSetVector(0xcf); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - if (i == (nInterleave - 2)) { - ZetSetVector(0xd7); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - if ((i & 3) == 3) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - } - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); - } - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(txt_enable); - SCAN_VAR(spr_enable); - SCAN_VAR(bg_enable); - SCAN_VAR(fg_enable); - SCAN_VAR(fg_scrolly); - SCAN_VAR(fg_scrollx); - SCAN_VAR(bg_scrollx); - } - - return 0; -} - - -// Exed Exes - -static struct BurnRomInfo exedexesRomDesc[] = { - { "11m_ee04.bin", 0x4000, 0x44140dbd, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "10m_ee03.bin", 0x4000, 0xbf72cfba, 1 | BRF_PRG | BRF_ESS }, // 1 - { "09m_ee02.bin", 0x4000, 0x7ad95e2f, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "11e_ee01.bin", 0x4000, 0x73cdf3b2, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "05c_ee00.bin", 0x2000, 0xcadb75bd, 3 | BRF_GRA }, // 4 Characters - - { "h01_ee08.bin", 0x4000, 0x96a65c1d, 4 | BRF_GRA }, // 5 32x32 tiles - - { "a03_ee06.bin", 0x4000, 0x6039bdd1, 5 | BRF_GRA }, // 6 16x16 tiles - { "a02_ee05.bin", 0x4000, 0xb32d8252, 5 | BRF_GRA }, // 7 - - { "j11_ee10.bin", 0x4000, 0xbc83e265, 6 | BRF_GRA }, // 8 Sprites - { "j12_ee11.bin", 0x4000, 0x0e0f300d, 6 | BRF_GRA }, // 9 - - { "c01_ee07.bin", 0x4000, 0x3625a68d, 7 | BRF_GRA }, // 10 Tile Maps - { "h04_ee09.bin", 0x2000, 0x6057c907, 7 | BRF_GRA }, // 11 - - { "02d_e-02.bin", 0x0100, 0x8d0d5935, 8 | BRF_GRA }, // 12 Color Proms - { "03d_e-03.bin", 0x0100, 0xd3c17efc, 8 | BRF_GRA }, // 13 - { "04d_e-04.bin", 0x0100, 0x58ba964c, 8 | BRF_GRA }, // 14 - { "06f_e-05.bin", 0x0100, 0x35a03579, 8 | BRF_GRA }, // 15 - { "l04_e-10.bin", 0x0100, 0x1dfad87a, 8 | BRF_GRA }, // 16 - { "c04_e-07.bin", 0x0100, 0x850064e0, 8 | BRF_GRA }, // 17 - { "l09_e-11.bin", 0x0100, 0x2bb68710, 8 | BRF_GRA }, // 18 - { "l10_e-12.bin", 0x0100, 0x173184ef, 8 | BRF_GRA }, // 19 - - { "06l_e-06.bin", 0x0100, 0x712ac508, 0 | BRF_OPT }, // 20 Misc. Proms - { "k06_e-08.bin", 0x0100, 0x0eaf5158, 0 | BRF_OPT }, // 21 - { "l03_e-09.bin", 0x0100, 0x0d968558, 0 | BRF_OPT }, // 22 - { "03e_e-01.bin", 0x0020, 0x1acee376, 0 | BRF_OPT }, // 23 -}; - -STD_ROM_PICK(exedexes) -STD_ROM_FN(exedexes) - -struct BurnDriver BurnDrvExedexes = { - "exedexes", NULL, NULL, NULL, "1985", - "Exed Exes\0", NULL, "Capcom", "Miscellaneous", - L"Exed Exes\0\u30A8\u30B0\u30BC\u30C9 \u30A8\u30B0\u30BC\u30B9\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, exedexesRomInfo, exedexesRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; - - -// Savage Bees - -static struct BurnRomInfo savgbeesRomDesc[] = { - { "ee04e.11m", 0x4000, 0xc0caf442, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "ee03e.10m", 0x4000, 0x9cd70ae1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ee02e.9m", 0x4000, 0xa04e6368, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ee01e.11e", 0x4000, 0x93d3f952, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "ee00e.5c", 0x2000, 0x5972f95f, 3 | BRF_GRA }, // 4 Characters - - { "h01_ee08.bin", 0x4000, 0x96a65c1d, 4 | BRF_GRA }, // 5 32x32 tiles - - { "a03_ee06.bin", 0x4000, 0x6039bdd1, 5 | BRF_GRA }, // 6 16x16 tiles - { "a02_ee05.bin", 0x4000, 0xb32d8252, 5 | BRF_GRA }, // 7 - - { "j11_ee10.bin", 0x4000, 0xbc83e265, 6 | BRF_GRA }, // 8 Sprites - { "j12_ee11.bin", 0x4000, 0x0e0f300d, 6 | BRF_GRA }, // 9 - - { "c01_ee07.bin", 0x4000, 0x3625a68d, 7 | BRF_GRA }, // 10 Tile Maps - { "h04_ee09.bin", 0x2000, 0x6057c907, 7 | BRF_GRA }, // 11 - - { "02d_e-02.bin", 0x0100, 0x8d0d5935, 8 | BRF_GRA }, // 12 Color Proms - { "03d_e-03.bin", 0x0100, 0xd3c17efc, 8 | BRF_GRA }, // 13 - { "04d_e-04.bin", 0x0100, 0x58ba964c, 8 | BRF_GRA }, // 14 - { "06f_e-05.bin", 0x0100, 0x35a03579, 8 | BRF_GRA }, // 15 - { "l04_e-10.bin", 0x0100, 0x1dfad87a, 8 | BRF_GRA }, // 16 - { "c04_e-07.bin", 0x0100, 0x850064e0, 8 | BRF_GRA }, // 17 - { "l09_e-11.bin", 0x0100, 0x2bb68710, 8 | BRF_GRA }, // 18 - { "l10_e-12.bin", 0x0100, 0x173184ef, 8 | BRF_GRA }, // 19 - - { "06l_e-06.bin", 0x0100, 0x712ac508, 0 | BRF_OPT }, // 20 Misc. Proms - { "k06_e-08.bin", 0x0100, 0x0eaf5158, 0 | BRF_OPT }, // 21 - { "l03_e-09.bin", 0x0100, 0x0d968558, 0 | BRF_OPT }, // 22 - { "03e_e-01.bin", 0x0020, 0x1acee376, 0 | BRF_OPT }, // 23 -}; - -STD_ROM_PICK(savgbees) -STD_ROM_FN(savgbees) - -struct BurnDriver BurnDrvSavgbees = { - "savgbees", "exedexes", NULL, NULL, "1985", - "Savage Bees\0", NULL, "Capcom (Memetron license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, savgbeesRomInfo, savgbeesRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_fantland.cpp b/jan/src/burn/drv/pre90s/d_fantland.cpp deleted file mode 100644 index 8ab3c5155..000000000 --- a/jan/src/burn/drv/pre90s/d_fantland.cpp +++ /dev/null @@ -1,1161 +0,0 @@ -// FB Alpha Fantasy Land driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "nec_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "burn_ym3526.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvI8086ROM; -static UINT8 *DrvI8088ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvI8088RAM; -static UINT8 *DrvI8086RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 nmi_enable; -static UINT8 soundlatch; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvFake[8]; - -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[4]; -static UINT8 DrvReset; - -static INT32 game_select = 0; - -static struct BurnInputInfo FantlandInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Fantland) - -static struct BurnInputInfo WheelrunInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Left", BIT_DIGITAL, DrvFake + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvFake + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, - {"P2 Left", BIT_DIGITAL, DrvFake + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvFake + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Wheelrun) - -static struct BurnDIPInfo FantlandDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x00, "Invulnerability" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x10, 0x00, "No" }, - {0x11, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x60, 0x60, "Normal" }, - {0x11, 0x01, 0x60, 0x40, "Hard" }, - {0x11, 0x01, 0x60, 0x20, "Harder" }, - {0x11, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - - {0 , 0xfe, 0 , 2, "Test Sound" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Lives" }, - {0x12, 0x01, 0x0e, 0x0e, "1" }, - {0x12, 0x01, 0x0e, 0x0c, "2" }, - {0x12, 0x01, 0x0e, 0x0a, "3" }, - {0x12, 0x01, 0x0e, 0x08, "4" }, - {0x12, 0x01, 0x0e, 0x06, "5" }, - {0x12, 0x01, 0x0e, 0x04, "6" }, - {0x12, 0x01, 0x0e, 0x02, "7" }, - {0x12, 0x01, 0x0e, 0x00, "8" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x30, 0x30, "800k" }, - {0x12, 0x01, 0x30, 0x20, "1600k" }, - {0x12, 0x01, 0x30, 0x10, "2400k" }, - {0x12, 0x01, 0x30, 0x00, "3200k" }, -}; - -STDDIPINFO(Fantland) - -static struct BurnDIPInfo GalaxygnDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xf9, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x60, 0x60, "Normal" }, - {0x11, 0x01, 0x60, 0x40, "Hard" }, - {0x11, 0x01, 0x60, 0x20, "Harder" }, - {0x11, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - - {0 , 0xfe, 0 , 2, "Test Sound" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Lives" }, - {0x12, 0x01, 0x0e, 0x0e, "1" }, - {0x12, 0x01, 0x0e, 0x0c, "2" }, - {0x12, 0x01, 0x0e, 0x0a, "3" }, - {0x12, 0x01, 0x0e, 0x08, "4" }, - {0x12, 0x01, 0x0e, 0x06, "5" }, - {0x12, 0x01, 0x0e, 0x04, "6" }, - {0x12, 0x01, 0x0e, 0x02, "7" }, - {0x12, 0x01, 0x0e, 0x00, "8" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x30, 0x30, "10k" }, - {0x12, 0x01, 0x30, 0x20, "20k" }, - {0x12, 0x01, 0x30, 0x10, "30k" }, - {0x12, 0x01, 0x30, 0x00, "40k" }, -}; - -STDDIPINFO(Galaxygn) - -static struct BurnDIPInfo WheelrunDIPList[]= -{ - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0xdf, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x09, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x09, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x09, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x09, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x09, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x09, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x09, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x09, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x09, 0x01, 0x08, 0x00, "Off" }, - {0x09, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x09, 0x01, 0x10, 0x00, "No" }, - {0x09, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x09, 0x01, 0x60, 0x60, "Normal" }, - {0x09, 0x01, 0x60, 0x40, "Hard" }, - {0x09, 0x01, 0x60, 0x20, "Harder" }, - {0x09, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Wheel Sensitivity" }, - {0x0a, 0x01, 0xff, 0x7f, "0" }, - {0x0a, 0x01, 0xff, 0xbf, "1" }, - {0x0a, 0x01, 0xff, 0xdf, "2" }, - {0x0a, 0x01, 0xff, 0xef, "3" }, - {0x0a, 0x01, 0xff, 0xf7, "4" }, - {0x0a, 0x01, 0xff, 0xfb, "5" }, - {0x0a, 0x01, 0xff, 0xfd, "6" }, - {0x0a, 0x01, 0xff, 0xfe, "7" }, -}; - -STDDIPINFO(Wheelrun) - -static void __fastcall fantland_main_write(UINT32 address, UINT8 data) -{ - //bprintf(0, _T("mw %X %X. "), address ,data); - switch (address) - { - case 0x53000: - //case 0x53001: - case 0xa3000: - case 0xa3001: - nmi_enable = data & 0x08; - return; - - case 0x53002: - // case 0x53003: - case 0xa3002: - // case 0xa3003: - soundlatch = data; - if (game_select < 2) { - VezClose(); - VezOpen(1); - VezSetIRQLineAndVector(0x20, 0xff, CPU_IRQSTATUS_AUTO); - VezClose(); - VezOpen(0); - } else { - ZetNmi(); - } - return; - } -} - -static UINT8 __fastcall fantland_main_read(UINT32 address) -{ - switch (address) - { - case 0x53000: - case 0x53001: - case 0xa3000: - case 0xa3001: - case 0x53002: - case 0x53003: - case 0xa3002: - case 0xa3003: - return DrvInputs[address & 3]; - } - - return 0; -} - -static void __fastcall fantland_sound_write_port(UINT32 port, UINT8 data) -{ - switch (port) - { - case 0x0100: - BurnYM2151SelectRegister(data); - return; - - case 0x0101: - BurnYM2151WriteRegister(data); - return; - - case 0x0180: - DACSignedWrite(0, data); - return; - } - bprintf(0, _T("wp %X %X. "), port, data); -} - -static UINT8 __fastcall fantland_sound_read_port(UINT32 port) -{ - switch (port) - { - case 0x0080: - return soundlatch; - - case 0x0101: - return BurnYM2151ReadStatus(); - } - bprintf(0, _T("rp %X. "), port); - return 0; -} - -static void __fastcall wheelrun_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - BurnYM3526Write(address & 1, data); - return; - - case 0xb000: - case 0xc000: - return; - } -} - -static UINT8 __fastcall wheelrun_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - case 0xa001: - return BurnYM3526Read(address & 1); - - case 0xd000: - return soundlatch; - } - - return 0; -} - -static void DrvYM3526IrqHandler(INT32, INT32 nStatus) -{ - if (ZetGetActive() == -1) return; - - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void DrvYM2151IrqHandler(INT32 nStatus) -{ - if (VezGetActive() == -1) return; - - if (nStatus) VezSetIRQLineAndVector(0, 0x80/4, CPU_IRQSTATUS_AUTO); - // Galaxygn soundcpu will eventually crash with the traditional method, below... - //VezSetIRQLineAndVector(0, 0x80/4, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDACSync() -{ - return (INT32)(float)(nBurnSoundLen * (VezTotalCycles() / (8000000.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 9000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - VezOpen(0); - VezReset(); - VezClose(); - - if (game_select < 2) - { - VezOpen(1); - VezReset(); - DACReset(); - BurnYM2151Reset(); - VezClose(); - } - else if (game_select == 2) - { - ZetOpen(0); - ZetReset(); - BurnYM3526Reset(); - ZetClose(); - } - - soundlatch = 0; - nmi_enable = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvI8086ROM = Next; Next += 0x100000; - DrvZ80ROM = Next; - DrvI8088ROM = Next; Next += 0x100000; - - DrvGfxROM = Next; Next += 0x600000; - - DrvPalette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - - AllRam = Next; - - DrvI8086RAM = Next; Next += 0x008000; - DrvZ80RAM = Next; - DrvI8088RAM = Next; Next += 0x002000; - - DrvPalRAM = Next; Next += 0x000200; - DrvSprRAM0 = Next; Next += 0x002800; - DrvSprRAM1 = Next; Next += 0x010000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[6] = { 0,1,2,3,4,5 }; - INT32 XOffs[16] = { STEP4(3*6,-6),STEP4(7*6,-6),STEP4(11*6,-6),STEP4(15*6,-6) }; - INT32 YOffs[16] = { STEP16(0,16*6) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x480000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM, 0x480000); - - GfxDecode(0x6000, 6, 16, 16, Plane, XOffs, YOffs, 0x600, tmp, DrvGfxROM); - - BurnFree(tmp); - - return 0; -} - -static INT32 FantlandInit() -{ - game_select = 0; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvI8086ROM + 0x00000, 0, 2)) return 1; - if (BurnLoadRom(DrvI8086ROM + 0x00001, 1, 2)) return 1; - memcpy (DrvI8086ROM + 0x40000, DrvI8086ROM, 0x40000); - if (BurnLoadRom(DrvI8086ROM + 0xe0000, 2, 2)) return 1; - if (BurnLoadRom(DrvI8086ROM + 0xe0001, 3, 2)) return 1; - - if (BurnLoadRom(DrvI8088ROM + 0x80000, 4, 1)) return 1; - if (BurnLoadRom(DrvI8088ROM + 0xc0000, 5, 1)) return 1; - memcpy (DrvI8088ROM + 0xe0000, DrvI8088ROM + 0xc0000, 0x20000); - - UINT8 *tmp = (UINT8*)BurnMalloc(0x280000); - if (BurnLoadRom(tmp + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(tmp + 0x080000, 7, 1)) return 1; - if (BurnLoadRom(tmp + 0x100000, 9, 1)) return 1; - if (BurnLoadRom(tmp + 0x180000, 10, 1)) return 1; - if (BurnLoadRom(tmp + 0x200000, 12, 1)) return 1; - - for (INT32 i = 0, j = 0; i < 0x280000; i+=2, j+=3) { - memcpy (DrvGfxROM + j, tmp + i, 2); - } - - BurnFree(tmp); - - if (BurnLoadRom(DrvGfxROM + 0x000002, 8, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180002, 11, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x3c0001, 13, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x3c0000, 14, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x300002, 15, 3)) return 1; - - DrvGfxDecode(); - } - - VezInit(0, V30_TYPE, 8000000); - VezOpen(0); - VezMapMemory(DrvI8086RAM, 0x00000, 0x07fff, MAP_RAM); - VezMapMemory(DrvI8086ROM + 0x08000, 0x08000, 0x7ffff, MAP_ROM); - VezMapMemory(DrvPalRAM, 0xa2000, 0xa21ff, MAP_RAM); - VezMapMemory(DrvSprRAM0, 0xa4000, 0xa67ff, MAP_RAM); - VezMapMemory(DrvSprRAM1, 0xc0000, 0xcffff, MAP_RAM); - VezMapMemory(DrvI8086ROM + 0xe0000, 0xe0000, 0xfffff, MAP_ROM); - VezSetWriteHandler(fantland_main_write); - VezSetReadHandler(fantland_main_read); - VezClose(); - - VezInit(1, V20_TYPE, 8000000); - VezOpen(1); - VezMapMemory(DrvI8088RAM, 0x00000, 0x01fff, MAP_RAM); - VezMapMemory(DrvI8088ROM + 0x80000, 0x80000, 0xfffff, MAP_ROM); - VezSetWritePort(fantland_sound_write_port); - VezSetReadPort(fantland_sound_read_port); - VezClose(); - - BurnYM2151Init(3000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.55, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.55, BURN_SND_ROUTE_RIGHT); - - DACInit(0, 0, 1, DrvDACSync); - DACSetRoute(0, 0.65, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 GalaxygnInit() -{ - game_select = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvI8086ROM + 0x10000, 0, 1)) return 1; - if (BurnLoadRom(DrvI8086ROM + 0x20000, 1, 1)) return 1; - if (BurnLoadRom(DrvI8086ROM + 0xf0000, 2, 1)) return 1; - memcpy (DrvI8086ROM + 0x70000, DrvI8086ROM + 0xf0000, 0x10000); - - if (BurnLoadRom(DrvI8088ROM + 0xc0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 4, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x000001, 5, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x000002, 6, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x030000, 7, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x030001, 8, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x030002, 9, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x060000, 10, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x060001, 11, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x060002, 12, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x090000, 13, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x090001, 14, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x090002, 15, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0c0000, 16, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0c0001, 17, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0c0002, 18, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0f0000, 19, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0f0001, 20, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0f0002, 21, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x120000, 22, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x120001, 23, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x120002, 24, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x150000, 25, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x150001, 26, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x150002, 27, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 28, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180001, 29, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180002, 30, 3)) return 1; - - DrvGfxDecode(); - } - - VezInit(0, V20_TYPE, 8000000); - VezOpen(0); - VezMapMemory(DrvI8086RAM, 0x00000, 0x07fff, MAP_RAM); - VezMapMemory(DrvI8086ROM + 0x10000, 0x10000, 0x2ffff, MAP_ROM); - VezMapMemory(DrvPalRAM, 0x52000, 0x521ff, MAP_RAM); - VezMapMemory(DrvSprRAM0, 0x54000, 0x567ff, MAP_RAM); - VezMapMemory(DrvSprRAM1, 0x60000, 0x6ffff, MAP_RAM); - VezMapMemory(DrvI8086ROM + 0x70000, 0x70000, 0x7ffff, MAP_ROM); - VezMapMemory(DrvI8086ROM + 0xf0000, 0xf0000, 0xfffff, MAP_ROM); - VezSetWriteHandler(fantland_main_write); - VezSetReadHandler(fantland_main_read); - VezClose(); - - VezInit(1, V20_TYPE, 8000000); - VezOpen(1); - VezMapMemory(DrvI8088RAM, 0x00000, 0x01fff, MAP_RAM); - VezMapMemory(DrvI8088ROM + 0xc0000, 0xc0000, 0xcffff, MAP_ROM); - VezMapMemory(DrvI8088ROM + 0xc0000, 0xd0000, 0xdffff, MAP_ROM); - VezMapMemory(DrvI8088ROM + 0xc0000, 0xe0000, 0xeffff, MAP_ROM); - VezMapMemory(DrvI8088ROM + 0xc0000, 0xf0000, 0xfffff, MAP_ROM); - VezSetWritePort(fantland_sound_write_port); - VezSetReadPort(fantland_sound_read_port); - VezClose(); - - BurnYM2151Init(3000000); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.55, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.55, BURN_SND_ROUTE_RIGHT); - - DACInit(0, 0, 1, DrvDACSync); - DACSetRoute(0, 0.65, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 WheelrunInit() -{ - game_select = 2; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvI8086ROM + 0x30000, 0, 1)) return 1; - if (BurnLoadRom(DrvI8086ROM + 0xf0000, 1, 1)) return 1; - memcpy (DrvI8086ROM + 0x70000, DrvI8086ROM + 0xf0000, 0x10000); - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x000001, 4, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x000002, 5, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x030000, 6, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x030001, 7, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x030002, 8, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x060000, 9, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x060001, 10, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x060002, 11, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x090000, 12, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x090001, 13, 3)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x090002, 14, 3)) return 1; - - DrvGfxDecode(); - } - - VezInit(0, V20_TYPE, 9000000); - VezOpen(0); - VezMapMemory(DrvI8086RAM, 0x00000, 0x07fff, MAP_RAM); - VezMapMemory(DrvI8086ROM + 0x30000, 0x30000, 0x3ffff, MAP_ROM); - VezMapMemory(DrvPalRAM, 0x52000, 0x521ff, MAP_RAM); - VezMapMemory(DrvSprRAM0, 0x54000, 0x567ff, MAP_RAM); - VezMapMemory(DrvSprRAM1, 0x60000, 0x6ffff, MAP_RAM); - VezMapMemory(DrvI8086ROM + 0x70000, 0x70000, 0xfffff, MAP_ROM); - VezSetWriteHandler(fantland_main_write); - VezSetReadHandler(fantland_main_read); - VezClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(wheelrun_sound_write); - ZetSetReadHandler(wheelrun_sound_read); - ZetClose(); - - BurnYM3526Init(3500000, &DrvYM3526IrqHandler, &SynchroniseStream, 0); - BurnTimerAttachZetYM3526(9000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - VezExit(); - - if (game_select < 2) { - BurnYM2151Exit(); - DACExit(); - } else if (game_select == 2) { - ZetExit(); - BurnYM3526Exit(); - } - - BurnFree(AllMem); - - game_select = 0; - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 r = (p[i] >> 10) & 0x1f; - INT32 g = (p[i] >> 5) & 0x1f; - INT32 b = (p[i] >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_sprites() -{ - UINT8 *spriteram_2 = DrvSprRAM1; - UINT8 *indx_ram = DrvSprRAM0 + 0x2000; // this ram contains indexes into offs_ram - UINT8 *offs_ram = DrvSprRAM0 + 0x2400; // this ram contains x,y offsets or indexes into spriteram_2 - UINT8 *ram = DrvSprRAM0; // current sprite pointer in spriteram - UINT8 *ram2 = indx_ram; // current sprite pointer in indx_ram - - INT32 special = (nScreenHeight < 256) ? 1 : 0; // wheelrun is the only game with a smaller visible area - - for ( ; ram < indx_ram; ram += 8,ram2++) - { - INT32 attr,code,color, x,y,xoffs,yoffs,flipx,flipy, idx; - - attr = ram[1]; - - x = ram[0]; - code = ram[3] + (ram[2] << 8); - y = ram[4]; - - color = (attr & 0x03); - flipy = (attr & 0x10) ? 1 : 0; - flipx = (attr & 0x20) ? 1 : 0; - - y += (attr & 0x40) << 2; - x += (attr & 0x80) << 1; - - idx = ram2[0] * 4; - - if (offs_ram[idx + 2] & 0x80) - { - idx = (((offs_ram[idx + 2] << 8) + offs_ram[idx + 3]) & 0x3fff) * 4; - - yoffs = spriteram_2[idx + 0] + (spriteram_2[idx + 1] << 8); - xoffs = spriteram_2[idx + 2] + (spriteram_2[idx + 3] << 8); - - code += (yoffs & 0x3e00) >> 9; - flipy ^= (yoffs & 0x4000) ? 1 : 0; - flipx ^= (yoffs & 0x8000) ? 1 : 0; - } - else - { - yoffs = ((offs_ram[idx + 3] & 0x01) << 8) + offs_ram[idx + 1]; - xoffs = ((offs_ram[idx + 2] & 0x01) << 8) + offs_ram[idx + 0]; - } - - yoffs = (yoffs & 0xff) - (yoffs & 0x100); - xoffs = (xoffs & 0x1ff); - - if (xoffs >= 0x180) xoffs -= 0x200; - - y += yoffs; - x += xoffs; - - if (special && y > 0) y &= 0xff; - - y = (y & 0xff) - (y & 0x100); - x = (x & 0x1ff); - - if (x >= 0x180) x -= 0x200; - - code %= 0x6000; // largest graphics size (fantland) - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, color, 6, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, color, 6, 0, 0, DrvGfxROM); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, 6, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, 6, 0, 0, DrvGfxROM); - } - } - } -} - -static INT32 DrvDraw() -{ - //if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; - //} - - BurnTransferClear(); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 FantlandFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - VezNewFrame(); - - { - memset (DrvInputs, 0xff, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[2] = DrvDips[0]; - DrvInputs[3] = DrvDips[1]; - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 133; // periodic int for sound cpu (dac) - INT32 nCyclesTotal[2] = { 8000000 / 60, 8000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSegment = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - VezOpen(0); - nSegment = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += VezRun(nSegment - nCyclesDone[0]); - if (i == (nInterleave - 1) && nmi_enable) VezSetIRQLineAndVector(0x20, 0xff, CPU_IRQSTATUS_AUTO); - VezClose(); - - VezOpen(1); - nSegment = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += VezRun(nSegment - nCyclesDone[1]); - if (game_select == 0) VezSetIRQLineAndVector(0, 0x80/4, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - nSoundBufferPos += nSegment; - } - VezClose(); - } - - VezOpen(1); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - VezClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 WheelrunFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - VezNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[2] = DrvDips[0]; - DrvInputs[3] = DrvDips[1]; - - DrvInputs[0] &= ~0x70; - DrvInputs[1] &= ~0x70; - - UINT8 nWheel = ((DrvFake[0] ? 5 : 0) | (DrvFake[1] ? 3 : 0)) << 4; - if (nWheel == 0) nWheel = 0x40; - DrvInputs[0] |= nWheel; - nWheel = ((DrvFake[2] ? 5 : 0) | (DrvFake[3] ? 3 : 0)) << 4; - if (nWheel == 0) nWheel = 0x40; - DrvInputs[1] |= nWheel; - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 9000000 / 60, 9000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - VezOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += VezRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1) && nmi_enable) VezSetIRQLineAndVector(0x20, 0, CPU_IRQSTATUS_AUTO); - - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - VezClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) - { - VezScan(nAction); - - if (game_select < 2) - { - BurnYM2151Scan(nAction); - DACScan(nAction,pnMin); - } - - if (game_select == 2) - { - ZetScan(nAction); - - ZetOpen(0); - BurnYM3526Scan(nAction, pnMin); - ZetClose(); - } - - SCAN_VAR(soundlatch); - SCAN_VAR(nmi_enable); - } - - return 0; -} - - -// Fantasy Land (set 1) - -static struct BurnRomInfo fantlandRomDesc[] = { - { "fantasyl.ev2", 0x20000, 0xf5bdca0e, 1 | BRF_PRG | BRF_ESS }, // 0 I8086 code - { "fantasyl.od2", 0x20000, 0x9db35023, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fantasyl.ev1", 0x10000, 0x70e0ee30, 1 | BRF_PRG | BRF_ESS }, // 2 - { "fantasyl.od1", 0x10000, 0x577b4bd7, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fantasyl.s2", 0x20000, 0xf23837d8, 2 | BRF_PRG | BRF_ESS }, // 4 I8088 code - { "fantasyl.s1", 0x20000, 0x1a324a69, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "fantasyl.m00", 0x80000, 0x82d819ff, 3 | BRF_GRA }, // 6 Sprites - { "fantasyl.m01", 0x80000, 0x70a94139, 3 | BRF_GRA }, // 7 - { "fantasyl.05", 0x80000, 0x62b9a00b, 3 | BRF_GRA }, // 8 - { "fantasyl.m02", 0x80000, 0xae52bf37, 3 | BRF_GRA }, // 9 - { "fantasyl.m03", 0x80000, 0xf3f534a1, 3 | BRF_GRA }, // 10 - { "fantasyl.06", 0x80000, 0x867fa549, 3 | BRF_GRA }, // 11 - { "fantasyl.m04", 0x80000, 0xe7b1918c, 3 | BRF_GRA }, // 12 - { "fantasyl.d0", 0x20000, 0x0f907f19, 3 | BRF_GRA }, // 13 - { "fantasyl.d1", 0x20000, 0x10d10389, 3 | BRF_GRA }, // 14 - { "fantasyl.07", 0x80000, 0x162ad422, 3 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(fantland) -STD_ROM_FN(fantland) - -struct BurnDriver BurnDrvFantland = { - "fantland", NULL, NULL, NULL, "19??", - "Fantasy Land (set 1)\0", NULL, "Electronic Devices Italy", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, fantlandRomInfo, fantlandRomName, NULL, NULL, FantlandInputInfo, FantlandDIPInfo, - FantlandInit, DrvExit, FantlandFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 352, 256, 4, 3 -}; - - -// Fantasy Land (set 2) - -static struct BurnRomInfo fantlandaRomDesc[] = { - { "fantasyl.ev2", 0x20000, 0xf5bdca0e, 1 | BRF_PRG | BRF_ESS }, // 0 I8086 code - { "fantasyl.od2", 0x20000, 0x9db35023, 1 | BRF_PRG | BRF_ESS }, // 1 - { "02.bin", 0x10000, 0x8b835eed, 1 | BRF_PRG | BRF_ESS }, // 2 - { "01.bin", 0x10000, 0x4fa3eb8b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fantasyl.s2", 0x20000, 0xf23837d8, 2 | BRF_PRG | BRF_ESS }, // 4 I8088 code - { "fantasyl.s1", 0x20000, 0x1a324a69, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "fantasyl.m00", 0x80000, 0x82d819ff, 3 | BRF_GRA }, // 6 Sprites - { "fantasyl.m01", 0x80000, 0x70a94139, 3 | BRF_GRA }, // 7 - { "fantasyl.05", 0x80000, 0x62b9a00b, 3 | BRF_GRA }, // 8 - { "fantasyl.m02", 0x80000, 0xae52bf37, 3 | BRF_GRA }, // 9 - { "fantasyl.m03", 0x80000, 0xf3f534a1, 3 | BRF_GRA }, // 10 - { "fantasyl.06", 0x80000, 0x867fa549, 3 | BRF_GRA }, // 11 - { "fantasyl.m04", 0x80000, 0xe7b1918c, 3 | BRF_GRA }, // 12 - { "fantasyl.d0", 0x20000, 0x0f907f19, 3 | BRF_GRA }, // 13 - { "fantasyl.d1", 0x20000, 0x10d10389, 3 | BRF_GRA }, // 14 - { "fantasyl.07", 0x80000, 0x162ad422, 3 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(fantlanda) -STD_ROM_FN(fantlanda) - -struct BurnDriver BurnDrvFantlanda = { - "fantlanda", "fantland", NULL, NULL, "19??", - "Fantasy Land (set 2)\0", NULL, "Electronic Devices Italy", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, fantlandaRomInfo, fantlandaRomName, NULL, NULL, FantlandInputInfo, FantlandDIPInfo, - FantlandInit, DrvExit, FantlandFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 352, 256, 4, 3 -}; - - -// Galaxy Gunners - -static struct BurnRomInfo galaxygnRomDesc[] = { - { "gg03.bin", 0x10000, 0x9e469189, 1 | BRF_PRG | BRF_ESS }, // 0 I8086 code - { "gg02.bin", 0x10000, 0xb87a438f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gg01.bin", 0x10000, 0xad0e5b29, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gg20.bin", 0x10000, 0xf5c65a85, 2 | BRF_PRG | BRF_ESS }, // 3 I8088 code - - { "gg54.bin", 0x10000, 0xb3621119, 3 | BRF_GRA }, // 4 Sprites - { "gg38.bin", 0x10000, 0x52b70f3e, 3 | BRF_GRA }, // 5 - { "gg22.bin", 0x10000, 0xea49fee4, 3 | BRF_GRA }, // 6 - { "gg55.bin", 0x10000, 0xbffe278f, 3 | BRF_GRA }, // 7 - { "gg39.bin", 0x10000, 0x3f7df1e6, 3 | BRF_GRA }, // 8 - { "gg23.bin", 0x10000, 0x4dcbbc99, 3 | BRF_GRA }, // 9 - { "gg56.bin", 0x10000, 0x0306069e, 3 | BRF_GRA }, // 10 - { "gg40.bin", 0x10000, 0xf635aa7e, 3 | BRF_GRA }, // 11 - { "gg24.bin", 0x10000, 0x733f5dcf, 3 | BRF_GRA }, // 12 - { "gg57.bin", 0x10000, 0xc3919bef, 3 | BRF_GRA }, // 13 - { "gg41.bin", 0x10000, 0x1f2757de, 3 | BRF_GRA }, // 14 - { "gg25.bin", 0x10000, 0x1d094f95, 3 | BRF_GRA }, // 15 - { "gg58.bin", 0x10000, 0x4a459cb8, 3 | BRF_GRA }, // 16 - { "gg42.bin", 0x10000, 0xae7a8e1e, 3 | BRF_GRA }, // 17 - { "gg26.bin", 0x10000, 0xc2f310b4, 3 | BRF_GRA }, // 18 - { "gg59.bin", 0x10000, 0xc8d4fbc2, 3 | BRF_GRA }, // 19 - { "gg43.bin", 0x10000, 0x74d3a0df, 3 | BRF_GRA }, // 20 - { "gg27.bin", 0x10000, 0xc2cfd3f9, 3 | BRF_GRA }, // 21 - { "gg60.bin", 0x10000, 0x6e32b549, 3 | BRF_GRA }, // 22 - { "gg44.bin", 0x10000, 0xfcda6efa, 3 | BRF_GRA }, // 23 - { "gg28.bin", 0x10000, 0x4d4fc01c, 3 | BRF_GRA }, // 24 - { "gg61.bin", 0x10000, 0x177a767a, 3 | BRF_GRA }, // 25 - { "gg45.bin", 0x10000, 0x2ba49d47, 3 | BRF_GRA }, // 26 - { "gg29.bin", 0x10000, 0xc1c68148, 3 | BRF_GRA }, // 27 - { "gg62.bin", 0x10000, 0x0fb2d41a, 3 | BRF_GRA }, // 28 - { "gg46.bin", 0x10000, 0x5f1bf8ad, 3 | BRF_GRA }, // 29 - { "gg30.bin", 0x10000, 0xded7cacf, 3 | BRF_GRA }, // 30 -}; - -STD_ROM_PICK(galaxygn) -STD_ROM_FN(galaxygn) - -struct BurnDriver BurnDrvGalaxygn = { - "galaxygn", NULL, NULL, NULL, "1989", - "Galaxy Gunners\0", "No Sound.", "Electronic Devices Italy", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, galaxygnRomInfo, galaxygnRomName, NULL, NULL, FantlandInputInfo, GalaxygnDIPInfo, - GalaxygnInit, DrvExit, FantlandFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 352, 3, 4 -}; - - -// Wheels Runner - -static struct BurnRomInfo wheelrunRomDesc[] = { - { "4.4", 0x10000, 0x359303df, 1 | BRF_PRG | BRF_ESS }, // 0 V20 code - { "3.3", 0x10000, 0xc28d0b31, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.1", 0x10000, 0x67b5f31f, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "7.7", 0x10000, 0xe0e5ff64, 3 | BRF_GRA }, // 3 Sprites - { "11.11", 0x10000, 0xce9718fb, 3 | BRF_GRA }, // 4 - { "15.15", 0x10000, 0xf6665f31, 3 | BRF_GRA }, // 5 - { "8.8", 0x10000, 0xfa1ec091, 3 | BRF_GRA }, // 6 - { "12.12", 0x10000, 0x8923dce4, 3 | BRF_GRA }, // 7 - { "16.16", 0x10000, 0x49801733, 3 | BRF_GRA }, // 8 - { "9.9", 0x10000, 0x9fea30d0, 3 | BRF_GRA }, // 9 - { "13.13", 0x10000, 0x8b0aae8d, 3 | BRF_GRA }, // 10 - { "17.17", 0x10000, 0xbe8ab48d, 3 | BRF_GRA }, // 11 - { "10.10", 0x10000, 0xc5bdd367, 3 | BRF_GRA }, // 12 - { "14.14", 0x10000, 0xe592302f, 3 | BRF_GRA }, // 13 - { "18.18", 0x10000, 0x6bd42d8e, 3 | BRF_GRA }, // 14 - - { "pal16r6cn.pal3", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 15 plds - { "pal16r6cn.pal4", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 16 - { "pal16r6cn.pal5", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 17 - { "tibpal16l8-25cn.pal1", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 18 - { "tibpal16l8-25cn.pal13", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 19 - { "tibpal16l8-25cn.pal14", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 20 - { "tibpal16l8-25cn.pal7", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 21 - { "tibpal16l8-25cn.pal8", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 22 - { "tibpal16r4-25cn.pal10", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 23 - { "tibpal16r4-25cn.pal15", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 24 - { "tibpal16r4-25cn.pal6", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 25 - { "tibpal16r4-25cn.pal9", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 26 - { "tibpal16r8-25cn.pal2", 0x104, 0, 4 | BRF_NODUMP | BRF_OPT }, // 27 - { "pal20l8acns.pal11", 0x144, 0, 4 | BRF_NODUMP | BRF_OPT }, // 28 - { "pal20l8acns.pal12", 0x144, 0, 4 | BRF_NODUMP | BRF_OPT }, // 29 -}; - -STD_ROM_PICK(wheelrun) -STD_ROM_FN(wheelrun) - -struct BurnDriver BurnDrvWheelrun = { - "wheelrun", NULL, NULL, NULL, "19??", - "Wheels Runner\0", NULL, "International Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, wheelrunRomInfo, wheelrunRomName, NULL, NULL, WheelrunInputInfo, WheelrunDIPInfo, - WheelrunInit, DrvExit, WheelrunFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - diff --git a/jan/src/burn/drv/pre90s/d_fastfred.cpp b/jan/src/burn/drv/pre90s/d_fastfred.cpp deleted file mode 100644 index 1d4d19b1f..000000000 --- a/jan/src/burn/drv/pre90s/d_fastfred.cpp +++ /dev/null @@ -1,1829 +0,0 @@ -// Fast Freddy / Jump Coaster HW emu-layer for FB Alpha, Based on the MAME driver by Zsolt Vasvari -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -#include "flt_rc.h" - -extern "C" { - #include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; - -static UINT8 *DrvMainRAM; -static UINT8 *DrvSubRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvFGVidRAM; -static UINT8 *DrvAttrRAM; - -static UINT8 *Rom0, *Rom1; -static UINT8 *Gfx0, *Gfx1, *Gfx2, *Gfx3, *GfxImagoSprites, *Prom; - -static UINT8 DrvJoy1[8], DrvJoy2[8], DrvDips[2], DrvInput[2], DrvReset; - -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 flyboymode = 0; -static UINT8 boggy84mode = 0; -static UINT8 boggy84bmode = 0; -static UINT8 imagomode = 0; - -static INT32 fastfred_hardware_type = 0; - -static INT32 fastfred_background_color = 0; -static INT32 fastfred_cpu0_interrupt_enable = 0; -static INT32 fastfred_cpu1_interrupt_enable = 0; -static INT32 fastfred_colorbank = 0; -static INT32 fastfred_charbank = 0; -static INT32 fastfred_flipscreenx = 0; -static INT32 fastfred_flipscreeny = 0; -static INT32 fastfred_soundlatch = 0; -static INT32 fastfred_scroll[32]; -static INT32 fastfred_color_select[32]; - -static UINT8 imago_sprites[0x800*3]; -static UINT16 imago_sprites_address; -static UINT8 imago_sprites_bank; - -static struct BurnInputInfo CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Common) - -static struct BurnInputInfo ImagoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Imago) - -static struct BurnInputInfo TwoBtnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(TwoBtn) - -static struct BurnDIPInfo FastfredDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x0f, 0x01, 0x0f, 0x01, "A 2/1 B 2/1" }, - {0x0f, 0x01, 0x0f, 0x02, "A 2/1 B 1/3" }, - {0x0f, 0x01, 0x0f, 0x00, "A 1/1 B 1/1" }, - {0x0f, 0x01, 0x0f, 0x03, "A 1/1 B 1/2" }, - {0x0f, 0x01, 0x0f, 0x04, "A 1/1 B 1/3" }, - {0x0f, 0x01, 0x0f, 0x05, "A 1/1 B 1/4" }, - {0x0f, 0x01, 0x0f, 0x06, "A 1/1 B 1/5" }, - {0x0f, 0x01, 0x0f, 0x07, "A 1/1 B 1/6" }, - {0x0f, 0x01, 0x0f, 0x08, "A 1/2 B 1/2" }, - {0x0f, 0x01, 0x0f, 0x09, "A 1/2 B 1/4" }, - {0x0f, 0x01, 0x0f, 0x0a, "A 1/2 B 1/5" }, - {0x0f, 0x01, 0x0f, 0x0e, "A 1/2 B 1/6" }, - {0x0f, 0x01, 0x0f, 0x0b, "A 1/2 B 1/10" }, - {0x0f, 0x01, 0x0f, 0x0c, "A 1/2 B 1/11" }, - {0x0f, 0x01, 0x0f, 0x0d, "A 1/2 B 1/12" }, - {0x0f, 0x01, 0x0f, 0x0f, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0f, 0x01, 0x10, 0x00, "3" }, - {0x0f, 0x01, 0x10, 0x10, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0f, 0x01, 0x60, 0x20, "30000" }, - {0x0f, 0x01, 0x60, 0x40, "50000" }, - {0x0f, 0x01, 0x60, 0x60, "100000" }, - {0x0f, 0x01, 0x60, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x80, 0x00, "Upright" }, - {0x0f, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Fastfred) - -static struct BurnDIPInfo FlyboyDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0x03, 0x03, "6 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0f, 0x01, 0x0c, 0x0c, "6 Coins 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x00, "3" }, - {0x0f, 0x01, 0x30, 0x10, "5" }, - {0x0f, 0x01, 0x30, 0x20, "7" }, - {0x0f, 0x01, 0x30, 0x30, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x80, 0x00, "Upright" }, - {0x0f, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Flyboy) - -static struct BurnDIPInfo JumpcoasDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0x03, 0x03, "6 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0f, 0x01, 0x0c, 0x0c, "6 Coins 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x00, "3" }, - {0x0f, 0x01, 0x30, 0x10, "5" }, - {0x0f, 0x01, 0x30, 0x20, "7" }, - {0x0f, 0x01, 0x30, 0x30, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x80, 0x00, "Upright" }, - {0x0f, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Jumpcoas) - -static struct BurnDIPInfo Boggy84DIPList[]= -{ - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0b, 0x01, 0x03, 0x03, "6 Coins 1 Credits" }, - {0x0b, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x0b, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x0b, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0b, 0x01, 0x0c, 0x0c, "6 Coins 1 Credits" }, - {0x0b, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x0b, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x0b, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0b, 0x01, 0x30, 0x00, "3" }, - {0x0b, 0x01, 0x30, 0x10, "5" }, - {0x0b, 0x01, 0x30, 0x20, "7" }, - {0x0b, 0x01, 0x30, 0x30, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0b, 0x01, 0x40, 0x00, "Off" }, - {0x0b, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0b, 0x01, 0x80, 0x00, "Upright" }, - {0x0b, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0c, 0x01, 0x01, 0x01, "Off" }, - {0x0c, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0c, 0x01, 0x02, 0x02, "Off" }, - {0x0c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0c, 0x01, 0x08, 0x08, "Off" }, - {0x0c, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0c, 0x01, 0x10, 0x10, "Off" }, - {0x0c, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0c, 0x01, 0x20, 0x20, "Off" }, - {0x0c, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0c, 0x01, 0x40, 0x40, "Off" }, - {0x0c, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0c, 0x01, 0x80, 0x80, "Off" }, - {0x0c, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Boggy84) - -static struct BurnDIPInfo RedrobinDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0b, 0x01, 0x03, 0x03, "4 Coins 1 Credits" }, - {0x0b, 0x01, 0x03, 0x02, "3 Coins 1 Credits" }, - {0x0b, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x0b, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0b, 0x01, 0x0c, 0x0c, "4 Coins 1 Credits" }, - {0x0b, 0x01, 0x0c, 0x08, "3 Coins 1 Credits" }, - {0x0b, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x0b, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0b, 0x01, 0x30, 0x00, "2" }, - {0x0b, 0x01, 0x30, 0x10, "3" }, - {0x0b, 0x01, 0x30, 0x20, "4" }, - {0x0b, 0x01, 0x30, 0x30, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x0b, 0x01, 0x40, 0x00, "30000" }, - {0x0b, 0x01, 0x40, 0x40, "50000" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0b, 0x01, 0x80, 0x00, "Off" }, - {0x0b, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Redrobin) - -static struct BurnDIPInfo ImagoDIPList[]= -{ - {0x09, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x09, 0x01, 0x03, 0x00, "2" }, - {0x09, 0x01, 0x03, 0x01, "3" }, - {0x09, 0x01, 0x03, 0x02, "4" }, - {0x09, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x09, 0x01, 0x04, 0x04, "Off" }, - {0x09, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x09, 0x01, 0x38, 0x38, "5 Coins 1 Credits" }, - {0x09, 0x01, 0x38, 0x18, "4 Coins 1 Credits" }, - {0x09, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x09, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x09, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x09, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x09, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x09, 0x01, 0x38, 0x30, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x09, 0x01, 0x40, 0x40, "Off" }, - {0x09, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x09, 0x01, 0x80, 0x80, "Off" }, - {0x09, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Imago) - -static UINT8 flyboy_custom1_io_r() -{ - switch (ZetGetPC(-1)) - { - case 0x049d: return 0xad; // compare - case 0x04b9: // compare with 0x9e ??? When ??? - case 0x0563: return 0x03; // $c085 compare - starts game - case 0x069b: return 0x69; // $c086 compare - case 0x076b: return 0xbb; // $c087 compare - case 0x0852: return 0xd9; // $c096 compare - case 0x09d5: return 0xa4; // $c099 compare - case 0x0a83: return 0xa4; // $c099 compare - case 0x1028: // $c08a bit 0 compare - case 0x1051: // $c08a bit 3 compare - case 0x107d: // $c08c bit 5 compare - case 0x10a7: // $c08e bit 1 compare - case 0x10d0: // $c08d bit 2 compare - case 0x10f6: // $c090 bit 0 compare - case 0x3fb6: // lddr - - return 0x00; - } - - return 0x00; -} - -static UINT8 flyboy_custom2_io_r() -{ - switch (ZetGetPC(-1)) - { - case 0x0395: return 0xf7; // $C900 compare - case 0x03f5: // $c8fd - case 0x043d: // $c8fd - case 0x0471: // $c900 - case 0x1031: return 0x01; // $c8fe bit 0 compare - case 0x1068: return 0x04; // $c8fe bit 2 compare - case 0x1093: return 0x20; // $c8fe bit 5 compare - case 0x10bd: return 0x80; // $c8fb bit 7 compare - case 0x103f: // $c8fe - case 0x10e4: // $c900 - case 0x110a: // $c900 - case 0x3fc8: // ld a with c8fc-c900 - - return 0x00; - } - - return 0x00; -} - -static UINT8 fastfred_custom_io_r(INT32 offset) -{ - if (~fastfred_hardware_type & 1) { - if (offset == 0x100) { - if (boggy84bmode) return 0x63; - return (boggy84mode) ? 0x6a : 0x63; - } else { - return 0; - } - } - - switch (ZetGetPC(-1)) - { - case 0x03c0: return 0x9d; - case 0x03e6: return 0x9f; - case 0x0407: return 0x00; - case 0x0446: return 0x94; - case 0x049f: return 0x01; - case 0x04b1: return 0x00; - case 0x0dd2: return 0x00; - case 0x0de4: return 0x20; - case 0x122b: return 0x10; - case 0x123d: return 0x00; - case 0x1a83: return 0x10; - case 0x1a93: return 0x00; - case 0x1b26: return 0x00; - case 0x1b37: return 0x80; - case 0x2491: return 0x10; - case 0x24a2: return 0x00; - case 0x46ce: return 0x20; - case 0x46df: return 0x00; - case 0x7b18: return 0x01; - case 0x7b29: return 0x00; - case 0x7b47: return 0x00; - case 0x7b58: return 0x20; - } - - return 0x00; -} - -static INT32 ImagoSpritesDecode() // for sprite dma in 0_w -{ - INT32 spriteplanes[3] = { 0x800*8*2, 0x800*8*1, 0x800*8*0 }; - INT32 spritexoffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }; - INT32 spriteyoffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }; - - GfxDecode(0x40, 3, 16, 16, spriteplanes, spritexoffs, spriteyoffs, 0x100, &imago_sprites[0], GfxImagoSprites); - - return 0; -} - - -static void __fastcall fastfred_cpu0_write(UINT16 address, UINT8 data) -{ - if (fastfred_hardware_type & 1) // fastfred, flyboy, - { - if (address >= 0xd800 && address < 0xd840) { - if (address & 1) { - fastfred_color_select[(address >> 1) & 0x1f] = data & 7; - } else { - fastfred_scroll[(address >> 1) & 0x1f] = data; - } - } - - if (address >= 0xd800 && address <= 0xdbff) { - DrvAttrRAM[address & 0x3ff] = data; - return; - } - } else { // jumpcoas = 0, boggy84 = 2 - if (address >= 0xd000 && address < 0xd040) { - if (address & 1) { - fastfred_color_select[(address >> 1) & 0x1f] = data & 7; - } else { - fastfred_scroll[(address >> 1) & 0x1f] = data; - } - } - - if (address >= 0xd000 && address <= 0xd3ff) { - DrvAttrRAM[address & 0x3ff] = data; - return; - } - } - - if (imagomode && address >= 0xb800 && address <= 0xbfff) { - UINT8 *rom = Gfx1; - UINT8 sprites_data; - UINT32 offset = address - 0xb800; - - sprites_data = rom[imago_sprites_address + 0x2000*0 + imago_sprites_bank * 0x1000]; - imago_sprites[offset + 0x800*0] = sprites_data; - - sprites_data = rom[imago_sprites_address + 0x2000*1 + imago_sprites_bank * 0x1000]; - imago_sprites[offset + 0x800*1] = sprites_data; - - sprites_data = rom[imago_sprites_address + 0x2000*2 + imago_sprites_bank * 0x1000]; - imago_sprites[offset + 0x800*2] = sprites_data; - - if ((offset & 0xf) == 0xf && (offset & 0xff) >= 0x7f) - { // end-of-dma always ends on a 0x007f or greater offset (if we decode every time, it causes some lag) - ImagoSpritesDecode(); // decode the dma'd sprites. - } - return; - } - - switch (address) - { - case 0xe000: - fastfred_background_color = data; - return; - - case 0xf001: - fastfred_cpu0_interrupt_enable = data & 1; - return; - - case 0xf002: - fastfred_colorbank = (fastfred_colorbank & 0x10) | ((data & 1) << 3); - return; - - case 0xf003: - fastfred_colorbank = (fastfred_colorbank & 0x08) | ((data & 1) << 4); - return; - - case 0xf004: - if (imagomode) { - ZetSetIRQLine(0, (data & 1) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - } else { - fastfred_charbank = (fastfred_charbank & 0x0200) | ((data & 1) << 8); - } - return; - - case 0xf005: - if (imagomode) { - fastfred_charbank = data; - } else { - fastfred_charbank = (fastfred_charbank & 0x0100) | ((data & 1) << 9); - } - return; - - case 0xf006: - case 0xf116: - fastfred_flipscreenx = data & 1; - return; - - case 0xf007: - case 0xf117: - fastfred_flipscreeny = data & 1; - return; - - case 0xf401: - imago_sprites_bank = (data & 2) >> 1; - return; - - case 0xf800: - if (fastfred_hardware_type & 1) { - fastfred_soundlatch = data; - } else { - AY8910Write(0, 0, data); - } - return; - - case 0xf801: - if (~fastfred_hardware_type & 1) { - AY8910Write(0, 1, data); - } - return; - } -} - -static UINT8 __fastcall fastfred_cpu0_read(UINT16 address) -{ - - if (imagomode && address >= 0x1000 && address <= 0x1fff) { - imago_sprites_address = address & 0xfff; - return 0xff; - } - - switch (address) - { - case 0xe000: // buttons - case 0xe802: - return DrvInput[0]; - - case 0xe800: { - return ((fastfred_hardware_type == 0) || boggy84mode) ? DrvDips[0] : DrvInput[1]; - } - - case 0xf000: // dip 1 - return DrvDips[0]; - - case 0xe801: // dip 2 - return DrvDips[1]; - - case 0xe803: // joy inputs - return DrvInput[1]; - - case 0xf800: // watchdog - return 0; - } - - if (flyboymode) { - if (address >= 0xc085 && address <= 0xc099) { - return flyboy_custom1_io_r(); - } - - if (address >= 0xc8fb && address <= 0xc900) { - return flyboy_custom2_io_r(); - } - } - - if (address >= 0xc800 && address <= 0xcfff) { - return fastfred_custom_io_r(address & 0x7ff); - } - - return 0; -} - -static void __fastcall fastfred_cpu1_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3000: - fastfred_cpu1_interrupt_enable = data & 1; - return; - - case 0x4000: - AY8910Reset(0); - AY8910Reset(1); - return; - - case 0x5000: - case 0x5001: - case 0x6000: - case 0x6001: - AY8910Write((address >> 13) & 1, address & 1, data); - return; - - case 0x7000: - return; - } -} - -static UINT8 __fastcall fastfred_cpu1_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - return fastfred_soundlatch; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - fastfred_background_color = 0; - fastfred_cpu0_interrupt_enable = 0; - fastfred_cpu1_interrupt_enable = 0; - fastfred_colorbank = 0; - fastfred_charbank = 0; - fastfred_flipscreenx = 0; - fastfred_flipscreeny = 0; - fastfred_soundlatch = 0; - memset(fastfred_scroll, 0, sizeof(fastfred_scroll)); - memset(fastfred_color_select, 0, sizeof(fastfred_color_select)); - - memset(&imago_sprites, 0, sizeof(imago_sprites)); - imago_sprites_address = 0; - imago_sprites_bank = 0; - - DrvReset = 0; - - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - - AY8910Reset(i); - } - - return 0; -} - -static INT32 DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0, bit1, bit2, bit3; - INT32 r, g, b; - - bit0 = (Prom[i + 0x000] >> 0) & 0x01; - bit1 = (Prom[i + 0x000] >> 1) & 0x01; - bit2 = (Prom[i + 0x000] >> 2) & 0x01; - bit3 = (Prom[i + 0x000] >> 3) & 0x01; - r = bit0 * 14 + bit1 * 31 + bit2 * 66 + bit3 * 144; - - bit0 = (Prom[i + 0x100] >> 0) & 0x01; - bit1 = (Prom[i + 0x100] >> 1) & 0x01; - bit2 = (Prom[i + 0x100] >> 2) & 0x01; - bit3 = (Prom[i + 0x100] >> 3) & 0x01; - g = bit0 * 14 + bit1 * 31 + bit2 * 66 + bit3 * 144; - - bit0 = (Prom[i + 0x200] >> 0) & 0x01; - bit1 = (Prom[i + 0x200] >> 1) & 0x01; - bit2 = (Prom[i + 0x200] >> 2) & 0x01; - bit3 = (Prom[i + 0x200] >> 3) & 0x01; - b = bit0 * 14 + bit1 * 31 + bit2 * 66 + bit3 * 144; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - - if (imagomode) { - DrvPalette[0x100+0x40+0] = BurnHighCol(0x15, 0x00, 0x00, 0); - DrvPalette[0x100+0x40+1] = BurnHighCol(0x00, 0x00, 0x00, 0); - } - - return 0; -} - -static INT32 GraphicsDecode() -{ - static INT32 TilePlanes[3] = { 0x20000, 0x10000, 0x00000 }; - static INT32 SpriPlanes[3] = { 0x10000, 0x08000, 0x00000 }; - static INT32 SharXOffs[16] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47 }; - static INT32 SharYOffs[16] = { 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, - 0x80, 0x88, 0x90, 0x98, 0xa0, 0xa8, 0xb0, 0xb8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, Gfx0, 0x06000); - GfxDecode(0x400, 3, 8, 8, TilePlanes, SharXOffs, SharYOffs, 0x040, tmp, Gfx0); - - memcpy (tmp, Gfx1, 0x03000); - GfxDecode(0x080, 3, 16, 16, SpriPlanes, SharXOffs, SharYOffs, 0x100, tmp, Gfx1); - - BurnFree (tmp); - - return 0; -} - -static INT32 ImagoGraphicsDecode() -{ - INT32 charplanes[3] = { RGN_FRAC(0x3000, 2,3), RGN_FRAC(0x3000, 1,3), RGN_FRAC(0x3000, 0,3) }; - INT32 charxoffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 charyoffs[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }; - - INT32 imago1bppplanes[1] = { 0 }; - INT32 imago1bppxoffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 imago1bppyoffs[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, Gfx0, 0x03000); - GfxDecode(0x200, 3, 8, 8, charplanes, charxoffs, charyoffs, 0x040, tmp, Gfx0); - - memcpy (tmp, Gfx2, 0x03000); - GfxDecode(0x200, 3, 8, 8, charplanes, charxoffs, charyoffs, 0x040, tmp, Gfx2); - - memcpy (tmp, Gfx3, 0x01000); - GfxDecode(0x200, 1, 8, 8, imago1bppplanes, imago1bppxoffs, imago1bppyoffs, 0x040, tmp, Gfx3); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvLoadRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - INT32 gfx1_loaded = 0; - UINT8 *Rom0Load = Rom0; - UINT8 *Rom1Load = Rom1; - UINT8 *Gfx0Load = Gfx0; - UINT8 *Gfx1Load = Gfx1; - UINT8 *Gfx2Load = Gfx2; - UINT8 *Gfx3Load = Gfx3; - UINT8 *PromLoad = Prom; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(Rom0Load, i, 1)) return 1; - Rom0Load += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(Rom1Load, i, 1)) return 1; - Rom1Load += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(Gfx0Load, i, 1)) return 1; - Gfx0Load += ri.nLen; - gfx1_loaded = 1; - - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(Gfx1Load, i, 1)) return 1; - Gfx1Load += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 5) { - if (BurnLoadRom(PromLoad, i, 1)) return 1; - PromLoad += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 6) { - if (BurnLoadRom(Gfx2Load, i, 1)) return 1; - Gfx2Load += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 7) { - if (BurnLoadRom(Gfx3Load, i, 1)) return 1; - Gfx3Load += ri.nLen; - - continue; - } - } - - if (!gfx1_loaded) { - memcpy (Gfx0 + 0x0000, Gfx1 + 0x0000, 0x1000); - memcpy (Gfx0 + 0x2000, Gfx1 + 0x1000, 0x1000); - memcpy (Gfx0 + 0x4000, Gfx1 + 0x2000, 0x1000); - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Rom0 = Next; Next += 0x10000; - Rom1 = Next; Next += 0x10000; - - Gfx0 = Next; Next += 0x20000; - Gfx1 = Next; Next += 0x20000; - Gfx2 = Next; Next += 0x20000; - Gfx3 = Next; Next += 0x20000; - GfxImagoSprites= Next; Next += 0x20000; - - Prom = Next; Next += 0x00300; - - DrvPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - - AllRam = Next; - - DrvMainRAM = Next; Next += 0x10000; - DrvVidRAM = Next; Next += 0x10000; - DrvFGVidRAM = Next; Next += 0x10000; - DrvAttrRAM = Next; Next += 0x10000; - DrvSubRAM = Next; Next += 0x10000; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (DrvLoadRoms()) return 1; - if (DrvPaletteInit()) return 1; - if (fastfred_hardware_type == 3) { - if (ImagoGraphicsDecode()) return 1; - } else { - if (GraphicsDecode()) return 1; - } - } - - ZetInit(0); - ZetOpen(0); - - ZetMapMemory(Rom0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvMainRAM, 0xc000, 0xc7ff, MAP_RAM); - - if (fastfred_hardware_type == 3) { - ZetUnmapMemory(0x1000, 0x1fff, MAP_ROM); // sprites dma addy - ZetMapMemory(DrvFGVidRAM, 0xc800, 0xcfff, MAP_RAM); - } - - if (fastfred_hardware_type & 1) { // Fast Freddie, Fly Boy & Imago - ZetMapMemory(DrvVidRAM, 0xd000, 0xd3ff, MAP_RAM); // video ram - ZetMapMemory(DrvVidRAM, 0xd400, 0xd7ff, MAP_RAM); // mirror @ +0x400 - ZetMapMemory(DrvAttrRAM, 0xd800, 0xdbff, MAP_READ); - } else { // jump coaster, boggy84 - ZetMapMemory(DrvVidRAM, 0xd800, 0xdbff, MAP_RAM); // video ram - ZetMapMemory(DrvVidRAM, 0xdc00, 0xdfff, MAP_RAM); // mirror @ +0x400 - ZetMapMemory(DrvAttrRAM, 0xd000, 0xd3ff, MAP_READ); - } - - ZetSetWriteHandler(fastfred_cpu0_write); - ZetSetReadHandler(fastfred_cpu0_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(Rom1, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvSubRAM, 0x2000, 0x23ff, MAP_RAM); - ZetSetWriteHandler(fastfred_cpu1_write); - ZetSetReadHandler(fastfred_cpu1_read); - ZetClose(); - - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); - - // for boggy '84, remove horrible hiss on one of the ay's channels using LPF. - filter_rc_init(0, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_P(0), 0); // (CAP_P(0) = passthru / mix only) - filter_rc_init(1, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(0x2a0), 1); - filter_rc_init(2, FLT_RC_LOWPASS, 1000, 5100, 0, CAP_N(0x4a0), 1); - - filter_rc_set_route(0, 0.10, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(1, 0.20, BURN_SND_ROUTE_BOTH); - filter_rc_set_route(2, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - GenericTilesExit(); - - AY8910Exit(0); - AY8910Exit(1); - - filter_rc_exit(); - - BurnFree (AllMem); - fastfred_hardware_type = 0; - flyboymode = 0; - boggy84mode = 0; - boggy84bmode = 0; - imagomode = 0; - - return 0; -} - -static void draw_sprites() -{ - UINT8 *fastfred_spriteram = DrvAttrRAM + 0x40; - - for (INT32 offs = 32 - 4; offs >= 0; offs -= 4) - { - INT32 code, sx, sy; - INT32 flipx, flipy; - - sx = fastfred_spriteram[offs + 3]; - sy = 240 - fastfred_spriteram[offs]; - - if (fastfred_hardware_type == 3) - { - // Imago - code = (fastfred_spriteram[offs + 1]) & 0x3f; - - flipx = 0; - flipy = 0; - } - else if (fastfred_hardware_type == 2) - { - // Boggy 84 - code = fastfred_spriteram[offs + 1] & 0x7f; - flipx = 0; - flipy = fastfred_spriteram[offs + 1] & 0x80; - } - else if (fastfred_hardware_type == 1) - { - // Fly-Boy/Fast Freddie/Red Robin - code = fastfred_spriteram[offs + 1] & 0x7f; - flipx = 0; - flipy = ~fastfred_spriteram[offs + 1] & 0x80; - } - else - { - // Jump Coaster - code = (fastfred_spriteram[offs + 1] & 0x3f) | 0x40; - flipx = ~fastfred_spriteram[offs + 1] & 0x40; - flipy = fastfred_spriteram[offs + 1] & 0x80; - } - - sy -= 16; // offsets - - if (sy < -15) sy += 256; - - if (fastfred_flipscreenx) - { - sx = 240 - sx; - flipx = !flipx; - } - if (fastfred_flipscreeny) - { - sy = 240 - sy; - flipy = !flipy; - } - - INT32 color = fastfred_colorbank | (fastfred_spriteram[offs + 2] & 7); - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, (imagomode) ? GfxImagoSprites : Gfx1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, (imagomode) ? GfxImagoSprites : Gfx1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, (imagomode) ? GfxImagoSprites : Gfx1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, (imagomode) ? GfxImagoSprites : Gfx1); - } - } - } -} - -static void draw_chars() -{ // draw chars - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = offs & 0x1f; - INT32 sy = (offs >> 2) & 0xf8; - - INT32 code = fastfred_charbank | DrvVidRAM[offs]; - INT32 color = fastfred_colorbank | fastfred_color_select[sx]; - - if (imagomode) {// for bg - UINT8 x = offs & 0x1f; - - code = fastfred_charbank * 0x100 + DrvVidRAM[offs]; - color = fastfred_colorbank | (DrvAttrRAM[2 * x + 1] & 0x07); - } - - sy -= 16; - - sy -= fastfred_scroll[sx]; - if (sy < -15) sy += 0x100; - - sx <<= 3; - - if (fastfred_flipscreeny) { - if (fastfred_flipscreenx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, Gfx0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, Gfx0); - } - } else { - if (fastfred_flipscreenx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, Gfx0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, Gfx0); - } - } - } -} - -static void draw_web() -{ // imago - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 code = offs & 0x1ff; - INT32 color = 0; - - sy -= 16; - - if (sy < -7) sy += 256; - if (sx < -7) sx += 256; - - if (fastfred_flipscreeny) { - if (fastfred_flipscreenx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 1, 0x140, Gfx3); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 1, 0x140, Gfx3); - } - } else { - if (fastfred_flipscreenx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 1, 0x140, Gfx3); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 1, 0x140, Gfx3); - } - } - } -} - -static void draw_imagofg() -{ // imago - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 code = DrvFGVidRAM[offs]; - INT32 color = 2; - - sy -= 16; - - if (sy < -7) sy += 256; - if (sx < -7) sx += 256; - - if (fastfred_flipscreeny) { - if (fastfred_flipscreenx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, Gfx2); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, Gfx2); - } - } else { - if (fastfred_flipscreenx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, Gfx2); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, Gfx2); - } - } - } -} - - -static INT32 ImagoDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - { // fill background - for (INT32 offs = 0; offs < nScreenWidth * nScreenHeight; offs++) { - pTransDraw[offs] = fastfred_background_color; - } - } - - if (nBurnLayer & 1) draw_web(); - // draw_stars(); - if (nBurnLayer & 2) draw_chars(); // imago's bg - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) draw_imagofg(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - { // fill background - for (INT32 offs = 0; offs < nScreenWidth * nScreenHeight; offs++) { - pTransDraw[offs] = fastfred_background_color; - } - } - - if (nBurnLayer & 1) draw_chars(); - - if (nSpriteEnable & 1) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvMakeInputs() -{ - // Reset Inputs (all active HIGH) - DrvInput[0] = 0; - DrvInput[1] = 0; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvMakeInputs(); - - INT32 nInterleave = 128; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nCyclesTotal[2] = { 3108000 / 60, 1536000 / 60 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nCycleSegment; - - ZetOpen(0); - nCycleSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += ZetRun(nCycleSegment); - if (i == ( nInterleave - 1) && fastfred_cpu0_interrupt_enable) ZetNmi(); - ZetClose(); - - if (~fastfred_hardware_type & 1) continue; - - ZetOpen(1); - nCycleSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - nCyclesDone[1] += ZetRun(nCycleSegment); - if (fastfred_cpu1_interrupt_enable && (i % (nInterleave / 4)) == ((nInterleave / 4) - 1)) ZetNmi(); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - - if (boggy84mode) { // hiss-removal lpf (see init) - filter_rc_update(0, pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen); - filter_rc_update(1, pAY8910Buffer[1], pBurnSoundOut, nBurnSoundLen); - filter_rc_update(2, pAY8910Buffer[2], pBurnSoundOut, nBurnSoundLen); - } - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(fastfred_background_color); - SCAN_VAR(fastfred_cpu0_interrupt_enable); - SCAN_VAR(fastfred_cpu1_interrupt_enable); - SCAN_VAR(fastfred_colorbank); - SCAN_VAR(fastfred_charbank); - SCAN_VAR(fastfred_flipscreenx); - SCAN_VAR(fastfred_flipscreeny); - SCAN_VAR(fastfred_soundlatch); - SCAN_VAR(fastfred_scroll); - SCAN_VAR(fastfred_color_select); - } - - return 0; -} - -static INT32 fastfredInit() -{ - fastfred_hardware_type = 1; - - return DrvInit(); -} - - -// Fast Freddie - -static struct BurnRomInfo fastfredRomDesc[] = { - { "ffr.01", 0x1000, 0x15032c13, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "ffr.02", 0x1000, 0xf9642744, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ffr.03", 0x1000, 0xf0919727, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ffr.04", 0x1000, 0xc778751e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ffr.05", 0x1000, 0xcd6e160a, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ffr.06", 0x1000, 0x67f7f9b3, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ffr.07", 0x1000, 0x2935c76a, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ffr.08", 0x1000, 0x0fb79e7b, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ffr.09", 0x1000, 0xa1ec8d7e, 2 | BRF_PRG | BRF_ESS }, // 8 audiocpu - { "ffr.10", 0x1000, 0x460ca837, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "ffr.14", 0x1000, 0xe8a00e81, 3 | BRF_GRA }, // 10 gfx1 - { "ffr.17", 0x1000, 0x701e0f01, 3 | BRF_GRA }, // 11 - { "ffr.15", 0x1000, 0xb49b053f, 3 | BRF_GRA }, // 12 - { "ffr.18", 0x1000, 0x4b208c8b, 3 | BRF_GRA }, // 13 - { "ffr.16", 0x1000, 0x8c686bc2, 3 | BRF_GRA }, // 14 - { "ffr.19", 0x1000, 0x75b613f6, 3 | BRF_GRA }, // 15 - - { "ffr.11", 0x1000, 0x0e1316d4, 4 | BRF_GRA }, // 16 gfx2 - { "ffr.12", 0x1000, 0x94c06686, 4 | BRF_GRA }, // 17 - { "ffr.13", 0x1000, 0x3fcfaa8e, 4 | BRF_GRA }, // 18 - - { "red.9h", 0x0100, 0xb801e294, 5 | BRF_GRA }, // 19 proms - { "green.8h", 0x0100, 0x7da063d0, 5 | BRF_GRA }, // 20 - { "blue.7h", 0x0100, 0x85c05c18, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(fastfred) -STD_ROM_FN(fastfred) - -struct BurnDriver BurnDrvFastfred = { - "fastfred", "flyboy", NULL, NULL, "1982", - "Fast Freddie\0", NULL, "Kaneko (Atari license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, fastfredRomInfo, fastfredRomName, NULL, NULL, CommonInputInfo, FastfredDIPInfo, - fastfredInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Fly-Boy - -static struct BurnRomInfo flyboyRomDesc[] = { - { "flyboy01.cpu", 0x1000, 0xb05aa900, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "flyboy02.cpu", 0x1000, 0x474867f5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rom3.cpu", 0x1000, 0xd2f8f085, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rom4.cpu", 0x1000, 0x19e5e15c, 1 | BRF_PRG | BRF_ESS }, // 3 - { "flyboy05.cpu", 0x1000, 0x207551f7, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rom6.cpu", 0x1000, 0xf5464c72, 1 | BRF_PRG | BRF_ESS }, // 5 - { "rom7.cpu", 0x1000, 0x50a1baff, 1 | BRF_PRG | BRF_ESS }, // 6 - { "rom8.cpu", 0x1000, 0xfe2ae95d, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "rom9.cpu", 0x1000, 0x5d05d1a0, 2 | BRF_PRG | BRF_ESS }, // 8 audiocpu - { "rom10.cpu", 0x1000, 0x7a28005b, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "rom14.rom", 0x1000, 0xaeb07260, 3 | BRF_GRA }, // 10 gfx1 - { "rom17.rom", 0x1000, 0xa834325b, 3 | BRF_GRA }, // 11 - { "rom15.rom", 0x1000, 0xc10c7ce2, 3 | BRF_GRA }, // 12 - { "rom18.rom", 0x1000, 0x2f196c80, 3 | BRF_GRA }, // 13 - { "rom16.rom", 0x1000, 0x719246b1, 3 | BRF_GRA }, // 14 - { "rom19.rom", 0x1000, 0x00c1c5d2, 3 | BRF_GRA }, // 15 - - { "rom11.rom", 0x1000, 0xee7ec342, 4 | BRF_GRA }, // 16 gfx2 - { "rom12.rom", 0x1000, 0x84d03124, 4 | BRF_GRA }, // 17 - { "rom13.rom", 0x1000, 0xfcb33ff4, 4 | BRF_GRA }, // 18 - - { "red.9h", 0x0100, 0xb801e294, 5 | BRF_GRA }, // 19 proms - { "green.8h", 0x0100, 0x7da063d0, 5 | BRF_GRA }, // 20 - { "blue.7h", 0x0100, 0x85c05c18, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(flyboy) -STD_ROM_FN(flyboy) - -static void flyboy_patch() -{ - // The simulation fails due to the way Doze works, - // so use patches from the bootleg - Rom0[0x0397] = 0x00; - Rom0[0x0398] = 0x00; - Rom0[0x0399] = 0x00; - Rom0[0x049F] = 0x00; - Rom0[0x04A0] = 0x00; - Rom0[0x04A1] = 0x00; - Rom0[0x04F6] = 0x00; - Rom0[0x04F7] = 0x00; - Rom0[0x04F8] = 0x00; - Rom0[0x0567] = 0x00; - Rom0[0x0568] = 0x00; - Rom0[0x0569] = 0x00; - Rom0[0x069F] = 0x00; - Rom0[0x06A0] = 0x00; - Rom0[0x06A1] = 0x00; - Rom0[0x06A2] = 0x00; - Rom0[0x076F] = 0x00; - Rom0[0x0770] = 0x00; - Rom0[0x0856] = 0x00; - Rom0[0x0857] = 0x00; - Rom0[0x09D9] = 0x00; - Rom0[0x09DA] = 0x00; - Rom0[0x09DB] = 0x00; - Rom0[0x0A87] = 0x00; - Rom0[0x0A88] = 0x00; - Rom0[0x0A89] = 0x00; - Rom0[0x0A8B] = 0x00; - Rom0[0x0A8C] = 0x00; - Rom0[0x0A8D] = 0x00; - Rom0[0x0A8E] = 0x00; - Rom0[0x0A8F] = 0x00; - Rom0[0x1037] = 0x00; - Rom0[0x1038] = 0x00; - Rom0[0x1045] = 0xC9; - Rom0[0x1060] = 0xC9; - Rom0[0x106E] = 0x00; - Rom0[0x106F] = 0x00; - Rom0[0x108B] = 0xC9; - Rom0[0x1099] = 0x00; - Rom0[0x109A] = 0x00; - Rom0[0x10B4] = 0xC9; - Rom0[0x10C2] = 0x00; - Rom0[0x10C3] = 0x00; - Rom0[0x10DD] = 0x00; - Rom0[0x10DE] = 0x00; - Rom0[0x10E9] = 0xC9; - Rom0[0x1103] = 0x00; - Rom0[0x1104] = 0x00; - Rom0[0x110F] = 0xC9; - Rom0[0x1122] = 0x00; - Rom0[0x1123] = 0x00; - Rom0[0x1124] = 0x00; - Rom0[0x1125] = 0x00; - Rom0[0x1126] = 0x00; - Rom0[0x1127] = 0x00; - Rom0[0x1128] = 0x00; - Rom0[0x1129] = 0x00; - Rom0[0x112A] = 0x00; - Rom0[0x117A] = 0x00; - Rom0[0x117B] = 0x00; - Rom0[0x117C] = 0x00; - Rom0[0x117D] = 0x00; - Rom0[0x117E] = 0x00; - Rom0[0x117F] = 0x00; - Rom0[0x1317] = 0x00; - Rom0[0x1318] = 0x00; - Rom0[0x1319] = 0x00; - Rom0[0x131A] = 0x00; - Rom0[0x131B] = 0x00; - Rom0[0x4A55] = 0x01; -} - -static INT32 flyboyInit() -{ - fastfred_hardware_type = 1; - flyboymode = 1; - - INT32 nRet = DrvInit(); - if (!nRet) { - flyboy_patch(); - } - return nRet; -} - -struct BurnDriver BurnDrvFlyboy = { - "flyboy", NULL, NULL, NULL, "1982", - "Fly-Boy\0", NULL, "Kaneko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, flyboyRomInfo, flyboyRomName, NULL, NULL, CommonInputInfo, FlyboyDIPInfo, - flyboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Fly-Boy (bootleg) - -static struct BurnRomInfo flyboybRomDesc[] = { - { "rom1.cpu", 0x1000, 0xe9e1f527, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "rom2.cpu", 0x1000, 0x07fbe78c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rom3.cpu", 0x1000, 0xd2f8f085, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rom4.cpu", 0x1000, 0x19e5e15c, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rom5.cpu", 0x1000, 0xd56872ea, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rom6.cpu", 0x1000, 0xf5464c72, 1 | BRF_PRG | BRF_ESS }, // 5 - { "rom7.cpu", 0x1000, 0x50a1baff, 1 | BRF_PRG | BRF_ESS }, // 6 - { "rom8.cpu", 0x1000, 0xfe2ae95d, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "rom9.cpu", 0x1000, 0x5d05d1a0, 2 | BRF_PRG | BRF_ESS }, // 8 audiocpu - { "rom10.cpu", 0x1000, 0x7a28005b, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "rom14.rom", 0x1000, 0xaeb07260, 3 | BRF_GRA }, // 10 gfx1 - { "rom17.rom", 0x1000, 0xa834325b, 3 | BRF_GRA }, // 11 - { "rom15.rom", 0x1000, 0xc10c7ce2, 3 | BRF_GRA }, // 12 - { "rom18.rom", 0x1000, 0x2f196c80, 3 | BRF_GRA }, // 13 - { "rom16.rom", 0x1000, 0x719246b1, 3 | BRF_GRA }, // 14 - { "rom19.rom", 0x1000, 0x00c1c5d2, 3 | BRF_GRA }, // 15 - - { "rom11.rom", 0x1000, 0xee7ec342, 4 | BRF_GRA }, // 16 gfx2 - { "rom12.rom", 0x1000, 0x84d03124, 4 | BRF_GRA }, // 17 - { "rom13.rom", 0x1000, 0xfcb33ff4, 4 | BRF_GRA }, // 18 - - { "red.9h", 0x0100, 0xb801e294, 5 | BRF_GRA }, // 19 proms - { "green.8h", 0x0100, 0x7da063d0, 5 | BRF_GRA }, // 20 - { "blue.7h", 0x0100, 0x85c05c18, 5 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(flyboyb) -STD_ROM_FN(flyboyb) - -struct BurnDriver BurnDrvFlyboyb = { - "flyboyb", "flyboy", NULL, NULL, "1982", - "Fly-Boy (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, flyboybRomInfo, flyboybRomName, NULL, NULL, CommonInputInfo, FlyboyDIPInfo, - fastfredInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Jump Coaster - -static struct BurnRomInfo jumpcoasRomDesc[] = { - { "jumpcoas.001", 0x2000, 0x0778c953, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "jumpcoas.002", 0x2000, 0x57f59ce1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jumpcoas.003", 0x2000, 0xd9fc93be, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jumpcoas.004", 0x2000, 0xdc108fc1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "jumpcoas.005", 0x1000, 0x2dce6b07, 4 | BRF_GRA }, // 4 gfx1 - { "jumpcoas.006", 0x1000, 0x0d24aa1b, 4 | BRF_GRA }, // 5 - { "jumpcoas.007", 0x1000, 0x14c21e67, 4 | BRF_GRA }, // 6 - - { "jumpcoas.red", 0x0100, 0x13714880, 5 | BRF_GRA }, // 7 proms - { "jumpcoas.gre", 0x0100, 0x05354848, 5 | BRF_GRA }, // 8 - { "jumpcoas.blu", 0x0100, 0xf4662db7, 5 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(jumpcoas) -STD_ROM_FN(jumpcoas) - -static INT32 jumpcoasInit() -{ - fastfred_hardware_type = 0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvJumpcoas = { - "jumpcoas", NULL, NULL, NULL, "1983", - "Jump Coaster\0", NULL, "Kaneko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, jumpcoasRomInfo, jumpcoasRomName, NULL, NULL, CommonInputInfo, JumpcoasDIPInfo, - jumpcoasInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Jump Coaster (Taito) - -static struct BurnRomInfo jumpcoastRomDesc[] = { - { "1.d1", 0x2000, 0x8ac220c5, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "jumpcoas.002", 0x2000, 0x57f59ce1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.d3", 0x2000, 0x17e4deba, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jumpcoas.004", 0x2000, 0xdc108fc1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "jumpcoas.005", 0x1000, 0x2dce6b07, 4 | BRF_GRA }, // 4 gfx1 - { "jumpcoas.006", 0x1000, 0x0d24aa1b, 4 | BRF_GRA }, // 5 - { "jumpcoas.007", 0x1000, 0x14c21e67, 4 | BRF_GRA }, // 6 - - { "jumpcoas.red", 0x0100, 0x13714880, 5 | BRF_GRA }, // 7 proms - { "jumpcoas.gre", 0x0100, 0x05354848, 5 | BRF_GRA }, // 8 - { "jumpcoas.blu", 0x0100, 0xf4662db7, 5 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(jumpcoast) -STD_ROM_FN(jumpcoast) - -struct BurnDriver BurnDrvJumpcoast = { - "jumpcoast", "jumpcoas", NULL, NULL, "1983", - "Jump Coaster (Taito)\0", NULL, "Kaneko (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, jumpcoastRomInfo, jumpcoastRomName, NULL, NULL, CommonInputInfo, JumpcoasDIPInfo, - jumpcoasInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Boggy '84 - -static struct BurnRomInfo boggy84RomDesc[] = { - { "p1.d1", 0x2000, 0x722cc0ec, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "p2.d2", 0x2000, 0x6c096798, 1 | BRF_PRG | BRF_ESS }, // 1 - { "p3.d3", 0x2000, 0x9da59104, 1 | BRF_PRG | BRF_ESS }, // 2 - { "p4.d4", 0x2000, 0x73ef6807, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "g1.h10", 0x1000, 0xf4238c68, 4 | BRF_GRA }, // 4 gfx1 - { "g2.h11", 0x1000, 0xce285bd2, 4 | BRF_GRA }, // 5 - { "g3.h12", 0x1000, 0x02f5f4fa, 4 | BRF_GRA }, // 6 - - { "r.e10", 0x0100, 0xf3862912, 5 | BRF_GRA }, // 7 proms - { "g.e11", 0x0100, 0x80b87220, 5 | BRF_GRA }, // 8 - { "b.e12", 0x0100, 0x52b7f445, 5 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(boggy84) -STD_ROM_FN(boggy84) - -static INT32 boggy84Init() -{ - fastfred_hardware_type = 2; - boggy84mode = 1; - - return DrvInit(); -} - -static INT32 boggy84bInit() -{ - fastfred_hardware_type = 2; - boggy84mode = 1; - boggy84bmode = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvBoggy84 = { - "boggy84", NULL, NULL, NULL, "1983", - "Boggy '84\0", NULL, "Kaneko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, boggy84RomInfo, boggy84RomName, NULL, NULL, TwoBtnInputInfo, Boggy84DIPInfo, - boggy84Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - -// Boggy '84 (bootleg) - -static struct BurnRomInfo boggy84bRomDesc[] = { - { "cpurom1.bin", 0x2000, 0x665266c0, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "cpurom2.bin", 0x2000, 0x6c096798, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cpurom3.bin", 0x2000, 0x9da59104, 1 | BRF_PRG | BRF_ESS }, // 2 - { "cpurom4.bin", 0x2000, 0x73ef6807, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "gfx1.bin", 0x1000, 0xf4238c68, 4 | BRF_GRA }, // 4 gfx1 - { "gfx2.bin", 0x1000, 0xce285bd2, 4 | BRF_GRA }, // 5 - { "gfx3.bin", 0x1000, 0x02f5f4fa, 4 | BRF_GRA }, // 6 - - { "r12e", 0x0100, 0xf3862912, 5 | BRF_GRA }, // 7 proms - { "g12e", 0x0100, 0x80b87220, 5 | BRF_GRA }, // 8 - { "b12e", 0x0100, 0x52b7f445, 5 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(boggy84b) -STD_ROM_FN(boggy84b) - -struct BurnDriver BurnDrvBoggy84b = { - "boggy84b", "boggy84", NULL, NULL, "1983", - "Boggy '84 (bootleg)\0", NULL, "bootleg (Eddie's Games)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, boggy84bRomInfo, boggy84bRomName, NULL, NULL, TwoBtnInputInfo, Boggy84DIPInfo, - boggy84bInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Red Robin - -static struct BurnRomInfo redrobinRomDesc[] = { - { "redro01f.16d", 0x1000, 0x0788ce10, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "redrob02.17d", 0x1000, 0xbf9b95b4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "redrob03.14b", 0x1000, 0x9386e40b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "redrob04.16b", 0x1000, 0x5cafffc4, 1 | BRF_PRG | BRF_ESS }, // 3 - { "redrob05.17b", 0x1000, 0xa224d41e, 1 | BRF_PRG | BRF_ESS }, // 4 - { "redrob06.14a", 0x1000, 0x822e0bd7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "redrob07.15a", 0x1000, 0x0deacf17, 1 | BRF_PRG | BRF_ESS }, // 6 - { "redrob08.17a", 0x1000, 0x095cf908, 1 | BRF_PRG | BRF_ESS }, // 7 - { "redrob20.15e", 0x4000, 0x5cce22b7, 1 | BRF_PRG | BRF_ESS }, // 8 - - { "redrob09.1f", 0x1000, 0x21af2d03, 2 | BRF_PRG | BRF_ESS }, // 9 audiocpu - { "redro10f.1e", 0x1000, 0xbf0e772f, 2 | BRF_PRG | BRF_ESS }, // 10 - - { "redrob14.17l", 0x1000, 0xf6c571e0, 3 | BRF_GRA }, // 11 gfx1 - { "redrob17.17j", 0x1000, 0x86dcdf21, 3 | BRF_GRA }, // 12 - { "redrob15.15k", 0x1000, 0x05f7df48, 3 | BRF_GRA }, // 13 - { "redrob18.16j", 0x1000, 0x7aeb2bb9, 3 | BRF_GRA }, // 14 - { "redrob16.14l", 0x1000, 0x21349d09, 3 | BRF_GRA }, // 15 - { "redrob19.14j", 0x1000, 0x7184d999, 3 | BRF_GRA }, // 16 - - { "redrob11.17m", 0x1000, 0x559f7894, 4 | BRF_GRA }, // 17 gfx2 - { "redrob12.15m", 0x1000, 0xa763b11d, 4 | BRF_GRA }, // 18 - { "redrob13.14m", 0x1000, 0xd667f45b, 4 | BRF_GRA }, // 19 - - { "red.9h", 0x0100, 0xb801e294, 5 | BRF_GRA }, // 20 proms - { "green.8h", 0x0100, 0x7da063d0, 5 | BRF_GRA }, // 21 - { "blue.7h", 0x0100, 0x85c05c18, 5 | BRF_GRA }, // 22 -}; - -STD_ROM_PICK(redrobin) -STD_ROM_FN(redrobin) - -struct BurnDriver BurnDrvRedrobin = { - "redrobin", NULL, NULL, NULL, "1986", - "Red Robin\0", NULL, "Elettronolo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, redrobinRomInfo, redrobinRomName, NULL, NULL, TwoBtnInputInfo, RedrobinDIPInfo, - fastfredInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -static INT32 imagoInit() -{ - fastfred_hardware_type = 3; - imagomode = 1; - - INT32 nRet = DrvInit(); - if (!nRet) { - memmove (Rom0 + 0x2000, Rom0 + 0x1000, 0x5000); - memset (Rom0 + 0x1000, 0, 0x1000); - - } - return nRet; -} - - -// Imago (cocktail set) - -static struct BurnRomInfo imagoRomDesc[] = { - { "imago11.82", 0x2000, 0x3cce69b4, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "imago12.83", 0x2000, 0x8dff98c0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "13.bin", 0x2000, 0xae684602, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "imago08.60", 0x1000, 0x4f77c2c9, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "1.bin", 0x1000, 0xf80a0b69, 3 | BRF_GRA }, // 4 gfx1 - { "imago02.40", 0x1000, 0x71354480, 3 | BRF_GRA }, // 5 - { "3.bin", 0x1000, 0x722fd625, 3 | BRF_GRA }, // 6 - - { "imago04.51", 0x1000, 0xed987b3e, 4 | BRF_GRA }, // 7 gfx2 - { "imago05.52", 0x1000, 0x77ee68ce, 4 | BRF_GRA }, // 8 - { "imago07.56", 0x1000, 0x48b35190, 4 | BRF_GRA }, // 9 - { "imago06.55", 0x1000, 0x136990fc, 4 | BRF_GRA }, // 10 - { "imago09.64", 0x1000, 0x9efb806d, 4 | BRF_GRA }, // 11 - { "imago10.65", 0x1000, 0x801a18d3, 4 | BRF_GRA }, // 12 - - { "imago14.170", 0x1000, 0xeded37f6, 6 | BRF_GRA }, // 13 gfx3 - - { "imago15.191", 0x1000, 0x85fcc195, 7 | BRF_GRA }, // 14 gfx4 - - { "imago.96", 0x0100, 0x5ba81edc, 5 | BRF_GRA }, // 15 proms - { "imago.95", 0x0100, 0xe2b7aa09, 5 | BRF_GRA }, // 16 - { "imago.97", 0x0100, 0xe28a7f00, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(imago) -STD_ROM_FN(imago) - -struct BurnDriver BurnDrvImago = { - "imago", NULL, NULL, NULL, "1984", - "Imago (cocktail set)\0", NULL, "Acom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, imagoRomInfo, imagoRomName, NULL, NULL, ImagoInputInfo, ImagoDIPInfo, - imagoInit, DrvExit, DrvFrame, ImagoDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Imago (no cocktail set) - -static struct BurnRomInfo imagoaRomDesc[] = { - { "imago11.82", 0x2000, 0x3cce69b4, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "imago12.83", 0x2000, 0x8dff98c0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "imago13.84", 0x2000, 0xf0f14b4d, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "imago08.60", 0x1000, 0x4f77c2c9, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "imago01.39", 0x1000, 0xf09fe0d4, 3 | BRF_GRA }, // 4 gfx1 - { "imago02.40", 0x1000, 0x71354480, 3 | BRF_GRA }, // 5 - { "imago03.41", 0x1000, 0x7aba3d98, 3 | BRF_GRA }, // 6 - - { "imago04.51", 0x1000, 0xed987b3e, 4 | BRF_GRA }, // 7 gfx2 - { "imago05.52", 0x1000, 0x77ee68ce, 4 | BRF_GRA }, // 8 - { "imago07.56", 0x1000, 0x48b35190, 4 | BRF_GRA }, // 9 - { "imago06.55", 0x1000, 0x136990fc, 4 | BRF_GRA }, // 10 - { "imago09.64", 0x1000, 0x9efb806d, 4 | BRF_GRA }, // 11 - { "imago10.65", 0x1000, 0x801a18d3, 4 | BRF_GRA }, // 12 - - { "imago.96", 0x0100, 0x5ba81edc, 5 | BRF_GRA }, // 15 proms - { "imago.95", 0x0100, 0xe2b7aa09, 5 | BRF_GRA }, // 16 - { "imago.97", 0x0100, 0xe28a7f00, 5 | BRF_GRA }, // 17 - - { "imago14.170", 0x1000, 0xeded37f6, 6 | BRF_GRA }, // 13 gfx3 - - { "imago15.191", 0x1000, 0x85fcc195, 7 | BRF_GRA }, // 14 gfx4 - -}; - -STD_ROM_PICK(imagoa) -STD_ROM_FN(imagoa) - -struct BurnDriver BurnDrvImagoa = { - "imagoa", "imago", NULL, NULL, "1983", - "Imago (no cocktail set)\0", NULL, "Acom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, imagoaRomInfo, imagoaRomName, NULL, NULL, ImagoInputInfo, ImagoDIPInfo, - imagoInit, DrvExit, DrvFrame, ImagoDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - diff --git a/jan/src/burn/drv/pre90s/d_firetrap.cpp b/jan/src/burn/drv/pre90s/d_firetrap.cpp deleted file mode 100644 index 57f3796ab..000000000 --- a/jan/src/burn/drv/pre90s/d_firetrap.cpp +++ /dev/null @@ -1,1180 +0,0 @@ -// FB Alpha Fire Trap driver module -// Based on MAME driver by Nicola Salmoria and Stephane Humbert - - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6502_intf.h" -#include "burn_ym3526.h" -#include "msm5205.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvM6502ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvBg0RAM; -static UINT8 *DrvBg1RAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvM6502RAM; -static UINT8 *scroll; -static UINT8 *banks; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[4]; -static UINT8 DrvReset; - -static UINT8 flipscreen; -static UINT8 soundlatch; -static UINT8 nmi_enable; -static UINT8 sound_irq_enable; -static UINT8 msm5205next; -static UINT8 MSM5205Last = 0; -static UINT8 adpcm_toggle; - -static UINT8 coin_command_pending; // bootleg -static UINT8 i8751_current_command; -static UINT8 i8751_return; -static INT32 i8751_init_ptr; - -static struct BurnInputInfo FiretrapInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 1, "p1 start" }, - {"P1 Left Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Left Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Left Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Right Up", BIT_DIGITAL, DrvJoy1 + 4, "p2 up" }, - {"P1 Right Down", BIT_DIGITAL, DrvJoy1 + 5, "p2 down" }, - {"P1 Right Left", BIT_DIGITAL, DrvJoy1 + 6, "p2 left" }, - {"P1 Right Right", BIT_DIGITAL, DrvJoy1 + 7, "p2 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Left Up", BIT_DIGITAL, DrvJoy2 + 0, "p3 up" }, - {"P2 Left Down", BIT_DIGITAL, DrvJoy2 + 1, "p3 down" }, - {"P2 Left Left", BIT_DIGITAL, DrvJoy2 + 2, "p3 left" }, - {"P2 Left Right", BIT_DIGITAL, DrvJoy2 + 3, "p3 right" }, - {"P2 Right Up", BIT_DIGITAL, DrvJoy2 + 4, "p4 up" }, - {"P2 Right Down", BIT_DIGITAL, DrvJoy2 + 5, "p4 down" }, - {"P2 Right Left", BIT_DIGITAL, DrvJoy2 + 6, "p4 left" }, - {"P2 Right Right", BIT_DIGITAL, DrvJoy2 + 7, "p4 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 2, "p3 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Firetrap) - -static struct BurnInputInfo FiretrapblInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 1, "p1 start" }, - {"P1 Left Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Left Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Left Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Right Up", BIT_DIGITAL, DrvJoy1 + 4, "p2 up" }, - {"P1 Right Down", BIT_DIGITAL, DrvJoy1 + 5, "p2 down" }, - {"P1 Right Left", BIT_DIGITAL, DrvJoy1 + 6, "p2 left" }, - {"P1 Right Right", BIT_DIGITAL, DrvJoy1 + 7, "p2 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Left Up", BIT_DIGITAL, DrvJoy2 + 0, "p3 up" }, - {"P2 Left Down", BIT_DIGITAL, DrvJoy2 + 1, "p3 down" }, - {"P2 Left Left", BIT_DIGITAL, DrvJoy2 + 2, "p3 left" }, - {"P2 Left Right", BIT_DIGITAL, DrvJoy2 + 3, "p3 right" }, - {"P2 Right Up", BIT_DIGITAL, DrvJoy2 + 4, "p4 up" }, - {"P2 Right Down", BIT_DIGITAL, DrvJoy2 + 5, "p4 down" }, - {"P2 Right Left", BIT_DIGITAL, DrvJoy2 + 6, "p4 left" }, - {"P2 Right Right", BIT_DIGITAL, DrvJoy2 + 7, "p4 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 2, "p3 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Firetrapbl) - -static struct BurnDIPInfo FiretrapDIPList[]= -{ - {0x18, 0xff, 0xff, 0xdf, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 5, "Coin A" }, - {0x18, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x18, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x18, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x18, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x18, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x18, 0x01, 0x18, 0x00, "4 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x08, "3 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x18, 0x01, 0x20, 0x00, "Upright" }, - {0x18, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x18, 0x01, 0x40, 0x00, "Off" }, - {0x18, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x18, 0x01, 0x80, 0x80, "Off" }, - {0x18, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x19, 0x01, 0x03, 0x02, "Easy" }, - {0x19, 0x01, 0x03, 0x03, "Normal" }, - {0x19, 0x01, 0x03, 0x01, "Hard" }, - {0x19, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x19, 0x01, 0x0c, 0x00, "2" }, - {0x19, 0x01, 0x0c, 0x0c, "3" }, - {0x19, 0x01, 0x0c, 0x08, "4" }, - {0x19, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x19, 0x01, 0x30, 0x10, "30k and 70k" }, - {0x19, 0x01, 0x30, 0x00, "50k and 100k" }, - {0x19, 0x01, 0x30, 0x30, "30k only" }, - {0x19, 0x01, 0x30, 0x20, "50k only" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x19, 0x01, 0x40, 0x00, "No" }, - {0x19, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x19, 0x01, 0x80, 0x80, "Off" }, - {0x19, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Firetrap) - -static struct BurnDIPInfo FiretrapjDIPList[]= -{ - {0x18, 0xff, 0xff, 0xdf, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 5, "Coin A" }, - {0x18, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x18, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x18, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x18, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x18, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x18, 0x01, 0x18, 0x00, "4 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x08, "3 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x18, 0x01, 0x20, 0x00, "Upright" }, - {0x18, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x18, 0x01, 0x40, 0x00, "Off" }, - {0x18, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x18, 0x01, 0x80, 0x80, "Off" }, - {0x18, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x19, 0x01, 0x03, 0x02, "Easy" }, - {0x19, 0x01, 0x03, 0x03, "Normal" }, - {0x19, 0x01, 0x03, 0x01, "Hard" }, - {0x19, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x19, 0x01, 0x0c, 0x00, "2" }, - {0x19, 0x01, 0x0c, 0x0c, "3" }, - {0x19, 0x01, 0x0c, 0x08, "4" }, - {0x19, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x19, 0x01, 0x30, 0x30, "50k & Every 70k" }, - {0x19, 0x01, 0x30, 0x20, "60k & Every 80k" }, - {0x19, 0x01, 0x30, 0x10, "80k & Every 100k" }, - {0x19, 0x01, 0x30, 0x00, "50k only" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x19, 0x01, 0x40, 0x00, "No" }, - {0x19, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x19, 0x01, 0x80, 0x80, "Off" }, - {0x19, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Firetrapj) - -static struct BurnDIPInfo FiretrapblDIPList[]= -{ - {0x18, 0xff, 0xff, 0xdf, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 5, "Coin A" }, - {0x18, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x18, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x18, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x18, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x18, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x18, 0x01, 0x18, 0x00, "4 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x08, "3 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x18, 0x01, 0x20, 0x00, "Upright" }, - {0x18, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x18, 0x01, 0x40, 0x00, "Off" }, - {0x18, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x18, 0x01, 0x80, 0x80, "Off" }, - {0x18, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x19, 0x01, 0x03, 0x02, "Easy" }, - {0x19, 0x01, 0x03, 0x03, "Normal" }, - {0x19, 0x01, 0x03, 0x01, "Hard" }, - {0x19, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x19, 0x01, 0x0c, 0x00, "2" }, - {0x19, 0x01, 0x0c, 0x0c, "3" }, - {0x19, 0x01, 0x0c, 0x08, "4" }, - {0x19, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x19, 0x01, 0x30, 0x10, "30k and 70k" }, - {0x19, 0x01, 0x30, 0x00, "50k and 100k" }, - {0x19, 0x01, 0x30, 0x30, "30k only" }, - {0x19, 0x01, 0x30, 0x20, "50k only" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x19, 0x01, 0x40, 0x00, "No" }, - {0x19, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x19, 0x01, 0x80, 0x80, "Off" }, - {0x19, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Firetrapbl) - -static void firetrap_8751_write(UINT8 data) -{ - static const UINT8 i8751_init_data[0x100] = { - 0xf5,0xd5,0xdd,0x21,0x05,0xc1,0x87,0x5f,0x87,0x83,0x5f,0x16,0x00,0xdd,0x19,0xd1, - 0xf1,0xc9,0xf5,0xd5,0xfd,0x21,0x2f,0xc1,0x87,0x5f,0x16,0x00,0xfd,0x19,0xd1,0xf1, - 0xc9,0xe3,0xd5,0xc5,0xf5,0xdd,0xe5,0xfd,0xe5,0xe9,0xe1,0xfd,0xe1,0xdd,0xe1,0xf1, - 0xc1,0xd1,0xe3,0xc9,0xf5,0xc5,0xe5,0xdd,0xe5,0xc5,0x78,0xe6,0x0f,0x47,0x79,0x48, - 0x06,0x00,0xdd,0x21,0x00,0xd0,0xdd,0x09,0xe6,0x0f,0x6f,0x26,0x00,0x29,0x29,0x29, - 0x29,0xeb,0xdd,0x19,0xc1,0x78,0xe6,0xf0,0x28,0x05,0x11,0x00,0x02,0xdd,0x19,0x79, - 0xe6,0xf0,0x28,0x05,0x11,0x00,0x04,0xdd,0x19,0xdd,0x5e,0x00,0x01,0x00,0x01,0xdd, - 0x09,0xdd,0x56,0x00,0xdd,0xe1,0xe1,0xc1,0xf1,0xc9,0xf5,0x3e,0x01,0x32,0x04,0xf0, - 0xf1,0xc9,0xf5,0x3e,0x00,0x32,0x04,0xf0,0xf1,0xc9,0xf5,0xd5,0xdd,0x21,0x05,0xc1, - 0x87,0x5f,0x87,0x83,0x5f,0x16,0x00,0xdd,0x19,0xd1,0xf1,0xc9,0xf5,0xd5,0xfd,0x21, - 0x2f,0xc1,0x87,0x5f,0x16,0x00,0xfd,0x19,0xd1,0xf1,0xc9,0xe3,0xd5,0xc5,0xf5,0xdd, - 0xe5,0xfd,0xe5,0xe9,0xe1,0xfd,0xe1,0xdd,0xe1,0xf1,0xc1,0xd1,0xe3,0xc9,0xf5,0xc5, - 0xe5,0xdd,0xe5,0xc5,0x78,0xe6,0x0f,0x47,0x79,0x48,0x06,0x00,0xdd,0x21,0x00,0xd0, - 0xdd,0x09,0xe6,0x0f,0x6f,0x26,0x00,0x29,0x29,0x29,0x29,0xeb,0xdd,0x19,0xc1,0x78, - 0xe6,0xf0,0x28,0x05,0x11,0x00,0x02,0xdd,0x19,0x79,0xe6,0xf0,0x28,0x05,0x11,0x00, - 0x04,0xdd,0x19,0xdd,0x5e,0x00,0x01,0x00,0x01,0xdd,0x09,0xdd,0x56,0x00,0xdd,0x00 - }; - - static const int i8751_coin_data[2] = { 0x00, 0xb7 }; - static const int i8751_36_data[2] = { 0x00, 0xbc }; - - if (BurnDrvGetFlags() & BDF_BOOTLEG) return; - - if (data == 0x26) - { - data = 0; - i8751_return = 0xff; - } - else if ((data == 0x13) || (data == 0xf5)) - { - if (!i8751_current_command) i8751_init_ptr = 0; - i8751_return = i8751_init_data[i8751_init_ptr++]; - } - else if (data == 0xbd) - { - if (!i8751_current_command) i8751_init_ptr = 0; - i8751_return = i8751_coin_data[i8751_init_ptr++]; - } - else if (data == 0x36) - { - if (!i8751_current_command) i8751_init_ptr = 0; - i8751_return = i8751_36_data[i8751_init_ptr++]; - } - else if (data == 0x14) i8751_return = 1; - else if (data == 0x02) i8751_return = 0; - else if (data == 0x72) i8751_return = 3; - else if (data == 0x69) i8751_return = 2; - else if (data == 0xcb) i8751_return = 0; - else if (data == 0x49) i8751_return = 1; - else if (data == 0x17) i8751_return = 2; - else if (data == 0x88) i8751_return = 3; - else i8751_return = 0xff; - - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - i8751_current_command = data; -} - -static void bankswitch1(INT32 data) -{ - banks[0] = data; - - INT32 bank = (data & 3) * 0x4000; - - ZetMapMemory(DrvZ80ROM + 0x10000 + bank, 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall firetrap_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: // nop / IRQ ACK - return; - - case 0xf001: - soundlatch = data; - M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - return; - - case 0xf002: - bankswitch1(data); - return; - - case 0xf003: - flipscreen = data; - return; - - case 0xf004: - nmi_enable = ~data & 1; - return; - - case 0xf005: - firetrap_8751_write(data); - return; - - case 0xf008: - case 0xf009: - case 0xf00a: - case 0xf00b: - case 0xf00c: - case 0xf00d: - case 0xf00e: - case 0xf00f: - scroll[address & 7] = data; - return; - } -} - -static UINT8 firetrap_8751_bootleg_read() -{ - UINT8 coin = 0; - UINT8 port = DrvInputs[2] & 0x70; - - if (ZetGetPC(-1) == 0x1188) return ~coin_command_pending; - - if (port != 0x70) - { - if (!(port & 0x20)) coin = 1; - if (!(port & 0x40)) coin = 2; - if (!(port & 0x10)) coin = 3; - - coin_command_pending = coin; - - return 0xff; - } - - return 0; -} - -static UINT8 __fastcall firetrap_main_read(UINT16 address) -{ - switch (address) - { - case 0xf010: - case 0xf011: - case 0xf012: - return DrvInputs[address & 3]; - - case 0xf013: - case 0xf014: - return DrvDips[address - 0xf013]; - - case 0xf016: - if (BurnDrvGetFlags() & BDF_BOOTLEG) - return firetrap_8751_bootleg_read(); - return i8751_return; - } - - return 0; -} - -static void bankswitch2(INT32 data) -{ - banks[1] = data; - - INT32 bank = (data & 1) * 0x4000; - - M6502MapMemory(DrvM6502ROM + 0x10000 + bank, 0x4000, 0x7fff, MAP_ROM); -} - -static void firetrap_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1000: - case 0x1001: - BurnYM3526Write(address & 1, data); - return; - - case 0x2000: - msm5205next = data; - if (MSM5205Last == 0x8 && msm5205next == 0x8) { // clears up hissing & clicking noise - MSM5205ResetWrite(0, 1); - } else MSM5205ResetWrite(0, 0); - MSM5205Last = data; - return; - - case 0x2400: - MSM5205ResetWrite(0, ~data & 0x01); - sound_irq_enable = data & 0x02; - return; - - case 0x2800: - bankswitch2(data); - return; - } -} - -static UINT8 firetrap_sound_read(UINT16 address) -{ - if (address >= 0x4000 && address <= 0x7fff) { - return DrvM6502ROM[(address&0x3fff) + (banks[1] & 1) * 0x4000]; - } - - switch (address) - { - case 0x3400: - return soundlatch; - } - - return 0; -} - -static void firetrap_adpcm_interrupt() -{ - MSM5205DataWrite(0, msm5205next >> 4); - msm5205next <<= 4; - - adpcm_toggle ^= 1; - if (sound_irq_enable && adpcm_toggle) { - M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } -} - -static INT32 SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6502TotalCycles() * nSoundRate / 1500000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - M6502Open(0); - M6502Reset(); - BurnYM3526Reset(); - MSM5205Reset(); - M6502Close(); - - flipscreen = 0; - soundlatch = 0; - nmi_enable = 0; - sound_irq_enable = 0; - msm5205next = 0xff; - adpcm_toggle = 0; - - coin_command_pending = 0; - i8751_current_command = 0; - i8751_return = 0; - i8751_init_ptr = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x020000; - DrvM6502ROM = Next; Next += 0x018000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x040000; - DrvGfxROM2 = Next; Next += 0x040000; - DrvGfxROM3 = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x0010000; - DrvBg0RAM = Next; Next += 0x0008000; - DrvBg1RAM = Next; Next += 0x0008000; - DrvFgRAM = Next; Next += 0x0008000; - DrvSprRAM = Next; Next += 0x0002000; - DrvM6502RAM = Next; Next += 0x0008000; - - scroll = Next; Next += 0x000008; - banks = Next; Next += 0x000002; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Planes0[2] = { 0, 4 }; - INT32 Planes1[4] = { 0, 4, (0x10000*8)+0, (0x10000*8)+4 }; - INT32 Planes2[4] = { (0x8000*8)*0, (0x8000*8)*1, (0x8000*8)*2, (0x8000*8)*3 }; - INT32 XOffs0[16] = { STEP4(3,-1), STEP4((0x1000*8)+3,-1) }; - INT32 XOffs1[16] = { STEP4(3,-1), STEP4((0x8000*8+3), -1), STEP4(0x80+3, -1), STEP4((0x8000*8+0x80+3), -1) }; - INT32 XOffs2[16] = { STEP8(7,-1), STEP8(0x80+7,-1) }; - INT32 YOffs0[8] = { STEP8(7*8,-8) }; - INT32 YOffs1[16] = { STEP16(15*8,-8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x200, 2, 8, 8, Planes0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - for (INT32 i = 0; i < 0x20000; i++) { - tmp[((i & 0x2000) << 2) | ((i & 0xc000) >> 1) | (i & 0x11fff)] = DrvGfxROM1[i]; - } - - GfxDecode(0x400, 4, 16, 16, Planes1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - for (INT32 i = 0; i < 0x20000; i++) { - tmp[((i & 0x2000) << 2) | ((i & 0xc000) >> 1) | (i & 0x11fff)] = DrvGfxROM2[i]; - } - - GfxDecode(0x400, 4, 16, 16, Planes1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x20000); - - GfxDecode(0x400, 4, 16, 16, Planes2, XOffs2, YOffs1, 0x100, tmp, DrvGfxROM3); - - BurnFree(tmp); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x18000, 2, 1)) return 1; - - if (BurnDrvGetFlags() & BDF_BOOTLEG) - BurnLoadRom(DrvZ80ROM + 0x08000, 5, 1); // bootleg - - if (BurnLoadRom(DrvM6502ROM + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM + 0x10000, 4, 1)) return 1; - - // if (BurnLoadRom(DrvI8751ROM + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x08000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x10000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x18000, 18, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 19, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 20, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvBg0RAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBg1RAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvFgRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe800, 0xe9ff, MAP_RAM); // 0-180 - ZetMapMemory(DrvZ80ROM + 0xf800,0xf800, 0xf8ff, MAP_ROM); // bootleg only - ZetSetWriteHandler(firetrap_main_write); - ZetSetReadHandler(firetrap_main_read); - ZetClose(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM, 0x8000, 0xffff, MAP_ROM); - M6502SetWriteHandler(firetrap_sound_write); - M6502SetReadHandler(firetrap_sound_read); - M6502SetReadOpArgHandler(firetrap_sound_read); - M6502SetReadOpHandler(firetrap_sound_read); - M6502Close(); - - BurnYM3526Init(3000000, NULL, &SynchroniseStream, 0); - BurnTimerAttachM6502YM3526(1500000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, SynchroniseStream, 375000, firetrap_adpcm_interrupt, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - ZetExit(); - - BurnYM3526Exit(); - MSM5205Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i] >> 4) & 0x01; - bit1 = (DrvColPROM[i] >> 5) & 0x01; - bit2 = (DrvColPROM[i] >> 6) & 0x01; - bit3 = (DrvColPROM[i] >> 7) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static inline void draw_16x16_tile(UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 transparent) -{ - transparent = (transparent) ? 0 : 0xff; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 8, color, 4, transparent, 0, gfx); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 8, color, 4, transparent, 0, gfx); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 8, color, 4, transparent, 0, gfx); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 4, transparent, 0, gfx); - } - } -} - -static void draw_16x16_layer(UINT8 *ram, UINT8 *gfx, UINT8 *scr, INT32 color_base, INT32 transparent) -{ - INT32 scrollx = ((scr[0] + (scr[1] << 8)) & 0x1ff); - INT32 scrolly = ((scr[2] + (scr[3] << 8)) & 0x1ff); - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 row = (offs / 0x20); - INT32 col = (offs & 0x1f); - - INT32 sx = col * 16; - INT32 sy = row * 16; - - sx -= scrollx; - if (sx < -15) sx += 512; - sy += scrolly; - if (sy >= 256) sy -= 512; - - INT32 ofst = ((row & 0x0f) ^ 0x0f) | ((col & 0x0f) << 4) | ((row & 0x10) << 5) | ((col & 0x10) << 6); - - INT32 attr = ram[ofst + 0x100]; - INT32 code = ram[ofst] | ((attr & 0x03) << 8); - INT32 color = (attr & 0x30) >> 4; - - INT32 flipx = attr & 0x08; - INT32 flipy = attr & 0x04; - - draw_16x16_tile(gfx, code, color+(color_base>>4), sx, sy, flipx, flipy, transparent); - } -} - -static void draw_8x8_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs / 0x20) * 8; - INT32 sy = (offs % 0x20) * 8; - - INT32 attr = DrvFgRAM[offs + 0x400]; - INT32 code = DrvFgRAM[offs] | ((attr & 0x01) << 8); - INT32 color = attr >> 4; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, (sy ^ 0xf8) - 8, color, 2, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x180; offs += 4) - { - INT32 sy = DrvSprRAM[offs]; - INT32 sx = DrvSprRAM[offs + 2]; - INT32 code = DrvSprRAM[offs + 3] + ((DrvSprRAM[offs + 1] & 0xc0) << 2); - INT32 color = ((DrvSprRAM[offs + 1] & 0x08) >> 2) | (DrvSprRAM[offs + 1] & 0x01); - INT32 flipx = DrvSprRAM[offs + 1] & 0x04; - INT32 flipy = DrvSprRAM[offs + 1] & 0x02; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (DrvSprRAM[offs + 1] & 0x10) /* double width */ - { - if (flipscreen) sy -= 16; - - draw_16x16_tile(DrvGfxROM3, code & ~1, color+0x4, sx, flipy ? sy : sy + 16, flipx, flipy, 1); - draw_16x16_tile(DrvGfxROM3, code | 1, color+0x4, sx, flipy ? sy + 16 : sy, flipx, flipy, 1); - draw_16x16_tile(DrvGfxROM3, code & ~1, color+0x4, sx - 256, flipy ? sy : sy + 16, flipx, flipy, 1); - draw_16x16_tile(DrvGfxROM3, code | 1, color+0x4, sx - 256, flipy ? sy + 16 : sy, flipx, flipy, 1); - } - else - { - draw_16x16_tile(DrvGfxROM3, code, color+0x4, sx, sy, flipx, flipy, 1); - draw_16x16_tile(DrvGfxROM3, code, color+0x4, sx-256, sy, flipx, flipy, 1); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_16x16_layer(DrvBg1RAM, DrvGfxROM2, scroll + 4, 0xc0, 0); // bg2 - draw_16x16_layer(DrvBg0RAM, DrvGfxROM1, scroll + 0, 0x80, 1); // bg1 - draw_sprites(); - draw_8x8_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - DrvInputs[3] = 0; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - { // coin derp - static UINT8 lastcoin = 0; - if (DrvInputs[3] && lastcoin != DrvInputs[3]) { - if (!i8751_current_command) { - i8751_return = (DrvInputs[3]&1) ? 1 : 2; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - } - } - lastcoin = DrvInputs[3]; - } - } - - INT32 nInterleave = MSM5205CalcInterleave(0, 1500000); - INT32 nCyclesTotal[2] = { 6000000 / 60, 1500000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - M6502Open(0); - DrvInputs[2] &= 0x7f; // vblank - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (nmi_enable && (i == nInterleave - 1)) ZetNmi(); - - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[1] / nInterleave)); - - if (i == (nInterleave - 2)) DrvInputs[2] |= 0x80; // vblank - - MSM5205Update(); - } - - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - - M6502Close(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - M6502Scan(nAction); - - M6502Open(0); - BurnYM3526Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - M6502Close(); - - SCAN_VAR(flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(nmi_enable); - SCAN_VAR(sound_irq_enable); - SCAN_VAR(msm5205next); - SCAN_VAR(adpcm_toggle); - - SCAN_VAR(i8751_current_command); - SCAN_VAR(i8751_return); - SCAN_VAR(i8751_init_ptr); - - SCAN_VAR(coin_command_pending); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch1(banks[0]); - ZetClose(); - - M6502Open(0); - bankswitch2(banks[1]); - M6502Close(); - } - - return 0; -} - - -// Fire Trap (US, set 1) - -static struct BurnRomInfo firetrapRomDesc[] = { - { "di-02.4a", 0x8000, 0x3d1e4bf7, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "di-01.3a", 0x8000, 0x9bbae38b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "di-00.2a", 0x8000, 0xd0dad7de, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "di-17.10j", 0x8000, 0x8605f6b9, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU Code - { "di-18.12j", 0x8000, 0x49508c93, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "di-12.16h", 0x1000, 0x00000000, 3 | BRF_NODUMP }, // 5 MCU (undumped) - - { "di-03.17c", 0x2000, 0x46721930, 4 | BRF_GRA }, // 6 Characters - - { "di-06.3e", 0x8000, 0x441d9154, 5 | BRF_GRA }, // 7 Background Tiles - { "di-04.2e", 0x8000, 0x8e6e7eec, 5 | BRF_GRA }, // 8 - { "di-07.6e", 0x8000, 0xef0a7e23, 5 | BRF_GRA }, // 9 - { "di-05.4e", 0x8000, 0xec080082, 5 | BRF_GRA }, // 10 - - { "di-09.3j", 0x8000, 0xd11e28e8, 6 | BRF_GRA }, // 11 Background Tiles - { "di-08.2j", 0x8000, 0xc32a21d8, 6 | BRF_GRA }, // 12 - { "di-11.6j", 0x8000, 0x6424d5c3, 6 | BRF_GRA }, // 13 - { "di-10.4j", 0x8000, 0x9b89300a, 6 | BRF_GRA }, // 14 - - { "di-16.17h", 0x8000, 0x0de055d7, 7 | BRF_GRA }, // 15 Sprites - { "di-13.13h", 0x8000, 0x869219da, 7 | BRF_GRA }, // 16 - { "di-14.14h", 0x8000, 0x6b65812e, 7 | BRF_GRA }, // 17 - { "di-15.15h", 0x8000, 0x3e27f77d, 7 | BRF_GRA }, // 18 - - { "firetrap.3b", 0x0100, 0x8bb45337, 8 | BRF_GRA }, // 19 Color data - { "firetrap.4b", 0x0100, 0xd5abfc64, 8 | BRF_GRA }, // 20 - - { "firetrap.1a", 0x0100, 0xd67f3514, 0 | BRF_OPT }, // 21 -}; - -STD_ROM_PICK(firetrap) -STD_ROM_FN(firetrap) - -struct BurnDriver BurnDrvFiretrap = { - "firetrap", NULL, NULL, NULL, "1986", - "Fire Trap (US, set 1)\0", NULL, "Wood Place Inc. (Data East USA license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, firetrapRomInfo, firetrapRomName, NULL, NULL, FiretrapInputInfo, FiretrapDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 256, 3, 4 -}; - - -// Fire Trap (US, set 2) - -static struct BurnRomInfo firetrapaRomDesc[] = { - { "di-02.4a", 0x8000, 0x3d1e4bf7, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "di-01.3a", 0x8000, 0x9bbae38b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "di-00-a.2a.bin", 0x8000, 0xf39e2cf4, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "di-17.10j", 0x8000, 0x8605f6b9, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU Code - { "di-18.12j", 0x8000, 0x49508c93, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "di-12.16h", 0x1000, 0x00000000, 3 | BRF_NODUMP }, // 5 MCU (undumped) - - { "di-03.17c", 0x2000, 0x46721930, 4 | BRF_GRA }, // 6 Characters - - { "di-06.3e", 0x8000, 0x441d9154, 5 | BRF_GRA }, // 7 Background Tiles - { "di-04.2e", 0x8000, 0x8e6e7eec, 5 | BRF_GRA }, // 8 - { "di-07.6e", 0x8000, 0xef0a7e23, 5 | BRF_GRA }, // 9 - { "di-05.4e", 0x8000, 0xec080082, 5 | BRF_GRA }, // 10 - - { "di-09.3j", 0x8000, 0xd11e28e8, 6 | BRF_GRA }, // 11 Background Tiles - { "di-08.2j", 0x8000, 0xc32a21d8, 6 | BRF_GRA }, // 12 - { "di-11.6j", 0x8000, 0x6424d5c3, 6 | BRF_GRA }, // 13 - { "di-10.4j", 0x8000, 0x9b89300a, 6 | BRF_GRA }, // 14 - - { "di-16.17h", 0x8000, 0x0de055d7, 7 | BRF_GRA }, // 15 Sprites - { "di-13.13h", 0x8000, 0x869219da, 7 | BRF_GRA }, // 16 - { "di-14.14h", 0x8000, 0x6b65812e, 7 | BRF_GRA }, // 17 - { "di-15.15h", 0x8000, 0x3e27f77d, 7 | BRF_GRA }, // 18 - - { "firetrap.3b", 0x0100, 0x8bb45337, 8 | BRF_GRA }, // 19 Color data - { "firetrap.4b", 0x0100, 0xd5abfc64, 8 | BRF_GRA }, // 20 - - { "firetrap.1a", 0x0100, 0xd67f3514, 0 | BRF_OPT }, // 21 -}; - -STD_ROM_PICK(firetrapa) -STD_ROM_FN(firetrapa) - -struct BurnDriver BurnDrvFiretrapa = { - "firetrapa", "firetrap", NULL, NULL, "1986", - "Fire Trap (US, set 2)\0", NULL, "Wood Place Inc. (Data East USA license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, firetrapaRomInfo, firetrapaRomName, NULL, NULL, FiretrapInputInfo, FiretrapDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 256, 3, 4 -}; - - -// Fire Trap (Japan) - -static struct BurnRomInfo firetrapjRomDesc[] = { - { "fi-03.4a", 0x8000, 0x20b2a4ff, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "fi-02.3a", 0x8000, 0x5c8a0562, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fi-01.2a", 0x8000, 0xf2412fe8, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "fi-18.10j", 0x8000, 0x8605f6b9, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU Code - { "fi-19.12j", 0x8000, 0x49508c93, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "fi-13.16h", 0x1000, 0x00000000, 3 | BRF_NODUMP }, // 5 MCU (undumped) - - { "fi-04.17c", 0x2000, 0xa584fc16, 4 | BRF_GRA }, // 6 Characters - - { "fi-06.3e", 0x8000, 0x441d9154, 5 | BRF_GRA }, // 7 Background Tiles - { "fi-05.2e", 0x8000, 0x8e6e7eec, 5 | BRF_GRA }, // 8 - { "fi-08.6e", 0x8000, 0xef0a7e23, 5 | BRF_GRA }, // 9 - { "fi-07.4e", 0x8000, 0xec080082, 5 | BRF_GRA }, // 10 - - { "fi-10.3j", 0x8000, 0xd11e28e8, 6 | BRF_GRA }, // 11 Background Tiles - { "fi-09.2j", 0x8000, 0xc32a21d8, 6 | BRF_GRA }, // 12 - { "fi-12.6j", 0x8000, 0x6424d5c3, 6 | BRF_GRA }, // 13 - { "fi-11.4j", 0x8000, 0x9b89300a, 6 | BRF_GRA }, // 14 - - { "fi-17.17h", 0x8000, 0x0de055d7, 7 | BRF_GRA }, // 15 Sprites - { "fi-14.13h", 0x8000, 0xdbcdd3df, 7 | BRF_GRA }, // 16 - { "fi-15.14h", 0x8000, 0x6b65812e, 7 | BRF_GRA }, // 17 - { "fi-16.15h", 0x8000, 0x3e27f77d, 7 | BRF_GRA }, // 18 - - { "fi-2.3b", 0x0100, 0x8bb45337, 8 | BRF_GRA }, // 19 Color data - { "fi-3.4b", 0x0100, 0xd5abfc64, 8 | BRF_GRA }, // 20 - - { "fi-1.1a", 0x0100, 0xd67f3514, 0 | BRF_OPT }, // 21 -}; - -STD_ROM_PICK(firetrapj) -STD_ROM_FN(firetrapj) - -struct BurnDriver BurnDrvFiretrapj = { - "firetrapj", "firetrap", NULL, NULL, "1986", - "Fire Trap (Japan)\0", NULL, "Wood Place Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 4, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, firetrapjRomInfo, firetrapjRomName, NULL, NULL, FiretrapInputInfo, FiretrapjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 256, 3, 4 -}; - - -// Fire Trap (Japan bootleg) - -static struct BurnRomInfo firetrapblRomDesc[] = { - { "ft0d.bin", 0x8000, 0x793ef849, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "fi-02.3a", 0x8000, 0x5c8a0562, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fi-01.2a", 0x8000, 0xf2412fe8, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "fi-18.10j", 0x8000, 0x8605f6b9, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU Code - { "fi-19.12j", 0x8000, 0x49508c93, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "ft0a.bin", 0x8000, 0x613313ee, 1 | BRF_PRG | BRF_ESS }, // 5 Main CPU Extra - - { "fi-04.17c", 0x2000, 0xa584fc16, 4 | BRF_GRA }, // 6 Characters - - { "fi-06.3e", 0x8000, 0x441d9154, 5 | BRF_GRA }, // 7 Background Tiles - { "fi-05.2e", 0x8000, 0x8e6e7eec, 5 | BRF_GRA }, // 8 - { "fi-08.6e", 0x8000, 0xef0a7e23, 5 | BRF_GRA }, // 9 - { "fi-07.4e", 0x8000, 0xec080082, 5 | BRF_GRA }, // 10 - - { "fi-10.3j", 0x8000, 0xd11e28e8, 6 | BRF_GRA }, // 11 Background Tiles - { "fi-09.2j", 0x8000, 0xc32a21d8, 6 | BRF_GRA }, // 12 - { "fi-12.6j", 0x8000, 0x6424d5c3, 6 | BRF_GRA }, // 13 - { "fi-11.4j", 0x8000, 0x9b89300a, 6 | BRF_GRA }, // 14 - - { "fi-17.17h", 0x8000, 0x0de055d7, 7 | BRF_GRA }, // 15 Sprites - { "fi-14.13h", 0x8000, 0x869219da, 7 | BRF_GRA }, // 16 - { "fi-15.14h", 0x8000, 0x6b65812e, 7 | BRF_GRA }, // 17 - { "fi-16.15h", 0x8000, 0x3e27f77d, 7 | BRF_GRA }, // 18 - - { "fi-2.3b", 0x0100, 0x8bb45337, 8 | BRF_GRA }, // 19 Color data - { "fi-3.4b", 0x0100, 0xd5abfc64, 8 | BRF_GRA }, // 20 - - { "fi-1.1a", 0x0100, 0xd67f3514, 0 | BRF_OPT }, // 21 -}; - -STD_ROM_PICK(firetrapbl) -STD_ROM_FN(firetrapbl) - -struct BurnDriver BurnDrvFiretrapbl = { - "firetrapbl", "firetrap", NULL, NULL, "1986", - "Fire Trap (Japan bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 4, HARDWARE_PREFIX_DATAEAST, GBF_MISC, 0, - NULL, firetrapblRomInfo, firetrapblRomName, NULL, NULL, FiretrapblInputInfo, FiretrapblDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_freekick.cpp b/jan/src/burn/drv/pre90s/d_freekick.cpp deleted file mode 100644 index 33a0fc07e..000000000 --- a/jan/src/burn/drv/pre90s/d_freekick.cpp +++ /dev/null @@ -1,1783 +0,0 @@ -// Gigas / Freekick / Counter Run / Perfect Billiard for FBA, ported by vbt - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -#include "bitswap.h" -#include "sn76496.h" -#include "mc8123.h" -#include "8255ppi.h" - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; - -static UINT8 DrvInputs[2]; -static UINT8 DrvDip[3]; -static INT16 DrvDial1; -static INT16 DrvDial2; -static UINT8 DrvReset; - -static UINT8 DrvRecalc; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvRAM; -static UINT8 *DrvMainROM; -static UINT8 *DrvMainROMdec; -static UINT8 *DrvSndROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *MC8123Key; -static UINT32 *DrvPalette; -static UINT8 DrvZ80Bank0; -typedef void (*RenderSprite)(INT32); -static RenderSprite DrawSprite; - -static UINT8 nmi_enable; -static UINT8 flipscreen; -static UINT8 coin; -static UINT8 spinner; -static UINT8 ff_data; -static UINT16 romaddr; - -static UINT8 use_encrypted = 0; -static UINT8 countrunbmode = 0; -static UINT8 pbillrdmode = 0; - -static void DrvPaletteInit(); - -static struct BurnInputInfo PbillrdInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 5, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 4, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 5, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 4, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Pbillrd) - - -static struct BurnDIPInfo PbillrdDIPList[]= -{ - {0x11, 0xff, 0xff, 0x1f, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Balls" }, - {0x11, 0x01, 0x01, 0x01, "3" }, - {0x11, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Ball" }, - {0x11, 0x01, 0x06, 0x06, "10000, 30000 & 50000 Points" }, - {0x11, 0x01, 0x06, 0x02, "20000 & 60000 Points" }, - {0x11, 0x01, 0x06, 0x04, "30000 & 80000 Points" }, - {0x11, 0x01, 0x06, 0x00, "Only 20000 Points" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x10, 0x00, "No" }, - {0x11, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Shot" }, - {0x11, 0x01, 0x20, 0x00, "2" }, - {0x11, 0x01, 0x20, 0x20, "3" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x00, "Upright" }, - {0x11, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "4 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x02, "3 Coins/5 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "4 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0x20, "3 Coins/5 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, -}; - -STDDIPINFO(Pbillrd) - -static struct BurnInputInfo GigasInputList[] = { - - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Gigas) - -static struct BurnDIPInfo GigasDIPList[]= -{ - {0x0d, 0xff, 0xff, 0x3f, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0d, 0x01, 0x01, 0x01, "3" }, - {0x0d, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0d, 0x01, 0x06, 0x06, "20000 & 60000, Every 60000 Points" }, - {0x0d, 0x01, 0x06, 0x02, "20000 & 60000 Points" }, - {0x0d, 0x01, 0x06, 0x04, "30000 & 80000, Every 80000 Points" }, - {0x0d, 0x01, 0x06, 0x00, "Only 20000 Points" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0d, 0x01, 0x18, 0x18, "Easy" }, - {0x0d, 0x01, 0x18, 0x10, "Normal" }, - {0x0d, 0x01, 0x18, 0x08, "Hard" }, - {0x0d, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0d, 0x01, 0x20, 0x00, "No" }, - {0x0d, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0d, 0x01, 0x40, 0x00, "Upright" }, - {0x0d, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0d, 0x01, 0x80, 0x00, "Off" }, - {0x0d, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x0e, 0x01, 0x0f, 0x00, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0c, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0e, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x05, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x06, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0x0f, 0x04, "4 Coins 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x08, "4 Coins 5 Credits" }, - {0x0e, 0x01, 0x0f, 0x0a, "3 Coins 4 Credits" }, - {0x0e, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x02, "3 Coins/5 Credits" }, - {0x0e, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x0f, 0x01, "2 Coins 5 Credits" }, - {0x0e, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x0e, 0x01, 0xf0, 0x00, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xe0, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x50, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x60, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0xf0, 0x40, "4 Coins 3 Credits" }, - {0x0e, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x80, "4 Coins 5 Credits" }, - {0x0e, 0x01, 0xf0, 0xa0, "3 Coins 4 Credits" }, - {0x0e, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0xf0, 0x20, "3 Coins/5 Credits" }, - {0x0e, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0xf0, 0x10, "2 Coins 5 Credits" }, - {0x0e, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, -}; - -STDDIPINFO(Gigas) - -static struct BurnDIPInfo Gigasm2DIPList[]= -{ - {0x0d, 0xff, 0xff, 0x3f, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0d, 0x01, 0x01, 0x01, "3" }, - {0x0d, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0d, 0x01, 0x06, 0x06, "20000 & 60000, Every 60000 Points" }, - {0x0d, 0x01, 0x06, 0x02, "20000 & 60000 Points" }, - {0x0d, 0x01, 0x06, 0x04, "30000 & 80000, Every 80000 Points" }, - {0x0d, 0x01, 0x06, 0x00, "Only 20000 Points" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0d, 0x01, 0x18, 0x18, "Easy" }, - {0x0d, 0x01, 0x18, 0x10, "Normal" }, - {0x0d, 0x01, 0x18, 0x08, "Hard" }, - {0x0d, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0d, 0x01, 0x20, 0x00, "No" }, - {0x0d, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0d, 0x01, 0x40, 0x00, "Upright" }, - {0x0d, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0d, 0x01, 0x80, 0x00, "Off" }, - {0x0d, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x0e, 0x01, 0x0f, 0x00, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0c, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0e, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x05, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x06, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0x0f, 0x04, "4 Coins 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x08, "4 Coins 5 Credits" }, - {0x0e, 0x01, 0x0f, 0x0a, "3 Coins 4 Credits" }, - {0x0e, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x02, "3 Coins/5 Credits" }, - {0x0e, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x0f, 0x01, "2 Coins 5 Credits" }, - {0x0e, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x0e, 0x01, 0xf0, 0x00, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xe0, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x50, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x60, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0xf0, 0x40, "4 Coins 3 Credits" }, - {0x0e, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x80, "4 Coins 5 Credits" }, - {0x0e, 0x01, 0xf0, 0xa0, "3 Coins 4 Credits" }, - {0x0e, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0xf0, 0x20, "3 Coins/5 Credits" }, - {0x0e, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0xf0, 0x10, "2 Coins 5 Credits" }, - {0x0e, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, -}; - -STDDIPINFO(Gigasm2) - -static struct BurnInputInfo FreekckInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 5, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 4, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 5, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 4, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip"}, -}; - -STDINPUTINFO(Freekck) - - -static struct BurnDIPInfo FreekckDIPList[]= -{ - {0x11, 0xff, 0xff, 0xbf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x11, 0x01, 0x01, 0x01, "3" }, - {0x11, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x06, 0x06, "2-3-4-5-60000 Points" }, - {0x11, 0x01, 0x06, 0x02, "3-4-5-6-7-80000 Points" }, - {0x11, 0x01, 0x06, 0x04, "20000 & 60000 Points" }, - {0x11, 0x01, 0x06, 0x00, "ONLY 20000 Points" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x18, 0x18, "Easy" }, - {0x11, 0x01, 0x18, 0x10, "Normal" }, - {0x11, 0x01, 0x18, 0x08, "Hard" }, - {0x11, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x20, 0x00, "No" }, - {0x11, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x00, "Upright" }, - {0x11, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "4 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x02, "3 Coins/5 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0x20, "3 Coins/5 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin/10 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "1 Coin/25 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "1 Coin/50 Credits" }, - - {0 , 0xfe, 0 , 2, "Manufacturer" }, - {0x13, 0x01, 0x01, 0x00, "Nihon System" }, - {0x13, 0x01, 0x01, 0x01, "Sega/Nihon System" }, - - {0 , 0xfe, 0 , 0, "Coin Slots" }, - {0x13, 0x01, 0x80, 0x00, "1" }, - {0x13, 0x01, 0x80, 0x80, "2" }, -}; - -STDDIPINFO(Freekck) - -static struct BurnInputInfo CountrunInputList[] = { - - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 5, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 4, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 5, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 4, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip"}, -}; - -STDINPUTINFO(Countrun) - - -static struct BurnDIPInfo CountrunDIPList[]= -{ - {0x11, 0xff, 0xff, 0xbf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x11, 0x01, 0x01, 0x01, "3" }, - {0x11, 0x01, 0x01, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x06, 0x06, "20000, 60000 and every 60000 Points" }, - {0x11, 0x01, 0x06, 0x02, "30000, 80000 and every 80000 Points" }, - {0x11, 0x01, 0x06, 0x04, "20000 & 60000 Points" }, - {0x11, 0x01, 0x06, 0x00, "ONLY 20000 Points" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x18, 0x18, "Easy" }, - {0x11, 0x01, 0x18, 0x10, "Normal" }, - {0x11, 0x01, 0x18, 0x08, "Hard" }, - {0x11, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x20, 0x00, "No" }, - {0x11, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x00, "Upright" }, - {0x11, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "4 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x02, "3 Coins/5 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0x20, "3 Coins/5 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin/10 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "1 Coin/25 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "1 Coin/50 Credits" }, - - {0 , 0xfe, 0 , 2, "Manufacturer" }, - {0x13, 0x01, 0x01, 0x00, "Nihon System" }, - {0x13, 0x01, 0x01, 0x01, "Sega/Nihon System" }, - - {0 , 0xfe, 0 , 0, "Coin Slots" }, - {0x13, 0x01, 0x80, 0x00, "1" }, - {0x13, 0x01, 0x80, 0x80, "2" }, - -}; - -STDDIPINFO(Countrun) - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - coin = 0; - nmi_enable = 0; - ff_data = 0; - romaddr = 0; - flipscreen = 0; - - spinner = 0; - DrvDial1 = 0; - DrvDial2 = 0; - - ZetOpen(0); - ZetReset(); - ZetClose(); - - return 0; -} - -void freekick_draw_sprite(INT32 offs) -{ - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = 232 - DrvSprRAM[offs + 0]; - INT32 code = DrvSprRAM[offs + 1] + ((DrvSprRAM[offs + 2] & 0x20) << 3); - - INT32 flipx = DrvSprRAM[offs + 2] & 0x80; //?? unused ? - INT32 flipy = !(DrvSprRAM[offs + 2] & 0x40); - INT32 color = DrvSprRAM[offs + 2] & 0x1f; - - if (flipy) - { - if (flipx) - { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 256, DrvGfxROM1); - } - else - { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 256, DrvGfxROM1); - } - } - else - { - if (flipx) - { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 256, DrvGfxROM1); - } - else - { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 256, DrvGfxROM1); - } - } -} - -static void gigas_draw_sprite(INT32 offs) -{ - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = DrvSprRAM[offs + 2]; - INT32 code = DrvSprRAM[offs + 0] | ((DrvSprRAM[offs + 1] & 0x20) << 3); - - INT32 flipx = 0; - INT32 flipy = 0; - INT32 color = DrvSprRAM[offs + 1] & 0x1f; - - if (pbillrdmode) { - code = DrvSprRAM[offs + 0]; - color = DrvSprRAM[offs + 1] & 0x0f; - } - - if (0) - { - sx = 240 - sx; - flipx = !flipx; - } - if (1) - { - sy = 224 - sy; - flipy = !flipy; - } - - if (flipy) - { - if (flipx) - { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 256, DrvGfxROM1); - } - else - { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 256, DrvGfxROM1); - } - } - else - { - if (flipx) - { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 256, DrvGfxROM1); - } - else - { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 256, DrvGfxROM1); - } - } -} - -static INT32 DrvDraw() -{ - - if (DrvRecalc) - { - DrvPaletteInit(); - DrvRecalc = 0; - } - - // Draw tiles - for (INT32 offs = 0x3ff; offs >= 0; offs--) - { - INT32 sx = (offs % 32) * 8; - INT32 sy = (offs / 32) * 8; - - INT32 code = DrvVidRAM[offs] + ((DrvVidRAM[offs + 0x400] & 0xe0) << 3); - INT32 color = DrvVidRAM[offs + 0x400] & 0x1f; - sy -= 16; - - if(sy >= 0) - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } - - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - DrawSprite(offs); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void __fastcall freekick_write(UINT16 address, UINT8 data) -{ - switch (address) - { -// AM_RANGE(0xec00, 0xec03) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) - case 0xec00: - case 0xec01: - case 0xec02: - case 0xec03: - ppi8255_w(0, address & 0x03, data); - return; - -// AM_RANGE(0xf000, 0xf003) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) - case 0xf000: - case 0xf001: - case 0xf002: - case 0xf003: - ppi8255_w(1, address & 0x03, data); - return; - -// AM_RANGE(0xf800, 0xf800) AM_READ_PORT("IN0") AM_WRITE(flipscreen_w) - case 0xf800: - case 0xf801: - return; - - case 0xf802: - case 0xf803: - coin = ~data & 1; - return; - - case 0xf804: -// bprintf(0, _T("nmi enable %X\n"), data); - nmi_enable = data & 1; - return; - -// AM_RANGE(0xf806, 0xf806) AM_WRITE(spinner_select_w) - case 0xf806: - spinner = data & 1; - return; - - case 0xfc00: - SN76496Write(0, data); - return; - - case 0xfc01: - SN76496Write(1, data); - return; - - case 0xfc02: - SN76496Write(2, data); - return; - - case 0xfc03: - SN76496Write(3, data); - return; - } -} - -UINT8 __fastcall freekick_read(UINT16 address) -{ - switch (address) - { -// AM_RANGE(0xec00, 0xec03) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) - case 0xec00: - case 0xec01: - case 0xec02: - case 0xec03: - return ppi8255_r(0, address & 0x03); - -// AM_RANGE(0xf000, 0xf003) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) - case 0xf000: - case 0xf001: - case 0xf002: - case 0xf003: - return ppi8255_r(1, address & 0x03); - - case 0xf800: { - return DrvInputs[0]; - } - - case 0xf801: { - return DrvInputs[1]; - } - -// AM_RANGE(0xf802, 0xf802) AM_READNOP //MUST return bit 0 = 0, otherwise game resets - case 0xf802: - return 0; - -// AM_RANGE(0xf803, 0xf803) AM_READ(spinner_r) - case 0xf803: - { - if(spinner) - return DrvDial2; - else - return DrvDial1; - } - } - return 0; -} - -static void pbillrd_setbank(UINT8 banknum) -{ - DrvZ80Bank0 = banknum; // for savestates - - UINT32 bankloc = 0x10000 + banknum * 0x4000; - - if (use_encrypted) { - ZetMapArea(0x8000, 0xbfff, 0, DrvMainROM + bankloc); // read - ZetMapArea(0x8000, 0xbfff, 2, DrvMainROMdec + bankloc, DrvMainROM + bankloc); // fetch ops(encrypted), opargs(unencrypted) - } else { - ZetMapArea(0x8000, 0xbfff, 0, DrvMainROM + bankloc); // read - ZetMapArea(0x8000, 0xbfff, 2, DrvMainROM + bankloc); // fetch - } -} - -static void __fastcall gigas_write(UINT16 address, UINT8 data) -{ -// AM_RANGE(0xe000, 0xe000) AM_WRITENOP -// AM_RANGE(0xe002, 0xe003) AM_WRITE(coin_w) -// AM_RANGE(0xe004, 0xe004) AM_WRITE(nmi_enable_w) -// AM_RANGE(0xe005, 0xe005) AM_WRITENOP - switch (address) - { - case 0xe000: -// case 0xe001: -// flipscreen = data; - return; - - case 0xe002: - case 0xe003: - coin = ~data & 1; - return; - - case 0xe004: //bprintf(0, _T("nmi enable %X\n"), data); - nmi_enable = data & 1; - return; - case 0xe005: - return; -// AM_RANGE(0xf000, 0xf000) AM_WRITE(SMH_NOP) //bankswitch ? - - case 0xf000: { - if (pbillrdmode) { - pbillrd_setbank(data & 1); - } - return; - } - -// AM_RANGE(0xfc00, 0xfc00) AM_WRITE(sn76496_0_w) -// AM_RANGE(0xfc01, 0xfc01) AM_WRITE(sn76496_1_w) -// AM_RANGE(0xfc02, 0xfc02) AM_WRITE(sn76496_2_w) -// AM_RANGE(0xfc03, 0xfc03) AM_WRITE(sn76496_3_w) - - case 0xfc00: - SN76496Write(0, data); - return; - - case 0xfc01: - SN76496Write(1, data); - return; - - case 0xfc02: - SN76496Write(2, data); - return; - - case 0xfc03: - SN76496Write(3, data); - return; - } -} - -UINT8 __fastcall gigas_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - { - return DrvInputs[0]; - // AM_RANGE(0xe000, 0xe000) AM_READ_PORT("IN0") AM_WRITENOP // probably not flipscreen - } - - case 0xe800: - { - return DrvInputs[1]; - // AM_RANGE(0xe800, 0xe800) AM_READ_PORT("IN1") - } - - case 0xf000: { - return DrvDip[0];// AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSW1") AM_WRITENOP //bankswitch ? - } - - case 0xf800: { - return DrvDip[1];// AM_RANGE(0xf800, 0xf800) AM_READ_PORT("DSW2") - } - } - return 0; -} - -UINT8 __fastcall freekick_in(UINT16 address) -{ - switch (address & 0xff) - { - case 0xff: - // AM_RANGE(0xff, 0xff) AM_READWRITE(freekick_ff_r, freekick_ff_w) - return ff_data; - break; - } - - return 0; -} - -void __fastcall freekick_out(UINT16 address, UINT8 data) -{ - switch (address & 0xff) - { - case 0xff: - // AM_RANGE(0xff, 0xff) AM_READWRITE(freekick_ff_r, freekick_ff_w) - ff_data = data; - break; - } -} - -static UINT8 freekick_ppiread_1_c() -{ - return DrvSndROM[romaddr & 0x7fff]; -} - -static void freekick_ppi_write_1_a(UINT8 data) -{ - romaddr = (romaddr & 0xff00) | data; -} - -static void freekick_ppi_write_1_b(UINT8 data) -{ - romaddr = (romaddr & 0x00ff) | (data << 8); -} - -static UINT8 freekick_ppiread_2_a() -{ - return DrvDip[0]; -} - -static UINT8 freekick_ppiread_2_b() -{ - return DrvDip[1]; -} - -static UINT8 freekick_ppiread_2_c() -{ - return DrvDip[2]; -} - -UINT8 __fastcall gigas_in(UINT16 address) -{ - switch (address & 0xff) - { - case 0x00: - if(spinner) - return DrvDial2; - else - return DrvDial1; - break; - - case 0x01: - return 0; - break; - } - - return 0; -} - -void __fastcall gigas_out(UINT16 address, UINT8 data) -{ - switch (address & 0xff) - { - case 0x00: - spinner = data & 1; - break; - } -} - - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x40000; - DrvMainROMdec = Next; Next += 0x20000; - DrvSndROM = Next; Next += 0x10000; - DrvGfxROM0 = Next; Next += 0x20000; // 0x800 * 8 * 8 - DrvGfxROM1 = Next; Next += 0x20000; // 0x200 * 16 * 16 - MC8123Key = Next; Next += 0x02000; - DrvColPROM = Next; Next += 0x00600; - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); // à faire - - AllRam = Next; - - DrvRAM = Next; Next += 0x02000; // 0x0e000 - 0x0c000 - DrvVidRAM = Next; Next += 0x00800; - DrvSprRAM = Next; Next += 0x00100; - DrvColRAM = Next; Next += 0x00600; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Planes0[3] = { RGN_FRAC(0xc000, 2,3), RGN_FRAC(0xc000, 1,3), RGN_FRAC(0xc000, 0,3) }; - INT32 XOffs0[8] = {0, 1, 2, 3, 4, 5, 6, 7}; - INT32 YOffs0[8] = {STEP8(0, 8)}; - - INT32 Planes1[3] = { RGN_FRAC(0xc000, 0,3),RGN_FRAC(0xc000, 2,3),RGN_FRAC(0xc000, 1,3) }; - INT32 XOffs1[16] = {0, 1, 2, 3, 4, 5, 6, 7,128+0,128+1,128+2,128+3,128+4,128+5,128+6,128+7}; - -// INT32 YOffs1[16] = {0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8,12*8,13*8,14*8,15*8}; - INT32 YOffs1[16] = {15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8,3*8,2*8,1*8,0*8}; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0xc000); - GfxDecode(0x0800, 3, 8, 8, Planes0, XOffs0, YOffs0, 0x40, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0xc000); - GfxDecode(0x0200, 3, 16, 16, Planes1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); -} - -static void DrvPaletteInit() -{ - INT32 len = 0x200; - - for (INT32 i = 0; i < len; i++) - { - INT32 bit0,bit1,bit2,bit3,r,g,b; - - bit0 = (DrvColPROM[i + len * 0] >> 0) & 0x01; - bit1 = (DrvColPROM[i + len * 0] >> 1) & 0x01; - bit2 = (DrvColPROM[i + len * 0] >> 2) & 0x01; - bit3 = (DrvColPROM[i + len * 0] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + len * 1] >> 0) & 0x01; - bit1 = (DrvColPROM[i + len * 1] >> 1) & 0x01; - bit2 = (DrvColPROM[i + len * 1] >> 2) & 0x01; - bit3 = (DrvColPROM[i + len * 1] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + len * 2] >> 0) & 0x01; - bit1 = (DrvColPROM[i + len * 2] >> 1) & 0x01; - bit2 = (DrvColPROM[i + len * 2] >> 2) & 0x01; - bit3 = (DrvColPROM[i + len * 2] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -/*static INT32 GigasDecode() -{ - mc8123_decrypt_rom(0, 0, DrvMainROM, DrvMainROM + 0x10000, MC8123Key); - return 0; -}*/ - -static INT32 LoadRoms() -{ - INT32 rom_number = 0; - - countrunbmode = !strcmp(BurnDrvGetTextA(DRV_NAME), "countrunb"); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "countrunb") || - !strcmp(BurnDrvGetTextA(DRV_NAME), "freekick") || - !strcmp(BurnDrvGetTextA(DRV_NAME), "freekicka") || - !strcmp(BurnDrvGetTextA(DRV_NAME), "freekickb1") || - !strcmp(BurnDrvGetTextA(DRV_NAME), "freekickb2") || - !strcmp(BurnDrvGetTextA(DRV_NAME), "freekickb3") - ) - { - if (BurnLoadRom(DrvMainROM, rom_number++, 1)) return 1; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "freekickb3")) { - if (BurnLoadRom(DrvMainROM + 0x08000, rom_number++, 1)) return 1; - } - if (BurnLoadRom(DrvSndROM, rom_number++, 1)) return 1; // sound rom - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "pbillrd") || - !strcmp(BurnDrvGetTextA(DRV_NAME), "pbillrdsa")) - { - if (BurnLoadRom(DrvMainROM, rom_number++, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x04000, rom_number++, 1)) return 1; - memmove(DrvMainROM + 0x10000, DrvMainROM + 0x08000, 0x4000); - if (BurnLoadRom(DrvMainROM + 0x14000, rom_number++, 1)) return 1; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "pbillrdsa")) { - if (BurnLoadRom(MC8123Key, rom_number++, 1)) return 1; - mc8123_decrypt_rom(0, 2, DrvMainROM, DrvMainROMdec, MC8123Key); - use_encrypted = 1; - } - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gigasb")) - { - if (BurnLoadRom(DrvMainROM + 0x10000, rom_number++, 1)) return 1; - memmove(DrvMainROM + 0x00000, DrvMainROM + 0x14000, 0x4000); - - if (BurnLoadRom(DrvMainROM + 0x14000, rom_number++, 1)) return 1; - memmove(DrvMainROM + 0x04000, DrvMainROM + 0x1c000, 0x8000); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gigasm2b")) - { - if (BurnLoadRom(DrvMainROM + 0x10000, rom_number++, 1)) return 1; - memmove(DrvMainROM + 0x00000, DrvMainROM + 0x14000, 0x4000); - - if (BurnLoadRom(DrvMainROM + 0x14000, rom_number++, 1)) return 1; - memmove(DrvMainROM + 0x04000, DrvMainROM + 0x18000, 0x4000); - - if (BurnLoadRom(DrvMainROM + 0x18000, rom_number++, 1)) return 1; - memmove(DrvMainROM + 0x08000, DrvMainROM + 0x1c000, 0x4000); - } - - // Gfx char - if (BurnLoadRom(DrvGfxROM0 + 0x00000, rom_number++, 1)) return 1; // ( "4.3k", 0x00000, 0x04000 - if (BurnLoadRom(DrvGfxROM0 + 0x04000, rom_number++, 1)) return 1; // ( "5.3h", 0x04000, 0x04000 - if (BurnLoadRom(DrvGfxROM0 + 0x08000, rom_number++, 1)) return 1; // ( "6.3g", 0x08000, 0x04000 - - // Gfx sprite - if (BurnLoadRom(DrvGfxROM1 + 0x00000, rom_number++, 1)) return 1; // ( "1.3p", 0x00000, 0x04000 - if (BurnLoadRom(DrvGfxROM1 + 0x04000, rom_number++, 1)) return 1; // ( "3.3l", 0x04000, 0x04000 - if (BurnLoadRom(DrvGfxROM1 + 0x08000, rom_number++, 1)) return 1; // ( "2.3n", 0x08000, 0x04000 - // Opcode Decryption PROMS - // GigasDecode(); - not used due to incomplete "gigas" romset. - - // Palette - if (BurnLoadRom(DrvColPROM + 0x000000, rom_number++, 1)) return 1; // ( "3a.bin", 0x0000, 0x0100 - if (BurnLoadRom(DrvColPROM + 0x000100, rom_number++, 1)) return 1; // ( "4d.bin", 0x0100, 0x0100 - if (BurnLoadRom(DrvColPROM + 0x000200, rom_number++, 1)) return 1; // ( "4a.bin", 0x0200, 0x0100 - if (BurnLoadRom(DrvColPROM + 0x000300, rom_number++, 1)) return 1; // ( "3d.bin", 0x0300, 0x0100 - if (BurnLoadRom(DrvColPROM + 0x000400, rom_number++, 1)) return 1; // ( "3b.bin", 0x0400, 0x0100 - if (BurnLoadRom(DrvColPROM + 0x000500, rom_number++, 1)) return 1; // ( "3c.bin", 0x0500, 0x0100 - - return 0; -} - -static INT32 DrvFreeKickInit() -{ - DrawSprite = freekick_draw_sprite; - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - LoadRoms(); - - DrvPaletteInit(); - - DrvGfxDecode(); - - ZetInit(0); - ZetOpen(0); -// AM_RANGE(0x0000, 0xcfff) AM_ROM - ZetMapArea(0x0000, 0xcfff, 0, DrvMainROM); - ZetMapArea(0x0000, 0xcfff, 2, DrvMainROM); //+0x10000,DrvMainROM); -// AM_RANGE(0xd000, 0xdfff) AM_RAM - ZetMapMemory(DrvRAM, 0xd000, 0xdfff, MAP_RAM); -// AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(freek_videoram_w) AM_SHARE("videoram") // tilemap - ZetMapMemory(DrvVidRAM, 0xe000, 0xe7ff, MAP_RAM); -// AM_RANGE(0xe800, 0xe8ff) AM_RAM AM_SHARE("spriteram") // sprites - ZetMapMemory(DrvSprRAM, 0xe800, 0xe8ff, MAP_RAM); - - ppi8255_init(2); - - PPI0PortReadC = freekick_ppiread_1_c; - PPI0PortWriteA = freekick_ppi_write_1_a; - PPI0PortWriteB = freekick_ppi_write_1_b; - - PPI1PortReadA = freekick_ppiread_2_a; - PPI1PortReadB = freekick_ppiread_2_b; - PPI1PortReadC = freekick_ppiread_2_c; - - ZetSetReadHandler(freekick_read); - ZetSetWriteHandler(freekick_write); - ZetSetInHandler(freekick_in); - ZetSetOutHandler(freekick_out); - - ZetClose(); - - SN76489AInit(0, 12000000/4, 0); - SN76489AInit(1, 12000000/4, 1); - SN76489AInit(2, 12000000/4, 1); - SN76489AInit(3, 12000000/4, 1); - - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(2, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(3, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvInit() -{ - DrawSprite = gigas_draw_sprite; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - LoadRoms(); - - DrvPaletteInit(); - - DrvGfxDecode(); - - ZetInit(0); - ZetOpen(0); - - if (pbillrdmode) { - ZetMapArea(0x0000, 0x7fff, 0, DrvMainROM); // read - ZetMapArea(0x0000, 0x7fff, 2, DrvMainROM); // fetch - - if (use_encrypted) { - ZetMapArea(0x0000, 0x7fff, 0, DrvMainROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvMainROMdec, DrvMainROM); // fetch ops(encrypted), opargs(unencrypted) - } - pbillrd_setbank(0); - } else { // gigas* - ZetMapArea(0x0000, 0xbfff, 0, DrvMainROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvMainROM + 0x10000, DrvMainROM); - } - - -// AM_RANGE(0xc000, 0xcfff) AM_RAM - ZetMapMemory(DrvRAM, 0xc000, 0xcfff, MAP_RAM); -// AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(freek_videoram_w) AM_SHARE("videoram") - ZetMapMemory(DrvVidRAM, 0xd000, 0xd7ff, MAP_RAM); -// AM_RANGE(0xd800, 0xd8ff) AM_RAM AM_SHARE("spriteram") - ZetMapMemory(DrvSprRAM, 0xd800, 0xd8ff, MAP_RAM); -// AM_RANGE(0xd900, 0xdfff) AM_RAM - ZetMapMemory(DrvRAM + 0x1000, 0xd900, 0xdfff, MAP_RAM); - - ppi8255_init(1); - - ZetSetReadHandler(gigas_read); // Memory - ZetSetWriteHandler(gigas_write); - - ZetSetInHandler(gigas_in); // IO Port - ZetSetOutHandler(gigas_out); - - ZetClose(); - - SN76489AInit(0, 12000000/4, 0); - SN76489AInit(1, 12000000/4, 1); - SN76489AInit(2, 12000000/4, 1); - SN76489AInit(3, 12000000/4, 1); - - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(2, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(3, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - SN76496Exit(); - ppi8255_exit(); - BurnFree (AllMem); - - countrunbmode = 0; - pbillrdmode = 0; - use_encrypted = 0; - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvInputs[0] = 0xff; // Active LOW - DrvInputs[1] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - { // spinner calculation stuff. - if (DrvJoy1[2]) DrvDial1 -= 0x04; - if (DrvJoy1[3]) DrvDial1 += 0x04; - if (DrvDial1 >= 0x100) DrvDial1 = 0; - if (DrvDial1 < 0) DrvDial1 = 0xfc; - - if (DrvJoy2[2]) DrvDial2 -= 0x04; - if (DrvJoy2[3]) DrvDial2 += 0x04; - if (DrvDial2 >= 0x100) DrvDial2 = 0; - if (DrvDial2 < 0) DrvDial2 = 0xfc; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal = nCyclesTotal = (countrunbmode) ? 6000000 / 60 : 3072000 / 60; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - ZetRun(nCyclesTotal / nInterleave); - - if (i % 128 == 127) - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); // audio irq - - - if (i == (nInterleave - 1) && nmi_enable) { // vblank - ZetNmi(); - } - } - ZetClose(); - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - SN76496Update(2, pBurnSoundOut, nBurnSoundLen); - SN76496Update(3, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - ZetScan(nAction); - - SN76496Scan(nAction, pnMin); - - SCAN_VAR(nmi_enable); - SCAN_VAR(flipscreen); - SCAN_VAR(coin); - SCAN_VAR(spinner); - SCAN_VAR(ff_data); - SCAN_VAR(romaddr); - SCAN_VAR(DrvDial1); - SCAN_VAR(DrvDial2); - SCAN_VAR(DrvZ80Bank0); - } - - if (nAction & ACB_WRITE && pbillrdmode) { - ZetOpen(0); - pbillrd_setbank(DrvZ80Bank0); - ZetClose(); - } - - return 0; -} - -static INT32 pbillrdInit() -{ - pbillrdmode = 1; - - return DrvInit(); -} - -// Perfect Billiard - -static struct BurnRomInfo pbillrdRomDesc[] = { - { "pb.18", 0x4000, 0x9e6275ac, 1 }, // 0 maincpu - { "pb.7", 0x8000, 0xdd438431, 1 }, // 1 - { "pb.9", 0x4000, 0x089ce80a, 1 }, // 2 - - { "pb.4", 0x4000, 0x2f4d4dd3, 2 }, // 3 gfx1 - { "pb.5", 0x4000, 0x9dfccbd3, 2 }, // 4 - { "pb.6", 0x4000, 0xb5c3f6f6, 2 }, // 5 - - { "10619.3r", 0x2000, 0x3296b9d9, 3 }, // 6 gfx2 - { "10621.3m", 0x2000, 0x3dca8e4b, 3 }, // 7 - { "10620.3n", 0x2000, 0xee76b079, 3 }, // 8 - - { "82s129.3a", 0x0100, 0x44802169, 4 }, // 9 proms - { "82s129.4d", 0x0100, 0x69ca07cc, 4 }, // 10 - { "82s129.4a", 0x0100, 0x145f950a, 4 }, // 11 - { "82s129.3d", 0x0100, 0x43d24e17, 4 }, // 12 - { "82s129.3b", 0x0100, 0x7fdc872c, 4 }, // 13 - { "82s129.3c", 0x0100, 0xcc1657e5, 4 }, // 14 -}; - -STD_ROM_PICK(pbillrd) -STD_ROM_FN(pbillrd) - -struct BurnDriver BurnDrvPbillrd = { - "pbillrd", NULL, NULL, NULL, "1987", - "Perfect Billiard\0", NULL, "Nihon System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pbillrdRomInfo, pbillrdRomName, NULL, NULL, PbillrdInputInfo, PbillrdDIPInfo, - pbillrdInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - -// Perfect Billiard (MC-8123, 317-5008) - -static struct BurnRomInfo pbillrdsaRomDesc[] = { - { "20", 0x4000, 0xda020258, 1 }, // 0 maincpu - { "17", 0x8000, 0x9bb3d467, 1 }, // 1 - { "19", 0x4000, 0x2335e6dd, 1 }, // 2 - - { "317-0030.key", 0x2000, 0x9223f06d, 2 }, // 3 user1 - - { "pb.4", 0x4000, 0x2f4d4dd3, 3 }, // 4 gfx1 - { "pb.5", 0x4000, 0x9dfccbd3, 3 }, // 5 - { "pb.6", 0x4000, 0xb5c3f6f6, 3 }, // 6 - - { "1", 0x4000, 0xc8ed651e, 4 }, // 7 gfx2 - { "3", 0x4000, 0x5282fc86, 4 }, // 8 - { "2", 0x4000, 0xe9f73f5b, 4 }, // 9 - - { "82s129.3a", 0x0100, 0x44802169, 5 }, // 10 proms - { "82s129.4d", 0x0100, 0x69ca07cc, 5 }, // 11 - { "82s129.4a", 0x0100, 0x145f950a, 5 }, // 12 - { "82s129.3d", 0x0100, 0x43d24e17, 5 }, // 13 - { "82s129.3b", 0x0100, 0x7fdc872c, 5 }, // 14 - { "82s129.3c", 0x0100, 0xcc1657e5, 5 }, // 15 -}; - -STD_ROM_PICK(pbillrdsa) -STD_ROM_FN(pbillrdsa) - -struct BurnDriver BurnDrvPbillrds = { - "pbillrdsa", "pbillrd", NULL, NULL, "1987", - "Perfect Billiard (MC-8123, 317-5008)\0", NULL, "Nihon System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pbillrdsaRomInfo, pbillrdsaRomName, NULL, NULL, PbillrdInputInfo, PbillrdDIPInfo, - pbillrdInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Free Kick (NS6201-A 1987.10) - -static struct BurnRomInfo freekickRomDesc[] = { - { "ns6201-a_1987.10_free_kick.cpu", 0xd000, 0x6d172850, 1 }, // 0 maincpu - - { "11.1e", 0x8000, 0xa6030ba9, 2 }, // 1 user1 - - { "12.1h", 0x4000, 0xfb82e486, 3 }, // 2 gfx1 - { "13.1j", 0x4000, 0x3ad78ee2, 3 }, // 3 - { "14.1l", 0x4000, 0x0185695f, 3 }, // 4 - - { "15.1m", 0x4000, 0x0fa7c13c, 4 }, // 5 gfx2 - { "16.1p", 0x4000, 0x2b996e89, 4 }, // 6 - { "17.1r", 0x4000, 0xe7894def, 4 }, // 7 - - { "24s10n.8j", 0x0100, 0x53a6bc21, 5 }, // 8 proms - { "24s10n.7j", 0x0100, 0x38dd97d8, 5 }, // 9 - { "24s10n.8k", 0x0100, 0x18e66087, 5 }, // 10 - { "24s10n.7k", 0x0100, 0xbc21797a, 5 }, // 11 - { "24s10n.8h", 0x0100, 0x8aac5fd0, 5 }, // 12 - { "24s10n.7h", 0x0100, 0xa507f941, 5 }, // 13 -}; - -STD_ROM_PICK(freekick) -STD_ROM_FN(freekick) - -struct BurnDriver BurnDrvFreekick = { - "freekick", NULL, NULL, NULL, "1987", - "Free Kick (NS6201-A 1987.10)\0", NULL, "Nihon System (Merit license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, freekickRomInfo, freekickRomName, NULL, NULL, FreekckInputInfo, FreekckDIPInfo, - DrvFreeKickInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - -// Free Kick (NS6201-A 1987.9) - -static struct BurnRomInfo freekickaRomDesc[] = { - { "ns6201-a_1987.9_free_kick.cpu", 0xd000, 0xacc0a278, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "11.1e", 0x8000, 0xa6030ba9, 2 | BRF_GRA }, // 1 user1 - - { "12.1h", 0x4000, 0xfb82e486, 3 | BRF_GRA }, // 2 gfx1 - { "13.1j", 0x4000, 0x3ad78ee2, 3 | BRF_GRA }, // 3 - { "14.1l", 0x4000, 0x0185695f, 3 | BRF_GRA }, // 4 - - { "15.1m", 0x4000, 0x0fa7c13c, 4 | BRF_GRA }, // 5 gfx2 - { "16.1p", 0x4000, 0x2b996e89, 4 | BRF_GRA }, // 6 - { "17.1r", 0x4000, 0xe7894def, 4 | BRF_GRA }, // 7 - - { "24s10n.8j", 0x0100, 0x53a6bc21, 5 | BRF_GRA }, // 8 proms - { "24s10n.7j", 0x0100, 0x38dd97d8, 5 | BRF_GRA }, // 9 - { "24s10n.8k", 0x0100, 0x18e66087, 5 | BRF_GRA }, // 10 - { "24s10n.7k", 0x0100, 0xbc21797a, 5 | BRF_GRA }, // 11 - { "24s10n.8h", 0x0100, 0x8aac5fd0, 5 | BRF_GRA }, // 12 - { "24s10n.7h", 0x0100, 0xa507f941, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(freekicka) -STD_ROM_FN(freekicka) - -struct BurnDriver BurnDrvFreekicka = { - "freekicka", "freekick", NULL, NULL, "1987", - "Free Kick (NS6201-A 1987.9)\0", NULL, "Nihon System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, freekickaRomInfo, freekickaRomName, NULL, NULL, FreekckInputInfo, FreekckDIPInfo, - DrvFreeKickInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - -// Free Kick (bootleg set 1) - -static struct BurnRomInfo freekickb1RomDesc[] = { - { "freekbl8.q7", 0x10000, 0x4208cfe5, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "11.1e", 0x08000, 0xa6030ba9, 2 | BRF_GRA }, // 1 user1 - - { "12.1h", 0x04000, 0xfb82e486, 3 | BRF_GRA }, // 2 gfx1 - { "13.1j", 0x04000, 0x3ad78ee2, 3 | BRF_GRA }, // 3 - { "14.1l", 0x04000, 0x0185695f, 3 | BRF_GRA }, // 4 - - { "15.1m", 0x04000, 0x0fa7c13c, 4 | BRF_GRA }, // 5 gfx2 - { "16.1p", 0x04000, 0x2b996e89, 4 | BRF_GRA }, // 6 - { "17.1r", 0x04000, 0xe7894def, 4 | BRF_GRA }, // 7 - - { "24s10n.8j", 0x00100, 0x53a6bc21, 5 | BRF_GRA }, // 8 proms - { "24s10n.7j", 0x00100, 0x38dd97d8, 5 | BRF_GRA }, // 9 - { "24s10n.8k", 0x00100, 0x18e66087, 5 | BRF_GRA }, // 10 - { "24s10n.7k", 0x00100, 0xbc21797a, 5 | BRF_GRA }, // 11 - { "24s10n.8h", 0x00100, 0x8aac5fd0, 5 | BRF_GRA }, // 12 - { "24s10n.7h", 0x00100, 0xa507f941, 5 | BRF_GRA }, // 13 - - { "pal16l8.q10.bin", 0x00001, 0x00000000, 6 | BRF_NODUMP | BRF_GRA }, // 14 pals - { "pal16l8.r1.bin", 0x00001, 0x00000000, 6 | BRF_NODUMP | BRF_GRA }, // 15 - { "pal16l8.s1.bin", 0x00001, 0x00000000, 6 | BRF_NODUMP | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(freekickb1) -STD_ROM_FN(freekickb1) - -struct BurnDriver BurnDrvFreekickb1 = { - "freekickb1", "freekick", NULL, NULL, "1987", - "Free Kick (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, freekickb1RomInfo, freekickb1RomName, NULL, NULL, FreekckInputInfo, FreekckDIPInfo, - DrvFreeKickInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - -// Free Kick (bootleg set 3) - -static struct BurnRomInfo freekickb3RomDesc[] = { - { "1", 0x8000, 0x214e1868, 1 }, // 0 maincpu - { "2", 0x8000, 0x734cdfc7, 1 }, // 1 - - { "11.1e", 0x8000, 0xa6030ba9, 2 }, // 2 user1 - - { "12.1h", 0x4000, 0xfb82e486, 3 }, // 3 gfx1 - { "13.1j", 0x4000, 0x3ad78ee2, 3 }, // 4 - { "14.1l", 0x4000, 0x0185695f, 3 }, // 5 - - { "15.1m", 0x4000, 0x0fa7c13c, 4 }, // 6 gfx2 - { "16.1p", 0x4000, 0x2b996e89, 4 }, // 7 - { "17.1r", 0x4000, 0xe7894def, 4 }, // 8 - - { "24s10n.8j", 0x0100, 0x53a6bc21, 5 }, // 9 proms - { "24s10n.7j", 0x0100, 0x38dd97d8, 5 }, // 10 - { "24s10n.8k", 0x0100, 0x18e66087, 5 }, // 11 - { "24s10n.7k", 0x0100, 0xbc21797a, 5 }, // 12 - { "24s10n.8h", 0x0100, 0x8aac5fd0, 5 }, // 13 - { "24s10n.7h", 0x0100, 0xa507f941, 5 }, // 14 - { "n82s123an", 0x0020, 0x5ed93a02, 5 }, // 15 -}; - -STD_ROM_PICK(freekickb3) -STD_ROM_FN(freekickb3) - -struct BurnDriver BurnDrvFreekickb3 = { - "freekickb3", "freekick", NULL, NULL, "1987", - "Free Kick (bootleg set 3)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, freekickb3RomInfo, freekickb3RomName, NULL, NULL, FreekckInputInfo, FreekckDIPInfo, - DrvFreeKickInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Counter Run (NS6201-A 1988.3) - -static struct BurnRomInfo countrunRomDesc[] = { - { "ns6201-a_1988.3_counter_run.cpu", 0x10000, 0x00000000, 1 | BRF_NODUMP }, // 0 maincpu - - { "c-run.e1", 0x08000, 0x2c3b6f8f, 2 }, // 1 user1 - - { "c-run.h1", 0x04000, 0x3385b7b5, 3 }, // 2 gfx1 - { "c-run.j1", 0x04000, 0x58dc148d, 3 }, // 3 - { "c-run.l1", 0x04000, 0x3201f1e9, 3 }, // 4 - - { "c-run.m1", 0x04000, 0x1efab3b4, 4 }, // 5 gfx2 - { "c-run.p1", 0x04000, 0xd0bf8d42, 4 }, // 6 - { "c-run.r1", 0x04000, 0x4bb4a3e3, 4 }, // 7 - - { "24s10n.8j", 0x00100, 0x63c114ad, 5 }, // 8 proms - { "24s10n.7j", 0x00100, 0xd16f95cc, 5 }, // 9 - { "24s10n.8k", 0x00100, 0x217db2c1, 5 }, // 10 - { "24s10n.7k", 0x00100, 0x8d983949, 5 }, // 11 - { "24s10n.8h", 0x00100, 0x33e87550, 5 }, // 12 - { "24s10n.7h", 0x00100, 0xc77d0077, 5 }, // 13 -}; - -STD_ROM_PICK(countrun) -STD_ROM_FN(countrun) - -struct BurnDriver BurnDrvCountrun = { - "countrun", NULL, NULL, NULL, "1988", - "Counter Run (NS6201-A 1988.3)\0", "Please use countrunb instead!", "Nihon System (Sega license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, countrunRomInfo, countrunRomName, NULL, NULL, CountrunInputInfo, CountrunDIPInfo, - DrvFreeKickInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - -// Counter Run (bootleg set 1) - -static struct BurnRomInfo countrunbRomDesc[] = { - { "rom_cpu.bin", 0x10000, 0xf65639ae, 1 }, // 0 maincpu - - { "c-run.e1", 0x08000, 0x2c3b6f8f, 2 }, // 1 user1 - - { "c-run.h1", 0x04000, 0x3385b7b5, 3 }, // 2 gfx1 - { "c-run.j1", 0x04000, 0x58dc148d, 3 }, // 3 - { "c-run.l1", 0x04000, 0x3201f1e9, 3 }, // 4 - - { "c-run.m1", 0x04000, 0x1efab3b4, 4 }, // 5 gfx2 - { "c-run.p1", 0x04000, 0xd0bf8d42, 4 }, // 6 - { "c-run.r1", 0x04000, 0x4bb4a3e3, 4 }, // 7 - - { "24s10n.8j", 0x00100, 0x63c114ad, 5 }, // 8 proms - { "24s10n.7j", 0x00100, 0xd16f95cc, 5 }, // 9 - { "24s10n.8k", 0x00100, 0x217db2c1, 5 }, // 10 - { "24s10n.7k", 0x00100, 0x8d983949, 5 }, // 11 - { "24s10n.8h", 0x00100, 0x33e87550, 5 }, // 12 - { "24s10n.7h", 0x00100, 0xc77d0077, 5 }, // 13 -}; - -STD_ROM_PICK(countrunb) -STD_ROM_FN(countrunb) - -struct BurnDriver BurnDrvCountrunb = { - "countrunb", "countrun", NULL, NULL, "1988", - "Counter Run (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, countrunbRomInfo, countrunbRomName, NULL, NULL, CountrunInputInfo, CountrunDIPInfo, - DrvFreeKickInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - -// Gigas (bootleg) - -static struct BurnRomInfo gigasbRomDesc[] = { - { "g-7", 0x08000, 0xdaf4e88d, 1 }, // 0 maincpu - { "g-8", 0x10000, 0x4ab4c1f1, 1 }, // 1 - - { "g-4", 0x04000, 0x8ed78981, 2 }, // 2 gfx1 - { "g-5", 0x04000, 0x0645ec2d, 2 }, // 3 - { "g-6", 0x04000, 0x99e9cb27, 2 }, // 4 - - { "g-1", 0x04000, 0xd78fae6e, 3 }, // 5 gfx2 - { "g-3", 0x04000, 0x37df4a4c, 3 }, // 6 - { "g-2", 0x04000, 0x3a46e354, 3 }, // 7 - - { "1.pr", 0x00100, 0xa784e71f, 4 }, // 8 proms - { "6.pr", 0x00100, 0x376df30c, 4 }, // 9 - { "5.pr", 0x00100, 0x4edff5bd, 4 }, // 10 - { "4.pr", 0x00100, 0xfe201a4e, 4 }, // 11 - { "2.pr", 0x00100, 0x5796cc4a, 4 }, // 12 - { "3.pr", 0x00100, 0x28b5ee4c, 4 }, // 13 -}; - -STD_ROM_PICK(gigasb) -STD_ROM_FN(gigasb) - -struct BurnDriver BurnDrvGigasb = { - "gigasb", "gigas", NULL, NULL, "1986", - "Gigas (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, gigasbRomInfo, gigasbRomName, NULL, NULL, GigasInputInfo, GigasDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - -// Gigas Mark II (bootleg) - -static struct BurnRomInfo gigasm2RomDesc[] = { - { "8.rom", 0x08000, 0xc00a4a6c, 1 }, // 0 maincpu - { "7.rom", 0x08000, 0x92bd9045, 1 }, // 1 - { "9.rom", 0x08000, 0xa3ef809c, 1 }, // 1 - - { "4.rom", 0x04000, 0x20b3405f, 2 }, // 2 gfx1 - { "5.rom", 0x04000, 0xd04ecfa8, 2 }, // 3 - { "6.rom", 0x04000, 0x33776801, 2 }, // 4 - - { "1.rom", 0x04000, 0xf64cbd1e, 3 }, // 5 gfx2 - { "3.rom", 0x04000, 0xc228df19, 3 }, // 6 - { "2.rom", 0x04000, 0xa6ad9ce2, 3 }, // 7 - - { "1.pr", 0x00100, 0xa784e71f, 4 }, // 8 proms - { "6.pr", 0x00100, 0x376df30c, 4 }, // 9 - { "5.pr", 0x00100, 0x4edff5bd, 4 }, // 10 - { "4.pr", 0x00100, 0xfe201a4e, 4 }, // 11 - { "2.pr", 0x00100, 0x5796cc4a, 4 }, // 12 - { "3.pr", 0x00100, 0x28b5ee4c, 4 }, // 13 -}; - -STD_ROM_PICK(gigasm2) -STD_ROM_FN(gigasm2) - -struct BurnDriver BurnDrvGigasm2 = { - "gigasm2b", NULL, NULL, NULL, "1986", - "Gigas Mark II\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, gigasm2RomInfo, gigasm2RomName, NULL, NULL, GigasInputInfo, Gigasm2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - -// Gigas (MC-8123, 317-5002) - -static struct BurnRomInfo gigasRomDesc[] = { - { "8.8n", 0x04000, 0x34ea8262, BRF_ESS | BRF_PRG }, // 0 maincpu - { "7.8r", 0x08000, 0x43653909, BRF_ESS | BRF_PRG }, // 1 - - { "4.3k", 0x04000, 0x8ed78981, BRF_GRA }, // 2 gfx1 - { "5.3h", 0x04000, 0x0645ec2d, BRF_GRA }, // 3 - { "6.3g", 0x04000, 0x99e9cb27, BRF_GRA }, // 4 - - { "1.3p", 0x04000, 0xd78fae6e, BRF_GRA }, // 5 gfx2 - { "3.3l", 0x04000, 0x37df4a4c, BRF_GRA }, // 6 - { "2.3n", 0x04000, 0x3a46e354, BRF_GRA }, // 7 - - { "3a.bin", 0x00100, 0xa784e71f, BRF_OPT }, // 8 proms - { "4d.bin", 0x00100, 0x376df30c, BRF_OPT }, // 9 - { "4a.bin", 0x00100, 0x4edff5bd, BRF_OPT }, // 10 - { "3d.bin", 0x00100, 0xfe201a4e, BRF_OPT }, // 11 - { "3b.bin", 0x00100, 0x5796cc4a, BRF_OPT }, // 12 - { "3c.bin", 0x00100, 0x28b5ee4c, BRF_OPT }, // 13 - - { "317-5002.key", 0x02000, 0x86a7e5f6, BRF_ESS | BRF_PRG }, // 14 -}; -STD_ROM_PICK(gigas) -STD_ROM_FN(gigas) - -struct BurnDriver BurnDrvGigas = { - "gigas", NULL, NULL, NULL, "1986", - "Gigas (MC-8123, 317-5002)\0", "Please use gigasb instead!", "SEGA", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0 | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, gigasRomInfo, gigasRomName, NULL, NULL, GigasInputInfo, GigasDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_funkybee.cpp b/jan/src/burn/drv/pre90s/d_funkybee.cpp deleted file mode 100644 index 81a89735d..000000000 --- a/jan/src/burn/drv/pre90s/d_funkybee.cpp +++ /dev/null @@ -1,730 +0,0 @@ -// FB Alpha Funky Bee Driver Module -// Based on MAME driver by Zsolt Vasvari - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 *scroll; -static UINT8 *flipscreen; -static UINT8 *gfx_bank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 watchdog; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 0, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy1 + 3, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 1, "p1 right" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 1"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy1 + 1, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy1 + 4, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 1, "p2 right" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up", }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo funkybeeDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x20, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x10, 0x01, 0x03, 0x03, "1C 1C" }, - {0x10, 0x01, 0x03, 0x02, "1C 2C" }, - {0x10, 0x01, 0x03, 0x01, "1C 3C" }, - {0x10, 0x01, 0x03, 0x00, "1C 4C" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x10, 0x01, 0x0c, 0x08, "2C 1C" }, - {0x10, 0x01, 0x0c, 0x0c, "1C 1C" }, - {0x10, 0x01, 0x0c, 0x04, "2C 3C" }, - {0x10, 0x01, 0x0c, 0x00, "1C 6C" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x20, "4" }, - {0x10, 0x01, 0x30, 0x10, "5" }, - {0x10, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x40, 0x40, "20000" }, - {0x10, 0x01, 0x40, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x00, "Upright" }, - {0x10, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(funkybee) - -static struct BurnDIPInfo funkbeebDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x20, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x10, 0x01, 0x03, 0x03, "1C 1C" }, - {0x10, 0x01, 0x03, 0x02, "1C 2C" }, - {0x10, 0x01, 0x03, 0x01, "1C 3C" }, - {0x10, 0x01, 0x03, 0x00, "1C 4C" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x10, 0x01, 0x0c, 0x08, "2C 1C" }, - {0x10, 0x01, 0x0c, 0x0c, "1C 1C" }, - {0x10, 0x01, 0x0c, 0x04, "2C 3C" }, - {0x10, 0x01, 0x0c, 0x00, "1C 6C" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x30, 0x30, "1" }, - {0x10, 0x01, 0x30, 0x20, "2" }, - {0x10, 0x01, 0x30, 0x10, "3" }, - {0x10, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x40, 0x40, "20000" }, - {0x10, 0x01, 0x40, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x00, "Upright" }, - {0x10, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(funkbeeb) - -static struct BurnDIPInfo skylancrDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x20, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x10, 0x01, 0x03, 0x03, "1C 1C" }, - {0x10, 0x01, 0x03, 0x02, "1C 2C" }, - {0x10, 0x01, 0x03, 0x01, "1C 3C" }, - {0x10, 0x01, 0x03, 0x00, "1C 6C" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x10, 0x01, 0x0c, 0x08, "2C 1C" }, - {0x10, 0x01, 0x0c, 0x0c, "1C 1C" }, - {0x10, 0x01, 0x0c, 0x04, "2C 3C" }, - {0x10, 0x01, 0x0c, 0x00, "1C 6C" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x30, 0x30, "1" }, - {0x10, 0x01, 0x30, 0x20, "2" }, - {0x10, 0x01, 0x30, 0x10, "3" }, - {0x10, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x40, 0x40, "20000" }, - {0x10, 0x01, 0x40, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x00, "Upright" }, - {0x10, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(skylancr) - -static struct BurnDIPInfo skylanceDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x20, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x10, 0x01, 0x03, 0x03, "1C 1C" }, - {0x10, 0x01, 0x03, 0x02, "1C 2C" }, - {0x10, 0x01, 0x03, 0x01, "1C 3C" }, - {0x10, 0x01, 0x03, 0x00, "1C 6C" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x10, 0x01, 0x0c, 0x08, "2C 1C" }, - {0x10, 0x01, 0x0c, 0x0c, "1C 1C" }, - {0x10, 0x01, 0x0c, 0x04, "2C 3C" }, - {0x10, 0x01, 0x0c, 0x00, "1C 6C" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x20, "4" }, - {0x10, 0x01, 0x30, 0x10, "5" }, - {0x10, 0x01, 0x30, 0x00, "64" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x40, 0x40, "20000 50000" }, - {0x10, 0x01, 0x40, 0x00, "40000 70000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x00, "Upright" }, - {0x10, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(skylance) - -UINT8 __fastcall funkybee_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - return 0; - - case 0xf800: - watchdog = 0; - return DrvInputs[0] | (DrvDips[0] & 0xe0); - - case 0xf801: - return DrvInputs[1]; - - case 0xf802: - return DrvInputs[2]; - } - - return 0; -} - -void __fastcall funkybee_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - *scroll = data; - break; - - case 0xe800: - *flipscreen = data & 1; - break; - - case 0xe802: // coin counter - case 0xe803: - break; - - case 0xe805: - *gfx_bank = data & 1; - break; - - case 0xf800: - watchdog = 0; - break; - } -} - -UINT8 __fastcall funkybee_in_port(UINT16 address) -{ - switch (address & 0xff) - { - case 0x02: - return AY8910Read(0); - } - - return 0; -} - -void __fastcall funkybee_out_port(UINT16 address, UINT8 data) -{ - switch (address & 0xff) - { - case 0x00: - case 0x01: - AY8910Write(0, address & 1, data); - break; - } -} - -static UINT8 funkybee_ay8910_read_A(UINT32) -{ - return DrvDips[1]; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - watchdog = 0; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Planes[2] = { 0, 4 }; - INT32 XOffs[8] = { STEP4(0, 1), STEP4(0x40, 1) }; - INT32 YOffs[32] = { STEP8(0, 8), STEP8(0x80, 8), STEP8(0x100, 8), STEP8(0x180, 8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x400, 2, 8, 8, Planes, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - GfxDecode(0x100, 2, 8, 32, Planes, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree (tmp); -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x005000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x002000; - DrvColRAM = Next; Next += 0x002000; - - flipscreen = Next; Next += 0x000001; - gfx_bank = Next; Next += 0x000001; - scroll = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 game) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (game) { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 4, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 5, 1)) return 1; - } else { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x3000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 5, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 6, 1)) return 1; - } - - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x4fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x4fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetMapArea(0xa000, 0xbfff, 0, DrvVidRAM); - ZetMapArea(0xa000, 0xbfff, 1, DrvVidRAM); - ZetMapArea(0xa000, 0xbfff, 2, DrvVidRAM); - ZetMapArea(0xc000, 0xdfff, 0, DrvColRAM); - ZetMapArea(0xc000, 0xdfff, 1, DrvColRAM); - ZetMapArea(0xc000, 0xdfff, 2, DrvColRAM); - ZetSetWriteHandler(funkybee_write); - ZetSetReadHandler(funkybee_read); - ZetSetOutHandler(funkybee_out_port); - ZetSetInHandler(funkybee_in_port); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, &funkybee_ay8910_read_A, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - - BurnFree(AllMem); - - return 0; -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sx -= *scroll; - if (sx < -7) sx += 256; - - INT32 ofst = ((offs / 0x20) * 0x100) + (offs & 0x1f); - - INT32 attr = DrvColRAM[ofst]; - INT32 code = DrvVidRAM[ofst] + ((attr & 0x80) << 1) + (*gfx_bank * 0x200); - INT32 color = attr & 0x03; - - Render8x8Tile_Clip(pTransDraw, code, sx - 12, sy, color, 2, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x0f; offs >= 0; offs--) - { - INT32 ofst = offs + 0x1e00; - INT32 attr = DrvVidRAM[ofst]; - INT32 sy = 224 - DrvColRAM[ofst]; - INT32 sx = DrvVidRAM[ofst + 0x10]; - INT32 color = DrvColRAM[ofst + 0x10] & 3; - INT32 code = (attr >> 2) + ((attr & 2) << 5) + (*gfx_bank * 0x080); - INT32 flipy = attr & 1; - INT32 flipx = 0; - - if (flipy) { - if (flipx) { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 8, 32, code, sx - 12, sy, color, 2, 0, 0x10, DrvGfxROM1); - } else { - RenderCustomTile_Mask_FlipY_Clip(pTransDraw, 8, 32, code, sx - 12, sy, color, 2, 0, 0x10, DrvGfxROM1); - } - } else { - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(pTransDraw, 8, 32, code, sx - 12, sy, color, 2, 0, 0x10, DrvGfxROM1); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 8, 32, code, sx - 12, sy, color, 2, 0, 0x10, DrvGfxROM1); - } - } - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0x1f; offs >= 0; offs--) - { - int flip = *flipscreen; - int sy = offs * 8; - if (flip) sy = 248 - sy; - - int code = DrvVidRAM[0x1c00 + offs] + (*gfx_bank * 0x200); - int color = DrvColRAM[0x1f10] & 0x03; - int sx = flip ? DrvVidRAM[0x1f1f] : DrvVidRAM[0x1f10]; - - if (flip) - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, (232 - sx) + 4, sy ^ 0xf8, color, 2, 0, 0, DrvGfxROM0); - else - Render8x8Tile_Mask_Clip(pTransDraw, code, sx - 12, sy, color, 2, 0, 0, DrvGfxROM0); - - code = DrvVidRAM[0x1d00 + offs] + (*gfx_bank * 0x200); - color = DrvColRAM[0x1f11] & 0x03; - sx = flip ? DrvVidRAM[0x1f1e] : DrvVidRAM[0x1f11]; - - if (flip) - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, (232 - sx) + 4, sy ^ 0xf8, color, 2, 0, 0, DrvGfxROM0); - else - Render8x8Tile_Mask_Clip(pTransDraw, code, sx - 12, sy, color, 2, 0, 0, DrvGfxROM0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_bg_layer(); - draw_sprites(); - draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - { - memset (DrvInputs, 0, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - ZetOpen(0); - ZetRun(3072000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - } - - return 0; -} - - -// Funky Bee - -static struct BurnRomInfo funkybeeRomDesc[] = { - { "funkybee.1", 0x1000, 0x3372cb33, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "funkybee.3", 0x1000, 0x7bf7c62f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "funkybee.2", 0x1000, 0x8cc0fe8e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "funkybee.4", 0x1000, 0x1e1aac26, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "funkybee.5", 0x2000, 0x86126655, 2 | BRF_GRA }, // 4 Graphics tiles - { "funkybee.6", 0x2000, 0x5fffd323, 2 | BRF_GRA }, // 5 - - { "funkybee.clr", 0x0020, 0xe2cf5fe2, 3 | BRF_GRA }, // 6 Color prom -}; - -STD_ROM_PICK(funkybee) -STD_ROM_FN(funkybee) - -static INT32 funkybeeInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvfunkybee = { - "funkybee", NULL, NULL, NULL, "1982", - "Funky Bee\0", NULL, "Orca", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, funkybeeRomInfo, funkybeeRomName, NULL, NULL, DrvInputInfo, funkybeeDIPInfo, - funkybeeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 224, 236, 3, 4 -}; - - -// Funky Bee (bootleg, harder) - -static struct BurnRomInfo funkbeebRomDesc[] = { - { "senza_orca.fb1", 0x1000, 0x7f2e7f85, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "funkybee.3", 0x1000, 0x7bf7c62f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "funkybee.2", 0x1000, 0x8cc0fe8e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "senza_orca.fb4", 0x1000, 0x53c2db3b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "funkybee.5", 0x2000, 0x86126655, 2 | BRF_GRA }, // 4 Graphics tiles - { "funkybee.6", 0x2000, 0x5fffd323, 2 | BRF_GRA }, // 5 - - { "funkybee.clr", 0x0020, 0xe2cf5fe2, 3 | BRF_GRA }, // 6 Color prom -}; - -STD_ROM_PICK(funkbeeb) -STD_ROM_FN(funkbeeb) - -struct BurnDriver BurnDrvfunkbeeb = { - "funkybeeb", "funkybee", NULL, NULL, "1982", - "Funky Bee (bootleg, harder)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, funkbeebRomInfo, funkbeebRomName, NULL, NULL, DrvInputInfo, funkbeebDIPInfo, - funkybeeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 224, 236, 3, 4 -}; - - -// Sky Lancer - -static struct BurnRomInfo skylancrRomDesc[] = { - { "1sl.5a", 0x2000, 0xe80b315e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2sl.5c", 0x2000, 0x9d70567b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3sl.5d", 0x2000, 0x64c39457, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "4sl.6a", 0x2000, 0x9b4469a5, 2 | BRF_GRA }, // 3 Graphics tiles - { "5sl.6c", 0x2000, 0x29afa134, 2 | BRF_GRA }, // 4 - - { "18s030.1a", 0x0020, 0xe645bacb, 3 | BRF_GRA }, // 5 Color prom -}; - -STD_ROM_PICK(skylancr) -STD_ROM_FN(skylancr) - -static INT32 skylancrInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvskylancr = { - "skylancr", NULL, NULL, NULL, "1983", - "Sky Lancer\0", NULL, "Orca", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, skylancrRomInfo, skylancrRomName, NULL, NULL, DrvInputInfo, skylancrDIPInfo, - skylancrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 224, 236, 3, 4 -}; - - -// Sky Lancer (Esco Trading Co license) - -static struct BurnRomInfo skylanceRomDesc[] = { - { "1.5a", 0x2000, 0x82d55824, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2.5c", 0x2000, 0xdff3a682, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.5d", 0x1000, 0x7c006ee6, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "4.6a", 0x2000, 0x0f8ede07, 2 | BRF_GRA }, // 3 Graphics tiles - { "5.6b", 0x2000, 0x24cec070, 2 | BRF_GRA }, // 4 - - { "18s030.1a", 0x0020, 0xe645bacb, 3 | BRF_GRA }, // 5 Color prom -}; - -STD_ROM_PICK(skylance) -STD_ROM_FN(skylance) - -struct BurnDriver BurnDrvskylance = { - "skylancre", "skylancr", NULL, NULL, "1983", - "Sky Lancer (Esco Trading Co license)\0", NULL, "Orca (Esco Trading Co license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, skylanceRomInfo, skylanceRomName, NULL, NULL, DrvInputInfo, skylanceDIPInfo, - skylancrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20, - 224, 236, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_galaga.cpp b/jan/src/burn/drv/pre90s/d_galaga.cpp deleted file mode 100644 index afc008c15..000000000 --- a/jan/src/burn/drv/pre90s/d_galaga.cpp +++ /dev/null @@ -1,2328 +0,0 @@ -// Galaga & Dig-Dug driver for FB Alpha, based on the MAME driver by Nicola Salmoria & previous work by Martin Scragg, Mirko Buffoni, Aaron Giles -// Dig Dug added July 27, 2015 - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "namco_snd.h" -#include "samples.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1r[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2r[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[3] = {0, 0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80Rom1 = NULL; -static UINT8 *DrvZ80Rom2 = NULL; -static UINT8 *DrvZ80Rom3 = NULL; -static UINT8 *DrvVideoRam = NULL; -static UINT8 *DrvSharedRam1 = NULL; -static UINT8 *DrvSharedRam2 = NULL; -static UINT8 *DrvSharedRam3 = NULL; -static UINT8 *DrvPromPalette = NULL; -static UINT8 *DrvPromCharLookup = NULL; -static UINT8 *DrvPromSpriteLookup = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvGfx4 = NULL; // digdug playfield data -static UINT8 *DrvDigdugChars = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvCPU1FireIRQ; -static UINT8 DrvCPU2FireIRQ; -static UINT8 DrvCPU3FireIRQ; -static UINT8 DrvCPU2Halt; -static UINT8 DrvCPU3Halt; -static UINT8 DrvFlipScreen; -static UINT8 DrvStarControl[6]; -static UINT32 DrvStarScrollX; -static UINT32 DrvStarScrollY; - -static UINT8 IOChipCustomCommand; -static UINT8 IOChipCPU1FireIRQ; -static UINT8 IOChipMode; -static UINT8 IOChipCredits; -static UINT8 IOChipCoinPerCredit; -static UINT8 IOChipCreditPerCoin; -static UINT8 IOChipCustom[16]; -static UINT8 PrevInValue; -// Namco54XX Stuff -static INT32 Fetch = 0; -static INT32 FetchMode = 0; -static UINT8 Config1[4], Config2[4], Config3[5]; -// Dig Dug playfield stuff -static INT32 playfield, alphacolor, playenable, playcolor; -static INT32 digdugmode; -static UINT8 bHasSamples = 0; - -// hi-score stuff! (atari earom) -#define EAROM_SIZE 0x40 -static UINT8 earom_offset; -static UINT8 earom_data; -static UINT8 earom[EAROM_SIZE]; - -static INT32 DrvButtonHold[2] = { 0, 0 }; // Fire button must be held for 1 frame -static INT32 DrvButtonHeld[2] = { 0, 0 }; // otherwise Dig Dug acts strangely. -static INT32 DrvLastButtons; // State of the last button press - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 3, "p2 start" }, - - {"Left" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 6, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo DigdugInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 start" }, - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"P2 Left (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 left" }, - {"P2 Right (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"P2 Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -// {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Digdug) - - -static struct BurnDIPInfo DigdugDIPList[]= -{ - {0x10, 0xff, 0xff, 0xa1, NULL }, - {0x11, 0xff, 0xff, 0x24, NULL }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x10, 0x01, 0x07, 0x07, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x01, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x07, 0x05, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x07, 0x00, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16, "Bonus Life" }, - {0x10, 0x01, 0x38, 0x20, "10K, 40K, Every 40K" }, - {0x10, 0x01, 0x38, 0x10, "10K, 50K, Every 50K" }, - {0x10, 0x01, 0x38, 0x30, "20K, 60K, Every 60K" }, - {0x10, 0x01, 0x38, 0x08, "20K, 70K, Every 70K" }, - {0x10, 0x01, 0x38, 0x28, "10K and 40K Only" }, - {0x10, 0x01, 0x38, 0x18, "20K and 60K Only" }, - {0x10, 0x01, 0x38, 0x38, "10K Only" }, - {0x10, 0x01, 0x38, 0x00, "None" }, - {0x10, 0x01, 0x38, 0x20, "20K, 60K, Every 60K" }, - {0x10, 0x01, 0x38, 0x10, "30K, 80K, Every 80K" }, - {0x10, 0x01, 0x38, 0x30, "20K and 50K Only" }, - {0x10, 0x01, 0x38, 0x08, "20K and 60K Only" }, - {0x10, 0x01, 0x38, 0x28, "30K and 70K Only" }, - {0x10, 0x01, 0x38, 0x18, "20K Only" }, - {0x10, 0x01, 0x38, 0x38, "30K Only" }, - {0x10, 0x01, 0x38, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0xc0, 0x00, "1" }, - {0x10, 0x01, 0xc0, 0x40, "2" }, - {0x10, 0x01, 0xc0, 0x80, "3" }, - {0x10, 0x01, 0xc0, 0xc0, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x08, 0x08, "No" }, - {0x11, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x04, "Upright" }, - {0x11, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x03, 0x00, "Easy" }, - {0x11, 0x01, 0x03, 0x02, "Medium" }, - {0x11, 0x01, 0x03, 0x01, "Hard" }, - {0x11, 0x01, 0x03, 0x03, "Hardest" }, -}; - -STDDIPINFO(Digdug) - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x80, NULL }, - {0x0d, 0xff, 0xff, 0xf7, NULL }, - {0x0e, 0xff, 0xff, 0x97, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x80, 0x80, "Off" }, - {0x0c, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0d, 0x01, 0x03, 0x03, "Easy" }, - {0x0d, 0x01, 0x03, 0x00, "Medium" }, - {0x0d, 0x01, 0x03, 0x01, "Hard" }, - {0x0d, 0x01, 0x03, 0x02, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x08, "Off" }, - {0x0d, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x0d, 0x01, 0x10, 0x10, "Off" }, - {0x0d, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Rack Test" }, - {0x0d, 0x01, 0x20, 0x20, "Off" }, - {0x0d, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x80, 0x80, "Upright" }, - {0x0d, 0x01, 0x80, 0x00, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x0e, 0x01, 0x07, 0x04, "4 Coins 1 Play" }, - {0x0e, 0x01, 0x07, 0x02, "3 Coins 1 Play" }, - {0x0e, 0x01, 0x07, 0x06, "2 Coins 1 Play" }, - {0x0e, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x0e, 0x01, 0x07, 0x01, "2 Coins 3 Plays" }, - {0x0e, 0x01, 0x07, 0x03, "1 Coin 2 Plays" }, - {0x0e, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x0e, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x0e, 0x01, 0x38, 0x20, "20k 60k 60k" }, - {0x0e, 0x01, 0x38, 0x18, "20k 60k" }, - {0x0e, 0x01, 0x38, 0x10, "20k 70k 70k" }, - {0x0e, 0x01, 0x38, 0x30, "20k 80k 80k" }, - {0x0e, 0x01, 0x38, 0x38, "30k 80k" }, - {0x0e, 0x01, 0x38, 0x08, "30k 100k 100k" }, - {0x0e, 0x01, 0x38, 0x28, "30k 120k 120k" }, - {0x0e, 0x01, 0x38, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0xc0, 0x00, "2" }, - {0x0e, 0x01, 0xc0, 0x80, "3" }, - {0x0e, 0x01, 0xc0, 0x40, "4" }, - {0x0e, 0x01, 0xc0, 0xc0, "5" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo GalagamwDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x80, NULL }, - {0x0d, 0xff, 0xff, 0xf7, NULL }, - {0x0e, 0xff, 0xff, 0x97, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x80, 0x80, "Off" }, - {0x0c, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits Game" }, - {0x0d, 0x01, 0x01, 0x00, "1 Player" }, - {0x0d, 0x01, 0x01, 0x01, "2 Players" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0d, 0x01, 0x06, 0x06, "Easy" }, - {0x0d, 0x01, 0x06, 0x00, "Medium" }, - {0x0d, 0x01, 0x06, 0x02, "Hard" }, - {0x0d, 0x01, 0x06, 0x04, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x08, "Off" }, - {0x0d, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x0d, 0x01, 0x10, 0x10, "Off" }, - {0x0d, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Rack Test" }, - {0x0d, 0x01, 0x20, 0x20, "Off" }, - {0x0d, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x80, 0x80, "Upright" }, - {0x0d, 0x01, 0x80, 0x00, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x0e, 0x01, 0x07, 0x04, "4 Coins 1 Play" }, - {0x0e, 0x01, 0x07, 0x02, "3 Coins 1 Play" }, - {0x0e, 0x01, 0x07, 0x06, "2 Coins 1 Play" }, - {0x0e, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x0e, 0x01, 0x07, 0x01, "2 Coins 3 Plays" }, - {0x0e, 0x01, 0x07, 0x03, "1 Coin 2 Plays" }, - {0x0e, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x0e, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x0e, 0x01, 0x38, 0x20, "20k 60k 60k" }, - {0x0e, 0x01, 0x38, 0x18, "20k 60k" }, - {0x0e, 0x01, 0x38, 0x10, "20k 70k 70k" }, - {0x0e, 0x01, 0x38, 0x30, "20k 80k 80k" }, - {0x0e, 0x01, 0x38, 0x38, "30k 80k" }, - {0x0e, 0x01, 0x38, 0x08, "30k 100k 100k" }, - {0x0e, 0x01, 0x38, 0x28, "30k 120k 120k" }, - {0x0e, 0x01, 0x38, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0xc0, 0x00, "2" }, - {0x0e, 0x01, 0xc0, 0x80, "3" }, - {0x0e, 0x01, 0xc0, 0x40, "4" }, - {0x0e, 0x01, 0xc0, 0xc0, "5" }, -}; - -STDDIPINFO(Galagamw) - -static struct BurnRomInfo DrvRomDesc[] = { - { "gg1_1b.3p", 0x01000, 0xab036c9f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "gg1_2b.3m", 0x01000, 0xd9232240, BRF_ESS | BRF_PRG }, // 1 - { "gg1_3.2m", 0x01000, 0x753ce503, BRF_ESS | BRF_PRG }, // 2 - { "gg1_4b.2l", 0x01000, 0x499fcc76, BRF_ESS | BRF_PRG }, // 3 - - { "gg1_5b.3f", 0x01000, 0xbb5caae3, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - - { "gg1_7b.2c", 0x01000, 0xd016686b, BRF_ESS | BRF_PRG }, // 5 Z80 #3 Program Code - - { "gg1_9.4l", 0x01000, 0x58b2f47c, BRF_GRA }, // 6 Characters - - { "gg1_11.4d", 0x01000, 0xad447c80, BRF_GRA }, // 7 Sprites - { "gg1_10.4f", 0x01000, 0xdd6f1afc, BRF_GRA }, // 8 - - { "prom-5.5n", 0x00020, 0x54603c6b, BRF_GRA }, // 9 PROMs - { "prom-4.2n", 0x00100, 0x59b6edab, BRF_GRA }, // 10 - { "prom-3.1c", 0x00100, 0x4a04bb6b, BRF_GRA }, // 11 - { "prom-1.1d", 0x00100, 0x7a2815b4, BRF_GRA }, // 12 - { "prom-2.5c", 0x00100, 0x77245b66, BRF_GRA }, // 13 -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo GalagaoRomDesc[] = { - { "gg1-1.3p", 0x01000, 0xa3a0f743, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "gg1-2.3m", 0x01000, 0x43bb0d5c, BRF_ESS | BRF_PRG }, // 1 - { "gg1-3.2m", 0x01000, 0x753ce503, BRF_ESS | BRF_PRG }, // 2 - { "gg1-4.2l", 0x01000, 0x83874442, BRF_ESS | BRF_PRG }, // 3 - - { "gg1-5.3f", 0x01000, 0x3102fccd, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - - { "gg1-7.2c", 0x01000, 0x8995088d, BRF_ESS | BRF_PRG }, // 5 Z80 #3 Program Code - - { "gg1-9.4l", 0x01000, 0x58b2f47c, BRF_GRA }, // 6 Characters - - { "gg1-11.4d", 0x01000, 0xad447c80, BRF_GRA }, // 7 Sprites - { "gg1-10.4f", 0x01000, 0xdd6f1afc, BRF_GRA }, // 8 - - { "prom-5.5n", 0x00020, 0x54603c6b, BRF_GRA }, // 9 PROMs - { "prom-4.2n", 0x00100, 0x59b6edab, BRF_GRA }, // 10 - { "prom-3.1c", 0x00100, 0x4a04bb6b, BRF_GRA }, // 11 - { "prom-1.1d", 0x00100, 0x7a2815b4, BRF_GRA }, // 12 - { "prom-2.5c", 0x00100, 0x77245b66, BRF_GRA }, // 13 -}; - -STD_ROM_PICK(Galagao) -STD_ROM_FN(Galagao) - -static struct BurnRomInfo GalagamwRomDesc[] = { - { "3200a.bin", 0x01000, 0x3ef0b053, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "3300b.bin", 0x01000, 0x1b280831, BRF_ESS | BRF_PRG }, // 1 - { "3400c.bin", 0x01000, 0x16233d33, BRF_ESS | BRF_PRG }, // 2 - { "3500d.bin", 0x01000, 0x0aaf5c23, BRF_ESS | BRF_PRG }, // 3 - - { "3600e.bin", 0x01000, 0xbc556e76, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - - { "3700g.bin", 0x01000, 0xb07f0aa4, BRF_ESS | BRF_PRG }, // 5 Z80 #3 Program Code - - { "2600j.bin", 0x01000, 0x58b2f47c, BRF_GRA }, // 6 Characters - - { "2800l.bin", 0x01000, 0xad447c80, BRF_GRA }, // 7 Sprites - { "2700k.bin", 0x01000, 0xdd6f1afc, BRF_GRA }, // 8 - - { "prom-5.5n", 0x00020, 0x54603c6b, BRF_GRA }, // 9 PROMs - { "prom-4.2n", 0x00100, 0x59b6edab, BRF_GRA }, // 10 - { "prom-3.1c", 0x00100, 0x4a04bb6b, BRF_GRA }, // 11 - { "prom-1.1d", 0x00100, 0x7a2815b4, BRF_GRA }, // 12 - { "prom-2.5c", 0x00100, 0x77245b66, BRF_GRA }, // 13 -}; - -STD_ROM_PICK(Galagamw) -STD_ROM_FN(Galagamw) - -static struct BurnRomInfo GalagamfRomDesc[] = { - { "3200a.bin", 0x01000, 0x3ef0b053, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "3300b.bin", 0x01000, 0x1b280831, BRF_ESS | BRF_PRG }, // 1 - { "3400c.bin", 0x01000, 0x16233d33, BRF_ESS | BRF_PRG }, // 2 - { "3500d.bin", 0x01000, 0x0aaf5c23, BRF_ESS | BRF_PRG }, // 3 - - { "3600fast.bin", 0x01000, 0x23d586e5, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - - { "3700g.bin", 0x01000, 0xb07f0aa4, BRF_ESS | BRF_PRG }, // 5 Z80 #3 Program Code - - { "2600j.bin", 0x01000, 0x58b2f47c, BRF_GRA }, // 6 Characters - - { "2800l.bin", 0x01000, 0xad447c80, BRF_GRA }, // 7 Sprites - { "2700k.bin", 0x01000, 0xdd6f1afc, BRF_GRA }, // 8 - - { "prom-5.5n", 0x00020, 0x54603c6b, BRF_GRA }, // 9 PROMs - { "prom-4.2n", 0x00100, 0x59b6edab, BRF_GRA }, // 10 - { "prom-3.1c", 0x00100, 0x4a04bb6b, BRF_GRA }, // 11 - { "prom-1.1d", 0x00100, 0x7a2815b4, BRF_GRA }, // 12 - { "prom-2.5c", 0x00100, 0x77245b66, BRF_GRA }, // 13 -}; - -STD_ROM_PICK(Galagamf) -STD_ROM_FN(Galagamf) - -static struct BurnRomInfo GalagamkRomDesc[] = { - { "mk2-1", 0x01000, 0x23cea1e2, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "mk2-2", 0x01000, 0x89695b1a, BRF_ESS | BRF_PRG }, // 1 - { "3400c.bin", 0x01000, 0x16233d33, BRF_ESS | BRF_PRG }, // 2 - { "mk2-4", 0x01000, 0x24b767f5, BRF_ESS | BRF_PRG }, // 3 - - { "gg1-5.3f", 0x01000, 0x3102fccd, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - - { "gg1-7b.2c", 0x01000, 0xd016686b, BRF_ESS | BRF_PRG }, // 5 Z80 #3 Program Code - - { "gg1-9.4l", 0x01000, 0x58b2f47c, BRF_GRA }, // 6 Characters - - { "gg1-11.4d", 0x01000, 0xad447c80, BRF_GRA }, // 7 Sprites - { "gg1-10.4f", 0x01000, 0xdd6f1afc, BRF_GRA }, // 8 - - { "prom-5.5n", 0x00020, 0x54603c6b, BRF_GRA }, // 9 PROMs - { "prom-4.2n", 0x00100, 0x59b6edab, BRF_GRA }, // 10 - { "prom-3.1c", 0x00100, 0x4a04bb6b, BRF_GRA }, // 11 - { "prom-1.1d", 0x00100, 0x7a2815b4, BRF_GRA }, // 12 - { "prom-2.5c", 0x00100, 0x77245b66, BRF_GRA }, // 13 -}; - -STD_ROM_PICK(Galagamk) -STD_ROM_FN(Galagamk) - -static struct BurnRomInfo GallagRomDesc[] = { - { "gallag.1", 0x01000, 0xa3a0f743, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "gallag.2", 0x01000, 0x5eda60a7, BRF_ESS | BRF_PRG }, // 1 - { "gallag.3", 0x01000, 0x753ce503, BRF_ESS | BRF_PRG }, // 2 - { "gallag.4", 0x01000, 0x83874442, BRF_ESS | BRF_PRG }, // 3 - - { "gallag.5", 0x01000, 0x3102fccd, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - - { "gallag.7", 0x01000, 0x8995088d, BRF_ESS | BRF_PRG }, // 5 Z80 #3 Program Code - - { "gallag.6", 0x01000, 0x001b70bc, BRF_ESS | BRF_PRG }, // 6 Z80 #4 Program Code - - { "gallag.8", 0x01000, 0x169a98a4, BRF_GRA }, // 7 Characters - - { "gallag.a", 0x01000, 0xad447c80, BRF_GRA }, // 8 Sprites - { "gallag.9", 0x01000, 0xdd6f1afc, BRF_GRA }, // 9 - - { "prom-5.5n", 0x00020, 0x54603c6b, BRF_GRA }, // 10 PROMs - { "prom-4.2n", 0x00100, 0x59b6edab, BRF_GRA }, // 11 - { "prom-3.1c", 0x00100, 0x4a04bb6b, BRF_GRA }, // 12 - { "prom-1.1d", 0x00100, 0x7a2815b4, BRF_GRA }, // 13 - { "prom-2.5c", 0x00100, 0x77245b66, BRF_GRA }, // 14 -}; - -STD_ROM_PICK(Gallag) -STD_ROM_FN(Gallag) - -static struct BurnRomInfo NebulbeeRomDesc[] = { - { "nebulbee.01", 0x01000, 0xf405f2c4, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "nebulbee.02", 0x01000, 0x31022b60, BRF_ESS | BRF_PRG }, // 1 - { "gg1_3.2m", 0x01000, 0x753ce503, BRF_ESS | BRF_PRG }, // 2 - { "nebulbee.04", 0x01000, 0xd76788a5, BRF_ESS | BRF_PRG }, // 3 - - { "gg1-5", 0x01000, 0x3102fccd, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - - { "gg1-7", 0x01000, 0x8995088d, BRF_ESS | BRF_PRG }, // 5 Z80 #3 Program Code - - { "nebulbee.07", 0x01000, 0x035e300c, BRF_ESS | BRF_PRG }, // 6 Z80 #4 Program Code - - { "gg1_9.4l", 0x01000, 0x58b2f47c, BRF_GRA }, // 7 Characters - - { "gg1_11.4d", 0x01000, 0xad447c80, BRF_GRA }, // 8 Sprites - { "gg1_10.4f", 0x01000, 0xdd6f1afc, BRF_GRA }, // 9 - - { "prom-5.5n", 0x00020, 0x54603c6b, BRF_GRA }, // 10 PROMs - { "2n.bin", 0x00100, 0xa547d33b, BRF_GRA }, // 11 - { "1c.bin", 0x00100, 0xb6f585fb, BRF_GRA }, // 12 - { "1d.bin", 0x00100, 0x86d92b24, BRF_GRA }, // 14 - { "5c.bin", 0x00100, 0x8bd565f6, BRF_GRA }, // 13 -}; - -STD_ROM_PICK(Nebulbee) -STD_ROM_FN(Nebulbee) - -// Dig Dug (rev 2) - -static struct BurnRomInfo digdugRomDesc[] = { - { "dd1a.1", 0x1000, 0xa80ec984, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "dd1a.2", 0x1000, 0x559f00bd, BRF_ESS | BRF_PRG }, // 1 - { "dd1a.3", 0x1000, 0x8cbc6fe1, BRF_ESS | BRF_PRG }, // 2 - { "dd1a.4", 0x1000, 0xd066f830, BRF_ESS | BRF_PRG }, // 3 - - { "dd1a.5", 0x1000, 0x6687933b, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - { "dd1a.6", 0x1000, 0x843d857f, BRF_ESS | BRF_PRG }, // 5 - - { "dd1.7", 0x1000, 0xa41bce72, BRF_ESS | BRF_PRG }, // 6 Z80 #3 Program Code - - { "dd1.9", 0x0800, 0xf14a6fe1, BRF_GRA }, // 7 Characters - - { "dd1.15", 0x1000, 0xe22957c8, BRF_GRA }, // 8 Sprites - { "dd1.14", 0x1000, 0x2829ec99, BRF_GRA }, // 9 - { "dd1.13", 0x1000, 0x458499e9, BRF_GRA }, // 10 - { "dd1.12", 0x1000, 0xc58252a0, BRF_GRA }, // 11 - - { "dd1.11", 0x1000, 0x7b383983, BRF_GRA }, // 12 Characters 8x8 2bpp - - { "dd1.10b", 0x1000, 0x2cf399c2, BRF_GRA }, // 13 Playfield Data - - { "136007.113", 0x0020, 0x4cb9da99, BRF_GRA }, // 14 Palette Prom - { "136007.111", 0x0100, 0x00c7c419, BRF_GRA }, // 15 Sprite Color Prom - { "136007.112", 0x0100, 0xe9b3e08e, BRF_GRA }, // 16 Character Color Prom - - { "136007.110", 0x0100, 0x7a2815b4, BRF_GRA }, // 17 Namco Sound Proms - { "136007.109", 0x0100, 0x77245b66, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(digdug) -STD_ROM_FN(digdug) - -static struct BurnSampleInfo GalagaSampleDesc[] = { -#if !defined (ROM_VERIFY) - { "bang", SAMPLE_NOLOOP }, - { "init", SAMPLE_NOLOOP }, -#endif - { "", 0 } -}; - -STD_SAMPLE_PICK(Galaga) -STD_SAMPLE_FN(Galaga) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom1 = Next; Next += 0x04000; - DrvZ80Rom2 = Next; Next += 0x04000; - DrvZ80Rom3 = Next; Next += 0x04000; - DrvPromPalette = Next; Next += 0x00020; - DrvPromCharLookup = Next; Next += 0x00100; - DrvPromSpriteLookup = Next; Next += 0x00100; - NamcoSoundProm = Next; Next += 0x00200; - - RamStart = Next; - - DrvVideoRam = Next; Next += 0x00800; - DrvSharedRam1 = Next; Next += 0x00400; - DrvSharedRam1 = Next; Next += 0x04000; - DrvSharedRam2 = Next; Next += 0x00400; - DrvSharedRam3 = Next; Next += 0x00400; - - RamEnd = Next; - - DrvDigdugChars = Next; Next += 0x00180 * 8 * 8; - DrvGfx4 = Next; Next += 0x01000; - DrvChars = Next; Next += 0x01100 * 8 * 8; - DrvSprites = Next; Next += 0x01100 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x300 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static UINT8 earom_read(UINT16 /*address*/) -{ - return (earom_data); -} - -static void earom_write(UINT16 offset, UINT8 data) -{ - earom_offset = offset; - earom_data = data; -} - -static void earom_ctrl_write(UINT16 /*offset*/, UINT8 data) -{ - /* - 0x01 = clock - 0x02 = set data latch? - writes only (not always) - 0x04 = write mode? - writes only - 0x08 = set addr latch? - */ - if (data & 0x01) - earom_data = earom[earom_offset]; - if ((data & 0x0c) == 0x0c) - earom[earom_offset] = earom_data; -} - -static INT32 DrvDoReset() -{ - for (INT32 i = 0; i < 3; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - BurnSampleReset(); - NamcoSoundReset(); - - DrvCPU1FireIRQ = 0; - DrvCPU2FireIRQ = 0; - DrvCPU3FireIRQ = 0; - DrvCPU2Halt = 0; - DrvCPU3Halt = 0; - DrvFlipScreen = 0; - for (INT32 i = 0; i < 6; i++) { - DrvStarControl[i] = 0; - } - DrvStarScrollX = 0; - DrvStarScrollY = 0; - - IOChipCustomCommand = 0; - IOChipCPU1FireIRQ = 0; - IOChipMode = 0; - IOChipCredits = 0; - IOChipCoinPerCredit = 0; - IOChipCreditPerCoin = 0; - for (INT32 i = 0; i < 16; i++) { - IOChipCustom[i] = 0; - } - PrevInValue = 0xff; - - Fetch = 0; - FetchMode = 0; - memset(&Config1, 0, sizeof(Config1)); - memset(&Config2, 0, sizeof(Config2)); - memset(&Config3, 0, sizeof(Config3)); - playfield = 0; - alphacolor = 0; - playenable = 0; - playcolor = 0; - - earom_offset = 0; - earom_data = 0; - - HiscoreReset(); - - return 0; -} - -void __fastcall digdug_pf_latch_w(UINT16 offset, UINT8 data) -{ - switch (offset) - { - case 0: - playfield = (playfield & ~1) | (data & 1); - break; - - case 1: - playfield = (playfield & ~2) | ((data << 1) & 2); - break; - - case 2: - alphacolor = data & 1; - break; - - case 3: - playenable = data & 1; - break; - - case 4: - playcolor = (playcolor & ~1) | (data & 1); - break; - - case 5: - playcolor = (playcolor & ~2) | ((data << 1) & 2); - break; - } -} - - - -static void Namco54XXWrite(INT32 Data) -{ - if (Fetch) { - switch (FetchMode) { - default: - case 1: - Config1[4 - (Fetch--)] = Data; - break; - - case 2: - Config2[4 - (Fetch--)] = Data; - break; - - case 3: - Config3[5 - (Fetch--)] = Data; - break; - } - } else { - switch (Data & 0xf0) { - case 0x00: // nop - break; - - case 0x10: // output sound on pins 4-7 only - if (memcmp(Config1,"\x40\x00\x02\xdf",4) == 0) - // bosco - // galaga - // xevious - BurnSamplePlay(0); -// else if (memcmp(Config1,"\x10\x00\x80\xff",4) == 0) - // xevious -// sample_start(0, 1, 0); -// else if (memcmp(Config1,"\x80\x80\x01\xff",4) == 0) - // xevious -// sample_start(0, 2, 0); - break; - - case 0x20: // output sound on pins 8-11 only -// if (memcmp(Config2,"\x40\x40\x01\xff",4) == 0) - // xevious -// sample_start(1, 3, 0); -// BurnSamplePlay(1); - /*else*/ if (memcmp(Config2,"\x30\x30\x03\xdf",4) == 0) - // bosco - // galaga - BurnSamplePlay(1); -// else if (memcmp(Config2,"\x60\x30\x03\x66",4) == 0) - // polepos -// sample_start( 0, 0, 0 ); - break; - - case 0x30: - Fetch = 4; - FetchMode = 1; - break; - - case 0x40: - Fetch = 4; - FetchMode = 2; - break; - - case 0x50: // output sound on pins 17-20 only -// if (memcmp(Config3,"\x08\x04\x21\x00\xf1",5) == 0) - // bosco -// sample_start(2, 2, 0); - break; - - case 0x60: - Fetch = 5; - FetchMode = 3; - break; - - case 0x70: - // polepos - /* 0x7n = Screech sound. n = pitch (if 0 then no sound) */ - /* followed by 0x60 command? */ - if (( Data & 0x0f ) == 0) { -// if (sample_playing(1)) -// sample_stop(1); - } else { -// INT32 freq = (INT32)( ( 44100.0f / 10.0f ) * (float)(Data & 0x0f) ); - -// if (!sample_playing(1)) -// sample_start(1, 1, 1); -// sample_set_freq(1, freq); - } - break; - } - } -} - -static UINT8 __fastcall GalagaZ80ProgRead(UINT16 a) -{ - if (a >= 0xb800 && a <= 0xb83f && digdugmode) { // EAROM Read - return earom_read(a - 0xb800); - } - - switch (a) { - case 0x6800: - case 0x6801: - case 0x6802: - case 0x6803: - case 0x6804: - case 0x6805: - case 0x6806: - case 0x6807: { - INT32 Offset = a - 0x6800; - INT32 Bit0 = (DrvDip[2] >> Offset) & 0x01; - INT32 Bit1 = (DrvDip[1] >> Offset) & 0x01; - - return Bit0 | (Bit1 << 1); - } - - case 0x7000: - case 0x7001: - case 0x7002: - case 0x7003: - case 0x7004: - case 0x7005: - case 0x7006: - case 0x7007: - case 0x7008: - case 0x7009: - case 0x700a: - case 0x700b: - case 0x700c: - case 0x700d: - case 0x700e: - case 0x700f: { - INT32 Offset = a - 0x7000; - - switch (IOChipCustomCommand) { - case 0xd2: {// digdug dips - if (digdugmode && ((Offset == 0) || (Offset == 1))) - return DrvDip[Offset]; - break; - } - case 0x71: - case 0xb1: { - if (IOChipCustomCommand == 0xb1 && digdugmode) { - if (Offset <= 2) // status - return 0; - else - return 0xff; - } - if (Offset == 0) { - if (IOChipMode) { - return DrvInput[0]; - } else { - UINT8 In; - static UINT8 CoinInserted; - - In = DrvInput[0]; - if (In != PrevInValue) { - if (IOChipCoinPerCredit > 0) { - if (((((In & 0x70) != 0x70) && !digdugmode) || (((In & 0x01) == 0) && digdugmode)) && (IOChipCredits < 99)) { - CoinInserted++; - if (CoinInserted >= IOChipCoinPerCredit) { - IOChipCredits += IOChipCreditPerCoin; - CoinInserted = 0; - } - } - } else { - IOChipCredits = 2; - } - - if (((In & 0x04) == 0 && !digdugmode) || ((In & 0x10) == 0 && digdugmode)) { - if (IOChipCredits >= 1) IOChipCredits--; - } - - if (((In & 0x08) == 0 && !digdugmode) || ((In & 0x20) == 0 && digdugmode)) { - if (IOChipCredits >= 2) IOChipCredits -= 2; - } - } - - PrevInValue = In; - - return (IOChipCredits / 10) * 16 + IOChipCredits % 10; - } - } - - if (Offset == 1 || Offset == 2) { - INT32 jp = DrvInput[Offset]; - - if (IOChipMode == 0 && digdugmode) { - /* check directions, according to the following 8-position rule */ - /* 0 */ - /* 7 1 */ - /* 6 8 2 */ - /* 5 3 */ - /* 4 */ - if ((jp & 0x01) == 0) /* up */ - jp = (jp & ~0x0f) | 0x00; - else if ((jp & 0x02) == 0) /* right */ - jp = (jp & ~0x0f) | 0x02; - else if ((jp & 0x04) == 0) /* down */ - jp = (jp & ~0x0f) | 0x04; - else if ((jp & 0x08) == 0) /* left */ - jp = (jp & ~0x0f) | 0x06; - else - jp = (jp & ~0x0f) | 0x08; - } - - INT32 joy = jp & 0x0f; - INT32 in, toggle; - - in = ~((jp & 0xf0) >> 4); - - toggle = in ^ DrvLastButtons; - DrvLastButtons = (DrvLastButtons & 2) | (in & 1); - - /* fire */ - joy |= ((toggle & in & 0x01)^1) << 4; - joy |= ((in & 0x01)^1) << 5; - - return joy; - } - } - } - - return 0xff; - } - - case 0x7100: { - return IOChipCustomCommand; - } - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - case 0xa004: - case 0xa005: - case 0xa006: break; // (ignore) spurious reads when playfield latch written to - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #%i Read %04x\n"), ZetGetActive(), a); - } - } - - return 0; -} - -static void __fastcall GalagaZ80ProgWrite(UINT16 a, UINT8 d) -{ - if (a >= 0x6800 && a <= 0x681f) { - NamcoSoundWrite(a - 0x6800, d); - return; - } - - if (a >= 0xb800 && a <= 0xb83f && digdugmode) { // EAROM Write - earom_write(a - 0xb800, d); - return; - } - -// bprintf(PRINT_NORMAL, _T("54XX z80 #%i Write %X, %X nbs %X\n"), ZetGetActive(), a, d, nBurnSoundLen); - - switch (a) { - case 0xb840: - if (digdugmode) - earom_ctrl_write(0xb840, d); - return; - - case 0x6820: { - DrvCPU1FireIRQ = d & 0x01; - if (!DrvCPU1FireIRQ) { - INT32 nActive = ZetGetActive(); - ZetClose(); - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - ZetOpen(nActive); - } - return; - } - - case 0x6821: { - DrvCPU2FireIRQ = d & 0x01; - if (!DrvCPU2FireIRQ) { - INT32 nActive = ZetGetActive(); - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - ZetOpen(nActive); - } - return; - } - - case 0x6822: { - DrvCPU3FireIRQ = !(d & 0x01); - return; - } - - case 0x6823: { - if (!(d & 0x01)) { - INT32 nActive = ZetGetActive(); - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(2); - ZetReset(); - ZetClose(); - ZetOpen(nActive); - DrvCPU2Halt = 1; - DrvCPU3Halt = 1; - return; - } else { - DrvCPU2Halt = 0; - DrvCPU3Halt = 0; - } - } - - case 0x6830: { - // watchdog write - return; - } - - case 0x7000: - case 0x7001: - case 0x7002: - case 0x7003: - case 0x7004: - case 0x7005: - case 0x7006: - case 0x7007: - case 0x7008: - case 0x7009: - case 0x700a: - case 0x700b: - case 0x700c: - case 0x700d: - case 0x700e: - case 0x700f: { - INT32 Offset = a - 0x7000; - IOChipCustom[Offset] = d; - Namco54XXWrite(d); - - switch (IOChipCustomCommand) { - case 0xe1: { - if (Offset == 7 && !digdugmode) { // galaga - IOChipCoinPerCredit = IOChipCustom[1]; - IOChipCreditPerCoin = IOChipCustom[2]; - } - break; - } - case 0xc1: { - if (Offset == 8 && digdugmode) { // digdug - IOChipCoinPerCredit = IOChipCustom[2] & 0x0f; - IOChipCreditPerCoin = IOChipCustom[3] & 0x0f; - } - break; - } - } - - return; - } - - case 0x7100: { - IOChipCustomCommand = d; - IOChipCPU1FireIRQ = 1; - - switch (IOChipCustomCommand) { - case 0x10: { - IOChipCPU1FireIRQ = 0; - return; - } - - case 0xa1: { - IOChipMode = 1; - return; - } - case 0xb1: { - IOChipCredits = 0; - return; - } - case 0xc1: - case 0xe1: { - IOChipCredits = 0; - IOChipMode = 0; - return; - } - } - - return; - } - - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - case 0xa004: - case 0xa005: - case 0xa006: { - if (a != 0xa006) - DrvStarControl[a - 0xa000] = d & 0x01; - digdug_pf_latch_w(a - 0xa000, d); - return; - } - - case 0xa007: { - DrvFlipScreen = d & 0x01; - return; - } - - default: { - //bprintf(PRINT_NORMAL, _T("Z80 #%i Write %04x, %02x\n"), ZetGetActive(), a, d); - } - } -} - -static INT32 CharPlaneOffsets[2] = { 0, 4 }; -static INT32 CharXOffsets[8] = { 64, 65, 66, 67, 0, 1, 2, 3 }; -static INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 SpritePlaneOffsets[2] = { 0, 4 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 64, 65, 66, 67, 128, 129, 130, 131, 192, 193, 194, 195 }; -static INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 256, 264, 272, 280, 288, 296, 304, 312 }; - -static INT32 DigdugCharPlaneOffsets[2] = { 0 }; -static INT32 DigdugCharXOffsets[8] = { STEP8(7,-1) }; -static INT32 DigdugCharYOffsets[8] = { STEP8(0,8) }; - -static void MachineInit() -{ - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(GalagaZ80ProgRead); - ZetSetWriteHandler(GalagaZ80ProgWrite); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80Rom1); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80Rom1); - ZetMapArea(0x8000, 0x87ff, 0, DrvVideoRam); - ZetMapArea(0x8000, 0x87ff, 1, DrvVideoRam); - ZetMapArea(0x8000, 0x87ff, 2, DrvVideoRam); - ZetMapArea(0x8800, 0x8bff, 0, DrvSharedRam1); - ZetMapArea(0x8800, 0x8bff, 1, DrvSharedRam1); - ZetMapArea(0x8800, 0x8bff, 2, DrvSharedRam1); - ZetMapArea(0x9000, 0x93ff, 0, DrvSharedRam2); - ZetMapArea(0x9000, 0x93ff, 1, DrvSharedRam2); - ZetMapArea(0x9000, 0x93ff, 2, DrvSharedRam2); - ZetMapArea(0x9800, 0x9bff, 0, DrvSharedRam3); - ZetMapArea(0x9800, 0x9bff, 1, DrvSharedRam3); - ZetMapArea(0x9800, 0x9bff, 2, DrvSharedRam3); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(GalagaZ80ProgRead); - ZetSetWriteHandler(GalagaZ80ProgWrite); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80Rom2); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80Rom2); - ZetMapArea(0x8000, 0x87ff, 0, DrvVideoRam); - ZetMapArea(0x8000, 0x87ff, 1, DrvVideoRam); - ZetMapArea(0x8000, 0x87ff, 2, DrvVideoRam); - ZetMapArea(0x8800, 0x8bff, 0, DrvSharedRam1); - ZetMapArea(0x8800, 0x8bff, 1, DrvSharedRam1); - ZetMapArea(0x8800, 0x8bff, 2, DrvSharedRam1); - ZetMapArea(0x9000, 0x93ff, 0, DrvSharedRam2); - ZetMapArea(0x9000, 0x93ff, 1, DrvSharedRam2); - ZetMapArea(0x9000, 0x93ff, 2, DrvSharedRam2); - ZetMapArea(0x9800, 0x9bff, 0, DrvSharedRam3); - ZetMapArea(0x9800, 0x9bff, 1, DrvSharedRam3); - ZetMapArea(0x9800, 0x9bff, 2, DrvSharedRam3); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetSetReadHandler(GalagaZ80ProgRead); - ZetSetWriteHandler(GalagaZ80ProgWrite); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80Rom3); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80Rom3); - ZetMapArea(0x8000, 0x87ff, 0, DrvVideoRam); - ZetMapArea(0x8000, 0x87ff, 1, DrvVideoRam); - ZetMapArea(0x8000, 0x87ff, 2, DrvVideoRam); - ZetMapArea(0x8800, 0x8bff, 0, DrvSharedRam1); - ZetMapArea(0x8800, 0x8bff, 1, DrvSharedRam1); - ZetMapArea(0x8800, 0x8bff, 2, DrvSharedRam1); - ZetMapArea(0x9000, 0x93ff, 0, DrvSharedRam2); - ZetMapArea(0x9000, 0x93ff, 1, DrvSharedRam2); - ZetMapArea(0x9000, 0x93ff, 2, DrvSharedRam2); - ZetMapArea(0x9800, 0x9bff, 0, DrvSharedRam3); - ZetMapArea(0x9800, 0x9bff, 1, DrvSharedRam3); - ZetMapArea(0x9800, 0x9bff, 2, DrvSharedRam3); - ZetClose(); - - NamcoSoundInit(18432000 / 6 / 32, 3, 0); - NacmoSoundSetAllRoutes(0.90 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.25, BURN_SND_ROUTE_BOTH); - bHasSamples = BurnSampleGetStatus(0) != -1; - - GenericTilesInit(); - - memset(&earom, 0, sizeof(earom)); // don't put this in DrvDoReset() - - // Reset the driver - DrvDoReset(); -} - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x02000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x01000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x02000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x03000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Roms - nRet = BurnLoadRom(DrvZ80Rom3 + 0x00000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x02000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x01000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x80, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromPalette, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromCharLookup, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpriteLookup, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(NamcoSoundProm, 12, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - MachineInit(); - - return 0; -} - -static INT32 GallagInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x02000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x01000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x02000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x03000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Roms - nRet = BurnLoadRom(DrvZ80Rom3 + 0x00000, 5, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x02000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x01000, 9, 1); if (nRet != 0) return 1; - GfxDecode(0x80, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromPalette, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromCharLookup, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpriteLookup, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(NamcoSoundProm, 13, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - MachineInit(); - - return 0; -} - -static INT32 DrvDigdugInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x10000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x01000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x02000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x03000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom2 + 0x01000, 5, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Roms - nRet = BurnLoadRom(DrvZ80Rom3 + 0x00000, 6, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0, 0x10000); - // Load and decode the chars 8x8 (in digdug) - nRet = BurnLoadRom(DrvTempRom, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x80, 1, 8, 8, DigdugCharPlaneOffsets, DigdugCharXOffsets, DigdugCharYOffsets, 0x40, DrvTempRom, DrvDigdugChars); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x01000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x02000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x03000, 11, 1); if (nRet != 0) return 1; - GfxDecode(0x80 + 0x80, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - memset(DrvTempRom, 0, 0x10000); - // Load and decode the chars 2bpp - nRet = BurnLoadRom(DrvTempRom, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load gfx4 - the playfield data - nRet = BurnLoadRom(DrvGfx4, 13, 1); if (nRet != 0) return 1; - - // Load the PROMs - nRet = BurnLoadRom(DrvPromPalette, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromSpriteLookup, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromCharLookup, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(NamcoSoundProm, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(NamcoSoundProm + 0x0100, 18, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - digdugmode = 1; - - MachineInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - NamcoSoundExit(); - BurnSampleExit(); - ZetExit(); - - BurnFree(Mem); - - DrvCPU1FireIRQ = 0; - DrvCPU2FireIRQ = 0; - DrvCPU3FireIRQ = 0; - DrvCPU2Halt = 0; - DrvCPU3Halt = 0; - DrvFlipScreen = 0; - for (INT32 i = 0; i < 6; i++) { - DrvStarControl[i] = 0; - } - DrvStarScrollX = 0; - DrvStarScrollY = 0; - - IOChipCustomCommand = 0; - IOChipCPU1FireIRQ = 0; - IOChipMode = 0; - IOChipCredits = 0; - IOChipCoinPerCredit = 0; - IOChipCreditPerCoin = 0; - for (INT32 i = 0; i < 16; i++) { - IOChipCustom[i] = 0; - } - digdugmode = 0; - - return 0; -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT32 Palette[96]; - - for (i = 0; i < 32; i++) { - INT32 bit0, bit1, bit2, r, g, b; - - bit0 = (DrvPromPalette[i] >> 0) & 0x01; - bit1 = (DrvPromPalette[i] >> 1) & 0x01; - bit2 = (DrvPromPalette[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - bit0 = (DrvPromPalette[i] >> 3) & 0x01; - bit1 = (DrvPromPalette[i] >> 4) & 0x01; - bit2 = (DrvPromPalette[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - bit0 = 0; - bit1 = (DrvPromPalette[i] >> 6) & 0x01; - bit2 = (DrvPromPalette[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - Palette[i] = BurnHighCol(r, g, b, 0); - } - - for (i = 0; i < 64; i++) { - INT32 bits, r, g, b; - static const INT32 map[4] = { 0x00, 0x47, 0x97, 0xde }; - - bits = (i >> 0) & 0x03; - r = map[bits]; - bits = (i >> 2) & 0x03; - g = map[bits]; - bits = (i >> 4) & 0x03; - b = map[bits]; - - Palette[32 + i] = BurnHighCol(r, g, b, 0); - } - - for (i = 0; i < 256; i++) { - DrvPalette[i] = Palette[((DrvPromCharLookup[i]) & 0x0f) + 0x10]; - } - - for (i = 0; i < 256; i++) { - DrvPalette[256 + i] = Palette[DrvPromSpriteLookup[i] & 0x0f]; - } - - for (i = 0; i < 64; i++) { - DrvPalette[512 + i] = Palette[32 + i]; - } -} - -static void DrvCalcPaletteDigdug() -{ - INT32 i; - UINT32 Palette[96]; - - for (i = 0; i < 32; i++) { - INT32 bit0, bit1, bit2, r, g, b; - - bit0 = (DrvPromPalette[i] >> 0) & 0x01; - bit1 = (DrvPromPalette[i] >> 1) & 0x01; - bit2 = (DrvPromPalette[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - bit0 = (DrvPromPalette[i] >> 3) & 0x01; - bit1 = (DrvPromPalette[i] >> 4) & 0x01; - bit2 = (DrvPromPalette[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - bit0 = 0; - bit1 = (DrvPromPalette[i] >> 6) & 0x01; - bit2 = (DrvPromPalette[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - Palette[i] = BurnHighCol(r, g, b, 0); - } - - /* characters - direct mapping */ - for (i = 0; i < 16; i++) - { - DrvPalette[i*2+0] = Palette[0]; - DrvPalette[i*2+1] = Palette[i]; - } - - /* sprites */ - for (i = 0; i < 0x100; i++) { - DrvPalette[0x200+i] = Palette[(DrvPromSpriteLookup[i] & 0x0f) + 0x10]; - } - - /* bg_select */ - for (i = 0; i < 0x100; i++) { - DrvPalette[0x100 + i] = Palette[DrvPromCharLookup[i] & 0x0f]; - } -} - -struct Star { - UINT16 x, y; - UINT8 Colour, Set; -}; - -const struct Star StarSeedTab[252] = { - // set 0 - {0x0085, 0x0006, 0x35, 0x00}, - {0x008F, 0x0008, 0x30, 0x00}, - {0x00E5, 0x001B, 0x07, 0x00}, - {0x0022, 0x001C, 0x31, 0x00}, - {0x00E5, 0x0025, 0x1D, 0x00}, - {0x0015, 0x0026, 0x29, 0x00}, - {0x0080, 0x002D, 0x3B, 0x00}, - {0x0097, 0x002E, 0x1C, 0x00}, - {0x00BA, 0x003B, 0x05, 0x00}, - {0x0036, 0x003D, 0x36, 0x00}, - {0x0057, 0x0044, 0x09, 0x00}, - {0x00CF, 0x0044, 0x3D, 0x00}, - {0x0061, 0x004E, 0x27, 0x00}, - {0x0087, 0x0064, 0x1A, 0x00}, - {0x00D6, 0x0064, 0x17, 0x00}, - {0x000B, 0x006C, 0x3C, 0x00}, - {0x0006, 0x006D, 0x24, 0x00}, - {0x0018, 0x006E, 0x3A, 0x00}, - {0x00A9, 0x0079, 0x23, 0x00}, - {0x008A, 0x007B, 0x11, 0x00}, - {0x00D6, 0x0080, 0x0C, 0x00}, - {0x0067, 0x0082, 0x3F, 0x00}, - {0x0039, 0x0083, 0x38, 0x00}, - {0x0072, 0x0083, 0x14, 0x00}, - {0x00EC, 0x0084, 0x16, 0x00}, - {0x008E, 0x0085, 0x10, 0x00}, - {0x0020, 0x0088, 0x25, 0x00}, - {0x0095, 0x008A, 0x0F, 0x00}, - {0x000E, 0x008D, 0x00, 0x00}, - {0x0006, 0x0091, 0x2E, 0x00}, - {0x0007, 0x0094, 0x0D, 0x00}, - {0x00AE, 0x0097, 0x0B, 0x00}, - {0x0000, 0x0098, 0x2D, 0x00}, - {0x0086, 0x009B, 0x01, 0x00}, - {0x0058, 0x00A1, 0x34, 0x00}, - {0x00FE, 0x00A1, 0x3E, 0x00}, - {0x00A2, 0x00A8, 0x1F, 0x00}, - {0x0041, 0x00AA, 0x0A, 0x00}, - {0x003F, 0x00AC, 0x32, 0x00}, - {0x00DE, 0x00AC, 0x03, 0x00}, - {0x00D4, 0x00B9, 0x26, 0x00}, - {0x006D, 0x00BB, 0x1B, 0x00}, - {0x0062, 0x00BD, 0x39, 0x00}, - {0x00C9, 0x00BE, 0x18, 0x00}, - {0x006C, 0x00C1, 0x04, 0x00}, - {0x0059, 0x00C3, 0x21, 0x00}, - {0x0060, 0x00CC, 0x0E, 0x00}, - {0x0091, 0x00CC, 0x12, 0x00}, - {0x003F, 0x00CF, 0x06, 0x00}, - {0x00F7, 0x00CF, 0x22, 0x00}, - {0x0044, 0x00D0, 0x33, 0x00}, - {0x0034, 0x00D2, 0x08, 0x00}, - {0x00D3, 0x00D9, 0x20, 0x00}, - {0x0071, 0x00DD, 0x37, 0x00}, - {0x0073, 0x00E1, 0x2C, 0x00}, - {0x00B9, 0x00E3, 0x2F, 0x00}, - {0x00A9, 0x00E4, 0x13, 0x00}, - {0x00D3, 0x00E7, 0x19, 0x00}, - {0x0037, 0x00ED, 0x02, 0x00}, - {0x00BD, 0x00F4, 0x15, 0x00}, - {0x000F, 0x00F6, 0x28, 0x00}, - {0x004F, 0x00F7, 0x2B, 0x00}, - {0x00FB, 0x00FF, 0x2A, 0x00}, - - // set 1 - {0x00FE, 0x0004, 0x3D, 0x01}, - {0x00C4, 0x0006, 0x10, 0x01}, - {0x001E, 0x0007, 0x2D, 0x01}, - {0x0083, 0x000B, 0x1F, 0x01}, - {0x002E, 0x000D, 0x3C, 0x01}, - {0x001F, 0x000E, 0x00, 0x01}, - {0x00D8, 0x000E, 0x2C, 0x01}, - {0x0003, 0x000F, 0x17, 0x01}, - {0x0095, 0x0011, 0x3F, 0x01}, - {0x006A, 0x0017, 0x35, 0x01}, - {0x00CC, 0x0017, 0x02, 0x01}, - {0x0000, 0x0018, 0x32, 0x01}, - {0x0092, 0x001D, 0x36, 0x01}, - {0x00E3, 0x0021, 0x04, 0x01}, - {0x002F, 0x002D, 0x37, 0x01}, - {0x00F0, 0x002F, 0x0C, 0x01}, - {0x009B, 0x003E, 0x06, 0x01}, - {0x00A4, 0x004C, 0x07, 0x01}, - {0x00EA, 0x004D, 0x13, 0x01}, - {0x0084, 0x004E, 0x21, 0x01}, - {0x0033, 0x0052, 0x0F, 0x01}, - {0x0070, 0x0053, 0x0E, 0x01}, - {0x0006, 0x0059, 0x08, 0x01}, - {0x0081, 0x0060, 0x28, 0x01}, - {0x0037, 0x0061, 0x29, 0x01}, - {0x008F, 0x0067, 0x2F, 0x01}, - {0x001B, 0x006A, 0x1D, 0x01}, - {0x00BF, 0x007C, 0x12, 0x01}, - {0x0051, 0x007F, 0x31, 0x01}, - {0x0061, 0x0086, 0x25, 0x01}, - {0x006A, 0x008F, 0x0D, 0x01}, - {0x006A, 0x0091, 0x19, 0x01}, - {0x0090, 0x0092, 0x05, 0x01}, - {0x003B, 0x0096, 0x24, 0x01}, - {0x008C, 0x0097, 0x0A, 0x01}, - {0x0006, 0x0099, 0x03, 0x01}, - {0x0038, 0x0099, 0x38, 0x01}, - {0x00A8, 0x0099, 0x18, 0x01}, - {0x0076, 0x00A6, 0x20, 0x01}, - {0x00AD, 0x00A6, 0x1C, 0x01}, - {0x00EC, 0x00A6, 0x1E, 0x01}, - {0x0086, 0x00AC, 0x15, 0x01}, - {0x0078, 0x00AF, 0x3E, 0x01}, - {0x007B, 0x00B3, 0x09, 0x01}, - {0x0027, 0x00B8, 0x39, 0x01}, - {0x0088, 0x00C2, 0x23, 0x01}, - {0x0044, 0x00C3, 0x3A, 0x01}, - {0x00CF, 0x00C5, 0x34, 0x01}, - {0x0035, 0x00C9, 0x30, 0x01}, - {0x006E, 0x00D1, 0x3B, 0x01}, - {0x00D6, 0x00D7, 0x16, 0x01}, - {0x003A, 0x00D9, 0x2B, 0x01}, - {0x00AB, 0x00E0, 0x11, 0x01}, - {0x00E0, 0x00E2, 0x1B, 0x01}, - {0x006F, 0x00E6, 0x0B, 0x01}, - {0x00B8, 0x00E8, 0x14, 0x01}, - {0x00D9, 0x00E8, 0x1A, 0x01}, - {0x00F9, 0x00E8, 0x22, 0x01}, - {0x0004, 0x00F1, 0x2E, 0x01}, - {0x0049, 0x00F8, 0x26, 0x01}, - {0x0010, 0x00F9, 0x01, 0x01}, - {0x0039, 0x00FB, 0x33, 0x01}, - {0x0028, 0x00FC, 0x27, 0x01}, - - // set 2 - {0x00FA, 0x0006, 0x19, 0x02}, - {0x00E4, 0x0007, 0x2D, 0x02}, - {0x0072, 0x000A, 0x03, 0x02}, - {0x0084, 0x001B, 0x00, 0x02}, - {0x00BA, 0x001D, 0x29, 0x02}, - {0x00E3, 0x0022, 0x04, 0x02}, - {0x00D1, 0x0026, 0x2A, 0x02}, - {0x0089, 0x0032, 0x30, 0x02}, - {0x005B, 0x0036, 0x27, 0x02}, - {0x0084, 0x003A, 0x36, 0x02}, - {0x0053, 0x003F, 0x0D, 0x02}, - {0x0008, 0x0040, 0x1D, 0x02}, - {0x0055, 0x0040, 0x1A, 0x02}, - {0x00AA, 0x0041, 0x31, 0x02}, - {0x00FB, 0x0041, 0x2B, 0x02}, - {0x00BC, 0x0046, 0x16, 0x02}, - {0x0093, 0x0052, 0x39, 0x02}, - {0x00B9, 0x0057, 0x10, 0x02}, - {0x0054, 0x0059, 0x28, 0x02}, - {0x00E6, 0x005A, 0x01, 0x02}, - {0x00A7, 0x005D, 0x1B, 0x02}, - {0x002D, 0x005E, 0x35, 0x02}, - {0x0014, 0x0062, 0x21, 0x02}, - {0x0069, 0x006D, 0x1F, 0x02}, - {0x00CE, 0x006F, 0x0B, 0x02}, - {0x00DF, 0x0075, 0x2F, 0x02}, - {0x00CB, 0x0077, 0x12, 0x02}, - {0x004E, 0x007C, 0x23, 0x02}, - {0x004A, 0x0084, 0x0F, 0x02}, - {0x0012, 0x0086, 0x25, 0x02}, - {0x0068, 0x008C, 0x32, 0x02}, - {0x0003, 0x0095, 0x20, 0x02}, - {0x000A, 0x009C, 0x17, 0x02}, - {0x005B, 0x00A3, 0x08, 0x02}, - {0x005F, 0x00A4, 0x3E, 0x02}, - {0x0072, 0x00A4, 0x2E, 0x02}, - {0x00CC, 0x00A6, 0x06, 0x02}, - {0x008A, 0x00AB, 0x0C, 0x02}, - {0x00E0, 0x00AD, 0x26, 0x02}, - {0x00F3, 0x00AF, 0x0A, 0x02}, - {0x0075, 0x00B4, 0x13, 0x02}, - {0x0068, 0x00B7, 0x11, 0x02}, - {0x006D, 0x00C2, 0x2C, 0x02}, - {0x0076, 0x00C3, 0x14, 0x02}, - {0x00CF, 0x00C4, 0x1E, 0x02}, - {0x0004, 0x00C5, 0x1C, 0x02}, - {0x0013, 0x00C6, 0x3F, 0x02}, - {0x00B9, 0x00C7, 0x3C, 0x02}, - {0x0005, 0x00D7, 0x34, 0x02}, - {0x0095, 0x00D7, 0x3A, 0x02}, - {0x00FC, 0x00D8, 0x02, 0x02}, - {0x00E7, 0x00DC, 0x09, 0x02}, - {0x001D, 0x00E1, 0x05, 0x02}, - {0x0005, 0x00E6, 0x33, 0x02}, - {0x001C, 0x00E9, 0x3B, 0x02}, - {0x00A2, 0x00ED, 0x37, 0x02}, - {0x0028, 0x00EE, 0x07, 0x02}, - {0x00DD, 0x00EF, 0x18, 0x02}, - {0x006D, 0x00F0, 0x38, 0x02}, - {0x00A1, 0x00F2, 0x0E, 0x02}, - {0x0074, 0x00F7, 0x3D, 0x02}, - {0x0069, 0x00F9, 0x22, 0x02}, - {0x003F, 0x00FF, 0x24, 0x02}, - - // set 3 - {0x0071, 0x0010, 0x34, 0x03}, - {0x00AF, 0x0011, 0x23, 0x03}, - {0x00A0, 0x0014, 0x26, 0x03}, - {0x0002, 0x0017, 0x02, 0x03}, - {0x004B, 0x0019, 0x31, 0x03}, - {0x0093, 0x001C, 0x0E, 0x03}, - {0x001B, 0x001E, 0x25, 0x03}, - {0x0032, 0x0020, 0x2E, 0x03}, - {0x00EE, 0x0020, 0x3A, 0x03}, - {0x0079, 0x0022, 0x2F, 0x03}, - {0x006C, 0x0023, 0x17, 0x03}, - {0x00BC, 0x0025, 0x11, 0x03}, - {0x0041, 0x0029, 0x30, 0x03}, - {0x001C, 0x002E, 0x32, 0x03}, - {0x00B9, 0x0031, 0x01, 0x03}, - {0x0083, 0x0032, 0x05, 0x03}, - {0x0095, 0x003A, 0x12, 0x03}, - {0x000D, 0x003F, 0x07, 0x03}, - {0x0020, 0x0041, 0x33, 0x03}, - {0x0092, 0x0045, 0x2C, 0x03}, - {0x00D4, 0x0047, 0x08, 0x03}, - {0x00A1, 0x004B, 0x2D, 0x03}, - {0x00D2, 0x004B, 0x3B, 0x03}, - {0x00D6, 0x0052, 0x24, 0x03}, - {0x009A, 0x005F, 0x1C, 0x03}, - {0x0016, 0x0060, 0x3D, 0x03}, - {0x001A, 0x0063, 0x1F, 0x03}, - {0x00CD, 0x0066, 0x28, 0x03}, - {0x00FF, 0x0067, 0x10, 0x03}, - {0x0035, 0x0069, 0x20, 0x03}, - {0x008F, 0x006C, 0x04, 0x03}, - {0x00CA, 0x006C, 0x2A, 0x03}, - {0x005A, 0x0074, 0x09, 0x03}, - {0x0060, 0x0078, 0x38, 0x03}, - {0x0072, 0x0079, 0x1E, 0x03}, - {0x0037, 0x007F, 0x29, 0x03}, - {0x0012, 0x0080, 0x14, 0x03}, - {0x0029, 0x0082, 0x2B, 0x03}, - {0x0084, 0x0098, 0x36, 0x03}, - {0x0032, 0x0099, 0x37, 0x03}, - {0x00BB, 0x00A0, 0x19, 0x03}, - {0x003E, 0x00A3, 0x3E, 0x03}, - {0x004A, 0x00A6, 0x1A, 0x03}, - {0x0029, 0x00A7, 0x21, 0x03}, - {0x009D, 0x00B7, 0x22, 0x03}, - {0x006C, 0x00B9, 0x15, 0x03}, - {0x000C, 0x00C0, 0x0A, 0x03}, - {0x00C2, 0x00C3, 0x0F, 0x03}, - {0x002F, 0x00C9, 0x0D, 0x03}, - {0x00D2, 0x00CE, 0x16, 0x03}, - {0x00F3, 0x00CE, 0x0B, 0x03}, - {0x0075, 0x00CF, 0x27, 0x03}, - {0x001A, 0x00D5, 0x35, 0x03}, - {0x0026, 0x00D6, 0x39, 0x03}, - {0x0080, 0x00DA, 0x3C, 0x03}, - {0x00A9, 0x00DD, 0x00, 0x03}, - {0x00BC, 0x00EB, 0x03, 0x03}, - {0x0032, 0x00EF, 0x1B, 0x03}, - {0x0067, 0x00F0, 0x3F, 0x03}, - {0x00EF, 0x00F1, 0x18, 0x03}, - {0x00A8, 0x00F3, 0x0C, 0x03}, - {0x00DE, 0x00F9, 0x1D, 0x03}, - {0x002C, 0x00FA, 0x13, 0x03} -}; - -static void DrvRenderStars() -{ - if (DrvStarControl[5] == 1) { - INT32 StarCounter; - INT32 SetA, SetB; - - SetA = DrvStarControl[3]; - SetB = DrvStarControl[4] | 0x02; - - for (StarCounter = 0; StarCounter < 252; StarCounter++) { - INT32 x, y; - - if ((SetA == StarSeedTab[StarCounter].Set) || (SetB == StarSeedTab[StarCounter].Set)) { - x = (StarSeedTab[StarCounter].x + DrvStarScrollX) % 256 + 16; - y = (112 + StarSeedTab[StarCounter].y + DrvStarScrollY) % 256; - - if (x >= 0 && x < 288 && y >= 0 && y < 224) { - pTransDraw[(y * nScreenWidth) + x] = StarSeedTab[StarCounter].Colour + 512; - } - } - - } - } -} - -static void DrvRenderTilemap() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex, Row, Col; - - for (mx = 0; mx < 28; mx++) { - for (my = 0; my < 36; my++) { - Row = mx + 2; - Col = my - 2; - if (Col & 0x20) { - TileIndex = Row + ((Col & 0x1f) << 5); - } else { - TileIndex = Col + (Row << 5); - } - - Code = DrvVideoRam[TileIndex + 0x000] & 0x7f; - Colour = DrvVideoRam[TileIndex + 0x400] & 0x3f; - - y = 8 * mx; - x = 8 * my; - - if (DrvFlipScreen) { - x = 280 - x; - y = 216 - y; - } - - if (x > 8 && x < 280 && y > 8 && y < 216) { - if (DrvFlipScreen) { - Render8x8Tile_FlipXY(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } else { - Render8x8Tile(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } - } else { - if (DrvFlipScreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } - } - } - } -} - -static void digdugchars() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex, Row, Col; - UINT8 *pf = DrvGfx4 + (playfield << 10); - UINT8 pfval; - UINT32 pfcolor = playcolor << 4; - - if (playenable != 0) - pf = NULL; - - for (mx = 0; mx < 28; mx++) { - for (my = 0; my < 36; my++) { - Row = mx + 2; - Col = my - 2; - if (Col & 0x20) { - TileIndex = Row + ((Col & 0x1f) << 5); - } else { - TileIndex = Col + (Row << 5); - } - - Code = DrvVideoRam[TileIndex]; - Colour = ((Code >> 4) & 0x0e) | ((Code >> 3) & 2); - Code &= 0x7f; - - y = 8 * mx; - x = 8 * my; - - if (DrvFlipScreen) { - x = 280 - x; - y = 216 - y; - } - - if (pf) { - // Draw playfield / background - pfval = pf[TileIndex&0xfff]; - INT32 pfColour = (pfval >> 4) + pfcolor; - if (x > 8 && x < 280 && y > 8 && y < 216) { - if (DrvFlipScreen) { - Render8x8Tile_FlipXY(pTransDraw, pfval, x, y, pfColour, 2, 0x100, DrvChars); - } else { - Render8x8Tile(pTransDraw, pfval, x, y, pfColour, 2, 0x100, DrvChars); - } - } else { - if (DrvFlipScreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, pfval, x, y, pfColour, 2, 0x100, DrvChars); - } else { - Render8x8Tile_Clip(pTransDraw, pfval, x, y, pfColour, 2, 0x100, DrvChars); - } - } - } - - if (x >= 0 && x <= 288 && y >= 0 && y <= 224) { - if (DrvFlipScreen) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 1, 0, 0, DrvDigdugChars); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 1, 0, 0, DrvDigdugChars); - } - } else { - if (DrvFlipScreen) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 1, 0, 0, DrvDigdugChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 1, 0, 0, DrvDigdugChars); - } - } - } - } -} - -static void DrvRenderSprites() -{ - UINT8 *SpriteRam1 = DrvSharedRam1 + 0x380; - UINT8 *SpriteRam2 = DrvSharedRam2 + 0x380; - UINT8 *SpriteRam3 = DrvSharedRam3 + 0x380; - - for (INT32 Offset = 0; Offset < 0x80; Offset += 2) { - static const INT32 GfxOffset[2][2] = { - { 0, 1 }, - { 2, 3 } - }; - INT32 Sprite = SpriteRam1[Offset + 0] & 0x7f; - INT32 Colour = SpriteRam1[Offset + 1] & 0x3f; - INT32 sx = SpriteRam2[Offset + 1] - 40 + (0x100 * (SpriteRam3[Offset + 1] & 0x03)); - INT32 sy = 256 - SpriteRam2[Offset + 0] + 1; - INT32 xFlip = (SpriteRam3[Offset + 0] & 0x01); - INT32 yFlip = (SpriteRam3[Offset + 0] & 0x02) >> 1; - INT32 xSize = (SpriteRam3[Offset + 0] & 0x04) >> 2; - INT32 ySize = (SpriteRam3[Offset + 0] & 0x08) >> 3; - - sy -= 16 * ySize; - sy = (sy & 0xff) - 32; - - if (DrvFlipScreen) { - xFlip = !xFlip; - yFlip = !yFlip; - } - - for (INT32 y = 0; y <= ySize; y++) { - for (INT32 x = 0; x <= xSize; x++) { - INT32 Code = Sprite + GfxOffset[y ^ (ySize * yFlip)][x ^ (xSize * xFlip)]; - INT32 xPos = sx + 16 * x; - INT32 yPos = sy + 16 * y; - - if (xPos >= nScreenWidth || yPos >= nScreenHeight) continue; - if (xPos < -15 || yPos < -15) continue; // crash preventer - - if (xPos > 16 && xPos < 272 && yPos > 16 && yPos < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 256, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 256, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 256, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 256, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 256, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 256, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 256, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 256, DrvSprites); - } - } - } - } - } - } -} - -static void digdug_Sprites() -{ - UINT8 *SpriteRam1 = DrvSharedRam1 + 0x380; - UINT8 *SpriteRam2 = DrvSharedRam2 + 0x380; - UINT8 *SpriteRam3 = DrvSharedRam3 + 0x380; - - for (INT32 Offset = 0; Offset < 0x80; Offset += 2) { - static const INT32 GfxOffset[2][2] = { - { 0, 1 }, - { 2, 3 } - }; - INT32 Sprite = SpriteRam1[Offset + 0]; - INT32 Colour = SpriteRam1[Offset + 1] & 0x3f; - INT32 sx = SpriteRam2[Offset + 1] - 40 + 1; - INT32 sy = 256 - SpriteRam2[Offset + 0] + 1; - INT32 xFlip = (SpriteRam3[Offset + 0] & 0x01); - INT32 yFlip = (SpriteRam3[Offset + 0] & 0x02) >> 1; - INT32 sSize = (Sprite & 0x80) >> 7; - - sy -= 16 * sSize; - sy = (sy & 0xff) - 32; - - if (sSize) - Sprite = (Sprite & 0xc0) | ((Sprite & ~0xc0) << 2); - - if (DrvFlipScreen) { - xFlip = !xFlip; - yFlip = !yFlip; - } - - for (INT32 y = 0; y <= sSize; y++) { - for (INT32 x = 0; x <= sSize; x++) { - INT32 Code = Sprite + GfxOffset[y ^ (sSize * yFlip)][x ^ (sSize * xFlip)]; - INT32 xPos = (sx + 16 * x); - INT32 yPos = sy + 16 * y; - - if (xPos < 8) xPos += 0x100; // that's a wrap! - if (xPos >= nScreenWidth || yPos >= nScreenHeight) continue; - if (xPos < -15 || yPos < -15) continue; // crash preventer - - if (xPos > 0 && xPos < 288-16 && yPos > 0 && yPos < 224-16) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 0x200, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 0x200, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 0x200, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 0x200, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 0x200, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 0x200, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 0x200, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, xPos, yPos, Colour, 2, 0, 0x200, DrvSprites); - } - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - DrvRenderTilemap(); - DrvRenderStars(); - DrvRenderSprites(); - BurnTransferCopy(DrvPalette); - return 0; -} - -static INT32 DrvDigdugDraw() -{ - BurnTransferClear(); - DrvCalcPaletteDigdug(); - digdugchars(); - digdug_Sprites(); - BurnTransferCopy(DrvPalette); - return 0; -} - -static void DrvPreMakeInputs() { - // silly bit of code to keep the joystick button pressed for only 1 frame - // needed for proper pumping action in digdug & highscore name entry. - memcpy(DrvInputPort1r, DrvInputPort1, sizeof(DrvInputPort1r)); - memcpy(DrvInputPort2r, DrvInputPort2, sizeof(DrvInputPort2r)); - - { - DrvInputPort1r[4] = 0; - DrvInputPort2r[4] = 0; - for (INT32 i = 0; i < 2; i++) { - if(((!i) ? DrvInputPort1[4] : DrvInputPort2[4]) && !DrvButtonHeld[i]) { - DrvButtonHold[i] = 2; // number of frames to be held + 1. - DrvButtonHeld[i] = 1; - } else { - if (((!i) ? !DrvInputPort1[4] : !DrvInputPort2[4])) { - DrvButtonHeld[i] = 0; - } - } - - if(DrvButtonHold[i]) { - DrvButtonHold[i]--; - ((!i) ? DrvInputPort1r[4] : DrvInputPort2r[4]) = ((DrvButtonHold[i]) ? 1 : 0); - } else { - (!i) ? DrvInputPort1r[4] : DrvInputPort2r[4] = 0; - } - } - //bprintf(0, _T("%X:%X,"), DrvInputPort1r[4], DrvButtonHold[0]); - } -} - -static void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = 0xff; - DrvInput[1] = 0xff; - DrvInput[2] = 0xff; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] -= (DrvInputPort0[i] & 1) << i; - DrvInput[1] -= (DrvInputPort1r[i] & 1) << i; - DrvInput[2] -= (DrvInputPort2r[i] & 1) << i; - } -} - -static INT32 DrvFrame() -{ - - if (DrvReset) DrvDoReset(); - - DrvPreMakeInputs(); - DrvMakeInputs(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 400; - INT32 nCyclesTotal[3]; - - nCyclesTotal[0] = (18432000 / 6) / 60; - nCyclesTotal[1] = (18432000 / 6) / 60; - nCyclesTotal[2] = (18432000 / 6) / 60; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - ZetRun(nCyclesTotal[nCurrentCPU] / nInterleave); - if (i == (nInterleave-1) && DrvCPU1FireIRQ) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - if ((i % 10==9) && IOChipCPU1FireIRQ) { - ZetNmi(); - } - ZetClose(); - - if (!DrvCPU2Halt) { - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - ZetRun(nCyclesTotal[nCurrentCPU] / nInterleave); - if (i == (nInterleave-1) && DrvCPU2FireIRQ) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - } - - if (!DrvCPU3Halt) { - nCurrentCPU = 2; - ZetOpen(nCurrentCPU); - ZetRun(nCyclesTotal[nCurrentCPU] / nInterleave); - if ((i == (nInterleave / 2)-3 || i == (nInterleave-1-3)) && DrvCPU3FireIRQ) { - ZetNmi(); - } - ZetClose(); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - if (bHasSamples) - BurnSampleRender(pSoundBuf, nSegmentLength); - } - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - if (bHasSamples) - BurnSampleRender(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) - BurnDrvRedraw(); - - if (!digdugmode) { - static const INT32 Speeds[8] = { -1, -2, -3, 0, 3, 2, 1, 0 }; - - DrvStarScrollX += Speeds[DrvStarControl[0] + (DrvStarControl[1] * 2) + (DrvStarControl[2] * 4)]; - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029737; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); // Scan Z80 - NamcoSoundScan(nAction, pnMin); - BurnSampleScan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(DrvCPU1FireIRQ); - SCAN_VAR(DrvCPU2FireIRQ); - SCAN_VAR(DrvCPU3FireIRQ); - SCAN_VAR(DrvCPU2Halt); - SCAN_VAR(DrvCPU3Halt); - SCAN_VAR(DrvFlipScreen); - SCAN_VAR(DrvStarScrollX); - SCAN_VAR(DrvStarScrollY); - SCAN_VAR(IOChipCustomCommand); - SCAN_VAR(IOChipCPU1FireIRQ); - SCAN_VAR(IOChipMode); - SCAN_VAR(IOChipCredits); - SCAN_VAR(IOChipCoinPerCredit); - SCAN_VAR(IOChipCreditPerCoin); - SCAN_VAR(PrevInValue); - SCAN_VAR(DrvStarControl); - SCAN_VAR(IOChipCustom); - - SCAN_VAR(Fetch); - SCAN_VAR(FetchMode); - SCAN_VAR(Config1); - SCAN_VAR(Config2); - SCAN_VAR(Config3); - SCAN_VAR(playfield); - SCAN_VAR(alphacolor); - SCAN_VAR(playenable); - SCAN_VAR(playcolor); - } - - if (nAction & ACB_NVRAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = earom; - ba.nLen = sizeof(earom); - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - return 0; -} - -struct BurnDriver BurnDrvGalaga = { - "galaga", NULL, NULL, "galaga", "1981", - "Galaga (Namco rev. B)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, DrvRomInfo, DrvRomName, GalagaSampleInfo, GalagaSampleName, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 576, - 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvGalagao = { - "galagao", "galaga", NULL, "galaga", "1981", - "Galaga (Namco)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, GalagaoRomInfo, GalagaoRomName, GalagaSampleInfo, GalagaSampleName, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 576, - 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvGalagamw = { - "galagamw", "galaga", NULL, "galaga", "1981", - "Galaga (Midway set 1)\0", NULL, "Namco (Midway License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, GalagamwRomInfo, GalagamwRomName, GalagaSampleInfo, GalagaSampleName, DrvInputInfo, GalagamwDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 576, - 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvGalagamk = { - "galagamk", "galaga", NULL, "galaga", "1981", - "Galaga (Midway set 2)\0", NULL, "Namco (Midway License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, GalagamkRomInfo, GalagamkRomName, GalagaSampleInfo, GalagaSampleName, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 576, - 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvGalagamf = { - "galagamf", "galaga", NULL, "galaga", "1981", - "Galaga (Midway set 1 with fast shoot hack)\0", NULL, "Namco (Midway License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, GalagamfRomInfo, GalagamfRomName, GalagaSampleInfo, GalagaSampleName, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 576, - 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvGallag = { - "gallag", "galaga", NULL, "galaga", "1981", - "Gallag\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, GallagRomInfo, GallagRomName, GalagaSampleInfo, GalagaSampleName, DrvInputInfo, DrvDIPInfo, - GallagInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 576, - 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvNebulbee = { - "nebulbee", "galaga", NULL, "galaga", "1981", - "Nebulous Bee\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, NebulbeeRomInfo, NebulbeeRomName, GalagaSampleInfo, GalagaSampleName, DrvInputInfo, DrvDIPInfo, - GallagInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 576, - 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvDigdug = { - "digdug", NULL, NULL, NULL, "1982", - "Dig Dug (rev 2)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, digdugRomInfo, digdugRomName, NULL, NULL, DigdugInputInfo, DigdugDIPInfo, - DrvDigdugInit, DrvExit, DrvFrame, DrvDigdugDraw, DrvScan, NULL, 0x300, - 224, 288, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_galivan.cpp b/jan/src/burn/drv/pre90s/d_galivan.cpp deleted file mode 100644 index 4e9e6b1fd..000000000 --- a/jan/src/burn/drv/pre90s/d_galivan.cpp +++ /dev/null @@ -1,1516 +0,0 @@ -// FB Alpha Galivan driver module -// Based on MAME driver by Luca Elia and Olivier Galibert - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "dac.h" -#include "burn_ym3526.h" -#include "flt_rc.h" -#include "nb1414m4_8bit.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvMapROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvSprPal; -static UINT8 *DrvColTable; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *hpfiltbuffer; - -static UINT8 sprite_priority; -static UINT16 scrollx; -static UINT16 scrolly; -static UINT8 flipscreen; -static UINT8 soundlatch; -static UINT8 bankdata; -static UINT8 display_disable; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDip[2]; // for ninjemak service mode -static UINT8 DrvInputs[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -static UINT8 DrvReset; - -static INT32 game_mode; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 3, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 4, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvJoy3 + 5, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo ninjemakInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 3, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 4, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDip + 0, "dip" }, -}; - -STDINPUTINFO(ninjemak) - -static struct BurnDIPInfo GalivanDIPList[]= -{ - {0x14, 0xff, 0xff, 0xdf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x02, "4" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "20k and every 60k" }, - {0x14, 0x01, 0x0c, 0x08, "50k and every 60k" }, - {0x14, 0x01, 0x0c, 0x04, "20k and every 90k" }, - {0x14, 0x01, 0x0c, 0x00, "50k and every 90k" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x20, 0x00, "Upright" }, - {0x14, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Power Invulnerability"}, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Life Invulnerability" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0x0c, 0x00, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0c, 0x04, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x15, 0x01, 0x10, 0x10, "Easy" }, - {0x15, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x01, 0x00, "Off" }, - {0x16, 0x01, 0x01, 0x01, "On (reset after turning off)" }, -}; - -STDDIPINFO(Galivan) - -static struct BurnDIPInfo DangarDIPList[]= -{ - {0x14, 0xff, 0xff, 0x9f, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x02, "4" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "20k and every 60k" }, - {0x14, 0x01, 0x0c, 0x08, "50k and every 60k" }, - {0x14, 0x01, 0x0c, 0x04, "20k and every 90k" }, - {0x14, 0x01, 0x0c, 0x00, "50k and every 90k" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x20, 0x00, "Upright" }, - {0x14, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Alternate Enemies" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x15, 0x01, 0x10, 0x10, "Easy" }, - {0x15, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x15, 0x01, 0xc0, 0xc0, "No" }, - {0x15, 0x01, 0xc0, 0x80, "3 Times" }, - {0x15, 0x01, 0xc0, 0x40, "5 Times" }, - {0x15, 0x01, 0xc0, 0x00, "99 Times" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x01, 0x00, "Off" }, - {0x16, 0x01, 0x01, 0x01, "On" }, -}; - -STDDIPINFO(Dangar) - -static struct BurnDIPInfo NinjemakDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7c, NULL }, - {0x16, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x02, "4" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "20k and every 60k" }, - {0x14, 0x01, 0x0c, 0x08, "50k and every 60k" }, - {0x14, 0x01, 0x0c, 0x04, "20k and every 90k" }, - {0x14, 0x01, 0x0c, 0x00, "50k and every 90k" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x30, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x02, 0x00, "Upright" }, - {0x15, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x15, 0x01, 0x04, 0x04, "Easy" }, - {0x15, 0x01, 0x04, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x15, 0x01, 0xc0, 0xc0, "No" }, - {0x15, 0x01, 0xc0, 0x80, "3 Times" }, - {0x15, 0x01, 0xc0, 0x40, "5 Times" }, - {0x15, 0x01, 0xc0, 0x00, "99 Times" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, -}; - -STDDIPINFO(Ninjemak) - -static void bankswitch(INT32 data) -{ - bankdata = data; - - ZetMapMemory(DrvZ80ROM0 + 0x10000 + data * 0x2000, 0xc000, 0xdfff, MAP_ROM); -} - -static void __fastcall galivan_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x40: - // coin counter data & 0x03 - flipscreen = data & 0x04; - bankswitch((data & 0x80) >> 7); - return; - - case 0x41: - scrollx = (scrollx & 0xff00) | data; - return; - - case 0x42: - { - if ((data & 0x80) == 0 && scrollx & 0x8000) - { - scrollx &= 0x7fff; - sprite_priority = data & 0x20; - display_disable = data & 0x40; - } - - scrollx = (scrollx & 0x00ff) | (data << 8); - } - return; - - case 0x43: - scrolly = (scrolly & 0xff00) | data; - return; - - case 0x44: - scrolly = (scrolly & 0x00ff) | (data << 8); - return; - - case 0x45: - case 0x85: - soundlatch = (data << 1) | 1; - return; - - case 0x80: - // coin counter = data & 0x03 - flipscreen = data & 0x04; - display_disable = data & 0x10; - bankswitch((data & 0xc0) >> 6); - return; - - case 0x86: { - nb_1414m4_exec8b((DrvVidRAM[0] << 8) | (DrvVidRAM[1] & 0xff), DrvVidRAM,&scrollx,&scrolly,game_mode); - } - return; - - case 0x46: - case 0x47: - case 0x87: - return; // nop - } -} - -static UINT8 __fastcall galivan_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - case 0x04: - case 0x05: - return DrvInputs[port & 7]; - - case 0xc0: // dangar - return 0x58; - - // ninja emaki (ninjemak) - case 0x80: - case 0x81: - case 0x82: - return DrvInputs[port & 7]; - - case 0x84: - case 0x85: - return DrvInputs[(port & 7)-1]; - - case 0x83: - return (DrvDip[0] & 0x02); - - } - - return 0; -} - -static void __fastcall galivan_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - BurnYM3526Write(port & 1, data); - return; - - case 0x02: - case 0x03: - DACWrite(port & 1, data); - return; - } -} - -static UINT8 __fastcall galivan_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x04: - soundlatch = 0; - return 0; - - case 0x06: - return soundlatch; - - } - - return 0; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (4000000.000 / (nBurnFPS / 100.000)))); -} - -inline static INT32 DrvYM3526SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - bankswitch(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - BurnYM3526Reset(); - - sprite_priority = 0; - scrollx = 0; - scrolly = 0; - flipscreen = 0; - soundlatch = 0; - display_disable = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x018000; - DrvZ80ROM1 = Next; Next += 0x00c000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x040000; - DrvGfxROM2 = Next; Next += 0x040000; - - DrvMapROM = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000400; - DrvSprPal = Next; Next += 0x000100; - - nb1414_blit_data8b = Next; Next += 0x004000; - - DrvColTable = Next; Next += 0x001180; - - DrvPalette = (UINT32*)Next; Next += 0x1180 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM1 = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x002000; - DrvSprBuf = Next; Next += 0x000200; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteTable() -{ - for (INT32 i = 0; i < 0x80; i++) { - DrvColTable[i] = i; - } - - for (INT32 i = 0; i < 0x100; i++) { - DrvColTable[i+0x80] = 0xc0 | ((i >> ((i&8)>>2)) & 0x30) | (i & 0x0f); - } - - for (INT32 i = 0; i < 0x1000; i++) { - - UINT8 ctabentry; - INT32 i_swapped = ((i & 0x0f) << 8) | ((i & 0xff0) >> 4); - - if (i & 0x80) - ctabentry = 0x80 | (DrvColPROM[0x300 + (i >> 4)] & 0x0f) | ((i & 0x0c) << 2); - else - ctabentry = 0x80 | (DrvColPROM[0x300 + (i >> 4)] & 0x0f) | ((i & 0x03) << 4); - - DrvColTable[0x180 + i_swapped] = ctabentry; - } -} - -static void DrvNibbleExpand(UINT8 *rom, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i -= 2) { - rom[i+1] = rom[i/2] >> 4; - rom[i+0] = rom[i/2] & 0xf; - } -} - -static INT32 DrvInit(INT32 game) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - game_mode = game; - - if (game == 0) - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - memcpy (DrvGfxROM0 + 0x4000, DrvGfxROM0, 0x4000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 11, 2)) return 1; - memcpy (DrvGfxROM2 + 0x10000, DrvGfxROM2, 0x10000); - - if (BurnLoadRom(DrvMapROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvMapROM + 0x04000, 13, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 17, 1)) return 1; - - if (BurnLoadRom(DrvSprPal + 0x00000, 18, 1)) return 1; - } - - if (game == 1) - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10001, 13, 2)) return 1; - - if (BurnLoadRom(DrvMapROM + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvMapROM + 0x04000, 15, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 18, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 19, 1)) return 1; - - if (BurnLoadRom(DrvSprPal + 0x00000, 20, 1)) return 1; - - if (BurnLoadRom(nb1414_blit_data8b, 21, 1)) return 1; - } - - DrvNibbleExpand(DrvGfxROM0, 0x08000); - DrvNibbleExpand(DrvGfxROM1, 0x20000); - DrvNibbleExpand(DrvGfxROM2, 0x20000); - DrvPaletteTable(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0xd800, 0xdfff, MAP_WRITE); - ZetMapMemory(DrvSprRAM, 0xe000, 0xffff, MAP_RAM); - ZetSetOutHandler(galivan_main_write_port); - ZetSetInHandler(galivan_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetSetOutHandler(galivan_sound_write_port); - ZetSetInHandler(galivan_sound_read_port); - ZetClose(); - - // dac0 -> dac1 -> dc-offset removal (hp filter) -> ym3526 -> OUT - - BurnYM3526Init(4000000, NULL, &DrvYM3526SynchroniseStream, 1); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 0.85, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 0, DrvSyncDAC); - DACInit(1, 0, 0, DrvSyncDAC); - DACSetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - - // #0 takes dac #0,1 and highpasses it a little to get rid of the dc offset. - filter_rc_init(0, FLT_RC_HIGHPASS, 3846, 0, 0, CAP_N(0x310), 0); - filter_rc_set_src_stereo(0); - hpfiltbuffer = (INT16*)BurnMalloc(nBurnSoundLen*8); // for #0 - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnYM3526Exit(); - DACExit(); - filter_rc_exit(); - - BurnFree(AllMem); - - BurnFree(hpfiltbuffer); - hpfiltbuffer = NULL; - - nb1414_blit_data8b = NULL; - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 tab[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 r = DrvColPROM[i+0x000] & 0xf; - INT32 g = DrvColPROM[i+0x100] & 0xf; - INT32 b = DrvColPROM[i+0x200] & 0xf; - - tab[i] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); - } - - for (INT32 i = 0; i < 0x1180; i++) { - DrvPalette[i] = tab[DrvColTable[i]]; - } -} - -static void draw_fg_layer(INT32 mode) -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs & 0x1f) * 8; - INT32 sx = (offs / 0x20) * 8; - - INT32 attr = DrvVidRAM[offs + 0x400]; - INT32 code = DrvVidRAM[offs] | ((attr & 0x03) << 8); - INT32 color = (attr >> ((mode) ? 2 : 5)) & 7; - - if(offs < 0x12 && mode) - code = attr = 0x01; - - // necessary?? - // INT32 category = -1; - // if (mode == 0) category = (attr & 8) ? 0 : 1; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0xf, 0, DrvGfxROM0); - } -} - -static void draw_bg_layer(INT32 mode) -{ - INT32 width = (mode) ? 512 : 128; - INT32 height = (128 * 128) / width; - - INT32 xscroll = scrollx % (width * 16); - INT32 yscroll = (scrolly + 16) % (height * 16); - - for (INT32 offs = 0; offs < width * height; offs++) - { - INT32 sx,sy; - if (mode) { - sx = ((offs / height) * 16) - xscroll; - sy = ((offs % height) * 16) - yscroll; - } else { - sx = ((offs % width) * 16) - xscroll; - sy = ((offs / width) * 16) - yscroll; - } - if (sx < -15) sx += width*16; - if (sy < -15) sy += height*16; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvMapROM[offs + 0x4000]; - INT32 code = DrvMapROM[offs] + ((attr & 0x03) << 8); - INT32 color = ((attr & 0x60) >> 3) | ((mode) ? ((attr & 0x0c) >> 2) : ((attr & 0x18) >> 3)); - - Render16x16Tile_Clip(pTransDraw, code, sx, sy, ((0x80/0x10)+color), 4, 0, DrvGfxROM1); - } -} - -static void draw_sprites(INT32 mode) -{ - for (INT32 offs = 0; offs < (mode ? 0x200 : 0x100); offs += 4) - { - INT32 attr = DrvSprBuf[offs + 2]; - INT32 code = DrvSprBuf[offs + 1] + ((attr & 0x06) << 7); - INT32 color = (attr & 0x3c) >> 2; - color += 16 * (DrvSprPal[code >> 2] & 0x0f); - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - - INT32 sx = (DrvSprBuf[offs + 3] - 0x80) + 256 * (attr & 0x01); - INT32 sy = 240 - DrvSprBuf[offs + 0]; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color+(0x180/0x10), 4, 0xf, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color+(0x180/0x10), 4, 0xf, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color+(0x180/0x10), 4, 0xf, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color+(0x180/0x10), 4, 0xf, 0, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (display_disable || (nBurnLayer & 1) == 0) { - BurnTransferClear(); // 0 should fill black - } else { - draw_bg_layer(game_mode); - } - - if ((nBurnLayer & 2) && sprite_priority == 0) draw_sprites(game_mode); - if (nBurnLayer & 4) draw_fg_layer(game_mode); - if ((nBurnLayer & 8) && sprite_priority != 0) draw_sprites(game_mode); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - nb1414_frame8b++; - - { - DrvInputs[0] = 0xff; - DrvInputs[1] = 0xff; - DrvInputs[2] = 0xff; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 130; // sound irqs - INT32 nCyclesTotal[2] = { 6000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - INT32 nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - nSegment = nCyclesTotal[1] / nInterleave; - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[1] / nInterleave)); - - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - ZetClose(); - - if (pBurnSoundOut) { - ZetOpen(1); - - DACUpdate(pBurnSoundOut, nBurnSoundLen); - filter_rc_update(0, pBurnSoundOut, hpfiltbuffer, nBurnSoundLen); - memmove(pBurnSoundOut, hpfiltbuffer, nBurnSoundLen*4); - - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - - ZetClose(); - } - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x200); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - BurnYM3526Scan(nAction, pnMin); - - SCAN_VAR(sprite_priority); - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - SCAN_VAR(flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(bankdata); - SCAN_VAR(display_disable); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(bankdata); - ZetClose(); - } - - return 0; -} - - - -// Cosmo Police Galivan (12/26/1985) - -static struct BurnRomInfo galivanRomDesc[] = { - { "1.1b", 0x8000, 0x1e66b3f8, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.3b", 0x4000, 0xa45964f1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gv3.4b", 0x4000, 0x82f0c5e6, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gv11.14b", 0x4000, 0x05f1a0e3, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "gv12.15b", 0x8000, 0x5b7a0d6d, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "gv4.13d", 0x4000, 0x162490b4, 3 | BRF_GRA }, // 5 Characters - - { "gv7.14f", 0x8000, 0xeaa1a0db, 4 | BRF_GRA }, // 6 Background Tiles - { "gv8.15f", 0x8000, 0xf174a41e, 4 | BRF_GRA }, // 7 - { "gv9.17f", 0x8000, 0xedc60f5d, 4 | BRF_GRA }, // 8 - { "gv10.19f", 0x8000, 0x41f27fca, 4 | BRF_GRA }, // 9 - - { "gv14.4f", 0x8000, 0x03e2229f, 5 | BRF_GRA }, // 10 Sprites - { "gv13.1f", 0x8000, 0xbca9e66b, 5 | BRF_GRA }, // 11 - - { "gv6.19d", 0x4000, 0xda38168b, 6 | BRF_GRA }, // 12 Background Tilemaps - { "gv5.17d", 0x4000, 0x22492d2a, 6 | BRF_GRA }, // 13 - - { "mb7114e.9f", 0x0100, 0xde782b3e, 7 | BRF_GRA }, // 14 Color data - { "mb7114e.10f", 0x0100, 0x0ae2a857, 7 | BRF_GRA }, // 15 - { "mb7114e.11f", 0x0100, 0x7ba8b9d1, 7 | BRF_GRA }, // 16 - { "mb7114e.2d", 0x0100, 0x75466109, 7 | BRF_GRA }, // 17 - - { "mb7114e.7f", 0x0100, 0x06538736, 8 | BRF_GRA }, // 18 Sprite LUT -}; - -STD_ROM_PICK(galivan) -STD_ROM_FN(galivan) - -static INT32 galivanInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvGalivan = { - "galivan", NULL, NULL, NULL, "1985", - "Cosmo Police Galivan (12/26/1985)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, galivanRomInfo, galivanRomName, NULL, NULL, DrvInputInfo, GalivanDIPInfo, - galivanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Cosmo Police Galivan (12/16/1985) - -static struct BurnRomInfo galivan2RomDesc[] = { - { "gv1.1b", 0x8000, 0x5e480bfc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "gv2.3b", 0x4000, 0x0d1b3538, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gv3.4b", 0x4000, 0x82f0c5e6, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gv11.14b", 0x4000, 0x05f1a0e3, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "gv12.15b", 0x8000, 0x5b7a0d6d, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "gv4.13d", 0x4000, 0x162490b4, 3 | BRF_GRA }, // 5 Characters - - { "gv7.14f", 0x8000, 0xeaa1a0db, 4 | BRF_GRA }, // 6 Background Tiles - { "gv8.15f", 0x8000, 0xf174a41e, 4 | BRF_GRA }, // 7 - { "gv9.17f", 0x8000, 0xedc60f5d, 4 | BRF_GRA }, // 8 - { "gv10.19f", 0x8000, 0x41f27fca, 4 | BRF_GRA }, // 9 - - { "gv14.4f", 0x8000, 0x03e2229f, 5 | BRF_GRA }, // 10 Sprites - { "gv13.1f", 0x8000, 0xbca9e66b, 5 | BRF_GRA }, // 11 - - { "gv6.19d", 0x4000, 0xda38168b, 6 | BRF_GRA }, // 12 Background Tilemaps - { "gv5.17d", 0x4000, 0x22492d2a, 6 | BRF_GRA }, // 13 - - { "mb7114e.9f", 0x0100, 0xde782b3e, 7 | BRF_GRA }, // 14 Color data - { "mb7114e.10f", 0x0100, 0x0ae2a857, 7 | BRF_GRA }, // 15 - { "mb7114e.11f", 0x0100, 0x7ba8b9d1, 7 | BRF_GRA }, // 16 - { "mb7114e.2d", 0x0100, 0x75466109, 7 | BRF_GRA }, // 17 - - { "mb7114e.7f", 0x0100, 0x06538736, 8 | BRF_GRA }, // 18 Sprite LUT -}; - -STD_ROM_PICK(galivan2) -STD_ROM_FN(galivan2) - -struct BurnDriver BurnDrvGalivan2 = { - "galivan2", "galivan", NULL, NULL, "1985", - "Cosmo Police Galivan (12/16/1985)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, galivan2RomInfo, galivan2RomName, NULL, NULL, DrvInputInfo, GalivanDIPInfo, - galivanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Cosmo Police Galivan (12/11/1985) - -static struct BurnRomInfo galivan3RomDesc[] = { - { "e-1.1b", 0x8000, 0xd8cc72b8, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "e-2.3b", 0x4000, 0x9e5b3157, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gv3.4b", 0x4000, 0x82f0c5e6, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gv11.14b", 0x4000, 0x05f1a0e3, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "gv12.15b", 0x8000, 0x5b7a0d6d, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "gv4.13d", 0x4000, 0x162490b4, 3 | BRF_GRA }, // 5 Characters - - { "gv7.14f", 0x8000, 0xeaa1a0db, 4 | BRF_GRA }, // 6 Background Tiles - { "gv8.15f", 0x8000, 0xf174a41e, 4 | BRF_GRA }, // 7 - { "gv9.17f", 0x8000, 0xedc60f5d, 4 | BRF_GRA }, // 8 - { "gv10.19f", 0x8000, 0x41f27fca, 4 | BRF_GRA }, // 9 - - { "gv14.4f", 0x8000, 0x03e2229f, 5 | BRF_GRA }, // 10 Sprites - { "gv13.1f", 0x8000, 0xbca9e66b, 5 | BRF_GRA }, // 11 - - { "gv6.19d", 0x4000, 0xda38168b, 6 | BRF_GRA }, // 12 Background Tilemaps - { "gv5.17d", 0x4000, 0x22492d2a, 6 | BRF_GRA }, // 13 - - { "mb7114e.9f", 0x0100, 0xde782b3e, 7 | BRF_GRA }, // 14 Color data - { "mb7114e.10f", 0x0100, 0x0ae2a857, 7 | BRF_GRA }, // 15 - { "mb7114e.11f", 0x0100, 0x7ba8b9d1, 7 | BRF_GRA }, // 16 - { "mb7114e.2d", 0x0100, 0x75466109, 7 | BRF_GRA }, // 17 - - { "mb7114e.7f", 0x0100, 0x06538736, 8 | BRF_GRA }, // 18 Sprite LUT -}; - -STD_ROM_PICK(galivan3) -STD_ROM_FN(galivan3) - -struct BurnDriver BurnDrvGalivan3 = { - "galivan3", "galivan", NULL, NULL, "1985", - "Cosmo Police Galivan (12/11/1985)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, galivan3RomInfo, galivan3RomName, NULL, NULL, DrvInputInfo, GalivanDIPInfo, - galivanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Ufo Robo Dangar (4/07/1987) - -static struct BurnRomInfo dangarRomDesc[] = { - { "8.1b", 0x8000, 0xfe4a3fd6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "9.3b", 0x4000, 0x809d280f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "10.4b", 0x4000, 0x99a3591b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "13.b14", 0x4000, 0x3e041873, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "14.b15", 0x8000, 0x488e3463, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "5.13d", 0x4000, 0x40cb378a, 3 | BRF_GRA }, // 5 Characters - - { "1.14f", 0x8000, 0xd59ed1f1, 4 | BRF_GRA }, // 6 Background Tiles - { "2.15f", 0x8000, 0xdfdb931c, 4 | BRF_GRA }, // 7 - { "3.17f", 0x8000, 0x6954e8c3, 4 | BRF_GRA }, // 8 - { "4.19f", 0x8000, 0x4af6a8bf, 4 | BRF_GRA }, // 9 - - { "12.f4", 0x8000, 0x55711884, 5 | BRF_GRA }, // 10 Sprites - { "11.f1", 0x8000, 0x8cf11419, 5 | BRF_GRA }, // 11 - - { "7.19d", 0x4000, 0x6dba32cf, 6 | BRF_GRA }, // 12 Background Tilemaps - { "6.17d", 0x4000, 0x6c899071, 6 | BRF_GRA }, // 13 - - { "82s129.9f", 0x0100, 0xb29f6a07, 7 | BRF_GRA }, // 14 Color data - { "82s129.10f", 0x0100, 0xc6de5ecb, 7 | BRF_GRA }, // 15 - { "82s129.11f", 0x0100, 0xa5bbd6dc, 7 | BRF_GRA }, // 16 - { "82s129.2d", 0x0100, 0xa4ac95a5, 7 | BRF_GRA }, // 17 - - { "82s129.7f", 0x0100, 0x29bc6216, 8 | BRF_GRA }, // 18 Sprite LUT -}; - -STD_ROM_PICK(dangar) -STD_ROM_FN(dangar) - -struct BurnDriver BurnDrvDangar = { - "dangar", NULL, NULL, NULL, "1986", - "Ufo Robo Dangar (4/07/1987)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dangarRomInfo, dangarRomName, NULL, NULL, DrvInputInfo, DangarDIPInfo, - galivanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Ufo Robo Dangar (12/1/1986) - -static struct BurnRomInfo dangaraRomDesc[] = { - { "8.1b", 0x8000, 0xe52638f2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "9.3b", 0x4000, 0x809d280f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "10.4b", 0x4000, 0x99a3591b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "13.14b", 0x4000, 0x3e041873, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "14.15b", 0x8000, 0x488e3463, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "5.13d", 0x4000, 0x40cb378a, 3 | BRF_GRA }, // 5 Characters - - { "1.14f", 0x8000, 0xd59ed1f1, 4 | BRF_GRA }, // 6 Background Tiles - { "2.15f", 0x8000, 0xdfdb931c, 4 | BRF_GRA }, // 7 - { "3.17f", 0x8000, 0x6954e8c3, 4 | BRF_GRA }, // 8 - { "4.19f", 0x8000, 0x4af6a8bf, 4 | BRF_GRA }, // 9 - - { "12.4f", 0x8000, 0x55711884, 5 | BRF_GRA }, // 10 Sprites - { "11.1f", 0x8000, 0x8cf11419, 5 | BRF_GRA }, // 11 - - { "7.19d", 0x4000, 0x6dba32cf, 6 | BRF_GRA }, // 12 Background Tilemaps - { "6.17d", 0x4000, 0x6c899071, 6 | BRF_GRA }, // 13 - - { "82s129.9f", 0x0100, 0xb29f6a07, 7 | BRF_GRA }, // 14 Color data - { "82s129.10f", 0x0100, 0xc6de5ecb, 7 | BRF_GRA }, // 15 - { "82s129.11f", 0x0100, 0xa5bbd6dc, 7 | BRF_GRA }, // 16 - { "82s129.2d", 0x0100, 0xa4ac95a5, 7 | BRF_GRA }, // 17 - - { "82s129.7f", 0x0100, 0x29bc6216, 8 | BRF_GRA }, // 18 Sprite LUT -}; - -STD_ROM_PICK(dangara) -STD_ROM_FN(dangara) - -struct BurnDriver BurnDrvDangara = { - "dangara", "dangar", NULL, NULL, "1986", - "Ufo Robo Dangar (12/1/1986)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dangaraRomInfo, dangaraRomName, NULL, NULL, DrvInputInfo, DangarDIPInfo, // dangar2 - galivanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Ufo Robo Dangar (9/26/1986) - -static struct BurnRomInfo dangarbRomDesc[] = { - { "16.1b", 0x8000, 0x743fa2d4, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "17.3b", 0x4000, 0x1cdc60a5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "18.4b", 0x4000, 0xdb7f6613, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "13.14b", 0x4000, 0x3e041873, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "14.15b", 0x8000, 0x488e3463, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "11.13d", 0x4000, 0xe804ffe1, 3 | BRF_GRA }, // 5 Characters - - { "1.14f", 0x8000, 0xd59ed1f1, 4 | BRF_GRA }, // 6 Background Tiles - { "2.15f", 0x8000, 0xdfdb931c, 4 | BRF_GRA }, // 7 - { "3.17f", 0x8000, 0x6954e8c3, 4 | BRF_GRA }, // 8 - { "4.19f", 0x8000, 0x4af6a8bf, 4 | BRF_GRA }, // 9 - - { "12.4f", 0x8000, 0x55711884, 5 | BRF_GRA }, // 10 Sprites - { "11.1f", 0x8000, 0x8cf11419, 5 | BRF_GRA }, // 11 - - { "7.19d", 0x4000, 0x6dba32cf, 6 | BRF_GRA }, // 12 Background Tilemaps - { "6.17d", 0x4000, 0x6c899071, 6 | BRF_GRA }, // 13 - - { "82s129.9f", 0x0100, 0xb29f6a07, 7 | BRF_GRA }, // 14 Color data - { "82s129.10f", 0x0100, 0xc6de5ecb, 7 | BRF_GRA }, // 15 - { "82s129.11f", 0x0100, 0xa5bbd6dc, 7 | BRF_GRA }, // 16 - { "82s129.2d", 0x0100, 0xa4ac95a5, 7 | BRF_GRA }, // 17 - - { "82s129.7f", 0x0100, 0x29bc6216, 8 | BRF_GRA }, // 18 Sprite LUT -}; - -STD_ROM_PICK(dangarb) -STD_ROM_FN(dangarb) - -struct BurnDriver BurnDrvDangarb = { - "dangarb", "dangar", NULL, NULL, "1986", - "Ufo Robo Dangar (9/26/1986)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dangarbRomInfo, dangarbRomName, NULL, NULL, DrvInputInfo, DangarDIPInfo, // Dangar2 - galivanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Ufo Robo Dangar (9/26/1986, Japan) - -static struct BurnRomInfo dangarjRomDesc[] = { - { "16.1b", 0x8000, 0x1e14b0b4, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "17.3b", 0x4000, 0x9ba92111, 1 | BRF_PRG | BRF_ESS }, // 1 - { "18.4b", 0x4000, 0xdb7f6613, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "21.14b", 0x4000, 0x3e041873, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "22.15b", 0x4000, 0x1d484f68, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "11.13d", 0x4000, 0xe804ffe1, 3 | BRF_GRA }, // 5 Characters - - { "7.14f", 0x8000, 0xd59ed1f1, 4 | BRF_GRA }, // 6 Background Tiles - { "8.15f", 0x8000, 0xdfdb931c, 4 | BRF_GRA }, // 7 - { "9.17f", 0x8000, 0x6954e8c3, 4 | BRF_GRA }, // 8 - { "10.19f", 0x8000, 0x4af6a8bf, 4 | BRF_GRA }, // 9 - - { "20.4f", 0x8000, 0x55711884, 5 | BRF_GRA }, // 10 Sprites - { "19.1f", 0x8000, 0x8cf11419, 5 | BRF_GRA }, // 11 - - { "15.19d", 0x4000, 0x6dba32cf, 6 | BRF_GRA }, // 12 Background Tilemaps - { "12.17d", 0x4000, 0x6c899071, 6 | BRF_GRA }, // 13 - - { "82s129.9f", 0x0100, 0xb29f6a07, 7 | BRF_GRA }, // 14 Color data - { "82s129.10f", 0x0100, 0xc6de5ecb, 7 | BRF_GRA }, // 15 - { "82s129.11f", 0x0100, 0xa5bbd6dc, 7 | BRF_GRA }, // 16 - { "82s129.2d", 0x0100, 0xa4ac95a5, 7 | BRF_GRA }, // 17 - - { "82s129.7f", 0x0100, 0x29bc6216, 8 | BRF_GRA }, // 18 Sprite LUT - - { "dg-3.ic7.2764", 0x2000, 0x84a56d26, 9 | BRF_GRA }, // 19 user2 -}; - -STD_ROM_PICK(dangarj) -STD_ROM_FN(dangarj) - -struct BurnDriver BurnDrvDangarj = { - "dangarj", "dangar", NULL, NULL, "1986", - "Ufo Robo Dangar (9/26/1986, Japan)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dangarjRomInfo, dangarjRomName, NULL, NULL, DrvInputInfo, DangarDIPInfo, // Dangar2 - galivanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Ufo Robo Dangar (bootleg) - -static struct BurnRomInfo dangarbtRomDesc[] = { - { "8", 0x8000, 0x8136fd10, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "9", 0x4000, 0x3ce5ec11, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dangar2.018", 0x4000, 0xdb7f6613, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "dangar13.b14", 0x4000, 0x3e041873, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "dangar14.b15", 0x8000, 0x488e3463, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "dangar2.011", 0x4000, 0xe804ffe1, 3 | BRF_GRA }, // 5 Characters - - { "dangar01.14f", 0x8000, 0xd59ed1f1, 4 | BRF_GRA }, // 6 Background Tiles - { "dangar02.15f", 0x8000, 0xdfdb931c, 4 | BRF_GRA }, // 7 - { "dangar03.17f", 0x8000, 0x6954e8c3, 4 | BRF_GRA }, // 8 - { "dangar04.19f", 0x8000, 0x4af6a8bf, 4 | BRF_GRA }, // 9 - - { "dangarxx.f4", 0x8000, 0x55711884, 5 | BRF_GRA }, // 10 Sprites - { "dangarxx.f1", 0x8000, 0x8cf11419, 5 | BRF_GRA }, // 11 - - { "dangar07.19d", 0x4000, 0x6dba32cf, 6 | BRF_GRA }, // 12 Background Tilemaps - { "dangar06.17d", 0x4000, 0x6c899071, 6 | BRF_GRA }, // 13 - - { "82s129.9f", 0x0100, 0xb29f6a07, 7 | BRF_GRA }, // 14 Color data - { "82s129.10f", 0x0100, 0xc6de5ecb, 7 | BRF_GRA }, // 15 - { "82s129.11f", 0x0100, 0xa5bbd6dc, 7 | BRF_GRA }, // 16 - { "82s129.2d", 0x0100, 0xa4ac95a5, 7 | BRF_GRA }, // 17 - - { "82s129.7f", 0x0100, 0x29bc6216, 8 | BRF_GRA }, // 18 Sprite LUT -}; - -STD_ROM_PICK(dangarbt) -STD_ROM_FN(dangarbt) - -struct BurnDriver BurnDrvDangarbt = { - "dangarbt", "dangar", NULL, NULL, "1986", - "Ufo Robo Dangar (bootleg)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dangarbtRomInfo, dangarbtRomName, NULL, NULL, DrvInputInfo, DangarDIPInfo, // Dangar2 - galivanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Ninja Emaki (US) - -static struct BurnRomInfo ninjemakRomDesc[] = { - { "ninjemak.1", 0x8000, 0x12b0a619, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "ninjemak.2", 0x4000, 0xd5b505d1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ninjemak.3", 0x8000, 0x68c92bf6, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ninjemak.12", 0x4000, 0x3d1cd329, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "ninjemak.13", 0x8000, 0xac3a0b81, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "ninjemak.4", 0x8000, 0x83702c37, 3 | BRF_GRA }, // 5 Characters - - { "ninjemak.8", 0x8000, 0x655f0a58, 4 | BRF_GRA }, // 6 Background Tiles - { "ninjemak.9", 0x8000, 0x934e1703, 4 | BRF_GRA }, // 7 - { "ninjemak.10", 0x8000, 0x955b5c45, 4 | BRF_GRA }, // 8 - { "ninjemak.11", 0x8000, 0xbbd2e51c, 4 | BRF_GRA }, // 9 - - { "ninjemak.16", 0x8000, 0x8df93fed, 5 | BRF_GRA }, // 10 Sprites - { "ninjemak.17", 0x8000, 0xa3efd0fc, 5 | BRF_GRA }, // 11 - { "ninjemak.14", 0x8000, 0xbff332d3, 5 | BRF_GRA }, // 12 - { "ninjemak.15", 0x8000, 0x56430ed4, 5 | BRF_GRA }, // 13 - - { "ninjemak.7", 0x4000, 0x80c20d36, 6 | BRF_GRA }, // 14 Background Tilemaps - { "ninjemak.6", 0x4000, 0x1da7a651, 6 | BRF_GRA }, // 15 - - { "ninjemak.pr1", 0x0100, 0x8a62d4e4, 7 | BRF_GRA }, // 16 Color data - { "ninjemak.pr2", 0x0100, 0x2ccf976f, 7 | BRF_GRA }, // 17 - { "ninjemak.pr3", 0x0100, 0x16b2a7a4, 7 | BRF_GRA }, // 18 - { "yncp-2d.bin", 0x0100, 0x23bade78, 7 | BRF_GRA }, // 19 - - { "yncp-7f.bin", 0x0100, 0x262d0809, 8 | BRF_GRA }, // 20 Sprite LUT - - { "ninjemak.5", 0x4000, 0x5f91dd30, 9 | BRF_GRA }, // 21 nb1414m4 data -}; - -STD_ROM_PICK(ninjemak) -STD_ROM_FN(ninjemak) - -static INT32 ninjemakInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvNinjemak = { - "ninjemak", NULL, NULL, NULL, "1986", - "Ninja Emaki (US)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, ninjemakRomInfo, ninjemakRomName, NULL, NULL, ninjemakInputInfo, NinjemakDIPInfo, - ninjemakInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Youma Ninpou Chou (Japan) - -static struct BurnRomInfo youmaRomDesc[] = { - { "ync-1.bin", 0x8000, 0x0552adab, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "ync-2.bin", 0x4000, 0xf961e5e6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ync-3.bin", 0x8000, 0x9ad50a5e, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ninjemak.12", 0x4000, 0x3d1cd329, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "ninjemak.13", 0x8000, 0xac3a0b81, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "ync-4.bin", 0x8000, 0xa1954f44, 3 | BRF_GRA }, // 5 Characters - - { "ninjemak.8", 0x8000, 0x655f0a58, 4 | BRF_GRA }, // 6 Background Tiles - { "ninjemak.9", 0x8000, 0x934e1703, 4 | BRF_GRA }, // 7 - { "ninjemak.10", 0x8000, 0x955b5c45, 4 | BRF_GRA }, // 8 - { "ninjemak.11", 0x8000, 0xbbd2e51c, 4 | BRF_GRA }, // 9 - - { "ninjemak.16", 0x8000, 0x8df93fed, 5 | BRF_GRA }, // 10 Sprites - { "ninjemak.17", 0x8000, 0xa3efd0fc, 5 | BRF_GRA }, // 11 - { "ninjemak.14", 0x8000, 0xbff332d3, 5 | BRF_GRA }, // 12 - { "ninjemak.15", 0x8000, 0x56430ed4, 5 | BRF_GRA }, // 13 - - { "ninjemak.7", 0x4000, 0x80c20d36, 6 | BRF_GRA }, // 14 Background Tilemaps - { "ninjemak.6", 0x4000, 0x1da7a651, 6 | BRF_GRA }, // 15 - - { "yncp-6e.bin", 0x0100, 0xea47b91a, 8 | BRF_GRA }, // 16 Color data - { "yncp-7e.bin", 0x0100, 0xe94c0fed, 8 | BRF_GRA }, // 17 - { "yncp-8e.bin", 0x0100, 0xffb4b287, 8 | BRF_GRA }, // 18 - { "yncp-2d.bin", 0x0100, 0x23bade78, 8 | BRF_GRA }, // 19 - - { "yncp-7f.bin", 0x0100, 0x262d0809, 9 | BRF_GRA }, // 20 Sprite LUT - - { "ync-5.bin", 0x4000, 0x993e4ab2, 7 | BRF_GRA }, // 21 nb1414m4 data -}; - -STD_ROM_PICK(youma) -STD_ROM_FN(youma) - -struct BurnDriver BurnDrvYouma = { - "youma", "ninjemak", NULL, NULL, "1986", - "Youma Ninpou Chou (Japan)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, youmaRomInfo, youmaRomName, NULL, NULL, ninjemakInputInfo, NinjemakDIPInfo, - ninjemakInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Youma Ninpou Chou (Japan, alt) - -static struct BurnRomInfo youma2RomDesc[] = { - { "1.1d", 0x8000, 0x171dbe99, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.3d", 0x4000, 0xe502d62a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.4d", 0x8000, 0xcb84745c, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "12.14b", 0x4000, 0x3d1cd329, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "13.15b", 0x8000, 0xac3a0b81, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "4.7d", 0x8000, 0x40aeffd8, 3 | BRF_GRA }, // 5 Characters - - { "ninjemak.8", 0x8000, 0x655f0a58, 4 | BRF_GRA }, // 6 Background Tiles - { "ninjemak.9", 0x8000, 0x934e1703, 4 | BRF_GRA }, // 7 - { "ninjemak.10", 0x8000, 0x955b5c45, 4 | BRF_GRA }, // 8 - { "ninjemak.11", 0x8000, 0xbbd2e51c, 4 | BRF_GRA }, // 9 - - { "ninjemak.16", 0x8000, 0x8df93fed, 5 | BRF_GRA }, // 10 Sprites - { "ninjemak.17", 0x8000, 0xa3efd0fc, 5 | BRF_GRA }, // 11 - { "ninjemak.14", 0x8000, 0xbff332d3, 5 | BRF_GRA }, // 12 - { "ninjemak.15", 0x8000, 0x56430ed4, 5 | BRF_GRA }, // 13 - - { "ninjemak.7", 0x4000, 0x80c20d36, 6 | BRF_GRA }, // 14 Background Tilemaps - { "ninjemak.6", 0x4000, 0x1da7a651, 6 | BRF_GRA }, // 15 - - { "bpr.6e", 0x0100, 0x8a62d4e4, 8 | BRF_GRA }, // 16 Color data - { "bpr.7e", 0x0100, 0x2ccf976f, 8 | BRF_GRA }, // 17 - { "bpr.8e", 0x0100, 0x16b2a7a4, 8 | BRF_GRA }, // 18 - { "bpr.2d", 0x0100, 0x23bade78, 8 | BRF_GRA }, // 19 - - { "bpr.7f", 0x0100, 0x262d0809, 9 | BRF_GRA }, // 20 Sprite LUT - - { "5.15d", 0x4000, 0x1b4f64aa, 7 | BRF_GRA }, // 21 nb1414m4 data -}; - -STD_ROM_PICK(youma2) -STD_ROM_FN(youma2) - -struct BurnDriver BurnDrvYouma2 = { - "youma2", "ninjemak", NULL, NULL, "1986", - "Youma Ninpou Chou (Japan, alt)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, youma2RomInfo, youma2RomName, NULL, NULL, ninjemakInputInfo, NinjemakDIPInfo, - ninjemakInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Youma Ninpou Chou (Game Electronics bootleg, set 1) - -static struct BurnRomInfo youmabRomDesc[] = { - { "electric1.3u", 0x8000, 0xcc4fdb92, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "electric3.3r", 0x8000, 0xc1bc7387, 1 | BRF_PRG | BRF_ESS }, // 1 - { "electric2.3t", 0x8000, 0x99aee3bc, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "electric12.5e", 0x4000, 0x3d1cd329, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "electric13.5d", 0x8000, 0xac3a0b81, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "electric4.3m", 0x8000, 0xa1954f44, 3 | BRF_GRA }, // 5 Characters - - { "electric8.1f", 0x8000, 0x655f0a58, 4 | BRF_GRA }, // 6 Background Tiles - { "electric9.1d", 0x8000, 0x77a964c1, 4 | BRF_GRA }, // 7 - { "electric10.1b", 0x8000, 0x955b5c45, 4 | BRF_GRA }, // 8 - { "electric11.1a", 0x8000, 0xbbd2e51c, 4 | BRF_GRA }, // 9 - - { "electric16.1p", 0x8000, 0x8df93fed, 5 | BRF_GRA }, // 10 Sprites - { "electric17.1m", 0x8000, 0xa3efd0fc, 5 | BRF_GRA }, // 11 - { "electric14.1t", 0x8000, 0xbff332d3, 5 | BRF_GRA }, // 12 - { "electric15.1r", 0x8000, 0x56430ed4, 5 | BRF_GRA }, // 13 - - { "electric7.3a", 0x4000, 0x80c20d36, 6 | BRF_GRA }, // 14 Background Tilemaps - { "electric6.3b", 0x4000, 0x1da7a651, 6 | BRF_GRA }, // 15 - - { "prom82s129.2n", 0x0100, 0xea47b91a, 7 | BRF_GRA }, // 16 Color data - { "prom82s129.2m", 0x0100, 0xe94c0fed, 7 | BRF_GRA }, // 17 - { "prom82s129.2l", 0x0100, 0xffb4b287, 7 | BRF_GRA }, // 18 - { "prom82s129.3s", 0x0100, 0x23bade78, 7 | BRF_GRA }, // 19 - - { "prom82s129.1l", 0x0100, 0x262d0809, 8 | BRF_GRA }, // 20 Sprite LUT -}; - -STD_ROM_PICK(youmab) -STD_ROM_FN(youmab) - -struct BurnDriverD BurnDrvYoumab = { - "youmab", "ninjemak", NULL, NULL, "1986", - "Youma Ninpou Chou (Game Electronics bootleg, set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0 | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, youmabRomInfo, youmabRomName, NULL, NULL, ninjemakInputInfo, NinjemakDIPInfo, - ninjemakInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; - - -// Youma Ninpou Chou (Game Electronics bootleg, set 2) - -static struct BurnRomInfo youmab2RomDesc[] = { - { "1.1d", 0x8000, 0x692ae497, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "3.4d", 0x8000, 0xebf61afc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2.2d", 0x8000, 0x99aee3bc, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "11.13b", 0x4000, 0x3d1cd329, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "12.15b", 0x8000, 0xac3a0b81, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "4.7d", 0x8000, 0xa1954f44, 3 | BRF_GRA }, // 5 Characters - - { "7.13f", 0x8000, 0x655f0a58, 4 | BRF_GRA }, // 6 Background Tiles - { "8.15f", 0x8000, 0x934e1703, 4 | BRF_GRA }, // 7 - { "9.16f", 0x8000, 0x955b5c45, 4 | BRF_GRA }, // 8 - { "10.18f", 0x8000, 0xbbd2e51c, 4 | BRF_GRA }, // 9 - - { "15.4h", 0x8000, 0x8df93fed, 5 | BRF_GRA }, // 10 Sprites - { "16.6h", 0x8000, 0xa3efd0fc, 5 | BRF_GRA }, // 11 - { "13.1h", 0x8000, 0xbff332d3, 5 | BRF_GRA }, // 12 - { "14.3h", 0x8000, 0x56430ed4, 5 | BRF_GRA }, // 13 - - { "6.18d", 0x4000, 0x80c20d36, 6 | BRF_GRA }, // 14 Background Tilemaps - { "5.17d", 0x4000, 0x1da7a651, 6 | BRF_GRA }, // 15 - - { "pr.6e", 0x0100, 0xea47b91a, 7 | BRF_GRA }, // 16 Color data - { "pr.7e", 0x0100, 0x6d66da81, 7 | BRF_GRA }, // 17 - { "pr.8e", 0x0100, 0xffb4b287, 7 | BRF_GRA }, // 18 - { "pr.2e", 0x0100, 0x23bade78, 7 | BRF_GRA }, // 19 - - { "pr.7h", 0x0100, 0x262d0809, 8 | BRF_GRA }, // 20 Sprite LUT -}; - -STD_ROM_PICK(youmab2) -STD_ROM_FN(youmab2) - -struct BurnDriverD BurnDrvYoumab2 = { - "youmab2", "ninjemak", NULL, NULL, "1986", - "Youma Ninpou Chou (Game Electronics bootleg, set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0 | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, youmab2RomInfo, youmab2RomName, NULL, NULL, ninjemakInputInfo, NinjemakDIPInfo, - ninjemakInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1180, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_gaplus.cpp b/jan/src/burn/drv/pre90s/d_gaplus.cpp deleted file mode 100644 index a2a1c9d52..000000000 --- a/jan/src/burn/drv/pre90s/d_gaplus.cpp +++ /dev/null @@ -1,1240 +0,0 @@ -// FB Alpha Galaga 3 / Gaplus driver module -// Based on MAME driver by Manuel Abadia, Ernesto Corvi, and Nicola Salmoria - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "namco_snd.h" -#include "namcoio.h" -#include "samples.h" - -// stars not hooked up to states - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvM6809ROM2; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvSndPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 sub_cpu_in_reset; -static UINT8 sub2_cpu_in_reset; -static UINT8 main_irq_mask; -static UINT8 sub_irq_mask; -static UINT8 sub2_irq_mask; -static UINT8 flipscreen; - -static UINT8 custom_io[16]; -static UINT8 starfield_control[4]; - -struct star { - float x,y; - INT32 col,set; -}; - -static INT32 total_stars; -static struct star m_stars[250]; - -static INT32 watchdog; // not hooked up - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[5]; -static UINT8 DrvInputs[4]; -static UINT8 DrvReset; - -static struct BurnInputInfo GaplusInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, - {"Dip E", BIT_DIPSWITCH, DrvDips + 4, "dip" }, -}; - -STDINPUTINFO(Gaplus) - -static struct BurnDIPInfo GaplusDIPList[]= -{ - {0x10, 0xff, 0xff, 0x0f, NULL }, - {0x11, 0xff, 0xff, 0x0f, NULL }, - {0x12, 0xff, 0xff, 0x0f, NULL }, - {0x13, 0xff, 0xff, 0x0f, NULL }, - {0x14, 0xff, 0xff, 0x0f, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 0, "Demo Sounds" }, - {0x10, 0x01, 0x08, 0x00, "Off" }, - {0x10, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x11, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x0c, 0x08, "2" }, - {0x11, 0x01, 0x0c, 0x0c, "3" }, - {0x11, 0x01, 0x0c, 0x04, "4" }, - {0x11, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x07, 0x00, "30k 70k and every 70k" }, - {0x12, 0x01, 0x07, 0x01, "30k 100k and every 100k" }, - {0x12, 0x01, 0x07, 0x02, "30k 100k and every 200k" }, - {0x12, 0x01, 0x07, 0x03, "50k 100k and every 100k" }, - {0x12, 0x01, 0x07, 0x04, "50k 100k and every 200k" }, - {0x12, 0x01, 0x07, 0x07, "50k 150k and every 150k" }, - {0x12, 0x01, 0x07, 0x05, "50k 150k and every 300k" }, - {0x12, 0x01, 0x07, 0x06, "50k 150k" }, - - {0 , 0xfe, 0 , 4, "Round Advance" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x07, 0x07, "0 - Standard" }, - {0x13, 0x01, 0x07, 0x06, "1 - Easiest" }, - {0x13, 0x01, 0x07, 0x05, "2" }, - {0x13, 0x01, 0x07, 0x04, "3" }, - {0x13, 0x01, 0x07, 0x03, "4" }, - {0x13, 0x01, 0x07, 0x02, "5" }, - {0x13, 0x01, 0x07, 0x01, "6" }, - {0x13, 0x01, 0x07, 0x00, "7 - Hardest" }, - - {0 , 0xfe, 0 , 8, "Cabinet" }, - {0x14, 0x01, 0x04, 0x04, "Upright" }, - {0x14, 0x01, 0x04, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Gaplus) - -static void gaplus_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x6000) { - namco_15xx_sharedram_write(address,data); - return; - } - - if ((address & 0xfff0) == 0x6800) { - namcoio_write(0, address & 0xf, data); - return; - } - - if ((address & 0xfff0) == 0x6810) { - namcoio_write(1, address & 0xf, data); - return; - } - - if ((address & 0xfff0) == 0x6820) { - custom_io[address & 0xf] = data; - - if (address == 0x6829 && data >= 0x0f) { - BurnSamplePlay(0); - } - - return; - } - - if ((address & 0xf000) == 0x7000) { - main_irq_mask = (~address >> 11) & 1; - if (main_irq_mask == 0) M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } - - if ((address & 0xf000) == 0x8000) { - sub_cpu_in_reset = (address >> 11) & 1; - sub2_cpu_in_reset = sub_cpu_in_reset; - if (sub_cpu_in_reset) { - M6809Close(); - M6809Open(1); - M6809Reset(); - M6809Close(); - M6809Open(2); - M6809Reset(); - M6809Close(); - M6809Open(0); - } - namco_15xx_sound_enable((sub_cpu_in_reset)^1); - return; - } - - if ((address & 0xf000) == 0x9000) { - INT32 bit = !(address >> 11) & 1; - namcoio_set_reset_line(0, bit); - namcoio_set_reset_line(1, bit); - return; - } - - if ((address & 0xf800) == 0xa000) { - starfield_control[address & 3] = data; - return; - } -} - -static UINT8 gaplus_main_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x6000) { - return namco_15xx_sharedram_read(address); - } - - if ((address & 0xfff0) == 0x6800) { - return namcoio_read(0, address & 0xf); - } - - if ((address & 0xfff0) == 0x6810) { - return namcoio_read(1, address & 0xf); - } - - if ((address & 0xfff0) == 0x6820) { - INT32 mode = custom_io[8]; - - switch (address & 0xf) - { - case 0: return DrvDips[4]; // in2 - case 1: return (mode == 2) ? custom_io[1] : 0xf; - case 2: return (mode == 2) ? 0xf : 0xe; - case 3: return (mode == 2) ? custom_io[3] : 0x1; - } - - return custom_io[address & 0xf]; - } - - if ((address & 0xf800) == 0x7800) { - watchdog = 0; - return 0; - } - - return 0; -} - -static void gaplus_sub_write(UINT16 address, UINT8 /*data*/) -{ - if ((address & 0xf000) == 0x6000) { - sub_irq_mask = address & 1; - if (sub_irq_mask == 0) M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} -static void gaplus_sub2_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x0000) { - namco_15xx_sharedram_write(address,data); - return; - } - - if ((address & 0xe000) == 0x2000) { - watchdog = 0; - return; - } - - if ((address & 0xc000) == 0x4000) { - sub2_irq_mask = (~address >> 13) & 1; - if (sub2_irq_mask == 0) M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static UINT8 gaplus_sub2_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x0000) { - return namco_15xx_sharedram_read(address); - } - - if ((address & 0xe000) == 0x6800) { - watchdog = 0; - return 0; - } - - return 0; -} - -static tilemap_scan( background ) -{ - INT32 offs; - - row += 2; - col -= 2; - if (col & 0x20) - offs = row + ((col & 0x1f) << 5); - else - offs = col + (row << 5); - - return offs; -} - -static tilemap_callback( background ) -{ - UINT8 code = DrvVidRAM[offs]; - UINT8 attr = DrvVidRAM[offs + 0x400]; - - TILE_SET_INFO(0, code + ((attr & 0x80) << 1), attr, TILE_GROUP((attr >> 6) & 1)); -} - -static UINT8 nio0_i0(UINT8) { return DrvInputs[3]; } -static UINT8 nio0_i1(UINT8) { return DrvInputs[0]; } -static UINT8 nio0_i2(UINT8) { return DrvInputs[1]; } -static UINT8 nio0_i3(UINT8) { return DrvInputs[2]; } -static UINT8 nio1_i0(UINT8) { return DrvDips[1]; } -static UINT8 nio1_i1(UINT8) { return DrvDips[0]; } -static UINT8 nio1_i2(UINT8) { return DrvDips[3]; } -static UINT8 nio1_i3(UINT8) { return DrvDips[2]; } - -static void starfield_init() -{ - struct star *stars = m_stars; - INT32 generator = 0; - INT32 set = 0; - - total_stars = 0; - - for (INT32 y = 0; y < nScreenHeight; y++) - { - for (INT32 x = nScreenWidth*2 - 1; x >= 0; x--) - { - generator <<= 1; - INT32 bit1 = (~generator >> 17) & 1; - INT32 bit2 = (generator >> 5) & 1; - - if (bit1 ^ bit2) generator |= 1; - - if (((~generator >> 16) & 1) && (generator & 0xff) == 0xff) { - int color; - - color = (~(generator >> 8)) & 0x3f; - if (color && total_stars < 240) { - stars[total_stars].x = x; - stars[total_stars].y = y; - stars[total_stars].col = color; - stars[total_stars].set = set++; - - if (set == 3) set = 0; - - total_stars++; - } - } - } - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - NamcoSoundReset(); - BurnSampleReset(); - M6809Close(); - - M6809Open(2); - M6809Reset(); - M6809Close(); - - namcoio_reset(0); - namcoio_reset(1); - - main_irq_mask = 0; - sub_irq_mask = 0; - sub2_irq_mask = 0; - memset (custom_io, 0, 16); - memset (starfield_control, 0, 4); - - sub_cpu_in_reset = 1; // by default - sub2_cpu_in_reset = 0; - watchdog = 0; - flipscreen = 0; - - starfield_init(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x006000; - DrvM6809ROM1 = Next; Next += 0x006000; - DrvM6809ROM2 = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000800; - - NamcoSoundProm = Next; - DrvSndPROM = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 4, 6 }; - INT32 Plane1[3] = { 0x6000*8, 0, 4 }; - INT32 XOffs0[ 8] = { 16*8, 16*8+1, 24*8, 24*8+1, 0, 1, 8*8, 8*8+1 }; - INT32 XOffs1[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); // 2nd decode tries to access out of bounds w/0xc000 - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x0200, 2, 8, 8, Plane0, XOffs0, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0xc000); - - GfxDecode(0x0200, 3, 16, 16, Plane1, XOffs1, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit(INT32 gaplusd) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM1 + 0x2000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM1 + 0x4000, 5, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM2 + 0x0000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x6000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0300, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0400, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0600, 17, 1)) return 1; - - if (BurnLoadRom(DrvSndPROM + 0x0000, 18, 1)) return 1; - - for (INT32 i = 0; i < 0x200; i++) { // merge nibbles - DrvColPROM[0x400+i] = (DrvColPROM[0x400+i] & 0xf) | (DrvColPROM[0x600+i] << 4); - } - - for (INT32 i = 0; i < 0x2000; i++) { - DrvGfxROM0[i + 0x2000] = DrvGfxROM0[i] >> 4; - DrvGfxROM1[i + 0x8000] = DrvGfxROM1[i + 0x6000] << 4; - } - - DrvGfxDecode(); - } - - M6809Init(3); - - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x0800, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0xa000, 0xffff, MAP_ROM); - M6809SetWriteHandler(gaplus_main_write); - M6809SetReadHandler(gaplus_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvVidRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x0800, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM1, 0xa000, 0xffff, MAP_ROM); - M6809SetWriteHandler(gaplus_sub_write); - M6809Close(); - - M6809Open(2); - M6809MapMemory(DrvM6809ROM2, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(gaplus_sub2_write); - M6809SetReadHandler(gaplus_sub2_read); - M6809Close(); - - NamcoSoundInit(24000, 8, 0); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.25, BURN_SND_ROUTE_BOTH); - - namcoio_init(0, gaplusd ? NAMCO58xx : NAMCO56xx, nio0_i0, nio0_i1, nio0_i2, nio0_i3, NULL, NULL); // lamps not hooked up - namcoio_init(1, gaplusd ? NAMCO56xx : NAMCO58xx, nio1_i0, nio1_i1, nio1_i2, nio1_i3, NULL, NULL); - - GenericTilesInit(); - GenericTilemapInit(0, background_map_scan, background_map_callback, 8, 8, 36, 28); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x4000*4, 0, 0x3f); - GenericTilemapSetTransparent(0, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - - BurnSampleExit(); - NamcoSoundExit(); - NamcoSoundProm = NULL; - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pal[0x100]; - - for (INT32 i = 0; i < 256; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x200] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x200] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x200] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x200] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - pal[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 4 * 64; i++) { - DrvPalette[i] = pal[0xf0 | (DrvColPROM[i+0x300] & 0xf)]; - } - - for (INT32 i = 0; i < 8 * 64; i++) { - DrvPalette[0x100+i] = pal[DrvColPROM[0x400+i]]; - } -} - -static void draw_sprites() -{ - UINT8 *spriteram = DrvSprRAM + 0x780; - UINT8 *spriteram_2 = spriteram + 0x800; - UINT8 *spriteram_3 = spriteram_2 + 0x800; - - for (INT32 offs = 0; offs < 0x80; offs += 2) - { - if ((spriteram_3[offs+1] & 2) == 0) - { - static const int gfx_offs[2][2] = { - { 0, 1 }, - { 2, 3 } - }; - INT32 sprite = spriteram[offs] | ((spriteram_3[offs] & 0x40) << 2); - INT32 color = spriteram[offs+1] & 0x3f; - INT32 sx = spriteram_2[offs+1] + 0x100 * (spriteram_3[offs+1] & 1) - 71; - INT32 sy = 256 - spriteram_2[offs] - 8; - INT32 flipx = (spriteram_3[offs] & 0x01); - INT32 flipy = (spriteram_3[offs] & 0x02) >> 1; - INT32 sizex = (spriteram_3[offs] & 0x08) >> 3; - INT32 sizey = (spriteram_3[offs] & 0x20) >> 5; - INT32 duplicate = spriteram_3[offs] & 0x80; - - if (flipscreen) - { - flipx ^= 1; - flipy ^= 1; - } - - sy = ((sy - 16 * sizey) & 0xff) - 32; - - for (INT32 y = 0;y <= sizey;y++) - { - for (INT32 x = 0;x <= sizex;x++) - { - INT32 code = sprite + (duplicate ? 0 : (gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)])); - - RenderTileTranstab(pTransDraw, DrvGfxROM1, code, (color*8)+0x100, 0xff, sx + 16 * x, sy + 16 * y, flipx, flipy, 16, 16, DrvColPROM + 0x300); - } - } - } - } -} - -static void starfield_render() -{ - struct star *stars = m_stars; - - if ((starfield_control[0] & 1) == 0) - return; - - for (INT32 i = 0; i < total_stars; i++) - { - INT32 x = (INT32)stars[i].x; - INT32 y = (INT32)stars[i].y; - - if (x >=0 && x < nScreenWidth && y >= 0 && y < nScreenHeight) - { - pTransDraw[(y * nScreenWidth) + x] = stars[i].col; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - flipscreen = DrvSprRAM[0x1f7f-0x800] & 1; - GenericTilemapSetFlip(0, flipscreen); - - BurnTransferClear(); - - if (nBurnLayer & 1) starfield_render(); - - if (nBurnLayer & 2) GenericTilemapDraw(0, pTransDraw, 0); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(1)); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void vblank_update() -{ - struct star *stars = m_stars; - - if ((starfield_control[0] & 1) == 0) - return; - - for (INT32 i = 0; i < total_stars; i++) - { - switch (starfield_control[stars[i].set + 1]) - { - case 0x86: stars[i].x += 0.5f; break; - case 0x85: stars[i].x += 1.0f; break; - case 0x06: stars[i].x += 2.0f; break; - case 0x80: stars[i].x -= 0.5f; break; - case 0x82: stars[i].x -= 1.0f; break; - case 0x81: stars[i].x -= 2.0f; break; - case 0x9f: stars[i].y += 1.0f; break; - case 0xaf: stars[i].y += 0.5f; break; - } - - if (stars[i].x < 0) stars[i].x = (float)(nScreenWidth*2 ) + stars[i].x; - if (stars[i].x >= (float)(nScreenWidth*2)) stars[i].x -= (float)(nScreenWidth*2); - if (stars[i].y < 0) stars[i].y = (float)(nScreenHeight) + stars[i].y; - if (stars[i].y >= (float)(nScreenHeight)) stars[i].y -= (float)(nScreenHeight); - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nInterleave = 264; - INT32 nCyclesTotal[3] = { (INT32)((double)1536000 / 60.606061), (INT32)((double)1536000 / 60.606061), (INT32)((double)1536000 / 60.606061) }; - INT32 nCyclesDone[3] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = 0; - - M6809Open(0); - nCyclesDone[0] += M6809Run((nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i)); - if (i == (nInterleave - 1)) - { - if (main_irq_mask) - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - - vblank_update(); - - if (!namcoio_read_reset_line(0)) - namcoio_run(0); - - if (!namcoio_read_reset_line(1)) - namcoio_run(1); - } - nSegment = M6809TotalCycles(); - M6809Close(); - - if (sub_cpu_in_reset) { - nCyclesDone[1] += nSegment - nCyclesDone[1]; - } else { - M6809Open(1); - nCyclesDone[1] += M6809Run(nSegment - nCyclesDone[1]); - if (i == nInterleave-1 && sub_irq_mask) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - } - - if (sub2_cpu_in_reset) { - nCyclesDone[2] += nSegment - nCyclesDone[2]; - } else { - M6809Open(2); - nCyclesDone[2] += M6809Run(nSegment - nCyclesDone[2]); - if (i == nInterleave-1 && sub_irq_mask) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - } - } - - if (pBurnSoundOut) { - NamcoSoundUpdate(pBurnSoundOut, nBurnSoundLen); - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - NamcoSoundScan(nAction, pnMin); - BurnSampleScan(nAction, pnMin); - namcoio_scan(0); - namcoio_scan(1); - - SCAN_VAR(sub_cpu_in_reset); - SCAN_VAR(sub2_cpu_in_reset); - SCAN_VAR(main_irq_mask); - SCAN_VAR(sub_irq_mask); - SCAN_VAR(sub2_irq_mask); - SCAN_VAR(flipscreen); - SCAN_VAR(custom_io); - SCAN_VAR(starfield_control); - } - - return 0; -} - -static struct BurnSampleInfo GaplusSampleDesc[] = { - { "bang", SAMPLE_NOLOOP }, - { "", 0 } -}; - -STD_SAMPLE_PICK(Gaplus) -STD_SAMPLE_FN(Gaplus) - - -// Gaplus (GP2 rev. B) - -static struct BurnRomInfo gaplusRomDesc[] = { - { "gp2-4.8d", 0x2000, 0xe525d75d, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gp2-3b.8c", 0x2000, 0xd77840a4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gp2-2b.8b", 0x2000, 0xb3cb90db, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gp2-8.11d", 0x2000, 0x42b9fd7c, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "gp2-7.11c", 0x2000, 0x0621f7df, 2 | BRF_PRG | BRF_ESS }, // 4 - { "gp2-6.11b", 0x2000, 0x75b18652, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gp2-1.4b", 0x2000, 0xed8aa206, 3 | BRF_GRA }, // 6 M6809 #2 Code - - { "gp2-5.8s", 0x2000, 0xf3d19987, 4 | BRF_GRA }, // 7 Background Tiles - - { "gp2-11.11p", 0x2000, 0x57740ff9, 5 | BRF_GRA }, // 8 Sprites - { "gp2-10.11n", 0x2000, 0x6cd8ce11, 5 | BRF_GRA }, // 9 - { "gp2-12.11r", 0x2000, 0x7316a1f1, 5 | BRF_GRA }, // 10 - { "gp2-9.11m", 0x2000, 0xe6a9ae67, 5 | BRF_GRA }, // 11 - - { "gp2-3.1p", 0x0100, 0xa5091352, 6 | BRF_GRA }, // 12 Color Data - { "gp2-1.1n", 0x0100, 0x8bc8022a, 6 | BRF_GRA }, // 13 - { "gp2-2.2n", 0x0100, 0x8dabc20b, 6 | BRF_GRA }, // 14 - { "gp2-7.6s", 0x0100, 0x2faa3e09, 6 | BRF_GRA }, // 15 - { "gp2-6.6p", 0x0200, 0x6f99c2da, 6 | BRF_GRA }, // 16 - { "gp2-5.6n", 0x0200, 0xc7d31657, 6 | BRF_GRA }, // 17 - - { "gp2-4.3f", 0x0100, 0x2d9fbdd8, 7 | BRF_GRA }, // 18 Sound Prom - - { "pal10l8.8n", 0x002c, 0x08e5b2fe, 0 | BRF_OPT }, // 19 plds -}; - -STD_ROM_PICK(gaplus) -STD_ROM_FN(gaplus) - -static INT32 GaplusInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvGaplus = { - "gaplus", NULL, NULL, "gaplus", "1984", - "Gaplus (GP2 rev. B)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, gaplusRomInfo, gaplusRomName, GaplusSampleInfo, GaplusSampleName, GaplusInputInfo, GaplusDIPInfo, - GaplusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Gaplus (GP2) - -static struct BurnRomInfo gaplusaRomDesc[] = { - { "gp2-4.8d", 0x2000, 0xe525d75d, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gp2-3b.8c", 0x2000, 0xd77840a4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gp2-2.8b", 0x2000, 0x61f6cc65, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gp2-8.11d", 0x2000, 0x42b9fd7c, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "gp2-7.11c", 0x2000, 0x0621f7df, 2 | BRF_PRG | BRF_ESS }, // 4 - { "gp2-6.11b", 0x2000, 0x75b18652, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gp2-1.4b", 0x2000, 0xed8aa206, 3 | BRF_GRA }, // 6 M6809 #2 Code - - { "gp2-5.8s", 0x2000, 0xf3d19987, 4 | BRF_GRA }, // 7 Background Tiles - - { "gp2-11.11p", 0x2000, 0x57740ff9, 5 | BRF_GRA }, // 8 Sprites - { "gp2-10.11n", 0x2000, 0x6cd8ce11, 5 | BRF_GRA }, // 9 - { "gp2-12.11r", 0x2000, 0x7316a1f1, 5 | BRF_GRA }, // 10 - { "gp2-9.11m", 0x2000, 0xe6a9ae67, 5 | BRF_GRA }, // 11 - - { "gp2-3.1p", 0x0100, 0xa5091352, 6 | BRF_GRA }, // 12 Color Data - { "gp2-1.1n", 0x0100, 0x8bc8022a, 6 | BRF_GRA }, // 13 - { "gp2-2.2n", 0x0100, 0x8dabc20b, 6 | BRF_GRA }, // 14 - { "gp2-7.6s", 0x0100, 0x2faa3e09, 6 | BRF_GRA }, // 15 - { "gp2-6.6p", 0x0200, 0x6f99c2da, 6 | BRF_GRA }, // 16 - { "gp2-5.6n", 0x0200, 0xc7d31657, 6 | BRF_GRA }, // 17 - - { "gp2-4.3f", 0x0100, 0x2d9fbdd8, 7 | BRF_GRA }, // 18 Sound Prom - - { "pal10l8.8n", 0x002c, 0x08e5b2fe, 0 | BRF_OPT }, // 19 plds -}; - -STD_ROM_PICK(gaplusa) -STD_ROM_FN(gaplusa) - -struct BurnDriver BurnDrvGaplusa = { - "gaplusa", "gaplus", NULL, "gaplus", "1984", - "Gaplus (GP2)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, gaplusaRomInfo, gaplusaRomName, GaplusSampleInfo, GaplusSampleName, GaplusInputInfo, GaplusDIPInfo, - GaplusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Gaplus (GP2 rev D, alternate hardware) - -static struct BurnRomInfo gaplusdRomDesc[] = { - { "gp2-4b.8d", 0x2000, 0x484f11e0, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gp2-3c.8c", 0x2000, 0xa74b0266, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gp2-2d.8b", 0x2000, 0x69fdfdb7, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gp2-8b.11d", 0x2000, 0xbff601a6, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "gp2-7.11c", 0x2000, 0x0621f7df, 2 | BRF_PRG | BRF_ESS }, // 4 - { "gp2-6b.11b", 0x2000, 0x14cd61ea, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gp2-1.4b", 0x2000, 0xed8aa206, 3 | BRF_GRA }, // 6 M6809 #2 Code - - { "gp2-5.8s", 0x2000, 0xf3d19987, 4 | BRF_GRA }, // 7 Background Tiles - - { "gp2-11.11p", 0x2000, 0x57740ff9, 5 | BRF_GRA }, // 8 Sprites - { "gp2-10.11n", 0x2000, 0x6cd8ce11, 5 | BRF_GRA }, // 9 - { "gp2-12.11r", 0x2000, 0x7316a1f1, 5 | BRF_GRA }, // 10 - { "gp2-9.11m", 0x2000, 0xe6a9ae67, 5 | BRF_GRA }, // 11 - - { "gp2-3.1p", 0x0100, 0xa5091352, 6 | BRF_GRA }, // 12 Color Data - { "gp2-1.1n", 0x0100, 0x8bc8022a, 6 | BRF_GRA }, // 13 - { "gp2-2.2n", 0x0100, 0x8dabc20b, 6 | BRF_GRA }, // 14 - { "gp2-7.6s", 0x0100, 0x2faa3e09, 6 | BRF_GRA }, // 15 - { "gp2-6.6p", 0x0200, 0x6f99c2da, 6 | BRF_GRA }, // 16 - { "gp2-5.6n", 0x0200, 0xc7d31657, 6 | BRF_GRA }, // 17 - - { "gp2-4.3f", 0x0100, 0x2d9fbdd8, 7 | BRF_GRA }, // 18 Sound Prom - - { "pal10l8.8n", 0x002c, 0x08e5b2fe, 0 | BRF_OPT }, // 19 plds -}; - -STD_ROM_PICK(gaplusd) -STD_ROM_FN(gaplusd) - -static INT32 GaplusdInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvGaplusd = { - "gaplusd", "gaplus", NULL, "gaplus", "1984", - "Gaplus (GP2 rev D, alternate hardware)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, gaplusdRomInfo, gaplusdRomName, GaplusSampleInfo, GaplusSampleName, GaplusInputInfo, GaplusDIPInfo, - GaplusdInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Gaplus (Tecfri PCB) - -static struct BurnRomInfo gaplustRomDesc[] = { - { "gp2_4.4", 0x2000, 0xd891a70d, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gp2_3.3", 0x2000, 0x1df6e319, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gp2_2.2", 0x2000, 0xfc764728, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gp2_8.8", 0x2000, 0x9ec3dce5, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "gp2_7.7", 0x2000, 0x0621f7df, 2 | BRF_PRG | BRF_ESS }, // 4 - { "gp2_6.6", 0x2000, 0x6a2942c5, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gp2-1.4b", 0x2000, 0xed8aa206, 3 | BRF_GRA }, // 6 M6809 #2 Code - - { "gp2-5.8s", 0x2000, 0xf3d19987, 4 | BRF_GRA }, // 7 Background Tiles - - { "gp2-11.11p", 0x2000, 0x57740ff9, 5 | BRF_GRA }, // 8 Sprites - { "gp2-10.11n", 0x2000, 0x6cd8ce11, 5 | BRF_GRA }, // 9 - { "gp2-12.11r", 0x2000, 0x7316a1f1, 5 | BRF_GRA }, // 10 - { "gp2-9.11m", 0x2000, 0xe6a9ae67, 5 | BRF_GRA }, // 11 - - { "gp2-3.1p", 0x0100, 0xa5091352, 6 | BRF_GRA }, // 12 Color Data - { "gp2-1.1n", 0x0100, 0x8bc8022a, 6 | BRF_GRA }, // 13 - { "gp2-2.2n", 0x0100, 0x8dabc20b, 6 | BRF_GRA }, // 14 - { "gp2-7.6s", 0x0100, 0x2faa3e09, 6 | BRF_GRA }, // 15 - { "gp2-6.6p", 0x0200, 0x6f99c2da, 6 | BRF_GRA }, // 16 - { "gp2-5.6n", 0x0200, 0xc7d31657, 6 | BRF_GRA }, // 17 - - { "gp2-4.3f", 0x0100, 0x2d9fbdd8, 7 | BRF_GRA }, // 18 Sound Prom - - { "pal10l8.8n", 0x002c, 0x08e5b2fe, 0 | BRF_OPT }, // 19 plds -}; - -STD_ROM_PICK(gaplust) -STD_ROM_FN(gaplust) - -struct BurnDriver BurnDrvGaplust = { - "gaplust", "gaplus", NULL, "gaplus", "1992", - "Gaplus (Tecfri PCB)\0", NULL, "bootleg (Tecfri)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, gaplustRomInfo, gaplustRomName, GaplusSampleInfo, GaplusSampleName, GaplusInputInfo, GaplusDIPInfo, - GaplusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Galaga 3 (GP3 rev. D) - -static struct BurnRomInfo galaga3RomDesc[] = { - { "gp3-4c.8d", 0x2000, 0x10d7f64c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gp3-3c.8c", 0x2000, 0x962411e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gp3-2d.8b", 0x2000, 0xecc01bdb, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gp3-8b.11d", 0x2000, 0xf5e056d1, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "gp2-7.11c", 0x2000, 0x0621f7df, 2 | BRF_PRG | BRF_ESS }, // 4 - { "gp3-6b.11b", 0x2000, 0x026491b6, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gp2-1.4b", 0x2000, 0xed8aa206, 3 | BRF_GRA }, // 6 M6809 #2 Code - - { "gp3-5.8s", 0x2000, 0x8d4dcebf, 4 | BRF_GRA }, // 7 Background Tiles - - { "gp2-11.11p", 0x2000, 0x57740ff9, 5 | BRF_GRA }, // 8 Sprites - { "gp2-10.11n", 0x2000, 0x6cd8ce11, 5 | BRF_GRA }, // 9 - { "gp2-12.11r", 0x2000, 0x7316a1f1, 5 | BRF_GRA }, // 10 - { "gp2-9.11m", 0x2000, 0xe6a9ae67, 5 | BRF_GRA }, // 11 - - { "gp2-3.1p", 0x0100, 0xa5091352, 6 | BRF_GRA }, // 12 Color Data - { "gp2-1.1n", 0x0100, 0x8bc8022a, 6 | BRF_GRA }, // 13 - { "gp2-2.2n", 0x0100, 0x8dabc20b, 6 | BRF_GRA }, // 14 - { "gp2-7.6s", 0x0100, 0x2faa3e09, 6 | BRF_GRA }, // 15 - { "gp3-6.6p", 0x0200, 0xd48c0eef, 6 | BRF_GRA }, // 16 - { "gp3-5.6n", 0x0200, 0x417ba0dc, 6 | BRF_GRA }, // 17 - - { "gp2-4.3f", 0x0100, 0x2d9fbdd8, 7 | BRF_GRA }, // 18 Sound Prom - - { "pal10l8.8n", 0x002c, 0x08e5b2fe, 0 | BRF_OPT }, // 19 plds -}; - -STD_ROM_PICK(galaga3) -STD_ROM_FN(galaga3) - -struct BurnDriver BurnDrvGalaga3 = { - "galaga3", "gaplus", NULL,"gaplus", "1984", - "Galaga 3 (GP3 rev. D)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, galaga3RomInfo, galaga3RomName, GaplusSampleInfo, GaplusSampleName, GaplusInputInfo, GaplusDIPInfo, - GaplusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Galaga 3 (GP3 rev. C) - -static struct BurnRomInfo galaga3aRomDesc[] = { - { "gp3-4c.8d", 0x2000, 0x10d7f64c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gp3-3c.8c", 0x2000, 0x962411e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gp3-2c.8b", 0x2000, 0xf72d6fc5, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gp3-8b.11d", 0x2000, 0xf5e056d1, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "gp2-7.11c", 0x2000, 0x0621f7df, 2 | BRF_PRG | BRF_ESS }, // 4 - { "gp3-6b.11b", 0x2000, 0x026491b6, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gp2-1.4b", 0x2000, 0xed8aa206, 3 | BRF_GRA }, // 6 M6809 #2 Code - - { "gp3-5.8s", 0x2000, 0x8d4dcebf, 4 | BRF_GRA }, // 7 Background Tiles - - { "gp2-11.11p", 0x2000, 0x57740ff9, 5 | BRF_GRA }, // 8 Sprites - { "gp2-10.11n", 0x2000, 0x6cd8ce11, 5 | BRF_GRA }, // 9 - { "gp2-12.11r", 0x2000, 0x7316a1f1, 5 | BRF_GRA }, // 10 - { "gp2-9.11m", 0x2000, 0xe6a9ae67, 5 | BRF_GRA }, // 11 - - { "gp2-3.1p", 0x0100, 0xa5091352, 6 | BRF_GRA }, // 12 Color Data - { "gp2-1.1n", 0x0100, 0x8bc8022a, 6 | BRF_GRA }, // 13 - { "gp2-2.2n", 0x0100, 0x8dabc20b, 6 | BRF_GRA }, // 14 - { "gp2-7.6s", 0x0100, 0x2faa3e09, 6 | BRF_GRA }, // 15 - { "gp3-6.6p", 0x0200, 0xd48c0eef, 6 | BRF_GRA }, // 16 - { "gp3-5.6n", 0x0200, 0x417ba0dc, 6 | BRF_GRA }, // 17 - - { "gp2-4.3f", 0x0100, 0x2d9fbdd8, 7 | BRF_GRA }, // 18 Sound Prom - - { "pal10l8.8n", 0x002c, 0x08e5b2fe, 0 | BRF_OPT }, // 19 plds -}; - -STD_ROM_PICK(galaga3a) -STD_ROM_FN(galaga3a) - -struct BurnDriver BurnDrvGalaga3a = { - "galaga3a", "gaplus", NULL, "gaplus", "1984", - "Galaga 3 (GP3 rev. C)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, galaga3aRomInfo, galaga3aRomName, GaplusSampleInfo, GaplusSampleName, GaplusInputInfo, GaplusDIPInfo, - GaplusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Galaga 3 (GP3) - -static struct BurnRomInfo galaga3bRomDesc[] = { - { "gp3-4.8d", 0x2000, 0x58de387c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gp3-3.8c", 0x2000, 0x94a3fd4e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gp3-2.8b", 0x2000, 0x4b1cb589, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gp3-8.11d", 0x2000, 0xd390ef28, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "gp2-7.11c", 0x2000, 0x0621f7df, 2 | BRF_PRG | BRF_ESS }, // 4 - { "gp3-6.11b", 0x2000, 0xb36a9a2b, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gp2-1.4b", 0x2000, 0xed8aa206, 3 | BRF_GRA }, // 6 M6809 #2 Code - - { "gp3-5.8s", 0x2000, 0x8d4dcebf, 4 | BRF_GRA }, // 7 Background Tiles - - { "gp2-11.11p", 0x2000, 0x57740ff9, 5 | BRF_GRA }, // 8 Sprites - { "gp2-10.11n", 0x2000, 0x6cd8ce11, 5 | BRF_GRA }, // 9 - { "gp2-12.11r", 0x2000, 0x7316a1f1, 5 | BRF_GRA }, // 10 - { "gp2-9.11m", 0x2000, 0xe6a9ae67, 5 | BRF_GRA }, // 11 - - { "gp2-3.1p", 0x0100, 0xa5091352, 6 | BRF_GRA }, // 12 Color Data - { "gp2-1.1n", 0x0100, 0x8bc8022a, 6 | BRF_GRA }, // 13 - { "gp2-2.2n", 0x0100, 0x8dabc20b, 6 | BRF_GRA }, // 14 - { "gp2-7.6s", 0x0100, 0x2faa3e09, 6 | BRF_GRA }, // 15 - { "gp3-6.6p", 0x0200, 0xd48c0eef, 6 | BRF_GRA }, // 16 - { "gp3-5.6n", 0x0200, 0x417ba0dc, 6 | BRF_GRA }, // 17 - - { "gp2-4.3f", 0x0100, 0x2d9fbdd8, 7 | BRF_GRA }, // 18 Sound Prom - - { "pal10l8.8n", 0x002c, 0x08e5b2fe, 0 | BRF_OPT }, // 19 plds -}; - -STD_ROM_PICK(galaga3b) -STD_ROM_FN(galaga3b) - -struct BurnDriver BurnDrvGalaga3b = { - "galaga3b", "gaplus", NULL, "gaplus", "1984", - "Galaga 3 (GP3)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, galaga3bRomInfo, galaga3bRomName, GaplusSampleInfo, GaplusSampleName, GaplusInputInfo, GaplusDIPInfo, - GaplusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Galaga 3 (set 4) - -static struct BurnRomInfo galaga3cRomDesc[] = { - { "gal3_9e.9e", 0x2000, 0xf4845e7f, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gal3_9d.9d", 0x2000, 0x86fac687, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gal3_9c.9c", 0x2000, 0xf1b00073, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gal3_6l.6l", 0x2000, 0x9ec3dce5, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "gal3_6m.6m", 0x2000, 0x0621f7df, 2 | BRF_PRG | BRF_ESS }, // 4 - { "gal3_6n.6n", 0x2000, 0x6a2942c5, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gp2-1.7b", 0x2000, 0xed8aa206, 3 | BRF_GRA }, // 6 M6809 #2 Code - - { "gal3_9l.bin", 0x2000, 0x8d4dcebf, 4 | BRF_GRA }, // 7 Background Tiles - - { "gp2-11.5m", 0x2000, 0x57740ff9, 5 | BRF_GRA }, // 8 Sprites - { "gp2-10.5l", 0x2000, 0x6cd8ce11, 5 | BRF_GRA }, // 9 - { "gp2-12.5k", 0x2000, 0x7316a1f1, 5 | BRF_GRA }, // 10 - { "gp2-9.5n", 0x2000, 0xe6a9ae67, 5 | BRF_GRA }, // 11 - - { "gp2-3.1c", 0x0100, 0xa5091352, 6 | BRF_GRA }, // 12 Color Data - { "gp2-1.1d", 0x0100, 0x8bc8022a, 6 | BRF_GRA }, // 13 - { "gp2-2.2d", 0x0100, 0x8dabc20b, 6 | BRF_GRA }, // 14 - { "gp2-7.4f", 0x0100, 0x2faa3e09, 6 | BRF_GRA }, // 15 - { "g3_3f.3f", 0x0200, 0xd48c0eef, 6 | BRF_GRA }, // 16 - { "g3_3e.3e", 0x0200, 0x417ba0dc, 6 | BRF_GRA }, // 17 - - { "gp2-4.3f", 0x0100, 0x2d9fbdd8, 7 | BRF_GRA }, // 18 Sound Prom -}; - -STD_ROM_PICK(galaga3c) -STD_ROM_FN(galaga3c) - -struct BurnDriver BurnDrvGalaga3c = { - "galaga3c", "gaplus", NULL, "gaplus", "1984", - "Galaga 3 (set 4)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, galaga3cRomInfo, galaga3cRomName, GaplusSampleInfo, GaplusSampleName, GaplusInputInfo, GaplusDIPInfo, - GaplusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Galaga 3 (set 5) - -static struct BurnRomInfo galaga3mRomDesc[] = { - { "m1.9e", 0x2000, 0xe392704e, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "m2.9d", 0x2000, 0x86fac687, 1 | BRF_PRG | BRF_ESS }, // 1 - { "m3.9c", 0x2000, 0xf1b00073, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "m6.6l", 0x2000, 0x9ec3dce5, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - { "m5.6m", 0x2000, 0x0621f7df, 2 | BRF_PRG | BRF_ESS }, // 4 - { "m4.6n", 0x2000, 0x6a2942c5, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "gp2-1.7b", 0x2000, 0xed8aa206, 3 | BRF_GRA }, // 6 M6809 #2 Code - - { "gal3_9l.bin", 0x2000, 0x8d4dcebf, 4 | BRF_GRA }, // 7 Background Tiles - - { "gp2-11.5m", 0x2000, 0x57740ff9, 5 | BRF_GRA }, // 8 Sprites - { "gp2-10.5l", 0x2000, 0x6cd8ce11, 5 | BRF_GRA }, // 9 - { "gp2-12.5k", 0x2000, 0x7316a1f1, 5 | BRF_GRA }, // 10 - { "gp2-9.5n", 0x2000, 0xe6a9ae67, 5 | BRF_GRA }, // 11 - - { "gp2-3.1c", 0x0100, 0xa5091352, 6 | BRF_GRA }, // 12 Color Data - { "gp2-1.1d", 0x0100, 0x8bc8022a, 6 | BRF_GRA }, // 13 - { "gp2-2.2d", 0x0100, 0x8dabc20b, 6 | BRF_GRA }, // 14 - { "gp2-7.4f", 0x0100, 0x2faa3e09, 6 | BRF_GRA }, // 15 - { "g3_3f.3f", 0x0200, 0xd48c0eef, 6 | BRF_GRA }, // 16 - { "g3_3e.3e", 0x0200, 0x417ba0dc, 6 | BRF_GRA }, // 17 - - { "gp2-4.3f", 0x0100, 0x2d9fbdd8, 7 | BRF_GRA }, // 18 Sound Prom -}; - -STD_ROM_PICK(galaga3m) -STD_ROM_FN(galaga3m) - -struct BurnDriver BurnDrvGalaga3m = { - "galaga3m", "gaplus", NULL, "gaplus", "1984", - "Galaga 3 (set 5)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, galaga3mRomInfo, galaga3mRomName, GaplusSampleInfo, GaplusSampleName, GaplusInputInfo, GaplusDIPInfo, - GaplusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_gauntlet.cpp b/jan/src/burn/drv/pre90s/d_gauntlet.cpp deleted file mode 100644 index 7c394f7b3..000000000 --- a/jan/src/burn/drv/pre90s/d_gauntlet.cpp +++ /dev/null @@ -1,2854 +0,0 @@ -// FB Alpha Gauntlet driver module -// Based on MAME driver by Aaron Giles - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "m6502_intf.h" -#include "burn_ym2151.h" -#include "pokey.h" - -//#define SNDCPUDBG - -#define USE_OWN_SLAPSTIC 1 - -#ifndef USE_OWN_SLAPSTIC - #include "slapstic.h" -#endif - -UINT8 *Drv68KRom = NULL; -static UINT8 *DrvEEPROM = NULL; - -#ifdef USE_OWN_SLAPSTIC -struct slapstic_params -{ - INT32 reset; - INT32 bank0, bank1, bank2, bank3; - INT32 disable; - INT32 ignore; - INT32 senable; - INT32 sbank0, sbank1, sbank2, sbank3; -}; - - - -/************************************* - * - * Constants - * - *************************************/ - -#define DISABLE_MASK 0x3ff0 -#define IGNORE_MASK 0x007f -#define UNKNOWN 0xffff - -enum state_type { ENABLED, DISABLED, IGNORE, SPECIAL }; - -#define LOG_SLAPSTIC 0 - - - -/************************************* - * - * The master table - * - *************************************/ - -static struct slapstic_params slapstic_table[18] = -{ - /* 137412-101 ESB/Tetris */ - { 0x0000, 0x0080, 0x0090, 0x00a0, 0x00b0, 0x1540,UNKNOWN, 0x1dfe, 0x1b5c, 0x1b5d, 0x1b5e, 0x1b5f }, - /* 137412-102 ???? */ - { 0x0000,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN }, - /* 137412-103 Marble Madness */ - { 0x0000, 0x0040, 0x0050, 0x0060, 0x0070, 0x34c0, 0x002d, 0x3d14, 0x3d24, 0x3d25, 0x3d26, 0x3d27 }, - /* 137412-104 Gauntlet */ -/* { 0x0000, 0x0020, 0x0028, 0x0030, 0x0038, 0x3d90, 0x0069, 0x3735, 0x3764, 0x3765, 0x3766, 0x3767 },*/ -/* EC990621 Gauntlet fix */ - { 0x0000, 0x0020, 0x0028, 0x0030, 0x0038, 0x3da0, 0x0069, 0x3735, 0x3764, 0x3765, 0x3766, 0x3767 }, -/* EC990621 end of Gauntlet fix */ - /* 137412-105 Indiana Jones/Paperboy */ - { 0x0000, 0x0010, 0x0014, 0x0018, 0x001c, 0x35b0, 0x003d, 0x0092, 0x00a4, 0x00a5, 0x00a6, 0x00a7 }, - /* 137412-106 Gauntlet II */ -/* { 0x0000, 0x0008, 0x000a, 0x000c, 0x000e, 0x3da0, 0x002b, 0x0052, 0x0064, 0x0065, 0x0066, 0x0067 },*/ -/* NS990620 Gauntlet II fix */ - { 0x0000, 0x0008, 0x000a, 0x000c, 0x000e, 0x3db0, 0x002b, 0x0052, 0x0064, 0x0065, 0x0066, 0x0067 }, -/* NS990620 end of Gauntlet II fix */ - /* 137412-107 Peter Packrat/Xybots/2-player Gauntlet/720 Degrees */ -/* { 0x0000, 0x0018, 0x001a, 0x001c, 0x001e, 0x00a0, 0x006b, 0x3d52, 0x3d64, 0x3d65, 0x3d66, 0x3d67 },*/ -/* NS990622 Xybots fix */ - { 0x0000, 0x0018, 0x001a, 0x001c, 0x001e, 0x00b0, 0x006b, 0x3d52, 0x3d64, 0x3d65, 0x3d66, 0x3d67 }, -/* NS990622 end of Xybots fix */ - /* 137412-108 Road Runner/Super Sprint */ - { 0x0000, 0x0028, 0x002a, 0x002c, 0x002e, 0x0060, 0x001f,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN }, - /* 137412-109 Championship Sprint */ - { 0x0000, 0x0008, 0x000a, 0x000c, 0x000e, 0x3da0, 0x002b, 0x0052, 0x0064, 0x0065, 0x0066, 0x0067 }, - /* 137412-110 Road Blasters/APB */ - { 0x0000, 0x0040, 0x0050, 0x0060, 0x0070, 0x34c0, 0x002d, 0x3d14, 0x3d24, 0x3d25, 0x3d26, 0x3d27 }, - /* 137412-111 Pit Fighter */ - { 0x0000, 0x0042, 0x0052, 0x0062, 0x0072,UNKNOWN, 0x000a,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN }, - /* 137412-112 ???? */ - { 0x0000,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN }, - /* 137412-113 ???? */ - { 0x0000,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN }, - /* 137412-114 ???? */ - { 0x0000,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN }, - /* 137412-115 ???? */ - { 0x0000,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN }, - /* 137412-116 Hydra/Cyberball 2072 Tournament */ - { 0x0000, 0x0044, 0x004c, 0x0054, 0x005c,UNKNOWN, 0x0069,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN }, - /* 137412-117 Race Drivin' */ - { 0x0000,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN }, - /* 137412-118 Vindicators II/Rampart */ -/* { 0x0000, 0x0014, 0x0034, 0x0054, 0x0074,UNKNOWN, 0x0002, 0x1950, 0x1958, 0x1960, 0x1968, 0x1970 },*/ -/* EC990622 Rampart fix */ - { 0x0000, 0x0014, 0x0034, 0x0054, 0x0074, 0x30e0, 0x0002, 0x1958, 0x1959, 0x195a, 0x195b, 0x195c }, -/* EC990622 end of Rampart fix */ -}; - - - -/************************************* - * - * Statics - * - *************************************/ - -static struct slapstic_params *slapstic; - -static enum state_type state; -static INT8 next_bank; -static INT8 extra_bank; -static INT8 current_bank; -static UINT8 version; - -#if LOG_SLAPSTIC - static void slapstic_log(INT32 offset); - static FILE *slapsticlog; -#else - #define slapstic_log(o) -#endif - - - -/************************************* - * - * Initialization - * - *************************************/ - -void slapstic_init(INT32 chip) -{ - /* only a small number of chips are known to exist */ - if (chip < 101 || chip > 118) - return; - - /* set up a pointer to the parameters */ - version = chip; - slapstic = slapstic_table + (chip - 101); - - /* reset the chip */ - state = ENABLED; - next_bank = extra_bank = -1; - - /* the 111 and later chips seem to reset to bank 0 */ - if (chip < 111) - current_bank = 3; - else - current_bank = 0; -} - - -void slapstic_reset(void) -{ - slapstic_init(version); -} - - - -/************************************* - * - * Returns active bank without tweaking - * - *************************************/ - -INT32 slapstic_bank(void) -{ - return current_bank; -} - - - -/************************************* - * - * Call this before every access - * - *************************************/ - -INT32 slapstic_tweak(INT32 offset) -{ - /* switch banks now if one is pending */ - if (next_bank != -1) - { - current_bank = next_bank; - next_bank = -1; - extra_bank = -1; - } - - /* state machine */ - switch (state) - { - /* ENABLED state: the chip has been activated and is ready for a bankswitch */ - case ENABLED: - if ((offset & DISABLE_MASK) == slapstic->disable) - { - state = DISABLED; - /* NS990620 Gauntlet II fix */ - if (extra_bank != -1) - next_bank = extra_bank; - /* NS990620 end of Gauntlet II fix */ - } - else if ((offset & IGNORE_MASK) == slapstic->ignore) - { - state = IGNORE; - } - else if (offset == slapstic->bank0) - { - state = DISABLED; - if (extra_bank == -1) - next_bank = 0; - else - next_bank = extra_bank; - } - else if (offset == slapstic->bank1) - { - state = DISABLED; - if (extra_bank == -1) - next_bank = 1; - else - next_bank = extra_bank; - } - else if (offset == slapstic->bank2) - { - state = DISABLED; - if (extra_bank == -1) - next_bank = 2; - else - next_bank = extra_bank; - } - else if (offset == slapstic->bank3) - { - state = DISABLED; - if (extra_bank == -1) - next_bank = 3; - else - next_bank = extra_bank; - } - else if (offset == slapstic->reset) - { - next_bank = -1; - extra_bank = -1; - } - /* This is the transition which has */ - /* not been verified on the HW yet */ - else if (offset == slapstic->senable) - { - state = SPECIAL; - } - break; - - /* DISABLED state: everything is ignored except a reset */ - case DISABLED: - if (offset == slapstic->reset) - { - state = ENABLED; - next_bank = -1; - extra_bank = -1; - } - break; - - /* IGNORE state: next access is interpreted differently */ - case IGNORE: - if (offset == slapstic->senable) - { - state = SPECIAL; - } - else - { - state = ENABLED; - } - break; - - /* SPECIAL state: the special alternate bank switch override method is being used */ - case SPECIAL: - if (offset == slapstic->sbank0) - { - state = ENABLED; - extra_bank = 0; - } - else if (offset == slapstic->sbank1) - { - state = ENABLED; - extra_bank = 1; - } - else if (offset == slapstic->sbank2) - { - state = ENABLED; - extra_bank = 2; - } - else if (offset == slapstic->sbank3) - { - state = ENABLED; - extra_bank = 3; - } - else if (offset == slapstic->reset) - { - state = ENABLED; - next_bank = -1; - extra_bank = -1; - } - else - { - state = ENABLED; - } - break; - } - - /* log this access */ - slapstic_log(offset); - - /* return the active bank */ - return current_bank; -} -#endif - -static UINT8 atarigen_slapstic_num; -static UINT8 *atarigen_slapstic; - -UINT8 __fastcall atarigen_slapstic_r(UINT32 a) -{ - INT32 offset = (a - 0x38000);// >> 1; -#ifdef USE_OWN_SLAPSTIC - INT32 bank = slapstic_tweak(offset / 2) * 0x2000; -#else - INT32 bank = SlapsticTweak(offset / 2) * 0x2000; -#endif - //return READ_WORD(&atarigen_slapstic[bank + (offset & 0x1fff)]); - //return atarigen_slapstic[bank + (offset & 0x1fff)]; - -// if (a & 1) { -// return atarigen_slapstic[bank + ((offset + 0) & 0x1fff)]; -// } else { -// return atarigen_slapstic[bank + ((offset + 1) & 0x1fff)]; -// } - - return atarigen_slapstic[(bank + (offset & 0x1fff)) ^ 1]; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Slapstic Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall atarigen_slapstic_w(UINT32 a, UINT8 d) -{ - //SlapsticTweak(offset / 2); - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Slapstic Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall atarigen_slapstic_r_word(UINT32 a) -{ -// UINT16 *Slapstic = (UINT16*)atarigen_slapstic; -// INT32 Offset = (a - 0x38000);// >> 1; -// INT32 Bank = SlapsticTweak(Offset / 2) * 0x2000; -// return Slapstic[Bank + ((Offset >> 1) & 0x1fff)]; - - SEK_DEF_READ_WORD(1, a); - return 0; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Slapstic Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall atarigen_slapstic_w_word(UINT32 a, UINT16 d) -{ - INT32 offset = (a - 0x38000);// >> 1; -#ifdef USE_OWN_SLAPSTIC - slapstic_tweak(offset / 2); -#else - SlapsticTweak(offset / 2); -#endif - return; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Slapstic Write word => %06X, %04X\n"), a, d); - } - } -} - -void atarigen_SlapsticReset(void) -{ -#ifdef USE_OWN_SLAPSTIC - if (atarigen_slapstic_num) slapstic_reset(); -#else - if (atarigen_slapstic_num) SlapsticReset(); -#endif -} - -void atarigen_SlapsticInit(INT32 base, INT32 chipnum) -{ - atarigen_slapstic_num = chipnum; - atarigen_slapstic = NULL; - if (chipnum) - { -#ifdef USE_OWN_SLAPSTIC - slapstic_init(chipnum); -#else - SlapsticInit(chipnum); -#endif - SekOpen(0); - SekMapHandler(1, base, base + 0x7fff, MAP_RAM); - SekSetReadByteHandler(1, atarigen_slapstic_r); - SekSetReadWordHandler(1, atarigen_slapstic_r_word); - SekSetWriteByteHandler(1, atarigen_slapstic_w); - SekSetWriteWordHandler(1, atarigen_slapstic_w_word); - SekClose(); - - atarigen_slapstic = (UINT8*)BurnMalloc(0x8000); - memcpy(atarigen_slapstic, Drv68KRom + 0x38000, 0x8000); - } -} - - - -static UINT8 eeprom_unlocked; - -void atarigen_eeprom_reset(void) -{ - eeprom_unlocked = 0; -} - -void atarigen_eeprom_init() -{ - memset(DrvEEPROM, 0xff, 0x1000); -} - -void atarigen_slapstic_exit() -{ - BurnFree(atarigen_slapstic); - -#ifndef USE_OWN_SLAPSTIC - SlapsticExit(); -#endif -} - - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -//static UINT8 DrvInputPort4[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort5[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -static UINT8 DrvDip[1] = {0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -//static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvM6502Rom = NULL; -static UINT8 *DrvM6502Ram = NULL; -//static UINT8 *DrvEEPROM = NULL; -static UINT8 *DrvPlayfieldRam = NULL; -static UINT8 *DrvMOSpriteRam = NULL; -static UINT8 *DrvAlphaRam = NULL; -static UINT8 *DrvMOSlipRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvMotionObjectTiles = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvVBlank; -static UINT16 DrvSoundResetVal; -static UINT8 DrvSoundCPUHalt; -static UINT8 DrvCPUtoSoundReady; -static UINT8 DrvSoundtoCPUReady; -static UINT8 DrvCPUtoSound; -static UINT8 DrvSoundtoCPU; -static INT16 DrvScrollX; -static INT16 DrvScrollY; -static UINT8 DrvTileBank; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -#define GAME_GAUNTLET 0 -#define GAME_GAUNTLET2 1 - -static UINT8 DrvGameType; - - - - -struct atarigen_modesc -{ - INT32 maxmo; /* maximum number of MO's */ - INT32 moskip; /* number of bytes per MO entry */ - INT32 mowordskip; /* number of bytes between MO words */ - INT32 ignoreword; /* ignore an entry if this word == 0xffff */ - INT32 linkword, linkshift, linkmask; /* link = (data[linkword >> linkshift) & linkmask */ - INT32 reverse; /* render in reverse link order */ -}; - -static struct atarigen_modesc *modesc; - -static UINT16 *displaylist; -static UINT16 *displaylist_end; -static UINT16 *displaylist_last; - -static INT32 atarigen_init_display_list (struct atarigen_modesc *_modesc) -{ - modesc = _modesc; - - displaylist = (UINT16*)BurnMalloc (modesc->maxmo * 10 * (/*Machine->drv->screen_height*/ 240 / 8) * sizeof(UINT16)); - if (!displaylist) - return 1; - - displaylist_end = displaylist; - displaylist_last = NULL; - - return 0; -} - -static void atarigen_update_display_list (UINT8 *base, INT32 start, INT32 scanline) -{ - INT32 link = start, match = 0, moskip = modesc->moskip, wordskip = modesc->mowordskip; - INT32 ignoreword = modesc->ignoreword; - UINT16 *d, *startd, *lastd; - UINT8 spritevisit[1024]; - - /* scanline 0 means first update */ - if (scanline <= 0) - { - displaylist_end = displaylist; - displaylist_last = NULL; - } - - /* set up local pointers */ - startd = d = displaylist_end; - lastd = displaylist_last; - - /* if the last list entries were on the same scanline, overwrite them */ - if (lastd) - { - if (*lastd == scanline) - d = startd = lastd; - else - match = 1; - } - - /* visit all the sprites and copy their data into the display list */ - memset (spritevisit, 0, sizeof (spritevisit)); - while (!spritevisit[link]) - { - UINT8 *modata = &base[link * moskip]; - UINT16 data[4]; - - /* bounds checking */ - if (d - displaylist >= modesc->maxmo * 5 * (/*Machine->drv->screen_height*/ 240 / 8)) - { -// if (errorlog) fprintf (errorlog, "Motion object list exceeded maximum\n"); - break; - } - - /* start with the scanline */ - *d++ = scanline; - - /* add the data words */ - data[0] = *d++ = modata[0] | (modata[1] << 8);//READ_WORD (&modata[0]); - data[1] = *d++ = modata[wordskip + 0] | (modata[wordskip + 1] << 8);//READ_WORD (&modata[wordskip]); - data[2] = *d++ = modata[(2 * wordskip) + 0] | (modata[(2 * wordskip) + 1] << 8);//READ_WORD (&modata[2 * wordskip]); - data[3] = *d++ = modata[(3 * wordskip) + 0] | (modata[(3 * wordskip) + 1] << 8);//READ_WORD (&modata[3 * wordskip]); - - /* is this one to ignore? */ - if (data[ignoreword] == 0xffff) - d -= 5; - - /* update our match status */ - else if (match) - { - lastd++; - if (*lastd++ != data[0] || *lastd++ != data[1] || *lastd++ != data[2] || *lastd++ != data[3]) - match = 0; - } - - /* link to the next object */ - spritevisit[link] = 1; - if (modesc->linkword >= 0) - link = (data[modesc->linkword] >> modesc->linkshift) & modesc->linkmask; - else - link = (link + 1) & modesc->linkmask; - } - - /* if we didn't match the last set of entries, update the counters */ - if (!match) - { - displaylist_end = d; - displaylist_last = startd; - } -} - -#define XCHARS 42 -#define YCHARS 30 - -#define XDIM (XCHARS*8) -#define YDIM (YCHARS*8) - -static void atarigen_render_display_list (/*struct osd_bitmap *bitmap, atarigen_morender morender, void *param*/) -{ - UINT16 *base = displaylist; - INT32 last_start_scan = -1; -// struct rectangle clip; - - INT32 xscroll = DrvScrollX; - UINT16 *AlphaRam = (UINT16*)DrvAlphaRam; - INT32 yscroll = BURN_ENDIAN_SWAP_INT16(AlphaRam[0xf6e >> 1]) >> 7; - yscroll &= 0x1ff; - - /* create a clipping rectangle so that only partial sections are updated at a time */ -// clip.min_x = 0; -// clip.max_x = Machine->drv->screen_width - 1; - -// INT32 xMin = 0; -// INT32 xMax = nScreenWidth - 1; - INT32 yMin = 0; - INT32 yMax = nScreenHeight - 1; - - /* loop over the list until the end */ - while (base < displaylist_end) - { - UINT16 *d, *first, *last; - INT32 start_scan = base[0], step; - - last_start_scan = start_scan; -// clip.min_y = start_scan; - yMin = start_scan; - - /* look for an entry whose scanline start is different from ours; that's our bottom */ - for (d = base; d < displaylist_end; d += 5) - if (*d != start_scan) - { -// clip.max_y = *d; - yMax = *d; - break; - } - - /* if we didn't find any additional regions, go until the bottom of the screen */ -// if (d == displaylist_end) -// clip.max_y = Machine->drv->screen_height - 1; - - if (d == displaylist_end) - yMax = nScreenHeight - 1; - - /* set the start and end points */ - if (modesc->reverse) - { - first = d - 5; - last = base - 5; - step = -5; - } - else - { - first = base; - last = d; - step = 5; - } - - /* update the base */ - base = d; - - /* render the mos */ - for (d = first; d != last; d += step) { - //(*morender)(bitmap, &clip, &d[1], param); - - UINT16 *data = &d[1]; - - INT32 sx, sy, x, y, xadv; - - /* extract data from the various words */ - INT32 pict = data[0] & 0x7fff; - INT32 color = (data[1] & 0x0f) | 0x10; - INT32 xpos = -xscroll + (data[1] >> 7); - INT32 vsize = (data[2] & 7) + 1; - INT32 hsize = ((data[2] >> 3) & 7) + 1; - INT32 hflip = data[2] & 0x40; - INT32 ypos = -yscroll - (data[2] >> 7) - vsize * 8; - - /* adjust for h flip */ - if (hflip) - xpos += (hsize - 1) * 8, xadv = -8; - else - xadv = 8; - - /* adjust the final coordinates */ - xpos &= 0x1ff; - ypos &= 0x1ff; - if (xpos >= XDIM) xpos -= 0x200; - if (ypos >= YDIM) ypos -= 0x200; - - /* loop over the height */ - for (y = 0, sy = ypos; y < vsize; y++, sy += 8) - { - /* clip the Y coordinate */ - if (sy <= /*clip->min_y*/ yMin - 8) - { - pict += hsize; - continue; - } - else if (sy > /*clip->max_y*/ yMax) - break; - - /* loop over the width */ - for (x = 0, sx = xpos; x < hsize; x++, sx += xadv, pict++) - { - /* clip the X coordinate */ - if (sx <= -8 || sx >= XDIM) - continue; - - /* draw the sprite */ - //drawgfx (bitmap, Machine->gfx[1], - // pict ^ 0x800, color, hflip, 0, sx, sy, clip, TRANSPARENCY_PEN, 0); - Render8x8Tile_Mask_Clip(pTransDraw, pict ^ 0x800, sx, sy, color, 4, 0, 0, DrvMotionObjectTiles); - } - } - } - } -} - -void atarigen_exit() -{ - BurnFree(displaylist); -} - - -static struct BurnInputInfo GauntletInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort5 + 3, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort5 + 2, "p2 coin" }, - {"Coin 3" , BIT_DIGITAL , DrvInputPort5 + 1, "p3 coin" }, - {"Coin 4" , BIT_DIGITAL , DrvInputPort5 + 0, "p4 coin" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 fire 2" }, - - {"P3 Up" , BIT_DIGITAL , DrvInputPort2 + 7, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , DrvInputPort2 + 6, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , DrvInputPort2 + 5, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , DrvInputPort2 + 4, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 1, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 0, "p3 fire 2" }, - - {"P4 Up" , BIT_DIGITAL , DrvInputPort3 + 7, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , DrvInputPort3 + 6, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , DrvInputPort3 + 5, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , DrvInputPort3 + 4, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , DrvInputPort3 + 1, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , DrvInputPort3 + 0, "p4 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, -// {"Diagnostics" , BIT_DIGITAL , DrvSrv + 0, "diag" }, -}; - -STDINPUTINFO(Gauntlet) - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x1d, 0xff, 0xff, 0x08, NULL }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x1d, 0x01, 0x08, 0x08, "Off" }, - {0x1d, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x30) == 0x30) { - *nJoystickInputs &= ~0x30; - } - if ((*nJoystickInputs & 0xc0) == 0xc0) { - *nJoystickInputs &= ~0xc0; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = DrvInput[3] = DrvInput[5] = 0x00; - DrvInput[4] = DrvDip[0]; // 0x40 VBLANK, 0x08 Diagnostics (active low) - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - DrvInput[3] |= (DrvInputPort3[i] & 1) << i; - DrvInput[5] |= (DrvInputPort5[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); - DrvClearOpposites(&DrvInput[3]); -} - -static struct BurnRomInfo GauntletRomDesc[] = { - { "136037-1307.9a", 0x08000, 0x46fe8743, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1308.9b", 0x08000, 0x276e15c4, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136037-1409.7a", 0x08000, 0x6fb8419c, BRF_ESS | BRF_PRG }, // 4 - { "136037-1410.7b", 0x08000, 0x931bd2a0, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntlet) -STD_ROM_FN(Gauntlet) - -static struct BurnRomInfo GauntletsRomDesc[] = { - { "136037-1507.9a", 0x08000, 0xb5183228, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1508.9b", 0x08000, 0xafd3c501, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136037-1509.7a", 0x08000, 0x69e50ae9, BRF_ESS | BRF_PRG }, // 4 - { "136037-1510.7b", 0x08000, 0x54e2692c, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntlets) -STD_ROM_FN(Gauntlets) - -static struct BurnRomInfo GauntletjRomDesc[] = { - { "136037-1307.9a", 0x08000, 0x46fe8743, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1308.9b", 0x08000, 0x276e15c4, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136037-1309.7a", 0x08000, 0xe8ba39d8, BRF_ESS | BRF_PRG }, // 4 - { "136037-1310.7b", 0x08000, 0xa204d997, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletj) -STD_ROM_FN(Gauntletj) - -static struct BurnRomInfo GauntletgRomDesc[] = { - { "136037-1007.9a", 0x08000, 0x6a224cea, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1008.9b", 0x08000, 0xfa391dab, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136037-1009.7a", 0x08000, 0x75d1f966, BRF_ESS | BRF_PRG }, // 4 - { "136037-1010.7b", 0x08000, 0x28a4197b, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletg) -STD_ROM_FN(Gauntletg) - -static struct BurnRomInfo Gauntletj12RomDesc[] = { - { "136037-1207.9a", 0x08000, 0x6dc0610d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1208.9b", 0x08000, 0xfaa306eb, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136037-1109.7a", 0x08000, 0x500194fb, BRF_ESS | BRF_PRG }, // 4 - { "136037-1110.7b", 0x08000, 0xb2969076, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletj12) -STD_ROM_FN(Gauntletj12) - -static struct BurnRomInfo Gauntletr9RomDesc[] = { - { "136037-907.9a", 0x08000, 0xc13a6399, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-908.9b", 0x08000, 0x417607d9, BRF_ESS | BRF_PRG }, // 1 - { "136037-105.10a", 0x04000, 0x4642cd95, BRF_ESS | BRF_PRG }, // 2 - { "136037-106.10b", 0x04000, 0xc8df945e, BRF_ESS | BRF_PRG }, // 3 - { "136037-909.7a", 0x08000, 0xfb1cdc1c, BRF_ESS | BRF_PRG }, // 4 - { "136037-910.7b", 0x08000, 0xf188e7b3, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletr9) -STD_ROM_FN(Gauntletr9) - -static struct BurnRomInfo Gauntletgr8RomDesc[] = { - { "136037-807.9a", 0x08000, 0x671c0bc2, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-808.9b", 0x08000, 0xf2842af4, BRF_ESS | BRF_PRG }, // 1 - { "136037-105.10a", 0x04000, 0x4642cd95, BRF_ESS | BRF_PRG }, // 2 - { "136037-106.10b", 0x04000, 0xc8df945e, BRF_ESS | BRF_PRG }, // 3 - { "136037-809.7a", 0x08000, 0x05642d60, BRF_ESS | BRF_PRG }, // 4 - { "136037-810.7b", 0x08000, 0x36d295e3, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletgr8) -STD_ROM_FN(Gauntletgr8) - -static struct BurnRomInfo Gauntletr7RomDesc[] = { - { "136037-207.9a", 0x08000, 0xfd871f81, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-208.9b", 0x08000, 0xbcb2fb1d, BRF_ESS | BRF_PRG }, // 1 - { "136037-105.10a", 0x04000, 0x4642cd95, BRF_ESS | BRF_PRG }, // 2 - { "136037-106.10b", 0x04000, 0xc8df945e, BRF_ESS | BRF_PRG }, // 3 - { "136037-709.7a", 0x08000, 0x73e1ad79, BRF_ESS | BRF_PRG }, // 4 - { "136037-710.7b", 0x08000, 0xfd248cea, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletr7) -STD_ROM_FN(Gauntletr7) - -static struct BurnRomInfo Gauntletgr6RomDesc[] = { - { "136037-307.9a", 0x08000, 0x759827c9, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-308.9b", 0x08000, 0xd71262d1, BRF_ESS | BRF_PRG }, // 1 - { "136037-105.10a", 0x04000, 0x4642cd95, BRF_ESS | BRF_PRG }, // 2 - { "136037-106.10b", 0x04000, 0xc8df945e, BRF_ESS | BRF_PRG }, // 3 - { "136037-609.7a", 0x08000, 0xcd3381de, BRF_ESS | BRF_PRG }, // 4 - { "136037-610.7b", 0x08000, 0x2cff932a, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletgr6) -STD_ROM_FN(Gauntletgr6) - -static struct BurnRomInfo Gauntletr5RomDesc[] = { - { "136037-207.9a", 0x08000, 0xfd871f81, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-208.9b", 0x08000, 0xbcb2fb1d, BRF_ESS | BRF_PRG }, // 1 - { "136037-105.10a", 0x04000, 0x4642cd95, BRF_ESS | BRF_PRG }, // 2 - { "136037-106.10b", 0x04000, 0xc8df945e, BRF_ESS | BRF_PRG }, // 3 - { "136037-409.7a", 0x08000, 0xc57377b3, BRF_ESS | BRF_PRG }, // 4 - { "136037-510.7b", 0x08000, 0x1cac2071, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletr5) -STD_ROM_FN(Gauntletr5) - -static struct BurnRomInfo Gauntletr4RomDesc[] = { - { "136037-207.9a", 0x08000, 0xfd871f81, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-208.9b", 0x08000, 0xbcb2fb1d, BRF_ESS | BRF_PRG }, // 1 - { "136037-105.10a", 0x04000, 0x4642cd95, BRF_ESS | BRF_PRG }, // 2 - { "136037-106.10b", 0x04000, 0xc8df945e, BRF_ESS | BRF_PRG }, // 3 - { "136037-409.7a", 0x08000, 0xc57377b3, BRF_ESS | BRF_PRG }, // 4 - { "136037-410.7b", 0x08000, 0x6b971a27, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletr4) -STD_ROM_FN(Gauntletr4) - -static struct BurnRomInfo Gauntletgr3RomDesc[] = { - { "136037-307.9a", 0x08000, 0x759827c9, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-308.9b", 0x08000, 0xd71262d1, BRF_ESS | BRF_PRG }, // 1 - { "136037-105.10a", 0x04000, 0x4642cd95, BRF_ESS | BRF_PRG }, // 2 - { "136037-106.10b", 0x04000, 0xc8df945e, BRF_ESS | BRF_PRG }, // 3 - { "136037-309.7a", 0x08000, 0x7f03696b, BRF_ESS | BRF_PRG }, // 4 - { "136037-310.7b", 0x08000, 0x8d7197fc, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletgr3) -STD_ROM_FN(Gauntletgr3) - -static struct BurnRomInfo Gauntletr2RomDesc[] = { - { "136037-207.9a", 0x08000, 0xfd871f81, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-208.9b", 0x08000, 0xbcb2fb1d, BRF_ESS | BRF_PRG }, // 1 - { "136037-105.10a", 0x04000, 0x4642cd95, BRF_ESS | BRF_PRG }, // 2 - { "136037-106.10b", 0x04000, 0xc8df945e, BRF_ESS | BRF_PRG }, // 3 - { "136037-209.7a", 0x08000, 0xd810a7dc, BRF_ESS | BRF_PRG }, // 4 - { "136037-210.7b", 0x08000, 0xfbba7290, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletr2) -STD_ROM_FN(Gauntletr2) - -static struct BurnRomInfo Gauntletr1RomDesc[] = { - { "136037-107.9a", 0x08000, 0xa5885e14, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-108.9b", 0x08000, 0x0087f1ab, BRF_ESS | BRF_PRG }, // 1 - { "136037-105.10a", 0x04000, 0x4642cd95, BRF_ESS | BRF_PRG }, // 2 - { "136037-106.10b", 0x04000, 0xc8df945e, BRF_ESS | BRF_PRG }, // 3 - { "136037-109.7a", 0x08000, 0x55d87198, BRF_ESS | BRF_PRG }, // 4 - { "136037-110.7b", 0x08000, 0xf84ad06d, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntletr1) -STD_ROM_FN(Gauntletr1) - -static struct BurnRomInfo Gauntlet2pRomDesc[] = { - { "136041-507.9a", 0x08000, 0x8784133f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136041-508.9b", 0x08000, 0x2843bde3, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136041-609.7a", 0x08000, 0x5b4ee415, BRF_ESS | BRF_PRG }, // 4 - { "136041-610.7b", 0x08000, 0x41f5c9e2, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntlet2p) -STD_ROM_FN(Gauntlet2p) - -static struct BurnRomInfo Gauntlet2pjRomDesc[] = { - { "136041-507.9a", 0x08000, 0x8784133f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136041-508.9b", 0x08000, 0x2843bde3, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136041-509.7a", 0x08000, 0xfb2ef226, BRF_ESS | BRF_PRG }, // 4 - { "136041-510.7b", 0x08000, 0xa69be8da, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntlet2pj) -STD_ROM_FN(Gauntlet2pj) - -static struct BurnRomInfo Gauntlet2pgRomDesc[] = { - { "136041-407.9a", 0x08000, 0xcde72140, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136041-408.9b", 0x08000, 0x4ab1af62, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136041-409.7a", 0x08000, 0x44e01459, BRF_ESS | BRF_PRG }, // 4 - { "136041-410.7b", 0x08000, 0xb58d96d3, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntlet2pg) -STD_ROM_FN(Gauntlet2pg) - -static struct BurnRomInfo Gauntlet2pr3RomDesc[] = { - { "136041-207.9a", 0x08000, 0x0e1af1b4, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136041-208.9b", 0x08000, 0xbf51a238, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136041-309.7a", 0x08000, 0x5acbcd2b, BRF_ESS | BRF_PRG }, // 4 - { "136041-310.7b", 0x08000, 0x1889ab77, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntlet2pr3) -STD_ROM_FN(Gauntlet2pr3) - -static struct BurnRomInfo Gauntlet2pj2RomDesc[] = { - { "136041-207.9a", 0x08000, 0x0e1af1b4, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136041-208.9b", 0x08000, 0xbf51a238, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136041-209.7a", 0x08000, 0xddc9b56f, BRF_ESS | BRF_PRG }, // 4 - { "136041-210.7b", 0x08000, 0xffe78a4f, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntlet2pj2) -STD_ROM_FN(Gauntlet2pj2) - -static struct BurnRomInfo Gauntlet2pg1RomDesc[] = { - { "136041-107.9a", 0x08000, 0x3faf74d8, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136041-108.9b", 0x08000, 0xf1e6d815, BRF_ESS | BRF_PRG }, // 1 - { "136037-205.10a", 0x04000, 0x6d99ed51, BRF_ESS | BRF_PRG }, // 2 - { "136037-206.10b", 0x04000, 0x545ead91, BRF_ESS | BRF_PRG }, // 3 - { "136041-109.7a", 0x08000, 0x56d0c5b8, BRF_ESS | BRF_PRG }, // 4 - { "136041-110.7b", 0x08000, 0x3b9ae397, BRF_ESS | BRF_PRG }, // 5 - - { "136037-120.16r", 0x04000, 0x6ee7f3cc, BRF_ESS | BRF_PRG }, // 6 M6502 Program - { "136037-119.16s", 0x08000, 0xfa19861f, BRF_ESS | BRF_PRG }, // 7 - - { "136037-104.6p", 0x02000, 0x9e2a5b59, BRF_GRA }, // 8 Characters - - { "136037-111.1a", 0x08000, 0x91700f33, BRF_GRA }, // 9 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 10 - { "136037-113.1l", 0x08000, 0xd497d0a8, BRF_GRA }, // 11 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 12 - { "136037-115.2a", 0x08000, 0x9510b898, BRF_GRA }, // 13 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 14 - { "136037-117.2l", 0x08000, 0x29a5db41, BRF_GRA }, // 15 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 16 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 18 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 19 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 20 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gauntlet2pg1) -STD_ROM_FN(Gauntlet2pg1) - -static struct BurnRomInfo Gaunt2RomDesc[] = { - { "136037-1307.9a", 0x08000, 0x46fe8743, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1308.9b", 0x08000, 0x276e15c4, BRF_ESS | BRF_PRG }, // 1 - { "136043-1105.10a", 0x04000, 0x45dfda47, BRF_ESS | BRF_PRG }, // 2 - { "136043-1106.10b", 0x04000, 0x343c029c, BRF_ESS | BRF_PRG }, // 3 - { "136043-1109.7a", 0x08000, 0x58a0a9a3, BRF_ESS | BRF_PRG }, // 4 - { "136043-1110.7b", 0x08000, 0x658f0da8, BRF_ESS | BRF_PRG }, // 5 - { "136043-1121.6a", 0x08000, 0xae301bba, BRF_ESS | BRF_PRG }, // 6 - { "136043-1122.6b", 0x08000, 0xe94aaa8a, BRF_ESS | BRF_PRG }, // 7 - - { "136043-1120.16r", 0x04000, 0x5c731006, BRF_ESS | BRF_PRG }, // 8 M6502 Program - { "136043-1119.16s", 0x08000, 0xdc3591e7, BRF_ESS | BRF_PRG }, // 9 - - { "136043-1104.6p", 0x02000, 0x1343cf6f, BRF_GRA }, // 10 Characters - - { "136043-1111.1a", 0x08000, 0x09df6e23, BRF_GRA }, // 11 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 12 - { "136043-1123.1c", 0x04000, 0xe4c98f01, BRF_GRA }, // 13 - { "136043-1113.1l", 0x08000, 0x33cb476e, BRF_GRA }, // 14 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 15 - { "136043-1124.1p", 0x04000, 0xc4857879, BRF_GRA }, // 16 - { "136043-1115.2a", 0x08000, 0xf71e2503, BRF_GRA }, // 17 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 18 - { "136043-1125.2c", 0x04000, 0xd9c2c2d1, BRF_GRA }, // 19 - { "136043-1117.2l", 0x08000, 0x9e30b2e9, BRF_GRA }, // 20 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 21 - { "136043-1126.2p", 0x04000, 0xa32c732a, BRF_GRA }, // 22 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 23 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 24 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 25 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gaunt2) -STD_ROM_FN(Gaunt2) - -static struct BurnRomInfo Gaunt2gRomDesc[] = { - { "136037-1007.9a", 0x08000, 0x6a224cea, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1008.9b", 0x08000, 0xfa391dab, BRF_ESS | BRF_PRG }, // 1 - { "136043-1105.10a", 0x04000, 0x45dfda47, BRF_ESS | BRF_PRG }, // 2 - { "136043-1106.10b", 0x04000, 0x343c029c, BRF_ESS | BRF_PRG }, // 3 - { "136043-2209.7a", 0x08000, 0x577f4101, BRF_ESS | BRF_PRG }, // 4 - { "136043-2210.7b", 0x08000, 0x03254cf4, BRF_ESS | BRF_PRG }, // 5 - { "136043-2221.6a", 0x08000, 0xc8adcf1a, BRF_ESS | BRF_PRG }, // 6 - { "136043-2222.6b", 0x08000, 0x7788ff84, BRF_ESS | BRF_PRG }, // 7 - - { "136043-1120.16r", 0x04000, 0x5c731006, BRF_ESS | BRF_PRG }, // 8 M6502 Program - { "136043-1119.16s", 0x08000, 0xdc3591e7, BRF_ESS | BRF_PRG }, // 9 - - { "136043-1104.6p", 0x02000, 0x1343cf6f, BRF_GRA }, // 10 Characters - - { "136043-1111.1a", 0x08000, 0x09df6e23, BRF_GRA }, // 11 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 12 - { "136043-1123.1c", 0x04000, 0xe4c98f01, BRF_GRA }, // 13 - { "136043-1113.1l", 0x08000, 0x33cb476e, BRF_GRA }, // 14 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 15 - { "136043-1124.1p", 0x04000, 0xc4857879, BRF_GRA }, // 16 - { "136043-1115.2a", 0x08000, 0xf71e2503, BRF_GRA }, // 17 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 18 - { "136043-1125.2c", 0x04000, 0xd9c2c2d1, BRF_GRA }, // 19 - { "136043-1117.2l", 0x08000, 0x9e30b2e9, BRF_GRA }, // 20 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 21 - { "136043-1126.2p", 0x04000, 0xa32c732a, BRF_GRA }, // 22 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 23 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 24 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 25 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gaunt2g) -STD_ROM_FN(Gaunt2g) - -static struct BurnRomInfo Gaunt22pRomDesc[] = { - { "136037-1307.9a", 0x08000, 0x46fe8743, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1308.9b", 0x08000, 0x276e15c4, BRF_ESS | BRF_PRG }, // 1 - { "136043-1105.10a", 0x04000, 0x45dfda47, BRF_ESS | BRF_PRG }, // 2 - { "136043-1106.10b", 0x04000, 0x343c029c, BRF_ESS | BRF_PRG }, // 3 - { "136044-2109.7a", 0x08000, 0x1102ab96, BRF_ESS | BRF_PRG }, // 4 - { "136044-2110.7b", 0x08000, 0xd2203a2b, BRF_ESS | BRF_PRG }, // 5 - { "136044-2121.6a", 0x08000, 0x753982d7, BRF_ESS | BRF_PRG }, // 6 - { "136044-2122.6b", 0x08000, 0x879149ea, BRF_ESS | BRF_PRG }, // 7 - - { "136043-1120.16r", 0x04000, 0x5c731006, BRF_ESS | BRF_PRG }, // 8 M6502 Program - { "136043-1119.16s", 0x08000, 0xdc3591e7, BRF_ESS | BRF_PRG }, // 9 - - { "136043-1104.6p", 0x02000, 0x1343cf6f, BRF_GRA }, // 10 Characters - - { "136043-1111.1a", 0x08000, 0x09df6e23, BRF_GRA }, // 11 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 12 - { "136043-1123.1c", 0x04000, 0xe4c98f01, BRF_GRA }, // 13 - { "136043-1113.1l", 0x08000, 0x33cb476e, BRF_GRA }, // 14 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 15 - { "136043-1124.1p", 0x04000, 0xc4857879, BRF_GRA }, // 16 - { "136043-1115.2a", 0x08000, 0xf71e2503, BRF_GRA }, // 17 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 18 - { "136043-1125.2c", 0x04000, 0xd9c2c2d1, BRF_GRA }, // 19 - { "136043-1117.2l", 0x08000, 0x9e30b2e9, BRF_GRA }, // 20 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 21 - { "136043-1126.2p", 0x04000, 0xa32c732a, BRF_GRA }, // 22 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 23 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 24 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 25 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gaunt22p) -STD_ROM_FN(Gaunt22p) - -static struct BurnRomInfo Gaunt22p1RomDesc[] = { - { "136037-1307.9a", 0x08000, 0x46fe8743, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1308.9b", 0x08000, 0x276e15c4, BRF_ESS | BRF_PRG }, // 1 - { "136043-1105.10a", 0x04000, 0x45dfda47, BRF_ESS | BRF_PRG }, // 2 - { "136043-1106.10b", 0x04000, 0x343c029c, BRF_ESS | BRF_PRG }, // 3 - { "136044-1109.7a", 0x08000, 0x31f805eb, BRF_ESS | BRF_PRG }, // 4 - { "136044-1110.7b", 0x08000, 0x5285c0e2, BRF_ESS | BRF_PRG }, // 5 - { "136044-1121.6a", 0x08000, 0xd1f3b32a, BRF_ESS | BRF_PRG }, // 6 - { "136044-1122.6b", 0x08000, 0x3485785f, BRF_ESS | BRF_PRG }, // 7 - - { "136043-1120.16r", 0x04000, 0x5c731006, BRF_ESS | BRF_PRG }, // 8 M6502 Program - { "136043-1119.16s", 0x08000, 0xdc3591e7, BRF_ESS | BRF_PRG }, // 9 - - { "136043-1104.6p", 0x02000, 0x1343cf6f, BRF_GRA }, // 10 Characters - - { "136043-1111.1a", 0x08000, 0x09df6e23, BRF_GRA }, // 11 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 12 - { "136043-1123.1c", 0x04000, 0xe4c98f01, BRF_GRA }, // 13 - { "136043-1113.1l", 0x08000, 0x33cb476e, BRF_GRA }, // 14 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 15 - { "136043-1124.1p", 0x04000, 0xc4857879, BRF_GRA }, // 16 - { "136043-1115.2a", 0x08000, 0xf71e2503, BRF_GRA }, // 17 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 18 - { "136043-1125.2c", 0x04000, 0xd9c2c2d1, BRF_GRA }, // 19 - { "136043-1117.2l", 0x08000, 0x9e30b2e9, BRF_GRA }, // 20 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 21 - { "136043-1126.2p", 0x04000, 0xa32c732a, BRF_GRA }, // 22 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 23 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 24 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 25 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gaunt22p1) -STD_ROM_FN(Gaunt22p1) - -static struct BurnRomInfo Gaunt22pgRomDesc[] = { - { "136037-1007.9a", 0x08000, 0x6a224cea, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "136037-1008.9b", 0x08000, 0xfa391dab, BRF_ESS | BRF_PRG }, // 1 - { "136043-1105.10a", 0x04000, 0x45dfda47, BRF_ESS | BRF_PRG }, // 2 - { "136043-1106.10b", 0x04000, 0x343c029c, BRF_ESS | BRF_PRG }, // 3 - { "136044-2209.7a", 0x08000, 0x9da52ecd, BRF_ESS | BRF_PRG }, // 4 - { "136044-2210.7b", 0x08000, 0x63d0f6a7, BRF_ESS | BRF_PRG }, // 5 - { "136044-2221.6a", 0x08000, 0x8895b31b, BRF_ESS | BRF_PRG }, // 6 - { "136044-2222.6b", 0x08000, 0xa4456cc7, BRF_ESS | BRF_PRG }, // 7 - - { "136043-1120.16r", 0x04000, 0x5c731006, BRF_ESS | BRF_PRG }, // 8 M6502 Program - { "136043-1119.16s", 0x08000, 0xdc3591e7, BRF_ESS | BRF_PRG }, // 9 - - { "136043-1104.6p", 0x02000, 0x1343cf6f, BRF_GRA }, // 10 Characters - - { "136043-1111.1a", 0x08000, 0x09df6e23, BRF_GRA }, // 11 Motion Objects - { "136037-112.1b", 0x08000, 0x869330be, BRF_GRA }, // 12 - { "136043-1123.1c", 0x04000, 0xe4c98f01, BRF_GRA }, // 13 - { "136043-1113.1l", 0x08000, 0x33cb476e, BRF_GRA }, // 14 - { "136037-114.1mn", 0x08000, 0x29ef9882, BRF_GRA }, // 15 - { "136043-1124.1p", 0x04000, 0xc4857879, BRF_GRA }, // 16 - { "136043-1115.2a", 0x08000, 0xf71e2503, BRF_GRA }, // 17 - { "136037-116.2b", 0x08000, 0x11e0ac5b, BRF_GRA }, // 18 - { "136043-1125.2c", 0x04000, 0xd9c2c2d1, BRF_GRA }, // 19 - { "136043-1117.2l", 0x08000, 0x9e30b2e9, BRF_GRA }, // 20 - { "136037-118.2mn", 0x08000, 0x8bf3b263, BRF_GRA }, // 21 - { "136043-1126.2p", 0x04000, 0xa32c732a, BRF_GRA }, // 22 - - { "74s472-136037-101.7u", 0x00200, 0x2964f76f, BRF_GRA }, // 23 PROM (Motion Timing) - { "74s472-136037-102.5l", 0x00200, 0x4d4fec6c, BRF_GRA }, // 24 PROM (Motion Flip Control) - { "74s287-136037-103.4r", 0x00100, 0x6c5ccf08, BRF_GRA }, // 25 PROM (Motion Position/Size) -}; - -STD_ROM_PICK(Gaunt22pg) -STD_ROM_FN(Gaunt22pg) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x80000; - DrvM6502Rom = Next; Next += 0x10000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x03000; - DrvM6502Ram = Next; Next += 0x01000; - DrvPlayfieldRam = Next; Next += 0x02000; - DrvMOSpriteRam = Next; Next += 0x02000; - DrvAlphaRam = Next; Next += 0x00f80; - DrvMOSlipRam = Next; Next += 0x00080; - DrvPaletteRam = Next; Next += 0x00800; - - RamEnd = Next; - - DrvEEPROM = Next; Next += 0x01000; - - DrvChars = Next; Next += 0x0400 * 8 * 8; - DrvMotionObjectTiles = Next; Next += /*0x2000*/0x3000 * 8 * 8; - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset(RamStart, 0, RamEnd - RamStart); - - SekOpen(0); - SekReset(); - SekClose(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - BurnYM2151Reset(); - - atarigen_SlapsticReset(); - atarigen_eeprom_reset(); - - DrvVBlank = 1; - DrvSoundResetVal = 1; - DrvSoundCPUHalt = 1; - DrvCPUtoSoundReady = 0; - DrvSoundtoCPUReady = 0; - DrvCPUtoSound = 0; - DrvSoundtoCPU = 0; - - return 0; -} - -UINT8 __fastcall Gauntlet68KReadByte(UINT32 a) -{ - if (a >= 0x802000 && a <= 0x802fff) { - UINT16 *Eeprom = (UINT16*)DrvEEPROM; - INT32 Offset = (a - 0x802000) >> 1; - return Eeprom[Offset] | 0xff00; - } - - switch (a) { - case 0x803009: { - UINT8 Res = DrvInput[4] | (DrvVBlank ? 0x40 : 0x00); - if (DrvCPUtoSoundReady) Res ^= 0x20; - if (DrvSoundtoCPUReady) Res ^= 0x10; - return Res; - } - - case 0x80300f: { - DrvSoundtoCPUReady = 0; -#ifdef SNDCPUDBG - bprintf(0, _T("68k_rb.")); -#endif - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - return DrvSoundtoCPU; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Gauntlet68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x802000 && a <= 0x802fff) { - if (!eeprom_unlocked) return; - - UINT16 *Eeprom = (UINT16*)DrvEEPROM; - INT32 Offset = (a - 0x802000) >> 1; - eeprom_unlocked = 0; - Eeprom[Offset] = d; - return; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Gauntlet68KReadWord(UINT32 a) -{ - switch (a) { - case 0x803000: { - return 0xffff - DrvInput[0]; - } - - case 0x803002: { - return 0xffff - DrvInput[1]; - } - - case 0x803004: { - return 0xffff - DrvInput[2]; - } - - case 0x803006: { - return 0xffff - DrvInput[3]; - } - - case 0x803008: { - UINT8 Res = DrvInput[4] | (DrvVBlank ? 0x40 : 0x00); - if (DrvCPUtoSoundReady) Res ^= 0x20; - if (DrvSoundtoCPUReady) Res ^= 0x10; - return 0xff00 | Res; - } - - case 0x80300e: { - DrvSoundtoCPUReady = 0; -#ifdef SNDCPUDBG - bprintf(0, _T("68k_rw.")); -#endif - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - return 0xff00 | DrvSoundtoCPU; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -static void soundcpuSync() -{ - if (!DrvSoundCPUHalt) { - INT32 todo = (SekTotalCycles() / 4) - nCyclesDone[1]; - if (todo > 0) nCyclesDone[1] += M6502Run(todo); - } else { - nCyclesDone[1] = SekTotalCycles() / 4; - } -} - -void __fastcall Gauntlet68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x803100: { - // watchdog_reset16_w - return; - } - - case 0x803120: - case 0x80312e: { - INT32 OldVal = DrvSoundResetVal; - DrvSoundResetVal = d; - if ((OldVal ^ DrvSoundResetVal) & 1) { - if (DrvSoundResetVal & 1) { - M6502Open(0); - M6502Reset(); - DrvSoundtoCPUReady = 0; - M6502Run(10); // why's this needed? who knows... - M6502Close(); - DrvSoundCPUHalt = 0; -#ifdef SNDCPUDBG - bprintf(PRINT_NORMAL, _T("Enabling sound CPU\n")); -#endif - } else { - DrvSoundCPUHalt = 1; -#ifdef SNDCPUDBG - bprintf(PRINT_NORMAL, _T("Disabling sound CPU\n")); -#endif - } - } - - return; - } - - case 0x803140: { - // irq_ack - return; - } - - case 0x803150: { - eeprom_unlocked = 1; - return; - } - - case 0x803170: { - DrvCPUtoSound = d & 0xff; -#ifdef SNDCPUDBG - if (DrvCPUtoSoundReady) bprintf(0, _T("68k: sound command missed!\n")); -#endif - DrvCPUtoSoundReady = 1; - M6502Open(0); - soundcpuSync(); - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_ACK); - M6502Close(); - return; - } - - case 0x930000: { - DrvScrollX = d & 0x1ff; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 GauntletSoundRead(UINT16 Address) -{ - if ((Address & 0xd830) == 0x1800) { - return pokey1_r(Address & 0xf); - } - - switch (Address) { - case 0x1010: { -#ifdef SNDCPUDBG - bprintf(0, _T("snd_rb.")); -#endif - DrvCPUtoSoundReady = 0; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_NONE); - return DrvCPUtoSound; - } - - case 0x1020: { - return 0xff - DrvInput[5]; - } - - case 0x1030: - case 0x1031: { - UINT8 Res = 0x30; - UINT8 Input = DrvInput[4] | (DrvVBlank ? 0x40 : 0x00); - - if (DrvCPUtoSoundReady) Res ^= 0x80; - if (DrvSoundtoCPUReady) Res ^= 0x40; - Res ^= 0x20; // tms5220 ready status, no core yet. - if (!(Input & 0x08)) Res ^= 0x10; - return Res; - } - - case 0x1811: { - return BurnYM2151ReadStatus(); - } - - default: { - bprintf(PRINT_NORMAL, _T("M6502 Read Byte %04X\n"), Address); - } - } - - return 0; -} - -void GauntletSoundWrite(UINT16 Address, UINT8 Data) -{ - - if ((Address & 0xd830) == 0x1800) { - pokey1_w(Address & 0xf, Data); - return; - } - - switch (Address) { - case 0x1000: - case 0x1001: - case 0x1002: - case 0x1003: - case 0x1004: - case 0x1005: - case 0x1006: - case 0x1007: - case 0x1008: - case 0x1009: - case 0x100a: - case 0x100b: - case 0x100c: - case 0x100d: - case 0x100e: - case 0x100f: { - DrvSoundtoCPU = Data; -#ifdef SNDCPUDBG - if (DrvSoundtoCPUReady) bprintf(0, _T("main missed sound cmd!\n")); -#endif - DrvSoundtoCPUReady = 1; - if (SekGetActive() == -1) { - SekOpen(0); - SekSetIRQLine(6, CPU_IRQSTATUS_ACK); - SekClose(); - } else { - SekSetIRQLine(6, CPU_IRQSTATUS_ACK); - } - return; - } - - case 0x1020: { - return; // sound mixer - } - - case 0x1030: - case 0x1031: - case 0x1032: - case 0x1033: - case 0x1034: - case 0x1035: { - // sound_ctl_w - return; - } - - case 0x1810: { - BurnYM2151SelectRegister(Data); - return; - } - - case 0x1811: { - BurnYM2151WriteRegister(Data); - return; - } - - case 0x1820: { - // tms5220_w - return; - } - - case 0x1830: { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_NONE); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("M6502 Write Byte %04X, %02X\n"), Address, Data); - } - } -} - -void atarigen_swap_mem(void *ptr1, void *ptr2, INT32 bytes) -{ - UINT8 *p1 = (UINT8 *)ptr1; - UINT8 *p2 = (UINT8 *)ptr2; - while (bytes--) { - INT32 temp = *p1; - *p1++ = *p2; - *p2++ = temp; - } -} - -static INT32 CharPlaneOffsets[2] = { 0, 4 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 8, 9, 10, 11 }; -static INT32 CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -//static INT32 MOPlaneOffsets[4] = { 0x180000, 0x100000, 0x080000, 0x000000 }; -static INT32 MOPlaneOffsets[4] = { 3*8*0x18000, 2*8*0x18000, 1*8*0x18000, 0*8*0x18000 }; -static INT32 MOXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 MOYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(/*0x40000*/0x60000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x38001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x38000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 5, 2); if (nRet != 0) return 1; - - atarigen_swap_mem(Drv68KRom + 0x000000, Drv68KRom + 0x008000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x040000, Drv68KRom + 0x048000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x050000, Drv68KRom + 0x058000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x060000, Drv68KRom + 0x068000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x070000, Drv68KRom + 0x078000, 0x8000); - - // Load M6502 Program Rom - nRet = BurnLoadRom(DrvM6502Rom + 0x0000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6502Rom + 0x4000, 7, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x0400, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, /*0x40000*/0x60000); - /*nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 16, 1); if (nRet != 0) return 1;*/ - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x48000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 16, 1); if (nRet != 0) return 1; - for (UINT32 i = 0; i < /*0x40000*/0x60000; i++) DrvTempRom[i] ^= 0xff; - GfxDecode(/*0x2000*/12288, 4, 8, 8, MOPlaneOffsets, MOXOffsets, MOYOffsets, 0x40, DrvTempRom, DrvMotionObjectTiles); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68010); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPlayfieldRam , 0x900000, 0x901fff, MAP_RAM); - SekMapMemory(DrvMOSpriteRam , 0x902000, 0x903fff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x2000 , 0x904000, 0x904fff, MAP_RAM); - SekMapMemory(DrvAlphaRam , 0x905000, 0x905f7f, MAP_RAM); - SekMapMemory(DrvMOSlipRam , 0x905f80, 0x905fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x910000, 0x9107ff, MAP_RAM); - SekSetReadByteHandler(0, Gauntlet68KReadByte); - SekSetWriteByteHandler(0, Gauntlet68KWriteByte); - SekSetReadWordHandler(0, Gauntlet68KReadWord); - SekSetWriteWordHandler(0, Gauntlet68KWriteWord); - SekClose(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502Ram , 0x0000, 0x0fff, MAP_RAM); - M6502MapMemory(DrvM6502Rom , 0x4000, 0xffff, MAP_ROM); - M6502SetReadHandler(GauntletSoundRead); - M6502SetWriteHandler(GauntletSoundWrite); - M6502Close(); - - atarigen_SlapsticInit(0x038000, 104); - atarigen_eeprom_init(); - - BurnYM2151Init(14318180 / 4); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.48, BURN_SND_ROUTE_RIGHT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.48, BURN_SND_ROUTE_LEFT); - - PokeyInit(14000000/8, 2, 1.00, 1); - - GenericTilesInit(); - - static struct atarigen_modesc gauntlet_modesc = - { - 1024, /* maximum number of MO's */ - 2, /* number of bytes per MO entry */ - 0x800, /* number of bytes between MO words */ - 3, /* ignore an entry if this word == 0xffff */ - 3, 0, 0x3ff, /* link = (data[linkword] >> linkshift) & linkmask */ - 0 /* render in reverse link order */ - }; - - atarigen_init_display_list (&gauntlet_modesc); - - DrvGameType = GAME_GAUNTLET; - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 Gaunt2pInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(/*0x40000*/0x60000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x38001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x38000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 5, 2); if (nRet != 0) return 1; - - atarigen_swap_mem(Drv68KRom + 0x000000, Drv68KRom + 0x008000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x040000, Drv68KRom + 0x048000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x050000, Drv68KRom + 0x058000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x060000, Drv68KRom + 0x068000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x070000, Drv68KRom + 0x078000, 0x8000); - - // Load M6502 Program Rom - nRet = BurnLoadRom(DrvM6502Rom + 0x0000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6502Rom + 0x4000, 7, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x0400, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, /*0x40000*/0x60000); - /*nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 16, 1); if (nRet != 0) return 1;*/ - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x48000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 16, 1); if (nRet != 0) return 1; - for (UINT32 i = 0; i < /*0x40000*/0x60000; i++) DrvTempRom[i] ^= 0xff; - GfxDecode(/*0x2000*/12288, 4, 8, 8, MOPlaneOffsets, MOXOffsets, MOYOffsets, 0x40, DrvTempRom, DrvMotionObjectTiles); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68010); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPlayfieldRam , 0x900000, 0x901fff, MAP_RAM); - SekMapMemory(DrvMOSpriteRam , 0x902000, 0x903fff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x2000 , 0x904000, 0x904fff, MAP_RAM); - SekMapMemory(DrvAlphaRam , 0x905000, 0x905f7f, MAP_RAM); - SekMapMemory(DrvMOSlipRam , 0x905f80, 0x905fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x910000, 0x9107ff, MAP_RAM); - SekSetReadByteHandler(0, Gauntlet68KReadByte); - SekSetWriteByteHandler(0, Gauntlet68KWriteByte); - SekSetReadWordHandler(0, Gauntlet68KReadWord); - SekSetWriteWordHandler(0, Gauntlet68KWriteWord); - SekClose(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502Ram , 0x0000, 0x0fff, MAP_RAM); - M6502MapMemory(DrvM6502Rom , 0x4000, 0xffff, MAP_ROM); - M6502SetReadHandler(GauntletSoundRead); - M6502SetWriteHandler(GauntletSoundWrite); - M6502Close(); - - atarigen_SlapsticInit(0x038000, 107); - atarigen_eeprom_init(); - - BurnYM2151Init(14318180 / 4); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.48, BURN_SND_ROUTE_RIGHT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.48, BURN_SND_ROUTE_LEFT); - - PokeyInit(14000000/8, 2, 1.00, 1); - - GenericTilesInit(); - - static struct atarigen_modesc gauntlet_modesc = - { - 1024, /* maximum number of MO's */ - 2, /* number of bytes per MO entry */ - 0x800, /* number of bytes between MO words */ - 3, /* ignore an entry if this word == 0xffff */ - 3, 0, 0x3ff, /* link = (data[linkword] >> linkshift) & linkmask */ - 0 /* render in reverse link order */ - }; - - atarigen_init_display_list (&gauntlet_modesc); - - DrvGameType = GAME_GAUNTLET; - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 Gaunt2Init() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(/*0x40000*/0x60000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x38001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x38000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x50001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x50000, 7, 2); if (nRet != 0) return 1; - - atarigen_swap_mem(Drv68KRom + 0x000000, Drv68KRom + 0x008000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x040000, Drv68KRom + 0x048000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x050000, Drv68KRom + 0x058000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x060000, Drv68KRom + 0x068000, 0x8000); - atarigen_swap_mem(Drv68KRom + 0x070000, Drv68KRom + 0x078000, 0x8000); - - // Load M6502 Program Rom - nRet = BurnLoadRom(DrvM6502Rom + 0x0000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6502Rom + 0x4000, 9, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x0400, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, /*0x40000*/0x60000); - /*nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 16, 1); if (nRet != 0) return 1;*/ - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x14000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x2c000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x44000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x48000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x58000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x5c000, 22, 1); if (nRet != 0) return 1; - for (UINT32 i = 0; i < /*0x40000*/0x60000; i++) DrvTempRom[i] ^= 0xff; - GfxDecode(/*0x2000*/12288, 4, 8, 8, MOPlaneOffsets, MOXOffsets, MOYOffsets, 0x40, DrvTempRom, DrvMotionObjectTiles); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68010); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPlayfieldRam , 0x900000, 0x901fff, MAP_RAM); - SekMapMemory(DrvMOSpriteRam , 0x902000, 0x903fff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x2000 , 0x904000, 0x904fff, MAP_RAM); - SekMapMemory(DrvAlphaRam , 0x905000, 0x905f7f, MAP_RAM); - SekMapMemory(DrvMOSlipRam , 0x905f80, 0x905fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x910000, 0x9107ff, MAP_RAM); - SekSetReadByteHandler(0, Gauntlet68KReadByte); - SekSetWriteByteHandler(0, Gauntlet68KWriteByte); - SekSetReadWordHandler(0, Gauntlet68KReadWord); - SekSetWriteWordHandler(0, Gauntlet68KWriteWord); - SekClose(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502Ram , 0x0000, 0x0fff, MAP_RAM); - M6502MapMemory(DrvM6502Rom , 0x4000, 0xffff, MAP_ROM); - M6502SetReadHandler(GauntletSoundRead); - M6502SetWriteHandler(GauntletSoundWrite); - M6502Close(); - - atarigen_SlapsticInit(0x038000, 106); - atarigen_eeprom_init(); - - BurnYM2151Init(14318180 / 4); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.48, BURN_SND_ROUTE_RIGHT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.48, BURN_SND_ROUTE_LEFT); - - PokeyInit(14000000/8, 2, 1.00, 1); - - GenericTilesInit(); - - static struct atarigen_modesc gauntlet_modesc = - { - 1024, /* maximum number of MO's */ - 2, /* number of bytes per MO entry */ - 0x800, /* number of bytes between MO words */ - 3, /* ignore an entry if this word == 0xffff */ - 3, 0, 0x3ff, /* link = (data[linkword] >> linkshift) & linkmask */ - 0 /* render in reverse link order */ - }; - - atarigen_init_display_list (&gauntlet_modesc); - - DrvGameType = GAME_GAUNTLET2; - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - M6502Exit(); - - BurnYM2151Exit(); - - PokeyExit(); - - GenericTilesExit(); - - atarigen_exit(); - atarigen_slapstic_exit(); - - BurnFree(Mem); - - DrvVBlank = 0; - DrvSoundResetVal = 0; - DrvSoundCPUHalt = 0; - DrvGameType = 0; - - return 0; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - static const UINT8 ztable[16] = { 0x0, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11 }; - INT32 i, r, g, b; - - i = ztable[(BURN_ENDIAN_SWAP_INT16(nColour) >> 12) & 15]; - r = ((BURN_ENDIAN_SWAP_INT16(nColour) >> 8) & 15) * i; - g = ((BURN_ENDIAN_SWAP_INT16(nColour) >> 4) & 15) * i; - b = ((BURN_ENDIAN_SWAP_INT16(nColour) >> 0) & 15) * i; - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x400; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void DrvRenderPlayfield(INT32 PriorityDraw) -{ - INT32 mx, my, Data, Code, Colour, x, y, TileIndex, Priority; - - UINT16 *VideoRam = (UINT16*)DrvPlayfieldRam; - - for (mx = 0; mx < 64; mx++) { - for (my = 0; my < 64; my++) { - TileIndex = (my * 64) + mx; - Data = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Code = ((DrvTileBank * 0x1000) + (Data & 0xfff)) ^ 0x800; - - if (Code < 0x3000) { - Colour = 0x10 + ((DrvGameType == GAME_GAUNTLET || DrvGameType == GAME_GAUNTLET2) ? 0x08 : 0x00) + (0x100 >> 4) + ((Data >> 12) & 7); - - y = 8 * mx; - x = 8 * my; - - x -= DrvScrollX; - y -= DrvScrollY; - if (x < -8) x += 512; - if (y < -8) y += 512; - - Priority = (Data >> 15) & 1; //xFlip - - if (Priority == PriorityDraw) { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0, DrvMotionObjectTiles); - } - } - } - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, Opaque, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvAlphaRam; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - UINT16 Data = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Code = Data & 0x3ff; - Colour = ((Data >> 10) & 0x0f) | ((Data >> 9) & 0x20); - Opaque = Data & 0x8000; - - x = 8 * mx; - y = 8 * my; - - if (Opaque) { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, DrvChars); - } - - TileIndex++; - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - - DrvRenderPlayfield(0); - DrvRenderPlayfield(1); - atarigen_render_display_list(); - DrvRenderCharLayer(); - - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nMult = 2; - INT32 nInterleave = 262*nMult; - INT32 nSoundBufferPos = 0; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = (14318180 / 2) / 60; - nCyclesTotal[1] = (14318180 / 8) / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - - INT32 NextScanline = 0; - - UINT16 *AlphaRam = (UINT16*)DrvAlphaRam; - DrvScrollY = BURN_ENDIAN_SWAP_INT16(AlphaRam[0xf6e >> 1]); - DrvTileBank = DrvScrollY & 0x03; - DrvScrollY >>= 7; - DrvScrollY &= 0x1ff; - - if (DrvGameType == GAME_GAUNTLET) { - if (DrvTileBank > 1) DrvTileBank -= 2; - } - - if (DrvGameType == GAME_GAUNTLET2) { - if (DrvTileBank == 3) DrvTileBank = 0; - } - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 11*nMult) DrvVBlank = 0; - if (i == 250*nMult) DrvVBlank = 1; - if (i == 261*nMult) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (i%nMult==nMult-1 && i/nMult == NextScanline) { - INT32 Link = (DrvMOSlipRam[2 * ((((i/nMult) + DrvScrollY) / 8) & 0x3f) + 0] | (DrvMOSlipRam[2 * ((((i/nMult) + DrvScrollY) / 8) & 0x3f) + 1] << 8)) & 0x3ff; - atarigen_update_display_list(DrvMOSpriteRam, Link, (i/nMult)); - - if (!NextScanline) { - NextScanline += 8 - (DrvScrollY & 7); - } else { - NextScanline += 8; - } - } - - if (!DrvSoundCPUHalt) { - M6502Open(0); - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += M6502Run(nCyclesSegment); - - if (i%nMult==nMult-1 && (i/nMult) % 32 == 0) - { - if ((i/nMult) & 32) - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_ACK); - else - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_NONE); - } - M6502Close(); - } else { - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesDone[nCurrentCPU] += nNext; // idle skip - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - pokey_update(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029607; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - M6502Scan(nAction); - - BurnYM2151Scan(nAction); - pokey_scan(nAction, pnMin); - - SCAN_VAR(DrvVBlank); - SCAN_VAR(DrvSoundResetVal); - SCAN_VAR(DrvSoundCPUHalt); - SCAN_VAR(DrvCPUtoSoundReady); - SCAN_VAR(DrvSoundtoCPUReady); - SCAN_VAR(DrvCPUtoSound); - SCAN_VAR(DrvSoundtoCPU); - SCAN_VAR(eeprom_unlocked); - // slapstic stuff - SCAN_VAR(state); - SCAN_VAR(next_bank); - SCAN_VAR(extra_bank); - SCAN_VAR(current_bank); - } - - return 0; -} - -struct BurnDriver BurnDrvGauntlet = { - "gauntlet", NULL, NULL, NULL, "1985", - "Gauntlet (rev 14)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, GauntletRomInfo, GauntletRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntlets = { - "gauntlets", "gauntlet", NULL, NULL, "1985", - "Gauntlet (Spanish, rev 15)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, GauntletsRomInfo, GauntletsRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletj = { - "gauntletj", "gauntlet", NULL, NULL, "1985", - "Gauntlet (Japanese, rev 13)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, GauntletjRomInfo, GauntletjRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletg = { - "gauntletg", "gauntlet", NULL, NULL, "1985", - "Gauntlet (German, rev 10)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, GauntletgRomInfo, GauntletgRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletj12 = { - "gauntletj12", "gauntlet", NULL, NULL, "1985", - "Gauntlet (Japanese, rev 12)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletj12RomInfo, Gauntletj12RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletr9 = { - "gauntletr9", "gauntlet", NULL, NULL, "1985", - "Gauntlet (rev 9)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletr9RomInfo, Gauntletr9RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletgr8 = { - "gauntletgr8", "gauntlet", NULL, NULL, "1985", - "Gauntlet (German, rev 8)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletgr8RomInfo, Gauntletgr8RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletr7 = { - "gauntletr7", "gauntlet", NULL, NULL, "1985", - "Gauntlet (rev 7)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletr7RomInfo, Gauntletr7RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletgr6 = { - "gauntletgr6", "gauntlet", NULL, NULL, "1985", - "Gauntlet (German, rev 6)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletgr6RomInfo, Gauntletgr6RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletr5 = { - "gauntletr5", "gauntlet", NULL, NULL, "1985", - "Gauntlet (rev 5)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletr5RomInfo, Gauntletr5RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletr4 = { - "gauntletr4", "gauntlet", NULL, NULL, "1985", - "Gauntlet (rev 4)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletr4RomInfo, Gauntletr4RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletgr3 = { - "gauntletgr3", "gauntlet", NULL, NULL, "1985", - "Gauntlet (German, rev 3)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletgr3RomInfo, Gauntletgr3RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletr2 = { - "gauntletr2", "gauntlet", NULL, NULL, "1985", - "Gauntlet (rev 2)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletr2RomInfo, Gauntletr2RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntletr1 = { - "gauntletr1", "gauntlet", NULL, NULL, "1985", - "Gauntlet (rev 1)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntletr1RomInfo, Gauntletr1RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntlet2p = { - "gauntlet2p", "gauntlet", NULL, NULL, "1985", - "Gauntlet (2 Players, rev 6)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntlet2pRomInfo, Gauntlet2pRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2pInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntlet2pj = { - "gauntlet2pj", "gauntlet", NULL, NULL, "1985", - "Gauntlet (2 Players, Japanese, rev 5)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntlet2pjRomInfo, Gauntlet2pjRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2pInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntlet2pg = { - "gauntlet2pg", "gauntlet", NULL, NULL, "1985", - "Gauntlet (2 Players, German, rev 4)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntlet2pgRomInfo, Gauntlet2pgRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2pInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntlet2pr3 = { - "gauntlet2pr3", "gauntlet", NULL, NULL, "1985", - "Gauntlet (2 Players, rev 3)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntlet2pr3RomInfo, Gauntlet2pr3RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2pInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntlet2pj2 = { - "gauntlet2pj2", "gauntlet", NULL, NULL, "1985", - "Gauntlet (2 Players, Japanese rev 2)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntlet2pj2RomInfo, Gauntlet2pj2RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2pInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGauntlet2pg1 = { - "gauntlet2pg1", "gauntlet", NULL, NULL, "1985", - "Gauntlet (2 Players, German, rev 1)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gauntlet2pg1RomInfo, Gauntlet2pg1RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2pInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGaunt2 = { - "gaunt2", NULL, NULL, NULL, "1986", - "Gauntlet II\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gaunt2RomInfo, Gaunt2RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGaunt2g = { - "gaunt2g", "gaunt2", NULL, NULL, "1986", - "Gauntlet II (German)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gaunt2gRomInfo, Gaunt2gRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGaunt22p = { - "gaunt22p", "gaunt2", NULL, NULL, "1986", - "Gauntlet II (2 Players, rev 2)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gaunt22pRomInfo, Gaunt22pRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGaunt22p1 = { - "gaunt22p1", "gaunt2", NULL, NULL, "1986", - "Gauntlet II (2 Players, rev 1)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gaunt22p1RomInfo, Gaunt22p1RomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGaunt22pg = { - "gaunt22pg", "gaunt2", NULL, NULL, "1986", - "Gauntlet II (2 Players, German)\0", NULL, "Atari Games", "Atari Gauntlet", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, Gaunt22pgRomInfo, Gaunt22pgRomName, NULL, NULL , GauntletInputInfo, DrvDIPInfo, - Gaunt2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 336, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_ginganin.cpp b/jan/src/burn/drv/pre90s/d_ginganin.cpp deleted file mode 100644 index 0e60a6f5b..000000000 --- a/jan/src/burn/drv/pre90s/d_ginganin.cpp +++ /dev/null @@ -1,756 +0,0 @@ -// FB Alpha Ginga NinkyouDen driver module -// Based on MAME driver by Luca Elia and Takahiro Nogi - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "m6809_intf.h" -#include "burn_y8950.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT16 *layer_control; -static UINT16 *scroll; - -static UINT8 MC6840_idx0; -static UINT8 MC6840_idx1; -static UINT8 MC6840_reg0; -static UINT8 MC6840_reg1; -static UINT8 MC6840_tempo; -static UINT8 MC6840_tempo2; -static UINT8 MC6840_ctr; -static UINT8 MC6840_flag; - -static UINT8 DrvJoy1[16]; -static UINT16 DrvInputs[1]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo GinganinInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 12, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 14, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 13, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 7, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 8, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 9, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 10, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 11, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ginganin) - -static struct BurnDIPInfo GinganinDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x38, 0x00, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x20, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Infinite Lives" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play & Invulnerability" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x02, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x08, 0x00, "Upright" }, - {0x12, 0x01, 0x08, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze (Cheat)" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ginganin) - -void __fastcall ginganin_write_word(UINT32 address, UINT16 data) -{ - if (address < 0x20000) return; - - switch (address) - { - case 0x060000: // scrolly fg - case 0x060002: // scrollx fg - case 0x060004: // scrolly bg - case 0x060006: // scrollx bg - scroll[(address & 6) / 2] = data; - return; - - case 0x060008: - *layer_control = data; - return; - - case 0x06000c: - *flipscreen = ~data & 1; - return; - - case 0x06000e: - *soundlatch = data & 0xff; - M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // nmi - return; - } -} - -UINT16 __fastcall ginganin_read_word(UINT32 address) -{ - switch (address) - { - case 0x070000: - return DrvInputs[0]; - - case 0x070002: - return (DrvDips[0] | (DrvDips[1] << 8)); - } - - return 0; -} - -void __fastcall ginganin_write_byte(UINT32 /*address*/, UINT8 /*data*/) -{ - return; -} - -UINT8 __fastcall ginganin_read_byte(UINT32 /*address*/) -{ - return 0; -} - -void ginganin_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0800: - { - MC6840_idx0 = data; - MC6840_flag = MC6840_idx0 / 0x80; - - if (MC6840_flag && MC6840_reg0 != MC6840_tempo && MC6840_reg0 != 0) { - MC6840_tempo = MC6840_reg0; - } - } - return; - - case 0x0801: - MC6840_idx1 = data; - return; - - case 0x0802: - MC6840_reg0 = data; - return; - - case 0x0803: - MC6840_reg1 = data; - return; - - case 0x2000: - case 0x2001: // y8950 - BurnY8950Write(0, address & 1, data); - return; - - case 0x2800: - case 0x2801: - AY8910Write(0, address & 1, data); - return; - } -} - -UINT8 ginganin_sound_read(UINT16 address) -{ - if (address == 0x1800) { - return *soundlatch; - } - - bprintf(PRINT_NORMAL, _T("read %x\n"), address); - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / 1000000; -} - -static void DrvGfxDecode(UINT8 *src, INT32 len, INT32 size) -{ - INT32 Planes[4] = { 0x000, 0x001, 0x002, 0x003 }; - INT32 XOffs[16] = { 0x000, 0x004, 0x008, 0x00c, 0x010, 0x014, 0x018, 0x01c, - 0x200, 0x204, 0x208, 0x20c, 0x210, 0x214, 0x218, 0x21c }; - INT32 YOffs[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return; - } - - memcpy (tmp, src, len); - - GfxDecode((len * 2) / (size * size), 4, size, size, Planes, XOffs, YOffs, (size * size * 4), tmp, src); - - BurnFree (tmp); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - AY8910Reset(0); - BurnY8950Reset(); - - MC6840_idx0 = 0; - MC6840_idx1 = 0; - MC6840_reg0 = 0; - MC6840_reg1 = 0; - MC6840_flag = 0; - MC6840_tempo = 0; - MC6840_tempo2 = 0; - MC6840_ctr = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x020000; - DrvM6809ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x040000; - DrvGfxROM2 = Next; Next += 0x008000; - DrvGfxROM3 = Next; Next += 0x100000; - DrvGfxROM4 = Next; Next += 0x008000; - - DrvSndROM = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvM6809RAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x004000; - DrvTxtRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - - layer_control = (UINT16*)Next; Next += 0x000001 * sizeof(UINT16); - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - scroll = (UINT16*)Next; Next += 0x000004 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvM6809ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x010000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 8, 1)) return 1; - memcpy (DrvGfxROM3 + 0x40000, DrvGfxROM3 + 0x10000, 0x10000); - if (BurnLoadRom(DrvGfxROM3 + 0x010000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x030000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 12, 1)) return 1; - BurnByteswap(DrvGfxROM4, 0x8000); - - if (BurnLoadRom(DrvSndROM + 0x000000, 13, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x010000, 14, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x20000, 16); - DrvGfxDecode(DrvGfxROM1, 0x20000, 16); - DrvGfxDecode(DrvGfxROM2, 0x04000, 8); - DrvGfxDecode(DrvGfxROM3, 0x50000, 16); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x020000, 0x023fff, MAP_RAM); - SekMapMemory(DrvTxtRAM, 0x030000, 0x0307ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x040000, 0x0407ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x050000, 0x0507ff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x068000, 0x06bfff, MAP_RAM); - SekSetWriteWordHandler(0, ginganin_write_word); - SekSetWriteByteHandler(0, ginganin_write_byte); - SekSetReadWordHandler(0, ginganin_read_word); - SekSetReadByteHandler(0, ginganin_read_byte); - SekClose(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x4000, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(ginganin_sound_write); - M6809SetReadHandler(ginganin_sound_read); - M6809Close(); - - AY8910Init(0, 3579545 / 2, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 3579545, DrvSndROM, 0x20000, NULL, 0, NULL, &DrvSynchroniseStream, 1); - BurnTimerAttachM6809Y8950(1000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - M6809Exit(); - - BurnY8950Exit(); - AY8910Exit(0); - - BurnFree (AllMem); - - return 0; -} - -static void DrvRecalcPalette() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x800 / 2; i++) - { - INT32 r = (pal[i] >> 12) & 0x0f; - INT32 g = (pal[i] >> 8) & 0x0f; - INT32 b = (pal[i] >> 4) & 0x0f; - - DrvPalette[i] = BurnHighCol((r << 4) | r, (g << 4) | g, (b << 4) | b, 0); - } -} - -static void draw_layer(UINT8 *ram, UINT8 *gfx, INT32 color_offset, INT32 wide, INT32 scroll_offset, INT32 transparent) -{ - INT32 scrollx = scroll[scroll_offset + 1] & ((wide * 16) - 1); - INT32 scrolly = scroll[scroll_offset + 0] & 0x01ff; - - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 16 * 16 + 16; offs++) - { - INT32 ofst = ((((offs >> 4) + (scrollx >> 4)) & (wide-1)) << 5) + (((offs & 0xf) + (scrolly >> 4)) & 0x01f); - - INT32 sy = ((offs & 0xf) << 4) - (scrolly & 0x0f); - INT32 sx = ((offs >> 4) << 4) - (scrollx & 0x0f); - - INT32 attr = vram[ofst]; - - if (*flipscreen) { - if (transparent) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, attr & 0x3ff, 240 - sx, 240 - sy - 16, attr >> 12, 4, 0x0f, color_offset, gfx); - } else { - Render16x16Tile_FlipXY_Clip(pTransDraw, attr & 0x3ff, 240 - sx, 240 - sy - 16, attr >> 12, 4, color_offset, gfx); - } - } else { - if (transparent) { - Render16x16Tile_Mask_Clip(pTransDraw, attr & 0x3ff, sx, sy - 16, attr >> 12, 4, 0x0f, color_offset, gfx); - } else { - Render16x16Tile_Clip(pTransDraw, attr & 0x3ff, sx, sy - 16, attr >> 12, 4, color_offset, gfx); - } - } - } -} - -static void draw_txt_layer() -{ - UINT16 *vram = (UINT16*)DrvTxtRAM; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - if (sy < 16 || sy > 240) continue; - - INT32 attr = vram[offs]; - - if (*flipscreen) { - Render8x8Tile_Mask_FlipXY(pTransDraw, attr & 0x1ff, sx ^ 0xf8, (sy ^ 0xf8) - 16, attr >> 12, 4, 0x0f, 0x000, DrvGfxROM2); - } else { - Render8x8Tile_Mask(pTransDraw, attr & 0x1ff, sx, sy - 16, attr >> 12, 4, 0x0f, 0x000, DrvGfxROM2); - } - } -} - -static void draw_sprites() -{ - UINT16 *vram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x800 / 2; offs += 4) - { - INT32 sy = vram[offs + 0]; - INT32 sx = vram[offs + 1]; - INT32 code = vram[offs + 2]; - INT32 color = vram[offs + 3] >> 12; - INT32 flipx = code & 0x4000; - INT32 flipy = code & 0x8000; - - sx = (sx & 0xff) - (sx & 0x100); - sy = (sy & 0xff) - (sy & 0x100); - code &= 0xfff; - - if (code >= 0xa00) continue; - - if (*flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx ^= 0x4000; - flipy ^= 0x8000; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0x0f, 0x100, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0x0f, 0x100, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0x0f, 0x100, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0x0f, 0x100, DrvGfxROM3); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - if (*layer_control & 0x01) { - draw_layer(DrvGfxROM4, DrvGfxROM0, 0x300, 0x200, 2, 0); - } else { - BurnTransferClear(); - } - - if (*layer_control & 0x02) { - draw_layer(DrvFgRAM, DrvGfxROM1, 0x200, 0x100, 0, 1); - } - - if (*layer_control & 0x08) { - draw_sprites(); - } - - if (*layer_control & 0x04) { - draw_txt_layer(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void sound_interrupt() -{ - if (MC6840_tempo2 != MC6840_tempo) { - MC6840_tempo2 = MC6840_tempo; - MC6840_ctr = 0; - } - - if (MC6840_flag) { - if (MC6840_ctr > MC6840_tempo) { - MC6840_ctr = 0; - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } else { - MC6840_ctr++; - } - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0xffff; - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - } - - INT32 nInterleave = 60; - INT32 nCyclesTotal[2] = { 6000000 / 60, 1000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - M6809NewFrame(); - - SekOpen(0); - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment; - - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - nSegment = nCyclesTotal[1] / nInterleave; - BurnTimerUpdateY8950(i * (nCyclesTotal[1] / nInterleave)); - sound_interrupt(); - } - - SekClose(); - - BurnTimerEndFrameY8950(nCyclesTotal[1]); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - - BurnY8950Update(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029722; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - M6809Scan(nAction); - - AY8910Scan(nAction, pnMin); - BurnY8950Scan(nAction, pnMin); - - SCAN_VAR(MC6840_idx0); - SCAN_VAR(MC6840_idx1); - SCAN_VAR(MC6840_reg0); - SCAN_VAR(MC6840_reg1); - SCAN_VAR(MC6840_tempo); - SCAN_VAR(MC6840_tempo2); - SCAN_VAR(MC6840_ctr); - SCAN_VAR(MC6840_flag); - } - - return 0; -} - - -// Ginga NinkyouDen (set 1) - -static struct BurnRomInfo ginganinRomDesc[] = { - { "gn_02.bin", 0x10000, 0x4a4e012f, 1 | BRF_PRG | BRF_ESS }, // 0 M68000 Code - { "gn_01.bin", 0x10000, 0x30256fcb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gn_05.bin", 0x10000, 0xe76e10e7, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 Code - - { "gn_15.bin", 0x10000, 0x1b8ac9fb, 3 | BRF_GRA }, // 3 Background Tiles - { "gn_14.bin", 0x10000, 0xe73fe668, 3 | BRF_GRA }, // 4 - - { "gn_12.bin", 0x10000, 0xc134a1e9, 4 | BRF_GRA }, // 5 Foreground Tiles - { "gn_13.bin", 0x10000, 0x1d3bec21, 4 | BRF_GRA }, // 6 - - { "gn_10.bin", 0x04000, 0xae371b2d, 5 | BRF_GRA }, // 7 Characters - - { "gn_06.bin", 0x20000, 0xbdc65835, 6 | BRF_GRA }, // 8 Sprites - { "gn_07.bin", 0x10000, 0xc2b8eafe, 6 | BRF_GRA }, // 9 - { "gn_08.bin", 0x10000, 0xf7c73c18, 6 | BRF_GRA }, // 10 - { "gn_09.bin", 0x10000, 0xa5e07c3b, 6 | BRF_GRA }, // 11 - - { "gn_11.bin", 0x08000, 0xf0d0e605, 7 | BRF_GRA }, // 12 Background Tilemap - - { "gn_04.bin", 0x10000, 0x0ed9133b, 8 | BRF_SND }, // 13 Y8950 Samples - { "gn_03.bin", 0x10000, 0xf1ba222c, 8 | BRF_SND }, // 14 -}; - -STD_ROM_PICK(ginganin) -STD_ROM_FN(ginganin) - -struct BurnDriver BurnDrvGinganin = { - "ginganin", NULL, NULL, NULL, "1987", - "Ginga NinkyouDen (set 1)\0", NULL, "Jaleco", "Miscellaneous", - L"\u9280\u6CB3\u4EFB\u4FA0\u4F1D\0Ginga NinkyouDen (set 1)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, ginganinRomInfo, ginganinRomName, NULL, NULL, GinganinInputInfo, GinganinDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Ginga NinkyouDen (set 2) - -static struct BurnRomInfo ginganinaRomDesc[] = { - { "2.bin", 0x10000, 0x6da1d8a3, 1 | BRF_PRG | BRF_ESS }, // 0 M68000 Code - { "1.bin", 0x10000, 0x0bd32d59, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gn_05.bin", 0x10000, 0xe76e10e7, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 Code - - { "gn_15.bin", 0x10000, 0x1b8ac9fb, 3 | BRF_GRA }, // 3 Background Tiles - { "gn_14.bin", 0x10000, 0xe73fe668, 3 | BRF_GRA }, // 4 - - { "gn_12.bin", 0x10000, 0xc134a1e9, 4 | BRF_GRA }, // 5 Foreground Tiles - { "gn_13.bin", 0x10000, 0x1d3bec21, 4 | BRF_GRA }, // 6 - - { "10.bin", 0x04000, 0x48a20745, 5 | BRF_GRA }, // 7 Characters - - { "gn_06.bin", 0x20000, 0xbdc65835, 6 | BRF_GRA }, // 8 Sprites - { "gn_07.bin", 0x10000, 0xc2b8eafe, 6 | BRF_GRA }, // 9 - { "gn_08.bin", 0x10000, 0xf7c73c18, 6 | BRF_GRA }, // 10 - { "gn_09.bin", 0x10000, 0xa5e07c3b, 6 | BRF_GRA }, // 11 - - { "gn_11.bin", 0x08000, 0xf0d0e605, 7 | BRF_GRA }, // 12 Background Tilemap - - { "gn_04.bin", 0x10000, 0x0ed9133b, 8 | BRF_SND }, // 13 Y8950 Samples - { "gn_03.bin", 0x10000, 0xf1ba222c, 8 | BRF_SND }, // 14 -}; - -STD_ROM_PICK(ginganina) -STD_ROM_FN(ginganina) - -struct BurnDriver BurnDrvGinganina = { - "ginganina", "ginganin", NULL, NULL, "1987", - "Ginga NinkyouDen (set 2)\0", NULL, "Jaleco", "Miscellaneous", - L"\u9280\u6CB3\u4EFB\u4FA0\u4F1D\0Ginga NinkyouDen (set 2)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, ginganinaRomInfo, ginganinaRomName, NULL, NULL, GinganinInputInfo, GinganinDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_gng.cpp b/jan/src/burn/drv/pre90s/d_gng.cpp deleted file mode 100644 index b2f94333a..000000000 --- a/jan/src/burn/drv/pre90s/d_gng.cpp +++ /dev/null @@ -1,1585 +0,0 @@ -// FB Alpha Ghosts'n Goblins driver module -// Based on MAME driver by Pierpaolo Prazzoli - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "burn_ym2203.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvM6809Rom = NULL; -static UINT8 *DrvZ80Rom = NULL; -static UINT8 *DrvM6809Ram = NULL; -static UINT8 *DrvZ80Ram = NULL; -static UINT8 *DrvFgVideoRam = NULL; -static UINT8 *DrvBgVideoRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvSpriteRamBuffer = NULL; -static UINT8 *DrvPaletteRam1 = NULL; -static UINT8 *DrvPaletteRam2 = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvRomBank; -static UINT8 DrvBgScrollX[2]; -static UINT8 DrvBgScrollY[2]; -static UINT8 DrvSoundLatch; - -static INT32 RomLoadOffset = 0; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; -static INT32 nExtraCycles = 0; - -static INT32 Diamond; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 5, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo DiamondInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Diamond) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xdf, NULL }, - {0x13, 0xff, 0xff, 0xfb, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Coinage" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Plays" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Play" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Plays" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Plays" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Plays" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Plays" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Plays" }, - {0x12, 0x01, 0x0f, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 2 , "Coinage affects" }, - {0x12, 0x01, 0x10, 0x10, "Coin A" }, - {0x12, 0x01, 0x10, 0x00, "Coin B" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "20k 70k 70k" }, - {0x13, 0x01, 0x18, 0x10, "30k 80k 80k" }, - {0x13, 0x01, 0x18, 0x08, "20k 80k" }, - {0x13, 0x01, 0x18, 0x00, "30k 80k" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x60, 0x40, "Easy" }, - {0x13, 0x01, 0x60, 0x60, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo DrvjDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xdf, NULL }, - {0x13, 0xff, 0xff, 0xfb, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Coinage" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Plays" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Play" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Plays" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Plays" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Plays" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Plays" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Plays" }, - {0x12, 0x01, 0x0f, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 2 , "Coinage affects" }, - {0x12, 0x01, 0x10, 0x10, "Coin A" }, - {0x12, 0x01, 0x10, 0x00, "Coin B" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x04, 0x00, "Upright" }, - {0x13, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "20k 70k 70k" }, - {0x13, 0x01, 0x18, 0x10, "30k 80k 80k" }, - {0x13, 0x01, 0x18, 0x08, "20k 80k" }, - {0x13, 0x01, 0x18, 0x00, "30k 80k" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x60, 0x40, "Easy" }, - {0x13, 0x01, 0x60, 0x60, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Difficult" }, - {0x13, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Drvj) - -static struct BurnDIPInfo DiamondDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0x81, NULL }, - {0x0b, 0xff, 0xff, 0x07, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0a, 0x01, 0x03, 0x00, "2" }, - {0x0a, 0x01, 0x03, 0x01, "3" }, - {0x0a, 0x01, 0x03, 0x02, "4" }, - {0x0a, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 4 , "Credits A" }, - {0x0a, 0x01, 0x0c, 0x00, "x1" }, - {0x0a, 0x01, 0x0c, 0x04, "x2" }, - {0x0a, 0x01, 0x0c, 0x08, "x3" }, - {0x0a, 0x01, 0x0c, 0x0c, "x4" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0a, 0x01, 0x30, 0x30, "4 Coins 1 Play" }, - {0x0a, 0x01, 0x30, 0x20, "3 Coins 1 Play" }, - {0x0a, 0x01, 0x30, 0x10, "2 Coins 1 Play" }, - {0x0a, 0x01, 0x30, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0a, 0x01, 0x80, 0x80, "Off" }, - {0x0a, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Energy Loss" }, - {0x0b, 0x01, 0x0f, 0x00, "Slowest" }, - {0x0b, 0x01, 0x0f, 0x01, "-6 Slower" }, - {0x0b, 0x01, 0x0f, 0x02, "-5 Slower" }, - {0x0b, 0x01, 0x0f, 0x03, "-4 Slower" }, - {0x0b, 0x01, 0x0f, 0x04, "-3 Slower" }, - {0x0b, 0x01, 0x0f, 0x05, "-2 Slower" }, - {0x0b, 0x01, 0x0f, 0x06, "-1 Slower" }, - {0x0b, 0x01, 0x0f, 0x07, "Normal" }, - {0x0b, 0x01, 0x0f, 0x08, "+1 Faster" }, - {0x0b, 0x01, 0x0f, 0x09, "+2 Faster" }, - {0x0b, 0x01, 0x0f, 0x0a, "+3 Faster" }, - {0x0b, 0x01, 0x0f, 0x0b, "+4 Faster" }, - {0x0b, 0x01, 0x0f, 0x0c, "+5 Faster" }, - {0x0b, 0x01, 0x0f, 0x0d, "+6 Faster" }, - {0x0b, 0x01, 0x0f, 0x0e, "+7 Faster" }, - {0x0b, 0x01, 0x0f, 0x0f, "Fastest" }, - - {0 , 0xfe, 0 , 4 , "Credits B" }, - {0x0b, 0x01, 0x30, 0x00, "x1" }, - {0x0b, 0x01, 0x30, 0x10, "x2" }, - {0x0b, 0x01, 0x30, 0x20, "x3" }, - {0x0b, 0x01, 0x30, 0x30, "x4" }, -}; - -STDDIPINFO(Diamond) - -static struct BurnRomInfo DrvRomDesc[] = { - { "gg4.bin", 0x04000, 0x66606beb, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "gg3.bin", 0x08000, 0x9e01c65e, BRF_ESS | BRF_PRG }, // 1 - { "gg5.bin", 0x08000, 0xd6397b2b, BRF_ESS | BRF_PRG }, // 2 - - { "gg2.bin", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "gg1.bin", 0x04000, 0xecfccf07, BRF_GRA }, // 4 Characters - - { "gg11.bin", 0x04000, 0xddd56fa9, BRF_GRA }, // 5 Tiles - { "gg10.bin", 0x04000, 0x7302529d, BRF_GRA }, // 6 - { "gg9.bin", 0x04000, 0x20035bda, BRF_GRA }, // 7 - { "gg8.bin", 0x04000, 0xf12ba271, BRF_GRA }, // 8 - { "gg7.bin", 0x04000, 0xe525207d, BRF_GRA }, // 9 - { "gg6.bin", 0x04000, 0x2d77e9b2, BRF_GRA }, // 10 - - { "gg17.bin", 0x04000, 0x93e50a8f, BRF_GRA }, // 11 Sprites - { "gg16.bin", 0x04000, 0x06d7e5ca, BRF_GRA }, // 12 - { "gg15.bin", 0x04000, 0xbc1fe02d, BRF_GRA }, // 13 - { "gg14.bin", 0x04000, 0x6aaf12f9, BRF_GRA }, // 14 - { "gg13.bin", 0x04000, 0xe80c3fca, BRF_GRA }, // 15 - { "gg12.bin", 0x04000, 0x7780a925, BRF_GRA }, // 16 - - { "tbp24s10.14k", 0x00100, 0x0eaf5158, BRF_GRA }, // 17 PROMs - { "63s141.2e", 0x00100, 0x4a1285a4, BRF_GRA }, // 18 - - { "gg-pal10l8.bin",0x0002c, 0x87f1b7e0, BRF_GRA }, // 19 PLDs -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvaRomDesc[] = { - { "gng.n10", 0x04000, 0x60343188, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "gng.n9", 0x04000, 0xb6b91cfb, BRF_ESS | BRF_PRG }, // 1 - { "gng.n8", 0x04000, 0xa5cfa928, BRF_ESS | BRF_PRG }, // 2 - { "gng.n13", 0x04000, 0xfd9a8dda, BRF_ESS | BRF_PRG }, // 3 - { "gng.n12", 0x04000, 0x13cf6238, BRF_ESS | BRF_PRG }, // 4 - - { "gg2.bin", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 5 Z80 Program - - { "gg1.bin", 0x04000, 0xecfccf07, BRF_GRA }, // 6 Characters - - { "gg11.bin", 0x04000, 0xddd56fa9, BRF_GRA }, // 7 Tiles - { "gg10.bin", 0x04000, 0x7302529d, BRF_GRA }, // 8 - { "gg9.bin", 0x04000, 0x20035bda, BRF_GRA }, // 9 - { "gg8.bin", 0x04000, 0xf12ba271, BRF_GRA }, // 10 - { "gg7.bin", 0x04000, 0xe525207d, BRF_GRA }, // 11 - { "gg6.bin", 0x04000, 0x2d77e9b2, BRF_GRA }, // 12 - - { "gg17.bin", 0x04000, 0x93e50a8f, BRF_GRA }, // 13 Sprites - { "gg16.bin", 0x04000, 0x06d7e5ca, BRF_GRA }, // 14 - { "gg15.bin", 0x04000, 0xbc1fe02d, BRF_GRA }, // 15 - { "gg14.bin", 0x04000, 0x6aaf12f9, BRF_GRA }, // 16 - { "gg13.bin", 0x04000, 0xe80c3fca, BRF_GRA }, // 17 - { "gg12.bin", 0x04000, 0x7780a925, BRF_GRA }, // 18 - - { "tbp24s10.14k", 0x00100, 0x0eaf5158, BRF_GRA }, // 19 PROMs - { "63s141.2e", 0x00100, 0x4a1285a4, BRF_GRA }, // 20 -}; - -STD_ROM_PICK(Drva) -STD_ROM_FN(Drva) - -static struct BurnRomInfo DrvcRomDesc[] = { - { "mm_c_04", 0x04000, 0x4f94130f, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "mm_c_03", 0x08000, 0x1def138a, BRF_ESS | BRF_PRG }, // 1 - { "mm_c_05", 0x08000, 0xed28e86e, BRF_ESS | BRF_PRG }, // 2 - - { "gg2.bin", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "gg1.bin", 0x04000, 0xecfccf07, BRF_GRA }, // 4 Characters - - { "gg11.bin", 0x04000, 0xddd56fa9, BRF_GRA }, // 5 Tiles - { "gg10.bin", 0x04000, 0x7302529d, BRF_GRA }, // 6 - { "gg9.bin", 0x04000, 0x20035bda, BRF_GRA }, // 7 - { "gg8.bin", 0x04000, 0xf12ba271, BRF_GRA }, // 8 - { "gg7.bin", 0x04000, 0xe525207d, BRF_GRA }, // 9 - { "gg6.bin", 0x04000, 0x2d77e9b2, BRF_GRA }, // 10 - - { "gg17.bin", 0x04000, 0x93e50a8f, BRF_GRA }, // 11 Sprites - { "gg16.bin", 0x04000, 0x06d7e5ca, BRF_GRA }, // 12 - { "gg15.bin", 0x04000, 0xbc1fe02d, BRF_GRA }, // 13 - { "gg14.bin", 0x04000, 0x6aaf12f9, BRF_GRA }, // 14 - { "gg13.bin", 0x04000, 0xe80c3fca, BRF_GRA }, // 15 - { "gg12.bin", 0x04000, 0x7780a925, BRF_GRA }, // 16 - - { "tbp24s10.14k", 0x00100, 0x0eaf5158, BRF_GRA }, // 17 PROMs - { "63s141.2e", 0x00100, 0x4a1285a4, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Drvc) -STD_ROM_FN(Drvc) - -static struct BurnRomInfo DrvblRomDesc[] = { - { "5.84490.10n", 0x04000, 0x66606beb, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "4.84490.9n", 0x04000, 0x527f5c39, BRF_ESS | BRF_PRG }, // 1 - { "3.84490.8n", 0x04000, 0x1c5175d5, BRF_ESS | BRF_PRG }, // 2 - { "7.84490.13n", 0x04000, 0xfd9a8dda, BRF_ESS | BRF_PRG }, // 3 - { "6.84490.12n", 0x04000, 0xc83dbd10, BRF_ESS | BRF_PRG }, // 4 - - { "2.8529.13h", 0x08000, 0x55cfb196, BRF_ESS | BRF_PRG }, // 5 Z80 Program - - { "1.84490.11e", 0x04000, 0xecfccf07, BRF_GRA }, // 6 Characters - - { "13.84490.3e", 0x04000, 0xddd56fa9, BRF_GRA }, // 7 Tiles - { "12.84490.1e", 0x04000, 0x7302529d, BRF_GRA }, // 8 - { "11.84490.3c", 0x04000, 0x20035bda, BRF_GRA }, // 9 - { "10.84490.1c", 0x04000, 0xf12ba271, BRF_GRA }, // 10 - { "9.84490.3b", 0x04000, 0xe525207d, BRF_GRA }, // 11 - { "8.84490.1b", 0x04000, 0x2d77e9b2, BRF_GRA }, // 12 - - { "19.84472.4n", 0x04000, 0x4613afdc, BRF_GRA }, // 13 Sprites - { "18.84472.3n", 0x04000, 0x06d7e5ca, BRF_GRA }, // 14 - { "17.84472.1n", 0x04000, 0xbc1fe02d, BRF_GRA }, // 15 - { "16.84472.4l", 0x04000, 0x608d68d5, BRF_GRA }, // 16 - { "15.84490.3l", 0x04000, 0xe80c3fca, BRF_GRA }, // 17 - { "14.84490.1l", 0x04000, 0x7780a925, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Drvbl) -STD_ROM_FN(Drvbl) - -static struct BurnRomInfo DrvblaRomDesc[] = { - { "3.bin", 0x04000, 0x4859d068, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "4.bin", 0x04000, 0x08322bef, BRF_ESS | BRF_PRG }, // 1 - { "5.bin", 0x04000, 0x888d7764, BRF_ESS | BRF_PRG }, // 2 - { "gng.n13", 0x04000, 0xfd9a8dda, BRF_ESS | BRF_PRG }, // 3 - { "2.bin", 0x04000, 0xf32c2e55, BRF_ESS | BRF_PRG }, // 4 - - { "gg2.bin", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 5 Z80 Program - - { "gg1.bin", 0x04000, 0xecfccf07, BRF_GRA }, // 5 Characters - - { "gg11.bin", 0x04000, 0xddd56fa9, BRF_GRA }, // 7 Tiles - { "gg10.bin", 0x04000, 0x7302529d, BRF_GRA }, // 8 - { "gg9.bin", 0x04000, 0x20035bda, BRF_GRA }, // 9 - { "gg8.bin", 0x04000, 0xf12ba271, BRF_GRA }, // 10 - { "gg7.bin", 0x04000, 0xe525207d, BRF_GRA }, // 11 - { "gg6.bin", 0x04000, 0x2d77e9b2, BRF_GRA }, // 12 - - { "19.84472.4n", 0x04000, 0x4613afdc, BRF_GRA }, // 13 Sprites - { "18.84472.3n", 0x04000, 0x06d7e5ca, BRF_GRA }, // 14 - { "17.84472.1n", 0x04000, 0xbc1fe02d, BRF_GRA }, // 15 - { "16.84472.4l", 0x04000, 0x608d68d5, BRF_GRA }, // 16 - { "15.84490.3l", 0x04000, 0xe80c3fca, BRF_GRA }, // 17 - { "14.84490.1l", 0x04000, 0x7780a925, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Drvbla) -STD_ROM_FN(Drvbla) - -static struct BurnRomInfo DrvblitaRomDesc[] = { - { "3", 0x04000, 0x4859d068, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "4-5", 0x08000, 0x233a4589, BRF_ESS | BRF_PRG }, // 1 - { "1-2", 0x08000, 0xed28e86e, BRF_ESS | BRF_PRG }, // 2 - - { "gg2.bin", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "gg1.bin", 0x04000, 0xecfccf07, BRF_GRA }, // 4 Characters - - { "gg11.bin", 0x04000, 0xddd56fa9, BRF_GRA }, // 5 Tiles - { "gg10.bin", 0x04000, 0x7302529d, BRF_GRA }, // 6 - { "gg9.bin", 0x04000, 0x20035bda, BRF_GRA }, // 7 - { "gg8.bin", 0x04000, 0xf12ba271, BRF_GRA }, // 8 - { "gg7.bin", 0x04000, 0xe525207d, BRF_GRA }, // 9 - { "gg6.bin", 0x04000, 0x2d77e9b2, BRF_GRA }, // 10 - - { "gg17.bin", 0x04000, 0x93e50a8f, BRF_GRA }, // 11 Sprites - { "gg16.bin", 0x04000, 0x06d7e5ca, BRF_GRA }, // 12 - { "gg15.bin", 0x04000, 0xbc1fe02d, BRF_GRA }, // 13 - { "gg14.bin", 0x04000, 0x6aaf12f9, BRF_GRA }, // 14 - { "gg13.bin", 0x04000, 0xe80c3fca, BRF_GRA }, // 15 - { "gg12.bin", 0x04000, 0x7780a925, BRF_GRA }, // 16 - - { "tbp24s10.14k", 0x00100, 0x0eaf5158, BRF_GRA }, // 17 PROMs - { "63s141.2e", 0x00100, 0x4a1285a4, BRF_GRA }, // 18 - - { "gg-pal10l8.bin",0x0002c, 0x87f1b7e0, BRF_GRA }, // 19 PLDs -}; - -STD_ROM_PICK(Drvblita) -STD_ROM_FN(Drvblita) - -static struct BurnRomInfo DrvprotRomDesc[] = { - { "gg10n.bin", 0x04000, 0x5d2a2c90, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "gg9n.bin", 0x04000, 0x30eb183d, BRF_ESS | BRF_PRG }, // 1 - { "gg8n.bin", 0x04000, 0x4b5e2145, BRF_ESS | BRF_PRG }, // 2 - { "gg13n.bin", 0x04000, 0x2664aae6, BRF_ESS | BRF_PRG }, // 3 - { "gg12n.bin", 0x04000, 0xc7ef4ae8, BRF_ESS | BRF_PRG }, // 4 - - { "gg14h.bin", 0x08000, 0x55cfb196, BRF_ESS | BRF_PRG }, // 5 Z80 Program - - { "1.84490.11e", 0x04000, 0xecfccf07, BRF_GRA }, // 6 Characters - - { "gg3e.bin", 0x04000, 0x68db22c8, BRF_GRA }, // 7 Tiles - { "gg1e.bin", 0x04000, 0xdad8dd2f, BRF_GRA }, // 8 - { "gg3c.bin", 0x04000, 0x7a158323, BRF_GRA }, // 9 - { "gg1c.bin", 0x04000, 0x7314d095, BRF_GRA }, // 10 - { "gg3b.bin", 0x04000, 0x03a96d9b, BRF_GRA }, // 11 - { "gg1b.bin", 0x04000, 0x7b9899bc, BRF_GRA }, // 12 - - { "gg4l.bin", 0x04000, 0x49cf81b4, BRF_GRA }, // 13 Sprites - { "gg3l.bin", 0x04000, 0xe61437b1, BRF_GRA }, // 14 - { "gg1l.bin", 0x04000, 0xbc1fe02d, BRF_GRA }, // 15 - { "gg4n.bin", 0x04000, 0xd5aff5a7, BRF_GRA }, // 16 - { "gg3n.bin", 0x04000, 0xd589caeb, BRF_GRA }, // 17 - { "gg1n.bin", 0x04000, 0x7780a925, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Drvprot) -STD_ROM_FN(Drvprot) - -static struct BurnRomInfo DrvtRomDesc[] = { - { "mmt04d.10n", 0x04000, 0x652406f6, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "mmt03d.8n", 0x08000, 0xfb040b42, BRF_ESS | BRF_PRG }, // 1 - { "mmt05d.13n", 0x08000, 0x8f7cff61, BRF_ESS | BRF_PRG }, // 2 - - { "mm02.14h", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "mm01.11e", 0x04000, 0xecfccf07, BRF_GRA }, // 4 Characters - - { "mm11.3e", 0x04000, 0xddd56fa9, BRF_GRA }, // 5 Tiles - { "mm10.1e", 0x04000, 0x7302529d, BRF_GRA }, // 6 - { "mm09.3c", 0x04000, 0x20035bda, BRF_GRA }, // 7 - { "mm08.1c", 0x04000, 0xf12ba271, BRF_GRA }, // 8 - { "mm07.3b", 0x04000, 0xe525207d, BRF_GRA }, // 9 - { "mm06.1b", 0x04000, 0x2d77e9b2, BRF_GRA }, // 10 - - { "mm17.4n", 0x04000, 0x93e50a8f, BRF_GRA }, // 11 Sprites - { "mm16.3n", 0x04000, 0x06d7e5ca, BRF_GRA }, // 12 - { "mm15.1n", 0x04000, 0xbc1fe02d, BRF_GRA }, // 13 - { "mm14.4l", 0x04000, 0x6aaf12f9, BRF_GRA }, // 14 - { "mm13.3l", 0x04000, 0xe80c3fca, BRF_GRA }, // 15 - { "mm12.1l", 0x04000, 0x7780a925, BRF_GRA }, // 16 - - { "m-02.14k", 0x00100, 0x0eaf5158, BRF_GRA }, // 17 PROMs - { "m-01.2e", 0x00100, 0x4a1285a4, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Drvt) -STD_ROM_FN(Drvt) - -static struct BurnRomInfo MakaimurRomDesc[] = { - { "10n.rom", 0x04000, 0x81e567e0, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "8n.rom", 0x08000, 0x9612d66c, BRF_ESS | BRF_PRG }, // 1 - { "12n.rom", 0x08000, 0x65a6a97b, BRF_ESS | BRF_PRG }, // 2 - - { "gg2.bin", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "gg1.bin", 0x04000, 0xecfccf07, BRF_GRA }, // 4 Characters - - { "gg11.bin", 0x04000, 0xddd56fa9, BRF_GRA }, // 5 Tiles - { "gg10.bin", 0x04000, 0x7302529d, BRF_GRA }, // 6 - { "gg9.bin", 0x04000, 0x20035bda, BRF_GRA }, // 7 - { "gg8.bin", 0x04000, 0xf12ba271, BRF_GRA }, // 8 - { "gg7.bin", 0x04000, 0xe525207d, BRF_GRA }, // 9 - { "gg6.bin", 0x04000, 0x2d77e9b2, BRF_GRA }, // 10 - - { "gng13.n4", 0x04000, 0x4613afdc, BRF_GRA }, // 11 Sprites - { "gg16.bin", 0x04000, 0x06d7e5ca, BRF_GRA }, // 12 - { "gg15.bin", 0x04000, 0xbc1fe02d, BRF_GRA }, // 13 - { "gng16.l4", 0x04000, 0x608d68d5, BRF_GRA }, // 14 - { "gg13.bin", 0x04000, 0xe80c3fca, BRF_GRA }, // 15 - { "gg12.bin", 0x04000, 0x7780a925, BRF_GRA }, // 16 - - { "tbp24s10.14k", 0x00100, 0x0eaf5158, BRF_GRA }, // 17 PROMs - { "63s141.2e", 0x00100, 0x4a1285a4, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Makaimur) -STD_ROM_FN(Makaimur) - -static struct BurnRomInfo MakaimucRomDesc[] = { - { "mj04c.bin", 0x04000, 0x1294edb1, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "mj03c.bin", 0x08000, 0xd343332d, BRF_ESS | BRF_PRG }, // 1 - { "mj05c.bin", 0x08000, 0x535342c2, BRF_ESS | BRF_PRG }, // 2 - - { "gg2.bin", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "gg1.bin", 0x04000, 0xecfccf07, BRF_GRA }, // 4 Characters - - { "gg11.bin", 0x04000, 0xddd56fa9, BRF_GRA }, // 5 Tiles - { "gg10.bin", 0x04000, 0x7302529d, BRF_GRA }, // 6 - { "gg9.bin", 0x04000, 0x20035bda, BRF_GRA }, // 7 - { "gg8.bin", 0x04000, 0xf12ba271, BRF_GRA }, // 8 - { "gg7.bin", 0x04000, 0xe525207d, BRF_GRA }, // 9 - { "gg6.bin", 0x04000, 0x2d77e9b2, BRF_GRA }, // 10 - - { "gng13.n4", 0x04000, 0x4613afdc, BRF_GRA }, // 11 Sprites - { "gg16.bin", 0x04000, 0x06d7e5ca, BRF_GRA }, // 12 - { "gg15.bin", 0x04000, 0xbc1fe02d, BRF_GRA }, // 13 - { "gng16.l4", 0x04000, 0x608d68d5, BRF_GRA }, // 14 - { "gg13.bin", 0x04000, 0xe80c3fca, BRF_GRA }, // 15 - { "gg12.bin", 0x04000, 0x7780a925, BRF_GRA }, // 16 - - { "tbp24s10.14k", 0x00100, 0x0eaf5158, BRF_GRA }, // 17 PROMs - { "63s141.2e", 0x00100, 0x4a1285a4, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Makaimuc) -STD_ROM_FN(Makaimuc) - -static struct BurnRomInfo MakaimugRomDesc[] = { - { "mj04g.bin", 0x04000, 0x757c94d3, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "mj03g.bin", 0x08000, 0x61b043bb, BRF_ESS | BRF_PRG }, // 1 - { "mj05g.bin", 0x08000, 0xf2fdccf5, BRF_ESS | BRF_PRG }, // 2 - - { "gg2.bin", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "gg1.bin", 0x04000, 0xecfccf07, BRF_GRA }, // 4 Characters - - { "gg11.bin", 0x04000, 0xddd56fa9, BRF_GRA }, // 5 Tiles - { "gg10.bin", 0x04000, 0x7302529d, BRF_GRA }, // 6 - { "gg9.bin", 0x04000, 0x20035bda, BRF_GRA }, // 7 - { "gg8.bin", 0x04000, 0xf12ba271, BRF_GRA }, // 8 - { "gg7.bin", 0x04000, 0xe525207d, BRF_GRA }, // 9 - { "gg6.bin", 0x04000, 0x2d77e9b2, BRF_GRA }, // 10 - - { "gng13.n4", 0x04000, 0x4613afdc, BRF_GRA }, // 11 Sprites - { "gg16.bin", 0x04000, 0x06d7e5ca, BRF_GRA }, // 12 - { "gg15.bin", 0x04000, 0xbc1fe02d, BRF_GRA }, // 13 - { "gng16.l4", 0x04000, 0x608d68d5, BRF_GRA }, // 14 - { "gg13.bin", 0x04000, 0xe80c3fca, BRF_GRA }, // 15 - { "gg12.bin", 0x04000, 0x7780a925, BRF_GRA }, // 16 - - { "tbp24s10.14k", 0x00100, 0x0eaf5158, BRF_GRA }, // 17 PROMs - { "63s141.2e", 0x00100, 0x4a1285a4, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Makaimug) -STD_ROM_FN(Makaimug) - -static struct BurnRomInfo DiamondRomDesc[] = { - { "d3o", 0x04000, 0xba4bf9f1, BRF_ESS | BRF_PRG }, // 0 M6809 Program Code - { "d3", 0x08000, 0xf436d6fa, BRF_ESS | BRF_PRG }, // 1 - { "d5o", 0x08000, 0xae58bd3a, BRF_ESS | BRF_PRG }, // 2 - { "d5", 0x08000, 0x453f3f9e, BRF_ESS | BRF_PRG }, // 3 - - { "d2", 0x08000, 0x615f5b6f, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "d1", 0x04000, 0x3a24e504, BRF_GRA }, // 5 Characters - - { "d11", 0x04000, 0x754357d7, BRF_GRA }, // 6 Tiles - { "d10", 0x04000, 0x7531edcd, BRF_GRA }, // 7 - { "d9", 0x04000, 0x22eeca08, BRF_GRA }, // 8 - { "d8", 0x04000, 0x6b61be60, BRF_GRA }, // 9 - { "d7", 0x04000, 0xfd595274, BRF_GRA }, // 10 - { "d6", 0x04000, 0x7f51dcd2, BRF_GRA }, // 11 - - { "d17", 0x04000, 0x8164b005, BRF_GRA }, // 12 Sprites - { "d14", 0x04000, 0x6f132163, BRF_GRA }, // 13 - - { "prom1", 0x00100, 0x0eaf5158, BRF_GRA }, // 14 PROMs - { "prom2", 0x00100, 0x4a1285a4, BRF_GRA }, // 15 -}; - -STD_ROM_PICK(Diamond) -STD_ROM_FN(Diamond) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvM6809Rom = Next; Next += 0x14000; - DrvZ80Rom = Next; Next += 0x08000; - - RamStart = Next; - - DrvM6809Ram = Next; Next += 0x01e00; - DrvZ80Ram = Next; Next += 0x00800; - DrvSpriteRam = Next; Next += 0x00200; - DrvSpriteRamBuffer = Next; Next += 0x00200; - DrvFgVideoRam = Next; Next += 0x00800; - DrvBgVideoRam = Next; Next += 0x00800; - DrvPaletteRam1 = Next; Next += 0x00100; - DrvPaletteRam2 = Next; Next += 0x00100; - - RamEnd = Next; - - DrvChars = Next; Next += 0x400 * 8 * 8; - DrvTiles = Next; Next += 0x400 * 16 * 16; - DrvSprites = Next; Next += 0x400 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00100 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - M6809Open(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - BurnYM2203Reset(); - ZetReset(); - ZetClose(); - - HiscoreReset(); - - DrvRomBank = 0; - DrvBgScrollX[0] = DrvBgScrollX[1] = 0; - DrvBgScrollY[0] = DrvBgScrollY[1] = 0; - DrvSoundLatch = 0; - nExtraCycles = 0; - - return 0; -} - -static void bank_switch(UINT8 bank) -{ - DrvRomBank = bank & 3; - if (bank == 4) { - DrvRomBank = 4; - M6809MapMemory(DrvM6809Rom, 0x4000, 0x5fff, MAP_ROM); - } else { - M6809MapMemory(DrvM6809Rom + 0xc000 + (DrvRomBank * 0x2000), 0x4000, 0x5fff, MAP_ROM); - } -} - -UINT8 DrvGngM6809ReadByte(UINT16 Address) -{ - switch (Address) { - case 0x3000: { - return 0xff - DrvInput[0]; - } - - case 0x3001: { - return 0xff - DrvInput[1]; - } - - case 0x3002: { - return 0xff - DrvInput[2]; - } - - case 0x3003: { - return DrvDip[0]; - } - - case 0x3004: { - return DrvDip[1]; - } - - case 0x3c00: { - // nop - return 0; - } - } - - bprintf(PRINT_NORMAL, _T("M6809 Read Byte -> %04X\n"), Address); - - return 0; -} - - -void DrvGngM6809WriteByte(UINT16 Address, UINT8 Data) -{ - switch (Address) { - case 0x3a00: { - DrvSoundLatch = Data; - return; - } - - case 0x3b08: { - DrvBgScrollX[0] = Data; - return; - } - - case 0x3b09: { - DrvBgScrollX[1] = Data; - return; - } - - case 0x3b0a: { - DrvBgScrollY[0] = Data; - return; - } - - case 0x3b0b: { - DrvBgScrollY[1] = Data; - return; - } - - case 0x3c00: { - // nop - return; - } - - case 0x3d00: { - // flipscreen - return; - } - - case 0x3d01: - case 0x3d02: - case 0x3d03: { - // reset sound cpu, coin counter... - return; - } - - case 0x3e00: { - bank_switch(Data); - return; - } - } - - bprintf(PRINT_NORMAL, _T("M6809 Write Byte -> %04X, %02X\n"), Address, Data); -} - -UINT8 __fastcall DrvGngZ80Read(UINT16 a) -{ - switch (a) { - case 0xc800: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall DrvGngZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0xe001: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xe002: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0xe003: { - BurnYM2203Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static void DrvRandPalette() -{ // On first boot we fill the palette with some arbatrary values to see the boot-up messages - DrvPaletteRam1[0] = 0x00; - DrvPaletteRam2[0] = 0x00; - for (INT32 i = 1; i < 0x100; i++) { - DrvPaletteRam1[i] = 0xaf; - DrvPaletteRam2[i] = 0x5a; - } -} - -static INT32 CharPlaneOffsets[2] = { 4, 0 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 8, 9, 10, 11 }; -static INT32 CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 TilePlaneOffsets[3] = { 0x80000, 0x40000, 0 }; -static INT32 TileXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 TileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 SpritePlaneOffsets[4] = { 0x80004, 0x80000, 4, 0 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 8, 9, 10, 11, 256, 257, 258, 259, 264, 265, 266, 267 }; -static INT32 SpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 3000000); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3000000; -} - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - BurnSetRefreshRate(59.59); - - DrvTempRom = (UINT8 *)BurnMalloc(0x20000); - - // Load M6809 Program Roms - if (RomLoadOffset == 2) { - nRet = BurnLoadRom(DrvM6809Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6809Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6809Rom + 0x08000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6809Rom + 0x0c000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6809Rom + 0x10000, 4, 1); if (nRet != 0) return 1; - } else { - nRet = BurnLoadRom(DrvM6809Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6809Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6809Rom + 0x0c000, 2, 1); if (nRet != 0) return 1; - } - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 3 + RomLoadOffset, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 4 + RomLoadOffset, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 6 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 7 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 8 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 9 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x14000, 10 + RomLoadOffset, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 3, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0xff, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 12 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 13 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 14 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x14000, 15 + RomLoadOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 16 + RomLoadOffset, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - // Setup the M6809 emulation - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809Ram , 0x0000, 0x1dff, MAP_RAM); - M6809MapMemory(DrvSpriteRam , 0x1e00, 0x1fff, MAP_RAM); - M6809MapMemory(DrvFgVideoRam , 0x2000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvBgVideoRam , 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvPaletteRam2 , 0x3800, 0x38ff, MAP_RAM); - M6809MapMemory(DrvPaletteRam1 , 0x3900, 0x39ff, MAP_RAM); - M6809MapMemory(DrvM6809Rom , 0x4000, 0x5fff, MAP_ROM); - M6809MapMemory(DrvM6809Rom + 0x2000 , 0x6000, 0xffff, MAP_ROM); - M6809SetReadHandler(DrvGngM6809ReadByte); - M6809SetWriteHandler(DrvGngM6809WriteByte); - M6809Close(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(DrvGngZ80Read); - ZetSetWriteHandler(DrvGngZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram ); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - DrvRandPalette(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DiamondInit() -{ - INT32 nRet = 0, nLen; - - Diamond = 1; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x20000); - - // Load M6809 Program Roms - nRet = BurnLoadRom(DrvM6809Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6809Rom + 0x04000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6809Rom + 0x0c000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6809Rom + 0x14000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x14000, 11, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 3, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0xff, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 13 + RomLoadOffset, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - // Setup the M6809 emulation - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809Ram , 0x0000, 0x1dff, MAP_RAM); - M6809MapMemory(DrvSpriteRam , 0x1e00, 0x1fff, MAP_RAM); - M6809MapMemory(DrvFgVideoRam , 0x2000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvBgVideoRam , 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvPaletteRam2 , 0x3800, 0x38ff, MAP_RAM); - M6809MapMemory(DrvPaletteRam1 , 0x3900, 0x39ff, MAP_RAM); - M6809MapMemory(DrvM6809Rom , 0x4000, 0x5fff, MAP_ROM); - M6809MapMemory(DrvM6809Rom + 0x2000 , 0x6000, 0xffff, MAP_ROM); - M6809SetReadHandler(DrvGngM6809ReadByte); - M6809SetWriteHandler(DrvGngM6809WriteByte); - M6809Close(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(DrvGngZ80Read); - ZetSetWriteHandler(DrvGngZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram ); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvM6809Rom[0x2000] = 0; - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 GngaInit() -{ - RomLoadOffset = 2; - - return DrvInit(); -} - -static INT32 DrvExit() -{ - M6809Exit(); - ZetExit(); - - BurnYM2203Exit(); - - GenericTilesExit(); - - BurnFree(Mem); - - DrvRomBank = 0; - DrvBgScrollX[0] = DrvBgScrollX[1] = 0; - DrvBgScrollY[0] = DrvBgScrollY[1] = 0; - DrvSoundLatch = 0; - - RomLoadOffset = 0; - Diamond = 0; - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 12); - g = pal4bit(nColour >> 8); - b = pal4bit(nColour >> 4); - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - for (INT32 i = 0; i < 0x100; i++) { - INT32 Val = DrvPaletteRam1[i] + (DrvPaletteRam2[i] << 8); - - DrvPalette[i] = CalcCol(Val); - } -} - -static void DrvRenderBgLayer(INT32 Priority, INT32 Opaque) -{ - INT32 mx, my, Code, Attr, Colour, x, y, TileIndex, xScroll, yScroll, Split, Flip, xFlip, yFlip; - - xScroll = DrvBgScrollX[0] | (DrvBgScrollX[1] << 8); - xScroll &= 0x1ff; - - yScroll = DrvBgScrollY[0] | (DrvBgScrollY[1] << 8); - yScroll &= 0x1ff; - - for (mx = 0; mx < 32; mx++) { - for (my = 0; my < 32; my++) { - TileIndex = (my * 32) + mx; - - Attr = DrvBgVideoRam[TileIndex + 0x400]; - Code = DrvBgVideoRam[TileIndex + 0x000]; - - Code += (Attr & 0xc0) << 2; - Colour = Attr & 0x07; - - Split = (Attr & 0x08) >> 3; - - if (Split != Priority) continue; - - Flip = (Attr & 0x30) >> 4; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - y = 16 * mx; - x = 16 * my; - - x -= xScroll; - if (x < -16) x += 512; - y -= yScroll; - if (y < -16) y += 512; - - y -= 16; - - if (Opaque) { - if (x > 16 && x < 240 && y > 16 && y < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } else { - Render16x16Tile_FlipX(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } else { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } else { - Render16x16Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 3, 0, DrvTiles); - } - } - } - } else { - if (x > 16 && x < 240 && y > 16 && y < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvTiles); - } - } - } - } - } - } -} - -static void DrvRenderSprites() -{ - for (INT32 Offs = 0x200 - 4; Offs >= 0; Offs -= 4) { - UINT8 Attr = DrvSpriteRamBuffer[Offs + 1]; - INT32 sx = DrvSpriteRamBuffer[Offs + 3] - (0x100 * (Attr & 0x01)); - INT32 sy = DrvSpriteRamBuffer[Offs + 2]; - INT32 xFlip = Attr & 0x04; - INT32 yFlip = Attr & 0x08; - INT32 Code = DrvSpriteRamBuffer[Offs + 0] + ((Attr << 2) & 0x300); - INT32 Colour = (Attr >> 4) & 3; - - if (sx > 16 && sx < 240 && sy > 16 && sy < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, sx, sy - 16, Colour, 4, 15, 0x40, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy - 16, Colour, 4, 15, 0x40, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, sx, sy - 16, Colour, 4, 15, 0x40, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy - 16, Colour, 4, 15, 0x40, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy - 16, Colour, 4, 15, 0x40, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy - 16, Colour, 4, 15, 0x40, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, sy - 16, Colour, 4, 15, 0x40, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy - 16, Colour, 4, 15, 0x40, DrvSprites); - } - } - } - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Code, Attr, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Attr = DrvFgVideoRam[TileIndex + 0x400]; - Code = DrvFgVideoRam[TileIndex + 0x000]; - - Code += (Attr & 0xc0) << 2; - Colour = Attr & 0x0f; - - Flip = (Attr & 0x30) >> 4; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - y -= 16; - - if (x > 8 && x < 248 && y > 8 && y < 216) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 2, 3, 0x80, DrvChars); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 2, 3, 0x80, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 2, 3, 0x80, DrvChars); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 2, 3, 0x80, DrvChars); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 0x80, DrvChars); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 0x80, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 0x80, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 0x80, DrvChars); - } - } - } - - TileIndex++; - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - if (nBurnLayer & 2) DrvRenderBgLayer(0, 1); - if (nSpriteEnable & 1) DrvRenderSprites(); - if (nBurnLayer & 4) DrvRenderBgLayer(1, 0); - if (nBurnLayer & 8) DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 256; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = (UINT32)((double)1500000 / 59.59); - nCyclesTotal[1] = (UINT32)((double)3000000 / 59.59); - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run M6809 - nCurrentCPU = 0; - M6809Open(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += M6809Run((i == nInterleave-1) ? nCyclesSegment - nExtraCycles : nCyclesSegment ); - if (i == 239) { - memcpy(DrvSpriteRamBuffer, DrvSpriteRam, 0x200); - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - M6809Close(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - if (i % 64 == 63) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nCyclesTotal[1]); - - nExtraCycles = nCyclesDone[0] - nCyclesTotal[0]; - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029696; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - ZetScan(nAction); - - ZetOpen(0); - BurnYM2203Scan(nAction, pnMin); - ZetClose(); - - // Scan critical driver variables - SCAN_VAR(nExtraCycles); - SCAN_VAR(DrvRomBank); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvBgScrollX); - SCAN_VAR(DrvBgScrollY); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bank_switch(DrvRomBank); - M6809Close(); - } - - return 0; -} - -struct BurnDriver BurnDrvGng = { - "gng", NULL, NULL, NULL, "1985", - "Ghosts'n Goblins (World? set 1)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGnga = { - "gnga", "gng", NULL, NULL, "1985", - "Ghosts'n Goblins (World? set 2)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, DrvaRomInfo, DrvaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - GngaInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGngbl = { - "gngbl", "gng", NULL, NULL, "1985", - "Ghosts'n Goblins (bootleg with Cross)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, DrvblRomInfo, DrvblRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - GngaInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGngbla = { - "gngbla", "gng", NULL, NULL, "1985", - "Ghosts'n Goblins (bootleg, harder)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, DrvblaRomInfo, DrvblaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - GngaInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGngblita = { - "gngblita", "gng", NULL, NULL, "1985", - "Ghosts'n Goblins (Italian bootleg, harder)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, DrvblitaRomInfo, DrvblitaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGngprot = { - "gngprot", "gng", NULL, NULL, "1985", - "Ghosts'n Goblins (prototype)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, DrvprotRomInfo, DrvprotRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - GngaInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGngt = { - "gngt", "gng", NULL, NULL, "1985", - "Ghosts'n Goblins (US)\0", NULL, "Capcom (Taito America License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, DrvtRomInfo, DrvtRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGngc = { - "gngc", "gng", NULL, NULL, "1985", - "Ghosts'n Goblins (World Revision C)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, DrvcRomInfo, DrvcRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMakaimur = { - "makaimur", "gng", NULL, NULL, "1985", - "Makai-Mura (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, MakaimurRomInfo, MakaimurRomName, NULL, NULL, DrvInputInfo, DrvjDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMakaimuc = { - "makaimurc", "gng", NULL, NULL, "1985", - "Makai-Mura (Japan revision C)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, MakaimucRomInfo, MakaimucRomName, NULL, NULL, DrvInputInfo, DrvjDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMakaimug = { - "makaimurg", "gng", NULL, NULL, "1985", - "Makai-Mura (Japan revision G)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, MakaimugRomInfo, MakaimugRomName, NULL, NULL, DrvInputInfo, DrvjDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDiamond = { - "diamond", NULL, NULL, NULL, "1985", - "Diamond Run\0", NULL, "KH Video", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, DiamondRomInfo, DiamondRomName, NULL, NULL, DiamondInputInfo, DiamondDIPInfo, - DiamondInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_gunsmoke.cpp b/jan/src/burn/drv/pre90s/d_gunsmoke.cpp deleted file mode 100644 index 418e97bab..000000000 --- a/jan/src/burn/drv/pre90s/d_gunsmoke.cpp +++ /dev/null @@ -1,1096 +0,0 @@ -// FB Alpha Gun.Smoke driver module -// Based on MAME driver by Paul Leaman - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" - -static UINT8 *Mem, *MemEnd, *Rom0, *Rom1, *Ram; -static UINT8 *Gfx0, *Gfx1, *Gfx2, *Gfx3, *Prom; -static UINT8 DrvJoy1[8], DrvJoy2[8], DrvJoy3[8], DrvDips[2], DrvReset; -static UINT32 *DrvPalette; -static UINT8 DrvCalcPal; -static UINT8 *SprTrnsp; - -static UINT8 soundlatch; -static UINT8 flipscreen; -static INT32 nGunsmokeBank; - -static UINT8 sprite3bank; -static UINT8 chon, bgon, objon; -static UINT8 gunsmoke_scrollx[2], gunsmoke_scrolly; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 0, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 1, "p1 left" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy2 + 2, "p1 down" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy2 + 3, "p1 up" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy2 + 6, "p1 fire 3"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy1 + 7, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 0, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 1, "p2 left" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 2, "p2 down" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 3, "p2 up" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy3 + 6, "p2 fire 3"}, - - {"Service" , BIT_DIGITAL , DrvJoy1 + 4, "service" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDips + 1, "dip" }, - -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x03, 0x01, "30k 80k 80k+" }, - {0x14, 0x01, 0x03, 0x03, "30k 100k 100k+" }, - {0x14, 0x01, 0x03, 0x00, "30k 100k 150k+" }, - {0x14, 0x01, 0x03, 0x02, "30k 100k" }, - - {0 , 0xfe, 0 , 2 , "Demo" }, - {0x14, 0x01, 0x04, 0x00, "Off" }, - {0x14, 0x01, 0x04, 0x04, "On" }, -}; - -static struct BurnDIPInfo gunsmokeuDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x03, 0x01, "30k 80k 80k+" }, - {0x14, 0x01, 0x03, 0x03, "30k 100k 100k+" }, - {0x14, 0x01, 0x03, 0x00, "30k 100k 150k+" }, - {0x14, 0x01, 0x03, 0x02, "30k 100k" }, - - {0 , 0xfe, 0 , 2 , "Lifes" }, - {0x14, 0x01, 0x04, 0x04, "3" }, - {0x14, 0x01, 0x04, 0x00, "5" }, -}; - -static struct BurnDIPInfo gunsmokeDIPList[]= -{ - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x08, 0x00, "Upright" }, - {0x14, 0x01, 0x08, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x30, 0x20, "Easy" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - {0x14, 0x01, 0x30, 0x10, "Difficult" }, - {0x14, 0x01, 0x30, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x15, 0x01, 0x07, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x07, 0x01, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x07, 0x02, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x15, 0x01, 0x38, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x38, 0x08, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x38, 0x10, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x40, 0x00, "No" }, - {0x15, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFOEXT(Drv, Drv, gunsmoke) -STDDIPINFOEXT(gunsmokeu, gunsmokeu, gunsmoke) - - -static inline void gunsmoke_bankswitch(INT32 nBank) -{ - if (nGunsmokeBank != nBank) { - nGunsmokeBank = nBank; - - ZetMapArea(0x8000, 0xbfff, 0, Rom0 + 0x10000 + nBank * 0x04000); - ZetMapArea(0x8000, 0xbfff, 2, Rom0 + 0x10000 + nBank * 0x04000); - } -} - -void __fastcall gunsmoke_cpu0_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc800: - soundlatch = data; - break; - - case 0xc804: - gunsmoke_bankswitch((data >> 2) & 3); - - flipscreen = data & 0x40; - chon = data & 0x80; - break; - - case 0xc806: - break; - - case 0xd800: - case 0xd801: - gunsmoke_scrollx[address & 1] = data; - break; - - case 0xd802: - case 0xd803: - gunsmoke_scrolly = data; - break; - - case 0xd806: - sprite3bank = data & 0x07; - - bgon = data & 0x10; - objon = data & 0x20; - break; - } -} - -UINT8 __fastcall gunsmoke_cpu0_read(UINT16 address) -{ - UINT8 ret = 0xff; - - switch (address) - { - case 0xc000: - { - for (INT32 i = 0; i < 8; i++) - ret ^= DrvJoy1[i] << i; - - return ret | 0x08; - } - - case 0xc001: - { - for (INT32 i = 0; i < 8; i++) - ret ^= DrvJoy2[i] << i; - - return ret; - } - - case 0xc002: - { - for (INT32 i = 0; i < 8; i++) - ret ^= DrvJoy3[i] << i; - - return ret; - } - - case 0xc003: // dips - return DrvDips[0]; - - case 0xc004: - return DrvDips[1]; - - // reads at c4c9 - c4cb are part of some sort of protection or bug - case 0xc4c9: - return 0xff; - case 0xc4ca: - case 0xc4cb: - return 0; - } - - return 0; -} - -void __fastcall gunsmoke_cpu1_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: // control 0 - BurnYM2203Write(0, 0, data); - break; - - case 0xe001: // write 0 - BurnYM2203Write(0, 1, data); - break; - - case 0xe002: // control 1 - BurnYM2203Write(1, 0, data); - break; - - case 0xe003: // write 1 - BurnYM2203Write(1, 1, data); - break; - } -} - -UINT8 __fastcall gunsmoke_cpu1_read(UINT16 address) -{ - if (address == 0xc800) return soundlatch; - - return 0; -} - - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (Ram, 0, 0x4000); - - nGunsmokeBank = -1; - soundlatch = 0; - flipscreen = 0; - - sprite3bank = 0; - chon = bgon = objon = 0; - gunsmoke_scrollx[0] = gunsmoke_scrollx[1] = 0; - gunsmoke_scrolly = 0; - - ZetOpen(0); - ZetReset(); - gunsmoke_bankswitch(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 DrvPaletteInit() -{ - UINT32 tmp[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 r = Prom[i + 0x000] & 0x0f; - UINT8 g = Prom[i + 0x100] & 0x0f; - UINT8 b = Prom[i + 0x200] & 0x0f; - - tmp[i] = BurnHighCol((r*16)+r,(g*16)+g,(b*16)+b,0); - } - - for (INT32 i = 0; i < 0x100; i++) - { - DrvPalette[0x000 + i] = tmp[Prom[0x300 + i] | 0x40]; - DrvPalette[0x100 + i] = tmp[Prom[0x400 + i] | ((Prom[0x500 + i] & 0x03) << 4)]; - DrvPalette[0x200 + i] = tmp[Prom[0x600 + i] | ((Prom[0x700 + i] & 0x07) << 4) | 0x80]; - } - - return 0; -} - -static INT32 gunsmoke_gfx_decode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (!tmp) return 1; - - static INT32 Planes[4] = { 0x100004, 0x100000, 4, 0 }; - - static INT32 CharXOffs[8] = { 11, 10, 9, 8, 3, 2, 1, 0 }; - static INT32 CharYOffs[8] = { 112, 96, 80, 64, 48, 32, 16, 0 }; - - static INT32 TileXOffs[32] = { 0, 1, 2, 3, 8, 9, 10, 11, - 512, 513, 514, 515, 520, 521, 522, 523, - 1024, 1025, 1026, 1027, 1032, 1033, 1034, 1035, - 1536, 1537, 1538, 1539, 1544, 1545, 1546, 1547 }; - - static INT32 TileYOffs[32] = { 0, 16, 32, 48, 64, 80, 96, 112, - 128, 144, 160, 176, 192, 208, 224, 240, - 256, 272, 288, 304, 320, 336, 352, 368, - 384, 400, 416, 432, 448, 464, 480, 496 }; - - static INT32 SpriXOffs[16] = { 0, 1, 2, 3, 8, 9, 10, 11, - 256, 257, 258, 259, 264, 265, 266, 267 }; - - memcpy (tmp, Gfx0, 0x04000); - GfxDecode(0x400, 2, 8, 8, Planes + 2, CharXOffs, CharYOffs, 0x080, tmp, Gfx0); - - memcpy (tmp, Gfx1, 0x40000); - GfxDecode(0x200, 4, 32, 32, Planes + 0, TileXOffs, TileYOffs, 0x800, tmp, Gfx1); - - memcpy (tmp, Gfx2, 0x40000); - GfxDecode(0x800, 4, 16, 16, Planes + 0, SpriXOffs, TileYOffs, 0x200, tmp, Gfx2); - - BurnFree (tmp); - - { - memset (SprTrnsp, 1, 0x800); - - for (INT32 i = 0; i < 0x80000; i++) - if (Gfx2[i]) SprTrnsp[i >> 8] = 0; - } - - return 0; -} - -static INT32 gunsmokeSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3000000; -} - -static double gunsmokeGetTime() -{ - return (double)ZetTotalCycles() / 3000000; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Rom0 = Next; Next += 0x20000; - Rom1 = Next; Next += 0x08000; - Ram = Next; Next += 0x04000; - Gfx0 = Next; Next += 0x10000; - Gfx1 = Next; Next += 0x80000; - Gfx2 = Next; Next += 0x80000; - Gfx3 = Next; Next += 0x08000; - Prom = Next; Next += 0x00800; - - SprTrnsp = Next; Next += 0x00800; - - DrvPalette = (UINT32*)Next; Next += 0x00300 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Rom0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(Rom0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(Rom0 + 0x18000, 2, 1)) return 1; - - if (BurnLoadRom(Rom1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(Gfx0 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(Gfx3 + 0x00000, 21, 1)) return 1; - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(Gfx1 + i * 0x8000, 5 + i, 1)) return 1; - if (BurnLoadRom(Gfx2 + i * 0x8000, 13 + i, 1)) return 1; - if (BurnLoadRom(Prom + i * 0x0100, 22 + i, 1)) return 1; - } - - gunsmoke_gfx_decode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, Rom0 + 0x00000); - ZetMapArea(0x0000, 0x7fff, 2, Rom0 + 0x00000); - ZetMapArea(0x8000, 0xbfff, 0, Rom0 + 0x10000); - ZetMapArea(0x8000, 0xbfff, 2, Rom0 + 0x10000); - ZetMapArea(0xd000, 0xd7ff, 0, Ram + 0x00000); - ZetMapArea(0xd000, 0xd7ff, 1, Ram + 0x00000); - ZetMapArea(0xe000, 0xefff, 0, Ram + 0x01000); - ZetMapArea(0xe000, 0xefff, 1, Ram + 0x01000); - ZetMapArea(0xe000, 0xefff, 2, Ram + 0x01000); - ZetMapArea(0xf000, 0xffff, 0, Ram + 0x02000); - ZetMapArea(0xf000, 0xffff, 1, Ram + 0x02000); - ZetSetReadHandler(gunsmoke_cpu0_read); - ZetSetWriteHandler(gunsmoke_cpu0_write); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, Rom1 + 0x00000); - ZetMapArea(0x0000, 0x7fff, 2, Rom1 + 0x00000); - ZetMapArea(0xc000, 0xc7ff, 0, Ram + 0x03000); - ZetMapArea(0xc000, 0xc7ff, 1, Ram + 0x03000); - ZetMapArea(0xc000, 0xc7ff, 2, Ram + 0x03000); - ZetSetReadHandler(gunsmoke_cpu1_read); - ZetSetWriteHandler(gunsmoke_cpu1_write); - ZetClose(); - - GenericTilesInit(); - - BurnYM2203Init(2, 1500000, NULL, gunsmokeSynchroniseStream, gunsmokeGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.14, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.22, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.22, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.22, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.14, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.22, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.22, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.22, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - BurnYM2203Exit(); - - BurnFree (Mem); - - Mem = MemEnd = Rom0 = Rom1 = Ram = NULL; - Gfx0 = Gfx1 = Gfx2 = Gfx3 = Prom = NULL; - SprTrnsp = NULL; - DrvPalette = NULL; - - soundlatch = flipscreen = nGunsmokeBank = 0; - - sprite3bank = chon = bgon = objon = 0; - gunsmoke_scrollx[0] = gunsmoke_scrollx[1] = 0; - gunsmoke_scrolly = 0; - - return 0; -} - -static void draw_bg_layer() -{ - UINT16 scroll = gunsmoke_scrollx[0] + (gunsmoke_scrollx[1] << 8); - - UINT8 *tilerom = Gfx3 + ((scroll >> 1) & ~0x0f); - - for (INT32 offs = 0; offs < 0x50; offs++) - { - INT32 attr = tilerom[1]; - INT32 code = tilerom[0] + ((attr & 1) << 8); - INT32 color = (attr & 0x3c) >> 2; - INT32 flipy = attr & 0x80; - INT32 flipx = attr & 0x40; - - INT32 sy = (offs & 7) << 5; - INT32 sx = (offs >> 3) << 5; - - sy -= gunsmoke_scrolly; - sx -= (scroll & 0x1f); - - if (flipscreen) { - flipy ^= 0x80; - flipx ^= 0x40; - - sy = 224 - sy; - sx = 224 - sx; - } - - sy -= 16; - - if (flipy) { - if (flipx) { - Render32x32Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, Gfx1); - } else { - Render32x32Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, Gfx1); - } - } else { - if (flipx) { - Render32x32Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, Gfx1); - } else { - Render32x32Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, Gfx1); - } - } - - tilerom += 2; - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs << 3) & 0xf8; - INT32 sy = (offs >> 2) & 0xf8; - - INT32 attr = Ram[0x0400 + offs]; - INT32 code = Ram[0x0000 + offs] + ((attr & 0xe0) << 2); - INT32 color = attr & 0x1f; - - if (code == 0x0024) continue; - - UINT8 *src = Gfx0 + (code << 6); - color <<= 2; - - if (flipscreen) { - sy = 240 - sy; - sx = 240 - sx; - - sy -= 8; - - for (INT32 y = sy + 7; y >= sy; y--) - { - for (INT32 x = sx + 7; x >= sx; x--, src++) - { - if (y < 0 || x < 0 || y > 223 || x > 255) continue; - if (!DrvPalette[color|*src]) continue; - - pTransDraw[(y << 8) | x] = color | *src; - } - } - } else { - sy -= 16; - - for (INT32 y = sy; y < sy + 8; y++) - { - for (INT32 x = sx; x < sx + 8; x++, src++) - { - if (y < 0 || x < 0 || y > 223 || x > 255) continue; - if (!DrvPalette[color|*src]) continue; - - pTransDraw[(y << 8) | x] = color | *src; - } - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x1000 - 32; offs >= 0; offs -= 32) - { - INT32 attr = Ram[0x2001 + offs]; - INT32 bank = (attr & 0xc0) >> 6; - INT32 code = Ram[0x2000 + offs]; - INT32 color = attr & 0x0f; - INT32 flipx = 0; - INT32 flipy = attr & 0x10; - INT32 sx = Ram[0x2003 + offs] - ((attr & 0x20) << 3); - INT32 sy = Ram[0x2002 + offs]; - - if (sy == 0 || sy > 0xef) continue; - - if (bank == 3) bank += sprite3bank; - code += 256 * bank; - - if (SprTrnsp[code]) continue; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x200, Gfx2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x200, Gfx2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x200, Gfx2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x200, Gfx2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvCalcPal) { - DrvPaletteInit(); - DrvCalcPal = 0; - } - - if (!bgon || ~nBurnLayer & 1) BurnTransferClear(); - if (bgon && nBurnLayer & 1) draw_bg_layer(); - if (objon && nSpriteEnable & 1) draw_sprites(); - if (chon && nBurnLayer & 2) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - INT32 nInterleave = 256; - - INT32 nCyclesSegment; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nCyclesTotal[2] = { 4000000 / 60, 3000000 / 60 }; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #0 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 240) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - // Run Z80 #1 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - BurnTimerUpdate((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - if (i%64 == 63) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = Ram; - ba.nLen = 0x4000; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - BurnYM2203Scan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(nGunsmokeBank); - SCAN_VAR(sprite3bank); - SCAN_VAR(chon); - SCAN_VAR(bgon); - SCAN_VAR(objon); - SCAN_VAR(gunsmoke_scrollx); - SCAN_VAR(gunsmoke_scrolly); - - if (nAction & ACB_WRITE) { - INT32 banktemp = nGunsmokeBank; - ZetOpen(0); - gunsmoke_bankswitch(0); - gunsmoke_bankswitch(banktemp); - ZetClose(); - } - } - - return 0; -} - - -// Gun.Smoke (World, 851115) - -static struct BurnRomInfo gunsmokeRomDesc[] = { - { "gs03.09n", 0x8000, 0x40a06cef, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "gs04.10n", 0x8000, 0x8d4b423f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gs05.12n", 0x8000, 0x2b5667fb, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gs02.14h", 0x8000, 0xcd7a2c38, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "gs01.11f", 0x4000, 0xb61ece9b, 3 | BRF_GRA }, // 4 Character Tiles - - { "gs13.06c", 0x8000, 0xf6769fc5, 4 | BRF_GRA }, // 5 32x32 Tiles - { "gs12.05c", 0x8000, 0xd997b78c, 4 | BRF_GRA }, // 6 - { "gs11.04c", 0x8000, 0x125ba58e, 4 | BRF_GRA }, // 7 - { "gs10.02c", 0x8000, 0xf469c13c, 4 | BRF_GRA }, // 8 - { "gs09.06a", 0x8000, 0x539f182d, 4 | BRF_GRA }, // 9 - { "gs08.05a", 0x8000, 0xe87e526d, 4 | BRF_GRA }, // 10 - { "gs07.04a", 0x8000, 0x4382c0d2, 4 | BRF_GRA }, // 11 - { "gs06.02a", 0x8000, 0x4cafe7a6, 4 | BRF_GRA }, // 12 - - { "gs22.06n", 0x8000, 0xdc9c508c, 5 | BRF_GRA }, // 13 Sprites - { "gs21.04n", 0x8000, 0x68883749, 5 | BRF_GRA }, // 14 - { "gs20.03n", 0x8000, 0x0be932ed, 5 | BRF_GRA }, // 15 - { "gs19.01n", 0x8000, 0x63072f93, 5 | BRF_GRA }, // 16 - { "gs18.06l", 0x8000, 0xf69a3c7c, 5 | BRF_GRA }, // 17 - { "gs17.04l", 0x8000, 0x4e98562a, 5 | BRF_GRA }, // 18 - { "gs16.03l", 0x8000, 0x0d99c3b3, 5 | BRF_GRA }, // 19 - { "gs15.01l", 0x8000, 0x7f14270e, 5 | BRF_GRA }, // 20 - - { "gs14.11c", 0x8000, 0x0af4f7eb, 6 | BRF_GRA }, // 21 Background Tilemaps - - { "g-01.03b", 0x0100, 0x02f55589, 7 | BRF_GRA }, // 22 Color Proms - { "g-02.04b", 0x0100, 0xe1e36dd9, 7 | BRF_GRA }, // 23 - { "g-03.05b", 0x0100, 0x989399c0, 7 | BRF_GRA }, // 24 - { "g-04.09d", 0x0100, 0x906612b5, 7 | BRF_GRA }, // 25 - { "g-06.14a", 0x0100, 0x4a9da18b, 7 | BRF_GRA }, // 26 - { "g-07.15a", 0x0100, 0xcb9394fc, 7 | BRF_GRA }, // 27 - { "g-09.09f", 0x0100, 0x3cee181e, 7 | BRF_GRA }, // 28 - { "g-08.08f", 0x0100, 0xef91cdd2, 7 | BRF_GRA }, // 29 - - { "g-10.02j", 0x0100, 0x0eaf5158, 0 | BRF_OPT }, // 30 Video Timing - { "g-05.01f", 0x0100, 0x25c90c2a, 0 | BRF_OPT }, // 31 Priority -}; - -STD_ROM_PICK(gunsmoke) -STD_ROM_FN(gunsmoke) - -struct BurnDriver BurnDrvGunsmoke = { - "gunsmoke", NULL, NULL, NULL, "1985", - "Gun.Smoke (World, 851115)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, gunsmokeRomInfo, gunsmokeRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x300, - 224, 256, 3, 4 -}; - - -// Gun.Smoke (World, 851115)(bootleg) -// based on world version, warning message patched out - -static struct BurnRomInfo gunsmokebRomDesc[] = { - { "3.ic85", 0x8000, 0xae6f4b75, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "4.ic86", 0x8000, 0x8d4b423f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5.ic87", 0x8000, 0x2b5667fb, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "2.ic41", 0x8000, 0xcd7a2c38, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "1.ic39", 0x4000, 0xb61ece9b, 3 | BRF_GRA }, // 4 Character Tiles - - { "13.ic21", 0x8000, 0xf6769fc5, 4 | BRF_GRA }, // 5 32x32 Tiles - { "12.ic20", 0x8000, 0xd997b78c, 4 | BRF_GRA }, // 6 - { "11.ic19", 0x8000, 0x125ba58e, 4 | BRF_GRA }, // 7 - { "10.ic18", 0x8000, 0xf469c13c, 4 | BRF_GRA }, // 8 - { "9.ic04", 0x8000, 0x539f182d, 4 | BRF_GRA }, // 9 - { "8.ic03", 0x8000, 0xe87e526d, 4 | BRF_GRA }, // 10 - { "7.ic02", 0x8000, 0x4382c0d2, 4 | BRF_GRA }, // 11 - { "6.ic01", 0x8000, 0x4cafe7a6, 4 | BRF_GRA }, // 12 - - { "22.ic134", 0x8000, 0xdc9c508c, 5 | BRF_GRA }, // 13 Sprites - { "21.ic133", 0x8000, 0x68883749, 5 | BRF_GRA }, // 14 - { "20.ic132", 0x8000, 0x0be932ed, 5 | BRF_GRA }, // 15 - { "19.ic131", 0x8000, 0x63072f93, 5 | BRF_GRA }, // 16 - { "18.ic115", 0x8000, 0xf69a3c7c, 5 | BRF_GRA }, // 17 - { "17.ic114", 0x8000, 0x4e98562a, 5 | BRF_GRA }, // 18 - { "16.ic113", 0x8000, 0x0d99c3b3, 5 | BRF_GRA }, // 19 - { "15.ic112", 0x8000, 0x7f14270e, 5 | BRF_GRA }, // 20 - - { "14.ic25", 0x8000, 0x0af4f7eb, 6 | BRF_GRA }, // 21 Background Tilemaps - - { "prom.ic3", 0x0100, 0x02f55589, 7 | BRF_GRA }, // 22 Color Proms - { "prom.ic4", 0x0100, 0xe1e36dd9, 7 | BRF_GRA }, // 23 - { "prom.ic5", 0x0100, 0x989399c0, 7 | BRF_GRA }, // 24 - { "g-04.09d", 0x0100, 0x906612b5, 7 | BRF_GRA }, // 25 - { "g-06.14a", 0x0100, 0x4a9da18b, 7 | BRF_GRA }, // 26 - { "g-07.15a", 0x0100, 0xcb9394fc, 7 | BRF_GRA }, // 27 - { "g-09.09f", 0x0100, 0x3cee181e, 7 | BRF_GRA }, // 28 - { "g-08.08f", 0x0100, 0xef91cdd2, 7 | BRF_GRA }, // 29 - - { "g-10.02j", 0x0100, 0x0eaf5158, 0 | BRF_OPT }, // 30 Video Timing - { "g-05.01f", 0x0100, 0x25c90c2a, 0 | BRF_OPT }, // 31 Priority -}; - -STD_ROM_PICK(gunsmokeb) -STD_ROM_FN(gunsmokeb) - -struct BurnDriver BurnDrvGunsmokeb = { - "gunsmokeb", "gunsmoke", NULL, NULL, "1985", - "Gun.Smoke (World, 851115) (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, gunsmokebRomInfo, gunsmokebRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x300, - 224, 256, 3, 4 -}; - - -// Gun.Smoke (Japan, 851115) - -static struct BurnRomInfo gunsmokejRomDesc[] = { - { "gsj_03.09n", 0x8000, 0xb56b5df6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "gs04.10n", 0x8000, 0x8d4b423f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gs05.12n", 0x8000, 0x2b5667fb, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gs02.14h", 0x8000, 0xcd7a2c38, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "gs01.11f", 0x4000, 0xb61ece9b, 3 | BRF_GRA }, // 4 Character Tiles - - { "gs13.06c", 0x8000, 0xf6769fc5, 4 | BRF_GRA }, // 5 32x32 Tiles - { "gs12.05c", 0x8000, 0xd997b78c, 4 | BRF_GRA }, // 6 - { "gs11.04c", 0x8000, 0x125ba58e, 4 | BRF_GRA }, // 7 - { "gs10.02c", 0x8000, 0xf469c13c, 4 | BRF_GRA }, // 8 - { "gs09.06a", 0x8000, 0x539f182d, 4 | BRF_GRA }, // 9 - { "gs08.05a", 0x8000, 0xe87e526d, 4 | BRF_GRA }, // 10 - { "gs07.04a", 0x8000, 0x4382c0d2, 4 | BRF_GRA }, // 11 - { "gs06.02a", 0x8000, 0x4cafe7a6, 4 | BRF_GRA }, // 12 - - { "gs22.06n", 0x8000, 0xdc9c508c, 5 | BRF_GRA }, // 13 Sprites - { "gs21.04n", 0x8000, 0x68883749, 5 | BRF_GRA }, // 14 - { "gs20.03n", 0x8000, 0x0be932ed, 5 | BRF_GRA }, // 15 - { "gs19.01n", 0x8000, 0x63072f93, 5 | BRF_GRA }, // 16 - { "gs18.06l", 0x8000, 0xf69a3c7c, 5 | BRF_GRA }, // 17 - { "gs17.04l", 0x8000, 0x4e98562a, 5 | BRF_GRA }, // 18 - { "gs16.03l", 0x8000, 0x0d99c3b3, 5 | BRF_GRA }, // 19 - { "gs15.01l", 0x8000, 0x7f14270e, 5 | BRF_GRA }, // 20 - - { "gs14.11c", 0x8000, 0x0af4f7eb, 6 | BRF_GRA }, // 21 Background Tilemaps - - { "g-01.03b", 0x0100, 0x02f55589, 7 | BRF_GRA }, // 22 Color Proms - { "g-02.04b", 0x0100, 0xe1e36dd9, 7 | BRF_GRA }, // 23 - { "g-03.05b", 0x0100, 0x989399c0, 7 | BRF_GRA }, // 24 - { "g-04.09d", 0x0100, 0x906612b5, 7 | BRF_GRA }, // 25 - { "g-06.14a", 0x0100, 0x4a9da18b, 7 | BRF_GRA }, // 26 - { "g-07.15a", 0x0100, 0xcb9394fc, 7 | BRF_GRA }, // 27 - { "g-09.09f", 0x0100, 0x3cee181e, 7 | BRF_GRA }, // 28 - { "g-08.08f", 0x0100, 0xef91cdd2, 7 | BRF_GRA }, // 29 - - { "g-10.02j", 0x0100, 0x0eaf5158, 0 | BRF_OPT }, // 30 Video Timing - { "g-05.01f", 0x0100, 0x25c90c2a, 0 | BRF_OPT }, // 31 Priority -}; - -STD_ROM_PICK(gunsmokej) -STD_ROM_FN(gunsmokej) - -struct BurnDriver BurnDrvGunsmokej = { - "gunsmokej", "gunsmoke", NULL, NULL, "1985", - "Gun.Smoke (Japan, 851115)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, gunsmokejRomInfo, gunsmokejRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x300, - 224, 256, 3, 4 -}; - - -// Gun.Smoke (US, 860408) - -static struct BurnRomInfo gunsmokeuRomDesc[] = { - { "gsa_03.9n", 0x8000, 0x51dc3f76, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "gs04.10n", 0x8000, 0x5ecf31b8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gs05.12n", 0x8000, 0x1c9aca13, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gs02.14h", 0x8000, 0xcd7a2c38, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "gs01.11f", 0x4000, 0xb61ece9b, 3 | BRF_GRA }, // 4 Character Tiles - - { "gs13.06c", 0x8000, 0xf6769fc5, 4 | BRF_GRA }, // 5 32x32 Tiles - { "gs12.05c", 0x8000, 0xd997b78c, 4 | BRF_GRA }, // 6 - { "gs11.04c", 0x8000, 0x125ba58e, 4 | BRF_GRA }, // 7 - { "gs10.02c", 0x8000, 0xf469c13c, 4 | BRF_GRA }, // 8 - { "gs09.06a", 0x8000, 0x539f182d, 4 | BRF_GRA }, // 9 - { "gs08.05a", 0x8000, 0xe87e526d, 4 | BRF_GRA }, // 10 - { "gs07.04a", 0x8000, 0x4382c0d2, 4 | BRF_GRA }, // 11 - { "gs06.02a", 0x8000, 0x4cafe7a6, 4 | BRF_GRA }, // 12 - - { "gs22.06n", 0x8000, 0xdc9c508c, 5 | BRF_GRA }, // 13 Sprites - { "gs21.04n", 0x8000, 0x68883749, 5 | BRF_GRA }, // 14 - { "gs20.03n", 0x8000, 0x0be932ed, 5 | BRF_GRA }, // 15 - { "gs19.01n", 0x8000, 0x63072f93, 5 | BRF_GRA }, // 16 - { "gs18.06l", 0x8000, 0xf69a3c7c, 5 | BRF_GRA }, // 17 - { "gs17.04l", 0x8000, 0x4e98562a, 5 | BRF_GRA }, // 18 - { "gs16.03l", 0x8000, 0x0d99c3b3, 5 | BRF_GRA }, // 19 - { "gs15.01l", 0x8000, 0x7f14270e, 5 | BRF_GRA }, // 20 - - { "gs14.11c", 0x8000, 0x0af4f7eb, 6 | BRF_GRA }, // 21 Background Tilemaps - - { "g-01.03b", 0x0100, 0x02f55589, 7 | BRF_GRA }, // 22 Color Proms - { "g-02.04b", 0x0100, 0xe1e36dd9, 7 | BRF_GRA }, // 23 - { "g-03.05b", 0x0100, 0x989399c0, 7 | BRF_GRA }, // 24 - { "g-04.09d", 0x0100, 0x906612b5, 7 | BRF_GRA }, // 25 - { "g-06.14a", 0x0100, 0x4a9da18b, 7 | BRF_GRA }, // 26 - { "g-07.15a", 0x0100, 0xcb9394fc, 7 | BRF_GRA }, // 27 - { "g-09.09f", 0x0100, 0x3cee181e, 7 | BRF_GRA }, // 28 - { "g-08.08f", 0x0100, 0xef91cdd2, 7 | BRF_GRA }, // 29 - - { "g-10.02j", 0x0100, 0x0eaf5158, 0 | BRF_OPT }, // 30 Video Timing - { "g-05.01f", 0x0100, 0x25c90c2a, 0 | BRF_OPT }, // 31 Priority -}; - -STD_ROM_PICK(gunsmokeu) -STD_ROM_FN(gunsmokeu) - -struct BurnDriver BurnDrvGunsmokeu = { - "gunsmokeu", "gunsmoke", NULL, NULL, "1985", - "Gun.Smoke (US, 860408)\0", NULL, "Capcom (Romstar License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, gunsmokeuRomInfo, gunsmokeuRomName, NULL, NULL, DrvInputInfo, gunsmokeuDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x300, - 224, 256, 3, 4 -}; - - -// Gun.Smoke (US, 851115, set 1) -// has a small extra piece of code at 0x2f00 and a jump to it at 0x297b, otherwise the same as gunsmokeub including the datecode, chip had an 'A' stamped on it, bugfix? - -static struct BurnRomInfo gunsmokeuaRomDesc[] = { - { "gsr_03a.9n", 0x8000, 0x2f6e6ad7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "gs04.10n", 0x8000, 0x8d4b423f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gs05.12n", 0x8000, 0x2b5667fb, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gs02.14h", 0x8000, 0xcd7a2c38, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "gs01.11f", 0x4000, 0xb61ece9b, 3 | BRF_GRA }, // 4 Character Tiles - - { "gs13.06c", 0x8000, 0xf6769fc5, 4 | BRF_GRA }, // 5 32x32 Tiles - { "gs12.05c", 0x8000, 0xd997b78c, 4 | BRF_GRA }, // 6 - { "gs11.04c", 0x8000, 0x125ba58e, 4 | BRF_GRA }, // 7 - { "gs10.02c", 0x8000, 0xf469c13c, 4 | BRF_GRA }, // 8 - { "gs09.06a", 0x8000, 0x539f182d, 4 | BRF_GRA }, // 9 - { "gs08.05a", 0x8000, 0xe87e526d, 4 | BRF_GRA }, // 10 - { "gs07.04a", 0x8000, 0x4382c0d2, 4 | BRF_GRA }, // 11 - { "gs06.02a", 0x8000, 0x4cafe7a6, 4 | BRF_GRA }, // 12 - - { "gs22.06n", 0x8000, 0xdc9c508c, 5 | BRF_GRA }, // 13 Sprites - { "gs21.04n", 0x8000, 0x68883749, 5 | BRF_GRA }, // 14 - { "gs20.03n", 0x8000, 0x0be932ed, 5 | BRF_GRA }, // 15 - { "gs19.01n", 0x8000, 0x63072f93, 5 | BRF_GRA }, // 16 - { "gs18.06l", 0x8000, 0xf69a3c7c, 5 | BRF_GRA }, // 17 - { "gs17.04l", 0x8000, 0x4e98562a, 5 | BRF_GRA }, // 18 - { "gs16.03l", 0x8000, 0x0d99c3b3, 5 | BRF_GRA }, // 19 - { "gs15.01l", 0x8000, 0x7f14270e, 5 | BRF_GRA }, // 20 - - { "gs14.11c", 0x8000, 0x0af4f7eb, 6 | BRF_GRA }, // 21 Background Tilemaps - - { "g-01.03b", 0x0100, 0x02f55589, 7 | BRF_GRA }, // 22 Color Proms - { "g-02.04b", 0x0100, 0xe1e36dd9, 7 | BRF_GRA }, // 23 - { "g-03.05b", 0x0100, 0x989399c0, 7 | BRF_GRA }, // 24 - { "g-04.09d", 0x0100, 0x906612b5, 7 | BRF_GRA }, // 25 - { "g-06.14a", 0x0100, 0x4a9da18b, 7 | BRF_GRA }, // 26 - { "g-07.15a", 0x0100, 0xcb9394fc, 7 | BRF_GRA }, // 27 - { "g-09.09f", 0x0100, 0x3cee181e, 7 | BRF_GRA }, // 28 - { "g-08.08f", 0x0100, 0xef91cdd2, 7 | BRF_GRA }, // 29 - - { "g-10.02j", 0x0100, 0x0eaf5158, 0 | BRF_OPT }, // 30 Video Timing - { "g-05.01f", 0x0100, 0x25c90c2a, 0 | BRF_OPT }, // 31 Priority -}; - -STD_ROM_PICK(gunsmokeua) -STD_ROM_FN(gunsmokeua) - -struct BurnDriver BurnDrvGunsmokeua = { - "gunsmokeua", "gunsmoke", NULL, NULL, "1986", - "Gun.Smoke (US, 851115, set 1)\0", NULL, "Capcom (Romstar License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, gunsmokeuaRomInfo, gunsmokeuaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x300, - 224, 256, 3, 4 -}; - - -// Gun.Smoke (US, 851115, set 2) - -static struct BurnRomInfo gunsmokeubRomDesc[] = { - { "gsr_03.9n", 0x8000, 0x592f211b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "gs04.10n", 0x8000, 0x8d4b423f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gs05.12n", 0x8000, 0x2b5667fb, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gs02.14h", 0x8000, 0xcd7a2c38, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "gs01.11f", 0x4000, 0xb61ece9b, 3 | BRF_GRA }, // 4 Character Tiles - - { "gs13.06c", 0x8000, 0xf6769fc5, 4 | BRF_GRA }, // 5 32x32 Tiles - { "gs12.05c", 0x8000, 0xd997b78c, 4 | BRF_GRA }, // 6 - { "gs11.04c", 0x8000, 0x125ba58e, 4 | BRF_GRA }, // 7 - { "gs10.02c", 0x8000, 0xf469c13c, 4 | BRF_GRA }, // 8 - { "gs09.06a", 0x8000, 0x539f182d, 4 | BRF_GRA }, // 9 - { "gs08.05a", 0x8000, 0xe87e526d, 4 | BRF_GRA }, // 10 - { "gs07.04a", 0x8000, 0x4382c0d2, 4 | BRF_GRA }, // 11 - { "gs06.02a", 0x8000, 0x4cafe7a6, 4 | BRF_GRA }, // 12 - - { "gs22.06n", 0x8000, 0xdc9c508c, 5 | BRF_GRA }, // 13 Sprites - { "gs21.04n", 0x8000, 0x68883749, 5 | BRF_GRA }, // 14 - { "gs20.03n", 0x8000, 0x0be932ed, 5 | BRF_GRA }, // 15 - { "gs19.01n", 0x8000, 0x63072f93, 5 | BRF_GRA }, // 16 - { "gs18.06l", 0x8000, 0xf69a3c7c, 5 | BRF_GRA }, // 17 - { "gs17.04l", 0x8000, 0x4e98562a, 5 | BRF_GRA }, // 18 - { "gs16.03l", 0x8000, 0x0d99c3b3, 5 | BRF_GRA }, // 19 - { "gs15.01l", 0x8000, 0x7f14270e, 5 | BRF_GRA }, // 20 - - { "gs14.11c", 0x8000, 0x0af4f7eb, 6 | BRF_GRA }, // 21 Background Tilemaps - - { "g-01.03b", 0x0100, 0x02f55589, 7 | BRF_GRA }, // 22 Color Proms - { "g-02.04b", 0x0100, 0xe1e36dd9, 7 | BRF_GRA }, // 23 - { "g-03.05b", 0x0100, 0x989399c0, 7 | BRF_GRA }, // 24 - { "g-04.09d", 0x0100, 0x906612b5, 7 | BRF_GRA }, // 25 - { "g-06.14a", 0x0100, 0x4a9da18b, 7 | BRF_GRA }, // 26 - { "g-07.15a", 0x0100, 0xcb9394fc, 7 | BRF_GRA }, // 27 - { "g-09.09f", 0x0100, 0x3cee181e, 7 | BRF_GRA }, // 28 - { "g-08.08f", 0x0100, 0xef91cdd2, 7 | BRF_GRA }, // 29 - - { "g-10.02j", 0x0100, 0x0eaf5158, 0 | BRF_OPT }, // 30 Video Timing - { "g-05.01f", 0x0100, 0x25c90c2a, 0 | BRF_OPT }, // 31 Priority -}; - -STD_ROM_PICK(gunsmokeub) -STD_ROM_FN(gunsmokeub) - -struct BurnDriver BurnDrvGunsmokeub = { - "gunsmokeub", "gunsmoke", NULL, NULL, "1986", - "Gun.Smoke (US, 851115, set 2)\0", NULL, "Capcom (Romstar License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, gunsmokeubRomInfo, gunsmokeubRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x300, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_higemaru.cpp b/jan/src/burn/drv/pre90s/d_higemaru.cpp deleted file mode 100644 index 88a7fa77d..000000000 --- a/jan/src/burn/drv/pre90s/d_higemaru.cpp +++ /dev/null @@ -1,513 +0,0 @@ -// FB Alpha Pirate Ship Higemaru Module -// Based on MAME driver by Mirko Buffoni - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *Mem, *MemEnd, *Rom, *Gfx0, *Gfx1, *Prom; -static INT16 *pAY8910Buffer[6], *pFMBuffer = NULL; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc = 0; - -static UINT8 DrvJoy1[8], DrvJoy2[8], DrvJoy3[8], DrvDips[3], DrvReset; -static UINT8 DrvInput[3]; - -static INT32 flipscreen; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy3 + 7, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy3 + 6, "p2 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy3 + 5, "p1 start" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy3 + 4, "p2 start" }, - - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 0, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 1, "p1 left" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 2, "p1 down" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 3, "p1 up" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 3, "p1 fire 1"}, - - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 0, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 1, "p2 left" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy2 + 2, "p2 down" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 3, "p2 up" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 1, "p2 fire 1"}, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDips + 0, "dip 1" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDips + 1, "dip 2" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDips + 2, "dip 3" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x10, 0x01, 0x07, 0x01, "5 Coins 1 Play" }, - {0x10, 0x01, 0x07, 0x02, "4 Coins 1 Play" }, - {0x10, 0x01, 0x07, 0x03, "3 Coins 1 Play" }, - {0x10, 0x01, 0x07, 0x04, "1 Coins 1 Play" }, - {0x10, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x10, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x10, 0x01, 0x38, 0x08, "5 Coins 1 Play" }, - {0x10, 0x01, 0x38, 0x10, "4 Coins 1 Play" }, - {0x10, 0x01, 0x38, 0x18, "3 Coins 1 Play" }, - {0x10, 0x01, 0x38, 0x20, "1 Coins 1 Play" }, - {0x10, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x10, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x38, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0xc0, 0x80, "1" }, - {0x10, 0x01, 0xc0, 0x40, "2" }, - {0x10, 0x01, 0xc0, 0xc0, "3" }, - {0x10, 0x01, 0xc0, 0x00, "5" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, - {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x11, 0x01, 0x0e, 0x0e, "10k 50k 50k" }, - {0x11, 0x01, 0x0e, 0x0c, "10k 60k 60k" }, - {0x11, 0x01, 0x0e, 0x0a, "20k 60k 60k" }, - {0x11, 0x01, 0x0e, 0x08, "20k 70k 70k" }, - {0x11, 0x01, 0x0e, 0x06, "30k 70k 70k" }, - {0x11, 0x01, 0x0e, 0x04, "30k 80k 80k" }, - {0x11, 0x01, 0x0e, 0x02, "40k 100k 100k" }, - {0x11, 0x01, 0x0e, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Music" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static void DrvMakeInputs() -{ - UINT8 *DrvJoy[3] = { DrvJoy1, DrvJoy2, DrvJoy3 }; - UINT32 DrvJoyInit[3] = { 0x00, 0x00, DrvDips[0] }; - - CompileInput(DrvJoy, (void*)DrvInput, 3, 8, DrvJoyInit); - - ProcessJoystick(&DrvInput[0], 0, 3,2,1,0, INPUT_4WAY | INPUT_MAKEACTIVELOW); - ProcessJoystick(&DrvInput[1], 1, 3,2,1,0, INPUT_4WAY | INPUT_MAKEACTIVELOW); -} - -static void __fastcall higemaru_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc800: - flipscreen = data >> 7; - break; - - case 0xc801: - case 0xc802: - AY8910Write(0, (address - 1) & 1, data); - break; - - case 0xc803: - case 0xc804: - AY8910Write(1, (address - 1) & 1, data); - break; - } -} - -static UINT8 __fastcall higemaru_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return DrvInput[0]; - - case 0xc001: - return DrvInput[1]; - - case 0xc002: - return DrvInput[2]; - - case 0xc003: - return DrvDips[1]; - - case 0xc004: - return DrvDips[2]; - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Rom = Next; Next += 0x10000; - Gfx0 = Next; Next += 0x08000; - Gfx1 = Next; Next += 0x08000; - Prom = Next; Next += 0x00300; - - DrvPalette = (UINT32*)Next; Next += 0x00180 * sizeof(UINT32); - - pFMBuffer = (INT16*)Next; Next += (nBurnSoundLen * 6 * sizeof(INT16)); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (Rom + 0xd000, 0, 0x2000); - - AY8910Reset(0); - AY8910Reset(1); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - flipscreen = 0; - - HiscoreReset(); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 tmp[0x20]; - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0, bit1, bit2; - - bit0 = (Prom[i] >> 0) & 1; - bit1 = (Prom[i] >> 1) & 1; - bit2 = (Prom[i] >> 2) & 1; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (Prom[i] >> 3) & 1; - bit1 = (Prom[i] >> 4) & 1; - bit2 = (Prom[i] >> 5) & 1; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit1 = (Prom[i] >> 6) & 1; - bit2 = (Prom[i] >> 7) & 1; - INT32 b = 0x47 * bit1 + 0x97 * bit2; - - tmp[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x80; i++) { - DrvPalette[i] = tmp[Prom[i+0x100] & 0x0f]; - } - - for (INT32 i = 0x80; i < 0x180; i++) { - DrvPalette[i] = tmp[(Prom[i + 0x180] & 0x0f) | 0x10]; - } -} - -static INT32 DrvGfxDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, Gfx0, 0x2000); - - static INT32 Planes[4] = { 0x10004, 0x10000, 0x00004, 0x00000 }; - static INT32 XOffs[16] = { 0x000, 0x001, 0x002, 0x003, 0x008, 0x009, 0x00a, 0x00b, - 0x100, 0x101, 0x102, 0x103, 0x108, 0x109, 0x10a, 0x10b }; - static INT32 YOffs[16] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, - 0x080, 0x090, 0x0a0, 0x0b0, 0x0c0, 0x0d0, 0x0e0, 0x0f0 }; - - GfxDecode(0x200, 2, 8, 8, Planes + 2, XOffs, YOffs, 0x080, tmp, Gfx0); - - memcpy (tmp, Gfx1, 0x4000); - - GfxDecode(0x080, 4, 16, 16, Planes, XOffs, YOffs, 0x200, tmp, Gfx1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - for (INT32 i = 0; i < 6; i++) { - pAY8910Buffer[i] = pFMBuffer + nBurnSoundLen * i; - } - - { - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(Rom + i * 0x2000, i + 0, 1)) return 1; - } - - if (BurnLoadRom(Gfx0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(Gfx1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(Gfx1 + 0x2000, 6, 1)) return 1; - - for (INT32 i = 0; i < 3; i++) { - if (BurnLoadRom(Prom + i * 0x100, i + 7, 1)) return 1; - } - - if (DrvGfxDecode()) return 1; - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, Rom + 0x0000); - ZetMapArea(0x0000, 0x7fff, 2, Rom + 0x0000); - ZetMapArea(0xd000, 0xd7ff, 0, Rom + 0xd000); - ZetMapArea(0xd000, 0xd9ff, 1, Rom + 0xd000); - ZetMapArea(0xe000, 0xefff, 0, Rom + 0xe000); - ZetMapArea(0xe000, 0xefff, 1, Rom + 0xe000); - ZetMapArea(0xe000, 0xefff, 2, Rom + 0xe000); - ZetSetWriteHandler(higemaru_write); - ZetSetReadHandler(higemaru_read); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - GenericTilesExit(); - - BurnFree (Mem); - - Mem = MemEnd = Rom = Gfx0 = Gfx1 = Prom = NULL; - DrvPalette = NULL; - pFMBuffer = NULL; - - for (INT32 i = 0; i < 6; i++) { - pAY8910Buffer[i] = NULL; - } - - flipscreen = 0; - DrvRecalc = 0; - - return 0; -} - - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 offs = 0x40; offs < 0x3c0; offs++) - { - INT32 sx = (offs << 3) & 0xf8; - INT32 sy = (offs >> 2) & 0xf8; - - INT32 code = Rom[0xd000 + offs] | ((Rom[0xd400 + offs] & 0x80) << 1); - INT32 color = Rom[0xd400 + offs] & 0x1f; - - sy -= 16; - - if (flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx ^ 0xf8, 216 - sy, color, 2, 0, Gfx0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, Gfx0); - } - } - - for (INT32 offs = 0x170; offs >= 0; offs -= 16) - { - INT32 code,color,sx,sy,flipx,flipy; - - code = Rom[0xd880 + offs] & 0x7f; - color = Rom[0xd884 + offs] & 0x0f; - sx = Rom[0xd88c + offs]; - sy = Rom[0xd888 + offs]; - flipx = Rom[0xd884 + offs] & 0x10; - flipy = Rom[0xd884 + offs] & 0x20; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x80, Gfx1); - if (sx > 0xf0) Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx - 256, sy, color, 4, 0x0f, 0x80, Gfx1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x80, Gfx1); - if (sx > 0xf0) Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx - 256, sy, color, 4, 0x0f, 0x80, Gfx1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x80, Gfx1); - if (sx > 0xf0) Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx - 256, sy, color, 4, 0x0f, 0x80, Gfx1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x80, Gfx1); - if (sx > 0xf0) Render16x16Tile_Mask_Clip(pTransDraw, code, sx - 256, sy, color, 4, 0x0f, 0x80, Gfx1); - } - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} -extern int counter; - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvMakeInputs(); - - INT32 nInterleave = 262; - INT32 nCyclesTotal = 4000000 / 60; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - ZetRun(nCyclesTotal / nInterleave); - if (i == 0) { - ZetSetVector(0xd7); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - if (i == 235) { - ZetSetVector(0xcf); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - } - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029672; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = Rom + 0xd000; - ba.nLen = 0x2000; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - } - - return 0; -} - - -// Pirate Ship Higemaru - -static struct BurnRomInfo higemaruRomDesc[] = { - { "hg4.p12", 0x2000, 0xdc67a7f9, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "hg5.m12", 0x2000, 0xf65a4b68, 1 | BRF_PRG | BRF_ESS }, // 1 - { "hg6.p11", 0x2000, 0x5f5296aa, 1 | BRF_PRG | BRF_ESS }, // 2 - { "hg7.m11", 0x2000, 0xdc5d455d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "hg3.m1", 0x2000, 0xb37b88c8, 2 | BRF_GRA }, // 4 Characters - - { "hg1.c14", 0x2000, 0xef4c2f5d, 3 | BRF_GRA }, // 5 Sprites - { "hg2.e14", 0x2000, 0x9133f804, 3 | BRF_GRA }, // 6 - - { "hgb3.l6", 0x0020, 0x629cebd8, 4 | BRF_GRA }, // 7 Color Proms - { "hgb5.m4", 0x0100, 0xdbaa4443, 4 | BRF_GRA }, // 8 - { "hgb1.h7", 0x0100, 0x07c607ce, 4 | BRF_GRA }, // 9 - - { "hgb4.l9", 0x0100, 0x712ac508, 0 | BRF_OPT }, // 10 Misc. Proms (not used) - { "hgb2.k7", 0x0100, 0x4921635c, 0 | BRF_OPT }, // 11 -}; - -STD_ROM_PICK(higemaru) -STD_ROM_FN(higemaru) - -struct BurnDriver BurnDrvhigemaru = { - "higemaru", NULL, NULL, NULL, "1984", - "Pirate Ship Higemaru\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_MAZE, 0, - NULL, higemaruRomInfo, higemaruRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x180, - 256, 224, 4, 3 -}; - diff --git a/jan/src/burn/drv/pre90s/d_himesiki.cpp b/jan/src/burn/drv/pre90s/d_himesiki.cpp deleted file mode 100644 index 4b6f8574f..000000000 --- a/jan/src/burn/drv/pre90s/d_himesiki.cpp +++ /dev/null @@ -1,919 +0,0 @@ -// FB Alpha Himeshikibu & Android driver module -// Based on MAME driver by Uki and David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "8255ppi.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 nDrvZ80Bank; -static UINT8 scrolly; -static UINT16 scrollx; -static UINT8 soundlatch; -static UINT8 flipscreen; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo HimesikiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Himesiki) - -static struct BurnInputInfo AndroidpInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Androidp) - -static struct BurnDIPInfo HimesikiDIPList[]= -{ - {0x14, 0xff, 0xff, 0xfe, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "1-2" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "1-3" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x08, 0x08, "Upright" }, - {0x14, 0x01, 0x08, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "1-5" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "1-6" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2-1" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2-2" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2-3" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2-4" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2-5" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2-6" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2-7" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2-8" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Himesiki) - -static struct BurnDIPInfo AndroidpoDIPList[]= -{ - {0x14, 0xff, 0xff, 0xfb, NULL }, - {0x15, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "1" }, - {0x14, 0x01, 0x0c, 0x04, "2" }, - {0x14, 0x01, 0x0c, 0x08, "3" }, - {0x14, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x15, 0x01, 0x07, 0x00, "6 Coins 1 Credit" }, - {0x15, 0x01, 0x07, 0x01, "5 Coins 1 Credit" }, - {0x15, 0x01, 0x07, 0x02, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x03, "Invalid" }, -}; - -STDDIPINFO(Androidpo) - -static struct BurnDIPInfo AndroidpDIPList[]= -{ - {0x14, 0xff, 0xff, 0xf6, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x0c, 0x08, "1" }, - {0x14, 0x01, 0x0c, 0x0c, "2" }, - {0x14, 0x01, 0x0c, 0x04, "3" }, - {0x14, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "No" }, - {0x14, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x15, 0x01, 0x07, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x07, 0x01, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x07, 0x02, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Androidp) - - -static void palette_update_one(INT32 offset) -{ - INT32 p = (DrvPalRAM[offset+0] | (DrvPalRAM[offset+1] << 8)); - - INT32 r = (p >> 10) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p & 0x1f); - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r,g,b,0); -} - -static void __fastcall himesiki_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xa800) { - DrvPalRAM[address & 0x7ff] = data; - palette_update_one(address & 0x7fe); - return; - } -} - -static void __fastcall himesiki_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - case 0x04: - case 0x05: - case 0x06: - case 0x07: - ppi8255_w((port/4) & 1, port & 3, data); - return; - - case 0x08: - scrolly = data; - return; - - case 0x09: - scrollx = ((data & 1) << 8) | (scrollx & 0xff); - return; - - case 0x0a: - scrollx = (scrollx & 0x100) | data; - return; - - case 0x0b: - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - } -} - -static UINT8 __fastcall himesiki_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - case 0x04: - case 0x05: - case 0x06: - case 0x07: - return ppi8255_r((port/4) & 1, port & 3); - } - - return 0; -} - -static void __fastcall himesiki_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - BurnYM2203Write(0, port & 1, data); - return; - } -} - -static UINT8 __fastcall himesiki_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM2203Read(0, port & 1); - - case 0x04: - return soundlatch; - } - - return 0; -} - -static UINT8 ppi8255_0_portA_r() { return DrvInputs[0]; } -static UINT8 ppi8255_0_portB_r() { return DrvInputs[1]; } -static UINT8 ppi8255_0_portC_r() { return DrvInputs[2]; } -static UINT8 ppi8255_1_portA_r() { return DrvDips[0]; } -static UINT8 ppi8255_1_portB_r() { return DrvDips[1]; } - -static void ppi8255_1_portC_w(UINT8 data) -{ - nDrvZ80Bank = data; -// flipscreen = data & 0x10; - - INT32 bank = ((data >> 2) & 3) * 0x4000; - - ZetMapMemory(DrvZ80ROM0 + 0x10000 + bank, 0xc000, 0xffff, MAP_ROM); -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ppi8255_1_portC_w(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - BurnYM2203Reset(); - ZetClose(); - - //nDrvZ80Bank = 0; - soundlatch = 0; - flipscreen = 0; - scrolly = 0; - scrollx = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x002000; - DrvZ80RAM1 = Next; Next += 0x000800; - - DrvPalRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Planes[4] = { STEP4(0,1) }; - INT32 XOffs[32] = { 4,0,12,8,20,16,28,24,36,32,44,40,52,48,60,56,68,64,76,72,84,80,92,88,100,96,108,104,116,112,124,120 }; - INT32 YOffs0[8] = { STEP8(0,32) }; - INT32 YOffs1[16] = { STEP16(0,64) }; - INT32 YOffs2[32] = { STEP32(0,128) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x20000); - - GfxDecode(0x1000, 4, 8, 8, Planes, XOffs, YOffs0, 0x0100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Planes, XOffs, YOffs1, 0x0400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x0400, 4, 32, 32, Planes, XOffs, YOffs2, 0x1000, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(INT32 nGame) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (nGame == 0) // himesiki - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x18000, DrvZ80ROM0 + 0x10000, 0x04000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20001, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20001, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40001, 14, 2)) return 1; - memset (DrvGfxROM1 + 0x60000, 0xff, 0x20000); - } - else if (nGame == 1) // androidpo - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 1, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x10000, DrvZ80ROM1 + 0x00000, 0x04000); - memcpy (DrvZ80ROM0 + 0x18000, DrvZ80ROM1 + 0x04000, 0x04000); - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x14000, DrvZ80ROM1 + 0x00000, 0x04000); - memcpy (DrvZ80ROM0 + 0x1c000, DrvZ80ROM1 + 0x04000, 0x04000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20001, 6, 2)) return 1; - - memset (DrvGfxROM2, 0xff, 0x80000); // not present - } else if (nGame == 2) // androidp - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 1, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x10000, DrvZ80ROM1 + 0x00000, 0x04000); - memcpy (DrvZ80ROM0 + 0x18000, DrvZ80ROM1 + 0x04000, 0x04000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20001, 5, 2)) return 1; - - memset (DrvGfxROM2, 0xff, 0x80000); // not present - } - - DrvGfxDecode(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x9fff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xa000, 0xa7ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xa800, 0xafff, MAP_ROM); // written in handler - ZetMapMemory(DrvBgRAM, 0xb000, 0xbfff, MAP_RAM); - ZetSetWriteHandler(himesiki_main_write); - ZetSetOutHandler(himesiki_main_write_port); - ZetSetInHandler(himesiki_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xf800, 0xffff, MAP_RAM); - ZetSetOutHandler(himesiki_sound_write_port); - ZetSetInHandler(himesiki_sound_read_port); - ZetClose(); - - ppi8255_init(2); - PPI0PortReadA = ppi8255_0_portA_r; - PPI0PortReadB = ppi8255_0_portB_r; - PPI0PortReadC = ppi8255_0_portC_r; - PPI1PortReadA = ppi8255_1_portA_r; - PPI1PortReadB = ppi8255_1_portB_r; - PPI1PortWriteC = ppi8255_1_portC_w; - - BurnYM2203Init(1, 3000000, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 0.05); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2203Exit(); - ZetExit(); - ppi8255_exit(); - GenericTilesExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - INT32 yscroll = scrolly; - INT32 xscroll = scrollx; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= xscroll; - if (sx < -7) sx += 512; - sy -= yscroll; - if (sy < -7) sy += 256; - - INT32 code = (DrvBgRAM[offs * 2] + (DrvBgRAM[offs * 2 + 1] << 8)); - INT32 color = code >> 12; - - Render8x8Tile_Clip(pTransDraw, code & 0xfff, sx, sy, color, 4, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - UINT8 *spriteram = DrvSprRAM + 0x100; - - for (INT32 offs = 0x00; offs < 0x60; offs += 4) - { - INT32 attr = spriteram[offs + 1]; - INT32 code = spriteram[offs + 0] | (attr & 3) << 8; - code &= 0x2ff; - INT32 x = spriteram[offs + 3] | (attr & 8) << 5; - INT32 y = spriteram[offs + 2]; - - INT32 color = (attr & 0xf0) >> 4; - color &= 0x3ff; - INT32 fx = attr & 4; - INT32 fy = 0; - - if (x > 0x1e0) - x -= 0x200; - - if (flipscreen) - { - y = (y - 31) & 0xff; - x = 224 - x; - fx ^= 4; - fy = 1; - } - else - { - y = 257 - y; - if (y > 0xc0) - y -= 0x100; - } - - if (fy) { - if (fx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x200, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x200, DrvGfxROM2); - } - } else { - if (fx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x200, DrvGfxROM2); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x200, DrvGfxROM2); - } - } - } - - spriteram = DrvSprRAM; - - for (INT32 offs = 0; offs < 0x100; offs += 4) - { - if ((spriteram[offs + 0] == 0x00) && - (spriteram[offs + 1] == 0x00) && - (spriteram[offs + 2] == 0x00) && - (spriteram[offs + 3] == 0x00)) - continue; - - INT32 attr = spriteram[offs + 1]; - INT32 code = spriteram[offs + 0] | (attr & 7) << 8; - INT32 x = spriteram[offs + 3] | (attr & 8) << 5; - INT32 y = spriteram[offs + 2]; - - INT32 color = (attr & 0xf0) >> 4; - INT32 f = 0; - - if (x > 0x1e0) - x -= 0x200; - - if (flipscreen) - { - y = (y - 15) &0xff; - x = 240 - x; - f = 1; - } - else - y = 257 - y; - - y &= 0xff; - if (y > 0xf0) - y -= 0x100; - - if (f) { - if (f) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x200, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x200, DrvGfxROM1); - } - } else { - if (f) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x200, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x200, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_update_one(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - if (nBurnLayer & 1) draw_layer(); - if (nBurnLayer & 2) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256*2; - INT32 nCyclesTotal[2] = { 8000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 239*2) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - BurnTimerUpdate((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - ppi8255_scan(); - - SCAN_VAR(nDrvZ80Bank); - SCAN_VAR(scrolly); - SCAN_VAR(scrollx); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ppi8255_1_portC_w(nDrvZ80Bank); - ZetClose(); - } - } - - return 0; -} - - -// Himeshikibu (Japan) - -static struct BurnRomInfo himesikiRomDesc[] = { - { "1.1k", 0x08000, 0xfb4604b3, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "2.1g", 0x08000, 0x0c30ded1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "5.6n", 0x08000, 0xb1214ac7, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 #1 Code - - { "3.5f", 0x10000, 0x73843e60, 3 | BRF_GRA }, // 3 - Background Tiles - { "4.5d", 0x10000, 0x443a3164, 3 | BRF_GRA }, // 4 - - { "13.9e", 0x10000, 0x43102682, 4 | BRF_GRA }, // 5 - 16x16 Sprites - { "12.9c", 0x10000, 0x19c8f9f4, 4 | BRF_GRA }, // 6 - { "15.8e", 0x10000, 0x2630d394, 4 | BRF_GRA }, // 7 - { "14.8c", 0x10000, 0x8103a207, 4 | BRF_GRA }, // 8 - - { "6.1a", 0x10000, 0x14989c22, 5 | BRF_GRA }, // 9 - 32x32 Sprites - { "7.1c", 0x10000, 0xcec56e16, 5 | BRF_GRA }, // 10 - { "8.2a", 0x10000, 0x44ba127e, 5 | BRF_GRA }, // 11 - { "9.2c", 0x10000, 0x0dda724a, 5 | BRF_GRA }, // 12 - { "10.4a", 0x10000, 0x0adda8d1, 5 | BRF_GRA }, // 13 - { "11.4c", 0x10000, 0xaa032946, 5 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(himesiki) -STD_ROM_FN(himesiki) - -static INT32 himesikiInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvHimesiki = { - "himesiki", NULL, NULL, NULL, "1989", - "Himeshikibu (Japan)\0", NULL, "Hi-Soft", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MAHJONG, 0, - NULL, himesikiRomInfo, himesikiRomName, NULL, NULL, HimesikiInputInfo, HimesikiDIPInfo, - himesikiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 192, 256, 3, 4 -}; - - -// Android (early build?) - -static struct BurnRomInfo androidpoRomDesc[] = { - { "MITSUBISHI__AD1__M5L27256K.toppcb.k1", 0x08000, 0x25ab85eb, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "MITSUBISHI__AD-3__M5L27256K.toppcb.g1", 0x08000, 0x6cf5f48a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "MITSUBISHI__AD2__M5L27256K.toppcb.j1", 0x08000, 0xe41426be, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "MITSUBISHI__AD-4__M5L27256K.toppcb.n6", 0x08000, 0x13c38fe4, 2 | BRF_PRG | BRF_ESS }, // 3 - Z80 #1 Code - - { "MITSUBISHI__AD-5__M5L27512K.toppcb.f5", 0x10000, 0x4c72a930, 3 | BRF_GRA }, // 4 - Background Tiles - - { "MITSUBISHI__AD-6__M5L27512K.botpcb.def9", 0x10000, 0x5e42984e, 4 | BRF_GRA }, // 5 - 16x16 Sprites - { "MITSUBISHI__AD-7__M5L27512K.botpcb.bc9", 0x10000, 0x611ff400, 4 | BRF_GRA }, // 6 - - { "RICOH_7A2_19__EPL10P8BP_JAPAN_M.j3.jed", 0x00473, 0x807d1553, 0 | BRF_OPT }, // 7 - { "RICOH_7A2_19__EPL10P8BP_JAPAN_I.f1.jed", 0x00473, 0xc5e51ea2, 0 | BRF_OPT }, // 8 -}; - -STD_ROM_PICK(androidpo) -STD_ROM_FN(androidpo) - -static INT32 androidpoInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvAndroidpo = { - "androidpo", "androidp", NULL, NULL, "198?", - "Android (prototype, early build)\0", NULL, "Nasco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, androidpoRomInfo, androidpoRomName, NULL, NULL, AndroidpInputInfo, AndroidpoDIPInfo, - androidpoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 192, 256, 3, 4 -}; - -// Android (later build?) - -static struct BurnRomInfo androidpRomDesc[] = { - { "ANDR1.BIN", 0x08000, 0xfff04130, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "ANDR3.BIN", 0x08000, 0x112d5123, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ANDR4.BIN", 0x08000, 0x65f5e98b, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 #1 Code - - { "ANDR5.BIN", 0x10000, 0x0a0b44c0, 3 | BRF_GRA }, // 3 - Background Tiles - - { "ANDR6.BIN", 0x10000, 0x122b7dd1, 4 | BRF_GRA }, // 4 - 16x16 Sprites - { "ANDR7.BIN", 0x10000, 0xfc0f9234, 4 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(androidp) -STD_ROM_FN(androidp) - -static INT32 androidpInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvAndroidp = { - "androidp", NULL, NULL, NULL, "198?", - "Android (prototype, later build)\0", NULL, "Nasco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, androidpRomInfo, androidpRomName, NULL, NULL, AndroidpInputInfo, AndroidpDIPInfo, - androidpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 192, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_hvyunit.cpp b/jan/src/burn/drv/pre90s/d_hvyunit.cpp deleted file mode 100644 index bddc641f4..000000000 --- a/jan/src/burn/drv/pre90s/d_hvyunit.cpp +++ /dev/null @@ -1,892 +0,0 @@ -// FB Alpha Heavy Unit driver module -// Based on MAME drivery Angelo Salese, Tomasz Slanina, and David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "mermaid.h" -#include "burn_ym2203.h" -#include "pandora.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvMCUROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPandoraRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvShareRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvPalRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 scrollx; -static UINT16 scrolly; -static UINT8 soundlatch; -static UINT8 z80banks[3]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[6]; -static UINT8 DrvReset; - -static struct BurnInputInfo HvyunitInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 4, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 5, "dip" }, -}; - -STDINPUTINFO(Hvyunit) - -static struct BurnDIPInfo HvyunitDIPList[]= -{ - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 1, "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, -// {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x11, 0x01, 0x08, 0x08, "Mode 1" }, - {0x11, 0x01, 0x08, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x30, 0x00, "1 Coin 6 Credits" }, - {0x11, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x30, 0x10, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x30, 0x00, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - {0x11, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xc0, 0x00, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x30, "3" }, - {0x12, 0x01, 0x30, 0x20, "4" }, - {0x12, 0x01, 0x30, 0x10, "5" }, - {0x12, 0x01, 0x30, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Hvyunit) - -static struct BurnDIPInfo HvyunitjDIPList[]= -{ - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 1, "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, -// {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x30, "3" }, - {0x12, 0x01, 0x30, 0x20, "4" }, - {0x12, 0x01, 0x30, 0x10, "5" }, - {0x12, 0x01, 0x30, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Hvyunitj) - -static void __fastcall hvyunit_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xc000) { - DrvSprRAM[address & 0xfff] = data; - - address = (address & 0x800) | ((address & 0xff) << 3) | ((address & 0x700) >> 8); - - DrvPandoraRAM[address] = data; - return; - } -} - -static void master_bankswitch(INT32 data) -{ - z80banks[0] = data; - INT32 bank = (data & 7) * 0x4000; - - ZetMapMemory(DrvZ80ROM0 + bank, 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall hvyunit_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - master_bankswitch(data); - return; - - case 0x02: - { - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - } - return; - } -} - -static void slave_bankswitch(INT32 data) -{ - z80banks[1] = data; - INT32 bank = (data & 0x03) * 0x4000; - - ZetMapMemory(DrvZ80ROM1 + bank, 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall hvyunit_sub_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - scrollx = (scrollx & 0xff) | ((data & 0x40) << 2); - scrolly = (scrolly & 0xff) | ((data & 0x80) << 1); - slave_bankswitch(data); - return; - - case 0x02: - { - soundlatch = data; - ZetClose(); - ZetOpen(2); - ZetNmi(); - ZetClose(); - ZetOpen(1); - } - return; - - case 0x04: - mermaidWrite(data); - return; - - case 0x06: - scrolly = (scrolly & 0x100) | data; - return; - - case 0x08: - scrollx = (scrollx & 0x100) | data; - return; - - case 0x0e: - // coin counter - return; - } -} - -static UINT8 __fastcall hvyunit_sub_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x04: - return mermaidRead(); - - case 0x0c: - return mermaidStatus(); - } - - return 0; -} - -static void sound_bankswitch(INT32 data) -{ - z80banks[2] = data; - INT32 bank = (data & 0x03) * 0x4000; - - ZetMapMemory(DrvZ80ROM2 + bank, 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall hvyunit_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - sound_bankswitch(data); - return; - - case 0x02: - case 0x03: - BurnYM2203Write(0, port & 1, data); - return; - } -} - -static UINT8 __fastcall hvyunit_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x02: - case 0x03: - return BurnYM2203Read(0, port & 1); - - case 0x04: - return soundlatch; - } - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 6000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - master_bankswitch(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - slave_bankswitch(0); - ZetClose(); - - ZetOpen(2); - ZetReset(); - sound_bankswitch(0); - BurnYM2203Reset(); - ZetClose(); - - mermaidReset(); - - scrollx = 0; - scrolly = 0; - soundlatch = 0; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - static INT32 Plane[4] = { STEP4(0,1) }; - static INT32 XOffs[16] = { STEP8(0,4), STEP8(256,4) }; - static INT32 YOffs[16] = { STEP8(0,32), STEP8(512,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x010000; - DrvZ80ROM2 = Next; Next += 0x010000; - - DrvMCUROM = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x001000; - DrvPandoraRAM = Next; Next += 0x001000; - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x001000; - DrvShareRAM = Next; Next += 0x002000; - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - DrvPalRAM = Next; Next += 0x000400; - DrvZ80RAM2 = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 select) -{ - BurnSetRefreshRate(58); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvMCUROM + 0x000000, 3, 1)) return 1; - - switch (select) - { - case 0: // hvyunit, hvyunitjo - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x120000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x140000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x160000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x180000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1a0000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1c0000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 12, 1)) return 1; - } - break; - - case 1: // hvyunitj - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x110000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x120000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x130000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x140000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x150000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x160000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 12, 1)) return 1; - } - break; - - case 2: // hvyunitu - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x120000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x140000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x160000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - } - break; - } - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc000, 0xcfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xd000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xe000, 0xffff, MAP_RAM); - ZetSetWriteHandler(hvyunit_main_write); - //ZetSetReadHandler(hvyunit_main_read); - ZetSetOutHandler(hvyunit_main_write_port); - //ZetSetInHandler(hvyunit_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0xc000, 0xc3ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0xc400, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0xd000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvPalRAM + 0x200, 0xd000, 0xd1ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd800, 0xd9ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xe000, 0xffff, MAP_RAM); - ZetSetOutHandler(hvyunit_sub_write_port); - ZetSetInHandler(hvyunit_sub_read_port); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xc7ff, MAP_RAM); - ZetSetOutHandler(hvyunit_sound_write_port); - ZetSetInHandler(hvyunit_sound_read_port); - ZetClose(); - - mermaidInit(DrvMCUROM, DrvInputs); - - BurnYM2203Init(1, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(6000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - pandora_init(DrvPandoraRAM, DrvGfxROM0, (0x400000/0x100)-1, 0x100, 0, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - pandora_exit(); - - GenericTilesExit(); - - ZetExit(); - mermaidExit(); - - BurnYM2203Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvRecalcPalette() -{ - for (INT32 i = 0; i < 0x400/2; i++) { - INT32 r = DrvPalRAM[0x200+i] & 0xf; - INT32 g = DrvPalRAM[i] >> 4; - INT32 b = DrvPalRAM[i] & 0x0f; - - DrvPalette[i] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); - } -} - -static void draw_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 16; - INT32 sy = (offs / 0x20) * 16; - - sx -= (scrollx + 96) & 0x1ff; - sy -= (scrolly + 16); - if (sx < -15) sx += 512; - if (sy < -15) sy += 512; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = DrvVidRAM[offs] | (DrvColRAM[offs] << 8); - INT32 color = code >> 12; - - Render16x16Tile_Clip(pTransDraw, code & 0xfff, sx, sy, color, 4, 0, DrvGfxROM1); - } -} - -static INT32 DrvDraw() -{ - DrvRecalcPalette(); - - draw_layer(); - - pandora_flipscreen = 0; - pandora_update(pTransDraw); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - // mermaid new frame - - { - memset (DrvInputs, 0xff, 4); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[2] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[0] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[4] = { 6000000 / 58, 6000000 / 58, 6000000 / 58, 6000000 / 58 }; - INT32 nCyclesDone[4] = { 0, 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == 64) { - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - if (i == 240) { - ZetSetVector(0xfd); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - nSegment = ZetTotalCycles(); - ZetClose(); - - ZetOpen(1); - nSegment -= ZetTotalCycles(); - if (mermaid_sub_z80_reset) { - nCyclesDone[1] += nSegment; - ZetIdle(nSegment); - } else { - nCyclesDone[1] += ZetRun(nSegment); - if (i == 240) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - nSegment = ZetTotalCycles(); - ZetClose(); - - ZetOpen(2); - BurnTimerUpdate(nSegment); - if (i == 240) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - nCyclesDone[3] += mermaidRun(nSegment - nCyclesDone[3]); - - if (i == 239) - pandora_buffer_sprites(); - } - - ZetOpen(2); - BurnTimerEndFrame(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029672; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - mermaidScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - SCAN_VAR(soundlatch); - SCAN_VAR(z80banks); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - master_bankswitch(z80banks[0]); - ZetClose(); - - ZetOpen(1); - slave_bankswitch(z80banks[1]); - ZetClose(); - - ZetOpen(2); - sound_bankswitch(z80banks[2]); - ZetClose(); - } - - return 0; -} - - -// Heavy Unit (World) - -static struct BurnRomInfo hvyunitRomDesc[] = { - { "b73_10.5c", 0x20000, 0xca52210f, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b73_11.5p", 0x10000, 0xcb451695, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b73_12.7e", 0x10000, 0xd1d24fab, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "mermaid.bin", 0x00e00, 0x88c5dd27, 4 | BRF_PRG | BRF_ESS }, // 3 I80C51 (mermaid) Code - - { "b73_08.2f", 0x80000, 0xf83dd808, 5 | BRF_GRA }, // 4 Sprites - { "b73_07.2c", 0x10000, 0x5cffa42c, 5 | BRF_GRA }, // 5 - { "b73_06.2b", 0x10000, 0xa98e4aea, 5 | BRF_GRA }, // 6 - { "b73_01.1b", 0x10000, 0x3a8a4489, 5 | BRF_GRA }, // 7 - { "b73_02.1c", 0x10000, 0x025c536c, 5 | BRF_GRA }, // 8 - { "b73_03.1d", 0x10000, 0xec6020cf, 5 | BRF_GRA }, // 9 - { "b73_04.1f", 0x10000, 0xf7badbb2, 5 | BRF_GRA }, // 10 - { "b73_05.1h", 0x10000, 0xb8e829d2, 5 | BRF_GRA }, // 11 - - { "b73_09.2p", 0x80000, 0x537c647f, 6 | BRF_GRA }, // 12 Background Tiles -}; - -STD_ROM_PICK(hvyunit) -STD_ROM_FN(hvyunit) - -static INT32 hvyunitInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvHvyunit = { - "hvyunit", NULL, NULL, NULL, "1988", - "Heavy Unit (World)\0", NULL, "Kaneko / Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO_MISC, GBF_VERSHOOT, 0, - NULL, hvyunitRomInfo, hvyunitRomName, NULL, NULL, HvyunitInputInfo, HvyunitDIPInfo, - hvyunitInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Heavy Unit (Japan, Newer) - -static struct BurnRomInfo hvyunitjRomDesc[] = { - { "b73_30.5c", 0x20000, 0x600af545, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b73_14.5p", 0x10000, 0x0dfb51d4, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b73_12.7e", 0x10000, 0xd1d24fab, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "mermaid.bin", 0x00e00, 0x88c5dd27, 4 | BRF_PRG | BRF_ESS }, // 3 I80C51 (mermaid) Code - - { "b73_08.2f", 0x80000, 0xf83dd808, 5 | BRF_GRA }, // 4 Sprites - { "b73_07.2c", 0x10000, 0x5cffa42c, 5 | BRF_GRA }, // 5 - { "b73_06.2b", 0x10000, 0xa98e4aea, 5 | BRF_GRA }, // 6 - { "b73_01.1b", 0x10000, 0x3a8a4489, 5 | BRF_GRA }, // 7 - { "b73_02.1c", 0x10000, 0x025c536c, 5 | BRF_GRA }, // 8 - { "b73_03.1d", 0x10000, 0xec6020cf, 5 | BRF_GRA }, // 9 - { "b73_04.1f", 0x10000, 0xf7badbb2, 5 | BRF_GRA }, // 10 - { "b73_05.1h", 0x10000, 0xb8e829d2, 5 | BRF_GRA }, // 11 - - { "b73_09.2p", 0x80000, 0x537c647f, 6 | BRF_GRA }, // 12 Background Tiles -}; - -STD_ROM_PICK(hvyunitj) -STD_ROM_FN(hvyunitj) - -static INT32 hvyunitjInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvHvyunitj = { - "hvyunitj", "hvyunit", NULL, NULL, "1988", - "Heavy Unit (Japan, Newer)\0", NULL, "Kaneko / Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO_MISC, GBF_VERSHOOT, 0, - NULL, hvyunitjRomInfo, hvyunitjRomName, NULL, NULL, HvyunitInputInfo, HvyunitjDIPInfo, - hvyunitjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Heavy Unit (Japan, Older) - -static struct BurnRomInfo hvyunitjoRomDesc[] = { - { "b73_13.5c", 0x20000, 0xe2874601, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b73_14.5p", 0x10000, 0x0dfb51d4, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b73_12.7e", 0x10000, 0xd1d24fab, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "mermaid.bin", 0x00e00, 0x88c5dd27, 4 | BRF_PRG | BRF_ESS }, // 3 I80C51 (mermaid) Code - - { "b73_08.2f", 0x80000, 0xf83dd808, 5 | BRF_GRA }, // 4 Sprites - { "b73_07.2c", 0x10000, 0x5cffa42c, 5 | BRF_GRA }, // 5 - { "b73_06.2b", 0x10000, 0xa98e4aea, 5 | BRF_GRA }, // 6 - { "b73_01.1b", 0x10000, 0x3a8a4489, 5 | BRF_GRA }, // 7 - { "b73_02.1c", 0x10000, 0x025c536c, 5 | BRF_GRA }, // 8 - { "b73_03.1d", 0x10000, 0xec6020cf, 5 | BRF_GRA }, // 9 - { "b73_04.1f", 0x10000, 0xf7badbb2, 5 | BRF_GRA }, // 10 - { "b73_05.1h", 0x10000, 0xb8e829d2, 5 | BRF_GRA }, // 11 - - { "b73_09.2p", 0x80000, 0x537c647f, 6 | BRF_GRA }, // 12 Background Tiles -}; - -STD_ROM_PICK(hvyunitjo) -STD_ROM_FN(hvyunitjo) - -struct BurnDriver BurnDrvHvyunitjo = { - "hvyunitjo", "hvyunit", NULL, NULL, "1988", - "Heavy Unit (Japan, Older)\0", NULL, "Kaneko / Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO_MISC, GBF_VERSHOOT, 0, - NULL, hvyunitjoRomInfo, hvyunitjoRomName, NULL, NULL, HvyunitInputInfo, HvyunitjDIPInfo, - hvyunitInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Heavy Unit -U.S.A. Version- (US) - -static struct BurnRomInfo hvyunituRomDesc[] = { - { "b73_34.5c", 0x20000, 0x05c30a90, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b73_35.6p", 0x10000, 0xaed1669d, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b73_12.7e", 0x10000, 0xd1d24fab, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "mermaid.bin", 0x00e00, 0x88c5dd27, 4 | BRF_PRG | BRF_ESS }, // 3 I80C51 (mermaid) Code - - { "b73_08.2f", 0x80000, 0xf83dd808, 5 | BRF_GRA }, // 4 Sprites - { "b73_28.2c", 0x20000, 0xa02e08d6, 5 | BRF_GRA }, // 5 - { "b73_27.2b", 0x20000, 0x8708f97c, 5 | BRF_GRA }, // 6 - { "b73_25.0b", 0x20000, 0x2f13f81e, 5 | BRF_GRA }, // 7 - { "b73_26.0c", 0x10000, 0xb8e829d2, 5 | BRF_GRA }, // 8 - - { "b73_09.2p", 0x80000, 0x537c647f, 6 | BRF_GRA }, // 9 Background Tiles -}; - -STD_ROM_PICK(hvyunitu) -STD_ROM_FN(hvyunitu) - -static INT32 hvyunituInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvHvyunitu = { - "hvyunitu", "hvyunit", NULL, NULL, "1988", - "Heavy Unit -U.S.A. Version- (US)\0", NULL, "Kaneko / Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO_MISC, GBF_VERSHOOT, 0, - NULL, hvyunituRomInfo, hvyunituRomName, NULL, NULL, HvyunitInputInfo, HvyunitjDIPInfo, - hvyunituInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_ikki.cpp b/jan/src/burn/drv/pre90s/d_ikki.cpp deleted file mode 100644 index 499df2204..000000000 --- a/jan/src/burn/drv/pre90s/d_ikki.cpp +++ /dev/null @@ -1,659 +0,0 @@ -// FB Alpha Ikki / Farmers Rebellion driver module -// Based on MAME driver by Uki - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidAttr; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvShareRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; - -static UINT8 *DrvTransMask; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; - -static UINT8 *flipscreen; -static UINT8 *ikki_scroll; - -static INT32 vblank; - -static struct BurnInputInfo IkkiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ikki) - -static struct BurnDIPInfo IkkiDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x01, 0x00, "3" }, - {0x10, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2, "2 Player Game" }, - {0x10, 0x01, 0x02, 0x00, "2 Credits" }, - {0x10, 0x01, 0x02, 0x02, "1 Credit" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 16, "Coin1 / Coin2" }, - {0x10, 0x01, 0xf0, 0x00, "1 Coin 1 Credit / 1 Coin 1 Credit " }, - {0x10, 0x01, 0xf0, 0x10, "2 Coins 1 Credit / 2 Coins 1 Credit " }, - {0x10, 0x01, 0xf0, 0x20, "2 Coins 1 Credit / 1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "1 Coin 1 Credit / 1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x40, "1 Coin 1 Credit / 1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "1 Coin 1 Credit / 1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "1 Coin 1 Credit / 1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "1 Coin 1 Credit / 1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "1 Coin 2 Credits / 1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 2 Credits / 1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 2 Credits / 1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 2 Credits / 1 Coin 10 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 2 Credits / 1 Coin 11 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 2 Credits / 1 Coin 12 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits / 1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "Free_Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x06, 0x00, "1 (Normal)" }, - {0x11, 0x01, 0x06, 0x02, "2" }, - {0x11, 0x01, 0x06, 0x04, "3" }, - {0x11, 0x01, 0x06, 0x06, "4 (Difficult)" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Ikki) - -void __fastcall ikki_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe008: - *flipscreen = data & 4; - return; - - case 0xe00a: - case 0xe00b: - ikki_scroll[address & 1] = data; - return; - } -} - -UINT8 __fastcall ikki_main_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - return (vblank ? 2 : 0); - - case 0xe001: - return DrvDips[0]; - - case 0xe002: - return DrvDips[1]; - - case 0xe003: - return DrvInputs[2]; - - case 0xe004: - return DrvInputs[0]; - - case 0xe005: - return DrvInputs[1]; - } - - return 0; -} - -void __fastcall ikki_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xd801: - SN76496Write(0, data); - return; - - case 0xd802: - SN76496Write(1, data); - return; - } -} - -UINT8 __fastcall ikki_sub_read(UINT16 /*address*/) -{ - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - HiscoreReset(); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 tmp[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 r = DrvColPROM[i + 0x000] & 0x0f; - UINT8 g = DrvColPROM[i + 0x100] & 0x0f; - UINT8 b = DrvColPROM[i + 0x200] & 0x0f; - - tmp[i] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0); - } - - memset (DrvTransMask, 1, 0x200); - - for (INT32 i = 0; i < 0x200; i++) - { - UINT16 ctabentry = DrvColPROM[i+0x300] ^ 0xff; - - if ((i & 0x07) == 0x07 && ctabentry == 0) DrvTransMask[i] = 0; - if ((i & 0x07) == 0x00) DrvTransMask[i] = 0; // Seems to work... - - DrvPalette[i+0x000] = tmp[ctabentry]; - DrvPalette[i+0x200] = tmp[DrvColPROM[i+0x500]]; - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { 16384*8*2,16384*8,0 }; - INT32 XOffs[16] = { 7,6,5,4,3,2,1,0,8*16+7,8*16+6,8*16+5,8*16+4,8*16+3,8*16+2,8*16+1,8*16+0 }; - INT32 YOffs[32] = { 8*0, 8*1, 8*2, 8*3, 8*4, 8*5, 8*6, 8*7, 8*8,8*9,8*10,8*11,8*12,8*13,8*14,8*15, - 8*32,8*33,8*34,8*35,8*36,8*37,8*38,8*39, 8*40,8*41,8*42,8*43,8*44,8*45,8*46,8*47 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); - - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0xc000); - - GfxDecode(0x800, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0xc000); - - GfxDecode(0x100, 3, 16, 32, Plane, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000800; - - DrvVidAttr = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvTransMask = Next; Next += 0x000200; - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x000800; - DrvShareRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - - ikki_scroll = Next; Next += 0x000002; - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x8000, DrvZ80ROM0 + 0x2000, 0x2000); - - if (BurnLoadRom(DrvZ80ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 4, 1)) return 1; - - for (INT32 i = 0; i < 3; i++) { - if (BurnLoadRom(DrvGfxROM1 + 0x4000 * i, 5 + i, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000 * i, 8 + i, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100 * i, 11 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvColPROM + 0x0300, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0500, 15, 1)) return 1; - - if (BurnLoadRom(DrvVidAttr + 0x0000, 16, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x9fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x9fff, 2, DrvZ80ROM0); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM0); - ZetMapArea(0xc800, 0xcfff, 0, DrvShareRAM); - ZetMapArea(0xc800, 0xcfff, 1, DrvShareRAM); - ZetMapArea(0xc800, 0xcfff, 2, DrvShareRAM); - ZetMapArea(0xd000, 0xd7ff, 0, DrvVidRAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvVidRAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvVidRAM); - ZetSetWriteHandler(ikki_main_write); - ZetSetReadHandler(ikki_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x1fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x1fff, 2, DrvZ80ROM1); - ZetMapArea(0xc000, 0xc7ff, 0, DrvSprRAM); - ZetMapArea(0xc000, 0xc7ff, 1, DrvSprRAM); - ZetMapArea(0xc000, 0xc7ff, 2, DrvSprRAM); - ZetMapArea(0xc800, 0xcfff, 0, DrvShareRAM); - ZetMapArea(0xc800, 0xcfff, 1, DrvShareRAM); - ZetMapArea(0xc800, 0xcfff, 2, DrvShareRAM); - ZetSetWriteHandler(ikki_sub_write); - ZetSetReadHandler(ikki_sub_read); - ZetClose(); - - SN76496Init(0, 8000000/4, 0); - SN76496Init(1, 8000000/2, 1); - SN76496SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.75, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SN76496Exit(); - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x800; offs += 4) - { - INT32 code = (DrvSprRAM[offs + 2] & 0x80) | (DrvSprRAM[offs + 1] >> 1); - INT32 color = DrvSprRAM[offs + 2] & 0x3f; - - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = DrvSprRAM[offs + 0]; - - if (*flipscreen) - sx = 240 - sx; - else - sy = 224 - sy; - - sx &= 0xff; - sy &= 0xff; - if (sx > 248) sx -= 256; - if (sy > 240) sy -= 256; - - sy -= 16; - sx -= 8; - - { - UINT8 *src = DrvGfxROM1 + (code << 9); - color <<= 3; - - if (*flipscreen) { - for (INT32 y = 31; y >= 0; y--) - { - INT32 yy = sy + y; - - for (INT32 x = 15; x >= 0; x--) - { - INT32 xx = sx + x; - INT32 pxl = src[15-x] | color; - - if (xx < 0 || yy < 0 || xx >= nScreenWidth || yy >= nScreenHeight) continue; - - if (DrvTransMask[pxl]) - pTransDraw[(yy * nScreenWidth) + xx] = pxl; - } - - src += 16; - } - } else { - for (INT32 y = 0; y < 32; y++) - { - INT32 yy = sy + y; - - for (INT32 x = 0; x < 16; x++) - { - INT32 xx = sx + x; - INT32 pxl = src[x] | color; - - if (xx < 0 || yy < 0 || xx >= nScreenWidth || yy >= nScreenHeight) continue; - - if (DrvTransMask[pxl]) - pTransDraw[(yy * nScreenWidth) + xx] = pxl; - } - - src += 16; - } - } - } - } -} - -static void draw_bg_layer(INT32 prio) -{ - for (INT32 offs = 0; offs < 0x800 / 2; offs++) - { - INT32 x = (offs >> 5) << 3; - INT32 y = (offs & 0x1f) << 3; - INT32 d = DrvVidAttr[x >> 3]; - - if (d != 0 && d != 0x0d) { - if (prio) continue; - } - - INT32 color = DrvVidRAM[offs << 1]; - INT32 code = DrvVidRAM[(offs << 1) | 1] + ((color & 0xe0) << 3); - color = (color & 0x1f) | ((color & 0x80) >> 2); - - if (d == 0x02 && prio == 0) { - x -= ikki_scroll[1]; - if (x < 0) x += 176; - - y = (y + ~ikki_scroll[0]) & 0xff; - } - - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, (248-x)-8, (248-y)-16, color, 3, 0x200, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, x-8, y-16, color, 3, 0x200, DrvGfxROM0); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_bg_layer(0); - draw_sprites(); - draw_bg_layer(1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0x00, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // clear opposites - if (DrvJoy1[2] && DrvJoy1[3]) DrvInputs[0] &= ~0x0c; - if (DrvJoy1[1] && DrvJoy1[0]) DrvInputs[0] &= ~0x03; - if (DrvJoy2[3] && DrvJoy2[2]) DrvInputs[1] &= ~0x0c; - if (DrvJoy2[1] && DrvJoy2[0]) DrvInputs[1] &= ~0x03; - } - - INT32 nCycleSegment; - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - vblank = 1; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCycleSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCycleSegment); - if (i == 15) { - vblank = 0; - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - if (i == 239) { - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - vblank = 1; - } - ZetClose(); - - nCycleSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCycleSegment); - if (i == 15) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - if (i == 239) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - } - - return 0; -} - - -// Ikki (Japan) - -static struct BurnRomInfo ikkiRomDesc[] = { - { "tvg17_1", 0x4000, 0xcb28167c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "tvg17_2", 0x2000, 0x756c7450, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tvg17_3", 0x2000, 0x91f0a8b6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tvg17_4", 0x2000, 0x696fcf7d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "tvg17_5", 0x2000, 0x22bdb40e, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "tvg17_6", 0x4000, 0xdc8aa269, 3 | BRF_GRA }, // 5 Sprites - { "tvg17_7", 0x4000, 0x0e9efeba, 3 | BRF_GRA }, // 6 - { "tvg17_8", 0x4000, 0x45c9087a, 3 | BRF_GRA }, // 7 - - { "tvg17_9", 0x4000, 0xc594f3c5, 4 | BRF_GRA }, // 8 Background Tiles - { "tvg17_10", 0x4000, 0x2e510b4e, 4 | BRF_GRA }, // 9 - { "tvg17_11", 0x4000, 0x35012775, 4 | BRF_GRA }, // 10 - - { "prom17_3", 0x0100, 0xdbcd3bec, 5 | BRF_GRA }, // 11 Color Proms - { "prom17_4", 0x0100, 0x9eb7b6cf, 5 | BRF_GRA }, // 12 - { "prom17_5", 0x0100, 0x9b30a7f3, 5 | BRF_GRA }, // 13 - { "prom17_6", 0x0200, 0x962e619d, 5 | BRF_GRA }, // 14 - { "prom17_7", 0x0200, 0xb1f5148c, 5 | BRF_GRA }, // 15 - - { "prom17_1", 0x0100, 0xca0af30c, 6 | BRF_OPT }, // 16 Unused Proms - { "prom17_2", 0x0100, 0xf3c55174, 6 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(ikki) -STD_ROM_FN(ikki) - -struct BurnDriver BurnDrvIkki = { - "ikki", NULL, NULL, NULL, "1985", - "Ikki (Japan)\0", NULL, "Sun Electronics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE | GBF_SCRFIGHT, 0, - NULL, ikkiRomInfo, ikkiRomName, NULL, NULL, IkkiInputInfo, IkkiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// Farmers Rebellion - -static struct BurnRomInfo farmerRomDesc[] = { - { "tvg-1.10", 0x4000, 0x2c0bd392, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "tvg-2.9", 0x2000, 0xb86efe02, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tvg-3.8", 0x2000, 0xfd686ff4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tvg-4.7", 0x2000, 0x1415355d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "tvg-5.30", 0x2000, 0x22bdb40e, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "tvg-6.104", 0x4000, 0xdc8aa269, 3 | BRF_GRA }, // 5 Sprites - { "tvg-7.103", 0x4000, 0x0e9efeba, 3 | BRF_GRA }, // 6 - { "tvg-8.102", 0x4000, 0x45c9087a, 3 | BRF_GRA }, // 7 - - { "tvg17_9", 0x4000, 0xc594f3c5, 4 | BRF_GRA }, // 8 Background Tiles - { "tvg17_10", 0x4000, 0x2e510b4e, 4 | BRF_GRA }, // 9 - { "tvg17_11", 0x4000, 0x35012775, 4 | BRF_GRA }, // 10 - - { "prom17_3", 0x0100, 0xdbcd3bec, 5 | BRF_GRA }, // 11 Color Proms - { "prom17_4", 0x0100, 0x9eb7b6cf, 5 | BRF_GRA }, // 12 - { "prom17_5", 0x0100, 0x9b30a7f3, 5 | BRF_GRA }, // 13 - { "prom17_6", 0x0200, 0x962e619d, 5 | BRF_GRA }, // 14 - { "prom17_7", 0x0200, 0xb1f5148c, 5 | BRF_GRA }, // 15 - - { "prom17_1", 0x0100, 0xca0af30c, 6 | BRF_OPT }, // 16 Unused Proms - { "prom17_2", 0x0100, 0xf3c55174, 6 | BRF_OPT }, // 17 -}; - -STD_ROM_PICK(farmer) -STD_ROM_FN(farmer) - -struct BurnDriver BurnDrvFarmer = { - "farmer", "ikki", NULL, NULL, "1985", - "Farmers Rebellion\0", NULL, "Sun Electronics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE | GBF_SCRFIGHT, 0, - NULL, farmerRomInfo, farmerRomName, NULL, NULL, IkkiInputInfo, IkkiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_invaders.cpp b/jan/src/burn/drv/pre90s/d_invaders.cpp deleted file mode 100644 index 242d54df2..000000000 --- a/jan/src/burn/drv/pre90s/d_invaders.cpp +++ /dev/null @@ -1,717 +0,0 @@ -// FB Alpha Space Invaders driver module -// Based on MAME driver by Michael Strutts, Nicola Salmoria, Tormod Tjaberg, Mirko Buffoni, -// Lee Taylor, Valerio Verrando, Marco Cassili, Zsolt Vasvari and others - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "samples.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvI8080ROM; -static UINT8 *DrvMainRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *prev_snd_data; - -static UINT16 shift_data; -static UINT8 shift_count; -static INT32 watchdog; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; -static UINT32 inputxor=0; - -static struct BurnInputInfo InvadersInputList[] = { - {"Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 6, "p1 right" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 6, "p2 right" }, - - {"Tilt", BIT_DIGITAL, DrvJoy3 + 2, "tilt" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dips", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Invaders) - -static struct BurnDIPInfo InvadersDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0b, 0x01, 0x03, 0x00, "3" }, - {0x0b, 0x01, 0x03, 0x01, "4" }, - {0x0b, 0x01, 0x03, 0x02, "5" }, - {0x0b, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0b, 0x01, 0x0c, 0x00, "1000" }, - {0x0b, 0x01, 0x0c, 0x08, "5000" }, - - {0 , 0xfe, 0 , 2 , "Coin Info" }, - {0x0b, 0x01, 0x80, 0x80, "Off" }, - {0x0b, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Invaders) - -static struct BurnInputInfo SitvInputList[] = { - {"Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 6, "p1 right" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 6, "p2 right" }, - - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 2, "tilt" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dips", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Sitv) - -static struct BurnDIPInfo SitvDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "1000" }, - {0x0c, 0x01, 0x0c, 0x08, "1500" }, - - {0 , 0xfe, 0 , 2 , "Coin Info" }, - {0x0c, 0x01, 0x80, 0x80, "Off" }, - {0x0c, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Sitv) - -static struct BurnDIPInfo OzmawarsDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Energy" }, - {0x0b, 0x01, 0x03, 0x00, "15000" }, - {0x0b, 0x01, 0x03, 0x01, "20000" }, - {0x0b, 0x01, 0x03, 0x02, "25000" }, - {0x0b, 0x01, 0x03, 0x03, "35000" }, - - {0 , 0xfe, 0 , 2, "Bonus Energy" }, - {0x0b, 0x01, 0x08, 0x00, "15000" }, - {0x0b, 0x01, 0x08, 0x08, "10000" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0b, 0x01, 0x80, 0x00, "1 Coin 1 Credits" }, - {0x0b, 0x01, 0x80, 0x80, "1 Coin 2 Credits" }, -}; - -STDDIPINFO(Ozmawars) - -static void invaders_sh_1_write(UINT8 data, UINT8 *last) -{ - if ( data & 0x01 && ~*last & 0x01) BurnSamplePlay(9); // Ufo Sound - if ( data & 0x02 && ~*last & 0x02) BurnSamplePlay(0); // Shot Sound - if ( data & 0x04 && ~*last & 0x04) BurnSamplePlay(1); // Base Hit - if (~data & 0x04 && *last & 0x04) BurnSampleStop(1); - if ( data & 0x08 && ~*last & 0x08) BurnSamplePlay(2); // Invader Hit - if ( data & 0x10 && ~*last & 0x10) BurnSamplePlay(8); // Bonus Missle Base - - *last = data; -} - -static void invaders_sh_2_write(UINT8 data, UINT8 *last) -{ - if (data & 0x01 && ~*last & 0x01) BurnSamplePlay(3); // Fleet 1 - if (data & 0x02 && ~*last & 0x02) BurnSamplePlay(4); // Fleet 2 - if (data & 0x04 && ~*last & 0x04) BurnSamplePlay(5); // Fleet 3 - if (data & 0x08 && ~*last & 0x08) BurnSamplePlay(6); // Fleet 4 - if (data & 0x10 && ~*last & 0x10) BurnSamplePlay(7); // Saucer Hit - - *last = data; -} - -static void __fastcall invaders_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0x07) - { - case 0x02: - shift_count = ~data & 0x07; - return; - - case 0x03: - invaders_sh_1_write(data, &prev_snd_data[0]); - return; - - case 0x04: - shift_data = (data << 7) | (shift_data >> 8); - return; - - case 0x05: - invaders_sh_2_write(data, &prev_snd_data[0]); - return; - - case 0x06: - watchdog = 0; - return; - } -} - -static UINT8 __fastcall invaders_read_port(UINT16 port) -{ - switch (port & 0x03) - { - case 0x00: - return DrvInputs[0] ^ (inputxor & 0xff); - - case 0x01: - return DrvInputs[1] ^ ((inputxor >> 8) & 0xff); - - case 0x02: - return ((DrvInputs[2] ^ ((inputxor >> 16) & 0xff)) & 0x74) | (DrvDips[0] & 0x8b); - - case 0x03: - return (shift_data >> shift_count) & 0xff; - } - - return 0; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset(AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnSampleReset(); - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvI8080ROM = Next; Next += 0x006000; - - DrvPalette = (UINT32*)Next; Next += 0x0002 * sizeof(UINT32); - - AllRam = Next; - - DrvMainRAM = Next; Next += 0x002000; - - prev_snd_data = Next; Next += 0x000002; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 rom_size, INT32 rom_count, UINT32 input_xor) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - INT32 load_offset = 0; - for (INT32 i = 0; i < rom_count; i++) { - if (BurnLoadRom(DrvI8080ROM + load_offset, i, 1)) return 1; - load_offset += rom_size; - if (load_offset == 0x0c00 && rom_size == 0x400 && rom_count == 6) load_offset = 0x1400; - if (load_offset == 0x2000) load_offset = 0x4000; - } - } - - ZetInit(0); // really i8080 - ZetOpen(0); - ZetMapMemory(DrvI8080ROM, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvMainRAM, 0x2000, 0x3fff, MAP_RAM); - ZetMapMemory(DrvI8080ROM + 0x4000, 0x4000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvMainRAM, 0x6000, 0x7fff, MAP_RAM); // mirror - ZetMapMemory(DrvI8080ROM, 0x8000, 0x9fff, MAP_ROM); // mirror - ZetMapMemory(DrvMainRAM, 0xa000, 0xbfff, MAP_RAM); // mirror - ZetMapMemory(DrvI8080ROM + 0x4000, 0xc000, 0xdfff, MAP_ROM); // mirror - ZetMapMemory(DrvMainRAM, 0xe000, 0xffff, MAP_RAM); // mirror - ZetSetOutHandler(invaders_write_port); - ZetSetInHandler(invaders_read_port); - ZetClose(); - - BurnSampleInit(0); - BurnSampleSetAllRoutesAllSamples(0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - inputxor = input_xor; - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnSampleExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_invaders_bitmap() -{ - UINT8 x = 0; - UINT8 y = 0x20; - UINT8 video_data = 0; - - while (1) - { - pTransDraw[((y - 0x20) * nScreenWidth) + x] = (video_data & 0x01); - - video_data >>= 1; - x++; - - if (x == 0) - { - for (INT32 i = 0; i < 4; i++) - { - pTransDraw[((y - 0x20) * nScreenWidth) + (256 + i)] = (video_data & 0x01); - video_data >>= 1; - } - - y++; - - if (y == 0) break; - } - else if ((x & 0x07) == 0x04) - { - video_data = DrvMainRAM[((y << 5) | (x >> 3)) & 0x1fff]; - } - } -} - -static INT32 DrvDraw() -{ - DrvPalette[0] = BurnHighCol(0x00,0x00,0x00,0); - DrvPalette[1] = BurnHighCol(0xff,0xff,0xff,0); - - draw_invaders_bitmap(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[1] = { 1996800 / 60 }; - INT32 nCyclesDone[1] = { 0 }; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] += ZetRun(nSegment); - if (i == 96) { - ZetSetVector(0xd7); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - if (i == 224) { - ZetSetVector(0xcf); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - } - - ZetClose(); - - if (pBurnSoundOut) { - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029695; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - SCAN_VAR(shift_data); - SCAN_VAR(shift_count); - } - - return 0; -} - -static struct BurnSampleInfo InvadersSampleDesc[] = { -#if !defined (ROM_VERIFY) - { "1", SAMPLE_NOLOOP }, // Shot/Missle - { "2", SAMPLE_NOLOOP }, // Base Hit/Explosion - { "3", SAMPLE_NOLOOP }, // Invader Hit - { "4", SAMPLE_NOLOOP }, // Fleet move 1 - { "5", SAMPLE_NOLOOP }, // Fleet move 2 - { "6", SAMPLE_NOLOOP }, // Fleet move 3 - { "7", SAMPLE_NOLOOP }, // Fleet move 4 - { "8", SAMPLE_NOLOOP }, // UFO/Saucer Hit - { "9", SAMPLE_NOLOOP }, // Bonus Base - { "18",SAMPLE_NOLOOP }, // UFO Sound -#endif - { "", 0 } -}; - -STD_SAMPLE_PICK(Invaders) -STD_SAMPLE_FN(Invaders) - - -static struct BurnSampleInfo OzmawarsSampleDesc[] = { - { "1", SAMPLE_NOLOOP }, // Shot/Missle - { "2", SAMPLE_NOLOOP }, // Base Hit/Explosion - { "3", SAMPLE_NOLOOP }, // Invader Hit - { "4", SAMPLE_NOLOOP }, // Fleet move 1 - { "5", SAMPLE_NOLOOP }, // Fleet move 2 - { "6", SAMPLE_NOLOOP }, // Fleet move 3 - { "7", SAMPLE_NOLOOP }, // Fleet move 4 - { "8", SAMPLE_NOLOOP }, // UFO/Saucer Hit - { "9", SAMPLE_NOLOOP }, // Bonus Base - { "", 0 } -}; - -STD_SAMPLE_PICK(Ozmawars) -STD_SAMPLE_FN(Ozmawars) - - -// Space Invaders / Space Invaders M - -static struct BurnRomInfo invadersRomDesc[] = { - { "invaders.h", 0x0800, 0x734f5ad8, 1 | BRF_ESS | BRF_PRG }, // 0 i8080 code - { "invaders.g", 0x0800, 0x6bfaca4a, 1 | BRF_ESS | BRF_PRG }, // 1 - { "invaders.f", 0x0800, 0x0ccead96, 1 | BRF_ESS | BRF_PRG }, // 2 - { "invaders.e", 0x0800, 0x14e538b0, 1 | BRF_ESS | BRF_PRG }, // 3 -}; - -STD_ROM_PICK(invaders) -STD_ROM_FN(invaders) - -static INT32 InvadersInit() -{ - return DrvInit(0x800, 4, 0x000100); -} - -struct BurnDriver BurnDrvInvaders = { - "invaders", NULL, NULL, "invaders", "1978", - "Space Invaders / Space Invaders M\0", NULL, "Taito / Midway", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, invadersRomInfo, invadersRomName, InvadersSampleInfo, InvadersSampleName, InvadersInputInfo, InvadersDIPInfo, - InvadersInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x02, - 224, 260, 3, 4 -}; - - -// Space Invaders (SV Version rev 1) - -static struct BurnRomInfo sisv1RomDesc[] = { - { "sv01.36", 0x0400, 0xd0c32d72, 1 | BRF_ESS | BRF_PRG }, // 0 i8080 Code - { "sv02.35", 0x0400, 0x0e159534, 1 | BRF_ESS | BRF_PRG }, // 1 - { "sv03.34", 0x0400, 0x00000000, 1 | BRF_NODUMP | BRF_ESS | BRF_PRG }, // 2 - { "sv04.31", 0x0400, 0x1293b826, 1 | BRF_ESS | BRF_PRG }, // 3 - { "sv05.42", 0x0400, 0x00000000, 1 | BRF_NODUMP | BRF_ESS | BRF_PRG }, // 4 - { "sv06.41", 0x0400, 0x2c68e0b4, 1 | BRF_ESS | BRF_PRG }, // 5 -}; - -STD_ROM_PICK(sisv1) -STD_ROM_FN(sisv1) - -static INT32 Sisv1Init() -{ - return DrvInit(0x400, 6, 0x000100); -} - -struct BurnDriver BurnDrvSisv1 = { - "sisv1", "invaders", NULL, "invaders", "1978", - "Space Invaders (SV Version rev 1)\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, sisv1RomInfo, sisv1RomName, InvadersSampleInfo, InvadersSampleName, InvadersInputInfo, InvadersDIPInfo, - Sisv1Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 2, - 224, 260, 3, 4 -}; - - -// Space Invaders (SV Version rev 2) - -static struct BurnRomInfo sisv2RomDesc[] = { - { "sv01.36", 0x0400, 0xd0c32d72, 1 | BRF_ESS | BRF_PRG }, // 0 i8080 Code - { "sv02.35", 0x0400, 0x0e159534, 1 | BRF_ESS | BRF_PRG }, // 1 - { "sv10.34", 0x0400, 0x483e651e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "sv04.31", 0x0400, 0x1293b826, 1 | BRF_ESS | BRF_PRG }, // 3 - { "sv09.42", 0x0400, 0xcd80b13f, 1 | BRF_ESS | BRF_PRG }, // 4 - { "sv06.41", 0x0400, 0x2c68e0b4, 1 | BRF_ESS | BRF_PRG }, // 5 -}; - -STD_ROM_PICK(sisv2) -STD_ROM_FN(sisv2) - -struct BurnDriver BurnDrvSisv2 = { - "sisv2", "invaders", NULL, "invaders", "1978", - "Space Invaders (SV Version rev 2)\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, sisv2RomInfo, sisv2RomName, InvadersSampleInfo, InvadersSampleName, InvadersInputInfo, InvadersDIPInfo, - Sisv1Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 2, - 224, 260, 3, 4 -}; - - -// Space Invaders (SV Version rev 3) - -static struct BurnRomInfo sisv3RomDesc[] = { - { "sv0h.36", 0x0400, 0x86bb8cb6, 1 | BRF_ESS | BRF_PRG }, // 0 i8080 Code - { "sv02.35", 0x0400, 0x0e159534, 1 | BRF_ESS | BRF_PRG }, // 1 - { "sv10.34", 0x0400, 0x483e651e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "sv04.31", 0x0400, 0x1293b826, 1 | BRF_ESS | BRF_PRG }, // 3 - { "sv09.42", 0x0400, 0xcd80b13f, 1 | BRF_ESS | BRF_PRG }, // 4 - { "sv06.41", 0x0400, 0x2c68e0b4, 1 | BRF_ESS | BRF_PRG }, // 5 -}; - -STD_ROM_PICK(sisv3) -STD_ROM_FN(sisv3) - -struct BurnDriver BurnDrvSisv3 = { - "sisv3", "invaders", NULL, "invaders", "1978", - "Space Invaders (SV Version rev 3)\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, sisv3RomInfo, sisv3RomName, InvadersSampleInfo, InvadersSampleName, InvadersInputInfo, InvadersDIPInfo, - Sisv1Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 2, - 224, 260, 3, 4 -}; - - -// Space Invaders (SV Version rev 4) - -static struct BurnRomInfo sisvRomDesc[] = { - { "sv0h.36", 0x0400, 0x86bb8cb6, 1 | BRF_ESS | BRF_PRG }, // 0 i8080 Code - { "sv11.35", 0x0400, 0xfebe6d1a, 1 | BRF_ESS | BRF_PRG }, // 1 - { "sv12.34", 0x0400, 0xa08e7202, 1 | BRF_ESS | BRF_PRG }, // 2 - { "sv04.31", 0x0400, 0x1293b826, 1 | BRF_ESS | BRF_PRG }, // 3 - { "sv13.42", 0x0400, 0xa9011634, 1 | BRF_ESS | BRF_PRG }, // 4 - { "sv14.41", 0x0400, 0x58730370, 1 | BRF_ESS | BRF_PRG }, // 5 -}; - -STD_ROM_PICK(sisv) -STD_ROM_FN(sisv) - -struct BurnDriver BurnDrvSisv = { - "sisv", "invaders", NULL, "invaders", "1978", - "Space Invaders (SV Version rev 4)\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, sisvRomInfo, sisvRomName, InvadersSampleInfo, InvadersSampleName, InvadersInputInfo, InvadersDIPInfo, - Sisv1Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 2, - 224, 260, 3, 4 -}; - - -// Space Invaders (TV Version rev 1) - -static struct BurnRomInfo sitv1RomDesc[] = { - { "tv01.s1", 0x0800, 0x9f37b146, 1 | BRF_ESS | BRF_PRG }, // 0 i8080 Code - { "tv02.rp1", 0x0800, 0x3c759a90, 1 | BRF_ESS | BRF_PRG }, // 1 - { "tv03.n1", 0x0800, 0x0ad3657f, 1 | BRF_ESS | BRF_PRG }, // 2 - { "tv04.m1", 0x0800, 0xcd2c67f6, 1 | BRF_ESS | BRF_PRG }, // 3 -}; - -STD_ROM_PICK(sitv1) -STD_ROM_FN(sitv1) - -static INT32 Sitv1Init() -{ - return DrvInit(0x800, 4, 0x000101); -} - -struct BurnDriver BurnDrvSitv1 = { - "sitv1", "invaders", NULL, "invaders", "1978", - "Space Invaders (TV Version rev 1)\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, sitv1RomInfo, sitv1RomName, InvadersSampleInfo, InvadersSampleName, SitvInputInfo, SitvDIPInfo, - Sitv1Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 2, - 224, 260, 3, 4 -}; - - -// Space Invaders (TV Version rev 2) - -static struct BurnRomInfo sitvRomDesc[] = { - { "tv0h.s1", 0x0800, 0xfef18aad, 1 | BRF_ESS | BRF_PRG }, // 0 i8080 Code - { "tv02.rp1", 0x0800, 0x3c759a90, 1 | BRF_ESS | BRF_PRG }, // 1 - { "tv03.n1", 0x0800, 0x0ad3657f, 1 | BRF_ESS | BRF_PRG }, // 2 - { "tv04.m1", 0x0800, 0xcd2c67f6, 1 | BRF_ESS | BRF_PRG }, // 3 -}; - -STD_ROM_PICK(sitv) -STD_ROM_FN(sitv) - -struct BurnDriver BurnDrvSitv = { - "sitv", "invaders", NULL, "invaders", "1978", - "Space Invaders (TV Version rev 2)\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, sitvRomInfo, sitvRomName, InvadersSampleInfo, InvadersSampleName, SitvInputInfo, SitvDIPInfo, - Sitv1Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 2, - 224, 260, 3, 4 -}; - - -// Ozma Wars (set 1) - -static struct BurnRomInfo ozmawarsRomDesc[] = { - { "mw01", 0x0800, 0x31f4397d, 1 | BRF_ESS | BRF_PRG }, // 0 i8080 Code - { "mw02", 0x0800, 0xd8e77c62, 1 | BRF_ESS | BRF_PRG }, // 1 - { "mw03", 0x0800, 0x3bfa418f, 1 | BRF_ESS | BRF_PRG }, // 2 - { "mw04", 0x0800, 0xe190ce6c, 1 | BRF_ESS | BRF_PRG }, // 3 - { "mw05", 0x0800, 0x3bc7d4c7, 1 | BRF_ESS | BRF_PRG }, // 4 - { "mw06", 0x0800, 0x99ca2eae, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "01.1", 0x0400, 0xaac24f34, 0 | BRF_OPT }, - { "02.2", 0x0400, 0x2bdf83a0, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(ozmawars) -STD_ROM_FN(ozmawars) - -static INT32 OzmawarsInit() -{ - return DrvInit(0x800, 6, 0x000000); -} - -struct BurnDriver BurnDrvOzmawars = { - "ozmawars", NULL, NULL, "invaders", "1979", - "Ozma Wars (set 1)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, ozmawarsRomInfo, ozmawarsRomName, OzmawarsSampleInfo, OzmawarsSampleName, InvadersInputInfo, OzmawarsDIPInfo, - OzmawarsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 2, - 224, 260, 3, 4 -}; - - -// Ozma Wars (set 2) - -static struct BurnRomInfo ozmawars2RomDesc[] = { - { "oz1", 0x0400, 0x9300830e, 1 | BRF_ESS | BRF_PRG }, // 0 i8080 Code - { "oz2", 0x0400, 0x957fc661, 1 | BRF_ESS | BRF_PRG }, // 1 - { "oz3", 0x0400, 0xcf8f4d6c, 1 | BRF_ESS | BRF_PRG }, // 2 - { "oz4", 0x0400, 0xf51544a5, 1 | BRF_ESS | BRF_PRG }, // 3 - { "oz5", 0x0400, 0x5597bf52, 1 | BRF_ESS | BRF_PRG }, // 4 - { "oz6", 0x0400, 0x19b43578, 1 | BRF_ESS | BRF_PRG }, // 5 - { "oz7", 0x0400, 0xa285bfde, 1 | BRF_ESS | BRF_PRG }, // 6 - { "oz8", 0x0400, 0xae59a629, 1 | BRF_ESS | BRF_PRG }, // 7 - { "oz9", 0x0400, 0xdf0cc633, 1 | BRF_ESS | BRF_PRG }, // 8 - { "oz10", 0x0400, 0x31b7692e, 1 | BRF_ESS | BRF_PRG }, // 9 - { "oz11", 0x0400, 0x660e934c, 1 | BRF_ESS | BRF_PRG }, // 10 - { "oz12", 0x0400, 0x8b969f61, 1 | BRF_ESS | BRF_PRG }, // 11 - - { "01.1", 0x0400, 0xaac24f34, 0 | BRF_OPT }, - { "02.2", 0x0400, 0x2bdf83a0, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(ozmawars2) -STD_ROM_FN(ozmawars2) - -static INT32 Ozmawars2Init() -{ - INT32 nRet = DrvInit(0x400, 12, 0x000000); - - return nRet; -} - -struct BurnDriver BurnDrvOzmawars2 = { - "ozmawars2", "ozmawars", NULL, "invaders", "1979", - "Ozma Wars (set 2)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, ozmawars2RomInfo, ozmawars2RomName, OzmawarsSampleInfo, OzmawarsSampleName, InvadersInputInfo, OzmawarsDIPInfo, - Ozmawars2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 2, - 224, 260, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_jack.cpp b/jan/src/burn/drv/pre90s/d_jack.cpp deleted file mode 100644 index e9f663f35..000000000 --- a/jan/src/burn/drv/pre90s/d_jack.cpp +++ /dev/null @@ -1,2119 +0,0 @@ -// FB Alpha Jack the Giantkiller driver module -// Based on MAME driver by Brad Oliver - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "bitswap.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - - -static UINT8 *Mem, *Rom0, *Rom1, *Gfx, *Prom, *User; -static UINT8 DrvJoy1[8], DrvJoy2[8], DrvJoy3[8], DrvJoy4[8], DrvReset, DrvDips[2]; -static INT16 *pAY8910Buffer[3], *pFMBuffer = NULL; -static INT32 tri_fix = 0, joinem = 0, loverb = 0, suprtriv = 0, unclepoo = 0, zzyzzyxx = 0, freeze = 0; -static INT32 timer_rate, flip_screen; -static UINT32 *Palette, *DrvPal; -static UINT8 DrvCalcPal; -static UINT8 joinem_palette_bank = 0, joinem_nmi_enable = 0; -static INT32 joinem_scroll_w[300]; - -static UINT8 soundlatch; -static INT32 question_address, question_rom, remap_address[16]; -static INT32 joinem_snd_bit; - -static INT32 nCyclesSegment; -static INT32 nCyclesDone[2], nCyclesTotal[2]; - -static struct BurnInputInfo JackInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"p1 Up" , BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down", }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p1 left" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 0, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 1, "p1 fire 2"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy1 + 5, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"p2 Up" , BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down", }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 6, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 7, "p2 left" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy4 + 0, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy4 + 1, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Jack) - -static struct BurnInputInfo ZzyzzyxxInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 5, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 0, "p1 fire 1"}, - - {"P2 start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 4, "p2 Up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy4 + 0, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Zzyzzyxx) - -static struct BurnInputInfo FreezeInputList[] = { - {"Coin" , BIT_DIGITAL , DrvJoy1 + 5, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 0, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 1, "p1 left" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 1, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 0, "p1 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Freeze) - -static struct BurnInputInfo SucasinoInputList[] = { - {"Coin" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - - {"P1 start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p1 left" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 0, "p1 fire 1"}, - - {"P2 start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 6, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 7, "p2 left" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy4 + 0, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Sucasino) - -static struct BurnInputInfo TripoolInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down", }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p1 left" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 0, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 1, "p1 fire 2"}, - {"Select Game 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 3"}, - {"Select Game 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 4"}, - {"Select Game 3", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 5"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy1 + 5, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down", }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 6, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 7, "p2 left" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy4 + 0, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy4 + 1, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, -}; - -STDINPUTINFO(Tripool) - -static struct BurnInputInfo JoinemInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy3 + 0, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down", }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 2, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 3, "p1 left" }, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy3 + 1, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up", }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down", }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p2 left" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Joinem) - -static struct BurnInputInfo UnclepooInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy3 + 0, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down", }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 2, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 3, "p1 left" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy3 + 1, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up", }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down", }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p2 left" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Unclepoo) - -static struct BurnInputInfo LoverboyInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy3 + 0, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down", }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 2, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 3, "p1 left" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy3 + 1, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up", }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down", }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p2 left" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Loverboy) - -static struct BurnInputInfo StrivInputList[] = { - {"Coin" , BIT_DIGITAL , DrvJoy3 + 1, "p1 coin" }, - - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 1, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 2, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy1 + 3, "p1 fire 3"}, - {"P1 Button 4" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 4"}, - - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 1, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 2, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy2 + 3, "p2 fire 3"}, - {"P2 Button 4" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Striv) - -static struct BurnDIPInfo JackDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL}, - {0x12, 0xff, 0xff, 0x00, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 4 , "Coin B"}, - {0x11, 0x01, 0x03, 0x01, "2 coins 1 credit"}, - {0x11, 0x01, 0x03, 0x03, "4 coins 3 credits"}, - {0x11, 0x01, 0x03, 0x00, "1 coin 1 credit"}, - {0x11, 0x01, 0x03, 0x02, "1 coin 3 credits"}, - - {0 , 0xfe, 0 , 4 , "Coin A"}, - {0x11, 0x01, 0x0c, 0x00, "3 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x04, "2 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x08, "4 coins 3 credits"}, - {0x11, 0x01, 0x0c, 0x0c, "1 coin 1 credits"}, - - {0 , 0xfe, 0 , 2 , "Lives"}, - {0x11, 0x01, 0x10, 0x00, "3"}, - {0x11, 0x01, 0x10, 0x10, "5"}, - - {0 , 0xfe, 0 , 2 , "Bonus Life"}, - {0x11, 0x01, 0x20, 0x00, "Every 10000"}, - {0x11, 0x01, 0x20, 0x20, "10000 ONly"}, - - {0 , 0xfe, 0 , 2 , "Difficulty"}, - {0x11, 0x01, 0x40, 0x00, "Start on Level 1"}, - {0x11, 0x01, 0x40, 0x40, "Start on Level 13"}, - - {0 , 0xfe, 0 , 2 , "Bullets per Bean Collected"}, - {0x11, 0x01, 0x80, 0x00, "1"}, - {0x11, 0x01, 0x80, 0x80, "2"}, - - // DSW2 - {0 , 0xfe, 0 , 2 , "Cabinet"}, - {0x12, 0x01, 0x01, 0x01, "Upright"}, - {0x12, 0x01, 0x01, 0x00, "Cocktail"}, - - {0 , 0xfe, 0 , 2 , "Invulnerability (Cheat)"}, - {0x12, 0x01, 0x40, 0x00, "Off"}, - {0x12, 0x01, 0x40, 0x40, "On"}, - - {0 , 0xfe, 0 , 2 , "255 Lives (Cheat)"}, - {0x12, 0x01, 0x80, 0x00, "Off"}, - {0x12, 0x01, 0x80, 0x80, "On"}, -}; - -STDDIPINFO(Jack) - - -static struct BurnDIPInfo Jack2DIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL}, - {0x12, 0xff, 0xff, 0x00, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 4 , "Coin B"}, - {0x11, 0x01, 0x03, 0x03, "4 coins 3 credits"}, - {0x11, 0x01, 0x03, 0x00, "1 coin 1 credit"}, - {0x11, 0x01, 0x03, 0x01, "1 coin 2 credits"}, - {0x11, 0x01, 0x03, 0x02, "1 coin 3 credits"}, - - {0 , 0xfe, 0 , 4 , "Coin A"}, - {0x11, 0x01, 0x0c, 0x08, "3 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x04, "2 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x0c, "4 coins 3 credits"}, - {0x11, 0x01, 0x0c, 0x00, "1 coin 1 credits"}, - - {0 , 0xfe, 0 , 2 , "Lives"}, - {0x11, 0x01, 0x10, 0x00, "3"}, - {0x11, 0x01, 0x10, 0x10, "5"}, - - {0 , 0xfe, 0 , 2 , "Bonus Life"}, - {0x11, 0x01, 0x20, 0x00, "Every 10000"}, - {0x11, 0x01, 0x20, 0x20, "10000 ONly"}, - - {0 , 0xfe, 0 , 2 , "Difficulty"}, - {0x11, 0x01, 0x40, 0x00, "Start on Level 1"}, - {0x11, 0x01, 0x40, 0x40, "Start on Level 13"}, - - {0 , 0xfe, 0 , 2 , "Bullets per Bean Collected"}, - {0x11, 0x01, 0x80, 0x00, "1"}, - {0x11, 0x01, 0x80, 0x80, "2"}, - - // DSW2 - {0 , 0xfe, 0 , 2 , "Cabinet"}, - {0x12, 0x01, 0x01, 0x01, "Upright"}, - {0x12, 0x01, 0x01, 0x00, "Cocktail"}, - - {0 , 0xfe, 0 , 2 , "Invulnerability (Cheat)"}, - {0x12, 0x01, 0x40, 0x00, "Off"}, - {0x12, 0x01, 0x40, 0x40, "On"}, - - {0 , 0xfe, 0 , 2 , "255 Lives (Cheat)"}, - {0x12, 0x01, 0x80, 0x00, "Off"}, - {0x12, 0x01, 0x80, 0x80, "On"}, -}; - -STDDIPINFO(Jack2) - -static struct BurnDIPInfo Jack3DIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL}, - {0x12, 0xff, 0xff, 0x00, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 4 , "Coin B"}, - {0x11, 0x01, 0x03, 0x00, "1 coin 1 credit"}, - {0x11, 0x01, 0x03, 0x01, "1 coin 2 credits"}, - {0x11, 0x01, 0x03, 0x02, "1 coin 3 credits"}, - {0x11, 0x01, 0x03, 0x03, "1 coin 5 credits"}, - - {0 , 0xfe, 0 , 4 , "Coin A"}, - {0x11, 0x01, 0x0c, 0x0c, "4 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x08, "3 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x04, "2 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x00, "1 coin 1 credit"}, - - {0 , 0xfe, 0 , 2 , "Lives"}, - {0x11, 0x01, 0x10, 0x00, "3"}, - {0x11, 0x01, 0x10, 0x10, "5"}, - - {0 , 0xfe, 0 , 2 , "Bonus Life"}, - {0x11, 0x01, 0x20, 0x00, "Every 10000"}, - {0x11, 0x01, 0x20, 0x20, "10000 ONly"}, - - {0 , 0xfe, 0 , 2 , "Difficulty"}, - {0x11, 0x01, 0x40, 0x00, "Start on Level 1"}, - {0x11, 0x01, 0x40, 0x40, "Start on Level 13"}, - - {0 , 0xfe, 0 , 2 , "Bullets per Bean Collected"}, - {0x11, 0x01, 0x80, 0x00, "1"}, - {0x11, 0x01, 0x80, 0x80, "2"}, - - // DSW2 - {0 , 0xfe, 0 , 2 , "Cabinet"}, - {0x12, 0x01, 0x01, 0x01, "Upright"}, - {0x12, 0x01, 0x01, 0x00, "Cocktail"}, - - {0 , 0xfe, 0 , 2 , "Invulnerability (Cheat)"}, - {0x12, 0x01, 0x40, 0x00, "Off"}, - {0x12, 0x01, 0x40, 0x40, "On"}, - - {0 , 0xfe, 0 , 2 , "255 Lives (Cheat)"}, - {0x12, 0x01, 0x80, 0x00, "Off"}, - {0x12, 0x01, 0x80, 0x80, "On"}, -}; - -STDDIPINFO(Jack3) - -static struct BurnDIPInfo TreahuntDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL}, - {0x12, 0xff, 0xff, 0x00, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 4 , "Coin B"}, - {0x11, 0x01, 0x03, 0x01, "2 coins 1 credit"}, - {0x11, 0x01, 0x03, 0x03, "4 coins 3 credits"}, - {0x11, 0x01, 0x03, 0x00, "1 coin 1 credit"}, - {0x11, 0x01, 0x03, 0x02, "1 coin 3 credits"}, - - {0 , 0xfe, 0 , 4 , "Coin A"}, - {0x11, 0x01, 0x0c, 0x08, "3 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x04, "2 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x0c, "4 coins 3 credits"}, - {0x11, 0x01, 0x0c, 0x00, "1 coin 1 credit"}, - - {0 , 0xfe, 0 , 2 , "Lives"}, - {0x11, 0x01, 0x10, 0x00, "3"}, - {0x11, 0x01, 0x10, 0x10, "5"}, - - {0 , 0xfe, 0 , 2 , "Bonus Life"}, - {0x11, 0x01, 0x20, 0x00, "Every 10000"}, - {0x11, 0x01, 0x20, 0x20, "10000 ONly"}, - - {0 , 0xfe, 0 , 2 , "Difficulty"}, - {0x11, 0x01, 0x40, 0x00, "Start on Level 1"}, - {0x11, 0x01, 0x40, 0x40, "Start on Level 6"}, - - {0 , 0xfe, 0 , 2 , "Bullets per Bean Collected"}, - {0x11, 0x01, 0x80, 0x00, "5"}, - {0x11, 0x01, 0x80, 0x80, "20"}, - - // DSW2 - {0 , 0xfe, 0 , 2 , "Cabinet"}, - {0x12, 0x01, 0x01, 0x01, "Upright"}, - {0x12, 0x01, 0x01, 0x00, "Cocktail"}, - - {0 , 0xfe, 0 , 2 , "Invulnerability (Cheat)"}, - {0x12, 0x01, 0x40, 0x00, "Off"}, - {0x12, 0x01, 0x40, 0x40, "On"}, - - {0 , 0xfe, 0 , 2 , "255 Lives (Cheat)"}, - {0x12, 0x01, 0x80, 0x00, "Off"}, - {0x12, 0x01, 0x80, 0x80, "On"}, -}; - -STDDIPINFO(Treahunt) - - -static struct BurnDIPInfo ZzyzzyxxDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x20, NULL }, - {0x0b, 0xff, 0xff, 0x44, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0a, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x03, 0x03, "4 Coins 3 Credits" }, - {0x0a, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0a, 0x01, 0x04, 0x04, "2" }, - {0x0a, 0x01, 0x04, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "2 Credits on Reset" }, - {0x0a, 0x01, 0x08, 0x00, "Off" }, - {0x0a, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0a, 0x01, 0x10, 0x10, "Off" }, - {0x0a, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0a, 0x01, 0x20, 0x20, "Upright" }, - {0x0a, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0a, 0x01, 0x80, 0x00, "Off" }, - {0x0a, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0b, 0x01, 0x03, 0x02, "None" }, - {0x0b, 0x01, 0x03, 0x00, "10000 50000" }, - {0x0b, 0x01, 0x03, 0x01, "25000 100000" }, - {0x0b, 0x01, 0x03, 0x03, "100000 300000" }, - - {0 , 0xfe, 0 , 2, "2nd Bonus Given" }, - {0x0b, 0x01, 0x04, 0x00, "No" }, - {0x0b, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 2, "Starting Laps" }, - {0x0b, 0x01, 0x08, 0x00, "2" }, - {0x0b, 0x01, 0x08, 0x08, "3" }, - - {0 , 0xfe, 0 , 2, "Difficulty of Pleasing Lola" }, - {0x0b, 0x01, 0x10, 0x00, "Easy" }, - {0x0b, 0x01, 0x10, 0x10, "Hard" }, - - {0 , 0xfe, 0 , 2, "Show Intermissions" }, - {0x0b, 0x01, 0x20, 0x00, "No" }, - {0x0b, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 3, "Extra Lives" }, - {0x0b, 0x01, 0xc0, 0x00, "3 under 4000 pts" }, - {0x0b, 0x01, 0xc0, 0x80, "5 under 4000 pts" }, - {0x0b, 0x01, 0xc0, 0x40, "None" }, -}; - -STDDIPINFO(Zzyzzyxx) - -static struct BurnDIPInfo FreezeDIPList[]= -{ - // Default Values - {0x08, 0xff, 0xff, 0x00, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 2 , "Flip Screen"}, - {0x08, 0x01, 0x01, 0x00, "Off"}, - {0x08, 0x01, 0x01, 0x01, "On"}, - - {0 , 0xfe, 0 , 2 , "Difficulty"}, - {0x08, 0x01, 0x04, 0x00, "Easy"}, - {0x08, 0x01, 0x04, 0x04, "Hard"}, - - {0 , 0xfe, 0 , 2 , "Lives"}, - {0x08, 0x01, 0x08, 0x00, "3"}, - {0x08, 0x01, 0x08, 0x08, "5"}, - - {0 , 0xfe, 0 , 4 , "Bonus Life"}, - {0x08, 0x01, 0x30, 0x00, "10000"}, - {0x08, 0x01, 0x30, 0x10, "10000 40000"}, - {0x08, 0x01, 0x30, 0x20, "10000 60000"}, - {0x08, 0x01, 0x30, 0x30, "20000 100000"}, - - {0 , 0xfe, 0 , 4 , "Coinage"}, - {0x08, 0x01, 0xc0, 0x80, "2 Coins 1 Credit"}, - {0x08, 0x01, 0xc0, 0x00, "1 Coin 1 Credit"}, - {0x08, 0x01, 0xc0, 0x40, "1 Coin 2 Credits"}, - {0x08, 0x01, 0xc0, 0xc0, "Free Play"}, -}; - -STDDIPINFO(Freeze) - -static struct BurnDIPInfo SucasinoDIPList[]= -{ - // Default Values - {0x0A, 0xff, 0xff, 0x00, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 4 , "Coinage"}, - {0x0A, 0x01, 0x03, 0x00, "1 Coin 1 Credit"}, - {0x0A, 0x01, 0x03, 0x01, "1 Coin 2 Credits"}, - {0x0A, 0x01, 0x03, 0x02, "1 Coin 3 Credits"}, - {0x0A, 0x01, 0x03, 0x03, "1 Coin 4 Credits"}, - - {0 , 0xfe, 0 , 2 , "Cabinet"}, - {0x0A, 0x01, 0x04, 0x00, "Upright"}, - {0x0A, 0x01, 0x04, 0x04, "Cocktail"}, - - {0 , 0xfe, 0 , 2 , "Flip Screen"}, - {0x0A, 0x01, 0x08, 0x00, "Off"}, - {0x0A, 0x01, 0x08, 0x08, "On"}, -}; - -STDDIPINFO(Sucasino) - -static struct BurnDIPInfo JoinemDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x00, NULL}, - {0x0e, 0xff, 0xff, 0x00, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 4 , "Coin A"}, - {0x0d, 0x01, 0x03, 0x01, "2 coins 1 credit"}, - {0x0d, 0x01, 0x03, 0x03, "4 coins 3 credits"}, - {0x0d, 0x01, 0x03, 0x00, "1 coin 1 credit"}, - {0x0d, 0x01, 0x03, 0x02, "1 coin 3 credits"}, - - {0 , 0xfe, 0 , 4 , "Coin B"}, - {0x0d, 0x01, 0x0c, 0x08, "3 coins 1 credit"}, - {0x0d, 0x01, 0x0c, 0x04, "2 coins 1 credit"}, - {0x0d, 0x01, 0x0c, 0x0c, "4 coins 3 credits"}, - {0x0d, 0x01, 0x0c, 0x00, "1 coin 1 credit"}, - - {0 , 0xfe, 0 , 2 , "Lives"}, - {0x0d, 0x01, 0x10, 0x00, "2"}, - {0x0d, 0x01, 0x10, 0x10, "5"}, - - // DSW2 - {0 , 0xfe, 0 , 2 , "Cabinet"}, - {0x0e, 0x01, 0x01, 0x01, "Upright"}, - {0x0e, 0x01, 0x01, 0x00, "Cocktail"}, - - {0 , 0xfe, 0 , 2 , "Sound Check"}, - {0x0e, 0x01, 0x20, 0x00, "Off"}, - {0x0e, 0x01, 0x20, 0x20, "On"}, - - {0 , 0xfe, 0 , 2 , "Infinite Lives"}, - {0x0e, 0x01, 0x80, 0x00, "2"}, - {0x0e, 0x01, 0x80, 0x80, "3"}, -}; - -STDDIPINFO(Joinem) - -static struct BurnDIPInfo UnclepooDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL}, - {0x12, 0xff, 0xff, 0x01, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 4 , "Coin A"}, - {0x11, 0x01, 0x03, 0x01, "2 coins 1 credit"}, - {0x11, 0x01, 0x03, 0x03, "4 coins 3 credits"}, - {0x11, 0x01, 0x03, 0x00, "1 coin 1 credit"}, - {0x11, 0x01, 0x03, 0x02, "1 coin 3 credits"}, - - {0 , 0xfe, 0 , 4 , "Coin B"}, - {0x11, 0x01, 0x0c, 0x08, "3 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x04, "2 coins 1 credit"}, - {0x11, 0x01, 0x0c, 0x0c, "4 coins 3 credits"}, - {0x11, 0x01, 0x0c, 0x00, "1 coin 1 credit"}, - - {0 , 0xfe, 0 , 2 , "Lives"}, - {0x11, 0x01, 0x10, 0x00, "2"}, - {0x11, 0x01, 0x10, 0x10, "5"}, - - // DSW2 - {0 , 0xfe, 0 , 2 , "Cabinet"}, - {0x12, 0x01, 0x01, 0x01, "Upright"}, - {0x12, 0x01, 0x01, 0x00, "Cocktail"}, - - {0 , 0xfe, 0 , 2 , "Sound Check"}, - {0x12, 0x01, 0x20, 0x00, "Off"}, - {0x12, 0x01, 0x20, 0x20, "On"}, - - {0 , 0xfe, 0 , 2 , "Infinite Lives"}, - {0x12, 0x01, 0x80, 0x00, "2"}, - {0x12, 0x01, 0x80, 0x80, "3"}, -}; - -STDDIPINFO(Unclepoo) - -static struct BurnDIPInfo LoverboyDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x00, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 15 , "Coin A"}, - {0x0f, 0x01, 0x0f, 0x0c, "4 Coins 1 Credit"}, - {0x0f, 0x01, 0x0f, 0x08, "3 Coins 1 Credit"}, - {0x0f, 0x01, 0x0f, 0x0d, "4 Coins 2 Credit"}, - {0x0f, 0x01, 0x0f, 0x04, "2 Coins 1 Credit"}, - {0x0f, 0x01, 0x0f, 0x09, "3 Coins 2 Credit"}, - {0x0f, 0x01, 0x0f, 0x0e, "4 Coins 3 Credit"}, - {0x0f, 0x01, 0x0f, 0x0f, "4 Coins 4 Credit"}, - {0x0f, 0x01, 0x0f, 0x0a, "3 Coins 3 Credit"}, - {0x0f, 0x01, 0x0f, 0x05, "2 Coins 2 Credit"}, - {0x0f, 0x01, 0x0f, 0x00, "1 Coins 1 Credit"}, - {0x0f, 0x01, 0x0f, 0x0b, "3 Coins 4 Credit"}, - {0x0f, 0x01, 0x0f, 0x06, "2 Coins 3 Credit"}, - {0x0f, 0x01, 0x0f, 0x07, "2 Coins 4 Credit"}, - {0x0f, 0x01, 0x0f, 0x01, "1 Coins 2 Credit"}, - {0x0f, 0x01, 0x0f, 0x02, "1 Coins 3 Credit"}, - {0x0f, 0x01, 0x0f, 0x03, "1 Coins 4 Credit"}, - - {0 , 0xfe, 0 , 2 , "Bonus"}, - {0x0f, 0x01, 0x20, 0x00, "20,000"}, - {0x0f, 0x01, 0x20, 0x20, "30,000"}, - - {0 , 0xfe, 0 , 2 , "Lives"}, - {0x0f, 0x01, 0x40, 0x00, "3"}, - {0x0f, 0x01, 0x40, 0x40, "5"}, - - {0 , 0xfe, 0 , 2 , "Cabinet"}, - {0x0f, 0x01, 0x80, 0x80, "Upright"}, - {0x0f, 0x01, 0x80, 0x00, "Cocktail"}, -}; - -STDDIPINFO(Loverboy) - -static struct BurnDIPInfo StrivDIPList[]= -{ - // Default Values - {0x0A, 0xff, 0xff, 0xfd, NULL}, - - // DSW1 - {0 , 0xfe, 0 , 2 , "Monitor"}, - {0x0A, 0x01, 0x02, 0x02, "Horizontal"}, - {0x0A, 0x01, 0x02, 0x00, "Vertical"}, - - {0 , 0xfe, 0 , 8 , "Gaming Option Number"}, - {0x0A, 0x01, 0x05, 0x01, "2"}, - {0x0A, 0x01, 0x05, 0x05, "3"}, - {0x0A, 0x01, 0x05, 0x00, "4"}, - {0x0A, 0x01, 0x05, 0x04, "5"}, - {0x0A, 0x01, 0x05, 0x01, "4"}, - {0x0A, 0x01, 0x05, 0x05, "5"}, - {0x0A, 0x01, 0x05, 0x00, "6"}, - {0x0A, 0x01, 0x05, 0x04, "7"}, - - {0 , 0xfe, 0 , 2 , "Cabinet"}, - {0x0A, 0x01, 0x08, 0x08, "Upright"}, - {0x0A, 0x01, 0x08, 0x00, "Cocktail"}, - - {0 , 0xfe, 0 , 2 , "Coinage"}, - {0x0A, 0x01, 0x10, 0x00, "2 Coins 1 Credit"}, - {0x0A, 0x01, 0x10, 0x10, "1 Coin 1 Credit"}, - - {0 , 0xfe, 0 , 2 , "Gaming Options"}, - {0x0A, 0x01, 0x20, 0x20, "Number of Wrong Answer"}, - {0x0A, 0x01, 0x20, 0x00, "Number of Questions"}, - - {0 , 0xfe, 0 , 2 , "Show Correct Answer"}, - {0x0A, 0x01, 0x40, 0x00, "No"}, - {0x0A, 0x01, 0x40, 0x40, "Yes"}, -}; - -STDDIPINFO(Striv) - -static UINT8 timer_r(UINT32) -{ - return ZetTotalCycles() / timer_rate; -} - -static UINT8 soundlatch_r(UINT32) -{ - return soundlatch; -} - -static UINT8 __fastcall striv_question_r(UINT16 offset) -{ - if((offset & 0xc00) == 0x800) - { - remap_address[offset & 0x0f] = (offset & 0xf0) >> 4; - } - else if((offset & 0xc00) == 0xc00) - { - question_rom = offset & 7; - question_address = (offset & 0xf8) << 7; - } - else - { - UINT8 *ROM = User; - INT32 real_address; - - real_address = question_address | (offset & 0x3f0) | remap_address[offset & 0x0f]; - - if(offset & 0x400) - real_address |= 0x8000 * (question_rom + 8); - else - real_address |= 0x8000 * question_rom; - - return ROM[real_address]; - } - - return 0; -} - -void jack_paletteram_w(UINT16 offset, UINT8 data) -{ - UINT32 *pl = Palette + (offset & 0x1f); - - Rom0[offset] = data; - - DrvCalcPal = 1; - - data ^= 0xff; - - *pl = ((data & 7) << 21) | ((data & 7) << 18) | ((data & 6) << 15); - - data >>= 3; - - *pl |= ((data & 7) << 13) | ((data & 7) << 10) | ((data & 6) << 7); - - data >>= 3; - - *pl |= ((data & 3) << 6) | ((data & 3) << 4) | ((data & 3) << 2) | (data & 3); -} - -UINT8 __fastcall jack_cpu0_read(UINT16 address) -{ - UINT8 ret = 0; - - if (address >= 0xb000 && address <= 0xb07f) - { - return Rom0[address]; - } - - switch (address) - { - case 0xb500: - return DrvDips[0]; - - case 0xb501: - { - ret = DrvDips[1]; - if (joinem && DrvJoy2[7] && !joinem_snd_bit) ret |= 0x20; - - return ret; - } - - case 0xb502: - { - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy1[i] << i; - - return ret; - } - - case 0xb503: - { - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy2[i] << i; - - return ret; - } - - case 0xb504: - { - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy3[i] << i; - if (joinem || loverb) ret |= 0x40; // boot-freeze disable. - - return ret; - } - - case 0xb505: - { - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy4[i] << i; - - return ret; - } - - case 0xb506: - case 0xb507: - flip_screen = (address & 1) ^ suprtriv; - return 0; - } - - if (suprtriv && address >= 0xc000 && address <= 0xcfff) { - return striv_question_r(address & 0x0fff); - } - - return 0; -} - -void __fastcall jack_cpu0_write(UINT16 address, UINT8 data) -{ - if (address >= 0xb600 && address <= 0xb61f) - { - jack_paletteram_w(address, data); - return; - } - - if (address >= 0xb000 && address <= 0xb07f) - { - Rom0[address] = data; - return; - } - - if (address >= 0xb080 && address <= 0xb0ff) - { - joinem_scroll_w[(address - 0xb080) >> 2] = data; - return; - } - - switch (address) - { - case 0xb400: - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(0); - break; - - case 0xb506: - flip_screen = 1; - break; - - case 0xb700: - flip_screen = data >> 7; - joinem_snd_bit = data & 1; - joinem_palette_bank = (data & 0x18) << 1; - joinem_nmi_enable = data & 0x20; - - //from MAME: palette_bank = data & (m_palette->entries() - 1) >> 3 & 0x18; - //Why do we do it differently? :/ - dink - //bprintf(0, _T("pbank[%X] data[%X],"), joinem_palette_bank, data); - break; - } -} - -UINT8 __fastcall jack_in_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x40: - return AY8910Read(0); - } - - return 0; -} - -void __fastcall jack_out_port(UINT16 address, UINT8 data) -{ - switch (address & 0xff) - { - case 0x40: - AY8910Write(0, 1, data); - return; - - case 0x80: - AY8910Write(0, 0, data); - return; - } -} - -void __fastcall jack_cpu1_write() -{ -} - - -static INT32 DrvDoReset() -{ - flip_screen = 0; - DrvReset = 0; - soundlatch = 0; - - if (loverb || joinem) { - memset (Rom0 + 0x8000, 0, 0x1000); - memset (Rom0 + 0x9000, 0, 0x07ff); - } else { - memset ((UINT8*)Palette, 0, 0x400); - memset (Rom0 + 0x4000, 0, 0x1000); - } - - memset (Rom0 + 0xb000, 0, 0x1000); - if (!unclepoo) - memset (Rom1 + 0x4000, 0, 0x0400); - memset ((UINT8*)remap_address, 0, 0x40); - - question_address = question_rom = 0; - joinem_snd_bit = 0; - joinem_nmi_enable = 0; - joinem_palette_bank = 0; - memset(&joinem_scroll_w, 0, sizeof(joinem_scroll_w)); - soundlatch = 0; - - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - AY8910Reset(0); - - HiscoreReset(); - - return 0; -} - -static INT32 GetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *Load0 = Rom0; - UINT8 *Load1 = Rom1; - UINT8 *Loadg = Gfx; - UINT8 *Loadt = User; - INT32 gCount = 0; - - if (!joinem && !loverb) Loadg += 0x2000; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (ri.nLen == 0x2000) - { - if (BurnLoadRom(Load0, i, 1)) return 1; - Load0 += ri.nLen; - } - else - { - if (BurnLoadRom(Load0, i, 1)) return 1; - Load0 += ri.nLen; - - if (tri_fix && i == 0) { - Load0 += 0x1000; - } - - if (i == (3 - tri_fix)) Load0 += 0x8000; - } - - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(Load1, i, 1)) return 1; - Load1 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(Loadg, i, 1)) return 1; - Loadg += ri.nLen; - if (joinem && !unclepoo) Loadg += 0x1000; - gCount++; - - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(Prom + 0x000, i + 0, 1)) return 1; - if (BurnLoadRom(Prom + 0x200, i + 1, 1)) return 1; - i++; - - // Roms are nibbles, (1/2 byte), #0 is low, #1 is high - for (INT32 j = 0; j < 0x200; j++) { - Prom[j] = Prom[j] | (Prom[j + 0x200] << 4); - } - - continue; - } - - if ((ri.nType & 7) == 5) { - if (BurnLoadRom(Loadt, i, 1)) return 1; - Loadt += ri.nLen; - - continue; - } - } - - // sucasino, tripool, tripoola - if (gCount == 2) { - memcpy (Gfx + 0x4000, Gfx + 0x3000, 0x1000); - memset (Gfx + 0x3000, 0, 0x1000); - } - - return 0; -} - -static void gfx_decode() -{ - UINT8* tmp = (UINT8*)BurnMalloc( 0x2000 * 3 ); - if (!tmp) return; - - memcpy (tmp, Gfx, 0x6000); - - static INT32 Planes[3] = { 0, 1024*8*8, 1024*8*8*2 }; - static INT32 YOffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - static INT32 XOffs[8] = { 56, 48, 40, 32, 24, 16, 8, 0 }; - - GfxDecode(1024, 3, 8, 8, Planes, XOffs, YOffs, 64, tmp, Gfx); - - BurnFree (tmp); -} - -static INT32 DrvInit() -{ - Mem = (UINT8 *)BurnMalloc (0x100000); - if (Mem == NULL) { - return 1; - } - - pFMBuffer = (INT16 *)BurnMalloc (nBurnSoundLen * 3 * sizeof(INT16)); - if (pFMBuffer == NULL) { - return 1; - } - - Rom0 = Mem + 0x00000; - Rom1 = Mem + 0x10000; - Gfx = Mem + 0x20000; - User = Mem + 0x30000; - Prom = Mem + 0xb0000; - Palette = (UINT32*)(Mem + 0xc0000); - DrvPal = (UINT32*)(Mem + 0xc1000); - - GetRoms(); - - gfx_decode(); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(jack_cpu0_read); - ZetSetWriteHandler(jack_cpu0_write); - - if (joinem || loverb) - { - ZetMapMemory(Rom0 + 0x0000, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(Rom0 + 0x8000, 0x8000, 0x8fff, MAP_RAM); - ZetMapMemory(Rom0 + 0x9000, 0x9000, 0x97ff, MAP_RAM); - - if (!unclepoo) - ZetMapArea(0xb500, 0xb5ff, 0, Rom0 + 0xb500); // controls hack - } else { - ZetMapMemory(Rom0 + 0x0000, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(Rom0 + 0x4000, 0x4000, 0x5fff, MAP_RAM); - } - - //ZetMapArea(0xb000, 0xb07f, 0, Rom0 + 0xb000); // move to cpu0_read/write - //ZetMapArea(0xb000, 0xb07f, 1, Rom0 + 0xb000); - - ZetMapMemory(Rom0 + 0xb800, 0xb800, 0xbbff, MAP_RAM); // vidram - ZetMapMemory(Rom0 + 0xbc00, 0xbc00, 0xbfff, MAP_RAM); // colram - - if (suprtriv) - { - ZetMapMemory(Rom0 + 0xc000, 0xd000, 0xffff, MAP_RAM); // + 0xc000, really? - } else if (!unclepoo) { - ZetMapMemory(Rom0 + 0xc000, 0xc000, 0xffff, MAP_ROM); - } - - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetInHandler(jack_in_port); - ZetSetOutHandler(jack_out_port); - ZetMapArea(0x0000, 0x1fff, 0, Rom1 + 0x0000); - ZetMapArea(0x0000, 0x1fff, 2, Rom1 + 0x0000); - ZetMapArea(0x4000, 0x43ff, 0, Rom1 + 0x4000); - ZetMapArea(0x4000, 0x43ff, 1, Rom1 + 0x4000); - ZetMapArea(0x4000, 0x43ff, 2, Rom1 + 0x4000); - ZetClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - - AY8910Init(0, 1500000, nBurnSoundRate, &soundlatch_r, &timer_r, NULL, NULL); - AY8910SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - if (loverb || joinem || zzyzzyxx || freeze) { - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - } - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - AY8910Exit(0); - GenericTilesExit(); - - BurnFree (pFMBuffer); - BurnFree (Mem); - - DrvPal = Palette = NULL; - pFMBuffer = NULL; - Mem = Rom0 = Rom1 = Gfx = User = NULL; - pAY8910Buffer[0] = pAY8910Buffer[1] = pAY8910Buffer[2] = NULL; - - tri_fix = 0; - joinem = 0; - loverb = 0; - suprtriv = 0; - unclepoo = 0; - zzyzzyxx = 0; - freeze = 0; - - memset(joinem_scroll_w, 0, sizeof(joinem_scroll_w)); - - return 0; -} - - -static INT32 DrvDraw() -{ - if (DrvCalcPal) - { - for (INT32 i = 0; i < 0x100; i++) { - UINT32 col = Palette[i]; - DrvPal[i] = BurnHighCol((col >> 16) & 0xff, (col >> 8) & 0xff, col & 0xff, 0); - } - DrvCalcPal = 0; - } - - UINT8 *sram = Rom0 + 0xb000; // sprite ram - UINT8 *vram = Rom0 + 0xb800; // video ram - UINT8 *cram = Rom0 + 0xbc00; // color ram - INT32 offs, sx, sy, num, color, flipx, flipy; // Tiles - - for (offs = 0; offs < 0x400; offs++) - { - sx = (offs & 0x1f) << 3; - sy = (offs >> 2) & 0xf8; - sx -= joinem_scroll_w[sy >> 3]; - if (sx < -15) sx += 256; - if (sy < -15) sy += 256; - - if (joinem || loverb) { - num = vram[offs] + ((cram[offs] & 0x03) << 8); - color = (cram[offs] & 0x38) >> 2 | joinem_palette_bank; - } else { - num = vram[offs] + ((cram[offs] & 0x18) << 5); - color = (cram[offs] & 0x07); - } - - if (flip_screen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, num, sx ^ 0xf8, sy ^ 0xf8, color, 2, 0, Gfx); - } else { - sx -= 16; - Render8x8Tile_Clip(pTransDraw, num, sx, sy, color, 2, 0, Gfx); - } - } - - for (offs = 0; offs < 0x80; offs += 4) // Sprites - { - sx = 248 - sram[offs]; - if (sx < -15) sx += 256; - if (sy < -15) sy += 256; - sy = sram[offs + 1]; - - if (joinem || loverb) { - num = sram[offs + 2] + ((sram[offs + 3] & 0x03) << 8); - color = (sram[offs + 3] & 0x38) >> 2 | joinem_palette_bank; - } else { - num = sram[offs + 2] + ((sram[offs + 3] & 0x08) << 5); - color = (sram[offs + 3] & 0x07); - } - - flipx = sram[offs + 3] & 0x40; - flipy = sram[offs + 3] & 0x80; - - if (flip_screen) { - flipx = !flipx; - flipy = !flipy; - sx = 248 - sx; - sy = 248 - sy; - } - - sx -= 16; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, num, sx, sy, color, 2, 0, 0, Gfx); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, num, sx, sy, color, 2, 0, 0, Gfx); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, num, sx, sy, color, 2, 0, 0, Gfx); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, num, sx, sy, color, 2, 0, 0, Gfx); - } - } - } - - BurnTransferCopy(DrvPal); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - if ((joinem || loverb) && !unclepoo) { // this causes Unclepoo to not boot - for (INT32 i = 0; i < 6; i++) - Rom0[0xb500 + i] = jack_cpu0_read(0xb500 + i); - } - - INT32 nInterleave = 1000; - INT32 nSoundBufferPos = 0; - - nCyclesTotal[0] = 3000000 / 60; - nCyclesTotal[1] = 3000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #0 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - - if (joinem && (i % 249) == 0) - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); // game speed (joinem, uncle poo) - - if (i == (nInterleave - 1)) { // vblank - if ((joinem && joinem_nmi_enable) || (loverb)) { // joinem, uncle poo, loverboy - ZetNmi(); - } else { // other - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - } - - ZetClose(); - - // Run Z80 #1 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut && (i%8) == 7 && !suprtriv) { // disable sound for suprtriv - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut && !suprtriv) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -//------------------------------------------------------------------------------------- -// Save states - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - if (joinem || loverb) { - ba.Data = Rom0 + 0x8000; - ba.nLen = 0xbfff - 0x8000; - } else { - ba.Data = Rom0 + 0x4000; - ba.nLen = 0xbfff - 0x4000; - } - ba.szName = "Main Ram"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = Rom1 + 0x4000; - ba.nLen = 0x003ff; - ba.szName = "Soundcpu Ram"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = (UINT8*)Palette; - ba.nLen = 0x00400; - ba.szName = "Palette"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = (UINT8*)remap_address; - ba.nLen = 0x00040; - ba.szName = "striv question addresses"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(question_address); - SCAN_VAR(question_rom); - SCAN_VAR(soundlatch); - SCAN_VAR(joinem_snd_bit); - SCAN_VAR(joinem_palette_bank); - SCAN_VAR(joinem_nmi_enable); - SCAN_VAR(joinem_scroll_w); - } - - return 0; -} - - -// Jack the Giantkiller (set 1) - -static struct BurnRomInfo jackRomDesc[] = { - { "j8", 0x1000, 0xc8e73998, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "jgk.j6", 0x1000, 0x36d7810e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jgk.j7", 0x1000, 0xb15ff3ee, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jgk.j5", 0x1000, 0x4a63d242, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jgk.j3", 0x1000, 0x605514a8, 1 | BRF_PRG | BRF_ESS }, // 4 - { "jgk.j4", 0x1000, 0xbce489b7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "jgk.j2", 0x1000, 0xdb21bd55, 1 | BRF_PRG | BRF_ESS }, // 6 - { "jgk.j1", 0x1000, 0x49fffe31, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "jgk.j9", 0x1000, 0xc2dc1e00, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - - { "jgk.j12", 0x1000, 0xce726df0, 3 | BRF_GRA }, // 9 Graphics - { "jgk.j13", 0x1000, 0x6aec2c8d, 3 | BRF_GRA }, // 10 - { "jgk.j11", 0x1000, 0xfd14c525, 3 | BRF_GRA }, // 11 - { "jgk.j10", 0x1000, 0xeab890b2, 3 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(jack) -STD_ROM_FN(jack) - -static INT32 jackInit() -{ - timer_rate = 256; - - return DrvInit(); -} - -struct BurnDriver BurnDrvjack = { - "jack", NULL, NULL, NULL, "1982", - "Jack the Giantkiller (set 1)\0", NULL, "Cinematronics", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, jackRomInfo, jackRomName, NULL, NULL, JackInputInfo, JackDIPInfo, - jackInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Jack the Giantkiller (set 2) - -static struct BurnRomInfo jack2RomDesc[] = { - { "jgk.j8", 0x1000, 0xfe229e20, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "jgk.j6", 0x1000, 0x36d7810e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jgk.j7", 0x1000, 0xb15ff3ee, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jgk.j5", 0x1000, 0x4a63d242, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jgk.j3", 0x1000, 0x605514a8, 1 | BRF_PRG | BRF_ESS }, // 4 - { "jgk.j4", 0x1000, 0xbce489b7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "jgk.j2", 0x1000, 0xdb21bd55, 1 | BRF_PRG | BRF_ESS }, // 6 - { "jgk.j1", 0x1000, 0x49fffe31, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "jgk.j9", 0x1000, 0xc2dc1e00, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - - { "jgk.j12", 0x1000, 0xce726df0, 3 | BRF_GRA }, // 9 Graphics - { "jgk.j13", 0x1000, 0x6aec2c8d, 3 | BRF_GRA }, // 10 - { "jgk.j11", 0x1000, 0xfd14c525, 3 | BRF_GRA }, // 11 - { "jgk.j10", 0x1000, 0xeab890b2, 3 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(jack2) -STD_ROM_FN(jack2) - -struct BurnDriver BurnDrvjack2 = { - "jack2", "jack", NULL, NULL, "1982", - "Jack the Giantkiller (set 2)\0", NULL, "Cinematronics", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, jack2RomInfo, jack2RomName, NULL, NULL, JackInputInfo, Jack2DIPInfo, - jackInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Jack the Giantkiller (set 3) - -static struct BurnRomInfo jack3RomDesc[] = { - { "jack8", 0x1000, 0x632151d2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "jack6", 0x1000, 0xf94f80d9, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jack7", 0x1000, 0xc830ff1e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jack5", 0x1000, 0x8dea17e7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jgk.j3", 0x1000, 0x605514a8, 1 | BRF_PRG | BRF_ESS }, // 4 // bank 2 - { "jgk.j4", 0x1000, 0xbce489b7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "jgk.j2", 0x1000, 0xdb21bd55, 1 | BRF_PRG | BRF_ESS }, // 6 - { "jack1", 0x1000, 0x7e75ea3d, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "jgk.j9", 0x1000, 0xc2dc1e00, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - - { "jack12", 0x1000, 0x80320647, 3 | BRF_GRA }, // 9 Graphics - { "jgk.j13", 0x1000, 0x6aec2c8d, 3 | BRF_GRA }, // 10 - { "jgk.j11", 0x1000, 0xfd14c525, 3 | BRF_GRA }, // 11 - { "jgk.j10", 0x1000, 0xeab890b2, 3 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(jack3) -STD_ROM_FN(jack3) - -struct BurnDriver BurnDrvjack3 = { - "jack3", "jack", NULL, NULL, "1982", - "Jack the Giantkiller (set 3)\0", NULL, "Cinematronics", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, jack3RomInfo, jack3RomName, NULL, NULL, JackInputInfo, Jack3DIPInfo, - jackInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Treasure Hunt (bootleg?) - -static struct BurnRomInfo treahuntRomDesc[] = { - { "thunt-1.f2", 0x1000, 0x0b35858c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "thunt-2.f3", 0x1000, 0x67305a51, 1 | BRF_PRG | BRF_ESS }, // 1 - { "thunt-3.4f", 0x1000, 0xd7a969c3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "thunt-4.6f", 0x1000, 0x2483f14d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "thunt-5.7f", 0x1000, 0xc69d5e21, 1 | BRF_PRG | BRF_ESS }, // 4 - { "thunt-6.7e", 0x1000, 0x11bf3d49, 1 | BRF_PRG | BRF_ESS }, // 5 - { "thunt-7.6e", 0x1000, 0x7c2d6279, 1 | BRF_PRG | BRF_ESS }, // 6 - { "thunt-8.4e", 0x1000, 0xf73b86fb, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "jgk.j9", 0x1000, 0xc2dc1e00, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - - { "thunt-13.a4", 0x1000, 0xe03f1f09, 3 | BRF_GRA }, // 9 Graphics - { "thunt-12.a3", 0x1000, 0xda4ee9eb, 3 | BRF_GRA }, // 10 - { "thunt-10.a1", 0x1000, 0x51ec7934, 3 | BRF_GRA }, // 11 - { "thunt-11.a2", 0x1000, 0xf9781143, 3 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(treahunt) -STD_ROM_FN(treahunt) - -static void treahunt_decode() -{ - for (INT32 i = 0; i < 0x4000; i++) - { - if (i & 0x1000) - { - User[i] = BITSWAP08(Rom0[i], 0, 2, 5, 1, 3, 6, 4, 7); - - if (~i & 0x04) User[i] ^= 0x81; - } - else - { - User[i] = BITSWAP08(Rom0[i], 7, 2, 5, 1, 3, 6, 4, 0) ^ 0x81; - } - } - - ZetOpen(0); - ZetMapArea(0x0000, 0x3fff, 2, User, Rom0); - ZetClose(); -} - -static INT32 treahuntInit() -{ - timer_rate = 128; - - INT32 nRet = DrvInit(); - - treahunt_decode(); - - return nRet; -} - -struct BurnDriver BurnDrvtreahunt = { - "treahunt", "jack", NULL, NULL, "1982", - "Treasure Hunt (bootleg?)\0", NULL, "Hara Industries", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, treahuntRomInfo, treahuntRomName, NULL, NULL, JackInputInfo, TreahuntDIPInfo, - treahuntInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Zzyzzyxx (set 1) - -static struct BurnRomInfo zzyzzyxxRomDesc[] = { - { "a.2f", 0x1000, 0xa9102e34, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "zzyzzyxx.b", 0x1000, 0xefa9d4c6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "zzyzzyxx.c", 0x1000, 0xb0a365b1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "zzyzzyxx.d", 0x1000, 0x5ed6dd9a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "zzyzzyxx.e", 0x1000, 0x5966fdbf, 1 | BRF_PRG | BRF_ESS }, // 4 - { "f.7e", 0x1000, 0x12f24c68, 1 | BRF_PRG | BRF_ESS }, // 5 - { "g.6e", 0x1000, 0x408f2326, 1 | BRF_PRG | BRF_ESS }, // 6 - { "h.4e", 0x1000, 0xf8bbabe0, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "i.5a", 0x1000, 0xc7742460, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - { "j.6a", 0x1000, 0x72166ccd, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "n.1c", 0x1000, 0x4f64538d, 3 | BRF_GRA }, // 10 Graphics - { "m.1d", 0x1000, 0x217b1402, 3 | BRF_GRA }, // 11 - { "k.1b", 0x1000, 0xb8b2b8cc, 3 | BRF_GRA }, // 12 - { "l.1a", 0x1000, 0xab421a83, 3 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(zzyzzyxx) -STD_ROM_FN(zzyzzyxx) - -static INT32 zzyzzyxxInit() -{ - timer_rate = 32; - zzyzzyxx = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvzzyzzyxx = { - "zzyzzyxx", NULL, NULL, NULL, "1982", - "Zzyzzyxx (set 1)\0", NULL, "Cinematronics + Advanced Microcomputer Systems", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, zzyzzyxxRomInfo, zzyzzyxxRomName, NULL, NULL, ZzyzzyxxInputInfo, ZzyzzyxxDIPInfo, - zzyzzyxxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Zzyzzyxx (set 2) - -static struct BurnRomInfo zzyzzyx2RomDesc[] = { - { "a.2f", 0x1000, 0xa9102e34, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b.3f", 0x1000, 0x4277beab, 1 | BRF_PRG | BRF_ESS }, // 1 - { "c.4f", 0x1000, 0x72ac99e1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "d.6f", 0x1000, 0x7c7eec2b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "e.7f", 0x1000, 0xcffc4a68, 1 | BRF_PRG | BRF_ESS }, // 4 - { "f.7e", 0x1000, 0x12f24c68, 1 | BRF_PRG | BRF_ESS }, // 5 - { "g.6e", 0x1000, 0x408f2326, 1 | BRF_PRG | BRF_ESS }, // 6 - { "h.4e", 0x1000, 0xf8bbabe0, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "i.5a", 0x1000, 0xc7742460, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - { "j.6a", 0x1000, 0x72166ccd, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "n.1c", 0x1000, 0x4f64538d, 3 | BRF_GRA }, // 10 Graphics - { "m.1d", 0x1000, 0x217b1402, 3 | BRF_GRA }, // 11 - { "k.1b", 0x1000, 0xb8b2b8cc, 3 | BRF_GRA }, // 12 - { "l.1a", 0x1000, 0xab421a83, 3 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(zzyzzyx2) -STD_ROM_FN(zzyzzyx2) - -struct BurnDriver BurnDrvzzyzzyx2 = { - "zzyzzyxx2", "zzyzzyxx", NULL, NULL, "1982", - "Zzyzzyxx (set 2)\0", NULL, "Cinematronics + Advanced Microcomputer Systems", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, zzyzzyx2RomInfo, zzyzzyx2RomName, NULL, NULL, ZzyzzyxxInputInfo, ZzyzzyxxDIPInfo, - zzyzzyxxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Brix - -static struct BurnRomInfo brixRomDesc[] = { - { "a", 0x1000, 0x050e0d70, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b", 0x1000, 0x668118ae, 1 | BRF_PRG | BRF_ESS }, // 1 - { "c", 0x1000, 0xff5ed6cf, 1 | BRF_PRG | BRF_ESS }, // 2 - { "d", 0x1000, 0xc3ae45a9, 1 | BRF_PRG | BRF_ESS }, // 3 - { "e", 0x1000, 0xdef99fa9, 1 | BRF_PRG | BRF_ESS }, // 4 - { "f", 0x1000, 0xdde717ed, 1 | BRF_PRG | BRF_ESS }, // 5 - { "g", 0x1000, 0xadca02d8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "h", 0x1000, 0xbc3b878c, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "i.5a", 0x1000, 0xc7742460, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - { "j.6a", 0x1000, 0x72166ccd, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "n", 0x1000, 0x8064910e, 3 | BRF_GRA }, // 10 Graphics - { "m.1d", 0x1000, 0x217b1402, 3 | BRF_GRA }, // 11 - { "k", 0x1000, 0xc7d7e2a0, 3 | BRF_GRA }, // 12 - { "l.1a", 0x1000, 0xab421a83, 3 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(brix) -STD_ROM_FN(brix) - -struct BurnDriver BurnDrvbrix = { - "brix", "zzyzzyxx", NULL, NULL, "1982", - "Brix\0", NULL, "Cinematronics + Advanced Microcomputer Systems", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, brixRomInfo, brixRomName, NULL, NULL, ZzyzzyxxInputInfo, ZzyzzyxxDIPInfo, - zzyzzyxxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - -INT32 freezeInit() -{ - freeze = 1; - timer_rate = 256; - - return DrvInit(); -} - -// Freeze - -static struct BurnRomInfo freezeRomDesc[] = { - { "freeze.f2", 0x1000, 0x0a431665, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "freeze.f3", 0x1000, 0x1189b8ad, 1 | BRF_PRG | BRF_ESS }, // 1 - { "freeze.f4", 0x1000, 0x10c4a5ea, 1 | BRF_PRG | BRF_ESS }, // 2 - { "freeze.f5", 0x1000, 0x16024c53, 1 | BRF_PRG | BRF_ESS }, // 3 - { "freeze.f7", 0x1000, 0xea0b0765, 1 | BRF_PRG | BRF_ESS }, // 4 - { "freeze.e7", 0x1000, 0x1155c00b, 1 | BRF_PRG | BRF_ESS }, // 5 - { "freeze.e5", 0x1000, 0x95c18d75, 1 | BRF_PRG | BRF_ESS }, // 6 - { "freeze.e4", 0x1000, 0x7e8f5afc, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "freeze.a1", 0x1000, 0x7771f5b9, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - - { "freeze.5a", 0x1000, 0x6c8a98a0, 3 | BRF_GRA }, // 9 Graphics - { "freeze.3a", 0x1000, 0x6d2125e4, 3 | BRF_GRA }, // 10 - { "freeze.1a", 0x1000, 0x3a7f2fa9, 3 | BRF_GRA }, // 11 - { "freeze.2a", 0x1000, 0xdd70ddd6, 3 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(freeze) -STD_ROM_FN(freeze) - -struct BurnDriver BurnDrvfreeze = { - "freeze", NULL, NULL, NULL, "1984", - "Freeze\0", NULL, "Cinematronics", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, freezeRomInfo, freezeRomName, NULL, NULL, FreezeInputInfo, FreezeDIPInfo, - freezeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Super Casino - -static struct BurnRomInfo sucasinoRomDesc[] = { - { "1", 0x1000, 0xe116e979, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2", 0x1000, 0x2a2635f5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3", 0x1000, 0x69864d90, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4", 0x1000, 0x174c9373, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5", 0x1000, 0x115bcb1e, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6", 0x1000, 0x434caa17, 1 | BRF_PRG | BRF_ESS }, // 5 - { "7", 0x1000, 0x67c68b82, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8", 0x1000, 0xf5b63006, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "9", 0x1000, 0x67cf8aec, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - - { "11", 0x1000, 0xf92c4c5b, 3 | BRF_GRA }, // 9 Graphics - { "10", 0x1000, 0x3b0783ce, 3 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(sucasino) -STD_ROM_FN(sucasino) - -struct BurnDriver BurnDrvsucasino = { - "sucasino", NULL, NULL, NULL, "1984", - "Super Casino\0", NULL, "Data Amusement", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_CASINO, 0, - NULL, sucasinoRomInfo, sucasinoRomName, NULL, NULL, SucasinoInputInfo, SucasinoDIPInfo, - jackInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Tri-Pool (Casino Tech) - -static struct BurnRomInfo tripoolRomDesc[] = { - { "tri73a.bin", 0x1000, 0x96893aa7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "tri62a.bin", 0x1000, 0x3299dc65, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tri52b.bin", 0x1000, 0x27ef765e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tri33c.bin", 0x1000, 0xd7ef061d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "tri45c.bin", 0x1000, 0x51b813b1, 1 | BRF_PRG | BRF_ESS }, // 4 - { "tri25d.bin", 0x1000, 0x8e64512d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "tri13d.bin", 0x1000, 0xad268e9b, 1 | BRF_PRG | BRF_ESS }, // 6 - - { "trisnd.bin", 0x1000, 0x945c4b8b, 2 | BRF_PRG | BRF_ESS }, // 7 Z80 #1 Code - - { "tri105a.bin", 0x1000, 0x366a753c, 3 | BRF_GRA }, // 8 Graphics - { "tri93a.bin", 0x1000, 0x35213782, 3 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(tripool) -STD_ROM_FN(tripool) - -static INT32 tripoolInit() -{ - tri_fix = 1; - timer_rate = 256; - - return DrvInit(); -} - -struct BurnDriver BurnDrvtripool = { - "tripool", NULL, NULL, NULL, "1981", - "Tri-Pool (Casino Tech)\0", NULL, "Noma (Casino Tech license)", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, tripoolRomInfo, tripoolRomName, NULL, NULL, TripoolInputInfo, NULL, - tripoolInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Tri-Pool (Costal Games) - -static struct BurnRomInfo tripoolaRomDesc[] = { - { "tri73a.bin", 0x1000, 0x96893aa7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "tri62a.bin", 0x1000, 0x3299dc65, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tri52b.bin", 0x1000, 0x27ef765e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tri33c.bin", 0x1000, 0xd7ef061d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "tri45c.bin", 0x1000, 0x51b813b1, 1 | BRF_PRG | BRF_ESS }, // 4 - { "tri25d.bin", 0x1000, 0x8e64512d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "tp1ckt", 0x1000, 0x72ec43a3, 1 | BRF_PRG | BRF_ESS }, // 6 - - { "trisnd.bin", 0x1000, 0x945c4b8b, 2 | BRF_PRG | BRF_ESS }, // 7 Z80 #1 Code - - { "tri105a.bin", 0x1000, 0x366a753c, 3 | BRF_GRA }, // 8 Graphics - { "tri93a.bin", 0x1000, 0x35213782, 3 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(tripoola) -STD_ROM_FN(tripoola) - -struct BurnDriver BurnDrvtripoola = { - "tripoola", "tripool", NULL, NULL, "1981", - "Tri-Pool (Costal Games)\0", NULL, "Noma (Costal Games license)", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, tripoolaRomInfo, tripoolaRomName, NULL, NULL, TripoolInputInfo, NULL, - tripoolInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Joinem - -static struct BurnRomInfo joinemRomDesc[] = { - { "join1.r0", 0x2000, 0xb5b2e2cc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "join2.r2", 0x2000, 0xbcf140e6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "join3.r4", 0x2000, 0xfe04e4d4, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "join7.s0", 0x1000, 0xbb8a7814, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "join4.p3", 0x1000, 0x4964c82c, 3 | BRF_GRA }, // 4 Graphics - { "join5.p2", 0x1000, 0xae78fa89, 3 | BRF_GRA }, // 5 - { "join6.p1", 0x1000, 0x2b533261, 3 | BRF_GRA }, // 6 - - { "l82s129.11n", 0x0100, 0x7b724211, 4 | BRF_GRA }, // 7 Color Proms - { "h82s129.12n", 0x0100, 0x2e81c5ff, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(joinem) -STD_ROM_FN(joinem) - -static void joinem_palette_init() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0,bit1,bit2,r,g,b; - - bit0 = (Prom[i] >> 0) & 1; - bit1 = (Prom[i] >> 1) & 1; - bit2 = (Prom[i] >> 2) & 1; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (Prom[i] >> 3) & 1; - bit1 = (Prom[i] >> 4) & 1; - bit2 = (Prom[i] >> 5) & 1; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (Prom[i] >> 6) & 1; - bit2 = (Prom[i] >> 7) & 1; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - Palette[i] = (r << 16) | (g << 8) | b; - } -} - -static INT32 joinemInit() -{ - joinem = 1; - timer_rate = 32; - - INT32 nRet = DrvInit(); - - joinem_palette_init(); - - return nRet; -} - -struct BurnDriver BurnDrvjoinem = { - "joinem", NULL, NULL, NULL, "1986", - "Joinem\0", NULL, "Global Corporation", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, joinemRomInfo, joinemRomName, NULL, NULL, JoinemInputInfo, JoinemDIPInfo, - joinemInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - -static INT32 unclepooInit() -{ - joinem = 1; - unclepoo = 1; - timer_rate = 32; - - INT32 nRet = DrvInit(); - - joinem_palette_init(); - - return nRet; -} - -// Uncle Poo - -static struct BurnRomInfo unclepooRomDesc[] = { - { "01.f17", 0x2000, 0x92fb238c, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "02.f14", 0x2000, 0xb99214ef, 1 | BRF_PRG | BRF_ESS }, // 1 - { "03.f11", 0x2000, 0xa136af97, 1 | BRF_PRG | BRF_ESS }, // 2 - { "04.f09", 0x2000, 0xc4bcd414, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "08.c15", 0x1000, 0xfd84106b, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - - { "07.h04", 0x2000, 0xe2f73e99, 3 | BRF_GRA }, // 5 gfx1 - { "06.j04", 0x2000, 0x94b5f676, 3 | BRF_GRA }, // 6 - { "05.k04", 0x2000, 0x64026934, 3 | BRF_GRA }, // 7 - - { "diatec_l.bin", 0x0100, 0xb04d466a, 4 | BRF_GRA }, // 8 proms - { "diatec_h.bin", 0x0100, 0x938601b1, 4 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(unclepoo) -STD_ROM_FN(unclepoo) - -struct BurnDriver BurnDrvUnclepoo = { - "unclepoo", NULL, NULL, NULL, "1983", - "Uncle Poo\0", NULL, "Diatec", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, unclepooRomInfo, unclepooRomName, NULL, NULL, UnclepooInputInfo, UnclepooDIPInfo, - unclepooInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - -// Lover Boy - -static struct BurnRomInfo loverboyRomDesc[] = { - { "lover.r0", 0x2000, 0xffec4e41, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "lover.r2", 0x2000, 0x04052262, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lover.r4", 0x2000, 0xce5f3b49, 1 | BRF_PRG | BRF_ESS }, // 2 - { "lover.r6", 0x1000, 0x839d79b7, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "lover.s0", 0x1000, 0xec38111c, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "lover.p3", 0x2000, 0x1a519c8f, 3 | BRF_GRA }, // 5 Graphics - { "lover.p2", 0x2000, 0xe465372f, 3 | BRF_GRA }, // 6 - { "lover.p1", 0x2000, 0xcda0d87e, 3 | BRF_GRA }, // 7 - - { "color.n11", 0x0200, 0xcf4a16ae, 4 | BRF_GRA }, // 8 Color Proms - { "color.n12", 0x0200, 0x4b11ac21, 4 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(loverboy) -STD_ROM_FN(loverboy) - -static INT32 loverboyInit() -{ - loverb = 1; - timer_rate = 16; - - INT32 nRet = DrvInit(); - - // Hack (Protection?) - Rom0[0x12] = 0x9d; - Rom0[0x13] = 0x01; - - joinem_palette_init(); - - return nRet; -} - -struct BurnDriver BurnDrvloverboy = { - "loverboy", NULL, NULL, NULL, "1983", - "Lover Boy\0", NULL, "G.T Enterprise Inc", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, loverboyRomInfo, loverboyRomName, NULL, NULL, LoverboyInputInfo, LoverboyDIPInfo, - loverboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 240, 3, 4 -}; - - -// Triki Triki (Lover Boy bootleg) - -static struct BurnRomInfo trikitriRomDesc[] = { - { "1.bin", 0x2000, 0x248f2f12, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.bin", 0x2000, 0x04052262, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.bin", 0x2000, 0x979c17c1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.bin", 0x1000, 0x839d79b7, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "snd.bin", 0x1000, 0x1589c4a9, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "5.bin", 0x2000, 0x8cb6ec1c, 3 | BRF_GRA }, // 5 Graphics - { "6.bin", 0x2000, 0xa7bed0c1, 3 | BRF_GRA }, // 6 - { "7.bin", 0x2000, 0xb473ce14, 3 | BRF_GRA }, // 7 - - { "prom2.bin", 0x0100, 0xed5cec15, 4 | BRF_GRA }, // 8 Color Proms - { "prom1.bin", 0x0100, 0x79632c67, 4 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(trikitri) -STD_ROM_FN(trikitri) - -struct BurnDriver BurnDrvtrikitri = { - "trikitri", "loverboy", NULL, NULL, "1983", - "Triki Triki (Lover Boy bootleg)\0", NULL, "DTT Enterprise Inc", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, trikitriRomInfo, trikitriRomName, NULL, NULL, LoverboyInputInfo, LoverboyDIPInfo, - loverboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 240, 3, 4 -}; - - -// Super Triv - -static struct BurnRomInfo strivRomDesc[] = { - { "pr1.f2", 0x1000, 0xdcf5da6e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "pr2.4f", 0x1000, 0x921610ba, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pr3.5f", 0x1000, 0xc36f0e21, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pr4.6f", 0x1000, 0x0dc98a97, 1 | BRF_PRG | BRF_ESS }, // 3 - { "bc3.7e", 0x1000, 0x83f03885, 1 | BRF_PRG | BRF_ESS }, // 4 - { "bc2.6e", 0x1000, 0x75f18361, 1 | BRF_PRG | BRF_ESS }, // 5 - { "bc1.5e", 0x1000, 0x0d150385, 1 | BRF_PRG | BRF_ESS }, // 6 - - { "snd.5a", 0x1000, 0xb7ddf84f, 2 | BRF_PRG | BRF_ESS }, // 7 Z80 #1 Code - - { "chr0.1a", 0x1000, 0x8f60229b, 3 | BRF_GRA }, // 8 Graphics - { "chr2.4a", 0x1000, 0x8f982a9c, 3 | BRF_GRA }, // 9 - { "chr3.5a", 0x1000, 0x8f982a9c, 3 | BRF_GRA }, // 10 - { "chr1.2a", 0x1000, 0x7ad4358e, 3 | BRF_GRA }, // 11 - - { "rom.u6", 0x8000, 0xa32d7a28, 5 | BRF_PRG | BRF_ESS }, // 12 Question ROMs - { "rom.u7", 0x8000, 0xbc44ae18, 5 | BRF_PRG | BRF_ESS }, // 13 - { "tbfd2.u8", 0x8000, 0x9572984a, 5 | BRF_PRG | BRF_ESS }, // 14 - { "tbfd3.u9", 0x8000, 0xd904a2f1, 5 | BRF_PRG | BRF_ESS }, // 15 - { "tbfl0.u10", 0x8000, 0x680264a2, 5 | BRF_PRG | BRF_ESS }, // 16 - { "tbfl1.u11", 0x8000, 0x33e99d00, 5 | BRF_PRG | BRF_ESS }, // 17 - { "tbfl2.u12", 0x8000, 0x2e7a941f, 5 | BRF_PRG | BRF_ESS }, // 18 - { "tbft0.u13", 0x8000, 0x7d2e5e89, 5 | BRF_PRG | BRF_ESS }, // 19 - { "tbft1.u14", 0x8000, 0xd36246cf, 5 | BRF_PRG | BRF_ESS }, // 20 - { "tbfd1.u15", 0x8000, 0x745db398, 5 | BRF_PRG | BRF_ESS }, // 21 - - { "tbfd0.u21", 0x2000, 0x15b83099, 0 | BRF_OPT }, // 22 Junk -}; - -STD_ROM_PICK(striv) -STD_ROM_FN(striv) - -static INT32 strivInit() -{ - suprtriv = 1; - timer_rate = 128; - - INT32 nRet = DrvInit(); - - for (INT32 i = 0; i < 0x4000; i++) - { - if (i & 0x1000) - { - if (i & 4) - Rom0[i] = BITSWAP08(Rom0[i],7,2,5,1,3,6,4,0) ^ 1; - else - Rom0[i] = BITSWAP08(Rom0[i],0,2,5,1,3,6,4,7) ^ 0x81; - } - else - { - if (i & 4) - Rom0[i] = BITSWAP08(Rom0[i],7,2,5,1,3,6,4,0) ^ 1; - else - Rom0[i] = BITSWAP08(Rom0[i],0,2,5,1,3,6,4,7); - } - } - - return nRet; -} - -struct BurnDriver BurnDrvstriv = { - "striv", NULL, NULL, NULL, "1985", - "Super Triv\0", "No sound", "Hara Industries", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, strivRomInfo, strivRomName, NULL, NULL, StrivInputInfo, StrivDIPInfo, - strivInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; - - -// Super Triv (set 2) - -static struct BurnRomInfo striv2RomDesc[] = { - { "s.triv_p1.2f", 0x1000, 0xdcf5da6e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "s.triv_p2.3f", 0x1000, 0x921610ba, 1 | BRF_PRG | BRF_ESS }, // 1 - { "s.triv_p3.4f", 0x1000, 0xc36f0e21, 1 | BRF_PRG | BRF_ESS }, // 2 - { "s.triv_cp4.f6", 0x1000, 0x0dc98a97, 1 | BRF_PRG | BRF_ESS }, // 3 - { "s.triv_c3.e7", 0x1000, 0x2f4b0570, 1 | BRF_PRG | BRF_ESS }, // 4 - { "s.triv_c2.e6", 0x1000, 0xe21bd3ab, 1 | BRF_PRG | BRF_ESS }, // 5 - { "s.triv_c1.5e", 0x1000, 0x2c2c7282, 1 | BRF_PRG | BRF_ESS }, // 6 - - { "s.triv_sound.5a", 0x1000, 0xb7ddf84f, 2 | BRF_PRG | BRF_ESS }, // 7 Z80 #1 Code - - { "s.triv.1a", 0x1000, 0x8f60229b, 3 | BRF_GRA }, // 8 Graphics - { "s.triv.4a", 0x1000, 0x8f982a9c, 3 | BRF_GRA }, // 9 - { "s.triv.5a", 0x1000, 0x8f982a9c, 3 | BRF_GRA }, // 10 - { "s.triv.2a", 0x1000, 0x7ad4358e, 3 | BRF_GRA }, // 11 - - { "s.triv_ts0.u6", 0x8000, 0x796849da, 5 | BRF_PRG | BRF_ESS }, // 12 Question ROMs - { "s.triv_ts1.u7", 0x8000, 0x059d4900, 5 | BRF_PRG | BRF_ESS }, // 13 - { "s.triv_ts2.u8", 0x8000, 0x184159aa, 5 | BRF_PRG | BRF_ESS }, // 14 - { "s.triv_ta0.u9", 0x8000, 0xc4eb7f2e, 5 | BRF_PRG | BRF_ESS }, // 15 - { "s.triv_ta1.u10", 0x8000, 0x3d9a136f, 5 | BRF_PRG | BRF_ESS }, // 16 - { "s.triv_ta2.u11", 0x8000, 0x8fa557b2, 5 | BRF_PRG | BRF_ESS }, // 17 - { "s.triv_te0.u12", 0x8000, 0x3f5d1c4b, 5 | BRF_PRG | BRF_ESS }, // 18 - { "s.triv_te1.u13", 0x8000, 0x6ae2bf3a, 5 | BRF_PRG | BRF_ESS }, // 19 - { "s.triv_tg0.u14", 0x8000, 0x8fc9c76d, 5 | BRF_PRG | BRF_ESS }, // 20 - { "s.triv_tg1.u15", 0x8000, 0x981a2a43, 5 | BRF_PRG | BRF_ESS }, // 21 -}; - -STD_ROM_PICK(striv2) -STD_ROM_FN(striv2) - -struct BurnDriver BurnDrvstriv2 = { - "striv2", "striv", NULL, NULL, "1985", - "Super Triv (set 2)\0", "No sound", "Hara Industries", "Jack the Giantkiller", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, striv2RomInfo, striv2RomName, NULL, NULL, StrivInputInfo, StrivDIPInfo, - strivInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvCalcPal, 0x100, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_jrpacman.cpp b/jan/src/burn/drv/pre90s/d_jrpacman.cpp deleted file mode 100644 index 6d664471a..000000000 --- a/jan/src/burn/drv/pre90s/d_jrpacman.cpp +++ /dev/null @@ -1,681 +0,0 @@ -// FB Alpha JR. Pacman driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "bitswap.h" -#include "namco_snd.h" -#include "driver.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvColPROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprRAM2; -static UINT8 *DrvVidRAM; -static UINT32 *DrvPalette; -static UINT32 *Palette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[2]; - -static INT32 interrupt_enable = 0; -static INT32 palettebank = 0; -static INT32 colortablebank = 0; -static INT32 flipscreen = 0; -static INT32 bgpriority = 0; -static INT32 spritebank = 0; -static INT32 charbank = 0; -static INT32 scrolly = 0; - -static struct BurnInputInfo JrpacmanInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip c", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Jrpacman) - - -static struct BurnDIPInfo JrpacmanDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x10, NULL }, - {0x0e, 0xff, 0xff, 0x90, NULL }, - {0x0f, 0xff, 0xff, 0x69, NULL }, - - {0 , 0xfe, 0 , 2, "Rack Test (Cheat)" }, - {0x0d, 0x01, 0x10, 0x10, "Off" }, - {0x0d, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service" }, - {0x0e, 0x01, 0x10, 0x10, "Off" }, - {0x0e, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x80, 0x80, "Upright" }, - {0x0e, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0f, 0x01, 0x03, 0x03, "2 Coins 1 Credits " }, - {0x0f, 0x01, 0x03, 0x01, "1 Coin 1 Credits " }, - {0x0f, 0x01, 0x03, 0x02, "1 Coin 2 Credits " }, - {0x0f, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x0c, 0x00, "1" }, - {0x0f, 0x01, 0x0c, 0x04, "2" }, - {0x0f, 0x01, 0x0c, 0x08, "3" }, - {0x0f, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0f, 0x01, 0x30, 0x00, "10000" }, - {0x0f, 0x01, 0x30, 0x10, "15000" }, - {0x0f, 0x01, 0x30, 0x20, "20000" }, - {0x0f, 0x01, 0x30, 0x30, "30000" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0f, 0x01, 0x40, 0x40, "Normal" }, - {0x0f, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Jrpacman) - -void __fastcall jrpacman_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x5000: - interrupt_enable = data; - return; - - case 0x5001: - // pacman_sound_enable_w - return; - - case 0x5003: - flipscreen = data & 1; - return; - - case 0x5070: - palettebank = data; - return; - - case 0x5071: - colortablebank = data; - return; - - case 0x5073: - bgpriority = data & 1; - return; - - case 0x5074: - charbank = data & 1; - return; - - case 0x5075: - spritebank = data & 1; - return; - - case 0x5080: - scrolly = data; - return; - - case 0x50c0: - // nop - return; - } - - if (address >= 0x5040 && address <= 0x505f) { - NamcoSoundWrite(address & 0x1f, data); - return; - } - - if ((address & 0xfff0) == 0x5060) { - DrvSprRAM2[address & 0x0f] = data; - return; - } -} - -UINT8 __fastcall jrpacman_read(UINT16 address) -{ - if ((address & 0xff00) == 0x5000) address &= 0xffc0; - - switch (address) - { - case 0x5000: - return (DrvInputs[0] & 0xef) | (DrvDips[0] & 0x10); - - case 0x5040: - return (DrvInputs[1] & 0x6f) | (DrvDips[1] & 0x90); - - case 0x5080: - return DrvDips[2]; - } - - return 0; -} - -void __fastcall jrpacman_out(UINT16 port, UINT8 data) -{ - if ((port & 0xff) == 0) { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetSetVector(data); - return; - } -} - -static void DrvGfxDecode() -{ - INT32 Planes[2] = { 0, 4 }; - INT32 XOffs8x8[8] = { STEP4(8*8,1), STEP4(0*8,1) }; - INT32 YOffs8x8[8] = { STEP8(0*8,8) }; - INT32 XOffs16x16[16] = { STEP4(8*8,1), STEP4(16*8,1), STEP4(24*8,1), STEP4(0*8,1) }; - INT32 YOffs16x16[16] = { STEP8(0*8,8), STEP8(32*8,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc( 0x2000 ); - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x200, 2, 8, 8, Planes, XOffs8x8, YOffs8x8, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x2000); - - GfxDecode(0x080, 2, 16, 16, Planes, XOffs16x16, YOffs16x16, 0x200, tmp, DrvGfxROM1); - - BurnFree (tmp); -} - -static void DrvPaletteInit() -{ - UINT32 tmp[32]; - - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0, bit1, bit2; - INT32 r, g, b; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = (bit0 * 33) + (bit1 * 71) + (bit2 * 151); - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - g = (bit0 * 33) + (bit1 * 71) + (bit2 * 151); - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - b = (bit0 * 81) + (bit1 * 171); - - tmp[i] = (r << 16) | (g << 8) | b; - } - - for (INT32 i = 0; i < 256; i++) - { - UINT8 ctabentry = DrvColPROM[0x20 + i] & 0x0f; - - Palette[0x000 | i] = tmp[ctabentry | 0x00]; - Palette[0x100 + i] = tmp[ctabentry + 0x10]; - } -} - - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - NamcoSoundReset(); - - interrupt_enable = 0; - palettebank = 0; - colortablebank = 0; - flipscreen = 0; - bgpriority = 0; - spritebank = 0; - charbank = 0; - scrolly = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x0080000; - DrvGfxROM1 = Next; Next += 0x0080000; - - DrvColPROM = Next; Next += 0x000120; - - NamcoSoundProm = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(int); - Palette = (UINT32*)Next; Next += 0x0200 * sizeof(int); - - AllRam = Next; - - DrvSprRAM2 = Next; Next += 0x000010; - DrvVidRAM = Next; Next += 0x000800; - DrvZ80RAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void jrpacman_decode() -{ - static const struct { - INT32 count; - INT32 value; - } table[] = - { - { 0x00C1, 0x00 }, { 0x0002, 0x80 }, { 0x0004, 0x00 }, { 0x0006, 0x80 }, - { 0x0003, 0x00 }, { 0x0002, 0x80 }, { 0x0009, 0x00 }, { 0x0004, 0x80 }, - { 0x9968, 0x00 }, { 0x0001, 0x80 }, { 0x0002, 0x00 }, { 0x0001, 0x80 }, - { 0x0009, 0x00 }, { 0x0002, 0x80 }, { 0x0009, 0x00 }, { 0x0001, 0x80 }, - { 0x00AF, 0x00 }, { 0x000E, 0x04 }, { 0x0002, 0x00 }, { 0x0004, 0x04 }, - { 0x001E, 0x00 }, { 0x0001, 0x80 }, { 0x0002, 0x00 }, { 0x0001, 0x80 }, - { 0x0002, 0x00 }, { 0x0002, 0x80 }, { 0x0009, 0x00 }, { 0x0002, 0x80 }, - { 0x0009, 0x00 }, { 0x0002, 0x80 }, { 0x0083, 0x00 }, { 0x0001, 0x04 }, - { 0x0001, 0x01 }, { 0x0001, 0x00 }, { 0x0002, 0x05 }, { 0x0001, 0x00 }, - { 0x0003, 0x04 }, { 0x0003, 0x01 }, { 0x0002, 0x00 }, { 0x0001, 0x04 }, - { 0x0003, 0x01 }, { 0x0003, 0x00 }, { 0x0003, 0x04 }, { 0x0001, 0x01 }, - { 0x002E, 0x00 }, { 0x0078, 0x01 }, { 0x0001, 0x04 }, { 0x0001, 0x05 }, - { 0x0001, 0x00 }, { 0x0001, 0x01 }, { 0x0001, 0x04 }, { 0x0002, 0x00 }, - { 0x0001, 0x01 }, { 0x0001, 0x04 }, { 0x0002, 0x00 }, { 0x0001, 0x01 }, - { 0x0001, 0x04 }, { 0x0002, 0x00 }, { 0x0001, 0x01 }, { 0x0001, 0x04 }, - { 0x0001, 0x05 }, { 0x0001, 0x00 }, { 0x0001, 0x01 }, { 0x0001, 0x04 }, - { 0x0002, 0x00 }, { 0x0001, 0x01 }, { 0x0001, 0x04 }, { 0x0002, 0x00 }, - { 0x0001, 0x01 }, { 0x0001, 0x04 }, { 0x0001, 0x05 }, { 0x0001, 0x00 }, - { 0x01B0, 0x01 }, { 0x0001, 0x00 }, { 0x0002, 0x01 }, { 0x00AD, 0x00 }, - { 0x0031, 0x01 }, { 0x005C, 0x00 }, { 0x0005, 0x01 }, { 0x604E, 0x00 }, - { 0, 0 } - }; - - for (INT32 i = 0, A = 0; table[i].count; i++) - for (INT32 j = 0; j < table[i].count; j++) - DrvZ80ROM[A++] ^= table[i].value; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x8000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0xa000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0xc000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x000, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x020, 8, 1)) return 1; - for (INT32 i = 0; i < 0x20; i++) { - DrvColPROM[i] = (DrvColPROM[i] & 0x0f) | (DrvColPROM[i + 0x020] << 4); - } - if (BurnLoadRom(DrvColPROM + 0x020, 9, 1)) return 1; - - if (BurnLoadRom(NamcoSoundProm + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(NamcoSoundProm + 0x0100, 11, 1)) return 1; - - DrvGfxDecode(); - jrpacman_decode(); - DrvPaletteInit(); - } - - DrvSprRAM = DrvZ80RAM + 0x7f0; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0x4000, 0x47ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0x4800, 0x4fff, MAP_RAM); //+ 0x7f0 = sprite ram - ZetMapMemory(DrvZ80ROM + 0x8000,0x8000, 0xdfff, MAP_ROM); - ZetSetWriteHandler(jrpacman_write); - ZetSetReadHandler(jrpacman_read); - ZetSetOutHandler(jrpacman_out); - ZetClose(); - - NamcoSoundInit(18432000 / 6 / 32, 3, 0); - NacmoSoundSetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - NamcoSoundExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_bg_layer() -{ - for (INT32 mx = 0; mx < 36+20; mx++) { - for (INT32 my = 0; my < 54+20; my++) { - - INT32 offs; - - INT32 row = mx + 2; - INT32 col = my - 2; - if ((col & 0x20) && (row & 0x20)) - offs = 0; - else if (col & 0x20) - offs = row + (((col&0x3) | 0x38)<< 5); - else - offs = col + (row << 5); - - INT32 y = 8 * mx; - INT32 x = 8 * my; - - if (x > 8 && x < 272) { - y -= scrolly; - } - - INT32 idx = (offs < 1792) ? (offs & 0x1f) : (offs + 0x80); - - INT32 code = DrvVidRAM[offs] | (charbank << 8); - INT32 color = (DrvVidRAM[idx] & 0x1f) | (colortablebank << 5) | (palettebank << 6); - - Render8x8Tile_Mask_Clip(pTransDraw, code, x, y, color, 2, 0, 0, DrvGfxROM0); - } - } -} - -static void RenderTileCPMP(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height) -{ - UINT16 *dest = pTransDraw; - UINT8 *gfx = DrvGfxROM1; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - if (DrvPalette[pxl | (color << 2)] == 0) continue; - - dest[sy * nScreenWidth + sx] = pxl | (color << 2); - } - sx -= width; - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x10 - 2; offs >= 0; offs -= 2) - { - INT32 code = (DrvSprRAM[offs] >> 2) | (spritebank << 6); - INT32 color = (DrvSprRAM[offs + 1] & 0x1f ) | (colortablebank << 5) | (palettebank << 6); - INT32 sx = DrvSprRAM2[offs + 1]; - INT32 sy = DrvSprRAM2[offs]; - INT32 flipx = DrvSprRAM [offs] & 1; - INT32 flipy = DrvSprRAM [offs] & 2; - - if (flipscreen) { - sy = (240 - sy) - 8; - sx += 8; - flipy = !flipy; - flipx = !flipx; - } else { - sx = 272 - sx; - sy = sy - 31; - } - - if (offs <= 2*2) sy += 1; // first couple sprites are offset - - RenderTileCPMP(code, color, sx, sy, flipx, flipy, 16, 16); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x200; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (bgpriority == 0) - if (nBurnLayer & 1) draw_bg_layer(); - - if (nBurnLayer & 2) draw_sprites(); - - if (bgpriority != 0) - if (nBurnLayer & 1) draw_bg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - ProcessJoystick(&DrvInputs[0], 0, 0,3,1,2, INPUT_4WAY | INPUT_CLEAROPPOSITES | INPUT_MAKEACTIVELOW ); - ProcessJoystick(&DrvInputs[1], 1, 0,3,1,2, INPUT_4WAY | INPUT_CLEAROPPOSITES | INPUT_MAKEACTIVELOW ); - } - - INT32 nInterleave = 264; - INT32 nSoundBufferPos = 0; - - INT32 nCyclesTotal = (18432000 / 6) / 60; - INT32 nCyclesDone = 0, nSegment = 0; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - nSegment = (nCyclesTotal - nCyclesDone) / (nInterleave - i); - nCyclesDone += ZetRun(nSegment); - - if (i == 223 && interrupt_enable) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - } - nSoundBufferPos += nSegmentLength; - } - } - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029693; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - NamcoSoundScan(nAction, pnMin); - - SCAN_VAR(interrupt_enable); - SCAN_VAR(palettebank); - SCAN_VAR(colortablebank); - SCAN_VAR(flipscreen); - SCAN_VAR(bgpriority); - SCAN_VAR(spritebank); - SCAN_VAR(charbank); - SCAN_VAR(scrolly); - } - - return 0; -} - -// Jr. Pac-Man (11/9/83) - -static struct BurnRomInfo jrpacmanRomDesc[] = { - { "jrp8d.8d", 0x2000, 0xe3fa972e, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "jrp8e.8e", 0x2000, 0xec889e94, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jrp8h.8h", 0x2000, 0x35f1fc6e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jrp8j.8j", 0x2000, 0x9737099e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jrp8k.8k", 0x2000, 0x5252dd97, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "jrp2c.2c", 0x2000, 0x0527ff9b, 2 | BRF_GRA }, // 5 gfx1 - { "jrp2e.2e", 0x2000, 0x73477193, 2 | BRF_GRA }, // 6 - - { "a290-27axv-bxhd.9e", 0x0100, 0x029d35c4, 3 | BRF_GRA }, // 7 proms - { "a290-27axv-cxhd.9f", 0x0100, 0xeee34a79, 3 | BRF_GRA }, // 8 - { "a290-27axv-axhd.9p", 0x0100, 0x9f6ea9d8, 3 | BRF_GRA }, // 9 - - { "a290-27axv-dxhd.7p", 0x0100, 0xa9cc86bf, 4 | BRF_GRA }, // 10 namco - { "a290-27axv-exhd.5s", 0x0100, 0x77245b66, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(jrpacman) -STD_ROM_FN(jrpacman) - -struct BurnDriver BurnDrvJrpacman = { - "jrpacman", NULL, NULL, NULL, "1983", - "Jr. Pac-Man (11/9/83)\0", NULL, "Bally Midway", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, jrpacmanRomInfo, jrpacmanRomName, NULL, NULL, JrpacmanInputInfo, JrpacmanDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Jr. Pac-Man (speedup hack) - -static struct BurnRomInfo jrpacmanfRomDesc[] = { - { "fast_jr.8d", 0x2000, 0x461e8b57, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "jrp8e.8e", 0x2000, 0xec889e94, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jrp8h.8h", 0x2000, 0x35f1fc6e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jrp8j.8j", 0x2000, 0x9737099e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "jrp8k.8k", 0x2000, 0x5252dd97, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "jrp2c.2c", 0x2000, 0x0527ff9b, 2 | BRF_GRA }, // 5 gfx1 - { "jrp2e.2e", 0x2000, 0x73477193, 2 | BRF_GRA }, // 6 - - { "a290-27axv-bxhd.9e", 0x0100, 0x029d35c4, 3 | BRF_GRA }, // 7 proms - { "a290-27axv-cxhd.9f", 0x0100, 0xeee34a79, 3 | BRF_GRA }, // 8 - { "a290-27axv-axhd.9p", 0x0100, 0x9f6ea9d8, 3 | BRF_GRA }, // 9 - - { "a290-27axv-dxhd.7p", 0x0100, 0xa9cc86bf, 4 | BRF_GRA }, // 10 namco - { "a290-27axv-exhd.5s", 0x0100, 0x77245b66, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(jrpacmanf) -STD_ROM_FN(jrpacmanf) - -struct BurnDriver BurnDrvJrpacmanf = { - "jrpacmanf", "jrpacman", NULL, NULL, "1983", - "Jr. Pac-Man (speedup hack)\0", NULL, "hack", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, jrpacmanfRomInfo, jrpacmanfRomName, NULL, NULL, JrpacmanInputInfo, JrpacmanDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - diff --git a/jan/src/burn/drv/pre90s/d_kangaroo.cpp b/jan/src/burn/drv/pre90s/d_kangaroo.cpp deleted file mode 100644 index 2c8db6b88..000000000 --- a/jan/src/burn/drv/pre90s/d_kangaroo.cpp +++ /dev/null @@ -1,749 +0,0 @@ -// FB Alpha Kangaroo driver module -// Based on MAME driver by Ville Laitinen, Aaron Giles - -#include "tiles_generic.h" -#include "z80_intf.h" - -#include "driver.h" -extern "C" { - #include "ay8910.h" -} - -static UINT8 *Mem, *MemEnd, *AllRAM, *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvGfxROM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT32 *DrvVidRAM32; - -static UINT8 GfxRomBank; - -static INT16* pAY8910Buffer[3]; -static INT16 *pFMBuffer; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static UINT8 kangaroo_clock; -static UINT8 soundlatch; -static UINT8 *DrvVidControl; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p1 start" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 2, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 3, "p1 left" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 6, "p1 fire 1"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy2 + 0, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 1, "p2 start" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p2 left" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 6, "p2 fire 1"}, - - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag" }, - {"Reset" , BIT_DIGITAL ,&DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDips + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDips + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Music" }, - {0x10, 0x01, 0x20, 0x20, "Off" }, - {0x10, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x40, 0x00, "Upright" }, - {0x10, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x10, 0x01, 0x80, 0x00, "Off" }, - {0x10, 0x01, 0x80, 0x80, "On" }, - - // Default Values - {0x11, 0xff, 0xff, 0x00, NULL }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x01, 0x00, "3" }, - {0x11, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x11, 0x01, 0x02, 0x00, "Easy" }, - {0x11, 0x01, 0x02, 0x02, "Hard" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x11, 0x01, 0x0c, 0x08, "10000 30000" }, - {0x11, 0x01, 0x0c, 0x0c, "20000 40000" }, - {0x11, 0x01, 0x0c, 0x04, "10000" }, - {0x11, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 0x10, "Coinage" }, - {0x11, 0x01, 0xf0, 0x10, "2C_1C" }, - {0x11, 0x01, 0xf0, 0x20, "A 2C/1C B 1C/3C" }, - {0x11, 0x01, 0xf0, 0x00, "1C_1C" }, - {0x11, 0x01, 0xf0, 0x30, "A 1C/1C B 1C/2C" }, - {0x11, 0x01, 0xf0, 0x40, "A 1C/1C B 1C/3C" }, - {0x11, 0x01, 0xf0, 0x50, "A 1C/1C B 1C/4C" }, - {0x11, 0x01, 0xf0, 0x60, "A 1C/1C B 1C/5C" }, - {0x11, 0x01, 0xf0, 0x70, "A 1C/1C B 1C/6C" }, - {0x11, 0x01, 0xf0, 0x80, "1C_2C" }, - {0x11, 0x01, 0xf0, 0x90, "A 1C/2C B 1C/4C" }, - {0x11, 0x01, 0xf0, 0xa0, "A 1C/2C B 1C/5C" }, - {0x11, 0x01, 0xf0, 0xe0, "A 1C/2C B 1C/6C" }, - {0x11, 0x01, 0xf0, 0xb0, "A 1C/2C B 1C/10C" }, - {0x11, 0x01, 0xf0, 0xc0, "A 1C/2C B 1C/11C" }, - {0x11, 0x01, 0xf0, 0xd0, "A 1C/2C B 1C/12C" }, - {0x11, 0x01, 0xf0, 0xf0, "Free_Play" }, -}; - -STDDIPINFO(Drv) - -static void videoram_write(UINT16 offset, UINT8 data, UINT8 mask) -{ - UINT32 expdata, layermask; - - // data contains 4 2-bit values packed as DCBADCBA; expand these into 4 8-bit values - expdata = 0; - if (data & 0x01) expdata |= 0x00000055; - if (data & 0x10) expdata |= 0x000000aa; - if (data & 0x02) expdata |= 0x00005500; - if (data & 0x20) expdata |= 0x0000aa00; - if (data & 0x04) expdata |= 0x00550000; - if (data & 0x40) expdata |= 0x00aa0000; - if (data & 0x08) expdata |= 0x55000000; - if (data & 0x80) expdata |= 0xaa000000; - - // determine which layers are enabled - layermask = 0; - if (mask & 0x08) layermask |= 0x30303030; - if (mask & 0x04) layermask |= 0xc0c0c0c0; - if (mask & 0x02) layermask |= 0x03030303; - if (mask & 0x01) layermask |= 0x0c0c0c0c; - - // update layers - DrvVidRAM32[offset] = (DrvVidRAM32[offset] & ~layermask) | (expdata & layermask); -} - -static void blitter_execute() -{ - UINT16 src = DrvVidControl[0] | (DrvVidControl[1] << 8); - UINT16 dst = DrvVidControl[2] | (DrvVidControl[3] << 8); - UINT8 height = DrvVidControl[5]; - UINT8 width = DrvVidControl[4]; - UINT8 mask = DrvVidControl[8]; - - // during DMA operations, the top 2 bits are ORed together, as well as the bottom 2 bits - // adjust the mask to account for this - mask |= ((mask & 0x5) << 1) | ((mask & 0xa) >> 1); - - // loop over height, then width - for (INT32 y = 0; y <= height; y++, dst += 256) { - for (INT32 x = 0; x <= width; x++) { - UINT16 effdst = (dst + x) & 0x3fff; - UINT16 effsrc = src++ & 0x1fff; - videoram_write(effdst, DrvGfxROM[0x0000 + effsrc], mask & 0x05); - videoram_write(effdst, DrvGfxROM[0x2000 + effsrc], mask & 0x0a); - } - } -} - -static void set_gfxrombank(UINT8 bank) -{ - GfxRomBank = bank; - ZetMapArea(0xc000, 0xdfff, 0, DrvGfxROM + ((bank & 0x05) ? 0 : 0x2000)); -} - -static void __fastcall kangaroo_main_write(UINT16 address, UINT8 data) -{ - if (address >= 0x8000 && address <= 0xbfff) { - videoram_write(address & 0x3fff, data, DrvVidControl[8]); - return; - } - - if ((address & 0xec00) == 0xe800) address &= 0xfc0f; - if ((address & 0xec00) == 0xec00) address &= 0xff00; - - switch (address) - { - case 0xe800: - case 0xe801: - case 0xe802: - case 0xe803: - case 0xe804: - DrvVidControl[address & 0x0f] = data; - return; - - case 0xe805: - DrvVidControl[address & 0x0f] = data; - - blitter_execute(); - return; - - case 0xe806: - case 0xe807: - DrvVidControl[address & 0x0f] = data; - return; - - case 0xe808: - DrvVidControl[address & 0x0f] = data; - - set_gfxrombank(data); - return; - - case 0xe809: - case 0xe80a: - DrvVidControl[address & 0x0f] = data; - return; - - case 0xec00: - soundlatch = data; - return; - - case 0xed00: - // coin counter - return; - } -} - -static UINT8 __fastcall kangaroo_main_read(UINT16 address) -{ - if ((address & 0xec00) == 0xe400) address &= 0xfc00; - if ((address & 0xec00) == 0xec00) address &= 0xff00; - - switch (address) - { - case 0xe400: - return DrvDips[1]; - - case 0xec00: // in0 - { - UINT8 ret = DrvDips[0]; - if (DrvJoy1[7]) ret |= 0x01; // service - if (DrvJoy1[1]) ret |= 0x02; - if (DrvJoy2[1]) ret |= 0x04; - if (DrvJoy1[0]) ret |= 0x08; - if (DrvJoy2[0]) ret |= 0x10; - return ret; - } - - case 0xed00: // in1 - { - UINT8 ret = 0; - if (DrvJoy1[2]) ret |= 0x01; - if (DrvJoy1[3]) ret |= 0x02; - if (DrvJoy1[4]) ret |= 0x04; - if (DrvJoy1[5]) ret |= 0x08; - if (DrvJoy1[6]) ret |= 0x10; - // if (DrvJoy1[7]) ret |= 0x80; // service? - return ret; - } - - - case 0xee00: // in2 - { - UINT8 ret = 0; - if (DrvJoy2[2]) ret |= 0x01; - if (DrvJoy2[3]) ret |= 0x02; - if (DrvJoy2[4]) ret |= 0x04; - if (DrvJoy2[5]) ret |= 0x08; - if (DrvJoy2[6]) ret |= 0x10; - return ret; - } - - case 0xef00: - return ++kangaroo_clock & 0x0f; - } - - return 0; -} - -static UINT8 __fastcall kangaroo_sound_read(UINT16 address) -{ - switch (address & 0xf000) - { - case 0x6000: - return soundlatch; - } - - return 0; -} - -static void __fastcall kangaroo_sound_write(UINT16 address, UINT8 data) -{ - switch (address & 0xf000) - { - case 0x7000: - AY8910Write(0, 1, data); - return; - - case 0x8000: - AY8910Write(0, 0, data); - return; - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; - - Next = Mem; Next += 0x10000; // buffer - - DrvZ80ROM0 = Next; Next += 0x06000; - DrvZ80ROM1 = Next; Next += 0x01000; - DrvGfxROM = Next; Next += 0x04000; - - DrvPalette = (UINT32*)Next; Next += 0x00008 * sizeof(UINT32); - - AllRAM = Next; - - DrvZ80RAM0 = Next; Next += 0x00400; - DrvZ80RAM1 = Next; Next += 0x00400; - - DrvVidRAM32 = (UINT32*)Next; Next += 0x4000 * sizeof(UINT32); - - DrvVidControl = Next; Next += 16; - - RamEnd = Next; - - pFMBuffer = (INT16 *)Next; Next += nBurnSoundLen * 3 * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 8; i++) { - DrvPalette[i] = BurnHighCol((i & 4) ? 0xff : 0, (i & 2) ? 0xff : 0, (i & 1) ? 0xff : 0, 0); - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRAM, 0, RamEnd - AllRAM); - - ZetOpen(0); - set_gfxrombank(0x05 /*default*/); - ZetReset(); - ZetNmi(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - soundlatch = 0; - kangaroo_clock = 0; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - for (INT32 i = 0; i < 3; i++) - pAY8910Buffer[i] = pFMBuffer + nBurnSoundLen * i; - - // kangaroo - if (strncmp ("kangaro", BurnDrvGetTextA(DRV_NAME), 7) == 0) - { - for (INT32 i = 0; i < 6; i++) - if (BurnLoadRom(DrvZ80ROM0 + i * 0x1000, 0 + i, 0)) return 1; - - if (BurnLoadRom(DrvZ80ROM1, 6, 0)) return 1; - - for (INT32 i = 0; i < 4; i++) - if (BurnLoadRom(DrvGfxROM + i * 0x1000, 7 + i, 0)) return 1; - } - // funkyfish - else - { - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvZ80ROM0 + i * 0x1000, 0 + i, 0)) return 1; - if (BurnLoadRom(DrvGfxROM + i * 0x1000, 5 + i, 0)) return 1; - } - - if (BurnLoadRom(DrvZ80ROM1, 4, 0)) return 1; - } - - DrvPaletteInit(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM0); - - ZetMapArea(0xc000, 0xdfff, 0, DrvGfxROM ); // Gfx are banked here - - ZetMapArea(0xe000, 0xe3ff, 0, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe3ff, 1, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe3ff, 2, DrvZ80RAM0); - - ZetSetWriteHandler(kangaroo_main_write); - ZetSetReadHandler(kangaroo_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x0fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x0fff, 2, DrvZ80ROM1); - - // mirrored 4x - ZetMapArea(0x4000, 0x43ff, 0, DrvZ80RAM1); - ZetMapArea(0x4000, 0x43ff, 1, DrvZ80RAM1); - ZetMapArea(0x4000, 0x43ff, 2, DrvZ80RAM1); - - ZetSetWriteHandler(kangaroo_sound_write); - ZetSetReadHandler(kangaroo_sound_read); - ZetSetInHandler(kangaroo_sound_read); - ZetSetOutHandler(kangaroo_sound_write); - ZetClose(); - - AY8910Init(0, 1250000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnFree (Mem); - - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - - return 0; -} - - -static INT32 DrvDraw() -{ - UINT8 scrolly = DrvVidControl[6]; - UINT8 scrollx = DrvVidControl[7]; - UINT8 maska = (DrvVidControl[10] & 0x28) >> 3; - UINT8 maskb = (DrvVidControl[10] & 0x07) >> 0; - UINT8 xora = (DrvVidControl[9] & 0x20) ? 0xff : 0x00; - UINT8 xorb = (DrvVidControl[9] & 0x10) ? 0xff : 0x00; - UINT8 enaa = (DrvVidControl[9] & 0x08); - UINT8 enab = (DrvVidControl[9] & 0x04); - UINT8 pria = (~DrvVidControl[9] & 0x02); - UINT8 prib = (~DrvVidControl[9] & 0x01); - INT32 x, y; - - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - // iterate over pixels - for (y = 0; y < nScreenHeight; y++) - { - UINT16 *dest = pTransDraw + (y * nScreenWidth); - - for (x = 0; x < nScreenWidth; x += 2) - { - UINT8 effxa = scrollx + ((x / 2) ^ xora); - UINT8 effya = scrolly + (y ^ xora); - UINT8 effxb = (x / 2) ^ xorb; - UINT8 effyb = y ^ xorb; - UINT8 pixa = (DrvVidRAM32[effya + 256 * (effxa / 4)] >> (8 * (effxa % 4) + 0)) & 0x0f; - UINT8 pixb = (DrvVidRAM32[effyb + 256 * (effxb / 4)] >> (8 * (effxb % 4) + 4)) & 0x0f; - UINT8 finalpens; - - // for each layer, contribute bits if (a) enabled, and (b) either has priority or the opposite plane is 0 - finalpens = 0; - if (enaa && (pria || pixb == 0)) - finalpens |= pixa; - if (enab && (prib || pixa == 0)) - finalpens |= pixb; - - // store the first of two pixels, which is always full brightness - dest[x + 0] = finalpens & 7; - - // KOS1 alternates at 5MHz, offset from the pixel clock by 1/2 clock - // when 0, it enables the color mask for pixels with Z = 0 - finalpens = 0; - if (enaa && (pria || pixb == 0)) - { - if (!(pixa & 0x08)) pixa &= maska; - finalpens |= pixa; - } - if (enab && (prib || pixa == 0)) - { - if (!(pixb & 0x08)) pixb &= maskb; - finalpens |= pixb; - } - - // store the second of two pixels, which is affected by KOS1 and the A/B masks - dest[x + 1] = finalpens & 7; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - if ( pnMin ) *pnMin = 0x029671; - - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { // Scan all memory, devices & variables - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRAM; - ba.nLen = MemEnd-AllRAM; - ba.szName = "All Ram"; - BurnAcb(&ba); - - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(kangaroo_clock); - SCAN_VAR(GfxRomBank); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - set_gfxrombank(GfxRomBank); - ZetClose(); - } - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 2500000 / 60, 1250000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == (nInterleave - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == (nInterleave - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -// Funky Fish - -static struct BurnRomInfo fnkyfishRomDesc[] = { - { "tvg_64.0", 0x1000, 0xaf728803, 1 | BRF_ESS | BRF_PRG }, // 0 Main Z80 Code - { "tvg_65.1", 0x1000, 0x71959e6b, 1 | BRF_ESS | BRF_PRG }, // 1 - { "tvg_66.2", 0x1000, 0x5ccf68d4, 1 | BRF_ESS | BRF_PRG }, // 2 - { "tvg_67.3", 0x1000, 0x938ff36f, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "tvg_68.8", 0x1000, 0xd36bb2be, 2 | BRF_ESS | BRF_PRG }, // 4 Sound Z80 Code - - { "tvg_69.v0", 0x1000, 0xcd532d0b, 3 | BRF_GRA }, // 5 Graphics - { "tvg_71.v2", 0x1000, 0xa59c9713, 3 | BRF_GRA }, // 6 - { "tvg_70.v1", 0x1000, 0xfd308ef1, 3 | BRF_GRA }, // 7 - { "tvg_72.v3", 0x1000, 0x6ae9b584, 3 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(fnkyfish) -STD_ROM_FN(fnkyfish) - -struct BurnDriver BurnDrvfnkyfish = { - "fnkyfish", NULL, NULL, NULL, "1981", - "Funky Fish\0", NULL, "Sun Electronics", "Kangaroo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, fnkyfishRomInfo, fnkyfishRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x08, 256, 512, 3, 4 -}; - - -// Kangaroo - -static struct BurnRomInfo kangarooRomDesc[] = { - { "tvg_75.0", 0x1000, 0x0d18c581, 1 | BRF_ESS | BRF_PRG }, // 0 Main Z80 Code - { "tvg_76.1", 0x1000, 0x5978d37a, 1 | BRF_ESS | BRF_PRG }, // 1 - { "tvg_77.2", 0x1000, 0x522d1097, 1 | BRF_ESS | BRF_PRG }, // 2 - { "tvg_78.3", 0x1000, 0x063da970, 1 | BRF_ESS | BRF_PRG }, // 3 - { "tvg_79.4", 0x1000, 0x9e5cf8ca, 1 | BRF_ESS | BRF_PRG }, // 4 - { "tvg_80.5", 0x1000, 0x2fc18049, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "tvg_81.8", 0x1000, 0xfb449bfd, 2 | BRF_ESS | BRF_PRG }, // 6 Sound Z80 Code - - { "tvg_83.v0", 0x1000, 0xc0446ca6, 3 | BRF_GRA }, // 7 Graphics - { "tvg_85.v2", 0x1000, 0x72c52695, 3 | BRF_GRA }, // 8 - { "tvg_84.v1", 0x1000, 0xe4cb26c2, 3 | BRF_GRA }, // 9 - { "tvg_86.v3", 0x1000, 0x9e6a599f, 3 | BRF_GRA }, // 10 - - { "tvg_82.12", 0x0800, 0x57766f69, 0 | BRF_ESS | BRF_PRG }, // 11 MB8841 custom microcontroller data (unused) - - { "mb8841.ic29", 0x0800, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, // 12 MB8841 custom microcontroller prg (unused) -}; - -STD_ROM_PICK(kangaroo) -STD_ROM_FN(kangaroo) - -struct BurnDriver BurnDrvkangaroo = { - "kangaroo", NULL, NULL, NULL, "1982", - "Kangaroo\0", NULL, "Sun Electronics", "Kangaroo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, kangarooRomInfo, kangarooRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x08, 256, 512, 3, 4 -}; - - -// Kangaroo (Atari) -static struct BurnRomInfo kangaroaRomDesc[] = { - { "136008-101.ic7", 0x1000, 0x0d18c581, 1 | BRF_ESS | BRF_PRG }, // 0 Main Z80 Code - { "136008-102.ic8", 0x1000, 0x5978d37a, 1 | BRF_ESS | BRF_PRG }, // 1 - { "136008-103.ic9", 0x1000, 0x522d1097, 1 | BRF_ESS | BRF_PRG }, // 2 - { "136008-104.ic10", 0x1000, 0x063da970, 1 | BRF_ESS | BRF_PRG }, // 3 - { "136008-105.ic16", 0x1000, 0x82a26c7d, 1 | BRF_ESS | BRF_PRG }, // 4 - { "136008-106.ic17", 0x1000, 0x3dead542, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "136008-107.ic24", 0x1000, 0xfb449bfd, 2 | BRF_ESS | BRF_PRG }, // 6 Sound Z80 Code - - { "136008-108.ic76", 0x1000, 0xc0446ca6, 3 | BRF_GRA }, // 7 Graphics - { "136008-110.ic77", 0x1000, 0x72c52695, 3 | BRF_GRA }, // 8 - { "136008-109.ic52", 0x1000, 0xe4cb26c2, 3 | BRF_GRA }, // 9 - { "136008-111.ic53", 0x1000, 0x9e6a599f, 3 | BRF_GRA }, // 10 - - { "136008-112.ic28", 0x0800, 0x57766f69, 0 | BRF_ESS | BRF_PRG }, // 11 MB8841 custom microcontroller (unused) - - { "mb8841.ic29", 0x0800, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, // 12 MB8841 custom microcontroller prg (unused) -}; - -STD_ROM_PICK(kangaroa) -STD_ROM_FN(kangaroa) - -struct BurnDriver BurnDrvkangaroa = { - "kangarooa", "kangaroo", NULL, NULL, "1982", - "Kangaroo (Atari)\0", NULL, "[Sun Electronics] (Atari license)", "Kangaroo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, kangaroaRomInfo, kangaroaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x08, 256, 512, 3, 4 -}; - - -// Kangaroo (bootleg) - -static struct BurnRomInfo kangarobRomDesc[] = { - { "k1.ic7", 0x1000, 0x0d18c581, 1 | BRF_ESS | BRF_PRG }, // 0 Main Z80 Code - { "k2.ic8", 0x1000, 0x5978d37a, 1 | BRF_ESS | BRF_PRG }, // 1 - { "k3.ic9", 0x1000, 0x522d1097, 1 | BRF_ESS | BRF_PRG }, // 2 - { "k4.ic10", 0x1000, 0x063da970, 1 | BRF_ESS | BRF_PRG }, // 3 - { "k5.ic16", 0x1000, 0x9e5cf8ca, 1 | BRF_ESS | BRF_PRG }, // 4 - { "k6.ic17", 0x1000, 0x7644504a, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "k7.ic24", 0x1000, 0xfb449bfd, 2 | BRF_ESS | BRF_PRG }, // 6 Sound Z80 Code - - { "k10.ic76", 0x1000, 0xc0446ca6, 3 | BRF_GRA }, // 7 Graphics - { "k11.ic77", 0x1000, 0x72c52695, 3 | BRF_GRA }, // 8 - { "k8.ic52", 0x1000, 0xe4cb26c2, 3 | BRF_GRA }, // 9 - { "k9.ic53", 0x1000, 0x9e6a599f, 3 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(kangarob) -STD_ROM_FN(kangarob) - -struct BurnDriver BurnDrvkangarob = { - "kangaroob", "kangaroo", NULL, NULL, "1982", - "Kangaroo (bootleg)\0", NULL, "Bootleg", "Kangaroo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, kangarobRomInfo, kangarobRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x08, 256, 512, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_kncljoe.cpp b/jan/src/burn/drv/pre90s/d_kncljoe.cpp deleted file mode 100644 index 863bf1788..000000000 --- a/jan/src/burn/drv/pre90s/d_kncljoe.cpp +++ /dev/null @@ -1,810 +0,0 @@ -// FB Alpha Knuckle Joe driver module -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "m6800_intf.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvM6803ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvM6803RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *sprite_bank; -static UINT8 *tile_bank; -static UINT16 *scrollx; - -static UINT8 m6803_port1_data; -static UINT8 m6803_port2_data; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo KncljoeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Kncljoe) - -static struct BurnDIPInfo KncljoeDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x18, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x18, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Infinite Energy (Cheat)" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play (Not Working)" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x02, 0x02, "Upright" }, - {0x12, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x04, 0x04, "3" }, - {0x12, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x18, 0x18, "10k and every 20k" }, - {0x12, 0x01, 0x18, 0x10, "20k and every 40k" }, - {0x12, 0x01, 0x18, 0x08, "30k and every 60k" }, - {0x12, 0x01, 0x18, 0x00, "40k and every 80k" }, - - {0 , 0xfe, 0 , 4, "Difficulty?" }, - {0x12, 0x01, 0x60, 0x60, "Easy" }, - {0x12, 0x01, 0x60, 0x40, "Medium" }, - {0x12, 0x01, 0x60, 0x20, "Hard" }, - {0x12, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kncljoe) - -static void __fastcall kncljoe_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xd000: - *scrollx = (*scrollx & 0x0100) | ((data & 0xff) << 0); - return; - - case 0xd001: - *scrollx = (*scrollx & 0x00ff) | ((data & 0x01) << 8); - return; - - case 0xd800: - if (data & 0x80) { - M6803SetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - *soundlatch = data; - } - return; - - case 0xd801: { - *flipscreen = (data & 0x01) >> 0; - - if (((data & 0x04) >> 2) != *sprite_bank) { - memset (DrvZ80RAM + 0x0100, 0, 0x180); - } - - *sprite_bank= (data & 0x04) >> 2; - *tile_bank = (data & 0x10) >> 4; - } - return; - - case 0xd802: - case 0xd803: - SN76496Write(address & 1, data); - return; - } -} - -static UINT8 __fastcall kncljoe_main_read(UINT16 address) -{ - switch (address) - { - case 0xd800: - return DrvInputs[0]; - - case 0xd801: - return DrvInputs[1]; - - case 0xd802: - return DrvInputs[2]; - - case 0xd803: - return DrvDips[0]; - - case 0xd804: - return DrvDips[1]; - - case 0xd807: // nop - case 0xd817: - return 0; - } - - return 0; -} - -static UINT8 kncljoe_sound_read(UINT16 address) -{ - address &= 0x7fff; - - if (address < 0x20) { - return m6803_internal_registers_r(address & 0x1f); - } - - if (address < 0x80) { - return 0; - } - - if ((address & 0xff80) == 0x80) { - return DrvM6803RAM[address & 0x7f]; - } - - return 0; -} - -static void kncljoe_sound_write(UINT16 address, UINT8 data) -{ - address &= 0x7fff; - - if (address < 0x20) { - m6803_internal_registers_w(address & 0x1f, data); - return; - } - - if (address < 0x80) { - return; - } - - if ((address & 0xff80) == 0x80) { - DrvM6803RAM[address & 0x7f] = data; - return; - } - - if ((address & 0x7000) == 0x1000) { - M6803SetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static void kncljoe_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case 0x100: - m6803_port1_data = data; - return; - - case 0x101: - if ((m6803_port2_data & 0x09) == 0x09 && (data & 0x01) == 0x00) { - AY8910Write(0, (~m6803_port2_data >> 2) & 1, m6803_port1_data); - } - m6803_port2_data = data; - return; - } -} - -static UINT8 kncljoe_sound_read_port(UINT16 port) -{ - switch (port & 0x1ff) - { - case 0x100: - if (m6803_port2_data & 0x08) { - return AY8910Read(0); - } - return 0xff; - } - - return 0; -} - -static UINT8 ay8910_port_A_read(unsigned int) -{ - return *soundlatch; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - -// M6803Open(0); - M6803Reset(); -// M6803Close(); - - AY8910Reset(0); - - m6803_port1_data = 0; - m6803_port2_data = 0; - - return 0; -} - -static INT32 DrvGfxDecode(UINT8 *gfx, INT32 len, INT32 size) -{ - INT32 Planes[3] = { ((len / 3) * 8) * 2, ((len / 3) * 8) * 1, ((len / 3) * 8) * 0 }; - INT32 XOffs[16] = { STEP8(0,1), STEP8(64,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(128,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, gfx, len); - - GfxDecode(((len / 3) * 8) / (size * size), 3, size, size, Planes, XOffs, YOffs, size * size, tmp, gfx); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pal[0x10]; - - for (INT32 i = 0; i < 0x10; i++) - { - INT32 bit0 = 0; - INT32 bit1 = (DrvColPROM[i + 0x300] >> 6) & 0x01; - INT32 bit2 = (DrvColPROM[i + 0x300] >> 7) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i + 0x300] >> 3) & 0x01; - bit1 = (DrvColPROM[i + 0x300] >> 4) & 0x01; - bit2 = (DrvColPROM[i + 0x300] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i + 0x300] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x300] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x300] >> 2) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - pal[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x80; i++) - { - INT32 r = DrvColPROM[i + 0x000] & 0x0f; - INT32 g = DrvColPROM[i + 0x100] & 0x0f; - INT32 b = DrvColPROM[i + 0x200] & 0x0f; - - DrvPalette[0x00 + i] = BurnHighCol((r << 4) | r, (g << 4) | g, (b << 4) | b, 0); - - DrvPalette[0x80 + i] = pal[DrvColPROM[i + 0x320] & 0x0f]; - } - - DrvRecalc = 1; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - DrvM6803ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x080000; - - DrvColPROM = Next; Next += 0x000500; - - DrvPalette = (unsigned int*)Next; Next += 0x0100 * sizeof(INT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000800; - - DrvM6803RAM = Next; Next += 0x000080; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - sprite_bank = Next; Next += 0x000001; - tile_bank = Next; Next += 0x000001; - - scrollx = (UINT16*)Next; Next += 0x000002; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6803ROM + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x28000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00320, 17, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x0c000, 8); - DrvGfxDecode(DrvGfxROM1, 0x30000, 16); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xcfff, 0, DrvVidRAM); - ZetMapArea(0xc000, 0xcfff, 1, DrvVidRAM); - ZetMapArea(0xc000, 0xcfff, 2, DrvVidRAM); - ZetMapArea(0xe800, 0xefff, 0, DrvSprRAM); - ZetMapArea(0xe800, 0xefff, 1, DrvSprRAM); - ZetMapArea(0xe800, 0xefff, 2, DrvSprRAM); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80RAM); - ZetSetWriteHandler(kncljoe_main_write); - ZetSetReadHandler(kncljoe_main_read); - ZetClose(); - - M6803Init(1); -// M6803Open(0); - M6803MapMemory(DrvM6803ROM, 0x6000, 0x7fff, MAP_ROM); - M6803MapMemory(DrvM6803ROM, 0xe000, 0xffff, MAP_ROM); - M6803SetReadHandler(kncljoe_sound_read); - M6803SetWriteHandler(kncljoe_sound_write); - M6803SetWritePortHandler(kncljoe_sound_write_port); - M6803SetReadPortHandler(kncljoe_sound_read_port); -// M6803Close(); - - AY8910Init(0, 894886, nBurnSoundRate, &ay8910_port_A_read, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - SN76489Init(0, 3579545, 1); - SN76489Init(1, 3579545, 1); - SN76496SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6803Exit(); - ZetExit(); - - AY8910Exit(0); - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - if (sy < 0xc0) { - sx -= (*scrollx + 8) & 0x1ff; - if (sx < -7) sx += 512; - } else { - sx -= 8; - } - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvVidRAM[offs * 2 + 1]; - INT32 code = DrvVidRAM[offs * 2 + 0] | ((attr & 0xc0) << 2) | (*tile_bank << 10); - - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x20; - INT32 flipy = attr & 0x10; - - if (*flipscreen) { - flipx = !flipx; - sx = 218 - sx; - } else { - flipy = !flipy; - sy ^= 0xf8; - } - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - UINT16 *pDraw = pTransDraw; - - if (*flipscreen == 0) { - pDraw += 64 * nScreenWidth; - } - nScreenHeight -= 64; - - for (INT32 i = 0; i < 4; i++) - { - for (INT32 j = 0x7c; j >= 0; j -= 4) - { - INT32 offs = ((~i & 1) << 8) | ((~i & 2) << 6) | j; - - INT32 sy = DrvSprRAM[offs + 0] - 64; - INT32 attr = DrvSprRAM[offs + 1]; - INT32 code = DrvSprRAM[offs + 2] | ((attr & 0x10) << 5) | ((attr & 0x20) << 3) | (*sprite_bank << 10); - INT32 sx = DrvSprRAM[offs + 3]; - - INT32 flipx = attr & 0x40; - INT32 flipy = ~attr & 0x80; - INT32 color = attr & 0x0f; - - if (*flipscreen) - { - flipx = !flipx; - flipy = !flipy; - sx = 240 - sx; - sy = 240 - sy; - } - - if (sx >= 248) sx -= 256; - if (code >= 0x600) code &= 0x5ff; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pDraw, code, sx - 8, sy, color, 3, 0, 0x80, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pDraw, code, sx - 8, sy, color, 3, 0, 0x80, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pDraw, code, sx - 8, sy, color, 3, 0, 0x80, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pDraw, code, sx - 8, sy, color, 3, 0, 0x80, DrvGfxROM1); - } - } - } - } - - nScreenHeight += 64; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 66; // for sound nmi - INT32 nCyclesTotal[2] = { 6000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); -// M6803Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment; - - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nSegment); - if (i == 60) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - - nSegment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += M6803Run(nSegment); - M6803SetIRQLine(M6803_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - } - -// M6803Close(); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - M6803Scan(nAction); - - AY8910Scan(nAction, pnMin); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(m6803_port1_data); - SCAN_VAR(m6803_port2_data); - } - - return 0; -} - - -// Knuckle Joe (set 1) - -static struct BurnRomInfo kncljoeRomDesc[] = { - { "kj-1.bin", 0x4000, 0x4e4f5ff2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "kj-2.bin", 0x4000, 0xcb11514b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "kj-3.bin", 0x4000, 0x0f50697b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "kj-13.bin", 0x2000, 0x0a0be3f5, 2 | BRF_PRG | BRF_ESS }, // 3 M6803 Code - - { "kj-10.bin", 0x4000, 0x74d3ba33, 3 | BRF_GRA }, // 4 Tiles - { "kj-11.bin", 0x4000, 0x8ea01455, 3 | BRF_GRA }, // 5 - { "kj-12.bin", 0x4000, 0x33367c41, 3 | BRF_GRA }, // 6 - - { "kj-4.bin", 0x8000, 0xa499ea10, 4 | BRF_GRA }, // 7 Sprites - { "kj-6.bin", 0x8000, 0x815f5c0a, 4 | BRF_GRA }, // 8 - { "kj-5.bin", 0x8000, 0x11111759, 4 | BRF_GRA }, // 9 - { "kj-7.bin", 0x4000, 0x121fcccb, 4 | BRF_GRA }, // 10 - { "kj-9.bin", 0x4000, 0xaffbe3eb, 4 | BRF_GRA }, // 11 - { "kj-8.bin", 0x4000, 0xe057e72a, 4 | BRF_GRA }, // 12 - - { "kjclr1.bin", 0x0100, 0xc3378ac2, 5 | BRF_GRA }, // 13 Color PROMs - { "kjclr2.bin", 0x0100, 0x2126da97, 5 | BRF_GRA }, // 14 - { "kjclr3.bin", 0x0100, 0xfde62164, 5 | BRF_GRA }, // 15 - { "kjprom5.bin", 0x0020, 0x5a81dd9f, 5 | BRF_GRA }, // 16 - { "kjprom4.bin", 0x0100, 0x48dc2066, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(kncljoe) -STD_ROM_FN(kncljoe) - -struct BurnDriver BurnDrvKncljoe = { - "kncljoe", NULL, NULL, NULL, "1985", - "Knuckle Joe (set 1)\0", NULL, "[Seibu Kaihatsu] (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, kncljoeRomInfo, kncljoeRomName, NULL, NULL, KncljoeInputInfo, KncljoeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 256, 3, 4 -}; - - -// Knuckle Joe (set 2) - -static struct BurnRomInfo kncljoeaRomDesc[] = { - { "kj01.bin", 0x4000, 0xf251019e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "kj-2.bin", 0x4000, 0xcb11514b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "kj-3.bin", 0x4000, 0x0f50697b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "kj-13.bin", 0x2000, 0x0a0be3f5, 2 | BRF_PRG | BRF_ESS }, // 3 M6803 Code - - { "kj-10.bin", 0x4000, 0x74d3ba33, 3 | BRF_GRA }, // 4 Tiles - { "kj-11.bin", 0x4000, 0x8ea01455, 3 | BRF_GRA }, // 5 - { "kj-12.bin", 0x4000, 0x33367c41, 3 | BRF_GRA }, // 6 - - { "kj-4.bin", 0x8000, 0xa499ea10, 4 | BRF_GRA }, // 7 Sprites - { "kj-6.bin", 0x8000, 0x815f5c0a, 4 | BRF_GRA }, // 8 - { "kj-5.bin", 0x8000, 0x11111759, 4 | BRF_GRA }, // 9 - { "kj-7.bin", 0x4000, 0x121fcccb, 4 | BRF_GRA }, // 10 - { "kj-9.bin", 0x4000, 0xaffbe3eb, 4 | BRF_GRA }, // 11 - { "kj-8.bin", 0x4000, 0xe057e72a, 4 | BRF_GRA }, // 12 - - { "kjclr1.bin", 0x0100, 0xc3378ac2, 5 | BRF_GRA }, // 13 Color PROMs - { "kjclr2.bin", 0x0100, 0x2126da97, 5 | BRF_GRA }, // 14 - { "kjclr3.bin", 0x0100, 0xfde62164, 5 | BRF_GRA }, // 15 - { "kjprom5.bin", 0x0020, 0x5a81dd9f, 5 | BRF_GRA }, // 16 - { "kjprom4.bin", 0x0100, 0x48dc2066, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(kncljoea) -STD_ROM_FN(kncljoea) - -struct BurnDriver BurnDrvKncljoea = { - "kncljoea", "kncljoe", NULL, NULL, "1985", - "Knuckle Joe (set 2)\0", NULL, "[Seibu Kaihatsu] (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, kncljoeaRomInfo, kncljoeaRomName, NULL, NULL, KncljoeInputInfo, KncljoeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 256, 3, 4 -}; - - -// Bone Crusher - -static struct BurnRomInfo bcrusherRomDesc[] = { - { "bcrush1.bin", 0x4000, 0xe8979196, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "bcrush2.bin", 0x4000, 0x1be4c731, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bcrush3.bin", 0x4000, 0x0772d993, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "kj-13.bin", 0x2000, 0x0a0be3f5, 2 | BRF_PRG | BRF_ESS }, // 3 M6803 Code - - { "bcrush10.bin", 0x4000, 0xa62f4572, 3 | BRF_GRA }, // 4 Tiles - { "bcrush11.bin", 0x4000, 0x79cc5644, 3 | BRF_GRA }, // 5 - { "bcrush12.bin", 0x4000, 0x8f09641d, 3 | BRF_GRA }, // 6 - - { "kj-4.bin", 0x8000, 0xa499ea10, 4 | BRF_GRA }, // 7 Sprites - { "kj-6.bin", 0x8000, 0x815f5c0a, 4 | BRF_GRA }, // 8 - { "kj-5.bin", 0x8000, 0x11111759, 4 | BRF_GRA }, // 9 - { "kj-7.bin", 0x4000, 0x121fcccb, 4 | BRF_GRA }, // 10 - { "kj-9.bin", 0x4000, 0xaffbe3eb, 4 | BRF_GRA }, // 11 - { "kj-8.bin", 0x4000, 0xe057e72a, 4 | BRF_GRA }, // 12 - - { "kjclr1.bin", 0x0100, 0xc3378ac2, 5 | BRF_GRA }, // 13 Color PROMs - { "kjclr2.bin", 0x0100, 0x2126da97, 5 | BRF_GRA }, // 14 - { "kjclr3.bin", 0x0100, 0xfde62164, 5 | BRF_GRA }, // 15 - { "kjprom5.bin", 0x0020, 0x5a81dd9f, 5 | BRF_GRA }, // 16 - { "kjprom4.bin", 0x0100, 0x48dc2066, 5 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(bcrusher) -STD_ROM_FN(bcrusher) - -struct BurnDriver BurnDrvBcrusher = { - "bcrusher", "kncljoe", NULL, NULL, "1985", - "Bone Crusher\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, bcrusherRomInfo, bcrusherRomName, NULL, NULL, KncljoeInputInfo, KncljoeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_kyugo.cpp b/jan/src/burn/drv/pre90s/d_kyugo.cpp deleted file mode 100644 index 37e03d624..000000000 --- a/jan/src/burn/drv/pre90s/d_kyugo.cpp +++ /dev/null @@ -1,2674 +0,0 @@ -// FB Alpha Kyugo driver module -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "z80_intf.h" - -#include "driver.h" -extern "C" { - #include "ay8910.h" -} - -static UINT8 KyugoInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 KyugoInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 KyugoInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 KyugoDip[2] = {0, 0}; -static UINT8 KyugoInput[3] = {0x00, 0x00, 0x00}; -static UINT8 KyugoReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *KyugoZ80Rom1 = NULL; -static UINT8 *KyugoZ80Rom2 = NULL; -static UINT8 *KyugoSharedZ80Ram = NULL; -static UINT8 *KyugoZ80Ram2 = NULL; -static UINT8 *KyugoSprite1Ram = NULL; -static UINT8 *KyugoSprite2Ram = NULL; -static UINT8 *KyugoFgVideoRam = NULL; -static UINT8 *KyugoBgVideoRam = NULL; -static UINT8 *KyugoBgAttrRam = NULL; -static UINT8 *KyugoPromRed = NULL; -static UINT8 *KyugoPromGreen = NULL; -static UINT8 *KyugoPromBlue = NULL; -static UINT8 *KyugoPromCharLookup = NULL; -static UINT8 *KyugoChars = NULL; -static UINT8 *KyugoTiles = NULL; -static UINT8 *KyugoSprites = NULL; -static UINT8 *KyugoTempRom = NULL; -static UINT32 *KyugoPalette = NULL; -static INT16* pFMBuffer; -static INT16* pAY8910Buffer[6]; - -static UINT8 KyugoIRQEnable; -static UINT8 KyugoSubCPUEnable; -static UINT8 KyugoFgColour; -static UINT8 KyugoBgPaletteBank; -static UINT8 KyugoBgScrollXHi; -static UINT8 KyugoBgScrollXLo; -static UINT8 KyugoBgScrollY; -static UINT8 KyugoFlipScreen; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static INT32 KyugoNumZ80Rom1; -static INT32 KyugoNumZ80Rom2; -static INT32 KyugoNumSpriteRom; -static INT32 KyugoSizeZ80Rom1; -static INT32 KyugoSizeZ80Rom2; -static INT32 KyugoSizeSpriteRom; - -static struct BurnInputInfo KyugoInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , KyugoInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , KyugoInputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , KyugoInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , KyugoInputPort0 + 4, "p2 start" }, - - {"Up" , BIT_DIGITAL , KyugoInputPort1 + 2, "p1 up" }, - {"Down" , BIT_DIGITAL , KyugoInputPort1 + 3, "p1 down" }, - {"Left" , BIT_DIGITAL , KyugoInputPort1 + 0, "p1 left" }, - {"Right" , BIT_DIGITAL , KyugoInputPort1 + 1, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , KyugoInputPort1 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , KyugoInputPort1 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , KyugoInputPort2 + 2, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , KyugoInputPort2 + 3, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , KyugoInputPort2 + 0, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , KyugoInputPort2 + 1, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , KyugoInputPort2 + 4, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , KyugoInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &KyugoReset , "reset" }, - {"Service" , BIT_DIGITAL , KyugoInputPort0 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH, KyugoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, KyugoDip + 1 , "dip" }, -}; - - -STDINPUTINFO(Kyugo) - -inline void KyugoClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -inline void KyugoMakeInputs() -{ - // Reset Inputs - KyugoInput[0] = KyugoInput[1] = KyugoInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - KyugoInput[0] |= (KyugoInputPort0[i] & 1) << i; - KyugoInput[1] |= (KyugoInputPort1[i] & 1) << i; - KyugoInput[2] |= (KyugoInputPort2[i] & 1) << i; - } - - // Clear Opposites - KyugoClearOpposites(&KyugoInput[1]); - KyugoClearOpposites(&KyugoInput[2]); -} - -static struct BurnDIPInfo AirwolfDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xbb, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "4" }, - {0x12, 0x01, 0x03, 0x02, "5" }, - {0x12, 0x01, 0x03, 0x01, "6" }, - {0x12, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Slow Motion" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Sound Test" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "5 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, -}; - -STDDIPINFO(Airwolf) - -static struct BurnDIPInfo SkywolfDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xbb, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Slow Motion" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Sound Test" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "5 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, -}; - -STDDIPINFO(Skywolf) - -static struct BurnDIPInfo FlashgalDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xaf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x12, 0x01, 0x04, 0x04, "Every 50000" }, - {0x12, 0x01, 0x04, 0x00, "Every 70000" }, - - {0 , 0xfe, 0 , 2 , "Slow Motion" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Sound Test" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "5 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, -}; - -STDDIPINFO(Flashgal) - -static struct BurnDIPInfo GyrodineDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x12, 0x01, 0x10, 0x10, "Easy" }, - {0x12, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x12, 0x01, 0x20, 0x20, "20000 50000" }, - {0x12, 0x01, 0x20, 0x00, "40000 70000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "5 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, -}; - -STDDIPINFO(Gyrodine) - -static struct BurnDIPInfo LegendDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life / Continue" }, - {0x12, 0x01, 0x04, 0x04, "Every 50000 / No" }, - {0x12, 0x01, 0x04, 0x00, "Every 70000 / Yes" }, - - {0 , 0xfe, 0 , 2 , "Slow Motion" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Sound Test" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "5 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, -}; - -STDDIPINFO(Legend) - -static struct BurnDIPInfo SonofphxDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xbf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x12, 0x01, 0x04, 0x04, "Every 50000" }, - {0x12, 0x01, 0x04, 0x00, "Every 70000" }, - - {0 , 0xfe, 0 , 2 , "Slow Motion" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Sound Test" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "5 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0xc0, 0xc0, "Easy" }, - {0x13, 0x01, 0xc0, 0x80, "Normal" }, - {0x13, 0x01, 0xc0, 0x40, "Hard" }, - {0x13, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Sonofphx) - -static struct BurnDIPInfo SrdmissnDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life / Continue" }, - {0x12, 0x01, 0x04, 0x04, "Every 50000 / No" }, - {0x12, 0x01, 0x04, 0x00, "Every 70000 / Yes" }, - - {0 , 0xfe, 0 , 2 , "Slow Motion" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Sound Test" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 2 Plays" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 6 Plays" }, - {0x13, 0x01, 0x07, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "5 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 4 Plays" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, -}; - -STDDIPINFO(Srdmissn) - -static struct BurnRomInfo AirwolfRomDesc[] = { - { "b.2s", 0x08000, 0x8c993cce, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - - { "a.7s", 0x08000, 0xa3c7af5c, BRF_ESS | BRF_PRG }, // 1 Z80 #2 Program - - { "f.4a", 0x01000, 0x4df44ce9, BRF_GRA }, // 2 Characters - - { "09h_14.bin", 0x02000, 0x25e57e1f, BRF_GRA }, // 3 Tiles - { "10h_13.bin", 0x02000, 0xcf0de5e9, BRF_GRA }, // 4 - { "11h_12.bin", 0x02000, 0x4050c048, BRF_GRA }, // 5 - - { "e.6a", 0x08000, 0xe8fbc7d2, BRF_GRA }, // 6 Sprites - { "d.8a", 0x08000, 0xc5d4156b, BRF_GRA }, // 7 - { "c.10a", 0x08000, 0xde91dfb1, BRF_GRA }, // 8 - - { "01j.bin", 0x00100, 0x6a94b2a3, BRF_GRA }, // 9 PROMs - { "01h.bin", 0x00100, 0xec0923d3, BRF_GRA }, // 10 - { "01f.bin", 0x00100, 0xade97052, BRF_GRA }, // 11 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 12 - - { "pal16l8a.2j", 0x00104, 0x00000000, BRF_OPT | BRF_NODUMP }, // 13 PLDs - { "epl12p6a.9j", 0x00034, 0x19808f14, BRF_OPT }, // 14 - { "epl12p6a.9k", 0x00034, 0xf5acad85, BRF_OPT }, // 15 -}; - -STD_ROM_PICK(Airwolf) -STD_ROM_FN(Airwolf) - -static struct BurnRomInfo AirwolfaRomDesc[] = { - { "airwolf.2", 0x08000, 0xbc1a8587, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - - { "airwolf.1", 0x08000, 0xa3c7af5c, BRF_ESS | BRF_PRG }, // 1 Z80 #2 Program - - { "airwolf.6", 0x02000, 0x5b0a01e9, BRF_GRA }, // 2 Characters - - { "airwolf.9", 0x02000, 0x25e57e1f, BRF_GRA }, // 3 Tiles - { "airwolf.8", 0x02000, 0xcf0de5e9, BRF_GRA }, // 4 - { "airwolf.7", 0x02000, 0x4050c048, BRF_GRA }, // 5 - - { "airwolf.5", 0x08000, 0xe8fbc7d2, BRF_GRA }, // 6 Sprites - { "airwolf.4", 0x08000, 0xc5d4156b, BRF_GRA }, // 7 - { "airwolf.3", 0x08000, 0xde91dfb1, BRF_GRA }, // 8 - - { "01j.bin", 0x00100, 0x6a94b2a3, BRF_GRA }, // 9 PROMs - { "01h.bin", 0x00100, 0xec0923d3, BRF_GRA }, // 10 - { "01f.bin", 0x00100, 0xade97052, BRF_GRA }, // 11 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 12 - - { "pal16l8a.2j", 0x00104, 0x00000000, BRF_OPT | BRF_NODUMP }, // 13 PLDs - { "epl12p6a.9j", 0x00034, 0x19808f14, BRF_OPT }, // 14 - { "epl12p6a.9k", 0x00034, 0xf5acad85, BRF_OPT }, // 15 -}; - -STD_ROM_PICK(Airwolfa) -STD_ROM_FN(Airwolfa) - -static struct BurnRomInfo SkywolfRomDesc[] = { - { "02s_03.bin", 0x04000, 0xa0891798, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "03s_04.bin", 0x04000, 0x5f515d46, BRF_ESS | BRF_PRG }, // 1 Z80 - - { "07s_01.bin", 0x04000, 0xc680a905, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - { "08s_02.bin", 0x04000, 0x3d66bf26, BRF_ESS | BRF_PRG }, // 3 Z80 - - { "04a_11.bin", 0x01000, 0x219de9aa, BRF_GRA }, // 4 Characters - - { "09h_14.bin", 0x02000, 0x25e57e1f, BRF_GRA }, // 5 Tiles - { "10h_13.bin", 0x02000, 0xcf0de5e9, BRF_GRA }, // 6 - { "11h_12.bin", 0x02000, 0x4050c048, BRF_GRA }, // 7 - - { "06a_10.bin", 0x04000, 0x1c809383, BRF_GRA }, // 6 Sprites - { "07a_09.bin", 0x04000, 0x5665d774, BRF_GRA }, // 7 - { "08a_08.bin", 0x04000, 0x6dda8f2a, BRF_GRA }, // 8 - { "09a_07.bin", 0x04000, 0x6a21ddb8, BRF_GRA }, // 9 - { "10a_06.bin", 0x04000, 0xf2e548e0, BRF_GRA }, // 10 - { "11a_05.bin", 0x04000, 0x8681b112, BRF_GRA }, // 11 - - { "01j.bin", 0x00100, 0x6a94b2a3, BRF_GRA }, // 12 PROMs - { "01h.bin", 0x00100, 0xec0923d3, BRF_GRA }, // 13 - { "01f.bin", 0x00100, 0xade97052, BRF_GRA }, // 14 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 15 -}; - -STD_ROM_PICK(Skywolf) -STD_ROM_FN(Skywolf) - -static struct BurnRomInfo Skywolf2RomDesc[] = { - { "z80_2.bin", 0x08000, 0x34db7bda, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - - { "07s_01.bin", 0x04000, 0xc680a905, BRF_ESS | BRF_PRG }, // 1 Z80 #2 Program - { "08s_02.bin", 0x04000, 0x3d66bf26, BRF_ESS | BRF_PRG }, // 2 Z80 - - { "04a_11.bin", 0x01000, 0x219de9aa, BRF_GRA }, // 3 Characters - - { "09h_14.bin", 0x02000, 0x25e57e1f, BRF_GRA }, // 4 Tiles - { "10h_13.bin", 0x02000, 0xcf0de5e9, BRF_GRA }, // 5 - { "11h_12.bin", 0x02000, 0x4050c048, BRF_GRA }, // 6 - - { "06a_10.bin", 0x04000, 0x1c809383, BRF_GRA }, // 7 Sprites - { "07a_09.bin", 0x04000, 0x5665d774, BRF_GRA }, // 8 - { "08a_08.bin", 0x04000, 0x6dda8f2a, BRF_GRA }, // 9 - { "09a_07.bin", 0x04000, 0x6a21ddb8, BRF_GRA }, // 10 - { "10a_06.bin", 0x04000, 0xf2e548e0, BRF_GRA }, // 11 - { "11a_05.bin", 0x04000, 0x8681b112, BRF_GRA }, // 12 - - { "01j.bin", 0x00100, 0x6a94b2a3, BRF_GRA }, // 13 PROMs - { "01h.bin", 0x00100, 0xec0923d3, BRF_GRA }, // 14 - { "01f.bin", 0x00100, 0xade97052, BRF_GRA }, // 15 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 16 -}; - -STD_ROM_PICK(Skywolf2) -STD_ROM_FN(Skywolf2) - -static struct BurnRomInfo Skywolf3RomDesc[] = { - { "1.bin", 0x08000, 0x74a86ec8, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "2.bin", 0x08000, 0xf02143de, BRF_ESS | BRF_PRG }, // 1 - - { "3.bin", 0x08000, 0x787cdd0a, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - { "4.bin", 0x08000, 0x07a2c814, BRF_ESS | BRF_PRG }, // 3 Z80 - - { "8.bin", 0x08000, 0xb86d3dac, BRF_GRA }, // 4 Characters - - { "11.bin", 0x08000, 0xfc7bbf7a, BRF_GRA }, // 5 Tiles - { "10.bin", 0x08000, 0x1a3710ab, BRF_GRA }, // 6 - { "9.bin", 0x08000, 0xa184349a, BRF_GRA }, // 7 - - { "7.bin", 0x08000, 0x086612e8, BRF_GRA }, // 8 Sprites - { "6.bin", 0x08000, 0x3a9beabd, BRF_GRA }, // 9 - { "5.bin", 0x08000, 0xbd83658e, BRF_GRA }, // 10 - - { "82s129-1.bin", 0x00100, 0x6a94b2a3, BRF_GRA }, // 11 PROMs - { "82s129-2.bin", 0x00100, 0xec0923d3, BRF_GRA }, // 12 - { "82s129-3.bin", 0x00100, 0xade97052, BRF_GRA }, // 13 - { "74s288-2.bin", 0x00020, 0x190a55ad, BRF_GRA }, // 14 - { "74s288-1.bin", 0x00020, 0x5ddb2d15, BRF_GRA }, // 15 -}; - -STD_ROM_PICK(Skywolf3) -STD_ROM_FN(Skywolf3) - -static struct BurnRomInfo FlashgalRomDesc[] = { - { "epr-7167.4f", 0x02000, 0xcf5ad733, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7168.4h", 0x02000, 0x00c4851f, BRF_ESS | BRF_PRG }, // 1 - { "epr-7169.4j", 0x02000, 0x1ef0b8f7, BRF_ESS | BRF_PRG }, // 2 - { "epr-7170.4k", 0x02000, 0x885d53de, BRF_ESS | BRF_PRG }, // 3 - - { "epr-7163.2f", 0x02000, 0xeee2134d, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program - { "epr-7164.2h", 0x02000, 0xe5e0cd22, BRF_ESS | BRF_PRG }, // 5 - { "epr-7165.2j", 0x02000, 0x4cd3fe5e, BRF_ESS | BRF_PRG }, // 6 - { "epr-7166.2k", 0x02000, 0x552ca339, BRF_ESS | BRF_PRG }, // 7 - - { "epr-7177.4a", 0x01000, 0xdca9052f, BRF_GRA }, // 8 Characters - - { "epr-7178.9h", 0x02000, 0x2f5b62c0, BRF_GRA }, // 9 Tiles - { "epr-7179.10h", 0x02000, 0x8fbb49b5, BRF_GRA }, // 10 - { "epr-7180.11h", 0x02000, 0x26a8e5c3, BRF_GRA }, // 11 - - { "epr-7171.6a", 0x04000, 0x62caf2a1, BRF_GRA }, // 12 Sprites - { "epr-7172.7a", 0x04000, 0x10f78a10, BRF_GRA }, // 13 - { "epr-7173.8a", 0x04000, 0x36ea1d59, BRF_GRA }, // 14 - { "epr-7174.9a", 0x04000, 0xf527d837, BRF_GRA }, // 15 - { "epr-7175.10a", 0x04000, 0xba76e4c1, BRF_GRA }, // 16 - { "epr-7176.11a", 0x04000, 0xf095d619, BRF_GRA }, // 17 - - { "7161.1j", 0x00100, 0x02c4043f, BRF_GRA }, // 18 PROMs - { "7160.1h", 0x00100, 0x225938d1, BRF_GRA }, // 19 - { "7159.1f", 0x00100, 0x1e0a1cd3, BRF_GRA }, // 20 - { "7162.5j", 0x00020, 0xcce2e29f, BRF_GRA }, // 21 - { "bpr.2c", 0x00020, 0x83a39201, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Flashgal) -STD_ROM_FN(Flashgal) - -static struct BurnRomInfo FlashgalkRomDesc[] = { - { "epr-7167.4f", 0x02000, 0xcf5ad733, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7168.4h", 0x02000, 0x00c4851f, BRF_ESS | BRF_PRG }, // 1 - { "epr-7169.4j", 0x02000, 0x1ef0b8f7, BRF_ESS | BRF_PRG }, // 2 - { "epr-7170.4k", 0x02000, 0x885d53de, BRF_ESS | BRF_PRG }, // 3 - - { "epr-7163.2f", 0x02000, 0xeee2134d, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program - { "epr-7164.2h", 0x02000, 0xe5e0cd22, BRF_ESS | BRF_PRG }, // 5 - { "epr-7165.2j", 0x02000, 0x4cd3fe5e, BRF_ESS | BRF_PRG }, // 6 - { "epr-7166.2k", 0x02000, 0x552ca339, BRF_ESS | BRF_PRG }, // 7 - - { "4a.bin", 0x01000, 0x83a30785, BRF_GRA }, // 8 Characters - - { "epr-7178.9h", 0x02000, 0x2f5b62c0, BRF_GRA }, // 9 Tiles - { "epr-7179.10h", 0x02000, 0x8fbb49b5, BRF_GRA }, // 10 - { "epr-7180.11h", 0x02000, 0x26a8e5c3, BRF_GRA }, // 11 - - { "epr-7171.6a", 0x04000, 0x62caf2a1, BRF_GRA }, // 12 Sprites - { "epr-7172.7a", 0x04000, 0x10f78a10, BRF_GRA }, // 13 - { "epr-7173.8a", 0x04000, 0x36ea1d59, BRF_GRA }, // 14 - { "epr-7174.9a", 0x04000, 0xf527d837, BRF_GRA }, // 15 - { "epr-7175.10a", 0x04000, 0xba76e4c1, BRF_GRA }, // 16 - { "epr-7176.11a", 0x04000, 0xf095d619, BRF_GRA }, // 17 - - { "7161.1j", 0x00100, 0x02c4043f, BRF_GRA }, // 18 PROMs - { "7160.1h", 0x00100, 0x225938d1, BRF_GRA }, // 19 - { "7159.1f", 0x00100, 0x1e0a1cd3, BRF_GRA }, // 20 - { "7162.5j", 0x00020, 0xcce2e29f, BRF_GRA }, // 21 - { "bpr.2c", 0x00020, 0x83a39201, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Flashgalk) -STD_ROM_FN(Flashgalk) - -static struct BurnRomInfo FlashgalaRomDesc[] = { - { "flashgal.5", 0x02000, 0xaa889ace, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7168.4h", 0x02000, 0x00c4851f, BRF_ESS | BRF_PRG }, // 1 - { "epr-7169.4j", 0x02000, 0x1ef0b8f7, BRF_ESS | BRF_PRG }, // 2 - { "epr-7170.4k", 0x02000, 0x885d53de, BRF_ESS | BRF_PRG }, // 3 - - { "flashgal.1", 0x02000, 0x55171cc1, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program - { "flashgal.2", 0x02000, 0x3fd21aac, BRF_ESS | BRF_PRG }, // 5 - { "flashgal.3", 0x02000, 0xa1223b74, BRF_ESS | BRF_PRG }, // 6 - { "flashgal.4", 0x02000, 0x04d2a05f, BRF_ESS | BRF_PRG }, // 7 - - { "epr-7177.4a", 0x01000, 0xdca9052f, BRF_GRA }, // 8 Characters - - { "epr-7178.9h", 0x02000, 0x2f5b62c0, BRF_GRA }, // 9 Tiles - { "epr-7179.10h", 0x02000, 0x8fbb49b5, BRF_GRA }, // 10 - { "epr-7180.11h", 0x02000, 0x26a8e5c3, BRF_GRA }, // 11 - - { "epr-7171.6a", 0x04000, 0x62caf2a1, BRF_GRA }, // 12 Sprites - { "epr-7172.7a", 0x04000, 0x10f78a10, BRF_GRA }, // 13 - { "epr-7173.8a", 0x04000, 0x36ea1d59, BRF_GRA }, // 14 - { "epr-7174.9a", 0x04000, 0xf527d837, BRF_GRA }, // 15 - { "epr-7175.10a", 0x04000, 0xba76e4c1, BRF_GRA }, // 16 - { "epr-7176.11a", 0x04000, 0xf095d619, BRF_GRA }, // 17 - - { "7161.1j", 0x00100, 0x02c4043f, BRF_GRA }, // 18 PROMs - { "7160.1h", 0x00100, 0x225938d1, BRF_GRA }, // 19 - { "7159.1f", 0x00100, 0x1e0a1cd3, BRF_GRA }, // 20 - { "7162.5j", 0x00020, 0xcce2e29f, BRF_GRA }, // 21 - { "bpr.2c", 0x00020, 0x83a39201, BRF_GRA }, // 22 -}; - -STD_ROM_PICK(Flashgala) -STD_ROM_FN(Flashgala) - -static struct BurnRomInfo GyrodineRomDesc[] = { - { "rom2", 0x02000, 0x85ddea38, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a21.03", 0x02000, 0x4e9323bd, BRF_ESS | BRF_PRG }, // 1 - { "a21.04", 0x02000, 0x57e659d4, BRF_ESS | BRF_PRG }, // 2 - { "a21.05", 0x02000, 0x1e7293f3, BRF_ESS | BRF_PRG }, // 3 - - { "a21.01", 0x02000, 0xb2ce0aa2, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program - - { "a21.15", 0x01000, 0xadba18d0, BRF_GRA }, // 5 Characters - - { "a21.08", 0x02000, 0xa57df1c9, BRF_GRA }, // 6 Tiles - { "a21.07", 0x02000, 0x63623ba3, BRF_GRA }, // 7 - { "a21.06", 0x02000, 0x4cc969a9, BRF_GRA }, // 8 - - { "a21.14", 0x02000, 0x9c5c4d5b, BRF_GRA }, // 9 Sprites - { "a21.13", 0x02000, 0xd36b5aad, BRF_GRA }, // 10 - { "a21.12", 0x02000, 0xf387aea2, BRF_GRA }, // 11 - { "a21.11", 0x02000, 0x87967d7d, BRF_GRA }, // 12 - { "a21.10", 0x02000, 0x59640ab4, BRF_GRA }, // 13 - { "a21.09", 0x02000, 0x22ad88d8, BRF_GRA }, // 14 - - { "a21.16", 0x00100, 0xcc25fb56, BRF_GRA }, // 15 PROMs - { "a21.17", 0x00100, 0xca054448, BRF_GRA }, // 16 - { "a21.18", 0x00100, 0x23c0c449, BRF_GRA }, // 17 - { "a21.20", 0x00020, 0xefc4985e, BRF_GRA }, // 18 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 19 -}; - -STD_ROM_PICK(Gyrodine) -STD_ROM_FN(Gyrodine) - -static struct BurnRomInfo GyrodinetRomDesc[] = { - { "a21.02", 0x02000, 0xc5ec4a50, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a21.03", 0x02000, 0x4e9323bd, BRF_ESS | BRF_PRG }, // 1 - { "a21.04", 0x02000, 0x57e659d4, BRF_ESS | BRF_PRG }, // 2 - { "a21.05", 0x02000, 0x1e7293f3, BRF_ESS | BRF_PRG }, // 3 - - { "a21.01", 0x02000, 0xb2ce0aa2, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program - - { "a21.15", 0x01000, 0xadba18d0, BRF_GRA }, // 5 Characters - - { "a21.08", 0x02000, 0xa57df1c9, BRF_GRA }, // 6 Tiles - { "a21.07", 0x02000, 0x63623ba3, BRF_GRA }, // 7 - { "a21.06", 0x02000, 0x4cc969a9, BRF_GRA }, // 8 - - { "a21.14", 0x02000, 0x9c5c4d5b, BRF_GRA }, // 9 Sprites - { "a21.13", 0x02000, 0xd36b5aad, BRF_GRA }, // 10 - { "a21.12", 0x02000, 0xf387aea2, BRF_GRA }, // 11 - { "a21.11", 0x02000, 0x87967d7d, BRF_GRA }, // 12 - { "a21.10", 0x02000, 0x59640ab4, BRF_GRA }, // 13 - { "a21.09", 0x02000, 0x22ad88d8, BRF_GRA }, // 14 - - { "a21.16", 0x00100, 0xcc25fb56, BRF_GRA }, // 15 PROMs - { "a21.17", 0x00100, 0xca054448, BRF_GRA }, // 16 - { "a21.18", 0x00100, 0x23c0c449, BRF_GRA }, // 17 - { "a21.20", 0x00020, 0xefc4985e, BRF_GRA }, // 18 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 19 -}; - -STD_ROM_PICK(Gyrodinet) -STD_ROM_FN(Gyrodinet) - -static struct BurnRomInfo BuzzardRomDesc[] = { - { "rom2", 0x02000, 0x85ddea38, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a21.03", 0x02000, 0x4e9323bd, BRF_ESS | BRF_PRG }, // 1 - { "a21.04", 0x02000, 0x57e659d4, BRF_ESS | BRF_PRG }, // 2 - { "a21.05", 0x02000, 0x1e7293f3, BRF_ESS | BRF_PRG }, // 3 - - { "a21.01", 0x02000, 0xb2ce0aa2, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program - - { "buzl01.bin", 0x01000, 0x65d728d0, BRF_GRA }, // 5 Characters - - { "a21.08", 0x02000, 0xa57df1c9, BRF_GRA }, // 6 Tiles - { "a21.07", 0x02000, 0x63623ba3, BRF_GRA }, // 7 - { "a21.06", 0x02000, 0x4cc969a9, BRF_GRA }, // 8 - - { "a21.14", 0x02000, 0x9c5c4d5b, BRF_GRA }, // 9 Sprites - { "a21.13", 0x02000, 0xd36b5aad, BRF_GRA }, // 10 - { "a21.12", 0x02000, 0xf387aea2, BRF_GRA }, // 11 - { "a21.11", 0x02000, 0x87967d7d, BRF_GRA }, // 12 - { "a21.10", 0x02000, 0x59640ab4, BRF_GRA }, // 13 - { "a21.09", 0x02000, 0x22ad88d8, BRF_GRA }, // 14 - - { "a21.16", 0x00100, 0xcc25fb56, BRF_GRA }, // 15 PROMs - { "a21.17", 0x00100, 0xca054448, BRF_GRA }, // 16 - { "a21.18", 0x00100, 0x23c0c449, BRF_GRA }, // 17 - { "a21.20", 0x00020, 0xefc4985e, BRF_GRA }, // 18 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 19 -}; - -STD_ROM_PICK(Buzzard) -STD_ROM_FN(Buzzard) - -static struct BurnRomInfo LegendRomDesc[] = { - { "a_r2.rom", 0x04000, 0x0cc1c4f4, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a_r3.rom", 0x04000, 0x4b270c6b, BRF_ESS | BRF_PRG }, // 1 - - { "a_r7.rom", 0x02000, 0xabfe5eb4, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - { "a_r8.rom", 0x02000, 0x7e7b9ba9, BRF_ESS | BRF_PRG }, // 3 - { "a_r9.rom", 0x02000, 0x66737f1e, BRF_ESS | BRF_PRG }, // 4 - { "a_n7.rom", 0x02000, 0x13915a53, BRF_ESS | BRF_PRG }, // 5 - - { "b_a4.rom", 0x01000, 0xc7dd3cf7, BRF_GRA }, // 6 Characters - - { "b_h9.rom", 0x02000, 0x1fe8644a, BRF_GRA }, // 7 Tiles - { "b_h10.rom", 0x02000, 0x5f7dc82e, BRF_GRA }, // 8 - { "b_h11.rom", 0x02000, 0x46741643, BRF_GRA }, // 9 - - { "b_a6.rom", 0x04000, 0x1689f21c, BRF_GRA }, // 10 Sprites - { "b_a7.rom", 0x04000, 0xf527c909, BRF_GRA }, // 11 - { "b_a8.rom", 0x04000, 0x8d618629, BRF_GRA }, // 12 - { "b_a9.rom", 0x04000, 0x7d7e2d55, BRF_GRA }, // 13 - { "b_a10.rom", 0x04000, 0xf12232fe, BRF_GRA }, // 14 - { "b_a11.rom", 0x04000, 0x8c09243d, BRF_GRA }, // 15 - - { "82s129.1j", 0x00100, 0x40590ac0, BRF_GRA }, // 16 PROMs - { "82s129.1h", 0x00100, 0xe542b363, BRF_GRA }, // 17 - { "82s129.1f", 0x00100, 0x75536fc8, BRF_GRA }, // 18 - { "82s123.5j", 0x00020, 0xc98f0651, BRF_GRA }, // 19 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 20 - - { "epl10p8.2j", 0x0002c, 0x8abc03bf, BRF_OPT }, // 21 PLDs - { "epl12p6.9k", 0x00034, 0x9b0bd6f8, BRF_OPT }, // 22 - { "epl12p6.9j", 0x00034, 0xdcae870d, BRF_OPT }, // 23 -}; - -STD_ROM_PICK(Legend) -STD_ROM_FN(Legend) - -static struct BurnRomInfo SonofphxRomDesc[] = { - { "5.f4", 0x02000, 0xe0d2c6cf, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "6.h4", 0x02000, 0x3a0d0336, BRF_ESS | BRF_PRG }, // 1 - { "7.j4", 0x02000, 0x57a8e900, BRF_ESS | BRF_PRG }, // 2 - - { "1.f2", 0x02000, 0xc485c621, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - { "2.h2", 0x02000, 0xb3c6a886, BRF_ESS | BRF_PRG }, // 4 - { "3.j2", 0x02000, 0x197e314c, BRF_ESS | BRF_PRG }, // 5 - { "4.k2", 0x02000, 0x4f3695a1, BRF_ESS | BRF_PRG }, // 6 - - { "14.4a", 0x01000, 0xb3859b8b, BRF_GRA }, // 7 Characters - - { "15.9h", 0x02000, 0xc9213469, BRF_GRA }, // 8 Tiles - { "16.10h", 0x02000, 0x7de5d39e, BRF_GRA }, // 9 - { "17.11h", 0x02000, 0x0ba5f72c, BRF_GRA }, // 10 - - { "8.6a", 0x04000, 0x0e9f757e, BRF_GRA }, // 11 Sprites - { "9.7a", 0x04000, 0xf7d2e650, BRF_GRA }, // 12 - { "10.8a", 0x04000, 0xe717baf4, BRF_GRA }, // 13 - { "11.9a", 0x04000, 0x04b2250b, BRF_GRA }, // 14 - { "12.10a", 0x04000, 0xd110e140, BRF_GRA }, // 15 - { "13.11a", 0x04000, 0x8fdc713c, BRF_GRA }, // 16 - - { "b.1j", 0x00100, 0x3ea35431, BRF_GRA }, // 17 PROMs - { "g.1h", 0x00100, 0xacd7a69e, BRF_GRA }, // 18 - { "r.1f", 0x00100, 0xb7f48b41, BRF_GRA }, // 19 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 20 -}; - -STD_ROM_PICK(Sonofphx) -STD_ROM_FN(Sonofphx) - -static struct BurnRomInfo RepulseRomDesc[] = { - { "repulse.b5", 0x02000, 0xfb2b7c9d, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "repulse.b6", 0x02000, 0x99129918, BRF_ESS | BRF_PRG }, // 1 - { "7.j4", 0x02000, 0x57a8e900, BRF_ESS | BRF_PRG }, // 2 - - { "1.f2", 0x02000, 0xc485c621, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - { "2.h2", 0x02000, 0xb3c6a886, BRF_ESS | BRF_PRG }, // 4 - { "3.j2", 0x02000, 0x197e314c, BRF_ESS | BRF_PRG }, // 5 - { "repulse.b4", 0x02000, 0x86b267f3, BRF_ESS | BRF_PRG }, // 6 - - { "repulse.a11", 0x01000, 0x8e1de90a, BRF_GRA }, // 7 Characters - - { "15.9h", 0x02000, 0xc9213469, BRF_GRA }, // 8 Tiles - { "16.10h", 0x02000, 0x7de5d39e, BRF_GRA }, // 9 - { "17.11h", 0x02000, 0x0ba5f72c, BRF_GRA }, // 10 - - { "8.6a", 0x04000, 0x0e9f757e, BRF_GRA }, // 11 Sprites - { "9.7a", 0x04000, 0xf7d2e650, BRF_GRA }, // 12 - { "10.8a", 0x04000, 0xe717baf4, BRF_GRA }, // 13 - { "11.9a", 0x04000, 0x04b2250b, BRF_GRA }, // 14 - { "12.10a", 0x04000, 0xd110e140, BRF_GRA }, // 15 - { "13.11a", 0x04000, 0x8fdc713c, BRF_GRA }, // 16 - - { "b.1j", 0x00100, 0x3ea35431, BRF_GRA }, // 17 PROMs - { "g.1h", 0x00100, 0xacd7a69e, BRF_GRA }, // 18 - { "r.1f", 0x00100, 0xb7f48b41, BRF_GRA }, // 19 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 20 -}; - -STD_ROM_PICK(Repulse) -STD_ROM_FN(Repulse) - -static struct BurnRomInfo Lstwar99RomDesc[] = { - { "1999.4f", 0x02000, 0xe3cfc09f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "1999.4h", 0x02000, 0xfd58c6e1, BRF_ESS | BRF_PRG }, // 1 - { "7.j4", 0x02000, 0x57a8e900, BRF_ESS | BRF_PRG }, // 2 - - { "1.f2", 0x02000, 0xc485c621, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - { "2.h2", 0x02000, 0xb3c6a886, BRF_ESS | BRF_PRG }, // 4 - { "3.j2", 0x02000, 0x197e314c, BRF_ESS | BRF_PRG }, // 5 - { "repulse.b4", 0x02000, 0x86b267f3, BRF_ESS | BRF_PRG }, // 6 - - { "1999.4a", 0x01000, 0x49a2383e, BRF_GRA }, // 7 Characters - - { "15.9h", 0x02000, 0xc9213469, BRF_GRA }, // 8 Tiles - { "16.10h", 0x02000, 0x7de5d39e, BRF_GRA }, // 9 - { "17.11h", 0x02000, 0x0ba5f72c, BRF_GRA }, // 10 - - { "8.6a", 0x04000, 0x0e9f757e, BRF_GRA }, // 11 Sprites - { "9.7a", 0x04000, 0xf7d2e650, BRF_GRA }, // 12 - { "10.8a", 0x04000, 0xe717baf4, BRF_GRA }, // 13 - { "11.9a", 0x04000, 0x04b2250b, BRF_GRA }, // 14 - { "12.10a", 0x04000, 0xd110e140, BRF_GRA }, // 15 - { "13.11a", 0x04000, 0x8fdc713c, BRF_GRA }, // 16 - - { "b.1j", 0x00100, 0x3ea35431, BRF_GRA }, // 17 PROMs - { "g.1h", 0x00100, 0xacd7a69e, BRF_GRA }, // 18 - { "r.1f", 0x00100, 0xb7f48b41, BRF_GRA }, // 19 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 20 -}; - -STD_ROM_PICK(Lstwar99) -STD_ROM_FN(Lstwar99) - -static struct BurnRomInfo Lstwra99RomDesc[] = { - { "4f.bin", 0x02000, 0xefe2908d, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "4h.bin", 0x02000, 0x5b79c342, BRF_ESS | BRF_PRG }, // 1 - { "4j.bin", 0x02000, 0xd2a62c1b, BRF_ESS | BRF_PRG }, // 2 - - { "2f.bin", 0x02000, 0xcb9d8291, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - { "2h.bin", 0x02000, 0x24dbddc3, BRF_ESS | BRF_PRG }, // 4 - { "2j.bin", 0x02000, 0x16879c4c, BRF_ESS | BRF_PRG }, // 5 - { "repulse.b4", 0x02000, 0x86b267f3, BRF_ESS | BRF_PRG }, // 6 - - { "1999.4a", 0x01000, 0x49a2383e, BRF_GRA }, // 7 Characters - - { "9h.bin", 0x02000, 0x59993c27, BRF_GRA }, // 8 Tiles - { "10h.bin", 0x02000, 0xdfbf0280, BRF_GRA }, // 9 - { "11h.bin", 0x02000, 0xe4f29fc0, BRF_GRA }, // 10 - - { "6a.bin", 0x04000, 0x98d44410, BRF_GRA }, // 11 Sprites - { "7a.bin", 0x04000, 0x4c54d281, BRF_GRA }, // 12 - { "8a.bin", 0x04000, 0x81018101, BRF_GRA }, // 13 - { "9a.bin", 0x04000, 0x347b91fd, BRF_GRA }, // 14 - { "10a.bin", 0x04000, 0xf07de4fa, BRF_GRA }, // 15 - { "11a.bin", 0x04000, 0x34a04f48, BRF_GRA }, // 16 - - { "b.1j", 0x00100, 0x3ea35431, BRF_GRA }, // 17 PROMs - { "g.1h", 0x00100, 0xacd7a69e, BRF_GRA }, // 18 - { "r.1f", 0x00100, 0xb7f48b41, BRF_GRA }, // 19 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 20 -}; - -STD_ROM_PICK(Lstwra99) -STD_ROM_FN(Lstwra99) - -static struct BurnRomInfo Lstwrk99RomDesc[] = { - { "1999.4f", 0x02000, 0xe3cfc09f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "1999.4h", 0x02000, 0xfd58c6e1, BRF_ESS | BRF_PRG }, // 1 - { "7.j4", 0x02000, 0x57a8e900, BRF_ESS | BRF_PRG }, // 2 - - { "1.f2", 0x02000, 0xc485c621, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - { "2.h2", 0x02000, 0xb3c6a886, BRF_ESS | BRF_PRG }, // 4 - { "3.j2", 0x02000, 0x197e314c, BRF_ESS | BRF_PRG }, // 5 - { "repulse.b4", 0x02000, 0x86b267f3, BRF_ESS | BRF_PRG }, // 6 - - { "1999-14.rom", 0x01000, 0xb4995072, BRF_GRA }, // 7 Characters - - { "15.9h", 0x02000, 0xc9213469, BRF_GRA }, // 8 Tiles - { "16.10h", 0x02000, 0x7de5d39e, BRF_GRA }, // 9 - { "17.11h", 0x02000, 0x0ba5f72c, BRF_GRA }, // 10 - - { "8.6a", 0x04000, 0x0e9f757e, BRF_GRA }, // 11 Sprites - { "9.7a", 0x04000, 0xf7d2e650, BRF_GRA }, // 12 - { "10.8a", 0x04000, 0xe717baf4, BRF_GRA }, // 13 - { "11.9a", 0x04000, 0x04b2250b, BRF_GRA }, // 14 - { "12.10a", 0x04000, 0xd110e140, BRF_GRA }, // 15 - { "13.11a", 0x04000, 0x8fdc713c, BRF_GRA }, // 16 - - { "b.1j", 0x00100, 0x3ea35431, BRF_GRA }, // 17 PROMs - { "g.1h", 0x00100, 0xacd7a69e, BRF_GRA }, // 18 - { "r.1f", 0x00100, 0xb7f48b41, BRF_GRA }, // 19 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 20 - { "1999-00.rom", 0x00800, 0x0c0c449f, BRF_GRA }, // 21 -}; - -STD_ROM_PICK(Lstwrk99) -STD_ROM_FN(Lstwrk99) - -static struct BurnRomInfo SrdmissnRomDesc[] = { - { "5.t2", 0x04000, 0xa682b48c, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "7.t3", 0x04000, 0x1719c58c, BRF_ESS | BRF_PRG }, // 1 - - { "1.t7", 0x04000, 0xdc48595e, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - { "3.t8", 0x04000, 0x216be1e8, BRF_ESS | BRF_PRG }, // 3 - - { "15.4a", 0x01000, 0x4961f7fd, BRF_GRA }, // 4 Characters - - { "17.9h", 0x02000, 0x41211458, BRF_GRA }, // 5 Tiles - { "18.10h", 0x02000, 0x740eccd4, BRF_GRA }, // 6 - { "16.11h", 0x02000, 0xc1f4a5db, BRF_GRA }, // 7 - - { "14.6a", 0x04000, 0x3d4c0447, BRF_GRA }, // 8 Sprites - { "13.7a", 0x04000, 0x22414a67, BRF_GRA }, // 9 - { "12.8a", 0x04000, 0x61e34283, BRF_GRA }, // 10 - { "11.9a", 0x04000, 0xbbbaffef, BRF_GRA }, // 11 - { "10.10a", 0x04000, 0xde564f97, BRF_GRA }, // 12 - { "9.11a", 0x04000, 0x890dc815, BRF_GRA }, // 13 - - { "mr.1j", 0x00100, 0x110a436e, BRF_GRA }, // 14 PROMs - { "mg.1h", 0x00100, 0x0fbfd9f0, BRF_GRA }, // 15 - { "mb.1f", 0x00100, 0xa342890c, BRF_GRA }, // 16 - { "m2.5j", 0x00020, 0x190a55ad, BRF_GRA }, // 17 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Srdmissn) -STD_ROM_FN(Srdmissn) - -static struct BurnRomInfo FxRomDesc[] = { - { "fx.01", 0x04000, 0xb651754b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "fx.02", 0x04000, 0xf3d2dcc1, BRF_ESS | BRF_PRG }, // 1 - - { "fx.03", 0x04000, 0x8907df6b, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - { "fx.04", 0x04000, 0xc665834f, BRF_ESS | BRF_PRG }, // 3 - - { "fx.05", 0x01000, 0x4a504286, BRF_GRA }, // 4 Characters - - { "17.9h", 0x02000, 0x41211458, BRF_GRA }, // 5 Tiles - { "18.10h", 0x02000, 0x740eccd4, BRF_GRA }, // 6 - { "16.11h", 0x02000, 0xc1f4a5db, BRF_GRA }, // 7 - - { "14.6a", 0x04000, 0x3d4c0447, BRF_GRA }, // 8 Sprites - { "13.7a", 0x04000, 0x22414a67, BRF_GRA }, // 9 - { "12.8a", 0x04000, 0x61e34283, BRF_GRA }, // 10 - { "11.9a", 0x04000, 0xbbbaffef, BRF_GRA }, // 11 - { "10.10a", 0x04000, 0xde564f97, BRF_GRA }, // 12 - { "9.11a", 0x04000, 0x890dc815, BRF_GRA }, // 13 - - { "mr.1j", 0x00100, 0x110a436e, BRF_GRA }, // 14 PROMs - { "mg.1h", 0x00100, 0x0fbfd9f0, BRF_GRA }, // 15 - { "mb.1f", 0x00100, 0xa342890c, BRF_GRA }, // 16 - { "m2.5j", 0x00020, 0x190a55ad, BRF_GRA }, // 17 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 18 -}; - -STD_ROM_PICK(Fx) -STD_ROM_FN(Fx) - -// f205v id 989 -// same data as fx, different format -static struct BurnRomInfo FxaRomDesc[] = { - { "fxa1.t4", 0x08000, 0xa71332aa, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - - { "fxa2.t8", 0x08000, 0xeb299381, BRF_ESS | BRF_PRG }, // 1 Z80 #2 Program - - { "fx.05", 0x01000, 0x4a504286, BRF_GRA }, // 2 Characters - - { "17.9h", 0x02000, 0x41211458, BRF_GRA }, // 3 Tiles - { "18.10h", 0x02000, 0x740eccd4, BRF_GRA }, // 4 - { "16.11h", 0x02000, 0xc1f4a5db, BRF_GRA }, // 5 - - { "fxa5.7a", 0x08000, 0x3e2289dc, BRF_GRA }, // 6 Sprites - { "fxa4.9a", 0x08000, 0x26963d7f, BRF_GRA }, // 7 - { "fxa3.11a", 0x08000, 0x8687f1a0, BRF_GRA }, // 8 - - { "mr.1j", 0x00100, 0x110a436e, BRF_GRA }, // 9 PROMs - { "mg.1h", 0x00100, 0x0fbfd9f0, BRF_GRA }, // 10 - { "mb.1f", 0x00100, 0xa342890c, BRF_GRA }, // 11 - { "m2.5j", 0x00020, 0x190a55ad, BRF_GRA }, // 12 - { "m1.2c", 0x00020, 0x83a39201, BRF_GRA }, // 13 -}; - -STD_ROM_PICK(Fxa) -STD_ROM_FN(Fxa) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - KyugoZ80Rom1 = Next; Next += 0x08000; - KyugoZ80Rom2 = Next; Next += 0x08000; - KyugoPromRed = Next; Next += 0x00100; - KyugoPromGreen = Next; Next += 0x00100; - KyugoPromBlue = Next; Next += 0x00100; - KyugoPromCharLookup = Next; Next += 0x00020; - - RamStart = Next; - - KyugoSharedZ80Ram = Next; Next += 0x00800; - KyugoZ80Ram2 = Next; Next += 0x00800; - KyugoSprite1Ram = Next; Next += 0x00800; - KyugoSprite2Ram = Next; Next += 0x00800; - KyugoFgVideoRam = Next; Next += 0x00800; - KyugoBgVideoRam = Next; Next += 0x00800; - KyugoBgAttrRam = Next; Next += 0x00800; - - RamEnd = Next; - - KyugoChars = Next; Next += 0x100 * 8 * 8; - KyugoTiles = Next; Next += 0x400 * 8 * 8; - KyugoSprites = Next; Next += 0x400 * 16 * 16; - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 6 * sizeof(INT16); - KyugoPalette = (UINT32*)Next; Next += 256 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 KyugoDoReset() -{ - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - for (INT32 i = 0; i < 2; i++) { - AY8910Reset(i); - } - - KyugoIRQEnable = 0; - KyugoSubCPUEnable = 0; - KyugoFgColour = 0; - KyugoBgPaletteBank = 0; - KyugoBgScrollXHi = 0; - KyugoBgScrollXLo = 0; - KyugoBgScrollY = 0; - KyugoFlipScreen = 0; - - return 0; -} - -UINT8 __fastcall KyugoRead1(UINT16 a) -{ - if (a >= 0x9800 && a <= 0x9fff) { - return KyugoSprite2Ram[a - 0x9800] | 0xf0; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall KyugoWrite1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xa800: { - KyugoBgScrollXLo = d; - return; - } - - case 0xb000: { - KyugoBgScrollXHi = d & 1; - KyugoFgColour = (d & 0x20) >> 5; - KyugoBgPaletteBank = (d & 0x40) >> 6; - return; - } - - case 0xb800: { - KyugoBgScrollY = d; - return; - } - - - case 0xe000: { - // watchdog write - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall FlashgalPortWrite1(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x40: { - KyugoIRQEnable = d & 1; - return; - } - - case 0x41: { - KyugoFlipScreen = d & 1; - return; - } - - case 0x42: { - KyugoSubCPUEnable = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall FlashgalaPortWrite1(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0xc0: { - KyugoIRQEnable = d & 1; - return; - } - - case 0xc1: { - KyugoFlipScreen = d & 1; - return; - } - - case 0xc2: { - KyugoSubCPUEnable = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall GyrodinePortWrite1(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - KyugoIRQEnable = d & 1; - return; - } - - case 0x01: { - KyugoFlipScreen = d & 1; - return; - } - - case 0x02: { - KyugoSubCPUEnable = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall SrdmissnPortWrite1(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x08: { - KyugoIRQEnable = d & 1; - return; - } - - case 0x09: { - KyugoFlipScreen = d & 1; - return; - } - - case 0x0a: { - KyugoSubCPUEnable = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall FlashgalRead2(UINT16 a) -{ - switch (a) { - case 0xc000: { - return KyugoInput[2]; - } - - case 0xc040: { - return KyugoInput[1]; - } - - case 0xc080: { - return KyugoInput[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall FlashgalaRead2(UINT16 a) -{ - switch (a) { - case 0xc040: { - return KyugoInput[0]; - } - - case 0xc080: { - return KyugoInput[1]; - } - - case 0xc0c0: { - return KyugoInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall GyrodineRead2(UINT16 a) -{ - switch (a) { - case 0x8000: { - return KyugoInput[2]; - } - - case 0x8040: { - return KyugoInput[1]; - } - - case 0x8080: { - return KyugoInput[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall SrdmissnRead2(UINT16 a) -{ - switch (a) { - case 0xf400: { - return KyugoInput[0]; - } - - case 0xf401: { - return KyugoInput[1]; - } - - case 0xf402: { - return KyugoInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall LegendRead2(UINT16 a) -{ - switch (a) { - case 0xf800: { - return KyugoInput[0]; - } - - case 0xf801: { - return KyugoInput[1]; - } - - case 0xf802: { - return KyugoInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall KyugoWrite2(UINT16 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall KyugoPortRead2(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x02: { - return AY8910Read(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall FlashgalaPortRead2(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x42: { - return AY8910Read(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall SrdmissnPortRead2(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x82: { - return AY8910Read(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall FlashgalPortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - AY8910Write(0, 0, d); - return; - } - - case 0x01: { - AY8910Write(0, 1, d); - return; - } - - case 0x40: { - AY8910Write(1, 0, d); - return; - } - - case 0x41: { - AY8910Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall FlashgalaPortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x40: { - AY8910Write(0, 0, d); - return; - } - - case 0x41: { - AY8910Write(0, 1, d); - return; - } - - case 0x80: { - AY8910Write(1, 0, d); - return; - } - - case 0x81: { - AY8910Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall GyrodinePortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - AY8910Write(0, 0, d); - return; - } - - case 0x01: { - AY8910Write(0, 1, d); - return; - } - - case 0xc0: { - AY8910Write(1, 0, d); - return; - } - - case 0xc1: { - AY8910Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall SrdmissnPortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x80: { - AY8910Write(0, 0, d); - return; - } - - case 0x81: { - AY8910Write(0, 1, d); - return; - } - - case 0x84: { - AY8910Write(1, 0, d); - return; - } - - case 0x85: { - AY8910Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[2] = { 0, 4 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 64, 65, 66, 67 }; -static INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 TilePlaneOffsets[3] = { 0, 0x10000, 0x20000 }; -static INT32 TileXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 TileYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 SpritePlaneOffsets[3] = { 0, 0x40000, 0x80000 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71 }; -static INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 128, 136, 144, 152, 160, 168, 176, 184 }; - -static UINT8 KyugoDip0Read(UINT32 /*a*/) -{ - return KyugoDip[0]; -} - -static UINT8 KyugoDip1Read(UINT32 /*a*/) -{ - return KyugoDip[1]; -} - -static INT32 KyugoInit() -{ - INT32 nRet = 0, nLen, i; - - KyugoNumZ80Rom1 = 4; - KyugoNumZ80Rom2 = 4; - KyugoNumSpriteRom = 6; - KyugoSizeZ80Rom1 = 0x2000; - KyugoSizeZ80Rom2 = 0x2000; - KyugoSizeSpriteRom = 0x4000; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "airwolf") || !strcmp(BurnDrvGetTextA(DRV_NAME), "airwolfa")) { - KyugoNumZ80Rom1 = 1; - KyugoNumZ80Rom2 = 1; - KyugoNumSpriteRom = 3; - KyugoSizeZ80Rom1 = 0x8000; - KyugoSizeZ80Rom2 = 0x8000; - KyugoSizeSpriteRom = 0x8000; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gyrodine") || !strcmp(BurnDrvGetTextA(DRV_NAME), "gyrodinet") || !strcmp(BurnDrvGetTextA(DRV_NAME), "buzzard")) { - KyugoNumZ80Rom2 = 1; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "legend")) { - KyugoNumZ80Rom1 = 2; - KyugoNumZ80Rom2 = 4; - KyugoSizeZ80Rom1 = 0x4000; - KyugoSizeZ80Rom2 = 0x2000; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "sonofphx") || !strcmp(BurnDrvGetTextA(DRV_NAME), "repulse") || !strcmp(BurnDrvGetTextA(DRV_NAME), "99lstwar") || !strcmp(BurnDrvGetTextA(DRV_NAME), "99lstwara") || !strcmp(BurnDrvGetTextA(DRV_NAME), "99lstwark")) { - KyugoNumZ80Rom1 = 3; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "skywolf") || !strcmp(BurnDrvGetTextA(DRV_NAME), "srdmissn") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fx")) { - KyugoNumZ80Rom1 = 2; - KyugoNumZ80Rom2 = 2; - KyugoSizeZ80Rom1 = 0x4000; - KyugoSizeZ80Rom2 = 0x4000; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "skywolf2")) { - KyugoNumZ80Rom1 = 1; - KyugoNumZ80Rom2 = 2; - KyugoSizeZ80Rom1 = 0x8000; - KyugoSizeZ80Rom2 = 0x4000; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "fxa")) { - KyugoNumZ80Rom1 = 1; - KyugoNumZ80Rom2 = 1; - KyugoNumSpriteRom = 3; - KyugoSizeZ80Rom1 = 0x8000; - KyugoSizeZ80Rom2 = 0x8000; - KyugoSizeSpriteRom = 0x8000; - } - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - KyugoTempRom = (UINT8 *)BurnMalloc(0x18000); - - // Load Z80 #1 Program Roms - for (i = 0; i < KyugoNumZ80Rom1; i++) { - nRet = BurnLoadRom(KyugoZ80Rom1 + (KyugoSizeZ80Rom1 * i), i, 1); if (nRet != 0) return 1; - } - - // Load Z80 #2 Program Roms - for (i = KyugoNumZ80Rom1; i < KyugoNumZ80Rom2 + KyugoNumZ80Rom1; i++) { - nRet = BurnLoadRom(KyugoZ80Rom2 + (KyugoSizeZ80Rom2 * (i - KyugoNumZ80Rom1)), i, 1); if (nRet != 0) return 1; - } - - // Load and decode the chars - nRet = BurnLoadRom(KyugoTempRom, KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 0, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, KyugoTempRom, KyugoChars); - - // Load and decode the tiles - memset(KyugoTempRom, 0, 0x18000); - nRet = BurnLoadRom(KyugoTempRom + 0x00000, KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(KyugoTempRom + 0x02000, KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(KyugoTempRom + 0x04000, KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 3, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 3, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, KyugoTempRom, KyugoTiles); - - // Load and decode the sprites - memset(KyugoTempRom, 0, 0x18000); - for (i = KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 4; i < KyugoNumSpriteRom + KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 4; i++) { - nRet = BurnLoadRom(KyugoTempRom + (KyugoSizeSpriteRom * (i - KyugoNumZ80Rom2 - KyugoNumZ80Rom1 - 4)), i, 1); if (nRet != 0) return 1; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "airwolf") || !strcmp(BurnDrvGetTextA(DRV_NAME), "airwolfa")) { - UINT8 *Temp = (UINT8*)BurnMalloc(0x18000); - memcpy(Temp, KyugoTempRom, 0x18000); - memcpy(KyugoTempRom + 0x00000, Temp + 0x00000, 0x2000); - memcpy(KyugoTempRom + 0x04000, Temp + 0x02000, 0x2000); - memcpy(KyugoTempRom + 0x02000, Temp + 0x04000, 0x2000); - memcpy(KyugoTempRom + 0x06000, Temp + 0x06000, 0x2000); - memcpy(KyugoTempRom + 0x08000, Temp + 0x08000, 0x2000); - memcpy(KyugoTempRom + 0x0c000, Temp + 0x0a000, 0x2000); - memcpy(KyugoTempRom + 0x0a000, Temp + 0x0c000, 0x2000); - memcpy(KyugoTempRom + 0x0e000, Temp + 0x0e000, 0x2000); - memcpy(KyugoTempRom + 0x10000, Temp + 0x10000, 0x2000); - memcpy(KyugoTempRom + 0x14000, Temp + 0x12000, 0x2000); - memcpy(KyugoTempRom + 0x12000, Temp + 0x14000, 0x2000); - memcpy(KyugoTempRom + 0x16000, Temp + 0x16000, 0x2000); - BurnFree(Temp); - } - GfxDecode(0x400, 3, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, KyugoTempRom, KyugoSprites); - - // Load the PROMs - nRet = BurnLoadRom(KyugoPromRed, KyugoNumSpriteRom + KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(KyugoPromGreen, KyugoNumSpriteRom + KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(KyugoPromBlue, KyugoNumSpriteRom + KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 6, 1); if (nRet != 0) return 1; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "flashgal") || !strcmp(BurnDrvGetTextA(DRV_NAME), "flashgala") || !strcmp(BurnDrvGetTextA(DRV_NAME), "flashgalk") || !strcmp(BurnDrvGetTextA(DRV_NAME), "gyrodine") || !strcmp(BurnDrvGetTextA(DRV_NAME), "gyrodinet") || !strcmp(BurnDrvGetTextA(DRV_NAME), "buzzard") || !strcmp(BurnDrvGetTextA(DRV_NAME), "legend") || !strcmp(BurnDrvGetTextA(DRV_NAME), "srdmissn") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fx") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fxa")) { - nRet = BurnLoadRom(KyugoPromCharLookup, KyugoNumSpriteRom + KyugoNumZ80Rom2 + KyugoNumZ80Rom1 + 7, 1); if (nRet != 0) return 1; - } - - BurnFree(KyugoTempRom); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(KyugoRead1); - ZetSetWriteHandler(KyugoWrite1); - ZetMapArea(0x0000, 0x7fff, 0, KyugoZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, KyugoZ80Rom1 ); - ZetMapArea(0x8000, 0x87ff, 0, KyugoBgVideoRam ); - ZetMapArea(0x8000, 0x87ff, 1, KyugoBgVideoRam ); - ZetMapArea(0x8000, 0x87ff, 2, KyugoBgVideoRam ); - ZetMapArea(0x8800, 0x8fff, 0, KyugoBgAttrRam ); - ZetMapArea(0x8800, 0x8fff, 1, KyugoBgAttrRam ); - ZetMapArea(0x8800, 0x8fff, 2, KyugoBgAttrRam ); - ZetMapArea(0x9000, 0x97ff, 0, KyugoFgVideoRam ); - ZetMapArea(0x9000, 0x97ff, 1, KyugoFgVideoRam ); - ZetMapArea(0x9000, 0x97ff, 2, KyugoFgVideoRam ); - ZetMapArea(0x9800, 0x9fff, 1, KyugoSprite2Ram ); - ZetMapArea(0x9800, 0x9fff, 2, KyugoSprite2Ram ); - ZetMapArea(0xa000, 0xa7ff, 0, KyugoSprite1Ram ); - ZetMapArea(0xa000, 0xa7ff, 1, KyugoSprite1Ram ); - ZetMapArea(0xa000, 0xa7ff, 2, KyugoSprite1Ram ); - ZetMapArea(0xf000, 0xf7ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetWriteHandler(KyugoWrite2); - ZetSetInHandler(KyugoPortRead2); - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gyrodine") || !strcmp(BurnDrvGetTextA(DRV_NAME), "gyrodinet") || !strcmp(BurnDrvGetTextA(DRV_NAME), "buzzard")) { - ZetMapArea(0x0000, 0x1fff, 0, KyugoZ80Rom2 ); - ZetMapArea(0x0000, 0x1fff, 2, KyugoZ80Rom2 ); - } else { - ZetMapArea(0x0000, 0x7fff, 0, KyugoZ80Rom2 ); - ZetMapArea(0x0000, 0x7fff, 2, KyugoZ80Rom2 ); - } - ZetClose(); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "airwolf") || !strcmp(BurnDrvGetTextA(DRV_NAME), "airwolfa") || !strcmp(BurnDrvGetTextA(DRV_NAME), "skywolf") || !strcmp(BurnDrvGetTextA(DRV_NAME), "skywolf2")) { - ZetOpen(0); - ZetSetOutHandler(SrdmissnPortWrite1); - ZetMapArea(0xe000, 0xe7ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - - ZetOpen(1); - ZetSetReadHandler(SrdmissnRead2); - ZetSetInHandler(SrdmissnPortRead2); - ZetSetOutHandler(SrdmissnPortWrite2); - ZetMapArea(0x8000, 0x87ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "flashgal") || !strcmp(BurnDrvGetTextA(DRV_NAME), "flashgalk")) { - ZetOpen(0); - ZetSetOutHandler(FlashgalPortWrite1); - ZetClose(); - - ZetOpen(1); - ZetSetReadHandler(FlashgalRead2); - ZetSetOutHandler(FlashgalPortWrite2); - ZetMapArea(0xa000, 0xa7ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0xa000, 0xa7ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0xa000, 0xa7ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "flashgala")) { - ZetOpen(0); - ZetSetOutHandler(FlashgalaPortWrite1); - ZetClose(); - - ZetOpen(1); - ZetSetReadHandler(FlashgalaRead2); - ZetSetInHandler(FlashgalaPortRead2); - ZetSetOutHandler(FlashgalaPortWrite2); - ZetMapArea(0xe000, 0xe7ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gyrodine") || !strcmp(BurnDrvGetTextA(DRV_NAME), "gyrodinet") || !strcmp(BurnDrvGetTextA(DRV_NAME), "buzzard")) { - ZetOpen(0); - ZetSetOutHandler(GyrodinePortWrite1); - ZetClose(); - - ZetOpen(1); - ZetSetReadHandler(GyrodineRead2); - ZetSetOutHandler(GyrodinePortWrite2); - ZetMapArea(0x4000, 0x47ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0x4000, 0x47ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0x4000, 0x47ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "legend")) { - ZetOpen(0); - ZetSetOutHandler(GyrodinePortWrite1); - ZetClose(); - - ZetOpen(1); - ZetSetReadHandler(LegendRead2); - ZetSetInHandler(SrdmissnPortRead2); - ZetSetOutHandler(SrdmissnPortWrite2); - ZetMapArea(0xc000, 0xc7ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "sonofphx") || !strcmp(BurnDrvGetTextA(DRV_NAME), "repulse") || !strcmp(BurnDrvGetTextA(DRV_NAME), "99lstwar") || !strcmp(BurnDrvGetTextA(DRV_NAME), "99lstwara") || !strcmp(BurnDrvGetTextA(DRV_NAME), "99lstwark")) { - ZetOpen(0); - ZetSetOutHandler(GyrodinePortWrite1); - ZetClose(); - - ZetOpen(1); - ZetSetReadHandler(FlashgalRead2); - ZetSetOutHandler(FlashgalPortWrite2); - ZetMapArea(0xa000, 0xa7ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0xa000, 0xa7ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0xa000, 0xa7ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "srdmissn") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fx") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fxa")) { - ZetOpen(0); - ZetSetOutHandler(SrdmissnPortWrite1); - ZetMapArea(0xe000, 0xe7ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - - ZetOpen(1); - ZetSetReadHandler(SrdmissnRead2); - ZetSetInHandler(SrdmissnPortRead2); - ZetSetOutHandler(SrdmissnPortWrite2); - ZetMapArea(0x8000, 0x87ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 2, KyugoSharedZ80Ram ); - ZetMapArea(0x8800, 0x8fff, 0, KyugoZ80Ram2 ); - ZetMapArea(0x8800, 0x8fff, 1, KyugoZ80Ram2 ); - ZetMapArea(0x8800, 0x8fff, 2, KyugoZ80Ram2 ); - ZetClose(); - } - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - AY8910Init(0, 18432000 / 12, nBurnSoundRate, &KyugoDip0Read, &KyugoDip1Read, NULL, NULL); - AY8910Init(1, 18432000 / 12, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - KyugoDoReset(); - - return 0; -} - -static INT32 Skywolf3Init() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - KyugoTempRom = (UINT8 *)BurnMalloc(0x18000); - UINT8 *pTemp = (UINT8*)BurnMalloc(0x8000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(pTemp, 0, 1); if (nRet != 0) return 1; - memcpy(KyugoZ80Rom1 + 0x00000, pTemp + 0x04000, 0x4000); - nRet = BurnLoadRom(pTemp, 1, 1); if (nRet != 0) return 1; - memcpy(KyugoZ80Rom1 + 0x04000, pTemp + 0x04000, 0x4000); - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(pTemp, 2, 1); if (nRet != 0) return 1; - memcpy(KyugoZ80Rom2 + 0x00000, pTemp + 0x04000, 0x4000); - nRet = BurnLoadRom(pTemp, 3, 1); if (nRet != 0) return 1; - memcpy(KyugoZ80Rom2 + 0x04000, pTemp + 0x04000, 0x4000); - - // Load and decode the chars - nRet = BurnLoadRom(pTemp, 4, 1); if (nRet != 0) return 1; - memcpy(KyugoTempRom + 0x00000, pTemp + 0x07000, 0x1000); - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, KyugoTempRom, KyugoChars); - - // Load and decode the tiles - memset(KyugoTempRom, 0, 0x18000); - nRet = BurnLoadRom(pTemp, 5, 1); if (nRet != 0) return 1; - memcpy(KyugoTempRom + 0x00000, pTemp + 0x06000, 0x2000); - nRet = BurnLoadRom(pTemp, 6, 1); if (nRet != 0) return 1; - memcpy(KyugoTempRom + 0x02000, pTemp + 0x06000, 0x2000); - nRet = BurnLoadRom(pTemp, 7, 1); if (nRet != 0) return 1; - memcpy(KyugoTempRom + 0x04000, pTemp + 0x06000, 0x2000); - GfxDecode(0x400, 3, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, KyugoTempRom, KyugoTiles); - - // Load and decode the sprites - memset(KyugoTempRom, 0, 0x18000); - nRet = BurnLoadRom(KyugoTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(KyugoTempRom + 0x08000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(KyugoTempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 3, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, KyugoTempRom, KyugoSprites); - - // Load the PROMs - nRet = BurnLoadRom(KyugoPromRed, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(KyugoPromGreen, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(KyugoPromBlue, 13, 1); if (nRet != 0) return 1; - - BurnFree(KyugoTempRom); - BurnFree(pTemp); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(KyugoRead1); - ZetSetWriteHandler(KyugoWrite1); - ZetMapArea(0x0000, 0x7fff, 0, KyugoZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, KyugoZ80Rom1 ); - ZetMapArea(0x8000, 0x87ff, 0, KyugoBgVideoRam ); - ZetMapArea(0x8000, 0x87ff, 1, KyugoBgVideoRam ); - ZetMapArea(0x8000, 0x87ff, 2, KyugoBgVideoRam ); - ZetMapArea(0x8800, 0x8fff, 0, KyugoBgAttrRam ); - ZetMapArea(0x8800, 0x8fff, 1, KyugoBgAttrRam ); - ZetMapArea(0x8800, 0x8fff, 2, KyugoBgAttrRam ); - ZetMapArea(0x9000, 0x97ff, 0, KyugoFgVideoRam ); - ZetMapArea(0x9000, 0x97ff, 1, KyugoFgVideoRam ); - ZetMapArea(0x9000, 0x97ff, 2, KyugoFgVideoRam ); - ZetMapArea(0x9800, 0x9fff, 1, KyugoSprite2Ram ); - ZetMapArea(0x9800, 0x9fff, 2, KyugoSprite2Ram ); - ZetMapArea(0xa000, 0xa7ff, 0, KyugoSprite1Ram ); - ZetMapArea(0xa000, 0xa7ff, 1, KyugoSprite1Ram ); - ZetMapArea(0xa000, 0xa7ff, 2, KyugoSprite1Ram ); - ZetMapArea(0xf000, 0xf7ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0xf000, 0xf7ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetWriteHandler(KyugoWrite2); - ZetSetInHandler(KyugoPortRead2); - ZetMapArea(0x0000, 0x7fff, 0, KyugoZ80Rom2 ); - ZetMapArea(0x0000, 0x7fff, 2, KyugoZ80Rom2 ); - ZetClose(); - - ZetOpen(0); - ZetSetOutHandler(SrdmissnPortWrite1); - ZetMapArea(0xe000, 0xe7ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - - ZetOpen(1); - ZetSetReadHandler(SrdmissnRead2); - ZetSetInHandler(SrdmissnPortRead2); - ZetSetOutHandler(SrdmissnPortWrite2); - ZetMapArea(0x8000, 0x87ff, 0, KyugoSharedZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 1, KyugoSharedZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 2, KyugoSharedZ80Ram ); - ZetClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - AY8910Init(0, 18432000 / 12, nBurnSoundRate, &KyugoDip0Read, &KyugoDip1Read, NULL, NULL); - AY8910Init(1, 18432000 / 12, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - KyugoDoReset(); - - return 0; -} - -static INT32 KyugoExit() -{ - ZetExit(); - - for (INT32 i = 0; i < 2; i++) { - AY8910Exit(i); - } - - GenericTilesExit(); - - KyugoIRQEnable = 0; - KyugoSubCPUEnable = 0; - KyugoFgColour = 0; - KyugoBgPaletteBank = 0; - KyugoBgScrollXHi = 0; - KyugoBgScrollXLo = 0; - KyugoBgScrollY = 0; - KyugoFlipScreen = 0; - - KyugoNumZ80Rom1 = 0; - KyugoNumZ80Rom2 = 0; - KyugoNumSpriteRom = 0; - KyugoSizeZ80Rom1 = 0; - KyugoSizeZ80Rom2 = 0; - KyugoSizeSpriteRom = 0; - - BurnFree(Mem); - - return 0; -} - -static void KyugoCalcPalette() -{ - INT32 i; - - for (i = 0; i < 256; i++) { - INT32 bit0, bit1, bit2, bit3, r, g, b; - - bit0 = (KyugoPromRed[i] >> 0) & 0x01; - bit1 = (KyugoPromRed[i] >> 1) & 0x01; - bit2 = (KyugoPromRed[i] >> 2) & 0x01; - bit3 = (KyugoPromRed[i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (KyugoPromGreen[i] >> 0) & 0x01; - bit1 = (KyugoPromGreen[i] >> 1) & 0x01; - bit2 = (KyugoPromGreen[i] >> 2) & 0x01; - bit3 = (KyugoPromGreen[i] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (KyugoPromBlue[i] >> 0) & 0x01; - bit1 = (KyugoPromBlue[i] >> 1) & 0x01; - bit2 = (KyugoPromBlue[i] >> 2) & 0x01; - bit3 = (KyugoPromBlue[i] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - KyugoPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void KyugoRenderBgLayer() -{ - INT32 mx, my, Code, Attr, Colour, x, y, TileIndex = 0, xScroll, Flip, xFlip, yFlip; - - xScroll = KyugoBgScrollXLo + (KyugoBgScrollXHi * 256); - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = KyugoBgVideoRam[TileIndex]; - Attr = KyugoBgAttrRam[TileIndex]; - Code = Code | ((Attr & 0x03) << 8); - Code &= 0x3ff; - Colour = (Attr >> 4) | (KyugoBgPaletteBank << 4); - Flip = (Attr & 0x0c) >> 2; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - if (KyugoFlipScreen) { - xFlip = !xFlip; - yFlip = !yFlip; - y = 248 - y; - x = 504 - x; - x -= xScroll; - y += KyugoBgScrollY; - } else { - x -= xScroll; - y -= KyugoBgScrollY; - } - - if (x < -8) x += 512; - if (y < -8) y += 256; - if (y > 264) y -= 256; - - x -= 32; - y -= 16; - - if (x > 8 && x < 280 && y > 8 && y < 216) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_FlipXY(pTransDraw, Code, x, y, Colour, 3, 0, KyugoTiles); - } else { - Render8x8Tile_FlipX(pTransDraw, Code, x, y, Colour, 3, 0, KyugoTiles); - } - } else { - if (yFlip) { - Render8x8Tile_FlipY(pTransDraw, Code, x, y, Colour, 3, 0, KyugoTiles); - } else { - Render8x8Tile(pTransDraw, Code, x, y, Colour, 3, 0, KyugoTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, KyugoTiles); - } else { - Render8x8Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 3, 0, KyugoTiles); - } - } else { - if (yFlip) { - Render8x8Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, KyugoTiles); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 3, 0, KyugoTiles); - } - } - } - - TileIndex++; - } - } -} - -static void KyugoRenderSpriteLayer() -{ - UINT8 *SpriteRam_Area1 = &KyugoSprite1Ram[0x28]; - UINT8 *SpriteRam_Area2 = &KyugoSprite2Ram[0x28]; - UINT8 *SpriteRam_Area3 = &KyugoFgVideoRam[0x28]; - - INT32 i; - - for (i = 0; i < 24; i++) { - INT32 Offset, y, sy, sx, Colour; - - Offset = 2 * (i % 12) + 64 * (i / 12); - - sx = SpriteRam_Area3[Offset + 1] + 256 * (SpriteRam_Area2[Offset + 1] & 1); - if (sx > 320) sx -= 512; - sy = 255 - SpriteRam_Area1[Offset] + 2; - if (sy > 0xf0) sy -= 256; - if (KyugoFlipScreen) sy = 240 - sy; - sy -= 16; - - Colour = SpriteRam_Area1[Offset + 1] & 0x1f; - - for (y = 0; y < 16; y++) { - INT32 Code, Attr, FlipX, FlipY, yPos; - - Code = SpriteRam_Area3[Offset + 128 * y]; - Attr = SpriteRam_Area2[Offset + 128 * y]; - Code = Code | ((Attr & 0x01) << 9) | ((Attr & 0x02) << 7); - Code &= 0x3ff; - - FlipX = Attr & 0x08; - FlipY = Attr & 0x04; - - yPos = sy + 16 * y; - - if (KyugoFlipScreen) { - FlipX = !FlipX; - FlipY = !FlipY; - yPos = sy - 16 * y; - } - - if (sx > 16 && sx < 272 && yPos > 16 && yPos < 208) { - if (FlipX) { - if (FlipY) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, sx, yPos, Colour, 3, 0, 0, KyugoSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, yPos, Colour, 3, 0, 0, KyugoSprites); - } - } else { - if (FlipY) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, sx, yPos, Colour, 3, 0, 0, KyugoSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, sx, yPos, Colour, 3, 0, 0, KyugoSprites); - } - } - } else { - if (FlipX) { - if (FlipY) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, yPos, Colour, 3, 0, 0, KyugoSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, yPos, Colour, 3, 0, 0, KyugoSprites); - } - } else { - if (FlipY) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, yPos, Colour, 3, 0, 0, KyugoSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, yPos, Colour, 3, 0, 0, KyugoSprites); - } - } - } - } - } -} - -static void KyugoRenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0, FlipX = 0, FlipY = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = KyugoFgVideoRam[TileIndex]; - Colour = 2 * KyugoPromCharLookup[Code >> 3] + KyugoFgColour; - Code &= 0xff; - - x = 8 * mx; - y = 8 * my; - - if (KyugoFlipScreen) { - FlipX = 1; - FlipY = 1; - y = 248 - y; - x = 280 - x; - } - - y -= 16; - - if (x > 0 && x < 280 && y > 0 && y < 216) { - if (FlipX) { - if (FlipY) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 2, 0, 0, KyugoChars); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 2, 0, 0, KyugoChars); - } - } else { - if (FlipY) { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 2, 0, 0, KyugoChars); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 2, 0, 0, KyugoChars); - } - } - } else { - if (FlipX) { - if (FlipY) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, KyugoChars); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, KyugoChars); - } - } else { - if (FlipY) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, KyugoChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, KyugoChars); - } - } - } - - TileIndex++; - } - } -} - -static void KyugoDraw() -{ - BurnTransferClear(); - KyugoCalcPalette(); - if (nBurnLayer & 1) KyugoRenderBgLayer(); - if (nBurnLayer & 2) KyugoRenderSpriteLayer(); - if (nBurnLayer & 4) KyugoRenderCharLayer(); - BurnTransferCopy(KyugoPalette); -} - -static INT32 KyugoFrame() -{ - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - if (KyugoReset) KyugoDoReset(); - - KyugoMakeInputs(); - - nCyclesTotal[0] = (18432000 / 6) / 60; - nCyclesTotal[1] = (18432000 / 6) / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 9 && KyugoIRQEnable) ZetNmi(); - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - if (KyugoSubCPUEnable) { - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 2 || i == 4 || i == 6 || i == 8) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) KyugoDraw(); - - return 0; -} - -static INT32 KyugoScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029674; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); // Scan Z80 - AY8910Scan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(KyugoDip); - SCAN_VAR(KyugoInput); - SCAN_VAR(KyugoIRQEnable); - SCAN_VAR(KyugoSubCPUEnable); - SCAN_VAR(KyugoFgColour); - SCAN_VAR(KyugoBgPaletteBank); - SCAN_VAR(KyugoBgScrollXHi); - SCAN_VAR(KyugoBgScrollXLo); - SCAN_VAR(KyugoBgScrollY); - SCAN_VAR(KyugoFlipScreen); - } - - - return 0; -} - -struct BurnDriver BurnDrvAirwolf = { - "airwolf", NULL, NULL, NULL, "1987", - "Airwolf\0", NULL, "Kyugo", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, AirwolfRomInfo, AirwolfRomName, NULL, NULL, KyugoInputInfo, AirwolfDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAirwolfa = { - "airwolfa", "airwolf", NULL, NULL, "1987", - "Airwolf (US)\0", NULL, "Kyugo (United Amusements license)", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, AirwolfaRomInfo, AirwolfaRomName, NULL, NULL, KyugoInputInfo, AirwolfDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSkywolf = { - "skywolf", "airwolf", NULL, NULL, "1987", - "Sky Wolf (set 1)\0", NULL, "bootleg", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, SkywolfRomInfo, SkywolfRomName, NULL, NULL, KyugoInputInfo, SkywolfDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSkywolf2 = { - "skywolf2", "airwolf", NULL, NULL, "1987", - "Sky Wolf (set 2)\0", NULL, "bootleg", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, Skywolf2RomInfo, Skywolf2RomName, NULL, NULL, KyugoInputInfo, AirwolfDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSkywolf3 = { - "skywolf3", "airwolf", NULL, NULL, "1987", - "Sky Wolf (set 3)\0", NULL, "bootleg", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, Skywolf3RomInfo, Skywolf3RomName, NULL, NULL, KyugoInputInfo, AirwolfDIPInfo, - Skywolf3Init, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlashgal = { - "flashgal", NULL, NULL, NULL, "1985", - "Flashgal (set 1)\0", NULL, "Sega", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, FlashgalRomInfo, FlashgalRomName, NULL, NULL, KyugoInputInfo, FlashgalDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlashgalk = { - "flashgalk", "flashgal", NULL, NULL, "1985", - "Flashgal (set 1, Kyugo logo)\0", NULL, "Sega", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, FlashgalkRomInfo, FlashgalkRomName, NULL, NULL, KyugoInputInfo, FlashgalDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlashgala = { - "flashgala", "flashgal", NULL, NULL, "1985", - "Flashgal (set 2)\0", NULL, "Sega", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, FlashgalaRomInfo, FlashgalaRomName, NULL, NULL, KyugoInputInfo, FlashgalDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGyrodine = { - "gyrodine", NULL, NULL, NULL, "1984", - "Gyrodine\0", NULL, "Crux", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, GyrodineRomInfo, GyrodineRomName, NULL, NULL, KyugoInputInfo, GyrodineDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvGyrodinet = { - "gyrodinet", "gyrodine", NULL, NULL, "1984", - "Gyrodine (Taito Corporation license)\0", NULL, "Crux (Taito Corporation license)", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, GyrodinetRomInfo, GyrodinetRomName, NULL, NULL, KyugoInputInfo, GyrodineDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvBuzzard = { - "buzzard", "gyrodine", NULL, NULL, "1984", - "Buzzard\0", NULL, "Crux", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, BuzzardRomInfo, BuzzardRomName, NULL, NULL, KyugoInputInfo, GyrodineDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvLegend = { - "legend", NULL, NULL, NULL, "1986", - "Legend\0", NULL, "Sega / Coreland", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, LegendRomInfo, LegendRomName, NULL, NULL, KyugoInputInfo, LegendDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSonofphx = { - "sonofphx", "repulse", NULL, NULL, "1985", - "Son of Phoenix\0", NULL, "Associated Overseas MFR, Inc", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, SonofphxRomInfo, SonofphxRomName, NULL, NULL, KyugoInputInfo, SonofphxDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvRepulse = { - "repulse", NULL, NULL, NULL, "1985", - "Repulse\0", NULL, "Sega", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, RepulseRomInfo, RepulseRomName, NULL, NULL, KyugoInputInfo, SonofphxDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrv99lstwar = { - "99lstwar", "repulse", NULL, NULL, "1985", - "'99: The Last War\0", NULL, "Proma", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, Lstwar99RomInfo, Lstwar99RomName, NULL, NULL, KyugoInputInfo, SonofphxDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrv99lstwara = { - "99lstwara", "repulse", NULL, NULL, "1985", - "'99: The Last War (alternate)\0", NULL, "Proma", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, Lstwra99RomInfo, Lstwra99RomName, NULL, NULL, KyugoInputInfo, SonofphxDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrv99lstwark = { - "99lstwark", "repulse", NULL, NULL, "1985", - "'99: The Last War (Kyugo)\0", NULL, "Kyugo", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, Lstwrk99RomInfo, Lstwrk99RomName, NULL, NULL, KyugoInputInfo, SonofphxDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvSrdmissn = { - "srdmissn", NULL, NULL, NULL, "1986", - "S.R.D. Mission\0", NULL, "Taito Corporation", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, SrdmissnRomInfo, SrdmissnRomName, NULL, NULL, KyugoInputInfo, SrdmissnDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvFx = { - "fx", "srdmissn", NULL, NULL, "1986", - "F-X\0", NULL, "bootleg", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, FxRomInfo, FxRomName, NULL, NULL, KyugoInputInfo, SrdmissnDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; - -struct BurnDriver BurnDrvFxa = { - "fxa", "srdmissn", NULL, NULL, "1986", - "F-X (alternate set)\0", NULL, "bootleg", "Kyugo", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, FxaRomInfo, FxaRomName, NULL, NULL, KyugoInputInfo, SrdmissnDIPInfo, - KyugoInit, KyugoExit, KyugoFrame, NULL, KyugoScan, - NULL, 0x100, 224, 288, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_ladybug.cpp b/jan/src/burn/drv/pre90s/d_ladybug.cpp deleted file mode 100644 index 64812bace..000000000 --- a/jan/src/burn/drv/pre90s/d_ladybug.cpp +++ /dev/null @@ -1,1597 +0,0 @@ -// FB Alpha Lady Bug driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80Ops0; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvColRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvGridRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; -static UINT8 *soundlatch; -static UINT8 *gridcolor; -static UINT8 *enablestars; -static UINT8 *starspeed; - -static INT32 stars_offset; -static INT32 stars_state; -static INT32 vblank; -static INT32 ladybug = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[4]; -static UINT8 DrvReset; - -// 4-Way input stuff -static UINT8 fourwaymode = 0; // enabled or disabled (per-game) - -static struct BurnInputInfo LadybugInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 7, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ladybug) - -static struct BurnInputInfo SraiderInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Sraider) - -static struct BurnDIPInfo LadybugDIPList[]= -{ - {0x12, 0xff, 0xff, 0xdf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x03, "Easy" }, - {0x12, 0x01, 0x03, 0x02, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "High Score Names" }, - {0x12, 0x01, 0x04, 0x00, "3 Letters" }, - {0x12, 0x01, 0x04, 0x04, "10 Letters" }, - - {0 , 0xfe, 0 , 2, "Rack Test (Cheat)" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x20, 0x00, "Upright" }, - {0x12, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x40, 0x40, "No" }, - {0x12, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x80, 0x80, "3" }, - {0x12, 0x01, 0x80, 0x00, "5" }, - - {0 , 0xfe, 0 , 10, "Coin B" }, - {0x13, 0x01, 0x0f, 0x06, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 10, "Coin A" }, - {0x13, 0x01, 0xf0, 0x60, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, -}; - -STDDIPINFO(Ladybug) - -static struct BurnDIPInfo SnapjackDIPList[]= -{ - {0x12, 0xff, 0xff, 0xf7, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x03, "Easy" }, - {0x12, 0x01, 0x03, 0x02, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "High Score Names" }, - {0x12, 0x01, 0x04, 0x00, "3 Letters" }, - {0x12, 0x01, 0x04, 0x04, "10 Letters" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x08, 0x00, "Upright" }, - {0x12, 0x01, 0x08, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, - {0x12, 0x01, 0xc0, 0x40, "5" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x13, 0x01, 0x0f, 0x05, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x13, 0x01, 0xf0, 0x50, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, -}; - -STDDIPINFO(Snapjack) - -static struct BurnDIPInfo CavengerDIPList[]= -{ - {0x12, 0xff, 0xff, 0xc7, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x03, "Easy" }, - {0x12, 0x01, 0x03, 0x02, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "High Score Names" }, - {0x12, 0x01, 0x04, 0x00, "3 Letters" }, - {0x12, 0x01, 0x04, 0x04, "10 Letters" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x08, 0x00, "Upright" }, - {0x12, 0x01, 0x08, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Initial High Score" }, - {0x12, 0x01, 0x30, 0x00, "0" }, - {0x12, 0x01, 0x30, 0x30, "5000" }, - {0x12, 0x01, 0x30, 0x20, "8000" }, - {0x12, 0x01, 0x30, 0x10, "10000" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, - {0x12, 0x01, 0xc0, 0x40, "5" }, - - {0 , 0xfe, 0 , 10, "Coin B" }, - {0x13, 0x01, 0x0f, 0x06, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 10, "Coin A" }, - {0x13, 0x01, 0xf0, 0x60, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, -}; - -STDDIPINFO(Cavenger) - -static struct BurnDIPInfo DorodonDIPList[]= -{ - {0x12, 0xff, 0xff, 0xdf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x03, "Easy" }, - {0x12, 0x01, 0x03, 0x02, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x04, 0x04, "20000" }, - {0x12, 0x01, 0x04, 0x00, "30000" }, - - {0 , 0xfe, 0 , 2, "Rack Test (Cheat)" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x20, 0x00, "Upright" }, - {0x12, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x40, 0x40, "No" }, - {0x12, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x80, 0x80, "3" }, - {0x12, 0x01, 0x80, 0x00, "5" }, - - {0 , 0xfe, 0 , 10, "Coin B" }, - {0x13, 0x01, 0x0f, 0x06, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 10, "Coin A" }, - {0x13, 0x01, 0xf0, 0x60, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, -}; - -STDDIPINFO(Dorodon) - -static struct BurnDIPInfo SraiderDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xdf, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0f, 0x01, 0x03, 0x03, "Easy" }, - {0x0f, 0x01, 0x03, 0x02, "Medium" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "High Score Names" }, - {0x0f, 0x01, 0x04, 0x00, "3 Letters" }, - {0x0f, 0x01, 0x04, 0x04, "10 Letters" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0f, 0x01, 0x08, 0x08, "No" }, - {0x0f, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x20, 0x00, "Upright" }, - {0x0f, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0xc0, 0x00, "2" }, - {0x0f, 0x01, 0xc0, 0xc0, "3" }, - {0x0f, 0x01, 0xc0, 0x80, "4" }, - {0x0f, 0x01, 0xc0, 0x40, "5" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x10, 0x01, 0x0f, 0x06, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "2 Coins 2 Credits" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x10, 0x01, 0xf0, 0x60, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "2 Coins 2 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Sraider) - -void __fastcall ladybug_write(UINT16 address, UINT8 data) -{ - switch (address & 0xf000) - { - case 0xa000: - *flipscreen = data & 1; - return; - - case 0xb000: - SN76496Write(0, data); - return; - - case 0xc000: - SN76496Write(1, data); - return; - } -} - -UINT8 __fastcall ladybug_read(UINT16 address) -{ - switch (address) - { - case 0x8005: - return 0x3e; - - case 0x9000: - return DrvInputs[0]; - - case 0x9001: { - if (ladybug) { - if (DrvDips[0] & 0x20) { - return DrvInputs[1] ^ vblank; - } else { - return (DrvInputs[0] & 0x7f) ^ vblank; - } - } - - return DrvInputs[1] ^ vblank; - } - - case 0x9002: - return DrvDips[0]; - - case 0x9003: - return DrvDips[1]; - - case 0xe000: - return DrvInputs[2]; - } - - return 0; -} - -void __fastcall sraider_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8006: - soundlatch[0] = data; - return; - - case 0x8007: - soundlatch[1] = data; - return; - } -} - -void __fastcall sraider_sub_write(UINT16 address, UINT8 data) -{ - if (address == 0xe800) { - *flipscreen = data & 0x80; - *gridcolor = data & 0x70; - *enablestars = data & 0x08; - *starspeed =(data & 0x07) - 1; - } -} - -UINT8 __fastcall sraider_sub_read(UINT16 address) -{ - switch (address) - { - case 0x8000: - return soundlatch[0]; - - case 0xa000: - return soundlatch[1]; - } - - return 0; -} - -void __fastcall sraider_sub_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - SN76496Write(0, data); - return; - - case 0x08: - SN76496Write(1, data); - return; - - case 0x10: - SN76496Write(2, data); - return; - - case 0x18: - SN76496Write(3, data); - return; - - case 0x20: - SN76496Write(4, data); - return; - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - stars_offset = 0; - stars_state = 0; - vblank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; - DrvZ80Ops0 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x008000; - DrvGfxROM2 = Next; Next += 0x008000; - DrvGfxROM3 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000040; - - DrvPalette = (UINT32*)Next; Next += 0x0082 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000400; - - DrvColRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000400; - DrvGridRAM = Next; Next += 0x000100; - - flipscreen = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000002; - gridcolor = Next; Next += 0x000001; - enablestars = Next; Next += 0x000001; - starspeed = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0x0000, 0x8000 }; - INT32 Plane1[2] = { 0x0001, 0x0000 }; - INT32 XOffs0[8] = { 0x007, 0x006, 0x005, 0x004, 0x003, 0x002, 0x001, 0x000 }; - INT32 YOffs0[8] = { 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038 }; - INT32 XOffs1[16] = { 0x000, 0x002, 0x004, 0x006, 0x008, 0x00a, 0x00c, 0x00e, - 0x080, 0x082, 0x084, 0x086, 0x088, 0x08a, 0x08c, 0x08e }; - INT32 YOffs1[16] = { 0x170, 0x160, 0x150, 0x140, 0x130, 0x120, 0x110, 0x100, - 0x070, 0x060, 0x050, 0x040, 0x030, 0x020, 0x010, 0x000 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x200, 2, 8, 8, Plane0, XOffs0, YOffs0 + 0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x2000); - - GfxDecode(0x080, 2, 16, 16, Plane1, XOffs1, YOffs1 + 0, 0x200, tmp, DrvGfxROM1); - GfxDecode(0x200, 2, 8, 8, Plane1, XOffs1, YOffs1 + 8, 0x080, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x1000); - - GfxDecode(0x200, 1, 8, 8, Plane0, XOffs0, YOffs0 + 0, 0x040, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit(INT32 sh0, INT32 sh1, INT32 sh2, INT32 sh3, INT32 sh4, INT32 sh5) -{ - UINT32 tmp[0x20]; - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0 = (~DrvColPROM[i] >> sh0) & 0x01; - INT32 bit1 = (~DrvColPROM[i] >> sh1) & 0x01; - INT32 r = bit0 * 82 + bit1 * 173; - - bit0 = (~DrvColPROM[i] >> sh2) & 0x01; - bit1 = (~DrvColPROM[i] >> sh3) & 0x01; - INT32 g = bit0 * 82 + bit1 * 173; - - bit0 = (~DrvColPROM[i] >> sh4) & 0x01; - bit1 = (~DrvColPROM[i] >> sh5) & 0x01; - INT32 b = bit0 * 82 + bit1 * 173; - - tmp[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x20; i++) - { - DrvPalette[i + 0x00] = tmp[((i << 3) & 0x18) | ((i >> 2) & 0x07)]; - DrvPalette[i + 0x20] = tmp[BITSWAP08(DrvColPROM[i + 0x20] & 0x0f, 7,6,5,4,0,1,2,3)]; - DrvPalette[i + 0x40] = tmp[BITSWAP08(DrvColPROM[i + 0x20] >> 4, 7,6,5,4,0,1,2,3)]; - } - - DrvRecalc = 1; -} - -static void SraiderPaletteInit() -{ - DrvPaletteInit(3, 0, 5, 4, 7, 6); - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0 = (i >> 3) & 0x01; - INT32 bit1 = (i >> 4) & 0x01; - INT32 b = 0x47 * bit0 + 0x97 * bit1; - - bit0 = (i >> 1) & 0x01; - bit1 = (i >> 2) & 0x01; - INT32 g = 0x47 * bit0 + 0x97 * bit1; - - bit0 = (i >> 0) & 0x01; - INT32 r = 0x47 * bit0; - - DrvPalette[i + 0x60] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DorodonDecode() -{ - UINT8 *tmp = DrvZ80RAM0; - - if (BurnLoadRom(tmp + 0x000, 7, 1)) return 1; - if (BurnLoadRom(tmp + 0x100, 8, 1)) return 1; - for (INT32 i = 0; i < 0x100; i++) { - tmp[i] = (tmp[i] << 4) | tmp[i + 0x100]; - } - - for (INT32 i = 0; i < 0x10000; i++) { - DrvZ80Ops0[i] = tmp[DrvZ80ROM0[i]]; - } - - return 0; -} - -static INT32 DrvInit(INT32 game_select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - switch (game_select) - { - case 0: // ladybug, snapjack - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x01000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x03000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x05000, 5, 1)) return 1; - memcpy (DrvZ80Ops0, DrvZ80ROM0, 0x10000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x01000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x01000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 11, 1)) return 1; - - ladybug = 1; - } - break; - - case 1: // cavenger - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x01000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x03000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x05000, 5, 1)) return 1; - memcpy (DrvZ80Ops0, DrvZ80ROM0, 0x10000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x01000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 10, 1)) return 1; - } - break; - - case 2: // dorodon - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x01000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x01000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 10, 1)) return 1; - - DorodonDecode(); - } - break; - } - - DrvPaletteInit(0, 5, 2, 6, 4, 7); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80Ops0, 0x0000, 0x5fff, MAP_FETCHOP); // dorodon encrypted opcodes - ZetMapMemory(DrvZ80RAM0, 0x6000, 0x6fff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x7000, 0x73ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xd000, 0xd3ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0xd400, 0xd7ff, MAP_RAM); - ZetSetWriteHandler(ladybug_write); - ZetSetReadHandler(ladybug_read); - ZetClose(); - - ZetInit(1); // So reset function can be shared - - SN76489Init(0, 4000000, 0); - SN76489Init(1, 4000000, 1); - SN76496SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 SraiderInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x01000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x01000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 12, 1)) return 1; - - SraiderPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x6000, 0x6fff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x7000, 0x73ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xd000, 0xd3ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0xd400, 0xd7ff, MAP_RAM); - ZetSetWriteHandler(sraider_main_write); - ZetSetReadHandler(ladybug_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x6000, 0x63ff, MAP_RAM); - ZetMapMemory(DrvGridRAM, 0xe000, 0xe0ff, MAP_RAM); - ZetSetWriteHandler(sraider_sub_write); - ZetSetReadHandler(sraider_sub_read); - ZetSetOutHandler(sraider_sub_out); - ZetClose(); - - SN76489Init(0, 4000000, 0); - SN76489Init(1, 4000000, 1); - SN76489Init(2, 4000000, 1); - SN76489Init(3, 4000000, 1); - SN76489Init(4, 4000000, 1); - SN76496SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.60, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(2, 0.60, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(3, 0.60, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(4, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - fourwaymode = 1; - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - SN76496Exit(); - - BurnFree (AllMem); - - ladybug = 0; - - fourwaymode = 0; - - return 0; -} - -static void draw_layer() -{ - for (INT32 offs = 4 * 32; offs < 32 * 28; offs++) { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5); - - sx -= DrvVidRAM[((sy & 3) << 5) | (sy >> 2)] + 8; - if (sx < -7) sx += 256; - - INT32 code = DrvVidRAM[offs] | ((DrvColRAM[offs] & 0x08) << 5); - INT32 color = DrvColRAM[offs] & 0x07; - - if (*flipscreen) { - sx = 240 - sx; - sy = 196 - sy; - - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, (sy * 8) - 32, color, 2, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, (sy * 8) - 32, color, 2, 0, 0, DrvGfxROM0); - } - } -} - -static void boxizer(INT32 x, INT32 y, INT32 w, INT32 h, INT32 pxl) { - INT32 t = x; - while(h-- > 0) { - INT32 c = w; x = t; - while(c-- > 0) { - if (x < nScreenWidth && y < nScreenHeight) - pTransDraw[(y*nScreenWidth) + x] = pxl; - x++; - } - y++; - } -} - -static void draw_grid() -{ - for (INT32 offs = 4 * 32; offs < 32 * 28; offs++) - { - INT32 sx = ((offs & 0x1f) << 3) - 8; - INT32 sy = ((offs >> 5) << 3) - 32; - - if (*flipscreen) { - sx = 240 - sx; - sy = 196 - sy; - - if (offs & 0x200) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, (offs & 0x1ff) ^ 0x1e0, sx, sy, 0, 1, 0, 0x80, DrvGfxROM3); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, offs, sx, sy, 0, 1, 0, 0x80, DrvGfxROM3); - } - } else { - if (offs & 0x200) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, (offs & 0x1ff) ^ 0x1e0, sx, sy, 0, 1, 0, 0x80, DrvGfxROM3); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, offs, sx, sy, 0, 1, 0, 0x80, DrvGfxROM3); - } - } - } - - for (INT32 i = 0; i < 0x100; i++) - { - if (DrvGridRAM[i] != 0) - { - UINT8 x = i; - int height = nScreenHeight; - - if (*flipscreen) - x = ~x; - - boxizer(x, 0, 1, height, 0x81); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x400 - 2*0x40;offs >= 2*0x40;offs -= 0x40) - { - INT32 i = 0; - - while (i < 0x40 && DrvSprRAM[offs + i + 0] != 0) - i += 4; - - while (i > 0) - { - i -= 4; - - if (DrvSprRAM[offs + i + 0] & 0x80) - { - INT32 size = (DrvSprRAM[offs + i + 0] >> 6) & 0x01; - - INT32 code; - if (size) // 16 - code = ((DrvSprRAM[offs + i + 1] >> 2) + 4 * (DrvSprRAM[offs + i + 2] & 0x10)) & 0x7f; - else // 8 - code = (DrvSprRAM[offs + i + 1] + 16 * (DrvSprRAM[offs + i + 2] & 0x10)) & 0x1ff; - - //INT32 code = (DrvSprRAM[offs + i + 1] >> 2) + ((DrvSprRAM[offs + i + 2] & 0x10) << (4 >> size)); - INT32 color = (DrvSprRAM[offs + i + 2] & 0x0f) + 8; - INT32 flipx = DrvSprRAM[offs + i + 0] & 0x20; - INT32 flipy = DrvSprRAM[offs + i + 0] & 0x10; - INT32 sx = DrvSprRAM[offs + i + 3] - 8; - INT32 sy = (DrvSprRAM[offs + i + 0] & 0x0f) + offs / 4 - 32; - - if (size) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 8, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 8, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 8, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 2, 0, 0, DrvGfxROM1); - } - } - } else { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } - } - } - } - } -} - -static void redclash_update_stars() -{ - static INT32 count = 0; - - if (*enablestars == 0) - return; - - count = (count + 1) & 1; - - if (count == 0) - { - stars_offset += ((*starspeed << 1) - 0x09); - stars_offset &= 0xffff; - stars_state = 0; - } - else - { - stars_state = 0x1fc71; - } -} - -static void redclash_draw_stars(INT32 palette_offset, INT32 sraider, INT32 firstx, INT32 lastx) -{ - UINT8 tempbit, feedback, star_color, hcond,vcond; - - if (*enablestars == 0) - return; - - UINT32 state = stars_state; - - for (INT32 i = 0; i < 256 * 256; i++) - { - INT32 xloc = (stars_offset + i) & 0xff; - INT32 yloc = ((stars_offset + i) >> 8) & 0xff; - - xloc -= 8; - yloc -= 32; - - if ((state & 0x10000) == 0) - tempbit = 1; - else - tempbit = 0; - - if ((state & 0x00020) != 0) - feedback = tempbit ^ 1; - else - feedback = tempbit ^ 0; - - hcond = ((xloc + 8) & 0x10) >> 4; - - if (sraider) - vcond = 1; - else - vcond = yloc & 0x01; - - if (xloc >= 0 && xloc < nScreenWidth && - yloc >= 0 && yloc < nScreenHeight) - { - if ((hcond ^ vcond) == 0) - { - if (((state & 0x000ff) == 0x000ff) && (feedback == 0)) - { - if ((xloc >= firstx) && (xloc <= lastx)) - { - star_color = (state >> 9) & 0x1f; - pTransDraw[(yloc * nScreenWidth) + xloc] = palette_offset + star_color; - } - } - } - } - - state = ((state << 1) & 0x1fffe) | feedback; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(0, 5, 2, 6, 4, 7); - DrvRecalc = 0; - } - - BurnTransferClear(); - - draw_layer(); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 SraiderDraw() -{ - if (DrvRecalc) { - SraiderPaletteInit(); - DrvRecalc = 0; - } - - DrvPalette[0x81] = BurnHighCol((*gridcolor & 0x40) ? 0xff : 0, (*gridcolor & 0x20) ? 0xff : 0, (*gridcolor & 0x10) ? 0xff : 0, 0); - - BurnTransferClear(); - - if (*flipscreen) { - redclash_draw_stars(0x60, 1, 0x27, 0xff); - } else { - redclash_draw_stars(0x60, 1, 0x00, 0xd8); - } - redclash_update_stars(); - - draw_grid(); - - draw_layer(); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - INT32 coin = 0; - - { - INT32 previous = DrvInputs[3] ^ 0xff; - - DrvInputs[0] = 0x00; // p1. active=low conv. happens after the 4-way conv. - DrvInputs[1] = 0x00; // p2. "" - DrvInputs[2] = 0xff; - DrvInputs[3] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - if ((previous & 1) != (~DrvInputs[3] & 1)) coin |= 1; - if ((previous & 2) != (~DrvInputs[3] & 2)) coin |= 2; - DrvInputs[1] &= 0x7f; - } - - if (fourwaymode) { - // Convert to 4-way - ProcessJoystick(&DrvInputs[0], 0, 3,1,0,2, INPUT_4WAY); - ProcessJoystick(&DrvInputs[1], 1, 3,1,0,2, INPUT_4WAY); - } - - DrvInputs[0] = ~DrvInputs[0]; // convert to active=low - DrvInputs[1] = ~DrvInputs[1]; - - ZetOpen(0); - if (coin & 1) Z80SetIrqLine(0x20, DrvJoy4[0] ? Z80_ASSERT_LINE : Z80_CLEAR_LINE); - if (coin & 2) Z80SetIrqLine(0x00, DrvJoy4[1] ? Z80_ASSERT_LINE : Z80_CLEAR_LINE); - - vblank = 0xc0; - - for (INT32 i = 0; i < 32; i++) { - if (i == 5) vblank = 0; - if (i == 31) vblank = 0xc0; - - INT32 nSegment = (4000000 / 60) / 32; - - ZetRun(nSegment); - } - - ZetClose(); - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 SraiderFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nTotalCycles[2] = { 4000000 / 60, 4000000 / 60 }; - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - ZetRun(nTotalCycles[0] / nInterleave); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - ZetRun(nTotalCycles[1] / nInterleave); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - SN76496Update(2, pSoundBuf, nSegmentLength); - SN76496Update(3, pSoundBuf, nSegmentLength); - SN76496Update(4, pSoundBuf, nSegmentLength); - - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - SN76496Update(2, pSoundBuf, nSegmentLength); - SN76496Update(3, pSoundBuf, nSegmentLength); - SN76496Update(4, pSoundBuf, nSegmentLength); - } - } - - - if (pBurnDraw) { - SraiderDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029706; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(stars_offset); - SCAN_VAR(stars_state); - } - - return 0; -} - - -// Lady Bug - -static struct BurnRomInfo ladybugRomDesc[] = { - { "l1.c4", 0x1000, 0xd09e0adb, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "l2.d4", 0x1000, 0x88bc4a0a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "l3.e4", 0x1000, 0x53e9efce, 1 | BRF_PRG | BRF_ESS }, // 2 - { "l4.h4", 0x1000, 0xffc424d7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "l5.j4", 0x1000, 0xad6af809, 1 | BRF_PRG | BRF_ESS }, // 4 - { "l6.k4", 0x1000, 0xcf1acca4, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "l9.f7", 0x1000, 0x77b1da1e, 2 | BRF_GRA }, // 6 Characters - { "l0.h7", 0x1000, 0xaa82e00b, 2 | BRF_GRA }, // 7 - - { "l8.l7", 0x1000, 0x8b99910b, 3 | BRF_GRA }, // 8 Sprites - { "l7.m7", 0x1000, 0x86a5b448, 3 | BRF_GRA }, // 9 - - { "10-2.k1", 0x0020, 0xdf091e52, 4 | BRF_GRA }, // 10 Color PROMs - { "10-1.f4", 0x0020, 0x40640d8f, 4 | BRF_GRA }, // 11 - { "10-3.c4", 0x0020, 0x27fa3a50, 4 | BRF_OPT }, // 12 -}; - -STD_ROM_PICK(ladybug) -STD_ROM_FN(ladybug) - -static INT32 LadybugInit() -{ - fourwaymode = 1; - - return DrvInit(0); -} - -struct BurnDriver BurnDrvLadybug = { - "ladybug", NULL, NULL, NULL, "1981", - "Lady Bug\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, ladybugRomInfo, ladybugRomName, NULL, NULL, LadybugInputInfo, LadybugDIPInfo, - LadybugInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 196, 240, 3, 4 -}; - - -// Lady Bug (bootleg set 1) - -static struct BurnRomInfo ladybugbRomDesc[] = { - { "lb1a.cpu", 0x1000, 0xec135e54, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "lb2a.cpu", 0x1000, 0x3049c5c6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lb3a.cpu", 0x1000, 0xb0fef837, 1 | BRF_PRG | BRF_ESS }, // 2 - { "l4.h4", 0x1000, 0xffc424d7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "l5.j4", 0x1000, 0xad6af809, 1 | BRF_PRG | BRF_ESS }, // 4 - { "lb6a.cpu", 0x1000, 0x88c8002a, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "l9.f7", 0x1000, 0x77b1da1e, 2 | BRF_GRA }, // 6 Characters - { "l0.h7", 0x1000, 0xaa82e00b, 2 | BRF_GRA }, // 7 - - { "l8.l7", 0x1000, 0x8b99910b, 3 | BRF_GRA }, // 8 Sprites - { "l7.m7", 0x1000, 0x86a5b448, 3 | BRF_GRA }, // 9 - - { "10-2.k1", 0x0020, 0xdf091e52, 4 | BRF_GRA }, // 10 Color PROMs - { "10-1.f4", 0x0020, 0x40640d8f, 4 | BRF_GRA }, // 11 - { "10-3.c4", 0x0020, 0x27fa3a50, 4 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(ladybugb) -STD_ROM_FN(ladybugb) - -struct BurnDriver BurnDrvLadybugb = { - "ladybugb", "ladybug", NULL, NULL, "1981", - "Lady Bug (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, ladybugbRomInfo, ladybugbRomName, NULL, NULL, LadybugInputInfo, LadybugDIPInfo, - LadybugInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 196, 240, 3, 4 -}; - - -// Coccinelle (bootleg of Lady Bug, set 2) - -static struct BurnRomInfo ladybugb2RomDesc[] = { - { "lb1b.cpu", 0x1000, 0x35d61e65, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "lb2b.cpu", 0x1000, 0xa13e0fe4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lb3b.cpu", 0x1000, 0xee8ac716, 1 | BRF_PRG | BRF_ESS }, // 2 - { "l4.h4", 0x1000, 0xffc424d7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "l5.j4", 0x1000, 0xad6af809, 1 | BRF_PRG | BRF_ESS }, // 4 - { "lb6b.cpu", 0x1000, 0xdc906e89, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "l9.f7", 0x1000, 0x77b1da1e, 2 | BRF_GRA }, // 6 Characters - { "l0.h7", 0x1000, 0xaa82e00b, 2 | BRF_GRA }, // 7 - - { "l8.l7", 0x1000, 0x8b99910b, 3 | BRF_GRA }, // 8 Sprites - { "l7.m7", 0x1000, 0x86a5b448, 3 | BRF_GRA }, // 9 - - { "10-2.k1", 0x0020, 0xdf091e52, 4 | BRF_GRA }, // 10 Color PROMs - { "10-1.f4", 0x0020, 0x40640d8f, 4 | BRF_GRA }, // 11 - { "10-3.c4", 0x0020, 0x27fa3a50, 4 | BRF_OPT }, // 12 -}; - -STD_ROM_PICK(ladybugb2) -STD_ROM_FN(ladybugb2) - -struct BurnDriver BurnDrvLadybugb2 = { - "ladybugb2", "ladybug", NULL, NULL, "1981", - "Coccinelle (bootleg of Lady Bug, set 2)\0", NULL, "bootleg (Model Racing)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, ladybugb2RomInfo, ladybugb2RomName, NULL, NULL, LadybugInputInfo, LadybugDIPInfo, - LadybugInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 196, 240, 3, 4 -}; - -static INT32 SnapJackInit() -{ - fourwaymode = 0; - - return DrvInit(0); -} - - -// Snap Jack - -static struct BurnRomInfo snapjackRomDesc[] = { - { "sj1.c4", 0x1000, 0x6b30fcda, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "sj2.d4", 0x1000, 0x1f1088d1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sj3.e4", 0x1000, 0xedd65f3a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sj4.h4", 0x1000, 0xf4481192, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sj5.j4", 0x1000, 0x1bff7d05, 1 | BRF_PRG | BRF_ESS }, // 4 - { "sj6.k4", 0x1000, 0x21793edf, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "sj9.f7", 0x1000, 0xff2011c7, 2 | BRF_GRA }, // 6 Characters - { "sj0.h7", 0x1000, 0xf097babb, 2 | BRF_GRA }, // 7 - - { "sj8.l7", 0x1000, 0xb7f105b6, 3 | BRF_GRA }, // 8 Sprites - { "sj7.m7", 0x1000, 0x1cdb03a8, 3 | BRF_GRA }, // 9 - - { "10-2.k1", 0x0020, 0xcbbd9dd1, 4 | BRF_GRA }, // 10 Color PROMs - { "10-1.f4", 0x0020, 0x5b16fbd2, 4 | BRF_GRA }, // 11 - { "10-3.c4", 0x0020, 0x27fa3a50, 4 | BRF_OPT }, // 12 -}; - -STD_ROM_PICK(snapjack) -STD_ROM_FN(snapjack) - -struct BurnDriver BurnDrvSnapjack = { - "snapjack", NULL, NULL, NULL, "1982", - "Snap Jack\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, snapjackRomInfo, snapjackRomName, NULL, NULL, LadybugInputInfo, SnapjackDIPInfo, - SnapJackInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 240, 196, 4, 3 -}; - - -// Cosmic Avenger - -static struct BurnRomInfo cavengerRomDesc[] = { - { "1.c4", 0x1000, 0x9e0cc781, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2.d4", 0x1000, 0x5ce5b950, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.e4", 0x1000, 0xbc28218d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.h4", 0x1000, 0x2b32e9f5, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.j4", 0x1000, 0xd117153e, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6.k4", 0x1000, 0xc7d366cb, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "9.f7", 0x1000, 0x63357785, 2 | BRF_GRA }, // 6 Characters - { "0.h7", 0x1000, 0x52ad1133, 2 | BRF_GRA }, // 7 - - { "8.l7", 0x1000, 0xb022bf2d, 3 | BRF_GRA }, // 8 Sprites - - { "10-2.k1", 0x0020, 0x42a24dd5, 4 | BRF_GRA }, // 9 Color PROMs - { "10-1.f4", 0x0020, 0xd736b8de, 4 | BRF_GRA }, // 10 - { "10-3.c4", 0x0020, 0x27fa3a50, 4 | BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cavenger) -STD_ROM_FN(cavenger) - -static INT32 CavengerInit() -{ - fourwaymode = 0; - - return DrvInit(1); -} - -struct BurnDriver BurnDrvCavenger = { - "cavenger", NULL, NULL, NULL, "1981", - "Cosmic Avenger\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, cavengerRomInfo, cavengerRomName, NULL, NULL, LadybugInputInfo, CavengerDIPInfo, - CavengerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 240, 196, 4, 3 -}; - - -// Dorodon (set 1) - -static struct BurnRomInfo dorodonRomDesc[] = { - { "dorodon.0", 0x2000, 0x460aaf26, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "dorodon.1", 0x2000, 0xd2451eb6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dorodon.2", 0x2000, 0xd3c6ee6c, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "dorodon.5", 0x1000, 0x5eee2b85, 2 | BRF_GRA }, // 3 Characters - { "dorodon.6", 0x1000, 0x395ac25a, 2 | BRF_GRA }, // 4 - - { "dorodon.4", 0x1000, 0xd70bb50a, 3 | BRF_GRA }, // 5 Sprites - { "dorodon.3", 0x1000, 0xe44e59e6, 3 | BRF_GRA }, // 6 - - { "dorodon.bp4", 0x0100, 0xf865c135, 4 | BRF_PRG | BRF_ESS }, // 7 Protection PROMs - { "dorodon.bp3", 0x0100, 0x47b2f0bb, 4 | BRF_PRG | BRF_ESS }, // 8 - - { "dorodon.bp0", 0x0020, 0x8fcf0bc8, 5 | BRF_GRA }, // 9 Color PROMs - { "dorodon.bp1", 0x0020, 0x3f209be4, 5 | BRF_GRA }, // 10 - { "dorodon.bp2", 0x0020, 0x27fa3a50, 5 | BRF_OPT }, // 11 -}; - -STD_ROM_PICK(dorodon) -STD_ROM_FN(dorodon) - -static INT32 DorodonInit() -{ - fourwaymode = 1; - return DrvInit(2); -} - -struct BurnDriver BurnDrvDorodon = { - "dorodon", NULL, NULL, NULL, "1982", - "Dorodon (set 1)\0", NULL, "Falcon", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, dorodonRomInfo, dorodonRomName, NULL, NULL, LadybugInputInfo, DorodonDIPInfo, - DorodonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 196, 240, 3, 4 -}; - - -// Dorodon (set 2) - -static struct BurnRomInfo dorodon2RomDesc[] = { - { "1.3fg", 0x2000, 0x4d05d6f8, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2.3h", 0x2000, 0x27b43b09, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.3k", 0x2000, 0x38d2f295, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "6.6a", 0x1000, 0x2a2d8b9c, 2 | BRF_GRA }, // 3 Characters - { "7.6bc", 0x1000, 0xd14f95fa, 2 | BRF_GRA }, // 4 - - { "5.3t", 0x1000, 0x54c04f58, 3 | BRF_GRA }, // 5 Sprites - { "4.3r", 0x1000, 0x1ebb6493, 3 | BRF_GRA }, // 6 - - { "dorodon.bp4", 0x0100, 0xf865c135, 4 | BRF_PRG | BRF_ESS }, // 7 Protection PROMs - { "dorodon.bp3", 0x0100, 0x47b2f0bb, 4 | BRF_PRG | BRF_ESS }, // 8 - - { "dorodon.bp0", 0x0020, 0x8fcf0bc8, 5 | BRF_GRA }, // 9 Color PROMs - { "dorodon.bp1", 0x0020, 0x3f209be4, 5 | BRF_GRA }, // 10 - { "dorodon.bp2", 0x0020, 0x27fa3a50, 5 | BRF_OPT }, // 11 -}; - -STD_ROM_PICK(dorodon2) -STD_ROM_FN(dorodon2) - -struct BurnDriver BurnDrvDorodon2 = { - "dorodon2", "dorodon", NULL, NULL, "1982", - "Dorodon (set 2)\0", NULL, "Falcon", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, dorodon2RomInfo, dorodon2RomName, NULL, NULL, LadybugInputInfo, DorodonDIPInfo, - DorodonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 196, 240, 3, 4 -}; - - -// Space Raider - -static struct BurnRomInfo sraiderRomDesc[] = { - { "sraid3.r4", 0x2000, 0x0f389774, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "sraid2.n4", 0x2000, 0x38a48db0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sraid1.m4", 0x2000, 0x2f302a4e, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "sraid-s4.h6", 0x2000, 0x57173a12, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "sraid-s5.j6", 0x2000, 0x5a459179, 2 | BRF_PRG | BRF_ESS }, // 4 - { "sraid-s6.l6", 0x2000, 0xea3aa25d, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "sraid-s0.k6", 0x1000, 0xa0373909, 3 | BRF_GRA }, // 6 Characters - { "sraids11.l6", 0x1000, 0xba22d949, 3 | BRF_GRA }, // 7 - - { "sraid-s7.m2", 0x1000, 0x299f8e07, 4 | BRF_GRA }, // 8 Sprites - { "sraid-s8.n2", 0x1000, 0x57ba8888, 4 | BRF_GRA }, // 9 - - { "sraid-s9.f6", 0x1000, 0x2380b90f, 5 | BRF_GRA }, // 10 Grid Tiles - - { "srpr10-1.a2", 0x0020, 0x121fdb99, 6 | BRF_GRA }, // 11 Color PROMs - { "srpr10-2.l3", 0x0020, 0x88b67e70, 6 | BRF_GRA }, // 12 - { "srpr10-3.c1", 0x0020, 0x27fa3a50, 6 | BRF_OPT }, // 13 -}; - -STD_ROM_PICK(sraider) -STD_ROM_FN(sraider) - -struct BurnDriver BurnDrvSraider = { - "sraider", NULL, NULL, NULL, "1982", - "Space Raider\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, sraiderRomInfo, sraiderRomName, NULL, NULL, SraiderInputInfo, SraiderDIPInfo, - SraiderInit, DrvExit, SraiderFrame, SraiderDraw, DrvScan, &DrvRecalc, 0x82, - 192, 240, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_lasso.cpp b/jan/src/burn/drv/pre90s/d_lasso.cpp deleted file mode 100644 index 7a96be1b2..000000000 --- a/jan/src/burn/drv/pre90s/d_lasso.cpp +++ /dev/null @@ -1,1592 +0,0 @@ -// FB Alpha Lasso driver module -// Based on MAME driver by Phil Stroffolino, Nicola Salmoria, and Luca Elia - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "dac.h" -#include "driver.h" -#include "bitswap.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6502ROM0; -static UINT8 *DrvM6502ROM1; -static UINT8 *DrvM6502ROM2; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvMapROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvM6502RAM0; -static UINT8 *DrvM6502RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvBitmapRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 back_color; -static UINT8 soundlatch; -static UINT8 chip_data; -static UINT8 gfx_bank; -static UINT8 flipscreenx; -static UINT8 flipscreeny; -static UINT8 last_colors[3]; -static UINT8 track_scroll[4]; -static UINT8 track_enable; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -INT32 previous_coin = 0; - -static INT32 game_select = 0; // 0 = lasso, 1 = chameleo, 2 - wwjgtin, 3 - pinbo - -static struct BurnInputInfo LassoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 7, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Lasso) - -static struct BurnInputInfo WwjgtinInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 6, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Wwjgtin) - -static struct BurnInputInfo PinboInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 7, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pinbo) - -static struct BurnInputInfo ChameleoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 7, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Chameleo) - -static struct BurnDIPInfo LassoDIPList[]= -{ - {0x11, 0xff, 0xff, 0x81, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x01, 0x01, "Upright" }, - {0x11, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 5, "Coin A" }, - {0x11, 0x01, 0x0e, 0x02, "2 Coin 1 Credit" }, - {0x11, 0x01, 0x0e, 0x00, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0e, 0x04, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0e, 0x0c, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 3, "Lives" }, - {0x11, 0x01, 0x30, 0x00, "3" }, - {0x11, 0x01, 0x30, 0x10, "4" }, - {0x11, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Coin B" }, - {0x11, 0x01, 0x40, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x40, 0x00, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2, "Warm-Up Instructions" }, - {0x11, 0x01, 0x80, 0x00, "No" }, - {0x11, 0x01, 0x80, 0x80, "Yes" }, - - {0 , 0xfe, 0 , 2, "Warm-Up" }, - {0x12, 0x01, 0x01, 0x01, "No" }, - {0x12, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Warm-Up Language" }, - {0x12, 0x01, 0x02, 0x00, "English" }, - {0x12, 0x01, 0x02, 0x02, "German" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "on" }, -}; - -STDDIPINFO(Lasso) - -static struct BurnDIPInfo WwjgtinDIPList[]= -{ - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 5, "Coin A" }, - {0x11, 0x01, 0x0e, 0x02, "2 Coin 1 Credit" }, - {0x11, 0x01, 0x0e, 0x00, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0e, 0x04, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0e, 0x0c, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x01, 0x00, "20k" }, - {0x12, 0x01, 0x01, 0x01, "50k" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, -}; - -STDDIPINFO(Wwjgtin) - -static struct BurnDIPInfo PinboDIPList[]= -{ - {0x11, 0xff, 0xff, 0x01, NULL }, - {0x12, 0xff, 0xff, 0x0a, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x01, 0x01, "Upright" }, - {0x11, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 5, "Coin A" }, - {0x11, 0x01, 0x0e, 0x02, "2 Coin 1 Credit" }, - {0x11, 0x01, 0x0e, 0x00, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0e, 0x04, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0e, 0x0c, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x30, 0x00, "3" }, - {0x11, 0x01, 0x30, 0x10, "4" }, - {0x11, 0x01, 0x30, 0x20, "5" }, - {0x11, 0x01, 0x30, 0x30, "70 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Coin B" }, - {0x11, 0x01, 0x40, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x40, 0x00, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x01, 0x01, "None" }, - {0x12, 0x01, 0x01, 0x00, "500000 / 1000000" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x12, 0x01, 0x02, 0x00, "Reversed" }, - {0x12, 0x01, 0x02, 0x02, "Normal" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "On" }, -}; - -STDDIPINFO(Pinbo) - -static struct BurnDIPInfo ChameleoDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x01, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x01, 0x01, "Upright" }, - {0x0f, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 5, "Coin A" }, - {0x0f, 0x01, 0x0e, 0x02, "2 Coin 1 Credit" }, - {0x0f, 0x01, 0x0e, 0x00, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x0e, 0x04, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0x0e, 0x0c, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0f, 0x01, 0x30, 0x00, "3" }, - {0x0f, 0x01, 0x30, 0x30, "5" }, - - {0 , 0xfe, 0 , 2, "Coin B" }, - {0x0f, 0x01, 0x40, 0x40, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0x40, 0x00, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x08, 0x00, "Off" }, - {0x10, 0x01, 0x08, 0x08, "On" }, -}; - -STDDIPINFO(Chameleo) - -static void wwjgtinPaletteUpdate(); //forward. - -static void lasso_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1800: - { - soundlatch = data; - - if (game_select == 3) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } else { - M6502Close(); - M6502Open(1); - M6502SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6502Close(); - M6502Open(0); - } - } - return; - - case 0x1801: - back_color = data; - wwjgtinPaletteUpdate(); - return; - - case 0x1802: { - gfx_bank = (data >> 2) & 1; - - if (game_select == 3) { - gfx_bank = gfx_bank | ((data & 0x08) >> 2); - } - - if (game_select == 2) { - gfx_bank = ((data & 0x04) ? 0 : 1) + ((data & 0x10) ? 2 : 0); - track_enable = data & 0x08; - } - - flipscreenx = data & 0x01; - flipscreeny = data & 0x02; - } - return; - - case 0x1806: - return; // nop - - // wwjgtin - case 0x1c00: - case 0x1c01: - case 0x1c02: - { - last_colors[address & 3] = data; - wwjgtinPaletteUpdate(); - } - return; - - case 0x1c04: - case 0x1c05: - case 0x1c06: - case 0x1c07: - track_scroll[address & 3] = data; - return; - } -} - -static UINT8 lasso_main_read(UINT16 address) -{ - switch (address) - { - case 0x1804: - case 0x1805: - return DrvInputs[address & 1]; - - case 0x1806: - return DrvDips[0]; - - case 0x1807: - return (DrvDips[1] & 0x0f) | (DrvInputs[2] ^ 0x30); - } - - return 0; -} - -static void lasso_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xb000: - chip_data = data; - return; - - case 0xb001: - { - INT32 data2 = BITSWAP08(chip_data, 0, 1, 2, 3, 4, 5, 6, 7); - if (~data & 0x01) SN76496Write(0, data2); - if (~data & 0x02) SN76496Write(1, data2); - } - return; - - case 0xb003: - if (game_select == 2) { - DACWrite(0, data); - } - return; - } -} - -static UINT8 lasso_sound_read(UINT16 address) -{ - switch (address) - { - case 0xb004: - return 0x03; - - case 0xb005: - M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - - -static void __fastcall pinbo_sound_write(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x04: - case 0x05: - AY8910Write((port >> 2) & 1, port & 1, data); - return; - - case 0x08: - case 0x14: - return; - } -} - -static UINT8 __fastcall pinbo_sound_read(UINT16 port) -{ - switch (port & 0xff) - { - case 0x02: - case 0x06: - return AY8910Read((port >> 2) & 1); - - case 0x08: - //ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (M6502TotalCycles() / (6000000.000 / (nBurnFPS / 100.000)))); -} - - -static INT32 LassoDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - if (game_select == 3) - { - ZetOpen(0); - ZetReset(); - AY8910Reset(0); - AY8910Reset(1); - ZetClose(); - } - else - { - M6502Open(1); - M6502Reset(); - if (game_select == 2) DACReset(); - M6502Close(); - - SN76496Reset(); - - if (game_select == 0) { - M6502Open(2); - M6502Reset(); - M6502Close(); - } - } - - HiscoreReset(); - - track_enable = 0; - back_color = 0; - soundlatch = 0; - chip_data = 0; - gfx_bank = 0; - flipscreenx = 0; - flipscreeny = 0; - - memset (last_colors, 0, 3); - memset (track_scroll, 0, 4); - - DrvInputs[2] = 0; // coin - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6502ROM0 = Next; Next += 0x010000; - DrvZ80ROM = Next; - DrvM6502ROM1 = Next; Next += 0x010000; - DrvM6502ROM2 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x010000; // 1. somehow these 2 wipe out the colprom below if they are set lower., in wwgjtin - DrvMapROM = Next; Next += 0x010000; // 2. - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x0140 * sizeof(UINT32); - - AllRam = Next; - - DrvM6502RAM0 = Next; Next += 0x000800; - DrvZ80RAM = Next; - DrvM6502RAM1 = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000100; - DrvShareRAM = Next; Next += 0x000800; - DrvBitmapRAM = Next; Next += 0x002000; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 LassoGfxDecode(INT32 gfxlen) -{ - INT32 Plane0[3] = { ((gfxlen/4) * 8) * 0, ((gfxlen/4) * 8) * 2 }; - INT32 Plane1[3] = { ((gfxlen/4) * 8) * 1, ((gfxlen/4) * 8) * 3 }; - INT32 Plane2[3] = { ((gfxlen/6) * 8) * 0, ((gfxlen/6) * 8) * 2, ((gfxlen/6) * 8) * 4 }; - INT32 Plane3[3] = { ((gfxlen/6) * 8) * 1, ((gfxlen/6) * 8) * 3, ((gfxlen/6) * 8) * 5 }; - INT32 Plane4[4] = { (0x1000*8) * 1, (0x1000*8)*3, (0x1000*8)*0, (0x1000*8)*2 }; - INT32 XOffs[16] = { STEP8(0,1), STEP8(64,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(128,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(gfxlen); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, gfxlen); - - if (gfxlen == 0xc000) { - GfxDecode(((gfxlen/3)*8)/(8*8), 3, 8, 8, Plane2, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - GfxDecode(((gfxlen/3/2)*8)/(16*16), 3, 16, 16, Plane3, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - } else { - GfxDecode(((gfxlen/2)*8)/(8*8), 2, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - GfxDecode(((gfxlen/2/2)*8)/(16*16), 2, 16, 16, Plane1, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - } - - memcpy (tmp, DrvGfxROM2, 0x4000); - - GfxDecode(((gfxlen/4)*8)/(16*16), 4, 16, 16, Plane4, XOffs, YOffs, 0x100, tmp, DrvGfxROM2); - BurnFree(tmp); - - return 0; -} - -static void DrvGfxDescramble(UINT8 *src, INT32 len) -{ - INT32 Lshift = (len == 0x4000) ? 2 : 1; - UINT8 *tmp = (UINT8*)BurnMalloc(len); - - memcpy (tmp, src, len); - - for (INT32 i = 0; i < len; i++) { - src[((i & 0x0800) << Lshift) | ((i & 0x3000) >> 1) | (i & 0x07ff)] = tmp[i]; - } - - BurnFree (tmp); -} - -static INT32 LassoInit() -{ - game_select = 0; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6502ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x2000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM1 + 0x5000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x6000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x7000, 4, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM2 + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 7, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 9, 1)) return 1; - - DrvGfxDescramble(DrvGfxROM0 + 0x0000, 0x2000); - DrvGfxDescramble(DrvGfxROM0 + 0x2000, 0x2000); - LassoGfxDecode(0x4000); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM0, 0x0000, 0x03ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x0400, 0x07ff, MAP_RAM); - M6502MapMemory(DrvColRAM, 0x0800, 0x0bff, MAP_RAM); - M6502MapMemory(DrvSprRAM, 0x0c00, 0x0cff, MAP_RAM); - M6502MapMemory(DrvShareRAM, 0x1000, 0x17ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM0, 0x8000, 0xbfff, MAP_ROM); - M6502MapMemory(DrvM6502ROM0, 0xc000, 0xffff, MAP_ROM); - M6502SetWriteHandler(lasso_main_write); - M6502SetReadHandler(lasso_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502MapMemory(DrvM6502RAM1, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM1 + 0x1000, 0x1000, 0x7fff, MAP_ROM); - M6502MapMemory(DrvM6502ROM1 + 0x7000, 0xf000, 0xffff, MAP_ROM); - M6502SetWriteHandler(lasso_sound_write); - M6502SetReadHandler(lasso_sound_read); - M6502Close(); - - M6502Init(2, TYPE_M6502); - M6502Open(2); - M6502MapMemory(DrvShareRAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvBitmapRAM, 0x2000, 0x3fff, MAP_RAM); - M6502MapMemory(DrvM6502ROM2, 0x8000, 0x8fff, MAP_ROM); - M6502MapMemory(DrvM6502ROM2, 0x9000, 0x9fff, MAP_ROM); - M6502MapMemory(DrvM6502ROM2, 0xa000, 0xafff, MAP_ROM); - M6502MapMemory(DrvM6502ROM2, 0xb000, 0xbfff, MAP_ROM); - M6502MapMemory(DrvM6502ROM2, 0xc000, 0xcfff, MAP_ROM); - M6502MapMemory(DrvM6502ROM2, 0xd000, 0xdfff, MAP_ROM); - M6502MapMemory(DrvM6502ROM2, 0xe000, 0xefff, MAP_ROM); - M6502MapMemory(DrvM6502ROM2, 0xf000, 0xffff, MAP_ROM); - M6502Close(); - - SN76489Init(0, 2000000, 0); - SN76489Init(1, 2000000, 1); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - LassoDoReset(); - - return 0; -} - -static INT32 ChameleoInit() -{ - game_select = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6502ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM1 + 0x1000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x6000, 5, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM1 + 0x7000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 10, 1)) return 1; - - //DrvGfxDescramble(DrvGfxROM0 + 0x0000, 0x2000); - //DrvGfxDescramble(DrvGfxROM0 + 0x2000, 0x2000); - UINT8 *tmp = BurnMalloc(0x4000); - memcpy(tmp, DrvGfxROM0, 0x4000); - - memcpy(DrvGfxROM0 + 0x0800, tmp + 0x0000, 0x800); - memcpy(DrvGfxROM0 + 0x1800, tmp + 0x0800, 0x800); - memcpy(DrvGfxROM0 + 0x0000, tmp + 0x1000, 0x800); - memcpy(DrvGfxROM0 + 0x1000, tmp + 0x1800, 0x800); - - memcpy(DrvGfxROM0 + 0x2800, tmp + 0x2000, 0x800); - memcpy(DrvGfxROM0 + 0x3800, tmp + 0x2800, 0x800); - memcpy(DrvGfxROM0 + 0x2000, tmp + 0x3000, 0x800); - memcpy(DrvGfxROM0 + 0x3000, tmp + 0x3800, 0x800); - BurnFree(tmp); - - LassoGfxDecode(0x4000); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM0, 0x0000, 0x03ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x0400, 0x07ff, MAP_RAM); - M6502MapMemory(DrvColRAM, 0x0800, 0x0bff, MAP_RAM); - M6502MapMemory(DrvShareRAM, 0x0c00, 0x0fff, MAP_RAM); // not shared - M6502MapMemory(DrvSprRAM, 0x1000, 0x10ff, MAP_RAM); // 0-7f - M6502MapMemory(DrvM6502ROM0, 0x4000, 0xbfff, MAP_ROM); - M6502MapMemory(DrvM6502ROM0 + 0x6000, 0xe000, 0xffff, MAP_ROM); - M6502SetWriteHandler(lasso_main_write); - M6502SetReadHandler(lasso_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502MapMemory(DrvM6502RAM1, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM1 + 0x1000, 0x1000, 0x7fff, MAP_ROM); - M6502MapMemory(DrvM6502ROM1 + 0x7000, 0xf000, 0xffff, MAP_ROM); - M6502SetWriteHandler(lasso_sound_write); - M6502SetReadHandler(lasso_sound_read); - M6502Close(); - - SN76489Init(0, 2000000, 0); - SN76489Init(1, 2000000, 1); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - LassoDoReset(); - - return 0; -} - -static INT32 WwjgtinInit() -{ - game_select = 2; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6502ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x4000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM1 + 0x4000, 2, 1)) return 1; - - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 4, 1)) return 1; - - UINT8 *tmp = BurnMalloc(0x8000); - memcpy(tmp, DrvGfxROM0, 0x8000); - - memcpy(DrvGfxROM0 + 0x0000, tmp + 0x0000, 0x800); - memcpy(DrvGfxROM0 + 0x2000, tmp + 0x0800, 0x800); - memcpy(DrvGfxROM0 + 0x0800, tmp + 0x1000, 0x800); - memcpy(DrvGfxROM0 + 0x2800, tmp + 0x1800, 0x800); - memcpy(DrvGfxROM0 + 0x1000, tmp + 0x2000, 0x800); - memcpy(DrvGfxROM0 + 0x3000, tmp + 0x2800, 0x800); - memcpy(DrvGfxROM0 + 0x1800, tmp + 0x3000, 0x800); - memcpy(DrvGfxROM0 + 0x3800, tmp + 0x3800, 0x800); - - memcpy(DrvGfxROM0 + 0x4000, tmp + 0x4000, 0x800); - memcpy(DrvGfxROM0 + 0x6000, tmp + 0x4800, 0x800); - memcpy(DrvGfxROM0 + 0x4800, tmp + 0x5000, 0x800); - memcpy(DrvGfxROM0 + 0x6800, tmp + 0x5800, 0x800); - memcpy(DrvGfxROM0 + 0x5000, tmp + 0x6000, 0x800); - memcpy(DrvGfxROM0 + 0x7000, tmp + 0x6800, 0x800); - memcpy(DrvGfxROM0 + 0x5800, tmp + 0x7000, 0x800); - memcpy(DrvGfxROM0 + 0x7800, tmp + 0x7800, 0x800); - BurnFree(tmp); - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x2000, 6, 1)) return 1; - - if (BurnLoadRom(DrvMapROM + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvMapROM + 0x2000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 10, 1)) return 1; - - //DrvGfxDescramble(DrvGfxROM0 + 0x0000, 0x4000); - //DrvGfxDescramble(DrvGfxROM0 + 0x4000, 0x4000); - LassoGfxDecode(0x8000); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM0, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x0800, 0x0bff, MAP_RAM); - M6502MapMemory(DrvColRAM, 0x0c00, 0x0fff, MAP_RAM); - //M6502MapMemory(DrvShareRAM, 0x0c00, 0x0fff, MAP_RAM); // not shared - M6502MapMemory(DrvSprRAM, 0x1000, 0x10ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM0, 0x4000, 0xbfff, MAP_ROM); - M6502MapMemory(DrvM6502ROM0 + 0x4000, 0xc000, 0xffff, MAP_ROM); - M6502SetWriteHandler(lasso_main_write); - M6502SetReadHandler(lasso_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502MapMemory(DrvM6502RAM1, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM1 + 0x4000, 0x4000, 0x7fff, MAP_ROM); - M6502MapMemory(DrvM6502ROM1 + 0x4000, 0xc000, 0xffff, MAP_ROM); - M6502SetWriteHandler(lasso_sound_write); - M6502SetReadHandler(lasso_sound_read); - M6502Close(); - - SN76489Init(0, 2000000, 0); - SN76489Init(1, 2000000, 1); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 1.0, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - LassoDoReset(); - - return 0; -} - -static INT32 PinboInit() -{ - game_select = 3; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6502ROM0 + 0x2000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x6000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0x8000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6502ROM0 + 0xa000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 7, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 10, 1)) return 1; - - UINT8 *tmp = BurnMalloc(0xc000); - memcpy(tmp, DrvGfxROM0, 0xc000); - - memcpy(DrvGfxROM0 + 0x0000, tmp + 0x0000, 0x800); - memcpy(DrvGfxROM0 + 0x2000, tmp + 0x0800, 0x800); - memcpy(DrvGfxROM0 + 0x0800, tmp + 0x1000, 0x800); - memcpy(DrvGfxROM0 + 0x2800, tmp + 0x1800, 0x800); - memcpy(DrvGfxROM0 + 0x1000, tmp + 0x2000, 0x800); - memcpy(DrvGfxROM0 + 0x3000, tmp + 0x2800, 0x800); - memcpy(DrvGfxROM0 + 0x1800, tmp + 0x3000, 0x800); - memcpy(DrvGfxROM0 + 0x3800, tmp + 0x3800, 0x800); - - memcpy(DrvGfxROM0 + 0x4000, tmp + 0x4000, 0x800); - memcpy(DrvGfxROM0 + 0x6000, tmp + 0x4800, 0x800); - memcpy(DrvGfxROM0 + 0x4800, tmp + 0x5000, 0x800); - memcpy(DrvGfxROM0 + 0x6800, tmp + 0x5800, 0x800); - memcpy(DrvGfxROM0 + 0x5000, tmp + 0x6000, 0x800); - memcpy(DrvGfxROM0 + 0x7000, tmp + 0x6800, 0x800); - memcpy(DrvGfxROM0 + 0x5800, tmp + 0x7000, 0x800); - memcpy(DrvGfxROM0 + 0x7800, tmp + 0x7800, 0x800); - - memcpy(DrvGfxROM0 + 0x8000, tmp + 0x8000, 0x800); - memcpy(DrvGfxROM0 + 0xa000, tmp + 0x8800, 0x800); - memcpy(DrvGfxROM0 + 0x8800, tmp + 0x9000, 0x800); - memcpy(DrvGfxROM0 + 0xa800, tmp + 0x9800, 0x800); - memcpy(DrvGfxROM0 + 0x9000, tmp + 0xa000, 0x800); - memcpy(DrvGfxROM0 + 0xb000, tmp + 0xa800, 0x800); - memcpy(DrvGfxROM0 + 0x9800, tmp + 0xb000, 0x800); - memcpy(DrvGfxROM0 + 0xb800, tmp + 0xb800, 0x800); - BurnFree(tmp); -#if 0 - ROM_LOAD( "rom7.d1", 0x8000, 0x0800, CRC(327a3c21) SHA1(e938915d28ac4ec033b20d33728788493e3f30f6) ) /* 3rd bitplane */ - ROM_CONTINUE( 0xa000, 0x0800 ) - ROM_CONTINUE( 0x8800, 0x0800 ) - ROM_CONTINUE( 0xa800, 0x0800 ) - ROM_CONTINUE( 0x9000, 0x0800 ) - ROM_CONTINUE( 0xb000, 0x0800 ) - ROM_CONTINUE( 0x9800, 0x0800 ) - ROM_CONTINUE( 0xb800, 0x0800 ) -#endif - //DrvGfxDescramble(DrvGfxROM0 + 0x0000, 0x4000); - //DrvGfxDescramble(DrvGfxROM0 + 0x4000, 0x4000); - //DrvGfxDescramble(DrvGfxROM0 + 0x8000, 0x4000); - LassoGfxDecode(0xc000); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502RAM0, 0x0000, 0x03ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x0400, 0x07ff, MAP_RAM); - M6502MapMemory(DrvColRAM, 0x0800, 0x0bff, MAP_RAM); - M6502MapMemory(DrvSprRAM, 0x1000, 0x10ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM0 + 0x2000, 0x2000, 0x3fff, MAP_ROM); - M6502MapMemory(DrvM6502ROM0 + 0x6000, 0x6000, 0xbfff, MAP_ROM); - M6502MapMemory(DrvM6502ROM0 + 0xa000, 0xe000, 0xffff, MAP_ROM); - M6502SetWriteHandler(lasso_main_write); - M6502SetReadHandler(lasso_main_read); - M6502Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xffff, MAP_RAM); - ZetSetInHandler(pinbo_sound_read); - ZetSetOutHandler(pinbo_sound_write); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - LassoDoReset(); - - return 0; -} - -static INT32 LassoExit() -{ - GenericTilesExit(); - - M6502Exit(); - if (game_select == 3) { - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - } else { - SN76496Exit(); - } - if (game_select == 2) DACExit(); - - BurnFree(AllMem); - - return 0; -} - -static UINT32 color_calculate(UINT8 d) -{ - INT32 r,g,b,b0,b1,b2; - - b0 = ((d >> 0) & 1) * 0x21; - b1 = ((d >> 1) & 1) * 0x47; - b2 = ((d >> 2) & 1) * 0x97; - r = b0 + b1 + b2; - - b0 = ((d >> 3) & 1) * 0x21; - b1 = ((d >> 4) & 1) * 0x47; - b2 = ((d >> 5) & 1) * 0x97; - g = b0 + b1 + b2; - - b0 = ((d >> 6) & 1) * 0x4f; - b1 = ((d >> 7) & 1) * 0xa8; - b = b0 + b1; - - return BurnHighCol(r,g,b,0); -} - -static void wwjgtinPaletteUpdate() -{ - if (game_select != 2) return; // only for wwjgtin! - - DrvPalette[0x3d] = color_calculate(last_colors[0]); - DrvPalette[0x3e] = color_calculate(last_colors[1]); - DrvPalette[0x3f] = color_calculate(last_colors[2]); - - DrvPalette[0] = color_calculate(back_color); - - for (INT32 i = 0x40; i < 0x140; i++) { - UINT8 ctabentry; - - if ((i - 0x40) & 0x03) - ctabentry = ((((i - 0x40) & 0xf0) >> 2) + ((i - 0x40) & 0x0f)) & 0x3f; - else - ctabentry = 0; - - DrvPalette[i] = DrvPalette[ctabentry]; - } -} - -static void LassoPaletteInit() -{ - for (INT32 i = 0; i < 0x40; i++) { - DrvPalette[i] = color_calculate(DrvColPROM[i]); - } - - if (game_select == 2) // wwjgtin - wwjgtinPaletteUpdate(); -} - -static void PinboPaletteInit() -{ - // complete guess - iq_132! - for (INT32 i = 0; i < 0x100; i++) { - INT32 r = DrvColPROM[i] & 0xf; - INT32 g = DrvColPROM[i+0x100] & 0x0f; - INT32 b = DrvColPROM[i+0x200] & 0x0f; - - DrvPalette[i] = BurnHighCol(r+(r*16), g+(g*16), b+(b*16), 0); - } -} - -static void draw_sprites(INT32 ram_size, INT32 bpp, INT32 reverse) -{ - const UINT8 *finish, *source; - INT32 inc; - - if (reverse) - { - source = DrvSprRAM; - finish = DrvSprRAM + ram_size; - inc = 4; - } - else - { - source = DrvSprRAM + ram_size - 4; - finish = DrvSprRAM - 4; - inc = -4; - } - - while (source != finish) - { - INT32 sx = source[3]; - INT32 sy = source[0]; - INT32 flipx = source[1] & 0x40; - INT32 flipy = source[1] & 0x80; - - if (flipscreenx) - { - sx = 240 - sx; - flipx = !flipx; - } - - if (flipscreeny) - flipy = !flipy; - else - sy = 240 - sy; - - INT32 code = (source[1] & 0x3f) | (gfx_bank * 0x40); - INT32 color = source[2] & 0x0f; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, bpp, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, bpp, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, bpp, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, bpp, 0, 0, DrvGfxROM1); - } - } - - source += inc; - } -} - -static void lasso_draw_layer(INT32 bpp, INT32 bank_type) -{ - for (INT32 offs = (2 * 32); offs < (32 * 32) - (2 * 32); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy =((offs / 0x20) * 8) - 16; - - INT32 code = DrvVidRAM[offs]; - INT32 color = DrvColRAM[offs]; - - if (bank_type) { - code |= (color & 0x30) << 4; - } else { - code |= (gfx_bank << 8); - } - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color & 0xf, bpp, 0, 0, DrvGfxROM0); - } -} - -static void wwjgtin_draw_track_layer() -{ - INT32 scrollx = (track_scroll[0] + (track_scroll[1] * 256)) & 0x7ff; - INT32 scrolly = (track_scroll[2] + (track_scroll[3] * 256) + 16) & 0x3ff; - - INT32 yy = scrolly & 0xf; - INT32 xx = scrollx & 0xf; - - for (INT32 y = 0; y < 16 * (16 + 1); y+=16) - { - INT32 sy = ((y + scrolly) & 0x3f0) << 3; - - for (INT32 x = 0; x < 16 * (16 + 1); x += 16) - { - INT32 offs = sy + (((x + scrollx) >> 4) & 0x7f); - - INT32 code = DrvMapROM[offs]; - INT32 color =(DrvMapROM[offs + 0x2000] & 0x0f) + (0x40/16); - - Render16x16Tile_Mask_Clip(pTransDraw, code, x - xx, y - yy, color, 4, 0, 0, DrvGfxROM2); - } - } -} - -static void lasso_draw_bitmap() -{ - INT32 inc = (flipscreenx) ? -1 : 1; - - for (INT32 offs = (16 * 32); offs < (256 * 32) - (16 * 32); offs++) - { - UINT8 y = (offs / 0x20) - 16; - UINT8 x = (offs & 0x1f) * 8; - if (flipscreeny) y = ~y; - if (flipscreenx) x = ~x; - - if (/*(y < 0) ||*/ (y >= nScreenHeight) || /*(x < 0) ||*/ (x >= nScreenWidth)) - continue; - - UINT8 data = DrvBitmapRAM[offs]; - if (data == 0) continue; - - UINT16 *dst = pTransDraw + (y * nScreenWidth); - - for (INT32 bit = 0; bit < 8; bit++, data<<=1, x+=inc) - { - if (data & 0x80) // need to clip? - dst[x] = 0x3f; - } - } -} - -static INT32 get_black_palette_entry() -{ - for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++) { - if (DrvPalette[i] == 0) { - return i; - } - } - return BurnDrvGetPaletteEntries() - 1; // give up. -} - -static INT32 WwjgtinDraw() -{ - if (DrvRecalc) { - LassoPaletteInit(); - wwjgtinPaletteUpdate(); - DrvRecalc = 0; - } - - DrvPalette[0] = color_calculate(back_color); - - BurnTransferClear(); - - if (track_enable) { - wwjgtin_draw_track_layer(); - } else { - INT32 fill_color = get_black_palette_entry(); - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = fill_color; - } - } - - draw_sprites(0x100, 2, 1); - lasso_draw_layer(2, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 LassoDraw() -{ - if (DrvRecalc) { - LassoPaletteInit(); - DrvRecalc = 0; - } - - DrvPalette[0] = color_calculate(back_color); - - BurnTransferClear(); - - lasso_draw_layer(2,0); - if (game_select == 0) lasso_draw_bitmap(); - draw_sprites(0x80, 2, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 PinboDraw() -{ - if (DrvRecalc) { - PinboPaletteInit(); - DrvRecalc = 0; - } - - DrvPalette[0] = color_calculate(back_color); - - BurnTransferClear(); - - lasso_draw_layer(3,1); - draw_sprites(0x100, 3, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 LassoFrame() -{ - if (DrvReset) { - LassoDoReset(); - } - - M6502NewFrame(); - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - if ((DrvInputs[2] & 0x30) != previous_coin) { - M6502Open(0); - M6502SetIRQLine(0x20, (DrvInputs[2] & 0x30) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - M6502Close(); - previous_coin = DrvInputs[2] & 0x30; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { (11289000/16) / 60, 600000 / 60, (11289000/16) / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6502Open(0); - nCyclesDone[0] += M6502Run(nCyclesTotal[0] / nInterleave); - if (i == 240) M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6502Close(); - - M6502Open(1); - nCyclesDone[1] += M6502Run(nCyclesTotal[1] / nInterleave); - M6502Close(); - - if (game_select == 0) { - M6502Open(2); - nCyclesDone[2] += M6502Run(nCyclesTotal[2] / nInterleave); - M6502Close(); - } - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - M6502Open(1); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - } - if (game_select == 2) DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - M6502Close(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 PinboFrame() -{ - if (DrvReset) { - LassoDoReset(); - } - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - if ((DrvInputs[2] & 0x30) != previous_coin) { - M6502Open(0); - M6502SetIRQLine(0x20, (DrvInputs[2] & 0x30) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - M6502Close(); - previous_coin = DrvInputs[2] & 0x30; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 750000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - M6502Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += M6502Run(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1)) M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - } - - ZetClose(); - M6502Close(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - PinboDraw(); - } - - return 0; -} - -static INT32 LassoScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - if (game_select == 3) { - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - } else { - SN76496Scan(nAction,pnMin); - } - if (game_select == 2) DACScan(nAction, pnMin); - - SCAN_VAR(back_color); - SCAN_VAR(soundlatch); - SCAN_VAR(chip_data); - SCAN_VAR(gfx_bank); - SCAN_VAR(flipscreenx); - SCAN_VAR(flipscreeny); - SCAN_VAR(track_enable); - - SCAN_VAR(last_colors); - SCAN_VAR(track_scroll); - SCAN_VAR(track_enable); - } - - return 0; -} - - -// Lasso - -static struct BurnRomInfo lassoRomDesc[] = { - { "wm3", 0x2000, 0xf93addd6, 0 | BRF_PRG | BRF_ESS }, // 0 - M6502 #0 Code - { "wm4", 0x2000, 0x77719859, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "wmc", 0x1000, 0x8b4eb242, 1 | BRF_PRG | BRF_ESS }, // 2 - M6502 #1 Code - { "wmb", 0x1000, 0x4658bcb9, 1 | BRF_PRG | BRF_ESS }, // 3 - { "wma", 0x1000, 0x2e7de3e9, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "wm5", 0x1000, 0x7dc3ff07, 2 | BRF_PRG | BRF_ESS }, // 5 - M6502 #2 Code - - { "wm1", 0x2000, 0x7db77256, 3 | BRF_GRA }, // 6 - Graphics Tiles - { "wm2", 0x2000, 0x9e7d0b6f, 3 | BRF_GRA }, // 7 - - { "82s123.69", 0x0020, 0x1eabb04d, 6 | BRF_GRA }, // 8 - Color PROM - { "82s123.70", 0x0020, 0x09060f8c, 6 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(lasso) -STD_ROM_FN(lasso) - -struct BurnDriver BurnDrvLasso = { - "lasso", NULL, NULL, NULL, "1982", - "Lasso\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, lassoRomInfo, lassoRomName, NULL, NULL, LassoInputInfo, LassoDIPInfo, - LassoInit, LassoExit, LassoFrame, LassoDraw, LassoScan, &DrvRecalc, 0x40, - 224, 256, 3, 4 -}; - - -// Chameleon - -static struct BurnRomInfo chameleoRomDesc[] = { - { "chamel4.bin", 0x2000, 0x97379c47, 0 | BRF_PRG | BRF_ESS }, // 0 - M6502 #0 Code - { "chamel5.bin", 0x2000, 0x0a2cadfd, 0 | BRF_PRG | BRF_ESS }, // 1 - { "chamel6.bin", 0x2000, 0xb023c354, 0 | BRF_PRG | BRF_ESS }, // 2 - { "chamel7.bin", 0x2000, 0xa5a03375, 0 | BRF_PRG | BRF_ESS }, // 3 - - { "chamel3.bin", 0x1000, 0x52eab9ec, 1 | BRF_PRG | BRF_ESS }, // 4 - M6502 #1 Code - { "chamel2.bin", 0x1000, 0x81dcc49c, 1 | BRF_PRG | BRF_ESS }, // 5 - { "chamel1.bin", 0x1000, 0x96031d3b, 1 | BRF_PRG | BRF_ESS }, // 6 - - { "chamel8.bin", 0x2000, 0xdc67916b, 3 | BRF_GRA }, // 7 - Graphics Tiles - { "chamel9.bin", 0x2000, 0x6b559bf1, 3 | BRF_GRA }, // 8 - - { "chambprm.bin",0x0020, 0xe3ad76df, 6 | BRF_GRA }, // 9 - Color PROM - { "chamaprm.bin",0x0020, 0xc7063b54, 6 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(chameleo) -STD_ROM_FN(chameleo) - -struct BurnDriver BurnDrvChameleo = { - "chameleo", NULL, NULL, NULL, "1983", - "Chameleon\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, chameleoRomInfo, chameleoRomName, NULL, NULL, ChameleoInputInfo, ChameleoDIPInfo, - ChameleoInit, LassoExit, LassoFrame, LassoDraw, LassoScan, &DrvRecalc, 0x40, - 256, 224, 4, 3 -}; - - -// Wai Wai Jockey Gate-In! - -static struct BurnRomInfo wwjgtinRomDesc[] = { - { "ic2.6", 0x4000, 0x744ba45b, 0 | BRF_PRG | BRF_ESS }, // 0 - M6502 #0 Code - { "ic5.5", 0x4000, 0xaf751614, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "ic59.9", 0x4000, 0x2ecb4d98, 1 | BRF_PRG | BRF_ESS }, // 2 - M6502 #1 Code - - { "ic81.7", 0x4000, 0xa27f1a63, 3 | BRF_GRA }, // 3 - Graphics Tiles - { "ic82.8", 0x4000, 0xea2862b3, 3 | BRF_GRA }, // 4 - - { "ic47.3", 0x2000, 0x40594c59, 4 | BRF_GRA }, // 5 - Background Tiles - { "ic46.4", 0x2000, 0xd1921348, 4 | BRF_GRA }, // 6 - - { "ic48.2", 0x2000, 0xa4a7df77, 5 | BRF_GRA }, // 7 - Background Tile Map - { "ic49.1", 0x2000, 0xe480fbba, 5 | BRF_GRA }, // 8 - - { "2.bpr", 0x0020, 0x79adda5d, 6 | BRF_GRA }, // 9 - Color PROM - { "1.bpr", 0x0020, 0xc1a93cc8, 6 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(wwjgtin) -STD_ROM_FN(wwjgtin) - -struct BurnDriver BurnDrvWwjgtin = { - "wwjgtin", NULL, NULL, NULL, "1984", - "Wai Wai Jockey Gate-In!\0", NULL, "Jaleco / Casio", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, wwjgtinRomInfo, wwjgtinRomName, NULL, NULL, WwjgtinInputInfo, WwjgtinDIPInfo, - WwjgtinInit, LassoExit, LassoFrame, WwjgtinDraw, LassoScan, &DrvRecalc, 0x140, - 256, 224, 4, 3 -}; - - -// Photo Finish (bootleg?) - -static struct BurnRomInfo photofRomDesc[] = { - { "ic2.bin", 0x4000, 0x4d960b54, 0 | BRF_PRG | BRF_ESS }, // 0 - M6502 #0 Code - { "ic6.bin", 0x4000, 0xa4ad21dc, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "ic59.bin", 0x4000, 0x2ecb4d98, 1 | BRF_PRG | BRF_ESS }, // 2 - M6502 #1 Code - - { "ic81.bin", 0x4000, 0x0f170253, 3 | BRF_GRA }, // 3 - Graphics Tiles - { "ic82.bin", 0x4000, 0xc4cadee9, 3 | BRF_GRA }, // 4 - - { "3-ic47.bin", 0x2000, 0x40594c59, 4 | BRF_GRA }, // 6 - Background Tiles - { "4-ic46.bin", 0x2000, 0xd1921348, 4 | BRF_GRA }, // 7 - - { "2-ic48.bin", 0x2000, 0xa4a7df77, 5 | BRF_GRA }, // 8 - Background Tile Map - { "1-ic49.bin", 0x2000, 0xe480fbba, 5 | BRF_GRA }, // 9 - - { "2.bpr", 0x0020, 0x79adda5d, 6 | BRF_GRA }, // 10 - Color PROM - { "1.bpr", 0x0020, 0xc1a93cc8, 6 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(photof) -STD_ROM_FN(photof) - -struct BurnDriver BurnDrvPhotof = { - "photof", "wwjgtin", NULL, NULL, "1991", - "Photo Finish (bootleg?)\0", NULL, "Jaleco / Casio", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, photofRomInfo, photofRomName, NULL, NULL, WwjgtinInputInfo, WwjgtinDIPInfo, - WwjgtinInit, LassoExit, LassoFrame, WwjgtinDraw, LassoScan, &DrvRecalc, 0x140, - 256, 224, 4, 3 -}; - - -// Pinbo (set 1) - -static struct BurnRomInfo pinboRomDesc[] = { - { "rom2.b7", 0x2000, 0x9a185338, 0 | BRF_PRG | BRF_ESS }, // 0 - M6502 Code - { "rom3.e7", 0x2000, 0x1cd1b3bd, 0 | BRF_PRG | BRF_ESS }, // 1 - { "rom4.h7", 0x2000, 0xba043fa7, 0 | BRF_PRG | BRF_ESS }, // 2 - { "rom5.j7", 0x2000, 0xe71046c4, 0 | BRF_PRG | BRF_ESS }, // 3 - - { "rom1.s8", 0x2000, 0xca45a1be, 0 | BRF_PRG | BRF_ESS }, // 4 - Z80 Code - - { "rom6.a1", 0x4000, 0x74fe8e98, 3 | BRF_GRA }, // 5 - Graphics Tiles - { "rom8.c1", 0x4000, 0x5a800fe7, 3 | BRF_GRA }, // 6 - { "rom7.d1", 0x4000, 0x327a3c21, 3 | BRF_GRA }, // 7 - - { "red.l10", 0x0100, 0xe6c9ba52, 6 | BRF_GRA }, // 8 - Color PROM - { "green.k10", 0x0100, 0x1bf2d335, 6 | BRF_GRA }, // 9 - { "blue.n10", 0x0100, 0xe41250ad, 6 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(pinbo) -STD_ROM_FN(pinbo) - -struct BurnDriver BurnDrvPinbo = { - "pinbo", NULL, NULL, NULL, "1984", - "Pinbo (set 1)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pinboRomInfo, pinboRomName, NULL, NULL, PinboInputInfo, PinboDIPInfo, - PinboInit, LassoExit, PinboFrame, PinboDraw, LassoScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_lastduel.cpp b/jan/src/burn/drv/pre90s/d_lastduel.cpp deleted file mode 100644 index 8219f5b16..000000000 --- a/jan/src/burn/drv/pre90s/d_lastduel.cpp +++ /dev/null @@ -1,1921 +0,0 @@ -// FB Alpha Last Duel driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "msm6295.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[3] = {0, 0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvZ80Rom = NULL; -static UINT8 *DrvZ80Ram = NULL; -static UINT8 *DrvVideoRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvSpriteRamBuffer = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvScroll1Ram = NULL; -static UINT8 *DrvScroll2Ram = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvBgTiles = NULL; -static UINT8 *DrvFgTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT16 DrvFgScrollX; -static UINT16 DrvFgScrollY; -static UINT16 DrvBgScrollX; -static UINT16 DrvBgScrollY; -static UINT16 DrvTmapPriority; -static UINT8 DrvSpritePriMask; -static UINT8 DrvSpriteFlipYMask; -static UINT8 DrvZ80RomBank; -static UINT8 DrvSoundLatch; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 fire 1" }, - - {"Up (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo LastduelInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 up" }, - {"Down" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 down" }, - {"Left" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 5, "service" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort2 + 3, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Lastduel) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[1]); -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Allow continue" }, - {0x11, 0x01, 0x01, 0x00, "No" }, - {0x11, 0x01, 0x01, 0x01, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x0c, 0x08, "Easy" }, - {0x11, 0x01, 0x0c, 0x0c, "Normal" }, - {0x11, 0x01, 0x0c, 0x04, "Difficult" }, - {0x11, 0x01, 0x0c, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x11, 0x01, 0x30, 0x30, "Upright (One Player)" }, - {0x11, 0x01, 0x30, 0x00, "Upright (Two Players)" }, - {0x11, 0x01, 0x30, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Background Music" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - // Dip3 - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x12, 0x01, 0xf0, 0x20, "6 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x40, "5 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x50, "4 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x70, "3 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x10, "8 Coins 3 Plays" }, - {0x12, 0x01, 0xf0, 0x90, "2 Coins 1 Play" }, - {0x12, 0x01, 0xf0, 0x30, "5 Coins 3 Plays" }, - {0x12, 0x01, 0xf0, 0x60, "3 Coins 2 Plays" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Play" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 3 Plays" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Plays" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Plays" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Plays" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Plays" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Plays" }, - {0x12, 0x01, 0xf0, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 15 , "Coin B" }, - {0x12, 0x01, 0x0f, 0x02, "6 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x04, "5 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x05, "4 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x07, "3 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x01, "8 Coins 3 Plays" }, - {0x12, 0x01, 0x0f, 0x09, "2 Coins 1 Play" }, - {0x12, 0x01, 0x0f, 0x03, "5 Coins 3 Plays" }, - {0x12, 0x01, 0x0f, 0x06, "3 Coins 2 Plays" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Play" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Plays" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Plays" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Plays" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Plays" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo LastduelDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x00, "4 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 6 Plays" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x08, "3 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Play" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Plays" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 6 Plays" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Difficult" }, - {0x14, 0x01, 0x03, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x20, "20000, 60000, 80000" }, - {0x14, 0x01, 0x30, 0x30, "30000, 80000, 80000" }, - {0x14, 0x01, 0x30, 0x10, "40000, 80000, 80000" }, - {0x14, 0x01, 0x30, 0x00, "40000, 80000, 100000" }, - - // Dip3 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x02, "4" }, - {0x15, 0x01, 0x03, 0x01, "6" }, - {0x15, 0x01, 0x03, 0x00, "8" }, - - {0 , 0xfe, 0 , 2 , "Type" }, - {0x15, 0x01, 0x04, 0x04, "Car" }, - {0x15, 0x01, 0x04, 0x00, "Plane" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow continue" }, - {0x15, 0x01, 0x40, 0x00, "No" }, - {0x15, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -}; - -STDDIPINFO(Lastduel) - -static struct BurnRomInfo DrvRomDesc[] = { - { "mg_04.8b", 0x20000, 0xb112257d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "mg_03.7b", 0x20000, 0xb2672465, BRF_ESS | BRF_PRG }, // 1 - { "mg_02.6b", 0x20000, 0x9f5ebe16, BRF_ESS | BRF_PRG }, // 2 - { "mg_01.5b", 0x20000, 0x1cea2af0, BRF_ESS | BRF_PRG }, // 3 - - { "mg_05.14j", 0x10000, 0x2fbfc945, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "mg_06.10k", 0x08000, 0x382ee59b, BRF_GRA }, // 5 Characters - - { "ls-12.7l", 0x40000, 0x6c1b2c6c, BRF_GRA }, // 6 BG Tiles - - { "ls-11.2l", 0x80000, 0x6bf81c64, BRF_GRA }, // 7 FG Tiles - - { "mg_m11.rom0", 0x10000, 0xee319a64, BRF_GRA }, // 8 Sprites - { "mg_m07.rom2", 0x10000, 0xe5c0b211, BRF_GRA }, // 9 - { "mg_m12.rom1", 0x10000, 0x887ef120, BRF_GRA }, // 10 - { "mg_m08.rom3", 0x10000, 0x59709aa3, BRF_GRA }, // 11 - { "mg_m13.rom0", 0x10000, 0xeae07db4, BRF_GRA }, // 12 - { "mg_m09.rom2", 0x10000, 0x40ee83eb, BRF_GRA }, // 13 - { "mg_m14.rom1", 0x10000, 0x21e5424c, BRF_GRA }, // 14 - { "mg_m10.rom3", 0x10000, 0xb64afb54, BRF_GRA }, // 15 - - { "ls-06.10e", 0x20000, 0x88d39a5b, BRF_SND }, // 16 Samples - { "ls-05.12e", 0x20000, 0xb06e03b5, BRF_SND }, // 17 - - { "29.14k", 0x00100, 0x7f862e1e, BRF_GRA }, // 18 PROM (Priority) -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvjRomDesc[] = { - { "mdj_04.8b", 0x20000, 0x9ebbebb1, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "mdj_03.7b", 0x20000, 0xa5579c2d, BRF_ESS | BRF_PRG }, // 1 - { "mg_02.6b", 0x20000, 0x9f5ebe16, BRF_ESS | BRF_PRG }, // 2 - { "mg_01.5b", 0x20000, 0x1cea2af0, BRF_ESS | BRF_PRG }, // 3 - - { "mg_05.14j", 0x10000, 0x2fbfc945, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "mg_06.10k", 0x08000, 0x382ee59b, BRF_GRA }, // 5 Characters - - { "ls-12.7l", 0x40000, 0x6c1b2c6c, BRF_GRA }, // 6 BG Tiles - - { "ls-11.2l", 0x80000, 0x6bf81c64, BRF_GRA }, // 7 FG Tiles - - { "mg_m11.rom0", 0x10000, 0xee319a64, BRF_GRA }, // 8 Sprites - { "mg_m07.rom2", 0x10000, 0xe5c0b211, BRF_GRA }, // 9 - { "mg_m12.rom1", 0x10000, 0x887ef120, BRF_GRA }, // 10 - { "mg_m08.rom3", 0x10000, 0x59709aa3, BRF_GRA }, // 11 - { "mg_m13.rom0", 0x10000, 0xeae07db4, BRF_GRA }, // 12 - { "mg_m09.rom2", 0x10000, 0x40ee83eb, BRF_GRA }, // 13 - { "mg_m14.rom1", 0x10000, 0x21e5424c, BRF_GRA }, // 14 - { "mg_m10.rom3", 0x10000, 0xb64afb54, BRF_GRA }, // 15 - - { "ls-06.10e", 0x20000, 0x88d39a5b, BRF_SND }, // 16 Samples - { "ls-05.12e", 0x20000, 0xb06e03b5, BRF_SND }, // 17 - - { "29.14k", 0x00100, 0x7f862e1e, BRF_GRA }, // 18 PROM (Priority) -}; - -STD_ROM_PICK(Drvj) -STD_ROM_FN(Drvj) - -static struct BurnRomInfo DrvuRomDesc[] = { - { "mdu_04.8b", 0x20000, 0x7f7f8329, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "mdu_03.7b", 0x20000, 0x11fa542f, BRF_ESS | BRF_PRG }, // 1 - { "mde_02.6b", 0x20000, 0x9f5ebe16, BRF_ESS | BRF_PRG }, // 2 - { "mde_01.5b", 0x20000, 0x1cea2af0, BRF_ESS | BRF_PRG }, // 3 - - { "mde_05.14j", 0x10000, 0x2fbfc945, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "mdu_06.10k", 0x08000, 0x54bfdc02, BRF_GRA }, // 5 Characters - - { "ls-12.7l", 0x40000, 0x6c1b2c6c, BRF_GRA }, // 6 BG Tiles - - { "ls-11.2l", 0x80000, 0x6bf81c64, BRF_GRA }, // 7 FG Tiles - - { "11.rom0", 0x10000, 0xee319a64, BRF_GRA }, // 8 Sprites - { "07u.rom2", 0x10000, 0x7152b212, BRF_GRA }, // 9 - { "12.rom1", 0x10000, 0x887ef120, BRF_GRA }, // 10 - { "08u.rom3", 0x10000, 0x72e5d525, BRF_GRA }, // 11 - { "13.rom0", 0x10000, 0xeae07db4, BRF_GRA }, // 12 - { "09u.rom2", 0x10000, 0x7b5175cb, BRF_GRA }, // 13 - { "14.rom1", 0x10000, 0x21e5424c, BRF_GRA }, // 14 - { "10u.rom3", 0x10000, 0x6db7ca64, BRF_GRA }, // 15 - - { "ls-06.10e", 0x20000, 0x88d39a5b, BRF_SND }, // 16 Samples - { "ls-05.12e", 0x20000, 0xb06e03b5, BRF_SND }, // 17 - - { "29.14k", 0x00100, 0x7f862e1e, BRF_GRA }, // 18 PROM (Priority) -}; - -STD_ROM_PICK(Drvu) -STD_ROM_FN(Drvu) - -static struct BurnRomInfo Leds2011RomDesc[] = { - { "lse_04.8b", 0x20000, 0x166c0576, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "lse_03.7b", 0x20000, 0x0c8647b6, BRF_ESS | BRF_PRG }, // 1 - { "ls-02.6b", 0x20000, 0x05c0285e, BRF_ESS | BRF_PRG }, // 2 - { "ls-01.5b", 0x20000, 0x8bf934dd, BRF_ESS | BRF_PRG }, // 3 - - { "ls-07.14j", 0x10000, 0x98af7838, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "ls-08.10k", 0x08000, 0x8803cf49, BRF_GRA }, // 5 Characters - - { "ls-12.7l", 0x40000, 0x6c1b2c6c, BRF_GRA }, // 6 BG Tiles - - { "ls-11.2l", 0x80000, 0x6bf81c64, BRF_GRA }, // 7 FG Tiles - - { "ls-10.13a", 0x40000, 0xdb2c5883, BRF_GRA }, // 8 Sprites - { "ls-09.5a", 0x40000, 0x89949efb, BRF_GRA }, // 9 - - { "ls-06.10e", 0x20000, 0x88d39a5b, BRF_SND }, // 10 Samples - { "ls-05.12e", 0x20000, 0xb06e03b5, BRF_SND }, // 11 - - { "29.14k", 0x00100, 0x7f862e1e, BRF_GRA }, // 12 PROM (Priority) -}; - -STD_ROM_PICK(Leds2011) -STD_ROM_FN(Leds2011) - -static struct BurnRomInfo Leds2011uRomDesc[] = { - { "lsu-04.8b", 0x20000, 0x56a2f079, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "lsu-03.7b", 0x20000, 0x9b6408c0, BRF_ESS | BRF_PRG }, // 1 - { "ls-02.6b", 0x20000, 0x05c0285e, BRF_ESS | BRF_PRG }, // 2 - { "ls-01.5b", 0x20000, 0x8bf934dd, BRF_ESS | BRF_PRG }, // 3 - - { "ls-07.14j", 0x10000, 0x98af7838, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "ls-08.10k", 0x08000, 0x8803cf49, BRF_GRA }, // 5 Characters - - { "ls-12.7l", 0x40000, 0x6c1b2c6c, BRF_GRA }, // 6 BG Tiles - - { "ls-11.2l", 0x80000, 0x6bf81c64, BRF_GRA }, // 7 FG Tiles - - { "ls-10.13a", 0x40000, 0xdb2c5883, BRF_GRA }, // 8 Sprites - { "ls-09.5a", 0x40000, 0x89949efb, BRF_GRA }, // 9 - - { "ls-06.10e", 0x20000, 0x88d39a5b, BRF_SND }, // 10 Samples - { "ls-05.12e", 0x20000, 0xb06e03b5, BRF_SND }, // 11 - - { "29.14k", 0x00100, 0x7f862e1e, BRF_GRA }, // 12 PROM (Priority) -}; - -STD_ROM_PICK(Leds2011u) -STD_ROM_FN(Leds2011u) - -static struct BurnRomInfo LastduelRomDesc[] = { - { "ldu_06b.13k", 0x20000, 0x0e71acaf, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ldu_05b.12k", 0x20000, 0x47a85bea, BRF_ESS | BRF_PRG }, // 1 - { "ldu_04b.11k", 0x10000, 0xaa4bf001, BRF_ESS | BRF_PRG }, // 2 - { "ldu_03b.9k", 0x10000, 0xbbaac8ab, BRF_ESS | BRF_PRG }, // 3 - - { "ld_02.16h", 0x10000, 0x91834d0c, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "ld_01.12f", 0x08000, 0xad3c6f87, BRF_GRA }, // 5 Characters - - { "ld-15.6p", 0x20000, 0xd977a175, BRF_GRA }, // 6 BG Tiles - { "ld-13.6m", 0x20000, 0xbc25729f, BRF_GRA }, // 7 - - { "ld-14.15n", 0x80000, 0xd0653739, BRF_GRA }, // 8 FG Tiles - - { "ld-09.12a", 0x20000, 0x6efadb74, BRF_GRA }, // 9 Sprites - { "ld-10.17a", 0x20000, 0xb8d3b2e3, BRF_GRA }, // 10 - { "ld-11.12b", 0x20000, 0x49d4dbbd, BRF_GRA }, // 11 - { "ld-12.17b", 0x20000, 0x313e5338, BRF_GRA }, // 12 - - - { "ld.3d", 0x00100, 0x729a1ddc, BRF_GRA }, // 13 PROM (Priority) -}; - -STD_ROM_PICK(Lastduel) -STD_ROM_FN(Lastduel) - -static struct BurnRomInfo LastdueloRomDesc[] = { - { "ldu_06.13k", 0x20000, 0x4228a00b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ldu_05.12k", 0x20000, 0x7260434f, BRF_ESS | BRF_PRG }, // 1 - { "ldu_04.11k", 0x10000, 0x429fb964, BRF_ESS | BRF_PRG }, // 2 - { "ldu_03.9k", 0x10000, 0x5aa4df72, BRF_ESS | BRF_PRG }, // 3 - - { "ld_02.16h", 0x10000, 0x91834d0c, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "ld_01.12f", 0x08000, 0xad3c6f87, BRF_GRA }, // 5 Characters - - { "ld-15.6p", 0x20000, 0xd977a175, BRF_GRA }, // 6 BG Tiles - { "ld-13.6m", 0x20000, 0xbc25729f, BRF_GRA }, // 7 - - { "ld-14.15n", 0x80000, 0xd0653739, BRF_GRA }, // 8 FG Tiles - - { "ld-09.12a", 0x20000, 0x6efadb74, BRF_GRA }, // 9 Sprites - { "ld-10.17a", 0x20000, 0xb8d3b2e3, BRF_GRA }, // 10 - { "ld-11.12b", 0x20000, 0x49d4dbbd, BRF_GRA }, // 11 - { "ld-12.17b", 0x20000, 0x313e5338, BRF_GRA }, // 12 - - { "ld.3d", 0x00100, 0x729a1ddc, BRF_GRA }, // 13 PROM (Priority) -}; - -STD_ROM_PICK(Lastduelo) -STD_ROM_FN(Lastduelo) - -static struct BurnRomInfo LastdueljRomDesc[] = { - { "ld_06.13k", 0x20000, 0x58a9e12b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ld_05.12k", 0x20000, 0x14685d78, BRF_ESS | BRF_PRG }, // 1 - { "ld_04.11k", 0x10000, 0xaa4bf001, BRF_ESS | BRF_PRG }, // 2 - { "ld_03.9k", 0x10000, 0xbbaac8ab, BRF_ESS | BRF_PRG }, // 3 - - { "ld_02.16h", 0x10000, 0x91834d0c, BRF_ESS | BRF_PRG }, // 4 Z80 Program - - { "ld_01.12f", 0x08000, 0xad3c6f87, BRF_GRA }, // 5 Characters - - { "ld-15.6p", 0x20000, 0xd977a175, BRF_GRA }, // 6 BG Tiles - { "ld-13.6m", 0x20000, 0xbc25729f, BRF_GRA }, // 7 - - { "ld-14.15n", 0x80000, 0xd0653739, BRF_GRA }, // 8 FG Tiles - - { "ld-09.12a", 0x20000, 0x6efadb74, BRF_GRA }, // 9 Sprites - { "ld-10.17a", 0x20000, 0xb8d3b2e3, BRF_GRA }, // 10 - { "ld-11.12b", 0x20000, 0x49d4dbbd, BRF_GRA }, // 11 - { "ld-12.17b", 0x20000, 0x313e5338, BRF_GRA }, // 12 - - { "ld.3d", 0x00100, 0x729a1ddc, BRF_GRA }, // 13 PROM (Priority) -}; - -STD_ROM_PICK(Lastduelj) -STD_ROM_FN(Lastduelj) - -static struct BurnRomInfo LastduelbRomDesc[] = { - { "ld_08.bin", 0x10000, 0x43811a96, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ld_07.bin", 0x10000, 0x63c30946, BRF_ESS | BRF_PRG }, // 1 - { "ld_04.bin", 0x10000, 0x46a4e0f8, BRF_ESS | BRF_PRG }, // 2 - { "ld_03.bin", 0x10000, 0x8d5f204a, BRF_ESS | BRF_PRG }, // 3 - { "ldu-04.rom", 0x10000, 0x429fb964, BRF_ESS | BRF_PRG }, // 4 - { "ldu-03.rom", 0x10000, 0x5aa4df72, BRF_ESS | BRF_PRG }, // 5 - - { "ld_02.bin", 0x10000, 0x91834d0c, BRF_ESS | BRF_PRG }, // 6 Z80 Program - - { "ld_01.bin", 0x08000, 0xad3c6f87, BRF_GRA }, // 7 Characters - - { "ld_17.bin", 0x10000, 0x7188bfdd, BRF_GRA }, // 8 BG Tiles - { "ld_18.bin", 0x10000, 0xa62af66a, BRF_GRA }, // 9 - { "ld_19.bin", 0x10000, 0x4b762e50, BRF_GRA }, // 10 - { "ld_20.bin", 0x10000, 0xb140188e, BRF_GRA }, // 11 - - { "ld_28.bin", 0x10000, 0x06778248, BRF_GRA }, // 12 FG Tiles - { "ld_27.bin", 0x10000, 0x48c78675, BRF_GRA }, // 13 - { "ld_26.bin", 0x10000, 0xb0edac81, BRF_GRA }, // 14 - { "ld_25.bin", 0x10000, 0xc541ae9a, BRF_GRA }, // 15 - { "ld_24.bin", 0x10000, 0x66eac4df, BRF_GRA }, // 16 - { "ld_23.bin", 0x10000, 0xd817332c, BRF_GRA }, // 17 - { "ld_22.bin", 0x10000, 0xf80f8812, BRF_GRA }, // 18 - { "ld_21.bin", 0x10000, 0xb74f0c0e, BRF_GRA }, // 19 - - { "ld_11.bin", 0x10000, 0x1a0d180e, BRF_GRA }, // 20 Sprites - { "ld_12.bin", 0x10000, 0xb2745e26, BRF_GRA }, // 21 - { "ld_13.bin", 0x10000, 0xa1a598ac, BRF_GRA }, // 22 - { "ld_14.bin", 0x10000, 0xedf515cc, BRF_GRA }, // 23 - { "ld_09.bin", 0x10000, 0xf8fd5243, BRF_GRA }, // 24 - { "ld_10.bin", 0x10000, 0xb49ad746, BRF_GRA }, // 25 - { "ld_15.bin", 0x10000, 0x96b13bbc, BRF_GRA }, // 26 - { "ld_16.bin", 0x10000, 0x9d80f7e6, BRF_GRA }, // 27 - - { "ld.3d", 0x00100, 0x729a1ddc, BRF_GRA }, // 28 PROM (Priority) -}; - -STD_ROM_PICK(Lastduelb) -STD_ROM_FN(Lastduelb) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x80000; - DrvZ80Rom = Next; Next += 0x10000; - MSM6295ROM = Next; Next += 0x40000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x20000; - DrvZ80Ram = Next; Next += 0x00800; - DrvSpriteRam = Next; Next += 0x00800; - DrvSpriteRamBuffer = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x02000; - DrvPaletteRam = Next; Next += 0x00800; - DrvScroll1Ram = Next; Next += 0x04000; - DrvScroll2Ram = Next; Next += 0x08000; - - RamEnd = Next; - - DrvChars = Next; Next += 0x0800 * 8 * 8; - DrvBgTiles = Next; Next += 0x0800 * 16 * 16; - DrvFgTiles = Next; Next += 0x1000 * 16 * 16; - DrvSprites = Next; Next += 0x1000 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - - DrvFgScrollX = 0; - DrvFgScrollY = 0; - DrvBgScrollX = 0; - DrvBgScrollY = 0; - DrvTmapPriority = 0; - DrvZ80RomBank = 0; - DrvSoundLatch = 0; - - return 0; -} - -static INT32 MadgearDoReset() -{ - DrvDoReset(); - - MSM6295Reset(0); - - return 0; -} - -UINT8 __fastcall Madgear68KReadByte(UINT32 a) -{ - switch (a) { - case 0xfc4000: { - return DrvDip[0]; - } - - case 0xfc4001: { - return DrvDip[1]; - } - - case 0xfc4002: { - return DrvDip[2]; - } - - case 0xfc4004: { - return 0xff - DrvInput[0]; - } - - case 0xfc4005: { - return 0xff - DrvInput[1]; - } - - case 0xfc4006: { - return 0xff - DrvInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Madgear68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xfc4000: { - // flip - return; - } - - case 0xfc4002: { - DrvSoundLatch = d & 0xff; - return; - } - - case 0xfd0000: { - DrvFgScrollY = d & 0x1ff; - return; - } - - case 0xfd0002: { - DrvFgScrollX = d & 0x3ff; - return; - } - - case 0xfd0004: { - DrvBgScrollY = d & 0x1ff; - return; - } - - case 0xfd0006: { - DrvBgScrollX = d & 0x3ff; - return; - } - - case 0xfd0008: { - // ??? - return; - } - - case 0xfd000e: { - DrvTmapPriority = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall MadgearZ80Read(UINT16 a) -{ - switch (a) { - case 0xf000: { - return BurnYM2203Read(0, 0); - } - - case 0xf002: { - return BurnYM2203Read(1, 0); - } - - case 0xf006: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall MadgearZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xf000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0xf001: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xf002: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0xf003: { - BurnYM2203Write(1, 1, d); - return; - } - - case 0xf004: { - MSM6295Command(0, d); - return; - } - - case 0xf00a: { - DrvZ80RomBank = d & 1; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x8000 + DrvZ80RomBank * 0x4000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x8000 + DrvZ80RomBank * 0x4000 ); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -void __fastcall Lastduel68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xfc4001: { - // flip - return; - } - - case 0xfc4003: { - DrvSoundLatch = d & 0xff; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Lastduel68KReadWord(UINT32 a) -{ - switch (a) { - case 0xfc4000: { - return 0xffff - ((DrvInput[1] << 8) | DrvInput[0]); - } - - case 0xfc4002: { - return 0xffff - DrvInput[2]; - } - - case 0xfc4004: { - return (DrvDip[1] << 8) | DrvDip[0]; - } - - case 0xfc4006: { - return DrvDip[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read Word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Lastduel68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xfc0000: - case 0xfc0002: { - // NOP - return; - } - - case 0xfc8000: { - DrvFgScrollY = d & 0x1ff; - return; - } - - case 0xfc8002: { - DrvFgScrollX = d & 0x3ff; - return; - } - - case 0xfc8004: { - DrvBgScrollY = d & 0x1ff; - return; - } - - case 0xfc8006: { - DrvBgScrollX = d & 0x3ff; - return; - } - - case 0xfc8008: - case 0xfc800e: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall LastduelZ80Read(UINT16 a) -{ - switch (a) { - case 0xe800: { - return BurnYM2203Read(0, 0); - } - - case 0xf000: { - return BurnYM2203Read(1, 0); - } - - case 0xf800: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall LastduelZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe800: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0xe801: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xf000: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0xf001: { - BurnYM2203Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3579545; -} - -static INT32 CharPlaneOffsets[2] = { 4, 0 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 8, 9, 10, 11 }; -static INT32 CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 BgTilePlaneOffsets[4] = { 12, 8, 4, 0 }; -static INT32 FgTilePlaneOffsets[4] = { 4, 12, 0, 8 }; -static INT32 TileXOffsets[16] = { 0, 1, 2, 3, 16, 17, 18, 19, 512, 513, 514, 515, 528, 529, 530, 531 }; -static INT32 TileYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480 }; -static INT32 SpritePlaneOffsets[4] = { 16, 0, 24, 8 }; -static INT32 SpriteXOffsets[16] = { STEP8(0,1), STEP8(512,1) }; -static INT32 SpriteYOffsets[16] = { STEP16(0,32) }; - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 3, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(DrvZ80Rom, 4, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvBgTiles); - - // Load and decode the fg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, FgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvFgTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00002, 8, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40002, 9, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 11, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00003, 12, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40003, 13, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00001, 14, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40001, 15, 4); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, DrvTempRom, DrvSprites); - - // Load the samples - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x20000, 17, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0xfc1800, 0xfc1fff, MAP_RAM); - SekMapMemory(DrvVideoRam , 0xfc8000, 0xfc9fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0xfcc000, 0xfcc7ff, MAP_RAM); - SekMapMemory(DrvScroll1Ram , 0xfd4000, 0xfd7fff, MAP_RAM); - SekMapMemory(DrvScroll2Ram , 0xfd8000, 0xfdffff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, Madgear68KWriteWord); - SekSetReadByteHandler(0, Madgear68KReadByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(MadgearZ80Read); - ZetSetWriteHandler(MadgearZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x8000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x8000 ); - ZetMapArea(0xd000, 0xd7ff, 0, DrvZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 1, DrvZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 2, DrvZ80Ram ); - ZetClose(); - - GenericTilesInit(); - DrvSpritePriMask = 0x10; - DrvSpriteFlipYMask = 0x80; - - BurnYM2203Init(2, 3579545, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3579545); - BurnYM2203SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.40, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 7575, 1); - MSM6295SetRoute(0, 0.98, BURN_SND_ROUTE_BOTH); - - // Reset the driver - MadgearDoReset(); - - return 0; -} - -static INT32 Leds2011Init() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 3, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(DrvZ80Rom, 4, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvBgTiles); - - // Load and decode the fg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, FgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvFgTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00001, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 2); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, DrvTempRom, DrvSprites); - - // Load the samples - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x20000, 11, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0xfc1800, 0xfc1fff, MAP_RAM); - SekMapMemory(DrvVideoRam , 0xfc8000, 0xfc9fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0xfcc000, 0xfcc7ff, MAP_RAM); - SekMapMemory(DrvScroll1Ram , 0xfd4000, 0xfd7fff, MAP_RAM); - SekMapMemory(DrvScroll2Ram , 0xfd8000, 0xfdffff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, Madgear68KWriteWord); - SekSetReadByteHandler(0, Madgear68KReadByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(MadgearZ80Read); - ZetSetWriteHandler(MadgearZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x8000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x8000 ); - ZetMapArea(0xd000, 0xd7ff, 0, DrvZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 1, DrvZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 2, DrvZ80Ram ); - ZetClose(); - - GenericTilesInit(); - DrvSpritePriMask = 0x10; - DrvSpriteFlipYMask = 0x80; - - BurnYM2203Init(2, 3579545, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3579545); - BurnYM2203SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.40, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 7575, 1); - MSM6295SetRoute(0, 0.98, BURN_SND_ROUTE_BOTH); - - // Reset the driver - MadgearDoReset(); - - return 0; -} - -static INT32 LastduelInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 3, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(DrvZ80Rom, 4, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 2); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvBgTiles); - - // Load and decode the fg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvFgTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 9, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00001, 10, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00002, 11, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00003, 12, 4); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0xfc0800, 0xfc0fff, MAP_RAM); - SekMapMemory(DrvVideoRam , 0xfcc000, 0xfcdfff, MAP_RAM); - SekMapMemory(DrvScroll1Ram , 0xfd0000, 0xfd3fff, MAP_RAM); - SekMapMemory(DrvScroll2Ram , 0xfd4000, 0xfd7fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0xfd8000, 0xfd87ff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xfe0000, 0xffffff, MAP_RAM); - SekSetReadWordHandler(0, Lastduel68KReadWord); - SekSetWriteWordHandler(0, Lastduel68KWriteWord); - SekSetWriteByteHandler(0, Lastduel68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(LastduelZ80Read); - ZetSetWriteHandler(LastduelZ80Write); - ZetMapArea(0x0000, 0xdfff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xdfff, 2, DrvZ80Rom ); - ZetMapArea(0xe000, 0xe7ff, 0, DrvZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 1, DrvZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 2, DrvZ80Ram ); - ZetClose(); - - GenericTilesInit(); - DrvSpritePriMask = 0x00; - DrvSpriteFlipYMask = 0x40; - - BurnYM2203Init(2, 3579545, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3579545); - BurnYM2203SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.40, BURN_SND_ROUTE_BOTH); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 LastduelbInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x20000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 5, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(DrvZ80Rom, 6, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00001, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20001, 9, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 11, 2); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvBgTiles); - - // Load and decode the fg tiles - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00001, 12, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00000, 13, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20001, 14, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 15, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40001, 16, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 17, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60001, 18, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 19, 2); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, BgTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvFgTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 20, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 21, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00001, 22, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40001, 23, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00002, 24, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40002, 25, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00003, 26, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40003, 27, 4); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0xfc0800, 0xfc0fff, MAP_RAM); - SekMapMemory(DrvVideoRam , 0xfcc000, 0xfcdfff, MAP_RAM); - SekMapMemory(DrvScroll1Ram , 0xfd0000, 0xfd3fff, MAP_RAM); - SekMapMemory(DrvScroll2Ram , 0xfd4000, 0xfd7fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0xfd8000, 0xfd87ff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xfe0000, 0xffffff, MAP_RAM); - SekSetReadWordHandler(0, Lastduel68KReadWord); - SekSetWriteWordHandler(0, Lastduel68KWriteWord); - SekSetWriteByteHandler(0, Lastduel68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(LastduelZ80Read); - ZetSetWriteHandler(LastduelZ80Write); - ZetMapArea(0x0000, 0xdfff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xdfff, 2, DrvZ80Rom ); - ZetMapArea(0xe000, 0xe7ff, 0, DrvZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 1, DrvZ80Ram ); - ZetMapArea(0xe000, 0xe7ff, 2, DrvZ80Ram ); - ZetClose(); - - GenericTilesInit(); - DrvSpritePriMask = 0x00; - DrvSpriteFlipYMask = 0x40; - - BurnYM2203Init(2, 3579545, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.40, BURN_SND_ROUTE_BOTH); - BurnTimerAttachZet(3579545); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - ZetExit(); - - BurnYM2203Exit(); - - GenericTilesExit(); - - DrvFgScrollX = 0; - DrvFgScrollY = 0; - DrvBgScrollX = 0; - DrvBgScrollY = 0; - DrvSpritePriMask = 0; - DrvSpriteFlipYMask = 0; - DrvZ80RomBank = 0; - DrvSoundLatch = 0; - - BurnFree(Mem); - - return 0; -} - -static INT32 MadgearExit() -{ - MSM6295Exit(0); - return DrvExit(); -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - static const UINT8 ztable[16] = { 0x0, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11 }; - INT32 i, r, g, b; - - i = ztable[(nColour >> 0) & 15]; - r = ((nColour >> 12) & 15) * i; - g = ((nColour >> 8) & 15) * i; - b = ((nColour >> 4) & 15) * i; - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x800; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void DrvTileDraw(UINT8 *gfx, INT32 Code, INT32 Colour, INT32 x, INT32 y, INT32 xFlip, INT32 yFlip, INT32 transparent, INT32 tcolor) -{ - if (transparent) - { - if (x > 16 && x < 368 && y > 16 && y < 224) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, tcolor, 0, gfx); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, tcolor, 0, gfx); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, tcolor, 0, gfx); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, tcolor, 0, gfx); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, tcolor, 0, gfx); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, tcolor, 0, gfx); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, tcolor, 0, gfx); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, tcolor, 0, gfx); - } - } - } - } else { - if (x > 16 && x < 368 && y > 16 && y < 224) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, gfx); - } else { - Render16x16Tile_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, gfx); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, gfx); - } else { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 0, gfx); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, gfx); - } else { - Render16x16Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, gfx); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, gfx); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0, gfx); - } - } - } - } -} - -static void DrvRenderBgLayer(INT32 nTransparent) -{ - INT32 mx, my, Code, Colour, x, y, TileIndex, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)DrvScroll2Ram; - - for (mx = 0; mx < 32; mx++) { - for (my = 0; my < 64; my++) { - TileIndex = (my * 32) + mx; - Code = VideoRam[TileIndex] & 0x1fff; - Colour = VideoRam[TileIndex + 0x800]; - Flip = (Colour & 0x60) >> 5; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - Colour &= 0x0f; - - y = 16 * mx; - x = 16 * my; - - x -= DrvBgScrollX; - y -= DrvBgScrollY; - if (x < -16) x += 1024; - if (y < -16) y += 512; - - DrvTileDraw(DrvBgTiles, Code, Colour, x - 64, y - 8, xFlip, yFlip, nTransparent, 0xf); - } - } -} - -static void DrvRenderFgLayer(INT32 Priority) -{ - INT32 mx, my, Code, Colour, x, y, TileIndex, Split, Flip, xFlip, yFlip, nTransparent; - - UINT16 *VideoRam = (UINT16*)DrvScroll1Ram; - - nTransparent = Priority & (1 << 16); - Priority &= 1; - - for (mx = 0; mx < 32; mx++) { - for (my = 0; my < 64; my++) { - TileIndex = (my * 32) + mx; - Code = VideoRam[TileIndex] & 0x1fff; - Colour = VideoRam[TileIndex + 0x800]; - Flip = (Colour & 0x60) >> 5; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - Split = (Colour & 0x10) >> 4; - Colour &= 0x0f; - - if (Split != Priority) continue; - - y = 16 * mx; - x = 16 * my; - - x -= DrvFgScrollX; - y -= DrvFgScrollY; - if (x < -16) x += 1024; - if (y < -16) y += 512; - - DrvTileDraw(DrvFgTiles, Code, Colour + 0x10, x - 64, y - 8, xFlip, yFlip, nTransparent, 0xf); - } - } -} - -static void LastduelRenderBgLayer(INT32 nTransparent) -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)DrvScroll2Ram; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Code = VideoRam[2 * TileIndex] & 0x1fff; - Colour = VideoRam[2 * TileIndex + 1]; - Flip = (Colour & 0x60) >> 5; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - Colour &= 0x0f; - - x = 16 * mx; - y = 16 * my; - - x -= DrvBgScrollX; - y -= DrvBgScrollY; - if (x < -16) x += 1024; - if (y < -16) y += 1024; - - DrvTileDraw(DrvBgTiles, Code, Colour, x - 64, y - 8, xFlip, yFlip, nTransparent, 0); - - TileIndex++; - } - } -} - -static void LastduelRenderFgLayer(INT32 Priority) -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0, Split, Flip, xFlip, yFlip, nTransparent; - - UINT16 *VideoRam = (UINT16*)DrvScroll1Ram; - - nTransparent = Priority & (1 << 16); - Priority &= 1; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Code = VideoRam[2 * TileIndex] & 0x1fff; - Colour = VideoRam[2 * TileIndex + 1]; - Flip = (Colour & 0x60) >> 5; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - Split = (Colour & 0x80) >> 7; - Colour &= 0x0f; - - if (Split != Priority) continue; - - x = 16 * mx; - y = 16 * my; - - x -= DrvFgScrollX; - y -= DrvFgScrollY; - if (x < -16) x += 1024; - if (y < -16) y += 1024; - - DrvTileDraw(DrvFgTiles, Code, Colour + 0x10, x - 64, y - 8, xFlip, yFlip, nTransparent, 0); - - TileIndex++; - } - } -} - -static void DrvRenderSprites(INT32 Priority) -{ - INT32 Offset; - UINT16 *SpriteRam = (UINT16*)DrvSpriteRamBuffer; - - for (Offset = 0x400 - 4; Offset >= 0; Offset -= 4) { - INT32 Attr, sy, sx, xFlip, yFlip, Code, Colour; - - Attr = SpriteRam[Offset + 1]; - if (DrvSpritePriMask) { - if (Priority == 1 && (Attr & DrvSpritePriMask)) continue; - if (Priority == 0 && !(Attr & DrvSpritePriMask)) continue; - } - - Code = SpriteRam[Offset] & 0xfff; - sx = SpriteRam[Offset + 3] & 0x1ff; - sy = SpriteRam[Offset + 2] & 0x1ff; - if (sy > 0x100) sy -= 0x200; - - xFlip = Attr & 0x20; - yFlip = Attr & DrvSpriteFlipYMask; - Colour = Attr & 0x0f; - - DrvTileDraw(DrvSprites, Code, Colour + 0x20, sx - 64, sy - 8, xFlip, yFlip, 1, 0xf); - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, yFlip, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvVideoRam; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - yFlip = 0; - Code = VideoRam[TileIndex]; - Colour = Code >> 12; - if (Code & 0x800) yFlip = 1; - Code &= 0x7ff; - - x = 8 * mx; - y = 8 * my; - - x -= 64; - y -= 8; - - if (x > 0 && x < 376 && y > 8 && y < 232) { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 2, 3, 0x300, DrvChars); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 2, 3, 0x300, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 0x300, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 2, 3, 0x300, DrvChars); - } - } - - TileIndex++; - } - } -} - -static void DrvDraw() -{ -// BurnTransferClear(); - DrvCalcPalette(); - - if (DrvTmapPriority) { - DrvRenderFgLayer(0|(0<<16)); - DrvRenderSprites(0); - DrvRenderFgLayer(1|(1<<16)); - DrvRenderBgLayer(1); - } else { - DrvRenderBgLayer(0); - DrvRenderFgLayer(0|(1<<16)); - DrvRenderSprites(0); - DrvRenderFgLayer(1|(1<<16)); - } - - DrvRenderSprites(1); - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static void LastduelDraw() -{ -// BurnTransferClear(); - DrvCalcPalette(); - - LastduelRenderBgLayer(0); - LastduelRenderFgLayer(0|(1<<16)); - DrvRenderSprites(0); - LastduelRenderFgLayer(1|(1<<16)); - DrvRenderCharLayer(); - - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 100; - - if (DrvReset) MadgearDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 10000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 33 || i == 66) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekClose(); - - ZetOpen(0); - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - - } - ZetClose(); - - if (pBurnDraw) DrvDraw(); - - SekOpen(0); - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - memcpy(DrvSpriteRamBuffer, DrvSpriteRam, 0x800); - - return 0; -} - -static INT32 LastduelFrame() -{ - INT32 nInterleave = 100; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 10000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 33 || i == 66) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - ZetOpen(0); - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - if (pBurnDraw) LastduelDraw(); - - SekOpen(0); - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - - memcpy(DrvSpriteRamBuffer, DrvSpriteRam, 0x800); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029672; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); // Scan Z80 - BurnYM2203Scan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(DrvZ80RomBank); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvFgScrollX); - SCAN_VAR(DrvFgScrollY); - SCAN_VAR(DrvBgScrollX); - SCAN_VAR(DrvBgScrollY); - SCAN_VAR(DrvTmapPriority); - SCAN_VAR(DrvDip); - SCAN_VAR(DrvInput); - } - - return 0; -} - -static INT32 MadgearScan(INT32 nAction, INT32 *pnMin) -{ - INT32 i = DrvScan(nAction, pnMin); - - if (i == 0) { - if (nAction & ACB_DRIVER_DATA) { - MSM6295Scan(0, nAction); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x8000 + DrvZ80RomBank * 0x4000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x8000 + DrvZ80RomBank * 0x4000 ); - ZetClose(); - } - } - - return i; -} - -struct BurnDriver BurnDrvLastduel = { - "lastduel", NULL, NULL, NULL, "1988", - "Last Duel (US New Ver.)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, LastduelRomInfo, LastduelRomName, NULL, NULL, LastduelInputInfo, LastduelDIPInfo, - LastduelInit, DrvExit, LastduelFrame, NULL, DrvScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvLastduelo = { - "lastduelo", "lastduel", NULL, NULL, "1988", - "Last Duel (US Old Ver.)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, LastdueloRomInfo, LastdueloRomName, NULL, NULL, LastduelInputInfo, LastduelDIPInfo, - LastduelInit, DrvExit, LastduelFrame, NULL, DrvScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvLastduelj = { - "lastduelj", "lastduel", NULL, NULL, "1988", - "Last Duel (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, LastdueljRomInfo, LastdueljRomName, NULL, NULL, LastduelInputInfo, LastduelDIPInfo, - LastduelInit, DrvExit, LastduelFrame, NULL, DrvScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvLsstduelb = { - "lastduelb", "lastduel", NULL, NULL, "1988", - "Last Duel (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, LastduelbRomInfo, LastduelbRomName, NULL, NULL, LastduelInputInfo, LastduelDIPInfo, - LastduelbInit, DrvExit, LastduelFrame, NULL, DrvScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvMadgear = { - "madgear", NULL, NULL, NULL, "1989", - "Mad Gear (US)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_RACING, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, MadgearExit, DrvFrame, NULL, MadgearScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvMadgearj = { - "madgearj", "madgear", NULL, NULL, "1989", - "Mad Gear (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_RACING, 0, - NULL, DrvjRomInfo, DrvjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, MadgearExit, DrvFrame, NULL, MadgearScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvMadgearu = { - "ledstorm", "madgear", NULL, NULL, "1988", - "Led Storm (US)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_RACING, 0, - NULL, DrvuRomInfo, DrvuRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, MadgearExit, DrvFrame, NULL, MadgearScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvLeds2011 = { - "leds2011", NULL, NULL, NULL, "1988", - "Led Storm Rally 2011 (World)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_RACING, 0, - NULL, Leds2011RomInfo, Leds2011RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - Leds2011Init, MadgearExit, DrvFrame, NULL, MadgearScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvLeds2011u = { - "leds2011u", "leds2011", NULL, NULL, "1988", - "Led Storm Rally 2011 (US)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARWARE_CAPCOM_MISC, GBF_RACING, 0, - NULL, Leds2011uRomInfo, Leds2011uRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - Leds2011Init, MadgearExit, DrvFrame, NULL, MadgearScan, - NULL, 0x800, 240, 384, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_lwings.cpp b/jan/src/burn/drv/pre90s/d_lwings.cpp deleted file mode 100644 index 7a432bc3b..000000000 --- a/jan/src/burn/drv/pre90s/d_lwings.cpp +++ /dev/null @@ -1,2618 +0,0 @@ -// FB Alpha "Legendary Wings" driver module -// Based on MAME driver by Paul Leaman - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "msm5205.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSampleROM; -static UINT8 *DrvTileMap; -static UINT8 *DrvGfxMask; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *ScrollX; -static UINT8 *ScrollY; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDip[2]; -static UINT8 DrvInp[5]; - -static UINT8 interrupt_enable; -static UINT8 soundlatch; -static UINT8 soundlatch2; -static UINT8 flipscreen; -static UINT8 DrvZ80Bank; -static UINT8 DrvSampleBank; -static UINT8 DrvSpriteBank; - -static UINT8 avengers_param[4]; -static UINT32 avengers_palette_pen; -static UINT8 avengers_soundlatch2; -static UINT8 avengers_soundstate; - -static UINT8 trojan_bg2_scrollx; -static UINT8 trojan_bg2_image; - -static INT32 irq_counter = 0; - -static INT32 fball = 0; -static INT32 avengers = 0; -static INT32 MSM5205InUse = 0; -static INT32 spritelen = 0; - -static INT32 nCyclesTotal[3]; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo FballInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - - {"P3 Start", BIT_DIGITAL, DrvJoy1 + 2, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 3, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 2, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 1, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 0, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2"}, - - {"P4 Start", BIT_DIGITAL, DrvJoy1 + 3, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy5 + 3, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy5 + 2, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy5 + 1, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy5 + 0, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 4, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 5, "p4 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, -}; - -STDINPUTINFO(Fball) - -static struct BurnDIPInfo FballDIPList[]= -{ - {0x1f, 0xff, 0xff, 0x6d, NULL }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x1f, 0x01, 0x01, 0x01, "0" }, - {0x1f, 0x01, 0x01, 0x00, "1" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x1f, 0x01, 0x06, 0x00, "1" }, - {0x1f, 0x01, 0x06, 0x02, "2" }, - {0x1f, 0x01, 0x06, 0x04, "3" }, - {0x1f, 0x01, 0x06, 0x06, "4" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x1f, 0x01, 0x18, 0x00, "2 Coins 1 Credits" }, - {0x1f, 0x01, 0x18, 0x08, "1 Coin 1 Credits" }, - {0x1f, 0x01, 0x18, 0x10, "1 Coin 2 Credits" }, - {0x1f, 0x01, 0x18, 0x18, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1f, 0x01, 0x20, 0x20, "Off" }, - {0x1f, 0x01, 0x20, 0x00, "On" }, - - {0x1f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1f, 0x01, 0x80, 0x00, "Off" }, - {0x1f, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Fball) - -static struct BurnDIPInfo LwingsDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Flip_Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x0c, 0x0c, "3" }, - {0x11, 0x01, 0x0c, 0x04, "4" }, - {0x11, 0x01, 0x0c, 0x08, "5" }, - {0x11, 0x01, 0x0c, 0x00, "6" }, - - {0 , 0xfe, 0 , 4, "Coin_B" }, - {0x11, 0x01, 0x30, 0x00, "4C_1C" }, - {0x11, 0x01, 0x30, 0x20, "3C_1C" }, - {0x11, 0x01, 0x30, 0x10, "2C_1C" }, - {0x11, 0x01, 0x30, 0x30, "1C_1C" }, - - {0 , 0xfe, 0 , 4, "Coin_A" }, - {0x11, 0x01, 0xc0, 0xc0, "1C_1C" }, - {0x11, 0x01, 0xc0, 0x00, "2C_4C" }, - {0x11, 0x01, 0xc0, 0x40, "1C_2C" }, - {0x11, 0x01, 0xc0, 0x80, "1C_3C" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x06, 0x02, "Easy" }, - {0x12, 0x01, 0x06, 0x06, "Medium" }, - {0x12, 0x01, 0x06, 0x04, "Hard" }, - {0x12, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo_Sounds" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Allow_Continue" }, - {0x12, 0x01, 0x10, 0x00, "No" }, - {0x12, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 8, "Bonus_Life" }, - {0x12, 0x01, 0xe0, 0xe0, "20000 and every 50000"}, - {0x12, 0x01, 0xe0, 0x60, "20000 and every 60000"}, - {0x12, 0x01, 0xe0, 0xa0, "20000 and every 70000"}, - {0x12, 0x01, 0xe0, 0x20, "30000 and every 60000"}, - {0x12, 0x01, 0xe0, 0xc0, "30000 and every 70000"}, - {0x12, 0x01, 0xe0, 0x40, "30000 and every 80000"}, - {0x12, 0x01, 0xe0, 0x80, "40000 and every 100000"}, - {0x12, 0x01, 0xe0, 0x00, "None" }, -}; - -STDDIPINFO(Lwings) - -static struct BurnDIPInfo LwingsbDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Flip_Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x0c, 0x0c, "2" }, - {0x11, 0x01, 0x0c, 0x04, "3" }, - {0x11, 0x01, 0x0c, 0x08, "4" }, - {0x11, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin_B" }, - {0x11, 0x01, 0x30, 0x00, "4C_1C" }, - {0x11, 0x01, 0x30, 0x20, "3C_1C" }, - {0x11, 0x01, 0x30, 0x10, "2C_1C" }, - {0x11, 0x01, 0x30, 0x30, "1C_1C" }, - - {0 , 0xfe, 0 , 4, "Coin_A" }, - {0x11, 0x01, 0xc0, 0xc0, "1C_1C" }, - {0x11, 0x01, 0xc0, 0x00, "2C_4C" }, - {0x11, 0x01, 0xc0, 0x40, "1C_2C" }, - {0x11, 0x01, 0xc0, 0x80, "1C_3C" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x06, 0x02, "Easy" }, - {0x12, 0x01, 0x06, 0x06, "Medium" }, - {0x12, 0x01, 0x06, 0x04, "Hard" }, - {0x12, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo_Sounds" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Allow_Continue" }, - {0x12, 0x01, 0x10, 0x00, "No" }, - {0x12, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 8, "Bonus_Life" }, - {0x12, 0x01, 0xe0, 0xe0, "20000 and every 50000" }, - {0x12, 0x01, 0xe0, 0x60, "20000 and every 60000" }, - {0x12, 0x01, 0xe0, 0xa0, "20000 and every 70000" }, - {0x12, 0x01, 0xe0, 0x20, "30000 and every 60000" }, - {0x12, 0x01, 0xe0, 0xc0, "30000 and every 70000" }, - {0x12, 0x01, 0xe0, 0x40, "30000 and every 80000" }, - {0x12, 0x01, 0xe0, 0x80, "40000 and every 100000" }, - {0x12, 0x01, 0xe0, 0x00, "None" }, -}; - -STDDIPINFO(Lwingsb) - -static struct BurnDIPInfo SectionzDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip_Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x0c, 0x04, "2" }, - {0x11, 0x01, 0x0c, 0x0c, "3" }, - {0x11, 0x01, 0x0c, 0x08, "4" }, - {0x11, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin_A" }, - {0x11, 0x01, 0x30, 0x00, "4C_1C" }, - {0x11, 0x01, 0x30, 0x20, "3C_1C" }, - {0x11, 0x01, 0x30, 0x10, "2C_1C" }, - {0x11, 0x01, 0x30, 0x30, "1C_1C" }, - - {0 , 0xfe, 0 , 4, "Coin_B" }, - {0x11, 0x01, 0xc0, 0x00, "2C_1C" }, - {0x11, 0x01, 0xc0, 0xc0, "1C_1C" }, - {0x11, 0x01, 0xc0, 0x40, "1C_2C" }, - {0x11, 0x01, 0xc0, 0x80, "1C_3C" }, - - {0 , 0xfe, 0 , 2, "Allow_Continue" }, - {0x12, 0x01, 0x01, 0x00, "No" }, - {0x12, 0x01, 0x01, 0x01, "Yes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x06, 0x02, "Easy" }, - {0x12, 0x01, 0x06, 0x06, "Normal" }, - {0x12, 0x01, 0x06, 0x04, "Hard" }, - {0x12, 0x01, 0x06, 0x00, "Very_Hard" }, - - {0 , 0xfe, 0 , 8, "Bonus_Life" }, - {0x12, 0x01, 0x38, 0x38, "20000 50000" }, - {0x12, 0x01, 0x38, 0x18, "20000 60000" }, - {0x12, 0x01, 0x38, 0x28, "20000 70000" }, - {0x12, 0x01, 0x38, 0x08, "30000 60000" }, - {0x12, 0x01, 0x38, 0x30, "30000 70000" }, - {0x12, 0x01, 0x38, 0x10, "30000 80000" }, - {0x12, 0x01, 0x38, 0x20, "40000 100000" }, - {0x12, 0x01, 0x38, 0x00, "None" }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x12, 0x01, 0xc0, 0x00, "Upright One Player" }, - {0x12, 0x01, 0xc0, 0x40, "Upright Two Players" }, - {0x12, 0x01, 0xc0, 0xc0, "Cocktail" }, -}; - -STDDIPINFO(Sectionz) - -static struct BurnDIPInfo TrojanlsDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x1c, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x11, 0x01, 0x03, 0x00, "Upright 1 Player" }, - {0x11, 0x01, 0x03, 0x02, "Upright 2 Players" }, - {0x11, 0x01, 0x03, 0x03, "Cocktail" }, - - {0 , 0xfe, 0 , 8, "Bonus_Life" }, - {0x11, 0x01, 0x1c, 0x10, "20000 60000" }, - {0x11, 0x01, 0x1c, 0x0c, "20000 70000" }, - {0x11, 0x01, 0x1c, 0x08, "20000 80000" }, - {0x11, 0x01, 0x1c, 0x1c, "30000 60000" }, - {0x11, 0x01, 0x1c, 0x18, "30000 70000" }, - {0x11, 0x01, 0x1c, 0x14, "30000 80000" }, - {0x11, 0x01, 0x1c, 0x04, "40000 80000" }, - {0x11, 0x01, 0x1c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Coin_A" }, - {0x12, 0x01, 0x03, 0x00, "2C_1C" }, - {0x12, 0x01, 0x03, 0x03, "1C_1C" }, - {0x12, 0x01, 0x03, 0x02, "1C_2C" }, - {0x12, 0x01, 0x03, 0x01, "1C_3C" }, - - {0 , 0xfe, 0 , 4, "Coin_B" }, - {0x12, 0x01, 0x0c, 0x00, "4C_1C" }, - {0x12, 0x01, 0x0c, 0x04, "3C_1C" }, - {0x12, 0x01, 0x0c, 0x08, "2C_1C" }, - {0x12, 0x01, 0x0c, 0x0c, "1C_1C" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x20, "2" }, - {0x12, 0x01, 0x30, 0x30, "3" }, - {0x12, 0x01, 0x30, 0x10, "4" }, - {0x12, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Flip_Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow_Continue" }, - {0x12, 0x01, 0x80, 0x00, "No" }, - {0x12, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Trojanls) - -static struct BurnDIPInfo TrojanDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfc, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x11, 0x01, 0x03, 0x00, "Upright 1 Player" }, - {0x11, 0x01, 0x03, 0x02, "Upright 2 Players" }, - {0x11, 0x01, 0x03, 0x03, "Cocktail" }, - - {0 , 0xfe, 0 , 8, "Bonus_Life" }, - {0x11, 0x01, 0x1c, 0x10, "20000 60000" }, - {0x11, 0x01, 0x1c, 0x0c, "20000 70000" }, - {0x11, 0x01, 0x1c, 0x08, "20000 80000" }, - {0x11, 0x01, 0x1c, 0x1c, "30000 60000" }, - {0x11, 0x01, 0x1c, 0x18, "30000 70000" }, - {0x11, 0x01, 0x1c, 0x14, "30000 80000" }, - {0x11, 0x01, 0x1c, 0x04, "40000 80000" }, - {0x11, 0x01, 0x1c, 0x00, "None" }, - - {0 , 0xfe, 0 , 6, "Starting Level" }, - {0x11, 0x01, 0xe0, 0xe0, "1" }, - {0x11, 0x01, 0xe0, 0xc0, "2" }, - {0x11, 0x01, 0xe0, 0xa0, "3" }, - {0x11, 0x01, 0xe0, 0x80, "4" }, - {0x11, 0x01, 0xe0, 0x60, "5" }, - {0x11, 0x01, 0xe0, 0x40, "6" }, - - {0 , 0xfe, 0 , 4, "Coin_A" }, - {0x12, 0x01, 0x03, 0x00, "2C_1C" }, - {0x12, 0x01, 0x03, 0x03, "1C_1C" }, - {0x12, 0x01, 0x03, 0x02, "1C_2C" }, - {0x12, 0x01, 0x03, 0x01, "1C_3C" }, - - {0 , 0xfe, 0 , 4, "Coin_B" }, - {0x12, 0x01, 0x0c, 0x00, "4C_1C" }, - {0x12, 0x01, 0x0c, 0x04, "3C_1C" }, - {0x12, 0x01, 0x0c, 0x08, "2C_1C" }, - {0x12, 0x01, 0x0c, 0x0c, "1C_1C" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x20, "2" }, - {0x12, 0x01, 0x30, 0x30, "3" }, - {0x12, 0x01, 0x30, 0x10, "4" }, - {0x12, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Flip_Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow_Continue" }, - {0x12, 0x01, 0x80, 0x00, "No" }, - {0x12, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Trojan) - -static struct BurnDIPInfo AvengersDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip_Screen" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin_B" }, - {0x12, 0x01, 0x1c, 0x00, "4C_1C" }, - {0x12, 0x01, 0x1c, 0x10, "3C_1C" }, - {0x12, 0x01, 0x1c, 0x08, "2C_1C" }, - {0x12, 0x01, 0x1c, 0x1c, "1C_1C" }, - {0x12, 0x01, 0x1c, 0x0c, "1C_2C" }, - {0x12, 0x01, 0x1c, 0x14, "1C_3C" }, - {0x12, 0x01, 0x1c, 0x04, "1C_4C" }, - {0x12, 0x01, 0x1c, 0x18, "1C_6C" }, - - {0 , 0xfe, 0 , 8, "Coin_A" }, - {0x12, 0x01, 0xe0, 0x00, "4C_1C" }, - {0x12, 0x01, 0xe0, 0x80, "3C_1C" }, - {0x12, 0x01, 0xe0, 0x40, "2C_1C" }, - {0x12, 0x01, 0xe0, 0xe0, "1C_1C" }, - {0x12, 0x01, 0xe0, 0x60, "1C_2C" }, - {0x12, 0x01, 0xe0, 0xa0, "1C_3C" }, - {0x12, 0x01, 0xe0, 0x20, "1C_4C" }, - {0x12, 0x01, 0xe0, 0xc0, "1C_6C" }, - - {0 , 0xfe, 0 , 2, "Allow_Continue" }, - {0x11, 0x01, 0x01, 0x00, "No" }, - {0x11, 0x01, 0x01, 0x01, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo_Sounds" }, - {0x11, 0x01, 0x02, 0x00, "Off" }, - {0x11, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x0c, 0x04, "Easy" }, - {0x11, 0x01, 0x0c, 0x0c, "Normal" }, - {0x11, 0x01, 0x0c, 0x08, "Hard" }, - {0x11, 0x01, 0x0c, 0x00, "Very_Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus_Life" }, - {0x11, 0x01, 0x30, 0x30, "20k 60k" }, - {0x11, 0x01, 0x30, 0x10, "20k 70k" }, - {0x11, 0x01, 0x30, 0x20, "20k 80k" }, - {0x11, 0x01, 0x30, 0x00, "30k 80k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0xc0, "3" }, - {0x11, 0x01, 0xc0, 0x40, "4" }, - {0x11, 0x01, 0xc0, 0x80, "5" }, - {0x11, 0x01, 0xc0, 0x00, "6" }, -}; - -STDDIPINFO(Avengers) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x010000; - DrvZ80ROM2 = Next; Next += 0x010000; - - DrvTileMap = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x020000; - - DrvGfxMask = Next; Next += 0x000020; - - MSM6295ROM = Next; - DrvSampleROM = Next; Next += 0x200000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x002000; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000200; - DrvSprBuf = Next; Next += 0x000200; - - ScrollX = Next; Next += 0x000002; - ScrollY = Next; Next += 0x000002; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -// Avengers protection code ripped directly from MAME -static void avengers_protection_w(UINT8 data) -{ - INT32 pc = ZetGetPC(-1); - - if (pc == 0x2eeb) - { - avengers_param[0] = data; - } - else if (pc == 0x2f09) - { - avengers_param[1] = data; - } - else if (pc == 0x2f26) - { - avengers_param[2] = data; - } - else if (pc == 0x2f43) - { - avengers_param[3] = data; - } - else if (pc == 0x0445) - { - avengers_soundstate = 0x80; - soundlatch = data; - } -} - -static INT32 avengers_fetch_paldata() -{ - static const char pal_data[] = - // page 1: 0x03,0x02,0x01,0x00 - "0000000000000000" "A65486A6364676D6" "C764C777676778A7" "A574E5E5C5756AE5" - "0000000000000000" "F51785D505159405" "A637B6A636269636" "F45744E424348824" - "0000000000000000" "A33263B303330203" "4454848454440454" "A27242C232523632" - "0000000000000000" "1253327202421102" "3386437373631373" "41A331A161715461" - "0000000000000000" "1341715000711203" "4442635191622293" "5143D48383D37186" - "0000000000000000" "2432423000412305" "6633343302333305" "7234A565A5A4A2A8" - "0000000000000000" "46232422A02234A7" "88241624A21454A7" "A3256747A665D3AA" - "0000000000000000" "070406020003050B" "0A05090504050508" "05060A090806040C" - - // page2: 0x07,0x06,0x05,0x04 - "0000000000000000" "2472030503230534" "6392633B23433B53" "0392846454346423" - "0000000000000000" "1313052405050423" "3223754805354832" "323346A38686A332" - "0000000000000000" "72190723070723D2" "81394776070776D1" "A15929F25959F2F1" - "0000000000000000" "650706411A2A1168" "770737C43A3A3466" "87071F013C0C3175" - "0000000000000000" "2001402727302020" "4403048F4A484344" "4A050B074E0E4440" - "0000000000000000" "3003800C35683130" "5304035C587C5453" "5607080C5B265550" - "0000000000000000" "4801D00043854245" "6C020038669A6569" "6604050A69446764" - "0000000000000000" "0504000001030504" "0A05090504060307" "04090D0507010403" - - // page3: 0x0b,0x0a,0x09,0x08 - "0000000000000000" "685A586937F777F7" "988A797A67A7A7A7" "B8CA898DC737F787" - "0000000000000000" "4738A61705150505" "8797672835250535" "7777072A25350525" - "0000000000000000" "3525642404340404" "6554453554440454" "5544053634540434" - "0000000000000000" "2301923203430303" "4333834383630373" "3324034473730363" - "0000000000000000" "3130304000762005" "5352525291614193" "6463635483D06581" - "0000000000000000" "4241415100483107" "6463631302335304" "76757415A5A077A3" - "0000000000000000" "53525282A02A43AA" "76747424A31565A5" "88888536A66089A4" - "0000000000000000" "05040304000D050C" "0806050604070707" "0A0A060808000C06" - - // page4: 0x0f,0x0e,0x0d,0x0c - "0000000000000000" "3470365956342935" "5590578997554958" "73C078A8C573687A" - "0000000000000000" "5355650685030604" "2427362686042607" "010A070584010508" - "0000000000000000" "0208432454022403" "737A243455733406" "000D050353000307" - "0000000000000000" "000A023233003202" "424C134234424204" "000F241132001105" - "0000000000000000" "3031113030300030" "5152215252512051" "7273337374723272" - "0000000000000000" "4141214041411041" "6263326363623162" "8385448585834383" - "0000000000000000" "5153225152512051" "7375437475734273" "9598559697946495" - "0000000000000000" "0205020303020102" "0407040606040304" "060A060809060506" - - // page5: 0x13,0x12,0x11,0x10 - "0000000000000000" "4151D141D3D177F7" "5454C44482C4A7A7" "0404D45491D4F787" - "0000000000000000" "0303032374230505" "9696962673560535" "0505054502850525" - "0000000000000000" "0303030355030404" "7777770754470454" "0606060603760434" - "0000000000000000" "0505053547050303" "4949492945390373" "0808083804580363" - "0000000000000000" "0B0C444023442005" "3D3F333433334193" "0000043504046581" - "0000000000000000" "0809565085863107" "0B6A352374455304" "00700644050677A3" - "0000000000000000" "06073879C8C843AA" "09492739A58765A5" "0050084A060889A4" - "0000000000000000" "05060B070B0B050C" "0707090707090707" "00000B08070B0C06" - - // page6: 0x17,0x16,0x15,0x14 - "0000000000000000" "0034308021620053" "0034417042512542" "0034526064502E31" - "0000000000000000" "0106412032733060" "11A6522053628350" "22A6632072620D42" - "0000000000000000" "1308223052242080" "2478233071235170" "3578243090230960" - "0000000000000000" "2111334333331404" "3353324232324807" "45B5314131310837" - "0000000000000000" "3232445444445302" "445443534343B725" "567642524242B745" - "0000000000000000" "4343556555550201" "5575546454540524" "6787536353537554" - "0000000000000000" "6474667676660100" "7696657575650423" "88A8647474645473" - "0000000000000000" "0001070701050004" "0003060603040303" "0005050505040302"; - - INT32 bank = avengers_palette_pen/64; - INT32 offs = avengers_palette_pen%64; - INT32 page = bank/4; // 0..7 - INT32 base = (3-(bank&3)); // 0..3 - INT32 row = offs&0xf; // 0..15 - INT32 col = offs/16 + base*4; // 0..15 - INT32 digit0 = pal_data[page*256*2 + (31-row*2)*16+col]; - INT32 digit1 = pal_data[page*256*2 + (30-row*2)*16+col]; - INT32 result; - - if( digit0>='A' ) digit0 += 10 - 'A'; else digit0 -= '0'; - if( digit1>='A' ) digit1 += 10 - 'A'; else digit1 -= '0'; - result = digit0 * 16 + digit1; - - if( (avengers_palette_pen&0x3f)!=0x3f ) avengers_palette_pen++; - - return result; -} - -static UINT8 avengers_protection_r() -{ - static const INT32 xpos[8] = { 10, 7, 0, -7, -10, -7, 0, 7 }; - static const INT32 ypos[8] = { 0, 7, 10, 7, 0, -7, -10, -7 }; - INT32 best_dist = 0; - INT32 best_dir = 0; - INT32 x,y; - INT32 dx,dy,dist,dir; - - if(ZetGetPC(-1) == 0x7c7 ) - { - // palette data - return avengers_fetch_paldata(); - } - - // int to Angle Function - // - // Input: two cartesian points - // Output: direction code (north,northeast,east,...) - // - x = avengers_param[0] - avengers_param[2]; - y = avengers_param[1] - avengers_param[3]; - for( dir=0; dir<8; dir++ ) - { - dx = xpos[dir]-x; - dy = ypos[dir]-y; - dist = dx*dx+dy*dy; - if( dist < best_dist || dir==0 ) - { - best_dir = dir; - best_dist = dist; - } - } - return best_dir<<5; -} - - - -UINT8 __fastcall lwings_main_read(UINT16 address) -{ - switch (address) - { - case 0xf808: - case 0xf809: - case 0xf80a: - return DrvInp[address - 0xf808]; - - case 0xf80b: - case 0xf80c: - return DrvDip[address - 0xf80b]; - - case 0xf80d: - case 0xf80e: - if (fball) { - return DrvInp[(address - 0xf80d) + 3]; - } else { - return avengers_protection_r(); - } - } - - return 0; -} - -static void lwings_bankswitch_w(UINT8 data) -{ - DrvZ80Bank = data; - - INT32 bankaddress = 0x10000 + ((data >> 1) & 3) * 0x4000; - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + bankaddress); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM0 + bankaddress); -} - -static inline void palette_update(INT32 entry) -{ - UINT16 p = DrvPalRAM[entry | 0x400] | (DrvPalRAM[entry] << 8); - - UINT8 r = (p >> 12) & 0xf; - UINT8 g = (p >> 8) & 0xf; - UINT8 b = (p >> 4) & 0xf; - - DrvPalette[entry] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0); -} - -void __fastcall lwings_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xf000) { - DrvPalRAM[address & 0x7ff] = data; - palette_update(address & 0x3ff); - return; - } - - // hack - if (avengers && (address & 0xfff8) == 0xf808) address += 0x10; - - switch (address) - { - case 0xf800: - case 0xf801: - case 0xf808: - case 0xf809: - ScrollX[address & 1] = data; - return; - - case 0xf802: - case 0xf803: - case 0xf80a: - case 0xf80b: - ScrollY[address & 1] = data; - return; - - case 0xf804: - trojan_bg2_scrollx = data; - return; - - case 0xf805: - trojan_bg2_image = data; - return; - - case 0xf80c: - soundlatch = data; - return; - - case 0xf80d: - if (fball) { - // watchdog = 0; - } else { - soundlatch2 = data; - } - return; - - case (0xf80e + 0x10): - case 0xf80e: { - lwings_bankswitch_w(data); - - flipscreen = ~data & 0x01; - - DrvSpriteBank = (data & 0x10) >> 4; - - interrupt_enable = data & 0x08; - } - return; - - case (0xf809 + 0x10): - avengers_protection_w(data); - return; - - case (0xf80c + 0x10): - avengers_palette_pen = data << 6; - return; - - case (0xf80d + 0x10): - soundlatch2 = data; - return; - } -} - -void __fastcall lwings_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - BurnYM2203Write((address & 2) >> 1, address & 1, data); - return; - - case 0xe006: - avengers_soundlatch2 = data; - return; - } -} - -UINT8 __fastcall lwings_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc800: - return soundlatch; - - case 0xe006: - UINT8 Data = avengers_soundlatch2 | avengers_soundstate; - avengers_soundstate = 0; - return Data; - } - - return 0; -} - -static void oki_bank(INT32 data) -{ - DrvSampleBank = data; - - INT32 bank = (DrvSampleBank & 0x0e) * 0x10000; - if (bank >= 0xc0000) bank -= 0xc0000; - - memcpy (DrvSampleROM + 0x20000, DrvSampleROM + 0x40000 + bank, 0x20000); -} - -static void __fastcall fball_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - oki_bank(data); - return; - - case 0xe000: - MSM6295Command(0, data); - return; - } -} - -static UINT8 __fastcall fball_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8000: - return soundlatch; - - case 0xe000: - return MSM6295ReadStatus(0); - } - - return 0; -} - -void __fastcall trojan_adpcm_out(UINT16 port, UINT8 data) -{ - if ((port & 0xff) == 0x01) { - MSM5205ResetWrite(0, (data >> 7) & 1); - MSM5205DataWrite(0, data); - MSM5205VCLKWrite(0, 1); - MSM5205VCLKWrite(0, 0); - } -} - -UINT8 __fastcall trojan_adpcm_in(UINT16 port) -{ - port &= 0xff; - - UINT8 ret = 0; - - if (port == 0x00) { - ret = soundlatch2; - } - - return ret; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - if (i == 0) lwings_bankswitch_w(0); - ZetClose(); - } - - if (MSM5205InUse) { - ZetOpen(2); - ZetReset(); - ZetClose(); - } - - if (fball) { - MSM6295Reset(0); - oki_bank(0); - } else { - BurnYM2203Reset(); - } - - if (MSM5205InUse) MSM5205Reset(); - - trojan_bg2_scrollx = 0; - trojan_bg2_image = 0; - - memset(avengers_param, 0, 4); - avengers_palette_pen = 0; - - avengers_soundlatch2 = 0; - avengers_soundstate = 0; - - DrvSpriteBank = 0; - DrvZ80Bank = 0; - flipscreen = 0; - interrupt_enable = 0; - soundlatch = 0; - soundlatch2 = 0; - irq_counter = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0x000000, 0x000004 }; - INT32 Plane1[4] = { RGN_FRAC(spritelen, 1, 2)+4, RGN_FRAC(spritelen, 1, 2)+0, 4, 0 };//0x080004, 0x080000, 0x000004, 0x000000 }; - INT32 Plane1a[4] = { 0x100004, 0x100000, 0x000004, 0x000000 }; - INT32 Plane2[4] = { 0x180000, 0x100000, 0x080000, 0x000000 }; - INT32 Plane3[4] = { 0x040000, 0x040004, 0x000000, 0x000004 }; - - // sprite, char - INT32 XOffs0[16] = { 0, 1, 2, 3, 8, 9, 10, 11, 256, 257, 258, 259, 264, 265, 266, 267 }; - INT32 YOffs0[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; - - // background - INT32 XOffs1[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; - INT32 YOffs1[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0800, 2, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane2, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - if (DrvTileMap != NULL) { - GfxDecode(0x0800, 4, 16, 16, Plane1a, XOffs0, YOffs0, 0x200, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x10000); - - GfxDecode(0x0200, 4, 16, 16, Plane3, XOffs0, YOffs0, 0x200, tmp, DrvGfxROM3); - } else { - GfxDecode(0x0400, 4, 16, 16, Plane1, XOffs0, YOffs0, 0x200, tmp, DrvGfxROM2); - } - - BurnFree (tmp); - - return 0; -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 3000000); -} - -inline static INT32 DrvMSM5205SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate / (nCyclesTotal[0] * 130)); -} - -inline static INT32 DrvMSM5205SynchroniseStreamAvengers(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate / (nCyclesTotal[0] * 60)); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3000000; -} - -static void lwings_main_cpu_init() -{ - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - // 8000 - bfff banked - ZetMapArea(0xc000, 0xddff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xddff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xddff, 2, DrvZ80RAM0); - - ZetMapArea(0xde00, 0xdfff, 0, DrvSprRAM); - ZetMapArea(0xde00, 0xdfff, 1, DrvSprRAM); - ZetMapArea(0xde00, 0xdfff, 2, DrvSprRAM); - - ZetMapArea(0xe000, 0xe7ff, 0, DrvFgRAM); - ZetMapArea(0xe000, 0xe7ff, 1, DrvFgRAM); - ZetMapArea(0xe000, 0xe7ff, 2, DrvFgRAM); - - ZetMapArea(0xe800, 0xefff, 0, DrvBgRAM); - ZetMapArea(0xe800, 0xefff, 1, DrvBgRAM); - ZetMapArea(0xe800, 0xefff, 2, DrvBgRAM); - - ZetMapArea(0xf000, 0xf7ff, 0, DrvPalRAM); -// ZetMapArea(0xf000, 0xf7ff, 1, DrvPalRAM); // write handler - ZetMapArea(0xf000, 0xf7ff, 2, DrvPalRAM); - ZetSetReadHandler(lwings_main_read); - ZetSetWriteHandler(lwings_main_write); - ZetClose(); -} - -static void lwings_sound_init() -{ - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM1); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM1); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM1); - ZetSetReadHandler(lwings_sound_read); - ZetSetWriteHandler(lwings_sound_write); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.10, BURN_SND_ROUTE_BOTH); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - DrvTileMap = NULL; - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x18000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x8000, i + 5, 1)) return 1; - } - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM2 + i * 0x8000, i + 13, 1)) return 1; - } - - spritelen = 0x20000; - - DrvGfxDecode(); - } - - ZetInit(0); - lwings_main_cpu_init(); - - ZetInit(1); - lwings_sound_init(); - - GenericTilesInit(); - - nCyclesTotal[0] = 6000000 / 60; - nCyclesTotal[1] = 3000000 / 60; - nCyclesTotal[2] = 0; - - DrvDoReset(); - - return 0; -} - -static INT32 TrojanInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x18000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x8000, i + 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + i * 0x8000, i + 14, 1)) return 1; - } - spritelen = 0x40000; - - if (BurnLoadRom(DrvGfxROM3 + 0x0000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x8000, 23, 1)) return 1; - - if (BurnLoadRom(DrvTileMap, 24, 1)) return 1; - - DrvGfxDecode(); - - { - for (INT32 i = 0; i < 32; i++) { - DrvGfxMask[i] = (0xf07f0001 & (1 << i)) ? 1 : 0; - } - } - } - - ZetInit(0); - lwings_main_cpu_init(); - - ZetInit(1); - lwings_sound_init(); - - ZetInit(2); - ZetOpen(2); - ZetMapArea(0x0000, 0xffff, 0, DrvZ80ROM2); - ZetMapArea(0x0000, 0xffff, 2, DrvZ80ROM2); - ZetSetInHandler(trojan_adpcm_in); - ZetSetOutHandler(trojan_adpcm_out); - ZetClose(); - - MSM5205Init(0, (avengers) ? DrvMSM5205SynchroniseStreamAvengers : DrvMSM5205SynchroniseStream, /*455000*/384000, NULL, MSM5205_SEX_4B, 1); - MSM5205SetRoute(0, (avengers) ? 1.00 : 0.50, BURN_SND_ROUTE_BOTH); - MSM5205InUse = 1; - - GenericTilesInit(); - - nCyclesTotal[0] = 3000000 / 60; - nCyclesTotal[1] = 3000000 / 60; - nCyclesTotal[2] = 3000000 / 60; - - DrvDoReset(); - - return 0; -} - -static INT32 FballInit() -{ - fball = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - DrvTileMap = NULL; - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - // bank2 = 0x8000 - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 1, 1)) return 1; - memset (DrvZ80ROM1 + 0x1000, 0xff, 0x10000-0x1000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 2, 1)) return 1; - memset (DrvGfxROM0 + 0x4000, 0xff, 0x10000-0x4000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 6, 1)) return 1; - memset (DrvGfxROM1 + 0x40000, 0, 0x50000); - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 8, 1)) return 1; - spritelen = 0x40000; - - if (BurnLoadRom(DrvSampleROM + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvSampleROM + 0x40000, 9, 1)) return 1; - if (BurnLoadRom(DrvSampleROM + 0x80000, 10, 1)) return 1; - if (BurnLoadRom(DrvSampleROM + 0xc0000, 11, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - lwings_main_cpu_init(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x0fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(fball_sound_write); - ZetSetReadHandler(fball_sound_read); - ZetClose(); - - MSM6295Init(0, 1000000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - nCyclesTotal[0] = 6000000 / 60; - nCyclesTotal[1] = 3000000 / 60; - nCyclesTotal[2] = 0; - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - if (fball) { - MSM6295Exit(0); - } else { - BurnYM2203Exit(); - } - BurnFree (AllMem); - - fball = 0; - avengers = 0; - MSM5205InUse = 0; - - return 0; -} - -static INT32 TrojanExit() -{ - MSM5205Exit(); - return DrvExit(); -} - -static void draw_foreground(INT32 colbase) -{ - for (INT32 offs = 0x20; offs < 0x3e0; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 color = DrvFgRAM[offs | 0x400]; - INT32 code = DrvFgRAM[offs] | ((color & 0xc0) << 2); - - INT32 flipx = color & 0x10; - INT32 flipy = color & 0x20; - - color &= 0x0f; - - sy -= 8; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 2, 0x03, colbase, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 2, 0x03, colbase, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 2, 0x03, colbase, DrvGfxROM0); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 2, 0x03, colbase, DrvGfxROM0); - } - } - } -} - -static void draw_background() -{ - INT32 scrollx = (ScrollX[0] | (ScrollX[1] << 8)) & 0x1ff; - INT32 scrolly = (ScrollY[0] | (ScrollY[1] << 8)) & 0x1ff; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sy = (offs & 0x1f) << 4; - INT32 sx = (offs >> 5) << 4; - sy -= 8; - - sx -= scrollx; - sy -= scrolly; - if (sx < -15) sx += 512; - if (sy < -15) sy += 512; - - if (sy < -15 || sx < -15 || sy >= nScreenHeight || sx >= nScreenWidth) - continue; - - INT32 color = DrvBgRAM[offs | 0x400]; - INT32 code = DrvBgRAM[offs] | (color & 0xe0) << 3;; - - INT32 flipx = color & 0x08; - INT32 flipy = color & 0x10; - - color &= 0x07; - - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM1); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM1); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM1); - } - } - } -} - -static void lwings_draw_sprites() -{ - for (INT32 offs = 0x200 - 4; offs >= 0; offs -= 4) - { - INT32 sx = DrvSprBuf[offs + 3] - 0x100 * (DrvSprBuf[offs + 1] & 0x01); - INT32 sy = DrvSprBuf[offs + 2]; - - if (sy && sx) - { - INT32 code,color,flipx,flipy; - - if (sy > 0xf8) sy-=0x100; - - code = DrvSprBuf[offs] | ((DrvSprBuf[offs + 1] & 0xc0) << 2); - color = (DrvSprBuf[offs + 1] & 0x38) >> 3; - flipx = DrvSprBuf[offs + 1] & 0x02; - flipy = DrvSprBuf[offs + 1] & 0x04; - - color += 0x18; - - sy -= 8; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM2); - } - } - } - } -} - - -static void draw_16x16_with_mask(INT32 sx, INT32 sy, INT32 code, INT32 color, UINT8 *gfxbase, UINT8 *mask, INT32 flipx, INT32 flipy) -{ - UINT8 *src = gfxbase + (code << 8); - - color = (color << 4) | 0x100; - - if (flipy) { - src += 0xf0; - - if (flipx) { - for (INT32 y = 15; y >= 0; y--, src-=16) - { - INT32 yy = sy + y; - if (yy < 0) break; - if (yy >= nScreenHeight) continue; - - for (INT32 x = 15; x >= 0; x--) - { - INT32 xx = sx + x; - if (xx < 0) break; - if (xx >= nScreenWidth) continue; - - INT32 o = color | src[15-x]; - if (mask[src[15-x]]) continue; - - pTransDraw[(yy * nScreenWidth) + xx] = o; - } - } - } else { - for (INT32 y = 15; y >= 0; y--, src-=16) - { - INT32 yy = sy + y; - if (yy < 0) break; - if (yy >= nScreenHeight) continue; - - for (INT32 x = 0; x < 16; x++) - { - INT32 xx = sx + x; - if (xx < 0) continue; - if (xx >= nScreenWidth) break; - - INT32 o = color | src[x]; - if (mask[src[x]]) continue; - - pTransDraw[(yy * nScreenWidth) + xx] = o; - } - } - } - } else { - if (flipx) { - for (INT32 y = 0; y < 16; y++, src+=16) - { - INT32 yy = sy + y; - if (yy < 0) continue; - if (yy >= nScreenHeight) break; - - for (INT32 x = 15; x >= 0; x--) - { - INT32 xx = sx + x; - if (xx < 0) break; - if (xx >= nScreenWidth) continue; - - INT32 o = color | src[15-x]; - if (mask[src[15-x]]) continue; - - pTransDraw[(yy * nScreenWidth) + xx] = o; - } - } - } else { - for (INT32 y = 0; y < 16; y++, src+=16) - { - INT32 yy = sy + y; - if (yy < 0) continue; - if (yy >= nScreenHeight) break; - - for (INT32 x = 0; x < 16; x++) - { - INT32 xx = sx + x; - if (xx < 0) continue; - if (xx >= nScreenWidth) break; - - INT32 o = color | src[x]; - if (mask[src[x]]) continue; - - pTransDraw[(yy * nScreenWidth) + xx] = o; - } - } - } - } -} - -static void trojan_draw_background(INT32 priority) -{ - INT32 scrollx = (ScrollX[0] | (ScrollX[1] << 8)) & 0x1ff; - INT32 scrolly = (ScrollY[0] | (ScrollY[1] << 8)) & 0x1ff; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 color = DrvBgRAM[offs | 0x400]; - if (priority && ((~color >> 3) & 1)) continue; - - INT32 sy = (offs & 0x1f) << 4; - INT32 sx = (offs >> 5) << 4; - sy -= 8; - - sx -= scrollx; - sy -= scrolly; - if (sx < -15) sx += 512; - if (sy < -15) sy += 512; - - if (sy < -15 || sx < -15 || sy >= nScreenHeight || sx >= nScreenWidth) - continue; - - INT32 code = DrvBgRAM[offs] | ((color & 0xe0) << 3); - INT32 flipx = color & 0x10; - INT32 flipy = 0; - - color &= 0x07; - - if (avengers) color ^= 6; - - draw_16x16_with_mask(sx, sy, code, color, DrvGfxROM1, DrvGfxMask + priority * 16, flipx, flipy); -/* - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x00, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x00, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x00, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x00, 0x100, DrvGfxROM1); - } - } -*/ - } -} - -static void trojan_draw_background2() -{ - for (INT32 offs = 0; offs < 32 * 16; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= trojan_bg2_scrollx; - if (sx < -15) sx += 512; - sy -= 8; - - if (sy < -15 || sx < -15 || sy >= nScreenHeight || sx >= nScreenWidth) - continue; - - INT32 offset = ((((offs << 6) & 0x7800) | ((offs << 1) & 0x3e)) + (trojan_bg2_image << 5)) & 0x7fff; - - INT32 color = DrvTileMap[offset + 1]; - INT32 code = DrvTileMap[offset + 0] | ((color & 0x80) << 1); - INT32 flipx = color & 0x10; - INT32 flipy = color & 0x20; - - color &= 7; - - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM3); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM3); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM3); - } - } - } -} - -static void trojan_draw_sprites() -{ - for (INT32 offs = 0x180 - 4; offs >= 0; offs -= 4) - { - INT32 sx = DrvSprBuf[offs + 3] - 0x100 * (DrvSprBuf[offs + 1] & 0x01); - INT32 sy = DrvSprBuf[offs + 2]; - - if (sy && sx) - { - INT32 flipx, flipy; - - if (sy > 0xf8) sy-=0x100; - - INT32 color = DrvSprBuf[offs + 1]; - INT32 code = DrvSprBuf[offs] | ((color & 0x20) << 4) | ((color & 0x40) << 2) | ((color & 0x80) << 3) | (DrvSpriteBank << 10); - - if (avengers) - { - flipx = 0; - flipy = ~color & 0x10; - } - else - { - flipx = color & 0x10; - flipy = 1; - } - - color = ((color >> 1) & 7) + 0x28; - - sy -= 8; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM2); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i++) { - palette_update(i); - } - DrvRecalc = 0; - } - - if (DrvTileMap == NULL) { - draw_background(); - lwings_draw_sprites(); - draw_foreground(0x200); - } else { - trojan_draw_background2(); - trojan_draw_background(0); - trojan_draw_sprites(); - trojan_draw_background(1); - draw_foreground(0x300); - } - - if (flipscreen) { - UINT16 *ptr = pTransDraw + (nScreenWidth * nScreenHeight) - 1; - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight / 2; i++, ptr--) - { - INT32 n = pTransDraw[i]; - pTransDraw[i] = *ptr; - *ptr = n; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInp, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInp[0] ^= (DrvJoy1[i] & 1) << i; - DrvInp[1] ^= (DrvJoy2[i] & 1) << i; - DrvInp[2] ^= (DrvJoy3[i] & 1) << i; - } - - if ((DrvInp[1] & 0x03) == 0) DrvInp[1] |= 0x03; - if ((DrvInp[1] & 0x0c) == 0) DrvInp[1] |= 0x0c; - if ((DrvInp[2] & 0x03) == 0) DrvInp[2] |= 0x03; - if ((DrvInp[2] & 0x0c) == 0) DrvInp[2] |= 0x0c; - } - - INT32 nInterleave; - INT32 MSMIRQSlice[134]; - - if (MSM5205InUse) { - nInterleave = MSM5205CalcInterleave(0, 6000000); - - for (INT32 i = 0; i < 133; i++) { - MSMIRQSlice[i] = (INT32)((double)((nInterleave * (i + 1)) / 134)); - } - } else { - nInterleave = 16; - } - - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (interrupt_enable && i == (nInterleave-1 /* * 242 / 256*/)) { - if (avengers & 1) { - ZetNmi(); - } else { - ZetSetVector(0xd7); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - } - if (MSM5205InUse) MSM5205Update(); - ZetClose(); - - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - BurnTimerUpdate((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - if ((i % (nInterleave / 4)) == ((nInterleave / 4) - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetRun(500); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - ZetClose(); - - if (MSM5205InUse) { - nCurrentCPU = 2; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - for (INT32 j = 0; j < 133; j++) { - if (i == MSMIRQSlice[j]) { - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - nCyclesDone[nCurrentCPU] += ZetRun((avengers) ? 500 : 1000); - } - } - ZetClose(); - } - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - if (MSM5205InUse) MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x200); - - return 0; -} - -static INT32 FballFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInp, 0xff, 5); - - for (INT32 i = 0; i < 8; i++) { - DrvInp[0] ^= (DrvJoy1[i] & 1) << i; - DrvInp[1] ^= (DrvJoy2[i] & 1) << i; - DrvInp[2] ^= (DrvJoy3[i] & 1) << i; - DrvInp[3] ^= (DrvJoy4[i] & 1) << i; - DrvInp[4] ^= (DrvJoy5[i] & 1) << i; - } - - if ((DrvInp[1] & 0x03) == 0) DrvInp[1] |= 0x03; - if ((DrvInp[1] & 0x0c) == 0) DrvInp[1] |= 0x0c; - if ((DrvInp[2] & 0x03) == 0) DrvInp[2] |= 0x03; - if ((DrvInp[2] & 0x0c) == 0) DrvInp[2] |= 0x0c; - if ((DrvInp[3] & 0x03) == 0) DrvInp[3] |= 0x03; - if ((DrvInp[3] & 0x0c) == 0) DrvInp[3] |= 0x0c; - if ((DrvInp[4] & 0x03) == 0) DrvInp[4] |= 0x03; - if ((DrvInp[4] & 0x0c) == 0) DrvInp[4] |= 0x0c; - } - - INT32 nInterleave = 100; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++, irq_counter++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (interrupt_enable && i == (nInterleave-1)) { - ZetNmi(); - } - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - if (irq_counter == 27) { - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - irq_counter = 0; - } - ZetClose(); - } - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x200); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029692; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - SCAN_VAR(DrvSampleBank); - - if (fball) { - MSM6295Scan(0, nAction); - oki_bank(0); // wrong - } else { - BurnYM2203Scan(nAction, pnMin); - } - if (MSM5205InUse) MSM5205Scan(nAction, pnMin); - - SCAN_VAR(interrupt_enable); - SCAN_VAR(soundlatch); - SCAN_VAR(soundlatch2); - SCAN_VAR(flipscreen); - SCAN_VAR(DrvZ80Bank); - SCAN_VAR(DrvSpriteBank); - SCAN_VAR(irq_counter); - - SCAN_VAR(avengers_param); - SCAN_VAR(avengers_palette_pen); - SCAN_VAR(avengers_soundlatch2); - SCAN_VAR(avengers_soundstate); - SCAN_VAR(trojan_bg2_scrollx); - SCAN_VAR(trojan_bg2_image); - } - - ZetOpen(0); - lwings_bankswitch_w(DrvZ80Bank); - ZetClose(); - - return 0; -} - - -// Section Z (set 1) - -static struct BurnRomInfo sectionzRomDesc[] = { - { "6c_sz01.bin", 0x8000, 0x69585125, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "7c_sz02.bin", 0x8000, 0x22f161b8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "9c_sz03.bin", 0x8000, 0x4c7111ed, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "11e_sz04.bin", 0x8000, 0xa6073566, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "9h_sz05.bin", 0x4000, 0x3173ba2e, 4 | BRF_GRA }, // 4 Characters - - { "3e_sz14.bin", 0x8000, 0x63782e30, 5 | BRF_GRA }, // 5 Background Layer 1 Tiles - { "1e_sz08.bin", 0x8000, 0xd57d9f13, 5 | BRF_GRA }, // 6 - { "3d_sz13.bin", 0x8000, 0x1b3d4d7f, 5 | BRF_GRA }, // 7 - { "1d_sz07.bin", 0x8000, 0xf5b3a29f, 5 | BRF_GRA }, // 8 - { "3b_sz12.bin", 0x8000, 0x11d47dfd, 5 | BRF_GRA }, // 9 - { "1b_sz06.bin", 0x8000, 0xdf703b68, 5 | BRF_GRA }, // 10 - { "3f_sz15.bin", 0x8000, 0x36bb9bf7, 5 | BRF_GRA }, // 11 - { "1f_sz09.bin", 0x8000, 0xda8f06c9, 5 | BRF_GRA }, // 12 - - { "3j_sz17.bin", 0x8000, 0x8df7b24a, 6 | BRF_GRA }, // 13 Sprites - { "1j_sz11.bin", 0x8000, 0x685d4c54, 6 | BRF_GRA }, // 14 - { "3h_sz16.bin", 0x8000, 0x500ff2bb, 6 | BRF_GRA }, // 15 - { "1h_sz10.bin", 0x8000, 0x00b3d244, 6 | BRF_GRA }, // 16 - - { "mb7114e.15g", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 17 Proms (not used) -}; - -STD_ROM_PICK(sectionz) -STD_ROM_FN(sectionz) - -struct BurnDriver BurnDrvSectionz = { - "sectionz", NULL, NULL, NULL, "1985", - "Section Z (set 1)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_HORSHOOT, 0, - NULL, sectionzRomInfo, sectionzRomName, NULL, NULL, DrvInputInfo, SectionzDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Section Z (set 2) - -static struct BurnRomInfo sctionzaRomDesc[] = { - { "sz-01a.bin", 0x8000, 0x98df49fd, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "7c_sz02.bin", 0x8000, 0x22f161b8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sz-03j.bin", 0x8000, 0x94547abf, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "11e_sz04.bin", 0x8000, 0xa6073566, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "9h_sz05.bin", 0x4000, 0x3173ba2e, 4 | BRF_GRA }, // 4 Characters - - { "3e_sz14.bin", 0x8000, 0x63782e30, 5 | BRF_GRA }, // 5 Background Layer 1 Tiles - { "1e_sz08.bin", 0x8000, 0xd57d9f13, 5 | BRF_GRA }, // 6 - { "3d_sz13.bin", 0x8000, 0x1b3d4d7f, 5 | BRF_GRA }, // 7 - { "1d_sz07.bin", 0x8000, 0xf5b3a29f, 5 | BRF_GRA }, // 8 - { "3b_sz12.bin", 0x8000, 0x11d47dfd, 5 | BRF_GRA }, // 9 - { "1b_sz06.bin", 0x8000, 0xdf703b68, 5 | BRF_GRA }, // 10 - { "3f_sz15.bin", 0x8000, 0x36bb9bf7, 5 | BRF_GRA }, // 11 - { "1f_sz09.bin", 0x8000, 0xda8f06c9, 5 | BRF_GRA }, // 12 - - { "3j_sz17.bin", 0x8000, 0x8df7b24a, 6 | BRF_GRA }, // 13 Sprites - { "1j_sz11.bin", 0x8000, 0x685d4c54, 6 | BRF_GRA }, // 14 - { "3h_sz16.bin", 0x8000, 0x500ff2bb, 6 | BRF_GRA }, // 15 - { "1h_sz10.bin", 0x8000, 0x00b3d244, 6 | BRF_GRA }, // 16 - - { "mb7114e.15g", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 17 Proms (not used) -}; - -STD_ROM_PICK(sctionza) -STD_ROM_FN(sctionza) - -struct BurnDriver BurnDrvSctionza = { - "sectionza", "sectionz", NULL, NULL, "1985", - "Section Z (set 2)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_HORSHOOT, 0, - NULL, sctionzaRomInfo, sctionzaRomName, NULL, NULL, DrvInputInfo, SectionzDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Legendary Wings (US set 1) - -static struct BurnRomInfo lwingsRomDesc[] = { - { "6c_lw01.bin", 0x8000, 0xb55a7f60, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "7c_lw02.bin", 0x8000, 0xa5efbb1b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "9c_lw03.bin", 0x8000, 0xec5cc201, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "11e_lw04.bin", 0x8000, 0xa20337a2, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "9h_lw05.bin", 0x4000, 0x091d923c, 4 | BRF_GRA }, // 4 Characters - - { "3e_lw14.bin", 0x8000, 0x5436392c, 5 | BRF_GRA }, // 5 Background Layer 1 Tiles - { "1e_lw08.bin", 0x8000, 0xb491bbbb, 5 | BRF_GRA }, // 6 - { "3d_lw13.bin", 0x8000, 0xfdd1908a, 5 | BRF_GRA }, // 7 - { "1d_lw07.bin", 0x8000, 0x5c73d406, 5 | BRF_GRA }, // 8 - { "3b_lw12.bin", 0x8000, 0x32e17b3c, 5 | BRF_GRA }, // 9 - { "1b_lw06.bin", 0x8000, 0x52e533c1, 5 | BRF_GRA }, // 10 - { "3f_lw15.bin", 0x8000, 0x99e134ba, 5 | BRF_GRA }, // 11 - { "1f_lw09.bin", 0x8000, 0xc8f28777, 5 | BRF_GRA }, // 12 - - { "3j_lw17.bin", 0x8000, 0x5ed1bc9b, 6 | BRF_GRA }, // 13 Sprites - { "1j_lw11.bin", 0x8000, 0x2a0790d6, 6 | BRF_GRA }, // 14 - { "3h_lw16.bin", 0x8000, 0xe8834006, 6 | BRF_GRA }, // 15 - { "1h_lw10.bin", 0x8000, 0xb693f5a5, 6 | BRF_GRA }, // 16 - - { "63s141.15g", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 17 Proms (not used) -}; - -STD_ROM_PICK(lwings) -STD_ROM_FN(lwings) - -struct BurnDriver BurnDrvLwings = { - "lwings", NULL, NULL, NULL, "1986", - "Legendary Wings (US set 1)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, lwingsRomInfo, lwingsRomName, NULL, NULL, DrvInputInfo, LwingsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Legendary Wings (US set 2) - -static struct BurnRomInfo lwings2RomDesc[] = { - { "u13-l", 0x8000, 0x3069c01c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "u14-k", 0x8000, 0x5d91c828, 1 | BRF_PRG | BRF_ESS }, // 1 - { "9c_lw03.bin", 0x8000, 0xec5cc201, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "11e_lw04.bin", 0x8000, 0xa20337a2, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "9h_lw05.bin", 0x4000, 0x091d923c, 4 | BRF_GRA }, // 4 Characters - - { "b_03e.rom", 0x8000, 0x176e3027, 5 | BRF_GRA }, // 5 Background Layer 1 Tiles - { "b_01e.rom", 0x8000, 0xf5d25623, 5 | BRF_GRA }, // 6 - { "b_03d.rom", 0x8000, 0x001caa35, 5 | BRF_GRA }, // 7 - { "b_01d.rom", 0x8000, 0x0ba008c3, 5 | BRF_GRA }, // 8 - { "b_03b.rom", 0x8000, 0x4f8182e9, 5 | BRF_GRA }, // 9 - { "b_01b.rom", 0x8000, 0xf1617374, 5 | BRF_GRA }, // 10 - { "b_03f.rom", 0x8000, 0x9b374dcc, 5 | BRF_GRA }, // 11 - { "b_01f.rom", 0x8000, 0x23654e0a, 5 | BRF_GRA }, // 12 - - { "b_03j.rom", 0x8000, 0x8f3c763a, 6 | BRF_GRA }, // 13 Sprites - { "b_01j.rom", 0x8000, 0x7cc90a1d, 6 | BRF_GRA }, // 14 - { "b_03h.rom", 0x8000, 0x7d58f532, 6 | BRF_GRA }, // 15 - { "b_01h.rom", 0x8000, 0x3e396eda, 6 | BRF_GRA }, // 16 - - { "63s141.15g", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 17 Proms (not used) -}; - -STD_ROM_PICK(lwings2) -STD_ROM_FN(lwings2) - -struct BurnDriver BurnDrvLwings2 = { - "lwings2", "lwings", NULL, NULL, "1986", - "Legendary Wings (US set 2)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, lwings2RomInfo, lwings2RomName, NULL, NULL, DrvInputInfo, LwingsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Ares no Tsubasa (Japan) - -static struct BurnRomInfo lwingsjpRomDesc[] = { - { "a_06c.rom", 0x8000, 0x2068a738, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a_07c.rom", 0x8000, 0xd6a2edc4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "9c_lw03.bin", 0x8000, 0xec5cc201, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "11e_lw04.bin", 0x8000, 0xa20337a2, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "9h_lw05.bin", 0x4000, 0x091d923c, 4 | BRF_GRA }, // 4 Characters - - { "b_03e.rom", 0x8000, 0x176e3027, 5 | BRF_GRA }, // 5 Background Layer 1 Tiles - { "b_01e.rom", 0x8000, 0xf5d25623, 5 | BRF_GRA }, // 6 - { "b_03d.rom", 0x8000, 0x001caa35, 5 | BRF_GRA }, // 7 - { "b_01d.rom", 0x8000, 0x0ba008c3, 5 | BRF_GRA }, // 8 - { "b_03b.rom", 0x8000, 0x4f8182e9, 5 | BRF_GRA }, // 9 - { "b_01b.rom", 0x8000, 0xf1617374, 5 | BRF_GRA }, // 10 - { "b_03f.rom", 0x8000, 0x9b374dcc, 5 | BRF_GRA }, // 11 - { "b_01f.rom", 0x8000, 0x23654e0a, 5 | BRF_GRA }, // 12 - - { "b_03j.rom", 0x8000, 0x8f3c763a, 6 | BRF_GRA }, // 13 Sprites - { "b_01j.rom", 0x8000, 0x7cc90a1d, 6 | BRF_GRA }, // 14 - { "b_03h.rom", 0x8000, 0x7d58f532, 6 | BRF_GRA }, // 15 - { "b_01h.rom", 0x8000, 0x3e396eda, 6 | BRF_GRA }, // 16 - - { "63s141.15g", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 17 Proms (not used) -}; - -STD_ROM_PICK(lwingsjp) -STD_ROM_FN(lwingsjp) - -struct BurnDriver BurnDrvLwingsjp = { - "lwingsj", "lwings", NULL, NULL, "1986", - "Ares no Tsubasa (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, lwingsjpRomInfo, lwingsjpRomName, NULL, NULL, DrvInputInfo, LwingsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Legendary Wings (bootleg) - -static struct BurnRomInfo lwingsbRomDesc[] = { - { "ic17.bin", 0x8000, 0xfe8a8823, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "ic18.bin", 0x8000, 0x2a00cde8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic19.bin", 0x8000, 0xec5cc201, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ic37.bin", 0x8000, 0xa20337a2, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "ic60.bin", 0x4000, 0x091d923c, 4 | BRF_GRA }, // 4 Characters - - { "ic50.bin", 0x8000, 0x5436392c, 5 | BRF_GRA }, // 5 Background Layer 1 Tiles - { "ic49.bin", 0x8000, 0xffdbdd69, 5 | BRF_GRA }, // 6 - { "ic26.bin", 0x8000, 0xfdd1908a, 5 | BRF_GRA }, // 7 - { "ic25.bin", 0x8000, 0x5c73d406, 5 | BRF_GRA }, // 8 - { "ic2.bin", 0x8000, 0x32e17b3c, 5 | BRF_GRA }, // 9 - { "ic1.bin", 0x8000, 0x52e533c1, 5 | BRF_GRA }, // 10 - { "ic63.bin", 0x8000, 0x99e134ba, 5 | BRF_GRA }, // 11 - { "ic62.bin", 0x8000, 0xc8f28777, 5 | BRF_GRA }, // 12 - - { "ic99.bin", 0x8000, 0x163946da, 6 | BRF_GRA }, // 13 Sprites - { "ic98.bin", 0x8000, 0x7cc90a1d, 6 | BRF_GRA }, // 14 - { "ic87.bin", 0x8000, 0xbca275ac, 6 | BRF_GRA }, // 15 - { "ic86.bin", 0x8000, 0x3e396eda, 6 | BRF_GRA }, // 16 - - { "63s141.15g", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 17 Proms (not used) -}; - -STD_ROM_PICK(lwingsb) -STD_ROM_FN(lwingsb) - -struct BurnDriver BurnDrvLwingsb = { - "lwingsb", "lwings", NULL, NULL, "1986", - "Legendary Wings (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, lwingsbRomInfo, lwingsbRomName, NULL, NULL, DrvInputInfo, LwingsbDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Trojan (US set 1) - -static struct BurnRomInfo trojanRomDesc[] = { - { "t4.10n", 0x8000, 0xc1bbeb4e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "t6.13n", 0x8000, 0xd49592ef, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tb05.12n", 0x8000, 0x9273b264, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "tb02.15h", 0x8000, 0x21154797, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "tb01.6d", 0x4000, 0x1c0f91b2, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "tb03.8k", 0x4000, 0x581a2b4c, 4 | BRF_GRA }, // 5 Characters - - { "tb13.6b", 0x8000, 0x285a052b, 5 | BRF_GRA }, // 6 Background Layer 1 Tiles - { "tb09.6a", 0x8000, 0xaeb693f7, 5 | BRF_GRA }, // 7 - { "tb12.4b", 0x8000, 0xdfb0fe5c, 5 | BRF_GRA }, // 8 - { "tb08.4a", 0x8000, 0xd3a4c9d1, 5 | BRF_GRA }, // 9 - { "tb11.3b", 0x8000, 0x00f0f4fd, 5 | BRF_GRA }, // 10 - { "tb07.3a", 0x8000, 0xdff2ee02, 5 | BRF_GRA }, // 11 - { "tb14.8b", 0x8000, 0x14bfac18, 5 | BRF_GRA }, // 12 - { "tb10.8a", 0x8000, 0x71ba8a6d, 5 | BRF_GRA }, // 13 - - { "tb18.7l", 0x8000, 0x862c4713, 6 | BRF_GRA }, // 14 Sprites - { "tb16.3l", 0x8000, 0xd86f8cbd, 6 | BRF_GRA }, // 15 - { "tb17.5l", 0x8000, 0x12a73b3f, 6 | BRF_GRA }, // 16 - { "tb15.2l", 0x8000, 0xbb1a2769, 6 | BRF_GRA }, // 17 - { "tb22.7n", 0x8000, 0x39daafd4, 6 | BRF_GRA }, // 18 - { "tb20.3n", 0x8000, 0x94615d2a, 6 | BRF_GRA }, // 19 - { "tb21.5n", 0x8000, 0x66c642bd, 6 | BRF_GRA }, // 20 - { "tb19.2n", 0x8000, 0x81d5ab36, 6 | BRF_GRA }, // 21 - - { "tb25.15n", 0x8000, 0x6e38c6fa, 7 | BRF_GRA }, // 22 Background Layer 2 Tiles - { "tb24.13n", 0x8000, 0x14fc6cf2, 7 | BRF_GRA }, // 23 - - { "tb23.9n", 0x8000, 0xeda13c0e, 8 | BRF_GRA }, // 24 Background Layer 2 Tile Map - - { "tbp24s10.7j", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 25 Proms (not used) - { "mb7114e.1e", 0x0100, 0x5052fa9d, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(trojan) -STD_ROM_FN(trojan) - -struct BurnDriver BurnDrvTrojan = { - "trojan", NULL, NULL, NULL, "1986", - "Trojan (US set 1)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, trojanRomInfo, trojanRomName, NULL, NULL, DrvInputInfo, TrojanlsDIPInfo, - TrojanInit, TrojanExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Trojan (US set 2) - -static struct BurnRomInfo trojanaRomDesc[] = { - { "tb4.10n", 0x8000, 0x0113a551, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "tb6.13n", 0x8000, 0xaa127a5b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tb05.12n", 0x8000, 0x9273b264, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "tb02.15h", 0x8000, 0x21154797, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "tb01.6d", 0x4000, 0x1c0f91b2, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "tb03.8k", 0x4000, 0x581a2b4c, 4 | BRF_GRA }, // 5 Characters - - { "tb13.6b", 0x8000, 0x285a052b, 5 | BRF_GRA }, // 6 Background Layer 1 Tiles - { "tb09.6a", 0x8000, 0xaeb693f7, 5 | BRF_GRA }, // 7 - { "tb12.4b", 0x8000, 0xdfb0fe5c, 5 | BRF_GRA }, // 8 - { "tb08.4a", 0x8000, 0xd3a4c9d1, 5 | BRF_GRA }, // 9 - { "tb11.3b", 0x8000, 0x00f0f4fd, 5 | BRF_GRA }, // 10 - { "tb07.3a", 0x8000, 0xdff2ee02, 5 | BRF_GRA }, // 11 - { "tb14.8b", 0x8000, 0x14bfac18, 5 | BRF_GRA }, // 12 - { "tb10.8a", 0x8000, 0x71ba8a6d, 5 | BRF_GRA }, // 13 - - { "tb18.7l", 0x8000, 0x862c4713, 6 | BRF_GRA }, // 14 Sprites - { "tb16.3l", 0x8000, 0xd86f8cbd, 6 | BRF_GRA }, // 15 - { "tb17.5l", 0x8000, 0x12a73b3f, 6 | BRF_GRA }, // 16 - { "tb15.2l", 0x8000, 0xbb1a2769, 6 | BRF_GRA }, // 17 - { "tb22.7n", 0x8000, 0x39daafd4, 6 | BRF_GRA }, // 18 - { "tb20.3n", 0x8000, 0x94615d2a, 6 | BRF_GRA }, // 19 - { "tb21.5n", 0x8000, 0x66c642bd, 6 | BRF_GRA }, // 20 - { "tb19.2n", 0x8000, 0x81d5ab36, 6 | BRF_GRA }, // 21 - - { "tb25.15n", 0x8000, 0x6e38c6fa, 7 | BRF_GRA }, // 22 Background Layer 2 Tiles - { "tb24.13n", 0x8000, 0x14fc6cf2, 7 | BRF_GRA }, // 23 - - { "tb23.9n", 0x8000, 0xeda13c0e, 8 | BRF_GRA }, // 24 Background Layer 2 Tile Map - - { "tbp24s10.7j", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 25 Proms (not used) - { "mb7114e.1e", 0x0100, 0x5052fa9d, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(trojana) -STD_ROM_FN(trojana) - -struct BurnDriver BurnDrvTrojana = { - "trojana", "trojan", NULL, NULL, "1986", - "Trojan (US set 2)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, trojanaRomInfo, trojanaRomName, NULL, NULL, DrvInputInfo, TrojanlsDIPInfo, - TrojanInit, TrojanExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Trojan (Romstar) - -static struct BurnRomInfo trojanrRomDesc[] = { - { "tb04.10n", 0x8000, 0x92670f27, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "tb06.13n", 0x8000, 0xa4951173, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tb05.12n", 0x8000, 0x9273b264, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "tb02.15h", 0x8000, 0x21154797, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "tb01.6d", 0x4000, 0x1c0f91b2, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "tb03.8k", 0x4000, 0x581a2b4c, 4 | BRF_GRA }, // 5 Characters - - { "tb13.6b", 0x8000, 0x285a052b, 5 | BRF_GRA }, // 6 Background Layer 1 Tiles - { "tb09.6a", 0x8000, 0xaeb693f7, 5 | BRF_GRA }, // 7 - { "tb12.4b", 0x8000, 0xdfb0fe5c, 5 | BRF_GRA }, // 8 - { "tb08.4a", 0x8000, 0xd3a4c9d1, 5 | BRF_GRA }, // 9 - { "tb11.3b", 0x8000, 0x00f0f4fd, 5 | BRF_GRA }, // 10 - { "tb07.3a", 0x8000, 0xdff2ee02, 5 | BRF_GRA }, // 11 - { "tb14.8b", 0x8000, 0x14bfac18, 5 | BRF_GRA }, // 12 - { "tb10.8a", 0x8000, 0x71ba8a6d, 5 | BRF_GRA }, // 13 - - { "tb18.7l", 0x8000, 0x862c4713, 6 | BRF_GRA }, // 14 Sprites - { "tb16.3l", 0x8000, 0xd86f8cbd, 6 | BRF_GRA }, // 15 - { "tb17.5l", 0x8000, 0x12a73b3f, 6 | BRF_GRA }, // 16 - { "tb15.2l", 0x8000, 0xbb1a2769, 6 | BRF_GRA }, // 17 - { "tb22.7n", 0x8000, 0x39daafd4, 6 | BRF_GRA }, // 18 - { "tb20.3n", 0x8000, 0x94615d2a, 6 | BRF_GRA }, // 19 - { "tb21.5n", 0x8000, 0x66c642bd, 6 | BRF_GRA }, // 20 - { "tb19.2n", 0x8000, 0x81d5ab36, 6 | BRF_GRA }, // 21 - - { "tb25.15n", 0x8000, 0x6e38c6fa, 7 | BRF_GRA }, // 22 Background Layer 2 Tiles - { "tb24.13n", 0x8000, 0x14fc6cf2, 7 | BRF_GRA }, // 23 - - { "tb23.9n", 0x8000, 0xeda13c0e, 8 | BRF_GRA }, // 24 Background Layer 2 Tile Map - - { "tbp24s10.7j", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 25 Proms (not used) - { "mb7114e.1e", 0x0100, 0x5052fa9d, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(trojanr) -STD_ROM_FN(trojanr) - -struct BurnDriver BurnDrvTrojanr = { - "trojanr", "trojan", NULL, NULL, "1986", - "Trojan (Romstar)\0", NULL, "Capcom (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, trojanrRomInfo, trojanrRomName, NULL, NULL, DrvInputInfo, TrojanDIPInfo, - TrojanInit, TrojanExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Trojan (bootleg) - -static struct BurnRomInfo trojanbRomDesc[] = { - { "4.11l", 0x8000, 0xaad03bc7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "6.11p", 0x8000, 0x8ad19c83, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5.11m", 0x8000, 0x9273b264, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "2.6q", 0x8000, 0x21154797, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "1.3f", 0x8000, 0x83c715b2, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "3.8h", 0x4000, 0x581a2b4c, 4 | BRF_GRA }, // 5 Characters - - { "13.3e", 0x8000, 0x285a052b, 5 | BRF_GRA }, // 6 Background Layer 1 Tiles - { "9.1e", 0x8000, 0xaeb693f7, 5 | BRF_GRA }, // 7 - { "12.3d", 0x8000, 0xdfb0fe5c, 5 | BRF_GRA }, // 8 - { "8.1d", 0x8000, 0xd3a4c9d1, 5 | BRF_GRA }, // 9 - { "11.3b", 0x8000, 0x00f0f4fd, 5 | BRF_GRA }, // 10 - { "7.1b", 0x8000, 0xdff2ee02, 5 | BRF_GRA }, // 11 - { "14.3g", 0x8000, 0x14bfac18, 5 | BRF_GRA }, // 12 - { "10.1g", 0x8000, 0x71ba8a6d, 5 | BRF_GRA }, // 13 - - { "18.10f", 0x8000, 0x862c4713, 6 | BRF_GRA }, // 14 Sprites - { "16.10c", 0x8000, 0xd86f8cbd, 6 | BRF_GRA }, // 15 - { "17.10e", 0x8000, 0x12a73b3f, 6 | BRF_GRA }, // 16 - { "15.10b", 0x8000, 0xbb1a2769, 6 | BRF_GRA }, // 17 - { "22.12f", 0x8000, 0x39daafd4, 6 | BRF_GRA }, // 18 - { "20.12c", 0x8000, 0x94615d2a, 6 | BRF_GRA }, // 19 - { "21.12e", 0x8000, 0x66c642bd, 6 | BRF_GRA }, // 20 - { "19.12b", 0x8000, 0x81d5ab36, 6 | BRF_GRA }, // 21 - - { "25.12q", 0x8000, 0x6e38c6fa, 7 | BRF_GRA }, // 22 Background Layer 2 Tiles - { "24.12o", 0x8000, 0x14fc6cf2, 7 | BRF_GRA }, // 23 - - { "23.12h", 0x8000, 0xeda13c0e, 8 | BRF_GRA }, // 24 Background Layer 2 Tile Map - - { "82s129.8g", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 25 Proms (not used) - { "82s129.4a", 0x0100, 0x5052fa9d, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(trojanb) -STD_ROM_FN(trojanb) - -struct BurnDriver BurnDrvTrojanb = { - "trojanb", "trojan", NULL, NULL, "1986", - "Trojan (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, trojanbRomInfo, trojanbRomName, NULL, NULL, DrvInputInfo, TrojanlsDIPInfo, - TrojanInit, TrojanExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Tatakai no Banka (Japan) - -static struct BurnRomInfo trojanjRomDesc[] = { - { "troj-04.10n", 0x8000, 0x0b5a7f49, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "troj-06.13n", 0x8000, 0xdee6ed92, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tb05.12n", 0x8000, 0x9273b264, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "tb02.15h", 0x8000, 0x21154797, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "tb01.6d", 0x4000, 0x1c0f91b2, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "tb03.8k", 0x4000, 0x581a2b4c, 4 | BRF_GRA }, // 5 Characters - - { "tb13.6b", 0x8000, 0x285a052b, 5 | BRF_GRA }, // 6 Background Layer 1 Tiles - { "tb09.6a", 0x8000, 0xaeb693f7, 5 | BRF_GRA }, // 7 - { "tb12.4b", 0x8000, 0xdfb0fe5c, 5 | BRF_GRA }, // 8 - { "tb08.4a", 0x8000, 0xd3a4c9d1, 5 | BRF_GRA }, // 9 - { "tb11.3b", 0x8000, 0x00f0f4fd, 5 | BRF_GRA }, // 10 - { "tb07.3a", 0x8000, 0xdff2ee02, 5 | BRF_GRA }, // 11 - { "tb14.8b", 0x8000, 0x14bfac18, 5 | BRF_GRA }, // 12 - { "tb10.8a", 0x8000, 0x71ba8a6d, 5 | BRF_GRA }, // 13 - - { "tb18.7l", 0x8000, 0x862c4713, 6 | BRF_GRA }, // 14 Sprites - { "tb16.3l", 0x8000, 0xd86f8cbd, 6 | BRF_GRA }, // 15 - { "tb17.5l", 0x8000, 0x12a73b3f, 6 | BRF_GRA }, // 16 - { "tb15.2l", 0x8000, 0xbb1a2769, 6 | BRF_GRA }, // 17 - { "tb22.7n", 0x8000, 0x39daafd4, 6 | BRF_GRA }, // 18 - { "tb20.3n", 0x8000, 0x94615d2a, 6 | BRF_GRA }, // 19 - { "tb21.5n", 0x8000, 0x66c642bd, 6 | BRF_GRA }, // 20 - { "tb19.2n", 0x8000, 0x81d5ab36, 6 | BRF_GRA }, // 21 - - { "tb25.15n", 0x8000, 0x6e38c6fa, 7 | BRF_GRA }, // 22 Background Layer 2 Tiles - { "tb24.13n", 0x8000, 0x14fc6cf2, 7 | BRF_GRA }, // 23 - - { "tb23.9n", 0x8000, 0xeda13c0e, 8 | BRF_GRA }, // 24 Background Layer 2 Tile Map - - { "tbp24s10.7j", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 25 Proms (not used) - { "mb7114e.1e", 0x0100, 0x5052fa9d, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(trojanj) -STD_ROM_FN(trojanj) - -struct BurnDriver BurnDrvTrojanj = { - "trojanj", "trojan", NULL, NULL, "1986", - "Tatakai no Banka (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, trojanjRomInfo, trojanjRomName, NULL, NULL, DrvInputInfo, TrojanDIPInfo, - TrojanInit, TrojanExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; - - -// Avengers (US set 1) - -static struct BurnRomInfo avengersRomDesc[] = { - { "04.10n", 0x8000, 0xa94aadcc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "06.13n", 0x8000, 0x39cd80bd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "05.12n", 0x8000, 0x06b1cec9, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "02.15h", 0x8000, 0x107a2e17, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "01.6d", 0x8000, 0xc1e5d258, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "03.8k", 0x8000, 0xefb5883e, 4 | BRF_GRA }, // 5 Characters - - { "13.6b", 0x8000, 0x9b5ff305, 5 | BRF_GRA }, // 6 Background Layer 1 Tiles - { "09.6a", 0x8000, 0x08323355, 5 | BRF_GRA }, // 7 - { "12.4b", 0x8000, 0x6d5261ba, 5 | BRF_GRA }, // 8 - { "08.4a", 0x8000, 0xa13d9f54, 5 | BRF_GRA }, // 9 - { "11.3b", 0x8000, 0xa2911d8b, 5 | BRF_GRA }, // 10 - { "07.3a", 0x8000, 0xcde78d32, 5 | BRF_GRA }, // 11 - { "14.8b", 0x8000, 0x44ac2671, 5 | BRF_GRA }, // 12 - { "10.8a", 0x8000, 0xb1a717cb, 5 | BRF_GRA }, // 13 - - { "18.7l", 0x8000, 0x3c876a17, 6 | BRF_GRA }, // 14 Sprites - { "16.3l", 0x8000, 0x4b1ff3ac, 6 | BRF_GRA }, // 15 - { "17.5l", 0x8000, 0x4eb543ef, 6 | BRF_GRA }, // 16 - { "15.2l", 0x8000, 0x8041de7f, 6 | BRF_GRA }, // 17 - { "22.7n", 0x8000, 0xbdaa8b22, 6 | BRF_GRA }, // 18 - { "20.3n", 0x8000, 0x566e3059, 6 | BRF_GRA }, // 19 - { "21.5n", 0x8000, 0x301059aa, 6 | BRF_GRA }, // 20 - { "19.2n", 0x8000, 0xa00485ec, 6 | BRF_GRA }, // 21 - - { "25.15n", 0x8000, 0x230d9e30, 7 | BRF_GRA }, // 22 Background Layer 2 Tiles - { "24.13n", 0x8000, 0xa6354024, 7 | BRF_GRA }, // 23 - - { "23.9n", 0x8000, 0xc0a93ef6, 8 | BRF_GRA }, // 24 Background Layer 2 Tile Map - - { "tbb_2bpr.7j", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 25 Proms (not used) - { "tbb_1bpr.1e", 0x0100, 0x5052fa9d, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(avengers) -STD_ROM_FN(avengers) - -static INT32 AvengersInit() -{ - avengers = 1; - - return TrojanInit(); -} - -struct BurnDriver BurnDrvAvengers = { - "avengers", NULL, NULL, NULL, "1987", - "Avengers (US set 1)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SCRFIGHT, 0, - NULL, avengersRomInfo, avengersRomName, NULL, NULL, DrvInputInfo, AvengersDIPInfo, - AvengersInit, TrojanExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Avengers (US set 2) - -static struct BurnRomInfo avenger2RomDesc[] = { - { "avg4.bin", 0x8000, 0x0fea7ac5, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "av_06a.13n", 0x8000, 0x491a712c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "av_05.12n", 0x8000, 0x9a214b42, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "02.15h", 0x8000, 0x107a2e17, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "01.6d", 0x8000, 0xc1e5d258, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "03.8k", 0x8000, 0xefb5883e, 4 | BRF_GRA }, // 5 Characters - - { "13.6b", 0x8000, 0x9b5ff305, 5 | BRF_GRA }, // 6 Background Layer 1 Tiles - { "09.6a", 0x8000, 0x08323355, 5 | BRF_GRA }, // 7 - { "12.4b", 0x8000, 0x6d5261ba, 5 | BRF_GRA }, // 8 - { "08.4a", 0x8000, 0xa13d9f54, 5 | BRF_GRA }, // 9 - { "11.3b", 0x8000, 0xa2911d8b, 5 | BRF_GRA }, // 10 - { "07.3a", 0x8000, 0xcde78d32, 5 | BRF_GRA }, // 11 - { "14.8b", 0x8000, 0x44ac2671, 5 | BRF_GRA }, // 12 - { "10.8a", 0x8000, 0xb1a717cb, 5 | BRF_GRA }, // 13 - - { "18.7l", 0x8000, 0x3c876a17, 6 | BRF_GRA }, // 14 Sprites - { "16.3l", 0x8000, 0x4b1ff3ac, 6 | BRF_GRA }, // 15 - { "17.5l", 0x8000, 0x4eb543ef, 6 | BRF_GRA }, // 16 - { "15.2l", 0x8000, 0x8041de7f, 6 | BRF_GRA }, // 17 - { "22.7n", 0x8000, 0xbdaa8b22, 6 | BRF_GRA }, // 18 - { "20.3n", 0x8000, 0x566e3059, 6 | BRF_GRA }, // 19 - { "21.5n", 0x8000, 0x301059aa, 6 | BRF_GRA }, // 20 - { "19.2n", 0x8000, 0xa00485ec, 6 | BRF_GRA }, // 21 - - { "25.15n", 0x8000, 0x230d9e30, 7 | BRF_GRA }, // 22 Background Layer 2 Tiles - { "24.13n", 0x8000, 0xa6354024, 7 | BRF_GRA }, // 23 - - { "23.9n", 0x8000, 0xc0a93ef6, 8 | BRF_GRA }, // 24 Background Layer 2 Tile Map - - { "tbb_2bpr.7j", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 25 Proms (not used) - { "tbb_1bpr.1e", 0x0100, 0x5052fa9d, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(avenger2) -STD_ROM_FN(avenger2) - -struct BurnDriver BurnDrvAvenger2 = { - "avengers2", "avengers", NULL, NULL, "1987", - "Avengers (US set 2)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SCRFIGHT, 0, - NULL, avenger2RomInfo, avenger2RomName, NULL, NULL, DrvInputInfo, AvengersDIPInfo, - AvengersInit, TrojanExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Hissatsu Buraiken (Japan) - -static struct BurnRomInfo buraikenRomDesc[] = { - { "av_04a.10n", 0x8000, 0x361fc614, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "av_06a.13n", 0x8000, 0x491a712c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "av_05.12n", 0x8000, 0x9a214b42, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "02.15h", 0x8000, 0x107a2e17, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "01.6d", 0x8000, 0xc1e5d258, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "03.8k", 0x8000, 0xefb5883e, 4 | BRF_GRA }, // 5 Characters - - { "13.6b", 0x8000, 0x9b5ff305, 5 | BRF_GRA }, // 6 Background Layer 1 Tiles - { "09.6a", 0x8000, 0x08323355, 5 | BRF_GRA }, // 7 - { "12.4b", 0x8000, 0x6d5261ba, 5 | BRF_GRA }, // 8 - { "08.4a", 0x8000, 0xa13d9f54, 5 | BRF_GRA }, // 9 - { "11.3b", 0x8000, 0xa2911d8b, 5 | BRF_GRA }, // 10 - { "07.3a", 0x8000, 0xcde78d32, 5 | BRF_GRA }, // 11 - { "14.8b", 0x8000, 0x44ac2671, 5 | BRF_GRA }, // 12 - { "10.8a", 0x8000, 0xb1a717cb, 5 | BRF_GRA }, // 13 - - { "18.7l", 0x8000, 0x3c876a17, 6 | BRF_GRA }, // 14 Sprites - { "16.3l", 0x8000, 0x4b1ff3ac, 6 | BRF_GRA }, // 15 - { "17.5l", 0x8000, 0x4eb543ef, 6 | BRF_GRA }, // 16 - { "15.2l", 0x8000, 0x8041de7f, 6 | BRF_GRA }, // 17 - { "22.7n", 0x8000, 0xbdaa8b22, 6 | BRF_GRA }, // 18 - { "20.3n", 0x8000, 0x566e3059, 6 | BRF_GRA }, // 19 - { "21.5n", 0x8000, 0x301059aa, 6 | BRF_GRA }, // 20 - { "19.2n", 0x8000, 0xa00485ec, 6 | BRF_GRA }, // 21 - - { "av_25.15n", 0x8000, 0x88a505a7, 7 | BRF_GRA }, // 22 Background Layer 2 Tiles - { "av_24.13n", 0x8000, 0x1f4463c8, 7 | BRF_GRA }, // 23 - - { "23.9n", 0x8000, 0xc0a93ef6, 8 | BRF_GRA }, // 24 Background Layer 2 Tile Map - - { "tbb_2bpr.7j", 0x0100, 0xd96bcc98, 0 | BRF_OPT }, // 25 Proms (not used) - { "tbb_1bpr.1e", 0x0100, 0x5052fa9d, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(buraiken) -STD_ROM_FN(buraiken) - -struct BurnDriver BurnDrvBuraiken = { - "buraiken", "avengers", NULL, NULL, "1987", - "Hissatsu Buraiken (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SCRFIGHT, 0, - NULL, buraikenRomInfo, buraikenRomName, NULL, NULL, DrvInputInfo, AvengersDIPInfo, - AvengersInit, TrojanExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 256, 3, 4 -}; - - -// Fire Ball (FM Work) - -static struct BurnRomInfo fballRomDesc[] = { - { "D4.bin", 0x20000, 0x6122b3dc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "A05.bin", 0x10000, 0x474dd19e, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "J03.bin", 0x10000, 0xbe11627f, 3 | BRF_GRA }, // 2 Characters - - { "B15.bin", 0x20000, 0x2169ad3e, 4 | BRF_GRA }, // 3 Background Layer 1 Tiles - { "C15.bin", 0x20000, 0x0f77b03e, 4 | BRF_GRA }, // 4 - { "E15.bin", 0x20000, 0x89a761d2, 4 | BRF_GRA }, // 5 - { "F15.bin", 0x20000, 0x34b3f9a2, 4 | BRF_GRA }, // 6 - - { "J15.bin", 0x20000, 0xed7be8e7, 5 | BRF_GRA }, // 7 Sprites - { "H15.bin", 0x20000, 0x6ffb5433, 5 | BRF_GRA }, // 8 - - { "A03.bin", 0x40000, 0x22b0d089, 6 | BRF_SND }, // 9 msm6295 Samples - { "A02.bin", 0x40000, 0x951d6579, 6 | BRF_SND }, // 10 - { "A01.bin", 0x40000, 0x020b5261, 6 | BRF_SND }, // 11 -}; - -STD_ROM_PICK(fball) -STD_ROM_FN(fball) - -struct BurnDriver BurnDrvFball = { - "fball", NULL, NULL, NULL, "1992", - "Fire Ball (FM Work)\0", "Black Bar on the left side is normal.", "FM Work", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARWARE_CAPCOM_MISC, GBF_MISC, 0, - NULL, fballRomInfo, fballRomName, NULL, NULL, FballInputInfo, FballDIPInfo, - FballInit, DrvExit, FballFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_mainsnk.cpp b/jan/src/burn/drv/pre90s/d_mainsnk.cpp deleted file mode 100644 index c0d0c82a2..000000000 --- a/jan/src/burn/drv/pre90s/d_mainsnk.cpp +++ /dev/null @@ -1,830 +0,0 @@ -// FB Alpha SNK Main event driver module -// Based on MAME driver by David Haywood and Tomasz Slanina - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[4]; -static UINT8 DrvReset; - -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 sound_cpu_busy; -static INT32 palette_offset; -static INT32 bg_tile_offset; -static INT32 sprromsize; - -static INT32 game_select = 0; // 0 mainsnk, 1 = canvas - -static struct BurnInputInfo MainsnkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Left Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Left Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Left Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Right Up", BIT_DIGITAL, DrvJoy2 + 4, "p3 up" }, - {"P1 Right Down", BIT_DIGITAL, DrvJoy2 + 5, "p3 down" }, - {"P1 Right Left", BIT_DIGITAL, DrvJoy2 + 6, "p3 left" }, - {"P1 Right Right", BIT_DIGITAL, DrvJoy2 + 7, "p3 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy4 + 2, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy4 + 3, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Left Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Left Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Left Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Right Up", BIT_DIGITAL, DrvJoy3 + 4, "p4 up" }, - {"P2 Right Down", BIT_DIGITAL, DrvJoy3 + 5, "p4 down" }, - {"P2 Right Left", BIT_DIGITAL, DrvJoy3 + 6, "p4 left" }, - {"P2 Right Right", BIT_DIGITAL, DrvJoy3 + 7, "p4 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy4 + 7, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Mainsnk) - - -static struct BurnDIPInfo MainsnkDIPList[]= -{ - {0x1e, 0xff, 0xff, 0xff, NULL }, - {0x1f, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x1e, 0x01, 0x01, 0x01, "Off" }, - {0x1e, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x1e, 0x01, 0x02, 0x02, "Off" }, - {0x1e, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x1e, 0x01, 0x04, 0x04, "Off" }, - {0x1e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x1e, 0x01, 0x08, 0x08, "Off" }, - {0x1e, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x1e, 0x01, 0x10, 0x10, "Off" }, - {0x1e, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x1e, 0x01, 0x20, 0x20, "Off" }, - {0x1e, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x1e, 0x01, 0x40, 0x40, "Off" }, - {0x1e, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x1e, 0x01, 0x80, 0x80, "Off" }, - {0x1e, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 6, "Coinage" }, - {0x1f, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x1f, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x1f, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x1f, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x1f, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x1f, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x1f, 0x01, 0x08, 0x08, "Easy" }, - {0x1f, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Round Time" }, - {0x1f, 0x01, 0x10, 0x10, "Normal" }, - {0x1f, 0x01, 0x10, 0x00, "Short" }, - - {0 , 0xfe, 0 , 4, "Game mode" }, - {0x1f, 0x01, 0x60, 0x60, "Demo Sounds Off" }, - {0x1f, 0x01, 0x60, 0x20, "Demo Sounds On" }, - {0x1f, 0x01, 0x60, 0x00, "Freeze" }, - {0x1f, 0x01, 0x60, 0x40, "Endless Game (Cheat)" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x1f, 0x01, 0x80, 0x80, "1 Credit" }, - {0x1f, 0x01, 0x80, 0x00, "2 Credits" }, -}; - -STDDIPINFO(Mainsnk) - -static struct BurnInputInfo CanvasInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Canvas) - - -static struct BurnDIPInfo CanvasDIPList[]= -{ - {0x10, 0xff, 0xff, 0xfd, NULL }, - {0x11, 0xff, 0xff, 0x57, NULL }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x01, 0x01, "Off" }, - {0x10, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x02, 0x00, "Upright" }, - {0x10, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x04, 0x04, "3" }, - {0x10, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 7, "Coinage" }, - {0x10, 0x01, 0x38, 0x10, "5 Coins 1 Credits" }, - {0x10, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x40, 0x40, "Off" }, - {0x10, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Game mode" }, - {0x11, 0x01, 0x18, 0x18, "Demo Sounds Off" }, - {0x11, 0x01, 0x18, 0x10, "Demo Sounds On" }, - {0x11, 0x01, 0x18, 0x00, "Freeze" }, - {0x11, 0x01, 0x18, 0x08, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Must Be On" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Canvas) - - - -static void __fastcall main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc600: - { - flipscreen = ~data & 0x80; - palette_offset = ((data & 0x07) << 4); - if (game_select) { - bg_tile_offset = /*((data & 0x40) >> 6) | ((data & 0x30) >> 3);*/ ((data & 0x40) << 2) | ((data & 0x30) << 5); - } else { - bg_tile_offset = (data & 0x30) << 4; - } - } - return; - - case 0xc700: - { - sound_cpu_busy = 1; - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - } - return; - } -} - -static UINT8 __fastcall main_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return ((DrvInputs[0] ^ 0x07) & ~0x20) | (sound_cpu_busy << 5); - - case 0xc100: - case 0xc200: - case 0xc300: - return DrvInputs[(address >> 8) & 3]; - - case 0xc400: - case 0xc500: - return DrvDips[(address >> 8) & 1]; - } - - return 0; -} - -static void __fastcall sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - case 0xe001: - case 0xe008: - case 0xe009: - AY8910Write((address >> 3) & 1, address & 1, data); - return; - } -} - -static UINT8 __fastcall sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return soundlatch; - - case 0xc000: - sound_cpu_busy = 0; - return 0xff; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - soundlatch = 0; - flipscreen = 0; - sound_cpu_busy = 0; - palette_offset = 0; - bg_tile_offset = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x00c000; - DrvZ80ROM1 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000c00; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM1 = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x001000; - DrvFgRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { STEP4(0,1) }; - INT32 XOffs0[8] = { 4, 0, 12, 8, 20, 16, 28, 24 }; - INT32 YOffs0[8] = { STEP8(0,32) }; - INT32 Plane1[16] = { RGN_FRAC(sprromsize, 2,3),RGN_FRAC(sprromsize, 1,3),RGN_FRAC(sprromsize, 0,3) }; - INT32 XOffs1[16] = { 7,6,5,4,3,2,1,0, 15,14,13,12,11,10,9,8 }; - INT32 YOffs1[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x12000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x10000); - - GfxDecode(0x0800, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x12000); - - GfxDecode(0x0300, 3, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - memset (DrvGfxROM1 + 0x30000, 0x7, 0x10000); // fill extra with blank tiles - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - game_select = select; - - if (select == 0) // mainsnk - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x0a000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x06000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0e000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 19, 1)) return 1; - sprromsize = 0x12000; - if (BurnLoadRom(DrvColPROM + 0x00000, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 21, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 22, 1)) return 1; - } - else // canvas - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x0a000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 7, 1)) return 1; - - memset (DrvGfxROM0, 0xff, 0x4000); - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 13, 1)) return 1; - /*if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - memcpy (DrvGfxROM1 + 0x2000, DrvGfxROM1 + 0x0000, 0x2000); - memcpy (DrvGfxROM1 + 0x4000, DrvGfxROM1 + 0x0000, 0x2000); - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 12, 1)) return 1; - memcpy (DrvGfxROM1 + 0x8000, DrvGfxROM1 + 0x4000, 0x2000); - memcpy (DrvGfxROM1 + 0xa000, DrvGfxROM1 + 0x4000, 0x2000); - if (BurnLoadRom(DrvGfxROM1 + 0x0c000, 13, 1)) return 1; - memcpy (DrvGfxROM1 + 0xe000, DrvGfxROM1 + 0xc000, 0x2000); - memcpy (DrvGfxROM1 + 0x10000, DrvGfxROM1 + 0xc000, 0x2000); */ - sprromsize = 0x6000; - - if (BurnLoadRom(DrvColPROM + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 16, 1)) return 1; - } - - DrvGfxDecode(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgRAM, 0xd800, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvFgRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(main_write); - ZetSetReadHandler(main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(sound_write); - ZetSetReadHandler(sound_read); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x400; i++) - { - INT32 bit0 = (DrvColPROM[i + 0x800] >> 3) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x800] >> 2) & 0x01; - bit1 = (DrvColPROM[i + 0x400] >> 2) & 0x01; - bit2 = (DrvColPROM[i + 0x400] >> 3) & 0x01; - bit3 = (DrvColPROM[i] >> 0) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x800] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x800] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x400] >> 0) & 0x01; - bit3 = (DrvColPROM[i + 0x400] >> 1) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_layer_tx() -{ - for (INT32 offs = 0; offs < 36 * 28; offs++) - { - INT32 col = offs % 36; - INT32 row = offs / 36; - - INT32 sx = (col * 8); - INT32 sy = (row * 8); - - INT32 ofst = (col - 2); - - if (ofst & 0x20) { - ofst = 0x400 + row + ((ofst & 0x1f) << 5); - } else { - ofst = row + (ofst << 5); - } - - INT32 code = DrvFgRAM[ofst]; - - if (ofst & 0x400) { // correct?? - Render8x8Tile_Clip(pTransDraw, code, sx, sy, 0, 4, palette_offset+0x100, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 4, 0xf, palette_offset+0x100, DrvGfxROM0); - } - } -} - -static void draw_layer_bg() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs & 0x1f) * 8; - INT32 sx = (offs / 0x20) * 8; - sx += 16; - - INT32 code = DrvBgRAM[offs] | bg_tile_offset; - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, 0, 4, palette_offset+0x100, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 25*4; offs+=4) - { - INT32 attr = DrvSprRAM[offs+3]; - INT32 code = DrvSprRAM[offs+1]; - code |= attr << 4 & 0x300; - INT32 sy = DrvSprRAM[offs+0]; - INT32 sx = 288-16-DrvSprRAM[offs+2]; - INT32 color = attr & 0x0f; - INT32 flipx = 0; - INT32 flipy = 0; - - if (sy > 240) sy -= 256; - - if (flipscreen) - { - sx = 288-16 - sx; - sy = 224-16 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 7, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 7, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 7, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 7, 0, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer_bg(); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 2) draw_layer_tx(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs,0xff,4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nInterleave = 16; - INT32 nCyclesTotal[2] = { 3360000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == 15) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - if (i == 3 || i == 7 || i == 13 || i == 15) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(sound_cpu_busy); - SCAN_VAR(palette_offset); - SCAN_VAR(bg_tile_offset); - } - - return 0; -} - -INT32 DrvInitmainsnk() -{ - return DrvInit(0); -} - -INT32 DrvInitcanvas() -{ - return DrvInit(1); -} - -// Main Event (1984) - -static struct BurnRomInfo mainsnkRomDesc[] = { - { "snk.p01", 0x2000, 0x00db1ca2, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "snk.p02", 0x2000, 0xdf5c86b5, 1 | BRF_ESS | BRF_PRG }, // 1 - { "snk.p03", 0x2000, 0x5c2b7bca, 1 | BRF_ESS | BRF_PRG }, // 2 - { "snk.p04", 0x2000, 0x68b4b2a1, 1 | BRF_ESS | BRF_PRG }, // 3 - { "snk.p05", 0x2000, 0x580a29b4, 1 | BRF_ESS | BRF_PRG }, // 4 - { "snk.p06", 0x2000, 0x5f8a60a2, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "snk.p07", 0x4000, 0x4208391e, 2 | BRF_ESS | BRF_PRG }, // 6 audiocpu - - { "snk.p12", 0x2000, 0xecf87eb7, 3 | BRF_GRA }, // 7 gfx1 - { "snk.p11", 0x2000, 0x3f6bc5ba, 3 | BRF_GRA }, // 8 - { "snk.p10", 0x2000, 0xb5147a96, 3 | BRF_GRA }, // 9 - { "snk.p09", 0x2000, 0x0ebcf837, 3 | BRF_GRA }, // 10 - - { "snk.p13", 0x2000, 0x2eb624a4, 4 | BRF_GRA }, // 11 gfx2 - { "snk.p16", 0x2000, 0xdc502869, 4 | BRF_GRA }, // 12 - { "snk.p19", 0x2000, 0x58d566a1, 4 | BRF_GRA }, // 13 - { "snk.p14", 0x2000, 0xbb927d82, 4 | BRF_GRA }, // 14 - { "snk.p17", 0x2000, 0x66f60c32, 4 | BRF_GRA }, // 15 - { "snk.p20", 0x2000, 0xd12c6333, 4 | BRF_GRA }, // 16 - { "snk.p15", 0x2000, 0xd242486d, 4 | BRF_GRA }, // 17 - { "snk.p18", 0x2000, 0x838b12a3, 4 | BRF_GRA }, // 18 - { "snk.p21", 0x2000, 0x8961a51e, 4 | BRF_GRA }, // 19 - - { "main3.bin", 0x0800, 0x78b29dde, 5 | BRF_GRA }, // 20 proms - { "main2.bin", 0x0800, 0x7c314c93, 5 | BRF_GRA }, // 21 - { "main1.bin", 0x0800, 0xdeb895c4, 5 | BRF_GRA }, // 22 -}; - -STD_ROM_PICK(mainsnk) -STD_ROM_FN(mainsnk) - -struct BurnDriver BurnDrvMainsnk = { - "mainsnk", NULL, NULL, NULL, "1984", - "Main Event (1984)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, mainsnkRomInfo, mainsnkRomName, NULL, NULL, MainsnkInputInfo, MainsnkDIPInfo, - DrvInitmainsnk, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Canvas Croquis - -static struct BurnRomInfo canvasRomDesc[] = { - { "cc_p1.a2", 0x2000, 0xfa7109e1, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "cc_p2.a3", 0x2000, 0x8b8beb34, 1 | BRF_ESS | BRF_PRG }, // 1 - { "cc_p3.a4", 0x2000, 0xea342f87, 1 | BRF_ESS | BRF_PRG }, // 2 - { "cc_p4.a5", 0x2000, 0x9cf35d98, 1 | BRF_ESS | BRF_PRG }, // 3 - { "cc_p5.a7", 0x2000, 0xc5ef1eda, 1 | BRF_ESS | BRF_PRG }, // 4 - { "cc_p6.a8", 0x2000, 0x7b1dd7fc, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "cc_p7.h2", 0x4000, 0x029b5ea0, 2 | BRF_ESS | BRF_PRG }, // 6 audiocpu - { "cc_p8.f2", 0x2000, 0x0f0368ce, 2 | BRF_ESS | BRF_PRG }, // 7 - - { "cc_p11.c2", 0x4000, 0x4c8c2156, 3 | BRF_GRA }, // 8 gfx1 - { "cc_p10.b2", 0x4000, 0x3c0a4eeb, 3 | BRF_GRA }, // 9 - { "cc_p9.a2", 0x4000, 0xb58c5f24, 3 | BRF_GRA }, // 10 - - { "cc_p12.j8", 0x2000, 0x9003a979, 4 | BRF_GRA }, // 11 gfx2 - { "cc_p13.j5", 0x2000, 0xa52cd549, 4 | BRF_GRA }, // 12 - { "cc_p14.j2", 0x2000, 0xedc6a1e8, 4 | BRF_GRA }, // 13 - - { "cc_bprom3.j8", 0x0400, 0x21f72498, 5 | BRF_GRA }, // 14 proms - { "cc_bprom2.j9", 0x0400, 0x19efe7df, 5 | BRF_GRA }, // 15 - { "cc_bprom1.j10", 0x0400, 0xfbbbf911, 5 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(canvas) -STD_ROM_FN(canvas) - -struct BurnDriver BurnDrvCanvas = { - "canvas", NULL, NULL, NULL, "1985", - "Canvas Croquis\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, canvasRomInfo, canvasRomName, NULL, NULL, CanvasInputInfo, CanvasDIPInfo, - DrvInitcanvas, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - diff --git a/jan/src/burn/drv/pre90s/d_mappy.cpp b/jan/src/burn/drv/pre90s/d_mappy.cpp deleted file mode 100644 index 640c6bc95..000000000 --- a/jan/src/burn/drv/pre90s/d_mappy.cpp +++ /dev/null @@ -1,2668 +0,0 @@ -// FB Alpha Mappy driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "namco_snd.h" -#include "namcoio.h" -#include "bitswap.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvM6809ROM2; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvSndPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvM6809RAM2; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 main_irq_mask; -static UINT8 sub_irq_mask; -static UINT8 sub2_irq_mask; -static UINT8 flipscreen; -static UINT8 sub_cpu_in_reset; -static UINT8 sub2_cpu_in_reset; -static UINT8 scroll; -static UINT8 out_mux; - -static INT32 watchdog; // not hooked up - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[7]; -static UINT8 DrvReset; - -static INT32 fourwaymode = 0; - -static struct BurnInputInfo MappyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Mappy) - -static struct BurnInputInfo Digdug2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy5 + 0, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy5 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Digdug2) - -static struct BurnInputInfo TodruagaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Todruaga) - -static struct BurnInputInfo MotosInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy5 + 0, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy5 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Motos) - -static struct BurnInputInfo SuperpacInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Superpac) - -static struct BurnInputInfo PacnpalInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Pacnpal) - -static struct BurnInputInfo GrobdaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy5 + 0, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy5 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Grobda) - -static struct BurnInputInfo PhozonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Phozon) - -static struct BurnDIPInfo MappyDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x0f, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0c, 0x01, 0x04, 0x04, "Upright" }, - {0x0c, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service" }, - {0x0c, 0x01, 0x08, 0x08, "Off" }, - {0x0c, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x0d, 0x01, 0x07, 0x07, "Rank A" }, - {0x0d, 0x01, 0x07, 0x06, "Rank B" }, - {0x0d, 0x01, 0x07, 0x05, "Rank C" }, - {0x0d, 0x01, 0x07, 0x04, "Rank D" }, - {0x0d, 0x01, 0x07, 0x03, "Rank E" }, - {0x0d, 0x01, 0x07, 0x02, "Rank F" }, - {0x0d, 0x01, 0x07, 0x01, "Rank G" }, - {0x0d, 0x01, 0x07, 0x00, "Rank H" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0d, 0x01, 0x18, 0x00, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x18, 0x10, "1 Coin 5 Credits" }, - {0x0d, 0x01, 0x18, 0x08, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0d, 0x01, 0x20, 0x00, "Off" }, - {0x0d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Rack Test (Cheat)" }, - {0x0d, 0x01, 0x40, 0x40, "Off" }, - {0x0d, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x0d, 0x01, 0x80, 0x80, "Off" }, - {0x0d, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0e, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x00, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x07, 0x02, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x0e, 0x01, 0x38, 0x18, "20k Only" }, - {0x0e, 0x01, 0x38, 0x30, "20k & 60k Only" }, - {0x0e, 0x01, 0x38, 0x38, "20k & 70k Only" }, - {0x0e, 0x01, 0x38, 0x10, "20k, 70k & Every 70k" }, - {0x0e, 0x01, 0x38, 0x28, "20k & 80k Only" }, - {0x0e, 0x01, 0x38, 0x08, "20k, 80k & Every 80k" }, - {0x0e, 0x01, 0x38, 0x20, "30k & 100k Only" }, -#if 0 - {0x0e, 0x01, 0x38, 0x20, "30k Only" }, - {0x0e, 0x01, 0x38, 0x38, "30k & 80k Only" }, - {0x0e, 0x01, 0x38, 0x30, "30k & 100k Only" }, - {0x0e, 0x01, 0x38, 0x10, "30k, 100k & Every 100k" }, - {0x0e, 0x01, 0x38, 0x28, "30k & 120k Only" }, - {0x0e, 0x01, 0x38, 0x18, "40k Only" }, - {0x0e, 0x01, 0x38, 0x08, "40k, 120k & Every 120k" }, -#endif - {0x0e, 0x01, 0x38, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0e, 0x01, 0xc0, 0x40, "1" }, - {0x0e, 0x01, 0xc0, 0x00, "2" }, - {0x0e, 0x01, 0xc0, 0xc0, "3" }, - {0x0e, 0x01, 0xc0, 0x80, "5" }, -}; - -STDDIPINFO(Mappy) - -static struct BurnDIPInfo Digdug2DIPList[]= -{ - {0x12, 0xff, 0xff, 0x0f, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x04, 0x04, "Upright" }, - {0x12, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x02, 0x02, "3" }, - {0x13, 0x01, 0x02, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x13, 0x01, 0x0c, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x30, "30k 80k and ..." }, - {0x13, 0x01, 0x30, 0x20, "30k 100k and ..." }, - {0x13, 0x01, 0x30, 0x10, "30k 120k and ..." }, - {0x13, 0x01, 0x30, 0x00, "30k 150k and..." }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Digdug2) - -static struct BurnDIPInfo TodruagaDIPList[]= -{ - {0x10, 0xff, 0xff, 0x0f, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x04, 0x04, "Upright" }, - {0x10, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x01, "1" }, - {0x11, 0x01, 0x03, 0x02, "2" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x0c, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, -}; - -STDDIPINFO(Todruaga) - -static struct BurnDIPInfo MotosDIPList[]= -{ - {0x12, 0xff, 0xff, 0x0f, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x04, 0x04, "Upright" }, - {0x12, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x13, 0x01, 0x06, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x06, 0x02, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x06, 0x06, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x06, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x08, 0x08, "3" }, - {0x13, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x10, 0x10, "Rank A" }, - {0x13, 0x01, 0x10, 0x00, "Rank B" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x60, 0x60, "10k 30k and every 50k" }, - {0x13, 0x01, 0x60, 0x40, "20k and every 50k" }, - {0x13, 0x01, 0x60, 0x20, "30k and every 70k" }, - {0x13, 0x01, 0x60, 0x00, "20k 70k" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Motos) - -static struct BurnDIPInfo SuperpacDIPList[]= -{ - {0x10, 0xff, 0xff, 0x0f, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x04, 0x04, "Upright" }, - {0x10, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 16, "Difficulty" }, - {0x11, 0x01, 0x0f, 0x0f, "Rank 0-Normal" }, - {0x11, 0x01, 0x0f, 0x0e, "Rank 1-Easiest" }, - {0x11, 0x01, 0x0f, 0x0d, "Rank 2" }, - {0x11, 0x01, 0x0f, 0x0c, "Rank 3" }, - {0x11, 0x01, 0x0f, 0x0b, "Rank 4" }, - {0x11, 0x01, 0x0f, 0x0a, "Rank 5" }, - {0x11, 0x01, 0x0f, 0x09, "Rank 6-Medium" }, - {0x11, 0x01, 0x0f, 0x08, "Rank 7" }, - {0x11, 0x01, 0x0f, 0x07, "Rank 8-Default" }, - {0x11, 0x01, 0x0f, 0x06, "Rank 9" }, - {0x11, 0x01, 0x0f, 0x05, "Rank A" }, - {0x11, 0x01, 0x0f, 0x04, "Rank B-Hardest" }, - {0x11, 0x01, 0x0f, 0x03, "Rank C-Easy Auto" }, - {0x11, 0x01, 0x0f, 0x02, "Rank D-Auto" }, - {0x11, 0x01, 0x0f, 0x01, "Rank E-Auto" }, - {0x11, 0x01, 0x0f, 0x00, "Rank F-Hard Auto" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x12, 0x01, 0x38, 0x08, "30k Only" }, - {0x12, 0x01, 0x38, 0x30, "30k & 80k Only" }, - {0x12, 0x01, 0x38, 0x20, "30k, 80k & Every 80k" }, - {0x12, 0x01, 0x38, 0x38, "30k & 100k Only" }, - {0x12, 0x01, 0x38, 0x18, "30k, 100k & Every 100k" }, - {0x12, 0x01, 0x38, 0x28, "30k & 120k Only" }, - {0x12, 0x01, 0x38, 0x10, "30k, 120k & Every 120k" }, - {0x12, 0x01, 0x38, 0x00, "None" }, -#if 0 - {0x12, 0x01, 0x38, 0x10, "30k Only" }, - {0x12, 0x01, 0x38, 0x38, "30k & 100k Only" }, - {0x12, 0x01, 0x38, 0x20, "30k, 100k & Every 100k" }, - {0x12, 0x01, 0x38, 0x30, "30k & 120k Only" }, - {0x12, 0x01, 0x38, 0x08, "40k Only" }, - {0x12, 0x01, 0x38, 0x28, "40k & 120k Only" }, - {0x12, 0x01, 0x38, 0x18, "40k, 120k & Every 120k" }, -#endif - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x80, "1" }, - {0x12, 0x01, 0xc0, 0x40, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Superpac) - -static struct BurnDIPInfo PacnpalDIPList[]= -{ - {0x10, 0xff, 0xff, 0x0f, NULL }, - {0x11, 0xff, 0xff, 0x77, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x04, 0x04, "Upright" }, - {0x10, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x11, 0x01, 0x38, 0x20, "20k & 70k Only" }, - {0x11, 0x01, 0x38, 0x30, "20k, 70k & Every 70k" }, - {0x11, 0x01, 0x38, 0x00, "30k Only" }, - {0x11, 0x01, 0x38, 0x18, "30k & 70k Only" }, - {0x11, 0x01, 0x38, 0x10, "30k & 80k Only" }, - {0x11, 0x01, 0x38, 0x28, "30k, 100k & Every 80k" }, - {0x11, 0x01, 0x38, 0x08, "30k & 100k Only" }, -#if 0 - {0x11, 0x01, 0x38, 0x08, "30k Only" }, - {0x11, 0x01, 0x38, 0x00, "40k Only" }, - {0x11, 0x01, 0x38, 0x20, "30k & 80k Only" }, - {0x11, 0x01, 0x38, 0x30, "30k, 80k & Every 80k" }, - {0x11, 0x01, 0x38, 0x18, "30k & 100k Only" }, - {0x11, 0x01, 0x38, 0x10, "40k & 120k Only" }, - {0x11, 0x01, 0x38, 0x28, "40k, 100k & Every 100k" }, -#endif - {0x11, 0x01, 0x38, 0x38, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0xc0, "1" }, - {0x11, 0x01, 0xc0, 0x80, "2" }, - {0x11, 0x01, 0xc0, 0x40, "3" }, - {0x11, 0x01, 0xc0, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x0c, "Rank A" }, - {0x12, 0x01, 0x0c, 0x08, "Rank B" }, - {0x12, 0x01, 0x0c, 0x04, "Rank C" }, - {0x12, 0x01, 0x0c, 0x00, "Rank D" }, -}; - -STDDIPINFO(Pacnpal) - -static struct BurnDIPInfo GrobdaDIPList[]= -{ - {0x12, 0xff, 0xff, 0x0f, NULL }, - {0x13, 0xff, 0xff, 0xc9, NULL }, - {0x14, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x04, 0x04, "Upright" }, - {0x12, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x0e, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0e, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0e, 0x06, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0e, 0x08, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0e, 0x04, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0e, 0x0a, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0e, 0x0e, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0e, 0x0c, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x70, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x70, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x70, 0x30, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x70, 0x40, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x70, 0x20, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x70, 0x50, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x70, 0x70, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x70, 0x60, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x02, "1" }, - {0x14, 0x01, 0x03, 0x01, "2" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x0c, "Rank A" }, - {0x14, 0x01, 0x0c, 0x08, "Rank B" }, - {0x14, 0x01, 0x0c, 0x04, "Rank C" }, - {0x14, 0x01, 0x0c, 0x00, "Rank D" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0xc0, 0x00, "10k, 50k & Every 50k" }, - {0x14, 0x01, 0xc0, 0x40, "10k & 30k Only" }, - {0x14, 0x01, 0xc0, 0xc0, "10k Only" }, - {0x14, 0x01, 0xc0, 0x80, "None" }, -}; - -STDDIPINFO(Grobda) - -static struct BurnDIPInfo PhozonDIPList[]= -{ - {0x10, 0xff, 0xff, 0x0f, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x04, 0x04, "Upright" }, - {0x10, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x11, 0x01, 0x0e, 0x0e, "Rank 0" }, - {0x11, 0x01, 0x0e, 0x0c, "Rank 1" }, - {0x11, 0x01, 0x0e, 0x0a, "Rank 2" }, - {0x11, 0x01, 0x0e, 0x08, "Rank 3" }, - {0x11, 0x01, 0x0e, 0x06, "Rank 4" }, - {0x11, 0x01, 0x0e, 0x04, "Rank 5" }, - {0x11, 0x01, 0x0e, 0x02, "Rank 6" }, - {0x11, 0x01, 0x0e, 0x00, "Rank 7" }, - - {0 , 0xfe, 0 , 2, "Level Select (Cheat)" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Stop Mode (Cheat)" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "1" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x12, 0x01, 0x1c, 0x08, "20k & 80k Only" }, - {0x12, 0x01, 0x1c, 0x10, "20k, 80k & Every 80k" }, - {0x12, 0x01, 0x1c, 0x04, "30k Only" }, - {0x12, 0x01, 0x1c, 0x18, "30k & 60k Only" }, - {0x12, 0x01, 0x1c, 0x1c, "30k & 100k Only" }, - {0x12, 0x01, 0x1c, 0x0c, "30k, 120k & Every 120k" }, -#if 0 - {0x12, 0x01, 0x1c, 0x0c, "20k & 80k Only" }, - {0x12, 0x01, 0x1c, 0x08, "30k" }, - {0x12, 0x01, 0x1c, 0x10, "30k, 100k & Every 100k" }, - {0x12, 0x01, 0x1c, 0x1c, "30k & 100k Only" }, - {0x12, 0x01, 0x1c, 0x18, "40k & 80k Only" }, - {0x12, 0x01, 0x1c, 0x04, "100k Only" }, -#endif - {0x12, 0x01, 0x1c, 0x00, "None" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0xe0, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "1 Coin 7 Credits" }, -}; - -STDDIPINFO(Phozon) - -static void mappy_latch_write(INT32 cpu, INT32 offset) -{ - INT32 bit = offset & 1; - - switch (offset & 0x0e) - { - case 0x00: - sub_irq_mask = bit; - if (bit == 0) { - if (cpu == 0) { - M6809Close(); - M6809Open(1); - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - M6809Close(); - M6809Open(0); - } else { - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - } - } - break; - - case 0x02: - main_irq_mask = bit; - if (bit == 0) { - if (cpu == 1) { - M6809Close(); - M6809Open(0); - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - M6809Close(); - M6809Open(1); - } else { - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - } - } - break; - - case 0x04: - flipscreen = bit; - break; - - case 0x06: - namco_15xx_sound_enable(bit); - break; - - case 0x08: - namcoio_set_reset_line(0, ~bit & 1); - namcoio_set_reset_line(1, ~bit & 1); - break; - - case 0x0a: - sub_cpu_in_reset = ~bit & 1; - if (bit == 0) - { - if (cpu == 0) { - M6809Close(); - M6809Open(1); - M6809Reset(); - M6809Close(); - M6809Open(0); - } else { - M6809Reset(); - } - } - break; - } -} - -static void phozon_latch_write(INT32 cpu, INT32 offset) -{ - INT32 bit = offset & 1; - - switch (offset & 0x0e) - { - case 0x04: - if (bit == 0) { - M6809Close(); - M6809Open(2); - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - M6809Close(); - M6809Open(0); - } - sub2_irq_mask = bit; - return; - - case 0x06: - return; - - case 0x0c: - sub2_cpu_in_reset = ~bit & 1; - if (bit == 0) - { - M6809Close(); - M6809Open(2); - M6809Reset(); - M6809Close(); - M6809Open(0); - } - return; - } - - mappy_latch_write(cpu, offset); -} - -static void mappy_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0x3800) { - scroll = (address & 0x7f8) / 8; - return; - } - - if ((address & 0xfc00) == 0x4000) { - namco_15xx_sharedram_write(address,data); - return; - } - - if ((address & 0xfff0) == 0x4800) { - namcoio_write(0, address & 0xf, data); - return; - } - - if ((address & 0xfff0) == 0x4810) { - namcoio_write(1, address & 0xf, data); - return; - } - - if ((address & 0xfff0) == 0x5000) { - mappy_latch_write(0, address); - return; - } - - if (address == 0x8000) { - watchdog = 0; - return; - } -} - -static UINT8 mappy_main_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x4000) { - return namco_15xx_sharedram_read(address); - } - - if ((address & 0xfff0) == 0x4800) { - return namcoio_read(0, address & 0xf); - } - - if ((address & 0xfff0) == 0x4810) { - return namcoio_read(1, address & 0xf); - } - - return 0; -} - -static void phozon_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x4000) { - namco_15xx_sharedram_write(address,data); - return; - } - - if ((address & 0xfff0) == 0x4800) { - namcoio_write(0, address & 0xf, data); - return; - } - - if ((address & 0xfff0) == 0x4810) { - namcoio_write(1, address & 0xf, data); - return; - } - - if ((address & 0xfff0) == 0x5000) { - phozon_latch_write(0, address); - return; - } - - if (address == 0x7000) { - watchdog = 0; - return; - } -} - -static UINT8 phozon_main_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x4000) { - return namco_15xx_sharedram_read(address); - } - - if ((address & 0xfff0) == 0x4800) { - return namcoio_read(0, address & 0xf); - } - - if ((address & 0xfff0) == 0x4810) { - return namcoio_read(1, address & 0xf); - } - - return 0; -} - -static void superpac_main_write(UINT16 address, UINT8 data) -{ - if (address == 0x2000) { - flipscreen = data & 1; - return; - } - - if ((address & 0xfff0) == 0x5000) { - mappy_latch_write(0, address); - return; - } - - mappy_main_write(address,data); -} - -static UINT8 superpac_main_read(UINT16 address) -{ - if (address == 0x2000) { - flipscreen = 1; - return 0xff; - } - - return mappy_main_read(address); -} - -static void mappy_sub_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x0000) { - namco_15xx_sharedram_write(address,data); - return; - } - - if ((address & 0xfff0) == 0x2000) { - mappy_latch_write(1, address); - return; - } -} - -static UINT8 mappy_sub_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x0000) { - return namco_15xx_sharedram_read(address); - } - - return 0; -} - -static void superpac_sub_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0x2000) { - mappy_latch_write(1, address); - return; - } - - mappy_sub_write(address, data); -} - -static void grobda_sub_write(UINT16 address, UINT8 data) -{ - if (address == 0x0002) { - DACWrite(0, data); - } - - if ((address & 0xfff0) == 0x2000) { - mappy_latch_write(1, address); - return; - } - - mappy_sub_write(address, data); -} - - -static UINT8 nio0_i0(UINT8) { return DrvInputs[3] & 0xf; } // COINS -static UINT8 nio0_i1(UINT8) { return DrvInputs[0] & 0xf; } // P1 -static UINT8 nio0_i2(UINT8) { return DrvInputs[1] & 0xf; } // P2 -static UINT8 nio0_i3(UINT8) { return DrvInputs[2] & 0xf; } // BUTTONS - -static UINT8 nio1_i0(UINT8) { return DrvInputs[6] >> (out_mux * 4); } -static UINT8 nio1_i0b(UINT8) { return BITSWAP08(DrvInputs[6], 6,4,2,0,7,5,3,1) >> (out_mux * 4); } -static UINT8 nio1_i1(UINT8) { return DrvInputs[5] & 0xf; } -static UINT8 nio1_i2(UINT8) { return DrvInputs[5] >> 4; } -static UINT8 nio1_i3(UINT8) { return DrvInputs[4]; } -static void nio1_o0(UINT8, UINT8 data) { out_mux = data & 1; } - -static tilemap_scan( mappy_bg ) -{ - INT32 offs; - - col -= 2; - if (col & 0x20) - { - if (row & 0x20) - offs = 0x7ff; // outside visible area - else - offs = ((row + 2) & 0x0f) + (row & 0x10) + ((col & 3) << 5) + 0x780; - } - else - offs = col + (row << 5); - - return offs; -} - -static tilemap_scan( superpac_bg ) -{ - INT32 offs; - - row += 2; - col -= 2; - if (col & 0x20) - offs = row + ((col & 0x1f) << 5); - else - offs = col + (row << 5); - - return offs; -} - -static tilemap_callback( mappy_bg ) -{ - UINT8 code = DrvVidRAM[offs]; - UINT8 attr = DrvVidRAM[offs + 0x800]; - - TILE_SET_INFO(0, code, attr, TILE_GROUP((attr >> 6) & 1)); -} - -static tilemap_callback( superpac_bg ) -{ - UINT8 code = DrvVidRAM[offs]; - UINT8 attr = DrvVidRAM[offs + 0x400]; - - TILE_SET_INFO(0, code + ((attr & 0x80) << 1), attr, TILE_GROUP((attr >> 6) & 1)); -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (M6809TotalCycles() / (1536000.000 / (nBurnFPS / 100.000)))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - for (INT32 i = 0; i < 0x10; i+=2) { - M6809WriteRom(0x2000 + i, 0); // send through the game's write handler - } - M6809Close(); - - M6809Open(1); - M6809Reset(); - NamcoSoundReset(); - DACReset(); // grobda - M6809Close(); - - M6809Open(2); // phozon - M6809Reset(); - M6809Close(); - - namcoio_reset(0); - namcoio_reset(1); - - HiscoreReset(); - - scroll = 0; - out_mux = 0; - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x008000; - DrvM6809ROM1 = Next; Next += 0x002000; - DrvM6809ROM2 = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000520; - - NamcoSoundProm = Next; - DrvSndPROM = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0500 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001800; - DrvM6809RAM2 = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(INT32 decode_type) -{ - INT32 Plane[4] = { 0, 4, 0x4000*8, 0x4000*8+4 }; - INT32 XOffs0[8] = { STEP4(64,1), STEP4(0,1) }; - INT32 XOffs1[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Plane, XOffs0, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x8000); - - if (decode_type) { // phozon - GfxDecode(0x0200, 2, 8, 8, Plane, XOffs1, YOffs, 0x080, tmp, DrvGfxROM1); - } else { - GfxDecode(0x0100, 4, 16, 16, Plane, XOffs1, YOffs, 0x200, tmp, DrvGfxROM1); - } - - BurnFree(tmp); - - return 0; -} - -static INT32 MappyInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x2000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x6000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x0000, 3, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x0000, 4, 1, LD_INVERT)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 9, 1)) return 1; - - if (BurnLoadRom(DrvSndPROM + 0x0000, 10, 1)) return 1; - - DrvGfxDecode(0); - } - - M6809Init(3); - - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(mappy_main_write); - M6809SetReadHandler(mappy_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(mappy_sub_write); - M6809SetReadHandler(mappy_sub_read); - M6809Close(); - - NamcoSoundInit(24000, 8, 0); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); // not used on this hardware - DACSetRoute(0, 0.0, BURN_SND_ROUTE_BOTH); - - namcoio_init(0, NAMCO58xx, nio0_i0, nio0_i1, nio0_i2, nio0_i3, NULL, NULL); - namcoio_init(1, NAMCO58xx, nio1_i0, nio1_i1, nio1_i2, nio1_i3, nio1_o0, NULL); - - GenericTilesInit(); - GenericTilemapInit(0, mappy_bg_map_scan, mappy_bg_map_callback, 8, 8, 36, 60); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x1000*4, 0, 0x3f); - GenericTilemapSetScrollCols(0, 36); - - DrvDoReset(); - - return 0; -} - -static INT32 Digdug2Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x0000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x0000, 3, 1, LD_INVERT)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 5, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 8, 1)) return 1; - - if (BurnLoadRom(DrvSndPROM + 0x0000, 9, 1)) return 1; - - DrvGfxDecode(0); - } - - M6809Init(3); - - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(mappy_main_write); - M6809SetReadHandler(mappy_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(mappy_sub_write); - M6809SetReadHandler(mappy_sub_read); - M6809Close(); - - NamcoSoundInit(24000, 8, 0); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); // not used on this hardware - DACSetRoute(0, 0.0, BURN_SND_ROUTE_BOTH); - - namcoio_init(0, NAMCO58xx, nio0_i0, nio0_i1, nio0_i2, nio0_i3, NULL, NULL); - namcoio_init(1, NAMCO56xx, nio1_i0, nio1_i1, nio1_i2, nio1_i3, nio1_o0, NULL); - - GenericTilesInit(); - GenericTilemapInit(0, mappy_bg_map_scan, mappy_bg_map_callback, 8, 8, 36, 60); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x1000*4, 0, 0x3f); - GenericTilemapSetScrollCols(0, 36); - - fourwaymode = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 MotosInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x0000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM0 + 0x0000, 3, 1, LD_INVERT)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 5, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 8, 1)) return 1; - - if (BurnLoadRom(DrvSndPROM + 0x0000, 9, 1)) return 1; - - DrvGfxDecode(0); - } - - M6809Init(3); - - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(mappy_main_write); - M6809SetReadHandler(mappy_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(mappy_sub_write); - M6809SetReadHandler(mappy_sub_read); - M6809Close(); - - NamcoSoundInit(24000, 8, 0); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); // not used on this hardware - DACSetRoute(0, 0.0, BURN_SND_ROUTE_BOTH); - - namcoio_init(0, NAMCO56xx, nio0_i0, nio0_i1, nio0_i2, nio0_i3, NULL, NULL); - namcoio_init(1, NAMCO56xx, nio1_i0, nio1_i1, nio1_i2, nio1_i3, nio1_o0, NULL); - - GenericTilesInit(); - GenericTilemapInit(0, mappy_bg_map_scan, mappy_bg_map_callback, 8, 8, 36, 60); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x1000*4, 0, 0x3f); - GenericTilemapSetScrollCols(0, 36); - - DrvDoReset(); - - return 0; -} - -static INT32 SuperpacInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x2000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x1000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 4, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 5, 1)) return 1; - if (BurnLoadRomExt(DrvColPROM + 0x0020, 6, 1, LD_INVERT)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 7, 1)) return 1; - - if (BurnLoadRom(DrvSndPROM + 0x0000, 8, 1)) return 1; - - DrvGfxDecode(0); - } - - M6809Init(3); - - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x0800, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0xa000, 0xffff, MAP_ROM); - M6809SetWriteHandler(superpac_main_write); - M6809SetReadHandler(superpac_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(superpac_sub_write); - M6809SetReadHandler(mappy_sub_read); - M6809Close(); - - NamcoSoundInit(24000, 8, 0); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); // not used on this hardware - DACSetRoute(0, 0.0, BURN_SND_ROUTE_BOTH); - - namcoio_init(0, NAMCO56xx, nio0_i0, nio0_i1, nio0_i2, nio0_i3, NULL, NULL); - namcoio_init(1, NAMCO56xx, nio1_i0, nio1_i1, nio1_i2, nio1_i3, nio1_o0, NULL); - - GenericTilesInit(); - GenericTilemapInit(0, superpac_bg_map_scan, superpac_bg_map_callback, 8, 8, 36, 28); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x1000*4, 0, 0x3f); - - fourwaymode = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 PacnpalInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x1000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 5, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 6, 1)) return 1; - if (BurnLoadRomExt(DrvColPROM + 0x0020, 7, 1, LD_INVERT)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 8, 1)) return 1; - - if (BurnLoadRom(DrvSndPROM + 0x0000, 9, 1)) return 1; - - DrvGfxDecode(0); - } - - M6809Init(3); - - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x0800, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0xa000, 0xffff, MAP_ROM); - M6809SetWriteHandler(superpac_main_write); - M6809SetReadHandler(superpac_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(superpac_sub_write); - M6809SetReadHandler(mappy_sub_read); - M6809Close(); - - NamcoSoundInit(24000, 8, 0); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); // not used on this hardware - DACSetRoute(0, 0.0, BURN_SND_ROUTE_BOTH); - - namcoio_init(0, NAMCO56xx, nio0_i0, nio0_i1, nio0_i2, nio0_i3, NULL, NULL); - namcoio_init(1, NAMCO59xx, nio1_i0, nio1_i1, nio1_i2, nio1_i3, nio1_o0, NULL); - - GenericTilesInit(); - GenericTilemapInit(0, superpac_bg_map_scan, superpac_bg_map_callback, 8, 8, 36, 28); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x1000*4, 0, 0x3f); - - fourwaymode = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 GrobdaInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x6000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 7, 1)) return 1; - if (BurnLoadRomExt(DrvColPROM + 0x0020, 8, 1, LD_INVERT)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0120, 9, 1)) return 1; - - if (BurnLoadRom(DrvSndPROM + 0x0000, 10, 1)) return 1; - - DrvGfxDecode(0); - } - - M6809Init(3); - - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x0800, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0xa000, 0xffff, MAP_ROM); - M6809SetWriteHandler(superpac_main_write); - M6809SetReadHandler(superpac_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(grobda_sub_write); - M6809SetReadHandler(mappy_sub_read); - M6809Close(); - - NamcoSoundInit(24000, 8, 0); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 1.0, BURN_SND_ROUTE_BOTH); - - namcoio_init(0, NAMCO58xx, nio0_i0, nio0_i1, nio0_i2, nio0_i3, NULL, NULL); - namcoio_init(1, NAMCO56xx, nio1_i0, nio1_i1, nio1_i2, nio1_i3, nio1_o0, NULL); - - GenericTilesInit(); - GenericTilemapInit(0, superpac_bg_map_scan, superpac_bg_map_callback, 8, 8, 36, 28); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x1000*4, 0, 0x3f); - - DrvDoReset(); - - return 0; -} - -static INT32 PhozonInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM2 + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0300, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0400, 13, 1)) return 1; -// if (BurnLoadRom(DrvColPROM + 0x0500, 14, 1)) return 1; - - if (BurnLoadRom(DrvSndPROM + 0x0000, 15, 1)) return 1; - - DrvGfxDecode(1); - } - - M6809Init(3); - - M6809Open(0); - M6809MapMemory(DrvVidRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x0800, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(phozon_main_write); - M6809SetReadHandler(phozon_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(mappy_sub_write); - M6809SetReadHandler(mappy_sub_read); - M6809Close(); - - M6809Open(2); - M6809MapMemory(DrvVidRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x0800, 0x1fff, MAP_RAM); - M6809MapMemory(DrvM6809RAM2, 0xa000, 0xa7ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM2, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(mappy_main_write); - M6809SetReadHandler(mappy_main_read); - M6809Close(); - - NamcoSoundInit(24000, 8, 0); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); // not used on this hardware - DACSetRoute(0, 0.0, BURN_SND_ROUTE_BOTH); - - namcoio_init(0, NAMCO58xx, nio0_i0, nio0_i1, nio0_i2, nio0_i3, NULL, NULL); - namcoio_init(1, NAMCO56xx, nio1_i0b, nio1_i1, nio1_i2, nio1_i3, nio1_o0, NULL); - - GenericTilesInit(); - GenericTilemapInit(0, superpac_bg_map_scan, superpac_bg_map_callback, 8, 8, 36, 28); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x2000*4, 0, 0x3f); - GenericTilemapSetTransparent(0, 0x00); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - - NamcoSoundExit(); - NamcoSoundProm = NULL; - - DACExit(); - - BurnFree(AllMem); - - fourwaymode = 0; - - return 0; -} - -static void MappyPaletteInit() -{ - UINT32 pal[32]; - - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = (((bit0 * 220) + (bit1 * 470) + (bit2 * 1000)) * 255) / 1690; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = (((bit0 * 220) + (bit1 * 470) + (bit2 * 1000)) * 255) / 1690; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = (((bit0 * 470) + (bit1 * 1000)) * 255) / 1470; - - pal[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 256; i++) - { - DrvPalette[i + 0x000] = pal[(DrvColPROM[i + 0x020] & 0xf) + 0x10]; - } - - for (INT32 i = 0; i < BurnDrvGetPaletteEntries() - 0x100; i++) - { - DrvPalette[i + 0x100] = pal[(DrvColPROM[i + 0x120] & 0xf)]; - } -} - -static void PhozonPaletteInit() -{ - UINT32 pal[32]; - - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i] >> 3) & 0x01; - INT32 r = (((bit0 * 220) + (bit1 * 470) + (bit2 * 1000) + (bit3 * 2200)) * 255) / 3890; - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - INT32 g = (((bit0 * 220) + (bit1 * 470) + (bit2 * 1000) + (bit3 * 2200)) * 255) / 3890; - - bit0 = (DrvColPROM[i + 0x200] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x200] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x200] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x200] >> 3) & 0x01; - INT32 b = (((bit0 * 220) + (bit1 * 470) + (bit2 * 1000) + (bit3 * 2200)) * 255) / 3890; - - pal[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 256; i++) - { - DrvPalette[i + 0x000] = pal[(DrvColPROM[i + 0x300] & 0xf)]; - DrvPalette[i + 0x100] = pal[(DrvColPROM[i + 0x400] & 0xf) + 0x10]; - } -} - -static void mappy_draw_sprites(INT32 depth, INT32 priority) -{ - UINT8 *ram0 = DrvSprRAM + 0x780; - UINT8 *ram1 = ram0 + 0x800; - UINT8 *ram2 = ram1 + 0x800; - - for (INT32 offs = 0; offs < 0x80; offs += 2) - { - if ((ram2[offs+1] & 2) == 0) - { - static const UINT8 gfx_offs[2][2] = - { - { 0, 1 }, - { 2, 3 } - }; - INT32 sprite = ram0[offs]; - INT32 color = (ram0[offs+1] << depth) & 0x3ff; - INT32 sx = ram1[offs+1] + 0x100 * (ram2[offs+1] & 1) - 40; - INT32 sy = 256 - ram1[offs] + 1; - INT32 flipx = (ram2[offs] & 0x01); - INT32 flipy = (ram2[offs] & 0x02) >> 1; - INT32 sizex = (ram2[offs] & 0x04) >> 2; - INT32 sizey = (ram2[offs] & 0x08) >> 3; - - sprite &= ~sizex; - sprite &= ~(sizey << 1); - - sy = ((sy - (16 * sizey)) & 0xff) - 32; - - if (flipscreen) - { - flipx ^= 1; - flipy ^= 1; - } - - for (INT32 y = 0; y <= sizey; y++) - { - for (INT32 x = 0; x <= sizex; x++) - { - INT32 code = (sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)]); - - if (priority) // pens 0 & 1 are over the char layer in superpac hardware - { - UINT8 *gfx = DrvGfxROM1 + (code * 0x100); - INT32 flip = (flipy ? 0xf0 : 0) | (flipx ? 0x0f : 0); - - INT32 dy = sy + 16 * y; - INT32 dx = sx + 16 * x; - - for (INT32 yy = 0; yy < 16; yy++) { - if ((yy+dy) < 0 || (yy+dy) >= nScreenHeight) continue; - - for (INT32 xx = 0; xx < 16; xx++) - { - if ((xx+dx) < 0 || (xx+dx) >= nScreenWidth) continue; - - INT32 pxl = gfx[((yy*16)+xx)^flip] + color; - - INT32 col = DrvColPROM[0x120 + pxl]; - - if (pxl && col < 2) { - pTransDraw[(dy + yy) * nScreenWidth + dx + xx] = pxl + 0x100; - } - } - } - } else { - RenderTileTranstab(pTransDraw, DrvGfxROM1, code, color+0x100, 0xf, sx + 16 * x, sy + 16 * y, flipx, flipy, 16, 16, DrvColPROM + 0x020); - } - } - } - } - } -} - -static void phozon_draw_sprites() -{ - UINT8 *ram0 = DrvSprRAM + 0x780; - UINT8 *ram1 = ram0 + 0x800; - UINT8 *ram2 = ram1 + 0x800; - - for (INT32 offs = 0; offs < 0x80; offs += 2) - { - if ((ram2[offs+1] & 2) == 0) - { - static const UINT8 size[4] = { 1, 0, 3, 0 }; - static const UINT8 gfx_offs[4][4] = - { - { 0, 1, 4, 5 }, - { 2, 3, 6, 7 }, - { 8, 9,12,13 }, - {10,11,14,15 } - }; - INT32 sprite = (ram0[offs] << 2) | ((ram2[offs] & 0xc0) >> 6); - INT32 color = ram0[offs+1] & 0x3f; - INT32 sx = ram1[offs+1] + 0x100 * (ram2[offs+1] & 1) - 69; - INT32 sy = 256 - ram1[offs]; - INT32 flipx = (ram2[offs] & 0x01); - INT32 flipy = (ram2[offs] & 0x02) >> 1; - INT32 sizex = size[(ram2[offs] & 0x0c) >> 2]; - INT32 sizey = size[(ram2[offs] & 0x30) >> 4]; - - sy = ((sy - (8 * sizey)) & 0xff) - 32; - - if (flipscreen) - { - flipx ^= 1; - flipy ^= 1; - } - - for (INT32 y = 0; y <= sizey; y++) - { - for (INT32 x = 0; x <= sizex; x++) - { - INT32 code = sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)]; - - RenderTileTranstab(pTransDraw, DrvGfxROM1, code, (color*4)+0x100, 0x0f, sx + 8 * x, sy + 8 * y, flipx, flipy, 8, 8, DrvColPROM + 0x300); - } - } - } - } -} - -static INT32 MappyDraw() -{ - if (DrvRecalc) { - MappyPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - GenericTilemapSetFlip(0, flipscreen); - - for (INT32 offs = 2; offs < 34; offs++) { - GenericTilemapSetScrollCol(0, offs, scroll); - } - - if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, 0); - if (nSpriteEnable & 1) mappy_draw_sprites(4, 0); - if (nBurnLayer & 2) GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(1)); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 SuperpacDraw() -{ - if (DrvRecalc) { - MappyPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - GenericTilemapSetFlip(0, flipscreen); - - if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, 0); - if (nSpriteEnable & 1) mappy_draw_sprites(2, 0); - if (nBurnLayer & 2) GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(1)); - if (nSpriteEnable & 2) mappy_draw_sprites(2, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 PhozonDraw() -{ - if (DrvRecalc) { - PhozonPaletteInit(); - DrvRecalc = 0; - } - - flipscreen = DrvSprRAM[0x1f7f-0x800] & 1; - - BurnTransferClear(); - - GenericTilemapSetFlip(0, flipscreen); - - if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, 0 | TMAP_FORCEOPAQUE); - if (nSpriteEnable & 1) phozon_draw_sprites(); - if (nBurnLayer & 2) GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(1)); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 4); - - DrvInputs[4] = DrvDips[0]; - DrvInputs[5] = DrvDips[1]; - DrvInputs[6] = DrvDips[2]; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - - if (fourwaymode) { - DrvInputs[0] ^= 0xff; // make active-high for ProcessJoystick() - DrvInputs[1] ^= 0xff; - - ProcessJoystick(&DrvInputs[0], 0, 0,2,3,1, INPUT_4WAY | INPUT_MAKEACTIVELOW); - ProcessJoystick(&DrvInputs[1], 1, 0,2,3,1, INPUT_4WAY | INPUT_MAKEACTIVELOW); - } - } - - INT32 nInterleave = 264; - INT32 nCyclesTotal[3] = { (INT32)((double)1536000 / 60.606061), (INT32)((double)1536000 / 60.606061), (INT32)((double)1536000 / 60.606061) }; - INT32 nCyclesDone[3] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = 0; - - M6809Open(0); - nCyclesDone[0] += M6809Run((nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i));//nCyclesTotal[0] / nInterleave); - if (i == nInterleave-1) { - if (main_irq_mask) - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - - if (!namcoio_read_reset_line(0)) - namcoio_run(0); - - if (!namcoio_read_reset_line(1)) - namcoio_run(1); - } - nSegment = M6809TotalCycles(); - M6809Close(); - - if (sub_cpu_in_reset) { - nCyclesDone[1] += nSegment - nCyclesDone[1]; - } else { - M6809Open(1); - nCyclesDone[1] += M6809Run(nSegment - nCyclesDone[1]); - if (i == nInterleave-1 && sub_irq_mask) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - } - - if (sub2_cpu_in_reset) { - nCyclesDone[2] += nSegment - nCyclesDone[2]; - } else { - M6809Open(2); - nCyclesDone[2] += M6809Run(nSegment - nCyclesDone[2]); - if (i == nInterleave-1 && sub2_irq_mask) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - } - } - - if (pBurnSoundOut) { - NamcoSoundUpdate(pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - NamcoSoundScan(nAction, pnMin); - DACScan(nAction, pnMin); - - namcoio_scan(0); - namcoio_scan(1); - - SCAN_VAR(sub_cpu_in_reset); - SCAN_VAR(sub2_cpu_in_reset); - SCAN_VAR(scroll); - SCAN_VAR(main_irq_mask); - SCAN_VAR(sub_irq_mask); - SCAN_VAR(sub2_irq_mask); - SCAN_VAR(flipscreen); - SCAN_VAR(out_mux); - } - - return 0; -} - - -// Mappy (US) - -static struct BurnRomInfo mappyRomDesc[] = { - { "mpx_3.1d", 0x2000, 0x52e6c708, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "mp1_2.1c", 0x2000, 0xa958a61c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mpx_1.1b", 0x2000, 0x203766d4, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "mp1_4.1k", 0x2000, 0x8182dd5b, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "mp1_5.3b", 0x1000, 0x16498b9f, 3 | BRF_GRA }, // 4 Background Tiles - - { "mp1_6.3m", 0x2000, 0xf2d9647a, 4 | BRF_GRA }, // 5 Sprites - { "mp1_7.3n", 0x2000, 0x757cf2b6, 4 | BRF_GRA }, // 6 - - { "mp1-5.5b", 0x0020, 0x56531268, 5 | BRF_GRA }, // 7 Color Data - { "mp1-6.4c", 0x0100, 0x50765082, 5 | BRF_GRA }, // 8 - { "mp1-7.5k", 0x0100, 0x5396bd78, 5 | BRF_GRA }, // 9 - - { "mp1-3.3m", 0x0100, 0x16a9166a, 6 | BRF_GRA }, // 10 Sound Prom -}; - -STD_ROM_PICK(mappy) -STD_ROM_FN(mappy) - -struct BurnDriver BurnDrvMappy = { - "mappy", NULL, NULL, NULL, "1983", - "Mappy (US)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, mappyRomInfo, mappyRomName, NULL, NULL, MappyInputInfo, MappyDIPInfo, - MappyInit, DrvExit, DrvFrame, MappyDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Mappy (Japan) - -static struct BurnRomInfo mappyjRomDesc[] = { - { "mp1_3.1d", 0x2000, 0xdb9d5ab5, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "mp1_2.1c", 0x2000, 0xa958a61c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mp1_1.1b", 0x2000, 0x77c0b492, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "mp1_4.1k", 0x2000, 0x8182dd5b, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "mp1_5.3b", 0x1000, 0x16498b9f, 3 | BRF_GRA }, // 4 Background Tiles - - { "mp1_6.3m", 0x2000, 0xf2d9647a, 4 | BRF_GRA }, // 5 Sprites - { "mp1_7.3n", 0x2000, 0x757cf2b6, 4 | BRF_GRA }, // 6 - - { "mp1-5.5b", 0x0020, 0x56531268, 5 | BRF_GRA }, // 7 Color Data - { "mp1-6.4c", 0x0100, 0x50765082, 5 | BRF_GRA }, // 8 - { "mp1-7.5k", 0x0100, 0x5396bd78, 5 | BRF_GRA }, // 9 - - { "mp1-3.3m", 0x0100, 0x16a9166a, 6 | BRF_GRA }, // 10 Sound Prom -}; - -STD_ROM_PICK(mappyj) -STD_ROM_FN(mappyj) - -struct BurnDriver BurnDrvMappyj = { - "mappyj", "mappy", NULL, NULL, "1983", - "Mappy (Japan)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, mappyjRomInfo, mappyjRomName, NULL, NULL, MappyInputInfo, MappyDIPInfo, - MappyInit, DrvExit, DrvFrame, MappyDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Dig Dug II (New Ver.) - -static struct BurnRomInfo digdug2RomDesc[] = { - { "d23_3.1d", 0x4000, 0xcc155338, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "d23_1.1b", 0x4000, 0x40e46af8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "d21_4.1k", 0x2000, 0x737443b1, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 #1 Code - - { "d21_5.3b", 0x1000, 0xafcb4509, 3 | BRF_GRA }, // 3 Background Tiles - - { "d21_6.3m", 0x4000, 0xdf1f4ad8, 4 | BRF_GRA }, // 4 Sprites - { "d21_7.3n", 0x4000, 0xccadb3ea, 4 | BRF_GRA }, // 5 - - { "d21-5.5b", 0x0020, 0x9b169db5, 5 | BRF_GRA }, // 6 Color Data - { "d21-6.4c", 0x0100, 0x55a88695, 5 | BRF_GRA }, // 7 - { "d21-7.5k", 0x0100, 0x9c55feda, 5 | BRF_GRA }, // 8 - - { "d21-3.3m", 0x0100, 0xe0074ee2, 6 | BRF_GRA }, // 9 Sound Prom -}; - -STD_ROM_PICK(digdug2) -STD_ROM_FN(digdug2) - -struct BurnDriver BurnDrvDigdug2 = { - "digdug2", NULL, NULL, NULL, "1985", - "Dig Dug II (New Ver.)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, digdug2RomInfo, digdug2RomName, NULL, NULL, Digdug2InputInfo, Digdug2DIPInfo, - Digdug2Init, DrvExit, DrvFrame, MappyDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Dig Dug II (Old Ver.) - -static struct BurnRomInfo digdug2oRomDesc[] = { - { "d21_3.1d", 0x4000, 0xbe7ec80b, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "d21_1.1b", 0x4000, 0x5c77c0d4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "d21_4.1k", 0x2000, 0x737443b1, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 #1 Code - - { "d21_5.3b", 0x1000, 0xafcb4509, 3 | BRF_GRA }, // 3 Background Tiles - - { "d21_6.3m", 0x4000, 0xdf1f4ad8, 4 | BRF_GRA }, // 4 Sprites - { "d21_7.3n", 0x4000, 0xccadb3ea, 4 | BRF_GRA }, // 5 - - { "d21-5.5b", 0x0020, 0x9b169db5, 5 | BRF_GRA }, // 6 Color Data - { "d21-6.4c", 0x0100, 0x55a88695, 5 | BRF_GRA }, // 7 - { "d2x-7.5k", 0x0100, 0x1525a4d1, 5 | BRF_GRA }, // 8 - - { "d21-3.3m", 0x0100, 0xe0074ee2, 6 | BRF_GRA }, // 9 Sound Prom -}; - -STD_ROM_PICK(digdug2o) -STD_ROM_FN(digdug2o) - -struct BurnDriver BurnDrvDigdug2o = { - "digdug2o", "digdug2", NULL, NULL, "1985", - "Dig Dug II (Old Ver.)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, digdug2oRomInfo, digdug2oRomName, NULL, NULL, Digdug2InputInfo, Digdug2DIPInfo, - Digdug2Init, DrvExit, DrvFrame, MappyDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// The Tower of Druaga (New Ver.) - -static struct BurnRomInfo todruagaRomDesc[] = { - { "td2_3.1d", 0x4000, 0xfbf16299, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "td2_1.1b", 0x4000, 0xb238d723, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "td1_4.1k", 0x2000, 0xae9d06d9, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 #1 Code - - { "td1_5.3b", 0x1000, 0xd32b249f, 3 | BRF_GRA }, // 3 Background Tiles - - { "td1_6.3m", 0x2000, 0xe827e787, 4 | BRF_GRA }, // 4 Sprites - { "td1_7.3n", 0x2000, 0x962bd060, 4 | BRF_GRA }, // 5 - - { "td1-5.5b", 0x0020, 0x122cc395, 5 | BRF_GRA }, // 6 Color Data - { "td1-6.4c", 0x0100, 0x8c661d6a, 5 | BRF_GRA }, // 7 - { "td1-7.5k", 0x0400, 0xa86c74dd, 5 | BRF_GRA }, // 8 - - { "td1-3.3m", 0x0100, 0x07104c40, 6 | BRF_GRA }, // 9 Sound Prom -}; - -STD_ROM_PICK(todruaga) -STD_ROM_FN(todruaga) - -struct BurnDriver BurnDrvTodruaga = { - "todruaga", NULL, NULL, NULL, "1984", - "The Tower of Druaga (New Ver.)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, todruagaRomInfo, todruagaRomName, NULL, NULL, TodruagaInputInfo, TodruagaDIPInfo, - Digdug2Init, DrvExit, DrvFrame, MappyDraw, DrvScan, &DrvRecalc, 0x500, - 224, 288, 3, 4 -}; - - -// The Tower of Druaga (Old Ver.) - -static struct BurnRomInfo todruagaoRomDesc[] = { - { "td1_3.1d", 0x4000, 0x7ab4f5b2, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "td1_1.1b", 0x4000, 0x8c20ef10, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "td1_4.1k", 0x2000, 0xae9d06d9, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 #1 Code - - { "td1_5.3b", 0x1000, 0xd32b249f, 3 | BRF_GRA }, // 3 Background Tiles - - { "td1_6.3m", 0x2000, 0xe827e787, 4 | BRF_GRA }, // 4 Sprites - { "td1_7.3n", 0x2000, 0x962bd060, 4 | BRF_GRA }, // 5 - - { "td1-5.5b", 0x0020, 0x122cc395, 5 | BRF_GRA }, // 6 Color Data - { "td1-6.4c", 0x0100, 0x8c661d6a, 5 | BRF_GRA }, // 7 - { "td1-7.5k", 0x0400, 0xa86c74dd, 5 | BRF_GRA }, // 8 - - { "td1-3.3m", 0x0100, 0x07104c40, 6 | BRF_GRA }, // 9 Sound Prom -}; - -STD_ROM_PICK(todruagao) -STD_ROM_FN(todruagao) - -struct BurnDriver BurnDrvTodruagao = { - "todruagao", "todruaga", NULL, NULL, "1984", - "The Tower of Druaga (Old Ver.)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, todruagaoRomInfo, todruagaoRomName, NULL, NULL, TodruagaInputInfo, TodruagaDIPInfo, - Digdug2Init, DrvExit, DrvFrame, MappyDraw, DrvScan, &DrvRecalc, 0x500, - 224, 288, 3, 4 -}; - - -// The Tower of Druaga (Sidam) - -static struct BurnRomInfo todruagasRomDesc[] = { - { "3b.bin", 0x4000, 0x85d052d9, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "1b.bin", 0x4000, 0xa5db267a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "td1_4.1k", 0x2000, 0xae9d06d9, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 #1 Code - - { "td1_5.3b", 0x1000, 0xd32b249f, 3 | BRF_GRA }, // 3 Background Tiles - - { "td1_6.3m", 0x2000, 0xe827e787, 4 | BRF_GRA }, // 4 Sprites - { "td1_7.3n", 0x2000, 0x962bd060, 4 | BRF_GRA }, // 5 - - { "td1-5.5b", 0x0020, 0x122cc395, 5 | BRF_GRA }, // 6 Color Data - { "td1-6.4c", 0x0100, 0x8c661d6a, 5 | BRF_GRA }, // 7 - { "td1-7.5k", 0x0400, 0xa86c74dd, 5 | BRF_GRA }, // 8 - - { "td1-3.3m", 0x0100, 0x07104c40, 6 | BRF_GRA }, // 9 Sound Prom -}; - -STD_ROM_PICK(todruagas) -STD_ROM_FN(todruagas) - -struct BurnDriver BurnDrvTodruagas = { - "todruagas", "todruaga", NULL, NULL, "1984", - "The Tower of Druaga (Sidam)\0", NULL, "bootleg? (Sidam)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, todruagasRomInfo, todruagasRomName, NULL, NULL, TodruagaInputInfo, TodruagaDIPInfo, - Digdug2Init, DrvExit, DrvFrame, MappyDraw, DrvScan, &DrvRecalc, 0x500, - 224, 288, 3, 4 -}; - - -// Motos - -static struct BurnRomInfo motosRomDesc[] = { - { "mo1_3.1d", 0x4000, 0x1104abb2, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "mo1_1.1b", 0x4000, 0x57b157e2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mo1_4.1k", 0x2000, 0x55e45d21, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 #1 Code - - { "mo1_5.3b", 0x1000, 0x5d4a2a22, 3 | BRF_GRA }, // 3 Background Tiles - - { "mo1_6.3m", 0x4000, 0x2f0e396e, 4 | BRF_GRA }, // 4 Sprites - { "mo1_7.3n", 0x4000, 0xcf8a3b86, 4 | BRF_GRA }, // 5 - - { "mo1-5.5b", 0x0020, 0x71972383, 5 | BRF_GRA }, // 6 Color Data - { "mo1-6.4c", 0x0100, 0x730ba7fb, 5 | BRF_GRA }, // 7 - { "mo1-7.5k", 0x0100, 0x7721275d, 5 | BRF_GRA }, // 8 - - { "mo1-3.3m", 0x0100, 0x2accdfb4, 6 | BRF_GRA }, // 9 Sound Prom -}; - -STD_ROM_PICK(motos) -STD_ROM_FN(motos) - -struct BurnDriver BurnDrvMotos = { - "motos", NULL, NULL, NULL, "1985", - "Motos\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, motosRomInfo, motosRomName, NULL, NULL, MotosInputInfo, MotosDIPInfo, - MotosInit, DrvExit, DrvFrame, MappyDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Super Pac-Man - -static struct BurnRomInfo superpacRomDesc[] = { - { "sp1-2.1c", 0x2000, 0x4bb33d9c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "sp1-1.1b", 0x2000, 0x846fbb4a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "spc-3.1k", 0x1000, 0x04445ddb, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 #1 Code - - { "sp1-6.3c", 0x1000, 0x91c5935c, 3 | BRF_GRA }, // 3 Background Tiles - - { "spv-2.3f", 0x2000, 0x670a42f2, 4 | BRF_GRA }, // 4 Sprites - - { "superpac.4c", 0x0020, 0x9ce22c46, 5 | BRF_GRA }, // 5 Color Data - { "superpac.4e", 0x0100, 0x1253c5c1, 5 | BRF_GRA }, // 6 - { "superpac.3l", 0x0100, 0xd4d7026f, 5 | BRF_GRA }, // 7 - - { "superpac.3m", 0x0100, 0xad43688f, 6 | BRF_GRA }, // 8 Sound Prom -}; - -STD_ROM_PICK(superpac) -STD_ROM_FN(superpac) - -struct BurnDriver BurnDrvSuperpac = { - "superpac", NULL, NULL, NULL, "1982", - "Super Pac-Man\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, superpacRomInfo, superpacRomName, NULL, NULL, SuperpacInputInfo, SuperpacDIPInfo, - SuperpacInit, DrvExit, DrvFrame, SuperpacDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Super Pac-Man (Midway) - -static struct BurnRomInfo superpacmRomDesc[] = { - { "spc-2.1c", 0x2000, 0x1a38c30e, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "spc-1.1b", 0x2000, 0x730e95a9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "spc-3.1k", 0x1000, 0x04445ddb, 2 | BRF_PRG | BRF_ESS }, // 2 M6809 #1 Code - - { "spv-1.3c", 0x1000, 0x78337e74, 3 | BRF_GRA }, // 3 Background Tiles - - { "spv-2.3f", 0x2000, 0x670a42f2, 4 | BRF_GRA }, // 4 Sprites - - { "superpac.4c", 0x0020, 0x9ce22c46, 5 | BRF_GRA }, // 5 Color Data - { "superpac.4e", 0x0100, 0x1253c5c1, 5 | BRF_GRA }, // 6 - { "superpac.3l", 0x0100, 0xd4d7026f, 5 | BRF_GRA }, // 7 - - { "superpac.3m", 0x0100, 0xad43688f, 6 | BRF_GRA }, // 8 Sound Prom -}; - -STD_ROM_PICK(superpacm) -STD_ROM_FN(superpacm) - -struct BurnDriver BurnDrvSuperpacm = { - "superpacm", "superpac", NULL, NULL, "1982", - "Super Pac-Man (Midway)\0", NULL, "Namco (Bally Midway license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, superpacmRomInfo, superpacmRomName, NULL, NULL, SuperpacInputInfo, SuperpacDIPInfo, - SuperpacInit, DrvExit, DrvFrame, SuperpacDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac & Pal - -static struct BurnRomInfo pacnpalRomDesc[] = { - { "pap1-3b.1d", 0x2000, 0xed64a565, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "pap1-2b.1c", 0x2000, 0x15308bcf, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pap3-1.1b", 0x2000, 0x3cac401c, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pap1-4.1k", 0x1000, 0x330e20de, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "pap1-6.3c", 0x1000, 0xa36b96cb, 3 | BRF_GRA }, // 4 Background Tiles - - { "pap1-5.3f", 0x2000, 0xfb6f56e3, 4 | BRF_GRA }, // 5 Sprites - - { "pap1-6.4c", 0x0020, 0x52634b41, 5 | BRF_GRA }, // 6 Color Data - { "pap1-5.4e", 0x0100, 0xac46203c, 5 | BRF_GRA }, // 7 - { "pap1-4.3l", 0x0100, 0x686bde84, 5 | BRF_GRA }, // 8 - - { "pap1-3.3m", 0x0100, 0x94782db5, 6 | BRF_GRA }, // 9 Sound Prom -}; - -STD_ROM_PICK(pacnpal) -STD_ROM_FN(pacnpal) - -struct BurnDriver BurnDrvPacnpal = { - "pacnpal", NULL, NULL, NULL, "1983", - "Pac & Pal\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, pacnpalRomInfo, pacnpalRomName, NULL, NULL, PacnpalInputInfo, PacnpalDIPInfo, - PacnpalInit, DrvExit, DrvFrame, SuperpacDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac & Pal (older) - -static struct BurnRomInfo pacnpal2RomDesc[] = { - { "pap1-3.1d", 0x2000, 0xd7ec2719, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "pap1-2.1c", 0x2000, 0x0245396e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pap1-1.1b", 0x2000, 0x7f046b58, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pap1-4.1k", 0x1000, 0x330e20de, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "pap1-6.3c", 0x1000, 0xa36b96cb, 3 | BRF_GRA }, // 4 Background Tiles - - { "pap1-5.3f", 0x2000, 0xfb6f56e3, 4 | BRF_GRA }, // 5 Sprites - - { "pap1-6.4c", 0x0020, 0x52634b41, 5 | BRF_GRA }, // 6 Color Data - { "pap1-5.4e", 0x0100, 0xac46203c, 5 | BRF_GRA }, // 7 - { "pap1-4.3l", 0x0100, 0x686bde84, 5 | BRF_GRA }, // 8 - - { "pap1-3.3m", 0x0100, 0x94782db5, 6 | BRF_GRA }, // 9 Sound Prom -}; - -STD_ROM_PICK(pacnpal2) -STD_ROM_FN(pacnpal2) - -struct BurnDriver BurnDrvPacnpal2 = { - "pacnpal2", "pacnpal", NULL, NULL, "1983", - "Pac & Pal (older)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, pacnpal2RomInfo, pacnpal2RomName, NULL, NULL, PacnpalInputInfo, PacnpalDIPInfo, - PacnpalInit, DrvExit, DrvFrame, SuperpacDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac-Man & Chomp Chomp - -static struct BurnRomInfo pacnchmpRomDesc[] = { - { "pap3-3.1d", 0x2000, 0x20a07d3d, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "pap3-2.1c", 0x2000, 0x505bae56, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pap3-1.1b", 0x2000, 0x3cac401c, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pap1-4.1k", 0x1000, 0x330e20de, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "pap2-6.3c", 0x1000, 0x93d15c30, 3 | BRF_GRA }, // 4 Background Tiles - - { "pap2-5.3f", 0x2000, 0x39f44aa4, 4 | BRF_GRA }, // 5 Sprites - - { "pap2-6.4c", 0x0020, 0x18c3db79, 5 | BRF_GRA }, // 6 Color Data - { "pap2-5.4e", 0x0100, 0x875b49bb, 5 | BRF_GRA }, // 7 - { "pap2-4.3l", 0x0100, 0x23701566, 5 | BRF_GRA }, // 8 - - { "pap1-3.3m", 0x0100, 0x94782db5, 6 | BRF_GRA }, // 9 Sound Prom -}; - -STD_ROM_PICK(pacnchmp) -STD_ROM_FN(pacnchmp) - -struct BurnDriver BurnDrvPacnchmp = { - "pacnchmp", "pacnpal", NULL, NULL, "1983", - "Pac-Man & Chomp Chomp\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, pacnchmpRomInfo, pacnchmpRomName, NULL, NULL, PacnpalInputInfo, PacnpalDIPInfo, - PacnpalInit, DrvExit, DrvFrame, SuperpacDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Grobda (New Ver.) - -static struct BurnRomInfo grobdaRomDesc[] = { - { "gr2-3.1d", 0x2000, 0x8e3a23be, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gr2-2.1c", 0x2000, 0x19ffa83d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gr2-1.1b", 0x2000, 0x0089b13a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gr1-4.1k", 0x2000, 0x3fe78c08, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "gr1-7.3c", 0x1000, 0x4ebfabfd, 3 | BRF_GRA }, // 4 Background Tiles - - { "gr1-5.3f", 0x2000, 0xeed43487, 4 | BRF_GRA }, // 5 Sprites - { "gr1-6.3e", 0x2000, 0xcebb7362, 4 | BRF_GRA }, // 6 - - { "gr1-6.4c", 0x0020, 0xc65efa77, 5 | BRF_GRA }, // 7 Color Data - { "gr1-5.4e", 0x0100, 0xa0f66911, 5 | BRF_GRA }, // 8 - { "gr1-4.3l", 0x0100, 0xf1f2c234, 5 | BRF_GRA }, // 9 - - { "gr1-3.3m", 0x0100, 0x66eb1467, 6 | BRF_GRA }, // 10 Sound Prom -}; - -STD_ROM_PICK(grobda) -STD_ROM_FN(grobda) - -struct BurnDriver BurnDrvGrobda = { - "grobda", NULL, NULL, NULL, "1984", - "Grobda (New Ver.)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, grobdaRomInfo, grobdaRomName, NULL, NULL, GrobdaInputInfo, GrobdaDIPInfo, - GrobdaInit, DrvExit, DrvFrame, SuperpacDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Grobda (Old Ver. set 1) - -static struct BurnRomInfo grobda2RomDesc[] = { - { "gr1-3.1d", 0x2000, 0x4ef4a7c1, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gr2-2a.1c", 0x2000, 0xf93e82ae, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gr1-1.1b", 0x2000, 0x32d42f22, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gr1-4.1k", 0x2000, 0x3fe78c08, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "gr1-7.3c", 0x1000, 0x4ebfabfd, 3 | BRF_GRA }, // 4 Background Tiles - - { "gr1-5.3f", 0x2000, 0xeed43487, 4 | BRF_GRA }, // 5 Sprites - { "gr1-6.3e", 0x2000, 0xcebb7362, 4 | BRF_GRA }, // 6 - - { "gr1-6.4c", 0x0020, 0xc65efa77, 5 | BRF_GRA }, // 7 Color Data - { "gr1-5.4e", 0x0100, 0xa0f66911, 5 | BRF_GRA }, // 8 - { "gr1-4.3l", 0x0100, 0xf1f2c234, 5 | BRF_GRA }, // 9 - - { "gr1-3.3m", 0x0100, 0x66eb1467, 6 | BRF_GRA }, // 10 Sound Prom -}; - -STD_ROM_PICK(grobda2) -STD_ROM_FN(grobda2) - -struct BurnDriver BurnDrvGrobda2 = { - "grobda2", "grobda", NULL, NULL, "1984", - "Grobda (Old Ver. set 1)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, grobda2RomInfo, grobda2RomName, NULL, NULL, GrobdaInputInfo, GrobdaDIPInfo, - GrobdaInit, DrvExit, DrvFrame, SuperpacDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Grobda (Old Ver. set 2) - -static struct BurnRomInfo grobda3RomDesc[] = { - { "gr1-3.1d", 0x2000, 0x4ef4a7c1, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "gr1-2.1c", 0x2000, 0x7dcc6e8e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "gr1-1.1b", 0x2000, 0x32d42f22, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "gr1-4.1k", 0x2000, 0x3fe78c08, 2 | BRF_PRG | BRF_ESS }, // 3 M6809 #1 Code - - { "gr1-7.3c", 0x1000, 0x4ebfabfd, 3 | BRF_GRA }, // 4 Background Tiles - - { "gr1-5.3f", 0x2000, 0xeed43487, 4 | BRF_GRA }, // 5 Sprites - { "gr1-6.3e", 0x2000, 0xcebb7362, 4 | BRF_GRA }, // 6 - - { "gr1-6.4c", 0x0020, 0xc65efa77, 5 | BRF_GRA }, // 7 Color Data - { "gr1-5.4e", 0x0100, 0xa0f66911, 5 | BRF_GRA }, // 8 - { "gr1-4.3l", 0x0100, 0xf1f2c234, 5 | BRF_GRA }, // 9 - - { "gr1-3.3m", 0x0100, 0x66eb1467, 6 | BRF_GRA }, // 10 Sound Prom -}; - -STD_ROM_PICK(grobda3) -STD_ROM_FN(grobda3) - -struct BurnDriver BurnDrvGrobda3 = { - "grobda3", "grobda", NULL, NULL, "1984", - "Grobda (Old Ver. set 2)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, grobda3RomInfo, grobda3RomName, NULL, NULL, GrobdaInputInfo, GrobdaDIPInfo, - GrobdaInit, DrvExit, DrvFrame, SuperpacDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Phozon (Japan) - -static struct BurnRomInfo phozonRomDesc[] = { - { "6e.rom", 0x2000, 0xa6686af1, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "6h.rom", 0x2000, 0x72a65ba0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "6c.rom", 0x2000, 0xf1fda22e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "6d.rom", 0x2000, 0xf40e6df0, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "3b.rom", 0x2000, 0x5a4b3a79, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - - { "9r.rom", 0x2000, 0x5d9f0a28, 3 | BRF_GRA }, // 5 M6809 #2 Code - - { "7j.rom", 0x1000, 0x27f9db5b, 4 | BRF_GRA }, // 6 Background Tiles - { "8j.rom", 0x1000, 0x15b12ef8, 4 | BRF_GRA }, // 7 - - { "5t.rom", 0x2000, 0xd50f08f8, 5 | BRF_GRA }, // 8 Sprites - - { "red.prm", 0x0100, 0xa2880667, 6 | BRF_GRA }, // 9 Color Data - { "green.prm", 0x0100, 0xd6e08bef, 6 | BRF_GRA }, // 10 - { "blue.prm", 0x0100, 0xb2d69c72, 6 | BRF_GRA }, // 11 - { "chr.prm", 0x0100, 0x429e8fee, 6 | BRF_GRA }, // 12 - { "sprite.prm", 0x0100, 0x9061db07, 6 | BRF_GRA }, // 13 - { "palette.prm", 0x0020, 0x60e856ed, 6 | BRF_GRA | BRF_OPT }, // 14 - - { "sound.prm", 0x0100, 0xad43688f, 7 | BRF_GRA }, // 15 Sound Prom -}; - -STD_ROM_PICK(phozon) -STD_ROM_FN(phozon) - -struct BurnDriver BurnDrvPhozon = { - "phozon", NULL, NULL, NULL, "1983", - "Phozon (Japan)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phozonRomInfo, phozonRomName, NULL, NULL, PhozonInputInfo, PhozonDIPInfo, - PhozonInit, DrvExit, DrvFrame, PhozonDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Phozon (Sidam) - -static struct BurnRomInfo phozonsRomDesc[] = { - { "6e.bin", 0x2000, 0xef822900, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - { "6h.bin", 0x2000, 0xacb7869e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "6c.bin", 0x2000, 0x8ffa3e0e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "6d.bin", 0x2000, 0x8e6800b3, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "3b.rom", 0x2000, 0x5a4b3a79, 2 | BRF_PRG | BRF_ESS }, // 4 M6809 #1 Code - - { "9r.rom", 0x2000, 0x5d9f0a28, 3 | BRF_GRA }, // 5 M6809 #2 Code - - { "7j.bin", 0x1000, 0x312b3ece, 4 | BRF_GRA }, // 6 Background Tiles - { "8j.bin", 0x1000, 0xd21422a2, 4 | BRF_GRA }, // 7 - - { "5t.rom", 0x2000, 0xd50f08f8, 5 | BRF_GRA }, // 8 Sprites - - { "red.prm", 0x0100, 0xa2880667, 6 | BRF_GRA }, // 9 Color Data - { "green.prm", 0x0100, 0xd6e08bef, 6 | BRF_GRA }, // 10 - { "blue.prm", 0x0100, 0xb2d69c72, 6 | BRF_GRA }, // 11 - { "chr.prm", 0x0100, 0x429e8fee, 6 | BRF_GRA }, // 12 - { "sprite.prm", 0x0100, 0x9061db07, 6 | BRF_GRA }, // 13 - { "palette.prm", 0x0020, 0x60e856ed, 6 | BRF_GRA | BRF_OPT }, // 14 - - { "sound.prm", 0x0100, 0xad43688f, 7 | BRF_GRA }, // 15 Sound Prom -}; - -STD_ROM_PICK(phozons) -STD_ROM_FN(phozons) - -struct BurnDriver BurnDrvPhozons = { - "phozons", "phozon", NULL, NULL, "1983", - "Phozon (Sidam)\0", NULL, "Namco (Sidam license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phozonsRomInfo, phozonsRomName, NULL, NULL, PhozonInputInfo, PhozonDIPInfo, - PhozonInit, DrvExit, DrvFrame, PhozonDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_marineb.cpp b/jan/src/burn/drv/pre90s/d_marineb.cpp deleted file mode 100644 index e48adf294..000000000 --- a/jan/src/burn/drv/pre90s/d_marineb.cpp +++ /dev/null @@ -1,2034 +0,0 @@ -// Based on original MAME driver writen by Zsolt Vasvari -// updated with all the romsets by dink, Oct. 2015 - -#include "tiles_generic.h" -#include "z80_intf.h" - -#include "driver.h" -extern "C" { - #include "ay8910.h" -} - -enum { SPRINGER = 0, MARINEB, HOPPROBO, CHANGES, HOCCER, WANTED, BCRUZM12 }; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *RamStart; -static UINT8 *RamEnd; -static UINT32 *DrvPalette; -static UINT8 DrvRecalcPalette; - -static UINT8 DrvInputPort0[8]; -static UINT8 DrvInputPort1[8]; -static UINT8 DrvInputPort2[8]; -static UINT8 DrvDip; -static UINT8 DrvInput[3]; -static UINT8 DrvReset; - -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; - -static UINT8 DrvPaletteBank; -static UINT8 DrvColumnScroll; -static UINT8 DrvFlipScreenY; -static UINT8 DrvFlipScreenX; -static INT32 DrvInterruptEnable; -static UINT8 ActiveLowFlipscreen; -static INT32 hardware; - -static INT16 *pAY8910Buffer[6]; - - -static struct BurnInputInfo MarinebInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 right" }, - {"P1 Fire" , BIT_DIGITAL , DrvInputPort2 + 4, "p1 fire 1" }, - - {"P2 Start" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 right" }, - {"P2 Fire" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip" , BIT_DIPSWITCH, &DrvDip , "dip" }, - -}; - -STDINPUTINFO(Marineb) - -static struct BurnDIPInfo MarinebDIPList[]= -{ - {0x0E, 0xFF, 0xFF, 0x40, NULL }, - - {0 , 0xFE, 0 , 4, "Lives" }, - {0x0E, 0x01, 0x03, 0x00, "3" }, - {0x0E, 0x01, 0x03, 0x01, "4" }, - {0x0E, 0x01, 0x03, 0x02, "5" }, - {0x0E, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xFE, 0 , 2, "Coinage" }, - {0x0E, 0x01, 0x1C, 0x00, "1 Coin 1 Credit" }, - {0x0E, 0x01, 0x1C, 0x1C, "Free Play" }, - - {0 , 0xFE, 0 , 2, "Bonus Life" }, - {0x0E, 0x01, 0x20, 0x00, "20000 50000" }, - {0x0E, 0x01, 0x20, 0x20, "40000 70000" }, - - {0 , 0xFE, 0 , 2, "Cabinet" }, - {0x0E, 0x01, 0x40, 0x40, "Upright" }, - {0x0E, 0x01, 0x40, 0x00, "Cocktail" }, - -}; - -STDDIPINFO(Marineb) - -static struct BurnInputInfo ChangesInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvInputPort2 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvInputPort0 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvInputPort0 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvInputPort0 + 6, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvInputPort0 + 7, "p1 right" }, - - {"P2 Start", BIT_DIGITAL, DrvInputPort2 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvInputPort1 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvInputPort1 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvInputPort1 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvInputPort1 + 7, "p2 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, &DrvDip, "dip"}, -}; - -STDINPUTINFO(Changes) - - -static struct BurnDIPInfo ChangesDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0c, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x0c, 0x01, 0x0c, 0x0c, "Free Play" }, - - {0 , 0xfe, 0 , 2, "1st Bonus Life" }, - {0x0c, 0x01, 0x10, 0x00, "20000" }, - {0x0c, 0x01, 0x10, 0x10, "40000" }, - - {0 , 0xfe, 0 , 2, "2nd Bonus Life" }, - {0x0c, 0x01, 0x20, 0x00, "50000" }, - {0x0c, 0x01, 0x20, 0x20, "100000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0c, 0x01, 0x40, 0x40, "Upright" }, - {0x0c, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0c, 0x01, 0x80, 0x00, "Off" }, - {0x0c, 0x01, 0x80, 0x80, "On" }, -}; - -static struct BurnInputInfo HoccerInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 right" }, - {"P1 Fire" , BIT_DIGITAL , DrvInputPort2 + 4, "p1 fire 1" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 right" }, - {"P2 Fire" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, &DrvDip, "dip"}, -}; - -STDINPUTINFO(Hoccer) - - -static struct BurnDIPInfo HoccerDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x01, 0x00, "Upright" }, - {0x0f, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x00, "Off" }, - {0x0f, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Unknown" }, - {0x0f, 0x01, 0x0c, 0x00, "0" }, - {0x0f, 0x01, 0x0c, 0x04, "1" }, - {0x0f, 0x01, 0x0c, 0x08, "2" }, - {0x0f, 0x01, 0x0c, 0x0c, "3" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x00, "3" }, - {0x0f, 0x01, 0x30, 0x10, "4" }, - {0x0f, 0x01, 0x30, 0x20, "5" }, - {0x0f, 0x01, 0x30, 0x30, "6" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0f, 0x01, 0xc0, 0xc0, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Hoccer) - -static struct BurnInputInfo WantedInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 right" }, - {"P1 Fire" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 1" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 6, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 right" }, - {"P2 Fire" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, &DrvDip, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 2, "dip"}, -}; - -STDINPUTINFO(Wanted) - - -static struct BurnDIPInfo WantedDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x30, NULL }, - {0x10, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x03, 0x00, "3" }, - {0x0f, 0x01, 0x03, 0x01, "4" }, - {0x0f, 0x01, 0x03, 0x02, "5" }, - {0x0f, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0f, 0x01, 0x04, 0x00, "Off" }, - {0x0f, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x20, 0x20, "Upright" }, - {0x0f, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0f, 0x01, 0x80, 0x00, "Off" }, - {0x0f, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x01, 0x00, "Off" }, - {0x10, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x08, 0x00, "Off" }, - {0x10, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x10, 0x01, 0xf0, 0x40, "A 3C/1C B 3C/1C" }, - {0x10, 0x01, 0xf0, 0xe0, "A 3C/1C B 1C/2C" }, - {0x10, 0x01, 0xf0, 0xf0, "A 3C/1C B 1C/4C" }, - {0x10, 0x01, 0xf0, 0x20, "A 2C/1C B 2C/1C" }, - {0x10, 0x01, 0xf0, 0xd0, "A 2C/1C B 1C/1C" }, - {0x10, 0x01, 0xf0, 0x70, "A 2C/1C B 1C/3C" }, - {0x10, 0x01, 0xf0, 0xb0, "A 2C/1C B 1C/5C" }, - {0x10, 0x01, 0xf0, 0xc0, "A 2C/1C B 1C/6C" }, - {0x10, 0x01, 0xf0, 0x60, "A 1C/1C B 4C/1C" }, - {0x10, 0x01, 0xf0, 0x50, "A 1C/1C B 2C/1C" }, - {0x10, 0x01, 0xf0, 0x10, "A 1C/1C B 1C/1C" }, - {0x10, 0x01, 0xf0, 0x30, "A 1C/2C B 1C/2C" }, - {0x10, 0x01, 0xf0, 0xa0, "A 1C/1C B 1C/3C" }, - {0x10, 0x01, 0xf0, 0x80, "A 1C/1C B 1C/5C" }, - {0x10, 0x01, 0xf0, 0x90, "A 1C/1C B 1C/6C" }, - {0x10, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Wanted) - -static struct BurnInputInfo Bcruzm12InputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 right" }, - {"P1 Fire" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 1" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort0 + 6, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 right" }, - {"P2 Fire" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, &DrvDip, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 2, "dip"}, -}; - -STDINPUTINFO(Bcruzm12) - - -static struct BurnDIPInfo Bcruzm12DIPList[]= -{ - {0x0f, 0xff, 0xff, 0xfc, NULL }, - {0x10, 0xff, 0xff, 0x15, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x03, 0x00, "3" }, - {0x0f, 0x01, 0x03, 0x01, "4" }, - {0x0f, 0x01, 0x03, 0x02, "5" }, - {0x0f, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0f, 0x01, 0x0c, 0x0c, "Off" }, - {0x0f, 0x01, 0x0c, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x20, 0x20, "Upright" }, - {0x0f, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "2nd Bonus Life" }, - {0x10, 0x01, 0x03, 0x00, "None" }, - {0x10, 0x01, 0x03, 0x01, "60000" }, - {0x10, 0x01, 0x03, 0x02, "80000" }, - {0x10, 0x01, 0x03, 0x03, "100000" }, - - {0 , 0xfe, 0 , 4, "1st Bonus Life" }, - {0x10, 0x01, 0x0c, 0x00, "None" }, - {0x10, 0x01, 0x0c, 0x04, "30000" }, - {0x10, 0x01, 0x0c, 0x08, "40000" }, - {0x10, 0x01, 0x0c, 0x0c, "50000" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x10, 0x01, 0xf0, 0x40, "A 3C/1C B 3C/1C" }, - {0x10, 0x01, 0xf0, 0xe0, "A 3C/1C B 1C/2C" }, - {0x10, 0x01, 0xf0, 0xf0, "A 3C/1C B 1C/4C" }, - {0x10, 0x01, 0xf0, 0x20, "A 2C/1C B 2C/1C" }, - {0x10, 0x01, 0xf0, 0xd0, "A 2C/1C B 1C/1C" }, - {0x10, 0x01, 0xf0, 0x70, "A 2C/1C B 1C/3C" }, - {0x10, 0x01, 0xf0, 0xb0, "A 2C/1C B 1C/5C" }, - {0x10, 0x01, 0xf0, 0xc0, "A 2C/1C B 1C/6C" }, - {0x10, 0x01, 0xf0, 0x60, "A 1C/1C B 4C/5C" }, - {0x10, 0x01, 0xf0, 0x50, "A 1C/1C B 2C/3C" }, - {0x10, 0x01, 0xf0, 0x10, "A 1C/1C B 1C/1C" }, - {0x10, 0x01, 0xf0, 0x30, "A 1C/2C B 1C/2C" }, - {0x10, 0x01, 0xf0, 0xa0, "A 1C/1C B 1C/3C" }, - {0x10, 0x01, 0xf0, 0x80, "A 1C/1C B 1C/5C" }, - {0x10, 0x01, 0xf0, 0x90, "A 1C/1C B 1C/6C" }, - {0x10, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Bcruzm12) - - -STDDIPINFO(Changes) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x10000; - DrvColPROM = Next; Next += 0x200; - DrvGfxROM0 = Next; Next += 1024 * 8 * 8; - DrvGfxROM1 = Next; Next += 64*2 * 16 * 16; - DrvGfxROM2 = Next; Next += 64*2 * 32 * 32; - - DrvPalette = (UINT32*)Next; Next += 0x100 * sizeof(UINT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - RamStart = Next; - - DrvZ80RAM = Next; Next += 0x800; - DrvVidRAM = Next; Next += 0x400; - DrvSprRAM = Next; Next += 0x100; - DrvColRAM = Next; Next += 0x400; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void CleanAndInitStuff() -{ - DrvPaletteBank = 0; - DrvColumnScroll = 0; - DrvFlipScreenY = 0; - DrvFlipScreenX = 0; - DrvInterruptEnable = 0; - hardware = 0; - ActiveLowFlipscreen = 0; - - memset(DrvInputPort0, 0, 8); - memset(DrvInputPort1, 0, 8); - memset(DrvInputPort2, 0, 8); - memset(DrvInput, 0, 3); - - DrvDip = 0; - DrvReset = 0; -} - - -UINT8 __fastcall marineb_read(UINT16 address) -{ - switch (address) { - case 0xa800: - return DrvInput[0]; - - case 0xa000: - return DrvInput[1]; - - case 0xb000: - return DrvDip; - - case 0xb800: - return DrvInput[2]; - } - - return 0; -} - - -void __fastcall marineb_write(UINT16 address, UINT8 data) -{ - switch (address) { - - case 0x9800: - DrvColumnScroll = data; - return; - - case 0x9a00: - DrvPaletteBank = (DrvPaletteBank & 0x02) | (data & 0x01); - return; - - case 0x9c00: - DrvPaletteBank = (DrvPaletteBank & 0x01) | ((data & 0x01) << 1); - return; - - - case 0xa000: - DrvInterruptEnable = data & 1; - return; - - case 0xa001: - DrvFlipScreenY = data ^ ActiveLowFlipscreen; - return; - - case 0xa002: - DrvFlipScreenX = data ^ ActiveLowFlipscreen; - return; - } -} - -void __fastcall marineb_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xFF) { - case 0x00: - case 0x01: - case 0x08: - case 0x09: - AY8910Write(0, port & 1, data); - break; - case 0x02: - case 0x03: - AY8910Write(1, port & 1, data); - break; - } -} - -static INT32 DrvDoReset() -{ - memset (RamStart, 0, RamEnd - RamStart); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - DrvPaletteBank = 0; - DrvColumnScroll = 0; - DrvFlipScreenY = 0; - DrvFlipScreenX = 0; - DrvInterruptEnable = 0; - - return 0; -} - -static void DrvCreatePalette() -{ - for (INT32 i = 0; i < 256; i++) - { - INT32 bit0, bit1, bit2, r, g, b; - - // Red - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - // Green - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i + 256] >> 0) & 0x01; - bit2 = (DrvColPROM[i + 256] >> 1) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - // Blue - bit0 = 0; - bit1 = (DrvColPROM[i + 256] >> 2) & 0x01; - bit2 = (DrvColPROM[i + 256] >> 3) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - - -static INT32 MarinebCharPlane[2] = { 0, 4 }; -static INT32 MarinebCharXOffs[8] = { 0, 1, 2, 3, 64, 65, 66, 67 }; -static INT32 MarinebCharYOffs[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - -static INT32 WantedCharPlane[2] = { 4, 0 }; -static INT32 WantedCharXOffs[8] = { 0, 1, 2, 3, 64, 65, 66, 67 }; -static INT32 WantedCharYOffs[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - -static INT32 MarinebSmallSpriteCharPlane[2] = { 0, 65536 }; -static INT32 MarinebSmallSpriteXOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71 }; -static INT32 MarinebSmallSpriteYOffs[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 128, 136, 144, 152, 160, 168, 176, 184 }; - -static INT32 MarinebBigSpriteCharPlane[2] = { 0, 65536 }; -static INT32 MarinebBigSpriteXOffs[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71, 256, 257, 258, 259, 260, 261, 262, 263, 320, 321, 322, 323, 324, 325, 326, 327 }; -static INT32 MarinebBigSpriteYOffs[32] = { 0, 8, 16, 24, 32, 40, 48, 56, 128, 136, 144, 152, 160, 168, 176, 184, 512, 520, 528, 536, 544, 552, 560, 568, 640, 648, 656, 664, 672, 680, 688, 696 }; - -static INT32 ChangesSmallSpriteCharPlane[2] = { 0, 4 }; -static INT32 ChangesSmallSpriteXOffs[16] = { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 }; -static INT32 ChangesSmallSpriteYOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 }; - -static INT32 ChangesBigSpriteCharPlane[2] = { 0, 4 }; -static INT32 ChangesBigSpriteXOffs[32] = { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3, 64*8+0, 64*8+1, 64*8+2, 64*8+3, 72*8+0, 72*8+1, 72*8+2, 72*8+3, 80*8+0, 80*8+1, 80*8+2, 80*8+3, 88*8+0, 88*8+1, 88*8+2, 88*8+3 }; -static INT32 ChangesBigSpriteYOffs[32] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8, 128*8, 129*8, 130*8, 131*8, 132*8, 133*8, 134*8, 135*8, 160*8, 161*8, 162*8, 163*8, 164*8, 165*8, 166*8, 167*8 }; - -static INT32 MarinebLoadRoms() -{ - // Load roms - - // Z80 - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvZ80ROM + (i * 0x1000), i, 1)) return 1; - } - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) return 1; - - // Chars - memset(tmp, 0, 0x2000); - if (BurnLoadRom(tmp, 5, 1)) return 1; - GfxDecode(0x200, 2, 8, 8, MarinebCharPlane, MarinebCharXOffs, MarinebCharYOffs, 0x80, tmp, DrvGfxROM0); - - // Sprites - memset(tmp, 0, 0x4000); - if (BurnLoadRom(tmp, 6, 1)) return 1; - if (BurnLoadRom(tmp + 0x2000, 7, 1)) return 1; - - // Small Sprites - GfxDecode(0x40, 2, 16, 16, MarinebSmallSpriteCharPlane, MarinebSmallSpriteXOffs, MarinebSmallSpriteYOffs, 0x100, tmp, DrvGfxROM1); - - // Big Sprites - GfxDecode(0x40, 2, 32, 32, MarinebBigSpriteCharPlane, MarinebBigSpriteXOffs, MarinebBigSpriteYOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree(tmp); - - // ColorRoms - if (BurnLoadRom(DrvColPROM, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x100, 9, 1)) return 1; - - return 0; -} - -static INT32 ChangesLoadRoms() -{ - // Load roms - - // Z80 - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvZ80ROM + (i * 0x1000), i, 1)) return 1; - } - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) return 1; - - // Chars - memset(tmp, 0, 0x2000); - if (BurnLoadRom(tmp, 5, 1)) return 1; - GfxDecode(0x200, 2, 8, 8, MarinebCharPlane, MarinebCharXOffs, MarinebCharYOffs, 0x80, tmp, DrvGfxROM0); - - // Sprites - memset(tmp, 0, 0x4000); - if (BurnLoadRom(tmp, 6, 1)) return 1; - - // Small Sprites - GfxDecode(0x40, 2, 16, 16, ChangesSmallSpriteCharPlane, ChangesSmallSpriteXOffs, ChangesSmallSpriteYOffs, 0x200, tmp, DrvGfxROM1); - - // Big Sprites - GfxDecode(0xf, 2, 32, 32, ChangesBigSpriteCharPlane, ChangesBigSpriteXOffs, ChangesBigSpriteYOffs, 0x800, tmp + 0x1000, DrvGfxROM2); - - BurnFree(tmp); - - // ColorRoms - if (BurnLoadRom(DrvColPROM, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x100, 8, 1)) return 1; - - return 0; -} - -static INT32 HoccerLoadRoms() -{ - // Load roms - - // Z80 - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvZ80ROM + (i * 0x2000), i, 1)) return 1; - } - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) return 1; - - // Chars - memset(tmp, 0, 0x2000); - if (BurnLoadRom(tmp, 4, 1)) return 1; - GfxDecode(0x200, 2, 8, 8, MarinebCharPlane, MarinebCharXOffs, MarinebCharYOffs, 0x80, tmp, DrvGfxROM0); - - // Sprites - memset(tmp, 0, 0x4000); - if (BurnLoadRom(tmp, 5, 1)) return 1; - - // Small Sprites - GfxDecode(0x40, 2, 16, 16, ChangesSmallSpriteCharPlane, ChangesSmallSpriteXOffs, ChangesSmallSpriteYOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - // ColorRoms - if (BurnLoadRom(DrvColPROM, 6, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x100, 7, 1)) return 1; - - return 0; -} - -static INT32 WantedLoadRoms() -{ - // Load roms - - // Z80 - for (INT32 i = 0; i < 3; i++) { - if (BurnLoadRom(DrvZ80ROM + (i * 0x2000), i, 1)) return 1; - } - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) return 1; - - // Chars - memset(tmp, 0, 0x4000); - if (BurnLoadRom(tmp, 3, 1)) return 1; - if (BurnLoadRom(tmp + 0x2000, 4, 1)) return 1; - GfxDecode(0x400, 2, 8, 8, WantedCharPlane, WantedCharXOffs, WantedCharYOffs, 0x80, tmp, DrvGfxROM0); - - // Sprites - memset(tmp, 0, 0x4000); - if (BurnLoadRom(tmp, 5, 1)) return 1; - if (BurnLoadRom(tmp + 0x2000, 6, 1)) return 1; - - // Small Sprites - GfxDecode(0x40, 2, 16, 16, MarinebSmallSpriteCharPlane, MarinebSmallSpriteXOffs, MarinebSmallSpriteYOffs, 0x100, tmp, DrvGfxROM1); - - // Big Sprites - GfxDecode(0x40, 2, 32, 32, MarinebBigSpriteCharPlane, MarinebBigSpriteXOffs, MarinebBigSpriteYOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree(tmp); - - // ColorRoms - if (BurnLoadRom(DrvColPROM, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x100, 8, 1)) return 1; - - return 0; -} - -static INT32 SpringerLoadRoms() -{ - // Load roms - - // Z80 - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvZ80ROM + (i * 0x1000), i, 1)) return 1; - } - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) return 1; - - // Chars - memset(tmp, 0, 0x4000); - if (BurnLoadRom(tmp, 5, 1)) return 1; - if (BurnLoadRom(tmp + 0x1000, 6, 1)) return 1; - - GfxDecode(0x200, 2, 8, 8, MarinebCharPlane, MarinebCharXOffs, MarinebCharYOffs, 0x80, tmp, DrvGfxROM0); - - memset(tmp, 0, 0x4000); - if (BurnLoadRom(tmp, 7, 1)) return 1; - if (BurnLoadRom(tmp + 0x2000, 8, 1)) return 1; - - // Small Sprites - GfxDecode(0x40, 2, 16, 16, MarinebSmallSpriteCharPlane, MarinebSmallSpriteXOffs, MarinebSmallSpriteYOffs, 0x100, tmp, DrvGfxROM1); - // Big Sprites - GfxDecode(0x40, 2, 32, 32, MarinebBigSpriteCharPlane, MarinebBigSpriteXOffs, MarinebBigSpriteYOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree(tmp); - - // ColorRoms - if (BurnLoadRom(DrvColPROM, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x100, 10, 1)) return 1; - - return 0; -} - -static INT32 HopproboLoadRoms() -{ - // Load roms - - // Z80 - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvZ80ROM + (i * 0x1000), i, 1)) return 1; - } - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) return 1; - - // Chars - memset(tmp, 0, 0x4000); - if (BurnLoadRom(tmp, 5, 1)) return 1; - if (BurnLoadRom(tmp + 0x2000, 6, 1)) return 1; - if (BurnLoadRom(tmp + 0x3000, 6, 1)) return 1; - - GfxDecode(0x400, 2, 8, 8, MarinebCharPlane, MarinebCharXOffs, MarinebCharYOffs, 0x80, tmp, DrvGfxROM0); - - memset(tmp, 0, 0x4000); - if (BurnLoadRom(tmp, 7, 1)) return 1; - if (BurnLoadRom(tmp + 0x2000, 8, 1)) return 1; - - // Small Sprites - GfxDecode(0x40, 2, 16, 16, MarinebSmallSpriteCharPlane, MarinebSmallSpriteXOffs, MarinebSmallSpriteYOffs, 0x100, tmp, DrvGfxROM1); - // Big Sprites - GfxDecode(0x40, 2, 32, 32, MarinebBigSpriteCharPlane, MarinebBigSpriteXOffs, MarinebBigSpriteYOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree(tmp); - - // ColorRoms - if (BurnLoadRom(DrvColPROM, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x100, 10, 1)) return 1; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - switch(hardware) { - case MARINEB: - MarinebLoadRoms(); - break; - case SPRINGER: - SpringerLoadRoms(); - break; - case HOPPROBO: - HopproboLoadRoms(); - break; - case CHANGES: - ChangesLoadRoms(); - break; - case HOCCER: - HoccerLoadRoms(); - break; - case WANTED: - WantedLoadRoms(); - break; - case BCRUZM12: - WantedLoadRoms(); - break; - } - - DrvCreatePalette(); - - ZetInit(0); - ZetOpen(0); - - ZetMapArea (0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea (0x0000, 0x7fff, 2, DrvZ80ROM); - - ZetMapArea (0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea (0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea (0x8000, 0x87ff, 2, DrvZ80RAM); - - ZetMapArea (0x8800, 0x8bff, 0, DrvVidRAM); - ZetMapArea (0x8800, 0x8bff, 1, DrvVidRAM); - ZetMapArea (0x8800, 0x8bff, 2, DrvVidRAM); - - ZetMapArea (0x8c00, 0x8c3f, 0, DrvSprRAM); - ZetMapArea (0x8c00, 0x8c3f, 1, DrvSprRAM); - ZetMapArea (0x8c00, 0x8c3f, 2, DrvSprRAM); - - ZetMapArea (0x9000, 0x93ff, 0, DrvColRAM); - ZetMapArea (0x9000, 0x93ff, 1, DrvColRAM); - ZetMapArea (0x9000, 0x93ff, 2, DrvColRAM); - - ZetSetReadHandler(marineb_read); - ZetSetWriteHandler(marineb_write); - ZetSetOutHandler(marineb_write_port); - - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - DrvDoReset(); - - return 0; - -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - - BurnFree (AllMem); - - CleanAndInitStuff(); - - return 0; -} - -static void RenderMarinebBg() -{ - INT32 TileIndex = 0; - - for (INT32 my = 0; my < 32; my++) { - for (INT32 mx = 0; mx < 32; mx++) { - - TileIndex = (my * 32) + mx; - - INT32 code = DrvVidRAM[TileIndex]; - INT32 color = DrvColRAM[TileIndex]; - - INT32 flipx = (color >> 4) & 0x02; - INT32 flipy = (color >> 4) & 0x01; - - /*if (hardware == MARINEB) { - flipx = 0; - flipy = 0; - }*/ - - code = (code | ((color & 0xc0) << 2)) & 0x1ff; - color = ((color & 0x0f) | (DrvPaletteBank << 4)) & 0xff; - - - INT32 x = mx << 3; - INT32 y = my << 3; - - // stuff from 192 to 256 does not scroll - if (((hardware == MARINEB) && (x >> 3) < 24) || ((hardware == CHANGES) && (x >> 3) < 26)) { - y -= DrvColumnScroll; - if (y < -7) y += 256; - } - - y -= 16; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } - } - } - } -} - -static void RenderSpringerBg() -{ - INT32 TileIndex = 0; - - for (INT32 my = 0; my < 32; my++) { - for (INT32 mx = 0; mx < 32; mx++) { - - TileIndex = (my * 32) + mx; - - INT32 code = DrvVidRAM[TileIndex]; - INT32 color = DrvColRAM[TileIndex]; - - INT32 flipx = (color >> 4) & 0x02; - INT32 flipy = (color >> 4) & 0x01; - - code |= ((color & 0xc0) << 2); - - color &= 0x0f; - color |= DrvPaletteBank << 4; - - INT32 x = mx << 3; - INT32 y = my << 3; - - y -= 16; // remove garbage on left side - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } - } - } - } -} - -static void RenderBcruz12mBg() -{ - INT32 TileIndex = 0; - - for (INT32 my = 0; my < 32; my++) { - for (INT32 mx = 0; mx < 32; mx++) { - - TileIndex = (my * 32) + mx; - - INT32 code = DrvVidRAM[TileIndex]; - INT32 color = DrvColRAM[TileIndex]; - - INT32 flipx = (color >> 4) & 0x02; - INT32 flipy = (color >> 4) & 0x01; - - code |= ((color & 0xc0) << 2); - - color &= 0x0f; - color |= DrvPaletteBank << 4; - - INT32 x = mx << 3; - INT32 y = my << 3; - - y -= 16; // remove garbage on left side - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } - } - } - } -} - -static void RenderWantedBg() -{ - for (INT32 offs = 0x3ff; offs >= 0; offs--) { - INT32 sx,sy,flipx,flipy,x,y; - sx = offs % 32; - sy = offs / 32; - - flipx = DrvColRAM[offs] & 0x20; - flipy = DrvColRAM[offs] & 0x10; - INT32 code = DrvVidRAM[offs] | ((DrvColRAM[offs] & 0xc0) << 2); - INT32 color = (DrvColRAM[offs] & 0x0f) + 16 * DrvPaletteBank; - - if (DrvFlipScreenY) - { - sy = 31 - sy; - flipy = !flipy; - } - - if (DrvFlipScreenX) - { - sx = 31 - sx; - flipx = !flipx; - } - x = 8*sx; - y = 8*sy; - y -=16; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, x, y, color, 2, 0, DrvGfxROM0); - } - } - } -} - -static void MarinebDrawSprites() -{ - // Render Tiles - RenderMarinebBg(); - - for (INT32 offs = 0x0f; offs >= 0; offs--) { - - INT32 gfx, sx, sy, code, color, flipx, flipy, offs2; - - if ((offs == 0) || (offs == 2)) - continue; - - if (offs < 8) { - offs2 = 0x0018 + offs; - } else { - offs2 = 0x03d8 - 8 + offs; - } - - code = DrvVidRAM[offs2]; - sx = DrvVidRAM[offs2 + 0x20]; - sy = DrvColRAM[offs2]; - color = (DrvColRAM[offs2 + 0x20] & 0x0f) + 16 * DrvPaletteBank; - flipx = code & 0x02; - flipy = !(code & 0x01); - - if (offs < 4) { - gfx = 2; - code = (code >> 4) | ((code & 0x0c) << 2); - } else { - gfx = 1; - code >>= 2; - } - - if (!DrvFlipScreenY) { - - if (gfx == 1) { - sy = 256 - 16 - sy; - } else { - sy = 256 - 32 - sy; - } - flipy = !flipy; - } - - if (DrvFlipScreenX) { - sx++; - } - - sy -= 16; // proper alignement - - // Small Sprites - if (gfx == 1) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } - // Big sprites - } else { - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } - } - } -} - -static void ChangesDrawSprites() -{ - INT32 sx, sy, code, color, flipx, flipy, offs2; - // Render Tiles - RenderMarinebBg(); - - for (INT32 offs = 0x05; offs >= 0; offs--) { - offs2 = 0x001a + offs; - - code = DrvVidRAM[offs2]; - sx = DrvVidRAM[offs2 + 0x20]; - sy = DrvColRAM[offs2]; - color = ((DrvColRAM[offs2 + 0x20] & 0x0f) + 16 * DrvPaletteBank) & 0xff; - flipx = (code & 0x02); - flipy = !(code & 0x01); - - if (!DrvFlipScreenY) { - sy = 256 - 16 - sy; - flipy = !flipy; - } - - if (DrvFlipScreenX) { - sx++; - } - - sy -= 16; // proper alignement - code >>= 2 & 0x3f; - - // Small Sprites - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } - } - - code = DrvVidRAM[0x3df]; - sx = DrvVidRAM[0x3ff]; - sy = DrvColRAM[0x3df]; - color = DrvColRAM[0x3ff] & 0xff; - flipx = (code & 0x02); - flipy = !(code & 0x01); - - if (!DrvFlipScreenY) { - sy = 256 - 32 - sy; - flipy = !flipy; - } - - if (DrvFlipScreenX) { - sx++; - } - - code >>= 4 & 0xf; - - sy -= 16; // proper alignement - - // THE Big sprite - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx-256, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx-256, sy, color, 2, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx-256, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_Clip(pTransDraw, code, sx-256, sy, color, 2, 0, 0, DrvGfxROM2); - } - } -} - -static void HoccerDrawSprites() -{ - INT32 sx, sy, code, color, flipx, flipy, offs2; - // Render Tiles - RenderMarinebBg(); - - for (INT32 offs = 0x07; offs >= 0; offs--) { - offs2 = 0x0018 + offs; - - code = DrvSprRAM[offs2]; - sx = DrvSprRAM[offs2 + 0x20]; - sy = DrvColRAM[offs2]; - color = (DrvColRAM[offs2 + 0x20] & 0xff); - flipx = (code & 0x02); - flipy = !(code & 0x01); - - if (!DrvFlipScreenY) { - sy = 256 - 16 - sy; - flipy = !flipy; - } - - if (DrvFlipScreenX) { - sx = 256 - 16 - sx; - flipx = !flipx; - } - - sy -= 16; // proper alignement - code >>= 2 & 0x3f; - - // Small Sprites - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } - } -} - -static void SpringerDrawSprites() -{ - // Render Tiles - RenderSpringerBg(); - - for (INT32 offs = 0x0f; offs >= 0; offs--) - { - INT32 gfx, sx, sy, code, color, flipx, flipy, offs2; - - if ((offs == 0) || (offs == 2)) - continue; - - offs2 = 0x0010 + offs; - - code = DrvVidRAM[offs2]; - sx = 240 - DrvVidRAM[offs2 + 0x20]; - sy = DrvColRAM[offs2]; - color = (DrvColRAM[offs2 + 0x20] & 0x0f) + 16 * DrvPaletteBank; - flipx = !(code & 0x02); - flipy = !(code & 0x01); - - if (offs < 4) - { - sx -= 0x10; - gfx = 2; - code = (code >> 4) | ((code & 0x0c) << 2); - } - else - { - gfx = 1; - code >>= 2; - } - - if (((hardware == SPRINGER) && !DrvFlipScreenY) || (((hardware == HOPPROBO) || (hardware == BCRUZM12)) && DrvFlipScreenY)) { - - if (gfx == 1) { - sy = 256 - 16 - sy; - } else { - sy = 256 - 32 - sy; - } - flipy = !flipy; - } - - if (!DrvFlipScreenX) - { - sx--; - } - - sy -= 16; // proper alignement - - // Small Sprites - if (gfx == 1) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } - // Big Sprites - } else { - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } - } - } -} - -static void Bcruz12mDrawSprites() -{ - // Render Tiles - RenderBcruz12mBg(); - - for (INT32 offs = 0x0f; offs >= 0; offs--) - { - INT32 gfx, sx, sy, code, color, flipx, flipy, offs2; - - if ((offs == 0) || (offs == 2)) - continue; - - offs2 = 0x0010 + offs; - - code = DrvVidRAM[offs2]; - sx = /*240 - */DrvVidRAM[offs2 + 0x20]; - sy = DrvColRAM[offs2]; - color = (DrvColRAM[offs2 + 0x20] & 0x0f) + 16 * DrvPaletteBank; - flipx = (code & 0x02); - flipy = !(code & 0x01); - - if (offs < 4) - { - //sx -= 0x10; - gfx = 2; - code = (code >> 4) | ((code & 0x0c) << 2); - } - else - { - gfx = 1; - code >>= 2; - } - - if (!DrvFlipScreenY) { - - if (gfx == 1) { - sy = 256 - 16 - sy; - } else { - sy = 256 - 32 - sy; - } - flipy = !flipy; - } - - if (!DrvFlipScreenX) - { - sx--; - } - - sy -= 16; // proper alignement - - // Small Sprites - if (gfx == 1) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } - // Big Sprites - } else { - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } - } - } -} - -static void WantedDrawSprites() -{ - // Render Tiles - RenderWantedBg(); - - for (INT32 offs = 0x0f; offs >= 0; offs--) - { - INT32 gfx, sx, sy, code, color, flipx, flipy, offs2; - - if ((offs == 0) || (offs == 2)) - continue; - - offs2 = 0x0010 + offs; - - code = DrvVidRAM[offs2]; - sx = DrvVidRAM[offs2 + 0x20]; - sy = DrvColRAM[offs2]; - color = (DrvColRAM[offs2 + 0x20] & 0x0f) + 16 * DrvPaletteBank; - flipx = (code & 0x02); - flipy = !(code & 0x01); - - if (offs < 4) - { - gfx = 2; - code = (code >> 4) | ((code & 0x0c) << 2); - } - else - { - gfx = 1; - code >>= 2; - } - - if (!DrvFlipScreenY) { - - if (gfx == 1) { - sy = 256 - 16 - sy; - } else { - sy = 256 - 32 - sy; - } - flipy = !flipy; - } - - if (DrvFlipScreenX) - { - if (gfx == 1) { - sx = 256 - 16 - sx; - } else { - sx = 256 - 32 - sx; - } - flipx = !flipx; - sx--; - } else { - if (sx >= 240) continue; // don't draw sprites in the statusbar - } - - - - sy -= 16; // proper alignement - - // Small Sprites - if (gfx == 1) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } - // Big Sprites - } else { - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalcPalette) { - DrvCreatePalette(); - DrvRecalcPalette = 0; - } - BurnTransferClear(); - switch(hardware) { - case CHANGES: - ChangesDrawSprites(); - break; - - case HOCCER: - HoccerDrawSprites(); - break; - - case MARINEB: - MarinebDrawSprites(); - break; - - case BCRUZM12: - Bcruz12mDrawSprites(); - break; - - case WANTED: - WantedDrawSprites(); - break; - - case SPRINGER: - case HOPPROBO: - SpringerDrawSprites(); - break; - } - - BurnTransferCopy(DrvPalette); - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvInput[0] = DrvInput[1] = 0; - if (hardware != WANTED && hardware != BCRUZM12) - DrvInput[2] = 0; - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - if (hardware != WANTED && hardware != BCRUZM12) - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - INT32 nInterleave = 256; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - ZetRun(3072000 / 60 / nInterleave); - - if (i == nInterleave - 1) { - if (DrvInterruptEnable) { - switch (hardware) { - case WANTED: - case BCRUZM12: - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - break; - default: - ZetNmi(); - break; - } - } - } - } - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029736; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(DrvPaletteBank); - SCAN_VAR(DrvColumnScroll); - SCAN_VAR(DrvFlipScreenY); - SCAN_VAR(DrvFlipScreenX); - SCAN_VAR(DrvInterruptEnable); - } - - return 0; -} - -static INT32 MarinebInit() -{ - CleanAndInitStuff(); - hardware = MARINEB; - - return DrvInit(); -} - -static INT32 SpringerInit() -{ - CleanAndInitStuff(); - - ActiveLowFlipscreen = 1; - hardware = SPRINGER; - - return DrvInit(); -} - -static INT32 hopproboInit() -{ - CleanAndInitStuff(); - - hardware = HOPPROBO; - - return DrvInit(); -} - -static INT32 changesInit() -{ - CleanAndInitStuff(); - - hardware = CHANGES; - - return DrvInit(); -} - -static INT32 hoccerInit() -{ - CleanAndInitStuff(); - - hardware = HOCCER; - - return DrvInit(); -} - -static INT32 wantedInit() -{ - CleanAndInitStuff(); - - ActiveLowFlipscreen = 1; - hardware = WANTED; - - return DrvInit(); -} - -static INT32 bcruzm12Init() -{ - CleanAndInitStuff(); - - hardware = BCRUZM12; - - return DrvInit(); -} - -// Marine Boy - -static struct BurnRomInfo MarinebRomDesc[] = { - - { "marineb.1", 0x1000, 0x661d6540, BRF_ESS | BRF_PRG }, // 0 maincpu - { "marineb.2", 0x1000, 0x922da17f, BRF_ESS | BRF_PRG }, // 1 - { "marineb.3", 0x1000, 0x820a235b, BRF_ESS | BRF_PRG }, // 2 - { "marineb.4", 0x1000, 0xa157a283, BRF_ESS | BRF_PRG }, // 3 - { "marineb.5", 0x1000, 0x9ffff9c0, BRF_ESS | BRF_PRG }, // 4 - - { "marineb.6", 0x2000, 0xee53ec2e, BRF_GRA }, // 5 gfx1 - - { "marineb.8", 0x2000, 0xdc8bc46c, BRF_GRA }, // 6 gfx2 - { "marineb.7", 0x2000, 0x9d2e19ab, BRF_GRA }, // 7 - - { "marineb.1b", 0x100, 0xf32d9472, BRF_GRA }, // 8 proms - { "marineb.1c", 0x100, 0x93c69d3e, BRF_GRA }, // 9 -}; - -STD_ROM_PICK(Marineb) -STD_ROM_FN(Marineb) - -struct BurnDriver BurnDrvMarineb = { - "marineb", NULL, NULL, NULL, "1982", - "Marine Boy\0", NULL, "Orca", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, MarinebRomInfo, MarinebRomName, NULL, NULL, MarinebInputInfo, MarinebDIPInfo, - MarinebInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 256, 224, 4, 3 -}; - -// Springer - -static struct BurnRomInfo SpringerRomDesc[] = { - - { "springer.1", 0x1000, 0x0794103a, BRF_ESS | BRF_PRG }, // 0 maincpu - { "springer.2", 0x1000, 0xf4aecd9a, BRF_ESS | BRF_PRG }, // 1 - { "springer.3", 0x1000, 0x2f452371, BRF_ESS | BRF_PRG }, // 2 - { "springer.4", 0x1000, 0x859d1bf5, BRF_ESS | BRF_PRG }, // 3 - { "springer.5", 0x1000, 0x72adbbe3, BRF_ESS | BRF_PRG }, // 4 - - { "springer.6", 0x1000, 0x6a961833, BRF_GRA }, // 5 gfx1 - { "springer.7", 0x1000, 0x95ab8fc0, BRF_GRA }, // 6 - - { "springer.8", 0x1000, 0xa54bafdc, BRF_GRA }, // 7 gfx2 - { "springer.9", 0x1000, 0xfa302775, BRF_GRA }, // 8 - - { "1b.vid", 0x100, 0xa2f935aa, BRF_GRA }, // 9 proms - { "1c.vid", 0x100, 0xb95421f4, BRF_GRA }, // 10 -}; - -STD_ROM_PICK(Springer) -STD_ROM_FN(Springer) - -struct BurnDriver BurnDrvSpringer = { - "springer", NULL, NULL, NULL, "1982", - "Springer\0", NULL, "Orca", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, SpringerRomInfo, SpringerRomName, NULL, NULL, MarinebInputInfo, MarinebDIPInfo, - SpringerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 224, 256, 3, 4 -}; - -// Hopper Robo - -static struct BurnRomInfo hopproboRomDesc[] = { - { "hopper01.3k", 0x1000, 0xfd7935c0, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "hopper02.3l", 0x1000, 0xdf1a479a, 1 | BRF_ESS | BRF_PRG }, // 1 - { "hopper03.3n", 0x1000, 0x097ac2a7, 1 | BRF_ESS | BRF_PRG }, // 2 - { "hopper04.3p", 0x1000, 0x0f4f3ca8, 1 | BRF_ESS | BRF_PRG }, // 3 - { "hopper05.3r", 0x1000, 0x9d77a37b, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "hopper06.5c", 0x2000, 0x68f79bc8, 2 | BRF_GRA }, // 5 gfx1 - { "hopper07.5d", 0x1000, 0x33d82411, 2 | BRF_GRA }, // 6 - - { "hopper09.6k", 0x2000, 0x047921c7, 3 | BRF_GRA }, // 7 gfx2 - { "hopper08.6f", 0x2000, 0x06d37e64, 3 | BRF_GRA }, // 8 - - { "7052hop.1b", 0x0100, 0x94450775, 4 | BRF_GRA }, // 9 proms - { "7052hop.1c", 0x0100, 0xa76bbd51, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(hopprobo) -STD_ROM_FN(hopprobo) - -struct BurnDriver BurnDrvhopprobo = { - "hopprobo", NULL, NULL, NULL, "1983", - "Hopper Robo\0", NULL, "Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, hopproboRomInfo, hopproboRomName, NULL, NULL, MarinebInputInfo, MarinebDIPInfo, - hopproboInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 224, 256, 3, 4 -}; - -// Changes - -static struct BurnRomInfo changesRomDesc[] = { - { "changes.1", 0x1000, 0x56f83813, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "changes.2", 0x1000, 0x0e627f0b, 1 | BRF_ESS | BRF_PRG }, // 1 - { "changes.3", 0x1000, 0xff8291e9, 1 | BRF_ESS | BRF_PRG }, // 2 - { "changes.4", 0x1000, 0xa8e9aa22, 1 | BRF_ESS | BRF_PRG }, // 3 - { "changes.5", 0x1000, 0xf4198e9e, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "changes.7", 0x2000, 0x2204194e, 2 | BRF_GRA }, // 5 gfx1 - - { "changes.6", 0x2000, 0x985c9db4, 3 | BRF_GRA }, // 6 gfx2 - - { "changes.1b", 0x0100, 0xf693c153, 4 | BRF_GRA }, // 7 proms - { "changes.1c", 0x0100, 0xf8331705, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(changes) -STD_ROM_FN(changes) - -struct BurnDriver BurnDrvChanges = { - "changes", NULL, NULL, NULL, "1982", - "Changes\0", NULL, "Orca", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, changesRomInfo, changesRomName, NULL, NULL, ChangesInputInfo, ChangesDIPInfo, - changesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 256, 224, 4, 3 -}; - - -// Changes (EME license) - -static struct BurnRomInfo changesaRomDesc[] = { - { "changes3.1", 0x1000, 0xff80cad7, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "changes.2", 0x1000, 0x0e627f0b, 1 | BRF_ESS | BRF_PRG }, // 1 - { "changes3.3", 0x1000, 0x359bf7e1, 1 | BRF_ESS | BRF_PRG }, // 2 - { "changes.4", 0x1000, 0xa8e9aa22, 1 | BRF_ESS | BRF_PRG }, // 3 - { "changes3.5", 0x1000, 0xc197e64a, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "changes.7", 0x2000, 0x2204194e, 2 | BRF_GRA }, // 5 gfx1 - - { "changes.6", 0x2000, 0x985c9db4, 3 | BRF_GRA }, // 6 gfx2 - - { "changes.1b", 0x0100, 0xf693c153, 4 | BRF_GRA }, // 7 proms - { "changes.1c", 0x0100, 0xf8331705, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(changesa) -STD_ROM_FN(changesa) - -struct BurnDriver BurnDrvChangesa = { - "changesa", "changes", NULL, NULL, "1982", - "Changes (EME license)\0", NULL, "Orca (Eastern Micro Electronics, Inc. license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, changesaRomInfo, changesaRomName, NULL, NULL, ChangesInputInfo, ChangesDIPInfo, - changesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 256, 224, 4, 3 -}; - -// Looper - -static struct BurnRomInfo looperRomDesc[] = { - { "changes.1", 0x1000, 0x56f83813, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "changes.2", 0x1000, 0x0e627f0b, 1 | BRF_ESS | BRF_PRG }, // 1 - { "changes.3", 0x1000, 0xff8291e9, 1 | BRF_ESS | BRF_PRG }, // 2 - { "changes.4", 0x1000, 0xa8e9aa22, 1 | BRF_ESS | BRF_PRG }, // 3 - { "changes.5", 0x1000, 0xf4198e9e, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "looper_7.bin", 0x2000, 0x71a89975, 2 | BRF_GRA }, // 5 gfx1 - - { "looper_6.bin", 0x2000, 0x1f3f70c2, 3 | BRF_GRA }, // 6 gfx2 - - { "changes.1b", 0x0100, 0xf693c153, 4 | BRF_GRA }, // 7 proms - { "changes.1c", 0x0100, 0xf8331705, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(looper) -STD_ROM_FN(looper) - -struct BurnDriver BurnDrvLooper = { - "looper", "changes", NULL, NULL, "1982", - "Looper\0", NULL, "Orca", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, looperRomInfo, looperRomName, NULL, NULL, ChangesInputInfo, ChangesDIPInfo, - changesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 256, 224, 4, 3 -}; - -// Hoccer (set 1) - -static struct BurnRomInfo hoccerRomDesc[] = { - { "hr1.cpu", 0x2000, 0x12e96635, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "hr2.cpu", 0x2000, 0xcf1fc328, 1 | BRF_ESS | BRF_PRG }, // 1 - { "hr3.cpu", 0x2000, 0x048a0659, 1 | BRF_ESS | BRF_PRG }, // 2 - { "hr4.cpu", 0x2000, 0x9a788a2c, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "hr.d", 0x2000, 0xd33aa980, 2 | BRF_GRA }, // 4 gfx1 - - { "hr.c", 0x2000, 0x02808294, 3 | BRF_GRA }, // 5 gfx2 - - { "hr.1b", 0x0100, 0x896521d7, 4 | BRF_GRA }, // 6 proms - { "hr.1c", 0x0100, 0x2efdd70b, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(hoccer) -STD_ROM_FN(hoccer) - -struct BurnDriver BurnDrvHoccer = { - "hoccer", NULL, NULL, NULL, "1983", - "Hoccer (set 1)\0", NULL, "Eastern Micro Electronics, Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, hoccerRomInfo, hoccerRomName, NULL, NULL, HoccerInputInfo, HoccerDIPInfo, - hoccerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 224, 256, 3, 4 -}; - - -// Hoccer (set 2) - -static struct BurnRomInfo hoccer2RomDesc[] = { - { "hr.1", 0x2000, 0x122d159f, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "hr.2", 0x2000, 0x48e1efc0, 1 | BRF_ESS | BRF_PRG }, // 1 - { "hr.3", 0x2000, 0x4e67b0be, 1 | BRF_ESS | BRF_PRG }, // 2 - { "hr.4", 0x2000, 0xd2b44f58, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "hr.d", 0x2000, 0xd33aa980, 2 | BRF_GRA }, // 4 gfx1 - - { "hr.c", 0x2000, 0x02808294, 3 | BRF_GRA }, // 5 gfx2 - - { "hr.1b", 0x0100, 0x896521d7, 4 | BRF_GRA }, // 6 proms - { "hr.1c", 0x0100, 0x2efdd70b, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(hoccer2) -STD_ROM_FN(hoccer2) - -struct BurnDriver BurnDrvHoccer2 = { - "hoccer2", "hoccer", NULL, NULL, "1983", - "Hoccer (set 2)\0", NULL, "Eastern Micro Electronics, Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, hoccer2RomInfo, hoccer2RomName, NULL, NULL, HoccerInputInfo, HoccerDIPInfo, - hoccerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 224, 256, 3, 4 -}; - - -// Wanted - -static struct BurnRomInfo wantedRomDesc[] = { - { "prg-1", 0x2000, 0x2dd90aed, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "prg-2", 0x2000, 0x67ac0210, 1 | BRF_ESS | BRF_PRG }, // 1 - { "prg-3", 0x2000, 0x373c7d82, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "vram-1", 0x2000, 0xc4226e54, 2 | BRF_GRA }, // 3 gfx1 - { "vram-2", 0x2000, 0x2a9b1e36, 2 | BRF_GRA }, // 4 - - { "obj-a", 0x2000, 0x90b60771, 3 | BRF_GRA }, // 5 gfx2 - { "obj-b", 0x2000, 0xe14ee689, 3 | BRF_GRA }, // 6 - - { "wanted.k7", 0x0100, 0x2ba90a00, 4 | BRF_GRA }, // 7 proms - { "wanted.k6", 0x0100, 0xa93d87cc, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(wanted) -STD_ROM_FN(wanted) - -struct BurnDriver BurnDrvWanted = { - "wanted", NULL, NULL, NULL, "1984", - "Wanted\0", NULL, "Sigma Enterprises Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, wantedRomInfo, wantedRomName, NULL, NULL, WantedInputInfo, WantedDIPInfo, - wantedInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 224, 256, 3, 4 -}; - - -// Battle Cruiser M-12 - -static struct BurnRomInfo bcruzm12RomDesc[] = { - { "d-84_3.12c", 0x2000, 0x132baa3d, 1 | BRF_ESS | BRF_PRG }, // 0 maincpu - { "d-84_2.12b", 0x2000, 0x1a788d1f, 1 | BRF_ESS | BRF_PRG }, // 1 - { "d-84_1.12ab", 0x2000, 0x9d5b3017, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "d-84_5.17f", 0x2000, 0x2e963f6a, 2 | BRF_GRA }, // 3 gfx1 - { "d-84_4.17ef", 0x2000, 0xfe186459, 2 | BRF_GRA }, // 4 - - { "d-84_6.17fh", 0x2000, 0x1337dc01, 3 | BRF_GRA }, // 5 gfx2 - { "d-84_7.17h", 0x2000, 0xa5be90ef, 3 | BRF_GRA }, // 6 - - { "bcm12col.7k", 0x0100, 0xbf4f2671, 4 | BRF_GRA }, // 7 proms - { "bcm12col.6k", 0x0100, 0x59f955f6, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(bcruzm12) -STD_ROM_FN(bcruzm12) - -struct BurnDriver BurnDrvBcruzm12 = { - "bcruzm12", NULL, NULL, NULL, "1983", - "Battle Cruiser M-12\0", NULL, "Sigma Enterprises Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, bcruzm12RomInfo, bcruzm12RomName, NULL, NULL, Bcruzm12InputInfo, Bcruzm12DIPInfo, - bcruzm12Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalcPalette, 0x100, 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_mario.cpp b/jan/src/burn/drv/pre90s/d_mario.cpp deleted file mode 100644 index c14aa31d1..000000000 --- a/jan/src/burn/drv/pre90s/d_mario.cpp +++ /dev/null @@ -1,903 +0,0 @@ -// FB Alpha Mario Bros driver module -// Based on MAME driver by Mirko Buffoni - -// todo: -// emulate sound cpu - quite a few sounds are missing! -// - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "samples.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSndRAM; - -static INT16 *pAY8910Buffer[3]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *sample_data; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *interrupt_enable; -static UINT8 *gfxbank; -static UINT8 *palbank; -static UINT8 *scroll; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static INT32 monitor = 0; // monitor type (unused atm) - -static struct BurnInputInfo MarioInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Mario) - -static struct BurnInputInfo MariooInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Marioo) - -static struct BurnDIPInfo MarioDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x80, 0x00, "Off" }, - {0x0b, 0x01, 0x80, 0x01, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0c, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x0c, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0x0c, 0x0c, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x30, 0x00, "20k only" }, - {0x0c, 0x01, 0x30, 0x10, "30k only" }, - {0x0c, 0x01, 0x30, 0x20, "40k only" }, - {0x0c, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x00, "Easy" }, - {0x0c, 0x01, 0xc0, 0x80, "Medium" }, - {0x0c, 0x01, 0xc0, 0x40, "Hard" }, - {0x0c, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Mario) - -static struct BurnDIPInfo MariojDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x80, 0x00, "Off" }, - {0x0b, 0x01, 0x80, 0x01, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0c, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x0c, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x1c, 0x00, "1 Coin 1 Credits" }, - {0x0c, 0x01, 0x1c, 0x18, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0x1c, 0x04, "1 Coin 3 Credits" }, - {0x0c, 0x01, 0x1c, 0x0c, "1 Coin 4 Credits" }, - {0x0c, 0x01, 0x1c, 0x14, "1 Coin 5 Credits" }, - {0x0c, 0x01, 0x1c, 0x1c, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x0c, 0x01, 0x20, 0x00, "1 Credit" }, - {0x0c, 0x01, 0x20, 0x20, "2 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0xc0, 0x00, "20k 50k 30k+" }, - {0x0c, 0x01, 0xc0, 0x40, "30k 60k 30k+" }, - {0x0c, 0x01, 0xc0, 0x80, "40k 70k 30k+" }, - {0x0c, 0x01, 0xc0, 0xc0, "None" }, -}; - -STDDIPINFO(Marioj) - -static UINT8 __fastcall mario_main_read(unsigned short address) -{ - switch (address) - { - case 0x7c00: - return DrvInputs[0]; - - case 0x7c80: - return DrvInputs[1]; - - case 0x7f80: - return DrvDips[0]; - } - - return 0; -} - -static void play_sample(INT32 sample, INT32 checkstatus, UINT8 data) -{ - if (sample_data[sample] != data) { - if (!data) return; - - sample_data[sample] = data; - - if (checkstatus) { - if (BurnSampleGetStatus(sample) <= 0) BurnSamplePlay(sample); - } else { - BurnSamplePlay(sample); - } - } -} - -static void __fastcall mario_main_write(unsigned short address, UINT8 data) -{ - switch (address) - { - case 0x7c00: - play_sample(3, 1, data); - return; - - case 0x7c80: - play_sample(4, 1, data); - return; - - case 0x7f00: - case 0x7f01: - ZetClose(); // masao - ZetOpen(1); - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0x7f02: - play_sample(0, 0, data); - return; - - case 0x7f03: - case 0x7f04: - case 0x7f05: - return; - - case 0x7f06: - play_sample(1, 0, data); - return; - - case 0x7f07: - play_sample(2, 0, data); - return; - - case 0x7d00: - *scroll = data + 0x11; - return; - - case 0x7e00: - *soundlatch = data; // masao - return; - - case 0x7e80: - *gfxbank = data & 1; - return; - - case 0x7e82: - *flipscreen = data & 1; - return; - - case 0x7e83: - *palbank = data & 1; - return; - - case 0x7e84: - *interrupt_enable = data; - return; - - case 0x7e85: - // z80dma_rdy_w(device, data & 0x01); - return; - } -} - -static void __fastcall mario_main_write_port(unsigned short port, UINT8 /*data*/) -{ - switch (port & 0xff) - { - case 0x00: - // dma - return; - } -} - -static UINT8 __fastcall mario_main_read_port(unsigned short port) -{ - switch (port & 0xff) - { - case 0x00: - return 0; // dma - } - - return 0; -} - -static void __fastcall masao_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x4000: - AY8910Write(0, 1, data); - return; - - case 0x6000: - AY8910Write(0, 0, data); - return; - } -} - -static UINT8 __fastcall masao_sound_read(UINT16 address) -{ - switch (address) - { - case 0x4000: - return AY8910Read(0); - } - - return 0; -} - -static UINT8 masao_ay8910_read_port_A(UINT32) -{ - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; -} - -static int DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); // masao - ZetReset(); - ZetClose(); - - BurnSampleReset(); - AY8910Reset(0); - - return 0; -} - -static int MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - - DrvSndROM = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000200; - - DrvPalette = (unsigned int*)Next; Next += 0x0200 * sizeof(int); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000400; - - DrvSndRAM = Next; Next += 0x000400; - - soundlatch = Next; Next += 0x000001; - interrupt_enable = Next; Next += 0x000001; - gfxbank = Next; Next += 0x000001; - palbank = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - scroll = Next; Next += 0x000001; - - sample_data = Next; Next += 0x000010; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static int DrvGfxDecode() -{ - int Plane0[2] = { 1*512*8*8, 0*512*8*8 }; - int Plane1[3] = { 2*256*256, 1*256*256, 0*256*256 }; - int XOffs[16] = { STEP8(0,1), STEP8((256*16*8), 1) }; - int YOffs[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x6000); - - GfxDecode(0x0100, 3, 16, 16, Plane1, XOffs, YOffs, 0x080, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - INT32 tab0[8] = { 0x00, 0x20, 0x46, 0x67, 0x8d, 0xb3, 0xd4, 0xfc }; - INT32 tab1[4] = { 0x00, 0x0b, 0x66, 0xff }; - - for (INT32 i = 0; i < 0x100; i++) { - UINT8 c = DrvColPROM[i]; - - int r = tab0[(c >> 5) & 0x07] + ((c & 0x1c) ? 0x07 : 0) + ((c & 0x03) ? 0x07 : 0); - int g = tab0[(c >> 2) & 0x07] + ((c & 0xe0) ? 0x07 : 0) + ((c & 0x03) ? 0x07 : 0); - int b = tab1[(c >> 0) & 0x03]; - - if (r > 0x100) r = 0xff; - if (g > 0x100) g = 0xff; - if (b > 0x100) b = 0xff; - - DrvPalette[i] = BurnHighCol(r^0xfc, g^0xfc, b^0xff, 0); - } -} - -static struct BurnSampleInfo MarioSampleDesc[] = { -#if !defined (ROM_VERIFY) - { "ice", SAMPLE_NOLOOP }, - { "coin", SAMPLE_NOLOOP }, - { "skid", SAMPLE_NOLOOP }, - { "run", SAMPLE_NOLOOP }, - { "luigirun", SAMPLE_NOLOOP }, -#endif - { "", 0 } -}; - -STD_SAMPLE_PICK(Mario) -STD_SAMPLE_FN(Mario) - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0xf000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x3000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x5000, 12, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 13, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x6000, 0x6fff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x7000, 0x73ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x7400, 0x77ff, MAP_RAM); - ZetMapMemory(DrvZ80ROM + 0xf000,0xf000, 0xffff, MAP_ROM); - ZetSetWriteHandler(mario_main_write); - ZetSetReadHandler(mario_main_read); - ZetSetOutHandler(mario_main_write_port); - ZetSetInHandler(mario_main_read_port); - ZetClose(); - - BurnSampleInit(0); - BurnSampleSetAllRoutesAllSamples(0.80, BURN_SND_ROUTE_BOTH); - - { // masao - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvSndROM, 0x0000, 0x0fff, MAP_ROM); - ZetMapMemory(DrvSndRAM, 0x2000, 0x23ff, MAP_RAM); - ZetSetWriteHandler(masao_sound_write); - ZetSetReadHandler(masao_sound_read); - ZetClose(); - - AY8910Init(0, 2386333, nBurnSoundRate, &masao_ay8910_read_port_A, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - } - - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnSampleExit(); - AY8910Exit(0); // masao - - GenericTilesExit(); - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - INT32 scrolly = *scroll;// - (flipscreen[0] ? 8 : 0); - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs / 32) * 8; - INT32 sx = (offs & 31) * 8; - - if (flipscreen[0]) { - sx ^= 0xf8; - sy ^= 0xf8; - } - - sy -= scrolly + 16; - if (sy < -7) sy += 256; - - INT32 code = DrvVidRAM[offs] | (*gfxbank << 8); - INT32 color = ((DrvVidRAM[offs] & 0xe0) >> 4) | 0x10 | (*palbank << 5) | (monitor << 6); - - if (flipscreen[0]) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - INT32 flip = *flipscreen ? 0xff : 0; - - memcpy (DrvSprRAM, DrvZ80RAM + 0x900, 0x180); // hack around missing dma functions - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - if (DrvSprRAM[offs]) - { - INT32 sy = (240 - ((DrvSprRAM[offs] + (flip ? 0xF7 : 0xF9) + 1) & 0xff)) ^ flip; - INT32 sx = DrvSprRAM[offs+3] ^ flip; - - INT32 flipx = DrvSprRAM[offs+1] & 0x80; - INT32 flipy = DrvSprRAM[offs+1] & 0x40; - - INT32 code = DrvSprRAM[offs+2]; - INT32 color = (DrvSprRAM[offs+1] & 0x0f) + (*palbank << 4) + (monitor << 5); - - if (flip) { - sy -= 30; - sx -= 7; - flipx ^= 0x80; - flipy ^= 0x40; - } else { - sy -= 15; - sx -= 8; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nCyclesTotal = 4000000 / 60; - - ZetOpen(0); - ZetRun(nCyclesTotal); - if (*interrupt_enable) ZetNmi(); - ZetClose(); - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * 2); - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 MasaoFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 4000000 / 60, 1536000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0]/nInterleave); - if (i == (nInterleave - 1) && *interrupt_enable) ZetNmi(); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1]/nInterleave); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnSampleScan(nAction, pnMin); - } - - return 0; -} - - - -// Mario Bros. (US, Revision F) - -static struct BurnRomInfo marioRomDesc[] = { - { "tma1-c-7f_f.7f", 0x2000, 0xc0c6e014, 1 }, // 0 maincpu - { "tma1-c-7e_f.7e", 0x2000, 0x94fb60d6, 1 }, // 1 - { "tma1-c-7d_f.7d", 0x2000, 0xdcceb6c1, 1 }, // 2 - { "tma1-c-7c_f.7c", 0x1000, 0x4a63d96b, 1 }, // 3 - - { "tma1-c-6k_e.6k", 0x1000, 0x06b9ff85, 2 }, // 4 audiocpu - - { "tma1-v-3f.3f", 0x1000, 0x28b0c42c, 3 }, // 5 gfx1 - { "tma1-v-3j.3j", 0x1000, 0x0c8cc04d, 3 }, // 6 - - { "tma1-v-7m.7m", 0x1000, 0x22b7372e, 4 }, // 7 gfx2 - { "tma1-v-7n.7n", 0x1000, 0x4f3a1f47, 4 }, // 8 - { "tma1-v-7p.7p", 0x1000, 0x56be6ccd, 4 }, // 9 - { "tma1-v-7s.7s", 0x1000, 0x56f1d613, 4 }, // 10 - { "tma1-v-7t.7t", 0x1000, 0x641f0008, 4 }, // 11 - { "tma1-v-7u.7u", 0x1000, 0x7baf5309, 4 }, // 12 - - { "tma1-c-4p_1.4p", 0x0200, 0x8187d286, 5 }, // 13 proms - - { "tma1-c-5p.5p", 0x0020, 0x58d86098, 6 }, // 14 unk_proms -}; - -STD_ROM_PICK(mario) -STD_ROM_FN(mario) - -struct BurnDriver BurnDrvMario = { - "mario", NULL, NULL, "mario", "1983", - "Mario Bros. (US, Revision F)\0", "Imperfect sound", "Nintendo of America", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, marioRomInfo, marioRomName, MarioSampleInfo, MarioSampleName, MariooInputInfo, MarioDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Mario Bros. (US, Revision E) - -static struct BurnRomInfo marioeRomDesc[] = { - { "tma1-c-7f_e-1.7f", 0x2000, 0xc0c6e014, 1 }, // 0 maincpu - { "tma1-c-7e_e-3.7e", 0x2000, 0xb09ab857, 1 }, // 1 - { "tma1-c-7d_e-1.7d", 0x2000, 0xdcceb6c1, 1 }, // 2 - { "tma1-c-7c_e-3.7c", 0x1000, 0x0d31bd1c, 1 }, // 3 - - { "tma1-c-6k_e.6k", 0x1000, 0x06b9ff85, 2 }, // 4 audiocpu - - { "tma1-v-3f.3f", 0x1000, 0x28b0c42c, 3 }, // 5 gfx1 - { "tma1-v-3j.3j", 0x1000, 0x0c8cc04d, 3 }, // 6 - - { "tma1-v.7m", 0x1000, 0xd01c0e2c, 4 }, // 7 gfx2 - { "tma1-v-7n.7n", 0x1000, 0x4f3a1f47, 4 }, // 8 - { "tma1-v-7p.7p", 0x1000, 0x56be6ccd, 4 }, // 9 - { "tma1-v.7s", 0x1000, 0xff856e6f, 4 }, // 10 - { "tma1-v-7t.7t", 0x1000, 0x641f0008, 4 }, // 11 - { "tma1-v.7u", 0x1000, 0xd2dbeb75, 4 }, // 12 - - { "tma1-c-4p_1.4p", 0x0200, 0x8187d286, 5 }, // 13 proms - - { "tma1-c-5p.5p", 0x0020, 0x58d86098, 6 }, // 14 unk_proms -}; - -STD_ROM_PICK(marioe) -STD_ROM_FN(marioe) - -struct BurnDriver BurnDrvMarioe = { - "marioe", "mario", NULL, "mario", "1983", - "Mario Bros. (US, Revision E)\0", "Imperfect sound", "Nintendo of America", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, marioeRomInfo, marioeRomName, MarioSampleInfo, MarioSampleName, MarioInputInfo, MarioDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Mario Bros. (US, Unknown Rev) - -static struct BurnRomInfo mariooRomDesc[] = { - { "tma1-c-7f_.7f", 0x2000, 0xc0c6e014, 1 }, // 0 maincpu - { "tma1-c-7f_.7e", 0x2000, 0x116b3856, 1 }, // 1 - { "tma1-c-7f_.7d", 0x2000, 0xdcceb6c1, 1 }, // 2 - { "tma1-c-7f_.7c", 0x1000, 0x4a63d96b, 1 }, // 3 - - { "tma1-c-6k_e.6k", 0x1000, 0x06b9ff85, 2 }, // 4 audiocpu - - { "tma1-v-3f.3f", 0x1000, 0x28b0c42c, 3 }, // 5 gfx1 - { "tma1-v-3j.3j", 0x1000, 0x0c8cc04d, 3 }, // 6 - - { "tma1-v-7m.7m", 0x1000, 0x22b7372e, 4 }, // 7 gfx2 - { "tma1-v-7n.7n", 0x1000, 0x4f3a1f47, 4 }, // 8 - { "tma1-v-7p.7p", 0x1000, 0x56be6ccd, 4 }, // 9 - { "tma1-v-7s.7s", 0x1000, 0x56f1d613, 4 }, // 10 - { "tma1-v-7t.7t", 0x1000, 0x641f0008, 4 }, // 11 - { "tma1-v-7u.7u", 0x1000, 0x7baf5309, 4 }, // 12 - - { "tma1-c-4p.4p", 0x0200, 0xafc9bd41, 5 }, // 13 proms - - { "tma1-c-5p.5p", 0x0020, 0x58d86098, 6 }, // 14 unk_proms -}; - -STD_ROM_PICK(marioo) -STD_ROM_FN(marioo) - -struct BurnDriver BurnDrvMarioo = { - "marioo", "mario", NULL, "mario", "1983", - "Mario Bros. (US, Unknown Rev)\0", "Imperfect sound", "Nintendo of America", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, mariooRomInfo, mariooRomName, MarioSampleInfo, MarioSampleName, MariooInputInfo, MarioDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Mario Bros. (Japan) - -static struct BurnRomInfo mariojRomDesc[] = { - { "tma1c-a1.7f", 0x2000, 0xb64b6330, 1 }, // 0 maincpu - { "tma1c-a2.7e", 0x2000, 0x290c4977, 1 }, // 1 - { "tma1c-a1.7d", 0x2000, 0xf8575f31, 1 }, // 2 - { "tma1c-a2.7c", 0x1000, 0xa3c11e9e, 1 }, // 3 - - { "tma1c-a.6k", 0x1000, 0x06b9ff85, 2 }, // 4 audiocpu - - { "tma1v-a.3f", 0x1000, 0xadf49ee0, 3 }, // 5 gfx1 - { "tma1v-a.3j", 0x1000, 0xa5318f2d, 3 }, // 6 - - { "tma1v-a.7m", 0x1000, 0x186762f8, 4 }, // 7 gfx2 - { "tma1v-a.7n", 0x1000, 0xe0e08bba, 4 }, // 8 - { "tma1v-a.7p", 0x1000, 0x7b27c8c1, 4 }, // 9 - { "tma1v-a.7s", 0x1000, 0x912ba80a, 4 }, // 10 - { "tma1v-a.7t", 0x1000, 0x5cbb92a5, 4 }, // 11 - { "tma1v-a.7u", 0x1000, 0x13afb9ed, 4 }, // 12 - - { "tma1-c-4p.4p", 0x0200, 0xafc9bd41, 5 }, // 13 proms - - { "tma1-c-5p.5p", 0x0020, 0x58d86098, 6 }, // 14 unk_proms -}; - -STD_ROM_PICK(marioj) -STD_ROM_FN(marioj) - -struct BurnDriver BurnDrvMarioj = { - "marioj", "mario", NULL, "mario", "1983", - "Mario Bros. (Japan)\0", "Imperfect sound", "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, mariojRomInfo, mariojRomName, MarioSampleInfo, MarioSampleName, MarioInputInfo, MariojDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Masao - -static struct BurnRomInfo masaoRomDesc[] = { - { "masao-4.rom", 0x2000, 0x07a75745, 1 }, // 0 maincpu - { "masao-3.rom", 0x2000, 0x55c629b6, 1 }, // 1 - { "masao-2.rom", 0x2000, 0x42e85240, 1 }, // 2 - { "masao-1.rom", 0x1000, 0xb2817af9, 1 }, // 3 - - { "masao-5.rom", 0x1000, 0xbd437198, 2 }, // 4 audiocpu - - { "masao-6.rom", 0x1000, 0x1c9e0be2, 3 }, // 5 gfx1 - { "masao-7.rom", 0x1000, 0x747c1349, 3 }, // 6 - - { "tma1v-a.7m", 0x1000, 0x186762f8, 4 }, // 7 gfx2 - { "masao-9.rom", 0x1000, 0x50be3918, 4 }, // 8 - { "mario.7p", 0x1000, 0x56be6ccd, 4 }, // 9 - { "tma1v-a.7s", 0x1000, 0x912ba80a, 4 }, // 10 - { "tma1v-a.7t", 0x1000, 0x5cbb92a5, 4 }, // 11 - { "tma1v-a.7u", 0x1000, 0x13afb9ed, 4 }, // 12 - - { "tma1-c-4p.4p", 0x0200, 0xafc9bd41, 5 }, // 13 proms -}; - -STD_ROM_PICK(masao) -STD_ROM_FN(masao) - -struct BurnDriver BurnDrvMasao = { - "masao", "mario", NULL, "mario", "1983", - "Masao\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, masaoRomInfo, masaoRomName, MarioSampleInfo, MarioSampleName, MariooInputInfo, MarioDIPInfo, - DrvInit, DrvExit, MasaoFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_markham.cpp b/jan/src/burn/drv/pre90s/d_markham.cpp deleted file mode 100644 index 1a1f8a2bc..000000000 --- a/jan/src/burn/drv/pre90s/d_markham.cpp +++ /dev/null @@ -1,550 +0,0 @@ - // FB Alpha Markham driver module -// Based on MAME driver by Uki - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *MemEnd; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvShareRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *scroll; - -static UINT8 flipscreen; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo MarkhamInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Markham) - -static struct BurnDIPInfo MarkhamDIPList[]= -{ - {0x12, 0xff, 0xff, 0x02, NULL }, - {0x13, 0xff, 0xff, 0x7e, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x01, 0x00, "3" }, - {0x12, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x02, 0x02, "Upright" }, - {0x12, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Chutes" }, - {0x12, 0x01, 0x08, 0x00, "Individual" }, - {0x12, 0x01, 0x08, 0x08, "Common" }, - - {0 , 0xfe, 0 , 16, "Coin1 / Coin2" }, - {0x12, 0x01, 0xf0, 0x00, "1C 1C / 1C 1C" }, - {0x12, 0x01, 0xf0, 0x10, "2C 1C / 2C 1C" }, - {0x12, 0x01, 0xf0, 0x20, "2C 1C / 1C 3C" }, - {0x12, 0x01, 0xf0, 0x30, "1C 1C / 1C 2C" }, - {0x12, 0x01, 0xf0, 0x40, "1C 1C / 1C 3C" }, - {0x12, 0x01, 0xf0, 0x50, "1C 1C / 1C 4C" }, - {0x12, 0x01, 0xf0, 0x60, "1C 1C / 1C 5C" }, - {0x12, 0x01, 0xf0, 0x70, "1C 1C / 1C 6C" }, - {0x12, 0x01, 0xf0, 0x80, "1C 2C / 1C 2C" }, - {0x12, 0x01, 0xf0, 0x90, "1C 2C / 1C 4C" }, - {0x12, 0x01, 0xf0, 0xa0, "1C 2C / 1C 5C" }, - {0x12, 0x01, 0xf0, 0xb0, "1C 2C / 1C 10C" }, - {0x12, 0x01, 0xf0, 0xc0, "1C 2C / 1C 11C" }, - {0x12, 0x01, 0xf0, 0xd0, "1C 2C / 1C 12C" }, - {0x12, 0x01, 0xf0, 0xe0, "1C 2C / 1C 6C" }, - {0x12, 0x01, 0xf0, 0xf0, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x03, 0x00, "None" }, - {0x13, 0x01, 0x03, 0x01, "20000" }, - {0x13, 0x01, 0x03, 0x02, "20000, Every 50000" }, - {0x13, 0x01, 0x03, 0x03, "20000, Every 80000" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, -}; - -STDDIPINFO(Markham) - -void __fastcall markham_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe00c: - scroll[0] = data; - return; - - case 0xe00d: - scroll[1] = data; - return; - - case 0xe00e: - flipscreen = data & 1; - return; - } -} - -UINT8 __fastcall markham_main_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - return DrvDips[1]; - - case 0xe001: - return DrvDips[0]; - - case 0xe002: - return DrvInputs[0]; - - case 0xe003: - return DrvInputs[1]; - - case 0xe005: - return (DrvInputs[2] & ~0x10) | (DrvDips[2] & 0x10); - } - - return 0; -} - -void __fastcall markham_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - SN76496Write(0, data); - return; - - case 0xc001: - SN76496Write(1, data); - return; - } -} - -static tilemap_callback( markham ) -{ - INT32 attr = DrvVidRAM[offs * 2 + 0]; - - TILE_SET_INFO(0, DrvVidRAM[offs * 2 + 1] | ((attr & 0x60) << 3), (attr & 0x1f) | ((attr & 0x80) >> 2), 0); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - flipscreen = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x006000; - DrvZ80ROM1 = Next; Next += 0x006000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000700; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - DrvShareRAM = Next; Next += 0x000800; - - scroll = Next; Next += 0x000002; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { 0x00000, 0x10000, 0x20000 }; - INT32 XOffs[16] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x87, 0x86, 0x85, 0x84, 0x83, 0x82, 0x81, 0x80 }; - INT32 YOffs[16] = { 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, 0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x6000); - - GfxDecode(0x0100, 3, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x6000); - - GfxDecode(0x0400, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 tmp[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 r = DrvColPROM[i + 0x000] & 0x0f; - INT32 g = DrvColPROM[i + 0x100] & 0x0f; - INT32 b = DrvColPROM[i + 0x200] & 0x0f; - - tmp[i] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0); - } - - for (INT32 i = 0; i < 0x400; i++) { - DrvPalette[i] = tmp[DrvColPROM[0x300 + i]]; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00500, 15, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM0); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM0); - ZetMapArea(0xc800, 0xcfff, 0, DrvSprRAM); - ZetMapArea(0xc800, 0xcfff, 1, DrvSprRAM); - ZetMapArea(0xc800, 0xcfff, 2, DrvSprRAM); - ZetMapArea(0xd000, 0xd7ff, 0, DrvVidRAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvVidRAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvVidRAM); - ZetMapArea(0xd800, 0xdfff, 0, DrvShareRAM); - ZetMapArea(0xd800, 0xdfff, 1, DrvShareRAM); - ZetMapArea(0xd800, 0xdfff, 2, DrvShareRAM); - ZetSetWriteHandler(markham_main_write); - ZetSetReadHandler(markham_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvShareRAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvShareRAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvShareRAM); - ZetSetWriteHandler(markham_sound_write); - ZetClose(); - - SN76496Init(0, 4000000, 0); - SN76496Init(1, 4000000, 1); - SN76496SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.75, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - GenericTilemapInit(0, scan_cols_map_scan, markham_map_callback, 8, 8, 32, 32); - GenericTilemapSetOffsets(0, -8, -16); - GenericTilemapSetScrollRows(0, 32); - GenericTilemapSetGfx(0, DrvGfxROM1, 3, 8, 8, 0x10000, 0x200, 0x3f); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -#if 0 -static void draw_background_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs >> 5) << 3; - INT32 sy = (offs & 0x1f) << 3; - - if (sy >= 32 && sy < 128) sx -= scroll[0]; - if (sy >= 128 && sy < 256) sx -= scroll[1]; - - if (sx < -7) sx += 256; - - INT32 attr = DrvVidRAM[offs * 2 + 0]; - INT32 code = DrvVidRAM[offs * 2 + 1] | ((attr & 0x60) << 3); - INT32 color = (attr & 0x1f) | ((attr & 0x80) >> 2); - - if (flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, (248 - sx) - 8, (248 - sy) - 16, color, 3, 0x200, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx - 8, sy - 16, color, 3, 0x200, DrvGfxROM1); - } - } -} -#endif - -static void draw_sprites() -{ - for (INT32 offs = 0x60; offs < 0x100; offs +=4) - { - INT32 sy = DrvSprRAM[offs + 0]; - INT32 code = DrvSprRAM[offs + 1]; - INT32 color = DrvSprRAM[offs + 2] & 0x3f; - INT32 sx = DrvSprRAM[offs + 3]; - - if (flipscreen) { - sx = (240 - sx) & 0xff; - } else { - sx = (sx - 2) & 0xff; - sy = 240 - sy; - } - - if (sx > 248) sx -= 256; - - RenderTileTranstab(pTransDraw, DrvGfxROM0, code, color << 3, 0, sx - 8, sy - 16, flipscreen, flipscreen, 16, 16, DrvColPROM + 0x300); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 32/8; i < 128/8; i++) GenericTilemapSetScrollRow(0, i, scroll[0]); - for (INT32 i = 128/8; i < 256/8; i++) GenericTilemapSetScrollRow(0, i, scroll[1]); - -// GenericTilemapSetFlip(0, (flipscreen) ? TMAP_FLIPXY : 0); - GenericTilemapDraw(0, pTransDraw, -1); - - //draw_background_layer(); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - SCAN_VAR(flipscreen); - SN76496Scan(nAction, pnMin); - } - - return 0; -} - - -// Markham - -static struct BurnRomInfo markhamRomDesc[] = { - { "tv3.9", 0x2000, 0x59391637, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "tvg4.10", 0x2000, 0x1837bcce, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tvg5.11", 0x2000, 0x651da602, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "tvg1.5", 0x2000, 0xc5299766, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "tvg2.6", 0x2000, 0xb216300a, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "tvg6.84", 0x2000, 0xab933ae5, 3 | BRF_GRA }, // 5 Sprites - { "tvg7.85", 0x2000, 0xce8edda7, 3 | BRF_GRA }, // 6 - { "tvg8.86", 0x2000, 0x74d1536a, 3 | BRF_GRA }, // 7 - - { "tvg9.87", 0x2000, 0x42168675, 4 | BRF_GRA }, // 8 Tiles - { "tvg10.88", 0x2000, 0xfa9feb67, 4 | BRF_GRA }, // 9 - { "tvg11.89", 0x2000, 0x71f3dd49, 4 | BRF_GRA }, // 10 - - { "14-3.99", 0x0100, 0x89d09126, 5 | BRF_GRA }, // 11 Color PROMs - { "14-4.100", 0x0100, 0xe1cafe6c, 5 | BRF_GRA }, // 12 - { "14-5.101", 0x0100, 0x2d444fa6, 5 | BRF_GRA }, // 13 - { "14-1.61", 0x0200, 0x3ad8306d, 5 | BRF_GRA }, // 14 - { "14-2.115", 0x0200, 0x12a4f1ff, 5 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(markham) -STD_ROM_FN(markham) - -struct BurnDriver BurnDrvMarkham = { - "markham", NULL, NULL, NULL, "1983", - "Markham\0", NULL, "Sun Electronics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, markhamRomInfo, markhamRomName, NULL, NULL, MarkhamInputInfo, MarkhamDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_megasys1.cpp b/jan/src/burn/drv/pre90s/d_megasys1.cpp deleted file mode 100644 index 66d88d643..000000000 --- a/jan/src/burn/drv/pre90s/d_megasys1.cpp +++ /dev/null @@ -1,5880 +0,0 @@ -// FB Alpha Jaleco Mega System 1 driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM0; -static UINT8 *Drv68KROM1; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM[4]; -static UINT8 *DrvTransTab[4]; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvPrioPROM; -static UINT8 *DrvSprBuf0; -static UINT8 *DrvObjBuf0; -static UINT8 *DrvSprBuf1; -static UINT8 *DrvObjBuf1; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvObjRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvScrRAM[3]; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRegs; -static UINT8 *DrvPrioBitmap; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 scrollx[3]; -static UINT16 scrolly[3]; -static UINT16 scroll_flag[3]; -static UINT16 m_active_layers; -static UINT16 sprite_flag; -static UINT16 sprite_bank; -static UINT16 screen_flag; - -static UINT16 input_select; -static UINT16 protection_val; -static UINT8 oki_bank; - -static UINT16 soundlatch; -static UINT16 soundlatch2; - -static UINT16 mcu_ram[0x10]; -static INT32 mcu_hs = 0; -static UINT16 *mcu_config; -static UINT32 mcu_write_address; -static UINT16 mcu_config_type1[3] = { 0xff, 0, 0x889e }; -static UINT16 mcu_config_type2[3] = { 0, 0xff, 0x835d }; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static INT32 system_select = 0; -static INT32 sound_cpu_reset = 0; -static UINT8 input_select_values[5]; -static INT32 ignore_oki_status_hack = 1; -static INT32 layer_color_config[4] = { 0, 0x100, 0x200, 0x300 }; -static UINT32 m_layers_order[0x10]; -static INT32 scroll_factor_8x8[3] = { 1, 1, 1 }; -static INT32 tshingen = 0; -static INT32 monkelf = 0; -#ifdef BUILD_A68K -static INT32 oldasmemulation = 0; -#endif - -static struct BurnInputInfo CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common) - -static struct BurnInputInfo Common3ButtonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common3Button) - -static struct BurnInputInfo Hayaosi1InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 3, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy3 + 2, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 5" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 5" }, - - {"P3 Start", BIT_DIGITAL, DrvJoy1 + 4, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p3 fire 3" }, - {"P3 Button 4", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 4" }, - {"P3 Button 5", BIT_DIGITAL, DrvJoy2 + 7, "p3 fire 5" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Hayaosi1) - -static struct BurnInputInfo PeekabooInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 9, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 12, "p1 right" }, - {"P1 Fire", BIT_DIGITAL, DrvJoy1 + 8, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 11, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 13, "p2 right" }, - {"P2 Fire", BIT_DIGITAL, DrvJoy1 + 10, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Peekaboo) - -static struct BurnDIPInfo P47DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x00, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x10, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(P47) - -static struct BurnDIPInfo KickoffDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x12, 0x01, 0x03, 0x03, "3'" }, - {0x12, 0x01, 0x03, 0x02, "4'" }, - {0x12, 0x01, 0x03, 0x01, "5'" }, - {0x12, 0x01, 0x03, 0x00, "6'" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x10, "Harder" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x12, 0x01, 0x40, 0x40, "Trackball" }, - {0x12, 0x01, 0x40, 0x00, "Joystick" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Freeze Screen (Cheat)" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Text" }, - {0x13, 0x01, 0x80, 0x80, "Japanese" }, - {0x13, 0x01, 0x80, 0x00, "English" }, -}; - -STDDIPINFO(Kickoff) - -static struct BurnDIPInfo KazanDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x03, "2" }, - {0x12, 0x01, 0x03, 0x01, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x04, 0x04, "50k" }, - {0x12, 0x01, 0x04, 0x00, "200k" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x10, "Harder" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x04, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze Screen (Cheat)" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kazan) - -static struct BurnDIPInfo TshingenDIPList[]= -{ - {0x14, 0xff, 0xff, 0xdd, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x03, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x02, "4" }, - {0x14, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "20k" }, - {0x14, 0x01, 0x0c, 0x04, "30k" }, - {0x14, 0x01, 0x0c, 0x08, "40k" }, - {0x14, 0x01, 0x0c, 0x00, "50k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x30, "Easy" }, - {0x14, 0x01, 0x30, 0x10, "Normal" }, - {0x14, 0x01, 0x30, 0x20, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0x07, 0x04, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x38, 0x30, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Tshingen) - -static struct BurnDIPInfo AstyanaxDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x14, 0x01, 0x04, 0x04, "30k 70k 110k then every 30k" }, - {0x14, 0x01, 0x04, 0x00, "50k 100k then every 40k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x18, 0x08, "2" }, - {0x14, 0x01, 0x18, 0x18, "3" }, - {0x14, 0x01, 0x18, 0x10, "4" }, - {0x14, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x14, 0x01, 0x20, 0x20, "Normal" }, - {0x14, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Swap 1P/2P Controls" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x04, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Test Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Astyanax) - -static struct BurnDIPInfo HachooDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x10, "Harder" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x04, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Hachoo) - -static struct BurnDIPInfo JitsuproDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 2, "2 Player Innings per Credit" }, - {0x14, 0x01, 0x01, 0x01, "2" }, - {0x14, 0x01, 0x01, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Difficulty for Catching Ball" }, - {0x14, 0x01, 0x02, 0x02, "Normal" }, - {0x14, 0x01, 0x02, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 13, "Franchise (Increase Power)" }, - {0x14, 0x01, 0x3c, 0x3c, "Normal" }, - {0x14, 0x01, 0x3c, 0x38, "G" }, - {0x14, 0x01, 0x3c, 0x34, "D" }, - {0x14, 0x01, 0x3c, 0x30, "C" }, - {0x14, 0x01, 0x3c, 0x2c, "S" }, - {0x14, 0x01, 0x3c, 0x28, "W (B)" }, - {0x14, 0x01, 0x3c, 0x24, "T" }, - {0x14, 0x01, 0x3c, 0x20, "L" }, - {0x14, 0x01, 0x3c, 0x1c, "Br (Bw)" }, - {0x14, 0x01, 0x3c, 0x18, "F" }, - {0x14, 0x01, 0x3c, 0x14, "H" }, - {0x14, 0x01, 0x3c, 0x10, "O (M)" }, - {0x14, 0x01, 0x3c, 0x0c, "Bu" }, - - {0 , 0xfe, 0 , 2, "Scroll Is Based On" }, - {0x14, 0x01, 0x40, 0x40, "Shadow of Baseball" }, - {0x14, 0x01, 0x40, 0x00, "The Baseball Itself" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0x07, 0x04, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x38, 0x30, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Jitsupro) - -static struct BurnDIPInfo PlusalphDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Hyper Laser Beams" }, - {0x12, 0x01, 0x04, 0x00, "2" }, - {0x12, 0x01, 0x04, 0x04, "3" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x08, 0x08, "70k and every 200k" }, - {0x12, 0x01, 0x08, 0x00, "100k and 300k Only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x00, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x20, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x04, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze Screen (Cheat)" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Plusalph) - -static struct BurnDIPInfo StdragonDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Easy" }, - {0x12, 0x01, 0x30, 0x20, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Stdragon) - -static struct BurnDIPInfo RodlandDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x0c, 0x04, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x08, "4" }, - {0x12, 0x01, 0x0c, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Default episode" }, - {0x12, 0x01, 0x10, 0x10, "1" }, - {0x12, 0x01, 0x10, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x60, 0x00, "Easy" }, - {0x12, 0x01, 0x60, 0x60, "Normal" }, - {0x12, 0x01, 0x60, 0x20, "Hard" }, - {0x12, 0x01, 0x60, 0x40, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x04, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Rodland) - -static struct BurnDIPInfo SoldamDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x00, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x02, "Hard" }, - {0x12, 0x01, 0x03, 0x01, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Games To Play (Vs)" }, - {0x12, 0x01, 0x0c, 0x00, "1" }, - {0x12, 0x01, 0x0c, 0x0c, "2" }, - {0x12, 0x01, 0x0c, 0x08, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Credits To Start (Vs)" }, - {0x12, 0x01, 0x20, 0x20, "1" }, - {0x12, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Credits To Continue (Vs)" }, - {0x12, 0x01, 0x40, 0x40, "1" }, - {0x12, 0x01, 0x40, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Soldam) - -static struct BurnDIPInfo AvspiritDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x12, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x12, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x08, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x10, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x20, 0x20, "Upright" }, - {0x13, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Test Mode" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Avspirit) - -static struct BurnDIPInfo EdfDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x04, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "DSW-B bits 2-0" }, - {0x13, 0x01, 0x07, 0x00, "0" }, - {0x13, 0x01, 0x07, 0x01, "1" }, - {0x13, 0x01, 0x07, 0x02, "2" }, - {0x13, 0x01, 0x07, 0x03, "3" }, - {0x13, 0x01, 0x07, 0x04, "4" }, - {0x13, 0x01, 0x07, 0x05, "5" }, - {0x13, 0x01, 0x07, 0x06, "6" }, - {0x13, 0x01, 0x07, 0x07, "7" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x08, 0x08, "3" }, - {0x13, 0x01, 0x08, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x00, "Easy" }, - {0x13, 0x01, 0x30, 0x30, "Normal" }, - {0x13, 0x01, 0x30, 0x10, "Hard" }, - {0x13, 0x01, 0x30, 0x20, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Edf) - -static struct BurnDIPInfo Hayaosi1DIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x16, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x16, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x16, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x16, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x16, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x16, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x02, 0x00, "Off" }, - {0x17, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x18, 0x10, "Easy" }, - {0x17, 0x01, 0x18, 0x18, "Normal" }, - {0x17, 0x01, 0x18, 0x08, "Hard" }, - {0x17, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Points To Win" }, - {0x17, 0x01, 0x20, 0x00, "10" }, - {0x17, 0x01, 0x20, 0x20, "15" }, -}; - -STDDIPINFO(Hayaosi1) - -static struct BurnDIPInfo Street64DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xbd, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x12, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x12, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x10, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x08, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x60, 0x40, "1" }, - {0x13, 0x01, 0x60, 0x60, "2" }, - {0x13, 0x01, 0x60, 0x20, "3" }, - {0x13, 0x01, 0x60, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Street64) - -static struct BurnDIPInfo BigstrikDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x14, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x14, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x06, 0x02, "Easy" }, - {0x15, 0x01, 0x06, 0x06, "Normal" }, - {0x15, 0x01, 0x06, 0x04, "Hard" }, - {0x15, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x15, 0x01, 0x18, 0x00, "Very Short" }, - {0x15, 0x01, 0x18, 0x10, "Short" }, - {0x15, 0x01, 0x18, 0x18, "Normal" }, - {0x15, 0x01, 0x18, 0x08, "Long" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "1 Credit 2 Play" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Bigstrik) - -static struct BurnDIPInfo ChimerabDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbd, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x18, 0x10, "Easy" }, - {0x12, 0x01, 0x18, 0x18, "Normal" }, - {0x12, 0x01, 0x18, 0x08, "Hard" }, - {0x12, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x60, 0x40, "1" }, - {0x12, 0x01, 0x60, 0x60, "2" }, - {0x12, 0x01, 0x60, 0x20, "3" }, - {0x12, 0x01, 0x60, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x13, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x13, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Chimerab) - -static struct BurnDIPInfo CybattlrDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Disable Instruction Screen" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x13, 0x01, 0x18, 0x00, "Off" }, - {0x13, 0x01, 0x18, 0x10, "Up to Mission 4" }, - {0x13, 0x01, 0x18, 0x08, "Not on Final Mission" }, - {0x13, 0x01, 0x18, 0x18, "On" }, - - {0 , 0xfe, 0 , 2, "Intro Music" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Cybattlr) - -static struct BurnDIPInfo LomakaiDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Easy" }, - {0x12, 0x01, 0x30, 0x20, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Lomakai) - -static struct BurnDIPInfo PhantasmDIPList[]= -{ - {0x12, 0xff, 0xff, 0xfd, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x18, 0x08, "Easy" }, - {0x12, 0x01, 0x18, 0x18, "Normal" }, - {0x12, 0x01, 0x18, 0x10, "Hard" }, - {0x12, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x20, 0x20, "Upright" }, - {0x12, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Test Mode" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x13, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x13, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Phantasm) - -static struct BurnDIPInfo PeekabooDIPList[]= -{ - {0x0b, 0xff, 0xff, 0xf7, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0b, 0x01, 0x03, 0x00, "Easy" }, - {0x0b, 0x01, 0x03, 0x03, "Normal" }, - {0x0b, 0x01, 0x03, 0x02, "Hard" }, - {0x0b, 0x01, 0x03, 0x01, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 1, "Movement" }, - //{0x0a, 0x01, 0x08, 0x08, "Paddles" }, - {0x0b, 0x01, 0x08, 0x00, "Buttons" }, - - {0 , 0xfe, 0 , 4, "Nudity" }, - {0x0b, 0x01, 0x30, 0x30, "Female and Male (Full)" }, - {0x0b, 0x01, 0x30, 0x20, "Female (Full)" }, - {0x0b, 0x01, 0x30, 0x10, "Female (Partial)" }, - {0x0b, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0b, 0x01, 0x40, 0x40, "Upright" }, - {0x0b, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Number of controllers" }, - {0x0b, 0x01, 0x80, 0x80, "1" }, - {0x0b, 0x01, 0x80, 0x00, "2" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0c, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x0c, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x0c, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0c, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x0c, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x0c, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x0c, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x0c, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x0c, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x0c, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x0c, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x0c, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0c, 0x01, 0x80, 0x80, "Off" }, - {0x0c, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Peekaboo) - -static UINT8 __fastcall mcu_prot_read_byte(UINT32 address) -{ - return Drv68KROM0[(address & 0x3ffff) ^ 1]; -} - -static UINT16 __fastcall mcu_prot_read_word(UINT32 address) -{ - if ((UINT32)mcu_hs && (((UINT32)mcu_ram[4] << 6) & 0x3ffc0) == (address & 0x3ffc0)) - { - return mcu_config[2]; - } - - return *((UINT16*)(Drv68KROM0 + (address & 0x3fffe))); -} - -static void __fastcall mcu_prot_write_word(UINT32 address, UINT16 data) -{ - if (address >= mcu_write_address && address <= (mcu_write_address + 9)) { - mcu_ram[(address & 0xe)/2] = data; - - if ((address & ~1) == (mcu_write_address+8)) { - if (mcu_ram[0] == mcu_config[0] && mcu_ram[1] == 0x55 && mcu_ram[2] == 0xaa && mcu_ram[3] == mcu_config[1]) { - mcu_hs = 1; - } else { - mcu_hs = 0; - } - } - } -} - -static void install_mcu_protection(UINT16 *config, UINT32 address) -{ - mcu_write_address = address; - mcu_config = config; - - SekOpen(0); - SekMapHandler(2, 0x00000, 0x3ffff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler(2, mcu_prot_read_word); - SekSetReadByteHandler(2, mcu_prot_read_byte); - SekSetWriteWordHandler(2, mcu_prot_write_word); - SekClose(); -} - -static inline void megasys_palette_write(INT32 offset) -{ - INT32 r,g,b,p; - - p = *((UINT16*)(DrvPalRAM + (offset & 0x7fe))); - - if (system_select == 0xD) // system D - { - r = ((p >> 11) & 0x1f); - g = ((p >> 6) & 0x1f); - b = ((p >> 1) & 0x1f); - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - } - else // system A, B, C, Z - { - r = ((p >> 11) & 0x1e) | ((p >> 3) & 0x01); - g = ((p >> 7) & 0x1e) | ((p >> 2) & 0x01); - b = ((p >> 3) & 0x1e) | ((p >> 1) & 0x01); - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - } - - DrvPalette[(offset & 0x7fe)/2] = BurnHighCol(r,g,b,0); -} - -#define RAM_WRITE_BYTE_MIRRORED(mask) \ - { \ - Drv68KRAM0[(address & mask) | 0] = data; \ - Drv68KRAM0[(address & mask) | 1] = data; \ - return; \ - } \ - -#define RAM_WRITE_WORD(mask) \ - { \ - *((UINT16*)(Drv68KRAM0 + (address & mask))) = BURN_ENDIAN_SWAP_INT16(data); \ - return; \ - } \ - -static void __fastcall megasys_palette_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + (address & 0x7fe))) = data; - megasys_palette_write(address); -} - -static void __fastcall megasys_palette_write_byte(UINT32 address, UINT8 data) -{ - DrvPalRAM[(address & 0x7ff)^1] = data; - megasys_palette_write(address); -} - -static void update_video_regs(INT32 offset) -{ - offset &= 0x3fe; - - UINT16 data = *((UINT16*)(DrvVidRegs + offset)); - - switch (offset) - { - case 0x000: - m_active_layers = data; - return; - - case 0x008: - scrollx[2] = data; - return; - - case 0x00a: - scrolly[2] = data; - return; - - case 0x00c: - scroll_flag[2] = data; - return; - - case 0x100: - sprite_flag = data; - return; - - case 0x200: - if ((data & 0x0f) > 0x0d && monkelf) data -= 0x10; - scrollx[0] = data; - return; - - case 0x202: - scrolly[0] = data; - return; - - case 0x204: - scroll_flag[0] = data; - return; - - case 0x208: - if ((data & 0x0f) > 0x0b && monkelf) data -= 0x10; - scrollx[1] = data; - return; - - case 0x20a: - scrolly[1] = data; - return; - - case 0x20c: - scroll_flag[1] = data; - return; - - case 0x300: - { - screen_flag = data; - sound_cpu_reset = data & 0x10; - - if (sound_cpu_reset) { - if (system_select == 0) { // system Z - ZetReset(); - } else { - - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - } - } - } - return; - - case 0x308: - { - soundlatch = data; - - if (system_select == 0) { // system Z - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } else { - SekClose(); - SekOpen(1); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - SekOpen(0); - } - } - return; - } -} - -static void update_video_regs2(INT32 offset) -{ - offset &= 0xfffe; - - UINT16 data = *((UINT16*)(DrvVidRegs + offset)); - - switch (offset) - { - case 0x2000: - scrollx[0] = data; - return; - - case 0x2002: - scrolly[0] = data; - return; - - case 0x2004: - scroll_flag[0] = data; - return; - - case 0x2008: - scrollx[1] = data; - return; - - case 0x200a: - scrolly[1] = data; - return; - - case 0x200c: - scroll_flag[1] = data; - return; - - case 0x2100: - scrollx[2] = data; - return; - - case 0x2102: - scrolly[2] = data; - return; - - case 0x2104: - scroll_flag[2] = data; - return; - - case 0x2108: - sprite_bank = data; - return; - - case 0x2208: - m_active_layers = data; - return; - - case 0x2200: - sprite_flag = data; - return; - - case 0x2308: - { - screen_flag = data; - - sound_cpu_reset = data & 0x10; - - if (sound_cpu_reset) { - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - } - } - return; - - case 0x8000: - { - soundlatch = data; - SekClose(); - SekOpen(1); - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); // auto? - SekClose(); - SekOpen(0); - } - return; - } -} - -static UINT8 __fastcall megasys1A_main_read_byte(UINT32 address) -{ - if (address & 0xfff00000) { - return SekReadByte(address & 0xfffff); - } - - switch (address) - { - case 0x080000: - return DrvInputs[0] >> 8; - - case 0x080001: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1] >> 8; - - case 0x080003: - return DrvInputs[1]; - - case 0x080004: - return DrvInputs[2] >> 8; - - case 0x080005: - return DrvInputs[2]; - - case 0x080006: - return DrvDips[1]; - - case 0x080007: - return DrvDips[0]; - - case 0x080008: - return soundlatch2 >> 8; - - case 0x080009: - return soundlatch2; - } - - return 0; -} - -static UINT16 __fastcall megasys1A_main_read_word(UINT32 address) -{ - if (address & 0xfff00000) { - return SekReadWord(address & 0xfffff); - } - - switch (address) - { - case 0x080000: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1]; - - case 0x080004: - return DrvInputs[2]; - - case 0x080006: - return (DrvDips[1] << 8) | (DrvDips[0] << 0); - - case 0x080008: - return soundlatch2; - } - - return 0; -} - -static void __fastcall megasys1A_main_write_byte(UINT32 address, UINT8 data) -{ - if (address >= 0xf0000 && address <= 0xfffff) { - RAM_WRITE_BYTE_MIRRORED(0xffff) - return; - } - - if (address & 0xfff00000) { - SekWriteByte(address & 0xfffff, data); - return; - } - - if ((address & 0xffc00) == 0x084000) { - DrvVidRegs[(address & 0x3ff)^1] = data; - update_video_regs(address); - return; - } -} - -static void __fastcall megasys1A_main_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0xf0000 && address <= 0xfffff) { - RAM_WRITE_WORD(0xffff) - return; - } - - if (address & 0xfff00000) { - SekWriteWord(address & 0xfffff, data); - return; - } - - if ((address & 0xffc00) == 0x084000) { - *((UINT16*)(DrvVidRegs + (address & 0x3fe))) = data; - update_video_regs(address); - return; - } -} - -static UINT16 input_protection_read() -{ - int i; - - if ((input_select & 0xf0) == 0xf0) return 0x000D; - - for (i = 0; i < 5; i++) - if (input_select == input_select_values[i]) break; - - switch (i) - { - case 0: - case 1: - case 2: return DrvInputs[i]; - case 3: - case 4: return DrvDips[i-3]; - } - - return 0x0006; -} - -static UINT8 __fastcall megasys1B_main_read_byte(UINT32 address) -{ - if (address & 0xf00000) { - return SekReadByte(address & 0xfffff); - } - - switch (address) - { - case 0x0e0000: - return input_protection_read() >> 8; - - case 0x0e0001: - return input_protection_read(); - } - - return 0xff; -} - -static UINT16 __fastcall megasys1B_main_read_word(UINT32 address) -{ - if (address & 0xf00000) { - return SekReadWord(address & 0xfffff); - } - - switch (address) - { - case 0x0e0000: - return input_protection_read(); - } - - return 0xffff; -} - -static void __fastcall megasys1B_main_write_byte(UINT32 address, UINT8 data) -{ - if (address >= 0x60000 && address <= 0x7ffff) { - RAM_WRITE_BYTE_MIRRORED(0x1ffff) - return; - } - - if (address & 0xf00000) { - SekWriteByte(address & 0xfffff, data); - return; - } - - if ((address & 0xffc00) == 0x044000) { - DrvVidRegs[(address & 0x3ff)^1] = data; - update_video_regs(address); - return; - } - - switch (address) - { - case 0x0e0000: - case 0x0e0001: - input_select = data; - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - return; - - case 0x0e000e: // edf bootleg.. - case 0x0e000f: - MSM6295Command(0, data); - return; - } -} - -static void __fastcall megasys1B_main_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0x60000 && address <= 0x7ffff) { - RAM_WRITE_WORD(0x1ffff) - return; - } - - if (address & 0xf00000) { - SekWriteWord(address & 0xfffff, data); - return; - } - - if ((address & 0xffc00) == 0x044000) { - *((UINT16*)(DrvVidRegs + (address & 0x3fe))) = data; - update_video_regs(address); - return; - } - - switch (address) - { - case 0x0e0000: - input_select = data; - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - return; - - case 0x0e000e: // edf bootleg.. - case 0x0e000f: - MSM6295Command(0, data); - return; - } -} - -static UINT8 __fastcall megasys1C_main_read_byte(UINT32 address) -{ - if (address & 0xffe00000) { - return SekReadByte(address & 0x1fffff); - } - - switch (address) - { - case 0x0d8000: - return input_protection_read() >> 8; - - case 0x0d8001: - return input_protection_read(); - } - - return 0; -} - -static UINT16 __fastcall megasys1C_main_read_word(UINT32 address) -{ - if (address & 0xffe00000) { - return SekReadWord(address & 0x1fffff); - } - - switch (address) - { - case 0x0d8000: - return input_protection_read(); - } - - return 0; -} - -static void __fastcall megasys1C_main_write_byte(UINT32 address, UINT8 data) -{ - if (address >= 0x1c0000 && address <= 0x1fffff) { - RAM_WRITE_BYTE_MIRRORED(0xffff) - return; - } - - if (address & 0xffe00000) { - SekWriteByte(address & 0x1fffff, data); - return; - } - - if ((address & 0x1f0000) == 0x0c0000) { - DrvVidRegs[(address & 0xffff)^1] = data; - update_video_regs2(address); - return; - } - - switch (address) - { - case 0x0d8000: - case 0x0d8001: - input_select = data; - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - return; - } -} - -static void __fastcall megasys1C_main_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0x1c0000 && address <= 0x1fffff) { - RAM_WRITE_WORD(0xffff) - return; - } - - if (address & 0xffe00000) { - SekWriteWord(address & 0x1fffff, data); - return; - } - - if ((address & 0x1f0000) == 0x0c0000) { - *((UINT16*)(DrvVidRegs + (address & 0xfffe))) = data; - update_video_regs2(address); - return; - } - - switch (address) - { - case 0x0d8000: - input_select = data; - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - return; - } -} - -static UINT16 peekaboo_prot_read() -{ - switch (protection_val) - { - case 0x02: return 0x03; - case 0x51: return DrvInputs[0]; - case 0x52: return DrvInputs[1]; - } - - return protection_val; -} - -static void peekaboo_prot_write(INT32 data) -{ - protection_val = data; - - if ((protection_val & 0x90) == 0x90) - { - INT32 bank = (protection_val + 1) & 0x07; - if (oki_bank != bank) { - oki_bank = bank; - memcpy (DrvSndROM0 + 0x20000, DrvSndROM1 + bank * 0x20000, 0x20000); - } - } - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); -// hack - for some reason, setting irq line 4 isn't working, so simulate -// what is suppose to be doing. -// 000520: 33FC FFFF 001F 000A move.w #$ffff, $1f000a.l -// 000528: 4E73 rte - *((UINT16*)(Drv68KRAM0 + 0x000a)) = 0xffff; -} - -static void __fastcall megasys1D_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0x1f0000) == 0x0c0000) { - *((UINT16*)(DrvVidRegs + (address & 0xfffe))) = data; - update_video_regs2(address); - return; - } - - switch (address) - { - case 0x0f8000: - MSM6295Command(0, data & 0xff); - return; - - case 0x100000: - peekaboo_prot_write(data); - return; - } -} - -static void __fastcall megasys1D_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0x1f0000) == 0x0c0000) { - DrvVidRegs[(address & 0xffff)^1] = data; - update_video_regs2(address); - return; - } -} - -static UINT16 __fastcall megasys1D_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x0e0000: - return (DrvDips[1]<<8)|(DrvDips[0]); - - case 0x0f0000: - return DrvInputs[0]; - - case 0x0f8000: - return MSM6295ReadStatus(0); - - case 0x100000: - return peekaboo_prot_read(); - } - - return 0; -} - -static UINT8 __fastcall megasys1D_main_read_byte(UINT32 /*address*/) -{ - return 0; -} - -static UINT8 __fastcall megasys_sound_read_byte(UINT32 address) -{ - switch (address) - { - case 0x040000: - case 0x060000: - return soundlatch >> 8; - - case 0x060001: - case 0x040001: - return soundlatch; - - case 0x080000: - case 0x080001: - case 0x080002: - case 0x080003: - return BurnYM2151ReadStatus(); - - case 0x0a0000: - case 0x0a0001: - return (ignore_oki_status_hack) ? 0 : MSM6295ReadStatus(0); - - case 0x0c0000: - case 0x0c0001: - return (ignore_oki_status_hack) ? 0 : MSM6295ReadStatus(1); - } - - return 0; -} - -static UINT16 __fastcall megasys_sound_read_word(UINT32 address) -{ - switch (address) - { - case 0x040000: - case 0x060000: - return soundlatch; - - case 0x080002: - return BurnYM2151ReadStatus(); - - case 0x0a0000: - case 0x0a0001: - return (ignore_oki_status_hack) ? 0 : MSM6295ReadStatus(0); - - case 0x0c0000: - case 0x0c0001: - return (ignore_oki_status_hack) ? 0 : MSM6295ReadStatus(1); - } - - return 0; -} - -static void __fastcall megasys_sound_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x040000: - case 0x060000: - case 0x040001: - case 0x060001: - soundlatch2 = data; - return; - - case 0x080000: - case 0x080001: - BurnYM2151SelectRegister(data); - return; - - case 0x080002: - case 0x080003: - BurnYM2151WriteRegister(data); - return; - - case 0x0a0000: - case 0x0a0001: - case 0x0a0002: - case 0x0a0003: - MSM6295Command(0, data); - return; - - case 0x0c0000: - case 0x0c0001: - case 0x0c0002: - case 0x0c0003: - MSM6295Command(1, data); - return; - } -} - -static void __fastcall megasys_sound_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x040000: - case 0x060000: - soundlatch2 = data; - *((UINT16*)(DrvVidRegs + 0x8000)) = data; - return; - - case 0x080000: - BurnYM2151SelectRegister(data); - return; - - case 0x080002: - BurnYM2151WriteRegister(data); - return; - - case 0x0a0000: - case 0x0a0001: - case 0x0a0002: - case 0x0a0003: - MSM6295Command(0, data); - return; - - case 0x0c0000: - case 0x0c0001: - case 0x0c0002: - case 0x0c0003: - MSM6295Command(1, data); - return; - } -} - -static void __fastcall megasys1z_sound_write(UINT16 /*address*/, UINT8 /*data*/) -{ - -} - -static UINT8 __fastcall megasys1z_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - return soundlatch; - } - - return 0; -} - -static void __fastcall megasys1z_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - BurnYM2203Write(0, port & 1, data); - return; - } -} - -static UINT8 __fastcall megasys1z_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM2203Read(0, port & 1); - } - - return 0; -} - -static void DrvYM2151IrqHandler(INT32 nStatus) -{ - if (nStatus) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); -} - -static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3000000.0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - if (system_select == 0) { // system Z - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - } else { - SekOpen(1); - SekReset(); - SekClose(); - - MSM6295Reset(0); - MSM6295Reset(1); - BurnYM2151Reset(); - } - - for (INT32 i = 0; i < 3; i++) { - scrollx[i] = 0; - scrolly[i] = 0; - scroll_flag[i] = 0; - } - - memset (mcu_ram, 0, sizeof(mcu_ram)); - mcu_hs = 0; - - m_active_layers = 0; - sprite_flag = 0; - sprite_bank = 0; - screen_flag = 0; - - input_select = 0; - protection_val = 0; - - soundlatch = 0; - soundlatch2 = 0; - - oki_bank = 0xff; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM0 = Next; Next += 0x080000; - DrvZ80ROM = Next; - Drv68KROM1 = Next; Next += 0x020000; - - DrvGfxROM[0] = Next; Next += 0x100000; - DrvGfxROM[1] = Next; Next += 0x100000; - DrvGfxROM[2] = Next; Next += 0x100000; - DrvGfxROM[3] = Next; Next += 0x200000; - - DrvTransTab[0] = Next; Next += 0x100000 / (8 * 8); - DrvTransTab[1] = Next; Next += 0x100000 / (8 * 8); - DrvTransTab[2] = Next; Next += 0x100000 / (8 * 8); - DrvTransTab[3] = Next; Next += 0x200000 / (16 * 16); - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x100000; - - DrvPrioPROM = Next; Next += 0x000200; - - DrvPrioBitmap = Next; Next += 256 * 256; - - DrvSprBuf0 = Next; Next += 0x002000; - DrvObjBuf0 = Next; Next += 0x002000; - DrvSprBuf1 = Next; Next += 0x002000; - DrvObjBuf1 = Next; Next += 0x002000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x020000; - Drv68KRAM1 = Next; Next += 0x020000; - - DrvZ80RAM = Next; Next += 0x000800; - - DrvPalRAM = Next; Next += 0x000800; - DrvObjRAM = Next; Next += 0x002000; - - DrvScrRAM[0] = Next; Next += 0x004000; - DrvScrRAM[1] = Next; Next += 0x004000; - DrvScrRAM[2] = Next; Next += 0x004000; - - DrvVidRegs = Next; Next += 0x010000; - - DrvSprRAM = Drv68KRAM0 + 0x8000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(INT32 gfx, INT32 nLen, INT32 nType) -{ - INT32 Plane[4] = { STEP4(0,1) }; - INT32 XOffs[16] = { STEP8(0,4), STEP8(512,4) }; - INT32 YOffs[16] = { STEP16(0,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(nLen); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM[gfx], nLen); - - if (nType == 0) { // 8x8 - GfxDecode(((nLen*8)/4)/(8 * 8), 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM[gfx]); - } else { // 16x16 - GfxDecode(((nLen*8)/4)/(16*16), 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM[gfx]); - } - - BurnFree (tmp); - - INT32 size = (nType) ? 16 : 8; - - memset (DrvTransTab[gfx], 1, nLen / (size * size)); - - for (INT32 i = 0; i < nLen; i++) { - if (DrvGfxROM[gfx][i] != 0xff) { - DrvTransTab[gfx][i/(size*size)] = 0; - i = (i|((size*size)-1))+1; - } - } - - return 0; -} - -static void DrvPriorityDecode() -{ - const UINT8 *color_prom = DrvPrioPROM; - - for (INT32 pri_code = 0; pri_code < 0x10 ; pri_code++) // 16 priority codes - { - INT32 layers_order[2]; // 2 layers orders (split sprites on/off) - - for (INT32 offset = 0; offset < 2; offset ++) - { - INT32 enable_mask = 0xf; // start with every layer enabled - - layers_order[offset] = 0xfffff; - - do - { - INT32 top = color_prom[pri_code * 0x20 + offset + enable_mask * 2] & 3; // this must be the top layer - INT32 top_mask = 1 << top; - - INT32 result = 0; // result of the feasibility check for this layer - - for (INT32 i = 0; i < 0x10 ; i++) // every combination of opaque and transparent pens - { - int opacity = i & enable_mask; // only consider active layers - int layer = color_prom[pri_code * 0x20 + offset + opacity * 2]; - - if (opacity) - { - if (opacity & top_mask) - { - if (layer != top ) result |= 1; // error: opaque pens aren't always opaque! - } - else - { - if (layer == top) result |= 2; // transparent pen is opaque - else result |= 4; // transparent pen is transparent - } - } - } - - layers_order[offset] = ( (layers_order[offset] << 4) | top ) & 0xfffff; - enable_mask &= ~top_mask; - - if (result & 1) - { - layers_order[offset] = 0xfffff; - break; - } - - if ((result & 6) == 6) - { - layers_order[offset] = 0xfffff; - break; - } - - if (result == 2) enable_mask = 0; // totally opaque top layer - - } while (enable_mask); - } - - INT32 order = 0xfffff; - - for (INT32 i = 5; i > 0 ; ) // 5 layers to write - { - INT32 layer; - INT32 layer0 = layers_order[0] & 0x0f; - INT32 layer1 = layers_order[1] & 0x0f; - - if (layer0 != 3) // 0,1,2 or f - { - if (layer1 == 3) - { - layer = 4; - layers_order[0] <<= 4; // layer1 won't change next loop - } - else - { - layer = layer0; - if (layer0 != layer1) - { - order = 0xfffff; - break; - } - } - } - else // layer0 = 3; - { - if (layer1 == 3) - { - layer = 0x43; // 4 must always be present - order <<= 4; - i --; // 2 layers written at once - } - else - { - layer = 3; - layers_order[1] <<= 4; // layer1 won't change next loop - } - } - - order = (order << 4 ) | layer; - - i--; // layer written - - layers_order[0] >>= 4; - layers_order[1] >>= 4; - } - - m_layers_order[pri_code] = order & 0xfffff; - } -} - -static void phantasm_rom_decode() -{ -#define BITSWAP_0 BITSWAP16(x,0xd,0xe,0xf,0x0,0x1,0x8,0x9,0xa,0xb,0xc,0x5,0x6,0x7,0x2,0x3,0x4) -#define BITSWAP_1 BITSWAP16(x,0xf,0xd,0xb,0x9,0x7,0x5,0x3,0x1,0xe,0xc,0xa,0x8,0x6,0x4,0x2,0x0) -#define BITSWAP_2 BITSWAP16(x,0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0xb,0xa,0x9,0x8,0xf,0xe,0xd,0xc) - - UINT16 *prg = (UINT16*)Drv68KROM0; - - for (INT32 i = 0 ; i < 0x40000 / 2; i++) - { - UINT16 x,y; - - x = prg[i]; - - if (i < 0x08000/2) { if ((i | (0x248/2)) != i) { y = BITSWAP_0; } else { y = BITSWAP_1; } } - else if (i < 0x10000/2) { y = BITSWAP_2; } - else if (i < 0x18000/2) { if ((i | (0x248/2)) != i) { y = BITSWAP_0; } else { y = BITSWAP_1; } } - else if (i < 0x20000/2) { y = BITSWAP_1; } - else { y = BITSWAP_2; } - - prg[i] = y; - } - -#undef BITSWAP_0 -#undef BITSWAP_1 -#undef BITSWAP_2 -} - -static void astyanax_rom_decode() -{ -#define BITSWAP_0 BITSWAP16(x,0xd,0xe,0xf,0x0,0xa,0x9,0x8,0x1,0x6,0x5,0xc,0xb,0x7,0x2,0x3,0x4) -#define BITSWAP_1 BITSWAP16(x,0xf,0xd,0xb,0x9,0x7,0x5,0x3,0x1,0x8,0xa,0xc,0xe,0x0,0x2,0x4,0x6) -#define BITSWAP_2 BITSWAP16(x,0x4,0x5,0x6,0x7,0x0,0x1,0x2,0x3,0xb,0xa,0x9,0x8,0xf,0xe,0xd,0xc) - - UINT16 *prg = (UINT16*)Drv68KROM0; - - for (INT32 i = 0 ; i < 0x40000 / 2; i++) - { - UINT16 x,y; - - x = prg[i]; - - if (i < 0x08000/2) { if ((i | (0x248/2)) != i) {y = BITSWAP_0;} else {y = BITSWAP_1;} } - else if (i < 0x10000/2) { y = BITSWAP_2; } - else if (i < 0x18000/2) { if ((i | (0x248/2)) != i) {y = BITSWAP_0;} else {y = BITSWAP_1;} } - else if (i < 0x20000/2) { y = BITSWAP_1; } - else { y = BITSWAP_2; } - - prg[i] = y; - } - -#undef BITSWAP_0 -#undef BITSWAP_1 -#undef BITSWAP_2 -} - -static void rodland_rom_decode() -{ -#define BITSWAP_0 BITSWAP16(x,0xd,0x0,0xa,0x9,0x6,0xe,0xb,0xf,0x5,0xc,0x7,0x2,0x3,0x8,0x1,0x4); -#define BITSWAP_1 BITSWAP16(x,0x4,0x5,0x6,0x7,0x0,0x1,0x2,0x3,0xb,0xa,0x9,0x8,0xf,0xe,0xd,0xc); -#define BITSWAP_2 BITSWAP16(x,0xf,0xd,0xb,0x9,0xc,0xe,0x0,0x7,0x5,0x3,0x1,0x8,0xa,0x2,0x4,0x6); -#define BITSWAP_3 BITSWAP16(x,0x4,0x5,0x1,0x2,0xe,0xd,0x3,0xb,0xa,0x9,0x6,0x7,0x0,0x8,0xf,0xc); - - UINT16 *prg = (UINT16*)Drv68KROM0; - - for (INT32 i = 0 ; i < 0x40000 / 2; i++) - { - UINT16 x,y; - - x = prg[i]; - - if (i < 0x08000/2) { if ((i | (0x248/2)) != i) { y = BITSWAP_0; } else { y = BITSWAP_1; } } - else if (i < 0x10000/2) { if ((i | (0x248/2)) != i) { y = BITSWAP_2; } else { y = BITSWAP_3; } } - else if (i < 0x18000/2) { if ((i | (0x248/2)) != i) { y = BITSWAP_0; } else { y = BITSWAP_1; } } - else if (i < 0x20000/2) { y = BITSWAP_1; } - else { y = BITSWAP_3; } - - prg[i] = y; - } - -#undef BITSWAP_0 -#undef BITSWAP_1 -#undef BITSWAP_2 -#undef BITSWAP_3 -} - -static INT32 DrvLoadRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - - UINT8 *Prg0Load = Drv68KROM0; - UINT8 *Prg1Load = Drv68KROM1; - UINT8 *Gfx0Load = DrvGfxROM[0]; - UINT8 *Gfx1Load = DrvGfxROM[1]; - UINT8 *Gfx2Load = DrvGfxROM[2]; - UINT8 *Gfx3Load = DrvGfxROM[3]; - UINT8 *Snd0Load = DrvSndROM0; - UINT8 *Snd1Load = DrvSndROM1; - UINT8 *PromLoad = DrvPrioPROM; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) - { - BurnDrvGetRomInfo(&ri, i); - - if (ri.nType & BRF_NODUMP) continue; - - if ((ri.nType & 0x0f) == 1) { - if (BurnLoadRom(Prg0Load + 1, i + 0, 2)) return 1; - if (BurnLoadRom(Prg0Load + 0, i + 1, 2)) return 1; - Prg0Load += ri.nLen * 2; i++; - } - - if ((ri.nType & 0x0f) == 2) { - if (BurnLoadRom(Prg1Load + 1, i + 0, 2)) return 1; - if (BurnLoadRom(Prg1Load + 0, i + 1, 2)) return 1; - Prg1Load += ri.nLen * 2; i++; - } - - if ((ri.nType & 0x0f) == 3) { - if (BurnLoadRom(Gfx0Load, i, 1)) return 1; - Gfx0Load += ri.nLen; - } - - if ((ri.nType & 0x0f) == 4) { - if (BurnLoadRom(Gfx1Load, i, 1)) return 1; - Gfx1Load += ri.nLen; - } - - if ((ri.nType & 0x0f) == 5) { - if (BurnLoadRom(Gfx2Load, i, 1)) return 1; - Gfx2Load += ri.nLen; - } - - if ((ri.nType & 0x0f) == 6) { - if (BurnLoadRom(Gfx3Load, i, 1)) return 1; - Gfx3Load += ri.nLen; - } - - if ((ri.nType & 0x0f) == 7) { - if (BurnLoadRom(Snd0Load, i, 1)) return 1; - Snd0Load += ri.nLen; - } - - if ((ri.nType & 0x0f) == 8) { - if (BurnLoadRom(Snd1Load, i, 1)) return 1; - Snd1Load += ri.nLen; - } - - if ((ri.nType & 0x0f) == 9) { - if (BurnLoadRom(PromLoad, i, 1)) return 1; - PromLoad += ri.nLen; - } - - if ((ri.nType & 0x0f) == 10) { - if (BurnLoadRom(Prg1Load, i, 1)) return 1; - Prg1Load += ri.nLen; - } - } - - if ((PromLoad - DrvPrioPROM) != 0) { - DrvPriorityDecode(); - } - - return 0; -} - -static INT32 SystemInit(INT32 nSystem, void (*pRomLoadCallback)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (DrvLoadRoms()) return 1; - - if (pRomLoadCallback) { - pRomLoadCallback(); - } - - DrvGfxDecode(0, 0x080000, 0); - DrvGfxDecode(1, 0x080000, 0); - DrvGfxDecode(2, 0x080000, 0); - DrvGfxDecode(3, 0x100000, 1); - } - - system_select = nSystem; - - switch (system_select) - { - case 0x0: // system Z - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(DrvVidRegs, 0x084000, 0x0843ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvObjRAM, 0x08e000, 0x08ffff, MAP_RAM); - SekMapMemory(DrvScrRAM[0], 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvScrRAM[1], 0x094000, 0x097fff, MAP_RAM); - SekMapMemory(DrvScrRAM[2], 0x098000, 0x09bfff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetReadWordHandler(0, megasys1A_main_read_word); - SekSetReadByteHandler(0, megasys1A_main_read_byte); - SekSetWriteWordHandler(0, megasys1A_main_write_word); - SekSetWriteByteHandler(0, megasys1A_main_write_byte); - - SekMapHandler(1, 0x088000, 0x0887ff, MAP_WRITE); - SekSetWriteWordHandler(1, megasys_palette_write_word); - SekSetWriteByteHandler(1, megasys_palette_write_byte); - SekClose(); - } - break; - - case 0xA: // system A - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(DrvVidRegs, 0x084000, 0x0843ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvObjRAM, 0x08e000, 0x08ffff, MAP_RAM); - SekMapMemory(DrvScrRAM[0], 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvScrRAM[1], 0x094000, 0x097fff, MAP_RAM); - SekMapMemory(DrvScrRAM[2], 0x098000, 0x09bfff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x0f0000, 0x0fffff, MAP_ROM); // writes handled in write handlers (mirrored bytes) - SekSetReadWordHandler(0, megasys1A_main_read_word); - SekSetReadByteHandler(0, megasys1A_main_read_byte); - SekSetWriteWordHandler(0, megasys1A_main_write_word); - SekSetWriteByteHandler(0, megasys1A_main_write_byte); - - SekMapHandler(1, 0x088000, 0x0887ff, MAP_WRITE); - SekSetWriteWordHandler(1, megasys_palette_write_word); - SekSetWriteByteHandler(1, megasys_palette_write_byte); - SekClose(); - } - break; - - case 0xB: // system B - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvVidRegs, 0x044000, 0x0443ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvPalRAM, 0x048000, 0x0487ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvObjRAM, 0x04e000, 0x04ffff, MAP_RAM); - SekMapMemory(DrvScrRAM[0], 0x050000, 0x053fff, MAP_RAM); - SekMapMemory(DrvScrRAM[1], 0x054000, 0x057fff, MAP_RAM); - SekMapMemory(DrvScrRAM[2], 0x058000, 0x05bfff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x060000, 0x07ffff, MAP_RAM); // mirrored bytes breaks EDF, use regular writes for system B - SekMapMemory(Drv68KROM0 + 0x40000, 0x080000, 0x0bffff, MAP_ROM); - SekSetReadWordHandler(0, megasys1B_main_read_word); - SekSetReadByteHandler(0, megasys1B_main_read_byte); - SekSetWriteWordHandler(0, megasys1B_main_write_word); - SekSetWriteByteHandler(0, megasys1B_main_write_byte); - - SekMapHandler(1, 0x048000, 0x0487ff, MAP_WRITE); - SekSetWriteWordHandler(1, megasys_palette_write_word); - SekSetWriteByteHandler(1, megasys_palette_write_byte); - - SekClose(); - } - break; - - case 0xC: // system C - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvVidRegs, 0x0c0000, 0x0cffff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvObjRAM, 0x0d2000, 0x0d3fff, MAP_RAM); - SekMapMemory(DrvScrRAM[0], 0x0e0000, 0x0e3fff, MAP_RAM); - SekMapMemory(DrvScrRAM[0], 0x0e4000, 0x0e7fff, MAP_RAM); // mirror - SekMapMemory(DrvScrRAM[1], 0x0e8000, 0x0ebfff, MAP_RAM); - SekMapMemory(DrvScrRAM[1], 0x0ec000, 0x0effff, MAP_RAM); // mirror - SekMapMemory(DrvScrRAM[2], 0x0f0000, 0x0f3fff, MAP_RAM); - SekMapMemory(DrvScrRAM[2], 0x0f4000, 0x0f7fff, MAP_RAM); // mirror - SekMapMemory(DrvPalRAM, 0x0f8000, 0x0f87ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(Drv68KRAM0, 0x1c0000, 0x1cffff, MAP_ROM); // writes handled in write handlers (mirrored bytes) - SekMapMemory(Drv68KRAM0, 0x1d0000, 0x1dffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x1e0000, 0x1effff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x1f0000, 0x1fffff, MAP_ROM); - SekSetReadWordHandler(0, megasys1C_main_read_word); - SekSetReadByteHandler(0, megasys1C_main_read_byte); - SekSetWriteWordHandler(0, megasys1C_main_write_word); - SekSetWriteByteHandler(0, megasys1C_main_write_byte); - - SekMapHandler(1, 0x0f8000, 0x0f87ff, MAP_WRITE); - SekSetWriteWordHandler(1, megasys_palette_write_word); - SekSetWriteByteHandler(1, megasys_palette_write_byte); - SekClose(); - } - break; - - case 0xD: // system D - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvVidRegs, 0x0c0000, 0x0c9fff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvObjRAM, 0x0ca000, 0x0cbfff, MAP_RAM); - SekMapMemory(DrvScrRAM[1], 0x0d0000, 0x0d3fff, MAP_RAM); - SekMapMemory(DrvScrRAM[2], 0x0d4000, 0x0d7fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0d8000, 0x0d87ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvPalRAM, 0x0d9000, 0x0d97ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvPalRAM, 0x0da000, 0x0da7ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvPalRAM, 0x0db000, 0x0db7ff, MAP_ROM /*MAP_WRITE*/); - SekMapMemory(DrvScrRAM[0], 0x0e8000, 0x0ebfff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x1f0000, 0x1fffff, MAP_RAM); - SekSetReadWordHandler(0, megasys1D_main_read_word); - SekSetReadByteHandler(0, megasys1D_main_read_byte); - SekSetWriteWordHandler(0, megasys1D_main_write_word); - SekSetWriteByteHandler(0, megasys1D_main_write_byte); - - SekMapHandler(1, 0x0d8000, 0x0db7ff, MAP_WRITE); - SekSetWriteWordHandler(1, megasys_palette_write_word); - SekSetWriteByteHandler(1, megasys_palette_write_byte); - SekClose(); - } - break; - } - - if (system_select == 0) // system Z - { - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(megasys1z_sound_write); - ZetSetReadHandler(megasys1z_sound_read); - ZetSetOutHandler(megasys1z_sound_write_port); - ZetSetInHandler(megasys1z_sound_read_port); - ZetClose(); - - BurnYM2203Init(2, 1500000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.50, BURN_SND_ROUTE_BOTH); - - layer_color_config[0] = 0; - layer_color_config[1] = 0x200; - layer_color_config[2] = 0; // layer doesn't exist - layer_color_config[3] = 0x100; // sprites - } - else - { - // not in system D - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Drv68KROM1, 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0x0e0000, 0x0fffff, MAP_RAM); - SekSetReadWordHandler(0, megasys_sound_read_word); - SekSetReadByteHandler(0, megasys_sound_read_byte); - SekSetWriteWordHandler(0, megasys_sound_write_word); - SekSetWriteByteHandler(0, megasys_sound_write_byte); - SekClose(); - - // not in system D - BurnYM2151Init(3500000); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.80, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.80, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, ((system_select == 0xD) ? 2000000 : 4000000) / 132, 1); - MSM6295SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - - // not in system D - MSM6295Init(1, 4000000 / 132, 1); - MSM6295SetRoute(1, 0.30, BURN_SND_ROUTE_BOTH); - } - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - if (system_select == 0) { // system Z - ZetExit(); - BurnYM2203Exit(); - } else { - BurnYM2151Exit(); - MSM6295Exit(0); - MSM6295Exit(1); - } - - SekExit(); - -#ifdef BUILD_A68K - if (tshingen) { - if (!oldasmemulation) - bprintf(0, _T("Switching back to Musashi 68K core\n")); - bBurnUseASMCPUEmulation = oldasmemulation; - oldasmemulation = 0; - } -#endif - - ignore_oki_status_hack = 1; - system_select = 0; - - scroll_factor_8x8[1] = 1; - - layer_color_config[0] = 0; - layer_color_config[1] = 0x100; - layer_color_config[2] = 0x200; - layer_color_config[3] = 0x300; - - monkelf = 0; - tshingen = 0; - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static inline void draw_16x16_priority_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, UINT8 mosaic, UINT8 mosaicsol, INT32 priority) -{ - if (sy >= nScreenHeight || sy < -15 || sx >= nScreenWidth || sx < -15) return; - - UINT8 *gfx = DrvGfxROM[3] + (code * 0x100); - - flipy = (flipy) ? 0x0f : 0; - flipx = (flipx) ? 0x0f : 0; - - color = (color * 16) + layer_color_config[3]; - - UINT16 *dest = pTransDraw + sy * nScreenWidth + sx; - UINT8 *prio = DrvPrioBitmap + sy * nScreenWidth + sx; - - for (INT32 y = 0; y < 16; y++, sy++, sx-=16) - { - for (INT32 x = 0; x < 16; x++, sx++) - { - if (sx < 0 || sy < 0 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 pxl; - - if (mosaicsol) { - pxl = gfx[(((y ^ flipy) | mosaic) * 16) + ((x ^ flipx) | mosaic)]; - } else { - pxl = gfx[(((y ^ flipy) & ~mosaic) * 16) + ((x ^ flipx) & ~mosaic)]; - } - - if (pxl != 0x0f) { - if ((priority & (1 << (prio[x] & 0x1f))) == 0 && prio[x] < 0x80) { - dest[x] = pxl + color; - prio[x] |= 0x80; - } - } - } - dest += nScreenWidth; - prio += nScreenWidth; - } -} - -static void System1A_draw_sprites() -{ - INT32 color_mask = (sprite_flag & 0x100) ? 0x07 : 0x0f; - - UINT16 *objectram = (UINT16*)DrvObjBuf1; - UINT16 *spriteram = (UINT16*)DrvSprBuf1; - - for (INT32 offs = (0x800-8)/2; offs >= 0; offs -= 4) - { - for (INT32 sprite = 0; sprite < 4 ; sprite ++) - { - UINT16 *objectdata = &objectram[offs + (0x800/2) * sprite]; - UINT16 *spritedata = &spriteram[(objectdata[0] & 0x7f) * 8]; - - INT32 attr = spritedata[4]; - if (((attr & 0xc0) >> 6) != sprite) continue; - - INT32 sx = (spritedata[5] + objectdata[1]) & 0x1ff; - INT32 sy = (spritedata[6] + objectdata[2]) & 0x1ff; - - if (sx > 255) sx -= 512; - if (sy > 255) sy -= 512; - - INT32 code = spritedata[7] + objectdata[3]; - INT32 color = attr & color_mask; - - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - INT32 pri = (attr & 0x08) ? 0x0c : 0x0a; - INT32 mosaic = (attr & 0x0f00)>>8; - INT32 mossol = (attr & 0x1000)>>8; //not yet - - code = (code & 0xfff) + ((sprite_bank & 1) << 12); - if (DrvTransTab[3][code]) continue; - - if (screen_flag & 1) - { - flipx = !flipx; - flipy = !flipy; - sx = 240 - sx; - sy = 240 - sy; - } - - draw_16x16_priority_sprite(code, color, sx, sy - 16, flipx, flipy, mosaic, mossol, pri); - } - } -} - -static void System1Z_draw_sprites() -{ - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - - for (INT32 sprite = 0x80-1; sprite >= 0; sprite--) - { - UINT16 *spritedata = &spriteram16[sprite * 8]; - - INT32 attr = spritedata[4]; - - INT32 sx = spritedata[5] & 0x1ff; - INT32 sy = spritedata[6] & 0x1ff; - - if (sx > 255) sx -= 512; - if (sy > 255) sy -= 512; - - INT32 code = spritedata[7] & 0x3ff; - if (DrvTransTab[3][code]) continue; - - INT32 color = attr & 0x0f; - - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - INT32 pri = (attr & 0x08) ? 0x0c : 0x0a; - - if (screen_flag & 1) - { - flipx = !flipx; - flipy = !flipy; - sx = 240 - sx; - sy = 240 - sy; - } - - draw_16x16_priority_sprite(code, color, sx, sy - 16, flipx, flipy, 0, 0, pri); - } -} - -static void draw_layer(INT32 tmap, INT32 flags, INT32 priority) -{ - INT32 layer = scroll_flag[tmap] & 0x03; - INT32 size =(scroll_flag[tmap] & 0x10) >> 4; // 1 - 8x8, 0 - 16x16 - - INT32 type[2][4][2] = { { { 16, 2 }, { 8, 4 }, { 4, 8 }, { 2, 16 } }, { { 8, 1 }, { 4, 2 }, { 4, 2 }, { 2, 4 } } }; - INT32 trans_mask = (flags) ? 0xff : 0x0f; - INT32 color_base = layer_color_config[tmap]; - - UINT8 *gfxbase = DrvGfxROM[tmap]; - UINT16 *vidram = (UINT16*)DrvScrRAM[tmap]; - - INT32 columns = type[size][layer][0]; - INT32 rows = type[size][layer][1]; - INT32 width = columns * 32; - INT32 height = rows * 32; - - INT32 xscroll = scrollx[tmap] & ((width * 8)-1); - INT32 yscroll = (scrolly[tmap] + 16) & ((height * 8)-1); - - for (INT32 row = 0; row < height; row++) - { - for (INT32 col = 0; col < width; col++) - { - INT32 ofst, code; - INT32 sx = (col * 8) - xscroll; - INT32 sy = (row * 8) - yscroll; - - if (sx < -7) sx += width * 8; - if (sy < -7) sy += height * 8; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (size) { - ofst = (col * 32) + (row / 32) * 1024 * columns + (row & 0x1f); - code = (vidram[ofst] & 0x0fff) * scroll_factor_8x8[tmap]; - } else { - ofst = (((col / 2) * 16) + (row / 32) * 256 * columns + ((row / 2) & 0x0f)); - code = (vidram[ofst] & 0xfff) * 4 + ((row & 1) + (col & 1) * 2); - } - - if (flags == 0 && DrvTransTab[tmap][code]) continue; - - INT32 color = ((vidram[ofst] >> 12) * 16) + color_base; - - { - UINT8 *gfx = gfxbase + code * 0x40; - UINT16 *dest = pTransDraw + sy * nScreenWidth + sx; - UINT8 *prio = DrvPrioBitmap + sy * nScreenWidth + sx; - - for (INT32 y = 0; y < 8; y++, sy++, sx-=8) { - if (sy >= nScreenHeight) break; - - for (INT32 x = 0; x < 8; x++, sx++, gfx++) { - if (sx < 0 || sy < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = *gfx; - if (pxl != trans_mask) { - dest[x] = pxl + color; - prio[x] = priority; - } - } - - dest += nScreenWidth; - prio += nScreenWidth; - } - } - } - } -} - -static void screen_update() -{ - int reallyactive = 0; - - UINT32 pri = m_layers_order[(m_active_layers & 0x0f0f) >> 8]; - - if (pri == 0xfffff) pri = 0x04132; - - for (INT32 i = 0;i < 5;i++) { - reallyactive |= 1 << ((pri >> (4 * i)) & 0x0f); - } - - INT32 active_layers = (m_active_layers & reallyactive) | (1 << ((pri & 0xf0000) >> 16)); - - if (system_select == 0) { - active_layers = 0x000b; - pri = 0x0314f; - } - - INT32 flag = 1; - UINT32 primask = 0; - - for (INT32 i = 0; i < 5; i++) - { - int layer = (pri & 0xf0000) >> 16; - pri <<= 4; - - switch (layer) - { - case 0: - case 1: - case 2: - if (active_layers & (1 << layer)) - { - if (nSpriteEnable & (1< 0) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 System1BFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - - { - memset (DrvInputs, 0xff, 6); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 8000000 / 60, 7000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - SekOpen(0); - nSegment = (nCyclesTotal[0] * (i + 1)) / nInterleave; - nCyclesDone[0] += SekRun(nSegment - nCyclesDone[0]); - if (i == 0) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == 128) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - if (i == 240) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - SekOpen(1); - nSegment = (nCyclesTotal[1] * (i + 1)) / nInterleave; - if (sound_cpu_reset) { - nCyclesDone[1] += SekIdle(nSegment - nCyclesDone[1]); - } else { - nCyclesDone[1] += SekRun(nSegment - nCyclesDone[1]); - } - - if (pBurnSoundOut && i%8 == 7) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - SekClose(); - } - - SekOpen(1); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength > 0) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 System1CFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - - { - memset (DrvInputs, 0xff, 6); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 60, 7000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - SekOpen(0); - nSegment = (nCyclesTotal[0] * (i + 1)) / nInterleave; - nCyclesDone[0] += SekRun(nSegment - nCyclesDone[0]); - if (i == 0) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == 128) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - if (i == 240) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - SekOpen(1); - nSegment = (nCyclesTotal[1] * (i + 1)) / nInterleave; - if (sound_cpu_reset) { - nCyclesDone[1] += SekIdle(nSegment - nCyclesDone[1]); - } else { - nCyclesDone[1] += SekRun(nSegment - nCyclesDone[1]); - } - - if (pBurnSoundOut && i%8 == 7) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - SekClose(); - } - - SekOpen(1); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength > 0) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 System1DFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 6); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - SekOpen(0); - SekRun(8000000 / 60); - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * sizeof(INT16) * 2); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - if (system_select == 0) { - ZetScan(nAction); - BurnYM2203Scan(nAction, pnMin); - } else { - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - } - - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - SCAN_VAR(soundlatch); - SCAN_VAR(soundlatch2); - SCAN_VAR(scroll_flag); - SCAN_VAR(m_active_layers); - SCAN_VAR(sprite_flag); - SCAN_VAR(sprite_bank); - SCAN_VAR(screen_flag); - - SCAN_VAR(input_select); - SCAN_VAR(protection_val); - - SCAN_VAR(mcu_ram); - SCAN_VAR(mcu_hs); - - SCAN_VAR(sound_cpu_reset); - SCAN_VAR(oki_bank); - } - - if (nAction & ACB_WRITE) { - if (system_select == 0xD) { - memcpy (DrvSndROM0 + 0x20000, DrvSndROM1 + oki_bank * 0x20000, 0x20000); - } - } - - return 0; -} - - -// P-47 - The Phantom Fighter (World) - -static struct BurnRomInfo p47RomDesc[] = { - { "p47us3.bin", 0x20000, 0x022e58b8, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "p47us1.bin", 0x20000, 0xed926bd8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "p47j_9.bin", 0x10000, 0xffcf318e, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "p47j_19.bin", 0x10000, 0xadb8c12e, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "p47j_5.bin", 0x20000, 0xfe65b65c, 3 | BRF_GRA }, // 4 Tilemap #0 Tiles - { "p47j_6.bin", 0x20000, 0xe191d2d2, 3 | BRF_GRA }, // 5 - { "p47j_7.bin", 0x20000, 0xf77723b7, 3 | BRF_GRA }, // 6 - - { "p47j_23.bin", 0x20000, 0x6e9bc864, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - { "p47j_12.bin", 0x20000, 0x5268395f, 4 | BRF_GRA }, // 8 - - { "p47us16.bin", 0x10000, 0x5a682c8f, 5 | BRF_GRA }, // 9 Tilemap #2 Tiles - - { "p47j_27.bin", 0x20000, 0x9e2bde8e, 6 | BRF_GRA }, // 10 Sprites - { "p47j_18.bin", 0x20000, 0x29d8f676, 6 | BRF_GRA }, // 11 - { "p47j_26.bin", 0x20000, 0x4d07581a, 6 | BRF_GRA }, // 12 - - { "p47j_20.bin", 0x20000, 0x2ed53624, 7 | BRF_SND }, // 13 OKI #0 Samples - { "p47j_21.bin", 0x20000, 0x6f56b56d, 7 | BRF_SND }, // 14 - - { "p47j_10.bin", 0x20000, 0xb9d79c1e, 8 | BRF_SND }, // 15 OKI #1 Samples - { "p47j_11.bin", 0x20000, 0xfa0d1887, 8 | BRF_SND }, // 16 - - { "p-47.14m", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 17 Priority PROM -}; - -STD_ROM_PICK(p47) -STD_ROM_FN(p47) - -static void p47RomLoadCallback() -{ - memmove (DrvGfxROM[1] + 0x020000, DrvGfxROM[1] + 0x000000, 0x040000); - memmove (DrvGfxROM[3] + 0x060000, DrvGfxROM[3] + 0x040000, 0x020000); -} - -static INT32 p47Init() -{ - return SystemInit(0xA, p47RomLoadCallback); -} - -struct BurnDriver BurnDrvP47 = { - "p47", NULL, NULL, NULL, "1988", - "P-47 - The Phantom Fighter (World)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, p47RomInfo, p47RomName, NULL, NULL, CommonInputInfo, P47DIPInfo, - p47Init, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// P-47 - The Freedom Fighter (Japan) - -static struct BurnRomInfo p47jRomDesc[] = { - { "p47j_3.bin", 0x20000, 0x11c655e5, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "p47j_1.bin", 0x20000, 0x0a5998de, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "p47j_9.bin", 0x10000, 0xffcf318e, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "p47j_19.bin", 0x10000, 0xadb8c12e, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "p47j_5.bin", 0x20000, 0xfe65b65c, 3 | BRF_GRA }, // 4 Tilemap #0 Tiles - { "p47j_6.bin", 0x20000, 0xe191d2d2, 3 | BRF_GRA }, // 5 - { "p47j_7.bin", 0x20000, 0xf77723b7, 3 | BRF_GRA }, // 6 - - { "p47j_23.bin", 0x20000, 0x6e9bc864, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - { "p47j_12.bin", 0x20000, 0x5268395f, 4 | BRF_GRA }, // 8 - - { "p47j_16.bin", 0x10000, 0x30e44375, 5 | BRF_GRA }, // 9 Tilemap #2 Tiles - - { "p47j_27.bin", 0x20000, 0x9e2bde8e, 6 | BRF_GRA }, // 10 Sprites - { "p47j_18.bin", 0x20000, 0x29d8f676, 6 | BRF_GRA }, // 11 - { "p47j_26.bin", 0x20000, 0x4d07581a, 6 | BRF_GRA }, // 12 - - { "p47j_20.bin", 0x20000, 0x2ed53624, 7 | BRF_SND }, // 13 OKI #0 Samples - { "p47j_21.bin", 0x20000, 0x6f56b56d, 7 | BRF_SND }, // 14 - - { "p47j_10.bin", 0x20000, 0xb9d79c1e, 8 | BRF_SND }, // 15 OKI #1 Samples - { "p47j_11.bin", 0x20000, 0xfa0d1887, 8 | BRF_SND }, // 16 - - { "p-47.14m", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 17 Priority PROM -}; - -STD_ROM_PICK(p47j) -STD_ROM_FN(p47j) - -struct BurnDriver BurnDrvP47j = { - "p47j", "p47", NULL, NULL, "1988", - "P-47 - The Freedom Fighter (Japan)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, p47jRomInfo, p47jRomName, NULL, NULL, CommonInputInfo, P47DIPInfo, - p47Init, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// P-47 - The Freedom Fighter (Japan, Export) - -static struct BurnRomInfo p47jeRomDesc[] = { - { "export_p-47_3.rom2", 0x20000, 0x37185412, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "export_p-47_1.rom1", 0x20000, 0x3925dd4f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "p47j_9.bin", 0x10000, 0xffcf318e, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "p47j_19.bin", 0x10000, 0xadb8c12e, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "p47j_5.bin", 0x20000, 0xfe65b65c, 3 | BRF_GRA }, // 4 Tilemap #0 Tiles - { "p47j_6.bin", 0x20000, 0xe191d2d2, 3 | BRF_GRA }, // 5 - { "p47j_7.bin", 0x20000, 0xf77723b7, 3 | BRF_GRA }, // 6 - - { "p47j_23.bin", 0x20000, 0x6e9bc864, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - { "p47j_12.bin", 0x20000, 0x5268395f, 4 | BRF_GRA }, // 8 - - { "p47j_16.bin", 0x10000, 0x30e44375, 5 | BRF_GRA }, // 9 Tilemap #2 Tiles - - { "p47j_27.bin", 0x20000, 0x9e2bde8e, 6 | BRF_GRA }, // 10 Sprites - { "p47j_18.bin", 0x20000, 0x29d8f676, 6 | BRF_GRA }, // 11 - { "export_17.rom15", 0x20000, 0xb6c2e241, 6 | BRF_GRA }, // 12 - { "p47j_26.bin", 0x20000, 0x4d07581a, 6 | BRF_GRA }, // 13 - - { "p47j_20.bin", 0x20000, 0x2ed53624, 7 | BRF_SND }, // 14 OKI #0 Samples - { "p47j_21.bin", 0x20000, 0x6f56b56d, 7 | BRF_SND }, // 15 - - { "p47j_10.bin", 0x20000, 0xb9d79c1e, 8 | BRF_SND }, // 16 OKI #1 Samples - { "p47j_11.bin", 0x20000, 0xfa0d1887, 8 | BRF_SND }, // 17 - - { "p-47.14m", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 18 Priority PROM -}; - -STD_ROM_PICK(p47je) -STD_ROM_FN(p47je) - -static void p47jeCallback() -{ - memmove (DrvGfxROM[1] + 0x020000, DrvGfxROM[1] + 0x000000, 0x040000); -} - -static INT32 p47jeInit() -{ - return SystemInit(0xA, p47jeCallback); -} - -struct BurnDriver BurnDrvP47je = { - "p47je", "p47", NULL, NULL, "1988", - "P-47 - The Freedom Fighter (Japan, Export)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, p47jeRomInfo, p47jeRomName, NULL, NULL, CommonInputInfo, P47DIPInfo, - p47jeInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Kick Off (Japan) - -static struct BurnRomInfo kickoffRomDesc[] = { - { "kioff03.rom", 0x10000, 0x3b01be65, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "kioff01.rom", 0x10000, 0xae6e68a1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "kioff09.rom", 0x10000, 0x1770e980, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "kioff19.rom", 0x10000, 0x1b03bbe4, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "kioff05.rom", 0x20000, 0xe7232103, 3 | BRF_GRA }, // 4 Tilemap #0 Tiles - { "kioff06.rom", 0x20000, 0xa0b3cb75, 3 | BRF_GRA }, // 5 - { "kioff07.rom", 0x20000, 0xed649919, 3 | BRF_GRA }, // 6 - { "kioff10.rom", 0x20000, 0xfd739fec, 3 | BRF_GRA }, // 7 - - { "kioff16.rom", 0x20000, 0x22c46314, 5 | BRF_GRA }, // 8 Tilemap #2 Tiles - - { "kioff27.rom", 0x20000, 0xca221ae2, 6 | BRF_GRA }, // 9 Sprites - { "kioff18.rom", 0x20000, 0xd7909ada, 6 | BRF_GRA }, // 10 - { "kioff17.rom", 0x20000, 0xf171559e, 6 | BRF_GRA }, // 11 - { "kioff26.rom", 0x20000, 0x2a90df1b, 6 | BRF_GRA }, // 12 - - { "kioff20.rom", 0x20000, 0x5c28bd2d, 7 | BRF_SND }, // 13 OKI #0 Samples - { "kioff21.rom", 0x20000, 0x195940cf, 7 | BRF_SND }, // 14 - - { "kioff20.rom", 0x20000, 0x5c28bd2d, 8 | BRF_SND }, // 15 OKI #1 Samples - { "kioff21.rom", 0x20000, 0x195940cf, 8 | BRF_SND }, // 16 - - { "kick.bin", 0x00200, 0x85b30ac4, 9 | BRF_GRA }, // 17 Priority PROM -}; - -STD_ROM_PICK(kickoff) -STD_ROM_FN(kickoff) - -static void kickoffCallback() -{ - memset (DrvGfxROM[1], 0xff, 0x80000); -} - -static INT32 kickoffInit() -{ - return SystemInit(0xA, kickoffCallback); -} - -struct BurnDriver BurnDrvKickoff = { - "kickoff", NULL, NULL, NULL, "1988", - "Kick Off (Japan)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, kickoffRomInfo, kickoffRomName, NULL, NULL, CommonInputInfo, KickoffDIPInfo, - kickoffInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Shingen Samurai-Fighter (Japan, English) - -static struct BurnRomInfo tshingenRomDesc[] = { - { "shing_02.rom", 0x20000, 0xd9ab5b78, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "shing_01.rom", 0x20000, 0xa9d2de20, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "takeda5.bin", 0x10000, 0xfbdc51c0, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "takeda6.bin", 0x10000, 0x8fa65b69, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "takeda11.bin", 0x20000, 0xbf0b40a6, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - { "shing_12.rom", 0x20000, 0x5e4adedb, 3 | BRF_GRA }, // 6 - - { "shing_15.rom", 0x20000, 0x9db18233, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - { "takeda16.bin", 0x20000, 0xceda9dd6, 4 | BRF_GRA }, // 8 - { "takeda17.bin", 0x20000, 0x3d4371dc, 4 | BRF_GRA }, // 9 - - { "shing_19.rom", 0x10000, 0x97282d9d, 5 | BRF_GRA }, // 10 Tilemap #2 Tiles - - { "shing_20.rom", 0x20000, 0x7f6f8384, 6 | BRF_GRA }, // 11 Sprites - { "takeda21.bin", 0x20000, 0x12fb006b, 6 | BRF_GRA }, // 12 - { "takeda22.bin", 0x20000, 0xb165b6ae, 6 | BRF_GRA }, // 13 - { "takeda23.bin", 0x20000, 0x37cb9214, 6 | BRF_GRA }, // 14 - - { "takeda9.bin", 0x20000, 0xdb7f3f4f, 7 | BRF_SND }, // 15 OKI #0 Samples - { "takeda10.bin", 0x20000, 0xc9959d71, 7 | BRF_SND }, // 16 - - { "shing_07.rom", 0x20000, 0xc37ecbdc, 8 | BRF_SND }, // 17 OKI #1 Samples - { "shing_08.rom", 0x20000, 0x36d56c8c, 8 | BRF_SND }, // 18 - - { "ts.bpr", 0x00200, 0x85b30ac4, 9 | BRF_GRA }, // 19 Priority PROM -}; - -STD_ROM_PICK(tshingen) -STD_ROM_FN(tshingen) - -static INT32 tshingenInit() -{ - tshingen = 1; - -#ifdef BUILD_A68K - oldasmemulation = bBurnUseASMCPUEmulation; - if (!bBurnUseASMCPUEmulation) { - bprintf(0, _T("Switching to A68K for Takeda Shingen / Shingen Samurai-Fighter.\n")); - bBurnUseASMCPUEmulation = true; - } -#endif - - return SystemInit(0xA, phantasm_rom_decode); -} - -struct BurnDriver BurnDrvTshingen = { - "tshingen", NULL, NULL, NULL, "1988", - "Shingen Samurai-Fighter (Japan, English)\0", "Game crashes in level 2, play tshingena instead!", "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, tshingenRomInfo, tshingenRomName, NULL, NULL, Common3ButtonInputInfo, TshingenDIPInfo, - tshingenInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Takeda Shingen (Japan, Japanese) - -static struct BurnRomInfo tshingenaRomDesc[] = { - { "takeda2.bin", 0x20000, 0x6ddfc9f3, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "takeda1.bin", 0x20000, 0x1afc6b7d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "takeda5.bin", 0x10000, 0xfbdc51c0, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "takeda6.bin", 0x10000, 0x8fa65b69, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "takeda11.bin", 0x20000, 0xbf0b40a6, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - { "takeda12.bin", 0x20000, 0x07987d89, 3 | BRF_GRA }, // 6 - - { "takeda15.bin", 0x20000, 0x4c316b79, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - { "takeda16.bin", 0x20000, 0xceda9dd6, 4 | BRF_GRA }, // 8 - { "takeda17.bin", 0x20000, 0x3d4371dc, 4 | BRF_GRA }, // 9 - - { "takeda19.bin", 0x10000, 0x2ca2420d, 5 | BRF_GRA }, // 10 Tilemap #2 Tiles - - { "takeda20.bin", 0x20000, 0x1bfd636f, 6 | BRF_GRA }, // 11 Sprites - { "takeda21.bin", 0x20000, 0x12fb006b, 6 | BRF_GRA }, // 12 - { "takeda22.bin", 0x20000, 0xb165b6ae, 6 | BRF_GRA }, // 13 - { "takeda23.bin", 0x20000, 0x37cb9214, 6 | BRF_GRA }, // 14 - - { "takeda9.bin", 0x20000, 0xdb7f3f4f, 7 | BRF_SND }, // 15 OKI #0 Samples - { "takeda10.bin", 0x20000, 0xc9959d71, 7 | BRF_SND }, // 16 - - { "shing_07.rom", 0x20000, 0xc37ecbdc, 8 | BRF_SND }, // 17 OKI #1 Samples - { "shing_08.rom", 0x20000, 0x36d56c8c, 8 | BRF_SND }, // 18 - - { "ts.bpr", 0x00200, 0x85b30ac4, 9 | BRF_GRA }, // 19 Priority PROM -}; - -STD_ROM_PICK(tshingena) -STD_ROM_FN(tshingena) - -struct BurnDriver BurnDrvTshingena = { - "tshingena", "tshingen", NULL, NULL, "1988", - "Takeda Shingen (Japan, Japanese)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, tshingenaRomInfo, tshingenaRomName, NULL, NULL, Common3ButtonInputInfo, TshingenDIPInfo, - tshingenInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Ninja Kazan (World) - -static struct BurnRomInfo kazanRomDesc[] = { - { "kazan.2", 0x20000, 0x072aa3d6, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "kazan.1", 0x20000, 0xb9801e2d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "iga_03.bin", 0x10000, 0xde5937ad, 1 | BRF_PRG | BRF_ESS }, // 2 - { "iga_04.bin", 0x10000, 0xafaf0480, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "iga_05.bin", 0x10000, 0x13580868, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "iga_06.bin", 0x10000, 0x7904d5dd, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 6 MCU Code - - { "kazan.11", 0x20000, 0x08e54137, 3 | BRF_GRA }, // 7 Tilemap #0 Tiles - { "kazan.12", 0x20000, 0xe89d58bd, 3 | BRF_GRA }, // 8 - - { "kazan.15", 0x20000, 0x48b28aa9, 4 | BRF_GRA }, // 9 Tilemap #1 Tiles - { "kazan.16", 0x20000, 0x07eab526, 4 | BRF_GRA }, // 10 - { "kazan.17", 0x20000, 0x617269ea, 4 | BRF_GRA }, // 11 - { "kazan.18", 0x20000, 0x52fc1b4b, 4 | BRF_GRA }, // 12 - - { "kazan.19", 0x10000, 0xb3a9a4ae, 5 | BRF_GRA }, // 13 Tilemap #2 Tiles - - { "kazan.20", 0x20000, 0xee5819d8, 6 | BRF_GRA }, // 14 Sprites - { "kazan.21", 0x20000, 0xabf14d39, 6 | BRF_GRA }, // 15 - { "kazan.22", 0x20000, 0x646933c4, 6 | BRF_GRA }, // 16 - { "kazan.23", 0x20000, 0x0b531aee, 6 | BRF_GRA }, // 17 - - { "kazan.9", 0x20000, 0x5c28bd2d, 7 | BRF_SND }, // 18 OKI #0 Samples - { "kazan.10", 0x10000, 0xcd6c7978, 7 | BRF_SND }, // 19 - - { "kazan.7", 0x20000, 0x42f228f8, 8 | BRF_SND }, // 20 OKI #1 Samples - { "kazan.8", 0x20000, 0xebd1c883, 8 | BRF_SND }, // 21 - - { "kazan.14m", 0x00200, 0x85b30ac4, 9 | BRF_GRA }, // 22 Priority PROM -}; - -STD_ROM_PICK(kazan) -STD_ROM_FN(kazan) - -static INT32 kazanInit() -{ - INT32 nRet = SystemInit(0xA, phantasm_rom_decode); - - if (nRet == 0) - { - *((UINT16*)(Drv68KROM0 + 0x000410)) = 0x4e73; // hack - kill level 3 irq - - install_mcu_protection(mcu_config_type2, 0x2f000); - } - - return nRet; -} - -struct BurnDriver BurnDrvKazan = { - "kazan", NULL, NULL, NULL, "1988", - "Ninja Kazan (World)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, kazanRomInfo, kazanRomName, NULL, NULL, CommonInputInfo, KazanDIPInfo, - kazanInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Iga Ninjyutsuden (Japan) - -static struct BurnRomInfo iganinjuRomDesc[] = { - { "iga_02.bin", 0x20000, 0xbd00c280, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "iga_01.bin", 0x20000, 0xfa416a9e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "iga_03.bin", 0x10000, 0xde5937ad, 1 | BRF_PRG | BRF_ESS }, // 2 - { "iga_04.bin", 0x10000, 0xafaf0480, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "iga_05.bin", 0x10000, 0x13580868, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "iga_06.bin", 0x10000, 0x7904d5dd, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 6 MCU Code - - { "iga_14.bin", 0x40000, 0xc707d513, 3 | BRF_GRA }, // 7 Tilemap #0 Tiles - - { "iga_18.bin", 0x80000, 0x6c727519, 4 | BRF_GRA }, // 8 Tilemap #1 Tiles - - { "iga_19.bin", 0x20000, 0x98a7e998, 5 | BRF_GRA }, // 9 Tilemap #2 Tiles - - { "iga_23.bin", 0x80000, 0xfb58c5f4, 6 | BRF_GRA }, // 10 Sprites - - { "iga_10.bin", 0x40000, 0x67a89e0d, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "iga_08.bin", 0x40000, 0x857dbf60, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "iga.131", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 13 Priority PROM -}; - -STD_ROM_PICK(iganinju) -STD_ROM_FN(iganinju) - -struct BurnDriver BurnDrvIganinju = { - "iganinju", "kazan", NULL, NULL, "1988", - "Iga Ninjyutsuden (Japan)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, iganinjuRomInfo, iganinjuRomName, NULL, NULL, CommonInputInfo, KazanDIPInfo, - kazanInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// The Astyanax - -static struct BurnRomInfo astyanaxRomDesc[] = { - { "astyan2.bin", 0x20000, 0x1b598dcc, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "astyan1.bin", 0x20000, 0x1a1ad3cf, 1 | BRF_PRG | BRF_ESS }, // 1 - { "astyan3.bin", 0x10000, 0x097b53a6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "astyan4.bin", 0x10000, 0x1e1cbdb2, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "astyan5.bin", 0x10000, 0x11c74045, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "astyan6.bin", 0x10000, 0xeecd4b16, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // - - { "astyan11.bin", 0x20000, 0x5593fec9, 3 | BRF_GRA }, // 7 Tilemap #0 Tiles - { "astyan12.bin", 0x20000, 0xe8b313ec, 3 | BRF_GRA }, // 8 - { "astyan13.bin", 0x20000, 0x5f3496c6, 3 | BRF_GRA }, // 9 - { "astyan14.bin", 0x20000, 0x29a09ec2, 3 | BRF_GRA }, // 10 - - { "astyan15.bin", 0x20000, 0x0d316615, 4 | BRF_GRA }, // 11 Tilemap #1 Tiles - { "astyan16.bin", 0x20000, 0xba96e8d9, 4 | BRF_GRA }, // 12 - { "astyan17.bin", 0x20000, 0xbe60ba06, 4 | BRF_GRA }, // 13 - { "astyan18.bin", 0x20000, 0x3668da3d, 4 | BRF_GRA }, // 14 - - { "astyan19.bin", 0x20000, 0x98158623, 5 | BRF_GRA }, // 15 Tilemap #2 Tiles - - { "astyan20.bin", 0x20000, 0xc1ad9aa0, 6 | BRF_GRA }, // 16 Sprites - { "astyan21.bin", 0x20000, 0x0bf498ee, 6 | BRF_GRA }, // 17 - { "astyan22.bin", 0x20000, 0x5f04d9b1, 6 | BRF_GRA }, // 18 - { "astyan23.bin", 0x20000, 0x7bd4d1e7, 6 | BRF_GRA }, // 19 - - { "astyan9.bin", 0x20000, 0xa10b3f17, 7 | BRF_SND }, // 20 OKI #0 Samples - { "astyan10.bin", 0x20000, 0x4f704e7a, 7 | BRF_SND }, // 21 - - { "astyan7.bin", 0x20000, 0x319418cc, 8 | BRF_SND }, // 22 OKI #1 Samples - { "astyan8.bin", 0x20000, 0x5e5d2a22, 8 | BRF_SND }, // 23 - - { "rd.bpr", 0x00200, 0x85b30ac4, 9 | BRF_GRA }, // 24 Priority PROM -}; - -STD_ROM_PICK(astyanax) -STD_ROM_FN(astyanax) - -static INT32 astyanaxInit() -{ - INT32 nRet = SystemInit(0xA, astyanax_rom_decode); - - if (nRet == 0) { - install_mcu_protection(mcu_config_type1, 0x20000); - } - - return nRet; -} - -struct BurnDriver BurnDrvAstyanax = { - "astyanax", NULL, NULL, NULL, "1989", - "The Astyanax\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, astyanaxRomInfo, astyanaxRomName, NULL, NULL, Common3ButtonInputInfo, AstyanaxDIPInfo, - astyanaxInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// The Lord of King (Japan) - -static struct BurnRomInfo lordofkRomDesc[] = { - { "lokj02.bin", 0x20000, 0x0d7f9b4a, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "lokj01.bin", 0x20000, 0xbed3cb93, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lokj03.bin", 0x20000, 0xd8702c91, 1 | BRF_PRG | BRF_ESS }, // 2 - { "lokj04.bin", 0x20000, 0xeccbf8c9, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "astyan5.bin", 0x10000, 0x11c74045, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "astyan6.bin", 0x10000, 0xeecd4b16, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // - - { "astyan11.bin", 0x20000, 0x5593fec9, 3 | BRF_GRA }, // 7 Tilemap #0 Tiles - { "astyan12.bin", 0x20000, 0xe8b313ec, 3 | BRF_GRA }, // 8 - { "astyan13.bin", 0x20000, 0x5f3496c6, 3 | BRF_GRA }, // 9 - { "astyan14.bin", 0x20000, 0x29a09ec2, 3 | BRF_GRA }, // 10 - - { "astyan15.bin", 0x20000, 0x0d316615, 4 | BRF_GRA }, // 11 Tilemap #1 Tiles - { "astyan16.bin", 0x20000, 0xba96e8d9, 4 | BRF_GRA }, // 12 - { "astyan17.bin", 0x20000, 0xbe60ba06, 4 | BRF_GRA }, // 13 - { "astyan18.bin", 0x20000, 0x3668da3d, 4 | BRF_GRA }, // 14 - - { "astyan19.bin", 0x20000, 0x98158623, 5 | BRF_GRA }, // 15 Tilemap #2 Tiles - - { "astyan20.bin", 0x20000, 0xc1ad9aa0, 6 | BRF_GRA }, // 16 Sprites - { "astyan21.bin", 0x20000, 0x0bf498ee, 6 | BRF_GRA }, // 17 - { "astyan22.bin", 0x20000, 0x5f04d9b1, 6 | BRF_GRA }, // 18 - { "astyan23.bin", 0x20000, 0x7bd4d1e7, 6 | BRF_GRA }, // 19 - - { "astyan9.bin", 0x20000, 0xa10b3f17, 7 | BRF_SND }, // 20 OKI #0 Samples - { "astyan10.bin", 0x20000, 0x4f704e7a, 7 | BRF_SND }, // 21 - - { "astyan7.bin", 0x20000, 0x319418cc, 8 | BRF_SND }, // 22 OKI #1 Samples - { "astyan8.bin", 0x20000, 0x5e5d2a22, 8 | BRF_SND }, // 23 - - { "rd.bpr", 0x00200, 0x85b30ac4, 9 | BRF_GRA }, // 24 Priority PROM -}; - -STD_ROM_PICK(lordofk) -STD_ROM_FN(lordofk) - -struct BurnDriver BurnDrvLordofk = { - "lordofk", "astyanax", NULL, NULL, "1989", - "The Lord of King (Japan)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, lordofkRomInfo, lordofkRomName, NULL, NULL, Common3ButtonInputInfo, AstyanaxDIPInfo, - astyanaxInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Hachoo! - -static struct BurnRomInfo hachooRomDesc[] = { - { "hacho02.rom", 0x20000, 0x49489c27, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "hacho01.rom", 0x20000, 0x97fc9515, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "hacho05.rom", 0x10000, 0x6271f74f, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "hacho06.rom", 0x10000, 0xdb9e743c, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 mcu - - { "hacho14.rom", 0x80000, 0x10188483, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "hacho15.rom", 0x20000, 0xe559347e, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - { "hacho16.rom", 0x20000, 0x105fd8b5, 4 | BRF_GRA }, // 7 - { "hacho17.rom", 0x20000, 0x77f46174, 4 | BRF_GRA }, // 8 - { "hacho18.rom", 0x20000, 0x0be21111, 4 | BRF_GRA }, // 9 - - { "hacho19.rom", 0x20000, 0x33bc9de3, 5 | BRF_GRA }, // 10 Tilemap #2 Tiles - - { "hacho20.rom", 0x20000, 0x2ae2011e, 6 | BRF_GRA }, // 11 Sprites - { "hacho21.rom", 0x20000, 0x6dcfb8d5, 6 | BRF_GRA }, // 12 - { "hacho22.rom", 0x20000, 0xccabf0e0, 6 | BRF_GRA }, // 13 - { "hacho23.rom", 0x20000, 0xff5f77aa, 6 | BRF_GRA }, // 14 - - { "hacho09.rom", 0x20000, 0xe9f35c90, 7 | BRF_SND }, // 15 OKI #0 Samples - { "hacho10.rom", 0x20000, 0x1aeaa188, 7 | BRF_SND }, // 16 - - { "hacho07.rom", 0x20000, 0x06e6ca7f, 8 | BRF_SND }, // 17 OKI #1 Samples - { "hacho08.rom", 0x20000, 0x888a6df1, 8 | BRF_SND }, // 18 - - { "ht.bin", 0x00200, 0x85302b15, 9 | BRF_GRA }, // 19 Priority PROM -}; - -STD_ROM_PICK(hachoo) -STD_ROM_FN(hachoo) - -static INT32 hachooInit() -{ - ignore_oki_status_hack = 0; - - INT32 nRet = SystemInit(0xA, astyanax_rom_decode); - - if (nRet == 0) { - install_mcu_protection(mcu_config_type1, 0x20000); - } - - return nRet; -} - -struct BurnDriver BurnDrvHachoo = { - "hachoo", NULL, NULL, NULL, "1989", - "Hachoo!\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, hachooRomInfo, hachooRomName, NULL, NULL, CommonInputInfo, HachooDIPInfo, - hachooInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Jitsuryoku!! Pro Yakyuu (Japan) - -static struct BurnRomInfo jitsuproRomDesc[] = { - { "jp_2.bin", 0x20000, 0x5d842ff2, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "jp_1.bin", 0x20000, 0x0056edec, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jp_5.bin", 0x10000, 0x84454e9e, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "jp_6.bin", 0x10000, 0x1fa9b75b, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 mcu - - { "jp_14.bin", 0x80000, 0xdb112abf, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "jp_18.bin", 0x80000, 0x3ed855e3, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "jp_19.bin", 0x20000, 0xff59111f, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "jp_23.bin", 0x80000, 0x275f48bd, 6 | BRF_GRA }, // 8 Sprites - - { "jp_10.bin", 0x80000, 0x178e43c0, 7 | BRF_SND }, // 9 OKI #0 Samples - - { "jp_8.bin", 0x80000, 0xeca67632, 8 | BRF_SND }, // 10 OKI #1 Samples - - { "bs.bpr", 0x00200, 0x85b30ac4, 9 | BRF_GRA }, // 11 Priority PROM -}; - -STD_ROM_PICK(jitsupro) -STD_ROM_FN(jitsupro) - -static void jitsupro_gfx_unmangle(UINT8 *rom, INT32 size) -{ - UINT8 *buf = rom + 0x80000; - - memcpy (buf, rom, size); - - for (INT32 i = 0; i < size; i++) - { - INT32 j = BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,8,12,11,3,9,13,7,6,5,4,10,2,1,0); - - rom[i] = BITSWAP08(buf[j],4,3,5,7,6,2,1,0); - } -} - -static void jitsuproCallback() -{ - astyanax_rom_decode(); - jitsupro_gfx_unmangle(DrvGfxROM[0], 0x80000); - jitsupro_gfx_unmangle(DrvGfxROM[3], 0x80000); -} - -static INT32 jitsuproInit() -{ - INT32 nRet = SystemInit(0xA, jitsuproCallback); - - if (nRet == 0) { - install_mcu_protection(mcu_config_type1, 0x20000); - } - - return nRet; -} - -struct BurnDriver BurnDrvJitsupro = { - "jitsupro", NULL, NULL, NULL, "1989", - "Jitsuryoku!! Pro Yakyuu (Japan)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, jitsuproRomInfo, jitsuproRomName, NULL, NULL, Common3ButtonInputInfo, JitsuproDIPInfo, - jitsuproInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Plus Alpha - -static struct BurnRomInfo plusalphRomDesc[] = { - { "pa-rom2.bin", 0x20000, 0x33244799, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "pa-rom1.bin", 0x20000, 0xa32fdcae, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pa-rom3.bin", 0x10000, 0x1b739835, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pa-rom4.bin", 0x10000, 0xff760e80, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "pa-rom5.bin", 0x10000, 0xddc2739b, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "pa-rom6.bin", 0x10000, 0xf6f8a167, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 6 mcu - - { "pa-rom11.bin", 0x20000, 0xeb709ae7, 3 | BRF_GRA }, // 7 Tilemap #0 Tiles - { "pa-rom12.bin", 0x20000, 0xcacbc350, 3 | BRF_GRA }, // 8 - { "pa-rom13.bin", 0x20000, 0xfad093dd, 3 | BRF_GRA }, // 9 - { "pa-rom14.bin", 0x20000, 0xd3676cd1, 3 | BRF_GRA }, // 10 - - { "pa-rom15.bin", 0x20000, 0x8787735b, 4 | BRF_GRA }, // 11 Tilemap #1 Tiles - { "pa-rom16.bin", 0x20000, 0xa06b813b, 4 | BRF_GRA }, // 12 - { "pa-rom17.bin", 0x20000, 0xc6b38a4b, 4 | BRF_GRA }, // 13 - - { "pa-rom19.bin", 0x10000, 0x39ef193c, 5 | BRF_GRA }, // 14 Tilemap #2 Tiles - - { "pa-rom20.bin", 0x20000, 0x86c557a8, 6 | BRF_GRA }, // 15 Sprites - { "pa-rom21.bin", 0x20000, 0x81140a88, 6 | BRF_GRA }, // 16 - { "pa-rom22.bin", 0x20000, 0x97e39886, 6 | BRF_GRA }, // 17 - { "pa-rom23.bin", 0x20000, 0x0383fb65, 6 | BRF_GRA }, // 18 - - { "pa-rom9.bin", 0x20000, 0x065364bd, 7 | BRF_SND }, // 19 OKI #0 Samples - { "pa-rom10.bin", 0x20000, 0x395df3b2, 7 | BRF_SND }, // 20 - - { "pa-rom7.bin", 0x20000, 0x9f5d800e, 8 | BRF_SND }, // 21 OKI #1 Samples - { "pa-rom8.bin", 0x20000, 0xae007750, 8 | BRF_SND }, // 22 - - { "prom.14m", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 23 Priority PROM -}; - -STD_ROM_PICK(plusalph) -STD_ROM_FN(plusalph) - -static INT32 plusalphInit() -{ - INT32 nRet = SystemInit(0xA, astyanax_rom_decode); - - if (nRet == 0) { - install_mcu_protection(mcu_config_type1, 0x20000); - } - - return nRet; -} - -struct BurnDriver BurnDrvPlusalph = { - "plusalph", NULL, NULL, NULL, "1989", - "Plus Alpha\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, plusalphRomInfo, plusalphRomName, NULL, NULL, CommonInputInfo, PlusalphDIPInfo, - plusalphInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; - - -// Saint Dragon (set 1) - -static struct BurnRomInfo stdragonRomDesc[] = { - { "jsd-02.bin", 0x20000, 0xcc29ab19, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "jsd-01.bin", 0x20000, 0x67429a57, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jsd-05.bin", 0x10000, 0x8c04feaa, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "jsd-06.bin", 0x10000, 0x0bb62f3a, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 mcu - - { "jsd-11.bin", 0x20000, 0x2783b7b1, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - { "jsd-12.bin", 0x20000, 0x89466ab7, 3 | BRF_GRA }, // 6 - { "jsd-13.bin", 0x20000, 0x9896ae82, 3 | BRF_GRA }, // 7 - { "jsd-14.bin", 0x20000, 0x7e8da371, 3 | BRF_GRA }, // 8 - - { "jsd-15.bin", 0x20000, 0xe296bf59, 4 | BRF_GRA }, // 9 Tilemap #1 Tiles - { "jsd-16.bin", 0x20000, 0xd8919c06, 4 | BRF_GRA }, // 10 - { "jsd-17.bin", 0x20000, 0x4f7ad563, 4 | BRF_GRA }, // 11 - { "jsd-18.bin", 0x20000, 0x1f4da822, 4 | BRF_GRA }, // 12 - - { "jsd-19.bin", 0x10000, 0x25ce807d, 5 | BRF_GRA }, // 13 Tilemap #2 Tiles - - { "jsd-20.bin", 0x20000, 0x2c6e93bb, 6 | BRF_GRA }, // 14 Sprites - { "jsd-21.bin", 0x20000, 0x864bcc61, 6 | BRF_GRA }, // 15 - { "jsd-22.bin", 0x20000, 0x44fe2547, 6 | BRF_GRA }, // 16 - { "jsd-23.bin", 0x20000, 0x6b010e1a, 6 | BRF_GRA }, // 17 - - { "jsd-09.bin", 0x20000, 0xe366bc5a, 7 | BRF_SND }, // 18 OKI #0 Samples - { "jsd-10.bin", 0x20000, 0x4a8f4fe6, 7 | BRF_SND }, // 19 - - { "jsd-07.bin", 0x20000, 0x6a48e979, 8 | BRF_SND }, // 20 OKI #1 Samples - { "jsd-08.bin", 0x20000, 0x40704962, 8 | BRF_SND }, // 21 - - { "prom.14m", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 22 Priority PROM -}; - -STD_ROM_PICK(stdragon) -STD_ROM_FN(stdragon) - -static INT32 stdragonInit() -{ - INT32 nRet = SystemInit(0xA, phantasm_rom_decode); - - if (nRet == 0) { - install_mcu_protection(mcu_config_type2, 0x23ff0); - } - - return nRet; -} - -struct BurnDriver BurnDrvStdragon = { - "stdragon", NULL, NULL, NULL, "1989", - "Saint Dragon (set 1)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, stdragonRomInfo, stdragonRomName, NULL, NULL, CommonInputInfo, StdragonDIPInfo, - stdragonInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Saint Dragon (set 2) - -static struct BurnRomInfo stdragonaRomDesc[] = { - { "jsda-02.bin", 0x20000, 0xd65d4154, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "jsda-01.bin", 0x20000, 0xc40c8ee1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jsd-05.bin", 0x10000, 0x8c04feaa, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "jsd-06.bin", 0x10000, 0x0bb62f3a, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 mcu - - { "e71-14.bin", 0x80000, 0x8e26ff92, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "e72-18.bin", 0x80000, 0x0b234711, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "jsd-19.bin", 0x10000, 0x25ce807d, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "e73-23.bin", 0x80000, 0x00ca3e04, 6 | BRF_GRA }, // 8 Sprites - - { "jsd-09.bin", 0x20000, 0xe366bc5a, 7 | BRF_SND }, // 9 OKI #0 Samples - { "jsd-10.bin", 0x20000, 0x4a8f4fe6, 7 | BRF_SND }, // 10 - - { "jsd-07.bin", 0x20000, 0x6a48e979, 8 | BRF_SND }, // 11 OKI #1 Samples - { "jsd-08.bin", 0x20000, 0x40704962, 8 | BRF_SND }, // 12 - - { "prom.14m", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 13 Priority PROM -}; - -STD_ROM_PICK(stdragona) -STD_ROM_FN(stdragona) - -static void stdragona_gfx_unmangle(UINT8 *rom, INT32 size) -{ - UINT8 *buf = (UINT8*)BurnMalloc(size); - - memcpy (buf, rom, size); - - for (INT32 i = 0;i < size;i++) - { - INT32 j = BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,3,12,11,13,9,10,7,6,5,4,8,2,1,0); - - rom[i] = BITSWAP08(buf[j],3,7,5,6,4,2,1,0); - } - - BurnFree (buf); -} - -static void stdragonaCallback() -{ - phantasm_rom_decode(); - stdragona_gfx_unmangle(DrvGfxROM[0], 0x80000); - stdragona_gfx_unmangle(DrvGfxROM[3], 0x80000); -} - -static INT32 stdragonaInit() -{ - INT32 nRet = SystemInit(0xA, stdragonaCallback); - - if (nRet == 0) { - install_mcu_protection(mcu_config_type2, 0x23ff0); - } - - return nRet; -} - -struct BurnDriver BurnDrvStdragona = { - "stdragona", "stdragon", NULL, NULL, "1989", - "Saint Dragon (set 2)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, stdragonaRomInfo, stdragonaRomName, NULL, NULL, CommonInputInfo, StdragonDIPInfo, - stdragonaInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Saint Dragon (bootleg) -/* - -Bootleg version of Saint Dragon. Two PCBs connected by two flat cables. -Sound section can host two oki chips (and roms) but only one is populated. -No ASICs just logic chips. - -- ROMs A-19 and A-20 are fitted 'piggy backed' with one pin - from A-20 bent out and wired to a nearby TTL. -- Stage 5 has some of its background graphics corrupted. - Don't know if it is a PCB issue or designed like that. - -*/ - -static struct BurnRomInfo stdragonbRomDesc[] = { - { "a-4.bin", 0x10000, 0xc58fe5c2, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "a-2.bin", 0x10000, 0x46a7cdbb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a-3.bin", 0x10000, 0xf6a268c4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a-1.bin", 0x10000, 0x0fb439bd, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "b-20.bin", 0x10000, 0x8c04feaa, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "b-19.bin", 0x10000, 0x0bb62f3a, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "a-15.bin", 0x10000, 0x42f7d2cd, 3 | BRF_GRA }, // 6 Tilemap #0 Tiles - { "a-16.bin", 0x10000, 0x4f519a97, 3 | BRF_GRA }, // 7 - { "a-14.bin", 0x10000, 0xd8ba8d4c, 3 | BRF_GRA }, // 8 - { "a-18.bin", 0x10000, 0x5e35f269, 3 | BRF_GRA }, // 9 - { "a-19.bin", 0x10000, 0xb818db20, 3 | BRF_GRA }, // 10 - { "a-17.bin", 0x10000, 0x0f6094f9, 3 | BRF_GRA }, // 11 - { "a-20.bin", 0x10000, 0xe8849b15, 3 | BRF_GRA }, // 12 - - { "a-9.bin", 0x10000, 0x135c2e0e, 4 | BRF_GRA }, // 13 Tilemap #1 Tiles - { "a-10.bin", 0x10000, 0x19cec47a, 4 | BRF_GRA }, // 14 - { "a-5.bin", 0x10000, 0xda4ca7bf, 4 | BRF_GRA }, // 15 - { "a-6.bin", 0x10000, 0x9d9b6470, 4 | BRF_GRA }, // 16 - { "a-12.bin", 0x10000, 0x22382b5f, 4 | BRF_GRA }, // 17 - { "a-11.bin", 0x10000, 0x26c2494d, 4 | BRF_GRA }, // 18 - { "a-7.bin", 0x10000, 0xcee3a6f7, 4 | BRF_GRA }, // 19 - { "a-8.bin", 0x10000, 0x883b99bb, 4 | BRF_GRA }, // 20 - - { "a-13.bin", 0x08000, 0x9e487aa1, 5 | BRF_GRA }, // 21 Tilemap #2 Tiles - - { "a-22.bin", 0x10000, 0xc7ee6d89, 6 | BRF_GRA }, // 22 Sprites - { "a-23.bin", 0x10000, 0x79552709, 6 | BRF_GRA }, // 23 - { "a-25.bin", 0x10000, 0xd8926711, 6 | BRF_GRA }, // 24 - { "a-26.bin", 0x10000, 0x41d76447, 6 | BRF_GRA }, // 25 - { "a-21.bin", 0x10000, 0x5af84bd5, 6 | BRF_GRA }, // 26 - { "a-24.bin", 0x10000, 0x09ae3173, 6 | BRF_GRA }, // 27 - { "a-27.bin", 0x10000, 0xc9049e98, 6 | BRF_GRA }, // 28 - { "a-28.bin", 0x10000, 0xb4d12106, 6 | BRF_GRA }, // 29 - - { "a-29.bin", 0x10000, 0x0049aa65, 8 | BRF_SND }, // 30 OKI #1 Samples - { "a-30.bin", 0x10000, 0x05bce2c7, 8 | BRF_SND }, // 31 - { "b-17.bin", 0x10000, 0x3e4e34d3, 8 | BRF_SND }, // 32 - { "b-18.bin", 0x10000, 0x738a6643, 8 | BRF_SND }, // 33 - - { "prom.14m", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 34 Priority PROM -}; - -STD_ROM_PICK(stdragonb) -STD_ROM_FN(stdragonb) - -static void stdragonbCallback() -{ - stdragona_gfx_unmangle(DrvGfxROM[0], 0x80000); - stdragona_gfx_unmangle(DrvGfxROM[3], 0x80000); -} - -static INT32 stdragonbInit() -{ - return SystemInit(0xA, stdragonbCallback); -} - -struct BurnDriver BurnDrvStdragonb = { - "stdragonb", "stdragon", NULL, NULL, "1989", - "Saint Dragon (bootleg)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, stdragonbRomInfo, stdragonbRomName, NULL, NULL, CommonInputInfo, StdragonDIPInfo, - stdragonbInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Rod-Land (World) - -static struct BurnRomInfo rodlandRomDesc[] = { - { "JALECO_ROD_LAND_2.ROM2", 0x20000, 0xc7e00593, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "JALECO_ROD_LAND_1.ROM1", 0x20000, 0x2e748ca1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "JALECO_ROD_LAND_3.ROM3", 0x10000, 0x62fdf6d7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "JALECO_ROD_LAND_4.ROM4", 0x10000, 0x44163c86, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "JALECO_ROD_LAND_5.ROM5", 0x10000, 0xc1617c28, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "JALECO_ROD_LAND_6.ROM6", 0x10000, 0x663392b2, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "LH534H31.ROM14", 0x80000, 0x8201e1bb, 3 | BRF_GRA }, // 6 Tilemap #0 Tiles - - { "LH534H32.ROM18", 0x80000, 0xf3b30ca6, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - - { "LH2311J0.ROM19", 0x20000, 0x124d7e8f, 5 | BRF_GRA }, // 8 Tilemap #2 Tiles - - { "LH534H33.ROM23", 0x80000, 0x936db174, 6 | BRF_GRA }, // 9 Sprites - - { "LH5321T5.ROM10", 0x40000, 0xe1d1cd99, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "S202000DR.ROM8", 0x40000, 0x8a49d3a7, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "PS89013A.M14", 0x00200, 0x8914e72d, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(rodland) -STD_ROM_FN(rodland) - -static void rodland_gfx_unmangle(UINT8 *rom, INT32 size) -{ - UINT8 *buf = (UINT8*)BurnMalloc(size); - - memcpy (buf, rom, size); - - for (INT32 i = 0;i < size;i++) - { - INT32 j = BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,10,12,11,8,9,3,7,6,5,4,13,2,1,0); - - rom[i] = BITSWAP08(buf[j], 6,4,5,3,7,2,1,0); - } - - BurnFree (buf); -} - -static void rodlandCallback() -{ - rodland_rom_decode(); - rodland_gfx_unmangle(DrvGfxROM[0], 0x80000); - rodland_gfx_unmangle(DrvGfxROM[3], 0x80000); -} - -static INT32 rodlandInit() -{ - return SystemInit(0xA, rodlandCallback); -} - -struct BurnDriver BurnDrvRodland = { - "rodland", NULL, NULL, NULL, "1990", - "Rod-Land (World)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, rodlandRomInfo, rodlandRomName, NULL, NULL, CommonInputInfo, RodlandDIPInfo, - rodlandInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Rod-Land (Japan) - -static struct BurnRomInfo rodlandjRomDesc[] = { - { "JALECO_ROD_LAND_2.ROM2", 0x20000, 0xb1d2047e, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "JALECO_ROD_LAND_1.ROM1", 0x20000, 0x3c47c2a3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "JALECO_ROD_LAND_3.ROM3", 0x10000, 0xc5b1075f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "JALECO_ROD_LAND_4.ROM4", 0x10000, 0x9ec61048, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "JALECO_ROD_LAND_5.ROM5", 0x10000, 0xc1617c28, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "JALECO_ROD_LAND_6.ROM6", 0x10000, 0x663392b2, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "LH534H31.ROM14", 0x80000, 0x8201e1bb, 3 | BRF_GRA }, // 6 Tilemap #0 Tiles - - { "LH534H32.ROM18", 0x80000, 0xf3b30ca6, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - - { "LH2311J0.ROM19", 0x20000, 0x124d7e8f, 5 | BRF_GRA }, // 8 Tilemap #2 Tiles - - { "LH534H33.ROM23", 0x80000, 0x936db174, 6 | BRF_GRA }, // 9 Sprites - - { "LH5321T5.ROM10", 0x40000, 0xe1d1cd99, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "S202000DR.ROM8", 0x40000, 0x8a49d3a7, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "PS89013A.M14", 0x00200, 0x8914e72d, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(rodlandj) -STD_ROM_FN(rodlandj) - -static void rodlandjCallback() -{ - astyanax_rom_decode(); - rodland_gfx_unmangle(DrvGfxROM[0], 0x80000); - rodland_gfx_unmangle(DrvGfxROM[3], 0x80000); -} - -static INT32 rodlandjInit() -{ - return SystemInit(0xA, rodlandjCallback); -} - -struct BurnDriver BurnDrvRodlandj = { - "rodlandj", "rodland", NULL, NULL, "1990", - "Rod-Land (Japan)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, rodlandjRomInfo, rodlandjRomName, NULL, NULL, CommonInputInfo, RodlandDIPInfo, - rodlandjInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Rod-Land (Japan bootleg) - -static struct BurnRomInfo rodlandjbRomDesc[] = { - { "rl19.bin", 0x10000, 0x028de21f, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "rl17.bin", 0x10000, 0x9c720046, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rl20.bin", 0x10000, 0x3f536d07, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rl18.bin", 0x10000, 0x5aa61717, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rl_3.bin", 0x10000, 0xc5b1075f, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rl_4.bin", 0x10000, 0x9ec61048, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "rl02.bin", 0x10000, 0xd26eae8f, 2 | BRF_PRG | BRF_ESS }, // 6 68k #1 Code - { "rl01.bin", 0x10000, 0x04cf24bc, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "LH534H31.ROM14", 0x80000, 0x8201e1bb, 3 | BRF_GRA }, // 6 Tilemap #0 Tiles - - { "LH534H32.ROM18", 0x80000, 0xf3b30ca6, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - - { "LH2311J0.ROM19", 0x20000, 0x124d7e8f, 5 | BRF_GRA }, // 8 Tilemap #2 Tiles - - { "LH534H33.ROM23", 0x80000, 0x936db174, 6 | BRF_GRA }, // 9 Sprites - - { "LH5321T5.ROM10", 0x40000, 0xe1d1cd99, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "S202000DR.ROM8", 0x40000, 0x8a49d3a7, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "PS89013A.M14", 0x00200, 0x8914e72d, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(rodlandjb) -STD_ROM_FN(rodlandjb) - -static void rodlandjbCallback() -{ - rodland_gfx_unmangle(DrvGfxROM[0], 0x80000); - rodland_gfx_unmangle(DrvGfxROM[3], 0x80000); -} - -static INT32 rodlandjbInit() -{ - return SystemInit(0xA, rodlandjbCallback); -} - -struct BurnDriver BurnDrvRodlandjb = { - "rodlandjb", "rodland", NULL, NULL, "1990", - "Rod-Land (Japan bootleg)\0", NULL, "bootleg", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, rodlandjbRomInfo, rodlandjbRomName, NULL, NULL, CommonInputInfo, RodlandDIPInfo, - rodlandjbInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// R&T (Rod-Land prototype?) -/* probably a prototype, original JP key and unscrambled ROMs, incorrect audio matches PCB */ - -static struct BurnRomInfo rittamRomDesc[] = { - { "2.ROM2", 0x20000, 0x93085af2, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "R+T_1.ROM1", 0x20000, 0x20446C34, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "JALECO_5.ROM5", 0x10000, 0xea6600ec, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "JALECO_6.ROM6", 0x10000, 0x51c3c0bc, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "11.ROM11", 0x20000, 0xad2bf897, 3 | BRF_GRA }, // 6 Tilemap #0 Tiles - { "12.ROM12", 0x20000, 0xd0224ed6, 3 | BRF_GRA }, // 7 - { "13.ROM13", 0x20000, 0xb1d5d423, 3 | BRF_GRA }, // 8 - { "14.ROM14", 0x20000, 0x20f8c361, 3 | BRF_GRA }, // 9 - - { "15.ROM15", 0x20000, 0x90bc97ac, 4 | BRF_GRA }, // 10 Tilemap #1 Tiles - { "16.ROM16", 0x20000, 0xe38750aa, 4 | BRF_GRA }, // 11 - // ROM17 not populated - not sure why, missing? - { "18.ROM18", 0x20000, 0x57ccf24f, 4 | BRF_GRA }, // 12 - - { "19.ROM19", 0x20000, 0x6daa1081, 5 | BRF_GRA }, // 13 Tilemap #2 Tiles - - { "R+T_20.ROM20", 0x20000, 0x23bc2b0b, 6 | BRF_GRA }, // 14 Sprites - { "21.ROM21", 0x20000, 0x9d2b0ec4, 6 | BRF_GRA }, // 15 - { "22.ROM22", 0x20000, 0xbba2e2cf, 6 | BRF_GRA }, // 16 - { "23.ROM23", 0x20000, 0x05536a18, 6 | BRF_GRA }, // 17 - - { "JALECO_9.ROM9", 0x20000, 0x065364bd, 7 | BRF_SND }, // 18 OKI #0 Samples - { "JALECO_10.ROM10", 0x20000, 0x395df3b2, 7 | BRF_SND }, // 19 - - { "JALECO_7.ROM7", 0x20000, 0x76fd879f, 8 | BRF_SND }, // 20 OKI #1 Samples - { "JALECO_8.ROM8", 0x20000, 0xa771ab00, 8 | BRF_SND }, // 21 OKI #1 Samples - - { "PS89013A.M14", 0x00200, 0x8914e72d, 9 | BRF_GRA }, // 22 Priority PROM -}; - -STD_ROM_PICK(rittam) -STD_ROM_FN(rittam) - -static void rittamCallback() -{ - astyanax_rom_decode(); -} - -static INT32 rittamInit() -{ - return SystemInit(0xA, rittamCallback); -} - -struct BurnDriver BurnDrvRittam = { - "rittam", "rodland", NULL, NULL, "1990", - "R&T (Rod-Land prototype?)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, rittamRomInfo, rittamRomName, NULL, NULL, CommonInputInfo, RodlandDIPInfo, - rittamInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Soldam - -static struct BurnRomInfo soldamRomDesc[] = { - { "2ver1j.bin", 0x20000, 0x45444b07, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "1euro.bin", 0x20000, 0x9f9da28a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3ver1.bin", 0x10000, 0xc5382a07, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4ver1.bin", 0x10000, 0x1df7816f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "5ver1.bin", 0x10000, 0xd1019a67, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "6ver1.bin", 0x10000, 0x3ed219b4, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "14ver1.bin", 0x80000, 0x73c90610, 3 | BRF_GRA }, // 6 Tilemap #0 Tiles - - { "18ver1.bin", 0x80000, 0xe91a1afd, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - - { "19ver1.bin", 0x20000, 0x38465da1, 5 | BRF_GRA }, // 8 Tilemap #2 Tiles - - { "23ver1.bin", 0x80000, 0x0ca09432, 6 | BRF_GRA }, // 9 Sprites - - { "10ver1.bin", 0x40000, 0x8d5613bf, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "8ver1.bin", 0x40000, 0xfcd36019, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "pr-91023.m14", 0x00200, 0x8914e72d, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(soldam) -STD_ROM_FN(soldam) - -static INT32 soldamInit() -{ - INT32 nRet = SystemInit(0xA, phantasm_rom_decode); - - if (nRet == 0) { - SekOpen(0); - SekMapMemory(DrvSprRAM, 0x8c000, 0x8c7ff, MAP_RAM); // mirror - SekClose(); - } - - return nRet; -} - -struct BurnDriver BurnDrvSoldam = { - "soldam", NULL, NULL, NULL, "1992", - "Soldam\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, soldamRomInfo, soldamRomName, NULL, NULL, CommonInputInfo, SoldamDIPInfo, - soldamInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Soldam (Japan) - -static struct BurnRomInfo soldamjRomDesc[] = { - { "soldam2.bin", 0x20000, 0xc73d29e4, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "soldam1.bin", 0x20000, 0xe7cb0c20, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3ver1.bin", 0x10000, 0xc5382a07, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4ver1.bin", 0x10000, 0x1df7816f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "5ver1.bin", 0x10000, 0xd1019a67, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "6ver1.bin", 0x10000, 0x3ed219b4, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "soldam14.bin", 0x80000, 0x26cea54a, 3 | BRF_GRA }, // 6 Tilemap #0 Tiles - - { "soldam18.bin", 0x80000, 0x7d8e4712, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - - { "19ver1.bin", 0x20000, 0x38465da1, 5 | BRF_GRA }, // 8 Tilemap #2 Tiles - - { "23ver1.bin", 0x80000, 0x0ca09432, 6 | BRF_GRA }, // 9 Sprites - - { "10ver1.bin", 0x40000, 0x8d5613bf, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "8ver1.bin", 0x40000, 0xfcd36019, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "pr-91023.m14", 0x00200, 0x8914e72d, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(soldamj) -STD_ROM_FN(soldamj) - -static INT32 soldamjInit() -{ - INT32 nRet = SystemInit(0xA, astyanax_rom_decode); - - scroll_factor_8x8[1] = 4; - - if (nRet == 0) { - SekOpen(0); - SekMapMemory(DrvSprRAM, 0x8c000, 0x8c7ff, MAP_RAM); // mirror - SekClose(); - } - - return nRet; -} - -struct BurnDriver BurnDrvSoldamj = { - "soldamj", "soldam", NULL, NULL, "1992", - "Soldam (Japan)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, soldamjRomInfo, soldamjRomName, NULL, NULL, CommonInputInfo, SoldamDIPInfo, - soldamjInit, DrvExit, System1AFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Avenging Spirit - -static struct BurnRomInfo avspiritRomDesc[] = { - { "spirit05.rom", 0x40000, 0xb26a341a, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "spirit06.rom", 0x40000, 0x609f71fe, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "spirit01.rom", 0x20000, 0xd02ec045, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "spirit02.rom", 0x20000, 0x30213390, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "m50747", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "spirit12.rom", 0x80000, 0x728335d4, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "spirit11.rom", 0x80000, 0x7896f6b0, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "spirit09.rom", 0x20000, 0x0c37edf7, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "spirit10.rom", 0x80000, 0x2b1180b3, 6 | BRF_GRA }, // 8 Sprites - - { "spirit14.rom", 0x40000, 0x13be9979, 7 | BRF_SND }, // 9 OKI #0 Samples - - { "spirit13.rom", 0x40000, 0x05bc04d9, 8 | BRF_SND }, // 10 OKI #1 Samples - - { "ph.bin", 0x00200, 0x8359650a, 9 | BRF_GRA }, // 11 Priority PROM -}; - -STD_ROM_PICK(avspirit) -STD_ROM_FN(avspirit) - -static INT32 avspiritInit() -{ - input_select_values[0] = 0x37; - input_select_values[1] = 0x35; - input_select_values[2] = 0x36; - input_select_values[3] = 0x33; - input_select_values[4] = 0x34; - - INT32 nRet = SystemInit(0xB, NULL); - - if (nRet == 0) { - SekOpen(0); - SekMapMemory(Drv68KRAM0, 0x70000, 0x7ffff, MAP_RAM); // only 64k - SekClose(); - } - - return nRet; -} - -struct BurnDriver BurnDrvAvspirit = { - "avspirit", NULL, NULL, NULL, "1991", - "Avenging Spirit\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, avspiritRomInfo, avspiritRomName, NULL, NULL, CommonInputInfo, AvspiritDIPInfo, - avspiritInit, DrvExit, System1BFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Phantasm (Japan) - -static struct BurnRomInfo phantasmRomDesc[] = { - { "phntsm02.bin", 0x20000, 0xd96a3584, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "phntsm01.bin", 0x20000, 0xa54b4b87, 1 | BRF_PRG | BRF_ESS }, // 1 - { "phntsm03.bin", 0x10000, 0x1d96ce20, 1 | BRF_PRG | BRF_ESS }, // 2 - { "phntsm04.bin", 0x10000, 0xdc0c4994, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "phntsm05.bin", 0x10000, 0x3b169b4a, 2 | BRF_PRG | BRF_ESS }, // 4 68k #1 Code - { "phntsm06.bin", 0x10000, 0xdf2dfb2e, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "spirit12.rom", 0x80000, 0x728335d4, 3 | BRF_GRA }, // 6 Tilemap #0 Tiles - - { "spirit11.rom", 0x80000, 0x7896f6b0, 4 | BRF_GRA }, // 7 Tilemap #1 Tiles - - { "spirit09.rom", 0x20000, 0x0c37edf7, 5 | BRF_GRA }, // 8 Tilemap #2 Tiles - - { "spirit10.rom", 0x80000, 0x2b1180b3, 6 | BRF_GRA }, // 9 Sprites - - { "spirit14.rom", 0x40000, 0x13be9979, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "spirit13.rom", 0x40000, 0x05bc04d9, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "ph.bin", 0x00200, 0x8359650a, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(phantasm) -STD_ROM_FN(phantasm) - -static INT32 phantasmInit() -{ - return SystemInit(0xA, phantasm_rom_decode); -} - -struct BurnDriver BurnDrvPhantasm = { - "phantasm", "avspirit", NULL, NULL, "1990", - "Phantasm (Japan)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, phantasmRomInfo, phantasmRomName, NULL, NULL, CommonInputInfo, PhantasmDIPInfo, - phantasmInit, DrvExit, System1BFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Monky Elf (Korean bootleg of Avenging Spirit) - -static struct BurnRomInfo monkelfRomDesc[] = { - { "6", 0x40000, 0x40b80914, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "5", 0x40000, 0x6c45465d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "4", 0x20000, 0xd02ec045, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "3", 0x20000, 0x30213390, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "8", 0x80000, 0x728335d4, 3 | BRF_GRA }, // 4 Tilemap #0 Tiles - - { "9", 0x80000, 0x7896f6b0, 4 | BRF_GRA }, // 5 Tilemap #1 Tiles - - { "10", 0x20000, 0x0c37edf7, 5 | BRF_GRA }, // 6 Tilemap #2 Tiles - - { "7", 0x80000, 0x2b1180b3, 6 | BRF_GRA }, // 7 Sprites - - { "1", 0x40000, 0x13be9979, 7 | BRF_SND }, // 8 OKI #0 Samples - - { "2", 0x40000, 0x05bc04d9, 8 | BRF_SND }, // 9 OKI #1 Samples - - { "82s147", 0x00200, 0x547eccc0, 9 | BRF_GRA }, // 10 Priority PROM -}; - -STD_ROM_PICK(monkelf) -STD_ROM_FN(monkelf) - -static UINT16 __fastcall monkelf_read_word(UINT32 address) -{ - switch (address) - { - case 0xe0002: - return DrvInputs[1]; - - case 0xe0004: - return DrvInputs[2]; - - case 0xe0006: - return DrvDips[0]; - - case 0xe0008: - return DrvDips[1]; - - case 0xe000a: - return DrvInputs[0]; - - case 0xe000e: - return 0; - } - - return 0xffff; -} - -static UINT8 __fastcall monkelf_read_byte(UINT32 address) -{ - switch (address) - { - case 0xe0002: - return DrvInputs[1] >> 8; - - case 0xe0003: - return DrvInputs[1]; - - case 0xe0004: - return DrvInputs[2] >> 8; - - case 0xe0005: - return DrvInputs[2]; - - case 0xe0006: - case 0xe0007: - return DrvDips[0]; - - case 0xe0008: - case 0xe0009: - return DrvDips[1]; - - case 0xe000a: - return DrvInputs[0] >> 8; - - case 0xe000b: - return DrvInputs[0]; - } - - return 0xff; -} - -static void monkelfCallback() -{ - *((UINT16*)(Drv68KROM0 + 0x0744)) = 0x4e71; // bypass trap - very strange - - // convert bootleg priority prom to standard format - for (INT32 i = 0x1fe; i >= 0; i -= 2) { - DrvPrioPROM[i+0] = DrvPrioPROM[i+1] = (DrvPrioPROM[i/2] >> 4) & 0x03; - } - - DrvPriorityDecode(); // re-decode -} - -static INT32 monkelfInit() -{ - monkelf = 1; - - INT32 nRet = SystemInit(0xB, monkelfCallback); - - if (nRet == 0) { - SekOpen(0); - SekMapMemory(Drv68KRAM0, 0x70000, 0x7ffff, MAP_RAM); // only 64k - - SekMapHandler(2, 0x0e0000, 0x0e000f, MAP_READ); - SekSetReadWordHandler(2, monkelf_read_word); - SekSetReadByteHandler(2, monkelf_read_byte); - SekClose(); - } - - return nRet; -} - -struct BurnDriver BurnDrvMonkelf = { - "monkelf", "avspirit", NULL, NULL, "1990", - "Monky Elf (Korean bootleg of Avenging Spirit)\0", "imperfect graphics", "bootleg", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, monkelfRomInfo, monkelfRomName, NULL, NULL, CommonInputInfo, AvspiritDIPInfo, - monkelfInit, DrvExit, System1BFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - - -// E.D.F. : Earth Defense Force (set 1) - -static struct BurnRomInfo edfRomDesc[] = { - { "edf5.b5", 0x40000, 0x105094d1, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "edf_06.rom", 0x40000, 0x94da2f0c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "edf1.f5", 0x20000, 0x2290ea19, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "edf2.f3", 0x20000, 0xce93643e, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "edf.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "edf_m04.rom", 0x80000, 0x6744f406, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "edf_m05.rom", 0x80000, 0x6f47e456, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "edf_09.rom", 0x20000, 0x96e38983, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "edf_m03.rom", 0x80000, 0xef469449, 6 | BRF_GRA }, // 8 Sprites - - { "edf_m02.rom", 0x40000, 0xfc4281d2, 7 | BRF_SND }, // 9 OKI #0 Samples - - { "edf_m01.rom", 0x40000, 0x9149286b, 8 | BRF_SND }, // 10 OKI #1 Samples - - { "rd.20n", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 11 Priority PROM -}; - -STD_ROM_PICK(edf) -STD_ROM_FN(edf) - -static INT32 edfInit() -{ - input_select_values[0] = 0x20; - input_select_values[1] = 0x21; - input_select_values[2] = 0x22; - input_select_values[3] = 0x23; - input_select_values[4] = 0x24; - - return SystemInit(0xB, NULL); -} - -struct BurnDriver BurnDrvEdf = { - "edf", NULL, NULL, NULL, "1991", - "E.D.F. : Earth Defense Force (set 1)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, edfRomInfo, edfRomName, NULL, NULL, CommonInputInfo, EdfDIPInfo, - edfInit, DrvExit, System1BFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// E.D.F. : Earth Defense Force (set 2) - -static struct BurnRomInfo edfaRomDesc[] = { - { "5.b5", 0x40000, 0x6edd3c53, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "6.b3", 0x40000, 0x4d8bfa8f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "edf1.f5", 0x20000, 0x2290ea19, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "edf2.f3", 0x20000, 0xce93643e, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "edf.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "edf_m04.rom", 0x80000, 0x6744f406, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "edf_m05.rom", 0x80000, 0x6f47e456, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "edf_09.rom", 0x20000, 0x96e38983, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "edf_m03.rom", 0x80000, 0xef469449, 6 | BRF_GRA }, // 8 Sprites - - { "edf_m02.rom", 0x40000, 0xfc4281d2, 7 | BRF_SND }, // 9 OKI #0 Samples - - { "edf_m01.rom", 0x40000, 0x9149286b, 8 | BRF_SND }, // 10 OKI #1 Samples - - { "rd.20n", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 11 Priority PROM -}; - -STD_ROM_PICK(edfa) -STD_ROM_FN(edfa) - -struct BurnDriver BurnDrvEdfa = { - "edfa", "edf", NULL, NULL, "1991", - "E.D.F. : Earth Defense Force (set 2)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, edfaRomInfo, edfaRomName, NULL, NULL, CommonInputInfo, EdfDIPInfo, - edfInit, DrvExit, System1BFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// E.D.F. : Earth Defense Force (North America) - -static struct BurnRomInfo edfuRomDesc[] = { - { "edf5.b5", 0x40000, 0x105094d1, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "edf6.b3", 0x40000, 0x4797de97, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "edf1.f5", 0x20000, 0x2290ea19, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "edf2.f3", 0x20000, 0xce93643e, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "edf.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "edf_m04.rom", 0x80000, 0x6744f406, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "edf_m05.rom", 0x80000, 0x6f47e456, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "edf_09.rom", 0x20000, 0x96e38983, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "edf_m03.rom", 0x80000, 0xef469449, 6 | BRF_GRA }, // 8 Sprites - - { "edf_m02.rom", 0x40000, 0xfc4281d2, 7 | BRF_SND }, // 9 OKI #0 Samples - - { "edf_m01.rom", 0x40000, 0x9149286b, 8 | BRF_SND }, // 10 OKI #1 Samples - - { "rd.20n", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 11 Priority PROM -}; - -STD_ROM_PICK(edfu) -STD_ROM_FN(edfu) - -struct BurnDriver BurnDrvEdfu = { - "edfu", "edf", NULL, NULL, "1991", - "E.D.F. : Earth Defense Force (North America)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, edfuRomInfo, edfuRomName, NULL, NULL, CommonInputInfo, EdfDIPInfo, - edfInit, DrvExit, System1BFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// E.D.F. : Earth Defense Force (bootleg) - -static struct BurnRomInfo edfblRomDesc[] = { - { "02.bin", 0x40000, 0x19a0dfa0, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "01.bin", 0x40000, 0xfc893ad0, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "07.bin", 0x40000, 0x4495c228, 3 | BRF_GRA }, // 2 Tilemap #0 Tiles - { "06.bin", 0x40000, 0x3e37f226, 3 | BRF_GRA }, // 3 - - { "03.bin", 0x40000, 0xeea24345, 4 | BRF_GRA }, // 4 Tilemap #1 Tiles - { "04.bin", 0x40000, 0x2cfe9439, 4 | BRF_GRA }, // 5 - - { "05.bin", 0x20000, 0x96e38983, 5 | BRF_GRA }, // 6 Tilemap #2 Tiles - - { "09.bin", 0x40000, 0xe89d27c0, 6 | BRF_GRA }, // 7 Sprites - { "08.bin", 0x40000, 0x603ac969, 6 | BRF_GRA }, // 8 - - { "12.bin", 0x10000, 0xe645f447, 7 | BRF_SND }, // 9 OKI #0 Samples - - { "11.bin", 0x40000, 0x5a8896cb, 8 | BRF_SND }, // 10 okibanks - { "10.bin", 0x40000, 0xbaa7c91b, 8 | BRF_SND }, // 11 - - { "rd.20n", 0x00200, 0x1d877538, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(edfbl) -STD_ROM_FN(edfbl) - -static UINT16 __fastcall edfbl_read_word(UINT32 address) -{ - switch (address) - { - case 0xe0002: - return DrvInputs[0]; - - case 0xe0004: - return DrvInputs[1]; - - case 0xe0006: - return DrvInputs[2]; - - case 0xe0008: - return DrvDips[0]; - - case 0xe000a: - return DrvDips[1]; - } - - return 0; -} - -static UINT8 __fastcall edfbl_read_byte(UINT32 address) -{ - switch (address) - { - case 0xe0002: - return DrvInputs[0] >> 8; - - case 0xe0003: - return DrvInputs[0]; - - case 0xe0004: - return DrvInputs[1] >> 8; - - case 0xe0005: - return DrvInputs[1]; - - case 0xe0006: - return DrvInputs[2] >> 8; - - case 0xe0007: - return DrvInputs[2]; - - case 0xe0008: - case 0xe0009: - return DrvDips[0]; - - case 0xe000a: - case 0xe000b: - return DrvDips[1]; - } - - return 0; -} - -static INT32 edfblInit() -{ - INT32 nRet = SystemInit(0xB, NULL); - - if (nRet == 0) { - SekOpen(0); - SekMapHandler(2, 0x0e0000, 0x0e000f, MAP_READ); - SekSetReadWordHandler(2, edfbl_read_word); - SekSetReadByteHandler(2, edfbl_read_byte); - SekClose(); - } - - return nRet; -} - -struct BurnDriver BurnDrvEdfbl = { - "edfbl", "edf", NULL, NULL, "1991", - "E.D.F. : Earth Defense Force (bootleg)\0", "no sound", "bootleg", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, edfblRomInfo, edfblRomName, NULL, NULL, CommonInputInfo, EdfDIPInfo, - edfblInit, DrvExit, System1BFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Hayaoshi Quiz Ouza Ketteisen - The King Of Quiz - -static struct BurnRomInfo hayaosi1RomDesc[] = { - { "5", 0x40000, 0xeaf38fab, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "6", 0x40000, 0x341f8057, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1", 0x20000, 0xb088b27e, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "2", 0x20000, 0xcebc7b16, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "mo-91044.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "7", 0x80000, 0x3629c455, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "8", 0x80000, 0x15f0b2a3, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "9", 0x20000, 0x64d5b95e, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "10", 0x80000, 0x593e93d6, 6 | BRF_GRA }, // 8 Sprites - - { "3", 0x40000, 0xf3f5787a, 7 | BRF_SND }, // 9 OKI #0 Samples - - { "4", 0x40000, 0xac3f9bd2, 8 | BRF_SND }, // 10 OKI #1 Samples - - { "pr-91044", 0x00200, 0xc69423d6, 9 | BRF_GRA }, // 11 Priority PROM -}; - -STD_ROM_PICK(hayaosi1) -STD_ROM_FN(hayaosi1) - -static INT32 hayaosi1Init() -{ - input_select_values[0] = 0x51; - input_select_values[1] = 0x52; - input_select_values[2] = 0x53; - input_select_values[3] = 0x54; - input_select_values[4] = 0x55; - - INT32 nRet = SystemInit(0xB, NULL); - - if (nRet == 0) { - MSM6295SetSamplerate(0, 2000000 / 132); - MSM6295SetSamplerate(1, 2000000 / 132); - } - - return nRet; -} - -struct BurnDriver BurnDrvHayaosi1 = { - "hayaosi1", NULL, NULL, NULL, "1993", - "Hayaoshi Quiz Ouza Ketteisen - The King Of Quiz\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, hayaosi1RomInfo, hayaosi1RomName, NULL, NULL, Hayaosi1InputInfo, Hayaosi1DIPInfo, - hayaosi1Init, DrvExit, System1BFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// 64th. Street - A Detective Story (World) - -static struct BurnRomInfo Street64RomDesc[] = { - { "64th_03.rom", 0x40000, 0xed6c6942, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "64th_02.rom", 0x40000, 0x0621ed1d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "64th_08.rom", 0x10000, 0x632be0c1, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "64th_07.rom", 0x10000, 0x13595d01, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "64street.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "64th_01.rom", 0x80000, 0x06222f90, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "64th_06.rom", 0x80000, 0x2bfcdc75, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "64th_09.rom", 0x20000, 0xa4a97db4, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "64th_05.rom", 0x80000, 0xa89a7020, 6 | BRF_GRA }, // 8 Sprites - { "64th_04.rom", 0x80000, 0x98f83ef6, 6 | BRF_GRA }, // 9 - - { "64th_11.rom", 0x20000, 0xb0b8a65c, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "64th_10.rom", 0x40000, 0xa3390561, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "pr91009.12", 0x00200, 0xc69423d6, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(Street64) -STD_ROM_FN(Street64) - -static INT32 street64Init() -{ - input_select_values[0] = 0x57; - input_select_values[1] = 0x53; - input_select_values[2] = 0x54; - input_select_values[3] = 0x55; - input_select_values[4] = 0x56; - - return SystemInit(0xC, NULL); -} - -struct BurnDriver BurnDrvStreet64 = { - "64street", NULL, NULL, NULL, "1991", - "64th. Street - A Detective Story (World)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, Street64RomInfo, Street64RomName, NULL, NULL, CommonInputInfo, Street64DIPInfo, - street64Init, DrvExit, System1CFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// 64th. Street - A Detective Story (Japan, set 1) - -static struct BurnRomInfo Street64jRomDesc[] = { - { "91105-3.bin", 0x40000, 0xa211a83b, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "91105-2.bin", 0x40000, 0x27c1f436, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "64th_08.rom", 0x10000, 0x632be0c1, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "64th_07.rom", 0x10000, 0x13595d01, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "64street.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "64th_01.rom", 0x80000, 0x06222f90, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "64th_06.rom", 0x80000, 0x2bfcdc75, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "64th_09.rom", 0x20000, 0xa4a97db4, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "64th_05.rom", 0x80000, 0xa89a7020, 6 | BRF_GRA }, // 8 Sprites - { "64th_04.rom", 0x80000, 0x98f83ef6, 6 | BRF_GRA }, // 9 - - { "64th_11.rom", 0x20000, 0xb0b8a65c, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "64th_10.rom", 0x40000, 0xa3390561, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "pr91009.12", 0x00200, 0xc69423d6, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(Street64j) -STD_ROM_FN(Street64j) - -struct BurnDriver BurnDrvStreet64j = { - "64streetj", "64street", NULL, NULL, "1991", - "64th. Street - A Detective Story (Japan, set 1)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, Street64jRomInfo, Street64jRomName, NULL, NULL, CommonInputInfo, Street64DIPInfo, - street64Init, DrvExit, System1CFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// 64th. Street - A Detective Story (Japan, set 2) - -static struct BurnRomInfo Street64jaRomDesc[] = { - { "ic53.bin", 0x40000, 0xc978d086, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "ic52.bin", 0x40000, 0xaf475852, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "64th_08.rom", 0x10000, 0x632be0c1, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "64th_07.rom", 0x10000, 0x13595d01, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "64street.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "64th_01.rom", 0x80000, 0x06222f90, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "64th_06.rom", 0x80000, 0x2bfcdc75, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "64th_09.rom", 0x20000, 0xa4a97db4, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "64th_05.rom", 0x80000, 0xa89a7020, 6 | BRF_GRA }, // 8 Sprites - { "64th_04.rom", 0x80000, 0x98f83ef6, 6 | BRF_GRA }, // 9 - - { "64th_11.rom", 0x20000, 0xb0b8a65c, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "64th_10.rom", 0x40000, 0xa3390561, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "pr91009.12", 0x00200, 0xc69423d6, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(Street64ja) -STD_ROM_FN(Street64ja) - -struct BurnDriver BurnDrvStreet64ja = { - "64streetja", "64street", NULL, NULL, "1991", - "64th. Street - A Detective Story (Japan, alt)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, Street64jaRomInfo, Street64jaRomName, NULL, NULL, CommonInputInfo, Street64DIPInfo, - street64Init, DrvExit, System1CFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Big Striker - -static struct BurnRomInfo bigstrikRomDesc[] = { - { "91105v11.3", 0x20000, 0x5d6e08ec, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "91105v11.2", 0x20000, 0x2120f05b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "91105v10.8", 0x10000, 0x7dd69ece, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "91105v10.7", 0x10000, 0xbc2c1508, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "bigstrik.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "91021-01.1", 0x80000, 0xf1945858, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "91021-03.6", 0x80000, 0xe88821e5, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "91105v11.9", 0x20000, 0x7be1c50c, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "91021-02.5", 0x80000, 0x199819ca, 6 | BRF_GRA }, // 8 Sprites - - { "91105v10.11", 0x40000, 0x0ef8fd43, 7 | BRF_SND }, // 9 OKI #0 Samples - - { "91105v10.10", 0x40000, 0xd273a92a, 8 | BRF_SND }, // 10 OKI #1 Samples - - { "82s131.12", 0x00200, 0x4b00fccf, 9 | BRF_GRA }, // 11 Priority PROM -}; - -STD_ROM_PICK(bigstrik) -STD_ROM_FN(bigstrik) - -static INT32 bigstrikInit() -{ - input_select_values[0] = 0x58; - input_select_values[1] = 0x54; - input_select_values[2] = 0x55; - input_select_values[3] = 0x56; - input_select_values[4] = 0x57; - - return SystemInit(0xC, NULL); -} - -struct BurnDriver BurnDrvBigstrik = { - "bigstrik", NULL, NULL, NULL, "1992", - "Big Striker\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSFOOTBALL, 0, - NULL, bigstrikRomInfo, bigstrikRomName, NULL, NULL, Common3ButtonInputInfo, BigstrikDIPInfo, - bigstrikInit, DrvExit, System1CFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Chimera Beast (prototype) - -static struct BurnRomInfo chimerabRomDesc[] = { - { "prg3.bin", 0x40000, 0x70f1448f, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "prg2.bin", 0x40000, 0x821dbb85, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "prg8.bin", 0x10000, 0xa682b1ca, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "prg7.bin", 0x10000, 0x83b9982d, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "chimerab.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "s1.bin", 0x80000, 0xe4c2ac77, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "s2.bin", 0x80000, 0xfafb37a5, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "scr3.bin", 0x20000, 0x5fe38a83, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "b2.bin", 0x80000, 0x6e7f1778, 6 | BRF_GRA }, // 8 Sprites - { "b1.bin", 0x80000, 0x29c0385e, 6 | BRF_GRA }, // 9 - - { "voi11.bin", 0x40000, 0x14b3afe6, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "voi10.bin", 0x40000, 0x67498914, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "pr-91044", 0x00200, 0xc69423d6, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(chimerab) -STD_ROM_FN(chimerab) - -static INT32 chimerabInit() -{ - const UINT32 priority_data[16] = { - 0x14032,0x04132,0x14032,0x04132,0xfffff,0xfffff,0xfffff,0xfffff, - 0xfffff,0xfffff,0x01324,0xfffff,0xfffff,0xfffff,0xfffff,0xfffff - }; - - memcpy (m_layers_order, priority_data, 16 * sizeof(INT32)); - - input_select_values[0] = 0x56; - input_select_values[1] = 0x52; - input_select_values[2] = 0x53; - input_select_values[3] = 0x54; - input_select_values[4] = 0x55; - - return SystemInit(0xC, NULL); -} - -struct BurnDriver BurnDrvChimerab = { - "chimerab", NULL, NULL, NULL, "1993", - "Chimera Beast (prototype)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, chimerabRomInfo, chimerabRomName, NULL, NULL, CommonInputInfo, ChimerabDIPInfo, - chimerabInit, DrvExit, System1CFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Cybattler - -static struct BurnRomInfo cybattlrRomDesc[] = { - { "cb_03.rom", 0x40000, 0xbee20587, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "cb_02.rom", 0x40000, 0x2ed14c50, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "cb_08.rom", 0x10000, 0xbf7b3558, 2 | BRF_PRG | BRF_ESS }, // 2 68k #1 Code - { "cb_07.rom", 0x10000, 0x85d219d7, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cybattlr.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 4 MCU Code - - { "cb_m01.rom", 0x80000, 0x1109337f, 3 | BRF_GRA }, // 5 Tilemap #0 Tiles - - { "cb_m04.rom", 0x80000, 0x0c91798e, 4 | BRF_GRA }, // 6 Tilemap #1 Tiles - - { "cb_09.rom", 0x20000, 0x37b1f195, 5 | BRF_GRA }, // 7 Tilemap #2 Tiles - - { "cb_m03.rom", 0x80000, 0x4cd49f58, 6 | BRF_GRA }, // 8 Sprites - { "cb_m02.rom", 0x80000, 0x882825db, 6 | BRF_GRA }, // 9 - - { "cb_11.rom", 0x40000, 0x59d62d1f, 7 | BRF_SND }, // 10 OKI #0 Samples - - { "cb_10.rom", 0x40000, 0x8af95eed, 8 | BRF_SND }, // 11 OKI #1 Samples - - { "pr-91028.12", 0x00200, 0xcfe90082, 9 | BRF_GRA }, // 12 Priority PROM -}; - -STD_ROM_PICK(cybattlr) -STD_ROM_FN(cybattlr) - -static INT32 cybattlrInit() -{ - input_select_values[0] = 0x56; - input_select_values[1] = 0x52; - input_select_values[2] = 0x53; - input_select_values[3] = 0x54; - input_select_values[4] = 0x55; - - return SystemInit(0xC, NULL); -} - -struct BurnDriver BurnDrvCybattlr = { - "cybattlr", NULL, NULL, NULL, "1993", - "Cybattler\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, cybattlrRomInfo, cybattlrRomName, NULL, NULL, CommonInputInfo, CybattlrDIPInfo, - cybattlrInit, DrvExit, System1CFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; - - -// Legend of Makai (World) - -static struct BurnRomInfo lomakaiRomDesc[] = { - { "lom_30.rom", 0x20000, 0xba6d65b8, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "lom_20.rom", 0x20000, 0x56a00dc2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "lom_01.rom", 0x10000, 0x46e85e90, 10 | BRF_PRG | BRF_ESS },// 2 Z80 Code - - { "lom_05.rom", 0x20000, 0xd04fc713, 3 | BRF_GRA }, // 3 Tilemap #0 Tiles - - { "lom_08.rom", 0x10000, 0xbdb15e67, 4 | BRF_GRA }, // 4 Tilemap #1 Tiles - - { "lom_06.rom", 0x20000, 0xf33b6eed, 6 | BRF_GRA }, // 5 Sprites - - { "makaiden.9", 0x00100, 0x3567065d, 0 | BRF_OPT }, // 6 Unknown PROMs - { "makaiden.10", 0x00100, 0xe6709c51, 0 | BRF_OPT }, // 7 -}; - -STD_ROM_PICK(lomakai) -STD_ROM_FN(lomakai) - -static INT32 lomakaiInit() -{ - return SystemInit(0x0/*Z*/, NULL); -} - -struct BurnDriver BurnDrvLomakai = { - "lomakai", NULL, NULL, NULL, "1988", - "Legend of Makai (World)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, lomakaiRomInfo, lomakaiRomName, NULL, NULL, CommonInputInfo, LomakaiDIPInfo, - lomakaiInit, DrvExit, System1ZFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 224, 4, 3 -}; - - -// Makai Densetsu (Japan) - -static struct BurnRomInfo makaidenRomDesc[] = { - { "makaiden.3a", 0x20000, 0x87cf81d1, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "makaiden.2a", 0x20000, 0xd40e0fea, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "lom_01.rom", 0x10000, 0x46e85e90, 10 | BRF_PRG | BRF_ESS },// 2 Z80 Code - - { "lom_05.rom", 0x20000, 0xd04fc713, 3 | BRF_GRA }, // 3 Tilemap #0 Tiles - - { "makaiden.8", 0x10000, 0xa7f623f9, 4 | BRF_GRA }, // 4 Tilemap #1 Tiles - - { "lom_06.rom", 0x20000, 0xf33b6eed, 6 | BRF_GRA }, // 5 Sprites - - { "makaiden.9", 0x00100, 0x3567065d, 0 | BRF_OPT }, // 6 Unknown PROMs - { "makaiden.10", 0x00100, 0xe6709c51, 0 | BRF_OPT }, // 7 -}; - -STD_ROM_PICK(makaiden) -STD_ROM_FN(makaiden) - -struct BurnDriver BurnDrvMakaiden = { - "makaiden", "lomakai", NULL, NULL, "1988", - "Makai Densetsu (Japan)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, makaidenRomInfo, makaidenRomName, NULL, NULL, CommonInputInfo, LomakaiDIPInfo, - lomakaiInit, DrvExit, System1ZFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 256, 224, 4, 3 -}; - - -// Peek-a-Boo! - -static struct BurnRomInfo peekabooRomDesc[] = { - { "j3", 0x020000, 0xf5f4cf33, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "j2", 0x020000, 0x7b3d430d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mo-90233.mcu", 0x001000, 0x00000000, 0 | BRF_NODUMP }, // 2 MCU Code - - { "5", 0x080000, 0x34fa07bb, 3 | BRF_GRA }, // 3 Tilemap #0 Tiles - - { "4", 0x020000, 0xf037794b, 4 | BRF_GRA }, // 4 Tilemap #1 Tiles - - { "1", 0x080000, 0x5a444ecf, 6 | BRF_GRA }, // 5 Sprites - - { "peeksamp.124", 0x100000, 0xe1206fa8, 8 | BRF_SND }, // 6 OKI #0 Samples - - { "priority.69", 0x000200, 0xb40bff56, 9 | BRF_GRA }, // 7 Priority PROM -}; - -STD_ROM_PICK(peekaboo) -STD_ROM_FN(peekaboo) - -static void peekabooCallback() -{ - memcpy (DrvSndROM0, DrvSndROM1, 0x40000); // set initial banks -} - -static INT32 peekabooInit() -{ - return SystemInit(0xD, peekabooCallback); -} - -struct BurnDriver BurnDrvPeekaboo = { - "peekaboo", NULL, NULL, NULL, "1993", - "Peek-a-Boo!\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, peekabooRomInfo, peekabooRomName, NULL, NULL, PeekabooInputInfo, PeekabooDIPInfo, - peekabooInit, DrvExit, System1DFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Peek-a-Boo! (North America, ver 1.0) - -static struct BurnRomInfo peekaboouRomDesc[] = { - { "pb92127a_3_ver1.0.ic29", 0x020000, 0x4603176a, 1 | BRF_PRG | BRF_ESS }, // 0 68k #0 Code - { "pb92127a_2_ver1.0.ic28", 0x020000, 0x7bf4716b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mo-90233.mcu", 0x001000, 0x00000000, 0 | BRF_NODUMP }, // 2 MCU Code - - { "5", 0x080000, 0x34fa07bb, 3 | BRF_GRA }, // 3 Tilemap #0 Tiles - - { "4", 0x020000, 0xf037794b, 4 | BRF_GRA }, // 4 Tilemap #1 Tiles - - { "1", 0x080000, 0x5a444ecf, 6 | BRF_GRA }, // 5 Sprites - - { "peeksamp.124", 0x100000, 0xe1206fa8, 8 | BRF_SND }, // 6 OKI #0 Samples - - { "priority.69", 0x000200, 0xb40bff56, 9 | BRF_GRA }, // 7 Priority PROM -}; - -STD_ROM_PICK(peekaboou) -STD_ROM_FN(peekaboou) - -struct BurnDriver BurnDrvPeekaboou = { - "peekaboou", "peekaboo", NULL, NULL, "1993", - "Peek-a-Boo! (North America, ver 1.0)\0", NULL, "Jaleco", "Mega System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, peekaboouRomInfo, peekaboouRomName, NULL, NULL, PeekabooInputInfo, PeekabooDIPInfo, - peekabooInit, DrvExit, System1DFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_meijinsn.cpp b/jan/src/burn/drv/pre90s/d_meijinsn.cpp deleted file mode 100644 index a912313d3..000000000 --- a/jan/src/burn/drv/pre90s/d_meijinsn.cpp +++ /dev/null @@ -1,534 +0,0 @@ -// FB Alpha Meijinsen Driver Module -// Based on MAME driver by Tomasz Slanina - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColPROM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; - -static INT16 *pAY8910Buffer[3]; - -static UINT16 DrvInputs[3]; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvReset; -static UINT8 DrvDips; - -static INT32 credits; -static INT32 mcu_latch; -static INT32 deposits1; -static INT32 deposits2; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - - {"Start 1", BIT_DIGITAL, DrvJoy1 + 8, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"Start 2", BIT_DIGITAL, DrvJoy1 + 9, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 15, "Service" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip Switches", BIT_DIPSWITCH, &DrvDips, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[] = -{ - {0x12, 0xFF, 0xFF, 0x08, NULL }, - - {0, 0xFE, 0, 8, "Game time (actual game)" }, - {0x12, 0x01, 0x07, 0x07, "01:00" }, - {0x12, 0x01, 0x07, 0x06, "02:00" }, - {0x12, 0x01, 0x07, 0x05, "03:00" }, - {0x12, 0x01, 0x07, 0x04, "04:00" }, - {0x12, 0x01, 0x07, 0x03, "05:00" }, - {0x12, 0x01, 0x07, 0x02, "10:00" }, - {0x12, 0x01, 0x07, 0x01, "20:00" }, - {0x12, 0x01, 0x07, 0x00, "00:30" }, - - {0, 0xFE, 0, 2, "Coinage" }, - {0x12, 0x01, 0x08, 0x08, "A 1C/1C B 1C/5C" }, - {0x12, 0x01, 0x08, 0x00, "A 1C/2C B 2C/1C" }, - - {0, 0xFE, 0, 2, "2 Player" }, - {0x12, 0x01, 0x10, 0x00, "1C" }, - {0x12, 0x01, 0x10, 0x10, "2C" }, - - {0, 0xFE, 0, 2, "Game time (tsumeshougi)" }, - {0x12, 0x01, 0x20, 0x20, "01:00" }, - {0x12, 0x01, 0x20, 0x00, "02:00" }, -}; - -STDDIPINFO(Drv) - -static UINT8 alpha_mcu_r(UINT8 offset) -{ - static const UINT8 coinage1[2][2] = {{1,1}, {1,2}}; - static const UINT8 coinage2[2][2] = {{1,5}, {2,1}}; - - UINT16 source = SekReadWord(0x180e00 + offset); - - switch (offset) - { - case 0x00: - SekWriteWord(0x180e00, (source & 0xff00) | DrvDips); - return 0; - - case 0x44: - SekWriteWord(0x180e44, (source & 0xff00) | credits); - return 0; - - case 0x52: - credits = 0; - if ((DrvInputs[2] & 0x3) == 0) - mcu_latch = 0; - - SekWriteWord(0x180e52, (source & 0xff00) | 0x22); - - if ((DrvInputs[2] & 0x1) == 0x1 && !mcu_latch) - { - SekWriteWord(0x180e44, (source & 0xff00) | 0x00); - mcu_latch = 1; - - INT32 coinvalue = (~DrvDips >> 3) & 1; - - deposits1++; - if (deposits1 == coinage1[coinvalue][0]) - { - credits = coinage1[coinvalue][1]; - deposits1 = 0; - } - else - credits = 0; - } - else if ((DrvInputs[2] & 0x2) == 0x2 && !mcu_latch) - { - SekWriteWord(0x180e44, (source & 0xff00) | 0x00); - mcu_latch = 1; - - INT32 coinvalue = (~DrvDips >> 3) & 1; - - deposits2++; - if (deposits2 == coinage2[coinvalue][0]) - { - credits = coinage2[coinvalue][1]; - deposits2 = 0; - } - else - credits = 0; - } - - return 0; - } - - return 0; -} - -UINT8 __fastcall meijinsn_read_byte(UINT32 address) -{ - if ((address & ~0xff) == 0x080e00) { - return alpha_mcu_r(address & 0xfe); - } - - switch (address) - { - case 0x1a0000: - return DrvInputs[0] >> 8; - - case 0x1a0001: - return DrvInputs[0] >> 0; - - case 0x1c0000: - return DrvInputs[1] >> 8; - } - - return 0; -} - -void __fastcall meijinsn_write_byte(UINT32 address, UINT8 data) -{ - if (address == 0x1a0001) { - *soundlatch = data; - return; - } -} - -UINT8 __fastcall meijinsn_in_port(UINT16 port) -{ - if ((port & 0xff) == 0x01) { - return AY8910Read(0); - } - - return 0; -} - -void __fastcall meijinsn_out_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - AY8910Write(0, port & 1, data); - break; - - case 0x02: - *soundlatch = 0; - break; - } -} - -static UINT8 ay8910_port_a_r(UINT32) -{ - return *soundlatch; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - credits = 0; - mcu_latch = 0; - deposits1 = 0; - deposits2 = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0010 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x002000; - DrvZ80RAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x008000; - - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x10; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - - INT32 r = ((bit0 * 4169) + (bit1 * 7304) + (bit2 * 14025)) / 100; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - - INT32 g = ((bit0 * 4169) + (bit1 * 7304) + (bit2 * 14025)) / 100; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - - INT32 b = ((bit0 * 8322) + (bit1 * 15980)) / 100; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - UINT8 *tmp = BurnMalloc(0x10000); - - if (BurnLoadRom(tmp + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(tmp + 0x000000, 1, 2)) return 1; - - memcpy (Drv68KROM + 0x000000, tmp + 0x000000, 0x008000); - memcpy (Drv68KROM + 0x020000, tmp + 0x008000, 0x008000); - - if (BurnLoadRom(tmp + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(tmp + 0x000000, 3, 2)) return 1; - - memcpy (Drv68KROM + 0x008000, tmp + 0x000000, 0x008000); - memcpy (Drv68KROM + 0x028000, tmp + 0x008000, 0x008000); - - if (BurnLoadRom(tmp + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(tmp + 0x000000, 5, 2)) return 1; - - memcpy (Drv68KROM + 0x010000, tmp + 0x000000, 0x008000); - memcpy (Drv68KROM + 0x030000, tmp + 0x008000, 0x008000); - - if (BurnLoadRom(tmp + 0x000001, 6, 2)) return 1; - if (BurnLoadRom(tmp + 0x000000, 7, 2)) return 1; - - memcpy (Drv68KROM + 0x018000, tmp + 0x000000, 0x008000); - memcpy (Drv68KROM + 0x038000, tmp + 0x008000, 0x008000); - - BurnFree (tmp); - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x04000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x000, 10, 1)) return 1; - - DrvPaletteInit(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0x100000, 0x107fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x180000, 0x181fff, MAP_RAM); - SekSetWriteByteHandler(0, meijinsn_write_byte); - SekSetReadByteHandler(0, meijinsn_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetOutHandler(meijinsn_out_port); - ZetSetInHandler(meijinsn_in_port); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, &ay8910_port_a_r, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.75, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - AY8910Exit(0); - - BurnFree(AllMem); - - return 0; -} - -static void draw_layer() -{ - UINT16 *vram = (UINT16*)DrvVidRAM; - - for (INT32 i = 0; i < 0x4000; i++) - { - INT32 sx = (i >> 6) & 0xfc; - INT32 sy = i & 0xff; - - if (sy < 16 || sy > 239 || sx < 12 || sx > 240) continue; - - sx -= 12; - sy -= 16; - - INT32 data = vram[i]; - - for (INT32 x = 0; x < 4; x++, data >>= 1) - { - pTransDraw[sy * 232 + sx + (x ^ 3)] = (data & 1) | ((data >> 3) & 2) | ((data >> 6) & 4) | ((data >> 9) & 8); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 3 * sizeof(INT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 160; - INT32 nCyclesSegment; - INT32 nCyclesTotal[2] = { 9000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesDone[0] += SekRun(nCyclesSegment); - if (i == 0) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == 159) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - nNext = (i + 1) * nCyclesTotal[1] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[1]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[1] += nCyclesSegment; - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - ZetClose(); - SekClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(mcu_latch); - SCAN_VAR(deposits1); - SCAN_VAR(deposits2); - SCAN_VAR(credits); - } - - return 0; -} - - -// Meijinsen - -static struct BurnRomInfo meijinsnRomDesc[] = { - { "p1", 0x08000, 0x8c9697a3, BRF_PRG | BRF_ESS }, // 0 M68000 Code - { "p2", 0x08000, 0xf7da3535, BRF_PRG | BRF_ESS }, // 1 - { "p3", 0x08000, 0x0af0b266, BRF_PRG | BRF_ESS }, // 2 - { "p4", 0x08000, 0xaab159c5, BRF_PRG | BRF_ESS }, // 3 - { "p5", 0x08000, 0x0ed10a47, BRF_PRG | BRF_ESS }, // 4 - { "p6", 0x08000, 0x60b58755, BRF_PRG | BRF_ESS }, // 5 - { "p7", 0x08000, 0x604c76f1, BRF_PRG | BRF_ESS }, // 6 - { "p8", 0x08000, 0xe3eaef19, BRF_PRG | BRF_ESS }, // 7 - - { "p9", 0x04000, 0xaedfefdf, BRF_PRG | BRF_ESS }, // 8 Z80 Code - { "p10", 0x04000, 0x93b4d764, BRF_PRG | BRF_ESS }, // 9 - - { "clr", 0x00020, 0x7b95b5a7, BRF_GRA }, // 10 Color Prom -}; - -STD_ROM_PICK(meijinsn) -STD_ROM_FN(meijinsn) - -struct BurnDriver BurnDrvMeijinsn = { - "meijinsn", NULL, NULL, NULL, "1986", - "Meijinsen\0", NULL, "SNK Electronics corp.", "Miscellaneous", - L"\u540D\u4EBA\u6226\0Meijinsen\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, meijinsnRomInfo, meijinsnRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 232, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_metlfrzr.cpp b/jan/src/burn/drv/pre90s/d_metlfrzr.cpp deleted file mode 100644 index e7142e893..000000000 --- a/jan/src/burn/drv/pre90s/d_metlfrzr.cpp +++ /dev/null @@ -1,616 +0,0 @@ -// FB Alpha Metal Freezer driver module -// Based on MAME driver by Angelo Salese (Kale) - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "t5182.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80ROMDec; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvScrollRAM; -static UINT8 *DrvPalRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 z80_bank; -static UINT8 fg_tilebank; -static UINT8 rowscroll_enable; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[2]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo MetlfrzrInputList[] = { - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 4, "p1 start" }, - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 5, "p2 start" }, - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Metlfrzr) - -static struct BurnDIPInfo MetlfrzrDIPList[]= -{ - {0x11, 0xff, 0xff, 0xcf, NULL }, - {0x12, 0xff, 0xff, 0xfe, NULL }, - {0x13, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 2, "2-0" }, - {0x11, 0x01, 0x01, 0x01, "No" }, - {0x11, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "2-1" }, - {0x11, 0x01, 0x02, 0x02, "No" }, - {0x11, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "2-2" }, - {0x11, 0x01, 0x04, 0x04, "No" }, - {0x11, 0x01, 0x04, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "2-2" }, - {0x11, 0x01, 0x08, 0x08, "No" }, - {0x11, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "2-6" }, - {0x11, 0x01, 0x40, 0x40, "No" }, - {0x11, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "2-7" }, - {0x11, 0x01, 0x80, 0x80, "No" }, - {0x11, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x01, 0x00, "Upright" }, - {0x12, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x30, 0x30, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x30, 0x38, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x30, 0x18, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x30, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x30, 0x08, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0xc0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Off" }, - {0x13, 0x01, 0x03, 0x03, "On" }, - {0x13, 0x01, 0x03, 0x01, "Off" }, - {0x13, 0x01, 0x03, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x08, "20k/50k/100k" }, - {0x13, 0x01, 0x0c, 0x0c, "30k/80k/150k" }, - {0x13, 0x01, 0x0c, 0x04, "50k/100k/200k" }, - {0x13, 0x01, 0x0c, 0x00, "100k/200k/400k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x30, 0x20, "1" }, - {0x13, 0x01, 0x30, 0x10, "2" }, - {0x13, 0x01, 0x30, 0x30, "3" }, - {0x13, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Metlfrzr) - -static void bankswitch(INT32 data) -{ - z80_bank = data; - - INT32 nBank = ((data & 0x0c) >> 2) * 0x4000 + 0x10000; - - ZetMapMemory(DrvZ80ROM + nBank, 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall metlfrzr_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff80) == 0xd400) { - t5182SharedRAM[address & 0x7f] = data; - return; - } - - switch (address) - { - case 0xd700: - fg_tilebank = (data >> 4) & 1; - rowscroll_enable = data & 0x02; - bankswitch(data); - return; - - case 0xd710: - ZetClose(); - ZetOpen(1); - t5182_setirq_callback(CPU_ASSERT); - ZetClose(); - ZetOpen(0); - return; - - case 0xd712: - case 0xd713: - t5182_semaphore_main = address & 1; - return; - } -} - -static UINT8 __fastcall metlfrzr_main_read(UINT16 address) -{ - if ((address & 0xff80) == 0xd400) { - return t5182SharedRAM[address & 0x7f]; - } - - switch (address) - { - case 0xd600: - return DrvInputs[0]; - - case 0xd601: - return DrvInputs[1]; - - case 0xd602: - return (DrvInputs[2] & 0x30) | (DrvDips[0] & ~0x30); - - case 0xd603: - return DrvDips[1]; - - case 0xd604: - return DrvDips[2]; - - case 0xd711: - return t5182_semaphore_snd; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - bankswitch(0); - ZetClose(); - - t5182Reset(); - - fg_tilebank = 0; - rowscroll_enable = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x020000; - DrvZ80ROMDec = DrvZ80ROM + 0x008000; - - t5182ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0201 * sizeof(UINT32); - - AllRam = Next; - - DrvPalRAM = Next; Next += 0x000400; - DrvScrollRAM = Next; Next += 0x000100; - DrvZ80RAM = Next; Next += 0x002800; - DrvVidRAM = Next; Next += 0x001000; - - t5182SharedRAM = Next; Next += 0x000100; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Planes[4] = { STEP4(0,4) }; - INT32 XOffs0[8] = { STEP4(16+3,-1), STEP4(3,-1) }; - INT32 XOffs1[16] = { STEP4(0,1), STEP4(16,1), STEP4(64*8,1), STEP4(64*8+16,1) }; - INT32 YOffs[16] = { STEP16(0,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x40000); - - GfxDecode(0x2000, 4, 8, 8, Planes, XOffs0, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Planes, XOffs1, YOffs, 0x400, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static void DrvProgDecrypt() -{ - for (INT32 A = 0; A < 0x8000; A++) - { - DrvZ80ROMDec[A] = DrvZ80ROM[A]; - - if (BIT(A,5) && !BIT(A,3)) - DrvZ80ROMDec[A] ^= 0x40; - - if (BIT(A,10) && !BIT(A,9) && BIT(A,3)) - DrvZ80ROMDec[A] ^= 0x20; - - if ((BIT(A,10) ^ BIT(A,9)) && BIT(A,1)) - DrvZ80ROMDec[A] ^= 0x02; - - if (BIT(A,9) || !BIT(A,5) || BIT(A,3)) - DrvZ80ROMDec[A] = BITSWAP08(DrvZ80ROMDec[A],7,6,1,4,3,2,5,0); - - /* decode the data */ - if (BIT(A,5)) - DrvZ80ROM[A] ^= 0x40; - - if (BIT(A,9) || !BIT(A,5)) - DrvZ80ROM[A] = BITSWAP08(DrvZ80ROM[A],7,6,1,4,3,2,5,0); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(t5182ROM + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(t5182ROM + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 7, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 11, 2)) return 1; - - DrvProgDecrypt(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80ROMDec, 0x0000, 0x7fff, MAP_FETCHOP); - ZetMapMemory(DrvPalRAM, 0xd000, 0xd3ff, MAP_RAM); - ZetMapMemory(DrvScrollRAM, 0xd600, 0xd6ff, MAP_WRITE); - ZetMapMemory(DrvVidRAM, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0xd800, 0xffff, MAP_RAM); - ZetSetWriteHandler(metlfrzr_main_write); - ZetSetReadHandler(metlfrzr_main_read); - ZetClose(); - - t5182Init(1, 14318180/4); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - t5182Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 0x200; i++) { - INT32 b = DrvPalRAM[i+0x200] & 0x0f; - INT32 g = DrvPalRAM[i+0x000] >> 4; - INT32 r = DrvPalRAM[i+0x000] & 0x0f; - - DrvPalette[i] = BurnHighCol(r+(r*16), g+(g*16), b+(b*16), 0); - } - - DrvPalette[0x200] = 0; -} - -static void draw_bg_layer() // Ripped directly from MAME, very ugly! -{ - INT32 x_scroll_shift; - - UINT16 x_scroll_value = DrvScrollRAM[0x17] + ((DrvScrollRAM[0x06] & 1) << 8); - INT32 x_scroll_base = (x_scroll_value >> 3) * 32; - - for (INT32 count = 0; count < 32*33; count++) - { - INT32 tile_base = count; - INT32 y = (count % 32); - if(y > 7 || rowscroll_enable == 0) // TODO: this condition breaks on level 5 halfway thru. - { - tile_base+= x_scroll_base; - x_scroll_shift = (x_scroll_value & 7); - } - else - x_scroll_shift = 0; - tile_base &= 0x7ff; - INT32 x = (count / 32); - - UINT16 tile = DrvVidRAM[tile_base*2+0] + ((DrvVidRAM[tile_base*2+1] & 0xf0) << 4) + (fg_tilebank * 0x1000); - UINT8 color = DrvVidRAM[tile_base*2+1] & 0xf; - - Render8x8Tile_Mask_Clip(pTransDraw, tile, x*8-x_scroll_shift, y*8 - 16, color, 4, 0xf, 0x100, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - UINT8 *ram = DrvZ80RAM + 0x2600; - - for (INT32 count = 0x200 - 4; count >- 1; count -= 4) - { - INT32 code = ram[count+0] + ((ram[count+1] & 0x70) << 4); - UINT8 color = ram[count+1] & 0xf; - INT32 sy = ram[count+2]; - INT32 sx = ram[count+3]; - if (ram[count+1] & 0x80) sx -= 256; // wrap - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0xf, 0, DrvGfxROM1); - } -} - -static INT32 DrvDraw() -{ - //if (DrvRecalc) { - // DrvRecalc = 0; - DrvPaletteUpdate(); - //} - - for (INT32 offs = 0; offs < nScreenWidth * nScreenHeight; offs++) { - pTransDraw[offs] = 0x200; - } - - draw_bg_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - t5182_coin_input = (DrvJoy4[0] << 0) | (DrvJoy4[1] << 1); - } - - INT32 nSegment; - INT32 nInterleave = 16; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 6000000 / 60, 63079 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - - nSegment = ((nCyclesTotal[0] / nInterleave) * (i + 1)) - ZetTotalCycles(); - - nCyclesDone[0] += ZetRun(nSegment); - - if (i == 0) { - ZetSetVector(0x08); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - if (i == 15) { - ZetSetVector(0x10); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - ZetClose(); - - ZetOpen(1); // t5182 - - nSegment = ((nCyclesTotal[1] / nInterleave) * (i + 1)) - ZetTotalCycles(); - - nCyclesDone[1] += ZetRun(nSegment); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - - ZetClose(); - } - - ZetOpen(1); // t5182 - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029729; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - t5182Scan(nAction); - - - SCAN_VAR(z80_bank); - SCAN_VAR(fg_tilebank); - - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(z80_bank); - ZetClose(); - } - - return 0; -} - - -// Metal Freezer - -static struct BurnRomInfo metlfrzrRomDesc[] = { - { "1.15j", 0x08000, 0xf59b5fa2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2.14j", 0x10000, 0x21ecc248, 1 | BRF_PRG | BRF_ESS }, // 1 - -#if !defined (ROM_VERIFY) - { "t5182.rom", 0x02000, 0xd354c8fc, 2 | BRF_PRG | BRF_ESS }, // 2 t5182 Code (Z80) -#endif - { "3.4h", 0x08000, 0x36f88e54, 2 | BRF_GRA }, // 3 t5182 External - - { "10.5a", 0x10000, 0x3313e74a, 3 | BRF_GRA }, // 4 Background Tiles - { "12.7a", 0x10000, 0x6da5fda9, 3 | BRF_GRA }, // 5 - { "11.6a", 0x10000, 0xfa6490b8, 3 | BRF_GRA }, // 6 - { "13.9a", 0x10000, 0xa4f689ec, 3 | BRF_GRA }, // 7 - - { "14.13a", 0x10000, 0xa9cd5225, 4 | BRF_GRA }, // 8 Sprites - { "16.11a", 0x10000, 0x92f2cb49, 4 | BRF_GRA }, // 9 - { "15.12a", 0x10000, 0xce5c4c8b, 4 | BRF_GRA }, // 10 - { "17.10a", 0x10000, 0x3fec33f7, 4 | BRF_GRA }, // 11 - - { "n8s129a.7f", 0x00100, 0xc849d60b, 5 | BRF_OPT }, // 12 Proms (unused) - { "n82s135n.9c", 0x00100, 0x7bbd52db, 5 | BRF_OPT }, // 13 - - { "pld3.14h.bin", 0x00149, 0x8183f7f0, 6 | BRF_OPT }, // 14 PLDs - { "pld8.4d.bin", 0x00149, 0xf1e35034, 6 | BRF_OPT }, // 15 -}; - -STD_ROM_PICK(metlfrzr) -STD_ROM_FN(metlfrzr) - -struct BurnDriver BurnDrvMetlfrzr = { - "metlfrzr", NULL, NULL, NULL, "1989", - "Metal Freezer\0", NULL, "Seibu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, metlfrzrRomInfo, metlfrzrRomName, NULL, NULL, MetlfrzrInputInfo, MetlfrzrDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_millipede.cpp b/jan/src/burn/drv/pre90s/d_millipede.cpp deleted file mode 100644 index a77632f45..000000000 --- a/jan/src/burn/drv/pre90s/d_millipede.cpp +++ /dev/null @@ -1,1109 +0,0 @@ -// Millipede emu-layer for FB Alpha by dink, based on Ivan Mackintosh's Millipede/Centipede emulator and MAME driver. -// Todo: -// Screen flip needs fixing (2p coctail mode) [move joystick <- -> or press OK to continue!] - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "pokey.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv6502ROM; -static UINT8 *Drv6502RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSpriteRAM; - -static UINT8 *DrvBGGFX; -static UINT8 *DrvSpriteGFX; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 m_dsw_select; -static UINT8 m_control_select; -static UINT32 m_flipscreen = 0; -static UINT32 vblank; -// transmask stuff -UINT8 m_penmask[64]; -// trackball stuff -static int oldpos[4]; -static UINT8 sign[4]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDip[5] = {0, 0, 0, 0, 0}; -static UINT8 DrvInput[5]; -static UINT8 DrvReset; - -// hi-score stuff! (atari earom) -#define EAROM_SIZE 0x40 -static UINT8 earom_offset; -static UINT8 earom_data; -static UINT8 earom[EAROM_SIZE]; - -static UINT32 centipedemode = 0; - -static struct BurnInputInfo MillipedInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 3, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 2, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 3, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 2, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy3 + 7, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 4, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip"}, - {"Dip D", BIT_DIPSWITCH, DrvDip + 3, "dip"}, -// {"Dip E", BIT_DIPSWITCH, DrvDip + 4, "dip"}, -}; - -STDINPUTINFO(Milliped) - -static struct BurnInputInfo CentipedInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy4 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy4 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy4 + 6, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy4 + 7, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 1, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 0, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 4, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip"}, -}; - -STDINPUTINFO(Centiped) - - -static struct BurnDIPInfo CentipedDIPList[]= -{ - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x54, NULL }, - {0x13, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x10, 0x00, "Upright" }, - {0x11, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Language" }, - {0x12, 0x01, 0x03, 0x00, "English" }, - {0x12, 0x01, 0x03, 0x01, "German" }, - {0x12, 0x01, 0x03, 0x02, "French" }, - {0x12, 0x01, 0x03, 0x03, "Spanish" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x0c, 0x00, "2" }, - {0x12, 0x01, 0x0c, 0x04, "3" }, - {0x12, 0x01, 0x0c, 0x08, "4" }, - {0x12, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x30, 0x00, "10000" }, - {0x12, 0x01, 0x30, 0x10, "12000" }, - {0x12, 0x01, 0x30, 0x20, "15000" }, - {0x12, 0x01, 0x30, 0x30, "20000" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x12, 0x01, 0x40, 0x40, "Easy" }, - {0x12, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Credit Minimum" }, - {0x12, 0x01, 0x80, 0x00, "1" }, - {0x12, 0x01, 0x80, 0x80, "2" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x13, 0x01, 0x03, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Right Coin" }, - {0x13, 0x01, 0x0c, 0x00, "*1" }, - {0x13, 0x01, 0x0c, 0x04, "*4" }, - {0x13, 0x01, 0x0c, 0x08, "*5" }, - {0x13, 0x01, 0x0c, 0x0c, "*6" }, - - {0 , 0xfe, 0 , 2, "Left Coin" }, - {0x13, 0x01, 0x10, 0x00, "*1" }, - {0x13, 0x01, 0x10, 0x10, "*2" }, - - {0 , 0xfe, 0 , 6, "Bonus Coins" }, - {0x13, 0x01, 0xe0, 0x00, "None" }, - {0x13, 0x01, 0xe0, 0x20, "3 credits/2 coins" }, - {0x13, 0x01, 0xe0, 0x40, "5 credits/4 coins" }, - {0x13, 0x01, 0xe0, 0x60, "6 credits/4 coins" }, - {0x13, 0x01, 0xe0, 0x80, "6 credits/5 coins" }, - {0x13, 0x01, 0xe0, 0xa0, "4 credits/3 coins" }, -}; - -STDDIPINFO(Centiped) - - -static struct BurnDIPInfo MillipedDIPList[]= -{ - {0x11, 0xff, 0xff, 0x04, NULL }, -// {0x12, 0xff, 0xff, 0x08, NULL }, - {0x12, 0xff, 0xff, 0xA0, NULL }, - {0x13, 0xff, 0xff, 0x04, NULL }, - {0x14, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 4, "Language" }, - {0x11, 0x01, 0x03, 0x00, "English" }, - {0x11, 0x01, 0x03, 0x01, "German" }, - {0x11, 0x01, 0x03, 0x02, "French" }, - {0x11, 0x01, 0x03, 0x03, "Spanish" }, - - {0 , 0xfe, 0 , 4, "Bonus" }, - {0x11, 0x01, 0x0c, 0x00, "0" }, - {0x11, 0x01, 0x0c, 0x04, "0 1x" }, - {0x11, 0x01, 0x0c, 0x08, "0 1x 2x" }, - {0x11, 0x01, 0x0c, 0x0c, "0 1x 2x 3x" }, - -/* {0 , 0xfe, 0 , 2, "Credit Minimum" }, - {0x12, 0x01, 0x04, 0x00, "1" }, - {0x12, 0x01, 0x04, 0x04, "2" }, - - {0 , 0xfe, 0 , 2, "Coin Counters" }, - {0x12, 0x01, 0x08, 0x00, "1" }, - {0x12, 0x01, 0x08, 0x08, "2" }, */ - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x20, 0x20, "Upright" }, - {0x12, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Millipede Head" }, - {0x13, 0x01, 0x01, 0x00, "Easy" }, - {0x13, 0x01, 0x01, 0x01, "Hard" }, - - {0 , 0xfe, 0 , 2, "Beetle" }, - {0x13, 0x01, 0x02, 0x00, "Easy" }, - {0x13, 0x01, 0x02, 0x02, "Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x0c, 0x00, "2" }, - {0x13, 0x01, 0x0c, 0x04, "3" }, - {0x13, 0x01, 0x0c, 0x08, "4" }, - {0x13, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x00, "12000" }, - {0x13, 0x01, 0x30, 0x10, "15000" }, - {0x13, 0x01, 0x30, 0x20, "20000" }, - {0x13, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2, "Spider" }, - {0x13, 0x01, 0x40, 0x00, "Easy" }, - {0x13, 0x01, 0x40, 0x40, "Hard" }, - - {0 , 0xfe, 0 , 2, "Starting Score Select" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x14, 0x01, 0x03, 0x03, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Right Coin" }, - {0x14, 0x01, 0x0c, 0x00, "*1" }, - {0x14, 0x01, 0x0c, 0x04, "*4" }, - {0x14, 0x01, 0x0c, 0x08, "*5" }, - {0x14, 0x01, 0x0c, 0x0c, "*6" }, - - {0 , 0xfe, 0 , 2, "Left Coin" }, - {0x14, 0x01, 0x10, 0x00, "*1" }, - {0x14, 0x01, 0x10, 0x10, "*2" }, - - {0 , 0xfe, 0 , 7, "Bonus Coins" }, - {0x14, 0x01, 0xe0, 0x00, "None" }, - {0x14, 0x01, 0xe0, 0x20, "3 credits/2 coins" }, - {0x14, 0x01, 0xe0, 0x40, "5 credits/4 coins" }, - {0x14, 0x01, 0xe0, 0x60, "6 credits/4 coins" }, - {0x14, 0x01, 0xe0, 0x80, "6 credits/5 coins" }, - {0x14, 0x01, 0xe0, 0xa0, "4 credits/3 coins" }, - {0x14, 0x01, 0xe0, 0xc0, "Demo Mode" }, -}; - -STDDIPINFO(Milliped) - -static void milliped_set_color(UINT16 offset, UINT8 data) -{ - UINT32 color; - int bit0, bit1, bit2; - int r, g, b; - - /* red component */ - bit0 = (~data >> 5) & 0x01; - bit1 = (~data >> 6) & 0x01; - bit2 = (~data >> 7) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* green component */ - bit0 = 0; - bit1 = (~data >> 3) & 0x01; - bit2 = (~data >> 4) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* blue component */ - bit0 = (~data >> 0) & 0x01; - bit1 = (~data >> 1) & 0x01; - bit2 = (~data >> 2) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - color = BurnHighCol(r, g, b, 0); - - /* character colors, set directly */ - if (offset < 0x10) - DrvPalette[offset] = color; - - /* sprite colors - set all the applicable ones */ - else - { - int i; - - int base = offset & 0x0c; - - offset = offset & 0x03; - - for (i = (base << 6); i < (base << 6) + 0x100; i += 4) - { - if (offset == ((i >> 2) & 0x03)) - DrvPalette[i + 0x100 + 1] = color; - - if (offset == ((i >> 4) & 0x03)) - DrvPalette[i + 0x100 + 2] = color; - - if (offset == ((i >> 6) & 0x03)) - DrvPalette[i + 0x100 + 3] = color; - } - } -} - -static void millipede_recalcpalette() -{ - for (INT32 i = 0;i <= 0x1f; i++) { - milliped_set_color(i, DrvPalRAM[i]); - } -} - -static void centipede_set_color(UINT16 offset, UINT8 data) -{ - /* bit 2 of the output palette RAM is always pulled high, so we ignore */ - /* any palette changes unless the write is to a palette RAM address */ - /* that is actually used */ - if (offset & 4) - { - INT32 color; - - int r = 0xff * ((~data >> 0) & 1); - int g = 0xff * ((~data >> 1) & 1); - int b = 0xff * ((~data >> 2) & 1); - - if (~data & 0x08) /* alternate = 1 */ - { - /* when blue component is not 0, decrease it. When blue component is 0, */ - /* decrease green component. */ - if (b) b = 0xc0; - else if (g) g = 0xc0; - } - - color = BurnHighCol(r, g, b, 0); - - /* character colors, set directly */ - if ((offset & 0x08) == 0) - DrvPalette[offset & 0x03] = color; - - /* sprite colors - set all the applicable ones */ - else - { - int i; - - offset = offset & 0x03; - - for (i = 0; i < 0x100; i += 4) - { - if (offset == ((i >> 2) & 0x03)) - DrvPalette[i + 0x100 + 1] = color; - - if (offset == ((i >> 4) & 0x03)) - DrvPalette[i + 0x100 + 2] = color; - - if (offset == ((i >> 6) & 0x03)) - DrvPalette[i + 0x100 + 3] = color; - } - } - } -} - -static void centipede_recalcpalette() -{ - for (INT32 i = 0;i <= 0x0f; i++) { - centipede_set_color(i, DrvPalRAM[i]); - } -} - -static UINT8 earom_read(UINT16 /*address*/) -{ - return (earom_data); -} - -static void earom_write(UINT16 offset, UINT8 data) -{ - earom_offset = offset; - earom_data = data; -} - -static void earom_ctrl_write(UINT16 /*offset*/, UINT8 data) -{ - /* - 0x01 = clock - 0x02 = set data latch? - writes only (not always) - 0x04 = write mode? - writes only - 0x08 = set addr latch? - */ - - if (data & 0x01) - earom_data = earom[earom_offset]; - if ((data & 0x0c) == 0x0c) - { - earom[earom_offset] = earom_data; - } -} - -static void millipede_write(UINT16 address, UINT8 data) -{ - address &= 0x7fff; // 15bit addressing - if (address >= 0x1000 && address <= 0x13bf) { // Video Ram - DrvVidRAM[address - 0x1000] = data; - return; - } - if (address >= 0x13c0 && address <= 0x13ff) { // Sprite Ram - DrvSpriteRAM[address - 0x13c0] = data; - return; - } - if (address >= 0x2480 && address <= 0x249f) { // Palette Ram - DrvPalRAM[address - 0x2480] = data; - milliped_set_color(address - 0x2480, data); - return; - } - - if (address >= 0x400 && address <= 0x40f) { // Pokey 1 - pokey1_w(address - 0x400, data); - return; - } - - if (address >= 0x800 && address <= 0x80f) { // Pokey 2 - pokey2_w(address - 0x800, data); - return; - } - - if (address >= 0x2780 && address <= 0x27bf) { // EAROM Write - earom_write(address - 0x2780, data); - return; - } - - switch (address) - { - case 0x2505: - m_dsw_select = (~data >> 7) & 1; - return; - - case 0x2506: - m_flipscreen = data >> 7; - return; - case 0x2507: - m_control_select = (data >> 7) & 1; - return; - case 0x2600: - M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - case 0x2700: - earom_ctrl_write(0x2700, data); - return; - } -// bprintf(0, _T("mw %X,"), address); -} - -static void centipede_write(UINT16 address, UINT8 data) -{ - address &= 0x3fff; // 14bit addressing - if (address >= 0x400 && address <= 0x7bf) { // Video Ram - DrvVidRAM[address - 0x400] = data; - return; - } - if (address >= 0x7c0 && address <= 0x7ff) { // Sprite Ram - DrvSpriteRAM[address - 0x7c0] = data; - return; - } - if (address >= 0x1400 && address <= 0x140f) { // Palette Ram - DrvPalRAM[address - 0x1400] = data; - centipede_set_color(address - 0x1400, data); - return; - } - - if (address >= 0x1000 && address <= 0x100f) { // Pokey #1 - pokey1_w(address - 0x1000, data); - return; - } - - if (address >= 0x1600 && address <= 0x163f) { // EAROM Write - earom_write(address - 0x1600, data); - return; - } - - switch (address) - { - case 0x2000: // watchdog - return; - case 0x1c07: - m_flipscreen = data >> 7; - return; - case 0x1680: - earom_ctrl_write(0x1680, data); - return; - case 0x2507: - m_control_select = (data >> 7) & 1; - return; - case 0x1800: - M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } - -// bprintf(0, _T("mw %X,"), address); -} - -static INT32 read_trackball(INT32 idx, INT32 switch_port) -{ - INT32 newpos; - - /* adjust idx if we're cocktail flipped */ - if (m_flipscreen) - idx += 2; - - /* if we're to read the dipswitches behind the trackball data, do it now */ - if (m_dsw_select) - return (DrvInput[switch_port] & 0x7f) | sign[idx]; - - /* get the new position and adjust the result */ - //newpos = readinputport(6 + idx); - newpos = 0; // no trackball!! -dink - if (newpos != oldpos[idx]) - { - sign[idx] = (newpos - oldpos[idx]) & 0x80; - oldpos[idx] = newpos; - } - - /* blend with the bits from the switch port */ - return (DrvInput[switch_port] & 0x70) | (oldpos[idx] & 0x0f) | sign[idx]; -} - - -static UINT8 millipede_read(UINT16 address) -{ - address &= 0x7fff; // 15bit addressing - if (address >= 0x1000 && address <= 0x13bf) { // Video Ram - return DrvVidRAM[address - 0x1000]; - } - if (address >= 0x13c0 && address <= 0x13ff) { // Sprite Ram - return DrvSpriteRAM[address - 0x13c0]; - } - if (address >= 0x2480 && address <= 0x249f) { // Palette Ram - return DrvPalRAM[address - 0x2480]; - } - if (address >= 0x4000 && address <= 0x7fff) { // ROM - return Drv6502ROM[address]; - } - - switch (address) - { - case 0x2000: return ((read_trackball(0, 0) | DrvDip[0]) & 0x3f) | ((vblank) ? 0x40 : 0x00); - case 0x2001: return read_trackball(1, 1);// | DrvDip[1] ; - case 0x2010: return DrvInput[2]; - case 0x2011: return DrvInput[3] | DrvDip[1]; - case 0x2030: return earom_read(address); - case 0x0400: - case 0x0401: - case 0x0402: - case 0x0403: - case 0x0404: - case 0x0405: - case 0x0406: - case 0x0407: return pokey1_r(address); - case 0x0408: return DrvDip[2]; - case 0x0409: - case 0x040a: - case 0x040b: - case 0x040c: - case 0x040d: - case 0x040e: - case 0x040f: return pokey1_r(address); - case 0x0800: - case 0x0801: - case 0x0802: - case 0x0803: - case 0x0804: - case 0x0805: - case 0x0806: - case 0x0807: return pokey2_r(address); - case 0x0808: return DrvDip[3]; - case 0x0809: - case 0x080a: - case 0x080b: - case 0x080c: - case 0x080d: - case 0x080e: - case 0x080f: return pokey2_r(address); - } - - //bprintf(0, _T("mr %X,"), address); - - return 0; -} - -static UINT8 centipede_read(UINT16 address) -{ - address &= 0x3fff; // 14bit addressing - if (address >= 0x400 && address <= 0x7bf) { // Video Ram - return DrvVidRAM[address - 0x400]; - } - if (address >= 0x7c0 && address <= 0x7ff) { // Sprite Ram - return DrvSpriteRAM[address - 0x7c0]; - } - if (address >= 0x1400 && address <= 0x140f) { // Palette Ram - return DrvPalRAM[address - 0x1400]; - } - if (address >= 0x2000 && address <= 0x3fff) { // ROM - return Drv6502ROM[address]; - } - if (address >= 0x1700 && address <= 0x173f) { // EAROM - return earom_read(address); - } - - switch (address) - { - case 0x0c00: return ((read_trackball(0, 0) | DrvDip[0]) & 0x3f) | ((vblank) ? 0x40 : 0x00); - case 0x0c01: return DrvInput[1]; - case 0x0c02: return read_trackball(1, 2); - case 0x0c03: return DrvInput[3]; - case 0x0800: return DrvDip[1]; - case 0x0801: return DrvDip[2]; - case 0x1000: - case 0x1001: - case 0x1002: - case 0x1003: - case 0x1004: - case 0x1005: - case 0x1006: - case 0x1007: return pokey1_r(address); - case 0x1008: return DrvDip[2]; - case 0x1009: - case 0x100a: - case 0x100b: - case 0x100c: - case 0x100d: - case 0x100e: - case 0x100f: return pokey1_r(address); - } - -// bprintf(0, _T("mr %X,"), address); - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - m_dsw_select = 0; - m_flipscreen = 0; - - M6502Open(0); - M6502Reset(); - M6502Close(); - - earom_offset = 0; - earom_data = 0; - //memset(&earom, 0, EAROM_SIZE); // only clear this @ init - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv6502ROM = Next; Next += 0x012000; - - DrvPalette = (UINT32*)Next; Next += 0x0600 * sizeof(UINT32); - DrvBGGFX = Next; Next += 0x10000; - DrvSpriteGFX = Next; Next += 0x10000; - - AllRam = Next; - - Drv6502RAM = Next; Next += 0x00400; - DrvVidRAM = Next; Next += 0x01000; - DrvSpriteRAM = Next; Next += 0x01000; - DrvPalRAM = Next; Next += 0x01000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void init_penmask() -{ - int i; - - for (i = 0; i < 64; i++) - { - UINT8 mask = 1; - if (((i >> 0) & 3) == 0) mask |= 2; - if (((i >> 2) & 3) == 0) mask |= 4; - if (((i >> 4) & 3) == 0) mask |= 8; - m_penmask[i] = mask; - } -} - -static INT32 CharPlaneOffsets[2] = { 256*8*8, 0 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 CharYOffsets[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }; - -static INT32 SpritePlaneOffsets[2] = { 128*16*8, 0 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0 }; -static INT32 SpriteYOffsets[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }; - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv6502ROM + 0x4000, 0, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x5000, 1, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x6000, 2, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x7000, 3, 1)) return 1; - - UINT8 *DrvTempRom = (UINT8 *)BurnMalloc(0x10000); - memset(DrvTempRom, 0, 0x10000); - if (BurnLoadRom(DrvTempRom , 4, 1)) return 1; - if (BurnLoadRom(DrvTempRom+0x800 , 5, 1)) return 1; - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvBGGFX); - GfxDecode(0x80, 2, 8, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x80, DrvTempRom, DrvSpriteGFX); - BurnFree(DrvTempRom); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Drv6502RAM, 0x0000, 0x03ff, MAP_RAM); - M6502MapMemory(Drv6502ROM + 0x4000, 0x4000, 0x7fff, MAP_ROM); - M6502SetWriteHandler(millipede_write); - M6502SetReadHandler(millipede_read); - M6502SetReadOpArgHandler(millipede_read); - M6502SetReadOpHandler(millipede_read); - M6502Close(); - - PokeyInit(12096000/8, 2, 1.00, 0); - - init_penmask(); - - GenericTilesInit(); - - memset(&earom, 0, sizeof(earom)); // don't put this in DrvDoReset() - - DrvDoReset(); - - return 0; -} - -static INT32 DrvInitcentiped() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv6502ROM + 0x2000, 0, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x2800, 1, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x3000, 2, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x3800, 3, 1)) return 1; - - UINT8 *DrvTempRom = (UINT8 *)BurnMalloc(0x10000); - memset(DrvTempRom, 0, 0x10000); - if (BurnLoadRom(DrvTempRom , 4, 1)) return 1; - if (BurnLoadRom(DrvTempRom+0x800 , 5, 1)) return 1; - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvBGGFX); - GfxDecode(0x80, 2, 8, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x80, DrvTempRom, DrvSpriteGFX); - BurnFree(DrvTempRom); - } - - centipedemode = 1; - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Drv6502RAM, 0x0000, 0x03ff, MAP_RAM); - M6502MapMemory(Drv6502ROM + 0x2000, 0x2000, 0x3fff, MAP_ROM); - M6502SetWriteHandler(centipede_write); - M6502SetReadHandler(centipede_read); - M6502SetReadOpArgHandler(centipede_read); - M6502SetReadOpHandler(centipede_read); - M6502Close(); - - PokeyInit(12096000/8, 2, 2.40, 0); - - init_penmask(); - - GenericTilesInit(); - - memset(&earom, 0, sizeof(earom)); // don't put this in DrvDoReset() - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - PokeyExit(); - - M6502Exit(); - - BurnFree(AllMem); - - centipedemode = 0; - m_dsw_select = 0; - m_flipscreen = 0; - - return 0; -} - - -extern int counter; - - -static void draw_bg() -{ - UINT8 *videoram = DrvVidRAM; - for (INT32 offs = 0; offs <= 0x3bf; offs++) - { - int flip_tiles; - int sx = offs % 32; - int sy = offs / 32; - - int data = videoram[offs]; - int bank = ((data >> 6) & 1); - int color = (data >> 6) & 3; - // Flip both x and y if flipscreen is non-zero - flip_tiles = (m_flipscreen) ? 0x03 : 0; - if (centipedemode) { - bank = 0; - color = 0; - flip_tiles = data >> 6; - } - int code = (data & 0x3f) + 0x40 + (bank * 0x80); - - - sx = 8 * sx; - sy = 8 * sy; - if (sx >= nScreenWidth) continue; - if (sy >= nScreenHeight) continue; - - if (flip_tiles) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, 248 - sx, 184 - sy, color, 2, 0, DrvBGGFX); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvBGGFX); - } - } -} - -static void RenderTileCPMP(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height) -{ - UINT16 *dest = pTransDraw; - UINT8 *gfx = DrvSpriteGFX; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - if (m_penmask[color & 0x3f] & (1 << pxl) || !pxl) continue; // is this right? - dest[sy * nScreenWidth + sx] = pxl | (color << 2) | 0x100; - } - sx -= width; - } -} - - -static void draw_sprites() -{ - UINT8 *spriteram = DrvSpriteRAM; - for (INT32 offs = 0; offs < 0x10; offs++) - { - int code = ((spriteram[offs] & 0x3e) >> 1) | ((spriteram[offs] & 0x01) << 6); - int color = spriteram[offs + 0x30]; - int flipx = (centipedemode) ? (spriteram[offs] >> 6) & 1 : m_flipscreen; - int flipy = (centipedemode) ? (spriteram[offs] >> 7) & 1 : (spriteram[offs] & 0x80); - int x = spriteram[offs + 0x20]; - int y = 240 - spriteram[offs + 0x10]; - if (flipx && !centipedemode) { - flipy = !flipy; - } - - if (x + 8 >= nScreenWidth) continue; // clip top 8px of sprites (top of screen) - - RenderTileCPMP(code, color, x, y, flipx, flipy, 8, 16); - } -} - -static INT32 DrvDraw() -{ - BurnTransferClear(); - - draw_bg(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvMakeInputs() -{ - // Reset Inputs - bring active-LOW stuff HIGH - DrvInput[0] = (centipedemode) ? 0x20 : 0x10 + 0x20; - DrvInput[1] = (centipedemode) ? 0xff : 0x01 + 0x02 + 0x10 + 0x20 + 0x40; - DrvInput[2] = 0xff; - DrvInput[3] = (centipedemode) ? 0xff : 0x01 + 0x02 + 0x04 + 0x08 + 0x10 + 0x40; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] -= (DrvJoy1[i] & 1) << i; - DrvInput[1] -= (DrvJoy2[i] & 1) << i; - DrvInput[2] -= (DrvJoy3[i] & 1) << i; - DrvInput[3] -= (DrvJoy4[i] & 1) << i; - } - -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - if(DrvRecalc) { - if (centipedemode) - centipede_recalcpalette(); - else - millipede_recalcpalette(); - DrvRecalc = 0; - } - - DrvMakeInputs(); - - M6502NewFrame(); - - INT32 nTotalCycles = 12096000/8 / 60; - INT32 nInterleave = 4; - - vblank = 0; - - M6502Open(0); - INT32 nNext, nCyclesDone = 0, nCyclesSegment; - - for (INT32 i = 0; i < nInterleave; i++) { - nNext = (i + 1) * nTotalCycles / nInterleave; - nCyclesSegment = nNext - nCyclesDone; - nCyclesDone += M6502Run(nCyclesSegment); - M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if (i == 2) - vblank = 1; - } - - M6502Close(); - if (pBurnSoundOut) { - pokey_update(0, pBurnSoundOut, nBurnSoundLen); - pokey_update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029722; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - - pokey_scan(nAction, pnMin); - - SCAN_VAR(earom_offset); - SCAN_VAR(earom_data); - SCAN_VAR(m_dsw_select); - SCAN_VAR(m_control_select); - SCAN_VAR(m_flipscreen); - } - - if (nAction & ACB_NVRAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = earom; - ba.nLen = sizeof(earom); - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - return 0; -} - - -// Millipede - -static struct BurnRomInfo millipedRomDesc[] = { - { "136013-104.mn1", 0x1000, 0x40711675, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "136013-103.l1", 0x1000, 0xfb01baf2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136013-102.jk1", 0x1000, 0x62e137e0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136013-101.h1", 0x1000, 0x46752c7d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136013-107.r5", 0x0800, 0x68c3437a, 2 | BRF_PRG | BRF_ESS }, // 4 gfx1 - { "136013-106.p5", 0x0800, 0xf4468045, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "136001-213.e7", 0x0100, 0x6fa3093a, 3 | BRF_PRG | BRF_ESS }, // 6 proms -}; - -STD_ROM_PICK(milliped) -STD_ROM_FN(milliped) - -struct BurnDriver BurnDrvMilliped = { - "milliped", NULL, NULL, NULL, "1982", - "Millipede\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, millipedRomInfo, millipedRomName, NULL, NULL, MillipedInputInfo, MillipedDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x600, - 240, 256, 3, 4 -}; - -// Centipede (revision 4) -static struct BurnRomInfo centipedRomDesc[] = { - { "136001-407.d1", 0x0800, 0xc4d995eb, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "136001-408.e1", 0x0800, 0xbcdebe1b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136001-409.fh1", 0x0800, 0x66d7b04a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136001-410.j1", 0x0800, 0x33ce4640, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136001-211.f7", 0x0800, 0x880acfb9, 2 | BRF_PRG | BRF_ESS }, // 4 gfx1 - { "136001-212.hj7", 0x0800, 0xb1397029, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "136001-213.p4", 0x0100, 0x6fa3093a, 3 | BRF_PRG | BRF_ESS }, // 6 proms -}; - - -STD_ROM_PICK(centiped) -STD_ROM_FN(centiped) - -struct BurnDriver BurnDrvCentiped = { - "centiped", NULL, NULL, NULL, "1980", - "Centipede (revision 4)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, centipedRomInfo, centipedRomName, NULL, NULL, CentipedInputInfo, CentipedDIPInfo, - DrvInitcentiped, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x600, - 240, 256, 3, 4 -}; - -// Centipede (revision 3) - -static struct BurnRomInfo centiped3RomDesc[] = { - { "136001-307.d1", 0x0800, 0x5ab0d9de, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "136001-308.e1", 0x0800, 0x4c07fd3e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "136001-309.fh1", 0x0800, 0xff69b424, 1 | BRF_PRG | BRF_ESS }, // 2 - { "136001-310.j1", 0x0800, 0x44e40fa4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "136001-211.f7", 0x0800, 0x880acfb9, 2 | BRF_PRG | BRF_ESS }, // 4 gfx1 - { "136001-212.hj7", 0x0800, 0xb1397029, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "136001-213.p4", 0x0100, 0x6fa3093a, 3 | BRF_PRG | BRF_ESS }, // 6 proms -}; - -STD_ROM_PICK(centiped3) -STD_ROM_FN(centiped3) - -struct BurnDriver BurnDrvCentiped3 = { - "centiped3", "centiped", NULL, NULL, "1980", - "Centipede (revision 3)\0", NULL, "Atari", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, centiped3RomInfo, centiped3RomName, NULL, NULL, CentipedInputInfo, CentipedDIPInfo, - DrvInitcentiped, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x600, - 240, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_mirax.cpp b/jan/src/burn/drv/pre90s/d_mirax.cpp deleted file mode 100644 index c73033543..000000000 --- a/jan/src/burn/drv/pre90s/d_mirax.cpp +++ /dev/null @@ -1,637 +0,0 @@ -// Mirax emu-layer for FB Alpha by dink, based on the MAME driver by Angelo Salese, Tomasz Slanina, Olivier Galibert. - -#include "tiles_generic.h" -#include "driver.h" -#include "z80_intf.h" -#include "bitswap.h" - -extern "C" { - #include "ay8910.h" -} -static INT16 *pAY8910Buffer[6]; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColorRAM; -static UINT8 *DrvSpriteRAM; -static UINT8 *DrvColorPROM; -static UINT8 *DrvCharGFX; -static UINT8 *DrvSpriteGFX; - -static UINT8 *nAyCtrl; -static UINT8 *nmi_mask; -static UINT8 *flipscreen_x; -static UINT8 *flipscreen_y; -static UINT8 *soundlatch; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDip[2] = { 0, 0 }; -static UINT8 DrvInput[5]; -static UINT8 DrvReset; - -static struct BurnInputInfo MiraxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 5, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 0, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 5, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 0, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Mirax) - - -static struct BurnDIPInfo MiraxDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x0c, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0f, 0x01, 0x03, 0x03, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0x03, 0x00, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x04, 0x00, "Upright" }, - {0x0f, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x30, "2" }, - {0x0f, 0x01, 0x30, 0x00, "3" }, - {0x0f, 0x01, 0x30, 0x10, "4" }, - {0x0f, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x10, 0x01, 0x01, 0x00, "30k 80k 150k" }, - {0x10, 0x01, 0x01, 0x01, "900k 950k 990k" }, - - {0 , 0xfe, 0 , 2, "Flags for Extra Life" }, - {0x10, 0x01, 0x02, 0x00, "5" }, - {0x10, 0x01, 0x02, 0x02, "8" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x10, 0x01, 0x08, 0x00, "No" }, - {0x10, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 2, "AutoPlay Mode (Debug)"}, - {0x10, 0x01, 0x10, 0x00, "No" }, - {0x10, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x10, 0x01, 0x20, 0x00, "Easy" }, - {0x10, 0x01, 0x20, 0x20, "Hard" }, -}; - -STDDIPINFO(Mirax) - -static void mirax_palette() -{ - for (INT32 i = 0; i < 0x40; i++) { - INT32 bit0, bit1, bit2, r, g, b; - - /* red component */ - bit0 = (DrvColorPROM[i] >> 0) & 0x01; - bit1 = (DrvColorPROM[i] >> 1) & 0x01; - bit2 = (DrvColorPROM[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* green component */ - bit0 = (DrvColorPROM[i] >> 3) & 0x01; - bit1 = (DrvColorPROM[i] >> 4) & 0x01; - bit2 = (DrvColorPROM[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* blue component */ - bit0 = (DrvColorPROM[i] >> 6) & 0x01; - bit1 = (DrvColorPROM[i] >> 7) & 0x01; - b = 0x4f * bit0 + 0xa8 * bit1; - - DrvPalette[i] = BurnHighCol(r, g, b, 0);; - } -} - -static void __fastcall main_write(UINT16 address, UINT8 data) -{ - if (address >= 0xea00 && address <= 0xea3f) { - DrvColorRAM[address - 0xea00] = data; - return; - } - - switch (address) - { - case 0xF501: *nmi_mask = data & 1; return; - case 0xF506: *flipscreen_x = data & 0x01; return; - case 0xF507: *flipscreen_y = data & 0x01; return; - case 0xF800: { - *soundlatch = data & 0xff; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - } - } -} - -static UINT8 __fastcall main_read(UINT16 address) -{ - if (address >= 0xea00 && address <= 0xea3f) - return DrvColorRAM[address - 0xea00]; - - switch (address) - { - case 0xF000: return DrvInput[0]; - case 0xF100: return DrvInput[1]; - case 0xF200: return DrvDip[0]; - case 0xF400: return DrvDip[1]; - } - - return 0; -} - -static void __fastcall audio_write(UINT16 address, UINT8 data) -{ - if (address >= 0xf900 && address <= 0xf9ff) { - *nAyCtrl = address - 0xf900; - return; - } - - switch (address) - { - case 0xE003: { - AY8910Write(0, 0, *nAyCtrl); - AY8910Write(0, 1, data); - return; - } - case 0xE403: { - AY8910Write(1, 0, *nAyCtrl); - AY8910Write(1, 1, data); - return; - } - } -} - -static UINT8 __fastcall audio_read(UINT16 address) -{ - switch (address) - { - case 0xA000: return *soundlatch; - } - - return 0; -} - - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - *nAyCtrl = 0x00; - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x10000; - DrvZ80ROM1 = Next; Next += 0x10000; - - DrvPalette = (UINT32*)Next; Next += 0x040 * sizeof(UINT32); - DrvCharGFX = Next; Next += 0x40000; - DrvSpriteGFX = Next; Next += 0x40000; - DrvColorPROM = Next; Next += 0x00400; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x01000; - DrvZ80RAM1 = Next; Next += 0x01000; - DrvVidRAM = Next; Next += 0x00400; - DrvColorRAM = Next; Next += 0x00400; - DrvSpriteRAM = Next; Next += 0x00300; - - nAyCtrl = Next; Next += 0x00001; - nmi_mask = Next; Next += 0x00001; - flipscreen_x = Next; Next += 0x00001; - flipscreen_y = Next; Next += 0x00001; - soundlatch = Next; Next += 0x00001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 c8PlaneOffsets[3] = { RGN_FRAC(0xc000, 2, 3), RGN_FRAC(0xc000, 1, 3), RGN_FRAC(0xc000, 0, 3) }; - INT32 c8XOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 c8YOffsets[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }; - - INT32 c16PlaneOffsets[3] = { RGN_FRAC(0x18000, 2, 3), RGN_FRAC(0x18000, 1, 3), RGN_FRAC(0x18000, 0, 3) }; - INT32 c16XOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7 , 0+8*8, 1+8*8, 2+8*8, 3+8*8, 4+8*8, 5+8*8, 6+8*8, 7+8*8 }; - INT32 c16YOffsets[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 0*8+8*8*2, 1*8+8*8*2, 2*8+8*8*2, 3*8+8*8*2, 4*8+8*8*2, 5*8+8*8*2, 6*8+8*8*2, 7*8+8*8*2 }; - - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { // Load ROMS parse GFX - UINT8 *DrvTempRom = (UINT8 *)BurnMalloc(0x40000); - memset(DrvTempRom, 0, 0x40000); - - { - if (BurnLoadRom(DrvTempRom + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x4000, 1, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x8000, 2, 1)) return 1; - - /* decrypt the program ROMs */ - UINT8 *DATA = DrvTempRom; - UINT8 *ROM = DrvZ80ROM; - - for(INT32 i=0x0000;i<0x4000;i++) - ROM[BITSWAP16(i, 15,14,13,12,11,10,9, 5,7,6,8, 4,3,2,1,0)] = (BITSWAP08(DATA[i], 1, 3, 7, 0, 5, 6, 4, 2) ^ 0xff); - - for(INT32 i=0x4000;i<0x8000;i++) - ROM[BITSWAP16(i, 15,14,13,12,11,10,9, 5,7,6,8, 4,3,2,1,0)] = (BITSWAP08(DATA[i], 2, 1, 0, 6, 7, 5, 3, 4) ^ 0xff); - - for(INT32 i=0x8000;i<0xc000;i++) - ROM[BITSWAP16(i, 15,14,13,12,11,10,9, 5,7,6,8, 4,3,2,1,0)] = (BITSWAP08(DATA[i], 1, 3, 7, 0, 5, 6, 4, 2) ^ 0xff); - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 3, 1)) return 1; - - // load & decode 8x8 tiles - memset(DrvTempRom, 0, 0x40000); - if (BurnLoadRom(DrvTempRom , 4, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x4000, 5, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x8000, 6, 1)) return 1; - GfxDecode(0x800, 3, 8, 8, c8PlaneOffsets, c8XOffsets, c8YOffsets, 0x40, DrvTempRom, DrvCharGFX); - - // load & decode 16x16 tiles - memset(DrvTempRom, 0, 0x40000); - if (BurnLoadRom(DrvTempRom + 0x04000, 7, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x0c000, 8, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x14000, 9, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x00000,10, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x08000,11, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x10000,12, 1)) return 1; - GfxDecode(0x400 /*((0x18000*8)/3)/(16*16))*/, 3, 16, 16, c16PlaneOffsets, c16XOffsets, c16YOffsets, 0x100, DrvTempRom, DrvSpriteGFX); - - if (BurnLoadRom(DrvColorPROM + 0x0000, 13, 1)) return 1; - if (BurnLoadRom(DrvColorPROM + 0x0020, 14, 1)) return 1; - } - BurnFree(DrvTempRom); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc800, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvSpriteRAM, 0xe800, 0xe9ff, MAP_RAM); - ZetSetWriteHandler(main_write); - ZetSetReadHandler(main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x8000, 0x8fff, MAP_RAM); - ZetSetWriteHandler(audio_write); - ZetSetReadHandler(audio_read); - ZetClose(); - - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - - return 0; -} - -void draw_tiles(UINT8 draw_flag) -{ - for (INT32 y = 0; y < 32; y++) { - for (INT32 x = 0; x < 32; x++) { - INT32 color = DrvColorRAM[(x*2)+1]; - INT32 code = DrvVidRAM[32*y+x] | ((color & 0xe0)<<3); - - INT32 sx = (x * 8); - if (sx < -7) sx += 256; - INT32 sy = (y * 8) - (DrvColorRAM[x*2] + 8); // + 8 offset for smoothe scroll. -dink - if (sy < -7) sy += 256; - - if (*flipscreen_x) sx = 248 - sx; - if (*flipscreen_y) sy = 248 - sy; - - if ((x <= 1 || x >= 30) ^ draw_flag) { - if (*flipscreen_y) { // we need a macro for this -dink - if (*flipscreen_x) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color & 7, 3, 0, 0x00, DrvCharGFX); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color & 7, 3, 0, 0x00, DrvCharGFX); - } - } else { - if (*flipscreen_x) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color & 7, 3, 0, 0x00, DrvCharGFX); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color & 7, 3, 0, 0x00, DrvCharGFX); - } - } - } - } - } -} - -static void RenderTileCPMP(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, INT32 offset, INT32 /*mode*/, UINT8 *gfxrom) -{ - UINT16 *dest = pTransDraw; - UINT8 *gfx = gfxrom; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 16 || sx + 16 >= nScreenWidth) continue; // blank out the top and bottom 16 pixels for status - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - if (!pxl) continue; // transparency - - dest[sy * nScreenWidth + sx] = pxl | (color << 3) | offset; - } - sx -= width; - } -} - -static void draw_sprites() -{ - for(INT32 count = 0; count < 0x200; count += 4) { - INT32 spr_offs, x, y, color, fx, fy; - - if(DrvSpriteRAM[count] == 0x00 || DrvSpriteRAM[count+3] == 0x00) - continue; - - spr_offs = (DrvSpriteRAM[count+1] & 0x3f); - color = DrvSpriteRAM[count+2] & 0x7; - fx = (*flipscreen_x) ^ ((DrvSpriteRAM[count+1] & 0x40) >> 6); //<- guess - fy = (*flipscreen_y) ^ ((DrvSpriteRAM[count+1] & 0x80) >> 7); - - spr_offs += (DrvSpriteRAM[count+2] & 0xe0)<<1; - spr_offs += (DrvSpriteRAM[count+2] & 0x10)<<5; - - y = (*flipscreen_y) ? DrvSpriteRAM[count] : 0x100 - DrvSpriteRAM[count] - 16; - x = (*flipscreen_x) ? 240 - DrvSpriteRAM[count+3] : DrvSpriteRAM[count+3]; - y -= 8; - - RenderTileCPMP(spr_offs, color, x, y, fx, fy, 16, 16, 0x000, 0, DrvSpriteGFX); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - mirax_palette(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 2) draw_tiles(1); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) draw_tiles(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvMakeInputs() -{ - // Reset Inputs (all active HIGH) - DrvInput[0] = 0; - DrvInput[1] = 0; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvMakeInputs(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal = 3000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - ZetRun(nCyclesTotal / nInterleave); - - if (i == 248 && *nmi_mask) - ZetNmi(); - - ZetClose(); - - ZetOpen(1); - ZetRun(nCyclesTotal / nInterleave); - - if (i % (nInterleave / 4) == (nInterleave / 4) - 1) - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - } - - return 0; -} - - -// Mirax (set 1) - -static struct BurnRomInfo miraxRomDesc[] = { - { "mxp5-42.rom", 0x4000, 0x716410a0, 1 | BRF_PRG | BRF_ESS }, // 0 main cpu - { "mxr5-4v.rom", 0x4000, 0xc9484fc3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mxs5-4v.rom", 0x4000, 0xe0085f91, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "mxr2-4v.rom", 0x2000, 0xcd2d52dc, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "mxe3-4v.rom", 0x4000, 0x0cede01f, 3 | BRF_GRA }, // 4 gfx1 - { "mxh3-4v.rom", 0x4000, 0x58221502, 3 | BRF_GRA }, // 5 - { "mxk3-4v.rom", 0x4000, 0x6dbc2961, 3 | BRF_GRA }, // 6 - - { "mxe2-4v.rom", 0x4000, 0x2cf5d8b7, 4 | BRF_GRA }, // 7 gfx2 - { "mxf2-4v.rom", 0x4000, 0x1f42c7fa, 4 | BRF_GRA }, // 8 - { "mxh2-4v.rom", 0x4000, 0xcbaff4c6, 4 | BRF_GRA }, // 9 - { "mxf3-4v.rom", 0x4000, 0x14b1ca85, 4 | BRF_GRA }, // 10 - { "mxi3-4v.rom", 0x4000, 0x20fb2099, 4 | BRF_GRA }, // 11 - { "mxl3-4v.rom", 0x4000, 0x918487aa, 4 | BRF_GRA }, // 12 - - { "mra3.prm", 0x0020, 0xae7e1a63, 5 | BRF_GRA }, // 13 proms - { "mrb3.prm", 0x0020, 0xe3f3d0f5, 5 | BRF_GRA }, // 14 - { "mirax.prm", 0x0020, 0x00000000, 5 | BRF_NODUMP }, // 15 -}; - -STD_ROM_PICK(mirax) -STD_ROM_FN(mirax) - -struct BurnDriver BurnDrvMirax = { - "mirax", NULL, NULL, NULL, "1985", - "Mirax (set 1)\0", NULL, "Current Technologies", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, miraxRomInfo, miraxRomName, NULL, NULL, MiraxInputInfo, MiraxDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 240, 256, 3, 4 -}; - - -// Mirax (set 2) - -static struct BurnRomInfo miraxaRomDesc[] = { - { "mx_p5_43v.p5", 0x4000, 0x87664903, 1 | BRF_PRG | BRF_ESS }, // 0 main cpu - { "mx_r5_43v.r5", 0x4000, 0x1ba4cd8e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mx_s5_43v.s5", 0x4000, 0xc58cc151, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "mxr2-4v.rom", 0x2000, 0xcd2d52dc, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "mxe3-4v.rom", 0x4000, 0x0cede01f, 3 | BRF_GRA }, // 4 gfx1 - { "mxh3-4v.rom", 0x4000, 0x58221502, 3 | BRF_GRA }, // 5 - { "mxk3-4v.rom", 0x4000, 0x6dbc2961, 3 | BRF_GRA }, // 6 - - { "mxe2-4v.rom", 0x4000, 0x2cf5d8b7, 4 | BRF_GRA }, // 7 gfx2 - { "mxf2-4v.rom", 0x4000, 0x1f42c7fa, 4 | BRF_GRA }, // 8 - { "mxh2-4v.rom", 0x4000, 0xcbaff4c6, 4 | BRF_GRA }, // 9 - { "mxf3-4v.rom", 0x4000, 0x14b1ca85, 4 | BRF_GRA }, // 10 - { "mxi3-4v.rom", 0x4000, 0x20fb2099, 4 | BRF_GRA }, // 11 - { "mxl3-4v.rom", 0x4000, 0x918487aa, 4 | BRF_GRA }, // 12 - - { "mra3.prm", 0x0020, 0xae7e1a63, 5 | BRF_GRA }, // 13 proms - { "mrb3.prm", 0x0020, 0xe3f3d0f5, 5 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(miraxa) -STD_ROM_FN(miraxa) - -struct BurnDriver BurnDrvMiraxa = { - "miraxa", "mirax", NULL, NULL, "1985", - "Mirax (set 2)\0", NULL, "Current Technologies", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, miraxaRomInfo, miraxaRomName, NULL, NULL, MiraxInputInfo, MiraxDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 240, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_mitchell.cpp b/jan/src/burn/drv/pre90s/d_mitchell.cpp deleted file mode 100644 index 21678ab41..000000000 --- a/jan/src/burn/drv/pre90s/d_mitchell.cpp +++ /dev/null @@ -1,3419 +0,0 @@ -// FB Alpha Mitchell driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "eeprom.h" -#include "burn_ym2413.h" -#include "msm6295.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort4[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort5[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort6[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort7[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort8[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort9[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort10[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort11[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[12] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvReset = 0; -static INT16 DrvDial1 = 0; -static INT16 DrvDial2 = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80Rom = NULL; -static UINT8 *DrvZ80Code = NULL; -static UINT8 *DrvZ80Rom2 = NULL; -static UINT8 *DrvSoundRom = NULL; -static UINT8 *DrvZ80Ram = NULL; -static UINT8 *DrvZ80Ram2 = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvAttrRam = NULL; -static UINT8 *DrvVideoRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static UINT8 DrvRomBank; -static UINT8 DrvPaletteRamBank; -static UINT8 DrvOkiBank; -static UINT8 DrvFlipScreen; -static UINT8 DrvVideoBank; -static UINT8 DrvInput5Toggle; -static UINT8 DrvPort5Kludge; -static INT32 DrvTileMask; -static UINT8 DrvHasEEPROM; -static INT32 DrvNumColours; -static INT32 DrvNVRamSize; -static INT32 DrvNVRamAddress; -static UINT8 DrvDialSelected; -static INT32 DrvDial[2]; -static UINT8 DrvSoundLatch; - -static UINT8 DrvInputType; -static INT32 DrvMahjongKeyMatrix; - -#define DRV_INPUT_TYPE_MAHJONG 1 -#define DRV_INPUT_TYPE_BLOCK 2 - -static struct BurnInputInfo MgakuenInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort7 + 2, "p2 start" }, - - {"P1 A" , BIT_DIGITAL , DrvInputPort1 + 7, "mah a" }, - {"P1 B" , BIT_DIGITAL , DrvInputPort2 + 7, "mah b" }, - {"P1 C" , BIT_DIGITAL , DrvInputPort4 + 7, "mah c" }, - {"P1 D" , BIT_DIGITAL , DrvInputPort5 + 7, "mah d" }, - {"P1 E" , BIT_DIGITAL , DrvInputPort1 + 6, "mah e" }, - {"P1 F" , BIT_DIGITAL , DrvInputPort2 + 6, "mah f" }, - {"P1 G" , BIT_DIGITAL , DrvInputPort4 + 6, "mah g" }, - {"P1 H" , BIT_DIGITAL , DrvInputPort5 + 6, "mah h" }, - {"P1 I" , BIT_DIGITAL , DrvInputPort1 + 5, "mah i" }, - {"P1 J" , BIT_DIGITAL , DrvInputPort2 + 5, "mah j" }, - {"P1 K" , BIT_DIGITAL , DrvInputPort4 + 5, "mah k" }, - {"P1 L" , BIT_DIGITAL , DrvInputPort5 + 5, "mah l" }, - {"P1 M" , BIT_DIGITAL , DrvInputPort1 + 4, "mah m" }, - {"P1 N" , BIT_DIGITAL , DrvInputPort2 + 4, "mah n" }, - {"P1 Pon" , BIT_DIGITAL , DrvInputPort5 + 4, "mah pon" }, - {"P1 Chi" , BIT_DIGITAL , DrvInputPort4 + 4, "mah chi" }, - {"P1 Kan" , BIT_DIGITAL , DrvInputPort1 + 3, "mah kan" }, - {"P1 Ron" , BIT_DIGITAL , DrvInputPort4 + 3, "mah ron" }, - {"P1 Reach" , BIT_DIGITAL , DrvInputPort2 + 3, "mah reach" }, - {"P1 Flip Flop" , BIT_DIGITAL , DrvInputPort6 + 4, "mah ff" }, - - {"P2 A" , BIT_DIGITAL , DrvInputPort7 + 7, "mah a" }, - {"P2 B" , BIT_DIGITAL , DrvInputPort8 + 7, "mah b" }, - {"P2 C" , BIT_DIGITAL , DrvInputPort9 + 7, "mah c" }, - {"P2 D" , BIT_DIGITAL , DrvInputPort10 + 7, "mah d" }, - {"P2 E" , BIT_DIGITAL , DrvInputPort7 + 6, "mah e" }, - {"P2 F" , BIT_DIGITAL , DrvInputPort8 + 6, "mah f" }, - {"P2 G" , BIT_DIGITAL , DrvInputPort9 + 6, "mah g" }, - {"P2 H" , BIT_DIGITAL , DrvInputPort10 + 6, "mah h" }, - {"P2 I" , BIT_DIGITAL , DrvInputPort7 + 5, "mah i" }, - {"P2 J" , BIT_DIGITAL , DrvInputPort8 + 5, "mah j" }, - {"P2 K" , BIT_DIGITAL , DrvInputPort9 + 5, "mah k" }, - {"P2 L" , BIT_DIGITAL , DrvInputPort10 + 5, "mah l" }, - {"P2 M" , BIT_DIGITAL , DrvInputPort7 + 4, "mah m" }, - {"P2 N" , BIT_DIGITAL , DrvInputPort2 + 4, "mah n" }, - {"P2 Pon" , BIT_DIGITAL , DrvInputPort10 + 4, "mah pon" }, - {"P2 Chi" , BIT_DIGITAL , DrvInputPort9 + 4, "mah chi" }, - {"P2 Kan" , BIT_DIGITAL , DrvInputPort7 + 3, "mah kan" }, - {"P2 Ron" , BIT_DIGITAL , DrvInputPort9 + 3, "mah ron" }, - {"P2 Reach" , BIT_DIGITAL , DrvInputPort8 + 3, "mah reach" }, - {"P2 Flip Flop" , BIT_DIGITAL , DrvInputPort11 + 4, "mah ff" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Mgakuen) - -static struct BurnInputInfo MarukinInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort7 + 2, "p2 start" }, - - {"P1 A" , BIT_DIGITAL , DrvInputPort1 + 7, "mah a" }, - {"P1 B" , BIT_DIGITAL , DrvInputPort2 + 7, "mah b" }, - {"P1 C" , BIT_DIGITAL , DrvInputPort4 + 7, "mah c" }, - {"P1 D" , BIT_DIGITAL , DrvInputPort5 + 7, "mah d" }, - {"P1 E" , BIT_DIGITAL , DrvInputPort1 + 6, "mah e" }, - {"P1 F" , BIT_DIGITAL , DrvInputPort2 + 6, "mah f" }, - {"P1 G" , BIT_DIGITAL , DrvInputPort4 + 6, "mah g" }, - {"P1 H" , BIT_DIGITAL , DrvInputPort5 + 6, "mah h" }, - {"P1 I" , BIT_DIGITAL , DrvInputPort1 + 5, "mah i" }, - {"P1 J" , BIT_DIGITAL , DrvInputPort2 + 5, "mah j" }, - {"P1 K" , BIT_DIGITAL , DrvInputPort4 + 5, "mah k" }, - {"P1 L" , BIT_DIGITAL , DrvInputPort5 + 5, "mah l" }, - {"P1 M" , BIT_DIGITAL , DrvInputPort1 + 4, "mah m" }, - {"P1 N" , BIT_DIGITAL , DrvInputPort2 + 4, "mah n" }, - {"P1 Pon" , BIT_DIGITAL , DrvInputPort5 + 4, "mah pon" }, - {"P1 Chi" , BIT_DIGITAL , DrvInputPort4 + 4, "mah chi" }, - {"P1 Kan" , BIT_DIGITAL , DrvInputPort1 + 3, "mah kan" }, - {"P1 Ron" , BIT_DIGITAL , DrvInputPort4 + 3, "mah ron" }, - {"P1 Reach" , BIT_DIGITAL , DrvInputPort2 + 3, "mah reach" }, - {"P1 Flip Flop" , BIT_DIGITAL , DrvInputPort6 + 4, "mah ff" }, - - {"P2 A" , BIT_DIGITAL , DrvInputPort7 + 7, "mah a" }, - {"P2 B" , BIT_DIGITAL , DrvInputPort8 + 7, "mah b" }, - {"P2 C" , BIT_DIGITAL , DrvInputPort9 + 7, "mah c" }, - {"P2 D" , BIT_DIGITAL , DrvInputPort10 + 7, "mah d" }, - {"P2 E" , BIT_DIGITAL , DrvInputPort7 + 6, "mah e" }, - {"P2 F" , BIT_DIGITAL , DrvInputPort8 + 6, "mah f" }, - {"P2 G" , BIT_DIGITAL , DrvInputPort9 + 6, "mah g" }, - {"P2 H" , BIT_DIGITAL , DrvInputPort10 + 6, "mah h" }, - {"P2 I" , BIT_DIGITAL , DrvInputPort7 + 5, "mah i" }, - {"P2 J" , BIT_DIGITAL , DrvInputPort8 + 5, "mah j" }, - {"P2 K" , BIT_DIGITAL , DrvInputPort9 + 5, "mah k" }, - {"P2 L" , BIT_DIGITAL , DrvInputPort10 + 5, "mah l" }, - {"P2 M" , BIT_DIGITAL , DrvInputPort7 + 4, "mah m" }, - {"P2 N" , BIT_DIGITAL , DrvInputPort2 + 4, "mah n" }, - {"P2 Pon" , BIT_DIGITAL , DrvInputPort10 + 4, "mah pon" }, - {"P2 Chi" , BIT_DIGITAL , DrvInputPort9 + 4, "mah chi" }, - {"P2 Kan" , BIT_DIGITAL , DrvInputPort7 + 3, "mah kan" }, - {"P2 Ron" , BIT_DIGITAL , DrvInputPort9 + 3, "mah ron" }, - {"P2 Reach" , BIT_DIGITAL , DrvInputPort8 + 3, "mah reach" }, - {"P2 Flip Flop" , BIT_DIGITAL , DrvInputPort11 + 4, "mah ff" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort3 + 1, "diag" }, -}; - -STDINPUTINFO(Marukin) - -static struct BurnInputInfo PkladiesInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort7 + 2, "p2 start" }, - - {"P1 A" , BIT_DIGITAL , DrvInputPort1 + 7, "mah a" }, - {"P1 B" , BIT_DIGITAL , DrvInputPort2 + 7, "mah b" }, - {"P1 C" , BIT_DIGITAL , DrvInputPort4 + 7, "mah c" }, - {"P1 D" , BIT_DIGITAL , DrvInputPort5 + 7, "mah d" }, - {"P1 E" , BIT_DIGITAL , DrvInputPort1 + 6, "mah e" }, - {"P1 Deal" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 1" }, - {"P1 Cancel" , BIT_DIGITAL , DrvInputPort2 + 5, "p1 fire 2" }, - {"P1 Flip" , BIT_DIGITAL , DrvInputPort4 + 5, "p1 fire 3" }, - - {"P2 A" , BIT_DIGITAL , DrvInputPort7 + 7, "mah a" }, - {"P2 B" , BIT_DIGITAL , DrvInputPort8 + 7, "mah b" }, - {"P2 C" , BIT_DIGITAL , DrvInputPort9 + 7, "mah c" }, - {"P2 D" , BIT_DIGITAL , DrvInputPort10 + 7, "mah d" }, - {"P2 E" , BIT_DIGITAL , DrvInputPort7 + 6, "mah e" }, - {"P2 Deal" , BIT_DIGITAL , DrvInputPort7 + 5, "p2 fire 1" }, - {"P2 Cancel" , BIT_DIGITAL , DrvInputPort8 + 5, "p2 fire 2" }, - {"P2 Flip" , BIT_DIGITAL , DrvInputPort9 + 5, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 0, "service" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort3 + 1, "diag" }, -}; - -STDINPUTINFO(Pkladies) - -static struct BurnInputInfo PangInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 6, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 6, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 6, "service" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort3 + 1, "diag" }, -}; - -STDINPUTINFO(Pang) - -static struct BurnInputInfo Qtono1InputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 start" }, - - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 6, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 4" }, - - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 6, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 4" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 6, "service" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort3 + 1, "diag" }, -}; - -STDINPUTINFO(Qtono1) - -static struct BurnInputInfo MstworldInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 6, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 6, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 6, "service" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort3 + 1, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, -}; - -STDINPUTINFO(Mstworld) - -static struct BurnInputInfo BlockInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , DrvInputPort11 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort11 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 fire 1" }, - - {"P2 Left" , BIT_DIGITAL , DrvInputPort11 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort11 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 6, "service" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort3 + 1, "diag" }, -}; - -STDINPUTINFO(Block) - -static struct BurnInputInfo BlockjoyInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 fire 1" }, - - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 6, "service" }, - {"Diagnostics" , BIT_DIGITAL , DrvInputPort3 + 1, "diag" }, -}; - -STDINPUTINFO(Blockjoy) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x30) == 0x30) { - *nJoystickInputs &= ~0x30; - } - if ((*nJoystickInputs & 0xc0) == 0xc0) { - *nJoystickInputs &= ~0xc0; - } -} - -static inline void DrvMakeInputs() -{ - for (INT32 i = 0; i < 12; i++) DrvInput[i] = 0x00; - - for (INT32 i = 0; i < 8; i++) { - DrvInput[ 0] |= (DrvInputPort0[ i] & 1) << i; - DrvInput[ 1] |= (DrvInputPort1[ i] & 1) << i; - DrvInput[ 2] |= (DrvInputPort2[ i] & 1) << i; - DrvInput[ 3] |= (DrvInputPort3[ i] & 1) << i; - DrvInput[ 4] |= (DrvInputPort4[ i] & 1) << i; - DrvInput[ 5] |= (DrvInputPort5[ i] & 1) << i; - DrvInput[ 6] |= (DrvInputPort6[ i] & 1) << i; - DrvInput[ 7] |= (DrvInputPort7[ i] & 1) << i; - DrvInput[ 8] |= (DrvInputPort8[ i] & 1) << i; - DrvInput[ 9] |= (DrvInputPort9[ i] & 1) << i; - DrvInput[10] |= (DrvInputPort10[i] & 1) << i; - DrvInput[11] |= (DrvInputPort11[i] & 1) << i; - } - - if (DrvInputType == DRV_INPUT_TYPE_BLOCK) { - if (DrvInputPort11[0]) DrvDial1 -= 0x04; - if (DrvInputPort11[1]) DrvDial1 += 0x04; - if (DrvDial1 >= 0x100) DrvDial1 = 0; - if (DrvDial1 < 0) DrvDial1 = 0xfc; - - if (DrvInputPort11[2]) DrvDial2 -= 0x04; - if (DrvInputPort11[3]) DrvDial2 += 0x04; - if (DrvDial2 >= 0x100) DrvDial2 = 0; - if (DrvDial2 < 0) DrvDial2 = 0xfc; - } else { - if (DrvInputType != DRV_INPUT_TYPE_MAHJONG) { - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); - } - } -} - -static struct BurnDIPInfo MgakuenDIPList[]= -{ - // Default Values - {0x2c, 0xff, 0xff, 0xef, NULL }, - {0x2d, 0xff, 0xff, 0x8f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x2c, 0x01, 0x07, 0x00, "4 Coins 1 Play" }, - {0x2c, 0x01, 0x07, 0x01, "3 Coins 1 Play" }, - {0x2c, 0x01, 0x07, 0x02, "2 Coins 1 Play" }, - {0x2c, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x2c, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x2c, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x2c, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - {0x2c, 0x01, 0x07, 0x03, "1 Coin 6 Plays" }, - - {0 , 0xfe, 0 , 2 , "Rules" }, - {0x2c, 0x01, 0x08, 0x08, "Kantou" }, - {0x2c, 0x01, 0x08, 0x00, "Kansai" }, - - {0 , 0xfe, 0 , 2 , "Harness Type" }, - {0x2c, 0x01, 0x10, 0x10, "Generic" }, - {0x2c, 0x01, 0x10, 0x00, "Royal Mahjong" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x2c, 0x01, 0x20, 0x20, "Off" }, - {0x2c, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x2c, 0x01, 0x40, 0x40, "Off" }, - {0x2c, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x2c, 0x01, 0x80, 0x80, "Off" }, - {0x2c, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Player 1 Skill" }, - {0x2d, 0x01, 0x03, 0x03, "Weak" }, - {0x2d, 0x01, 0x03, 0x02, "Normal" }, - {0x2d, 0x01, 0x03, 0x01, "Strong" }, - {0x2d, 0x01, 0x03, 0x00, "Very Strong" }, - - {0 , 0xfe, 0 , 4 , "Player 2 Skill" }, - {0x2d, 0x01, 0x0c, 0x0c, "Weak" }, - {0x2d, 0x01, 0x0c, 0x08, "Normal" }, - {0x2d, 0x01, 0x0c, 0x04, "Strong" }, - {0x2d, 0x01, 0x0c, 0x00, "Very Strong" }, - - {0 , 0xfe, 0 , 2 , "Music" }, - {0x2d, 0x01, 0x10, 0x10, "Off" }, - {0x2d, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x2d, 0x01, 0x20, 0x20, "Off" }, - {0x2d, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Help Mode" }, - {0x2d, 0x01, 0x40, 0x40, "Off" }, - {0x2d, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Mgakuen) - -static struct BurnDIPInfo MstworldDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xb0, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x15, 0x01, 0x07, 0x03, "A 1C/4P B 1C/4P" }, - {0x15, 0x01, 0x07, 0x02, "A 1C/3P B 1C/3P" }, - {0x15, 0x01, 0x07, 0x01, "A 1C/2P B 1C/2P" }, - {0x15, 0x01, 0x07, 0x00, "A 1C/1P B 1C/4P" }, - {0x15, 0x01, 0x07, 0x04, "A 2C/1P B 1C/2P" }, - {0x15, 0x01, 0x07, 0x05, "A 2C/1P B 1C/3P" }, - {0x15, 0x01, 0x07, 0x06, "A 3C/1P B 1C/2P" }, - {0x15, 0x01, 0x07, 0x07, "A 4C/1P B 1C/1P" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x18, 0x00, "1" }, - {0x15, 0x01, 0x18, 0x08, "2" }, - {0x15, 0x01, 0x18, 0x10, "3" }, - {0x15, 0x01, 0x18, 0x18, "4" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x60, 0x00, "Easy" }, - {0x15, 0x01, 0x60, 0x20, "Normal" }, - {0x15, 0x01, 0x60, 0x40, "Hard" }, - {0x15, 0x01, 0x60, 0x60, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Mstworld) - -static struct BurnRomInfo MgakuenRomDesc[] = { - { "mg-1.1j", 0x08000, 0xbf02ea6b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "mg-2.1l", 0x20000, 0x64141b0c, BRF_ESS | BRF_PRG }, // 1 - - { "mg-1.13h", 0x80000, 0xfd6a0805, BRF_GRA }, // 2 Characters - { "mg-2.14h", 0x80000, 0xe26e871e, BRF_GRA }, // 3 - { "mg-3.16h", 0x80000, 0xdd781d9a, BRF_GRA }, // 4 - { "mg-4.17h", 0x80000, 0x97afcc79, BRF_GRA }, // 5 - - { "mg-6.4l", 0x20000, 0x34594e62, BRF_GRA }, // 6 Sprites - { "mg-7.6l", 0x20000, 0xf304c806, BRF_GRA }, // 7 - - { "mg-5.1c", 0x80000, 0x170332f1, BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(Mgakuen) -STD_ROM_FN(Mgakuen) - -static struct BurnRomInfo SeventoitsuRomDesc[] = { - { "mc01.1j", 0x08000, 0x0bebe45f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "mc02.1l", 0x20000, 0x375378b0, BRF_ESS | BRF_PRG }, // 1 - - { "mg-1.13h", 0x80000, 0xfd6a0805, BRF_GRA }, // 2 Characters - { "mg-2.14h", 0x80000, 0xe26e871e, BRF_GRA }, // 3 - { "mg-3.16h", 0x80000, 0xdd781d9a, BRF_GRA }, // 4 - { "mg-4.17h", 0x80000, 0x97afcc79, BRF_GRA }, // 5 - - { "mc06.4l", 0x20000, 0x0ef83926, BRF_GRA }, // 6 Sprites - { "mc07.6l", 0x20000, 0x59f9ffb1, BRF_GRA }, // 7 - - { "mg-5.1c", 0x80000, 0x170332f1, BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(Seventoitsu) -STD_ROM_FN(Seventoitsu) - -static struct BurnRomInfo Mgakuen2RomDesc[] = { - { "mg2-xf.1j", 0x08000, 0xc8165d2d, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "mg2-y.1l", 0x20000, 0x75bbcc14, BRF_ESS | BRF_PRG }, // 1 - { "mg2-z.3l", 0x20000, 0xbfdba961, BRF_ESS | BRF_PRG }, // 2 - - { "mg2-a.13h", 0x80000, 0x31a0c55e, BRF_GRA }, // 3 Characters - { "mg2-b.14h", 0x80000, 0xc18488fa, BRF_GRA }, // 4 - { "mg2-c.16h", 0x80000, 0x9425b364, BRF_GRA }, // 5 - { "mg2-d.17h", 0x80000, 0x6cc9eeba, BRF_GRA }, // 6 - - { "mg2-f.4l", 0x20000, 0x3172c9fe, BRF_GRA }, // 7 Sprites - { "mg2-g.6l", 0x20000, 0x19b8b61c, BRF_GRA }, // 8 - - { "mg2-e.1c", 0x80000, 0x70fd0809, BRF_SND }, // 9 Samples -}; - -STD_ROM_PICK(Mgakuen2) -STD_ROM_FN(Mgakuen2) - -static struct BurnRomInfo PkladiesRomDesc[] = { - { "pko-prg1.14f", 0x08000, 0x86585a94, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "pko-prg2.15f", 0x10000, 0x86cbe82d, BRF_ESS | BRF_PRG }, // 1 - - { "pko-001.8h", 0x80000, 0x1ead5d9b, BRF_GRA }, // 2 Characters - { "pko-003.8j", 0x80000, 0x339ab4e6, BRF_GRA }, // 3 - { "pko-002.9h", 0x80000, 0x1cf02586, BRF_GRA }, // 4 - { "pko-004.9j", 0x80000, 0x09ccb442, BRF_GRA }, // 5 - - { "pko-chr1.2j", 0x20000, 0x31ce33cd, BRF_GRA }, // 6 Sprites - { "pko-chr2.3j", 0x20000, 0xad7e055f, BRF_GRA }, // 7 - - { "pko-voi1.2d", 0x20000, 0x07e0f531, BRF_SND }, // 8 Samples - { "pko-voi2.3d", 0x20000, 0x18398bf6, BRF_SND }, // 9 -}; - -STD_ROM_PICK(Pkladies) -STD_ROM_FN(Pkladies) - -static struct BurnRomInfo PkladieslRomDesc[] = { - { "pk05.14f", 0x08000, 0xea1740a6, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "pk06.15f", 0x20000, 0x3078ff5e, BRF_ESS | BRF_PRG }, // 1 - - { "pko-001.8h", 0x80000, 0x1ead5d9b, BRF_GRA }, // 2 Characters - { "pko-003.8j", 0x80000, 0x339ab4e6, BRF_GRA }, // 3 - { "pko-002.9h", 0x80000, 0x1cf02586, BRF_GRA }, // 4 - { "pko-004.9j", 0x80000, 0x09ccb442, BRF_GRA }, // 5 - - { "pko-chr1.2j", 0x20000, 0x31ce33cd, BRF_GRA }, // 6 Sprites - { "pko-chr2.3j", 0x20000, 0xad7e055f, BRF_GRA }, // 7 - - { "pko-voi1.2d", 0x20000, 0x07e0f531, BRF_SND }, // 8 Samples - { "pko-voi2.3d", 0x20000, 0x18398bf6, BRF_SND }, // 9 -}; - -STD_ROM_PICK(Pkladiesl) -STD_ROM_FN(Pkladiesl) - -static struct BurnRomInfo PkladieslaRomDesc[] = { - { "05.14f", 0x08000, 0xfa18e16a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "06.15f", 0x10000, 0xa2fb7646, BRF_ESS | BRF_PRG }, // 1 - - { "pko-001.8h", 0x80000, 0x1ead5d9b, BRF_GRA }, // 2 Characters - { "pko-003.8j", 0x80000, 0x339ab4e6, BRF_GRA }, // 3 - { "pko-002.9h", 0x80000, 0x1cf02586, BRF_GRA }, // 4 - { "pko-004.9j", 0x80000, 0x09ccb442, BRF_GRA }, // 5 - - { "pko-chr1.2j", 0x20000, 0x31ce33cd, BRF_GRA }, // 6 Sprites - { "pko-chr2.3j", 0x20000, 0xad7e055f, BRF_GRA }, // 7 - - { "pko-voi1.2d", 0x20000, 0x07e0f531, BRF_SND }, // 8 Samples - { "pko-voi2.3d", 0x20000, 0x18398bf6, BRF_SND }, // 9 -}; - -STD_ROM_PICK(Pkladiesla) -STD_ROM_FN(Pkladiesla) - -static struct BurnRomInfo DokabenRomDesc[] = { - { "db06.11h", 0x08000, 0x413e0886, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "db07.13h", 0x20000, 0x8bdcf49e, BRF_ESS | BRF_PRG }, // 1 - { "db08.14h", 0x20000, 0x1643bdd9, BRF_ESS | BRF_PRG }, // 2 - - { "db02.1e", 0x20000, 0x9aa8470c, BRF_GRA }, // 3 Characters - { "db03.2e", 0x20000, 0x3324e43d, BRF_GRA }, // 4 - { "db04.1g", 0x20000, 0xc0c5b6c2, BRF_GRA }, // 5 - { "db05.2g", 0x20000, 0xd2ab25f2, BRF_GRA }, // 6 - - { "db10.2k", 0x20000, 0x9e70f7ae, BRF_GRA }, // 7 Sprites - { "db09.1k", 0x20000, 0x2d9263f7, BRF_GRA }, // 8 - - { "db01.1d", 0x20000, 0x62fa6b81, BRF_SND }, // 9 Samples -}; - -STD_ROM_PICK(Dokaben) -STD_ROM_FN(Dokaben) - -static struct BurnRomInfo PangRomDesc[] = { - { "pwe_06.11h", 0x08000, 0x68be52cd, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "pwe_07.13h", 0x20000, 0x4a2e70f6, BRF_ESS | BRF_PRG }, // 1 - - { "pwe_02.1e", 0x20000, 0x3a5883f5, BRF_GRA }, // 2 Characters - { "pw_03.2e", 0x20000, 0x79a8ed08, BRF_GRA }, // 3 - { "pwe_04.1g", 0x20000, 0x166a16ae, BRF_GRA }, // 4 - { "pw_05.2g", 0x20000, 0x2fb3db6c, BRF_GRA }, // 5 - - { "pw_10.2k", 0x20000, 0xfdba4f6e, BRF_GRA }, // 6 Sprites - { "pw_9.1k", 0x20000, 0x39f47a63, BRF_GRA }, // 7 - - { "pw_01.1d", 0x20000, 0xc52e5b8e, BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(Pang) -STD_ROM_FN(Pang) - -static struct BurnRomInfo BbrosRomDesc[] = { - { "pwu_06.11h", 0x08000, 0xa3041ca4, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "pwu_07.13h", 0x20000, 0x09231c68, BRF_ESS | BRF_PRG }, // 1 - - { "pwu_02.1e", 0x20000, 0x62f29992, BRF_GRA }, // 2 Characters - { "pw_03.2e", 0x20000, 0x79a8ed08, BRF_GRA }, // 3 - { "pwu_04.1g", 0x20000, 0xf705aa89, BRF_GRA }, // 4 - { "pw_05.2g", 0x20000, 0x2fb3db6c, BRF_GRA }, // 5 - - { "pw_10.2k", 0x20000, 0xfdba4f6e, BRF_GRA }, // 6 Sprites - { "pw_9.1k", 0x20000, 0x39f47a63, BRF_GRA }, // 7 - - { "pw_01.1d", 0x20000, 0xc52e5b8e, BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(Bbros) -STD_ROM_FN(Bbros) - -static struct BurnRomInfo PompingwRomDesc[] = { - { "pwj_06.11h", 0x08000, 0x4a0a6426, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "pwj_07.13h", 0x20000, 0xa9402420, BRF_ESS | BRF_PRG }, // 1 - - { "pw_02.1e", 0x20000, 0x4b5992e4, BRF_GRA }, // 2 Characters - { "pw_03.2e", 0x20000, 0x79a8ed08, BRF_GRA }, // 3 - { "pwj_04.1g", 0x20000, 0x01e49081, BRF_GRA }, // 4 - { "pw_05.2g", 0x20000, 0x2fb3db6c, BRF_GRA }, // 5 - - { "pw_10.2k", 0x20000, 0xfdba4f6e, BRF_GRA }, // 6 Sprites - { "pw_9.1k", 0x20000, 0x39f47a63, BRF_GRA }, // 7 - - { "pw_01.1d", 0x20000, 0xc52e5b8e, BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(Pompingw) -STD_ROM_FN(Pompingw) - -static struct BurnRomInfo PangbRomDesc[] = { - { "pang_04.bin", 0x10000, 0xf68f88a5, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "pang_02.bin", 0x20000, 0x3f15bb61, BRF_ESS | BRF_PRG }, // 1 - { "pang_03.bin", 0x20000, 0x0c8477ae, BRF_ESS | BRF_PRG }, // 2 - - { "pang_9.bin", 0x20000, 0x3a5883f5, BRF_GRA }, // 3 Characters - { "bb3.bin", 0x20000, 0x79a8ed08, BRF_GRA }, // 4 - { "bb11.bin", 0x20000, 0x166a16ae, BRF_GRA }, // 5 - { "bb5.bin", 0x20000, 0x2fb3db6c, BRF_GRA }, // 6 - - { "bb10.bin", 0x20000, 0xfdba4f6e, BRF_GRA }, // 7 Sprites - { "bb9.bin", 0x20000, 0x39f47a63, BRF_GRA }, // 8 - - { "bb1.bin", 0x20000, 0xc52e5b8e, BRF_SND }, // 9 Samples -}; - -STD_ROM_PICK(Pangb) -STD_ROM_FN(Pangb) - -static struct BurnRomInfo PangboldRomDesc[] = { - { "4.6l", 0x10000, 0xf68f88a5, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "2.3l", 0x20000, 0x3f15bb61, BRF_ESS | BRF_PRG }, // 1 - { "3.5l", 0x20000, 0xce6375e4, BRF_ESS | BRF_PRG }, // 2 - - { "9.10o", 0x20000, 0x3a5883f5, BRF_GRA }, // 3 Characters - { "10.14o", 0x20000, 0x79a8ed08, BRF_GRA }, // 4 - { "11.17j", 0x20000, 0x166a16ae, BRF_GRA }, // 5 - { "12.20j", 0x20000, 0x2fb3db6c, BRF_GRA }, // 6 - - { "8.7o", 0x10000, 0xf3188aa1, BRF_GRA }, // 7 Sprites - { "7.5o", 0x10000, 0x011da14b, BRF_GRA }, // 8 - { "6.3o", 0x10000, 0x0e25e797, BRF_GRA }, // 9 - { "5.1o", 0x10000, 0x6daa4e27, BRF_GRA }, // 10 - - { "1.1a", 0x10000, 0xb6463907, BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(Pangbold) -STD_ROM_FN(Pangbold) - -static struct BurnRomInfo Pangbold2RomDesc[] = { - // f205v id 1294 - { "4.bin", 0x10000, 0x4ef5908b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "2.l3", 0x20000, 0x3f15bb61, BRF_ESS | BRF_PRG }, // 1 - { "3.bin", 0x20000, 0x19c4c0fb, BRF_ESS | BRF_PRG }, // 2 - - { "9.o10", 0x20000, 0x3a5883f5, BRF_GRA }, // 3 Characters - { "10.o13", 0x20000, 0x79a8ed08, BRF_GRA }, // 4 - { "11.j17", 0x20000, 0x166a16ae, BRF_GRA }, // 5 - { "12.j20", 0x20000, 0x2fb3db6c, BRF_GRA }, // 6 - - { "8.o7", 0x10000, 0xf3188aa1, BRF_GRA }, // 7 Sprites - { "7.o5", 0x10000, 0x011da14b, BRF_GRA }, // 8 - { "6.o3", 0x10000, 0x0e25e797, BRF_GRA }, // 9 - { "5.o2", 0x10000, 0x6daa4e27, BRF_GRA }, // 10 - - { "1.bin", 0x10000, 0xd7ecf849, BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(Pangbold2) -STD_ROM_FN(Pangbold2) - -static struct BurnRomInfo Pangbold3RomDesc[] = { - { "4.l6", 0x10000, 0xf5e6e2fa, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "2.l3", 0x20000, 0x3f15bb61, BRF_ESS | BRF_PRG }, // 1 - { "3.l5", 0x20000, 0xce6375e4, BRF_ESS | BRF_PRG }, // 2 - - { "9.o10", 0x20000, 0x3a5883f5, BRF_GRA }, // 3 Characters - { "10.o13", 0x20000, 0x79a8ed08, BRF_GRA }, // 4 - { "11.j17", 0x20000, 0x166a16ae, BRF_GRA }, // 5 - { "12.j20", 0x20000, 0x2fb3db6c, BRF_GRA }, // 6 - - { "8.o7", 0x10000, 0xf3188aa1, BRF_GRA }, // 7 Sprites - { "7.o5", 0x10000, 0x011da14b, BRF_GRA }, // 8 - { "6.o3", 0x10000, 0x0e25e797, BRF_GRA }, // 9 - { "5.o2", 0x10000, 0x6daa4e27, BRF_GRA }, // 10 - - { "1.a1", 0x10000, 0xb6463907, BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(Pangbold3) -STD_ROM_FN(Pangbold3) - -static struct BurnRomInfo Pangb2RomDesc[] = { - { "27c512.11h", 0x10000, 0x369a453e, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "27c020.13h", 0x40000, 0x5e7f24b1, BRF_ESS | BRF_PRG }, // 1 - - { "pang_9.bin", 0x20000, 0x3a5883f5, BRF_GRA }, // 2 Characters - { "bb3.bin", 0x20000, 0x79a8ed08, BRF_GRA }, // 3 - { "bb11.bin", 0x20000, 0x166a16ae, BRF_GRA }, // 4 - { "bb5.bin", 0x20000, 0x2fb3db6c, BRF_GRA }, // 5 - - { "bb10.bin", 0x20000, 0xfdba4f6e, BRF_GRA }, // 6 Sprites - { "bb9.bin", 0x20000, 0x39f47a63, BRF_GRA }, // 7 - - { "bb1.bin", 0x20000, 0xc52e5b8e, BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(Pangb2) -STD_ROM_FN(Pangb2) - -static struct BurnRomInfo CworldRomDesc[] = { - { "cw05.bin", 0x08000, 0xd3c1723d, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "cw06.bin", 0x20000, 0xd71ed4a3, BRF_ESS | BRF_PRG }, // 1 - { "cw07.bin", 0x20000, 0xd419ce08, BRF_ESS | BRF_PRG }, // 2 - - { "cw08.bin", 0x20000, 0x6c80da3c, BRF_GRA }, // 3 Characters - { "cw09.bin", 0x20000, 0x7607da71, BRF_GRA }, // 4 - { "cw10.bin", 0x20000, 0x6f0e639f, BRF_GRA }, // 5 - { "cw11.bin", 0x20000, 0x130bd7c0, BRF_GRA }, // 6 - { "cw18.bin", 0x20000, 0xbe6ee0c9, BRF_GRA }, // 7 - { "cw19.bin", 0x20000, 0x51fc5532, BRF_GRA }, // 8 - { "cw20.bin", 0x20000, 0x58381d58, BRF_GRA }, // 9 - { "cw21.bin", 0x20000, 0x910cc753, BRF_GRA }, // 10 - - { "cw16.bin", 0x20000, 0xf90217d1, BRF_GRA }, // 11 Sprites - { "cw17.bin", 0x20000, 0xc953c702, BRF_GRA }, // 12 - - { "cw01.bin", 0x20000, 0xf4368f5b, BRF_SND }, // 13 Samples -}; - -STD_ROM_PICK(Cworld) -STD_ROM_FN(Cworld) - -static struct BurnRomInfo HatenaRomDesc[] = { - { "q2-05.rom", 0x08000, 0x66c9e1da, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "q2-06.rom", 0x20000, 0x5fc39916, BRF_ESS | BRF_PRG }, // 1 - { "q2-07.rom", 0x20000, 0xec6d5e5e, BRF_ESS | BRF_PRG }, // 2 - - { "q2-08.rom", 0x20000, 0x6c80da3c, BRF_GRA }, // 3 Characters - { "q2-09.rom", 0x20000, 0xabe3e15c, BRF_GRA }, // 4 - { "q2-10.rom", 0x20000, 0x6963450d, BRF_GRA }, // 5 - { "q2-11.rom", 0x20000, 0x1e319fa2, BRF_GRA }, // 6 - { "q2-18.rom", 0x20000, 0xbe6ee0c9, BRF_GRA }, // 7 - { "q2-19.rom", 0x20000, 0x70300445, BRF_GRA }, // 8 - { "q2-20.rom", 0x20000, 0x21a6ff42, BRF_GRA }, // 9 - { "q2-21.rom", 0x20000, 0x076280c9, BRF_GRA }, // 10 - - { "q2-16.rom", 0x20000, 0xec19b2f0, BRF_GRA }, // 11 Sprites - { "q2-17.rom", 0x20000, 0xecd69d92, BRF_GRA }, // 12 - - { "q2-01.rom", 0x20000, 0x149e7a89, BRF_SND }, // 13 Samples -}; - -STD_ROM_PICK(Hatena) -STD_ROM_FN(Hatena) - -static struct BurnRomInfo SpangRomDesc[] = { - { "spe_06.11h", 0x08000, 0x1af106fb, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "spe_07.13h", 0x20000, 0x208b5f54, BRF_ESS | BRF_PRG }, // 1 - { "spe_08.14h", 0x20000, 0x2bc03ade, BRF_ESS | BRF_PRG }, // 2 - - { "spe_02.1e", 0x20000, 0x63c9dfd2, BRF_GRA }, // 3 Characters - { "spj_03.3e", 0x20000, 0x3ae28bc1, BRF_GRA }, // 4 - { "spe_04.1g", 0x20000, 0x9d7b225b, BRF_GRA }, // 5 - { "spj_05.2g", 0x20000, 0x4a060884, BRF_GRA }, // 6 - - { "spj_10.2k", 0x20000, 0xeedd0ade, BRF_GRA }, // 7 Sprites - { "spj_09.1k", 0x20000, 0x04b41b75, BRF_GRA }, // 8 - - { "spe_01.1d", 0x20000, 0x2d19c133, BRF_SND }, // 9 Samples - - { "eeprom-spang.bin", 0x80, 0xdeae1291, BRF_PRG }, -}; - -STD_ROM_PICK(Spang) -STD_ROM_FN(Spang) - -static struct BurnRomInfo SpangjRomDesc[] = { - { "spj_06.11h", 0x08000, 0x1a548b0b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "spj_07.13h", 0x20000, 0x14c2b765, BRF_ESS | BRF_PRG }, // 1 - { "spj_08.14h", 0x20000, 0x4be4e5b7, BRF_ESS | BRF_PRG }, // 2 - - { "spj_02.1e", 0x20000, 0x419f69d7, BRF_GRA }, // 3 Characters - { "spj_03.3e", 0x20000, 0x3ae28bc1, BRF_GRA }, // 4 - { "spj_04.1g", 0x20000, 0x6870506f, BRF_GRA }, // 5 - { "spj_05.2g", 0x20000, 0x4a060884, BRF_GRA }, // 6 - - { "spj_10.2k", 0x20000, 0xeedd0ade, BRF_GRA }, // 7 Sprites - { "spj_09.1k", 0x20000, 0x04b41b75, BRF_GRA }, // 8 - - { "spj_01.1d", 0x20000, 0xb96ea126, BRF_SND }, // 9 Samples - - { "eeprom-spangj.bin",0x80, 0x237c00eb, BRF_PRG }, -}; - -STD_ROM_PICK(Spangj) -STD_ROM_FN(Spangj) - -static struct BurnRomInfo SbbrosRomDesc[] = { - { "spu_06.11h", 0x08000, 0x292eee6a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "spu_07.13h", 0x20000, 0xf46b698d, BRF_ESS | BRF_PRG }, // 1 - { "spu_08.14h", 0x20000, 0xa75e7fbe, BRF_ESS | BRF_PRG }, // 2 - - { "spu_02.1e", 0x20000, 0x0c22ffc6, BRF_GRA }, // 3 Characters - { "spj_03.3e", 0x20000, 0x3ae28bc1, BRF_GRA }, // 4 - { "spu_04.1g", 0x20000, 0xbb3dee5b, BRF_GRA }, // 5 - { "spj_05.2g", 0x20000, 0x4a060884, BRF_GRA }, // 6 - - { "spu_10.2k", 0x20000, 0xd6675d8f, BRF_GRA }, // 7 Sprites - { "spu_09.1k", 0x20000, 0x8f678bc8, BRF_GRA }, // 8 - - { "spj_01.1d", 0x20000, 0xb96ea126, BRF_SND }, // 9 Samples - - { "eeprom-sbbros.bin",0x80, 0xed69d3cd, BRF_PRG }, -}; - -STD_ROM_PICK(Sbbros) -STD_ROM_FN(Sbbros) - -static struct BurnRomInfo MstworldRomDesc[] = { - { "mw-1.rom", 0x80000, 0xc4e51fb4, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - - { "mw-2.rom", 0x08000, 0x12c4fea9, BRF_ESS | BRF_PRG }, // 1 Z80 #2 Program Code - - { "mw-4.rom", 0x20000, 0x28a3af15, BRF_GRA }, // 2 Characters - { "mw-5.rom", 0x20000, 0xffdf7e9f, BRF_GRA }, // 3 - { "mw-6.rom", 0x20000, 0x1ed773a3, BRF_GRA }, // 4 - { "mw-7.rom", 0x20000, 0x8eb7525c, BRF_GRA }, // 5 - - { "mw-8.rom", 0x20000, 0xb9b92a3c, BRF_GRA }, // 6 Sprites - { "mw-9.rom", 0x20000, 0x75fc3375, BRF_GRA }, // 7 - - { "mw-3.rom", 0x80000, 0x110c6a68, BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(Mstworld) -STD_ROM_FN(Mstworld) - -static struct BurnRomInfo MarukinRomDesc[] = { - { "mg3-01.9d", 0x08000, 0x04357973, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "mg3-02.10d", 0x20000, 0x50d08da0, BRF_ESS | BRF_PRG }, // 1 - - { "mg3-a.3k", 0x80000, 0x420f1de7, BRF_GRA }, // 2 Characters - { "mg3-b.4k", 0x80000, 0xd8de13fa, BRF_GRA }, // 3 - { "mg3-c.6k", 0x80000, 0xfbeb66e8, BRF_GRA }, // 4 - { "mg3-d.7k", 0x80000, 0x8f6bd831, BRF_GRA }, // 5 - - { "mg3-05.2g", 0x20000, 0x7a738d2d, BRF_GRA }, // 6 Sprites - { "mg3-04.1g", 0x20000, 0x56f30515, BRF_GRA }, // 7 - - { "mg3-e.1d", 0x80000, 0x106c2fa9, BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(Marukin) -STD_ROM_FN(Marukin) - -static struct BurnRomInfo Qtono1RomDesc[] = { - { "q3-05.rom", 0x08000, 0x1dd0a344, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "q3-06.rom", 0x20000, 0xbd6a2110, BRF_ESS | BRF_PRG }, // 1 - { "q3-07.rom", 0x20000, 0x61e53c4f, BRF_ESS | BRF_PRG }, // 2 - - { "q3-08.rom", 0x20000, 0x1533b978, BRF_GRA }, // 3 Characters - { "q3-09.rom", 0x20000, 0xa32db2f2, BRF_GRA }, // 4 - { "q3-10.rom", 0x20000, 0xed681aa8, BRF_GRA }, // 5 - { "q3-11.rom", 0x20000, 0x38b2fd10, BRF_GRA }, // 6 - { "q3-18.rom", 0x20000, 0x9e4292ac, BRF_GRA }, // 7 - { "q3-19.rom", 0x20000, 0xb7f6d40f, BRF_GRA }, // 8 - { "q3-20.rom", 0x20000, 0x6cd7f38d, BRF_GRA }, // 9 - { "q3-21.rom", 0x20000, 0xb4aa6b4b, BRF_GRA }, // 10 - - { "q3-16.rom", 0x20000, 0x863d6836, BRF_GRA }, // 11 Sprites - { "q3-17.rom", 0x20000, 0x459bf59c, BRF_GRA }, // 12 - - { "q3-01.rom", 0x20000, 0x6c1be591, BRF_SND }, // 13 Samples -}; - -STD_ROM_PICK(Qtono1) -STD_ROM_FN(Qtono1) - -static struct BurnRomInfo QsangokuRomDesc[] = { - { "q4-05c.rom", 0x08000, 0xe1d010b4, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "q4-06.rom", 0x20000, 0xa0301849, BRF_ESS | BRF_PRG }, // 1 - { "q4-07.rom", 0x20000, 0x2941ef5b, BRF_ESS | BRF_PRG }, // 2 - - { "q4-08.rom", 0x20000, 0xdc84c6cb, BRF_GRA }, // 3 Characters - { "q4-09.rom", 0x20000, 0xcbb6234c, BRF_GRA }, // 4 - { "q4-10.rom", 0x20000, 0xc20a27a8, BRF_GRA }, // 5 - { "q4-11.rom", 0x20000, 0x4ff66aed, BRF_GRA }, // 6 - { "q4-18.rom", 0x20000, 0xca3acea5, BRF_GRA }, // 7 - { "q4-19.rom", 0x20000, 0x1fd92b7d, BRF_GRA }, // 8 - { "q4-20.rom", 0x20000, 0xb02dc6a1, BRF_GRA }, // 9 - { "q4-21.rom", 0x20000, 0x432b1dc1, BRF_GRA }, // 10 - - { "q4-16.rom", 0x20000, 0x77342320, BRF_GRA }, // 11 Sprites - { "q4-17.rom", 0x20000, 0x1275c436, BRF_GRA }, // 12 - - { "q4-01.rom", 0x20000, 0x5d0d07d8, BRF_SND }, // 13 Samples -}; - -STD_ROM_PICK(Qsangoku) -STD_ROM_FN(Qsangoku) - -static struct BurnRomInfo BlockRomDesc[] = { - { "ble_05b.14f", 0x08000, 0xfcdb7885, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ble_06b.15f", 0x20000, 0xe114ebde, BRF_ESS | BRF_PRG }, // 1 - { "ble_07b.16f", 0x20000, 0x61bef077, BRF_ESS | BRF_PRG }, // 2 - - { "bl_08.8h", 0x20000, 0xaa0f4ff1, BRF_GRA }, // 3 Characters - { "bl_09.9h", 0x20000, 0x6fa8c186, BRF_GRA }, // 4 - { "bl_18.8j", 0x20000, 0xc0acafaf, BRF_GRA }, // 5 - { "bl_19.9j", 0x20000, 0x1ae942f5, BRF_GRA }, // 6 - - { "bl_16.2j", 0x20000, 0xfadcaff7, BRF_GRA }, // 7 Sprites - { "bl_17.3j", 0x20000, 0x5f8cab42, BRF_GRA }, // 8 - - { "bl_01.2d", 0x20000, 0xc2ec2abb, BRF_SND }, // 9 Samples -}; - -STD_ROM_PICK(Block) -STD_ROM_FN(Block) - -static struct BurnRomInfo Blockr1RomDesc[] = { - { "ble_05a.14f", 0x08000, 0xfa2a4536, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ble_06a.15f", 0x20000, 0xe114ebde, BRF_ESS | BRF_PRG }, // 1 - { "ble_07.16f", 0x20000, 0x1d114f13, BRF_ESS | BRF_PRG }, // 2 - - { "bl_08.8h", 0x20000, 0xaa0f4ff1, BRF_GRA }, // 3 Characters - { "bl_09.9h", 0x20000, 0x6fa8c186, BRF_GRA }, // 4 - { "bl_18.8j", 0x20000, 0xc0acafaf, BRF_GRA }, // 5 - { "bl_19.9j", 0x20000, 0x1ae942f5, BRF_GRA }, // 6 - - { "bl_16.2j", 0x20000, 0xfadcaff7, BRF_GRA }, // 7 Sprites - { "bl_17.3j", 0x20000, 0x5f8cab42, BRF_GRA }, // 8 - - { "bl_01.2d", 0x20000, 0xc2ec2abb, BRF_SND }, // 9 Samples -}; - -STD_ROM_PICK(Blockr1) -STD_ROM_FN(Blockr1) - -static struct BurnRomInfo Blockr2RomDesc[] = { - { "ble_05.14f", 0x08000, 0xc12e7f4c, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ble_06.15f", 0x20000, 0xcdb13d55, BRF_ESS | BRF_PRG }, // 1 - { "ble_07.16f", 0x20000, 0x1d114f13, BRF_ESS | BRF_PRG }, // 2 - - { "bl_08.8h", 0x20000, 0xaa0f4ff1, BRF_GRA }, // 3 Characters - { "bl_09.9h", 0x20000, 0x6fa8c186, BRF_GRA }, // 4 - { "bl_18.8j", 0x20000, 0xc0acafaf, BRF_GRA }, // 5 - { "bl_19.9j", 0x20000, 0x1ae942f5, BRF_GRA }, // 6 - - { "bl_16.2j", 0x20000, 0xfadcaff7, BRF_GRA }, // 7 Sprites - { "bl_17.3j", 0x20000, 0x5f8cab42, BRF_GRA }, // 8 - - { "bl_01.2d", 0x20000, 0xc2ec2abb, BRF_SND }, // 9 Samples -}; - -STD_ROM_PICK(Blockr2) -STD_ROM_FN(Blockr2) - -static struct BurnRomInfo BlockjRomDesc[] = { - { "blj_05.14f", 0x08000, 0x3b55969a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ble_06.15f", 0x20000, 0xcdb13d55, BRF_ESS | BRF_PRG }, // 1 - { "blj_07.16f", 0x20000, 0x1723883c, BRF_ESS | BRF_PRG }, // 2 - - { "bl_08.8h", 0x20000, 0xaa0f4ff1, BRF_GRA }, // 3 Characters - { "bl_09.9h", 0x20000, 0x6fa8c186, BRF_GRA }, // 4 - { "bl_18.8j", 0x20000, 0xc0acafaf, BRF_GRA }, // 5 - { "bl_19.9j", 0x20000, 0x1ae942f5, BRF_GRA }, // 6 - - { "bl_16.2j", 0x20000, 0xfadcaff7, BRF_GRA }, // 7 Sprites - { "bl_17.3j", 0x20000, 0x5f8cab42, BRF_GRA }, // 8 - - { "bl_01.2d", 0x20000, 0xc2ec2abb, BRF_SND }, // 9 Samples -}; - -STD_ROM_PICK(Blockj) -STD_ROM_FN(Blockj) - -static struct BurnRomInfo BlockblRomDesc[] = { - { "m7.l6", 0x10000, 0x3b576fd9, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "m5.l3", 0x40000, 0x7c988bb7, BRF_ESS | BRF_PRG }, // 1 - { "m6.l5", 0x20000, 0x5768d8eb, BRF_ESS | BRF_PRG }, // 2 - - { "m12.o10", 0x20000, 0x963154d9, BRF_GRA }, // 3 Characters - { "m13.o14", 0x20000, 0x069480bb, BRF_GRA }, // 4 - { "m4.j17", 0x20000, 0x9e3b6f4f, BRF_GRA }, // 5 - { "m3.j20", 0x20000, 0x629d58fe, BRF_GRA }, // 6 - - { "m11.o7", 0x10000, 0x255180a5, BRF_GRA }, // 7 Sprites - { "m10.o5", 0x10000, 0x3201c088, BRF_GRA }, // 8 - { "m9.o3", 0x10000, 0x29357fe4, BRF_GRA }, // 9 - { "m8.o2", 0x10000, 0xabd665d1, BRF_GRA }, // 10 - - { "bl_01.rom", 0x20000, 0xc2ec2abb, BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(Blockbl) -STD_ROM_FN(Blockbl) - -static const eeprom_interface MitchellEEPROMIntf = -{ - 6, - 16, - "0110", - "0101", - "0111", - 0, - 0, - 0, - 0 -}; - -static INT32 MgakuenMemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom = Next; Next += 0x50000; - DrvSoundRom = Next; Next += 0x80000; - - RamStart = Next; - - DrvZ80Ram = Next; Next += 0x01000; - DrvPaletteRam = Next; Next += 0x00800; - DrvAttrRam = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x01000; - DrvSpriteRam = Next; Next += 0x01000; - - RamEnd = Next; - - DrvChars = Next; Next += 0x10000 * 8 * 8; - DrvSprites = Next; Next += 0x00800 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 PangMemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom = Next; Next += 0x50000; - DrvZ80Code = Next; Next += 0x50000; - DrvSoundRom = Next; Next += 0x20000; - - RamStart = Next; - - DrvZ80Ram = Next; Next += 0x02000; - DrvPaletteRam = Next; Next += 0x01000; - DrvAttrRam = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x01000; - DrvSpriteRam = Next; Next += 0x01000; - - RamEnd = Next; - - DrvChars = Next; Next += 0x8000 * 8 * 8; - DrvSprites = Next; Next += 0x0800 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 MahjongMemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom = Next; Next += 0x50000; - DrvZ80Code = Next; Next += 0x50000; - DrvSoundRom = Next; Next += 0x80000; - - RamStart = Next; - - DrvZ80Ram = Next; Next += 0x02000; - DrvPaletteRam = Next; Next += 0x01000; - DrvAttrRam = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x01000; - DrvSpriteRam = Next; Next += 0x01000; - - RamEnd = Next; - - DrvChars = Next; Next += 0x10000 * 8 * 8; - DrvSprites = Next; Next += 0x00800 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 MstworldMemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom = Next; Next += 0x50000; - DrvZ80Code = Next; Next += 0x50000; - DrvZ80Rom2 = Next; Next += 0x08000; - DrvSoundRom = Next; Next += 0x100000; - - RamStart = Next; - - DrvZ80Ram = Next; Next += 0x02000; - DrvZ80Ram2 = Next; Next += 0x00800; - DrvPaletteRam = Next; Next += 0x01000; - DrvAttrRam = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x01000; - DrvSpriteRam = Next; Next += 0x01000; - - RamEnd = Next; - - DrvChars = Next; Next += 0x4000 * 8 * 8; - DrvSprites = Next; Next += 0x0800 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static void oki_bankswitch(INT32 bank) -{ - DrvOkiBank = bank; - - MSM6295SetBank(0, DrvSoundRom + (DrvOkiBank * 0x40000), 0x00000, 0x3ffff); -} - -static INT32 DrvDoReset() -{ - ZetOpen(0); - DrvRomBank = 0; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - if (DrvHasEEPROM) { - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Code + 0x10000 + (DrvRomBank * 0x4000), DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - } else { - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - } - ZetReset(); - ZetClose(); - - BurnYM2413Reset(); - MSM6295Reset(0); - oki_bankswitch(0); - - if (DrvHasEEPROM) EEPROMReset(); - - DrvPaletteRamBank = 0; - DrvVideoBank = 0; - DrvDialSelected = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MstworldDoReset() -{ - ZetOpen(0); - DrvRomBank = 0; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Code + 0x10000 + (DrvRomBank * 0x4000), DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - - DrvPaletteRamBank = 0; - DrvVideoBank = 0; - DrvSoundLatch = 0; - - HiscoreReset(); - - return 0; -} - -static UINT8 BlockDialRead(INT32 Offset) -{ - static INT32 Dir[2]; - - if (DrvDialSelected) { - INT32 Delta; - - Delta = ((Offset ? DrvDial2 : DrvDial1) - DrvDial[Offset]) & 0xff; - if (Delta & 0x80) { - Delta = (-Delta) & 0xff; - if (Dir[Offset]) { - Dir[Offset] = 0; - Delta = 0; - } - } else { - if (Delta > 0) { - if (Dir[Offset] == 0) { - Dir[Offset] = 1; - Delta = 0; - } - } - } - - if (Delta > 0x3f) Delta = 0x3f; - - return Delta << 2; - } else { - INT32 Res = (0xff - DrvInput[Offset + 1]) & 0xf7; - if (Dir[Offset]) Res |= 0x08; - - return Res; - } -} - -UINT8 __fastcall MitchellZ80Read(UINT16 a) -{ - if (a >= 0xc000 && a <= 0xc7ff) { - return DrvPaletteRam[(a - 0xc000) + (DrvPaletteRamBank ? 0x800 : 0x000)]; - } - - if (a >= 0xd000 && a <= 0xdfff) { - INT32 Offset = a - 0xd000; - if (DrvVideoBank) { - return DrvSpriteRam[Offset]; - } else { - return DrvVideoRam[Offset]; - } - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall MitchellZ80Write(UINT16 a, UINT8 d) -{ - if (a >= 0xc000 && a <= 0xc7ff) { - DrvPaletteRam[(a - 0xc000) + (DrvPaletteRamBank ? 0x800 : 0x000)] = d; - return; - } - - if (a >= 0xd000 && a <= 0xdfff) { - INT32 Offset = a - 0xd000; - if (DrvVideoBank) { - DrvSpriteRam[Offset] = d; - } else { - DrvVideoRam[Offset] = d; - } - return; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall MitchellZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return 0xff - DrvInput[0]; - } - - case 0x01: { - switch (DrvInputType) { - case DRV_INPUT_TYPE_MAHJONG: { - if (DrvMahjongKeyMatrix & (0x80 >> 0)) return 0xff - DrvInput[1]; - if (DrvMahjongKeyMatrix & (0x80 >> 1)) return 0xff - DrvInput[2]; - if (DrvMahjongKeyMatrix & (0x80 >> 2)) return 0xff - DrvInput[4]; - if (DrvMahjongKeyMatrix & (0x80 >> 3)) return 0xff - DrvInput[5]; - if (DrvMahjongKeyMatrix & (0x80 >> 4)) return 0xff - DrvInput[6]; - } - - case DRV_INPUT_TYPE_BLOCK: { - return BlockDialRead(0); - } - } - - return 0xff - DrvInput[1]; - } - - case 0x02: { - switch (DrvInputType) { - case DRV_INPUT_TYPE_MAHJONG: { - if (DrvMahjongKeyMatrix & (0x80 >> 0)) return 0xff - DrvInput[7]; - if (DrvMahjongKeyMatrix & (0x80 >> 1)) return 0xff - DrvInput[8]; - if (DrvMahjongKeyMatrix & (0x80 >> 2)) return 0xff - DrvInput[9]; - if (DrvMahjongKeyMatrix & (0x80 >> 3)) return 0xff - DrvInput[10]; - if (DrvMahjongKeyMatrix & (0x80 >> 4)) return 0xff - DrvInput[11]; - } - - case DRV_INPUT_TYPE_BLOCK: { - return BlockDialRead(1); - } - } - - return 0xff - DrvInput[2]; - } - - case 0x03: { - return DrvDip[0]; - } - - case 0x04: { - return DrvDip[1]; - } - - case 0x05: { - INT32 Bit = DrvHasEEPROM ? (EEPROMRead() & 0x01) << 7 : 0x80; - Bit |= 0x01; - Bit |= 0x08; - if (DrvInput5Toggle) { - //Bit |= 0x01; - } else { - Bit ^= 0x08; - Bit ^= 0x01; - } - - if (DrvPort5Kludge) Bit ^= 0x08; - - return ((0xff - DrvInput[3]) & 0x76) | Bit; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0xff; -} - -void __fastcall MitchellZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - DrvFlipScreen = d & 0x04; - if (DrvOkiBank != (d & 0x10)>>4) { - DrvOkiBank = (d & 0x10)>>4; - - oki_bankswitch(DrvOkiBank); - } - DrvPaletteRamBank = d & 0x20; - return; - } - - case 0x01: { - switch (DrvInputType) { - case DRV_INPUT_TYPE_MAHJONG: { - DrvMahjongKeyMatrix = d; - return; - } - - case DRV_INPUT_TYPE_BLOCK: { - if (d == 0x08) { - DrvDial[0] = DrvDial1; - DrvDial[1] = DrvDial2; - } else { - if (d == 0x80) { - DrvDialSelected = 0; - } else { - DrvDialSelected = 1; - } - } - return; - } - } - - return; - } - - case 0x02: { - DrvRomBank = d & 0x0f; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - if (DrvHasEEPROM) { - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Code + 0x10000 + (DrvRomBank * 0x4000), DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - } else { - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - } - return; - } - - case 0x03: { - BurnYM2413Write(1, d); - return; - } - - case 0x04: { - BurnYM2413Write(0, d); - return; - } - - case 0x05: { - MSM6295Command(0, d); - return; - } - - case 0x06:{ - // nop - return; - } - - case 0x07: { - DrvVideoBank = d; - return; - } - - case 0x08 :{ - if (DrvHasEEPROM) EEPROMSetCSLine(d ? 0 : 1); - return; - } - - case 0x10 :{ - if (DrvHasEEPROM) EEPROMSetClockLine(d ? 0 : 1); - return; - } - - case 0x18 :{ - if (DrvHasEEPROM) EEPROMWriteBit(d); - return; - } - - default: { - //bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall MstworldZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return 0xff - DrvInput[0]; - } - - case 0x01: { - return 0xfe - DrvInput[1]; - } - - case 0x02: { - return 0xfe - DrvInput[2]; - } - - case 0x03: { - return DrvDip[0]; - } - - case 0x05: { - return 0xff - DrvInput[3]; - } - - case 0x06: { - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0xff; -} - -void __fastcall MstworldZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - DrvFlipScreen = d & 0x04; - DrvPaletteRamBank = d & 0x20; - return; - } - - case 0x02: { - DrvRomBank = d & 0x0f; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Code + 0x10000 + (DrvRomBank * 0x4000), DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - return; - } - - case 0x03: { - DrvSoundLatch = d; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - } - - case 0x06: { - // nop - return; - } - - case 0x07: { - DrvVideoBank = d & 0x01; - return; - } - - case 0x08: - case 0x10: - case 0x18: - case 0x27: { - // ??? - return; - } - - default: { // block block seems to write to random ports quite often - //bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall MstworldSoundZ80Read(UINT16 a) -{ - switch (a) { - case 0x9800: { - return MSM6295ReadStatus(0); - } - - case 0xa000: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall MstworldSoundZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - DrvOkiBank = d & 0x03; - - oki_bankswitch(DrvOkiBank); - return; - } - - case 0x9800: { - MSM6295Command(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -// Kabuki - we use the module from the CPS-1 Q-Sound games -extern void kabuki_decode(UINT8 *src, UINT8 *dest_op, UINT8 *dest_data, INT32 base_addr, INT32 length, INT32 swap_key1, INT32 swap_key2, INT32 addr_key, INT32 xor_key); - -static void mitchell_decode(INT32 swap_key1, INT32 swap_key2, INT32 addr_key, INT32 xor_key) -{ - UINT8 *rom = DrvZ80Rom; - UINT8 *decrypt = DrvZ80Code; - INT32 numbanks = (0x50000 - 0x10000) / 0x4000; - INT32 i; - - kabuki_decode(rom, decrypt, rom, 0x0000, 0x8000, swap_key1, swap_key2, addr_key, xor_key); - - rom += 0x10000; - decrypt += 0x10000; - for (i = 0; i < numbanks; i++) - kabuki_decode(rom + i * 0x4000,decrypt + i * 0x4000, rom + i * 0x4000, 0x8000, 0x4000, swap_key1, swap_key2, addr_key, xor_key); -} - -static void mgakuen2_decode() { mitchell_decode(0x76543210, 0x01234567, 0xaa55, 0xa5); } -static void pang_decode() { mitchell_decode(0x01234567, 0x76543210, 0x6548, 0x24); } -static void cworld_decode() { mitchell_decode(0x04152637, 0x40516273, 0x5751, 0x43); } -static void hatena_decode() { mitchell_decode(0x45670123, 0x45670123, 0x5751, 0x43); } -static void spang_decode() { mitchell_decode(0x45670123, 0x45670123, 0x5852, 0x43); } -static void spangj_decode() { mitchell_decode(0x45123670, 0x67012345, 0x55aa, 0x5a); } -static void sbbros_decode() { mitchell_decode(0x45670123, 0x45670123, 0x2130, 0x12); } -static void marukin_decode() { mitchell_decode(0x54321076, 0x54321076, 0x4854, 0x4f); } -static void qtono1_decode() { mitchell_decode(0x12345670, 0x12345670, 0x1111, 0x11); } -static void qsangoku_decode() { mitchell_decode(0x23456701, 0x23456701, 0x1828, 0x18); } -static void block_decode() { mitchell_decode(0x02461357, 0x64207531, 0x0002, 0x01); } - -static INT32 CharPlaneOffsets[4] = { 0x400004, 0x400000, 4, 0 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 8, 9, 10, 11 }; -static INT32 CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 MahjongCharPlaneOffsets[4] = { 12, 8, 4, 0 }; -static INT32 MahjongCharXOffsets[8] = { 0, 1, 2, 3, 16, 17, 18, 19 }; -static INT32 MahjongCharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 SpritePlaneOffsets[4] = { 0x100004, 0x100000, 4, 0 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 8, 9, 10, 11, 256, 257, 258, 259, 264, 265, 266, 267 }; -static INT32 SpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; -static INT32 MstworldCharPlaneOffsets[4] = { 0x200000, 0x300000, 0, 0x100000 }; -static INT32 MstworldCharXOffsets[8] = { 7, 6, 5, 4, 3, 2, 1, 0 }; -static INT32 MstworldCharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 MstworldSpritePlaneOffsets[4] = { 4, 0, 0x100004, 0x100000 }; -static INT32 MstworldSpriteXOffsets[16] = { 0, 1, 2, 3, 8, 9, 10, 11, 256, 257, 258, 259, 264, 265, 266, 267 }; -static INT32 MstworldSpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; - -static void MitchellMachineInit() -{ - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(MitchellZ80Read); - ZetSetWriteHandler(MitchellZ80Write); - ZetSetInHandler(MitchellZ80PortRead); - ZetSetOutHandler(MitchellZ80PortWrite); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom + 0x00000 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Code + 0x00000, DrvZ80Rom + 0x00000); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Code + 0x10000, DrvZ80Rom + 0x10000); - ZetMapArea(0xc800, 0xcfff, 0, DrvAttrRam ); - ZetMapArea(0xc800, 0xcfff, 1, DrvAttrRam ); - ZetMapArea(0xc800, 0xcfff, 2, DrvAttrRam ); - ZetMapArea(0xe000, 0xffff, 0, DrvZ80Ram ); - ZetMapArea(0xe000, 0xffff, 1, DrvZ80Ram ); - ZetMapArea(0xe000, 0xffff, 2, DrvZ80Ram ); - ZetClose(); - - BurnYM2413Init(4000000); - BurnYM2413SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&MitchellEEPROMIntf); - DrvHasEEPROM = 1; - - GenericTilesInit(); - - DrvTileMask = 0x7fff; - DrvNumColours = 0x800; - DrvInput5Toggle = 0; -} - -static void MahjongMachineInit() -{ - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(MitchellZ80Read); - ZetSetWriteHandler(MitchellZ80Write); - ZetSetInHandler(MitchellZ80PortRead); - ZetSetOutHandler(MitchellZ80PortWrite); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom + 0x00000 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Code + 0x00000, DrvZ80Rom + 0x00000); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Code + 0x10000, DrvZ80Rom + 0x10000); - ZetMapArea(0xc800, 0xcfff, 0, DrvAttrRam ); - ZetMapArea(0xc800, 0xcfff, 1, DrvAttrRam ); - ZetMapArea(0xc800, 0xcfff, 2, DrvAttrRam ); - ZetMapArea(0xe000, 0xffff, 0, DrvZ80Ram ); - ZetMapArea(0xe000, 0xffff, 1, DrvZ80Ram ); - ZetMapArea(0xe000, 0xffff, 2, DrvZ80Ram ); - ZetClose(); - - BurnYM2413Init(4000000); - BurnYM2413SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 990000 / 132, 1); - MSM6295SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&MitchellEEPROMIntf); - DrvHasEEPROM = 1; - - GenericTilesInit(); - - DrvTileMask = 0xffff; - DrvNumColours = 0x800; -} - -static INT32 MgakuenInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - MgakuenMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MgakuenMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x200000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x000000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x010000, 1, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x10000, 4, 8, 8, MahjongCharPlaneOffsets, MahjongCharXOffsets, MahjongCharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x020000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x00800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x000000, 8, 1); if (nRet != 0) return 1; - - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(MitchellZ80PortRead); - ZetSetOutHandler(MitchellZ80PortWrite); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom + 0x00000); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom + 0x00000); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x10000); - ZetMapArea(0xc000, 0xc7ff, 0, DrvPaletteRam ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvPaletteRam ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvPaletteRam ); - ZetMapArea(0xc800, 0xcfff, 0, DrvAttrRam ); - ZetMapArea(0xc800, 0xcfff, 1, DrvAttrRam ); - ZetMapArea(0xc800, 0xcfff, 2, DrvAttrRam ); - ZetMapArea(0xd000, 0xdfff, 0, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 1, DrvVideoRam ); - ZetMapArea(0xd000, 0xdfff, 2, DrvVideoRam ); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80Ram ); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80Ram ); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80Ram ); - ZetMapArea(0xf000, 0xffff, 0, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 1, DrvSpriteRam ); - ZetMapArea(0xf000, 0xffff, 2, DrvSpriteRam ); - ZetClose(); - - BurnYM2413Init(4000000); - BurnYM2413SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 990000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvTileMask = 0xffff; - DrvNumColours = 0x400; - DrvHasEEPROM = 0; - - DrvInputType = DRV_INPUT_TYPE_MAHJONG; - - DrvDoReset(); - - return 0; -} - -static INT32 Mgakuen2Init() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - MahjongMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MahjongMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x200000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x000000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x010000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x030000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x10000, 4, 8, 8, MahjongCharPlaneOffsets, MahjongCharXOffsets, MahjongCharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x020000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x00800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x000000, 9, 1); if (nRet != 0) return 1; - - mgakuen2_decode(); - - MahjongMachineInit(); - - DrvInputType = DRV_INPUT_TYPE_MAHJONG; - - DrvPort5Kludge = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 PkladiesInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - MahjongMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MahjongMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x200000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x000000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x010000, 1, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100001, 5, 2); if (nRet != 0) return 1; - GfxDecode(0x10000, 4, 8, 8, MahjongCharPlaneOffsets, MahjongCharXOffsets, MahjongCharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x020000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x00800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x000000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvSoundRom + 0x020000, 9, 1); if (nRet != 0) return 1; - - mgakuen2_decode(); - - MahjongMachineInit(); - - DrvInputType = DRV_INPUT_TYPE_MAHJONG; - - DrvDoReset(); - - return 0; -} - -static INT32 DokabenInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - mgakuen2_decode(); - - MitchellMachineInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 PangInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 8, 1); if (nRet != 0) return 1; - - pang_decode(); - - MitchellMachineInit(); - BurnSetRefreshRate(57); - DrvDoReset(); - - return 0; -} - -static INT32 PangbInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Code + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Code + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 2, 1); if (nRet != 0) return 1; - memcpy(DrvZ80Rom + 0x0000, DrvZ80Code + 0x8000, 0x8000); - memset(DrvZ80Code + 0x8000, 0, 0x8000); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - MitchellMachineInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 PangboldInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Code + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Code + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 2, 1); if (nRet != 0) return 1; - memcpy(DrvZ80Rom + 0x0000, DrvZ80Code + 0x8000, 0x8000); - memset(DrvZ80Code + 0x8000, 0, 0x8000); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 11, 1); if (nRet != 0) return 1; - - MitchellMachineInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 Pangb2Init() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Code + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Code + 0x10000, 1, 1); if (nRet != 0) return 1; - memcpy(DrvZ80Rom + 0x00000, DrvZ80Code + 0x08000, 0x08000); - memcpy(DrvZ80Rom + 0x10000, DrvZ80Code + 0x30000, 0x20000); - memset(DrvZ80Code + 0x8000, 0, 0x8000); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 8, 1); if (nRet != 0) return 1; - - MitchellMachineInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 CworldInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xc0000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xe0000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 13, 1); if (nRet != 0) return 1; - - cworld_decode(); - - MitchellMachineInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 HatenaInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xc0000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xe0000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 13, 1); if (nRet != 0) return 1; - - hatena_decode(); - - MitchellMachineInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 SpangInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - - spang_decode(); - - MitchellMachineInit(); - - if (!EEPROMAvailable()) EEPROMFill(DrvTempRom, 0, 128); - - BurnFree(DrvTempRom); - - DrvNVRamSize = 0x0080; - DrvNVRamAddress = 0x0000; - - DrvDoReset(); - - return 0; -} - -static INT32 SpangjInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - - spangj_decode(); - - MitchellMachineInit(); - - if (!EEPROMAvailable()) EEPROMFill(DrvTempRom, 0, 128); - - BurnFree(DrvTempRom); - - DrvNVRamSize = 0x0080; - DrvNVRamAddress = 0x0000; - - DrvDoReset(); - - return 0; -} - -static INT32 SbbrosInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - - sbbros_decode(); - - MitchellMachineInit(); - - if (!EEPROMAvailable()) EEPROMFill(DrvTempRom, 0, 128); - - BurnFree(DrvTempRom); - - DrvNVRamSize = 0x0080; - DrvNVRamAddress = 0x0000; - - DrvDoReset(); - - return 0; -} - -static INT32 MstworldInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - MstworldMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MstworldMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 1, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0x00, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 5, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x80000; i++) DrvTempRom[i] ^= 0xff; - GfxDecode(0x4000, 4, 8, 8, MstworldCharPlaneOffsets, MstworldCharXOffsets, MstworldCharYOffsets, 0x40, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0x00, 0x80000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 7, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x40000; i++) DrvTempRom[i] ^= 0xff; - GfxDecode(0x0800, 4, 16, 16, MstworldSpritePlaneOffsets, MstworldSpriteXOffsets, MstworldSpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - memcpy(DrvSoundRom + 0x000000, DrvTempRom + 0x000000, 0x20000); - memcpy(DrvSoundRom + 0x020000, DrvTempRom + 0x000000, 0x20000); - memcpy(DrvSoundRom + 0x040000, DrvTempRom + 0x000000, 0x20000); - memcpy(DrvSoundRom + 0x060000, DrvTempRom + 0x020000, 0x20000); - memcpy(DrvSoundRom + 0x080000, DrvTempRom + 0x000000, 0x20000); - memcpy(DrvSoundRom + 0x0a0000, DrvTempRom + 0x040000, 0x20000); - memcpy(DrvSoundRom + 0x0c0000, DrvTempRom + 0x000000, 0x20000); - memcpy(DrvSoundRom + 0x0e0000, DrvTempRom + 0x060000, 0x20000); - - static const INT32 tablebank[] = { - 0, 0, - 1, 1, - -1, -1, - -1, -1, - 10, 4, - 5, 13, - 7, 17, - 21, 2, - 18, 9, - 15, 3, - 6, 11, - 19, 8, - -1, -1, - -1, -1, - -1, -1, - -1, -1, - 20, 20, - 14, 14, - 16, 16, - 12, 12, - }; - - memcpy(DrvTempRom, DrvZ80Rom, 0x80000); - for (INT32 x = 0; x < 40; x += 2) { - if (tablebank[x] != -1) { - memcpy(&DrvZ80Rom[(x / 2) * 0x4000], &DrvTempRom[tablebank[x] * 0x4000], 0x4000); - memcpy(&DrvZ80Code[(x / 2) * 0x4000], &DrvTempRom[tablebank[x + 1] * 0x4000], 0x4000); - } - } - - BurnFree(DrvTempRom); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(MitchellZ80Read); - ZetSetWriteHandler(MitchellZ80Write); - ZetSetInHandler(MstworldZ80PortRead); - ZetSetOutHandler(MstworldZ80PortWrite); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom + 0x00000 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Code + 0x00000, DrvZ80Rom + 0x00000); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Code + 0x10000, DrvZ80Rom + 0x10000); - ZetMapArea(0xc800, 0xcfff, 0, DrvAttrRam ); - ZetMapArea(0xc800, 0xcfff, 1, DrvAttrRam ); - ZetMapArea(0xc800, 0xcfff, 2, DrvAttrRam ); - ZetMapArea(0xe000, 0xffff, 0, DrvZ80Ram ); - ZetMapArea(0xe000, 0xffff, 1, DrvZ80Ram ); - ZetMapArea(0xe000, 0xffff, 2, DrvZ80Ram ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(MstworldSoundZ80Read); - ZetSetWriteHandler(MstworldSoundZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom2); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom2); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80Ram2); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80Ram2); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80Ram2); - ZetClose(); - - MSM6295Init(0, 990000 / 132, 0); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - DrvHasEEPROM = 0; - - GenericTilesInit(); - - DrvTileMask = 0x3fff; - DrvNumColours = 0x800; - - MstworldDoReset(); - - return 0; -} - -static INT32 MarukinInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - MahjongMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MahjongMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x200000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x000000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x010000, 1, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x10000, 4, 8, 8, MahjongCharPlaneOffsets, MahjongCharXOffsets, MahjongCharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x020000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x00800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x000000, 8, 1); if (nRet != 0) return 1; - - marukin_decode(); - - MahjongMachineInit(); - - DrvInputType = DRV_INPUT_TYPE_MAHJONG; - - DrvDoReset(); - - return 0; -} - -static INT32 Qtono1Init() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xc0000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xe0000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 13, 1); if (nRet != 0) return 1; - - qtono1_decode(); - - MitchellMachineInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 QsangokuInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xc0000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xe0000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 13, 1); if (nRet != 0) return 1; - - qsangoku_decode(); - - MitchellMachineInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 BlockInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - block_decode(); - - MitchellMachineInit(); - - DrvInputType = DRV_INPUT_TYPE_BLOCK; - - DrvNVRamSize = 0x0080; - DrvNVRamAddress = 0x1f80; - - DrvDoReset(); - - return 0; -} - -static INT32 BlockjoyInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 9, 1); if (nRet != 0) return 1; - - block_decode(); - - MitchellMachineInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 BlockblInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - PangMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - PangMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - nRet = BurnLoadRom(DrvZ80Code + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Code + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x30000, 2, 1); if (nRet != 0) return 1; - memcpy(DrvZ80Rom + 0x00000, DrvZ80Code + 0x08000, 0x08000); - memset(DrvZ80Code + 0x08000, 0, 0x08000); - memcpy(DrvZ80Rom + 0x10000, DrvZ80Code + 0x30000, 0x20000); - memset(DrvZ80Code + 0x30000, 0, 0x20000); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xa0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x8000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0xff, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x0800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - BurnFree(DrvTempRom); - - nRet = BurnLoadRom(DrvSoundRom + 0x00000, 11, 1); if (nRet != 0) return 1; - - MitchellMachineInit(); - - DrvInputType = DRV_INPUT_TYPE_BLOCK; - - DrvNVRamSize = 0x0080; - DrvNVRamAddress = 0x1f80; - - DrvDoReset(); - - return 0; -} - -static INT32 CommonExit() -{ - ZetExit(); - - MSM6295Exit(0); - if (DrvHasEEPROM) EEPROMExit(); - - GenericTilesExit(); - - BurnFree(Mem); - - DrvRomBank = 0; - DrvPaletteRamBank = 0; - DrvOkiBank = 0; - DrvFlipScreen = 0; - DrvVideoBank = 0; - DrvInputType = 0; - DrvMahjongKeyMatrix = 0; - DrvTileMask = 0; - DrvInput5Toggle = 0; - DrvPort5Kludge = 0; - DrvHasEEPROM = 0; - DrvNumColours = 0; - DrvNVRamSize = 0; - DrvNVRamAddress = 0; - DrvDialSelected = 0; - DrvSoundLatch = 0; - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2413Exit(); - - return CommonExit(); -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 8); - g = pal4bit(nColour >> 4); - b = pal4bit(nColour >> 0); - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - for (INT32 i = 0; i < DrvNumColours * 2; i += 2) { - INT32 Val = DrvPaletteRam[i & ~1] + (DrvPaletteRam[i | 1] << 8); - - DrvPalette[i >> 1] = CalcCol(Val); - } -} - -static void DrvRenderBgLayer() -{ - INT32 mx, my, Code, Attr, Colour, x, y, TileIndex = 0, xFlip; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = DrvAttrRam[TileIndex]; - Code = DrvVideoRam[(2 * TileIndex) + 0] + (DrvVideoRam[(2 * TileIndex) + 1] << 8); - Colour = Attr & (DrvNumColours == 0x800 ? 0x7f : 0x3f); - xFlip = (Attr & 0x80); - - x = 8 * mx; - y = 8 * my; - - if (DrvFlipScreen) { - x = 504 - x; - y = 248 - y; - xFlip = !xFlip; - } - - x -= 64; - y -= 8; - - Code &= DrvTileMask; - - if (DrvFlipScreen) { - if (x > 8 && x < (nScreenWidth - 8) && y > 8 && y < (nScreenHeight - 8)) { - if (xFlip) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 15, 0, DrvChars); - } else { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 15, 0, DrvChars); - } - } else { - if (xFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 15, 0, DrvChars); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 15, 0, DrvChars); - } - } - } else { - if (x > 8 && x < (nScreenWidth - 8) && y > 8 && y < (nScreenHeight - 8)) { - if (xFlip) { - Render8x8Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 15, 0, DrvChars); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 15, 0, DrvChars); - } - } else { - if (xFlip) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 15, 0, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 15, 0, DrvChars); - } - } - } - - TileIndex++; - } - } -} - -static void DrvRenderSpriteLayer() -{ - INT32 sx, sy; - - for (INT32 Offset = 0x1000 - 0x40; Offset >= 0; Offset -= 0x20) { - INT32 Code = DrvSpriteRam[Offset + 0]; - INT32 Attr = DrvSpriteRam[Offset + 1]; - INT32 Colour = Attr & 0x0f; - sx = DrvSpriteRam[Offset + 3] + ((Attr & 0x10) << 4); - sy = ((DrvSpriteRam[Offset + 2] + 8) & 0xff) - 8; - Code += (Attr & 0xe0) << 3; - - if (DrvFlipScreen) { - sx = 496 - sx; - sy = 240 - sy; - } - - sx -= 64; - sy -= 8; - - if (DrvFlipScreen) { - if (sx > 16 && sx < (nScreenWidth - 16) && sy > 16 && sy < (nScreenHeight - 16)) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, sx, sy, Colour, 4, 15, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 15, 0, DrvSprites); - } - } else { - if (sx > 16 && sx < (nScreenWidth - 16) && sy > 16 && sy < (nScreenHeight - 16)) { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour, 4, 15, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 4, 15, 0, DrvSprites); - } - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - DrvRenderBgLayer(); - DrvRenderSpriteLayer(); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 8000000 / 57; - nCyclesDone[0] = 0; - - //DrvInput5Toggle = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nCyclesSegment = nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 0 || i == 240) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - DrvInput5Toggle = (i == 240); - } - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2413Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2413Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 MstworldFrame() -{ - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - if (DrvReset) MstworldDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 24000000 / 60; - nCyclesTotal[1] = 6000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 9) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_NVRAM && DrvNVRamSize) { - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvZ80Ram + DrvNVRamAddress; - ba.nLen = DrvNVRamSize; - ba.szName = "NVRam"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - BurnYM2413Scan(nAction); - MSM6295Scan(0, nAction); - - if (DrvHasEEPROM) EEPROMScan(nAction, pnMin); - - SCAN_VAR(nCyclesDone[0]); - SCAN_VAR(nCyclesDone[1]); - SCAN_VAR(DrvRomBank); - SCAN_VAR(DrvPaletteRamBank); - SCAN_VAR(DrvOkiBank); - SCAN_VAR(DrvFlipScreen); - SCAN_VAR(DrvVideoBank); - SCAN_VAR(DrvInput5Toggle); - SCAN_VAR(DrvDialSelected); - SCAN_VAR(DrvDial[0]); - SCAN_VAR(DrvDial[1]); - SCAN_VAR(DrvDial1); - SCAN_VAR(DrvDial2); - SCAN_VAR(DrvMahjongKeyMatrix); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - if (DrvHasEEPROM) { - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Code + 0x10000 + (DrvRomBank * 0x4000), DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - } else { - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - } - ZetClose(); - - oki_bankswitch(DrvOkiBank); - } - - return 0; -} - -static INT32 MstworldScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(nCyclesDone[0]); - SCAN_VAR(nCyclesDone[1]); - SCAN_VAR(DrvRomBank); - SCAN_VAR(DrvPaletteRamBank); - SCAN_VAR(DrvOkiBank); - SCAN_VAR(DrvFlipScreen); - SCAN_VAR(DrvVideoBank); - SCAN_VAR(DrvSoundLatch); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Code + 0x10000 + (DrvRomBank * 0x4000), DrvZ80Rom + 0x10000 + (DrvRomBank * 0x4000)); - ZetClose(); - - oki_bankswitch(DrvOkiBank); - } - - return 0; -} - -struct BurnDriver BurnDrvMgakuen = { - "mgakuen", NULL, NULL, NULL, "1988", - "Mahjong Gakuen\0", NULL, "Yuga", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAHJONG, 0, - NULL, MgakuenRomInfo, MgakuenRomName, NULL, NULL, MgakuenInputInfo, MgakuenDIPInfo, - MgakuenInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSeventoitsu = { - "7toitsu", "mgakuen", NULL, NULL, "1988", - "Chi-Toitsu\0", NULL, "Yuga", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAHJONG, 0, - NULL, SeventoitsuRomInfo, SeventoitsuRomName, NULL, NULL, MgakuenInputInfo, MgakuenDIPInfo, - MgakuenInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMgakuen2 = { - "mgakuen2", NULL, NULL, NULL, "1989", - "Mahjong Gakuen 2 Gakuen-chou no Fukushuu\0", NULL, "Face", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAHJONG, 0, - NULL, Mgakuen2RomInfo, Mgakuen2RomName, NULL, NULL, MarukinInputInfo, NULL, - Mgakuen2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPkladies = { - "pkladies", NULL, NULL, NULL, "1989", - "Poker Ladies\0", NULL, "Mitchell", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAHJONG, 0, - NULL, PkladiesRomInfo, PkladiesRomName, NULL, NULL, PkladiesInputInfo, NULL, - PkladiesInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPkladiesl = { - "pkladiesl", "pkladies", NULL, NULL, "1989", - "Poker Ladies (Leprechaun ver. 510)\0", NULL, "Leprechaun", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAHJONG, 0, - NULL, PkladieslRomInfo, PkladieslRomName, NULL, NULL, PkladiesInputInfo, NULL, - PkladiesInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPkladiesla = { - "pkladiesla", "pkladies", NULL, NULL, "1989", - "Poker Ladies (Leprechaun ver. 401)\0", NULL, "Leprechaun", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAHJONG, 0, - NULL, PkladieslaRomInfo, PkladieslaRomName, NULL, NULL, PkladiesInputInfo, NULL, - PkladiesInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDokaben = { - "dokaben", NULL, NULL, NULL, "1989", - "Dokaben (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, DokabenRomInfo, DokabenRomName, NULL, NULL, PangInputInfo, NULL, - DokabenInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPang = { - "pang", NULL, NULL, NULL, "1989", - "Pang (World)\0", NULL, "Mitchell", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, PangRomInfo, PangRomName, NULL, NULL, PangInputInfo, NULL, - PangInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBbros = { - "bbros", "pang", NULL, NULL, "1989", - "Buster Bros. (USA)\0", NULL, "Mitchell (Capcom license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, BbrosRomInfo, BbrosRomName, NULL, NULL, PangInputInfo, NULL, - PangInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPompingw = { - "pompingw", "pang", NULL, NULL, "1989", - "Pomping World (Japan)\0", NULL, "Mitchell", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, PompingwRomInfo, PompingwRomName, NULL, NULL, PangInputInfo, NULL, - PangInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPangb = { - "pangb", "pang", NULL, NULL, "1989", - "Pang (bootleg, set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, PangbRomInfo, PangbRomName, NULL, NULL, PangInputInfo, NULL, - PangbInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPangbold = { - "pangbold", "pang", NULL, NULL, "1989", - "Pang (bootleg, set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, PangboldRomInfo, PangboldRomName, NULL, NULL, PangInputInfo, NULL, - PangboldInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPangbold2 = { - "pangbold2", "pang", NULL, NULL, "1990", - "Pang (bootleg, set 5)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, Pangbold2RomInfo, Pangbold2RomName, NULL, NULL, PangInputInfo, NULL, - PangboldInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPangbold3 = { - "pangbold3", "pang", NULL, NULL, "1989", - "Pang (bootleg, set 6)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, Pangbold3RomInfo, Pangbold3RomName, NULL, NULL, PangInputInfo, NULL, - PangboldInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPangb2 = { - "pangb2", "pang", NULL, NULL, "1989", - "Pang (bootleg, set 4)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, Pangb2RomInfo, Pangb2RomName, NULL, NULL, PangInputInfo, NULL, - Pangb2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvCworld = { - "cworld", NULL, NULL, NULL, "1990", - "Capcom World (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, CworldRomInfo, CworldRomName, NULL, NULL, Qtono1InputInfo, NULL, - CworldInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvHatena = { - "hatena", NULL, NULL, NULL, "1990", - "Adventure Quiz 2 - Hatena? no Daibouken (Japan 900228)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, HatenaRomInfo, HatenaRomName, NULL, NULL, Qtono1InputInfo, NULL, - HatenaInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSpang = { - "spang", NULL, NULL, NULL, "1990", - "Super Pang (World 900914)\0", NULL, "Mitchell", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, SpangRomInfo, SpangRomName, NULL, NULL, PangInputInfo, NULL, - SpangInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSpangj = { - "spangj", "spang", NULL, NULL, "1990", - "Super Pang (Japan 901023)\0", NULL, "Mitchell", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, SpangjRomInfo, SpangjRomName, NULL, NULL, PangInputInfo, NULL, - SpangjInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSbbros = { - "sbbros", "spang", NULL, NULL, "1990", - "Super Buster Bros. (USA 901001)\0", NULL, "Mitchell (Capcom license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, SbbrosRomInfo, SbbrosRomName, NULL, NULL, PangInputInfo, NULL, - SbbrosInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMstworld = { - "mstworld", NULL, NULL, NULL, "1994", - "Monsters World (bootleg of Super Pang)\0", NULL, "bootleg (TCH)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, MstworldRomInfo, MstworldRomName, NULL, NULL, MstworldInputInfo, MstworldDIPInfo, - MstworldInit, CommonExit, MstworldFrame, NULL, MstworldScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMarukin = { - "marukin", NULL, NULL, NULL, "1990", - "Super Marukin-Ban (Japan 901017)\0", NULL, "Yuga", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_MAHJONG, 0, - NULL, MarukinRomInfo, MarukinRomName, NULL, NULL, MarukinInputInfo, NULL, - MarukinInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvQtono1 = { - "qtono1", NULL, NULL, NULL, "1991", - "Quiz Tonosama no Yabou (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, Qtono1RomInfo, Qtono1RomName, NULL, NULL, Qtono1InputInfo, NULL, - Qtono1Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvQsangoku = { - "qsangoku", NULL, NULL, NULL, "1991", - "Quiz Sangokushi (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, QsangokuRomInfo, QsangokuRomName, NULL, NULL, Qtono1InputInfo, NULL, - QsangokuInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBlock = { - "block", NULL, NULL, NULL, "1991", - "Block Block (World 911219 Joystick)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_BREAKOUT, 0, - NULL, BlockRomInfo, BlockRomName, NULL, NULL, BlockjoyInputInfo, NULL, - BlockjoyInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvBlockr1 = { - "blockr1", "block", NULL, NULL, "1991", - "Block Block (World 911106 Joystick)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_BREAKOUT, 0, - NULL, Blockr1RomInfo, Blockr1RomName, NULL, NULL, BlockjoyInputInfo, NULL, - BlockjoyInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvBlockr2 = { - "blockr2", "block", NULL, NULL, "1991", - "Block Block (World 910910)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_BREAKOUT, 0, - NULL, Blockr2RomInfo, Blockr2RomName, NULL, NULL, BlockInputInfo, NULL, - BlockInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvBlockj = { - "blockj", "block", NULL, NULL, "1991", - "Block Block (Japan 910910)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_BREAKOUT, 0, - NULL, BlockjRomInfo, BlockjRomName, NULL, NULL, BlockInputInfo, NULL, - BlockInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 240, 384, 3, 4 -}; - -struct BurnDriver BurnDrvBlockbl = { - "blockbl", "block", NULL, NULL, "1991", - "Block Block (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_BREAKOUT, 0, - NULL, BlockblRomInfo, BlockblRomName, NULL, NULL, BlockInputInfo, NULL, - BlockblInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 240, 384, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_mole.cpp b/jan/src/burn/drv/pre90s/d_mole.cpp deleted file mode 100644 index 06c2efcb3..000000000 --- a/jan/src/burn/drv/pre90s/d_mole.cpp +++ /dev/null @@ -1,481 +0,0 @@ -// Mole Attack FB Driver Module -// Based on MAME driver by Jason Nelson and Phil Stroffolino - -#include "burnint.h" -#include "m6502_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - - -//-------------------------------------------------------------------------------------- -// Variables - - -static UINT8 *Mem, *Rom, *Gfx, *BankRam; -static UINT8 DrvJoy1[12], DrvJoy2[12], DrvReset, DrvDips; -static INT32 *Palette; -static INT16 *pAY8910Buffer[3], *pFMBuffer = NULL; - -static INT32 tile_bank, flipscreen; - - -//-------------------------------------------------------------------------------------- -// Inputs - -// buttons are laid out as follows: -// 7 8 9 -// 4 5 6 -// 1 2 3 - - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1" , BIT_DIGITAL, DrvJoy1 + 9, "p1 coin" }, - {"Start 1" , BIT_DIGITAL, DrvJoy1 + 10, "p1 start" }, - {"Start 2" , BIT_DIGITAL, DrvJoy2 + 10, "p2 start" }, - {"P1 button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1", }, - {"P1 button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2", }, - {"P1 button 3", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 3", }, - {"P1 button 4", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 4", }, - {"P1 button 5", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 5", }, - {"P1 button 6", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 6", }, - {"P1 button 7", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 7", }, - {"P1 button 8", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 8", }, - {"P1 button 9", BIT_DIGITAL, DrvJoy1 + 8, "p1 fire 9", }, - - {"P2 button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1", }, - {"P2 button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2", }, - {"P2 button 3", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 3", }, - {"P2 button 4", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 4", }, - {"P2 button 5", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 5", }, - {"P2 button 6", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 6", }, - {"P2 button 7", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 7", }, - {"P2 button 8", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 8", }, - {"P2 button 9", BIT_DIGITAL, DrvJoy2 + 8, "p2 fire 9", }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, &DrvDips, "dip" }, -}; - -STDINPUTINFO(Drv) - - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2 , "Passing Points" }, - {0x16, 0x01, 0x01, 0x00, "300" }, - {0x16, 0x01, 0x01, 0x01, "400" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x16, 0x01, 0x02, 0x00, "1 Coin 1 Play" }, - {0x16, 0x01, 0x02, 0x02, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x16, 0x01, 0x10, 0x00, "Upright" }, - {0x16, 0x01, 0x10, 0x10, "Cocktail" }, -}; - -STDDIPINFO(Drv) - - -//-------------------------------------------------------------------------------------- -// Memory handling - - -static UINT8 mole_protection_r(UINT8 offset) -{ - switch (offset) - { - case 0x08: // random mole placement - return 0xb0; - - case 0x26: - if (M6502GetPC(0) == 0x53d7) - { - return 0x06; // bonus round - } - else // pc == 0x515b, 0x5162 - { - return 0xc6; // game start - } - - case 0x86: // game over - return 0x91; - - case 0xae: // coinage - return 0x32; - } - - return 0x00; -} - -void mole_write_byte(UINT16 address, UINT8 data) -{ - // Tile RAM - if (address >= 0x8000 && address <= 0x83ff) - { - BankRam[address & 0x3ff] = tile_bank; - Rom[address] = data; - return; - } - - switch (address) - { - case 0x0800: // ? - case 0x0820: - case 0x8c40: - case 0x8c80: - case 0x8c81: - break; - - case 0x8400: - tile_bank = data; - break; - - case 0x8c00: // ay8910_write_port - case 0x8c01: // ay8910_control_port - AY8910Write(0, ~address & 1, data); - break; - - case 0x8d00: // watchdog - break; - - case 0x8dc0: // flipscreen - flipscreen = data & 1; - break; - } - - if (address <= 0x3ff) { - Rom[address] = data; - } -} - -UINT8 mole_read_byte(UINT16 address) -{ - UINT8 ret = 0; - - switch (address) - { - case 0x8d00: // input port 0 - return DrvDips & 0x03; - - case 0x8d40: // input port 1 - { - for (INT32 i = 0; i < 8; i++) - ret |= DrvJoy1[i] << i; - - return ret; - } - - case 0x8d80: // input port 2 - { - ret |= DrvJoy1[8]; - ret |= DrvJoy2[0] << 1; - ret |= DrvJoy2[1] << 2; - ret |= DrvJoy2[2] << 3; - ret |= DrvDips & 0x10; - ret |= DrvJoy2[10] << 5; - ret |= DrvJoy1[10] << 6; - ret |= DrvJoy1[ 9] << 7; - - return ret; - } - - case 0x8dc0: // input port 3 - { - ret |= DrvJoy2[7]; - ret |= DrvJoy2[6] << 1; - ret |= DrvJoy2[3] << 2; - ret |= DrvJoy2[8] << 3; - ret |= DrvJoy2[5] << 4; - ret |= DrvJoy2[4] << 5; - - return ret; - } - } - - // Protection read - if (address >= 0x800 && address <= 0x8ff) - { - return mole_protection_r(address & 0xff); - } - - if (address <= 0x3ff) { - return Rom[address]; - } - - return 0; -} - - -//-------------------------------------------------------------------------------------- -// Initilizing functions - - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (Rom + 0x0000, 0, 0x0400); - memset (Rom + 0x8000, 0, 0x0400); - memset (BankRam, 0, 0x0400); - - tile_bank = 0; - flipscreen = 0; - - M6502Open(0); - M6502Reset(); - M6502Close(); - - AY8910Reset(0); - - return 0; -} - -static void mole_palette_init() -{ - for (INT32 i = 0; i < 8; i++) { - Palette[i] |= (i & 1) ? 0xff0000 : 0; - Palette[i] |= (i & 4) ? 0x00ff00 : 0; - Palette[i] |= (i & 2) ? 0x0000ff : 0; - } - -} - -static INT32 mole_gfx_convert() -{ - UINT8 a, b, c; - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, Gfx, 0x6000); - - for (INT32 i = 0; i < 0x8000; i++) - { - a = (tmp[0x0000 + (i >> 3)] >> (i & 7)) & 1; - b = (tmp[0x1000 + (i >> 3)] >> (i & 7)) & 1; - c = (tmp[0x2000 + (i >> 3)] >> (i & 7)) & 1; - - Gfx[0x0007 ^ i] = (a << 2) | (b << 1) | c; - - a = (tmp[0x3000 + (i >> 3)] >> (i & 7)) & 1; - b = (tmp[0x4000 + (i >> 3)] >> (i & 7)) & 1; - c = (tmp[0x5000 + (i >> 3)] >> (i & 7)) & 1; - - Gfx[0x8007 ^ i] = (a << 2) | (b << 1) | c; - } - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - Mem = (UINT8*)BurnMalloc(0x10000 + 0x10000 + 0x400 + (0x20 * sizeof(INT32))); - if (Mem == NULL) { - return 1; - } - - pFMBuffer = (INT16 *)BurnMalloc(nBurnSoundLen * 3 * sizeof(INT16)); - if (pFMBuffer == NULL) { - return 1; - } - - memset (Mem, 0, 0x20420); - - Rom = Mem + 0x00000; - Gfx = Mem + 0x10000; - BankRam = Mem + 0x20000; - Palette = (INT32 *)(Mem + 0x20400); - - { - BurnLoadRom(Rom + 0x5000, 0, 1); - BurnLoadRom(Rom + 0x6000, 1, 1); - BurnLoadRom(Rom + 0x7000, 2, 1); - - BurnLoadRom(Gfx + 0x0000, 3, 1); - BurnLoadRom(Gfx + 0x1000, 4, 1); - BurnLoadRom(Gfx + 0x2000, 5, 1); - BurnLoadRom(Gfx + 0x3000, 6, 1); - BurnLoadRom(Gfx + 0x4000, 7, 1); - BurnLoadRom(Gfx + 0x5000, 8, 1); - } - - mole_gfx_convert(); - mole_palette_init(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Rom + 0x0000, 0x0000, 0x03ff, MAP_RAM); // Rom - M6502MapMemory(Rom + 0x5000, 0x5000, 0x7fff, MAP_ROM); // Rom - M6502MapMemory(Rom + 0x5000, 0xd000, 0xffff, MAP_ROM); // Rom Mirror - M6502SetReadHandler(mole_read_byte); - M6502SetWriteHandler(mole_write_byte); - M6502SetReadOpHandler(mole_read_byte); - M6502SetReadOpArgHandler(mole_read_byte); - M6502Close(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - M6502Exit(); - AY8910Exit(0); - - BurnFree (Mem); - BurnFree (pFMBuffer); - - return 0; -} - - -//-------------------------------------------------------------------------------------- -// Drawing functions - - -static INT32 DrvDraw() -{ - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sy = ((offs / 40) % 25) << 3; - INT32 sx = (offs % 40) << 3; - - INT32 code = ((BankRam[offs] & 3) << 14) | ((Rom[0x8000 + offs]) << 6); - - UINT8 *gfxsrc = Gfx + code; - - for (INT32 y = sy; y < sy + 8; y++) - { - for (INT32 x = sx; x < sx + 8; x++, gfxsrc++) - { - INT32 pxl = Palette[*gfxsrc]; - - INT32 pos; - - if (flipscreen) - pos = (199 - y) * 320 + (319 - x); - else - pos = y * 320 + x; - - PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0)); - } - } - } - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6502Open(0); - M6502Run(4000000 / 60); - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_AUTO); - M6502Close(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -//-------------------------------------------------------------------------------------- -// Savestates - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - - ba.Data = Rom + 0x0000; - ba.nLen = 0x0400; - ba.szName = "Work Ram"; - BurnAcb(&ba); - - ba.Data = Rom + 0x8000; - ba.nLen = 0x0400; - ba.szName = "Video Ram"; - BurnAcb(&ba); - - ba.Data = BankRam; - ba.nLen = 0x0400; - ba.szName = "Bank Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); // Scan m6502 - AY8910Scan(nAction, pnMin); // Scan AY8910 - - // Scan critical driver variables - SCAN_VAR(tile_bank); - SCAN_VAR(flipscreen); - } - - return 0; -} - - -//-------------------------------------------------------------------------------------- -// Game drivers - - -// Mole Attack - -static struct BurnRomInfo moleRomDesc[] = { - { "m3a.5h", 0x1000, 0x5fbbdfef, 1 | BRF_ESS | BRF_PRG }, // 0 M6502 Code - { "m2a.7h", 0x1000, 0xf2a90642, 1 | BRF_ESS | BRF_PRG }, // 1 - { "m1a.8h", 0x1000, 0xcff0119a, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "mea.4a", 0x1000, 0x49d89116, 2 | BRF_GRA }, // 3 Graphics tiles - { "mca.6a", 0x1000, 0x04e90300, 2 | BRF_GRA }, // 4 - { "maa.9a", 0x1000, 0x6ce9442b, 2 | BRF_GRA }, // 5 - { "mfa.3a", 0x1000, 0x0d0c7d13, 2 | BRF_GRA }, // 6 - { "mda.5a", 0x1000, 0x41ae1842, 2 | BRF_GRA }, // 7 - { "mba.8a", 0x1000, 0x50c43fc9, 2 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(mole) -STD_ROM_FN(mole) - -struct BurnDriver BurnDrvMole = { - "mole", NULL, NULL, NULL, "1982", - "Mole Attack\0", NULL, "Yachiyo Electronics, Ltd.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, moleRomInfo, moleRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x08, - 320, 200, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_momoko.cpp b/jan/src/burn/drv/pre90s/d_momoko.cpp deleted file mode 100644 index fb6e955fe..000000000 --- a/jan/src/burn/drv/pre90s/d_momoko.cpp +++ /dev/null @@ -1,896 +0,0 @@ -// FB Alpha Momoko 120% driver module -// Based on MAME driver by Uki - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "watchdog.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM1a; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvBankROM; -static UINT8 *DrvBgCPROM; -static UINT8 *DrvFgMPROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; - -static UINT8 *DrvTransTab[4]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *fg_scrolly; -static UINT8 *fg_scrollx; -static UINT8 *fg_select; -static UINT8 *tx_scrolly; -static UINT8 *tx_mode; -static UINT8 *bg_scrolly; -static UINT8 *bg_scrollx; -static UINT8 *bg_select; -static UINT8 *bg_priority; -static UINT8 *bg_bank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo MomokoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Momoko) - -static struct BurnDIPInfo MomokoDIPList[]= -{ - {0x10, 0xff, 0xff, 0x7f, NULL }, - {0x11, 0xff, 0xff, 0xef, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x03, "3" }, - {0x10, 0x01, 0x03, 0x02, "4" }, - {0x10, 0x01, 0x03, 0x01, "5" }, - {0x10, 0x01, 0x03, 0x00, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x10, 0x01, 0x1c, 0x10, "5 Coins 1 Credits" }, - {0x10, 0x01, 0x1c, 0x14, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x1c, 0x04, "2 Coins 5 Credits" }, - {0x10, 0x01, 0x1c, 0x08, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x60, 0x40, "Easy" }, - {0x10, 0x01, 0x60, 0x60, "Normal" }, - {0x10, 0x01, 0x60, 0x20, "Hard" }, - {0x10, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x03, 0x01, "20k" }, - {0x11, 0x01, 0x03, 0x03, "30k" }, - {0x11, 0x01, 0x03, 0x02, "50k" }, - {0x11, 0x01, 0x03, 0x00, "100k" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x11, 0x01, 0x10, 0x00, "Upright" }, -// {0x11, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen (Fake)" }, -// {0x12, 0x01, 0x01, 0x00, "Off" }, -// {0x12, 0x01, 0x01, 0x01, "On" }, -}; - -STDDIPINFO(Momoko) - -static inline void palette_write(UINT16 offset) -{ - INT32 r = DrvPalRAM[offset + 0] & 0x0f; - INT32 g = DrvPalRAM[offset + 1] >> 4; - INT32 b = DrvPalRAM[offset + 1] & 0x0f; - - DrvPalette[offset/2] = BurnHighCol(r + (r * 16), g + (g * 16), b + (b * 16), 0); -} - -static void bankswitch(INT32 data) -{ - *bg_bank = data; - - ZetMapMemory(DrvBankROM + (data & 0x1f) * 0x1000, 0xf000, 0xffff, MAP_ROM); -} - -void __fastcall momoko_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xd800) { - DrvPalRAM[(address & 0x3ff)] = data; - palette_write(address & 0x3fe); - return; - } - - switch (address) - { - case 0xd402: - *flipscreen = data & 0x01; - return; - - case 0xd404: - BurnWatchogWrite(); - return; - - case 0xd406: - *soundlatch = data; - return; - - case 0xdc00: - *fg_scrolly = data; - return; - - case 0xdc01: - *fg_scrollx = data; - return; - - case 0xdc02: - *fg_select = data; - return; - - case 0xe800: - *tx_scrolly = data; - return; - - case 0xe801: - *tx_mode = data; - return; - - case 0xf000: - case 0xf001: - bg_scrolly[address & 1] = data; - return; - - case 0xf002: - case 0xf003: - bg_scrollx[address & 1] = data; - return; - - case 0xf004: - bankswitch(data); - return; - - case 0xf006: - *bg_select = data; - return; - - case 0xf007: - *bg_priority = data & 0x01; - return; - } -} - -UINT8 __fastcall momoko_main_read(UINT16 address) -{ - switch (address) - { - case 0xd400: - return DrvInputs[0]; - - case 0xd402: - return DrvInputs[1]; - - case 0xd406: - return (DrvInputs[2] & 0x80) | (DrvDips[0] & 0x7f); - - case 0xd407: - return DrvDips[1]; - } - - return 0; -} - -void __fastcall momoko_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xc000: - case 0xc001: - BurnYM2203Write(1, address & 1, data); - return; - } -} - -UINT8 __fastcall momoko_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - case 0xa001: - return BurnYM2203Read(0, address & 1); - - case 0xc000: - case 0xc001: - return BurnYM2203Read(1, address & 1); - } - - return 0; -} - -static UINT8 momoko_sound_read_port_A(UINT32) -{ - return *soundlatch; -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 2500000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 2500000.0; -} - -static INT32 DrvDoReset(INT32 clear) -{ - if (clear) { - memset(AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - - BurnWatchdogReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x00c000; - DrvZ80ROM1 = Next; Next += 0x008000; - - DrvBankROM = Next; Next += 0x020000; - DrvBgCPROM = Next; Next += 0x002000; - DrvFgMPROM = Next; Next += 0x004000; - DrvColPROM = Next; Next += 0x000120; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM1a = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x008000; - DrvGfxROM3 = Next; Next += 0x040000; - - DrvTransTab[0] = Next; Next += 0x008000 / 0x08; - DrvTransTab[1] = Next; Next += 0x000200; - DrvTransTab[2] = Next; Next += 0x008000 / 0x40; - DrvTransTab[3] = Next; Next += 0x040000 / 0x80; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x000100; - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - fg_scrolly = Next; Next += 0x000001; - fg_scrollx = Next; Next += 0x000001; - fg_select = Next; Next += 0x000001; - tx_scrolly = Next; Next += 0x000001; - tx_mode = Next; Next += 0x000001; - bg_scrolly = Next; Next += 0x000002; - bg_scrollx = Next; Next += 0x000002; - bg_select = Next; Next += 0x000001; - bg_priority = Next; Next += 0x000001; - bg_bank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Planes[4] = { 4,0,12,8 }; - INT32 XOffs0[8] = { STEP4(0,1), STEP4(256*8*8,1) }; - INT32 YOffs0[8] = { STEP8(0, 8) }; - INT32 XOffs1[8] = { STEP4(0,1), STEP4(4096*8,1) }; - INT32 YOffs1[16] = { STEP16(0, 16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x02000); - - GfxDecode(0x0200, 2, 8, 8, Planes, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (DrvGfxROM1a, DrvGfxROM1, 0x20000); - - GfxDecode(0x2000, 4, 8, 8, Planes, XOffs1, YOffs1, 0x080, DrvGfxROM1a, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x02000); - - GfxDecode(0x0800, 2, 8, 1, Planes, XOffs0, YOffs0, 0x008, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x10000); - - GfxDecode(0x0800, 4, 8, 16, Planes, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM3); - - BurnFree(tmp); - - return 0; -} - -static void DrvFillTransTab(INT32 tab, UINT8 *gfx, INT32 len, INT32 size) -{ - memset (DrvTransTab[tab], 1, len / size); - - for (INT32 i = 0; i < len; i+= size) { - for (INT32 j = 0; j < size; j++) { - if (gfx[i+j]) { - DrvTransTab[tab][i/size] = 0; - break; - } - } - } -} - -static void DrvFillTransMask() -{ - for (INT32 i = 0x100; i < 0x200; i+=0x10) { - memset (DrvTransTab[1] + i + 8, 0xff, 8); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10001, 10, 2)) return 1; - - if (BurnLoadRom(DrvBankROM + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvBankROM + 0x08000, 12, 1)) return 1; - if (BurnLoadRom(DrvBankROM + 0x10000, 13, 1)) return 1; - if (BurnLoadRom(DrvBankROM + 0x18000, 14, 1)) return 1; - - if (BurnLoadRom(DrvBgCPROM + 0x00000, 15, 1)) return 1; - - if (BurnLoadRom(DrvFgMPROM + 0x00000, 16, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 18, 1)) return 1; - - if (DrvGfxDecode()) return 1; - - DrvFillTransTab(0, DrvGfxROM0, 0x008000, 0x08); - DrvFillTransTab(3, DrvGfxROM3, 0x040000, 0x80); - DrvFillTransTab(2, DrvGfxROM2, 0x008000, 0x40); - DrvFillTransMask(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xd0ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd800, 0xdbff, MAP_ROM); // write through handler - ZetMapMemory(DrvVidRAM, 0xe000, 0xe3ff, MAP_RAM); - ZetSetWriteHandler(momoko_main_write); - ZetSetReadHandler(momoko_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(momoko_sound_write); - ZetSetReadHandler(momoko_sound_read); - ZetClose(); - - BurnWatchdogInit(DrvDoReset, 180); - - BurnYM2203Init(2, 1250000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(1, momoko_sound_read_port_A, NULL, NULL, NULL); - BurnTimerAttachZet(2500000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnYM2203Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_bg_layer(int pri) -{ - INT32 dx = ~bg_scrollx[0] & 7; - INT32 dy = ~bg_scrolly[0] & 7; - INT32 rx = (bg_scrollx[0] + bg_scrollx[1] * 256) >> 3; - INT32 ry = (bg_scrolly[0] + bg_scrolly[1] * 256) >> 3; - INT32 bank = (*bg_select & 0x0f) * 0x200; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f); - INT32 sy = (offs / 0x20); - - INT32 ofst = (((ry + sy + 2) & 0x3ff) << 7) + ((rx + sx) & 0x7f); - INT32 code = DrvBankROM[ofst] + bank; - INT32 color = DrvBgCPROM[code + (*bg_priority * 0x100)] & 0x1f; - - if ((color & 0x10) == pri && !pri) continue; - - sx = (sx * 8) + dx - 6; - sy = (sy * 8) + dy + 9 - 16; - - if (pri) { - Render8x8Tile_Clip(pTransDraw, code, sx - 8, sy, color&0x0f, 4, 0x100, DrvGfxROM1); - } else { - RenderTileTranstab(pTransDraw, DrvGfxROM1, code, ((color&0x0f)<<4)+0x100, 0, sx - 8, sy, 0, 0, 8, 8, DrvTransTab[1]); - } - } -} - -static void draw_fg_layer() -{ - INT32 dx = ~*fg_scrollx & 7; - INT32 dy = ~*fg_scrolly & 7; - INT32 rx = (*fg_scrollx) >> 3; - INT32 ry = (*fg_scrolly) >> 3; - INT32 bank = (*fg_select & 0x03) * 0x800; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f); - INT32 sy = (offs / 0x20); - - INT32 ofst = ((ry + sy + 34) & 0x3f) * 0x20 + ((rx + sx) & 0x1f) + bank; - INT32 code = DrvFgMPROM[ofst]; - - sx = (sx * 8) + dx - 6; - sy = (sy * 8) + dy + 9 - 16; - - if (DrvTransTab[2][code]) continue; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 2, 0, 0, DrvGfxROM2); - } -} - -static void draw_txt_layer() -{ - for (INT32 offs = 16 * 32; offs < 240 * 32; offs++) - { - INT32 color; - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20); - - if (tx_mode) - { - if ((DrvColPROM[sy] & 0xf8) == 0) sy -= *tx_scrolly; - - color = (DrvColPROM[sy] & 0x07) | 0x10; - } - else - { - color = DrvColPROM[(sy >> 3) + 0x100] & 0x0f; - } - - INT32 code = DrvVidRAM[((sy >> 3) << 5) | (sx >> 3)] * 8 + (sy & 7); - - if (DrvTransTab[0][code]) continue; - - RenderCustomTile_Mask_Clip(pTransDraw, 8, 1, code, sx - 8, sy - 16, color, 2, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites(INT32 start, INT32 end) -{ - UINT8 *sprite_ram = DrvSprRAM + 0x64; - - for (INT32 offs = start; offs < end; offs += 4) - { - INT32 sy = 239 - sprite_ram[offs + 0] - 16; - INT32 code = sprite_ram[offs + 1] | ((sprite_ram[offs + 2] & 0x60) << 3); - code = ((code & 0x380) << 1) | (code & 0x7f); - INT32 color = sprite_ram[offs + 2] & 0x07; - INT32 flipy = sprite_ram[offs + 2] & 0x08; - INT32 flipx = sprite_ram[offs + 2] & 0x10; - INT32 sx = sprite_ram[offs + 3] - 8; - - if (DrvTransTab[3][code]) continue; - - if (flipy) { - if (!flipx) { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0x80, DrvGfxROM3); - } else { - RenderCustomTile_Mask_FlipY_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0x80, DrvGfxROM3); - } - } else { - if (!flipx) { - RenderCustomTile_Mask_FlipX_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0x80, DrvGfxROM3); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 8, 16, code, sx, sy, color, 4, 0, 0x80, DrvGfxROM3); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i+=2) { - palette_write(i); - } - - DrvRecalc = 0; - } - - BurnTransferClear(); - - if ((*bg_select & 0x10) == 0) - { - if (nBurnLayer & 1) draw_bg_layer(0x10); - } - else - { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x100; - } - } - - draw_sprites(0, 0x24); - - if ((*bg_select & 0x10) == 0) - { - draw_bg_layer(0); - } - - draw_sprites(0x24, 0x100-0x64); - - draw_txt_layer(); - - if ((*fg_select & 0x10) == 0) - { - draw_fg_layer(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - BurnWatchdogUpdate(); - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3 * sizeof(UINT8)); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nCycleSegment; - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 5000000 / 60, 2500000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCycleSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCycleSegment); - if (i == 66) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - nCycleSegment = nCyclesTotal[1] / nInterleave; - - ZetOpen(1); - BurnTimerUpdate(i * nCycleSegment); - nCyclesDone[1] += nCycleSegment; - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - BurnWatchdogScan(nAction); - } - - if (nAction & ACB_WRITE) - { - ZetOpen(0); - bankswitch(*bg_bank); - ZetClose(); - - DrvRecalc = 1; - } - - return 0; -} - - -// Momoko 120% (Japanese text) - -static struct BurnRomInfo momokoRomDesc[] = { - { "momoko03.m6", 0x8000, 0x386e26ed, 0x01 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "momoko02.m5", 0x4000, 0x4255e351, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "momoko01.u4", 0x8000, 0xe8a6673c, 0x02 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "momoko13.u4", 0x2000, 0x2745cf5a, 0x03 | BRF_GRA }, // 3 Character Tiles - - { "momoko14.p2", 0x2000, 0xcfccca05, 0x04 | BRF_GRA }, // 4 Foreground Tiles - - { "momoko16.e5", 0x8000, 0xfc6876fc, 0x05 | BRF_GRA }, // 5 Sprite Tiles - { "momoko17.e6", 0x8000, 0x45dc0247, 0x05 | BRF_GRA }, // 6 - - { "momoko09.e8", 0x8000, 0x9f5847c7, 0x06 | BRF_GRA }, // 7 Background Tiles - { "momoko11.c8", 0x8000, 0x9c9fbd43, 0x06 | BRF_GRA }, // 8 - { "momoko10.d8", 0x8000, 0xae17e74b, 0x06 | BRF_GRA }, // 9 - { "momoko12.a8", 0x8000, 0x1e29c9c4, 0x06 | BRF_GRA }, // 10 - - { "momoko04.r8", 0x8000, 0x3ab3c2c3, 0x07 | BRF_GRA }, // 11 Background Map (Banks used by Z80 #0) - { "momoko05.p8", 0x8000, 0x757cdd2b, 0x07 | BRF_GRA }, // 12 - { "momoko06.n8", 0x8000, 0x20cacf8b, 0x07 | BRF_GRA }, // 13 - { "momoko07.l8", 0x8000, 0xb94b38db, 0x07 | BRF_GRA }, // 14 - - { "momoko08.h8", 0x2000, 0x69b41702, 0x08 | BRF_GRA }, // 15 Background Color/Priority Table - - { "momoko15.k2", 0x4000, 0x8028f806, 0x09 | BRF_GRA }, // 16 Foreground Map - - { "momoko-c.bin", 0x0100, 0xf35ccae0, 0x0a | BRF_GRA }, // 17 Text Layer Color PROMs - { "momoko-b.bin", 0x0020, 0x427b0e5c, 0x0a | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(momoko) -STD_ROM_FN(momoko) - -struct BurnDriver BurnDrvMomoko = { - "momoko", NULL, NULL, NULL, "1986", - "Momoko 120% (Japanese text)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, momokoRomInfo, momokoRomName, NULL, NULL, MomokoInputInfo, MomokoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 240, 224, 4, 3 -}; - - -// Momoko 120% (English text) - -static struct BurnRomInfo momokoeRomDesc[] = { - { "3.m6", 0x8000, 0x84053a7d, 0x01 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.m5", 0x4000, 0x98ad397b, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "momoko01.u4", 0x8000, 0xe8a6673c, 0x02 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "momoko13.u4", 0x2000, 0x2745cf5a, 0x03 | BRF_GRA }, // 3 Character Tiles - - { "momoko14.p2", 0x2000, 0xcfccca05, 0x04 | BRF_GRA }, // 4 Foreground Tiles - - { "momoko16.e5", 0x8000, 0xfc6876fc, 0x05 | BRF_GRA }, // 5 Sprite Tiles - { "momoko17.e6", 0x8000, 0x45dc0247, 0x05 | BRF_GRA }, // 6 - - { "momoko09.e8", 0x8000, 0x9f5847c7, 0x06 | BRF_GRA }, // 7 Background Tiles - { "momoko11.c8", 0x8000, 0x9c9fbd43, 0x06 | BRF_GRA }, // 8 - { "momoko10.d8", 0x8000, 0xae17e74b, 0x06 | BRF_GRA }, // 9 - { "momoko12.a8", 0x8000, 0x1e29c9c4, 0x06 | BRF_GRA }, // 10 - - { "momoko04.r8", 0x8000, 0x3ab3c2c3, 0x07 | BRF_GRA }, // 11 Background Map (Banks used by Z80 #0) - { "momoko05.p8", 0x8000, 0x757cdd2b, 0x07 | BRF_GRA }, // 12 - { "momoko06.n8", 0x8000, 0x20cacf8b, 0x07 | BRF_GRA }, // 13 - { "momoko07.l8", 0x8000, 0xb94b38db, 0x07 | BRF_GRA }, // 14 - - { "momoko08.h8", 0x2000, 0x69b41702, 0x08 | BRF_GRA }, // 15 Background Color/Priority Table - - { "momoko15.k2", 0x4000, 0x8028f806, 0x09 | BRF_GRA }, // 16 Foreground Map - - { "momoko-c.bin", 0x0100, 0xf35ccae0, 0x0a | BRF_GRA }, // 17 Text Layer Color PROMs - { "momoko-b.bin", 0x0020, 0x427b0e5c, 0x0a | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(momokoe) -STD_ROM_FN(momokoe) - -struct BurnDriver BurnDrvMomokoe = { - "momokoe", "momoko", NULL, NULL, "1986", - "Momoko 120% (English text)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, momokoeRomInfo, momokoeRomName, NULL, NULL, MomokoInputInfo, MomokoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 240, 224, 4, 3 -}; - - -// Momoko 120% (bootleg) -// bootleg board, almost exact copy of an original one - -static struct BurnRomInfo momokobRomDesc[] = { - { "3.bin", 0x8000, 0xa18d7e78, 0x01 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.bin", 0x4000, 0x2dcf50ed, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "momoko01.u4", 0x8000, 0xe8a6673c, 0x02 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "momoko13.u4", 0x2000, 0x2745cf5a, 0x03 | BRF_GRA }, // 3 Character Tiles - - { "momoko14.p2", 0x2000, 0xcfccca05, 0x04 | BRF_GRA }, // 4 Foreground Tiles - - { "16.bin", 0x8000, 0x49de49a1, 0x05 | BRF_GRA }, // 5 Sprite Tiles - { "17.bin", 0x8000, 0xf06a3d1a, 0x05 | BRF_GRA }, // 6 - - { "momoko09.e8", 0x8000, 0x9f5847c7, 0x06 | BRF_GRA }, // 7 Background Tiles - { "momoko11.c8", 0x8000, 0x9c9fbd43, 0x06 | BRF_GRA }, // 8 - { "10.bin", 0x8000, 0x68b9156d, 0x06 | BRF_GRA }, // 9 - { "12.bin", 0x8000, 0xc32f5e19, 0x06 | BRF_GRA }, // 10 - - { "4.bin", 0x8000, 0x1f0226d5, 0x07 | BRF_GRA }, // 11 Background Map (Banks used by Z80 #0) - { "momoko05.p8", 0x8000, 0x757cdd2b, 0x07 | BRF_GRA }, // 12 - { "momoko06.n8", 0x8000, 0x20cacf8b, 0x07 | BRF_GRA }, // 13 - { "momoko07.l8", 0x8000, 0xb94b38db, 0x07 | BRF_GRA }, // 14 - - { "momoko08.h8", 0x2000, 0x69b41702, 0x08 | BRF_GRA }, // 15 Background Color/Priority Table - - { "momoko15.k2", 0x4000, 0x8028f806, 0x09 | BRF_GRA }, // 16 Foreground Map - - { "momoko-c.bin", 0x0100, 0xf35ccae0, 0x0a | BRF_GRA }, // 17 Text Layer Color PROMs - { "momoko-b.bin", 0x0020, 0x427b0e5c, 0x0a | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(momokob) -STD_ROM_FN(momokob) - -struct BurnDriver BurnDrvMomokob = { - "momokob", "momoko", NULL, NULL, "1986", - "Momoko 120% (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, momokobRomInfo, momokobRomName, NULL, NULL, MomokoInputInfo, MomokoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 240, 224, 4, 3 -}; \ No newline at end of file diff --git a/jan/src/burn/drv/pre90s/d_mouser.cpp b/jan/src/burn/drv/pre90s/d_mouser.cpp deleted file mode 100644 index 3a7d76209..000000000 --- a/jan/src/burn/drv/pre90s/d_mouser.cpp +++ /dev/null @@ -1,598 +0,0 @@ -// Mouser for FBA, ported by vbt with help from dink -// Based on MAME driver by Frank Palazzolo -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -#include "bitswap.h" -extern "C" { - #include "ay8910.h" -} -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDip[2]; -static UINT8 DrvReset; -static UINT8 DrvRecalc; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvRAM; -static UINT8 *DrvMainROM; -static UINT8 *DrvDecROM; -static UINT8 *DrvSubROM; -static UINT8 *DrvSubRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT32 *DrvPalette; - -static UINT8 sound_byte; -static UINT8 nmi_enable; -static void DrvPaletteInit(); - -static struct BurnInputInfo MouserInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 6, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 7, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 5, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 7, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvJoy1 + 5,"dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Mouser) - - -static struct BurnDIPInfo MouserDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x20, NULL }, - {0x10, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0f, 0x01, 0x20, 0x00, "Normal" }, - {0x0f, 0x01, 0x20, 0x20, "Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x00, "3" }, - {0x10, 0x01, 0x03, 0x01, "4" }, - {0x10, 0x01, 0x03, 0x02, "5" }, - {0x10, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x0c, 0x00, "20000" }, - {0x10, 0x01, 0x0c, 0x04, "40000" }, - {0x10, 0x01, 0x0c, 0x08, "60000" }, - {0x10, 0x01, 0x0c, 0x0c, "80000" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x10, 0x01, 0x70, 0x70, "5 Coins 1 Credit" }, - {0x10, 0x01, 0x70, 0x50, "4 Coins 1 Credit" }, - {0x10, 0x01, 0x70, 0x30, "3 Coins 1 Credit" }, - {0x10, 0x01, 0x70, 0x10, "2 Coins 1 Credit" }, - {0x10, 0x01, 0x70, 0x00, "1 Coin 1 Credit" }, - {0x10, 0x01, 0x70, 0x20, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x70, 0x40, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x70, 0x60, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Mouser) - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - sound_byte = 0; - nmi_enable = 0; - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - return 0; -} - -static void DrawSprite(INT32 offs) -{ - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = 0xef - DrvSprRAM[offs + 2]; - - INT32 flipx = BIT(DrvSprRAM[offs], 6); - INT32 flipy = BIT(DrvSprRAM[offs], 7); - sy-=16; // screen offset - if (BIT(DrvSprRAM[offs+1], 4)) { - INT32 code = DrvSprRAM[offs] & 0x3f; - INT32 color = DrvSprRAM[offs + 1] % 16; - - if (sx < -7 || sy < -7 || sx >= nScreenWidth || sy >= nScreenHeight) return; - - if (flipy) - { - if (flipx) - { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1+(((DrvSprRAM[offs+1]&0x20)>>5)*16384)); - } - else - { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1+(((DrvSprRAM[offs+1]&0x20)>>5)*16384)); - } - } - else - { - if (flipx) - { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1+(((DrvSprRAM[offs+1]&0x20)>>5)*16384)); - } - else - { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1+(((DrvSprRAM[offs+1]&0x20)>>5)*16384)); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) - { - DrvPaletteInit(); - DrvRecalc = 0; - } - - /* for every character in the Video RAM, check if it has been modified */ - /* since last time and update it accordingly. */ - for (INT32 offs = 0x3ff;offs >= 0;offs--) - { - INT32 sx = (offs % 32)*8; - INT32 sy = (offs / 32)*8; - - sy = (256 + sy - DrvSprRAM[offs%32])%256; - sy -= 16; // screen offset - INT32 color_offs = offs % 32 + ((256 + 8 * (offs / 32) - DrvSprRAM[offs % 32] )% 256) / 8 * 32; - INT32 code = DrvVidRAM[offs] | (DrvColRAM[color_offs] >> 5) * 256 | ((DrvColRAM[color_offs] >> 4) & 1) * 512; - INT32 color = DrvColRAM[color_offs]%16; - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } - - for(INT32 offs = 0x0084; offs < 0x00A0; offs += 4) - { - DrawSprite(offs); - } - - /* This is the second set of 8 sprites */ - for(INT32 offs = 0x00C4; offs < 0x00E4; offs += 4) - { - DrawSprite(offs); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static UINT8 __fastcall mouser_sub_read(UINT16 address) -{ - if(address == 0x3000) { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return sound_byte; - } - - return 0; -} - -static void __fastcall mouser_sub_write(UINT16 address, UINT8 /*data*/) -{ - if(address == 0x4000) - ZetSetIRQLine(Z80_INPUT_LINE_NMI, CPU_IRQSTATUS_NONE); -} - -static UINT8 __fastcall mouser_main_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return DrvInputs[1]; - case 0xa800: - return DrvInputs[0]; - case 0xb000: - return DrvDip[1]; - case 0xb800: - return DrvInputs[2]; - break; - } - - return 0; -} - -static void __fastcall mouser_main_write(UINT16 address, UINT8 data) -{ - if(address >= 0x8800 && address <= 0x88ff) - { - return; - } - - switch (address) - { - case 0xa000: - nmi_enable = data; - return; - case 0xa001: - //mouser_flip_screen_x_w(); //AM_WRITE(mouser_flip_screen_x_w) - return; - case 0xa002: - //mouser_flip_screen_y_w(); //AM_WRITE(mouser_flip_screen_y_w) - return; - case 0xb800: - sound_byte = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0x00, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - } -} - -void __fastcall mouser_sub_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - AY8910Write(0, 1, data); - break; - - case 0x01: - AY8910Write(0, 0, data); - break; - - case 0x80: - AY8910Write(1, 1, data); - break; - - case 0x81: - AY8910Write(1, 0, data); - break; - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x10000; - DrvDecROM = Next; Next += 0x10000; - DrvSubROM = Next; Next += 0x10000; - DrvGfxROM0 = Next; Next += 0x10000; - DrvGfxROM1 = Next; Next += 0x10000; - DrvColPROM = Next; Next += 0x040; - DrvPalette = (UINT32*)Next; Next += 0x040 * sizeof(UINT32); - AllRam = Next; - DrvRAM = Next; Next += 0x3000; - DrvSubRAM = Next; Next += 0x2000; - DrvVidRAM = Next; Next += 0x800; - DrvSprRAM = Next; Next += 0x4FF; - DrvColRAM = Next; Next += 0x400; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Planes0[2] = { 1*8192*8, 0*8192*8 }; - INT32 XOffs0[8] = {0, 1, 2, 3, 4, 5, 6, 7}; - INT32 YOffs0[8] = {STEP8(0, 8)};//{8*0, 8*1, 8*2, 8*3, 8*4, 8*5, 8*6, 8*7}; - - INT32 Planes1[2] = { 1*8192*8, 0*8192*8 }; - INT32 XOffs1[16] = {0, 1, 2, 3, 4, 5, 6, 7, 64+0, 64+1, 64+2, 64+3, 64+4, 64+5, 64+6, 64+7}; - INT32 YOffs1[16] = {STEP8(0, 8), 128+8*0, 128+8*1, 128+8*2, 128+8*3, 128+8*4, 128+8*5, 128+8*6, 128+8*7}; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x0400, 2, 8, 8, Planes0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); // modulo 0x040 to verify !!! - GfxDecode(0x0040, 2, 16, 16, Planes1, XOffs1, YOffs1, 0x100, tmp+0x1000, DrvGfxROM1); // modulo 0x040 to verify !!! - GfxDecode(0x0040, 2, 16, 16, Planes1, XOffs1, YOffs1, 0x100, tmp+0x1800, DrvGfxROM1+(0x800*8)); // modulo 0x100 to verify !!! - - BurnFree (tmp); -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x40; i++) - { - INT32 bit0,bit1,bit2,r,g,b; - - /* red component */ - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* green component */ - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* blue component */ - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - b = 0x4f * bit0 + 0xa8 * bit1; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 MouserDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x200); - - if (BurnLoadRom(tmp + 0x00000, 6, 2)) return 1; // { "bprom.4b", 0x0100, 0xdd233851, 4 }, // 6 user1 - if (BurnLoadRom(tmp + 0x00001, 7, 2)) return 1; // { "bprom.4c", 0x0100, 0x60aaa686, 4 }, // 7 - - for (INT32 l = 0; l < 0x200; l+=2) - { - tmp[l/2] = (tmp[l+1] & 0x0f) | (tmp[l+0] << 4); - } - - for (INT32 i = 0; i < 0x10000; i++) - { - DrvDecROM[i] = tmp[DrvMainROM[i]]; - } - - BurnFree (tmp); - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - { - if (BurnLoadRom(DrvMainROM + 0x00000, 0, 1)) return 1; // { "m0.5e", 0x2000, 0xb56e00bc, 1 }, // 0 maincpu - if (BurnLoadRom(DrvMainROM + 0x02000, 1, 1)) return 1; // {"m1.5f", 0x2000, 0xae375d49, 1 } - if (BurnLoadRom(DrvMainROM + 0x04000, 2, 1)) return 1; // { "m2.5j", 0x2000, 0xef5817e4, 1 }, // 2 - if (BurnLoadRom(DrvSubROM + 0x00000, 3, 1)) return 1; // { "m5.3v", 0x1000, 0x50705eec, 2 }, // 3 audiocpu - // Gfx char + sprite - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; // { "m3.11h", 0x2000, 0xaca2834e, 3 }, // 4 gfx1 - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 5, 1)) return 1; // { "m4.11k", 0x2000, 0x943ab2e2, 3 }, // 5 - // Opcode Decryption PROMS - MouserDecode(); - // Palette - if (BurnLoadRom(DrvColPROM + 0x000000, 8, 1)) return 1; // { "bprom.5v", 0x0020, 0x7f8930b2, 5 }, // 8 proms - if (BurnLoadRom(DrvColPROM + 0x000020, 9, 1)) return 1; // { "bprom.5u", 0x0020, 0x0086feed, 5 }, // 9 - DrvPaletteInit(); - DrvGfxDecode(); - } - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 0, DrvMainROM); - ZetMapArea(0x0000, 0x5fff, 2, DrvDecROM, DrvMainROM); - ZetMapMemory(DrvRAM, 0x6000, 0x6bff, MAP_RAM);//AM_RANGE(0x6000, 0x6bff) AM_RAM - ZetMapMemory(DrvVidRAM, 0x9000, 0x93ff, MAP_RAM);//AM_RANGE(0x9000, 0x93ff) AM_RAM AM_SHARE("videoram") - ZetMapMemory(DrvSprRAM, 0x9800, 0x9cff, MAP_RAM);//AM_RANGE(0x9800, 0x9cff) AM_RAM AM_SHARE("spriteram") - ZetMapMemory(DrvColRAM, 0x9c00, 0x9fff, MAP_RAM);//AM_RANGE(0x9c00, 0x9fff) AM_RAM AM_SHARE("colorram") - ZetSetWriteHandler(mouser_main_write); - ZetSetReadHandler(mouser_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvSubROM, 0x0000, 0x1fff, MAP_ROM);//AM_RANGE(0x0000, 0x1fff) AM_ROM - ZetMapMemory(DrvSubRAM, 0x2000, 0x23ff, MAP_RAM);//AM_RANGE(0x2000, 0x23ff) AM_RAM - ZetSetWriteHandler(mouser_sub_write); - ZetSetReadHandler(mouser_sub_read); - ZetSetOutHandler(mouser_sub_out); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInputs, 0x00, 3); // DrvJoy1 = active low, 2, 3 = active high - memset (DrvInputs, 0xff, 1); // DrvJoy1 = active low, 2, 3 = active high - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal = 4000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - ZetRun(nCyclesTotal / nInterleave); - - if(i == 240 && nmi_enable&1) { - ZetNmi(); - } - ZetClose(); - - ZetOpen(1); - ZetRun(nCyclesTotal / nInterleave); - if (i % (nInterleave / 5) == (nInterleave / 5) - 1) { - if(nmi_enable & 1) - ZetSetIRQLine(Z80_INPUT_LINE_NMI, CPU_IRQSTATUS_ACK); - } - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(sound_byte); - SCAN_VAR(nmi_enable); - } - - return 0; -} - - -// Mouser - -static struct BurnRomInfo mouserRomDesc[] = { - { "m0.5e", 0x2000, 0xb56e00bc, 1 }, // 0 maincpu - { "m1.5f", 0x2000, 0xae375d49, 1 }, // 1 - { "m2.5j", 0x2000, 0xef5817e4, 1 }, // 2 - - { "m5.3v", 0x1000, 0x50705eec, 2 }, // 3 audiocpu - - { "m3.11h", 0x2000, 0xaca2834e, 3 }, // 4 gfx1 - { "m4.11k", 0x2000, 0x943ab2e2, 3 }, // 5 - - { "bprom.4b", 0x0100, 0xdd233851, 4 }, // 6 user1 - { "bprom.4c", 0x0100, 0x60aaa686, 4 }, // 7 - - { "bprom.5v", 0x0020, 0x7f8930b2, 5 }, // 8 proms - { "bprom.5u", 0x0020, 0x0086feed, 5 }, // 9 -}; - -STD_ROM_PICK(mouser) -STD_ROM_FN(mouser) - -struct BurnDriver BurnDrvMouser = { - "mouser", NULL, NULL, NULL, "1983", - "Mouser\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, mouserRomInfo, mouserRomName, NULL, NULL, MouserInputInfo, MouserDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 224, 256, 3, 4 -}; - -// Mouser (Cosmos) - -static struct BurnRomInfo mousercRomDesc[] = { - { "83001.0", 0x2000, 0xe20f9601, 1 }, // 0 maincpu - { "m1.5f", 0x2000, 0xae375d49, 1 }, // 1 - { "m2.5j", 0x2000, 0xef5817e4, 1 }, // 2 - - { "m5.3v", 0x1000, 0x50705eec, 2 }, // 3 audiocpu - - { "m3.11h", 0x2000, 0xaca2834e, 3 }, // 4 gfx1 - { "m4.11k", 0x2000, 0x943ab2e2, 3 }, // 5 - - { "bprom.4b", 0x0100, 0xdd233851, 4 }, // 6 user1 - { "bprom.4c", 0x0100, 0x60aaa686, 4 }, // 7 - - { "bprom.5v", 0x0020, 0x7f8930b2, 5 }, // 8 proms - { "bprom.5u", 0x0020, 0x0086feed, 5 }, // 9 -}; - -STD_ROM_PICK(mouserc) -STD_ROM_FN(mouserc) - -struct BurnDriver BurnDrvMouserc = { - "mouserc", "mouser", NULL, NULL, "1983", - "Mouser (Cosmos)\0", NULL, "UPL (Cosmos license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, mousercRomInfo, mousercRomName, NULL, NULL, MouserInputInfo, MouserDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_mrdo.cpp b/jan/src/burn/drv/pre90s/d_mrdo.cpp deleted file mode 100644 index bcb598c42..000000000 --- a/jan/src/burn/drv/pre90s/d_mrdo.cpp +++ /dev/null @@ -1,784 +0,0 @@ -// FB Alpha Mr. Do! driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; - -static UINT8 *DrvROM; -static UINT8 *DrvRAM; -static UINT8 *DrvFGVidRAM; -static UINT8 *DrvBGVidRAM; -static UINT8 *DrvSpriteRAM; -static UINT8 *Gfx0; -static UINT8 *Gfx1; -static UINT8 *Gfx2; -static UINT8 *Prom; -static UINT32 *Palette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvReset; -static UINT8 DrvDips[2]; - -static INT32 flipscreen, scroll_x, scroll_y; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy2 + 6, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 5, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy2 + 7, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 6, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL, DrvJoy2 + 1, "p2 down", }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - - {"Tilt" , BIT_DIGITAL , DrvJoy1 + 7, "tilt" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip 1" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip 2" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0xdf, NULL }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0x03, 0x03, "Easy" }, - {0x10, 0x01, 0x03, 0x02, "Medium" }, - {0x10, 0x01, 0x03, 0x01, "Hard" }, - {0x10, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Rack Test (cheat)" }, - {0x10, 0x01, 0x04, 0x04, "Off" }, - {0x10, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Special" }, - {0x10, 0x01, 0x08, 0x08, "Easy" }, - {0x10, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Extra" }, - {0x10, 0x01, 0x10, 0x10, "Easy" }, - {0x10, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x20, 0x00, "Upright" }, - {0x10, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0xc0, 0x00, "2" }, - {0x10, 0x01, 0xc0, 0xc0, "3" }, - {0x10, 0x01, 0xc0, 0x80, "4" }, - {0x10, 0x01, 0xc0, 0x40, "5" }, - - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 11 , "Coin B" }, - {0x11, 0x01, 0x0f, 0x06, "4 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x08, "3 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0a, "2 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x07, "3 Coins / 2 Credits" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x09, "2 Coins / 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin / 2 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin / 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin / 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin / 5 Credits" }, - {0x11, 0x01, 0x0f, 0x00, "Free_Play" }, - - {0 , 0xfe, 0 , 11 , "Coin A" }, - {0x11, 0x01, 0xf0, 0x60, "4 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x80, "3 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0xa0, "2 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x70, "3 Coins / 2 Credits" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x90, "2 Coins / 3 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin / 2 Credits" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin / 3 Credits" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coin / 4 Credits" }, - {0x11, 0x01, 0xf0, 0xb0, "1 Coin / 5 Credits" }, - {0x11, 0x01, 0xf0, 0x00, "Free_Play" }, -}; - -STDDIPINFO(Drv) - -void __fastcall mrdo_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xf000) address &= 0xf800; - - switch (address) - { - case 0x9800: - flipscreen = data & 1; - break; - - case 0x9801: - SN76496Write(0, data); - break; - - case 0x9802: - SN76496Write(1, data); - break; - - case 0xf000: - scroll_x = data; - break; - - case 0xf800: - scroll_y = data ^ (flipscreen ? 0xff : 0); - break; - } -} - -UINT8 __fastcall mrdo_read(UINT16 address) -{ - UINT8 ret = 0xff; - - switch (address) - { - case 0x9803: // Protection - return DrvROM[ZetHL(-1)]; - - case 0xa000: - { - for (INT32 i = 0; i < 8; i++) ret ^= DrvJoy1[i] << i; - return ret; - } - - case 0xa001: - { - for (INT32 i = 0; i < 8; i++) ret ^= DrvJoy2[i] << i; - return ret; - } - - case 0xa002: - return DrvDips[0]; - - case 0xa003: - return DrvDips[1]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - flipscreen = 0; - scroll_x = scroll_y = 0; - - ZetOpen(0); - ZetReset(); - ZetClose(); - - HiscoreReset(); - - return 0; -} - -static void mrdo_palette_init() -{ - const UINT8 *color_prom = Prom; - int i; - - const int R1 = 150; - const int R2 = 120; - const int R3 = 100; - const int R4 = 75; - const int pull = 220; - float pot[16]; - int weight[16]; - const float potadjust = 0.7f; - - for (i = 0x0f; i >= 0; i--) - { - float par = 0; - - if (i & 1) par += 1.0f/(float)R1; - if (i & 2) par += 1.0f/(float)R2; - if (i & 4) par += 1.0f/(float)R3; - if (i & 8) par += 1.0f/(float)R4; - if (par) - { - par = 1/par; - pot[i] = pull/(pull+par) - potadjust; - } - else pot[i] = 0; - - weight[i] = (INT32)(0xff * pot[i] / pot[0x0f]); - if (weight[i] < 0) weight[i] = 0; - } - - for (i = 0; i < 0x100; i++) - { - int a1,a2; - int bits0, bits2; - int r, g, b; - - a1 = ((i >> 3) & 0x1c) + (i & 0x03) + 0x20; - a2 = ((i >> 0) & 0x1c) + (i & 0x03); - - bits0 = (color_prom[a1] >> 0) & 0x03; - bits2 = (color_prom[a2] >> 0) & 0x03; - r = weight[bits0 + (bits2 << 2)]; - - bits0 = (color_prom[a1] >> 2) & 0x03; - bits2 = (color_prom[a2] >> 2) & 0x03; - g = weight[bits0 + (bits2 << 2)]; - - bits0 = (color_prom[a1] >> 4) & 0x03; - bits2 = (color_prom[a2] >> 4) & 0x03; - b = weight[bits0 + (bits2 << 2)]; - - Palette[i] = BurnHighCol(r, g, b, 0); - } - - color_prom += 0x40; - - for (i = 0x100; i < 0x140; i++) - { - UINT8 ctabentry = color_prom[(i - 0x100) & 0x1f]; - - if ((i - 0x100) & 0x20) - ctabentry >>= 4; - else - ctabentry &= 0x0f; - - Palette[i] = Palette[ctabentry + ((ctabentry & 0x0c) << 3)]; - } -} - -static void mrdo_gfx_decode() -{ - static INT32 CharPlane[2] = { 0, 0x8000 }; - static INT32 CharXOffs[8] = { 7, 6, 5, 4, 3, 2, 1, 0 }; - static INT32 CharYOffs[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - - static INT32 SpriPlane[2] = { 4, 0 }; - static INT32 SpriXOffs[16] = { 3, 2, 1, 0, 11, 10, 9, 8, 19, 18, 17, 16, 27, 26, 25, 24 }; - static INT32 SpriYOffs[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - if (!tmp) return; - - memcpy (tmp, Gfx0, 0x2000); - - GfxDecode(0x200, 2, 8, 8, CharPlane, CharXOffs, CharYOffs, 0x040, tmp, Gfx0); - - memcpy (tmp, Gfx1, 0x2000); - - GfxDecode(0x200, 2, 8, 8, CharPlane, CharXOffs, CharYOffs, 0x040, tmp, Gfx1); - - memcpy (tmp, Gfx2, 0x2000); - - GfxDecode(0x080, 2, 16, 16, SpriPlane, SpriXOffs, SpriYOffs, 0x200, tmp, Gfx2); - - BurnFree (tmp); -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvROM = Next; Next += 0x10000; - - Gfx0 = Next; Next += 0x08000; - Gfx1 = Next; Next += 0x08000; - Gfx2 = Next; Next += 0x08000; - - Prom = Next; Next += 0x00080; - - Palette = (UINT32 *)Next; Next += 0x00140 * sizeof(UINT32); - - AllRam = Next; - - DrvRAM = Next; Next += 0x01000; - DrvFGVidRAM = Next; Next += 0x00800; - DrvBGVidRAM = Next; Next += 0x00800; - DrvSpriteRAM = Next; Next += 0x00100; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - for (INT32 i = 0; i < 4; i++) { - if(BurnLoadRom(DrvROM + (i * 0x2000), 0 + i, 1)) return 1; - if(BurnLoadRom(Prom + (i * 0x0020), 10 + i, 1)) return 1; - } - - for (INT32 i = 0; i < 2; i++) { - if(BurnLoadRom(Gfx0 + (i * 0x1000), 4 + i, 1)) return 1; - if(BurnLoadRom(Gfx1 + (i * 0x1000), 6 + i, 1)) return 1; - if(BurnLoadRom(Gfx2 + (i * 0x1000), 8 + i, 1)) return 1; - } - - mrdo_palette_init(); - mrdo_gfx_decode(); - } - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(mrdo_read); - ZetSetWriteHandler(mrdo_write); - ZetMapMemory(DrvROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvBGVidRAM, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvFGVidRAM, 0x8800, 0x8fff, MAP_RAM); - ZetMapMemory(DrvSpriteRAM, 0x9000, 0x90ff, MAP_RAM); - ZetMapMemory(DrvRAM, 0xe000, 0xefff, MAP_RAM); - ZetClose(); - - SN76489Init(0, 4000000, 0); - SN76489Init(1, 4000000, 1); - SN76496SetRoute(0, 0.45, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.45, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - SN76496Exit(); - GenericTilesExit(); - - BurnFree(AllMem); - - flipscreen = scroll_x = scroll_y = 0; - - return 0; -} - -static void draw_sprites() -{ - for (INT32 offs = 0x100 - 4; offs >= 0; offs -= 4) - { - if (DrvSpriteRAM[offs + 1]) - { - INT32 sx = DrvSpriteRAM[offs + 3]; - INT32 sy = DrvSpriteRAM[offs + 1] ^ 0xff; - - INT32 code = DrvSpriteRAM[offs] & 0x7f; - INT32 color = DrvSpriteRAM[offs + 2] & 0x0f; - - INT32 flipx = DrvSpriteRAM[offs + 2] & 0x10; - INT32 flipy = DrvSpriteRAM[offs + 2] & 0x20; - - sx -= 8; - sy -= 31; // sy is offset by 1 pixel from the bg/fg - - if (sx < 0 || sy < -7 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0x100, Gfx2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0x100, Gfx2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0x100, Gfx2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0x100, Gfx2); - } - } - } - } -} - -static void draw_8x8_tiles(UINT8 *vram, UINT8 *gfx_base, INT32 scrollx, INT32 scrolly) -{ - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 2) & 0xf8; - - INT32 code = (vram[0x400 + offs] | ((vram[offs] & 0x80) << 1)) & 0x1ff; - INT32 color = vram[offs] & 0x3f; - INT32 forcelayer0 = vram[offs] & 0x40; - - sx = (sx - scrollx) & 0xff; - sy = (sy - scrolly) & 0xff; - - sx -= 8; - sy -= 32; - - if (sx < 0 || sy < -7 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (forcelayer0) { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, gfx_base); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, gfx_base); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - mrdo_palette_init(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 2) draw_8x8_tiles(DrvBGVidRAM, Gfx1, scroll_x, scroll_y); - if (nBurnLayer & 4) draw_8x8_tiles(DrvFGVidRAM, Gfx0, 0, 0); - if (nBurnLayer & 8) draw_sprites(); - - BurnTransferCopy(Palette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal = 4000000 / 60; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - ZetRun(nCyclesTotal / nInterleave); - - if (i == nInterleave-1) - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029736; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - SCAN_VAR(flipscreen); - SCAN_VAR(scroll_x); - SCAN_VAR(scroll_y); - } - - return 0; -} - - -// Mr. Do! - -static struct BurnRomInfo mrdoRomDesc[] = { - { "a4-01.bin", 0x2000, 0x03dcfba2, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "c4-02.bin", 0x2000, 0x0ecdd39c, 1 | BRF_ESS | BRF_PRG }, // 1 - { "e4-03.bin", 0x2000, 0x358f5dc2, 1 | BRF_ESS | BRF_PRG }, // 2 - { "f4-04.bin", 0x2000, 0xf4190cfc, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "s8-09.bin", 0x1000, 0xaa80c5b6, 2 | BRF_GRA }, // 4 FG Tiles - { "u8-10.bin", 0x1000, 0xd20ec85b, 2 | BRF_GRA }, // 5 - - { "r8-08.bin", 0x1000, 0xdbdc9ffa, 3 | BRF_GRA }, // 6 BG Tiles - { "n8-07.bin", 0x1000, 0x4b9973db, 3 | BRF_GRA }, // 7 - - { "h5-05.bin", 0x1000, 0xe1218cc5, 4 | BRF_GRA }, // 8 Sprite Tiles - { "k5-06.bin", 0x1000, 0xb1f68b04, 4 | BRF_GRA }, // 9 - - { "u02--2.bin", 0x0020, 0x238a65d7, 5 | BRF_GRA }, // 10 Palette (high bits) - { "t02--3.bin", 0x0020, 0xae263dc0, 5 | BRF_GRA }, // 11 Palette (low bits) - { "f10--1.bin", 0x0020, 0x16ee4ca2, 5 | BRF_GRA }, // 12 Sprite color lookup table - { "j10--4.bin", 0x0020, 0xff7fe284, 5 | BRF_GRA }, // 13 Timing (not used) -}; - -STD_ROM_PICK(mrdo) -STD_ROM_FN(mrdo) - -struct BurnDriver BurnDrvmrdo = { - "mrdo", NULL, NULL, NULL, "1982", - "Mr. Do!\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mrdoRomInfo, mrdoRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 192, 240, 3, 4 -}; - - -// Mr. Do! (Taito license) - -static struct BurnRomInfo mrdotRomDesc[] = { - { "d1", 0x2000, 0x3dcd9359, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "d2", 0x2000, 0x710058d8, 1 | BRF_ESS | BRF_PRG }, // 1 - { "d3", 0x2000, 0x467d12d8, 1 | BRF_ESS | BRF_PRG }, // 2 - { "d4", 0x2000, 0xfce9afeb, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "d9", 0x1000, 0xde4cfe66, 2 | BRF_GRA }, // 4 FG Tiles - { "d10", 0x1000, 0xa6c2f38b, 2 | BRF_GRA }, // 5 - - { "r8-08.bin", 0x1000, 0xdbdc9ffa, 3 | BRF_GRA }, // 6 BG Tiles - { "n8-07.bin", 0x1000, 0x4b9973db, 3 | BRF_GRA }, // 7 - - { "h5-05.bin", 0x1000, 0xe1218cc5, 4 | BRF_GRA }, // 8 Sprite Tiles - { "k5-06.bin", 0x1000, 0xb1f68b04, 4 | BRF_GRA }, // 9 - - { "u02--2.bin", 0x0020, 0x238a65d7, 5 | BRF_GRA }, // 10 Palette (high bits) - { "t02--3.bin", 0x0020, 0xae263dc0, 5 | BRF_GRA }, // 11 Palette (low bits) - { "f10--1.bin", 0x0020, 0x16ee4ca2, 5 | BRF_GRA }, // 12 Sprite color lookup table - { "j10--4.bin", 0x0020, 0xff7fe284, 5 | BRF_GRA }, // 13 Timing (not used) -}; - -STD_ROM_PICK(mrdot) -STD_ROM_FN(mrdot) - -struct BurnDriver BurnDrvmrdot = { - "mrdot", "mrdo", NULL, NULL, "1982", - "Mr. Do! (Taito license)\0", NULL, "Universal (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mrdotRomInfo, mrdotRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 192, 240, 3, 4 -}; - -// Mr. Do! (bugfixed) - -static struct BurnRomInfo mrdofixRomDesc[] = { - { "d1", 0x2000, 0x3dcd9359, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "d2", 0x2000, 0x710058d8, 1 | BRF_ESS | BRF_PRG }, // 1 - { "dofix.d3", 0x2000, 0x3a7d039b, 1 | BRF_ESS | BRF_PRG }, // 2 - { "dofix.d4", 0x2000, 0x32db845f, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "d9", 0x1000, 0xde4cfe66, 2 | BRF_GRA }, // 4 FG Tiles - { "d10", 0x1000, 0xa6c2f38b, 2 | BRF_GRA }, // 5 - - { "r8-08.bin", 0x1000, 0xdbdc9ffa, 3 | BRF_GRA }, // 6 BG Tiles - { "n8-07.bin", 0x1000, 0x4b9973db, 3 | BRF_GRA }, // 7 - - { "h5-05.bin", 0x1000, 0xe1218cc5, 4 | BRF_GRA }, // 8 Sprite Tiles - { "k5-06.bin", 0x1000, 0xb1f68b04, 4 | BRF_GRA }, // 9 - - { "u02--2.bin", 0x0020, 0x238a65d7, 5 | BRF_GRA }, // 10 Palette (high bits) - { "t02--3.bin", 0x0020, 0xae263dc0, 5 | BRF_GRA }, // 11 Palette (low bits) - { "f10--1.bin", 0x0020, 0x16ee4ca2, 5 | BRF_GRA }, // 12 Sprite color lookup table - { "j10--4.bin", 0x0020, 0xff7fe284, 5 | BRF_GRA }, // 13 Timing (not used) -}; - -STD_ROM_PICK(mrdofix) -STD_ROM_FN(mrdofix) - -struct BurnDriver BurnDrvmrdofix = { - "mrdofix", "mrdo", NULL, NULL, "1982", - "Mr. Do! (bugfixed)\0", NULL, "Universal (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mrdofixRomInfo, mrdofixRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 192, 240, 3, 4 -}; - - -// Mr. Lo! - -static struct BurnRomInfo mrloRomDesc[] = { - { "mrlo01.bin", 0x2000, 0x6f455e7d, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "d2", 0x2000, 0x710058d8, 1 | BRF_ESS | BRF_PRG }, // 1 - { "dofix.d3", 0x2000, 0x3a7d039b, 1 | BRF_ESS | BRF_PRG }, // 2 - { "mrlo04.bin", 0x2000, 0x49c10274, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "mrlo09.bin", 0x1000, 0xfdb60d0d, 2 | BRF_GRA }, // 4 FG Tiles - { "mrlo10.bin", 0x1000, 0x0492c10e, 2 | BRF_GRA }, // 5 - - { "r8-08.bin", 0x1000, 0xdbdc9ffa, 3 | BRF_GRA }, // 6 BG Tiles - { "n8-07.bin", 0x1000, 0x4b9973db, 3 | BRF_GRA }, // 7 - - { "h5-05.bin", 0x1000, 0xe1218cc5, 4 | BRF_GRA }, // 8 Sprite Tiles - { "k5-06.bin", 0x1000, 0xb1f68b04, 4 | BRF_GRA }, // 9 - - { "u02--2.bin", 0x0020, 0x238a65d7, 5 | BRF_GRA }, // 10 Palette (high bits) - { "t02--3.bin", 0x0020, 0xae263dc0, 5 | BRF_GRA }, // 11 Palette (low bits) - { "f10--1.bin", 0x0020, 0x16ee4ca2, 5 | BRF_GRA }, // 12 Sprite color lookup table - { "j10--4.bin", 0x0020, 0xff7fe284, 5 | BRF_GRA }, // 13 Timing (not used) -}; - -STD_ROM_PICK(mrlo) -STD_ROM_FN(mrlo) - -struct BurnDriver BurnDrvmrlo = { - "mrlo", "mrdo", NULL, NULL, "1982", - "Mr. Lo!\0", NULL, "Bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mrloRomInfo, mrloRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 192, 240, 3, 4 -}; - - -// Mr. Du! - -static struct BurnRomInfo mrduRomDesc[] = { - { "d1", 0x2000, 0x3dcd9359, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "d2", 0x2000, 0x710058d8, 1 | BRF_ESS | BRF_PRG }, // 1 - { "d3", 0x2000, 0x467d12d8, 1 | BRF_ESS | BRF_PRG }, // 2 - { "du4.bin", 0x2000, 0x893bc218, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "du9.bin", 0x1000, 0x4090dcdc, 2 | BRF_GRA }, // 4 FG Tiles - { "du10.bin", 0x1000, 0x1e63ab69, 2 | BRF_GRA }, // 5 - - { "r8-08.bin", 0x1000, 0xdbdc9ffa, 3 | BRF_GRA }, // 6 BG Tiles - { "n8-07.bin", 0x1000, 0x4b9973db, 3 | BRF_GRA }, // 7 - - { "h5-05.bin", 0x1000, 0xe1218cc5, 4 | BRF_GRA }, // 8 Sprite Tiles - { "k5-06.bin", 0x1000, 0xb1f68b04, 4 | BRF_GRA }, // 9 - - { "u02--2.bin", 0x0020, 0x238a65d7, 5 | BRF_GRA }, // 10 Palette (high bits) - { "t02--3.bin", 0x0020, 0xae263dc0, 5 | BRF_GRA }, // 11 Palette (low bits) - { "f10--1.bin", 0x0020, 0x16ee4ca2, 5 | BRF_GRA }, // 12 Sprite color lookup table - { "j10--4.bin", 0x0020, 0xff7fe284, 5 | BRF_GRA }, // 13 Timing (not used) -}; - -STD_ROM_PICK(mrdu) -STD_ROM_FN(mrdu) - -struct BurnDriver BurnDrvmrdu = { - "mrdu", "mrdo", NULL, NULL, "1982", - "Mr. Du!\0", NULL, "Bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mrduRomInfo, mrduRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 192, 240, 3, 4 -}; - - -// Mr. Do! (prototype) - -static struct BurnRomInfo mrdoyRomDesc[] = { - { "dosnow.1", 0x2000, 0xd3454e2c, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "dosnow.2", 0x2000, 0x5120a6b2, 1 | BRF_ESS | BRF_PRG }, // 1 - { "dosnow.3", 0x2000, 0x96416dbe, 1 | BRF_ESS | BRF_PRG }, // 2 - { "dosnow.4", 0x2000, 0xc05051b6, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "dosnow.9", 0x1000, 0x85d16217, 2 | BRF_GRA }, // 4 FG Tiles - { "dosnow.10", 0x1000, 0x61a7f54b, 2 | BRF_GRA }, // 5 - - { "dosnow.8", 0x1000, 0x2bd1239a, 3 | BRF_GRA }, // 6 BG Tiles - { "dosnow.7", 0x1000, 0xac8ffddf, 3 | BRF_GRA }, // 7 - - { "dosnow.5", 0x1000, 0x7662d828, 4 | BRF_GRA }, // 8 Sprite Tiles - { "dosnow.6", 0x1000, 0x413f88d1, 4 | BRF_GRA }, // 9 - - { "u02--2.bin", 0x0020, 0x238a65d7, 5 | BRF_GRA }, // 10 Palette (high bits) - { "t02--3.bin", 0x0020, 0xae263dc0, 5 | BRF_GRA }, // 11 Palette (low bits) - { "f10--1.bin", 0x0020, 0x16ee4ca2, 5 | BRF_GRA }, // 12 Sprite color lookup table - { "j10--4.bin", 0x0020, 0xff7fe284, 5 | BRF_GRA }, // 13 Timing (not used) -}; - -STD_ROM_PICK(mrdoy) -STD_ROM_FN(mrdoy) - -struct BurnDriver BurnDrvmrdoy = { - "mrdoy", "mrdo", NULL, NULL, "1982", - "Mr. Do! (prototype)\0", NULL, "Universal", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mrdoyRomInfo, mrdoyRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 192, 240, 3, 4 -}; - - -// Yankee DO! - -static struct BurnRomInfo yankeedoRomDesc[] = { - { "a4-01.bin", 0x2000, 0x03dcfba2, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "yd_d2.c4", 0x2000, 0x7c9d7ce0, 1 | BRF_ESS | BRF_PRG }, // 1 - { "e4-03.bin", 0x2000, 0x358f5dc2, 1 | BRF_ESS | BRF_PRG }, // 2 - { "f4-04.bin", 0x2000, 0xf4190cfc, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "s8-09.bin", 0x1000, 0xaa80c5b6, 2 | BRF_GRA }, // 4 FG Tiles - { "u8-10.bin", 0x1000, 0xd20ec85b, 2 | BRF_GRA }, // 5 - - { "r8-08.bin", 0x1000, 0xdbdc9ffa, 3 | BRF_GRA }, // 6 BG Tiles - { "n8-07.bin", 0x1000, 0x4b9973db, 3 | BRF_GRA }, // 7 - - { "yd_d5.h5", 0x1000, 0xf530b79b, 4 | BRF_GRA }, // 8 Sprite Tiles - { "yd_d6.k5", 0x1000, 0x790579aa, 4 | BRF_GRA }, // 9 - - { "u02--2.bin", 0x0020, 0x238a65d7, 5 | BRF_GRA }, // 10 Palette (high bits) - { "t02--3.bin", 0x0020, 0xae263dc0, 5 | BRF_GRA }, // 11 Palette (low bits) - { "f10--1.bin", 0x0020, 0x16ee4ca2, 5 | BRF_GRA }, // 12 Sprite color lookup table - { "j10--4.bin", 0x0020, 0xff7fe284, 5 | BRF_GRA }, // 13 Timing (not used) -}; - -STD_ROM_PICK(yankeedo) -STD_ROM_FN(yankeedo) - -struct BurnDriver BurnDrvyankeedo = { - "yankeedo", "mrdo", NULL, NULL, "1982", - "Yankee DO!\0", NULL, "hack", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, yankeedoRomInfo, yankeedoRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x140, - 192, 240, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_mrflea.cpp b/jan/src/burn/drv/pre90s/d_mrflea.cpp deleted file mode 100644 index ab8b81d05..000000000 --- a/jan/src/burn/drv/pre90s/d_mrflea.cpp +++ /dev/null @@ -1,606 +0,0 @@ -// FB Alpha Amazing Adventures of Mr. F. Lea driver module -// Based on MAME driver by Phil Stroffolino - -#include "burnint.h" -#include "z80_intf.h" -#include "bitswap.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *Mem, *Rom0, *Rom1, *Ram, *Gfx0, *Gfx1; -static INT32 *Palette; -static UINT8 DrvJoy1[8], DrvJoy2[8], DrvDips[2], DrvReset; - -static INT16 *pFMBuffer, *pAY8910Buffer[9]; - -static INT32 mrflea_io; -static INT32 mrflea_main; -static INT32 mrflea_status; -static INT32 mrflea_select[4]; -static UINT8 mrflea_gfx_bank; - -static struct BurnInputInfo DrvInputList[] = { - {"Start 1" , BIT_DIGITAL , DrvJoy1 + 3, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvJoy1 + 2, "p2 start" }, - {"P1 Coin" , BIT_DIGITAL , DrvJoy2 + 2, "p1 coin" }, - - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 4, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 5, "p1 left" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 1, "p1 fire 1"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips+0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips+1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x09, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Bonus" }, - {0x09, 0x01, 0x03, 0x03, "A" }, - {0x09, 0x01, 0x03, 0x02, "B" }, - {0x09, 0x01, 0x03, 0x01, "C" }, - {0x09, 0x01, 0x03, 0x00, "D" }, - - // Default Values - {0x0a, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0a, 0x01, 0x03, 0x02, "2C 1C" }, - {0x0a, 0x01, 0x03, 0x03, "1C 1C" }, - {0x0a, 0x01, 0x03, 0x00, "2C 3C" }, - {0x0a, 0x01, 0x03, 0x01, "1C 2C" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0a, 0x01, 0x0c, 0x0c, "3" }, - {0x0a, 0x01, 0x0c, 0x08, "4" }, - {0x0a, 0x01, 0x0c, 0x04, "5" }, - {0x0a, 0x01, 0x0c, 0x00, "7" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0a, 0x01, 0x30, 0x30, "Easy" }, - {0x0a, 0x01, 0x30, 0x20, "Medium" }, - {0x0a, 0x01, 0x30, 0x10, "Hard" }, - {0x0a, 0x01, 0x30, 0x00, "Hardest" }, -}; - -STDDIPINFO(Drv) - -void __fastcall mrflea_write(UINT16 a, UINT8 d) -{ - if (a >= 0xe000 && a <= 0xe7ff) // video ram - { - Ram[0xe000 + (a & 0x3ff)] = d; - Ram[0xe400 + (a & 0x3ff)] = (a >> 10) & 1; - return; - } - - if (a >= 0xe800 && a <= 0xe83f) // palette ram - { - Ram[a] = d; - - Palette[(a >> 1) & 0x1f] = ((Ram[a | 1] & 0x0f) | (Ram[a | 1] << 4)) << 16; - Palette[(a >> 1) & 0x1f] |= ((Ram[a &~1] & 0xf0) | (Ram[a &~1] >> 4)) << 8; - Palette[(a >> 1) & 0x1f] |= ((Ram[a &~1] & 0x0f) | (Ram[a &~1] << 4)) << 0; - - return; - } - - if (a >= 0xec00 && a <= 0xecff) // sprite ram - { - if (a & 2) { // tile number - Ram[a | 1] = a & 1; - a &= 0xfffe; - } - - Ram[a] = d; - - return; - } -} - - -void __fastcall mrflea_out_port(UINT16 a, UINT8 data) -{ - switch (a & 0xff) - { - case 0x00: // watchdog? - case 0x43: - break; - - case 0x40: - { - mrflea_status |= 0x08; - mrflea_io = data; - - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - ZetOpen(0); - } - break; - - case 0x60: - mrflea_gfx_bank = data; - break; - } -} - -UINT8 __fastcall mrflea_in_port(UINT16 a) -{ - switch (a & 0xff) - { - case 0x41: - mrflea_status &= ~0x01; - return mrflea_main; - - break; - - case 0x42: - return (mrflea_status ^ 0x08); - break; - } - - return 0; -} - -void __fastcall mrflea_cpu1_out_port(UINT16 a, UINT8 data) -{ - switch (a & 0xff) - { - case 0x00: // watchdog - case 0x10: - case 0x11: - case 0x23: - break; - - case 0x21: - mrflea_status |= 0x01; - mrflea_main = data; - break; - - case 0x40: - AY8910Write(0, 0, mrflea_select[0]); - AY8910Write(0, 1, data); - break; - - case 0x42: - break; - - case 0x44: - AY8910Write(1, 0, mrflea_select[2]); - AY8910Write(1, 1, data); - break; - - case 0x46: - AY8910Write(2, 0, mrflea_select[3]); - AY8910Write(2, 1, data); - break; - - case 0x41: - case 0x43: - case 0x45: - case 0x47: - mrflea_select[(a >> 1) & 3] = data; - break; - } -} - -UINT8 __fastcall mrflea_cpu1_in_port(UINT16 a) -{ - UINT8 ret = 0; - - switch (a & 0xff) - { - case 0x10: - if (mrflea_status & 0x08) return 0x00; - return 0x01; - break; - - case 0x20: - mrflea_status &= ~0x08; - return mrflea_io; - - case 0x22: - return (mrflea_status ^ 0x01); - - case 0x40: - if (mrflea_select[0] == 0x0f) { - for (INT32 i = 0; i < 8; i++) { - ret |= DrvJoy1[i] << i; - } - return ~ret; - } - if (mrflea_select[0] == 0x0e) { - for (INT32 i = 0; i < 8; i++) { - ret |= DrvJoy2[i] << i; - } - return ~ret; - } - return 0; - - case 0x44: - if (mrflea_select[2] == 0x0f) return 0xff; - if (mrflea_select[2] == 0x0e) return 0xff; - return 0; - - case 0x42: - case 0x46: - return 0; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (Ram, 0, 0x10000); - - memset (mrflea_select, 0, sizeof(INT32) * 4); - - mrflea_io = 0; - mrflea_main = 0; - mrflea_status = 0; - mrflea_gfx_bank = 0; - - DrvReset = 0; - - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - for (INT32 i = 0; i < 3; i++) { - AY8910Reset(i); - } - - HiscoreReset(); - - return 0; -} - -static INT32 convert_gfx() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, Gfx0, 0x10000); - - for (INT32 i = 0; i < 0x20000; i++) // sprites - { - Gfx0[i^0x07] = ((tmp[0x0000 + (i >> 3)] >> (i & 7)) & 1) << 3; - Gfx0[i^0x07] |= ((tmp[0x4000 + (i >> 3)] >> (i & 7)) & 1) << 2; - Gfx0[i^0x07] |= ((tmp[0x8000 + (i >> 3)] >> (i & 7)) & 1) << 1; - Gfx0[i^0x07] |= ((tmp[0xc000 + (i >> 3)] >> (i & 7)) & 1); - } - - memcpy (tmp, Gfx1, 0x10000); - - for (INT32 i = 0; i < 0x20000; i+=2) // chars - { - Gfx1[i + 0] = (tmp[i>>1] >> 4) & 0x0f; - Gfx1[i + 1] = (tmp[i>>1] >> 0) & 0x0f; - } - - BurnFree (tmp); - - return 0; -} - - -static INT32 DrvInit() -{ - Mem = (UINT8*)BurnMalloc(0x70000 + (128 * sizeof(INT32))); - if (Mem == NULL) { - return 1; - } - - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * 9 * sizeof(INT16)); - if (pFMBuffer == NULL) { - return 1; - } - - memset (Mem, 0, 0x70080); - - Rom0 = Mem + 0x000000; - Rom1 = Mem + 0x010000; - Ram = Mem + 0x020000; - Gfx0 = Mem + 0x030000; - Gfx1 = Mem + 0x050000; - Palette = (INT32*)(Mem + 0x70000); - - { - for (INT32 i = 0; i < 6; i++) { - if (BurnLoadRom(Rom0 + i * 0x2000, i, 1)) return 1; - } - - if (BurnLoadRom(Rom1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(Rom1 + 0x2000, 7, 1)) return 1; - if (BurnLoadRom(Rom1 + 0x3000, 8, 1)) return 1; - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(Gfx0 + i * 0x2000, i + 9, 1)) return 1; - if (BurnLoadRom(Gfx1 + i * 0x2000, i + 17, 1)) return 1; - } - - if (convert_gfx()) return 1; - } - - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(mrflea_in_port); - ZetSetOutHandler(mrflea_out_port); - ZetSetWriteHandler(mrflea_write); - ZetMapArea(0x0000, 0xbfff, 0, Rom0 + 0x0000); - ZetMapArea(0x0000, 0xbfff, 2, Rom0 + 0x0000); - ZetMapArea(0xc000, 0xcfff, 0, Ram + 0xc000); - ZetMapArea(0xc000, 0xcfff, 1, Ram + 0xc000); - ZetMapArea(0xc000, 0xcfff, 2, Ram + 0xc000); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetInHandler(mrflea_cpu1_in_port); - ZetSetOutHandler(mrflea_cpu1_out_port); - ZetMapArea(0x0000, 0x3fff, 0, Rom1 + 0x0000); - ZetMapArea(0x0000, 0x3fff, 2, Rom1 + 0x0000); - ZetMapArea(0x8000, 0x80ff, 0, Ram + 0x8000); - ZetMapArea(0x8000, 0x80ff, 1, Ram + 0x8000); - ZetMapArea(0x8000, 0x80ff, 2, Ram + 0x8000); - ZetMapArea(0x9000, 0x905a, 0, Ram + 0x9000); - ZetMapArea(0x9000, 0x905a, 1, Ram + 0x9000); - ZetMapArea(0x9000, 0x905a, 2, Ram + 0x9000); - ZetClose(); - - for (INT32 i = 0; i < 9; i++) - pAY8910Buffer[i] = pFMBuffer + nBurnSoundLen * i; - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(2, 0.25, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - AY8910Exit(2); - - BurnFree (Mem); - BurnFree (pFMBuffer); - - Rom0 = Rom1 = Ram = Gfx0 = Gfx1 = NULL; - - pFMBuffer = NULL; - for (INT32 i = 0; i < 9; i++) - pAY8910Buffer[i] = NULL; - - Palette = NULL; - - return 0; -} - - -static INT32 DrvDraw() -{ - INT32 base = ((mrflea_gfx_bank & 0x04) << 8) | ((mrflea_gfx_bank & 0x10) << 5); - - for (INT32 i = 0; i < 0x400; i++) - { - INT32 sy = (i >> 2) & 0xf8; - INT32 sx = (i << 3) & 0xf8; - - if (sy >= 0xf8) continue; - - INT32 code = base + Ram[0xe000 + i] + (Ram[0xe400 + i] << 8); - - UINT8 *src = Gfx1 + code * 64; - - for (INT32 y = sy; y < sy + 8; y++) - { - for (INT32 x = sx; x < sx + 8; x++, src++) - { - INT32 pxl = Palette[*src]; - - PutPix(pBurnDraw + ((y << 8) | x) * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0)); - } - } - } - - for (INT32 i = 0; i < 0x100; i+=4) - { - INT32 sx = Ram[0xec00 + i + 1]; - INT32 sy = Ram[0xec00 + i + 0] - 13; - - INT32 code = (Ram[0xec00 + i + 2] | (Ram[0xec00 + i + 3] << 8)) << 8; - - UINT8 *src = Gfx0 + code; - - for (INT32 y = sy; y < sy + 16; y++) - { - for (INT32 x = sx; x < sx + 16; x++, src++) - { - if (!*src || x >= 0xff || y >= 0xf8 || y < 0) continue; - - INT32 pxl = Palette[0x10|*src]; - - PutPix(pBurnDraw + ((y << 8) | x) * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0)); - } - } - } - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - INT32 nInterleave = 200; - INT32 nSoundBufferPos = 0; - - INT32 nCyclesSegment; - INT32 nCyclesDone[2], nCyclesTotal[2]; - - nCyclesTotal[0] = 4000000 / 60; - nCyclesTotal[1] = 6000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #0 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - // Run Z80 #1 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if ((mrflea_status&0x08) || i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = Ram; - ba.nLen = 0x10000; - ba.szName = "All Ram"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = (UINT8*)Palette; - ba.nLen = 0x80 * sizeof(INT32); - ba.szName = "Palette"; - BurnAcb(&ba); - - ZetScan(nAction); // Scan Z80 - - AY8910Scan(nAction, pnMin); // Scan AY8910 - - // Scan critical driver variables - SCAN_VAR(mrflea_io); - SCAN_VAR(mrflea_main); - SCAN_VAR(mrflea_status); - SCAN_VAR(mrflea_gfx_bank); - SCAN_VAR(mrflea_select[0]); - SCAN_VAR(mrflea_select[1]); - SCAN_VAR(mrflea_select[2]); - SCAN_VAR(mrflea_select[3]); - } - - return 0; -} - - -// The Amazing Adventures of Mr. F. Lea - -static struct BurnRomInfo mrfleaRomDesc[] = { - { "cpu_d1", 0x2000, 0xd286217c, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 0 Code - { "cpu_d3", 0x2000, 0x95cf94bc, 1 | BRF_ESS | BRF_PRG }, // 1 - { "cpu_d5", 0x2000, 0x466ca77e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "cpu_b1", 0x2000, 0x721477d6, 1 | BRF_ESS | BRF_PRG }, // 3 - { "cpu_b3", 0x2000, 0xf55b01e4, 1 | BRF_ESS | BRF_PRG }, // 4 - { "cpu_b5", 0x2000, 0x79f560aa, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "io_a11", 0x1000, 0x7a20c3ee, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 1 Code - { "io_c11", 0x1000, 0x8d26e0c8, 2 | BRF_ESS | BRF_PRG }, // 7 - { "io_d11", 0x1000, 0xabd9afc0, 2 | BRF_ESS | BRF_PRG }, // 8 - - { "vd_l10", 0x2000, 0x48b2adf9, 3 | BRF_GRA }, // 9 Sprites - { "vd_l11", 0x2000, 0x2ff168c0, 3 | BRF_GRA }, // 10 - { "vd_l6", 0x2000, 0x100158ca, 3 | BRF_GRA }, // 11 - { "vd_l7", 0x2000, 0x34501577, 3 | BRF_GRA }, // 12 - { "vd_j10", 0x2000, 0x3f29b8c3, 3 | BRF_GRA }, // 13 - { "vd_j11", 0x2000, 0x39380bea, 3 | BRF_GRA }, // 14 - { "vd_j6", 0x2000, 0x2b4b110e, 3 | BRF_GRA }, // 15 - { "vd_j7", 0x2000, 0x3a3c8b1e, 3 | BRF_GRA }, // 16 - - { "vd_k1", 0x2000, 0x7540e3a7, 4 | BRF_GRA }, // 17 Characters - { "vd_k2", 0x2000, 0x6c688219, 4 | BRF_GRA }, // 18 - { "vd_k3", 0x2000, 0x15e96f3c, 4 | BRF_GRA }, // 19 - { "vd_k4", 0x2000, 0xfe5100df, 4 | BRF_GRA }, // 20 - { "vd_l1", 0x2000, 0xd1e3d056, 4 | BRF_GRA }, // 21 - { "vd_l2", 0x2000, 0x4d7fb925, 4 | BRF_GRA }, // 22 - { "vd_l3", 0x2000, 0x6d81588a, 4 | BRF_GRA }, // 23 - { "vd_l4", 0x2000, 0x423735a5, 4 | BRF_GRA }, // 24 -}; - -STD_ROM_PICK(mrflea) -STD_ROM_FN(mrflea) - -struct BurnDriver BurnDrvmrflea = { - "mrflea", NULL, NULL, NULL, "1982", - "The Amazing Adventures of Mr. F. Lea\0", NULL, "Pacific Novelty", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 1, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, mrfleaRomInfo, mrfleaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x80, - 248, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_mrjong.cpp b/jan/src/burn/drv/pre90s/d_mrjong.cpp deleted file mode 100644 index 9a2c10c04..000000000 --- a/jan/src/burn/drv/pre90s/d_mrjong.cpp +++ /dev/null @@ -1,547 +0,0 @@ -// FB Alpha Mr. Jong driver module -// Based on MAME driver by Takahiro Nogi (nogi@kt.rim.or.jp) 2000/03/20 - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvInputs[2]; -static UINT8 DrvDip[2]; -static UINT8 DrvReset; -static UINT8 DrvRecalc; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvRAM0; -static UINT8 *DrvRAM1; -static UINT8 *DrvBgVidRAM; -static UINT8 *DrvBgColRAM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxTMP0; -static UINT8 *DrvColPROM; -static UINT8 *DrvMainROM; -static UINT32 *DrvPalette; - -static UINT8 flipscreen; - -static struct BurnInputInfo MrjongInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 2, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, -}; - -STDINPUTINFO(Mrjong) - - -static struct BurnDIPInfo MrjongDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x01, 0x01, "Upright" }, - {0x0f, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x00, "Off" }, - {0x0f, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x0f, 0x01, 0x04, 0x00, "30k" }, - {0x0f, 0x01, 0x04, 0x04, "50k" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0f, 0x01, 0x08, 0x00, "Normal" }, - {0x0f, 0x01, 0x08, 0x08, "Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x00, "3" }, - {0x0f, 0x01, 0x30, 0x10, "4" }, - {0x0f, 0x01, 0x30, 0x20, "5" }, - {0x0f, 0x01, 0x30, 0x30, "6" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0f, 0x01, 0xc0, 0xc0, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Mrjong) - -static void DrvPaletteInit() -{ - UINT32 t_pal[16]; - - for (INT32 i = 0; i < 0x10; i++) - { - int bit0, bit1, bit2; - int r, g, b; - - /* red component */ - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* green component */ - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* blue component */ - bit0 = 0; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - t_pal[i] = BurnHighCol(r,g,b,0); - } - - /* prom now points to the beginning of the lookup table */ - UINT8 *prom = DrvColPROM + 0x20; - - /* characters/sprites */ - for (INT32 i = 0; i < 0x80; i++) - { - UINT8 ctabentry = prom[i] & 0x0f; - DrvPalette[i] = t_pal[ctabentry]; - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x10000; - - AllRam = DrvMainROM + 0x8000; - DrvRAM0 = DrvMainROM + 0x8000; - DrvRAM1 = DrvMainROM + 0xa000; - DrvBgVidRAM = DrvMainROM + 0xe000; - DrvBgColRAM = DrvMainROM + 0xe400; - RamEnd = DrvMainROM + 0x10000; - - DrvColPROM = Next; Next += 0x00120; - DrvPalette = (UINT32*)Next; Next += 0x00120 * sizeof(UINT32); - DrvGfxTMP0 = Next; Next += 0x02000; - DrvGfxROM0 = Next; Next += 0x01000*8; - DrvGfxROM1 = Next; Next += 0x01000*8; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxTMP0, 0x2000); - - INT32 Planes0[2] = { 0, 512*8*8 }; /* the two bitplanes are separated */ - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; /* pretty straightforward layout */ - INT32 YOffs0[8] = { 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 }; - - GfxDecode(0x0200, 2, 8, 8, Planes0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); // modulo 0x040 to verify !!! - - INT32 Planes1[2] = { 0, 128*16*16 }; /* the bitplanes are separated */ - INT32 XOffs1[16] = { 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7, 0, 1, 2, 3, 4, 5, 6, 7 }; /* pretty straightforward layout */ - INT32 YOffs1[16] = { 23*8, 22*8, 21*8, 20*8, 19*8, 18*8, 17*8, 16*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 }; - - GfxDecode(0x0080, 2, 16, 16, Planes1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); -} - -static void __fastcall mrjong_write(unsigned short address, unsigned char data) -{ - DrvMainROM[address] = data; -} - -static unsigned char __fastcall mrjong_read(unsigned short address) -{ - return DrvMainROM[address]; -} - -UINT8 __fastcall mrjong_in(UINT16 address) -{ - switch (address & 0xff) - { - case 0x00: - { - return DrvInputs[0] | 0x80; - } - - case 0x01: - { - return DrvInputs[1]; - } - - case 0x02: - { - return DrvDip[0]; - } - - case 0x03: - return 0x00; - } - return 0; -} - -void __fastcall mrjong_out(UINT16 address, UINT8 data) -{ - switch (address & 0xff) - { - case 0x00: - flipscreen = ((data & 0x04) > 2); - break; - - case 0x01: - SN76496Write(0, data); - break; - - case 0x02: - SN76496Write(1, data); - break; - } -} - -static void DrawSprites() -{ - - for (INT32 offs = (0x40 - 4); offs >= 0; offs -= 4) { - int code; - int color; - int sx, sy; - int flipx, flipy; - - code = (((DrvBgVidRAM[offs + 1] >> 2) & 0x3f) | ((DrvBgVidRAM[offs + 3] & 0x20) << 1)); - flipx = !((DrvBgVidRAM[offs + 1] & 0x01) >> 0); - flipy = !((DrvBgVidRAM[offs + 1] & 0x02) >> 1); - color = (DrvBgVidRAM[offs + 3] & 0x1f); - - sx = DrvBgVidRAM[offs + 2] + 16; - sy = 240-DrvBgVidRAM[offs + 0]; - - if (flipscreen) { - sx = 208 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 16; - sx -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2 /*2 bits*/, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2 /*2 bits*/, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2 /*2 bits*/, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2 /*2 bits*/, 0, 0, DrvGfxROM1); - } - } - } -} - -static void DrawBgTiles() -{ - for (INT32 offs = 0x400 - 1;offs >= 0;offs--) { - INT32 sx,sy,code,color,flipx,flipy; - - sx = offs % 32; - sy = offs / 32; - code = DrvBgVidRAM[offs] | ((DrvBgColRAM[offs] & 0x20) << 3); - code &= 0x1ff; - color = DrvBgColRAM[offs] & 0x1f; - flipx = !(DrvBgColRAM[offs] & 0x40); //TILEMAP_SCAN_ROWS_FLIPXY (inverted flipxy) - flipy = !(DrvBgColRAM[offs] & 0x80); - - if (flipscreen) { - sx = 31 - sx; - sy = 31 - sy; - flipx = !flipx; - } - - sy -= 2; - sx -= 2; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx*8, sy*8, color, 2 /*2 bits*/, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx*8, sy*8, color, 2 /*2 bits*/, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx*8, sy*8, color, 2 /*2 bits*/, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx*8, sy*8, color, 2 /*2 bits*/, 0, DrvGfxROM0); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - DrawBgTiles(); - DrawSprites(); - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - flipscreen = 0; - - ZetOpen(0); - ZetReset(); - ZetClose(); - - return 0; -} - -static INT32 DrvLoadRoms() -{ - for (INT32 i = 0; i < 4; i++) - if (BurnLoadRom(DrvMainROM + i * 0x2000, i + 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxTMP0 + 0x00000, 4, 1)) return 1; // mj21 - if (BurnLoadRom(DrvGfxTMP0 + 0x01000, 5, 1)) return 1; // mj20 - - if (BurnLoadRom(DrvColPROM + 0x0000, 6, 1)) return 1; // mj61 - if (BurnLoadRom(DrvColPROM + 0x0020, 7, 1)) return 1; // mj60 - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - if(DrvLoadRoms()) return 1; - - DrvPaletteInit(); - DrvGfxDecode(); - - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(mrjong_in); - ZetSetOutHandler(mrjong_out); - - ZetMapMemory(DrvMainROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvRAM0, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvRAM1, 0xa000, 0xa7ff, MAP_RAM); - ZetMapMemory(DrvBgVidRAM, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvBgColRAM, 0xe400, 0xe7ff, MAP_RAM); - - ZetSetWriteHandler(mrjong_write); - ZetSetReadHandler(mrjong_read); - - ZetClose(); - - SN76489Init(0, 2578000, 0); - SN76489Init(1, 2578000, 1); - - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInputs, 0x00, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - INT32 nCyclesTotal = 2578000 / 60; - - ZetOpen(0); - ZetRun(nCyclesTotal); - ZetNmi(); - ZetClose(); - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - ZetScan(nAction); - - SN76496Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - } - - return 0; -} - -// Mr. Jong (Japan) - -static struct BurnRomInfo mrjongRomDesc[] = { - { "mj00", 0x2000, 0xd211aed3, 1 }, // 0 maincpu - { "mj01", 0x2000, 0x49a9ca7e, 1 }, // 1 - { "mj02", 0x2000, 0x4b50ae6a, 1 }, // 2 - { "mj03", 0x2000, 0x2c375a17, 1 }, // 3 - - { "mj21", 0x1000, 0x1ea99dab, 2 }, // 4 gfx1 - { "mj20", 0x1000, 0x7eb1d381, 2 }, // 5 - - { "mj61", 0x0020, 0xa85e9b27, 3 }, // 6 proms - { "mj60", 0x0100, 0xdd2b304f, 3 }, // 7 -}; - -STD_ROM_PICK(mrjong) -STD_ROM_FN(mrjong) - - -static struct BurnRomInfo crazyblkRomDesc[] = { - { "c1.a6", 0x2000, 0xe2a211a2, 1 }, // 0 maincpu - { "c2.a7", 0x2000, 0x75070978, 1 }, // 1 - { "c3.a7", 0x2000, 0x696ca502, 1 }, // 2 - { "c4.a8", 0x2000, 0xc7f5a247, 1 }, // 3 - - { "c6.h5", 0x1000, 0x2b2af794, 2 }, // 4 gfx1 - { "c5.h4", 0x1000, 0x98d13915, 2 }, // 5 - - { "clr.j7", 0x0020, 0xee1cf1d5, 3 }, // 6 proms - { "clr.g5", 0x0100, 0xbcb1e2e3, 3 }, // 7 -}; - -STD_ROM_PICK(crazyblk) -STD_ROM_FN(crazyblk) - -static struct BurnRomInfo blkbustrRomDesc[] = { - { "6a.bin", 0x2000, 0x9e4b426c, 1 }, // 0 maincpu - { "c2.a7", 0x2000, 0x75070978, 1 }, // 1 - { "8a.bin", 0x2000, 0x0e803777, 1 }, // 2 - { "c4.a8", 0x2000, 0xc7f5a247, 1 }, // 3 - - { "4h.bin", 0x1000, 0x67dd6c19, 2 }, // 4 gfx1 - { "5h.bin", 0x1000, 0x50fba1d4, 2 }, // 5 - - { "clr.j7", 0x0020, 0xee1cf1d5, 3 }, // 6 proms - { "clr.g5", 0x0100, 0xbcb1e2e3, 3 }, // 7 -}; - -STD_ROM_PICK(blkbustr) -STD_ROM_FN(blkbustr) - -struct BurnDriver BurnDrvMrjong = { - "mrjong", NULL, NULL, NULL, "1983", - "Mr. Jong (Japan)\0", NULL, "Kiwako", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mrjongRomInfo, mrjongRomName, NULL, NULL, MrjongInputInfo, MrjongDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 512, - 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvCrazyblk = { - "crazyblk", "mrjong", NULL, NULL, "1983", - "Crazy Blocks\0", NULL, "Kiwako (ECI license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, crazyblkRomInfo, crazyblkRomName, NULL, NULL, MrjongInputInfo, MrjongDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 512, - 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvBlkbustr = { - "blkbustr", "mrjong", NULL, NULL, "1983", - "BlockBuster\0", NULL, "Kiwako (ECI license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, blkbustrRomInfo, blkbustrRomName, NULL, NULL, MrjongInputInfo, MrjongDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 512, - 224, 240, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_munchmo.cpp b/jan/src/burn/drv/pre90s/d_munchmo.cpp deleted file mode 100644 index 23544f325..000000000 --- a/jan/src/burn/drv/pre90s/d_munchmo.cpp +++ /dev/null @@ -1,740 +0,0 @@ -// FB Alpha Joyful Road / Munch Mobile driver module -// Based on MAME driver by Phil Stroffolino - -/* - To do (Remove as completed): - Video frequency is not correct, should be 57hz. -*/ - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvMapROM1; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvStatRAM; -static UINT8 *DrvSprXRAM; -static UINT8 *DrvSprTRAM; -static UINT8 *DrvSprARAM; -static UINT8 *DrvVRegs; - -static UINT16 *DrvBGBitmap; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 flipscreen; -static UINT8 nmi_enable; -static UINT8 soundlatch; -static UINT8 palette_bank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Left Stick Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Left Stick Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left Stick Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Left Stick Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Right Stick Left", BIT_DIGITAL, DrvJoy2 + 4, "p3 left" }, - {"P1 Right Stick Right",BIT_DIGITAL, DrvJoy2 + 5, "p3 right" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Left Stick Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Left Stick Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left Stick Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Left Stick Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Right Stick Left", BIT_DIGITAL, DrvJoy3 + 4, "p4 left" }, - {"P2 Right Stick Right",BIT_DIGITAL, DrvJoy3 + 5, "p4 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dips" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dips" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x88, NULL }, - - {0 , 0xfe, 0 , 2, "Continue after game over? (Cheat)" }, - {0x11, 0x01, 0x01, 0x00, "Off" }, - {0x11, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 12, "Coin A" }, - {0x11, 0x01, 0x1e, 0x14, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x1e, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x1e, 0x16, "3 Coins 2 Credits" }, - {0x11, 0x01, 0x1e, 0x00, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x1e, 0x12, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x1e, 0x02, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x1e, 0x04, "1 Coins 3 Credits" }, - {0x11, 0x01, 0x1e, 0x06, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x1e, 0x08, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x1e, 0x0a, "1 Coin 6 Credits" }, - {0x11, 0x01, 0x1e, 0x0c, "1 Coin 7 Credits" }, - {0x11, 0x01, 0x1e, 0x0e, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 8, "First Bonus" }, - {0x11, 0x01, 0xe0, 0x00, "10000" }, - {0x11, 0x01, 0xe0, 0x20, "20000" }, - {0x11, 0x01, 0xe0, 0x40, "30000" }, - {0x11, 0x01, 0xe0, 0x60, "40000" }, - {0x11, 0x01, 0xe0, 0x80, "50000" }, - {0x11, 0x01, 0xe0, 0xa0, "60000" }, - {0x11, 0x01, 0xe0, 0xc0, "70000" }, - {0x11, 0x01, 0xe0, 0xe0, "None" }, - - {0 , 0xfe, 0 , 4, "Second Bonus (First +)" }, - {0x12, 0x01, 0x03, 0x00, "30000" }, - {0x12, 0x01, 0x03, 0x01, "40000" }, - {0x12, 0x01, 0x03, 0x02, "100000" }, - {0x12, 0x01, 0x03, 0x03, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x0c, 0x00, "1" }, - {0x12, 0x01, 0x0c, 0x04, "2" }, - {0x12, 0x01, 0x0c, 0x08, "3" }, - {0x12, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 1, "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, -// {0x12, 0x01, 0x40, 0x40, "Cocktail" }, // not supported - - {0 , 0xfe, 0 , 2, "Additional Bonus (Second)" }, - {0x12, 0x01, 0x80, 0x00, "No" }, - {0x12, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Drv) - -static void __fastcall mnchmobl_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xbaba: - return; // nop - - case 0xbe00: { - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xbe01: - palette_bank = data & 0x03; - return; - - case 0xbe11: - case 0xbe21: - case 0xbe31: - return; // nop - - case 0xbe41: - flipscreen = data; - return; - - case 0xbe61: - nmi_enable = data; - return; - - case 0xbf00: - case 0xbf01: - case 0xbf02: - case 0xbf03: - case 0xbf04: - case 0xbf05: - case 0xbf06: - case 0xbf07: - DrvVRegs[address & 7] = data; - return; - } -} - -static UINT8 __fastcall mnchmobl_main_read(UINT16 address) -{ - switch (address) - { - case 0xbe02: - return DrvDips[0]; - - case 0xbe03: - return DrvDips[1]; - - case 0xbf01: - return DrvInputs[0]; - - case 0xbf02: - return DrvInputs[1]; - - case 0xbf03: - return DrvInputs[2]; - } - bprintf(0, _T("u-mr %X.\n"), address); - return 0; -} - -static void __fastcall mnchmobl_sound_write(UINT16 address, UINT8 data) -{ - switch (address & ~0x1fff) - { - case 0x4000: - AY8910Write(0, (~address >> 12) & 1, data); - return; - - case 0x6000: - AY8910Write(1, (~address >> 12) & 1, data); - return; - - case 0x8000: - AY8910Reset(0); - return; - - case 0xa000: - AY8910Reset(1); - return; - - case 0xc000: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - } -} - -static UINT8 __fastcall mnchmobl_sound_read(UINT16 address) -{ - switch (address & ~0x1fff) - { - case 0x2000: - //ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - - case 0x8000: - AY8910Reset(0); - return 0; - - case 0xa000: - AY8910Reset(1); - return 0; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - HiscoreReset(); - - flipscreen = 0; - nmi_enable = 0; - soundlatch = 0; - palette_bank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x004000; - DrvZ80ROM1 = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x004000; - DrvMapROM1 = Next; Next += 0x021000; - DrvGfxROM1 = Next; Next += 0x042000; - DrvGfxROM2 = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x00100 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x000400; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000100; - DrvStatRAM = Next; Next += 0x000100; - DrvSprXRAM = Next; Next += 0x000400; - DrvSprTRAM = Next; Next += 0x000400; - DrvSprARAM = Next; Next += 0x000400; - - DrvVRegs = Next; Next += 0x0000080; - - DrvBGBitmap = (UINT16*)Next; Next += (512 * 512) * sizeof(UINT16); - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 1; - INT32 bit1 = (DrvColPROM[i] >> 1) & 1; - INT32 bit2 = (DrvColPROM[i] >> 2) & 1; - - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 1; - bit1 = (DrvColPROM[i] >> 4) & 1; - bit2 = (DrvColPROM[i] >> 5) & 1; - - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 6) & 1; - bit1 = (DrvColPROM[i] >> 7) & 1; - - INT32 b = 0x4f * bit0 + 0xa8 * bit1; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0, 8, 0x8000, 0x8008 }; - INT32 Plane1[4] = { 8,12,0,4 }; - INT32 Plane2[3] = { 0x4000*8,0x2000*8,0 }; - INT32 Plane3[3] = { 0,0,0 }; // monochrome - - INT32 XOffs0[8] = { STEP8(7,-1) }; - INT32 XOffs1[8] = { 0,0,1,1,2,2,3,3 }; - INT32 XOffs2[32] = - { - 7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0, - 0x8000+7,0x8000+7,0x8000+6,0x8000+6,0x8000+5,0x8000+5,0x8000+4,0x8000+4, - 0x8000+3,0x8000+3,0x8000+2,0x8000+2,0x8000+1,0x8000+1,0x8000+0,0x8000+0 - }; - INT32 YOffs0[8] = { STEP8(0,16) }; - INT32 YOffs2[32] = { STEP32(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0100, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x1000); - - GfxDecode(0x0080, 4, 8, 8, Plane1, XOffs1, YOffs0, 0x080, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x6000); - - GfxDecode(0x0080, 3, 32, 32, Plane2, XOffs2, YOffs2, 0x100, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM2 + 0x20000, 0x2000); - - GfxDecode(0x0080, 3, 32, 32, Plane3, XOffs2, YOffs2, 0x100, tmp, DrvGfxROM2 + 0x20000); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x01000, 4, 1)) return 1; - - if (BurnLoadRom(DrvMapROM1 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 11, 1)) return 1; - - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x83ff, MAP_RAM); - ZetMapMemory(DrvSprXRAM, 0xa000, 0xa3ff, MAP_RAM); - ZetMapMemory(DrvSprXRAM, 0xa400, 0xa7ff, MAP_RAM); - ZetMapMemory(DrvSprTRAM, 0xa800, 0xabff, MAP_RAM); - ZetMapMemory(DrvSprTRAM, 0xac00, 0xafff, MAP_RAM); - ZetMapMemory(DrvSprARAM, 0xb000, 0xb3ff, MAP_RAM); - ZetMapMemory(DrvSprARAM, 0xb400, 0xb7ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xb800, 0xb8ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xb900, 0xb9ff, MAP_RAM); - ZetMapMemory(DrvStatRAM, 0xbc00, 0xbcff, MAP_RAM); - ZetSetWriteHandler(mnchmobl_main_write); - ZetSetReadHandler(mnchmobl_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0xf000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(mnchmobl_sound_write); - ZetSetReadHandler(mnchmobl_sound_read); - ZetClose(); - - AY8910Init(0, 1875000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1875000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - - return 0; -} - -static void draw_status() -{ - for (INT32 row = 0; row < 4; row++) { - - INT32 sx = ((row & 1) << 3) + ((~row & 2) ? 304 : 0); - - for (INT32 sy = 0; sy < 256; sy+=8) { - INT32 code = DrvStatRAM[((~row & 3) << 5) + (sy >> 3)]; - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, 0, 4, 0, DrvGfxROM0); - } - } -} - -static void draw_background() -{ - INT32 scrollx = (-(DrvVRegs[6] *2 + (DrvVRegs[7] >> 7)) - 64 - 128 - 16) & 0x1ff; - - GenericTilesSetClipRaw(0, 512, 0, 512); - - for (INT32 offs = 0; offs < 16 * 16; offs++) - { - INT32 sy = (offs % 16) * 32; - INT32 sx = (offs / 16) * 32; - - INT32 code_offset = DrvVidRAM[offs]; - - for (INT32 row = 0; row < 4; row++) - { - for (INT32 col = 0; col < 4; col++) - { - INT32 code = DrvMapROM1[col + code_offset * 4 + row * 0x400] & 0x7f; - - Render8x8Tile_Clip(DrvBGBitmap, code, (sx + (col * 8)), sy + (row * 8), palette_bank + 0x04, 4, 0, DrvGfxROM1); - } - } - } - - GenericTilesClearClipRaw(); - - // copy the BGBitmap to pTransDraw - for (INT32 sy = 0; sy < nScreenHeight; sy++) { - - UINT16 *src = DrvBGBitmap + sy * 512; - UINT16 *dst = pTransDraw + sy * nScreenWidth; - - for (INT32 sx = 0; sx < nScreenWidth; sx++) { - dst[sx] = src[(sx-scrollx)&0x1ff]; - } - } - -} - -static void draw_sprites() -{ - int scroll = DrvVRegs[6]; - int flags = DrvVRegs[7]; - int xadjust = - 128 - 16 - ((flags & 0x80) ? 1 : 0); - int bank = (flags & 0x40) ? 0x80 : 0; - - int color_base = (palette_bank * 4) + 3; - - int firstsprite = DrvVRegs[4] & 0x3f; - - for (INT32 i = firstsprite; i < firstsprite + 0x40; i++) - { - for (INT32 j = 0; j < 8; j++) - { - INT32 offs = (j << 6) | (i & 0x3f); - INT32 attributes = DrvSprARAM[offs]; - - if (attributes & 0x80) - { - INT32 tile_number = DrvSprTRAM[offs] ^ 0x7f; - INT32 sx = DrvSprXRAM[offs]; - INT32 sy = ((offs >> 6) << 5) + ((attributes >> 2) & 0x1f); - - sx = (sx >> 1) | (tile_number & 0x80); - sx = 2 * ((- 32 - scroll - sx) & 0xff) + xadjust; - - INT32 color = color_base - (attributes & 0x03); - - Render32x32Tile_Mask_Clip(pTransDraw, (tile_number & 0x7f) + bank, sx, sy, color, 3, 7, 0x80, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - BurnTransferClear(); - if (nBurnLayer & 1) draw_background(); - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 4) draw_status(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 3750000 / 57, 3750000 / 57 }; // 57HZ... - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - INT32 nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nSegment); - if (i == 220) { // 220? weird? probably due to hz? any higher and car flickers - if (nmi_enable) ZetNmi(); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment); - if (i == 220) { - ZetSetIRQLine(0x20, CPU_IRQSTATUS_ACK); // nmi - } - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - SCAN_VAR(nmi_enable); - SCAN_VAR(soundlatch); - SCAN_VAR(palette_bank); - } - - return 0; -} - - -// Joyful Road (Japan) - -static struct BurnRomInfo joyfulrRomDesc[] = { - { "m1j.10e", 0x2000, 0x1fe86e25, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "m2j.10d", 0x2000, 0xb144b9a6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mu.2j", 0x2000, 0x420adbd4, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 #1 Code - - { "s1.10a", 0x1000, 0xc0bcc301, 3 | BRF_GRA }, // 3 - Characters - { "s2.10b", 0x1000, 0x96aa11ca, 3 | BRF_GRA }, // 4 - - { "b1.2c", 0x1000, 0x8ce3a403, 4 | BRF_GRA }, // 5 - Background Tile Map - - { "b2.2b", 0x1000, 0x0df28913, 5 | BRF_GRA }, // 6 - Background Tiles - - { "f1j.1g", 0x2000, 0x93c3c17e, 6 | BRF_GRA }, // 7 - Sprites - { "f2j.3g", 0x2000, 0xb3fb5bd2, 6 | BRF_GRA }, // 8 - { "f3j.5g", 0x2000, 0x772a7527, 6 | BRF_GRA }, // 9 - { "h", 0x2000, 0x332584de, 6 | BRF_GRA }, // 10 - Monochrome Sprites - - { "a2001.clr", 0x0100, 0x1b16b907, 7 | BRF_GRA }, // 11 - Color PROMs -}; - -STD_ROM_PICK(joyfulr) -STD_ROM_FN(joyfulr) - -struct BurnDriver BurnDrvJoyfulr = { - "joyfulr", NULL, NULL, NULL, "1983", - "Joyful Road (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 4, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, joyfulrRomInfo, joyfulrRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 320, 3, 4 -}; - - -// Munch Mobile (US) - -static struct BurnRomInfo mnchmoblRomDesc[] = { - { "m1.10e", 0x2000, 0xa4bebc6a, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "m2.10d", 0x2000, 0xf502d466, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mu.2j", 0x2000, 0x420adbd4, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 #1 Code - - { "s1.10a", 0x1000, 0xc0bcc301, 3 | BRF_GRA }, // 3 - Characters - { "s2.10b", 0x1000, 0x96aa11ca, 3 | BRF_GRA }, // 4 - - { "b1.2c", 0x1000, 0x8ce3a403, 4 | BRF_GRA }, // 5 - Background Tile Map - - { "b2.2b", 0x1000, 0x0df28913, 5 | BRF_GRA }, // 6 - Background Tiles - - { "f1.1g", 0x2000, 0xb75411d4, 6 | BRF_GRA }, // 7 - Sprites - { "f2.3g", 0x2000, 0x539a43ba, 6 | BRF_GRA }, // 8 - { "f3.5g", 0x2000, 0xec996706, 5 | BRF_GRA }, // 9 - { "h", 0x2000, 0x332584de, 6 | BRF_GRA }, // 10 - Monochrome Sprites - - { "a2001.clr", 0x0100, 0x1b16b907, 7 | BRF_GRA }, // 11 - Color PROMs -}; - -STD_ROM_PICK(mnchmobl) -STD_ROM_FN(mnchmobl) - -struct BurnDriver BurnDrvMnchmobl = { - "mnchmobl", "joyfulr", NULL, NULL, "1983", - "Munch Mobile (US)\0", NULL, "SNK (Centuri license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 4, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, mnchmoblRomInfo, mnchmoblRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_mustache.cpp b/jan/src/burn/drv/pre90s/d_mustache.cpp deleted file mode 100644 index ffa1d3045..000000000 --- a/jan/src/burn/drv/pre90s/d_mustache.cpp +++ /dev/null @@ -1,711 +0,0 @@ -// FB Alpha Mustache Boy driver module -// Based on MAME drver by Tomasz Slanina - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "t5182.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80ROMDec; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 scroll = 0; -static UINT8 video_control = 0; -static UINT8 flipscreen = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[2]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo MustacheInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 2, "p2 start"} , - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Mustache) - -static struct BurnDIPInfo MustacheDIPList[]= -{ - {0x11, 0xff, 0xff, 0x1d, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x01, 0x01, "Upright" }, - {0x11, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x06, 0x06, "Easy" }, - {0x11, 0x01, 0x06, 0x04, "Normal" }, - {0x11, 0x01, 0x06, 0x02, "Hard" }, - {0x11, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x18, 0x10, "1" }, - {0x11, 0x01, 0x18, 0x18, "3" }, - {0x11, 0x01, 0x18, 0x08, "4" }, - {0x11, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x18, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x18, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Mustache) - -static UINT8 __fastcall mustache_main_read(UINT16 a) -{ - switch (a) - { - case 0xd001: - return t5182_semaphore_snd; - - case 0xd800: - return DrvInputs[0]; - - case 0xd801: - return DrvInputs[1]; - - case 0xd802: - return DrvInputs[2]; - - case 0xd803: - return DrvDips[0]; - - case 0xd804: - return DrvDips[1]; - } - - return 0; -} - -static void __fastcall mustache_main_write(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0xd000: - ZetClose(); - ZetOpen(1); - t5182_setirq_callback(CPU_ASSERT); - ZetClose(); - ZetOpen(0); - return; - - case 0xd002: - case 0xd003: - t5182_semaphore_main = ~a & 1; - return; - - case 0xd806: - scroll = d; - return; - - case 0xd807: - flipscreen = d & 0x01; - video_control = d; - return; - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - DrvZ80ROMDec = Next; Next += 0x008000; - - t5182ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000800; - - t5182SharedRAM = Next; Next += 0x000100; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - t5182Reset(); - - scroll = 0; - video_control = 0; - flipscreen = 0; - - HiscoreReset(); - - return 0; -} - -static UINT8 decrypt_byte(INT32 op, INT32 a, INT32 src) -{ - if ( BIT(a,9) & BIT(a,8)) src ^= 0x80; - if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40; - - if (op) // opcode only - { - if (~BIT(a,13) & BIT(a,12)) src ^= 0x20; - if (~BIT(a,6) & BIT(a,1)) src ^= 0x10; - if (~BIT(a,12) & BIT(a,2)) src ^= 0x08; - } - - if ( BIT(a,11) & ~BIT(a,8) & BIT(a,1)) src ^= 0x04; - if ( BIT(a,13) & ~BIT(a,6) & BIT(a,4)) src ^= 0x02; - if (~BIT(a,11) & BIT(a,9) & BIT(a,2)) src ^= 0x01; - - if (BIT(a,13) & BIT(a,4)) src = BITSWAP08(src,7,6,5,4,3,2,0,1); - if (BIT(a, 8) & BIT(a,4)) src = BITSWAP08(src,7,6,5,4,2,3,1,0); - - if (op) // opcode only - { - if (BIT(a,12) & BIT(a,9)) src = BITSWAP08(src,7,6,4,5,3,2,1,0); - if (BIT(a,11) & ~BIT(a,6)) src = BITSWAP08(src,6,7,5,4,3,2,1,0); - } - - return src; -} - -static void seibu_decrypt() -{ - for (INT32 i = 0; i < 0x8000; i++) - { - DrvZ80ROMDec[i] = decrypt_byte(1,i,DrvZ80ROM[i]); - DrvZ80ROM[i] = decrypt_byte(0,i,DrvZ80ROM[i]); - } -} - -static void decode_gfx() -{ - INT32 i; - INT32 G1 = 0xc000/3; - INT32 G2 = 0x20000/2; - UINT8 *gfx1 = DrvGfxROM0; - UINT8 *gfx2 = DrvGfxROM1; - UINT8 *buf = (UINT8*)BurnMalloc(0x20000); - - /* BG data lines */ - for (i=0;i> 8; - buf[i+G1*2] = w & 0xff; - } - - /* BG address lines */ - for (i = 0; i < 3*G1; i++) - gfx1[i] = buf[BITSWAP16(i,15,14,13,2,1,0,12,11,10,9,8,7,6,5,4,3)]; - - /* SPR data lines */ - for (i=0;i> 8; - buf[i+G2] = w & 0xff; - } - - /* SPR address lines */ - for (i = 0; i < 2*G2; i++) - gfx2[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,16,15,12,11,10,9,8,7,6,5,4,13,14,3,2,1,0)]; - - BurnFree(buf); -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { 0x00000, 0x20000, 0x40000 }; - INT32 Plane1[4] = { 0x40000, 0xc0000, 0x00000, 0x80000 }; - INT32 XOffs0[8] = { STEP8(7,-1) }; - INT32 XOffs1[16] = { STEP16(15,-1) }; - INT32 YOffs0[8] = { STEP8(0,8) }; - INT32 YOffs1[16] = { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x0c000); - - GfxDecode(0x0800, 3, 8, 8, Plane0, XOffs0, YOffs0, 0x40, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x20000); - - GfxDecode(0x0400, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0;i < 256;i++) - { - INT32 bit0,bit1,bit2,bit3,r,g,b; - - /* red component */ - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - bit3 = (DrvColPROM[i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - /* green component */ - bit0 = (DrvColPROM[i + 256] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 256] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 256] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 256] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - /* blue component */ - bit0 = (DrvColPROM[i + 512] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 512] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 512] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 512] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(56.747); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x08000, 1, 1)) return 1; - - if (BurnLoadRom(t5182ROM + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(t5182ROM + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 13, 1)) return 1; - - seibu_decrypt(); - decode_gfx(); - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80ROMDec, 0x0000, 0x7fff, MAP_FETCHOP); - ZetMapMemory(DrvVidRAM, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(t5182SharedRAM, 0xd400, 0xd4ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0xf000, 0xffff, MAP_RAM); - ZetSetWriteHandler(mustache_main_write); - ZetSetReadHandler(mustache_main_read); - ZetClose(); - - t5182Init(1, 14318180/4); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - t5182Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(INT32 rows_start, INT32 rows_end) -{ - INT32 scrollx[4] = { 0x100 - scroll, 0x100 - scroll, 0x100 - scroll, 0x100 }; - - for (INT32 offs = rows_start * 64; offs < 64 * rows_end; offs++) - { - INT32 sx = (~offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= scrollx[(sy / 0x40) & 3] + 8; - if (sx < -7) sx += 512; - sy -= 8; - - if (sx >= nScreenWidth || sy >= nScreenHeight || sy <= -7) continue; - - INT32 attr = DrvVidRAM[offs * 2 + 1]; - INT32 code = DrvVidRAM[offs * 2 + 0] + ((attr & 0x60) << 3) + ((video_control & 0x08) << 7); - INT32 color = attr & 0x0f; - - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x80; - - if (flipscreen) { - sx = 232 - sx; - sy = 240 - sy; - - flipx ^= 0x10; - flipy ^= 0x80; - } - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x0800; offs += 4) - { - INT32 sy = (240-DrvSprRAM[offs]) ; - INT32 sx = (240-DrvSprRAM[offs+3]) - 8; - INT32 attr = DrvSprRAM[offs+1]; - INT32 code = DrvSprRAM[offs+2] + ((attr & 0x0c) << 6); - INT32 color = (attr & 0xe0)>>5; - - if (flipscreen) - { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, (232 - sx) - 8, (232 - sy) + 8, color, 4, 0, 0x80, DrvGfxROM1); - } - else - { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 4, 0, 0x80, DrvGfxROM1); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalc = 0; - DrvPaletteInit(); - } - - // Hack-ish - should clip sprites rather than just draw over them - INT32 all_rows = (video_control & 0x0a) ? 1 : 0; - - draw_layer(0, (all_rows) ? 32: 24); - draw_sprites(); - if (all_rows == 0) draw_layer(24,32); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - t5182_coin_input = (DrvJoy4[0] << 0) | (DrvJoy4[1] << 1); - } - - INT32 nSegment; - INT32 nInterleave = 16; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 105732, 63079 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - - nSegment = ((nCyclesTotal[0] / nInterleave) * (i + 1)) - ZetTotalCycles(); - - nCyclesDone[0] += ZetRun(nSegment); - - if (i == 0) { - ZetSetVector(0x08); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - if (i == 12) { - ZetSetVector(0x10); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - ZetClose(); - - ZetOpen(1); // t5182 - - nSegment = ((nCyclesTotal[1] / nInterleave) * (i + 1)) - ZetTotalCycles(); - - nCyclesDone[1] += ZetRun(nSegment); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - - ZetClose(); - } - - ZetOpen(1); // t5182 - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029729; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - t5182Scan(nAction); - - SCAN_VAR(scroll); - SCAN_VAR(video_control); - SCAN_VAR(flipscreen); - } - - return 0; -} - - -// Mustache Boy (Japan) - -static struct BurnRomInfo mustacheRomDesc[] = { - { "mustache.h18", 0x8000, 0x123bd9b8, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "mustache.h16", 0x4000, 0x62552beb, 1 | BRF_PRG | BRF_ESS }, // 1 - -#if !defined (ROM_VERIFY) - { "t5182.rom", 0x2000, 0xd354c8fc, 2 | BRF_PRG | BRF_ESS }, // 2 t5182 (Z80 #1) Code -#else - { "", 0x0000, 0x00000000, 2 | BRF_PRG | BRF_ESS }, // 2 t5182 (Z80 #1) Code -#endif - { "mustache.e5", 0x8000, 0xefbb1943, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "mustache.a13", 0x4000, 0x9baee4a7, 3 | BRF_GRA }, // 4 Background Tiles - { "mustache.a14", 0x4000, 0x8155387d, 3 | BRF_GRA }, // 5 - { "mustache.a16", 0x4000, 0x4db4448d, 3 | BRF_GRA }, // 6 - - { "mustache.a4", 0x8000, 0xd5c3bbbf, 4 | BRF_GRA }, // 7 Sprites - { "mustache.a7", 0x8000, 0xe2a6012d, 4 | BRF_GRA }, // 8 - { "mustache.a5", 0x8000, 0xc975fb06, 4 | BRF_GRA }, // 9 - { "mustache.a8", 0x8000, 0x2e180ee4, 4 | BRF_GRA }, // 10 - - { "mustache.c3", 0x0100, 0x68575300, 5 | BRF_GRA }, // 11 Color PROMs - { "mustache.c2", 0x0100, 0xeb008d62, 5 | BRF_GRA }, // 12 - { "mustache.c1", 0x0100, 0x65da3604, 5 | BRF_GRA }, // 13 - - { "mustache.b6", 0x1000, 0x5f83fa35, 5 | BRF_GRA | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(mustache) -STD_ROM_FN(mustache) - -struct BurnDriver BurnDrvMustache = { - "mustache", NULL, NULL, NULL, "1987", - "Mustache Boy (Japan)\0", NULL, "Seibu Kaihatsu (March license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mustacheRomInfo, mustacheRomName, NULL, NULL, MustacheInputInfo, MustacheDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 248, 240, 3, 4 -}; - - -// Mustache Boy (Italy) - -static struct BurnRomInfo mustacheiRomDesc[] = { - { "1.h18", 0x8000, 0x22893fbc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2.h16", 0x4000, 0xec70cfd3, 1 | BRF_PRG | BRF_ESS }, // 1 - -#if !defined (ROM_VERIFY) - { "t5182.rom", 0x2000, 0xd354c8fc, 2 | BRF_PRG | BRF_ESS }, // 2 t5182 (Z80 #1) Code -#else - { "", 0x0000, 0x00000000, 2 | BRF_PRG | BRF_ESS }, // 2 t5182 (Z80 #1) Code -#endif - { "10.e5", 0x8000, 0xefbb1943, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "5.a13", 0x4000, 0x9baee4a7, 3 | BRF_GRA }, // 4 Background Tiles - { "4.a15", 0x4000, 0x8155387d, 3 | BRF_GRA }, // 5 - { "3.a16", 0x4000, 0x4db4448d, 3 | BRF_GRA }, // 6 - - { "6.a4", 0x8000, 0x4a95a89c, 4 | BRF_GRA }, // 7 Sprites - { "8.a7", 0x8000, 0x3e6be0fb, 4 | BRF_GRA }, // 8 - { "7.a5", 0x8000, 0x8ad38884, 4 | BRF_GRA }, // 9 - { "9.a8", 0x8000, 0x3568c158, 4 | BRF_GRA }, // 10 - - { "d.c3", 0x0100, 0x68575300, 5 | BRF_GRA }, // 11 Color PROMs - { "c.c2", 0x0100, 0xeb008d62, 5 | BRF_GRA }, // 12 - { "b.c1", 0x0100, 0x65da3604, 5 | BRF_GRA }, // 13 - - { "a.b6", 0x1000, 0x5f83fa35, 5 | BRF_GRA | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(mustachei) -STD_ROM_FN(mustachei) - -struct BurnDriver BurnDrvMustachei = { - "mustachei", "mustache", NULL, NULL, "1987", - "Mustache Boy (Italy)\0", NULL, "Seibu Kaihatsu (IG SPA licence)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mustacheiRomInfo, mustacheiRomName, NULL, NULL, MustacheInputInfo, MustacheDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 248, 240, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_mystston.cpp b/jan/src/burn/drv/pre90s/d_mystston.cpp deleted file mode 100644 index 909098740..000000000 --- a/jan/src/burn/drv/pre90s/d_mystston.cpp +++ /dev/null @@ -1,855 +0,0 @@ -// FB Alpha Mysterious Stones Driver Module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv6502ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *Drv6502RAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; - -static UINT8 *flipscreen; -static UINT8 *soundlatch; -static UINT8 *scrolly; -static UINT8 *video_control; - -static INT16 *pAY8910Buf = NULL; -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 ay8910_select; -static INT32 vblank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy2 + 6, "p1 start" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 0, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 1, "p1 left" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy1 + 7, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy2 + 7, "p2 start" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 0, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 1, "p2 left" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up", }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip 1" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip 2" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x11, 0xff, 0xff, 0xfb, NULL }, - {0x12, 0xff, 0xff, 0x1f, NULL }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x11, 0x01, 0x01, 0x01, "3" }, - {0x11, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x11, 0x01, 0x02, 0x02, "Easy" }, - {0x11, 0x01, 0x02, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x12, 0x01, 0x03, 0x00, "2C 1C" }, - {0x12, 0x01, 0x03, 0x03, "1C 1C" }, - {0x12, 0x01, 0x03, 0x02, "1C 2C" }, - {0x12, 0x01, 0x03, 0x01, "1C 3C" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x12, 0x01, 0x0c, 0x00, "2C 1C" }, - {0x12, 0x01, 0x0c, 0x0c, "1C 1C" }, - {0x12, 0x01, 0x0c, 0x08, "1C 2C" }, - {0x12, 0x01, 0x0c, 0x04, "1C 3C" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, -}; - -STDDIPINFO(Drv) - -static void mystston_soundcontrol(UINT8 data) -{ - if (((ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00)) - { - AY8910Write(0, (ay8910_select & 0x10) ? 0 : 1, *soundlatch); - } - - if (((ay8910_select & 0x80) == 0x80) && ((data & 0x80) == 0x00)) - { - AY8910Write(1, (ay8910_select & 0x40) ? 0 : 1, *soundlatch); - } - - ay8910_select = data; -} - -UINT8 mystston_read(UINT16 address) -{ - switch (address & ~0x1f8f) - { - case 0x2000: - return DrvInputs[0]; - - case 0x2010: - return DrvInputs[1]; - - case 0x2020: - return DrvDips[0]; - - case 0x2030: - return DrvDips[1] | vblank; - } - - return 0; -} - -void mystston_write(UINT16 address, UINT8 data) -{ - if ((address & 0xe060) == 0x2060) { - DrvPalRAM[address & 0x1f] = data; - return; - } - - switch (address & ~0x1f8f) - { - case 0x2000: - *video_control = data; - return; - - case 0x2010: - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_NONE); - break; - - case 0x2020: - *scrolly = data; - break; - - case 0x2030: - *soundlatch = data; - break; - - case 0x2040: - mystston_soundcontrol(data); - break; - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - AY8910Reset(0); - AY8910Reset(1); - - ay8910_select = 0; - - return 0; -} - -#define MAX_NETS 3 -#define MAX_RES_PER_NET 18 -#define Combine2Weights(tab,w0,w1) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5)) -#define Combine3Weights(tab,w0,w1,w2) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5)) - -static double ComputeResistorWeights(INT32 MinVal, INT32 MaxVal, double Scaler, INT32 Count1, const INT32 *Resistances1, double *Weights1, INT32 PullDown1, INT32 PullUp1, INT32 Count2, const INT32 *Resistances2, double *Weights2, INT32 PullDown2, INT32 PullUp2, INT32 Count3, const INT32 *Resistances3, double *Weights3, INT32 PullDown3, INT32 PullUp3) -{ - INT32 NetworksNum; - - INT32 ResCount[MAX_NETS]; - double r[MAX_NETS][MAX_RES_PER_NET]; - double w[MAX_NETS][MAX_RES_PER_NET]; - double ws[MAX_NETS][MAX_RES_PER_NET]; - INT32 r_pd[MAX_NETS]; - INT32 r_pu[MAX_NETS]; - - double MaxOut[MAX_NETS]; - double *Out[MAX_NETS]; - - INT32 i, j, n; - double Scale; - double Max; - - NetworksNum = 0; - for (n = 0; n < MAX_NETS; n++) { - INT32 Count, pd, pu; - const INT32 *Resistances; - double *Weights; - - switch (n) { - case 0: { - Count = Count1; - Resistances = Resistances1; - Weights = Weights1; - pd = PullDown1; - pu = PullUp1; - break; - } - - case 1: { - Count = Count2; - Resistances = Resistances2; - Weights = Weights2; - pd = PullDown2; - pu = PullUp2; - break; - } - - case 2: - default: { - Count = Count3; - Resistances = Resistances3; - Weights = Weights3; - pd = PullDown3; - pu = PullUp3; - break; - } - } - - if (Count > 0) { - ResCount[NetworksNum] = Count; - for (i = 0; i < Count; i++) { - r[NetworksNum][i] = 1.0 * Resistances[i]; - } - Out[NetworksNum] = Weights; - r_pd[NetworksNum] = pd; - r_pu[NetworksNum] = pu; - NetworksNum++; - } - } - - for (i = 0; i < NetworksNum; i++) { - double R0, R1, Vout, Dst; - - for (n = 0; n < ResCount[i]; n++) { - R0 = (r_pd[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pd[i]; - R1 = (r_pu[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pu[i]; - - for (j = 0; j < ResCount[i]; j++) { - if (j == n) { - if (r[i][j] != 0.0) R1 += 1.0 / r[i][j]; - } else { - if (r[i][j] != 0.0) R0 += 1.0 / r[i][j]; - } - } - - R0 = 1.0/R0; - R1 = 1.0/R1; - Vout = (MaxVal - MinVal) * R0 / (R1 + R0) + MinVal; - - Dst = (Vout < MinVal) ? MinVal : (Vout > MaxVal) ? MaxVal : Vout; - - w[i][n] = Dst; - } - } - - j = 0; - Max = 0.0; - for (i = 0; i < NetworksNum; i++) { - double Sum = 0.0; - - for (n = 0; n < ResCount[i]; n++) Sum += w[i][n]; - - MaxOut[i] = Sum; - if (Max < Sum) { - Max = Sum; - j = i; - } - } - - if (Scaler < 0.0) { - Scale = ((double)MaxVal) / MaxOut[j]; - } else { - Scale = Scaler; - } - - for (i = 0; i < NetworksNum; i++) { - for (n = 0; n < ResCount[i]; n++) { - ws[i][n] = w[i][n] * Scale; - (Out[i])[n] = ws[i][n]; - } - } - - return Scale; -} - - -static void DrvPaletteUpdate(UINT8 *p, INT32 offs) -{ - static const int resistances_tiles_rg[3] = { 4700, 3300, 1500 }; - static const int resistances_tiles_b[2] = { 3300, 1500 }; - - double weights_tiles_rg[3], weights_tiles_b[2]; - - ComputeResistorWeights(0, 0xff, -1.0, - 3, &resistances_tiles_rg[0], weights_tiles_rg, 0, 4700, - 2, &resistances_tiles_b[0], weights_tiles_b, 0, 4700, - 0, NULL, NULL, 0, 0); - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0 = (p[i] >> 0) & 0x01; - INT32 bit1 = (p[i] >> 1) & 0x01; - INT32 bit2 = (p[i] >> 2) & 0x01; - INT32 r = Combine3Weights(weights_tiles_rg, bit0, bit1, bit2); - - bit0 = (p[i] >> 3) & 0x01; - bit1 = (p[i] >> 4) & 0x01; - bit2 = (p[i] >> 5) & 0x01; - INT32 g = Combine3Weights(weights_tiles_rg, bit0, bit1, bit2); - - bit0 = (p[i] >> 6) & 0x01; - bit1 = (p[i] >> 7) & 0x01; - INT32 b = Combine2Weights(weights_tiles_b, bit0, bit1); - - DrvPalette[offs + i] = BurnHighCol(r, g, b, 0); - } -} -#undef MAX_NETS -#undef MAX_RES_PER_NET -#undef Combine2Weights -#undef Combine3Weights - -static INT32 DrvGfxDecode() -{ - static INT32 Planes[3] = { RGN_FRAC(0xc000,2,3), RGN_FRAC(0xc000,1,3), RGN_FRAC(0xc000,0,3) }; - static INT32 XOffs[16] = { STEP8(128, 1), STEP8(0, 1) }; - static INT32 YOffs[16] = { STEP16(0, 8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x10000); - - GfxDecode(0x800, 3, 8, 8, Planes, XOffs + 8, YOffs, 0x040, tmp, DrvGfxROM0); - GfxDecode(0x200, 3, 16, 16, Planes, XOffs + 0, YOffs, 0x100, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM1, 0x10000); - - GfxDecode(0x200, 3, 16, 16, Planes, XOffs + 0, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv6502ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0040 * sizeof(UINT32); - - AllRam = Next; - - Drv6502RAM = Next; Next += 0x001000; - DrvFgRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000020; - - flipscreen = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - scrolly = Next; Next += 0x000001; - video_control = Next; Next += 0x000001; - - RamEnd = Next; - - DrvSprRAM = Drv6502RAM + 0x0780; - - MemEnd = Next; - - return 0; -} - -// nBurnSoundLen changes if the refresh rate is changed, but this only -// occurs AFTER the init is called, so we can't allocate this there, so -// we call it during the frame function. -static void SoundBufferAlloc() -{ - pAY8910Buf = (INT16*)BurnMalloc(nBurnSoundLen * 6 * sizeof(INT16)); - - for (INT32 i = 0; i < 6; i++) { - pAY8910Buffer[i] = pAY8910Buf + i * nBurnSoundLen; - } -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(57.445); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv6502ROM + 0x4000, 0, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x6000, 1, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x8000, 2, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0xa000, 3, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0xc000, 4, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0xe000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x6000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xa000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x6000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x8000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xa000, 17, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 18, 1)) return 1; - - if (DrvGfxDecode()) return 1; - - DrvPaletteUpdate(DrvColPROM, 0x20); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Drv6502RAM, 0x0000, 0x0fff, MAP_RAM); - M6502MapMemory(DrvFgRAM, 0x1000, 0x17ff, MAP_RAM); - M6502MapMemory(DrvBgRAM, 0x1800, 0x1fff, MAP_RAM); - M6502MapMemory(Drv6502ROM + 0x4000, 0x4000, 0xffff, MAP_ROM); - M6502SetWriteHandler(mystston_write); - M6502SetReadHandler(mystston_read); - M6502Close(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - BurnFree(pAY8910Buf); - - return 0; -} - -static void draw_bg_layer() -{ - INT32 page = (*video_control & 0x04) * 256; - - for (INT32 offs = 0; offs < 16 * 32; offs++) - { - INT32 sy = ((offs & 0x1f) * 16); - INT32 sx = ((offs / 0x20) ^ 0x0f) * 16; - - sy -= *scrolly; - if (sy < -15) sy += 256; - - INT32 code = (DrvBgRAM[page + offs]) + ((DrvBgRAM[page + 0x200 + offs] & 0x01) * 256); - INT32 flipy = offs & 0x10; - INT32 flipx = 0; - - if (*flipscreen) { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy - 8, 0, 3, 0x10, DrvGfxROM1); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy - 8, 0, 3, 0x10, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy - 8, 0, 3, 0x10, DrvGfxROM1); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy - 8, 0, 3, 0x10, DrvGfxROM1); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x60; offs += 4) - { - INT32 attr = DrvSprRAM[offs]; - - if (attr & 0x01) - { - INT32 code = ((attr & 0x10) << 4) | DrvSprRAM[offs + 1]; - INT32 color = (attr & 0x08) >> 3; - INT32 flipx = attr & 0x04; - INT32 flipy = attr & 0x02; - INT32 sx = 240 - DrvSprRAM[offs + 3]; - INT32 sy = (240 - DrvSprRAM[offs + 2]) & 0xff; - - if (*flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0, DrvGfxROM2); - } - } - } - } -} - -static void draw_fg_layer() -{ - INT32 color = ((*video_control & 1) << 1) + ((*video_control & 0x02) >> 1); - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = ((offs & 0x1f) * 8); - INT32 sx = ((offs / 0x20) ^ 0x1f) * 8; - - INT32 code = DrvFgRAM[offs] + ((DrvFgRAM[0x400 + offs] & 0x07) * 256); - INT32 flipxy = 0; - - if (*flipscreen) { - sx = 248 - sx; - sy = 248 - sy; - flipxy = !flipxy; - } - - if (flipxy) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0x20, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 3, 0, 0x20, DrvGfxROM0); - } - } -} - -static INT32 DrvDraw() -{ - *flipscreen = (*video_control & 0x80) ^ ((DrvDips[0] & 0x20) << 2); - - if (DrvRecalc) { - DrvPaletteUpdate(DrvColPROM, 0x20); - DrvRecalc = 0; - } - - DrvPaletteUpdate(DrvPalRAM, 0); - - draw_bg_layer(); - draw_sprites(); - draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void mystston_interrupt_handler(INT32 scanline) -{ - static INT32 coin; - INT32 inp = (DrvJoy1[6] << 6) | (DrvJoy1[7] << 7); - - if ((~inp & 0xc0) != 0xc0) - { - if (coin == 0) - { - coin = 1; - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - return; - } - } - else coin = 0; - - if (scanline == 8) vblank = 0; - if (scanline == 248) vblank = 0x80; - if ((scanline & 0x0f) == 0) M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_ACK); -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - if (pAY8910Buf == NULL) { // Refresh rate != 60 - SoundBufferAlloc(); - } - - { - memset (DrvInputs, 0xff, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nTotalCycles = (INT32)((double)(1500000 / 57.45)); - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 272; - INT32 nCyclesRun = 0; - - vblank = 0x80; - - M6502Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesRun += M6502Run(nTotalCycles / nInterleave); - mystston_interrupt_handler(i); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - M6502Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029722; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(ay8910_select); - } - - return 0; -} - - -// Mysterious Stones - Dr. John's Adventure - -static struct BurnRomInfo myststonRomDesc[] = { - { "rom6.bin", 0x2000, 0x7bd9c6cd, 1 | BRF_PRG | BRF_ESS }, // 0 M6205 Code - { "rom5.bin", 0x2000, 0xa83f04a6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rom4.bin", 0x2000, 0x46c73714, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rom3.bin", 0x2000, 0x34f8b8a3, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rom2.bin", 0x2000, 0xbfd22cfc, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rom1.bin", 0x2000, 0xfb163e38, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "ms6", 0x2000, 0x85c83806, 2 | BRF_GRA }, // 6 Character + Sprite Tiles - { "ms9", 0x2000, 0xb146c6ab, 2 | BRF_GRA }, // 7 - { "ms7", 0x2000, 0xd025f84d, 2 | BRF_GRA }, // 8 - { "ms10", 0x2000, 0xd85015b5, 2 | BRF_GRA }, // 9 - { "ms8", 0x2000, 0x53765d89, 2 | BRF_GRA }, // 10 - { "ms11", 0x2000, 0x919ee527, 2 | BRF_GRA }, // 11 - - { "ms12", 0x2000, 0x72d8331d, 3 | BRF_GRA }, // 12 Background Tiles - { "ms13", 0x2000, 0x845a1f9b, 3 | BRF_GRA }, // 13 - { "ms14", 0x2000, 0x822874b0, 3 | BRF_GRA }, // 14 - { "ms15", 0x2000, 0x4594e53c, 3 | BRF_GRA }, // 15 - { "ms16", 0x2000, 0x2f470b0f, 3 | BRF_GRA }, // 16 - { "ms17", 0x2000, 0x38966d1b, 3 | BRF_GRA }, // 17 - - { "ic61", 0x0020, 0xe802d6cf, 4 | BRF_GRA }, // 18 Color Prom -}; - -STD_ROM_PICK(mystston) -STD_ROM_FN(mystston) - -struct BurnDriver BurnDrvmystston = { - "mystston", NULL, NULL, NULL, "1984", - "Mysterious Stones - Dr. John's Adventure\0", NULL, "Technos", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TECHNOS, GBF_MAZE, 0, - NULL, myststonRomInfo, myststonRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 64, - 240, 256, 3, 4 -}; - - -// Mysterious Stones - Dr. Kick in Adventure - -static struct BurnRomInfo myststnoRomDesc[] = { - { "ms0", 0x2000, 0x6dacc05f, 1 | BRF_PRG | BRF_ESS }, // 0 M6205 Code - { "ms1", 0x2000, 0xa3546df7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ms2", 0x2000, 0x43bc6182, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ms3", 0x2000, 0x9322222b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ms4", 0x2000, 0x47cefe9b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ms5", 0x2000, 0xb37ae12b, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "ms6", 0x2000, 0x85c83806, 2 | BRF_GRA }, // 6 Character + Sprite Tiles - { "ms9", 0x2000, 0xb146c6ab, 2 | BRF_GRA }, // 7 - { "ms7", 0x2000, 0xd025f84d, 2 | BRF_GRA }, // 8 - { "ms10", 0x2000, 0xd85015b5, 2 | BRF_GRA }, // 9 - { "ms8", 0x2000, 0x53765d89, 2 | BRF_GRA }, // 10 - { "ms11", 0x2000, 0x919ee527, 2 | BRF_GRA }, // 11 - - { "ms12", 0x2000, 0x72d8331d, 3 | BRF_GRA }, // 12 Background Tiles - { "ms13", 0x2000, 0x845a1f9b, 3 | BRF_GRA }, // 13 - { "ms14", 0x2000, 0x822874b0, 3 | BRF_GRA }, // 14 - { "ms15", 0x2000, 0x4594e53c, 3 | BRF_GRA }, // 15 - { "ms16", 0x2000, 0x2f470b0f, 3 | BRF_GRA }, // 16 - { "ms17", 0x2000, 0x38966d1b, 3 | BRF_GRA }, // 17 - - { "ic61", 0x0020, 0xe802d6cf, 4 | BRF_GRA }, // 18 Color Prom -}; - -STD_ROM_PICK(myststno) -STD_ROM_FN(myststno) - -struct BurnDriver BurnDrvmyststno = { - "myststono", "mystston", NULL, NULL, "1984", - "Mysterious Stones - Dr. Kick in Adventure\0", NULL, "Technos", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TECHNOS, GBF_MAZE, 0, - NULL, myststnoRomInfo, myststnoRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 64, - 240, 256, 3, 4 -}; - -// Mysterious Stones - Dr. Kick in Adventure (Itisa PCB) - -static struct BurnRomInfo myststniRomDesc[] = { - { "14.bin", 0x2000, 0x78bf2a58, 1 | BRF_PRG | BRF_ESS }, // 0 M6205 Code - { "13.bin", 0x2000, 0xa3546df7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "12.bin", 0x2000, 0x43bc6182, 1 | BRF_PRG | BRF_ESS }, // 2 - { "11.bin", 0x2000, 0x9322222b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "8.bin", 0x2000, 0x47cefe9b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "7.bin", 0x2000, 0xb37ae12b, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "18.bin", 0x2000, 0x85c83806, 2 | BRF_GRA }, // 6 Character + Sprite Tiles - { "15.bin", 0x2000, 0xb146c6ab, 2 | BRF_GRA }, // 7 - { "19.bin", 0x2000, 0xd025f84d, 2 | BRF_GRA }, // 8 - { "16.bin", 0x2000, 0xd85015b5, 2 | BRF_GRA }, // 9 - { "20.bin", 0x2000, 0x53765d89, 2 | BRF_GRA }, // 10 - { "17.bin", 0x2000, 0x919ee527, 2 | BRF_GRA }, // 11 - - { "1.bin", 0x2000, 0x72d8331d, 3 | BRF_GRA }, // 12 Background Tiles - { "2.bin", 0x2000, 0x845a1f9b, 3 | BRF_GRA }, // 13 - { "3.bin", 0x2000, 0x822874b0, 3 | BRF_GRA }, // 14 - { "4.bin", 0x2000, 0x4594e53c, 3 | BRF_GRA }, // 15 - { "5.bin", 0x2000, 0x2f470b0f, 3 | BRF_GRA }, // 16 - { "6.bin", 0x2000, 0x38966d1b, 3 | BRF_GRA }, // 17 - - { "82s123.bin", 0x0020, 0xe802d6cf, 4 | BRF_GRA }, // 18 Color Prom - - { "pal10l8.bin", 0x002c, 0x2d4d034c, 0 | BRF_OPT }, // 19 - { "pal16r4-1.bin",0x0104, 0xc57555d0, 0 | BRF_OPT }, // 20 - { "pal16r4-2.bin",0x0104, 0xc57555d0, 0 | BRF_OPT }, // 21 -}; - -STD_ROM_PICK(myststni) -STD_ROM_FN(myststni) - -struct BurnDriver BurnDrvmyststni = { - "myststonoi", "mystston", NULL, NULL, "1984", - "Mysterious Stones - Dr. Kick in Adventure (Itisa PCB)\0", NULL, "Technos", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TECHNOS, GBF_MAZE, 0, - NULL, myststniRomInfo, myststniRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 64, - 240, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_namcos1.cpp b/jan/src/burn/drv/pre90s/d_namcos1.cpp deleted file mode 100644 index 997315f97..000000000 --- a/jan/src/burn/drv/pre90s/d_namcos1.cpp +++ /dev/null @@ -1,4092 +0,0 @@ -// FB Alpha Namco System 1 driver module -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "m6800_intf.h" -#include "burn_ym2151.h" -#include "namco_snd.h" -#include "dac.h" -#include "driver.h" - -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *AllMem; -static UINT8 *MemEnd; - -static UINT8 *DrvMainROM; -static UINT8 *DrvSoundROM; -static UINT8 *DrvMCUROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvMainRAM; -static UINT8 *DrvTriRAM; -static UINT8 *DrvSoundRAM; -static UINT8 *DrvMCURAM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvPfCtrl; - -static UINT8 *DrvTransTable; - -static UINT8 *DrvPalRAMR; -static UINT8 *DrvPalRAMG; -static UINT8 *DrvPalRAMB; -static UINT16 *DrvPalRegs; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 sub_cpu_reset; -static UINT8 sub_cpu_in_reset; -static INT32 shared_watchdog; - -static UINT32 bank_offsets[2][8]; -static UINT8 sound_bank; -static UINT8 mcu_bank; - -static INT32 dac0_value; -static INT32 dac1_value; -static INT32 dac0_gain; -static INT32 dac1_gain; - -static INT32 buffer_sprites; -static UINT8 mcu_patch_data; -static UINT8 coin_lockout; - -static UINT8 (*input_read_callback)(INT32 offset) = NULL; - -static UINT8 (*key_read_callback)(INT32 offset) = NULL; -static void (*key_write_callback)(INT32 offset, UINT8 data) = NULL; - -static UINT16 namcos1_key_id; -static UINT8 namcos1_key[8]; -static UINT32 namcos1_key_numerator_high_word; -static UINT32 namcos1_key_quotient; -static UINT32 namcos1_key_reminder; -static INT32 namcos1_key_reg; -static INT32 namcos1_key_rng; -static INT32 namcos1_key_swap4; -static INT32 namcos1_key_bottom4; -static INT32 namcos1_key_top4; -static INT32 namcos1_key_swap4_arg; - -static INT32 input_count; -static INT32 strobe_count; -static UINT8 stored_input[2]; - -static INT32 watchdog; -static INT32 flipscreen; -static INT32 clip_min_x; -static INT32 clip_max_x; -static INT32 clip_min_y; -static INT32 clip_max_y; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvJoy6[8]; -static UINT8 DrvJoy7[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[7]; -static UINT8 DrvReset; - -static INT16 Paddle[2]; // quester -static UINT8 quester = 0; // use paddle? - -static UINT8 sixtyhz = 0; // some games only like 60hz -static UINT8 dac_kludge = 0; // dac is fine-tuned to each game, due to cycle-inaccuracy of our m680x cores. - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo Tankfrce4InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy4 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy4 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy4 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy4 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy6 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy6 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy6 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy6 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy6 + 4, "p2 fire 1" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p3 coin" }, - {"P3 Up", BIT_DIGITAL, DrvJoy5 + 3, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy5 + 2, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy5 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy5 + 0, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy5 + 4, "p3 fire 1" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p4 coin" }, - {"P4 Up", BIT_DIGITAL, DrvJoy7 + 3, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy7 + 2, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy7 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy7 + 0, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy7 + 4, "p4 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Tankfrce4) - -static struct BurnInputInfo FaceoffInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Left Stick Up", BIT_DIGITAL, DrvJoy4 + 3, "p1 up" }, - {"P1 Left Stick Down", BIT_DIGITAL, DrvJoy4 + 2, "p1 down" }, - {"P1 Left Stick Left", BIT_DIGITAL, DrvJoy4 + 1, "p1 left" }, - {"P1 Left Stick Right", BIT_DIGITAL, DrvJoy4 + 0, "p1 right" }, - {"P3 Right Stick Up", BIT_DIGITAL, DrvJoy5 + 3, "p3 up" }, - {"P3 Right Stick Down", BIT_DIGITAL, DrvJoy5 + 2, "p3 down" }, - {"P3 Right Stick Left", BIT_DIGITAL, DrvJoy5 + 1, "p3 left" }, - {"P3 Right Stick Right",BIT_DIGITAL, DrvJoy5 + 0, "p3 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy5 + 4, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Left Stick Up", BIT_DIGITAL, DrvJoy6 + 3, "p2 up" }, - {"P2 Left Stick Down", BIT_DIGITAL, DrvJoy6 + 2, "p2 down" }, - {"P2 Left Stick Left", BIT_DIGITAL, DrvJoy6 + 1, "p2 left" }, - {"P2 Left Stick Right", BIT_DIGITAL, DrvJoy6 + 0, "p2 right" }, - {"P4 ight Stick Up", BIT_DIGITAL, DrvJoy7 + 3, "p4 up" }, - {"P4 ight Stick Down", BIT_DIGITAL, DrvJoy7 + 2, "p4 down" }, - {"P4 ight Stick Left", BIT_DIGITAL, DrvJoy7 + 1, "p4 left" }, - {"P4 ight Stick Right", BIT_DIGITAL, DrvJoy7 + 0, "p4 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy6 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy7 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Faceoff) -static struct BurnInputInfo BerabohmInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy5 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy5 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy5 + 2, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvJoy4 + 2, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy7 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy7 + 1, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy7 + 2, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy6 + 0, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvJoy6 + 1, "p2 fire 5" }, - {"P2 Button 6", BIT_DIGITAL, DrvJoy6 + 2, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Berabohm) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo ShadowldDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Alt. sound effects" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Shadowld) - -static struct BurnDIPInfo DspiritDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Life" }, - {0x14, 0x01, 0x7f, 0x7f, "2" }, - {0x14, 0x01, 0x7f, 0x16, "3" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dspirit) - -static struct BurnDIPInfo PacmaniaDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Auto Data Sampling" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Kick Watchdog in IRQ" }, - {0x14, 0x01, 0x20, 0x20, "No" }, - {0x14, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Pacmania) - -static struct BurnDIPInfo Galaga88DIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Auto Data Sampling" }, - {0x14, 0x01, 0x28, 0x28, "Off" }, - {0x14, 0x01, 0x28, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Galaga88) - -static struct BurnDIPInfo Ws89DIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Draw Debug Lines" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ws89) - -static struct BurnDIPInfo DangseedDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Auto Data Sampling" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Kick Watchdog in IRQ" }, - {0x14, 0x01, 0x20, 0x20, "No" }, - {0x14, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dangseed) - -static struct BurnDIPInfo Ws90DIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Draw Debug Lines" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ws90) - -static struct BurnDIPInfo BoxyboyDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Boxyboy) - -static struct BurnDIPInfo PuzlclubDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Auto Data Sampling" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Puzlclub) - -static struct BurnDIPInfo MmazeDIPList[]= -{ - {0x14, 0xff, 0xff, 0x91, NULL }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Mmaze) - -static struct BurnDIPInfo BakutotuDIPList[]= -{ - {0x14, 0xff, 0xff, 0xf9, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sprite Viewer" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Level Selection" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Show Coordinates" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invincibility (Cheat)"}, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Bakutotu) - -static struct BurnDIPInfo WldcourtDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Draw Debug Lines" }, - {0x14, 0x01, 0x7e, 0x7e, "Off" }, - {0x14, 0x01, 0x7e, 0x5c, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Wldcourt) - -static struct BurnDIPInfo Splatter3DIPList[]= -{ - {0x14, 0xff, 0xff, 0xa0+0x17, NULL }, // 0x17 for the strange watchdog settings. - - {0 , 0xfe, 0 , 2, "Stage Select" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Splatter3) - -static struct BurnDIPInfo FaceoffDIPList[]= -{ - {0x1a, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1a, 0x01, 0x80, 0x80, "Off" }, - {0x1a, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Faceoff) - -static struct BurnDIPInfo BerabohmDIPList[]= -{ - {0x1a, 0xff, 0xff, 0xa1, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x1a, 0x01, 0x01, 0x01, "Off" }, - {0x1a, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x1a, 0x01, 0x20, 0x20, "Off" }, - {0x1a, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1a, 0x01, 0x80, 0x80, "Off" }, - {0x1a, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Berabohm) - -static UINT8 faceoff_inputs_read(INT32 offset) -{ - if ((offset & 1) == 0) - { - return (DrvInputs[0] & 0x80) | stored_input[0]; - } - else - { - INT32 res = DrvInputs[1] & 0x80; - - if (++strobe_count > 8) - { - strobe_count = 0; - res |= input_count; - - switch (input_count) - { - case 0: - stored_input[0] = DrvInputs[3] & 0x1f; - stored_input[1] = (DrvInputs[6] & 0x07) << 3; - break; - - case 3: - stored_input[0] = DrvInputs[5] & 0x1f; - break; - - case 4: - stored_input[0] = DrvInputs[4] & 0x1f; - stored_input[1] = DrvInputs[6] & 0x18; - break; - - default: - stored_input[0] = 0x1f; - stored_input[1] = 0x1f; - break; - } - - input_count = (input_count + 1) & 7; - } - else - { - res |= 0x40 | stored_input[1]; - } - - return res; - } -} - -static UINT8 berabohm_buttons_read(INT32 offset) -{ - if ((offset & 1) == 0) - { - INT32 inp = input_count; - - if (inp == 4) - { - return DrvInputs[0]; - } - else - { - INT32 res = DrvInputs[3 + input_count] ^ 0xff; - - if (res & 1) res = 0x7f; // weak - else if (res & 2) res = 0x48; // medium - else if (res & 4) res = 0x40; // strong - - return res; - } - } - else - { - INT32 res = DrvInputs[1] & 0x8f; - - if (++strobe_count > 4) - { - strobe_count = 0; - stored_input[0] ^= 0x40; - if (stored_input[0] == 0) - { - input_count = (input_count + 1) % 5; - if (input_count == 3) res |= 0x10; - } - } - - return res | stored_input[0]; - } -} - -static UINT8 quester_paddle_read(INT32 offset) -{ - if ((offset & 1) == 0) - { - INT32 ret; - - if (!(strobe_count & 0x20)) - ret = (DrvInputs[0]&0x90) | (strobe_count & 0x40) | (Paddle[0]&0x0f); - else - ret = (DrvInputs[0]&0x90) | (strobe_count & 0x40) | (Paddle[1]&0x0f); - - strobe_count ^= 0x40; - - return ret; - } - else - { - INT32 ret; - - if (!(strobe_count & 0x20)) - ret = (DrvInputs[1]&0x90) | 0x00 | (Paddle[0]>>4); - else - ret = (DrvInputs[1]&0x90) | 0x20 | (Paddle[1]>>4); - - if (!(strobe_count & 0x40)) strobe_count ^= 0x20; - - return ret; - } -} - -static UINT8 key_type1_read(INT32 offset) -{ - if (offset < 3) - { - int d = namcos1_key[0]; - int n = (namcos1_key[1] << 8) | namcos1_key[2]; - int q,r; - - if (d) - { - q = n / d; - r = n % d; - } - else - { - q = 0xffff; - r = 0x00; - } - - if (offset == 0) return r; - if (offset == 1) return q >> 8; - if (offset == 2) return q & 0xff; - } - else if (offset == 3) - return namcos1_key_id; - - return 0; -} - -static void key_type1_write(INT32 offset, UINT8 data) -{ - if (offset < 3) - namcos1_key[offset] = data; -} - -static UINT8 key_type2_read(INT32 offset) -{ - namcos1_key_numerator_high_word = 0; - - if (offset < 4) - { - if (offset == 0) return namcos1_key_reminder >> 8; - if (offset == 1) return namcos1_key_reminder & 0xff; - if (offset == 2) return namcos1_key_quotient >> 8; - if (offset == 3) return namcos1_key_quotient & 0xff; - } - else if (offset == 4) - return namcos1_key_id; - - return 0; -} - -static void key_type2_write(INT32 offset, UINT8 data) -{ - if (offset < 5) - { - namcos1_key[offset] = data; - - if (offset == 3) - { - UINT32 d = (namcos1_key[0] << 8) | namcos1_key[1]; - UINT32 n = (namcos1_key_numerator_high_word << 16) | (namcos1_key[2] << 8) | namcos1_key[3]; - - if (d) - { - namcos1_key_quotient = n / d; - namcos1_key_reminder = n % d; - } - else - { - namcos1_key_quotient = 0xffff; - namcos1_key_reminder = 0x0000; - } - - namcos1_key_numerator_high_word = (namcos1_key[2] << 8) | namcos1_key[3]; - } - } -} - -static UINT8 key_type3_read(INT32 offset) -{ - INT32 op = (offset & 0x70) >> 4; - - if (op == namcos1_key_reg) return namcos1_key_id; - if (op == namcos1_key_rng) return BurnRandom(); - if (op == namcos1_key_swap4) return (namcos1_key[namcos1_key_swap4_arg] << 4) | (namcos1_key[namcos1_key_swap4_arg] >> 4); - if (op == namcos1_key_bottom4) return (offset << 4) | (namcos1_key[namcos1_key_swap4_arg] & 0x0f); - if (op == namcos1_key_top4) return (offset << 4) | (namcos1_key[namcos1_key_swap4_arg] >> 4); - - return 0; -} - -static void key_type3_write(INT32 offset, UINT8 data) -{ - namcos1_key[(offset & 0x70) >> 4] = data; -} - -static void namcos1_key_init(INT32 type, UINT16 key, INT32 reg, INT32 rng, INT32 swap4_arg, INT32 swap4, INT32 bottom4, INT32 top4) -{ - switch (type) - { - case 1: - key_read_callback = key_type1_read; - key_write_callback = key_type1_write; - break; - - case 2: - key_read_callback = key_type2_read; - key_write_callback = key_type2_write; - break; - - case 3: - key_read_callback = key_type3_read; - key_write_callback = key_type3_write; - break; - - default: - bprintf (0, _T("namco_key_init called with invalid key type (%d)!\n"), type); - } - - namcos1_key_id = key; - namcos1_key_reg = reg; - namcos1_key_rng = rng; - namcos1_key_swap4_arg = swap4_arg; - namcos1_key_swap4 = swap4; - namcos1_key_bottom4 = bottom4; - namcos1_key_top4 = top4; -} - -static UINT8 namco_c116_read(UINT16 offset) -{ - UINT8 *RAM; - - offset &= 0x7fff; - - switch (offset & 0x1800) - { - case 0x0000: - RAM = DrvPalRAMR; - break; - - case 0x0800: - RAM = DrvPalRAMG; - break; - - case 0x1000: - RAM = DrvPalRAMB; - break; - - default: // case 0x1800 (internal registers) - { - INT32 reg = (offset & 0xf) >> 1; - if (offset & 1) - return DrvPalRegs[reg] & 0xff; - else - return DrvPalRegs[reg] >> 8; - } - } - - return RAM[((offset & 0x6000) >> 2) | (offset & 0x7ff)]; -} - -static void namco_c116_write(UINT16 offset, UINT8 data) -{ - UINT8 *RAM; - - offset &= 0x7fff; - - switch (offset & 0x1800) - { - case 0x0000: - RAM = DrvPalRAMR; - break; - - case 0x0800: - RAM = DrvPalRAMG; - break; - - case 0x1000: - RAM = DrvPalRAMB; - break; - - default: // case 0x1800 (internal registers) - { - INT32 reg = (offset & 0xf) >> 1; - if (offset & 1) - DrvPalRegs[reg] = (DrvPalRegs[reg] & 0xff00) | data; - else - DrvPalRegs[reg] = (DrvPalRegs[reg] & 0x00ff) | (data << 8); - return; - } - } - - int color = ((offset & 0x6000) >> 2) | (offset & 0x7ff); - RAM[color] = data; - - DrvPalette[color] = BurnHighCol(DrvPalRAMR[color], DrvPalRAMG[color], DrvPalRAMB[color], 0); -} - -static UINT8 virtual_read(UINT32 address) -{ - if (address >= 0x2e0000 && address <= 0x2e7fff) { - return namco_c116_read(address & 0x7fff); - } - - if (address >= 0x2f0000 && address <= 0x2f7fff) { - return DrvVidRAM[address & 0x7fff]; - } - - if (address >= 0x2f8000 && address <= 0x2f9fff) { - if (key_read_callback) { - return key_read_callback(address & 0x1fff); - } - return 0; // no key - } - - if (address >= 0x2fc000 && address <= 0x2fcfff) { - return DrvSprRAM[address & 0xfff]; - } - - if (address >= 0x2fe000 && address <= 0x2fefff) { - return namcos1_custom30_read(address & 0x3ff); - } - - if (address >= 0x2ff000 && address <= 0x2fffff) { - return DrvTriRAM[address & 0x7ff]; - } - - if (address >= 0x300000 && address <= 0x307fff) { - return DrvMainRAM[address & 0x7fff]; - } - - if ((address & 0x400000) == 0x400000) { - return DrvMainROM[address & 0x3fffff]; - } - - return 0; -} - -static void virtual_write(UINT32 address, UINT8 data) -{ - if (address >= 0x2c0000 && address <= 0x2c1fff) { - // _3dcs_w (not used) - return; - } - - if (address >= 0x2e0000 && address <= 0x2e7fff) { - namco_c116_write(address & 0x7fff, data); - return; - } - - if (address >= 0x2f0000 && address <= 0x2f7fff) { - DrvVidRAM[address & 0x7fff] = data; - return; - } - - if (address >= 0x2f8000 && address <= 0x2f9fff) { - if (key_write_callback) { - key_write_callback(address & 0x1fff, data); - } - return; - } - - if (address >= 0x2fc000 && address <= 0x2fcfff) { - if (address == 0x2fcff2) buffer_sprites = 1; - DrvSprRAM[address & 0xfff] = data; - return; - } - - if (address >= 0x2fd000 && address <= 0x2fdfff) { - DrvPfCtrl[address & 0x1f] = data; - return; - } - - if (address >= 0x2fe000 && address <= 0x2fefff) { - namcos1_custom30_write(address & 0x3ff, data); - return; - } - - if (address >= 0x2ff000 && address <= 0x2fffff) { - DrvTriRAM[address & 0x7ff] = data; - return; - } - - if (address >= 0x300000 && address <= 0x307fff) { - DrvMainRAM[address & 0x7fff] = data; - return; - } -} - -static void subres_callback(INT32 state) -{ - if (state != sub_cpu_in_reset) - { - mcu_patch_data = 0; - sub_cpu_in_reset = state; - } - - if (state == CPU_IRQSTATUS_ACK) - { - M6809Close(); - - M6809Open(1); - M6809Reset(); - M6809Close(); - - M6809Open(2); - M6809Reset(); - M6809Close(); - - M6809Open(0); - - HD63701Reset(); - } -} - -static void bankswitch(int whichcpu, int whichbank, int a0, UINT8 data) -{ - UINT32 &bank = bank_offsets[whichcpu][whichbank]; - - if (a0 == 0) - bank = (bank & 0x1fe000) | ((data & 0x03) * 0x200000); - else - bank = (bank & 0x600000) | (data * 0x2000); - - INT32 mapbank = whichbank * 0x2000; - - M6809UnmapMemory(mapbank, mapbank + 0x1fff, MAP_RAM); - - if (bank >= 0x400000 && bank <= 0x7fffff) { - M6809MapMemory(DrvMainROM + (bank & 0x3fe000), mapbank, mapbank + 0x1fff, MAP_ROM); - return; - } - - if (bank >= 0x2f0000 && bank <= 0x2f7fff) { - M6809MapMemory(DrvVidRAM + (bank & 0x006000), mapbank, mapbank + 0x1fff, MAP_RAM); - return; - } - - if (bank >= 0x300000 && bank <= 0x307fff) { - M6809MapMemory(DrvMainRAM + (bank & 0x006000), mapbank, mapbank + 0x1fff, MAP_RAM); - return; - } -} - -static void kick_watchdog(int whichcpu) -{ - static const int ALL_CPU_MASK = 7; - - shared_watchdog |= (1 << whichcpu); - - if (shared_watchdog == ALL_CPU_MASK || !sub_cpu_reset) - { - shared_watchdog = 0; - watchdog = 0; - } -} - -static void register_write(int whichcpu, UINT16 offset, UINT8 data) -{ - INT32 reg = (offset >> 9) & 0xf; - - switch (reg) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - bankswitch(whichcpu, reg, offset & 1, data); - break; - - case 8: // F000 - SUBRES (halt/reset everything but main CPU) - if (whichcpu == 0) - { - sub_cpu_reset = data & 1; - subres_callback(sub_cpu_reset ? CLEAR_LINE : ASSERT_LINE); - } - break; - - case 9: // F200 - kick watchdog - kick_watchdog(whichcpu); - break; - - case 11: // F600 - IRQ ack - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - break; - - case 12: // F800 - FIRQ ack - M6809SetIRQLine(1, CPU_IRQSTATUS_NONE); - break; - - case 13: // FA00 - assert FIRQ on sub CPU - if (whichcpu == 0) - { - M6809Close(); - M6809Open(1); - M6809SetIRQLine(1, CPU_IRQSTATUS_ACK); - M6809Close(); - M6809Open(0); - } - break; - - case 14: // FC00 - set initial ROM bank for sub CPU - if (whichcpu == 0) - { - bank_offsets[1][7] = 0x600000 | (data * 0x2000); - - M6809Close(); - M6809Open(1); - M6809MapMemory(DrvMainROM + (bank_offsets[1][7] & 0x3fffff), 0xe000, 0xffff, MAP_ROM); - M6809Close(); - M6809Open(0); - } - break; - } -} - -static inline UINT32 remap(INT32 whichcpu, UINT16 offset) -{ - return bank_offsets[whichcpu][offset>>13] | (offset & 0x1fff); -} - -static void main_write(UINT16 address, UINT8 data) -{ - if (address < 0xe000) - { - virtual_write(remap(0, address), data); - } - else - { - register_write(0, address & 0x1fff, data); - } -} - -static UINT8 main_read(UINT16 address) -{ - return virtual_read(remap(0, address)); -} - -static void sub_write(UINT16 address, UINT8 data) -{ - if (address < 0xe000) - { - virtual_write(remap(1, address), data); - } - else - { - register_write(1, address & 0x1fff, data); - } -} - -static UINT8 sub_read(UINT16 address) -{ - return virtual_read(remap(1, address)); -} - -static void sound_bankswitch(INT32 data) -{ - sound_bank = data; - - INT32 bank = (data & 7) * 0x4000; - - M6809MapMemory(DrvSoundROM + bank, 0x0000, 0x3fff, MAP_ROM); -} - -static void sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0x5000) { - namcos1_custom30_write(address & 0x3ff, data); - return; - } - - switch (address) - { - case 0x4000: - BurnYM2151SelectRegister(data); - return; - - case 0x4001: - BurnYM2151WriteRegister(data); - return; - - case 0xc000: - case 0xc001: - sound_bankswitch(data >> 4); - return; - - case 0xd001: - kick_watchdog(2); - return; - - case 0xe000: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static UINT8 sound_read(UINT16 address) -{ - if ((address & 0xf800) == 0x5000) { - return namcos1_custom30_read(address & 0x3ff); - } - - switch (address) - { - case 0x4000: - case 0x4001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void mcu_bankswitch(INT32 data) -{ - mcu_bank = data; - - INT32 bank = 0; - - switch (data & 0xfc) - { - case 0xf8: bank = 0; data ^= 2; break; // bit 2 : ROM 0, A16 is inverted - case 0xf4: bank = 4; break; // bit 3 : ROM 1 - case 0xec: bank = 8; break; // bit 4 : ROM 2 - case 0xdc: bank = 12; break; // bit 5 : ROM 3 - case 0xbc: bank = 16; break; // bit 6 : ROM 4 - case 0x7c: bank = 20; break; // bit 7 : ROM 5 - default: bank = 0; break; // illegal (selects multiple ROMs at once) - } - - bank += (data & 3); - - HD63701MapMemory(DrvMCUROM + 0x10000 + (bank * 0x8000), 0x4000, 0xbfff, MAP_ROM); -} - -static void reset_dacs() -{ - dac0_value = 0; - dac1_value = 0; - dac0_gain = 0x80; - dac1_gain = 0x80; -} - -static void update_dacs() -{ - DACWrite16(0, (dac0_value * dac0_gain) + (dac1_value * dac1_gain)); -} - -static void mcu_write(UINT16 address, UINT8 data) -{ - if ((address & 0xffe0) == 0x0000) { - m6803_internal_registers_w(address & 0x001f, data); - return; - } - - if ((address & 0xff80) == 0x0080) { - DrvMCURAM[(address & 0x7f)] = data; - return; - } - - if ((address & 0xf800) == 0xc000) { - if (address == 0xc000) { - if (mcu_patch_data == 0xa6) return; - mcu_patch_data = data; - } - DrvTriRAM[address & 0x7ff] = data; - return; - } - - switch (address) - { - case 0xd000: - dac0_value = data - 0x80; - update_dacs(); - return; - - case 0xd400: - dac1_value = data - 0x80; - update_dacs(); - return; - - case 0xd800: - mcu_bankswitch(data); - return; - - case 0xf000: - HD63701SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static UINT8 mcu_read(UINT16 address) -{ - if ((address & 0xffe0) == 0x0000) { - return m6803_internal_registers_r(address & 0x001f); - } - - if ((address & 0xff80) == 0x0080) { - return DrvMCURAM[(address & 0x7f)]; - } - - switch (address) - { - case 0x1000: - case 0x1001: - return 0xf0 | (DrvDips[0] >> 4); - - case 0x1002: - case 0x1003: - return 0xf0 | (DrvDips[0]); - - case 0x1400: - case 0x1401: - if (input_read_callback) return input_read_callback(address & 1); - return DrvInputs[address & 1]; - } - - return 0; -} - -static void mcu_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: - coin_lockout = (data & 1) ? 0 : 0x18; - return; - - case HD63701_PORT2: - { - INT32 value = (data & 1) | ((data >> 1) & 2); - dac0_gain = 0x20 * (value+1); - - value = (data >> 3) & 3; - dac1_gain = 0x20 * (value+1); - update_dacs(); - } - return; - } -} - -static UINT8 mcu_read_port(UINT16 port) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: - return (DrvInputs[2] & 0xf8) | coin_lockout; // coin - - case HD63701_PORT2: - return 0; - } - - return 0; -} - -static INT32 DrvDACSync() // sync to hd63701 (m6800 core) -{ - return (INT32)(float)(nBurnSoundLen * (M6800TotalCycles() / (1536000.0000 / ((nBurnFPS / 100.0000) - dac_kludge)))); -} - -static void YM2151IrqHandler(INT32 status) -{ - if (M6809GetActive() == -1) return; - - M6809SetIRQLine(1, (status) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void set_initial_map_banks() -{ - for (INT32 i = 0; i < 8*2; i++) { - bank_offsets[i/8][i&7] = 0; - } - - // default MMU setup for main CPU - bank_offsets[0][0] = 0x0180 * 0x2000; // bank0 = 0x180(RAM) - evidence: wldcourt - bank_offsets[0][1] = 0x0180 * 0x2000; // bank1 = 0x180(RAM) - evidence: berabohm - bank_offsets[0][7] = 0x03ff * 0x2000; // bank7 = 0x3ff(PRG7) - - // default MMU setup for sub CPU - bank_offsets[1][0] = 0x0180 * 0x2000; // bank0 = 0x180(RAM) - evidence: wldcourt - bank_offsets[1][7] = 0x03ff * 0x2000; // bank7 = 0x3ff(PRG7) - - M6809Open(0); - M6809UnmapMemory(0x0000, 0xffff, MAP_RAM); - M6809MapMemory(DrvMainRAM + 0x000000, 0x0000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvMainRAM + 0x000000, 0x2000, 0x3fff, MAP_RAM); - M6809MapMemory(DrvMainROM + 0x3fe000, 0xe000, 0xffff, MAP_ROM); - M6809Close(); - - M6809Open(1); - M6809UnmapMemory(0x0000, 0xffff, MAP_RAM); - M6809MapMemory(DrvMainRAM + 0x000000, 0x0000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvMainROM + 0x3fe000, 0xe000, 0xffff, MAP_ROM); - M6809Close(); -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - if (clear_mem) set_initial_map_banks(); // this fixes rompers boot. (relies on wdt after warning screen) - - M6809Open(0); - M6809Reset(); - if (clear_mem) m6809_reset_hard(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - if (clear_mem) m6809_reset_hard(); // this gets shadowld to reboot - M6809Close(); - - M6809Open(2); - M6809Reset(); - if (clear_mem) { - M6809MapMemory(NULL, 0x0000, 0x3fff, MAP_ROM); - m6809_reset_hard(); - } - NamcoSoundReset(); - BurnYM2151Reset(); - DACReset(); - reset_dacs(); - M6809Close(); - -// HD63701Open(0); - HD63701Reset(); - if (clear_mem) { - HD63701MapMemory(NULL, 0x4000, 0xbfff, MAP_ROM); - m6800_reset_hard(); // HD63701 - } -// HD63701Close(); - - HiscoreReset(); - - sub_cpu_in_reset = 1; - sub_cpu_reset = 0; - shared_watchdog = 0; - watchdog = 0; - mcu_patch_data = 0; - buffer_sprites = 0; - coin_lockout = 0; - - memset (namcos1_key, 0, 8); - namcos1_key_numerator_high_word = 0; - namcos1_key_quotient = 0; - namcos1_key_reminder = 0; - - input_count = 0; - strobe_count = 0; - stored_input[0] = stored_input[1] = 0; - - Paddle[0] = Paddle[1] = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x400000; - DrvSoundROM = Next; Next += 0x020000; - DrvMCUROM = Next; Next += 0x0d0000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x200000; - - DrvTransTable = Next; Next += 0x020000 / 8; - - DrvPalette = (UINT32*)Next; Next += 0x2001 * sizeof(UINT32); - - DrvNVRAM = Next; Next += 0x000800; - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x008000; - DrvSprRAM = Next; Next += 0x001000; - DrvMainRAM = Next; Next += 0x008000; - DrvTriRAM = Next; Next += 0x000800; - DrvSoundRAM = Next; Next += 0x002000; - DrvMCURAM = Next; Next += 0x000080; - - DrvPfCtrl = Next; Next += 0x000020; - - DrvPalRAMR = Next; Next += 0x002000; - DrvPalRAMG = Next; Next += 0x002000; - DrvPalRAMB = Next; Next += 0x002000; - DrvPalRegs = (UINT16*)Next; Next += 0x00008 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvTransTableInit() -{ - for (INT32 i = 0; i < 0x20000; i+= 8) { - DrvTransTable[i/8] = 1; - - for (INT32 j = 0; j < 8; j++) { - if (DrvGfxROM0[i+j] != 0) { - DrvTransTable[i/8] = 0; - } - } - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { STEP4(0,1) }; - INT32 XOffs[32] = { STEP16(0,4), STEP16(1024, 4) }; - INT32 YOffs[32] = { STEP16(0,64), STEP16(2048, 64) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM2, 0x100000); - - GfxDecode((0x100000 * 2) / 0x400, 4, 32, 32, Plane, XOffs, YOffs, 0x1000, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static void PRG7Decode() -{ - for (INT32 i = 0x380000;i < 0x400000;i++) - { - if ((i & 0x010000) == 0) - { - UINT8 t = DrvMainROM[i]; - DrvMainROM[i] = DrvMainROM[i + 0x010000]; - DrvMainROM[i + 0x010000] = t; - } - } -} - -static void DoMirror(UINT8 *rom, INT32 size, INT32 mirror_size) -{ - for (INT32 i = mirror_size; i < size; i+=mirror_size) - { - memcpy (rom + i, rom, mirror_size); - } -} - -static INT32 Namcos1GetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) - { - BurnDrvGetRomInfo(&ri, i); - - // the rom names have the rom position in them - INT32 whichrompos = 0; - for (INT32 j = 0; j < (INT32)strlen(pRomName); j++) { - if (pRomName[j] == '.') break; - if ((pRomName[j] & 0xf8) == 0x30) { // '0', '1', '2', '3' - whichrompos = pRomName[j] & 7; - } - } - //bprintf(0, _T("[%S] rompos %X.\n"), pRomName, whichrompos); - // pacmania has rom positions at the end of the file name - if ((pRomName[strlen(pRomName)-1] & 0xf8) == 0x30 && pRomName[strlen(pRomName)-2] != '1') { - whichrompos = pRomName[strlen(pRomName)-1] & 7; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 1) { - if (BurnLoadRom(DrvSoundROM + (whichrompos * 0x10000), i, 1)) return 1; - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 2) { - if (BurnLoadRom(DrvMainROM + (whichrompos * 0x80000), i, 1)) return 1; - DoMirror(DrvMainROM + (whichrompos * 0x80000), 0x80000, ri.nLen); - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 3) { - if (BurnLoadRom(DrvMCUROM, i, 1)) return 1; - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 4) { - if (BurnLoadRom(DrvMCUROM + 0x10000 + (whichrompos * 0x20000), i, 1)) return 1; - if (ri.nLen < 0x20000) DoMirror(DrvMCUROM + 0x10000 + (whichrompos * 0x20000), 0x20000, ri.nLen); - continue; - } - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 5) { - if (BurnLoadRom(DrvGfxROM0, i, 1)) return 1; - continue; - } - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 6) { - if (BurnLoadRom(DrvGfxROM1 + (whichrompos * 0x20000), i, 1)) return 1; - if (ri.nLen < 0x20000) DoMirror(DrvGfxROM1 + (whichrompos * 0x20000), 0x20000, ri.nLen); - continue; - } - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 7) { - if (BurnLoadRom(DrvGfxROM2 + (whichrompos * 0x20000), i, 1)) return 1; - if (ri.nLen < 0x20000) DoMirror(DrvGfxROM2 + (whichrompos * 0x20000), 0x20000, ri.nLen); - continue; - } - } - - DrvGfxDecode(); - DrvTransTableInit(); - PRG7Decode(); - - return 0; -} - -static INT32 DrvInit() -{ - //BurnSetRefreshRate((sixtyhz) ? 60.00 : 60.6060); above 60hz is a no-go, causes horrible sound issues on some systems (ym2151) - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (Namcos1GetRoms()) return 1; - - M6809Init(3); - - M6809Open(0); - M6809SetWriteHandler(main_write); - M6809SetReadHandler(main_read); - M6809SetReadOpHandler(main_read); - M6809SetReadOpArgHandler(main_read); - M6809Close(); - - M6809Open(1); - M6809SetWriteHandler(sub_write); - M6809SetReadHandler(sub_read); - M6809SetReadOpHandler(sub_read); - M6809SetReadOpArgHandler(sub_read); - M6809Close(); - - M6809Open(2); - M6809MapMemory(DrvTriRAM, 0x7000, 0x77ff, MAP_RAM); - M6809MapMemory(DrvSoundRAM, 0x8000, 0x9fff, MAP_RAM); - M6809MapMemory(DrvSoundROM + 0x0000, 0xc000, 0xffff, MAP_ROM); - M6809SetWriteHandler(sound_write); - M6809SetReadHandler(sound_read); - M6809Close(); - - HD63701Init(1); -// HD63701Open(0); - HD63701MapMemory(DrvTriRAM, 0xc000, 0xc7ff, MAP_ROM); - HD63701MapMemory(DrvNVRAM, 0xc800, 0xcfff, MAP_RAM); - HD63701MapMemory(DrvMCUROM + 0x0000, 0xf000, 0xffff, MAP_ROM); -// HD63701SetReadOpHandler(mcu_read); -// HD63701SetReadOpArgHandler(mcu_read); - HD63701SetReadHandler(mcu_read); - HD63701SetWriteHandler(mcu_write); - HD63701SetWritePortHandler(mcu_write_port); - HD63701SetReadPortHandler(mcu_read_port); -// HD63701Close(); - - BurnYM2151Init(3579580); - BurnYM2151SetIrqHandler(&YM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.60, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.60, BURN_SND_ROUTE_RIGHT); - - NamcoSoundInit(24000/2, 8, 1); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvDACSync); - - DACSetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - input_read_callback = NULL; - key_read_callback = NULL; - key_write_callback = NULL; - - sixtyhz = 0; - dac_kludge = 0; - quester = 0; - - M6809Exit(); - HD63701Exit(); - - NamcoSoundExit(); - NamcoSoundProm = NULL; - - DACExit(); - - BurnYM2151Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 color = 0; color < 0x1800; color++) - { - DrvPalette[color] = BurnHighCol(DrvPalRAMR[color], DrvPalRAMG[color], DrvPalRAMB[color], 0); - } -} - - -static void draw_layer(INT32 layer, INT32 pri_mask) -{ - INT32 layer_size[6][2] = { { 64, 64 }, { 64, 64 }, { 64, 64 }, { 64, 32 }, { 36, 28 }, { 36, 28 } }; - - UINT16 ram_offset[6] = { 0x0000, 0x2000, 0x4000, 0x6000, 0x7010, 0x7810 }; - - INT32 map_width = layer_size[layer][0]; - INT32 map_height = layer_size[layer][1]; - - INT32 width = map_width * 8; - INT32 height = map_height * 8; - - INT32 scrollx = 0; - INT32 scrolly = 0; - - if (layer < 4) { - INT32 dispx[4] = { 48, 46, 45, 44 }; - - scrollx = (DrvPfCtrl[layer*4+1] + (DrvPfCtrl[layer*4+0] * 256)); - scrolly = (DrvPfCtrl[layer*4+3] + (DrvPfCtrl[layer*4+2] * 256)); - - if (flipscreen) { - scrollx = -(scrollx + 288 + dispx[layer]); - scrolly = -(scrolly + 224 + 24); - } else { - scrollx = (scrollx + dispx[layer]); - scrolly = (scrolly + 24); - } - - scrollx &= 0x1ff; - scrolly &= height - 1; - } - - INT32 color = ((DrvPfCtrl[0x18 + layer] & 7) * 256) + 0x800; - - UINT8 *ram = DrvVidRAM + ram_offset[layer]; - - for (INT32 offs = 0; offs < map_width * map_height; offs++) - { - INT32 sx = (offs % map_width) * 8; - INT32 sy = (offs / map_width) * 8; - - sx -= scrollx; - sy -= scrolly; - - if (sx < -7) sx += width; - if (sy < -7) sy += height; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 code = ram[offs * 2 + 1] + ((ram[offs * 2] & 0x3f) * 256); - - if (DrvTransTable[code] == 0) - { - UINT8 *gfx = DrvGfxROM1 + (code * 0x40); - UINT8 *msk = DrvGfxROM0 + (code * 0x08); - - for (INT32 yy = 0; yy < 8; yy++, msk++, gfx+=8) - { - if (*msk == 0) continue; // transparent line - - if ((sy + yy) < clip_min_y || (sy + yy) >= clip_max_y) continue; - - UINT16 *dst = pTransDraw + ((sy + yy) * nScreenWidth) + sx; - UINT8 *pri = pPrioDraw + ((sy + yy) * nScreenWidth) + sx; - - for (INT32 xx = 0; xx < 8; xx++) - { - if ((sx + xx) < clip_min_x || (sx + xx) >= clip_max_x) continue; - - if (*msk & (0x80 >> xx)) { - dst[xx] = gfx[xx] + color; - pri[xx] = pri_mask; - } - } - } - } - } -} - -static void draw_sprites() -{ - UINT8 *spriteram = DrvSprRAM + 0x800; - const UINT8 *source = &spriteram[0x800-0x20]; - const UINT8 *finish = &spriteram[0]; - - INT32 sprite_xoffs = spriteram[0x07f5] + ((spriteram[0x07f4] & 1) << 8); - INT32 sprite_yoffs = spriteram[0x07f7]; - - while (source >= finish) - { - static const INT32 sprite_size[4] = { 16, 8, 32, 4 }; - INT32 attr1 = source[10]; - INT32 attr2 = source[14]; - INT32 color = source[12]; - INT32 flipx = (attr1 & 0x20) >> 5; - INT32 flipy = (attr2 & 0x01); - INT32 sizex = sprite_size[(attr1 & 0xc0) >> 6]; - INT32 sizey = sprite_size[(attr2 & 0x06) >> 1]; - INT32 tx = (attr1 & 0x18) & (~(sizex-1)); - INT32 ty = (attr2 & 0x18) & (~(sizey-1)); - INT32 sx = source[13] + ((color & 0x01) << 8); - INT32 sy = -source[15] - sizey; - INT32 sprite = source[11]; - INT32 sprite_bank = attr1 & 7; - INT32 priority = (source[14] & 0xe0) >> 5; - UINT32 pri_mask = ((0xff << (priority + 1)) & 0xff) | (1 << 31); - - sprite += sprite_bank * 256; - color = color >> 1; - - sx += sprite_xoffs; - sy -= sprite_yoffs; - - if (flipscreen) - { - sx -= 83; - sy -= 3; - } - else - { - sx -= 6; - sy--; - } - - sy++; - - { - sx &= 0x1ff; - sy = ((sy + 16) & 0xff) - 16; - - sy -= 15; - sx -= 67; - - UINT8 *gfxbase = DrvGfxROM2 + (sprite * 0x400); - - color = (color * 16); - - for (INT32 y = 0; y < sizey; y++, sy++) { - if (sy < clip_min_y || sy >= clip_max_y) continue; - - UINT16 *dst = pTransDraw + (sy * nScreenWidth); - UINT8 *pri = pPrioDraw + (sy * nScreenWidth); - - for (INT32 x = 0; x < sizex; x++, sx++) { - if (sx < clip_min_x || sx >= clip_max_x) continue; - - INT32 xx = x; - INT32 yy = y; - - if (flipx) xx = (sizex - 1) - x; - if (flipy) yy = (sizey - 1) - y; - - INT32 pxl = gfxbase[xx + tx + ((yy + ty) * 32)]; - - if (pxl != 0x0f) { - if ((pri_mask & (1 << (pri[sx] & 0x1f))) == 0) { - if (color == 0x7f0) { - if (dst[sx] & 0x800) dst[sx] += 0x800; - } else { - dst[sx] = pxl + color; - } - } - pri[sx] = 0x1f; - } - } - - sx -= sizex; - } - } - - source -= 0x10; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPalette[0x2000] = 0; // black entry - DrvPaletteInit(); - DrvRecalc = 0; - } - - //BurnTransferClear(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x2000; - pPrioDraw[i] = 0; - } - - flipscreen = DrvSprRAM[0x0ff6] & 1; - - clip_min_x = DrvPalRegs[0] - 73 - 1; - clip_max_x = DrvPalRegs[1] - 73 - 1; - clip_min_y = DrvPalRegs[2] - 16 - 0x11; - clip_max_y = DrvPalRegs[3] - 16 - 0x11; - - if (clip_min_x < 0) clip_min_x = 0; - if (clip_max_x > nScreenWidth) clip_max_x = nScreenWidth; - if (clip_min_y < 0) clip_min_y = 0; - if (clip_max_y > nScreenHeight) clip_max_y = nScreenHeight; - - if ((clip_min_x >= clip_max_x) || (clip_min_y >= clip_max_y)) - { - BurnTransferCopy(DrvPalette); - return 0; - } - - for (INT32 priority = 0; priority < 8; priority++) - { - for (INT32 i = 0; i < 6; i++) - { - if (DrvPfCtrl[0x10 + i] == priority) { - if (nBurnLayer & (1 << i)) { - draw_layer(i, priority); - } - } - } - } - - if (nSpriteEnable & 1) { - draw_sprites(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - watchdog++; - if (watchdog >= 180) { - bprintf (0, _T("Watchdog triggered!\n")); - DrvDoReset(0); - } - - M6809NewFrame(); - HD63701NewFrame(); - - { - memset (DrvInputs, 0xff, 7); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy6[i] & 1) << i; - DrvInputs[6] ^= (DrvJoy7[i] & 1) << i; - } - - if (quester) { - if (DrvJoy1[0]) Paddle[0] += 0x04; - if (DrvJoy1[1]) Paddle[0] -= 0x04; - if (Paddle[0] >= 0x100) Paddle[0] = 0; - if (Paddle[0] < 0) Paddle[0] = 0xfc; - if (DrvJoy2[0]) Paddle[1] += 0x04; - if (DrvJoy2[1]) Paddle[1] -= 0x04; - if (Paddle[1] >= 0x100) Paddle[1] = 0; - if (Paddle[1] < 0) Paddle[1] = 0xfc; - } - } - - INT32 nSegment; - INT32 nInterleave = 640; // mame interleave - INT32 S1VBL = ((nInterleave * 240) / 256); - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[4] = { (INT32)((double)1536000 / 60.6060), (INT32)((double)1536000 / 60.6060), (INT32)((double)1536000 / 60.6060), (INT32)((double)1536000 / 60.6060) }; - if (sixtyhz) { - nCyclesTotal[0] = nCyclesTotal[1] = nCyclesTotal[2] = nCyclesTotal[3] = 1536000 / 60; - } - INT32 nCyclesDone[4] = { 0, 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - if (i == S1VBL) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - nSegment = M6809TotalCycles(); - M6809Close(); - - if (sub_cpu_in_reset == 0) - { - M6809Open(1); - nCyclesDone[1] += M6809Run(nSegment - M6809TotalCycles()); - if (i == S1VBL) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - - M6809Open(2); - nCyclesDone[2] += M6809Run(nSegment - M6809TotalCycles()); - if (i == S1VBL) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - - nCyclesDone[3] += HD63701Run(nSegment - nCyclesDone[3]); - if (i == S1VBL) HD63701SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - else - { - M6809Open(1); - nCyclesDone[1] += M6809Idle(nSegment - M6809TotalCycles()); - M6809Close(); - - M6809Open(2); - nCyclesDone[2] += M6809Idle(nSegment - M6809TotalCycles()); - M6809Close(); - - // HD63701 - nCyclesDone[3] += M6800Idle(nSegment - M6800TotalCycles()); - } - - if (i == S1VBL) { - if (buffer_sprites) { - for (INT32 s = 0; s < 0x800; s+= 16) { - for (INT32 j = 10; j < 16; j++) { - DrvSprRAM[0x800 + s + j] = DrvSprRAM[0x800 + s + j - 6]; - } - } - buffer_sprites = 0; - } - } - - if ((i % 8) == 7) { - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / (nInterleave / 8); - M6809Open(2); - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - M6809Close(); - nSoundBufferPos += nSegment; - } - } - } - - M6809Open(2); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - NamcoSoundUpdateStereo(pBurnSoundOut , nBurnSoundLen); - - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static void save_state_set_bank() -{ - for (INT32 j = 0; j < 2; j++) - { - M6809Open(j); - - for (INT32 i = 0; i < 8 * 2; i++) - { - INT32 bank = i / 2; - INT32 a0 = i & 1; - - UINT32 data = bank_offsets[j][bank] / ((a0) ? 0x2000 : 0x200000); - - bankswitch(j, bank, a0, data & 0xff); - } - - M6809Close(); - } -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - HD63701Scan(nAction); - - M6809Open(2); - NamcoSoundScan(nAction, pnMin); - BurnYM2151Scan(nAction); - M6809Close(); - - SCAN_VAR(bank_offsets); - SCAN_VAR(buffer_sprites); - SCAN_VAR(sound_bank); - SCAN_VAR(mcu_bank); - SCAN_VAR(sub_cpu_reset); - SCAN_VAR(shared_watchdog); - SCAN_VAR(mcu_patch_data); - SCAN_VAR(sub_cpu_in_reset); - SCAN_VAR(coin_lockout); - SCAN_VAR(namcos1_key); - SCAN_VAR(namcos1_key_numerator_high_word); - SCAN_VAR(namcos1_key_quotient); - SCAN_VAR(namcos1_key_reminder); - SCAN_VAR(input_count); - SCAN_VAR(strobe_count); - SCAN_VAR(stored_input); - SCAN_VAR(dac0_value); - SCAN_VAR(dac1_value); - SCAN_VAR(dac0_gain); - SCAN_VAR(dac1_gain); - - BurnRandomScan(nAction); - } - - if (nAction & ACB_WRITE) { - save_state_set_bank(); - - M6809Open(2); - sound_bankswitch(sound_bank); - M6809Close(); - - mcu_bankswitch(mcu_bank); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNVRAM; - ba.nLen = 0x000800; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - return 0; -} - - -// Shadowland (YD3) - -static struct BurnRomInfo shadowldRomDesc[] = { - { "yd1_s0.bin", 0x10000, 0xa9cb51fb, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "yd1_s1.bin", 0x10000, 0x65d1dc0d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "yd1_p0.bin", 0x10000, 0x07e49883, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "yd1_p1.bin", 0x10000, 0xa8ea6bd3, 2 | BRF_PRG | BRF_ESS }, // 3 - { "yd1_p2.bin", 0x10000, 0x62e5bbec, 2 | BRF_PRG | BRF_ESS }, // 4 - { "yd1_p3.bin", 0x10000, 0xa4f27c24, 2 | BRF_PRG | BRF_ESS }, // 5 - { "yd1_p5.bin", 0x10000, 0x29a78bd6, 2 | BRF_PRG | BRF_ESS }, // 6 - { "yd3_p6.bin", 0x10000, 0x93d6811c, 2 | BRF_PRG | BRF_ESS }, // 7 - { "yd3_p7.bin", 0x10000, 0xf1c271a0, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 9 Internal MCU Code - - { "yd_voi-0.bin", 0x20000, 0x448bc6a1, 4 | BRF_PRG | BRF_ESS }, // 10 External MCU Code - { "yd_voi-1.bin", 0x20000, 0x7809035c, 4 | BRF_PRG | BRF_ESS }, // 11 - { "yd_voi-2.bin", 0x20000, 0x73bffc16, 4 | BRF_PRG | BRF_ESS }, // 12 - - { "yd_chr-8.bin", 0x20000, 0x0c8e69d0, 5 | BRF_GRA }, // 13 Character Pixel Masks - - { "yd_chr-0.bin", 0x20000, 0x717441dd, 6 | BRF_GRA }, // 14 Characters - { "yd_chr-1.bin", 0x20000, 0xc1be6e35, 6 | BRF_GRA }, // 15 - { "yd_chr-2.bin", 0x20000, 0x2df8d8cc, 6 | BRF_GRA }, // 16 - { "yd_chr-3.bin", 0x20000, 0xd4e15c9e, 6 | BRF_GRA }, // 17 - { "yd_chr-4.bin", 0x20000, 0xc0041e0d, 6 | BRF_GRA }, // 18 - { "yd_chr-5.bin", 0x20000, 0x7b368461, 6 | BRF_GRA }, // 19 - { "yd_chr-6.bin", 0x20000, 0x3ac6a90e, 6 | BRF_GRA }, // 20 - { "yd_chr-7.bin", 0x20000, 0x8d2cffa5, 6 | BRF_GRA }, // 21 - - { "yd_obj-0.bin", 0x20000, 0xefb8efe3, 7 | BRF_GRA }, // 22 Sprites - { "yd_obj-1.bin", 0x20000, 0xbf4ee682, 7 | BRF_GRA }, // 23 - { "yd_obj-2.bin", 0x20000, 0xcb721682, 7 | BRF_GRA }, // 24 - { "yd_obj-3.bin", 0x20000, 0x8a6c3d1c, 7 | BRF_GRA }, // 25 - { "yd_obj-4.bin", 0x20000, 0xef97bffb, 7 | BRF_GRA }, // 26 - { "yd3_obj5.bin", 0x10000, 0x1e4aa460, 7 | BRF_GRA }, // 27 -}; - -STD_ROM_PICK(shadowld) -STD_ROM_FN(shadowld) - -static INT32 ShadowldInit() -{ - sixtyhz = 1; - dac_kludge = 4; - - return DrvInit(); -} - -struct BurnDriver BurnDrvShadowld = { - "shadowld", NULL, NULL, NULL, "1987", - "Shadowland (YD3)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, shadowldRomInfo, shadowldRomName, NULL, NULL, DrvInputInfo, ShadowldDIPInfo, - ShadowldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Yokai Douchuuki (Japan, new version (YD2, Rev B)) - -static struct BurnRomInfo youkaidk2RomDesc[] = { - { "yd1_s0.bin", 0x10000, 0xa9cb51fb, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "yd1_s1.bin", 0x10000, 0x65d1dc0d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "yd1_p0.bin", 0x10000, 0x07e49883, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "yd1_p1.bin", 0x10000, 0xa8ea6bd3, 2 | BRF_PRG | BRF_ESS }, // 3 - { "yd1_p2.bin", 0x10000, 0x62e5bbec, 2 | BRF_PRG | BRF_ESS }, // 4 - { "yd1_p3.bin", 0x10000, 0xa4f27c24, 2 | BRF_PRG | BRF_ESS }, // 5 - { "yd1_p5.bin", 0x10000, 0x29a78bd6, 2 | BRF_PRG | BRF_ESS }, // 6 - { "yd1_p6.bin", 0x10000, 0x785a2772, 2 | BRF_PRG | BRF_ESS }, // 7 - { "yd2_p7b.bin", 0x10000, 0xa05bf3ae, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 9 Internal MCU Code - - { "yd_voi-0.bin", 0x20000, 0x448bc6a1, 4 | BRF_PRG | BRF_ESS }, // 10 External MCU Code - { "yd_voi-1.bin", 0x20000, 0x7809035c, 4 | BRF_PRG | BRF_ESS }, // 11 - { "yd_voi-2.bin", 0x20000, 0x73bffc16, 4 | BRF_PRG | BRF_ESS }, // 12 - - { "yd_chr-8.bin", 0x20000, 0x0c8e69d0, 5 | BRF_GRA }, // 13 Character Pixel Masks - - { "yd_chr-0.bin", 0x20000, 0x717441dd, 6 | BRF_GRA }, // 14 Characters - { "yd_chr-1.bin", 0x20000, 0xc1be6e35, 6 | BRF_GRA }, // 15 - { "yd_chr-2.bin", 0x20000, 0x2df8d8cc, 6 | BRF_GRA }, // 16 - { "yd_chr-3.bin", 0x20000, 0xd4e15c9e, 6 | BRF_GRA }, // 17 - { "yd_chr-4.bin", 0x20000, 0xc0041e0d, 6 | BRF_GRA }, // 18 - { "yd_chr-5.bin", 0x20000, 0x7b368461, 6 | BRF_GRA }, // 19 - { "yd_chr-6.bin", 0x20000, 0x3ac6a90e, 6 | BRF_GRA }, // 20 - { "yd_chr-7.bin", 0x20000, 0x8d2cffa5, 6 | BRF_GRA }, // 21 - - { "yd_obj-0.bin", 0x20000, 0xefb8efe3, 7 | BRF_GRA }, // 22 Sprites - { "yd_obj-1.bin", 0x20000, 0xbf4ee682, 7 | BRF_GRA }, // 23 - { "yd_obj-2.bin", 0x20000, 0xcb721682, 7 | BRF_GRA }, // 24 - { "yd_obj-3.bin", 0x20000, 0x8a6c3d1c, 7 | BRF_GRA }, // 25 - { "yd_obj-4.bin", 0x20000, 0xef97bffb, 7 | BRF_GRA }, // 26 -}; - -STD_ROM_PICK(youkaidk2) -STD_ROM_FN(youkaidk2) - -struct BurnDriver BurnDrvYoukaidk2 = { - "youkaidk2", "shadowld", NULL, NULL, "1987", - "Yokai Douchuuki (Japan, new version (YD2, Rev B))\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, youkaidk2RomInfo, youkaidk2RomName, NULL, NULL, DrvInputInfo, ShadowldDIPInfo, - ShadowldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Yokai Douchuuki (Japan, old version (YD1)) - -static struct BurnRomInfo youkaidk1RomDesc[] = { - { "yd1.sd0", 0x10000, 0xa9cb51fb, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "yd1.sd1", 0x10000, 0x65d1dc0d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "yd1_p0.bin", 0x10000, 0x07e49883, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "yd1_p1.bin", 0x10000, 0xa8ea6bd3, 2 | BRF_PRG | BRF_ESS }, // 3 - { "yd1_p2.bin", 0x10000, 0x62e5bbec, 2 | BRF_PRG | BRF_ESS }, // 4 - { "yd1_p3.bin", 0x10000, 0xa4f27c24, 2 | BRF_PRG | BRF_ESS }, // 5 - { "yd1_p5.bin", 0x10000, 0x29a78bd6, 2 | BRF_PRG | BRF_ESS }, // 6 - { "yd1_p6.bin", 0x10000, 0x785a2772, 2 | BRF_PRG | BRF_ESS }, // 7 - { "yd2_p7.bin", 0x10000, 0x3d39098c, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 9 Internal MCU Code - - { "yd_voi-0.bin", 0x20000, 0x448bc6a1, 4 | BRF_PRG | BRF_ESS }, // 10 External MCU Code - { "yd_voi-1.bin", 0x20000, 0x7809035c, 4 | BRF_PRG | BRF_ESS }, // 11 - { "yd_voi-2.bin", 0x20000, 0x73bffc16, 4 | BRF_PRG | BRF_ESS }, // 12 - - { "yd_chr-8.bin", 0x20000, 0x0c8e69d0, 5 | BRF_GRA }, // 13 Character Pixel Masks - - { "yd_chr-0.bin", 0x20000, 0x717441dd, 6 | BRF_GRA }, // 14 Characters - { "yd_chr-1.bin", 0x20000, 0xc1be6e35, 6 | BRF_GRA }, // 15 - { "yd_chr-2.bin", 0x20000, 0x2df8d8cc, 6 | BRF_GRA }, // 16 - { "yd_chr-3.bin", 0x20000, 0xd4e15c9e, 6 | BRF_GRA }, // 17 - { "yd_chr-4.bin", 0x20000, 0xc0041e0d, 6 | BRF_GRA }, // 18 - { "yd_chr-5.bin", 0x20000, 0x7b368461, 6 | BRF_GRA }, // 19 - { "yd_chr-6.bin", 0x20000, 0x3ac6a90e, 6 | BRF_GRA }, // 20 - { "yd_chr-7.bin", 0x20000, 0x8d2cffa5, 6 | BRF_GRA }, // 21 - - { "yd_obj-0.bin", 0x20000, 0xefb8efe3, 7 | BRF_GRA }, // 22 Sprites - { "yd_obj-1.bin", 0x20000, 0xbf4ee682, 7 | BRF_GRA }, // 23 - { "yd_obj-2.bin", 0x20000, 0xcb721682, 7 | BRF_GRA }, // 24 - { "yd_obj-3.bin", 0x20000, 0x8a6c3d1c, 7 | BRF_GRA }, // 25 - { "yd_obj-4.bin", 0x20000, 0xef97bffb, 7 | BRF_GRA }, // 26 -}; - -STD_ROM_PICK(youkaidk1) -STD_ROM_FN(youkaidk1) - -struct BurnDriver BurnDrvYoukaidk1 = { - "youkaidk1", "shadowld", NULL, NULL, "1987", - "Yokai Douchuuki (Japan, old version (YD1))\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, youkaidk1RomInfo, youkaidk1RomName, NULL, NULL, DrvInputInfo, ShadowldDIPInfo, - ShadowldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - - -// Dragon Spirit (new version (DS3)) - -static struct BurnRomInfo dspiritRomDesc[] = { - { "ds1_s0.bin", 0x10000, 0x27100065, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "ds1_s1.bin", 0x10000, 0xb398645f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ds1_p0.bin", 0x10000, 0xb22a2856, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "ds1_p1.bin", 0x10000, 0xf7e3298a, 2 | BRF_PRG | BRF_ESS }, // 3 - { "ds1_p2.bin", 0x10000, 0x3c9b0100, 2 | BRF_PRG | BRF_ESS }, // 4 - { "ds1_p3.bin", 0x10000, 0xc6e5954b, 2 | BRF_PRG | BRF_ESS }, // 5 - { "ds1_p4.bin", 0x10000, 0xf3307870, 2 | BRF_PRG | BRF_ESS }, // 6 - { "ds1_p5.bin", 0x10000, 0x9a3a1028, 2 | BRF_PRG | BRF_ESS }, // 7 - { "ds3_p6.bin", 0x10000, 0xfcc01bd1, 2 | BRF_PRG | BRF_ESS }, // 8 - { "ds3_p7.bin", 0x10000, 0x820bedb2, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 10 Internal MCU Code - - { "ds1_v0.bin", 0x10000, 0x313b3508, 4 | BRF_PRG | BRF_ESS }, // 11 External MCU Code - { "ds_voi-1.bin", 0x20000, 0x54790d4e, 4 | BRF_PRG | BRF_ESS }, // 12 - { "ds_voi-2.bin", 0x20000, 0x05298534, 4 | BRF_PRG | BRF_ESS }, // 13 - { "ds_voi-3.bin", 0x20000, 0x13e84c7e, 4 | BRF_PRG | BRF_ESS }, // 14 - { "ds_voi-4.bin", 0x20000, 0x34fbb8cd, 4 | BRF_PRG | BRF_ESS }, // 15 - - { "ds_chr-8.bin", 0x20000, 0x946eb242, 5 | BRF_GRA }, // 16 Character Pixel Masks - - { "ds_chr-0.bin", 0x20000, 0x7bf28ac3, 6 | BRF_GRA }, // 17 Characters - { "ds_chr-1.bin", 0x20000, 0x03582fea, 6 | BRF_GRA }, // 18 - { "ds_chr-2.bin", 0x20000, 0x5e05f4f9, 6 | BRF_GRA }, // 19 - { "ds_chr-3.bin", 0x20000, 0xdc540791, 6 | BRF_GRA }, // 20 - { "ds_chr-4.bin", 0x20000, 0xffd1f35c, 6 | BRF_GRA }, // 21 - { "ds_chr-5.bin", 0x20000, 0x8472e0a3, 6 | BRF_GRA }, // 22 - { "ds_chr-6.bin", 0x20000, 0xa799665a, 6 | BRF_GRA }, // 23 - { "ds_chr-7.bin", 0x20000, 0xa51724af, 6 | BRF_GRA }, // 24 - - { "ds_obj-0.bin", 0x20000, 0x03ec3076, 7 | BRF_GRA }, // 25 Sprites - { "ds_obj-1.bin", 0x20000, 0xe67a8fa4, 7 | BRF_GRA }, // 26 - { "ds_obj-2.bin", 0x20000, 0x061cd763, 7 | BRF_GRA }, // 27 - { "ds_obj-3.bin", 0x20000, 0x63225a09, 7 | BRF_GRA }, // 28 - { "ds1_o4.bin", 0x10000, 0xa6246fcb, 7 | BRF_GRA }, // 29 -}; - -STD_ROM_PICK(dspirit) -STD_ROM_FN(dspirit) - -static INT32 DspiritInit() -{ - namcos1_key_init(1, 0x036, -1, -1, -1, -1, -1, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvDspirit = { - "dspirit", NULL, NULL, NULL, "1987", - "Dragon Spirit (new version (DS3))\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dspiritRomInfo, dspiritRomName, NULL, NULL, DrvInputInfo, DspiritDIPInfo, - DspiritInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Dragon Spirit (DS2) - -static struct BurnRomInfo dspirit2RomDesc[] = { - { "ds1_s0.bin", 0x10000, 0x27100065, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "ds1_s1.bin", 0x10000, 0xb398645f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ds1_p0.bin", 0x10000, 0xb22a2856, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "ds1_p1.bin", 0x10000, 0xf7e3298a, 2 | BRF_PRG | BRF_ESS }, // 3 - { "ds1_p2.bin", 0x10000, 0x3c9b0100, 2 | BRF_PRG | BRF_ESS }, // 4 - { "ds1_p3.bin", 0x10000, 0xc6e5954b, 2 | BRF_PRG | BRF_ESS }, // 5 - { "ds1_p4.bin", 0x10000, 0xf3307870, 2 | BRF_PRG | BRF_ESS }, // 6 - { "ds1_p5.bin", 0x10000, 0x9a3a1028, 2 | BRF_PRG | BRF_ESS }, // 7 - { "ds2-pr6d.s11", 0x10000, 0x5382447d, 2 | BRF_PRG | BRF_ESS }, // 8 - { "ds2-pr7d.t11", 0x10000, 0x80ff492a, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 10 Internal MCU Code - - { "ds1_v0.bin", 0x10000, 0x313b3508, 4 | BRF_PRG | BRF_ESS }, // 11 External MCU Code - { "ds_voi-1.bin", 0x20000, 0x54790d4e, 4 | BRF_PRG | BRF_ESS }, // 12 - { "ds_voi-2.bin", 0x20000, 0x05298534, 4 | BRF_PRG | BRF_ESS }, // 13 - { "ds_voi-3.bin", 0x20000, 0x13e84c7e, 4 | BRF_PRG | BRF_ESS }, // 14 - { "ds_voi-4.bin", 0x20000, 0x34fbb8cd, 4 | BRF_PRG | BRF_ESS }, // 15 - - { "ds_chr-8.bin", 0x20000, 0x946eb242, 5 | BRF_GRA }, // 16 Character Pixel Masks - - { "ds_chr-0.bin", 0x20000, 0x7bf28ac3, 6 | BRF_GRA }, // 17 Characters - { "ds_chr-1.bin", 0x20000, 0x03582fea, 6 | BRF_GRA }, // 18 - { "ds_chr-2.bin", 0x20000, 0x5e05f4f9, 6 | BRF_GRA }, // 19 - { "ds_chr-3.bin", 0x20000, 0xdc540791, 6 | BRF_GRA }, // 20 - { "ds_chr-4.bin", 0x20000, 0xffd1f35c, 6 | BRF_GRA }, // 21 - { "ds_chr-5.bin", 0x20000, 0x8472e0a3, 6 | BRF_GRA }, // 22 - { "ds_chr-6.bin", 0x20000, 0xa799665a, 6 | BRF_GRA }, // 23 - { "ds_chr-7.bin", 0x20000, 0xa51724af, 6 | BRF_GRA }, // 24 - - { "ds_obj-0.bin", 0x20000, 0x03ec3076, 7 | BRF_GRA }, // 25 Sprites - { "ds_obj-1.bin", 0x20000, 0xe67a8fa4, 7 | BRF_GRA }, // 26 - { "ds_obj-2.bin", 0x20000, 0x061cd763, 7 | BRF_GRA }, // 27 - { "ds_obj-3.bin", 0x20000, 0x63225a09, 7 | BRF_GRA }, // 28 - { "ds1_o4.bin", 0x10000, 0xa6246fcb, 7 | BRF_GRA }, // 29 -}; - -STD_ROM_PICK(dspirit2) -STD_ROM_FN(dspirit2) - -struct BurnDriver BurnDrvDspirit2 = { - "dspirit2", "dspirit", NULL, NULL, "1987", - "Dragon Spirit (DS2)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dspirit2RomInfo, dspirit2RomName, NULL, NULL, DrvInputInfo, DspiritDIPInfo, - DspiritInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Dragon Spirit (old version (DS1)) - -static struct BurnRomInfo dspirit1RomDesc[] = { - { "ds1_s0.bin", 0x10000, 0x27100065, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "ds1_s1.bin", 0x10000, 0xb398645f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ds1_p0.bin", 0x10000, 0xb22a2856, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "ds1_p1.bin", 0x10000, 0xf7e3298a, 2 | BRF_PRG | BRF_ESS }, // 3 - { "ds1_p2.bin", 0x10000, 0x3c9b0100, 2 | BRF_PRG | BRF_ESS }, // 4 - { "ds1_p3.bin", 0x10000, 0xc6e5954b, 2 | BRF_PRG | BRF_ESS }, // 5 - { "ds1_p4.bin", 0x10000, 0xf3307870, 2 | BRF_PRG | BRF_ESS }, // 6 - { "ds1_p5.bin", 0x10000, 0x9a3a1028, 2 | BRF_PRG | BRF_ESS }, // 7 - { "ds1_p6.bin", 0x10000, 0xa82737b4, 2 | BRF_PRG | BRF_ESS }, // 8 - { "ds1_p7.bin", 0x10000, 0xf4c0d75e, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 10 Internal MCU Code - - { "ds1_v0.bin", 0x10000, 0x313b3508, 4 | BRF_PRG | BRF_ESS }, // 11 External MCU Code - { "ds_voi-1.bin", 0x20000, 0x54790d4e, 4 | BRF_PRG | BRF_ESS }, // 12 - { "ds_voi-2.bin", 0x20000, 0x05298534, 4 | BRF_PRG | BRF_ESS }, // 13 - { "ds_voi-3.bin", 0x20000, 0x13e84c7e, 4 | BRF_PRG | BRF_ESS }, // 14 - { "ds_voi-4.bin", 0x20000, 0x34fbb8cd, 4 | BRF_PRG | BRF_ESS }, // 15 - - { "ds_chr-8.bin", 0x20000, 0x946eb242, 5 | BRF_GRA }, // 16 Character Pixel Masks - - { "ds_chr-0.bin", 0x20000, 0x7bf28ac3, 6 | BRF_GRA }, // 17 Characters - { "ds_chr-1.bin", 0x20000, 0x03582fea, 6 | BRF_GRA }, // 18 - { "ds_chr-2.bin", 0x20000, 0x5e05f4f9, 6 | BRF_GRA }, // 19 - { "ds_chr-3.bin", 0x20000, 0xdc540791, 6 | BRF_GRA }, // 20 - { "ds_chr-4.bin", 0x20000, 0xffd1f35c, 6 | BRF_GRA }, // 21 - { "ds_chr-5.bin", 0x20000, 0x8472e0a3, 6 | BRF_GRA }, // 22 - { "ds_chr-6.bin", 0x20000, 0xa799665a, 6 | BRF_GRA }, // 23 - { "ds_chr-7.bin", 0x20000, 0xa51724af, 6 | BRF_GRA }, // 24 - - { "ds_obj-0.bin", 0x20000, 0x03ec3076, 7 | BRF_GRA }, // 25 Sprites - { "ds_obj-1.bin", 0x20000, 0xe67a8fa4, 7 | BRF_GRA }, // 26 - { "ds_obj-2.bin", 0x20000, 0x061cd763, 7 | BRF_GRA }, // 27 - { "ds_obj-3.bin", 0x20000, 0x63225a09, 7 | BRF_GRA }, // 28 - { "ds1_o4.bin", 0x10000, 0xa6246fcb, 7 | BRF_GRA }, // 29 -}; - -STD_ROM_PICK(dspirit1) -STD_ROM_FN(dspirit1) - -struct BurnDriver BurnDrvDspirit1 = { - "dspirit1", "dspirit", NULL, NULL, "1987", - "Dragon Spirit (old version (DS1))\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dspirit1RomInfo, dspirit1RomName, NULL, NULL, DrvInputInfo, DspiritDIPInfo, - DspiritInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Blazer (Japan) - -static struct BurnRomInfo blazerRomDesc[] = { - { "bz1_s0.bin", 0x10000, 0x6c3a580b, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "bz1_p0.bin", 0x10000, 0xa7dd195b, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "bz1_p1.bin", 0x10000, 0xc54bbbf4, 2 | BRF_PRG | BRF_ESS }, // 2 - { "bz1_p2.bin", 0x10000, 0x5d700aed, 2 | BRF_PRG | BRF_ESS }, // 3 - { "bz1_p3.bin", 0x10000, 0x81b32a1a, 2 | BRF_PRG | BRF_ESS }, // 4 - { "bz_prg-4.bin", 0x20000, 0x65ef6f05, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bz_prg-5.bin", 0x20000, 0x900da191, 2 | BRF_PRG | BRF_ESS }, // 6 - { "bz_prg-6.bin", 0x20000, 0x81c48fc0, 2 | BRF_PRG | BRF_ESS }, // 7 - { "bz1_p7.bin", 0x10000, 0x2d4cbb95, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 9 Internal MCU Code - - { "bz1_v0.bin", 0x10000, 0x3d09d32e, 4 | BRF_PRG | BRF_ESS }, // 10 External MCU Code - { "bz_voi-1.bin", 0x20000, 0x2043b141, 4 | BRF_PRG | BRF_ESS }, // 11 - { "bz_voi-2.bin", 0x20000, 0x64143442, 4 | BRF_PRG | BRF_ESS }, // 12 - { "bz_voi-3.bin", 0x20000, 0x26cfc510, 4 | BRF_PRG | BRF_ESS }, // 13 - { "bz_voi-4.bin", 0x20000, 0xd206b1bd, 4 | BRF_PRG | BRF_ESS }, // 14 - - { "bz_chr-8.bin", 0x20000, 0xdb28bfca, 5 | BRF_GRA }, // 15 Character Pixel Masks - - { "bz_chr-0.bin", 0x20000, 0xd346ba61, 6 | BRF_GRA }, // 16 Characters - { "bz_chr-1.bin", 0x20000, 0xe45eb2ea, 6 | BRF_GRA }, // 17 - { "bz_chr-2.bin", 0x20000, 0x599079ee, 6 | BRF_GRA }, // 18 - { "bz_chr-3.bin", 0x20000, 0xd5182e36, 6 | BRF_GRA }, // 19 - { "bz_chr-4.bin", 0x20000, 0xe788259e, 6 | BRF_GRA }, // 20 - { "bz_chr-5.bin", 0x20000, 0x107e6814, 6 | BRF_GRA }, // 21 - { "bz_chr-6.bin", 0x20000, 0x0312e2ba, 6 | BRF_GRA }, // 22 - { "bz_chr-7.bin", 0x20000, 0xd9d9a90f, 6 | BRF_GRA }, // 23 - - { "bz_obj-0.bin", 0x20000, 0x22aee927, 7 | BRF_GRA }, // 24 Sprites - { "bz_obj-1.bin", 0x20000, 0x7cb10112, 7 | BRF_GRA }, // 25 - { "bz_obj-2.bin", 0x20000, 0x34b23bb7, 7 | BRF_GRA }, // 26 - { "bz_obj-3.bin", 0x20000, 0x9bc1db71, 7 | BRF_GRA }, // 27 -}; - -STD_ROM_PICK(blazer) -STD_ROM_FN(blazer) - -static INT32 BlazerInit() -{ - namcos1_key_init(1, 0x013, -1, -1, -1, -1, -1, -1); - - INT32 nRet = DrvInit(); - - dac_kludge = 4; - - if (nRet == 0) { - // transparent sprites in empty space, otherwise the explosions look bad. - memset (DrvGfxROM2 + 0x100000, 0xf, 0x100000); - } - - return nRet; -} - -struct BurnDriver BurnDrvBlazer = { - "blazer", NULL, NULL, NULL, "1987", - "Blazer (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, blazerRomInfo, blazerRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - BlazerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Quester (Japan) - -static struct BurnRomInfo questerRomDesc[] = { - { "qs1_s0.bin", 0x10000, 0xc2ef3af9, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "qs1_p5.bin", 0x10000, 0xc8e11f30, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "qs1_p7b.bin", 0x10000, 0xf358a944, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 3 Internal MCU Code - - { "qs1_v0.bin", 0x10000, 0x6a2f3038, 4 | BRF_PRG | BRF_ESS }, // 4 External MCU Code - - { "qs1_c8.bin", 0x10000, 0x06730d54, 5 | BRF_GRA }, // 5 Character Pixel Masks - - { "qs1_c0.bin", 0x20000, 0xca69bd7a, 6 | BRF_GRA }, // 6 Characters - { "qs1_c1.bin", 0x20000, 0xd660ba71, 6 | BRF_GRA }, // 7 - { "qs1_c2.bin", 0x20000, 0x4686f656, 6 | BRF_GRA }, // 8 - - { "qs1_o0.bin", 0x10000, 0xe24f0bf1, 7 | BRF_GRA }, // 9 Sprites - { "qs1_o1.bin", 0x10000, 0xe4aab0ca, 7 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(quester) -STD_ROM_FN(quester) - -static INT32 QuesterInit() -{ - input_read_callback = quester_paddle_read; - quester = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvQuester = { - "quester", NULL, NULL, NULL, "1987", - "Quester (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, questerRomInfo, questerRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, //QuesterInputInfo, QuesterDIPInfo, - QuesterInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Quester Special Edition (Japan) - -static struct BurnRomInfo questersRomDesc[] = { - { "qs1_s0.bin", 0x10000, 0xc2ef3af9, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "qs2_p5.bin", 0x10000, 0x15661fe7, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "qs2_p6.bin", 0x10000, 0x19e0fc20, 2 | BRF_PRG | BRF_ESS }, // 2 - { "qs2_p7.bin", 0x10000, 0x4f6ad716, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "qs1_v0.bin", 0x10000, 0x6a2f3038, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - - { "qs1_c8.bin", 0x10000, 0x06730d54, 5 | BRF_GRA }, // 6 Character Pixel Masks - - { "qs1_c0.bin", 0x20000, 0xca69bd7a, 6 | BRF_GRA }, // 7 Characters - { "qs1_c1.bin", 0x20000, 0xd660ba71, 6 | BRF_GRA }, // 8 - { "qs1_c2.bin", 0x20000, 0x4686f656, 6 | BRF_GRA }, // 9 - - { "qs1_o0.bin", 0x10000, 0xe24f0bf1, 7 | BRF_GRA }, // 10 Sprites - { "qs1_o1.bin", 0x10000, 0xe4aab0ca, 7 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(questers) -STD_ROM_FN(questers) - -struct BurnDriver BurnDrvQuesters = { - "questers", "quester", NULL, NULL, "1987", - "Quester Special Edition (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, questersRomInfo, questersRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, //QuesterInputInfo, QuesterDIPInfo, - QuesterInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Pac-Mania - -static struct BurnRomInfo pacmaniaRomDesc[] = { - { "pn2_s0.bin", 0x10000, 0xc10370fa, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "pn2_s1.bin", 0x10000, 0xf761ed5a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pn_prg-6.bin", 0x20000, 0xfe94900c, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "pn2_p7.bin", 0x10000, 0x462fa4fd, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "pn2_v0.bin", 0x10000, 0x1ad5788f, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - - { "pn2_c8.bin", 0x10000, 0xf3afd65d, 5 | BRF_GRA }, // 6 Character Pixel Masks - - { "pn_chr-0.bin", 0x20000, 0x7c57644c, 6 | BRF_GRA }, // 7 Characters - { "pn_chr-1.bin", 0x20000, 0x7eaa67ed, 6 | BRF_GRA }, // 8 - { "pn_chr-2.bin", 0x20000, 0x27e739ac, 6 | BRF_GRA }, // 9 - { "pn_chr-3.bin", 0x20000, 0x1dfda293, 6 | BRF_GRA }, // 10 - - { "pn_obj-0.bin", 0x20000, 0xfda57e8b, 7 | BRF_GRA }, // 11 Sprites - { "pnx_obj1.bin", 0x20000, 0x4c08affe, 7 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(pacmania) -STD_ROM_FN(pacmania) - -static INT32 PacmaniaInit() -{ - namcos1_key_init(2, 0x012, -1, -1, -1, -1, -1, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvPacmania = { - "pacmania", NULL, NULL, NULL, "1987", - "Pac-Mania\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, pacmaniaRomInfo, pacmaniaRomName, NULL, NULL, DrvInputInfo, PacmaniaDIPInfo, - PacmaniaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Pac-Mania (111187 sound program) - -static struct BurnRomInfo pacmaniaoRomDesc[] = { - { "pac-mania_111187.sound0", 0x10000, 0x845d6a2e, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "pac-mania_111187.sound1", 0x10000, 0x411bc134, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pn_prg-6.bin", 0x20000, 0xfe94900c, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "pn2_p7.bin", 0x10000, 0x462fa4fd, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "pac-mania_111187.voice0", 0x10000, 0x1ad5788f, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - - { "pn1_c8.bin", 0x10000, 0xf3afd65d, 5 | BRF_GRA }, // 6 Character Pixel Masks - - { "pn_chr-0.bin", 0x20000, 0x7c57644c, 6 | BRF_GRA }, // 7 Characters - { "pn_chr-1.bin", 0x20000, 0x7eaa67ed, 6 | BRF_GRA }, // 8 - { "pn_chr-2.bin", 0x20000, 0x27e739ac, 6 | BRF_GRA }, // 9 - { "pn_chr-3.bin", 0x20000, 0x1dfda293, 6 | BRF_GRA }, // 10 - - { "pn_obj-0.bin", 0x20000, 0xfda57e8b, 7 | BRF_GRA }, // 11 Sprites - { "pnx_obj1.bin", 0x20000, 0x4c08affe, 7 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(pacmaniao) -STD_ROM_FN(pacmaniao) - -struct BurnDriver BurnDrvPacmaniao = { - "pacmaniao", "pacmania", NULL, NULL, "1987", - "Pac-Mania (111187 sound program)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, pacmaniaoRomInfo, pacmaniaoRomName, NULL, NULL, DrvInputInfo, PacmaniaDIPInfo, - PacmaniaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Pac-Mania (Japan) - -static struct BurnRomInfo pacmaniajRomDesc[] = { - { "pn1_s0.bin", 0x10000, 0xd5ef5eee, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "pn1_s1.bin", 0x10000, 0x411bc134, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pn_prg-6.bin", 0x20000, 0xfe94900c, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "pn1_p7.bin", 0x10000, 0x2aa99e2b, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "pn1_v0.bin", 0x10000, 0xe2689f79, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - - { "pn1_c8.bin", 0x10000, 0xf3afd65d, 5 | BRF_GRA }, // 6 Character Pixel Masks - - { "pn_chr-0.bin", 0x20000, 0x7c57644c, 6 | BRF_GRA }, // 7 Characters - { "pn_chr-1.bin", 0x20000, 0x7eaa67ed, 6 | BRF_GRA }, // 8 - { "pn_chr-2.bin", 0x20000, 0x27e739ac, 6 | BRF_GRA }, // 9 - { "pn_chr-3.bin", 0x20000, 0x1dfda293, 6 | BRF_GRA }, // 10 - - { "pn_obj-0.bin", 0x20000, 0xfda57e8b, 7 | BRF_GRA }, // 11 Sprites - { "pn_obj-1.bin", 0x20000, 0x27bdf440, 7 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(pacmaniaj) -STD_ROM_FN(pacmaniaj) - -struct BurnDriver BurnDrvPacmaniaj = { - "pacmaniaj", "pacmania", NULL, NULL, "1987", - "Pac-Mania (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, pacmaniajRomInfo, pacmaniajRomName, NULL, NULL, DrvInputInfo, PacmaniaDIPInfo, - PacmaniaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Galaga '88 - -static struct BurnRomInfo galaga88RomDesc[] = { - { "g81_s0.bin", 0x10000, 0x164a3fdc, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "g81_s1.bin", 0x10000, 0x16a4b784, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "g81_p0.bin", 0x10000, 0x0f0778ca, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "g81_p1.bin", 0x10000, 0xe68cb351, 2 | BRF_PRG | BRF_ESS }, // 3 - { "g81_p5.bin", 0x10000, 0x4fbd3f6c, 2 | BRF_PRG | BRF_ESS }, // 4 - { "g8x_p6.bin", 0x10000, 0x403d01c1, 2 | BRF_PRG | BRF_ESS }, // 5 - { "g8x_p7.bin", 0x10000, 0xdf75b7fc, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 7 Internal MCU Code - - { "g81_v0.bin", 0x10000, 0x86921dd4, 4 | BRF_PRG | BRF_ESS }, // 8 External MCU Code - { "g81_v1.bin", 0x10000, 0x9c300e16, 4 | BRF_PRG | BRF_ESS }, // 9 - { "g81_v2.bin", 0x10000, 0x5316b4b0, 4 | BRF_PRG | BRF_ESS }, // 10 - { "g81_v3.bin", 0x10000, 0xdc077af4, 4 | BRF_PRG | BRF_ESS }, // 11 - { "g81_v4.bin", 0x10000, 0xac0279a7, 4 | BRF_PRG | BRF_ESS }, // 12 - { "g81_v5.bin", 0x10000, 0x014ddba1, 4 | BRF_PRG | BRF_ESS }, // 13 - - { "g8_chr-8.bin", 0x20000, 0x3862ed0a, 5 | BRF_GRA }, // 14 Character Pixel Masks - - { "g8_chr-0.bin", 0x20000, 0x68559c78, 6 | BRF_GRA }, // 15 Characters - { "g8_chr-1.bin", 0x20000, 0x3dc0f93f, 6 | BRF_GRA }, // 16 - { "g8_chr-2.bin", 0x20000, 0xdbf26f1f, 6 | BRF_GRA }, // 17 - { "g8_chr-3.bin", 0x20000, 0xf5d6cac5, 6 | BRF_GRA }, // 18 - - { "g8_obj-0.bin", 0x20000, 0xd7112e3f, 7 | BRF_GRA }, // 19 Sprites - { "g8_obj-1.bin", 0x20000, 0x680db8e7, 7 | BRF_GRA }, // 20 - { "g8_obj-2.bin", 0x20000, 0x13c97512, 7 | BRF_GRA }, // 21 - { "g8_obj-3.bin", 0x20000, 0x3ed3941b, 7 | BRF_GRA }, // 22 - { "g8_obj-4.bin", 0x20000, 0x370ff4ad, 7 | BRF_GRA }, // 23 - { "g8_obj-5.bin", 0x20000, 0xb0645169, 7 | BRF_GRA }, // 24 -}; - -STD_ROM_PICK(galaga88) -STD_ROM_FN(galaga88) - -static INT32 Galaga88Init() -{ - namcos1_key_init(2, 0x031, -1, -1, -1, -1, -1, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvGalaga88 = { - "galaga88", NULL, NULL, NULL, "1987", - "Galaga '88\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, galaga88RomInfo, galaga88RomName, NULL, NULL, DrvInputInfo, Galaga88DIPInfo, - Galaga88Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Galaga '88 (Japan) - -static struct BurnRomInfo galaga88jRomDesc[] = { - { "g81_s0.bin", 0x10000, 0x164a3fdc, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "g81_s1.bin", 0x10000, 0x16a4b784, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "g81_p0.bin", 0x10000, 0x0f0778ca, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "g81_p1.bin", 0x10000, 0xe68cb351, 2 | BRF_PRG | BRF_ESS }, // 3 - { "g81_p5.bin", 0x10000, 0x4fbd3f6c, 2 | BRF_PRG | BRF_ESS }, // 4 - { "g81_p6.bin", 0x10000, 0xe7203707, 2 | BRF_PRG | BRF_ESS }, // 5 - { "g81_p7.bin", 0x10000, 0x7c10965d, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 7 Internal MCU Code - - { "g81_v0.bin", 0x10000, 0x86921dd4, 4 | BRF_PRG | BRF_ESS }, // 8 External MCU Code - { "g81_v1.bin", 0x10000, 0x9c300e16, 4 | BRF_PRG | BRF_ESS }, // 9 - { "g81_v2.bin", 0x10000, 0x5316b4b0, 4 | BRF_PRG | BRF_ESS }, // 10 - { "g81_v3.bin", 0x10000, 0xdc077af4, 4 | BRF_PRG | BRF_ESS }, // 11 - { "g81_v4.bin", 0x10000, 0xac0279a7, 4 | BRF_PRG | BRF_ESS }, // 12 - { "g81_v5.bin", 0x10000, 0x014ddba1, 4 | BRF_PRG | BRF_ESS }, // 13 - - { "g8_chr-8.bin", 0x20000, 0x3862ed0a, 5 | BRF_GRA }, // 14 Character Pixel Masks - - { "g8_chr-0.bin", 0x20000, 0x68559c78, 6 | BRF_GRA }, // 15 Characters - { "g8_chr-1.bin", 0x20000, 0x3dc0f93f, 6 | BRF_GRA }, // 16 - { "g8_chr-2.bin", 0x20000, 0xdbf26f1f, 6 | BRF_GRA }, // 17 - { "g8_chr-3.bin", 0x20000, 0xf5d6cac5, 6 | BRF_GRA }, // 18 - - { "g8_obj-0.bin", 0x20000, 0xd7112e3f, 7 | BRF_GRA }, // 19 Sprites - { "g8_obj-1.bin", 0x20000, 0x680db8e7, 7 | BRF_GRA }, // 20 - { "g8_obj-2.bin", 0x20000, 0x13c97512, 7 | BRF_GRA }, // 21 - { "g8_obj-3.bin", 0x20000, 0x3ed3941b, 7 | BRF_GRA }, // 22 - { "g8_obj-4.bin", 0x20000, 0x370ff4ad, 7 | BRF_GRA }, // 23 - { "g8_obj-5.bin", 0x20000, 0xb0645169, 7 | BRF_GRA }, // 24 -}; - -STD_ROM_PICK(galaga88j) -STD_ROM_FN(galaga88j) - -struct BurnDriver BurnDrvGalaga88j = { - "galaga88j", "galaga88", NULL, NULL, "1987", - "Galaga '88 (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, galaga88jRomInfo, galaga88jRomName, NULL, NULL, DrvInputInfo, Galaga88DIPInfo, - Galaga88Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Galaga '88 (02-03-88) - -static struct BurnRomInfo galaga88aRomDesc[] = { - { "g81_s0.bin", 0x10000, 0x164a3fdc, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "g81_s1.bin", 0x10000, 0x16a4b784, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "g81_p0.bin", 0x10000, 0x0f0778ca, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "g81_p1.bin", 0x10000, 0xe68cb351, 2 | BRF_PRG | BRF_ESS }, // 3 - { "g81_p5.bin", 0x10000, 0x4fbd3f6c, 2 | BRF_PRG | BRF_ESS }, // 4 - { "prg-6c.s10", 0x10000, 0xc781b8b5, 2 | BRF_PRG | BRF_ESS }, // 5 - { "prg-7c.t10", 0x10000, 0xd2d7e4fa, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 7 Internal MCU Code - - { "g81_v0.bin", 0x10000, 0x86921dd4, 4 | BRF_PRG | BRF_ESS }, // 8 External MCU Code - { "g81_v1.bin", 0x10000, 0x9c300e16, 4 | BRF_PRG | BRF_ESS }, // 9 - { "g81_v2.bin", 0x10000, 0x5316b4b0, 4 | BRF_PRG | BRF_ESS }, // 10 - { "g81_v3.bin", 0x10000, 0xdc077af4, 4 | BRF_PRG | BRF_ESS }, // 11 - { "g81_v4.bin", 0x10000, 0xac0279a7, 4 | BRF_PRG | BRF_ESS }, // 12 - { "g81_v5.bin", 0x10000, 0x014ddba1, 4 | BRF_PRG | BRF_ESS }, // 13 - - { "g8_chr-8.bin", 0x20000, 0x3862ed0a, 5 | BRF_GRA }, // 14 Character Pixel Masks - - { "g8_chr-0.bin", 0x20000, 0x68559c78, 6 | BRF_GRA }, // 15 Characters - { "g8_chr-1.bin", 0x20000, 0x3dc0f93f, 6 | BRF_GRA }, // 16 - { "g8_chr-2.bin", 0x20000, 0xdbf26f1f, 6 | BRF_GRA }, // 17 - { "g8_chr-3.bin", 0x20000, 0xf5d6cac5, 6 | BRF_GRA }, // 18 - { "g8chr-7.m8", 0x20000, 0x5f655016, 6 | BRF_GRA }, // 19 - - { "g8_obj-0.bin", 0x20000, 0xd7112e3f, 7 | BRF_GRA }, // 20 Sprites - { "g8_obj-1.bin", 0x20000, 0x680db8e7, 7 | BRF_GRA }, // 21 - { "g8_obj-2.bin", 0x20000, 0x13c97512, 7 | BRF_GRA }, // 22 - { "g8_obj-3.bin", 0x20000, 0x3ed3941b, 7 | BRF_GRA }, // 23 - { "g8_obj-4.bin", 0x20000, 0x370ff4ad, 7 | BRF_GRA }, // 24 - { "g8_obj-5.bin", 0x20000, 0xb0645169, 7 | BRF_GRA }, // 25 -}; - -STD_ROM_PICK(galaga88a) -STD_ROM_FN(galaga88a) - -struct BurnDriver BurnDrvGalaga88a = { - "galaga88a", "galaga88", NULL, NULL, "1987", - "Galaga '88 (02-03-88)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, galaga88aRomInfo, galaga88aRomName, NULL, NULL, DrvInputInfo, Galaga88DIPInfo, - Galaga88Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// World Stadium (Japan) - -static struct BurnRomInfo wsRomDesc[] = { - { "ws1_snd0.bin", 0x10000, 0x45a87810, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "ws1_snd1.bin", 0x10000, 0x31bf74c1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ws1_prg0.bin", 0x10000, 0xb0234298, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "ws1_prg1.bin", 0x10000, 0xdfd72bed, 2 | BRF_PRG | BRF_ESS }, // 3 - { "ws1_prg2.bin", 0x10000, 0xbb09fa9b, 2 | BRF_PRG | BRF_ESS }, // 4 - { "ws1_prg7.bin", 0x10000, 0x28712eba, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 6 Internal MCU Code - - { "ws1_voi0.bin", 0x10000, 0xf6949199, 4 | BRF_PRG | BRF_ESS }, // 7 External MCU Code - { "ws_voi-1.bin", 0x20000, 0x210e2af9, 4 | BRF_PRG | BRF_ESS }, // 8 - - { "ws_chr-8.bin", 0x20000, 0xd1897b9b, 5 | BRF_GRA }, // 9 Character Pixel Masks - - { "ws_chr-0.bin", 0x20000, 0x3e3e96b4, 6 | BRF_GRA }, // 10 Characters - { "ws_chr-1.bin", 0x20000, 0x897dfbc1, 6 | BRF_GRA }, // 11 - { "ws_chr-2.bin", 0x20000, 0xe142527c, 6 | BRF_GRA }, // 12 - { "ws_chr-3.bin", 0x20000, 0x907d4dc8, 6 | BRF_GRA }, // 13 - { "ws_chr-4.bin", 0x20000, 0xafb11e17, 6 | BRF_GRA }, // 14 - { "ws_chr-6.bin", 0x20000, 0xa16a17c2, 6 | BRF_GRA }, // 15 - - { "ws_obj-0.bin", 0x20000, 0x12dc83a6, 7 | BRF_GRA }, // 16 Sprites - { "ws_obj-1.bin", 0x20000, 0x68290a46, 7 | BRF_GRA }, // 17 - { "ws_obj-2.bin", 0x20000, 0xcd5ba55d, 7 | BRF_GRA }, // 18 - { "ws1_obj3.bin", 0x10000, 0xf2ed5309, 7 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(ws) -STD_ROM_FN(ws) - -static INT32 WsInit() -{ - namcos1_key_init(2, 0x007, -1, -1, -1, -1, -1, -1); - dac_kludge = 3; - - return DrvInit(); -} - -struct BurnDriver BurnDrvWs = { - "ws", NULL, NULL, NULL, "1988", - "World Stadium (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, wsRomInfo, wsRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - WsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Beraboh Man (Japan, Rev C) - -static struct BurnRomInfo berabohmRomDesc[] = { - { "bm1_s0.bin", 0x10000, 0xd5d53cb1, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "bm1_p0.bin", 0x20000, 0xb57ff8c1, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "bm1_p1.bin", 0x20000, 0xb15f6407, 2 | BRF_PRG | BRF_ESS }, // 2 - { "bm1_p4.bin", 0x20000, 0xf6cfcb8c, 2 | BRF_PRG | BRF_ESS }, // 3 - { "bm1-p6.bin", 0x10000, 0xa51b69a5, 2 | BRF_PRG | BRF_ESS }, // 4 - { "bm1_p7c.bin", 0x20000, 0x9694d7b2, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 6 Internal MCU Code - - { "bm1_v0.bin", 0x10000, 0x4e40d0ca, 4 | BRF_PRG | BRF_ESS }, // 7 External MCU Code - { "bm_voi-1.bin", 0x20000, 0xbe9ce0a8, 4 | BRF_PRG | BRF_ESS }, // 8 - { "bm1_v2.bin", 0x10000, 0x41225d04, 4 | BRF_PRG | BRF_ESS }, // 9 - - { "bm_chr-8.bin", 0x20000, 0x92860e95, 5 | BRF_GRA }, // 10 Character Pixel Masks - - { "bm_chr-0.bin", 0x20000, 0xeda1d92e, 6 | BRF_GRA }, // 11 Characters - { "bm_chr-1.bin", 0x20000, 0x8ae1891e, 6 | BRF_GRA }, // 12 - { "bm_chr-2.bin", 0x20000, 0x774cdf4e, 6 | BRF_GRA }, // 13 - { "bm_chr-3.bin", 0x20000, 0x6d81e6c9, 6 | BRF_GRA }, // 14 - { "bm_chr-4.bin", 0x20000, 0xf4597683, 6 | BRF_GRA }, // 15 - { "bm_chr-5.bin", 0x20000, 0x0e0abde0, 6 | BRF_GRA }, // 16 - { "bm_chr-6.bin", 0x20000, 0x4a61f08c, 6 | BRF_GRA }, // 17 - - { "bm_obj-0.bin", 0x20000, 0x15724b94, 7 | BRF_GRA }, // 18 Sprites - { "bm_obj-1.bin", 0x20000, 0x5d21f962, 7 | BRF_GRA }, // 19 - { "bm_obj-2.bin", 0x20000, 0x5d48e924, 7 | BRF_GRA }, // 20 - { "bm_obj-3.bin", 0x20000, 0xcbe56b7f, 7 | BRF_GRA }, // 21 - { "bm_obj-4.bin", 0x20000, 0x76dcc24c, 7 | BRF_GRA }, // 22 - { "bm_obj-5.bin", 0x20000, 0xfe70201d, 7 | BRF_GRA }, // 23 - { "bm_obj-7.bin", 0x20000, 0x377c81ed, 7 | BRF_GRA }, // 24 -}; - -STD_ROM_PICK(berabohm) -STD_ROM_FN(berabohm) - -static INT32 BerabohmInit() -{ - input_read_callback = berabohm_buttons_read; - dac_kludge = 4; - - return DrvInit(); -} - -struct BurnDriver BurnDrvBerabohm = { - "berabohm", NULL, NULL, NULL, "1988", - "Beraboh Man (Japan, Rev C)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, berabohmRomInfo, berabohmRomName, NULL, NULL, BerabohmInputInfo, BerabohmDIPInfo, - BerabohmInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Beraboh Man (Japan, Rev B) - -static struct BurnRomInfo berabohmbRomDesc[] = { - { "bm1_s0.bin", 0x10000, 0xd5d53cb1, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "bm1_p0.bin", 0x20000, 0xb57ff8c1, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "bm1_p1.bin", 0x20000, 0xb15f6407, 2 | BRF_PRG | BRF_ESS }, // 2 - { "bm1_p4.bin", 0x20000, 0xf6cfcb8c, 2 | BRF_PRG | BRF_ESS }, // 3 - { "bm1-p6.bin", 0x10000, 0xa51b69a5, 2 | BRF_PRG | BRF_ESS }, // 4 - { "bm1_p7b.bin", 0x20000, 0xe0c36ddd, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 6 Internal MCU Code - - { "bm1_v0.bin", 0x10000, 0x4e40d0ca, 4 | BRF_PRG | BRF_ESS }, // 7 External MCU Code - { "bm_voi-1.bin", 0x20000, 0xbe9ce0a8, 4 | BRF_PRG | BRF_ESS }, // 8 - { "bm1_v2.bin", 0x10000, 0x41225d04, 4 | BRF_PRG | BRF_ESS }, // 9 - - { "bm_chr-8.bin", 0x20000, 0x92860e95, 5 | BRF_GRA }, // 10 Character Pixel Masks - - { "bm_chr-0.bin", 0x20000, 0xeda1d92e, 6 | BRF_GRA }, // 11 Characters - { "bm_chr-1.bin", 0x20000, 0x8ae1891e, 6 | BRF_GRA }, // 12 - { "bm_chr-2.bin", 0x20000, 0x774cdf4e, 6 | BRF_GRA }, // 13 - { "bm_chr-3.bin", 0x20000, 0x6d81e6c9, 6 | BRF_GRA }, // 14 - { "bm_chr-4.bin", 0x20000, 0xf4597683, 6 | BRF_GRA }, // 15 - { "bm_chr-5.bin", 0x20000, 0x0e0abde0, 6 | BRF_GRA }, // 16 - { "bm_chr-6.bin", 0x20000, 0x4a61f08c, 6 | BRF_GRA }, // 17 - - { "bm_obj-0.bin", 0x20000, 0x15724b94, 7 | BRF_GRA }, // 18 Sprites - { "bm_obj-1.bin", 0x20000, 0x5d21f962, 7 | BRF_GRA }, // 19 - { "bm_obj-2.bin", 0x20000, 0x5d48e924, 7 | BRF_GRA }, // 20 - { "bm_obj-3.bin", 0x20000, 0xcbe56b7f, 7 | BRF_GRA }, // 21 - { "bm_obj-4.bin", 0x20000, 0x76dcc24c, 7 | BRF_GRA }, // 22 - { "bm_obj-5.bin", 0x20000, 0xfe70201d, 7 | BRF_GRA }, // 23 - { "bm_obj-7.bin", 0x20000, 0x377c81ed, 7 | BRF_GRA }, // 24 -}; - -STD_ROM_PICK(berabohmb) -STD_ROM_FN(berabohmb) - -struct BurnDriver BurnDrvBerabohmb = { - "berabohmb", "berabohm", NULL, NULL, "1988", - "Beraboh Man (Japan, Rev B)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, berabohmbRomInfo, berabohmbRomName, NULL, NULL, BerabohmInputInfo, BerabohmDIPInfo, - BerabohmInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Marchen Maze (Japan) - -static struct BurnRomInfo mmazeRomDesc[] = { - { "mm_snd-0.bin", 0x10000, 0x25d25e07, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "mm_snd-1.bin", 0x10000, 0x2c5849c8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mm_prg-0.bin", 0x20000, 0xe169a911, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "mm_prg-1.bin", 0x20000, 0x6ba14e41, 2 | BRF_PRG | BRF_ESS }, // 3 - { "mm_prg-2.bin", 0x20000, 0x91bde09f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "mm1_p6.bin", 0x10000, 0xeaf530d8, 2 | BRF_PRG | BRF_ESS }, // 5 - { "mm1_p7.bin", 0x10000, 0x085e58cc, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 7 Internal MCU Code - - { "mm_voi-0.bin", 0x20000, 0xee974cff, 4 | BRF_PRG | BRF_ESS }, // 8 External MCU Code - { "mm_voi-1.bin", 0x20000, 0xd09b5830, 4 | BRF_PRG | BRF_ESS }, // 9 - - { "mm_chr-8.bin", 0x20000, 0xa3784dfe, 5 | BRF_GRA }, // 10 Character Pixel Masks - - { "mm_chr-0.bin", 0x20000, 0x43ff2dfc, 6 | BRF_GRA }, // 11 Characters - { "mm_chr-1.bin", 0x20000, 0xb9b4b72d, 6 | BRF_GRA }, // 12 - { "mm_chr-2.bin", 0x20000, 0xbee28425, 6 | BRF_GRA }, // 13 - { "mm_chr-3.bin", 0x20000, 0xd9f41e5c, 6 | BRF_GRA }, // 14 - { "mm_chr-4.bin", 0x20000, 0x3484f4ae, 6 | BRF_GRA }, // 15 - { "mm_chr-5.bin", 0x20000, 0xc863deba, 6 | BRF_GRA }, // 16 - - { "mm_obj-0.bin", 0x20000, 0xd4b7e698, 7 | BRF_GRA }, // 17 Sprites - { "mm_obj-1.bin", 0x20000, 0x1ce49e04, 7 | BRF_GRA }, // 18 - { "mm_obj-2.bin", 0x20000, 0x3d3d5de3, 7 | BRF_GRA }, // 19 - { "mm_obj-3.bin", 0x20000, 0xdac57358, 7 | BRF_GRA }, // 20 -}; - -STD_ROM_PICK(mmaze) -STD_ROM_FN(mmaze) - -static INT32 MmazeInit() -{ - namcos1_key_init(2, 0x025, -1, -1, -1, -1, -1, -1); - dac_kludge = 2; - - return DrvInit(); -} - -struct BurnDriver BurnDrvMmaze = { - "mmaze", NULL, NULL, NULL, "1988", - "Marchen Maze (Japan)\0", "Error on first boot is normal", "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mmazeRomInfo, mmazeRomName, NULL, NULL, DrvInputInfo, MmazeDIPInfo, - MmazeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Marchen Maze (Japan, hack?) - -static struct BurnRomInfo mmaze2RomDesc[] = { - { "mm_snd-0.bin", 0x10000, 0x25d25e07, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "mm_snd-1.bin", 0x10000, 0x2c5849c8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mm_prg-0.bin", 0x20000, 0xe169a911, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "mm_prg-1.bin", 0x20000, 0x6ba14e41, 2 | BRF_PRG | BRF_ESS }, // 3 - { "mm_prg-2.bin", 0x20000, 0x91bde09f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "mm1_p6.bin", 0x10000, 0xeaf530d8, 2 | BRF_PRG | BRF_ESS }, // 5 - { "prg7.bin", 0x10000, 0x463d8c95, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 7 Internal MCU Code - - { "mm_voi-0.bin", 0x20000, 0xee974cff, 4 | BRF_PRG | BRF_ESS }, // 8 External MCU Code - { "mm_voi-1.bin", 0x20000, 0xd09b5830, 4 | BRF_PRG | BRF_ESS }, // 9 - - { "mm_chr-8.bin", 0x20000, 0xa3784dfe, 5 | BRF_GRA }, // 10 Character Pixel Masks - - { "mm_chr-0.bin", 0x20000, 0x43ff2dfc, 6 | BRF_GRA }, // 11 Characters - { "mm_chr-1.bin", 0x20000, 0xb9b4b72d, 6 | BRF_GRA }, // 12 - { "mm_chr-2.bin", 0x20000, 0xbee28425, 6 | BRF_GRA }, // 13 - { "mm_chr-3.bin", 0x20000, 0xd9f41e5c, 6 | BRF_GRA }, // 14 - { "mm_chr-4.bin", 0x20000, 0x3484f4ae, 6 | BRF_GRA }, // 15 - { "mm_chr-5.bin", 0x20000, 0xc863deba, 6 | BRF_GRA }, // 16 - - { "mm_obj-0.bin", 0x20000, 0xd4b7e698, 7 | BRF_GRA }, // 17 Sprites - { "mm_obj-1.bin", 0x20000, 0x1ce49e04, 7 | BRF_GRA }, // 18 - { "mm_obj-2.bin", 0x20000, 0x3d3d5de3, 7 | BRF_GRA }, // 19 - { "mm_obj-3.bin", 0x20000, 0xdac57358, 7 | BRF_GRA }, // 20 -}; - -STD_ROM_PICK(mmaze2) -STD_ROM_FN(mmaze2) - -struct BurnDriver BurnDrvMmaze2 = { - "mmaze2", "mmaze", NULL, NULL, "1988", - "Marchen Maze (Japan, hack?)\0", "Error on first boot is normal", "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, mmaze2RomInfo, mmaze2RomName, NULL, NULL, DrvInputInfo, MmazeDIPInfo, - MmazeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Bakutotsu Kijuutei - -static struct BurnRomInfo bakutotuRomDesc[] = { - { "bk1_s0.bin", 0x10000, 0xc35d7df6, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "bk_prg-0.bin", 0x20000, 0x4529c362, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "bk1_p1.bin", 0x10000, 0xd389d6d4, 2 | BRF_PRG | BRF_ESS }, // 2 - { "bk1_p2.bin", 0x10000, 0x7a686daa, 2 | BRF_PRG | BRF_ESS }, // 3 - { "bk1_p3.bin", 0x20000, 0xe608234f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "bk1_p4.bin", 0x10000, 0x96446d48, 2 | BRF_PRG | BRF_ESS }, // 5 - { "bk1_p5.bin", 0x10000, 0xdceed7cb, 2 | BRF_PRG | BRF_ESS }, // 6 - { "bk1_p6.bin", 0x20000, 0x57a3ce42, 2 | BRF_PRG | BRF_ESS }, // 7 - { "bk1_prg7.bin", 0x20000, 0xfac1c1bf, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 9 Internal MCU Code - - { "bk1_v0.bin", 0x10000, 0x008e290e, 4 | BRF_PRG | BRF_ESS }, // 10 External MCU Code - - { "bk_chr-8.bin", 0x20000, 0x6c8d4029, 5 | BRF_GRA }, // 11 Character Pixel Masks - - { "bk_chr-0.bin", 0x20000, 0x4e011058, 6 | BRF_GRA }, // 12 Characters - { "bk_chr-1.bin", 0x20000, 0x496fcb9b, 6 | BRF_GRA }, // 13 - { "bk_chr-2.bin", 0x20000, 0xdc812e28, 6 | BRF_GRA }, // 14 - { "bk_chr-3.bin", 0x20000, 0x2b6120f4, 6 | BRF_GRA }, // 15 - - { "bk_obj-0.bin", 0x20000, 0x88c627c1, 7 | BRF_GRA }, // 16 Sprites - { "bk_obj-3.bin", 0x20000, 0xf7d1909a, 7 | BRF_GRA }, // 17 - { "bk_obj-4.bin", 0x20000, 0x27ed1441, 7 | BRF_GRA }, // 18 - { "bk_obj-3.bin", 0x20000, 0xf7d1909a, 7 | BRF_GRA }, // 19 - { "bk_obj-4.bin", 0x20000, 0x27ed1441, 7 | BRF_GRA }, // 20 - { "bk_obj-5.bin", 0x20000, 0x790560c0, 7 | BRF_GRA }, // 21 - { "bk_obj-6.bin", 0x20000, 0x2cd4d2ea, 7 | BRF_GRA }, // 22 - { "bk_obj-7.bin", 0x20000, 0x809aa0e6, 7 | BRF_GRA }, // 23 -}; - -STD_ROM_PICK(bakutotu) -STD_ROM_FN(bakutotu) - -static INT32 BakutotuInit() -{ - namcos1_key_init(2, 0x022, -1, -1, -1, -1, -1, -1); - dac_kludge = 2; - - return DrvInit(); -} - -struct BurnDriver BurnDrvBakutotu = { - "bakutotu", NULL, NULL, NULL, "1988", - "Bakutotsu Kijuutei\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, bakutotuRomInfo, bakutotuRomName, NULL, NULL, DrvInputInfo, BakutotuDIPInfo, - BakutotuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// World Court (Japan) - -static struct BurnRomInfo wldcourtRomDesc[] = { - { "wc1_snd0.bin", 0x10000, 0x17a6505d, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "wc1_prg6.bin", 0x10000, 0xe9216b9e, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "wc1_prg7.bin", 0x10000, 0x8a7c6cac, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 3 Internal MCU Code - - { "wc1_voi0.bin", 0x10000, 0xb57919f7, 4 | BRF_PRG | BRF_ESS }, // 4 External MCU Code - { "wc1_voi1.bin", 0x20000, 0x97974b4b, 4 | BRF_PRG | BRF_ESS }, // 5 - - { "wc1_chr8.bin", 0x20000, 0x23e1c399, 5 | BRF_GRA }, // 6 Character Pixel Masks - - { "wc1_chr0.bin", 0x20000, 0x9fb07b9b, 6 | BRF_GRA }, // 7 Characters - { "wc1_chr1.bin", 0x20000, 0x01bfbf60, 6 | BRF_GRA }, // 8 - { "wc1_chr2.bin", 0x20000, 0x7e8acf45, 6 | BRF_GRA }, // 9 - { "wc1_chr3.bin", 0x20000, 0x924e9c81, 6 | BRF_GRA }, // 10 - - { "wc1_obj0.bin", 0x20000, 0x70d562f8, 7 | BRF_GRA }, // 11 Sprites - { "wc1_obj1.bin", 0x20000, 0xba8b034a, 7 | BRF_GRA }, // 12 - { "wc1_obj2.bin", 0x20000, 0xc2bd5f0f, 7 | BRF_GRA }, // 13 - { "wc1_obj3.bin", 0x10000, 0x1aa2dbc8, 7 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(wldcourt) -STD_ROM_FN(wldcourt) - -static INT32 WldcourtInit() -{ - namcos1_key_init(1, 0x035, -1, -1, -1, -1, -1, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvWldcourt = { - "wldcourt", NULL, NULL, NULL, "1988", - "World Court (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, wldcourtRomInfo, wldcourtRomName, NULL, NULL, DrvInputInfo, WldcourtDIPInfo, - WldcourtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Splatter House (World, new version (SH3)) - -static struct BurnRomInfo splatterRomDesc[] = { - { "sh1_snd0b.bin", 0x10000, 0x03b47a5c, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "sh1_snd1.bin", 0x10000, 0x8ece9e0a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sh1_prg0.bin", 0x10000, 0x4e07e6d9, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "sh1_prg1.bin", 0x10000, 0x7a3efe09, 2 | BRF_PRG | BRF_ESS }, // 3 - { "sh1_prg2.bin", 0x10000, 0x434dbe7d, 2 | BRF_PRG | BRF_ESS }, // 4 - { "sh1_prg3.bin", 0x10000, 0x955ce93f, 2 | BRF_PRG | BRF_ESS }, // 5 - { "sh1_prg4.bin", 0x10000, 0x350dee5b, 2 | BRF_PRG | BRF_ESS }, // 6 - { "sh3_prg5.bin", 0x10000, 0x3af893d9, 2 | BRF_PRG | BRF_ESS }, // 7 - { "sh3_prg6.bin", 0x10000, 0x0579e90e, 2 | BRF_PRG | BRF_ESS }, // 8 - { "sh3_prg7.bin", 0x10000, 0x653b4509, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 10 Internal MCU Code - - { "sh_voi-0.bin", 0x20000, 0x2199cb66, 4 | BRF_PRG | BRF_ESS }, // 11 External MCU Code - { "sh_voi-1.bin", 0x20000, 0x9b6472af, 4 | BRF_PRG | BRF_ESS }, // 12 - { "sh_voi-2.bin", 0x20000, 0x25ea75b6, 4 | BRF_PRG | BRF_ESS }, // 13 - { "sh_voi-3.bin", 0x20000, 0x5eebcdb4, 4 | BRF_PRG | BRF_ESS }, // 14 - - { "sh_chr-8.bin", 0x20000, 0x321f483b, 5 | BRF_GRA }, // 15 Character Pixel Masks - - { "sh_chr-0.bin", 0x20000, 0x4dd2ef05, 6 | BRF_GRA }, // 16 Characters - { "sh_chr-1.bin", 0x20000, 0x7a764999, 6 | BRF_GRA }, // 17 - { "sh_chr-2.bin", 0x20000, 0x6e6526ee, 6 | BRF_GRA }, // 18 - { "sh_chr-3.bin", 0x20000, 0x8d05abdb, 6 | BRF_GRA }, // 19 - { "sh_chr-4.bin", 0x20000, 0x1e1f8488, 6 | BRF_GRA }, // 20 - { "sh_chr-5.bin", 0x20000, 0x684cf554, 6 | BRF_GRA }, // 21 - - { "sh_obj-0.bin", 0x20000, 0x1cedbbae, 7 | BRF_GRA }, // 22 Sprites - { "sh_obj-1.bin", 0x20000, 0xe56e91ee, 7 | BRF_GRA }, // 23 - { "sh_obj-2.bin", 0x20000, 0x3dfb0230, 7 | BRF_GRA }, // 24 - { "sh_obj-3.bin", 0x20000, 0xe4e5a581, 7 | BRF_GRA }, // 25 - { "sh_obj-4.bin", 0x20000, 0xb2422182, 7 | BRF_GRA }, // 26 - { "sh_obj-5.bin", 0x20000, 0x24d0266f, 7 | BRF_GRA }, // 27 - { "sh_obj-6.bin", 0x20000, 0x80830b0e, 7 | BRF_GRA }, // 28 - { "sh_obj-7.bin", 0x20000, 0x08b1953a, 7 | BRF_GRA }, // 29 -}; - -STD_ROM_PICK(splatter) -STD_ROM_FN(splatter) - -static INT32 SplatterInit() -{ - namcos1_key_init(3, 0x0b5, 3, 4, -1, -1, -1, -1); - dac_kludge = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvSplatter = { - "splatter", NULL, NULL, NULL, "1988", - "Splatter House (World, new version (SH3))\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, splatterRomInfo, splatterRomName, NULL, NULL, DrvInputInfo, Splatter3DIPInfo, - SplatterInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Splatter House (World, old version (SH2)) - -static struct BurnRomInfo splatter2RomDesc[] = { - { "sh1_snd0.bin", 0x10000, 0x90abd4ad, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "sh1_snd1.bin", 0x10000, 0x8ece9e0a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sh1_prg0.bin", 0x10000, 0x4e07e6d9, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "sh1_prg1.bin", 0x10000, 0x7a3efe09, 2 | BRF_PRG | BRF_ESS }, // 3 - { "sh1_prg2.bin", 0x10000, 0x434dbe7d, 2 | BRF_PRG | BRF_ESS }, // 4 - { "sh1_prg3.bin", 0x10000, 0x955ce93f, 2 | BRF_PRG | BRF_ESS }, // 5 - { "sh1_prg4.bin", 0x10000, 0x350dee5b, 2 | BRF_PRG | BRF_ESS }, // 6 - { "sh1_prg5.bin", 0x10000, 0x0187de9a, 2 | BRF_PRG | BRF_ESS }, // 7 - { "sh2_prg6.bin", 0x10000, 0x054d6275, 2 | BRF_PRG | BRF_ESS }, // 8 - { "sh2_prg7.bin", 0x10000, 0x942cb61e, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 10 Internal MCU Code - - { "sh_voi-0.bin", 0x20000, 0x2199cb66, 4 | BRF_PRG | BRF_ESS }, // 11 External MCU Code - { "sh_voi-1.bin", 0x20000, 0x9b6472af, 4 | BRF_PRG | BRF_ESS }, // 12 - { "sh_voi-2.bin", 0x20000, 0x25ea75b6, 4 | BRF_PRG | BRF_ESS }, // 13 - { "sh_voi-3.bin", 0x20000, 0x5eebcdb4, 4 | BRF_PRG | BRF_ESS }, // 14 - - { "sh_chr-8.bin", 0x20000, 0x321f483b, 5 | BRF_GRA }, // 15 Character Pixel Masks - - { "sh_chr-0.bin", 0x20000, 0x4dd2ef05, 6 | BRF_GRA }, // 16 Characters - { "sh_chr-1.bin", 0x20000, 0x7a764999, 6 | BRF_GRA }, // 17 - { "sh_chr-2.bin", 0x20000, 0x6e6526ee, 6 | BRF_GRA }, // 18 - { "sh_chr-3.bin", 0x20000, 0x8d05abdb, 6 | BRF_GRA }, // 19 - { "sh_chr-4.bin", 0x20000, 0x1e1f8488, 6 | BRF_GRA }, // 20 - { "sh_chr-5.bin", 0x20000, 0x684cf554, 6 | BRF_GRA }, // 21 - - { "sh_obj-0.bin", 0x20000, 0x1cedbbae, 7 | BRF_GRA }, // 22 Sprites - { "sh_obj-1.bin", 0x20000, 0xe56e91ee, 7 | BRF_GRA }, // 23 - { "sh_obj-2.bin", 0x20000, 0x3dfb0230, 7 | BRF_GRA }, // 24 - { "sh_obj-3.bin", 0x20000, 0xe4e5a581, 7 | BRF_GRA }, // 25 - { "sh_obj-4.bin", 0x20000, 0xb2422182, 7 | BRF_GRA }, // 26 - { "sh_obj-5.bin", 0x20000, 0x24d0266f, 7 | BRF_GRA }, // 27 - { "sh_obj-6.bin", 0x20000, 0x80830b0e, 7 | BRF_GRA }, // 28 - { "sh_obj-7.bin", 0x20000, 0x08b1953a, 7 | BRF_GRA }, // 29 -}; - -STD_ROM_PICK(splatter2) -STD_ROM_FN(splatter2) - -struct BurnDriver BurnDrvSplatter2 = { - "splatter2", "splatter", NULL, NULL, "1988", - "Splatter House (World, old version (SH2))\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, splatter2RomInfo, splatter2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - SplatterInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Splatter House (Japan, SH1) - -static struct BurnRomInfo splatterjRomDesc[] = { - { "sh1_snd0.bin", 0x10000, 0x90abd4ad, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "sh1_snd1.bin", 0x10000, 0x8ece9e0a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sh1_prg0.bin", 0x10000, 0x4e07e6d9, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "sh1_prg1.bin", 0x10000, 0x7a3efe09, 2 | BRF_PRG | BRF_ESS }, // 3 - { "sh1_prg2.bin", 0x10000, 0x434dbe7d, 2 | BRF_PRG | BRF_ESS }, // 4 - { "sh1_prg3.bin", 0x10000, 0x955ce93f, 2 | BRF_PRG | BRF_ESS }, // 5 - { "sh1_prg4.bin", 0x10000, 0x350dee5b, 2 | BRF_PRG | BRF_ESS }, // 6 - { "sh1_prg5.bin", 0x10000, 0x0187de9a, 2 | BRF_PRG | BRF_ESS }, // 7 - { "sh1_prg6.bin", 0x10000, 0x97a3e664, 2 | BRF_PRG | BRF_ESS }, // 8 - { "sh1_prg7.bin", 0x10000, 0x24c8cbd7, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 10 Internal MCU Code - - { "sh_voi-0.bin", 0x20000, 0x2199cb66, 4 | BRF_PRG | BRF_ESS }, // 11 External MCU Code - { "sh_voi-1.bin", 0x20000, 0x9b6472af, 4 | BRF_PRG | BRF_ESS }, // 12 - { "sh_voi-2.bin", 0x20000, 0x25ea75b6, 4 | BRF_PRG | BRF_ESS }, // 13 - { "sh_voi-3.bin", 0x20000, 0x5eebcdb4, 4 | BRF_PRG | BRF_ESS }, // 14 - - { "sh_chr-8.bin", 0x20000, 0x321f483b, 5 | BRF_GRA }, // 15 Character Pixel Masks - - { "sh_chr-0.bin", 0x20000, 0x4dd2ef05, 6 | BRF_GRA }, // 16 Characters - { "sh_chr-1.bin", 0x20000, 0x7a764999, 6 | BRF_GRA }, // 17 - { "sh_chr-2.bin", 0x20000, 0x6e6526ee, 6 | BRF_GRA }, // 18 - { "sh_chr-3.bin", 0x20000, 0x8d05abdb, 6 | BRF_GRA }, // 19 - { "sh_chr-4.bin", 0x20000, 0x1e1f8488, 6 | BRF_GRA }, // 20 - { "sh_chr-5.bin", 0x20000, 0x684cf554, 6 | BRF_GRA }, // 21 - - { "sh_obj-0.bin", 0x20000, 0x1cedbbae, 7 | BRF_GRA }, // 22 Sprites - { "sh_obj-1.bin", 0x20000, 0xe56e91ee, 7 | BRF_GRA }, // 23 - { "sh_obj-2.bin", 0x20000, 0x3dfb0230, 7 | BRF_GRA }, // 24 - { "sh_obj-3.bin", 0x20000, 0xe4e5a581, 7 | BRF_GRA }, // 25 - { "sh_obj-4.bin", 0x20000, 0xb2422182, 7 | BRF_GRA }, // 26 - { "sh_obj-5.bin", 0x20000, 0x24d0266f, 7 | BRF_GRA }, // 27 - { "sh_obj-6.bin", 0x20000, 0x80830b0e, 7 | BRF_GRA }, // 28 - { "sh_obj-7.bin", 0x20000, 0x08b1953a, 7 | BRF_GRA }, // 29 -}; - -STD_ROM_PICK(splatterj) -STD_ROM_FN(splatterj) - -struct BurnDriver BurnDrvSplatterj = { - "splatterj", "splatter", NULL, NULL, "1988", - "Splatter House (Japan, SH1)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, splatterjRomInfo, splatterjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - SplatterInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Face Off (Japan 2 Players) - -static struct BurnRomInfo faceoffRomDesc[] = { - { "fo1_s0.bin", 0x10000, 0x9a00d97d, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "fo1_p6.bin", 0x10000, 0xa48ee82b, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "fo1_p7.bin", 0x10000, 0x6791d221, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 3 Internal MCU Code - - { "fo1_v0.bin", 0x10000, 0xe6edf63e, 4 | BRF_PRG | BRF_ESS }, // 4 External MCU Code - { "fo1_v1.bin", 0x10000, 0x132a5d90, 4 | BRF_PRG | BRF_ESS }, // 5 - - { "fo1_c8.bin", 0x10000, 0xd397216c, 5 | BRF_GRA }, // 6 Character Pixel Masks - - { "fo1_c0.bin", 0x20000, 0x27884ac0, 6 | BRF_GRA }, // 7 Characters - { "fo1_c1.bin", 0x20000, 0x4d423499, 6 | BRF_GRA }, // 8 - { "fo1_c2.bin", 0x20000, 0xd62d86f1, 6 | BRF_GRA }, // 9 - { "fo1_c3.bin", 0x20000, 0xc2a08694, 6 | BRF_GRA }, // 10 - - { "fo1_o0.bin", 0x20000, 0x41af669d, 7 | BRF_GRA }, // 11 Sprites - { "fo1_o1.bin", 0x20000, 0xad5fbaa7, 7 | BRF_GRA }, // 12 - { "fo1_o2.bin", 0x20000, 0xc1f7eb52, 7 | BRF_GRA }, // 13 - { "fo1_o3.bin", 0x20000, 0xaa95d2e0, 7 | BRF_GRA }, // 14 - { "fo1_o4.bin", 0x20000, 0x985f04c7, 7 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(faceoff) -STD_ROM_FN(faceoff) - -static INT32 FaceoffInit() -{ - input_read_callback = faceoff_inputs_read; - dac_kludge = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvFaceoff = { - "faceoff", NULL, NULL, NULL, "1988", - "Face Off (Japan 2 Players)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 4, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, faceoffRomInfo, faceoffRomName, NULL, NULL, FaceoffInputInfo, FaceoffDIPInfo, - FaceoffInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Rompers (Japan, new version (Rev B)) - -static struct BurnRomInfo rompersRomDesc[] = { - { "rp1_snd0.bin", 0x10000, 0xc7c8d649, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "rp1_prg4.bin", 0x10000, 0x0918f06d, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "rp1_prg5.bin", 0x10000, 0x98bd4133, 2 | BRF_PRG | BRF_ESS }, // 2 - { "rp1prg6b.bin", 0x10000, 0x80821065, 2 | BRF_PRG | BRF_ESS }, // 3 - { "rp1prg7b.bin", 0x10000, 0x49d057e2, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 5 Internal MCU Code - - { "rp_voi-0.bin", 0x20000, 0x11caef7e, 4 | BRF_PRG | BRF_ESS }, // 6 External MCU Code - - { "rp1_chr8.bin", 0x10000, 0x69cfe46a, 5 | BRF_GRA }, // 7 Character Pixel Masks - - { "rp_chr-0.bin", 0x20000, 0x41b10ef3, 6 | BRF_GRA }, // 8 Characters - { "rp_chr-1.bin", 0x20000, 0xc18cd24e, 6 | BRF_GRA }, // 9 - { "rp_chr-2.bin", 0x20000, 0x6c9a3c79, 6 | BRF_GRA }, // 10 - { "rp_chr-3.bin", 0x20000, 0x473aa788, 6 | BRF_GRA }, // 11 - - { "rp_obj-0.bin", 0x20000, 0x1dcbf8bb, 7 | BRF_GRA }, // 12 Sprites - { "rp_obj-1.bin", 0x20000, 0xcb98e273, 7 | BRF_GRA }, // 13 - { "rp_obj-2.bin", 0x20000, 0x6ebd191e, 7 | BRF_GRA }, // 14 - { "rp_obj-3.bin", 0x20000, 0x7c9828a1, 7 | BRF_GRA }, // 15 - { "rp_obj-4.bin", 0x20000, 0x0348220b, 7 | BRF_GRA }, // 16 - { "rp1_obj5.bin", 0x10000, 0x9e2ba243, 7 | BRF_GRA }, // 17 - { "rp1_obj6.bin", 0x10000, 0x6bf2aca6, 7 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(rompers) -STD_ROM_FN(rompers) - -static INT32 RompersInit() -{ - namcos1_key_init(3, 0x0b6, 7, -1, -1, -1, -1, -1); - sixtyhz = 1; - dac_kludge = 3; - - return DrvInit(); -} - -struct BurnDriver BurnDrvRompers = { - "rompers", NULL, NULL, NULL, "1989", - "Rompers (Japan, new version (Rev B))\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, rompersRomInfo, rompersRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - RompersInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Rompers (Japan, old version) - -static struct BurnRomInfo rompersoRomDesc[] = { - { "rp1_snd0.bin", 0x10000, 0xc7c8d649, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "rp1_prg4.bin", 0x10000, 0x0918f06d, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "rp1_prg5.bin", 0x10000, 0x98bd4133, 2 | BRF_PRG | BRF_ESS }, // 2 - { "rp1_prg6.bin", 0x10000, 0xfc183345, 2 | BRF_PRG | BRF_ESS }, // 3 - { "rp1_prg7.bin", 0x10000, 0x8d49f28a, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 5 Internal MCU Code - - { "rp_voi-0.bin", 0x20000, 0x11caef7e, 4 | BRF_PRG | BRF_ESS }, // 6 External MCU Code - - { "rp1_chr8.bin", 0x10000, 0x69cfe46a, 5 | BRF_GRA }, // 7 Character Pixel Masks - - { "rp_chr-0.bin", 0x20000, 0x41b10ef3, 6 | BRF_GRA }, // 8 Characters - { "rp_chr-1.bin", 0x20000, 0xc18cd24e, 6 | BRF_GRA }, // 9 - { "rp_chr-2.bin", 0x20000, 0x6c9a3c79, 6 | BRF_GRA }, // 10 - { "rp_chr-3.bin", 0x20000, 0x473aa788, 6 | BRF_GRA }, // 11 - - { "rp_obj-0.bin", 0x20000, 0x1dcbf8bb, 7 | BRF_GRA }, // 12 Sprites - { "rp_obj-1.bin", 0x20000, 0xcb98e273, 7 | BRF_GRA }, // 13 - { "rp_obj-2.bin", 0x20000, 0x6ebd191e, 7 | BRF_GRA }, // 14 - { "rp_obj-3.bin", 0x20000, 0x7c9828a1, 7 | BRF_GRA }, // 15 - { "rp_obj-4.bin", 0x20000, 0x0348220b, 7 | BRF_GRA }, // 16 - { "rp1_obj5.bin", 0x10000, 0x9e2ba243, 7 | BRF_GRA }, // 17 - { "rp1_obj6.bin", 0x10000, 0x6bf2aca6, 7 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(romperso) -STD_ROM_FN(romperso) - -struct BurnDriver BurnDrvRomperso = { - "romperso", "rompers", NULL, NULL, "1989", - "Rompers (Japan, old version)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, rompersoRomInfo, rompersoRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - RompersInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Blast Off (Japan) - -static struct BurnRomInfo blastoffRomDesc[] = { - { "bo1-snd0.bin", 0x10000, 0x2ecab76e, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "bo1-snd1.bin", 0x10000, 0x048a6af1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bo1_prg6.bin", 0x20000, 0xd60da63e, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "bo1prg7b.bin", 0x20000, 0xb630383c, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "bo_voi-0.bin", 0x20000, 0x47065e18, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - { "bo_voi-1.bin", 0x20000, 0x0308b18e, 4 | BRF_PRG | BRF_ESS }, // 6 - { "bo_voi-2.bin", 0x20000, 0x88cab230, 4 | BRF_PRG | BRF_ESS }, // 7 - - { "bo_chr-8.bin", 0x20000, 0xe8b5f2d4, 5 | BRF_GRA }, // 8 Character Pixel Masks - - { "bo_chr-0.bin", 0x20000, 0xbdc0afb5, 6 | BRF_GRA }, // 9 Characters - { "bo_chr-1.bin", 0x20000, 0x963d2639, 6 | BRF_GRA }, // 10 - { "bo_chr-2.bin", 0x20000, 0xacdb6894, 6 | BRF_GRA }, // 11 - { "bo_chr-3.bin", 0x20000, 0x214ec47f, 6 | BRF_GRA }, // 12 - { "bo_chr-4.bin", 0x20000, 0x08397583, 6 | BRF_GRA }, // 13 - { "bo_chr-5.bin", 0x20000, 0x20402429, 6 | BRF_GRA }, // 14 - { "bo_chr-7.bin", 0x20000, 0x4c5c4603, 6 | BRF_GRA }, // 15 - - { "bo_obj-0.bin", 0x20000, 0xb3308ae7, 7 | BRF_GRA }, // 16 Sprites - { "bo_obj-1.bin", 0x20000, 0xc9c93c47, 7 | BRF_GRA }, // 17 - { "bo_obj-2.bin", 0x20000, 0xeef77527, 7 | BRF_GRA }, // 18 - { "bo_obj-3.bin", 0x20000, 0xe3d9ed58, 7 | BRF_GRA }, // 19 - { "bo1_obj4.bin", 0x20000, 0xc2c1b9cb, 7 | BRF_GRA }, // 20 -}; - -STD_ROM_PICK(blastoff) -STD_ROM_FN(blastoff) - -static INT32 BlastoffInit() -{ - namcos1_key_init(3, 0x0b7, 0, 7, 3, 5, -1, -1); - dac_kludge = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvBlastoff = { - "blastoff", NULL, NULL, NULL, "1989", - "Blast Off (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, blastoffRomInfo, blastoffRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - BlastoffInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// World Stadium '89 (Japan) - -static struct BurnRomInfo ws89RomDesc[] = { - { "w91_snd0.bin", 0x10000, 0x52b84d5a, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "ws1_snd1.bin", 0x10000, 0x31bf74c1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ws1_prg0.bin", 0x10000, 0xb0234298, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "w91_prg1.bin", 0x10000, 0x7ad8768f, 2 | BRF_PRG | BRF_ESS }, // 3 - { "w91_prg2.bin", 0x10000, 0x522e5441, 2 | BRF_PRG | BRF_ESS }, // 4 - { "w91_prg7.bin", 0x10000, 0x611ed964, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 6 Internal MCU Code - - { "ws1_voi0.bin", 0x10000, 0xf6949199, 4 | BRF_PRG | BRF_ESS }, // 7 External MCU Code - { "ws_voi-1.bin", 0x20000, 0x210e2af9, 4 | BRF_PRG | BRF_ESS }, // 8 - - { "ws_chr-8.bin", 0x20000, 0xd1897b9b, 5 | BRF_GRA }, // 9 Character Pixel Masks - - { "ws_chr-0.bin", 0x20000, 0x3e3e96b4, 6 | BRF_GRA }, // 10 Characters - { "ws_chr-1.bin", 0x20000, 0x897dfbc1, 6 | BRF_GRA }, // 11 - { "ws_chr-2.bin", 0x20000, 0xe142527c, 6 | BRF_GRA }, // 12 - { "ws_chr-3.bin", 0x20000, 0x907d4dc8, 6 | BRF_GRA }, // 13 - { "ws_chr-4.bin", 0x20000, 0xafb11e17, 6 | BRF_GRA }, // 14 - { "ws_chr-6.bin", 0x20000, 0xa16a17c2, 6 | BRF_GRA }, // 15 - - { "ws_obj-0.bin", 0x20000, 0x12dc83a6, 7 | BRF_GRA }, // 16 Sprites - { "ws_obj-1.bin", 0x20000, 0x68290a46, 7 | BRF_GRA }, // 17 - { "ws_obj-2.bin", 0x20000, 0xcd5ba55d, 7 | BRF_GRA }, // 18 - { "w91_obj3.bin", 0x10000, 0x8ee76105, 7 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(ws89) -STD_ROM_FN(ws89) - -static INT32 Ws89Init() -{ - namcos1_key_init(3, 0x0b8, 2, -1, -1, -1, -1, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvWs89 = { - "ws89", "ws", NULL, NULL, "1989", - "World Stadium '89 (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, ws89RomInfo, ws89RomName, NULL, NULL, DrvInputInfo, Ws89DIPInfo, - Ws89Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Dangerous Seed (Japan) - -static struct BurnRomInfo dangseedRomDesc[] = { - { "dr1_snd0.bin", 0x20000, 0xbcbbb21d, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "dr_prg-5.bin", 0x20000, 0x7986bbdd, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "dr1_prg6.bin", 0x10000, 0xcc68262b, 2 | BRF_PRG | BRF_ESS }, // 2 - { "dr1_prg7.bin", 0x20000, 0xd7d2f653, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "dr_voi-0.bin", 0x20000, 0xde4fdc0e, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - - { "dr_chr-8.bin", 0x20000, 0x0fbaa10e, 5 | BRF_GRA }, // 6 Character Pixel Masks - - { "dr_chr-0.bin", 0x20000, 0x419bacc7, 6 | BRF_GRA }, // 7 Characters - { "dr_chr-1.bin", 0x20000, 0x55ce77e1, 6 | BRF_GRA }, // 8 - { "dr_chr-2.bin", 0x20000, 0x6f913419, 6 | BRF_GRA }, // 9 - { "dr_chr-3.bin", 0x20000, 0xfe1f1a25, 6 | BRF_GRA }, // 10 - { "dr_chr-4.bin", 0x20000, 0xc34471bc, 6 | BRF_GRA }, // 11 - { "dr_chr-5.bin", 0x20000, 0x715c0720, 6 | BRF_GRA }, // 12 - { "dr_chr-6.bin", 0x20000, 0x5c1b71fa, 6 | BRF_GRA }, // 13 - - { "dr_obj-0.bin", 0x20000, 0xabb95644, 7 | BRF_GRA }, // 14 Sprites - { "dr_obj-1.bin", 0x20000, 0x24d6db51, 7 | BRF_GRA }, // 15 - { "dr_obj-2.bin", 0x20000, 0x7e3a78c0, 7 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(dangseed) -STD_ROM_FN(dangseed) - -static INT32 DangseedInit() -{ - namcos1_key_init(3, 0x134, 6, -1, 5, -1, 0, 4); - - return DrvInit(); -} - -struct BurnDriver BurnDrvDangseed = { - "dangseed", NULL, NULL, NULL, "1989", - "Dangerous Seed (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dangseedRomInfo, dangseedRomName, NULL, NULL, DrvInputInfo, DangseedDIPInfo, - DangseedInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// World Stadium '90 (Japan) - -static struct BurnRomInfo ws90RomDesc[] = { - { "w91_snd0.bin", 0x10000, 0x52b84d5a, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - { "ws1_snd1.bin", 0x10000, 0x31bf74c1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ws1_prg0.bin", 0x10000, 0xb0234298, 2 | BRF_PRG | BRF_ESS }, // 2 Main and Sub m6809 Code - { "w91_prg1.bin", 0x10000, 0x7ad8768f, 2 | BRF_PRG | BRF_ESS }, // 3 - { "w901prg2.bin", 0x10000, 0xb9e98e2f, 2 | BRF_PRG | BRF_ESS }, // 4 - { "w901prg7.bin", 0x10000, 0x37ae1b25, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 6 Internal MCU Code - - { "ws1_voi0.bin", 0x10000, 0xf6949199, 4 | BRF_PRG | BRF_ESS }, // 7 External MCU Code - { "ws_voi-1.bin", 0x20000, 0x210e2af9, 4 | BRF_PRG | BRF_ESS }, // 8 - - { "ws_chr-8.bin", 0x20000, 0xd1897b9b, 5 | BRF_GRA }, // 9 Character Pixel Masks - - { "ws_chr-0.bin", 0x20000, 0x3e3e96b4, 6 | BRF_GRA }, // 10 Characters - { "ws_chr-1.bin", 0x20000, 0x897dfbc1, 6 | BRF_GRA }, // 11 - { "ws_chr-2.bin", 0x20000, 0xe142527c, 6 | BRF_GRA }, // 12 - { "ws_chr-3.bin", 0x20000, 0x907d4dc8, 6 | BRF_GRA }, // 13 - { "ws_chr-4.bin", 0x20000, 0xafb11e17, 6 | BRF_GRA }, // 14 - { "ws_chr-6.bin", 0x20000, 0xa16a17c2, 6 | BRF_GRA }, // 15 - - { "ws_obj-0.bin", 0x20000, 0x12dc83a6, 7 | BRF_GRA }, // 16 Sprites - { "ws_obj-1.bin", 0x20000, 0x68290a46, 7 | BRF_GRA }, // 17 - { "ws_obj-2.bin", 0x20000, 0xcd5ba55d, 7 | BRF_GRA }, // 18 - { "w901obj3.bin", 0x10000, 0x7d0b8961, 7 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(ws90) -STD_ROM_FN(ws90) - -static INT32 Ws90Init() -{ - namcos1_key_init(3, 0x136, 4, -1, 7, -1, 3, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvWs90 = { - "ws90", "ws", NULL, NULL, "1990", - "World Stadium '90 (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, ws90RomInfo, ws90RomName, NULL, NULL, DrvInputInfo, Ws90DIPInfo, - Ws90Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Pistol Daimyo no Bouken (Japan) - -static struct BurnRomInfo pistoldmRomDesc[] = { - { "pd1_snd0.bin", 0x20000, 0x026da54e, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "pd1_prg0.bin", 0x20000, 0x9db9b89c, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "pd1prg7b.bin", 0x20000, 0x7189b797, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 3 Internal MCU Code - - { "pd_voi-0.bin", 0x20000, 0xad1b8128, 4 | BRF_PRG | BRF_ESS }, // 4 External MCU Code - { "pd_voi-1.bin", 0x20000, 0x2871c494, 4 | BRF_PRG | BRF_ESS }, // 5 - { "pd_voi-2.bin", 0x20000, 0xe783f0c4, 4 | BRF_PRG | BRF_ESS }, // 6 - - { "pd_chr-8.bin", 0x20000, 0xa5f516db, 5 | BRF_GRA }, // 7 Character Pixel Masks - - { "pd_chr-0.bin", 0x20000, 0xadbbaf5c, 6 | BRF_GRA }, // 8 Characters - { "pd_chr-1.bin", 0x20000, 0xb4e4f554, 6 | BRF_GRA }, // 9 - { "pd_chr-2.bin", 0x20000, 0x84592540, 6 | BRF_GRA }, // 10 - { "pd_chr-3.bin", 0x20000, 0x450bdaa9, 6 | BRF_GRA }, // 11 - - { "pd_obj-0.bin", 0x20000, 0x7269821d, 7 | BRF_GRA }, // 12 Sprites - { "pd_obj-1.bin", 0x20000, 0x4f9738e5, 7 | BRF_GRA }, // 13 - { "pd_obj-2.bin", 0x20000, 0x33208776, 7 | BRF_GRA }, // 14 - { "pd_obj-3.bin", 0x20000, 0x0dbd54ef, 7 | BRF_GRA }, // 15 - { "pd_obj-4.bin", 0x20000, 0x58e838e2, 7 | BRF_GRA }, // 16 - { "pd_obj-5.bin", 0x20000, 0x414f9a9d, 7 | BRF_GRA }, // 17 - { "pd_obj-6.bin", 0x20000, 0x91b4e6e0, 7 | BRF_GRA }, // 18 - { "pd_obj-7.bin", 0x20000, 0x00d4a8f0, 7 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(pistoldm) -STD_ROM_FN(pistoldm) - -static INT32 PistoldmInit() -{ - namcos1_key_init(3, 0x135, 1, 2, 0, -1, 4, -1); - dac_kludge = 3; - - return DrvInit(); -} - -struct BurnDriver BurnDrvPistoldm = { - "pistoldm", NULL, NULL, NULL, "1990", - "Pistol Daimyo no Bouken (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, pistoldmRomInfo, pistoldmRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - PistoldmInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Boxy Boy (SB?) - -static struct BurnRomInfo boxyboyRomDesc[] = { - { "sb1_snd0.bin", 0x10000, 0xbf46a106, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "sb1_prg0.bin", 0x20000, 0x8af8cb73, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "sb1_prg1.bin", 0x20000, 0x5d1fdd94, 2 | BRF_PRG | BRF_ESS }, // 2 - { "sbx_prg7.bin", 0x10000, 0x7787c72e, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "sb1_voi0.bin", 0x10000, 0x63d9cedf, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - - { "sb1_chr8.bin", 0x10000, 0x5692b297, 5 | BRF_GRA }, // 6 Character Pixel Masks - - { "sb1_chr0.bin", 0x20000, 0x267f1331, 6 | BRF_GRA }, // 7 Characters - { "sb1_chr1.bin", 0x20000, 0xe5ff61ad, 6 | BRF_GRA }, // 8 - { "sb1_chr2.bin", 0x20000, 0x099b746b, 6 | BRF_GRA }, // 9 - { "sb1_chr3.bin", 0x20000, 0x1551bb7c, 6 | BRF_GRA }, // 10 - - { "sb1_obj0.bin", 0x10000, 0xed810da4, 7 | BRF_GRA }, // 11 Sprites -}; - -STD_ROM_PICK(boxyboy) -STD_ROM_FN(boxyboy) - -static INT32 BoxyboyInit() -{ - namcos1_key_init(3, 0x137, 2, 3, 0, -1, 4, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvBoxyboy = { - "boxyboy", NULL, NULL, NULL, "1990", - "Boxy Boy (SB?)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, boxyboyRomInfo, boxyboyRomName, NULL, NULL, DrvInputInfo, BoxyboyDIPInfo, - BoxyboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Souko Ban Deluxe (Japan, SB1) - -static struct BurnRomInfo soukobdxRomDesc[] = { - { "sb1_snd0.bin", 0x10000, 0xbf46a106, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "sb1_prg0.bin", 0x20000, 0x8af8cb73, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "sb1_prg1.bin", 0x20000, 0x5d1fdd94, 2 | BRF_PRG | BRF_ESS }, // 2 - { "sb1_prg7.bin", 0x10000, 0xc3bd418a, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "sb1_voi0.bin", 0x10000, 0x63d9cedf, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - - { "sb1_chr8.bin", 0x10000, 0x5692b297, 5 | BRF_GRA }, // 6 Character Pixel Masks - - { "sb1_chr0.bin", 0x20000, 0x267f1331, 6 | BRF_GRA }, // 7 Characters - { "sb1_chr1.bin", 0x20000, 0xe5ff61ad, 6 | BRF_GRA }, // 8 - { "sb1_chr2.bin", 0x20000, 0x099b746b, 6 | BRF_GRA }, // 9 - { "sb1_chr3.bin", 0x20000, 0x1551bb7c, 6 | BRF_GRA }, // 10 - - { "sb1_obj0.bin", 0x10000, 0xed810da4, 7 | BRF_GRA }, // 11 Sprites -}; - -STD_ROM_PICK(soukobdx) -STD_ROM_FN(soukobdx) - -struct BurnDriver BurnDrvSoukobdx = { - "soukobdx", "boxyboy", NULL, NULL, "1990", - "Souko Ban Deluxe (Japan, SB1)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, soukobdxRomInfo, soukobdxRomName, NULL, NULL, DrvInputInfo, BoxyboyDIPInfo, - BoxyboyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Puzzle Club (Japan prototype) - -static struct BurnRomInfo puzlclubRomDesc[] = { - { "pc1_s0.bin", 0x10000, 0x44737c02, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "pc1_p0.bin", 0x10000, 0x2db477c8, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "pc1_p1.bin", 0x10000, 0xdfd9108a, 2 | BRF_PRG | BRF_ESS }, // 2 - { "pc1_p7.bin", 0x10000, 0xf0638260, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "pc1-c8.bin", 0x20000, 0x4e196bcd, 5 | BRF_GRA }, // 5 Character Pixel Masks - - { "pc1-c0.bin", 0x20000, 0xad7b134e, 6 | BRF_GRA }, // 6 Characters - { "pc1-c1.bin", 0x20000, 0x10cb3207, 6 | BRF_GRA }, // 7 - { "pc1-c2.bin", 0x20000, 0xd98d2c8f, 6 | BRF_GRA }, // 8 - { "pc1-c3.bin", 0x20000, 0x91a61d96, 6 | BRF_GRA }, // 9 - { "pc1-c4.bin", 0x20000, 0xf1c95296, 6 | BRF_GRA }, // 10 - { "pc1-c5.bin", 0x20000, 0xbc443c27, 6 | BRF_GRA }, // 11 - { "pc1-c6.bin", 0x20000, 0xec0a3dc5, 6 | BRF_GRA }, // 12 - { "pc1-c7.bin", 0x20000, 0x00000000, 0 | BRF_NODUMP | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(puzlclub) -STD_ROM_FN(puzlclub) - -static INT32 PuzlclubInit() -{ - namcos1_key_init(1, 0x035, -1, -1, -1, -1, -1, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvPuzlclub = { - "puzlclub", NULL, NULL, NULL, "1990", - "Puzzle Club (Japan prototype)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, puzlclubRomInfo, puzlclubRomName, NULL, NULL, DrvInputInfo, PuzlclubDIPInfo, - PuzlclubInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 288, 3, 4 -}; - - -// Tank Force (US, 2 Players) - -static struct BurnRomInfo tankfrceRomDesc[] = { - { "tf1_snd0.bin", 0x20000, 0x4d9cf7aa, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "tf1_prg0.bin", 0x20000, 0x2ae4b9eb, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "tf1_prg1.bin", 0x20000, 0x4a8bb251, 2 | BRF_PRG | BRF_ESS }, // 2 - { "tf1prg7.bin", 0x20000, 0x2ec28a87, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "tf1_voi0.bin", 0x20000, 0xf542676a, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - { "tf1_voi1.bin", 0x20000, 0x615d09cd, 4 | BRF_PRG | BRF_ESS }, // 6 - - { "tf1_chr8.bin", 0x20000, 0x7d53b31e, 5 | BRF_GRA }, // 7 Character Pixel Masks - - { "tf1_chr0.bin", 0x20000, 0x9e91794e, 6 | BRF_GRA }, // 8 Characters - { "tf1_chr1.bin", 0x20000, 0x76e1bc56, 6 | BRF_GRA }, // 9 - { "tf1_chr2.bin", 0x20000, 0xfcb645d9, 6 | BRF_GRA }, // 10 - { "tf1_chr3.bin", 0x20000, 0xa8dbf080, 6 | BRF_GRA }, // 11 - { "tf1_chr4.bin", 0x20000, 0x51fedc8c, 6 | BRF_GRA }, // 12 - { "tf1_chr5.bin", 0x20000, 0xe6c6609a, 6 | BRF_GRA }, // 13 - - { "tf1_obj0.bin", 0x20000, 0x4bedd51a, 7 | BRF_GRA }, // 14 Sprites - { "tf1_obj1.bin", 0x20000, 0xdf674d6d, 7 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(tankfrce) -STD_ROM_FN(tankfrce) - -static INT32 TankfrceInit() -{ - namcos1_key_init(3, 0x0b9, 5, -1, 1, -1, 2, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvTankfrce = { - "tankfrce", NULL, NULL, NULL, "1991", - "Tank Force (US, 2 Players)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, tankfrceRomInfo, tankfrceRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - TankfrceInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Tank Force (US, 4 Players) - -static struct BurnRomInfo tankfrce4RomDesc[] = { - { "tf1_snd0.bin", 0x20000, 0x4d9cf7aa, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "tf1_prg0.bin", 0x20000, 0x2ae4b9eb, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "tf1_prg1.bin", 0x20000, 0x4a8bb251, 2 | BRF_PRG | BRF_ESS }, // 2 - { "tfu4prg7.bin", 0x20000, 0x162adea0, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "tf1_voi0.bin", 0x20000, 0xf542676a, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - { "tf1_voi1.bin", 0x20000, 0x615d09cd, 4 | BRF_PRG | BRF_ESS }, // 6 - - { "tf1_chr8.bin", 0x20000, 0x7d53b31e, 5 | BRF_GRA }, // 7 Character Pixel Masks - - { "tf1_chr0.bin", 0x20000, 0x9e91794e, 6 | BRF_GRA }, // 8 Characters - { "tf1_chr1.bin", 0x20000, 0x76e1bc56, 6 | BRF_GRA }, // 9 - { "tf1_chr2.bin", 0x20000, 0xfcb645d9, 6 | BRF_GRA }, // 10 - { "tf1_chr3.bin", 0x20000, 0xa8dbf080, 6 | BRF_GRA }, // 11 - { "tf1_chr4.bin", 0x20000, 0x51fedc8c, 6 | BRF_GRA }, // 12 - { "tf1_chr5.bin", 0x20000, 0xe6c6609a, 6 | BRF_GRA }, // 13 - - { "tf1_obj0.bin", 0x20000, 0x4bedd51a, 7 | BRF_GRA }, // 14 Sprites - { "tf1_obj1.bin", 0x20000, 0xdf674d6d, 7 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(tankfrce4) -STD_ROM_FN(tankfrce4) - -static INT32 Tankfrce4Init() -{ - input_read_callback = faceoff_inputs_read; - - namcos1_key_init(3, 0x0b9, 5, -1, 1, -1, 2, -1); - - return DrvInit(); -} - -struct BurnDriver BurnDrvTankfrce4 = { - "tankfrce4", "tankfrce", NULL, NULL, "1991", - "Tank Force (US, 4 Players)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 4, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, tankfrce4RomInfo, tankfrce4RomName, NULL, NULL, Tankfrce4InputInfo, FaceoffDIPInfo, - Tankfrce4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Tank Force (Japan) - -static struct BurnRomInfo tankfrcejRomDesc[] = { - { "tf1_snd0.bin", 0x20000, 0x4d9cf7aa, 1 | BRF_PRG | BRF_ESS }, // 0 Sound m6809 Code - - { "tf1_prg0.bin", 0x20000, 0x2ae4b9eb, 2 | BRF_PRG | BRF_ESS }, // 1 Main and Sub m6809 Code - { "tf1_prg1.bin", 0x20000, 0x4a8bb251, 2 | BRF_PRG | BRF_ESS }, // 2 - { "tf1_prg7.bin", 0x20000, 0x9dfa0dd5, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "cus64-64a1.mcu", 0x01000, 0xffb5c0bd, 3 | BRF_PRG | BRF_ESS }, // 4 Internal MCU Code - - { "tf1_voi0.bin", 0x20000, 0xf542676a, 4 | BRF_PRG | BRF_ESS }, // 5 External MCU Code - { "tf1_voi1.bin", 0x20000, 0x615d09cd, 4 | BRF_PRG | BRF_ESS }, // 6 - - { "tf1_chr8.bin", 0x20000, 0x7d53b31e, 5 | BRF_GRA }, // 7 Character Pixel Masks - - { "tf1_chr0.bin", 0x20000, 0x9e91794e, 6 | BRF_GRA }, // 8 Characters - { "tf1_chr1.bin", 0x20000, 0x76e1bc56, 6 | BRF_GRA }, // 9 - { "tf1_chr2.bin", 0x20000, 0xfcb645d9, 6 | BRF_GRA }, // 10 - { "tf1_chr3.bin", 0x20000, 0xa8dbf080, 6 | BRF_GRA }, // 11 - { "tf1_chr4.bin", 0x20000, 0x51fedc8c, 6 | BRF_GRA }, // 12 - { "tf1_chr5.bin", 0x20000, 0xe6c6609a, 6 | BRF_GRA }, // 13 - - { "tf1_obj0.bin", 0x20000, 0x4bedd51a, 7 | BRF_GRA }, // 14 Sprites - { "tf1_obj1.bin", 0x20000, 0xdf674d6d, 7 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(tankfrcej) -STD_ROM_FN(tankfrcej) - -struct BurnDriver BurnDrvTankfrcej = { - "tankfrcej", "tankfrce", NULL, NULL, "1991", - "Tank Force (Japan)\0", NULL, "Namco", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, tankfrcejRomInfo, tankfrcejRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - TankfrceInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_namcos86.cpp b/jan/src/burn/drv/pre90s/d_namcos86.cpp deleted file mode 100644 index ebf8c9153..000000000 --- a/jan/src/burn/drv/pre90s/d_namcos86.cpp +++ /dev/null @@ -1,2314 +0,0 @@ -// FB Alpha Namco System 86 driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "m6800_intf.h" -#include "burn_ym2151.h" -#include "namco_snd.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvSubROM; -static UINT8 *DrvMCUROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvMCURAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 buffer_sprites; -static INT32 watchdog; -static INT32 watchdog1; -static INT32 backcolor; -static INT32 tilebank; -static INT32 flipscreen; -static UINT8 scroll[4][3]; -static UINT8 nBankData[2]; - -static INT32 gfxlen[3]; -static INT32 has_pcm = 0; -static INT32 enable_bankswitch2 = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -struct voice_63701x -{ - INT32 select; - INT32 playing; - INT32 base_addr; - INT32 position; - INT32 volume; - INT32 silence_counter; -}; - -struct voice_63701x m_voices[2]; - -static struct BurnInputInfo CommonInputList[] = { - {"P1 coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 7, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common) - -static struct BurnInputInfo HopmappyInputList[] = { - {"P1 coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 7, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Hopmappy) - -static struct BurnInputInfo RoishtarInputList[] = { - {"Coin A", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"Coin B", BIT_DIGITAL, DrvJoy2 + 5, "p2 coin" }, - {"Start 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start" }, - - {"P1 Left Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Left Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left Left", BIT_DIGITAL, DrvJoy3 + 4, "p1 left" }, - {"P1 Left Right", BIT_DIGITAL, DrvJoy3 + 5, "p1 right" }, - {"P1 Right Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P1 Right Down", BIT_DIGITAL, DrvJoy1 + 3, "p2 down" }, - {"P1 Right Left", BIT_DIGITAL, DrvJoy3 + 7, "p2 left" }, - {"P1 Right Right", BIT_DIGITAL, DrvJoy1 + 4, "p2 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Roishtar) - -static struct BurnDIPInfo SkykiddxDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Level Select (Cheat)" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x60, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x20, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x60, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x60, 0x40, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x00, "20000 Every 80000" }, - {0x13, 0x01, 0x30, 0x10, "20000 80000" }, - {0x13, 0x01, 0x30, 0x20, "30000 Every 90000" }, - {0x13, 0x01, 0x30, 0x30, "30000 90000" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0xc0, 0x80, "1" }, - {0x13, 0x01, 0xc0, 0x40, "2" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Skykiddx) - -static struct BurnDIPInfo HopmappyDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0x03, 0x00, "3 Coins / 1 Credit" }, - {0x10, 0x01, 0x03, 0x01, "2 Coins / 1 Credit" }, - {0x10, 0x01, 0x03, 0x03, "1 Coin / 1 Credit" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x10, 0x01, 0x04, 0x00, "No" }, - {0x10, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x18, 0x10, "1" }, - {0x10, 0x01, 0x18, 0x08, "2" }, - {0x10, 0x01, 0x18, 0x18, "3" }, - {0x10, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x10, 0x01, 0x60, 0x00, "3C 1C" }, - {0x10, 0x01, 0x60, 0x20, "2C 1C" }, - {0x10, 0x01, 0x60, 0x60, "1C 1C" }, - {0x10, 0x01, 0x60, 0x40, "1C 2C" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x01, 0x01, "Upright" }, - {0x11, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Level Select (Cheat)" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x80, 0x80, "Easy" }, - {0x11, 0x01, 0x80, 0x00, "Hard" }, -}; - -STDDIPINFO(Hopmappy) - -static struct BurnDIPInfo GenpeitdDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x08, 0x00, "No" }, - {0x12, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x60, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x20, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x60, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x60, 0x40, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x20, "Easy" }, - {0x13, 0x01, 0x30, 0x30, "Normal" }, - {0x13, 0x01, 0x30, 0x10, "Hard" }, - {0x13, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Candle" }, - {0x13, 0x01, 0xc0, 0x80, "40" }, - {0x13, 0x01, 0xc0, 0xc0, "50" }, - {0x13, 0x01, 0xc0, 0x40, "60" }, - {0x13, 0x01, 0xc0, 0x00, "70" }, -}; - -STDDIPINFO(Genpeitd) - -static struct BurnDIPInfo RthunderDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xd5, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x60, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x20, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x60, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x60, 0x40, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x13, 0x01, 0x01, 0x00, "3" }, - {0x13, 0x01, 0x01, 0x01, "6" }, - - {0 , 0xfe, 0 , 4, "Cabinet" }, - {0x13, 0x01, 0x06, 0x06, "Upright 1 Player" }, - {0x13, 0x01, 0x06, 0x02, "Upright 1 Player" }, - {0x13, 0x01, 0x06, 0x04, "Upright 2 Players" }, - {0x13, 0x01, 0x06, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Level Select (Cheat)" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x10, 0x10, "Normal" }, - {0x13, 0x01, 0x10, 0x00, "Easy" }, - - {0 , 0xfe, 0 , 2, "Timer value" }, - {0x13, 0x01, 0x20, 0x20, "120 secs" }, - {0x13, 0x01, 0x20, 0x00, "150 secs" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x13, 0x01, 0x40, 0x40, "70k, 200k" }, - {0x13, 0x01, 0x40, 0x00, "100k, 300k" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x80, 0x80, "3" }, - {0x13, 0x01, 0x80, 0x00, "5" }, -}; - -STDDIPINFO(Rthunder) - -static struct BurnDIPInfo Rthunder1DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x60, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x20, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x60, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x60, 0x40, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 4, "Cabinet" }, - {0x13, 0x01, 0x06, 0x00, "Upright 1 Player" }, - {0x13, 0x01, 0x06, 0x04, "Upright 2 Players" }, - {0x13, 0x01, 0x06, 0x06, "Cocktail" }, - {0x13, 0x01, 0x06, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Level Select (Cheat)" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0xc0, 0x80, "1" }, - {0x13, 0x01, 0xc0, 0x40, "2" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Rthunder1) - -static struct BurnDIPInfo WndrmomoDIPList[]= -{ - {0x12, 0xff, 0xff, 0xfd, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x60, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x20, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x60, 0x60, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x60, 0x40, "1 Coin / 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Cabinet" }, - {0x13, 0x01, 0x06, 0x02, "Upright 1 Player" }, - {0x13, 0x01, 0x06, 0x04, "Upright 2 Players" }, - {0x13, 0x01, 0x06, 0x06, "Cocktail" }, - {0x13, 0x01, 0x06, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Wndrmomo) - -static struct BurnDIPInfo RoishtarDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x00, "3 Coins / 1 Credit" }, - {0x11, 0x01, 0x07, 0x02, "2 Coins / 1 Credit" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin / 1 Credit" }, - {0x11, 0x01, 0x07, 0x01, "2 Coins / 3 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin / 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin / 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin / 5 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin / 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins / 1 Credit" }, - {0x12, 0x01, 0x07, 0x02, "2 Coins / 1 Credit" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin / 1 Credit" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins / 3 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin / 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin / 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin / 5 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin / 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Roishtar) - -static INT32 tile_xoffset[4] = { 4, 2, 5, 3 }; - -static void set_tile_offsets(INT32 a, INT32 b, INT32 c, INT32 d) -{ - tile_xoffset[0] = a; tile_xoffset[1] = b; - tile_xoffset[2] = c; tile_xoffset[3] = d; -} - -static void namco_63701x_write(INT32 offset, UINT8 data) -{ - offset &= 3; - - int ch = offset / 2; - - if (offset & 1) - m_voices[ch].select = data; - else - { - if (m_voices[ch].select & 0x1f) - { - m_voices[ch].playing = 1; - m_voices[ch].base_addr = 0x10000 * ((m_voices[ch].select & 0xe0) >> 5); - INT32 rom_offs = m_voices[ch].base_addr + 2 * ((m_voices[ch].select & 0x1f) - 1); - m_voices[ch].position = (DrvSndROM[rom_offs] << 8) + DrvSndROM[rom_offs+1]; - m_voices[ch].volume = data >> 6; - m_voices[ch].silence_counter = 0; - } - } -} - -static void namco_63701x_update(INT16 *outputs, INT32 samples) -{ - static const INT32 vol_table[4] = { 26, 84, 200, 258 }; - - INT16 t_samples[100]; - - memset (t_samples, 0, sizeof(t_samples)); - - for (INT32 ch = 0; ch < 2; ch++) - { - INT16 *buf = t_samples; - voice_63701x *v = &m_voices[ch]; - - if (v->playing) - { - UINT8 *base = DrvSndROM + v->base_addr; - INT32 pos = v->position; - INT32 vol = vol_table[v->volume]; - - for (INT32 p = 0; p < 100; p++) - { - if (v->silence_counter) - { - v->silence_counter--; - buf++; - } - else - { - INT32 data = base[(pos++) & 0xffff]; - - if (data == 0xff) // end of sample - { - v->playing = 0; - break; - } - else if (data == 0x00) // silence compression - { - data = base[(pos++) & 0xffff]; - v->silence_counter = data; - buf++; - } - else - { - *(buf++) += (vol * (data - 0x80)); - } - } - } - - v->position = pos; - } - } - - INT16 *buffer = outputs; - - for (INT32 i = 0; i < samples; i++) { - INT32 offset = (i * 100) / nBurnSoundLen; - if (offset > 99) offset = 99; // safe - buffer[0] += t_samples[offset]; - buffer[1] += t_samples[offset]; - buffer += 2; - } - -} - -static UINT8 namcos86_cpu0_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x4000) { - return namcos1_custom30_read(address & 0x3ff); - } - - return 0; -} - -static void bankswitch1(INT32 data) -{ - if (!has_pcm) data &= 0x03; - - nBankData[0] = data & 0x1f; - - M6809MapMemory(DrvMainROM + 0x10000 + nBankData[0] * 0x2000, 0x6000, 0x7fff, MAP_ROM); -} - -static void namcos86_cpu0_write(UINT16 address, UINT8 data) -{ - if ((address & 0xe000) == 0x4000) { - if (address < 0x4400) { - namcos1_custom30_write(address & 0x3ff, data); - } else { - DrvSprRAM[address & 0x1fff] = data; - } - - if (address == 0x5ff2) { - buffer_sprites = 1; - } - - return; - } - - if ((address & 0xf800) == 0x8800) { - tilebank = (address >> 10) & 1; - return; - } - - if ((address & 0xe000) == 0x6000 && has_pcm) - { - switch ((address & 0x1e00) >> 9) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - namco_63701x_write((address & 0x1e00) >> 9, data); - return; - - case 0x04: - bankswitch1(data); - return; - } - } - - switch (address) - { - case 0x8000: - watchdog1 |= 1; - if (watchdog1 == 3) { - watchdog1 = 0; - watchdog = 0; - } - return; - - case 0x8400: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0x9000: - case 0x9001: - case 0x9002: - scroll[0][address & 3] = data; - return; - - case 0x9003: - if (has_pcm == 0) bankswitch1(data); - return; - - case 0x9004: - case 0x9005: - case 0x9006: - scroll[1][address & 3] = data; - return; - - case 0x9400: - case 0x9401: - case 0x9402: - scroll[2][address & 3] = data; - return; - - case 0x9404: - case 0x9405: - case 0x9406: - scroll[3][address & 3] = data; - return; - - case 0xa000: - backcolor = data; - return; - } -} - -static void hopmappy_cpu1_write(UINT16 address, UINT8 /*data*/) -{ - switch (address) - { - case 0x9000: - watchdog1 |= 2; - if (watchdog1 == 3) { - watchdog1 = 0; - watchdog = 0; - } - return; - - case 0x9400: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static void roishtar_cpu1_write(UINT16 address, UINT8 data) -{ - if ((address & 0xe000) == 0x0000) { - DrvSprRAM[address & 0x1fff] = data; - - if (address == 0x1ff2) { - buffer_sprites = 1; - } - - return; - } - - switch (address) - { - case 0xa000: - watchdog1 |= 2; - if (watchdog1 == 3) { - watchdog1 = 0; - watchdog = 0; - } - return; - - case 0xb000: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static void bankswitch2(INT32 data) -{ - nBankData[1] = data & 0x03; - M6809MapMemory(DrvSubROM + nBankData[1] * 0x2000, 0x6000, 0x7fff, MAP_ROM); -} - -static void rthunder_cpu1_write(UINT16 address, UINT8 data) -{ - if ((address & 0xe000) == 0x0000) { - DrvSprRAM[address & 0x1fff] = data; - - if (address == 0x1ff2) { - buffer_sprites = 1; - } - - return; - } - - switch (address) - { - case 0x8000: - watchdog1 |= 2; - if (watchdog1 == 3) { - watchdog1 = 0; - watchdog = 0; - } - return; - - case 0x8800: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0xd803: - bankswitch2(data); - return; - } -} - -static void genpeitd_cpu1_write(UINT16 address, UINT8 data) -{ - if ((address & 0xe000) == 0x4000) { - DrvSprRAM[address & 0x1fff] = data; - - if (address == 0x5ff2) { - buffer_sprites = 1; - } - - return; - } - - switch (address) - { - case 0xb000: - watchdog1 |= 2; - if (watchdog1 == 3) { - watchdog1 = 0; - watchdog = 0; - } - return; - - case 0x8800: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static void wndrmomo_cpu1_write(UINT16 address, UINT8 data) -{ - if ((address & 0xe000) == 0x2000) { - DrvSprRAM[address & 0x1fff] = data; - - if (address == 0x3ff2) { - buffer_sprites = 1; - } - - return; - } - - switch (address) - { - case 0xc000: - watchdog1 |= 2; - if (watchdog1 == 3) { - watchdog1 = 0; - watchdog = 0; - } - return; - - case 0xc800: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static inline UINT8 dip0_read() -{ - int rhi, rlo; - - rhi = ( DrvDips[0] & 0x01 ) << 4; - rhi |= ( DrvDips[0] & 0x04 ) << 3; - rhi |= ( DrvDips[0] & 0x10 ) << 2; - rhi |= ( DrvDips[0] & 0x40 ) << 1; - - rlo = ( DrvDips[1] & 0x01 ) >> 0; - rlo |= ( DrvDips[1] & 0x04 ) >> 1; - rlo |= ( DrvDips[1] & 0x10 ) >> 2; - rlo |= ( DrvDips[1] & 0x40 ) >> 3; - - return rhi | rlo; -} - -static inline UINT8 dip1_read() -{ - int rhi, rlo; - - rhi = ( DrvDips[0] & 0x02 ) << 3; - rhi |= ( DrvDips[0] & 0x08 ) << 2; - rhi |= ( DrvDips[0] & 0x20 ) << 1; - rhi |= ( DrvDips[0] & 0x80 ) << 0; - - rlo = ( DrvDips[1] & 0x02 ) >> 1; - rlo |= ( DrvDips[1] & 0x08 ) >> 2; - rlo |= ( DrvDips[1] & 0x20 ) >> 3; - rlo |= ( DrvDips[1] & 0x80 ) >> 4; - - return rhi | rlo; -} - -static void namcos86_mcu_write(UINT16 address, UINT8 data) -{ - if ((address & 0xffe0) == 0x0000) { - m6803_internal_registers_w(address & 0x001f, data); - return; - } - - if ((address & 0xff80) == 0x0080) { - DrvMCURAM[0x2000 + (address & 0x7f)] = data; - return; - } - - if ((address & 0xfc00) == 0x1000) { - namcos1_custom30_write(address & 0x3ff, data); - return; - } - - switch (address) - { - case 0x2000: - case 0x2800: - case 0x3800: - case 0x6000: - BurnYM2151SelectRegister(data); - return; - - case 0x2001: - case 0x2801: - case 0x3801: - case 0x6001: - BurnYM2151WriteRegister(data); - return; - - case 0x8000: - case 0xa000: - case 0xb000: - case 0xc000: - case 0x8800: - case 0x9800: - case 0xa800: - case 0xb800: - case 0xc800: - return; - } -} - -static UINT8 namcos86_mcu_read(UINT16 address) -{ - if ((address & 0xffe0) == 0x0000) { - return m6803_internal_registers_r(address & 0x001f); - } - - if ((address & 0xff80) == 0x0080) { - return DrvMCURAM[0x2000 + (address & 0x7f)]; - } - - if ((address & 0xfc00) == 0x1000) { - return namcos1_custom30_read(address & 0x3ff); - } - - switch (address) - { - case 0x2000: - case 0x2800: - case 0x3800: - case 0x6000: - case 0x2001: - case 0x2801: - case 0x3801: - case 0x6001: - return BurnYM2151ReadStatus(); - - case 0x2020: - case 0x2820: - case 0x3820: - case 0x6020: - return DrvInputs[0]; - - case 0x2021: - case 0x2821: - case 0x3821: - case 0x6021: - return DrvInputs[1]; - - case 0x2030: - case 0x2830: - case 0x3830: - case 0x6030: - return dip0_read(); - - case 0x2031: - case 0x2831: - case 0x3831: - case 0x6031: - return dip1_read(); - } - - return 0; -} - -static void namcos86_mcu_write_port(UINT16 port, UINT8 /*data*/) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: - // coin - return; - - case HD63701_PORT2: - // led - return; - } -} - -static UINT8 namcos86_mcu_read_port(UINT16 port) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: - return DrvInputs[2]; - - case HD63701_PORT2: - return 0xff; - } - - return 0; -} - -static tilemap_callback( layer0 ) -{ - INT32 attr = DrvVidRAM0[offs * 2 + 1]; - INT32 bank = ((DrvColPROM[0x1400 + ((attr & 0x03) << 2)] & 0x0e) >> 1) * 0x100 + tilebank * 0x800; - INT32 code = DrvVidRAM0[offs * 2 + 0] + bank; - - TILE_SET_INFO(0, code, attr, 0); -} - -static tilemap_callback( layer1 ) -{ - INT32 attr = DrvVidRAM0[0x1000 + offs * 2 + 1]; - INT32 bank = ((DrvColPROM[0x1410 + ((attr & 0x03) << 2)] & 0x0e) >> 1) * 0x100 + tilebank * 0x800; - INT32 code = DrvVidRAM0[0x1000 + offs * 2 + 0] + bank; - - TILE_SET_INFO(0, code, attr, 0); -} - -static tilemap_callback( layer2 ) -{ - INT32 attr = DrvVidRAM1[offs * 2 + 1]; - INT32 bank = ((DrvColPROM[0x1400 + ((attr & 0x03) << 0)] & 0xe0) >> 5) * 0x100; - INT32 code = DrvVidRAM1[offs * 2 + 0] + bank; - - TILE_SET_INFO(1, code, attr, 0); -} - -static tilemap_callback( layer3 ) -{ - INT32 attr = DrvVidRAM1[0x1000 + offs * 2 + 1]; - INT32 bank = ((DrvColPROM[0x1410 + ((attr & 0x03) << 0)] & 0xe0) >> 5) * 0x100; - INT32 code = DrvVidRAM1[0x1000 + offs * 2 + 0] + bank; - - TILE_SET_INFO(1, code, attr, 0); -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - M6809Open(1); - M6809Reset(); - M6809Close(); - -// HD63701Open(0); - HD63701Reset(); -// HD63701Close(); - - BurnYM2151Reset(); - - buffer_sprites = 0; - watchdog = 0; - watchdog1 = 0; - backcolor = 0; - tilebank = 0; - memset (scroll, 0, sizeof(scroll)); - memset (nBankData, 0, sizeof(nBankData)); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x050000; - DrvSubROM = Next; Next += 0x010000; - DrvMCUROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x200000; - - DrvSndROM = Next; Next += 0x080000; - - DrvColPROM = Next; Next += 0x001420; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x002000; - DrvVidRAM0 = Next; Next += 0x002000; - DrvVidRAM1 = Next; Next += 0x002000; - DrvMCURAM = Next; Next += 0x002080; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxShuffle(UINT8 *gfx, INT32 romsize) -{ - INT32 size = romsize * 2 / 3; - - UINT8 *dest1 = gfx; - UINT8 *dest2 = gfx + (size / 2); - UINT8 *mono = gfx + size; - UINT8 *buf = (UINT8*)BurnMalloc(romsize); - - memcpy (buf, gfx, size); - - for (INT32 i = 0; i < size; i += 2) - { - UINT8 data1 = buf[i]; - UINT8 data2 = buf[i+1]; - *dest1++ = (data1 << 4) | (data2 & 0xf); - *dest2++ = (data1 & 0xf0) | (data2 >> 4); - - *mono ^= 0xff; mono++; - } - - BurnFree(buf); -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { (gfxlen[0] / 3) * 8 * 2, (gfxlen[0] / 3) * 8 * 1, (gfxlen[0] / 3) * 8 * 0 }; - INT32 Plane1[3] = { (gfxlen[1] / 3) * 8 * 2, (gfxlen[1] / 3) * 8 * 1, (gfxlen[1] / 3) * 8 * 0 }; - INT32 XOffs0[8] = { STEP8(0,1) }; - INT32 YOffs0[8] = { STEP8(0,8) }; - - INT32 Plane2[4] = { STEP4(0,1) }; - INT32 XOffs1[32] = { STEP16(0,4), STEP16(1024, 4) }; - INT32 YOffs1[32] = { STEP16(0,64), STEP16(2048, 64) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(gfxlen[2]); - if (tmp == NULL) { - return 1; - } - - DrvGfxShuffle(DrvGfxROM0, gfxlen[0]); - DrvGfxShuffle(DrvGfxROM1, gfxlen[1]); - - memcpy (tmp, DrvGfxROM0, gfxlen[0]); - - GfxDecode(((gfxlen[0] * 8) / 3) / 0x040, 3, 8, 8, Plane0, XOffs0, YOffs0, 0x0040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, gfxlen[1]); - - GfxDecode(((gfxlen[1] * 8) / 3) / 0x040, 3, 8, 8, Plane1, XOffs0, YOffs0, 0x0040, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, gfxlen[2]); - - GfxDecode(((gfxlen[2] * 8) / 4) / 0x400, 4, 32, 32, Plane2, XOffs1, YOffs1, 0x1000, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pens[512]; - - for (INT32 i = 0; i < 512; i++) - { - INT32 bit0 = (DrvColPROM[i+0] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i+0] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i+0] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i+0] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i+0] >> 4) & 0x01; - bit1 = (DrvColPROM[i+0] >> 5) & 0x01; - bit2 = (DrvColPROM[i+0] >> 6) & 0x01; - bit3 = (DrvColPROM[i+0] >> 7) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i+512] >> 0) & 0x01; - bit1 = (DrvColPROM[i+512] >> 1) & 0x01; - bit2 = (DrvColPROM[i+512] >> 2) & 0x01; - bit3 = (DrvColPROM[i+512] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - pens[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 2048; i++) { - DrvPalette[0x000 + i] = pens[DrvColPROM[0x400 + i] | 0x000]; - DrvPalette[0x800 + i] = pens[DrvColPROM[0xc00 + i] | 0x100]; - } -} - -static INT32 DrvROMload() -{ - char* pRomName; - struct BurnRomInfo ri; - INT32 pSize = 0; - INT32 genpeitd = 0; - - UINT8 *pLoad[4] = { DrvMainROM + 0x8000, DrvSubROM, DrvMCUROM + 0x8000, DrvMainROM + 0x10000 }; - UINT8 *gLoad[4] = { DrvGfxROM0, DrvGfxROM1, DrvGfxROM2, DrvColPROM }; - UINT8 *sLoad = DrvSndROM; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - BurnDrvGetRomInfo(&ri, i); - INT32 nType = ri.nType & 0xf; - - if (nType == 1) { - if (BurnLoadRom(pLoad[0], i, 1)) return 1; - pLoad[0] += ri.nLen; - continue; - } - - if (nType == 2) { - if (ri.nLen == 0x4000) pLoad[1] = DrvSubROM + 0xc000; - if (BurnLoadRom(pLoad[1], i, 1)) return 1; - if ((pLoad[1] - DrvSubROM) == 0) memcpy (DrvSubROM + 0x8000, DrvSubROM, 0x8000); // rthunder - pLoad[1] += ri.nLen; - continue; - } - - if (nType == 7) { - if (ri.nLen == 0x1000) pLoad[2] = DrvMCUROM + 0xf000; // internal rom - if (ri.nLen == 0x8000) pLoad[2] = DrvMCUROM + 0x4000; - if (BurnLoadRom(pLoad[2], i, 1)) return 1; - pLoad[2] += ri.nLen; - continue; - } - - if (nType == 8) { - if (ri.nLen == 0x2000) pLoad[3] += 0x4000; // roishtar - if (BurnLoadRom(pLoad[3], i, 1)) return 1; - pLoad[3] += ri.nLen; - continue; - } - - if (nType > 2 && nType <= 6) { - if (BurnLoadRom(gLoad[nType - 3], i, 1)) return 1; - - if (nType == 5 && ((pSize == 0x20000 && ri.nLen == 0x10000) || genpeitd)) { - gLoad[nType - 3] += 0x20000; // genpeitd - genpeitd = 1; - } else { - gLoad[nType - 3] += ri.nLen; - } - - pSize = ri.nLen; - - continue; - } - - if (nType == 9) { - if (BurnLoadRom(sLoad, i, 1)) return 1; - sLoad += 0x20000; - - continue; - } - } - - memcpy (DrvMCUROM, DrvMCUROM + 0x4000, 0x4000); // mirror - - gfxlen[0] = gLoad[0] - DrvGfxROM0; - gfxlen[1] = gLoad[1] - DrvGfxROM1; - gfxlen[2] = gLoad[2] - DrvGfxROM2; - - if (gfxlen[0] < 0x06000) gfxlen[0] = 0x06000; - if (gfxlen[1] < 0x06000) gfxlen[1] = 0x06000; - if (gfxlen[2] < 0x40000) gfxlen[2] = 0x40000; - - return 0; -} - -static INT32 CommonInit(INT32 nSubCPUConfig, INT32 pcmdata) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (DrvROMload()) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvVidRAM0, 0x0000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x2000, 0x3fff, MAP_RAM); -// M6809MapMemory(DrvSprRAM + 0x0000, 0x4000, 0x43ff, MAP_RAM); - M6809MapMemory(DrvSprRAM + 0x0400, 0x4400, 0x5fff, MAP_ROM); -// M6809MapMemory(DrvMainROM + 0x0000, 0x6000, 0x7fff, MAP_ROM); // bank1 - M6809MapMemory(DrvMainROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6809SetReadHandler(namcos86_cpu0_read); - M6809SetWriteHandler(namcos86_cpu0_write); - M6809Close(); - - HD63701Init(1); -// HD63701Open(0); -// HD63701MapMemory(DrvMCURAM + 0x0000, 0x1000, 0x13ff, MAP_RAM); - HD63701MapMemory(DrvMCURAM + 0x0400, 0x1400, 0x1fff, MAP_RAM); - HD63701MapMemory(DrvMCUROM + 0x8000, 0x8000, 0xffff, MAP_ROM); -// HD63701SetReadOpHandler(namcos86_mcu_read); -// HD63701SetReadOpArgHandler(namcos86_mcu_read); - HD63701SetReadHandler(namcos86_mcu_read); - HD63701SetWriteHandler(namcos86_mcu_write); - HD63701SetWritePortHandler(namcos86_mcu_write_port); - HD63701SetReadPortHandler(namcos86_mcu_read_port); -// HD63701Close(); - - set_tile_offsets(4, 2, 5, 3); // rthunder - - switch (nSubCPUConfig) - { - case 0: // hopmappy / skykid - { - M6809Open(1); - M6809MapMemory(DrvSubROM + 0x0000, 0x0000, 0xffff, MAP_ROM); - M6809SetWriteHandler(hopmappy_cpu1_write); - M6809Close(); - - if (strstr(BurnDrvGetTextA(DRV_NAME), "skykid")) - set_tile_offsets(-3, -2, 5, 3); // skykid - } - break; - - case 1: // roishtar - { - M6809Open(1); - M6809MapMemory(DrvSprRAM + 0x0000, 0x0000, 0x1eff, MAP_RAM); - M6809MapMemory(DrvSprRAM + 0x1f00, 0x1f00, 0x1fff, MAP_ROM); - M6809MapMemory(DrvVidRAM1, 0x4000, 0x5fff, MAP_RAM); - M6809MapMemory(DrvVidRAM0, 0x6000, 0x7fff, MAP_RAM); - M6809MapMemory(DrvSubROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(roishtar_cpu1_write); - M6809Close(); - - // HD6370Open(0); - HD63701MapMemory(DrvMCUROM + 0x2000, 0x2000, 0x3fff, MAP_ROM); - // HD63701Close(); - } - break; - - case 2: // genpeitd - { - M6809Open(1); - M6809MapMemory(DrvVidRAM0, 0x0000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x2000, 0x3fff, MAP_RAM); - M6809MapMemory(DrvSprRAM + 0x0000, 0x4000, 0x5eff, MAP_RAM); - M6809MapMemory(DrvSprRAM + 0x1f00, 0x5f00, 0x5fff, MAP_ROM); - M6809MapMemory(DrvSubROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(genpeitd_cpu1_write); - M6809Close(); - - // HD6370Open(0); - HD63701MapMemory(DrvMCUROM + 0x4000, 0x4000, 0x7fff, MAP_ROM); - // HD63701Close(); - } - break; - - case 3: // rthunder - { - M6809Open(1); - M6809MapMemory(DrvSprRAM + 0x0000, 0x0000, 0x1eff, MAP_RAM); - M6809MapMemory(DrvSprRAM + 0x1f00, 0x1f00, 0x1fff, MAP_ROM); - M6809MapMemory(DrvVidRAM0, 0x2000, 0x3fff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x4000, 0x5fff, MAP_RAM); - M6809MapMemory(DrvSubROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(rthunder_cpu1_write); - M6809Close(); - - // HD6370Open(0); - HD63701MapMemory(DrvMCUROM + 0x4000, 0x4000, 0x7fff, MAP_ROM); - // HD63701Close(); - } - break; - - case 4: // wndrmomo - { - M6809Open(1); - M6809MapMemory(DrvSprRAM + 0x0000, 0x2000, 0x3eff, MAP_RAM); - M6809MapMemory(DrvSprRAM + 0x1f00, 0x3f00, 0x3fff, MAP_ROM); - M6809MapMemory(DrvVidRAM0, 0x4000, 0x5fff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x6000, 0x7fff, MAP_RAM); - M6809MapMemory(DrvSubROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(wndrmomo_cpu1_write); - M6809Close(); - - // HD6370Open(0); - HD63701MapMemory(DrvMCUROM + 0x4000, 0x4000, 0x7fff, MAP_ROM); - // HD63701Close(); - } - break; - } - - BurnYM2151Init(3579580); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.60, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.60, BURN_SND_ROUTE_RIGHT); - - NamcoSoundInit(24000, 8, 1); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - has_pcm = pcmdata; - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, layer0_map_callback, 8, 8, 64, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, layer1_map_callback, 8, 8, 64, 32); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, layer2_map_callback, 8, 8, 64, 32); - GenericTilemapInit(3, TILEMAP_SCAN_ROWS, layer3_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 3, 8, 8, (gfxlen[0]*8)/3, 0, 0xff); - GenericTilemapSetGfx(1, DrvGfxROM1, 3, 8, 8, (gfxlen[1]*8)/3, 0, 0xff); - GenericTilemapSetOffsets(TMAP_GLOBAL, -16, -25); - GenericTilemapSetTransparent(0, 0x07); - GenericTilemapSetTransparent(1, 0x07); - GenericTilemapSetTransparent(2, 0x07); - GenericTilemapSetTransparent(3, 0x07); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - HD63701Exit(); - - NamcoSoundExit(); - NamcoSoundProm = NULL; - - BurnYM2151Exit(); - - BurnFree(AllMem); - - has_pcm = 0; - enable_bankswitch2 = 0; - - return 0; -} - -static void draw_sprites() -{ - UINT8 *m_spriteram = DrvSprRAM + 0x1800; - const UINT8 *source = &m_spriteram[0x800-0x20]; - const UINT8 *finish = &m_spriteram[0]; - - INT32 sprite_xoffs = m_spriteram[0x07f5] + ((m_spriteram[0x07f4] & 1) << 8); - INT32 sprite_yoffs = m_spriteram[0x07f7]; - - INT32 gfxmask = ((gfxlen[2] * 8) / 4) / (32 * 32); - INT32 bank_sprites = gfxmask / 8; - - while (source >= finish) - { - static const INT32 sprite_size[4] = { 16, 8, 32, 4 }; - INT32 attr1 = source[10]; - INT32 attr2 = source[14]; - INT32 color = source[12]; - INT32 flipx = (attr1 & 0x20) >> 5; - INT32 flipy = (attr2 & 0x01); - INT32 sizex = sprite_size[(attr1 & 0xc0) >> 6]; - INT32 sizey = sprite_size[(attr2 & 0x06) >> 1]; - INT32 tx = (attr1 & 0x18) & (~(sizex-1)); - INT32 ty = (attr2 & 0x18) & (~(sizey-1)); - INT32 sx = source[13] + ((color & 0x01) << 8); - INT32 sy = -source[15] - sizey; - INT32 sprite = source[11]; - INT32 sprite_bank = attr1 & 7; - INT32 priority = (source[14] & 0xe0) >> 5; - UINT32 pri_mask = (0xff << (priority + 1)) & 0xff; - - pri_mask |= 1 << 31; - - sprite &= bank_sprites-1; - sprite += sprite_bank * bank_sprites; - sprite &= gfxmask - 1; - - color = color >> 1; - - sx += sprite_xoffs; - sy -= sprite_yoffs; - - if (flipscreen) - { - sx = -sx - sizex; - sy = -sy - sizey; - flipx ^= 1; - flipy ^= 1; - } - - { - sx &= 0x1ff; - sy = ((sy + 16) & 0xff) - 16; - - sy -= 15; - sx -= 67; - - UINT8 *gfxbase = DrvGfxROM2 + (sprite * 0x400); - - color = (color * 16) + 0x800; - - for (INT32 y = 0; y < sizey; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < sizex; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 xx = x; - INT32 yy = y; - - if (flipx) xx = (sizex - 1) - x; - if (flipy) yy = (sizey - 1) - y; - - INT32 pxl = gfxbase[xx + tx + ((yy + ty) * 32)]; - - if (pxl != 0x0f) { - if ((pri_mask & (1 << (pPrioDraw[(sy * nScreenWidth) + sx] & 0x1f))) == 0) { - pTransDraw[(sy * nScreenWidth) + sx] = pxl + color; - pPrioDraw[(sy * nScreenWidth) + sx] = 0x1f; // or enemies in wonder momo show up through the audience... - } - } - } - - sx -= sizex; - } - } - - source -= 0x10; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - { - INT32 bgcolor = (backcolor << 3) | 7; - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = bgcolor; - } - } - - flipscreen = DrvSprRAM[0x1ff6] & 1; - - GenericTilemapSetFlip(TMAP_GLOBAL, (flipscreen) ? (TMAP_FLIPX | TMAP_FLIPY) : 0); - - for (INT32 i = 0; i < 4; i++) - { - if (flipscreen) - { - GenericTilemapSetScrollX(i, -((scroll[i][0] * 256) + scroll[i][1] - 192 - tile_xoffset[i])); - GenericTilemapSetScrollY(i, -scroll[i][2] - 1 - 16); - } - else - { - GenericTilemapSetScrollX(i, (scroll[i][0] * 256) + scroll[i][1] + tile_xoffset[i]); - GenericTilemapSetScrollY(i, scroll[i][2]); - } - } - - for (INT32 layer = 0; layer < 8; layer++) - { - for (INT32 i = 3; i >= 0; i--) - { - if (((scroll[i][0] & 0x0e) >> 1) == layer) { - if (nBurnLayer & (1 << i)) GenericTilemapDraw(i, pTransDraw, layer); - } - } - } - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - watchdog++; - if (watchdog >= 180) { - // bprintf (0, _T("Watchdog triggered!\n")); - DrvDoReset(0); - } - - M6809NewFrame(); - HD63701NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 800; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[3] = { 1536000 / 60, 1536000 / 60, 1536000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - nSegment = M6809TotalCycles(); - if (i == 725) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - - M6809Open(1); - nCyclesDone[1] += M6809Run(nSegment - M6809TotalCycles()); - if (i == 725) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6809Close(); - - nCyclesDone[2] += HD63701Run(nSegment - M6800TotalCycles()); - if (i == 725) HD63701SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if ((i % 8) == 7) { - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / (nInterleave / 8); - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - nSoundBufferPos += nSegment; - } - } - } - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - NamcoSoundUpdate(pBurnSoundOut, nBurnSoundLen); - - namco_63701x_update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - if (buffer_sprites) - { - for (INT32 i = 0x1800 ; i < 0x2000; i+= 0x10) { - for (INT32 j = 0x0A; j < 0x10; j++) { - DrvSprRAM[i + j] = DrvSprRAM[i + j - 6]; - } - } - - buffer_sprites = 0; - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - HD63701Scan(nAction); - - NamcoSoundScan(nAction, pnMin); - BurnYM2151Scan(nAction); - - SCAN_VAR(m_voices); - SCAN_VAR(buffer_sprites); - SCAN_VAR(watchdog1); - SCAN_VAR(backcolor); - SCAN_VAR(tilebank); - SCAN_VAR(scroll); - SCAN_VAR(nBankData); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch1(nBankData[0]); - M6809Close(); - - if (enable_bankswitch2) { - M6809Open(1); - bankswitch2(nBankData[1]); - M6809Close(); - } - } - - return 0; -} - - - -// Sky Kid Deluxe (set 1) - -static struct BurnRomInfo skykiddxRomDesc[] = { - { "sk3_1b.9c", 0x8000, 0x767b3514, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "sk3_3.12c", 0x8000, 0x6d1084c4, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - - { "sk3_9.7r", 0x8000, 0x48675b17, 3 | BRF_GRA }, // 2 Layer 0 & 1 Tiles - { "sk3_10.7s", 0x4000, 0x7418465a, 3 | BRF_GRA }, // 3 - - { "sk3_7.4r", 0x8000, 0x4036b735, 4 | BRF_GRA }, // 4 Layer 2 & 3 Tiles - { "sk3_8.4s", 0x4000, 0x044bfd21, 4 | BRF_GRA }, // 5 - - { "sk3_5.12h", 0x8000, 0x5c7d4399, 5 | BRF_GRA }, // 6 Sprites - { "sk3_6.12k", 0x8000, 0xc908a3b2, 5 | BRF_GRA }, // 7 - - { "sk3-1.3r", 0x0200, 0x9e81dedd, 6 | BRF_GRA }, // 8 Color Proms - { "sk3-2.3s", 0x0200, 0xcbfec4dd, 6 | BRF_GRA }, // 9 - { "sk3-3.4v", 0x0800, 0x81714109, 6 | BRF_GRA }, // 10 - { "sk3-4.5v", 0x0800, 0x1bf25acc, 6 | BRF_GRA }, // 11 - { "sk3-5.6u", 0x0020, 0xe4130804, 6 | BRF_GRA }, // 12 - - { "sk3_4.6b", 0x4000, 0xe6cae2d6, 7 | BRF_PRG | BRF_ESS }, // 13 HD63701 MCU Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 14 - - { "sk3_2.9d", 0x8000, 0x74b8f8e2, 8 | BRF_PRG | BRF_ESS }, // 15 M6809 #0 Bank Code -}; - -STD_ROM_PICK(skykiddx) -STD_ROM_FN(skykiddx) - -static INT32 SkykiddxInit() -{ - return CommonInit(0, 0); -} - -struct BurnDriver BurnDrvSkykiddx = { - "skykiddx", NULL, NULL, NULL, "1986", - "Sky Kid Deluxe (set 1)\0", NULL, "Namco", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, skykiddxRomInfo, skykiddxRomName, NULL, NULL, CommonInputInfo, SkykiddxDIPInfo, - SkykiddxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// Sky Kid Deluxe (set 2) - -static struct BurnRomInfo skykiddxoRomDesc[] = { - { "sk3_1.9c", 0x8000, 0x5722a291, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "sk3_3.12c", 0x8000, 0x6d1084c4, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - - { "sk3_9.7r", 0x8000, 0x48675b17, 3 | BRF_GRA }, // 2 Layer 0 & 1 Tiles - { "sk3_10.7s", 0x4000, 0x7418465a, 3 | BRF_GRA }, // 3 - - { "sk3_7.4r", 0x8000, 0x4036b735, 4 | BRF_GRA }, // 4 Layer 2 & 3 Tiles - { "sk3_8.4s", 0x4000, 0x044bfd21, 4 | BRF_GRA }, // 5 - - { "sk3_5.12h", 0x8000, 0x5c7d4399, 5 | BRF_GRA }, // 6 Sprites - { "sk3_6.12k", 0x8000, 0xc908a3b2, 5 | BRF_GRA }, // 7 - - { "sk3-1.3r", 0x0200, 0x9e81dedd, 6 | BRF_GRA }, // 8 Color Proms - { "sk3-2.3s", 0x0200, 0xcbfec4dd, 6 | BRF_GRA }, // 9 - { "sk3-3.4v", 0x0800, 0x81714109, 6 | BRF_GRA }, // 10 - { "sk3-4.5v", 0x0800, 0x1bf25acc, 6 | BRF_GRA }, // 11 - { "sk3-5.6u", 0x0020, 0xe4130804, 6 | BRF_GRA }, // 12 - - { "sk3_4.6b", 0x4000, 0xe6cae2d6, 7 | BRF_PRG | BRF_ESS }, // 13 HD63701 MCU Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 14 - - { "sk3_2.9d", 0x8000, 0x74b8f8e2, 8 | BRF_PRG | BRF_ESS }, // 15 M6809 #0 Bank Code -}; - -STD_ROM_PICK(skykiddxo) -STD_ROM_FN(skykiddxo) - -struct BurnDriver BurnDrvSkykiddxo = { - "skykiddxo", "skykiddx", NULL, NULL, "1986", - "Sky Kid Deluxe (set 2)\0", NULL, "Namco", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, skykiddxoRomInfo, skykiddxoRomName, NULL, NULL, CommonInputInfo, SkykiddxDIPInfo, - SkykiddxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// Hopping Mappy - -static struct BurnRomInfo hopmappyRomDesc[] = { - { "hm1_1.9c", 0x8000, 0x1a83914e, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "hm1_2.12c", 0x4000, 0xc46cda65, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - - { "hm1_6.7r", 0x4000, 0xfd0e8887, 3 | BRF_GRA }, // 2 Layer 0 & 1 Tiles - - { "hm1_5.4r", 0x4000, 0x9c4f31ae, 4 | BRF_GRA }, // 3 Layer 2 & 3 Tiles - - { "hm1_4.12h", 0x8000, 0x78719c52, 5 | BRF_GRA }, // 4 Sprites - - { "hm1-1.3r", 0x0200, 0xcc801088, 6 | BRF_GRA }, // 5 Color Proms - { "hm1-2.3s", 0x0200, 0xa1cb71c5, 6 | BRF_GRA }, // 6 - { "hm1-3.4v", 0x0800, 0xe362d613, 6 | BRF_GRA }, // 7 - { "hm1-4.5v", 0x0800, 0x678252b4, 6 | BRF_GRA }, // 8 - { "hm1-5.6u", 0x0020, 0x475bf500, 6 | BRF_GRA }, // 9 - - { "hm1_3.6b", 0x2000, 0x6496e1db, 7 | BRF_PRG | BRF_ESS }, // 10 HD63701 MCU Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 11 -}; - -STD_ROM_PICK(hopmappy) -STD_ROM_FN(hopmappy) - -static INT32 HopmappyInit() -{ - return CommonInit(0, 0); -} - -struct BurnDriver BurnDrvHopmappy = { - "hopmappy", NULL, NULL, NULL, "1986", - "Hopping Mappy\0", NULL, "Namco", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, hopmappyRomInfo, hopmappyRomName, NULL, NULL, HopmappyInputInfo, HopmappyDIPInfo, - HopmappyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// The Return of Ishtar - -static struct BurnRomInfo roishtarRomDesc[] = { - { "ri1_1c.9c", 0x8000, 0x14acbacb, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "ri1_3.12c", 0x8000, 0xa39829f7, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - - { "ri1_14.7r", 0x4000, 0xde8154b4, 3 | BRF_GRA }, // 2 Layer 0 & 1 Tiles - { "ri1_15.7s", 0x2000, 0x4298822b, 3 | BRF_GRA }, // 3 - - { "ri1_12.4r", 0x4000, 0x557e54d3, 4 | BRF_GRA }, // 4 Layer 2 & 3 Tiles - { "ri1_13.4s", 0x2000, 0x9ebe8e32, 4 | BRF_GRA }, // 5 - - { "ri1_5.12h", 0x8000, 0x46b59239, 5 | BRF_GRA }, // 6 Sprites - { "ri1_6.12k", 0x8000, 0x94d9ef48, 5 | BRF_GRA }, // 7 - { "ri1_7.12l", 0x8000, 0xda802b59, 5 | BRF_GRA }, // 8 - { "ri1_8.12m", 0x8000, 0x16b88b74, 5 | BRF_GRA }, // 9 - { "ri1_9.12p", 0x8000, 0xf3de3c2a, 5 | BRF_GRA }, // 10 - { "ri1_10.12r", 0x8000, 0x6dacc70d, 5 | BRF_GRA }, // 11 - { "ri1_11.12t", 0x8000, 0xfb6bc533, 5 | BRF_GRA }, // 12 - - { "ri1-1.3r", 0x0200, 0x29cd0400, 6 | BRF_GRA }, // 13 Color Proms - { "ri1-2.3s", 0x0200, 0x02fd278d, 6 | BRF_GRA }, // 14 - { "ri1-3.4v", 0x0800, 0xcbd7e53f, 6 | BRF_GRA }, // 15 - { "ri1-4.5v", 0x0800, 0x22921617, 6 | BRF_GRA }, // 16 - { "ri1-5.6u", 0x0020, 0xe2188075, 6 | BRF_GRA }, // 17 - - { "ri1_4.6b", 0x8000, 0x552172b8, 7 | BRF_PRG | BRF_ESS }, // 18 HD63701 MCU Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 19 - - { "ri1_2.9d", 0x2000, 0xfcd58d91, 8 | BRF_PRG | BRF_ESS }, // 20 M6809 #0 Bank Code -}; - -STD_ROM_PICK(roishtar) -STD_ROM_FN(roishtar) - -static INT32 RoishtarInit() -{ - return CommonInit(1, 0); -} - -struct BurnDriver BurnDrvRoishtar = { - "roishtar", NULL, NULL, NULL, "1986", - "The Return of Ishtar\0", NULL, "Namco", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, roishtarRomInfo, roishtarRomName, NULL, NULL, RoishtarInputInfo, RoishtarDIPInfo, - RoishtarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// Genpei ToumaDen - -static struct BurnRomInfo genpeitdRomDesc[] = { - { "gt1_1b.9c", 0x08000, 0x75396194, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "gt1_2.12c", 0x04000, 0x302f2cb6, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - - { "gt1_7.7r", 0x10000, 0xea77a211, 3 | BRF_GRA }, // 2 Layer 0 & 1 Tiles - { "gt1_6.7s", 0x08000, 0x1b128a2e, 3 | BRF_GRA }, // 3 - - { "gt1_5.4r", 0x08000, 0x44d58b06, 4 | BRF_GRA }, // 4 Layer 2 & 3 Tiles - { "gt1_4.4s", 0x04000, 0xdb8d45b0, 4 | BRF_GRA }, // 5 - - { "gt1_11.12h", 0x20000, 0x3181a5fe, 5 | BRF_GRA }, // 6 Sprites - { "gt1_12.12k", 0x20000, 0x76b729ab, 5 | BRF_GRA }, // 7 - { "gt1_13.12l", 0x20000, 0xe332a36e, 5 | BRF_GRA }, // 8 - { "gt1_14.12m", 0x20000, 0xe5ffaef5, 5 | BRF_GRA }, // 9 - { "gt1_15.12p", 0x20000, 0x198b6878, 5 | BRF_GRA }, // 10 - { "gt1_16.12r", 0x20000, 0x801e29c7, 5 | BRF_GRA }, // 11 - { "gt1_8.12t", 0x10000, 0xad7bc770, 5 | BRF_GRA }, // 12 - { "gt1_9.12u", 0x10000, 0xd95a5fd7, 5 | BRF_GRA }, // 13 - - { "gt1-1.3r", 0x00200, 0x2f0ddddb, 6 | BRF_GRA }, // 14 Color Proms - { "gt1-2.3s", 0x00200, 0x87d27025, 6 | BRF_GRA }, // 15 - { "gt1-3.4v", 0x00800, 0xc178de99, 6 | BRF_GRA }, // 16 - { "gt1-4.5v", 0x00800, 0x9f48ef17, 6 | BRF_GRA }, // 17 - { "gt1-5.6u", 0x00020, 0xe4130804, 6 | BRF_GRA }, // 18 - - { "gt1_3.6b", 0x08000, 0x315cd988, 7 | BRF_PRG | BRF_ESS }, // 19 HD63701 MCU Code - { "cus60-60a1.mcu", 0x01000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 20 - - { "gt1_10b.f1", 0x10000, 0x5721ad0d, 8 | BRF_PRG | BRF_ESS }, // 21 M6809 #0 Bank Code - - { "gt1_17.f3", 0x20000, 0x26181ff8, 9 | BRF_SND }, // 22 Namco 63701x Samples - { "gt1_18.h3", 0x20000, 0x7ef9e5ea, 9 | BRF_SND }, // 23 - { "gt1_19.k3", 0x20000, 0x38e11f6c, 9 | BRF_SND }, // 24 -}; - -STD_ROM_PICK(genpeitd) -STD_ROM_FN(genpeitd) - -static INT32 GenpeitdInit() -{ - return CommonInit(2, 1); -} - -struct BurnDriver BurnDrvGenpeitd = { - "genpeitd", NULL, NULL, NULL, "1986", - "Genpei ToumaDen\0", NULL, "Namco", "System 86", - L"Genpei ToumaDen\0\u906E\u735E\u0E8A\u549B\u1D4F\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, genpeitdRomInfo, genpeitdRomName, NULL, NULL, CommonInputInfo, GenpeitdDIPInfo, - GenpeitdInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// Rolling Thunder (rev 3) - -static struct BurnRomInfo rthunderRomDesc[] = { - { "rt3_1b.9c", 0x08000, 0x7d252a1b, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "rt3_3.12d", 0x08000, 0xa13f601c, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - { "rt3_2b.12c", 0x08000, 0xa7ea46ee, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "rt1_7.7r", 0x10000, 0xa85efa39, 3 | BRF_GRA }, // 3 Layer 0 & 1 Tiles - { "rt1_8.7s", 0x08000, 0xf7a95820, 3 | BRF_GRA }, // 4 - - { "rt1_5.4r", 0x08000, 0xd0fc470b, 4 | BRF_GRA }, // 5 Layer 2 & 3 Tiles - { "rt1_6.4s", 0x04000, 0x6b57edb2, 4 | BRF_GRA }, // 6 - - { "rt1_9.12h", 0x10000, 0x8e070561, 5 | BRF_GRA }, // 7 Sprites - { "rt1_10.12k", 0x10000, 0xcb8fb607, 5 | BRF_GRA }, // 8 - { "rt1_11.12l", 0x10000, 0x2bdf5ed9, 5 | BRF_GRA }, // 9 - { "rt1_12.12m", 0x10000, 0xe6c6c7dc, 5 | BRF_GRA }, // 10 - { "rt1_13.12p", 0x10000, 0x489686d7, 5 | BRF_GRA }, // 11 - { "rt1_14.12r", 0x10000, 0x689e56a8, 5 | BRF_GRA }, // 12 - { "rt1_15.12t", 0x10000, 0x1d8bf2ca, 5 | BRF_GRA }, // 13 - { "rt1_16.12u", 0x10000, 0x1bbcf37b, 5 | BRF_GRA }, // 14 - - { "rt1-1.3r", 0x00200, 0x8ef3bb9d, 6 | BRF_GRA }, // 15 Color Proms - { "rt1-2.3s", 0x00200, 0x6510a8f2, 6 | BRF_GRA }, // 16 - { "rt1-3.4v", 0x00800, 0x95c7d944, 6 | BRF_GRA }, // 17 - { "rt1-4.5v", 0x00800, 0x1391fec9, 6 | BRF_GRA }, // 18 - { "rt1-5.6u", 0x00020, 0xe4130804, 6 | BRF_GRA }, // 19 - - { "rt3_4.6b", 0x08000, 0x00cf293f, 7 | BRF_PRG | BRF_ESS }, // 20 HD63701 MCU Code - { "cus60-60a1.mcu", 0x01000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 21 - - { "rt1_17.f1", 0x10000, 0x766af455, 8 | BRF_PRG | BRF_ESS }, // 22 M6809 #0 Bank Code - { "rt1_18.h1", 0x10000, 0x3f9f2f5d, 8 | BRF_PRG | BRF_ESS }, // 23 - { "rt3_19.k1", 0x10000, 0xc16675e9, 8 | BRF_PRG | BRF_ESS }, // 24 - { "rt3_20.m1", 0x10000, 0xc470681b, 8 | BRF_PRG | BRF_ESS }, // 25 - - { "rt1_21.f3", 0x10000, 0x454968f3, 9 | BRF_SND }, // 26 Namco 63701x Samples - { "rt2_22.h3", 0x10000, 0xfe963e72, 9 | BRF_SND }, // 27 -}; - -STD_ROM_PICK(rthunder) -STD_ROM_FN(rthunder) - -static INT32 RthunderInit() -{ - enable_bankswitch2 = 1; - - return CommonInit(3, 1); -} - -struct BurnDriver BurnDrvRthunder = { - "rthunder", NULL, NULL, NULL, "1986", - "Rolling Thunder (rev 3)\0", NULL, "Namco", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, rthunderRomInfo, rthunderRomName, NULL, NULL, CommonInputInfo, RthunderDIPInfo, - RthunderInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// Rolling Thunder (rev 3, hack) - -static struct BurnRomInfo rthunderaRomDesc[] = { - { "1.9c", 0x08000, 0x13c92678, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "rt3_3.12d", 0x08000, 0xa13f601c, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - { "rt3_2b.12c", 0x08000, 0xa7ea46ee, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "rt1_7.7r", 0x10000, 0xa85efa39, 3 | BRF_GRA }, // 3 Layer 0 & 1 Tiles - { "rt1_8.7s", 0x08000, 0xf7a95820, 3 | BRF_GRA }, // 4 - - { "rt1_5.4r", 0x08000, 0xd0fc470b, 4 | BRF_GRA }, // 5 Layer 2 & 3 Tiles - { "rt1_6.4s", 0x04000, 0x6b57edb2, 4 | BRF_GRA }, // 6 - - { "rt1_9.12h", 0x10000, 0x8e070561, 5 | BRF_GRA }, // 7 Sprites - { "rt1_10.12k", 0x10000, 0xcb8fb607, 5 | BRF_GRA }, // 8 - { "rt1_11.12l", 0x10000, 0x2bdf5ed9, 5 | BRF_GRA }, // 9 - { "rt1_12.12m", 0x10000, 0xe6c6c7dc, 5 | BRF_GRA }, // 10 - { "rt1_13.12p", 0x10000, 0x489686d7, 5 | BRF_GRA }, // 11 - { "rt1_14.12r", 0x10000, 0x689e56a8, 5 | BRF_GRA }, // 12 - { "rt1_15.12t", 0x10000, 0x1d8bf2ca, 5 | BRF_GRA }, // 13 - { "rt1_16.12u", 0x10000, 0x1bbcf37b, 5 | BRF_GRA }, // 14 - - { "rt1-1.3r", 0x00200, 0x8ef3bb9d, 6 | BRF_GRA }, // 15 Color Proms - { "rt1-2.3s", 0x00200, 0x6510a8f2, 6 | BRF_GRA }, // 16 - { "rt1-3.4v", 0x00800, 0x95c7d944, 6 | BRF_GRA }, // 17 - { "rt1-4.5v", 0x00800, 0x1391fec9, 6 | BRF_GRA }, // 18 - { "rt1-5.6u", 0x00020, 0xe4130804, 6 | BRF_GRA }, // 19 - - { "rt3_4.6b", 0x08000, 0x00cf293f, 7 | BRF_PRG | BRF_ESS }, // 20 HD63701 MCU Code - { "cus60-60a1.mcu", 0x01000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 21 - - { "rt1_17.f1", 0x10000, 0x766af455, 8 | BRF_PRG | BRF_ESS }, // 22 M6809 #0 Bank Code - { "rt1_18.h1", 0x10000, 0x3f9f2f5d, 8 | BRF_PRG | BRF_ESS }, // 23 - { "rt3_19.k1", 0x10000, 0xc16675e9, 8 | BRF_PRG | BRF_ESS }, // 24 - { "20.m1", 0x10000, 0x05d5db25, 8 | BRF_PRG | BRF_ESS }, // 25 - - { "rt1_21.f3", 0x10000, 0x454968f3, 9 | BRF_SND }, // 26 Namco 63701x Samples - { "rt2_22.h3", 0x10000, 0xfe963e72, 9 | BRF_SND }, // 27 -}; - -STD_ROM_PICK(rthundera) -STD_ROM_FN(rthundera) - -struct BurnDriver BurnDrvRthundera = { - "rthundera", "rthunder", NULL, NULL, "1986", - "Rolling Thunder (rev 3, hack)\0", NULL, "bootleg", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, rthunderaRomInfo, rthunderaRomName, NULL, NULL, CommonInputInfo, Rthunder1DIPInfo, - RthunderInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// Rolling Thunder (rev 2) - -static struct BurnRomInfo rthunder2RomDesc[] = { - { "rt2_1.9c", 0x08000, 0x7eaa9fdf, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "rt2_3.12d", 0x08000, 0xf5d439d8, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - { "rt2_2.12c", 0x08000, 0x1c0e29e0, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "rt1_7.7r", 0x10000, 0xa85efa39, 3 | BRF_GRA }, // 3 Layer 0 & 1 Tiles - { "rt1_8.7s", 0x08000, 0xf7a95820, 3 | BRF_GRA }, // 4 - - { "rt1_5.4r", 0x08000, 0xd0fc470b, 4 | BRF_GRA }, // 5 Layer 2 & 3 Tiles - { "rt1_6.4s", 0x04000, 0x6b57edb2, 4 | BRF_GRA }, // 6 - - { "rt1_9.12h", 0x10000, 0x8e070561, 5 | BRF_GRA }, // 7 Sprites - { "rt1_10.12k", 0x10000, 0xcb8fb607, 5 | BRF_GRA }, // 8 - { "rt1_11.12l", 0x10000, 0x2bdf5ed9, 5 | BRF_GRA }, // 9 - { "rt1_12.12m", 0x10000, 0xe6c6c7dc, 5 | BRF_GRA }, // 10 - { "rt1_13.12p", 0x10000, 0x489686d7, 5 | BRF_GRA }, // 11 - { "rt1_14.12r", 0x10000, 0x689e56a8, 5 | BRF_GRA }, // 12 - { "rt1_15.12t", 0x10000, 0x1d8bf2ca, 5 | BRF_GRA }, // 13 - { "rt1_16.12u", 0x10000, 0x1bbcf37b, 5 | BRF_GRA }, // 14 - - { "rt1-1.3r", 0x00200, 0x8ef3bb9d, 6 | BRF_GRA }, // 15 Color Proms - { "rt1-2.3s", 0x00200, 0x6510a8f2, 6 | BRF_GRA }, // 16 - { "rt1-3.4v", 0x00800, 0x95c7d944, 6 | BRF_GRA }, // 17 - { "rt1-4.5v", 0x00800, 0x1391fec9, 6 | BRF_GRA }, // 18 - { "rt1-5.6u", 0x00020, 0xe4130804, 6 | BRF_GRA }, // 19 - - { "rt2_4.6b", 0x08000, 0x0387464f, 7 | BRF_PRG | BRF_ESS }, // 20 HD63701 MCU Code - { "cus60-60a1.mcu", 0x01000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 21 - - { "rt1_17.f1", 0x10000, 0x766af455, 8 | BRF_PRG | BRF_ESS }, // 22 M6809 #0 Bank Code - { "rt1_18.h1", 0x10000, 0x3f9f2f5d, 8 | BRF_PRG | BRF_ESS }, // 23 - { "rt3_19.k1", 0x10000, 0xc16675e9, 8 | BRF_PRG | BRF_ESS }, // 24 - { "rt3_20.m1", 0x10000, 0xc470681b, 8 | BRF_PRG | BRF_ESS }, // 25 - - { "rt1_21.f3", 0x10000, 0x454968f3, 9 | BRF_SND }, // 26 Namco 63701x Samples - { "rt2_22.h3", 0x10000, 0xfe963e72, 9 | BRF_SND }, // 27 -}; - -STD_ROM_PICK(rthunder2) -STD_ROM_FN(rthunder2) - -struct BurnDriver BurnDrvRthunder2 = { - "rthunder2", "rthunder", NULL, NULL, "1986", - "Rolling Thunder (rev 2)\0", NULL, "Namco", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, rthunder2RomInfo, rthunder2RomName, NULL, NULL, CommonInputInfo, Rthunder1DIPInfo, - RthunderInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// Rolling Thunder (rev 1) -// some roms (mcu + samples) and maybe r19 updated to rt2 - -static struct BurnRomInfo rthunder1RomDesc[] = { - { "rt1_1b.9c", 0x08000, 0x6f8c1252, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "rt1_3.12d", 0x08000, 0xaaa82885, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - { "rt1_2b.12c", 0x08000, 0xf22a03d8, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "rt1_7.7r", 0x10000, 0xa85efa39, 3 | BRF_GRA }, // 3 Layer 0 & 1 Tiles - { "rt1_8.7s", 0x08000, 0xf7a95820, 3 | BRF_GRA }, // 4 - - { "rt1_5.4r", 0x08000, 0xd0fc470b, 4 | BRF_GRA }, // 5 Layer 2 & 3 Tiles2 - { "rt1_6.4s", 0x04000, 0x6b57edb2, 4 | BRF_GRA }, // 6 - - { "rt1_9.12h", 0x10000, 0x8e070561, 5 | BRF_GRA }, // 7 Sprites - { "rt1_10.12k", 0x10000, 0xcb8fb607, 5 | BRF_GRA }, // 8 - { "rt1_11.12l", 0x10000, 0x2bdf5ed9, 5 | BRF_GRA }, // 9 - { "rt1_12.12m", 0x10000, 0xe6c6c7dc, 5 | BRF_GRA }, // 10 - { "rt1_13.12p", 0x10000, 0x489686d7, 5 | BRF_GRA }, // 11 - { "rt1_14.12r", 0x10000, 0x689e56a8, 5 | BRF_GRA }, // 12 - { "rt1_15.12t", 0x10000, 0x1d8bf2ca, 5 | BRF_GRA }, // 13 - { "rt1_16.12u", 0x10000, 0x1bbcf37b, 5 | BRF_GRA }, // 14 - - { "rt1-1.3r", 0x00200, 0x8ef3bb9d, 6 | BRF_GRA }, // 15 Color Proms - { "rt1-2.3s", 0x00200, 0x6510a8f2, 6 | BRF_GRA }, // 16 - { "rt1-3.4v", 0x00800, 0x95c7d944, 6 | BRF_GRA }, // 17 - { "rt1-4.5v", 0x00800, 0x1391fec9, 6 | BRF_GRA }, // 18 - { "rt1-5.6u", 0x00020, 0xe4130804, 6 | BRF_GRA }, // 19 - - { "rt2_4.6b", 0x08000, 0x0387464f, 7 | BRF_PRG | BRF_ESS }, // 20 HD63701 MCU Code - { "cus60-60a1.mcu", 0x01000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 21 - - { "rt1_17.f1", 0x10000, 0x766af455, 8 | BRF_PRG | BRF_ESS }, // 22 M6809 #0 Bank Code - { "rt1_18.h1", 0x10000, 0x3f9f2f5d, 8 | BRF_PRG | BRF_ESS }, // 23 - { "r19", 0x10000, 0xfe9343b0, 8 | BRF_PRG | BRF_ESS }, // 24 - { "rt1_20.m1", 0x10000, 0xf8518d4f, 8 | BRF_PRG | BRF_ESS }, // 25 - - { "rt1_21.f3", 0x10000, 0x454968f3, 9 | BRF_SND }, // 26 Namco 63701x Samples - { "rt2_22.h3", 0x10000, 0xfe963e72, 9 | BRF_SND }, // 27 -}; - -STD_ROM_PICK(rthunder1) -STD_ROM_FN(rthunder1) - -struct BurnDriver BurnDrvRthunder1 = { - "rthunder1", "rthunder", NULL, NULL, "1986", - "Rolling Thunder (rev 1)\0", NULL, "Namco", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, rthunder1RomInfo, rthunder1RomName, NULL, NULL, CommonInputInfo, Rthunder1DIPInfo, - RthunderInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// Rolling Thunder (oldest) - -static struct BurnRomInfo rthunder0RomDesc[] = { - { "rt1_1b.9c", 0x08000, 0x6f8c1252, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "rt1_3.12d", 0x08000, 0xaaa82885, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - { "rt1_2b.12c", 0x08000, 0xf22a03d8, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "rt1_7.7r", 0x10000, 0xa85efa39, 3 | BRF_GRA }, // 3 Layer 0 & 1 Tiles - { "rt1_8.7s", 0x08000, 0xf7a95820, 3 | BRF_GRA }, // 4 - - { "rt1_5.4r", 0x08000, 0xd0fc470b, 4 | BRF_GRA }, // 5 Layer 2 & 3 Tiles2 - { "rt1_6.4s", 0x04000, 0x6b57edb2, 4 | BRF_GRA }, // 6 - - { "rt1_9.12h", 0x10000, 0x8e070561, 5 | BRF_GRA }, // 7 Sprites - { "rt1_10.12k", 0x10000, 0xcb8fb607, 5 | BRF_GRA }, // 8 - { "rt1_11.12l", 0x10000, 0x2bdf5ed9, 5 | BRF_GRA }, // 9 - { "rt1_12.12m", 0x10000, 0xe6c6c7dc, 5 | BRF_GRA }, // 10 - { "rt1_13.12p", 0x10000, 0x489686d7, 5 | BRF_GRA }, // 11 - { "rt1_14.12r", 0x10000, 0x689e56a8, 5 | BRF_GRA }, // 12 - { "rt1_15.12t", 0x10000, 0x1d8bf2ca, 5 | BRF_GRA }, // 13 - { "rt1_16.12u", 0x10000, 0x1bbcf37b, 5 | BRF_GRA }, // 14 - - { "rt1-1.3r", 0x00200, 0x8ef3bb9d, 6 | BRF_GRA }, // 15 Color Proms - { "rt1-2.3s", 0x00200, 0x6510a8f2, 6 | BRF_GRA }, // 16 - { "rt1-3.4v", 0x00800, 0x95c7d944, 6 | BRF_GRA }, // 17 - { "rt1-4.5v", 0x00800, 0x1391fec9, 6 | BRF_GRA }, // 18 - { "rt1-5.6u", 0x00020, 0xe4130804, 6 | BRF_GRA }, // 19 - - { "rt1_4.6b", 0x08000, 0x3f795094, 7 | BRF_PRG | BRF_ESS }, // 20 HD63701 MCU Code - { "cus60-60a1.mcu", 0x01000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 21 - - { "rt1_17.f1", 0x10000, 0x766af455, 8 | BRF_PRG | BRF_ESS }, // 22 M6809 #0 Bank Code - { "rt1_18.h1", 0x10000, 0x3f9f2f5d, 8 | BRF_PRG | BRF_ESS }, // 23 - { "rt1_19.k1", 0x10000, 0x1273a048, 8 | BRF_PRG | BRF_ESS }, // 24 - { "rt1_20.m1", 0x10000, 0xf8518d4f, 8 | BRF_PRG | BRF_ESS }, // 25 - - { "rt1_21.f3", 0x10000, 0x454968f3, 9 | BRF_SND }, // 26 Namco 63701x Samples - { "rt1_22.h3", 0x10000, 0x842a2fd4, 9 | BRF_SND }, // 27 -}; - -STD_ROM_PICK(rthunder0) -STD_ROM_FN(rthunder0) - -struct BurnDriver BurnDrvRthunder0 = { - "rthunder0", "rthunder", NULL, NULL, "1986", - "Rolling Thunder (oldest)\0", NULL, "Namco", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, rthunder0RomInfo, rthunder0RomName, NULL, NULL, CommonInputInfo, Rthunder1DIPInfo, - RthunderInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; - - -// Wonder Momo - -static struct BurnRomInfo wndrmomoRomDesc[] = { - { "wm1_1.9c", 0x08000, 0x34b50bf0, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 #0 Code - - { "wm1_2.12c", 0x08000, 0x3181efd0, 2 | BRF_PRG | BRF_ESS }, // 1 M6809 #1 Code - - { "wm1_6.7r", 0x08000, 0x93955fbb, 3 | BRF_GRA }, // 2 Layer 0 & 1 Tiles - { "wm1_7.7s", 0x04000, 0x7d662527, 3 | BRF_GRA }, // 3 - - { "wm1_4.4r", 0x08000, 0xbbe67836, 4 | BRF_GRA }, // 4 Layer 2 & 3 Tiles - { "wm1_5.4s", 0x04000, 0xa81b481f, 4 | BRF_GRA }, // 5 - - { "wm1_8.12h", 0x10000, 0x14f52e72, 5 | BRF_GRA }, // 6 Sprites - { "wm1_9.12k", 0x10000, 0x16f8cdae, 5 | BRF_GRA }, // 7 - { "wm1_10.12l", 0x10000, 0xbfbc1896, 5 | BRF_GRA }, // 8 - { "wm1_11.12m", 0x10000, 0xd775ddb2, 5 | BRF_GRA }, // 9 - { "wm1_12.12p", 0x10000, 0xde64c12f, 5 | BRF_GRA }, // 10 - { "wm1_13.12r", 0x10000, 0xcfe589ad, 5 | BRF_GRA }, // 11 - { "wm1_14.12t", 0x10000, 0x2ae21a53, 5 | BRF_GRA }, // 12 - { "wm1_15.12u", 0x10000, 0xb5c98be0, 5 | BRF_GRA }, // 13 - - { "wm1-1.3r", 0x00200, 0x1af8ade8, 6 | BRF_GRA }, // 14 Color Proms - { "wm1-2.3s", 0x00200, 0x8694e213, 6 | BRF_GRA }, // 15 - { "wm1-3.4v", 0x00800, 0x2ffaf9a4, 6 | BRF_GRA }, // 16 - { "wm1-4.5v", 0x00800, 0xf4e83e0b, 6 | BRF_GRA }, // 17 - { "wm1-5.6u", 0x00020, 0xe4130804, 6 | BRF_GRA }, // 18 - - { "wm1_3.6b", 0x08000, 0x55f01df7, 7 | BRF_PRG | BRF_ESS }, // 19 HD63701 MCU Code - { "cus60-60a1.mcu", 0x01000, 0x076ea82a, 7 | BRF_PRG | BRF_ESS }, // 20 - - { "wm1_16.f1", 0x10000, 0xe565f8f3, 8 | BRF_PRG | BRF_ESS }, // 21 M6809 #0 Bank Code - - { "wm1_17.f3", 0x10000, 0xbea3c318, 9 | BRF_SND }, // 22 Namco 63701x Samples - { "wm1_18.h3", 0x10000, 0x6d73bcc5, 9 | BRF_SND }, // 23 - { "wm1_19.k3", 0x10000, 0xd288e912, 9 | BRF_SND }, // 24 - { "wm1_20.m3", 0x10000, 0x076a72cb, 9 | BRF_SND }, // 25 -}; - -STD_ROM_PICK(wndrmomo) -STD_ROM_FN(wndrmomo) - -static INT32 WndrmomoInit() -{ - return CommonInit(4, 1); -} - -struct BurnDriver BurnDrvWndrmomo = { - "wndrmomo", NULL, NULL, NULL, "1987", - "Wonder Momo\0", NULL, "Namco", "System 86", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, wndrmomoRomInfo, wndrmomoRomName, NULL, NULL, CommonInputInfo, WndrmomoDIPInfo, - WndrmomoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_naughtyb.cpp b/jan/src/burn/drv/pre90s/d_naughtyb.cpp deleted file mode 100644 index 3c820252a..000000000 --- a/jan/src/burn/drv/pre90s/d_naughtyb.cpp +++ /dev/null @@ -1,1141 +0,0 @@ -// FB Alpha Naughty Boy driver module -// Based on MAME driver by Brad Oliver, Sal and John Bugliarisi, Paul Priest - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "pleiadssound.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvQuestion; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 cocktail; -static UINT8 palettereg; -static UINT8 bankreg; -static UINT8 scrollreg; - -static UINT8 prot_count; -static UINT8 prot_seed; -static INT32 prot_index; -static UINT32 question_offset; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; -static INT32 prevcoin; - -static INT32 game_select = 0; -static INT32 vblank; - -static struct BurnInputInfo NaughtybInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 7, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 6, "p1 right" }, - {"P1 Button", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 7, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 6, "p2 right" }, - {"P2 Button", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Naughtyb) - -static struct BurnInputInfo TrvmstrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 4" }, - - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Trvmstr) - -static struct BurnDIPInfo NaughtybDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x15, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "2" }, - {0x0e, 0x01, 0x03, 0x01, "3" }, - {0x0e, 0x01, 0x03, 0x02, "4" }, - {0x0e, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0e, 0x01, 0x0c, 0x00, "10000" }, - {0x0e, 0x01, 0x0c, 0x04, "30000" }, - {0x0e, 0x01, 0x0c, 0x08, "50000" }, - {0x0e, 0x01, 0x0c, 0x0c, "70000" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0e, 0x01, 0x30, 0x00, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x30, 0x10, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x30, 0x30, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0e, 0x01, 0x40, 0x00, "Easy" }, - {0x0e, 0x01, 0x40, 0x40, "Hard" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x80, 0x00, "Upright" }, - {0x0e, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Naughtyb) - -static struct BurnDIPInfo TrvmstrDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x44, NULL }, - - {0 , 0xfe, 0 , 4, "Screen Orientation" }, - {0x0a, 0x01, 0x03, 0x00, "0'" }, - {0x0a, 0x01, 0x03, 0x02, "90'" }, - {0x0a, 0x01, 0x03, 0x01, "180'" }, - {0x0a, 0x01, 0x03, 0x03, "270'" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Show Correct Answer" }, - {0x0a, 0x01, 0x08, 0x08, "No" }, - {0x0a, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0a, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x30, 0x30, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Number of Questions" }, - {0x0a, 0x01, 0x40, 0x00, "5" }, - {0x0a, 0x01, 0x40, 0x40, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0a, 0x01, 0x80, 0x00, "Upright" }, - {0x0a, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Trvmstr) - -static UINT8 popflame_protection_read() -{ - static const UINT8 seed[8] = { 0x78, 0x68, 0x48, 0xb8, 0x68, 0x60, 0x68, 0xe0 }; - - prot_count = (prot_count + 1) & 3; - - return seed[prot_seed + prot_count] | ((prot_index < 0x89) ? 1 : 0); -} - -static void popflame_protection_write(UINT8 data) -{ - if ((data & 1) && ((prot_seed & 1) == 0)) - prot_index = 0; - - if ((data & 8) && ((prot_seed & 8) == 0)) - prot_index++; - - prot_seed = (data & 0x10) >> 2; -} - -static void __fastcall naughtyb_main_write(UINT16 address, UINT8 data) -{ - if (game_select == 1) { // PopFlamer protection.. - if (address >= 0xb000 && address <= 0xb0ff) { - return popflame_protection_write(data); - } - } - - switch (address & ~0x07ff) - { - case 0x9000: - { - pleiads_sound_control_c_w(address, data); // sound - control c - - cocktail = (DrvDips[0] >> 7) & (data & 1); - palettereg = (data & 0x06) >> 1; - bankreg = (data >> ((game_select == 1) ? 3 : 2)) & 1; - } - return; - - case 0x9800: - scrollreg = data; - return; - - case 0xa000: - pleiads_sound_control_a_w(address, data); // sound - control a - return; - - case 0xa800: - pleiads_sound_control_b_w(address, data); // sound - control b and popflame protection writes - return; - - case 0xc000: - question_offset = (question_offset & ~(0xff << ((address & 3) << 3))) | (data << ((address & 3) << 3)); - return; - } -} - -static UINT8 __fastcall naughtyb_main_read(UINT16 address) -{ - if (game_select == 1) { // PopFlamer protection.. - if (address == 0x9000 || address == 0x9090) - return popflame_protection_read(); - } - - switch (address & ~0x07ff) - { - case 0xb000: - return (DrvInputs[0] & 0x03) | (DrvInputs[cocktail] & 0xfc); - - case 0xb800: - return (DrvDips[0] & 0x7f) | (vblank ? 0x80 : 0); - - case 0xc000: - return DrvQuestion[question_offset & 0x1ffff]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - if (game_select == 0 || game_select == 2) { - naughtyb_sound_reset(); - } - - if (game_select == 1) { - popflame_sound_reset(); - } - - DrvInputs[2] = 0xff; // default to no coin - prevcoin = 1; - - scrollreg = 0; - cocktail = 0; - bankreg = 0; - - prot_count = 0; - prot_seed = 0; - prot_index = 0; - - question_offset = 0; - - return 0; -} - -static INT32 MemIndex(INT32 select) -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x004000; - - DrvQuestion = Next; - if (select == 2 || select == 3) - Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x004000; - DrvVidRAM0 = Next; Next += 0x000800; - DrvVidRAM1 = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[2] = { 0x8000, 0 }; - INT32 XOffs[8] = { STEP8(7,-1) }; - INT32 YOffs[8] = { STEP8(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(select); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(select); - - game_select = select; - - if (game_select == 0) - { // naughty boy - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x0800, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1800, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2800, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x3000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x3800, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0800, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1800, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0800, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1800, 15, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 17, 1)) return 1; - } - else if (game_select == 1) - { // pop flamer - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x3000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 7, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 9, 1)) return 1; - } - else if (game_select == 2) - { // trivia master - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 7, 1)) return 1; - - if (BurnLoadRom(DrvQuestion + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x04000, 9, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x08000, 10, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x0c000, 11, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x10000, 12, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x14000, 13, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x18000, 14, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x1c000, 15, 1)) return 1; - } - else if (game_select == 3) - { // trivia genius - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 8, 1)) return 1; - - if (BurnLoadRom(DrvQuestion + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x04000, 10, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x08000, 11, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x0c000, 12, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x10000, 13, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x14000, 14, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x18000, 15, 1)) return 1; - if (BurnLoadRom(DrvQuestion + 0x1c000, 16, 1)) return 1; - game_select = 2; - } - - DrvGfxDecode(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x4000, 0x7fff, MAP_RAM); - ZetMapMemory(DrvVidRAM0, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvVidRAM1, 0x8800, 0x8fff, MAP_RAM); - ZetSetWriteHandler(naughtyb_main_write); - ZetSetReadHandler(naughtyb_main_read); - ZetClose(); - - pleiads_sound_init(1); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - pleiads_sound_deinit(); - - ZetExit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0;i < 0x100; i++) - { - INT32 bit0, bit1, r, g, b; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i+0x100] >> 0) & 0x01; - r = bit0 * 172 + bit1 * 83; - - bit0 = (DrvColPROM[i] >> 2) & 0x01; - bit1 = (DrvColPROM[i+0x100] >> 2) & 0x01; - g = bit0 * 172 + bit1 * 83; - - bit0 = (DrvColPROM[i] >> 1) & 0x01; - bit1 = (DrvColPROM[i+0x100] >> 1) & 0x01; - b = bit0 * 172 + bit1 * 83; - - INT32 o = ((i & 0xc0) >> 1) | ((i & 0x27) << 2) | ((i & 0x18) >> 3); - - DrvPalette[o] = BurnHighCol(r,g,b,0); - } -} - -static void draw_last_little_bit(INT32 layer) -{ - for (INT32 offs = 0x100 - 1; offs >= 0; offs--) - { - INT32 code0 = (DrvVidRAM0[offs + 0x700] + (bankreg << 8)) & 0x1ff; - INT32 color0 = ((DrvVidRAM0[offs + 0x700] >> 5) + (palettereg << 3)) & 0xff; - - INT32 code1 = (DrvVidRAM1[offs + 0x700] + (bankreg << 8)) & 0x1ff; - INT32 color1 = ((DrvVidRAM1[offs + 0x700] >> 5) + (palettereg << 3)) & 0xff; - - INT32 sx = (offs & 3) * 8; - INT32 sy = (offs / 4) * 8; - - if ((offs&3) >= 2) { - sx -= 16; - } else { - sx += (34 * 8); - } - - //if (nBurnLayer & 4) Render8x8Tile_Clip(pTransDraw, code0, sx, sy, color0, 2, 0x80, DrvGfxROM1); - //if (nBurnLayer & 8) Render8x8Tile_Mask_Clip(pTransDraw, code0, sx, sy, color0, 2, transp, 0x80, DrvGfxROM1); - if (nBurnLayer & 1 && layer == 0) Render8x8Tile_Clip(pTransDraw, code1, sx, sy, color1, 2, 0, DrvGfxROM0); - if (nBurnLayer & 2 && layer == 1) Render8x8Tile_Mask_Clip(pTransDraw, code0, sx, sy, color0, 2, 0, 0x80, DrvGfxROM1); - } -} - -static void draw_layer(INT32 layer) -{ - INT32 scrx = (scrollreg - 17) & 0x1ff; - -// 121 - 72 - - for (INT32 offs = 0x800 - 1; offs >= 0; offs--) - { - INT32 sx, sy; - - INT32 code1 = (DrvVidRAM1[offs] + (bankreg << 8)) & 0x1ff; - INT32 color1 = ((DrvVidRAM1[offs] >> 5) + (palettereg << 3)) & 0xff; - - INT32 code0 = (DrvVidRAM0[offs] + (bankreg << 8)) & 0x1ff; - INT32 color0 = ((DrvVidRAM0[offs] >> 5) + (palettereg << 3)) & 0xff; - - if (cocktail) - { - if (offs < 0x700) - { - sx = (63 - offs) & 0x3f; - sy = 27 - offs / 64; - } - else - { - sx = 64 + ((3 - (offs - 0x700)) & 3 ); - sy = 27 - (offs - 0x700) / 4; - } - - sx *= 8; - sy *= 8; - - - if (nBurnLayer & 1 && layer == 0) Render8x8Tile_FlipXY_Clip(pTransDraw, code1, sx, sy, color1, 2, 0, DrvGfxROM0); - if (nBurnLayer & 2 && layer == 1) Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code0, sx, sy, color0, 2, 0, 0x80, DrvGfxROM1); - } - else - { - INT32 transp = 0; - - if (offs < 0x700) - { - sx = (offs & 0x3f) * 8; - sy = (offs / 64) * 8; - - sx -= scrx; - if (sx < -7) sx += 512; - - } else continue; - // else - // { - // sx = (64 + (offs - 0x700) & 3) * 8; - // sy = ((offs - 0x700) / 4) * 8; - // transp = 0xff; - // } - - if (nBurnLayer & 1 && layer == 0) Render8x8Tile_Clip(pTransDraw, code1, sx, sy, color1, 2, 0, DrvGfxROM0); - if (nBurnLayer & 2 && layer == 1) Render8x8Tile_Mask_Clip(pTransDraw, code0, sx, sy, color0, 2, transp, 0x80, DrvGfxROM1); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - draw_layer(0); - draw_layer(1); - draw_last_little_bit(0); - draw_last_little_bit(1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - - ZetOpen(0); - - { - memset (DrvInputs, 0, 3); - DrvInputs[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - ProcessJoystick(&DrvInputs[0], 0, 4,5,7,6, INPUT_4WAY | INPUT_MAKEACTIVELOW); - ProcessJoystick(&DrvInputs[1], 1, 4,5,7,6, INPUT_4WAY | INPUT_MAKEACTIVELOW); - - if ((DrvInputs[2] & 1) && (prevcoin != (DrvInputs[2] & 1))) { - ZetNmi(); - } - prevcoin = DrvInputs[2] & 1; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal = 3000000 / 60; - INT32 nCyclesDone = 0; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone += ZetRun(nCyclesTotal / nInterleave); - - if (i == 240) vblank = 1; - } - - ZetClose(); - - if (pBurnSoundOut) { - pleiads_sound_update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - SCAN_VAR(cocktail); - SCAN_VAR(palettereg); - SCAN_VAR(bankreg); - SCAN_VAR(scrollreg); - SCAN_VAR(prot_count); - SCAN_VAR(prot_seed); - SCAN_VAR(prot_index); - SCAN_VAR(question_offset); - } - - return 0; -} - - -// Naughty Boy - -static struct BurnRomInfo naughtybRomDesc[] = { - { "1.30", 0x0800, 0xf6e1178e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2.29", 0x0800, 0xb803eb8c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.28", 0x0800, 0x004d0ba7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.27", 0x0800, 0x3c7bcac6, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.26", 0x0800, 0xea80f39b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6.25", 0x0800, 0x66d9f942, 1 | BRF_PRG | BRF_ESS }, // 5 - { "7.24", 0x0800, 0x00caf9be, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8.23", 0x0800, 0x17c3b6fb, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "15.44", 0x0800, 0xd692f9c7, 2 | BRF_GRA }, // 8 Background Tiles - { "16.43", 0x0800, 0xd3ba8b27, 2 | BRF_GRA }, // 9 - { "13.46", 0x0800, 0xc1669cd5, 2 | BRF_GRA }, // 10 - { "14.45", 0x0800, 0xeef2c8e5, 2 | BRF_GRA }, // 11 - - { "11.48", 0x0800, 0x75ec9710, 3 | BRF_GRA }, // 12 Foreground Tiles - { "12.47", 0x0800, 0xef0706c3, 3 | BRF_GRA }, // 13 - { "9.50", 0x0800, 0x8c8db764, 3 | BRF_GRA }, // 14 - { "10.49", 0x0800, 0xc97c97b9, 3 | BRF_GRA }, // 15 - - { "6301-1.63", 0x0100, 0x98ad89a1, 4 | BRF_GRA }, // 16 Color Proms - { "6301-1.64", 0x0100, 0x909107d4, 4 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(naughtyb) -STD_ROM_FN(naughtyb) - -static INT32 naughtybInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvNaughtyb = { - "naughtyb", NULL, NULL, NULL, "1982", - "Naughty Boy\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, naughtybRomInfo, naughtybRomName, NULL, NULL, NaughtybInputInfo, NaughtybDIPInfo, - naughtybInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Naughty Boy (bootleg) - -static struct BurnRomInfo naughtybaRomDesc[] = { - { "91", 0x0800, 0x42b14bc7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "92", 0x0800, 0xa24674b4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.28", 0x0800, 0x004d0ba7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.27", 0x0800, 0x3c7bcac6, 1 | BRF_PRG | BRF_ESS }, // 3 - { "95", 0x0800, 0xe282f1b8, 1 | BRF_PRG | BRF_ESS }, // 4 - { "96", 0x0800, 0x61178ff2, 1 | BRF_PRG | BRF_ESS }, // 5 - { "97", 0x0800, 0x3cafde88, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8.23", 0x0800, 0x17c3b6fb, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "15.44", 0x0800, 0xd692f9c7, 2 | BRF_GRA }, // 8 Background Tiles - { "16.43", 0x0800, 0xd3ba8b27, 2 | BRF_GRA }, // 9 - { "13.46", 0x0800, 0xc1669cd5, 2 | BRF_GRA }, // 10 - { "14.45", 0x0800, 0xeef2c8e5, 2 | BRF_GRA }, // 11 - - { "11.48", 0x0800, 0x75ec9710, 3 | BRF_GRA }, // 12 Foreground Tiles - { "12.47", 0x0800, 0xef0706c3, 3 | BRF_GRA }, // 13 - { "9.50", 0x0800, 0x8c8db764, 3 | BRF_GRA }, // 14 - { "10.49", 0x0800, 0xc97c97b9, 3 | BRF_GRA }, // 15 - - { "6301-1.63", 0x0100, 0x98ad89a1, 4 | BRF_GRA }, // 16 Color Proms - { "6301-1.64", 0x0100, 0x909107d4, 4 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(naughtyba) -STD_ROM_FN(naughtyba) - -struct BurnDriver BurnDrvNaughtyba = { - "naughtyba", "naughtyb", NULL, NULL, "1982", - "Naughty Boy (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, naughtybaRomInfo, naughtybaRomName, NULL, NULL, NaughtybInputInfo, NaughtybDIPInfo, - naughtybInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Naughty Boy (Cinematronics) - -static struct BurnRomInfo naughtybcRomDesc[] = { - { "nb1ic30", 0x0800, 0x3f482fa3, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "nb2ic29", 0x0800, 0x7ddea141, 1 | BRF_PRG | BRF_ESS }, // 1 - { "nb3ic28", 0x0800, 0x8c72a069, 1 | BRF_PRG | BRF_ESS }, // 2 - { "nb4ic27", 0x0800, 0x30feae51, 1 | BRF_PRG | BRF_ESS }, // 3 - { "nb5ic26", 0x0800, 0x05242fd0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "nb6ic25", 0x0800, 0x7a12ffea, 1 | BRF_PRG | BRF_ESS }, // 5 - { "nb7ic24", 0x0800, 0x9cc287df, 1 | BRF_PRG | BRF_ESS }, // 6 - { "nb8ic23", 0x0800, 0x4d84ff2c, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "15.44", 0x0800, 0xd692f9c7, 2 | BRF_GRA }, // 8 Background Tiles - { "16.43", 0x0800, 0xd3ba8b27, 2 | BRF_GRA }, // 9 - { "13.46", 0x0800, 0xc1669cd5, 2 | BRF_GRA }, // 10 - { "14.45", 0x0800, 0xeef2c8e5, 2 | BRF_GRA }, // 11 - - { "nb11ic48", 0x0800, 0x23271a13, 3 | BRF_GRA }, // 12 Foreground Tiles - { "12.47", 0x0800, 0xef0706c3, 3 | BRF_GRA }, // 13 - { "nb9ic50", 0x0800, 0xd6949c27, 3 | BRF_GRA }, // 14 - { "10.49", 0x0800, 0xc97c97b9, 3 | BRF_GRA }, // 15 - - { "6301-1.63", 0x0100, 0x98ad89a1, 4 | BRF_GRA }, // 16 Color Proms - { "6301-1.64", 0x0100, 0x909107d4, 4 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(naughtybc) -STD_ROM_FN(naughtybc) - -struct BurnDriver BurnDrvNaughtybc = { - "naughtybc", "naughtyb", NULL, NULL, "1982", - "Naughty Boy (Cinematronics)\0", NULL, "Jaleco (Cinematronics license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, naughtybcRomInfo, naughtybcRomName, NULL, NULL, NaughtybInputInfo, NaughtybDIPInfo, - naughtybInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Pop Flamer (protected) - -static struct BurnRomInfo popflameRomDesc[] = { - { "ic86.bin", 0x1000, 0x06397a4b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "ic80.pop", 0x1000, 0xb77abf3d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic94.bin", 0x1000, 0xae5248ae, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic100.pop", 0x1000, 0xf9f2343b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ic13.pop", 0x1000, 0x2367131e, 2 | BRF_GRA }, // 4 Background Tiles - { "ic3.pop", 0x1000, 0xdeed0a8b, 2 | BRF_GRA }, // 5 - - { "ic29.pop", 0x1000, 0x7b54f60f, 3 | BRF_GRA }, // 6 Foreground Tiles - { "ic38.pop", 0x1000, 0xdd2d9601, 3 | BRF_GRA }, // 7 - - { "ic54", 0x0100, 0x236bc771, 4 | BRF_GRA }, // 8 Color Proms - { "ic53", 0x0100, 0x6e66057f, 4 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(popflame) -STD_ROM_FN(popflame) - -static INT32 popflameInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvPopflame = { - "popflame", NULL, NULL, NULL, "1982", - "Pop Flamer (protected)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, popflameRomInfo, popflameRomName, NULL, NULL, NaughtybInputInfo, NaughtybDIPInfo, - popflameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Pop Flamer (not protected) - -static struct BurnRomInfo popflameaRomDesc[] = { - { "ic86.pop", 0x1000, 0x5e32bbdf, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "ic80.pop", 0x1000, 0xb77abf3d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic94.pop", 0x1000, 0x945a3c0f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic100.pop", 0x1000, 0xf9f2343b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ic13.pop", 0x1000, 0x2367131e, 2 | BRF_GRA }, // 4 Background Tiles - { "ic3.pop", 0x1000, 0xdeed0a8b, 2 | BRF_GRA }, // 5 - - { "ic29.pop", 0x1000, 0x7b54f60f, 3 | BRF_GRA }, // 6 Foreground Tiles - { "ic38.pop", 0x1000, 0xdd2d9601, 3 | BRF_GRA }, // 7 - - { "ic54", 0x0100, 0x236bc771, 4 | BRF_GRA }, // 8 Color Proms - { "ic53", 0x0100, 0x6e66057f, 4 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(popflamea) -STD_ROM_FN(popflamea) - -struct BurnDriver BurnDrvPopflamea = { - "popflamea", "popflame", NULL, NULL, "1982", - "Pop Flamer (not protected)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, popflameaRomInfo, popflameaRomName, NULL, NULL, NaughtybInputInfo, NaughtybDIPInfo, - popflameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Pop Flamer (hack?) - -static struct BurnRomInfo popflamebRomDesc[] = { - { "popflama.30", 0x1000, 0xa9bb0e8a, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "popflama.28", 0x1000, 0xdebe6d03, 1 | BRF_PRG | BRF_ESS }, // 1 - { "popflama.26", 0x1000, 0x09df0d4d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "popflama.24", 0x1000, 0xf399d553, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ic13.pop", 0x1000, 0x2367131e, 2 | BRF_GRA }, // 4 Background Tiles - { "ic3.pop", 0x1000, 0xdeed0a8b, 2 | BRF_GRA }, // 5 - - { "ic29.pop", 0x1000, 0x7b54f60f, 3 | BRF_GRA }, // 6 Foreground Tiles - { "ic38.pop", 0x1000, 0xdd2d9601, 3 | BRF_GRA }, // 7 - - { "ic54", 0x0100, 0x236bc771, 4 | BRF_GRA }, // 8 Color Proms - { "ic53", 0x0100, 0x6e66057f, 4 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(popflameb) -STD_ROM_FN(popflameb) - -struct BurnDriver BurnDrvPopflameb = { - "popflameb", "popflame", NULL, NULL, "1982", - "Pop Flamer (hack?)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, popflamebRomInfo, popflamebRomName, NULL, NULL, NaughtybInputInfo, NaughtybDIPInfo, - popflameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - - - -// Pop Flamer (bootleg on Naughty Boy PCB) - -static struct BurnRomInfo popflamenRomDesc[] = { - { "pfb2-1.bin", 0x0800, 0x88cd3faa, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "pfb2-2.bin", 0x0800, 0xa09892e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pfb2-3.bin", 0x0800, 0x99fca5ed, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pfb2-4.bin", 0x0800, 0xc8d254e0, 1 | BRF_PRG | BRF_ESS }, // 3 - { "pfb2-5.bin", 0x0800, 0xd89710d5, 1 | BRF_PRG | BRF_ESS }, // 4 - { "pfb2-6.bin", 0x0800, 0xb6cec1aa, 1 | BRF_PRG | BRF_ESS }, // 5 - { "pfb2-7.bin", 0x0800, 0x1cf8b5c4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "pfb2-8.bin", 0x0800, 0xa63feeff, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "pfb2-15.bin", 0x0800, 0x3d8b8f6f, 2 | BRF_GRA }, // 8 Background Tiles - { "pfb2-16.bin", 0x0800, 0x75f0308b, 2 | BRF_GRA }, // 9 - { "pfb2-13.bin", 0x0800, 0x42fc5bac, 2 | BRF_GRA }, // 10 - { "pfb2-14.bin", 0x0800, 0xfefada6e, 2 | BRF_GRA }, // 11 - - { "pfb2-11.bin", 0x0800, 0x8ccdcc01, 3 | BRF_GRA }, // 12 Foreground Tiles - { "pfb2-12.bin", 0x0800, 0x49e04ddb, 3 | BRF_GRA }, // 13 - { "pfb2-9.bin", 0x0800, 0x32debf48, 3 | BRF_GRA }, // 14 - { "pfb2-10.bin", 0x0800, 0x7fe61ed3, 3 | BRF_GRA }, // 15 - - { "ic54", 0x0100, 0x236bc771, 4 | BRF_GRA }, // 16 Color Proms - { "ic53", 0x0100, 0x6e66057f, 4 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(popflamen) -STD_ROM_FN(popflamen) - -struct BurnDriver BurnDrvPopflamen = { - "popflamen", "popflame", NULL, NULL, "1982", - "Pop Flamer (bootleg on Naughty Boy PCB)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, popflamenRomInfo, popflamenRomName, NULL, NULL, NaughtybInputInfo, NaughtybDIPInfo, - naughtybInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Trivia Master (set 1) - -static struct BurnRomInfo trvmstrRomDesc[] = { - { "ic30.bin", 0x1000, 0x4ccd0537, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "ic28.bin", 0x1000, 0x782a2b8c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic26.bin", 0x1000, 0x1362010a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ic44.bin", 0x1000, 0xdac8cff7, 2 | BRF_GRA }, // 3 Background Tiles - { "ic46.bin", 0x1000, 0xa97ab879, 2 | BRF_GRA }, // 4 - - { "ic48.bin", 0x1000, 0x79952015, 3 | BRF_GRA }, // 5 Foreground Tiles - { "ic50.bin", 0x1000, 0xf09da428, 3 | BRF_GRA }, // 6 - - { "ic64.bin", 0x0100, 0xe9915da8, 4 | BRF_GRA }, // 7 Color Proms - - { "sport_lo.u2", 0x4000, 0x24f30489, 5 | BRF_GRA }, // 8 Question Data - { "sport_hi.u1", 0x4000, 0xd64a7480, 5 | BRF_GRA }, // 9 - { "etain_lo.u4", 0x4000, 0xa2af9709, 5 | BRF_GRA }, // 10 - { "etain_hi.u3", 0x4000, 0x82a60dea, 5 | BRF_GRA }, // 11 - { "sex_lo.u6", 0x4000, 0xf2ecfa88, 5 | BRF_GRA }, // 12 - { "sex_hi.u5", 0x4000, 0xde4a6c4b, 5 | BRF_GRA }, // 13 - { "scien_lo.u8", 0x4000, 0x01a01ff1, 5 | BRF_GRA }, // 14 - { "scien_hi.u7", 0x4000, 0x0bc68078, 5 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(trvmstr) -STD_ROM_FN(trvmstr) - -static INT32 trvmstrInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvTrvmstr = { - "trvmstr", NULL, NULL, NULL, "1985", - "Trivia Master (set 1)\0", NULL, "Enerdyne Technologies Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, trvmstrRomInfo, trvmstrRomName, NULL, NULL, TrvmstrInputInfo, TrvmstrDIPInfo, - trvmstrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Trivia Master (set 2) - -static struct BurnRomInfo trvmstraRomDesc[] = { - { "ic30a.bin", 0x2000, 0x4c175c45, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "ic28a.bin", 0x2000, 0x3a8ca87d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic26a.bin", 0x2000, 0x3c655400, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ic44.bin", 0x1000, 0xdac8cff7, 2 | BRF_GRA }, // 3 Background Tiles - { "ic46.bin", 0x1000, 0xa97ab879, 2 | BRF_GRA }, // 4 - - { "ic48.bin", 0x1000, 0x79952015, 3 | BRF_GRA }, // 5 Foreground Tiles - { "ic50.bin", 0x1000, 0xf09da428, 3 | BRF_GRA }, // 6 - - { "ic64.bin", 0x0100, 0xe9915da8, 4 | BRF_GRA }, // 7 Color Proms - - { "enter_lo.u2", 0x4000, 0xa65b8f83, 5 | BRF_GRA }, // 8 Question Data - { "enter_hi.u1", 0x4000, 0xcaede447, 5 | BRF_GRA }, // 9 - { "sports_lo.u4", 0x4000, 0xd5317b26, 5 | BRF_GRA }, // 10 - { "sports_hi.u3", 0x4000, 0x9f706db2, 5 | BRF_GRA }, // 11 - { "sex2_lo.u6", 0x4000, 0xb73f2e31, 5 | BRF_GRA }, // 12 - { "sex2_hi.u5", 0x4000, 0xbf654110, 5 | BRF_GRA }, // 13 - { "comic_lo.u8", 0x4000, 0x109bd359, 5 | BRF_GRA }, // 14 - { "comic_hi.u7", 0x4000, 0x8e8b5f71, 5 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(trvmstra) -STD_ROM_FN(trvmstra) - -struct BurnDriver BurnDrvTrvmstra = { - "trvmstra", "trvmstr", NULL, NULL, "1985", - "Trivia Master (set 2)\0", NULL, "Enerdyne Technologies Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, trvmstraRomInfo, trvmstraRomName, NULL, NULL, TrvmstrInputInfo, TrvmstrDIPInfo, - trvmstrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Trivia Master (set 3) - -static struct BurnRomInfo trvmstrbRomDesc[] = { - { "ic30b.bin", 0x1000, 0xd3eb4197, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "ic28b.bin", 0x1000, 0x70322d65, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic26b.bin", 0x1000, 0x31dfa9cf, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ic44.bin", 0x1000, 0xdac8cff7, 2 | BRF_GRA }, // 3 Background Tiles - { "ic46.bin", 0x1000, 0xa97ab879, 2 | BRF_GRA }, // 4 - - { "ic48.bin", 0x1000, 0x79952015, 3 | BRF_GRA }, // 5 Foreground Tiles - { "ic50.bin", 0x1000, 0xf09da428, 3 | BRF_GRA }, // 6 - - { "ic64.bin", 0x0100, 0xe9915da8, 4 | BRF_GRA }, // 7 Color Proms - - { "earlytv_lo.u2", 0x4000, 0xdbfce45f, 5 | BRF_GRA }, // 8 Question Data - { "earlytv_hi.u1", 0x4000, 0xc8f5a02d, 5 | BRF_GRA }, // 9 - { "sex_lo.u4", 0x4000, 0x27a4ff7a, 5 | BRF_GRA }, // 10 - { "sex_hi.u3", 0x4000, 0xde84fc2f, 5 | BRF_GRA }, // 11 - { "rock_lo.u6", 0x4000, 0xec1df27b, 5 | BRF_GRA }, // 12 - { "rock_hi.u5", 0x4000, 0x8a4eccc9, 5 | BRF_GRA }, // 13 - { "lifesci_lo.u8", 0x4000, 0xb58ba9eb, 5 | BRF_GRA }, // 14 - { "lifesci_hi.u7", 0x4000, 0xe03dfa12, 5 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(trvmstrb) -STD_ROM_FN(trvmstrb) - -struct BurnDriver BurnDrvTrvmstrb = { - "trvmstrb", "trvmstr", NULL, NULL, "1985", - "Trivia Master (set 3)\0", NULL, "Enerdyne Technologies Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, trvmstrbRomInfo, trvmstrbRomName, NULL, NULL, TrvmstrInputInfo, TrvmstrDIPInfo, - trvmstrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Trivia Master (set 4) - -static struct BurnRomInfo trvmstrcRomDesc[] = { - { "jaleco.30", 0x1000, 0x9a80c5a7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "jaleco.28", 0x1000, 0x70322d65, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jaleco.26", 0x1000, 0x3431a2ba, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "jaleco.44", 0x1000, 0xdac8cff7, 2 | BRF_GRA }, // 3 Background Tiles - { "jaleco.46", 0x1000, 0xa97ab879, 2 | BRF_GRA }, // 4 - - { "jaleco.48", 0x1000, 0x79952015, 3 | BRF_GRA }, // 5 Foreground Tiles - { "jaleco.50", 0x1000, 0xf09da428, 3 | BRF_GRA }, // 6 - - { "jaleco.64", 0x0100, 0xe9915da8, 4 | BRF_GRA }, // 7 Color Proms - - { "jaleco.2", 0x4000, 0x1ad4c446, 5 | BRF_GRA }, // 8 Question Data - { "jaleco.1", 0x4000, 0x9c308849, 5 | BRF_GRA }, // 9 - { "jaleco.4", 0x4000, 0x38dd45cd, 5 | BRF_GRA }, // 10 - { "jaleco.3", 0x4000, 0x83b5465b, 5 | BRF_GRA }, // 11 - { "jaleco.6", 0x4000, 0x4a2263a7, 5 | BRF_GRA }, // 12 - { "jaleco.5", 0x4000, 0xbd31f382, 5 | BRF_GRA }, // 13 - { "jaleco.8", 0x4000, 0xb73f2e31, 5 | BRF_GRA }, // 14 - { "jaleco.7", 0x4000, 0xbf654110, 5 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(trvmstrc) -STD_ROM_FN(trvmstrc) - -struct BurnDriver BurnDrvTrvmstrc = { - "trvmstrc", "trvmstr", NULL, NULL, "1985", - "Trivia Master (set 4)\0", NULL, "Enerdyne Technologies Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, trvmstrcRomInfo, trvmstrcRomName, NULL, NULL, TrvmstrInputInfo, TrvmstrDIPInfo, - trvmstrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - - -// Trivia Genius - -static struct BurnRomInfo trvgnsRomDesc[] = { - { "trvgns.30", 0x1000, 0xa17f172c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "trvgns.28", 0x1000, 0x681a1bff, 1 | BRF_PRG | BRF_ESS }, // 1 - { "trvgns.26", 0x1000, 0x5b4068b8, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "trvgns.44", 0x1000, 0xcd67f2cb, 2 | BRF_GRA }, // 3 Background Tiles - { "trvgns.46", 0x1000, 0xf4021941, 2 | BRF_GRA }, // 4 - - { "trvgns.48", 0x1000, 0x6d05845e, 3 | BRF_GRA }, // 5 Foreground Tiles - { "trvgns.50", 0x1000, 0xac292be8, 3 | BRF_GRA }, // 6 - - { "82s129.ic63.bin", 0x0100, 0x8ab6076a, 4 | BRF_GRA }, // 7 Color Proms - { "82s129.ic64.bin", 0x0100, 0xc766c54a, 4 | BRF_GRA }, // 8 - - { "trvgns.u2", 0x4000, 0x109bd359, 5 | BRF_GRA }, // 9 Question Data - { "trvgns.u1", 0x4000, 0x8e8b5f71, 5 | BRF_GRA }, // 10 - { "trvgns.u4", 0x4000, 0xb73f2e31, 5 | BRF_GRA }, // 11 - { "trvgns.u3", 0x4000, 0xbf654110, 5 | BRF_GRA }, // 12 - { "trvgns.u6", 0x4000, 0x4a2263a7, 5 | BRF_GRA }, // 13 - { "trvgns.u5", 0x4000, 0xbd31f382, 5 | BRF_GRA }, // 14 - { "trvgns.u8", 0x4000, 0xdbfce45f, 5 | BRF_GRA }, // 15 - { "trvgns.u7", 0x4000, 0xc8f5a02d, 5 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(trvgns) -STD_ROM_FN(trvgns) - -static INT32 trvgnsInit() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvTrvgns = { - "trvgns", "trvmstr", NULL, NULL, "1985", - "Trivia Genius\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, trvgnsRomInfo, trvgnsRomName, NULL, NULL, TrvmstrInputInfo, TrvmstrDIPInfo, - trvgnsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 288, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_ninjakd2.cpp b/jan/src/burn/drv/pre90s/d_ninjakd2.cpp deleted file mode 100644 index ed5c8558c..000000000 --- a/jan/src/burn/drv/pre90s/d_ninjakd2.cpp +++ /dev/null @@ -1,2701 +0,0 @@ -// FB Alpha UPL (Ninja Kid 2) driver module -// Based on MAME driver by Roberto Ventura, Leandro Dardini, Yochizo, Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "mc8123.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvZ80Key; -static UINT8 *DrvSndROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvBgRAM0; -static UINT8 *DrvBgRAM1; -static UINT8 *DrvBgRAM2; - -static UINT16 *pSpriteDraw; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; - -static UINT16 scrollx[3]; -static UINT16 scrolly[3]; -static UINT8 tilemap_enable[3]; -static UINT8 overdraw_enable; -static UINT8 nZ80RomBank; -static UINT8 nZ80RamBank[3]; - -static UINT8 m_omegaf_io_protection[3]; -static UINT8 m_omegaf_io_protection_input; -static INT32 m_omegaf_io_protection_tic; - -static INT32 ninjakd2_sample_offset; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 previous_coin[2]; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo Drv2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv2) - -static struct BurnInputInfo OmegafInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Omegaf) - -static struct BurnDIPInfo MnightDIPList[]= -{ - {0x11, 0xff, 0xff, 0xcf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x11, 0x01, 0x01, 0x01, "Off" }, -// {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x02, 0x02, "30k and every 50k" }, - {0x11, 0x01, 0x02, 0x00, "50k and every 80k" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x04, 0x04, "Normal" }, - {0x11, 0x01, 0x04, 0x00, "Difficult" }, - - {0 , 0xfe, 0 , 2, "Infinite Lives" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x11, 0x01, 0x10, 0x00, "Upright" }, -// {0x11, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0x80, "2" }, - {0x11, 0x01, 0xc0, 0xc0, "3" }, - {0x11, 0x01, 0xc0, 0x40, "4" }, - {0x11, 0x01, 0xc0, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x12, 0x01, 0xe0, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Mnight) - -static struct BurnDIPInfo Ninjakd2DIPList[]= -{ - {0x11, 0xff, 0xff, 0x6f, NULL }, - {0x12, 0xff, 0xff, 0xfd, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x11, 0x01, 0x01, 0x01, "Off" }, -// {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x06, 0x04, "20000 and every 50000" }, - {0x11, 0x01, 0x06, 0x06, "30000 and every 50000" }, - {0x11, 0x01, 0x06, 0x02, "50000 and every 50000" }, - {0x11, 0x01, 0x06, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x08, 0x00, "No" }, - {0x11, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x20, 0x20, "Normal" }, - {0x11, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x11, 0x01, 0x40, 0x40, "3" }, - {0x11, 0x01, 0x40, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x11, 0x01, 0x80, 0x00, "English" }, - {0x11, 0x01, 0x80, 0x80, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x12, 0x01, 0x02, 0x00, "Upright" }, -// {0x12, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Credit Service" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x18, 0x00, "2 Coins/1 Credit, 6/4" }, - {0x12, 0x01, 0x18, 0x18, "1 Coin/1 Credit, 3/4" }, - {0x12, 0x01, 0x18, 0x10, "1 Coin/2 Credits, 2/6, 3/10" }, - {0x12, 0x01, 0x18, 0x08, "1 Coin/3 Credits, 3/12" }, - {0x12, 0x01, 0x18, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x18, 0x10, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x18, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0xe0, 0x00, "5 Coins/1 Credit, 15/4" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins/1 Credit, 12/4" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins/1 Credit, 9/4" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins/1 Credit, 6/4" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin/1 Credit, 3/4" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin/2 Credits, 2/6, 3/10" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin/3 Credits, 3/12" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xe0, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Ninjakd2) - -static struct BurnDIPInfo RdactionDIPList[]= -{ - {0x11, 0xff, 0xff, 0x6f, NULL }, - {0x12, 0xff, 0xff, 0xfd, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x11, 0x01, 0x01, 0x01, "Off" }, -// {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Bonus Life" }, - {0x11, 0x01, 0x06, 0x04, "20000 and every 50000" }, - {0x11, 0x01, 0x06, 0x06, "30000 and every 50000" }, - {0x11, 0x01, 0x06, 0x02, "50000 and every 100000" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x08, 0x00, "No" }, - {0x11, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x20, 0x20, "Normal" }, - {0x11, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x11, 0x01, 0x40, 0x40, "3" }, - {0x11, 0x01, 0x40, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x11, 0x01, 0x80, 0x00, "English" }, - {0x11, 0x01, 0x80, 0x80, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x12, 0x01, 0x02, 0x00, "Upright" }, -// {0x12, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Credit Service" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x18, 0x00, "2 Coins/1 Credit, 6/4" }, - {0x12, 0x01, 0x18, 0x18, "1 Coin/1 Credit, 3/4" }, - {0x12, 0x01, 0x18, 0x10, "1 Coin/2 Credits, 2/6, 3/10" }, - {0x12, 0x01, 0x18, 0x08, "1 Coin/3 Credits, 3/12" }, - {0x12, 0x01, 0x18, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x18, 0x10, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x18, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0xe0, 0x00, "5 Coins/1 Credit, 15/4" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins/1 Credit, 12/4" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins/1 Credit, 9/4" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins/1 Credit, 6/4" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin/1 Credit, 3/4" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin/2 Credits, 2/6, 3/10" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin/3 Credits, 3/12" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xe0, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Rdaction) - -static struct BurnDIPInfo ArkareaDIPList[]= -{ - {0x11, 0xff, 0xff, 0xef, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x11, 0x01, 0x04, 0x04, "Off" }, -// {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 0, "Demo Sounds" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x20, 0x20, "Normal" }, - {0x11, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x40, 0x40, "50000 and every 50000" }, - {0x11, 0x01, 0x40, 0x00, "100000 and every 100000" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x11, 0x01, 0x80, 0x80, "3" }, - {0x11, 0x01, 0x80, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, -}; - -STDDIPINFO(Arkarea) - -static struct BurnDIPInfo RobokidDIPList[]= -{ - {0x11, 0xff, 0xff, 0xcf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x11, 0x01, 0x01, 0x01, "Off" }, -// {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x02, 0x02, "50000 and every 100000" }, - {0x11, 0x01, 0x02, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x04, 0x04, "Normal" }, - {0x11, 0x01, 0x04, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x11, 0x01, 0x10, 0x00, "Upright" }, -// {0x11, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0x80, "2" }, - {0x11, 0x01, 0xc0, 0xc0, "3" }, - {0x11, 0x01, 0xc0, 0x40, "4" }, - {0x11, 0x01, 0xc0, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x12, 0x01, 0xe0, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Robokid) - -static struct BurnDIPInfo RobokidjDIPList[]= -{ - {0x11, 0xff, 0xff, 0xcf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x11, 0x01, 0x01, 0x01, "Off" }, -// {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x02, 0x02, "30000 and every 50000" }, - {0x11, 0x01, 0x02, 0x00, "50000 and every 80000" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x04, 0x04, "Normal" }, - {0x11, 0x01, 0x04, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x11, 0x01, 0x10, 0x00, "Upright" }, -// {0x11, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0x80, "2" }, - {0x11, 0x01, 0xc0, 0xc0, "3" }, - {0x11, 0x01, 0xc0, 0x40, "4" }, - {0x11, 0x01, 0xc0, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x12, 0x01, 0xe0, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, -}; - -STDDIPINFOEXT(Robokidj, Robokid, Robokidj) - -static struct BurnDIPInfo OmegafDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x01, 0x01, "Off" }, -// {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x06, 0x00, "Easy" }, - {0x12, 0x01, 0x06, 0x06, "Normal" }, - {0x12, 0x01, 0x06, 0x02, "Hard" }, - {0x12, 0x01, 0x06, 0x04, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x40, "4" }, - {0x12, 0x01, 0xc0, 0x80, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x03, 0x00, "200000" }, - {0x13, 0x01, 0x03, 0x03, "300000" }, - {0x13, 0x01, 0x03, 0x01, "500000" }, - {0x13, 0x01, 0x03, 0x02, "1000000" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x1c, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0xe0, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Omegaf) - -static void DrvPaletteUpdate(INT32 offset) -{ - offset &= 0x7fe; - - INT32 p = (DrvPalRAM[offset+0] * 256) + DrvPalRAM[offset+1]; - - INT32 r = p >> 12; - INT32 g = (p >> 8) & 0xf; - INT32 b = (p >> 4) & 0xf; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[offset/2] = BurnHighCol(r,g,b,0); -} - -static void ninjakd2_bankswitch(INT32 data) -{ - INT32 nBank = 0x10000 + (data * 0x4000); - - nZ80RomBank = data; - - ZetMapMemory(DrvZ80ROM0 + nBank, 0x8000, 0xbfff, MAP_ROM); -} - -static void ninjakd2_bgconfig(INT32 sel, INT32 offset, UINT8 data) -{ - switch (offset & 0x07) - { - case 0: - scrollx[sel] = (scrollx[sel] & 0x700) + data; - return; - - case 1: - scrollx[sel] = (scrollx[sel] & 0x0ff) + ((data & 0x07) * 256); - return; - - case 2: - scrolly[sel] = (scrolly[sel] & 0x100) + data; - return; - - case 3: - scrolly[sel] = (scrolly[sel] & 0x0ff) + ((data & 0x01) * 256); - return; - - case 4: - tilemap_enable[sel] = data & 0x01; - return; - } -} - -static UINT8 __fastcall ninjakd2_main_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - case 0xc002: - case 0xdc00: - case 0xdc01: - case 0xdc02: - case 0xf800: - case 0xf801: - case 0xf802: - return DrvInputs[address & 3]; - - case 0xc003: - case 0xc004: - case 0xdc03: - case 0xdc04: - case 0xf803: - case 0xf804: - return DrvDips[(address & 7) - 3]; - } - - return 0; -} - -static void __fastcall ninjakd2_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xc800) { - DrvPalRAM[address & 0x7ff] = data; - DrvPaletteUpdate(address); - return; - } - - switch (address) - { - case 0xc200: - *soundlatch = data; - return; - - case 0xc201: - { - if (data & 0x10) - { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - - *flipscreen = data & 0x80; - } - return; - - case 0xc202: - ninjakd2_bankswitch(data & 0x07); - return; - - case 0xc203: - overdraw_enable = data & 0x01; - return; - - case 0xc208: - case 0xc209: - case 0xc20a: - case 0xc20b: - case 0xc20c: - ninjakd2_bgconfig(0, address, data); - return; - } -} - -static void __fastcall mnight_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xf000) { - DrvPalRAM[address & 0x7ff] = data; - DrvPaletteUpdate(address); - return; - } - - switch (address) - { - case 0xfa00: - *soundlatch = data; - return; - - case 0xfa01: - { - if (data & 0x10) - { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - - *flipscreen = data & 0x80; - } - return; - - case 0xfa02: - ninjakd2_bankswitch(data & 0x07); - return; - - case 0xfa03: - overdraw_enable = data & 0x01; - return; - - case 0xfa08: - case 0xfa09: - case 0xfa0a: - case 0xfa0b: - case 0xfa0c: - ninjakd2_bgconfig(0, address, data); - return; - } -} - -static void robokid_rambank(INT32 sel, UINT8 data) -{ - UINT8 *ram[3] = { DrvBgRAM0, DrvBgRAM1, DrvBgRAM2 }; - INT32 off[2][3] = { { 0xd800, 0xd400, 0xd000 }, { 0xc400, 0xc800, 0xcc00 } }; - - INT32 nBank = 0x400 * data; - - nZ80RamBank[sel&3] = data; - - ZetMapMemory(ram[sel&3] + nBank, off[sel>>2][sel&3], off[sel>>2][sel&3] | 0x3ff, MAP_RAM); -} - -static void __fastcall robokid_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xc000) { - DrvPalRAM[address & 0x7ff] = data; - DrvPaletteUpdate(address); - return; - } - - switch (address) - { - case 0xdc00: - *soundlatch = data; - return; - - case 0xdc01: - { - if (data & 0x10) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - - *flipscreen = data & 0x80; - } - return; - - case 0xdc02: - ninjakd2_bankswitch(data & 0x0f); - return; - - case 0xdc03: - overdraw_enable = data & 0x01; - return; - - case 0xdd00: - case 0xdd01: - case 0xdd02: - case 0xdd03: - case 0xdd04: - ninjakd2_bgconfig(0, address, data); - return; - - case 0xdd05: - robokid_rambank(0, data & 1); - return; - - case 0xde00: - case 0xde01: - case 0xde02: - case 0xde03: - case 0xde04: - ninjakd2_bgconfig(1, address, data); - return; - - case 0xde05: - robokid_rambank(1, data & 1); - return; - - case 0xdf00: - case 0xdf01: - case 0xdf02: - case 0xdf03: - case 0xdf04: - ninjakd2_bgconfig(2, address, data); - return; - - case 0xdf05: - robokid_rambank(2, data & 1); - return; - } -} - -// Copied directly from MAME -static UINT8 omegaf_protection_read(INT32 offset) -{ - UINT8 result = 0xff; - - switch (m_omegaf_io_protection[1] & 3) - { - case 0: - switch (offset) - { - case 1: - switch (m_omegaf_io_protection[0] & 0xe0) - { - case 0x00: - if (++m_omegaf_io_protection_tic & 1) - { - result = 0x00; - } - else - { - switch (m_omegaf_io_protection_input) - { - // first interrogation - // this happens just after setting mode 0. - // input is not explicitly loaded so could be anything - case 0x00: - result = 0x80 | 0x02; - break; - - // second interrogation - case 0x8c: - result = 0x80 | 0x1f; - break; - - // third interrogation - case 0x89: - result = 0x80 | 0x0b; - break; - } - } - break; - - case 0x20: - result = 0xc7; - break; - - case 0x60: - result = 0x00; - break; - - case 0x80: - result = 0x20 | (m_omegaf_io_protection_input & 0x1f); - break; - - case 0xc0: - result = 0x60 | (m_omegaf_io_protection_input & 0x1f); - break; - } - break; - } - break; - - case 1: // dip switches - switch (offset) - { - case 0: result = DrvDips[0]; break; - case 1: result = DrvDips[1]; break; - case 2: result = 0x02; break; - } - break; - - case 2: // player inputs - switch (offset) - { - case 0: result = DrvInputs[1]; break; - case 1: result = DrvInputs[2]; break; - case 2: result = 0x01; break; - } - break; - } - - return result; -} - -static UINT8 __fastcall omegaf_main_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return DrvInputs[0]; - - case 0xc001: - case 0xc002: - case 0xc003: - return omegaf_protection_read(address - 0xc001); - } - - return 0; -} - -static void __fastcall omegaf_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xd800) { - DrvPalRAM[address & 0x7ff] = data; - DrvPaletteUpdate(address); - return; - } - - switch (address) - { - case 0xc000: - *soundlatch = data; - return; - - case 0xc001: - { - if (data & 0x10) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - - *flipscreen = data & 0x80; - } - return; - - case 0xc002: - ninjakd2_bankswitch(data & 0x0f); - return; - - case 0xc003: - overdraw_enable = data & 0x01; - return; - - case 0xc004: - case 0xc005: - case 0xc006: - { - if (address == 0xc006 && (data & 1) && !(m_omegaf_io_protection[2] & 1)) - { - m_omegaf_io_protection_input = m_omegaf_io_protection[0]; - } - - m_omegaf_io_protection[address - 0xc004] = data; - } - return; - - case 0xc100: - case 0xc101: - case 0xc102: - case 0xc103: - case 0xc104: - ninjakd2_bgconfig(0, address, data); - return; - - case 0xc105: - robokid_rambank(4|0, data & 7); - return; - - case 0xc200: - case 0xc201: - case 0xc202: - case 0xc203: - case 0xc204: - ninjakd2_bgconfig(1, address, data); - return; - - case 0xc205: - robokid_rambank(4|1, data & 7); - return; - - case 0xc300: - case 0xc301: - case 0xc302: - case 0xc303: - case 0xc304: - ninjakd2_bgconfig(2, address, data); - return; - - case 0xc305: - robokid_rambank(4|2, data & 7); - return; - } -} - -static void ninjakd2_sample_player(INT16 *dest, INT32 len) -{ - if (ninjakd2_sample_offset == -1) return; - - for (INT32 i = 0; i < len; i++) - { - UINT16 ofst = ninjakd2_sample_offset + ((i * 271) / len); - - if (DrvSndROM[ofst] == 0) { - ninjakd2_sample_offset = -1; - break; - } - - INT32 sample = BURN_SND_CLIP(((DrvSndROM[ofst]<<7) * 45) / 100); - - dest[i*2+0] = BURN_SND_CLIP(dest[i*2+0]+sample); - dest[i*2+1] = BURN_SND_CLIP(dest[i*2+1]+sample); - } - - if (ninjakd2_sample_offset != -1) - ninjakd2_sample_offset += 271; -} - -static void __fastcall ninjakd2_sound_write(UINT16 address, UINT8 data) -{ - data = data; - - switch (address) - { - case 0xf000: - ninjakd2_sample_offset = data << 8; - return; - } -} - -static UINT8 __fastcall ninjakd2_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - return *soundlatch; - } - - return 0; -} - -static void __fastcall ninjakd2_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x80: - case 0x81: - BurnYM2203Write((port >> 7) & 1, port & 1, data); - return; - } -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 5000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 5000000.0; -} - -static void ninjakd2_sound_init() -{ - ZetInit(1); - ZetOpen(1); - -// ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM1 + 0x10000, DrvZ80ROM1); - - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetSetOutHandler(ninjakd2_sound_write_port); - ZetSetWriteHandler(ninjakd2_sound_write); - ZetSetReadHandler(ninjakd2_sound_read); - ZetClose(); - - BurnYM2203Init(2, 1500000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(5000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.10, BURN_SND_ROUTE_BOTH); -} - -static INT32 DrvDoReset() -{ - memset(AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - BurnYM2203Reset(); - ZetClose(); - - memset (scrollx, 0, 3 * sizeof(UINT16)); - memset (scrolly, 0, 3 * sizeof(UINT16)); - - nZ80RomBank = 0; - memset (nZ80RamBank, 0, 3); - - overdraw_enable = 0; - memset (tilemap_enable, 0, 3); - - memset (m_omegaf_io_protection, 0, 3); - m_omegaf_io_protection_input = 0; - m_omegaf_io_protection_tic = 0; - - ninjakd2_sample_offset = -1; - - previous_coin[0] = previous_coin[1] = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x050000; - DrvZ80ROM1 = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROM3 = Next; Next += 0x100000; - DrvGfxROM4 = Next; Next += 0x100000; - - DrvZ80Key = Next; Next += 0x002000; - - DrvSndROM = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001a00; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000600; - DrvPalRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x000800; - DrvBgRAM0 = Next; - DrvBgRAM = Next; Next += 0x002000; - DrvBgRAM1 = Next; Next += 0x002000; - DrvBgRAM2 = Next; Next += 0x002000; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - pSpriteDraw = (UINT16*)Next; Next += 256 * 256 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(UINT8 *rom, INT32 len, INT32 type) -{ - INT32 Plane[4] = { STEP4(0,1) }; - INT32 XOffs0[16] = { STEP8(0,4), STEP8(32*8,4) }; - INT32 XOffs1[16] = { STEP8(0,4), STEP8(64*8,4) }; - INT32 YOffs0[16] = { STEP8(0,32), STEP8(64*8,32) }; - INT32 YOffs1[16] = { STEP16(0,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, rom, len); - - switch (type) - { - case 0: - GfxDecode((len * 2) / ( 8 * 8), 4, 8, 8, Plane, XOffs0, YOffs0, 0x100, tmp, rom); - break; - - case 1: - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Plane, XOffs0, YOffs0, 0x400, tmp, rom); - break; - - case 2: - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Plane, XOffs1, YOffs1, 0x400, tmp, rom); - break; - } - - BurnFree (tmp); - - return 0; -} - -static void lineswap_gfx_roms(UINT8 *rom, INT32 len, const INT32 bit) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(len); - - const INT32 mask = (1 << (bit + 1)) - 1; - - for (INT32 sa = 0; sa < len; sa++) - { - const INT32 da = (sa & ~mask) | ((sa << 1) & mask) | ((sa >> bit) & 1); - tmp[da] = rom[sa]; - } - - memcpy (rom, tmp, len); - - BurnFree (tmp); -} - -static void gfx_unscramble(INT32 gfxlen) -{ - lineswap_gfx_roms(DrvGfxROM0, 0x08000, 13); - lineswap_gfx_roms(DrvGfxROM1, gfxlen, 14); - lineswap_gfx_roms(DrvGfxROM2, gfxlen, 14); -} - -static INT32 Ninjakd2CommonInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x18000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x28000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 11, 1)) return 1; - - gfx_unscramble(0x20000); - DrvGfxDecode(DrvGfxROM0, 0x08000, 0); - DrvGfxDecode(DrvGfxROM1, 0x20000, 1); - DrvGfxDecode(DrvGfxROM2, 0x20000, 1); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80ROM0 + 0x10000, 0x8000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvPalRAM, 0xc800, 0xcdff, MAP_ROM); - ZetMapMemory(DrvFgRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xe000, 0xf9ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xfa00, 0xffff, MAP_RAM); - ZetSetWriteHandler(ninjakd2_main_write); - ZetSetReadHandler(ninjakd2_main_read); - ZetClose(); - - ninjakd2_sound_init(); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 Ninjakd2Init() -{ - INT32 nRet = Ninjakd2CommonInit(); - - if (nRet == 0) - { - if (BurnLoadRom(DrvZ80Key + 0x00000, 12, 1)) return 1; - - mc8123_decrypt_rom(0, 0, DrvZ80ROM1, DrvZ80ROM1 + 0x10000, DrvZ80Key); - } - - return nRet; -} - -static INT32 Ninjakd2DecryptedInit() -{ - INT32 nRet = Ninjakd2CommonInit(); - - if (nRet == 0) - { - memcpy (DrvZ80ROM1 + 0x10000, DrvZ80ROM1, 0x10000); - memcpy (DrvZ80ROM1, DrvZ80ROM1 + 0x08000, 0x08000); - } - - return nRet; -} - -static INT32 MnightInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x18000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x28000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 5, 1)) return 1; - memcpy (DrvZ80ROM1 + 0x10000, DrvZ80ROM1, 0x10000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 9, 1)) return 1; - memcpy (DrvGfxROM1 + 0x30000, DrvGfxROM1 + 0x20000, 0x10000); - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 12, 1)) return 1; - memcpy (DrvGfxROM1 + 0x30000, DrvGfxROM1 + 0x20000, 0x10000); - - gfx_unscramble(0x40000); - DrvGfxDecode(DrvGfxROM0, 0x08000, 0); - DrvGfxDecode(DrvGfxROM1, 0x40000, 1); - DrvGfxDecode(DrvGfxROM2, 0x40000, 1); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80ROM0 + 0x10000, 0x8000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xd9ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xda00, 0xdfff, MAP_RAM); - ZetMapMemory(DrvBgRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvFgRAM, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xf000, 0xf5ff, MAP_ROM); - ZetSetWriteHandler(mnight_main_write); - ZetSetReadHandler(ninjakd2_main_read); - ZetClose(); - - ninjakd2_sound_init(); - BurnYM2203SetPSGVolume(0, 0.05); - BurnYM2203SetPSGVolume(1, 0.05); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 RobokidInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x30000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x40000, 3, 1)) return 1; - memcpy (DrvZ80ROM0, DrvZ80ROM0 + 0x10000, 0x10000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x10000, 4, 1)) return 1; - memcpy (DrvZ80ROM1, DrvZ80ROM1 + 0x10000, 0x10000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x50000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 16, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x10000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x30000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x40000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x50000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x60000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x70000, 24, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x00000, 25, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x10000, 26, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x20000, 27, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x30000, 28, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x40000, 29, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x50000, 30, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x08000, 0); - DrvGfxDecode(DrvGfxROM1, 0x40000, 2); - DrvGfxDecode(DrvGfxROM2, 0x80000, 2); - DrvGfxDecode(DrvGfxROM3, 0x80000, 2); - DrvGfxDecode(DrvGfxROM4, 0x80000, 2); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80ROM0 + 0x10000, 0x8000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvPalRAM, 0xc000, 0xc7ff, MAP_ROM); - ZetMapMemory(DrvFgRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvBgRAM2, 0xd000, 0xd3ff, MAP_RAM); - ZetMapMemory(DrvBgRAM1, 0xd400, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgRAM0, 0xd800, 0xdbff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xe000, 0xf9ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xfa00, 0xffff, MAP_RAM); - ZetSetWriteHandler(robokid_main_write); - ZetSetReadHandler(ninjakd2_main_read); - ZetClose(); - - ninjakd2_sound_init(); - BurnYM2203SetPSGVolume(0, 0.03); - BurnYM2203SetPSGVolume(1, 0.03); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 OmegafInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x30000, 1, 1)) return 1; - memcpy (DrvZ80ROM0, DrvZ80ROM0 + 0x10000, 0x10000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x10000, 2, 1)) return 1; - memcpy (DrvZ80ROM1, DrvZ80ROM1 + 0x10000, 0x10000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x00000, 7, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x08000, 0); - DrvGfxDecode(DrvGfxROM1, 0x20000, 2); - DrvGfxDecode(DrvGfxROM2, 0x80000, 2); - DrvGfxDecode(DrvGfxROM3, 0x80000, 2); - DrvGfxDecode(DrvGfxROM4, 0x80000, 2); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80ROM0 + 0x10000, 0x8000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgRAM0, 0xc400, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvBgRAM1, 0xc800, 0xcbff, MAP_RAM); - ZetMapMemory(DrvBgRAM2, 0xcc00, 0xcfff, MAP_RAM); - ZetMapMemory(DrvFgRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd800, 0xdfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xe000, 0xf9ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xfa00, 0xffff, MAP_RAM); - ZetSetWriteHandler(omegaf_main_write); - ZetSetReadHandler(omegaf_main_read); - ZetClose(); - - ninjakd2_sound_init(); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2203Exit(); - - GenericTilesExit(); - - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvCalculatePalette() -{ - for (INT32 i = 0; i < 0x800; i+=2) - { - DrvPaletteUpdate(i); - } -} - -static void draw_bg_layer() -{ - INT32 xscroll = (scrollx[0] + 0) & 0x1ff; - INT32 yscroll = (scrolly[0] + 32) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 16; - INT32 sy = (offs / 0x20) * 16; - - sx -= xscroll; - if (sx < -15) sx += 512; - sy -= yscroll; - if (sy < -15) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvBgRAM[offs*2+1]; - INT32 code = DrvBgRAM[offs*2+0] + ((attr & 0xc0) << 2); - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - INT32 color = attr & 0x0f; - - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } - } - } -} - -static void draw_mnight_bg_layer() -{ - INT32 xscroll = (scrollx[0] + 0) & 0x1ff; - INT32 yscroll = (scrolly[0] + 32) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 16; - INT32 sy = (offs / 0x20) * 16; - - sx -= xscroll; - if (sx < -15) sx += 512; - sy -= yscroll; - if (sy < -15) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvBgRAM[offs*2+1]; - INT32 code = DrvBgRAM[offs*2+0] + ((attr & 0xc0) << 2) + ((attr & 0x10) << 6); - INT32 flipx = 0; - INT32 flipy = attr & 0x20; - INT32 color = attr & 0x0f; - - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } - } - } -} - -static void draw_robokid_bg_layer(INT32 sel, UINT8 *ram, UINT8 *rom, INT32 width, INT32 transp) -{ - if (tilemap_enable[sel] == 0) return; - - INT32 wide = (width) ? 128 : 32; - INT32 xscroll = scrollx[sel] & ((wide * 16) - 1); - INT32 yscroll = (scrolly[sel] + 32) & 0x1ff; - - for (INT32 offs = 0; offs < wide * 32; offs++) - { - INT32 sx = (offs % wide); - INT32 sy = (offs / wide); - - INT32 ofst = (sx & 0x0f) + (sy * 16) + ((sx & 0x70) * 0x20); - - sx = (sx * 16) - xscroll; - if (sx < -15) sx += wide * 16; - sy = (sy * 16) - yscroll; - if (sy < -15) sy += 32 * 16; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = ram[ofst * 2 + 1]; - INT32 code = ram[ofst * 2 + 0] + ((attr & 0x10) << 7) + ((attr & 0x20) << 5) + ((attr & 0xc0) << 2); - INT32 color = attr & 0x0f; - - if (transp) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0, rom); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, rom); - } - } -} - -static void draw_fg_layer(INT32 color_offset) -{ - for (INT32 offs = (32 * 4); offs < (32 * 32) - (32 * 4); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvFgRAM[offs*2+1]; - INT32 code = DrvFgRAM[offs*2+0] + ((attr & 0xc0) << 2); - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - INT32 color = attr & 0x0f; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 32, color, 4, 0xf, color_offset, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 32, color, 4, 0xf, color_offset, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 32, color, 4, 0xf, color_offset, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 32, color, 4, 0xf, color_offset, DrvGfxROM0); - } - } - } -} - -static void draw_sprites(INT32 color_offset, INT32 robokid) -{ - int const big_xshift = robokid ? 1 : 0; - int const big_yshift = robokid ? 0 : 1; - - UINT8* sprptr = DrvSprRAM + 11; - int sprites_drawn = 0; - - while (1) - { - if (sprptr[2] & 0x02) - { - int sx = sprptr[1] - ((sprptr[2] & 0x01) << 8); - int sy = sprptr[0]; - - int code = sprptr[3] + ((sprptr[2] & 0xc0) << 2) + ((sprptr[2] & 0x08) << 7); - int flipx = (sprptr[2] & 0x10) >> 4; - int flipy = (sprptr[2] & 0x20) >> 5; - int const color = sprptr[4] & 0x0f; - - int const big = (sprptr[2] & 0x04) >> 2; - - if (*flipscreen) - { - sx = 240 - 16*big - sx; - sy = 240 - 16*big - sy; - flipx ^= 1; - flipy ^= 1; - } - - if (big) - { - code &= ~3; - code ^= flipx << big_xshift; - code ^= flipy << big_yshift; - } - - for (int y = 0; y <= big; ++y) - { - for (int x = 0; x <= big; ++x) - { - int const tile = code ^ (x << big_xshift) ^ (y << big_yshift); - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pSpriteDraw, tile, sx + 16*x, (sy + 16*y) - 32, color, 4, 0xf, color_offset, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pSpriteDraw, tile, sx + 16*x, (sy + 16*y) - 32, color, 4, 0xf, color_offset, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pSpriteDraw, tile, sx + 16*x, (sy + 16*y) - 32, color, 4, 0xf, color_offset, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pSpriteDraw, tile, sx + 16*x, (sy + 16*y) - 32, color, 4, 0xf, color_offset, DrvGfxROM1); - } - } - - ++sprites_drawn; - - if (sprites_drawn >= 96) - break; - } - } - } - else - { - ++sprites_drawn; - - if (sprites_drawn >= 96) - break; - } - - sprptr += 16; - } -} - -static void draw_copy_sprites() -{ - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - if (pSpriteDraw[i] != 0x000f) pTransDraw[i] = pSpriteDraw[i]; - } -} - -static INT32 Ninjakd2Draw() -{ - if (DrvRecalc) { - DrvCalculatePalette(); - DrvRecalc = 0; - } - - if (overdraw_enable) { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - if ((pSpriteDraw[i] & 0x00f0) == 0x00f0) pSpriteDraw[i] = 0x000f; - } - } else { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pSpriteDraw[i] = 0x000f; - } - } - - draw_sprites(0x100, 0); - - if (tilemap_enable[0] == 0) - BurnTransferClear(); - - if (tilemap_enable[0]) - draw_bg_layer(); - - draw_copy_sprites(); - - draw_fg_layer(0x200); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 MnightDraw() -{ - if (DrvRecalc) { - DrvCalculatePalette(); - DrvRecalc = 0; - } - - if (overdraw_enable) { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - if ((pSpriteDraw[i] & 0x00f0) == 0x00f0) pSpriteDraw[i] = 0x000f; - } - } else { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pSpriteDraw[i] = 0x000f; - } - } - - draw_sprites(0x100, 0); - - if (tilemap_enable[0] == 0) - BurnTransferClear(); - - if (tilemap_enable[0]) - draw_mnight_bg_layer(); - - draw_copy_sprites(); - - draw_fg_layer(0x200); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 RobokidDraw() -{ - if (DrvRecalc) { - DrvCalculatePalette(); - DrvRecalc = 0; - } - - if (overdraw_enable) { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - if ((pSpriteDraw[i] & 0x00f0) < 0x00e0) pSpriteDraw[i] = 0x000f; - } - } else { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pSpriteDraw[i] = 0x000f; - } - } - - draw_sprites(0x200, 1); - - if (tilemap_enable[0] == 0) - BurnTransferClear(); - - draw_robokid_bg_layer(0, DrvBgRAM0, DrvGfxROM2, 0, 0); - - draw_robokid_bg_layer(1, DrvBgRAM1, DrvGfxROM3, 0, 1); - - draw_copy_sprites(); - - draw_robokid_bg_layer(2, DrvBgRAM2, DrvGfxROM4, 0, 1); - - draw_fg_layer(0x300); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 OmegafDraw() -{ - if (DrvRecalc) { - DrvCalculatePalette(); - DrvRecalc = 0; - } - - if (overdraw_enable) { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pSpriteDraw[i] = 0x000f; // no enable?? - } - } else { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pSpriteDraw[i] = 0x000f; - } - } - - draw_sprites(0x200, 1); - - BurnTransferClear(); - - draw_robokid_bg_layer(0, DrvBgRAM0, DrvGfxROM2, 1, 1); - draw_robokid_bg_layer(1, DrvBgRAM1, DrvGfxROM3, 1, 1); - draw_robokid_bg_layer(2, DrvBgRAM2, DrvGfxROM4, 1, 1); - - draw_copy_sprites(); - - draw_fg_layer(0x300); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ // for active LOW - if ((*nJoystickInputs & 0x03) == 0x00) { - *nJoystickInputs |= 0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x00) { - *nJoystickInputs |= 0x0c; - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvClearOpposites(&DrvInputs[1]); - DrvClearOpposites(&DrvInputs[2]); - - previous_coin[0] = (DrvInputs[0] & 0x40) ? 0 : (previous_coin[0] + 1); - previous_coin[1] = (DrvInputs[0] & 0x80) ? 0 : (previous_coin[1] + 1); - if (previous_coin[0] >= 4) DrvInputs[0] |= 0x40; - if (previous_coin[1] >= 4) DrvInputs[0] |= 0x80; - } - - ZetNewFrame(); - - INT32 nCycleSegment; - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 6000000 / 60, 5000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCycleSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCycleSegment); - - if (i == (nInterleave-1)) - { - ZetSetVector(0xd7); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - ZetClose(); - - nCycleSegment = nCyclesTotal[1] / nInterleave; - - ZetOpen(1); - // nCyclesDone[1] += ZetRun(nCycleSegment); - BurnTimerUpdate((i + 1) * nCycleSegment); - ZetClose(); - } - - ZetOpen(1); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ninjakd2_sample_player(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - for (INT32 i = 0; i < 3; i++) { - SCAN_VAR(scrollx[i]); - SCAN_VAR(scrolly[i]); - SCAN_VAR(tilemap_enable[i]); - SCAN_VAR(m_omegaf_io_protection[i]); - SCAN_VAR(nZ80RamBank[i]); - } - - SCAN_VAR(nZ80RomBank); - - SCAN_VAR(overdraw_enable); - SCAN_VAR(m_omegaf_io_protection_input); - SCAN_VAR(m_omegaf_io_protection_tic); - - SCAN_VAR(ninjakd2_sample_offset); - } - - if (nAction & ACB_WRITE) { - DrvRecalc = 1; - - ZetOpen(0); - ninjakd2_bankswitch(nZ80RomBank); - ZetClose(); - - } - - return 0; -} - -static INT32 RobokidScan(INT32 nAction, INT32 *pnMin) -{ - INT32 nRet = DrvScan(nAction, pnMin); - - if (nRet == 0) - { - ZetOpen(0); - robokid_rambank(0, nZ80RamBank[0]); - robokid_rambank(1, nZ80RamBank[1]); - robokid_rambank(2, nZ80RamBank[2]); - ZetClose(); - } - - return nRet; -} - -static INT32 OmegafScan(INT32 nAction, INT32 *pnMin) -{ - INT32 nRet = DrvScan(nAction, pnMin); - - if (nRet == 0) - { - ZetOpen(0); - robokid_rambank(4|0, nZ80RamBank[0]); - robokid_rambank(4|1, nZ80RamBank[1]); - robokid_rambank(4|2, nZ80RamBank[2]); - ZetClose(); - } - - return nRet; -} - - - -// Ninja-Kid II / NinjaKun Ashura no Shou (set 1) - -static struct BurnRomInfo ninjakd2RomDesc[] = { - { "nk2_01.rom", 0x08000, 0x3cdbb906, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "nk2_02.rom", 0x08000, 0xb5ce9a1a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "nk2_03.rom", 0x08000, 0xad275654, 1 | BRF_PRG | BRF_ESS }, // 2 - { "nk2_04.rom", 0x08000, 0xe7692a77, 1 | BRF_PRG | BRF_ESS }, // 3 - { "nk2_05.rom", 0x08000, 0x5dac9426, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "nk2_06.rom", 0x10000, 0xd3a18a79, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code (mc8123 encrypted) - - { "nk2_12.rom", 0x08000, 0xdb5657a9, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "nk2_08.rom", 0x10000, 0x1b79c50a, 4 | BRF_GRA }, // 7 Sprite Tiles - { "nk2_07.rom", 0x10000, 0x0be5cd13, 4 | BRF_GRA }, // 8 - - { "nk2_11.rom", 0x10000, 0x41a714b3, 5 | BRF_GRA }, // 9 Background Tiles - { "nk2_10.rom", 0x10000, 0xc913c4ab, 5 | BRF_GRA }, // 10 - - { "nk2_09.rom", 0x10000, 0xc1d2d170, 6 | BRF_GRA }, // 11 Samples (8 bit unsigned) - - { "ninjakd2.key", 0x02000, 0xec25318f, 7 | BRF_PRG | BRF_ESS }, // 12 mc8123 key -}; - -STD_ROM_PICK(ninjakd2) -STD_ROM_FN(ninjakd2) - -struct BurnDriver BurnDrvNinjakd2 = { - "ninjakd2", NULL, NULL, NULL, "1987", - "Ninja-Kid II / NinjaKun Ashura no Shou (set 1)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, ninjakd2RomInfo, ninjakd2RomName, NULL, NULL, DrvInputInfo, Ninjakd2DIPInfo, - Ninjakd2Init, DrvExit, DrvFrame, Ninjakd2Draw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - - -// Ninja-Kid II / NinjaKun Ashura no Shou (set 2, bootleg?) - -static struct BurnRomInfo ninjakd2aRomDesc[] = { - { "nk2_01.bin", 0x08000, 0xe6adca65, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "nk2_02.bin", 0x08000, 0xd9284bd1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "nk2_03.rom", 0x08000, 0xad275654, 1 | BRF_PRG | BRF_ESS }, // 2 - { "nk2_04.rom", 0x08000, 0xe7692a77, 1 | BRF_PRG | BRF_ESS }, // 3 - { "nk2_05.bin", 0x08000, 0x960725fb, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "nk2_06.bin", 0x10000, 0x7bfe6c9e, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "nk2_12.rom", 0x08000, 0xdb5657a9, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "nk2_08.rom", 0x10000, 0x1b79c50a, 4 | BRF_GRA }, // 7 Sprite Tiles - { "nk2_07.rom", 0x10000, 0x0be5cd13, 4 | BRF_GRA }, // 8 - - { "nk2_11.rom", 0x10000, 0x41a714b3, 5 | BRF_GRA }, // 9 Background Tiles - { "nk2_10.rom", 0x10000, 0xc913c4ab, 5 | BRF_GRA }, // 10 - - { "nk2_09.rom", 0x10000, 0xc1d2d170, 6 | BRF_GRA }, // 11 Samples (8 bit unsigned) -}; - -STD_ROM_PICK(ninjakd2a) -STD_ROM_FN(ninjakd2a) - -struct BurnDriver BurnDrvNinjakd2a = { - "ninjakd2a", "ninjakd2", NULL, NULL, "1987", - "Ninja-Kid II / NinjaKun Ashura no Shou (set 2, bootleg?)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, ninjakd2aRomInfo, ninjakd2aRomName, NULL, NULL, DrvInputInfo, Ninjakd2DIPInfo, - Ninjakd2DecryptedInit, DrvExit, DrvFrame, Ninjakd2Draw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - - -// Ninja-Kid II / NinjaKun Ashura no Shou (set 3, bootleg?) - -static struct BurnRomInfo ninjakd2bRomDesc[] = { - { "1.3s", 0x08000, 0xcb4f4624, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.3q", 0x08000, 0x0ad0c100, 1 | BRF_PRG | BRF_ESS }, // 1 - { "nk2_03.rom", 0x08000, 0xad275654, 1 | BRF_PRG | BRF_ESS }, // 2 - { "nk2_04.rom", 0x08000, 0xe7692a77, 1 | BRF_PRG | BRF_ESS }, // 3 - { "nk2_05.rom", 0x08000, 0x5dac9426, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "nk2_06.bin", 0x10000, 0x7bfe6c9e, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "nk2_12.rom", 0x08000, 0xdb5657a9, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "nk2_08.rom", 0x10000, 0x1b79c50a, 4 | BRF_GRA }, // 7 Sprite Tiles - { "nk2_07.rom", 0x10000, 0x0be5cd13, 4 | BRF_GRA }, // 8 - - { "nk2_11.rom", 0x10000, 0x41a714b3, 5 | BRF_GRA }, // 9 Background Tiles - { "nk2_10.rom", 0x10000, 0xc913c4ab, 5 | BRF_GRA }, // 10 - - { "nk2_09.rom", 0x10000, 0xc1d2d170, 6 | BRF_GRA }, // 11 Samples (8 bit unsigned) -}; - -STD_ROM_PICK(ninjakd2b) -STD_ROM_FN(ninjakd2b) - -struct BurnDriver BurnDrvNinjakd2b = { - "ninjakd2b", "ninjakd2", NULL, NULL, "1987", - "Ninja-Kid II / NinjaKun Ashura no Shou (set 3, bootleg?)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, ninjakd2bRomInfo, ninjakd2bRomName, NULL, NULL, DrvInputInfo, RdactionDIPInfo, - Ninjakd2DecryptedInit, DrvExit, DrvFrame, Ninjakd2Draw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - - -// Ninja-Kid II / NinjaKun Ashura no Shou (set 4) -// close to set 3 - -static struct BurnRomInfo ninjakd2cRomDesc[] = { - { "1.3U", 0x08000, 0x06096412, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.3T", 0x08000, 0x9ed9a994, 1 | BRF_PRG | BRF_ESS }, // 1 - { "nk2_03.rom", 0x08000, 0xad275654, 1 | BRF_PRG | BRF_ESS }, // 2 - { "nk2_04.rom", 0x08000, 0xe7692a77, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.3M", 0x08000, 0x800d4951, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "nk2_06.rom", 0x10000, 0xd3a18a79, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code (mc8123 encrypted) - - { "nk2_12.rom", 0x08000, 0xdb5657a9, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "nk2_08.rom", 0x10000, 0x1b79c50a, 4 | BRF_GRA }, // 7 Sprite Tiles - { "nk2_07.rom", 0x10000, 0x0be5cd13, 4 | BRF_GRA }, // 8 - - { "nk2_11.rom", 0x10000, 0x41a714b3, 5 | BRF_GRA }, // 9 Background Tiles - { "nk2_10.rom", 0x10000, 0xc913c4ab, 5 | BRF_GRA }, // 10 - - { "nk2_09.rom", 0x10000, 0xc1d2d170, 6 | BRF_GRA }, // 11 Samples (8 bit unsigned) - - { "ninjakd2.key", 0x02000, 0xec25318f, 7 | BRF_PRG | BRF_ESS }, // 12 mc8123 key -}; - -STD_ROM_PICK(ninjakd2c) -STD_ROM_FN(ninjakd2c) - -struct BurnDriver BurnDrvNinjakd2c = { - "ninjakd2c", "ninjakd2", NULL, NULL, "1987", - "Ninja-Kid II / NinjaKun Ashura no Shou (set 4)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, ninjakd2cRomInfo, ninjakd2cRomName, NULL, NULL, DrvInputInfo, RdactionDIPInfo, - Ninjakd2Init, DrvExit, DrvFrame, Ninjakd2Draw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - - -// Rad Action / NinjaKun Ashura no Shou - -static struct BurnRomInfo rdactionRomDesc[] = { - { "1.3u", 0x08000, 0x5c475611, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.3s", 0x08000, 0xa1e23bd2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "nk2_03.rom", 0x08000, 0xad275654, 1 | BRF_PRG | BRF_ESS }, // 2 - { "nk2_04.rom", 0x08000, 0xe7692a77, 1 | BRF_PRG | BRF_ESS }, // 3 - { "nk2_05.bin", 0x08000, 0x960725fb, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "nk2_06.rom", 0x10000, 0xd3a18a79, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code (mc8123 encrypted) - - { "12.5n", 0x08000, 0x0936b365, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "nk2_08.rom", 0x10000, 0x1b79c50a, 4 | BRF_GRA }, // 7 Sprite Tiles - { "nk2_07.rom", 0x10000, 0x0be5cd13, 4 | BRF_GRA }, // 8 - - { "nk2_11.rom", 0x10000, 0x41a714b3, 5 | BRF_GRA }, // 9 Background Tiles - { "nk2_10.rom", 0x10000, 0xc913c4ab, 5 | BRF_GRA }, // 10 - - { "nk2_09.rom", 0x10000, 0xc1d2d170, 6 | BRF_GRA }, // 11 Samples (8 bit unsigned) - - { "ninjakd2.key", 0x02000, 0xec25318f, 7 | BRF_PRG | BRF_ESS }, // 12 mc8123 key -}; - -STD_ROM_PICK(rdaction) -STD_ROM_FN(rdaction) - -struct BurnDriver BurnDrvRdaction = { - "rdaction", "ninjakd2", NULL, NULL, "1987", - "Rad Action / NinjaKun Ashura no Shou\0", NULL, "UPL (World Games license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, rdactionRomInfo, rdactionRomName, NULL, NULL, DrvInputInfo, RdactionDIPInfo, - Ninjakd2Init, DrvExit, DrvFrame, Ninjakd2Draw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - - -// JT-104 (title screen modification of Rad Action) -// identical to rdaction set with different gfx rom and decrypted sound rom - -static struct BurnRomInfo jt104RomDesc[] = { - { "1.3u", 0x08000, 0x5c475611, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.3s", 0x08000, 0xa1e23bd2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "nk2_03.rom", 0x08000, 0xad275654, 1 | BRF_PRG | BRF_ESS }, // 2 - { "nk2_04.rom", 0x08000, 0xe7692a77, 1 | BRF_PRG | BRF_ESS }, // 3 - { "nk2_05.bin", 0x08000, 0x960725fb, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "nk2_06.bin", 0x10000, 0x7bfe6c9e, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "jt_104_12.bin", 0x08000, 0xc038fadb, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "nk2_08.rom", 0x10000, 0x1b79c50a, 4 | BRF_GRA }, // 7 Sprite Tiles - { "nk2_07.rom", 0x10000, 0x0be5cd13, 4 | BRF_GRA }, // 8 - - { "nk2_11.rom", 0x10000, 0x41a714b3, 5 | BRF_GRA }, // 9 Background Tiles - { "nk2_10.rom", 0x10000, 0xc913c4ab, 5 | BRF_GRA }, // 10 - - { "nk2_09.rom", 0x10000, 0xc1d2d170, 6 | BRF_GRA }, // 11 Samples (8 bit unsigned) - - { "ninjakd2.key", 0x02000, 0xec25318f, 7 | BRF_PRG | BRF_ESS }, // 12 mc8123 key -}; - -STD_ROM_PICK(jt104) -STD_ROM_FN(jt104) - -struct BurnDriver BurnDrvJt104 = { - "jt104", "ninjakd2", NULL, NULL, "1987", - "JT-104 (title screen modification of Rad Action)\0", NULL, "UPL (United Amusements license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, jt104RomInfo, jt104RomName, NULL, NULL, DrvInputInfo, RdactionDIPInfo, - Ninjakd2DecryptedInit, DrvExit, DrvFrame, Ninjakd2Draw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - - -// Mutant Night - -static struct BurnRomInfo mnightRomDesc[] = { - { "1.j19", 0x08000, 0x56678d14, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.j17", 0x08000, 0x2a73f88e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.j16", 0x08000, 0xc5e42bb4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.j14", 0x08000, 0xdf6a4f7a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.j12", 0x08000, 0x9c391d1b, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "6.j7", 0x10000, 0xa0782a31, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "13.b10", 0x08000, 0x8c177a19, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "9.e11", 0x10000, 0x4883059c, 4 | BRF_GRA }, // 7 Sprite Tiles - { "8.e12", 0x10000, 0x02b91445, 4 | BRF_GRA }, // 8 - { "7.e14", 0x10000, 0x9f08d160, 4 | BRF_GRA }, // 9 - - { "12.b20", 0x10000, 0x4d37e0f4, 5 | BRF_GRA }, // 10 Background Tiles - { "11.b22", 0x10000, 0xb22cbbd3, 5 | BRF_GRA }, // 11 - { "10.b23", 0x10000, 0x65714070, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(mnight) -STD_ROM_FN(mnight) - -struct BurnDriver BurnDrvMnight = { - "mnight", NULL, NULL, NULL, "1987", - "Mutant Night\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, mnightRomInfo, mnightRomName, NULL, NULL, DrvInputInfo, MnightDIPInfo, - MnightInit, DrvExit, DrvFrame, MnightDraw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - - -// Mutant Night (Japan) - -static struct BurnRomInfo mnightjRomDesc[] = { - { "1.j19", 0x08000, 0x56678d14, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.j17", 0x08000, 0x2a73f88e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.j16", 0x08000, 0xc5e42bb4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.j14", 0x08000, 0xdf6a4f7a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.j12", 0x08000, 0x9c391d1b, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "6.j7", 0x10000, 0xa0782a31, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "13.b10", 0x08000, 0x37b8221f, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "9.e11", 0x10000, 0x4883059c, 4 | BRF_GRA }, // 7 Sprite Tiles - { "8.e12", 0x10000, 0x02b91445, 4 | BRF_GRA }, // 8 - { "7.e14", 0x10000, 0x9f08d160, 4 | BRF_GRA }, // 9 - - { "12.b20", 0x10000, 0x4d37e0f4, 5 | BRF_GRA }, // 10 Background Tiles - { "11.b22", 0x10000, 0xb22cbbd3, 5 | BRF_GRA }, // 11 - { "10.b23", 0x10000, 0x65714070, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(mnightj) -STD_ROM_FN(mnightj) - -struct BurnDriver BurnDrvMnightj = { - "mnightj", "mnight", NULL, NULL, "1987", - "Mutant Night (Japan)\0", NULL, "UPL (Kawakus license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, mnightjRomInfo, mnightjRomName, NULL, NULL, DrvInputInfo, MnightDIPInfo, - MnightInit, DrvExit, DrvFrame, MnightDraw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - - -// Ark Area - -static struct BurnRomInfo arkareaRomDesc[] = { - { "arkarea.008", 0x08000, 0x1ce1b5b9, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "arkarea.009", 0x08000, 0xdb1c81d1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "arkarea.010", 0x08000, 0x5a460dae, 1 | BRF_PRG | BRF_ESS }, // 2 - { "arkarea.011", 0x08000, 0x63f022c9, 1 | BRF_PRG | BRF_ESS }, // 3 - { "arkarea.012", 0x08000, 0x3c4c65d5, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "arkarea.013", 0x08000, 0x2d409d58, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "arkarea.004", 0x08000, 0x69e36af2, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "arkarea.007", 0x10000, 0xd5684a27, 4 | BRF_GRA }, // 7 Sprite Tiles - { "arkarea.006", 0x10000, 0x2c0567d6, 4 | BRF_GRA }, // 8 - { "arkarea.005", 0x10000, 0x9886004d, 4 | BRF_GRA }, // 9 - - { "arkarea.003", 0x10000, 0x6f45a308, 5 | BRF_GRA }, // 10 Background Tiles - { "arkarea.002", 0x10000, 0x051d3482, 5 | BRF_GRA }, // 11 - { "arkarea.001", 0x10000, 0x09d11ab7, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(arkarea) -STD_ROM_FN(arkarea) - -struct BurnDriver BurnDrvArkarea = { - "arkarea", NULL, NULL, NULL, "1988", - "Ark Area\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, arkareaRomInfo, arkareaRomName, NULL, NULL, Drv2InputInfo, ArkareaDIPInfo, - MnightInit, DrvExit, DrvFrame, MnightDraw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - - -// Atomic Robo-kid (World, Type-2) - -static struct BurnRomInfo robokidRomDesc[] = { - { "robokid1.18j", 0x10000, 0x378c21fc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "robokid2.18k", 0x10000, 0xddef8c5a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "robokid3.15k", 0x10000, 0x05295ec3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "robokid4.12k", 0x10000, 0x3bc3977f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "robokid.k7", 0x10000, 0xf490a2e9, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "robokid.b9", 0x08000, 0xfac59c3f, 3 | BRF_GRA }, // 5 Foreground Tiles - - { "robokid.15f", 0x10000, 0xba61f5ab, 4 | BRF_GRA }, // 6 Sprite Tiles - { "robokid.16f", 0x10000, 0xd9b399ce, 4 | BRF_GRA }, // 7 - { "robokid.17f", 0x10000, 0xafe432b9, 4 | BRF_GRA }, // 8 - { "robokid.18f", 0x10000, 0xa0aa2a84, 4 | BRF_GRA }, // 9 - - { "robokid.19c", 0x10000, 0x02220421, 5 | BRF_GRA }, // 10 Background Layer 0 Tiles - { "robokid.20c", 0x10000, 0x02d59bc2, 5 | BRF_GRA }, // 11 - { "robokid.17d", 0x10000, 0x2fa29b99, 5 | BRF_GRA }, // 12 - { "robokid.18d", 0x10000, 0xae15ce02, 5 | BRF_GRA }, // 13 - { "robokid.19d", 0x10000, 0x784b089e, 5 | BRF_GRA }, // 14 - { "robokid.20d", 0x10000, 0xb0b395ed, 5 | BRF_GRA }, // 15 - { "robokid.19f", 0x10000, 0x0f9071c6, 5 | BRF_GRA }, // 16 - - { "robokid.12c", 0x10000, 0x0ab45f94, 6 | BRF_GRA }, // 17 Background Layer 1 Tiles - { "robokid.14c", 0x10000, 0x029bbd4a, 6 | BRF_GRA }, // 18 - { "robokid.15c", 0x10000, 0x7de67ebb, 6 | BRF_GRA }, // 19 - { "robokid.16c", 0x10000, 0x53c0e582, 6 | BRF_GRA }, // 20 - { "robokid.17c", 0x10000, 0x0cae5a1e, 6 | BRF_GRA }, // 21 - { "robokid.18c", 0x10000, 0x56ac7c8a, 6 | BRF_GRA }, // 22 - { "robokid.15d", 0x10000, 0xcd632a4d, 6 | BRF_GRA }, // 23 - { "robokid.16d", 0x10000, 0x18d92b2b, 6 | BRF_GRA }, // 24 - - { "robokid.12a", 0x10000, 0xe64d1c10, 7 | BRF_GRA }, // 25 Background Layer 2 Tiles - { "robokid.14a", 0x10000, 0x8f9371e4, 7 | BRF_GRA }, // 26 - { "robokid.15a", 0x10000, 0x469204e7, 7 | BRF_GRA }, // 27 - { "robokid.16a", 0x10000, 0x4e340815, 7 | BRF_GRA }, // 28 - { "robokid.17a", 0x10000, 0xf0863106, 7 | BRF_GRA }, // 29 - { "robokid.18a", 0x10000, 0xfdff7441, 7 | BRF_GRA }, // 30 - - { "prom82s129.cpu", 0x00100, 0x4dd96f67, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(robokid) -STD_ROM_FN(robokid) - -struct BurnDriver BurnDrvRobokid = { - "robokid", NULL, NULL, NULL, "1988", - "Atomic Robo-kid (World, Type-2)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, robokidRomInfo, robokidRomName, NULL, NULL, DrvInputInfo, RobokidDIPInfo, - RobokidInit, DrvExit, DrvFrame, RobokidDraw, RobokidScan, &DrvRecalc, 0x400, - 256, 192, 4, 3 -}; - - -// Atomic Robo-kid (Japan, Type-2, set 1) - -static struct BurnRomInfo robokidjRomDesc[] = { - { "1.29", 0x10000, 0x59a1e2ec, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.30", 0x10000, 0xe3f73476, 1 | BRF_PRG | BRF_ESS }, // 1 - { "robokid3.15k", 0x10000, 0x05295ec3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "robokid4.12k", 0x10000, 0x3bc3977f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "robokid.k7", 0x10000, 0xf490a2e9, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "robokid.b9", 0x08000, 0xfac59c3f, 3 | BRF_GRA }, // 5 Foreground Tiles - - { "robokid.15f", 0x10000, 0xba61f5ab, 4 | BRF_GRA }, // 6 Sprite Tiles - { "robokid.16f", 0x10000, 0xd9b399ce, 4 | BRF_GRA }, // 7 - { "robokid.17f", 0x10000, 0xafe432b9, 4 | BRF_GRA }, // 8 - { "robokid.18f", 0x10000, 0xa0aa2a84, 4 | BRF_GRA }, // 9 - - { "robokid.19c", 0x10000, 0x02220421, 5 | BRF_GRA }, // 10 Background Layer 0 Tiles - { "robokid.20c", 0x10000, 0x02d59bc2, 5 | BRF_GRA }, // 11 - { "robokid.17d", 0x10000, 0x2fa29b99, 5 | BRF_GRA }, // 12 - { "robokid.18d", 0x10000, 0xae15ce02, 5 | BRF_GRA }, // 13 - { "robokid.19d", 0x10000, 0x784b089e, 5 | BRF_GRA }, // 14 - { "robokid.20d", 0x10000, 0xb0b395ed, 5 | BRF_GRA }, // 15 - { "robokid.19f", 0x10000, 0x0f9071c6, 5 | BRF_GRA }, // 16 - - { "robokid.12c", 0x10000, 0x0ab45f94, 6 | BRF_GRA }, // 17 Background Layer 1 Tiles - { "robokid.14c", 0x10000, 0x029bbd4a, 6 | BRF_GRA }, // 18 - { "robokid.15c", 0x10000, 0x7de67ebb, 6 | BRF_GRA }, // 19 - { "robokid.16c", 0x10000, 0x53c0e582, 6 | BRF_GRA }, // 20 - { "robokid.17c", 0x10000, 0x0cae5a1e, 6 | BRF_GRA }, // 21 - { "robokid.18c", 0x10000, 0x56ac7c8a, 6 | BRF_GRA }, // 22 - { "robokid.15d", 0x10000, 0xcd632a4d, 6 | BRF_GRA }, // 23 - { "robokid.16d", 0x10000, 0x18d92b2b, 6 | BRF_GRA }, // 24 - - { "robokid.12a", 0x10000, 0xe64d1c10, 7 | BRF_GRA }, // 25 Background Layer 2 Tiles - { "robokid.14a", 0x10000, 0x8f9371e4, 7 | BRF_GRA }, // 26 - { "robokid.15a", 0x10000, 0x469204e7, 7 | BRF_GRA }, // 27 - { "robokid.16a", 0x10000, 0x4e340815, 7 | BRF_GRA }, // 28 - { "robokid.17a", 0x10000, 0xf0863106, 7 | BRF_GRA }, // 29 - { "robokid.18a", 0x10000, 0xfdff7441, 7 | BRF_GRA }, // 30 - - { "prom82s129.cpu", 0x00100, 0x4dd96f67, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(robokidj) -STD_ROM_FN(robokidj) - -struct BurnDriver BurnDrvRobokidj = { - "robokidj", "robokid", NULL, NULL, "1988", - "Atomic Robo-kid (Japan, Type-2, set 1)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, robokidjRomInfo, robokidjRomName, NULL, NULL, DrvInputInfo, RobokidjDIPInfo, - RobokidInit, DrvExit, DrvFrame, RobokidDraw, RobokidScan, &DrvRecalc, 0x400, - 256, 192, 4, 3 -}; - - -// Atomic Robo-kid (Japan, Type-2, set 2) - -static struct BurnRomInfo robokidj2RomDesc[] = { - { "1_rom29.18j", 0x10000, 0x969fb951, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2_rom30.18k", 0x10000, 0xc0228b63, 1 | BRF_PRG | BRF_ESS }, // 1 - { "robokid3.15k", 0x10000, 0x05295ec3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "robokid4.12k", 0x10000, 0x3bc3977f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "robokid.k7", 0x10000, 0xf490a2e9, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "robokid.b9", 0x08000, 0xfac59c3f, 3 | BRF_GRA }, // 5 Foreground Tiles - - { "robokid.15f", 0x10000, 0xba61f5ab, 4 | BRF_GRA }, // 6 Sprite Tiles - { "robokid.16f", 0x10000, 0xd9b399ce, 4 | BRF_GRA }, // 7 - { "robokid.17f", 0x10000, 0xafe432b9, 4 | BRF_GRA }, // 8 - { "robokid.18f", 0x10000, 0xa0aa2a84, 4 | BRF_GRA }, // 9 - - { "robokid.19c", 0x10000, 0x02220421, 5 | BRF_GRA }, // 10 Background Layer 0 Tiles - { "robokid.20c", 0x10000, 0x02d59bc2, 5 | BRF_GRA }, // 11 - { "robokid.17d", 0x10000, 0x2fa29b99, 5 | BRF_GRA }, // 12 - { "robokid.18d", 0x10000, 0xae15ce02, 5 | BRF_GRA }, // 13 - { "robokid.19d", 0x10000, 0x784b089e, 5 | BRF_GRA }, // 14 - { "robokid.20d", 0x10000, 0xb0b395ed, 5 | BRF_GRA }, // 15 - { "robokid.19f", 0x10000, 0x0f9071c6, 5 | BRF_GRA }, // 16 - - { "robokid.12c", 0x10000, 0x0ab45f94, 6 | BRF_GRA }, // 17 Background Layer 1 Tiles - { "robokid.14c", 0x10000, 0x029bbd4a, 6 | BRF_GRA }, // 18 - { "robokid.15c", 0x10000, 0x7de67ebb, 6 | BRF_GRA }, // 19 - { "robokid.16c", 0x10000, 0x53c0e582, 6 | BRF_GRA }, // 20 - { "robokid.17c", 0x10000, 0x0cae5a1e, 6 | BRF_GRA }, // 21 - { "robokid.18c", 0x10000, 0x56ac7c8a, 6 | BRF_GRA }, // 22 - { "robokid.15d", 0x10000, 0xcd632a4d, 6 | BRF_GRA }, // 23 - { "robokid.16d", 0x10000, 0x18d92b2b, 6 | BRF_GRA }, // 24 - - { "robokid.12a", 0x10000, 0xe64d1c10, 7 | BRF_GRA }, // 25 Background Layer 2 Tiles - { "robokid.14a", 0x10000, 0x8f9371e4, 7 | BRF_GRA }, // 26 - { "robokid.15a", 0x10000, 0x469204e7, 7 | BRF_GRA }, // 27 - { "robokid.16a", 0x10000, 0x4e340815, 7 | BRF_GRA }, // 28 - { "robokid.17a", 0x10000, 0xf0863106, 7 | BRF_GRA }, // 29 - { "robokid.18a", 0x10000, 0xfdff7441, 7 | BRF_GRA }, // 30 - - { "prom82s129.cpu", 0x00100, 0x4dd96f67, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(robokidj2) -STD_ROM_FN(robokidj2) - -struct BurnDriver BurnDrvRobokidj2 = { - "robokidj2", "robokid", NULL, NULL, "1988", - "Atomic Robo-kid (Japan, Type-2, set 2)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, robokidj2RomInfo, robokidj2RomName, NULL, NULL, DrvInputInfo, RobokidjDIPInfo, - RobokidInit, DrvExit, DrvFrame, RobokidDraw, RobokidScan, &DrvRecalc, 0x400, - 256, 192, 4, 3 -}; - - -// Atomic Robo-kid (Japan) - -static struct BurnRomInfo robokidj3RomDesc[] = { - { "robokid1.18j", 0x10000, 0x77a9332a, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "robokid2.18k", 0x10000, 0x715ecee4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "robokid3.15k", 0x10000, 0xce12fa86, 1 | BRF_PRG | BRF_ESS }, // 2 - { "robokid4.12k", 0x10000, 0x97e86600, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "robokid.k7", 0x10000, 0xf490a2e9, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "robokid.b9", 0x08000, 0xfac59c3f, 3 | BRF_GRA }, // 5 Foreground Tiles - - { "robokid.15f", 0x10000, 0xba61f5ab, 4 | BRF_GRA }, // 6 Sprite Tiles - { "robokid.16f", 0x10000, 0xd9b399ce, 4 | BRF_GRA }, // 7 - { "robokid.17f", 0x10000, 0xafe432b9, 4 | BRF_GRA }, // 8 - { "robokid.18f", 0x10000, 0xa0aa2a84, 4 | BRF_GRA }, // 9 - - { "robokid.19c", 0x10000, 0x02220421, 5 | BRF_GRA }, // 10 Background Layer 0 Tiles - { "robokid.20c", 0x10000, 0x02d59bc2, 5 | BRF_GRA }, // 11 - { "robokid.17d", 0x10000, 0x2fa29b99, 5 | BRF_GRA }, // 12 - { "robokid.18d", 0x10000, 0xae15ce02, 5 | BRF_GRA }, // 13 - { "robokid.19d", 0x10000, 0x784b089e, 5 | BRF_GRA }, // 14 - { "robokid.20d", 0x10000, 0xb0b395ed, 5 | BRF_GRA }, // 15 - { "robokid.19f", 0x10000, 0x0f9071c6, 5 | BRF_GRA }, // 16 - - { "robokid.12c", 0x10000, 0x0ab45f94, 6 | BRF_GRA }, // 17 Background Layer 1 Tiles - { "robokid.14c", 0x10000, 0x029bbd4a, 6 | BRF_GRA }, // 18 - { "robokid.15c", 0x10000, 0x7de67ebb, 6 | BRF_GRA }, // 19 - { "robokid.16c", 0x10000, 0x53c0e582, 6 | BRF_GRA }, // 20 - { "robokid.17c", 0x10000, 0x0cae5a1e, 6 | BRF_GRA }, // 21 - { "robokid.18c", 0x10000, 0x56ac7c8a, 6 | BRF_GRA }, // 22 - { "robokid.15d", 0x10000, 0xcd632a4d, 6 | BRF_GRA }, // 23 - { "robokid.16d", 0x10000, 0x18d92b2b, 6 | BRF_GRA }, // 24 - - { "robokid.12a", 0x10000, 0xe64d1c10, 7 | BRF_GRA }, // 25 Background Layer 2 Tiles - { "robokid.14a", 0x10000, 0x8f9371e4, 7 | BRF_GRA }, // 26 - { "robokid.15a", 0x10000, 0x469204e7, 7 | BRF_GRA }, // 27 - { "robokid.16a", 0x10000, 0x4e340815, 7 | BRF_GRA }, // 28 - { "robokid.17a", 0x10000, 0xf0863106, 7 | BRF_GRA }, // 29 - { "robokid.18a", 0x10000, 0xfdff7441, 7 | BRF_GRA }, // 30 - - { "prom82s129.cpu", 0x00100, 0x4dd96f67, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(robokidj3) -STD_ROM_FN(robokidj3) - -struct BurnDriver BurnDrvRobokidj3 = { - "robokidj3", "robokid", NULL, NULL, "1988", - "Atomic Robo-kid (Japan)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, robokidj3RomInfo, robokidj3RomName, NULL, NULL, DrvInputInfo, RobokidjDIPInfo, - RobokidInit, DrvExit, DrvFrame, RobokidDraw, RobokidScan, &DrvRecalc, 0x400, - 256, 192, 4, 3 -}; - - -// Omega Fighter - -static struct BurnRomInfo omegafRomDesc[] = { - { "1.5", 0x20000, 0x57a7fd96, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "6.4l", 0x20000, 0x6277735c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "7.7m", 0x10000, 0xd40fc8d5, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "4.18h", 0x08000, 0x9e2d8152, 3 | BRF_GRA }, // 3 Foreground Tiles - - { "8.23m", 0x20000, 0x0bd2a5d1, 4 | BRF_GRA }, // 4 Sprite Tiles - - { "2back1.27b", 0x80000, 0x21f8a32e, 5 | BRF_GRA }, // 5 Background Layer 0 Tiles - - { "1back2.15b", 0x80000, 0x6210ddcc, 6 | BRF_GRA }, // 6 Background Layer 1 Tiles - - { "3back3.5f", 0x80000, 0xc31cae56, 7 | BRF_GRA }, // 7 Background Layer 2 Tiles -}; - -STD_ROM_PICK(omegaf) -STD_ROM_FN(omegaf) - -struct BurnDriver BurnDrvOmegaf = { - "omegaf", NULL, NULL, NULL, "1989", - "Omega Fighter\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, omegafRomInfo, omegafRomName, NULL, NULL, OmegafInputInfo, OmegafDIPInfo, - OmegafInit, DrvExit, DrvFrame, OmegafDraw, OmegafScan, &DrvRecalc, 0x400, - 192, 256, 3, 4 -}; - - -// Omega Fighter Special - -static struct BurnRomInfo omegafsRomDesc[] = { - { "5.3l", 0x20000, 0x503a3e63, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "6.4l", 0x20000, 0x6277735c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "7.7m", 0x10000, 0xd40fc8d5, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "4.18h", 0x08000, 0x9e2d8152, 3 | BRF_GRA }, // 3 Foreground Tiles - - { "8.23m", 0x20000, 0x0bd2a5d1, 4 | BRF_GRA }, // 4 Sprite Tiles - - { "2back1.27b", 0x80000, 0x21f8a32e, 5 | BRF_GRA }, // 5 Background Layer 0 Tiles - - { "1back2.15b", 0x80000, 0x6210ddcc, 6 | BRF_GRA }, // 6 Background Layer 1 Tiles - - { "3back3.5f", 0x80000, 0xc31cae56, 7 | BRF_GRA }, // 7 Background Layer 2 Tiles -}; - -STD_ROM_PICK(omegafs) -STD_ROM_FN(omegafs) - -struct BurnDriver BurnDrvOmegafs = { - "omegafs", "omegaf", NULL, NULL, "1989", - "Omega Fighter Special\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, omegafsRomInfo, omegafsRomName, NULL, NULL, OmegafInputInfo, OmegafDIPInfo, - OmegafInit, DrvExit, DrvFrame, OmegafDraw, OmegafScan, &DrvRecalc, 0x400, - 192, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_pac2650.cpp b/jan/src/burn/drv/pre90s/d_pac2650.cpp deleted file mode 100644 index 306fb06d8..000000000 --- a/jan/src/burn/drv/pre90s/d_pac2650.cpp +++ /dev/null @@ -1,615 +0,0 @@ -// FB Alpha Pac-Man-based S2650 game hardware driver module -// Based on MAME driver by Nicola Salmoria and many others - -#include "tiles_generic.h" -#include "s2650_intf.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvPrgROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvPrgRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvScrRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvSprRAM2; -static UINT8 *flipscreen; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static INT32 s2650_bank; -static INT32 watchdog; -static INT32 vblank; - -static struct BurnInputInfo DrivfrcpInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Drivfrcp) - -static struct BurnInputInfo _8bpmInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(_8bpm) - -static struct BurnInputInfo PorkyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 5, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Porky) - -static struct BurnDIPInfo DrivfrcpDIPList[]= -{ - {0x07, 0xff, 0xff, 0x00, NULL }, -}; - -STDDIPINFO(Drivfrcp) - -static struct BurnDIPInfo _8bpmDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x01, 0x00, "Upright" }, - {0x0f, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(_8bpm) - -static struct BurnDIPInfo PorkyDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Porky) - -static inline void bankswitch(INT32 data) -{ - INT32 bank = (data & 1) ? 0x4000 : 0; - - if (s2650_bank != (data & 1)) { - - for (INT32 i = 0; i <= 0x8000; i+= 0x8000) { - s2650MapMemory(DrvPrgROM + 0x00000 + bank, 0x0000 | i, 0x0fff | i, MAP_ROM); - s2650MapMemory(DrvPrgROM + 0x01000 + bank, 0x2000 | i, 0x2fff | i, MAP_ROM); - s2650MapMemory(DrvPrgROM + 0x02000 + bank, 0x4000 | i, 0x4fff | i, MAP_ROM); - s2650MapMemory(DrvPrgROM + 0x03000 + bank, 0x6000 | i, 0x6fff | i, MAP_ROM); - } - - s2650_bank = data & 1; - } -} - -static void s2650games_write(UINT16 address, UINT8 data) -{ - switch (address & 0x1fff) - { - case 0x1503: - *flipscreen = data & 1; - return; - - case 0x1507: // coin counter - return; - - case 0x15c0: - watchdog = 0; - return; - - case 0x15c7: - bankswitch(data); - return; - } - - if ((address & 0x1c00) == 0x1000) { - DrvColRAM[address & 0x1f] = data; - return; - } - - if ((address & 0x1ff0) == 0x1560) { - DrvSprRAM2[address & 0x0f] = data; - return; - } -} - -static UINT8 s2650games_read(UINT16 address) -{ - switch (address & 0x1fff) - { - case 0x1500: - return DrvInputs[0]; - - case 0x1540: - return DrvInputs[1]; - - case 0x1580: - return DrvDips[0]; - } - - return 0; -} - -static void s2650games_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case S2650_DATA_PORT: - SN76496Write(0, data); - return; - } -} - -static UINT8 s2650games_read_port(UINT16 port) -{ - switch (port & 0x1ff) - { - case S2650_SENSE_PORT: - return vblank ? 0 : 0x80; - - case 0x01: - { - switch (s2650GetPC(0)) - { - case 0x0030: // drivfrcp & _8bpm - case 0x0034: // porky - case 0x0291: // drivfrcp - case 0x0466: // _8bpm - return 1; - } - - return 0; - } - } - - return 0; -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - s2650Open(0); - s2650_bank = -1; - bankswitch(0); - s2650Reset(); - s2650Close(); - - watchdog = 0; - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 tmp[32]; - - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0, bit1, bit2; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = (bit0 * 33) + (bit1 * 71) + (bit2 * 151); - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = (bit0 * 33) + (bit1 * 71) + (bit2 * 151); - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = (bit0 * 81) + (bit1 * 174); - - tmp[i] = BurnHighCol(r, g, b, 0); - } - - for (INT32 i = 0; i < 128; i++) - { - INT32 ctabentry = DrvColPROM[i + 0x20] &= 0x0f; - DrvPalette[i] = tmp[ctabentry]; - } -} - -static void DrvGfxDecode() -{ - INT32 Planes[2] = { 0, 4 }; - INT32 XOffs0[8] = { 8*8, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 }; - INT32 XOffs1[16] = { 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3, 0, 1, 2, 3 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc( 0x4000 ); - if (tmp) - { - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x400, 2, 8, 8, Planes, XOffs0, YOffs, 0x080, tmp, DrvGfxROM0); - GfxDecode(0x100, 2, 16, 16, Planes, XOffs1, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree (tmp); - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvPrgROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000120; - - DrvPalette = (UINT32*)Next; Next += 0x080 * sizeof(UINT32); - - AllRam = Next; - - DrvPrgRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvScrRAM = Next; Next += 0x000100; - DrvColRAM = Next; Next += 0x000020; - DrvSprRAM2 = Next; Next += 0x000010; - DrvSprRAM1 = DrvScrRAM + 0x090; - DrvSprRAM0 = DrvPrgRAM + 0x3f0; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 game, INT32 swap) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvPrgROM, 0, 1)) return 1; - memcpy (DrvPrgROM + 0x4000, DrvPrgROM, 0x4000); - - if (game) { - if (BurnLoadRom(DrvPrgROM + 0x4000, 1, 1)) return 1; - } - - for (INT32 i = 0; i < 0x8000; i++) { // porky & 8bpm have data lines scrambled - DrvPrgROM[i] = (DrvPrgROM[i] & ~(1 | (1 << swap))) | ((DrvPrgROM[i] >> swap) & 1) | ((DrvPrgROM[i] & 1) << swap); - } - - if (BurnLoadRom(DrvGfxROM1, 1 + game, 1)) return 1; - - for (INT32 i = 0; i < 0x4000; i++) { - DrvGfxROM0[((i & 0x2000) >> 1) | ((i & 0x1000) << 1) | (i & 0xfff)] = DrvGfxROM1[i]; - } - - if (BurnLoadRom(DrvColPROM + 0x000, 2 + game, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x020, 3 + game, 1)) return 1; - - DrvPaletteInit(); - DrvGfxDecode(); - } - - s2650Init(1); - s2650Open(0); - for (INT32 i = 0; i <= 0xe000; i+= 0x2000) { - s2650MapMemory(DrvScrRAM, 0x1400 | i, 0x14ff | i, MAP_RAM); - s2650MapMemory(DrvVidRAM, 0x1800 | i, 0x1bff | i, MAP_RAM); - s2650MapMemory(DrvPrgRAM, 0x1c00 | i, 0x1fff | i, MAP_RAM); - } - s2650SetWriteHandler(s2650games_write); - s2650SetReadHandler(s2650games_read); - s2650SetOutHandler(s2650games_write_port); - s2650SetInHandler(s2650games_read_port); - s2650Close(); - - SN76496Init(0, 3072000, 0); - SN76496SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 drivfrcpInit() { return DrvInit(0,0); } -static INT32 _8bpmInit() { return DrvInit(0,6); } -static INT32 porkyInit() { return DrvInit(1,4); } - -static INT32 DrvExit() -{ - GenericTilesExit(); - - s2650Exit(); - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - UINT8 *ram = DrvScrRAM + 0x00a0; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs >> 5) << 3; - INT32 sx = (offs & 0x1f) << 3; - - sy -= DrvScrRAM[offs & 0x1f] + 16; - if (sy < -7) sy += 256; - - if (sy >= nScreenHeight) continue; - - INT32 code = DrvVidRAM[offs] | ((ram[offs & 0x1f] & 0x03) << 8); - INT32 color = DrvColRAM[offs & 0x1f] & 0x1f; - - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, 248 - sx, 216 - sy, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x0e; offs >= 0; offs -= 2) - { - INT32 attr = DrvSprRAM0[offs]; - INT32 sx = DrvSprRAM2[offs + 1] ^ 0xff; - INT32 sy = DrvSprRAM2[offs] - 15; - INT32 color = DrvSprRAM0[offs + 1] & 0x1f; - INT32 code = (attr >> 2) | ((DrvSprRAM1[offs] & 3) << 6); - INT32 flipx = attr & 0x01; - INT32 flipy = attr & 0x02; - - if (offs <= 4) sy += 1; // hack - - RenderTileTranstab(pTransDraw, DrvGfxROM1, code, color << 2, 0, sx, sy - 16, flipx, flipy, 16, 16, DrvColPROM + 0x020); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - if (watchdog >= 180) { - DrvDoReset(0); - } - watchdog++; - - { - memset (DrvInputs, 0xff, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - s2650Open(0); - - vblank = 0; - - for (INT32 i = 0; i < 32; i++) { - if (i == 31) { - vblank = 1; - s2650SetIRQLine(0x03, CPU_IRQSTATUS_ACK); - } - INT32 nSegment = (1536000 / 60) / 32; - - s2650Run(nSegment); - - if (i == 31) { - s2650SetIRQLine(0x03, CPU_IRQSTATUS_NONE); - } - } - - s2650Close(); - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029709; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - s2650Open(0); - s2650Scan(nAction); - s2650Close(); - SN76496Scan(nAction, pnMin); - SCAN_VAR(watchdog); - SCAN_VAR(s2650_bank); - } - - if (nAction & ACB_WRITE) { - s2650Open(0); - INT32 bank = s2650_bank; - s2650_bank = -1; - bankswitch(bank); - s2650Close(); - } - - return 0; -} - - -// Driving Force (Pac-Man conversion) - -static struct BurnRomInfo drivfrcpRomDesc[] = { - { "drivforc.1", 0x4000, 0x10b59d27, 1 | BRF_PRG | BRF_ESS }, // 0 s2650 Code - - { "drivforc.2", 0x4000, 0x56331cb5, 2 | BRF_GRA }, // 1 Tiles and Sprites - - { "drivforc.pr1", 0x0020, 0x045aa47f, 3 | BRF_GRA }, // 2 Color PROMs - { "drivforc.pr2", 0x0100, 0x9e6d2f1d, 3 | BRF_GRA }, // 3 -}; - -STD_ROM_PICK(drivfrcp) -STD_ROM_FN(drivfrcp) - -struct BurnDriver BurnDrvDrivfrcp = { - "drivfrcp", NULL, NULL, NULL, "1984", - "Driving Force (Pac-Man conversion)\0", NULL, "Shinkai Inc. (Magic Eletronics Inc. license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_PACMAN, GBF_RACING, 0, - NULL, drivfrcpRomInfo, drivfrcpRomName, NULL, NULL, DrivfrcpInputInfo, DrivfrcpDIPInfo, - drivfrcpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 224, 256, 3, 4 -}; - - -// Eight Ball Action (Pac-Man conversion) - -static struct BurnRomInfo _8bpmRomDesc[] = { - { "8bpmp.bin", 0x4000, 0xb4f7eba7, 1 | BRF_PRG | BRF_ESS }, // 0 s2650 Code - - { "8bpmc.bin", 0x4000, 0x1c894a6d, 2 | BRF_GRA }, // 1 Tiles and Sprites - - { "8bpm.7f", 0x0020, 0x4cf54241, 3 | BRF_GRA }, // 2 Color PROMs - { "8bpm.4a", 0x0100, 0x618505a0, 3 | BRF_GRA }, // 3 -}; - -STD_ROM_PICK(_8bpm) -STD_ROM_FN(_8bpm) - -struct BurnDriver BurnDrv_8bpm = { - "8bpm", "8ballact", NULL, NULL, "1985", - "Eight Ball Action (Pac-Man conversion)\0", "imperfect graphics", "Seatongrove Ltd (Magic Eletronics USA license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_SPORTSMISC, 0, - NULL, _8bpmRomInfo, _8bpmRomName, NULL, NULL, _8bpmInputInfo, _8bpmDIPInfo, - _8bpmInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 224, 256, 3, 4 -}; - - -// Porky - -static struct BurnRomInfo porkyRomDesc[] = { - { "pp", 0x4000, 0x00592624, 1 | BRF_PRG | BRF_ESS }, // 0 s2650 Code - { "ps", 0x4000, 0x2efb9861, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pc", 0x4000, 0xa20e3d39, 2 | BRF_GRA }, // 2 Tiles and Sprites - - { "7f", 0x0020, 0x98bce7cc, 3 | BRF_GRA }, // 3 Color PROMs - { "4a", 0x0100, 0x30fe0266, 3 | BRF_GRA }, // 4 -}; - -STD_ROM_PICK(porky) -STD_ROM_FN(porky) - -struct BurnDriver BurnDrvPorky = { - "porky", NULL, NULL, NULL, "1985", - "Porky\0", NULL, "Shinkai Inc. (Magic Eletronics Inc. license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_HORSHOOT, 0, - NULL, porkyRomInfo, porkyRomName, NULL, NULL, PorkyInputInfo, PorkyDIPInfo, - porkyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_pacland.cpp b/jan/src/burn/drv/pre90s/d_pacland.cpp deleted file mode 100644 index 782f7d850..000000000 --- a/jan/src/burn/drv/pre90s/d_pacland.cpp +++ /dev/null @@ -1,1065 +0,0 @@ -// FB Alpha Pac-Land driver module -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "m6800_intf.h" -#include "namco_snd.h" -#include "burn_led.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvMCUROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvMCURAM; -static UINT8 *DrvMCUIRAM; -static UINT8 *DrvSprMask; -static UINT8 *pPrioBitmap; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; - -static INT32 mcu_reset; - -static UINT16 *scroll; -static UINT8 *interrupt_enable; -static UINT8 *coin_lockout; -static UINT8 *palette_bank; - -static INT32 watchdog; -static INT32 pl_lastbank = 0; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo PaclandInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 7, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Pacland) - -static struct BurnDIPInfo PaclandDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x80, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - -// Not supported ATM -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x0c, 0x01, 0x80, 0x80, "Upright" }, -// {0x0c, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0d, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x0d, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0d, 0x01, 0x04, 0x00, "Off" }, - {0x0d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0d, 0x01, 0x18, 0x00, "3 Coins 1 Credits" }, - {0x0d, 0x01, 0x18, 0x08, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x18, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0d, 0x01, 0x60, 0x40, "2" }, - {0x0d, 0x01, 0x60, 0x60, "3" }, - {0x0d, 0x01, 0x60, 0x20, "4" }, - {0x0d, 0x01, 0x60, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0d, 0x01, 0x80, 0x80, "Off" }, - {0x0d, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Trip Select" }, - {0x0e, 0x01, 0x01, 0x00, "Off" }, - {0x0e, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x0e, 0x01, 0x02, 0x02, "Off" }, - {0x0e, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Round Select" }, - {0x0e, 0x01, 0x04, 0x04, "Off" }, - {0x0e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0e, 0x01, 0x18, 0x10, "B (Easy)" }, - {0x0e, 0x01, 0x18, 0x18, "A (Average)" }, - {0x0e, 0x01, 0x18, 0x08, "C (Hard)" }, - {0x0e, 0x01, 0x18, 0x00, "D (Very Hard)" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x0e, 0x01, 0xe0, 0xe0, "30K 80K 130K 300K 500K 1M" }, - {0x0e, 0x01, 0xe0, 0x80, "30K 80K every 100K" }, - {0x0e, 0x01, 0xe0, 0x40, "30K 80K 150K" }, - {0x0e, 0x01, 0xe0, 0xc0, "30K 100K 200K 400K 600K 1M" }, - {0x0e, 0x01, 0xe0, 0xa0, "40K 100K 180K 300K 500K 1M" }, - {0x0e, 0x01, 0xe0, 0x20, "40K 100K 200K" }, - {0x0e, 0x01, 0xe0, 0x00, "40K" }, - {0x0e, 0x01, 0xe0, 0x60, "50K 150K every 200K" }, -}; - -STDDIPINFO(Pacland) - -static void bankswitch(INT32 nBank) -{ - pl_lastbank = nBank; - palette_bank[0] = (nBank & 0x18) >> 3; - - nBank = (nBank & 0x07) * 0x2000; - - M6809MapMemory(DrvMainROM + 0x10000 + nBank, 0x4000, 0x5fff, MAP_ROM); -} - -static void pacland_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x6800) { - namcos1_custom30_write(address & 0x3ff, data); - return; - } - - if ((address & 0xf000) == 0x7000) { - INT32 bit = ~address & (1 << 11); - interrupt_enable[0] = bit ? 1 : 0; - if (!bit) M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } - - if ((address & 0xf000) == 0x8000) { - INT32 bit = ~address & (1 << 11); - if (!bit) HD63701Reset(); - mcu_reset = bit ^ (1<<11); - return; - } - - if ((address & 0xf000) == 0x9000) { - *flipscreen = ~(address >> 11) & 1; - BurnLEDSetFlipscreen(*flipscreen); - return; - } - - switch (address) - { - case 0x3800: - scroll[0] = data; - break; - - case 0x3801: - scroll[0] = 0x100 | data; - return; - - case 0x3a00: - scroll[1] = data; - return; - - case 0x3a01: - scroll[1] = 0x100 | data; - return; - - case 0x3c00: - bankswitch(data); - return; - } -} - -static UINT8 pacland_main_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x6800) { - return namcos1_custom30_read(address & 0x3ff); - } - - if ((address & 0xf800) == 0x7800) { - watchdog = 0; - return 0; - } - - return 0; -} - -static void pacland_mcu_write(UINT16 address, UINT8 data) -{ - if ((address & 0xffe0) == 0x0000) { - m6803_internal_registers_w(address, data); - return; - } - - if ((address & 0xff80) == 0x0080) { - DrvMCUIRAM[address & 0x7f] = data; - return; - } - - if ((address & 0xfc00) == 0x1000) { - namcos1_custom30_write(address & 0x3ff, data); - return; - } - - if ((address & 0xe000) == 0x2000) { - watchdog = 0; - return; - } - - if ((address & 0xc000) == 0x4000) { - INT32 bit = (~address >> 13) & 1; - interrupt_enable[1] = bit; - if (!bit) HD63701SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static UINT8 pacland_mcu_read(UINT16 address) -{ - if ((address & 0xffe0) == 0x0000) { - return m6803_internal_registers_r(address); - } - - if ((address & 0xff80) == 0x0080) { - return DrvMCUIRAM[address & 0x7f]; - } - - if ((address & 0xfc00) == 0x1000) { - return namcos1_custom30_read(address & 0x3ff); - } - - switch (address) - { - case 0xd000: - return (DrvDips[1] & 0xf0) | (DrvDips[2] >> 4); - - case 0xd001: - return (DrvDips[1] << 4) | (DrvDips[2] & 0x0f); - - case 0xd002: - return (DrvInputs[0] & 0xf0) | 0x0f; - - case 0xd003: - return (DrvInputs[0] << 4) | 0x0f; - } - - return 0; -} - -static void pacland_mcu_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: - coin_lockout[0] = data & 0x01; - // bprintf(0, _T("coin lockout\n")); - // coin counters ~data & 2 -> 0, ~data & 4 -> 1 - return; - - case HD63701_PORT2: - BurnLEDSetStatus(0, data & 0x08); - BurnLEDSetStatus(1, data & 0x10); - return; - } -} - -static UINT8 pacland_mcu_read_port(UINT16 port) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: return DrvInputs[1]; - case HD63701_PORT2: return 0xff; // led status? - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x020000; - DrvMCUROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x008000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x001400; - - DrvPalette = (UINT32*)Next; Next += 0x0c00 * 4 * sizeof(UINT32); - - pPrioBitmap = Next; Next += 288 * 224; - - DrvSprMask = Next; Next += 0x000c00; - - AllRam = Next; - - DrvVidRAM0 = Next; Next += 0x001000; - DrvVidRAM1 = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001800; - - DrvMCURAM = Next; Next += 0x000800; - DrvMCUIRAM = Next; Next += 0x000080; - - flipscreen = Next; Next += 0x000001; - scroll = (UINT16*)Next; Next += 0x000002 * sizeof(UINT16); - interrupt_enable = Next; Next += 0x000001; - coin_lockout = Next; Next += 0x000001; - palette_bank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - M6809Close(); - - // open - HD63701Reset(); - // close - - NamcoSoundReset(); - - BurnLEDReset(); - - HiscoreReset(); - - watchdog = 0; - mcu_reset = 0; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Plane[4] = { 0, 4, RGN_FRAC(0x10000, 1, 2) + 0, RGN_FRAC(0x10000, 1, 2) + 4 }; - INT32 XOffs0[ 8] = { STEP4(8*8,1), STEP4(0*8,1) }; - INT32 XOffs1[16] = { STEP4(0*8,1), STEP4(8*8,1), STEP4(16*8,1), STEP4(24*8,1) }; - INT32 YOffs[16] = { STEP8(0*8,8), STEP8(32*8,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x02000); - - GfxDecode(0x0200, 2, 8, 8, Plane, XOffs0, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x02000); - - GfxDecode(0x0200, 2, 8, 8, Plane, XOffs0, YOffs, 0x080, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x10000); - - GfxDecode(0x0200, 4, 16, 16, Plane, XOffs1, YOffs, 0x200, tmp, DrvGfxROM2); - - BurnFree(tmp); -} - -static void DrvPaletteInit() // Palette banks + Color tables -{ - UINT32 *tpal = (UINT32*)BurnMalloc(0x400 * sizeof(INT32)); - - for (INT32 j = 0; j < 0x400; j++) - { - INT32 bit0, bit1, bit2, bit3, r,g,b; - - bit0 = (DrvColPROM[j+0x000] >> 0) & 0x01; - bit1 = (DrvColPROM[j+0x000] >> 1) & 0x01; - bit2 = (DrvColPROM[j+0x000] >> 2) & 0x01; - bit3 = (DrvColPROM[j+0x000] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[j+0x000] >> 4) & 0x01; - bit1 = (DrvColPROM[j+0x000] >> 5) & 0x01; - bit2 = (DrvColPROM[j+0x000] >> 6) & 0x01; - bit3 = (DrvColPROM[j+0x000] >> 7) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[j+0x400] >> 0) & 0x01; - bit1 = (DrvColPROM[j+0x400] >> 1) & 0x01; - bit2 = (DrvColPROM[j+0x400] >> 2) & 0x01; - bit3 = (DrvColPROM[j+0x400] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - tpal[j] = BurnHighCol(r, g, b, 0); - } - - for (INT32 i = 0; i < 4; i++) - { - for (INT32 j = 0; j < 0x400; j++) - { - DrvPalette[(i * 0xc00) + 0x000 + j] = tpal[(i * 0x100) + DrvColPROM[j + 0x0800]]; - DrvPalette[(i * 0xc00) + 0x400 + j] = tpal[(i * 0x100) + DrvColPROM[j + 0x0c00]]; - DrvPalette[(i * 0xc00) + 0x800 + j] = tpal[(i * 0x100) + DrvColPROM[j + 0x1000]]; - - } - } - - BurnFree (tpal); -} - -static void DrvCreateSpriteMask() -{ - memset (DrvSprMask, 0, 0xc00); - - for (INT32 i = 0; i < 0x400; i++) { - INT32 p = DrvColPROM[0x1000 + i]; - - if (p >= 0x80) DrvSprMask[i + 0x000] = 1; - - if ((p&0x7f) == 0x7f) DrvSprMask[i + 0x400] = 1; - - if (p < 0xf0 || p == 0xff) DrvSprMask[i + 0x800] = 1; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x008000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x00c000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x010000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x014000, 3, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x018000, 4, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x01c000, 5, 1)) return 1; - - if (BurnLoadRom(DrvMCUROM + 0x008000, 6, 1)) return 1; - if (BurnLoadRom(DrvMCUROM + 0x00f000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x004000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x008000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00c000, 13, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000400, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000800, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x000c00, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x001000, 18, 1)) return 1; - - DrvCreateSpriteMask(); - DrvPaletteInit(); - DrvGfxDecode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvVidRAM0, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvVidRAM1, 0x1000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvMainROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(pacland_main_write); - M6809SetReadHandler(pacland_main_read); - M6809Close(); - - HD63701Init(1); - // Open - HD63701MapMemory(DrvMCUROM + 0x8000, 0x8000, 0xbfff, MAP_ROM); - HD63701MapMemory(DrvMCURAM, 0xc000, 0xc7ff, MAP_RAM); - HD63701MapMemory(DrvMCUROM + 0xf000, 0xf000, 0xffff, MAP_ROM); - HD63701SetWritePortHandler(pacland_mcu_write_port); - HD63701SetReadPortHandler(pacland_mcu_read_port); - HD63701SetWriteHandler(pacland_mcu_write); - HD63701SetReadHandler(pacland_mcu_read); - // Close - - NamcoSoundInit(49152000/2/1024, 8, 0); - NacmoSoundSetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); // MAME uses 1.00, which is way too loud - - BurnLEDInit(2, LED_POSITION_BOTTOM_RIGHT, LED_SIZE_2x2, LED_COLOR_GREEN, 80); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - HD63701Exit(); - - BurnLEDExit(); - - NamcoSoundExit(); - - BurnFree(AllMem); - - return 0; -} - -static void draw_bg_layer() -{ - INT32 scrollx = (scroll[1] + 27) & 0x1ff; - - for (INT32 offs = 2 * 64; offs < (64 * 32) - (2 * 64); offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= scrollx; - if (sx < -7) sx += 512; - if (sx >= nScreenWidth) continue; - - INT32 attr = DrvVidRAM1[offs * 2 + 0] + (DrvVidRAM1[offs * 2 + 1] << 8); - INT32 code = (attr & 0x01ff); - INT32 color =((attr & 0x01c0) >> 1) | ((attr & 0x3e00)>>9); - INT32 flipy = (attr & 0x8000); - INT32 flipx = (attr & 0x4000); - - if (*flipscreen) { - sx = 280 - sx; - sy = 216 - sy; - flipy ^= 0x8000; - flipx ^= 0x4000; - } - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy-16, color, 2, 0x400, DrvGfxROM1); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy-16, color, 2, 0x400, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy-16, color, 2, 0x400, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy-16, color, 2, 0x400, DrvGfxROM1); - } - } - } -} - -static void draw_fg_layer(INT32 priority) -{ - UINT8 *coltable = DrvColPROM + 0x800; - - INT32 scrollx = (scroll[0] + 24) & 0x1ff; - - for (INT32 offs = 2 * 64; offs < (64 * 32) - (2 * 64); offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= (sy >= 40 && sy < 232) ? scrollx : 24; - if (sx < -7) sx += 512; - if (sx >= nScreenWidth) continue; - - INT32 attr = DrvVidRAM0[offs * 2 + 0] + (DrvVidRAM0[offs * 2 + 1] << 8); - INT32 code = (attr & 0x01ff); - INT32 color =((attr & 0x01e0) >> 1) | ((attr & 0x1e00) >> 9); - INT32 flipy = (attr & 0x8000); - INT32 flipx = (attr & 0x4000); - INT32 group = (attr & 0x2000) >> 13; // category - - if (*flipscreen) { - sx = 280 - sx; - sy = 216 - sy; - flipy ^= 0x8000; - flipx ^= 0x4000; - } - - if (group == priority) - { - color <<= 2; - sy -= 16; - - UINT8 *gfx = DrvGfxROM0 + (code * 8 * 8); - INT32 flip = ((flipy) ? 0x38 : 0) + ((flipx) ? 0x07 : 0); - - for (INT32 y = 0; y < 8; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < 8; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y*8)+x)^flip] + color; - - if ((coltable[pxl] & 0x7f) != 0x7f) { - if (!pPrioBitmap[sy * nScreenWidth + sx]) { - pTransDraw[sy * nScreenWidth + sx] = pxl; - } - } - } - - sx -= 8; - } - } - } -} - -static void draw_sprite(INT32 code, INT32 sx, INT32 sy, INT32 color, INT32 flipx, INT32 flipy, INT32 prio) -{ - if (sx >= nScreenWidth || sy >= nScreenHeight || sx < -15 || sy < -15) return; - - INT32 flip = ((flipy) ? 0xf0 : 0) + ((flipx) ? 0x0f : 0); - - UINT8 *gfx = DrvGfxROM2 + code * 0x100; - UINT8 *mask = DrvSprMask + prio * 0x400; - - if (prio == 0) prio = 1; - else prio = 0; - - color <<= 4; -// color += 0x800; - - for (INT32 y = 0; y < 16; y++, sy++) - { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < 16; x++, sx++) - { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * 16) + x) ^ flip] + color; - - if (mask[pxl]) continue; - - pTransDraw[sy * nScreenWidth + sx] = pxl + 0x800; - pPrioBitmap[sy * nScreenWidth + sx] = prio; - } - - sx -= 16; - } -} - -static void draw_sprites(INT32 priority) -{ - for (INT32 offs = 0; offs < 0x80; offs += 2) - { - INT32 attr = DrvSprRAM[0x1780 + offs]; - INT32 code = DrvSprRAM[0x0780 + offs] + ((attr & 0x80) << 1); - INT32 color = DrvSprRAM[0x0781 + offs] & 0x3f; - INT32 sx = (DrvSprRAM[0x0f81 + offs]) + 0x100*(DrvSprRAM[0x1781 + offs] & 1) - 47; - INT32 sy = 256 - DrvSprRAM[0xf80 + offs] + 9; - INT32 flipx = (attr & 0x01); - INT32 flipy = (attr & 0x02) >> 1; - INT32 sizex = (attr & 0x04) >> 2; - INT32 sizey = (attr & 0x08) >> 3; - - code &= ~((sizey << 1) | sizex); - - if (*flipscreen) - { - flipx ^= 1; - flipy ^= 1; - } - - sy = ((sy - 16 * sizey) & 0xff) - 32; // fix wraparound - - for (INT32 y = 0; y <= sizey; y++) - { - for (INT32 x = 0; x <= sizex; x++) - { - draw_sprite(code + ((y ^ (sizey * flipy)) * 2) + (x ^ (sizex * flipx)), sx + 16*x - 24, sy + 16*y - 16, color, flipx, flipy, priority); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - memset (pPrioBitmap, 0, 288 * 224 * sizeof(UINT8)); - - INT32 nLayer = nBurnLayer; - - draw_sprites(0); - - if (nLayer & 1) draw_bg_layer(); - - if (nLayer & 2) draw_fg_layer(0); - - draw_sprites(1); - - if (nLayer & 4) draw_fg_layer(1); - - draw_sprites(2); - - BurnTransferCopy(DrvPalette + palette_bank[0] * 0xc00); - - BurnLEDRender(); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - DrvInputs[0] = (DrvInputs[0] & 0x7f) | (DrvDips[0] & 0x80); - // if (coin_lockout[0]) DrvInputs[0] |= 0x0c; - } - - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 49152000 / 32 / 60, 49152000 / 8 / 4 / 60 }; // refresh 60.606060 - INT32 nCyclesDone[2] = { 0, 0 }; - - M6809Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] += M6809Run(nSegment); - if (i == (nInterleave - 1) && interrupt_enable[0]) M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - nSegment = nCyclesTotal[1] / nInterleave; - - if (mcu_reset) { - nCyclesDone[1] += nSegment; - } else { - nCyclesDone[1] += HD63701Run(nSegment); - if (i == (nInterleave - 1) && interrupt_enable[1]) HD63701SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - } - nSoundBufferPos += nSegmentLength; - } - } - - M6809Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllMem; - ba.nLen = RamEnd - AllMem; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - HD63701Scan(nAction); - - NamcoSoundScan(nAction, pnMin); - BurnLEDScan(nAction, pnMin); - - SCAN_VAR(watchdog); - SCAN_VAR(mcu_reset); - DrvRecalc = 1; - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(pl_lastbank); - M6809Close(); - } - } - - return 0; -} - - -// Pac-Land (World) - -static struct BurnRomInfo paclandRomDesc[] = { - { "pl5_01b.8b", 0x4000, 0xb0ea7631, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "pl5_02.8d", 0x4000, 0xd903e84e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pl1_3.8e", 0x4000, 0xaa9fa739, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pl1_4.8f", 0x4000, 0x2b895a90, 1 | BRF_PRG | BRF_ESS }, // 3 - { "pl1_5.8h", 0x4000, 0x7af66200, 1 | BRF_PRG | BRF_ESS }, // 4 - { "pl3_6.8j", 0x4000, 0x2ffe3319, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "pl1_7.3e", 0x2000, 0x8c5becae, 2 | BRF_PRG | BRF_ESS }, // 6 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "pl2_12.6n", 0x2000, 0xa63c8726, 3 | BRF_GRA }, // 8 Foreground Tiles - - { "pl4_13.6t", 0x2000, 0x3ae582fd, 4 | BRF_GRA }, // 9 Background Tiles - - { "pl1-9.6f", 0x4000, 0xf5d5962b, 5 | BRF_GRA }, // 10 Sprites - { "pl1-8.6e", 0x4000, 0xa2ebfa4a, 5 | BRF_GRA }, // 11 - { "pl1-10.7e", 0x4000, 0xc7cf1904, 5 | BRF_GRA }, // 12 - { "pl1-11.7f", 0x4000, 0x6621361a, 5 | BRF_GRA }, // 13 - - { "pl1-2.1t", 0x0400, 0x472885de, 6 | BRF_GRA }, // 14 Color PROMs - { "pl1-1.1r", 0x0400, 0xa78ebdaf, 6 | BRF_GRA }, // 15 - { "pl1-5.5t", 0x0400, 0x4b7ee712, 6 | BRF_GRA }, // 16 - { "pl1-4.4n", 0x0400, 0x3a7be418, 6 | BRF_GRA }, // 17 - { "pl1-3.6l", 0x0400, 0x80558da8, 6 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(pacland) -STD_ROM_FN(pacland) - -struct BurnDriver BurnDrvPacland = { - "pacland", NULL, NULL, NULL, "1984", - "Pac-Land (World)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, paclandRomInfo, paclandRomName, NULL, NULL, PaclandInputInfo, PaclandDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0xc00 * 4, - 288, 224, 4, 3 -}; - - -// Pac-Land (Japan new) - -static struct BurnRomInfo paclandjRomDesc[] = { - { "pl6_01.8b", 0x4000, 0x4c96e11c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "pl6_02.8d", 0x4000, 0x8cf5bd8d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pl1_3.8e", 0x4000, 0xaa9fa739, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pl1_4.8f", 0x4000, 0x2b895a90, 1 | BRF_PRG | BRF_ESS }, // 3 - { "pl1_5.8h", 0x4000, 0x7af66200, 1 | BRF_PRG | BRF_ESS }, // 4 - { "pl1_6.8j", 0x4000, 0xb01e59a9, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "pl1_7.3e", 0x2000, 0x8c5becae, 2 | BRF_PRG | BRF_ESS }, // 6 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "pl6_12.6n", 0x2000, 0xc8cb61ab, 3 | BRF_GRA }, // 8 Foreground Tiles - - { "pl1_13.6t", 0x2000, 0x6c5ed9ae, 4 | BRF_GRA }, // 9 Background Tiles - - { "pl1_9b.6f", 0x4000, 0x80768a87, 5 | BRF_GRA }, // 10 Sprites - { "pl1_8.6e", 0x4000, 0x2b20e46d, 5 | BRF_GRA }, // 11 - { "pl1_10b.7e", 0x4000, 0xffd9d66e, 5 | BRF_GRA }, // 12 - { "pl1_11.7f", 0x4000, 0xc59775d8, 5 | BRF_GRA }, // 13 - - { "pl1-2.1t", 0x0400, 0x472885de, 6 | BRF_GRA }, // 14 Color PROMs - { "pl1-1.1r", 0x0400, 0xa78ebdaf, 6 | BRF_GRA }, // 15 - { "pl1-5.5t", 0x0400, 0x4b7ee712, 6 | BRF_GRA }, // 16 - { "pl1-4.4n", 0x0400, 0x3a7be418, 6 | BRF_GRA }, // 17 - { "pl1-3.6l", 0x0400, 0x80558da8, 6 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(paclandj) -STD_ROM_FN(paclandj) - -struct BurnDriver BurnDrvPaclandj = { - "paclandj", "pacland", NULL, NULL, "1984", - "Pac-Land (Japan new)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, paclandjRomInfo, paclandjRomName, NULL, NULL,PaclandInputInfo, PaclandDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0xc00 * 4, - 288, 224, 4, 3 -}; - - -// Pac-Land (Japan old) - -static struct BurnRomInfo paclandjoRomDesc[] = { - { "pl1_1.8b", 0x4000, 0xf729fb94, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "pl1_2.8d", 0x4000, 0x5c66eb6f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pl1_3.8e", 0x4000, 0xaa9fa739, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pl1_4.8f", 0x4000, 0x2b895a90, 1 | BRF_PRG | BRF_ESS }, // 3 - { "pl1_5.8h", 0x4000, 0x7af66200, 1 | BRF_PRG | BRF_ESS }, // 4 - { "pl1_6.8j", 0x4000, 0xb01e59a9, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "pl1_7.3e", 0x2000, 0x8c5becae, 2 | BRF_PRG | BRF_ESS }, // 6 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "pl1_12.6n", 0x2000, 0xc159fbce, 3 | BRF_GRA }, // 8 Foreground Tiles - - { "pl1_13.6t", 0x2000, 0x6c5ed9ae, 4 | BRF_GRA }, // 9 Background Tiles - - { "pl1_9b.6f", 0x4000, 0x80768a87, 5 | BRF_GRA }, // 10 Sprites - { "pl1_8.6e", 0x4000, 0x2b20e46d, 5 | BRF_GRA }, // 11 - { "pl1_10b.7e", 0x4000, 0xffd9d66e, 5 | BRF_GRA }, // 12 - { "pl1_11.7f", 0x4000, 0xc59775d8, 5 | BRF_GRA }, // 13 - - { "pl1-2.1t", 0x0400, 0x472885de, 6 | BRF_GRA }, // 14 Color PROMs - { "pl1-1.1r", 0x0400, 0xa78ebdaf, 6 | BRF_GRA }, // 15 - { "pl1-5.5t", 0x0400, 0x4b7ee712, 6 | BRF_GRA }, // 16 - { "pl1-4.4n", 0x0400, 0x3a7be418, 6 | BRF_GRA }, // 17 - { "pl1-3.6l", 0x0400, 0x80558da8, 6 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(paclandjo) -STD_ROM_FN(paclandjo) - -struct BurnDriver BurnDrvPaclandjo = { - "paclandjo", "pacland", NULL, NULL, "1984", - "Pac-Land (Japan old)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, paclandjoRomInfo, paclandjoRomName, NULL, NULL, PaclandInputInfo, PaclandDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0xc00 * 4, - 288, 224, 4, 3 -}; - - -// Pac-Land (Japan older) - -static struct BurnRomInfo paclandjo2RomDesc[] = { - { "pl1_1.8b", 0x4000, 0xf729fb94, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "pl1_2.8d", 0x4000, 0x5c66eb6f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pl1_3.8e", 0x4000, 0xaa9fa739, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pl1_4.8f", 0x4000, 0x2b895a90, 1 | BRF_PRG | BRF_ESS }, // 3 - { "pl1_5.8h", 0x4000, 0x7af66200, 1 | BRF_PRG | BRF_ESS }, // 4 - { "pl1_6.8j", 0x4000, 0xb01e59a9, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "pl1_7.3e", 0x2000, 0x8c5becae, 2 | BRF_PRG | BRF_ESS }, // 6 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "pl1_12.6n", 0x2000, 0xc159fbce, 3 | BRF_GRA }, // 8 Foreground Tiles - - { "pl1_13.6t", 0x2000, 0x6c5ed9ae, 4 | BRF_GRA }, // 9 Background Tiles - - { "pl1_9.6f", 0x4000, 0x80768a87, 5 | BRF_GRA }, // 10 Sprites - { "pl1_8.6e", 0x4000, 0x2b20e46d, 5 | BRF_GRA }, // 11 - { "pl1_10.7e", 0x4000, 0xc62660e8, 5 | BRF_GRA }, // 12 - { "pl1_11.7f", 0x4000, 0xc59775d8, 5 | BRF_GRA }, // 13 - - { "pl1-2.1t", 0x0400, 0x472885de, 6 | BRF_GRA }, // 14 Color PROMs - { "pl1-1.1r", 0x0400, 0xa78ebdaf, 6 | BRF_GRA }, // 15 - { "pl1-5.5t", 0x0400, 0x4b7ee712, 6 | BRF_GRA }, // 16 - { "pl1-4.4n", 0x0400, 0x3a7be418, 6 | BRF_GRA }, // 17 - { "pl1-3.6l", 0x0400, 0x80558da8, 6 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(paclandjo2) -STD_ROM_FN(paclandjo2) - -struct BurnDriver BurnDrvPaclandjo2 = { - "paclandjo2", "pacland", NULL, NULL, "1984", - "Pac-Land (Japan older)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, paclandjo2RomInfo, paclandjo2RomName, NULL, NULL, PaclandInputInfo, PaclandDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0xc00 * 4, - 288, 224, 4, 3 -}; - - -// Pac-Land (Midway) - -static struct BurnRomInfo paclandmRomDesc[] = { - { "pl1-1", 0x4000, 0xa938ae99, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "pl1-2", 0x4000, 0x3fe43bb5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pl1_3.8e", 0x4000, 0xaa9fa739, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pl1_4.8f", 0x4000, 0x2b895a90, 1 | BRF_PRG | BRF_ESS }, // 3 - { "pl1_5.8h", 0x4000, 0x7af66200, 1 | BRF_PRG | BRF_ESS }, // 4 - { "pl1_6.8j", 0x4000, 0xb01e59a9, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "pl1_7.3e", 0x2000, 0x8c5becae, 2 | BRF_PRG | BRF_ESS }, // 6 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "pl1_12.6n", 0x2000, 0xc159fbce, 3 | BRF_GRA }, // 8 Foreground Tiles - - { "pl1_13.6t", 0x2000, 0x6c5ed9ae, 4 | BRF_GRA }, // 9 Background Tiles - - { "pl1-9.6f", 0x4000, 0xf5d5962b, 5 | BRF_GRA }, // 10 Sprites - { "pl1-8.6e", 0x4000, 0xa2ebfa4a, 5 | BRF_GRA }, // 11 - { "pl1-10.7e", 0x4000, 0xc7cf1904, 5 | BRF_GRA }, // 12 - { "pl1-11.7f", 0x4000, 0x6621361a, 5 | BRF_GRA }, // 13 - - { "pl1-2.1t", 0x0400, 0x472885de, 6 | BRF_GRA }, // 14 Color PROMs - { "pl1-1.1r", 0x0400, 0xa78ebdaf, 6 | BRF_GRA }, // 15 - { "pl1-5.5t", 0x0400, 0x4b7ee712, 6 | BRF_GRA }, // 16 - { "pl1-4.4n", 0x0400, 0x3a7be418, 6 | BRF_GRA }, // 17 - { "pl1-3.6l", 0x0400, 0x80558da8, 6 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(paclandm) -STD_ROM_FN(paclandm) - -struct BurnDriver BurnDrvPaclandm = { - "paclandm", "pacland", NULL, NULL, "1984", - "Pac-Land (Midway)\0", NULL, "Namco (Bally Midway license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, paclandmRomInfo, paclandmRomName, NULL, NULL, PaclandInputInfo, PaclandDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0xc00 * 4, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_pacman.cpp b/jan/src/burn/drv/pre90s/d_pacman.cpp deleted file mode 100644 index c13299c21..000000000 --- a/jan/src/burn/drv/pre90s/d_pacman.cpp +++ /dev/null @@ -1,7016 +0,0 @@ -// FB Alpha Puckman module -// Based on MAME driver by Nicola Salmoria and many others - -// Fix Shoot the Bull inputs - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "bitswap.h" -#include "sn76496.h" -#include "namco_snd.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvQROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprRAM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvTransTable; - -static INT16 *pAY8910Buffer[3]; -static UINT32 *Palette; -static UINT8 DrvRecalc; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[8] = {0,0,0,0,0,0,0,0}; -static UINT8 DrvJoy2[8] = {0,0,0,0,0,0,0,0}; -static UINT8 DrvInputs[2] = {0,0}; - -static UINT8 DrvDips[4] = {0,0,0,0}; -static INT16 DrvAxis[2] = { 0, 0 }; -static INT16 nAnalogAxis[2] = {0,0}; -static UINT8 nCharAxis[2] = {0,0}; - -enum { PACMAN=0, MSPACMAN, CANNONBP, MAKETRAX, PIRANHA, VANVAN, NMOUSE, DREMSHPR, - MSCHAMP, BIGBUCKS, ROCKTRV2, ALIBABA, CRUSHS, SHOOTBUL, BIRDIY, EPOS, PENGO, JUMPSHOT }; - -static INT32 game_select; -static INT32 acitya = 0; - -static UINT8 *flipscreen; - -static INT32 interrupt_mode; -static INT32 interrupt_mask; - -static UINT8 colortablebank; -static UINT8 palettebank; -static UINT8 spritebank; -static UINT8 charbank; -static INT32 nPacBank; - -static INT32 alibaba_mystery; -static UINT8 *rocktrv2_prot_data; -static INT8 epos_hardware_counter; -static UINT8 mschamp_counter; -static UINT8 cannonb_bit_to_read; - -static UINT32 watchdog; - -//------------------------------------------------------------------------------------------------------ - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag"}, - - {"Dip Switches 1 ", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 4", BIT_DIPSWITCH, DrvDips + 3, "dip"}, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo lizwizInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 4, "diag"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 6, "tilt"}, - - {"Dip Switches 1 ", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 4", BIT_DIPSWITCH, DrvDips + 3, "dip"}, -}; - -STDINPUTINFO(lizwiz) - -static struct BurnInputInfo PengoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip"}, -}; - -STDINPUTINFO(Pengo) - -static struct BurnInputInfo mschampInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"Coin 3", BIT_DIGITAL, DrvJoy1 + 7, "p3 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 4", BIT_DIPSWITCH, DrvDips + 3, "dip"}, -}; - -STDINPUTINFO(mschamp) - -static struct BurnInputInfo eyesInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 6, "tilt"}, - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(eyes) - -static struct BurnInputInfo theglobpInputList[] = { - {"Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 2"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag"}, - - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(theglobp) - -static struct BurnInputInfo EeekkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1" }, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Eeekk) - -static struct BurnInputInfo ponpokoInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag"}, - - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 3, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 4", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(ponpoko) - -static struct BurnInputInfo vanvanInputList[] = { - {"Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag"}, - - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(vanvan) - -static struct BurnInputInfo vanvankInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin"}, - - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(vanvank) - -static struct BurnInputInfo cannonbpInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(cannonbp) - -static struct BurnInputInfo rocktrv2InputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - - {"Tilt", BIT_DIGITAL, DrvJoy1 + 7, "diag"}, - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 3, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 4", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(rocktrv2) - -static struct BurnInputInfo bigbucksInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag"}, - - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(bigbucks) - -static struct BurnInputInfo woodpekInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag"}, - - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(woodpek) - -static struct BurnInputInfo acityaInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 4"}, - {"P1 Button 5", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 5"}, - {"P1 Button 6", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 6"}, - - {"Service Mode 1", BIT_DIGITAL, DrvJoy1 + 4, "diag"}, - {"Service Mode 2", BIT_DIGITAL, DrvJoy2 + 4, "diag"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(acitya) - -static struct BurnInputInfo bwcasinoInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 4"}, - {"P1 Button 5", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 5"}, - {"P1 Button 6", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 6"}, - - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 4"}, - {"P2 Button 5", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 5"}, - {"P2 Button 6", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 6"}, - - {"Service Mode ", BIT_DIGITAL, DrvJoy1 + 4, "diag"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(bwcasino) - -static struct BurnInputInfo dremshprInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire "}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 4", BIT_DIPSWITCH, DrvDips + 3, "dip"}, -}; - -STDINPUTINFO(dremshpr) - -static struct BurnInputInfo alibabaInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 4", BIT_DIPSWITCH, DrvDips + 3, "dip"}, -}; - -STDINPUTINFO(alibaba) - -static struct BurnInputInfo jumpshotInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag"}, - - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(jumpshot) - -static struct BurnInputInfo korosukeInputList[] = { - {"Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin"}, - {"Start 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag"}, - - {"Dip Switches 1 ", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip Switches 4", BIT_DIPSWITCH, DrvDips + 3, "dip"}, -}; - -STDINPUTINFO(korosuke) - -#define A(a, b, c, d) { a, b, (UINT8*)(c), d } - -static struct BurnInputInfo shootbulInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"Coin 3", BIT_DIGITAL, DrvJoy1 + 7, "p3 coin"}, - {"Start", BIT_DIGITAL, DrvJoy2 + 6, "p1 start"}, - - A("P1 X Axis", BIT_ANALOG_REL, DrvAxis + 0, "mouse x-axis"), - A("P1 Y Axis", BIT_ANALOG_REL, DrvAxis + 1, "mouse y-axis"), - - {"P1 Button A", BIT_DIGITAL, DrvJoy2 + 5, "mouse button 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - - {"Dip Switches 1", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip Switches 2", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip Switches 3", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(shootbul) - -#undef A - - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xc9, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "2C 1C" }, - {0x0e, 0x01, 0x03, 0x01, "1C 1C" }, - {0x0e, 0x01, 0x03, 0x02, "1C 2C" }, - {0x0e, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x00, "1" }, - {0x0e, 0x01, 0x0c, 0x04, "2" }, - {0x0e, 0x01, 0x0c, 0x08, "3" }, - {0x0e, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x30, 0x00, "10000" }, - {0x0e, 0x01, 0x30, 0x10, "15000" }, - {0x0e, 0x01, 0x30, 0x20, "20000" }, - {0x0e, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x40, 0x40, "Normal" }, - {0x0e, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Ghost Names" }, - {0x0e, 0x01, 0x80, 0x80, "Normal" }, - {0x0e, 0x01, 0x80, 0x00, "Alternate" }, - - {0 , 0xfe, 0 , 2 , "Rack Test (Cheat)" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo PacmanpeDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xc8, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "2C 1C, 1C 1C" }, - {0x0e, 0x01, 0x03, 0x01, "1C 2C, 1C 3C" }, - {0x0e, 0x01, 0x03, 0x02, "1C 1C, 1C 3C" }, - {0x0e, 0x01, 0x03, 0x00, "1C 1C, 1C 2C" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0e, 0x01, 0x04, 0x00, "2" }, - {0x0e, 0x01, 0x04, 0x04, "3" }, - - {0 , 0xfe, 0 , 2 , "Unknown" }, - {0x0e, 0x01, 0x08, 0x00, "Off" }, - {0x0e, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x30, 0x00, "10000" }, - {0x0e, 0x01, 0x30, 0x10, "15000" }, - {0x0e, 0x01, 0x30, 0x20, "20000" }, - {0x0e, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x40, 0x40, "Normal" }, - {0x0e, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Ghost Names" }, - {0x0e, 0x01, 0x80, 0x80, "Normal" }, - {0x0e, 0x01, 0x80, 0x00, "Alternate" }, - - {0 , 0xfe, 0 , 2 , "Rack Test (Cheat)" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Pacmanpe) - -static struct BurnDIPInfo PacumanDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xc8, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "2C 1C, 1C 1C" }, - {0x0e, 0x01, 0x03, 0x01, "1C 2C, 1C 3C" }, - {0x0e, 0x01, 0x03, 0x02, "1C 2C, 1C 4C" }, - {0x0e, 0x01, 0x03, 0x00, "1C 1C, 1C 2C" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x00, "1" }, - {0x0e, 0x01, 0x0c, 0x04, "2" }, - {0x0e, 0x01, 0x0c, 0x08, "3" }, - {0x0e, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x30, 0x00, "10000" }, - {0x0e, 0x01, 0x30, 0x10, "15000" }, - {0x0e, 0x01, 0x30, 0x20, "20000" }, - {0x0e, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x40, 0x40, "Normal" }, - {0x0e, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Ghost Names" }, - {0x0e, 0x01, 0x80, 0x80, "Normal" }, - {0x0e, 0x01, 0x80, 0x00, "Alternate" }, - - {0 , 0xfe, 0 , 2 , "Rack Test (Cheat)" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Pacuman) - -static struct BurnDIPInfo PengoDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xb0, NULL }, - {0x12, 0xff, 0xff, 0xcc, NULL }, - - {0 , 0xfe, 0 , 1, "Service Mode" }, - {0x10, 0x01, 0x10, 0x10, "Off" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x01, 0x00, "30000" }, - {0x11, 0x01, 0x01, 0x01, "50000" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x00, "Upright" }, - {0x11, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x18, 0x18, "2" }, - {0x11, 0x01, 0x18, 0x10, "3" }, - {0x11, 0x01, 0x18, 0x08, "4" }, - {0x11, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Rack Test (Cheat)" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0xc0, 0xc0, "Easy" }, - {0x11, 0x01, 0xc0, 0x80, "Medium" }, - {0x11, 0x01, 0xc0, 0x40, "Hard" }, - {0x11, 0x01, 0xc0, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "2 Coins/1 Credit 5/3" }, - {0x12, 0x01, 0x0f, 0x05, "2 Coins/1 Credit 4/3" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin/1 Credit 5/6" }, - {0x12, 0x01, 0x0f, 0x03, "1 Coin/1 Credit 4/5" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin/1 Credit 2/3" }, - {0x12, 0x01, 0x0f, 0x02, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "1 Coin/2 Credits 5/11" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin/2 Credits 4/9" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "2 Coins/1 Credit 5/3" }, - {0x12, 0x01, 0xf0, 0x50, "2 Coins/1 Credit 4/3" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin/1 Credit 5/6" }, - {0x12, 0x01, 0xf0, 0x30, "1 Coin/1 Credit 4/5" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin/1 Credit 2/3" }, - {0x12, 0x01, 0xf0, 0x20, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "1 Coin/2 Credits 5/11" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin/2 Credits 4/9" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "1 Coin 6 Credits" }, -}; - -STDDIPINFO(Pengo) - -static struct BurnDIPInfo mspacmanDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xc9, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "2C 1C" }, - {0x0e, 0x01, 0x03, 0x01, "1C 1C" }, - {0x0e, 0x01, 0x03, 0x02, "1C 2C" }, - {0x0e, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x00, "1" }, - {0x0e, 0x01, 0x0c, 0x04, "2" }, - {0x0e, 0x01, 0x0c, 0x08, "3" }, - {0x0e, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x30, 0x00, "10000" }, - {0x0e, 0x01, 0x30, 0x10, "15000" }, - {0x0e, 0x01, 0x30, 0x20, "20000" }, - {0x0e, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x40, 0x40, "Normal" }, - {0x0e, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Rack Test (Cheat)" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(mspacman) - -static struct BurnDIPInfo mschampDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xc9, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2 , "Rack Test (Cheat)" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "2C 1C" }, - {0x0e, 0x01, 0x03, 0x01, "1C 1C" }, - {0x0e, 0x01, 0x03, 0x02, "1C 2C" }, - {0x0e, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x00, "1" }, - {0x0e, 0x01, 0x0c, 0x04, "2" }, - {0x0e, 0x01, 0x0c, 0x08, "3" }, - {0x0e, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x30, 0x00, "10000" }, - {0x0e, 0x01, 0x30, 0x10, "15000" }, - {0x0e, 0x01, 0x30, 0x20, "20000" }, - {0x0e, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x40, 0x40, "Normal" }, - {0x0e, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Game" }, - {0x11, 0x01, 0x01, 0x01, "Champion Edition" }, - {0x11, 0x01, 0x01, 0x00, "Super Zola Pac Gal" }, -}; - -STDDIPINFO(mschamp) - -static struct BurnDIPInfo maketraxDIPList[]= -{ - {0x0e, 0xff, 0x3f, 0x31, NULL }, - {0x0f, 0xff, 0xff, 0xef, NULL }, - {0x10, 0xff, 0x6f, 0x6f, NULL }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x10, 0x00, "Upright" }, - {0x0f, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "2C 1C" }, - {0x0e, 0x01, 0x03, 0x01, "1C 1C" }, - {0x0e, 0x01, 0x03, 0x02, "1C 2C" }, - {0x0e, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x00, "3" }, - {0x0e, 0x01, 0x0c, 0x04, "4" }, - {0x0e, 0x01, 0x0c, 0x08, "5" }, - {0x0e, 0x01, 0x0c, 0x0c, "6" }, - - {0 , 0xfe, 0 , 2 , "First Pattern" }, - {0x0e, 0x01, 0x30, 0x10, "Easy" }, - {0x0e, 0x01, 0x30, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Teleport Holes" }, - {0x0e, 0x01, 0x20, 0x20, "Off" }, - {0x0e, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(maketrax) - -static struct BurnDIPInfo mbrushDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x39, NULL }, - {0x0f, 0xff, 0xff, 0xef, NULL }, - {0x10, 0xff, 0xff, 0x6f, NULL }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x10, 0x00, "Upright" }, - {0x0f, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "2C 1C" }, - {0x0e, 0x01, 0x03, 0x01, "1C 1C" }, - {0x0e, 0x01, 0x03, 0x02, "1C 2C" }, - {0x0e, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x00, "1" }, - {0x0e, 0x01, 0x0c, 0x04, "2" }, - {0x0e, 0x01, 0x0c, 0x08, "3" }, - {0x0e, 0x01, 0x0c, 0x0c, "4" }, -}; - -STDDIPINFO(mbrush) - -static struct BurnDIPInfo crushsDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2 , "Teleport Holes" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x11, 0x01, 0x0f, 0x08, "2C 1C" }, - {0x11, 0x01, 0x0f, 0x09, "2C 2C" }, - {0x11, 0x01, 0x0f, 0x00, "1C 1C" }, - {0x11, 0x01, 0x0f, 0x0a, "2C 3C" }, - {0x11, 0x01, 0x0f, 0x0b, "2C 4C" }, - {0x11, 0x01, 0x0f, 0x01, "2C 2C" }, - {0x11, 0x01, 0x0f, 0x0c, "1C 5C" }, - {0x11, 0x01, 0x0f, 0x0d, "2C 6C" }, - {0x11, 0x01, 0x0f, 0x02, "1C 3C" }, - {0x11, 0x01, 0x0f, 0x0e, "2C 7C" }, - {0x11, 0x01, 0x0f, 0x0f, "2C 8C" }, - {0x11, 0x01, 0x0f, 0x03, "1C 4C" }, - {0x11, 0x01, 0x0f, 0x04, "1C 5C" }, - {0x11, 0x01, 0x0f, 0x05, "1C 6C" }, - {0x11, 0x01, 0x0f, 0x06, "1C 7C" }, - {0x11, 0x01, 0x0f, 0x07, "1C 8C" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x11, 0x01, 0xf0, 0x80, "2C 1C" }, - {0x11, 0x01, 0xf0, 0x90, "2C 2C" }, - {0x11, 0x01, 0xf0, 0x00, "1C 1C" }, - {0x11, 0x01, 0xf0, 0xa0, "2C 3C" }, - {0x11, 0x01, 0xf0, 0xb0, "2C 4C" }, - {0x11, 0x01, 0xf0, 0x10, "2C 2C" }, - {0x11, 0x01, 0xf0, 0xc0, "1C 5C" }, - {0x11, 0x01, 0xf0, 0xd0, "2C 6C" }, - {0x11, 0x01, 0xf0, 0x20, "1C 3C" }, - {0x11, 0x01, 0xf0, 0xe0, "2C 7C" }, - {0x11, 0x01, 0xf0, 0xf0, "2C 8C" }, - {0x11, 0x01, 0xf0, 0x30, "1C 4C" }, - {0x11, 0x01, 0xf0, 0x40, "1C 5C" }, - {0x11, 0x01, 0xf0, 0x50, "1C 6C" }, - {0x11, 0x01, 0xf0, 0x60, "1C 7C" }, - {0x11, 0x01, 0xf0, 0x70, "1C 8C" }, -}; - -STDDIPINFO(crushs) - -static struct BurnDIPInfo ponpokoDIPList[]= -{ - {0x10, 0xff, 0xff, 0xd1, NULL }, - {0x11, 0xff, 0xff, 0xb1, NULL }, - {0x12, 0xff, 0xff, 0xe0, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x10, 0x01, 0x03, 0x00, "10000" }, - {0x10, 0x01, 0x03, 0x01, "30000" }, - {0x10, 0x01, 0x03, 0x02, "50000" }, - {0x10, 0x01, 0x03, 0x03, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x30, 0x00, "2" }, - {0x10, 0x01, 0x30, 0x10, "3" }, - {0x10, 0x01, 0x30, 0x20, "4" }, - {0x10, 0x01, 0x30, 0x30, "5" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x40, 0x40, "Upright" }, - {0x10, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 16 , "Coinage" }, - {0x11, 0x01, 0x0f, 0x04, "A 3/1 B 3/1" }, - {0x11, 0x01, 0x0f, 0x0e, "A 3/1 B 1/2" }, - {0x11, 0x01, 0x0f, 0x0f, "A 3/1 B 1/4" }, - {0x11, 0x01, 0x0f, 0x02, "A 2/1 B 2/1" }, - {0x11, 0x01, 0x0f, 0x0d, "A 2/1 B 1/1" }, - {0x11, 0x01, 0x0f, 0x07, "A 2/1 B 1/3" }, - {0x11, 0x01, 0x0f, 0x0b, "A 2/1 B 1/5" }, - {0x11, 0x01, 0x0f, 0x0c, "A 2/1 B 1/6" }, - {0x11, 0x01, 0x0f, 0x01, "A 1/1 B 1/1" }, - {0x11, 0x01, 0x0f, 0x06, "A 1/1 B 4/5" }, - {0x11, 0x01, 0x0f, 0x05, "A 1/1 B 2/3" }, - {0x11, 0x01, 0x0f, 0x0a, "A 1/1 B 1/3" }, - {0x11, 0x01, 0x0f, 0x08, "A 1/1 B 1/5" }, - {0x11, 0x01, 0x0f, 0x09, "A 1/1 B 1/6" }, - {0x11, 0x01, 0x0f, 0x03, "A 1/2 B 1/2" }, - {0x11, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(ponpoko) - -static struct BurnDIPInfo bwcasinoDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x7f, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x80, 0x00, "Upright" }, - {0x0f, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 16 , "Hands Per Game" }, - {0x10, 0x01, 0x1e, 0x1e, "3" }, - {0x10, 0x01, 0x1e, 0x1c, "4" }, - {0x10, 0x01, 0x1e, 0x1a, "5" }, - {0x10, 0x01, 0x1e, 0x18, "6" }, - {0x10, 0x01, 0x1e, 0x16, "7" }, - {0x10, 0x01, 0x1e, 0x14, "8" }, - {0x10, 0x01, 0x1e, 0x12, "9" }, - {0x10, 0x01, 0x1e, 0x10, "10" }, - {0x10, 0x01, 0x1e, 0x0e, "11" }, - {0x10, 0x01, 0x1e, 0x0c, "12" }, - {0x10, 0x01, 0x1e, 0x0a, "13" }, - {0x10, 0x01, 0x1e, 0x07, "14" }, - {0x10, 0x01, 0x1e, 0x06, "15" }, - {0x10, 0x01, 0x1e, 0x04, "16" }, - {0x10, 0x01, 0x1e, 0x02, "17" }, - {0x10, 0x01, 0x1e, 0x00, "18" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x20, 0x20, "Off" }, - {0x10, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(bwcasino) - -static struct BurnDIPInfo acityaDIPList[]= -{ - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16 , "Hands Per Game" }, - {0x0b, 0x01, 0x1e, 0x1e, "3" }, - {0x0b, 0x01, 0x1e, 0x1c, "4" }, - {0x0b, 0x01, 0x1e, 0x1a, "5" }, - {0x0b, 0x01, 0x1e, 0x18, "6" }, - {0x0b, 0x01, 0x1e, 0x16, "7" }, - {0x0b, 0x01, 0x1e, 0x14, "8" }, - {0x0b, 0x01, 0x1e, 0x12, "9" }, - {0x0b, 0x01, 0x1e, 0x10, "10" }, - {0x0b, 0x01, 0x1e, 0x0e, "11" }, - {0x0b, 0x01, 0x1e, 0x0c, "12" }, - {0x0b, 0x01, 0x1e, 0x0a, "13" }, - {0x0b, 0x01, 0x1e, 0x07, "14" }, - {0x0b, 0x01, 0x1e, 0x06, "15" }, - {0x0b, 0x01, 0x1e, 0x04, "16" }, - {0x0b, 0x01, 0x1e, 0x02, "17" }, - {0x0b, 0x01, 0x1e, 0x00, "18" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x20, 0x20, "Off" }, - {0x0b, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(acitya) - -static struct BurnDIPInfo eyesDIPList[]= -{ - {0x10, 0xff, 0xff, 0xfb, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x03, 0x01, "2C 1C" }, - {0x10, 0x01, 0x03, 0x03, "1C 1C" }, - {0x10, 0x01, 0x03, 0x02, "1C 2C" }, - {0x10, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x0c, 0x0c, "2" }, - {0x10, 0x01, 0x0c, 0x08, "3" }, - {0x10, 0x01, 0x0c, 0x04, "4" }, - {0x10, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x10, 0x01, 0x30, 0x30, "50000" }, - {0x10, 0x01, 0x30, 0x20, "75000" }, - {0x10, 0x01, 0x30, 0x10, "100000" }, - {0x10, 0x01, 0x30, 0x00, "125000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x40, 0x40, "Upright" }, - {0x10, 0x01, 0x40, 0x00, "Cocktail" }, -}; - -STDDIPINFO(eyes) - -static struct BurnDIPInfo mrtntDIPList[]= -{ - {0x10, 0xff, 0xff, 0xfb, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x03, 0x01, "2C 1C" }, - {0x10, 0x01, 0x03, 0x03, "1C 1C" }, - {0x10, 0x01, 0x03, 0x02, "1C 2C" }, - {0x10, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x0c, 0x0c, "2" }, - {0x10, 0x01, 0x0c, 0x08, "3" }, - {0x10, 0x01, 0x0c, 0x04, "4" }, - {0x10, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x10, 0x01, 0x30, 0x30, "75000" }, - {0x10, 0x01, 0x30, 0x20, "100000" }, - {0x10, 0x01, 0x30, 0x10, "125000" }, - {0x10, 0x01, 0x30, 0x00, "150000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x40, 0x40, "Upright" }, - {0x10, 0x01, 0x40, 0x00, "Cocktail" }, -}; - -STDDIPINFO(mrtnt) - -static struct BurnDIPInfo alibabaDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xd9, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Rack Test (Cheat)" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x11, 0x01, 0x03, 0x03, "2C 1C" }, - {0x11, 0x01, 0x03, 0x01, "1C 1C" }, - {0x11, 0x01, 0x03, 0x02, "1C 2C" }, - {0x11, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x0c, 0x00, "1" }, - {0x11, 0x01, 0x0c, 0x04, "2" }, - {0x11, 0x01, 0x0c, 0x08, "3" }, - {0x11, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x11, 0x01, 0x30, 0x00, "10000" }, - {0x11, 0x01, 0x30, 0x10, "15000" }, - {0x11, 0x01, 0x30, 0x20, "20000" }, - {0x11, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x11, 0x01, 0x40, 0x40, "Normal" }, - {0x11, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(alibaba) - -static struct BurnDIPInfo theglobpDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x80, 0x80, "Upright" }, - {0x0f, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x03, 0x03, "3" }, - {0x10, 0x01, 0x03, 0x02, "4" }, - {0x10, 0x01, 0x03, 0x01, "5" }, - {0x10, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x10, 0x01, 0x1c, 0x1c, "Easiest" }, - {0x10, 0x01, 0x1c, 0x18, "Very Easy" }, - {0x10, 0x01, 0x1c, 0x14, "Easy" }, - {0x10, 0x01, 0x1c, 0x10, "Normal" }, - {0x10, 0x01, 0x1c, 0x0c, "Difficult" }, - {0x10, 0x01, 0x1c, 0x08, "Very Difficult" }, - {0x10, 0x01, 0x1c, 0x04, "Very Hard" }, - {0x10, 0x01, 0x1c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x20, 0x20, "Off" }, - {0x10, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(theglobp) - -static struct BurnDIPInfo woodpekDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xc1, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Rack Test (Cheat)" }, - {0x10, 0x01, 0x10, 0x10, "Off" }, - {0x10, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x11, 0x01, 0x03, 0x03, "2C 1C" }, - {0x11, 0x01, 0x03, 0x01, "1C 1C" }, - {0x11, 0x01, 0x03, 0x02, "1C 2C" }, - {0x11, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x0c, 0x00, "1" }, - {0x11, 0x01, 0x0c, 0x04, "2" }, - {0x11, 0x01, 0x0c, 0x08, "3" }, - {0x11, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x11, 0x01, 0x30, 0x00, "5000" }, - {0x11, 0x01, 0x30, 0x10, "10000" }, - {0x11, 0x01, 0x30, 0x20, "15000" }, - {0x11, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x40, 0x40, "Upright" }, - {0x11, 0x01, 0x40, 0x00, "Cocktail" }, -}; - -STDDIPINFO(woodpek) - -static struct BurnDIPInfo lizwizDIPList[]= -{ - {0x11, 0xff, 0xff, 0xfb, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x11, 0x01, 0x03, 0x01, "2C 1C" }, - {0x11, 0x01, 0x03, 0x03, "1C 1C" }, - {0x11, 0x01, 0x03, 0x02, "1C 2C" }, - {0x11, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x0c, 0x00, "5" }, - {0x11, 0x01, 0x0c, 0x04, "4" }, - {0x11, 0x01, 0x0c, 0x08, "3" }, - {0x11, 0x01, 0x0c, 0x0c, "2" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x11, 0x01, 0x30, 0x00, "75000" }, - {0x11, 0x01, 0x30, 0x10, "100000" }, - {0x11, 0x01, 0x30, 0x20, "125000" }, - {0x11, 0x01, 0x30, 0x30, "150000" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x11, 0x01, 0x40, 0x40, "Normal" }, - {0x11, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(lizwiz) - -static struct BurnDIPInfo vanvanDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xda, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x01, 0x00, "Upright" }, - {0x0f, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip screen" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0f, 0x01, 0x0c, 0x08, "20k and 100k" }, - {0x0f, 0x01, 0x0c, 0x04, "40k and 140k" }, - {0x0f, 0x01, 0x0c, 0x00, "70k and 200k" }, - {0x0f, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x30, 0x30, "1" }, - {0x0f, 0x01, 0x30, 0x20, "2" }, - {0x0f, 0x01, 0x30, 0x10, "3" }, - {0x0f, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0f, 0x01, 0xc0, 0x00, "2c_1c" }, - {0x0f, 0x01, 0xc0, 0xc0, "1C_1C" }, - {0x0f, 0x01, 0xc0, 0x80, "1c_2C" }, - {0x0f, 0x01, 0xc0, 0x40, "1C_3C" }, -}; - -STDDIPINFO(vanvan) - -static struct BurnDIPInfo nmouseDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xc9, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "2C 1C" }, - {0x0e, 0x01, 0x03, 0x01, "1C 1C" }, - {0x0e, 0x01, 0x03, 0x02, "1C 2C" }, - {0x0e, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x00, "1" }, - {0x0e, 0x01, 0x0c, 0x04, "2" }, - {0x0e, 0x01, 0x0c, 0x08, "3" }, - {0x0e, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x30, 0x00, "5000" }, - {0x0e, 0x01, 0x30, 0x10, "10000" }, - {0x0e, 0x01, 0x30, 0x20, "15000" }, - {0x0e, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x40, 0x40, "Normal" }, - {0x0e, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Rack Test (Cheat)" }, - {0x0f, 0x01, 0x10, 0x10, "Off" }, - {0x0f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(nmouse) - -static struct BurnDIPInfo jumpshotDIPList[]= -{ - {0x10, 0xff, 0xff, 0xf1, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 3 , "Time" }, - {0x10, 0x01, 0x03, 0x02, "2 Minutes" }, - {0x10, 0x01, 0x03, 0x03, "3 Minutes" }, - {0x10, 0x01, 0x03, 0x01, "4 Minutes" }, - - {0 , 0xfe, 0 , 2 , "Player Skin Tone" }, - {0x10, 0x01, 0x04, 0x04, "Lighter" }, - {0x10, 0x01, 0x04, 0x00, "Darker" }, - - {0 , 0xfe, 0 , 2 , "Player Skin Tone" }, - {0x10, 0x01, 0x08, 0x08, "Lighter" }, - {0x10, 0x01, 0x08, 0x00, "Darker" }, - - {0 , 0xfe, 0 , 2 , "Free play" }, - {0x10, 0x01, 0x10, 0x10, "Off" }, - {0x10, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "2 Players Game" }, - {0x10, 0x01, 0x20, 0x20, "1 Credit" }, - {0x10, 0x01, 0x20, 0x00, "2 Credits" }, -}; - -STDDIPINFO(jumpshot) - -static struct BurnDIPInfo jumpshtpDIPList[]= -{ - {0x10, 0xff, 0xff, 0xf1, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 3 , "Time" }, - {0x10, 0x01, 0x03, 0x02, "Short" }, - {0x10, 0x01, 0x03, 0x03, "Average" }, - {0x10, 0x01, 0x03, 0x01, "Above Average" }, - - {0 , 0xfe, 0 , 2 , "Player Skin Tone" }, - {0x10, 0x01, 0x04, 0x04, "Lighter" }, - {0x10, 0x01, 0x04, 0x00, "Darker" }, - - {0 , 0xfe, 0 , 2 , "Player Skin Tone" }, - {0x10, 0x01, 0x08, 0x08, "Lighter" }, - {0x10, 0x01, 0x08, 0x00, "Darker" }, - - {0 , 0xfe, 0 , 2 , "Free play" }, - {0x10, 0x01, 0x10, 0x10, "Off" }, - {0x10, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "2 Players Game" }, - {0x10, 0x01, 0x20, 0x20, "1 Credit" }, - {0x10, 0x01, 0x20, 0x00, "2 Credits" }, -}; - -STDDIPINFO(jumpshtp) - -static struct BurnDIPInfo dremshprDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfe, NULL }, - {0x0f, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x01, 0x01, "Upright" }, - {0x0f, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0f, 0x01, 0x0c, 0x08, "30000" }, - {0x0f, 0x01, 0x0c, 0x04, "50000" }, - {0x0f, 0x01, 0x0c, 0x00, "70000" }, - {0x0f, 0x01, 0x0c, 0x0c, "none" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x30, 0x30, "3" }, - {0x0f, 0x01, 0x30, 0x20, "4" }, - {0x0f, 0x01, 0x30, 0x10, "5" }, - {0x0f, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0, 4, "Coinage" }, - {0x0f, 0x01, 0xc0, 0x00, "2C 1C" }, - {0x0f, 0x01, 0xc0, 0xc0, "1C 1C" }, - {0x0f, 0x01, 0xc0, 0x80, "1C 2C" }, - {0x0f, 0x01, 0xc0, 0x40, "1C 3C" }, -}; - -STDDIPINFO(dremshpr) - -static struct BurnDIPInfo cannonbpDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Display" }, - {0x0f, 0x01, 0x03, 0x03, "Scores and Progression Bars" }, - {0x0f, 0x01, 0x03, 0x01, "Scores only" }, - {0x0f, 0x01, 0x03, 0x02, "Progression Bars only" }, - {0x0f, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x04, 0x04, "Upright" }, - {0x0f, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x18, 0x00, "3" }, - {0x0f, 0x01, 0x18, 0x08, "4" }, - {0x0f, 0x01, 0x18, 0x10, "5" }, - {0x0f, 0x01, 0x18, 0x18, "6" }, -}; - -STDDIPINFO(cannonbp) - -static struct BurnDIPInfo rocktrv2DIPList[]= -{ - {0x0e, 0xff, 0x3f, 0x33, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "2C 1C" }, - {0x0e, 0x01, 0x03, 0x01, "1C 1C" }, - {0x0e, 0x01, 0x03, 0x02, "1C 2C" }, - {0x0e, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8 , "Questions Per Game" }, - {0x0e, 0x01, 0x1c, 0x1c, "2" }, - {0x0e, 0x01, 0x1c, 0x18, "3" }, - {0x0e, 0x01, 0x1c, 0x14, "4" }, - {0x0e, 0x01, 0x1c, 0x10, "5" }, - {0x0e, 0x01, 0x1c, 0x0c, "6" }, - {0x0e, 0x01, 0x1c, 0x08, "7" }, - {0x0e, 0x01, 0x1c, 0x04, "8" }, - {0x0e, 0x01, 0x1c, 0x00, "9" }, - - {0 , 0xfe, 0 , 4 , "Clock Speed" }, - {0x0e, 0x01, 0x60, 0x60, "Beginner" }, - {0x0e, 0x01, 0x60, 0x40, "Intermediate" }, - {0x0e, 0x01, 0x60, 0x20, "Professional" }, - {0x0e, 0x01, 0x60, 0x00, "Super - Pro" }, - - {0 , 0xfe, 0 , 2 , "Freeze Image" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Mode" }, - {0x0f, 0x01, 0x01, 0x01, "Amusement" }, - {0x0f, 0x01, 0x01, 0x00, "Credit" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x02, 0x02, "Upright" }, - {0x0f, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "K.O. Switch" }, - {0x0f, 0x01, 0x04, 0x04, "Auto" }, - {0x0f, 0x01, 0x04, 0x00, "Manual" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x0f, 0x01, 0x70, 0x70, "10000" }, - {0x0f, 0x01, 0x70, 0x60, "17500" }, - {0x0f, 0x01, 0x70, 0x50, "25000" }, - {0x0f, 0x01, 0x70, 0x40, "32500" }, - {0x0f, 0x01, 0x70, 0x30, "40000" }, - {0x0f, 0x01, 0x70, 0x20, "47500" }, - {0x0f, 0x01, 0x70, 0x10, "55000" }, - {0x0f, 0x01, 0x70, 0x00, "62500" }, - - {0 , 0xfe, 0 , 2 , "Music" }, - {0x0f, 0x01, 0x80, 0x80, "On" }, - {0x0f, 0x01, 0x80, 0x00, "Off" }, -}; - -STDDIPINFO(rocktrv2) - -static struct BurnDIPInfo bigbucksDIPList[]= -{ - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Enable Adult Affairs Category" }, - {0x0c, 0x01, 0x10, 0x00, "Off" }, - {0x0c, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Time to bet / answer" }, - {0x0d, 0x01, 0x01, 0x00, "15 sec. / 10 sec." }, - {0x0d, 0x01, 0x01, 0x01, "20 sec. / 15 sec." }, - - {0 , 0xfe, 0 , 2 , "Continue if player busts"}, - {0x0d, 0x01, 0x02, 0x00, "Off" }, - {0x0d, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Show correct answer" }, - {0x0d, 0x01, 0x04, 0x00, "Off" }, - {0x0d, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0d, 0x01, 0x10, 0x00, "2C 1C" }, - {0x0d, 0x01, 0x10, 0x10, "1C 1C" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x20, 0x20, "Upright" }, - {0x0d, 0x01, 0x20, 0x00, "Cocktail" }, -}; - -STDDIPINFO(bigbucks) - -static struct BurnDIPInfo korosukeDIPList[]= -{ - {0x0f, 0xff, 0x3f, 0x31, NULL }, - {0x10, 0xff, 0xff, 0xef, NULL }, - {0x11, 0xff, 0x6f, 0x6f, NULL }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x10, 0x00, "Upright" }, - {0x10, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0f, 0x01, 0x03, 0x03, "2C 1C" }, - {0x0f, 0x01, 0x03, 0x01, "1C 1C" }, - {0x0f, 0x01, 0x03, 0x02, "1C 2C" }, - {0x0f, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x0c, 0x00, "3" }, - {0x0f, 0x01, 0x0c, 0x04, "4" }, - {0x0f, 0x01, 0x0c, 0x08, "5" }, - {0x0f, 0x01, 0x0c, 0x0c, "6" }, - - {0 , 0xfe, 0 , 2 , "First Pattern" }, - {0x0f, 0x01, 0x30, 0x10, "Easy" }, - {0x0f, 0x01, 0x30, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Teleport Holes" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(korosuke) - -static struct BurnDIPInfo shootbulDIPList[]= -{ - {0x08, 0xff, 0xff, 0xff, NULL }, - {0x09, 0xff, 0xff, 0xe0, NULL }, - {0x0A, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 5 , "Time" }, - {0x08, 0x01, 0x03, 0x01, "Short" }, - {0x08, 0x01, 0x03, 0x07, "Average" }, - {0x08, 0x01, 0x03, 0x03, "Long" }, - {0x08, 0x01, 0x03, 0x05, "Longer" }, - {0x08, 0x01, 0x03, 0x06, "Longest" }, - - {0 , 0xfe, 0 , 2 , "Title Page Sounds" }, - {0x08, 0x01, 0x08, 0x00, "Off" }, - {0x08, 0x01, 0x08, 0x08, "On" }, -}; - -STDDIPINFO(shootbul) - -static struct BurnDIPInfo EeekkDIPList[]= -{ - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0x53, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x80, 0x80, "Upright" }, - {0x0e, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x03, 0x03, "3" }, - {0x0f, 0x01, 0x03, 0x02, "4" }, - {0x0f, 0x01, 0x03, 0x01, "5" }, - {0x0f, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x0f, 0x01, 0x1c, 0x00, "8 (Hard)" }, - {0x0f, 0x01, 0x1c, 0x04, "7" }, - {0x0f, 0x01, 0x1c, 0x08, "6" }, - {0x0f, 0x01, 0x1c, 0x0c, "5" }, - {0x0f, 0x01, 0x1c, 0x10, "4" }, - {0x0f, 0x01, 0x1c, 0x14, "3" }, - {0x0f, 0x01, 0x1c, 0x18, "2" }, - {0x0f, 0x01, 0x1c, 0x1c, "1 (Easy)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, -}; - -STDDIPINFO(Eeekk) - -//------------------------------------------------------------------------------------------------------ - -static void mschamp_set_bank() -{ - nPacBank = DrvDips[3] & 1; - - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM + 0x0000 + (nPacBank * 0x08000)); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM + 0x0000 + (nPacBank * 0x08000)); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + 0x4000 + (nPacBank * 0x08000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + 0x4000 + (nPacBank * 0x08000)); -} - -static void epos_hardware_set_bank(INT32 nBank) -{ - nPacBank = nBank & 3; - - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM + 0x10000 + (nPacBank * 0x04000)); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM + 0x10000 + (nPacBank * 0x04000)); -} - -static UINT8 cannonbp_protection_r(UINT16 offset) -{ - switch (offset) - { - case 0x0004: - cannonb_bit_to_read = 7; - case 0x0000: - case 0x0003: - case 0x0012: - case 0x0105: - return 0x00; - - case 0x0001: - if (ZetGetPC(-1) == 0x2b97) - return ((0x46 >> (cannonb_bit_to_read--)) & 1) << 7; - else - return 0xff; - - case 0x0107: - return 0x40; - } - - return 0; -} - -static UINT8 epos_hardware_decrypt_rom(UINT16 offset) -{ - if (offset & 0x01) - { - epos_hardware_counter = (epos_hardware_counter - 1) & 0x0f; - } - else - { - epos_hardware_counter = (epos_hardware_counter + 1) & 0x0f; - } - - if (epos_hardware_counter >= 0x08 && epos_hardware_counter <= 0x0b) { - epos_hardware_set_bank(epos_hardware_counter); - } - - return 0; -} - -static UINT8 maketrax_special_port2_r(UINT16 offset) // and korosuke -{ - INT32 data = DrvDips[2]; - INT32 pc = ZetGetPC(-1); - - if (pc == 0x1973 || pc == 0x2389 || pc == 0x196e || pc == 0x2387) return data | 0x40; - - switch (offset) - { - case 0x01: - case 0x04: data |= 0x40; break; - case 0x05: data |= 0xc0; break; - - default: data &= 0x3f; break; - } - - return data; -} - -static UINT8 maketrax_special_port3_r(UINT16 offset) -{ - INT32 pc = ZetGetPC(-1); - - if (pc == 0x040e || pc == 0x0445) return 0x20; - if (pc == 0x115e || pc == 0x3ae2 || pc == 0x115b || pc == 0x3ae6) return 0x00; - - switch (offset) - { - case 0x00: return 0x1f; - case 0x09: return 0x30; - case 0x0c: return 0x00; - - default: return 0x20; - } -} - -UINT8 __fastcall pacman_read(UINT16 a) -{ - switch (game_select) - { - case ALIBABA: - { - if (a == 0x50c0) return rand() & 0xff; - if (a == 0x50c1) { - alibaba_mystery++; - return (alibaba_mystery >> 10) & 1; - } - } - break; - - case CANNONBP: - { - if ((a & 0xf000) == 0x3000) return cannonbp_protection_r(a & 0xfff); - } - break; - - case MAKETRAX: - { - if ((a & 0xffc0) == 0x5080) return maketrax_special_port2_r(a & 0x3f); - if ((a & 0xffc0) == 0x50c0) return maketrax_special_port3_r(a & 0x3f); - } - break; - - case CRUSHS: - { - if (a == 0x5080) return DrvInputs[1]; - } - break; - - case ROCKTRV2: - { - if ((a & 0xfff0) == 0x5fe0) return (rocktrv2_prot_data[(a >> 2) & 3] >> 4); - - if (a == 0x5fff) return DrvDips[3]; - - if ((a & 0x8000) == 0x8000) return DrvQROM[(a & 0x7fff) | (nPacBank * 0x8000)]; - } - break; - } - - switch (a & ~0x003f) - { - case 0x5000: return DrvInputs[0]; - case 0x5040: return DrvInputs[1]; - case 0x5080: return DrvDips[2]; - case 0x50c0: return DrvDips[3]; - } - - if ((a & 0xfc00) == 0x4800) return 0xbf; - - return 0; -} - -void __fastcall pacman_write(UINT16 a, UINT8 d) -{ - switch (game_select) - { - case BIRDIY: - { - if ((a & 0xffe0) == 0x5080) a -= 0x0040; - if ((a & 0xfff0) == 0x50a0) a -= 0x0040; - if (a == 0x5000) return; - if (a == 0x5001) interrupt_mask = d & 1; - } - break; - - case ALIBABA: - { - if (a == 0x50c2) { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - interrupt_mask = d; - return; - } - - if ((a & 0xfff0) == 0x5040) { - NamcoSoundWrite((a & 0x0f) | 0x00, d); - return; - } - - if ((a & 0xfff0) == 0x5060) { - NamcoSoundWrite((a & 0x0f) | 0x10, d); - return; - } - - if ((a & 0xfff0) == 0x5050) { - DrvSprRAM2[a & 0x0f] = d; - return; - } - - if (a == 0x5000) { - watchdog = 0; - return; - } - } - break; - - case ROCKTRV2: - { - if ((a & 0xfffc) == 0x5fe0) { - rocktrv2_prot_data[a & 3] = d; - return; - } - - if (a == 0x5ff0) { - nPacBank = d; - return; - } - } - break; - - case VANVAN: - { - if (a == 0x5001) { - //Palette[0] = (d & 1) ? BurnHighCol(0xaa, 0xaa, 0xaa, 0) : 0; - //bprintf(0, _T("vanvan bgcolor data %x.\n"), d); - // This isn't supposed to be here. - return; - } - } - break; - - case BIGBUCKS: - if (a == 0x6000) { - nPacBank = d; - return; - } - break; - } - - if ((a & 0xffe0) == 0x5040) { - NamcoSoundWrite(a & 0x1f, d); - return; - } - - if ((a & 0xfff0) == 0x5060) { - DrvSprRAM2[a & 0x0f] = d; - return; - } - - switch (a) - { - case 0x5000: - interrupt_mask = d & 1; - break; - - case 0x5001: - // pacman_sound_enable_w - break; - - case 0x5003: - *flipscreen = d & 1; - break; - - case 0x5002:// nop - case 0x5007:// coin counter - break; - - case 0x50c0: - watchdog = 0; - break; - } -} - -UINT8 __fastcall pacman_in_port(UINT16 a) -{ - if (game_select == BIGBUCKS) { - return DrvQROM[(nPacBank << 16) | (a ^ 0xffff)]; - } - - a &= 0xff; - - switch (game_select) - { - case CRUSHS: - if (a == 1) return DrvDips[3]; - if (a == 2) return DrvDips[2]; - return 0; - - case EPOS: - return epos_hardware_decrypt_rom(a); - - case MSCHAMP: - if (a == 0) return mschamp_counter++; - return 0; - } - - return 0; -} - -void __fastcall pacman_out_port(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (game_select) - { - case CRUSHS: - if (a == 0 || a == 1) { - AY8910Write(0, ~a & 1, d); - } - return; - - case DREMSHPR: - if (a == 6 || a == 7) { - AY8910Write(0, ~a & 1, d); - } - return; - - case VANVAN: - if (a == 1 || a == 2) { - SN76496Write(a - 1, d); - } - return; - - case PIRANHA: - if (a == 0) { - if (d == 0xfa) d = 0x78; - interrupt_mode = d; - } - return; - - case NMOUSE: - if (a == 0) { - if (d == 0xbf) d = 0x3c; - if (d == 0xc6) d = 0x40; - interrupt_mode = d; - } - return; - } - - if (a == 0) // pacman & clones only - { - interrupt_mode = d; - ZetSetVector(d); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -UINT8 __fastcall mspacman_read(UINT16 a) -{ - if ((a < 0x4000) || (a >= 0x8000 && a <= 0xbfff)) - { - if ((a >= 0x0038 && a <= 0x003f) | - (a >= 0x03b0 && a <= 0x03b7) | - (a >= 0x1600 && a <= 0x1607) | - (a >= 0x2120 && a <= 0x2127) | - (a >= 0x3ff0 && a <= 0x3ff7) | - (a >= 0x8000 && a <= 0x8007) | - (a >= 0x97f0 && a <= 0x97f7)) - { - nPacBank = 0; - } - - if (a >= 0x3ff8 && a <= 0x3fff) { - nPacBank = 1; - } - - return DrvZ80ROM[(nPacBank << 16) + a]; - } - - if ((a & 0xfc00) == 0x4800) return 0xbf; // unmapped read - - if ((a & 0xff00) == 0x5000) a &= ~0x003f; - - switch (a) - { - case 0x5000: return DrvInputs[0]; - case 0x5040: return DrvInputs[1]; - case 0x5080: return DrvDips[2]; - case 0x50c0: return DrvDips[3]; - } - - return 0; -} - -void __fastcall mspacman_write(UINT16 a, UINT8 d) -{ - if ((a >= 0x0038 && a <= 0x003f) | - (a >= 0x03b0 && a <= 0x03b7) | - (a >= 0x1600 && a <= 0x1607) | - (a >= 0x2120 && a <= 0x2127) | - (a >= 0x3ff0 && a <= 0x3ff7) | - (a >= 0x8000 && a <= 0x8007) | - (a >= 0x97f0 && a <= 0x97f7)) - { - nPacBank = 0; - } - - if (a >= 0x3ff8 && a <= 0x3fff) { - nPacBank = 1; - } - - if ((a & 0xffe0) == 0x5040) { - NamcoSoundWrite(a & 0x1f, d); - return; - } - - if ((a & 0xfff0) == 0x5060) { - DrvSprRAM2[a & 0x0f] = d; - return; - } - - switch (a) - { - case 0x5000: - interrupt_mask = d & 1; - break; - - case 0x5001: - // pacman_sound_enable_w - break; - - case 0x5003: - *flipscreen = d & 1; - break; - - case 0x5002: // nop - case 0x5004: - case 0x5005: // leds - case 0x5006: // coin lockout - case 0x5007: // coin counter - case 0x5080: // nop - return; - - case 0x50c0: - watchdog = 0; - break; - } -} - -void __fastcall pengo_write(UINT16 a, UINT8 d) -{ - if ((a & 0xffe0) == 0x9000) { - NamcoSoundWrite(a & 0x1f, d); - return; - } - - if ((a & 0xfff0) == 0x9020) { - DrvSprRAM2[a & 0x0f] = d; - return; - } - - switch (a) - { - case 0x9040: - interrupt_mask = d & 1; - return; - - case 0x9042: - palettebank = d; - return; - - case 0x9043: - *flipscreen = d & 1; - return; - - case 0x9044: - case 0x9045: // coin counter - return; - - case 0x9046: - colortablebank = d; - return; - - case 0x9047: - charbank = d & 1; - spritebank = d & 1; - return; - - case 0x9070: - watchdog = 0; - return; - } -} - -UINT8 __fastcall pengo_read(UINT16 a) -{ - switch (a & ~0x003f) - { - case 0x9000: return DrvDips[3]; - case 0x9040: return DrvDips[2]; - case 0x9080: return DrvInputs[1]; - case 0x90c0: return DrvInputs[0]; - } - - return 0; -} - -//------------------------------------------------------------------------------------------------------ - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - watchdog = 0; - nPacBank = 0; - - ZetOpen(0); - ZetReset(); - - switch (game_select) - { - case EPOS: - epos_hardware_counter = 0x0A + acitya; - if (strcmp(BurnDrvGetTextA(DRV_NAME), "eeekk") == 0) epos_hardware_counter = 0x09; - epos_hardware_set_bank(epos_hardware_counter); - break; - - case MSCHAMP: - mschamp_set_bank(); - break; - } - - ZetClose(); - - AY8910Reset(0); - - NamcoSoundReset(); - - HiscoreReset(); - - mschamp_counter = 0; - cannonb_bit_to_read = 0; - alibaba_mystery = 0; - - interrupt_mode = 0; - interrupt_mask = 0; - colortablebank = 0; - palettebank = 0; - spritebank = 0; - charbank = 0; - - return 0; -} - -static void DrvTransTableInit() -{ - for (INT32 i = 0; i < 0x100; i++) { - DrvTransTable[i] = (DrvColPROM[(i & 0xff) + 0x100] & 0x0f) ? 1 : 0; - } -} - -static void pacman_palette_init() -{ - UINT32 t_pal[32]; - - for (INT32 i = 0; i < 32; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - UINT8 r = (bit0 * 33) + (bit1 * 71) + (bit2 * 151); - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - UINT8 g = (bit0 * 33) + (bit1 * 71) + (bit2 * 151); - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - UINT8 b = (bit0 * 81) + (bit1 * 174); - - t_pal[i] = BurnHighCol(r, g, b, 0); - } - - for (INT32 i = 0; i < 256; i++) - { - UINT8 ctabentry = DrvColPROM[i + 0x100] & 0x0f; - - Palette[0x000 + i] = t_pal[ctabentry + 0x00]; - Palette[0x100 + i] = t_pal[ctabentry + 0x10]; - } - - DrvRecalc = 1; -} - -static void convert_gfx() -{ - static INT32 PlaneOffsets[2] = { 0, 4 }; - static INT32 CharXOffsets[8] = { 64, 65, 66, 67, 0, 1, 2, 3 }; - static INT32 SpriXOffsets[16] = { 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3, 0, 1, 2, 3 }; - static INT32 YOffsets[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 }; - - INT32 size = (game_select == PENGO) ? 0x2000 : 0x1000; - - UINT8 *tmp = (UINT8*)BurnMalloc( size * 2 ); - - if (tmp) - { - memcpy (tmp, DrvGfxROM, size * 2); - - GfxDecode(((size * 4) / 0x040), 2, 8, 8, PlaneOffsets, CharXOffsets + 0, YOffsets, 0x080, tmp, DrvGfxROM + 0x0000); - GfxDecode(((size * 4) / 0x100), 2, 16, 16, PlaneOffsets, SpriXOffsets + 0, YOffsets, 0x200, tmp + size, DrvGfxROM + 0x8000); - } - - BurnFree (tmp); -} - -static INT32 pacman_load() -{ - char* pRomName; - struct BurnRomInfo ri; - - INT32 pOffset = 0; - UINT8 *gLoad = DrvGfxROM; - UINT8 *cLoad = DrvColPROM; - UINT8 *sLoad = NamcoSoundProm; - UINT8 *qLoad = DrvQROM; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(DrvZ80ROM + pOffset, i, 1)) return 1; - - if (game_select == MSPACMAN) { - pOffset += 0x1000; - } else { - pOffset += ri.nLen; - } - - if (pOffset == 0x4000 && game_select != PENGO) { - pOffset = 0x8000; - } - - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(gLoad, i, 1)) return 1; - gLoad += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(cLoad, i, 1)) return 1; - cLoad += 0x100; - - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(sLoad, i, 1)) return 1; - sLoad += 0x100; - - continue; - } - - if ((ri.nType & 7) == 7) { - if (BurnLoadRom(qLoad, i, 1)) return 1; - qLoad += ri.nLen; - - continue; - } - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x020000; - - DrvQROM = Next; - if (game_select == BIGBUCKS) Next += 0x060000; - if (game_select == ROCKTRV2) Next += 0x040000; - - DrvGfxROM = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000500; - NamcoSoundProm = Next; Next += 0x000200; - - DrvTransTable = Next; Next += 0x000200; - - Palette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x001000; - - DrvSprRAM = DrvZ80RAM + ((game_select == ALIBABA) ? 0x6f0 : 0x7f0); - DrvSprRAM2 = Next; Next += 0x000010; - - DrvColRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - - rocktrv2_prot_data = Next; Next += 0x000004; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void StandardMap() -{ - for (INT32 i = 0; i <= 0x8000; i += 0x8000)// mirror - { - ZetMapArea(0x0000 + i, 0x3fff + i, 0, DrvZ80ROM); - ZetMapArea(0x0000 + i, 0x3fff + i, 2, DrvZ80ROM); - - for (INT32 j = 0; j <= 0x2000; j+= 0x2000) // mirrors - { - ZetMapArea(0x4000 + i + j, 0x43ff + i + j, 0, DrvVidRAM); - ZetMapArea(0x4000 + i + j, 0x43ff + i + j, 1, DrvVidRAM); - ZetMapArea(0x4000 + i + j, 0x43ff + i + j, 2, DrvVidRAM); - ZetMapArea(0x4400 + i + j, 0x47ff + i + j, 0, DrvColRAM); - ZetMapArea(0x4400 + i + j, 0x47ff + i + j, 1, DrvColRAM); - ZetMapArea(0x4400 + i + j, 0x47ff + i + j, 2, DrvColRAM); - ZetMapArea(0x4c00 + i + j, 0x4fff + i + j, 0, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00 + i + j, 0x4fff + i + j, 1, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00 + i + j, 0x4fff + i + j, 2, DrvZ80RAM + 0x0400); - } - } - - ZetSetWriteHandler(pacman_write); - ZetSetReadHandler(pacman_read); - ZetSetOutHandler(pacman_out_port); - ZetSetInHandler(pacman_in_port); -} - -static void CannonbpMap() -{ - for (INT32 i = 0; i <= 0x8000; i += 0x8000) { // mirror - - ZetMapArea(0x0000 + i, 0x2fff + i, 0, DrvZ80ROM); - ZetMapArea(0x0000 + i, 0x2fff + i, 2, DrvZ80ROM); - - for (INT32 j = 0; j <= 0x2000; j+= 0x2000) { // mirrors - ZetMapArea(0x4000 + i + j, 0x43ff + i + j, 0, DrvVidRAM); - ZetMapArea(0x4000 + i + j, 0x43ff + i + j, 1, DrvVidRAM); - ZetMapArea(0x4000 + i + j, 0x43ff + i + j, 2, DrvVidRAM); - ZetMapArea(0x4400 + i + j, 0x47ff + i + j, 0, DrvColRAM); - ZetMapArea(0x4400 + i + j, 0x47ff + i + j, 1, DrvColRAM); - ZetMapArea(0x4400 + i + j, 0x47ff + i + j, 2, DrvColRAM); - ZetMapArea(0x4800 + i + j, 0x4bff + i + j, 0, DrvZ80RAM + 0x0000); - ZetMapArea(0x4800 + i + j, 0x4bff + i + j, 1, DrvZ80RAM + 0x0000); - ZetMapArea(0x4800 + i + j, 0x4bff + i + j, 2, DrvZ80RAM + 0x0000); - ZetMapArea(0x4c00 + i + j, 0x4fff + i + j, 0, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00 + i + j, 0x4fff + i + j, 1, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00 + i + j, 0x4fff + i + j, 2, DrvZ80RAM + 0x0400); - } - } - - ZetSetWriteHandler(pacman_write); - ZetSetReadHandler(pacman_read); - ZetSetOutHandler(pacman_out_port); - ZetSetInHandler(pacman_in_port); -} - -static void DremshprMap() // and vanvan -{ - CannonbpMap(); - - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + 0x8000); -} - -static void WoodpekMap() -{ - StandardMap(); - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + 0x8000); -} - -static void Rocktrv2Map() -{ - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM); - ZetMapArea(0x4000, 0x43ff, 0, DrvVidRAM); - ZetMapArea(0x4000, 0x43ff, 1, DrvVidRAM); - ZetMapArea(0x4000, 0x43ff, 2, DrvVidRAM); - ZetMapArea(0x4400, 0x47ff, 0, DrvColRAM); - ZetMapArea(0x4400, 0x47ff, 1, DrvColRAM); - ZetMapArea(0x4400, 0x47ff, 2, DrvColRAM); - ZetMapArea(0x4c00, 0x4fff, 0, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00, 0x4fff, 1, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00, 0x4fff, 2, DrvZ80RAM + 0x0400); - - ZetMapArea(0x6000, 0x7fff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x6000, 0x7fff, 2, DrvZ80ROM + 0x8000); - - ZetSetWriteHandler(pacman_write); - ZetSetReadHandler(pacman_read); - ZetSetOutHandler(pacman_out_port); - ZetSetInHandler(pacman_in_port); -} - -static void BigbucksMap() -{ - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM); - ZetMapArea(0x4000, 0x43ff, 0, DrvVidRAM); - ZetMapArea(0x4000, 0x43ff, 1, DrvVidRAM); - ZetMapArea(0x4000, 0x43ff, 2, DrvVidRAM); - ZetMapArea(0x4400, 0x47ff, 0, DrvColRAM); - ZetMapArea(0x4400, 0x47ff, 1, DrvColRAM); - ZetMapArea(0x4400, 0x47ff, 2, DrvColRAM); - ZetMapArea(0x4c00, 0x4fff, 0, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00, 0x4fff, 1, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00, 0x4fff, 2, DrvZ80RAM + 0x0400); - - ZetMapArea(0x8000, 0x9fff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0x9fff, 2, DrvZ80ROM + 0x8000); - - ZetSetWriteHandler(pacman_write); - ZetSetReadHandler(pacman_read); - ZetSetOutHandler(pacman_out_port); - ZetSetInHandler(pacman_in_port); -} - -static void AlibabaMap() -{ - StandardMap(); - - ZetMapArea(0x8000, 0x8fff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0x8fff, 2, DrvZ80ROM + 0x8000); - - for (INT32 i = 0; i < 0x1000; i+= 0x400) { - ZetMapArea(0x9000 + i, 0x93ff + i, 0, DrvZ80RAM + 0x0000); - ZetMapArea(0x9000 + i, 0x93ff + i, 1, DrvZ80RAM + 0x0000); - ZetMapArea(0x9000 + i, 0x93ff + i, 2, DrvZ80RAM + 0x0000); - } - - for (INT32 i = 0x0000; i < 0x2000; i += 0x0800) { - ZetMapArea(0xa000 + i, 0xa7ff + i, 0, DrvZ80ROM + 0xa000); - ZetMapArea(0xa000 + i, 0xa7ff + i, 2, DrvZ80ROM + 0xa000); - } -} - -static void PengoMap() -{ - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); -// ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM + 0x8000, DrvZ80ROM); - ZetMapArea(0x8000, 0x83ff, 0, DrvVidRAM); - ZetMapArea(0x8000, 0x83ff, 1, DrvVidRAM); - ZetMapArea(0x8000, 0x83ff, 2, DrvVidRAM); - ZetMapArea(0x8400, 0x87ff, 0, DrvColRAM); - ZetMapArea(0x8400, 0x87ff, 1, DrvColRAM); - ZetMapArea(0x8400, 0x87ff, 2, DrvColRAM); - ZetMapArea(0x8800, 0x8fff, 0, DrvZ80RAM); - ZetMapArea(0x8800, 0x8fff, 1, DrvZ80RAM); - ZetMapArea(0x8800, 0x8fff, 2, DrvZ80RAM); - - ZetSetWriteHandler(pengo_write); - ZetSetReadHandler(pengo_read); -} - -static void MspacmanMap() -{ - for (INT32 i = 0; i <= 0x8000; i += 0x8000)// mirror - { - for (INT32 j = 0; j <= 0x2000; j+= 0x2000) // mirrors - { - ZetMapArea(0x4000 + i + j, 0x43ff + i + j, 0, DrvVidRAM); - ZetMapArea(0x4000 + i + j, 0x43ff + i + j, 1, DrvVidRAM); - ZetMapArea(0x4000 + i + j, 0x43ff + i + j, 2, DrvVidRAM); - ZetMapArea(0x4400 + i + j, 0x47ff + i + j, 0, DrvColRAM); - ZetMapArea(0x4400 + i + j, 0x47ff + i + j, 1, DrvColRAM); - ZetMapArea(0x4400 + i + j, 0x47ff + i + j, 2, DrvColRAM); - ZetMapArea(0x4c00 + i + j, 0x4fff + i + j, 0, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00 + i + j, 0x4fff + i + j, 1, DrvZ80RAM + 0x0400); - ZetMapArea(0x4c00 + i + j, 0x4fff + i + j, 2, DrvZ80RAM + 0x0400); - } - } - - ZetSetWriteHandler(mspacman_write); - ZetSetReadHandler(mspacman_read); - ZetSetOutHandler(pacman_out_port); -} - -static INT32 DrvInit(void (*mapCallback)(), void (*pInitCallback)(), INT32 select) -{ - game_select = select; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pacman_load()) return 1; - - if (pInitCallback) { - pInitCallback(); - } - - convert_gfx(); - pacman_palette_init(); - DrvTransTableInit(); - - ZetInit(0); - ZetOpen(0); - mapCallback(); - ZetClose(); - - AY8910Init(0, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.75, BURN_SND_ROUTE_BOTH); - if (game_select == DREMSHPR) AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - SN76496Init(0, 1789750, 0); - SN76496Init(1, 1789750, 1); - SN76496SetRoute(0, 0.75, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.75, BURN_SND_ROUTE_BOTH); - - NamcoSoundInit(18432000 / 6 / 32, 3, 0); - NacmoSoundSetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - AY8910Exit(0); - SN76496Exit(); - NamcoSoundExit(); - - game_select = PACMAN; - acitya = 0; - - nPacBank = -1; - - BurnFree (AllMem); - - return 0; -} - -static void DrawBackground() -{ - for (INT32 offs = 0; offs < 36 * 28; offs++) - { - INT32 sx = (offs % 36); - INT32 sy = offs / 36; - - INT32 row = sy + 2; - INT32 col = sx - 2; - - INT32 ofst; - - if (game_select == VANVAN) - sx -= 2; - - if (col & 0x20) - ofst = row + ((col & 0x1f) << 5); - else - ofst = col + (row << 5); - - INT32 code = (charbank << 8) | DrvVidRAM[ofst]; - INT32 color = (DrvColRAM[ofst] & 0x1f) | (colortablebank << 5) | (palettebank << 6); - - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, (272 - (sx * 8)) + 8, (224 - (sy * 8)) - 8, color, 2, 0, DrvGfxROM); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx * 8, sy * 8, color, 2, 0, DrvGfxROM); - } - } -} - -static void DrawSprites() -{ - for (INT32 offs = 0x10 - 2;offs >= 0;offs -= 2) - { - INT32 code = (DrvSprRAM[offs] >> 2) | (spritebank << 6); - INT32 color = (DrvSprRAM[offs + 1] & 0x1f ) | (colortablebank << 5) | (palettebank << 6); - - INT32 sx = DrvSprRAM2[offs + 1]; - INT32 sy = DrvSprRAM2[offs]; - INT32 flipx = DrvSprRAM [offs] & 1; - INT32 flipy = DrvSprRAM [offs] & 2; - - if (game_select == VANVAN) - sx += 2*8; - - if (*flipscreen) { - sy = (240 - sy) - 8; - sx += 8; - flipy = !flipy; - flipx = !flipx; - } else { - sx = 272 - sx; - sy = sy - 31; - } - - RenderTileTranstab(pTransDraw, DrvGfxROM + 0x8000, code, color << 2, 0, sx, sy, flipx, flipy, 16, 16, DrvTransTable); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - pacman_palette_init(); - DrvRecalc = 0; - } - - DrawBackground(); - DrawSprites(); - - BurnTransferCopy(Palette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 16) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - if (!acitya && game_select != SHOOTBUL && game_select != JUMPSHOT) { - // Convert to 4-way & clear opposites for Puckman / Pac-man - ProcessJoystick(&DrvInputs[0], 0, 0,3,1,2, INPUT_4WAY | INPUT_CLEAROPPOSITES); - ProcessJoystick(&DrvInputs[1], 1, 0,3,1,2, INPUT_4WAY | INPUT_CLEAROPPOSITES); - } - - DrvInputs[0] ^= DrvDips[0]; - DrvInputs[1] ^= DrvDips[1]; - - nAnalogAxis[0] -= DrvAxis[0]; - nAnalogAxis[1] -= DrvAxis[1]; - - nCharAxis[0] = (DrvAxis[0] >> 12) & 0x0f; - nCharAxis[1] = (DrvAxis[1] >> 12) & 0x0f; - - if (game_select == SHOOTBUL) { - DrvInputs[0] ^= nCharAxis[0]; - DrvInputs[1] ^= nCharAxis[1]; - } - } - - ZetOpen(0); - - INT32 nInterleave = 264; - INT32 nSoundBufferPos = 0; - - INT32 nCyclesTotal = (18432000 / 6) / 60; - INT32 nCyclesDone = 0, nSegment = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - nSegment = (nCyclesTotal - nCyclesDone) / (nInterleave - i); - nCyclesDone += ZetRun(nSegment); - - if (game_select == BIGBUCKS) { - INT32 nInterleaveIRQFire = nInterleave / 20; - for (INT32 j = 0; j < 20; j++) { - if (i == (nInterleaveIRQFire * j) - 1) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - } else { - if (game_select == DREMSHPR || game_select == VANVAN) { - if (i == (nInterleave - 1)) ZetNmi(); - } else { - if (i == 223 && interrupt_mask) { - ZetSetVector(interrupt_mode); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - if (game_select == DREMSHPR || game_select == CRUSHS) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } else { - if (game_select == VANVAN) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - } else { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - } - } - } - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - if (game_select == DREMSHPR || game_select == CRUSHS) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } else { - if (game_select == VANVAN) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - } else { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - } - } - } - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -//------------------------------------------------------------------------------------------------------ - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029693; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - NamcoSoundScan(nAction, pnMin); - AY8910Scan(nAction, pnMin); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(nPacBank); - - SCAN_VAR(interrupt_mode); - SCAN_VAR(interrupt_mask); - - SCAN_VAR(colortablebank); - SCAN_VAR(palettebank); - SCAN_VAR(spritebank); - SCAN_VAR(charbank); - - SCAN_VAR(alibaba_mystery); - SCAN_VAR(epos_hardware_counter); - SCAN_VAR(mschamp_counter); - SCAN_VAR(cannonb_bit_to_read); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - if (game_select == MSCHAMP) { - mschamp_set_bank(); - } - - if (game_select == EPOS) { - epos_hardware_set_bank(nPacBank); - } - ZetClose(); - } - - return 0; -} - - -//------------------------------------------------------------------------------------------------------ - - -// Puck Man (Japan set 1) - -static struct BurnRomInfo puckmanRomDesc[] = { - { "pm1_prg1.6e", 0x0800, 0xf36e88ab, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pm1_prg2.6k", 0x0800, 0x618bd9b3, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pm1_prg3.6f", 0x0800, 0x7d177853, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pm1_prg4.6m", 0x0800, 0xd3e8914c, 1 | BRF_ESS | BRF_PRG }, // 3 - { "pm1_prg5.6h", 0x0800, 0x6bf4f625, 1 | BRF_ESS | BRF_PRG }, // 4 - { "pm1_prg6.6n", 0x0800, 0xa948ce83, 1 | BRF_ESS | BRF_PRG }, // 5 - { "pm1_prg7.6j", 0x0800, 0xb6289b26, 1 | BRF_ESS | BRF_PRG }, // 6 - { "pm1_prg8.6p", 0x0800, 0x17a88c13, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "pm1_chg1.5e", 0x0800, 0x2066a0b7, 2 | BRF_GRA }, // 8 Graphics - { "pm1_chg2.5h", 0x0800, 0x3591b89d, 2 | BRF_GRA }, // 9 - { "pm1_chg3.5f", 0x0800, 0x9e39323a, 2 | BRF_GRA }, // 10 - { "pm1_chg4.5j", 0x0800, 0x1b1d9096, 2 | BRF_GRA }, // 11 - - { "pm1-1.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "pm1-4.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "pm1-3.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "pm1-2.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(puckman) -STD_ROM_FN(puckman) - -static INT32 puckmanInit() -{ - return DrvInit(StandardMap, NULL, PACMAN); -} - -struct BurnDriver BurnDrvpuckman = { - "puckman", NULL, NULL, NULL, "1980", - "Puck Man (Japan set 1)\0", NULL, "Namco", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, puckmanRomInfo, puckmanRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Puck Man (Bootleg set 1) - -static struct BurnRomInfo puckmanbRomDesc[] = { - { "namcopac.6e", 0x1000, 0xfee263b3, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "namcopac.6f", 0x1000, 0x39d1fc83, 1 | BRF_ESS | BRF_PRG }, // 1 - { "namcopac.6h", 0x1000, 0x02083b03, 1 | BRF_ESS | BRF_PRG }, // 2 - { "namcopac.6j", 0x1000, 0x7a36fe55, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacman.5e", 0x1000, 0x0c944964, 2 | BRF_GRA }, // 4 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(puckmanb) -STD_ROM_FN(puckmanb) - -struct BurnDriver BurnDrvpuckmanb = { - "puckmanb", "puckman", NULL, NULL, "1980", - "Puck Man (Bootleg set 1)\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, puckmanbRomInfo, puckmanbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Puck Man (Speedup hack) - -static struct BurnRomInfo puckmanfRomDesc[] = { - { "namcopac.6e", 0x1000, 0xfee263b3, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "nampfast.6f", 0x1000, 0x51b38db9, 1 | BRF_ESS | BRF_PRG }, // 1 - { "namcopac.6h", 0x1000, 0x02083b03, 1 | BRF_ESS | BRF_PRG }, // 2 - { "namcopac.6j", 0x1000, 0x7a36fe55, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacman.5e", 0x1000, 0x0c944964, 2 | BRF_GRA }, // 4 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(puckmanf) -STD_ROM_FN(puckmanf) - -struct BurnDriver BurnDrvpuckmanf = { - "puckmanf", "puckman", NULL, NULL, "1980", - "PuckMan (speedup hack)\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, puckmanfRomInfo, puckmanfRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Puck Man (Bootleg set 2) - -static struct BurnRomInfo puckmanhRomDesc[] = { - { "pm01.6e", 0x1000, 0x5fe8610a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pm02.6f", 0x1000, 0x61d38c6c, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pm03.6h", 0x1000, 0x4e7ef99f, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pm04.6j", 0x1000, 0x8939ddd2, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pm9.5e", 0x0800, 0x2229ab07, 2 | BRF_GRA }, // 4 Graphics - { "pm11.5h", 0x0800, 0x3591b89d, 2 | BRF_GRA }, // 5 - { "pm10.5f", 0x0800, 0x9e39323a, 2 | BRF_GRA }, // 6 - { "pm12.5j", 0x0800, 0x1b1d9096, 2 | BRF_GRA }, // 7 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 8 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(puckmanh) -STD_ROM_FN(puckmanh) - -struct BurnDriver BurnDrvpuckmanh = { - "puckmanh", "puckman", NULL, NULL, "1981", - "Puck Man (bootleg set 2)\0", NULL, "bootleg (Falcom?)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, puckmanhRomInfo, puckmanhRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Puck Man (Japan set 2) - -static struct BurnRomInfo puckmodRomDesc[] = { - { "namcopac.6e", 0x1000, 0xfee263b3, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "namcopac.6f", 0x1000, 0x39d1fc83, 1 | BRF_ESS | BRF_PRG }, // 1 - { "namcopac.6h", 0x1000, 0x02083b03, 1 | BRF_ESS | BRF_PRG }, // 2 - { "npacmod.6j", 0x1000, 0x7d98d5f5, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacman.5e", 0x1000, 0x0c944964, 2 | BRF_GRA }, // 4 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(puckmod) -STD_ROM_FN(puckmod) - -struct BurnDriver BurnDrvpuckmod = { - "puckmod", "puckman", NULL, NULL, "1981", - "Puck Man (Japan set 2)\0", NULL, "Namco", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, puckmodRomInfo, puckmodRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac-Man (Midway) - -static struct BurnRomInfo pacmanRomDesc[] = { - { "pacman.6e", 0x1000, 0xc1e6ab10, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacman.6f", 0x1000, 0x1a6fb2d4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacman.6h", 0x1000, 0xbcdd1beb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacman.6j", 0x1000, 0x817d94e3, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacman.5e", 0x1000, 0x0c944964, 2 | BRF_GRA }, // 4 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(pacman) -STD_ROM_FN(pacman) - -struct BurnDriver BurnDrvpacman = { - "pacman", "puckman", NULL, NULL, "1980", - "Pac-Man (Midway)\0", NULL, "Namco (Midway license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacmanRomInfo, pacmanRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac-Man (SegaSA / Sonic) - -static struct BurnRomInfo pacmansoRomDesc[] = { - { "PM-1R.6E", 0x0800, 0x76dbed21, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "PM-5R.6K", 0x0800, 0x965bb9b2, 1 | BRF_ESS | BRF_PRG }, // 1 - { "PM-2R.6F", 0x0800, 0x7d177853, 1 | BRF_ESS | BRF_PRG }, // 2 - { "PM-6R.6M", 0x0800, 0xd3e8914c, 1 | BRF_ESS | BRF_PRG }, // 3 - { "PM-3R.6H", 0x0800, 0xa5af382c, 1 | BRF_ESS | BRF_PRG }, // 4 - { "PM-7R.6N", 0x0800, 0xa948ce83, 1 | BRF_ESS | BRF_PRG }, // 5 - { "PM-4R.6J", 0x0800, 0xcd03135a, 1 | BRF_ESS | BRF_PRG }, // 6 - { "PM-8R.6P", 0x0800, 0xfb397ced, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "PM-9S.5E", 0x0800, 0x2ee076d2, 2 | BRF_GRA }, // 8 Graphics - { "PM-11S.5H", 0x0800, 0x3591b89d, 2 | BRF_GRA }, // 9 - { "PM-10S.5F", 0x0800, 0x9e39323a, 2 | BRF_GRA }, // 10 - { "PM-12S.5J", 0x0800, 0x1b1d9096, 2 | BRF_GRA }, // 11 - - { "pm1-1.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "pm1-4.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "pm1-3.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "pm1-2.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(pacmanso) -STD_ROM_FN(pacmanso) - -struct BurnDriver BurnDrvpacmanso = { - "pacmanso", "puckman", NULL, NULL, "1980", - "Pac-Man (SegaSA / Sonic)\0", NULL, "Namco (Sonic license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacmansoRomInfo, pacmansoRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Come Come (Petaco SA bootleg of Puck Man) - -static struct BurnRomInfo pacmanpeRomDesc[] = { - { "come1.6e", 0x0800, 0x183d235a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "come5.6k", 0x0800, 0x2771c530, 1 | BRF_ESS | BRF_PRG }, // 1 - { "come2.6f", 0x0800, 0x7d177853, 1 | BRF_ESS | BRF_PRG }, // 2 - { "come6.6m", 0x0800, 0xd3e8914c, 1 | BRF_ESS | BRF_PRG }, // 3 - { "come3.6h", 0x0800, 0xcc92abb1, 1 | BRF_ESS | BRF_PRG }, // 4 - { "come7.6n", 0x0800, 0x8810b38e, 1 | BRF_ESS | BRF_PRG }, // 5 - { "come4.6j", 0x0800, 0xa02ce07f, 1 | BRF_ESS | BRF_PRG }, // 6 - { "come8.6p", 0x0800, 0x34e9566d, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "come9.5e", 0x0800, 0x2229ab07, 2 | BRF_GRA }, // 8 Graphics - { "come11.5h", 0x0800, 0x3591b89d, 2 | BRF_GRA }, // 9 - { "come10.5f", 0x0800, 0x9e39323a, 2 | BRF_GRA }, // 10 - { "come12.5j", 0x0800, 0x1b1d9096, 2 | BRF_GRA }, // 11 - - { "pm1-1.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "pm1-4.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "pm1-3.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "pm1-2.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(pacmanpe) -STD_ROM_FN(pacmanpe) - -struct BurnDriver BurnDrvpacmanpe = { - "pacmanpe", "puckman", NULL, NULL, "1980", - "Come Come (Petaco SA bootleg of Puck Man)\0", NULL, "bootleg (Petaco SA)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacmanpeRomInfo, pacmanpeRomName, NULL, NULL, DrvInputInfo, PacmanpeDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac-Man (Midway, with speedup hack) - -static struct BurnRomInfo pacmanfRomDesc[] = { - { "pacman.6e", 0x1000, 0xc1e6ab10, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacfast.6f", 0x1000, 0x720dc3ee, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacman.6h", 0x1000, 0xbcdd1beb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacman.6j", 0x1000, 0x817d94e3, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacman.5e", 0x1000, 0x0c944964, 2 | BRF_GRA }, // 4 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(pacmanf) -STD_ROM_FN(pacmanf) - -struct BurnDriver BurnDrvpacmanf = { - "pacmanf", "puckman", NULL, NULL, "1980", - "Pac-Man (Midway, with speedup hack)\0", NULL, "Namco (Midway license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacmanfRomInfo, pacmanfRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Packetman (bootleg) - -static struct BurnRomInfo packetmanRomDesc[] = { - { "6e_4.6e", 0x1000, 0x5fe8610a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "6f_4.6f", 0x1000, 0x61d38c6c, 1 | BRF_ESS | BRF_PRG }, // 1 - { "6h_4.6h", 0x1000, 0x4e7ef99f, 1 | BRF_ESS | BRF_PRG }, // 2 - { "6j_4b.6j", 0x1000, 0x2693f8ac, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacman.5e", 0x1000, 0x0c944964, 2 | BRF_GRA }, // 4 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(packetman) -STD_ROM_FN(packetman) - -struct BurnDriver BurnDrvpacketman = { - "packetman", "puckman", NULL, NULL, "1980", - "Packetman (bootleg)\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, packetmanRomInfo, packetmanRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Hangly-Man (set 1) - -static struct BurnRomInfo hanglyRomDesc[] = { - { "hangly.6e", 0x1000, 0x5fe8610a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "hangly.6f", 0x1000, 0x73726586, 1 | BRF_ESS | BRF_PRG }, // 1 - { "hangly.6h", 0x1000, 0x4e7ef99f, 1 | BRF_ESS | BRF_PRG }, // 2 - { "hangly.6j", 0x1000, 0x7f4147e6, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacman.5e", 0x1000, 0x0c944964, 2 | BRF_GRA }, // 4 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(hangly) -STD_ROM_FN(hangly) - -struct BurnDriver BurnDrvhangly = { - "hangly", "puckman", NULL, NULL, "1981", - "Hangly-Man (set 1)\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, hanglyRomInfo, hanglyRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Hangly-Man (set 2) - -static struct BurnRomInfo hangly2RomDesc[] = { - { "hangly.6e", 0x1000, 0x5fe8610a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "hangly2.6f", 0x0800, 0x5ba228bb, 1 | BRF_ESS | BRF_PRG }, // 1 - { "hangly2.6m", 0x0800, 0xbaf5461e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "hangly.6h", 0x1000, 0x4e7ef99f, 1 | BRF_ESS | BRF_PRG }, // 3 - { "hangly2.6j", 0x0800, 0x51305374, 1 | BRF_ESS | BRF_PRG }, // 4 - { "hangly2.6p", 0x0800, 0x427c9d4d, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "pacmanh.5e", 0x1000, 0x299fb17a, 2 | BRF_GRA }, // 6 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 7 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 8 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(hangly2) -STD_ROM_FN(hangly2) - -struct BurnDriver BurnDrvhangly2 = { - "hangly2", "puckman", NULL, NULL, "1981", - "Hangly-Man (set 2)\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, hangly2RomInfo, hangly2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Hangly-Man (set 3) - -static struct BurnRomInfo hangly3RomDesc[] = { - { "hm1.6e", 0x0800, 0x9d027c4a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "hm5.6k", 0x0800, 0x194c7189, 1 | BRF_ESS | BRF_PRG }, // 1 - { "hangly2.6f", 0x0800, 0x5ba228bb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "hangly2.6m", 0x0800, 0xbaf5461e, 1 | BRF_ESS | BRF_PRG }, // 3 - { "hm3.6h", 0x0800, 0x08419c4a, 1 | BRF_ESS | BRF_PRG }, // 4 - { "hm7.6n", 0x0800, 0xab74b51f, 1 | BRF_ESS | BRF_PRG }, // 5 - { "hm4.6j", 0x0800, 0x5039b082, 1 | BRF_ESS | BRF_PRG }, // 6 - { "hm8.6p", 0x0800, 0x931770d7, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "hm9.5e", 0x0800, 0x5f4be3cc, 2 | BRF_GRA }, // 8 Graphics - { "hm11.5h", 0x0800, 0x3591b89d, 2 | BRF_GRA }, // 9 - { "hm10.5f", 0x0800, 0x9e39323a, 2 | BRF_GRA }, // 10 - { "hm12.5j", 0x0800, 0x1b1d9096, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(hangly3) -STD_ROM_FN(hangly3) - -struct BurnDriver BurnDrvhangly3 = { - "hangly3", "puckman", NULL, NULL, "1981", - "Hangly-Man (set 3)\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, hangly3RomInfo, hangly3RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Popeye Man - -static struct BurnRomInfo popeyemanRomDesc[] = { - { "pop1.6e", 0x0800, 0x9d027c4a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pop5.6k", 0x0800, 0x194c7189, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pop2.6f", 0x0800, 0x5ba228bb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pop6.6m", 0x0800, 0xbaf5461e, 1 | BRF_ESS | BRF_PRG }, // 3 - { "pop3.6h", 0x0800, 0x08419c4a, 1 | BRF_ESS | BRF_PRG }, // 4 - { "pop7.6n", 0x0800, 0xab74b51f, 1 | BRF_ESS | BRF_PRG }, // 5 - { "pop4.6j", 0x0800, 0x5039b082, 1 | BRF_ESS | BRF_PRG }, // 6 - { "pop8.6p", 0x0800, 0x931770d7, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "pop9.5e", 0x0800, 0xb569c4c1, 2 | BRF_GRA }, // 8 Graphics - { "pop11.5h", 0x0800, 0x3591b89d, 2 | BRF_GRA }, // 9 - { "pop10.5f", 0x0800, 0x014fb5a4, 2 | BRF_GRA }, // 10 - { "pop12.5j", 0x0800, 0x21b91c64, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(popeyeman) -STD_ROM_FN(popeyeman) - -struct BurnDriver BurnDrvpopeyeman = { - "popeyeman", "puckman", NULL, NULL, "1981", - "Popeye-Man\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HACK, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, popeyemanRomInfo, popeyemanRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pacu-Man (Spanish bootleg of Puck Man) - -static struct BurnRomInfo pacumanRomDesc[] = { - { "pacuman01.bin", 0x0800, 0xec8c1ed8, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacuman02.bin", 0x0800, 0x40edaf56, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacuman03.bin", 0x0800, 0xdb4f702b, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacuman04.bin", 0x0800, 0x28f7257d, 1 | BRF_ESS | BRF_PRG }, // 3 - { "pacuman05.bin", 0x0800, 0x212acb41, 1 | BRF_ESS | BRF_PRG }, // 4 - { "pacuman06.bin", 0x0800, 0xe73dd1b9, 1 | BRF_ESS | BRF_PRG }, // 5 - { "pacuman07.bin", 0x0800, 0x908a2cb2, 1 | BRF_ESS | BRF_PRG }, // 6 - { "pacuman08.bin", 0x0800, 0xcf4ba26c, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "pm1chg1.bin", 0x0800, 0x2066a0b7, 2 | BRF_GRA }, // 8 Graphics - { "pm1chg2.bin", 0x0800, 0x3591b89d, 2 | BRF_GRA }, // 9 - { "pm1chg3.bin", 0x0800, 0x9e39323a, 2 | BRF_GRA }, // 10 - { "pm1chg4.bin", 0x0800, 0x1b1d9096, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(pacuman) -STD_ROM_FN(pacuman) - -struct BurnDriver BurnDrvpacuman = { - "pacuman", "puckman", NULL, NULL, "1980", - "Pacu-Man (Spanish bootleg of Puck Man)\0", NULL, "bootleg (Recreativos Franco S.A.)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacumanRomInfo, pacumanRomName, NULL, NULL, DrvInputInfo, PacumanDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Crock-Man - -static struct BurnRomInfo crockmanRomDesc[] = { - { "p1.6e", 0x0800, 0x2c0fa0ab, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "p5.6k", 0x0800, 0xafeca2f1, 1 | BRF_ESS | BRF_PRG }, // 1 - { "p2.6f", 0x0800, 0x7d177853, 1 | BRF_ESS | BRF_PRG }, // 2 - { "p6.6m", 0x0800, 0xd3e8914c, 1 | BRF_ESS | BRF_PRG }, // 3 - { "p3.6h", 0x0800, 0x9045a44c, 1 | BRF_ESS | BRF_PRG }, // 4 - { "p7.6n", 0x0800, 0x93f344c5, 1 | BRF_ESS | BRF_PRG }, // 5 - { "p4.6j", 0x0800, 0xbed4a077, 1 | BRF_ESS | BRF_PRG }, // 6 - { "p8.6p", 0x0800, 0x800be41e, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "p9.5e", 0x0800, 0xa10218c4, 2 | BRF_GRA }, // 8 Graphics - { "p11.5h", 0x0800, 0x3591b89d, 2 | BRF_GRA }, // 9 - { "p10.5f", 0x0800, 0x9e39323a, 2 | BRF_GRA }, // 10 - { "p12.5j", 0x0800, 0x1b1d9096, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(crockman) -STD_ROM_FN(crockman) - -struct BurnDriver BurnDrvcrockman = { - "crockman", "puckman", NULL, NULL, "1980", - "Crock-Man (bootleg, Rene-Pierre)\0", NULL, "bootleg (Rene-Pierre)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, crockmanRomInfo, crockmanRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac-Man (Midway, harder) - -static struct BurnRomInfo pacmodRomDesc[] = { - { "pacmanh.6e", 0x1000, 0x3b2ec270, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacman.6f", 0x1000, 0x1a6fb2d4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacmanh.6h", 0x1000, 0x18811780, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacmanh.6j", 0x1000, 0x5c96a733, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacmanh.5e", 0x1000, 0x299fb17a, 2 | BRF_GRA }, // 4 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(pacmod) -STD_ROM_FN(pacmod) - -struct BurnDriver BurnDrvpacmod = { - "pacmod", "puckman", NULL, NULL, "1981", - "Pac-Man (Midway, harder)\0", NULL, "[Namco] (Midway license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacmodRomInfo, pacmodRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// New Puck-X - -static struct BurnRomInfo newpuckxRomDesc[] = { - { "puckman.6e", 0x1000, 0xa8ae23c5, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacman.6f", 0x1000, 0x1a6fb2d4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "puckman.6h", 0x1000, 0x197443f8, 1 | BRF_ESS | BRF_PRG }, // 2 - { "puckman.6j", 0x1000, 0x2e64a3ba, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacman.5e", 0x1000, 0x0c944964, 2 | BRF_GRA }, // 4 Graphics - { "pacman.5f", 0x1000, 0x958fedf9, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(newpuckx) -STD_ROM_FN(newpuckx) - -struct BurnDriver BurnDrvnewpuckx = { - "newpuckx", "puckman", NULL, NULL, "1980", - "New Puck-X\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, newpuckxRomInfo, newpuckxRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac-Man (Hearts) - -static struct BurnRomInfo pacheartRomDesc[] = { - { "pacheart1.6e", 0x0800, 0xd844b679, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacheart.pg2", 0x0800, 0xb9152a38, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacheart2.6f", 0x0800, 0x7d177853, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacheart.pg4", 0x0800, 0x842d6574, 1 | BRF_ESS | BRF_PRG }, // 3 - { "pacheart3.6h", 0x0800, 0x9045a44c, 1 | BRF_ESS | BRF_PRG }, // 4 - { "pacheart7.6n", 0x0800, 0x888f3c3e, 1 | BRF_ESS | BRF_PRG }, // 5 - { "pacheart.pg7", 0x0800, 0xf5265c10, 1 | BRF_ESS | BRF_PRG }, // 6 - { "pacheart.pg8", 0x0800, 0x1a21a381, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "pacheart.ch1", 0x0800, 0xc62bbabf, 2 | BRF_GRA }, // 8 Graphics - { "chg2", 0x0800, 0x3591b89d, 2 | BRF_GRA }, // 9 - { "pacheart.ch3", 0x0800, 0xca8c184c, 2 | BRF_GRA }, // 10 - { "pacheart.ch4", 0x0800, 0x1b1d9096, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(pacheart) -STD_ROM_FN(pacheart) - -struct BurnDriver BurnDrvpacheart = { - "pacheart", "puckman", NULL, NULL, "1981", - "Pac-Man (Hearts)\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacheartRomInfo, pacheartRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Joyman - -static struct BurnRomInfo joymanRomDesc[] = { - { "joy1.6e", 0x0800, 0xd844b679, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "joy5.6k", 0x0800, 0xab9c8f29, 1 | BRF_ESS | BRF_PRG }, // 1 - { "joy2.6f", 0x0800, 0x7d177853, 1 | BRF_ESS | BRF_PRG }, // 2 - { "joy6.6m", 0x0800, 0xb3c8d32e, 1 | BRF_ESS | BRF_PRG }, // 3 - { "joy3.6h", 0x0800, 0x9045a44c, 1 | BRF_ESS | BRF_PRG }, // 4 - { "joy7.6n", 0x0800, 0x888f3c3e, 1 | BRF_ESS | BRF_PRG }, // 5 - { "joy4.6j", 0x0800, 0x00b553f8, 1 | BRF_ESS | BRF_PRG }, // 6 - { "joy8.6p", 0x0800, 0x5d5ce992, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "joy9.5e", 0x0800, 0x39b557bc, 2 | BRF_GRA }, // 8 Graphics - { "joy11.5h", 0x0800, 0x33e0289e, 2 | BRF_GRA }, // 9 - { "joy10.5f", 0x0800, 0x338771a6, 2 | BRF_GRA }, // 10 - { "joy12.5j", 0x0800, 0xf4f0add5, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(joyman) -STD_ROM_FN(joyman) - -struct BurnDriver BurnDrvjoyman = { - "joyman", "puckman", NULL, NULL, "1982", - "Joyman\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, joymanRomInfo, joymanRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Buccaneer - -static struct BurnRomInfo bucanerRomDesc[] = { - { "buc1.6e", 0x0800, 0x2c0fa0ab, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "buc5.6k", 0x0800, 0xafeca2f1, 1 | BRF_ESS | BRF_PRG }, // 1 - { "buc2.6f", 0x0800, 0x6b53ada9, 1 | BRF_ESS | BRF_PRG }, // 2 - { "buc6.6m", 0x0800, 0x35f3ca84, 1 | BRF_ESS | BRF_PRG }, // 3 - { "buc3.6h", 0x0800, 0x9045a44c, 1 | BRF_ESS | BRF_PRG }, // 4 - { "buc7.6n", 0x0800, 0x888f3c3e, 1 | BRF_ESS | BRF_PRG }, // 5 - { "buc4.6j", 0x0800, 0x292de161, 1 | BRF_ESS | BRF_PRG }, // 6 - { "buc8.6p", 0x0800, 0x884af858, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "buc9.5e", 0x0800, 0x4060c077, 2 | BRF_GRA }, // 8 Graphics - { "buc11.5h", 0x0800, 0xe3861283, 2 | BRF_GRA }, // 9 - { "buc10.5f", 0x0800, 0x09f66dec, 2 | BRF_GRA }, // 10 - { "buc12.5j", 0x0800, 0x653314e7, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(bucaner) -STD_ROM_FN(bucaner) - -struct BurnDriver BurnDrvbucaner = { - "bucaner", "puckman", NULL, NULL, "19??", - "Buccaneer\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, bucanerRomInfo, bucanerRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Caterpillar Pacman Hack - -static struct BurnRomInfo ctrpllrpRomDesc[] = { - { "c1.bin", 0x0800, 0x9d027c4a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "c5.bin", 0x0800, 0xf39846d3, 1 | BRF_ESS | BRF_PRG }, // 1 - { "c2.bin", 0x0800, 0xafa149a8, 1 | BRF_ESS | BRF_PRG }, // 2 - { "c6.bin", 0x0800, 0xbaf5461e, 1 | BRF_ESS | BRF_PRG }, // 3 - { "c3.bin", 0x0800, 0x6bb282a1, 1 | BRF_ESS | BRF_PRG }, // 4 - { "c7.bin", 0x0800, 0xfa2140f5, 1 | BRF_ESS | BRF_PRG }, // 5 - { "c4.bin", 0x0800, 0x86c91e0e, 1 | BRF_ESS | BRF_PRG }, // 6 - { "c8.bin", 0x0800, 0x3d28134e, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "c9.bin", 0x0800, 0x1c4617be, 2 | BRF_GRA }, // 8 Graphics - { "c11.bin", 0x0800, 0x46f72fef, 2 | BRF_GRA }, // 9 - { "c10.bin", 0x0800, 0xba9ec199, 2 | BRF_GRA }, // 10 - { "c12.bin", 0x0800, 0x41c09655, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(ctrpllrp) -STD_ROM_FN(ctrpllrp) - -struct BurnDriver BurnDrvctrpllrp = { - "ctrpllrp", "puckman", NULL, NULL, "1982", - "Caterpillar Pacman Hack\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, ctrpllrpRomInfo, ctrpllrpRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Puck Man (Spanish, 'Made in Greece' bootleg) - -static struct BurnRomInfo pacmanspRomDesc[] = { - { "1.bin", 0x8000, 0xf2404b4d, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - - { "2.bin", 0x2000, 0x7a75b696, 2 | BRF_GRA }, // 1 Graphics - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(pacmansp) -STD_ROM_FN(pacmansp) - -static void pacmansp_decode() -{ - // code - memcpy(DrvZ80ROM + 0x8000, DrvZ80ROM + 0x4000, 0x4000); - memset(DrvZ80ROM + 0x4000, 0, 0x4000); - - // gfx - UINT8 *pTemp = (UINT8*)BurnMalloc(0x2000); - memcpy(pTemp, DrvGfxROM, 0x2000); - memcpy(DrvGfxROM + 0x0000, pTemp + 0x0000, 0x800); - memcpy(DrvGfxROM + 0x1000, pTemp + 0x0800, 0x800); - memcpy(DrvGfxROM + 0x0800, pTemp + 0x1000, 0x800); - memcpy(DrvGfxROM + 0x1800, pTemp + 0x1800, 0x800); - BurnFree(pTemp); -} - -static INT32 pacmanspInit() -{ - return DrvInit(StandardMap, pacmansp_decode, PACMAN); -} - -struct BurnDriver BurnDrvpacmansp = { - "pacmansp", "puckman", NULL, NULL, "198?", - "Puck Man (Spanish, 'Made in Greece' bootleg)\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacmanspRomInfo, pacmanspRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - pacmanspInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac-Man Plus - -static struct BurnRomInfo pacplusRomDesc[] = { - { "pacplus.6e", 0x1000, 0xd611ef68, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacplus.6f", 0x1000, 0xc7207556, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacplus.6h", 0x1000, 0xae379430, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacplus.6j", 0x1000, 0x5a6dff7b, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pacplus.5e", 0x1000, 0x022c35da, 2 | BRF_GRA }, // 4 Graphics - { "pacplus.5f", 0x1000, 0x4de65cdd, 2 | BRF_GRA }, // 5 - - { "pacplus.7f", 0x0020, 0x063dd53a, 3 | BRF_GRA }, // 6 Color Proms - { "pacplus.4a", 0x0100, 0xe271a166, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(pacplus) -STD_ROM_FN(pacplus) - -static UINT8 pacplus_decrypt(INT32 addr, UINT8 e) -{ - static const UINT8 swap_xor_table[6][9] = - { - { 7,6,5,4,3,2,1,0, 0x00 }, - { 7,6,5,4,3,2,1,0, 0x28 }, - { 6,1,3,2,5,7,0,4, 0x96 }, - { 6,1,5,2,3,7,0,4, 0xbe }, - { 0,3,7,6,4,2,1,5, 0xd5 }, - { 0,3,4,6,7,2,1,5, 0xdd } - }; - - static const INT32 picktable[32] = - { - 0,2,4,2,4,0,4,2,2,0,2,2,4,0,4,2, - 2,2,4,0,4,2,4,0,0,4,0,4,4,2,4,2 - }; - - INT32 method = picktable[(addr & 0x001) | ((addr & 0x004) >> 1) | ((addr & 0x020) >> 3) | ((addr & 0x080) >> 4) | ((addr & 0x200) >> 5)]; - - if (addr & 0x800) method ^= 1; - - const UINT8 *tbl = swap_xor_table[method]; - - return BITSWAP08(e,tbl[0],tbl[1],tbl[2],tbl[3],tbl[4],tbl[5],tbl[6],tbl[7]) ^ tbl[8]; -} - -void pacplus_decode() -{ - for (INT32 i = 0; i < 0x4000; i++) - { - DrvZ80ROM[i] = pacplus_decrypt(i, DrvZ80ROM[i]); - } -} - -static INT32 pacplusInit() -{ - return DrvInit(StandardMap, pacplus_decode, PACMAN); -} - -struct BurnDriver BurnDrvpacplus = { - "pacplus", NULL, NULL, NULL, "1982", - "Pac-Man Plus\0", NULL, "[Namco] (Midway license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacplusRomInfo, pacplusRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - pacplusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Newpuc2 - -static struct BurnRomInfo newpuc2RomDesc[] = { - { "6e.cpu", 0x0800, 0x69496a98, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "6k.cpu", 0x0800, 0x158fc01c, 1 | BRF_ESS | BRF_PRG }, // 1 - { "6f.cpu", 0x0800, 0x7d177853, 1 | BRF_ESS | BRF_PRG }, // 2 - { "6m.cpu", 0x0800, 0x70810ccf, 1 | BRF_ESS | BRF_PRG }, // 3 - { "6h.cpu", 0x0800, 0x81719de8, 1 | BRF_ESS | BRF_PRG }, // 4 - { "6n.cpu", 0x0800, 0x3f250c58, 1 | BRF_ESS | BRF_PRG }, // 5 - { "6j.cpu", 0x0800, 0xe6675736, 1 | BRF_ESS | BRF_PRG }, // 6 - { "6p.cpu", 0x0800, 0x1f81e765, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "5e.cpu", 0x0800, 0x2066a0b7, 2 | BRF_GRA }, // 8 Graphics - { "5h.cpu", 0x0800, 0x777c70d3, 2 | BRF_GRA }, // 9 - { "5f.cpu", 0x0800, 0xca8c184c, 2 | BRF_GRA }, // 10 - { "5j.cpu", 0x0800, 0x7dc75a81, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(newpuc2) -STD_ROM_FN(newpuc2) - -struct BurnDriver BurnDrvnewpuc2 = { - "newpuc2", "puckman", NULL, NULL, "1980", - "Newpuc2\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, newpuc2RomInfo, newpuc2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Newpuc2b - -static struct BurnRomInfo newpuc2bRomDesc[] = { - { "np2b1.bin", 0x0800, 0x9d027c4a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "6k.cpu", 0x0800, 0x158fc01c, 1 | BRF_ESS | BRF_PRG }, // 1 - { "6f.cpu", 0x0800, 0x7d177853, 1 | BRF_ESS | BRF_PRG }, // 2 - { "6m.cpu", 0x0800, 0x70810ccf, 1 | BRF_ESS | BRF_PRG }, // 3 - { "np2b3.bin", 0x0800, 0xf5e4b2b1, 1 | BRF_ESS | BRF_PRG }, // 4 - { "6n.cpu", 0x0800, 0x3f250c58, 1 | BRF_ESS | BRF_PRG }, // 5 - { "np2b4.bin", 0x0800, 0xf068e009, 1 | BRF_ESS | BRF_PRG }, // 6 - { "np2b8.bin", 0x0800, 0x1fadcc2f, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "5e.cpu", 0x0800, 0x2066a0b7, 2 | BRF_GRA }, // 8 Graphics - { "5h.cpu", 0x0800, 0x777c70d3, 2 | BRF_GRA }, // 9 - { "5f.cpu", 0x0800, 0xca8c184c, 2 | BRF_GRA }, // 10 - { "5j.cpu", 0x0800, 0x7dc75a81, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Prom - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(newpuc2b) -STD_ROM_FN(newpuc2b) - -struct BurnDriver BurnDrvnewpuc2b = { - "newpuc2b", "puckman", NULL, NULL, "1980", - "Newpuc2b\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, newpuc2bRomInfo, newpuc2bRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// MS Pacman - -static struct BurnRomInfo mspacmanRomDesc[] = { - { "pacman.6e", 0x1000, 0xc1e6ab10, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacman.6f", 0x1000, 0x1a6fb2d4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacman.6h", 0x1000, 0xbcdd1beb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacman.6j", 0x1000, 0x817d94e3, 1 | BRF_ESS | BRF_PRG }, // 3 - { "u5", 0x0800, 0xf45fbbcd, 1 | BRF_ESS | BRF_PRG }, // 4 - { "u6", 0x1000, 0xa90e7000, 1 | BRF_ESS | BRF_PRG }, // 5 - { "u7", 0x1000, 0xc82cd714, 1 | BRF_ESS | BRF_PRG }, // 6 - - { "5e", 0x1000, 0x5c281d01, 2 | BRF_GRA }, // 7 Graphics - { "5f", 0x1000, 0x615af909, 2 | BRF_GRA }, // 8 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 9 Color Prom - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 10 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 11 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 12 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacman) -STD_ROM_FN(mspacman) - -static void MspacmanDecode() -{ -#define ADD0SWAP(x) BITSWAP16(x,15,14,13,12,11,3,7,9,10,8,6,5,4,2,1,0) -#define ADD1SWAP(x) BITSWAP16(x,15,14,13,12,11,8,7,5,9,10,6,3,4,2,1,0) -#define DATASWAP(x) BITSWAP08(x,0,4,5,7,6,3,2,1) - - static const UINT16 tab[10 * 8] = { // even is dst, odd is src - 0x0410, 0x8008, 0x08E0, 0x81D8, 0x0A30, 0x8118, 0x0BD0, 0x80D8, - 0x0C20, 0x8120, 0x0E58, 0x8168, 0x0EA8, 0x8198, 0x1000, 0x8020, - 0x1008, 0x8010, 0x1288, 0x8098, 0x1348, 0x8048, 0x1688, 0x8088, - 0x16B0, 0x8188, 0x16D8, 0x80C8, 0x16F8, 0x81C8, 0x19A8, 0x80A8, - 0x19B8, 0x81A8, 0x2060, 0x8148, 0x2108, 0x8018, 0x21A0, 0x81A0, - 0x2298, 0x80A0, 0x23E0, 0x80E8, 0x2418, 0x8000, 0x2448, 0x8058, - 0x2470, 0x8140, 0x2488, 0x8080, 0x24B0, 0x8180, 0x24D8, 0x80C0, - 0x24F8, 0x81C0, 0x2748, 0x8050, 0x2780, 0x8090, 0x27B8, 0x8190, - 0x2800, 0x8028, 0x2B20, 0x8100, 0x2B30, 0x8110, 0x2BF0, 0x81D0, - 0x2CC0, 0x80D0, 0x2CD8, 0x80E0, 0x2CF0, 0x81E0, 0x2D60, 0x8160 - }; - - memcpy (DrvZ80ROM + 0x0b000, DrvZ80ROM + 0x0a000, 0x01000); - memcpy (DrvZ80ROM + 0x10000, DrvZ80ROM + 0x00000, 0x03000); - - for (INT32 i = 0; i < 0x1000; i++) - { - DrvZ80ROM[0x13000+i] = DATASWAP(DrvZ80ROM[0xb000+ADD0SWAP(i)]); - } - - for (INT32 i = 0; i < 0x800; i++) - { - DrvZ80ROM[0x18000+i] = DATASWAP(DrvZ80ROM[0x8000+ADD1SWAP(i)]); - DrvZ80ROM[0x18800+i] = DATASWAP(DrvZ80ROM[0x9800+ADD0SWAP(i)]); - DrvZ80ROM[0x19000+i] = DATASWAP(DrvZ80ROM[0x9000+ADD0SWAP(i)]); - DrvZ80ROM[0x19800+i] = DrvZ80ROM[0x1800+i]; - } - - memcpy (DrvZ80ROM + 0x1a000, DrvZ80ROM + 0x02000, 0x2000); - - for (INT32 i = 0; i < 80; i+=2) { // apply patches - memcpy (DrvZ80ROM + 0x10000 + tab[i], DrvZ80ROM + 0x10000 + tab[i+1], 8); - } - - memcpy (DrvZ80ROM + 0x8000, DrvZ80ROM, 0x4000); -} - -static INT32 mspacmanInit() -{ - return DrvInit(MspacmanMap, MspacmanDecode, MSPACMAN); -} - -struct BurnDriver BurnDrvmspacman = { - "mspacman", NULL, NULL, NULL, "1980", - "MS Pacman\0", NULL, "Namco", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmanRomInfo, mspacmanRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ms. Pac-Man (with speedup hack) - -static struct BurnRomInfo mspacmnfRomDesc[] = { - { "pacman.6e", 0x1000, 0xc1e6ab10, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacfast.6f", 0x1000, 0x720dc3ee, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacman.6h", 0x1000, 0xbcdd1beb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacman.6j", 0x1000, 0x817d94e3, 1 | BRF_ESS | BRF_PRG }, // 3 - { "u5", 0x0800, 0xf45fbbcd, 1 | BRF_ESS | BRF_PRG }, // 4 - { "u6", 0x1000, 0xa90e7000, 1 | BRF_ESS | BRF_PRG }, // 5 - { "u7", 0x1000, 0xc82cd714, 1 | BRF_ESS | BRF_PRG }, // 6 - - { "5e", 0x1000, 0x5c281d01, 2 | BRF_GRA }, // 7 Graphics - { "5f", 0x1000, 0x615af909, 2 | BRF_GRA }, // 8 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 9 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacmnf) -STD_ROM_FN(mspacmnf) - -struct BurnDriver BurnDrvmspacmnf = { - "mspacmnf", "mspacman", NULL, NULL, "1980", - "Ms. Pac-Man (with speedup hack)\0", NULL, "Midway", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmnfRomInfo, mspacmnfRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ms. Pac Attack - -static struct BurnRomInfo mspacmatRomDesc[] = { - { "pacman.6e", 0x1000, 0xc1e6ab10, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacman.6f", 0x1000, 0x1a6fb2d4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacman.6h", 0x1000, 0xbcdd1beb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacman.6j", 0x1000, 0x817d94e3, 1 | BRF_ESS | BRF_PRG }, // 3 - { "u5", 0x0800, 0xf45fbbcd, 1 | BRF_ESS | BRF_PRG }, // 4 - { "u6pacatk", 0x1000, 0xf6d83f4d, 1 | BRF_ESS | BRF_PRG }, // 5 - { "u7", 0x1000, 0xc82cd714, 1 | BRF_ESS | BRF_PRG }, // 6 - - { "5e", 0x1000, 0x5c281d01, 2 | BRF_GRA }, // 7 Graphics - { "5f", 0x1000, 0x615af909, 2 | BRF_GRA }, // 8 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 9 Color Prom - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 10 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 11 - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 12 Sound Prom (not used) -}; - -STD_ROM_PICK(mspacmat) -STD_ROM_FN(mspacmat) - -struct BurnDriver BurnDrvmspacmat = { - "mspacmat", "mspacman", NULL, NULL, "1980", - "Ms. Pac Attack\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmatRomInfo, mspacmatRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ms. Pac-Man Heart Burn - -static struct BurnRomInfo msheartbRomDesc[] = { - { "pacman.6e", 0x1000, 0xc1e6ab10, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacman.6f", 0x1000, 0x1a6fb2d4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacman.6h", 0x1000, 0xbcdd1beb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacman.6j", 0x1000, 0x817d94e3, 1 | BRF_ESS | BRF_PRG }, // 3 - { "u5", 0x0800, 0xf45fbbcd, 1 | BRF_ESS | BRF_PRG }, // 4 - { "u6", 0x1000, 0xa90e7000, 1 | BRF_ESS | BRF_PRG }, // 5 - { "u7", 0x1000, 0xc82cd714, 1 | BRF_ESS | BRF_PRG }, // 6 - - { "5e", 0x1000, 0x5431d4c4, 2 | BRF_GRA }, // 7 Graphics - { "5f", 0x1000, 0xceb50654, 2 | BRF_GRA }, // 8 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 9 Color Prom - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 10 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 11 - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 12 Sound Prom (not used) -}; - -STD_ROM_PICK(msheartb) -STD_ROM_FN(msheartb) - -struct BurnDriver BurnDrvmsheartb = { - "msheartb", "mspacman", NULL, NULL, "1980", - "Ms. Pac-Man Heart Burn\0", NULL, "hack (Two-Bit Score)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, msheartbRomInfo, msheartbRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// MS Pacman (bootleg) - -static struct BurnRomInfo mspacmabRomDesc[] = { - { "boot1", 0x1000, 0xd16b31b7, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "boot2", 0x1000, 0x0d32de5e, 1 | BRF_ESS | BRF_PRG }, // 1 - { "boot3", 0x1000, 0x1821ee0b, 1 | BRF_ESS | BRF_PRG }, // 2 - { "boot4", 0x1000, 0x165a9dd8, 1 | BRF_ESS | BRF_PRG }, // 3 - { "boot5", 0x1000, 0x8c3e6de6, 1 | BRF_ESS | BRF_PRG }, // 4 - { "boot6", 0x1000, 0x368cb165, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "5e", 0x1000, 0x5c281d01, 2 | BRF_GRA }, // 6 Graphics - { "5f", 0x1000, 0x615af909, 2 | BRF_GRA }, // 7 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 8 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacmab) -STD_ROM_FN(mspacmab) - -static INT32 mspacmanbInit() -{ - return DrvInit(MspacmanMap, NULL, PACMAN); -} - -struct BurnDriver BurnDrvmspacmab = { - "mspacmab", "mspacman", NULL, NULL, "1981", - "MS Pacman (bootleg)\0", NULL, "Namco", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmabRomInfo, mspacmabRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ms. Pac-Man (bootleg, encrypted) - -static struct BurnRomInfo mspacmbeRomDesc[] = { - { "boot1", 0x1000, 0xd16b31b7, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "2.bin", 0x1000, 0x04e6c486, 1 | BRF_ESS | BRF_PRG }, // 1 - { "boot3", 0x1000, 0x1821ee0b, 1 | BRF_ESS | BRF_PRG }, // 2 - { "boot4", 0x1000, 0x165a9dd8, 1 | BRF_ESS | BRF_PRG }, // 3 - { "boot5", 0x1000, 0x8c3e6de6, 1 | BRF_ESS | BRF_PRG }, // 4 - { "6.bin", 0x1000, 0x206a9623, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "5e", 0x1000, 0x5c281d01, 2 | BRF_GRA }, // 6 Graphics - { "5f", 0x1000, 0x615af909, 2 | BRF_GRA }, // 7 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 8 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacmbe) -STD_ROM_FN(mspacmbe) - -static void mspacmbe_decode() -{ - for(INT32 i = 0x1000; i < 0x2000; i+=4) - { - if (!(i & 8)) - { - INT32 t = DrvZ80ROM[i+1]; - DrvZ80ROM[i+1] = DrvZ80ROM[i+2]; - DrvZ80ROM[i+2] = t; - }; - } -} - -static INT32 mspacmbeInit() -{ - return DrvInit(MspacmanMap, mspacmbe_decode, PACMAN); -} - -struct BurnDriver BurnDrvmspacmbe = { - "mspacmbe", "mspacman", NULL, NULL, "1981", - "Ms. Pac-Man (bootleg, encrypted)\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmbeRomInfo, mspacmbeRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmbeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pac-Gal - -static struct BurnRomInfo pacgalRomDesc[] = { - { "boot1", 0x1000, 0xd16b31b7, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "boot2", 0x1000, 0x0d32de5e, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pacman.7fh", 0x1000, 0x513f4d5c, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pacman.7hj", 0x1000, 0x70694c8e, 1 | BRF_ESS | BRF_PRG }, // 3 - { "boot5", 0x1000, 0x8c3e6de6, 1 | BRF_ESS | BRF_PRG }, // 4 - { "boot6", 0x1000, 0x368cb165, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "5e", 0x1000, 0x5c281d01, 2 | BRF_GRA }, // 6 Graphics - { "pacman.5ef", 0x0800, 0x65a3ee71, 2 | BRF_GRA }, // 7 - { "pacman.5hj", 0x0800, 0x50c7477d, 2 | BRF_GRA }, // 8 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 9 Color Proms - { "82s129.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 10 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 11 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 12 Timing Prom (not used) -}; - -STD_ROM_PICK(pacgal) -STD_ROM_FN(pacgal) - -struct BurnDriver BurnDrvpacgal = { - "pacgal", "mspacman", NULL, NULL, "1981", - "Pac-Gal\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pacgalRomInfo, pacgalRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ms. Pac-Man Plus - -static struct BurnRomInfo mspacplsRomDesc[] = { - { "boot1", 0x1000, 0xd16b31b7, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "mspacatk.2", 0x1000, 0x0af09d31, 1 | BRF_ESS | BRF_PRG }, // 1 - { "boot3", 0x1000, 0x1821ee0b, 1 | BRF_ESS | BRF_PRG }, // 2 - { "boot4", 0x1000, 0x165a9dd8, 1 | BRF_ESS | BRF_PRG }, // 3 - { "mspacatk.5", 0x1000, 0xe6e06954, 1 | BRF_ESS | BRF_PRG }, // 4 - { "mspacatk.6", 0x1000, 0x3b5db308, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "5e", 0x1000, 0x5c281d01, 2 | BRF_GRA }, // 6 Graphics - { "5f", 0x1000, 0x615af909, 2 | BRF_GRA }, // 7 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 8 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacpls) -STD_ROM_FN(mspacpls) - -struct BurnDriver BurnDrvmspacpls = { - "mspacpls", "mspacman", NULL, NULL, "1981", - "Ms. Pac-Man Plus\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacplsRomInfo, mspacplsRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ms. Pac-Man ('Made in Greece' bootleg) - -static struct BurnRomInfo mspacmanbgRomDesc[] = { - { "9.g5", 0x8000, 0x97c64918, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - - { "10.e5", 0x8000, 0xf2c5da43, 2 | BRF_GRA }, // 1 Graphics - - { "82s123.h7", 0x0020, 0x3545e7e9, 3 | BRF_GRA }, // 2 Color Proms - { "82s129-3.d1", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 3 - - { "82s129-1.a9", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 4 Sound Prom - { "82s129-2.c9", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 5 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacmanbg) -STD_ROM_FN(mspacmanbg) - -static INT32 mspacmanbgInit() -{ - return DrvInit(MspacmanMap, pacmansp_decode, PACMAN); -} - -struct BurnDriver BurnDrvmspacmanbg = { - "mspacmanbg", "mspacman", NULL, NULL, "198?", - "Ms. Pac-Man ('Made in Greece' bootleg)\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmanbgRomInfo, mspacmanbgRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanbgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Miss Pukman ('Made in Greece' Datamat bootleg) - -static struct BurnRomInfo mspacmanbgdRomDesc[] = { - { "27256.01", 0x8000, 0x5bcc195e, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - - { "10.e5", 0x8000, 0xf2c5da43, 2 | BRF_GRA }, // 1 Graphics - - { "82s123.h7", 0x0020, 0x3545e7e9, 3 | BRF_GRA }, // 2 Color Proms - { "82s129-3.d1", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 3 - - { "82s129-1.a9", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 4 Sound Prom - { "82s129-2.c9", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 5 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacmanbgd) -STD_ROM_FN(mspacmanbgd) - -struct BurnDriver BurnDrvmspacmanbgd = { - "mspacmanbgd", "mspacman", NULL, NULL, "1992", - "Miss Pukman ('Made in Greece' Datamat bootleg)\0", NULL, "bootleg (Datamat)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmanbgdRomInfo, mspacmanbgdRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanbgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Come-Cocos (Ms. Pac-Man) ('Made in Greece' Triunvi bootleg) - -static struct BurnRomInfo mspacmanbltRomDesc[] = { - { "triunvi.1.bin", 0x8000, 0xd9da2917, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - - { "triunvi.2.bin", 0x2000, 0xe6446f49, 2 | BRF_GRA }, // 1 Graphics - - { "82s123.h7", 0x0020, 0x3545e7e9, 3 | BRF_GRA }, // 2 Color Proms - { "82s129-3.d1", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 3 - - { "82s129-1.a9", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 4 Sound Prom - { "82s129-2.c9", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 5 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacmanblt) -STD_ROM_FN(mspacmanblt) - -struct BurnDriver BurnDrvmspacmanblt = { - "mspacmanblt", "mspacman", NULL, NULL, "1991", - "Miss Pukman ('Made in Greece' Triunvi bootleg)\0", NULL, "bootleg (Triunvi)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmanbltRomInfo, mspacmanbltRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanbgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Come-Cocos (Ms. Pac-Man) ('Made in Greece' Tecnausa bootleg) - -static struct BurnRomInfo mspacmanbccRomDesc[] = { - { "comecocos.bin", 0x8000, 0x220eccae, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - - { "10.e5", 0x8000, 0xf2c5da43, 2 | BRF_GRA }, // 1 Graphics - - { "82s123.h7", 0x0020, 0x3545e7e9, 3 | BRF_GRA }, // 2 Color Proms - { "82s129-3.d1", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 3 - - { "82s129-1.a9", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 4 Sound Prom - { "82s129-2.c9", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 5 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacmanbcc) -STD_ROM_FN(mspacmanbcc) - -struct BurnDriver BurnDrvmspacmanbcc = { - "mspacmanbcc", "mspacman", NULL, NULL, "1981", - "Come-Cocos (Ms. Pac-Man) ('Made in Greece' Tecnausa bootleg)\0", NULL, "bootleg (Tecnausa)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmanbccRomInfo, mspacmanbccRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanbgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Come-Cocos (Ms. Pac-Man) ('Made in Greece' Herle SA bootleg) - -static struct BurnRomInfo mspacmanbheRomDesc[] = { - { "11.g5", 0x8000, 0xb256540f, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - - { "13.e5", 0x4000, 0x8ee4a3b0, 2 | BRF_GRA }, // 1 Graphics - - { "82s123.h7", 0x0020, 0x3545e7e9, 3 | BRF_GRA }, // 2 Color Proms - { "82s129-3.d1", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 3 - - { "82s129-1.a9", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 4 Sound Prom - { "82s129-2.c9", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 5 Timing Prom (not used) -}; - -STD_ROM_PICK(mspacmanbhe) -STD_ROM_FN(mspacmanbhe) - -struct BurnDriver BurnDrvmspacmanbhe = { - "mspacmanbhe", "mspacman", NULL, NULL, "1981", - "Come-Cocos (Ms. Pac-Man) ('Made in Greece' Herle SA bootleg)\0", NULL, "bootleg (Herle SA)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mspacmanbheRomInfo, mspacmanbheRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - mspacmanbgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ms. Pacman Champion Edition / Zola-Puc Gal - -static struct BurnRomInfo mschampRomDesc[] = { - { "9fg.bin", 0x10000, 0x04dba113, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - - { "8e.bin", 0x2000, 0x17435f53, 2 | BRF_GRA }, // 1 Graphics - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 2 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 3 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 4 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 5 Timing Prom (not used)) ) -}; - -STD_ROM_PICK(mschamp) -STD_ROM_FN(mschamp) - -static void mschampCallback() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x1000); - - memcpy (tmp + 0x0000, DrvGfxROM + 0x0800, 0x1000); - memcpy (DrvGfxROM + 0x1000, tmp + 0x0000, 0x0800); - memcpy (DrvGfxROM + 0x0800, tmp + 0x0800, 0x0800); - - BurnFree(tmp); -} - -static INT32 mschampInit() -{ - return DrvInit(WoodpekMap, mschampCallback, MSCHAMP); -} - -struct BurnDriver BurnDrvmschamp = { - "mschamp", "mspacman", NULL, NULL, "1995", - "Ms. Pacman Champion Edition / Zola-Puc Gal\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mschampRomInfo, mschampRomName, NULL, NULL, mschampInputInfo, mschampDIPInfo, - mschampInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ms. Pacman Champion Edition / Super Zola Pac Gal - -static struct BurnRomInfo mschampsRomDesc[] = { - { "pm4.bin", 0x10000, 0x7d6b6303, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - - { "pm5.bin", 0x2000, 0x7fe6b9e2, 2 | BRF_GRA }, // 1 Graphics - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 2 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 3 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 4 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 5 Timing Prom (not used)) ) -}; - -STD_ROM_PICK(mschamps) -STD_ROM_FN(mschamps) - -struct BurnDriver BurnDrvmschamps = { - "mschamps", "mspacman", NULL, NULL, "1995", - "Ms. Pacman Champion Edition / Super Zola Pac Gal\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mschampsRomInfo, mschampsRomName, NULL, NULL, mschampInputInfo, mschampDIPInfo, - mschampInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Crush Roller (Kural Samno) - -static struct BurnRomInfo crushRomDesc[] = { - { "crushkrl.6e", 0x1000, 0xa8dd8f54, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "crushkrl.6f", 0x1000, 0x91387299, 1 | BRF_ESS | BRF_PRG }, // 1 - { "crushkrl.6h", 0x1000, 0xd4455f27, 1 | BRF_ESS | BRF_PRG }, // 2 - { "crushkrl.6j", 0x1000, 0xd59fc251, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "maketrax.5e", 0x1000, 0x91bad2da, 2 | BRF_GRA }, // 4 Graphics - { "maketrax.5f", 0x1000, 0xaea79f55, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Prom - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(crush) -STD_ROM_FN(crush) - -static void maketraxCallback() -{ - DrvZ80ROM[0x0224] = 0x00; - DrvZ80ROM[0x0225] = 0x00; - DrvZ80ROM[0x0226] = 0x00; - DrvZ80ROM[0x022D] = 0x00; - DrvZ80ROM[0x022F] = 0x00; - DrvZ80ROM[0x023C] = 0x00; - DrvZ80ROM[0x023D] = 0x00; - DrvZ80ROM[0x023E] = 0x00; - DrvZ80ROM[0x0415] = 0xc9; - DrvZ80ROM[0x0428] = 0xC6; - DrvZ80ROM[0x0429] = 0x12; - DrvZ80ROM[0x115E] = 0xC9; - DrvZ80ROM[0x1481] = 0x28; - DrvZ80ROM[0x1492] = 0x20; - DrvZ80ROM[0x14A5] = 0xC8; - DrvZ80ROM[0x1978] = 0x18; - DrvZ80ROM[0x1C9F] = 0xA7; - DrvZ80ROM[0x1CA0] = 0xC9; - DrvZ80ROM[0x238e] = 0xc9; - DrvZ80ROM[0x3AE5] = 0x3E; - DrvZ80ROM[0x3AE7] = 0xFE; - DrvZ80ROM[0x3AE8] = 0x3F; - DrvZ80ROM[0x3AE9] = 0xC9; -} - -static INT32 crushInit() -{ - return DrvInit(StandardMap, maketraxCallback, PACMAN); -} - -struct BurnDriver BurnDrvcrush = { - "crush", NULL, NULL, NULL, "1981", - "Crush Roller (Kural Samno)\0", NULL, "Kural Samno Electric", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, crushRomInfo, crushRomName, NULL, NULL, DrvInputInfo, maketraxDIPInfo, - crushInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Crush Roller (bootleg set 1) - -static struct BurnRomInfo crushblRomDesc[] = { - { "cr1.bin", 0x1000, 0xe2e84cd1, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "cr2.bin", 0x1000, 0xec020e6f, 1 | BRF_ESS | BRF_PRG }, // 1 - { "cr3.bin", 0x1000, 0xd4455f27, 1 | BRF_ESS | BRF_PRG }, // 2 - { "cr4.bin", 0x1000, 0x9936ae06, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "maketrax.5e", 0x1000, 0x91bad2da, 2 | BRF_GRA }, // 4 Graphics - { "maketrax.5f", 0x1000, 0xaea79f55, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Prom - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(crushbl) -STD_ROM_FN(crushbl) - -struct BurnDriver BurnDrvcrushbl = { - "crushbl", "crush", NULL, NULL, "1981", - "Crush Roller (bootleg set 1)\0", NULL, "Kural Samno Electric", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, crushblRomInfo, crushblRomName, NULL, NULL, DrvInputInfo, maketraxDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Crush Roller (bootleg set 2) - -static struct BurnRomInfo crushbl2RomDesc[] = { - { "cr5.7d", 0x1000, 0x4954d51d, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "cr6.7e", 0x1000, 0x27eb4299, 1 | BRF_ESS | BRF_PRG }, // 1 - { "cr7.7h", 0x1000, 0xd297108e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "cr8.7j", 0x1000, 0xbcc40eaf, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "cr1.5e", 0x0800, 0xc7617198, 2 | BRF_GRA }, // 4 Graphics - { "cr3.5h", 0x0800, 0xc15b6967, 2 | BRF_GRA }, // 5 - { "cr2.5f", 0x0800, 0xd5bc5cb8, 2 | BRF_GRA }, // 6 - { "cr4.5j", 0x0800, 0xd35d1caf, 2 | BRF_GRA }, // 7 - - { "74s288.8a", 0x0020, 0xff344446, 3 | BRF_GRA }, // 8 Color Prom - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(crushbl2) -STD_ROM_FN(crushbl2) - -struct BurnDriver BurnDrvcrushbl2 = { - "crushbl2", "crush", NULL, NULL, "1981", - "Crush Roller (bootleg set 2)\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, crushbl2RomInfo, crushbl2RomName, NULL, NULL, DrvInputInfo, maketraxDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Crush Roller (bootleg set 3) - -static struct BurnRomInfo crushbl3RomDesc[] = { - { "cre.bin", 0x1000, 0xe1ecc4da, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "crf.bin", 0x1000, 0xb5193960, 1 | BRF_ESS | BRF_PRG }, // 1 - { "crg.bin", 0x1000, 0x964b9f24, 1 | BRF_ESS | BRF_PRG }, // 2 - { "crh.bin", 0x1000, 0xdfd2380e, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "cr1.5e", 0x0800, 0xc7617198, 2 | BRF_GRA }, // 4 Graphics - { "cr3.5h", 0x0800, 0xc15b6967, 2 | BRF_GRA }, // 5 - { "cr2.5f", 0x0800, 0xd5bc5cb8, 2 | BRF_GRA }, // 6 - { "cr4.5j", 0x0800, 0xd35d1caf, 2 | BRF_GRA }, // 7 - - { "74s288.8a", 0x0020, 0xff344446, 3 | BRF_GRA }, // 8 Color Prom - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(crushbl3) -STD_ROM_FN(crushbl3) - -struct BurnDriver BurnDrvcrushbl3 = { - "crushbl3", "crush", NULL, NULL, "1981", - "Crush Roller (bootleg set 3)\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, crushbl3RomInfo, crushbl3RomName, NULL, NULL, DrvInputInfo, maketraxDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Crush Roller (Kural Esco - bootleg?) - -static struct BurnRomInfo crush2RomDesc[] = { - { "tp1", 0x0800, 0xf276592e, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "tp5a", 0x0800, 0x3d302abe, 1 | BRF_ESS | BRF_PRG }, // 1 - { "tp2", 0x0800, 0x25f42e70, 1 | BRF_ESS | BRF_PRG }, // 2 - { "tp6", 0x0800, 0x98279cbe, 1 | BRF_ESS | BRF_PRG }, // 3 - { "tp3", 0x0800, 0x8377b4cb, 1 | BRF_ESS | BRF_PRG }, // 4 - { "tp7", 0x0800, 0xd8e76c8c, 1 | BRF_ESS | BRF_PRG }, // 5 - { "tp4", 0x0800, 0x90b28fa3, 1 | BRF_ESS | BRF_PRG }, // 6 - { "tp8", 0x0800, 0x10854e1b, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "tpa", 0x0800, 0xc7617198, 2 | BRF_GRA }, // 8 Graphics - { "tpc", 0x0800, 0xe129d76a, 2 | BRF_GRA }, // 9 - { "tpb", 0x0800, 0xd1899f05, 2 | BRF_GRA }, // 10 - { "tpd", 0x0800, 0xd35d1caf, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(crush2) -STD_ROM_FN(crush2) - -struct BurnDriver BurnDrvcrush2 = { - "crush2", "crush", NULL, NULL, "1981", - "Crush Roller (Kural Esco - bootleg?)\0", NULL, "Kural Esco Electric", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, crush2RomInfo, crush2RomName, NULL, NULL, DrvInputInfo, maketraxDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Crush Roller (Kural - bootleg?) - -static struct BurnRomInfo crush4RomDesc[] = { - { "unkmol.4e", 0x0800, 0x49150ddf, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "unkmol.6e", 0x0800, 0x21f47e17, 1 | BRF_ESS | BRF_PRG }, // 1 - { "unkmol.4f", 0x0800, 0x9b6dd592, 1 | BRF_ESS | BRF_PRG }, // 2 - { "unkmol.6f", 0x0800, 0x755c1452, 1 | BRF_ESS | BRF_PRG }, // 3 - { "unkmol.4h", 0x0800, 0xed30a312, 1 | BRF_ESS | BRF_PRG }, // 4 - { "unkmol.6h", 0x0800, 0xfe4bb0eb, 1 | BRF_ESS | BRF_PRG }, // 5 - { "unkmol.4j", 0x0800, 0x072b91c9, 1 | BRF_ESS | BRF_PRG }, // 6 - { "unkmol.6j", 0x0800, 0x66fba07d, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "unkmol.5e", 0x0800, 0x338880a0, 2 | BRF_GRA }, // 8 Graphics - { "unkmol.5h", 0x0800, 0x4ce9c81f, 2 | BRF_GRA }, // 9 - { "unkmol.5f", 0x0800, 0x752e3780, 2 | BRF_GRA }, // 10 - { "unkmol.5j", 0x0800, 0x6e00d2ac, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(crush4) -STD_ROM_FN(crush4) - -static void eyes_gfx_decode(UINT8 *src) -{ - UINT8 buf[8]; - - for (INT32 i = 0; i < 8; i++) { - buf[i] = BITSWAP08(src[((i & 1) << 2) | ((i & 4) >> 2) | (i & 2)],7,4,5,6,3,2,1,0); - } - - memcpy (src, buf, 8); -} - -static void eyes_decode() -{ - for (INT32 i = 0; i < 0x4000; i++) - DrvZ80ROM[i] = BITSWAP08(DrvZ80ROM[i],7,6,3,4,5,2,1,0); - - for (INT32 i = 0;i < 0x2000; i += 8) - eyes_gfx_decode(DrvGfxROM + i); -} - -static INT32 crush4Init() -{ - return DrvInit(StandardMap, eyes_decode, PACMAN); -} - -struct BurnDriver BurnDrvcrush4 = { - "crush4", "crush", NULL, NULL, "1981", - "Crush Roller (Kural - bootleg?)\0", NULL, "Kural Electric", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, crush4RomInfo, crush4RomName, NULL, NULL, DrvInputInfo, maketraxDIPInfo, - crush4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Crush Roller (Kural TWT) - -static struct BurnRomInfo crush5RomDesc[] = { - { "crtwt.2", 0x10000, 0xadbd21f7, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code (banked) - - { "crtwt.1", 0x4000, 0x4250a9ea, 2 | BRF_GRA }, // 1 Graphics - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 2 Color Proms - { "82s129.bin", 0x0100, 0x2bc5d339, 3 | BRF_GRA }, // 3 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 4 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 5 Timing Prom (not used) -}; - -STD_ROM_PICK(crush5) -STD_ROM_FN(crush5) - -static void crush5Callback() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - - memcpy (tmp + 0x0000, DrvGfxROM + 0x0000, 0x04000); - memcpy (DrvGfxROM + 0x1000, tmp + 0x0800, 0x00800); - memcpy (DrvGfxROM + 0x0800, tmp + 0x1000, 0x00800); - memcpy (DrvGfxROM + 0x3000, tmp + 0x2800, 0x00800); - memcpy (DrvGfxROM + 0x2800, tmp + 0x3000, 0x00800); - - memcpy (DrvZ80ROM + 0x00000, DrvZ80ROM + 0x08000, 0x04000); - memcpy (DrvZ80ROM + 0x08000, DrvZ80ROM + 0x0c000, 0x04000); - memset (DrvZ80ROM + 0x0c000, 0, 0x4000); - - BurnFree (tmp); -} - -static INT32 crush5Init() -{ - return DrvInit(StandardMap, crush5Callback, PACMAN); -} - -struct BurnDriver BurnDrvcrush5 = { - "crush5", "crush", NULL, NULL, "1981", - "Crush Roller (Kural TWT)\0", NULL, "Kural TWT", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, crush5RomInfo, crush5RomName, NULL, NULL, DrvInputInfo, maketraxDIPInfo, - crush5Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Paint Roller - -static struct BurnRomInfo paintrlrRomDesc[] = { - { "paintrlr.1", 0x0800, 0x556d20b5, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "paintrlr.5", 0x0800, 0x4598a965, 1 | BRF_ESS | BRF_PRG }, // 1 - { "paintrlr.2", 0x0800, 0x2da29c81, 1 | BRF_ESS | BRF_PRG }, // 2 - { "paintrlr.6", 0x0800, 0x1f561c54, 1 | BRF_ESS | BRF_PRG }, // 3 - { "paintrlr.3", 0x0800, 0xe695b785, 1 | BRF_ESS | BRF_PRG }, // 4 - { "paintrlr.7", 0x0800, 0x00e6eec0, 1 | BRF_ESS | BRF_PRG }, // 5 - { "paintrlr.4", 0x0800, 0x0fd5884b, 1 | BRF_ESS | BRF_PRG }, // 6 - { "paintrlr.8", 0x0800, 0x4900114a, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "tpa", 0x0800, 0xc7617198, 2 | BRF_GRA }, // 8 Graphics - { "mbrush.5h", 0x0800, 0xc15b6967, 2 | BRF_GRA }, // 9 - { "mbrush.5f", 0x0800, 0xd5bc5cb8, 2 | BRF_GRA }, // 10 - { "tpd", 0x0800, 0xd35d1caf, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (unused) -}; - -STD_ROM_PICK(paintrlr) -STD_ROM_FN(paintrlr) - -struct BurnDriver BurnDrvpaintrlr = { - "paintrlr", "crush", NULL, NULL, "1981", - "Paint Roller\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, paintrlrRomInfo, paintrlrRomName, NULL, NULL, DrvInputInfo, mbrushDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Crush Roller (Sidam bootleg) - -static struct BurnRomInfo crushsRomDesc[] = { - { "11105-0.0j", 0x1000, 0xdd425429, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "11105-1.1j", 0x1000, 0xf9d89eef, 1 | BRF_ESS | BRF_PRG }, // 1 - { "11105-2.2j", 0x1000, 0x40c23a27, 1 | BRF_ESS | BRF_PRG }, // 2 - { "11105-3.3j", 0x1000, 0x5802644f, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "11105-4.4j", 0x1000, 0x91bad2da, 2 | BRF_GRA }, // 4 Graphics - { "11105-5.5j", 0x1000, 0xb5c14376, 2 | BRF_GRA }, // 5 - - { "74s288.8a", 0x0020, 0xff344446, 3 | BRF_GRA }, // 6 Color Proms - { "24s10.6b", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 7 - - // uses AY8910 -}; - -STD_ROM_PICK(crushs) -STD_ROM_FN(crushs) - -static INT32 crushsInit() -{ - return DrvInit(StandardMap, NULL, CRUSHS); -} - -struct BurnDriver BurnDrvcrushs = { - "crushs", "crush", NULL, NULL, "19??", - "Crush Roller (Sidam bootleg)\0", NULL, "[Kural] (Sidam bootleg)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, crushsRomInfo, crushsRomName, NULL, NULL, DrvInputInfo, crushsDIPInfo, - crushsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Make Trax (set 1) - -static struct BurnRomInfo maketraxRomDesc[] = { - { "maketrax.6e", 0x1000, 0x0150fb4a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "maketrax.6f", 0x1000, 0x77531691, 1 | BRF_ESS | BRF_PRG }, // 1 - { "maketrax.6h", 0x1000, 0xa2cdc51e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "maketrax.6j", 0x1000, 0x0b4b5e0a, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "maketrax.5e", 0x1000, 0x91bad2da, 2 | BRF_GRA }, // 4 Graphics - { "maketrax.5f", 0x1000, 0xaea79f55, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(maketrax) -STD_ROM_FN(maketrax) - -static INT32 maketraxInit() -{ - return DrvInit(StandardMap, maketraxCallback, MAKETRAX); -} - -struct BurnDriver BurnDrvmaketrax = { - "maketrax", "crush", NULL, NULL, "1981", - "Make Trax (set 1)\0", NULL, "[Kural] (Williams license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, maketraxRomInfo, maketraxRomName, NULL, NULL, DrvInputInfo, maketraxDIPInfo, - maketraxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Make Trax (set 2) - -static struct BurnRomInfo maketrxbRomDesc[] = { - { "maketrax.6e", 0x1000, 0x0150fb4a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "maketrax.6f", 0x1000, 0x77531691, 1 | BRF_ESS | BRF_PRG }, // 1 - { "maketrxb.6h", 0x1000, 0x6ad342c9, 1 | BRF_ESS | BRF_PRG }, // 2 - { "maketrxb.6j", 0x1000, 0xbe27f729, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "maketrax.5e", 0x1000, 0x91bad2da, 2 | BRF_GRA }, // 4 Graphics - { "maketrax.5f", 0x1000, 0xaea79f55, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(maketrxb) -STD_ROM_FN(maketrxb) - -struct BurnDriver BurnDrvmaketrxb = { - "maketrxb", "crush", NULL, NULL, "1981", - "Make Trax (set 2)\0", NULL, "[Kural] (Williams license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, maketrxbRomInfo, maketrxbRomName, NULL, NULL, DrvInputInfo, maketraxDIPInfo, - maketraxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Magic Brush - -static struct BurnRomInfo mbrushRomDesc[] = { - { "mbrush.6e", 0x1000, 0x750fbff7, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "mbrush.6f", 0x1000, 0x27eb4299, 1 | BRF_ESS | BRF_PRG }, // 1 - { "mbrush.6h", 0x1000, 0xd297108e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "mbrush.6j", 0x1000, 0x6fd719d0, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "tpa", 0x0800, 0xc7617198, 2 | BRF_GRA }, // 4 Graphics - { "mbrush.5h", 0x0800, 0xc15b6967, 2 | BRF_GRA }, // 5 - { "mbrush.5f", 0x0800, 0xd5bc5cb8, 2 | BRF_GRA }, // 6 - { "tpd", 0x0800, 0xd35d1caf, 2 | BRF_GRA }, // 7 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 8 Color Proms - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(mbrush) -STD_ROM_FN(mbrush) - -static void mbrushCallback() -{ - DrvZ80ROM[0x3AE2] = 0x3E; - DrvZ80ROM[0x3AE3] = 0x00; - DrvZ80ROM[0x3AE4] = 0x00; -} - -static INT32 mbrushInit() -{ - return DrvInit(StandardMap, mbrushCallback, PACMAN); -} - -struct BurnDriver BurnDrvmbrush = { - "mbrush", "crush", NULL, NULL, "1981", - "Magic Brush\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mbrushRomInfo, mbrushRomName, NULL, NULL, DrvInputInfo, mbrushDIPInfo, - mbrushInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Korosuke Roller - -static struct BurnRomInfo korosukeRomDesc[] = { - { "kr.6e", 0x1000, 0x69f6e2da, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "kr.6f", 0x1000, 0xabf34d23, 1 | BRF_ESS | BRF_PRG }, // 1 - { "kr.6h", 0x1000, 0x76a2e2e2, 1 | BRF_ESS | BRF_PRG }, // 2 - { "kr.6j", 0x1000, 0x33e0e3bb, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "kr.5e", 0x1000, 0xe0380be8, 2 | BRF_GRA }, // 4 Graphics - { "kr.5f", 0x1000, 0x63fec9ee, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "2s140.4a", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(korosuke) -STD_ROM_FN(korosuke) - -static void korosukeCallback() -{ - DrvZ80ROM[0x0233] = 0x00; - DrvZ80ROM[0x0234] = 0x00; - DrvZ80ROM[0x0235] = 0x00; - DrvZ80ROM[0x023c] = 0x00; - DrvZ80ROM[0x023e] = 0x00; - DrvZ80ROM[0x024b] = 0x00; - DrvZ80ROM[0x024c] = 0x00; - DrvZ80ROM[0x024d] = 0x00; - DrvZ80ROM[0x044c] = 0xc9; - DrvZ80ROM[0x115B] = 0xC9; - DrvZ80ROM[0x1AE9] = 0x18; - DrvZ80ROM[0x1CA7] = 0xA7; - DrvZ80ROM[0x1CA8] = 0xC9; - DrvZ80ROM[0x238c] = 0xc9; - DrvZ80ROM[0x3AE9] = 0x3E; - DrvZ80ROM[0x3AEB] = 0xFE; - DrvZ80ROM[0x3AEC] = 0x3F; - DrvZ80ROM[0x3AEE] = 0xC9; - DrvZ80ROM[0x045d] = 0xC6; - DrvZ80ROM[0x045e] = 0x12; - DrvZ80ROM[0x1481] = 0x28; - DrvZ80ROM[0x1492] = 0x20; - DrvZ80ROM[0x14A5] = 0xC8; -} - -static INT32 korosukeInit() -{ - return DrvInit(StandardMap, korosukeCallback, MAKETRAX); -} - -struct BurnDriver BurnDrvkorosuke = { - "korosuke", "crush", NULL, NULL, "1981", - "Korosuke Roller\0", NULL, "Kural Electric", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, korosukeRomInfo, korosukeRomName, NULL, NULL, korosukeInputInfo, korosukeDIPInfo, - korosukeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Eyes (Digitrex Techstar) - -static struct BurnRomInfo eyesRomDesc[] = { - { "d7", 0x1000, 0x3b09ac89, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "e7", 0x1000, 0x97096855, 1 | BRF_ESS | BRF_PRG }, // 1 - { "f7", 0x1000, 0x731e294e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "h7", 0x1000, 0x22f7a719, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "d5", 0x1000, 0xd6af0030, 2 | BRF_GRA }, // 5 Graphics - { "e5", 0x1000, 0xa42b5201, 2 | BRF_GRA }, // 6 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 7 Color Proms - { "82s129.4a", 0x0100, 0xd8d78829, 3 | BRF_GRA }, // 8 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 9 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 10 Timing Prom (not used) -}; - -STD_ROM_PICK(eyes) -STD_ROM_FN(eyes) - -static INT32 eyesInit() -{ - return DrvInit(StandardMap, eyes_decode, PACMAN); -} - -struct BurnDriver BurnDrveyes = { - "eyes", NULL, NULL, NULL, "1982", - "Eyes (Digitrex Techstar)\0", NULL, "Digitrex Techstar (Rock-ola license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, eyesRomInfo, eyesRomName, NULL, NULL, eyesInputInfo, eyesDIPInfo, - eyesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Eyes (Techstar) - -static struct BurnRomInfo eyes2RomDesc[] = { - { "g38201.7d", 0x1000, 0x2cda7185, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "g38202.7e", 0x1000, 0xb9fe4f59, 1 | BRF_ESS | BRF_PRG }, // 1 - { "g38203.7f", 0x1000, 0xd618ba66, 1 | BRF_ESS | BRF_PRG }, // 2 - { "g38204.7h", 0x1000, 0xcf038276, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "g38205.5d", 0x1000, 0x03b1b4c7, 2 | BRF_GRA }, // 4 Graphics - { "g38206.5e", 0x1000, 0xa42b5201, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s129.4a", 0x0100, 0xd8d78829, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(eyes2) -STD_ROM_FN(eyes2) - -struct BurnDriver BurnDrveyes2 = { - "eyes2", "eyes", NULL, NULL, "1982", - "Eyes (Techstar)\0", NULL, "Techstar (Rock-ola license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, eyes2RomInfo, eyes2RomName, NULL, NULL, eyesInputInfo, eyesDIPInfo, - eyesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Eyes (bootleg set 1) - -static struct BurnRomInfo eyesbRomDesc[] = { - { "1.bin", 0x0800, 0x339d279a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "5.bin", 0x0800, 0x1b68a61d, 1 | BRF_ESS | BRF_PRG }, // 1 - { "2.bin", 0x0800, 0xd4f9aaf8, 1 | BRF_ESS | BRF_PRG }, // 2 - { "6.bin", 0x0800, 0x6b41bb80, 1 | BRF_ESS | BRF_PRG }, // 3 - { "3.bin", 0x0800, 0x748e0e48, 1 | BRF_ESS | BRF_PRG }, // 4 - { "7.bin", 0x0800, 0x7b7f4a74, 1 | BRF_ESS | BRF_PRG }, // 5 - { "4.bin", 0x0800, 0x367a3884, 1 | BRF_ESS | BRF_PRG }, // 6 - { "8.bin", 0x0800, 0x2baaadae, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "9.bin", 0x0800, 0x342c0653, 2 | BRF_GRA }, // 8 Graphics - { "11.bin", 0x0800, 0xaaa7a537, 2 | BRF_GRA }, // 9 - { "10.bin", 0x0800, 0xb247b82c, 2 | BRF_GRA }, // 10 - { "12.bin", 0x0800, 0x99af4b30, 2 | BRF_GRA }, // 11 - - { "7051.bin", 0x0020, 0x0dad2ccb, 3 | BRF_GRA }, // 12 Color Proms - { "7051-3.bin", 0x0100, 0xd8d78829, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "7051-2.bin", 0x0100, 0x77245b66, 4 | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(eyesb) -STD_ROM_FN(eyesb) - -struct BurnDriver BurnDrveyesb = { - "eyesb", "eyes", NULL, NULL, "1982", - "Eyes (bootleg set 1)\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, eyesbRomInfo, eyesbRomName, NULL, NULL, eyesInputInfo, eyesDIPInfo, - eyesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Eyes (bootleg set 2, decrypted) - -static struct BurnRomInfo eyeszacbRomDesc[] = { - { "zacb_1.bin", 0x0800, 0xa4a9d7a0, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "zacb_5.bin", 0x0800, 0xc32b3f73, 1 | BRF_ESS | BRF_PRG }, // 1 - { "zacb_2.bin", 0x0800, 0x195b9473, 1 | BRF_ESS | BRF_PRG }, // 2 - { "zacb_6.bin", 0x0800, 0x292886cb, 1 | BRF_ESS | BRF_PRG }, // 3 - { "zacb_3.bin", 0x0800, 0xff94b015, 1 | BRF_ESS | BRF_PRG }, // 4 - { "zacb_7.bin", 0x0800, 0x9271c58c, 1 | BRF_ESS | BRF_PRG }, // 5 - { "zacb_4.bin", 0x0800, 0x965cf32b, 1 | BRF_ESS | BRF_PRG }, // 6 - { "zacb_8.bin", 0x0800, 0xc254e92e, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "x.bin", 0x0800, 0x59dce22e, 2 | BRF_GRA }, // 8 Graphics - { "c.bin", 0x0800, 0xaaa7a537, 2 | BRF_GRA }, // 9 - { "b.bin", 0x0800, 0x1969792b, 2 | BRF_GRA }, // 10 - { "p.bin", 0x0800, 0x99af4b30, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s129.4a", 0x0100, 0xd8d78829, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) - - { "zacb_11.bin", 0x0800, 0x69c1602a, 0 | BRF_PRG }, // 16 (Not used) -}; - -STD_ROM_PICK(eyeszacb) -STD_ROM_FN(eyeszacb) - -struct BurnDriver BurnDrveyeszac = { - "eyeszacb", "eyes", NULL, NULL, "1982", - "Eyes (bootleg set 2, decrypted)\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, eyeszacbRomInfo, eyeszacbRomName, NULL, NULL, eyesInputInfo, eyesDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Mr. TNT - -static struct BurnRomInfo mrtntRomDesc[] = { - { "tnt.1", 0x1000, 0x0e836586, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "tnt.2", 0x1000, 0x779c4c5b, 1 | BRF_ESS | BRF_PRG }, // 1 - { "tnt.3", 0x1000, 0xad6fc688, 1 | BRF_ESS | BRF_PRG }, // 2 - { "tnt.4", 0x1000, 0xd77557b3, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "tnt.5", 0x1000, 0x3038cc0e, 2 | BRF_GRA }, // 4 Graphics - { "tnt.6", 0x1000, 0x97634d8b, 2 | BRF_GRA }, // 5 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 6 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 7 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 8 Timing Prom (not used) -}; - -STD_ROM_PICK(mrtnt) -STD_ROM_FN(mrtnt) - -struct BurnDriver BurnDrvmrtnt = { - "mrtnt", NULL, NULL, NULL, "1982", - "Mr. TNT\0", NULL, "Telko", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, mrtntRomInfo, mrtntRomName, NULL, NULL, eyesInputInfo, mrtntDIPInfo, - eyesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Gorkans - -static struct BurnRomInfo gorkansRomDesc[] = { - { "gorkans8.rom", 0x0800, 0x55100b18, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "gorkans4.rom", 0x0800, 0xb5c604bf, 1 | BRF_ESS | BRF_PRG }, // 1 - { "gorkans7.rom", 0x0800, 0xb8c6def4, 1 | BRF_ESS | BRF_PRG }, // 2 - { "gorkans3.rom", 0x0800, 0x4602c840, 1 | BRF_ESS | BRF_PRG }, // 3 - { "gorkans6.rom", 0x0800, 0x21412a62, 1 | BRF_ESS | BRF_PRG }, // 4 - { "gorkans2.rom", 0x0800, 0xa013310b, 1 | BRF_ESS | BRF_PRG }, // 5 - { "gorkans5.rom", 0x0800, 0x122969b2, 1 | BRF_ESS | BRF_PRG }, // 6 - { "gorkans1.rom", 0x0800, 0xf2524b11, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "gorkgfx4.rom", 0x0800, 0x39cd0dbc, 2 | BRF_GRA }, // 8 Graphics - { "gorkgfx2.rom", 0x0800, 0x33d52535, 2 | BRF_GRA }, // 9 - { "gorkgfx3.rom", 0x0800, 0x4b6b7970, 2 | BRF_GRA }, // 10 - { "gorkgfx1.rom", 0x0800, 0xed70bb3c, 2 | BRF_GRA }, // 11 - - { "gorkprom.4", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "gorkprom.1", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "gorkprom.3", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "gorkprom.2", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(gorkans) -STD_ROM_FN(gorkans) - -struct BurnDriver BurnDrvgorkans = { - "gorkans", "mrtnt", NULL, NULL, "1983", - "Gorkans\0", NULL, "Techstar", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, gorkansRomInfo, gorkansRomName, NULL, NULL, eyesInputInfo, mrtntDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Eggor - -static struct BurnRomInfo eggorRomDesc[] = { - { "1.bin", 0x0800, 0x818ed154, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "5.bin", 0x0800, 0xa4b21d93, 1 | BRF_ESS | BRF_PRG }, // 1 - { "2.bin", 0x0800, 0x5d7a23ed, 1 | BRF_ESS | BRF_PRG }, // 2 - { "6.bin", 0x0800, 0xe9dbca8d, 1 | BRF_ESS | BRF_PRG }, // 3 - { "3.bin", 0x0800, 0x4318ab85, 1 | BRF_ESS | BRF_PRG }, // 4 - { "7.bin", 0x0800, 0x03214d7f, 1 | BRF_ESS | BRF_PRG }, // 5 - { "4.bin", 0x0800, 0xdc805be4, 1 | BRF_ESS | BRF_PRG }, // 6 - { "8.bin", 0x0800, 0xf9ae204b, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "9.bin", 0x0800, 0x96ad8626, 2 | BRF_GRA }, // 8 Graphics - { "11.bin", 0x0800, 0xcc324017, 2 | BRF_GRA }, // 9 - { "10.bin", 0x0800, 0x7c97f513, 2 | BRF_GRA }, // 10 - { "12.bin", 0x0800, 0x2e930602, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(eggor) -STD_ROM_FN(eggor) - -struct BurnDriver BurnDrveggor = { - "eggor", NULL, NULL, NULL, "1982", - "Eggor\0", NULL, "Telko", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, eggorRomInfo, eggorRomName, NULL, NULL, eyesInputInfo, mrtntDIPInfo, - eyesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - - -// Piranha - -static struct BurnRomInfo piranhaRomDesc[] = { - { "pir1.bin", 0x0800, 0x69a3e6ea, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pir5.bin", 0x0800, 0x245e753f, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pir2.bin", 0x0800, 0x62cb6954, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pir6.bin", 0x0800, 0xcb0700bc, 1 | BRF_ESS | BRF_PRG }, // 3 - { "pir3.bin", 0x0800, 0x843fbfe5, 1 | BRF_ESS | BRF_PRG }, // 4 - { "pir7.bin", 0x0800, 0x73084d5e, 1 | BRF_ESS | BRF_PRG }, // 5 - { "pir4.bin", 0x0800, 0x4cdf6704, 1 | BRF_ESS | BRF_PRG }, // 6 - { "pir8.bin", 0x0800, 0xb86fedb3, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "pir9.bin", 0x0800, 0x0f19eb28, 2 | BRF_GRA }, // 8 Graphics - { "pir11.bin", 0x0800, 0x5f8bdabe, 2 | BRF_GRA }, // 9 - { "pir10.bin", 0x0800, 0xd19399fb, 2 | BRF_GRA }, // 10 - { "pir12.bin", 0x0800, 0xcfb4403d, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Prom - { "piranha.4a", 0x0100, 0x08c9447b, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(piranha) -STD_ROM_FN(piranha) - -static INT32 piranhaInit() -{ - return DrvInit(StandardMap, eyes_decode, PIRANHA); -} - -struct BurnDriver BurnDrvpiranha = { - "piranha", "puckman", NULL, NULL, "1981", - "Piranha\0", NULL, "GL (US Billiards License)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, piranhaRomInfo, piranhaRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - piranhaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Piranha (older) - -static struct BurnRomInfo piranhaoRomDesc[] = { - { "p1.bin", 0x0800, 0xc6ce1bfc, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "p5.bin", 0x0800, 0xa2655a33, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pir2.bin", 0x0800, 0x62cb6954, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pir6.bin", 0x0800, 0xcb0700bc, 1 | BRF_ESS | BRF_PRG }, // 3 - { "pir3.bin", 0x0800, 0x843fbfe5, 1 | BRF_ESS | BRF_PRG }, // 4 - { "pir7.bin", 0x0800, 0x73084d5e, 1 | BRF_ESS | BRF_PRG }, // 5 - { "p4.bin", 0x0800, 0x9363a4d1, 1 | BRF_ESS | BRF_PRG }, // 6 - { "p8.bin", 0x0800, 0x2769979c, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "p9.bin", 0x0800, 0x94eb7563, 2 | BRF_GRA }, // 8 Graphics - { "p11.bin", 0x0800, 0xa3606973, 2 | BRF_GRA }, // 9 - { "p10.bin", 0x0800, 0x84165a2c, 2 | BRF_GRA }, // 10 - { "p12.bin", 0x0800, 0x2699ba9e, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "piranha.4a", 0x0100, 0x08c9447b, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(piranhao) -STD_ROM_FN(piranhao) - -struct BurnDriver BurnDrvpiranhao = { - "piranhao", "puckman", NULL, NULL, "1981", - "Piranha (older)\0", NULL, "GL (US Billiards License)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, piranhaoRomInfo, piranhaoRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - piranhaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Piranha (hack) - -static struct BurnRomInfo piranhahRomDesc[] = { - { "pr1.cpu", 0x1000, 0xbc5ad024, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "pacman.6f", 0x1000, 0x1a6fb2d4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pr3.cpu", 0x1000, 0x473c379d, 1 | BRF_ESS | BRF_PRG }, // 2 - { "pr4.cpu", 0x1000, 0x63fbf895, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "pr5.cpu", 0x0800, 0x3fc4030c, 2 | BRF_GRA }, // 4 Graphics - { "pr7.cpu", 0x0800, 0x30b9a010, 2 | BRF_GRA }, // 5 - { "pr6.cpu", 0x0800, 0xf3e9c9d5, 2 | BRF_GRA }, // 6 - { "pr8.cpu", 0x0800, 0x133d720d, 2 | BRF_GRA }, // 7 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 8 Color Prom - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(piranhah) -STD_ROM_FN(piranhah) - -struct BurnDriver BurnDrvpiranhah = { - "piranhah", "puckman", NULL, NULL, "1981", - "Piranha (hack)\0", NULL, "hack", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, piranhahRomInfo, piranhahRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Abscam - -static struct BurnRomInfo abscamRomDesc[] = { - { "as0.bin", 0x0800, 0x0b102302, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "as4.bin", 0x0800, 0x3116a8ec, 1 | BRF_ESS | BRF_PRG }, // 1 - { "as1.bin", 0x0800, 0xbc0281e0, 1 | BRF_ESS | BRF_PRG }, // 2 - { "as5.bin", 0x0800, 0x428ee2e8, 1 | BRF_ESS | BRF_PRG }, // 3 - { "as2.bin", 0x0800, 0xe05d46ad, 1 | BRF_ESS | BRF_PRG }, // 4 - { "as6.bin", 0x0800, 0x3ae9a8cb, 1 | BRF_ESS | BRF_PRG }, // 5 - { "as3.bin", 0x0800, 0xb39eb940, 1 | BRF_ESS | BRF_PRG }, // 6 - { "as7.bin", 0x0800, 0x16cf1c67, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "as8.bin", 0x0800, 0x61daabe5, 2 | BRF_GRA }, // 8 Graphics - { "as10.bin", 0x0800, 0x81d50c98, 2 | BRF_GRA }, // 9 - { "as9.bin", 0x0800, 0xa3bd1613, 2 | BRF_GRA }, // 10 - { "as11.bin", 0x0800, 0x9d802b68, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "as4a.bin", 0x0100, 0x1605b324, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(abscam) -STD_ROM_FN(abscam) - -struct BurnDriver BurnDrvabscam = { - "abscam", "puckman", NULL, NULL, "1981", - "Abscam\0", NULL, "GL (US Billiards License)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, abscamRomInfo, abscamRomName, NULL, NULL, DrvInputInfo, mspacmanDIPInfo, - piranhaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Jump Shot - -static struct BurnRomInfo jumpshotRomDesc[] = { - { "6e", 0x1000, 0xf00def9a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "6f", 0x1000, 0xf70deae2, 1 | BRF_ESS | BRF_PRG }, // 1 - { "6h", 0x1000, 0x894d6f68, 1 | BRF_ESS | BRF_PRG }, // 2 - { "6j", 0x1000, 0xf15a108a, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "5e", 0x1000, 0xd9fa90f5, 2 | BRF_GRA }, // 4 Graphics - { "5f", 0x1000, 0x2ec711c1, 2 | BRF_GRA }, // 5 - - { "prom.7f", 0x0020, 0x872b42f3, 3 | BRF_GRA }, // 6 Color Prom - { "prom.4a", 0x0100, 0x0399f39f, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(jumpshot) -STD_ROM_FN(jumpshot) - -static UINT8 jumpshot_decrypt(INT32 addr, UINT8 e) -{ - static const UINT8 swap_xor_table[6][9] = { - { 7,6,5,4,3,2,1,0, 0x00 }, - { 7,6,3,4,5,2,1,0, 0x20 }, - { 5,0,4,3,7,1,2,6, 0xa4 }, - { 5,0,4,3,7,1,2,6, 0x8c }, - { 2,3,1,7,4,6,0,5, 0x6e }, - { 2,3,4,7,1,6,0,5, 0x4e } - }; - - static const INT32 picktable[32] = { - 0,2,4,4,4,2,0,2,2,0,2,4,4,2,0,2, - 5,3,5,1,5,3,5,3,1,5,1,5,5,3,5,3 - }; - - INT32 method = picktable[(addr & 0x001) | ((addr & 0x004) >> 1) | ((addr & 0x020) >> 3) | ((addr & 0x080) >> 4) |((addr & 0x200) >> 5)]; - - if ((addr & 0x800) == 0x800) - method ^= 1; - - const UINT8 *tbl = swap_xor_table[method]; - return BITSWAP08(e,tbl[0],tbl[1],tbl[2],tbl[3],tbl[4],tbl[5],tbl[6],tbl[7]) ^ tbl[8]; -} - -static void jumpshot_decode() -{ - for (INT32 i = 0; i < 0x4000; i++) { - DrvZ80ROM[i] = jumpshot_decrypt(i, DrvZ80ROM[i]); - } -} - -static INT32 jumpshotInit() -{ - return DrvInit(StandardMap, jumpshot_decode, JUMPSHOT); -} - -struct BurnDriver BurnDrvjumpshot = { - "jumpshot", NULL, NULL, NULL, "1985", - "Jump Shot\0", NULL, "Bally Midway", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_SPORTSMISC, 0, - NULL, jumpshotRomInfo, jumpshotRomName, NULL, NULL, jumpshotInputInfo, jumpshotDIPInfo, - jumpshotInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Jump Shot Engineering Sample - -static struct BurnRomInfo jumpshotpRomDesc[] = { - { "js6e.bin", 0x1000, 0xacc5e15e, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "js6f.bin", 0x1000, 0x62b48ba4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "js6h.bin", 0x1000, 0x7c9b5e30, 1 | BRF_ESS | BRF_PRG }, // 2 - { "js6j.bin", 0x1000, 0x9f0c39f6, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "5e", 0x1000, 0xd9fa90f5, 2 | BRF_GRA }, // 4 Graphics - { "5f", 0x1000, 0x2ec711c1, 2 | BRF_GRA }, // 5 - - { "prom.7f", 0x0020, 0x872b42f3, 3 | BRF_GRA }, // 6 Color Proms - { "prom.4a", 0x0100, 0x0399f39f, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(jumpshotp) -STD_ROM_FN(jumpshotp) - -struct BurnDriver BurnDrvjumpshotp = { - "jumpshotp", "jumpshot", NULL, NULL, "1985", - "Jump Shot Engineering Sample\0", NULL, "Bally Midway", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_SPORTSMISC, 0, - NULL, jumpshotpRomInfo, jumpshotpRomName, NULL, NULL, jumpshotInputInfo, jumpshtpDIPInfo, - jumpshotInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Shoot the Bull - -static struct BurnRomInfo shootbulRomDesc[] = { - { "sb6e.cpu", 0x1000, 0x25daa5e9, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "sb6f.cpu", 0x1000, 0x92144044, 1 | BRF_ESS | BRF_PRG }, // 1 - { "sb6h.cpu", 0x1000, 0x43b7f99d, 1 | BRF_ESS | BRF_PRG }, // 2 - { "sb6j.cpu", 0x1000, 0xbc4d3bbf, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "sb5e.cpu", 0x1000, 0x07c6c5aa, 2 | BRF_GRA }, // 4 Graphics - { "sb5f.cpu", 0x1000, 0xeaec6837, 2 | BRF_GRA }, // 5 - - { "7f.rom", 0x0020, 0xec578b98, 3 | BRF_GRA }, // 6 Color Proms - { "4a.rom", 0x0100, 0x81a6b30f, 3 | BRF_GRA }, // 7 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(shootbul) -STD_ROM_FN(shootbul) - -static INT32 shootbulInit() -{ - return DrvInit(StandardMap, jumpshot_decode, SHOOTBUL); -} - -struct BurnDriverD BurnDrvshootbul = { - "shootbul", NULL, NULL, NULL, "1985", - "Shoot the Bull\0", "Analog inputs not hooked up", "Bally Midway", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_SPORTSMISC, 0, - NULL, shootbulRomInfo, shootbulRomName, NULL, NULL, shootbulInputInfo, shootbulDIPInfo, - shootbulInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Cannon Ball (Pacman Hardware) - -static struct BurnRomInfo cannonbpRomDesc[] = { - { "n1-6e", 0x0800, 0xc68878c7, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "n2-6k", 0x0800, 0xff3951a5, 1 | BRF_ESS | BRF_PRG }, // 1 - { "n3-6f", 0x0800, 0x2329079d, 1 | BRF_ESS | BRF_PRG }, // 2 - { "n4-6m", 0x0800, 0xfcc57ecb, 1 | BRF_ESS | BRF_PRG }, // 3 - { "n5-6h", 0x0800, 0x52846c9d, 1 | BRF_ESS | BRF_PRG }, // 4 - { "n6-6n", 0x0800, 0x59e890dd, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "z1-5e", 0x0800, 0x125779e0, 2 | BRF_GRA }, // 6 Graphics - { "z3-5h", 0x0800, 0x78f866c0, 2 | BRF_GRA }, // 7 - { "z2-5f", 0x0800, 0xfbd2c99d, 2 | BRF_GRA }, // 8 - { "z4-5j", 0x0800, 0x8734c904, 2 | BRF_GRA }, // 9 - - { "colorprom_1", 0x0020, 0x08f8ae7e, 3 | BRF_GRA }, // 10 Color Proms - { "colorprom_2", 0x0100, 0x359a15dc, 3 | BRF_GRA }, // 11 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 12 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom (not used) -}; - -STD_ROM_PICK(cannonbp) -STD_ROM_FN(cannonbp) - -static INT32 cannonbpInit() -{ - return DrvInit(CannonbpMap, NULL, CANNONBP); -} - -struct BurnDriver BurnDrvcannonbp = { - "cannonbp", NULL, NULL, NULL, "198?", - "Cannon Ball (Pacman Hardware)\0", "wrong colors", "Novomatic", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_BREAKOUT, 0, - NULL, cannonbpRomInfo, cannonbpRomName, NULL, NULL, cannonbpInputInfo, cannonbpDIPInfo, - cannonbpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Woodpecker (set 1) - -static struct BurnRomInfo woodpeckRomDesc[] = { - { "f.bin", 0x1000, 0x37ea66ca, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "i.bin", 0x1000, 0xcd115dba, 1 | BRF_ESS | BRF_PRG }, // 1 - { "e.bin", 0x1000, 0xd40b2321, 1 | BRF_ESS | BRF_PRG }, // 2 - { "g.bin", 0x1000, 0x024092f4, 1 | BRF_ESS | BRF_PRG }, // 3 - { "h.bin", 0x1000, 0x18ef0fc8, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "a.5e", 0x0800, 0x15a87f62, 2 | BRF_GRA }, // 5 Graphics - { "c.5h", 0x0800, 0xab4abd88, 2 | BRF_GRA }, // 6 - { "b.5f", 0x0800, 0x5b9ba95b, 2 | BRF_GRA }, // 7 - { "d.5j", 0x0800, 0xd7b80a45, 2 | BRF_GRA }, // 8 - - { "pr.8h", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 9 Color Prom - { "pr.4a", 0x0100, 0xd8772167, 3 | BRF_GRA }, // 10 - - { "pr.1k", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 11 Sound Prom - { "pr.3k", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 12 Timing Prom (not used) -}; - -STD_ROM_PICK(woodpeck) -STD_ROM_FN(woodpeck) - -static void woodpeckCallback() -{ - memcpy (DrvZ80ROM + 0xb000, DrvZ80ROM + 0x8000, 0x1000); - memcpy (DrvZ80ROM + 0x8000, DrvZ80ROM + 0x1000, 0x3000); - - memset (DrvZ80ROM + 0x1000, 0, 0x3000); - - for (INT32 i = 0; i < 0x2000; i += 8) - eyes_gfx_decode(DrvGfxROM + i); -} - -static INT32 woodpeckInit() -{ - return DrvInit(WoodpekMap, woodpeckCallback, PACMAN); -} - -struct BurnDriver BurnDrvwoodpeck = { - "woodpeck", NULL, NULL, NULL, "1981", - "Woodpecker (set 1)\0", NULL, "Amenip (Palcom Queen River)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, woodpeckRomInfo, woodpeckRomName, NULL, NULL, woodpekInputInfo, woodpekDIPInfo, - woodpeckInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Woodpecker (set 2) - -static struct BurnRomInfo woodpekaRomDesc[] = { - { "0", 0x1000, 0xb5ee8bca, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "1", 0x1000, 0xc5ec2de6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2", 0x1000, 0x07ea534e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3", 0x1000, 0xa3a3253a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "4", 0x1000, 0x6c50546b, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "10.5f", 0x1000, 0x0bf52102, 2 | BRF_GRA }, // 5 Graphics - { "11.5h", 0x1000, 0x0ed8def8, 2 | BRF_GRA }, // 6 - - { "pr.8h", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 7 Color Proms - { "pr.4a", 0x0100, 0xd8772167, 3 | BRF_GRA }, // 8 - - { "pr.1k", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 9 - { "pr.3k", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 10 Timing Prom (not used) -}; - -STD_ROM_PICK(woodpeka) -STD_ROM_FN(woodpeka) - -struct BurnDriver BurnDrvwoodpeka = { - "woodpeca", "woodpeck", NULL, NULL, "1981", - "Woodpecker (set 2)\0", NULL, "Amenip (Palcom Queen River)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, woodpekaRomInfo, woodpekaRomName, NULL, NULL, woodpekInputInfo, woodpekDIPInfo, - woodpeckInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Lizard Wizard - -static struct BurnRomInfo lizwizRomDesc[] = { - { "6e.cpu", 0x1000, 0x32bc1990, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "6f.cpu", 0x1000, 0xef24b414, 1 | BRF_ESS | BRF_PRG }, // 1 - { "6h.cpu", 0x1000, 0x30bed83d, 1 | BRF_ESS | BRF_PRG }, // 2 - { "6j.cpu", 0x1000, 0xdd09baeb, 1 | BRF_ESS | BRF_PRG }, // 3 - { "wiza", 0x1000, 0xf6dea3a6, 1 | BRF_ESS | BRF_PRG }, // 4 - { "wizb", 0x1000, 0xf27fb5a8, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "5e.cpu", 0x1000, 0x45059e73, 2 | BRF_GRA }, // 6 Graphics - { "5f.cpu", 0x1000, 0xd2469717, 2 | BRF_GRA }, // 7 - - { "7f.cpu", 0x0020, 0x7549a947, 3 | BRF_GRA }, // 8 Color Proms - { "4a.cpu", 0x0100, 0x5fdca536, 3 | BRF_GRA }, // 9 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 10 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom (not used) -}; - -STD_ROM_PICK(lizwiz) -STD_ROM_FN(lizwiz) - -static INT32 lizwizInit() -{ - return DrvInit(WoodpekMap, NULL, PACMAN); -} - -struct BurnDriver BurnDrvlizwiz = { - "lizwiz", NULL, NULL, NULL, "1985", - "Lizard Wizard\0", NULL, "Techstar (Sunn license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_SHOOT, 0, - NULL, lizwizRomInfo, lizwizRomName, NULL, NULL, lizwizInputInfo, lizwizDIPInfo, - lizwizInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ponpoko - -static struct BurnRomInfo ponpokoRomDesc[] = { - { "ppokoj1.bin", 0x1000, 0xffa3c004, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ppokoj2.bin", 0x1000, 0x4a496866, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ppokoj3.bin", 0x1000, 0x17da6ca3, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ppokoj4.bin", 0x1000, 0x9d39a565, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ppoko5.bin", 0x1000, 0x54ca3d7d, 1 | BRF_ESS | BRF_PRG }, // 4 - { "ppoko6.bin", 0x1000, 0x3055c7e0, 1 | BRF_ESS | BRF_PRG }, // 5 - { "ppoko7.bin", 0x1000, 0x3cbe47ca, 1 | BRF_ESS | BRF_PRG }, // 6 - { "ppokoj8.bin", 0x1000, 0x04b63fc6, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "ppoko9.bin", 0x1000, 0xb73e1a06, 2 | BRF_GRA }, // 8 Graphics - { "ppoko10.bin", 0x1000, 0x62069b5d, 2 | BRF_GRA }, // 9 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 10 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 11 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 12 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom (not used) -}; - -STD_ROM_PICK(ponpoko) -STD_ROM_FN(ponpoko) - -static void ponpoko_decode() -{ - for (INT32 i = 0; i < 0x1000; i += 0x10) // Characters - { - for (INT32 j = 0; j < 8; j++) - { - INT32 t = DrvGfxROM[i+j+0x08]; - DrvGfxROM[i+j+0x08] = DrvGfxROM[i+j+0x00]; - DrvGfxROM[i+j+0x00] = t; - } - } - - for (INT32 i = 0x1000; i < 0x2000; i += 0x20) // Sprites - { - for (INT32 j = 0; j < 8; j++) - { - INT32 t = DrvGfxROM[i+j+0x18]; - DrvGfxROM[i+j+0x18] = DrvGfxROM[i+j+0x10]; - DrvGfxROM[i+j+0x10] = DrvGfxROM[i+j+0x08]; - DrvGfxROM[i+j+0x08] = DrvGfxROM[i+j+0x00]; - DrvGfxROM[i+j+0x00] = t; - } - } -} - -static INT32 ponpokoInit() -{ - return DrvInit(WoodpekMap, ponpoko_decode, PACMAN); -} - -struct BurnDriver BurnDrvponpoko = { - "ponpoko", NULL, NULL, NULL, "1982", - "Ponpoko\0", NULL, "Sigma Enterprises Inc.", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, ponpokoRomInfo, ponpokoRomName, NULL, NULL, ponpokoInputInfo, ponpokoDIPInfo, - ponpokoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; - - -// Candory (Bootleg) - -static struct BurnRomInfo CandoryRomDesc[] = { - { "ppokoj1.bin", 0x1000, 0xffa3c004, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ppokoj2.bin", 0x1000, 0x4a496866, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ppokoj3.bin", 0x1000, 0x17da6ca3, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ppokoj4.bin", 0x1000, 0x9d39a565, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ppoko5.bin", 0x1000, 0x54ca3d7d, 1 | BRF_ESS | BRF_PRG }, // 4 - { "ppoko6.bin", 0x1000, 0x3055c7e0, 1 | BRF_ESS | BRF_PRG }, // 5 - { "ppoko7.bin", 0x1000, 0x3cbe47ca, 1 | BRF_ESS | BRF_PRG }, // 6 - { "ppokoj8.bin", 0x1000, 0x04b63fc6, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "candory.v2", 0x1000, 0x7d16bdff, 2 | BRF_GRA }, // 8 Graphics - { "candory.v1", 0x1000, 0xe08ac188, 2 | BRF_GRA }, // 9 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 10 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 11 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 12 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom (not used) -}; - -STD_ROM_PICK(Candory) -STD_ROM_FN(Candory) - -struct BurnDriver BurnDrvCandory = { - "candory", "ponpoko", NULL, NULL, "1982", - "Candory (Bootleg)\0", NULL, "Bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, CandoryRomInfo, CandoryRomName, NULL, NULL, ponpokoInputInfo, ponpokoDIPInfo, - ponpokoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; - - -// Ponpoko (Venture Line) - -static struct BurnRomInfo ponpokovRomDesc[] = { - { "ppoko1.bin", 0x1000, 0x49077667, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ppoko2.bin", 0x1000, 0x5101781a, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ppoko3.bin", 0x1000, 0xd790ed22, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ppoko4.bin", 0x1000, 0x4e449069, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ppoko5.bin", 0x1000, 0x54ca3d7d, 1 | BRF_ESS | BRF_PRG }, // 4 - { "ppoko6.bin", 0x1000, 0x3055c7e0, 1 | BRF_ESS | BRF_PRG }, // 5 - { "ppoko7.bin", 0x1000, 0x3cbe47ca, 1 | BRF_ESS | BRF_PRG }, // 6 - { "ppoko8.bin", 0x1000, 0xb39be27d, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "ppoko9.bin", 0x1000, 0xb73e1a06, 2 | BRF_GRA }, // 8 Graphics - { "ppoko10.bin", 0x1000, 0x62069b5d, 2 | BRF_GRA }, // 9 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 10 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 11 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 12 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom (not used) -}; - -STD_ROM_PICK(ponpokov) -STD_ROM_FN(ponpokov) - -struct BurnDriver BurnDrvponpokov = { - "ponpokov", "ponpoko", NULL, NULL, "1982", - "Ponpoko (Venture Line)\0", NULL, "Sigma Enterprises Inc. (Venture Line license)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, ponpokovRomInfo, ponpokovRomName, NULL, NULL, ponpokoInputInfo, ponpokoDIPInfo, - ponpokoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 288, 224, 4, 3 -}; - - -// The Glob (Pac-Man hardware) - -static struct BurnRomInfo theglobpRomDesc[] = { - { "glob.u2", 0x2000, 0x829d0bea, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "glob.u3", 0x2000, 0x31de6628, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "glob.5e", 0x1000, 0x53688260, 2 | BRF_GRA }, // 2 Graphics - { "glob.5f", 0x1000, 0x051f59c7, 2 | BRF_GRA }, // 3 - - { "glob.7f", 0x0020, 0x1f617527, 3 | BRF_GRA }, // 4 Color Proms - { "glob.4a", 0x0100, 0x28faa769, 3 | BRF_GRA }, // 5 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 6 Sound Prom - { "82s126.3m" , 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 7 Timing Prom (not used) -}; - -STD_ROM_PICK(theglobp) -STD_ROM_FN(theglobp) - -static void theglobp_decrypt() -{ - for (INT32 i = 0; i < 0x4000; i++) { - DrvZ80ROM[0x10000 + i] = BITSWAP08(DrvZ80ROM[i] ^ 0xfc, 3, 7, 0, 6, 4, 1, 2, 5); - DrvZ80ROM[0x14000 + i] = BITSWAP08(DrvZ80ROM[i] ^ 0xf6, 1, 7, 0, 3, 4, 6, 2, 5); - DrvZ80ROM[0x18000 + i] = BITSWAP08(DrvZ80ROM[i] ^ 0x7d, 3, 0, 4, 6, 7, 1, 2, 5); - DrvZ80ROM[0x1c000 + i] = BITSWAP08(DrvZ80ROM[i] ^ 0x77, 1, 0, 4, 3, 7, 6, 2, 5); - } -} - -static INT32 theglobpInit() -{ - return DrvInit(StandardMap, theglobp_decrypt, EPOS); -} - -struct BurnDriver BurnDrvtheglobp = { - "theglobp", "suprglob", NULL, NULL, "1983", - "The Glob (Pac-Man hardware)\0", NULL, "Epos Corporation", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, theglobpRomInfo, theglobpRomName, NULL, NULL, theglobpInputInfo, theglobpDIPInfo, - theglobpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Super Glob (Pac-Man hardware) - -static struct BurnRomInfo sprglobpRomDesc[] = { - { "glob.u2", 0x2000, 0x829d0bea, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "glob.u3", 0x2000, 0x31de6628, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5e_2532.dat", 0x1000, 0x1aa16109, 2 | BRF_GRA }, // 2 Graphics - { "5f_2532.dat", 0x1000, 0xafe72a89, 2 | BRF_GRA }, // 3 - - { "glob.7f", 0x0020, 0x1f617527, 3 | BRF_GRA }, // 4 Color Prom - { "glob.4a", 0x0100, 0x28faa769, 3 | BRF_GRA }, // 5 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 6 Sound Prom - { "82s126.3m" , 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 7 Timing Prom (not used) -}; - -STD_ROM_PICK(sprglobp) -STD_ROM_FN(sprglobp) - -struct BurnDriver BurnDrvsprglobp = { - "sprglobp", "suprglob", NULL, NULL, "1983", - "Super Glob (Pac-Man hardware)\0", NULL, "Epos Corporation", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, sprglobpRomInfo, sprglobpRomName, NULL, NULL, theglobpInputInfo, theglobpDIPInfo, - theglobpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Super Glob (Pac-Man hardware) German - -static struct BurnRomInfo sprglbpgRomDesc[] = { - { "ic8.1", 0x1000, 0xa2df2073, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ic7.2", 0x1000, 0x3d2c22d9, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ic15.3", 0x1000, 0xa252047f, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ic14.4", 0x1000, 0x7efa81f1, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "ic92.5", 0x2000, 0xE54F484D, 2 | BRF_GRA }, // 4 Graphics - - { "ic78.prm", 0x0020, 0x1f617527, 3 | BRF_GRA }, // 5 Color Prom - { "ic88.prm", 0x0100, 0x28faa769, 3 | BRF_GRA }, // 6 - - { "ic51.prm", 0x0100, 0xc29dea27, 4 | BRF_SND }, // 7 Sound Prom - { "ic70.prm" , 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 8 Timing Prom (not used) -}; - -STD_ROM_PICK(sprglbpg) -STD_ROM_FN(sprglbpg) - -struct BurnDriver BurnDrvsprglbpg = { - "sprglbpg", "suprglob", NULL, NULL, "1983", - "Super Glob (Pac-Man hardware) German\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, sprglbpgRomInfo, sprglbpgRomName, NULL, NULL, theglobpInputInfo, theglobpDIPInfo, - puckmanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Beastie Feastie - -static struct BurnRomInfo beastfpRomDesc[] = { - { "bf-u2.bin", 0x2000, 0x3afc517b, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "bf-u3.bin", 0x2000, 0x8dbd76d0, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "beastf.5e", 0x1000, 0x5654dc34, 2 | BRF_GRA }, // 2 Graphics - { "beastf.5f", 0x1000, 0x1b30ca61, 2 | BRF_GRA }, // 3 - - { "glob.7f", 0x0020, 0x1f617527, 3 | BRF_GRA }, // 4 Color Proms - { "glob.4a", 0x0100, 0x28faa769, 3 | BRF_GRA }, // 5 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 6 Sound Prom - { "82s126.3m" , 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 7 Timing Prom (not used) - - { "beastf.ic4", 0x002c, 0xa6ab926d, 0 | BRF_OPT }, // 8 PAL -}; - -STD_ROM_PICK(beastfp) -STD_ROM_FN(beastfp) - -struct BurnDriver BurnDrvbeastfp = { - "beastfp", "suprglob", NULL, NULL, "1984", - "Beastie Feastie\0", NULL, "Epos Corporation", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, beastfpRomInfo, beastfpRomName, NULL, NULL, theglobpInputInfo, theglobpDIPInfo, - theglobpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Eeekk! - -static struct BurnRomInfo eeekkRomDesc[] = { - { "u_2_eeekk_pg03094.u2", 0x2000, 0x701e37f2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "u_3_eeekk_pg03094.u3", 0x2000, 0xbcf524ae, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "5_e_eeekk_pg03094.5e", 0x1000, 0x780183a8, 2 | BRF_GRA }, // 2 Graphics - { "5_f_eeekk_pg03094.5f", 0x1000, 0x418526e4, 2 | BRF_GRA }, // 3 - - { "7_f_eeekk.7f", 0x0020, 0xc64c8a53, 3 | BRF_GRA }, // 4 Color Proms - { "4_a_eeekk.4a", 0x0100, 0xa5044ded, 3 | BRF_GRA }, // 5 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 6 Sound Prom - - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_OPT }, // 7 Timing Prom (not used) - - { "eeekk.ic4", 0x002c, 0xf588ba4e, 0 | BRF_OPT }, // 4 epos_pal10h8 -}; - -STD_ROM_PICK(eeekk) -STD_ROM_FN(eeekk) - -static void eeekk_decrypt() -{ - for (INT32 i = 0; i < 0x4000; i++) { - DrvZ80ROM[0x10000 + i] = BITSWAP08(DrvZ80ROM[i] ^ 0xfd, 7, 6, 1, 3, 0, 4, 2, 5); - DrvZ80ROM[0x14000 + i] = BITSWAP08(DrvZ80ROM[i] ^ 0xbf, 7, 1, 4, 3, 0, 6, 2, 5); - DrvZ80ROM[0x18000 + i] = BITSWAP08(DrvZ80ROM[i] ^ 0x75, 7, 6, 1, 0, 3, 4, 2, 5); - DrvZ80ROM[0x1c000 + i] = BITSWAP08(DrvZ80ROM[i] ^ 0x37, 7, 1, 4, 0, 3, 6, 2, 5); - } -} - -static INT32 eeekkInit() -{ - return DrvInit(StandardMap, eeekk_decrypt, EPOS); -} - -struct BurnDriver BurnDrvEeekk = { - "eeekk", NULL, NULL, NULL, "1984", - "Eeekk!\0", NULL, "Epos Corporation", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, eeekkRomInfo, eeekkRomName, NULL, NULL, EeekkInputInfo, EeekkDIPInfo, - eeekkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Van-Van Car - -static struct BurnRomInfo vanvanRomDesc[] = { - { "van-1.50", 0x1000, 0xcf1b2df0, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "van-2.51", 0x1000, 0xdf58e1cb, 1 | BRF_ESS | BRF_PRG }, // 1 - { "van-3.52", 0x1000, 0x15571e24, 1 | BRF_ESS | BRF_PRG }, // 2 - { "van-4.53", 0x1000, 0xb724cbe0, 1 | BRF_ESS | BRF_PRG }, // 3 - { "van-5.39", 0x1000, 0xdb67414c, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "van-20.18", 0x1000, 0x60efbe66, 2 | BRF_GRA }, // 5 Graphics - { "van-21.19", 0x1000, 0x5dd53723, 2 | BRF_GRA }, // 6 - - { "6331-1.6", 0x0020, 0xce1d9503, 3 | BRF_GRA }, // 7 Color Proms - { "6301-1.37", 0x0100, 0x4b803d9f, 3 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(vanvan) -STD_ROM_FN(vanvan) - -static void vanvanCallback() -{ - memcpy (DrvZ80ROM + 0x9000, DrvZ80ROM + 0x8000, 0x1000); - memcpy (DrvZ80ROM + 0xa000, DrvZ80ROM + 0x8000, 0x1000); - memcpy (DrvZ80ROM + 0xb000, DrvZ80ROM + 0x8000, 0x1000); -} - -static INT32 vanvanInit() -{ - return DrvInit(DremshprMap, vanvanCallback, VANVAN); -} - -struct BurnDriver BurnDrvvanvan = { - "vanvan", NULL, NULL, NULL, "1983", - "Van-Van Car\0", NULL, "Sanritsu", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, vanvanRomInfo, vanvanRomName, NULL, NULL, vanvanInputInfo, vanvanDIPInfo, - vanvanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Van-Van Car (Karateco) - -static struct BurnRomInfo vanvankRomDesc[] = { - { "van1.bin", 0x1000, 0x00f48295, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "van-2.51", 0x1000, 0xdf58e1cb, 1 | BRF_ESS | BRF_PRG }, // 1 - { "van-3.52", 0x1000, 0x15571e24, 1 | BRF_ESS | BRF_PRG }, // 2 - { "van4.bin", 0x1000, 0xf8b37ed5, 1 | BRF_ESS | BRF_PRG }, // 3 - { "van5.bin", 0x1000, 0xb8c1e089, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "van-20.18", 0x1000, 0x60efbe66, 2 | BRF_GRA }, // 5 Graphics - { "van-21.19", 0x1000, 0x5dd53723, 2 | BRF_GRA }, // 6 - - { "6331-1.6", 0x0020, 0xce1d9503, 3 | BRF_GRA }, // 7 Color Proms - { "6301-1.37", 0x0100, 0x4b803d9f, 3 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(vanvank) -STD_ROM_FN(vanvank) - -struct BurnDriver BurnDrvvanvank = { - "vanvank", "vanvan", NULL, NULL, "1983", - "Van-Van Car (Karateco)\0", NULL, "Karateco", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, vanvankRomInfo, vanvankRomName, NULL, NULL, vanvankInputInfo, vanvanDIPInfo, - vanvanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Van-Van Car (set 3) - -static struct BurnRomInfo vanvanbRomDesc[] = { - { "vv1.bin", 0x1000, 0xcf1b2df0, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "vv2.bin", 0x1000, 0x80eca6a5, 1 | BRF_ESS | BRF_PRG }, // 1 - { "vv3.bin", 0x1000, 0x15571e24, 1 | BRF_ESS | BRF_PRG }, // 2 - { "vv4.bin", 0x1000, 0xb1f04006, 1 | BRF_ESS | BRF_PRG }, // 3 - { "vv5.bin", 0x1000, 0xdb67414c, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "vv20.bin", 0x1000, 0xeb56cb51, 2 | BRF_GRA }, // 5 Graphics - { "vv21.bin", 0x1000, 0x5dd53723, 2 | BRF_GRA }, // 6 - - { "6331-1.6", 0x0020, 0xce1d9503, 3 | BRF_GRA }, // 7 Color Proms - { "6301-1.37", 0x0100, 0x4b803d9f, 3 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(vanvanb) -STD_ROM_FN(vanvanb) - -struct BurnDriver BurnDrvvanvanb = { - "vanvanb", "vanvan", NULL, NULL, "1983", - "Van-Van Car (set 3)\0", NULL, "Karateco", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, vanvanbRomInfo, vanvanbRomName, NULL, NULL, vanvankInputInfo, vanvanDIPInfo, - vanvanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Naughty Mouse (set 1) - -static struct BurnRomInfo nmouseRomDesc[] = { - { "naumouse.d7", 0x0800, 0xe447ecfa, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "naumouse.d6", 0x0800, 0x2e6f13d9, 1 | BRF_ESS | BRF_PRG }, // 1 - { "naumouse.e7", 0x0800, 0x44a80f97, 1 | BRF_ESS | BRF_PRG }, // 2 - { "naumouse.e6", 0x0800, 0x9c7a46bd, 1 | BRF_ESS | BRF_PRG }, // 3 - { "naumouse.h7", 0x0800, 0x5bc94c5d, 1 | BRF_ESS | BRF_PRG }, // 4 - { "naumouse.h6", 0x0800, 0x1af29e22, 1 | BRF_ESS | BRF_PRG }, // 5 - { "naumouse.j7", 0x0800, 0xcc3be185, 1 | BRF_ESS | BRF_PRG }, // 6 - { "naumouse.j6", 0x0800, 0x66b3e5dc, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "naumouse.d5", 0x0800, 0x2ea7cc3f, 2 | BRF_GRA }, // 8 Graphics - { "naumouse.h5", 0x0800, 0x0511fcea, 2 | BRF_GRA }, // 9 - { "naumouse.e5", 0x0800, 0xf5a627cd, 2 | BRF_GRA }, // 10 - { "naumouse.j5", 0x0800, 0x65f2580e, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "naumouse.a4", 0x0100, 0xd8772167, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(nmouse) -STD_ROM_FN(nmouse) - -static INT32 nmouseInit() -{ - return DrvInit(StandardMap, eyes_decode, NMOUSE); -} - -struct BurnDriver BurnDrvnmouse = { - "nmouse", NULL, NULL, NULL, "1981", - "Naughty Mouse (set 1)\0", NULL, "Amenip (Palcom Queen River)", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, nmouseRomInfo, nmouseRomName, NULL, NULL, DrvInputInfo, nmouseDIPInfo, - nmouseInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Naughty Mouse (set 2) - -static struct BurnRomInfo nmousebRomDesc[] = { - { "naumouse.d7", 0x0800, 0xe447ecfa, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "naumouse.d6", 0x0800, 0x2e6f13d9, 1 | BRF_ESS | BRF_PRG }, // 1 - { "naumouse.e7", 0x0800, 0x44a80f97, 1 | BRF_ESS | BRF_PRG }, // 2 - { "naumouse.e6", 0x0800, 0x9c7a46bd, 1 | BRF_ESS | BRF_PRG }, // 3 - { "snatch2.bin", 0x0800, 0x405aa389, 1 | BRF_ESS | BRF_PRG }, // 4 - { "snatch6.bin", 0x0800, 0xf58e7df4, 1 | BRF_ESS | BRF_PRG }, // 5 - { "snatch3.bin", 0x0800, 0x06fb18ec, 1 | BRF_ESS | BRF_PRG }, // 6 - { "snatch7.bin", 0x0800, 0xd187b82b, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "naumouse.d5", 0x0800, 0x2ea7cc3f, 2 | BRF_GRA }, // 8 Graphics - { "naumouse.h5", 0x0800, 0x0511fcea, 2 | BRF_GRA }, // 9 - { "naumouse.e5", 0x0800, 0xf5a627cd, 2 | BRF_GRA }, // 10 - { "snatch11.bin", 0x0800, 0x330230a5, 2 | BRF_GRA }, // 11 - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 12 Color Proms - { "naumouse.a4", 0x0100, 0xd8772167, 3 | BRF_GRA }, // 13 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 14 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 15 Timing Prom (not used) -}; - -STD_ROM_PICK(nmouseb) -STD_ROM_FN(nmouseb) - -struct BurnDriver BurnDrvnmouseb = { - "nmouseb", "nmouse", NULL, NULL, "1981", - "Naughty Mouse (set 2)\0", NULL, "Amenip Nova Games Ltd.", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_PLATFORM, 0, - NULL, nmousebRomInfo, nmousebRomName, NULL, NULL, DrvInputInfo, nmouseDIPInfo, - nmouseInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Dream Shopper - -static struct BurnRomInfo dremshprRomDesc[] = { - { "red_1.50", 0x1000, 0x830c6361, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "red_2.51", 0x1000, 0xd22551cc, 1 | BRF_ESS | BRF_PRG }, // 1 - { "red_3.52", 0x1000, 0x0713a34a, 1 | BRF_ESS | BRF_PRG }, // 2 - { "red_4.53", 0x1000, 0xf38bcaaa, 1 | BRF_ESS | BRF_PRG }, // 3 - { "red_5.39", 0x1000, 0x6a382267, 1 | BRF_ESS | BRF_PRG }, // 4 - { "red_6.40", 0x1000, 0x4cf8b121, 1 | BRF_ESS | BRF_PRG }, // 5 - { "red_7.41", 0x1000, 0xbd4fc4ba, 1 | BRF_ESS | BRF_PRG }, // 6 - - { "red-20.18", 0x1000, 0x2d6698dc, 2 | BRF_GRA }, // 7 Graphics - { "red-21.19", 0x1000, 0x38c9ce9b, 2 | BRF_GRA }, // 8 - - { "6331-1.6", 0x0020, 0xce1d9503, 3 | BRF_GRA }, // 9 Color Proms - { "6301-1.37", 0x0100, 0x39d6fb5c, 3 | BRF_GRA }, // 10 - - // Uses AY8910 -}; - -STD_ROM_PICK(dremshpr) -STD_ROM_FN(dremshpr) - -static INT32 dremshprInit() -{ - return DrvInit(DremshprMap, NULL, DREMSHPR); -} - -struct BurnDriver BurnDrvdremshpr = { - "dremshpr", NULL, NULL, NULL, "1982", - "Dream Shopper\0", NULL, "Sanritsu", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PACMAN, GBF_PUZZLE, 0, - NULL, dremshprRomInfo, dremshprRomName, NULL, NULL, dremshprInputInfo, dremshprDIPInfo, - dremshprInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Boardwalk Casino - -static struct BurnRomInfo bwcasinoRomDesc[] = { - { "bwc_u2.bin", 0x2000, 0xe2eea868, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "bwc_u3.bin", 0x2000, 0xa935571e, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "bwc_5e.bin", 0x1000, 0xe334c01e, 2 | BRF_GRA }, // 2 Graphics - - { "aca_7f.bin", 0x0020, 0x133bb744, 3 | BRF_GRA }, // 3 Color Proms - { "aca_4a.bin", 0x0100, 0x8e29208f, 3 | BRF_GRA }, // 4 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 5 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 6 Timing Prom (not used) -}; - -STD_ROM_PICK(bwcasino) -STD_ROM_FN(bwcasino) - -static void acitya_decode() -{ - for (INT32 i = 0; i < 0x4000; i++) { - DrvZ80ROM[i + 0x10000] = BITSWAP08(DrvZ80ROM[i] ^ 0xb5, 1, 6, 7, 3, 4, 0, 2, 5); - DrvZ80ROM[i + 0x14000] = BITSWAP08(DrvZ80ROM[i] ^ 0xa7, 7, 6, 1, 3, 4, 0, 2, 5); - DrvZ80ROM[i + 0x18000] = BITSWAP08(DrvZ80ROM[i] ^ 0xfc, 1, 0, 7, 6, 4, 3, 2, 5); - DrvZ80ROM[i + 0x1c000] = BITSWAP08(DrvZ80ROM[i] ^ 0xee, 7, 0, 1, 6, 4, 3, 2, 5); - } -} - -static INT32 acityaInit() -{ - acitya = 1; - - return DrvInit(StandardMap, acitya_decode, EPOS); -} - -struct BurnDriver BurnDrvbwcasino = { - "bwcasino", NULL, NULL, NULL, "1983", - "Boardwalk Casino\0", NULL, "EPOS Corporation", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_CASINO, 0, - NULL, bwcasinoRomInfo, bwcasinoRomName, NULL, NULL, bwcasinoInputInfo, bwcasinoDIPInfo, - acityaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Atlantic City Action - -static struct BurnRomInfo acityaRomDesc[] = { - { "aca_u2.bin", 0x2000, 0x261c2fdc, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "aca_u3.bin", 0x2000, 0x05fab4ca, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "aca_5e.bin", 0x1000, 0x7f2dd2c9, 2 | BRF_GRA }, // 2 Graphics - - { "aca_7f.bin", 0x0020, 0x133bb744, 3 | BRF_GRA }, // 3 Color Proms - { "aca_4a.bin", 0x0100, 0x8e29208f, 3 | BRF_GRA }, // 4 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 5 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 6 Timing Prom (not used) -}; - -STD_ROM_PICK(acitya) -STD_ROM_FN(acitya) - -struct BurnDriver BurnDrvacitya = { - "acitya", "bwcasino", NULL, NULL, "1983", - "Atlantic City Action\0", NULL, "EPOS Corporation", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_CASINO, 0, - NULL, acityaRomInfo, acityaRomName, NULL, NULL, acityaInputInfo, acityaDIPInfo, - acityaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Big Bucks - -static struct BurnRomInfo bigbucksRomDesc[] = { - { "p.rom", 0x4000, 0xeea6c1c9, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "m.rom", 0x2000, 0xbb8f7363, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5e.cpu", 0x1000, 0x18442c37, 2 | BRF_GRA }, // 2 Graphics - - { "82s123.7f", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 3 Color Proms - { "82s126.4a", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 4 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 5 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 6 Timing Prom - - { "rom1.rom", 0x8000, 0x90b7785f, 7 | BRF_PRG | BRF_ESS }, // 7 Question Roms - { "rom2.rom", 0x8000, 0x60172d77, 7 | BRF_PRG | BRF_ESS }, // 8 - { "rom3.rom", 0x8000, 0xa2207320, 7 | BRF_PRG | BRF_ESS }, // 9 - { "rom4.rom", 0x8000, 0x5a74c1f9, 7 | BRF_PRG | BRF_ESS }, // 10 - { "rom5.rom", 0x8000, 0x93bc1080, 7 | BRF_PRG | BRF_ESS }, // 11 - { "rom6.rom", 0x8000, 0xeea2423f, 7 | BRF_PRG | BRF_ESS }, // 12 - { "rom7.rom", 0x8000, 0x96694055, 7 | BRF_PRG | BRF_ESS }, // 13 - { "rom8.rom", 0x8000, 0xe68ebf8e, 7 | BRF_PRG | BRF_ESS }, // 14 - { "rom9.rom", 0x8000, 0xfd20921d, 7 | BRF_PRG | BRF_ESS }, // 15 - { "rom10.rom", 0x8000, 0x5091b951, 7 | BRF_PRG | BRF_ESS }, // 16 - { "rom11.rom", 0x8000, 0x705128db, 7 | BRF_PRG | BRF_ESS }, // 17 - { "rom12.rom", 0x8000, 0x74c776e7, 7 | BRF_PRG | BRF_ESS }, // 18 -}; - -STD_ROM_PICK(bigbucks) -STD_ROM_FN(bigbucks) - -static INT32 bigbucksInit() -{ - return DrvInit(BigbucksMap, NULL, BIGBUCKS); -} - -struct BurnDriver BurnDrvbigbucks = { - "bigbucks", NULL, NULL, NULL, "1986", - "Big Bucks\0", NULL, "Dynasoft Inc.", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_QUIZ, 0, - NULL, bigbucksRomInfo, bigbucksRomName, NULL, NULL, bigbucksInputInfo, bigbucksDIPInfo, - bigbucksInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// MTV Rock-N-Roll Trivia (Part 2) - -static struct BurnRomInfo rocktrv2RomDesc[] = { - { "1.aux", 0x4000, 0xd182947b, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "2.aux", 0x2000, 0x27a7461d, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "5e.cpu", 0x1000, 0x0a6cc43b, 2 | BRF_GRA }, // 2 Graphics - - { "7f.cpu", 0x0020, 0x7549a947, 3 | BRF_GRA }, // 3 Color Proms - { "4a.cpu", 0x0100, 0xddd5d88e, 3 | BRF_GRA }, // 4 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 5 Sound Prom - { "82s126.3m" , 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 6 Timing Prom (not used) - - { "3.aux", 0x4000, 0x5b117ca6, 7 | BRF_PRG | BRF_ESS }, // 7 Question Roms - { "4.aux", 0x4000, 0x81bfd4c3, 7 | BRF_PRG | BRF_ESS }, // 8 - { "5.aux", 0x4000, 0xe976423c, 7 | BRF_PRG | BRF_ESS }, // 9 - { "6.aux", 0x4000, 0x425946bf, 7 | BRF_PRG | BRF_ESS }, // 10 - { "7.aux", 0x4000, 0x7056fc8f, 7 | BRF_PRG | BRF_ESS }, // 11 - { "8.aux", 0x4000, 0x8b86464f, 7 | BRF_PRG | BRF_ESS }, // 12 - { "9.aux", 0x4000, 0x17d8eba4, 7 | BRF_PRG | BRF_ESS }, // 13 - { "10.aux", 0x4000, 0x398c8eb4, 7 | BRF_PRG | BRF_ESS }, // 14 - { "11.aux", 0x4000, 0x7f376424, 7 | BRF_PRG | BRF_ESS }, // 15 - { "12.aux", 0x4000, 0x8d5bbf81, 7 | BRF_PRG | BRF_ESS }, // 16 - { "13.aux", 0x4000, 0x99fe2c21, 7 | BRF_PRG | BRF_ESS }, // 17 - { "14.aux", 0x4000, 0xdf4cf5e7, 7 | BRF_PRG | BRF_ESS }, // 18 - { "15.aux", 0x4000, 0x2a32de26, 7 | BRF_PRG | BRF_ESS }, // 19 - { "16.aux", 0x4000, 0xfcd42187, 7 | BRF_PRG | BRF_ESS }, // 20 - { "17.aux", 0x4000, 0x24d5c388, 7 | BRF_PRG | BRF_ESS }, // 21 - { "18.aux", 0x4000, 0xfeb195fd, 7 | BRF_PRG | BRF_ESS }, // 22 -}; - -STD_ROM_PICK(rocktrv2) -STD_ROM_FN(rocktrv2) - -static void rocktrv2Callback() -{ - DrvZ80ROM[0x9ffe] = 0xa7; - DrvZ80ROM[0x9fee] = 0x6d; -} - -static INT32 rocktrv2Init() -{ - return DrvInit(Rocktrv2Map, rocktrv2Callback, ROCKTRV2); -} - -struct BurnDriver BurnDrvrocktrv2 = { - "rocktrv2", NULL, NULL, NULL, "1986", - "MTV Rock-N-Roll Trivia (Part 2)\0", NULL, "Triumph Software Inc.", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_QUIZ, 0, - NULL, rocktrv2RomInfo, rocktrv2RomName, NULL, NULL, rocktrv2InputInfo, rocktrv2DIPInfo, - rocktrv2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Ali Baba and 40 Thieves - -static struct BurnRomInfo alibabaRomDesc[] = { - { "6e", 0x1000, 0x38d701aa, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "6f", 0x1000, 0x3d0e35f3, 1 | BRF_ESS | BRF_PRG }, // 1 - { "6h", 0x1000, 0x823bee89, 1 | BRF_ESS | BRF_PRG }, // 2 - { "6k", 0x1000, 0x474d032f, 1 | BRF_ESS | BRF_PRG }, // 3 - { "6l", 0x1000, 0x5ab315c1, 1 | BRF_ESS | BRF_PRG }, // 4 - { "6m", 0x0800, 0x438d0357, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "5e", 0x0800, 0x85bcb8f8, 2 | BRF_GRA }, // 6 Graphics - { "5h", 0x0800, 0x38e50862, 2 | BRF_GRA }, // 7 - { "5f", 0x0800, 0xb5715c86, 2 | BRF_GRA }, // 8 - { "5k", 0x0800, 0x713086b3, 2 | BRF_GRA }, // 9 - - { "82s123.e7", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 10 Color Proms - { "82s129.a4", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 11 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 12 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom - - { "ab7.bin", 0x0800, 0x52294ef5, 0 | BRF_OPT }, // 14 Mystery Rom? (1st & 2nd halves identical) -}; - -STD_ROM_PICK(alibaba) -STD_ROM_FN(alibaba) - -static void alibabaCallback() -{ - memcpy (DrvZ80ROM + 0xa000, DrvZ80ROM + 0x9000, 0x0800); - memset (DrvZ80ROM + 0x9000, 0, 0x800); -} - -static INT32 alibabaInit() -{ - return DrvInit(AlibabaMap, alibabaCallback, ALIBABA); -} - -struct BurnDriver BurnDrvalibaba = { - "alibaba", NULL, NULL, NULL, "1982", - "Ali Baba and 40 Thieves\0", NULL, "Sega", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, alibabaRomInfo, alibabaRomName, NULL, NULL, alibabaInputInfo, alibabaDIPInfo, - alibabaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Mustafa and 40 Thieves (bootleg) - -static struct BurnRomInfo alibababRomDesc[] = { - { "6e", 0x1000, 0x38d701aa, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "6f", 0x1000, 0x3d0e35f3, 1 | BRF_ESS | BRF_PRG }, // 1 - { "6h", 0x1000, 0x823bee89, 1 | BRF_ESS | BRF_PRG }, // 2 - { "6k", 0x1000, 0x474d032f, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ab5.bin", 0x1000, 0xae2f4aac, 1 | BRF_ESS | BRF_PRG }, // 4 - { "6m", 0x0800, 0x438d0357, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "5e", 0x0800, 0x85bcb8f8, 2 | BRF_GRA }, // 6 Graphics - { "5h", 0x0800, 0x38e50862, 2 | BRF_GRA }, // 7 - { "5f", 0x0800, 0xb5715c86, 2 | BRF_GRA }, // 8 - { "5k", 0x0800, 0x713086b3, 2 | BRF_GRA }, // 9 - - { "82s123.e7", 0x0020, 0x2fc650bd, 3 | BRF_GRA }, // 10 Color Proms - { "82s129.a4", 0x0100, 0x3eb3a8e4, 3 | BRF_GRA }, // 11 - - { "82s126.1m", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 12 Sound Prom - { "82s126.3m", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom - - { "ab7.bin", 0x0800, 0x52294ef5, 0 | BRF_OPT }, // 14 Mystery Rom? (1st & 2nd halves identical) -}; - -STD_ROM_PICK(alibabab) -STD_ROM_FN(alibabab) - -struct BurnDriver BurnDrvalibabab = { - "alibabab", "alibaba", NULL, NULL, "1982", - "Mustafa and 40 Thieves (bootleg)\0", NULL, "bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, alibababRomInfo, alibababRomName, NULL, NULL, alibabaInputInfo, alibabaDIPInfo, - alibabaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Birdiy - -static struct BurnRomInfo birdiyRomDesc[] = { - { "a6.6a", 0x1000, 0x3a58f8ad, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "c6.6c", 0x1000, 0xfec61ea2, 1 | BRF_ESS | BRF_PRG }, // 1 - { "a4.4a", 0x1000, 0x3392783b, 1 | BRF_ESS | BRF_PRG }, // 2 - { "c4.4c", 0x1000, 0x2391d83d, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "c1.1c", 0x1000, 0x8f6bf54f, 2 | BRF_GRA }, // 4 Graphics - { "c3.3c", 0x1000, 0x10b55440, 2 | BRF_GRA }, // 5 - - { "n82s123n.10n", 0x0020, 0xff344446, 3 | BRF_GRA }, // 6 Color Proms - { "n82s129n.9m", 0x0100, 0x63efb927, 3 | BRF_GRA }, // 7 - - { "n82s129n.4k", 0x0100, 0xa9cc86bf, 4 | BRF_SND }, // 8 Sound Prom - { "n82s129n.6l", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 9 Timing Prom (not used) -}; - -STD_ROM_PICK(birdiy) -STD_ROM_FN(birdiy) - -static INT32 birdiyInit() -{ - return DrvInit(StandardMap, NULL, BIRDIY); -} - -struct BurnDriver BurnDrvbirdiy = { - "birdiy", NULL, NULL, NULL, "1982", - "Birdiy\0", NULL, "Mama Top", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, birdiyRomInfo, birdiyRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - birdiyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pengo (set 1 rev c) - -static struct BurnRomInfo pengoRomDesc[] = { - { "ep1689c.8", 0x1000, 0xf37066a8, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ep1690b.7", 0x1000, 0xbaf48143, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ep1691b.15", 0x1000, 0xadf0eba0, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ep1692b.14", 0x1000, 0xa086d60f, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ep1693b.21", 0x1000, 0xb72084ec, 1 | BRF_ESS | BRF_PRG }, // 4 - { "ep1694b.20", 0x1000, 0x94194a89, 1 | BRF_ESS | BRF_PRG }, // 5 - { "ep5118b.32", 0x1000, 0xaf7b12c4, 1 | BRF_ESS | BRF_PRG }, // 6 - { "ep5119c.31", 0x1000, 0x933950fe, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "ep1640.92", 0x2000, 0xd7eec6cd, 2 | BRF_GRA }, // 8 Graphics - { "ep1695.105", 0x2000, 0x5bfd26e9, 2 | BRF_GRA }, // 9 - - { "pr1633.78", 0x0020, 0x3a5844ec, 3 | BRF_GRA }, // 10 Color Proms - { "pr1634.88", 0x0400, 0x766b139b, 3 | BRF_GRA }, // 11 - - { "pr1635.51", 0x0100, 0xc29dea27, 4 | BRF_SND }, // 12 Sound Prom - { "pr1636.70", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom -}; - -STD_ROM_PICK(pengo) -STD_ROM_FN(pengo) - -static void PengoDecode() -{ - static const UINT8 convtable[32][4] = - { - { 0xa0,0x80,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, - { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x80,0xa8,0x88 }, - { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, - { 0x08,0x28,0x88,0xa8 }, { 0xa0,0x80,0xa8,0x88 }, - { 0x08,0x00,0x88,0x80 }, { 0x28,0xa8,0x08,0x88 }, - { 0xa0,0x80,0x20,0x00 }, { 0x08,0x00,0x88,0x80 }, - { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, - { 0xa0,0x80,0x20,0x00 }, { 0x00,0x08,0x20,0x28 }, - { 0x88,0x80,0x08,0x00 }, { 0xa0,0x80,0x20,0x00 }, - { 0x88,0x80,0x08,0x00 }, { 0x00,0x08,0x20,0x28 }, - { 0x08,0x28,0x88,0xa8 }, { 0x08,0x28,0x88,0xa8 }, - { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0x20,0x00 }, - { 0x08,0x00,0x88,0x80 }, { 0x88,0x80,0x08,0x00 }, - { 0x00,0x08,0x20,0x28 }, { 0x88,0x80,0x08,0x00 }, - { 0x08,0x28,0x88,0xa8 }, { 0x08,0x28,0x88,0xa8 }, - { 0x08,0x00,0x88,0x80 }, { 0xa0,0x80,0x20,0x00 } - }; - - UINT8 *decrypted = DrvZ80ROM + 0x8000; - - for (INT32 A = 0x0000;A < 0x8000;A++) - { - INT32 xorval = 0; - UINT8 src = DrvZ80ROM[A]; - - INT32 row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2) + (((A >> 12) & 1) << 3); - - INT32 col = ((src >> 3) & 1) + (((src >> 5) & 1) << 1); - - if (src & 0x80) - { - col = 3 - col; - xorval = 0xa8; - } - - decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval); - DrvZ80ROM[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval); - - if (convtable[2*row][col] == 0xff) decrypted[A] = 0xee; - if (convtable[2*row+1][col] == 0xff) DrvZ80ROM[A] = 0xee; - } -} - -static void PengoGraphicsReorder() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - - memcpy (tmp + 0x0000, DrvGfxROM + 0x2000, 0x1000); - memcpy (tmp + 0x1000, DrvGfxROM + 0x1000, 0x1000); - memcpy (DrvGfxROM + 0x1000, tmp + 0x0000, 0x2000); - - BurnFree (tmp); -} - -static void PengoCallback() -{ - PengoDecode(); - - PengoGraphicsReorder(); -} - -static INT32 pengoInit() -{ - return DrvInit(PengoMap, PengoCallback, PENGO); -} - -struct BurnDriver BurnDrvpengo = { - "pengo", NULL, NULL, NULL, "1982", - "Pengo (set 1 rev c)\0", NULL, "Sega", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pengoRomInfo, pengoRomName, NULL, NULL, PengoInputInfo, PengoDIPInfo, - pengoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pengo (set 2) - -static struct BurnRomInfo pengo2RomDesc[] = { - { "ic8.2", 0x1000, 0xe4924b7b, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ic7.2", 0x1000, 0x72e7775d, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ic15.2", 0x1000, 0x7410ef1e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ic14.2", 0x1000, 0x55b3f379, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ep1693b.21", 0x1000, 0xb72084ec, 1 | BRF_ESS | BRF_PRG }, // 4 - { "ic20.2", 0x1000, 0x770570cf, 1 | BRF_ESS | BRF_PRG }, // 5 - { "ep5118b.32", 0x1000, 0xaf7b12c4, 1 | BRF_ESS | BRF_PRG }, // 6 - { "ic31.2", 0x1000, 0x669555c1, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "ep1640.92", 0x2000, 0xd7eec6cd, 2 | BRF_GRA }, // 8 Graphics - { "ep1695.105", 0x2000, 0x5bfd26e9, 2 | BRF_GRA }, // 9 - - { "pr1633.78", 0x0020, 0x3a5844ec, 3 | BRF_GRA }, // 10 Color Proms - { "pr1634.88", 0x0400, 0x766b139b, 3 | BRF_GRA }, // 11 - - { "pr1635.51", 0x0100, 0xc29dea27, 4 | BRF_SND }, // 12 Sound Prom - { "pr1636.70", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom -}; - -STD_ROM_PICK(pengo2) -STD_ROM_FN(pengo2) - -struct BurnDriver BurnDrvpengo2 = { - "pengo2", "pengo", NULL, NULL, "1982", - "Pengo (set 2)\0", NULL, "Sega", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pengo2RomInfo, pengo2RomName, NULL, NULL, PengoInputInfo, PengoDIPInfo, - pengoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pengo (set 2 not encrypted) - -static struct BurnRomInfo pengo2uRomDesc[] = { - { "epr5128.u8", 0x1000, 0x3dfeb20e, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "epr5129.u7", 0x1000, 0x1db341bd, 1 | BRF_ESS | BRF_PRG }, // 1 - { "epr5130.u15", 0x1000, 0x7c2842d5, 1 | BRF_ESS | BRF_PRG }, // 2 - { "epr5131.u14", 0x1000, 0x6e3c1f2f, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ep5124.21", 0x1000, 0x95f354ff, 1 | BRF_ESS | BRF_PRG }, // 4 - { "epr5133.u20", 0x1000, 0x0fdb04b8, 1 | BRF_ESS | BRF_PRG }, // 5 - { "ep5126.32", 0x1000, 0xe5920728, 1 | BRF_ESS | BRF_PRG }, // 6 - { "epr5135.u31", 0x1000, 0x13de47ed, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "ep1640.92", 0x2000, 0xd7eec6cd, 2 | BRF_GRA }, // 8 Graphics - { "ep1695.105", 0x2000, 0x5bfd26e9, 2 | BRF_GRA }, // 9 - - { "pr1633.78", 0x0020, 0x3a5844ec, 3 | BRF_GRA }, // 10 Color Proms - { "pr1634.88", 0x0400, 0x766b139b, 3 | BRF_GRA }, // 11 - - { "pr1635.51", 0x0100, 0xc29dea27, 4 | BRF_SND }, // 12 Sound Prom - { "pr1636.70", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom -}; - -STD_ROM_PICK(pengo2u) -STD_ROM_FN(pengo2u) - -static void PengouCallback() -{ - memcpy (DrvZ80ROM + 0x8000, DrvZ80ROM, 0x8000); - - PengoGraphicsReorder(); -} - -static INT32 pengouInit() -{ - return DrvInit(PengoMap, PengouCallback, PENGO); -} - -struct BurnDriver BurnDrvpengo2u = { - "pengo2u", "pengo", NULL, NULL, "1982", - "Pengo (set 2 not encrypted)\0", NULL, "Sega", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pengo2uRomInfo, pengo2uRomName, NULL, NULL, PengoInputInfo, PengoDIPInfo, - pengouInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pengo (set 3 not encrypted) - -static struct BurnRomInfo pengo3uRomDesc[] = { - { "ep5120.8", 0x1000, 0xf01afb60, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ep5121.7", 0x1000, 0x2eb38353, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ep5122.15", 0x1000, 0xc33400d7, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ep5123.14", 0x1000, 0x6a85c6a2, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ep5124.21", 0x1000, 0x95f354ff, 1 | BRF_ESS | BRF_PRG }, // 4 - { "ep5125.20", 0x1000, 0x1a42310f, 1 | BRF_ESS | BRF_PRG }, // 5 - { "ep5126.32", 0x1000, 0xe5920728, 1 | BRF_ESS | BRF_PRG }, // 6 - { "ep5127.31", 0x1000, 0xa7d3d1d6, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "ep1640.92", 0x2000, 0xd7eec6cd, 2 | BRF_GRA }, // 8 Graphics - { "ep1695.105", 0x2000, 0x5bfd26e9, 2 | BRF_GRA }, // 9 - - { "pr1633.78", 0x0020, 0x3a5844ec, 3 | BRF_GRA }, // 10 Color Proms - { "pr1634.88", 0x0400, 0x766b139b, 3 | BRF_GRA }, // 11 - - { "pr1635.51", 0x0100, 0xc29dea27, 4 | BRF_SND }, // 12 Sound Prom - { "pr1636.70", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom -}; - -STD_ROM_PICK(pengo3u) -STD_ROM_FN(pengo3u) - -struct BurnDriver BurnDrvpengo3u = { - "pengo3u", "pengo", NULL, NULL, "1982", - "Pengo (set 3 not encrypted)\0", NULL, "Sega", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pengo3uRomInfo, pengo3uRomName, NULL, NULL, PengoInputInfo, PengoDIPInfo, - pengouInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pengo (set 4) - -static struct BurnRomInfo pengo4RomDesc[] = { - { "ep1738.8", 0x1000, 0x68ba25ea, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ep1739.7", 0x1000, 0x41e7b5b3, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ep1740.15", 0x1000, 0x27f05f59, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ep1741.14", 0x1000, 0x27d93ec1, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ep1742.21", 0x1000, 0xb72084ec, 1 | BRF_ESS | BRF_PRG }, // 4 - { "ep1743.20", 0x1000, 0x770570cf, 1 | BRF_ESS | BRF_PRG }, // 5 - { "ep1744.32", 0x1000, 0xaf7b12c4, 1 | BRF_ESS | BRF_PRG }, // 6 - { "ep1745.31", 0x1000, 0x507e18b9, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "ep1640.92", 0x2000, 0xd7eec6cd, 2 | BRF_GRA }, // 8 Graphics - { "ep1695.105", 0x2000, 0x5bfd26e9, 2 | BRF_GRA }, // 9 - - { "pr1633.78", 0x0020, 0x3a5844ec, 3 | BRF_GRA }, // 10 Color Proms - { "pr1634.88", 0x0400, 0x766b139b, 3 | BRF_GRA }, // 11 - - { "pr1635.51", 0x0100, 0xc29dea27, 4 | BRF_SND }, // 12 Sound Prom - { "pr1636.70", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom -}; - -STD_ROM_PICK(pengo4) -STD_ROM_FN(pengo4) - -struct BurnDriver BurnDrvpengo4 = { - "pengo4", "pengo", NULL, NULL, "1982", - "Pengo (set 4)\0", NULL, "Sega", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pengo4RomInfo, pengo4RomName, NULL, NULL, PengoInputInfo, PengoDIPInfo, - pengoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pengo (set 5) -// PCB has an additional label Bally N.E. - -static struct BurnRomInfo pengo5RomDesc[] = { - { "0_OCT6-82.bin", 0x1000, 0x43e45441, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "1_OCT11-82.bin", 0x1000, 0x30a52a90, 1 | BRF_ESS | BRF_PRG }, // 1 - { "2_OCT11-82.bin", 0x1000, 0x09783cc2, 1 | BRF_ESS | BRF_PRG }, // 2 - { "3_OCT6-82.bin", 0x1000, 0x452c80c9, 1 | BRF_ESS | BRF_PRG }, // 3 - { "4_OCT6-82.bin", 0x1000, 0xb72084ec, 1 | BRF_ESS | BRF_PRG }, // 4 - { "5_OCT11-82.bin", 0x1000, 0x770570cf, 1 | BRF_ESS | BRF_PRG }, // 5 - { "6_OCT11-82.bin", 0x1000, 0xaf7b12c4, 1 | BRF_ESS | BRF_PRG }, // 6 - { "7_OCT11-82.bin", 0x1000, 0x1350ca0e, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "ep1640.92", 0x2000, 0xd7eec6cd, 2 | BRF_GRA }, // 8 Graphics - { "ep1695.105", 0x2000, 0x5bfd26e9, 2 | BRF_GRA }, // 9 - - { "pr1633.78", 0x0020, 0x3a5844ec, 3 | BRF_GRA }, // 10 Color Proms - { "pr1634.88", 0x0400, 0x766b139b, 3 | BRF_GRA }, // 11 - - { "pr1635.51", 0x0100, 0xc29dea27, 4 | BRF_SND }, // 12 Sound Prom - { "pr1636.70", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 13 Timing Prom -}; - -STD_ROM_PICK(pengo5) -STD_ROM_FN(pengo5) - -struct BurnDriver BurnDrvpengo5 = { - "pengo5", "pengo", NULL, NULL, "1982", - "Pengo (set 5)\0", NULL, "Sega", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pengo5RomInfo, pengo5RomName, NULL, NULL, PengoInputInfo, PengoDIPInfo, - pengoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Pengo (bootleg) - -static struct BurnRomInfo pengobRomDesc[] = { - { "1", 0x2000, 0xe04064db, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "2", 0x2000, 0x75752424, 1 | BRF_ESS | BRF_PRG }, // 1 - { "021_pn03.bin", 0x1000, 0x7824e3ef, 1 | BRF_ESS | BRF_PRG }, // 2 - { "020_pn07.bin", 0x1000, 0x377b9663, 1 | BRF_ESS | BRF_PRG }, // 3 - { "032_pn04.bin", 0x1000, 0xbfde44c1, 1 | BRF_ESS | BRF_PRG }, // 4 - { "031_pn08.bin", 0x1000, 0x64e8c30d, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "5", 0x2000, 0x1232437b, 2 | BRF_GRA }, // 6 Graphics - { "ep1695.105", 0x2000, 0x5bfd26e9, 2 | BRF_GRA }, // 7 - - { "pr1633.78", 0x0020, 0x3a5844ec, 3 | BRF_GRA }, // 8 Color Proms - { "pr1634.88", 0x0400, 0x766b139b, 3 | BRF_GRA }, // 9 - - { "pr1635.51", 0x0100, 0xc29dea27, 4 | BRF_SND }, // 10 Sound Prom - { "pr1636.70", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom -}; - -STD_ROM_PICK(pengob) -STD_ROM_FN(pengob) - -static void PentaDecode() -{ - static const UINT8 data_xortable[2][8] = - { - { 0xa0,0x82,0x28,0x0a,0x82,0xa0,0x0a,0x28 }, - { 0x88,0x0a,0x82,0x00,0x88,0x0a,0x82,0x00 } - }; - - static const UINT8 opcode_xortable[8][8] = - { - { 0x02,0x08,0x2a,0x20,0x20,0x2a,0x08,0x02 }, - { 0x88,0x88,0x00,0x00,0x88,0x88,0x00,0x00 }, - { 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 }, - { 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 }, - { 0x2a,0x08,0x2a,0x08,0x8a,0xa8,0x8a,0xa8 }, - { 0x2a,0x08,0x2a,0x08,0x8a,0xa8,0x8a,0xa8 }, - { 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 }, - { 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 } - }; - - UINT8 *decrypt = DrvZ80ROM + 0x8000; - - for (INT32 A = 0; A < 0x8000; A++) - { - UINT8 src = DrvZ80ROM[A]; - - INT32 i = A & 1; - - INT32 j = ((src >> 1) & 1) + (((src >> 3) & 1) << 1) + (((src >> 5) & 1) << 2); - - if (src & 0x80) j = 7 - j; - - DrvZ80ROM[A] = src ^ data_xortable[i][j]; - - i = ((A >> 4) & 1) + (((A >> 8) & 1) << 1) + (((A >> 12) & 1) << 2); - - decrypt[A] = src ^ opcode_xortable[i][j]; - } -} - -static void PengobCallback() -{ - PentaDecode(); - - PengoGraphicsReorder(); -} - -static INT32 pengobInit() -{ - return DrvInit(PengoMap, PengobCallback, PENGO); -} - -struct BurnDriver BurnDrvpengob = { - "pengob", "pengo", NULL, NULL, "1982", - "Pengo (bootleg)\0", NULL, "Bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pengobRomInfo, pengobRomName, NULL, NULL, PengoInputInfo, PengoDIPInfo, - pengobInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - -// Penta - -static struct BurnRomInfo pentaRomDesc[] = { - { "008_pn01.bin", 0x1000, 0x22f328df, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "007_pn05.bin", 0x1000, 0x15bbc7d3, 1 | BRF_ESS | BRF_PRG }, // 1 - { "015_pn02.bin", 0x1000, 0xde82b74a, 1 | BRF_ESS | BRF_PRG }, // 2 - { "014_pn06.bin", 0x1000, 0x160f3836, 1 | BRF_ESS | BRF_PRG }, // 3 - { "021_pn03.bin", 0x1000, 0x7824e3ef, 1 | BRF_ESS | BRF_PRG }, // 4 - { "020_pn07.bin", 0x1000, 0x377b9663, 1 | BRF_ESS | BRF_PRG }, // 5 - { "032_pn04.bin", 0x1000, 0xbfde44c1, 1 | BRF_ESS | BRF_PRG }, // 6 - { "031_pn08.bin", 0x1000, 0x64e8c30d, 1 | BRF_ESS | BRF_PRG }, // 7 - - { "092_pn09.bin", 0x2000, 0x6afeba9d, 2 | BRF_GRA }, // 6 Graphics - { "ep1695.105", 0x2000, 0x5bfd26e9, 2 | BRF_GRA }, // 7 - - { "pr1633.78", 0x0020, 0x3a5844ec, 3 | BRF_GRA }, // 8 Color Proms - { "pr1634.88", 0x0400, 0x766b139b, 3 | BRF_GRA }, // 9 - - { "pr1635.51", 0x0100, 0xc29dea27, 4 | BRF_SND }, // 10 Sound Prom - { "pr1636.70", 0x0100, 0x77245b66, 0 | BRF_SND | BRF_OPT }, // 11 Timing Prom -}; - -STD_ROM_PICK(penta) -STD_ROM_FN(penta) - -struct BurnDriver BurnDrvpenta = { - "penta", "pengo", NULL, NULL, "1982", - "Penta\0", NULL, "Bootleg", "Pac-man", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_PACMAN, GBF_MAZE, 0, - NULL, pentaRomInfo, pentaRomName, NULL, NULL, PengoInputInfo, PengoDIPInfo, - pengobInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 288, 3, 4 -}; - - diff --git a/jan/src/burn/drv/pre90s/d_pengadvb.cpp b/jan/src/burn/drv/pre90s/d_pengadvb.cpp deleted file mode 100644 index 68c502b75..000000000 --- a/jan/src/burn/drv/pre90s/d_pengadvb.cpp +++ /dev/null @@ -1,503 +0,0 @@ -// FB Alpha pengadvb arcade driver module based on hap's mame driver - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -#include "tms9928a.h" -#include "8255ppi.h" -#include "bitswap.h" - -extern "C" { - #include "ay8910.h" -} -static INT16 *pAY8910Buffer[6]; - -static UINT8 *AllMem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *AllRam = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *maincpu = NULL; -static UINT8 *game = NULL; -static UINT8 *main_mem = NULL; - -static UINT8 DrvInputs[2]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; -static UINT8 DrvNMI; - -static UINT8 msxmode = 0; -static UINT8 mem_map = 0; -static UINT8 mem_banks[4]; - -static struct BurnInputInfo PengadvbInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Pengadvb) - -static struct BurnDIPInfo PengadvbDIPList[]= -{ - {0x08, 0xff, 0xff, 0x00, NULL }, -}; - -STDDIPINFO(Pengadvb) - -static void __fastcall msx_write_port(UINT16 port, UINT8 data) -{ - port &= 0xff; - switch (port) - { - case 0x98: - TMS9928AWriteVRAM(data); - return; - - case 0x99: - TMS9928AWriteRegs(data); - return; - - case 0xa0: - AY8910Write(0, 0, data); - break; - - case 0xa1: - AY8910Write(0, 1, data); - break; - - case 0xa8: - case 0xa9: - case 0xaa: - case 0xab: - ppi8255_w(0, port & 3, data); - return; - } - - //bprintf(0, _T("port[%X] data[%X],"), port, data); -} - -static UINT8 __fastcall msx_read_port(UINT16 port) -{ - port &= 0xff; - - switch (port) - { - case 0x98: - return TMS9928AReadVRAM(); - - case 0x99: - return TMS9928AReadRegs(); - - case 0xa2: - return AY8910Read(0); - - case 0xa8: - case 0xa9: - case 0xaa: - case 0xab: - return ppi8255_r(0, port & 3); - } - - //bprintf(0, _T("port[%X],"), port); - - return 0; -} - -static void mem_map_banks() -{ - int slot_select; - - // page 0 - slot_select = (mem_map >> 0) & 0x03; - switch(slot_select) - { - case 0: - { - ZetMapMemory(maincpu, 0x0000, 0x3fff, MAP_READ | MAP_FETCH); - break; - } - case 1: - case 2: - case 3: - { - ZetUnmapMemory(0x0000, 0x3fff, MAP_READ | MAP_FETCH); - break; - } - } - - // page 1 - slot_select = (mem_map >> 2) & 0x03; - switch(slot_select) - { - case 0: - { - ZetMapMemory(maincpu + 0x4000, 0x4000, 0x5fff, MAP_READ | MAP_FETCH); - ZetMapMemory(maincpu + 0x6000, 0x6000, 0x7fff, MAP_READ | MAP_FETCH); - break; - } - case 1: - { - ZetMapMemory(game + mem_banks[0]*0x2000, 0x4000, 0x5fff, MAP_READ | MAP_FETCH); - ZetMapMemory(game + mem_banks[1]*0x2000, 0x6000, 0x7fff, MAP_READ | MAP_FETCH); - break; - } - case 2: - case 3: - { - ZetUnmapMemory(0x4000, 0x7fff, MAP_READ | MAP_FETCH); - break; - } - } - - // page 2 - slot_select = (mem_map >> 4) & 0x03; - switch(slot_select) - { - case 1: - { - ZetMapMemory(game + mem_banks[2]*0x2000, 0x8000, 0x9fff, MAP_READ | MAP_FETCH); - ZetMapMemory(game + mem_banks[3]*0x2000, 0xa000, 0xbfff, MAP_READ | MAP_FETCH); - break; - } - case 0: - case 2: - case 3: - { - ZetUnmapMemory(0x8000, 0xbfff, MAP_READ | MAP_FETCH); - break; - } - } - - // page 3 - slot_select = (mem_map >> 6) & 0x03; - - switch(slot_select) - { - case 0: - case 1: - case 2: - { - ZetUnmapMemory(0xc000, 0xffff, MAP_READ | MAP_FETCH); - break; - } - case 3: - { - ZetMapMemory(main_mem, 0xc000, 0xffff, MAP_READ | MAP_FETCH); - break; - } - } - -} - -static UINT8 sg1000_ppi8255_portB_read() -{ - if ((ppi8255_r(0, 2) & 0x0f) == 0) - return DrvInputs[1]; - - return 0xff; - -} - -static void sg1000_ppi8255_portA_write(UINT8 data) -{ - mem_map = data; - mem_map_banks(); -} - -static UINT8 msx_input_mask = 0; - -static UINT8 ay8910portAread(UINT32 /*offset*/) -{ - return DrvInputs[0]; -} - -static void ay8910portBwrite(UINT32 /*offset*/, UINT32 data) -{ - /* PSG reg 15, writes 0 at coin insert, 0xff at boot and game over */ - msx_input_mask = data; -} - -static void vdp_interrupt(INT32 state) -{ - ZetSetIRQLine(0, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - TMS9928AReset(); - mem_map = 0; - mem_banks[0] = mem_banks[1] = mem_banks[2] = mem_banks[3] = 0; - mem_map_banks(); - ZetClose(); - - AY8910Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - maincpu = Next; Next += 0x020000; - game = Next; Next += 0x020000; - - AllRam = Next; - - main_mem = Next; Next += 0x010400; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void __fastcall msx_write(UINT16 address, UINT8 data) -{ - if (address >= 0xc000) - { - int slot_select = (mem_map >> 6) & 0x03; - - if ( slot_select == 3 ) - { - main_mem[address - 0xc000] = data; - } - } - else - { - switch(address) - { - case 0x4000: mem_banks[0] = data; mem_map_banks(); break; - case 0x6000: mem_banks[1] = data; mem_map_banks(); break; - case 0x8000: mem_banks[2] = data; mem_map_banks(); break; - case 0xa000: mem_banks[3] = data; mem_map_banks(); break; - } - } - //bprintf(0, _T("a[%X] d[%X],"), address, data); -} - -static UINT8 __fastcall msx_read(UINT16 /*address*/) -{ - //bprintf(0, _T("a[%X],"), address); - return 0; -} - -static void pengadvb_decrypt(UINT8 *mem, INT32 memsize) -{ - UINT8 *buf; - int i; - - // data lines swap - for ( i = 0; i < memsize; i++ ) - { - mem[i] = BITSWAP08(mem[i],7,6,5,3,4,2,1,0); - } - - // address line swap - buf = (UINT8 *)BurnMalloc(memsize); - memcpy(buf, mem, memsize); - for ( i = 0; i < memsize; i++ ) - { - mem[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,5,11,10,9,8,7,6,12,4,3,2,1,0)]; - } - BurnFree(buf); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(maincpu, 0, 1)) return 1; - - if (msxmode) { - if (BurnLoadRom(game + 0x00000, 1, 1)) return 1; - } else { - if (BurnLoadRom(game + 0x00000, 1, 1)) return 1; - if (BurnLoadRom(game + 0x08000, 2, 1)) return 1; - if (BurnLoadRom(game + 0x10000, 3, 1)) return 1; - if (BurnLoadRom(game + 0x18000, 4, 1)) return 1; - pengadvb_decrypt(game, 0x20000); - //FILE * f = fopen("c:\\penga.rom", "wb+"); - //fwrite(game, 1, 0x20000, f); - //fclose(f); - } - - pengadvb_decrypt(maincpu, 0x8000); - } - - ZetInit(0); - ZetOpen(0); - - ZetSetOutHandler(msx_write_port); - ZetSetInHandler(msx_read_port); - ZetSetWriteHandler(msx_write); - ZetSetReadHandler(msx_read); - ZetClose(); - - AY8910Init(0, 3579545/2, nBurnSoundRate, ay8910portAread, NULL, NULL, ay8910portBwrite); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - TMS9928AInit(TMS99x8A, 0x4000, 0, 0, vdp_interrupt); - - ppi8255_init(1); - //PPI0PortReadA = sg1000_ppi8255_portA_read; - PPI0PortReadB = sg1000_ppi8255_portB_read; - //PPI0PortReadC = sg1000_ppi8255_portC_read; - PPI0PortWriteA = sg1000_ppi8255_portA_write; - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - TMS9928AExit(); - ZetExit(); - AY8910Exit(0); - ppi8255_exit(); - - BurnFree (AllMem); - AllMem = NULL; - - msxmode = 0; - - return 0; -} - -static INT32 DrvFrame() -{ - static UINT8 lastnmi = 0; - - if (DrvReset) { - DrvDoReset(); - } - - { // Compile Inputs - memset (DrvInputs, 0xff, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - if (i==6 || i==7) - DrvInputs[1] ^= (DrvJoy1[i] & 1) << i; - else - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[1] = { 3579545 / 60 }; - INT32 nCyclesDone[1] = { 0 }; - INT32 nSoundBufferPos = 0; - - ZetOpen(0); - - if (DrvNMI && !lastnmi) { - ZetNmi(); - lastnmi = DrvNMI; - } else lastnmi = DrvNMI; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - - TMS9928AScanline(i); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - ZetClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - TMS9928ADraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029708; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - TMS9928AScan(nAction, pnMin); - } - - return 0; -} - - -// Penguin Adventure (bootleg of MSX version) - -static struct BurnRomInfo pengadvbRomDesc[] = { - { "rom.u5", 0x8000, 0xd21950d2, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "rom.u7", 0x8000, 0xd4b4a4a4, 2 | BRF_GRA }, // 1 game - { "rom.u8", 0x8000, 0xeada2232, 2 | BRF_GRA }, // 2 - { "rom.u9", 0x8000, 0x6478c561, 2 | BRF_GRA }, // 3 - { "rom.u10", 0x8000, 0x5c48360f, 2 | BRF_GRA }, // 4 -}; - -STD_ROM_PICK(pengadvb) -STD_ROM_FN(pengadvb) - -struct BurnDriver BurnDrvPengadvb = { - "pengadvb", NULL, NULL, NULL, "1988", - "Penguin Adventure (bootleg of MSX version)\0", NULL, "bootleg (Screen) / Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pengadvbRomInfo, pengadvbRomName, NULL, NULL, PengadvbInputInfo, PengadvbDIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 216, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_phoenix.cpp b/jan/src/burn/drv/pre90s/d_phoenix.cpp deleted file mode 100644 index bfae30b23..000000000 --- a/jan/src/burn/drv/pre90s/d_phoenix.cpp +++ /dev/null @@ -1,2190 +0,0 @@ -// FB Alpha Phoenix driver module -// Based on MAME driver by Richard Davies - -#include "tiles_generic.h" -#define USE_Z80 - -#ifdef USE_Z80 - -#include "z80_intf.h" - -#define i8085Init ZetInit -#define i8080Reset ZetReset -#define i8080Open ZetOpen -#define i8080Close ZetClose -#define i8080Exit ZetExit -#define i8080SetWriteHandler ZetSetWriteHandler -#define i8080SetReadHandler ZetSetReadHandler -#define i8080MapMemory ZetMapMemory -#define i8080Run ZetRun -#define i8080Scan ZetScan - -#else - -#include "i8080.h" - -#endif - -#include "phoenixsound.h" -#include "pleiadssound.h" - -static UINT8 *DrvI8085ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *DrvI8085RAM; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 ram_bank; -static UINT8 scrollx; -static UINT8 palette_bank; -static UINT8 pleiads_protection_question; -static INT32 cocktail_mode = 0; - -static INT32 vblank; - -static INT32 pleiads = 0; -static INT32 condor = 0; -static INT32 phoenixmode = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo PhoenixInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 2, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Phoenix) - -static struct BurnInputInfo Phoenix3InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 2, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Phoenix3) - -static struct BurnInputInfo CondorInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 2, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Condor) - -static struct BurnInputInfo PleiadsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 2, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pleiads) - -static struct BurnDIPInfo PleiadsDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x60, NULL }, - {0x0b, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0a, 0x01, 0x03, 0x00, "3" }, - {0x0a, 0x01, 0x03, 0x01, "4" }, - {0x0a, 0x01, 0x03, 0x02, "5" }, - {0x0a, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0a, 0x01, 0x0c, 0x00, "3K 30K" }, - {0x0a, 0x01, 0x0c, 0x04, "4K 40K" }, - {0x0a, 0x01, 0x0c, 0x08, "5K 50K" }, - {0x0a, 0x01, 0x0c, 0x0c, "6K 60K" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0a, 0x01, 0x10, 0x10, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x10, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0a, 0x01, 0x40, 0x00, "Off" }, - {0x0a, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0b, 0x01, 0x01, 0x00, "Upright" }, - {0x0b, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Pleiads) - -static struct BurnDIPInfo PleiadblDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x60, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "3K 30K" }, - {0x0c, 0x01, 0x0c, 0x04, "4K 40K" }, - {0x0c, 0x01, 0x0c, 0x08, "5K 50K" }, - {0x0c, 0x01, 0x0c, 0x0c, "6K 60K" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0c, 0x01, 0x10, 0x10, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x10, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Pleiadbl) - -static struct BurnDIPInfo PleiadceDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x60, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 3, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "7K 70K" }, - {0x0c, 0x01, 0x0c, 0x04, "8K 80K" }, - {0x0c, 0x01, 0x0c, 0x08, "9K 90K" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0c, 0x01, 0x10, 0x10, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x10, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Pleiadce) - -static struct BurnDIPInfo CondorDIPList[]= -{ - {0x0d, 0xff, 0xff, 0x30, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0d, 0x01, 0x03, 0x00, "2" }, - {0x0d, 0x01, 0x03, 0x01, "3" }, - {0x0d, 0x01, 0x03, 0x02, "4" }, - {0x0d, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0d, 0x01, 0x0c, 0x00, "Every 6000" }, - {0x0d, 0x01, 0x0c, 0x08, "Every 10000" }, - {0x0d, 0x01, 0x0c, 0x04, "Every 14000" }, - {0x0d, 0x01, 0x0c, 0x0c, "Every 18000" }, - - {0 , 0xfe, 0 , 8, "Fuel Consumption" }, - {0x0d, 0x01, 0x70, 0x00, "Slowest" }, - {0x0d, 0x01, 0x70, 0x10, "Slower" }, - {0x0d, 0x01, 0x70, 0x20, "Slow" }, - {0x0d, 0x01, 0x70, 0x30, "Bit Slow" }, - {0x0d, 0x01, 0x70, 0x40, "Bit Fast" }, - {0x0d, 0x01, 0x70, 0x50, "Fast" }, - {0x0d, 0x01, 0x70, 0x60, "Faster" }, - {0x0d, 0x01, 0x70, 0x70, "Fastest" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x0e, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x09, "2 Coins 2 Credits" }, - {0x0e, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0a, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x0b, "2 Coins 4 Credits" }, - {0x0e, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x0f, 0x0c, "2 Coins 5 Credits" }, - {0x0e, 0x01, 0x0f, 0x0d, "2 Coins 6 Credits" }, - {0x0e, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x0e, "2 Coins 7 Credits" }, - {0x0e, 0x01, 0x0f, 0x0f, "2 Coins 8 Credits" }, - {0x0e, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x0e, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x0e, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x0e, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x0e, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x90, "2 Coins 2 Credits" }, - {0x0e, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xa0, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0xf0, 0xb0, "2 Coins 4 Credits" }, - {0x0e, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0xf0, 0xc0, "2 Coins 5 Credits" }, - {0x0e, 0x01, 0xf0, 0xd0, "2 Coins 6 Credits" }, - {0x0e, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0xf0, 0xe0, "2 Coins 7 Credits" }, - {0x0e, 0x01, 0xf0, 0xf0, "2 Coins 8 Credits" }, - {0x0e, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x0e, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x0e, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x0e, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x01, 0x00, "Upright" }, - {0x0f, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Condor) - -static struct BurnDIPInfo PhoenixDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x60, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "3K 30K" }, - {0x0c, 0x01, 0x0c, 0x04, "4K 40K" }, - {0x0c, 0x01, 0x0c, 0x08, "5K 50K" }, - {0x0c, 0x01, 0x0c, 0x0c, "6K 60K" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0c, 0x01, 0x10, 0x10, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x10, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Phoenix) - -static struct BurnDIPInfo PhoenixaDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x60, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "3K 30K" }, - {0x0c, 0x01, 0x0c, 0x04, "4K 40K" }, - {0x0c, 0x01, 0x0c, 0x08, "5K 50K" }, - {0x0c, 0x01, 0x0c, 0x0c, "6K 60K" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0c, 0x01, 0x10, 0x00, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x10, 0x10, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Phoenixa) - -static struct BurnDIPInfo PhoenixtDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x60, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "3K 30K" }, - {0x0c, 0x01, 0x0c, 0x04, "4K 40K" }, - {0x0c, 0x01, 0x0c, 0x08, "5K 50K" }, - {0x0c, 0x01, 0x0c, 0x0c, "6K 60K" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Phoenixt) - -static struct BurnDIPInfo Phoenix3DIPList[]= -{ - {0x0d, 0xff, 0xff, 0x60, NULL }, - {0x0f, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0d, 0x01, 0x03, 0x00, "3" }, - {0x0d, 0x01, 0x03, 0x01, "4" }, - {0x0d, 0x01, 0x03, 0x02, "5" }, - {0x0d, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0d, 0x01, 0x0c, 0x00, "3K 30K" }, - {0x0d, 0x01, 0x0c, 0x04, "4K 40K" }, - {0x0d, 0x01, 0x0c, 0x08, "5K 50K" }, - {0x0d, 0x01, 0x0c, 0x0c, "6K 60K" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0d, 0x01, 0x40, 0x40, "A- 2c/1c B-1c/3c" }, - {0x0d, 0x01, 0x40, 0x00, "A- 1c/1c B-1c/6c" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x01, 0x00, "Upright" }, - {0x0f, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Phoenix3) - -static struct BurnDIPInfo FalconzDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x60, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "2" }, - {0x0c, 0x01, 0x03, 0x01, "3" }, - {0x0c, 0x01, 0x03, 0x02, "4" }, - {0x0c, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "3K 30K" }, - {0x0c, 0x01, 0x0c, 0x04, "4K 40K" }, - {0x0c, 0x01, 0x0c, 0x08, "5K 50K" }, - {0x0c, 0x01, 0x0c, 0x0c, "6K 60K" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0c, 0x01, 0x40, 0x00, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x40, 0x40, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Falconz) - -static struct BurnDIPInfo NextfaseDIPList[]= -{ - {0x0c, 0xff, 0xff, 0x60, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "1" }, - {0x0c, 0x01, 0x03, 0x01, "2" }, - {0x0c, 0x01, 0x03, 0x02, "3" }, - {0x0c, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "3K 30K" }, - {0x0c, 0x01, 0x0c, 0x04, "4K 40K" }, - {0x0c, 0x01, 0x0c, 0x08, "5K 50K" }, - {0x0c, 0x01, 0x0c, 0x0c, "6K 60K" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0c, 0x01, 0x60, 0x00, "A - 1c/1c B - 1c/2c" }, - {0x0c, 0x01, 0x60, 0x20, "A - 2c/3c B - 1c/3c" }, - {0x0c, 0x01, 0x60, 0x40, "A - 1c/2c B - 1c/4c" }, - {0x0c, 0x01, 0x60, 0x60, "A - 2c/5c B - 1c/5c" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, -}; - -STDDIPINFO(Nextfase) - -static void bankswitch(INT32 data) -{ - ram_bank = data & 0x01; - - i8080MapMemory(DrvI8085RAM + ram_bank * 0x1000, 0x4000, 0x4fff, MAP_RAM); -} - -#ifdef USE_Z80 -static void __fastcall phoenix_main_write(UINT16 address, UINT8 data) -#else -static void phoenix_main_write(UINT16 address, UINT8 data) -#endif -{ - switch (address & ~0x03ff) - { - case 0x5000: - { - cocktail_mode = (data & 1) && (DrvDips[2] & 1); - bankswitch(data); - palette_bank = (data & 0x02) >> 1; - if (pleiads) { - palette_bank |= (data & 0x04) >> 1; - pleiads_protection_question = data & 0xfc; - pleiads_sound_control_c_w(address - 0x5000, data); - } - } - return; - - case 0x5800: - scrollx = data; - return; - - case 0x6000: // control a - if (phoenixmode) phoenix_sound_control_a_w(address, data); - if (pleiads) pleiads_sound_control_a_w(address, data); - return; - - case 0x6800: // control b - if (phoenixmode) phoenix_sound_control_b_w(address, data); - if (pleiads) pleiads_sound_control_b_w(address, data); - return; - } -} - -static UINT8 pleiads_protection_read() -{ - if (pleiads_protection_question == 0x0c || pleiads_protection_question == 0x30) { - return 0x08; - } - - return 0; -} - -#ifdef USE_Z80 -static UINT8 __fastcall phoenix_main_read(UINT16 address) -#else -static UINT8 phoenix_main_read(UINT16 address) -#endif -{ - switch (address & ~0x03ff) - { - case 0x5000: - return DrvDips[1]; - - case 0x7000: { - UINT8 res = (DrvInputs[0] & 0xf) | (DrvInputs[1+cocktail_mode] << 4); - - if (pleiads) { - res = (res & 0xf7) | pleiads_protection_read(); - } - - return res; - } - - case 0x7800: - return (DrvDips[0] & 0x7f) | (vblank ? 0x80 : 0); - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset(AllRam, 0, RamEnd - AllRam); - - i8080Open(0); - i8080Reset(); - bankswitch(0); - i8080Close(); - - if (phoenixmode) - phoenix_sound_reset(); - - if (pleiads) - pleiads_sound_reset(); - - pleiads_protection_question = 0; - scrollx = 0; - palette_bank = 0; - cocktail_mode = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvI8085ROM = Next; Next += 0x004000; - - DrvGfxROM0 = Next; Next += 0x004000; - DrvGfxROM1 = Next; Next += 0x004000; - - DrvColPROM = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvI8085RAM = Next; Next += 0x002000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[2] = { 0x4000, 0 }; - INT32 XOffs[8] = { STEP8(7,-1) }; - INT32 YOffs[8] = { STEP8(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x1000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x1000); - - GfxDecode(0x0100, 2, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x1000); - - GfxDecode(0x0100, 2, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit(INT32 single_prom) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvI8085ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvI8085ROM + 0x0800, 1, 1)) return 1; - if (BurnLoadRom(DrvI8085ROM + 0x1000, 2, 1)) return 1; - if (BurnLoadRom(DrvI8085ROM + 0x1800, 3, 1)) return 1; - if (BurnLoadRom(DrvI8085ROM + 0x2000, 4, 1)) return 1; - if (BurnLoadRom(DrvI8085ROM + 0x2800, 5, 1)) return 1; - if (BurnLoadRom(DrvI8085ROM + 0x3000, 6, 1)) return 1; - if (BurnLoadRom(DrvI8085ROM + 0x3800, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0800, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0800, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 12, 1)) return 1; - - if (single_prom == 0) { - if (BurnLoadRom(DrvColPROM + 0x0100, 13, 1)) return 1; - } else { - memcpy (DrvColPROM + 0x100, DrvColPROM, 0x100); - - for (INT32 i = 0; i < 0x100; i++) { - DrvColPROM[i] >>= 4; - DrvColPROM[i+0x100] &= 0x0f; - } - } - - DrvGfxDecode(); - } - - i8085Init(0); - i8080Open(0); - i8080MapMemory(DrvI8085ROM, 0x0000, 0x3fff, MAP_ROM); - i8080SetWriteHandler(phoenix_main_write); - i8080SetReadHandler(phoenix_main_read); - i8080Close(); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 PhoenixInit() -{ - phoenixmode = 1; - phoenix_sound_init(); - - return DrvInit(0); -} - -static INT32 CondorInit() -{ - phoenixmode = 1; - phoenix_sound_init(); - - condor = 1; - return DrvInit(0); -} - -static INT32 SinglePromInit() -{ - phoenixmode = 1; - phoenix_sound_init(); - - return DrvInit(1); -} - -static INT32 PleiadsInit() -{ - pleiads = 1; - pleiads_sound_init(0); - - return DrvInit(0); -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - i8080Exit(); - - if (phoenixmode) - phoenix_sound_deinit(); - - if (pleiads) - pleiads_sound_deinit(); - - condor = 0; - pleiads = 0; - phoenixmode = 0; - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pal[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 b0, b1, r, g, b; - - b0 = (DrvColPROM[0x000 + i] >> 0) & 1; - b1 = (DrvColPROM[0x100 + i] >> 0) & 1; - r = (b0 * 0x55) + (b1 * 0xaa); - - b0 = (DrvColPROM[0x000 + i] >> 2) & 1; - b1 = (DrvColPROM[0x100 + i] >> 2) & 1; - g = (b0 * 0x55) + (b1 * 0xaa); - - b0 = (DrvColPROM[0x000 + i] >> 1) & 1; - b1 = (DrvColPROM[0x100 + i] >> 1) & 1; - b = (b0 * 0x55) + (b1 * 0xaa); - - pal[i] = BurnHighCol(r,g,b,0); - } - - INT32 mask = BurnDrvGetPaletteEntries() - 1; - - for (INT32 i = 0; i < 256; i++) - { - DrvPalette[i] = pal[(((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0xe0)) & mask]; - } -} - -static void draw_layer(UINT8 *ram, UINT8 *gfx, INT32 color_offset, INT32 transparent, INT32 xscroll) -{ - for (INT32 offs = 0; offs < 32 * 26; offs++) - { - INT32 sx = (offs % 32) * 8; - INT32 sy = (offs / 32) * 8; - - sx -= xscroll; - - if (sx < 0) sx += 256; // no shit. weird, eh? - dink (fixes background scrolling @ the bottom of the screen) - - if (cocktail_mode) { - sx = 208 - sx; - sy = 248 - sx; - } - - INT32 code = ram[offs]; - INT32 color = ((code & 0xe0) >> 5) + color_offset + (palette_bank << 4); - - if (sx > nScreenWidth || sy > nScreenHeight) continue; - - if (transparent) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, gfx); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, gfx); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(DrvI8085RAM + 0x800 + (ram_bank*0x1000), DrvGfxROM0, 0, 0, scrollx); - if (nBurnLayer & 2) draw_layer(DrvI8085RAM + 0x000 + (ram_bank*0x1000), DrvGfxROM1, 8, 1, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, (condor) ? 0 : 0x0f, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - i8080Open(0); - vblank = 1; - i8080Run(((2750000 / 60)*250)/256); - vblank = 0; - i8080Run(((2750000 / 60)* 6)/256); - i8080Close(); - - if (pBurnSoundOut) { - if (phoenixmode) - phoenix_sound_update(pBurnSoundOut, nBurnSoundLen); - - if (pleiads) - pleiads_sound_update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - i8080Scan(nAction); - - SCAN_VAR(scrollx); - SCAN_VAR(ram_bank); - SCAN_VAR(palette_bank); - SCAN_VAR(pleiads_protection_question); - SCAN_VAR(cocktail_mode); - - i8080Open(0); - bankswitch(ram_bank); - i8080Close(); - } - - return 0; -} - - -// Phoenix (Amstar, set 1) - -static struct BurnRomInfo phoenixRomDesc[] = { - { "ic45", 0x0800, 0x9f68086b, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "ic46", 0x0800, 0x273a4a82, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic47", 0x0800, 0x3d4284b9, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic48", 0x0800, 0xcb5d9915, 1 | BRF_PRG | BRF_ESS }, // 3 - { "h5-ic49.5a", 0x0800, 0xa105e4e7, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "h7-ic51.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "h8-ic52.8a", 0x0800, 0xaff8e9c5, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "b1-ic39.3b", 0x0800, 0x53413e8f, 3 | BRF_GRA }, // 10 Foreground Tiles - { "b2-ic40.4b", 0x0800, 0x0be2ba91, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color PROMs - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenix) -STD_ROM_FN(phoenix) - -struct BurnDriver BurnDrvPhoenix = { - "phoenix", NULL, NULL, NULL, "1980", - "Phoenix (Amstar)\0", NULL, "Amstar", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixRomInfo, phoenixRomName, NULL, NULL, PhoenixInputInfo, PhoenixDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - -// Phoenix (Amstar, set 2) - -static struct BurnRomInfo phoenix2RomDesc[] = { - { "ic45-pg1.1a", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "ic46-pg2.2a", 0x0800, 0x273a4a82, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic47-pg3.3a", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic48-pg4.4a", 0x0800, 0xcb5d9915, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ic49-pg5.5a", 0x0800, 0x73bcd2e1, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ic50-pg6.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ic51-pg7.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ic52-pg8.8a", 0x0800, 0xaff8e9c5, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23-cg1.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24-cg2.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "ic39-cg3.3b", 0x0800, 0x53413e8f, 3 | BRF_GRA }, // 10 Foreground Tiles - { "ic40-cg4.4b", 0x0800, 0x0be2ba91, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color PROMs - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenix2) -STD_ROM_FN(phoenix2) - -struct BurnDriver BurnDrvPhoenix2 = { - "phoenix2", "phoenix", NULL, NULL, "1980", - "Phoenix (Amstar, set 2)\0", NULL, "Amstar", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenix2RomInfo, phoenix2RomName, NULL, NULL, PhoenixInputInfo, PhoenixDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - -// Phoenix (Centuri, set 1) - -static struct BurnRomInfo phoenixaRomDesc[] = { - { "1-ic45.1a", 0x0800, 0xc7a9b499, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "2-ic46.2a", 0x0800, 0xd0e6ae1b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3-ic47.3a", 0x0800, 0x64bf463a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4-ic48.4a", 0x0800, 0x1b20fe62, 1 | BRF_PRG | BRF_ESS }, // 3 - { "h5-ic49.5a", 0x0800, 0xa105e4e7, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "h7-ic51.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "h8-ic52.8a", 0x0800, 0xaff8e9c5, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "b1-ic39.3b", 0x0800, 0x53413e8f, 3 | BRF_GRA }, // 10 Foreground Tiles - { "b2-ic40.4b", 0x0800, 0x0be2ba91, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenixa) -STD_ROM_FN(phoenixa) - -struct BurnDriver BurnDrvPhoenixa = { - "phoenixa", "phoenix", NULL, NULL, "1980", - "Phoenix (Centuri, set 1)\0", NULL, "Amstar (Centuri license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixaRomInfo, phoenixaRomName, NULL, NULL, PhoenixInputInfo, PhoenixaDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (Centuri, set 2) - -static struct BurnRomInfo phoenixbRomDesc[] = { - { "1-ic45.1a", 0x0800, 0xc7a9b499, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "2-ic46.2a", 0x0800, 0xd0e6ae1b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3-ic47.3a", 0x0800, 0x64bf463a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4-ic48.4a", 0x0800, 0x1b20fe62, 1 | BRF_PRG | BRF_ESS }, // 3 - { "phoenixc.49", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "h7-ic51.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "h8-ic52.8a", 0x0800, 0xaff8e9c5, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "phoenixc.39", 0x0800, 0xbb0525ed, 3 | BRF_GRA }, // 10 Foreground Tiles - { "phoenixc.40", 0x0800, 0x4178aa4f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenixb) -STD_ROM_FN(phoenixb) - -struct BurnDriver BurnDrvPhoenixb = { - "phoenixb", "phoenix", NULL, NULL, "1980", - "Phoenix (Centuri, set 2)\0", NULL, "Amstar (Centuri license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixbRomInfo, phoenixbRomName, NULL, NULL, PhoenixInputInfo, PhoenixaDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (D&L bootleg) - -static struct BurnRomInfo phoenixdalRomDesc[] = { - { "dal.a1", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "dal.a2", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dal.a3", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dal.a4", 0x0800, 0x228b76ad, 1 | BRF_PRG | BRF_ESS }, // 3 - { "d2716,dal.a5", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "h7-ic51.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "dal.a8", 0x0800, 0x0a0f92c0, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "dal.b3", 0x0800, 0xbb0525ed, 3 | BRF_GRA }, // 10 Foreground Tiles - { "dal.b4", 0x0800, 0x4178aa4f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenixdal) -STD_ROM_FN(phoenixdal) - -struct BurnDriver BurnDrvPhoenixdal = { - "phoenixdal", "phoenix", NULL, NULL, "1980", - "Phoenix (D&L bootleg)\0", NULL, "bootleg (D&L)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixdalRomInfo, phoenixdalRomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (Taito) - -static struct BurnRomInfo phoenixtRomDesc[] = { - { "phoenix.45", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "phoenix.46", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "phoenix.47", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "phoenix.48", 0x0800, 0xcb65eff8, 1 | BRF_PRG | BRF_ESS }, // 3 - { "phoenix.49", 0x0800, 0xc8a5d6d6, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "h7-ic51.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "phoenix.52", 0x0800, 0xb9915263, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "b1-ic39.3b", 0x0800, 0x53413e8f, 3 | BRF_GRA }, // 10 Foreground Tiles - { "b2-ic40.4b", 0x0800, 0x0be2ba91, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenixt) -STD_ROM_FN(phoenixt) - -struct BurnDriver BurnDrvPhoenixt = { - "phoenixt", "phoenix", NULL, NULL, "1980", - "Phoenix (Taito)\0", NULL, "Amstar (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixtRomInfo, phoenixtRomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (Taito Japan) - -static struct BurnRomInfo phoenixjRomDesc[] = { - { "pn01.45", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "pn02.46", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pn03.47", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pn04.48", 0x0800, 0xdd41f22b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "pn05.49", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "pn06.50", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "pn07.51", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "pn08.52", 0x0800, 0xb9915263, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "pn11.23", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "pn12.24", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "pn09.39", 0x0800, 0x53413e8f, 3 | BRF_GRA }, // 10 Foreground Tiles - { "pn10.40", 0x0800, 0x0be2ba91, 3 | BRF_GRA }, // 11 - - { "pn14.40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "pn13.41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenixj) -STD_ROM_FN(phoenixj) - -struct BurnDriver BurnDrvPhoenixj = { - "phoenixj", "phoenix", NULL, NULL, "1980", - "Phoenix (Taito Japan)\0", NULL, "Amstar (Taito Japan license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixjRomInfo, phoenixjRomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (T.P.N. bootleg) - -static struct BurnRomInfo phoenix3RomDesc[] = { - { "phoenix3.45", 0x0800, 0xa362cda0, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "phoenix3.46", 0x0800, 0x5748f486, 1 | BRF_PRG | BRF_ESS }, // 1 - { "phoenix.47", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "phoenix3.48", 0x0800, 0xb5d97a4d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "h5-ic49.5a", 0x0800, 0xa105e4e7, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "h7-ic51.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "phoenix3.52", 0x0800, 0xd2c5c984, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "b1-ic39.3b", 0x0800, 0x53413e8f, 3 | BRF_GRA }, // 10 Foreground Tiles - { "b2-ic40.4b", 0x0800, 0x0be2ba91, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenix3) -STD_ROM_FN(phoenix3) - -struct BurnDriver BurnDrvPhoenix3 = { - "phoenix3", "phoenix", NULL, NULL, "1980", - "Phoenix (T.P.N. bootleg)\0", NULL, "bootleg (T.P.N.)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenix3RomInfo, phoenix3RomName, NULL, NULL, Phoenix3InputInfo, Phoenix3DIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (Irecsa / G.G.I Corp, set 1) - -static struct BurnRomInfo phoenixcRomDesc[] = { - { "phoenix.45", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "phoenix.46", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "phoenix.47", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "phoenixc.48", 0x0800, 0x5ae0b215, 1 | BRF_PRG | BRF_ESS }, // 3 - { "phoenixc.49", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "h7-ic51.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "phoenixc.52", 0x0800, 0x8424d7c4, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "phoenixc.39", 0x0800, 0xbb0525ed, 3 | BRF_GRA }, // 10 Foreground Tiles - { "phoenixc.40", 0x0800, 0x4178aa4f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenixc) -STD_ROM_FN(phoenixc) - -struct BurnDriver BurnDrvPhoenixc = { - "phoenixc", "phoenix", NULL, NULL, "1981", - "Phoenix (Irecsa / G.G.I Corp, set 1)\0", NULL, "bootleg? (Irecsa / G.G.I Corp)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixcRomInfo, phoenixcRomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (Irecsa / G.G.I Corp, set 2) -// verified main and ROMs PCBs and 2 PROMs - -static struct BurnRomInfo phoenixc2RomDesc[] = { - { "phoenix.45", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "phoenix.46", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "phoenix.47", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "01.ic48", 0x0800, 0xf28e16d8, 1 | BRF_PRG | BRF_ESS }, // 3 - { "phoenixc.49", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "h7-ic51.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "phoenixc.52", 0x0800, 0x8424d7c4, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "phoenixc.39", 0x0800, 0xbb0525ed, 3 | BRF_GRA }, // 10 Foreground Tiles - { "phoenixc.40", 0x0800, 0x4178aa4f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 - - { "tbp24sa10n.183.bin", 0x0100, 0x47f5e887, 5 | BRF_OPT }, // 14 PLDs - { "tbp24sa10n.184.bin", 0x0100, 0x931f3292, 5 | BRF_OPT }, // 15 - { "tbp24sa10n.185.bin", 0x0100, 0x0a06bd1b, 5 | BRF_OPT }, // 16 -}; - -STD_ROM_PICK(phoenixc2) -STD_ROM_FN(phoenixc2) - -struct BurnDriver BurnDrvPhoenixc2 = { - "phoenixc2", "phoenix", NULL, NULL, "1981", - "Phoenix (Irecsa / G.G.I Corp, set 2)\0", NULL, "bootleg? (Irecsa / G.G.I Corp)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixc2RomInfo, phoenixc2RomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (Irecsa / G.G.I Corp, set 3) -// verified main and ROMs PCBs and 2 PROMs - -static struct BurnRomInfo phoenixc3RomDesc[] = { - { "phoenix.45", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "phoenix.46", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "phoenix.47", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.a4", 0x0800, 0x61514bed, 1 | BRF_PRG | BRF_ESS }, // 3 - { "phoenixc.49", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "h7-ic51.7a", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "phoenixc.52", 0x0800, 0x8424d7c4, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "phoenixc.39", 0x0800, 0xbb0525ed, 3 | BRF_GRA }, // 10 Foreground Tiles - { "phoenixc.40", 0x0800, 0x4178aa4f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenixc3) -STD_ROM_FN(phoenixc3) - -struct BurnDriver BurnDrvPhoenixc3 = { - "phoenixc3", "phoenix", NULL, NULL, "1981", - "Phoenix (Irecsa / G.G.I Corp, set 3)\0", NULL, "bootleg? (Irecsa / G.G.I Corp)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixc3RomInfo, phoenixc3RomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (Irecsa / G.G.I Corp, set 4) -// verified main and ROMs PCBs and 2 PROMs - -static struct BurnRomInfo phoenixc4RomDesc[] = { - { "phoenix.45", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "phoenix.46", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "phoenix.47", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "phoenixd.48", 0x0800, 0x6e51f009, 1 | BRF_PRG | BRF_ESS }, // 3 - { "phoenixc.49", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "cond06c.bin", 0x0800, 0x8c83bff7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "vautor07.1m", 0x0800, 0x079ac364, 1 | BRF_PRG | BRF_ESS }, // 6 - { "phoenixc.52", 0x0800, 0x8424d7c4, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "phoenixd.3b", 0x0800, 0x31c06c22, 3 | BRF_GRA }, // 10 Foreground Tiles - { "phoenixc.40", 0x0800, 0x4178aa4f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 12 Color Proms -}; - -STD_ROM_PICK(phoenixc4) -STD_ROM_FN(phoenixc4) - -struct BurnDriver BurnDrvPhoenixc4 = { - "phoenixc4", "phoenix", NULL, NULL, "1981", - "Phoenix (Irecsa / G.G.I Corp, set 4)\0", NULL, "bootleg? (Irecsa / G.G.I Corp)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixc4RomInfo, phoenixc4RomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - SinglePromInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (IDI bootleg) -// verified single PCB, single PROM -// Needs correct color PROM decode - -static struct BurnRomInfo phoenixiRomDesc[] = { - { "0201.bin", 0x0800, 0xc0f73929, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "0202.bin", 0x0800, 0x440d56e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "0203.bin", 0x0800, 0x750b059b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "0204.bin", 0x0800, 0xe2d3271f, 1 | BRF_PRG | BRF_ESS }, // 3 - { "0205.bin", 0x0800, 0x1ff3a982, 1 | BRF_PRG | BRF_ESS }, // 4 - { "0206.bin", 0x0800, 0x8c83bff7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "0207.bin", 0x0800, 0x805ec2e8, 1 | BRF_PRG | BRF_ESS }, // 6 - // 0208.bin wasn't readable, but very probably matches the one from condor - { "cond08c.bin", 0x0800, 0x1edebb45, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "0209.bin", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "0210.bin", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "0211.bin", 0x0800, 0x53c52eb0, 3 | BRF_GRA }, // 10 Foreground Tiles - { "0212.bin", 0x0800, 0xeba42f0f, 3 | BRF_GRA }, // 11 - - { "sn74s471n.bin", 0x0100, 0xc68a49bc, 4 | BRF_GRA }, // 12 Color Proms -}; - -STD_ROM_PICK(phoenixi) -STD_ROM_FN(phoenixi) - -struct BurnDriver BurnDrvPhoenixi = { - "phoenixi", "phoenix", NULL, NULL, "1981", - "Phoenix (IDI bootleg)\0", NULL, "bootleg (IDI)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixiRomInfo, phoenixiRomName, NULL, NULL, CondorInputInfo, CondorDIPInfo, - SinglePromInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Condor (Sidam bootleg of Phoenix) - -static struct BurnRomInfo condorRomDesc[] = { - { "cond01c.bin", 0x0800, 0xc0f73929, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "cond02c.bin", 0x0800, 0x440d56e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cond03c.bin", 0x0800, 0x750b059b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "cond04c.bin", 0x0800, 0xca55e1dd, 1 | BRF_PRG | BRF_ESS }, // 3 - { "cond05c.bin", 0x0800, 0x1ff3a982, 1 | BRF_PRG | BRF_ESS }, // 4 - { "cond06c.bin", 0x0800, 0x8c83bff7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "cond07c.bin", 0x0800, 0x805ec2e8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "cond08c.bin", 0x0800, 0x1edebb45, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "cond09c.bin", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "cond10c.bin", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "cond11c.bin", 0x0800, 0x53c52eb0, 3 | BRF_GRA }, // 10 Foreground Tiles - { "cond12c.bin", 0x0800, 0xeba42f0f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(condor) -STD_ROM_FN(condor) - -struct BurnDriver BurnDrvCondor = { - "condor", "phoenix", NULL, NULL, "1981", - "Condor (Sidam bootleg of Phoenix)\0", NULL, "bootleg (Sidam)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, condorRomInfo, condorRomName, NULL, NULL, CondorInputInfo, CondorDIPInfo, - CondorInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Condor (S C Novar bootleg of Phoenix) - -static struct BurnRomInfo condornRomDesc[] = { - { "1.bin", 0x0800, 0xc0f73929, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2.bin", 0x0800, 0x440d56e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.bin", 0x0800, 0x750b059b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.bin", 0x0800, 0x78416372, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.bin", 0x0800, 0x1ff3a982, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6.bin", 0x0800, 0x8c83bff7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "7.bin", 0x0800, 0x805ec2e8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8.bin", 0x0800, 0x1edebb45, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "c.bin", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "d.bin", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "a.bin", 0x0800, 0xcdd5ef12, 3 | BRF_GRA }, // 10 Foreground Tiles - { "b.bin", 0x0800, 0xeba42f0f, 3 | BRF_GRA }, // 11 - - { "sn74s471n.bin", 0x0100, 0xc68a49bc, 4 | BRF_GRA }, // 12 Color Proms -}; - -STD_ROM_PICK(condorn) -STD_ROM_FN(condorn) - -struct BurnDriver BurnDrvCondorn = { - "condorn", "phoenix", NULL, NULL, "1981", - "Condor (S C Novar bootleg of Phoenix)\0", NULL, "bootleg (S C Novar)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, condornRomInfo, condornRomName, NULL, NULL, CondorInputInfo, CondorDIPInfo, - SinglePromInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Falcon (bootleg of Phoenix) (8085A CPU) - -static struct BurnRomInfo falconRomDesc[] = { - { "falcon.45", 0x0800, 0x80382b6c, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "falcon.46", 0x0800, 0x6a13193b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "phoenix.47", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "falcon.48", 0x0800, 0x084e9766, 1 | BRF_PRG | BRF_ESS }, // 3 - { "phoenixc.49", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "h6-ic50.6a", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "falcon.51", 0x0800, 0x6e82e400, 1 | BRF_PRG | BRF_ESS }, // 6 - { "h8-ic52.8a", 0x0800, 0xaff8e9c5, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "b1-ic39.3b", 0x0800, 0x53413e8f, 3 | BRF_GRA }, // 10 Foreground Tiles - { "b2-ic40.4b", 0x0800, 0x0be2ba91, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(falcon) -STD_ROM_FN(falcon) - -struct BurnDriver BurnDrvFalcon = { - "falcon", "phoenix", NULL, NULL, "1980", - "Falcon (bootleg of Phoenix) (8085A CPU)\0", NULL, "bootleg (BGV Ltd.)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, falconRomInfo, falconRomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Vautour (bootleg of Phoenix) (8085A CPU) - -static struct BurnRomInfo vautourRomDesc[] = { - { "vautor01.1e", 0x0800, 0xcd2807ee, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "phoenix.46", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "phoenix.47", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "vautor04.1j", 0x0800, 0x106262eb, 1 | BRF_PRG | BRF_ESS }, // 3 - { "phoenixc.49", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "vautor06.1h", 0x0800, 0xc90e3287, 1 | BRF_PRG | BRF_ESS }, // 5 - { "vautor07.1m", 0x0800, 0x079ac364, 1 | BRF_PRG | BRF_ESS }, // 6 - { "vautor08.1n", 0x0800, 0x1dbd937a, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "vautor12.2h", 0x0800, 0x8eff75c9, 3 | BRF_GRA }, // 10 Foreground Tiles - { "vautor11.2j", 0x0800, 0x369e7476, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(vautour) -STD_ROM_FN(vautour) - -struct BurnDriver BurnDrvVautour = { - "vautour", "phoenix", NULL, NULL, "1980", - "Vautour (bootleg of Phoenix) (8085A CPU)\0", NULL, "bootleg (Jeutel)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, vautourRomInfo, vautourRomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Vautour (bootleg of Phoenix) (Z80 CPU, single PROM) - -static struct BurnRomInfo vautourzaRomDesc[] = { - { "1.e1", 0x0800, 0xcd2807ee, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2.f1", 0x0800, 0x3699b11a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.h1", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.j1", 0x0800, 0x106262eb, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.k1", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6.h1", 0x0800, 0x1fcac707, 1 | BRF_PRG | BRF_ESS }, // 5 - { "7.m1", 0x0800, 0x805ec2e8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8.n1", 0x0800, 0x1edebb45, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "10.h2", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "9.j2", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "12.h4", 0x0800, 0x8eff75c9, 3 | BRF_GRA }, // 10 Foreground Tiles - { "11.j4", 0x0800, 0x369e7476, 3 | BRF_GRA }, // 11 - - { "82s135.m9", 0x0100, 0xc68a49bc, 4 | BRF_GRA }, // 12 Color Proms -}; - -STD_ROM_PICK(vautourza) -STD_ROM_FN(vautourza) - -struct BurnDriver BurnDrvVautourza = { - "vautourza", "phoenix", NULL, NULL, "1980", - "Vautour (bootleg of Phoenix) (Z80 CPU, single PROM)\0", NULL, "bootleg (Jeutel)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, vautourzaRomInfo, vautourzaRomName, NULL, NULL, PhoenixInputInfo, PhoenixtDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Falcon (bootleg of Phoenix) (Z80 CPU) - -static struct BurnRomInfo falconzRomDesc[] = { - { "f45.bin", 0x0800, 0x9158b43b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "f46.bin", 0x0800, 0x22ddb600, 1 | BRF_PRG | BRF_ESS }, // 1 - { "f47.bin", 0x0800, 0xcb2838d9, 1 | BRF_PRG | BRF_ESS }, // 2 - { "f48.bin", 0x0800, 0x552cf57a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "f49.bin", 0x0800, 0x1ff3a982, 1 | BRF_PRG | BRF_ESS }, // 4 - { "f50.bin", 0x0800, 0x8c83bff7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "f51.bin", 0x0800, 0x805ec2e8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "f52.bin", 0x0800, 0x33f3af63, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "f39.bin", 0x0800, 0x53c52eb0, 3 | BRF_GRA }, // 10 Foreground Tiles - { "f40.bin", 0x0800, 0xeba42f0f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(falconz) -STD_ROM_FN(falconz) - -struct BurnDriver BurnDrvFalconz = { - "falconz", "phoenix", NULL, NULL, "1980", - "Falcon (bootleg of Phoenix) (Z80 CPU)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, falconzRomInfo, falconzRomName, NULL, NULL, PhoenixInputInfo, FalconzDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Vautour (bootleg of Phoenix) (Z80 CPU) - -static struct BurnRomInfo vautourzRomDesc[] = { - { "vautour1.bin", 0x0800, 0xa600f6a4, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "vautour2.bin", 0x0800, 0x3699b11a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "vautour3.bin", 0x0800, 0x750b059b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "vautour4.bin", 0x0800, 0x01a4bfde, 1 | BRF_PRG | BRF_ESS }, // 3 - { "vautour5.bin", 0x0800, 0x1ff3a982, 1 | BRF_PRG | BRF_ESS }, // 4 - { "vautour6.bin", 0x0800, 0x8c83bff7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "vautour7.bin", 0x0800, 0x805ec2e8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "vautour8.bin", 0x0800, 0x1edebb45, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "vautor12.2h", 0x0800, 0x8eff75c9, 3 | BRF_GRA }, // 10 Foreground Tiles - { "vautor11.2j", 0x0800, 0x369e7476, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(vautourz) -STD_ROM_FN(vautourz) - -struct BurnDriver BurnDrvVautourz = { - "vautourz", "phoenix", NULL, NULL, "1980", - "Vautour (bootleg of Phoenix) (Z80 CPU)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, vautourzRomInfo, vautourzRomName, NULL, NULL, CondorInputInfo, CondorDIPInfo, - CondorInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Fenix (bootleg of Phoenix) -// verified single PCB, single PROM - -static struct BurnRomInfo fenixRomDesc[] = { - { "0.1e", 0x0800, 0x00000000, 1 | BRF_NODUMP | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "1.1f", 0x0800, 0x3699b11a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2.1h", 0x0800, 0x750b059b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3.1j", 0x0800, 0x61b8a41b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "4.1k", 0x0800, 0x1ff3a982, 1 | BRF_PRG | BRF_ESS }, // 4 - { "5.1l", 0x0800, 0xa210fe51, 1 | BRF_PRG | BRF_ESS }, // 5 - { "6.1m", 0x0800, 0x805ec2e8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "7.1n", 0x0800, 0x1edebb45, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "9.2h", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "8.2j", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "11.3h", 0x0800, 0x8eff75c9, 3 | BRF_GRA }, // 10 Foreground Tiles - { "10.3j", 0x0800, 0x369e7476, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(fenix) -STD_ROM_FN(fenix) - -struct BurnDriver BurnDrvFenix = { - "fenix", "phoenix", NULL, NULL, "1980", - "Fenix (bootleg of Phoenix)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, fenixRomInfo, fenixRomName, NULL, NULL, CondorInputInfo, CondorDIPInfo, - CondorInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Ave Fenix (Electrogame, Spanish bootleg of Phoenix) - -static struct BurnRomInfo avefenixRomDesc[] = { - { "4101-8516.rom", 0x0800, 0x5bc2e2fe, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "4102-2716.rom", 0x0800, 0xdcf2cc3e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4103-8516.rom", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4104-8516.rom", 0x0800, 0x8380a581, 1 | BRF_PRG | BRF_ESS }, // 3 - { "4105-8516.rom", 0x0800, 0xcfa8cb51, 1 | BRF_PRG | BRF_ESS }, // 4 - { "4106-8516.rom", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "4107-8516.rom", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "4108-8516.rom", 0x0800, 0xf15c439d, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "41011-8516.rom", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "41012-8516.rom", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "4109-8516.rom", 0x0800, 0x53413e8f, 3 | BRF_GRA }, // 10 Foreground Tiles - { "41010-8516.rom", 0x0800, 0x0be2ba91, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(avefenix) -STD_ROM_FN(avefenix) - -struct BurnDriver BurnDrvAvefenix = { - "avefenix", "phoenix", NULL, NULL, "1980", - "Ave Fenix (Electrogame, Spanish bootleg of Phoenix)\0", NULL, "bootleg (Video Game)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, avefenixRomInfo, avefenixRomName, NULL, NULL, PhoenixInputInfo, PhoenixDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Ave Fenix (Recreativos Franco, Spanish bootleg of Phoenix) - -static struct BurnRomInfo avefenixrfRomDesc[] = { - { "601-ic45.a1", 0x0800, 0xb04260e9, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "6002-ic46.a2", 0x0800, 0x25a2e4bd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "0003-ic47.a3", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "6004-ic48.a4", 0x0800, 0x4b7701b4, 1 | BRF_PRG | BRF_ESS }, // 3 - { "6005-ic49.a5", 0x0800, 0x1ab92ef9, 1 | BRF_PRG | BRF_ESS }, // 4 - { "0006-ic50.a6", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "6007-ic51.a7", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "f008-ic52.a8", 0x0800, 0x3719fc84, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "0011-ic23.d3", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "0012-ic24.d4", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "0009-ic39.b3", 0x0800, 0xbb0525ed, 3 | BRF_GRA }, // 10 Foreground Tiles - { "0010-ic40.b4", 0x0800, 0x4178aa4f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(avefenixrf) -STD_ROM_FN(avefenixrf) - -struct BurnDriver BurnDrvAvefenixrf = { - "avefenixrf", "phoenix", NULL, NULL, "1981", - "Ave Fenix (Recreativos Franco, Spanish bootleg of Phoenix)\0", NULL, "bootleg (Recreativos Franco S.A.)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, avefenixrfRomInfo, avefenixrfRomName, NULL, NULL, PhoenixInputInfo, PhoenixDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Ave Fenix (Laguna, Spanish bootleg of Phoenix) - -static struct BurnRomInfo avefenixlRomDesc[] = { - { "01_ic45.a1", 0x0800, 0x2c53998c, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "02_ic46.a2", 0x0800, 0xfea2435c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "03_ic47.a3", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "04_ic48.a4", 0x0800, 0x90a02a45, 1 | BRF_PRG | BRF_ESS }, // 3 - { "05_ic49.a5", 0x0800, 0x74b1cf66, 1 | BRF_PRG | BRF_ESS }, // 4 - { "06_ic50.a6", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "07_ic51.a7", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "08_ic52.a8", 0x0800, 0xf15c439d, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "11_ic23.d3", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "12_ic24.d4", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "09_ic39.b3", 0x0800, 0xbb0525ed, 3 | BRF_GRA }, // 10 Foreground Tiles - { "10_ic40.b4", 0x0800, 0x4178aa4f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(avefenixl) -STD_ROM_FN(avefenixl) - -struct BurnDriver BurnDrvAvefenixl = { - "avefenixl", "phoenix", NULL, NULL, "1980", - "Ave Fenix (Laguna, Spanish bootleg of Phoenix)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, avefenixlRomInfo, avefenixlRomName, NULL, NULL, PhoenixInputInfo, PhoenixDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Griffon (bootleg of Phoenix) -// verified single PCB, single PROM - -static struct BurnRomInfo griffonRomDesc[] = { - { "griffon0.a5", 0x0800, 0xc0f73929, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "griffon1.a6", 0x0800, 0x3cc33e4a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "griffon2.a7", 0x0800, 0x750b059b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "griffon3.a8", 0x0800, 0x5e49f5b5, 1 | BRF_PRG | BRF_ESS }, // 3 - { "griffon4.a9", 0x0800, 0x87a45ceb, 1 | BRF_PRG | BRF_ESS }, // 4 - { "griffon5.a10", 0x0800, 0x8c83bff7, 1 | BRF_PRG | BRF_ESS }, // 5 - { "griffon6.a11", 0x0800, 0x805ec2e8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "griffon7.a12", 0x0800, 0x55e68cb1, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.3d", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.4d", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "griffon.d7", 0x0800, 0x53c52eb0, 3 | BRF_GRA }, // 10 Foreground Tiles - { "griffon.d8", 0x0800, 0xeba42f0f, 3 | BRF_GRA }, // 11 - - { "sn74s471n.bin", 0x0100, 0xc68a49bc, 4 | BRF_GRA }, // 12 Color Proms -}; - -STD_ROM_PICK(griffon) -STD_ROM_FN(griffon) - -struct BurnDriver BurnDrvGriffon = { - "griffon", "phoenix", NULL, NULL, "1980", - "Griffon (bootleg of Phoenix)\0", NULL, "bootleg (Videotron)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, griffonRomInfo, griffonRomName, NULL, NULL, CondorInputInfo, CondorDIPInfo, - SinglePromInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Next Fase (bootleg of Phoenix) - -static struct BurnRomInfo nextfaseRomDesc[] = { - { "nf01.bin", 0x0800, 0xb31ce820, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "nf02.bin", 0x0800, 0x891d21e1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "nf03.bin", 0x0800, 0x2ab7389d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "nf04.bin", 0x0800, 0x590d3c36, 1 | BRF_PRG | BRF_ESS }, // 3 - { "nf05.bin", 0x0800, 0x3527f247, 1 | BRF_PRG | BRF_ESS }, // 4 - { "nf06.bin", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "nf07.bin", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "nf08.bin", 0x0800, 0x04c2323f, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "nf11.bin", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "nf12.bin", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "nf09.bin", 0x0800, 0xbacbfa88, 3 | BRF_GRA }, // 10 Foreground Tiles - { "nf10.bin", 0x0800, 0x3143a9ee, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(nextfase) -STD_ROM_FN(nextfase) - -struct BurnDriver BurnDrvNextfase = { - "nextfase", "phoenix", NULL, NULL, "1980", - "Next Fase (bootleg of Phoenix)\0", NULL, "bootleg (Petaco S.A.)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, nextfaseRomInfo, nextfaseRomName, NULL, NULL, PhoenixInputInfo, NextfaseDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - - -// Phoenix (Sonic, Spanish bootleg) - -static struct BurnRomInfo phoenixsRomDesc[] = { - { "ic45.1_a1", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "ic46.2_a2", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic47.3_a3", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic48.4_a4", 0x0800, 0x25c8b83f, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ic49.5_a5", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ic50.6_a6", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ic51.7_a7", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ic52.8_a8", 0x0800, 0x3657f69b, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.11_d3", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.12_d4", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "ic39.9_b3", 0x0800, 0x14ccdf63, 3 | BRF_GRA }, // 10 Foreground Tiles - { "ic40.10_b4", 0x0800, 0xeba42f0f, 3 | BRF_GRA }, // 11 - - { "mmi6301.ic40", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 12 Color Proms - { "mmi6301.ic41", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenixs) -STD_ROM_FN(phoenixs) - -struct BurnDriver BurnDrvPhoenixs = { - "phoenixs", "phoenix", NULL, NULL, "1981", - "Phoenix (Sonic, Spanish bootleg)\0", NULL, "bootleg (Sonic)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixsRomInfo, phoenixsRomName, NULL, NULL, PhoenixInputInfo, PhoenixDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Phoenix (Assa, Spanish bootleg) - -static struct BurnRomInfo phoenixassRomDesc[] = { - { "ic45.bin", 0x0800, 0x5b8c55a8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "ic46.bin", 0x0800, 0xdbc942fa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic47.bin", 0x0800, 0xcbbb8839, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic48.bin", 0x0800, 0x1e2e2fc7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ic49.bin", 0x0800, 0x1a1ce0d0, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ic50.bin", 0x0800, 0xac5e9ec1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ic51.bin", 0x0800, 0x2eab35b4, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ic52.bin", 0x0800, 0x15a02d87, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.bin", 0x0800, 0x3c7e623f, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.bin", 0x0800, 0x59916d3b, 2 | BRF_GRA }, // 9 - - { "ic39.bin", 0x0800, 0xbb0525ed, 3 | BRF_GRA }, // 10 Foreground Tiles - { "ic40.bin", 0x0800, 0x4178aa4f, 3 | BRF_GRA }, // 11 - - { "prom.41", 0x0100, 0x7c9f2e00, 4 | BRF_GRA }, // 12 Color Proms - { "prom.40", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(phoenixass) -STD_ROM_FN(phoenixass) - -struct BurnDriver BurnDrvPhoenixass = { - "phoenixass", "phoenix", NULL, NULL, "1981", - "Phoenix (Assa, Spanish bootleg)\0", NULL, "bootleg (Assa)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, phoenixassRomInfo, phoenixassRomName, NULL, NULL, PhoenixInputInfo, PhoenixDIPInfo, - PhoenixInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 208, 256, 3, 4 -}; - - -// Pleiads (Tehkan) - -static struct BurnRomInfo pleiadsRomDesc[] = { - { "ic47.r1", 0x0800, 0x960212c8, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "ic48.r2", 0x0800, 0xb254217c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic47.bin", 0x0800, 0x87e700bb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic48.bin", 0x0800, 0x2d5198d0, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ic51.r5", 0x0800, 0x49c629bc, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ic50.bin", 0x0800, 0xf1a8a00d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ic53.r7", 0x0800, 0xb5f07fbc, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ic52.bin", 0x0800, 0xb1b5a8a6, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.bin", 0x0800, 0x4e30f9e7, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.bin", 0x0800, 0x5188fc29, 2 | BRF_GRA }, // 9 - - { "ic39.bin", 0x0800, 0x85866607, 3 | BRF_GRA }, // 10 Foreground Tiles - { "ic40.bin", 0x0800, 0xa841d511, 3 | BRF_GRA }, // 11 - - { "7611-5.33", 0x0100, 0xe38eeb83, 4 | BRF_GRA }, // 12 Color Proms - { "7611-5.26", 0x0100, 0x7a1bcb1e, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(pleiads) -STD_ROM_FN(pleiads) - -struct BurnDriver BurnDrvPleiads = { - "pleiads", NULL, NULL, NULL, "1981", - "Pleiads (Tehkan)\0", NULL, "Tehkan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pleiadsRomInfo, pleiadsRomName, NULL, NULL, PleiadsInputInfo, PleiadsDIPInfo, - PleiadsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 208, 256, 3, 4 -}; - - -// Pleiads (bootleg set 2) - -static struct BurnRomInfo pleiadsb2RomDesc[] = { - { "ic47.r1", 0x0800, 0xfa98cb73, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "ic48.r2", 0x0800, 0xb254217c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic47.bin", 0x0800, 0x0951829e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic48.bin", 0x0800, 0x4972f5ce, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ic51.r5", 0x0800, 0x49c629bc, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ic50.bin", 0x0800, 0xf1a8a00d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ic53.r7", 0x0800, 0x037b319c, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ic52.bin", 0x0800, 0xb3db08c2, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.bin", 0x0800, 0x4e30f9e7, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.bin", 0x0800, 0x5188fc29, 2 | BRF_GRA }, // 9 - - { "ic39.bin", 0x0800, 0x85866607, 3 | BRF_GRA }, // 10 Foreground Tiles - { "ic40.bin", 0x0800, 0xa841d511, 3 | BRF_GRA }, // 11 - - { "7611-5.26", 0x0100, 0x7a1bcb1e, 4 | BRF_GRA }, // 12 Color Proms - { "7611-5.33", 0x0100, 0xe38eeb83, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(pleiadsb2) -STD_ROM_FN(pleiadsb2) - -struct BurnDriver BurnDrvPleiadsb2 = { - "pleiadsb2", "pleiads", NULL, NULL, "1981", - "Pleiads (bootleg set 2)\0", NULL, "bootleg (ESG)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pleiadsb2RomInfo, pleiadsb2RomName, NULL, NULL, PleiadsInputInfo, PleiadsDIPInfo, - PleiadsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 208, 256, 3, 4 -}; - - -// Pleiads (bootleg set 1) - -static struct BurnRomInfo pleiadblRomDesc[] = { - { "ic45.bin", 0x0800, 0x93fc2958, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "ic46.bin", 0x0800, 0xe2b5b8cd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic47.bin", 0x0800, 0x87e700bb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic48.bin", 0x0800, 0x2d5198d0, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ic49.bin", 0x0800, 0x9dc73e63, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ic50.bin", 0x0800, 0xf1a8a00d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ic51.bin", 0x0800, 0x6f56f317, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ic52.bin", 0x0800, 0xb1b5a8a6, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ic23.bin", 0x0800, 0x4e30f9e7, 2 | BRF_GRA }, // 8 Background Tiles - { "ic24.bin", 0x0800, 0x5188fc29, 2 | BRF_GRA }, // 9 - - { "ic39.bin", 0x0800, 0x85866607, 3 | BRF_GRA }, // 10 Foreground Tiles - { "ic40.bin", 0x0800, 0xa841d511, 3 | BRF_GRA }, // 11 - - { "7611-5.33", 0x0100, 0xe38eeb83, 4 | BRF_GRA }, // 12 Color Proms - { "7611-5.26", 0x0100, 0x7a1bcb1e, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(pleiadbl) -STD_ROM_FN(pleiadbl) - -struct BurnDriver BurnDrvPleiadbl = { - "pleiadbl", "pleiads", NULL, NULL, "1981", - "Pleiads (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pleiadblRomInfo, pleiadblRomName, NULL, NULL, PhoenixInputInfo, PleiadblDIPInfo, - PleiadsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 208, 256, 3, 4 -}; - - -// Pleiads (Centuri) - -static struct BurnRomInfo pleiadceRomDesc[] = { - { "pleiades.47", 0x0800, 0x711e2ba0, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "pleiades.48", 0x0800, 0x93a36943, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic47.bin", 0x0800, 0x87e700bb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pleiades.50", 0x0800, 0x5a9beba0, 1 | BRF_PRG | BRF_ESS }, // 3 - { "pleiades.51", 0x0800, 0x1d828719, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ic50.bin", 0x0800, 0xf1a8a00d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "pleiades.53", 0x0800, 0x037b319c, 1 | BRF_PRG | BRF_ESS }, // 6 - { "pleiades.54", 0x0800, 0xca264c7c, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "pleiades.45", 0x0800, 0x8dbd3785, 2 | BRF_GRA }, // 8 Background Tiles - { "pleiades.44", 0x0800, 0x0db3e436, 2 | BRF_GRA }, // 9 - - { "ic39.bin", 0x0800, 0x85866607, 3 | BRF_GRA }, // 10 Foreground Tiles - { "ic40.bin", 0x0800, 0xa841d511, 3 | BRF_GRA }, // 11 - - { "7611-5.33", 0x0100, 0xe38eeb83, 4 | BRF_GRA }, // 12 Color Proms - { "7611-5.26", 0x0100, 0x7a1bcb1e, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(pleiadce) -STD_ROM_FN(pleiadce) - -struct BurnDriver BurnDrvPleiadce = { - "pleiadce", "pleiads", NULL, NULL, "1981", - "Pleiads (Centuri)\0", NULL, "Tehkan (Centuri license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pleiadceRomInfo, pleiadceRomName, NULL, NULL, PhoenixInputInfo, PleiadceDIPInfo, - PleiadsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 208, 256, 3, 4 -}; - - -// Pleiads (Irecsa) - -static struct BurnRomInfo pleiadsiRomDesc[] = { - { "1 2716.bin", 0x0800, 0x9bbef607, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "2 2716.bin", 0x0800, 0xe2b5b8cd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3 2716.bin", 0x0800, 0x87e700bb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4 2716.bin", 0x0800, 0xca14fe4a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5 2716.bin", 0x0800, 0x9dc73e63, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6 2716.bin", 0x0800, 0xf1a8a00d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "7 2716.bin", 0x0800, 0x6f56f317, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8 2716.bin", 0x0800, 0xca264c7c, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "11 2716.bin", 0x0800, 0x8dbd3785, 2 | BRF_GRA }, // 8 Background Tiles - { "12 2716.bin", 0x0800, 0x0db3e436, 2 | BRF_GRA }, // 9 - - { "9 2716.bin", 0x0800, 0x85866607, 3 | BRF_GRA }, // 10 Foreground Tiles - { "10 2716.bin", 0x0800, 0xa841d511, 3 | BRF_GRA }, // 11 - - { "7611-5.26", 0x0100, 0x7a1bcb1e, 4 | BRF_GRA }, // 12 Color Proms - { "7611-5.33", 0x0100, 0xe38eeb83, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(pleiadsi) -STD_ROM_FN(pleiadsi) - -struct BurnDriver BurnDrvPleiadsi = { - "pleiadsi", "pleiads", NULL, NULL, "1981", - "Pleiads (Irecsa)\0", NULL, "bootleg? (Irecsa)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pleiadsiRomInfo, pleiadsiRomName, NULL, NULL, PhoenixInputInfo, PleiadceDIPInfo, - PleiadsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 208, 256, 3, 4 -}; - - -// Pleiads (Niemer S.A.) - -static struct BurnRomInfo pleiadsnRomDesc[] = { - { "1.bin", 0x0800, 0xc013515f, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "2.bin", 0x0800, 0xb254217c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.bin", 0x0800, 0x3b29aec5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.bin", 0x0800, 0x1fbde4d7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.bin", 0x0800, 0x9dc73e63, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6.bin", 0x0800, 0xf1a8a00d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "7.bin", 0x0800, 0xb5f07fbc, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8.bin", 0x0800, 0xb3db08c2, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "11.bin", 0x0800, 0x4e30f9e7, 2 | BRF_GRA }, // 8 Background Tiles - { "12.bin", 0x0800, 0x72d511fc, 2 | BRF_GRA }, // 9 - - { "9.bin", 0x0800, 0x85866607, 3 | BRF_GRA }, // 10 Foreground Tiles - { "10.bin", 0x0800, 0xa841d511, 3 | BRF_GRA }, // 11 - - { "hm3-7611.bin", 0x0100, 0xe38eeb83, 4 | BRF_GRA }, // 12 Color Proms - { "mb7052.ic41", 0x0100, 0x7a1bcb1e, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(pleiadsn) -STD_ROM_FN(pleiadsn) - -struct BurnDriver BurnDrvPleiadsn = { - "pleiadsn", "pleiads", NULL, NULL, "1981", - "Pleiads (Niemer S.A.)\0", NULL, "Niemer S.A.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pleiadsnRomInfo, pleiadsnRomName, NULL, NULL, PhoenixInputInfo, PleiadceDIPInfo, - PleiadsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 208, 256, 3, 4 -}; - - -// Pleiads (Spanish bootleg) - -static struct BurnRomInfo pleiadssRomDesc[] = { - { "pl45.bin", 0x0800, 0xe2528599, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "pl46.bin", 0x0800, 0xb254217c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pl47.bin", 0x0800, 0x3b29aec5, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pl48.bin", 0x0800, 0xe74ccdeb, 1 | BRF_PRG | BRF_ESS }, // 3 - { "pl49.bin", 0x0800, 0x24f9c3e8, 1 | BRF_PRG | BRF_ESS }, // 4 - { "pl50.bin", 0x0800, 0xf1a8a00d, 1 | BRF_PRG | BRF_ESS }, // 5 - { "pl51.bin", 0x0800, 0xb5f07fbc, 1 | BRF_PRG | BRF_ESS }, // 6 - { "pl52.bin", 0x0800, 0xb3db08c2, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "pl24.bin", 0x0800, 0x5188fc29, 2 | BRF_GRA }, // 8 Background Tiles - { "pl23.bin", 0x0800, 0x4e30f9e7, 2 | BRF_GRA }, // 9 - - { "pl39.bin", 0x0800, 0x71635678, 3 | BRF_GRA }, // 10 Foreground Tiles - { "pl40.bin", 0x0800, 0xa841d511, 3 | BRF_GRA }, // 11 - - { "ic41.prm", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 12 Color Proms - { "ic40.prm", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(pleiadss) -STD_ROM_FN(pleiadss) - -struct BurnDriver BurnDrvPleiadss = { - "pleiadss", "pleiads", NULL, NULL, "1981", - "Pleiads (Spanish bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pleiadssRomInfo, pleiadssRomName, NULL, NULL, PhoenixInputInfo, PleiadceDIPInfo, - PleiadsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 208, 256, 3, 4 -}; - - -// Capitol - -static struct BurnRomInfo capitolRomDesc[] = { - { "cp1.45", 0x0800, 0x0922905b, 1 | BRF_PRG | BRF_ESS }, // 0 i8085 Code - { "cp2.46", 0x0800, 0x4f168f45, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cp3.47", 0x0800, 0x3975e0b0, 1 | BRF_PRG | BRF_ESS }, // 2 - { "cp4.48", 0x0800, 0xda49caa8, 1 | BRF_PRG | BRF_ESS }, // 3 - { "cp5.49", 0x0800, 0x38e4362b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "cp6.50", 0x0800, 0xaaf798eb, 1 | BRF_PRG | BRF_ESS }, // 5 - { "cp7.51", 0x0800, 0xeaadf14c, 1 | BRF_PRG | BRF_ESS }, // 6 - { "cp8.52", 0x0800, 0xd3fe2af4, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "cp11.23", 0x0800, 0x9b0bbb8d, 2 | BRF_GRA }, // 8 Background Tiles - { "cp12.24", 0x0800, 0x39949e66, 2 | BRF_GRA }, // 9 - - { "cp9.39", 0x0800, 0x04f7d19a, 3 | BRF_GRA }, // 10 Foreground Tiles - { "cp10.40", 0x0800, 0x4807408f, 3 | BRF_GRA }, // 11 - - { "ic41.prm", 0x0100, 0xe176b768, 4 | BRF_GRA }, // 12 Color Proms - { "ic40.prm", 0x0100, 0x79350b25, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(capitol) -STD_ROM_FN(capitol) - -struct BurnDriver BurnDrvCapitol = { - "capitol", "pleiads", NULL, NULL, "1981", - "Capitol\0", NULL, "bootleg? (Universal Video Spiel)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, capitolRomInfo, capitolRomName, NULL, NULL, PleiadsInputInfo, PleiadsDIPInfo, - PleiadsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 208, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_pkunwar.cpp b/jan/src/burn/drv/pre90s/d_pkunwar.cpp deleted file mode 100644 index 928e450bd..000000000 --- a/jan/src/burn/drv/pre90s/d_pkunwar.cpp +++ /dev/null @@ -1,1907 +0,0 @@ -// FB Alpha Penguin-Kun Wars Driver Module -// Based on MAME Driver by David Haywood and Phil Stroffolino - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { - #include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvSubROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvMainRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSubRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[8]; - -static INT32 flipscreen; -static INT32 xscroll; -static INT32 yscroll; -static INT32 vblank; -static INT32 watchdog; -static UINT8 ninjakun_ioctrl; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy2 + 7, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy1 + 5, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 2, "p1 fire 1" }, - - {"P2 start" , BIT_DIGITAL , DrvJoy2 + 5, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 2, "p2 fire 1" }, - - {"Service Mode", BIT_DIGITAL, DrvJoy2 + 6, "diag" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo Nova2001InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 2, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Nova2001) - -static struct BurnInputInfo NinjakunInputList[] = { - {"P1 coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 5, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ninjakun) - -static struct BurnInputInfo Raiders5InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Raiders5) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x0b, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0b, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x03, 0x02, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x04, 0x00, "Upright" }, - {0x0b, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0x30, 0x10, "Easy" }, - {0x0b, 0x01, 0x30, 0x30, "Medium" }, - {0x0b, 0x01, 0x30, 0x20, "Hard" }, - {0x0b, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Flip screen" }, - {0x0b, 0x01, 0x40, 0x40, "Off" }, - {0x0b, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x0b, 0x01, 0x80, 0x80, "Off" }, - {0x0b, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo Nova2001DIPList[]= -{ - {0x10, 0xff, 0xff, 0xfe, NULL }, - {0x11, 0xff, 0xff, 0xf8, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x01, 0x00, "Upright" }, - {0x10, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x02, 0x02, "3" }, - {0x10, 0x01, 0x02, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "1st Bonus Life" }, - {0x10, 0x01, 0x04, 0x04, "20K" }, - {0x10, 0x01, 0x04, 0x00, "30K" }, - - {0 , 0xfe, 0 , 4, "Extra Bonus Life" }, - {0x10, 0x01, 0x18, 0x18, "60K" }, - {0x10, 0x01, 0x18, 0x10, "70K" }, - {0x10, 0x01, 0x18, 0x08, "90K" }, - {0x10, 0x01, 0x18, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x10, 0x01, 0x60, 0x40, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x60, 0x00, "2 Coins 2 Credits" }, - {0x10, 0x01, 0x60, 0x60, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x60, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x03, 0x00, "Easy" }, - {0x11, 0x01, 0x03, 0x03, "Medium" }, - {0x11, 0x01, 0x03, 0x02, "Hard" }, - {0x11, 0x01, 0x03, 0x01, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "High Score Names" }, - {0x11, 0x01, 0x08, 0x00, "3 Letters" }, - {0x11, 0x01, 0x08, 0x08, "8 Letters" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Nova2001) - -static struct BurnDIPInfo NinjakunDIPList[]= -{ - {0x0c, 0xff, 0xff, 0xac, NULL }, - {0x0d, 0xff, 0xff, 0xcf, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0c, 0x01, 0x01, 0x00, "Upright" }, - {0x0c, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x06, 0x02, "2" }, - {0x0c, 0x01, 0x06, 0x04, "3" }, - {0x0c, 0x01, 0x06, 0x06, "4" }, - {0x0c, 0x01, 0x06, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "First Bonus" }, - {0x0c, 0x01, 0x08, 0x08, "30000" }, - {0x0c, 0x01, 0x08, 0x00, "40000" }, - - {0 , 0xfe, 0 , 4, "Second Bonus" }, - {0x0c, 0x01, 0x30, 0x00, "No Bonus" }, - {0x0c, 0x01, 0x30, 0x10, "Every 30000" }, - {0x0c, 0x01, 0x30, 0x30, "Every 50000" }, - {0x0c, 0x01, 0x30, 0x20, "Every 70000" }, - - {0 , 0xfe, 0 , 2, "Demo_Sounds" }, - {0x0c, 0x01, 0x40, 0x40, "Off" }, - {0x0c, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0c, 0x01, 0x80, 0x80, "Normal" }, - {0x0c, 0x01, 0x80, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0d, 0x01, 0x07, 0x04, "4C_1C" }, - {0x0d, 0x01, 0x07, 0x05, "3C_1C" }, - {0x0d, 0x01, 0x07, 0x00, "4C_2C" }, - {0x0d, 0x01, 0x07, 0x06, "2C_1C" }, - {0x0d, 0x01, 0x07, 0x01, "3C_2C" }, - {0x0d, 0x01, 0x07, 0x02, "2C_2C" }, - {0x0d, 0x01, 0x07, 0x07, "1C_1C" }, - {0x0d, 0x01, 0x07, 0x03, "1C_2C" }, - - {0 , 0xfe, 0 , 2, "High Score Names" }, - {0x0d, 0x01, 0x08, 0x00, "3 Letters" }, - {0x0d, 0x01, 0x08, 0x08, "8 Letters" }, - - {0 , 0xfe, 0 , 2, "Allow_Continue" }, - {0x0d, 0x01, 0x10, 0x10, "No" }, - {0x0d, 0x01, 0x10, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Free_Play" }, - {0x0d, 0x01, 0x40, 0x40, "Off" }, - {0x0d, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Infinite Lives" }, - {0x0d, 0x01, 0x80, 0x80, "Off" }, - {0x0d, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ninjakun) - -static struct BurnDIPInfo Raiders5DIPList[]= -{ - {0x0e, 0xff, 0xff, 0xfe, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0e, 0x01, 0x06, 0x00, "2" }, - {0x0e, 0x01, 0x06, 0x06, "3" }, - {0x0e, 0x01, 0x06, 0x04, "4" }, - {0x0e, 0x01, 0x06, 0x02, "5" }, - - {0 , 0xfe, 0 , 2, "1st Bonus" }, - {0x0e, 0x01, 0x08, 0x08, "30000" }, - {0x0e, 0x01, 0x08, 0x00, "40000" }, - - {0 , 0xfe, 0 , 4, "2nd Bonus" }, - {0x0e, 0x01, 0x30, 0x30, "Every 50000" }, - {0x0e, 0x01, 0x30, 0x20, "Every 70000" }, - {0x0e, 0x01, 0x30, 0x10, "Every 90000" }, - {0x0e, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Exercise" }, - {0x0e, 0x01, 0x40, 0x00, "Off" }, - {0x0e, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0e, 0x01, 0x80, 0x80, "Normal" }, - {0x0e, 0x01, 0x80, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0f, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x00, "4 Coins 2 Credits" }, - {0x0f, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x0f, 0x01, 0x07, 0x02, "2 Coins 2 Credits" }, - {0x0f, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "High Score Names" }, - {0x0f, 0x01, 0x08, 0x00, "3 Letters" }, - {0x0f, 0x01, 0x08, 0x08, "8 Letters" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0f, 0x01, 0x10, 0x00, "No" }, - {0x0f, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 0, "Free Play" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unlimited Lives (If Free Play)" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Raiders5) - -static UINT8 __fastcall raiders5_main_read(UINT16 address) -{ - if(address >= 0x9000 && address <= 0x97ff) - { - return DrvBgRAM[(((address & 0x3ff) + (xscroll >> 3) + ((yscroll >> 3) << 5)) & 0x3ff) + (address & 0x400)]; - } - - if(address >= 0xd000 && address <= 0xd1ff) - { - return DrvPalRAM[address - 0xd000]; - } - - switch (address) - { - case 0xc001: - return AY8910Read(0); - - case 0xc003: - return AY8910Read(1); - } - - return 0; -} - -static void __fastcall raiders5_main_write(UINT16 address, UINT8 data) -{ - if(address >= 0x9000 && address <= 0x97ff) - { - DrvBgRAM[(((address & 0x3ff) + (xscroll >> 3) + ((yscroll >> 3) << 5)) & 0x3ff) + (address & 0x400)] = data; - return; - } - - if(address >= 0xd000 && address <= 0xd1ff) - { - INT32 offset = address - 0xd000; - - DrvPalRAM[offset] = data; - if (offset < 16) { - DrvPalRAM[0x200 + offset * 16 + 1] = data; - - if (offset != 1) { - for (INT32 i = 0; i < 16; i++) { - DrvPalRAM[0x200 + offset + i * 16] = data; - } - } - } - return; - } - - - switch (address) - { - case 0xa000: - xscroll = data; - break; - - case 0xa001: - yscroll = data; - break; - - case 0xc000: - AY8910Write(0, 0, data); - break; - - case 0xc001: - AY8910Write(0, 1, data); - break; - - case 0xc002: - AY8910Write(1, 0, data); - break; - - case 0xc003: - AY8910Write(1, 1, data); - break; - - case 0xa002: - flipscreen = ~data & 0x01; - break; - } -} - -static UINT8 __fastcall raiders5_sub_read(UINT16 address) -{ - switch (address) - { - case 0x8001: - return AY8910Read(0); - - case 0x8003: - return AY8910Read(1); - - case 0x9000: - case 0xc000: - case 0xc800: - case 0xd000: - return 0; // NOP - } - - return 0; -} - -UINT8 __fastcall raiders5_in(UINT16 /*address*/) -{ - return 0; // NOP -} - -static void __fastcall raiders5_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8000: - AY8910Write(0, 0, data); - break; - - case 0x8001: - AY8910Write(0, 1, data); - break; - - case 0x8002: - AY8910Write(1, 0, data); - break; - - case 0x8003: - AY8910Write(1, 1, data); - break; - - case 0xe000: - xscroll = data; - break; - - case 0xe001: - yscroll = data; - break; - - case 0xe002: - flipscreen = ~data & 0x01; - break; - } -} - -static UINT8 __fastcall pkunwar_read(UINT16 address) -{ - switch (address) - { - case 0xa001: - return AY8910Read(0); - break; - - case 0xa003: - return AY8910Read(1); - break; - } - - return 0; -} - -static void __fastcall pkunwar_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - AY8910Write(0, 0, data); - break; - - case 0xa001: - AY8910Write(0, 1, data); - break; - - case 0xa002: - AY8910Write(1, 0, data); - break; - - case 0xa003: - AY8910Write(1, 1, data); - break; - } -} - -static void __fastcall pkunwar_out(UINT16 address, UINT8 data) -{ - address &= 0xff; - - if (address == 0) flipscreen = data & 1; -} - -static UINT8 __fastcall nova2001_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return AY8910Read(0); - - case 0xc001: - return AY8910Read(1); - - case 0xc004: - watchdog = 0; - return 0; - - case 0xc006: - return DrvInputs[0]; - - case 0xc007: - return DrvInputs[1]; - - case 0xc00e: - return (DrvInputs[2] & 0x7f) | vblank; - } - - return 0; -} - -static void __fastcall nova2001_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xbfff: - flipscreen = ~data & 0x01; - break; - - case 0xc000: - AY8910Write(0, 1, data); - break; - - case 0xc002: - AY8910Write(0, 0, data); - break; - - case 0xc001: - AY8910Write(1, 1, data); - break; - - case 0xc003: - AY8910Write(1, 0, data); - break; - } -} - - -static UINT8 __fastcall ninjakun_main_read(UINT16 address) -{ - if ((address & 0xf800) == 0xc800) { - return DrvBgRAM[(((address & 0x3ff) + (xscroll >> 3) + ((yscroll >> 3) << 5)) & 0x3ff) + (address & 0x400)]; - } - - switch (address) - { - case 0x8001: - return AY8910Read(0); - - case 0x8003: - return AY8910Read(1); - - case 0xa000: - return DrvInputs[0] ^ 0xc0; - - case 0xa001: - return DrvInputs[1] ^ 0xc0; - - case 0xa002: - return ((vblank ? 0 : 2) | (ninjakun_ioctrl << 2)); - } - - return 0; -} - -static void __fastcall ninjakun_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xc800) { - DrvBgRAM[(((address & 0x3ff) + (xscroll >> 3) + ((yscroll >> 3) << 5)) & 0x3ff) + (address & 0x400)] = data; - return; - } - - switch (address) - { - case 0x8000: - AY8910Write(0, 0, data); - break; - - case 0x8001: - AY8910Write(0, 1, data); - break; - - case 0x8002: - AY8910Write(1, 0, data); - break; - - case 0x8003: - AY8910Write(1, 1, data); - break; - - case 0xa002: - if (data == 0x80) ninjakun_ioctrl |= 0x01; - if (data == 0x40) ninjakun_ioctrl &= ~0x02; - break; - - case 0xa003: - flipscreen = ~data & 0x01; - break; - } -} - -static UINT8 __fastcall ninjakun_sub_read(UINT16 address) -{ - if ((address & 0xf800) == 0xc800) { - return DrvBgRAM[(((address & 0x3ff) + (xscroll >> 3) + ((yscroll >> 3) << 5)) & 0x3ff) + (address & 0x400)]; - } - - switch (address) - { - case 0x8001: - return AY8910Read(0); - - case 0x8003: - return AY8910Read(1); - - case 0xa000: - return DrvInputs[0] ^ 0xc0; - - case 0xa001: - return DrvInputs[1] ^ 0xc0; - - case 0xa002: - return ((vblank ? 0 : 2) | (ninjakun_ioctrl << 2)); - } - - return 0; -} - -static void __fastcall ninjakun_sub_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xc800) { - DrvBgRAM[(((address & 0x3ff) + (xscroll >> 3) + ((yscroll >> 3) << 5)) & 0x3ff) + (address & 0x400)] = data; - return; - } - - switch (address) - { - case 0x8000: - AY8910Write(0, 0, data); - break; - - case 0x8001: - AY8910Write(0, 1, data); - break; - - case 0x8002: - AY8910Write(1, 0, data); - break; - - case 0x8003: - AY8910Write(1, 1, data); - break; - - case 0xa002: - if (data == 0x40) ninjakun_ioctrl |= 0x02; - if (data == 0x80) ninjakun_ioctrl &= ~0x01; - break; - - case 0xa003: - // flipscreen = ~data & 0x01; - break; - } -} - -static UINT8 pkunwar_port_0(UINT32) -{ - return (DrvInputs[0] & 0x7) | (vblank ^= 0x80); -} - -static UINT8 pkunwar_port_1(UINT32) -{ - return DrvInputs[1]; -} - -static UINT8 pkunwar_port_2(UINT32) -{ - return 0xff; -} - -static UINT8 pkunwar_port_3(UINT32) -{ - return DrvDips[0]; -} - -void nova2001_scroll_x_w(UINT32 /*offset*/,UINT32 data) -{ - xscroll = data; -} - -void nova2001_scroll_y_w(UINT32 /*offset*/,UINT32 data) -{ - yscroll = data; -} - -static UINT8 nova2001_port_3(UINT32) -{ - return DrvDips[0]; -} - -static UINT8 nova2001_port_4(UINT32) -{ - return DrvDips[1]; -} - -static UINT8 raiders5_port_0(UINT32) -{ - return (DrvInputs[0] & 0x7f) | (vblank ? 0 : 0x80); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - HiscoreReset(); - - flipscreen = 0; - watchdog = 0; - - xscroll = 0; - yscroll = 0; - ninjakun_ioctrl = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x010000; - DrvSubROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - DrvColPROM = Next; Next += 0x000020; - - AllRam = Next; - - DrvBgRAM = Next; Next += 0x000800; - - DrvFgRAM = Next; Next += 0x000800; - - DrvSprRAM = Next; Next += 0x000800; - - DrvMainRAM = Next; Next += 0x000800; - - DrvSubRAM = Next; Next += 0x000800; - - DrvPalRAM = Next; Next += 0x000300; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void pkunwar_palette_init() -{ - for (INT32 i = 0; i < 0x200; i++) - { - INT32 shift = ((i & 0x0f) == 1) ? 4 : 0; - INT32 entry = ((i >> shift) & 0xf) | ((i & 0x100) >> 4); - - INT32 intensity = DrvColPROM[entry] & 0x03; - - INT32 r = (((DrvColPROM[entry] >> 0) & 0x0c) | intensity) * 0x11; - INT32 g = (((DrvColPROM[entry] >> 2) & 0x0c) | intensity) * 0x11; - INT32 b = (((DrvColPROM[entry] >> 4) & 0x0c) | intensity) * 0x11; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void DrvGfxDecode(UINT8 *src, UINT8 *dst, INT32 type) -{ - INT32 Planes[4] = { STEP4(0,1) }; - INT32 XOffsets[16] = { STEP8(0,4), STEP8(256,4) }; - INT32 YOffsets[16] = { STEP8(0,32), STEP8(512,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - - memcpy (tmp, src, 0x10000); - - if (type == 0) { - GfxDecode(0x800, 4, 8, 8, Planes, XOffsets, YOffsets, 0x100, tmp, dst); - } else { - GfxDecode(0x200, 4, 16, 16, Planes, XOffsets, YOffsets, 0x400, tmp, dst); - } - - BurnFree(tmp); -} - -static void DrvGfxDescramble(UINT8 *gfx) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, gfx, 0x10000); - - for (INT32 i = 0; i < 0x10000; i++) - { - gfx[(i & ~0x3fff) | ((i << 1) & 0x3fff) | ((i >> 13) & 1)] = tmp[i]; - } - - BurnFree(tmp); -} - -static INT32 PkunwarInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x4000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0xe000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xc000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM, 7, 1)) return 1; - - DrvGfxDescramble(DrvGfxROM0); - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, 0); - - pkunwar_palette_init(); - } - - ZetInit(0); - ZetOpen(0); - ZetSetOutHandler(pkunwar_out); - ZetSetReadHandler(pkunwar_read); - ZetSetWriteHandler(pkunwar_write); - ZetMapMemory(DrvMainROM + 0x0000, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvBgRAM, 0x8800, 0x8fff, MAP_RAM); - ZetMapMemory(DrvMainRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvMainROM + 0xe000, 0xe000, 0xffff, MAP_ROM); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, &pkunwar_port_0, &pkunwar_port_1, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, &pkunwar_port_2, &pkunwar_port_3, NULL, NULL); - - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 NovaInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x6000, 3, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x7000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4001, 7, 2)) return 1; - - if (BurnLoadRom(DrvColPROM, 8, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, 0); - - pkunwar_palette_init(); - } - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(nova2001_read); - ZetSetWriteHandler(nova2001_write); - - ZetMapMemory(DrvMainROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvFgRAM, 0xa000, 0xa7ff, MAP_RAM); - ZetMapMemory(DrvBgRAM, 0xa800, 0xafff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xb000, 0xb7ff, MAP_RAM); - ZetMapMemory(DrvMainRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, &nova2001_scroll_x_w, &nova2001_scroll_y_w); - AY8910Init(1, 2000000, nBurnSoundRate, &nova2001_port_3, &nova2001_port_4, NULL, NULL); - - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 NinjakunDoReset() -{ - DrvDoReset(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - return 0; -} - -static INT32 NinjakunInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSubROM + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4001, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x4000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x4001, 12, 2)) return 1; - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, 0); - - DrvGfxDecode(DrvGfxROM2, DrvGfxROM2, 0); - } - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(ninjakun_main_read); - ZetSetWriteHandler(ninjakun_main_write); - ZetMapMemory(DrvMainROM, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvMainROM + 0x2000, 0x2000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvFgRAM, 0xc000, 0xc7ff, MAP_RAM); -// ZetMapMemory(DrvBgRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd800, 0xd9ff, MAP_RAM); - ZetMapMemory(DrvMainRAM + 0x0000, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvMainRAM + 0x0400, 0xe400, 0xe7ff, MAP_RAM); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(ninjakun_sub_read); - ZetSetWriteHandler(ninjakun_sub_write); - ZetMapMemory(DrvSubROM, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvMainROM + 0x2000, 0x2000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvFgRAM, 0xc000, 0xc7ff, MAP_RAM); -// ZetMapMemory(DrvBgRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd800, 0xd9ff, MAP_RAM); - ZetMapMemory(DrvMainRAM + 0x0400, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvMainRAM + 0x0000, 0xe400, 0xe7ff, MAP_RAM); - ZetClose(); - - AY8910Init(0, 3000000, nBurnSoundRate, &nova2001_port_3, &nova2001_port_4, NULL, NULL); - AY8910Init(1, 3000000, nBurnSoundRate, NULL, NULL, &nova2001_scroll_x_w, &nova2001_scroll_y_w); - - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - NinjakunDoReset(); - - return 0; -} - -static INT32 Raiders5Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x4000, 1, 1)) return 1; - - if (BurnLoadRom(DrvSubROM + 0x0000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 5, 1)) return 1; - - DrvGfxDescramble(DrvGfxROM0); - DrvGfxDescramble(DrvGfxROM2); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, 0); - - DrvGfxDecode(DrvGfxROM2, DrvGfxROM2, 0); - } - - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(raiders5_in); - ZetSetReadHandler(raiders5_main_read); - ZetSetWriteHandler(raiders5_main_write); - - ZetMapMemory(DrvMainROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvFgRAM, 0x8800, 0x8fff, MAP_RAM); - ZetMapMemory(DrvMainRAM + 0x0000, 0xe000, 0xe7ff, MAP_RAM); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetInHandler(raiders5_in); // a verifier - ZetSetReadHandler(raiders5_sub_read); - ZetSetWriteHandler(raiders5_sub_write); - ZetMapMemory(DrvSubROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvMainRAM + 0x0000, 0xa000, 0xa7ff, MAP_RAM); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, &raiders5_port_0, &pkunwar_port_1, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, &nova2001_port_3, &nova2001_port_4, NULL, NULL); - - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - NinjakunDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - GenericTilesExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(UINT8 *ram_base, UINT8 *gfx_base, INT32 config, INT32 color_base, INT32 priority) -{ - INT32 color_shift = 0; - INT32 code_extend = -1; - INT32 code_extend_shift = 0; - INT32 group_select_bit = -1; - INT32 transparent = 0xff; // opaque - INT32 enable_scroll = 0; - INT32 color_mask = 0x0f; - INT32 xskew = 0; - - switch (config) - { - case 0: // nova2001 background - enable_scroll = 1; - break; - - case 1: // nova2001 foreground - group_select_bit = 4; - transparent = 0; - break; - - case 2: // ninjakun background - code_extend = 3; - code_extend_shift = 6; - enable_scroll = 1; - break; - - case 3: // ninjakun foreground - code_extend = 1; - code_extend_shift = 5; - transparent = 0; - break; - - case 4: // pkunwar background - code_extend = 7; - code_extend_shift = 0; - color_shift = 4; - color_mask = 0xf0; - break; - - case 5: // pkunwar foreground (background + transparency + group) - code_extend = 7; - code_extend_shift = 0; - color_shift = 4; - group_select_bit = 3; - transparent = 0; - color_mask = 0xf0; - break; - - case 6: // raiders5 background <--- something is wrong here(?) -dink - code_extend = 1; - code_extend_shift = 0; - color_shift = 4; - enable_scroll = 1; - color_mask = 0x0f; - xskew = 7; - break; - - case 7: // raiders5 foreground - color_shift = 4; - transparent = 0; - color_mask = 0xf0; - break; - } - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sy -= 32; // all games y offset by 32 pixels - - if (enable_scroll) { - sx -= xscroll; - sy -= yscroll; - } - - if (sy < -7) sy += 256; - if (sx < -7) sx += 256; - if (sx >= nScreenWidth) continue; - if (sy >= nScreenHeight) continue; - sx += xskew; - - INT32 code = ram_base[offs + 0x000]; - INT32 attr = ram_base[offs + 0x400]; - - INT32 color = (attr & color_mask) >> color_shift; - - INT32 group = 0; - - if (group_select_bit != -1) { - group = (attr >> group_select_bit) & 1; - - if (group != priority) continue; - } - - if (code_extend != -1) code |= ((attr >> code_extend_shift) & code_extend) << 8; - - if (config == 6) {//hack. -dink - code = ram_base[offs + 0x000] + ((attr & 0x01) << 8); - color = (attr >> 4) & 0x0f; - } - - if (flipscreen) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, 248 - sx, 184 - sy, color, 4, transparent, color_base, gfx_base); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, transparent, color_base, gfx_base); - } - } -} - -static void pkunwar_draw_sprites(INT32 color_base) -{ - for (INT32 offs = 0; offs < 0x800; offs += 32) - { - INT32 attr = DrvSprRAM[offs+3]; - INT32 flipx = DrvSprRAM[offs+0] & 0x01; - INT32 flipy = DrvSprRAM[offs+0] & 0x02; - INT32 sx = DrvSprRAM[offs+1]; - INT32 sy = DrvSprRAM[offs+2]; - INT32 code = ((DrvSprRAM[offs+0] & 0xfc) >> 2) + ((attr & 0x07) << 6); - INT32 color = (attr & 0xf0) >> 4; - - if (attr & 0x08) continue; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 32; // all games y offset by 32 pixels - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_base, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_base, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_base, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_base, DrvGfxROM1); - } - } - - // wrap around - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx - 256, sy, color, 4, 0, color_base, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx - 256, sy, color, 4, 0, color_base, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx - 256, sy, color, 4, 0, color_base, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx - 256, sy, color, 4, 0, color_base, DrvGfxROM1); - } - } - } -} - -static void nova_draw_sprites(INT32 color_base) -{ - for (INT32 offs = 0; offs < 0x800; offs += 32) - { - INT32 attr = DrvSprRAM[offs+3]; - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - INT32 sx = DrvSprRAM[offs+1] - ((attr & 0x40) << 2); - INT32 sy = DrvSprRAM[offs+2]; - INT32 code = DrvSprRAM[offs+0]; - INT32 color = attr & 0x0f; - - if (attr & 0x80) continue; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 32; // all games y offset by 32 pixels - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_base, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_base, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_base, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_base, DrvGfxROM1); - } - } - } -} - -static INT32 NovaDraw() -{ - if (DrvRecalc) { - pkunwar_palette_init(); - DrvRecalc = 0; - } - -// BurnTransferClear(); - - draw_layer(DrvBgRAM, DrvGfxROM0 + 0x8000, 0, 0x100, 0); - - nova_draw_sprites(0x000); - - draw_layer(DrvFgRAM, DrvGfxROM0 + 0x0000, 1, 0x000, 0); - draw_layer(DrvFgRAM, DrvGfxROM0 + 0x0000, 1, 0x000, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 PkunwarDraw() -{ - if (DrvRecalc) { - pkunwar_palette_init(); - DrvRecalc = 0; - } - -// BurnTransferClear(); - - draw_layer(DrvBgRAM, DrvGfxROM0 + 0x0000, 4, 0x100, 0); - - pkunwar_draw_sprites(0); - - draw_layer(DrvBgRAM, DrvGfxROM0 + 0x0000, 5, 0x100, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvPalRAMUpdate(INT32 ninjakun) -{ - if (ninjakun) { - for (INT32 i = 0; i < 16; i++) { - if (i != 1) { // ?? - for (INT32 j = 0; j < 16; j++) { - DrvPalRAM[0x200 + i + j * 16 + 0] = DrvPalRAM[i]; - } - } - DrvPalRAM[0x200 + i * 16 + 1] = DrvPalRAM[i]; - } - } - - for (INT32 i = 0; i < 0x300; i++) { - INT32 intensity = DrvPalRAM[i] & 0x03; - - INT32 r = (((DrvPalRAM[i] >> 0) & 0x0c) | intensity) * 0x11; - INT32 g = (((DrvPalRAM[i] >> 2) & 0x0c) | intensity) * 0x11; - INT32 b = (((DrvPalRAM[i] >> 4) & 0x0c) | intensity) * 0x11; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 Raiders5Draw() -{ - DrvPalRAMUpdate(0); - - BurnTransferClear(); - - draw_layer(DrvBgRAM, DrvGfxROM2 + 0x0000, 6, 0x100, 0); - - pkunwar_draw_sprites(0x200); - - draw_layer(DrvFgRAM, DrvGfxROM0 + 0x0000, 7, 0x000, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 NinjakunDraw() -{ - DrvPalRAMUpdate(1); - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(DrvBgRAM, DrvGfxROM2 + 0x0000, 2, 0x100, 0); - - if (nBurnLayer & 2) draw_layer(DrvFgRAM, DrvGfxROM0 + 0x0000, 3, 0x000, 1); - - if (nBurnLayer & 4) nova_draw_sprites(0x200); - - if (nBurnLayer & 8) draw_layer(DrvFgRAM, DrvGfxROM0 + 0x0000, 3, 0x000, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvCoinHold = 0; -static INT32 DrvCoinHoldframecnt = 0; - -static INT32 NovaFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - watchdog++; - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // Nova 2001 - if the coin pulse is too long or too short, the game will reset. - // It will also reset if coined up like 5 in a row really fast, but that isn't handled in the code below. - if (DrvJoy3[0]) { - DrvCoinHold = 4; // hold coin input for 3 frames - first one is ignored - DrvCoinHoldframecnt = 0; - } - - if (DrvCoinHold) { - DrvCoinHold--; - DrvInputs[2] = 0xFF; // clear coin input - if (DrvCoinHoldframecnt) - DrvInputs[2] = 0xFF ^ 1; - } - DrvCoinHoldframecnt++; - //bprintf(0, _T("%X,"), (DrvInputs[2] == 0xff) ? 0 : DrvInputs[2]); - } - - vblank = 0; - INT32 nInterleave = 256; - INT32 nCyclesTotal = 3000000 / 60; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - ZetRun(nCyclesTotal / nInterleave); - if (i == 240) { - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - vblank = 0x80; - } - } - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - NovaDraw(); - } - - return 0; -} - -static INT32 PkunwarFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInputs, 0xff, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - vblank = 0; - - ZetOpen(0); - ZetRun(3000000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - PkunwarDraw(); - } - - return 0; -} - -static INT32 Raiders5Frame() -{ - if (DrvReset) { - NinjakunDoReset(); - } - watchdog++; - - memset (DrvInputs, 0xff, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - vblank = 0; - - INT32 nInterleave = 2000; // needs high interleave - INT32 nCyclesTotal = 3000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - ZetRun(nCyclesTotal / nInterleave); - - if (i == 1880) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - vblank = 1; - } - ZetClose(); - - ZetOpen(1); - ZetRun(nCyclesTotal / nInterleave); - if (i%(nInterleave/4) == (nInterleave/4)-10) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - Raiders5Draw(); - } - - return 0; -} - -static INT32 NinjakunFrame() -{ - if (DrvReset) { - NinjakunDoReset(); - } - watchdog++; - - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - vblank = 0; - INT32 nInterleave = 256; - INT32 nCyclesTotal = 3000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - ZetRun(nCyclesTotal / nInterleave); - INT32 sync_cycles = ZetTotalCycles(); - if (i == 250) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - vblank = 1; - } - ZetClose(); - - ZetOpen(1); - ZetRun(sync_cycles - ZetTotalCycles()); - if (i == 58 || i == 122 || i == 190 || i == 250) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - NinjakunDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - SCAN_VAR(yscroll); - SCAN_VAR(xscroll); - SCAN_VAR(ninjakun_ioctrl); - } - - return 0; -} - - -// Penguin-Kun Wars (US) - -static struct BurnRomInfo pkunwarRomDesc[] = { - { "pkwar.01r", 0x4000, 0xce2d2c7b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "pkwar.02r", 0x4000, 0xabc1f661, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pkwar.03r", 0x2000, 0x56faebea, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pkwar.01y", 0x4000, 0x428d3b92, 2 | BRF_GRA }, // 3 Graphics - { "pkwar.02y", 0x4000, 0xce1da7bc, 2 | BRF_GRA }, // 4 - { "pkwar.03y", 0x4000, 0x63204400, 2 | BRF_GRA }, // 5 - { "pkwar.04y", 0x4000, 0x061dfca8, 2 | BRF_GRA }, // 6 - - { "pkwar.col", 0x0020, 0xaf0fc5e2, 3 | BRF_GRA }, // 7 Color Prom -}; - -STD_ROM_PICK(pkunwar) -STD_ROM_FN(pkunwar) - -struct BurnDriver BurnDrvpkunwar = { - "pkunwar", NULL, NULL, NULL, "1985", - "Penguin-Kun Wars (US)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, pkunwarRomInfo, pkunwarRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - PkunwarInit, DrvExit, PkunwarFrame, PkunwarDraw, DrvScan, &DrvRecalc, 0x200, - 256, 192, 4, 3 -}; - - -// Penguin-Kun Wars (Japan) - -static struct BurnRomInfo pkunwarjRomDesc[] = { - { "pgunwar.6", 0x4000, 0x357f3ef3, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "pgunwar.5", 0x4000, 0x0092e49e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pkwar.03r", 0x2000, 0x56faebea, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pkwar.01y", 0x4000, 0x428d3b92, 2 | BRF_GRA }, // 3 Graphics - { "pkwar.02y", 0x4000, 0xce1da7bc, 2 | BRF_GRA }, // 4 - { "pgunwar.2", 0x4000, 0xa2a43443, 2 | BRF_GRA }, // 5 - { "pkwar.04y", 0x4000, 0x061dfca8, 2 | BRF_GRA }, // 6 - - { "pkwar.col", 0x0020, 0xaf0fc5e2, 3 | BRF_GRA }, // 7 Color Prom -}; - -STD_ROM_PICK(pkunwarj) -STD_ROM_FN(pkunwarj) - -struct BurnDriver BurnDrvpkunwarj = { - "pkunwarj", "pkunwar", NULL, NULL, "1985", - "Penguin-Kun Wars (Japan)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, pkunwarjRomInfo, pkunwarjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - PkunwarInit, DrvExit, PkunwarFrame, PkunwarDraw, DrvScan, &DrvRecalc, 0x200, - 256, 192, 4, 3 -}; - -// Nova 2001 (Japan) - -static struct BurnRomInfo nova2001RomDesc[] = { - { "1.6c", 0x2000, 0x368cffc0, 1 | BRF_PRG | BRF_ESS}, // 0 Z80 Code - { "2.6d", 0x2000, 0xbc4e442b, 1 | BRF_PRG | BRF_ESS}, // 1 - { "3.6f", 0x2000, 0xb2849038, 1 | BRF_PRG | BRF_ESS}, // 2 - { "4.6g", 0x1000, 0x6b5bb12d, 1 | BRF_PRG | BRF_ESS}, // 3 - - { "5.12s", 0x2000, 0x54198941, 2 | BRF_GRA }, // 4 Graphics - { "6.12p", 0x2000, 0xcbd90dca, 2 | BRF_GRA }, // 5 - { "7.12n", 0x2000, 0x9ebd8806, 2 | BRF_GRA }, // 6 - { "8.12l", 0x2000, 0xd1b18389, 2 | BRF_GRA }, // 7 - - { "nova2001.clr", 0x0020, 0xa2fac5cd, 3 | BRF_GRA }, // 8 Color Prom -}; - -STD_ROM_PICK(nova2001) -STD_ROM_FN(nova2001) - -struct BurnDriver BurnDrvNova2001 = { - "nova2001", NULL, NULL, NULL, "1983", - "Nova 2001 (Japan)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, nova2001RomInfo, nova2001RomName, NULL, NULL, Nova2001InputInfo, Nova2001DIPInfo, - NovaInit, DrvExit, NovaFrame, NovaDraw, DrvScan, &DrvRecalc, 0x200, - 256, 192, 4, 3 -}; - - -// Nova 2001 (Japan, hack?) - -static struct BurnRomInfo nova2001hRomDesc[] = { - // roms 1 and 2 had green stickers, but looks like an unofficial mod, bytes have been added in empty space to fix game checksum after mods were made to code. - // one of the mods fixes the game resetting if the coin input is held down for too short / long of a period, the purpose of the other is unknown. - { "1(green).6c", 0x2000, 0x1a8731b3, 1 | BRF_PRG | BRF_ESS}, // 0 Z80 Code - { "2(green).6d", 0x2000, 0xbc4e442b, 1 | BRF_PRG | BRF_ESS}, // 1 - { "3.6f", 0x2000, 0xb2849038, 1 | BRF_PRG | BRF_ESS}, // 2 - { "4.6g", 0x1000, 0x6b5bb12d, 1 | BRF_PRG | BRF_ESS}, // 3 - - { "5.12s", 0x2000, 0x54198941, 2 | BRF_GRA }, // 4 Graphics - { "6.12p", 0x2000, 0xcbd90dca, 2 | BRF_GRA }, // 5 - { "7.12n", 0x2000, 0x9ebd8806, 2 | BRF_GRA }, // 6 - { "8.12l", 0x2000, 0xd1b18389, 2 | BRF_GRA }, // 7 - - { "nova2001.clr", 0x0020, 0xa2fac5cd, 3 | BRF_GRA }, // 8 Color Prom -}; - -STD_ROM_PICK(nova2001h) -STD_ROM_FN(nova2001h) - -struct BurnDriver BurnDrvNova2001h = { - "nova2001h", "nova2001", NULL, NULL, "1983", - "Nova 2001 (Japan, hack?)\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, nova2001hRomInfo, nova2001hRomName, NULL, NULL, Nova2001InputInfo, Nova2001DIPInfo, - NovaInit, DrvExit, NovaFrame, NovaDraw, DrvScan, &DrvRecalc, 0x200, - 256, 192, 4, 3 -}; - - -// Nova 2001 (US) - -static struct BurnRomInfo nova2001uRomDesc[] = { - { "nova2001.1", 0x2000, 0xb79461bd, 1 | BRF_PRG | BRF_ESS}, // 0 Z80 Code - { "nova2001.2", 0x2000, 0xfab87144, 1 | BRF_PRG | BRF_ESS}, // 1 - { "3.6f", 0x2000, 0xb2849038, 1 | BRF_PRG | BRF_ESS}, // 2 - { "4.6g", 0x1000, 0x6b5bb12d, 1 | BRF_PRG | BRF_ESS}, // 3 - - { "nova2001.5", 0x2000, 0x8ea576e8, 2 | BRF_GRA }, // 4 Graphics - { "nova2001.6", 0x2000, 0x0c61656c, 2 | BRF_GRA }, // 5 - { "7.12n", 0x2000, 0x9ebd8806, 2 | BRF_GRA }, // 6 - { "8.12l", 0x2000, 0xd1b18389, 2 | BRF_GRA }, // 7 - - { "nova2001.clr", 0x0020, 0xa2fac5cd, 3 | BRF_GRA }, // 8 Color Prom -}; - -STD_ROM_PICK(nova2001u) -STD_ROM_FN(nova2001u) - -struct BurnDriver BurnDrvNova2001u = { - "nova2001u", "nova2001", NULL, NULL, "1983", - "Nova 2001 (US)\0", NULL, "UPL (Universal license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, nova2001uRomInfo, nova2001uRomName, NULL, NULL, Nova2001InputInfo, Nova2001DIPInfo, - NovaInit, DrvExit, NovaFrame, NovaDraw, DrvScan, &DrvRecalc, 0x200, - 256, 192, 4, 3 -}; - - -// Ninjakun Majou no Bouken - -static struct BurnRomInfo ninjakunRomDesc[] = { - { "ninja-1.7a", 0x2000, 0x1c1dc141, 1 | BRF_PRG | BRF_ESS}, // 0 Z80 #0 Code - { "ninja-2.7b", 0x2000, 0x39cc7d37, 1 | BRF_PRG | BRF_ESS}, // 1 - { "ninja-3.7d", 0x2000, 0xd542bfe3, 1 | BRF_PRG | BRF_ESS}, // 2 - { "ninja-4.7e", 0x2000, 0xa57385c6, 1 | BRF_PRG | BRF_ESS}, // 3 - - { "ninja-5.7h", 0x2000, 0x164a42c4, 2 | BRF_PRG | BRF_ESS}, // 4 Z80 #1 Code - - { "ninja-6.7n", 0x2000, 0xa74c4297, 3 | BRF_GRA }, // 5 Foreground & Sprites - { "ninja-7.7p", 0x2000, 0x53a72039, 3 | BRF_GRA }, // 6 - { "ninja-8.7s", 0x2000, 0x4a99d857, 3 | BRF_GRA }, // 7 - { "ninja-9.7t", 0x2000, 0xdede49e4, 3 | BRF_GRA }, // 8 - - { "ninja-10.2c", 0x2000, 0x0d55664a, 4 | BRF_GRA }, // 9 Backgrounds - { "ninja-11.2d", 0x2000, 0x12ff9597, 4 | BRF_GRA }, // 10 - { "ninja-12.4c", 0x2000, 0xe9b75807, 4 | BRF_GRA }, // 11 - { "ninja-13.4d", 0x2000, 0x1760ed2c, 4 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(ninjakun) -STD_ROM_FN(ninjakun) - -struct BurnDriver BurnDrvNinjakun = { - "ninjakun", NULL, NULL, NULL, "1984", - "Ninjakun Majou no Bouken\0", NULL, "UPL (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, ninjakunRomInfo, ninjakunRomName, NULL, NULL, NinjakunInputInfo, NinjakunDIPInfo, - NinjakunInit, DrvExit, NinjakunFrame, NinjakunDraw, DrvScan, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - -// Raiders5 - -static struct BurnRomInfo raiders5RomDesc[] = { - { "raiders5.1", 0x4000, 0x47cea11f, 1 | BRF_PRG | BRF_ESS}, // 0 Z80 #0 Code - { "raiders5.2", 0x4000, 0xeb2ff410, 1 | BRF_PRG | BRF_ESS}, // 1 - - { "raiders5.2", 0x4000, 0xeb2ff410, 2 | BRF_PRG | BRF_ESS}, // 2 Z80 #1 Code - - { "raiders3.11f", 0x4000, 0x30041d58, 3 | BRF_GRA }, // 3 Foreground & Sprites - { "raiders4.11g", 0x4000, 0xe441931c, 3 | BRF_GRA }, // 4 - - { "raiders5.11n", 0x4000, 0xc0895090, 4 | BRF_GRA }, // 5 Backgrounds -}; - -STD_ROM_PICK(raiders5) -STD_ROM_FN(raiders5) - -struct BurnDriver BurnDrvRaiders5 = { - "raiders5", NULL, NULL, NULL, "1985", - "Raiders5\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, raiders5RomInfo, raiders5RomName, NULL, NULL, Raiders5InputInfo, Raiders5DIPInfo, - Raiders5Init, DrvExit, Raiders5Frame, Raiders5Draw, NULL, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; - -// Raiders5 (Japan) - -static struct BurnRomInfo raiders5tRomDesc[] = { - { "raiders1.4c", 0x4000, 0x4e2d5679, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "raiders2.4d", 0x4000, 0xc8604be1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "raiders2.4d", 0x4000, 0xc8604be1, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "raiders3.11f", 0x4000, 0x30041d58, 3 | BRF_GRA }, // 3 Foreground & Sprites - { "raiders4.11g", 0x4000, 0xe441931c, 3 | BRF_GRA }, // 4 - - { "raiders5.11n", 0x4000, 0xc0895090, 4 | BRF_GRA }, // 5 Backgrounds -}; - -STD_ROM_PICK(raiders5t) -STD_ROM_FN(raiders5t) - -struct BurnDriver BurnDrvRaidrs5t = { - "raiders5t", "raiders5", NULL, NULL, "1985", - "Raiders5 (Japan)\0", NULL, "UPL (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, raiders5tRomInfo, raiders5tRomName, NULL, NULL, Raiders5InputInfo, Raiders5DIPInfo, - Raiders5Init, DrvExit, Raiders5Frame, Raiders5Draw, NULL, &DrvRecalc, 0x300, - 256, 192, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_popeye.cpp b/jan/src/burn/drv/pre90s/d_popeye.cpp deleted file mode 100644 index 899053674..000000000 --- a/jan/src/burn/drv/pre90s/d_popeye.cpp +++ /dev/null @@ -1,929 +0,0 @@ -// Popeye & SkySkipper emu-layer for FB Alpha by dink, based on Marc Lafontaine's MAME driver. -// Note: -// sprite clipping in popeye on the thru-way is normal (see pcb vid) - -#include "tiles_generic.h" -#include "driver.h" -#include "z80_intf.h" -#include "bitswap.h" - -extern "C" { - #include "ay8910.h" -} -static INT16 *pAY8910Buffer[3]; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColorRAM; -static UINT8 *DrvSpriteRAM; -static UINT8 *DrvBGRAM; -static UINT8 *DrvColorPROM; -static UINT8 *DrvCharGFX; -static UINT8 *DrvSpriteGFX; - -static UINT8 *background_pos; -static UINT8 *palette_bank; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 *bgbitmap; - -static UINT8 m_dswbit; -static UINT16 m_field; -static UINT8 m_prot0; -static UINT8 m_prot1; -static UINT8 m_prot_shift; -static UINT8 m_invertmask = 0xff; -static INT32 bgbitmapwh; // 512 for popeye, 1024 for skyskipr - -static UINT8 skyskiprmode = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[5]; -static UINT8 DrvReset; - -static struct BurnInputInfo SkyskiprInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Skyskipr) - - -static struct BurnDIPInfo SkyskiprDIPList[]= -{ - {0x12, 0xff, 0xff, 0x7f, NULL }, - {0x13, 0xff, 0xff, 0x7d, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x12, 0x01, 0x0f, 0x03, "A 3/1 B 1/2" }, - {0x12, 0x01, 0x0f, 0x0e, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "A 2/1 B 2/5" }, - {0x12, 0x01, 0x0f, 0x04, "A 2/1 B 1/3" }, - {0x12, 0x01, 0x0f, 0x07, "A 1/1 B 2/1" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "A 1/1 B 1/2" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "A 1/2 B 1/4" }, - {0x12, 0x01, 0x0f, 0x0b, "A 1/2 B 1/5" }, - {0x12, 0x01, 0x0f, 0x02, "A 2/5 B 1/1" }, - {0x12, 0x01, 0x0f, 0x0a, "A 1/3 B 1/1" }, - {0x12, 0x01, 0x0f, 0x09, "A 1/4 B 1/1" }, - {0x12, 0x01, 0x0f, 0x05, "A 1/5 B 1/1" }, - {0x12, 0x01, 0x0f, 0x08, "A 1/6 B 1/1" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x01, "3" }, - {0x13, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x13, 0x01, 0x20, 0x20, "15000" }, - {0x13, 0x01, 0x20, 0x00, "30000" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Skyskipr) - -static struct BurnInputInfo PopeyeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Popeye) - - -static struct BurnDIPInfo PopeyeDIPList[]= -{ - {0x10, 0xff, 0xff, 0x5f, NULL }, - {0x11, 0xff, 0xff, 0x3d, NULL }, - - {0 , 0xfe, 0 , 9, "Coinage" }, - {0x10, 0x01, 0x0f, 0x08, "6 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x05, "5 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x03, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x10, 0x10, "Off" }, - {0x10, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Copyright" }, - {0x10, 0x01, 0x60, 0x40, "Nintendo" }, - {0x10, 0x01, 0x60, 0x20, "Nintendo Co.,Ltd" }, - {0x10, 0x01, 0x60, 0x60, "Nintendo of America" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "1" }, - {0x11, 0x01, 0x03, 0x02, "2" }, - {0x11, 0x01, 0x03, 0x01, "3" }, - {0x11, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x0c, 0x0c, "Easy" }, - {0x11, 0x01, 0x0c, 0x08, "Medium" }, - {0x11, 0x01, 0x0c, 0x04, "Hard" }, - {0x11, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x30, 0x30, "40000" }, - {0x11, 0x01, 0x30, 0x20, "60000" }, - {0x11, 0x01, 0x30, 0x10, "80000" }, - {0x11, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x80, 0x00, "Upright" }, - {0x11, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Popeye) - -static void popeye_do_palette() -{ - UINT8 *color_prom = DrvColorPROM + 32; - - for (INT32 i = 0; i < 16;i++) - { - int prom_offs = i | ((i & 8) << 1); /* address bits 3 and 4 are tied together */ - int bit0,bit1,bit2,r,g,b; - - /* red component */ - bit0 = ((color_prom[prom_offs] ^ m_invertmask) >> 0) & 0x01; - bit1 = ((color_prom[prom_offs] ^ m_invertmask) >> 1) & 0x01; - bit2 = ((color_prom[prom_offs] ^ m_invertmask) >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* green component */ - bit0 = ((color_prom[prom_offs] ^ m_invertmask) >> 3) & 0x01; - bit1 = ((color_prom[prom_offs] ^ m_invertmask) >> 4) & 0x01; - bit2 = ((color_prom[prom_offs] ^ m_invertmask) >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* blue component */ - bit0 = 0; - bit1 = ((color_prom[prom_offs] ^ m_invertmask) >> 6) & 0x01; - bit2 = ((color_prom[prom_offs] ^ m_invertmask) >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[0x100 + (2 * i) + 1] = BurnHighCol(r, g, b, 0); - } - - color_prom += 32; - - for (INT32 i = 0; i < 256;i++) - { - int bit0,bit1,bit2,r,g,b; - - - /* red component */ - bit0 = ((color_prom[0] ^ m_invertmask) >> 0) & 0x01; - bit1 = ((color_prom[0] ^ m_invertmask) >> 1) & 0x01; - bit2 = ((color_prom[0] ^ m_invertmask) >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* green component */ - bit0 = ((color_prom[0] ^ m_invertmask) >> 3) & 0x01; - bit1 = ((color_prom[256] ^ m_invertmask) >> 0) & 0x01; - bit2 = ((color_prom[256] ^ m_invertmask) >> 1) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* blue component */ - bit0 = 0; - bit1 = ((color_prom[256] ^ m_invertmask) >> 2) & 0x01; - bit2 = ((color_prom[256] ^ m_invertmask) >> 3) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[0x200 + i] = BurnHighCol(r, g, b, 0); - - color_prom++; - } -} - -static void popeye_do_background_palette(UINT32 bank) -{ - UINT8 *color_prom = DrvColorPROM + 16 * bank; - - for (INT32 i = 0; i < 16;i++) - { - int bit0,bit1,bit2; - int r,g,b; - - /* red component */ - bit0 = ((color_prom[0] ^ m_invertmask) >> 0) & 0x01; - bit1 = ((color_prom[0] ^ m_invertmask) >> 1) & 0x01; - bit2 = ((color_prom[0] ^ m_invertmask) >> 2) & 0x01; - r = 0x1c * bit0 + 0x31 * bit1 + 0x47 * bit2; - /* green component */ - bit0 = ((color_prom[0] ^ m_invertmask) >> 3) & 0x01; - bit1 = ((color_prom[0] ^ m_invertmask) >> 4) & 0x01; - bit2 = ((color_prom[0] ^ m_invertmask) >> 5) & 0x01; - g = 0x1c * bit0 + 0x31 * bit1 + 0x47 * bit2; - /* blue component */ - bit0 = 0; - bit1 = ((color_prom[0] ^ m_invertmask) >> 6) & 0x01; - bit2 = ((color_prom[0] ^ m_invertmask) >> 7) & 0x01; - if (skyskiprmode) - { - bit0 = bit1; - bit1 = 0; - } - b = 0x1c * bit0 + 0x31 * bit1 + 0x47 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - - color_prom++; - } -} - -static void popeye_recalcpalette() -{ - popeye_do_palette(); - popeye_do_background_palette((*palette_bank & 0x08) >> 3); -} - -static void skyskipr_bitmap_w(UINT16 offset, UINT8 data) -{ - INT32 sx,sy,x,y,colour; - - if (skyskiprmode) - { - offset = ((offset & 0xfc0) << 1) | (offset & 0x03f); - if (data & 0x80) - offset |= 0x40; - - DrvBGRAM[offset] = data; - - sx = 8 * (offset % 128); - sy = 8 * (offset / 128); - - //if (flip_screen()) - // sy = 512-8 - sy; - - colour = data & 0x0f; - for (y = 0; y < 8; y++) { - for (x = 0; x < 8; x++) { - bgbitmap[((sy+y) * 1024) + sx+x] = colour; - } - } - } - else - { - DrvBGRAM[offset] = data; - - sx = 8 * (offset % 64); - sy = 4 * (offset / 64); - - //if (flip_screen()) - // sy = 512-4 - sy; - - colour = data & 0x0f; - for (y = 0; y < 4; y++) { - for (x = 0; x < 8; x++) { - bgbitmap[((sy+y) * 512) + sx+x] = colour; - } - } - } - -} - -static void __fastcall main_write(UINT16 address, UINT8 data) -{ - if (address >= 0x8c04 && address <= 0x8e7f) { - DrvSpriteRAM[address - 0x8c04] = data; - return; - } - - if (address >= 0x8e80 && address <= 0x8fff) { - DrvZ80RAM2[address - 0x8e80] = data; - return; - } - - if (address >= 0xc000 && address <= 0xdfff) { - skyskipr_bitmap_w(address - 0xc000, data); - return; - } - - switch (address) - { - case 0xE000: m_prot_shift = data & 0x07; return; - case 0xE001: m_prot0 = m_prot1; m_prot1 = data; return; - case 0x8c00: - case 0x8c01: - case 0x8c02: background_pos[address & 3] = data; return; - case 0x8c03: *palette_bank = data; return; - } - - //bprintf(0, _T("mw %X,"), address); -} - - -static UINT8 __fastcall main_read(UINT16 address) -{ - if (address >= 0x8c04 && address <= 0x8e7f) - return DrvSpriteRAM[address - 0x8c04]; - - if (address >= 0x8e80 && address <= 0x8fff) - return DrvZ80RAM2[address - 0x8e80]; - - if (address >= 0xc000 && address <= 0xdfff) { - return DrvBGRAM[address - 0xc000]; - } - - switch (address) - { - case 0xE000: return ((m_prot1 << m_prot_shift) | (m_prot0 >> (8-m_prot_shift))) & 0xff; - case 0xE001: return 0; - case 0x8c00: - case 0x8c01: - case 0x8c02: return background_pos[address & 3]; - case 0x8c03: return *palette_bank; - } - - //bprintf(0, _T("mr %X,"), address); - - return 0; -} - - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - HiscoreReset(); - - m_field = 0; - m_dswbit = 0; - m_field = 0; - m_prot0 = 0; - m_prot1 = 0; - m_prot_shift = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x08000; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - DrvCharGFX = Next; Next += 0x20000; - DrvSpriteGFX = Next; Next += 0x20000; - DrvColorPROM = Next; Next += 0x00400; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x00c00; - DrvZ80RAM2 = Next; Next += 0x00200; - DrvVidRAM = Next; Next += 0x00400; - DrvColorRAM = Next; Next += 0x00400; - DrvSpriteRAM = Next; Next += 0x00300; - DrvBGRAM = Next; Next += 0x02000; - background_pos = Next; Next += 0x00003; - palette_bank = Next; Next += 0x00002; - bgbitmap = (UINT16*)Next; Next += 1024 * 1024 * sizeof(UINT16); // background bitmap (RAM section) - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static UINT8 __fastcall port_read(UINT16 port) -{ - switch (port & 0xff) { - case 0x00: return DrvInput[0]; - case 0x01: return DrvInput[1]; - case 0x02: return (skyskiprmode) ? DrvInput[2] : DrvInput[2] | (m_field ^ 1) << 4; - case 0x03: return AY8910Read(0); - } - return 0xff; -} - -static void __fastcall port_write(UINT16 port, UINT8 data) -{ - switch (port & 0xff) { - case 0x00: - AY8910Write(0, 0, data); - break; - - case 0x01: - AY8910Write(0, 1, data); - break; - } -} - -static void popeye_ayportB_write(UINT32 /*addr*/, UINT32 data) -{ - /* bit 0 flips screen */ - //flip_screen_set(data & 1); - - /* bits 1-3 select DSW1 bit to read */ - m_dswbit = (data & 0x0e) >> 1; -} - -static UINT8 popeye_ayportA_read(UINT32 /*addr*/) -{ - return (DrvDip[0] & 0x7f) | ((DrvDip[1] << (7-m_dswbit)) & 0x80); -} - -static INT32 CharPlaneOffsets[2] = { 0, 0 }; -static INT32 CharXOffsets[16] = { 7,7, 6,6, 5,5, 4,4, 3,3, 2,2, 1,1, 0,0 }; -static INT32 CharYOffsets[16] = { 0*8,0*8, 1*8,1*8, 2*8,2*8, 3*8,3*8, 4*8,4*8, 5*8,5*8, 6*8,6*8, 7*8,7*8 }; - -static INT32 DrvInit() -{ - INT32 SpritePlaneOffsets[2] = { 0, RGN_FRAC(((skyskiprmode) ? 0x4000 : 0x8000), 1,2) }; - INT32 SpriteXOffsets[16] = { RGN_FRAC(((skyskiprmode) ? 0x4000 : 0x8000), 1,4)+7,RGN_FRAC(((skyskiprmode) ? 0x4000 : 0x8000), 1,4)+6,RGN_FRAC(((skyskiprmode) ? 0x4000 : 0x8000), 1,4)+5,RGN_FRAC(((skyskiprmode) ? 0x4000 : 0x8000), 1,4)+4,RGN_FRAC(((skyskiprmode) ? 0x4000 : 0x8000), 1,4)+3,RGN_FRAC(((skyskiprmode) ? 0x4000 : 0x8000), 1,4)+2,RGN_FRAC(((skyskiprmode) ? 0x4000 : 0x8000), 1,4)+1,RGN_FRAC(((skyskiprmode) ? 0x4000 : 0x8000), 1,4)+0,7,6,5,4,3,2,1,0}; - INT32 SpriteYOffsets[16] = { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 }; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { // Load ROMS parse GFX - UINT8 *DrvTempRom = (UINT8 *)BurnMalloc(0x40000); - memset(DrvTempRom, 0, 0x40000); - - if (skyskiprmode) { // SkySkipper - bgbitmapwh = 1024; - - if (BurnLoadRom(DrvTempRom + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x3000, 3, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x4000, 4, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x5000, 5, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x6000, 6, 1)) return 1; - - /* decrypt the program ROMs */ - for (INT32 i = 0; i < 0x8000; i++) - DrvZ80ROM[i] = BITSWAP08(DrvTempRom[BITSWAP16(i,15,14,13,12,11,10,8,7,0,1,2,4,5,9,3,6) ^ 0xfc],3,4,2,5,1,6,0,7); - - memset(DrvTempRom, 0, 0x40000); - if (BurnLoadRom(DrvTempRom , 7, 1)) return 1; - GfxDecode(0x100, 1, 16, 16, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom, DrvCharGFX); - - memset(DrvTempRom, 0, 0x40000); - if (BurnLoadRom(DrvTempRom + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x1000, 9, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x2000,10, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x3000,11, 1)) return 1; - GfxDecode(0x100 /*((0x4000*8)/2)/(16*16))*/, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x80, DrvTempRom, DrvSpriteGFX); - - if (BurnLoadRom(DrvColorPROM + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvColorPROM + 0x0020, 13, 1)) return 1; - if (BurnLoadRom(DrvColorPROM + 0x0040, 14, 1)) return 1; - if (BurnLoadRom(DrvColorPROM + 0x0140, 15, 1)) return 1; - if (BurnLoadRom(DrvColorPROM + 0x0240, 16, 1)) return 1; - - } else { // Popeye - bgbitmapwh = 512; - - if (BurnLoadRom(DrvTempRom + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x6000, 3, 1)) return 1; - - /* decrypt the program ROMs */ - for (INT32 i = 0; i < 0x8000; i++) - DrvZ80ROM[i] = BITSWAP08(DrvTempRom[BITSWAP16(i,15,14,13,12,11,10,8,7,6,3,9,5,4,2,1,0) ^ 0x3f],3,4,2,5,1,6,0,7); - - memset(DrvTempRom, 0, 0x40000); - if (BurnLoadRom(DrvTempRom , 4, 1)) return 1; - GfxDecode(0x100, 1, 16, 16, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvTempRom+0x800, DrvCharGFX); - - memset(DrvTempRom, 0, 0x40000); - if (BurnLoadRom(DrvTempRom + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x2000, 6, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x4000, 7, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x6000, 8, 1)) return 1; - GfxDecode(0x200, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x80, DrvTempRom, DrvSpriteGFX); - - if (BurnLoadRom(DrvColorPROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(DrvColorPROM + 0x0020, 10, 1)) return 1; - if (BurnLoadRom(DrvColorPROM + 0x0040, 11, 1)) return 1; - if (BurnLoadRom(DrvColorPROM + 0x0140, 12, 1)) return 1; - if (BurnLoadRom(DrvColorPROM + 0x0240, 13, 1)) return 1; - } - BurnFree(DrvTempRom); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x8bff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xa000, 0xa3ff, MAP_RAM); - ZetMapMemory(DrvColorRAM, 0xa400, 0xa7ff, MAP_RAM); - ZetSetWriteHandler(main_write); - ZetSetReadHandler(main_read); - ZetSetInHandler(port_read); - ZetSetOutHandler(port_write); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, popeye_ayportA_read, NULL, NULL, popeye_ayportB_write); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - - BurnFree(AllMem); - - skyskiprmode = 0; - - return 0; -} - - -extern int counter; - -static void draw_chars() -{ - for (INT32 offs = 0; offs <= 0x400; offs++) - { - int sx = offs % 32; - int sy = offs / 32; - - int code = DrvVidRAM[offs]; - int color = DrvColorRAM[offs] & 0x0f; - - sx = 16 * sx; - sy = (16 * sy) - 32; - - if (sx >= nScreenWidth || sy >= nScreenHeight || sx < 0 || sy < 0) continue; - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 1, 0, 0x100, DrvCharGFX); - } -} - -static void draw_background() -{ - if (background_pos[1] == 0) { - return; // background disabled - } - - popeye_do_background_palette((*palette_bank & 0x08) >> 3); - - INT32 scrollx = 200 - background_pos[0] - 256*(background_pos[2]&1); /* ??? */ - INT32 scrolly = 2 * (256 - background_pos[1]); - - if (skyskiprmode) - scrollx = 2 * scrollx - 512; - - // copy matching background section to pTransDraw - INT32 destx = 1-scrollx; - INT32 desty = 0-scrolly + 32; - INT32 destendx = destx + nScreenWidth/* - 1*/; - INT32 destendy = desty + nScreenHeight - 1; - - for (INT32 cury = desty; cury < destendy; cury++) - for (INT32 curx = destx; curx < destendx; curx++) { - UINT16 *pPixel = pTransDraw + ((cury-desty) * nScreenWidth) + (curx-destx); - if (cury-desty < 0 || curx-destx < 0 || cury-desty >= nScreenHeight || curx-destx >= nScreenWidth || cury >= bgbitmapwh /*|| curx >= bgbitmapwh this is solved by modulus below!*/ || cury < 0 || curx < 0) continue; - - *pPixel = bgbitmap[(cury*bgbitmapwh) + (curx%bgbitmapwh)]; - } - -} - - -static void draw_sprites() -{ - UINT8 *spriteram = DrvSpriteRAM; - INT32 sprmask = ((skyskiprmode) ? 0xff : 0x1ff); - - for (INT32 offs = 0; offs < 0x27b; offs += 4) - { - INT32 code,color,flipx,flipy,sx,sy; - - color = (spriteram[offs + 3] & 0x07); - if (color == 0) continue; - if (!spriteram[offs]) continue; - - code = (spriteram[offs + 2] & 0x7f) - + ((spriteram[offs + 3] & 0x10) << 3) - + ((spriteram[offs + 3] & 0x04) << 6); - - color += (*palette_bank & 0x07) << 3; - if (skyskiprmode) { - color = (color & 0x0f) | ((color & 0x08) << 1); - } - - flipx = spriteram[offs + 2] & 0x80; - flipy = spriteram[offs + 3] & 0x08; - - sx = 2*(spriteram[offs])-8; - sy = (2*(256-spriteram[offs + 1])) - 32; - - if (sx <= -6) sx += 512; - - code = (code ^ 0x1ff) & sprmask; - - if (flipy) { // we need a macro for this -dink - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0x200, DrvSpriteGFX); - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx-512, sy, color, 2, 0, 0x200, DrvSpriteGFX); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0x200, DrvSpriteGFX); - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx-512, sy, color, 2, 0, 0x200, DrvSpriteGFX); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0x200, DrvSpriteGFX); - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx-512, sy, color, 2, 0, 0x200, DrvSpriteGFX); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0x200, DrvSpriteGFX); - Render16x16Tile_Mask_Clip(pTransDraw, code, sx-512, sy, color, 2, 0, 0x200, DrvSpriteGFX); - } - } - } -} - - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - popeye_recalcpalette(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - draw_background(); - draw_sprites(); - draw_chars(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvMakeInputs() -{ - UINT8 *DrvJoy[3] = { DrvJoy1, DrvJoy2, DrvJoy3 }; - UINT32 DrvJoyInit[3] = { 0x00, 0x00, 0x00 }; - - CompileInput(DrvJoy, (void*)DrvInput, 3, 8, DrvJoyInit); - - if (!skyskiprmode) { - // Convert to 4-way for Popeye - ProcessJoystick(&DrvInput[0], 0, 3,2,1,0, INPUT_4WAY); - ProcessJoystick(&DrvInput[1], 1, 3,2,1,0, INPUT_4WAY); - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvMakeInputs(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal = 4000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - ZetRun(nCyclesTotal / nInterleave); - - if (i == nInterleave - 1 && (ZetI(-1) & 1)) - ZetNmi(); - - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(m_dswbit); - SCAN_VAR(m_field); - SCAN_VAR(m_prot0); - SCAN_VAR(m_prot1); - SCAN_VAR(m_prot_shift); - SCAN_VAR(m_invertmask); - } - - return 0; -} - - -// Sky Skipper - -static struct BurnRomInfo skyskiprRomDesc[] = { - { "tnx1-c.2a", 0x1000, 0xbdc7f218, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "tnx1-c.2b", 0x1000, 0xcbe601a8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tnx1-c.2c", 0x1000, 0x5ca79abf, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tnx1-c.2d", 0x1000, 0x6b7a7071, 1 | BRF_PRG | BRF_ESS }, // 3 - { "tnx1-c.2e", 0x1000, 0x6b0c0525, 1 | BRF_PRG | BRF_ESS }, // 4 - { "tnx1-c.2f", 0x1000, 0xd1712424, 1 | BRF_PRG | BRF_ESS }, // 5 - { "tnx1-c.2g", 0x1000, 0x8b33c4cf, 1 | BRF_PRG | BRF_ESS }, // 6 - - { "tnx1-v.3h", 0x0800, 0xecb6a046, 2 | BRF_GRA }, // 7 gfx1 - - { "tnx1-t.1e", 0x1000, 0x01c1120e, 3 | BRF_GRA }, // 8 gfx2 - { "tnx1-t.2e", 0x1000, 0x70292a71, 3 | BRF_GRA }, // 9 - { "tnx1-t.3e", 0x1000, 0x92b6a0e8, 3 | BRF_GRA }, // 10 - { "tnx1-t.5e", 0x1000, 0xcc5f0ac3, 3 | BRF_GRA }, // 11 - - { "tnx1-t.4a", 0x0020, 0x98846924, 4 | BRF_GRA }, // 12 proms - { "tnx1-t.1a", 0x0020, 0xc2bca435, 4 | BRF_GRA }, // 13 - { "tnx1-t.3a", 0x0100, 0x8abf9de4, 4 | BRF_GRA }, // 14 - { "tnx1-t.2a", 0x0100, 0xaa7ff322, 4 | BRF_GRA }, // 15 - { "tnx1-t.3j", 0x0100, 0x1c5c8dea, 4 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(skyskipr) -STD_ROM_FN(skyskipr) - -static INT32 DrvInitskyskipr() -{ - skyskiprmode = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvSkyskipr = { - "skyskipr", NULL, NULL, NULL, "1981", - "Sky Skipper\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, skyskiprRomInfo, skyskiprRomName, NULL, NULL, SkyskiprInputInfo, SkyskiprDIPInfo, - DrvInitskyskipr, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 512, 448, 4, 3 -}; - -// Popeye (revision D) - -static struct BurnRomInfo popeyeRomDesc[] = { - { "tpp2-c.7a", 0x2000, 0x9af7c821, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "tpp2-c.7b", 0x2000, 0xc3704958, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tpp2-c.7c", 0x2000, 0x5882ebf9, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tpp2-c.7e", 0x2000, 0xef8649ca, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "tpp2-v.5n", 0x1000, 0xcca61ddd, 2 | BRF_GRA }, // 4 gfx1 - - { "tpp2-v.1e", 0x2000, 0x0f2cd853, 3 | BRF_GRA }, // 5 gfx2 - { "tpp2-v.1f", 0x2000, 0x888f3474, 3 | BRF_GRA }, // 6 - { "tpp2-v.1j", 0x2000, 0x7e864668, 3 | BRF_GRA }, // 7 - { "tpp2-v.1k", 0x2000, 0x49e1d170, 3 | BRF_GRA }, // 8 - - { "tpp2-c.4a", 0x0020, 0x375e1602, 4 | BRF_GRA }, // 9 proms - { "tpp2-c.3a", 0x0020, 0xe950bea1, 4 | BRF_GRA }, // 10 - { "tpp2-c.5b", 0x0100, 0xc5826883, 4 | BRF_GRA }, // 11 - { "tpp2-c.5a", 0x0100, 0xc576afba, 4 | BRF_GRA }, // 12 - { "tpp2-v.7j", 0x0100, 0xa4655e2e, 4 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(popeye) -STD_ROM_FN(popeye) - -struct BurnDriver BurnDrvPopeye = { - "popeye", NULL, NULL, NULL, "1982", - "Popeye (revision D)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, popeyeRomInfo, popeyeRomName, NULL, NULL, PopeyeInputInfo, PopeyeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 512, 448, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_prehisle.cpp b/jan/src/burn/drv/pre90s/d_prehisle.cpp deleted file mode 100644 index 5f312695c..000000000 --- a/jan/src/burn/drv/pre90s/d_prehisle.cpp +++ /dev/null @@ -1,1050 +0,0 @@ -// FB Alpha Prehistoric Isle in 1930 driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "upd7759.h" - -// Input Related Variables -static UINT8 PrehisleInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 PrehisleInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 PrehisleInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 PrehisleDip[2] = {0, 0}; -static UINT8 PrehisleInput[3] = {0x00, 0x00, 0x00}; -static UINT8 PrehisleReset = 0; - -// Memory Holders -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *PrehisleRom = NULL; -static UINT8 *PrehisleZ80Rom = NULL; -static UINT8 *PrehisleTileMapRom = NULL; -static UINT8 *PrehisleADPCMSamples = NULL; -static UINT8 *PrehisleRam = NULL; -static UINT8 *PrehisleVideoRam = NULL; -static UINT8 *PrehisleSpriteRam = NULL; -static UINT8 *PrehisleVideo2Ram = NULL; -static UINT8 *PrehislePaletteRam = NULL; -static UINT8 *PrehisleZ80Ram = NULL; -static UINT32 *PrehislePalette = NULL; -static UINT8 *PrehisleTextTiles = NULL; -static UINT8 *PrehisleSprites = NULL; -static UINT8 *PrehisleBack1Tiles = NULL; -static UINT8 *PrehisleBack2Tiles = NULL; -static UINT8 *PrehisleTempGfx = NULL; - -// Misc Variables, system control values, etc. -static INT32 ControlsInvert; -static UINT16 VidControl[7]; -static INT32 SoundLatch; - -// CPU Interleave Variables -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -// Dip Switch and Input Definitions -static struct BurnInputInfo PrehisleInputList[] = { - {"Coin 1" , BIT_DIGITAL , PrehisleInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , PrehisleInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , PrehisleInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , PrehisleInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , PrehisleInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , PrehisleInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , PrehisleInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , PrehisleInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , PrehisleInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , PrehisleInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , PrehisleInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , PrehisleInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , PrehisleInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , PrehisleInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , PrehisleInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , PrehisleInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , PrehisleInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , PrehisleInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &PrehisleReset , "reset" }, - {"Service" , BIT_DIGITAL , PrehisleInputPort2 + 2, "service" }, - {"Diagnostics" , BIT_DIGITAL , PrehisleInputPort2 + 3, "diag" }, - {"Tilt" , BIT_DIGITAL , PrehisleInputPort2 + 4, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, PrehisleDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, PrehisleDip + 1 , "dip" }, -}; - -STDINPUTINFO(Prehisle) - -inline void PrehisleClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -inline void PrehisleMakeInputs() -{ - // Reset Inputs - PrehisleInput[0] = PrehisleInput[1] = PrehisleInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - PrehisleInput[0] |= (PrehisleInputPort0[i] & 1) << i; - PrehisleInput[1] |= (PrehisleInputPort1[i] & 1) << i; - PrehisleInput[2] |= (PrehisleInputPort2[i] & 1) << i; - } - - // Clear Opposites - PrehisleClearOpposites(&PrehisleInput[0]); - PrehisleClearOpposites(&PrehisleInput[1]); -} - -static struct BurnDIPInfo PrehisleDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Display" }, - {0x16, 0x01, 0x01, 0x01, "Normal" }, - {0x16, 0x01, 0x01, 0x00, "Inverse" }, - - {0 , 0xfe, 0 , 2 , "Level Select" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Bonus" }, - {0x16, 0x01, 0x04, 0x04, "2nd" }, - {0x16, 0x01, 0x04, 0x00, "Every" }, - -// {0 , 0xfe, 0 , 2 , "Unknown" }, -// {0x16, 0x01, 0x08, 0x08, "Off" }, -// {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x16, 0x01, 0x30, 0x30, "A 1-1 B 1-1" }, - {0x16, 0x01, 0x30, 0x20, "A 2-1 B 1-2" }, - {0x16, 0x01, 0x30, 0x10, "A 3-1 B 1-3" }, - {0x16, 0x01, 0x30, 0x00, "A 4-1 B 1-4" }, - - {0 , 0xfe, 0 , 4 , "Hero" }, - {0x16, 0x01, 0xc0, 0x80, "2" }, - {0x16, 0x01, 0xc0, 0xc0, "3" }, - {0x16, 0x01, 0xc0, 0x40, "4" }, - {0x16, 0x01, 0xc0, 0x00, "5" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Level" }, - {0x17, 0x01, 0x03, 0x02, "1 (Easy)" }, - {0x17, 0x01, 0x03, 0x03, "2 (Standard)" }, - {0x17, 0x01, 0x03, 0x01, "3 (Middle)" }, - {0x17, 0x01, 0x03, 0x00, "4 (Difficult)" }, - - {0 , 0xfe, 0 , 4 , "Game Mode" }, - {0x17, 0x01, 0x0c, 0x08, "Demo Sound Off" }, - {0x17, 0x01, 0x0c, 0x0c, "Demo Sound On" }, - {0x17, 0x01, 0x0c, 0x00, "Stop Video" }, - {0x17, 0x01, 0x0c, 0x04, "Never Finish" }, - - {0 , 0xfe, 0 , 4 , "Bonus 1st/2nd" }, - {0x17, 0x01, 0x30, 0x30, "100000/200000" }, - {0x17, 0x01, 0x30, 0x20, "150000/300000" }, - {0x17, 0x01, 0x30, 0x10, "300000/500000" }, - {0x17, 0x01, 0x30, 0x00, "No Bonus" }, - - {0 , 0xfe, 0 , 2 , "Continue" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Prehisle) - -// Rom Definitions -static struct BurnRomInfo PrehisleRomDesc[] = { - { "gt-e2.2h", 0x20000, 0x7083245a, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "gt-e3.3h", 0x20000, 0x6d8cdf58, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "gt15.b15", 0x08000, 0xac652412, BRF_GRA }, // 2 Text Layer Tiles - { "pi8914.b14", 0x40000, 0x207d6187, BRF_GRA }, // 3 Background2 Layer Tiles - { "pi8916.h16", 0x40000, 0x7cffe0f6, BRF_GRA }, // 4 Background1 Layer Tiles - { "pi8910.k14", 0x80000, 0x5a101b0b, BRF_GRA }, // 5 Sprite Layer Tiles - { "gt5.5", 0x20000, 0x3d3ab273, BRF_GRA }, // 6 Sprite Layer Tiles - { "gt11.11", 0x10000, 0xb4f0fcf0, BRF_GRA }, // 7 Background 2 TileMap - - { "gt1.1", 0x10000, 0x80a4c093, BRF_SND }, // 8 Z80 Program Code - - { "gt4.4", 0x20000, 0x85dfb9ec, BRF_SND }, // 9 ADPCM Samples -}; - - -STD_ROM_PICK(Prehisle) -STD_ROM_FN(Prehisle) - -static struct BurnRomInfo PrehisluRomDesc[] = { - { "gt-u2.2h", 0x20000, 0xa14f49bb, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "gt-u3.3h", 0x20000, 0xf165757e, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "gt15.b15", 0x08000, 0xac652412, BRF_GRA }, // 2 Text Layer Tiles - { "pi8914.b14", 0x40000, 0x207d6187, BRF_GRA }, // 3 Background2 Layer Tiles - { "pi8916.h16", 0x40000, 0x7cffe0f6, BRF_GRA }, // 4 Background1 Layer Tiles - { "pi8910.k14", 0x80000, 0x5a101b0b, BRF_GRA }, // 5 Sprite Layer Tiles - { "gt5.5", 0x20000, 0x3d3ab273, BRF_GRA }, // 6 Sprite Layer Tiles - { "gt11.11", 0x10000, 0xb4f0fcf0, BRF_GRA }, // 7 Background 2 TileMap - - { "gt1.1", 0x10000, 0x80a4c093, BRF_SND }, // 8 Z80 Program Code - - { "gt4.4", 0x20000, 0x85dfb9ec, BRF_SND }, // 9 ADPCM Samples -}; - - -STD_ROM_PICK(Prehislu) -STD_ROM_FN(Prehislu) - -static struct BurnRomInfo PrehislkRomDesc[] = { - { "gt-k2.2h", 0x20000, 0xf2d3544d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "gt-k3.3h", 0x20000, 0xebf7439b, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "gt15.b15", 0x08000, 0xac652412, BRF_GRA }, // 2 Text Layer Tiles - { "pi8914.b14", 0x40000, 0x207d6187, BRF_GRA }, // 3 Background2 Layer Tiles - { "pi8916.h16", 0x40000, 0x7cffe0f6, BRF_GRA }, // 4 Background1 Layer Tiles - { "pi8910.k14", 0x80000, 0x5a101b0b, BRF_GRA }, // 5 Sprite Layer Tiles - { "gt5.5", 0x20000, 0x3d3ab273, BRF_GRA }, // 6 Sprite Layer Tiles - { "gt11.11", 0x10000, 0xb4f0fcf0, BRF_GRA }, // 7 Background 2 TileMap - - { "gt1.1", 0x10000, 0x80a4c093, BRF_SND }, // 8 Z80 Program Code - - { "gt4.4", 0x20000, 0x85dfb9ec, BRF_SND }, // 9 ADPCM Samples -}; - - -STD_ROM_PICK(Prehislk) -STD_ROM_FN(Prehislk) - -static struct BurnRomInfo GensitouRomDesc[] = { - { "gt-j2.2h", 0x20000, 0xa2da0b6b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "gt-j3.3h", 0x20000, 0xc1a0ae8e, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "gt15.b15", 0x08000, 0xac652412, BRF_GRA }, // 2 Text Layer Tiles - { "pi8914.b14", 0x40000, 0x207d6187, BRF_GRA }, // 3 Background2 Layer Tiles - { "pi8916.h16", 0x40000, 0x7cffe0f6, BRF_GRA }, // 4 Background1 Layer Tiles - { "pi8910.k14", 0x80000, 0x5a101b0b, BRF_GRA }, // 5 Sprite Layer Tiles - { "gt5.5", 0x20000, 0x3d3ab273, BRF_GRA }, // 6 Sprite Layer Tiles - { "gt11.11", 0x10000, 0xb4f0fcf0, BRF_GRA }, // 7 Background 2 TileMap - - { "gt1.1", 0x10000, 0x80a4c093, BRF_SND }, // 8 Z80 Program Code - - { "gt4.4", 0x20000, 0x85dfb9ec, BRF_SND }, // 9 ADPCM Samples -}; - - -STD_ROM_PICK(Gensitou) -STD_ROM_FN(Gensitou) - -static struct BurnRomInfo PrehislbRomDesc[] = { - // world bootleg using 64k*8 UVEPROMs, program and sound unchanged, sprites and background tilemaps altered - { "u_h1.bin", 0x10000, 0x04c1703b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "u_h3.bin", 0x10000, 0x62f04cd1, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - { "u_j2.bin", 0x10000, 0x7b12501d, BRF_ESS | BRF_PRG }, // 2 68000 Program Code - { "u_j3.bin", 0x10000, 0x2a86f7c4, BRF_ESS | BRF_PRG }, // 3 68000 Program Code - - { "l_a17.bin", 0x08000, 0xac652412, BRF_GRA }, // 4 Text Layer Tiles - { "l_b17.bin", 0x10000, 0x65a22ffc, BRF_GRA }, // 5 Background2 Layer Tiles - { "l_b16.bin", 0x10000, 0xb1e1f527, BRF_GRA }, // 6 Background2 Layer Tiles - { "l_b14.bin", 0x10000, 0x28e94d40, BRF_GRA }, // 7 Background2 Layer Tiles - { "l_b13.bin", 0x10000, 0x4dbb557a, BRF_GRA }, // 8 Background2 Layer Tiles - { "l_h17.bin", 0x10000, 0x79c42316, BRF_GRA }, // 9 Background1 Layer Tiles - { "l_h15.bin", 0x10000, 0x50e31fb0, BRF_GRA }, // 10 Background1 Layer Tiles - { "l_f17.bin", 0x10000, 0x2af1739d, BRF_GRA }, // 11 Background1 Layer Tiles - { "l_f15.bin", 0x10000, 0xcac11327, BRF_GRA }, // 12 Background1 Layer Tiles - - { "u_k12.bin", 0x10000, 0x4b0215f0, BRF_GRA }, // 13 Sprite Layer Tiles - { "u_k13.bin", 0x10000, 0x68b8a698, BRF_GRA }, // 14 Sprite Layer Tiles - { "u_j4.bin", 0x10000, 0x06ce7b57, BRF_GRA }, // 15 Sprite Layer Tiles - { "u_j5.bin", 0x10000, 0x2ee8b401, BRF_GRA }, // 16 Sprite Layer Tiles - { "u_j7.bin", 0x10000, 0x35656cbc, BRF_GRA }, // 17 Sprite Layer Tiles - { "u_j8.bin", 0x10000, 0x1e7e9336, BRF_GRA }, // 18 Sprite Layer Tiles - { "u_j10.bin", 0x10000, 0x785bf046, BRF_GRA }, // 19 Sprite Layer Tiles - { "u_j11.bin", 0x10000, 0xc306b9fa, BRF_GRA }, // 20 Sprite Layer Tiles - { "u_j12.bin", 0x10000, 0x5ba5bbed, BRF_GRA }, // 21 Sprite Layer Tiles - { "u_j13.bin", 0x10000, 0x007dee47, BRF_GRA }, // 22 Sprite Layer Tiles // modified by bootleggers - - { "l_a6.bin", 0x10000, 0xe2b9a44b, BRF_GRA }, // 23 Background 2 TileMap // modified by bootleggers - - { "u_e12.bin", 0x10000, 0x80a4c093, BRF_SND }, // 24 Z80 Program Code - - { "u_f14.bin", 0x10000, 0x2fb32933, BRF_SND }, // 25 ADPCM Samples - { "u_j14.bin", 0x10000, 0x32d5f7c9, BRF_SND }, // 26 ADPCM Samples -}; - - -STD_ROM_PICK(Prehislb) -STD_ROM_FN(Prehislb) - -// Misc Driver Functions and Memory Handlers -INT32 PrehisleDoReset() -{ - ControlsInvert = 0; - SoundLatch = 0; - VidControl[0] = VidControl[1] = VidControl[2] = VidControl[3] = VidControl[4] = VidControl[5] = VidControl[6] = 0; - - SekOpen(0); - SekReset(); - SekClose(); - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - UPD7759Reset(); - - return 0; -} - -// ---------------------------------------------------------------------------- -// Callbacks for the FM chip - -static void prehisleFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 prehisleSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -// VBlank - -inline UINT16 PrehisleVBlankRegister() -{ - INT32 nCycles = SekTotalCycles(); - - // 262 == approximate number of scanlines on an arcade monitor - if (nCycles >= (262 - 16) * ((9000000 / 60) / 262)) { - return 0x80; - } else { - if (nCycles < (262 - 210 - 16) * ((9000000 / 60) / 262)) { - return 0x80; - } - } - - return 0x00; -} - -UINT16 __fastcall PrehisleReadWord(UINT32 a) -{ - switch (a) { - case 0x0e0010: { - return 0xff - PrehisleInput[1]; - } - - case 0x0e0020: { - return 0xff - PrehisleInput[2]; - } - - case 0x0e0040: { - return 0xff - (PrehisleInput[0] ^ ControlsInvert); - } - - case 0x0e0042: { - return PrehisleDip[0]; - } - - case 0x0e0044: { - return PrehisleDip[1] + PrehisleVBlankRegister(); - } - } - - return 0; -} - -void __fastcall PrehisleWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x0f0000: { - VidControl[0] = d; - return; - } - - case 0x0f0010: { - VidControl[1] = d; - return; - } - - case 0x0f0020: { - VidControl[2] = d; - return; - } - - case 0x0f0030: { - VidControl[3] = d; - return; - } - - case 0x0f0046: { - ControlsInvert = d ? 0xff : 0x00; - return; - } - - case 0x0f0050: { - VidControl[4] = d; - return; - } - - case 0x0f0052: { - VidControl[5] = d; - return; - } - - case 0x0f0060: { - VidControl[6] = d; - return; - } - - case 0x0f0070: { - SoundLatch = d & 0xff; - ZetNmi(); - return; - } - } -} - -UINT8 __fastcall PrehisleZ80PortRead(UINT16 a) -{ - a &= 0xff; - switch (a) { - case 0x00: { - return BurnYM3812Read(0, 0); - } - } - - return 0; -} - -void __fastcall PrehisleZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - switch (a) { - case 0x00: { - BurnYM3812Write(0, 0, d); - return; - } - - case 0x20: { - BurnYM3812Write(0, 1, d); - return; - } - - case 0x40: { - UPD7759PortWrite(0,d); - UPD7759StartWrite(0,0); - UPD7759StartWrite(0,1); - return; - } - - case 0x80: { - UPD7759ResetWrite(0,d); - return; - } - } -} - -UINT8 __fastcall PrehisleZ80Read(UINT16 a) -{ - switch (a) { - case 0xf800: { - return SoundLatch; - } - } - - return 0; -} - -// Function to Allocate and Index required memory -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - PrehisleRom = Next; Next += 0x40000; - PrehisleZ80Rom = Next; Next += 0x10000; - PrehisleTileMapRom = Next; Next += 0x10000; - PrehisleADPCMSamples = Next; Next += 0x20000; - - RamStart = Next; - - PrehisleRam = Next; Next += 0x04000; - PrehisleVideoRam = Next; Next += 0x00800; - PrehisleSpriteRam = Next; Next += 0x00800; - PrehisleVideo2Ram = Next; Next += 0x04000; - PrehislePaletteRam = Next; Next += 0x00800; - PrehisleZ80Ram = Next; Next += 0x00800; - - RamEnd = Next; - - PrehisleTextTiles = Next; Next += (1024 * 8 * 8); - PrehisleSprites = Next; Next += (5120 * 16 * 16); - PrehisleBack1Tiles = Next; Next += (2048 * 16 * 16); - PrehisleBack2Tiles = Next; Next += (2048 * 16 * 16); - PrehislePalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 CharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 TilePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TileXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 512, 516, 520, 524, 528, 532, 536, 540 }; -static INT32 TileYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480 }; - -// Driver Init and Exit Functions -INT32 PrehisleInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - PrehisleTempGfx = (UINT8*)BurnMalloc(0xa0000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(PrehisleRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and decode Text Tiles rom - memset(PrehisleTempGfx, 0, 0xa0000); - nRet = BurnLoadRom(PrehisleTempGfx, 2, 1); if (nRet != 0) return 1; - GfxDecode(1024, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, PrehisleTempGfx, PrehisleTextTiles); - - // Load and decode Background2 Tile rom - memset(PrehisleTempGfx, 0, 0xa0000); - nRet = BurnLoadRom(PrehisleTempGfx, 3, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, PrehisleTempGfx, PrehisleBack2Tiles); - - // Load and decode Background1 Tile rom - memset(PrehisleTempGfx, 0, 0xa0000); - nRet = BurnLoadRom(PrehisleTempGfx, 4, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, PrehisleTempGfx, PrehisleBack1Tiles); - - // Load and decode Sprite roms - memset(PrehisleTempGfx, 0, 0xa0000); - nRet = BurnLoadRom(PrehisleTempGfx + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x80000, 6, 1); if (nRet != 0) return 1; - GfxDecode(5120, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, PrehisleTempGfx, PrehisleSprites); - - BurnFree(PrehisleTempGfx); - - // Load Background2 Tilemap rom - nRet = BurnLoadRom(PrehisleTileMapRom, 7, 1); if (nRet != 0) return 1; - - // Load Z80 Program rom - nRet = BurnLoadRom(PrehisleZ80Rom, 8, 1); if (nRet != 0) return 1; - - // Load ADPCM Samples - nRet = BurnLoadRom(PrehisleADPCMSamples, 9, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(PrehisleRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(PrehisleRam , 0x070000, 0x073fff, MAP_RAM); - SekMapMemory(PrehisleVideoRam , 0x090000, 0x0907ff, MAP_RAM); - SekMapMemory(PrehisleSpriteRam , 0x0a0000, 0x0a07ff, MAP_RAM); - SekMapMemory(PrehisleVideo2Ram , 0x0b0000, 0x0b3fff, MAP_RAM); - SekMapMemory(PrehislePaletteRam, 0x0d0000, 0x0d07ff, MAP_RAM); - SekSetReadWordHandler(0, PrehisleReadWord); - SekSetWriteWordHandler(0, PrehisleWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, PrehisleZ80Rom); - ZetMapArea(0x0000, 0xefff, 2, PrehisleZ80Rom); - ZetMapArea(0xf000, 0xf7ff, 0, PrehisleZ80Ram); - ZetMapArea(0xf000, 0xf7ff, 1, PrehisleZ80Ram); - ZetMapArea(0xf000, 0xf7ff, 2, PrehisleZ80Ram); - ZetSetReadHandler(PrehisleZ80Read); - ZetSetInHandler(PrehisleZ80PortRead); - ZetSetOutHandler(PrehisleZ80PortWrite); - ZetClose(); - - BurnYM3812Init(1, 4000000, &prehisleFMIRQHandler, &prehisleSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - UPD7759Init(0, UPD7759_STANDARD_CLOCK, PrehisleADPCMSamples); - UPD7759SetRoute(0, 0.90, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - PrehisleDoReset(); - - return 0; -} - -INT32 PrehislebInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - PrehisleTempGfx = (UINT8*)BurnMalloc(0xa0000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(PrehisleRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleRom + 0x20000, 3, 2); if (nRet != 0) return 1; - - // Load and decode Text Tiles rom - memset(PrehisleTempGfx, 0, 0xa0000); - nRet = BurnLoadRom(PrehisleTempGfx, 4, 1); if (nRet != 0) return 1; - GfxDecode(1024, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, PrehisleTempGfx, PrehisleTextTiles); - - // Load and decode Background2 Tile rom - memset(PrehisleTempGfx, 0, 0xa0000); - nRet = BurnLoadRom(PrehisleTempGfx + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x10000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x20000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x30000, 8, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, PrehisleTempGfx, PrehisleBack2Tiles); - - // Load and decode Background1 Tile rom - memset(PrehisleTempGfx, 0, 0xa0000); - nRet = BurnLoadRom(PrehisleTempGfx + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x10000,10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x20000,11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x30000,12, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, PrehisleTempGfx, PrehisleBack1Tiles); - - // Load and decode Sprite roms - memset(PrehisleTempGfx, 0, 0xa0000); - nRet = BurnLoadRom(PrehisleTempGfx + 0x00000,13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x10000,14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x20000,15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x30000,16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x40000,17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x50000,18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x60000,19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x70000,20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x80000,21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleTempGfx + 0x90000,22, 1); if (nRet != 0) return 1; - GfxDecode(5120, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, PrehisleTempGfx, PrehisleSprites); - - BurnFree(PrehisleTempGfx); - - // Load Background2 Tilemap rom - nRet = BurnLoadRom(PrehisleTileMapRom,23, 1); if (nRet != 0) return 1; - - // Load Z80 Program rom - nRet = BurnLoadRom(PrehisleZ80Rom,24, 1); if (nRet != 0) return 1; - - // Load ADPCM Samples - nRet = BurnLoadRom(PrehisleADPCMSamples + 0x00000,25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(PrehisleADPCMSamples + 0x10000,26, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(PrehisleRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(PrehisleRam , 0x070000, 0x073fff, MAP_RAM); - SekMapMemory(PrehisleVideoRam , 0x090000, 0x0907ff, MAP_RAM); - SekMapMemory(PrehisleSpriteRam , 0x0a0000, 0x0a07ff, MAP_RAM); - SekMapMemory(PrehisleVideo2Ram , 0x0b0000, 0x0b3fff, MAP_RAM); - SekMapMemory(PrehislePaletteRam, 0x0d0000, 0x0d07ff, MAP_RAM); - SekSetReadWordHandler(0, PrehisleReadWord); - SekSetWriteWordHandler(0, PrehisleWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, PrehisleZ80Rom); - ZetMapArea(0x0000, 0xefff, 2, PrehisleZ80Rom); - ZetMapArea(0xf000, 0xf7ff, 0, PrehisleZ80Ram); - ZetMapArea(0xf000, 0xf7ff, 1, PrehisleZ80Ram); - ZetMapArea(0xf000, 0xf7ff, 2, PrehisleZ80Ram); - ZetSetReadHandler(PrehisleZ80Read); - ZetSetInHandler(PrehisleZ80PortRead); - ZetSetOutHandler(PrehisleZ80PortWrite); - ZetClose(); - - BurnYM3812Init(1, 4000000, &prehisleFMIRQHandler, &prehisleSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - UPD7759Init(0, UPD7759_STANDARD_CLOCK, PrehisleADPCMSamples); - UPD7759SetRoute(0, 0.90, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - PrehisleDoReset(); - - return 0; -} - -INT32 PrehisleExit() -{ - BurnYM3812Exit(); - UPD7759Exit(); - - SekExit(); - ZetExit(); - - GenericTilesExit(); - - BurnFree(Mem); - - return 0; -} - -// Graphics Emulation -void PrehisleRenderBack2TileLayer() -{ - INT32 TileBase, mx, my, Tile, Colour, Scrollx, Scrolly, x, y, Flipx; - - TileBase = ((VidControl[3] >> 4) & 0x3ff) * 32; - TileBase &= 0x7fff; - Scrollx = -(VidControl[3] & 0x0f); - Scrolly = -VidControl[2]; - - for (mx = 0; mx < 17; mx++) { - for (my = 0; my < 32; my++) { - Tile = (PrehisleTileMapRom[2 * TileBase + 0] << 8) + PrehisleTileMapRom[2 * TileBase + 1]; - Colour = Tile >> 12; - Flipx = Tile & 0x800; - x = 16 * mx + Scrollx; - y = (16 * my + Scrolly) & 0x1ff; - y -= 16; - - if (x > 15 && x < 240 && y > 15 && y < 208) { - if (!Flipx) { - Render16x16Tile(pTransDraw, Tile & 0x7ff, x, y, Colour, 4, 768, PrehisleBack2Tiles); - } else { - Render16x16Tile_FlipX(pTransDraw, Tile & 0x7ff, x, y, Colour, 4, 768, PrehisleBack2Tiles); - } - } else { - if (!Flipx) { - Render16x16Tile_Clip(pTransDraw, Tile & 0x7ff, x, y, Colour, 4, 768, PrehisleBack2Tiles); - } else { - Render16x16Tile_FlipX_Clip(pTransDraw, Tile & 0x7ff, x, y, Colour, 4, 768, PrehisleBack2Tiles); - } - } - - TileBase ++; - if (TileBase == 0x8000) TileBase = 0; - } - } -} - -void PrehisleRenderBack1TileLayer() -{ - INT32 TileBase, mx, my, Tile, Colour, Scrollx, Scrolly, x, y, Flipy; - - TileBase = ((VidControl[1] >> 4) & 0xff) * 32; - TileBase &= 0x1fff; - Scrollx = -(VidControl[1] & 0x0f); - Scrolly = -VidControl[0]; - - for (mx = 0; mx < 17; mx++) { - for (my = 0; my < 32; my++) { - Tile = (PrehisleVideo2Ram[2 * TileBase + 1] << 8) + PrehisleVideo2Ram[2 * TileBase + 0]; - Colour = Tile >> 12; - Flipy = Tile & 0x800; - x = 16 * mx + Scrollx; - y = (16 * my + Scrolly) & 0x1ff; - y -= 16; - - if (x > 15 && x < 240 && y > 15 && y < 208) { - if (!Flipy) { - Render16x16Tile_Mask(pTransDraw, Tile & 0x7ff, x, y, Colour, 4, 0x0f, 512, PrehisleBack1Tiles); - } else { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile & 0x7ff, x, y, Colour, 4, 0x0f, 512, PrehisleBack1Tiles); - } - } else { - if (!Flipy) { - Render16x16Tile_Mask_Clip(pTransDraw, Tile & 0x7ff, x, y, Colour, 4, 0x0f, 512, PrehisleBack1Tiles); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile & 0x7ff, x, y, Colour, 4, 0x0f, 512, PrehisleBack1Tiles); - } - } - - TileBase ++; - if (TileBase == 0x2000) TileBase = 0; - } - } -} - -void PrehisleRenderSpriteLayer() -{ - INT32 offs; - - for (offs = 0; offs < 0x800; offs += 8) { - INT32 x, y, Sprite, Colour, Flipx, Flipy; - - y = (PrehisleSpriteRam[offs + 1] << 8) + PrehisleSpriteRam[offs + 0]; - if (y > 254) continue; - y -= 16; - x = (PrehisleSpriteRam[offs + 3] << 8) + PrehisleSpriteRam[offs + 2]; - if (x & 0x200) x = -(0xff - (x & 0xff)); - if (x > 256) continue; - - Sprite = (PrehisleSpriteRam[offs + 5] << 8) + PrehisleSpriteRam[offs + 4]; - Colour = ((PrehisleSpriteRam[offs + 7] << 8) + PrehisleSpriteRam[offs + 6]) >> 12; - Flipy = Sprite & 0x8000; - Flipx = Sprite & 0x4000; - Sprite &= 0x1fff; - if (Sprite > 0x13ff) Sprite = 0x13ff; - - if (x > 15 && x < 240 && y > 15 && y < 208) { - if (!Flipy) { - if (!Flipx) { - Render16x16Tile_Mask(pTransDraw, Sprite, x, y, Colour, 4, 0x0f, 256, PrehisleSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Sprite, x, y, Colour, 4, 0x0f, 256, PrehisleSprites); - } - } else { - if (!Flipx) { - Render16x16Tile_Mask_FlipY(pTransDraw, Sprite, x, y, Colour, 4, 0x0f, 256, PrehisleSprites); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Sprite, x, y, Colour, 4, 0x0f, 256, PrehisleSprites); - } - } - } else { - if (!Flipy) { - if (!Flipx) { - Render16x16Tile_Mask_Clip(pTransDraw, Sprite, x, y, Colour, 4, 0x0f, 256, PrehisleSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Sprite, x, y, Colour, 4, 0x0f, 256, PrehisleSprites); - } - } else { - if (!Flipx) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Sprite, x, y, Colour, 4, 0x0f, 256, PrehisleSprites); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Sprite, x, y, Colour, 4, 0x0f, 256, PrehisleSprites); - } - } - } - } -} - -void PrehisleRenderTextLayer() -{ - INT32 offs, mx, my, Colour, Tile, x, y; - - mx = -1; - my = 0; - for (offs = 0x000; offs < 0x800; offs+=2) { - mx++; - if (mx == 32) { - mx = 0; - my++; - } - Tile = (PrehisleVideoRam[offs + 1] << 8) + PrehisleVideoRam[offs + 0]; - Colour = Tile >> 12; - x = 8 * mx; - y = 8 * my; - y -= 16; - - if (x > 7 && x < 248 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Tile & 0xfff, x, y, Colour, 4, 0x0f, 0, PrehisleTextTiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Tile & 0xfff, x, y, Colour, 4, 0x0f, 0, PrehisleTextTiles); - } - } -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 12) & 0x0f; - g = (nColour >> 8) & 0x0f; - b = (nColour >> 4) & 0x0f; - - r = (r << 4) | r; - g = (g << 4) | g; - b = (b << 4) | b; - - return BurnHighCol(r, g, b, 0); -} - -INT32 PrehisleCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)PrehislePaletteRam, pd = PrehislePalette; i < 0x800; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } - - return 0; -} - -void PrehisleDraw() -{ - PrehisleCalcPalette(); - PrehisleRenderBack2TileLayer(); - PrehisleRenderBack1TileLayer(); - PrehisleRenderSpriteLayer(); - PrehisleRenderTextLayer(); - BurnTransferCopy(PrehislePalette); -} - -// Frame Function -INT32 PrehisleFrame() -{ - INT32 nInterleave = 1; - - if (PrehisleReset) PrehisleDoReset(); - - PrehisleMakeInputs(); - - nCyclesTotal[0] = 9000000 / 60; - nCyclesTotal[1] = 4000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekOpen(0); - ZetOpen(0); - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - UPD7759Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) PrehisleDraw(); - - return 0; -} - -// Scan RAM -static INT32 PrehisleScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029521; - } - - if (nAction & ACB_MEMORY_RAM) { // Scan all memory, devices & variables - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); // Scan 68000 - ZetScan(nAction); // Scan Z80 - - BurnYM3812Scan(nAction, pnMin); - UPD7759Scan(0, nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(PrehisleInput); - SCAN_VAR(PrehisleDip); - SCAN_VAR(ControlsInvert); - SCAN_VAR(VidControl); - SCAN_VAR(nCyclesDone); - } - - return 0; -} - -// Driver Declarations -struct BurnDriver BurnDrvPrehisle = { - "prehisle", NULL, NULL, NULL, "1989", - "Prehistoric Isle in 1930 (World)\0", NULL, "SNK", "Prehistoric Isle (SNK)", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, PrehisleRomInfo, PrehisleRomName, NULL, NULL, PrehisleInputInfo, PrehisleDIPInfo, - PrehisleInit, PrehisleExit, PrehisleFrame, NULL, PrehisleScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPrehislu = { - "prehisleu", "prehisle", NULL, NULL, "1989", - "Prehistoric Isle in 1930 (US)\0", NULL, "SNK of America", "Prehistoric Isle (SNK)", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, PrehisluRomInfo, PrehisluRomName, NULL, NULL, PrehisleInputInfo, PrehisleDIPInfo, - PrehisleInit, PrehisleExit, PrehisleFrame, NULL, PrehisleScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPrehislk = { - "prehislek", "prehisle", NULL, NULL, "1989", - "Prehistoric Isle in 1930 (Korea)\0", NULL, "SNK (Victor license)", "Prehistoric Isle (SNK)", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, PrehislkRomInfo, PrehislkRomName, NULL, NULL, PrehisleInputInfo, PrehisleDIPInfo, - PrehisleInit, PrehisleExit, PrehisleFrame, NULL, PrehisleScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGensitou = { - "gensitou", "prehisle", NULL, NULL, "1989", - "Genshi-Tou 1930's (Japan)\0", NULL, "SNK", "Prehistoric Isle (SNK)", - L"Genshi-Tou 1930's (Japan)\0\u539F\u59CB\u5CF6 1930's\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, GensitouRomInfo, GensitouRomName, NULL, NULL, PrehisleInputInfo, PrehisleDIPInfo, - PrehisleInit, PrehisleExit, PrehisleFrame, NULL, PrehisleScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPrehislb = { - "prehisleb", "prehisle", NULL, NULL, "1989", - "Prehistoric Isle in 1930 (World, bootleg)\0", NULL, "bootleg", "Prehistoric Isle (SNK)", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, PrehislbRomInfo, PrehislbRomName, NULL, NULL, PrehisleInputInfo, PrehisleDIPInfo, - PrehislebInit, PrehisleExit, PrehisleFrame, NULL, PrehisleScan, - NULL, 0x800, 256, 224, 4, 3 -}; \ No newline at end of file diff --git a/jan/src/burn/drv/pre90s/d_psychic5.cpp b/jan/src/burn/drv/pre90s/d_psychic5.cpp deleted file mode 100644 index 62a5acfe9..000000000 --- a/jan/src/burn/drv/pre90s/d_psychic5.cpp +++ /dev/null @@ -1,1173 +0,0 @@ -// FB Alpha Psychic 5 driver module -// Based on MAME driver by Jarek Parchanski - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" - -#define BG_SCROLLX_LSB 0x308 -#define BG_SCROLLX_MSB 0x309 -#define BG_SCROLLY_LSB 0x30a -#define BG_SCROLLY_MSB 0x30b -#define BG_SCREEN_MODE 0x30c -#define BG_PAL_INTENSITY_RG 0x1fe -#define BG_PAL_INTENSITY_BU 0x1ff - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80Rom1 = NULL; -static UINT8 *DrvZ80Rom2 = NULL; -static UINT8 *DrvZ80Ram1 = NULL; -static UINT8 *DrvZ80Ram2 = NULL; -static UINT8 *DrvPagedRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvBgTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT8 *DrvBlendTable = NULL; -static UINT16 *DrvTempDraw = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvRecalc = 0; -static UINT8 DrvSoundLatch = 0; -static UINT8 DrvFlipScreen = 0; -static UINT8 DrvRomBank = 0; -static UINT8 DrvVRamPage = 0; -static UINT8 DrvTitleScreen = 0; -static UINT8 DrvBgStatus = 0; -static UINT16 DrvBgScrollX = 0; -static UINT16 DrvBgScrollY = 0; -static INT32 DrvBgClipMode = 0; -static INT32 DrvBgClipMinX = 0; -static INT32 DrvBgClipMaxX = 0; -static INT32 DrvBgClipMinY = 0; -static INT32 DrvBgClipMaxY = 0; -static UINT8 DrvBgSx1 = 0; -static UINT8 DrvBgSy1 = 0; -static UINT8 DrvBgSy2 = 0; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xe9, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x11, 0x01, 0x08, 0x08, "Normal" }, - {0x11, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x10, 0x00, "Upright" }, - {0x11, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0xc0, 0x80, "2" }, - {0x11, 0x01, 0xc0, 0xc0, "3" }, - {0x11, 0x01, 0xc0, 0x40, "4" }, - {0x11, 0x01, 0xc0, 0x00, "5" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Invulnerability (Cheat)"}, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x12, 0x01, 0xe0, 0x00, "5 Coins 1 Play" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins 1 Play" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins 1 Play" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins 1 Play" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Play" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 2 Plays" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Plays" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Plays" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x12, 0x01, 0x1c, 0x00, "5 Coins 1 Play" }, - {0x12, 0x01, 0x1c, 0x04, "4 Coins 1 Play" }, - {0x12, 0x01, 0x1c, 0x08, "3 Coins 1 Play" }, - {0x12, 0x01, 0x1c, 0x0c, "2 Coins 1 Play" }, - {0x12, 0x01, 0x1c, 0x1c, "1 Coin 1 Play" }, - {0x12, 0x01, 0x1c, 0x18, "1 Coin 2 Plays" }, - {0x12, 0x01, 0x1c, 0x14, "1 Coin 3 Plays" }, - {0x12, 0x01, 0x1c, 0x10, "1 Coin 4 Plays" }, -}; - -STDDIPINFO(Drv) - -static struct BurnRomInfo DrvRomDesc[] = { -// "Oversea's version V2.00 CHANGED BY TAMIO NAKASATO" text present in ROM, various modifications (English names, more complete attract demo etc.) - { "myp5d", 0x08000, 0x1d40a8c7, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "myp5e", 0x10000, 0x2fa7e8c0, BRF_ESS | BRF_PRG }, // 1 - - { "myp5a", 0x10000, 0x6efee094, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "p5b", 0x10000, 0x7e3f87d4, BRF_GRA }, // 3 Sprites - { "p5c", 0x10000, 0x8710fedb, BRF_GRA }, // 4 - - { "myp5g", 0x10000, 0x617b074b, BRF_GRA }, // 5 BG Tiles - { "myp5h", 0x10000, 0xa9dfbe67, BRF_GRA }, // 6 - - { "p5f", 0x08000, 0x04d7e21c, BRF_GRA }, // 7 FG Tiles - - { "my10.7l", 0x00200, 0x6a7d13c0, BRF_OPT }, // 8 PROMs - { "my09.3t", 0x00400, 0x59e44236, BRF_OPT }, // 9 -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo Psychic5jRomDesc[] = { - { "p5d", 0x08000, 0x90259249, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "p5e", 0x10000, 0x72298f34, BRF_ESS | BRF_PRG }, // 1 - - { "p5a", 0x08000, 0x50060ecd, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "p5b", 0x10000, 0x7e3f87d4, BRF_GRA }, // 3 Sprites - { "p5c", 0x10000, 0x8710fedb, BRF_GRA }, // 4 - - { "p5g", 0x10000, 0xf9262f32, BRF_GRA }, // 5 BG Tiles - { "p5h", 0x10000, 0xc411171a, BRF_GRA }, // 6 - - { "p5f", 0x08000, 0x04d7e21c, BRF_GRA }, // 7 FG Tiles - - { "my10.7l", 0x00200, 0x6a7d13c0, BRF_OPT }, // 8 PROMs - { "my09.3t", 0x00400, 0x59e44236, BRF_OPT }, // 9 -}; - -STD_ROM_PICK(Psychic5j) -STD_ROM_FN(Psychic5j) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom1 = Next; Next += 0x20000; - DrvZ80Rom2 = Next; Next += 0x10000; - - RamStart = Next; - - DrvZ80Ram1 = Next; Next += 0x01800; - DrvZ80Ram2 = Next; Next += 0x00800; - DrvPagedRam = Next; Next += 0x04000; - DrvSpriteRam = Next; Next += 0x00600; - DrvBlendTable = Next; Next += 0x00300; - - RamEnd = Next; - - DrvChars = Next; Next += 1024 * 8 * 8; - DrvBgTiles = Next; Next += 1024 * 16 * 16; - DrvSprites = Next; Next += 1024 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x301 * sizeof(UINT32); - - DrvTempDraw = (UINT16*)Next; Next += 224 * 256 * sizeof(UINT16); - - MemEnd = Next; - - return 0; -} - -static void bankswitch_main() -{ - ZetMapMemory(DrvZ80Rom1 + 0x10000 + DrvRomBank * 0x4000, 0x8000, 0xbfff, MAP_ROM); -} - -static INT32 DrvDoReset() -{ - memset (RamStart, 0, RamEnd - RamStart); - - ZetOpen(0); - DrvRomBank = 0; - bankswitch_main(); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - BurnYM2203Reset(); - ZetClose(); - - DrvBgClipMode = 0; - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -static void DrvChangePalette(INT32 color, UINT32 offset) -{ - UINT8 lo = DrvPagedRam[0x2400 + (offset & ~1)]; - UINT8 hi = DrvPagedRam[0x2400 + (offset | 1)]; - - DrvBlendTable[color] = hi & 0x0f; - - DrvPalette[color] = BurnHighCol(pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4), 0); -} - -static void DrvRecalcPalette() -{ - for (INT32 offset = 0x400; offset <= 0x5ff; offset++) { - // Sprite color - DrvChangePalette(((offset >> 1) & 0xff) + 0x000, offset - 0x400); - } - - for (INT32 offset = 0x800; offset <= 0x9ff; offset++) { - // BG color - DrvChangePalette(((offset >> 1) & 0xff) + 0x100, offset - 0x400); - } - - for (INT32 offset = 0xa00; offset <= 0xbff; offset++) { - // Text color - DrvChangePalette(((offset >> 1) & 0xff) + 0x200, offset - 0x400); - } - - DrvRecalc = 0; -} - -static UINT8 __fastcall DrvZ80Read1(UINT16 a) -{ - if (a >= 0xc000 && a <= 0xdfff) { - UINT8* PagedRAM = (UINT8*)DrvPagedRam; - if (DrvVRamPage == 1) PagedRAM = (UINT8*)DrvPagedRam + 0x2000; - UINT32 offset = a - 0xc000; - - if (DrvVRamPage == 1) { - switch (offset) { - case 0x00: return 0xff - DrvInput[0]; - case 0x01: return 0xff - DrvInput[1]; - case 0x02: return 0xff - DrvInput[2]; - case 0x03: return DrvDip[0]; - case 0x04: return DrvDip[1]; - } - } - - return PagedRAM[offset]; - } - - switch (a) { - case 0xf001: { - // nop - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -static void __fastcall DrvZ80Write1(UINT16 a, UINT8 d) -{ - if (a >= 0xc000 && a <= 0xdfff) { - UINT8* PagedRAM = (UINT8*)DrvPagedRam; - if (DrvVRamPage == 1) PagedRAM = (UINT8*)DrvPagedRam + 0x2000; - UINT32 offset = a - 0xc000; - - PagedRAM[offset] = d; - - if (offset == BG_SCROLLX_LSB || offset == BG_SCROLLX_MSB) { - DrvBgScrollX = (DrvPagedRam[0x2000 + BG_SCROLLX_LSB] + ((DrvPagedRam[0x2000 + BG_SCROLLX_MSB] & 0x03) << 8)) & 0x3ff; - } - - if (offset == BG_SCROLLY_LSB || offset == BG_SCROLLY_MSB) { - DrvBgScrollY = (DrvPagedRam[0x2000 + BG_SCROLLY_LSB] + ((DrvPagedRam[0x2000 + BG_SCROLLY_MSB] & 0x01) << 8)) & 0x1ff; - } - - if (offset == BG_SCREEN_MODE) { - DrvBgStatus = DrvPagedRam[0x2000 + BG_SCREEN_MODE]; - } - - if (offset >= 0x400 && offset <= 0x5ff) { - // Sprite color - DrvChangePalette(((offset >> 1) & 0xff) + 0x000, offset - 0x400); - } - - if (offset >= 0x800 && offset <= 0x9ff) { - // BG color - DrvChangePalette(((offset >> 1) & 0xff) + 0x100, offset - 0x400); - } - - if (offset >= 0xa00 && offset <= 0xbff) { - // Text color - DrvChangePalette(((offset >> 1) & 0xff) + 0x200, offset - 0x400); - } - - return; - } - - if (a >= 0xf006 && a <= 0xf1ff) return; // nop - - switch (a) { - case 0xf000: { - DrvSoundLatch = d; - return; - } - - case 0xf001: { - DrvFlipScreen = d & 0x80; - return; - } - - case 0xf002: { - DrvRomBank = d & 0x03; - bankswitch_main(); - return; - } - - case 0xf003: { - DrvVRamPage = d & 0x01; - return; - } - - case 0xf004: { - // nop - return; - } - - case 0xf005: { - DrvTitleScreen = d & 0x01; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -static UINT8 __fastcall DrvZ80PortRead1(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -static void __fastcall DrvZ80PortWrite1(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static UINT8 __fastcall DrvZ80Read2(UINT16 a) -{ - switch (a) { - case 0xe000: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -static void __fastcall DrvZ80Write2(UINT16 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -static UINT8 __fastcall DrvZ80PortRead2(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -static void __fastcall DrvZ80PortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x01: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0x80: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0x81: { - BurnYM2203Write(1, 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 CharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 SpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 SpriteXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 512, 516, 520, 524, 528, 532, 536, 540 }; -static INT32 SpriteYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480 }; - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 5000000); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 5000000; -} - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x20000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 2, 1); if (nRet != 0) return 1; - - // Load and decode the sprites - nRet = BurnLoadRom(DrvTempRom + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 4, 1); if (nRet != 0) return 1; - GfxDecode(1024, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, DrvTempRom, DrvSprites); - - // Load and decode the bg tiles - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 6, 1); if (nRet != 0) return 1; - GfxDecode(1024, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, DrvTempRom, DrvBgTiles); - - // Load and decode the chars - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom, 7, 1); if (nRet != 0) return 1; - GfxDecode(1024, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - BurnFree(DrvTempRom); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(DrvZ80Read1); - ZetSetWriteHandler(DrvZ80Write1); - ZetSetInHandler(DrvZ80PortRead1); - ZetSetOutHandler(DrvZ80PortWrite1); - ZetMapMemory(DrvZ80Rom1 + 0x00000, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80Rom1 + 0x10000, 0x8000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80Ram1 , 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvSpriteRam , 0xf200, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvZ80Ram1 + 0x1000 , 0xf800, 0xffff, MAP_RAM); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(DrvZ80Read2); - ZetSetWriteHandler(DrvZ80Write2); - ZetSetInHandler(DrvZ80PortRead2); - ZetSetOutHandler(DrvZ80PortWrite2); - ZetMapMemory(DrvZ80Rom2, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80Ram2, 0xc000, 0xc7ff, MAP_RAM); - ZetClose(); - - BurnYM2203Init(2, 1500000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(5000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.08, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.08, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.08, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.08, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.08, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.08, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - BurnSetRefreshRate(54); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - BurnYM2203Exit(); - - GenericTilesExit(); - - DrvSoundLatch = 0; - DrvFlipScreen = 0; - DrvRomBank = 0; - DrvVRamPage = 0; - DrvTitleScreen = 0; - DrvBgScrollX = 0; - DrvBgScrollY = 0; - DrvBgStatus = 0; - DrvBgClipMode = 0; - - BurnFree(Mem); - - return 0; -} - -static inline UINT32 DrvBlendFunction(UINT32 dest, UINT32 addMe, UINT8 alpha) -{ - INT32 r = dest >> 16; - INT32 g = (dest >> 8) & 0xff; - INT32 b = dest & 0xff; - - UINT8 ir = addMe >> 16; - UINT8 ig = addMe >> 8; - UINT8 ib = addMe; - - if (alpha & 4) { r -= ir; if (r < 0) r = 0; } else { r += ir; if (r > 255) r = 255; } - if (alpha & 2) { g -= ig; if (g < 0) g = 0; } else { g += ig; if (g > 255) g = 255; } - if (alpha & 1) { b -= ib; if (b < 0) b = 0; } else { b += ib; if (b > 255) b = 255; } - - return (r << 16) | (g << 8) | b; -} - -static void DrvSetBgColourIntensity() -{ - UINT16 intensity = DrvPagedRam[0x2400 + BG_PAL_INTENSITY_BU] | (DrvPagedRam[0x2400 + BG_PAL_INTENSITY_RG] << 8); - - UINT8 ir = pal4bit(intensity >> 12); - UINT8 ig = pal4bit(intensity >> 8); - UINT8 ib = pal4bit(intensity >> 4); - UINT8 ix = intensity & 0x0f; - - UINT32 irgb = (ir << 16) + (ig << 8) + (ib); - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 lo = DrvPagedRam[0x2800+i*2]; - UINT8 hi = DrvPagedRam[0x2800+i*2+1]; - - UINT8 r = pal4bit(lo >> 4); - UINT8 g = pal4bit(lo); - UINT8 b = pal4bit(hi >> 4); - - if (DrvBgStatus & 2) - { - UINT8 val = (r + g + b) / 3; - UINT32 c = DrvBlendFunction((val<<16)+(val<<8)+val,irgb,ix); - DrvPalette[0x100+i] = BurnHighCol(c>>16, (c>>8)&0xff, c&0xff, 0); - } - else - { - if (!(DrvTitleScreen & 1)) - { - UINT32 c = DrvBlendFunction((r<<16)+(g<<8)+b,irgb,ix); - DrvPalette[0x100+i] = BurnHighCol(c>>16, (c>>8)&0xff, c&0xff, 0); - } - } - } -} - -static void DrvEnableBgClipMode() -{ - DrvBgClipMinX = 0; - DrvBgClipMinY = 0; - DrvBgClipMaxX = nScreenWidth; - DrvBgClipMaxY = nScreenHeight; - - if (!(DrvTitleScreen & 1)) - { - DrvBgClipMode = 0; - DrvBgSx1 = DrvBgSy1 = DrvBgSy2 = 0; - } - else - { - INT32 sy1_old = DrvBgSy1; - INT32 sx1_old = DrvBgSx1; - INT32 sy2_old = DrvBgSy2; - - DrvBgSy1 = DrvSpriteRam[11]; - DrvBgSx1 = DrvSpriteRam[12]; - DrvBgSy2 = DrvSpriteRam[11+128]; - - switch (DrvBgClipMode) - { - case 0: case 4: if (sy1_old != DrvBgSy1) DrvBgClipMode++; break; - case 2: case 6: if (sy2_old != DrvBgSy2) DrvBgClipMode++; break; - case 8: case 10: - case 12: case 14: if (sx1_old != DrvBgSx1) DrvBgClipMode++; break; - case 1: case 5: if (DrvBgSy1 == 0xf0) DrvBgClipMode++; break; - case 3: case 7: if (DrvBgSy2 == 0xf0) DrvBgClipMode++; break; - case 9: case 11: if (DrvBgSx1 == 0xf0) DrvBgClipMode++; break; - case 13: case 15: if (sx1_old == 0xf0) DrvBgClipMode++; - case 16: if (DrvBgSy1 != 0x00) DrvBgClipMode = 0; break; - } - - switch (DrvBgClipMode) - { - case 0: case 4: case 8: case 12: case 16: // bg "off" mode - DrvBgClipMinX = 0; - DrvBgClipMinY = 0; - DrvBgClipMaxX = 0; - DrvBgClipMaxY = 0; - break; - - case 1: DrvBgClipMinY = DrvBgSy1; break; - case 3: DrvBgClipMaxY = DrvBgSy2; break; - case 5: DrvBgClipMaxY = DrvBgSy1; break; - case 7: DrvBgClipMinY = DrvBgSy2; break; - case 9: case 15: DrvBgClipMinX = DrvBgSx1; break; - case 11: case 13: DrvBgClipMaxX = DrvBgSx1; break; - } - - if (DrvBgClipMinY < 0) DrvBgClipMinY = 0; - if (DrvBgClipMaxY > nScreenHeight) DrvBgClipMaxY = nScreenHeight; - if (DrvBgClipMinX < 0) DrvBgClipMinX = 0; - if (DrvBgClipMaxX > nScreenWidth) DrvBgClipMaxX = nScreenWidth; - } -} - -static void DrvRenderBgLayer() -{ - INT32 mx, my, Code, Colour, Attr, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - DrvSetBgColourIntensity(); - DrvEnableBgClipMode(); - - for (mx = 0; mx < 64; mx++) { - for (my = 0; my < 32; my++) { - INT32 offs = TileIndex << 1; - Attr = DrvPagedRam[offs + 1]; - Code = DrvPagedRam[offs] | ((Attr & 0xc0) << 2); - Colour = Attr & 0x0f; - Flip = (Attr & 0x30) >> 4; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 16 * mx; - y = 16 * my; - - x -= DrvBgScrollX & 0x3ff; - y -= DrvBgScrollY & 0x1ff; - - if (x < -16) x += 1024; - if (y < -16) y += 512; - y -= 16; - - if (DrvFlipScreen) { - x = 240 - x; - y = 208 - y; - xFlip = !xFlip; - yFlip = !yFlip; - } - - UINT8 *gfx = DrvBgTiles + (Code * 0x100); - INT32 flip = ((xFlip) ? 0x0f : 0) + ((yFlip) ? 0xf0 : 0); - Colour = (Colour * 16) + 0x100; - - for (INT32 sy = 0; sy < 16; sy++) { - if ((sy + y) >= DrvBgClipMinY && (sy + y) < DrvBgClipMaxY) { - for (INT32 sx = 0; sx < 16; sx++) { - if ((sx + x) >= DrvBgClipMinX && (sx + x) < DrvBgClipMaxX) { - pTransDraw[((sy+y)*nScreenWidth) + (sx+x)] = gfx[((sy*16)+sx)^flip] + Colour; - } - } - } - } - - TileIndex++; - } - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, offs = 0, Flip, xFlip, yFlip; - - for (mx = 0; mx < 32; mx++) { - for (my = 0; my < 32; my++) { - offs = TileIndex << 1; - Attr = DrvPagedRam[0x3000 + offs + 1]; - Code = DrvPagedRam[0x3000 + offs + 0] | ((Attr & 0xc0) << 2); - Colour = Attr & 0x0f; - Flip = (Attr & 0x30) >> 4; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - y -= 16; - - if (DrvFlipScreen) { - x = 248 - x; - y = 216 - y; - xFlip = !xFlip; - yFlip = !yFlip; - } - - if (x > 0 && x < 248 && y > 0 && y < 216) - { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvChars); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvChars); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvChars); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvChars); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvChars); - } - } - } - - TileIndex++; - } - } -} - -static void DrvDrawBlendGfx(UINT8 *gfxbase,UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 offsx,INT32 offsy,INT32 transparent_color) -{ - color *= 16; - - const UINT8 *alpha = DrvBlendTable + color; - const UINT8 *source_base = gfxbase + (code * 16 * 16); - - INT32 xinc = flipx ? -1 : 1; - INT32 yinc = flipy ? -1 : 1; - - INT32 x_index_base = flipx ? 16-1 : 0; - INT32 y_index = flipy ? 16-1 : 0; - - INT32 sx = offsx; - INT32 sy = offsy; - INT32 ex = sx + 16; - INT32 ey = sy + 16; - - INT32 min_x = 0; - INT32 min_y = 0; - INT32 max_x = (nScreenWidth - 1); - INT32 max_y = (nScreenHeight - 1); - - if (sx < min_x) - { - int pixels = min_x-sx; - sx += pixels; - x_index_base += xinc*pixels; - } - - if (sy < min_y) - { - int pixels = min_y-sy; - sy += pixels; - y_index += yinc*pixels; - } - - if (ex > max_x+1) ex = max_x+1; - if (ey > max_y+1) ey = max_y+1; - - if (ex > sx) - { - for (INT32 y = sy; y < ey; y++) - { - const UINT8 *source = source_base + y_index*16; - - UINT16 *dest = pTransDraw + (y * nScreenWidth); - UINT16 *dst2 = DrvTempDraw + (y * nScreenWidth); - - INT32 x_index = x_index_base; - - for (INT32 x = sx; x < ex; x++) - { - int c = source[x_index]; - if (c != transparent_color) - { - if (alpha[c] & 8) - { - dest[x] += 0x8000; - dst2[x] = c + color + (alpha[c] * 0x0400); - } - else - { - dest[x] = c + color; - } - } - x_index += xinc; - } - y_index += yinc; - } - } -} - -static void DrvRenderSprites() -{ - for (INT32 Offs = 0; Offs < 0x600; Offs += 16) { - INT32 Attr = DrvSpriteRam[Offs + 13]; - INT32 Code = DrvSpriteRam[Offs + 14] | ((Attr & 0xc0) << 2); - INT32 Colour = DrvSpriteRam[Offs + 15] & 0x0f; - INT32 xFlip = Attr & 0x10; - INT32 yFlip = Attr & 0x20; - INT32 sx = DrvSpriteRam[Offs + 12]; - INT32 sy = DrvSpriteRam[Offs + 11]; - INT32 Size = (Attr & 0x08) ? 32 : 16; - - if (Attr & 0x01) sx -= 256; - if (Attr & 0x04) sy -= 256; - - if (DrvFlipScreen) { - sx = 224 - sx; - sy = 224 - sy; - xFlip = !xFlip; - yFlip = !yFlip; - } - - if (Size == 32) { - INT32 x0, x1, y0, y1; - - if (xFlip) { x0 = 2; x1 = 0; } - else { x0 = 0; x1 = 2; } - - if (yFlip) { y0 = 1; y1 = 0; } - else { y0 = 0; y1 = 1; } - - DrvDrawBlendGfx(DrvSprites, Code + x0 + y0, Colour, xFlip, yFlip, sx, sy - 16, 15); - DrvDrawBlendGfx(DrvSprites, Code + x0 + y1, Colour, xFlip, yFlip, sx, sy, 15); - DrvDrawBlendGfx(DrvSprites, Code + x1 + y0, Colour, xFlip, yFlip, sx + 16, sy - 16, 15); - DrvDrawBlendGfx(DrvSprites, Code + x1 + y1, Colour, xFlip, yFlip, sx + 16, sy, 15); - } else { - if (DrvFlipScreen) - DrvDrawBlendGfx(DrvSprites, Code, Colour, xFlip, yFlip, sx + 16, sy, 15); - else - DrvDrawBlendGfx(DrvSprites, Code, Colour, xFlip, yFlip, sx, sy-16, 15); - } - } -} - -static void DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - DrvPalette[0x300] = 0; // black - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x300; // black - } - - if (DrvBgStatus & 0x01) - if (nBurnLayer & 1) DrvRenderBgLayer(); - - if (!(DrvTitleScreen & 0x01)) - if (nSpriteEnable & 1) DrvRenderSprites(); - - if (nBurnLayer & 2) DrvRenderCharLayer(); - - if (nBurnBpp > 2) - { - UINT16* pSrc = pTransDraw; - UINT16* pAlp = DrvTempDraw; - UINT8* pDest = pBurnDraw; - - if (nBurnBpp == 3) { - for (INT32 y = 0; y < nScreenHeight; y++, pSrc += nScreenWidth, pAlp += nScreenWidth, pDest += nBurnPitch) { - for (INT32 x = 0; x < nScreenWidth; x++) - { - UINT32 c = pSrc[x]; - - if (c & 0x8000) { - c = DrvBlendFunction(DrvPalette[c&0x3ff], DrvPalette[pAlp[x]&0x3ff], pAlp[x] / 0x0400); - } else { - c = DrvPalette[c]; - } - - *(pDest + (x * 3) + 0) = c & 0xFF; - *(pDest + (x * 3) + 1) = (c >> 8) & 0xFF; - *(pDest + (x * 3) + 2) = c >> 16; - - } - } - } else { // nBurnBpp == 4 - for (INT32 y = 0; y < nScreenHeight; y++, pSrc += nScreenWidth, pAlp += nScreenWidth, pDest += nBurnPitch) { - for (INT32 x = 0; x < nScreenWidth; x++) - { - if (pSrc[x] & 0x8000) { - ((UINT32*)pDest)[x] = DrvBlendFunction(DrvPalette[pSrc[x]&0x3ff], DrvPalette[pAlp[x]&0x3ff], pAlp[x] / 0x0400); - } else { - ((UINT32*)pDest)[x] = DrvPalette[pSrc[x]]; - } - } - } - } - } else { // skip alpha for now on anything less than 24-bit - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - if (pTransDraw[i] & 0x8000) { - pTransDraw[i] = DrvTempDraw[i] & 0x3ff; - } else { - pTransDraw[i] &= 0x3ff; - } - } - - BurnTransferCopy(DrvPalette); - } -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 256; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 6000000 / 54; - nCyclesTotal[1] = 5000000 / 54; - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 0) { - ZetSetVector(0xcf); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - if (i == 240) { - ZetSetVector(0xd7); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029731; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvFlipScreen); - SCAN_VAR(DrvRomBank); - SCAN_VAR(DrvVRamPage); - SCAN_VAR(DrvTitleScreen); - SCAN_VAR(DrvBgScrollX); - SCAN_VAR(DrvBgScrollY); - SCAN_VAR(DrvBgStatus); - SCAN_VAR(DrvBgClipMode); - SCAN_VAR(DrvBgClipMinX); - SCAN_VAR(DrvBgClipMaxX); - SCAN_VAR(DrvBgClipMinY); - SCAN_VAR(DrvBgClipMaxY); - SCAN_VAR(DrvBgSx1); - SCAN_VAR(DrvBgSy1); - SCAN_VAR(DrvBgSy2); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch_main(); - ZetClose(); - } - - return 0; -} - -struct BurnDriver BurnDrvPsychic5 = { - "psychic5", NULL, NULL, NULL, "1987", - "Psychic 5 (World)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalc, 0x300, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvPsychic5j = { - "psychic5j", "psychic5", NULL, NULL, "1987", - "Psychic 5 (Japan)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, Psychic5jRomInfo, Psychic5jRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalc, 0x300, 224, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_pturn.cpp b/jan/src/burn/drv/pre90s/d_pturn.cpp deleted file mode 100644 index 81717a0db..000000000 --- a/jan/src/burn/drv/pre90s/d_pturn.cpp +++ /dev/null @@ -1,672 +0,0 @@ -// FB Alpha Parallel Turn driver module -// Based on MAME driver by Tomasz Slanina and Tatsuyuki Satoh - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvMapROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 soundlatch; -static UINT8 nmi_enable; -static UINT8 nmi_sub_enable; -static UINT8 sub_4000_data; -static UINT8 fgpalette; -static UINT8 bgpalette; -static UINT8 fgbank; -static UINT8 bgbank; -static UINT8 bgcolor; -static UINT8 bgscrollx; -static UINT16 bgscrolly; -static UINT8 flipscreen; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 4, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 5, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x13, 0xff, 0xff, 0x04, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x02, "7" }, - {0x13, 0x01, 0x03, 0x03, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Lives" }, - {0x13, 0x01, 0x0c, 0x00, "None" }, - {0x13, 0x01, 0x0c, 0x04, "20000" }, - {0x13, 0x01, 0x0c, 0x08, "50000" }, - {0x13, 0x01, 0x0c, 0x0c, "100000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x40, 0x00, "Upright" }, - {0x13, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x07, 0x07, "6 Coins 1 Credit" }, - {0x14, 0x01, 0x07, 0x06, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x07, 0x04, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x07, 0x00, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x07, 0x05, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x38, "6 Coins 1 Credit" }, - {0x14, 0x01, 0x38, 0x30, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x38, 0x20, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x38, 0x00, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x14, 0x01, 0x40, 0x00, "Normal" }, - {0x14, 0x01, 0x40, 0x40, "Stop Motion" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x14, 0x01, 0x80, 0x00, "English" }, - {0x14, 0x01, 0x80, 0x80, "Japanese" }, -}; - -STDDIPINFO(Drv) - -static void __fastcall pturn_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xdfe0: - return; // nop - - case 0xe400: - fgpalette = data & 0x1f; - return; - - case 0xe800: - soundlatch = data; - return; - - case 0xf400: - bgscrolly = (data>>5)*32*8; - bgpalette = (data & 0x1f); - return; - - case 0xf800: - return; // nop - - case 0xf801: - bgcolor = data; - return; - - case 0xf803: - bgscrollx = data; - return; - - case 0xfc00: - flipscreen = data; - return; - - case 0xfc01: - nmi_enable = data; - return; - - case 0xfc02: - case 0xfc03: - return; // nop - - case 0xfc04: - bgbank = data & 1; - return; - - case 0xfc05: - fgbank = data & 1; - return; - - case 0xfc06: - case 0xfc07: - return; // nop - } -} - -static UINT8 __fastcall pturn_main_read(UINT16 address) -{ - switch (address) - { - case 0xc803: - case 0xca00: - return 0x00; // protection - - case 0xca73: - return 0xbe; // protection - - case 0xca74: - return 0x66; // protection - - case 0xf800: - case 0xf801: - case 0xf802: - return DrvInputs[address & 3]; - - case 0xf804: - return DrvDips[1]; - - case 0xf805: - return DrvDips[0]; - - case 0xf806: // protection - status? - return 0; // bit 1 (0x2) must be 0! - } - - return 0; -} - -static void __fastcall pturn_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3000: - nmi_sub_enable = data; - return; - - case 0x4000: - sub_4000_data = data; - return; - - case 0x5000: - case 0x5001: - case 0x6000: - case 0x6001: - AY8910Write((address >> 13) & 1, (address & 1), data); - return; - } -} - -static UINT8 __fastcall pturn_sound_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - return soundlatch; - - case 0x4000: - return sub_4000_data; - } - - return 0; -} - - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - soundlatch = 0; - nmi_enable = 0; - nmi_sub_enable = 0; - sub_4000_data = 0; - fgpalette = 0; - bgpalette = 0; - fgbank = 0; - bgbank = 0; - bgcolor = 0; - bgscrolly = 0; - bgscrollx = 0; - flipscreen = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x008000; - DrvZ80ROM1 = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x008000; - DrvGfxROM2 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000300; - - DrvMapROM = Next; Next += 0x002000; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x000800; - DrvZ80RAM1 = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000100; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { RGN_FRAC(0x3000, 0,3), RGN_FRAC(0x3000, 1,3), RGN_FRAC(0x3000, 2,3) }; - INT32 Plane32[3] = { RGN_FRAC(0x6000, 0,3), RGN_FRAC(0x6000, 1,3), RGN_FRAC(0x6000, 2,3) }; - INT32 XOffs[32] = { STEP8(0,1), STEP8(64,1), STEP8(128,1), STEP8(192,1) }; - INT32 YOffs[32] = { STEP8(0,8), STEP8(256,8), STEP8(512,8), STEP8(768,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) return 1; - - memcpy (tmp, DrvGfxROM0, 0x6000); - - GfxDecode(0x0200, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x6000); - - GfxDecode(0x0200, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x6000); - - GfxDecode(0x0040, 3, 32, 32, Plane32, XOffs, YOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - const UINT8 tab[16] = { - 0x00, 0x0e, 0x1f, 0x2d, 0x43, 0x51, 0x62, 0x70, - 0x8f, 0x9d, 0xae, 0xbc, 0xd2, 0xe0, 0xf1, 0xff - }; - - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 r = tab[DrvColPROM[i+0x000] & 0xf]; - UINT8 g = tab[DrvColPROM[i+0x100] & 0xf]; - UINT8 b = tab[DrvColPROM[i+0x200] & 0xf]; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x01000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x01000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 13, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 16, 1)) return 1; - - if (BurnLoadRom(DrvMapROM + 0x00000, 17, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xf000, 0xf0ff, MAP_RAM); - ZetSetWriteHandler(pturn_main_write); - ZetSetReadHandler(pturn_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x0fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x2000, 0x23ff, MAP_RAM); - ZetSetWriteHandler(pturn_sound_write); - ZetSetReadHandler(pturn_sound_read); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - - return 0; -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - sy -= 16; - - INT32 code = DrvVidRAM[offs]; - - code = (code & 0x9f) | ((code & 0x20) << 1) | ((code & 0x40) >> 1) | (fgbank << 8); - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, fgpalette, 3, 0, 0, DrvGfxROM0); - } -} - -static void draw_bg_layer() -{ - INT32 color = ((bgpalette == 1) ? 25 : bgpalette); - - for (INT32 offs = 0; offs < 32 * (32 * 8); offs++) - { - INT32 sx = (offs % 0x20) * 8; - INT32 sy = (offs / 0x20) * 8; - - sx -= bgscrollx; - if (sx < -7) sx += 256; - - sy -= 16; //offset - if (sy < -7) sy += 256; - - INT32 code = DrvMapROM[offs + ( bgscrolly * 4 )] + (bgbank * 256); - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x80-4; offs >= 0; offs -= 4) - { - INT32 attr = DrvSprRAM[offs + 1]; - INT32 sy = 256 - DrvSprRAM[offs + 0] - 16; - INT32 sx = DrvSprRAM[offs + 3] - 16; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - INT32 code = attr & 0x3f; - INT32 color = DrvSprRAM[offs + 2] & 0x1f; - - sy -= 16; // offset - - if (flipscreen) - { - sx = 224 - sx; - sy = 224 - sy; - flipx ^= 0x40; - flipy ^= 0x80; - } - - if (sx | sy) - { - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = bgcolor; - } - - if (nBurnLayer & 1) draw_bg_layer(); - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 4) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 12; - INT32 nCyclesTotal[2] = { 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1) && nmi_enable) ZetNmi(); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - if ((i % (nInterleave / 3)) == ((nInterleave / 3)-1) && nmi_sub_enable) ZetNmi(); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(nmi_enable); - SCAN_VAR(nmi_sub_enable); - SCAN_VAR(sub_4000_data); - SCAN_VAR(fgpalette); - SCAN_VAR(bgpalette); - SCAN_VAR(fgbank); - SCAN_VAR(bgbank); - SCAN_VAR(bgcolor); - SCAN_VAR(bgscrolly); - SCAN_VAR(bgscrollx); - SCAN_VAR(flipscreen); - } - - return 0; -} - - -// Parallel Turn - -static struct BurnRomInfo pturnRomDesc[] = { - { "prom4.8d", 0x2000, 0xd3ae0840, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 #0 Code - { "prom6.8b", 0x2000, 0x65f09c56, 1 | BRF_PRG | BRF_ESS }, // 1 - { "prom5.7d", 0x2000, 0xde48afb4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "prom7.7b", 0x2000, 0xbfaeff9f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "prom9.5n", 0x1000, 0x8b4d944e, 2 | BRF_PRG | BRF_ESS }, // 4 - Z80 #1 Code - - { "prom1.8k", 0x1000, 0x10aba36d, 3 | BRF_GRA }, // 5 - Foreground Tiles - { "prom2.7k", 0x1000, 0xb8a4d94e, 3 | BRF_GRA }, // 6 - { "prom3.6k", 0x1000, 0x9f51185b, 3 | BRF_GRA }, // 7 - - { "prom11.16f", 0x1000, 0x129122c6, 4 | BRF_GRA }, // 8 - Background Tiles - { "prom12.16h", 0x1000, 0x69b09323, 4 | BRF_GRA }, // 9 - { "prom13.16k", 0x1000, 0xe9f67599, 4 | BRF_GRA }, // 10 - - { "prom14.16l", 0x2000, 0xffaa0b8a, 5 | BRF_GRA }, // 11 - Sprites - { "prom15.16m", 0x2000, 0x41445155, 5 | BRF_GRA }, // 12 - { "prom16.16p", 0x2000, 0x94814c5d, 5 | BRF_GRA }, // 13 - - { "prom_red.3p", 0x0100, 0x505fd8c2, 6 | BRF_GRA }, // 14 - Color PROMs - { "prom_grn.4p", 0x0100, 0x6a00199d, 6 | BRF_GRA }, // 15 - { "prom_blu.4r", 0x0100, 0x7b4c5788, 6 | BRF_GRA }, // 16 - - { "prom10.16d", 0x2000, 0xa96e3c95, 7 | BRF_GRA }, // 17 - Background Tile Map -}; - -STD_ROM_PICK(pturn) -STD_ROM_FN(pturn) - -struct BurnDriver BurnDrvPturn = { - "pturn", NULL, NULL, NULL, "1984", - "Parallel Turn\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, pturnRomInfo, pturnRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_punchout.cpp b/jan/src/burn/drv/pre90s/d_punchout.cpp deleted file mode 100644 index 44cc1d816..000000000 --- a/jan/src/burn/drv/pre90s/d_punchout.cpp +++ /dev/null @@ -1,1811 +0,0 @@ -// FB Alpha Punch Out!!! driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6502_intf.h" -#include "vlm5030.h" -#include "nes_apu.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvColPROM; -static UINT8 *DrvVLMROM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvBgtRAM; -static UINT8 *DrvBgbRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvSndRAM; - -static UINT8 *soundlatch; -static UINT8 *interrupt_enable; -static UINT8 *DrvSprCtrl; - -static UINT8 *spunchout_prot_mem; -static UINT8 spunchout_prot_mode = 0; - -static UINT16 *DrvTmpDraw; -static UINT16 *DrvTmpDraw2; - -static UINT32 *Palette; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvInputs[2]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo PunchoutInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Punchout) - -static struct BurnInputInfo SpnchoutInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Spnchout) - -static struct BurnInputInfo ArmwrestInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Armwrest) - -static struct BurnDIPInfo PunchoutDIPList[]= -{ - {0x09, 0xff, 0xff, 0x00, NULL }, - {0x0a, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 13, "Coinage" }, - {0x09, 0x01, 0x0f, 0x0e, "5 Coins 1 Credits" }, - {0x09, 0x01, 0x0f, 0x0b, "4 Coins 1 Credits" }, - {0x09, 0x01, 0x0f, 0x0c, "3 Coins 1 Credits" }, - {0x09, 0x01, 0x0f, 0x01, "2 Coins 1 Credits" }, - {0x09, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x09, 0x01, 0x0f, 0x08, "1 Coin/2 Credits (2 Credits/1 Play)" }, - {0x09, 0x01, 0x0f, 0x0d, "1 Coin/3 Credits (2 Credits/1 Play)" }, - {0x09, 0x01, 0x0f, 0x02, "1 Coin 2 Credits" }, - {0x09, 0x01, 0x0f, 0x05, "1 Coin 3 Credits" }, - {0x09, 0x01, 0x0f, 0x06, "1 Coin 4 Credits" }, - {0x09, 0x01, 0x0f, 0x0a, "1 Coin 5 Credits" }, - {0x09, 0x01, 0x0f, 0x07, "1 Coin 6 Credits" }, - {0x09, 0x01, 0x0f, 0x0f, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Copyright" }, - {0x09, 0x01, 0x80, 0x00, "Nintendo" }, - {0x09, 0x01, 0x80, 0x80, "Nintendo of America Inc." }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0a, 0x01, 0x03, 0x00, "Easy" }, - {0x0a, 0x01, 0x03, 0x01, "Medium" }, - {0x0a, 0x01, 0x03, 0x02, "Hard" }, - {0x0a, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x0a, 0x01, 0x0c, 0x00, "Longest" }, - {0x0a, 0x01, 0x0c, 0x04, "Long" }, - {0x0a, 0x01, 0x0c, 0x08, "Short" }, - {0x0a, 0x01, 0x0c, 0x0c, "Shortest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0a, 0x01, 0x10, 0x00, "Off" }, - {0x0a, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Rematch At A Discount" }, - {0x0a, 0x01, 0x20, 0x00, "Off" }, - {0x0a, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0a, 0x01, 0x80, 0x00, "Off" }, - {0x0a, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Punchout) - -static struct BurnDIPInfo SpnchoutDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x20, NULL }, - {0x0b, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 14, "Coinage" }, - {0x0a, 0x01, 0x0f, 0x08, "6 Coins 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x04, "5 Coins 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x03, "4 Coins 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x0c, "3 Coins 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x01, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x0f, 0x0d, "1 Coin/3 Credits (2 Credits/1 Play)" }, - {0x0a, 0x01, 0x0f, 0x02, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x0f, 0x0b, "1 Coin/2 Credits (3 Credits/1 Play)" }, - {0x0a, 0x01, 0x0f, 0x05, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0x0f, 0x06, "1 Coin 4 Credits" }, - {0x0a, 0x01, 0x0f, 0x0a, "1 Coin 5 Credits" }, - {0x0a, 0x01, 0x0f, 0x07, "1 Coin 6 Credits" }, - {0x0a, 0x01, 0x0f, 0x0f, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Copyright" }, - {0x0a, 0x01, 0x80, 0x00, "Nintendo" }, - {0x0a, 0x01, 0x80, 0x80, "Nintendo of America Inc." }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0b, 0x01, 0x03, 0x00, "Easy" }, - {0x0b, 0x01, 0x03, 0x01, "Medium" }, - {0x0b, 0x01, 0x03, 0x02, "Hard" }, - {0x0b, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x0b, 0x01, 0x0c, 0x00, "Longest" }, - {0x0b, 0x01, 0x0c, 0x04, "Long" }, - {0x0b, 0x01, 0x0c, 0x08, "Short" }, - {0x0b, 0x01, 0x0c, 0x0c, "Shortest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0b, 0x01, 0x10, 0x00, "Off" }, - {0x0b, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Rematch At A Discount" }, - {0x0b, 0x01, 0x20, 0x00, "Off" }, - {0x0b, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x80, 0x00, "Off" }, - {0x0b, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Spnchout) - -static struct BurnDIPInfo ArmwrestDIPList[]= -{ - {0x07, 0xff, 0xff, 0x00, NULL }, - {0x08, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage 1" }, - {0x07, 0x01, 0x0f, 0x00, "0000" }, - {0x07, 0x01, 0x0f, 0x01, "0001" }, - {0x07, 0x01, 0x0f, 0x02, "0010" }, - {0x07, 0x01, 0x0f, 0x03, "0011" }, - {0x07, 0x01, 0x0f, 0x04, "0100" }, - {0x07, 0x01, 0x0f, 0x05, "0101" }, - {0x07, 0x01, 0x0f, 0x06, "0110" }, - {0x07, 0x01, 0x0f, 0x07, "0111" }, - {0x07, 0x01, 0x0f, 0x08, "1000" }, - {0x07, 0x01, 0x0f, 0x09, "1001" }, - {0x07, 0x01, 0x0f, 0x0a, "1010" }, - {0x07, 0x01, 0x0f, 0x0b, "1011" }, - {0x07, 0x01, 0x0f, 0x0c, "1100" }, - {0x07, 0x01, 0x0f, 0x0d, "1101" }, - {0x07, 0x01, 0x0f, 0x0e, "1110" }, - {0x07, 0x01, 0x0f, 0x0f, "1111" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x07, 0x01, 0x40, 0x40, "1" }, - {0x07, 0x01, 0x40, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x08, 0x01, 0x03, 0x00, "Easy" }, - {0x08, 0x01, 0x03, 0x01, "Medium" }, - {0x08, 0x01, 0x03, 0x02, "Hard" }, - {0x08, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coinage 2" }, - {0x08, 0x01, 0x3c, 0x00, "0000" }, - {0x08, 0x01, 0x3c, 0x04, "0001" }, - {0x08, 0x01, 0x3c, 0x08, "0010" }, - {0x08, 0x01, 0x3c, 0x0c, "0011" }, - {0x08, 0x01, 0x3c, 0x10, "0100" }, - {0x08, 0x01, 0x3c, 0x14, "0101" }, - {0x08, 0x01, 0x3c, 0x18, "0110" }, - {0x08, 0x01, 0x3c, 0x1c, "0111" }, - {0x08, 0x01, 0x3c, 0x20, "1000" }, - {0x08, 0x01, 0x3c, 0x24, "1001" }, - {0x08, 0x01, 0x3c, 0x28, "1010" }, - {0x08, 0x01, 0x3c, 0x2c, "1011" }, - {0x08, 0x01, 0x3c, 0x30, "1100" }, - {0x08, 0x01, 0x3c, 0x34, "1101" }, - {0x08, 0x01, 0x3c, 0x38, "1110" }, - {0x08, 0x01, 0x3c, 0x3c, "1111" }, - - {0 , 0xfe, 0 , 2, "Rematches" }, - {0x08, 0x01, 0x40, 0x40, "3" }, - {0x08, 0x01, 0x40, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x08, 0x01, 0x80, 0x00, "Off" }, - {0x08, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Armwrest) - -static UINT8 spunchout_prot_read(UINT8 offset) -{ - offset >>= 4; - - if (offset <= 0x0c) - { - switch (spunchout_prot_mode & 3) - { - case 0: // time - switch ( offset ) - { - case 0x00: // 1-second counter - return spunchout_prot_mem[0x00]; - - case 0x01: // 10-second counter - return spunchout_prot_mem[0x01] & 0x7; - - case 0x02: // 1-minute counter - return spunchout_prot_mem[0x02]; - - case 0x03: // 10-minute counter - return spunchout_prot_mem[0x03] & 0x07; - - case 0x04: // 1-hour counter - return spunchout_prot_mem[0x04]; - - case 0x05: // 10-hour counter - return spunchout_prot_mem[0x05] & 0x03; - - case 0x06: // day-of-the-week counter - return spunchout_prot_mem[0x06] & 0x07; - - case 0x07: // 1-day counter - return spunchout_prot_mem[0x07]; - - case 0x08: // 10-day counter - return spunchout_prot_mem[0x08] & 0x03; - - case 0x09: // 1-month counter - return spunchout_prot_mem[0x09]; - - case 0x0a: // 10-month counter - return spunchout_prot_mem[0x0a] & 0x01; - - case 0x0b: // 1-year counter - return spunchout_prot_mem[0x0b]; - - case 0x0c: // 10-year counter - return spunchout_prot_mem[0x0c]; - } - break; - - case 1: // alarm - switch ( offset ) - { - case 0x00: // n/a - return 0x00; - - case 0x01: // n/a - return 0x00; - - case 0x02: // 1-minute alarm register - return spunchout_prot_mem[0x12]; - - case 0x03: // 10-minute alarm register - return spunchout_prot_mem[0x13] & 0x07; - - case 0x04: // 1-hour alarm register - return spunchout_prot_mem[0x14]; - - case 0x05: // 10-hour alarm register - return spunchout_prot_mem[0x15] & 0x03; - - case 0x06: // day-of-the-week alarm register - return spunchout_prot_mem[0x16] & 0x07; - - case 0x07: // 1-day alarm register - return spunchout_prot_mem[0x17]; - - case 0x08: // 10-day alarm register - return spunchout_prot_mem[0x18] & 0x03; - - case 0x09: // n/a - return 0xc0; // ok? - - case 0x0a: // /12/24 select register - return spunchout_prot_mem[0x1a] & 0x01; - - case 0x0b: // leap year count - return spunchout_prot_mem[0x1b] & 0x03; - - case 0x0c: // n/a - return 0x00; - } - break; - - case 2: // RAM BLOCK 10 - case 3: // RAM BLOCK 11 - return spunchout_prot_mem[0x10 * (spunchout_prot_mode & 3) + offset]; - } - } - else if (offset == 0x0d) - { - return spunchout_prot_mode; - } - - return 0; -} - -static void spunchout_prot_write(UINT8 offset, UINT8 data) -{ - offset >>= 4; - data &= 0x0f; - - if (offset <= 0x0c) - { - spunchout_prot_mem[0x10 * (spunchout_prot_mode & 3) + offset] = data; - } - else if (offset == 0x0d) - { - spunchout_prot_mode = data; - } -} - -static void __fastcall punchout_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - // nop - return; - - case 0x02: - case 0x03: - soundlatch[port & 1] = data; - return; - - case 0x04: - vlm5030_data_write(0, data); - return; - - case 0x05: - case 0x06: - return; // nop - - case 0x08: - *interrupt_enable = data; - return; - - case 0x09: - case 0x0a: - return; // nop - - case 0x0b: - if (data & 1) M6502Reset(); // iq_132 fix this! - return; - - case 0x0c: - vlm5030_rst(0, data & 0x01); - return; - - case 0x0d: - vlm5030_st(0, data & 0x01); - return; - - case 0x0e: - vlm5030_vcu(0, data & 0x01); - return; - - case 0x0f: - return; // nop - } - - if ((port & 0x0f) == 0x07) spunchout_prot_write(port, data); -} - -static UINT8 __fastcall punchout_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return DrvInputs[0] ^ 0x40; - - case 0x01: - return DrvInputs[1]; - - case 0x02: - return DrvDips[0]; - - case 0x03: - return (DrvDips[1] & 0xef) | ((vlm5030_bsy(0)) ? 0x00 : 0x10); - } - - if ((port & 0x0f) == 0x07) return spunchout_prot_read(port); - - return 0; -} - -static void sound_write(UINT16 a, UINT8 d) -{ - if ((a & 0xffe0) == 0x4000) { - nesapuWrite(0, a & 0x1f, d); - return; - } -} - -static UINT8 sound_read(UINT16 a) -{ - if ((a & 0xffe0) == 0x4000) { - if ((a & 0xfffe) == 0x4016) { - return soundlatch[a & 1]; - } - - return nesapuRead(0, a & 0x1f); - } - - return 0; -} - -static UINT32 punchout_vlm_sync(INT32 samples_rate) -{ - return (samples_rate * ZetTotalCycles()) / 66666 /* 8000000 / 2 / 60 */; -} - -static UINT32 punchout_nesapu_sync(INT32 samples_rate) -{ - return (samples_rate * M6502TotalCycles()) / 29830 /* 1789773 / 60 */; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - memset (DrvNVRAM, 0, 0x400); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - vlm5030Reset(0); - - spunchout_prot_mode = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - DrvSndROM = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x001000; - - DrvVLMROM = Next; Next += 0x010000; - - Palette = (UINT32*)Next; Next += 0x0400 * sizeof(INT32); - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(INT32); - - DrvNVRAM = Next; Next += 0x000400; - - DrvTmpDraw = (UINT16*)Next; Next += 128 * 256 * sizeof(UINT16); - DrvTmpDraw2 = (UINT16*)Next; Next += 128 * 256 * sizeof(UINT16); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001000; - DrvBgtRAM = Next; Next += 0x000800; - DrvBgbRAM = Next; Next += 0x001000; - DrvFgRAM = Next; Next += 0x000800; - DrvSndRAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000002; - interrupt_enable = Next; Next += 0x000001; - - spunchout_prot_mem = Next; Next += 0x000040; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode(UINT8 *rom, INT32 len, UINT8 xor1, INT32 depth) // 0x100, 0, 0x100, 0 (mod 0x40 always) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL || len == 0) return; - - for (INT32 i = 0; i < len; i++) tmp[i] = rom[i] ^ xor1; // copy & invert - - for (INT32 i = 0; i < (len / 3) * 8; i++) - { - rom[i] = (tmp[(i / 8) + (len / 3) * 2] >> (7 - (i & 7))) & 1; - rom[i] <<= 1; - rom[i] |= (tmp[(i / 8) + (len / 3) * 1] >> (7 - (i & 7))) & 1; - rom[i] <<= 1; - rom[i] |= (tmp[(i / 8) + (len / 3) * 0] >> (7 - (i & 7))) & 1; - rom[i] &= depth; - } - - BurnFree (tmp); -} - -static void DrvPaletteInit(INT32 off, INT32 bank, INT32 reverse) -{ - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 r = ~DrvColPROM[i + 0x000 + 0x100 * bank] & 0x0f; - UINT8 g = ~DrvColPROM[i + 0x200 + 0x100 * bank] & 0x0f; - UINT8 b = ~DrvColPROM[i + 0x400 + 0x100 * bank] & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - Palette[off * 0x100 + (i^reverse)] = (r << 16) | (g << 8) | b; - } - - DrvRecalc = 1; -} - -static INT32 CommonInit(INT32 (*pInitCallback)(), INT32 punchout, INT32 reverse_palette, UINT32 gfx_xor) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - memset (DrvGfxROM0, 0xff, 0x020000); - memset (DrvGfxROM1, 0xff, 0x020000); - memset (DrvGfxROM2, 0xff, 0x080000); - memset (DrvGfxROM3, 0xff, 0x040000); - - if (pInitCallback) { - if (pInitCallback()) return 1; - } - - DrvGfxDecode(DrvGfxROM0, 0x0c000, (gfx_xor >> 0), 3); - DrvGfxDecode(DrvGfxROM1, 0x0c000, (gfx_xor >> 8), (punchout) ? 3 : 7); - DrvGfxDecode(DrvGfxROM2, 0x30000, (gfx_xor >> 16), 7); - DrvGfxDecode(DrvGfxROM3, 0x18000, (gfx_xor >> 24), 3); - - DrvPaletteInit(0, 0, (reverse_palette >> 0) & 0xff); // top bank 0 - DrvPaletteInit(1, 1, (reverse_palette >> 0) & 0xff); // top bank 1 - DrvPaletteInit(2, 6, (reverse_palette >> 8) & 0xff); // bot bank 0 - DrvPaletteInit(3, 7, (reverse_palette >> 8) & 0xff); // bot bank 1 - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc3ff, 0, DrvNVRAM); - ZetMapArea(0xc000, 0xc3ff, 1, DrvNVRAM); - ZetMapArea(0xc000, 0xc3ff, 2, DrvNVRAM); - ZetMapArea(0xd000, 0xd7ff, 0, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvZ80RAM); - ZetMapArea(0xe000, 0xefff, 0, DrvSprRAM); - ZetMapArea(0xe000, 0xefff, 1, DrvSprRAM); - ZetMapArea(0xe000, 0xefff, 2, DrvSprRAM); - - if (punchout) - { - ZetMapArea(0xd800, 0xdfff, 0, DrvBgtRAM); - ZetMapArea(0xd800, 0xdfff, 1, DrvBgtRAM); - ZetMapArea(0xd800, 0xdfff, 2, DrvBgtRAM); - - ZetMapArea(0xf000, 0xffff, 0, DrvBgbRAM); - ZetMapArea(0xf000, 0xffff, 1, DrvBgbRAM); - ZetMapArea(0xf000, 0xffff, 2, DrvBgbRAM); - - DrvSprCtrl = DrvBgtRAM + 0x7f0; - } - else - { - ZetMapArea(0xd800, 0xdfff, 0, DrvFgRAM); - ZetMapArea(0xd800, 0xdfff, 1, DrvFgRAM); - ZetMapArea(0xd800, 0xdfff, 2, DrvFgRAM); - - ZetMapArea(0xf000, 0xf7ff, 0, DrvBgbRAM); - ZetMapArea(0xf000, 0xf7ff, 1, DrvBgbRAM); - ZetMapArea(0xf000, 0xf7ff, 2, DrvBgbRAM); - - ZetMapArea(0xf800, 0xffff, 0, DrvBgtRAM); - ZetMapArea(0xf800, 0xffff, 1, DrvBgtRAM); - ZetMapArea(0xf800, 0xffff, 2, DrvBgtRAM); - - DrvSprCtrl = DrvFgRAM + 0x7f0; - } - - ZetSetOutHandler(punchout_write_port); - ZetSetInHandler(punchout_read_port); - ZetClose(); - - M6502Init(0, TYPE_N2A03); - M6502Open(0); - M6502MapMemory(DrvSndRAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvSndROM, 0xe000, 0xffff, MAP_ROM); - M6502SetWriteHandler(sound_write); - M6502SetReadHandler(sound_read); - M6502Close(); - - vlm5030Init(0, 3580000, punchout_vlm_sync, DrvVLMROM, 0x4000, 1); - vlm5030SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - nesapuInit(0, 1789773, punchout_nesapu_sync, 0); - nesapuSetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - M6502Exit(); - vlm5030Exit(); - nesapuExit(); - - BurnFree (AllMem); - - return 0; -} - -static void predraw_big_sprite(UINT16 *bitmap, UINT8 *ram, UINT8 *rom, INT32 bpp, INT32 paloff) -{ - for (INT32 i = 0; i < 16 * 32; i++) - { - INT32 ofst = i; - - INT32 sx = (i & 0xf) * 8; - INT32 sy = (i / 0x10) * 8; - - INT32 attr = ram[ofst * 4 + 3]; - INT32 code = ram[ofst * 4] + ((ram[i * 4 + 1] & (0x1f >> (3 - bpp))) << 8); - - INT32 color = ((attr & (0xff >> bpp)) << bpp) + paloff; - INT32 flipx = (attr & 0x80) ? 7 : 0; - - { - UINT8 *src = rom + (code * 8 * 8); - UINT16 *dst = bitmap + (sy * 128) + sx; - - for (INT32 y = 0; y < 8; y++) { - for (INT32 x = 0; x < 8; x++) { - INT32 t = src[(y * 8) + (x ^ flipx)]; - if (t == ((1 << bpp)-1)) t |= 0x8000; - dst[(y * 128) + x] = t | color; - } - } - } - } -} - -static void draw_layer(UINT8 *ram, UINT8 *rom, INT32 wide, INT32 paloff, INT32 scroll, INT32 allow_flip) -{ - for (INT32 i = wide * 2; i < wide * 30; i++) - { - INT32 sx = (i % wide) * 8; - INT32 sy = (i / wide) * 8; - - INT32 attr = ram[i * 2 + 1]; - INT32 code = ram[i * 2 + 0] + ((attr & 0x03) << 8); - INT32 color = (attr & 0x7c) >> 2; - INT32 flipx = 0; - - if (allow_flip == 0) { - code += (attr & 0x80) << 3; - } else { - flipx = attr & 0x80; - } - - if (scroll) - { - INT32 scrollx = ram[(sy/8)*2] + ((ram[(sy/8)*2+1] & 0x01) << 8); - - sx -= (56 + scrollx) & 0x1ff; - if (sx < -7) sx += 256; - } - - sy -= 16; - - if (sx >= nScreenWidth) continue; - - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, paloff, rom); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, paloff, rom); - } - } -} - -static void copy_roz(UINT16 *src, UINT32 startx, UINT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, INT32 wrap, INT32 transp, INT32 wide) -{ - UINT16 *dst = pTransDraw; - - INT32 width; - INT32 height; - if (wide) { - width = 0x100; - height = 0x80; - } else { - width = 0x80; - height = 0x100; - } - - for (INT32 sy = 0; sy < nScreenHeight; sy++, startx+=incyx, starty+=incyy) - { - UINT32 cx = startx; - UINT32 cy = starty; - - dst = pTransDraw + sy * nScreenWidth; - - if (transp) { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++) - { - INT32 xx = cx / 0x10000; - INT32 yy = cy / 0x10000; - - if (wrap) { - xx %= width; - yy %= height; - } else { - if (xx >= width) continue; - if (yy >= height) continue; - } - - INT32 pxl = src[(yy * width) + xx]; - - if (!(pxl & 0x8000)) { - *dst = pxl; - } - } - } else { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++) - { - INT32 xx = cx / 0x10000; - INT32 yy = cy / 0x10000; - - if (wrap) { - xx %= width; - yy %= height; - } else { - if (xx >= width) continue; - if (yy >= height) continue; - } - - *dst = src[(yy * width) + xx] & 0xfff; - } - } - } -} - -static void draw_big_sprite(INT32 type2) -{ - INT32 zoom = DrvSprCtrl[0] + 256 * (DrvSprCtrl[1] & 0x0f); - - if (zoom) - { - INT32 sx = 4096 - (DrvSprCtrl[2] + 256 * (DrvSprCtrl[3] & 0x0f)); - if (sx > 4096-4*127) sx -= 4096; - - INT32 sy = -(DrvSprCtrl[4] + 256 * (DrvSprCtrl[5] & 1)); - if (sy <= -256 + zoom/0x40) sy += 512; - sy += 12; - - sy -= 16; - - INT32 incxx = zoom << 6; - INT32 incyy = zoom << 6; - - INT32 startx = -sx * 0x4000; - INT32 starty = -sy * 0x10000; - startx += 3740 * zoom; /* adjustment to match the screen shots */ - starty -= 178 * zoom; /* and make the hall of fame picture nice */ - - if (DrvSprCtrl[6] & 1) /* flip x */ - { - if (type2) { - startx = ((32 * 8) << 16) - startx - 1; - } else { - startx = ((16 * 8) << 16) - startx - 1; - } - incxx = -incxx; - } - - copy_roz(DrvTmpDraw, startx, starty + 0x200*(2) * zoom, incxx,0,0,incyy, 0, 1, type2); - } -} - -static void draw_big_sprite2() -{ - INT32 incxx; - - INT32 sx = 512 - (DrvSprCtrl[0x08] + 256 * (DrvSprCtrl[0x09] & 1)); - if (sx > 512-127) sx -= 512; - sx -= 55; /* adjustment to match the screen shots */ - - INT32 sy = -DrvSprCtrl[0x0a] + 256 * (DrvSprCtrl[0x0b] & 1); - sy += 3; /* adjustment to match the screen shots */ - - sy -= 16; - - sx = -sx << 16; - sy = -sy << 16; - - if (DrvSprCtrl[0x0c] & 1) /* flip x */ - { - sx = ((16 * 8) << 16) - sx - 1; - incxx = -1; - } - else - { - incxx = 1; - } - - copy_roz(DrvTmpDraw2, sx, sy, incxx << 16, 0, 0, 1 << 16, 0, 1, 0); -} - -static INT32 PunchoutDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i++) { - INT32 d = Palette[i]; - DrvPalette[i] = BurnHighCol(d >> 16, (d >> 8) & 0xff, d & 0xff, 0); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - INT32 palbank0 = ((DrvSprCtrl[0x0d] & 0x02) >> 1) * 0x100; - INT32 palbank1 = ((DrvSprCtrl[0x0d] & 0x01) >> 0) * 0x100; - predraw_big_sprite(DrvTmpDraw2, DrvSprRAM + 0x800, DrvGfxROM3, 2, palbank1 + 0x200); - - nScreenHeight -= 224; - if (nBurnLayer & 1) draw_layer(DrvBgtRAM, DrvGfxROM0, 32, palbank0, 0, 1); - - if (DrvSprCtrl[0x07] & 0x01 && nSpriteEnable & 0x01) { - predraw_big_sprite(DrvTmpDraw , DrvSprRAM + 0x000, DrvGfxROM2, 3, palbank0); - draw_big_sprite(0); - } - - pTransDraw += 224 * 256; - if (nBurnLayer & 2) draw_layer(DrvBgbRAM, DrvGfxROM1, 64, palbank1 + 0x200, 1, 1); - - if (DrvSprCtrl[0x07] & 0x02 && nSpriteEnable & 0x02) { - predraw_big_sprite(DrvTmpDraw , DrvSprRAM + 0x000, DrvGfxROM2, 3, palbank1 + 0x200); - draw_big_sprite(0); - } - - if (nSpriteEnable & 0x04) - draw_big_sprite2(); - - pTransDraw -= 224 * 256; - nScreenHeight += 224; - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void draw_fg_layer(INT32 paloff) -{ - for (INT32 i = 32 * 2; i < 32 * 30; i++) - { - INT32 sx = (i % 0x20) * 8; - INT32 sy = (i / 0x20) * 8; - - INT32 attr = DrvFgRAM[i * 2 + 1]; - INT32 code = DrvFgRAM[i * 2 + 0] + ((attr & 0x07) << 8); - INT32 color = (attr & 0x78) >> 3; - INT32 flipx = attr & 0x80; - - if (code == 0) continue; - - sy -= 16; - - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 7, paloff, DrvGfxROM1); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 7, paloff, DrvGfxROM1); - } - } -} - -static void predraw_big_sprite_armwrest(INT32 paloff) -{ - INT32 fx = (DrvSprCtrl[6] & 1) ? 0x10 : 0; - - for (INT32 i = 0; i < 32 * 16; i++) - { - INT32 ofst = ((((i ^ fx) & 0x10) + (i >> 5)) << 4) + (i & 0xf); - - INT32 sx = (i & 0x1f) * 8; - INT32 sy = (i / 0x20) * 8; - - INT32 attr = DrvSprRAM[ofst * 4 + 3]; - INT32 code = DrvSprRAM[ofst * 4] + ((DrvSprRAM[ofst * 4 + 1] & 0x1f) << 8); - - INT32 color = ((attr & 0x1f) << 3) + paloff; - INT32 flipx = (attr & 0x80) ? 7 : 0; - - { - UINT8 *src = DrvGfxROM2 + (code * 8 * 8); - UINT16 *dst = DrvTmpDraw + (sy * 256) + sx; - - for (INT32 y = 0; y < 8; y++) { - for (INT32 x = 0; x < 8; x++) { - INT32 t = src[(y * 8) + (x ^ flipx)]; - if (t == 0x07) t |= 0x8000; - dst[(y * 256) + x] = t | color; - } - } - } - } -} - -static INT32 ArmwrestDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i++) { - INT32 d = Palette[i]; - DrvPalette[i] = BurnHighCol(d >> 16, (d >> 8) & 0xff, d & 0xff, 0); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - INT32 palbank0 = ((DrvSprCtrl[0x0d] & 0x02) >> 1) * 0x100; - INT32 palbank1 = ((DrvSprCtrl[0x0d] & 0x01) >> 0) * 0x100; - - predraw_big_sprite(DrvTmpDraw2, DrvSprRAM + 0x800, DrvGfxROM3, 2, palbank1 + 0x200); - - nScreenHeight -= 224; - - if (nBurnLayer & 1) draw_layer(DrvBgtRAM, DrvGfxROM0, 32, palbank0, 0, 0); - - if (DrvSprCtrl[0x07] & 0x01 && nSpriteEnable & 0x01) { - predraw_big_sprite_armwrest(palbank0); - draw_big_sprite(1); - } - - pTransDraw += 224 * 256; - if (nBurnLayer & 2) draw_layer(DrvBgbRAM, DrvGfxROM0, 32, palbank1 + 0x200, 0, 1); - - if (DrvSprCtrl[0x07] & 0x02 && nSpriteEnable & 0x02) { - predraw_big_sprite_armwrest(palbank1 + 0x200); - draw_big_sprite(1); - } - - if (nSpriteEnable & 0x04) - draw_big_sprite2(); - - draw_fg_layer(palbank1 + 0x200); - - pTransDraw -= 224 * 256; - nScreenHeight += 224; - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 4000000 / 60, 1789773 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetNewFrame(); - M6502NewFrame(); - - ZetOpen(0); - M6502Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] += ZetRun(nSegment); - - nSegment = nCyclesTotal[1] / nInterleave; - - nCyclesDone[1] += M6502Run(nSegment); - } - - if (*interrupt_enable) ZetNmi(); - - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - - nesapuUpdate(0, pBurnSoundOut, nBurnSoundLen); - vlm5030Update(0, pBurnSoundOut, nBurnSoundLen); - - M6502Close(); - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - M6502Scan(nAction); - vlm5030Scan(nAction); - nesapuScan(nAction); - - SCAN_VAR(spunchout_prot_mode); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNVRAM; - ba.nLen = 0x000400; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - return 0; -} - -static void swap_gfx(UINT8 *src) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x800); - - memcpy (tmp, src + 0x800, 0x800); - memcpy (src + 0x800, src + 0x1000, 0x800); - memcpy (src + 0x1000, tmp, 0x800); - - BurnFree(tmp); -} - -static INT32 PunchoutLoadRoms() -{ - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x14000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x1c000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x24000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x28000, 20, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x02000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x08000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x0a000, 24, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 25, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 26, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 27, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00600, 28, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 29, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00a00, 30, 1)) return 1; - - if (BurnLoadRom(DrvVLMROM + 0x00000, 32, 1)) return 1; - - return 0; -} - -static INT32 ArmwrestLoadRoms() -{ - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x14000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x1c000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x24000, 18, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x08000, 20, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 21, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 22, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 23, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00600, 24, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 25, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00a00, 26, 1)) return 1; - - if (BurnLoadRom(DrvVLMROM + 0x00000, 29, 1)) return 1; - - return 0; -} - -static INT32 SpunchoutLoadRoms() -{ - if (PunchoutLoadRoms()) return 1; - - swap_gfx(DrvGfxROM0 + 0x00000); - swap_gfx(DrvGfxROM0 + 0x04000); - swap_gfx(DrvGfxROM1 + 0x00000); - swap_gfx(DrvGfxROM1 + 0x04000); - swap_gfx(DrvGfxROM3 + 0x00000); - swap_gfx(DrvGfxROM3 + 0x02000); - swap_gfx(DrvGfxROM3 + 0x08000); - swap_gfx(DrvGfxROM3 + 0x0a000); - - return 0; -} - -static INT32 SpunchoutjLoadRoms() -{ - if (PunchoutLoadRoms()) return 1; - - swap_gfx(DrvGfxROM1 + 0x00000); - swap_gfx(DrvGfxROM1 + 0x04000); - swap_gfx(DrvGfxROM3 + 0x00000); - swap_gfx(DrvGfxROM3 + 0x02000); - swap_gfx(DrvGfxROM3 + 0x08000); - swap_gfx(DrvGfxROM3 + 0x0a000); - - return 0; -} - -// Punch-Out (Rev B)!! - -static struct BurnRomInfo punchoutRomDesc[] = { - { "chp1-c.8l", 0x2000, 0xa4003adc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "chp1-c.8k", 0x2000, 0x745ecf40, 1 | BRF_PRG | BRF_ESS }, // 1 - { "chp1-c.8j", 0x2000, 0x7a7f870e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "chp1-c.8h", 0x2000, 0x5d8123d7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "chp1-c.8f", 0x4000, 0xc8a55ddb, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "chp1-c.4k", 0x2000, 0xcb6ef376, 2 | BRF_PRG | BRF_ESS }, // 5 N2A03 Code - - { "chp1-b.4c", 0x2000, 0x49b763bc, 3 | BRF_GRA }, // 6 Top Screen Background Characters - { "chp1-b.4d", 0x2000, 0x08bc6d67, 3 | BRF_GRA }, // 7 - - { "chp1-b.4a", 0x2000, 0xc075f831, 4 | BRF_GRA }, // 8 Bottom Screen Background Characters - { "chp1-b.4b", 0x2000, 0xc4cc2b5a, 4 | BRF_GRA }, // 9 - - { "chp1-v.2r", 0x4000, 0xbd1d4b2e, 5 | BRF_GRA }, // 10 Big Sprite Characters - { "chp1-v.2t", 0x4000, 0xdd9a688a, 5 | BRF_GRA }, // 11 - { "chp1-v.2u", 0x2000, 0xda6a3c4b, 5 | BRF_GRA }, // 12 - { "chp1-v.2v", 0x2000, 0x8c734a67, 5 | BRF_GRA }, // 13 - { "chp1-v.3r", 0x4000, 0x2e74ad1d, 5 | BRF_GRA }, // 14 - { "chp1-v.3t", 0x4000, 0x630ba9fb, 5 | BRF_GRA }, // 15 - { "chp1-v.3u", 0x2000, 0x6440321d, 5 | BRF_GRA }, // 16 - { "chp1-v.3v", 0x2000, 0xbb7b7198, 5 | BRF_GRA }, // 17 - { "chp1-v.4r", 0x4000, 0x4e5b0fe9, 5 | BRF_GRA }, // 18 - { "chp1-v.4t", 0x4000, 0x37ffc940, 5 | BRF_GRA }, // 19 - { "chp1-v.4u", 0x2000, 0x1a7521d4, 5 | BRF_GRA }, // 20 - - { "chp1-v.6p", 0x2000, 0x75be7aae, 6 | BRF_GRA }, // 21 Bottom Screen Big Sprite Characters - { "chp1-v.6n", 0x2000, 0xdaf74de0, 6 | BRF_GRA }, // 22 - { "chp1-v.8p", 0x2000, 0x4cb7ea82, 6 | BRF_GRA }, // 23 - { "chp1-v.8n", 0x2000, 0x1c0d09aa, 6 | BRF_GRA }, // 24 - - { "chp1-b-6e_pink.6e", 0x0200, 0xe9ca3ac6, 7 | BRF_GRA }, // 25 Color PROMs - { "chp1-b-6f_pink.6f", 0x0200, 0x02be56ab, 7 | BRF_GRA }, // 26 - { "chp1-b-7f_pink.7f", 0x0200, 0x11de55f1, 7 | BRF_GRA }, // 27 - { "chp1-b-7e_white.7e", 0x0200, 0x47adf7a2, 7 | BRF_GRA }, // 28 - { "chp1-b-8e_white.8e", 0x0200, 0xb0fc15a8, 7 | BRF_GRA }, // 29 - { "chp1-b-8f_white.8f", 0x0200, 0x1ffd894a, 7 | BRF_GRA }, // 30 - - { "chp1-v-2d.2d", 0x0100, 0x71dc0d48, 0 | BRF_GRA }, // 31 Timing PROM - - { "chp1-c.6p", 0x4000, 0xea0bbb31, 8 | BRF_SND }, // 32 VLM5030 Samples - - { "chp1-b-6e_white.6e", 0x0200, 0xddac5f0e, 0 | BRF_OPT }, - { "chp1-b-6f_white.6f", 0x0200, 0x846c6261, 0 | BRF_OPT }, - { "chp1-b-7f_white.7f", 0x0200, 0x1682dd30, 0 | BRF_OPT }, - { "chp1-b-7e_pink.7e", 0x0200, 0xfddaa777, 0 | BRF_OPT }, - { "chp1-b-8e_pink.8e", 0x0200, 0xc3d5d71f, 0 | BRF_OPT }, - { "chp1-b-8f_pink.8f", 0x0200, 0xa3037155, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(punchout) -STD_ROM_FN(punchout) - -static INT32 PunchoutInit() -{ - return CommonInit(SpunchoutLoadRoms, 1, 0xff00, 0x00000000); -} - -struct BurnDriver BurnDrvPunchout = { - "punchout", NULL, NULL, NULL, "1984", - "Punch-Out!! (Rev B)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 1, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, punchoutRomInfo, punchoutRomName, NULL, NULL, PunchoutInputInfo, PunchoutDIPInfo, - PunchoutInit, DrvExit, DrvFrame, PunchoutDraw, DrvScan, &DrvRecalc, 0x400, - 256, 448, 4, 6 -}; - - -// Punch-Out (Rev A)!! - -static struct BurnRomInfo punchoutaRomDesc[] = { - { "chp1-c.8l", 0x2000, 0xa4003adc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "chp1-c.8k", 0x2000, 0x745ecf40, 1 | BRF_PRG | BRF_ESS }, // 1 - { "chp1-c.8j", 0x2000, 0x7a7f870e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "chp1-c.8h", 0x2000, 0x5d8123d7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "chp1-c.8f", 0x4000, 0xc8a55ddb, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "chp1-c.4k", 0x2000, 0xcb6ef376, 2 | BRF_PRG | BRF_ESS }, // 5 N2A03 Code - - { "chp1-b.4c", 0x2000, 0xe26dc8b3, 3 | BRF_GRA }, // 6 Top Screen Background Characters - { "chp1-b.4d", 0x2000, 0xdd1310ca, 3 | BRF_GRA }, // 7 - - { "chp1-b.4a", 0x2000, 0x20fb4829, 4 | BRF_GRA }, // 8 Bottom Screen Background Characters - { "chp1-b.4b", 0x2000, 0xedc34594, 4 | BRF_GRA }, // 9 - - { "chp1-v.2r", 0x4000, 0xbd1d4b2e, 5 | BRF_GRA }, // 10 Big Sprite Characters - { "chp1-v.2t", 0x4000, 0xdd9a688a, 5 | BRF_GRA }, // 11 - { "chp1-v.2u", 0x2000, 0xda6a3c4b, 5 | BRF_GRA }, // 12 - { "chp1-v.2v", 0x2000, 0x8c734a67, 5 | BRF_GRA }, // 13 - { "chp1-v.3r", 0x4000, 0x2e74ad1d, 5 | BRF_GRA }, // 14 - { "chp1-v.3t", 0x4000, 0x630ba9fb, 5 | BRF_GRA }, // 15 - { "chp1-v.3u", 0x2000, 0x6440321d, 5 | BRF_GRA }, // 16 - { "chp1-v.3v", 0x2000, 0xbb7b7198, 5 | BRF_GRA }, // 17 - { "chp1-v.4r", 0x4000, 0x4e5b0fe9, 5 | BRF_GRA }, // 18 - { "chp1-v.4t", 0x4000, 0x37ffc940, 5 | BRF_GRA }, // 19 - { "chp1-v.4u", 0x2000, 0x1a7521d4, 5 | BRF_GRA }, // 20 - - { "chp1-v.6p", 0x2000, 0x16588f7a, 6 | BRF_GRA }, // 21 Bottom Screen Big Sprite Characters - { "chp1-v.6n", 0x2000, 0xdc743674, 6 | BRF_GRA }, // 22 - { "chp1-v.8p", 0x2000, 0xc2db5b4e, 6 | BRF_GRA }, // 23 - { "chp1-v.8n", 0x2000, 0xe6af390e, 6 | BRF_GRA }, // 24 - - { "chp1-b-6e_pink.6e", 0x0200, 0xe9ca3ac6, 7 | BRF_GRA }, // 25 Color PROMs - { "chp1-b-6f_pink.6f", 0x0200, 0x02be56ab, 7 | BRF_GRA }, // 26 - { "chp1-b-7f_pink.7f", 0x0200, 0x11de55f1, 7 | BRF_GRA }, // 27 - { "chp1-b-7e_white.7e", 0x0200, 0x47adf7a2, 7 | BRF_GRA }, // 28 - { "chp1-b-8e_white.8e", 0x0200, 0xb0fc15a8, 7 | BRF_GRA }, // 29 - { "chp1-b-8f_white.8f", 0x0200, 0x1ffd894a, 7 | BRF_GRA }, // 30 - - { "chp1-v-2d.2d", 0x0100, 0x71dc0d48, 0 | BRF_GRA }, // 31 Timing PROM - - { "chp1-c.6p", 0x4000, 0xea0bbb31, 8 | BRF_SND }, // 32 VLM5030 Samples - - { "chp1-b-6e_white.6e", 0x0200, 0xddac5f0e, 0 | BRF_OPT }, - { "chp1-b-6f_white.6f", 0x0200, 0x846c6261, 0 | BRF_OPT }, - { "chp1-b-7f_white.7f", 0x0200, 0x1682dd30, 0 | BRF_OPT }, - { "chp1-b-7e_pink.7e", 0x0200, 0xfddaa777, 0 | BRF_OPT }, - { "chp1-b-8e_pink.8e", 0x0200, 0xc3d5d71f, 0 | BRF_OPT }, - { "chp1-b-8f_pink.8f", 0x0200, 0xa3037155, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(punchouta) -STD_ROM_FN(punchouta) - -static INT32 PunchoutaInit() -{ - return CommonInit(PunchoutLoadRoms, 1, 0xff00, 0xff00ffff); -} - -struct BurnDriver BurnDrvPunchouta = { - "punchouta", "punchout", NULL, NULL, "1984", - "Punch-Out!! (Rev A)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 1, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, punchoutaRomInfo, punchoutaRomName, NULL, NULL, PunchoutInputInfo, PunchoutDIPInfo, - PunchoutaInit, DrvExit, DrvFrame, PunchoutDraw, DrvScan, &DrvRecalc, 0x400, - 256, 448, 4, 6 -}; - - -// Punch-Out!! (Japan) - -static struct BurnRomInfo punchoutjRomDesc[] = { - { "chp1-c_8l_a.8l", 0x2000, 0x9735eb5a, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "chp1-c_8k_a.8k", 0x2000, 0x98baba41, 1 | BRF_PRG | BRF_ESS }, // 1 - { "chp1-c_8j_a.8j", 0x2000, 0x7a7f870e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "chp1-c_8h_a.8h", 0x2000, 0x5d8123d7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "chp1-c_8f_a.8f", 0x4000, 0xea52cda1, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "chp1-c_4k_a.4k", 0x2000, 0xcb6ef376, 2 | BRF_PRG | BRF_ESS }, // 5 N2A03 Code - - { "chp1-b_4c_a.4c", 0x2000, 0xe26dc8b3, 3 | BRF_GRA }, // 6 Top Screen Background Characters - { "chp1-b_4d_a.4d", 0x2000, 0xdd1310ca, 3 | BRF_GRA }, // 7 - - { "chp1-b_4a_a.4a", 0x2000, 0x20fb4829, 4 | BRF_GRA }, // 8 Bottom Screen Background Characters - { "chp1-b_4b_a.4b", 0x2000, 0xedc34594, 4 | BRF_GRA }, // 9 - - { "chp1-v_2r_a.2r", 0x4000, 0xbd1d4b2e, 5 | BRF_GRA }, // 10 Big Sprite Characters - { "chp1-v_2t_a.2t", 0x4000, 0xdd9a688a, 5 | BRF_GRA }, // 11 - { "chp1-v_2u_a.2u", 0x2000, 0xda6a3c4b, 5 | BRF_GRA }, // 12 - { "chp1-v_2v_a.2v", 0x2000, 0x8c734a67, 5 | BRF_GRA }, // 13 - { "chp1-v_3r_a.3r", 0x4000, 0x2e74ad1d, 5 | BRF_GRA }, // 14 - { "chp1-v_3t_a.3t", 0x4000, 0x630ba9fb, 5 | BRF_GRA }, // 15 - { "chp1-v_3u_a.3u", 0x2000, 0x6440321d, 5 | BRF_GRA }, // 16 - { "chp1-v_3v_a.3v", 0x2000, 0xbb7b7198, 5 | BRF_GRA }, // 17 - { "chp1-v_4r_a.4r", 0x4000, 0x4e5b0fe9, 5 | BRF_GRA }, // 18 - { "chp1-v_4t_a.4t", 0x4000, 0x37ffc940, 5 | BRF_GRA }, // 19 - { "chp1-v_4u_a.4u", 0x2000, 0x1a7521d4, 5 | BRF_GRA }, // 20 - - { "chp1-v_6p_a.6p", 0x2000, 0x16588f7a, 6 | BRF_GRA }, // 21 Bottom Screen Big Sprite Characters - { "chp1-v_6n_a.6n", 0x2000, 0xdc743674, 6 | BRF_GRA }, // 22 - { "chp1-v_8p_a.8p", 0x2000, 0xc2db5b4e, 6 | BRF_GRA }, // 23 - { "chp1-v_8n_a.8n", 0x2000, 0xe6af390e, 6 | BRF_GRA }, // 24 - - { "chp1-b-6e_pink.6e", 0x0200, 0xe9ca3ac6, 7 | BRF_GRA }, // 25 Color PROMs - { "chp1-b-6f_pink.6f", 0x0200, 0x02be56ab, 7 | BRF_GRA }, // 26 - { "chp1-b-7f_pink.7f", 0x0200, 0x11de55f1, 7 | BRF_GRA }, // 27 - { "chp1-b-7e_white.7e", 0x0200, 0x47adf7a2, 7 | BRF_GRA }, // 28 - { "chp1-b-8e_white.8e", 0x0200, 0xb0fc15a8, 7 | BRF_GRA }, // 29 - { "chp1-b-8f_white.8f", 0x0200, 0x1ffd894a, 7 | BRF_GRA }, // 30 - - { "chp1-v-2d.2d", 0x0100, 0x71dc0d48, 0 | BRF_GRA }, // 31 Timing PROM - - { "chp1-c_6p_a.6p", 0x4000, 0x597955ca, 8 | BRF_SND }, // 32 VLM5030 Samples - - { "chp1-b-6e_white.6e", 0x0200, 0xddac5f0e, 0 | BRF_OPT }, - { "chp1-b-6f_white.6f", 0x0200, 0x846c6261, 0 | BRF_OPT }, - { "chp1-b-7f_white.7f", 0x0200, 0x1682dd30, 0 | BRF_OPT }, - { "chp1-b-7e_pink.7e", 0x0200, 0xfddaa777, 0 | BRF_OPT }, - { "chp1-b-8e_pink.8e", 0x0200, 0xc3d5d71f, 0 | BRF_OPT }, - { "chp1-b-8f_pink.8f", 0x0200, 0xa3037155, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(punchoutj) -STD_ROM_FN(punchoutj) - -struct BurnDriver BurnDrvPunchoutj = { - "punchoutj", "punchout", NULL, NULL, "1984", - "Punch-Out!! (Japan)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, punchoutjRomInfo, punchoutjRomName, NULL, NULL, PunchoutInputInfo, PunchoutDIPInfo, - PunchoutaInit, DrvExit, DrvFrame, PunchoutDraw, DrvScan, &DrvRecalc, 0x400, - 256, 448, 4, 6 -}; - - -// Punch-Out!! (Italian bootleg) - -static struct BurnRomInfo punchitaRomDesc[] = { - { "chp1-c.8l", 0x2000, 0x1d595ce2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "chp1-c.8k", 0x2000, 0xc062fa5c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "chp1-c.8j", 0x2000, 0x48d453ef, 1 | BRF_PRG | BRF_ESS }, // 2 - { "chp1-c.8h", 0x2000, 0x67f5aedc, 1 | BRF_PRG | BRF_ESS }, // 3 - { "chp1-c.8f", 0x4000, 0x761de4f3, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "chp1-c.4k", 0x2000, 0xcb6ef376, 2 | BRF_PRG | BRF_ESS }, // 5 N2A03 Code - - { "chp1-b.4c", 0x2000, 0x9a9ff1d3, 3 | BRF_GRA }, // 6 Top Screen Background Characters - { "chp1-b.4d", 0x2000, 0x4c23350f, 3 | BRF_GRA }, // 7 - - { "chp1-b.4a", 0x2000, 0xc075f831, 4 | BRF_GRA }, // 8 Bottom Screen Background Characters - { "chp1-b.4b", 0x2000, 0xc4cc2b5a, 4 | BRF_GRA }, // 9 - - { "chp1-v.2r", 0x4000, 0xbd1d4b2e, 5 | BRF_GRA }, // 10 Big Sprite Characters - { "chp1-v.2t", 0x4000, 0xdd9a688a, 5 | BRF_GRA }, // 11 - { "chp1-v.2u", 0x2000, 0xda6a3c4b, 5 | BRF_GRA }, // 12 - { "chp1-v.2v", 0x2000, 0x8c734a67, 5 | BRF_GRA }, // 13 - { "chp1-v.3r", 0x4000, 0x2e74ad1d, 5 | BRF_GRA }, // 14 - { "chp1-v.3t", 0x4000, 0x630ba9fb, 5 | BRF_GRA }, // 15 - { "chp1-v.3u", 0x2000, 0x6440321d, 5 | BRF_GRA }, // 16 - { "chp1-v.3v", 0x2000, 0xbb7b7198, 5 | BRF_GRA }, // 17 - { "chp1-v.4r", 0x4000, 0x4e5b0fe9, 5 | BRF_GRA }, // 18 - { "chp1-v.4t", 0x4000, 0x37ffc940, 5 | BRF_GRA }, // 19 - { "chp1-v.4u", 0x2000, 0x1a7521d4, 5 | BRF_GRA }, // 20 - - { "chp1-v.6p", 0x2000, 0x75be7aae, 6 | BRF_GRA }, // 21 Bottom Screen Big Sprite Characters - { "chp1-v.6n", 0x2000, 0xdaf74de0, 6 | BRF_GRA }, // 22 - { "chp1-v.8p", 0x2000, 0x4cb7ea82, 6 | BRF_GRA }, // 23 - { "chp1-v.8n", 0x2000, 0x1c0d09aa, 6 | BRF_GRA }, // 24 - - { "chp1-b-6e_pink.6e", 0x0200, 0xe9ca3ac6, 7 | BRF_GRA }, // 25 Color PROMs - { "chp1-b-6f_pink.6f", 0x0200, 0x02be56ab, 7 | BRF_GRA }, // 26 - { "chp1-b-7f_pink.7f", 0x0200, 0x11de55f1, 7 | BRF_GRA }, // 27 - { "chp1-b-7e_white.7e", 0x0200, 0x47adf7a2, 7 | BRF_GRA }, // 28 - { "chp1-b-8e_white.8e", 0x0200, 0xb0fc15a8, 7 | BRF_GRA }, // 29 - { "chp1-b-8f_white.8f", 0x0200, 0x1ffd894a, 7 | BRF_GRA }, // 30 - - { "chp1-v-2d.2d", 0x0100, 0x71dc0d48, 0 | BRF_GRA }, // 31 Timing PROM - - { "chp1-c.6p", 0x4000, 0xea0bbb31, 8 | BRF_SND }, // 32 VLM5030 Samples - - { "chp1-b-6e_white.6e", 0x0200, 0xddac5f0e, 0 | BRF_OPT }, - { "chp1-b-6f_white.6f", 0x0200, 0x846c6261, 0 | BRF_OPT }, - { "chp1-b-7f_white.7f", 0x0200, 0x1682dd30, 0 | BRF_OPT }, - { "chp1-b-7e_pink.7e", 0x0200, 0xfddaa777, 0 | BRF_OPT }, - { "chp1-b-8e_pink.8e", 0x0200, 0xc3d5d71f, 0 | BRF_OPT }, - { "chp1-b-8f_pink.8f", 0x0200, 0xa3037155, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(punchita) -STD_ROM_FN(punchita) - -static INT32 SpnchoutInit() -{ - return CommonInit(SpunchoutLoadRoms, 1, 0xff00, 0x00000000); -} - -struct BurnDriver BurnDrvPunchita = { - "punchita", "punchout", NULL, NULL, "1984", - "Punch-Out!! (Italian bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 1, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, punchitaRomInfo, punchitaRomName, NULL, NULL, PunchoutInputInfo, PunchoutDIPInfo, - SpnchoutInit, DrvExit, DrvFrame, PunchoutDraw, DrvScan, &DrvRecalc, 0x400, - 256, 448, 4, 6 -}; - - -// Super Punch-Out!! (Rev B) - -static struct BurnRomInfo spnchoutRomDesc[] = { - { "chs1-c.8l", 0x2000, 0x703b9780, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "chs1-c.8k", 0x2000, 0xe13719f6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "chs1-c.8j", 0x2000, 0x1fa629e8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "chs1-c.8h", 0x2000, 0x15a6c068, 1 | BRF_PRG | BRF_ESS }, // 3 - { "chs1-c.8f", 0x4000, 0x4ff3cdd9, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "chp1-c.4k", 0x2000, 0xcb6ef376, 2 | BRF_PRG | BRF_ESS }, // 5 N2A03 Code - - { "chs1-b.4c", 0x2000, 0x9f2ede2d, 3 | BRF_GRA }, // 6 Top Screen Background Characters - { "chs1-b.4d", 0x2000, 0x143ae5c6, 3 | BRF_GRA }, // 7 - - { "chp1-b.4a", 0x2000, 0xc075f831, 4 | BRF_GRA }, // 8 Bottom Screen Background Characters - { "chp1-b.4b", 0x2000, 0xc4cc2b5a, 4 | BRF_GRA }, // 9 - - { "chs1-v.2r", 0x4000, 0xff33405d, 5 | BRF_GRA }, // 10 Big Sprite Characters - { "chs1-v.2t", 0x4000, 0xf507818b, 5 | BRF_GRA }, // 11 - { "chs1-v.2u", 0x4000, 0x0995fc95, 5 | BRF_GRA }, // 12 - { "chs1-v.2v", 0x2000, 0xf44d9878, 5 | BRF_GRA }, // 13 - { "chs1-v.3r", 0x4000, 0x09570945, 5 | BRF_GRA }, // 14 - { "chs1-v.3t", 0x4000, 0x42c6861c, 5 | BRF_GRA }, // 15 - { "chs1-v.3u", 0x4000, 0xbf5d02dd, 5 | BRF_GRA }, // 16 - { "chs1-v.3v", 0x2000, 0x5673f4fc, 5 | BRF_GRA }, // 17 - { "chs1-v.4r", 0x4000, 0x8e155758, 5 | BRF_GRA }, // 18 - { "chs1-v.4t", 0x4000, 0xb4e43448, 5 | BRF_GRA }, // 19 - { "chs1-v.4u", 0x4000, 0x74e0d956, 5 | BRF_GRA }, // 20 - - { "chp1-v.6p", 0x2000, 0x75be7aae, 6 | BRF_GRA }, // 21 Bottom Screen Big Sprite Characters - { "chp1-v.6n", 0x2000, 0xdaf74de0, 6 | BRF_GRA }, // 22 - { "chp1-v.8p", 0x2000, 0x4cb7ea82, 6 | BRF_GRA }, // 23 - { "chp1-v.8n", 0x2000, 0x1c0d09aa, 6 | BRF_GRA }, // 24 - - { "chs1-b-6e_pink.6e", 0x0200, 0x0ad4d727, 7 | BRF_GRA }, // 25 Color PROMs - { "chs1-b-6f_pink.6f", 0x0200, 0x86f5cfdb, 7 | BRF_GRA }, // 26 - { "chs1-b-7f_pink.7f", 0x0200, 0x8bd406f8, 7 | BRF_GRA }, // 27 - { "chs1-b-7e_white.7e", 0x0200, 0x9e170f64, 7 | BRF_GRA }, // 28 - { "chs1-b-8e_white.8e", 0x0200, 0x3a2e333b, 7 | BRF_GRA }, // 29 - { "chs1-b-8f_white.8f", 0x0200, 0x1663eed7, 7 | BRF_GRA }, // 30 - - { "chs1-v.2d", 0x0100, 0x71dc0d48, 0 | BRF_GRA | BRF_OPT }, // 31 Timing PROM - - { "chs1-c.6p", 0x4000, 0xad8b64b8, 8 | BRF_SND }, // 32 VLM5030 Samples - - { "chs1-b-6e_white.6e", 0x0200, 0x8efd867f, 0 | BRF_OPT }, // - { "chs1-b-6f_white.6f", 0x0200, 0x279d6cbc, 0 | BRF_OPT }, // - { "chs1-b-7f_white.7f", 0x0200, 0xcad6b7ad, 0 | BRF_OPT }, // - { "chs1-b-7e_pink.7e", 0x0200, 0x4c7e3a67, 0 | BRF_OPT }, // - { "chs1-b-8e_pink.8e", 0x0200, 0xec659313, 0 | BRF_OPT }, // - { "chs1-b-8f_pink.8f", 0x0200, 0x8b493c09, 0 | BRF_OPT }, // -}; - -STD_ROM_PICK(spnchout) -STD_ROM_FN(spnchout) - -struct BurnDriver BurnDrvSpnchout = { - "spnchout", NULL, NULL, NULL, "1984", - "Super Punch-Out!! (Rev B)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, spnchoutRomInfo, spnchoutRomName, NULL, NULL, SpnchoutInputInfo, SpnchoutDIPInfo, - SpnchoutInit, DrvExit, DrvFrame, PunchoutDraw, DrvScan, &DrvRecalc, 0x400, - 256, 448, 4, 6 -}; - - -// Super Punch-Out!! (Rev A) - -static struct BurnRomInfo spnchoutaRomDesc[] = { - { "chs1-c.8l", 0x2000, 0x703b9780, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "chs1-c.8k", 0x2000, 0xe13719f6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "chs1-c.8j", 0x2000, 0x1fa629e8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "chs1-c.8h", 0x2000, 0x15a6c068, 1 | BRF_PRG | BRF_ESS }, // 3 - { "chs1-c.8f", 0x4000, 0x4ff3cdd9, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "chp1-c.4k", 0x2000, 0xcb6ef376, 2 | BRF_PRG | BRF_ESS }, // 5 N2A03 Code - - { "chs1-b.4c", 0x2000, 0xb017e1e9, 3 | BRF_GRA }, // 6 Top Screen Background Characters - { "chs1-b.4d", 0x2000, 0xe3de9d18, 3 | BRF_GRA }, // 7 - - { "chp1-b.4a", 0x2000, 0x20fb4829, 4 | BRF_GRA }, // 8 Bottom Screen Background Characters - { "chp1-b.4b", 0x2000, 0xedc34594, 4 | BRF_GRA }, // 9 - - { "chs1-v.2r", 0x4000, 0xff33405d, 5 | BRF_GRA }, // 10 Big Sprite Characters - { "chs1-v.2t", 0x4000, 0xf507818b, 5 | BRF_GRA }, // 11 - { "chs1-v.2u", 0x4000, 0x0995fc95, 5 | BRF_GRA }, // 12 - { "chs1-v.2v", 0x2000, 0xf44d9878, 5 | BRF_GRA }, // 13 - { "chs1-v.3r", 0x4000, 0x09570945, 5 | BRF_GRA }, // 14 - { "chs1-v.3t", 0x4000, 0x42c6861c, 5 | BRF_GRA }, // 15 - { "chs1-v.3u", 0x4000, 0xbf5d02dd, 5 | BRF_GRA }, // 16 - { "chs1-v.3v", 0x2000, 0x5673f4fc, 5 | BRF_GRA }, // 17 - { "chs1-v.4r", 0x4000, 0x8e155758, 5 | BRF_GRA }, // 18 - { "chs1-v.4t", 0x4000, 0xb4e43448, 5 | BRF_GRA }, // 19 - { "chs1-v.4u", 0x4000, 0x74e0d956, 5 | BRF_GRA }, // 20 - - { "chp1-v.6p", 0x2000, 0x16588f7a, 6 | BRF_GRA }, // 21 Bottom Screen Big Sprite Characters - { "chp1-v.6n", 0x2000, 0xdc743674, 6 | BRF_GRA }, // 22 - { "chp1-v.8p", 0x2000, 0xc2db5b4e, 6 | BRF_GRA }, // 23 - { "chp1-v.8n", 0x2000, 0xe6af390e, 6 | BRF_GRA }, // 24 - - { "chs1-b-6e_pink.6e", 0x0200, 0x0ad4d727, 7 | BRF_GRA }, // 25 Color PROMs - { "chs1-b-6f_pink.6f", 0x0200, 0x86f5cfdb, 7 | BRF_GRA }, // 26 - { "chs1-b-7f_pink.7f", 0x0200, 0x8bd406f8, 7 | BRF_GRA }, // 27 - { "chs1-b-7e_white.7e", 0x0200, 0x9e170f64, 7 | BRF_GRA }, // 28 - { "chs1-b-8e_white.8e", 0x0200, 0x3a2e333b, 7 | BRF_GRA }, // 29 - { "chs1-b-8f_white.8f", 0x0200, 0x1663eed7, 7 | BRF_GRA }, // 30 - - { "chs1-v.2d", 0x0100, 0x71dc0d48, 0 | BRF_GRA | BRF_OPT }, // 31 Timing PROM - - { "chs1-c.6p", 0x4000, 0xad8b64b8, 8 | BRF_SND }, // 32 VLM5030 Samples - - { "chs1-b-6e_white.6e", 0x0200, 0x8efd867f, 0 | BRF_OPT }, // - { "chs1-b-6f_white.6f", 0x0200, 0x279d6cbc, 0 | BRF_OPT }, // - { "chs1-b-7f_white.7f", 0x0200, 0xcad6b7ad, 0 | BRF_OPT }, // - { "chs1-b-7e_pink.7e", 0x0200, 0x4c7e3a67, 0 | BRF_OPT }, // - { "chs1-b-8e_pink.8e", 0x0200, 0xec659313, 0 | BRF_OPT }, // - { "chs1-b-8f_pink.8f", 0x0200, 0x8b493c09, 0 | BRF_OPT }, // -}; - -STD_ROM_PICK(spnchouta) -STD_ROM_FN(spnchouta) - -struct BurnDriver BurnDrvSpnchouta = { - "spnchouta", "spnchout", NULL, NULL, "1984", - "Super Punch-Out!! (Rev A)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, spnchoutaRomInfo, spnchoutaRomName, NULL, NULL, SpnchoutInputInfo, SpnchoutDIPInfo, - PunchoutaInit, DrvExit, DrvFrame, PunchoutDraw, DrvScan, &DrvRecalc, 0x400, - 256, 448, 4, 6 -}; - - -// Super Punch-Out!! (Japan) - -static struct BurnRomInfo spnchoutjRomDesc[] = { - { "chs1c8la.bin", 0x2000, 0xdc2a592b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "chs1c8ka.bin", 0x2000, 0xce687182, 1 | BRF_PRG | BRF_ESS }, // 1 - { "chs1-c.8j", 0x2000, 0x1fa629e8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "chs1-c.8h", 0x2000, 0x15a6c068, 1 | BRF_PRG | BRF_ESS }, // 3 - { "chs1c8fa.bin", 0x4000, 0xf745b5d5, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "chp1-c.4k", 0x2000, 0xcb6ef376, 2 | BRF_PRG | BRF_ESS }, // 5 N2A03 Code - - { "b_4c_01a.bin", 0x2000, 0xb017e1e9, 3 | BRF_GRA }, // 6 Top Screen Background Characters - { "b_4d_01a.bin", 0x2000, 0xe3de9d18, 3 | BRF_GRA }, // 7 - - { "chp1-b.4a", 0x2000, 0xc075f831, 4 | BRF_GRA }, // 8 Bottom Screen Background Characters - { "chp1-b.4b", 0x2000, 0xc4cc2b5a, 4 | BRF_GRA }, // 9 - - { "chs1-v.2r", 0x4000, 0xff33405d, 5 | BRF_GRA }, // 10 Big Sprite Characters - { "chs1-v.2t", 0x4000, 0xf507818b, 5 | BRF_GRA }, // 11 - { "chs1-v.2u", 0x4000, 0x0995fc95, 5 | BRF_GRA }, // 12 - { "chs1-v.2v", 0x2000, 0xf44d9878, 5 | BRF_GRA }, // 13 - { "chs1-v.3r", 0x4000, 0x09570945, 5 | BRF_GRA }, // 14 - { "chs1-v.3t", 0x4000, 0x42c6861c, 5 | BRF_GRA }, // 15 - { "chs1-v.3u", 0x4000, 0xbf5d02dd, 5 | BRF_GRA }, // 16 - { "chs1-v.3v", 0x2000, 0x5673f4fc, 5 | BRF_GRA }, // 17 - { "chs1-v.4r", 0x4000, 0x8e155758, 5 | BRF_GRA }, // 18 - { "chs1-v.4t", 0x4000, 0xb4e43448, 5 | BRF_GRA }, // 19 - { "chs1-v.4u", 0x4000, 0x74e0d956, 5 | BRF_GRA }, // 20 - - { "chp1-v.6p", 0x2000, 0x75be7aae, 6 | BRF_GRA }, // 21 Bottom Screen Big Sprite Characters - { "chp1-v.6n", 0x2000, 0xdaf74de0, 6 | BRF_GRA }, // 22 - { "chp1-v.8p", 0x2000, 0x4cb7ea82, 6 | BRF_GRA }, // 23 - { "chp1-v.8n", 0x2000, 0x1c0d09aa, 6 | BRF_GRA }, // 24 - - { "chs1-b-6e_white.6e", 0x0200, 0x8efd867f, 0 | BRF_GRA }, // 25 Color PROMS - { "chs1-b-6f_white.6f", 0x0200, 0x279d6cbc, 0 | BRF_GRA }, // 26 - { "chs1-b-7f_white.7f", 0x0200, 0xcad6b7ad, 0 | BRF_GRA }, // 27 - { "chs1-b-7e_white.7e", 0x0200, 0x9e170f64, 7 | BRF_GRA }, // 28 - { "chs1-b-8e_white.8e", 0x0200, 0x3a2e333b, 7 | BRF_GRA }, // 29 - { "chs1-b-8f_white.8f", 0x0200, 0x1663eed7, 7 | BRF_GRA }, // 30 - - { "chs1-v.2d", 0x0100, 0x71dc0d48, 0 | BRF_OPT }, // 31 Timing PROM - - { "chs1c6pa.bin", 0x4000, 0xd05fb730, 8 | BRF_SND }, // 32 VLM5030 Samples - - { "chs1-b-6e_pink.6e", 0x0200, 0x0ad4d727, 7 | BRF_OPT }, - { "chs1-b-6f_pink.6f", 0x0200, 0x86f5cfdb, 7 | BRF_OPT }, - { "chs1-b-7f_pink.7f", 0x0200, 0x8bd406f8, 7 | BRF_OPT }, - { "chs1-b-7e_pink.7e", 0x0200, 0x4c7e3a67, 0 | BRF_OPT }, - { "chs1-b-8e_pink.8e", 0x0200, 0xec659313, 0 | BRF_OPT }, - { "chs1-b-8f_pink.8f", 0x0200, 0x8b493c09, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(spnchoutj) -STD_ROM_FN(spnchoutj) - -static INT32 SpnchoutjInit() -{ - return CommonInit(SpunchoutjLoadRoms, 1, 0xffff, 0x000000ff); -} - -struct BurnDriver BurnDrvSpnchoutj = { - "spnchoutj", "spnchout", NULL, NULL, "1984", - "Super Punch-Out!! (Japan)\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, spnchoutjRomInfo, spnchoutjRomName, NULL, NULL, SpnchoutInputInfo, SpnchoutDIPInfo, - SpnchoutjInit, DrvExit, DrvFrame, PunchoutDraw, DrvScan, &DrvRecalc, 0x400, - 256, 448, 4, 6 -}; - - -// Arm Wrestling - -static struct BurnRomInfo armwrestRomDesc[] = { - { "chv1-c.8l", 0x2000, 0xb09764c1, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "chv1-c.8k", 0x2000, 0x0e147ff7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "chv1-c.8j", 0x2000, 0xe7365289, 1 | BRF_PRG | BRF_ESS }, // 2 - { "chv1-c.8h", 0x2000, 0xa2118eec, 1 | BRF_PRG | BRF_ESS }, // 3 - { "chpv-c.8f", 0x4000, 0x664a07c4, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "chp1-c.4k", 0x2000, 0xcb6ef376, 2 | BRF_PRG | BRF_ESS }, // 5 N2A03 Code - - { "chpv-b.2e", 0x4000, 0x8b45f365, 3 | BRF_GRA }, // 6 Background Characters - { "chpv-b.2d", 0x4000, 0xb1a2850c, 3 | BRF_GRA }, // 7 - - { "chpv-b.2m", 0x4000, 0x19245b37, 4 | BRF_GRA }, // 8 Bottom Screen Foreground Characters - { "chpv-b.2l", 0x4000, 0x46797941, 4 | BRF_GRA }, // 9 - { "chpv-b.2k", 0x2000, 0xde189b00, 4 | BRF_GRA }, // 10 - - { "chv1-v.2r", 0x4000, 0xd86056d9, 5 | BRF_GRA }, // 11 Big Sprite Characters - { "chv1-v.2t", 0x4000, 0x5ad77059, 5 | BRF_GRA }, // 12 - { "chv1-v.2v", 0x4000, 0xa0fd7338, 5 | BRF_GRA }, // 13 - { "chv1-v.3r", 0x4000, 0x690e26fb, 5 | BRF_GRA }, // 14 - { "chv1-v.3t", 0x4000, 0xea5d7759, 5 | BRF_GRA }, // 15 - { "chv1-v.3v", 0x4000, 0xceb37c05, 5 | BRF_GRA }, // 16 - { "chv1-v.4r", 0x4000, 0xe291cba0, 5 | BRF_GRA }, // 17 - { "chv1-v.4t", 0x4000, 0xe01f3b59, 5 | BRF_GRA }, // 18 - - { "chv1-v.6p", 0x2000, 0xd834e142, 6 | BRF_GRA }, // 19 Bottom Screen Big Sprite Characters - { "chv1-v.8p", 0x2000, 0xa2f531db, 6 | BRF_GRA }, // 20 - - { "chpv-b.7b", 0x0200, 0xdf6fdeb3, 7 | BRF_GRA }, // 21 Color PROMs - { "chpv-b.7c", 0x0200, 0xb1da5f42, 7 | BRF_GRA }, // 22 - { "chpv-b.7d", 0x0200, 0x4ede813e, 7 | BRF_GRA }, // 23 - { "chpv-b.4b", 0x0200, 0x9d51416e, 7 | BRF_GRA }, // 24 - { "chpv-b.4c", 0x0200, 0xb8a25795, 7 | BRF_GRA }, // 25 - { "chpv-b.4d", 0x0200, 0x474fc3b1, 7 | BRF_GRA }, // 26 - - { "chv1-b.3c", 0x0100, 0xc3f92ea2, 0 | BRF_OPT }, // 27 Priority PROM - { "chpv-v.2d", 0x0100, 0x71dc0d48, 0 | BRF_OPT }, // 28 Timing PROM - - { "chv1-c.6p", 0x4000, 0x31b52896, 8 | BRF_SND }, // 29 VLM5030 Samples -}; - -STD_ROM_PICK(armwrest) -STD_ROM_FN(armwrest) - -static INT32 ArmwrestInit() -{ - return CommonInit(ArmwrestLoadRoms, 0, 0x0000, 0xff000000); -} - -struct BurnDriver BurnDrvArmwrest = { - "armwrest", NULL, NULL, NULL, "1985", - "Arm Wrestling\0", NULL, "Nintendo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, armwrestRomInfo, armwrestRomName, NULL, NULL, ArmwrestInputInfo, ArmwrestDIPInfo, - ArmwrestInit, DrvExit, DrvFrame, ArmwrestDraw, DrvScan, &DrvRecalc, 0x400, - 256, 448, 4, 6 -}; diff --git a/jan/src/burn/drv/pre90s/d_qbert.cpp b/jan/src/burn/drv/pre90s/d_qbert.cpp deleted file mode 100644 index 16b4abdf6..000000000 --- a/jan/src/burn/drv/pre90s/d_qbert.cpp +++ /dev/null @@ -1,1265 +0,0 @@ -// Q-Bert emu-layer for FB Alpha by dink, based on the MAME driver by Fabrice Frances & Nicola Salmoria. - -#include "tiles_generic.h" -#include "driver.h" -#include "nec_intf.h" -#include "m6502_intf.h" -#include "bitswap.h" -#include "dac.h" -#include "samples.h" - -//#define QBERT_SOUND_DEBUG - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvV20ROM; -static UINT8 *Drv6502ROM; -static UINT8 *DrvV20RAM; -static UINT8 *Drv6502RAM; -static UINT8 *DrvVideoRAM; -static UINT8 *DrvCharRAM; -static UINT8 *DrvSpriteRAM; -static UINT8 *DrvPaletteRAM; -static UINT8 *DrvCharGFX; -static UINT8 *DrvSpriteGFX; -static UINT8 *DrvNVRAM; -static UINT8 *DrvDummyROM; - -static UINT8 *riot_regs; -static UINT8 *riot_ram; - -static UINT8 *background_prio; -static UINT8 *spritebank; -static UINT8 *soundlatch; -static UINT8 *soundcpu_do_nmi; - -static char *vtqueue; -static UINT8 *vtqueuepos; -static UINT32 *vtqueuetime; -static UINT8 *knocker_prev; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvFakeInput[8]; // fake inputs for rotate buttons - -static UINT8 DrvDip[2] = { 0, 0 }; -static UINT8 DrvInput[5]; -static UINT8 DrvReset; - -static UINT8 game_type = 0; // 0 = qbert, 6 = qbertcub, 4 = mplanets - -static UINT32 nRotateTime[2] = { 0, 0 }; - -static struct BurnInputInfo QbertInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Select", BIT_DIGITAL, DrvJoy1 + 7, "select" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Qbert) - - -static struct BurnDIPInfo QbertDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x02, NULL }, - {0x0f, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0e, 0x01, 0x01, 0x01, "Off" }, - {0x0e, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Kicker" }, - {0x0e, 0x01, 0x02, 0x00, "Off" }, - {0x0e, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x04, 0x00, "Upright" }, - {0x0e, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Auto Round Advance (Cheat)" }, - {0x0e, 0x01, 0x08, 0x00, "Off" }, - {0x0e, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0e, 0x01, 0x10, 0x00, "Off" }, - {0x0e, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "SW5" }, - {0x0e, 0x01, 0x20, 0x00, "Off" }, - {0x0e, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "SW7" }, - {0x0e, 0x01, 0x40, 0x00, "Off" }, - {0x0e, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "SW8" }, - {0x0e, 0x01, 0x80, 0x00, "Off" }, - {0x0e, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Service" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Qbert) - -static struct BurnInputInfo MplanetsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 2" }, - {"Rotate Left", BIT_DIGITAL, DrvFakeInput + 0, "p1 rotate left" }, - {"Rotate Right",BIT_DIGITAL, DrvFakeInput + 1, "p1 rotate right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Select", BIT_DIGITAL, DrvJoy1 + 6, "select" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Mplanets) - - -static struct BurnDIPInfo MplanetsDIPList[]= -{ - {0x0C, 0xff, 0xff, 0x00, NULL }, - {0x0D, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0C, 0x01, 0x01, 0x01, "Off" }, - {0x0C, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x0C, 0x01, 0x02, 0x00, "10000" }, - {0x0C, 0x01, 0x02, 0x02, "12000" }, - - {0 , 0xfe, 0 , 2, "Allow Round Select" }, - {0x0C, 0x01, 0x08, 0x00, "No" }, - {0x0C, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0C, 0x01, 0x14, 0x04, "2 Coins 1 Credit" }, - {0x0C, 0x01, 0x14, 0x00, "1 Coin 1 Credit" }, - {0x0C, 0x01, 0x14, 0x10, "1 Coin 2 Credits" }, - {0x0C, 0x01, 0x14, 0x14, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0C, 0x01, 0x20, 0x00, "3" }, - {0x0C, 0x01, 0x20, 0x20, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0C, 0x01, 0xc0, 0x40, "Easy" }, - {0x0C, 0x01, 0xc0, 0x00, "Medium" }, - {0x0C, 0x01, 0xc0, 0x80, "Hard" }, - {0x0C, 0x01, 0xc0, 0xc0, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service" }, - {0x0D, 0x01, 0x80, 0x80, "Off" }, - {0x0D, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Mplanets) - -static struct BurnInputInfo QbertqubInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Select", BIT_DIGITAL, DrvJoy1 + 7, "select" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Qbertqub) - -static struct BurnDIPInfo QbertqubDIPList[]= -{ - {0x08, 0xff, 0xff, 0x00, NULL }, - {0x09, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x08, 0x01, 0x08, 0x08, "Off" }, - {0x08, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 13, "Coinage" }, - {0x08, 0x01, 0x35, 0x24, "A 2/1 B 2/1" }, - {0x08, 0x01, 0x35, 0x14, "A 1/1 B 4/1" }, - {0x08, 0x01, 0x35, 0x30, "A 1/1 B 3/1" }, - {0x08, 0x01, 0x35, 0x10, "A 1/1 B 2/1" }, - {0x08, 0x01, 0x35, 0x00, "A 1/1 B 1/1" }, - {0x08, 0x01, 0x35, 0x11, "A 2/3 B 2/1" }, - {0x08, 0x01, 0x35, 0x15, "A 1/2 B 3/1" }, - {0x08, 0x01, 0x35, 0x20, "A 1/2 B 2/1" }, - {0x08, 0x01, 0x35, 0x21, "A 1/2 B 1/1" }, - {0x08, 0x01, 0x35, 0x31, "A 1/2 B 1/5" }, - {0x08, 0x01, 0x35, 0x04, "A 1/3 B 2/1" }, - {0x08, 0x01, 0x35, 0x05, "A 1/3 B 1/1" }, - {0x08, 0x01, 0x35, 0x35, "Free Play" }, - - {0 , 0xfe, 0 , 2, "1st Bonus Life" }, - {0x08, 0x01, 0x02, 0x00, "10000" }, - {0x08, 0x01, 0x02, 0x02, "15000" }, - - {0 , 0xfe, 0 , 2, "Additional Bonus Life" }, - {0x08, 0x01, 0x40, 0x00, "20000" }, - {0x08, 0x01, 0x40, 0x40, "25000" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x08, 0x01, 0x80, 0x00, "Normal" }, - {0x08, 0x01, 0x80, 0x80, "Hard" }, - - {0 , 0xfe, 0 , 2, "Service" }, - {0x09, 0x01, 0x40, 0x40, "Off" }, - {0x09, 0x01, 0x40, 0x00, "On" }, - -}; - -STDDIPINFO(Qbertqub) - -static UINT8 dialRotation(int addy) { - if (nRotateTime[addy] > nCurrentFrame) nRotateTime[addy] = 0; // Bugfix: no rotate after savestate - - if (DrvFakeInput[0] && (nCurrentFrame > nRotateTime[addy]+2)) { - nRotateTime[addy] = nCurrentFrame; - - return 0xfe; - } - if (DrvFakeInput[1] && (nCurrentFrame > nRotateTime[addy]+2)) { - nRotateTime[addy] = nCurrentFrame; - - return 2; - } - - return 0; -} - -static void gottlieb_paletteram_w(UINT16 offset, UINT8 data) -{ - INT32 bit0, bit1, bit2, bit3; - INT32 r, g, b, val; - - DrvPaletteRAM[offset] = data; - - /* red component */ - - val = DrvPaletteRAM[offset | 1]; - - bit0 = (val >> 0) & 0x01; - bit1 = (val >> 1) & 0x01; - bit2 = (val >> 2) & 0x01; - bit3 = (val >> 3) & 0x01; - - r = 0x10 * bit0 + 0x21 * bit1 + 0x46 * bit2 + 0x88 * bit3; - - /* green component */ - - val = DrvPaletteRAM[offset & ~1]; - - bit0 = (val >> 4) & 0x01; - bit1 = (val >> 5) & 0x01; - bit2 = (val >> 6) & 0x01; - bit3 = (val >> 7) & 0x01; - - g = 0x10 * bit0 + 0x21 * bit1 + 0x46 * bit2 + 0x88 * bit3; - - /* blue component */ - - val = DrvPaletteRAM[offset & ~1]; - - bit0 = (val >> 0) & 0x01; - bit1 = (val >> 1) & 0x01; - bit2 = (val >> 2) & 0x01; - bit3 = (val >> 3) & 0x01; - - b = 0x10 * bit0 + 0x21 * bit1 + 0x46 * bit2 + 0x88 * bit3; - - DrvPalette[offset / 2] = BurnHighCol(r, g, b, 0); -} - -static void qbert_palette() -{ - for (INT32 i = 0; i < 0x20; i++) { - gottlieb_paletteram_w(i, DrvPaletteRAM[i]); - } -} - -static void gottlieb_sh_w(UINT16 offset, UINT8 data); //forward! -static void qbert_knocker(UINT8 knock); - -static void __fastcall main_write(UINT32 address, UINT8 data) -{ - address &= 0xffff; - - if ((address & 0xff00) == 0x3700) address &= ~0x700; // mirror handling - if ((address & 0xfc00) == 0x3c00) address &= ~0x400; - if ((address & 0xffe0) == 0x57e0) address &= ~0x7e0; - if ((address & 0xffff) == 0x5ff8) address &= ~0x7f8; - - if (/*address >= 0x0000 &&*/ address <= 0x0fff) { - DrvNVRAM[address - 0x0000] = data; - return; - } - - if (address >= 0x1000 && address <= 0x2fff) { - //bprintf(0, _T("drw.")); - DrvDummyROM[address - 0x1000] = data; - return; - } - - if (address >= 0x3000 && address <= 0x30ff) { - DrvSpriteRAM[address - 0x3000] = data; - return; - } - - if (address >= 0x3800 && address <= 0x3bff) { - DrvVideoRAM[address - 0x3800] = data; - return; - } - - if (address >= 0x4000 && address <= 0x4fff) { - DrvCharRAM[address - 0x4000] = data; - return; - } - - if (address >= 0x5000 && address <= 0x501f) { - gottlieb_paletteram_w(address - 0x5000, data); - return; - } - - switch (address) - { - case 0x5802: gottlieb_sh_w(address, data); return; - case 0x5803: { - *background_prio = data & 0x01; - qbert_knocker(data >> 5 & 1); - if (game_type == 6) // qbertqub only - *spritebank = (data & 0x10) >> 4; - return; - } - } -} - -static UINT8 __fastcall main_read(UINT32 address) -{ - address &= 0xffff; - - if (address >= 0x6000 && address <= 0xffff) { - return DrvV20ROM[address - 0x6000]; - } - - if (/*address >= 0x0000 &&*/ address <= 0x0fff) { - return DrvNVRAM[address - 0x0000]; - } - - if (address >= 0x1000 && address <= 0x2fff) { - //bprintf(0, _T("drr.")); - return DrvDummyROM[address - 0x1000]; - } - - if ((address & 0xff00) == 0x3700) address &= ~0x700; - if ((address & 0xfc00) == 0x3c00) address &= ~0x400; - if ((address & 0xffe0) == 0x57e0) address &= ~0x7e0; - if ((address & 0xffff) == 0x5ff8) address &= ~0x7f8; - - if (address >= 0x3000 && address <= 0x30ff) { - return DrvSpriteRAM[address - 0x3000]; - } - - if (address >= 0x3800 && address <= 0x3bff) { - return DrvVideoRAM[address - 0x3800]; - } - - if (address >= 0x4000 && address <= 0x4fff) { - return DrvCharRAM[address - 0x4000]; - } - - if (address >= 0x5000 && address <= 0x501f) { - return DrvPaletteRAM[address - 0x5000]; - } - - - switch (address) - { - case 0x5800: return DrvDip[0]; - case 0x5801: return DrvInput[0] | DrvDip[1]; // DrvDip[1] (fake-dip) for service mode. - case 0x5803: return dialRotation(0); - case 0x5804: return DrvInput[1]; - } - - return 0; -} - -static void qbert_knocker(UINT8 knock) -{ - if (knock & ~*knocker_prev) - BurnSamplePlay(44); - *knocker_prev = knock; -} - -static void gottlieb_sh_w(UINT16 /*offset*/, UINT8 data) -{ - static INT32 random_offset = rand()&7; - data &= 0x3f; - - if ((data & 0x0f) != 0xf) { -#ifdef QBERT_SOUND_DEBUG - bprintf(0, _T("data %X.."), data ^ 0x3f); -#endif - switch (data ^ 0x3f) { // qbert sample player - case 17: - case 18: - case 19: - case 20: - case 21: - BurnSamplePlay(((data^0x3f)-17)*8+random_offset); - random_offset = (random_offset+1)&7; - break; - case 22: - BurnSamplePlay(40); - break; - case 23: - BurnSamplePlay(41); - break; - case 28: - BurnSamplePlay(42); // Hello, I'm turned on. - break; - case 36: - BurnSamplePlay(43); // Bye-Bye - break; - } - - *soundlatch = data; - - M6502SetIRQLine(0, CPU_IRQSTATUS_ACK); - M6502Run(10); //CPU_IRQSTATUS_AUTO no workie - M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static UINT8 gottlieb_riot_r(UINT16 offset) -{ - switch (offset & 0x1f) { - case 0: /* port A */ - return *soundlatch ^ 0xff; /* invert command */ - case 2: /* port B */ - return 0x40; /* say that PB6 is 1 (test SW1 not pressed) */ - case 5: /* interrupt register */ - return 0x40; /* say that edge detected on PA7 */ - default: - return riot_regs[offset & 0x1f]; - } -} - -static void blank_queue() -{ -#ifdef QBERT_SOUND_DEBUG - bprintf(0, _T("BLANK!{%X}.."), *vtqueuetime); -#endif - *vtqueuepos = 0; - memset(vtqueue, 0, 0x20); - *vtqueuetime = GetCurrentFrame(); -} - -static void add_to_queue(UINT8 data) -{ - if (*vtqueuepos > 0x20-1 || (UINT32)GetCurrentFrame() > *vtqueuetime+2) - blank_queue(); - vtqueue[(*vtqueuepos)++] = data; -} - -static UINT8 check_queue() -{ - if (*vtqueuepos == 24 && !strncmp("\xC1\xE4\xFF\xE7\xE8\xD2\xFC\xFC\xFC\xFC\xFC\xEA\xFF\xF6\xD6\xF3\xD5\xC5\xF5\xF2\xE1\xDB\xF2\xC0", vtqueue, 24)) { - blank_queue(); // "Hello, I'm turned on." - return 1; - } - - return 0; -} - -static void audio_write(UINT16 address, UINT8 data) -{ - address &= 0x7fff; // 15bit addressing - - if (address >= 0x7000 && address <= 0x7fff) { - bprintf(0, _T("write to audio ROM @ %X."), address); - Drv6502ROM[address - 0x7000] = data; - } - - if (/*address >= 0x0000 &&*/ address <= 0x01ff) { - riot_ram[address & 0x7f] = data; - } - - if (address >= 0x0200 && address <= 0x03ff) { - riot_regs[address & 0x1f] = data; - } - - switch (address) - { - case 0x1fff: - case 0x1000: { - DACWrite(0, data); - return; - } - case 0x2000: { - add_to_queue(data); -#ifdef QBERT_SOUND_DEBUG - bprintf(0, _T("\\x%X"), data); //save -#endif - switch (check_queue()) { - case 1: BurnSamplePlay(42); break; // Say Hello - } - *soundcpu_do_nmi = 1; - return; - } - } -} - -static UINT8 audio_read(UINT16 address) -{ - address &= 0x7fff; // 15bit addressing - - if (address >= 0x7000 && address <= 0x7fff) { - return Drv6502ROM[address - 0x7000]; - } - - if (/*address >= 0x0000 &&*/ address <= 0x01ff) { - return riot_ram[address&0x7f]; - } - - if (address >= 0x0200 && address <= 0x03ff) { - return gottlieb_riot_r(address - 0x200); - } - - return 0; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (M6502TotalCycles() / ((3579545.0000/4) / (nBurnFPS / 100.0000)))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - VezOpen(0); - VezReset(); - VezClose(); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - DACReset(); - BurnSampleReset(); - - nRotateTime[0] = 0; - nRotateTime[1] = 0; - - return 0; -} - - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvV20ROM = Next; Next += 0x10000; - Drv6502ROM = Next; Next += 0x10000; - - DrvPalette = (UINT32*)Next; Next += 0x10 * sizeof(UINT32); - DrvCharGFX = Next; Next += 0x40000; - DrvSpriteGFX = Next; Next += 0x40000; - - DrvNVRAM = Next; Next += 0x01000; // Keep in ROM section. - - AllRam = Next; - - DrvV20RAM = Next; Next += 0x01000; - Drv6502RAM = Next; Next += 0x01000; - - DrvVideoRAM = Next; Next += 0x00400; - DrvCharRAM = Next; Next += 0x01000; - DrvSpriteRAM = Next; Next += 0x00100; - DrvPaletteRAM = Next; Next += 0x00040; - DrvDummyROM = Next; Next += 0x02000; // it's RAM, too. - - riot_regs = Next; Next += 0x00020; - riot_ram = Next; Next += 0x00200; - - vtqueuepos = Next; Next += 0x00001; - vtqueuetime = (UINT32 *)Next; Next += 0x00004; - vtqueue = (char *)Next; Next += 0x00020; - knocker_prev = Next; Next += 0x00001; - - background_prio = Next; Next += 0x00001; - spritebank = Next; Next += 0x00001; - soundlatch = Next; Next += 0x00001; - soundcpu_do_nmi = Next; Next += 0x00001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 c8PlaneOffsets[4] = { 0, 1, 2, 3 }; - INT32 c8XOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; - INT32 c8YOffsets[8] = { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }; - - INT32 c16PlaneOffsets[4] = { RGN_FRAC(((game_type == 6) ? 0x10000 : 0x8000), 0, 4), RGN_FRAC(((game_type == 6) ? 0x10000 : 0x8000), 1, 4), RGN_FRAC(((game_type == 6) ? 0x10000 : 0x8000), 2, 4), RGN_FRAC(((game_type == 6) ? 0x10000 : 0x8000), 3, 4) }; - INT32 c16XOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; - INT32 c16YOffsets[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }; - INT32 roffset = 0; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { // Load ROMS parse GFX - UINT8 *DrvTempRom = (UINT8 *)BurnMalloc(0x40000); - memset(DrvTempRom, 0, 0x40000); - { - if (game_type == 0) { // qbert - if (BurnLoadRom(DrvV20ROM + 0x4000, 0, 1)) return 1; - if (BurnLoadRom(DrvV20ROM + 0x6000, 1, 1)) return 1; - if (BurnLoadRom(DrvV20ROM + 0x8000, 2, 1)) return 1; - } - if (game_type == 4) { // mplanets - if (BurnLoadRom(DrvV20ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvV20ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvV20ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvV20ROM + 0x6000, 3, 1)) return 1; - if (BurnLoadRom(DrvV20ROM + 0x8000, 4, 1)) return 1; - roffset = 2; - } - if (game_type == 6) { // qbertqub - if (BurnLoadRom(DrvV20ROM + 0x2000, 0, 1)) return 1; - if (BurnLoadRom(DrvV20ROM + 0x4000, 1, 1)) return 1; - if (BurnLoadRom(DrvV20ROM + 0x6000, 2, 1)) return 1; - if (BurnLoadRom(DrvV20ROM + 0x8000, 3, 1)) return 1; - roffset = 1; - } - - if (BurnLoadRom(Drv6502ROM + 0x0000, 3 + roffset, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x0800, 4 + roffset, 1)) return 1; - - // load & decode 8x8 tiles - memset(DrvTempRom, 0, 0x40000); - if (BurnLoadRom(DrvTempRom + 0x0000, 5 + roffset, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x1000, 6 + roffset, 1)) return 1; - GfxDecode(0x100, 4, 8, 8, c8PlaneOffsets, c8XOffsets, c8YOffsets, 0x100, DrvTempRom, DrvCharGFX); - - // load & decode 16x16 tiles - memset(DrvTempRom, 0, 0x40000); - if (game_type == 6) { // qbertqub - if (BurnLoadRom(DrvTempRom + 0x0000, 7 + roffset, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x4000, 8 + roffset, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x8000, 9 + roffset, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0xc000, 10 + roffset, 1)) return 1; - GfxDecode(0x200 /*((0x10000*8)/4)/(16*16))*/, 4, 16, 16, c16PlaneOffsets, c16XOffsets, c16YOffsets, 0x100, DrvTempRom, DrvSpriteGFX); - } else { - if (BurnLoadRom(DrvTempRom + 0x0000, 7 + roffset, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x2000, 8 + roffset, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x4000, 9 + roffset, 1)) return 1; - if (BurnLoadRom(DrvTempRom + 0x6000, 10 + roffset, 1)) return 1; - GfxDecode(0x100 /*((0x8000*8)/4)/(16*16))*/, 4, 16, 16, c16PlaneOffsets, c16XOffsets, c16YOffsets, 0x100, DrvTempRom, DrvSpriteGFX); - } - } - BurnFree(DrvTempRom); - } - - VezInit(0, V20_TYPE); - VezOpen(0); - - memset(DrvNVRAM, 0xff, 0x1000); // Init NVRAM - - //VezMapArea(0x01000, 0x02fff, 0, DrvDummyROM); // ROM for reactor and 3stooges, used as RAM for all other games. - //VezMapArea(0x01000, 0x02fff, 1, DrvDummyROM); // note: moved to main_read() / main_write() - //VezMapArea(0x01000, 0x02fff, 2, DrvDummyROM); - VezSetReadHandler(main_read); - VezSetWriteHandler(main_write); - - VezClose(); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502SetWriteHandler(audio_write); - M6502SetReadHandler(audio_read); - M6502SetReadOpArgHandler(audio_read); - M6502SetReadOpHandler(audio_read); - M6502Close(); - - BurnSampleInit(0); - BurnSampleSetAllRoutesAllSamples(0.30, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.35, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - - -static INT32 DrvExit() -{ - GenericTilesExit(); - - VezExit(); - M6502Exit(); - DACExit(); - BurnSampleExit(); - - BurnFree(AllMem); - - game_type = 0; - - return 0; -} - - -static void RenderTileCPMP(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, INT32 offset, INT32 /*mode*/, UINT8 *gfxrom) -{ - UINT16 *dest = pTransDraw; - UINT8 *gfx = gfxrom; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; // blank out the top and bottom 16 pixels for status - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - if (!pxl) continue; // transparency - - dest[sy * nScreenWidth + sx] = pxl | (color << 4) | offset; - } - sx -= width; - } -} - - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x100 - 8; offs += 4) { - INT32 sx = ((DrvSpriteRAM[offs + 1]) - 4) + ((game_type == 4) ? 7 : 0); // mplanets has weird sx/sy offsets - INT32 sy = ((DrvSpriteRAM[offs]) - 13) - ((game_type == 4) ? 4 : 0); // apparent in the hiscore table. - INT32 code = (255 ^ DrvSpriteRAM[offs + 2]) + 256 * *spritebank; - - if (DrvSpriteRAM[offs] || DrvSpriteRAM[offs + 1]) - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 4, 0, 0x00, DrvSpriteGFX); - } -} - -static void draw_bg() -{ - INT32 hflip = 0, vflip = 0; - for (INT32 offs = 0x3ff; offs >= 0; offs--) - { - INT32 sx = offs % 32; - INT32 sy = offs / 32; - - if (hflip) sx = 31 - sx; - if (vflip) sy = 29 - sy; - - INT32 code = DrvVideoRAM[offs]; - INT32 color = 0; - - sx = 8 * sx; - sy = 8 * sy; - if (sx >= nScreenWidth) continue; - if (sy >= nScreenHeight) continue; - - RenderTileCPMP(code, color, sx, sy, hflip, vflip, 8, 8, 0, 0, DrvCharGFX); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - qbert_palette(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 2 && !*background_prio) draw_bg(); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 2 && *background_prio) draw_bg(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvMakeInputs() -{ - // Reset Inputs (all active HIGH) - DrvInput[0] = 0; - DrvInput[1] = 0; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvMakeInputs(); - M6502NewFrame(); - - INT32 nInterleave = 256; - INT32 nCyclesTotalVez = 5000000 / 60; - INT32 nCyclesTotal6502 = (3579545 / 4) / 60; - - VezOpen(0); - M6502Open(0); - for (INT32 i = 0; i < nInterleave; i++) { - M6502Run(nCyclesTotal6502 / nInterleave); - if (*soundcpu_do_nmi) { - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - *soundcpu_do_nmi = 0; - } - - VezRun(nCyclesTotalVez / nInterleave); - if (i == (nInterleave - 1)) - VezSetIRQLineAndVector(0x20, 0xff, CPU_IRQSTATUS_AUTO); - } - VezClose(); - M6502Close(); - - if (pBurnSoundOut) { - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); // savestates get f*cked up, because NVRAM is also used - ba.Data = DrvNVRAM; // as regular memory, to fix that we will scan it both here - ba.nLen = 0x1000; // and in the NVRAM section. - ba.szName = "SSNVRAM"; // note: this is separate from "All Ram" so it doesn't get trashed in DrvDoReset(); - BurnAcb(&ba); - - VezScan(nAction); - M6502Scan(nAction); - - DACScan(nAction, pnMin); - BurnSampleScan(nAction, pnMin); - } - - if (nAction & ACB_NVRAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvNVRAM; - ba.nLen = 0x1000; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - return 0; -} - -static struct BurnSampleInfo qbertSampleDesc[] = { -#if !defined (ROM_VERIFY) - {"fx_17a", SAMPLE_NOLOOP }, - {"fx_17b", SAMPLE_NOLOOP }, - {"fx_17c", SAMPLE_NOLOOP }, - {"fx_17d", SAMPLE_NOLOOP }, - {"fx_17e", SAMPLE_NOLOOP }, - {"fx_17f", SAMPLE_NOLOOP }, - {"fx_17g", SAMPLE_NOLOOP }, - {"fx_17h", SAMPLE_NOLOOP }, - {"fx_18a", SAMPLE_NOLOOP }, - {"fx_18b", SAMPLE_NOLOOP }, - {"fx_18c", SAMPLE_NOLOOP }, - {"fx_18d", SAMPLE_NOLOOP }, - {"fx_18e", SAMPLE_NOLOOP }, - {"fx_18f", SAMPLE_NOLOOP }, - {"fx_18g", SAMPLE_NOLOOP }, - {"fx_18h", SAMPLE_NOLOOP }, - {"fx_19a", SAMPLE_NOLOOP }, - {"fx_19b", SAMPLE_NOLOOP }, - {"fx_19c", SAMPLE_NOLOOP }, - {"fx_19d", SAMPLE_NOLOOP }, - {"fx_19e", SAMPLE_NOLOOP }, - {"fx_19f", SAMPLE_NOLOOP }, - {"fx_19g", SAMPLE_NOLOOP }, - {"fx_19h", SAMPLE_NOLOOP }, - {"fx_20a", SAMPLE_NOLOOP }, - {"fx_20b", SAMPLE_NOLOOP }, - {"fx_20c", SAMPLE_NOLOOP }, - {"fx_20d", SAMPLE_NOLOOP }, - {"fx_20e", SAMPLE_NOLOOP }, - {"fx_20f", SAMPLE_NOLOOP }, - {"fx_20g", SAMPLE_NOLOOP }, - {"fx_20h", SAMPLE_NOLOOP }, - {"fx_21a", SAMPLE_NOLOOP }, - {"fx_21b", SAMPLE_NOLOOP }, - {"fx_21c", SAMPLE_NOLOOP }, - {"fx_21d", SAMPLE_NOLOOP }, - {"fx_21e", SAMPLE_NOLOOP }, - {"fx_21f", SAMPLE_NOLOOP }, - {"fx_21g", SAMPLE_NOLOOP }, - {"fx_21h", SAMPLE_NOLOOP }, - {"fx_22", SAMPLE_NOLOOP }, - {"fx_23", SAMPLE_NOLOOP }, - {"fx_28", SAMPLE_NOLOOP }, - {"fx_36", SAMPLE_NOLOOP }, -#endif - {"knocker", SAMPLE_NOLOOP }, - {"", 0 } -}; - -STD_SAMPLE_PICK(qbert) -STD_SAMPLE_FN(qbert) - -// Q*bert (US set 1) - -static struct BurnRomInfo qbertRomDesc[] = { - { "qb-rom2.bin", 0x2000, 0xfe434526, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "qb-rom1.bin", 0x2000, 0x55635447, 1 | BRF_PRG | BRF_ESS }, // 1 - { "qb-rom0.bin", 0x2000, 0x8e318641, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "qb-snd1.bin", 0x0800, 0x15787c07, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "qb-snd2.bin", 0x0800, 0x58437508, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "qb-bg0.bin", 0x1000, 0x7a9ba824, 3 | BRF_GRA }, // 5 bgtiles - { "qb-bg1.bin", 0x1000, 0x22e5b891, 3 | BRF_GRA }, // 6 - - { "qb-fg3.bin", 0x2000, 0xdd436d3a, 4 | BRF_GRA }, // 7 sprites - { "qb-fg2.bin", 0x2000, 0xf69b9483, 4 | BRF_GRA }, // 8 - { "qb-fg1.bin", 0x2000, 0x224e8356, 4 | BRF_GRA }, // 9 - { "qb-fg0.bin", 0x2000, 0x2f695b85, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(qbert) -STD_ROM_FN(qbert) - -struct BurnDriver BurnDrvQbert = { - "qbert", NULL, NULL, "qbert", "1982", - "Q*bert (US set 1)\0", NULL, "Gottlieb", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, qbertRomInfo, qbertRomName, qbertSampleInfo, qbertSampleName, QbertInputInfo, QbertDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 240, 256, 3, 4 -}; - - -// Q*bert (US set 2) - -static struct BurnRomInfo qbertaRomDesc[] = { - { "qrom_2.bin", 0x2000, 0xb54a8ffc, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "qrom_1.bin", 0x2000, 0x19d924e3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "qrom_0.bin", 0x2000, 0x2e7fad1b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "qb-snd1.bin", 0x0800, 0x15787c07, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "qb-snd2.bin", 0x0800, 0x58437508, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "qb-bg0.bin", 0x1000, 0x7a9ba824, 3 | BRF_GRA }, // 5 bgtiles - { "qb-bg1.bin", 0x1000, 0x22e5b891, 3 | BRF_GRA }, // 6 - - { "qb-fg3.bin", 0x2000, 0xdd436d3a, 4 | BRF_GRA }, // 7 sprites - { "qb-fg2.bin", 0x2000, 0xf69b9483, 4 | BRF_GRA }, // 8 - { "qb-fg1.bin", 0x2000, 0x224e8356, 4 | BRF_GRA }, // 9 - { "qb-fg0.bin", 0x2000, 0x2f695b85, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(qberta) -STD_ROM_FN(qberta) - -struct BurnDriver BurnDrvQberta = { - "qberta", "qbert", NULL, "qbert", "1982", - "Q*bert (US set 2)\0", NULL, "Gottlieb", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, qbertaRomInfo, qbertaRomName, qbertSampleInfo, qbertSampleName, QbertInputInfo, QbertDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 240, 256, 3, 4 -}; - - -// Q*bert (Japan) - -static struct BurnRomInfo qbertjRomDesc[] = { - { "qbj-rom2.bin", 0x2000, 0x67bb1cb2, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "qbj-rom1.bin", 0x2000, 0xc61216e7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "qbj-rom0.bin", 0x2000, 0x69679d5c, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "qb-snd1.bin", 0x0800, 0x15787c07, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "qb-snd2.bin", 0x0800, 0x58437508, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "qb-bg0.bin", 0x1000, 0x7a9ba824, 3 | BRF_GRA }, // 5 bgtiles - { "qb-bg1.bin", 0x1000, 0x22e5b891, 3 | BRF_GRA }, // 6 - - { "qb-fg3.bin", 0x2000, 0xdd436d3a, 4 | BRF_GRA }, // 7 sprites - { "qb-fg2.bin", 0x2000, 0xf69b9483, 4 | BRF_GRA }, // 8 - { "qb-fg1.bin", 0x2000, 0x224e8356, 4 | BRF_GRA }, // 9 - { "qb-fg0.bin", 0x2000, 0x2f695b85, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(qbertj) -STD_ROM_FN(qbertj) - -struct BurnDriver BurnDrvQbertj = { - "qbertj", "qbert", NULL, "qbert", "1982", - "Q*bert (Japan)\0", NULL, "Gottlieb (Konami license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, qbertjRomInfo, qbertjRomName, qbertSampleInfo, qbertSampleName, QbertInputInfo, QbertDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 240, 256, 3, 4 -}; - - -// Mello Yello Q*bert - -static struct BurnRomInfo myqbertRomDesc[] = { - { "mqb-rom2.bin", 0x2000, 0x6860f957, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "mqb-rom1.bin", 0x2000, 0x11f0a4e4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mqb-rom0.bin", 0x2000, 0x12a90cb2, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "mqb-snd1.bin", 0x0800, 0x495ffcd2, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "mqb-snd2.bin", 0x0800, 0x9bbaa945, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "qb-bg0.bin", 0x1000, 0x7a9ba824, 3 | BRF_GRA }, // 5 bgtiles - { "qb-bg1.bin", 0x1000, 0x22e5b891, 3 | BRF_GRA }, // 6 - - { "mqb-fg3.bin", 0x2000, 0x8b5d0852, 4 | BRF_GRA }, // 7 sprites - { "mqb-fg2.bin", 0x2000, 0x823f1e57, 4 | BRF_GRA }, // 8 - { "mqb-fg1.bin", 0x2000, 0x05343ae6, 4 | BRF_GRA }, // 9 - { "mqb-fg0.bin", 0x2000, 0xabc71bdd, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(myqbert) -STD_ROM_FN(myqbert) - -struct BurnDriver BurnDrvMyqbert = { - "myqbert", "qbert", NULL, "qbert", "1982", - "Mello Yello Q*bert\0", NULL, "Gottlieb", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, myqbertRomInfo, myqbertRomName, qbertSampleInfo, qbertSampleName, QbertInputInfo, QbertDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 240, 256, 3, 4 -}; - -static INT32 DrvInitMplanets() -{ - game_type = 4; - - return DrvInit(); -} - - -// Faster, Harder, More Challenging Q*bert (prototype) - -static struct BurnRomInfo sqbertRomDesc[] = { - { "qb-rom2.bin", 0x2000, 0x1e3d4038, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "qb-rom1.bin", 0x2000, 0xeaf3076c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "qb-rom0.bin", 0x2000, 0x61260a7e, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "qb-snd1.bin", 0x0800, 0x15787c07, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "qb-snd2.bin", 0x0800, 0x58437508, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "qb-bg0.bin", 0x1000, 0xc3118eef, 3 | BRF_GRA }, // 5 bgtiles - { "qb-bg1.bin", 0x1000, 0x4f6d8075, 3 | BRF_GRA }, // 6 - - { "qb-fg3.bin", 0x2000, 0xee595eda, 4 | BRF_GRA }, // 7 sprites - { "qb-fg2.bin", 0x2000, 0x59884c78, 4 | BRF_GRA }, // 8 - { "qb-fg1.bin", 0x2000, 0x2a60e3ad, 4 | BRF_GRA }, // 9 - { "qb-fg0.bin", 0x2000, 0xb11ad9d8, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(sqbert) -STD_ROM_FN(sqbert) - -struct BurnDriver BurnDrvSqbert = { - "sqbert", NULL, NULL, "qbert", "1983", - "Faster, Harder, More Challenging Q*bert (prototype)\0", NULL, "Mylstar", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, sqbertRomInfo, sqbertRomName, qbertSampleInfo, qbertSampleName, QbertInputInfo, QbertDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 240, 256, 3, 4 -}; - -// Mad Planets - -static struct BurnRomInfo mplanetsRomDesc[] = { - { "rom4.c16", 0x2000, 0x5402077f, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "rom3.c14-15", 0x2000, 0x5d18d740, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rom2.c13-14", 0x2000, 0x960c3bb1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rom1.c12-13", 0x2000, 0xeb515f10, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rom0.c11-12", 0x2000, 0x74de78aa, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "snd1", 0x0800, 0x453193a1, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - { "snd2", 0x0800, 0xf5ffc98f, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "bg0.e11-12", 0x1000, 0x709aa24c, 3 | BRF_GRA }, // 7 bgtiles - { "bg1.e13", 0x1000, 0x4921e345, 3 | BRF_GRA }, // 8 - - { "fg3.k7-8", 0x2000, 0xc990b39f, 4 | BRF_GRA }, // 9 sprites - { "fg2.k6", 0x2000, 0x735e2522, 4 | BRF_GRA }, // 10 - { "fg1.k5", 0x2000, 0x6456cc1c, 4 | BRF_GRA }, // 11 - { "fg0.k4", 0x2000, 0xa920e325, 4 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(mplanets) -STD_ROM_FN(mplanets) - -struct BurnDriver BurnDrvMplanets = { - "mplanets", NULL, NULL, NULL, "1983", - "Mad Planets\0", NULL, "Gottlieb", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, mplanetsRomInfo, mplanetsRomName, NULL, NULL, MplanetsInputInfo, MplanetsDIPInfo, - DrvInitMplanets, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 240, 256, 3, 4 -}; - - -// Mad Planets (UK) - -static struct BurnRomInfo mplanetsukRomDesc[] = { - { "mpt_rom4.bin", 0x2000, 0xcd88e23c, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "mpt_rom3.bin", 0x2000, 0xdc355b2d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mpt_rom2.bin", 0x2000, 0x846ddc23, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mpt_rom1.bin", 0x2000, 0x94d67b87, 1 | BRF_PRG | BRF_ESS }, // 3 - { "mpt_rom0.bin", 0x2000, 0xa9e30ad2, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "mpt_snd1.bin", 0x0800, 0x453193a1, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - { "mpt_snd2.bin", 0x0800, 0xf5ffc98f, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "mpt_bg0.bin", 0x1000, 0x709aa24c, 3 | BRF_GRA }, // 7 bgtiles - { "mpt_bg1.bin", 0x1000, 0x4921e345, 3 | BRF_GRA }, // 8 - - { "mpt_fg3.bin", 0x2000, 0xc990b39f, 4 | BRF_GRA }, // 9 sprites - { "mpt_fg2.bin", 0x2000, 0x735e2522, 4 | BRF_GRA }, // 10 - { "mpt_fg1.bin", 0x2000, 0x6456cc1c, 4 | BRF_GRA }, // 11 - { "mpt_fg0.bin", 0x2000, 0xa920e325, 4 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(mplanetsuk) -STD_ROM_FN(mplanetsuk) - -struct BurnDriver BurnDrvMplanetsuk = { - "mplanetsuk", "mplanets", NULL, NULL, "1983", - "Mad Planets (UK)\0", NULL, "Gottlieb (Taitel license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, mplanetsukRomInfo, mplanetsukRomName, NULL, NULL, MplanetsInputInfo, MplanetsDIPInfo, - DrvInitMplanets, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 240, 256, 3, 4 -}; - -static INT32 DrvInitCube() -{ - game_type = 6; - - return DrvInit(); -} - -// Q*bert's Qubes - -static struct BurnRomInfo qbertqubRomDesc[] = { - { "qq-rom3.bin", 0x2000, 0xc4dbdcd7, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "qq-rom2.bin", 0x2000, 0x21a6c6cc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "qq-rom1.bin", 0x2000, 0x63e6c43d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "qq-rom0.bin", 0x2000, 0x8ddbe438, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "qq-snd1.bin", 0x0800, 0xe704b450, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - { "qq-snd2.bin", 0x0800, 0xc6a98bf8, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "qq-bg0.bin", 0x1000, 0x050badde, 3 | BRF_GRA }, // 6 bgtiles - { "qq-bg1.bin", 0x1000, 0x8875902f, 3 | BRF_GRA }, // 7 - - { "qq-fg3.bin", 0x4000, 0x91a949cc, 4 | BRF_GRA }, // 8 sprites - { "qq-fg2.bin", 0x4000, 0x782d9431, 4 | BRF_GRA }, // 9 - { "qq-fg1.bin", 0x4000, 0x71c3ac4c, 4 | BRF_GRA }, // 10 - { "qq-fg0.bin", 0x4000, 0x6192853f, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(qbertqub) -STD_ROM_FN(qbertqub) - -struct BurnDriver BurnDrvQbertqub = { - "qbertqub", NULL, NULL, "qbert", "1983", - "Q*bert's Qubes\0", NULL, "Mylstar", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, qbertqubRomInfo, qbertqubRomName, qbertSampleInfo, qbertSampleName, QbertqubInputInfo, QbertqubDIPInfo, - DrvInitCube, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 240, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_quizo.cpp b/jan/src/burn/drv/pre90s/d_quizo.cpp deleted file mode 100644 index 72f8d62fd..000000000 --- a/jan/src/burn/drv/pre90s/d_quizo.cpp +++ /dev/null @@ -1,402 +0,0 @@ -// FB Alpha Quiz Olympic driver module -// Based on MAME driver by Tomasz Slanina - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 port60; -static UINT8 port70; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo QuizoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Quizo) - -static struct BurnDIPInfo QuizoDIPList[]= -{ - {0x07, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 2, "Test Mode" }, - {0x07, 0x01, 0x08, 0x00, "Off" }, - {0x07, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x07, 0x01, 0x40, 0x00, "2 Coins 1 Credits" }, - {0x07, 0x01, 0x40, 0x40, "1 Coin 1 Credits" }, -}; - -STDDIPINFO(Quizo) - -static void set_rom_bank(UINT8 data) -{ - INT32 lut[10] = { 2, 3, 4, 4, 4, 4, 4, 5, 0, 1}; - if (data > 9) data = 0; - port60 = data; - - ZetMapMemory(DrvZ80ROM + 0x4000 + lut[data] * 0x4000, 0x8000, 0xbfff, MAP_ROM); -} - -static void set_ram_bank(UINT8 data) -{ - port70 = data; - ZetMapMemory(DrvVidRAM + ((data & 8) ? 0x4000 : 0), 0xc000, 0xffff, MAP_RAM); -} - -static void __fastcall quizo_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x50: - AY8910Write(0, 0, data); - break; - - case 0x51: - AY8910Write(0, 1, data); - break; - - case 0x60: - set_rom_bank(data); - break; - - case 0x70: - set_ram_bank(data); - break; - } -} - -static UINT8 __fastcall quizo_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return DrvInputs[0]; - - case 0x10: - return DrvInputs[1]; - - case 0x40: - return DrvDips[0]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - set_rom_bank(0); - set_ram_bank(0); - ZetClose(); - - AY8910Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x01c000; - - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0010 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x008000; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (select == 0) - { - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - memcpy (DrvZ80ROM + 0x0000, DrvZ80ROM + 0x4000, 0x4000); - - if (BurnLoadRom(DrvZ80ROM + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x0c000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x14000, 3, 1)) return 1; - - if (BurnLoadRom(DrvColPROM , 4, 1)) return 1; - } - else if (select == 1) - { - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x08000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x0c000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x10000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x14000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x18000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM , 7, 1)) return 1; - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x4000, 0x47ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xc000, 0xffff, MAP_RAM); - ZetSetOutHandler(quizo_write_port); - ZetSetInHandler(quizo_read_port); - ZetClose(); - - AY8910Init(0, 1342329, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x10; i++) - { - INT32 bit0 = 0; - INT32 bit1 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 1) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 2) & 0x01; - bit1 = (DrvColPROM[i] >> 3) & 0x01; - bit2 = (DrvColPROM[i] >> 4) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 5) & 0x01; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_layer() -{ - for (INT32 y = 0; y < 200; y++) - { - UINT16 *dst = pTransDraw + y * 320; - - for (INT32 x = 0; x < 320; x+=4) - { - INT32 a = DrvVidRAM[y * 80 + x/4]; - INT32 b = DrvVidRAM[y * 80 + 0x4000 + x/4]; - - dst[x+3] = ((a & 1) >> 0) | ((a >> 3) & 2) | ((b & 1) << 2) | ((b >> 1) & 8); - dst[x+2] = ((a & 2) >> 1) | ((a >> 4) & 2) | ((b & 2) << 1) | ((b >> 2) & 8); - dst[x+1] = ((a & 4) >> 2) | ((a >> 5) & 2) | ((b & 4) << 0) | ((b >> 3) & 8); - dst[x+0] = ((a & 8) >> 3) | ((a >> 6) & 2) | ((b & 8) >> 1) | ((b >> 4) & 8); - } - } -} - -static INT32 DrvDraw() -{ - //if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - //} - - draw_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0x18; - DrvInputs[1] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - ZetOpen(0); - ZetRun(4000000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(port60); - SCAN_VAR(port70); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - set_rom_bank(port60); - set_ram_bank(port70); - ZetClose(); - } - - return 0; -} - - -// Quiz Olympic (set 1) - -static struct BurnRomInfo quizoRomDesc[] = { - { "rom1", 0x8000, 0x6731735f, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 code - { "rom2", 0x8000, 0xa700eb30, 1 | BRF_ESS | BRF_PRG }, // 1 - { "rom3", 0x8000, 0xd344f97e, 1 | BRF_ESS | BRF_PRG }, // 2 - { "rom4", 0x8000, 0xab1eb174, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "82s123", 0x0020, 0xc3f15914, 2 | BRF_GRA }, // 4 Color Prom -}; - -STD_ROM_PICK(quizo) -STD_ROM_FN(quizo) - -static INT32 QuizoInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvQuizo = { - "quizo", NULL, NULL, NULL, "1985", - "Quiz Olympic (set 1)\0", NULL, "Seoul Coin Corp.", "Miscellaneous", - L"\uD034\uC988\uC62C\uB9BC\uD53D (set 1)\0Quiz Olympic (set 1)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, quizoRomInfo, quizoRomName, NULL, NULL, QuizoInputInfo, QuizoDIPInfo, - QuizoInit, DrvExit, DrvFrame, NULL, DrvScan, NULL, 0x10, - 320, 200, 4, 3 -}; - - -// Quiz Olympic (set 2) - -static struct BurnRomInfo quizoaRomDesc[] = { - { "7.bin", 0x4000, 0x1579ae31, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 code - { "6.bin", 0x4000, 0xf00f6356, 1 | BRF_GRA }, // 1 - { "5.bin", 0x4000, 0x39e577e3, 1 | BRF_GRA }, // 2 - { "4.bin", 0x4000, 0xa977bd3a, 1 | BRF_GRA }, // 3 - { "3.bin", 0x4000, 0x4411bcff, 1 | BRF_GRA }, // 4 - { "2.bin", 0x4000, 0x4a0df776, 1 | BRF_GRA }, // 5 - { "1.bin", 0x4000, 0xd9566c1a, 1 | BRF_GRA }, // 6 - - { "82s123", 0x0020, 0xc3f15914, 2 | BRF_GRA }, // 7 Color Prom -}; - -STD_ROM_PICK(quizoa) -STD_ROM_FN(quizoa) - -static INT32 QuizoaInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvQuizoa = { - "quizoa", "quizo", NULL, NULL, "1985", - "Quiz Olympic (set 2)\0", NULL, "Seoul Coin Corp.", "Miscellaneous", - L"\uD034\uC988\uC62C\uB9BC\uD53D (set 2)\0Quiz Olympic (set 2)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, quizoaRomInfo, quizoaRomName, NULL, NULL, QuizoInputInfo, QuizoDIPInfo, - QuizoaInit, DrvExit, DrvFrame, NULL, DrvScan, NULL, 0x10, - 320, 200, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_rallyx.cpp b/jan/src/burn/drv/pre90s/d_rallyx.cpp deleted file mode 100644 index d04d9a4a9..000000000 --- a/jan/src/burn/drv/pre90s/d_rallyx.cpp +++ /dev/null @@ -1,2620 +0,0 @@ -// FinalBurn Alpha driver module for Rally-X, based on the MAME driver by Nicola Salmoria. -// Emulates Rally-X variants, Jungler, Tactician, Loco-Motion & Commando (Sega) -// Oddities: Jungler has flipped-mode on by default, but it only affects sprites -// and bullets. - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "namco_snd.h" -#include "timeplt_snd.h" -#include "samples.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0, 0, 0}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80Rom1 = NULL; -static UINT8 *DrvZ80Rom2 = NULL; -static UINT8 *DrvZ80Ram1 = NULL; -static UINT8 *DrvZ80Ram1_weird = NULL; -static UINT8 *DrvZ80Ram2 = NULL; -static UINT8 *DrvVideoRam = NULL; -static UINT8 *DrvRadarAttrRam = NULL; -static UINT8 *DrvPromPalette = NULL; -static UINT8 *DrvPromLookup = NULL; -static UINT8 *DrvPromVidLayout = NULL; -static UINT8 *DrvPromVidTiming = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvDots = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvCPUFireIRQ; -static UINT8 last_sound_irq; -static UINT8 DrvCPUIRQVector; -static UINT8 xScroll; -static UINT8 yScroll; -static UINT8 DrvLastBang; -static INT32 rallyx = 0; -static INT32 junglermode = 0; // jungler, locomtn, tactician, commsega use this -static INT32 junglerinputs = 0; // jungler has different dips than the others. -static INT32 junglerflip = 0; -static INT32 locomotnmode = 0; // locomotn, tactician, etc use this. -static INT32 commsegamode = 0; - -struct jungler_star { - int x, y, color; -}; - -static INT32 stars_enable; -static INT32 total_stars; -static struct jungler_star j_stars[1000]; - -static struct BurnInputInfo DrvInputList[] = -{ - { "Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - { "Start 1" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 start" }, - { "Coin 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 coin" }, - { "Start 2" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 start" }, - - { "Up" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 up" }, - { "Down" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 down" }, - { "Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - { "Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - { "Fire 1" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 fire 1" }, - - { "Up (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 up" }, - { "Down (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 down" }, - { "Left (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - { "Right (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - { "Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 fire 1" }, - - { "Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - { "Service" , BIT_DIGITAL , DrvInputPort0 + 0, "service" }, - { "Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - { "Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo JunglerInputList[] = -{ - { "Coin 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 coin" }, - { "Start 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 start" }, - { "Coin 2" , BIT_DIGITAL , DrvInputPort0 + 6, "p2 coin" }, - { "Start 2" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 start" }, - - { "Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 up" }, - { "Down" , BIT_DIGITAL , DrvInputPort2 + 7, "p1 down" }, - { "Left" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 left" }, - { "Right" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 right" }, - { "Fire 1" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 fire 1" }, - - { "Up (Cocktail)" , BIT_DIGITAL , DrvInputPort0 + 0, "p2 up" }, - { "Down (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - { "Left (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 left" }, - { "Right (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 right" }, - { "Fire 1 (Cocktail)" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 fire 1" }, - - { "Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - { "Service" , BIT_DIGITAL , DrvInputPort0 + 2, "service" }, - { "Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, -}; - -STDINPUTINFO(Jungler) - -static struct BurnInputInfo LocomotnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort0 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvInputPort1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvInputPort1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvInputPort2 + 7, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvInputPort0 + 4, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvInputPort0 + 5, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvInputPort0 + 3, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvInputPort0 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvInputPort1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvInputPort0 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvInputPort1 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvInputPort1 + 5, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvInputPort1 + 4, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvInputPort1 + 3, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvInputPort0 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Locomotn) - - -static struct BurnDIPInfo LocomotnDIPList[]= -{ - {0x10, 0xff, 0xff, 0x36, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x20, "4" }, - {0x10, 0x01, 0x30, 0x10, "5" }, - {0x10, 0x01, 0x30, 0x00, "255" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x08, 0x00, "Upright" }, - {0x10, 0x01, 0x08, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x10, 0x01, 0x04, 0x04, "Off" }, - {0x10, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Intermissions" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x01, 0x01, "Off" }, - {0x10, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x11, 0x01, 0x0f, 0x04, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x0a, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x01, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x02, "3 Coins 2 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "4 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0f, 0x0c, "3 Coins 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x11, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x11, 0x01, 0xf0, 0x40, "4 Coins 1 Credits" }, - {0x11, 0x01, 0xf0, 0xa0, "3 Coins 1 Credits" }, - {0x11, 0x01, 0xf0, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xf0, 0x20, "3 Coins 2 Credits" }, - {0x11, 0x01, 0xf0, 0x80, "4 Coins 3 Credits" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xf0, 0xc0, "3 Coins 4 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x11, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, - {0x11, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x11, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x11, 0x01, 0xf0, 0x00, "No Coin B" }, -}; - -STDDIPINFO(Locomotn) - -static struct BurnInputInfo TactcianInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort0 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvInputPort1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvInputPort1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvInputPort2 + 7, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvInputPort0 + 4, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvInputPort0 + 5, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvInputPort0 + 3, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvInputPort0 + 1, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvInputPort0 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvInputPort1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvInputPort0 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvInputPort1 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvInputPort1 + 5, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvInputPort1 + 4, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvInputPort1 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvInputPort1 + 2, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvInputPort0 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Tactcian) - - -static struct BurnDIPInfo TactcianDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x00, "3" }, - {0x12, 0x01, 0x30, 0x10, "4" }, - {0x12, 0x01, 0x30, 0x20, "5" }, - {0x12, 0x01, 0x30, 0x30, "255" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x08, 0x00, "Upright" }, - {0x12, 0x01, 0x08, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x12, 0x01, 0x06, 0x06, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x06, 0x02, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x06, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x06, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x12, 0x01, 0x06, 0x02, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x06, 0x04, "A 2C/1C B 1C/3C" }, - {0x12, 0x01, 0x06, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x06, 0x06, "A 1C/1C B 1C/6C" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x01, 0x00, "10k, 80k then every 100k" }, - {0x12, 0x01, 0x01, 0x01, "20k, 80k then every 100k" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x01, 0x00, "Mode 1" }, - {0x13, 0x01, 0x01, 0x01, "Mode 2" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Tactcian) - -static struct BurnInputInfo CommsegaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort0 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvInputPort1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvInputPort1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvInputPort2 + 7, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvInputPort0 + 4, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvInputPort0 + 5, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvInputPort2 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvInputPort0 + 3, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvInputPort0 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvInputPort1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvInputPort0 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvInputPort1 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvInputPort1 + 5, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvInputPort1 + 4, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvInputPort1 + 2, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvInputPort1 + 3, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Commsega) - - -static struct BurnDIPInfo CommsegaDIPList[]= -{ - {0x11, 0xff, 0xff, 0x3f, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x14, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x1c, 0x04, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x1c, 0x08, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x12, 0x01, 0x40, 0x40, "Easy" }, - {0x12, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Commsega) - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = 0xff; - DrvInput[1] = 0xfe; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] ^= (DrvInputPort0[i] & 1) << i; - DrvInput[1] ^= (DrvInputPort1[i] & 1) << i; - } -} - -static inline void JunglerMakeInputs() -{ - // Reset Inputs - DrvInput[0] = 0xff; - DrvInput[1] = 0xff; - DrvInput[2] = 0xff; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] ^= (DrvInputPort0[i] & 1) << i; - DrvInput[1] ^= (DrvInputPort1[i] & 1) << i; - DrvInput[2] ^= (DrvInputPort2[i] & 1) << i; - } -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x01, NULL }, - {0x11, 0xff, 0xff, 0xcb, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x01, 0x00, "Cocktail" }, - {0x10, 0x01, 0x01, 0x01, "Upright" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, // This is conditional on difficulty - {0x11, 0x01, 0x06, 0x02, "15000" }, - {0x11, 0x01, 0x06, 0x04, "30000" }, - {0x11, 0x01, 0x06, 0x06, "40000" }, - {0x11, 0x01, 0x06, 0x00, "None" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x11, 0x01, 0x38, 0x10, "1 Car, Medium" }, - {0x11, 0x01, 0x38, 0x28, "1 Car, Hard" }, - {0x11, 0x01, 0x38, 0x00, "2 Cars, Easy" }, - {0x11, 0x01, 0x38, 0x18, "2 Cars, Medium" }, - {0x11, 0x01, 0x38, 0x30, "2 Cars, Hard" }, - {0x11, 0x01, 0x38, 0x08, "3 Cars, Easy" }, - {0x11, 0x01, 0x38, 0x20, "3 Cars, Medium" }, - {0x11, 0x01, 0x38, 0x38, "3 Cars, Hard" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Play" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x11, 0x01, 0xc0, 0x00, "Freeplay" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo DngrtrckDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x01, NULL }, - {0x11, 0xff, 0xff, 0xcb, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x01, 0x00, "Cocktail" }, - {0x10, 0x01, 0x01, 0x01, "Upright" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, // This is conditional on difficulty - {0x11, 0x01, 0x06, 0x02, "15000" }, - {0x11, 0x01, 0x06, 0x04, "30000" }, - {0x11, 0x01, 0x06, 0x06, "40000" }, - {0x11, 0x01, 0x06, 0x00, "None" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x11, 0x01, 0x38, 0x10, "1 Car, Medium" }, - {0x11, 0x01, 0x38, 0x28, "1 Car, Hard" }, - {0x11, 0x01, 0x38, 0x00, "2 Cars, Easy" }, - {0x11, 0x01, 0x38, 0x18, "2 Cars, Medium" }, - {0x11, 0x01, 0x38, 0x30, "2 Cars, Hard" }, - {0x11, 0x01, 0x38, 0x08, "3 Cars, Easy" }, - {0x11, 0x01, 0x38, 0x20, "3 Cars, Medium" }, - {0x11, 0x01, 0x38, 0x38, "3 Cars, Hard" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x11, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x11, 0x01, 0xc0, 0x40, "1st Coin/1 Coin 2nd Coin/2 Plays" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - {0x11, 0x01, 0xc0, 0xc0, "1st Coin/2 Coins 2nd Coin/3 plays" }, -}; - -STDDIPINFO(Dngrtrck) - -static struct BurnDIPInfo JunglerDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0xbf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x10, 0x01, 0x07, 0x01, "4 Coins 1 Play" }, - {0x10, 0x01, 0x07, 0x02, "3 Coins 1 Play" }, - {0x10, 0x01, 0x07, 0x03, "2 Coins 1 Play" }, - {0x10, 0x01, 0x07, 0x00, "4 Coins 3 Plays" }, - {0x10, 0x01, 0x07, 0x07, "1 Coin 1 Play" }, - {0x10, 0x01, 0x07, 0x06, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x07, 0x05, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x07, 0x04, "1 Coin 4 Plays" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x10, 0x01, 0x38, 0x08, "4 Coins 1 Play" }, - {0x10, 0x01, 0x38, 0x10, "3 Coins 1 Play" }, - {0x10, 0x01, 0x38, 0x18, "2 Coins 1 Play" }, - {0x10, 0x01, 0x38, 0x00, "4 Coins 3 Plays" }, - {0x10, 0x01, 0x38, 0x38, "1 Coin 1 Play" }, - {0x10, 0x01, 0x38, 0x30, "1 Coin 2 Plays" }, - {0x10, 0x01, 0x38, 0x28, "1 Coin 3 Plays" }, - {0x10, 0x01, 0x38, 0x20, "1 Coin 4 Plays" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x40, 0x40, "Cocktail" }, - {0x10, 0x01, 0x40, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Test Mode (255 lives)" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Jungler) - -static struct BurnRomInfo RallyxRomDesc[] = { - { "1b", 0x01000, 0x5882700d, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "rallyxn.1e", 0x01000, 0xed1eba2b, BRF_ESS | BRF_PRG }, // 1 - { "rallyxn.1h", 0x01000, 0x4f98dd1c, BRF_ESS | BRF_PRG }, // 2 - { "rallyxn.1k", 0x01000, 0x9aacccf0, BRF_ESS | BRF_PRG }, // 3 - - { "8e", 0x01000, 0x277c1de5, BRF_GRA }, // 4 Characters & Sprites - - { "rx1-6.8m", 0x00100, 0x3c16f62c, BRF_GRA }, // 5 Dots - - { "rx1-1.11n", 0x00020, 0xc7865434, BRF_GRA }, // 6 Palette PROM - { "rx1-7.8p", 0x00100, 0x834d4fda, BRF_GRA }, // 7 Lookup PROM - { "rx1-2.4n", 0x00020, 0x8f574815, BRF_GRA }, // 8 Video Layout PROM - { "rx1-3.7k", 0x00020, 0xb8861096, BRF_GRA }, // 9 Video Timing PROM - - { "rx1-5.3p", 0x00100, 0x4bad7017, BRF_SND }, // 10 Sound PROMs - { "rx1-4.2m", 0x00100, 0x77245b66, BRF_SND }, // 11 -}; - -STD_ROM_PICK(Rallyx) -STD_ROM_FN(Rallyx) - -static struct BurnRomInfo RallyxaRomDesc[] = { - { "rx1_prg_1.1b", 0x00800, 0xef9238db, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "rx1_prg_2.1c", 0x00800, 0x7cbeb656, BRF_ESS | BRF_PRG }, // 1 - { "rx1_prg_3.1d", 0x00800, 0x334b1042, BRF_ESS | BRF_PRG }, // 2 - { "rx1_prg_4.1e", 0x00800, 0xd6618add, BRF_ESS | BRF_PRG }, // 3 - { "rx1_prg_5.bin", 0x00800, 0x3d69f24e, BRF_ESS | BRF_PRG }, // 4 - { "rx1_prg_6.bin", 0x00800, 0xe9740f16, BRF_ESS | BRF_PRG }, // 5 - { "rx1_prg_7.1k", 0x00800, 0x843109f2, BRF_ESS | BRF_PRG }, // 6 - { "rx1_prg_8.1l", 0x00800, 0x9b846ec9, BRF_ESS | BRF_PRG }, // 7 - - { "rx1_chg_1.8e", 0x00800, 0x1fff38a4, BRF_GRA }, // 8 Characters & Sprites - { "rx1_chg_2.8d", 0x00800, 0x68dff552, BRF_GRA }, // 9 - - { "rx1-6.8m", 0x00100, 0x3c16f62c, BRF_GRA }, // 10 Dots - - { "rx1-1.11n", 0x00020, 0xc7865434, BRF_GRA }, // 11 Palette PROM - { "rx1-7.8p", 0x00100, 0x834d4fda, BRF_GRA }, // 12 Lookup PROM - { "rx1-2.4n", 0x00020, 0x8f574815, BRF_GRA }, // 13 Video Layout PROM - { "rx1-3.7k", 0x00020, 0xb8861096, BRF_GRA }, // 14 Video Timing PROM - - { "rx1-5.3p", 0x00100, 0x4bad7017, BRF_SND }, // 15 Sound PROMs - { "rx1-4.2m", 0x00100, 0x77245b66, BRF_SND }, // 16 -}; - -STD_ROM_PICK(Rallyxa) -STD_ROM_FN(Rallyxa) - -static struct BurnRomInfo RallyxmRomDesc[] = { - { "1b", 0x01000, 0x5882700d, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "1e", 0x01000, 0x786585ec, BRF_ESS | BRF_PRG }, // 1 - { "1h", 0x01000, 0x110d7dcd, BRF_ESS | BRF_PRG }, // 2 - { "1k", 0x01000, 0x473ab447, BRF_ESS | BRF_PRG }, // 3 - - { "8e", 0x01000, 0x277c1de5, BRF_GRA }, // 4 Characters & Sprites - - { "rx1-6.8m", 0x00100, 0x3c16f62c, BRF_GRA }, // 5 Dots - - { "rx1-1.11n", 0x00020, 0xc7865434, BRF_GRA }, // 6 Palette PROM - { "rx1-7.8p", 0x00100, 0x834d4fda, BRF_GRA }, // 7 Lookup PROM - { "rx1-2.4n", 0x00020, 0x8f574815, BRF_GRA }, // 8 Video Layout PROM - { "rx1-3.7k", 0x00020, 0xb8861096, BRF_GRA }, // 9 Video Timing PROM - - { "rx1-5.3p", 0x00100, 0x4bad7017, BRF_SND }, // 10 Sound PROMs - { "rx1-4.2m", 0x00100, 0x77245b66, BRF_SND }, // 11 -}; - -STD_ROM_PICK(Rallyxm) -STD_ROM_FN(Rallyxm) - -static struct BurnRomInfo RallyxmrRomDesc[] = { - { "166.bin", 0x00800, 0xef9238db, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "167.bin", 0x00800, 0x7cbeb656, BRF_ESS | BRF_PRG }, // 1 - { "168.bin", 0x00800, 0x334b1042, BRF_ESS | BRF_PRG }, // 2 - { "169.bin", 0x00800, 0xb4852b52, BRF_ESS | BRF_PRG }, // 3 - { "170.bin", 0x00800, 0x3d69f24e, BRF_ESS | BRF_PRG }, // 4 - { "171.bin", 0x00800, 0xe9740f16, BRF_ESS | BRF_PRG }, // 5 - { "172.bin", 0x00800, 0x843109f2, BRF_ESS | BRF_PRG }, // 6 - { "173.bin", 0x00800, 0x3b5b1a81, BRF_ESS | BRF_PRG }, // 7 - - { "175.bin", 0x00800, 0x50a224e2, BRF_GRA }, // 8 Characters & Sprites - { "174.bin", 0x00800, 0x68dff552, BRF_GRA }, // 9 - - { "rx1-6.8m", 0x00100, 0x3c16f62c, BRF_GRA }, // 10 Dots - - { "rx1-1.11n", 0x00020, 0xc7865434, BRF_GRA }, // 11 Palette PROM - { "rx1-7.8p", 0x00100, 0x834d4fda, BRF_GRA }, // 12 Lookup PROM - { "rx1-2.4n", 0x00020, 0x8f574815, BRF_GRA }, // 13 Video Layout PROM - { "rx1-3.7k", 0x00020, 0xb8861096, BRF_GRA }, // 14 Video Timing PROM - - { "rx1-5.3p", 0x00100, 0x4bad7017, BRF_SND }, // 15 Sound PROMs - { "rx1-4.2m", 0x00100, 0x77245b66, BRF_SND }, // 16 -}; - -STD_ROM_PICK(Rallyxmr) -STD_ROM_FN(Rallyxmr) - -static struct BurnRomInfo DngrtrckRomDesc[] = { - { "1B-2716.BIN", 0x00800, 0xb6180a12, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "1C-2716.BIN", 0x00800, 0x7cbeb656, BRF_ESS | BRF_PRG }, // 1 - { "1D-2716.BIN", 0x00800, 0x594207b1, BRF_ESS | BRF_PRG }, // 2 - { "1E-2716.BIN", 0x00800, 0xae447251, BRF_ESS | BRF_PRG }, // 3 - { "1H-2716.BIN", 0x00800, 0xe0d4b534, BRF_ESS | BRF_PRG }, // 4 - { "1J-2716.BIN", 0x00800, 0xe9740f16, BRF_ESS | BRF_PRG }, // 5 - { "1K-2716.BIN", 0x00800, 0x843109f2, BRF_ESS | BRF_PRG }, // 6 - { "1L-2716.BIN", 0x00800, 0x17759749, BRF_ESS | BRF_PRG }, // 7 - - { "8E-2716.BIN", 0x00800, 0x50a224e2, BRF_GRA }, // 8 Characters & Sprites - { "8D-2716.BIN", 0x00800, 0x68dff552, BRF_GRA }, // 9 - - { "rx1-6.8m", 0x00100, 0x3c16f62c, BRF_GRA }, // 10 Dots - - { "rx1-1.11n", 0x00020, 0xc7865434, BRF_GRA }, // 11 Palette PROM - { "rx1-7.8p", 0x00100, 0x834d4fda, BRF_GRA }, // 12 Lookup PROM - { "rx1-2.4n", 0x00020, 0x8f574815, BRF_GRA }, // 13 Video Layout PROM - { "rx1-3.7k", 0x00020, 0xb8861096, BRF_GRA }, // 14 Video Timing PROM - - { "rx1-5.3p", 0x00100, 0x4bad7017, BRF_SND }, // 15 Sound PROMs - { "rx1-4.2m", 0x00100, 0x77245b66, BRF_SND }, // 16 -}; - -STD_ROM_PICK(Dngrtrck) -STD_ROM_FN(Dngrtrck) - -static struct BurnRomInfo NrallyxRomDesc[] = { - { "nrx_prg1.1d", 0x01000, 0xba7de9fc, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - { "nrx_prg2.1e", 0x01000, 0xeedfccae, BRF_ESS | BRF_PRG }, // 1 - { "nrx_prg3.1k", 0x01000, 0xb4d5d34a, BRF_ESS | BRF_PRG }, // 2 - { "nrx_prg4.1l", 0x01000, 0x7da5496d, BRF_ESS | BRF_PRG }, // 3 - - { "nrx_chg1.8e", 0x00800, 0x1fff38a4, BRF_GRA }, // 4 Characters & Sprites - { "nrx_chg2.8d", 0x00800, 0x85d9fffd, BRF_GRA }, // 5 - - { "rx1-6.8m", 0x00100, 0x3c16f62c, BRF_GRA }, // 6 Dots - - { "nrx1-1.11n", 0x00020, 0xa0a49017, BRF_GRA }, // 7 Palette PROM - { "nrx1-7.8p", 0x00100, 0x4e46f485, BRF_GRA }, // 8 Lookup PROM - { "rx1-2.4n", 0x00020, 0x8f574815, BRF_GRA }, // 9 Video Layout PROM - { "rx1-3.7k", 0x00020, 0xb8861096, BRF_GRA }, // 10 Video Timing PROM - - { "rx1-5.3p", 0x00100, 0x4bad7017, BRF_SND }, // 11 Sound PROMs - { "rx1-4.2m", 0x00100, 0x77245b66, BRF_SND }, // 12 -}; - -STD_ROM_PICK(Nrallyx) -STD_ROM_FN(Nrallyx) - -static struct BurnRomInfo JunglerRomDesc[] = { - { "jungr1", 0x01000, 0x5bd6ad15, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code #1 - { "jungr2", 0x01000, 0xdc99f1e3, BRF_ESS | BRF_PRG }, // 1 - { "jungr3", 0x01000, 0x3dcc03da, BRF_ESS | BRF_PRG }, // 2 - { "jungr4", 0x01000, 0xf92e9940, BRF_ESS | BRF_PRG }, // 3 - - { "1b", 0x01000, 0xf86999c3, BRF_ESS | BRF_PRG }, // 4 Z80 Program Code #2 - - { "5k", 0x00800, 0x924262bf, BRF_GRA }, // 5 Characters & Sprites - { "5m", 0x00800, 0x131a08ac, BRF_GRA }, // 6 - - { "82s129.10g", 0x00100, 0xc59c51b7, BRF_GRA }, // 7 Dots - - { "18s030.8b", 0x00020, 0x55a7e6d1, BRF_GRA }, // 8 Palette PROM - { "tbp24s10.9d", 0x00100, 0xd223f7b8, BRF_GRA }, // 9 Lookup PROM - { "18s030.7a", 0x00020, 0x8f574815, BRF_GRA }, // 10 Video Layout PROM - { "6331-1.10a", 0x00020, 0xb8861096, BRF_GRA }, // 11 Video Timing PROM -}; - -STD_ROM_PICK(Jungler) -STD_ROM_FN(Jungler) - -static struct BurnSampleInfo RallyxSampleDesc[] = { - { "bang", SAMPLE_NOLOOP }, - { "", 0 } -}; - -STD_SAMPLE_PICK(Rallyx) -STD_SAMPLE_FN(Rallyx) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom1 = Next; Next += 0x04000; - DrvPromPalette = Next; Next += 0x00020; - DrvPromLookup = Next; Next += 0x00100; - DrvPromVidLayout = Next; Next += 0x00020; - DrvPromVidTiming = Next; Next += 0x00020; - NamcoSoundProm = Next; Next += 0x00100; - - RamStart = Next; - - DrvZ80Ram1 = Next; Next += 0x00800; - DrvVideoRam = Next; Next += 0x01000; - DrvRadarAttrRam = Next; Next += 0x00010; - - RamEnd = Next; - - DrvChars = Next; Next += 0x100 * 8 * 8; - DrvSprites = Next; Next += 0x040 * 16 * 16; - DrvDots = Next; Next += 0x008 * 4 * 4; - DrvPalette = (UINT32*)Next; Next += 260 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 JunglerMemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom1 = Next; Next += 0x08000; - DrvZ80Rom2 = Next; Next += 0x02000; - DrvPromPalette = Next; Next += 0x00020; - DrvPromLookup = Next; Next += 0x00100; - DrvPromVidLayout = Next; Next += 0x00020; - DrvPromVidTiming = Next; Next += 0x00020; - - RamStart = Next; - - DrvZ80Ram1 = Next; Next += 0x00800; - DrvZ80Ram1_weird = Next; Next += 0x00800; - DrvZ80Ram2 = Next; Next += 0x00400; - DrvVideoRam = Next; Next += 0x01000; - DrvRadarAttrRam = Next; Next += 0x00010; - - RamEnd = Next; - - DrvChars = Next; Next += 0x400 * 8 * 8; - DrvSprites = Next; Next += 0x180 * 16 * 16; - DrvDots = Next; Next += 0x018 * 4 * 4; - DrvPalette = (UINT32*)Next; Next += 324 * sizeof(UINT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (RamStart, 0, RamEnd - RamStart); - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnSampleReset(); - - NamcoSoundReset(); - - DrvCPUFireIRQ = 0; - DrvCPUIRQVector = 0; - xScroll = 0; - yScroll = 0; - DrvLastBang = 0; - - HiscoreReset(); - - return 0; -} - -void calculate_star_field(); // forward.. - -static INT32 JunglerDoReset() -{ - memset (RamStart, 0, RamEnd - RamStart); - ZetOpen(0); - ZetReset(); - ZetClose(); - - DrvCPUFireIRQ = 0; - last_sound_irq = 0; - DrvCPUIRQVector = 0; - xScroll = 0; - yScroll = 0; - junglerflip = 0; - stars_enable = 0; - - calculate_star_field(); - - HiscoreReset(); - TimepltSndReset(); - - return 0; -} - -UINT8 __fastcall RallyxZ80ProgRead(UINT16 a) -{ - switch (a) { - case 0xa000: { - return DrvInput[0]; - } - - case 0xa080: { - return DrvInput[1] | DrvDip[0]; - } - - case 0xa100: { - return DrvDip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read %04x\n"), a); - } - } - - return 0; -} - -void __fastcall RallyxZ80ProgWrite(UINT16 a, UINT8 d) -{ - if (a >= 0xa100 && a <= 0xa11f) { - NamcoSoundWrite(a - 0xa100, d); - return; - } - - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: - case 0xa008: - case 0xa009: - case 0xa00a: - case 0xa00b: - case 0xa00c: - case 0xa00d: - case 0xa00e: - case 0xa00f: { - DrvRadarAttrRam[a & 0xf] = d; - return; - } - - case 0xa080: { - // watchdog write - return; - } - - case 0xa130: { - xScroll = d; - return; - } - - case 0xa140: { - yScroll = d; - return; - } - - case 0xa170: { - // NOP - return; - } - - case 0xa180: { - UINT8 Bit = d & 0x01; - if (Bit == 0 && DrvLastBang != 0) { - BurnSamplePlay(0); - } - DrvLastBang = Bit; - return; - } - - case 0xa181: { - DrvCPUFireIRQ = d & 0x01; - if (!DrvCPUFireIRQ) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } - - case 0xa182: { - // sound on - return; - } - - case 0xa183: { - //bprintf(0, _T("Flipmode %X\n"), d); - return; - } - - case 0xa184: { - // lamp - return; - } - - case 0xa185: { - // lamp - return; - } - - case 0xa186: { - // coin lockout - return; - } - - case 0xa187: { - // coin counter - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write %04x, %02x\n"), a, d); - } - } -} - -UINT8 __fastcall RallyxZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall RallyxZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - DrvCPUIRQVector = d; - ZetSetVector(d); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall JunglerZ80ProgRead1(UINT16 a) -{ - switch (a) { - case 0xa000: { - return DrvInput[0]; - } - - case 0xa080: { - return DrvInput[1]; - } - - case 0xa100: { - if (junglerinputs) - return DrvInput[2]; - - return (DrvInput[2] & 0xc0) | DrvDip[0]; - } - - case 0xa180: { - if (junglerinputs) - return DrvDip[0]; - - return DrvDip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read %04x\n"), a); - } - } - - return 0; -} - -void __fastcall JunglerZ80ProgWrite1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xa100: { - TimepltSndSoundlatch(d); - return; - } - case 0xa030: - case 0xa031: - case 0xa032: - case 0xa033: - case 0xa034: - case 0xa035: - case 0xa036: - case 0xa037: - case 0xa038: - case 0xa039: - case 0xa03a: - case 0xa03b: - case 0xa03c: - case 0xa03d: - case 0xa03e: - case 0xa03f: - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - case 0xa004: - case 0xa005: - case 0xa006: - case 0xa007: - case 0xa008: - case 0xa009: - case 0xa00a: - case 0xa00b: - case 0xa00c: - case 0xa00d: - case 0xa00e: - case 0xa00f: { - DrvRadarAttrRam[a & 0xf] = d; - return; - } - - case 0xa080: { - // watchdog write - return; - } - - case 0xa130: { - xScroll = d; - return; - } - - case 0xa140: { - yScroll = d; - return; - } - - case 0xa180: { - if (last_sound_irq == 0 && d) { - ZetClose(); - ZetOpen(1); - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(0); - } - last_sound_irq = d; - return; - } - - case 0xa181: { - DrvCPUFireIRQ = d & 0x01; - return; - } - - case 0xa183: { - //bprintf(0, _T("Flipmode %X\n"), d); - junglerflip = d; - return; - } - - case 0xa182: - case 0xa184: - case 0xa186: { // nop for now - return; - } - - case 0xa187: { - stars_enable = d & 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write %04x, %02x\n"), a, d); - } - } -} - -UINT8 __fastcall JunglerZ80PortRead1(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall JunglerZ80PortWrite1(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall JunglerZ80ProgRead2(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read %04x\n"), a); - } - } - - return 0; -} - -void __fastcall JunglerZ80ProgWrite2(UINT16 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write %04x, %02x\n"), a, d); - } - } -} - -UINT8 __fastcall JunglerZ80PortRead2(UINT16 a) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall JunglerZ80PortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[2] = { 0, 4 }; -static INT32 CharXOffsets[8] = { 64, 65, 66, 67, 0, 1, 2, 3 }; -static INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 JunglerCharPlaneOffsets[2] = { 4, 0 }; -static INT32 SpritePlaneOffsets[2] = { 0, 4 }; -static INT32 SpriteXOffsets[16] = { 64, 65, 66, 67, 128, 129, 130, 131, 192, 193, 194, 195, 0, 1, 2, 3 }; -static INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 256, 264, 272, 280, 288, 296, 304, 312 }; -static INT32 JunglerSpritePlaneOffsets[2] = { 4, 0 }; -static INT32 JunglerSpriteXOffsets[16] = { 64, 65, 66, 67, 0, 1, 2, 3, 192, 193, 194, 195, 128, 129, 130, 131 }; -static INT32 DotPlaneOffsets[2] = { 6, 7 }; -static INT32 DotXOffsets[4] = { 0, 8, 16, 24 }; -static INT32 DotYOffsets[4] = { 0, 32, 64, 96 }; - -static void MachineInit() -{ - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(RallyxZ80ProgRead); - ZetSetWriteHandler(RallyxZ80ProgWrite); - ZetSetInHandler(RallyxZ80PortRead); - ZetSetOutHandler(RallyxZ80PortWrite); - ZetMapMemory(DrvZ80Rom1 , 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvVideoRam , 0x8000, 0x8fff, MAP_RAM); - ZetMapMemory(DrvZ80Ram1 , 0x9800, 0x9fff, MAP_RAM); - ZetClose(); - - NamcoSoundInit(18432000 / 6 / 32, 3, 0); - NacmoSoundSetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); -} - -static void JunglerMachineInit() -{ - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(JunglerZ80ProgRead1); - ZetSetWriteHandler(JunglerZ80ProgWrite1); - ZetSetInHandler(JunglerZ80PortRead1); - ZetSetOutHandler(JunglerZ80PortWrite1); - ZetMapMemory(DrvZ80Rom1 , 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvVideoRam , 0x8000, 0x8fff, MAP_RAM); - ZetMapMemory(DrvZ80Ram1_weird, 0x9000, 0x93ff, MAP_RAM); // checked at boot - ZetMapMemory(DrvZ80Ram1 , 0x9800, 0x9fff, MAP_RAM); - ZetClose(); - - LocomotnSndInit(DrvZ80Rom2, DrvZ80Ram2, 1); - TimepltSndVol(0.55, 0.55); - - GenericTilesInit(); - - JunglerDoReset(); -} - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x01000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x01000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x02000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x03000, 3, 1); if (nRet != 0) return 1; - - // Load and decode the chars and sprites - nRet = BurnLoadRom(DrvTempRom, 4, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(0x40, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the dots - memset(DrvTempRom, 0, 0x1000); - nRet = BurnLoadRom(DrvTempRom, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x08, 2, 4, 4, DotPlaneOffsets, DotXOffsets, DotYOffsets, 0x80, DrvTempRom, DrvDots); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromPalette, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromLookup, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromVidLayout, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromVidTiming, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(NamcoSoundProm, 10, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - rallyx = 1; - - MachineInit(); - - return 0; -} - -static INT32 DrvaInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x01000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00800, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x01000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x01800, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x02000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x02800, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x03000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x03800, 7, 1); if (nRet != 0) return 1; - - // Load and decode the chars and sprites - nRet = BurnLoadRom(DrvTempRom + 0x0000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0800, 9, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(0x40, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the dots - memset(DrvTempRom, 0, 0x1000); - nRet = BurnLoadRom(DrvTempRom, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x08, 2, 4, 4, DotPlaneOffsets, DotXOffsets, DotYOffsets, 0x80, DrvTempRom, DrvDots); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromPalette, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromLookup, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromVidLayout, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromVidTiming, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(NamcoSoundProm, 15, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - rallyx = 1; - - MachineInit(); - - return 0; -} - -static INT32 NrallyxInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x01000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvTempRom, 0, 1); if (nRet != 0) return 1; - memcpy(DrvZ80Rom1 + 0x0000, DrvTempRom + 0x0000, 0x800); - memcpy(DrvZ80Rom1 + 0x1000, DrvTempRom + 0x0800, 0x800); - nRet = BurnLoadRom(DrvTempRom, 1, 1); if (nRet != 0) return 1; - memcpy(DrvZ80Rom1 + 0x0800, DrvTempRom + 0x0000, 0x800); - memcpy(DrvZ80Rom1 + 0x1800, DrvTempRom + 0x0800, 0x800); - nRet = BurnLoadRom(DrvTempRom, 2, 1); if (nRet != 0) return 1; - memcpy(DrvZ80Rom1 + 0x2000, DrvTempRom + 0x0000, 0x800); - memcpy(DrvZ80Rom1 + 0x3000, DrvTempRom + 0x0800, 0x800); - nRet = BurnLoadRom(DrvTempRom, 3, 1); if (nRet != 0) return 1; - memcpy(DrvZ80Rom1 + 0x2800, DrvTempRom + 0x0000, 0x800); - memcpy(DrvZ80Rom1 + 0x3800, DrvTempRom + 0x0800, 0x800); - - // Load and decode the chars and sprites - memset(DrvTempRom, 0, 0x1000); - nRet = BurnLoadRom(DrvTempRom + 0x0000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0800, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 2, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(0x40, 2, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the dots - memset(DrvTempRom, 0, 0x1000); - nRet = BurnLoadRom(DrvTempRom, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x08, 2, 4, 4, DotPlaneOffsets, DotXOffsets, DotYOffsets, 0x80, DrvTempRom, DrvDots); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromPalette, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromLookup, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromVidLayout, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromVidTiming, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(NamcoSoundProm, 11, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - rallyx = 1; - - MachineInit(); - - return 0; -} - -static INT32 JunglerInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - JunglerMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - JunglerMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x01000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x01000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x02000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x03000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 Sound Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the chars and sprites - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00800, 6, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 2, 8, 8, JunglerCharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(0x40, 2, 16, 16, JunglerSpritePlaneOffsets, JunglerSpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the dots - memset(DrvTempRom, 0, 0x1000); - nRet = BurnLoadRom(DrvTempRom, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x08, 2, 4, 4, DotPlaneOffsets, DotXOffsets, DotYOffsets, 0x80, DrvTempRom, DrvDots); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromPalette, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromLookup, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromVidLayout, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromVidTiming, 11, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - junglermode = 1; // for locomotn(timeplt) sound driver - junglerinputs = 1; - - JunglerMachineInit(); - - return 0; -} - -static INT32 LococommonDrvInit(INT32 prgroms, INT32 soundroms) -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - JunglerMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - JunglerMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x04000); - - // Load Z80 Program Roms - for (INT32 i = 0; i < prgroms; i++) { - nRet = BurnLoadRom(DrvZ80Rom1 + (i * 0x01000), i, 1); if (nRet != 0) return 1; - } - - // Load Z80 Sound Program Roms - for (INT32 i = 0; i < soundroms; i++) { - nRet = BurnLoadRom(DrvZ80Rom2 + (i * 0x01000), i + prgroms, 1); if (nRet != 0) return 1; - } - - INT32 rompos = (prgroms) + (soundroms); - - // Load and decode the chars and sprites - nRet = BurnLoadRom(DrvTempRom + 0x00000, 0 + rompos, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x01000, 1 + rompos, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 2, 8, 8, JunglerCharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(0x80, 2, 16, 16, JunglerSpritePlaneOffsets, JunglerSpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load and decode the dots - memset(DrvTempRom, 0, 0x1000); - nRet = BurnLoadRom(DrvTempRom, 2 + rompos, 1); if (nRet != 0) return 1; - GfxDecode(0x08, 2, 4, 4, DotPlaneOffsets, DotXOffsets, DotYOffsets, 0x80, DrvTempRom, DrvDots); - - // Load the PROMs - nRet = BurnLoadRom(DrvPromPalette, 3 + rompos, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromLookup, 4 + rompos, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvPromVidLayout, 5 + rompos, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - junglermode = 1; // for locomotn(timeplt) sound driver - locomotnmode = 1; - - JunglerMachineInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - if (junglermode) { - TimepltSndExit(); // konami - } else { - NamcoSoundExit(); // rallyx - BurnSampleExit(); - } - - ZetExit(); - - BurnFree(Mem); - - DrvCPUFireIRQ = 0; - DrvCPUIRQVector = 0; - xScroll = 0; - yScroll = 0; - DrvLastBang = 0; - - stars_enable = 0; - total_stars = 0; - - junglermode = 0; - junglerflip = 0; - junglerinputs = 0; - - locomotnmode = 0; - rallyx = 0; - commsegamode = 0; - - return 0; -} - -#define MAX_NETS 3 -#define MAX_RES_PER_NET 18 -#define Combine2Weights(tab,w0,w1) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5)) -#define Combine3Weights(tab,w0,w1,w2) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5)) - -static double ComputeResistorWeights(INT32 MinVal, INT32 MaxVal, double Scaler, INT32 Count1, const INT32 *Resistances1, double *Weights1, INT32 PullDown1, INT32 PullUp1, INT32 Count2, const INT32 *Resistances2, double *Weights2, INT32 PullDown2, INT32 PullUp2, INT32 Count3, const INT32 *Resistances3, double *Weights3, INT32 PullDown3, INT32 PullUp3) -{ - INT32 NetworksNum; - - INT32 ResCount[MAX_NETS]; - double r[MAX_NETS][MAX_RES_PER_NET]; - double w[MAX_NETS][MAX_RES_PER_NET]; - double ws[MAX_NETS][MAX_RES_PER_NET]; - INT32 r_pd[MAX_NETS]; - INT32 r_pu[MAX_NETS]; - - double MaxOut[MAX_NETS]; - double *Out[MAX_NETS]; - - INT32 i, j, n; - double Scale; - double Max; - - NetworksNum = 0; - for (n = 0; n < MAX_NETS; n++) { - INT32 Count, pd, pu; - const INT32 *Resistances; - double *Weights; - - switch (n) { - case 0: { - Count = Count1; - Resistances = Resistances1; - Weights = Weights1; - pd = PullDown1; - pu = PullUp1; - break; - } - - case 1: { - Count = Count2; - Resistances = Resistances2; - Weights = Weights2; - pd = PullDown2; - pu = PullUp2; - break; - } - - case 2: - default: { - Count = Count3; - Resistances = Resistances3; - Weights = Weights3; - pd = PullDown3; - pu = PullUp3; - break; - } - } - - if (Count > 0) { - ResCount[NetworksNum] = Count; - for (i = 0; i < Count; i++) { - r[NetworksNum][i] = 1.0 * Resistances[i]; - } - Out[NetworksNum] = Weights; - r_pd[NetworksNum] = pd; - r_pu[NetworksNum] = pu; - NetworksNum++; - } - } - - for (i = 0; i < NetworksNum; i++) { - double R0, R1, Vout, Dst; - - for (n = 0; n < ResCount[i]; n++) { - R0 = (r_pd[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pd[i]; - R1 = (r_pu[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pu[i]; - - for (j = 0; j < ResCount[i]; j++) { - if (j == n) { - if (r[i][j] != 0.0) R1 += 1.0 / r[i][j]; - } else { - if (r[i][j] != 0.0) R0 += 1.0 / r[i][j]; - } - } - - R0 = 1.0/R0; - R1 = 1.0/R1; - Vout = (MaxVal - MinVal) * R0 / (R1 + R0) + MinVal; - - Dst = (Vout < MinVal) ? MinVal : (Vout > MaxVal) ? MaxVal : Vout; - - w[i][n] = Dst; - } - } - - j = 0; - Max = 0.0; - for (i = 0; i < NetworksNum; i++) { - double Sum = 0.0; - - for (n = 0; n < ResCount[i]; n++) Sum += w[i][n]; - - MaxOut[i] = Sum; - if (Max < Sum) { - Max = Sum; - j = i; - } - } - - if (Scaler < 0.0) { - Scale = ((double)MaxVal) / MaxOut[j]; - } else { - Scale = Scaler; - } - - for (i = 0; i < NetworksNum; i++) { - for (n = 0; n < ResCount[i]; n++) { - ws[i][n] = w[i][n] * Scale; - (Out[i])[n] = ws[i][n]; - } - } - - return Scale; - -} - -static void DrvCalcPalette() -{ - static const INT32 ResistancesRG[3] = { 1000, 470, 220 }; - static const INT32 ResistancesB[2] = { 470, 220 }; - double rWeights[3], gWeights[3], bWeights[2]; - UINT32 Palette[32]; - UINT32 i; - - ComputeResistorWeights(0, 255, -1.0, 3, &ResistancesRG[0], rWeights, 0, 0, 3, &ResistancesRG[0], gWeights, 0, 0, 2, &ResistancesB[0], bWeights, 1000, 0); - - for (i = 0; i < 32; i++) { - INT32 Bit0, Bit1, Bit2; - INT32 r, g, b; - - Bit0 = (DrvPromPalette[i] >> 0) & 0x01; - Bit1 = (DrvPromPalette[i] >> 1) & 0x01; - Bit2 = (DrvPromPalette[i] >> 2) & 0x01; - r = Combine3Weights(rWeights, Bit0, Bit1, Bit2); - - /* green component */ - Bit0 = (DrvPromPalette[i] >> 3) & 0x01; - Bit1 = (DrvPromPalette[i] >> 4) & 0x01; - Bit2 = (DrvPromPalette[i] >> 5) & 0x01; - g = Combine3Weights(gWeights, Bit0, Bit1, Bit2); - - /* blue component */ - Bit0 = (DrvPromPalette[i] >> 6) & 0x01; - Bit1 = (DrvPromPalette[i] >> 7) & 0x01; - b = Combine2Weights(bWeights, Bit0, Bit1); - - Palette[i] = BurnHighCol(r, g, b, 0); - } - - for (i = 0; i < 256; i++) { - UINT8 PaletteEntry = DrvPromLookup[i] & 0x0f; - DrvPalette[i] = Palette[PaletteEntry]; - } - - for (i = 256; i < 260; i++) { - DrvPalette[i] = Palette[(i - 0x100) | 0x10]; - } -} - -static void DrvCalcPaletteJungler() -{ - static const INT32 ResistancesRG[3] = { 1000, 470, 220 }; - static const INT32 ResistancesB[2] = { 470, 220 }; - static const INT32 ResistancesSTAR[2] = { 150, 100 }; - double rWeights[3], gWeights[3], bWeights[2]; - double rWeightsSTAR[3], gWeightsSTAR[3], bWeightsSTAR[2]; - UINT32 Palette[0x60]; - UINT32 i; - - double scale = - ComputeResistorWeights(0, 255, -1.0, - 2, &ResistancesSTAR[0], rWeightsSTAR, 0, 0, - 2, &ResistancesSTAR[0], gWeightsSTAR, 0, 0, - 2, &ResistancesSTAR[0], bWeightsSTAR, 0, 0); - - ComputeResistorWeights(0, 255, scale, - 3, &ResistancesRG[0], rWeights, 1000, 0, - 3, &ResistancesRG[0], gWeights, 1000, 0, - 2, &ResistancesB[0], bWeights, 1000, 0); - - for (i = 0; i < 0x20; i++) { // create palette - INT32 Bit0, Bit1, Bit2; - INT32 r, g, b; - - Bit0 = (DrvPromPalette[i] >> 0) & 0x01; - Bit1 = (DrvPromPalette[i] >> 1) & 0x01; - Bit2 = (DrvPromPalette[i] >> 2) & 0x01; - r = Combine3Weights(rWeights, Bit0, Bit1, Bit2); - - /* green component */ - Bit0 = (DrvPromPalette[i] >> 3) & 0x01; - Bit1 = (DrvPromPalette[i] >> 4) & 0x01; - Bit2 = (DrvPromPalette[i] >> 5) & 0x01; - g = Combine3Weights(gWeights, Bit0, Bit1, Bit2); - - /* blue component */ - Bit0 = (DrvPromPalette[i] >> 6) & 0x01; - Bit1 = (DrvPromPalette[i] >> 7) & 0x01; - b = Combine2Weights(bWeights, Bit0, Bit1); - - Palette[i] = BurnHighCol(r, g, b, 0); - } - - for (i = 0x20; i < 0x60; i++) { // stars - INT32 bit0, bit1; - INT32 r, g, b; - - /* red component */ - bit0 = ((i - 0x20) >> 0) & 0x01; - bit1 = ((i - 0x20) >> 1) & 0x01; - r = Combine2Weights(rWeightsSTAR, bit0, bit1); - - /* green component */ - bit0 = ((i - 0x20) >> 2) & 0x01; - bit1 = ((i - 0x20) >> 3) & 0x01; - g = Combine2Weights(gWeightsSTAR, bit0, bit1); - - /* blue component */ - bit0 = ((i - 0x20) >> 4) & 0x01; - bit1 = ((i - 0x20) >> 5) & 0x01; - b = Combine2Weights(bWeightsSTAR, bit0, bit1); - - Palette[i] = BurnHighCol(r, g, b, 0); - } - - for (i = 0x000; i < 0x100; i++) { // char&sprites - UINT8 PaletteEntry = DrvPromLookup[i] & 0x0f; - DrvPalette[i] = Palette[PaletteEntry]; - } - - for (i = 0x100; i < 0x104; i++) { // bullets - DrvPalette[i] = Palette[(i - 0x100) | 0x10]; - } - - for (i = 0x104; i < 0x144; i++) { // stars - DrvPalette[i] = Palette[(i - 0x104) + 0x20]; - } -} - -#undef MAX_NETS -#undef MAX_RES_PER_NET -#undef Combine2Weights -#undef Combine3Weights - -static void DrvRenderBgLayer(INT32 priority) -{ - INT32 sx, sy, Code, Colour, x, y, xFlip, yFlip; - - INT32 Displacement = (rallyx) ? 1 : 0; - INT32 scrollx = -(xScroll - 3 * Displacement); - INT32 scrolly = -(yScroll + 16); - - for (INT32 offs = 0x3ff; offs >= 0; offs--) { - Code = DrvVideoRam[0x400 + offs]; - Colour = DrvVideoRam[0xc00 + offs]; - - if (locomotnmode) { - Code = (Code & 0x7f) + 2 * (Colour & 0x40) + 2 * (Code & 0x80); - } - - if (((Colour & 0x20) >> 5) != priority) continue; - - sx = offs % 32; - sy = offs / 32; - xFlip = ~Colour & 0x40; - yFlip = Colour & 0x80; - - if (locomotnmode) { - xFlip = yFlip; - } - - Colour &= 0x3f; - - x = 8 * sx; - y = 8 * sy; - - x += scrollx; - y += scrolly; - - if (x < -7) x += 256; - if (y < -7) y += 256; - - if (x >= nScreenWidth || y >= nScreenHeight) continue; - - if (xFlip) { - if (yFlip) { - Render8x8Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - Render8x8Tile_FlipXY_Clip(pTransDraw, Code, x-256, y, Colour, 2, 0, DrvChars); - } else { - Render8x8Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - Render8x8Tile_FlipX_Clip(pTransDraw, Code, x-256, y, Colour, 2, 0, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - Render8x8Tile_FlipY_Clip(pTransDraw, Code, x-256, y, Colour, 2, 0, DrvChars); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - Render8x8Tile_Clip(pTransDraw, Code, x-256, y, Colour, 2, 0, DrvChars); - } - } - } -} - -static void DrvRender8x32Layer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex, Flip, xFlip, yFlip; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 8; mx++) { - TileIndex = mx + (my << 5); - Code = DrvVideoRam[TileIndex + 0x000 + 0x000]; - Colour = DrvVideoRam[TileIndex + 0x000 + 0x800]; - - Flip = ((Colour >> 6) & 0x03) ^ 1; - xFlip = Flip & 0x01; - yFlip = Flip & 0x02; - - if (locomotnmode) { - Code = (Code & 0x7f) + 2 * (Colour & 0x40) + 2 * (Code & 0x80); - xFlip = yFlip = Colour & 0x80; - } - - Colour &= 0x3f; - - x = 8 * mx; - y = 8 * my; - - y -= 16; - - x -= 32; - if (x < 0) x += 64; - - x += 224; - - if (x >= nScreenWidth || y >= nScreenHeight) continue; - - if (x > 8 && x < 280 && y > 8 && y < 216) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_FlipXY(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } else { - Render8x8Tile_FlipX(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_FlipY(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } else { - Render8x8Tile(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } else { - Render8x8Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } - } else { - if (yFlip) { - Render8x8Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 2, 0, DrvChars); - } - } - } - } - } -} - -static void DrvRenderSprites() -{ - INT32 SpriteRamBase = (commsegamode) ? 0x00 : 0x14; - UINT8 *SpriteRam = DrvVideoRam; - UINT8 *SpriteRam2 = DrvVideoRam + 0x800; - INT32 Displacement = (rallyx || junglermode) ? 1 : 0; - - for (INT32 Offs = 0x20 - 2; Offs >= SpriteRamBase; Offs -= 2) { - INT32 sx = SpriteRam[Offs + 1] + ((SpriteRam2[Offs + 1] & 0x80) << 1) - Displacement; - INT32 sy = 241 - SpriteRam2[Offs] - Displacement; - INT32 Colour = SpriteRam2[Offs + 1] & 0x3f; - - INT32 xFlip = SpriteRam[Offs] & 1; - INT32 yFlip = SpriteRam[Offs] & 2; - INT32 Code = (SpriteRam[Offs] & 0xfc) >> 2; - - if (locomotnmode) { - xFlip = yFlip; - Code = ((SpriteRam[Offs] & 0x7c) >> 2) + 0x20*(SpriteRam[Offs] & 0x01) + ((SpriteRam[Offs] & 0x80) >> 1); - } - - if (junglerflip) { - sx = (nScreenWidth-16-1) - sx; - sy = SpriteRam2[Offs] - Displacement; - xFlip = !xFlip; - yFlip = !yFlip; - } - - - sy -= 16; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (sx > 16 && sx < 272 && sy > 16 && sy < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, sx, sy, Colour, 2, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, 2, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, sx, sy, Colour, 2, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour, 2, 0, 0, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Colour, 2, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 2, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, sy, Colour, 2, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 2, 0, 0, DrvSprites); - } - } - } - } -} - -static void DrvRenderBullets() -{ - INT32 SpriteRamBase = (commsegamode) ? 0x00 : 0x14; - UINT8 *RadarX = DrvVideoRam + 0x020; - UINT8 *RadarY = DrvVideoRam + 0x820; - - for (INT32 Offs = SpriteRamBase; Offs < 0x20; Offs++) { - INT32 x, y, Code, Flip; - - Code = ((DrvRadarAttrRam[Offs & 0x0f] & 0x0e) >> 1) ^ 0x07; - x = RadarX[Offs] + ((~DrvRadarAttrRam[Offs & 0x0f] & 0x01) << 8); - y = ((locomotnmode) ? 252 : 253) - RadarY[Offs]; - Flip = 0; - - if (junglermode) { - Code = (DrvRadarAttrRam[Offs & 0x0f] & 0x07) ^ 0x07; - x = RadarX[Offs] + ((~DrvRadarAttrRam[Offs & 0x0f] & 0x08) << 5); - - if (junglerflip) { - x = (nScreenWidth-4) - x; - y = RadarY[Offs] - 1; - Flip = 1; - } - } - - y -= 16; - - if (x >= nScreenWidth || y >= nScreenHeight) continue; - -// if (flip_screen_get(machine)) -// x -= 3; - -// if (transpen) -// drawgfx_transpen(bitmap,cliprect,machine->gfx[2], -// ((state->radarattr[offs & 0x0f] & 0x0e) >> 1) ^ 0x07, -// 0, -// 0,0, -// x,y, -// 3); -// else -// drawgfx_transtable(bitmap,cliprect,machine->gfx[2], -// ((state->radarattr[offs & 0x0f] & 0x0e) >> 1) ^ 0x07, -// 0, -// 0,0, -// x,y, -/// state->drawmode_table,machine->shadow_table); - if (Flip) { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 4, 4, Code, x, y, 0, 2, 3, 0x100, DrvDots); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 4, 4, Code, x, y, 0, 2, 3, 0x100, DrvDots); - } - } -} - -void calculate_star_field() -{ - INT32 generator; - - total_stars = 0; - generator = 0; - memset(&j_stars, 0, sizeof(j_stars)); - - for (INT32 y = 0; y < 256; y++) { - for (INT32 x = 0; x < 288; x++) { - INT32 bit1, bit2; - - generator <<= 1; - bit1 = (~generator >> 17) & 1; - bit2 = (generator >> 5) & 1; - - if (bit1 ^ bit2) - generator |= 1; - - if (((~generator >> 16) & 1) && (generator & 0xfe) == 0xfe) { - INT32 color = (~(generator >> 8)) & 0x3f; - - if (color && total_stars < 1000) - { - j_stars[total_stars].x = x; - j_stars[total_stars].y = y; - j_stars[total_stars].color = color; - - total_stars++; - } - } - } - } -} - -void plot_star(INT32 x, INT32 y, INT32 color) -{ - if (junglerflip) { - x = 255 - x; - y = 255 - y; - } - - if ((x >= 0 && x < nScreenWidth) && (y >= 0 && y < nScreenHeight)) { - UINT16 *pxl = &pTransDraw[(y * nScreenWidth) + x]; - if (*pxl == 0x1c || *pxl == 0x6c || *pxl == 0x00) - *pxl = 0x104 + color; - } -} - -void draw_stars() -{ - for (INT32 offs = 0; offs < total_stars; offs++) { - INT32 x = j_stars[offs].x; - INT32 y = j_stars[offs].y; - - if ((y & 0x01) ^ ((x >> 3) & 0x01)) - plot_star(x, y, j_stars[offs].color); - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - if (nBurnLayer & 1) DrvRenderBgLayer(0); - if (nBurnLayer & 2) DrvRenderSprites(); - if (nBurnLayer & 4) DrvRenderBgLayer(1); - if (nBurnLayer & 8) DrvRender8x32Layer(); - if (nBurnLayer & 8) DrvRenderBullets(); - BurnTransferCopy(DrvPalette); -} - -extern int counter; int funk = 0; - -static void DrvDrawJungler() -{ - BurnTransferClear(); - DrvCalcPaletteJungler(); - if (nBurnLayer & 1) DrvRenderBgLayer(0); - if (nBurnLayer & 4) DrvRenderBgLayer(1); - if (nBurnLayer & 8) DrvRender8x32Layer(); - if (nSpriteEnable & 1) DrvRenderSprites(); - if (nBurnLayer & 2) DrvRenderBullets(); - -#if 0 - // for debugging tactician stars. grrr! - FILE * f = fopen("c:\\transdraw.bin", "wb+"); - fwrite(pTransDraw, 1, nScreenWidth * nScreenHeight * 2, f); - fclose(f); -#endif - - if (stars_enable) - draw_stars(); - - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = nBurnSoundLen; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal = { (18432000 / 6) / 60 }; - INT32 nCyclesDone = 0; - INT32 nCyclesSegment; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run Z80 #1 - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal / nInterleave; - nCyclesSegment = nNext - nCyclesDone; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone += nCyclesSegment; - if (i == (nInterleave - 1) && DrvCPUFireIRQ) { - ZetSetVector(DrvCPUIRQVector); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - BurnSampleRender(pSoundBuf, nSegmentLength); - } - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - BurnSampleRender(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 JunglerFrame() -{ - INT32 nInterleave = 256; - - if (DrvReset) JunglerDoReset(); - - JunglerMakeInputs(); - - INT32 nSoundBufferPos = 0; - - INT32 nCyclesTotal[2] = { (18432000 / 6) / 60, (14318180 / 8) / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nCyclesSegment; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == (nInterleave - 1) && DrvCPUFireIRQ) { - ZetNmi(); - } - ZetClose(); - - ZetOpen(1); - nNext = (nCyclesTotal[1] * i) / nInterleave; - nCyclesDone[1] += ZetRun(nNext - nCyclesDone[1]); - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - TimepltSndUpdate(pAY8910Buffer, pSoundBuf, nSegmentLength); - } - - if (pBurnDraw) DrvDrawJungler(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029708; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - if (junglermode) { - TimepltSndScan(nAction, pnMin); - SCAN_VAR(last_sound_irq); - } - - if (rallyx) { - NamcoSoundScan(nAction, pnMin); - } - } - - return 0; -} - -struct BurnDriver BurnDrvRallyx = { - "rallyx", NULL, NULL, "rallyx", "1980", - "Rally X (32k Ver.?)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, RallyxRomInfo, RallyxRomName, RallyxSampleInfo, RallyxSampleName, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 260, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRallyxa = { - "rallyxa", "rallyx", NULL, "rallyx", "1980", - "Rally X\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, RallyxaRomInfo, RallyxaRomName, RallyxSampleInfo, RallyxSampleName, DrvInputInfo, DrvDIPInfo, - DrvaInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 260, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRallyxm = { - "rallyxm", "rallyx", NULL, "rallyx", "1980", - "Rally X (Midway)\0", NULL, "Namco (Midway License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, RallyxmRomInfo, RallyxmRomName, RallyxSampleInfo, RallyxSampleName, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 260, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRallyxmr = { - "rallyxmr", "rallyx", NULL, "rallyx", "1980", - "Rally X (Model Racing)\0", NULL, "bootleg (Petaco)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, RallyxmrRomInfo, RallyxmrRomName, RallyxSampleInfo, RallyxSampleName, DrvInputInfo, DrvDIPInfo, - DrvaInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 260, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDngrtrck = { - "dngrtrck", "rallyx", NULL, "rallyx", "1980", - "Danger Track (Rally X bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, DngrtrckRomInfo, DngrtrckRomName, RallyxSampleInfo, RallyxSampleName, DrvInputInfo, DngrtrckDIPInfo, - DrvaInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 260, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNrallyx = { - "nrallyx", NULL, NULL, "rallyx", "1981", - "New Rally X\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, NrallyxRomInfo, NrallyxRomName, RallyxSampleInfo, RallyxSampleName, DrvInputInfo, DrvDIPInfo, - NrallyxInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 260, 288, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJungler = { - "jungler", NULL, NULL, NULL, "1981", - "Jungler\0", NULL, "Konami", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, JunglerRomInfo, JunglerRomName, NULL, NULL, JunglerInputInfo, JunglerDIPInfo, - JunglerInit, DrvExit, JunglerFrame, NULL, DrvScan, - NULL, 324, 224, 288, 3, 4 -}; - -INT32 TactcianDrvInit() -{ - return LococommonDrvInit(6, 2); -} - -// Tactician (set 1) - -static struct BurnRomInfo tactcianRomDesc[] = { - { "tacticia.001", 0x1000, 0x99163e39, 1 }, // 0 maincpu - { "tacticia.002", 0x1000, 0x6d3e8a69, 1 }, // 1 - { "tacticia.003", 0x1000, 0x0f71d0fa, 1 }, // 2 - { "tacticia.004", 0x1000, 0x5e15f3b3, 1 }, // 3 - { "tacticia.005", 0x1000, 0x76456106, 1 }, // 4 - { "tacticia.006", 0x1000, 0xb33ca9ea, 1 }, // 5 - - { "tacticia.s2", 0x1000, 0x97d145a7, 2 }, // 6 tpsound - { "tacticia.s1", 0x1000, 0x067f781b, 2 }, // 7 - - { "tacticia.c1", 0x1000, 0x5d3ee965, 3 }, // 8 gfx1 - { "tacticia.c2", 0x1000, 0xe8c59c4f, 3 }, // 9 - - { "tact6301.004", 0x0100, 0x88b0b511, 4 }, // 10 gfx2 - - { "tact6331.002", 0x0020, 0xb7ef83b7, 5 }, // 11 proms - { "tact6301.003", 0x0100, 0xa92796f2, 5 }, // 12 - { "tact6331.001", 0x0020, 0x8f574815, 5 }, // 13 -}; - -STD_ROM_PICK(tactcian) -STD_ROM_FN(tactcian) - -struct BurnDriver BurnDrvTactcian = { - "tactcian", NULL, NULL, NULL, "1982", - "Tactician (set 1)\0", NULL, "Konami (Sega license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, tactcianRomInfo, tactcianRomName, NULL, NULL, TactcianInputInfo, TactcianDIPInfo, - TactcianDrvInit, DrvExit, JunglerFrame, NULL, DrvScan, - NULL, 324, 224, 288, 3, 4 -}; - - -// Tactician (set 2) - -static struct BurnRomInfo tactcian2RomDesc[] = { - { "tan1", 0x1000, 0xddf38b75, 1 }, // 0 maincpu - { "tan2", 0x1000, 0xf065ee2e, 1 }, // 1 - { "tan3", 0x1000, 0x2dba64fe, 1 }, // 2 - { "tan4", 0x1000, 0x2ba07847, 1 }, // 3 - { "tan5", 0x1000, 0x1dae4c61, 1 }, // 4 - { "tan6", 0x1000, 0x2b36a18d, 1 }, // 5 - - { "tacticia.s2", 0x1000, 0x97d145a7, 2 }, // 6 tpsound - { "tacticia.s1", 0x1000, 0x067f781b, 2 }, // 7 - - { "c1", 0x1000, 0x5399471f, 3 }, // 8 gfx1 - { "c2", 0x1000, 0x8e8861e8, 3 }, // 9 - - { "tact6301.004", 0x0100, 0x88b0b511, 4 }, // 10 gfx2 - - { "tact6331.002", 0x0020, 0xb7ef83b7, 5 }, // 11 proms - { "tact6301.003", 0x0100, 0xa92796f2, 5 }, // 12 - { "tact6331.001", 0x0020, 0x8f574815, 5 }, // 13 -}; - -STD_ROM_PICK(tactcian2) -STD_ROM_FN(tactcian2) - -struct BurnDriver BurnDrvTactcian2 = { - "tactcian2", "tactcian", NULL, NULL, "1981", - "Tactician (set 2)\0", NULL, "Konami (Sega license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, tactcian2RomInfo, tactcian2RomName, NULL, NULL, TactcianInputInfo, TactcianDIPInfo, - TactcianDrvInit, DrvExit, JunglerFrame, NULL, DrvScan, - NULL, 324, 224, 288, 3, 4 -}; - -INT32 LocomotnDrvInit() -{ - return LococommonDrvInit(5, 1); -} - -// Loco-Motion - -static struct BurnRomInfo locomotnRomDesc[] = { - { "1a.cpu", 0x1000, 0xb43e689a, 1 }, // 0 maincpu - { "2a.cpu", 0x1000, 0x529c823d, 1 }, // 1 - { "3.cpu", 0x1000, 0xc9dbfbd1, 1 }, // 2 - { "4.cpu", 0x1000, 0xcaf6431c, 1 }, // 3 - { "5.cpu", 0x1000, 0x64cf8dd6, 1 }, // 4 - - { "1b_s1.bin", 0x1000, 0xa1105714, 2 }, // 5 tpsound - - { "5l_c1.bin", 0x1000, 0x5732eda9, 3 }, // 6 gfx1 - { "c2.cpu", 0x1000, 0xc3035300, 3 }, // 7 - - { "10g.bpr", 0x0100, 0x2ef89356, 4 }, // 8 gfx2 - - { "8b.bpr", 0x0020, 0x75b05da0, 5 }, // 9 proms - { "9d.bpr", 0x0100, 0xaa6cf063, 5 }, // 10 - { "7a.bpr", 0x0020, 0x48c8f094, 5 }, // 11 - { "10a.bpr", 0x0020, 0xb8861096, 5 }, // 12 -}; - -STD_ROM_PICK(locomotn) -STD_ROM_FN(locomotn) - -struct BurnDriver BurnDrvLocomotn = { - "locomotn", NULL, NULL, NULL, "1982", - "Loco-Motion\0", NULL, "Konami (Centuri license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, locomotnRomInfo, locomotnRomName, NULL, NULL, LocomotnInputInfo, LocomotnDIPInfo, - LocomotnDrvInit, DrvExit, JunglerFrame, NULL, DrvScan, - NULL, 324, 224, 256, 3, 4 -}; - -INT32 GutangtnDrvInit() -{ - return LococommonDrvInit(5, 1); -} - -// Guttang Gottong - -static struct BurnRomInfo gutangtnRomDesc[] = { - { "3d_1.bin", 0x1000, 0xe9757395, 1 }, // 0 maincpu - { "3e_2.bin", 0x1000, 0x11d21d2e, 1 }, // 1 - { "3f_3.bin", 0x1000, 0x4d80f895, 1 }, // 2 - { "3h_4.bin", 0x1000, 0xaa258ddf, 1 }, // 3 - { "3j_5.bin", 0x1000, 0x52aec87e, 1 }, // 4 - - { "1b_s1.bin", 0x1000, 0xa1105714, 2 }, // 5 tpsound - - { "5l_c1.bin", 0x1000, 0x5732eda9, 3 }, // 6 gfx1 - { "5m_c2.bin", 0x1000, 0x51c542fd, 3 }, // 7 - - { "10g.bpr", 0x0100, 0x2ef89356, 4 }, // 8 gfx2 - - { "8b.bpr", 0x0020, 0x75b05da0, 5 }, // 9 proms - { "9d.bpr", 0x0100, 0xaa6cf063, 5 }, // 10 - { "7a.bpr", 0x0020, 0x48c8f094, 5 }, // 11 - { "10a.bpr", 0x0020, 0xb8861096, 5 }, // 12 -}; - -STD_ROM_PICK(gutangtn) -STD_ROM_FN(gutangtn) - -struct BurnDriver BurnDrvGutangtn = { - "gutangtn", "locomotn", NULL, NULL, "1982", - "Guttang Gottong\0", NULL, "Konami (Sega license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, gutangtnRomInfo, gutangtnRomName, NULL, NULL, LocomotnInputInfo, LocomotnDIPInfo, - GutangtnDrvInit, DrvExit, JunglerFrame, NULL, DrvScan, - NULL, 324, 224, 256, 3, 4 -}; - -INT32 CottongDrvInit() -{ - return LococommonDrvInit(4, 2); -} - - -// Cotocoto Cottong - -static struct BurnRomInfo cottongRomDesc[] = { - { "c1", 0x1000, 0x2c256fe6, 1 }, // 0 maincpu - { "c2", 0x1000, 0x1de5e6a0, 1 }, // 1 - { "c3", 0x1000, 0x01f909fe, 1 }, // 2 - { "c4", 0x1000, 0xa89eb3e3, 1 }, // 3 - - { "c7", 0x1000, 0x3d83f6d3, 2 }, // 4 tpsound - { "c8", 0x1000, 0x323e1937, 2 }, // 5 - - { "c5", 0x1000, 0x992d079c, 3 }, // 6 gfx1 - { "c6", 0x1000, 0x0149ef46, 3 }, // 7 - - { "5.bpr", 0x0100, 0x21fb583f, 4 }, // 8 gfx2 - - { "2.bpr", 0x0020, 0x26f42e6f, 5 }, // 9 proms - { "3.bpr", 0x0100, 0x4aecc0c8, 5 }, // 10 - { "7a.bpr", 0x0020, 0x48c8f094, 5 }, // 11 - { "10a.bpr", 0x0020, 0xb8861096, 5 }, // 12 -}; - -STD_ROM_PICK(cottong) -STD_ROM_FN(cottong) - -struct BurnDriver BurnDrvCottong = { - "cottong", "locomotn", NULL, NULL, "1982", - "Cotocoto Cottong\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, cottongRomInfo, cottongRomName, NULL, NULL, LocomotnInputInfo, LocomotnDIPInfo, - CottongDrvInit, DrvExit, JunglerFrame, NULL, DrvScan, - NULL, 324, 224, 256, 3, 4 -}; - -INT32 LocobootDrvInit() -{ - return LococommonDrvInit(4, 2); -} - -// Loco-Motion (bootleg) - -static struct BurnRomInfo locobootRomDesc[] = { - { "g.116", 0x1000, 0x1248799c, 1 }, // 0 maincpu - { "g.117", 0x1000, 0x5b5b5753, 1 }, // 1 - { "g.118", 0x1000, 0x6bc269e1, 1 }, // 2 - { "g.119", 0x1000, 0x3feb762e, 1 }, // 3 - - { "c7", 0x1000, 0x3d83f6d3, 2 }, // 4 tpsound - { "c8", 0x1000, 0x323e1937, 2 }, // 5 - - { "c5", 0x1000, 0x992d079c, 3 }, // 6 gfx1 - { "c6", 0x1000, 0x0149ef46, 3 }, // 7 - - { "5.bpr", 0x0100, 0x21fb583f, 4 }, // 8 gfx2 - - { "2.bpr", 0x0020, 0x26f42e6f, 5 }, // 9 proms - { "3.bpr", 0x0100, 0x4aecc0c8, 5 }, // 10 - { "7a.bpr", 0x0020, 0x48c8f094, 5 }, // 11 - { "10a.bpr", 0x0020, 0xb8861096, 5 }, // 12 -}; - -STD_ROM_PICK(locoboot) -STD_ROM_FN(locoboot) - -struct BurnDriver BurnDrvLocoboot = { - "locoboot", "locomotn", NULL, NULL, "1982", - "Loco-Motion (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, locobootRomInfo, locobootRomName, NULL, NULL, LocomotnInputInfo, LocomotnDIPInfo, - LocobootDrvInit, DrvExit, JunglerFrame, NULL, DrvScan, - NULL, 324, 224, 256, 3, 4 -}; - - -INT32 CommsegaDrvInit() -{ - commsegamode = 1; - return LococommonDrvInit(5, 1); -} - -// Commando (Sega) - -static struct BurnRomInfo commsegaRomDesc[] = { - { "csega1", 0x1000, 0x92de3405, 1 }, // 0 maincpu - { "csega2", 0x1000, 0xf14e2f9a, 1 }, // 1 - { "csega3", 0x1000, 0x941dbf48, 1 }, // 2 - { "csega4", 0x1000, 0xe0ac69b4, 1 }, // 3 - { "csega5", 0x1000, 0xbc56ebd0, 1 }, // 4 - - { "csega8", 0x1000, 0x588b4210, 2 }, // 5 tpsound - - { "csega7", 0x1000, 0xe8e374f9, 3 }, // 6 gfx1 - { "csega6", 0x1000, 0xcf07fd5e, 3 }, // 7 - - { "gg3.bpr", 0x0100, 0xae7fd962, 4 }, // 8 gfx2 - - { "gg1.bpr", 0x0020, 0xf69e585a, 5 }, // 9 proms - { "gg2.bpr", 0x0100, 0x0b756e30, 5 }, // 10 - { "gg0.bpr", 0x0020, 0x48c8f094, 5 }, // 11 - { "tt3.bpr", 0x0020, 0xb8861096, 5 }, // 12 -}; - -STD_ROM_PICK(commsega) -STD_ROM_FN(commsega) - -struct BurnDriver BurnDrvCommsega = { - "commsega", NULL, NULL, NULL, "1983", - "Commando (Sega)\0", NULL, "Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, commsegaRomInfo, commsegaRomName, NULL, NULL, CommsegaInputInfo, CommsegaDIPInfo, - CommsegaDrvInit, DrvExit, JunglerFrame, NULL, DrvScan, - NULL, 324, 224, 256, 3, 4 -}; - - diff --git a/jan/src/burn/drv/pre90s/d_renegade.cpp b/jan/src/burn/drv/pre90s/d_renegade.cpp deleted file mode 100644 index 82249b45e..000000000 --- a/jan/src/burn/drv/pre90s/d_renegade.cpp +++ /dev/null @@ -1,1126 +0,0 @@ -// FB Alpha Renegade driver module -// Based on MAME driver by Phil Stroffolino, Carlos A. Lozano, Rob Rosenbrock - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "m6805_intf.h" -#include "m6809_intf.h" -#include "burn_ym3526.h" -#include "msm5205.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvM6502Rom = NULL; -static UINT8 *DrvM6809Rom = NULL; -static UINT8 *DrvM68705Rom = NULL; -static UINT8 *DrvM68705Ram = NULL; -static UINT8 *DrvADPCMRom = NULL; -static UINT8 *DrvM6502Ram = NULL; -static UINT8 *DrvM6809Ram = NULL; -static UINT8 *DrvVideoRam1 = NULL; -static UINT8 *DrvVideoRam2 = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPaletteRam1 = NULL; -static UINT8 *DrvPaletteRam2 = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvRomBank; -static UINT8 DrvVBlank; -static UINT8 DrvScrollX[2]; -static UINT8 DrvSoundLatch; -static UINT8 DrvADPCMPlaying = 0; -static UINT32 DrvADPCMPos = 0; -static UINT32 DrvADPCMEnd = 0; - -static INT32 nCyclesTotal[3]; - -// MCU Simulation Variables -#define MCU_TYPE_NONE 0 -#define MCU_TYPE_MCU 1 - -#define MCU_BUFFER_MAX 6 -static UINT8 mcu_buffer[MCU_BUFFER_MAX]; -static UINT8 mcu_input_size; -static UINT8 mcu_output_byte; -static INT8 mcu_key; - -static INT32 DisableMCUEmulation = 0; - -// MCU Emulation Variables -static INT32 MCUFromMain; -static INT32 MCUFromMcu; -static INT32 MCUMainSent; -static INT32 MCUMcuSent; -static UINT8 MCUDdrA; -static UINT8 MCUDdrB; -static UINT8 MCUDdrC; -static UINT8 MCUPortAOut; -static UINT8 MCUPortBOut; -static UINT8 MCUPortCOut; -static UINT8 MCUPortAIn; -static UINT8 MCUPortBIn; -static UINT8 MCUPortCIn; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort1 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - - -STDINPUTINFO(Drv) - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = 0xff; - DrvInput[2] = 0x9c; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] -= (DrvInputPort0[i] & 1) << i; - DrvInput[1] -= (DrvInputPort1[i] & 1) << i; - DrvInput[2] -= (DrvInputPort2[i] & 1) << i; - } -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xbf, NULL }, - {0x15, 0xff, 0xff, 0x03, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x03, 0x00, "2 Coins 1 Play" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Play" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x03, 0x01, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0x0c, 0x00, "2 Coins 1 Play" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Play" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 2 Plays" }, - {0x14, 0x01, 0x0c, 0x04, "1 Coin 3 Plays" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x14, 0x01, 0x10, 0x10, "1" }, - {0x14, 0x01, 0x10, 0x00, "2" }, - - {0 , 0xfe, 0 , 2 , "Bonus" }, - {0x14, 0x01, 0x20, 0x20, "30k" }, - {0x14, 0x01, 0x20, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x40, 0x00, "Upright" }, - {0x14, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Very Hard" }, -}; - -STDDIPINFO(Drv) - -static struct BurnRomInfo DrvRomDesc[] = { - { "nb-5.ic51", 0x08000, 0xba683ddf, BRF_ESS | BRF_PRG }, // 0 M6502 Program Code - { "na-5.ic52", 0x08000, 0xde7e7df4, BRF_ESS | BRF_PRG }, // 1 - - { "n0-5.ic13", 0x08000, 0x3587de3b, BRF_ESS | BRF_PRG }, // 2 M6809 Program Code - - { "nc-5.bin", 0x08000, 0x9adfaa5d, BRF_GRA }, // 3 Characters - - { "n1-5.ic1", 0x08000, 0x4a9f47f3, BRF_GRA }, // 4 Tiles - { "n6-5.ic28", 0x08000, 0xd62a0aa8, BRF_GRA }, // 5 - { "n7-5.ic27", 0x08000, 0x7ca5a532, BRF_GRA }, // 6 - { "n2-5.ic14", 0x08000, 0x8d2e7982, BRF_GRA }, // 7 - { "n8-5.ic26", 0x08000, 0x0dba31d3, BRF_GRA }, // 8 - { "n9-5.ic25", 0x08000, 0x5b621b6a, BRF_GRA }, // 9 - - { "nh-5.bin", 0x08000, 0xdcd7857c, BRF_GRA }, // 10 Sprites - { "nd-5.bin", 0x08000, 0x2de1717c, BRF_GRA }, // 11 - { "nj-5.bin", 0x08000, 0x0f96a18e, BRF_GRA }, // 12 - { "nn-5.bin", 0x08000, 0x1bf15787, BRF_GRA }, // 13 - { "ne-5.bin", 0x08000, 0x924c7388, BRF_GRA }, // 14 - { "nk-5.bin", 0x08000, 0x69499a94, BRF_GRA }, // 15 - { "ni-5.bin", 0x08000, 0x6f597ed2, BRF_GRA }, // 16 - { "nf-5.bin", 0x08000, 0x0efc8d45, BRF_GRA }, // 17 - { "nl-5.bin", 0x08000, 0x14778336, BRF_GRA }, // 18 - { "no-5.bin", 0x08000, 0x147dd23b, BRF_GRA }, // 19 - { "ng-5.bin", 0x08000, 0xa8ee3720, BRF_GRA }, // 20 - { "nm-5.bin", 0x08000, 0xc100258e, BRF_GRA }, // 21 - - { "n3-5.ic33", 0x08000, 0x78fd6190, BRF_GRA }, // 22 ADPCM - { "n4-5.ic32", 0x08000, 0x6557564c, BRF_GRA }, // 23 - { "n5-5.ic31", 0x08000, 0x7ee43a3c, BRF_GRA }, // 24 - - { "nz-5.ic97", 0x00800, 0x32e47560, BRF_ESS | BRF_PRG }, // 25 MCU -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvjRomDesc[] = { - { "nb-01.bin", 0x08000, 0x93fcfdf5, BRF_ESS | BRF_PRG }, // 0 M6502 Program Code - { "ta18-11.bin", 0x08000, 0xf240f5cd, BRF_ESS | BRF_PRG }, // 1 - - { "n0-5.bin", 0x08000, 0x3587de3b, BRF_ESS | BRF_PRG }, // 2 M6809 Program Code - - { "ta18-25.bin", 0x08000, 0x9bd2bea3, BRF_GRA }, // 3 Characters - - { "ta18-01.bin", 0x08000, 0xdaf15024, BRF_GRA }, // 4 Tiles - { "ta18-06.bin", 0x08000, 0x1f59a248, BRF_GRA }, // 5 - { "n7-5.bin", 0x08000, 0x7ca5a532, BRF_GRA }, // 6 - { "ta18-02.bin", 0x08000, 0x994c0021, BRF_GRA }, // 7 - { "ta18-04.bin", 0x08000, 0x55b9e8aa, BRF_GRA }, // 8 - { "ta18-03.bin", 0x08000, 0x0475c99a, BRF_GRA }, // 9 - - { "ta18-20.bin", 0x08000, 0xc7d54139, BRF_GRA }, // 10 Sprites - { "ta18-24.bin", 0x08000, 0x84677d45, BRF_GRA }, // 11 - { "ta18-18.bin", 0x08000, 0x1c770853, BRF_GRA }, // 12 - { "ta18-14.bin", 0x08000, 0xaf656017, BRF_GRA }, // 13 - { "ta18-23.bin", 0x08000, 0x3fd19cf7, BRF_GRA }, // 14 - { "ta18-17.bin", 0x08000, 0x74c64c6e, BRF_GRA }, // 15 - { "ta18-19.bin", 0x08000, 0xc8795fd7, BRF_GRA }, // 16 - { "ta18-22.bin", 0x08000, 0xdf3a2ff5, BRF_GRA }, // 17 - { "ta18-16.bin", 0x08000, 0x7244bad0, BRF_GRA }, // 18 - { "ta18-13.bin", 0x08000, 0xb6b14d46, BRF_GRA }, // 19 - { "ta18-21.bin", 0x08000, 0xc95e009b, BRF_GRA }, // 20 - { "ta18-15.bin", 0x08000, 0xa5d61d01, BRF_GRA }, // 21 - - { "ta18-09.bin", 0x08000, 0x07ed4705, BRF_GRA }, // 22 ADPCM - { "ta18-08.bin", 0x08000, 0xc9312613, BRF_GRA }, // 23 - { "ta18-07.bin", 0x08000, 0x02e3f3ed, BRF_GRA }, // 24 - - { "nz-0.bin", 0x00800, 0x650bb5f0, BRF_ESS | BRF_PRG }, // 25 MCU -}; - -STD_ROM_PICK(Drvj) -STD_ROM_FN(Drvj) - -static struct BurnRomInfo DrvbRomDesc[] = { - { "ta18-10.bin", 0x08000, 0xa90cf44a, BRF_ESS | BRF_PRG }, // 0 M6502 Program Code - { "ta18-11.bin", 0x08000, 0xf240f5cd, BRF_ESS | BRF_PRG }, // 1 - - { "n0-5.bin", 0x08000, 0x3587de3b, BRF_ESS | BRF_PRG }, // 2 M6809 Program Code - - { "ta18-25.bin", 0x08000, 0x9bd2bea3, BRF_GRA }, // 3 Characters - - { "ta18-01.bin", 0x08000, 0xdaf15024, BRF_GRA }, // 4 Tiles - { "ta18-06.bin", 0x08000, 0x1f59a248, BRF_GRA }, // 5 - { "n7-5.bin", 0x08000, 0x7ca5a532, BRF_GRA }, // 6 - { "ta18-02.bin", 0x08000, 0x994c0021, BRF_GRA }, // 7 - { "ta18-04.bin", 0x08000, 0x55b9e8aa, BRF_GRA }, // 8 - { "ta18-03.bin", 0x08000, 0x0475c99a, BRF_GRA }, // 9 - - { "ta18-20.bin", 0x08000, 0xc7d54139, BRF_GRA }, // 10 Sprites - { "ta18-24.bin", 0x08000, 0x84677d45, BRF_GRA }, // 11 - { "ta18-18.bin", 0x08000, 0x1c770853, BRF_GRA }, // 12 - { "ta18-14.bin", 0x08000, 0xaf656017, BRF_GRA }, // 13 - { "ta18-23.bin", 0x08000, 0x3fd19cf7, BRF_GRA }, // 14 - { "ta18-17.bin", 0x08000, 0x74c64c6e, BRF_GRA }, // 15 - { "ta18-19.bin", 0x08000, 0xc8795fd7, BRF_GRA }, // 16 - { "ta18-22.bin", 0x08000, 0xdf3a2ff5, BRF_GRA }, // 17 - { "ta18-16.bin", 0x08000, 0x7244bad0, BRF_GRA }, // 18 - { "ta18-13.bin", 0x08000, 0xb6b14d46, BRF_GRA }, // 19 - { "ta18-21.bin", 0x08000, 0xc95e009b, BRF_GRA }, // 20 - { "ta18-15.bin", 0x08000, 0xa5d61d01, BRF_GRA }, // 21 - - { "ta18-09.bin", 0x08000, 0x07ed4705, BRF_GRA }, // 22 ADPCM - { "ta18-08.bin", 0x08000, 0xc9312613, BRF_GRA }, // 23 - { "ta18-07.bin", 0x08000, 0x02e3f3ed, BRF_GRA }, // 24 -}; - -STD_ROM_PICK(Drvb) -STD_ROM_FN(Drvb) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvM6502Rom = Next; Next += 0x10000; - DrvM6809Rom = Next; Next += 0x08000; - DrvM68705Rom = Next; Next += 0x00800; - DrvADPCMRom = Next; Next += 0x18000; - - RamStart = Next; - - DrvM6502Ram = Next; Next += 0x01800; - DrvM6809Ram = Next; Next += 0x01000; - DrvM68705Ram = Next; Next += 0x00070; - DrvSpriteRam = Next; Next += 0x00800; - DrvVideoRam1 = Next; Next += 0x00800; - DrvVideoRam2 = Next; Next += 0x00800; - DrvPaletteRam1 = Next; Next += 0x00100; - DrvPaletteRam2 = Next; Next += 0x00100; - - RamEnd = Next; - - DrvChars = Next; Next += 0x0400 * 8 * 8; - DrvTiles = Next; Next += 0x0800 * 16 * 16; - DrvSprites = Next; Next += 0x1000 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00100 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static UINT8 mcu_reset_r() -{ - m6805Open(0); - m68705Reset(); - m6805Close(); - - return 0; -} - -static void mcu_w(UINT8 data) -{ - MCUFromMain = data; - MCUMainSent = 1; - m6805Open(0); - m68705SetIrqLine(0, 1); - m6805Close(); -} - -static UINT8 mcu_r() -{ - MCUMcuSent = 0; - return MCUFromMcu; -} - -static UINT8 mcu_status_r() -{ - UINT8 Res = 0; - - if (DisableMCUEmulation) { - Res = 1; - } else { - if (!MCUMainSent) - Res |= 0x01; - if (!MCUMcuSent) - Res |= 0x02; - } - - return Res; -} - -struct adpcm_state -{ - INT32 signal; - INT32 step; -}; - -static INT32 DrvDoReset() -{ - M6502Open(0); - M6502Reset(); - M6502Close(); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - if (!DisableMCUEmulation) { - m6805Open(0); - m68705Reset(); - m6805Close(); - - MCUFromMain = 0; - MCUFromMcu = 0; - MCUMainSent = 0; - MCUMcuSent = 0; - MCUDdrA = 0; - MCUDdrB = 0; - MCUDdrC = 0; - MCUPortAOut = 0; - MCUPortBOut = 0; - MCUPortCOut = 0; - MCUPortAIn = 0; - MCUPortBIn = 0; - MCUPortCIn = 0; - } - - BurnYM3526Reset(); - MSM5205Reset(); - - DrvRomBank = 0; - DrvVBlank = 0; - memset(DrvScrollX, 0, 2); - DrvSoundLatch = 0; - DrvADPCMPlaying = 0; - DrvADPCMPos = 0; - DrvADPCMEnd = 0; - - return 0; -} - -UINT8 RenegadeReadByte(UINT16 Address) -{ - switch (Address) { - case 0x3800: { - return DrvInput[0]; - } - - case 0x3801: { - return DrvInput[1]; - } - - case 0x3802: { - UINT8 MCUStatus = mcu_status_r(); - if (MCUStatus) MCUStatus = (MCUStatus - 1) * 0x10; - return DrvInput[2] + DrvDip[1] + (DrvVBlank ? 0x40 : 0) + MCUStatus; - } - - case 0x3803: { - return DrvDip[0]; - } - - case 0x3804: { - if (!DisableMCUEmulation) { - return mcu_r(); - } - return 0; - } - - case 0x3805: { - if (!DisableMCUEmulation) { - return mcu_reset_r(); - } - } - - default: { - bprintf(PRINT_NORMAL, _T("M6502 Read Byte %04X\n"), Address); - } - } - - return 0; -} - -void RenegadeWriteByte(UINT16 Address, UINT8 Data) -{ - switch (Address) { - case 0x3800: { - DrvScrollX[0] = Data; - return; - } - - case 0x3801: { - DrvScrollX[1] = Data; - return; - } - - case 0x3802: { - DrvSoundLatch = Data; - M6809Open(0); - M6809SetIRQLine(M6809_IRQ_LINE, CPU_IRQSTATUS_AUTO); - M6809Close(); - return; - } - - case 0x3803: { - // flipscreen - return; - } - - case 0x3804: { - if (!DisableMCUEmulation) mcu_w(Data); - return; - } - - case 0x3805: { - DrvRomBank = Data & 1; - M6502MapMemory(DrvM6502Rom + 0x8000 + (DrvRomBank * 0x4000), 0x4000, 0x7fff, MAP_ROM); - return; - } - - case 0x3806: { - // nop - return; - } - - case 0x3807: { - // coin counter - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("M6502 Write Byte %04X, %02X\n"), Address, Data); - } - } -} - -UINT8 RenegadeM6809ReadByte(UINT16 Address) -{ - switch (Address) { - case 0x1000: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("M6809 Read Byte %04X\n"), Address); - } - } - - return 0; -} - -void RenegadeM6809WriteByte(UINT16 Address, UINT8 Data) -{ - switch (Address) { - case 0x1800: { - MSM5205ResetWrite(0, 0); - DrvADPCMPlaying = 1; - return; - } - - case 0x2000: { - switch (Data & 0x1c) { - case 0x18: DrvADPCMPos = 0 * 0x8000 * 2; break; - case 0x14: DrvADPCMPos = 1 * 0x8000 * 2; break; - case 0x0c: DrvADPCMPos = 2 * 0x8000 * 2; break; - default: DrvADPCMPos = DrvADPCMEnd = 0; return; - } - DrvADPCMPos |= (Data & 0x03) * 0x2000 * 2; - DrvADPCMEnd = DrvADPCMPos + 0x2000 * 2; - return; - } - - case 0x2800: { - BurnYM3526Write(0, Data); - return; - } - - case 0x2801: { - BurnYM3526Write(1, Data); - return; - } - - case 0x3000: { - MSM5205ResetWrite(0, 1); - DrvADPCMPlaying = 0; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("M6809 Write Byte %04X, %02X\n"), Address, Data); - } - } -} - -UINT8 MCUReadByte(UINT16 address) -{ - switch (address & 0x7ff) { - case 0x000: { - return (MCUPortAOut & MCUDdrA) | (MCUPortAIn & ~MCUDdrA); - } - - case 0x001: { - return (MCUPortBOut & MCUDdrB) | (MCUPortBIn & ~MCUDdrB); - } - - case 0x002: { - MCUPortCIn = 0; - if (MCUMainSent) MCUPortCIn |= 0x01; - if (!MCUMcuSent) MCUPortCIn |= 0x02; - - return (MCUPortCOut & MCUDdrC) | (MCUPortCIn & ~MCUDdrC); - } - - default: { - bprintf(PRINT_NORMAL, _T("MCU Read %x\n"), address); - } - } - - return 0; -} - -void MCUWriteByte(UINT16 address, UINT8 data) -{ - switch (address & 0x7ff) { - case 0x000: { - MCUPortAOut = data; - break; - } - - case 0x001: { - if ((MCUDdrB & 0x02) && (~data & 0x02) && (MCUPortBOut & 0x02)) { - MCUPortAIn = MCUFromMain; - - if (MCUMainSent) { - m68705SetIrqLine(0, 0); - MCUMainSent = 0; - } - } - - if ((MCUDdrB & 0x04) && (data & 0x04) && (~MCUPortBOut & 0x04)) { - MCUFromMcu = MCUPortAOut; - MCUMcuSent = 1; - } - - MCUPortBOut = data; - break; - } - - case 0x002: { - MCUPortCOut = data; - break; - } - - case 0x004: { - MCUDdrA = data; - break; - } - - case 0x005: { - MCUDdrB = data; - break; - } - - case 0x006: { - MCUDdrC = data; - break; - } - - default: { - bprintf(PRINT_NORMAL, _T("MCU Write %x, %x\n"), address, data); - } - } -} - -static INT32 CharPlaneOffsets[3] = { 2, 4, 6 }; -static INT32 CharXOffsets[8] = { 1, 0, 65, 64, 129, 128, 193, 192 }; -static INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 Tile1PlaneOffsets[3] = { 0x00004, 0x40000, 0x40004 }; -static INT32 Tile2PlaneOffsets[3] = { 0x00000, 0x60000, 0x60004 }; -static INT32 Tile3PlaneOffsets[3] = { 0x20004, 0x80000, 0x80004 }; -static INT32 Tile4PlaneOffsets[3] = { 0x20000, 0xa0000, 0xa0004 }; -static INT32 TileXOffsets[16] = { 3, 2, 1, 0, 131, 130, 129, 128, 259, 258, 257, 256, 387, 386, 385, 384 }; -static INT32 TileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - M6809SetIRQLine(M6809_FIRQ_LINE, CPU_IRQSTATUS_ACK); - } else { - M6809SetIRQLine(M6809_FIRQ_LINE, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)M6809TotalCycles() * nSoundRate / 1500000; -} - -static void DrvMSM5205Int() -{ - if (!DrvADPCMPlaying) { - MSM5205ResetWrite(0, 1); - return; - } - - if (DrvADPCMPos >= DrvADPCMEnd) { - MSM5205ResetWrite(0, 1); - DrvADPCMPlaying = false; - M6809SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - } else { - UINT8 const data = DrvADPCMRom[DrvADPCMPos / 2]; - MSM5205DataWrite(0, (DrvADPCMPos & 1) ? data & 0xf : data >> 4); - DrvADPCMPos++; - } -} - -static INT32 DrvInit(INT32 nMcuType) -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x60000); - - nRet = BurnLoadRom(DrvM6502Rom + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvM6502Rom + 0x08000, 1, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvM6809Rom + 0x00000, 2, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvTempRom, 3, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 3, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x60000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 9, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 3, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x00000, DrvTiles + (0x000 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x00000, DrvTiles + (0x100 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile3PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x00000, DrvTiles + (0x200 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile4PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x00000, DrvTiles + (0x300 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x18000, DrvTiles + (0x400 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x18000, DrvTiles + (0x500 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile3PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x18000, DrvTiles + (0x600 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile4PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x18000, DrvTiles + (0x700 * 16 * 16)); - - memset(DrvTempRom, 0, 0x60000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x48000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x58000, 21, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 3, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x00000, DrvSprites + (0x000 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x00000, DrvSprites + (0x100 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile3PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x00000, DrvSprites + (0x200 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile4PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x00000, DrvSprites + (0x300 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x18000, DrvSprites + (0x400 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x18000, DrvSprites + (0x500 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile3PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x18000, DrvSprites + (0x600 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile4PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x18000, DrvSprites + (0x700 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x30000, DrvSprites + (0x800 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x30000, DrvSprites + (0x900 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile3PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x30000, DrvSprites + (0xa00 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile4PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x30000, DrvSprites + (0xb00 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile1PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x48000, DrvSprites + (0xc00 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile2PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x48000, DrvSprites + (0xd00 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile3PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x48000, DrvSprites + (0xe00 * 16 * 16)); - GfxDecode(0x100, 3, 16, 16, Tile4PlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom + 0x48000, DrvSprites + (0xf00 * 16 * 16)); - - nRet = BurnLoadRom(DrvADPCMRom + 0x00000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvADPCMRom + 0x08000, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvADPCMRom + 0x10000, 24, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvM6502Ram , 0x0000, 0x17ff, MAP_RAM); - M6502MapMemory(DrvVideoRam2 , 0x1800, 0x1fff, MAP_RAM); - M6502MapMemory(DrvSpriteRam , 0x2000, 0x27ff, MAP_RAM); - M6502MapMemory(DrvVideoRam1 , 0x2800, 0x2fff, MAP_RAM); - M6502MapMemory(DrvPaletteRam1 , 0x3000, 0x30ff, MAP_RAM); - M6502MapMemory(DrvPaletteRam2 , 0x3100, 0x31ff, MAP_RAM); - M6502MapMemory(DrvM6502Rom + 0x8000 , 0x4000, 0x7fff, MAP_ROM); - M6502MapMemory(DrvM6502Rom , 0x8000, 0xffff, MAP_ROM); - M6502SetReadHandler(RenegadeReadByte); - M6502SetWriteHandler(RenegadeWriteByte); - M6502Close(); - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809Ram , 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvM6809Rom , 0x8000, 0xffff, MAP_ROM); - M6809SetReadHandler(RenegadeM6809ReadByte); - M6809SetWriteHandler(RenegadeM6809WriteByte); - M6809Close(); - - MSM5205Init(0, DrvSynchroniseStream, 12000000 / 32, DrvMSM5205Int, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - if (nMcuType == MCU_TYPE_MCU) { - nRet = BurnLoadRom(DrvM68705Rom, 25, 1); if (nRet != 0) return 1; - - m6805Init(1, 0x800); - m6805Open(0); - m6805MapMemory(DrvM68705Ram , 0x0010, 0x007f, MAP_RAM); - m6805MapMemory(DrvM68705Rom + 0x0080, 0x0080, 0x07ff, MAP_ROM); - m6805SetWriteHandler(MCUWriteByte); - m6805SetReadHandler(MCUReadByte); - m6805Close(); - } - - if (nMcuType == MCU_TYPE_NONE) { - DisableMCUEmulation = 1; - } - - BurnYM3526Init(3000000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachM6809YM3526(1500000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 RenegadeInit() -{ - return DrvInit(MCU_TYPE_MCU); -} - -static INT32 KuniokunbInit() -{ - return DrvInit(MCU_TYPE_NONE); -} - -static INT32 DrvExit() -{ - M6502Exit(); - M6809Exit(); - if (!DisableMCUEmulation) m6805Exit(); - - BurnYM3526Exit(); - MSM5205Exit(); - - GenericTilesExit(); - - BurnFree(Mem); - - memset(mcu_buffer, 0, MCU_BUFFER_MAX); - mcu_input_size = 0; - mcu_output_byte = 0; - mcu_key = 0; - - DisableMCUEmulation = 0; - - MCUFromMain = 0; - MCUFromMcu = 0; - MCUMainSent = 0; - MCUMcuSent = 0; - MCUDdrA = 0; - MCUDdrB = 0; - MCUDdrC = 0; - MCUPortAOut = 0; - MCUPortBOut = 0; - MCUPortCOut = 0; - MCUPortAIn = 0; - MCUPortBIn = 0; - MCUPortCIn = 0; - - DrvRomBank = 0; - DrvVBlank = 0; - memset(DrvScrollX, 0, 2); - DrvSoundLatch = 0; - DrvADPCMPlaying = 0; - DrvADPCMPos = 0; - DrvADPCMEnd = 0; - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 0); - g = pal4bit(nColour >> 4); - b = pal4bit(nColour >> 8); - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - for (INT32 i = 0; i < 0x100; i++) { - INT32 Val = DrvPaletteRam1[i] + (DrvPaletteRam2[i] << 8); - - DrvPalette[i] = CalcCol(Val); - } -} - -static void DrvRenderBgLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, xScroll; - - xScroll = DrvScrollX[0] + (DrvScrollX[1] << 8); - xScroll &= 0x3ff; - xScroll -= 256; - - for (my = 0; my < 16; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = DrvVideoRam1[TileIndex + 0x400]; - Code = DrvVideoRam1[TileIndex + 0x000]; - Colour = Attr >> 5; - - x = 16 * mx; - y = 16 * my; - - x -= xScroll; - if (x < -16) x += 1024; - - x -= 8; - - if (x > 0 && x < 224 && y > 0 && y < 224) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 3, 192, DrvTiles + ((Attr & 0x07) * 0x100 * 16 * 16)); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 3, 192, DrvTiles + ((Attr & 0x07) * 0x100 * 16 * 16)); - } - - TileIndex++; - } - } -} - -static void DrvRenderSprites() -{ - UINT8 *Source = DrvSpriteRam; - UINT8 *Finish = Source + 96 * 4; - - while (Source < Finish) { - INT32 sy = 240 - Source[0]; - - if (sy >= 16) { - INT32 Attr = Source[1]; - INT32 sx = Source[3]; - INT32 Code = Source[2]; - INT32 SpriteBank = Attr & 0xf; - INT32 Colour = (Attr >> 4) & 0x3; - INT32 xFlip = Attr & 0x40; - - if (sx > 248) sx -= 256; - - sx -= 8; - - if (Attr & 0x80) { - Code &= ~1; - if (sx > 16 && sx < 224 && (sy + 16) > 0 && (sy + 16) < 224) { - if (xFlip) { - Render16x16Tile_Mask_FlipX(pTransDraw, Code + 1, sx, sy + 16, Colour, 3, 0, 128, DrvSprites + (SpriteBank * 0x100 * 16 * 16)); - } else { - Render16x16Tile_Mask(pTransDraw, Code + 1, sx, sy + 16, Colour, 3, 0, 128, DrvSprites + (SpriteBank * 0x100 * 16 * 16)); - } - } else { - if (xFlip) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code + 1, sx, sy + 16, Colour, 3, 0, 128, DrvSprites + (SpriteBank * 0x100 * 16 * 16)); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code + 1, sx, sy + 16, Colour, 3, 0, 128, DrvSprites + (SpriteBank * 0x100 * 16 * 16)); - } - } - } else { - sy += 16; - } - - if (sx > 16 && sx < 224 && sy > 0 && sy < 224) { - if (xFlip) { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, 3, 0, 128, DrvSprites + (SpriteBank * 0x100 * 16 * 16)); - } else { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour, 3, 0, 128, DrvSprites + (SpriteBank * 0x100 * 16 * 16)); - } - } else { - if (xFlip) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 3, 0, 128, DrvSprites + (SpriteBank * 0x100 * 16 * 16)); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 3, 0, 128, DrvSprites + (SpriteBank * 0x100 * 16 * 16)); - } - } - } - Source += 4; - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Attr = DrvVideoRam2[TileIndex + 0x400]; - Code = ((Attr & 3) << 8) + DrvVideoRam2[TileIndex + 0x000]; - Colour = Attr >> 6; - - x = 8 * mx; - y = 8 * my; - - x -= 8; - - if (x > 0 && x < 232 && y > 0 && y < 232) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 3, 0, 0, DrvChars); - } - - TileIndex++; - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - DrvRenderBgLayer(); - DrvRenderSprites(); - DrvRenderCharLayer(); - BurnTransferCopy(DrvPalette); -} - -static void DrvInterrupt() -{ - static INT32 Count; - Count = !Count; - if (Count) { - M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); - } else { - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_AUTO); - } -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = MSM5205CalcInterleave(0, 12000000 / 8); - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = (12000000 / 8) / 60; - nCyclesTotal[1] = (12000000 / 8) / 60; - nCyclesTotal[2] = (12000000 / 4) / 60; - - INT32 nCyclesDone[3] = { 0, 0, 0 }; - INT32 nCyclesSegment; - - DrvVBlank = 0; - - M6502NewFrame(); - M6809NewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - M6502Open(0); - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += M6502Run(nCyclesSegment); - if (i == ((nInterleave / 10) * 7)) DrvVBlank = 1; - if (i == (nInterleave / 2) || i == ((nInterleave / 10) * 9)) DrvInterrupt(); - M6502Close(); - - if (!DisableMCUEmulation) { - m6805Open(0); - nCurrentCPU = 2; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += m6805Run(nCyclesSegment); - m6805Close(); - } - - M6809Open(0); - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[1] / nInterleave)); - MSM5205Update(); - M6809Close(); - } - - M6809Open(0); - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - M6809Close(); - - if (pBurnDraw) DrvDraw(); - - return 0; -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029696; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - return 0; -} - -struct BurnDriver BurnDrvRenegade = { - "renegade", NULL, NULL, NULL, "1986", - "Renegade (US)\0", NULL, "Technos (Taito America license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - RenegadeInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 240, 240, 4, 3 -}; - -struct BurnDriver BurnDrvKuniokun = { - "kuniokun", "renegade", NULL, NULL, "1986", - "Nekketsu Kouha Kunio-kun (Japan)\0", NULL, "Technos", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvjRomInfo, DrvjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - RenegadeInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 240, 240, 4, 3 -}; - -struct BurnDriver BurnDrvKuniokunb = { - "kuniokunb", "renegade", NULL, NULL, "1986", - "Nekketsu Kouha Kunio-kun (Japan bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvbRomInfo, DrvbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - KuniokunbInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 240, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_route16.cpp b/jan/src/burn/drv/pre90s/d_route16.cpp deleted file mode 100644 index 2ed5b7682..000000000 --- a/jan/src/burn/drv/pre90s/d_route16.cpp +++ /dev/null @@ -1,1231 +0,0 @@ -// FB Alpha Route 16 driver module -// Based on code by Zsolt Vasvari - -#include "burnint.h" -#include "z80_intf.h" -#include "driver.h" -#include "dac.h" -extern "C" { -#include "ay8910.h" -} -#include "sn76477.h" - -//------------------------------------------------------------------------------------------------ - -static INT32 draw_type; -static UINT8 *Mem = NULL; -static UINT8 *Rom0, *Rom1, *Prom; - -static UINT8 flipscreen, palette_1, palette_2, ttmahjng_port_select; -static INT32 speakres_vrx; - -static INT16 *pAY8910Buffer[3]; -static INT16 *pFMBuffer = NULL; - -static UINT8 DrvJoy1[24], DrvJoy2[8], Dips, DrvReset; - -//------------------------------------------------------------------------------------------------ - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p1 start" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 2, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 3, "p1 left" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 6, "p1 fire 1"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 0, "p2 start" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 1, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 2, "p2 left" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 4, "p2 down", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 5, "p2 fire 1"}, - - {"Service Mode", BIT_DIGITAL, DrvJoy1 + 7, "diag" }, - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, &Dips , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo mahjongInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 2, "p2 start"}, - {"A", BIT_DIGITAL, DrvJoy1 + 3, "mah a"}, - {"E", BIT_DIGITAL, DrvJoy1 + 4, "mah e"}, - {"I", BIT_DIGITAL, DrvJoy1 + 5, "mah i"}, - {"M", BIT_DIGITAL, DrvJoy1 + 6, "mah m"}, - {"Kan", BIT_DIGITAL, DrvJoy1 + 7, "mah kan"}, - {"B", BIT_DIGITAL, DrvJoy1 + 8, "mah b"}, - {"F", BIT_DIGITAL, DrvJoy1 + 9, "mah f"}, - {"J", BIT_DIGITAL, DrvJoy1 + 10, "mah j"}, - {"N", BIT_DIGITAL, DrvJoy1 + 11, "mah n"}, - {"Reach", BIT_DIGITAL, DrvJoy1 + 12, "mah reach"}, - {"C", BIT_DIGITAL, DrvJoy1 + 13, "mah c"}, - {"G", BIT_DIGITAL, DrvJoy1 + 14, "mah g"}, - {"K", BIT_DIGITAL, DrvJoy1 + 15, "mah k"}, - {"Chi", BIT_DIGITAL, DrvJoy1 + 16, "mah chi"}, - {"Ron", BIT_DIGITAL, DrvJoy1 + 17, "mah ron"}, - {"D", BIT_DIGITAL, DrvJoy1 + 18, "mah d"}, - {"H", BIT_DIGITAL, DrvJoy1 + 19, "mah h"}, - {"L", BIT_DIGITAL, DrvJoy1 + 20, "mah l"}, - {"Pon", BIT_DIGITAL, DrvJoy1 + 21, "mah pon"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, -}; - -STDINPUTINFO(mahjong) - - - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0f, 0x01, 0x01, 0x00, "3" }, - {0x0f, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 3 , "Coinage" }, - {0x0f, 0x01, 0x18, 0x08, "2C_1C" }, - {0x0f, 0x01, 0x18, 0x00, "1C_1C" }, - {0x0f, 0x01, 0x18, 0x18, "1C_2C" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x20, 0x20, "Upright" }, - {0x0f, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x80, 0x00, "Off" }, - {0x0f, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo stratvoxDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0f, 0x01, 0x01, 0x00, "3" }, - {0x0f, 0x01, 0x01, 0x01, "5" }, - - {0 , 0xfe, 0 , 2 , "Replenish Astronauts" }, - {0x0f, 0x01, 0x02, 0x00, "No" }, - {0x0f, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 4 , "2 Attackers At Wave" }, - {0x0f, 0x01, 0x0c, 0x00, "2" }, - {0x0f, 0x01, 0x0c, 0x04, "3" }, - {0x0f, 0x01, 0x0c, 0x08, "4" }, - {0x0f, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 2 , "Astronauts Kidnapped" }, - {0x0f, 0x01, 0x10, 0x00, "Less Often" }, - {0x0f, 0x01, 0x10, 0x10, "More Often" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x20, 0x20, "Upright" }, - {0x0f, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Voices" }, - {0x0f, 0x01, 0x80, 0x00, "Off" }, - {0x0f, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(stratvox) - -static struct BurnDIPInfo speakresDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x03, 0x00, "3" }, - {0x0f, 0x01, 0x03, 0x01, "4" }, - {0x0f, 0x01, 0x03, 0x02, "5" }, - {0x0f, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4 , "2 Attackers At Wave" }, - {0x0f, 0x01, 0x0c, 0x00, "2" }, - {0x0f, 0x01, 0x0c, 0x04, "3" }, - {0x0f, 0x01, 0x0c, 0x08, "4" }, - {0x0f, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0f, 0x01, 0x10, 0x00, "5000" }, - {0x0f, 0x01, 0x10, 0x10, "8000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x20, 0x20, "Upright" }, - {0x0f, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Voices" }, - {0x0f, 0x01, 0x80, 0x00, "Off" }, - {0x0f, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(speakres) - - -//------------------------------------------------------------------------------------------------ - -static UINT8 ttmahjng_input_port_matrix_r() -{ - UINT8 ret = 0; - - switch (ttmahjng_port_select) - { - case 1: { - for (INT32 i = 0; i < 5; i++) ret |= DrvJoy1[ 3 + i] << i; - ret |= DrvJoy1[1] << 5; - } - break; - case 2: { - for (INT32 i = 0; i < 5; i++) ret |= DrvJoy1[ 8 + i] << i; - ret |= DrvJoy1[2] << 5; - } - break; - case 4: { - for (INT32 i = 0; i < 5; i++) ret |= DrvJoy1[13 + i] << i; - } - break; - case 8: { - for (INT32 i = 0; i < 4; i++) ret |= DrvJoy1[18 + i] << i; - } - break; - default: break; - } - - return ~ret; -} - - -UINT8 __fastcall route16_cpu0_read(UINT16 offset) -{ - UINT8 nRet = 0; - - switch (offset) - { - case 0x4800: - return Dips; - - case 0x5000: - { - if (draw_type == 1) { // ttmahjng - nRet = (DrvJoy1[0] << 7) ^ 0xff; - } else { - if (DrvJoy1[2]) nRet |= 0x01; - if (DrvJoy1[3]) nRet |= 0x02; - if (DrvJoy1[4]) nRet |= 0x04; - if (DrvJoy1[5]) nRet |= 0x08; - if (DrvJoy1[6]) nRet |= 0x10; - if (DrvJoy1[7]) nRet |= 0x40; // service mode - if (DrvJoy1[0]) nRet |= 0x80; // coin - } - return nRet; - } - - - case 0x5800: - { - if (draw_type == 1) { // ttmahjng - nRet = ttmahjng_input_port_matrix_r(); - } else { - if (DrvJoy2[1]) nRet |= 0x01; - if (DrvJoy2[2]) nRet |= 0x02; - if (DrvJoy2[3]) nRet |= 0x04; - if (DrvJoy2[4]) nRet |= 0x08; - if (DrvJoy2[5]) nRet |= 0x10; - if (DrvJoy2[0]) nRet |= 0x40; // start 2 - if (DrvJoy1[1]) nRet |= 0x80; // start 1 - } - - return nRet; - } - - case 0x6000: // speakres - { - INT32 bit2=4, bit1=2, bit0=1; - - // just using a counter, the constants are the number of reads - // before going low, each read is 40 cycles apart. the constants - // were chosen based on the startup tests and for vr0=vr2 - speakres_vrx++; - if(speakres_vrx>0x300) bit0=0; /* VR0 100k ohm - speech */ - if(speakres_vrx>0x200) bit1=0; /* VR1 50k ohm - main volume */ - if(speakres_vrx>0x300) bit2=0; /* VR2 100k ohm - explosion */ - - return 0xf8|bit2|bit1|bit0; - } - - case 0x6400: // routex - { - if (ZetGetPC(-1) == 0x2f) - return 0xfb; - else - return 0; - } - } - - return 0; -} - - -void __fastcall route16_cpu0_write(UINT16 offset, UINT8 data) -{ - if (offset >= 0x4000 && offset < 0x4400) { - Rom0[offset] = data; - - // 4313-4319 are used in Route 16 as triggers to wake the other CPU - if (offset >= 0x4313 && offset <= 0x4319 && data == 0xff) - { - // Let the other CPU run - // cpu_yield(); - ZetRunEnd(); // Correct? - } - - return; - } - - switch (offset) - { - case 0x2800: // stratvox - DACWrite(0, data); - break; - - case 0x4800: - palette_1 = data & 0x1f; - break; - - case 0x5000: - palette_2 = data & 0x1f; - flipscreen = (data >> 5) & 0x01; - break; - - case 0x5800: // speakres, ttmahjng - ttmahjng_port_select = data; - speakres_vrx = 0; - break; - - case 0x6800: // ttmahjng - AY8910Write(0, 1, data); - break; - - case 0x6900: // ttmahjng - AY8910Write(0, 0, data); - break; - } -} - -void __fastcall route16_cpu0_out(UINT16 offset, UINT8 data) -{ - switch (offset & 0x1ff) - { - case 0x000: - AY8910Write(0, 1, data); - break; - - case 0x100: - AY8910Write(0, 0, data); - break; - } -} - - -static INT32 GetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *Rom0Load = Rom0; - UINT8 *Rom1Load = Rom1; - UINT8 *PromLoad = Prom; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(Rom0Load, i, 1)) return 1; - Rom0Load += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(Rom1Load, i, 1)) return 1; - Rom1Load += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(PromLoad, i, 1)) return 1; - PromLoad += ri.nLen; - continue; - } - } - - return 0; -} - - -static INT32 DrvDoReset() -{ - flipscreen = palette_1 = palette_2 = ttmahjng_port_select = 0; - speakres_vrx = 0; - - DrvReset = 0; - - memset (Rom0 + 0x4000, 0, 0xc000); // Shared & video ram - memset (Rom1 + 0x8000, 0, 0x4000); - - ZetOpen(0); - ZetReset(); - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - return 0; -} - -void stratvox_sn76477_write(UINT32, UINT32 data) -{ - - SN76477_enable_w(0, (data >> 0) & 1); - SN76477_vco_w(0, (data >> 1) & 1); - SN76477_envelope_1_w(0, (data >> 2) & 1); - SN76477_envelope_2_w(0, (data >> 3) & 1); - SN76477_mixer_a_w(0, (data >> 4) & 1); - SN76477_mixer_b_w(0, (data >> 5) & 1); - SN76477_mixer_c_w(0, (data >> 6) & 1); -#if 0 - SN76477_mixer_w(0,(data >> 4) & 7); - SN76477_envelope_w(0,(data >> 2) & 3); - SN76477_vco_w(0,(data >> 1) & 1); - SN76477_enable_w(0,data & 1); -#endif - -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (2500000.000 / (nBurnFPS / 100.000)))); -} - -static INT32 DrvInit() -{ - Mem = (UINT8*)BurnMalloc(0x10000 + 0x10000 + 0x200); - if (Mem == NULL) { - return 1; - } - - pFMBuffer = (INT16 *)BurnMalloc (nBurnSoundLen * 3 * sizeof(INT16)); - if (pFMBuffer == NULL) { - return 1; - } - - Rom0 = Mem + 0x00000; - Rom1 = Mem + 0x10000; - Prom = Mem + 0x20000; - - // Load Roms - if (GetRoms()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetSetOutHandler(route16_cpu0_out); - ZetSetReadHandler(route16_cpu0_read); - ZetSetWriteHandler(route16_cpu0_write); - ZetMapArea (0x0000, 0x3fff, 0, Rom0 + 0x0000); // ROM - ZetMapArea (0x0000, 0x3fff, 2, Rom0 + 0x0000); - ZetMapArea (0x4000, 0x43ff, 0, Rom0 + 0x4000); // Read Shared RAM - ZetMapArea (0x8000, 0xbfff, 0, Rom0 + 0x8000); // Video RAM - ZetMapArea (0x8000, 0xbfff, 1, Rom0 + 0x8000); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetWriteHandler(route16_cpu0_write); - ZetMapArea (0x0000, 0x1fff, 0, Rom1 + 0x0000); // ROM - ZetMapArea (0x0000, 0x1fff, 2, Rom1 + 0x0000); - ZetMapArea (0x4000, 0x43ff, 0, Rom0 + 0x4000); // Read Shared RAM - ZetMapArea (0x8000, 0xbfff, 0, Rom1 + 0x8000); // Video RAM - ZetMapArea (0x8000, 0xbfff, 1, Rom1 + 0x8000); - ZetClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - - SN76477_init(0); - SN76477_set_noise_res(0, RES_K(47)); - SN76477_set_filter_res(0, RES_K(150)); - SN76477_set_filter_cap(0, CAP_U(0.001)); - SN76477_set_decay_res(0, RES_M(3.3)); - SN76477_set_attack_decay_cap(0, CAP_U(1.0)); - SN76477_set_attack_res(0, RES_K(4.7)); - SN76477_set_amplitude_res(0, RES_K(200)); - SN76477_set_feedback_res(0, RES_K(55)); - SN76477_set_oneshot_res(0, RES_K(4.7)); - SN76477_set_oneshot_cap(0, CAP_U(2.2)); - SN76477_set_pitch_voltage(0, 5.0); - SN76477_set_slf_res(0, RES_K(75)); - SN76477_set_slf_cap(0, CAP_U(1.0)); - SN76477_set_vco_res(0, RES_K(100)); - SN76477_set_vco_cap(0, CAP_U(0.022)); - SN76477_set_vco_voltage(0, 5.0*2/(2+10)); - SN76477_mixer_w(0, 0); - SN76477_envelope_w(0, 0); - - SN76477_set_mastervol(0, 1.00); - - AY8910Init(0, 1250000, nBurnSoundRate, NULL, NULL, &stratvox_sn76477_write, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - - -static INT32 DrvExit() -{ - DACExit(); - ZetExit(); - AY8910Exit(0); - SN76477_exit(0); - - BurnFree (Mem); - BurnFree (pFMBuffer); - - draw_type = 0; - - pFMBuffer = NULL; - Mem = NULL; - Rom0 = Rom1 = Prom = NULL; - pAY8910Buffer[0] = pAY8910Buffer[1] = pAY8910Buffer[2] = NULL; - - return 0; -} - - -//------------------------------------------------------------------------------------------------ -// Drawing functions - -static inline UINT32 route16_make_pen(UINT8 color) -{ - UINT32 ret = 0; - if (color & 1) ret |= 0x00ff0000; - if (color & 2) ret |= 0x0000ff00; - if (color & 4) ret |= 0x000000ff; - return ret; -} - - -static inline UINT32 ttmajng_make_pen(UINT8 color) -{ - UINT32 ret = 0; - if (color & 4) ret |= 0x00ff0000; - if (color & 2) ret |= 0x0000ff00; - if (color & 1) ret |= 0x000000ff; - return ret; -} - - -static INT32 DrvDraw() -{ - UINT8 *prom1 = Prom + 0x0000; - UINT8 *prom2 = Prom + 0x0100; - - for (INT32 offs = 0; offs < 0x4000; offs++) - { - UINT8 y = offs >> 6; - UINT8 x = offs << 2; - - UINT8 d1 = Rom0[0x8000 + offs]; - UINT8 d2 = Rom1[0x8000 + offs]; - - for (INT32 i = 0; i < 4; i++) - { - UINT8 color1, color2; - - // stratvox & ttmahjng - if (draw_type) { - color1 = prom1[(palette_1 << 2) | ((d1 >> 3) & 2) | (d1 & 1)]; - color2 = prom2[(((d1 << 3) & 0x80) | ((d1 << 7) & 0x80)) | (palette_2 << 2) | ((d2 >> 3) & 2) | (d2 & 1)]; - } else { - color1 = prom1[((palette_1 << 6) & 0x80) | (palette_1 << 2) | ((d1 >> 3) & 0x02) | ((d1 >> 0) & 0x01)]; - color2 = prom2[((palette_2 << 6) & 0x80) | (((color1 << 6) & 0x80) | ((color1 << 7) & 0x80)) | (palette_2 << 2) | ((d2 >> 3) & 2) | (d2 & 1)]; - } - - UINT8 final_color = color1 | color2; - - UINT32 pen; - if (draw_type == 1) { - pen = ttmajng_make_pen(final_color); - } else { - pen = route16_make_pen(final_color); - } - - if (flipscreen) - PutPix(pBurnDraw + ((x << 8) | (y ^ 0xff)) * nBurnBpp, BurnHighCol((pen>>16)&0xff, (pen>>8)&0xff, (pen)&0xff, 0)); - else - PutPix(pBurnDraw + (((x ^ 0xff) << 8) | y) * nBurnBpp, BurnHighCol((pen>>16)&0xff, (pen>>8)&0xff, (pen)&0xff, 0)); - - x += 1; - d1 >>= 1; - d2 >>= 1; - } - } - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 100; - - INT32 DACIRQFireSlice[48]; - for (INT32 i = 0; i < 48; i++) { - DACIRQFireSlice[i] = (INT32)((double)((nInterleave * (i + 1)) / 49)); - } - - INT32 nCyclesSegment; - INT32 nCyclesDone[2], nCyclesTotal[2]; - - nCyclesTotal[0] = 2500000 / 60; - nCyclesTotal[1] = 2500000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #0 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i+1 == nInterleave) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - // Run Z80 #1 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (draw_type == 3) { // space echo - for (INT32 j = 0; j < 48; j++) { - if (i == DACIRQFireSlice[j]) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - } - } - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - SN76477_sound_update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - SN76477_sound_update(0, pSoundBuf, nSegmentLength); - } - - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -//------------------------------------------------------------------------------------------------ -// Savestates - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = Rom0 + 0x4000; - ba.nLen = 0x0400; - ba.szName = "Shared RAM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = Rom0 + 0x8000; - ba.nLen = 0x4000; - ba.szName = "Cpu0 Video RAM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = Rom1 + 0x8000; - ba.nLen = 0x4000; - ba.szName = "Cpu1 Video RAM"; - BurnAcb(&ba); - - ZetScan(nAction); // Scan Z80 - AY8910Scan(nAction, pnMin); // Scan AY8910 - - // Scan critical driver variables - SCAN_VAR(flipscreen); - SCAN_VAR(palette_1); - SCAN_VAR(palette_2); - SCAN_VAR(ttmahjng_port_select); - SCAN_VAR(speakres_vrx); - } - - return 0; -} - - -//------------------------------------------------------------------------------------------------ -// Drivers - - -// Route 16 (set 1) - -static struct BurnRomInfo route16RomDesc[] = { - { "tvg54.a0", 0x0800, 0xaef9ffc1, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "tvg55.a1", 0x0800, 0x389bc077, 1 | BRF_ESS | BRF_PRG }, // 1 - { "tvg56.a2", 0x0800, 0x1065a468, 1 | BRF_ESS | BRF_PRG }, // 2 - { "tvg57.a3", 0x0800, 0x0b1987f3, 1 | BRF_ESS | BRF_PRG }, // 3 - { "tvg58.a4", 0x0800, 0xf67d853a, 1 | BRF_ESS | BRF_PRG }, // 4 - { "tvg59.a5", 0x0800, 0xd85cf758, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "tvg60.b0", 0x0800, 0x0f9588a7, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "tvg61.b1", 0x0800, 0x2b326cf9, 2 | BRF_ESS | BRF_PRG }, // 7 - { "tvg62.b2", 0x0800, 0x529cad13, 2 | BRF_ESS | BRF_PRG }, // 8 - { "tvg63.b3", 0x0800, 0x3bd8b899, 2 | BRF_ESS | BRF_PRG }, // 9 - - { "mb7052.59", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 10 Graphics - { "mb7052.61", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(route16) -STD_ROM_FN(route16) - -static INT32 route16Init() -{ - INT32 nRet; - - draw_type = 0; - - nRet = DrvInit(); - - if (nRet == 0) - { - // Patch protection - Rom0[0x0105] = 0x00; // jp nz,$4109 (nirvana) - NOP's in route16c - Rom0[0x0106] = 0x00; - Rom0[0x0107] = 0x00; - - Rom0[0x072a] = 0x00; // jp nz,$4238 (nirvana) - Rom0[0x072b] = 0x00; - Rom0[0x072c] = 0x00; - - Rom0[0x00e9] = 0x3a; - - Rom0[0x0754] = 0xc3; - Rom0[0x0755] = 0x63; - Rom0[0x0756] = 0x07; - } - - return nRet; -} - -struct BurnDriver BurnDrvroute16 = { - "route16", NULL, NULL, NULL, "1981", - "Route 16 (set 1)\0", NULL, "Tehkan/Sun (Centuri license)", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, route16RomInfo, route16RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - route16Init, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Route 16 (set 2) - -static struct BurnRomInfo route16aRomDesc[] = { - { "vg-54", 0x0800, 0x0c966319, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "vg-55", 0x0800, 0xa6a8c212, 1 | BRF_ESS | BRF_PRG }, // 1 - { "vg-56", 0x0800, 0x5c74406a, 1 | BRF_ESS | BRF_PRG }, // 2 - { "vg-57", 0x0800, 0x313e68ab, 1 | BRF_ESS | BRF_PRG }, // 3 - { "vg-58", 0x0800, 0x40824e3c, 1 | BRF_ESS | BRF_PRG }, // 4 - { "vg-59", 0x0800, 0x9313d2c2, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "route16.b0", 0x0800, 0x0f9588a7, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "vg-61", 0x0800, 0xb216c88c, 2 | BRF_ESS | BRF_PRG }, // 7 - { "route16.b2", 0x0800, 0x529cad13, 2 | BRF_ESS | BRF_PRG }, // 8 - { "route16.b3", 0x0800, 0x3bd8b899, 2 | BRF_ESS | BRF_PRG }, // 9 - - { "im5623.f10", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 10 Graphics - { "im5623.f12", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(route16a) -STD_ROM_FN(route16a) - -static INT32 route16aInit() -{ - INT32 nRet; - - draw_type = 0; - - nRet = DrvInit(); - - if (nRet == 0) - { - // Patch protection - Rom0[0x00e9] = 0x3a; - - Rom0[0x0105] = 0x00; // jp nz,$4109 (nirvana) - NOP's in route16c - Rom0[0x0106] = 0x00; - Rom0[0x0107] = 0x00; - - Rom0[0x0731] = 0x00; // jp nz,$4238 (nirvana) - Rom0[0x0732] = 0x00; - Rom0[0x0733] = 0x00; - - Rom0[0x0747] = 0xc3; - Rom0[0x0748] = 0x56; - Rom0[0x0749] = 0x07; - } - - return nRet; -} - -struct BurnDriver BurnDrvroute16a = { - "route16a", "route16", NULL, NULL, "1981", - "Route 16 (set 2)\0", NULL, "Tehkan/Sun (Centuri license)", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, route16aRomInfo, route16aRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - route16aInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Route 16 (set 3, bootleg?) - -static struct BurnRomInfo route16cRomDesc[] = { - { "route16.a0", 0x0800, 0x8f9101bd, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "route16.a1", 0x0800, 0x389bc077, 1 | BRF_ESS | BRF_PRG }, // 1 - { "route16.a2", 0x0800, 0x1065a468, 1 | BRF_ESS | BRF_PRG }, // 2 - { "route16.a3", 0x0800, 0x0b1987f3, 1 | BRF_ESS | BRF_PRG }, // 3 - { "route16.a4", 0x0800, 0xf67d853a, 1 | BRF_ESS | BRF_PRG }, // 4 - { "route16.a5", 0x0800, 0xd85cf758, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "route16.b0", 0x0800, 0x0f9588a7, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "route16.b1", 0x0800, 0x2b326cf9, 2 | BRF_ESS | BRF_PRG }, // 7 - { "route16.b2", 0x0800, 0x529cad13, 2 | BRF_ESS | BRF_PRG }, // 8 - { "route16.b3", 0x0800, 0x3bd8b899, 2 | BRF_ESS | BRF_PRG }, // 9 - - { "im5623.f10", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 10 Graphics - { "im5623.f12", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(route16c) -STD_ROM_FN(route16c) - -static INT32 route16cInit() -{ - INT32 nRet; - - draw_type = 0; - - nRet = DrvInit(); - - if (nRet == 0) - { - // Patch protection - Rom0[0x00e9] = 0x3a; - Rom0[0x0754] = 0xc3; - Rom0[0x0755] = 0x63; - Rom0[0x0756] = 0x07; - } - - return nRet; -} - -struct BurnDriver BurnDrvroute16c = { - "route16c", "route16", NULL, NULL, "1981", - "Route 16 (set 3, bootleg?)\0", NULL, "Tehkan/Sun (Centuri license)", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, route16cRomInfo, route16cRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - route16cInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Route 16 (bootleg) - -static struct BurnRomInfo route16blRomDesc[] = { - { "rt16.0", 0x0800, 0xb1f0f636, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "rt16.1", 0x0800, 0x3ec52fe5, 1 | BRF_ESS | BRF_PRG }, // 1 - { "rt16.2", 0x0800, 0xa8e92871, 1 | BRF_ESS | BRF_PRG }, // 2 - { "rt16.3", 0x0800, 0xa0fc9fc5, 1 | BRF_ESS | BRF_PRG }, // 3 - { "rt16.4", 0x0800, 0x6dcaf8c4, 1 | BRF_ESS | BRF_PRG }, // 4 - { "rt16.5", 0x0800, 0x63d7b05b, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "rt16.6", 0x0800, 0xfef605f3, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "rt16.7", 0x0800, 0xd0d6c189, 2 | BRF_ESS | BRF_PRG }, // 7 - { "rt16.8", 0x0800, 0xdefc5797, 2 | BRF_ESS | BRF_PRG }, // 8 - { "rt16.9", 0x0800, 0x88d94a66, 2 | BRF_ESS | BRF_PRG }, // 9 - - { "im5623.f10", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 10 Graphics - { "im5623.f12", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(route16bl) -STD_ROM_FN(route16bl) - -static INT32 route16blInit() -{ - draw_type = 0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvroute16bl = { - "route16bl", "route16", NULL, NULL, "1981", - "Route 16 (bootleg)\0", NULL, "bootleg (Leisure and Allied)", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, route16blRomInfo, route16blRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - route16blInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Route X (bootleg) - -static struct BurnRomInfo routexRomDesc[] = { - { "routex01.a0", 0x0800, 0x99b500e7, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "rt16.1", 0x0800, 0x3ec52fe5, 1 | BRF_ESS | BRF_PRG }, // 1 - { "rt16.2", 0x0800, 0xa8e92871, 1 | BRF_ESS | BRF_PRG }, // 2 - { "rt16.3", 0x0800, 0xa0fc9fc5, 1 | BRF_ESS | BRF_PRG }, // 3 - { "routex05.a4", 0x0800, 0x2fef7653, 1 | BRF_ESS | BRF_PRG }, // 4 - { "routex06.a5", 0x0800, 0xa39ef648, 1 | BRF_ESS | BRF_PRG }, // 5 - { "routex07.a6", 0x0800, 0x89f80c1c, 1 | BRF_ESS | BRF_PRG }, // 6 - - { "routex11.b0", 0x0800, 0xb51edd1d, 2 | BRF_ESS | BRF_PRG }, // 7 Z80 #1 Code - { "rt16.7", 0x0800, 0xd0d6c189, 2 | BRF_ESS | BRF_PRG }, // 8 - { "rt16.8", 0x0800, 0xdefc5797, 2 | BRF_ESS | BRF_PRG }, // 9 - { "rt16.9", 0x0800, 0x88d94a66, 2 | BRF_ESS | BRF_PRG }, // 10 - - { "im5623.f10", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 11 Graphics - { "im5623.f12", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(routex) -STD_ROM_FN(routex) - -struct BurnDriver BurnDrvroutex = { - "routex", "route16", NULL, NULL, "1981", - "Route X (bootleg)\0", NULL, "bootleg", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, routexRomInfo, routexRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - route16blInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Speak & Rescue - -static struct BurnRomInfo speakresRomDesc[] = { - { "speakres.1", 0x0800, 0x6026e4ea, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "speakres.2", 0x0800, 0x93f0d4da, 1 | BRF_ESS | BRF_PRG }, // 1 - { "speakres.3", 0x0800, 0xa3874304, 1 | BRF_ESS | BRF_PRG }, // 2 - { "speakres.4", 0x0800, 0xf484be3a, 1 | BRF_ESS | BRF_PRG }, // 3 - { "speakres.5", 0x0800, 0x61b12a67, 1 | BRF_ESS | BRF_PRG }, // 4 - { "speakres.6", 0x0800, 0x220e0ab2, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "speakres.7", 0x0800, 0xd417be13, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "speakres.8", 0x0800, 0x52485d60, 2 | BRF_ESS | BRF_PRG }, // 7 - - { "im5623.f10", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 8 Graphics - { "im5623.f12", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(speakres) -STD_ROM_FN(speakres) - -static INT32 speakresInit() -{ - draw_type = 2; - - return DrvInit(); -} - -struct BurnDriver BurnDrvspeakres = { - "speakres", NULL, NULL, NULL, "1980", - "Speak & Rescue\0", NULL, "Sun Electronics", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, speakresRomInfo, speakresRomName, NULL, NULL, DrvInputInfo, speakresDIPInfo, - speakresInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Speak & Rescue (bootleg) - -static struct BurnRomInfo speakresbRomDesc[] = { - { "hmi1.27", 0x0800, 0x6026e4ea, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "hmi2.28", 0x0800, 0x93f0d4da, 1 | BRF_ESS | BRF_PRG }, // 1 - { "hmi3.29", 0x0800, 0xa3874304, 1 | BRF_ESS | BRF_PRG }, // 2 - { "hmi4.30", 0x0800, 0xf484be3a, 1 | BRF_ESS | BRF_PRG }, // 3 - { "hmi5.31", 0x0800, 0xaa2aaabe, 1 | BRF_ESS | BRF_PRG }, // 4 - { "hmi6.32", 0x0800, 0x220e0ab2, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "hmi.33", 0x0800, 0xbeafe7c5, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "hmi.34", 0x0800, 0x12ecd87b, 2 | BRF_ESS | BRF_PRG }, // 7 - - { "hmi.62", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 8 Graphics - { "hmi.64", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(speakresb) -STD_ROM_FN(speakresb) - -struct BurnDriver BurnDrvspeakresb = { - "speakresb", "speakres", NULL, NULL, "1980", - "Speak & Rescue (bootleg)\0", NULL, "bootleg", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, speakresbRomInfo, speakresbRomName, NULL, NULL, DrvInputInfo, speakresDIPInfo, - speakresInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Stratovox - -static struct BurnRomInfo stratvoxRomDesc[] = { - { "ls01.bin", 0x0800, 0xbf4d582e, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "ls02.bin", 0x0800, 0x16739dd4, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ls03.bin", 0x0800, 0x083c28de, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ls04.bin", 0x0800, 0xb0927e3b, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ls05.bin", 0x0800, 0xccd25c4e, 1 | BRF_ESS | BRF_PRG }, // 4 - { "ls06.bin", 0x0800, 0x07a907a7, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "ls07.bin", 0x0800, 0x4d333985, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "ls08.bin", 0x0800, 0x35b753fc, 2 | BRF_ESS | BRF_PRG }, // 7 - - { "im5623.f10", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 8 Graphics - { "im5623.f12", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(stratvox) -STD_ROM_FN(stratvox) - -struct BurnDriver BurnDrvstratvox = { - "stratvox", "speakres", NULL, NULL, "1980", - "Stratovox\0", NULL, "[Sun Electronics] (Taito license)", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, stratvoxRomInfo, stratvoxRomName, NULL, NULL, DrvInputInfo, stratvoxDIPInfo, - speakresInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Stratovox (bootleg) - -static struct BurnRomInfo stratvobRomDesc[] = { - { "j0-1", 0x0800, 0x93c78274, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "j0-2", 0x0800, 0x93b2b02d, 1 | BRF_ESS | BRF_PRG }, // 1 - { "j0-3", 0x0800, 0x655facb5, 1 | BRF_ESS | BRF_PRG }, // 2 - { "j0-4", 0x0800, 0xb0927e3b, 1 | BRF_ESS | BRF_PRG }, // 3 - { "j0-5", 0x0800, 0x9d2178d9, 1 | BRF_ESS | BRF_PRG }, // 4 - { "j0-6", 0x0800, 0x79118ffc, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "b0-a", 0x0800, 0x4d333985, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "j0-a", 0x0800, 0x3416a830, 2 | BRF_ESS | BRF_PRG }, // 7 - - { "im5623.f10", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 8 Graphics - { "im5623.f12", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(stratvob) -STD_ROM_FN(stratvob) - -struct BurnDriver BurnDrvstratvob = { - "stratvoxb", "speakres", NULL, NULL, "1980", - "Stratovox (bootleg)\0", NULL, "bootleg", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, stratvobRomInfo, stratvobRomName, NULL, NULL, DrvInputInfo, stratvoxDIPInfo, - speakresInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Space Echo (set 1) - -static struct BurnRomInfo spacechoRomDesc[] = { - { "rom.a0", 0x0800, 0x40d74dce, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "rom.a1", 0x0800, 0xa5f0a34f, 1 | BRF_ESS | BRF_PRG }, // 1 - { "rom.a2", 0x0800, 0xcbbb3acb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "rom.a3", 0x0800, 0x311050ca, 1 | BRF_ESS | BRF_PRG }, // 3 - { "rom.a4", 0x0800, 0x28943803, 1 | BRF_ESS | BRF_PRG }, // 4 - { "rom.a5", 0x0800, 0x851c9f28, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "rom.b0", 0x0800, 0xdb45689d, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "rom.b2", 0x0800, 0x1e074157, 2 | BRF_ESS | BRF_PRG }, // 7 - { "rom.b3", 0x0800, 0xd50a8b20, 2 | BRF_ESS | BRF_PRG }, // 8 - - { "im5623.f10", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 9 Graphics - { "im5623.f12", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(spacecho) -STD_ROM_FN(spacecho) - -static INT32 spacechoInit() -{ - INT32 nRet; - - draw_type = 3; - - nRet = DrvInit(); - - memcpy (Rom1 + 0x1000, Rom1 + 0x800, 0x1000); - - return nRet; -} - -struct BurnDriver BurnDrvspacecho = { - "spacecho", "speakres", NULL, NULL, "1980", - "Space Echo (set 1)\0", NULL, "bootleg (Gayton Games)", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, spacechoRomInfo, spacechoRomName, NULL, NULL, DrvInputInfo, stratvoxDIPInfo, - spacechoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// Space Echo (set 2) - -static struct BurnRomInfo spacecho2RomDesc[] = { - { "c11.5.6t", 0x0800, 0x90637f25, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "c2.5t", 0x0800, 0xa5f0a34f, 1 | BRF_ESS | BRF_PRG }, // 1 - { "c3.4.5t", 0x0800, 0xcbbb3acb, 1 | BRF_ESS | BRF_PRG }, // 2 - { "c4.4t", 0x0800, 0x311050ca, 1 | BRF_ESS | BRF_PRG }, // 3 - { "cb5.3t", 0x0800, 0x28943803, 1 | BRF_ESS | BRF_PRG }, // 4 - { "cb6.2.3t", 0x0800, 0x851c9f28, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "cb7.5b", 0x0800, 0xdb45689d, 2 | BRF_ESS | BRF_PRG }, // 6 Z80 #1 Code - { "cb9.4b", 0x0800, 0x1e074157, 2 | BRF_ESS | BRF_PRG }, // 7 - { "cb10.3b", 0x0800, 0xd50a8b20, 2 | BRF_ESS | BRF_PRG }, // 8 - - { "mb7052.6k", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 9 Graphics - { "mb7052.6m", 0x0100, 0x08793ef7, 3 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(spacecho2) -STD_ROM_FN(spacecho2) - -struct BurnDriver BurnDrvspacecho2 = { - "spacecho2", "speakres", NULL, NULL, "1980", - "Space Echo (set 2)\0", NULL, "bootleg (Gayton Games)", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, spacecho2RomInfo, spacecho2RomName, NULL, NULL, DrvInputInfo, stratvoxDIPInfo, - spacechoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 3, 4 -}; - - -// T.T Mahjong - -static struct BurnRomInfo ttmahjngRomDesc[] = { - { "ju04", 0x1000, 0xfe7c693a, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "ju05", 0x1000, 0x985723d3, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ju06", 0x1000, 0x2cd69bc8, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ju07", 0x1000, 0x30e8ec63, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "ju01", 0x0800, 0x0f05ca3c, 2 | BRF_ESS | BRF_PRG }, // 4 Z80 #1 Code - { "ju02", 0x0800, 0xc1ffeceb, 2 | BRF_ESS | BRF_PRG }, // 5 - { "ju08", 0x0800, 0x2dcc76b5, 2 | BRF_ESS | BRF_PRG }, // 6 - - { "ju03", 0x0100, 0x27d47624, 3 | BRF_GRA }, // 7 Graphics - { "ju09", 0x0100, 0x27d47624, 3 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(ttmahjng) -STD_ROM_FN(ttmahjng) - -static INT32 ttmahjngInit() -{ - draw_type = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvttmahjng = { - "ttmahjng", NULL, NULL, NULL, "1980", - "T.T Mahjong\0", NULL, "Taito", "Route 16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MAHJONG, 0, - NULL, ttmahjngRomInfo, ttmahjngRomName, NULL, NULL, mahjongInputInfo, NULL, - ttmahjngInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 256, 4, 3 -}; - - diff --git a/jan/src/burn/drv/pre90s/d_rpunch.cpp b/jan/src/burn/drv/pre90s/d_rpunch.cpp deleted file mode 100644 index e795c5190..000000000 --- a/jan/src/burn/drv/pre90s/d_rpunch.cpp +++ /dev/null @@ -1,1172 +0,0 @@ -// FB Alpha Rabio Lepus / Super Volleyball driver module -// Based on MAME driver by Aaron Giles - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "upd7759.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *DrvBMPRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT8 *soundlatch; -static UINT8 *sound_busy; -static UINT8 *sound_bank; -static UINT8 *sound_irq; -static UINT8 *sprite_offs; - -static UINT16 *DrvScrRegs; -static UINT16 *DrvVidRegs; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static INT32 crtc_register; -static INT32 crtc_timer; - -static INT32 game_select; - -static struct BurnInputInfo RpunchInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Rpunch) - -static struct BurnDIPInfo RpunchDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 12, "Coin A" }, - {0x12, 0x01, 0x0f, 0x0d, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "6 Coins/4 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "5 Coins/6 Credits" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 12, "Coin B" }, - {0x12, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "6 Coins/4 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "5 Coins/6 Credits" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x00, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x04, 0x00, "2" }, - {0x13, 0x01, 0x04, 0x04, "3" }, - - {0 , 0xfe, 0 , 2, "Laser" }, - {0x13, 0x01, 0x08, 0x00, "Manual" }, - {0x13, 0x01, 0x08, 0x08, "Semi-Automatic" }, - - {0 , 0xfe, 0 , 2, "Extended Play" }, - {0x13, 0x01, 0x10, 0x00, "500000 points" }, - {0x13, 0x01, 0x10, 0x10, "None" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Rpunch) - -static struct BurnDIPInfo RabiolepDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 12, "Coin A" }, - {0x12, 0x01, 0x0f, 0x0d, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "6 Coins/4 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "5 Coins/6 Credits" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 12, "Coin B" }, - {0x12, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "6 Coins/4 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "5 Coins/6 Credits" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x00, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x04, 0x00, "3" }, - {0x13, 0x01, 0x04, 0x04, "2" }, - - {0 , 0xfe, 0 , 2, "Laser" }, - {0x13, 0x01, 0x08, 0x00, "Semi-Automatic" }, - {0x13, 0x01, 0x08, 0x08, "Manual" }, - - {0 , 0xfe, 0 , 2, "Extended Play" }, - {0x13, 0x01, 0x10, 0x00, "500000 points" }, - {0x13, 0x01, 0x10, 0x10, "300000 points" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Rabiolep) - -static struct BurnDIPInfo SvolleyDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 12, "Coin A" }, - {0x12, 0x01, 0x0f, 0x0d, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "6 Coins/4 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "5 Coins/6 Credits" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 12, "Coin B" }, - {0x12, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "6 Coins/4 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "5 Coins/6 Credits" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Game Time" }, - {0x13, 0x01, 0x01, 0x01, "2 min/1 min" }, - {0x13, 0x01, 0x01, 0x00, "3 min/1.5 min" }, - - {0 , 0xfe, 0 , 4, "2P Starting Score" }, - {0x13, 0x01, 0x06, 0x06, "0-0" }, - {0x13, 0x01, 0x06, 0x04, "5-5" }, - {0x13, 0x01, 0x06, 0x00, "7-7" }, - {0x13, 0x01, 0x06, 0x02, "9-9" }, - - {0 , 0xfe, 0 , 4, "1P Starting Score" }, - {0x13, 0x01, 0x18, 0x10, "9-11" }, - {0x13, 0x01, 0x18, 0x18, "10-10" }, - {0x13, 0x01, 0x18, 0x08, "10-11" }, - {0x13, 0x01, 0x18, 0x00, "11-11" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Svolley) - -static inline void palette_write(INT32 offset) -{ - INT32 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (p >> 10) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -void __fastcall rpunch_main_write_word(UINT32 address, UINT16 data) -{ - address &= 0x0fffff; - - if ((address & 0x0ff800) == 0xa0000) { - *((UINT16*)(DrvPalRAM +(address & 0x7fe))) = data; - palette_write(address & 0x7fe); - return; - } - - switch (address) - { - case 0x0c0000: - case 0x0c0002: - case 0x0c0004: - case 0x0c0006: - DrvScrRegs[(address & 0x06)/2] = data; - return; - - case 0x0c000c: - *DrvVidRegs = data; - return; - - case 0x0c0010: - case 0x0c0012: - sprite_offs[(address / 2) & 1] = data & 0x3f; - return; - } -} - -void __fastcall rpunch_main_write_byte(UINT32 address, UINT8 data) -{ - address &= 0x0fffff; - - if ((address & 0x0ff800) == 0xa0000) { - DrvPalRAM[(address & 0x7ff) ^ 1] = data; - palette_write(address & 0x7fe); - return; - } - - switch (address) - { - case 0x0c0009: - if (crtc_register == 0x0b) { - crtc_timer = (data == 0xc0) ? 2 : 1; - } - return; - - case 0x0c000f: - *soundlatch = data; - *sound_busy = 1; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x0c0029: - crtc_register = data; - return; - } -} - -UINT16 __fastcall rpunch_main_read_word(UINT32 address) -{ - switch (address & 0x0fffff) - { - case 0x0c0018: - return DrvInputs[0] | (DrvInputs[2] << 8); - - case 0x0c001a: - return DrvInputs[1] | (DrvInputs[2] << 8); - - case 0x0c001c: - return DrvDips[0] | (DrvDips[1] << 8); - } - - return 0; -} - -UINT8 __fastcall rpunch_main_read_byte(UINT32 address) -{ - switch (address & 0x0fffff) - { - case 0x0c0018: - case 0x0c001a: - return DrvInputs[2]; - - case 0x0c0019: - return DrvInputs[0]; - - case 0x0c001b: - return DrvInputs[1]; - - case 0x0c001f: - return *sound_busy; - } - - return 0; -} - -static void sound_bankswitch(INT32 data) -{ - INT32 bank = data & 1; - - if (bank != sound_bank[0]) { - memcpy (DrvSndROM, DrvSndROM + 0x20000 * (bank + 1), 0x20000); - sound_bank[0] = bank; - } -} - -void __fastcall rpunch_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - BurnYM2151SelectRegister(data); - return; - - case 0xf001: - BurnYM2151WriteRegister(data); - return; - - case 0xf400: - UPD7759ResetWrite(0, data >> 7); - sound_bankswitch(data); - return; - - case 0xf600: - UPD7759PortWrite(0, data); - UPD7759StartWrite(0, 0); - UPD7759StartWrite(0, 1); - return; - } -} - -UINT8 __fastcall rpunch_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - case 0xf001: - return BurnYM2151ReadStatus(); - - case 0xf200: - *sound_busy = 0; - ZetSetIRQLine(0, (*sound_irq) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void DrvYM2151IrqHandler(INT32 irq) -{ - *sound_irq = irq; - - ZetSetIRQLine(0, (*sound_irq | *sound_busy) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0x00, RamEnd - AllRam); - memset (DrvBMPRAM, 0xff, 0x10000); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - UPD7759Reset(); - - sound_bank[0] = ~0; - sound_bankswitch(0); - - crtc_register = 0; - crtc_timer = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x100000; - - DrvSndROM = Next; Next += 0x060000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(INT32); - - AllRam = Next; - DrvBMPRAM = Next; Next += 0x010000; - DrvSprRAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x004000; - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - sound_busy = Next; Next += 0x000001; - sound_irq = Next; Next += 0x000001; - sound_bank = Next; Next += 0x000001; - - DrvScrRegs = (UINT16*)Next; Next += 0x000004 * sizeof(INT16); - DrvVidRegs = (UINT16*)Next; Next += 0x000001 * sizeof(INT16); - - sprite_offs = Next; Next += 0x000002; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void expand_graphics(UINT8 *gfx, INT32 len) -{ - memcpy (gfx + 0x60000, gfx + 0x40000, 0x20000); // mirror top bank - - for (INT32 i = (len - 1) * 2; i >= 0; i-= 2) - { - INT32 t = gfx[i/2]; - gfx[i+0] = t & 0x0f; - gfx[i+1] = t >> 4; - } -} - -static INT32 DrvInit(INT32 (*pRomLoadCallback)(), INT32 game) -{ - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pRomLoadCallback) { - memset (DrvGfxROM0, 0xff, 0x80000); - memset (DrvGfxROM1, 0xff, 0x80000); - memset (DrvGfxROM2, 0xff, 0x80000); - - if (pRomLoadCallback()) return 1; - - expand_graphics(DrvGfxROM0, 0x80000); - expand_graphics(DrvGfxROM1, 0x80000); - expand_graphics(DrvGfxROM2, 0x80000); - } - - game_select = game; - - SekInit(0, 0x68000); - SekOpen(0); - // FBA doesn't support memory masks, so use mirroring instead - for (INT32 i = 0; i < 1 << 24; i+= 1 << 20) { - SekMapMemory(Drv68KROM, i+0x000000, i+0x03ffff, MAP_ROM); - SekMapMemory(DrvBMPRAM, i+0x040000, i+0x04ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, i+0x060000, i+0x060fff, MAP_RAM); - SekMapMemory(DrvVidRAM, i+0x080000, i+0x083fff, MAP_RAM); - SekMapMemory(DrvPalRAM, i+0x0a0000, i+0x0a07ff, MAP_ROM); - SekMapMemory(Drv68KRAM, i+0x0fc000, i+0x0fffff, MAP_RAM); - } - SekSetWriteWordHandler(0, rpunch_main_write_word); - SekSetWriteByteHandler(0, rpunch_main_write_byte); - SekSetReadWordHandler(0, rpunch_main_read_word); - SekSetReadByteHandler(0, rpunch_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM); - ZetSetWriteHandler(rpunch_sound_write); - ZetSetReadHandler(rpunch_sound_read); - ZetClose(); - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - - UPD7759Init(0, UPD7759_STANDARD_CLOCK, DrvSndROM); - UPD7759SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - ZetExit(); - - BurnYM2151Exit(); - UPD7759Exit(); - - GenericTilesExit(); - - BurnFree (AllMem); - AllMem = NULL; - - return 0; -} - -static void draw_layer(INT32 layer, UINT8 *gfx) -{ - UINT16 *ram = (UINT16*)(DrvVidRAM + layer * 0x2000); - UINT16 *scroll = (UINT16*)(DrvScrRegs + layer * 2); - UINT16 vidflag = *DrvVidRegs >> layer; - - INT32 scrolly = scroll[0] & 0x1ff; - INT32 scrollx = (scroll[1] + 8) & 0x1ff; - INT32 bank = (vidflag & 0x0400) ? 0x2000 : 0; - INT32 colbank =((vidflag & 0x0010) >> 1) + layer * 0x10; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sy = (offs & 0x3f) * 8; - INT32 sx = (offs / 0x40) * 8; - - sy -= scrolly; - if (sy < -7) sy += 0x200; - sx -= scrollx; - if (sx < -7) sx += 0x200; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = ram[offs]; - INT32 code = (attr & 0x1fff) + bank; - INT32 color = ((attr >> 13) & 7) + colbank; - - if (layer) { // transparent - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, gfx); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, gfx); - } - } -} - -static void draw_bitmap() -{ - if (game_select) return; // rpunch only! - - INT32 colorbase = 0x200 + ((*DrvVidRegs & 0x0f) * 0x10); - - UINT16 *dst = (UINT16*)pTransDraw; - UINT16 *src = (UINT16*)(DrvBMPRAM + 6); - - for (INT32 y = 0; y < nScreenHeight; y++) - { - for (INT32 x = 0; x < nScreenWidth; x+=4) - { - INT32 v, s = src[x/4]; - - v = (s >> 12) & 0x0f; if (v != 15) dst[x+0] = v + colorbase; - v = (s >> 8) & 0x0f; if (v != 15) dst[x+1] = v + colorbase; - v = (s >> 4) & 0x0f; if (v != 15) dst[x+2] = v + colorbase; - v = (s >> 0) & 0x0f; if (v != 15) dst[x+3] = v + colorbase; - } - - src += 512 / 4; - dst += nScreenWidth; - } -} - -static void draw_sprites(INT32 start, INT32 stop) -{ - INT32 color_bank = ((*DrvVidRegs & 0x40) >> 3) + ((game_select) ? (0x80>>4) : (0x300>>4)); - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = start; offs < stop; offs += 4) - { - INT32 sy = 512 - (ram[offs + 0] & 0x01ff); - INT32 attr = ram[offs + 1]; - INT32 sx = ram[offs + 2] & 0x01ff; - INT32 code = attr & 0x07ff; - INT32 flipy = attr & 0x0800; - INT32 flipx = attr & 0x1000; - INT32 color =((attr& 0xe000) >> 13) + color_bank; - - if (sx >= 304) sx -= 512; - if (sy >= 224) sy -= 512; - - if (flipy) { - if (flipx) { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 16, 32, code, sx, sy, color, 4, 0xf, 0, DrvGfxROM2); - } else { - RenderCustomTile_Mask_FlipY_Clip(pTransDraw, 16, 32, code, sx, sy, color, 4, 0xf, 0, DrvGfxROM2); - } - } else { - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(pTransDraw, 16, 32, code, sx, sy, color, 4, 0xf, 0, DrvGfxROM2); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 16, 32, code, sx, sy, color, 4, 0xf, 0, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_write(i); - } - - DrvRecalc = 0; - } - - INT32 sproffs = (sprite_offs[1] > sprite_offs[0]) ? sprite_offs[0] : sprite_offs[1]; - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(0, DrvGfxROM0); - if (nSpriteEnable & 1) draw_sprites(0, sproffs * 4); - if (nBurnLayer & 2) draw_layer(1, DrvGfxROM1); - if (nSpriteEnable & 2) draw_sprites(sproffs * 4, sprite_offs[0] * 4); - if (nBurnLayer & 4) draw_bitmap(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 8000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nSegment); - - if (crtc_timer == 2 && i == ((nInterleave / 2) - 1)) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - nSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - nCyclesDone[1] += ZetRun(nSegment); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - UPD7759Update(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - } - - if (crtc_timer) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - UPD7759Update(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - - // UPD7759 does not have volume controls, so do all sounds at 100% and reduce levels - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[i*2+0] /= 2; - pBurnSoundOut[i*2+1] /= 2; - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029709; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - UPD7759Scan(0, nAction, pnMin); - - SCAN_VAR(crtc_register); - SCAN_VAR(crtc_timer); - } - - if (nAction & ACB_WRITE) { - INT32 bank = sound_bank[0]; - sound_bank[0] = ~0; - sound_bankswitch(bank); - - DrvRecalc = 1; - } - - return 0; -} - - -// Rabio Lepus (Japan) - -static struct BurnRomInfo rabiolepRomDesc[] = { - { "rl_e2.bin", 0x08000, 0x7d936a12, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "rl_d2.bin", 0x08000, 0xd8d85429, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rl_e4.bin", 0x08000, 0x5bfaee12, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rl_d4.bin", 0x08000, 0xe64216bf, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "rl_f20.bin", 0x10000, 0xa6f50351, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "rl_c13.bin", 0x40000, 0x7c8403b0, 3 | BRF_GRA }, // 5 Background Tiles - { "rl_c10.bin", 0x08000, 0x312eb260, 3 | BRF_GRA }, // 6 - { "rl_c12.bin", 0x08000, 0xbea85219, 3 | BRF_GRA }, // 7 - - { "rl_a10.bin", 0x40000, 0xc2a77619, 4 | BRF_GRA }, // 8 Foreground Tiles - { "rl_a13.bin", 0x08000, 0xa39c2c16, 4 | BRF_GRA }, // 9 - { "rl_a12.bin", 0x08000, 0x970b0e32, 4 | BRF_GRA }, // 10 - - { "rl_4g.bin", 0x20000, 0xc5cb4b7a, 5 | BRF_GRA }, // 11 Sprites - { "rl_4h.bin", 0x20000, 0x8a4d3c99, 5 | BRF_GRA }, // 12 - { "rl_1g.bin", 0x08000, 0x74d41b2e, 5 | BRF_GRA }, // 13 - { "rl_1h.bin", 0x08000, 0x7dcb32bb, 5 | BRF_GRA }, // 14 - { "rl_2g.bin", 0x08000, 0x744903b4, 5 | BRF_GRA }, // 15 - { "rl_2h.bin", 0x08000, 0x09649e75, 5 | BRF_GRA }, // 16 - - { "rl_f18.bin", 0x20000, 0x47840673, 6 | BRF_SND }, // 17 UPD Samples -}; - -STD_ROM_PICK(rabiolep) -STD_ROM_FN(rabiolep) - -static INT32 rpunchRomLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x010000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x048000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x048000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x050001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x050000, 16, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x020000, 17, 1)) return 1; - - return 0; -} - -static INT32 rpunchInit() -{ - return DrvInit(rpunchRomLoadCallback, 0); -} - -struct BurnDriver BurnDrvRabiolep = { - "rabiolep", NULL, NULL, NULL, "1987", - "Rabio Lepus (Japan)\0", NULL, "V-System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, rabiolepRomInfo, rabiolepRomName, NULL, NULL, RpunchInputInfo, RabiolepDIPInfo, - rpunchInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Rabbit Punch (US) - -static struct BurnRomInfo rpunchRomDesc[] = { - { "rpunch.20", 0x08000, 0xa2028d59, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "rpunch.21", 0x08000, 0x1cdb13d3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rpunch.2", 0x08000, 0x9b9729bb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rpunch.3", 0x08000, 0x5704a688, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "rpunch.92", 0x10000, 0x5e1870e3, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "rl_c13.bin", 0x40000, 0x7c8403b0, 3 | BRF_GRA }, // 5 Background Tiles - { "rl_c10.bin", 0x08000, 0x312eb260, 3 | BRF_GRA }, // 6 - { "rl_c12.bin", 0x08000, 0xbea85219, 3 | BRF_GRA }, // 7 - - { "rl_a10.bin", 0x40000, 0xc2a77619, 4 | BRF_GRA }, // 8 Foreground Tiles - { "rl_a13.bin", 0x08000, 0xa39c2c16, 4 | BRF_GRA }, // 9 - { "rpunch.54", 0x08000, 0xe2969747, 4 | BRF_GRA }, // 10 - - { "rl_4g.bin", 0x20000, 0xc5cb4b7a, 5 | BRF_GRA }, // 11 Sprite Tiles - { "rl_4h.bin", 0x20000, 0x8a4d3c99, 5 | BRF_GRA }, // 12 - { "rl_1g.bin", 0x08000, 0x74d41b2e, 5 | BRF_GRA }, // 13 - { "rl_1h.bin", 0x08000, 0x7dcb32bb, 5 | BRF_GRA }, // 14 - { "rpunch.85", 0x08000, 0x60b88a2c, 5 | BRF_GRA }, // 15 - { "rpunch.86", 0x08000, 0x91d204f6, 5 | BRF_GRA }, // 16 - - { "rl_f18.bin", 0x20000, 0x47840673, 6 | BRF_SND }, // 17 UPD Samples -}; - -STD_ROM_PICK(rpunch) -STD_ROM_FN(rpunch) - -struct BurnDriver BurnDrvRpunch = { - "rpunch", "rabiolep", NULL, NULL, "1987", - "Rabbit Punch (US)\0", NULL, "V-System Co. (Bally/Midway/Sente license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, rpunchRomInfo, rpunchRomName, NULL, NULL, RpunchInputInfo, RpunchDIPInfo, - rpunchInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Super Volleyball (Japan) - -static struct BurnRomInfo svolleyRomDesc[] = { - { "sps_13.bin", 0x10000, 0x2fbc5dcf, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "sps_11.bin", 0x10000, 0x51b025c9, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sps_14.bin", 0x08000, 0xe7630122, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sps_12.bin", 0x08000, 0xb6b24910, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sps_17.bin", 0x10000, 0x48b89688, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "sps_02.bin", 0x10000, 0x1a0abe75, 3 | BRF_GRA }, // 5 Background Tiles - { "sps_03.bin", 0x10000, 0x36279075, 3 | BRF_GRA }, // 6 - { "sps_04.bin", 0x10000, 0x7cede7d9, 3 | BRF_GRA }, // 7 - { "sps_01.bin", 0x08000, 0x6425e6d7, 3 | BRF_GRA }, // 8 - { "sps_10.bin", 0x08000, 0xa12b1589, 3 | BRF_GRA }, // 9 - - { "sps_05.bin", 0x10000, 0xb0671d12, 4 | BRF_GRA }, // 10 Foreground Tiles - { "sps_06.bin", 0x10000, 0xc231957e, 4 | BRF_GRA }, // 11 - { "sps_07.bin", 0x10000, 0x904b7709, 4 | BRF_GRA }, // 12 - { "sps_08.bin", 0x10000, 0x5430ffac, 4 | BRF_GRA }, // 13 - { "sps_09.bin", 0x10000, 0x414a6278, 4 | BRF_GRA }, // 14 - - { "sps_20.bin", 0x10000, 0xc9e7206d, 5 | BRF_GRA }, // 15 Sprite Tiles - { "sps_23.bin", 0x10000, 0x7b15c805, 5 | BRF_GRA }, // 16 - { "sps_19.bin", 0x08000, 0x8ac2f232, 5 | BRF_GRA }, // 17 - { "sps_22.bin", 0x08000, 0xfcc754e3, 5 | BRF_GRA }, // 18 - { "sps_18.bin", 0x08000, 0x4d6c8f0c, 5 | BRF_GRA }, // 19 - { "sps_21.bin", 0x08000, 0x9dd28b42, 5 | BRF_GRA }, // 20 - - { "sps_16.bin", 0x20000, 0x456d0f36, 6 | BRF_SND }, // 21 UPD Samples - { "sps_15.bin", 0x10000, 0xf33f415f, 6 | BRF_SND }, // 22 -}; - -STD_ROM_PICK(svolley) -STD_ROM_FN(svolley) - -static INT32 svolleyRomLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x010000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x030000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x030000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020001, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020000, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x030001, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x030000, 20, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x020000, 21, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x040000, 22, 1)) return 1; - - return 0; -} - -static INT32 svolleyInit() -{ - return DrvInit(svolleyRomLoadCallback, 1); -} - -struct BurnDriver BurnDrvSvolley = { - "svolley", NULL, NULL, NULL, "1989", - "Super Volleyball (Japan)\0", NULL, "V-System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, svolleyRomInfo, svolleyRomName, NULL, NULL, RpunchInputInfo, SvolleyDIPInfo, - svolleyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Super Volleyball (Korea) - -static struct BurnRomInfo svolleykRomDesc[] = { - { "a14.bin", 0x10000, 0xdbab3bf9, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "a11.bin", 0x10000, 0x92afd56f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a15.bin", 0x08000, 0xd8f89c4a, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a12.bin", 0x08000, 0xde3dd5cb, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sps_17.bin", 0x10000, 0x48b89688, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "sps_02.bin", 0x10000, 0x1a0abe75, 3 | BRF_GRA }, // 5 Background Tiles - { "sps_03.bin", 0x10000, 0x36279075, 3 | BRF_GRA }, // 6 - { "sps_04.bin", 0x10000, 0x7cede7d9, 3 | BRF_GRA }, // 7 - { "sps_01.bin", 0x08000, 0x6425e6d7, 3 | BRF_GRA }, // 8 - { "sps_10.bin", 0x08000, 0xa12b1589, 3 | BRF_GRA }, // 9 - - { "sps_05.bin", 0x10000, 0xb0671d12, 4 | BRF_GRA }, // 10 Foreground Tiles - { "sps_06.bin", 0x10000, 0xc231957e, 4 | BRF_GRA }, // 11 - { "sps_07.bin", 0x10000, 0x904b7709, 4 | BRF_GRA }, // 12 - { "sps_08.bin", 0x10000, 0x5430ffac, 4 | BRF_GRA }, // 13 - { "sps_09.bin", 0x10000, 0x414a6278, 4 | BRF_GRA }, // 14 - { "a09.bin", 0x08000, 0xdd92dfe1, 4 | BRF_GRA }, // 15 - - { "sps_20.bin", 0x10000, 0xc9e7206d, 5 | BRF_GRA }, // 16 Sprite Tiles - { "sps_23.bin", 0x10000, 0x7b15c805, 5 | BRF_GRA }, // 17 - { "sps_19.bin", 0x08000, 0x8ac2f232, 5 | BRF_GRA }, // 18 - { "sps_22.bin", 0x08000, 0xfcc754e3, 5 | BRF_GRA }, // 19 - { "sps_18.bin", 0x08000, 0x4d6c8f0c, 5 | BRF_GRA }, // 20 - { "sps_21.bin", 0x08000, 0x9dd28b42, 5 | BRF_GRA }, // 21 - - { "sps_16.bin", 0x20000, 0x456d0f36, 6 | BRF_SND }, // 22 UPD Samples - { "sps_15.bin", 0x10000, 0xf33f415f, 6 | BRF_SND }, // 23 -}; - -STD_ROM_PICK(svolleyk) -STD_ROM_FN(svolleyk) - -static INT32 svolleykRomLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x010000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x030000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x030000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x050000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020001, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020000, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x030001, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x030000, 21, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x020000, 22, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x040000, 23, 1)) return 1; - - return 0; -} - -static INT32 svolleykInit() -{ - return DrvInit(svolleykRomLoadCallback, 1); -} - -struct BurnDriver BurnDrvSvolleyk = { - "svolleyk", "svolley", NULL, NULL, "1989", - "Super Volleyball (Korea)\0", NULL, "V-System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, svolleykRomInfo, svolleykRomName, NULL, NULL, RpunchInputInfo, SvolleyDIPInfo, - svolleykInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Super Volleyball (US) - -static struct BurnRomInfo svolleyuRomDesc[] = { - { "svb-du8.137", 0x10000, 0xffd5d261, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "svb-du5.136", 0x10000, 0xc1e943f5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "svb-du9.127", 0x08000, 0x70e04a2e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "svb-du6.126", 0x08000, 0xacb3872b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sps_17.bin", 0x10000, 0x48b89688, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "sps_02.bin", 0x10000, 0x1a0abe75, 3 | BRF_GRA }, // 5 Background Tiles - { "sps_03.bin", 0x10000, 0x36279075, 3 | BRF_GRA }, // 6 - { "sps_04.bin", 0x10000, 0x7cede7d9, 3 | BRF_GRA }, // 7 - { "sps_01.bin", 0x08000, 0x6425e6d7, 3 | BRF_GRA }, // 8 - { "sps_10.bin", 0x08000, 0xa12b1589, 3 | BRF_GRA }, // 9 - - { "sps_05.bin", 0x10000, 0xb0671d12, 4 | BRF_GRA }, // 10 Foreground Tiles - { "sps_06.bin", 0x10000, 0xc231957e, 4 | BRF_GRA }, // 11 - { "sps_07.bin", 0x10000, 0x904b7709, 4 | BRF_GRA }, // 12 - { "sps_08.bin", 0x10000, 0x5430ffac, 4 | BRF_GRA }, // 13 - { "sps_09.bin", 0x10000, 0x414a6278, 4 | BRF_GRA }, // 14 - - { "sps_20.bin", 0x10000, 0xc9e7206d, 5 | BRF_GRA }, // 15 Sprite Tiles - { "sps_23.bin", 0x10000, 0x7b15c805, 5 | BRF_GRA }, // 16 - { "sps_19.bin", 0x08000, 0x8ac2f232, 5 | BRF_GRA }, // 17 - { "sps_22.bin", 0x08000, 0xfcc754e3, 5 | BRF_GRA }, // 18 - { "sps_18.bin", 0x08000, 0x4d6c8f0c, 5 | BRF_GRA }, // 19 - { "sps_21.bin", 0x08000, 0x9dd28b42, 5 | BRF_GRA }, // 20 - - { "sps_16.bin", 0x20000, 0x456d0f36, 6 | BRF_SND }, // 21 UPD Samples - { "sps_15.bin", 0x10000, 0xf33f415f, 6 | BRF_SND }, // 22 -}; - -STD_ROM_PICK(svolleyu) -STD_ROM_FN(svolleyu) - -struct BurnDriver BurnDrvSvolleyu = { - "svolleyu", "svolley", NULL, NULL, "1989", - "Super Volleyball (US)\0", NULL, "V-System Co. (Data East license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, svolleyuRomInfo, svolleyuRomName, NULL, NULL, RpunchInputInfo, SvolleyDIPInfo, - svolleyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_safarir.cpp b/jan/src/burn/drv/pre90s/d_safarir.cpp deleted file mode 100644 index 528eff94f..000000000 --- a/jan/src/burn/drv/pre90s/d_safarir.cpp +++ /dev/null @@ -1,506 +0,0 @@ -// FB Alpha Safari Rally driver module -// Based on MAME driver by Zsolt Vasvari - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "samples.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *DrvI8080ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvI8080RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 nRamBank; -static UINT8 scrollx; -static UINT8 m_port_last; -static UINT8 m_port_last2; - -static INT32 vblank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[1]; -static UINT8 DrvReset; - -static struct BurnInputInfo SafarirInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 6, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Safarir) - -static struct BurnDIPInfo SafarirDIPList[]= -{ - {0x06, 0xff, 0xff, 0x24, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x06, 0x01, 0x03, 0x00, "3" }, - {0x06, 0x01, 0x03, 0x01, "4" }, - {0x06, 0x01, 0x03, 0x02, "5" }, - {0x06, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Acceleration Rate" }, - {0x06, 0x01, 0x0c, 0x00, "Slowest" }, - {0x06, 0x01, 0x0c, 0x04, "Slow" }, - {0x06, 0x01, 0x0c, 0x08, "Fast" }, - {0x06, 0x01, 0x0c, 0x0c, "Fastest" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x06, 0x01, 0x10, 0x00, "Off" }, - {0x06, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x06, 0x01, 0x60, 0x00, "3000" }, - {0x06, 0x01, 0x60, 0x20, "5000" }, - {0x06, 0x01, 0x60, 0x40, "7000" }, - {0x06, 0x01, 0x60, 0x60, "9000" }, -}; - -STDDIPINFO(Safarir) - -#define SAMPLE_SOUND1_1 0 -#define SAMPLE_SOUND1_2 1 -#define SAMPLE_SOUND2 2 -#define SAMPLE_SOUND3 3 -#define SAMPLE_SOUND4_1 4 -#define SAMPLE_SOUND4_2 5 -#define SAMPLE_SOUND5_1 6 -#define SAMPLE_SOUND5_2 7 -#define SAMPLE_SOUND6 8 -#define SAMPLE_SOUND7 9 -#define SAMPLE_SOUND8 10 - -static void safarir_audio_write(UINT8 data) -{ - UINT8 rising_bits = data & ~m_port_last; - - if (rising_bits == 0x12) BurnSamplePlay(SAMPLE_SOUND1_1); - if (rising_bits == 0x02) BurnSamplePlay(SAMPLE_SOUND1_2); - if (rising_bits == 0x95) BurnSamplePlay(SAMPLE_SOUND6); - - if (rising_bits == 0x04 && (data == 0x15 || data ==0x16)) BurnSamplePlay(SAMPLE_SOUND2); - - if (data == 0x5f && (rising_bits == 0x49 || rising_bits == 0x5f)) BurnSamplePlay(SAMPLE_SOUND3); - if (data == 0x00 || rising_bits == 0x01) BurnSampleStop(SAMPLE_SOUND3); - - if (data == 0x13) - { - if ((rising_bits == 0x13 && m_port_last != 0x04) || (rising_bits == 0x01 && m_port_last == 0x12)) - { - BurnSamplePlay(SAMPLE_SOUND7); - } - else if (rising_bits == 0x03 && m_port_last2 == 0x15 && !BurnSampleGetStatus(SAMPLE_SOUND4_1)) - { - BurnSamplePlay(SAMPLE_SOUND4_1); - } - } - if (data == 0x53 && m_port_last == 0x55) BurnSamplePlay(SAMPLE_SOUND4_2); - - if (data == 0x1f && rising_bits == 0x1f) BurnSamplePlay(SAMPLE_SOUND5_1); - if (data == 0x14 && (rising_bits == 0x14 || rising_bits == 0x04)) BurnSamplePlay(SAMPLE_SOUND5_2); - - if (data == 0x07 && rising_bits == 0x07 && !BurnSampleGetStatus(SAMPLE_SOUND8)) - BurnSamplePlay(SAMPLE_SOUND8); - - m_port_last2 = m_port_last; - m_port_last = data; -} - -static void ram_bank(INT32 data) -{ - nRamBank = data & 0x01; - ZetMapMemory(DrvI8080RAM + (nRamBank * 0x800), 0x2000, 0x27ff, MAP_RAM); -} - -static void __fastcall safarir_write(UINT16 address, UINT8 data) -{ - switch (address & ~0x03ff) - { - case 0x2800: - ram_bank(data); - return; - - case 0x2c00: - scrollx = data; - - case 0x3000: - safarir_audio_write(data); - return; - - case 0x3400: - case 0x3800: - case 0x3c00: - return; // nop - } -} - -static UINT8 __fastcall safarir_read(UINT16 address) -{ - switch (address & ~0x03ff) - { - case 0x3800: - return DrvInputs[0]; - - case 0x3c00: - return (DrvDips[0] & 0x7f) | vblank; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ram_bank(0); - ZetClose(); - - BurnSampleReset(); - - scrollx = 0; - m_port_last = 0; - m_port_last2 = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvI8080ROM = Next; Next += 0x001800; - - DrvGfxROM0 = Next; Next += 0x002000; - DrvGfxROM1 = Next; Next += 0x002000; - - DrvPalette = (UINT32*)Next; Next += 0x0010 * sizeof(UINT32); - - AllRam = Next; - - DrvI8080RAM = Next; Next += 0x001000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[1] = { 0 }; - INT32 XOffs[8] = { STEP8(7,-1) }; - INT32 YOffs[8] = { STEP8(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x400); - - GfxDecode(0x80, 1, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x400); - - GfxDecode(0x80, 1, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvI8080ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvI8080ROM + 0x0400, 1, 1)) return 1; - if (BurnLoadRom(DrvI8080ROM + 0x0800, 2, 1)) return 1; - if (BurnLoadRom(DrvI8080ROM + 0x0c00, 3, 1)) return 1; - if (BurnLoadRom(DrvI8080ROM + 0x1000, 4, 1)) return 1; - if (BurnLoadRom(DrvI8080ROM + 0x1400, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 7, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvI8080ROM, 0x0000, 0x17ff, MAP_ROM); - ZetMapMemory(DrvI8080RAM, 0x2000, 0x27ff, MAP_RAM); - ZetSetWriteHandler(safarir_write); - ZetSetReadHandler(safarir_read); - ZetClose(); - - BurnSampleInit(0); - BurnSampleSetAllRoutesAllSamples(0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - - BurnSampleExit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x10; i+=2) - { - DrvPalette[i + 0] = BurnHighCol(0, 0, 0, 0); // black - DrvPalette[i + 1] = BurnHighCol((i & 8) ? 0xff : 0, (i & 4) ? 0xff : 0, (i & 2) ? 0xff : 0, 0); - } -} - -static void draw_layer_bg() -{ - UINT8 *ram = DrvI8080RAM + (nRamBank ? 0x800 : 0) + 0x400; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sx -= scrollx; - if (sx < -7) sx += 256; - - INT32 code = ram[offs]; - - INT32 color; - if (code & 0x80) { - color = 6; - } else { - color = ((~offs & 0x04) >> 2) | ((offs & 0x04) >> 1); - if (offs & 0x100) { - color |= ((offs & 0xc0) != 0x00) ? 1 : 0; - } else { - color |= ((code & 0xc0) == 0x80) ? 1 : 0; - } - } - - Render8x8Tile_Clip(pTransDraw, code & 0x7f, sx, sy, color, 1, 0, DrvGfxROM0); - } -} - -static void draw_layer_fg() -{ - UINT8 *ram = DrvI8080RAM + (nRamBank ? 0x800 : 0); - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 code = ram[offs]; - - INT32 color; - if (code & 0x80) { - color = 7; - } else { - //color = ((~offs & 0x04) >> 2) | ((offs & 0x06) >> 1); bad iq! :) - color = (~offs & 0x04) | ((offs >> 1) & 0x03); - } - - INT32 opaque = ((offs & 0x1f) >= 0x03) ? 0 : 1; - - if (opaque) { - Render8x8Tile_Clip(pTransDraw, code & 0x7f, sx, sy, color, 1, 0, DrvGfxROM1); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code & 0x7f, sx, sy, color, 1, 0, 0, DrvGfxROM1); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer_bg(); - draw_layer_fg(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0xff; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - - ZetOpen(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetRun(1500000 / 60 / nInterleave); - - if (i == 240) vblank = 0x80; - } - - ZetClose(); - - if (pBurnSoundOut) { - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029708; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - BurnSampleScan(nAction, pnMin); - - SCAN_VAR(nRamBank); - SCAN_VAR(scrollx); - SCAN_VAR(m_port_last); - SCAN_VAR(m_port_last2); - } - - return 0; -} - -static struct BurnSampleInfo SafarirSampleDesc[] = { - { "sound1-1", SAMPLE_NOLOOP }, - { "sound1-2", SAMPLE_NOLOOP }, - { "sound2", SAMPLE_NOLOOP }, - { "sound3", SAMPLE_NOLOOP }, - { "sound4-1", SAMPLE_NOLOOP }, - { "sound4-2", SAMPLE_NOLOOP }, - { "sound5-1", SAMPLE_NOLOOP }, - { "sound5-2", SAMPLE_NOLOOP }, - { "sound6", SAMPLE_NOLOOP }, - { "sound7", SAMPLE_NOLOOP }, - { "sound8", SAMPLE_NOLOOP }, - { "", 0 } -}; - -STD_SAMPLE_PICK(Safarir) -STD_SAMPLE_FN(Safarir) - -// Safari Rally (World) - -static struct BurnRomInfo safarirRomDesc[] = { - { "rl-01.9", 0x0400, 0xcf7703c9, 1 | BRF_PRG | BRF_ESS }, // 0 I8080 Code - { "rl-02.1", 0x0400, 0x1013ecd3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rl-03.10", 0x0400, 0x84545894, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rl-04.2", 0x0400, 0x5dd12f96, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rl-09.11", 0x0400, 0xd066b382, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rl-06.3", 0x0400, 0x24c1cd42, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "rl-10.43", 0x0400, 0xc04466c6, 2 | BRF_GRA }, // 6 Background Tiles - - { "rl-07.40", 0x0400, 0xba525203, 3 | BRF_GRA }, // 7 Foreground Tiles -}; - -STD_ROM_PICK(safarir) -STD_ROM_FN(safarir) - -struct BurnDriver BurnDrvSafarir = { - "safarir", NULL, NULL, "safarir", "1979", - "Safari Rally (World)\0", NULL, "SNK (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, safarirRomInfo, safarirRomName, SafarirSampleInfo, SafarirSampleName, SafarirInputInfo, SafarirDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 208, 256, 3, 4 -}; - - -// Safari Rally (Japan) - -static struct BurnRomInfo safarirjRomDesc[] = { - { "rl-01.9", 0x0400, 0xcf7703c9, 1 | BRF_PRG | BRF_ESS }, // 0 I8080 Code - { "rl-02.1", 0x0400, 0x1013ecd3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rl-03.10", 0x0400, 0x84545894, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rl-04.2", 0x0400, 0x5dd12f96, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rl-05.11", 0x0400, 0x935ed469, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rl-06.3", 0x0400, 0x24c1cd42, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "rl-08.43", 0x0400, 0xd6a50aac, 2 | BRF_GRA }, // 6 Background Tiles - - { "rl-07.40", 0x0400, 0xba525203, 3 | BRF_GRA }, // 7 Foreground Tiles -}; - -STD_ROM_PICK(safarirj) -STD_ROM_FN(safarirj) - -struct BurnDriver BurnDrvSafarirj = { - "safarirj", "safarir", NULL, "safarir", "1979", - "Safari Rally (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, safarirjRomInfo, safarirjRomName, SafarirSampleInfo, SafarirSampleName, SafarirInputInfo, SafarirDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10, - 208, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_sauro.cpp b/jan/src/burn/drv/pre90s/d_sauro.cpp deleted file mode 100644 index 2b734c8fc..000000000 --- a/jan/src/burn/drv/pre90s/d_sauro.cpp +++ /dev/null @@ -1,1167 +0,0 @@ -// FB Alpha Sauro driver module -// Based on MAME driver by Zsolt Vasvari - -// missing speech (sp0256 core) - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym3812.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvZ80RAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 flipscreen; -static UINT8 soundlatch; -static UINT8 fg_scrollx; -static UINT8 bg_scrollx; -static INT32 palette_bank; - -static INT32 watchdog; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo TecfriInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tecfri) - -static struct BurnDIPInfo TecfriDIPList[]= -{ - {0x11, 0xff, 0xff, 0x66, NULL }, - {0x12, 0xff, 0xff, 0x2f, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x00, "Off" }, - {0x11, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x00, "Off" }, - {0x11, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x04, "Upright" }, - {0x11, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x30, 0x30, "Very Easy" }, - {0x11, 0x01, 0x30, 0x20, "Easy" }, - {0x11, 0x01, 0x30, 0x10, "Hard" }, - {0x11, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x40, 0x00, "No" }, - {0x11, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x01, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0c, 0x00, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x30, "2" }, - {0x12, 0x01, 0x30, 0x20, "3" }, - {0x12, 0x01, 0x30, 0x10, "4" }, - {0x12, 0x01, 0x30, 0x00, "5" }, -}; - -STDDIPINFO(Tecfri) - -static struct BurnDIPInfo TrckydocaDIPList[]= -{ - {0x11, 0xff, 0xff, 0x66, NULL }, - {0x12, 0xff, 0xff, 0x2f, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x00, "Off" }, - {0x11, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x00, "Off" }, - {0x11, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x04, "Upright" }, - {0x11, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x30, 0x30, "Very Easy" }, - {0x11, 0x01, 0x30, 0x20, "Easy" }, - {0x11, 0x01, 0x30, 0x10, "Hard" }, - {0x11, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x40, 0x00, "No" }, - {0x11, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x01, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x30, "2" }, - {0x12, 0x01, 0x30, 0x20, "3" }, - {0x12, 0x01, 0x30, 0x10, "4" }, - {0x12, 0x01, 0x30, 0x00, "5" }, -}; - -STDDIPINFO(Trckydoca) - -static struct BurnDIPInfo SaurobDIPList[]= -{ - {0x11, 0xff, 0xff, 0x99, NULL }, - {0x12, 0xff, 0xff, 0xd0, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x04, "Cocktail" }, - {0x11, 0x01, 0x04, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x30, 0x30, "Very Hard" }, - {0x11, 0x01, 0x30, 0x20, "Hard" }, - {0x11, 0x01, 0x30, 0x10, "Easy" }, - {0x11, 0x01, 0x30, 0x00, "Very Easy" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x40, 0x00, "Yes" }, - {0x11, 0x01, 0x40, 0x40, "No" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "4 Coins 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0c, 0x00, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x30, "5" }, - {0x12, 0x01, 0x30, 0x20, "4" }, - {0x12, 0x01, 0x30, 0x10, "3" }, - {0x12, 0x01, 0x30, 0x00, "2" }, -}; - -STDDIPINFO(Saurob) - -static void __fastcall sauro_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x80: - soundlatch = data | 0x80; - return; - - case 0xa0: - bg_scrollx = data; - return; - - case 0xa1: - fg_scrollx = data; - return; - - case 0xc0: - flipscreen = data ? 1 : 0; - return; - - case 0xe0: - watchdog = 0; - return; - - case 0xca: - case 0xcb: - palette_bank = (data & 3) << 4; - return; - - case 0xc3: // coin counter - coin 1 - case 0xc5: // coin counter - coin 2 - case 0xc2: - case 0xc4: - case 0xc6: - case 0xc7: - case 0xc8: - case 0xc9: - case 0xcc: - case 0xcd: - case 0xce: - return; - } -} - -static UINT8 __fastcall sauro_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return DrvDips[0]; - - case 0x20: - return DrvDips[1]; - - case 0x40: - return DrvInputs[0]; - - case 0x60: - return DrvInputs[1]; - } - - return 0; -} - -static void __fastcall trckydoc_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf820: - case 0xf821: - BurnYM3812Write(0, address & 1, data); - return; - - case 0xf830: - bg_scrollx = data; - return; - - case 0xf839: - flipscreen = data ? 1 : 0; - return; - - case 0xf83c: - watchdog = 0; - return; - - case 0xf838: // nop - case 0xf83a: // coin counters - case 0xf83b: // coin counters - case 0xf83f: - return; - } -} - -static UINT8 __fastcall trckydoc_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return DrvDips[0]; - - case 0xf808: - return DrvDips[1]; - - case 0xf810: - return DrvInputs[0]; - - case 0xf818: - return DrvInputs[1]; - } - - return 0; -} - -static void __fastcall sauro_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - case 0xc001: - BurnYM3812Write(0, address & 1, data); - return; - - case 0xa000: - // m_sp0256->ald_w(space, 0, data); - return; - - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - case 0xe004: - case 0xe005: - case 0xe006: - case 0xe00e: - case 0xe00f: - return; - } -} - -static UINT8 __fastcall sauro_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - UINT8 ret = soundlatch; - soundlatch = 0; - return ret; - } - - return 0; -} - -inline static INT32 DrvSynchroniseStream1(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -inline static INT32 DrvSynchroniseStream2(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 5000000; -} - - -static tilemap_callback( background ) -{ - INT32 attr = DrvVidRAM0[offs + 0x400]; - INT32 code = DrvVidRAM0[offs] + ((attr & 0x07) << 8); - INT32 color = ((attr >> 4) & 0x0f) + palette_bank; - INT32 flipx = attr & 0x08; - - TILE_SET_INFO(0, code, color, flipx ? TILE_FLIPX : 0); -} - -static tilemap_callback( foreground ) -{ - INT32 attr = DrvVidRAM1[offs + 0x400]; - INT32 code = DrvVidRAM1[offs] + ((attr & 0x07) << 8); - INT32 color = ((attr >> 4) & 0x0f) + palette_bank; - INT32 flipx = attr & 0x08; - - TILE_SET_INFO(1, code, color, flipx ? TILE_FLIPX : 0); -} - -static int DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - BurnYM3812Reset(); -// SP0256 - ZetClose(); - - soundlatch = 0; - flipscreen = 0; - bg_scrollx = 0; - fg_scrollx = 0; - palette_bank = 0; - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x00e000; - DrvZ80ROM1 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x040000; - - DrvSndROM = Next; Next += 0x002000; - - DrvColPROM = Next; Next += 0x000c00; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - DrvNVRAM = Next; Next += 0x000800; - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x000800; - DrvVidRAM0 = Next; Next += 0x000800; - DrvVidRAM1 = Next; Next += 0x000800; - - DrvZ80RAM1 = Next; Next += 0x000800; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Planes[4] = { STEP4(0,1) }; - INT32 XOffs[16] = { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 }; - INT32 YOffs[16] = { - (0x8000*8*3) + 0, (0x8000*8*2) + 0, (0x8000*8*1) + 0, (0x8000*8*0) + 0, - (0x8000*8*3) + 64, (0x8000*8*2) + 64, (0x8000*8*1) + 64, (0x8000*8*0) + 64, - (0x8000*8*3) + 128, (0x8000*8*2) + 128, (0x8000*8*1) + 128, (0x8000*8*0) + 128, - (0x8000*8*3) + 192, (0x8000*8*2) + 192, (0x8000*8*1) + 192, (0x8000*8*0) + 192 - }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - - memcpy (tmp, DrvGfxROM2, 0x20000); - - GfxDecode(0x0400, 4, 16, 16, Planes, XOffs, YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - for (INT32 i = 0x10000-1; i >= 0; i--) { - DrvGfxROM0[i*2+1] = DrvGfxROM0[i] & 0xf; - DrvGfxROM0[i*2+0] = DrvGfxROM0[i] >> 4; - DrvGfxROM1[i*2+1] = DrvGfxROM1[i] & 0xf; - DrvGfxROM1[i*2+0] = DrvGfxROM1[i] >> 4; - } -} - -static INT32 SauroInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 13, 1)) return 1; - - BurnLoadRom(DrvSndROM + 0x00000, 14, 1); // bootleg doesn't have this - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xdfff, MAP_ROM); - ZetMapMemory(DrvNVRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe800, 0xebff, MAP_RAM); - ZetMapMemory(DrvVidRAM0, 0xf000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvVidRAM1, 0xf800, 0xffff, MAP_RAM); - ZetSetOutHandler(sauro_main_write_port); - ZetSetInHandler(sauro_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(sauro_sound_write); - ZetSetReadHandler(sauro_sound_read); - ZetClose(); - - BurnYM3812Init(1, 2500000, NULL, DrvSynchroniseStream1, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - -// SP0256 - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_COLS, background_map_callback, 8, 8, 32, 32); - GenericTilemapInit(1, TILEMAP_SCAN_COLS, foreground_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 4, 8, 8, 0x20000, 0, 0x3f); - GenericTilemapSetGfx(1, DrvGfxROM1, 4, 8, 8, 0x20000, 0, 0x3f); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetOffsets(TMAP_GLOBAL, -8, -16); - - // necessary? - memset (DrvNVRAM, 0xff, 0x800); - DrvNVRAM[0] = 1; - - DrvDoReset(1); - - return 0; -} - -static INT32 TrckydocInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 7, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 10, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xdfff, MAP_ROM); - ZetMapMemory(DrvNVRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe800, 0xebff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xec00, 0xefff, MAP_RAM); - ZetMapMemory(DrvVidRAM0, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(trckydoc_sound_write); - ZetSetReadHandler(trckydoc_sound_read); - ZetClose(); - - ZetInit(1); // Just here to let us use same reset routine - - BurnYM3812Init(1, 2500000, NULL, DrvSynchroniseStream2, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_COLS, background_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 4, 8, 8, 0x20000, 0, 0x3f); - GenericTilemapSetOffsets(TMAP_GLOBAL, -8, -16); - - // necessary? - memset (DrvNVRAM, 0xff, 0x800); - DrvNVRAM[0] = 1; - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnYM3812Exit(); -// SP0256 - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x400; i++) - { - UINT8 r = DrvColPROM[0x000 + i] & 0xf; - UINT8 g = DrvColPROM[0x400 + i] & 0xf; - UINT8 b = DrvColPROM[0x800 + i] & 0xf; - - DrvPalette[i] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); - } -} - -static void draw_sprites(INT32 ext_bit, INT32 color_bank, INT32 x_offset) // extbit = 8 sauro, 2 trick -{ - for (INT32 offs = 3; offs < 0x400 - 1; offs += 4) - { - INT32 sy = DrvSprRAM[offs]; - INT32 sx = DrvSprRAM[offs+2]; - INT32 code = DrvSprRAM[offs+1] + ((DrvSprRAM[offs+3] & 0x03) << 8); - INT32 color = ((DrvSprRAM[offs+3] >> 4) & 0x0f) | color_bank; - - if (DrvSprRAM[offs+3] & ext_bit) - { - if (sx > 0xc0) - { - sx = (signed int)(signed char)sx; - } - } - else - { - if (sx < 0x40) continue; - } - - sx -= x_offset; - - if (ext_bit == 2) { - if (DrvSprRAM[offs + 3] & 0x08) { - sy += 8; - } - code &= 0x1ff; - } - - sy = 236 - sy; - - INT32 flipy = flipscreen; - INT32 flipx = DrvSprRAM[offs+3] & 0x04; - - if (flipy) - { - flipx = !flipx; - sx = (235 - sx) & 0xff; - sy = 240 - sy; - } - - if (sx < -15 || sx > nScreenWidth) continue; - if (sy < -15 || sy > nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0, DrvGfxROM2); - } - } - } -} - -static INT32 SauroDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - // weird! - const UINT8 fg_scrollmap[2][8] = { - {2, 1, 4, 3, 6, 5, 0, 7}, // not flipped - {0, 7, 2, 1, 4, 3, 6, 5} // flipped - }; - - INT32 scrollx = (fg_scrollx & 0xf8) | fg_scrollmap[flipscreen][fg_scrollx & 7]; - - GenericTilemapSetScrollX(0, bg_scrollx); - GenericTilemapSetScrollX(1, scrollx); - - if (nBurnLayer & 1) { - GenericTilemapDraw(0, pTransDraw, 0); - } else { - BurnTransferClear(); - } - if (nBurnLayer & 2) GenericTilemapDraw(1, pTransDraw, 1); - - if (nBurnLayer & 4) draw_sprites(0x08, palette_bank, 8); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 TrckydocDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - GenericTilemapSetScrollX(0, bg_scrollx); - - if (nBurnLayer & 1) { - GenericTilemapDraw(0, pTransDraw, 0); - } else { - BurnTransferClear(); - } - - if (nBurnLayer & 2) draw_sprites(0x02, 0, 8+2); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 SauroFrame() -{ - watchdog++; - if (watchdog >= 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - // bootleg's input lines are inverted - INT32 state = (BurnDrvGetFlags() & BDF_BOOTLEG) ? 0xff : 0; - - memset (DrvInputs, state, 2); - - for (INT32 i = 0 ; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nCyclesSegment; - INT32 nInterleave = 128; - INT32 nCyclesTotal[2] = { 5000000 / 56, 4000000 / 56 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - nCyclesDone[0] += ZetRun(nCyclesSegment - nCyclesDone[0]); - if (i == 120) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); // vblank - ZetClose(); - - ZetOpen(1); - nCyclesSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - nCyclesDone[1] += BurnTimerUpdateYM3812(nCyclesSegment); - if ((i & 0xf) == 0xf) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); // 8x per frame - ZetClose(); - } - - ZetOpen(1); - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); -// SP0256 - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 TrckydocFrame() -{ - watchdog++; - if (watchdog >= 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0, 2); - - for (INT32 i = 0 ; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nCyclesSegment; - INT32 nInterleave = 128; - INT32 nCyclesTotal[1] = { 5000000 / 56 }; - INT32 nCyclesDone[1] = { 0 }; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - nCyclesDone[0] += BurnTimerUpdateYM3812(nCyclesSegment - nCyclesDone[0]); - if (i == 120) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); // vblank - } - - BurnTimerEndFrameYM3812(nCyclesTotal[0]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029705; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); -// SP0256 - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(bg_scrollx); - SCAN_VAR(fg_scrollx); - SCAN_VAR(palette_bank); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNVRAM; - ba.nLen = 0x000800; - ba.nAddress = 0; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - return 0; -} - - -// Sauro - -static struct BurnRomInfo sauroRomDesc[] = { - { "sauro-2.bin", 0x8000, 0x19f8de25, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "sauro-1.bin", 0x8000, 0x0f8b876f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sauro-3.bin", 0x8000, 0x0d501e1b, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "sauro-6.bin", 0x8000, 0x4b77cb0f, 3 | BRF_GRA }, // 3 Background Tiles - { "sauro-7.bin", 0x8000, 0x187da060, 3 | BRF_GRA }, // 4 - - { "sauro-4.bin", 0x8000, 0x9b617cda, 4 | BRF_GRA }, // 5 Foreground Tiles - { "sauro-5.bin", 0x8000, 0xa6e2640d, 4 | BRF_GRA }, // 6 - - { "sauro-8.bin", 0x8000, 0xe08b5d5e, 5 | BRF_GRA }, // 7 Sprites - { "sauro-9.bin", 0x8000, 0x7c707195, 5 | BRF_GRA }, // 8 - { "sauro-10.bin", 0x8000, 0xc93380d1, 5 | BRF_GRA }, // 9 - { "sauro-11.bin", 0x8000, 0xf47982a8, 5 | BRF_GRA }, // 10 - - { "82s137-3.bin", 0x0400, 0xd52c4cd0, 6 | BRF_GRA }, // 11 Color data - { "82s137-2.bin", 0x0400, 0xc3e96d5d, 6 | BRF_GRA }, // 12 - { "82s137-1.bin", 0x0400, 0xbdfcf00c, 6 | BRF_GRA }, // 13 - - { "sp0256-al2.bin", 0x0800, 0xb504ac15, 7 | BRF_GRA }, // 14 Speech data -}; - -STD_ROM_PICK(sauro) -STD_ROM_FN(sauro) - -struct BurnDriver BurnDrvSauro = { - "sauro", NULL, NULL, NULL, "1987", - "Sauro\0", "Missing speech chip!", "Tecfri", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, sauroRomInfo, sauroRomName, NULL, NULL, TecfriInputInfo, TecfriDIPInfo, - SauroInit, DrvExit, SauroFrame, SauroDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// Sauro (Philko license) - -static struct BurnRomInfo sauropRomDesc[] = { - { "s2.3k", 0x8000, 0x79846222, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "s1.3f", 0x8000, 0x3efd13ed, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "s3.5x", 0x8000, 0x0d501e1b, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "s6.7x", 0x8000, 0x4b77cb0f, 3 | BRF_GRA }, // 3 Background Tiles - { "s7.7z", 0x8000, 0x187da060, 3 | BRF_GRA }, // 4 - - { "s4.7h", 0x8000, 0x9b617cda, 4 | BRF_GRA }, // 5 Foreground Tiles - { "s5.7k", 0x8000, 0xde5cd249, 4 | BRF_GRA }, // 6 - - { "s8.10l", 0x8000, 0xe08b5d5e, 5 | BRF_GRA }, // 7 Sprites - { "s9.10p", 0x8000, 0x7c707195, 5 | BRF_GRA }, // 8 - { "s10.10r", 0x8000, 0xc93380d1, 5 | BRF_GRA }, // 9 - { "s11.10t", 0x8000, 0xf47982a8, 5 | BRF_GRA }, // 10 - - { "82s137-3.bin", 0x0400, 0xd52c4cd0, 6 | BRF_GRA }, // 11 Color data - { "82s137-2.bin", 0x0400, 0xc3e96d5d, 6 | BRF_GRA }, // 12 - { "82s137-1.bin", 0x0400, 0xbdfcf00c, 6 | BRF_GRA }, // 13 - - { "sp0256-al2.bin", 0x0800, 0xb504ac15, 7 | BRF_GRA }, // 14 Speech data -}; - -STD_ROM_PICK(saurop) -STD_ROM_FN(saurop) - -struct BurnDriver BurnDrvSaurop = { - "saurop", "sauro", NULL, NULL, "1987", - "Sauro (Philko license)\0", "Missing speech chip!", "Tecfri (Philko license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, sauropRomInfo, sauropRomName, NULL, NULL, TecfriInputInfo, TecfriDIPInfo, - SauroInit, DrvExit, SauroFrame, SauroDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// Sauro (Recreativos Real S.A. license) - -static struct BurnRomInfo saurorrRomDesc[] = { - { "27256-2.bin", 0x8000, 0xb0d80eab, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "27256-1.bin", 0x8000, 0xcbb5f06e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sauro-3.bin", 0x8000, 0x0d501e1b, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "sauro-6.bin", 0x8000, 0x4b77cb0f, 3 | BRF_GRA }, // 3 Background Tiles - { "sauro-7.bin", 0x8000, 0x187da060, 3 | BRF_GRA }, // 4 - - { "sauro-4.bin", 0x8000, 0x9b617cda, 4 | BRF_GRA }, // 5 Foreground Tiles - { "27256-5.bin", 0x8000, 0x9aabdbe5, 4 | BRF_GRA }, // 6 - - { "sauro-8.bin", 0x8000, 0xe08b5d5e, 5 | BRF_GRA }, // 7 Sprites - { "sauro-9.bin", 0x8000, 0x7c707195, 5 | BRF_GRA }, // 8 - { "sauro-10.bin", 0x8000, 0xc93380d1, 5 | BRF_GRA }, // 9 - { "sauro-11.bin", 0x8000, 0xf47982a8, 5 | BRF_GRA }, // 10 - - { "82s137-3.bin", 0x0400, 0xd52c4cd0, 6 | BRF_GRA }, // 11 Color data - { "82s137-2.bin", 0x0400, 0xc3e96d5d, 6 | BRF_GRA }, // 12 - { "82s137-1.bin", 0x0400, 0xbdfcf00c, 6 | BRF_GRA }, // 13 - - { "sp0256-al2.bin", 0x0800, 0xb504ac15, 7 | BRF_GRA }, // 14 Speech data -}; - -STD_ROM_PICK(saurorr) -STD_ROM_FN(saurorr) - -struct BurnDriver BurnDrvSaurorr = { - "saurorr", "sauro", NULL, NULL, "1987", - "Sauro (Recreativos Real S.A. license)\0", "Missing speech chip!", "Tecfri (Recreativos Real S.A. license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, saurorrRomInfo, saurorrRomName, NULL, NULL, TecfriInputInfo, TecfriDIPInfo, - SauroInit, DrvExit, SauroFrame, SauroDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// Sauro (bootleg) - -static struct BurnRomInfo saurobRomDesc[] = { - { "sauro02.7c", 0x8000, 0x72026b9a, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "sauro01.6c", 0x8000, 0x4ff12c25, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sauro03.16e", 0x8000, 0xa30b60fc, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "sauro-6.bin", 0x8000, 0x4b77cb0f, 3 | BRF_GRA }, // 3 Background Tiles - { "sauro-7.bin", 0x8000, 0x187da060, 3 | BRF_GRA }, // 4 - - { "sauro-4.bin", 0x8000, 0x9b617cda, 4 | BRF_GRA }, // 5 Foreground Tiles - { "sauro-5.bin", 0x8000, 0xa6e2640d, 4 | BRF_GRA }, // 6 - - { "sauro-8.bin", 0x8000, 0xe08b5d5e, 5 | BRF_GRA }, // 7 Sprites - { "sauro-9.bin", 0x8000, 0x7c707195, 5 | BRF_GRA }, // 8 - { "sauro-10.bin", 0x8000, 0xc93380d1, 5 | BRF_GRA }, // 9 - { "sauro-11.bin", 0x8000, 0xf47982a8, 5 | BRF_GRA }, // 10 - - { "82s137-3.bin", 0x0400, 0xd52c4cd0, 6 | BRF_GRA }, // 11 Color data - { "82s137-2.bin", 0x0400, 0xc3e96d5d, 6 | BRF_GRA }, // 12 - { "82s137-1.bin", 0x0400, 0xbdfcf00c, 6 | BRF_GRA }, // 13 - - { "sauropr4.16h", 0x0200, 0x5261bc11, 7 | BRF_GRA }, // 14 Unknown prom -}; - -STD_ROM_PICK(saurob) -STD_ROM_FN(saurob) - -struct BurnDriver BurnDrvSaurob = { - "saurob", "sauro", NULL, NULL, "1987", - "Sauro (bootleg)\0", "Missing speech is normal", "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, saurobRomInfo, saurobRomName, NULL, NULL, TecfriInputInfo, SaurobDIPInfo, - SauroInit, DrvExit, SauroFrame, SauroDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// Tricky Doc (set 1) - -static struct BurnRomInfo trckydocRomDesc[] = { - { "trckydoc.d9", 0x8000, 0xc6242fc3, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "trckydoc.b9", 0x8000, 0x8645c840, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "trckydoc.e6", 0x8000, 0xec326392, 3 | BRF_GRA }, // 2 Background Tiles - { "trckydoc.g6", 0x8000, 0x6a65c088, 3 | BRF_GRA }, // 3 - - { "trckydoc.h1", 0x4000, 0x8b73cbf3, 5 | BRF_GRA }, // 4 Sprites - { "trckydoc.e1", 0x4000, 0x841be98e, 5 | BRF_GRA }, // 5 - { "trckydoc.c1", 0x4000, 0x1d25574b, 5 | BRF_GRA }, // 6 - { "trckydoc.a1", 0x4000, 0x436c59ba, 5 | BRF_GRA }, // 7 - - { "tdclr3.prm", 0x0100, 0x671d0140, 6 | BRF_GRA }, // 8 Color data - { "tdclr2.prm", 0x0100, 0x874f9050, 6 | BRF_GRA }, // 9 - { "tdclr1.prm", 0x0100, 0x57f127b0, 6 | BRF_GRA }, // 10 - - { "tdprm.prm", 0x0200, 0x5261bc11, 0 | BRF_OPT }, // 11 Unknown prom -}; - -STD_ROM_PICK(trckydoc) -STD_ROM_FN(trckydoc) - -struct BurnDriver BurnDrvTrckydoc = { - "trckydoc", NULL, NULL, NULL, "1987", - "Tricky Doc (set 1)\0", NULL, "Tecfri", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, trckydocRomInfo, trckydocRomName, NULL, NULL, TecfriInputInfo, TecfriDIPInfo, - TrckydocInit, DrvExit, TrckydocFrame, TrckydocDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// Tricky Doc (set 2) - -static struct BurnRomInfo trckydocaRomDesc[] = { - { "trckydca.d9", 0x8000, 0x99c38aa4, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "trckydca.b9", 0x8000, 0xb6048a15, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "trckydoc.e6", 0x8000, 0xec326392, 3 | BRF_GRA }, // 2 Background Tiles - { "trckydoc.g6", 0x8000, 0x6a65c088, 3 | BRF_GRA }, // 3 - - { "trckydoc.h1", 0x4000, 0x8b73cbf3, 5 | BRF_GRA }, // 4 Sprites - { "trckydoc.e1", 0x4000, 0x841be98e, 5 | BRF_GRA }, // 5 - { "trckydoc.c1", 0x4000, 0x1d25574b, 5 | BRF_GRA }, // 6 - { "trckydoc.a1", 0x4000, 0x436c59ba, 5 | BRF_GRA }, // 7 - - { "tdclr3.prm", 0x0100, 0x671d0140, 6 | BRF_GRA }, // 8 Color data - { "tdclr2.prm", 0x0100, 0x874f9050, 6 | BRF_GRA }, // 9 - { "tdclr1.prm", 0x0100, 0x57f127b0, 6 | BRF_GRA }, // 10 - - { "tdprm.prm", 0x0200, 0x5261bc11, 0 | BRF_OPT }, // 11 Unkown prom -}; - -STD_ROM_PICK(trckydoca) -STD_ROM_FN(trckydoca) - -struct BurnDriver BurnDrvTrckydoca = { - "trckydoca", "trckydoc", NULL, NULL, "1987", - "Tricky Doc (set 2)\0", NULL, "Tecfri", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, trckydocaRomInfo, trckydocaRomName, NULL, NULL, TecfriInputInfo, TrckydocaDIPInfo, - TrckydocInit, DrvExit, TrckydocFrame, TrckydocDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_scregg.cpp b/jan/src/burn/drv/pre90s/d_scregg.cpp deleted file mode 100644 index 59d534a91..000000000 --- a/jan/src/burn/drv/pre90s/d_scregg.cpp +++ /dev/null @@ -1,738 +0,0 @@ -// FB Alpha Eggs & Dommy driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m6502_intf.h" -#include "bitswap.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv6502ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM; -static UINT8 *Drv6502RAM; -static UINT8 *DrvColRAM; - -static INT16 *pAY8910Buffer[6]; -static INT16 *pFMBuffer = NULL; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static INT32 vblank = 0; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy2 + 6, "p1 start" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 0, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 1, "p1 left" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy1 + 7, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy2 + 7, "p2 start" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 0, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 1, "p2 left" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up", }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip 1" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip 2" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0f, 0x01, 0x03, 0x00, "2C 1C" }, - {0x0f, 0x01, 0x03, 0x03, "1C 1C" }, - {0x0f, 0x01, 0x03, 0x01, "1C 2C" }, - {0x0f, 0x01, 0x03, 0x02, "1C 3C" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0f, 0x01, 0x0c, 0x00, "2C 1C" }, - {0x0f, 0x01, 0x0c, 0x0c, "1C 3C" }, - {0x0f, 0x01, 0x0c, 0x04, "1C 2C" }, - {0x0f, 0x01, 0x0c, 0x08, "1C 3C" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x40, 0x40, "Cocktail" }, - {0x0f, 0x01, 0x40, 0x00, "Upright" }, - - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x01, 0x01, "3" }, - {0x10, 0x01, 0x01, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x10, 0x01, 0x06, 0x04, "30000" }, - {0x10, 0x01, 0x06, 0x02, "50000" }, - {0x10, 0x01, 0x06, 0x06, "70000" }, - {0x10, 0x01, 0x06, 0x00, "Never" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x10, 0x01, 0x80, 0x80, "Easy" }, - {0x10, 0x01, 0x80, 0x00, "Hard" }, -}; - -STDDIPINFO(Drv) - -// Delay allocation of buffer. This allows us to use the proper frames/sec frame rate. -static inline void DrvDelayAY8910BufferAllocation() -{ - if (pFMBuffer == NULL && pBurnSoundOut) - { - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * sizeof(INT16) * 6); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - } -} - -static inline INT32 calc_mirror_offset(UINT16 address) -{ - return ((address >> 5) & 0x1f) + ((address & 0x1f) << 5); -} - -static UINT8 eggs_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x1800) { - return DrvVidRAM[calc_mirror_offset(address)]; - } - - if ((address & 0xfc00) == 0x1c00) { - return DrvColRAM[calc_mirror_offset(address)]; - } - - switch (address) - { - case 0x2000: - return DrvDips[0] | vblank; - - case 0x2001: - return DrvDips[1]; - - case 0x2002: - return DrvInputs[0]; - - case 0x2003: - return DrvInputs[1]; - } - - return 0; -} - -void eggs_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x1800) { - DrvVidRAM[calc_mirror_offset(address)] = data; - return; - } - - if ((address & 0xfc00) == 0x1c00) { - DrvColRAM[calc_mirror_offset(address)] = data; - return; - } - - switch (address) - { - case 0x2000: - *flipscreen = data & 1; - break; - - case 0x2001: - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_NONE); - break; - - case 0x2004: - case 0x2005: - case 0x2006: - case 0x2007: - AY8910Write((address >> 1) & 1, address & 1, data); - break; - } -} - -static UINT8 dommy_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x2800) { - return DrvVidRAM[calc_mirror_offset(address)]; - } - - switch (address) - { - case 0x4000: - return DrvDips[0] | vblank; - - case 0x4001: - return DrvDips[1]; - - case 0x4002: - return DrvInputs[0]; - - case 0x4003: - return DrvInputs[1]; - } - - return 0; -} - -static void dommy_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x2800) { - DrvVidRAM[calc_mirror_offset(address)] = data; - return; - } - - switch (address) - { - case 0x4000: - M6502SetIRQLine(M6502_IRQ_LINE, CPU_IRQSTATUS_NONE); - break; - - case 0x4001: - *flipscreen = data & 1; - break; - - case 0x4004: - case 0x4005: - case 0x4006: - case 0x4007: - AY8910Write((address >> 1) & 1, address & 1, data); - break; - } -} - -static INT32 DrvDoReset() -{ - memset(AllRam, 0, RamEnd - AllRam); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - HiscoreReset(); - - AY8910Reset(0); - AY8910Reset(1); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - static INT32 Planes[3] = { 0x20000, 0x10000, 0 }; - static INT32 XOffs[16] = { STEP8(128,1), STEP8(0,1) }; - static INT32 YOffs[16] = { STEP16(0, 8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x6000); - - GfxDecode(0x400, 3, 8, 8, Planes, XOffs + 8, YOffs, 0x040, tmp, DrvGfxROM0); - GfxDecode(0x100, 3, 16, 16, Planes, XOffs + 0, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0;i < 8;i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void scregg6502Init() -{ - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Drv6502RAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x1000, 0x13ff, MAP_RAM); - M6502MapMemory(DrvColRAM, 0x1400, 0x17ff, MAP_RAM); - M6502MapMemory(Drv6502ROM + 0x3000, 0x3000, 0x7fff, MAP_ROM); - M6502MapMemory(Drv6502ROM + 0x7000, 0xf000, 0xffff, MAP_ROM); - M6502SetReadOpArgHandler(eggs_read); - M6502SetWriteHandler(eggs_write); - M6502SetReadOpHandler(eggs_read); - M6502SetReadHandler(eggs_read); - M6502Close(); -} - -static void dommy6502Init() -{ - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(Drv6502RAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvVidRAM, 0x2000, 0x23ff, MAP_RAM); - M6502MapMemory(DrvColRAM, 0x2400, 0x27ff, MAP_RAM); - M6502MapMemory(Drv6502ROM + 0xa000, 0xa000, 0xffff, MAP_ROM); - M6502SetReadOpArgHandler(dommy_read); - M6502SetWriteHandler(dommy_write); - M6502SetReadOpHandler(dommy_read); - M6502SetReadHandler(dommy_read); - M6502Close(); -} - -static INT32 rockduckLoadRoms() -{ - if (BurnLoadRom(Drv6502ROM + 0x4000, 0, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x6000, 1, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x8000, 2, 1)) return 1; - memcpy (Drv6502ROM + 0x3000, Drv6502ROM + 0x5000, 0x1000); - memcpy (Drv6502ROM + 0x5000, Drv6502ROM + 0x7000, 0x1000); - memcpy (Drv6502ROM + 0xe000, Drv6502ROM + 0x8000, 0x2000); - memcpy (Drv6502ROM + 0x7000, Drv6502ROM + 0x9000, 0x1000); - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 5, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 6, 1)) return 1; - - for (INT32 i = 0x2000; i < 0x6000; i++) - DrvGfxROM0[i] = BITSWAP08(DrvGfxROM0[i],2,0,3,6,1,4,7,5); - - return 0; -} - -static INT32 screggLoadRoms() -{ - if (BurnLoadRom(Drv6502ROM + 0x3000, 0, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x4000, 1, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x5000, 2, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x6000, 3, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0x7000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x3000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x5000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM, 11, 1)) return 1; - - return 0; -} - -static INT32 dommyLoadRoms() -{ - if (BurnLoadRom(Drv6502ROM + 0xa000, 0, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0xc000, 1, 1)) return 1; - if (BurnLoadRom(Drv6502ROM + 0xe000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 5, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 6, 1)) return 1; - - memcpy (DrvColPROM, DrvColPROM + 0x08, 8); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv6502ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0008 * sizeof(UINT32); - - AllRam = Next; - - Drv6502RAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(void (*m6502Init)(), INT32 (*pLoadCB)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pLoadCB) { - if (pLoadCB()) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - if (m6502Init) { - m6502Init(); - } - - BurnSetRefreshRate(57); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.23, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.23, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - BurnFree (pFMBuffer); - - return 0; -} - -static void draw_layer() -{ - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (~offs >> 2) & 0xf8; - INT32 sy = ( offs & 0x1f) << 3; - - UINT16 code = DrvVidRAM[offs] | ((DrvColRAM[offs] & 3) << 8); - - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, (sx ^ 0xf8) - 8, (sy ^ 0xf8) - 8, 0, 3, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx - 8, sy - 8, 0, 3, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - for (INT32 i = 0, offs = 0; i < 8; i++, offs += 0x80) - { - if (~DrvVidRAM[offs] & 0x01) continue; - - INT32 sx = 240 - DrvVidRAM[offs + 0x60]; - INT32 sy = 240 - DrvVidRAM[offs + 0x40]; - - INT32 flipx = DrvVidRAM[offs] & 0x04; - INT32 flipy = DrvVidRAM[offs] & 0x02; - - INT32 code = DrvVidRAM[offs + 0x20]; - - if (*flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx - 8, sy - 8, 0, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx - 8, sy - 8, 0, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx - 8, sy - 8, 0, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx - 8, sy - 8, 0, 3, 0, 0, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - DrvDelayAY8910BufferAllocation(); - - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT8)); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 32; - INT32 nTotalCycles = 1500000 / 57; - INT32 nCyclesRun = 0; - - M6502Open(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - nCyclesRun += M6502Run(nTotalCycles / nInterleave); - M6502SetIRQLine(M6502_IRQ_LINE, (i & 1) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - - if (i == 28) vblank = 0x80; - } - - M6502Close(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - AY8910Scan(nAction, pnMin); - } - - return 0; -} - - -// Dommy - -static struct BurnRomInfo dommyRomDesc[] = { - { "dommy.e01", 0x2000, 0x9ae064ed, 1 | BRF_ESS | BRF_PRG }, // 0 M6502 Code - { "dommy.e11", 0x2000, 0x7c4fad5c, 1 | BRF_ESS | BRF_PRG }, // 1 - { "dommy.e21", 0x2000, 0xcd1a4d55, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "dommy.e50", 0x2000, 0x5e9db0a4, 2 | BRF_GRA }, // 3 Graphics - { "dommy.e40", 0x2000, 0x4d1c36fb, 2 | BRF_GRA }, // 4 - { "dommy.e30", 0x2000, 0x4e68bb12, 2 | BRF_GRA }, // 5 - - { "dommy.e70", 0x0020, 0x50c1d86e, 3 | BRF_GRA }, // 6 Palette - - { "dommy.e60", 0x0020, 0x24da2b63, 4 | BRF_OPT }, // 7 -}; - -STD_ROM_PICK(dommy) -STD_ROM_FN(dommy) - -static INT32 dommyInit() -{ - return DrvInit(dommy6502Init, dommyLoadRoms); -} - -struct BurnDriver BurnDrvdommy = { - "dommy", NULL, NULL, NULL, "198?", - "Dommy\0", NULL, "Technos", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TECHNOS, GBF_MAZE, 0, - NULL, dommyRomInfo, dommyRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - dommyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x08, - 240, 248, 3, 4 -}; - - -// Scrambled Egg - -static struct BurnRomInfo screggRomDesc[] = { - { "d00.e14", 0x1000, 0x29226d77, 1 | BRF_ESS | BRF_PRG }, // 0 M6502 Code - { "d10.d14", 0x1000, 0xeb143880, 1 | BRF_ESS | BRF_PRG }, // 1 - { "d20.c14", 0x1000, 0x4455f262, 1 | BRF_ESS | BRF_PRG }, // 2 - { "d30.b14", 0x1000, 0x044ac5d2, 1 | BRF_ESS | BRF_PRG }, // 3 - { "d40.a14", 0x1000, 0xb5a0814a, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "d50.j12", 0x1000, 0xa485c10c, 2 | BRF_GRA }, // 5 Graphics - { "d60.j10", 0x1000, 0x1fd4e539, 2 | BRF_GRA }, // 6 - { "d70.h12", 0x1000, 0x8454f4b2, 2 | BRF_GRA }, // 7 - { "d80.h10", 0x1000, 0x72bd89ee, 2 | BRF_GRA }, // 8 - { "d90.g12", 0x1000, 0xff3c2894, 2 | BRF_GRA }, // 9 - { "da0.g10", 0x1000, 0x9c20214a, 2 | BRF_GRA }, // 10 - - { "dc0.c6", 0x0020, 0xff23bdd6, 3 | BRF_GRA }, // 11 Palette - - { "db1.b4", 0x0020, 0x7cc4824b, 0 | BRF_OPT }, // 12 -}; - -STD_ROM_PICK(scregg) -STD_ROM_FN(scregg) - -static INT32 screggInit() -{ - return DrvInit(scregg6502Init, screggLoadRoms); -} - -struct BurnDriver BurnDrvscregg = { - "scregg", NULL, NULL, NULL, "1983", - "Scrambled Egg\0", NULL, "Technos", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TECHNOS, GBF_MAZE, 0, - NULL, screggRomInfo, screggRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - screggInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x08, - 240, 240, 3, 4 -}; - - -// Eggs - -static struct BurnRomInfo eggsRomDesc[] = { - { "e14.bin", 0x1000, 0x4e216f9d, 1 | BRF_ESS | BRF_PRG }, // 0 M6502 Code - { "d14.bin", 0x1000, 0x4edb267f, 1 | BRF_ESS | BRF_PRG }, // 1 - { "c14.bin", 0x1000, 0x15a5c48c, 1 | BRF_ESS | BRF_PRG }, // 2 - { "b14.bin", 0x1000, 0x5c11c00e, 1 | BRF_ESS | BRF_PRG }, // 3 - { "a14.bin", 0x1000, 0x953faf07, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "j12.bin", 0x1000, 0xce4a2e46, 2 | BRF_GRA }, // 5 Graphics - { "j10.bin", 0x1000, 0xa1bcaffc, 2 | BRF_GRA }, // 6 - { "h12.bin", 0x1000, 0x9562836d, 2 | BRF_GRA }, // 7 - { "h10.bin", 0x1000, 0x3cfb3a8e, 2 | BRF_GRA }, // 8 - { "g12.bin", 0x1000, 0x679f8af7, 2 | BRF_GRA }, // 9 - { "g10.bin", 0x1000, 0x5b58d3b5, 2 | BRF_GRA }, // 10 - - { "eggs.c6", 0x0020, 0xe8408c81, 3 | BRF_GRA }, // 11 Palette - - { "db1.b4", 0x0020, 0x7cc4824b, 0 | BRF_OPT }, // 12 -}; - -STD_ROM_PICK(eggs) -STD_ROM_FN(eggs) - -struct BurnDriver BurnDrveggs = { - "eggs", "scregg", NULL, NULL, "1983", - "Eggs\0", NULL, "[Technos] Universal USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TECHNOS, GBF_MAZE, 0, - NULL, eggsRomInfo, eggsRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - screggInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x08, - 240, 240, 3, 4 -}; - - -// Rock Duck (prototype?) - -static struct BurnRomInfo rockduckRomDesc[] = { - { "rde.bin", 0x2000, 0x56e2a030, 1 | BRF_ESS | BRF_PRG }, // 0 M6502 Code - { "rdc.bin", 0x2000, 0x482d9a0c, 1 | BRF_ESS | BRF_PRG }, // 1 - { "rdb.bin", 0x2000, 0x974626f2, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "rd3.rdg", 0x2000, 0x8a3f1e53, 2 | BRF_GRA }, // 3 Graphics - { "rd2.rdh", 0x2000, 0xe94e673e, 2 | BRF_GRA }, // 4 - { "rd1.rdj", 0x2000, 0x654afff2, 2 | BRF_GRA }, // 5 - - { "eggs.c6", 0x0020, 0xe8408c81, 3 | BRF_GRA }, // 6 Palette -}; - -STD_ROM_PICK(rockduck) -STD_ROM_FN(rockduck) - -static INT32 rockduckInit() -{ - return DrvInit(scregg6502Init, rockduckLoadRoms); -} - -struct BurnDriver BurnDrvrockduck = { - "rockduck", NULL, NULL, NULL, "1983", - "Rock Duck (prototype?)\0", "incorrect colors", "Datel SAS", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TECHNOS, GBF_MAZE, 0, - NULL, rockduckRomInfo, rockduckRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - rockduckInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x08, - 240, 240, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_seicross.cpp b/jan/src/burn/drv/pre90s/d_seicross.cpp deleted file mode 100644 index 2cf2e2960..000000000 --- a/jan/src/burn/drv/pre90s/d_seicross.cpp +++ /dev/null @@ -1,1079 +0,0 @@ -// FB Alpha Frisky Tom / Seicross / Radical Radial driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6800_intf.h" -#include "dac.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvMCUOps; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvMCURAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRegs; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 irq_mask; -static UINT8 flipscreen; -static UINT8 portb_data; -static UINT8 mcu_halt; -static UINT8 watchdog; - -static INT32 game_select = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[5]; -static UINT8 DrvInputs[6]; -static UINT8 DrvReset; - -static struct BurnInputInfo FriskytInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Friskyt) - -static struct BurnInputInfo RadradInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Radrad) - -static struct BurnInputInfo SeicrossInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, - {"Dip E", BIT_DIPSWITCH, DrvDips + 4, "dip" }, -}; - -STDINPUTINFO(Seicross) - -static struct BurnDIPInfo FriskytDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 2, "Counter Check" }, - {0x0e, 0x01, 0x80, 0x00, "Off" }, - {0x0e, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Test Mode" }, - {0x0f, 0x01, 0x01, 0x00, "Off" }, - {0x0f, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Connection Error" }, - {0x0f, 0x01, 0x02, 0x00, "Off" }, - {0x0f, 0x01, 0x02, 0x02, "On" }, -}; - -STDDIPINFO(Friskyt) - -static struct BurnDIPInfo RadradDIPList[]= -{ - {0x12, 0xff, 0xff, 0xf3, NULL }, - {0x13, 0xff, 0xff, 0xf1, NULL }, - {0x14, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x01, 0x01, "Upright" }, - {0x12, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x06, 0x00, "2" }, - {0x12, 0x01, 0x06, 0x02, "3" }, - {0x12, 0x01, 0x06, 0x04, "4" }, - {0x12, 0x01, 0x06, 0x06, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 15, "Coin A" }, - {0x13, 0x01, 0x0f, 0x07, "7 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "6 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x04, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "7 Coins/2 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "6 Coins/2 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "5 Coins/2 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "4 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x02, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "2 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "2 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "2 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "2 Coins 6 Credits" }, - {0x14, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "2 Coins 7 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "2 Coins 8 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, -}; - -STDDIPINFO(Radrad) - -static struct BurnDIPInfo SeicrossDIPList[]= -{ - {0x10, 0xff, 0xff, 0xfc, NULL }, - {0x11, 0xff, 0xff, 0xf0, NULL }, - {0x12, 0xff, 0xff, 0xf1, NULL }, - {0x13, 0xff, 0xff, 0xf0, NULL }, - {0x14, 0xff, 0xff, 0xe0, NULL }, - - {0 , 0xfe, 0 , 2, "Connection Error" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x01, 0x00, "Off" }, - {0x11, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x02, 0x00, "Off" }, - {0x11, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x0c, 0x00, "20000 40000" }, - {0x11, 0x01, 0x0c, 0x04, "30000" }, - {0x11, 0x01, 0x0c, 0x08, "30000 50000" }, - {0x11, 0x01, 0x0c, 0x0c, "30000 60000 90000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x01, 0x01, "Upright" }, - {0x12, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x12, 0x01, 0x02, 0x00, "Easy" }, - {0x12, 0x01, 0x02, 0x02, "Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x00, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x03, 0x03, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x03, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0c, 0x08, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Debug Mode" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Seicross) - -static void __fastcall seicross_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x9c00) { - DrvColRAM[address & 0x3df] = data; - DrvColRAM[(address & 0x3ff)| 0x20] = data; - return; - } -} - -static UINT8 __fastcall seicross_main_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return DrvInputs[0]; - - case 0xa800: - return DrvInputs[1]; - - case 0xb000: - return DrvInputs[2]; - - case 0xb800: - watchdog = 0; - return 0; - } - - return 0; -} - -static void __fastcall seicross_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xf7) // mirror 0x08 - { - case 0x00: - case 0x01: - AY8910Write(0, port & 1, data); - return; - } -} - -static UINT8 __fastcall seicross_main_read_port(UINT16 port) -{ - switch (port & 0xf7) // mirror 0x08 - { - case 0x04: - return AY8910Read(0); - } - - return 0; -} - -static void seicross_mcu_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - DACWrite(0, data); - return; - } -} - -static UINT8 seicross_mcu_read(UINT16 address) -{ - switch (address) - { - case 0x1003: - return DrvInputs[3]; - - case 0x1005: - return DrvInputs[4]; - - case 0x1006: - return DrvInputs[5]; - } - - return 0; -} - -static UINT8 ay8910_read_B(UINT32) -{ - return (portb_data & 0x9f) | (DrvDips[4] & 0x60); -} - -static void ay8910_write_B(UINT32, UINT32 data) -{ - irq_mask = data & 1; - - flipscreen = data & 2; - - if (((portb_data & 4) == 0) && (data & 4)) - { - NSC8105Reset(); - mcu_halt = 0; - } - - portb_data = data; -} - - -static INT32 syncronize_dac() -{ - return (INT32)(float)(nBurnSoundLen * (nM6800CyclesTotal / (3072000.000 / 60))); -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - NSC8105Reset(); - mcu_halt = 1; - - AY8910Reset(0); - DACReset(); - - static const UINT8 nvram_data[32] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0 - }; - - memset (DrvNVRAM, 0, 0x100); - memcpy (DrvNVRAM, nvram_data, 32); - - watchdog = 0; - irq_mask = 0; - flipscreen = 0; - portb_data = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x008000; - DrvMCUOps = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000040; - - DrvNVRAM = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0040 * sizeof(UINT32); - - AllRam = Next; - - DrvMCURAM = Next; Next += 0x000100; - DrvShareRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000100; // 8820-887f - DrvVidRegs = Next; Next += 0x000100; // 9800-981f scroll, 9880-989f spr2 - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { 0, 4 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(8,1), STEP4(16*8,1), STEP4(17*8,1) }; - INT32 YOffs[16] = { STEP8(0,16), STEP8(16*16,16) }; - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x0200, 2, 8, 8, Plane, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - GfxDecode(0x0100, 2, 16, 16, Plane, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - game_select = select; - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x3000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x5000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x6000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x7000, 7, 1)) return 1; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "radradj") ==0) { - if (BurnLoadRom(DrvZ80ROM + 0x7000, 7, 1)) return 1; - memcpy (DrvZ80ROM + 0x7800, DrvGfxROM0 + 0x7000, 0x0800); - } - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x3000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 13, 1)) return 1; - - if (game_select == 1) { - for (INT32 i = 0; i < 0x7800; i++) { - DrvMCUOps[i] = BITSWAP08(DrvZ80ROM[i], 6, 7, 5, 4, 3, 2, 0, 1); - } - } - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x77ff, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0x7800, 0x7fff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x8800, 0x88ff, MAP_RAM); // 8820-887f - ZetMapMemory(DrvVidRAM, 0x9000, 0x93ff, MAP_RAM); - ZetMapMemory(DrvVidRegs, 0x9800, 0x98ff, MAP_RAM); // 9800-981f scroll, 9880-989f spr2 - ZetMapMemory(DrvColRAM, 0x9c00, 0x9fff, MAP_READ); - ZetSetWriteHandler(seicross_main_write); - ZetSetReadHandler(seicross_main_read); - ZetSetOutHandler(seicross_main_write_port); - ZetSetInHandler(seicross_main_read_port); - ZetClose(); - - NSC8105Init(1); - NSC8105MapMemory(DrvMCURAM, 0x0000, 0x00ff, MAP_RAM); // 0-7f - if (game_select < 2) - NSC8105MapMemory(DrvNVRAM, 0x1000, 0x10ff, MAP_RAM); - NSC8105MapMemory(DrvZ80ROM, 0x8000, 0xf7ff, MAP_ROM); - if (game_select == 1) - NSC8105MapMemory(DrvMCUOps, 0x8000, 0xf7ff, MAP_FETCH); - NSC8105MapMemory(DrvShareRAM, 0xf800, 0xffff, MAP_RAM); - NSC8105SetWriteHandler(seicross_mcu_write); - NSC8105SetReadHandler(seicross_mcu_read); - - AY8910Init(0, 1536000, nBurnSoundRate, NULL, &ay8910_read_B, NULL, &ay8910_write_B); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, syncronize_dac); - DACSetRoute(0, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - NSC8105Exit(); - - AY8910Exit(0); - DACExit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x40; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x4f * bit0 + 0xa8 * bit1; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sy -= (DrvVidRegs[sx/8] + 16) & 0xff; - if (sy < -7) sy += 256; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] + ((attr & 0x10) << 4); - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } - } - } -} - -static void draw_single_sprite(INT32 code, INT32 sx, INT32 sy, INT32 color, INT32 flipx, INT32 flipy) -{ - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM1); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x80 - 4; offs >= 0x20; offs -= 4) - { - INT32 attr = DrvSprRAM[offs + 1]; - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = 240 - DrvSprRAM[offs + 2]; - INT32 code =(DrvSprRAM[offs + 0] & 0x3f) + ((attr & 0x10) << 2) + 128; - INT32 color = attr & 0x0f; - INT32 flipx = DrvSprRAM[offs + 0] & 0x40; - INT32 flipy = DrvSprRAM[offs + 0] & 0x80; - - if (nBurnLayer & 4) draw_single_sprite(code, sx, sy, color, flipx, flipy); - if (nBurnLayer & 4) if (sx > 0xf0) draw_single_sprite(code, sx - 256, sy, color, flipx, flipy); - } - - for (INT32 offs = 0xA0 - 4; offs >= 0x80; offs -= 4) - { - INT32 attr = DrvVidRegs[offs + 1]; - INT32 sx = DrvVidRegs[offs + 3]; - INT32 sy = 240 - DrvVidRegs[offs + 2]; - INT32 code =(DrvVidRegs[offs + 0] & 0x3f) + ((attr & 0x10) << 2); - INT32 color = attr & 0x0f; - INT32 flipx = DrvVidRegs[offs + 0] & 0x40; - INT32 flipy = DrvVidRegs[offs + 0] & 0x80; - - if (nBurnLayer & 8) draw_single_sprite(code, sx, sy, color, flipx, flipy); - if (nBurnLayer & 8) if (sx > 0xf0) draw_single_sprite(code, sx - 256, sy, color, flipx, flipy); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(); - if (nBurnLayer & 2) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (DrvReset || watchdog >= 180) { - DrvDoReset((watchdog < 180) ? 1 : 0); - } - - ZetNewFrame(); - NSC8105NewFrame(); - - { - memset (DrvInputs, 0, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - switch (game_select) - { - case 0: // friskyt, friskyta - case 1: // friskytb - DrvInputs[1] = (DrvDips[0] & 0x80) | (DrvInputs[1] & 0x7f); - DrvInputs[2] = DrvDips[1]; - break; - - case 2: // radrad - DrvInputs[3] = DrvDips[0]; - DrvInputs[4] = DrvDips[1]; - DrvInputs[5] = DrvDips[2]; - break; - - case 3: // seicross / sectrzon - DrvInputs[2] = DrvDips[0]; - DrvInputs[3] = DrvDips[1]; - DrvInputs[4] = DrvDips[2]; - DrvInputs[5] = DrvDips[3]; - break; - } - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 256; - INT32 nCyclesTotal = 3072000 / 60; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal / nInterleave; - - nCyclesDone[0] += ZetRun(nSegment); - if (i == 240 && irq_mask) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - - if (mcu_halt) { - nCyclesDone[1] = ZetTotalCycles(); - nM6800CyclesTotal += ZetTotalCycles() - nM6800CyclesTotal; - } else { - nCyclesDone[1] += NSC8105Run(ZetTotalCycles() - nM6800CyclesTotal); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - - } - - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - NSC8105Scan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(mcu_halt); - SCAN_VAR(irq_mask); - SCAN_VAR(flipscreen); - SCAN_VAR(portb_data); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNVRAM; - ba.nLen = 0x0100; - ba.nAddress = 0; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - return 0; -} - - -// Frisky Tom (set 1) - -static struct BurnRomInfo friskytRomDesc[] = { - { "ftom.01", 0x1000, 0xbce5d486, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 & NSC8105 Code - { "ftom.02", 0x1000, 0x63157d6e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ftom.03", 0x1000, 0xc8d9ef2c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ftom.04", 0x1000, 0x23a01aac, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ftom.05", 0x1000, 0xbfaf702a, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ftom.06", 0x1000, 0xbce70b9c, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ftom.07", 0x1000, 0xb2ef303a, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ft8_8.rom", 0x0800, 0x10461a24, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ftom.11", 0x1000, 0x1ec6ff65, 2 | BRF_GRA }, // 8 Graphics - { "ftom.12", 0x1000, 0x3b8f40b5, 2 | BRF_GRA }, // 9 - { "ftom.09", 0x1000, 0x60642f25, 2 | BRF_GRA }, // 10 - { "ftom.10", 0x1000, 0x07b9dcfc, 2 | BRF_GRA }, // 11 - - { "ft.9c", 0x0020, 0x0032167e, 3 | BRF_GRA }, // 12 Color Data - { "ft.9b", 0x0020, 0x6b364e69, 3 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(friskyt) -STD_ROM_FN(friskyt) - -static INT32 friskytInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvFriskyt = { - "friskyt", NULL, NULL, NULL, "1981", - "Frisky Tom (set 1)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, friskytRomInfo, friskytRomName, NULL, NULL, FriskytInputInfo, FriskytDIPInfo, - friskytInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 224, 4, 3 -}; - - -// Frisky Tom (set 2) - -static struct BurnRomInfo friskytaRomDesc[] = { - { "ft.01", 0x1000, 0x0ea46e19, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 & NSC8105 Code - { "ft.02", 0x1000, 0x4f7b8662, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ft.03", 0x1000, 0x1eb1b77c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ft.04", 0x1000, 0xb5c5400d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ft.05", 0x1000, 0xb465be8a, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ft.06", 0x1000, 0x90141317, 1 | BRF_PRG | BRF_ESS }, // 5 - { "ft.07", 0x1000, 0x0ba02b2e, 1 | BRF_PRG | BRF_ESS }, // 6 - { "ft8_8.rom", 0x0800, 0x10461a24, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "ft.11", 0x1000, 0x956d924a, 2 | BRF_GRA }, // 8 Graphics - { "ft.12", 0x1000, 0xc028d3b8, 2 | BRF_GRA }, // 9 - { "ftom.09", 0x1000, 0x60642f25, 2 | BRF_GRA }, // 10 - { "ftom.10", 0x1000, 0x07b9dcfc, 2 | BRF_GRA }, // 11 - - { "ft.9c", 0x0020, 0x0032167e, 3 | BRF_GRA }, // 12 Color Data - { "ft.9b", 0x0020, 0x6b364e69, 3 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(friskyta) -STD_ROM_FN(friskyta) - -struct BurnDriver BurnDrvFriskyta = { - "friskyta", "friskyt", NULL, NULL, "1981", - "Frisky Tom (set 2)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, friskytaRomInfo, friskytaRomName, NULL, NULL, FriskytInputInfo, FriskytDIPInfo, - friskytInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 224, 4, 3 -}; - - -// Frisky Tom (set 3, encrypted) - -static struct BurnRomInfo friskytbRomDesc[] = { - { "1.3a", 0x1000, 0x554bdb0f, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 & NSC8105 Code (Encrypted) - { "2.3b", 0x1000, 0x0658633a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.3d", 0x1000, 0xc8de15ff, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.3e", 0x1000, 0x970e5d2b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.3f", 0x1000, 0x45c8bd32, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6.3h", 0x1000, 0x2c1b7ecc, 1 | BRF_PRG | BRF_ESS }, // 5 - { "7.3i", 0x1000, 0xaa36a6b8, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8.3j", 0x0800, 0x10461a24, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "11.7l", 0x1000, 0xcaa93315, 2 | BRF_GRA }, // 8 Graphics - { "12.7n", 0x1000, 0xc028d3b8, 2 | BRF_GRA }, // 9 - { "9.7h", 0x1000, 0x60642f25, 2 | BRF_GRA }, // 10 - { "10.7j", 0x1000, 0x07b9dcfc, 2 | BRF_GRA }, // 11 - - { "ft.9c", 0x0020, 0x0032167e, 3 | BRF_GRA }, // 12 Color Data - { "ft.9b", 0x0020, 0x6b364e69, 3 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(friskytb) -STD_ROM_FN(friskytb) - -static INT32 friskytbInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvFriskytb = { - "friskytb", "friskyt", NULL, NULL, "1981", - "Frisky Tom (set 3, encrypted)\0", "Broken, please use parent romset!", "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MAZE, 0, - NULL, friskytbRomInfo, friskytbRomName, NULL, NULL, FriskytInputInfo, FriskytDIPInfo, - friskytbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 224, 4, 3 -}; - - -// Radical Radial (US) - -static struct BurnRomInfo radradRomDesc[] = { - { "1.3a", 0x1000, 0xb1e958ca, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 & NSC8105 Code - { "2.3b", 0x1000, 0x30ba76b3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.3c", 0x1000, 0x1c9f397b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.3d", 0x1000, 0x453966a3, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.3e", 0x1000, 0xc337c4bd, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6.3f", 0x1000, 0x06e15b59, 1 | BRF_PRG | BRF_ESS }, // 5 - { "7.3g", 0x1000, 0x02b1f9c9, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8.3h", 0x0800, 0x911c90e8, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "11.l7", 0x1000, 0x4ace7afb, 2 | BRF_GRA }, // 8 Graphics - { "12.n7", 0x1000, 0xb19b8473, 2 | BRF_GRA }, // 9 - { "9.j7", 0x1000, 0x229939a3, 2 | BRF_GRA }, // 10 - { "10.j7", 0x1000, 0x79237913, 2 | BRF_GRA }, // 11 - - { "clr.9c", 0x0020, 0xc9d88422, 3 | BRF_GRA }, // 12 Color Data - { "clr.9b", 0x0020, 0xee81af16, 3 | BRF_GRA }, // 13 - - { "pal16h2.2b", 0x0044, 0xa356803a, 0 | BRF_OPT }, // 14 plds -}; - -STD_ROM_PICK(radrad) -STD_ROM_FN(radrad) - -static INT32 radradInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvRadrad = { - "radrad", NULL, NULL, NULL, "1982", - "Radical Radial (US)\0", NULL, "Nichibutsu USA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, radradRomInfo, radradRomName, NULL, NULL, RadradInputInfo, RadradDIPInfo, - radradInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 224, 4, 3 -}; - - -// Radical Radial (Japan) -// Top and bottom PCBs have Nihon Bussan etched and the top PCB has a Nichibutsu sticker - -static struct BurnRomInfo radradjRomDesc[] = { - { "1.3a", 0x1000, 0xb1e958ca, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 & NSC8105 Code - { "2.3b", 0x1000, 0x30ba76b3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.3d", 0x1000, 0x1c9f397b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.3d", 0x1000, 0x453966a3, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.3f", 0x1000, 0xc337c4bd, 1 | BRF_PRG | BRF_ESS }, // 4 - { "6.3h", 0x1000, 0x06e15b59, 1 | BRF_PRG | BRF_ESS }, // 5 - { "7.3i", 0x1000, 0x02b1f9c9, 1 | BRF_PRG | BRF_ESS }, // 6 - { "8.3j", 0x1000, 0xbc9c7fae, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "11.7k", 0x1000, 0xc75b96da, 2 | BRF_GRA }, // 8 Graphics - { "12.7m", 0x1000, 0x83f35c05, 2 | BRF_GRA }, // 9 - { "9.7h", 0x1000, 0xf2da3954, 2 | BRF_GRA }, // 10 - { "10.7j", 0x1000, 0x79237913, 2 | BRF_GRA }, // 11 - - { "clr.9c", 0x0020, 0xc9d88422, 3 | BRF_GRA }, // 12 Color Data - { "clr.9b", 0x0020, 0xee81af16, 3 | BRF_GRA }, // 13 - - { "pal16h2.2b", 0x0044, 0xa356803a, 0 | BRF_OPT }, // 14 plds -}; - -STD_ROM_PICK(radradj) -STD_ROM_FN(radradj) - -struct BurnDriver BurnDrvRadradj = { - "radradj", "radrad", NULL, NULL, "1982", - "Radical Radial (Japan)\0", NULL, "Logitec Corp.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, radradjRomInfo, radradjRomName, NULL, NULL, RadradInputInfo, RadradDIPInfo, - radradInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 224, 4, 3 -}; - - -// Seicross - -static struct BurnRomInfo seicrossRomDesc[] = { - { "smc1", 0x1000, 0xf6c3aeca, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 & NSC8105 Code - { "smc2", 0x1000, 0x0ec6c218, 1 | BRF_PRG | BRF_ESS }, // 1 - { "smc3", 0x1000, 0xceb3c8f4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "smc4", 0x1000, 0x3112af59, 1 | BRF_PRG | BRF_ESS }, // 3 - { "smc5", 0x1000, 0xb494a993, 1 | BRF_PRG | BRF_ESS }, // 4 - { "smc6", 0x1000, 0x09d5b9da, 1 | BRF_PRG | BRF_ESS }, // 5 - { "smc7", 0x1000, 0x13052b03, 1 | BRF_PRG | BRF_ESS }, // 6 - { "smc8", 0x0800, 0x2093461d, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "sz11.7k", 0x1000, 0xfbd9b91d, 2 | BRF_GRA }, // 8 Graphics - { "smcd", 0x1000, 0xc3c953c4, 2 | BRF_GRA }, // 9 - { "sz9.7j", 0x1000, 0x4819f0cd, 2 | BRF_GRA }, // 10 - { "sz10.7h", 0x1000, 0x4c268778, 2 | BRF_GRA }, // 11 - - { "sz73.10c", 0x0020, 0x4d218a3c, 3 | BRF_GRA }, // 12 Color Data - { "sz74.10b", 0x0020, 0xc550531c, 3 | BRF_GRA }, // 13 - - { "pal16h2.3b", 0x0044, 0xe1a6a86d, 0 | BRF_OPT }, // 14 PLDs -}; - -STD_ROM_PICK(seicross) -STD_ROM_FN(seicross) - -static INT32 seicrossInit() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvSeicross = { - "seicross", NULL, NULL, NULL, "1984", - "Seicross\0", NULL, "Nichibutsu / Alice", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, seicrossRomInfo, seicrossRomName, NULL, NULL, SeicrossInputInfo, SeicrossDIPInfo, - seicrossInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 224, 256, 3, 4 -}; - - -// Sector Zone - -static struct BurnRomInfo sectrzonRomDesc[] = { - { "sz1.3a", 0x1000, 0xf0a45cb4, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 & NSC8105 Code - { "sz2.3c", 0x1000, 0xfea68ddb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sz3.3d", 0x1000, 0xbaad4294, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sz4.3e", 0x1000, 0x75f2ca75, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sz5.3fg", 0x1000, 0xdc14f2c8, 1 | BRF_PRG | BRF_ESS }, // 4 - { "sz6.3h", 0x1000, 0x397a38c5, 1 | BRF_PRG | BRF_ESS }, // 5 - { "sz7.3i", 0x1000, 0x7b34dc1c, 1 | BRF_PRG | BRF_ESS }, // 6 - { "sz8.3j", 0x0800, 0x9933526a, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "sz11.7k", 0x1000, 0xfbd9b91d, 2 | BRF_GRA }, // 8 Graphics - { "sz12.7m", 0x1000, 0x2bdef9ad, 2 | BRF_GRA }, // 9 - { "sz9.7j", 0x1000, 0x4819f0cd, 2 | BRF_GRA }, // 10 - { "sz10.7h", 0x1000, 0x4c268778, 2 | BRF_GRA }, // 11 - - { "sz73.10c", 0x0020, 0x4d218a3c, 3 | BRF_GRA }, // 12 Color Data - { "sz74.10b", 0x0020, 0xc550531c, 3 | BRF_GRA }, // 13 - - { "pal16h2.3b", 0x0044, 0xe1a6a86d, 0 | BRF_OPT }, // 14 PLDs -}; - -STD_ROM_PICK(sectrzon) -STD_ROM_FN(sectrzon) - -struct BurnDriver BurnDrvSectrzon = { - "sectrzon", "seicross", NULL, NULL, "1984", - "Sector Zone\0", NULL, "Nichibutsu / Alice", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, sectrzonRomInfo, sectrzonRomName, NULL, NULL, SeicrossInputInfo, SeicrossDIPInfo, - seicrossInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x40, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_sf.cpp b/jan/src/burn/drv/pre90s/d_sf.cpp deleted file mode 100644 index f0de7b8f1..000000000 --- a/jan/src/burn/drv/pre90s/d_sf.cpp +++ /dev/null @@ -1,1799 +0,0 @@ -// FB Alpha Street Fighter driver module -// Based on MAME driver by Olivier Galibert - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm5205.h" - -static UINT8 *Mem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68kRom; -static UINT8 *DrvZ80Rom0; -static UINT8 *DrvZ80Rom1; -static UINT8 *Drv68kPalRam; -static UINT8 *Drv68kVidRam; -static UINT8 *Drv68kRam; -static UINT8 *DrvZ80Ram0; -static UINT8 *Gfx0; -static UINT8 *Gfx1; -static UINT8 *Gfx2; -static UINT8 *Gfx3; -static UINT8 *Gfx4; -static UINT8 *Gfx1Trans; -static UINT8 *Gfx3Trans; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvJoy5[16]; -static UINT8 DrvDips[ 4]; -static UINT8 DrvReset; -static UINT16 DrvInputs[8]; - -static INT32 version; - -static INT32 sf_fg_scroll_x; -static INT32 sf_bg_scroll_x; - -static INT32 soundlatch; -static INT32 flipscreen; - -static INT32 sf_active; -static INT32 sound2_bank; - -static struct BurnInputInfo SfInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 1, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 3, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 2, "p1 down", }, - {"P1 Left" , BIT_DIGITAL , DrvJoy3 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy3 + 0, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy4 + 1, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy4 + 2, "p1 fire 3"}, - {"P1 Button 4" , BIT_DIGITAL , DrvJoy4 + 8, "p1 fire 4"}, - {"P1 Button 5" , BIT_DIGITAL , DrvJoy4 + 9, "p1 fire 5"}, - {"P1 Button 6" , BIT_DIGITAL , DrvJoy4 + 10, "p1 fire 6"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 11, "p2 up", }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 10, "p2 down", }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 9, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 8, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy5 + 0, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy5 + 1, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy5 + 2, "p2 fire 3"}, - {"P2 Button 4" , BIT_DIGITAL , DrvJoy5 + 8, "p2 fire 4"}, - {"P2 Button 5" , BIT_DIGITAL , DrvJoy5 + 9, "p2 fire 5"}, - {"P2 Button 6" , BIT_DIGITAL , DrvJoy5 + 10, "p2 fire 6"}, - - {"Service" , BIT_DIGITAL , DrvJoy1 + 2, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip 4", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Sf) - -static struct BurnInputInfo SfjInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 1, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 3, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 2, "p1 down", }, - {"P1 Left" , BIT_DIGITAL , DrvJoy3 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy3 + 0, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 8, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 9, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy3 + 10, "p1 fire 3"}, - {"P1 Button 4" , BIT_DIGITAL , DrvJoy3 + 12, "p1 fire 4"}, - {"P1 Button 5" , BIT_DIGITAL , DrvJoy3 + 13, "p1 fire 5"}, - {"P1 Button 6" , BIT_DIGITAL , DrvJoy3 + 14, "p1 fire 6"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 3, "p1 up", }, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 2, "p2 down", }, - {"P2 Left" , BIT_DIGITAL , DrvJoy4 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy4 + 0, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy4 + 8, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy4 + 9, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy4 + 10, "p2 fire 3"}, - {"P2 Button 4" , BIT_DIGITAL , DrvJoy4 + 12, "p2 fire 4"}, - {"P2 Button 5" , BIT_DIGITAL , DrvJoy4 + 13, "p2 fire 5"}, - {"P2 Button 6" , BIT_DIGITAL , DrvJoy4 + 14, "p2 fire 6"}, - - {"Service" , BIT_DIGITAL , DrvJoy1 + 2, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip 4", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Sfj) - -static struct BurnInputInfo SfusInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 1, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 3, "p1 up", }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 2, "p1 down", }, - {"P1 Left" , BIT_DIGITAL , DrvJoy3 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy3 + 0, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy2 + 9, "p1 fire 3"}, - {"P1 Button 4" , BIT_DIGITAL , DrvJoy3 + 6, "p1 fire 4"}, - {"P1 Button 5" , BIT_DIGITAL , DrvJoy3 + 7, "p1 fire 5"}, - {"P1 Button 6" , BIT_DIGITAL , DrvJoy2 + 2, "p1 fire 6"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 11, "p1 up", }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 10, "p2 down", }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 9, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 8, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 12, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 13, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy2 + 10, "p2 fire 3"}, - {"P2 Button 4" , BIT_DIGITAL , DrvJoy3 + 14, "p2 fire 4"}, - {"P2 Button 5" , BIT_DIGITAL , DrvJoy3 + 15, "p2 fire 5"}, - {"P2 Button 6" , BIT_DIGITAL , DrvJoy2 + 8, "p2 fire 6"}, - - {"Service" , BIT_DIGITAL , DrvJoy1 + 2, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip 4", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Sfus) - -static struct BurnDIPInfo SfDIPList[]= -{ - {0x1a, 0xff, 0xff, 0xff, NULL }, - {0x1b, 0xff, 0xff, 0xff, NULL }, - {0x1c, 0xff, 0xff, 0xf8, NULL }, - {0x1d, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2 , "Attract Music" }, - {0x1a, 0x01, 0x02, 0x00, "Off" }, - {0x1a, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Speed" }, - {0x1a, 0x01, 0x10, 0x00, "Slow" }, - {0x1a, 0x01, 0x10, 0x10, "Normal" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1a, 0x01, 0x20, 0x20, "Off" }, - {0x1a, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1a, 0x01, 0x40, 0x40, "Off" }, - {0x1a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x1b, 0x01, 0x07, 0x00, "4 Coins 1 Credit" }, - {0x1b, 0x01, 0x07, 0x01, "3 Coins 1 Credit" }, - {0x1b, 0x01, 0x07, 0x02, "2 Coins 1 Credit" }, - {0x1b, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x1b, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x1b, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x1b, 0x01, 0x38, 0x00, "4 Coins 1 Credit" }, - {0x1b, 0x01, 0x38, 0x08, "3 Coins 1 Credit" }, - {0x1b, 0x01, 0x38, 0x10, "2 Coins 1 Credit" }, - {0x1b, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x1b, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x1b, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 6 , "Buy-In Feature" }, - {0x1c, 0x01, 0x38, 0x38, "5th Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x30, "4th Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x28, "3rd Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x20, "2nd Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x18, "1st Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x08, "None" }, - - {0 , 0xfe, 0 , 2 , "Number of Countries Selected" }, - {0x1c, 0x01, 0x40, 0x40, "4" }, - {0x1c, 0x01, 0x40, 0x00, "2" }, - - {0 , 0xfe, 0 , 6 , "Game Continuation" }, - {0x1d, 0x01, 0x07, 0x07, "5th Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x06, "4th Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x05, "3rd Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x04, "2nd Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x03, "1st Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x02, "None" }, - - {0 , 0xfe, 0 , 4 , "Round Time Count" }, - {0x1d, 0x01, 0x18, 0x18, "100" }, - {0x1d, 0x01, 0x18, 0x10, "150" }, - {0x1d, 0x01, 0x18, 0x08, "200" }, - {0x1d, 0x01, 0x18, 0x00, "250" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1d, 0x01, 0x60, 0x60, "Normal" }, - {0x1d, 0x01, 0x60, 0x40, "Easy" }, - {0x1d, 0x01, 0x60, 0x20, "Difficult" }, - {0x1d, 0x01, 0x60, 0x00, "Very difficult" }, -}; - -STDDIPINFO(Sf) - -static struct BurnDIPInfo SfusDIPList[]= -{ - {0x1a, 0xff, 0xff, 0xff, NULL }, - {0x1b, 0xff, 0xff, 0xff, NULL }, - {0x1c, 0xff, 0xff, 0xf8, NULL }, - {0x1d, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1a, 0x01, 0x01, 0x01, "Off" }, - {0x1a, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Attract Music" }, - {0x1a, 0x01, 0x02, 0x00, "Off" }, - {0x1a, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Speed" }, - {0x1a, 0x01, 0x10, 0x00, "Slow" }, - {0x1a, 0x01, 0x10, 0x10, "Normal" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1a, 0x01, 0x20, 0x20, "Off" }, - {0x1a, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x1a, 0x01, 0x40, 0x40, "Off" }, - {0x1a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x1b, 0x01, 0x07, 0x00, "4 Coins 1 Credit" }, - {0x1b, 0x01, 0x07, 0x01, "3 Coins 1 Credit" }, - {0x1b, 0x01, 0x07, 0x02, "2 Coins 1 Credit" }, - {0x1b, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x1b, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x1b, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x1b, 0x01, 0x38, 0x00, "4 Coins 1 Credit" }, - {0x1b, 0x01, 0x38, 0x08, "3 Coins 1 Credit" }, - {0x1b, 0x01, 0x38, 0x10, "2 Coins 1 Credit" }, - {0x1b, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x1b, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x1b, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 6 , "Buy-In Feature" }, - {0x1c, 0x01, 0x38, 0x38, "5th Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x30, "4th Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x28, "3rd Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x20, "2nd Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x18, "1st Stage Maximum" }, - {0x1c, 0x01, 0x38, 0x08, "None" }, - - {0 , 0xfe, 0 , 2 , "Number of Countries Selected" }, - {0x1c, 0x01, 0x40, 0x00, "4" }, - {0x1c, 0x01, 0x40, 0x40, "2" }, - - {0 , 0xfe, 0 , 6 , "Game Continuation" }, - {0x1d, 0x01, 0x07, 0x07, "5th Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x06, "4th Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x05, "3rd Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x04, "2nd Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x03, "1st Stage Maximum" }, - {0x1d, 0x01, 0x07, 0x02, "None" }, - - {0 , 0xfe, 0 , 4 , "Round Time Count" }, - {0x1d, 0x01, 0x18, 0x18, "100" }, - {0x1d, 0x01, 0x18, 0x10, "150" }, - {0x1d, 0x01, 0x18, 0x08, "200" }, - {0x1d, 0x01, 0x18, 0x00, "250" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1d, 0x01, 0x60, 0x60, "Normal" }, - {0x1d, 0x01, 0x60, 0x40, "Easy" }, - {0x1d, 0x01, 0x60, 0x20, "Difficult" }, - {0x1d, 0x01, 0x60, 0x00, "Very difficult" }, -}; - -STDDIPINFO(Sfus) - -static void protection_w() -{ - static const INT32 maplist[4][10] = { - { 1, 0, 3, 2, 4, 5, 6, 7, 8, 9 }, - { 4, 5, 6, 7, 1, 0, 3, 2, 8, 9 }, - { 3, 2, 1, 0, 6, 7, 4, 5, 8, 9 }, - { 6, 7, 4, 5, 3, 2, 1, 0, 8, 9 } - }; - INT32 map; - - map = maplist[SekReadByte(0xffc006)][(SekReadByte(0xffc003)<<1) + (SekReadWord(0xffc004)>>8)]; - - switch (SekReadByte(0xffc684)) - { - case 1: - { - INT32 base; - - base = 0x1b6e8+0x300e*map; - - SekWriteLong(0xffc01c, 0x16bfc+0x270*map); - SekWriteLong(0xffc020, base+0x80); - SekWriteLong(0xffc024, base); - SekWriteLong(0xffc028, base+0x86); - SekWriteLong(0xffc02c, base+0x8e); - SekWriteLong(0xffc030, base+0x20e); - SekWriteLong(0xffc034, base+0x30e); - SekWriteLong(0xffc038, base+0x38e); - SekWriteLong(0xffc03c, base+0x40e); - SekWriteLong(0xffc040, base+0x80e); - SekWriteLong(0xffc044, base+0xc0e); - SekWriteLong(0xffc048, base+0x180e); - SekWriteLong(0xffc04c, base+0x240e); - SekWriteLong(0xffc050, 0x19548+0x60*map); - SekWriteLong(0xffc054, 0x19578+0x60*map); - break; - } - - case 2: - { - static const INT32 delta1[10] = { - 0x1f80, 0x1c80, 0x2700, 0x2400, 0x2b80, 0x2e80, 0x3300, 0x3600, 0x3a80, 0x3d80 - }; - static const INT32 delta2[10] = { - 0x2180, 0x1800, 0x3480, 0x2b00, 0x3e00, 0x4780, 0x5100, 0x5a80, 0x6400, 0x6d80 - }; - - INT32 d1 = delta1[map] + 0xc0; - INT32 d2 = delta2[map]; - - SekWriteWord(0xffc680, d1); - SekWriteWord(0xffc682, d2); - SekWriteWord(0xffc00c, 0xc0); - SekWriteWord(0xffc00e, 0); - - sf_fg_scroll_x = d1; - sf_bg_scroll_x = d2; - - break; - } - - case 4: - { - INT32 pos = SekReadByte(0xffc010); - pos = (pos+1) & 3; - SekWriteByte(0xffc010, pos); - - if(!pos) { - INT32 d1 = SekReadWord(0xffc682); - INT32 off = SekReadWord(0xffc00e); - if(off!=512) { - off++; - d1++; - } else { - off = 0; - d1 -= 512; - } - SekWriteWord(0xffc682, d1); - SekWriteWord(0xffc00e, off); - - sf_bg_scroll_x = d1; - } - break; - } - } -} - -static inline void palette_update(INT32 offset) -{ - UINT16 data = *((UINT16*)(Drv68kPalRam + (offset & 0x7fe))); - - INT32 r = (data >> 8) & 0x0f; - INT32 g = (data >> 4) & 0x0f; - INT32 b = (data >> 0) & 0x0f; - - DrvPalette[(offset & 0x7fe)/2] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0); -} - -void __fastcall sf_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff800) == 0xb00000) { - UINT16 *pal = (UINT16*)(Drv68kPalRam + (address & 0x7ff)); - - *pal = data; - - palette_update(address); - - return; - } - - switch (address) - { - case 0xc00010: - return; - - case 0xc00014: - sf_fg_scroll_x = data; - return; - - case 0xc00018: - sf_bg_scroll_x = data; - return; - - case 0xc0001c: - { - soundlatch = data & 0xff; - - ZetOpen(0); - ZetNmi(); - ZetClose(); - } - return; - - case 0xc0001e: - if (version == 3) { - protection_w(); - } - return; - } -} - -void __fastcall sf_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xc0001b: - { - sf_active = data & 0xff; - flipscreen = data & 0x04; - } - return; - } -} - -UINT16 __fastcall sf_read_word(UINT32 address) -{ - switch (address) - { - case 0xc00000: - return DrvInputs[3]; - - case 0xc00002: - return DrvInputs[4]; - - case 0xc00004: - return DrvInputs[5]; - - case 0xc00006: - return DrvInputs[6]; - - case 0xc00008: - return DrvInputs[0]; - - case 0xc0000a: - return DrvInputs[1]; - - case 0xc0000c: - return DrvInputs[2]; - - case 0xc0000e: - return 0xffff; - } - - return 0; -} - -UINT8 __fastcall sf_read_byte(UINT32 address) -{ - switch (address) - { - case 0xc00000: - case 0xc00001: - return DrvInputs[3] >> ((~address & 1) << 3); - - case 0xc00002: - case 0xc00003: - return DrvInputs[4] >> ((~address & 1) << 3); - - case 0xc00004: - case 0xc00005: - return DrvInputs[5] >> ((~address & 1) << 3); - - case 0xc00006: - case 0xc00007: - return DrvInputs[6] >> ((~address & 1) << 3); - - case 0xc00008: - case 0xc00009: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0xc0000a: - case 0xc0000b: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0xc0000c: - case 0xc0000d: - return DrvInputs[2] >> ((~address & 1) << 3); - - case 0xc0000e: - case 0xc0000f: - return 0xff; - } - - return 0; -} - -void __fastcall sf_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - BurnYM2151SelectRegister(data); - return; - - case 0xe001: - BurnYM2151WriteRegister(data); - return; - } -} - -UINT8 __fastcall sf_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc800: - return soundlatch; - - case 0xe001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void sound2_bank_w(INT32 data) -{ - sound2_bank = (data + 1) << 15; - - ZetMapArea(0x8000, 0xffff, 0, DrvZ80Rom1 + sound2_bank); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80Rom1 + sound2_bank); -} - -void __fastcall sf_sound2_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - MSM5205ResetWrite(0, data & 0x80); - MSM5205DataWrite(0, data); - MSM5205VCLKWrite(0, 1); - MSM5205VCLKWrite(0, 0); - return; - - case 0x01: - MSM5205ResetWrite(1, data & 0x80); - MSM5205DataWrite(1, data); - MSM5205VCLKWrite(1, 1); - MSM5205VCLKWrite(1, 0); - return; - - case 0x02: - sound2_bank_w(data); - return; - } -} - -UINT8 __fastcall sf_sound2_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x01: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(double)ZetTotalCycles() * nSoundRate / 3579545; -} - -static INT32 DrvGfxDecode() -{ - static INT32 Gfx0Planes[4] = { 4, 0, 0x200004, 0x200000 }; - static INT32 Gfx1Planes[4] = { 4, 0, 0x400004, 0x400000 }; - static INT32 Gfx2Planes[4] = { 4, 0, 0x700004, 0x700000 }; - static INT32 Gfx3Planes[2] = { 4, 0 }; - - static INT32 GfxXOffsets[16] = { 0, 1, 2, 3, 8, 9, 10, 11, 256, 257, 258, 259, 264, 265, 266, 267 }; - static INT32 GfxYOffsets[16] = { 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, - 0x80, 0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x1C0000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, Gfx0, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Gfx0Planes, GfxXOffsets, GfxYOffsets, 0x200, tmp, Gfx0); - - memcpy (tmp, Gfx1, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Gfx1Planes, GfxXOffsets, GfxYOffsets, 0x200, tmp, Gfx1); - - memcpy (tmp, Gfx2, 0x1c0000); - - GfxDecode(0x3800, 4, 16, 16, Gfx2Planes, GfxXOffsets, GfxYOffsets, 0x200, tmp, Gfx2); - - memcpy (tmp, Gfx3, 0x004000); - - GfxDecode(0x0400, 2, 8, 8, Gfx3Planes, GfxXOffsets, GfxYOffsets, 0x080, tmp, Gfx3); - - memset (Gfx1Trans, 1, 0x2000); - for (INT32 i = 0; i < 0x2000 * 0x100; i++) { - if (Gfx1[i] != 15) Gfx1Trans[i/0x100] = 0; - } - - memset (Gfx3Trans, 1, 0x400); - for (INT32 i = 0; i < 0x400 * 0x40; i++) { - if (Gfx3[i] != 3) Gfx3Trans[i/0x40] = 0; - } - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - sf_fg_scroll_x = 0; - sf_bg_scroll_x = 0; - - soundlatch = 0; - flipscreen = 0; - - sf_active = 0; - - sound2_bank = 0; - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - MSM5205Reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68kRom = Next; Next += 0x060000; - DrvZ80Rom0 = Next; Next += 0x008000; - DrvZ80Rom1 = Next; Next += 0x040000; - - Gfx0 = Next; Next += 0x100000; - Gfx1 = Next; Next += 0x200000; - Gfx1Trans = Next; Next += 0x002000; - Gfx2 = Next; Next += 0x380000; - Gfx3 = Next; Next += 0x010000; - Gfx3Trans = Next; Next += 0x000400; - Gfx4 = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x00401 * sizeof(UINT32); - - AllRam = Next; - - Drv68kPalRam = Next; Next += 0x000800; - Drv68kVidRam = Next; Next += 0x001000; - Drv68kRam = Next; Next += 0x008000; - - DrvZ80Ram0 = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -void sfYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvInit(INT32 initver) -{ - INT32 nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - if (initver == 4) - { - if (BurnLoadRom(Drv68kRom + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68kRom + 0, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80Rom0, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80Rom1, 3, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(Gfx0 + i * 0x20000, i + 4, 1)) return 1; - } - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(Gfx1 + i * 0x20000, i + 8, 1)) return 1; - } - - for (INT32 i = 0; i < 6; i++) { - if (BurnLoadRom(Gfx2 + 0x00000 + i * 0x10000, i + 16, 1)) return 1; - if (BurnLoadRom(Gfx2 + 0xe0000 + i * 0x10000, i + 22, 1)) return 1; - } - - if (BurnLoadRom(Gfx3, 28, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(Gfx4 + i * 0x10000, i + 29, 1)) return 1; - } - } else { - for (INT32 i = 0; i < 6; i+=2) { - if (BurnLoadRom(Drv68kRom + 1 + i * 0x10000, i + 0, 2)) return 1; - if (BurnLoadRom(Drv68kRom + 0 + i * 0x10000, i + 1, 2)) return 1; - } - - if (BurnLoadRom(DrvZ80Rom0, 6, 1)) return 1; - - if (BurnLoadRom(DrvZ80Rom1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvZ80Rom1 + 0x20000, 8, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(Gfx0 + i * 0x20000, i + 9, 1)) return 1; - } - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(Gfx1 + i * 0x20000, i + 13, 1)) return 1; - } - - for (INT32 i = 0; i < 14; i++) { - if (BurnLoadRom(Gfx2 + i * 0x20000, i + 21, 1)) return 1; - } - - if (BurnLoadRom(Gfx3, 35, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(Gfx4 + i * 0x10000, i + 36, 1)) return 1; - } - } - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "sfjan") == 0) memcpy (Gfx3, Gfx3 + 0x4000, 0x4000); - if (DrvGfxDecode()) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68kRom, 0x000000, 0x04ffff, MAP_ROM); - SekMapMemory(Drv68kVidRam, 0x800000, 0x800fff, MAP_RAM); - SekMapMemory(Drv68kRam, 0xff8000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, sf_write_byte); - SekSetWriteWordHandler(0, sf_write_word); - SekSetReadByteHandler(0, sf_read_byte); - SekSetReadWordHandler(0, sf_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom0); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram0); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram0); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram0); - ZetSetWriteHandler(sf_sound_write); - ZetSetReadHandler(sf_sound_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1); - ZetSetOutHandler(sf_sound2_out); - ZetSetInHandler(sf_sound2_in); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&sfYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.60, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.60, BURN_SND_ROUTE_RIGHT); - - MSM5205Init(0, DrvSynchroniseStream, 384000, NULL, MSM5205_SEX_4B, 1); - MSM5205Init(1, DrvSynchroniseStream, 384000, NULL, MSM5205_SEX_4B, 1); - MSM5205SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - MSM5205SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - version = initver; - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2151Exit(); - SekExit(); - ZetExit(); - - MSM5205Exit(); - - version = 0; - - GenericTilesExit(); - - BurnFree (Mem); - - sf_fg_scroll_x = 0; - sf_bg_scroll_x = 0; - - soundlatch = 0; - flipscreen = 0; - - sf_active = 0; - sound2_bank = 0; - - return 0; -} - -static void draw_background() -{ - UINT8 *base = Gfx4 + ((sf_bg_scroll_x >> 4) << 5); - - for (INT32 offs = 0; offs < 0x200; offs++, base += 2) - { - INT32 sx = (offs & 0x1f0) - (sf_bg_scroll_x & 0x0f); - INT32 sy = (offs << 4) & 0xf0; - - if (sx < 49 || sx >= 448 || sy < 16 || sy > 239) continue; - - INT32 attr = base[0x10000]; - INT32 color = base[0x00000]; - INT32 code = (base[0x10001] << 8) | base[1]; - - INT32 flipx = attr & 1; - INT32 flipy = attr & 2; - - if (flipscreen) { - flipx = !flipx; - flipy = !flipy; - sx = ((sx + (sf_bg_scroll_x & 0x0f)) ^ 0x1f0) + (sf_bg_scroll_x & 0x0f); - sy ^= 0xf0; - } - - sx -= 64; - sy -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, Gfx0); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, Gfx0); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, Gfx0); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, Gfx0); - } - } - } -} - -static void draw_foreground() -{ - UINT8 *base = 0x20000 + Gfx4 + ((sf_fg_scroll_x >> 4) << 5); - - for (INT32 offs = 0; offs < 0x200; offs++, base += 2) - { - INT32 sx = (offs & 0x1f0) - (sf_fg_scroll_x & 0x0f); - INT32 sy = (offs << 4) & 0xf0; - - if (sx < 49 || sx >= 448 || sy < 16 || sy > 239) continue; - - INT32 code = (base[0x10001] << 8) | base[1]; - if (Gfx1Trans[code]) continue; - - INT32 attr = base[0x10000]; - INT32 color = base[0x00000]; - - INT32 flipx = attr & 1; - INT32 flipy = attr & 2; - - if (flipscreen) { - flipx = !flipx; - flipy = !flipy; - sx = ((sx + (sf_fg_scroll_x & 0x0f)) ^ 0x1f0) + (sf_fg_scroll_x & 0x0f); - sy ^= 0xf0; - } - - sx -= 64; - sy -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x100, Gfx1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x100, Gfx1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x100, Gfx1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x100, Gfx1); - } - } - } -} - -static void draw_characters() -{ - UINT16 *fg_ram = (UINT16*)(Drv68kVidRam); - - for (INT32 offs = 0x100 / 2; offs < 0x0f00 / 2; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - if (sx < 64 || sx > 447) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(fg_ram[offs]); - INT32 code = attr & 0x3ff; - if (Gfx3Trans[code]) continue; - - INT32 color = attr >> 12; - - INT32 flipx = attr & 0x400; - INT32 flipy = attr & 0x800; - - if (flipscreen) { - flipx = !flipx; - flipy = !flipy; - sx ^= 0x1f8; - sy ^= 0x0f8; - } - - sx -= 64; - sy -= 16; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 2, 3, 0x300, Gfx3); - } else { - Render8x8Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 2, 3, 0x300, Gfx3); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 2, 3, 0x300, Gfx3); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 2, 3, 0x300, Gfx3); - } - } - } -} - -static inline INT32 sf_invert(INT32 nb) -{ - static const INT32 delta[4] = {0x00, 0x18, 0x18, 0x00}; - return nb ^ delta[(nb >> 3) & 3]; -} - -static void draw_sprites() -{ - UINT16 *sf_objectram = (UINT16*)(Drv68kRam + 0x6000); - - for (INT32 offs = 0x1000-0x20;offs >= 0;offs -= 0x20) - { - INT32 c = BURN_ENDIAN_SWAP_INT16(sf_objectram[offs]); - INT32 attr = BURN_ENDIAN_SWAP_INT16(sf_objectram[offs+1]); - INT32 sy = BURN_ENDIAN_SWAP_INT16(sf_objectram[offs+2]); - INT32 sx = BURN_ENDIAN_SWAP_INT16(sf_objectram[offs+3]); - INT32 color = attr & 0x000f; - INT32 flipx = attr & 0x0100; - INT32 flipy = attr & 0x0200; - - if (attr & 0x400) // large sprite - { - INT32 c1,c2,c3,c4,t; - - if (flipscreen) - { - sx = 480 - sx; - sy = 224 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (sy > 239 || sx < 33 || sx > 447) continue; - - sx -= 64; - sy -= 16; - - c1 = c; - c2 = c+1; - c3 = c+16; - c4 = c+17; - - if (flipx) - { - t = c1; c1 = c2; c2 = t; - t = c3; c3 = c4; c4 = t; - } - if (flipy) - { - t = c1; c1 = c3; c3 = t; - t = c2; c2 = c4; c4 = t; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sf_invert(c1), sx , sy , color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sf_invert(c2), sx + 16, sy , color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sf_invert(c3), sx , sy + 16, color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sf_invert(c4), sx + 16, sy + 16, color, 4, 15, 0x200, Gfx2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sf_invert(c1), sx , sy , color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sf_invert(c2), sx + 16, sy , color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sf_invert(c3), sx , sy + 16, color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sf_invert(c4), sx + 16, sy + 16, color, 4, 15, 0x200, Gfx2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sf_invert(c1), sx , sy , color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sf_invert(c2), sx + 16, sy , color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sf_invert(c3), sx , sy + 16, color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sf_invert(c4), sx + 16, sy + 16, color, 4, 15, 0x200, Gfx2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sf_invert(c1), sx , sy , color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_Clip(pTransDraw, sf_invert(c2), sx + 16, sy , color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_Clip(pTransDraw, sf_invert(c3), sx , sy + 16, color, 4, 15, 0x200, Gfx2); - Render16x16Tile_Mask_Clip(pTransDraw, sf_invert(c4), sx + 16, sy + 16, color, 4, 15, 0x200, Gfx2); - } - } - } - else - { - if (flipscreen) - { - sx = 496 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (sy < 1 || sy > 239 || sx < 49 || sx > 447) continue; - - sx -= 64; - sy -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sf_invert(c), sx, sy, color, 4, 15, 0x200, Gfx2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sf_invert(c), sx, sy, color, 4, 15, 0x200, Gfx2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sf_invert(c), sx, sy, color, 4, 15, 0x200, Gfx2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sf_invert(c), sx, sy, color, 4, 15, 0x200, Gfx2); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_update(i); - } - DrvPalette[0x400] = BurnHighCol(0xff,0,0xff,0); - DrvRecalc = 0; - } - - if (nBurnLayer & 8) { - if (sf_active & 0x20) - draw_background(); - else - memset (pTransDraw, 0, nScreenWidth * nScreenHeight * sizeof(INT16)); - } else { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) - pTransDraw[i] = 0x0400; // point to magenta - } - - if (sf_active & 0x40 && nBurnLayer & 4) - draw_foreground(); - - if (sf_active & 0x80 && nBurnLayer & 1) - draw_sprites(); - - if (sf_active & 0x08 && nBurnLayer & 2) - draw_characters(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvMakeInputs() -{ - DrvInputs[0] = (DrvDips[0] << 8) | DrvDips[1]; - DrvInputs[1] = (DrvDips[2] << 4) | DrvDips[3] | 0xf800; - - DrvInputs[2] = 0xff7f; - DrvInputs[3] = 0xffff; - DrvInputs[4] = 0xffff; - DrvInputs[5] = 0xffff; - DrvInputs[6] = 0xffff; - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[2] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy4[i] & 1) << i; - } - - // clear opposites - { - if (!(DrvInputs[4] & 0x0003)) DrvInputs[4] |= 0x0003; // p1 left/right - if (!(DrvInputs[4] & 0x000c)) DrvInputs[4] |= 0x000c; // p1 up/down - if (!(DrvInputs[4] & 0x0300)) DrvInputs[4] |= 0x0300; // p2 left/right - if (!(DrvInputs[4] & 0x0c00)) DrvInputs[4] |= 0x0c00; // p2 up/down - } - - // World & prototype -- simulate analogue buttons - if (version == 1 || version == 4) - { - static const INT32 scale[8] = { 0x00, 0x60, 0xe0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }; - - INT32 t = (DrvJoy4[0] & 1) | ((DrvJoy4[1] & 1) << 1) | ((DrvJoy4[2] & 1) << 2); - DrvInputs[5] = scale[t]; - t = (DrvJoy5[0] & 1) | ((DrvJoy5[1] & 1) << 1) | ((DrvJoy5[2] & 1) << 2); - DrvInputs[5] |= scale[t] << 8; - - t = (DrvJoy4[8] & 1) | ((DrvJoy4[9] & 1) << 1) | ((DrvJoy4[10] & 1) << 2); - DrvInputs[6] = scale[t]; - - t = (DrvJoy5[8] & 1) | ((DrvJoy5[9] & 1) << 1) | ((DrvJoy5[10] & 1) << 2); - DrvInputs[6] |= scale[t] << 8; - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - DrvMakeInputs(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = (133 * 2) / 3; // sample cpu irqs - INT32 nCyclesTotal[3]; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - INT32 nNext[3] = { 0, 0, 0 }; - - nCyclesTotal[0] = (INT32)((INT64)8000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)3579545 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[2] = 3579545 / 60; //(INT32)((INT64)3579545 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - nNext[0] += nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nNext[0] - nCyclesDone[0]); - - ZetOpen(0); - nNext[1] += nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(nNext[1] - nCyclesDone[1]); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - - nSoundBufferPos += nSegmentLength; - } - - ZetClose(); - - ZetOpen(1); - nNext[2] += nCyclesTotal[2] / nInterleave; - nCyclesDone[2] += ZetRun(nNext[2] - nCyclesDone[2]); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - } - - SekSetIRQLine((version == 4) ? 6 : 1, CPU_IRQSTATUS_AUTO); - - SekClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - } - - ZetOpen(1); - if ((nCyclesTotal[2] - nCyclesDone[2]) > 0) { - ZetRun(nCyclesTotal[2] - nCyclesDone[2]); - } - - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - MSM5205Render(1, pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - MSM5205Scan(nAction, pnMin); - BurnYM2151Scan(nAction); - - SCAN_VAR(sf_fg_scroll_x); - SCAN_VAR(sf_bg_scroll_x); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(sf_active); - SCAN_VAR(sound2_bank); - } - - if (nAction & ACB_WRITE) { - ZetOpen(1); - sound2_bank_w(sound2_bank); - ZetClose(); - } - - return 0; -} - - -// Street Fighter (US, set 1) - -static struct BurnRomInfo sfRomDesc[] = { - { "sfd-19.2a", 0x10000, 0xfaaf6255, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sfd-22.2c", 0x10000, 0xe1fe3519, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sfd-20.3a", 0x10000, 0x44b915bd, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sfd-23.3c", 0x10000, 0x79c43ff8, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sfd-21.4a", 0x10000, 0xe8db799b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "sfd-24.4c", 0x10000, 0x466a3440, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "sf-02.7k", 0x08000, 0x4a9ac534, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 #0 Code - - { "sfu-00.1h", 0x20000, 0xa7cce903, 3 | BRF_PRG | BRF_ESS }, // 7 Z80 #1 Code - { "sf-01.1k", 0x20000, 0x86e0f0d5, 3 | BRF_PRG | BRF_ESS }, // 8 - - { "sf-39.2k", 0x20000, 0xcee3d292, 4 | BRF_GRA }, // 9 Background Tiles - { "sf-38.1k", 0x20000, 0x2ea99676, 4 | BRF_GRA }, // 10 - { "sf-41.4k", 0x20000, 0xe0280495, 4 | BRF_GRA }, // 11 - { "sf-40.3k", 0x20000, 0xc70b30de, 4 | BRF_GRA }, // 12 - - { "sf-25.1d", 0x20000, 0x7f23042e, 5 | BRF_GRA }, // 13 Foreground Tiles - { "sf-28.1e", 0x20000, 0x92f8b91c, 5 | BRF_GRA }, // 14 - { "sf-30.1g", 0x20000, 0xb1399856, 5 | BRF_GRA }, // 15 - { "sf-34.1h", 0x20000, 0x96b6ae2e, 5 | BRF_GRA }, // 16 - { "sf-26.2d", 0x20000, 0x54ede9f5, 5 | BRF_GRA }, // 17 - { "sf-29.2e", 0x20000, 0xf0649a67, 5 | BRF_GRA }, // 18 - { "sf-31.2g", 0x20000, 0x8f4dd71a, 5 | BRF_GRA }, // 19 - { "sf-35.2h", 0x20000, 0x70c00fb4, 5 | BRF_GRA }, // 20 - - { "sf-15.1m", 0x20000, 0xfc0113db, 6 | BRF_GRA }, // 21 Sprites - { "sf-16.2m", 0x20000, 0x82e4a6d3, 6 | BRF_GRA }, // 22 - { "sf-11.1k", 0x20000, 0xe112df1b, 6 | BRF_GRA }, // 23 - { "sf-12.2k", 0x20000, 0x42d52299, 6 | BRF_GRA }, // 24 - { "sf-07.1h", 0x20000, 0x49f340d9, 6 | BRF_GRA }, // 25 - { "sf-08.2h", 0x20000, 0x95ece9b1, 6 | BRF_GRA }, // 26 - { "sf-03.1f", 0x20000, 0x5ca05781, 6 | BRF_GRA }, // 27 - { "sf-17.3m", 0x20000, 0x69fac48e, 6 | BRF_GRA }, // 28 - { "sf-18.4m", 0x20000, 0x71cfd18d, 6 | BRF_GRA }, // 29 - { "sf-13.3k", 0x20000, 0xfa2eb24b, 6 | BRF_GRA }, // 30 - { "sf-14.4k", 0x20000, 0xad955c95, 6 | BRF_GRA }, // 31 - { "sf-09.3h", 0x20000, 0x41b73a31, 6 | BRF_GRA }, // 32 - { "sf-10.4h", 0x20000, 0x91c41c50, 6 | BRF_GRA }, // 33 - { "sf-05.3f", 0x20000, 0x538c7cbe, 6 | BRF_GRA }, // 34 - - { "sf-27.4d", 0x04000, 0x2b09b36d, 7 | BRF_GRA }, // 35 Characters - - { "sf-37.4h", 0x10000, 0x23d09d3d, 8 | BRF_GRA }, // 36 Tilemaps - { "sf-36.3h", 0x10000, 0xea16df6c, 8 | BRF_GRA }, // 37 - { "sf-32.3g", 0x10000, 0x72df2bd9, 8 | BRF_GRA }, // 38 - { "sf-33.4g", 0x10000, 0x3e99d3d5, 8 | BRF_GRA }, // 39 - - { "mb7114h.12k", 0x0100, 0x75af3553, 0 | BRF_OPT }, // 40 Proms - { "mb7114h.11h", 0x0100, 0xc0e56586, 0 | BRF_OPT }, // 41 - { "mb7114h.12j", 0x0100, 0x4c734b64, 0 | BRF_OPT }, // 42 - { "mmi-7603.13h", 0x0020, 0x06bcda53, 0 | BRF_OPT }, // 43 -}; - -STD_ROM_PICK(sf) -STD_ROM_FN(sf) - -static INT32 SfusInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvsf = { - "sf", NULL, NULL, NULL, "1987", - "Street Fighter (US, set 1)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VSFIGHT, FBF_SF, - NULL, sfRomInfo, sfRomName, NULL, NULL, SfusInputInfo, SfusDIPInfo, - SfusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x401, 384, 224, 4, 3 -}; - - -// Street Fighter (World, pneumatic buttons) - -static struct BurnRomInfo sfanRomDesc[] = { - { "sfe-19.2a", 0x10000, 0x8346c3ca, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sfe-22.2c", 0x10000, 0x3a4bfaa8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sfe-20.3a", 0x10000, 0xb40e67ee, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sfe-23.3c", 0x10000, 0x477c3d5b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sfe-21.4a", 0x10000, 0x2547192b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "sfe-24.4c", 0x10000, 0x79680f4e, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "sf-02.7k", 0x08000, 0x4a9ac534, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 #0 Code - - { "sfu-00.1h", 0x20000, 0xa7cce903, 3 | BRF_PRG | BRF_ESS }, // 7 Z80 #1 Code - { "sf-01.2k", 0x20000, 0x86e0f0d5, 3 | BRF_PRG | BRF_ESS }, // 8 - - { "sf-39.2k", 0x20000, 0xcee3d292, 4 | BRF_GRA }, // 9 Background Tiles - { "sf-38.1k", 0x20000, 0x2ea99676, 4 | BRF_GRA }, // 10 - { "sf-41.4k", 0x20000, 0xe0280495, 4 | BRF_GRA }, // 11 - { "sf-40.3k", 0x20000, 0xc70b30de, 4 | BRF_GRA }, // 12 - - { "sf-25.1d", 0x20000, 0x7f23042e, 5 | BRF_GRA }, // 13 Foreground Tiles - { "sf-28.1e", 0x20000, 0x92f8b91c, 5 | BRF_GRA }, // 14 - { "sf-30.1g", 0x20000, 0xb1399856, 5 | BRF_GRA }, // 15 - { "sf-34.1h", 0x20000, 0x96b6ae2e, 5 | BRF_GRA }, // 16 - { "sf-26.2d", 0x20000, 0x54ede9f5, 5 | BRF_GRA }, // 17 - { "sf-29.2e", 0x20000, 0xf0649a67, 5 | BRF_GRA }, // 18 - { "sf-31.2g", 0x20000, 0x8f4dd71a, 5 | BRF_GRA }, // 19 - { "sf-35.2h", 0x20000, 0x70c00fb4, 5 | BRF_GRA }, // 20 - - { "sf-15.1m", 0x20000, 0xfc0113db, 6 | BRF_GRA }, // 21 Sprites - { "sf-16.2m", 0x20000, 0x82e4a6d3, 6 | BRF_GRA }, // 22 - { "sf-11.1k", 0x20000, 0xe112df1b, 6 | BRF_GRA }, // 23 - { "sf-12.2k", 0x20000, 0x42d52299, 6 | BRF_GRA }, // 24 - { "sf-07.1h", 0x20000, 0x49f340d9, 6 | BRF_GRA }, // 25 - { "sf-08.2h", 0x20000, 0x95ece9b1, 6 | BRF_GRA }, // 26 - { "sf-03.1f", 0x20000, 0x5ca05781, 6 | BRF_GRA }, // 27 - { "sf-17.3m", 0x20000, 0x69fac48e, 6 | BRF_GRA }, // 28 - { "sf-18.4m", 0x20000, 0x71cfd18d, 6 | BRF_GRA }, // 29 - { "sf-13.3k", 0x20000, 0xfa2eb24b, 6 | BRF_GRA }, // 30 - { "sf-14.4k", 0x20000, 0xad955c95, 6 | BRF_GRA }, // 31 - { "sf-09.3h", 0x20000, 0x41b73a31, 6 | BRF_GRA }, // 32 - { "sf-10.4h", 0x20000, 0x91c41c50, 6 | BRF_GRA }, // 33 - { "sf-05.3f", 0x20000, 0x538c7cbe, 6 | BRF_GRA }, // 34 - - { "sf-27.4d", 0x04000, 0x2b09b36d, 7 | BRF_GRA }, // 35 Characters - - { "sf-37.4h", 0x10000, 0x23d09d3d, 8 | BRF_GRA }, // 36 Tilemaps - { "sf-36.3h", 0x10000, 0xea16df6c, 8 | BRF_GRA }, // 37 - { "sf-32.3g", 0x10000, 0x72df2bd9, 8 | BRF_GRA }, // 38 - { "sf-33.4g", 0x10000, 0x3e99d3d5, 8 | BRF_GRA }, // 39 - - { "sfb05.mb7114h.12k", 0x0100, 0x75af3553, 0 | BRF_OPT }, // 40 Proms - { "sfb10.mb7114h.11h", 0x0100, 0xc0e56586, 0 | BRF_OPT }, // 41 - { "sfb04.mb7114h.12j", 0x0100, 0x4c734b64, 0 | BRF_OPT }, // 42 - { "sfb00.mb7051.13h", 0x0020, 0x06bcda53, 0 | BRF_OPT }, // 43 -}; - -STD_ROM_PICK(sfan) -STD_ROM_FN(sfan) - -static INT32 SfanInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvsfan = { - "sfan", "sf", NULL, NULL, "1987", - "Street Fighter (World, pneumatic buttons)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VSFIGHT, FBF_SF, - NULL, sfanRomInfo, sfanRomName, NULL, NULL, SfInputInfo, SfDIPInfo, - SfanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x401, 384, 224, 4, 3 -}; - - -// Street Fighter (US, set 2) (protected) - -static struct BurnRomInfo sfuaRomDesc[] = { - { "sfs19u.1a", 0x10000, 0xc8e41c49, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sfs22u.1b", 0x10000, 0x667e9309, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sfs20u.2a", 0x10000, 0x303065bf, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sfs23u.2b", 0x10000, 0xde6927a3, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sfs21u.3a", 0x10000, 0x004a418b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "sfs24u.3b", 0x10000, 0x2b4545ff, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "sf-02.7k", 0x08000, 0x4a9ac534, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 #0 Code - - { "sfu-00.1h", 0x20000, 0xa7cce903, 3 | BRF_PRG | BRF_ESS }, // 7 Z80 #1 Code - { "sf-01.1k", 0x20000, 0x86e0f0d5, 3 | BRF_PRG | BRF_ESS }, // 8 - - { "sf-39.2k", 0x20000, 0xcee3d292, 4 | BRF_GRA }, // 9 Background Tiles - { "sf-38.1k", 0x20000, 0x2ea99676, 4 | BRF_GRA }, // 10 - { "sf-41.4k", 0x20000, 0xe0280495, 4 | BRF_GRA }, // 11 - { "sf-40.3k", 0x20000, 0xc70b30de, 4 | BRF_GRA }, // 12 - - { "sf-25.1d", 0x20000, 0x7f23042e, 5 | BRF_GRA }, // 13 Foreground Tiles - { "sf-28.1e", 0x20000, 0x92f8b91c, 5 | BRF_GRA }, // 14 - { "sf-30.1g", 0x20000, 0xb1399856, 5 | BRF_GRA }, // 15 - { "sf-34.1h", 0x20000, 0x96b6ae2e, 5 | BRF_GRA }, // 16 - { "sf-26.2d", 0x20000, 0x54ede9f5, 5 | BRF_GRA }, // 17 - { "sf-29.2e", 0x20000, 0xf0649a67, 5 | BRF_GRA }, // 18 - { "sf-31.2g", 0x20000, 0x8f4dd71a, 5 | BRF_GRA }, // 19 - { "sf-35.2h", 0x20000, 0x70c00fb4, 5 | BRF_GRA }, // 20 - - { "sf-15.1m", 0x20000, 0xfc0113db, 6 | BRF_GRA }, // 21 Sprites - { "sf-16.2m", 0x20000, 0x82e4a6d3, 6 | BRF_GRA }, // 22 - { "sf-11.1k", 0x20000, 0xe112df1b, 6 | BRF_GRA }, // 23 - { "sf-12.2k", 0x20000, 0x42d52299, 6 | BRF_GRA }, // 24 - { "sf-07.1h", 0x20000, 0x49f340d9, 6 | BRF_GRA }, // 25 - { "sf-08.2h", 0x20000, 0x95ece9b1, 6 | BRF_GRA }, // 26 - { "sf-03.1f", 0x20000, 0x5ca05781, 6 | BRF_GRA }, // 27 - { "sf-17.3m", 0x20000, 0x69fac48e, 6 | BRF_GRA }, // 28 - { "sf-18.4m", 0x20000, 0x71cfd18d, 6 | BRF_GRA }, // 29 - { "sf-13.3k", 0x20000, 0xfa2eb24b, 6 | BRF_GRA }, // 30 - { "sf-14.4k", 0x20000, 0xad955c95, 6 | BRF_GRA }, // 31 - { "sf-09.3h", 0x20000, 0x41b73a31, 6 | BRF_GRA }, // 32 - { "sf-10.4h", 0x20000, 0x91c41c50, 6 | BRF_GRA }, // 33 - { "sf-05.3f", 0x20000, 0x538c7cbe, 6 | BRF_GRA }, // 34 - - { "sf-27.4d", 0x04000, 0x2b09b36d, 7 | BRF_GRA }, // 35 Characters - - { "sf-37.4h", 0x10000, 0x23d09d3d, 8 | BRF_GRA }, // 36 Tilemaps - { "sf-36.3h", 0x10000, 0xea16df6c, 8 | BRF_GRA }, // 37 - { "sf-32.3g", 0x10000, 0x72df2bd9, 8 | BRF_GRA }, // 38 - { "sf-33.4g", 0x10000, 0x3e99d3d5, 8 | BRF_GRA }, // 39 - - { "sfb05.bin", 0x0100, 0x864199ad, 0 | BRF_OPT }, // 40 Proms - { "sfb00.bin", 0x0100, 0xbd3f8c5d, 0 | BRF_OPT }, // 41 - { "mb7114h.12j", 0x0100, 0x4c734b64, 0 | BRF_OPT }, // 42 - { "mmi-7603.13h", 0x0020, 0x06bcda53, 0 | BRF_OPT }, // 43 - - { "sf_s.id8751h-8.14f", 0x00800, 0x00000000, 0 | BRF_NODUMP }, // i8751 MCU -}; - -STD_ROM_PICK(sfua) -STD_ROM_FN(sfua) - -static INT32 SfuaInit() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvsfua = { - "sfua", "sf", NULL, NULL, "1987", - "Street Fighter (US set 2) (protected)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VSFIGHT, FBF_SF, - NULL, sfuaRomInfo, sfuaRomName, NULL, NULL, SfjInputInfo, SfusDIPInfo, - SfuaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x401, 384, 224, 4, 3 -}; - - -// Street Fighter (Japan) (protected) - -static struct BurnRomInfo sfjRomDesc[] = { - { "sf-19.2a", 0x10000, 0x116027d7, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sf-22.2c", 0x10000, 0xd3cbd09e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sf-20.3a", 0x10000, 0xfe07e83f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sf-23.3c", 0x10000, 0x1e435d33, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sf-21.4a", 0x10000, 0xe086bc4c, 1 | BRF_PRG | BRF_ESS }, // 4 - { "sf-24.4c", 0x10000, 0x13a6696b, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "sf-02.7k", 0x08000, 0x4a9ac534, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 #0 Code - - { "sf-00.1h", 0x20000, 0x4b733845, 3 | BRF_PRG | BRF_ESS }, // 7 Z80 #1 Code - { "sf-01.1k", 0x20000, 0x86e0f0d5, 3 | BRF_PRG | BRF_ESS }, // 8 - - { "sf-39.2k", 0x20000, 0xcee3d292, 4 | BRF_GRA }, // 9 Background Tiles - { "sf-38.1k", 0x20000, 0x2ea99676, 4 | BRF_GRA }, // 10 - { "sf-41.4k", 0x20000, 0xe0280495, 4 | BRF_GRA }, // 11 - { "sf-40.3k", 0x20000, 0xc70b30de, 4 | BRF_GRA }, // 12 - - { "sf-25.1d", 0x20000, 0x7f23042e, 5 | BRF_GRA }, // 13 Foreground Tiles - { "sf-28.1e", 0x20000, 0x92f8b91c, 5 | BRF_GRA }, // 14 - { "sf-30.1g", 0x20000, 0xb1399856, 5 | BRF_GRA }, // 15 - { "sf-34.1h", 0x20000, 0x96b6ae2e, 5 | BRF_GRA }, // 16 - { "sf-26.2d", 0x20000, 0x54ede9f5, 5 | BRF_GRA }, // 17 - { "sf-29.2e", 0x20000, 0xf0649a67, 5 | BRF_GRA }, // 18 - { "sf-31.2g", 0x20000, 0x8f4dd71a, 5 | BRF_GRA }, // 19 - { "sf-35.2h", 0x20000, 0x70c00fb4, 5 | BRF_GRA }, // 20 - - { "sf-15.1m", 0x20000, 0xfc0113db, 6 | BRF_GRA }, // 21 Sprites - { "sf-16.2m", 0x20000, 0x82e4a6d3, 6 | BRF_GRA }, // 22 - { "sf-11.1k", 0x20000, 0xe112df1b, 6 | BRF_GRA }, // 23 - { "sf-12.2k", 0x20000, 0x42d52299, 6 | BRF_GRA }, // 24 - { "sf-07.1h", 0x20000, 0x49f340d9, 6 | BRF_GRA }, // 25 - { "sf-08.2h", 0x20000, 0x95ece9b1, 6 | BRF_GRA }, // 26 - { "sf-03.1f", 0x20000, 0x5ca05781, 6 | BRF_GRA }, // 27 - { "sf-17.3m", 0x20000, 0x69fac48e, 6 | BRF_GRA }, // 28 - { "sf-18.4m", 0x20000, 0x71cfd18d, 6 | BRF_GRA }, // 29 - { "sf-13.3k", 0x20000, 0xfa2eb24b, 6 | BRF_GRA }, // 30 - { "sf-14.4k", 0x20000, 0xad955c95, 6 | BRF_GRA }, // 31 - { "sf-09.3h", 0x20000, 0x41b73a31, 6 | BRF_GRA }, // 32 - { "sf-10.4h", 0x20000, 0x91c41c50, 6 | BRF_GRA }, // 33 - { "sf-05.3f", 0x20000, 0x538c7cbe, 6 | BRF_GRA }, // 34 - - { "sf-27.4d", 0x04000, 0x2b09b36d, 7 | BRF_GRA }, // 35 Characters - - { "sf-37.4h", 0x10000, 0x23d09d3d, 8 | BRF_GRA }, // 36 Tilemaps - { "sf-36.3h", 0x10000, 0xea16df6c, 8 | BRF_GRA }, // 37 - { "sf-32.3g", 0x10000, 0x72df2bd9, 8 | BRF_GRA }, // 38 - { "sf-33.4g", 0x10000, 0x3e99d3d5, 8 | BRF_GRA }, // 39 - - { "sfb05.bin", 0x0100, 0x864199ad, 0 | BRF_OPT }, // 40 Proms - { "sfb00.bin", 0x0100, 0xbd3f8c5d, 0 | BRF_OPT }, // 41 - { "mb7114h.12j", 0x0100, 0x4c734b64, 0 | BRF_OPT }, // 42 - { "mmi-7603.13h", 0x0020, 0x06bcda53, 0 | BRF_OPT }, // 43 - - { "sf_s.id8751h-8.14f", 0x00800, 0x00000000, 0 | BRF_NODUMP }, // i8751 MCU -}; - -STD_ROM_PICK(sfj) -STD_ROM_FN(sfj) - -static INT32 SfjInit() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvsfj = { - "sfj", "sf", NULL, NULL, "1987", - "Street Fighter (Japan) (protected)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VSFIGHT, FBF_SF, - NULL, sfjRomInfo, sfjRomName, NULL, NULL, SfjInputInfo, SfusDIPInfo, - SfjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x401, 384, 224, 4, 3 -}; - - -// Street Fighter (Japan, pneumatic buttons) - -static struct BurnRomInfo sfjanRomDesc[] = { - { "sf_n_19a.2a.27c512", 0x10000, 0x8346c3ca, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sf_n_22a.2c.27c512", 0x10000, 0x3a4bfaa8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sf_n_20a.3a.27c512", 0x10000, 0x7e00b1dd, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sf_n_23a.3c.27c512", 0x10000, 0x1cf3c108, 1 | BRF_PRG | BRF_ESS }, // 3 - { "sf_n_21a.4a.27c512", 0x10000, 0x2547192b, 1 | BRF_PRG | BRF_ESS }, // 4 - { "sf_n_24a.4c.27c512", 0x10000, 0x79680f4e, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "sf-02.bin", 0x08000, 0x4a9ac534, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 #0 Code // sf_02a.7k.27256 - - { "sf-00.bin", 0x20000, 0x4b733845, 3 | BRF_PRG | BRF_ESS }, // 7 Z80 #1 Code // sf_n_00.1h.27c1000 - { "sf-01.bin", 0x20000, 0x86e0f0d5, 3 | BRF_PRG | BRF_ESS }, // 8 // sf_n_01.1k.27c1000 - - { "sf-39.2k", 0x20000, 0xcee3d292, 4 | BRF_GRA }, // 9 Background Tiles - { "sf-38.1k", 0x20000, 0x2ea99676, 4 | BRF_GRA }, // 10 - { "sf-41.4k", 0x20000, 0xe0280495, 4 | BRF_GRA }, // 11 - { "sf-40.3k", 0x20000, 0xc70b30de, 4 | BRF_GRA }, // 12 - - { "sf-25.1d", 0x20000, 0x7f23042e, 5 | BRF_GRA }, // 13 Foreground Tiles - { "sf-28.1e", 0x20000, 0x92f8b91c, 5 | BRF_GRA }, // 14 - { "sf-30.1g", 0x20000, 0xb1399856, 5 | BRF_GRA }, // 15 - { "sf-34.1h", 0x20000, 0x96b6ae2e, 5 | BRF_GRA }, // 16 - { "sf-26.2d", 0x20000, 0x54ede9f5, 5 | BRF_GRA }, // 17 - { "sf-29.2e", 0x20000, 0xf0649a67, 5 | BRF_GRA }, // 18 - { "sf-31.2g", 0x20000, 0x8f4dd71a, 5 | BRF_GRA }, // 19 - { "sf-35.2h", 0x20000, 0x70c00fb4, 5 | BRF_GRA }, // 20 - - { "sf-15.1m", 0x20000, 0xfc0113db, 6 | BRF_GRA }, // 21 Sprites - { "sf-16.2m", 0x20000, 0x82e4a6d3, 6 | BRF_GRA }, // 22 - { "sf-11.1k", 0x20000, 0xe112df1b, 6 | BRF_GRA }, // 23 - { "sf-12.2k", 0x20000, 0x42d52299, 6 | BRF_GRA }, // 24 - { "sf-07.1h", 0x20000, 0x49f340d9, 6 | BRF_GRA }, // 25 - { "sf-08.2h", 0x20000, 0x95ece9b1, 6 | BRF_GRA }, // 26 - { "sf-03.1f", 0x20000, 0x5ca05781, 6 | BRF_GRA }, // 27 - { "sf-17.3m", 0x20000, 0x69fac48e, 6 | BRF_GRA }, // 28 - { "sf-18.4m", 0x20000, 0x71cfd18d, 6 | BRF_GRA }, // 29 - { "sf-13.3k", 0x20000, 0xfa2eb24b, 6 | BRF_GRA }, // 30 - { "sf-14.4k", 0x20000, 0xad955c95, 6 | BRF_GRA }, // 31 - { "sf-09.3h", 0x20000, 0x41b73a31, 6 | BRF_GRA }, // 32 - { "sf-10.4h", 0x20000, 0x91c41c50, 6 | BRF_GRA }, // 33 - { "sf-05.3f", 0x20000, 0x538c7cbe, 6 | BRF_GRA }, // 34 - - { "sf_27.4d.27256", 0x08000, 0x59416e03, 7 | BRF_GRA }, // 35 Characters // First half FF, second half matches known - - { "sf-37.4h", 0x10000, 0x23d09d3d, 8 | BRF_GRA }, // 36 Tilemaps - { "sf-36.3h", 0x10000, 0xea16df6c, 8 | BRF_GRA }, // 37 - { "sf-32.3g", 0x10000, 0x72df2bd9, 8 | BRF_GRA }, // 38 - { "sf-33.4g", 0x10000, 0x3e99d3d5, 8 | BRF_GRA }, // 39 - - { "sfb05.12k", 0x0100, 0x864199ad, 0 | BRF_OPT }, // 40 Proms - { "sfb00.13h", 0x0100, 0xbd3f8c5d, 0 | BRF_OPT }, // 41 - { "sfb04.12j", 0x0100, 0x4c734b64, 0 | BRF_OPT }, // 42 - { "mmi-7603.13h", 0x0020, 0x06bcda53, 0 | BRF_OPT }, // 43 -}; - -STD_ROM_PICK(sfjan) -STD_ROM_FN(sfjan) - -static INT32 SfjanInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvsfjan = { - "sfjan", "sf", NULL, NULL, "1987", - "Street Fighter (Japan, pneumatic buttons)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VSFIGHT, FBF_SF, - NULL, sfjanRomInfo, sfjanRomName, NULL, NULL, SfInputInfo, SfDIPInfo, - SfjanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x401, 384, 224, 4, 3 -}; - - -// Street Fighter (Prototype) - -static struct BurnRomInfo sfpRomDesc[] = { - { "prg8.2a", 0x20000, 0xd48d06a3, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "prg0.2c", 0x20000, 0xe8606c1a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sound.9j", 0x08000, 0x43cd32ae, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #0 Code - - { "voice.1g", 0x10000, 0x3f23c180, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "bkchr.2k", 0x20000, 0xe4d47aca, 4 | BRF_GRA }, // 4 Background Tiles - { "bkchr.1k", 0x20000, 0x5a1cbc1b, 4 | BRF_GRA }, // 5 - { "bkchr.4k", 0x20000, 0xc351bd48, 4 | BRF_GRA }, // 6 - { "bkchr.3k", 0x20000, 0x6bb2b050, 4 | BRF_GRA }, // 7 - - { "mchr.1d", 0x20000, 0xab06a60b, 5 | BRF_GRA }, // 8 Foreground Tiles - { "mchr.1e", 0x20000, 0xd221387d, 5 | BRF_GRA }, // 9 - { "mchr.1g", 0x20000, 0x1e4c1712, 5 | BRF_GRA }, // 10 - { "mchr.1h", 0x20000, 0xa381f529, 5 | BRF_GRA }, // 11 - { "mchr.2d", 0x20000, 0xe52303c4, 5 | BRF_GRA }, // 12 - { "mchr.2e", 0x20000, 0x23b9a6a1, 5 | BRF_GRA }, // 13 - { "mchr.2g", 0x20000, 0x1283ac09, 5 | BRF_GRA }, // 14 - { "mchr.2h", 0x20000, 0xcc6bf05c, 5 | BRF_GRA }, // 15 - - { "b1m.bin", 0x10000, 0x64758232, 6 | BRF_GRA }, // 16 Sprites - { "b2m.bin", 0x10000, 0xd958f5ad, 6 | BRF_GRA }, // 17 - { "b1k.bin", 0x10000, 0xe766f5fe, 6 | BRF_GRA }, // 18 - { "b2k.bin", 0x10000, 0xe71572d3, 6 | BRF_GRA }, // 19 - { "b1h.bin", 0x10000, 0x8494f38c, 6 | BRF_GRA }, // 20 - { "b2h.bin", 0x10000, 0x1fc5f049, 6 | BRF_GRA }, // 21 - { "b3m.bin", 0x10000, 0xd136802e, 6 | BRF_GRA }, // 22 - { "b4m.bin", 0x10000, 0xb4fa85d3, 6 | BRF_GRA }, // 23 - { "b3k.bin", 0x10000, 0x40e11cc8, 6 | BRF_GRA }, // 24 - { "b4k.bin", 0x10000, 0x5ca9716e, 6 | BRF_GRA }, // 25 - { "b3h.bin", 0x10000, 0x8c3d9173, 6 | BRF_GRA }, // 26 - { "b4h.bin", 0x10000, 0xa2df66f8, 6 | BRF_GRA }, // 27 - - { "vram.4d", 0x04000, 0xbfadfb32, 7 | BRF_GRA }, // 28 Characters - - { "bks1j10.5h", 0x10000, 0x4934aacd, 8 | BRF_GRA }, // 29 Tilemaps - { "bks1j18.3h", 0x10000, 0x551ffc88, 8 | BRF_GRA }, // 30 - { "ms1j10.3g", 0x10000, 0xf92958b8, 8 | BRF_GRA }, // 31 - { "ms1j18.5g", 0x10000, 0x89e35dc1, 8 | BRF_GRA }, // 32 - - { "sfb05.bin", 0x0100, 0x864199ad, 0 | BRF_OPT }, // 33 Proms - { "sfb00.bin", 0x0100, 0xbd3f8c5d, 0 | BRF_OPT }, // 34 - { "mb7114h.12j", 0x0100, 0x4c734b64, 0 | BRF_OPT }, // 35 - { "mmi-7603.13h", 0x0020, 0x06bcda53, 0 | BRF_OPT }, // 36 -}; - -STD_ROM_PICK(sfp) -STD_ROM_FN(sfp) - -static INT32 SfpInit() -{ - return DrvInit(4); -} - -struct BurnDriver BurnDrvsfp = { - "sfp", "sf", NULL, NULL, "1987", - "Street Fighter (Prototype)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VSFIGHT, FBF_SF, - NULL, sfpRomInfo, sfpRomName, NULL, NULL, SfInputInfo, SfDIPInfo, - SfpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x401, 384, 224, 4, 3 -}; - diff --git a/jan/src/burn/drv/pre90s/d_sidearms.cpp b/jan/src/burn/drv/pre90s/d_sidearms.cpp deleted file mode 100644 index 2208413e7..000000000 --- a/jan/src/burn/drv/pre90s/d_sidearms.cpp +++ /dev/null @@ -1,2051 +0,0 @@ -// FB Alpha Side Arms driver module -// Based on MAME driver by Paul Leaman - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "burn_ym2151.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvStarMap; -static UINT8 *DrvTileMap; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *bgscrollx; -static UINT8 *bgscrolly; - -static UINT8 flipscreen; -static UINT8 soundlatch; -static UINT8 starfield_enable; -static UINT8 character_enable; -static UINT8 sprite_enable; -static UINT8 bglayer_enable; -static UINT8 bank_data; - -static UINT16 starscrollx; -static UINT16 starscrolly; - -static INT32 hflop_74a; - -static INT32 enable_watchdog; -static INT32 watchdog; -static INT32 vblank; -static INT32 is_whizz = 0; // uses ym2151 instead of ym2203 -static INT32 is_turtshipk = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDips[4]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static struct BurnInputInfo SidearmsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Sidearms) - -static struct BurnInputInfo TurtshipInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Turtship) - -static struct BurnInputInfo DygerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Dyger) - -static struct BurnInputInfo WhizzInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy5 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy5 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Whizz) - -static struct BurnDIPInfo SidearmsDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x14, 0x01, 0x07, 0x07, "0 (Easiest)" }, - {0x14, 0x01, 0x07, 0x06, "1" }, - {0x14, 0x01, 0x07, 0x05, "2" }, - {0x14, 0x01, 0x07, 0x04, "3 (Normal)" }, - {0x14, 0x01, 0x07, 0x03, "4" }, - {0x14, 0x01, 0x07, 0x02, "5" }, - {0x14, 0x01, 0x07, 0x01, "6" }, - {0x14, 0x01, 0x07, 0x00, "7 (Hardest)" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x08, 0x08, "3" }, - {0x14, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "100000" }, - {0x14, 0x01, 0x30, 0x20, "100000 100000" }, - {0x14, 0x01, 0x30, 0x10, "150000 150000" }, - {0x14, 0x01, 0x30, 0x00, "200000 200000" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x40, 0x00, "No" }, - {0x15, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Sidearms) - -static struct BurnDIPInfo TurtshipDIPList[]= -{ - {0x14, 0xff, 0xff, 0xbd, NULL }, - {0x15, 0xff, 0xff, 0xeb, NULL }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x02, 0x02, "No" }, - {0x14, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x14, 0x01, 0x10, 0x10, "Normal" }, - {0x14, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 8, "Lives" }, - {0x14, 0x01, 0xe0, 0xe0, "1" }, - {0x14, 0x01, 0xe0, 0x60, "2" }, - {0x14, 0x01, 0xe0, 0xa0, "3" }, - {0x14, 0x01, 0xe0, 0x20, "4" }, - {0x14, 0x01, 0xe0, 0xc0, "5" }, - {0x14, 0x01, 0xe0, 0x40, "6" }, - {0x14, 0x01, 0xe0, 0x80, "7" }, - {0x14, 0x01, 0xe0, 0x00, "8" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x08, "Every 150000" }, - {0x15, 0x01, 0x0c, 0x00, "Every 200000" }, - {0x15, 0x01, 0x0c, 0x0c, "150000 only" }, - {0x15, 0x01, 0x0c, 0x04, "200000 only" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Coinage" }, - {0x15, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xe0, 0x80, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Turtship) - -static struct BurnDIPInfo DygerDIPList[]= -{ - {0x0a, 0xff, 0xff, 0xbd, NULL }, - {0x0b, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0a, 0x01, 0x02, 0x02, "No" }, - {0x0a, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0a, 0x01, 0x08, 0x08, "Off" }, - {0x0a, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0a, 0x01, 0x10, 0x10, "Easy" }, - {0x0a, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 8, "Lives" }, - {0x0a, 0x01, 0xe0, 0xe0, "1" }, - {0x0a, 0x01, 0xe0, 0x60, "2" }, - {0x0a, 0x01, 0xe0, 0xa0, "3" }, - {0x0a, 0x01, 0xe0, 0x20, "4" }, - {0x0a, 0x01, 0xe0, 0xc0, "5" }, - {0x0a, 0x01, 0xe0, 0x40, "6" }, - {0x0a, 0x01, 0xe0, 0x80, "7" }, - {0x0a, 0x01, 0xe0, 0x00, "8" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0b, 0x01, 0x0c, 0x04, "Every 150000" }, - {0x0b, 0x01, 0x0c, 0x00, "Every 200000" }, - {0x0b, 0x01, 0x0c, 0x0c, "150000 only" }, - {0x0b, 0x01, 0x0c, 0x08, "200000 only" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0b, 0x01, 0x10, 0x00, "Off" }, - {0x0b, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 7, "Coinage" }, - {0x0b, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x0b, 0x01, 0xe0, 0x80, "3 Coins 1 Credits" }, - {0x0b, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x0b, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x0b, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x0b, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Dyger) - -static struct BurnDIPInfo WhizzDIPList[]= -{ - {0x12, 0xff, 0xff, 0x10, NULL }, - {0x13, 0xff, 0xff, 0xfc, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x10, 0x00, "No" }, - {0x12, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x13, 0x01, 0x07, 0x07, "0 (Easiest)" }, - {0x13, 0x01, 0x07, 0x06, "1" }, - {0x13, 0x01, 0x07, 0x05, "2" }, - {0x13, 0x01, 0x07, 0x04, "3 (Normal)" }, - {0x13, 0x01, 0x07, 0x03, "4" }, - {0x13, 0x01, 0x07, 0x02, "5" }, - {0x13, 0x01, 0x07, 0x01, "6" }, - {0x13, 0x01, 0x07, 0x00, "7 (Hardest)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x18, 0x18, "100000 Only" }, - {0x14, 0x01, 0x18, 0x10, "Every 100000" }, - {0x14, 0x01, 0x18, 0x08, "Every 150000" }, - {0x14, 0x01, 0x18, 0x00, "Every 200000" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x15, 0x01, 0x10, 0x10, "3" }, - {0x15, 0x01, 0x10, 0x00, "5" }, -}; - -STDDIPINFO(Whizz) - -static void palette_write(INT32 offset) -{ - offset &= 0x3ff; - - UINT16 data = (DrvPalRAM[offset + 0x400] * 256) + DrvPalRAM[offset]; - - UINT8 r = (data >> 4) & 0x0f; - UINT8 g = (data >> 0) & 0x0f; - UINT8 b = (data >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[offset] = BurnHighCol(r,g,b,0); -} - -static void bankswitch(INT32 data) -{ - bank_data = data & 0x0f; - - ZetMapMemory(DrvZ80ROM0 + 0x8000 + (bank_data * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall sidearms_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xc000) { - DrvPalRAM[address & 0x7ff] = data; - palette_write(address); - return; - } - - switch (address) - { - case 0xc800: - soundlatch = data; - return; - - case 0xc801: - bankswitch(data); - return; - - case 0xc802: - enable_watchdog = 1; - watchdog = 0; - return; - - case 0xc804: - { - // coin counters data & 0x01, data & 0x02 - // coin lockout data & 0x04, data & 0x08 - - if (data & 0x10) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - - if (starfield_enable != (data & 0x20)) { - starfield_enable = data & 0x20; - hflop_74a = 1; - starscrollx = starscrolly = 0; - } - - character_enable = data & 0x40; - flipscreen = data & 0x80; - } - return; - - case 0xc805: - { - // INT32 last = starscrollx; - - starscrollx++; - starscrollx &= 0x1ff; - - // According to MAME this is correct, but for some reason in - // FBA it is seizure-inducing. Just disable it for now. - // if (starscrollx && (~last & 0x100)) hflop_74a ^= 1; - } - return; - - case 0xc806: - starscrolly++; - starscrolly &= 0xff; - return; - - case 0xc808: - case 0xc809: - bgscrollx[address & 1] = data; - return; - - case 0xc80a: - case 0xc80b: - bgscrolly[address & 1] = data; - return; - - case 0xc80c: - sprite_enable = data & 0x01; - bglayer_enable = data & 0x02; - return; - } -} - -static UINT8 __fastcall sidearms_main_read(UINT16 address) -{ - switch (address) - { - case 0xc800: - case 0xc801: - case 0xc802: - return DrvInputs[address & 3]; - - case 0xc803: - case 0xc804: - return DrvDips[address - 0xc803]; - - case 0xc805: - return ((vblank) ? 0 : 0x80); - } - - return 0; -} - -static void __fastcall turtship_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xe000) { - DrvPalRAM[address & 0x7ff] = data; - palette_write(address); - return; - } - - switch (address) - { - case 0xe800: - soundlatch = data; - return; - - case 0xe801: - bankswitch(data); - return; - - case 0xe802: - enable_watchdog = 1; - watchdog = 0; - return; - - case 0xe804: - { - // coin counters data & 0x01, data & 0x02 - // coin lockout data & 0x04, data & 0x08 - - if (data & 0x10) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - - character_enable = data & 0x40; - flipscreen = data & 0x80; - } - return; - - case 0xe808: - case 0xe809: - bgscrollx[address & 1] = data; - return; - - case 0xe80a: - case 0xe80b: - bgscrolly[address & 1] = data; - return; - - case 0xe80c: - sprite_enable = data & 0x01; - bglayer_enable = data & 0x02; - return; - } -} - -static UINT8 turtship_input_read(INT32 offset) -{ - UINT8 ret = 0; - UINT8 ports[5] = { DrvInputs[0], DrvInputs[1], DrvInputs[2], DrvDips[0], DrvDips[1] }; - - for (INT32 i = 0; i < 5; i++) { - ret |= ((ports[i] >> (offset & 7)) & 1) << i; - } - - return ret; -} - -static UINT8 __fastcall turtship_main_read(UINT16 address) -{ - if ((address & 0xfff8) == 0xe800) { - return turtship_input_read(address); - } - - return 0; -} - -static void __fastcall whizz_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc801: - bankswitch(((data >> 5) & 2) | (data >> 7)); - return; - - case 0xc803: - case 0xc805: - return; // nop - } - - sidearms_main_write(address, data); -} - -static UINT8 __fastcall whizz_main_read(UINT16 address) -{ - switch (address) - { - case 0xc800: - return DrvDips[1]; - - case 0xc801: - return DrvDips[2]; - - case 0xc802: - return DrvDips[3]; - - case 0xc803: - return (DrvInputs[0] & ~0x10) | (DrvDips[0] & 0x10); - - case 0xc804: - return DrvInputs[1]; - - case 0xc805: - return DrvInputs[2]; - - case 0xc806: - return (DrvInputs[3] & 0xef) | ((vblank) ? 0x10 : 0); - - case 0xc807: - return DrvInputs[4]; - } - - return 0; -} - -static void __fastcall sidearms_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - case 0xf001: - case 0xf002: - case 0xf003: - BurnYM2203Write((address/2)&1, address & 1, data); - return; - } -} - -static UINT8 __fastcall sidearms_sound_read(UINT16 address) -{ - switch (address) - { - case 0xd000: - return soundlatch; - - case 0xf000: - case 0xf001: - case 0xf002: - case 0xf003: - return BurnYM2203Read((address/2)&1, address & 1); - } - - return 0; -} - -static void __fastcall whizz_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM2151SelectRegister(data); - return; - - case 0x01: - BurnYM2151WriteRegister(data); - return; - - case 0x40: - return; // nop - } -} - -static UINT8 __fastcall whizz_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM2151ReadStatus(); - - case 0xc0: - return soundlatch; - } - - return 0; -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void DrvYM2151IrqHandler(INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 4000000); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - - if (is_whizz) { - BurnYM2151Reset(); - } else { - BurnYM2203Reset(); - } - ZetClose(); - - enable_watchdog = 0; - watchdog = 0; - - flipscreen = 0; - soundlatch = 0; - character_enable = 0; - sprite_enable = 0; - bglayer_enable = 0; - bank_data = 0; - - starfield_enable = 0; - starscrollx = 0; - starscrolly = 0; - hflop_74a = 1; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x018000; - DrvZ80ROM1 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x080000; - - DrvStarMap = Next; Next += 0x008000; - DrvTileMap = Next; Next += 0x008000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x001000; - DrvSprBuf = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x000800; - DrvZ80RAM0 = Next; Next += 0x002000; - DrvZ80RAM1 = Next; Next += 0x000800; - - bgscrollx = Next; Next += 0x000002; - bgscrolly = Next; Next += 0x000002; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Plane0[2] = { 4, 0 }; - INT32 Plane1[4] = { 0x200000 + 4, 0x200000 + 0, 4, 0 }; - INT32 Plane2[4] = { 0x100000 + 4, 0x100000 + 0, 4, 0 }; - INT32 XOffs0[16] = { STEP4(0,1), STEP4(8,1), STEP4(256,1), STEP4(256+8,1) }; - INT32 XOffs1[32] = { STEP4(0,1), STEP4(8,1), STEP4(512,1), STEP4(512+8,1), STEP4(1024,1), STEP4(1024+8,1), STEP4(1536,1), STEP4(1536+8,1) }; - INT32 YOffs[32] = { STEP32(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x04000); - - GfxDecode(0x0400, 2, 8, 8, Plane0, XOffs0, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x0400, 4, 32, 32, Plane1, XOffs1, YOffs, 0x800, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane2, XOffs0, YOffs, 0x200, tmp, DrvGfxROM2); - - BurnFree (tmp); -} - -static INT32 SidearmsInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvStarMap + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x48000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x58000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x28000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x38000, 21, 1)) return 1; - - if (BurnLoadRom(DrvTileMap + 0x00000, 22, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvPalRAM, 0xc000, 0xc7ff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0xd000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xf000, 0xffff, MAP_RAM); - ZetSetWriteHandler(sidearms_main_write); - ZetSetReadHandler(sidearms_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(sidearms_sound_write); - ZetSetReadHandler(sidearms_sound_read); - ZetClose(); - - BurnYM2203Init(2, 4000000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 TurtshipInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (is_turtshipk == 0) memcpy (DrvGfxROM0, DrvGfxROM0 + 0x4000, 0x4000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 7, 1)) return 1; - memcpy (DrvGfxROM1 + 0x30000, DrvGfxROM1 + 0x10000, 0x10000); - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 10, 1)) return 1; - memcpy (DrvGfxROM1 + 0x70000, DrvGfxROM1 + 0x50000, 0x10000); - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 14, 1)) return 1; - - if (BurnLoadRom(DrvTileMap + 0x00000, 15, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xe000, 0xe7ff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0xf000, 0xffff, MAP_RAM); - ZetSetWriteHandler(turtship_main_write); - ZetSetReadHandler(turtship_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(sidearms_sound_write); - ZetSetReadHandler(sidearms_sound_read); - ZetClose(); - - BurnYM2203Init(2, 4000000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 TurtshipkInit() -{ - is_turtshipk = 1; - return TurtshipInit(); -} - -static INT32 WhizzInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - memcpy (DrvGfxROM0, DrvGfxROM0 + 0x4000, 0x4000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 6, 1)) return 1; - memcpy (DrvGfxROM1 + 0x30000, DrvGfxROM1 + 0x10000, 0x10000); - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 9, 1)) return 1; - memcpy (DrvGfxROM1 + 0x70000, DrvGfxROM1 + 0x50000, 0x10000); - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 13, 1)) return 1; - - if (BurnLoadRom(DrvTileMap + 0x00000, 14, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvPalRAM, 0xc000, 0xc7ff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0xd000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xf000, 0xffff, MAP_RAM); - ZetSetWriteHandler(whizz_main_write); - ZetSetReadHandler(whizz_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xf800, 0xffff, MAP_RAM); - ZetSetOutHandler(whizz_sound_write_port); - ZetSetInHandler(whizz_sound_read_port); - ZetClose(); - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - is_whizz = 1; - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - if (is_whizz) { - BurnYM2151Exit(); - } else { - BurnYM2203Exit(); - } - - BurnFree (AllMem); - - is_whizz = 0; - is_turtshipk = 0; - - return 0; -} - -static void sidearms_draw_starfield() -{ - UINT16 *lineptr = pTransDraw; - UINT32 _hcount_191 = starscrollx & 0xff; - - for (INT32 y = 16; y < (16+nScreenHeight); y++) - { - UINT32 hadd_283 = _hcount_191 & ~0x1f; - UINT32 vadd_283 = starscrolly + y; - - INT32 i = (vadd_283<<4) & 0xff0; - i |= (hflop_74a^(hadd_283>>8)) << 3; - i |= (hadd_283>>5) & 7; - UINT32 latch_374 = DrvStarMap[i + 0x3000]; - - hadd_283 = _hcount_191 - 1; - - for (INT32 x = 0; x < nScreenWidth; lineptr++, x++) - { - i = hadd_283; - hadd_283 = _hcount_191 + (x & 0xff); - vadd_283 = starscrolly + y; - - if (!((vadd_283 ^ (x>>3)) & 4)) continue; - if ((vadd_283 | (hadd_283>>1)) & 2) continue; - - if ((i & 0x1f)==0x1f) - { - i = (vadd_283<<4) & 0xff0; - i |= (hflop_74a^(hadd_283>>8)) << 3; - i |= (hadd_283>>5) & 7; - latch_374 = DrvStarMap[i + 0x3000]; - } - - if ((~((latch_374^hadd_283)^1) & 0x1f)) continue; - - *lineptr = (UINT16)((latch_374>>5) | 0x378); - } - } -} - -static void draw_bg_layer(INT32 type) -{ - INT32 scrollx = ((((bgscrollx[1] << 8) + bgscrollx[0]) & 0xfff) + 64) & 0xfff; - INT32 scrolly = ((((bgscrolly[1] << 8) + bgscrolly[0]) & 0xfff) + 16) & 0xfff; - - for (INT32 y = 0; y < 256; y += 32) { - - INT32 sy = y - (scrolly & 0x1f); - if (sy >= nScreenHeight) continue; - - INT32 starty = (((scrolly + y) & 0xfff) / 0x20) * 0x80; - - for (INT32 x = 0; x < 416; x += 32) { - - INT32 sx = x - (scrollx & 0x1f); - if (sx >= nScreenWidth) continue; - - INT32 offs = (((scrollx + x) & 0xfff) / 0x20) + starty; - INT32 ofst = ((offs & 0x3c00) << 1) | ((offs & 0x0380) >> 6) | ((offs & 0x7f) << 4); - - INT32 attr = DrvTileMap[ofst + 1]; - INT32 code = DrvTileMap[ofst + 0] + ((attr & 0x01) * 256); - INT32 color = attr >> 3; - INT32 flipx = attr & 0x02; - INT32 flipy = attr & 0x04; - - if (type) - { - if (flipy) { - if (flipx) { - Render32x32Tile_FlipXY_Clip(pTransDraw, code | ((attr & 0x80) << 2), sx, sy, color & 0x0f, 4, 0, DrvGfxROM1); - } else { - Render32x32Tile_FlipY_Clip(pTransDraw, code | ((attr & 0x80) << 2), sx, sy, color & 0x0f, 4, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render32x32Tile_FlipX_Clip(pTransDraw, code | ((attr & 0x80) << 2), sx, sy, color & 0x0f, 4, 0, DrvGfxROM1); - } else { - Render32x32Tile_Clip(pTransDraw, code | ((attr & 0x80) << 2), sx, sy, color & 0x0f, 4, 0, DrvGfxROM1); - } - } - } else { - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM1); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM1); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM1); - } - } - } - } - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = ((offs & 0x3f) * 8) - 64; - INT32 sy = ((offs / 0x40) * 8) - 16; - - if (sx >= nScreenWidth || sx < 0 || sy >= nScreenHeight || sy < 0) continue; - - INT32 attr = DrvVidRAM[0x800 + offs]; - INT32 code = DrvVidRAM[0x000 + offs] | ((attr & 0xc0) << 2); - INT32 color = attr & 0x3f; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 3, 0x300, DrvGfxROM0); - } -} - -static void draw_sprites_region(INT32 start, INT32 end) -{ - for (INT32 offs = end - 32; offs >= start; offs -= 32) - { - INT32 sy = DrvSprBuf[offs + 2]; - if (!sy || DrvSprBuf[offs + 5] == 0xc3) continue; - - INT32 attr = DrvSprBuf[offs + 1]; - INT32 color = attr & 0xf; - INT32 code = DrvSprBuf[offs] + ((attr << 3) & 0x700); - INT32 sx = DrvSprBuf[offs + 3] + ((attr << 4) & 0x100); - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx - 64, sy - 16, color, 4, 0x0f, 0x200, DrvGfxROM2); - } -} - -static INT32 SidearmsDraw() -{ - if (DrvRecalc) { - for (INT32 offs = 0; offs < 0x400; offs++) { - palette_write(offs); - } - - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (starfield_enable) { - sidearms_draw_starfield(); - } - - if (bglayer_enable) { - draw_bg_layer(0); - } - - if (sprite_enable) { - draw_sprites_region(0x0700, 0x0800); - draw_sprites_region(0x0e00, 0x1000); - draw_sprites_region(0x0800, 0x0f00); - draw_sprites_region(0x0000, 0x0700); - } - - if (character_enable) { - draw_fg_layer(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 TurtshipDraw() -{ - if (DrvRecalc) { - for (INT32 offs = 0; offs < 0x400; offs++) { - palette_write(offs); - } - - DrvRecalc = 0; - } - - if (bglayer_enable) { - draw_bg_layer(1); - } else { - BurnTransferClear(); - } - - if (sprite_enable) { - draw_sprites_region(0x0700, 0x0800); - draw_sprites_region(0x0e00, 0x1000); - draw_sprites_region(0x0800, 0x0f00); - draw_sprites_region(0x0000, 0x0700); - } - - if (character_enable) { - draw_fg_layer(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DygerDraw() -{ - if (DrvRecalc) { - for (INT32 offs = 0; offs < 0x400; offs++) { - palette_write(offs); - } - - DrvRecalc = 0; - } - - if (bglayer_enable) { - draw_bg_layer(1); - } else { - BurnTransferClear(); - } - - if (sprite_enable) { - draw_sprites_region(0x0000, 0x1000); - } - - if (character_enable) { - draw_fg_layer(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog > 180 && enable_watchdog) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 5); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 278; - INT32 nCyclesTotal[2] = { 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == 274) {ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); vblank = 1; } - if (i == 276) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - nSegment = ZetTotalCycles(); - ZetClose(); - - ZetOpen(1); - if (is_whizz) { - nCyclesDone[1] += ZetRun(nSegment - ZetTotalCycles()); - if (i == 274) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == 276) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } else { - BurnTimerUpdate(nSegment); - } - ZetClose(); - } - - ZetOpen(1); - - if (is_whizz == 0) { - BurnTimerEndFrame(nCyclesTotal[1]); - } - - if (pBurnSoundOut) { - if (is_whizz) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - } else { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029709; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - if (is_whizz) { - BurnYM2151Scan(nAction); - } else { - BurnYM2203Scan(nAction, pnMin); - } - - SCAN_VAR(flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(starfield_enable); - SCAN_VAR(character_enable); - SCAN_VAR(sprite_enable); - SCAN_VAR(bglayer_enable); - SCAN_VAR(bank_data); - SCAN_VAR(bgscrollx[2]); - SCAN_VAR(bgscrolly[2]); - - SCAN_VAR(starscrollx); - SCAN_VAR(starscrolly); - SCAN_VAR(hflop_74a); - SCAN_VAR(enable_watchdog); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(bank_data); - ZetClose(); - } - - return 0; -} - - -// Side Arms - Hyper Dyne (World, 861129) - -static struct BurnRomInfo sidearmsRomDesc[] = { - { "sa03.bin", 0x8000, 0xe10fe6a0, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "a_14e.rom", 0x8000, 0x4925ed03, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a_12e.rom", 0x8000, 0x81d0ece7, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a_04k.rom", 0x8000, 0x34efe2d2, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "b_11j.rom", 0x8000, 0x134dc35b, 7 | BRF_GRA }, // 4 Starfield Data - - { "a_10j.rom", 0x4000, 0x651fef75, 3 | BRF_GRA }, // 5 Characters - - { "b_13d.rom", 0x8000, 0x3c59afe1, 4 | BRF_GRA }, // 6 Tiles - { "b_13e.rom", 0x8000, 0x64bc3b77, 4 | BRF_GRA }, // 7 - { "b_13f.rom", 0x8000, 0xe6bcea6f, 4 | BRF_GRA }, // 8 - { "b_13g.rom", 0x8000, 0xc71a3053, 4 | BRF_GRA }, // 9 - { "b_14d.rom", 0x8000, 0x826e8a97, 4 | BRF_GRA }, // 10 - { "b_14e.rom", 0x8000, 0x6cfc02a4, 4 | BRF_GRA }, // 11 - { "b_14f.rom", 0x8000, 0x9b9f6730, 4 | BRF_GRA }, // 12 - { "b_14g.rom", 0x8000, 0xef6af630, 4 | BRF_GRA }, // 13 - - { "b_11b.rom", 0x8000, 0xeb6f278c, 5 | BRF_GRA }, // 14 Sprites - { "b_13b.rom", 0x8000, 0xe91b4014, 5 | BRF_GRA }, // 15 - { "b_11a.rom", 0x8000, 0x2822c522, 5 | BRF_GRA }, // 16 - { "b_13a.rom", 0x8000, 0x3e8a9f75, 5 | BRF_GRA }, // 17 - { "b_12b.rom", 0x8000, 0x86e43eda, 5 | BRF_GRA }, // 18 - { "b_14b.rom", 0x8000, 0x076e92d1, 5 | BRF_GRA }, // 19 - { "b_12a.rom", 0x8000, 0xce107f3c, 5 | BRF_GRA }, // 20 - { "b_14a.rom", 0x8000, 0xdba06076, 5 | BRF_GRA }, // 21 - - { "b_03d.rom", 0x8000, 0x6f348008, 6 | BRF_GRA }, // 22 Tilemap - - { "63s141.16h", 0x0100, 0x75af3553, 8 | BRF_OPT }, // 23 Proms - { "63s141.11h", 0x0100, 0xa6e4d68f, 8 | BRF_OPT }, // 24 - { "63s141.15h", 0x0100, 0xc47c182a, 8 | BRF_OPT }, // 25 - { "63s081.3j", 0x0020, 0xc5817816, 8 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(sidearms) -STD_ROM_FN(sidearms) - -struct BurnDriver BurnDrvSidearms = { - "sidearms", NULL, NULL, NULL, "1986", - "Side Arms - Hyper Dyne (World, 861129)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, sidearmsRomInfo, sidearmsRomName, NULL, NULL, SidearmsInputInfo, SidearmsDIPInfo, - SidearmsInit, DrvExit, DrvFrame, SidearmsDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Side Arms - Hyper Dyne (US, 861202) - -static struct BurnRomInfo sidearmsuRomDesc[] = { - { "SAA_03.15E", 0x8000, 0x32ef2739, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "a_14e.rom", 0x8000, 0x4925ed03, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a_12e.rom", 0x8000, 0x81d0ece7, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a_04k.rom", 0x8000, 0x34efe2d2, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "b_11j.rom", 0x8000, 0x134dc35b, 7 | BRF_GRA }, // 4 Starfield Data - - { "a_10j.rom", 0x4000, 0x651fef75, 3 | BRF_GRA }, // 5 Characters - - { "b_13d.rom", 0x8000, 0x3c59afe1, 4 | BRF_GRA }, // 6 Tiles - { "b_13e.rom", 0x8000, 0x64bc3b77, 4 | BRF_GRA }, // 7 - { "b_13f.rom", 0x8000, 0xe6bcea6f, 4 | BRF_GRA }, // 8 - { "b_13g.rom", 0x8000, 0xc71a3053, 4 | BRF_GRA }, // 9 - { "b_14d.rom", 0x8000, 0x826e8a97, 4 | BRF_GRA }, // 10 - { "b_14e.rom", 0x8000, 0x6cfc02a4, 4 | BRF_GRA }, // 11 - { "b_14f.rom", 0x8000, 0x9b9f6730, 4 | BRF_GRA }, // 12 - { "b_14g.rom", 0x8000, 0xef6af630, 4 | BRF_GRA }, // 13 - - { "b_11b.rom", 0x8000, 0xeb6f278c, 5 | BRF_GRA }, // 14 Sprites - { "b_13b.rom", 0x8000, 0xe91b4014, 5 | BRF_GRA }, // 15 - { "b_11a.rom", 0x8000, 0x2822c522, 5 | BRF_GRA }, // 16 - { "b_13a.rom", 0x8000, 0x3e8a9f75, 5 | BRF_GRA }, // 17 - { "b_12b.rom", 0x8000, 0x86e43eda, 5 | BRF_GRA }, // 18 - { "b_14b.rom", 0x8000, 0x076e92d1, 5 | BRF_GRA }, // 19 - { "b_12a.rom", 0x8000, 0xce107f3c, 5 | BRF_GRA }, // 20 - { "b_14a.rom", 0x8000, 0xdba06076, 5 | BRF_GRA }, // 21 - - { "b_03d.rom", 0x8000, 0x6f348008, 6 | BRF_GRA }, // 22 Tilemap - - { "63s141.16h", 0x0100, 0x75af3553, 8 | BRF_OPT }, // 23 Proms - { "63s141.11h", 0x0100, 0xa6e4d68f, 8 | BRF_OPT }, // 24 - { "63s141.15h", 0x0100, 0xc47c182a, 8 | BRF_OPT }, // 25 - { "63s081.3j", 0x0020, 0xc5817816, 8 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(sidearmsu) -STD_ROM_FN(sidearmsu) - -struct BurnDriver BurnDrvSidearmsu = { - "sidearmsu", "sidearms", NULL, NULL, "1986", - "Side Arms - Hyper Dyne (US, 861202)\0", NULL, "Capcom (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, sidearmsuRomInfo, sidearmsuRomName, NULL, NULL, SidearmsInputInfo, SidearmsDIPInfo, - SidearmsInit, DrvExit, DrvFrame, SidearmsDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Side Arms - Hyper Dyne (US, 861128) - -static struct BurnRomInfo sidearmsur1RomDesc[] = { - { "03", 0x8000, 0x9a799c45, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "a_14e.rom", 0x8000, 0x4925ed03, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a_12e.rom", 0x8000, 0x81d0ece7, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a_04k.rom", 0x8000, 0x34efe2d2, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "b_11j.rom", 0x8000, 0x134dc35b, 7 | BRF_GRA }, // 4 Starfield Data - - { "a_10j.rom", 0x4000, 0x651fef75, 3 | BRF_GRA }, // 5 Characters - - { "b_13d.rom", 0x8000, 0x3c59afe1, 4 | BRF_GRA }, // 6 Tiles - { "b_13e.rom", 0x8000, 0x64bc3b77, 4 | BRF_GRA }, // 7 - { "b_13f.rom", 0x8000, 0xe6bcea6f, 4 | BRF_GRA }, // 8 - { "b_13g.rom", 0x8000, 0xc71a3053, 4 | BRF_GRA }, // 9 - { "b_14d.rom", 0x8000, 0x826e8a97, 4 | BRF_GRA }, // 10 - { "b_14e.rom", 0x8000, 0x6cfc02a4, 4 | BRF_GRA }, // 11 - { "b_14f.rom", 0x8000, 0x9b9f6730, 4 | BRF_GRA }, // 12 - { "b_14g.rom", 0x8000, 0xef6af630, 4 | BRF_GRA }, // 13 - - { "b_11b.rom", 0x8000, 0xeb6f278c, 5 | BRF_GRA }, // 14 Sprites - { "b_13b.rom", 0x8000, 0xe91b4014, 5 | BRF_GRA }, // 15 - { "b_11a.rom", 0x8000, 0x2822c522, 5 | BRF_GRA }, // 16 - { "b_13a.rom", 0x8000, 0x3e8a9f75, 5 | BRF_GRA }, // 17 - { "b_12b.rom", 0x8000, 0x86e43eda, 5 | BRF_GRA }, // 18 - { "b_14b.rom", 0x8000, 0x076e92d1, 5 | BRF_GRA }, // 19 - { "b_12a.rom", 0x8000, 0xce107f3c, 5 | BRF_GRA }, // 20 - { "b_14a.rom", 0x8000, 0xdba06076, 5 | BRF_GRA }, // 21 - - { "b_03d.rom", 0x8000, 0x6f348008, 6 | BRF_GRA }, // 22 Tilemap - - { "63s141.16h", 0x0100, 0x75af3553, 8 | BRF_OPT }, // 23 Proms - { "63s141.11h", 0x0100, 0xa6e4d68f, 8 | BRF_OPT }, // 24 - { "63s141.15h", 0x0100, 0xc47c182a, 8 | BRF_OPT }, // 25 - { "63s081.3j", 0x0020, 0xc5817816, 8 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(sidearmsur1) -STD_ROM_FN(sidearmsur1) - -struct BurnDriver BurnDrvSidearmsur1 = { - "sidearmsur1", "sidearms", NULL, NULL, "1986", - "Side Arms - Hyper Dyne (US, 861128)\0", NULL, "Capcom (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, sidearmsur1RomInfo, sidearmsur1RomName, NULL, NULL, SidearmsInputInfo, SidearmsDIPInfo, - SidearmsInit, DrvExit, DrvFrame, SidearmsDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Side Arms - Hyper Dyne (Japan, 861128) - -static struct BurnRomInfo sidearmsjRomDesc[] = { - { "a_15e.rom", 0x8000, 0x61ceb0cc, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "a_14e.rom", 0x8000, 0x4925ed03, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a_12e.rom", 0x8000, 0x81d0ece7, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a_04k.rom", 0x8000, 0x34efe2d2, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "b_11j.rom", 0x8000, 0x134dc35b, 7 | BRF_GRA }, // 4 Starfield Data - - { "a_10j.rom", 0x4000, 0x651fef75, 3 | BRF_GRA }, // 5 Characters - - { "b_13d.rom", 0x8000, 0x3c59afe1, 4 | BRF_GRA }, // 6 Tiles - { "b_13e.rom", 0x8000, 0x64bc3b77, 4 | BRF_GRA }, // 7 - { "b_13f.rom", 0x8000, 0xe6bcea6f, 4 | BRF_GRA }, // 8 - { "b_13g.rom", 0x8000, 0xc71a3053, 4 | BRF_GRA }, // 9 - { "b_14d.rom", 0x8000, 0x826e8a97, 4 | BRF_GRA }, // 10 - { "b_14e.rom", 0x8000, 0x6cfc02a4, 4 | BRF_GRA }, // 11 - { "b_14f.rom", 0x8000, 0x9b9f6730, 4 | BRF_GRA }, // 12 - { "b_14g.rom", 0x8000, 0xef6af630, 4 | BRF_GRA }, // 13 - - { "b_11b.rom", 0x8000, 0xeb6f278c, 5 | BRF_GRA }, // 14 Sprites - { "b_13b.rom", 0x8000, 0xe91b4014, 5 | BRF_GRA }, // 15 - { "b_11a.rom", 0x8000, 0x2822c522, 5 | BRF_GRA }, // 16 - { "b_13a.rom", 0x8000, 0x3e8a9f75, 5 | BRF_GRA }, // 17 - { "b_12b.rom", 0x8000, 0x86e43eda, 5 | BRF_GRA }, // 18 - { "b_14b.rom", 0x8000, 0x076e92d1, 5 | BRF_GRA }, // 19 - { "b_12a.rom", 0x8000, 0xce107f3c, 5 | BRF_GRA }, // 20 - { "b_14a.rom", 0x8000, 0xdba06076, 5 | BRF_GRA }, // 21 - - { "b_03d.rom", 0x8000, 0x6f348008, 6 | BRF_GRA }, // 22 Tilemap - - { "63s141.16h", 0x0100, 0x75af3553, 8 | BRF_OPT }, // 23 Proms - { "63s141.11h", 0x0100, 0xa6e4d68f, 8 | BRF_OPT }, // 24 - { "63s141.15h", 0x0100, 0xc47c182a, 8 | BRF_OPT }, // 25 - { "63s081.3j", 0x0020, 0xc5817816, 8 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(sidearmsj) -STD_ROM_FN(sidearmsj) - -struct BurnDriver BurnDrvSidearmsj = { - "sidearmsj", "sidearms", NULL, NULL, "1986", - "Side Arms - Hyper Dyne (Japan, 861128)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, sidearmsjRomInfo, sidearmsjRomName, NULL, NULL, SidearmsInputInfo, SidearmsDIPInfo, - SidearmsInit, DrvExit, DrvFrame, SidearmsDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Turtle Ship (North America) - -static struct BurnRomInfo turtshipRomDesc[] = { - { "t-3.bin", 0x08000, 0xb73ed7f2, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "t-2.3g", 0x08000, 0x2327b35a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "t-1.bin", 0x08000, 0xa258ffec, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "t-4.8a", 0x08000, 0x1cbe48e8, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "t-5.8k", 0x08000, 0x35c3dbc5, 3 | BRF_GRA }, // 4 Characters - - { "t-8.1d", 0x10000, 0x30a857f0, 4 | BRF_GRA }, // 5 Tiles - { "t-10.3c", 0x10000, 0x76bb73bb, 4 | BRF_GRA }, // 6 - { "t-11.3d", 0x10000, 0x53da6cb1, 4 | BRF_GRA }, // 7 - { "t-6.1a", 0x10000, 0x45ce41ad, 4 | BRF_GRA }, // 8 - { "t-7.1c", 0x10000, 0x3ccf11b9, 4 | BRF_GRA }, // 9 - { "t-9.3a", 0x10000, 0x44762916, 4 | BRF_GRA }, // 10 - - { "t-13.1i", 0x10000, 0x599f5246, 5 | BRF_GRA }, // 11 Sprites - { "t-15.bin", 0x10000, 0x6489b7b4, 5 | BRF_GRA }, // 12 - { "t-12.1g", 0x10000, 0xfb54cd33, 5 | BRF_GRA }, // 13 - { "t-14.bin", 0x10000, 0x1b67b674, 5 | BRF_GRA }, // 14 - - { "t-16.9f", 0x08000, 0x1a5a45d7, 6 | BRF_GRA }, // 15 Tilemap -}; - -STD_ROM_PICK(turtship) -STD_ROM_FN(turtship) - -struct BurnDriver BurnDrvTurtship = { - "turtship", NULL, NULL, NULL, "1988", - "Turtle Ship (North America)\0", NULL, "Philko (Sharp Image license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, turtshipRomInfo, turtshipRomName, NULL, NULL, TurtshipInputInfo, TurtshipDIPInfo, - TurtshipInit, DrvExit, DrvFrame, TurtshipDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Turtle Ship (Japan) - -static struct BurnRomInfo turtshipjRomDesc[] = { - { "t-3.5g", 0x08000, 0x0863fc1c, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "t-2.3g", 0x08000, 0x2327b35a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "t-1.3e", 0x08000, 0x845a9ab0, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "t-4.8a", 0x08000, 0x1cbe48e8, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "t-5.8k", 0x08000, 0x35c3dbc5, 3 | BRF_GRA }, // 4 Characters - - { "t-8.1d", 0x10000, 0x30a857f0, 4 | BRF_GRA }, // 5 Tiles - { "t-10.3c", 0x10000, 0x76bb73bb, 4 | BRF_GRA }, // 6 - { "t-11.3d", 0x10000, 0x53da6cb1, 4 | BRF_GRA }, // 7 - { "t-6.1a", 0x10000, 0x45ce41ad, 4 | BRF_GRA }, // 8 - { "t-7.1c", 0x10000, 0x3ccf11b9, 4 | BRF_GRA }, // 9 - { "t-9.3a", 0x10000, 0x44762916, 4 | BRF_GRA }, // 10 - - { "t-13.1i", 0x10000, 0x599f5246, 5 | BRF_GRA }, // 11 Sprites - { "t-15.3i", 0x10000, 0xf30cfa90, 5 | BRF_GRA }, // 12 - { "t-12.1g", 0x10000, 0xfb54cd33, 5 | BRF_GRA }, // 13 - { "t-14.3g", 0x10000, 0xd636873c, 5 | BRF_GRA }, // 14 - - { "t-16.9f", 0x08000, 0x1a5a45d7, 6 | BRF_GRA }, // 15 Tilemap -}; - -STD_ROM_PICK(turtshipj) -STD_ROM_FN(turtshipj) - -struct BurnDriver BurnDrvTurtshipj = { - "turtshipj", "turtship", NULL, NULL, "1988", - "Turtle Ship (Japan)\0", NULL, "Philko (Pacific Games license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, turtshipjRomInfo, turtshipjRomName, NULL, NULL, TurtshipInputInfo, TurtshipDIPInfo, - TurtshipInit, DrvExit, DrvFrame, TurtshipDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Turtle Ship (Korea) - -static struct BurnRomInfo turtshipkRomDesc[] = { - { "turtship.003", 0x08000, 0xe7a7fc2e, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "turtship.002", 0x08000, 0xe576f482, 1 | BRF_PRG | BRF_ESS }, // 1 - { "turtship.001", 0x08000, 0xa9b64240, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "t-4.8a", 0x08000, 0x1cbe48e8, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "turtship.005", 0x04000, 0x651fef75, 3 | BRF_GRA }, // 4 Characters - - { "turtship.008", 0x10000, 0xe0658469, 4 | BRF_GRA }, // 5 Tiles - { "t-10.3c", 0x10000, 0x76bb73bb, 4 | BRF_GRA }, // 6 - { "t-11.3d", 0x10000, 0x53da6cb1, 4 | BRF_GRA }, // 7 - { "turtship.006", 0x10000, 0xa7cce654, 4 | BRF_GRA }, // 8 - { "t-7.1c", 0x10000, 0x3ccf11b9, 4 | BRF_GRA }, // 9 - { "t-9.3a", 0x10000, 0x44762916, 4 | BRF_GRA }, // 10 - - { "t-13.1i", 0x10000, 0x599f5246, 5 | BRF_GRA }, // 11 Sprites - { "turtship.015", 0x10000, 0x69fd202f, 5 | BRF_GRA }, // 12 - { "t-12.1g", 0x10000, 0xfb54cd33, 5 | BRF_GRA }, // 13 - { "turtship.014", 0x10000, 0xb3ea74a3, 5 | BRF_GRA }, // 14 - - { "turtship.016", 0x08000, 0xaffd51dd, 6 | BRF_GRA }, // 15 Tilemap -}; - -STD_ROM_PICK(turtshipk) -STD_ROM_FN(turtshipk) - -struct BurnDriver BurnDrvTurtshipk = { - "turtshipk", "turtship", NULL, NULL, "1988", - "Turtle Ship (Korea)\0", NULL, "Philko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, turtshipkRomInfo, turtshipkRomName, NULL, NULL, TurtshipInputInfo, TurtshipDIPInfo, - TurtshipkInit, DrvExit, DrvFrame, TurtshipDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Turtle Ship (Korea, older) - -static struct BurnRomInfo turtshipkoRomDesc[] = { - { "T-3.G5", 0x08000, 0xcd789535, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "T-2.G3", 0x08000, 0x253678c0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "T-1.E3", 0x08000, 0xd6fdc376, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "T-4.A8", 0x08000, 0x1cbe48e8, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "T-5.K8", 0x08000, 0x35c3dbc5, 3 | BRF_GRA }, // 4 Characters - - { "T-8.D1", 0x10000, 0x2f0b2336, 4 | BRF_GRA }, // 5 Tiles - { "T-10.C3", 0x10000, 0x6a0072f4, 4 | BRF_GRA }, // 6 - { "T-11.D3", 0x10000, 0x53da6cb1, 4 | BRF_GRA }, // 7 - { "T-6.A1", 0x10000, 0xa7cce654, 4 | BRF_GRA }, // 8 - { "T-7.C1", 0x10000, 0x90dd8415, 4 | BRF_GRA }, // 9 - { "T-9.A3", 0x10000, 0x44762916, 4 | BRF_GRA }, // 10 - - { "T-13.I1", 0x10000, 0x1cc87f50, 5 | BRF_GRA }, // 11 Sprites - { "T-15.I3", 0x10000, 0x775ee5d9, 5 | BRF_GRA }, // 12 - { "T-12.G1", 0x10000, 0x57783312, 5 | BRF_GRA }, // 13 - { "T-14.G3", 0x10000, 0xa30e3346, 5 | BRF_GRA }, // 14 - - { "T-16.F9", 0x08000, 0x9b377277, 6 | BRF_GRA }, // 15 Tilemap -}; - -STD_ROM_PICK(turtshipko) -STD_ROM_FN(turtshipko) - -struct BurnDriver BurnDrvTurtshipko = { - "turtshipko", "turtship", NULL, NULL, "1988", - "Turtle Ship (Korea, older)\0", NULL, "Philko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, turtshipkoRomInfo, turtshipkoRomName, NULL, NULL, TurtshipInputInfo, TurtshipDIPInfo, - TurtshipInit, DrvExit, DrvFrame, TurtshipDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Turtle Ship (Korea, 88/9) - -static struct BurnRomInfo turtshipknRomDesc[] = { - { "T-3.G5", 0x08000, 0x529b091c, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "T-2.G3", 0x08000, 0xd2f30195, 1 | BRF_PRG | BRF_ESS }, // 1 - { "T-1.E3", 0x08000, 0x2d02da90, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "T-4.A8", 0x08000, 0x1cbe48e8, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "T-5.K8", 0x08000, 0x5c2ee02d, 3 | BRF_GRA }, // 4 Characters - - { "T-8.D1", 0x10000, 0x2f0b2336, 4 | BRF_GRA }, // 5 Tiles - { "T-10.C3", 0x10000, 0x6a0072f4, 4 | BRF_GRA }, // 6 - { "T-11.D3", 0x10000, 0x53da6cb1, 4 | BRF_GRA }, // 7 - { "T-6.A1", 0x10000, 0xa7cce654, 4 | BRF_GRA }, // 8 - { "T-7.C1", 0x10000, 0x90dd8415, 4 | BRF_GRA }, // 9 - { "T-9.A3", 0x10000, 0x44762916, 4 | BRF_GRA }, // 10 - - { "T-13.I1", 0x10000, 0x1cc87f50, 5 | BRF_GRA }, // 11 Sprites - { "T-15.I3", 0x10000, 0x3bf91fb8, 5 | BRF_GRA }, // 12 - { "T-12.G1", 0x10000, 0x57783312, 5 | BRF_GRA }, // 13 - { "T-14.G3", 0x10000, 0xee162dc0, 5 | BRF_GRA }, // 14 - - { "T-16.F9", 0x08000, 0x9b377277, 6 | BRF_GRA }, // 15 Tilemap -}; - -STD_ROM_PICK(turtshipkn) -STD_ROM_FN(turtshipkn) - -struct BurnDriver BurnDrvTurtshipkn = { - "turtshipkn", "turtship", NULL, NULL, "1988", - "Turtle Ship (Korea, 88/9)\0", NULL, "Philko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, turtshipknRomInfo, turtshipknRomName, NULL, NULL, TurtshipInputInfo, TurtshipDIPInfo, - TurtshipInit, DrvExit, DrvFrame, TurtshipDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Dyger (Korea set 1) - -static struct BurnRomInfo dygerRomDesc[] = { - { "d-3.5g", 0x08000, 0xbae9882e, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "d-2.3g", 0x08000, 0x059ac4dc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "d-1.3e", 0x08000, 0xd8440f66, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "d-4.8a", 0x08000, 0x8a256c09, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "d-5.8k", 0x08000, 0xc4bc72a5, 3 | BRF_GRA }, // 4 Characters - - { "d-10.1d", 0x10000, 0x9715880d, 4 | BRF_GRA }, // 5 Tiles - { "d-9.3c", 0x10000, 0x628dae72, 4 | BRF_GRA }, // 6 - { "d-11.3d", 0x10000, 0x23248db1, 4 | BRF_GRA }, // 7 - { "d-6.1a", 0x10000, 0x4ba7a437, 4 | BRF_GRA }, // 8 - { "d-8.1c", 0x10000, 0x6c0f0e0c, 4 | BRF_GRA }, // 9 - { "d-7.3a", 0x10000, 0x2c50a229, 4 | BRF_GRA }, // 10 - - { "d-14.1i", 0x10000, 0x99c60b26, 5 | BRF_GRA }, // 11 Sprites - { "d-15.3i", 0x10000, 0xd6475ecc, 5 | BRF_GRA }, // 12 - { "d-12.1g", 0x10000, 0xe345705f, 5 | BRF_GRA }, // 13 - { "d-13.3g", 0x10000, 0xfaf4be3a, 5 | BRF_GRA }, // 14 - - { "d-16.9f", 0x08000, 0x0792e8f2, 6 | BRF_GRA }, // 15 Tilemap -}; - -STD_ROM_PICK(dyger) -STD_ROM_FN(dyger) - -static INT32 DygerInit() -{ - INT32 nRet = TurtshipInit(); - - BurnYM2203SetPSGVolume(0, 0.10); - BurnYM2203SetPSGVolume(1, 0.10); - - return nRet; -} - -struct BurnDriver BurnDrvDyger = { - "dyger", NULL, NULL, NULL, "1989", - "Dyger (Korea set 1)\0", NULL, "Philko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dygerRomInfo, dygerRomName, NULL, NULL, DygerInputInfo, DygerDIPInfo, - DygerInit, DrvExit, DrvFrame, DygerDraw, DrvScan, &DrvRecalc, 0x800, - 224, 384, 3, 4 -}; - - -// Dyger (Korea set 2) - -static struct BurnRomInfo dygeraRomDesc[] = { - { "d-3.bin", 0x08000, 0xfc63da8b, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "d-2.3g", 0x08000, 0x059ac4dc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "d-1.3e", 0x08000, 0xd8440f66, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "d-4.8a", 0x08000, 0x8a256c09, 2 | BRF_PRG | BRF_ESS }, // 3 Sound CPU - - { "d-5.8k", 0x08000, 0xc4bc72a5, 3 | BRF_GRA }, // 4 Characters - - { "d-10.1d", 0x10000, 0x9715880d, 4 | BRF_GRA }, // 5 Tiles - { "d-9.3c", 0x10000, 0x628dae72, 4 | BRF_GRA }, // 6 - { "d-11.3d", 0x10000, 0x23248db1, 4 | BRF_GRA }, // 7 - { "d-6.1a", 0x10000, 0x4ba7a437, 4 | BRF_GRA }, // 8 - { "d-8.1c", 0x10000, 0x6c0f0e0c, 4 | BRF_GRA }, // 9 - { "d-7.3a", 0x10000, 0x2c50a229, 4 | BRF_GRA }, // 10 - - { "d-14.1i", 0x10000, 0x99c60b26, 5 | BRF_GRA }, // 11 Sprites - { "d-15.3i", 0x10000, 0xd6475ecc, 5 | BRF_GRA }, // 12 - { "d-12.1g", 0x10000, 0xe345705f, 5 | BRF_GRA }, // 13 - { "d-13.3g", 0x10000, 0xfaf4be3a, 5 | BRF_GRA }, // 14 - - { "d-16.9f", 0x08000, 0x0792e8f2, 6 | BRF_GRA }, // 15 Tilemap -}; - -STD_ROM_PICK(dygera) -STD_ROM_FN(dygera) - -struct BurnDriver BurnDrvDygera = { - "dygera", "dyger", NULL, NULL, "1989", - "Dyger (Korea set 2)\0", NULL, "Philko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, dygeraRomInfo, dygeraRomName, NULL, NULL, DygerInputInfo, DygerDIPInfo, - DygerInit, DrvExit, DrvFrame, DygerDraw, DrvScan, &DrvRecalc, 0x800, - 224, 384, 3, 4 -}; - - -// Twin Falcons - -static struct BurnRomInfo twinfalcRomDesc[] = { - { "t-15.bin", 0x08000, 0xe1f20144, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "t-14.bin", 0x10000, 0xc499ff83, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "t-1.b4", 0x08000, 0xb84bc980, 2 | BRF_PRG | BRF_ESS }, // 2 Sound CPU - - { "t-6.r6", 0x08000, 0x8e4ca776, 3 | BRF_GRA }, // 3 Characters - - { "t-10.y10", 0x10000, 0xb678ef5b, 4 | BRF_GRA }, // 4 Tiles - { "t-9.w10", 0x10000, 0xd7345fb9, 4 | BRF_GRA }, // 5 - { "t-8.u10", 0x10000, 0x41428dac, 4 | BRF_GRA }, // 6 - { "t-13.y11", 0x10000, 0x0eba10bd, 4 | BRF_GRA }, // 7 - { "t-12.w11", 0x10000, 0xc65050ce, 4 | BRF_GRA }, // 8 - { "t-11.u11", 0x10000, 0x51a2c65d, 4 | BRF_GRA }, // 9 - - { "t-2.a5", 0x10000, 0x9c106835, 5 | BRF_GRA }, // 10 Sprites - { "t-3.b5", 0x10000, 0x9b421ccf, 5 | BRF_GRA }, // 11 - { "t-4.a7", 0x10000, 0x3a1db986, 5 | BRF_GRA }, // 12 - { "t-5.b7", 0x10000, 0x9bd22190, 5 | BRF_GRA }, // 13 - - { "t-7.y8", 0x08000, 0xa8b5f750, 6 | BRF_GRA }, // 14 Tilemap -}; - -STD_ROM_PICK(twinfalc) -STD_ROM_FN(twinfalc) - -struct BurnDriver BurnDrvTwinfalc = { - "twinfalc", NULL, NULL, NULL, "1989", - "Twin Falcons\0", NULL, "Philko (Poara Enterprises license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, twinfalcRomInfo, twinfalcRomName, NULL, NULL, WhizzInputInfo, WhizzDIPInfo, - WhizzInit, DrvExit, DrvFrame, DygerDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - - -// Whizz - -static struct BurnRomInfo whizzRomDesc[] = { - { "t-15.l11", 0x08000, 0x73161302, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU - { "t-14.k11", 0x10000, 0xbf248879, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "t-1.b4", 0x08000, 0xb84bc980, 2 | BRF_PRG | BRF_ESS }, // 2 Sound CPU - - { "t-6.r6", 0x08000, 0x8e4ca776, 3 | BRF_GRA }, // 3 Characters - - { "t-10.y10", 0x10000, 0xb678ef5b, 4 | BRF_GRA }, // 4 Tiles - { "t-9.w10", 0x10000, 0xd7345fb9, 4 | BRF_GRA }, // 5 - { "t-8.u10", 0x10000, 0x41428dac, 4 | BRF_GRA }, // 6 - { "t-13.y11", 0x10000, 0x0eba10bd, 4 | BRF_GRA }, // 7 - { "t-12.w11", 0x10000, 0xc65050ce, 4 | BRF_GRA }, // 8 - { "t-11.u11", 0x10000, 0x51a2c65d, 4 | BRF_GRA }, // 9 - - { "t-2.a5", 0x10000, 0x9c106835, 5 | BRF_GRA }, // 10 Sprites - { "t-3.b5", 0x10000, 0x9b421ccf, 5 | BRF_GRA }, // 11 - { "t-4.a7", 0x10000, 0x3a1db986, 5 | BRF_GRA }, // 12 - { "t-5.b7", 0x10000, 0x9bd22190, 5 | BRF_GRA }, // 13 - - { "t-7.y8", 0x08000, 0xa8b5f750, 6 | BRF_GRA }, // 14 Tilemap -}; - -STD_ROM_PICK(whizz) -STD_ROM_FN(whizz) - -struct BurnDriver BurnDrvWhizz = { - "whizz", "twinfalc", NULL, NULL, "1989", - "Whizz\0", NULL, "Philko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, whizzRomInfo, whizzRomName, NULL, NULL, WhizzInputInfo, WhizzDIPInfo, - WhizzInit, DrvExit, DrvFrame, DygerDraw, DrvScan, &DrvRecalc, 0x800, - 384, 224, 4, 3 -}; - diff --git a/jan/src/burn/drv/pre90s/d_skyarmy.cpp b/jan/src/burn/drv/pre90s/d_skyarmy.cpp deleted file mode 100644 index d5a814509..000000000 --- a/jan/src/burn/drv/pre90s/d_skyarmy.cpp +++ /dev/null @@ -1,734 +0,0 @@ -// FB Alpha Sky Army driver module -// Based on MAME driver by Ryan Holtz - - -// This particular driver is a tutorial to hopefully help others -// develop drivers for fba using mame's source as a starting point -// I have tried to document as many lines as possible, and given hopefully enough details -// -// original source: -// src\mame\drivers\skyarmy.c -// - -#include "tiles_generic.h" // either this or burnint.h is required, but not both -#include "z80_intf.h" -#include "bitswap.h" // using bitswap functions in this driver... - -#include "driver.h" // all part of the ay8910 header -extern "C" { -#include "ay8910.h" -} - -// define variables, most of these can be gotten from memindex - -static UINT8 *AllMem; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *AllRam; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *RamEnd; -static UINT8 *MemEnd; - -static UINT32 *Palette; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[1]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvReset; - -static UINT8 nmi_enable; - -// static INPUT_PORTS_START( skyarmy ) -static struct BurnInputInfo SkyarmyInputList[] = { -// PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) - {"Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - -// DrvJoy3 + 0 -> 0x01 is (0x01 << 0) -// DrvJoy3 + 1 -> 0x02 is (0x01 << 1) ( * 2) -// DrvJoy3 + 6 -> 0x40 is (0x01 << 6) ( * 64) - -// PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 ) - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 1, "p1 start"}, -// PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, -// PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, -// PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, -// PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, -// PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, -// PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, -// PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 3, "p1 fire 3"}, -// PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) - {"P1 Button 4", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 4"}, -// PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) - {"P1 Button 5", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 5"}, -// PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON6 ) - {"P1 Button 6", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 6"}, - -// PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 2, "p2 start"}, -// PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, -// PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, -// PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, -// PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, -// PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, -// PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - -// PORT_START("DSW") - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Skyarmy) - -static struct BurnDIPInfo SkyarmyDIPList[]= -{ - {0x14, 0xff, 0xff, 0x02, NULL }, - -#if 0 - - PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) - PORT_DIPSETTING( 0x00, "2" ) - PORT_DIPSETTING( 0x01, "3" ) - PORT_DIPSETTING( 0x02, "4" ) -#endif - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x00, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x02, "4" }, - {0x14, 0x01, 0x03, 0x03, "Free Play" }, - -#if 0 - PORT_DIPSETTING( 0x03, DEF_STR (Free_Play )) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) -#endif - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x14, 0x01, 0x08, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x08, 0x01, "1 Coin 2 Credits" }, -}; - -STDDIPINFO(Skyarmy) -// end input setup... - - -/* - memory handlers - these take care of everything that isn't ram or rom -*/ - -void __fastcall skyarmy_write(UINT16 address, UINT8 data)// handle writes for skyarmy_map -{ - switch (address) - { - case 0xa004: // nmi_enable_w - nmi_enable = data & 1; // state->nmi=data&1; - return; - - case 0xa005: - case 0xa006: - case 0xa007: // AM_WRITENOP <- ignore these writes - return; - } -} - -UINT8 __fastcall skyarmy_read(UINT16 address)// handle reads for skyarmy_map -{ - switch (address) - { - case 0xa000: // AM_READ_PORT("DSW") - return DrvDips[0]; - - case 0xa001: // AM_READ_PORT("P1") - return DrvInputs[0]; - - case 0xa002: // AM_READ_PORT("P2") - return DrvInputs[1]; - - case 0xa003: // AM_READ_PORT("SYSTEM") - return DrvInputs[2]; - } - - return 0; -} - -void __fastcall skyarmy_write_port(UINT16 port, UINT8 data)// handle writes to skyarmy_io_map -{ - switch (port & 0xff) // ADDRESS_MAP_GLOBAL_MASK(0xff) - { - case 0x04: // AM_DEVWRITE("aysnd", ay8910_address_data_w) - AY8910Write(0 /* for multiple ay8910 */, 0 /* ay8910 has 2 write ports*/, data /* write actual data */); - return; - - case 0x05: // AM_DEVWRITE("aysnd", ay8910_address_data_w) - AY8910Write(0, 1, data); - return; - } -} - -UINT8 __fastcall skyarmy_read_port(UINT16 port)// handle reads from skyarmy_io_map -{ - switch (port & 0xff) // ADDRESS_MAP_GLOBAL_MASK(0xff) - { - case 0x06: // AM_DEVREAD("aysnd", ay8910_r) - return AY8910Read(0); - } - - return 0; -} - -/* - reset the machine - this is required or lots of bad things happen -*/ - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); // clear all ram! - - ZetOpen(0); // open cpu - ZetReset(); // reset it - ZetClose(); // close it - - AY8910Reset(0); // reset ay8910 sound cpu - - HiscoreReset(); - - nmi_enable = 0; // disable nmi by default - - return 0; -} - -// convert palette rom into a format fba can use (24-bit color) - -//static PALETTE_INIT( skyarmy ) // mame -static void DrvPaletteInit() -{ - INT32 i; - - UINT8 *color_prom = DrvColPROM; // fba - - for (i = 0;i < 32;i++) - { - INT32 bit0,bit1,bit2,r,g,b; - - bit0 = (*color_prom >> 0) & 0x01; - bit1 = (*color_prom >> 1) & 0x01; - bit2 = (*color_prom >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (*color_prom >> 3) & 0x01; - bit1 = (*color_prom >> 4) & 0x01; - bit2 = (*color_prom >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0=0; - bit1 = (*color_prom >> 6) & 0x01; - bit2 = (*color_prom >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - -// palette_set_color(machine,i,MAKE_RGB(r,g,b)); // mame - - // assemble colors into 24-bit standard rgb format - - Palette[i] = (r << 16) | (g << 8) | (b << 0); // fba - - color_prom++; - } -} - -/* - convert the graphics into a format fba's generic tile handling can use -*/ - -static INT32 DrvGfxDecode() -{ -#if 0 -static const gfx_layout charlayout = -{ - 8,8, - 256, - 2, - { 0, 256*8*8 }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - -static const gfx_layout spritelayout = -{ - 16,16, - 32*2, - 2, - { 0, 256*8*8 }, - { 0, 1, 2, 3, 4, 5, 6, 7, - 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 16*8,17*8,18*8,19*8,20*8,21*8,22*8,23*8 }, - 32*8 -}; - -static GFXDECODE_START( skyarmy ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 8 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 8 ) -GFXDECODE_END -#endif - - INT32 Plane[2] = { 0, 256*8*8 }; // <---------- same for both types! - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, // <--- 0 - 7 is used for both types, so we can repeat this and save a few lines - 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,// <--- 0 - 7 is used for both types, so we can repeat this and save a few lines - 16*8,17*8,18*8,19*8,20*8,21*8,22*8,23*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x1000); // ROM_REGION( 0x1000, "gfx1", 0 ), ROM_REGION( 0x1000, "gfx2", 0 ) whichever is larger... - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x1000); // ROM_REGION( 0x1000, "gfx1", 0 ) - -// number of tiles, bits per pixel, width, height, pointer to plane offsets, x offsets, y offsets, modulo, source, destination - - GfxDecode(256 , 2, 8, 8, Plane, XOffs, YOffs, 8 * 8, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x1000); // ROM_REGION( 0x1000, "gfx2", 0 ) - - GfxDecode(32*2, 2, 16, 16, Plane, XOffs, YOffs, 32 * 8, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -/* - MemIndex sets up memory for us - - Next += ... is the size for the previous region - - Values between AllRam and RamEnd are all RAM for the machine we are emulating - we *should* reset these in DrvDoReset -*/ - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; // ROM_REGION( 0x10000, "maincpu", 0 ) - - DrvGfxROM0 = Next; Next += 0x001000 * 8 / 2; // 8 bits per byte, and graphics are 2 bits per pixel - DrvGfxROM1 = Next; Next += 0x001000 * 8 / 2; - - DrvColPROM = Next; Next += 0x000020; - - Palette = (UINT32 *)Next; Next += 0x0020 * sizeof(UINT32); // MDRV_PALETTE_LENGTH(32) - DrvPalette = (UINT32 *)Next; Next += 0x0020 * sizeof(UINT32); // MDRV_PALETTE_LENGTH(32) - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; // ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); <-- (0x87ff+1) - 0x8000 - DrvVidRAM = Next; Next += 0x000800; // ZetMapArea(0x8800, 0x8fff, 0, DrvVidRAM); <-- (0x8fff+1) - 0x8800 - DrvColRAM = Next; Next += 0x000400; // ZetMapArea(0x9000, 0x93ff, 2, DrvColRAM); <-- (0x93ff+1) - 0x9000 - DrvSprRAM = Next; Next += 0x000100; // ZetMapArea(0x9800, 0x98ff, 0, DrvSprRAM); <-- (0x98ff+1) - 0x9800 - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); // allocate ram for sound output - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); // only really necessary for ay8910 - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - - - MemEnd = Next; - - return 0; -} - -/* - DrvInit sets up the machine that we are emulating - - Here we: - allocate the necessary ram - load roms in to ram - set up cpu(s) - set up sound chips - initialize fba's graphics routines - reset the machine -*/ - -static INT32 DrvInit() -{ - // set up and allocate memory for roms & ram - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { -// ROM_REGION( 0x10000, "maincpu", 0 ) - -// ROM_LOAD( "a1h.bin", 0x0000, 0x2000, CRC(e3fb9d70) SHA1(b8e3a6d7d6ef30c1397f9b741132c5257c16be2d) ) - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - -// ROM_LOAD( "a2h.bin", 0x2000, 0x2000, CRC(0417653e) SHA1(4f6ad7335b5b7e85b4e16cce3c127488c02401b2) ) - if (BurnLoadRom(DrvZ80ROM + 0x02000, 1, 1)) return 1; - -// ROM_LOAD( "a3h.bin", 0x4000, 0x2000, CRC(95485e56) SHA1(c4cbcd31ba68769d2d0d0875e2a92982265339ae) ) - if (BurnLoadRom(DrvZ80ROM + 0x04000, 2, 1)) return 1; - -// ROM_LOAD( "j4.bin", 0x6000, 0x2000, CRC(843783df) SHA1(256d8375a8af7de080d456dbc6290a22473d011b) ) - if (BurnLoadRom(DrvZ80ROM + 0x06000, 3, 1)) return 1; - -// ROM_REGION( 0x1000, "gfx1", 0 ) - -// ROM_LOAD( "13b.bin", 0x0000, 0x0800, CRC(3b0e0f7c) SHA1(2bbba10121d3e745146f50c14dc6df97de40fb96) ) - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - -// ROM_LOAD( "15b.bin", 0x0800, 0x0800, CRC(5ccfd782) SHA1(408406ae068e5578b8a742abed1c37dcd3720fe5) ) - if (BurnLoadRom(DrvGfxROM0 + 0x00800, 5, 1)) return 1; - -// ROM_REGION( 0x1000, "gfx2", 0 ) - -// ROM_LOAD( "8b.bin", 0x0000, 0x0800, CRC(6ac6bd98) SHA1(e653d80ec1b0f8e07821ea781942dae3de7d238d) ) - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - -// ROM_LOAD( "10b.bin", 0x0800, 0x0800, CRC(cada7682) SHA1(83ce8336274cb8006a445ac17a179d9ffd4d6809) ) - if (BurnLoadRom(DrvGfxROM1 + 0x00800, 7, 1)) return 1; - -// ROM_REGION( 0x0020, "proms", 0 ) -// ROM_LOAD( "a6.bin", 0x0000, 0x0020, CRC(c721220b) SHA1(61b3320fb616c0600d56840cb6438616c7e0c6eb) ) - if (BurnLoadRom(DrvColPROM + 0x00000, 8, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); // initialize cpu - - ZetOpen(0); // open cpu #0 for modification - - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); // AM_RANGE(0x0000, 0x7fff) AM_ROM - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); // AM_RANGE(0x8000, 0x87ff) AM_RAM - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - - ZetMapArea(0x8800, 0x8fff, 0, DrvVidRAM); // AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(skyarmy_videoram_w) < -- skyarmy_videoram_w does't do anything useful - ZetMapArea(0x8800, 0x8fff, 1, DrvVidRAM); - ZetMapArea(0x8800, 0x8fff, 2, DrvVidRAM); - - ZetMapArea(0x9000, 0x93ff, 0, DrvColRAM); // AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(skyarmy_colorram_w) < -- skyarmy_colorram_w doesn't do anything useful - ZetMapArea(0x9000, 0x93ff, 1, DrvColRAM); - ZetMapArea(0x9000, 0x93ff, 2, DrvColRAM); - - ZetMapArea(0x9800, 0x98ff, 0, DrvSprRAM); // AM_RANGE(0x9800, 0x983f) AM_RAM AM_BASE_MEMBER(skyarmy_state,spriteram) - ZetMapArea(0x9800, 0x98ff, 1, DrvSprRAM); // AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_MEMBER(skyarmy_state,scrollram) - ZetMapArea(0x9800, 0x98ff, 2, DrvSprRAM); // ZetMapArea( can only handle 0-ff sized areas, so we must combine these two writes scrollram = sprram + 0x40 - - ZetSetWriteHandler(skyarmy_write); // handle writes for skyarmy_map that aren't ram / rom - ZetSetReadHandler(skyarmy_read); // handle reads for skyarmy_map that aren't ram / rom - - ZetSetOutHandler(skyarmy_write_port); // handle writes to skyarmy_io_map - ZetSetInHandler(skyarmy_read_port); // handle reads from skyarmy_io_map - - ZetClose(); // close cpu to further modifications - - AY8910Init(0, 2500000, nBurnSoundRate, NULL, NULL, NULL, NULL); // MDRV_SOUND_ADD("aysnd", AY8910, 2500000) - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); // this must be called for generic tile handling - - DrvDoReset(); // reset the machine.. - - return 0; -} - -/* - DrvExit exits the machine -*/ - -static INT32 DrvExit() -{ - GenericTilesExit(); // exit generic tile handling - - ZetExit(); // exit cpu - - AY8910Exit(0); // exit ay8910 cpu - - BurnFree (AllMem); // Free all RAM - - return 0; -} - - -static void tilemap_draw() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) // tilemap_create(machine, get_skyarmy_tile_info, tilemap_scan_rows, 8, 8, 32, 32); - { - INT32 sx = (offs % 32) * 8; // tilemap_create(machine, get_skyarmy_tile_info, tilemap_scan_rows, 8 (sx tile width), 8, 32 (number of tiles wide), 32); - INT32 sy = (offs / 32) * 8; // tilemap_create(machine, get_skyarmy_tile_info, tilemap_scan_rows, 8, 8 (sy tile height), 32, 32 (number of tiles high)); - -// for(i=0;i<0x20;i++) -// tilemap_set_scrolly( state->tilemap,i,state->scrollram[i]); -// tilemap_set_scroll_cols(state->tilemap,32); - - sy -= DrvSprRAM[0x40 + (offs % 32)] + 8; // (offs % 32) gives the column, scroll ram is 64 bytes after sprite data - if (sy < -7) sy += 256; // (256 = 32 * 8), -7 or the screen shows garbage at the sides - - INT32 code = DrvVidRAM[offs]; // which tile are we drawing? - INT32 attr = BITSWAP08(DrvColRAM[offs], 7, 6, 5, 4, 3, 0, 1, 2) & 7; // color - - // there is no transparency color (mask), can possibly be partially off the screen so use clip, and does not do flip - Render8x8Tile_Clip(pTransDraw, code, sx, sy, attr /*color*/, 2 /* 2 bits - determine with gfx decode */, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x40; offs+=4) - { - INT32 pal = BITSWAP08(DrvSprRAM[offs+2], 7, 6, 5, 4, 3, 0, 1, 2) & 7; // color (this particular setup is unusual) - - INT32 sx = DrvSprRAM[offs+3]; // horizontal position -> start x - INT32 sy = 240-(DrvSprRAM[offs] + 1) - 8; // vertical position -> start y - INT32 flipy = (DrvSprRAM[offs+1]&0x80)>>7; // flip tile vertically? - INT32 flipx = (DrvSprRAM[offs+1]&0x40)>>6; // flip tile horizontally? - INT32 code = DrvSprRAM[offs + 1] & 0x3f; // which tile are we drawing? - if (sy < -7) sy += 256; // (256 = 32 * 8), -7 or the screen shows garbage at the sides - if (sx < -7) sx += 256; // same as above, but do sx too. this handles sprite/tile wrapping. - if (sy > 240) sy -= 256; // this kind of wrapping isn't as common or used in every game, but it's used here to fix the missing bridge heli when arriving at home base. -dink -#if 0 - drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], - spriteram[offs+1]&0x3f, /* code! */ - pal, /* color*/ - flipx,flipy, - sx,sy,0 /*transparent color!*/); -#endif - - // this does have flip, can be partially off screen, and has a transparent color - // so use flip, mask, clip - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, pal /*color*/, 2 /*2 bits*/, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, pal /*color*/, 2 /*2 bits*/, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, pal /*color*/, 2 /*2 bits*/, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, pal /*color*/, 2 /*2 bits*/, 0, 0, DrvGfxROM1); - } - } - } -} - - -//static VIDEO_UPDATE( skyarmy ) -static INT32 DrvDraw() -{ - // this will recalculate the colors if the screen color depth changes - if (DrvRecalc) { - for (INT32 i = 0; i < 32; i++) { - INT32 d = Palette[i]; - DrvPalette[i] = BurnHighCol(d >> 16, (d >> 8) & 0xff, d & 0xff, 0); - } - DrvRecalc = 0; // ok, we've recalculated it, now disable it for the next frame or we waste a lot of time - } - - tilemap_draw(); - draw_sprites(); // this was originally inside VIDEO_UPDATE, but move it to its own function to make things cleaner - - BurnTransferCopy(DrvPalette); // copy pixels so that they will work at any screen color depth - - return 0; -} - - -/* - the frame function is where we actually run the machine - here we: - reset the machine if necessary - assemble inputs in a way the machine can understand - run the cpu - set the irqs (interrupts [it's complicated]) - output sound - draw video -*/ - -static INT32 DrvFrame() -{ - if (DrvReset) { // is the reset button pressed - DrvDoReset(); // if so, reset! - } - - // assemble inputs - { - memset (DrvInputs, 0, 3); // clear input storage bytes < if IP_ACTIVE_HIGH clear with 0, if IP_ACTIVE_LOW, clear with 0xff - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; // pack bits for inputs in to respective bytes - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - // MDRV_SCREEN_REFRESH_RATE(60) ! 60!! - - INT32 nInterleave = 102/8; // MDRV_CPU_PERIODIC_INT(skyarmy_nmi_source,650) -> 4000000 / 60 -> 66666.67 / 650 -> 102 (add /8 to get the right timing -dink) - INT32 nCyclesTotal = 4000000 / 60; // MDRV_CPU_ADD("maincpu", Z80,4000000) - INT32 nCyclesDone = 0; - INT32 nSoundBufferPos = 0; - - ZetOpen(0); // open cpu for modification - - for (INT32 i = 0; i < nInterleave; i++) // split the amount of cpu the z80 is running in 1/60th of a second into slices - { - INT32 nSegment = nCyclesTotal / nInterleave; - - nCyclesDone += ZetRun(nSegment); // actually run the cpu - - if (i == (nInterleave - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); // MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) - } - // don't call if the irq above is triggered... - // static INTERRUPT_GEN( skyarmy_nmi_source ) - if (i != (nInterleave - 1) && nmi_enable) ZetNmi(); //if(state->nmi) cpu_set_input_line(device,INPUT_LINE_NMI, PULSE_LINE); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - ZetClose(); // close the cpu to modifications - -// output the sound -- ay8910 is more complex than most -// you can pretty much just copy and paste this from other drivers (this blob is from d_4enraya.cpp) - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - // make sure the drawing surface is allocated and then draw! - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -/* - fba's save state function - - we check the lowest version of fba this should be compatible with - and if it's not, we exit the state loading - - we also save ram, data from the z80, ay8910, and other misc data -*/ - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029708; // use current version number - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); // save all ram - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); // save z80 data - AY8910Scan(nAction, pnMin); // save ay8910 data - - SCAN_VAR(nmi_enable); // save nmi_enable since it is not part of defined ram (in memindex) - } - - return 0; -} - - -// Sky Army - -static struct BurnRomInfo skyarmyRomDesc[] = { -// ROM_REGION( 0x10000, "maincpu", 0 ) -// ROM_LOAD( "a1h.bin", 0x0000, 0x2000, CRC(e3fb9d70) SHA1(b8e3a6d7d6ef30c1397f9b741132c5257c16be2d) ) - { "a1h.bin", 0x2000, 0xe3fb9d70, 1 }, // 0 maincpu -// ROM_LOAD( "a2h.bin", 0x2000, 0x2000, CRC(0417653e) SHA1(4f6ad7335b5b7e85b4e16cce3c127488c02401b2) ) - { "a2h.bin", 0x2000, 0x0417653e, 1 }, // 1 -// ROM_LOAD( "a3h.bin", 0x4000, 0x2000, CRC(95485e56) SHA1(c4cbcd31ba68769d2d0d0875e2a92982265339ae) ) - { "a3h.bin", 0x2000, 0x95485e56, 1 }, // 2 -// ROM_LOAD( "j4.bin", 0x6000, 0x2000, CRC(843783df) SHA1(256d8375a8af7de080d456dbc6290a22473d011b) ) - { "j4.bin", 0x2000, 0x843783df, 1 }, // 3 - -// ROM_REGION( 0x1000, "gfx1", 0 ) -// ROM_LOAD( "13b.bin", 0x0000, 0x0800, CRC(3b0e0f7c) SHA1(2bbba10121d3e745146f50c14dc6df97de40fb96) ) - { "13b.bin", 0x0800, 0x3b0e0f7c, 2 }, // 4 gfx1 -// ROM_LOAD( "15b.bin", 0x0800, 0x0800, CRC(5ccfd782) SHA1(408406ae068e5578b8a742abed1c37dcd3720fe5) ) - { "15b.bin", 0x0800, 0x5ccfd782, 2 }, // 5 - -// ROM_REGION( 0x1000, "gfx2", 0 ) -// ROM_LOAD( "8b.bin", 0x0000, 0x0800, CRC(6ac6bd98) SHA1(e653d80ec1b0f8e07821ea781942dae3de7d238d) ) - { "8b.bin", 0x0800, 0x6ac6bd98, 3 }, // 6 gfx2 -// ROM_LOAD( "10b.bin", 0x0800, 0x0800, CRC(cada7682) SHA1(83ce8336274cb8006a445ac17a179d9ffd4d6809) ) - { "10b.bin", 0x0800, 0xcada7682, 3 }, // 7 - -// ROM_REGION( 0x0020, "proms", 0 ) -// ROM_LOAD( "a6.bin", 0x0000, 0x0020, CRC(c721220b) SHA1(61b3320fb616c0600d56840cb6438616c7e0c6eb) ) - { "a6.bin", 0x0020, 0xc721220b, 4 }, // 8 proms -}; - -STD_ROM_PICK(skyarmy) -STD_ROM_FN(skyarmy) - -//GAME( 1982, skyarmy, 0, skyarmy, skyarmy, 0, ROT90, "Shoei", "Sky Army", 0 ) - -struct BurnDriver BurnDrvSkyarmy = { - "skyarmy", NULL, NULL, NULL, "1982", // set name, parent name, bios name, publish date - "Sky Army\0", NULL, "Shoei", "Miscellaneous", // title, notes, developer, hardware name - NULL, NULL, NULL, NULL, // unicode title, unicode notes, unicode developer, unicode hardware name - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, // orientation vertical | flipped -> ROT90, number of players, hardware type, game category, series? - NULL, skyarmyRomInfo, skyarmyRomName, NULL, NULL, SkyarmyInputInfo, SkyarmyDIPInfo, // extra rom load routine (usually not used), rom info, rom name, input def, dip def - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 32, // 32 = palette size // pointers to init, exit, frame, draw, savestate, jukebox, drvrecalc (palette), number of palette colors - 240, 256, 3, 4 // MDRV_SCREEN_VISIBLE_AREA(0*8,32*8-1,1*8,31*8-1) switch x & y because of ROT90 // screen width, screen width, aspect ration x, y -}; - diff --git a/jan/src/burn/drv/pre90s/d_skyfox.cpp b/jan/src/burn/drv/pre90s/d_skyfox.cpp deleted file mode 100644 index 9d562074f..000000000 --- a/jan/src/burn/drv/pre90s/d_skyfox.cpp +++ /dev/null @@ -1,622 +0,0 @@ -// FB Alpha Skyfox Driver Module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRegs; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[1]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[1]; -static UINT8 DrvReset; - -static UINT8 *soundlatch; -static UINT8 *DrvBgCtrl; -static INT32 *DrvBgPos; - -static INT32 vblank; - -static struct BurnInputInfo SkyfoxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Skyfox) - -static struct BurnDIPInfo SkyfoxDIPList[]= -{ - {0x09, 0xff, 0xff, 0x6f, NULL }, - {0x0a, 0xff, 0xff, 0xf0, NULL }, - {0x0b, 0xff, 0xff, 0xfa, NULL }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x09, 0x01, 0x18, 0x00, "20K" }, - {0x09, 0x01, 0x18, 0x08, "30K" }, - {0x09, 0x01, 0x18, 0x10, "40K" }, - {0x09, 0x01, 0x18, 0x18, "50K" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x09, 0x01, 0x20, 0x20, "Medium" }, - {0x09, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x09, 0x01, 0x40, 0x40, "Off" }, - {0x09, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x09, 0x01, 0x80, 0x00, "Upright" }, - {0x09, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0a, 0x01, 0x0e, 0x0e, "5 Coins 1 Credits" }, - {0x0a, 0x01, 0x0e, 0x0a, "4 Coins 1 Credits" }, - {0x0a, 0x01, 0x0e, 0x06, "3 Coins 1 Credits" }, - {0x0a, 0x01, 0x0e, 0x02, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x0e, 0x00, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x0e, 0x04, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x0e, 0x08, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0x0e, 0x0c, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 6, "Lives" }, - {0x0b, 0x01, 0x07, 0x00, "1" }, - {0x0b, 0x01, 0x07, 0x01, "2" }, - {0x0b, 0x01, 0x07, 0x02, "3" }, - {0x0b, 0x01, 0x07, 0x03, "4" }, - {0x0b, 0x01, 0x07, 0x04, "5" }, - {0x0b, 0x01, 0x07, 0x07, "Infinite (Cheat)" }, -}; - -STDDIPINFO(Skyfox) - -void __fastcall skyfox_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe008: - case 0xe009: - case 0xe00a: - case 0xe00b: - case 0xe00c: - case 0xe00d: - case 0xe00e: - case 0xe00f: - DrvVidRegs[address & 7] = data; - return; - } -} - -UINT8 __fastcall skyfox_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - return DrvInputs[0]; - - case 0xe001: - return DrvDips[0]; - - case 0xe002: - return DrvDips[1] | vblank; - - case 0xf001: - return DrvDips[2]; - } - - return 0; -} - -void __fastcall skyfox_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xc000: - case 0xc001: - BurnYM2203Write(1, address & 1, data); - return; - } -} - -UINT8 __fastcall skyfox_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa001: - return BurnYM2203Read(0, 0); - - case 0xb000: - return *soundlatch; - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x060000; - DrvGfxROM1 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001000; - - DrvVidRegs = Next; - DrvBgCtrl = Next; - soundlatch = Next + 1; Next += 0x000008; - - DrvBgPos = (INT32*)Next; Next += 0x00001 * sizeof(INT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x60000); - - for (INT32 i = 0; i < 0x60000; i++) { - tmp[i] = DrvGfxROM0[(i&~0x3ff) | (i&7) | (((i>>3)&7)<<5) | (((i>>6)&3)<<3) | (i&0x300)]; - } - - memcpy (DrvGfxROM0, tmp, 0x60000); - - BurnFree (tmp); -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 256; i++) - { - INT32 bit0,bit1,bit2,bit3,r,g,b; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - bit3 = (DrvColPROM[i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 256] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 256] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 256] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 256] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 2*256] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 2*256] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 2*256] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 2*256] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 256; i++) - { - DrvPalette[i | 0x100] = BurnHighCol(i,i,i,0); - } -} - -static INT32 DrvDoReset() -{ - memset(AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - - return 0; -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 1748000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 1748000.0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x30000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x50000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 12, 1)) return 1; - - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xbfff, 1, DrvZ80ROM0); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM0); - ZetMapArea(0xc000, 0xcfff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 2, DrvZ80RAM0); - ZetMapArea(0xd000, 0xdfff, 0, DrvSprRAM); - ZetMapArea(0xd000, 0xdfff, 1, DrvSprRAM); - ZetMapArea(0xd000, 0xdfff, 2, DrvSprRAM); - ZetSetWriteHandler(skyfox_write); - ZetSetReadHandler(skyfox_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); - ZetSetWriteHandler(skyfox_sound_write); - ZetSetReadHandler(skyfox_sound_read); - ZetClose(); - - BurnYM2203Init(2, 1748000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(1748000); - BurnYM2203SetAllRoutes(0, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2203Exit(); - GenericTilesExit(); - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - INT32 shift = (*DrvBgCtrl & 0x80) ? (4-1) : 4; - - for (INT32 offs = 0; offs < 0x400; offs += 4) - { - INT32 xstart, ystart, xend, yend; - INT32 xinc, yinc, dx, dy; - INT32 low_code, n; - - INT32 y = DrvSprRAM[offs + 0]; - INT32 x = DrvSprRAM[offs + 1]; - INT32 code = DrvSprRAM[offs + 2] | (DrvSprRAM[offs+3] << 8); - INT32 flipx = code & 0x02; - INT32 flipy = code & 0x04; - - x = (x << 1) | (code & 1); - - INT32 high_code = ((code >> 4) & 0x7f0) + ((code & 0x8000) >> shift); - - switch (code & 0x88) - { - case 0x88: n = 4; low_code = 0; break; - case 0x08: n = 2; low_code = ((code & 0x20) >> 2) + ((code & 0x10) >> 3); break; - default: n = 1; low_code = (code >> 4) & 0x0f; break; - } - - if (*DrvBgCtrl & 1) - { - x = ((nScreenWidth-1) - x - ((n - 1) << 3)) + 88; - y = ((nScreenHeight-1) - y - ((n - 1) << 3)) + 8; - flipx = !flipx; - flipy = !flipy; - } else { - x -= 0x60; - y -= 0x10; - } - - if (flipx) { xstart = n-1; xend = -1; xinc = -1; } - else { xstart = 0; xend = n; xinc = +1; } - - if (flipy) { ystart = n-1; yend = -1; yinc = -1; } - else { ystart = 0; yend = n; yinc = +1; } - - code = low_code + high_code; - - for (dy = ystart; dy != yend; dy += yinc) - { - INT32 sy = y + (dy << 3); - - for (dx = xstart; dx != xend; dx += xinc) - { - INT32 sx = x + (dx << 3); - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code++, sx, sy, 0, 8, 0xff, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code++, sx, sy, 0, 8, 0xff, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code++,sx, sy, 0, 8, 0xff, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code++, sx, sy, 0, 8, 0xff, 0, DrvGfxROM0); - } - } - } - - code += n & 2; - } - } -} - -static void draw_background() -{ - INT32 pos = (*DrvBgPos >> 4) & 0x3ff; - - for (INT32 i = 0; i < 0x1000; i++) - { - INT32 offs = ((*DrvBgCtrl << 9) & 0x6000) + (i << 1); - INT32 attr = DrvGfxROM1[offs]; - INT32 x = (DrvGfxROM1[offs + 1] << 1) + (i & 1) + pos + ((i & 8) << 6); - INT32 y = ((i >> 4) << 3) | (i & 7); - INT32 pen = (attr & 0x7f) | 0x100; - - if (*DrvBgCtrl & 1) - { - x = 0x400 - (x & 0x3ff); - y = 0x100 - (y & 0x0ff); - } - - for (INT32 j = 0; j <= ((attr & 0x80) ? 0 : 3); j++) - { - INT32 sx = ((((j >> 0) & 1) + x) & 0x1ff) - 0x60; - INT32 sy = ((((j >> 1) & 1) + y) & 0x0ff) - 0x10; - - if (sx < 0 || sy < 0 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - pTransDraw[sy * nScreenWidth + sx] = pen; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 offs = 0; offs < nScreenWidth * nScreenHeight; offs++) { - pTransDraw[offs] = 0x00ff; - } - - draw_background(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - *DrvBgPos += (*DrvBgCtrl >> 1) & 7; - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0xff; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - } - - ZetNewFrame(); - vblank = 0; - - INT32 nCycleSegment; - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 4000000 / 60, 1748000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 8 || i == 248) vblank ^= 1; - - nCycleSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCycleSegment); - if (i == (nInterleave-1) && DrvJoy2[0]) ZetNmi(); - ZetClose(); - - nCycleSegment = nCyclesTotal[1] / nInterleave; - - ZetOpen(1); - //nCyclesDone[1] += ZetRun(nCycleSegment); - BurnTimerUpdate(i * nCycleSegment); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - - ZetScan(nAction); - BurnYM2203Scan(nAction, pnMin); - } - - return 0; -} - - -// Sky Fox - -static struct BurnRomInfo skyfoxRomDesc[] = { - { "skyfox1.bin", 0x08000, 0xb4d4bb6f, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "skyfox2.bin", 0x08000, 0xe15e0263, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "skyfox9.bin", 0x08000, 0x0b283bf5, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "skyfox3.bin", 0x10000, 0x3a17a929, 3 | BRF_GRA }, // 3 Sprites - { "skyfox4.bin", 0x10000, 0x358053bb, 3 | BRF_GRA }, // 4 - { "skyfox5.bin", 0x10000, 0xc1215a6e, 3 | BRF_GRA }, // 5 - { "skyfox6.bin", 0x10000, 0xcc37e15d, 3 | BRF_GRA }, // 6 - { "skyfox7.bin", 0x10000, 0xfa2ab5b4, 3 | BRF_GRA }, // 7 - { "skyfox8.bin", 0x10000, 0x0e3edc49, 3 | BRF_GRA }, // 8 - - { "skyfox10.bin", 0x08000, 0x19f58f9c, 4 | BRF_GRA }, // 9 Starfield - - { "sfoxrprm.bin", 0x00100, 0x79913c7f, 5 | BRF_GRA }, // 10 Color Proms - { "sfoxgprm.bin", 0x00100, 0xfb73d434, 5 | BRF_GRA }, // 11 - { "sfoxbprm.bin", 0x00100, 0x60d2ab41, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(skyfox) -STD_ROM_FN(skyfox) - -struct BurnDriver BurnDrvSkyfox = { - "skyfox", NULL, NULL, NULL, "1987", - "Sky Fox\0", NULL, "Jaleco (Nichibutsu USA license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, skyfoxRomInfo, skyfoxRomName, NULL, NULL, SkyfoxInputInfo, SkyfoxDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 320, 3, 4 -}; - - -// Exerizer (Japan) (bootleg) - -static struct BurnRomInfo exerizrbRomDesc[] = { - { "1-a", 0x08000, 0x5df72a5d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "skyfox2.bin", 0x08000, 0xe15e0263, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "skyfox9.bin", 0x08000, 0x0b283bf5, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "1-c", 0x10000, 0x450e9381, 3 | BRF_GRA }, // 3 Sprites - { "skyfox4.bin", 0x10000, 0x358053bb, 3 | BRF_GRA }, // 4 - { "1-e", 0x10000, 0x50a38c60, 3 | BRF_GRA }, // 5 - { "skyfox6.bin", 0x10000, 0xcc37e15d, 3 | BRF_GRA }, // 6 - { "1-g", 0x10000, 0xc9bbfe5c, 3 | BRF_GRA }, // 7 - { "skyfox8.bin", 0x10000, 0x0e3edc49, 3 | BRF_GRA }, // 8 - - { "skyfox10.bin", 0x08000, 0x19f58f9c, 4 | BRF_GRA }, // 9 Starfield - - { "sfoxrprm.bin", 0x00100, 0x79913c7f, 5 | BRF_GRA }, // 10 Color Proms - { "sfoxgprm.bin", 0x00100, 0xfb73d434, 5 | BRF_GRA }, // 11 - { "sfoxbprm.bin", 0x00100, 0x60d2ab41, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(exerizrb) -STD_ROM_FN(exerizrb) - -struct BurnDriver BurnDrvExerizrb = { - "exerizerb", "skyfox", NULL, NULL, "1987", - "Exerizer (Japan) (bootleg)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, exerizrbRomInfo, exerizrbRomName, NULL, NULL, SkyfoxInputInfo, SkyfoxDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, - 224, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_skykid.cpp b/jan/src/burn/drv/pre90s/d_skykid.cpp deleted file mode 100644 index d796c3f85..000000000 --- a/jan/src/burn/drv/pre90s/d_skykid.cpp +++ /dev/null @@ -1,1080 +0,0 @@ -// FB Alpha Sky Kid driver module -// Based on MAME driver by Manuel Abadia and various others - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "m6800_intf.h" -#include "namco_snd.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvHD63701ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvHD63701RAM1; -static UINT8 *DrvHD63701RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *m6809_bank; -static UINT8 *interrupt_enable; -static UINT8 *flipscreen; -static UINT8 *priority; -static UINT8 *coin_lockout; -static UINT16 *scroll; -static UINT8 *ip_select; - -static INT32 watchdog; -static INT32 hd63701_in_reset = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[8]; - -static INT32 nCyclesDone[2]; - -static struct BurnInputInfo SkykidInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 2, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 0, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Skykid) - -static struct BurnDIPInfo SkykidDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xf2, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Round Skip" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x60, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x60, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x60, 0x60, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x60, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, // swapped - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Buy In" }, - {0x13, 0x01, 0x02, 0x00, "No" }, - {0x13, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x00, "20k every 80k" }, - {0x13, 0x01, 0x30, 0x10, "20k and 80k" }, - {0x13, 0x01, 0x30, 0x20, "30k every 90k" }, - {0x13, 0x01, 0x30, 0x30, "30k and 90k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0xc0, 0x80, "1" }, - {0x13, 0x01, 0xc0, 0x40, "2" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Skykid) - -static struct BurnDIPInfo SkykidsDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xf2, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Round Select" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x60, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x60, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x60, 0x60, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x60, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, // swapped - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Buy In" }, - {0x13, 0x01, 0x02, 0x00, "No" }, - {0x13, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x00, "30k every 80k" }, - {0x13, 0x01, 0x30, 0x10, "30k and 80k" }, - {0x13, 0x01, 0x30, 0x20, "40k every 90k" }, - {0x13, 0x01, 0x30, 0x30, "40k and 90k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0xc0, 0x80, "1" }, - {0x13, 0x01, 0xc0, 0x40, "2" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Skykids) - -static struct BurnDIPInfo DrgnbstrDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Round Skip" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x60, 0x00, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x60, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x60, 0x60, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x60, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x01, 0x01, "No" }, - {0x13, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Bonus Level" }, - {0x13, 0x01, 0x02, 0x02, "Full" }, - {0x13, 0x01, 0x02, 0x00, "Partial" }, - - {0 , 0xfe, 0 , 4, "Bonus Vitality" }, - {0x13, 0x01, 0x0c, 0x00, "64" }, - {0x13, 0x01, 0x0c, 0x08, "48/64" }, - {0x13, 0x01, 0x0c, 0x04, "32/64" }, - {0x13, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Starting Vitality" }, - {0x13, 0x01, 0x30, 0x00, "160" }, - {0x13, 0x01, 0x30, 0x30, "128" }, - {0x13, 0x01, 0x30, 0x10, "96" }, - {0x13, 0x01, 0x30, 0x20, "64" }, - - {0 , 0xfe, 0 , 2, "Level of Monster" }, - {0x13, 0x01, 0x40, 0x40, "Normal" }, - {0x13, 0x01, 0x40, 0x00, "Difficult" }, - - {0 , 0xfe, 0 , 2, "Spurt Time" }, - {0x13, 0x01, 0x80, 0x80, "Normal" }, - {0x13, 0x01, 0x80, 0x00, "Difficult" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x02, 0x02, "Upright" }, - {0x14, 0x01, 0x02, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Drgnbstr) - -static inline void sync_HD63701(INT32 run) -{ - INT32 nNext = nM6809CyclesTotal - nCyclesDone[1]; - - if (nNext > 0) - { - if (run) { - nCyclesDone[1] += HD63701Run(nNext); - } else { - nCyclesDone[1] += nNext; - } - } -} - -static void m6809Bankswitch(INT32 bank) -{ - bank &= 1; - - if (m6809_bank[0] != bank) { - m6809_bank[0] = bank; - - M6809MapMemory(DrvM6809ROM + 0x10000 + bank * 0x2000, 0x0000, 0x1fff, MAP_ROM); - } -} - -void skykid_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff00) == 0x6000) { - scroll[1] = address & 0x0ff; - return; - } - - if ((address & 0xfe00) == 0x6200) { - scroll[0] = address & 0x1ff; - return; - } - - if ((address & 0xfc00) == 0x6800) { - namcos1_custom30_write(address & 0x3ff, data); - return; - } - - if ((address & 0xf000) == 0x7000) { - INT32 b = (~address & 0x0800) / 0x0800; - - interrupt_enable[0] = b; - if (b == 0) M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } - - if ((address & 0xf000) == 0x8000) { - INT32 b = (~address & 0x0800) / 0x0800; - - if (b == 0) { - if (hd63701_in_reset == 0) { // sync the HD63701 and then reset it - sync_HD63701(1); - HD63701Reset(); - hd63701_in_reset = 1; - } - } - else - { - if (hd63701_in_reset) { // burn cycles and then re-enable the HD63701 - sync_HD63701(0); - hd63701_in_reset = 0; - } - } - - return; - } - - if ((address & 0xf000) == 0x9000) { - INT32 b = (~address & 0x0800) / 0x0800; - - m6809Bankswitch(b); - return; - } - - if ((address & 0xfffe) == 0xa000) { - *flipscreen = address & 1; - *priority = ((data & 0xf0) == 0x50) ? 1 : 0; - return; - } -} - -UINT8 skykid_main_read(UINT16 address) -{ - if ((address & 0xfc00) == 0x6800) { - return namcos1_custom30_read(address & 0x3ff); - } - - if ((address & 0xf800) == 0x7800) { - watchdog = 0; - return 0; - } - - return 0; -} - -void skykid_mcu_write(UINT16 address, UINT8 data) -{ - if ((address & 0xffe0) == 0x0000) { - m6803_internal_registers_w(address & 0x1f, data); - return; - } - - if ((address & 0xff80) == 0x0080) { - DrvHD63701RAM1[address & 0x7f] = data; - return; - } - - if ((address & 0xfc00) == 0x1000) { - namcos1_custom30_write(address & 0x3ff, data); - return; - } - - if ((address & 0xe000) == 0x2000) { - watchdog = 0; - return; - } - - if ((address & 0xc000) == 0x4000) { - INT32 b = (~address & 0x2000) / 0x2000; - - interrupt_enable[1] = b; - - if (b == 0) HD63701SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -UINT8 skykid_mcu_read(UINT16 address) -{ - if ((address & 0xffe0) == 0x0000) { - return m6803_internal_registers_r(address & 0x1f); - } - - if ((address & 0xff80) == 0x0080) { - return DrvHD63701RAM1[address & 0x7f]; - } - - if ((address & 0xfc00) == 0x1000) { - return namcos1_custom30_read(address & 0x3ff); - } - - return 0; -} - -void skykid_mcu_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: - { - switch (data & 0xe0) { - case 0x60: - *ip_select = data & 0x07; - return; - - case 0xc0: - *coin_lockout = ~data & 0x01; - // coin counters 0 -> data & 0x02, 1 -> data & 0x04 - return; - } - } - return; - - case HD63701_PORT2: - // led0 = data & 8, led1 = data & 0x10 - return; - } -} - -UINT8 skykid_mcu_read_port(UINT16 port) -{ - switch (port & 0x1ff) - { - case HD63701_PORT1: - return DrvInputs[*ip_select]; - - case HD63701_PORT2: - return 0xff; - } - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) { - INT32 r = DrvColPROM[i + 0x000] & 0x0f; - INT32 g = DrvColPROM[i + 0x100] & 0x0f; - INT32 b = DrvColPROM[i + 0x200] & 0x0f; - - DrvPalette[i] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0); - } - - for (INT32 i = 0; i < 0x400; i++) { - DrvPalette[i + 0x100] = DrvPalette[DrvColPROM[0x300 + i]]; - } -} - -static void DrvSpriteExpand() -{ - for (INT32 i = 0; i < 0x2000; i++) { - DrvGfxROM2[0x8000 + i] = DrvGfxROM2[0x4000 + i]; - DrvGfxROM2[0xa000 + i] = DrvGfxROM2[0x4000 + i] >> 4; - DrvGfxROM2[0x4000 + i] = DrvGfxROM2[0x6000 + i]; - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Planes[3] = { (0x8000 * 8) + 4, 0, 4 }; - INT32 XOffs0[8] = { 8*8, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 }; - INT32 XOffs1[8] = { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 }; - INT32 XOffs2[16]= { 0, 1, 2, 3, 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 }; - INT32 YOffs0[16]= { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 }; - INT32 YOffs1[8] = { 0*8, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Planes + 1, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Planes + 1, XOffs1, YOffs1, 0x080, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x10000); - - GfxDecode(0x0200, 3, 16, 16, Planes + 0, XOffs2, YOffs0, 0x200, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvDoReset(INT32 ClearRAM) -{ - if (ClearRAM) { - memset (AllRam, 0, RamEnd - AllRam); - } - - M6809Open(0); - M6809Reset(); - m6809_bank[0] = ~0; - m6809Bankswitch(0); - M6809Close(); - -// HD63701Open(0); - HD63701Reset(); -// HD63701Close(); - - NamcoSoundReset(); - - watchdog = 0; - hd63701_in_reset = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x014000; - DrvHD63701ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x030000; - - DrvColPROM = Next; Next += 0x000700; - - DrvPalette = (UINT32*)Next; Next += 0x0500 * sizeof(UINT32); - - AllRam = Next; - - DrvHD63701RAM1 = Next; Next += 0x000080; - DrvHD63701RAM = Next; Next += 0x000800; - - DrvVidRAM = Next; Next += 0x001000; - DrvTxtRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001800; - - m6809_bank = Next; Next += 0x000001; - interrupt_enable = Next; Next += 0x000002; - flipscreen = Next; Next += 0x000001; - priority = Next; Next += 0x000001; - coin_lockout = Next; Next += 0x000001; - ip_select = Next; Next += 0x000001; - - scroll = (UINT16*)Next; Next += 0x0002 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x0c000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x10000, 2, 1)) return 1; - - if (BurnLoadRom(DrvHD63701ROM + 0x08000, 3, 1)) return 1; - if (BurnLoadRom(DrvHD63701ROM + 0x0f000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00500, 13, 1)) return 1; - - DrvSpriteExpand(); - DrvGfxDecode(); - DrvPaletteInit(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809ROM + 0x10000, 0x0000, 0x1fff, MAP_ROM); - M6809MapMemory(DrvVidRAM, 0x2000, 0x2fff, MAP_RAM); - M6809MapMemory(DrvTxtRAM, 0x4000, 0x47ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x4800, 0x5fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(skykid_main_write); - M6809SetReadHandler(skykid_main_read); - M6809Close(); - - HD63701Init(1); -// HD63701Open(0); - HD63701MapMemory(DrvHD63701ROM + 0x8000, 0x8000, 0xbfff, MAP_ROM); - HD63701MapMemory(DrvHD63701RAM, 0xc000, 0xc7ff, MAP_RAM); - HD63701MapMemory(DrvHD63701ROM + 0xf000, 0xf000, 0xffff, MAP_ROM); - HD63701SetReadHandler(skykid_mcu_read); - HD63701SetWriteHandler(skykid_mcu_write); - HD63701SetReadPortHandler(skykid_mcu_read_port); - HD63701SetWritePortHandler(skykid_mcu_write_port); -// HD63701Close(); - - NamcoSoundInit(49152000/2048, 8, 0); - NacmoSoundSetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); // MAME uses 1.00, which is way too loud - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - NamcoSoundExit(); - - M6809Exit(); - HD63701Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_fg_layer() -{ - INT32 bank = *flipscreen ? 0x100 : 0; - - for (INT32 y = 0; y < 28; y++) - { - for (INT32 x = 0; x < 36; x++) - { - INT32 col = x - 2; - INT32 row = y + 2; - - INT32 offs = 0; - if (col & 0x20) { - offs = row + ((col & 0x1f) << 5); - } else { - offs = col + (row << 5); - } - - INT32 code = DrvTxtRAM[offs + 0x000] + bank; - INT32 color = DrvTxtRAM[offs + 0x400] & 0x3f; - - if (*flipscreen) { - Render8x8Tile_Mask_Clip(pTransDraw, code, 280 - (x * 8), 216 - (y * 8), color, 2, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, x * 8, y * 8, color, 2, 0, 0, DrvGfxROM0); - } - } - } -} - -static void draw_bg_layer() -{ - INT32 scrollx, scrolly; - - if (*flipscreen) { - scrollx = 189 - (scroll[0] ^ 1); - scrolly = 7 - (scroll[1] ^ 0); - } else { - scrollx = scroll[0] + 35; - scrolly = scroll[1] + 25; - } - scrollx &= 0x1ff; - scrolly &= 0x0ff; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvVidRAM[offs + 0x800]; - INT32 code = DrvVidRAM[offs + 0x000] + ((attr & 0x01) << 8); - INT32 color = ((attr & 0x7e) >> 1) | ((attr & 0x01) << 6); - - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, 280 - sx, 216 - sy, color + (0x100 >> 2), 2, 0, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color + (0x100 >> 2), 2, 0, DrvGfxROM1); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x80; offs += 2) - { - INT32 attrib = DrvSprRAM[0x1780 + offs + 0]; - INT32 sprite = DrvSprRAM[0x0780 + offs + 0] + ((attrib & 0x80) << 1); - INT32 color =(DrvSprRAM[0x0780 + offs + 1] & 0x3f) * 8 + 0x300; - INT32 sx =(DrvSprRAM[0x0f80 + offs + 1]) + ((DrvSprRAM[0x1780 + offs + 1] & 1) << 8) - 71; - INT32 sy = 256 - DrvSprRAM[0x0f80 + offs + 0] - 7; - INT32 flipx = (attrib & 0x01); - INT32 flipy = (attrib & 0x02) >> 1; - INT32 sizex = (attrib & 0x04) >> 2; - INT32 sizey = (attrib & 0x08) >> 3; - - sprite &= ~sizex; - sprite &= ~(sizey << 1); - - if (*flipscreen) - { - flipx ^= 1; - flipy ^= 1; - } - - sy -= 16 * sizey; - sy = (sy & 0xff) - 32; - - for (INT32 y = 0; y <= sizey; y++) - { - for (INT32 x = 0; x <= sizex; x++) - { - INT32 code = sprite + (y ^ (sizey * flipy)) * 2 + (x ^ (sizex * flipx)); - - RenderTileTranstab(pTransDraw, DrvGfxROM2, code, color, 0xff, sx + x * 16, sy + y * 16, flipx, flipy, 16, 16, DrvColPROM + 0x200); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_bg_layer(); - - if (*priority == 0) draw_sprites(); - - draw_fg_layer(); - - if (*priority == 1) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - watchdog++; - if (watchdog > 180) { - DrvDoReset(0); - } - - { - memset (DrvInputs, 0xff, 8); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[3] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[6] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[0] = ((DrvDips[1] & 0xf8) >> 3); - DrvInputs[1] = ((DrvDips[1] & 0x07) << 2) | ((DrvDips[0] & 0xc0) >> 6); - DrvInputs[2] = ((DrvDips[0] & 0x3e) >> 1); - DrvInputs[3] = ((DrvInputs[3] & 0x0d) | (DrvDips[2] & 0x02)) | ((DrvDips[0] & 0x01) << 4); - - if (*coin_lockout) DrvInputs[4] |= 0x03; - } - - M6809NewFrame(); - HD63701NewFrame(); - - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 1536000 / 60, 1536000 / 60 }; - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nNext; - - M6809Open(0); - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += M6809Run(nNext - nCyclesDone[0]); - if (i == (nInterleave - 1) && interrupt_enable[0]) { - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - M6809Close(); - - // HD63701Open(0); - if (hd63701_in_reset == 0) { - sync_HD63701(1); - - if (i == (nInterleave - 1) && interrupt_enable[1]) { - HD63701SetIRQLine(0, CPU_IRQSTATUS_ACK); - } - } else { - sync_HD63701(0); - } - // HD63701Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - NamcoSoundUpdate(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - HD63701Scan(nAction); - - NamcoSoundScan(nAction, pnMin); - - SCAN_VAR(hd63701_in_reset); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - m6809Bankswitch(m6809_bank[0]); - M6809Close(); - } - - return 0; -} - - -// Sky Kid (new version) - -static struct BurnRomInfo skykidRomDesc[] = { - { "sk2_2.6c", 0x4000, 0xea8a5822, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "sk1-1c.6b", 0x4000, 0x7abe6c6c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sk1_3.6d", 0x4000, 0x314b8765, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "sk2_4.3c", 0x2000, 0xa460d0e0, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code - { "cus63-63a1.mcu", 0x1000, 0x6ef08fb3, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "sk1_6.6l", 0x2000, 0x58b731b9, 3 | BRF_GRA }, // 5 Characters - - { "sk1_5.7e", 0x2000, 0xc33a498e, 4 | BRF_GRA }, // 6 Background Tiles - - { "sk1_8.10n", 0x4000, 0x44bb7375, 5 | BRF_GRA }, // 7 Sprites - { "sk1_7.10m", 0x4000, 0x3454671d, 5 | BRF_GRA }, // 8 - - { "sk1-1.2n", 0x0100, 0x0218e726, 6 | BRF_GRA }, // 9 Color PROMs - { "sk1-2.2p", 0x0100, 0xfc0d5b85, 6 | BRF_GRA }, // 10 - { "sk1-3.2r", 0x0100, 0xd06b620b, 6 | BRF_GRA }, // 11 - { "sk1-4.5n", 0x0200, 0xc697ac72, 6 | BRF_GRA }, // 12 - { "sk1-5.6n", 0x0200, 0x161514a4, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(skykid) -STD_ROM_FN(skykid) - -struct BurnDriver BurnDrvSkykid = { - "skykid", NULL, NULL, NULL, "1985", - "Sky Kid (new version)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, skykidRomInfo, skykidRomName, NULL, NULL, SkykidInputInfo, SkykidDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x500, - 288, 224, 4, 3 -}; - - -// Sky Kid (old version) - -static struct BurnRomInfo skykidoRomDesc[] = { - { "sk2_2.6c", 0x4000, 0xea8a5822, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "sk1_1.6b", 0x4000, 0x070a49d4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sk1_3.6d", 0x4000, 0x314b8765, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "sk2_4.3c", 0x2000, 0xa460d0e0, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code - { "cus63-63a1.mcu", 0x1000, 0x6ef08fb3, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "sk1_6.6l", 0x2000, 0x58b731b9, 3 | BRF_GRA }, // 5 Characters - - { "sk1_5.7e", 0x2000, 0xc33a498e, 4 | BRF_GRA }, // 6 Background Tiles - - { "sk1_8.10n", 0x4000, 0x44bb7375, 5 | BRF_GRA }, // 7 Sprites - { "sk1_7.10m", 0x4000, 0x3454671d, 5 | BRF_GRA }, // 8 - - { "sk1-1.2n", 0x0100, 0x0218e726, 6 | BRF_GRA }, // 9 Color PROMs - { "sk1-2.2p", 0x0100, 0xfc0d5b85, 6 | BRF_GRA }, // 10 - { "sk1-3.2r", 0x0100, 0xd06b620b, 6 | BRF_GRA }, // 11 - { "sk1-4.5n", 0x0200, 0xc697ac72, 6 | BRF_GRA }, // 12 - { "sk1-5.6n", 0x0200, 0x161514a4, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(skykido) -STD_ROM_FN(skykido) - -struct BurnDriver BurnDrvSkykido = { - "skykido", "skykid", NULL, NULL, "1985", - "Sky Kid (old version)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, skykidoRomInfo, skykidoRomName, NULL, NULL, SkykidInputInfo, SkykidDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x500, - 288, 224, 4, 3 -}; - - -// Sky Kid (CUS60 version) - -static struct BurnRomInfo skykiddRomDesc[] = { - { "sk1_2.6c", 0x4000, 0x8370671a, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "sk1_1.6b", 0x4000, 0x070a49d4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sk1_3.6d", 0x4000, 0x314b8765, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "sk1_4.3c", 0x2000, 0x887137cc, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "sk1_6.6l", 0x2000, 0x58b731b9, 3 | BRF_GRA }, // 5 Characters - - { "sk1_5.7e", 0x2000, 0xc33a498e, 4 | BRF_GRA }, // 6 Background Tiles - - { "sk1_8.10n", 0x4000, 0x44bb7375, 5 | BRF_GRA }, // 7 Sprites - { "sk1_7.10m", 0x4000, 0x3454671d, 5 | BRF_GRA }, // 8 - - { "sk1-1.2n", 0x0100, 0x0218e726, 6 | BRF_GRA }, // 9 Color PROMs - { "sk1-2.2p", 0x0100, 0xfc0d5b85, 6 | BRF_GRA }, // 10 - { "sk1-3.2r", 0x0100, 0xd06b620b, 6 | BRF_GRA }, // 11 - { "sk1-4.5n", 0x0200, 0xc697ac72, 6 | BRF_GRA }, // 12 - { "sk1-5.6n", 0x0200, 0x161514a4, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(skykidd) -STD_ROM_FN(skykidd) - -struct BurnDriver BurnDrvSkykidd = { - "skykidd", "skykid", NULL, NULL, "1985", - "Sky Kid (CUS60 version)\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, skykiddRomInfo, skykiddRomName, NULL, NULL, SkykidInputInfo, SkykidDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x500, - 288, 224, 4, 3 -}; - - -// Sky Kid (Sipem) - -static struct BurnRomInfo skykidsRomDesc[] = { - { "sk2a.6c", 0x4000, 0x68492672, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "sk1a.6b", 0x4000, 0xe16abe25, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sk1_3.6d", 0x4000, 0x314b8765, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "sk2_4.3c", 0x2000, 0xa460d0e0, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code - { "cus63-63a1.mcu", 0x1000, 0x6ef08fb3, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "sk1_6.6l", 0x2000, 0x58b731b9, 3 | BRF_GRA }, // 5 Characters - - { "sk1_5.7e", 0x2000, 0xc33a498e, 4 | BRF_GRA }, // 6 Background Tiles - - { "sk1_8.10n", 0x4000, 0x44bb7375, 5 | BRF_GRA }, // 7 Sprites - { "sk1_7.10m", 0x4000, 0x3454671d, 5 | BRF_GRA }, // 8 - - { "sk1-1.2n", 0x0100, 0x0218e726, 6 | BRF_GRA }, // 9 Color PROMs - { "sk1-2.2p", 0x0100, 0xfc0d5b85, 6 | BRF_GRA }, // 10 - { "sk1-3.2r", 0x0100, 0xd06b620b, 6 | BRF_GRA }, // 11 - { "sk1-4.5n", 0x0200, 0xc697ac72, 6 | BRF_GRA }, // 12 - { "sk1-5.6n", 0x0200, 0x161514a4, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(skykids) -STD_ROM_FN(skykids) - -struct BurnDriver BurnDrvSkykids = { - "skykids", "skykid", NULL, NULL, "1985", - "Sky Kid (Sipem)\0", NULL, "Namco [Sipem license]", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, skykidsRomInfo, skykidsRomName, NULL, NULL, SkykidInputInfo, SkykidsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x500, - 288, 224, 4, 3 -}; - - -// Dragon Buster - -static struct BurnRomInfo drgnbstrRomDesc[] = { - { "db1_2b.6c", 0x4000, 0x0f11cd17, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "db1_1.6b", 0x4000, 0x1c7c1821, 1 | BRF_PRG | BRF_ESS }, // 1 - { "db1_3.6d", 0x4000, 0x6da169ae, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "db1_4.3c", 0x2000, 0x8a0b1fc1, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code - { "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "db1_6.6l", 0x2000, 0xc080b66c, 3 | BRF_GRA }, // 5 Characters - - { "db1_5.7e", 0x2000, 0x28129aed, 4 | BRF_GRA }, // 6 Background Tiles - - { "db1_8.10n", 0x4000, 0x11942c61, 5 | BRF_GRA }, // 7 Sprites - { "db1_7.10m", 0x4000, 0xcc130fe2, 5 | BRF_GRA }, // 8 - - { "db1-1.2n", 0x0100, 0x3f8cce97, 6 | BRF_GRA }, // 9 Color PROMs - { "db1-2.2p", 0x0100, 0xafe32436, 6 | BRF_GRA }, // 10 - { "db1-3.2r", 0x0100, 0xc95ff576, 6 | BRF_GRA }, // 11 - { "db1-4.5n", 0x0200, 0xb2180c21, 6 | BRF_GRA }, // 12 - { "db1-5.6n", 0x0200, 0x5e2b3f74, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(drgnbstr) -STD_ROM_FN(drgnbstr) - -struct BurnDriver BurnDrvDrgnbstr = { - "drgnbstr", NULL, NULL, NULL, "1984", - "Dragon Buster\0", "Missing sounds", "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, drgnbstrRomInfo, drgnbstrRomName, NULL, NULL, SkykidInputInfo, DrgnbstrDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x500, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_snk.cpp b/jan/src/burn/drv/pre90s/d_snk.cpp deleted file mode 100644 index 71e60866f..000000000 --- a/jan/src/burn/drv/pre90s/d_snk.cpp +++ /dev/null @@ -1,9015 +0,0 @@ -// FB Alpha SNK triple Z80 driver module -// Based on MAME driver by Marco Cassili, Ernesto Corvi, Tim Lindquist, Carlos A. Lozano, Bryan McPhail, Jarek Parchanski, Nicola Salmoria, Tomasz Slanina, Phil Stroffolino, Acho A. Tang, Victor Trucco - -// -// Todo: -// x tdfever, fsoccer - hook up inputs & trackball(?) -// x tnk3's second player can't use the new rotate-button feature, probably needs flipscreen & coctail mode to work. - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym3526.h" -#include "burn_ym3812.h" -#include "burn_y8950.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvSndROM0; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvBgVRAM; -static UINT8 *DrvFgVRAM; - -static UINT8 *DrvShareRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvTransTab; - -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 sound_status; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT16 sp16_scrolly; -static UINT16 sp16_scrollx; -static UINT16 sp32_scrolly; -static UINT16 sp32_scrollx; -static UINT16 bg_scrollx; -static UINT16 bg_scrolly; -static UINT16 fg_scrollx; -static UINT16 fg_scrolly; -static UINT16 txt_palette_offset; -static UINT16 txt_tile_offset; -static UINT16 bg_tile_offset; -static UINT16 bg_palette_offset; -static UINT16 fg_palette_offset; -static UINT8 sprite_split_point; -static UINT16 tc16_posy = 0; -static UINT16 tc16_posx = 0; -static UINT16 tc32_posy = 0; -static UINT16 tc32_posx = 0; - -static INT32 DrvGfxMask[5] = { ~0, ~0, ~0, ~0, ~0 }; -static INT32 nSampleLen = 0; -static INT32 game_select = 0; -static INT32 video_y_scroll_mask = 0x1ff; -static INT32 video_sprite_number = 50; -static INT32 hal21mode = 0; -static INT32 bonus_dip_config = 0; // xxyy yy = dip0 bonus, xx = dip1 bonus -static INT32 ikarijoy = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvJoy6[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[6]; -static UINT8 DrvReset; - -static UINT8 DrvFakeInput[6] = {0, 0, 0, 0, 0, 0}; -static INT32 nRotate[2] = {0, 0}; -static INT32 nRotateTarget[2] = {0, 0}; -static INT32 nRotateTry[2] = {0, 0}; -static UINT32 nRotateTime[2] = {0, 0}; -static UINT8 game_rotates = 0; -static UINT8 gwar_rot_last[2] = {0, 0}; -static UINT8 gwar_rot_cnt[2] = {0, 0}; - - -static struct BurnInputInfo PsychosInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 6, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 7, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 2, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Psychos) - -static struct BurnInputInfo GwarInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2"}, - {"P1 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 0, "p1 rotate left" }, - {"P1 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 1, "p1 rotate right" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 2"}, - {"P2 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 2, "p2 rotate left" }, - {"P2 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 3, "p2 rotate right" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 2, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Gwar) - -static struct BurnInputInfo GwarbInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 2, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Gwarb) - -static struct BurnInputInfo MarvinsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Marvins) - -static struct BurnInputInfo Vangrd2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 2"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Vangrd2) - -static struct BurnInputInfo MadcrashInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Madcrash) - -static struct BurnInputInfo JcrossInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 2"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip c", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Jcross) - -static struct BurnInputInfo SgladiatInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 2"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Sgladiat) - -static struct BurnInputInfo Hal21InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Hal21) - -static struct BurnInputInfo AthenaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Athena) - -static struct BurnInputInfo AsoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 3"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Aso) - -static struct BurnInputInfo Tnk3InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2"}, - {"P1 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 0, "p1 rotate left" }, - {"P1 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 1, "p1 rotate right" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 2, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 3, "p2 fire 2"}, - {"P2 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 2, "p2 rotate left" }, - {"P2 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 3, "p2 rotate right" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Tnk3) - -static struct BurnInputInfo IkariInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2"}, - {"P1 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 0, "p1 rotate left" }, - {"P1 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 1, "p1 rotate right" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 2"}, - {"P2 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 2, "p2 rotate left" }, - {"P2 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 3, "p2 rotate right" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Ikari) - -static struct BurnInputInfo IkariaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2"}, - {"P1 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 0, "p1 rotate left" }, - {"P1 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 1, "p1 rotate right" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 2"}, - {"P2 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 2, "p2 rotate left" }, - {"P2 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 3, "p2 rotate right" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Ikaria) - -static struct BurnInputInfo VictroadInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2"}, - {"P1 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 0, "p1 rotate left" }, - {"P1 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 1, "p1 rotate right" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 2"}, - {"P2 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 2, "p2 rotate left" }, - {"P2 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 3, "p2 rotate right" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 2, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Victroad) - -static struct BurnInputInfo FitegolfInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 2, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Fitegolf) - -static struct BurnInputInfo AlphamisInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Alphamis) - -static struct BurnInputInfo ChopperInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 6, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 7, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 2, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Chopper) - -static struct BurnInputInfo ChopperaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 2, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Choppera) - -static struct BurnInputInfo BermudatInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 2"}, - {"P1 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 0, "p1 rotate left" }, - {"P1 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 1, "p1 rotate right" }, - {"P1 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 2"}, - {"P2 Rotate Left" , BIT_DIGITAL , DrvFakeInput + 2, "p2 rotate left" }, - {"P2 Rotate Right" , BIT_DIGITAL , DrvFakeInput + 3, "p2 rotate right" }, - {"P2 Button 3 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 2, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Bermudat) - -#if 0 // someday we might hook these up.... -static struct BurnInputInfo TdfeverInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 7, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 6, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 5, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 4, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 7, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 6, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 5, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 4, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p2 fire 2"}, - - {"P3 Start", BIT_DIGITAL, DrvJoy2 + 6, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy5 + 7, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy5 + 6, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy5 + 5, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy5 + 4, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy5 + 0, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy5 + 1, "p3 fire 2"}, - - {"P4 Start", BIT_DIGITAL, DrvJoy2 + 7, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy6 + 7, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy6 + 6, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy6 + 5, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy6 + 4, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy6 + 0, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy6 + 1, "p4 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Tdfever) -#endif - -static struct BurnInputInfo FsoccerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 7, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 6, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 5, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 4, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 7, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 6, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 5, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 4, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p2 fire 2"}, - - {"P3 Start", BIT_DIGITAL, DrvJoy2 + 6, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy5 + 7, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy5 + 6, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy5 + 5, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy5 + 4, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy5 + 0, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy5 + 1, "p3 fire 2"}, - - {"P4 Start", BIT_DIGITAL, DrvJoy2 + 7, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy6 + 7, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy6 + 6, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy6 + 5, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy6 + 4, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy6 + 0, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy6 + 1, "p4 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Fsoccer) - -#if 0 -static struct BurnDIPInfo TdfeverDIPList[]= -{ - {0x20, 0xff, 0xff, 0x32, NULL }, - {0x21, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x20, 0x01, 0x01, 0x01, "No" }, - {0x20, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x20, 0x01, 0x02, 0x02, "2 Player Upright" }, - {0x20, 0x01, 0x02, 0x00, "4 Player Cocktail" }, - - {0 , 0xfe, 0 , 4, "1st Down Bonus Time" }, - {0x20, 0x01, 0x0c, 0x00, "Every 1st Down" }, - {0x20, 0x01, 0x0c, 0x04, "Every 4 1st Downs" }, - {0x20, 0x01, 0x0c, 0x08, "Every 6 1st Downs" }, - {0x20, 0x01, 0x0c, 0x0c, "Every 8 1st Downs" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x20, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x20, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x20, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x20, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x20, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x20, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x20, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x20, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x21, 0x01, 0x03, 0x03, "Easy" }, - {0x21, 0x01, 0x03, 0x02, "Normal" }, - {0x21, 0x01, 0x03, 0x01, "Hard" }, - {0x21, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x21, 0x01, 0x0c, 0x0c, "Demo Sound Off" }, - {0x21, 0x01, 0x0c, 0x08, "Demo Sound On" }, - {0x21, 0x01, 0x0c, 0x00, "Freeze" }, - {0x21, 0x01, 0x0c, 0x04, "Never Finish (Cheat)" }, - - {0 , 0xfe, 0 , 8, "Play Time (Type A)" }, - {0x21, 0x01, 0x70, 0x70, "1:00" }, - {0x21, 0x01, 0x70, 0x60, "1:10" }, - {0x21, 0x01, 0x70, 0x50, "1:20" }, - {0x21, 0x01, 0x70, 0x40, "1:30" }, - {0x21, 0x01, 0x70, 0x30, "1:40" }, - {0x21, 0x01, 0x70, 0x20, "1:50" }, - {0x21, 0x01, 0x70, 0x10, "2:00" }, - {0x21, 0x01, 0x70, 0x00, "2:10" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x21, 0x01, 0x80, 0x80, "Off" }, - {0x21, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Tdfever) -#endif - -static struct BurnDIPInfo FsoccerDIPList[]= -{ - {0x20, 0xff, 0xff, 0x37, NULL }, - {0x21, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 4, "Cabinet" }, - {0x20, 0x01, 0x03, 0x03, "Upright (With VS)" }, - {0x20, 0x01, 0x03, 0x02, "Upright (Without VS)" }, - {0x20, 0x01, 0x03, 0x00, "Cocktail (2 Players)" }, - {0x20, 0x01, 0x03, 0x01, "Cocktail (4 Players)" }, - - {0 , 0xfe, 0 , 3, "Version" }, - {0x20, 0x01, 0x0c, 0x04, "Europe" }, - {0x20, 0x01, 0x0c, 0x00, "USA" }, - {0x20, 0x01, 0x0c, 0x08, "Japan" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x20, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x20, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x20, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x20, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x20, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x20, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x20, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x20, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x21, 0x01, 0x01, 0x00, "No" }, - {0x21, 0x01, 0x01, 0x01, "Yes" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x21, 0x01, 0x02, 0x02, "Off" }, - {0x21, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x21, 0x01, 0x0c, 0x08, "Demo Sound Off" }, - {0x21, 0x01, 0x0c, 0x0c, "Demo Sound On" }, - {0x21, 0x01, 0x0c, 0x00, "Freeze" }, - {0x21, 0x01, 0x0c, 0x04, "Win Match Against CPU (Cheat)" }, - - {0 , 0xfe, 0 , 8, "Play Time (Type A)" }, - {0x21, 0x01, 0x70, 0x10, "1:00" }, - {0x21, 0x01, 0x70, 0x60, "1:10" }, - {0x21, 0x01, 0x70, 0x50, "1:20" }, - {0x21, 0x01, 0x70, 0x40, "1:30" }, - {0x21, 0x01, 0x70, 0x30, "1:40" }, - {0x21, 0x01, 0x70, 0x20, "1:50" }, - {0x21, 0x01, 0x70, 0x70, "2:00" }, - {0x21, 0x01, 0x70, 0x00, "2:10" }, -}; - -STDDIPINFO(Fsoccer) - -static struct BurnDIPInfo PsychosDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x34, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x08, 0x08, "3" }, - {0x12, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Service Mode" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x40, 0x40, "No" }, - {0x13, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x14, 0x01, 0x34, 0x30, "50k 100k 100k+" }, - {0x14, 0x01, 0x34, 0x20, "60k 120k 120k+" }, - {0x14, 0x01, 0x34, 0x10, "100k 200k 200k+" }, - {0x14, 0x01, 0x34, 0x00, "50k" }, - {0x14, 0x01, 0x34, 0x01, "60k" }, - {0x14, 0x01, 0x34, 0x00, "100k" }, - {0x14, 0x01, 0x34, 0x00, "None" }, -}; - -STDDIPINFO(Psychos) - -static struct BurnDIPInfo GwarDIPList[]= -{ - {0x19, 0xff, 0xff, 0x3b, NULL }, - {0x1a, 0xff, 0xff, 0x0a, NULL }, - {0x1b, 0xff, 0xff, 0x30, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x19, 0x01, 0x01, 0x00, "No" }, - {0x19, 0x01, 0x01, 0x01, "Yes" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x19, 0x01, 0x02, 0x02, "Off" }, - {0x19, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x19, 0x01, 0x08, 0x08, "3" }, - {0x19, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x19, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x19, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x19, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x19, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x19, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x19, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1a, 0x01, 0x03, 0x03, "Easy" }, - {0x1a, 0x01, 0x03, 0x02, "Normal" }, - {0x1a, 0x01, 0x03, 0x01, "Hard" }, - {0x1a, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x1a, 0x01, 0x0c, 0x0c, "Demo Sounds Off" }, - {0x1a, 0x01, 0x0c, 0x08, "Demo Sounds On" }, - {0x1a, 0x01, 0x0c, 0x00, "Freeze" }, - {0x1a, 0x01, 0x0c, 0x04, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x1b, 0x01, 0x34, 0x30, "30k 60k 60k+" }, - {0x1b, 0x01, 0x34, 0x20, "40k 80k 80k+" }, - {0x1b, 0x01, 0x34, 0x10, "50k 100k 100k+" }, - {0x1b, 0x01, 0x34, 0x34, "30k 60k" }, - {0x1b, 0x01, 0x34, 0x24, "40k 80k" }, - {0x1b, 0x01, 0x34, 0x14, "50k 100k" }, - {0x1b, 0x01, 0x34, 0x00, "None" }, -}; - -STDDIPINFO(Gwar) - -static struct BurnDIPInfo GwarbDIPList[]= -{ - {0x13, 0xff, 0xff, 0x3b, NULL }, - {0x14, 0xff, 0xff, 0x0a, NULL }, - {0x15, 0xff, 0xff, 0x30, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x01, 0x00, "No" }, - {0x13, 0x01, 0x01, 0x01, "Yes" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x08, 0x08, "3" }, - {0x13, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Easy" }, - {0x14, 0x01, 0x03, 0x02, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x14, 0x01, 0x0c, 0x0c, "Demo Sounds Off" }, - {0x14, 0x01, 0x0c, 0x08, "Demo Sounds On" }, - {0x14, 0x01, 0x0c, 0x00, "Freeze" }, - {0x14, 0x01, 0x0c, 0x04, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x15, 0x01, 0x34, 0x30, "30k 60k 60k+" }, - {0x15, 0x01, 0x34, 0x20, "40k 80k 80k+" }, - {0x15, 0x01, 0x34, 0x10, "50k 100k 100k+" }, - {0x15, 0x01, 0x34, 0x34, "30k 60k" }, - {0x15, 0x01, 0x34, 0x24, "40k 80k" }, - {0x15, 0x01, 0x34, 0x14, "50k 100k" }, - {0x15, 0x01, 0x34, 0x00, "None" }, -}; - -STDDIPINFO(Gwarb) - -static struct BurnDIPInfo MarvinsDIPList[]= -{ - {0x10, 0xff, 0xff, 0xc6, NULL }, - {0x11, 0xff, 0xff, 0xa8, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x00, "1" }, - {0x10, 0x01, 0x03, 0x01, "2" }, - {0x10, 0x01, 0x03, 0x02, "3" }, - {0x10, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 2, "Infinite Lives (Cheat)" }, - {0x10, 0x01, 0x04, 0x04, "Off" }, - {0x10, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x10, 0x01, 0x38, 0x38, "5 Coins 1 Credits" }, - {0x10, 0x01, 0x38, 0x30, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x38, 0x28, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x38, 0x20, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x10, 0x01, 0x40, 0x40, "Off" }, - {0x10, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "1st Bonus Life" }, - {0x11, 0x01, 0x07, 0x00, "10000" }, - {0x11, 0x01, 0x07, 0x01, "20000" }, - {0x11, 0x01, 0x07, 0x02, "30000" }, - {0x11, 0x01, 0x07, 0x03, "40000" }, - {0x11, 0x01, 0x07, 0x04, "50000" }, - {0x11, 0x01, 0x07, 0x05, "60000" }, - {0x11, 0x01, 0x07, 0x06, "70000" }, - {0x11, 0x01, 0x07, 0x07, "80000" }, - - {0 , 0xfe, 0 , 4, "2nd Bonus Life" }, - {0x11, 0x01, 0x18, 0x08, "1st bonus*2" }, - {0x11, 0x01, 0x18, 0x10, "1st bonus*3" }, - {0x11, 0x01, 0x18, 0x18, "1st bonus*4" }, - {0x11, 0x01, 0x18, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x00, "Upright" }, - {0x11, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Marvins) - -static struct BurnDIPInfo Vangrd2DIPList[]= -{ - {0x10, 0xff, 0xff, 0xbf, NULL }, - {0x11, 0xff, 0xff, 0xee, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x10, 0x01, 0x07, 0x00, "6 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x01, "5 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x07, 0x04, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x10, 0x01, 0x38, 0x38, "30000" }, - {0x10, 0x01, 0x38, 0x30, "40000" }, - {0x10, 0x01, 0x38, 0x28, "50000" }, - {0x10, 0x01, 0x38, 0x20, "60000" }, - {0x10, 0x01, 0x38, 0x18, "70000" }, - {0x10, 0x01, 0x38, 0x10, "80000" }, - {0x10, 0x01, 0x38, 0x08, "90000" }, - {0x10, 0x01, 0x38, 0x00, "100000" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0xc0, 0x00, "1" }, - {0x10, 0x01, 0xc0, 0x40, "2" }, - {0x10, 0x01, 0xc0, 0x80, "3" }, - {0x10, 0x01, 0xc0, 0xc0, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x04, "Upright" }, - {0x11, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x11, 0x01, 0x08, 0x08, "English" }, - {0x11, 0x01, 0x08, 0x00, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Bonus Life Occurrence" }, - {0x11, 0x01, 0x10, 0x00, "Every bonus" }, - {0x11, 0x01, 0x10, 0x10, "Bonus only" }, - - {0 , 0xfe, 0 , 2, "Infinite Lives (Cheat)" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Vangrd2) - -static struct BurnDIPInfo MadcrashDIPList[]= -{ - {0x12, 0xff, 0xff, 0xfd, NULL }, - {0x13, 0xff, 0xff, 0x74, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x02, 0x00, "Upright" }, - {0x12, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x04, 0x04, "3" }, - {0x12, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 7, "Coinage" }, - {0x12, 0x01, 0x38, 0x10, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0xc0, 0xc0, "20000 60000" }, - {0x12, 0x01, 0xc0, 0x80, "40000 90000" }, - {0x12, 0x01, 0xc0, 0x40, "50000 120000" }, - {0x12, 0x01, 0xc0, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Bonus Life Occurrence" }, - {0x13, 0x01, 0x01, 0x01, "1st, 2nd, then every 2nd" }, - {0x13, 0x01, 0x01, 0x00, "1st and 2nd only" }, - - {0 , 0xfe, 0 , 4, "Scroll Speed" }, - {0x13, 0x01, 0x06, 0x06, "Slow" }, - {0x13, 0x01, 0x06, 0x04, "Normal" }, - {0x13, 0x01, 0x06, 0x02, "Fast" }, - {0x13, 0x01, 0x06, 0x00, "Faster" }, - - {0 , 0xfe, 0 , 4, "Game mode" }, - {0x13, 0x01, 0x18, 0x18, "Demo Sounds Off" }, - {0x13, 0x01, 0x18, 0x10, "Demo Sounds On" }, - {0x13, 0x01, 0x18, 0x00, "Freeze" }, - {0x13, 0x01, 0x18, 0x08, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x40, 0x40, "Easy" }, - {0x13, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Madcrash) - -static struct BurnDIPInfo JcrossDIPList[]= -{ - {0x10, 0xff, 0xff, 0x3d, NULL }, - {0x11, 0xff, 0xff, 0xb4, NULL }, - {0x12, 0xff, 0xff, 0xc1, NULL }, - - {0 , 0xfe, 0 , 2, "Upright Controls" }, - {0x10, 0x01, 0x01, 0x01, "Single" }, - {0x10, 0x01, 0x01, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x02, 0x00, "Upright" }, - {0x10, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x10, 0x01, 0x04, 0x04, "3" }, - {0x10, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 6, "Coinage" }, - {0x10, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x38, 0x20, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x06, 0x06, "Easy" }, - {0x11, 0x01, 0x06, 0x04, "Normal" }, - {0x11, 0x01, 0x06, 0x02, "Hard" }, - {0x11, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game mode" }, - {0x11, 0x01, 0x18, 0x18, "Demo Sounds Off" }, - {0x11, 0x01, 0x18, 0x10, "Demo Sounds On" }, - {0x11, 0x01, 0x18, 0x00, "Freeze" }, - {0x11, 0x01, 0x18, 0x08, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "No BG Collision (Cheat)" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x12, 0x01, 0xc1, 0xc1, "20k 60k 40k+" }, - {0x12, 0x01, 0xc1, 0x81, "40k 120k 80k+" }, - {0x12, 0x01, 0xc1, 0x41, "60k 160k 100k+" }, - {0x12, 0x01, 0xc1, 0xc0, "20k" }, - {0x12, 0x01, 0xc1, 0x80, "40k" }, - {0x12, 0x01, 0xc1, 0x40, "60k" }, - {0x12, 0x01, 0xc1, 0x00, "None" }, -}; - -STDDIPINFO(Jcross) - -static struct BurnDIPInfo SgladiatDIPList[]= -{ - {0x11, 0xff, 0xff, 0x3d, NULL }, - {0x12, 0xff, 0xff, 0xf6, NULL }, - {0x13, 0xff, 0xff, 0xc1, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x02, 0x00, "Upright" }, - {0x11, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x11, 0x01, 0x04, 0x04, "3" }, - {0x11, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 7, "Coinage" }, - {0x11, 0x01, 0x38, 0x10, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Time" }, - {0x12, 0x01, 0x02, 0x02, "More" }, - {0x12, 0x01, 0x02, 0x00, "Less" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x12, 0x01, 0x18, 0x18, "Demo Sounds Off" }, - {0x12, 0x01, 0x18, 0x10, "Demo Sounds On" }, - {0x12, 0x01, 0x18, 0x00, "Freeze" }, - {0x12, 0x01, 0x18, 0x08, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "No Opponents (Cheat)" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x13, 0x01, 0xc1, 0xc1, "20k 60k 60k+" }, - {0x13, 0x01, 0xc1, 0x81, "40k 90k 90k+" }, - {0x13, 0x01, 0xc1, 0x41, "50k 120k 120k+" }, - {0x13, 0x01, 0xc1, 0xc0, "20k 60k" }, - {0x13, 0x01, 0xc1, 0x80, "40k 90k" }, - {0x13, 0x01, 0xc1, 0x40, "50k 120k" }, - {0x13, 0x01, 0xc1, 0x00, "None" }, -}; - -STDDIPINFO(Sgladiat) - -static struct BurnDIPInfo Hal21DIPList[]= -{ - {0x11, 0xff, 0xff, 0x3f, NULL }, - {0x12, 0xff, 0xff, 0xf6, NULL }, - {0x13, 0xff, 0xff, 0xc1, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x02, 0x02, "Upright" }, - {0x11, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x11, 0x01, 0x04, 0x04, "3" }, - {0x11, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 6, "Coinage" }, - {0x11, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x06, 0x06, "Easy" }, - {0x12, 0x01, 0x06, 0x04, "Normal" }, - {0x12, 0x01, 0x06, 0x02, "Hard" }, - {0x12, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game mode" }, - {0x12, 0x01, 0x18, 0x18, "Demo Sounds Off" }, - {0x12, 0x01, 0x18, 0x10, "Demo Sounds On" }, - {0x12, 0x01, 0x18, 0x00, "Freeze" }, - {0x12, 0x01, 0x18, 0x08, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x80, 0x80, "No" }, - {0x12, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x13, 0x01, 0xc1, 0xc1, "20k 60k 60k+" }, - {0x13, 0x01, 0xc1, 0x81, "40k 90k 90k+" }, - {0x13, 0x01, 0xc1, 0x41, "50k 120k 120k+" }, - {0x13, 0x01, 0xc1, 0xc0, "20k 60k" }, - {0x13, 0x01, 0xc1, 0x80, "40k 90k" }, - {0x13, 0x01, 0xc1, 0x40, "50k 120k" }, - {0x13, 0x01, 0xc1, 0x00, "None" }, -}; - -STDDIPINFO(Hal21) - -static struct BurnDIPInfo AsoDIPList[]= -{ - {0x13, 0xff, 0xff, 0x3c, NULL }, - {0x14, 0xff, 0xff, 0xf7, NULL }, - {0x14, 0xff, 0xff, 0xc1, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x01, 0x01, "No" }, - {0x13, 0x01, 0x01, 0x00, "3 Times" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x02, 0x00, "Upright" }, - {0x13, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x04, 0x04, "3" }, - {0x13, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0x38, 0x20, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x06, 0x06, "Easy" }, - {0x14, 0x01, 0x06, 0x04, "Normal" }, - {0x14, 0x01, 0x06, 0x02, "Hard" }, - {0x14, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "All Ships at Start (Cheat)" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Start Area" }, - {0x14, 0x01, 0xc0, 0xc0, "1" }, - {0x14, 0x01, 0xc0, 0x80, "2" }, - {0x14, 0x01, 0xc0, 0x40, "3" }, - {0x14, 0x01, 0xc0, 0x00, "4" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x15, 0x01, 0xc1, 0xc1, "50k 100k 100k+" }, - {0x15, 0x01, 0xc1, 0x81, "60k 120k 120k+" }, - {0x15, 0x01, 0xc1, 0x41, "100k 200k 200k+" }, - {0x15, 0x01, 0xc1, 0xc0, "50k 100k" }, - {0x15, 0x01, 0xc1, 0x80, "60k 120k" }, - {0x15, 0x01, 0xc1, 0x40, "100k 200k" }, - {0x15, 0x01, 0xc1, 0x00, "None" }, -}; - -STDDIPINFO(Aso) - -static struct BurnDIPInfo AthenaDIPList[]= -{ - {0x12, 0xff, 0xff, 0x39, NULL }, - {0x13, 0xff, 0xff, 0xcb, NULL }, - {0x14, 0xff, 0xff, 0x34, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x02, 0x00, "Upright" }, - {0x12, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x08, 0x08, "3" }, - {0x12, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x03, "Easy" }, - {0x13, 0x01, 0x03, 0x02, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Energy" }, - {0x13, 0x01, 0x80, 0x80, "12" }, - {0x13, 0x01, 0x80, 0x00, "14" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x14, 0x01, 0x34, 0x34, "50k 100k 100k+" }, - {0x14, 0x01, 0x34, 0x24, "60k 120k 120k+" }, - {0x14, 0x01, 0x34, 0x14, "100k 200k 200k+" }, - {0x14, 0x01, 0x34, 0x30, "50k 100k" }, - {0x14, 0x01, 0x34, 0x20, "60k 120k" }, - {0x14, 0x01, 0x34, 0x10, "100k 200k" }, - {0x14, 0x01, 0x34, 0x00, "None" }, -}; - -STDDIPINFO(Athena) - -static struct BurnDIPInfo Tnk3DIPList[]= -{ - {0x17, 0xff, 0xff, 0x3d, NULL }, - {0x18, 0xff, 0xff, 0x34, NULL }, - {0x19, 0xff, 0xff, 0xc1, NULL }, - - {0 , 0xfe, 0 , 2, "No BG Collision (Cheat)" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x17, 0x01, 0x02, 0x00, "Upright" }, - {0x17, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x17, 0x01, 0x04, 0x04, "3" }, - {0x17, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 6, "Coinage" }, - {0x17, 0x01, 0x38, 0x20, "3 Coins 1 Credits" }, - {0x17, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x17, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x17, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x17, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x17, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x18, 0x01, 0x06, 0x06, "Easy" }, - {0x18, 0x01, 0x06, 0x04, "Normal" }, - {0x18, 0x01, 0x06, 0x02, "Hard" }, - {0x18, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x18, 0x01, 0x18, 0x18, "Demo Sounds Off" }, - {0x18, 0x01, 0x18, 0x10, "Demo Sounds On" }, - {0x18, 0x01, 0x18, 0x00, "Freeze" }, - {0x18, 0x01, 0x18, 0x08, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x18, 0x01, 0x20, 0x20, "Off" }, - {0x18, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x18, 0x01, 0x80, 0x80, "No" }, - {0x18, 0x01, 0x80, 0x00, "5 Times" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x19, 0x01, 0xc1, 0xc1, "20k 60k 60k+" }, - {0x19, 0x01, 0xc1, 0x81, "40k 90k 90k+" }, - {0x19, 0x01, 0xc1, 0x41, "50k 120k 120k+" }, - {0x19, 0x01, 0xc1, 0xc0, "20k 60k" }, - {0x19, 0x01, 0xc1, 0x80, "40k 90k" }, - {0x19, 0x01, 0xc1, 0x40, "50k 120k" }, - {0x19, 0x01, 0xc1, 0x00, "None" }, -}; - -STDDIPINFO(Tnk3) - -static struct BurnDIPInfo IkariDIPList[]= -{ - {0x18, 0xff, 0xff, 0x3b, NULL }, - {0x19, 0xff, 0xff, 0x0a, NULL }, - {0x1a, 0xff, 0xff, 0x34, NULL }, - - {0 , 0xfe, 0 , 2, "Allow killing each other" }, - {0x18, 0x01, 0x01, 0x01, "No" }, - {0x18, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "P1 & P2 Fire Buttons" }, - {0x18, 0x01, 0x02, 0x02, "Separate" }, - {0x18, 0x01, 0x02, 0x00, "Common" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x18, 0x01, 0x08, 0x08, "3" }, - {0x18, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x18, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x18, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x18, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x18, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x18, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x18, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x18, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x19, 0x01, 0x03, 0x03, "Easy" }, - {0x19, 0x01, 0x03, 0x02, "Normal" }, - {0x19, 0x01, 0x03, 0x01, "Hard" }, - {0x19, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x19, 0x01, 0x0c, 0x0c, "Demo Sounds Off" }, - {0x19, 0x01, 0x0c, 0x08, "Demo Sounds On" }, - {0x19, 0x01, 0x0c, 0x04, "Freeze" }, - {0x19, 0x01, 0x0c, 0x00, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x19, 0x01, 0x80, 0x80, "No" }, - {0x19, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x1a, 0x01, 0x34, 0x34, "50k 100k 100k+" }, - {0x1a, 0x01, 0x34, 0x24, "60k 120k 120k+" }, - {0x1a, 0x01, 0x34, 0x14, "100k 200k 200k+" }, - {0x1a, 0x01, 0x34, 0x30, "50k 100k" }, - {0x1a, 0x01, 0x34, 0x20, "60k 120k" }, - {0x1a, 0x01, 0x34, 0x10, "100k 200k" }, - {0x1a, 0x01, 0x34, 0x00, "None" }, -}; - -STDDIPINFO(Ikari) - -static struct BurnDIPInfo VictroadDIPList[]= -{ - {0x19, 0xff, 0xff, 0x3b, NULL }, - {0x1a, 0xff, 0xff, 0x8b, NULL }, - {0x1b, 0xff, 0xff, 0x34, NULL }, - - {0 , 0xfe, 0 , 2, "Kill friend & walk everywhere (Cheat)" }, - {0x19, 0x01, 0x01, 0x01, "No" }, - {0x19, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "P1 & P2 Fire Buttons" }, - {0x19, 0x01, 0x02, 0x02, "Separate" }, - {0x19, 0x01, 0x02, 0x00, "Common" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x19, 0x01, 0x08, 0x08, "3" }, - {0x19, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x19, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x19, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x19, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x19, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x19, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x19, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1a, 0x01, 0x03, 0x03, "Easy" }, - {0x1a, 0x01, 0x03, 0x02, "Normal" }, - {0x1a, 0x01, 0x03, 0x01, "Hard" }, - {0x1a, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x1a, 0x01, 0x0c, 0x0c, "Demo Sounds Off" }, - {0x1a, 0x01, 0x0c, 0x08, "Demo Sounds On" }, - {0x1a, 0x01, 0x0c, 0x00, "Freeze" }, - {0x1a, 0x01, 0x0c, 0x04, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x1a, 0x01, 0x40, 0x40, "No" }, - {0x1a, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Credits Buy Lives During Play" }, - {0x1a, 0x01, 0x80, 0x00, "No" }, - {0x1a, 0x01, 0x80, 0x80, "Yes" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x1b, 0x01, 0x34, 0x34, "50k 100k 100k+" }, - {0x1b, 0x01, 0x34, 0x24, "60k 120k 120k+" }, - {0x1b, 0x01, 0x34, 0x14, "100k 200k 200k+" }, - {0x1b, 0x01, 0x34, 0x30, "50k 100k" }, - {0x1b, 0x01, 0x34, 0x20, "60k 120k" }, - {0x1b, 0x01, 0x34, 0x10, "100k 200k" }, - {0x1b, 0x01, 0x34, 0x00, "None" }, -}; - -STDDIPINFO(Victroad) - -static struct BurnDIPInfo FitegolfDIPList[]= -{ - {0x13, 0xff, 0xff, 0x37, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x13, 0x01, 0x01, 0x01, "English" }, - {0x13, 0x01, 0x01, 0x00, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x04, "Upright" }, - {0x13, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Gameplay" }, - {0x13, 0x01, 0x08, 0x00, "Basic Player" }, - {0x13, 0x01, 0x08, 0x08, "Avid Golfer" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Shot Time" }, - {0x14, 0x01, 0x01, 0x00, "Short (10 sec)" }, - {0x14, 0x01, 0x01, 0x01, "Long (12 sec)" }, - - {0 , 0xfe, 0 , 2, "Bonus Holes" }, - {0x14, 0x01, 0x02, 0x02, "More (Par 1,Birdie 2,Eagle 3)" }, - {0x14, 0x01, 0x02, 0x00, "Less (Par 0,Birdie 1,Eagle 2)" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x14, 0x01, 0x0c, 0x04, "Demo Sounds Off" }, - {0x14, 0x01, 0x0c, 0x0c, "Demo Sounds On" }, - {0x14, 0x01, 0x0c, 0x00, "Freeze" }, - {0x14, 0x01, 0x0c, 0x08, "Infinite Holes (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Play Holes" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x20, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - {0x14, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "No" }, - {0x14, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - -}; - -STDDIPINFO(Fitegolf) - -static struct BurnDIPInfo AlphamisDIPList[]= -{ - {0x14, 0xff, 0xff, 0x9c, NULL }, - {0x15, 0xff, 0xff, 0xf6, NULL }, - {0x16, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x01, 0x01, "No" }, - {0x14, 0x01, 0x01, 0x00, "3 Times" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x02, 0x00, "Upright" }, - {0x14, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x04, 0x04, "3" }, - {0x14, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x18, 0x00, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x18, 0x08, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x60, 0x00, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x60, 0x40, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x60, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x60, 0x60, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x06, 0x06, "Easy" }, - {0x15, 0x01, 0x06, 0x04, "Normal" }, - {0x15, 0x01, 0x06, 0x02, "Hard" }, - {0x15, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "All Ships at Start (Cheat)" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Start Area" }, - {0x15, 0x01, 0xc0, 0xc0, "1" }, - {0x15, 0x01, 0xc0, 0x80, "2" }, - {0x15, 0x01, 0xc0, 0x40, "3" }, - {0x15, 0x01, 0xc0, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x16, 0x01, 0x01, 0x01, "50k 100k 100k+" }, - {0x16, 0x01, 0x01, 0x00, "50k 100k" }, -}; - -STDDIPINFO(Alphamis) - -static struct BurnDIPInfo ChopperDIPList[]= -{ - {0x13, 0xff, 0xff, 0x3b, NULL }, - {0x14, 0xff, 0xff, 0xcf, NULL }, - {0x15, 0xff, 0xff, 0x30, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x02, 0x02, "Upright" }, - {0x13, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x08, 0x08, "3" }, - {0x13, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x14, 0x01, 0x0c, 0x08, "Demo Sounds Off" }, - {0x14, 0x01, 0x0c, 0x0c, "Demo Sounds On" }, - {0x14, 0x01, 0x0c, 0x00, "Freeze" }, - {0x14, 0x01, 0x0c, 0x04, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "No" }, - {0x14, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x15, 0x01, 0x34, 0x30, "50k 100k 100k+" }, - {0x15, 0x01, 0x34, 0x20, "75k 150k 150k+" }, - {0x15, 0x01, 0x34, 0x10, "100k 200k 200k+" }, - {0x15, 0x01, 0x34, 0x34, "50k 100k" }, - {0x15, 0x01, 0x34, 0x24, "75k 150k" }, - {0x15, 0x01, 0x34, 0x14, "100k 200k" }, - {0x15, 0x01, 0x34, 0x00, "None" }, -}; - -STDDIPINFO(Chopper) - -static struct BurnDIPInfo ChopperaDIPList[]= -{ - {0x13, 0xff, 0xff, 0x3b, NULL }, - {0x14, 0xff, 0xff, 0xcf, NULL }, - {0x15, 0xff, 0xff, 0x30, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x02, 0x02, "Upright" }, - {0x13, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x08, 0x08, "3" }, - {0x13, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x14, 0x01, 0x0c, 0x08, "Demo Sounds Off" }, - {0x14, 0x01, 0x0c, 0x0c, "Demo Sounds On" }, - {0x14, 0x01, 0x0c, 0x00, "Freeze" }, - {0x14, 0x01, 0x0c, 0x04, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "No" }, - {0x14, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x15, 0x01, 0x34, 0x30, "50k 100k 100k+" }, - {0x15, 0x01, 0x34, 0x20, "75k 150k 150k+" }, - {0x15, 0x01, 0x34, 0x10, "100k 200k 200k+" }, - {0x15, 0x01, 0x34, 0x34, "50k 100k" }, - {0x15, 0x01, 0x34, 0x24, "75k 150k" }, - {0x15, 0x01, 0x34, 0x14, "100k 200k" }, - {0x15, 0x01, 0x34, 0x00, "None" }, -}; - -STDDIPINFO(Choppera) - -static struct BurnDIPInfo BermudatDIPList[]= -{ - {0x19, 0xff, 0xff, 0x3a, NULL }, - {0x1a, 0xff, 0xff, 0x8a, NULL }, - {0x1b, 0xff, 0xff, 0x34, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x19, 0x01, 0x02, 0x02, "Off" }, - {0x19, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x19, 0x01, 0x08, 0x08, "3" }, - {0x19, 0x01, 0x08, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x19, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x19, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x19, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x19, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x19, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x19, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1a, 0x01, 0x03, 0x03, "Easy" }, - {0x1a, 0x01, 0x03, 0x02, "Normal" }, - {0x1a, 0x01, 0x03, 0x01, "Hard" }, - {0x1a, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Mode" }, - {0x1a, 0x01, 0x0c, 0x0c, "Demo Sounds Off" }, - {0x1a, 0x01, 0x0c, 0x08, "Demo Sounds On" }, - {0x1a, 0x01, 0x0c, 0x00, "Freeze" }, - {0x1a, 0x01, 0x0c, 0x04, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Game Style" }, - {0x1a, 0x01, 0xc0, 0xc0, "Normal without continue" }, - {0x1a, 0x01, 0xc0, 0x80, "Normal with continue" }, - {0x1a, 0x01, 0xc0, 0x40, "Time attack 3 minutes" }, - {0x1a, 0x01, 0xc0, 0x00, "Time attack 5 minutes" }, - - {0 , 0xfe, 0 , 7, "Bonus Life" }, - {0x1b, 0x01, 0x34, 0x34, "50k 100k 100k+" }, - {0x1b, 0x01, 0x34, 0x24, "60k 120k 120k+" }, - {0x1b, 0x01, 0x34, 0x14, "100k 200k 200k+" }, - {0x1b, 0x01, 0x34, 0x30, "50k 100k" }, - {0x1b, 0x01, 0x34, 0x20, "60k 120k" }, - {0x1b, 0x01, 0x34, 0x10, "100k 200k" }, - {0x1b, 0x01, 0x34, 0x00, "None" }, -}; - -STDDIPINFO(Bermudat) - -// SNKWAVE code - -#define CLOCK_SHIFT 8 -#define SNKWAVE_WAVEFORM_LENGTH 16 - -// data about the sound system -UINT32 snkwave_frequency; -UINT32 snkwave_counter; -INT32 snkwave_waveform_position; -// decoded waveform table -INT16 snkwave_waveform[SNKWAVE_WAVEFORM_LENGTH]; -double snkwave_volume = 1.00; - -static void snkwave_reset() -{ - /* reset all the voices */ - snkwave_frequency = 0; - snkwave_counter = 0; - snkwave_waveform_position = 0; - memset(&snkwave_waveform, 0, sizeof(snkwave_waveform)); -} - -static void snkwave_render(INT16 *buffer, INT32 samples) -{ - /* if no sound, we're done */ - if (snkwave_frequency == 0xfff) - return; - - /* generate sound into buffer while updating the counter */ - while (samples-- > 0) - { - INT32 loops; - INT16 out = 0; - - loops = 1 << CLOCK_SHIFT; - while (loops > 0) - { - int steps = 0x1000 - snkwave_counter; - - if (steps <= loops) - { - out += snkwave_waveform[snkwave_waveform_position] * steps; - snkwave_counter = snkwave_frequency; - snkwave_waveform_position = (snkwave_waveform_position + 1) & (SNKWAVE_WAVEFORM_LENGTH-1); - loops -= steps; - } - else - { - out += snkwave_waveform[snkwave_waveform_position] * loops; - snkwave_counter += loops; - loops = 0; - } - } - - *buffer = BURN_SND_CLIP(*buffer + (INT16)(out * snkwave_volume)); - buffer++; - *buffer = BURN_SND_CLIP(*buffer + (INT16)(out * snkwave_volume)); - buffer++; - } -} - -static void snkwave_update_waveform(UINT32 offset, UINT8 data) -{ - snkwave_waveform[offset * 2] = ((data & 0x38) >> 3) << (12-CLOCK_SHIFT); - snkwave_waveform[offset * 2 + 1] = ((data & 0x07) >> 0) << (12-CLOCK_SHIFT); - snkwave_waveform[SNKWAVE_WAVEFORM_LENGTH-2 - offset * 2] = ~snkwave_waveform[offset * 2 + 1]; - snkwave_waveform[SNKWAVE_WAVEFORM_LENGTH-1 - offset * 2] = ~snkwave_waveform[offset * 2]; -} - -static void snkwave_w(UINT32 offset, UINT8 data) -{ - data &= 0x3f; // all registers are 6-bit - - if (offset == 0) - snkwave_frequency = (snkwave_frequency & 0x03f) | (data << 6); - else if (offset == 1) - snkwave_frequency = (snkwave_frequency & 0xfc0) | data; - else if (offset <= 5) - snkwave_update_waveform(offset - 2, data); -} - -#undef CLOCK_SHIFT -#undef SNKWAVE_WAVEFORM_LENGTH - -// Rotation-handler code - -static void RotateReset() { - for (INT32 playernum = 0; playernum < 2; playernum++) { - nRotate[playernum] = 0; // start out pointing straight up (0=up) - nRotateTarget[playernum] = -1; - nRotateTime[playernum] = 0; - } -} - -static UINT32 RotationTimer(void) { - return nCurrentFrame; -} - -static void RotateRight(INT32 *v) { - (*v)--; - if (*v < 0) *v = 11; -} - -static void RotateLeft(INT32 *v) { - (*v)++; - if (*v > 11) *v = 0; -} - -static UINT8 Joy2Rotate(UINT8 *joy) { // ugly code, but the effect is awesome. -dink - if (joy[0] && joy[2]) return 7; // up left - if (joy[0] && joy[3]) return 1; // up right - - if (joy[1] && joy[2]) return 5; // down left - if (joy[1] && joy[3]) return 3; // down right - - if (joy[0]) return 0; // up - if (joy[1]) return 4; // down - if (joy[2]) return 6; // left - if (joy[3]) return 2; // right - - return 0xff; -} - -static int dialRotation(INT32 playernum) { - // p1 = 0, p2 = 1 - UINT8 player[2] = { 0, 0 }; - static UINT8 lastplayer[2][2] = { { 0, 0 }, { 0, 0 } }; - - if ((playernum != 0) && (playernum != 1)) { - bprintf(PRINT_NORMAL, _T("Strange Rotation address => %06X\n"), playernum); - return 0; - } - if (playernum == 0) { - player[0] = DrvFakeInput[0]; player[1] = DrvFakeInput[1]; - } - if (playernum == 1) { - player[0] = DrvFakeInput[2]; player[1] = DrvFakeInput[3]; - } - - if (player[0] && (player[0] != lastplayer[playernum][0] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateLeft(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Left => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - if (player[1] && (player[1] != lastplayer[playernum][1] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateRight(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Right => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - lastplayer[playernum][0] = player[0]; - lastplayer[playernum][1] = player[1]; - - return (nRotate[playernum]); -} - -static UINT8 *rotate_gunpos[2] = {NULL, NULL}; -static UINT8 rotate_gunpos_multiplier = 1; - -// Gun-rotation memory locations - do not remove this tag. - dink :) -// game p1 p2 clockwise value in memory -// victroad: fdb6 fe06 0 2 4 6 8 a c e -// ikari : fdb6 fe06 0 2 4 6 8 a c e -// tnk3 : fd43 fd89 0 1 2 3 4 5 6 7 // fd47 fd8d? -// gwar : e3d3 e437 0 2 4 6 8 a c e -// bermudat: e041 e055 0 1 2 3 4 5 6 7 - -static void RotateSetGunPosRAM(UINT8 *p1, UINT8 *p2, UINT8 multiplier) { - rotate_gunpos[0] = p1; - rotate_gunpos[1] = p2; - rotate_gunpos_multiplier = multiplier; -} - -static INT32 get_distance(INT32 from, INT32 to) { -// this function finds the easiest way to get from "from" to "to", wrapping at 0 and 7 - INT32 countA = 0; - INT32 countB = 0; - INT32 fromtmp = from / rotate_gunpos_multiplier; - INT32 totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp++; - countA++; - if(fromtmp>7) fromtmp = 0; - if(fromtmp == totmp || countA > 32) break; - } - - fromtmp = from / rotate_gunpos_multiplier; - totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp--; - countB++; - if(fromtmp<0) fromtmp = 7; - if(fromtmp == totmp || countB > 32) break; - } - - if (countA > countB) { - return 1; // go negative - } else { - return 0; // go positive - } -} - -static void RotateDoTick() { - // since the game only allows for 1 rotation every other frame, we have to - // do this. - if (nCurrentFrame&1) return; - - for (INT32 i = 0; i < 2; i++) { - if (rotate_gunpos[i] && (nRotateTarget[i] != -1) && (nRotateTarget[i] != (*rotate_gunpos[i] & 0x0f))) { - if (get_distance(nRotateTarget[i], *rotate_gunpos[i] & 0x0f)) { - RotateRight(&nRotate[i]); // -- - } else { - RotateLeft(&nRotate[i]); // ++ - } - bprintf(0, _T("p%X target %X mempos %X nRotate %X.\n"), i, nRotateTarget[0], *rotate_gunpos[0] & 0x0f, nRotate[0]); - nRotateTry[i]++; - if (nRotateTry[i] > 10) nRotateTarget[i] = -1; // don't get stuck in a loop if something goes horribly wrong here. - } else { - nRotateTarget[i] = -1; - } - } -} - -static void SuperJoy2Rotate() { - for (INT32 i = 0; i < 2; i++) { // p1 = 0, p2 = 1 - if (DrvFakeInput[4 + i]) { // rotate-button had been pressed - UINT8 rot = Joy2Rotate(((!i) ? &DrvJoy2[0] : &DrvJoy3[0])); - - if (rot != 0xff) { - nRotateTarget[i] = rot * rotate_gunpos_multiplier; - } - DrvInputs[1 + i] &= 0xc; // cancel out directionals since they are used to rotate here. - nRotateTry[i] = 0; - } - - DrvInputs[1 + i] = (DrvInputs[1 + i] & 0x0f) + (dialRotation(i) << 4); - } - - RotateDoTick(); -} - -// end Rotation-handler - -enum -{ - YM1IRQ_ASSERT=0, - YM1IRQ_CLEAR, - YM2IRQ_ASSERT, - YM2IRQ_CLEAR, - CMDIRQ_BUSY_ASSERT, - BUSY_CLEAR, - CMDIRQ_CLEAR -}; - -static void sgladiat_sndirq_update_callback(INT32 param) -{ - switch (param) - { - case CMDIRQ_BUSY_ASSERT: - sound_status |= 8|4; - break; - - case BUSY_CLEAR: - sound_status &= ~4; - break; - - case CMDIRQ_CLEAR: - sound_status &= ~8; - break; - } - - ZetSetIRQLine(0x20, (sound_status & 0x08) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void sndirq_update_callback(INT32 param) -{ - switch (param) - { - case YM1IRQ_ASSERT: - sound_status |= 1; - break; - - case YM1IRQ_CLEAR: - sound_status &= ~1; - break; - - case YM2IRQ_ASSERT: - sound_status |= 2; - break; - - case YM2IRQ_CLEAR: - sound_status &= ~2; - break; - - case CMDIRQ_BUSY_ASSERT: - sound_status |= 8|4; - break; - - case BUSY_CLEAR: - sound_status &= ~4; - break; - - case CMDIRQ_CLEAR: - sound_status &= ~8; - break; - } - - ZetSetIRQLine(0, (sound_status & 0xb) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static inline UINT8 nmi_trigger_read() -{ - INT32 nActive = ZetGetActive(); - - ZetClose(); - ZetOpen(nActive^1); - ZetSetIRQLine(0x20, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(nActive); - - return 0xff; -} - -static inline UINT8 common_read(UINT16 offset, UINT16 real_address, INT32 sound_status_val, INT32 sound_status_select, UINT16 hi_dips) -{ - if (hi_dips) hi_dips = 0x0100; - - if ((offset + 0x0000) == real_address) { - return (DrvInputs[0] & ~sound_status_val) | ((sound_status & sound_status_select) ? sound_status_val : 0); - } - - if ((offset + 0x0100) == real_address) return DrvInputs[1]; - if ((offset + 0x0200) == real_address) return DrvInputs[2]; - if ((offset + 0x0300) == real_address) return DrvInputs[3]; - if ((offset + 0x0400 + hi_dips) == real_address) { - INT32 dip = DrvDips[0] & (~(bonus_dip_config & 0xff)); - return dip | (DrvDips[2] & (bonus_dip_config & 0xff)); - } - if ((offset + 0x0500 + hi_dips) == real_address) { - INT32 dip = DrvDips[1] & (~(bonus_dip_config >> 8)); - return dip | (DrvDips[2] & (bonus_dip_config >> 8)); - } - if ((offset + 0x0700) == real_address) return nmi_trigger_read(); - - return 0; -} - -static void __fastcall bermudat_main_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("%d, W: %4.4x, %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xca00: - tc16_posy = (tc16_posy & ~0xff) | data; - return; - - case 0xca40: - tc16_posx = (tc16_posx & ~0xff) | data; - return; - - case 0xcc00: - tc32_posy = (tc32_posy & ~0xff) | data; - return; - - case 0xcc40: - tc32_posx = (tc32_posx & ~0xff) | data; - return; - - case 0xcc80: - { - tc16_posx = (tc16_posx & 0xff) | ((data & 0x80) << 1); - tc16_posy = (tc16_posy & 0xff) | ((data & 0x40) << 2); - tc32_posx = (tc32_posx & 0xff) | ((data & 0x80) << 1); - tc32_posy = (tc32_posy & 0xff) | ((data & 0x40) << 2); - } - return; - - case 0xc300: - // coin counter - return; - - case 0xc400: - { - soundlatch = data; - ZetClose(); - ZetOpen(2); - sndirq_update_callback(CMDIRQ_BUSY_ASSERT); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xc700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xc800: - bg_scrolly = (bg_scrolly & 0x100) | data; - return; - - case 0xc840: - bg_scrollx = (bg_scrollx & 0x100) | data; - return; - - case 0xc880: - { - flipscreen = data & 0x10; - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x01) << 8); - } - return; - - case 0xc8c0: - { - txt_palette_offset = (data & 0xf) << 4; - txt_tile_offset = (data & 0x30) << 4; - if (game_select == 1) bg_palette_offset = (data & 0x80); // psychos only!!!! - } - return; - - case 0xc900: - sp16_scrolly = (sp16_scrolly & 0x100) | data; - return; - - case 0xc940: - sp16_scrollx = (sp16_scrollx & 0x100) | data; - return; - - case 0xc980: - sp32_scrolly = (sp32_scrolly & 0x100) | data; - return; - - case 0xc9c0: - sp32_scrollx = (sp32_scrollx & 0x100) | data; - return; - - case 0xca80: - { - sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x20) << 3); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x10) << 4); - sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x08) << 5); - sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x04) << 6); - } - return; - - case 0xcac0: - sprite_split_point = data; - return; - } -} - -static INT32 turbofront_check(int small, int num) -{ - const UINT8 *sr = &DrvSprRAM[0x800*small + 4*num]; - INT32 x = sr[2] + ((sr[3] & 0x80) << 1); - INT32 y = sr[0] + ((sr[3] & 0x10) << 4); - - INT32 dx = (x - (small ? tc16_posx : tc32_posx)) & 0x1ff; - INT32 dy = (y - (small ? tc16_posy : tc32_posy)) & 0x1ff; - - if (dx > 0x20 && dx <= 0x1e0 && dy > 0x20 && dy <= 0x1e0) - return 0; - else - return 1; -} - -static INT32 turbofront_check8(int small, int num) -{ - return (turbofront_check(small, num + 0) << 0) | - (turbofront_check(small, num + 1) << 1) | - (turbofront_check(small, num + 2) << 2) | - (turbofront_check(small, num + 3) << 3) | - (turbofront_check(small, num + 4) << 4) | - (turbofront_check(small, num + 5) << 5) | - (turbofront_check(small, num + 6) << 6) | - (turbofront_check(small, num + 7) << 7); -} - -static UINT8 __fastcall bermudat_main_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - if ((address & 0xff8f) == 0xcb00) { - return turbofront_check8(1, ((address >> 4) & 7)*8); - } - - if ((address & 0xffcf) == 0xccc0) { - return turbofront_check8(0, ((address >> 4) & 3)*8); - } - - return common_read(0xc000, address, 0x01, 0x04, 1); -} - -static void __fastcall bermudat_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc300: // these should be written by the main cpu only! - case 0xc400: - case 0xcac0: - return; - } - - bermudat_main_write(address, data); -} - - -static UINT8 __fastcall bermudat_sub_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - return common_read(0xc000, address, 0x01, 0x04, 1); -} - -static void __fastcall gwar_main_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("%d, W: %4.4x, %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xc300: - // coin counter - return; - - case 0xc400: - { - soundlatch = data; - ZetClose(); - ZetOpen(2); - sndirq_update_callback(CMDIRQ_BUSY_ASSERT); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xc700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); // nmi_ack - return; - - case 0xc800: - case 0xf800: // gwara - bg_scrolly = (bg_scrolly & 0x100) | data; - return; - - case 0xc840: - case 0xf840: // gwara - bg_scrollx = (bg_scrollx & 0x100) | data; - return; - - case 0xc880: // gwar only! - { - flipscreen = data & 0x04; - - sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x80) << 1); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x40) << 2); - sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x20) << 3); - sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x10) << 4); - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x01) << 8); - } - return; - - case 0xc8c0: - case 0xf8c0: // gwara - { - txt_palette_offset = (data & 0xf) << 4; - txt_tile_offset = (data & 0x30) << 4; - if (game_select == 1) bg_palette_offset = (data & 0x80); // psychos only!!!! - } - return; - - case 0xc900: - case 0xf900: // gwara - sp16_scrolly = (sp16_scrolly & 0x100) | data; - return; - - case 0xc940: - case 0xf940: // gwara - sp16_scrollx = (sp16_scrollx & 0x100) | data; - return; - - case 0xc980: - case 0xf980: // gwara - sp32_scrolly = (sp32_scrolly & 0x100) | data; - return; - - case 0xc9c0: - case 0xf9c0: // gwara - sp32_scrollx = (sp32_scrollx & 0x100) | data; - return; - - case 0xcac0: - case 0xfac0: // gwara - sprite_split_point = data; - return; - - case 0xf880: // gwara only! - flipscreen = data & 0x10; - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x01) << 8); - return; - - case 0xfa80: // gwara only! - sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x20) << 3); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x10) << 4); - sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x08) << 5); - sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x04) << 6); - return; - } -} - -static void __fastcall gwar_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xc8c0: - case 0xf8c0: // gwara - gwar_main_write(address,data); - return; - } -} - -static UINT8 __fastcall gwar_sub_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return nmi_trigger_read(); - } - - return 0; -} - -static void __fastcall tnk3_main_write(UINT16 address, UINT8 data) -{ - //bprintf (0, _T("W C%d, A: %4.4x, D: %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xc300: - // coin counter - return; - - case 0xc400: - { - soundlatch = data; - ZetClose(); - ZetOpen(2); - sndirq_update_callback(CMDIRQ_BUSY_ASSERT); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xc700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); // nmi_ack - return; - - case 0xc800: - { - flipscreen = data & 0x80; - txt_tile_offset = ((data & 0x40) << 2); - //bprintf(0, _T("0x20 = %X."), data & 0x20); - //bprintf(0, _T("txttile = %X."), txt_tile_offset); - - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4); - sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5); - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8); - } - return; - - case 0xc900: - sp16_scrolly = (sp16_scrolly & 0x100) | data; - //if (sp16_scrolly == 0) - // bprintf(0, _T("sp16sy %X."), sp16_scrolly); - return; - - case 0xca00: - sp16_scrollx = (sp16_scrollx & 0x100) | data; - //if (sp16_scrollx == 0) - // bprintf(0, _T("sp16sx %X."), sp16_scrollx); - return; - - case 0xcb00: - bg_scrolly = (bg_scrolly & 0x100) | data; - //if (bg_scrolly == 0) bprintf(0, _T("bsy %X. "), bg_scrolly); - return; - - case 0xcc00: - bg_scrollx = (bg_scrollx & 0x100) | data; - //if (bg_scrollx == 0) bprintf(0, _T("bsx %X. "), bg_scrollx); - return; - } -} - -static UINT8 __fastcall tnk3_main_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - return common_read(0xc000, address, 0x20, 0x04, 1); -} - -static UINT8 __fastcall fitegolf_main_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - return common_read(0xc000, address, 0x01, 0x04, 1); -} - -static UINT8 __fastcall hal21_main_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - return common_read(0xc000, address, 0x20, 0x04, 0); -} - - -static UINT8 __fastcall athena_main_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - return common_read(0xc000, address, 0x01, 0x04, 1); -} - -static void __fastcall tnk3_sub_write(UINT16 address, UINT8 /*data*/) -{ -// bprintf (0, _T("W C%d, A: %4.4x, D: %2.2x\n"), ZetGetActive(), address, data); - - - switch (address) - { - case 0xc000: - case 0xc700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - } -} - - -static UINT8 __fastcall tnk3_sub_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - switch (address) - { - case 0xc000: - case 0xc700: - return nmi_trigger_read(); - } - - return 0; -} - -static void __fastcall aso_main_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("W C%d, A: %4.4x, D: %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xc400: - { - soundlatch = data; - ZetClose(); - ZetOpen(2); - sndirq_update_callback(CMDIRQ_BUSY_ASSERT); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xc700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); // nmi_ack - return; - - case 0xc800: - { - flipscreen = data & 0x20; - - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4); - sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5); - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8); - } - return; - - case 0xc900: - sp16_scrolly = (sp16_scrolly & 0x100) | data; - return; - - case 0xca00: - sp16_scrollx = (sp16_scrollx & 0x100) | data; - return; - - case 0xcb00: - bg_scrolly = (bg_scrolly & 0x100) | data; - return; - - case 0xcc00: - bg_scrollx = (bg_scrollx & 0x100) | data; - return; - - case 0xcf00: - bg_palette_offset = ((data&0xf)^8)<<4; - bg_tile_offset = ((data & 0x30) << 4); - return; - } -} - - -static void __fastcall marvins_ab_write(UINT16 address, UINT8 data) -{ - switch (address & ~0xff) - { - // CPU A only - case 0x6000: // palette_bank - bg_palette_offset = (data & 0x70); - fg_palette_offset = (data & 0x07) << 4; - return; - - case 0x8300: - if (ZetGetActive() == 0) { - sound_status = 1; - soundlatch = data; - ZetClose(); - ZetOpen(2); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(0); - } - return; - - case 0x8600: - flipscreen = data & 0x01; - return; - - case 0x8700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - // shared - case 0xf800: - sp16_scrolly = (sp16_scrolly & 0xff00) | data; - return; - - case 0xf900: - sp16_scrollx = (sp16_scrollx & 0xff00) | data; - return; - - case 0xfa00: - fg_scrolly = (fg_scrolly & 0xff00) | data; - return; - - case 0xfb00: - fg_scrollx = (fg_scrollx & 0xff00) | data; - return; - - case 0xfc00: - bg_scrolly = (bg_scrolly & 0xff00) | data; - return; - - case 0xfd00: - bg_scrollx = (bg_scrollx & 0xff00) | data; - return; - - case 0xfe00: - sprite_split_point = data; - return; - - case 0xff00: - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x04) << 6); - fg_scrollx = (fg_scrollx & 0xff) | ((data & 0x02) << 7); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8); - return; - } -} - -static UINT8 __fastcall marvins_ab_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - return common_read(0x8000, address, 0x60, 0xff, 0); -} - - -static void __fastcall madcrash_main_write(UINT16 address, UINT8 data) -{ - switch (address & ~0xff) - { - case 0x8300: - if (ZetGetActive() == 0) { - sound_status = 1; - soundlatch = data; - ZetClose(); - ZetOpen(2); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(0); - } - return; - - case 0x8600: - flipscreen = data & 0x01; - return; - - case 0x8700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xc800: // palette_bank - bg_palette_offset = (data & 0x70); - fg_palette_offset = (data & 0x07) << 4; - return; - - case 0xf800: - bg_scrolly = (bg_scrolly & 0xff00) | data; - return; - - case 0xf900: - bg_scrollx = (bg_scrollx & 0xff00) | data; - return; - - case 0xfa00: - sprite_split_point = data; - return; - - case 0xfb00: - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x04) << 6); - fg_scrollx = (fg_scrollx & 0xff) | ((data & 0x02) << 7); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8); - return; - - case 0xfc00: - sp16_scrolly = (sp16_scrolly & 0xff00) | data; - return; - - case 0xfd00: - sp16_scrollx = (sp16_scrollx & 0xff00) | data; - return; - - case 0xfe00: - fg_scrolly = (fg_scrolly & 0xff00) | data; - return; - - case 0xff00: - fg_scrollx = (fg_scrollx & 0xff00) | data; - return; - } -} - -static void __fastcall madcrash_sub_write(UINT16 address, UINT8 data) -{ - switch (address & ~0xff) - { - case 0x8700: // vangrd2 - case 0xa000: // madcrash - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xd800: - bg_scrolly = (bg_scrolly & 0xff00) | data; - return; - - case 0xd900: - bg_scrollx = (bg_scrollx & 0xff00) | data; - return; - - case 0xda00: - sprite_split_point = data; - return; - - case 0xdb00: - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x04) << 6); - fg_scrollx = (fg_scrollx & 0xff) | ((data & 0x02) << 7); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8); - return; - - case 0xdc00: - sp16_scrolly = (sp16_scrolly & 0xff00) | data; - return; - - case 0xdd00: - sp16_scrollx = (sp16_scrollx & 0xff00) | data; - return; - - case 0xde00: - fg_scrolly = (fg_scrolly & 0xff00) | data; - return; - - case 0xdf00: - fg_scrollx = (fg_scrollx & 0xff00) | data; - return; - } -} - -static void __fastcall madcrush_ab_write(UINT16 address, UINT8 data) -{ - switch (address & ~0xff) - { - case 0x8300: - if (ZetGetActive() == 0) { - sound_status = 1; - soundlatch = data; - ZetClose(); - ZetOpen(2); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - } - return; - - case 0x8600: - flipscreen = data & 0x01; - return; - - case 0x8700: - case 0xa000: // sub - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xc800: // palette_bank - bg_palette_offset = (data & 0x70); - fg_palette_offset = (data & 0x07) << 4; - return; - - case 0xf800: - sp16_scrolly = (sp16_scrolly & 0xff00) | data; - return; - - case 0xf900: - sp16_scrollx = (sp16_scrollx & 0xff00) | data; - return; - - case 0xfa00: - fg_scrolly = (fg_scrolly & 0xff00) | data; - return; - - case 0xfb00: - fg_scrollx = (fg_scrollx & 0xff00) | data; - return; - - case 0xfc00: - bg_scrolly = (bg_scrolly & 0xff00) | data; - return; - - case 0xfd00: - bg_scrollx = (bg_scrollx & 0xff00) | data; - return; - - case 0xfe00: - sprite_split_point = data; - return; - - case 0xff00: - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x04) << 6); - fg_scrollx = (fg_scrollx & 0xff) | ((data & 0x02) << 7); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8); - return; - } -} - -static UINT8 __fastcall jcross_main_read(UINT16 address) -{ -// bprintf (0, _T("R C%d, A: %4.4x\n"), ZetGetActive(), address); - - return common_read(0xa000, address, 0x20, 0xff, 0); -} - -static void __fastcall jcross_main_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("W C%d, A: %4.4x, D: %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xa300: - if (ZetGetActive() != 0) return; - soundlatch = data; - ZetClose(); - ZetOpen(2); - sgladiat_sndirq_update_callback(CMDIRQ_BUSY_ASSERT); - ZetClose(); - ZetOpen(0); - return; - - case 0xa600: - flipscreen = data & 0x80; - bg_palette_offset = ((data & 0xf) ^ 8) << 4; - return; - - case 0xa700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xd300: - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4); - sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5); - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8); - return; - - case 0xd400: - sp16_scrolly = (sp16_scrolly & 0x100) | data; - return; - - case 0xd500: - sp16_scrollx = (sp16_scrollx & 0x100) | data; - return; - - case 0xd600: - bg_scrolly = (bg_scrolly & 0x100) | data; - return; - - case 0xd700: - bg_scrollx = (bg_scrollx & 0x100) | data; - return; - } -} - -static void __fastcall sgladiat_sub_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("W C%d, A: %4.4x, D: %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xa000: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xa600: - flipscreen = data & 0x80; - bg_palette_offset = ((data & 0xf) ^ 8) << 4; - return; - - case 0xdb00: - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4); - sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5); - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8); - return; - - case 0xdc00: - sp16_scrolly = (sp16_scrolly & 0x100) | data; - return; - - case 0xdd0: - sp16_scrollx = (sp16_scrollx & 0x100) | data; - return; - - case 0xde00: - bg_scrolly = (bg_scrolly & 0x100) | data; - return; - - case 0xdf00: - bg_scrollx = (bg_scrollx & 0x100) | data; - return; - } -} - -static void __fastcall hal21_main_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("W C%d, A: %4.4x, D: %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xc300: - if (ZetGetActive() != 0) return; - soundlatch = data; - ZetClose(); - ZetOpen(2); - sgladiat_sndirq_update_callback(CMDIRQ_BUSY_ASSERT); - ZetClose(); - ZetOpen(0); - return; - - case 0xc600: - flipscreen = data & 0x80; - bg_tile_offset = ((data & 0x20) << 3); - bg_palette_offset = (((data & 0xf) ^ 8) << 4); - return; - - case 0xc700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xd300: - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4); - sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5); - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8); - return; - - case 0xd400: - sp16_scrolly = (sp16_scrolly & 0x100) | data; - return; - - case 0xd500: - sp16_scrollx = (sp16_scrollx & 0x100) | data; - return; - - case 0xd600: - bg_scrolly = (bg_scrolly & 0x100) | data; - return; - - case 0xd700: - bg_scrollx = (bg_scrollx & 0x100) | data; - return; - } -} - -static void __fastcall hal21_sub_write(UINT16 address, UINT8 /*data*/) -{ - switch (address) - { - case 0xa000: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - } -} - -static void __fastcall ikari_main_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("W C%d, A: %4.4x, D: %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xc300: - // coin counter - return; - - case 0xc400: - { - soundlatch = data; - ZetClose(); - ZetOpen(2); - sndirq_update_callback(CMDIRQ_BUSY_ASSERT); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xc700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xc800: - bg_scrolly = (bg_scrolly & 0x100) | data; - return; - - case 0xc880: - bg_scrollx = (bg_scrollx & 0x100) | data; - return; - - case 0xc900: - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x01) << 8); - return; - - case 0xc980: - txt_palette_offset = ((data & 0x01) << 4); - txt_tile_offset = ((data & 0x10) << 4); - return; - - case 0xca00: - sp16_scrolly = (sp16_scrolly & 0x100) | data; - return; - - case 0xca80: - sp16_scrollx = (sp16_scrollx & 0x100) | data; - return; - - case 0xcb00: - sp32_scrolly = (sp32_scrolly & 0x100) | data; - return; - - case 0xcb80: - sp32_scrollx = (sp32_scrollx & 0x100) | data; - return; - - - case 0xcc00: - tc16_posy = (tc16_posy & ~0xff) | data; - return; - - case 0xcc80: - tc16_posx = (tc16_posx & ~0xff) | data; - return; - - case 0xcd00: - sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x20) << 3); - sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x10) << 4); - sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x08) << 5); - sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x04) << 6); - return; - - case 0xcd80: - { - tc16_posx = (tc16_posx & 0xff) | ((data & 0x80) << 1); - tc16_posy = (tc16_posy & 0xff) | ((data & 0x40) << 2); - } - return; - } -} - -static UINT8 __fastcall ikari_main_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - switch (address) - { - case 0xce00: - return turbofront_check8(1,0*8); - - case 0xce20: - return turbofront_check8(1,1*8); - - case 0xce40: - return turbofront_check8(1,2*8); - - case 0xce60: - return turbofront_check8(1,3*8); - - case 0xce80: - return turbofront_check8(1,4*8); - - case 0xcea0: - return turbofront_check8(1,5*8); - - case 0xcee0: - return (turbofront_check8(1,6*8) << 0) | (turbofront_check8(1,6*8) << 4) | (turbofront_check8(1,6*8+1) << 1) | (turbofront_check8(1,6*8+1) << 5); - } - - return common_read(0xc000, address, 0x01, 0x04, 1); -} - -static UINT8 __fastcall ikaria_main_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - switch (address) - { - case 0xce00: - return turbofront_check8(1,0*8); - - case 0xce20: - return turbofront_check8(1,1*8); - - case 0xce40: - return turbofront_check8(1,2*8); - - case 0xce60: - return turbofront_check8(1,3*8); - - case 0xce80: - return turbofront_check8(1,4*8); - - case 0xcea0: - return turbofront_check8(1,5*8); - - case 0xcee0: - return (turbofront_check8(1,6*8) << 0) | (turbofront_check8(1,6*8) << 4) | (turbofront_check8(1,6*8+1) << 1) | (turbofront_check8(1,6*8+1) << 5); - } - - return common_read(0xc000, address, 0x20, 0x04, 1); -} - -static void __fastcall ikari_sub_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("W C%d, A: %4.4x, D: %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xc000: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xc980: - txt_palette_offset = ((data & 0x01) << 4); - txt_tile_offset = ((data & 0x10) << 4); - return; - - case 0xcc00: - tc16_posy = (tc16_posy & ~0xff) | data; - return; - - case 0xcc80: - tc16_posx = (tc16_posx & ~0xff) | data; - return; - - case 0xcd80: - { - tc16_posx = (tc16_posx & 0xff) | ((data & 0x80) << 1); - tc16_posy = (tc16_posy & 0xff) | ((data & 0x40) << 2); - } - return; - } -} - -static UINT8 __fastcall ikari_sub_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - switch (address) - { - case 0xc000: - return nmi_trigger_read(); - - case 0xce00: - return turbofront_check8(1,0*8); - - case 0xce20: - return turbofront_check8(1,1*8); - - case 0xce40: - return turbofront_check8(1,2*8); - - case 0xce60: - return turbofront_check8(1,3*8); - - case 0xce80: - return turbofront_check8(1,4*8); - - case 0xcea0: - return turbofront_check8(1,5*8); - - case 0xcee0: - return (turbofront_check8(1,6*8) << 0) | (turbofront_check8(1,6*8) << 4) | (turbofront_check8(1,6*8+1) << 1) | (turbofront_check8(1,6*8+1) << 5); - } - - return 0; -} - -static void __fastcall tdfever_ab_write(UINT16 address, UINT8 data) -{ -// bprintf (0, _T("W C%d, A: %4.4x, D: %2.2x\n"), ZetGetActive(), address, data); - - switch (address) - { - case 0xc500: - { - soundlatch = data; - ZetClose(); - ZetOpen(2); - sndirq_update_callback(CMDIRQ_BUSY_ASSERT); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xc600: - return; // coin counter - - case 0xc000: - case 0xc700: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0xc800: - bg_scrolly = (bg_scrolly & 0x100) | data; - return; - - case 0xc840: - bg_scrollx = (bg_scrollx & 0x100) | data; - return; - - case 0xc880: - flipscreen = data & 0x10; - bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); - bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x01) << 8); - return; - - case 0xc8c0: - txt_palette_offset = ((data & 0xf) << 4); - txt_tile_offset = ((data & 0x30) << 4); - return; - - case 0xc900: - sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x80) << 1); - sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x40) << 2); - return; - - case 0xc980: - sp32_scrolly = (sp32_scrolly & 0x100) | data; - return; - - case 0xc9c0: - sp32_scrollx = (sp32_scrollx & 0x100) | data; - return; - } -} - -static UINT8 __fastcall tdfever_main_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - switch (address) - { - case 0xc000: - return (DrvInputs[0] & ~0x08) | ((sound_status & 0x04) ? 0x08 : 0); - - case 0xc080: return DrvInputs[0]; - case 0xc100: return DrvInputs[1]; - case 0xc180: return DrvInputs[2]; - case 0xc200: return DrvInputs[3]; - case 0xc280: return DrvInputs[4]; - case 0xc300: return DrvInputs[5]; - case 0xc380: - case 0xc400: - case 0xc480: - return 0xff; // inputs... - - case 0xc580: - return DrvDips[0]; - - case 0xc600: - return DrvDips[1]; - - case 0xc700: - return nmi_trigger_read(); - } - - return 0; -} - -static UINT8 __fastcall tdfever_sub_read(UINT16 address) -{ -// bprintf (0, _T("%d R: %4.4x\n"), ZetGetActive(), address); - - switch (address) - { - case 0xc000: - case 0xc700: - return nmi_trigger_read(); - } - - return 0; -} - - - -static void __fastcall ym3526_y8950_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe800: - BurnYM3526Write(0, data); - return; - - case 0xec00: - BurnYM3526Write(1, data); - return; - - case 0xf000: - BurnY8950Write(0, 0, data); - return; - - case 0xf400: - BurnY8950Write(0, 1, data); - return; - - case 0xf800: - { - if (~data & 0x10) sndirq_update_callback(YM1IRQ_CLEAR); - if (~data & 0x20) sndirq_update_callback(YM2IRQ_CLEAR); - if (~data & 0x40) sndirq_update_callback(BUSY_CLEAR); - if (~data & 0x80) sndirq_update_callback(CMDIRQ_CLEAR); - } - return; - } -} - -static UINT8 __fastcall ym3526_y8950_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - return soundlatch; - - case 0xe800: - return BurnYM3526Read(0); - - case 0xf000: - return BurnY8950Read(0, 0); - - case 0xf800: - return sound_status; - } - - return 0; -} - -static void __fastcall ym3526_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - BurnYM3526Write(0, data); - return; - - case 0xe001: - BurnYM3526Write(1, data); - return; - } -} - -static UINT8 __fastcall ym3526_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return soundlatch; - - case 0xc000: - soundlatch = 0; - sndirq_update_callback(BUSY_CLEAR); - return 0xff; - - case 0xe000: - case 0xe001: - return BurnYM3526Read(0); - - case 0xe004: - sndirq_update_callback(CMDIRQ_CLEAR); - return 0xff; - - case 0xe006: - sndirq_update_callback(YM1IRQ_CLEAR); - return 0xff; - } - - return 0; -} - -static void __fastcall aso_ym3526_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - BurnYM3526Write(0, data); - return; - - case 0xf001: - BurnYM3526Write(1, data); - return; - } -} - -static UINT8 __fastcall aso_ym3526_sound_read(UINT16 address) -{ - switch (address) - { - case 0xd000: - return soundlatch; - - case 0xe000: - sndirq_update_callback(BUSY_CLEAR); - soundlatch = 0; - return 0xff; - - case 0xf000: - case 0xf001: - return BurnYM3526Read(0); - - case 0xf004: - sndirq_update_callback(CMDIRQ_CLEAR); - return 0xff; - - case 0xf006: - sndirq_update_callback(YM1IRQ_CLEAR); - return 0xff; - } - - return 0; -} - -static void __fastcall marvins_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8000: - case 0x8001: - case 0x8008: - case 0x8009: - AY8910Write((address >> 3) & 1, address & 1, data); - return; - - case 0x8002: - case 0x8003: - case 0x8004: - case 0x8005: - case 0x8006: - case 0x8007: - snkwave_w(address - 0x8002, data); - return; - } -} - -static UINT8 __fastcall marvins_sound_read(UINT16 address) -{ - switch (address) - { - case 0x4000: - sound_status = 0; - //ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - - case 0xa000: - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return 0xff; - } - - return 0; -} - -static void __fastcall jcross_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - case 0xe001: - case 0xe004: - case 0xe005: - AY8910Write((address >> 2) & 1, address & 1, data); - return; - - case 0xe008: - case 0xe009: - if (hal21mode) { - AY8910Write(1, address & 1, data); - } - return; - } -} - -static UINT8 __fastcall jcross_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - sgladiat_sndirq_update_callback(BUSY_CLEAR); - return soundlatch; - - case 0xc000: - sgladiat_sndirq_update_callback(CMDIRQ_CLEAR); - return 0xff; - } - - return 0; -} - -static UINT8 __fastcall jcross_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return 0xff; - } - - return 0; -} - -static void __fastcall ym3812_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe800: - BurnYM3812Write(0, 0, data); - return; - - case 0xec00: - BurnYM3812Write(0, 1, data); - return; - - case 0xf800: - if (~data & 0x10) sndirq_update_callback(YM1IRQ_CLEAR); - if (~data & 0x20) sndirq_update_callback(YM2IRQ_CLEAR); - if (~data & 0x40) sndirq_update_callback(BUSY_CLEAR); - if (~data & 0x80) sndirq_update_callback(CMDIRQ_CLEAR); - return; - } -} - -static UINT8 __fastcall ym3812_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - return soundlatch; - - case 0xe800: - return BurnYM3812Read(0, 0); - - case 0xf800: - return sound_status; - } - - return 0; -} - - -static void __fastcall ym3812_y8950_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe800: - BurnYM3812Write(0, 0, data); - return; - - case 0xec00: - BurnYM3812Write(0, 1, data); - return; - - case 0xf000: - BurnY8950Write(0, 0, data); - return; - - case 0xf400: - BurnY8950Write(0, 1, data); - return; - - case 0xf800: - { - if (~data & 0x10) sndirq_update_callback(YM1IRQ_CLEAR); - if (~data & 0x20) sndirq_update_callback(YM2IRQ_CLEAR); - if (~data & 0x40) sndirq_update_callback(BUSY_CLEAR); - if (~data & 0x80) sndirq_update_callback(CMDIRQ_CLEAR); - } - return; - } -} - -static UINT8 __fastcall ym3812_y8950_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - return soundlatch; - - case 0xe800: - return BurnYM3812Read(0, 0); - - case 0xf000: - return BurnY8950Read(0, 0); - - case 0xf800: - return sound_status; - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - INT32 nActive = ZetGetActive(); - - if (nActive != 2) { - ZetClose(); - ZetOpen(2); - } - - sndirq_update_callback((nActive == 2) ? YM2IRQ_ASSERT : YM1IRQ_ASSERT); - - if (nActive != 2) { - ZetClose(); - ZetOpen(nActive); - } - } -} - -static void DrvFMIRQHandler_CB1(INT32, INT32 nStatus) -{ - if (nStatus) { - INT32 nActive = ZetGetActive(); - - if (nActive != 2) { - ZetClose(); - ZetOpen(2); - } - - sndirq_update_callback(YM1IRQ_ASSERT); - - if (nActive != 2) { - ZetClose(); - ZetOpen(nActive); - } - } -} - -static void DrvFMIRQHandler_CB2(INT32, INT32 nStatus) -{ - if (nStatus) { - INT32 nActive = ZetGetActive(); - - if (nActive != 2) { - ZetClose(); - ZetOpen(2); - } - - sndirq_update_callback(YM2IRQ_ASSERT); - - if (nActive != 2) { - ZetClose(); - ZetOpen(nActive); - } - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - INT32 nActive = ZetGetActive(), nCycles = 0; - if (nActive != 2) { - ZetClose(); - ZetOpen(2); - nCycles = ZetTotalCycles(); - ZetClose(); - ZetOpen(nActive); - } else { - nCycles = ZetTotalCycles(); - } - - return (INT64)nCycles * nSoundRate / 4000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - ZetOpen(2); - ZetReset(); - if (game_select == 5) { - AY8910Reset(0); - AY8910Reset(1); - } else if (game_select == 7) { - BurnYM3812Reset(); - } else if (game_select == 9) { - BurnY8950Reset(); - BurnYM3812Reset(); - } else { - BurnYM3526Reset(); - if (game_select != 4) BurnY8950Reset(); - } - ZetClose(); - - snkwave_reset(); // can be run on reset for all games, no big deal. - - HiscoreReset(); - - sound_status = 0; - soundlatch = 0; - flipscreen = 0; - sp16_scrolly = 0; - sp16_scrollx = 0; - sp32_scrolly = 0; - sp32_scrollx = 0; - bg_scrollx = 0; - bg_scrolly = 0; - fg_scrollx = 0; - fg_scrolly = 0; - txt_palette_offset = 0; - txt_tile_offset = 0; - bg_palette_offset = 0; - bg_tile_offset = 0; - sprite_split_point = 0; - tc16_posy = 0; - tc16_posx = 0; - tc32_posy = 0; - tc32_posx = 0; - - RotateReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - DrvZ80ROM2 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x080000 + 0x100; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x100000; - DrvGfxROM4 = Next; Next += 0x004000; - - DrvSndROM0 = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000c00; - - DrvTransTab = Next; Next += 0x000400; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvFgVRAM = Next; Next += 0x000800; - DrvBgVRAM = Next; Next += 0x002000; - DrvShareRAM = Next; Next += 0x001800; - DrvSprRAM = Next; Next += 0x001800; - DrvTxtRAM = Next; Next += 0x000800; - DrvZ80RAM2 = Next; Next += 0x001000; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(INT32 gfx, INT32 nType, UINT8 *src, INT32 nLen) -{ - if (nLen == 0) { - DrvGfxMask[gfx] = 0; - return 1; - } - - INT32 Plane0[4] = { STEP4(0,1) }; - INT32 Plane1[4] = { (nLen/4)*8*3, (nLen/4)*8*2, (nLen/4)*8*1, (nLen/4)*8*0 }; - INT32 Plane2[3] = { (nLen/3)*8*2, (nLen/3)*8*1, (nLen/3)*8*0 }; - INT32 XOffs1[16] = { 4*1, 4*0, 4*3, 4*2, 4*5, 4*4, 4*7, 4*6, 32+4*1, 32+4*0, 32+4*3, 32+4*2, 32+4*5, 32+4*4, 32+4*7, 32+4*6 }; - INT32 XOffs2[16] = { STEP8(8,1), STEP8(0,1) }; - INT32 XOffs3[32] = { STEP8(24,1), STEP8(16,1), STEP8(8,1), STEP8(0,1) }; - INT32 XOffs4[32] = { STEP8(7,-1), STEP8(15,-1), STEP8(23,-1), STEP8(31,-1) }; - INT32 YOffs1[32] = { STEP8(0,32), STEP8(256,32), STEP8(512,32), STEP8(768,32) }; - INT32 YOffs2[16] = { STEP16(0,16) }; - INT32 YOffs3[16] = { STEP16(0,64) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(nLen); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, src, nLen); - - switch (nType) - { - case 0: // charlayout - GfxDecode(((nLen * 8) / 4)/( 8 * 8), 4, 8, 8, Plane0, XOffs1, YOffs1, 0x100, tmp, src); - DrvGfxMask[gfx] = ((nLen * 2) / (8 * 8)); - break; - - case 1: // tilelayout - GfxDecode(((nLen * 8) / 4)/(16 * 16), 4, 16, 16, Plane0, XOffs1, YOffs3, 0x400, tmp, src); - DrvGfxMask[gfx] = ((nLen * 2) / (16 * 16)); - break; - - case 2: // spritelayout 4 bpp - GfxDecode(((nLen * 8) / 4)/(16 * 16), 4, 16, 16, Plane1, XOffs2, YOffs2, 0x100, tmp, src); - DrvGfxMask[gfx] = ((nLen * 2) / (16 * 16)); - break; - - case 3: // bigspritelayout 4 bpp - GfxDecode(((nLen * 8) / 4)/(32 * 32), 4, 32, 32, Plane1, XOffs3, YOffs1, 0x400, tmp, src); - DrvGfxMask[gfx] = ((nLen * 2) / (32 * 32)); - break; - - case 4: // spritelayout 3bpp - GfxDecode(((nLen * 8) / 3)/(16 * 16), 3, 16, 16, Plane2, XOffs4, YOffs2, 0x100, tmp, src); - DrvGfxMask[gfx] = (((nLen * 8) / 3) / (16 * 16)); - break; - - case 5: // bigspritelayout 3bpp - GfxDecode(((nLen * 8 )/ 3)/(32 * 32), 3, 32, 32, Plane2, XOffs4, YOffs1, 0x400, tmp, src); - DrvGfxMask[gfx] = (((nLen * 8) / 3) / (32 * 32)); - break; - } - - BurnFree(tmp); - - for (UINT32 i = 1; i <= 0x1000000; i<<=1) { - if (i >= (UINT32)DrvGfxMask[gfx]) { - DrvGfxMask[gfx] = i-1; - break; - } - } - - if (nType == 1) memset (src + ((DrvGfxMask[gfx]+1) * 16 * 16), 0xf, 16 * 16); // empty tile for background - - return 0; -} - - -static INT32 DrvRomLoad() -{ - char* pRomName; - struct BurnRomInfo ri; - - UINT8 *prog[3] = { DrvZ80ROM0, DrvZ80ROM1, DrvZ80ROM2 }; - UINT8 *gfx[5] = { DrvGfxROM0, DrvGfxROM1, DrvGfxROM2, DrvGfxROM3, DrvGfxROM4 }; - INT32 gfxtype[5] = {0,0,0,0,0}; - UINT8 *col = DrvColPROM; - UINT8 *snd = DrvSndROM0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) - { - BurnDrvGetRomInfo(&ri, i); - if ((ri.nType & 0xf) == 0) continue; - - if ((ri.nType & 0xf) < 4) { // program roms - if (BurnLoadRom(prog[(ri.nType&0xf)-1], i, 1)) return 1; - prog[(ri.nType&0xf)-1] += ri.nLen; - continue; - } - - if ((ri.nType & 0xf) == 4) { // txt - if (BurnLoadRom(gfx[(ri.nType&0xf)-4], i, 1)) return 1; - gfx[(ri.nType&0xf)-4] += ri.nLen; - continue; - } - - if ((ri.nType & 0xf) == 5 || (ri.nType & 0xf) == 6) { // bg layer - if (BurnLoadRom(gfx[1], i, 1)) return 1; - gfx[1] += ri.nLen; - gfxtype[1] = ((ri.nType&0xf)-5) ^ 1; // 1,0 - continue; - } - - if ((ri.nType & 0xf) == 7 || (ri.nType & 0xf) == 9) { // 16x16 4 bpp sprite / 3 bpp sprite - if (BurnLoadRom(gfx[2], i, 1)) return 1; - gfx[2] += ri.nLen; - gfxtype[2] = ((ri.nType & 0xf) == 7) ? 2 : 4; - continue; - } - - if ((ri.nType & 0xf) == 8 || (ri.nType & 0xf) == 10) { // 32x32 4 bpp sprite / 3 bpp sprite - if (BurnLoadRom(gfx[3], i, 1)) return 1; - gfx[3] += ri.nLen; - gfxtype[3] = ((ri.nType & 0xf) == 8) ? 3 : 5; - continue; - } - - if ((ri.nType & 0xf) == 13) { // foreground tiles - if (BurnLoadRom(gfx[4], i, 1)) return 1; - gfx[4] += ri.nLen; - continue; - } - - if ((ri.nType & 0xf) == 14) { // color data - if (BurnLoadRom(col, i, 1)) return 1; - col += ri.nLen; - continue; - } - - if ((ri.nType & 0xf) == 15) { // samples - if (BurnLoadRom(snd, i, 1)) return 1; - snd += ri.nLen; - continue; - } - } - - DrvGfxDecode(0, gfxtype[0], DrvGfxROM0, gfx[0] - DrvGfxROM0); - DrvGfxDecode(1, gfxtype[1], DrvGfxROM1, gfx[1] - DrvGfxROM1); - DrvGfxDecode(2, gfxtype[2], DrvGfxROM2, gfx[2] - DrvGfxROM2); - DrvGfxDecode(3, gfxtype[3], DrvGfxROM3, gfx[3] - DrvGfxROM3); - DrvGfxDecode(4, gfxtype[4], DrvGfxROM4, gfx[4] - DrvGfxROM4); - nSampleLen = snd - DrvSndROM0; - - return 0; -} - -static INT32 PsychosInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(bermudat_main_write); - ZetSetReadHandler(bermudat_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(bermudat_sub_write); - ZetSetReadHandler(bermudat_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3526_y8950_sound_write); - ZetSetReadHandler(ym3526_y8950_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, DrvSndROM0, nSampleLen, NULL, 0,&DrvFMIRQHandler, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 1; - - bonus_dip_config = 0x3004; - - DrvDoReset(); - - return 0; -} - -static INT32 BermudatInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(bermudat_main_write); - ZetSetReadHandler(bermudat_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(bermudat_sub_write); - ZetSetReadHandler(bermudat_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3526_y8950_sound_write); - ZetSetReadHandler(ym3526_y8950_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, DrvSndROM0, nSampleLen, NULL, 0,&DrvFMIRQHandler_CB2, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - bonus_dip_config = 0x3004; - game_select = 2; - game_rotates = 1; - - RotateSetGunPosRAM(&DrvSprRAM[0x041], &DrvSprRAM[0x055], 1); - - DrvDoReset(); - - return 0; -} - -static INT32 GwarInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(gwar_main_write); - ZetSetReadHandler(bermudat_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(gwar_sub_write); - ZetSetReadHandler(gwar_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3526_y8950_sound_write); - ZetSetReadHandler(ym3526_y8950_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, DrvSndROM0, nSampleLen, NULL, 0, &DrvFMIRQHandler_CB2, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 3; - game_rotates = 1; - bonus_dip_config = 0x3004; - - RotateSetGunPosRAM(&DrvSprRAM[0x3d3], &DrvSprRAM[0x437], 2); - - DrvDoReset(); - - return 0; -} - -static INT32 GwarbInit() -{ - INT32 rc = GwarInit(); - - game_rotates = 0; - - return rc; -} - -static INT32 GwaraInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvTxtRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(gwar_main_write); - ZetSetReadHandler(bermudat_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvTxtRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(gwar_sub_write); - ZetSetReadHandler(gwar_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3526_y8950_sound_write); - ZetSetReadHandler(ym3526_y8950_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, DrvSndROM0, nSampleLen, NULL, 0,&DrvFMIRQHandler_CB2, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 3; - game_rotates = 1; - bonus_dip_config = 0x3004; - - DrvDoReset(); - - return 0; -} - -static INT32 Tnk3Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd800, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(tnk3_main_write); - ZetSetReadHandler(tnk3_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xefff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xf000, 0xf7ff, MAP_RAM); // not really shared - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(tnk3_sub_write); - ZetSetReadHandler(tnk3_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(ym3526_sound_write); - ZetSetReadHandler(ym3526_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 4; - game_rotates = 1; - bonus_dip_config = 0x01c0; - - RotateSetGunPosRAM(&DrvTxtRAM[0x547], &DrvTxtRAM[0x58d], 2); // TNK3 - - DrvDoReset(); - - return 0; -} - -static INT32 AsoInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - // swap sprite halves - { - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - memcpy (tmp, DrvGfxROM2, 0x20000); - memcpy (DrvGfxROM2, DrvGfxROM2 + 0x20000, 0x20000); - memcpy (DrvGfxROM2 + 0x20000, tmp, 0x20000); - BurnFree (tmp); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xe800, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(aso_main_write); - ZetSetReadHandler(tnk3_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd800, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(tnk3_sub_write); - ZetSetReadHandler(tnk3_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(aso_ym3526_sound_write); - ZetSetReadHandler(aso_ym3526_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 4; - bonus_dip_config = 0x01c0; - - DrvDoReset(); - - return 0; -} - -static INT32 AlphamisInit() -{ - INT32 nRet = AsoInit(); - - bonus_dip_config = 0x0100; - - return nRet; -} - -static INT32 AthenaInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd800, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(tnk3_main_write); - ZetSetReadHandler(athena_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xefff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xf000, 0xf7ff, MAP_RAM); // not really shared - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(tnk3_sub_write); - ZetSetReadHandler(tnk3_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3526_y8950_sound_write); - ZetSetReadHandler(ym3526_y8950_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, NULL, 0, NULL, 0,&DrvFMIRQHandler_CB2, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 6; - bonus_dip_config = 0x3004; - - DrvDoReset(); - - return 0; -} - -static INT32 MarvinsInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvFgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM+0x800, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(marvins_ab_write); - ZetSetReadHandler(marvins_ab_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvFgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM+0x800, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(marvins_ab_write); - ZetSetReadHandler(marvins_ab_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xe000, 0xe7ff, MAP_RAM); - ZetSetWriteHandler(marvins_sound_write); - ZetSetReadHandler(marvins_sound_read); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - - snkwave_volume = 0.50; - - GenericTilesInit(); - - game_select = 5; - bonus_dip_config = 0; - - DrvDoReset(); - - return 0; -} - -static INT32 MadcrashInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvFgVRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM+0x800, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(madcrash_main_write); - ZetSetReadHandler(marvins_ab_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvFgVRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM+0x800, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(madcrash_sub_write); - ZetSetReadHandler(marvins_ab_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xe000, 0xe7ff, MAP_RAM); - ZetSetWriteHandler(marvins_sound_write); - ZetSetReadHandler(marvins_sound_read); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - - snkwave_volume = 0.30; // for vangrd2 - - GenericTilesInit(); - - game_select = 5; - bonus_dip_config = 0; - - DrvDoReset(); - - return 0; -} - -static INT32 MadcrushInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvFgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM+0x800, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(madcrush_ab_write); - ZetSetReadHandler(marvins_ab_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvFgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM+0x800, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(madcrush_ab_write); - ZetSetReadHandler(marvins_ab_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xe000, 0xe7ff, MAP_RAM); - ZetSetWriteHandler(marvins_sound_write); - ZetSetReadHandler(marvins_sound_read); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.35, BURN_SND_ROUTE_BOTH); - - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.35, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 5; - bonus_dip_config = 0; - - DrvDoReset(); - - return 0; -} - -static INT32 JcrossInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(jcross_main_write); - ZetSetReadHandler(jcross_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xc800, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetSetWriteHandler(jcross_main_write); - ZetSetReadHandler(jcross_main_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(jcross_sound_write); - ZetSetReadHandler(jcross_sound_read); - ZetSetInHandler(jcross_sound_read_port); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - video_sprite_number = 25; - game_select = 5; - bonus_dip_config = 0x01c0; - - DrvDoReset(); - - return 0; -} - -static INT32 SgladiatInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(jcross_main_write); - ZetSetReadHandler(jcross_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xc800, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetSetWriteHandler(sgladiat_sub_write); - ZetSetReadHandler(jcross_main_read); // ? - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(jcross_sound_write); - ZetSetReadHandler(jcross_sound_read); - ZetSetInHandler(jcross_sound_read_port); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.35, BURN_SND_ROUTE_BOTH); - - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.35, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - video_sprite_number = 25; - video_y_scroll_mask = 0xff; - bonus_dip_config = 0x01c0; - game_select = 5; - - DrvDoReset(); - - return 0; -} - -static INT32 Hal21Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xe800, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(hal21_main_write); - ZetSetReadHandler(hal21_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xe800, 0xefff, MAP_RAM); - ZetSetWriteHandler(hal21_sub_write); // no reads, only write - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(jcross_sound_write); - ZetSetReadHandler(jcross_sound_read); - ZetClose(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - video_sprite_number = 50; - video_y_scroll_mask = 0x1ff; - bonus_dip_config = 0x01c0; - game_select = 5; - hal21mode = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 FitegolfInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd800, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(tnk3_main_write); - ZetSetReadHandler(fitegolf_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xefff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xf000, 0xf7ff, MAP_RAM); // not really shared - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(tnk3_sub_write); - ZetSetReadHandler(tnk3_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3812_sound_write); - ZetSetReadHandler(ym3812_sound_read); - ZetClose(); - - BurnYM3812Init(1, 4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 7; - bonus_dip_config = 0; - - DrvDoReset(); - - return 0; -} - -static INT32 IkariCommonInit(INT32 game) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(ikari_main_write); - ZetSetReadHandler((game == 1) ? ikaria_main_read : ikari_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(ikari_sub_write); - ZetSetReadHandler(ikari_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3526_y8950_sound_write); - ZetSetReadHandler(ym3526_y8950_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, NULL, 0, NULL, 0,&DrvFMIRQHandler_CB2, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 6; - game_rotates = 1; - bonus_dip_config = 0x3004; - - DrvDoReset(); - - return 0; -} - -static INT32 IkariInit() { - INT32 rc = IkariCommonInit(0); - - RotateSetGunPosRAM(&DrvTxtRAM[0x5b6], &DrvTxtRAM[0x606], 2); - - return rc; -} - -static INT32 IkariaInit() { - INT32 rc = IkariCommonInit(1); - - RotateSetGunPosRAM(&DrvTxtRAM[0x5b6], &DrvTxtRAM[0x606], 2); - - return rc; -} - -static INT32 IkarijoyInit() { ikarijoy = 1; return IkariCommonInit(1); } - -static INT32 VictroadInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(ikari_main_write); - ZetSetReadHandler(ikari_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgVRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(ikari_sub_write); - ZetSetReadHandler(ikari_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3526_y8950_sound_write); - ZetSetReadHandler(ym3526_y8950_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, DrvSndROM0, nSampleLen, NULL, 0,&DrvFMIRQHandler_CB2, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 6; - bonus_dip_config = 0x3004; - game_rotates = 1; - - RotateSetGunPosRAM(&DrvTxtRAM[0x5b6], &DrvTxtRAM[0x606], 2); - - DrvDoReset(); - - return 0; -} - -static INT32 Chopper1Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(bermudat_main_write); - ZetSetReadHandler(bermudat_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(gwar_sub_write); - ZetSetReadHandler(gwar_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3812_y8950_sound_write); - ZetSetReadHandler(ym3812_y8950_sound_read); - ZetClose(); - - BurnYM3812Init(1, 4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.80, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, DrvSndROM0, nSampleLen, NULL, 0, &DrvFMIRQHandler_CB2, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - bonus_dip_config = 0x3004; - game_select = 9; - - DrvDoReset(); - - return 0; -} - -static INT32 ChopperaInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(gwar_main_write); - ZetSetReadHandler(bermudat_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(gwar_sub_write); - ZetSetReadHandler(gwar_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3812_y8950_sound_write); - ZetSetReadHandler(ym3812_y8950_sound_read); - ZetClose(); - - BurnYM3812Init(1, 4000000, &DrvFMIRQHandler_CB1, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.80, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, DrvSndROM0, nSampleLen, NULL, 0, &DrvFMIRQHandler_CB2, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - bonus_dip_config = 0x3004; - game_select = 9; - - DrvDoReset(); - - return 0; -} - -static INT32 TdfeverInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRomLoad()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(tdfever_ab_write); - ZetSetReadHandler(tdfever_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvBgVRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvTxtRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(tdfever_ab_write); - ZetSetReadHandler(tdfever_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xcfff, MAP_RAM); - ZetSetWriteHandler(ym3526_y8950_sound_write); - ZetSetReadHandler(ym3526_y8950_sound_read); - ZetClose(); - - BurnYM3526Init(4000000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - BurnY8950Init(1, 4000000, DrvSndROM0, nSampleLen, NULL, 0,&DrvFMIRQHandler, &DrvSynchroniseStream, 1); - BurnTimerAttachZetY8950(4000000); - BurnY8950SetRoute(0, BURN_SND_Y8950_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - game_select = 3; - game_rotates = 1; - bonus_dip_config = 0; - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - if (game_select == 5) - { - AY8910Exit(0); - AY8910Exit(1); - } else if (game_select == 7) { - BurnYM3812Exit(); - } else if (game_select == 9) { - BurnYM3812Exit(); - BurnY8950Exit(); - } else { - BurnYM3526Exit(); - if (game_select != 4) BurnY8950Exit(); - } - - BurnFree(AllMem); - - for (INT32 i = 0; i < 5; i++) DrvGfxMask[i] = ~0; - - video_y_scroll_mask = 0x1ff; - video_sprite_number = 50; - game_select = 0; - bonus_dip_config = 0; - game_rotates = 0; - hal21mode = 0; - nSampleLen = 0; - ikarijoy = 0; - - rotate_gunpos[0] = rotate_gunpos[1] = NULL; - - return 0; -} - -static void tnk3PaletteInit() -{ - INT32 len = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < len; i++) - { - INT32 bit0 = (DrvColPROM[i + len * 2] >> 3) & 0x01; - INT32 bit1 = (DrvColPROM[i + len * 0] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i + len * 0] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i + len * 0] >> 3) & 0x01; - - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + len * 2] >> 2) & 0x01; - bit1 = (DrvColPROM[i + len * 1] >> 2) & 0x01; - bit2 = (DrvColPROM[i + len * 1] >> 3) & 0x01; - bit3 = (DrvColPROM[i + len * 0] >> 0) & 0x01; - - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + len * 2] >> 0) & 0x01; - bit1 = (DrvColPROM[i + len * 2] >> 1) & 0x01; - bit2 = (DrvColPROM[i + len * 1] >> 0) & 0x01; - bit3 = (DrvColPROM[i + len * 1] >> 1) & 0x01; - - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void DrvPaletteInit() -{ - INT32 len = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < len; i++) - { - INT32 bit0 = (DrvColPROM[i + len * 0] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i + len * 0] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i + len * 0] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i + len * 0] >> 3) & 0x01; - - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + len * 1] >> 0) & 0x01; - bit1 = (DrvColPROM[i + len * 1] >> 1) & 0x01; - bit2 = (DrvColPROM[i + len * 1] >> 2) & 0x01; - bit3 = (DrvColPROM[i + len * 1] >> 3) & 0x01; - - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + len * 2] >> 0) & 0x01; - bit1 = (DrvColPROM[i + len * 2] >> 1) & 0x01; - bit2 = (DrvColPROM[i + len * 2] >> 2) & 0x01; - bit3 = (DrvColPROM[i + len * 2] >> 3) & 0x01; - - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void marvins_draw_layer_tx(INT32 ) -{ - for (INT32 offs = 0; offs < 36 * 28; offs++) - { - INT32 col = offs % 36; // sx - INT32 row = offs / 36; // sy - - INT32 sx = (col * 8);// - tx_position_x; - INT32 sy = (row * 8);// - tx_position_y; - - INT32 ofst = (col - 2); - - if (ofst & 0x20) { - ofst = 0x400 + row + ((ofst & 0x1f) << 5); - } else { - ofst = row + (ofst << 5); - } - - INT32 code = DrvTxtRAM[ofst] | txt_tile_offset; - INT32 color = (code >> 5) & 0x07; - - if (ofst & 0x400) { // correct?? - Render8x8Tile_Clip(pTransDraw, code & DrvGfxMask[0], sx, sy, color+0x18, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code & DrvGfxMask[0], sx, sy, color+0x18, 4, 0xf, 0, DrvGfxROM0); - } - } -} - -static void ikari_draw_layer_tx(INT32 ) -{ - for (INT32 offs = 0; offs < 36 * 28; offs++) - { - INT32 col = offs % 36; // sx - INT32 row = offs / 36; // sy - - INT32 sx = (col * 8);// - tx_position_x; - INT32 sy = (row * 8);// - tx_position_y; - - INT32 ofst = (col - 2); - - if (ofst & 0x20) { - ofst = 0x400 + row + ((ofst & 0x1f) << 5); - } else { - ofst = row + (ofst << 5); - } - - INT32 code = DrvTxtRAM[ofst] | txt_tile_offset; - - if (ofst & 0x400) { // correct?? - Render8x8Tile_Clip(pTransDraw, code & DrvGfxMask[0], sx, sy, 0, 4, txt_palette_offset+0x180, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code & DrvGfxMask[0], sx, sy, 0, 4, 0xf, txt_palette_offset+0x180, DrvGfxROM0); - } - } -} - -static void gwar_draw_layer_tx(INT32 ) -{ - for (INT32 offs = 0; offs < 50 * 32; offs++) - { - INT32 sy = (offs % 32) * 8; - INT32 sx = (offs / 32) * 8; - - INT32 code = DrvTxtRAM[offs] + txt_tile_offset; - - Render8x8Tile_Mask_Clip(pTransDraw, code & DrvGfxMask[0], sx, sy, 0, 4, 0xf, txt_palette_offset, DrvGfxROM0); - } -} - -static void marvins_draw_layer(UINT8 *ram, UINT8 *gfx, INT32 scrollx, INT32 scrolly, INT32 color_offset, INT32 transparent) -{ - scrollx &= 0x1ff; - scrolly &= 0x0ff; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = ((offs / 32) & 0x3f) * 8; - INT32 sy = (offs & 0x1f) * 8; - - INT32 code = ram[offs]; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - sx += 15; // offset -dink - - if (transparent) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 4, 0xf, color_offset, gfx); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, 0, 4, color_offset, gfx); - } - } -} - -static void gwar_draw_layer_bg(INT32 color_offset,INT32 xoffset, INT32 yoffset) -{ - INT32 scrolly = (bg_scrolly - yoffset) & 0x1ff; - INT32 scrollx = (bg_scrollx - xoffset) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs % 32) * 16; - INT32 sx = (offs / 32) * 16; - - sy -= scrolly; - if (sy < -15) sy += 512; - sx -= scrollx; - if (sx < -15) sx += 512; - - INT32 attr = DrvBgVRAM[offs * 2 + 1]; - INT32 code = DrvBgVRAM[offs * 2 + 0] | ((attr & 0x0f) << 8); - INT32 color = attr >> 4; - - if (game_select == 1) color &= 0x07; // psychos! - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - if (code > (INT32)DrvGfxMask[1]) code = DrvGfxMask[1] + 1; - - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, color_offset+bg_palette_offset, DrvGfxROM1); - } -} - -static void ikari_draw_layer_bg(INT32 xoffset, INT32 yoffset) -{ - INT32 scrolly = (bg_scrolly - yoffset) & 0x1ff; - INT32 scrollx = (bg_scrollx - xoffset) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs % 32) * 16; - INT32 sx = (offs / 32) * 16; - - sy -= scrolly; - if (sy < -15) sy += 512; - sx -= scrollx; - if (sx < -15) sx += 512; - sx += 15; // offset -dink (yes, 15) - - INT32 attr = DrvBgVRAM[offs * 2 + 1]; - INT32 code = DrvBgVRAM[offs * 2 + 0] | ((attr & 0x03) << 8); - INT32 color = (attr >> 4) & 0x7; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - Render16x16Tile_Clip(pTransDraw, code & DrvGfxMask[1], sx, sy, color, 4, 0x100, DrvGfxROM1); - } -} - -static void aso_draw_layer_bg(INT32 xoffset,INT32 yoffset) -{ - INT32 height = (video_y_scroll_mask + 1) / 8; - INT32 scrolly = (bg_scrolly - yoffset) & video_y_scroll_mask; - INT32 scrollx = (bg_scrollx - xoffset) & 0x1ff; - - for (INT32 offs = 0; offs < 64 * height; offs++) - { - INT32 sy = (offs & (height-1)) * 8; - INT32 sx = (offs / height) * 8; - - sy -= scrolly; - if (sy < -7) sy += height*8; - sx -= scrollx; - if (sx < -7) sx += 512; - - sx += 16; - - INT32 code = DrvBgVRAM[offs] + bg_tile_offset; - - Render8x8Tile_Clip(pTransDraw, code & DrvGfxMask[1], sx, sy, 0, 4, bg_palette_offset+0x80, DrvGfxROM1); - } -} - -static void tnk3_draw_layer_bg(INT32 xoffset,INT32 yoffset) -{ - INT32 scrolly = (bg_scrolly - yoffset) & 0x1ff; - INT32 scrollx = (bg_scrollx - xoffset) & 0x1ff; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sy = (offs & 0x3f) * 8; - INT32 sx = (offs / 0x40) * 8; - - sy -= scrolly; - if (sy < -15) sy += 512; - sx -= scrollx; - if (sx < -15) sx += 512; - - sx += 15; // offset -dink - - INT32 attr = DrvBgVRAM[offs * 2 + 1]; - INT32 code = DrvBgVRAM[offs * 2 + 0] | ((attr & 0x30) << 4); - INT32 color = (attr & 0xf) ^ 8; // ?? - - Render8x8Tile_Clip(pTransDraw, code & DrvGfxMask[1], sx, sy, color+8, 4, 0, DrvGfxROM1); - } -} - -static void marvins_draw_sprites(INT32 scrollx, INT32 scrolly, INT32 from, INT32 to) -{ - const UINT8 *source = DrvSprRAM + from*4; - const UINT8 *finish = DrvSprRAM + to*4; - - while( source 512-16) sx -= 512; - if (sy > 256-16) sy -= 256; - - sy -= 8; // offset -dink - - { - color <<= 3; - - INT32 flip = ((flipx ? 0x0f : 0) | (flipy ? 0x0f : 0)); - UINT8 *gfxbase = DrvGfxROM2 + ((tile_number * 0x100) /*& DrvGfxMask[2]*/); // this mask causes the sprites to not animate in marvins & vanguard II - - for (INT32 y = 0; y < 16; y++) - { - if ((sy + y) < 0 || (sy + y) >= nScreenHeight) continue; - - for (INT32 x = 0; x < 16; x++) - { - if ((sx + x) < 0 || (sx + x) >= nScreenWidth) continue; - - INT32 pxl = gfxbase[((y*16)+x)^flip]; - - if (pxl == 0x7) continue; // transparent - - if (pxl == 0x6) { - pTransDraw[((sy + y) * nScreenWidth) + sx + x] |= 0x200; - } else { - pTransDraw[((sy + y) * nScreenWidth) + sx + x] = pxl + color; - } - } - } - } - - source+=4; - } -} - -static void tnk3_draw_sprites(const int xscroll, const int yscroll) -{ - UINT8 *spriteram = DrvSprRAM; - UINT8 *gfx = DrvGfxROM2; - const int size = 16; - int tile_number, attributes, color, sx, sy; - int xflip,yflip; - - for (INT32 offs = 0; offs < video_sprite_number*4; offs += 4) - { - tile_number = spriteram[offs+1]; - attributes = spriteram[offs+3]; - color = attributes & 0xf; - sx = xscroll + 301 - size - spriteram[offs+2]; - sy = -yscroll + 7 - size + spriteram[offs]; - sx += (attributes & 0x80) << 1; - sy += (attributes & 0x10) << 4; - xflip = 0; - yflip = 0; - - if (DrvGfxMask[2] > 256) // all except jcross - { - tile_number |= (attributes & 0x40) << 2; - } - - if (DrvGfxMask[2] > 512) // athena - { - tile_number |= (attributes & 0x20) << 4; - } - else // all others - { - yflip = attributes & 0x20; - } - - if (flipscreen) - { - sx = 89 - size - sx; // this causes slight misalignment in tnk3 but is correct for athena and fitegolf - sy = 262 - size - sy; - xflip = !xflip; - yflip = !yflip; - } - - sx &= 0x1ff; - sy &= video_y_scroll_mask; // sgladiat apparently has only 256 pixels of vertical scrolling range - if (sx > 512-size) sx -= 512; - if (sy > (video_y_scroll_mask+1)-size) sy -= (video_y_scroll_mask+1); - sy -= 8; // offset -dink - - { - UINT8 *gfxbase = gfx + ((tile_number & DrvGfxMask[2]) * size * size); - - INT32 flip = (yflip ? ((size-1)*size) : 0) | (xflip ? (size-1) : 0); - - color = (color << 3) + 0x000; - - for (INT32 y = 0; y < size; y++) { - if ((sy+y) < 0 || (sy+y) >= nScreenHeight) continue; - - for (INT32 x = 0; x < size; x++) { - if ((sx+x) < 0 || (sx+x) >= nScreenWidth) continue; - - INT32 pxl = gfxbase[((y*size)+x)^flip]; - if (pxl == 7) continue; - if (pxl == 6) pTransDraw[(sy+y)*nScreenWidth+(sx+x)] |= 0x200; - if (pxl <= 5) pTransDraw[(sy+y)*nScreenWidth+(sx+x)] = pxl + color; - } - } - } - } -} - -static void tdfever_draw_sprites(INT32 xscroll, INT32 yscroll, UINT8 *source, UINT8 *gfx, const int hw_xflip, const int from, const int to, INT32 color_offset) -{ - int size = (gfx == DrvGfxROM3) ? 32 : 16; - - INT32 mask = (gfx == DrvGfxROM3) ? DrvGfxMask[3] : DrvGfxMask[2]; - - for (INT32 which = from*4; which < to*4; which+=4) - { - int tile_number = source[which+1]; - int attributes = source[which+3]; - int color = attributes & 0x0f; - int sx = -xscroll - 9 + source[which+2]; - int sy = -yscroll + 1 - size + source[which]; - sx += (attributes & 0x80) << 1; - sy += (attributes & 0x10) << 4; - - switch (size) - { - case 16: - tile_number |= ((attributes & 0x08) << 5) | ((attributes & 0x60) << 4); - color &= 7; // attribute bit 3 is used for bank select - if (from == 0) - color |= 8; // low priority sprites use the other palette bank - break; - - case 32: - tile_number |= (attributes & 0x60) << 3; - break; - } - - int flipx = hw_xflip; - int flipy = 0; - - if (hw_xflip) - sx = 495 - size - sx; - - if (flipscreen) - { - sx = 495 - size - sx; - sy = 258 - size - sy; - flipx = !flipx; - flipy = !flipy; - } - - sx &= 0x1ff; - sy &= 0x1ff; - if (sx > 512-size) sx -= 512; - if (sy > 512-size) sy -= 512; - - - { - UINT8 *gfxbase = gfx + ((tile_number & mask) * size * size); - - INT32 flip = (flipy ? ((size-1)*size) : 0) | (flipx ? (size-1) : 0); - - color = (color << 4) + color_offset; - - for (INT32 y = 0; y < size; y++) { - if ((sy+y) < 0 || (sy+y) >= nScreenHeight) continue; - - for (INT32 x = 0; x < size; x++) { - if ((sx+x) < 0 || (sx+x) >= nScreenWidth) continue; - - INT32 pxl = gfxbase[((y*size)+x)^flip]; - if (pxl == 15) continue; - if (pxl == 14) { - if (pTransDraw[(sy+y)*nScreenWidth+(sx+x)] & 0x200) { - pTransDraw[(sy+y)*nScreenWidth+(sx+x)] += 0x100; - } else { - pTransDraw[(sy+y)*nScreenWidth+(sx+x)] = pxl + color; - } - } - if (pxl <= 13) pTransDraw[(sy+y)*nScreenWidth+(sx+x)] = pxl + color; - } - } - } - } -} - -static void ikari_draw_sprites(const int start, const int xscroll, const int yscroll, const UINT8 *source, UINT8 *gfx) -{ - int size = (gfx == DrvGfxROM3) ? 32 : 16; - INT32 color_offset = (gfx == DrvGfxROM3) ? 0x80 : 0; - INT32 mask = (gfx == DrvGfxROM3) ? DrvGfxMask[3] : DrvGfxMask[2]; - int tile_number, attributes, color, sx, sy; - int which, finish; -// int flipx = 0, flipy = 0; - - finish = (start+25)*4; - - for (which = start*4; which < finish; which += 4) - { - tile_number = source[which+1]; - attributes = source[which+3]; - color = attributes & 0xf; - sx = xscroll + 300 - size - source[which+2]; - sy = -yscroll + 7 - size + source[which]; - sx += (attributes & 0x80) << 1; - sy += (attributes & 0x10) << 4; - - switch (size) - { - case 16: - tile_number |= (attributes & 0x60) << 3; - break; - - case 32: - tile_number |= (attributes & 0x40) << 2; - break; - } - - sx &= 0x1ff; - sy &= 0x1ff; - if (sx > 512-size) sx -= 512; - if (sy > 512-size) sy -= 512; - sy -= 8; // offset -dink - - { - UINT8 *gfxbase = gfx + ((tile_number & mask) * size * size); - - INT32 flip = 0; //(yflip ? ((size-1)*size) : 0) | (xflip ? (size-1) : 0); - - color = (color << 3) + color_offset; - - for (INT32 y = 0; y < size; y++) { - if ((sy+y) < 0 || (sy+y) >= nScreenHeight) continue; - - for (INT32 x = 0; x < size; x++) { - if ((sx+x) < 0 || (sx+x) >= nScreenWidth) continue; - - INT32 pxl = gfxbase[((y*size)+x)^flip]; - if (pxl == 7) continue; - if (pxl == 6) pTransDraw[(sy+y)*nScreenWidth+(sx+x)] |= 0x200; - if (pxl <= 5) pTransDraw[(sy+y)*nScreenWidth+(sx+x)] = pxl + color; - } - } - } - } -} - -static INT32 GwarDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) gwar_draw_layer_bg(0x300,15,0); - - if (nSpriteEnable & 1) tdfever_draw_sprites(sp16_scrollx, sp16_scrolly, DrvSprRAM + 0x800, DrvGfxROM2, 0, 0, sprite_split_point, 0x100 ); - if (nSpriteEnable & 2) tdfever_draw_sprites(sp32_scrollx, sp32_scrolly, DrvSprRAM, DrvGfxROM3, 0, 0, 32, 0x200 ); - if (nSpriteEnable & 4) tdfever_draw_sprites(sp16_scrollx, sp16_scrolly, DrvSprRAM + 0x800, DrvGfxROM2, 0, sprite_split_point, 64, 0x100 ); - - if (nBurnLayer & 2) gwar_draw_layer_tx(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 TdfeverDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) gwar_draw_layer_bg(0x200,143,-32); - - if (nSpriteEnable & 2) tdfever_draw_sprites(sp32_scrollx, sp32_scrolly, DrvSprRAM, DrvGfxROM3, 0, 0, 32, 0x100 ); - - if (nBurnLayer & 2) gwar_draw_layer_tx(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 FsoccerDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) gwar_draw_layer_bg(0x200,16,0); - - if (nSpriteEnable & 2) tdfever_draw_sprites(sp32_scrollx, sp32_scrolly, DrvSprRAM, DrvGfxROM3, 1, 0, 32, 0x100 ); - - if (nBurnLayer & 2) gwar_draw_layer_tx(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 Tnk3Draw() -{ - if (DrvRecalc) { - tnk3PaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) tnk3_draw_layer_bg(0,0); - if (nSpriteEnable & 1) tnk3_draw_sprites(sp16_scrollx, sp16_scrolly); - if (nBurnLayer & 2) marvins_draw_layer_tx(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 JcrossDraw() -{ - if (DrvRecalc) { - tnk3PaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) aso_draw_layer_bg(0,0); - if (nSpriteEnable & 1) tnk3_draw_sprites(sp16_scrollx, sp16_scrolly); - if (nBurnLayer & 2) marvins_draw_layer_tx(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 Hal21Draw() -{ - if (DrvRecalc) { - tnk3PaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) aso_draw_layer_bg(0,0); - if (nSpriteEnable & 1) tnk3_draw_sprites(sp16_scrollx, sp16_scrolly); - if (nBurnLayer & 2) marvins_draw_layer_tx(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 AsoDraw() -{ - if (DrvRecalc) { - tnk3PaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) aso_draw_layer_bg(256,0); - if (nSpriteEnable & 1) tnk3_draw_sprites(sp16_scrollx, sp16_scrolly); - if (nBurnLayer & 2) marvins_draw_layer_tx(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 MarvinsDraw() -{ - if (DrvRecalc) { - tnk3PaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if ( nBurnLayer & 1) marvins_draw_layer(DrvBgVRAM, DrvGfxROM4, bg_scrollx, bg_scrolly, 0x100 + bg_palette_offset, 0); - if ( nSpriteEnable & 1) marvins_draw_sprites(sp16_scrollx, sp16_scrolly, 0, sprite_split_point >> 2); - if ( nBurnLayer & 2) marvins_draw_layer(DrvFgVRAM, DrvGfxROM1, fg_scrollx, fg_scrolly, 0x080 + fg_palette_offset, 1); - if ( nSpriteEnable & 2) marvins_draw_sprites(sp16_scrollx, sp16_scrolly, sprite_split_point >> 2, 25); - if ( nBurnLayer & 4) marvins_draw_layer_tx(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 IkariDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) ikari_draw_layer_bg(0,0); - - if (nSpriteEnable & 1) ikari_draw_sprites( 0, sp16_scrollx, sp16_scrolly, DrvSprRAM + 0x800, DrvGfxROM2); - if (nSpriteEnable & 2) ikari_draw_sprites( 0, sp32_scrollx, sp32_scrolly, DrvSprRAM, DrvGfxROM3); - if (nSpriteEnable & 4) ikari_draw_sprites(25, sp16_scrollx, sp16_scrolly, DrvSprRAM + 0x800, DrvGfxROM2); - - if (nBurnLayer & 2) ikari_draw_layer_tx(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 MarvinsFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 800; - INT32 nCyclesTotal[3] = { 3360000 / 60, 3360000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - INT32 nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nSegment); - nSegment = ZetTotalCycles(); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment - ZetTotalCycles()); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(2); - nSegment = nCyclesTotal[2] / nInterleave; - nCyclesDone[2] += ZetRun(nSegment); - if ((i % (nInterleave/4)) == ((nInterleave / 4) - 1)) - ZetSetIRQLine(0x20, CPU_IRQSTATUS_ACK); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - snkwave_render(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 JcrossFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 800; - INT32 nCyclesTotal[3] = { 3350000 / 60, 3350000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - INT32 nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nSegment); - nSegment = ZetTotalCycles(); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment - ZetTotalCycles()); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(2); - nSegment = nCyclesTotal[2] / nInterleave; - nCyclesDone[2] += ZetRun(nSegment); - if ((i % (nInterleave/4)) == ((nInterleave / 4) - 1)) { - if (hal21mode) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - } - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut && i%8==7) { - INT32 nSegmentLength = nBurnSoundLen / 100; //nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 gwar_rotary(INT32 which) -{ - INT32 value = dialRotation(which); - - if ((gwar_rot_last[which] == 0x5 && value == 0x6) || (gwar_rot_last[which] == 0x6 && value == 0x5)) - { - if (!gwar_rot_cnt[which]) - value = 0xf; - gwar_rot_cnt[which] = (gwar_rot_cnt[which] + 1) & 0x07; - } - gwar_rot_last[which] = value; - - return value; -} - -static INT32 GwarFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy6[i] & 1) << i; - } - - if (game_select == 1) { // psychos - DrvDips[0] = (DrvDips[0] & ~0x04) | (DrvDips[2] & 0x04); - DrvDips[1] = (DrvDips[1] & ~0x30) | (DrvDips[2] & 0x30); - } - - if (game_rotates) { - SuperJoy2Rotate(); - } - - if (game_rotates) { - if (game_select == 3) { - DrvInputs[1] = (DrvInputs[1] & 0x0f) + (gwar_rotary(0) << 4); - DrvInputs[2] = (DrvInputs[2] & 0x0f) + (gwar_rotary(1) << 4); - } else { - DrvInputs[1] = (DrvInputs[1] & 0x0f) + (dialRotation(0) << 4); - DrvInputs[2] = (DrvInputs[2] & 0x0f) + (dialRotation(1) << 4); - } - } else { - if (game_select == 3) { - // gwarb - DrvInputs[1] = (DrvInputs[1] & 0x0f) + 0xf0; - DrvInputs[2] = (DrvInputs[2] & 0x0f) + 0xf0; - } - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 4000000 / 60, 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - INT32 nSegment = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - nSegment = ZetTotalCycles(); - if (i == 240/*(nInterleave - 1)*/) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - BurnTimerUpdateYM3526((i + 1) * nCyclesTotal[1] / nInterleave);//nSegment); - if (i == 240/*(nInterleave - 1)*/) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(2); - BurnTimerUpdateY8950((i + 1) * nCyclesTotal[2] / nInterleave);//nSegment); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - ZetClose(); - - ZetOpen(2); - BurnTimerEndFrameY8950(nCyclesTotal[2]); - ZetClose(); - - if (pBurnSoundOut) { - ZetOpen(1); - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - ZetOpen(2); - BurnY8950Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 AthenaFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - if (game_select == 1) { // psychos - DrvDips[0] = (DrvDips[0] & ~0x04) | (DrvDips[2] & 0x04); - DrvDips[1] = (DrvDips[1] & ~0x30) | (DrvDips[2] & 0x30); - } - - if (game_rotates) { - SuperJoy2Rotate(); - } - - //if (rotate_gunpos[0]) bprintf(0, _T("[[target %X mempos %X nRotate %X.\n"), nRotateTarget[0], *rotate_gunpos[0] & 0x0f, nRotate[0]); - - if (ikarijoy) { - DrvInputs[1] &= 0x0f; - DrvInputs[2] &= 0x0f; - if (DrvJoy2[0]) DrvInputs[1] |= 0x20; - if (DrvJoy2[1]) DrvInputs[1] |= 0x40; - if (DrvJoy2[2]) DrvInputs[1] |= 0x80; - if (DrvJoy2[3]) DrvInputs[1] |= 0x10; - - if (DrvJoy3[0]) DrvInputs[2] |= 0x20; - if (DrvJoy3[1]) DrvInputs[2] |= 0x40; - if (DrvJoy3[2]) DrvInputs[2] |= 0x80; - if (DrvJoy3[3]) DrvInputs[2] |= 0x10; - - } - } - - INT32 nInterleave = 800; - INT32 nCyclesTotal[3] = { 3350000 / 60, 3350000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - INT32 nSegment = ZetTotalCycles(); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - BurnTimerUpdateYM3526(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - if ((i&7)==7) // update 100x per frame - { - ZetOpen(2); - BurnTimerUpdateY8950(nSegment); - ZetClose(); - } - } - - ZetOpen(1); - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - ZetClose(); - - ZetOpen(2); - BurnTimerEndFrameY8950(nCyclesTotal[2]); - ZetClose(); - - if (pBurnSoundOut) { - ZetOpen(1); - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - ZetOpen(2); - BurnY8950Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 Tnk3Frame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - if (game_rotates) { - SuperJoy2Rotate(); - } - } - - INT32 nInterleave = 800; - INT32 nCyclesTotal[3] = { 3350000 / 60, 3350000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - INT32 nSegment = ZetTotalCycles(); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment - ZetTotalCycles()); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(2); - BurnTimerUpdateYM3526(nSegment); - ZetClose(); - } - - ZetOpen(2); - - BurnTimerEndFrameYM3526(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 FitegolfFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nInterleave = 800; - INT32 nCyclesTotal[3] = { 3350000 / 60, 3350000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - INT32 nSegment = ZetTotalCycles(); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment - ZetTotalCycles()); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - if ((i&7)==7) { // update 100x per frame - ZetOpen(2); - BurnTimerUpdateYM3812(nSegment); - ZetClose(); - } - } - - ZetOpen(2); - - BurnTimerEndFrameYM3812(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 ChopperFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 4000000 / 60, 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == 240) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - BurnTimerUpdateY8950((i + 1) * nCyclesTotal[1] / nInterleave); - if (i == 240) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(2); - BurnTimerUpdateYM3812((i + 1) * nCyclesTotal[2] / nInterleave); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrameY8950(nCyclesTotal[1]); - ZetClose(); - - ZetOpen(2); - BurnTimerEndFrameYM3812(nCyclesTotal[2]); - ZetClose(); - - if (pBurnSoundOut) { - ZetOpen(2); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - ZetOpen(1); - BurnY8950Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - if (game_select == 1 || game_select == 2 || game_select == 3 || game_select == 4 || game_select == 6) - BurnYM3526Scan(nAction, pnMin); - - if (game_select == 1 || game_select == 2 || game_select == 3 || game_select == 6 || game_select == 9) - BurnY8950Scan(nAction, pnMin); - - if (game_select == 9) - BurnYM3812Scan(nAction, pnMin); - - if (game_select == 5) - AY8910Scan(nAction, pnMin); - - SCAN_VAR(sp16_scrolly); - SCAN_VAR(sp16_scrollx); - SCAN_VAR(sp32_scrolly); - SCAN_VAR(sp32_scrollx); - SCAN_VAR(bg_scrollx); - SCAN_VAR(bg_scrolly); - SCAN_VAR(fg_scrollx); - SCAN_VAR(fg_scrolly); - SCAN_VAR(txt_palette_offset); - SCAN_VAR(txt_tile_offset); - SCAN_VAR(bg_tile_offset); - SCAN_VAR(bg_palette_offset); - SCAN_VAR(fg_palette_offset); - SCAN_VAR(sprite_split_point); - SCAN_VAR(tc16_posy); - SCAN_VAR(tc16_posx); - SCAN_VAR(tc32_posy); - SCAN_VAR(tc32_posx); - - SCAN_VAR(nRotate); - SCAN_VAR(nRotateTarget); - SCAN_VAR(nRotateTry); - SCAN_VAR(gwar_rot_last); - SCAN_VAR(gwar_rot_cnt); - - if (nAction & ACB_WRITE) { - nRotateTime[0] = nRotateTime[1] = 0; - } - } - - return 0; -} - - -// Marvin's Maze - -static struct BurnRomInfo marvinsRomDesc[] = { - { "pa1", 0x02000, 0x0008d791, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "pa2", 0x02000, 0x9457003c, 1 | BRF_ESS | BRF_PRG }, // 1 - { "pa3", 0x02000, 0x54c33ecb, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "pb1", 0x02000, 0x3b6941a5, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - - { "m1", 0x02000, 0x2314c696, 3 | BRF_ESS | BRF_PRG }, // 4 Z80 #2 Code - { "m2", 0x02000, 0x74ba5799, 3 | BRF_ESS | BRF_PRG }, // 5 - - { "s1", 0x02000, 0x327f70f3, 4 | BRF_GRA }, // 6 Text Characters - - { "b1", 0x02000, 0xe528bc60, 6 | BRF_GRA }, // 7 Foreground Characters - - { "b2", 0x02000, 0xe528bc60, 13 | BRF_GRA }, // 8 Background Characters - - { "f1", 0x02000, 0x0bd6b4e5, 9 | BRF_GRA }, // 9 Sprites - { "f2", 0x02000, 0x8fc2b081, 9 | BRF_GRA }, // 10 - { "f3", 0x02000, 0xe55c9b83, 9 | BRF_GRA }, // 11 - - { "marvmaze.j1", 0x00400, 0x92f5b06d, 14 | BRF_GRA }, // 12 Color Data - { "marvmaze.j2", 0x00400, 0xd2b25665, 14 | BRF_GRA }, // 13 - { "marvmaze.j3", 0x00400, 0xdf9e6005, 14 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(marvins) -STD_ROM_FN(marvins) - -struct BurnDriver BurnDrvMarvins = { - "marvins", NULL, NULL, NULL, "1983", - "Marvin's Maze\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, marvinsRomInfo, marvinsRomName, NULL, NULL, MarvinsInputInfo, MarvinsDIPInfo, - MarvinsInit, DrvExit, MarvinsFrame, MarvinsDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Mad Crasher - -static struct BurnRomInfo madcrashRomDesc[] = { - { "p8", 0x02000, 0xecb2fdc9, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "p9", 0x02000, 0x0a87df26, 1 | BRF_ESS | BRF_PRG }, // 1 - { "p10", 0x02000, 0x6eb8a87c, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "p4", 0x02000, 0x5664d699, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - { "p5", 0x02000, 0xdea2865a, 2 | BRF_ESS | BRF_PRG }, // 4 - { "p6", 0x02000, 0xe25a9b9c, 2 | BRF_ESS | BRF_PRG }, // 5 - { "p7", 0x02000, 0x55b14a36, 2 | BRF_ESS | BRF_PRG }, // 6 - { "p3", 0x02000, 0xe3c8c2cb, 2 | BRF_ESS | BRF_PRG }, // 7 - - { "p1", 0x02000, 0x2dcd036d, 3 | BRF_ESS | BRF_PRG }, // 8 Z80 #2 Code - { "p2", 0x02000, 0xcc30ae8b, 3 | BRF_ESS | BRF_PRG }, // 9 - - { "p13", 0x02000, 0x48c4ade0, 4 | BRF_GRA }, // 10 Text Characters - - { "p11", 0x02000, 0x67174956, 6 | BRF_GRA }, // 11 Foreground Characters - - { "p12", 0x02000, 0x085094c1, 13 | BRF_GRA }, // 12 Background Characters - - { "p16", 0x02000, 0x6153611a, 9 | BRF_GRA }, // 13 Sprites - { "p15", 0x02000, 0xa74149d4, 9 | BRF_GRA }, // 14 - { "p14", 0x02000, 0x07e807bc, 9 | BRF_GRA }, // 15 - - { "m3-prom.j3", 0x00400, 0xd19e8a91, 14 | BRF_GRA }, // 16 Color Data - { "m2-prom.j4", 0x00400, 0x9fc325af, 14 | BRF_GRA }, // 17 - { "m1-prom.j5", 0x00400, 0x07678443, 14 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(madcrash) -STD_ROM_FN(madcrash) - -struct BurnDriver BurnDrvMadcrash = { - "madcrash", NULL, NULL, NULL, "1984", - "Mad Crasher\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, madcrashRomInfo, madcrashRomName, NULL, NULL, MadcrashInputInfo, MadcrashDIPInfo, - MadcrashInit, DrvExit, MarvinsFrame, MarvinsDraw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Mad Crusher (Japan) - -static struct BurnRomInfo madcrushRomDesc[] = { - { "p3.a8", 0x02000, 0xfbd3eda1, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "p4.a9", 0x02000, 0x1bc67cab, 1 | BRF_ESS | BRF_PRG }, // 1 - { "p5.a10", 0x02000, 0xd905ff79, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "p6.a11", 0x02000, 0x432b5743, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - { "p7.a13", 0x02000, 0xdea2865a, 2 | BRF_ESS | BRF_PRG }, // 4 - { "p8.a14", 0x02000, 0xe25a9b9c, 2 | BRF_ESS | BRF_PRG }, // 5 - { "p10.bin", 0x02000, 0x55b14a36, 2 | BRF_ESS | BRF_PRG }, // 6 - { "p9.bin", 0x02000, 0xe3c8c2cb, 2 | BRF_ESS | BRF_PRG }, // 7 - - { "p1.a6", 0x02000, 0x2dcd036d, 3 | BRF_ESS | BRF_PRG }, // 8 Z80 #2 Code - { "p2.a8", 0x02000, 0xcc30ae8b, 3 | BRF_ESS | BRF_PRG }, // 9 - - { "p13.e2", 0x02000, 0xfcdd36ca, 4 | BRF_GRA }, // 10 Text Characters - - { "p11.a2", 0x02000, 0x67174956, 6 | BRF_GRA }, // 11 Foreground Characters - - { "p12.c2", 0x02000, 0x085094c1, 13 | BRF_GRA }, // 12 Background Characters - - { "p16.k4", 0x02000, 0x6153611a, 9 | BRF_GRA }, // 13 Sprites - { "p15.k2", 0x02000, 0xa74149d4, 9 | BRF_GRA }, // 14 - { "p14.k1", 0x02000, 0x07e807bc, 9 | BRF_GRA }, // 15 - - { "m3-prom.j3", 0x00400, 0xd19e8a91, 14 | BRF_GRA }, // 16 Color Data - { "m2-prom.j4", 0x00400, 0x9fc325af, 14 | BRF_GRA }, // 17 - { "m1-prom.j5", 0x00400, 0x07678443, 14 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(madcrush) -STD_ROM_FN(madcrush) - -struct BurnDriver BurnDrvMadcrush = { - "madcrush", "madcrash", NULL, NULL, "1984", - "Mad Crusher (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, madcrushRomInfo, madcrushRomName, NULL, NULL, MadcrashInputInfo, MadcrashDIPInfo, - MadcrushInit, DrvExit, MarvinsFrame, MarvinsDraw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Vanguard II - -static struct BurnRomInfo vangrd2RomDesc[] = { - { "p1.9a", 0x02000, 0xbc9eeca5, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "p3.11a", 0x02000, 0x3970f69d, 1 | BRF_ESS | BRF_PRG }, // 1 - { "p2.12a", 0x02000, 0x58b08b58, 1 | BRF_ESS | BRF_PRG }, // 2 - { "p4.14a", 0x02000, 0xa95f11ea, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "p5.4a", 0x02000, 0xe4dfd0ba, 2 | BRF_ESS | BRF_PRG }, // 4 Z80 #1 Code - { "p6.6a", 0x02000, 0x894ff00d, 2 | BRF_ESS | BRF_PRG }, // 5 - { "p7.7a", 0x02000, 0x40b4d069, 2 | BRF_ESS | BRF_PRG }, // 6 - - { "p8.6a", 0x02000, 0xa3daa438, 3 | BRF_ESS | BRF_PRG }, // 7 Z80 #2 Code - { "p9.8a", 0x02000, 0x9345101a, 3 | BRF_ESS | BRF_PRG }, // 8 - - { "p15.1e", 0x02000, 0x85718a41, 4 | BRF_GRA }, // 9 Text Characters - - { "p13.1a", 0x02000, 0x912f22c6, 6 | BRF_GRA }, // 10 Foreground Characters - - { "p9", 0x02000, 0x7aa0b684, 13 | BRF_GRA }, // 11 Background Characters - - { "p10.4kl", 0x02000, 0x5bfc04c0, 9 | BRF_GRA }, // 12 Sprites - { "p11.3kl", 0x02000, 0x620cd4ec, 9 | BRF_GRA }, // 13 - { "p12.1kl", 0x02000, 0x8658ea6c, 9 | BRF_GRA }, // 14 - - { "mb7054.3j", 0x00400, 0x506f659a, 14 | BRF_GRA }, // 15 Color Data - { "mb7054.4j", 0x00400, 0x222133ce, 14 | BRF_GRA }, // 16 - { "mb7054.5j", 0x00400, 0x2e21a79b, 14 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(vangrd2) -STD_ROM_FN(vangrd2) - -struct BurnDriver BurnDrvVangrd2 = { - "vangrd2", NULL, NULL, NULL, "1984", - "Vanguard II\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, vangrd2RomInfo, vangrd2RomName, NULL, NULL, Vangrd2InputInfo, Vangrd2DIPInfo, - MadcrashInit, DrvExit, MarvinsFrame, MarvinsDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Jumping Cross - -static struct BurnRomInfo jcrossRomDesc[] = { - { "jcrossa0.10b", 0x02000, 0x0e79bbcd, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "jcrossa1.12b", 0x02000, 0x999b2bcc, 1 | BRF_ESS | BRF_PRG }, // 1 - { "jcrossa2.13b", 0x02000, 0xac89e49c, 1 | BRF_ESS | BRF_PRG }, // 2 - { "jcrossa3.14b", 0x02000, 0x4fd7848d, 1 | BRF_ESS | BRF_PRG }, // 3 - { "jcrossa4.15b", 0x02000, 0x8500575d, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "jcrossb0.15a", 0x02000, 0x77ed51e7, 2 | BRF_ESS | BRF_PRG }, // 5 Z80 #1 Code - { "jcrossb1.14a", 0x02000, 0x23cf0f70, 2 | BRF_ESS | BRF_PRG }, // 6 - { "jcrossb2.13a", 0x02000, 0x5bed3118, 2 | BRF_ESS | BRF_PRG }, // 7 - { "jcrossb3.12a", 0x02000, 0xcd75dc95, 2 | BRF_ESS | BRF_PRG }, // 8 - - { "jcrosss0.f1", 0x02000, 0x9ae8ea93, 3 | BRF_ESS | BRF_PRG }, // 9 Z80 #2 Code - { "jcrosss1.h2", 0x02000, 0x83785601, 3 | BRF_ESS | BRF_PRG }, // 10 - - { "jcrossb4.10a", 0x02000, 0x08ad93fe, 4 | BRF_GRA }, // 11 Text Characters - { "jcrosss.d2", 0x02000, 0x3ebb5beb, 4 | BRF_GRA }, // 12 - - { "jcrossb1.a2", 0x02000, 0xea3dfbc9, 6 | BRF_GRA }, // 13 Background Characters - - { "jcrossf0.l2", 0x02000, 0x4532509b, 9 | BRF_GRA }, // 14 Sprites - { "jcrossf1.k2", 0x02000, 0x70d219bf, 9 | BRF_GRA }, // 15 - { "jcrossf2.j2", 0x02000, 0x42a12b9d, 9 | BRF_GRA }, // 16 - - { "jcrossp2.j7", 0x00400, 0xb72a96a5, 14 | BRF_GRA }, // 17 Color Data - { "jcrossp1.j8", 0x00400, 0x35650448, 14 | BRF_GRA }, // 18 - { "jcrossp0.j9", 0x00400, 0x99f54d48, 14 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(jcross) -STD_ROM_FN(jcross) - -struct BurnDriver BurnDrvJcross = { - "jcross", NULL, NULL, NULL, "1984", - "Jumping Cross\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, jcrossRomInfo, jcrossRomName, NULL, NULL, JcrossInputInfo, JcrossDIPInfo, - JcrossInit, DrvExit, JcrossFrame, JcrossDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Gladiator 1984 - -static struct BurnRomInfo sgladiatRomDesc[] = { - { "glad.005", 0x04000, 0x4bc60f0b, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "glad.004", 0x04000, 0xdb557f46, 1 | BRF_ESS | BRF_PRG }, // 1 - { "glad.003", 0x02000, 0x55ce82b4, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "glad.002", 0x04000, 0x8350261c, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - { "glad.001", 0x04000, 0x5ee9d3fb, 2 | BRF_ESS | BRF_PRG }, // 4 - - { "glad.007", 0x02000, 0xc25b6731, 3 | BRF_ESS | BRF_PRG }, // 5 Z80 #2 Code - { "glad.006", 0x02000, 0x2024d716, 3 | BRF_ESS | BRF_PRG }, // 6 - - { "glad.011", 0x02000, 0x305bb294, 4 | BRF_GRA }, // 7 Text Characters - - { "glad.012", 0x02000, 0xb7dd519f, 6 | BRF_GRA }, // 8 Background Characters - - { "glad.008", 0x02000, 0xbcf42587, 9 | BRF_GRA }, // 9 Sprites - { "glad.009", 0x02000, 0x912a20e0, 9 | BRF_GRA }, // 10 - { "glad.010", 0x02000, 0x8b1db3a5, 9 | BRF_GRA }, // 11 - - { "82s137.001", 0x00400, 0xd9184823, 14 | BRF_GRA }, // 12 Color Data - { "82s137.002", 0x00400, 0x1a6b0953, 14 | BRF_GRA }, // 13 - { "82s137.003", 0x00400, 0xc0e70308, 14 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(sgladiat) -STD_ROM_FN(sgladiat) - -struct BurnDriver BurnDrvSgladiat = { - "sgladiat", NULL, NULL, NULL, "1984", - "Gladiator 1984\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, sgladiatRomInfo, sgladiatRomName, NULL, NULL, SgladiatInputInfo, SgladiatDIPInfo, - SgladiatInit, DrvExit, JcrossFrame, JcrossDraw, DrvScan, &DrvRecalc, 0x400, - 288, 224, 4, 3 -}; - - -// HAL21 - -static struct BurnRomInfo hal21RomDesc[] = { - { "hal21p1.bin", 0x02000, 0x9d193830, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "hal21p2.bin", 0x02000, 0xc1f00350, 1 | BRF_ESS | BRF_PRG }, // 1 - { "hal21p3.bin", 0x02000, 0x881d22a6, 1 | BRF_ESS | BRF_PRG }, // 2 - { "hal21p4.bin", 0x02000, 0xce692534, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "hal21p5.bin", 0x02000, 0x3ce0684a, 2 | BRF_ESS | BRF_PRG }, // 4 Z80 #1 Code - { "hal21p6.bin", 0x02000, 0x878ef798, 2 | BRF_ESS | BRF_PRG }, // 5 - { "hal21p7.bin", 0x02000, 0x72ebbe95, 2 | BRF_ESS | BRF_PRG }, // 6 - { "hal21p8.bin", 0x02000, 0x17e22ad3, 2 | BRF_ESS | BRF_PRG }, // 7 - { "hal21p9.bin", 0x02000, 0xb146f891, 2 | BRF_ESS | BRF_PRG }, // 8 - - { "hal21p10.bin", 0x04000, 0x916f7ba0, 3 | BRF_ESS | BRF_PRG }, // 9 Z80 #2 Code - - { "hal21p12.bin", 0x02000, 0x9839a7cd, 4 | BRF_GRA }, // 10 Text Characters - - { "hal21p11.bin", 0x04000, 0x24abc57e, 6 | BRF_GRA }, // 11 Background Characters - - { "hal21p13.bin", 0x04000, 0x052b4f4f, 9 | BRF_GRA }, // 12 Sprites - { "hal21p14.bin", 0x04000, 0xda0cb670, 9 | BRF_GRA }, // 13 - { "hal21p15.bin", 0x04000, 0x5c5ea945, 9 | BRF_GRA }, // 14 - - { "hal21_3.prm", 0x00400, 0x605afff8, 14 | BRF_GRA }, // 15 Color Data - { "hal21_2.prm", 0x00400, 0xc5d84225, 14 | BRF_GRA }, // 16 - { "hal21_1.prm", 0x00400, 0x195768fc, 14 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(hal21) -STD_ROM_FN(hal21) - -struct BurnDriver BurnDrvHal21 = { - "hal21", NULL, NULL, NULL, "1984", - "HAL21\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, hal21RomInfo, hal21RomName, NULL, NULL, Hal21InputInfo, Hal21DIPInfo, - Hal21Init, DrvExit, JcrossFrame, Hal21Draw, DrvScan, &DrvRecalc, 0x400, - 224, 288, 3, 4 -}; - - -// HAL21 (Japan) - -static struct BurnRomInfo hal21jRomDesc[] = { - { "hal21p1.bin", 0x02000, 0x9d193830, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "hal21p2.bin", 0x02000, 0xc1f00350, 1 | BRF_ESS | BRF_PRG }, // 1 - { "hal21p3.bin", 0x02000, 0x881d22a6, 1 | BRF_ESS | BRF_PRG }, // 2 - { "hal21p4.bin", 0x02000, 0xce692534, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "hal21p5.bin", 0x02000, 0x3ce0684a, 2 | BRF_ESS | BRF_PRG }, // 4 Z80 #1 Code - { "hal21p6.bin", 0x02000, 0x878ef798, 2 | BRF_ESS | BRF_PRG }, // 5 - { "hal21p7.bin", 0x02000, 0x72ebbe95, 2 | BRF_ESS | BRF_PRG }, // 6 - { "hal21p8.bin", 0x02000, 0x17e22ad3, 2 | BRF_ESS | BRF_PRG }, // 7 - { "hal21p9.bin", 0x02000, 0xb146f891, 2 | BRF_ESS | BRF_PRG }, // 8 - - { "hal21-10.bin", 0x04000, 0xa182b3f0, 3 | BRF_ESS | BRF_PRG }, // 9 Z80 #2 Code - - { "hal21p12.bin", 0x02000, 0x9839a7cd, 4 | BRF_GRA }, // 10 Text Characters - - { "hal21p11.bin", 0x04000, 0x24abc57e, 6 | BRF_GRA }, // 11 Background Characters - - { "hal21p13.bin", 0x04000, 0x052b4f4f, 9 | BRF_GRA }, // 12 Sprites - { "hal21p14.bin", 0x04000, 0xda0cb670, 9 | BRF_GRA }, // 13 - { "hal21p15.bin", 0x04000, 0x5c5ea945, 9 | BRF_GRA }, // 14 - - { "hal21_3.prm", 0x00400, 0x605afff8, 14 | BRF_GRA }, // 15 Color Data - { "hal21_2.prm", 0x00400, 0xc5d84225, 14 | BRF_GRA }, // 16 - { "hal21_1.prm", 0x00400, 0x195768fc, 14 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(hal21j) -STD_ROM_FN(hal21j) - -struct BurnDriver BurnDrvHal21j = { - "hal21j", "hal21", NULL, NULL, "1985", - "HAL21 (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, hal21jRomInfo, hal21jRomName, NULL, NULL, Hal21InputInfo, Hal21DIPInfo, - Hal21Init, DrvExit, JcrossFrame, Hal21Draw, DrvScan, &DrvRecalc, 0x400, - 224, 288, 3, 4 -}; - - -// Psycho Soldier (US) - -static struct BurnRomInfo psychosRomDesc[] = { - { "p7", 0x10000, 0x562809f4, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "up03_m8.rom", 0x10000, 0x5f426ddb, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "p5", 0x10000, 0x64503283, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "up03_k1.rom", 0x00400, 0x27b8ca8c, 14 | BRF_GRA }, // 3 Color Data - { "up03_l1.rom", 0x00400, 0x40e78c9e, 14 | BRF_GRA }, // 4 - { "up03_k2.rom", 0x00400, 0xd845d5ac, 14 | BRF_GRA }, // 5 - { "mb7122e.8j", 0x00400, 0xc20b197b, 0 | BRF_GRA }, // 6 - { "mb7122e.8k", 0x00400, 0x5d0c617f, 0 | BRF_GRA }, // 7 - - { "up02_a3.rom", 0x08000, 0x11a71919, 4 | BRF_GRA }, // 8 Text Characters - - { "up01_f1.rom", 0x10000, 0x167e5765, 5 | BRF_GRA }, // 9 Background Layer - { "up01_d1.rom", 0x10000, 0x8b0fe8d0, 5 | BRF_GRA }, // 10 - { "up01_c1.rom", 0x10000, 0xf4361c50, 5 | BRF_GRA }, // 11 - { "up01_a1.rom", 0x10000, 0xe4b0b95e, 5 | BRF_GRA }, // 12 - - { "up02_f3.rom", 0x08000, 0xf96f82db, 7 | BRF_GRA }, // 13 16x16 Sprites - { "up02_e3.rom", 0x08000, 0x2b007733, 7 | BRF_GRA }, // 14 - { "up02_c3.rom", 0x08000, 0xefa830e1, 7 | BRF_GRA }, // 15 - { "up02_b3.rom", 0x08000, 0x24559ee1, 7 | BRF_GRA }, // 16 - - { "up01_f10.rom", 0x10000, 0x2bac250e, 8 | BRF_GRA }, // 17 32x32 Sprites - { "up01_h10.rom", 0x10000, 0x5e1ba353, 8 | BRF_GRA }, // 18 - { "up01_j10.rom", 0x10000, 0x9ff91a97, 8 | BRF_GRA }, // 19 - { "up01_l10.rom", 0x10000, 0xae1965ef, 8 | BRF_GRA }, // 20 - { "up01_m10.rom", 0x10000, 0xdf283b67, 8 | BRF_GRA }, // 21 - { "up01_n10.rom", 0x10000, 0x914f051f, 8 | BRF_GRA }, // 22 - { "up01_r10.rom", 0x10000, 0xc4488472, 8 | BRF_GRA }, // 23 - { "up01_s10.rom", 0x10000, 0x8ec7fe18, 8 | BRF_GRA }, // 24 - - { "p1", 0x10000, 0x58f1683f, 15 | BRF_SND }, // 25 Samples - { "p2", 0x10000, 0xda3abda1, 15 | BRF_SND }, // 26 - { "p3", 0x10000, 0xf3683ae8, 15 | BRF_SND }, // 27 - { "p4", 0x10000, 0x437d775a, 15 | BRF_SND }, // 28 -}; - -STD_ROM_PICK(psychos) -STD_ROM_FN(psychos) - -struct BurnDriver BurnDrvPsychos = { - "psychos", NULL, NULL, NULL, "1987", - "Psycho Soldier (US)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, psychosRomInfo, psychosRomName, NULL, NULL, PsychosInputInfo, PsychosDIPInfo, - PsychosInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 400, 224, 4, 3 -}; - - -// Psycho Soldier (Japan) - -static struct BurnRomInfo psychosjRomDesc[] = { - { "up03_m4.rom", 0x10000, 0x05dfb409, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "up03_m8.rom", 0x10000, 0x5f426ddb, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "up03_j6.rom", 0x10000, 0xbbd0a8e3, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "up03_k1.rom", 0x00400, 0x27b8ca8c, 14 | BRF_GRA }, // 3 Color Data - { "up03_l1.rom", 0x00400, 0x40e78c9e, 14 | BRF_GRA }, // 4 - { "up03_k2.rom", 0x00400, 0xd845d5ac, 14 | BRF_GRA }, // 5 - { "mb7122e.8j", 0x00400, 0xc20b197b, 0 | BRF_GRA }, // 6 - { "mb7122e.8k", 0x00400, 0x5d0c617f, 0 | BRF_GRA }, // 7 - - { "up02_a3.rom", 0x08000, 0x11a71919, 4 | BRF_GRA }, // 8 Text Characters - - { "up01_f1.rom", 0x10000, 0x167e5765, 5 | BRF_GRA }, // 9 Background Layer - { "up01_d1.rom", 0x10000, 0x8b0fe8d0, 5 | BRF_GRA }, // 10 - { "up01_c1.rom", 0x10000, 0xf4361c50, 5 | BRF_GRA }, // 11 - { "up01_a1.rom", 0x10000, 0xe4b0b95e, 5 | BRF_GRA }, // 12 - - { "up02_f3.rom", 0x08000, 0xf96f82db, 7 | BRF_GRA }, // 13 16x16 Sprites - { "up02_e3.rom", 0x08000, 0x2b007733, 7 | BRF_GRA }, // 14 - { "up02_c3.rom", 0x08000, 0xefa830e1, 7 | BRF_GRA }, // 15 - { "up02_b3.rom", 0x08000, 0x24559ee1, 7 | BRF_GRA }, // 16 - - { "up01_f10.rom", 0x10000, 0x2bac250e, 8 | BRF_GRA }, // 17 32x32 Sprites - { "up01_h10.rom", 0x10000, 0x5e1ba353, 8 | BRF_GRA }, // 18 - { "up01_j10.rom", 0x10000, 0x9ff91a97, 8 | BRF_GRA }, // 19 - { "up01_l10.rom", 0x10000, 0xae1965ef, 8 | BRF_GRA }, // 20 - { "up01_m10.rom", 0x10000, 0xdf283b67, 8 | BRF_GRA }, // 21 - { "up01_n10.rom", 0x10000, 0x914f051f, 8 | BRF_GRA }, // 22 - { "up01_r10.rom", 0x10000, 0xc4488472, 8 | BRF_GRA }, // 23 - { "up01_s10.rom", 0x10000, 0x8ec7fe18, 8 | BRF_GRA }, // 24 - - { "up03_b5.rom", 0x10000, 0x0f8e8276, 15 | BRF_SND }, // 25 Samples - { "up03_c5.rom", 0x10000, 0x34e41dfb, 15 | BRF_SND }, // 26 - { "up03_d5.rom", 0x10000, 0xaa583c5e, 15 | BRF_SND }, // 27 - { "up03_f5.rom", 0x10000, 0x7e8bce7a, 15 | BRF_SND }, // 28 -}; - -STD_ROM_PICK(psychosj) -STD_ROM_FN(psychosj) - -struct BurnDriver BurnDrvPsychosj = { - "psychosj", "psychos", NULL, NULL, "1987", - "Psycho Soldier (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, psychosjRomInfo, psychosjRomName, NULL, NULL, PsychosInputInfo, PsychosDIPInfo, - PsychosInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 400, 224, 4, 3 -}; - - -// Bermuda Triangle (World?) - -static struct BurnRomInfo bermudatRomDesc[] = { - { "bt_p1.rom", 0x10000, 0x43dec5e9, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "bt_p2.rom", 0x10000, 0x0e193265, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "bt_p3.rom", 0x10000, 0x53a82e50, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "btj_01r.prm", 0x00400, 0xf4b54d06, 14 | BRF_GRA }, // 3 Color Data - { "btj_02g.prm", 0x00400, 0xbaac139e, 14 | BRF_GRA }, // 4 - { "btj_03b.prm", 0x00400, 0x2edf2e0b, 14 | BRF_GRA }, // 5 - { "btj_h.prm", 0x00400, 0xc20b197b, 0 | BRF_OPT }, // 6 - { "btj_v.prm", 0x00400, 0x5d0c617f, 0 | BRF_OPT }, // 7 - - { "bt_p10.rom", 0x08000, 0xd3650211, 4 | BRF_GRA }, // 8 Text Characters - - { "bt_p22.rom", 0x10000, 0x8daf7df4, 5 | BRF_GRA }, // 9 Background Layer - { "bt_p21.rom", 0x10000, 0xb7689599, 5 | BRF_GRA }, // 10 - { "bt_p20.rom", 0x10000, 0xab6217b7, 5 | BRF_GRA }, // 11 - { "bt_p19.rom", 0x10000, 0x8ed759a0, 5 | BRF_GRA }, // 12 - - { "bt_p6.rom", 0x08000, 0x8ffdf969, 7 | BRF_GRA }, // 13 16x16 Sprites - { "bt_p7.rom", 0x08000, 0x268d10df, 7 | BRF_GRA }, // 14 - { "bt_p8.rom", 0x08000, 0x3e39e9dd, 7 | BRF_GRA }, // 15 - { "bt_p9.rom", 0x08000, 0xbf56da61, 7 | BRF_GRA }, // 16 - - { "bt_p11.rom", 0x10000, 0xaae7410e, 8 | BRF_GRA }, // 17 32x32 Sprites - { "bt_p12.rom", 0x10000, 0x18914f70, 8 | BRF_GRA }, // 18 - { "bt_p13.rom", 0x10000, 0xcd79ce81, 8 | BRF_GRA }, // 19 - { "bt_p14.rom", 0x10000, 0xedc57117, 8 | BRF_GRA }, // 20 - { "bt_p15.rom", 0x10000, 0x448bf9f4, 8 | BRF_GRA }, // 21 - { "bt_p16.rom", 0x10000, 0x119999eb, 8 | BRF_GRA }, // 22 - { "bt_p17.rom", 0x10000, 0xb5462139, 8 | BRF_GRA }, // 23 - { "bt_p18.rom", 0x10000, 0xcb416227, 8 | BRF_GRA }, // 24 - - { "bt_p4.rom", 0x10000, 0x4bc83229, 15 | BRF_SND }, // 25 Samples - { "bt_p5.rom", 0x10000, 0x817bd62c, 15 | BRF_SND }, // 26 -}; - -STD_ROM_PICK(bermudat) -STD_ROM_FN(bermudat) - -struct BurnDriver BurnDrvBermudat = { - "bermudat", NULL, NULL, NULL, "1987", - "Bermuda Triangle (World?)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, bermudatRomInfo, bermudatRomName, NULL, NULL, BermudatInputInfo, BermudatDIPInfo, - BermudatInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// Bermuda Triangle (Japan) - -static struct BurnRomInfo bermudatjRomDesc[] = { - { "btj_p01.bin", 0x10000, 0xeda75f36, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "bt_p2.rom", 0x10000, 0x0e193265, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "btj_p03.bin", 0x10000, 0xfea8a096, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "btj_01r.prm", 0x00400, 0xf4b54d06, 14 | BRF_GRA }, // 3 Color Data - { "btj_02g.prm", 0x00400, 0xbaac139e, 14 | BRF_GRA }, // 4 - { "btj_03b.prm", 0x00400, 0x2edf2e0b, 14 | BRF_GRA }, // 5 - { "btj_h.prm", 0x00400, 0xc20b197b, 0 | BRF_OPT }, // 6 - { "btj_v.prm", 0x00400, 0x5d0c617f, 0 | BRF_OPT }, // 7 - - { "bt_p10.rom", 0x08000, 0xd3650211, 4 | BRF_GRA }, // 8 Text Characters - - { "bt_p22.rom", 0x10000, 0x8daf7df4, 5 | BRF_GRA }, // 9 Background Layer - { "bt_p21.rom", 0x10000, 0xb7689599, 5 | BRF_GRA }, // 10 - { "bt_p20.rom", 0x10000, 0xab6217b7, 5 | BRF_GRA }, // 11 - { "bt_p19.rom", 0x10000, 0x8ed759a0, 5 | BRF_GRA }, // 12 - - { "bt_p6.rom", 0x08000, 0x8ffdf969, 7 | BRF_GRA }, // 13 16x16 Sprites - { "bt_p7.rom", 0x08000, 0x268d10df, 7 | BRF_GRA }, // 14 - { "bt_p8.rom", 0x08000, 0x3e39e9dd, 7 | BRF_GRA }, // 15 - { "bt_p9.rom", 0x08000, 0xbf56da61, 7 | BRF_GRA }, // 16 - - { "bt_p11.rom", 0x10000, 0xaae7410e, 8 | BRF_GRA }, // 17 32x32 Sprites - { "bt_p12.rom", 0x10000, 0x18914f70, 8 | BRF_GRA }, // 18 - { "bt_p13.rom", 0x10000, 0xcd79ce81, 8 | BRF_GRA }, // 19 - { "bt_p14.rom", 0x10000, 0xedc57117, 8 | BRF_GRA }, // 20 - { "bt_p15.rom", 0x10000, 0x448bf9f4, 8 | BRF_GRA }, // 21 - { "bt_p16.rom", 0x10000, 0x119999eb, 8 | BRF_GRA }, // 22 - { "bt_p17.rom", 0x10000, 0xb5462139, 8 | BRF_GRA }, // 23 - { "bt_p18.rom", 0x10000, 0xcb416227, 8 | BRF_GRA }, // 24 - - { "btj_p04.bin", 0x10000, 0xb2e01129, 15 | BRF_SND }, // 25 Samples - { "btj_p05.bin", 0x10000, 0x924c24f7, 15 | BRF_SND }, // 26 -}; - -STD_ROM_PICK(bermudatj) -STD_ROM_FN(bermudatj) - -struct BurnDriver BurnDrvBermudatj = { - "bermudatj", "bermudat", NULL, NULL, "1987", - "Bermuda Triangle (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, bermudatjRomInfo, bermudatjRomName, NULL, NULL, BermudatInputInfo, BermudatDIPInfo, - BermudatInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// World Wars (World?) - -static struct BurnRomInfo worldwarRomDesc[] = { - { "ww4.bin", 0x10000, 0xbc29d09f, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "ww5.bin", 0x10000, 0x8dc15909, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "ww3.bin", 0x10000, 0x8b74c951, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "ww_r.bin", 0x00400, 0xb88e95f0, 14 | BRF_GRA }, // 3 Color Data - { "ww_g.bin", 0x00400, 0x5e1616b2, 14 | BRF_GRA }, // 4 - { "ww_b.bin", 0x00400, 0xe9770796, 14 | BRF_GRA }, // 5 - { "btj_h.prm", 0x00400, 0xc20b197b, 0 | BRF_OPT }, // 6 - { "btj_v.prm", 0x00400, 0x5d0c617f, 0 | BRF_OPT }, // 7 - - { "ww6.bin", 0x08000, 0xd57570ab, 4 | BRF_GRA }, // 8 Text Characters - - { "ww11.bin", 0x10000, 0x603ddcb5, 5 | BRF_GRA }, // 9 Background Layer - { "ww12.bin", 0x10000, 0x388093ff, 5 | BRF_GRA }, // 10 - { "ww13.bin", 0x10000, 0x83a7ef62, 5 | BRF_GRA }, // 11 - { "ww14.bin", 0x10000, 0x04c784be, 5 | BRF_GRA }, // 12 - - { "ww10.bin", 0x08000, 0xf68a2d51, 7 | BRF_GRA }, // 13 16x16 Sprites - { "ww9.bin", 0x08000, 0xd9d35911, 7 | BRF_GRA }, // 14 - { "ww8.bin", 0x08000, 0x0ec15086, 7 | BRF_GRA }, // 15 - { "ww7.bin", 0x08000, 0x53c4b24e, 7 | BRF_GRA }, // 16 - - { "ww21.bin", 0x10000, 0xbe974fbe, 8 | BRF_GRA }, // 17 32x32 Sprites - { "ww22.bin", 0x10000, 0x9914972a, 8 | BRF_GRA }, // 18 - { "ww19.bin", 0x10000, 0xc39ac1a7, 8 | BRF_GRA }, // 19 - { "ww20.bin", 0x10000, 0x8504170f, 8 | BRF_GRA }, // 20 - { "ww15.bin", 0x10000, 0xd55ce063, 8 | BRF_GRA }, // 21 - { "ww16.bin", 0x10000, 0xa2d19ce5, 8 | BRF_GRA }, // 22 - { "ww17.bin", 0x10000, 0xa9a6b128, 8 | BRF_GRA }, // 23 - { "ww18.bin", 0x10000, 0xc712d24c, 8 | BRF_GRA }, // 24 - - { "bt_p4.rom", 0x10000, 0x4bc83229, 15 | BRF_SND }, // 25 Samples - { "bt_p5.rom", 0x10000, 0x817bd62c, 15 | BRF_SND }, // 26 -}; - -STD_ROM_PICK(worldwar) -STD_ROM_FN(worldwar) - -struct BurnDriver BurnDrvWorldwar = { - "worldwar", NULL, NULL, NULL, "1987", - "World Wars (World?)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, worldwarRomInfo, worldwarRomName, NULL, NULL, BermudatInputInfo, BermudatDIPInfo, - BermudatInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// Bermuda Triangle (World Wars) (US) - -static struct BurnRomInfo bermudataRomDesc[] = { - { "4", 0x10000, 0x4de39d01, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "5", 0x10000, 0x76158e94, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "3", 0x10000, 0xc79134a8, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "mb7122e.1k", 0x00400, 0x1e8fc4c3, 14 | BRF_GRA }, // 3 proms - { "mb7122e.2l", 0x00400, 0x23ce9707, 14 | BRF_GRA }, // 4 - { "mb7122e.1l", 0x00400, 0x26caf985, 14 | BRF_GRA }, // 5 - { "btj_h.prm", 0x00400, 0xc20b197b, 0 | BRF_OPT }, // 6 - { "btj_v.prm", 0x00400, 0x5d0c617f, 0 | BRF_OPT }, // 7 - - { "6", 0x08000, 0xa0e6710c, 4 | BRF_GRA }, // 8 Text Characters - - { "ww11.bin", 0x10000, 0x603ddcb5, 5 | BRF_GRA }, // 9 Background Layer - { "ww12.bin", 0x10000, 0x388093ff, 5 | BRF_GRA }, // 10 - { "ww13.bin", 0x10000, 0x83a7ef62, 5 | BRF_GRA }, // 11 - { "ww14.bin", 0x10000, 0x04c784be, 5 | BRF_GRA }, // 12 - - { "ww10.bin", 0x08000, 0xf68a2d51, 7 | BRF_GRA }, // 13 16x16 Sprites - { "ww9.bin", 0x08000, 0xd9d35911, 7 | BRF_GRA }, // 14 - { "ww8.bin", 0x08000, 0x0ec15086, 7 | BRF_GRA }, // 15 - { "ww7.bin", 0x08000, 0x53c4b24e, 7 | BRF_GRA }, // 16 - - { "ww21.bin", 0x10000, 0xbe974fbe, 8 | BRF_GRA }, // 17 32x32 Sprites - { "ww22.bin", 0x10000, 0x9914972a, 8 | BRF_GRA }, // 18 - { "ww19.bin", 0x10000, 0xc39ac1a7, 8 | BRF_GRA }, // 19 - { "ww20.bin", 0x10000, 0x8504170f, 8 | BRF_GRA }, // 20 - { "ww15.bin", 0x10000, 0xd55ce063, 8 | BRF_GRA }, // 21 - { "ww16.bin", 0x10000, 0xa2d19ce5, 8 | BRF_GRA }, // 22 - { "ww17.bin", 0x10000, 0xa9a6b128, 8 | BRF_GRA }, // 23 - { "ww18.bin", 0x10000, 0xc712d24c, 8 | BRF_GRA }, // 24 - - { "bt_p4.rom", 0x10000, 0x4bc83229, 15 | BRF_SND }, // 25 Samples - { "bt_p5.rom", 0x10000, 0x817bd62c, 15 | BRF_SND }, // 26 -}; - -STD_ROM_PICK(bermudata) -STD_ROM_FN(bermudata) - -struct BurnDriver BurnDrvBermudata = { - "bermudata", "worldwar", NULL, NULL, "1987", - "Bermuda Triangle (World Wars) (US)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, bermudataRomInfo, bermudataRomName, NULL, NULL, BermudatInputInfo, BermudatDIPInfo, - BermudatInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// Guerrilla War (US) - -static struct BurnRomInfo gwarRomDesc[] = { - { "7g", 0x10000, 0x5bcfa7dc, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "g02", 0x10000, 0x86d931bf, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "g03", 0x10000, 0xeb544ab9, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "guprom.3", 0x00400, 0x090236a3, 14 | BRF_GRA }, // 3 Color Data - { "guprom.2", 0x00400, 0x9147de69, 14 | BRF_GRA }, // 4 - { "guprom.1", 0x00400, 0x7f9c839e, 14 | BRF_GRA }, // 5 - { "btj_h.prm", 0x00400, 0xc20b197b, 0 | BRF_OPT }, // 6 - { "btj_v.prm", 0x00400, 0x5d0c617f, 0 | BRF_OPT }, // 7 - { "ls.bin", 0x01000, 0x73df921d, 0 | BRF_OPT }, // 8 - - { "g05", 0x08000, 0x80f73e2e, 4 | BRF_GRA }, // 9 Text Characters - - { "g06", 0x10000, 0xf1dcdaef, 5 | BRF_GRA }, // 10 Background Layer - { "g07", 0x10000, 0x326e4e5e, 5 | BRF_GRA }, // 11 - { "g08", 0x10000, 0x0aa70967, 5 | BRF_GRA }, // 12 - { "g09", 0x10000, 0xb7686336, 5 | BRF_GRA }, // 13 - - { "g10", 0x10000, 0x58600f7d, 7 | BRF_GRA }, // 14 16x16 Sprites - { "g11", 0x10000, 0xa3f9b463, 7 | BRF_GRA }, // 15 - { "g12", 0x10000, 0x092501be, 7 | BRF_GRA }, // 16 - { "g13", 0x10000, 0x25801ea6, 7 | BRF_GRA }, // 17 - - { "g20", 0x10000, 0x2b46edff, 8 | BRF_GRA }, // 18 32x32 Sprites - { "g21", 0x10000, 0xbe19888d, 8 | BRF_GRA }, // 19 - { "g18", 0x10000, 0x2d653f0c, 8 | BRF_GRA }, // 21 - { "g19", 0x10000, 0xebbf3ba2, 8 | BRF_GRA }, // 22 - { "g16", 0x10000, 0xaeb3707f, 8 | BRF_GRA }, // 23 - { "g17", 0x10000, 0x0808f95f, 8 | BRF_GRA }, // 24 - { "g14", 0x10000, 0x8dfc7b87, 8 | BRF_GRA }, // 25 - { "g15", 0x10000, 0x06822aac, 8 | BRF_GRA }, // 26 - - { "g04", 0x10000, 0x2255f8dd, 15 | BRF_SND }, // 27 Samples -}; - -STD_ROM_PICK(gwar) -STD_ROM_FN(gwar) - -struct BurnDriver BurnDrvGwar = { - "gwar", NULL, NULL, NULL, "1987", - "Guerrilla War (US)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, gwarRomInfo, gwarRomName, NULL, NULL, GwarInputInfo, GwarDIPInfo, - GwarInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// Guevara (Japan) - -static struct BurnRomInfo gwarjRomDesc[] = { - { "7y3047", 0x10000, 0x7f8a880c, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "g02", 0x10000, 0x86d931bf, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "g03", 0x10000, 0xeb544ab9, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "guprom.3", 0x00400, 0x090236a3, 14 | BRF_GRA }, // 3 Color Data - { "guprom.2", 0x00400, 0x9147de69, 14 | BRF_GRA }, // 4 - { "guprom.1", 0x00400, 0x7f9c839e, 14 | BRF_GRA }, // 5 - { "btj_h.prm", 0x00400, 0xc20b197b, 0 | BRF_OPT }, // 6 - { "btj_v.prm", 0x00400, 0x5d0c617f, 0 | BRF_OPT }, // 7 - { "ls.bin", 0x01000, 0x73df921d, 0 | BRF_OPT }, // 8 - - { "792001", 0x08000, 0x99d7ddf3, 4 | BRF_GRA }, // 9 Text Characters - - { "g06", 0x10000, 0xf1dcdaef, 5 | BRF_GRA }, // 10 Background Layer - { "g07", 0x10000, 0x326e4e5e, 5 | BRF_GRA }, // 11 - { "g08", 0x10000, 0x0aa70967, 5 | BRF_GRA }, // 12 - { "g09", 0x10000, 0xb7686336, 5 | BRF_GRA }, // 13 - - { "g10", 0x10000, 0x58600f7d, 7 | BRF_GRA }, // 14 16x16 Sprites - { "g11", 0x10000, 0xa3f9b463, 7 | BRF_GRA }, // 15 - { "g12", 0x10000, 0x092501be, 7 | BRF_GRA }, // 16 - { "g13", 0x10000, 0x25801ea6, 7 | BRF_GRA }, // 17 - - { "g20", 0x10000, 0x2b46edff, 8 | BRF_GRA }, // 18 32x32 Sprites - { "g21", 0x10000, 0xbe19888d, 8 | BRF_GRA }, // 19 - { "g18", 0x10000, 0x2d653f0c, 8 | BRF_GRA }, // 21 - { "g19", 0x10000, 0xebbf3ba2, 8 | BRF_GRA }, // 22 - { "g16", 0x10000, 0xaeb3707f, 8 | BRF_GRA }, // 23 - { "g17", 0x10000, 0x0808f95f, 8 | BRF_GRA }, // 24 - { "g14", 0x10000, 0x8dfc7b87, 8 | BRF_GRA }, // 25 - { "g15", 0x10000, 0x06822aac, 8 | BRF_GRA }, // 26 - - { "g04", 0x10000, 0x2255f8dd, 15 | BRF_SND }, // 27 Samples -}; - -STD_ROM_PICK(gwarj) -STD_ROM_FN(gwarj) - -struct BurnDriver BurnDrvGwarj = { - "gwarj", "gwar", NULL, NULL, "1987", - "Guevara (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, gwarjRomInfo, gwarjRomName, NULL, NULL, GwarInputInfo, GwarDIPInfo, - GwarInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// Guerrilla War (Joystick hack bootleg) - -static struct BurnRomInfo gwarbRomDesc[] = { - { "g01", 0x10000, 0xce1d3c80, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "g02", 0x10000, 0x86d931bf, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "g03", 0x10000, 0xeb544ab9, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "guprom.3", 0x00400, 0x090236a3, 14 | BRF_GRA }, // 3 Color Data - { "guprom.2", 0x00400, 0x9147de69, 14 | BRF_GRA }, // 4 - { "guprom.1", 0x00400, 0x7f9c839e, 14 | BRF_GRA }, // 5 - - { "g05", 0x08000, 0x80f73e2e, 4 | BRF_GRA }, // 6 Text Characters - - { "g06", 0x10000, 0xf1dcdaef, 5 | BRF_GRA }, // 7 Background Layer - { "g07", 0x10000, 0x326e4e5e, 5 | BRF_GRA }, // 8 - { "g08", 0x10000, 0x0aa70967, 5 | BRF_GRA }, // 9 - { "g09", 0x10000, 0xb7686336, 5 | BRF_GRA }, // 10 - - { "g10", 0x10000, 0x58600f7d, 7 | BRF_GRA }, // 11 16x16 Sprites - { "g11", 0x10000, 0xa3f9b463, 7 | BRF_GRA }, // 12 - { "g12", 0x10000, 0x092501be, 7 | BRF_GRA }, // 13 - { "g13", 0x10000, 0x25801ea6, 7 | BRF_GRA }, // 14 - - { "g20", 0x10000, 0x2b46edff, 8 | BRF_GRA }, // 15 32x32 Sprites - { "g21", 0x10000, 0xbe19888d, 8 | BRF_GRA }, // 16 - { "g18", 0x10000, 0x2d653f0c, 8 | BRF_GRA }, // 17 - { "g19", 0x10000, 0xebbf3ba2, 8 | BRF_GRA }, // 18 - { "g16", 0x10000, 0xaeb3707f, 8 | BRF_GRA }, // 19 - { "g17", 0x10000, 0x0808f95f, 8 | BRF_GRA }, // 20 - { "g14", 0x10000, 0x8dfc7b87, 8 | BRF_GRA }, // 21 - { "g15", 0x10000, 0x06822aac, 8 | BRF_GRA }, // 22 - - { "g04", 0x10000, 0x2255f8dd, 15 | BRF_SND }, // 23 Samples -}; - -STD_ROM_PICK(gwarb) -STD_ROM_FN(gwarb) - -struct BurnDriver BurnDrvGwarb = { - "gwarb", "gwar", NULL, NULL, "1987", - "Guerrilla War (Joystick hack bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, gwarbRomInfo, gwarbRomName, NULL, NULL, GwarbInputInfo, GwarbDIPInfo, - GwarbInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// Guerrilla War (Version 1) - -static struct BurnRomInfo gwaraRomDesc[] = { - { "gv ver1 3.p4", 0x10000, 0x24936d83, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "gv4.p8", 0x10000, 0x26335a55, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "gv2.k7", 0x10000, 0x896682dd, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "1.k1", 0x00400, 0x090236a3, 14 | BRF_GRA }, // 3 Color Data - { "3.l2", 0x00400, 0x9147de69, 14 | BRF_GRA }, // 4 - { "2.l1", 0x00400, 0x7f9c839e, 14 | BRF_GRA }, // 5 - { "horizon.j8", 0x00400, 0xc20b197b, 0 | BRF_OPT }, // 6 - { "vertical.k8", 0x00400, 0x5d0c617f, 0 | BRF_OPT }, // 7 - { "ls.bin", 0x01000, 0x73df921d, 0 | BRF_OPT }, // 8 - - { "gv5.a3", 0x08000, 0x80f73e2e, 4 | BRF_GRA }, // 9 Text Characters - - { "gv13.ef1", 0x10000, 0xf1dcdaef, 5 | BRF_GRA }, // 10 Background Layer - { "gv12.d1", 0x10000, 0x326e4e5e, 5 | BRF_GRA }, // 11 - { "gv11.c1", 0x10000, 0x0aa70967, 5 | BRF_GRA }, // 12 - { "gv10.a1", 0x10000, 0xb7686336, 5 | BRF_GRA }, // 13 - - { "gv9.g3", 0x10000, 0x58600f7d, 7 | BRF_GRA }, // 14 16x16 Sprites - { "gv8.e3", 0x10000, 0xa3f9b463, 7 | BRF_GRA }, // 15 - { "gv7.cd3", 0x10000, 0x092501be, 7 | BRF_GRA }, // 16 - { "gv6.b3", 0x10000, 0x25801ea6, 7 | BRF_GRA }, // 17 - - { "gv14.f10", 0x10000, 0x2b46edff, 8 | BRF_GRA }, // 18 32x32 Sprites - { "gv15.h10", 0x10000, 0xbe19888d, 8 | BRF_GRA }, // 19 - { "gv16.j10", 0x10000, 0x2d653f0c, 8 | BRF_GRA }, // 20 - { "gv17.l10", 0x10000, 0xebbf3ba2, 8 | BRF_GRA }, // 21 - { "gv18.m10", 0x10000, 0xaeb3707f, 8 | BRF_GRA }, // 22 - { "gv19.pn10", 0x10000, 0x0808f95f, 8 | BRF_GRA }, // 23 - { "gv20.r10", 0x10000, 0x8dfc7b87, 8 | BRF_GRA }, // 24 - { "gv21.s10", 0x10000, 0x06822aac, 8 | BRF_GRA }, // 25 - - { "gv1.g5", 0x10000, 0x2255f8dd, 15 | BRF_SND }, // 26 Samples -}; - -STD_ROM_PICK(gwara) -STD_ROM_FN(gwara) - -struct BurnDriver BurnDrvGwara = { - "gwara", "gwar", NULL, NULL, "1987", - "Guerrilla War (Version 1)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, gwaraRomInfo, gwaraRomName, NULL, NULL, GwarInputInfo, GwarDIPInfo, - GwaraInit, DrvExit, GwarFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// T.N.K III (US) - -static struct BurnRomInfo tnk3RomDesc[] = { - { "tnk3-p1.bin", 0x04000, 0x0d2a8ca9, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "tnk3-p2.bin", 0x04000, 0x0ae0a483, 1 | BRF_ESS | BRF_PRG }, // 1 - { "tnk3-p3.bin", 0x04000, 0xd16dd4db, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "tnk3-p4.bin", 0x04000, 0x01b45a90, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - { "tnk3-p5.bin", 0x04000, 0x60db6667, 2 | BRF_ESS | BRF_PRG }, // 4 - { "tnk3-p6.bin", 0x04000, 0x4761fde7, 2 | BRF_ESS | BRF_PRG }, // 5 - - { "tnk3-p10.bin", 0x04000, 0x7bf0a517, 3 | BRF_ESS | BRF_PRG }, // 6 Z80 #2 Code - { "tnk3-p11.bin", 0x04000, 0x0569ce27, 3 | BRF_ESS | BRF_PRG }, // 7 - - { "7122.2", 0x00400, 0x34c06bc6, 14 | BRF_GRA }, // 8 Color Data - { "7122.1", 0x00400, 0x6d0ac66a, 14 | BRF_GRA }, // 9 - { "7122.0", 0x00400, 0x4662b4c8, 14 | BRF_GRA }, // 10 - - { "tnk3-p14.bin", 0x02000, 0x1fd18c43, 4 | BRF_GRA }, // 11 Text Characters - - { "tnk3-p12.bin", 0x04000, 0xff495a16, 6 | BRF_GRA }, // 12 Background Characters - { "tnk3-p13.bin", 0x04000, 0xf8344843, 6 | BRF_GRA }, // 13 - - { "tnk3-p7.bin", 0x04000, 0x06b92c88, 9 | BRF_GRA }, // 14 Sprites - { "tnk3-p8.bin", 0x04000, 0x63d0e2eb, 9 | BRF_GRA }, // 15 - { "tnk3-p9.bin", 0x04000, 0x872e3fac, 9 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(tnk3) -STD_ROM_FN(tnk3) - -struct BurnDriver BurnDrvTnk3 = { - "tnk3", NULL, NULL, NULL, "1985", - "T.N.K III (US)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, tnk3RomInfo, tnk3RomName, NULL, NULL, Tnk3InputInfo, Tnk3DIPInfo, - Tnk3Init, DrvExit, Tnk3Frame, Tnk3Draw, DrvScan, &DrvRecalc, 0x400, - 224, 288, 3, 4 -}; - - -// T.A.N.K (Japan) - -static struct BurnRomInfo tnk3jRomDesc[] = { - { "p1.4e", 0x04000, 0x03aca147, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "tnk3-p2.bin", 0x04000, 0x0ae0a483, 1 | BRF_ESS | BRF_PRG }, // 1 - { "tnk3-p3.bin", 0x04000, 0xd16dd4db, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "tnk3-p4.bin", 0x04000, 0x01b45a90, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - { "tnk3-p5.bin", 0x04000, 0x60db6667, 2 | BRF_ESS | BRF_PRG }, // 4 - { "tnk3-p6.bin", 0x04000, 0x4761fde7, 2 | BRF_ESS | BRF_PRG }, // 5 - - { "tnk3-p10.bin", 0x04000, 0x7bf0a517, 3 | BRF_ESS | BRF_PRG }, // 6 Z80 #2 Code - { "tnk3-p11.bin", 0x04000, 0x0569ce27, 3 | BRF_ESS | BRF_PRG }, // 7 - - { "7122.2", 0x00400, 0x34c06bc6, 14 | BRF_GRA }, // 8 Color Data - { "7122.1", 0x00400, 0x6d0ac66a, 14 | BRF_GRA }, // 9 - { "7122.0", 0x00400, 0x4662b4c8, 14 | BRF_GRA }, // 10 - - { "p14.1e", 0x02000, 0x6bd575ca, 4 | BRF_GRA }, // 11 Text Characters - - { "tnk3-p12.bin", 0x04000, 0xff495a16, 6 | BRF_GRA }, // 12 Background Characters - { "tnk3-p13.bin", 0x04000, 0xf8344843, 6 | BRF_GRA }, // 13 - - { "tnk3-p7.bin", 0x04000, 0x06b92c88, 9 | BRF_GRA }, // 14 Sprites - { "tnk3-p8.bin", 0x04000, 0x63d0e2eb, 9 | BRF_GRA }, // 15 - { "tnk3-p9.bin", 0x04000, 0x872e3fac, 9 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(tnk3j) -STD_ROM_FN(tnk3j) - -struct BurnDriver BurnDrvTnk3j = { - "tnk3j", "tnk3", NULL, NULL, "1985", - "T.A.N.K (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, tnk3jRomInfo, tnk3jRomName, NULL, NULL, Tnk3InputInfo, Tnk3DIPInfo, - Tnk3Init, DrvExit, Tnk3Frame, Tnk3Draw, DrvScan, &DrvRecalc, 0x400, - 224, 288, 3, 4 -}; - - -// Athena - -static struct BurnRomInfo athenaRomDesc[] = { - { "up02_p4.rom", 0x04000, 0x900a113c, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "up02_m4.rom", 0x08000, 0x61c69474, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "up02_p8.rom", 0x04000, 0xdf50af7e, 2 | BRF_ESS | BRF_PRG }, // 2 Z80 #1 Code - { "up02_m8.rom", 0x08000, 0xf3c933df, 2 | BRF_ESS | BRF_PRG }, // 3 - - { "up02_g6.rom", 0x04000, 0x42dbe029, 3 | BRF_ESS | BRF_PRG }, // 4 Z80 #2 Code - { "up02_k6.rom", 0x08000, 0x596f1c8a, 3 | BRF_ESS | BRF_PRG }, // 5 - - { "up02_c2.rom", 0x00400, 0x294279ae, 14 | BRF_GRA }, // 6 Color Data - { "up02_b1.rom", 0x00400, 0xd25c9099, 14 | BRF_GRA }, // 7 - { "up02_c1.rom", 0x00400, 0xa4a4e7dc, 14 | BRF_GRA }, // 8 - - { "up01_d2.rom", 0x04000, 0x18b4bcca, 4 | BRF_GRA }, // 9 Text Characters - - { "up01_b2.rom", 0x08000, 0xf269c0eb, 6 | BRF_GRA }, // 10 Background Characters - - { "up01_p2.rom", 0x08000, 0xc63a871f, 9 | BRF_GRA }, // 11 Sprites - { "up01_s2.rom", 0x08000, 0x760568d8, 9 | BRF_GRA }, // 12 - { "up01_t2.rom", 0x08000, 0x57b35c73, 9 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(athena) -STD_ROM_FN(athena) - -struct BurnDriver BurnDrvAthena = { - "athena", NULL, NULL, NULL, "1986", - "Athena\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, athenaRomInfo, athenaRomName, NULL, NULL, AthenaInputInfo, AthenaDIPInfo, - AthenaInit, DrvExit, AthenaFrame, Tnk3Draw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// ASO - Armored Scrum Object - -static struct BurnRomInfo asoRomDesc[] = { - { "aso_p1.d8", 0x04000, 0x84981f3c, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "aso_p2.d7", 0x04000, 0xcfe912a6, 1 | BRF_ESS | BRF_PRG }, // 1 - { "aso_p3.d5", 0x04000, 0x39a666d2, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "aso_p4.d3", 0x04000, 0xa4122355, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - { "p5.d2", 0x04000, 0x9879e506, 2 | BRF_ESS | BRF_PRG }, // 4 - { "p6.d1", 0x04000, 0xc0bfdf1f, 2 | BRF_ESS | BRF_PRG }, // 5 - - { "p7.f4", 0x04000, 0xdbc19736, 3 | BRF_ESS | BRF_PRG }, // 6 Z80 #2 Code - { "p8.f3", 0x04000, 0x537726a9, 3 | BRF_ESS | BRF_PRG }, // 7 - { "p9.f2", 0x04000, 0xaef5a4f4, 3 | BRF_ESS | BRF_PRG }, // 8 - - { "aso_p14.h1", 0x02000, 0x8baa2253, 4 | BRF_GRA }, // 9 Text Characters - - { "p10.h14", 0x08000, 0x00dff996, 6 | BRF_GRA }, // 10 Background Characters - - { "p11.h11", 0x08000, 0x7feac86c, 9 | BRF_GRA }, // 11 Sprites - { "p12.h9", 0x08000, 0x6895990b, 9 | BRF_GRA }, // 12 - { "p13.h8", 0x08000, 0x87a81ce1, 9 | BRF_GRA }, // 13 - - { "mb7122h.f12", 0x00400, 0x5b0a0059, 14 | BRF_GRA }, // 14 Color Data - { "mb7122h.f13", 0x00400, 0x37e28dd8, 14 | BRF_GRA }, // 15 - { "mb7122h.f14", 0x00400, 0xc3fd1dd3, 14 | BRF_GRA }, // 16 - - { "pal16l8a-1.bin", 0x00104, 0x4e3f9e0d, 0 | BRF_OPT }, // 17 PLDs - { "pal16l8a-2.bin", 0x00104, 0x2a681f9e, 0 | BRF_OPT }, // 18 - { "pal16r6a.bin", 0x00104, 0x59c03681, 0 | BRF_OPT }, // 19 -}; - -STD_ROM_PICK(aso) -STD_ROM_FN(aso) - -struct BurnDriver BurnDrvAso = { - "aso", NULL, NULL, NULL, "1985", - "ASO - Armored Scrum Object\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, asoRomInfo, asoRomName, NULL, NULL, AsoInputInfo, AsoDIPInfo, - AsoInit, DrvExit, Tnk3Frame, AsoDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Alpha Mission - -static struct BurnRomInfo alphamisRomDesc[] = { - { "p1.rom", 0x04000, 0x69af874b, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "p2.rom", 0x04000, 0x7707bfe3, 1 | BRF_ESS | BRF_PRG }, // 1 - { "p3.rom", 0x04000, 0xb970d642, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "p4.rom", 0x04000, 0x91a89d3c, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - { "p5.d2", 0x04000, 0x9879e506, 2 | BRF_ESS | BRF_PRG }, // 4 - { "p6.d1", 0x04000, 0xc0bfdf1f, 2 | BRF_ESS | BRF_PRG }, // 5 - - { "p7.f4", 0x04000, 0xdbc19736, 3 | BRF_ESS | BRF_PRG }, // 6 Z80 #2 Code - { "p8.f3", 0x04000, 0x537726a9, 3 | BRF_ESS | BRF_PRG }, // 7 - { "p9.f2", 0x04000, 0xaef5a4f4, 3 | BRF_ESS | BRF_PRG }, // 8 - - { "p14.rom", 0x02000, 0xacbe29b2, 4 | BRF_GRA }, // 9 Text Characters - - { "p10.h14", 0x08000, 0x00dff996, 6 | BRF_GRA }, // 10 Background Characters - - { "p11.h11", 0x08000, 0x7feac86c, 9 | BRF_GRA }, // 11 Sprites - { "p12.h9", 0x08000, 0x6895990b, 9 | BRF_GRA }, // 12 - { "p13.h8", 0x08000, 0x87a81ce1, 9 | BRF_GRA }, // 13 - - { "mb7122h.f12", 0x00400, 0x5b0a0059, 14 | BRF_GRA }, // 14 Color Data - { "mb7122h.f13", 0x00400, 0x37e28dd8, 14 | BRF_GRA }, // 15 - { "mb7122h.f14", 0x00400, 0xc3fd1dd3, 14 | BRF_GRA }, // 16 - - { "pal16l8a-1.bin", 0x00104, 0x4e3f9e0d, 0 | BRF_OPT }, // 17 PLDs - { "pal16l8a-2.bin", 0x00104, 0x2a681f9e, 0 | BRF_OPT }, // 18 - { "pal16r6a.bin", 0x00104, 0x59c03681, 0 | BRF_OPT }, // 19 -}; - -STD_ROM_PICK(alphamis) -STD_ROM_FN(alphamis) - -struct BurnDriver BurnDrvAlphamis = { - "alphamis", "aso", NULL, NULL, "1985", - "Alpha Mission\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, alphamisRomInfo, alphamisRomName, NULL, NULL, AlphamisInputInfo, AlphamisDIPInfo, - AlphamisInit, DrvExit, Tnk3Frame, AsoDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Arian Mission - -static struct BurnRomInfo arianRomDesc[] = { - { "p1.d8", 0x04000, 0x0ca89307, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "p2.d7", 0x04000, 0x724518c3, 1 | BRF_ESS | BRF_PRG }, // 1 - { "p3.d6", 0x04000, 0x4d8db650, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "p4.d3", 0x04000, 0x47baf1db, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - { "p5.d2", 0x04000, 0x9879e506, 2 | BRF_ESS | BRF_PRG }, // 4 - { "p6.d1", 0x04000, 0xc0bfdf1f, 2 | BRF_ESS | BRF_PRG }, // 5 - - { "p7.f4", 0x04000, 0xdbc19736, 3 | BRF_ESS | BRF_PRG }, // 6 Z80 #2 Code - { "p8.f3", 0x04000, 0x537726a9, 3 | BRF_ESS | BRF_PRG }, // 7 - { "p9.f2", 0x04000, 0xaef5a4f4, 3 | BRF_ESS | BRF_PRG }, // 8 - - { "p14.h1", 0x02000, 0xe599bd30, 4 | BRF_GRA }, // 9 Text Characters - - { "p10.h14", 0x08000, 0x00dff996, 6 | BRF_GRA }, // 10 Background Characters - - { "p11.h11", 0x08000, 0x7feac86c, 9 | BRF_GRA }, // 11 Sprites - { "p12.h9", 0x08000, 0x6895990b, 9 | BRF_GRA }, // 12 - { "p13.h8", 0x08000, 0x87a81ce1, 9 | BRF_GRA }, // 13 - - { "mb7122h.f12", 0x00400, 0x5b0a0059, 14 | BRF_GRA }, // 14 Color Data - { "mb7122h.f13", 0x00400, 0x37e28dd8, 14 | BRF_GRA }, // 15 - { "mb7122h.f14", 0x00400, 0xc3fd1dd3, 14 | BRF_GRA }, // 16 - - { "pal16l8a-1.bin", 0x00104, 0x4e3f9e0d, 0 | BRF_OPT }, // 17 PLDs - { "pal16l8a-2.bin", 0x00104, 0x2a681f9e, 0 | BRF_OPT }, // 18 - { "pal16r6a.bin", 0x00104, 0x59c03681, 0 | BRF_OPT }, // 19 -}; - -STD_ROM_PICK(arian) -STD_ROM_FN(arian) - -struct BurnDriver BurnDrvArian = { - "arian", "aso", NULL, NULL, "1985", - "Arian Mission\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, arianRomInfo, arianRomName, NULL, NULL, AlphamisInputInfo, AlphamisDIPInfo, - AlphamisInit, DrvExit, Tnk3Frame, AsoDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Fighting Golf (World?) - -static struct BurnRomInfo fitegolfRomDesc[] = { - { "gu2", 0x04000, 0x19be7ad6, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "gu1", 0x08000, 0xbc32568f, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "gu6", 0x04000, 0x2b9978c5, 2 | BRF_ESS | BRF_PRG }, // 2 Z80 #1 Code - { "gu5", 0x08000, 0xea3d138c, 2 | BRF_ESS | BRF_PRG }, // 3 - - { "gu3", 0x04000, 0x811b87d7, 3 | BRF_ESS | BRF_PRG }, // 4 Z80 #2 Code - { "gu4", 0x08000, 0x2d998e2b, 3 | BRF_ESS | BRF_PRG }, // 5 - - { "82s137.2c", 0x00400, 0x6e4c7836, 14 | BRF_GRA }, // 6 Color Data - { "82s137.1b", 0x00400, 0x29e7986f, 14 | BRF_GRA }, // 7 - { "82s137.1c", 0x00400, 0x27ba9ff9, 14 | BRF_GRA }, // 8 - - { "gu8", 0x04000, 0xf1628dcf, 4 | BRF_GRA }, // 9 Text Characters - - { "gu7", 0x08000, 0x4655f94e, 6 | BRF_GRA }, // 10 Background Characters - - { "gu9", 0x08000, 0xd4957ec5, 9 | BRF_GRA }, // 11 Sprites - { "gu10", 0x08000, 0xb3acdac2, 9 | BRF_GRA }, // 12 - { "gu11", 0x08000, 0xb99cf73b, 9 | BRF_GRA }, // 13 - - { "pal16r6a.6c", 0x00104, 0xde291f4e, 0 | BRF_OPT }, // 14 PLDs - { "pal16l8a.3f", 0x00104, 0xc5f1c1da, 0 | BRF_OPT }, // 15 - { "pal20l8a.6r", 0x00144, 0x0f011673, 0 | BRF_OPT }, // 16 -}; - -STD_ROM_PICK(fitegolf) -STD_ROM_FN(fitegolf) - -struct BurnDriver BurnDrvFitegolf = { - "fitegolf", NULL, NULL, NULL, "1988", - "Fighting Golf (World?)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, fitegolfRomInfo, fitegolfRomName, NULL, NULL, FitegolfInputInfo, FitegolfDIPInfo, - FitegolfInit, DrvExit, FitegolfFrame, Tnk3Draw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Fighting Golf (US) - -static struct BurnRomInfo fitegolfuRomDesc[] = { - { "np45.128", 0x04000, 0x16e8e763, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "mn45.256", 0x08000, 0xa4fa09d5, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "gu6", 0x04000, 0x2b9978c5, 2 | BRF_ESS | BRF_PRG }, // 2 Z80 #1 Code - { "gu5", 0x08000, 0xea3d138c, 2 | BRF_ESS | BRF_PRG }, // 3 - - { "gu3", 0x04000, 0x811b87d7, 3 | BRF_ESS | BRF_PRG }, // 4 Z80 #2 Code - { "gu4", 0x08000, 0x2d998e2b, 3 | BRF_ESS | BRF_PRG }, // 5 - - { "82s137.2c", 0x00400, 0x6e4c7836, 14 | BRF_GRA }, // 6 Color Data - { "82s137.1b", 0x00400, 0x29e7986f, 14 | BRF_GRA }, // 7 - { "82s137.1c", 0x00400, 0x27ba9ff9, 14 | BRF_GRA }, // 8 - - { "gu8", 0x04000, 0xf1628dcf, 4 | BRF_GRA }, // 9 Text Characters - - { "gu7", 0x08000, 0x4655f94e, 6 | BRF_GRA }, // 10 Background Characters - - { "gu9", 0x08000, 0xd4957ec5, 9 | BRF_GRA }, // 11 Sprites - { "gu10", 0x08000, 0xb3acdac2, 9 | BRF_GRA }, // 12 - { "gu11", 0x08000, 0xb99cf73b, 9 | BRF_GRA }, // 13 - - { "pal16r6a.6c", 0x00104, 0xde291f4e, 0 | BRF_OPT }, // 14 PLDs - { "pal16l8a.3f", 0x00104, 0xc5f1c1da, 0 | BRF_OPT }, // 15 - { "pal20l8a.6r", 0x00144, 0x0f011673, 0 | BRF_OPT }, // 16 -}; - -STD_ROM_PICK(fitegolfu) -STD_ROM_FN(fitegolfu) - -struct BurnDriver BurnDrvFitegolfu = { - "fitegolfu", "fitegolf", NULL, NULL, "1988", - "Fighting Golf (US)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, fitegolfuRomInfo, fitegolfuRomName, NULL, NULL, FitegolfInputInfo, FitegolfDIPInfo, - FitegolfInit, DrvExit, FitegolfFrame, Tnk3Draw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Fighting Golf (US, Ver 2) - -static struct BurnRomInfo fitegolf2RomDesc[] = { - { "fg_ver2_6.4e", 0x04000, 0x4cc9ef0c, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "fg_ver2_7.g4", 0x04000, 0x144b0beb, 1 | BRF_ESS | BRF_PRG }, // 1 - { "fg_ver2_8.4h", 0x04000, 0x057888c9, 1 | BRF_ESS | BRF_PRG }, // 2 - - { "fg_ver2_3.2e", 0x04000, 0xcf8c29d7, 2 | BRF_ESS | BRF_PRG }, // 3 Z80 #1 Code - { "fg_ver2_4.2g", 0x04000, 0x90c1fb09, 2 | BRF_ESS | BRF_PRG }, // 4 - { "fg_ver2_5.2h", 0x04000, 0x0ffbdbb8, 2 | BRF_ESS | BRF_PRG }, // 5 - - { "fg_2.3e", 0x04000, 0x811b87d7, 3 | BRF_ESS | BRF_PRG }, // 6 Z80 #2 Code - { "fg_1.2e", 0x08000, 0x2d998e2b, 3 | BRF_ESS | BRF_PRG }, // 7 - - { "gl1.5f", 0x00400, 0x6e4c7836, 14 | BRF_GRA }, // 8 Color Data - { "gl2.5g", 0x00400, 0x29e7986f, 14 | BRF_GRA }, // 9 - { "gl3.5h", 0x00400, 0x27ba9ff9, 14 | BRF_GRA }, // 10 - - { "fg_12.1e", 0x04000, 0xf1628dcf, 4 | BRF_GRA }, // 11 Text Characters - - { "fg_14.3d", 0x04000, 0x29393a19, 6 | BRF_GRA }, // 12 Background Characters - { "fg_ver2_13.3c", 0x04000, 0x5cd57c93, 6 | BRF_GRA }, // 13 - - { "fg_ver2_11.7h", 0x08000, 0xd4957ec5, 9 | BRF_GRA }, // 14 Sprites - { "fg_ver2_10.7g", 0x08000, 0xb3acdac2, 9 | BRF_GRA }, // 15 - { "fg_ver2_9.7e", 0x08000, 0xb99cf73b, 9 | BRF_GRA }, // 16 - - { "pal16r6a.6c", 0x00104, 0xde291f4e, 0 | BRF_OPT }, // 17 PLDs - { "pal16l8a.3f", 0x00104, 0xc5f1c1da, 0 | BRF_OPT }, // 18 - { "pal20l8a.6r", 0x00144, 0x0f011673, 0 | BRF_OPT }, // 19 -}; - -STD_ROM_PICK(fitegolf2) -STD_ROM_FN(fitegolf2) - -struct BurnDriver BurnDrvFitegolf2 = { - "fitegolf2", "fitegolf", NULL, NULL, "1988", - "Fighting Golf (US, Ver 2)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, fitegolf2RomInfo, fitegolf2RomName, NULL, NULL, FitegolfInputInfo, FitegolfDIPInfo, - FitegolfInit, DrvExit, FitegolfFrame, Tnk3Draw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Country Club - -static struct BurnRomInfo countrycRomDesc[] = { - { "cc5.4e", 0x04000, 0x07666af8, 1 | BRF_ESS | BRF_PRG }, // 3 Z80 #0 Code - { "cc6.4g", 0x04000, 0xab18fd9f, 1 | BRF_ESS | BRF_PRG }, // 4 - { "cc7.4h", 0x04000, 0x58a1ec0c, 1 | BRF_ESS | BRF_PRG }, // 5 - - { "cc2.2e", 0x04000, 0x43d205e0, 2 | BRF_ESS | BRF_PRG }, // 0 Z80 #1 Code - { "cc3.2g", 0x04000, 0x7290770f, 2 | BRF_ESS | BRF_PRG }, // 1 - { "cc4.2h", 0x04000, 0x61990582, 2 | BRF_ESS | BRF_PRG }, // 2 - - { "cc1.1f", 0x10000, 0x863f1624, 3 | BRF_ESS | BRF_PRG }, // 6 Z80 #2 Code - - { "cc1pr.5f", 0x00400, 0x7da9ce33, 14 | BRF_GRA }, // 7 Color Data - { "cc2pr.5g", 0x00400, 0x982e4f46, 14 | BRF_GRA }, // 8 - { "cc3pr.5h", 0x00400, 0x47f2b83d, 14 | BRF_GRA }, // 9 - - { "cc11.1e", 0x04000, 0xce927ac7, 4 | BRF_GRA }, // 10 Text Characters - - { "cc13.2d", 0x04000, 0xef86c388, 6 | BRF_GRA }, // 11 Background Characters - { "cc12.2c", 0x04000, 0xd7d55a36, 6 | BRF_GRA }, // 12 - - { "cc10.7h", 0x08000, 0x90091667, 9 | BRF_GRA }, // 13 Sprites - { "cc9.7g", 0x08000, 0x56249142, 9 | BRF_GRA }, // 14 - { "cc8.7e", 0x08000, 0x55943065, 9 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(countryc) -STD_ROM_FN(countryc) - -struct BurnDriver BurnDrvCountryc = { - "countryc", NULL, NULL, NULL, "1988", - "Country Club\0", "bad inputs, use fitegolf instead!", "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - /*BDF_GAME_WORKING |*/0, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, countrycRomInfo, countrycRomName, NULL, NULL, FitegolfInputInfo, FitegolfDIPInfo, // wrong - FitegolfInit, DrvExit, FitegolfFrame, Tnk3Draw, DrvScan, &DrvRecalc, 0x400, - 288, 216, 4, 3 -}; - - -// Ikari Warriors (US JAMMA) - -static struct BurnRomInfo ikariRomDesc[] = { - { "1.rom", 0x10000, 0x52a8b2dd, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "2.rom", 0x10000, 0x45364d55, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "3.rom", 0x10000, 0x56a26699, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "7122er.prm", 0x00400, 0xb9bf2c2c, 14 | BRF_GRA }, // 3 Color Data - { "7122eg.prm", 0x00400, 0x0703a770, 14 | BRF_GRA }, // 4 - { "7122eb.prm", 0x00400, 0x0a11cdde, 14 | BRF_GRA }, // 5 - - { "7.rom", 0x04000, 0xa7eb4917, 4 | BRF_GRA }, // 6 Text Characters - - { "17.rom", 0x08000, 0xe0dba976, 6 | BRF_GRA }, // 7 Background Characters - { "18.rom", 0x08000, 0x24947d5f, 6 | BRF_GRA }, // 8 - { "19.rom", 0x08000, 0x9ee59e91, 6 | BRF_GRA }, // 9 - { "20.rom", 0x08000, 0x5da7ec1a, 6 | BRF_GRA }, // 10 - - { "8.rom", 0x08000, 0x9827c14a, 9 | BRF_GRA }, // 11 16x16 Sprites - { "9.rom", 0x08000, 0x545c790c, 9 | BRF_GRA }, // 12 - { "10.rom", 0x08000, 0xec9ba07e, 9 | BRF_GRA }, // 13 - - { "11.rom", 0x08000, 0x5c75ea8f, 10 | BRF_GRA }, // 14 32x32 Sprites - { "14.rom", 0x08000, 0x3293fde4, 10 | BRF_GRA }, // 15 - { "12.rom", 0x08000, 0x95138498, 10 | BRF_GRA }, // 16 - { "15.rom", 0x08000, 0x65a61c99, 10 | BRF_GRA }, // 17 - { "13.rom", 0x08000, 0x315383d7, 10 | BRF_GRA }, // 18 - { "16.rom", 0x08000, 0xe9b03e07, 10 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(ikari) -STD_ROM_FN(ikari) - -struct BurnDriver BurnDrvIkari = { - "ikari", NULL, NULL, NULL, "1986", - "Ikari Warriors (US JAMMA)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikariRomInfo, ikariRomName, NULL, NULL, IkariInputInfo, IkariDIPInfo, - IkariInit, DrvExit, AthenaFrame, IkariDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Ikari Warriors (US) - -static struct BurnRomInfo ikariaRomDesc[] = { - { "p1.bin", 0x04000, 0xad0e440e, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "p2.bin", 0x08000, 0xb585e931, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "p3", 0x04000, 0x8a9bd1f0, 2 | BRF_ESS | BRF_PRG }, // 2 Z80 #1 Code - { "p4", 0x08000, 0xf4101cb4, 2 | BRF_ESS | BRF_PRG }, // 3 - - { "ik5", 0x04000, 0x863448fa, 3 | BRF_ESS | BRF_PRG }, // 4 Z80 #2 Code - { "ik6", 0x08000, 0x9b16aa57, 3 | BRF_ESS | BRF_PRG }, // 5 - - { "7122er.prm", 0x00400, 0xb9bf2c2c, 14 | BRF_GRA }, // 6 Color Data - { "7122eg.prm", 0x00400, 0x0703a770, 14 | BRF_GRA }, // 7 - { "7122eb.prm", 0x00400, 0x0a11cdde, 14 | BRF_GRA }, // 8 - - { "7.rom", 0x04000, 0xa7eb4917, 4 | BRF_GRA }, // 9 Text Characters - - { "17.rom", 0x08000, 0xe0dba976, 6 | BRF_GRA }, // 10 Background Tiles - { "18.rom", 0x08000, 0x24947d5f, 6 | BRF_GRA }, // 11 - { "19.rom", 0x08000, 0x9ee59e91, 6 | BRF_GRA }, // 12 - { "20.rom", 0x08000, 0x5da7ec1a, 6 | BRF_GRA }, // 13 - - { "8.rom", 0x08000, 0x9827c14a, 9 | BRF_GRA }, // 14 16x16 Sprite Tiles - { "9.rom", 0x08000, 0x545c790c, 9 | BRF_GRA }, // 15 - { "10.rom", 0x08000, 0xec9ba07e, 9 | BRF_GRA }, // 16 - - { "11.rom", 0x08000, 0x5c75ea8f, 10 | BRF_GRA }, // 17 32x32 Sprite Tiles - { "14.rom", 0x08000, 0x3293fde4, 10 | BRF_GRA }, // 18 - { "12.rom", 0x08000, 0x95138498, 10 | BRF_GRA }, // 19 - { "15.rom", 0x08000, 0x65a61c99, 10 | BRF_GRA }, // 20 - { "13.rom", 0x08000, 0x315383d7, 10 | BRF_GRA }, // 21 - { "16.rom", 0x08000, 0xe9b03e07, 10 | BRF_GRA }, // 22 -}; - -STD_ROM_PICK(ikaria) -STD_ROM_FN(ikaria) - -struct BurnDriver BurnDrvIkaria = { - "ikaria", "ikari", NULL, NULL, "1986", - "Ikari Warriors (US)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikariaRomInfo, ikariaRomName, NULL, NULL, IkariaInputInfo, IkariDIPInfo, - IkariaInit, DrvExit, AthenaFrame, IkariDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Ikari Warriors (US No Continues) - -static struct BurnRomInfo ikarincRomDesc[] = { - { "p1", 0x04000, 0x738fcec4, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "p2", 0x08000, 0x89f7945a, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "p3", 0x04000, 0x8a9bd1f0, 2 | BRF_ESS | BRF_PRG }, // 2 Z80 #1 Code - { "p4", 0x08000, 0xf4101cb4, 2 | BRF_ESS | BRF_PRG }, // 3 - - { "ik5", 0x04000, 0x863448fa, 3 | BRF_ESS | BRF_PRG }, // 4 Z80 #2 Code - { "ik6", 0x08000, 0x9b16aa57, 3 | BRF_ESS | BRF_PRG }, // 5 - - { "7122er.prm", 0x00400, 0xb9bf2c2c, 14 | BRF_GRA }, // 6 Color Data - { "7122eg.prm", 0x00400, 0x0703a770, 14 | BRF_GRA }, // 7 - { "7122eb.prm", 0x00400, 0x0a11cdde, 14 | BRF_GRA }, // 8 - - { "7.rom", 0x04000, 0xa7eb4917, 4 | BRF_GRA }, // 9 Text Characters - - { "17.rom", 0x08000, 0xe0dba976, 6 | BRF_GRA }, // 10 Background Tiles - { "18.rom", 0x08000, 0x24947d5f, 6 | BRF_GRA }, // 11 - { "19.rom", 0x08000, 0x9ee59e91, 6 | BRF_GRA }, // 12 - { "20.rom", 0x08000, 0x5da7ec1a, 6 | BRF_GRA }, // 13 - - { "8.rom", 0x08000, 0x9827c14a, 9 | BRF_GRA }, // 14 16x16 Sprite Tiles - { "9.rom", 0x08000, 0x545c790c, 9 | BRF_GRA }, // 15 - { "10.rom", 0x08000, 0xec9ba07e, 9 | BRF_GRA }, // 16 - - { "11.rom", 0x08000, 0x5c75ea8f, 10 | BRF_GRA }, // 17 32x32 Sprite Tiles - { "14.rom", 0x08000, 0x3293fde4, 10 | BRF_GRA }, // 18 - { "12.rom", 0x08000, 0x95138498, 10 | BRF_GRA }, // 19 - { "15.rom", 0x08000, 0x65a61c99, 10 | BRF_GRA }, // 20 - { "13.rom", 0x08000, 0x315383d7, 10 | BRF_GRA }, // 21 - { "16.rom", 0x08000, 0xe9b03e07, 10 | BRF_GRA }, // 22 - - { "ampal16r6a-a5004.1", 0x0104, 0xa2e9a162, 0 | BRF_OPT }, // 23 plds - { "pal20l8a-a5004.2", 0x0144, 0x28f2c404, 0 | BRF_OPT }, // 24 - { "ampal16l8a-a5004.3", 0x0104, 0x540351f2, 0 | BRF_OPT }, // 25 - { "ampal16l8a-a5004.4", 0x0104, 0x540351f2, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(ikarinc) -STD_ROM_FN(ikarinc) - -struct BurnDriver BurnDrvIkarinc = { - "ikarinc", "ikari", NULL, NULL, "1986", - "Ikari Warriors (US No Continues)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikarincRomInfo, ikarincRomName, NULL, NULL, IkariaInputInfo, IkariDIPInfo, - IkariInit, DrvExit, AthenaFrame, IkariDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Ikari (Japan No Continues) - -static struct BurnRomInfo ikarijpRomDesc[] = { - { "up03_l4.rom", 0x04000, 0xcde006be, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "up03_k4.rom", 0x08000, 0x26948850, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "ik3", 0x04000, 0x9bb385f8, 2 | BRF_ESS | BRF_PRG }, // 2 Z80 #1 Code - { "ik4", 0x08000, 0x3a144bca, 2 | BRF_ESS | BRF_PRG }, // 3 - - { "ik5", 0x04000, 0x863448fa, 3 | BRF_ESS | BRF_PRG }, // 4 Z80 #2 Code - { "ik6", 0x08000, 0x9b16aa57, 3 | BRF_ESS | BRF_PRG }, // 5 - - { "7122er.prm", 0x00400, 0xb9bf2c2c, 14 | BRF_GRA }, // 6 Color Data - { "7122eg.prm", 0x00400, 0x0703a770, 14 | BRF_GRA }, // 7 - { "7122eb.prm", 0x00400, 0x0a11cdde, 14 | BRF_GRA }, // 8 - - { "ik7", 0x04000, 0x9e88f536, 4 | BRF_GRA }, // 9 Text Characters - - { "17.rom", 0x08000, 0xe0dba976, 6 | BRF_GRA }, // 10 Background Tiles - { "18.rom", 0x08000, 0x24947d5f, 6 | BRF_GRA }, // 11 - { "ik19", 0x08000, 0x566242ec, 6 | BRF_GRA }, // 12 - { "20.rom", 0x08000, 0x5da7ec1a, 6 | BRF_GRA }, // 13 - - { "ik8", 0x08000, 0x75d796d0, 9 | BRF_GRA }, // 14 16x16 Sprite Tiles - { "ik9", 0x08000, 0x2c34903b, 9 | BRF_GRA }, // 15 - { "ik10", 0x08000, 0xda9ccc94, 9 | BRF_GRA }, // 16 - - { "11.rom", 0x08000, 0x5c75ea8f, 10 | BRF_GRA }, // 17 32x32 Sprite Tiles - { "14.rom", 0x08000, 0x3293fde4, 10 | BRF_GRA }, // 18 - { "12.rom", 0x08000, 0x95138498, 10 | BRF_GRA }, // 19 - { "15.rom", 0x08000, 0x65a61c99, 10 | BRF_GRA }, // 20 - { "13.rom", 0x08000, 0x315383d7, 10 | BRF_GRA }, // 21 - { "16.rom", 0x08000, 0xe9b03e07, 10 | BRF_GRA }, // 22 - - { "ampal16r6a-a5004.1", 0x00104, 0xa2e9a162, 0 | BRF_OPT }, // 23 plds - { "pal20l8a-a5004.2", 0x00144, 0x28f2c404, 0 | BRF_OPT }, // 24 - { "ampal16l8a-a5004.3", 0x00104, 0x540351f2, 0 | BRF_OPT }, // 25 - { "ampal16l8a-a5004.4", 0x00104, 0x540351f2, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(ikarijp) -STD_ROM_FN(ikarijp) - -struct BurnDriver BurnDrvIkarijp = { - "ikarijp", "ikari", NULL, NULL, "1986", - "Ikari (Japan No Continues)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikarijpRomInfo, ikarijpRomName, NULL, NULL, IkariaInputInfo, IkariDIPInfo, - IkariaInit, DrvExit, AthenaFrame, IkariDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Ikari (Joystick hack bootleg) - -static struct BurnRomInfo ikarijpbRomDesc[] = { - { "ik1", 0x04000, 0x2ef87dce, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "up03_k4.rom", 0x08000, 0x26948850, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "ik3", 0x04000, 0x9bb385f8, 2 | BRF_ESS | BRF_PRG }, // 2 Z80 #1 Code - { "ik4", 0x08000, 0x3a144bca, 2 | BRF_ESS | BRF_PRG }, // 3 - - { "ik5", 0x04000, 0x863448fa, 3 | BRF_ESS | BRF_PRG }, // 4 Z80 #2 Code - { "ik6", 0x08000, 0x9b16aa57, 3 | BRF_ESS | BRF_PRG }, // 5 - - { "7122er.prm", 0x00400, 0xb9bf2c2c, 14 | BRF_GRA }, // 6 Color Data - { "7122eg.prm", 0x00400, 0x0703a770, 14 | BRF_GRA }, // 7 - { "7122eb.prm", 0x00400, 0x0a11cdde, 14 | BRF_GRA }, // 8 - - { "ik7", 0x04000, 0x9e88f536, 4 | BRF_GRA }, // 9 Text Characters - - { "17.rom", 0x08000, 0xe0dba976, 6 | BRF_GRA }, // 10 Background Tiles - { "18.rom", 0x08000, 0x24947d5f, 6 | BRF_GRA }, // 11 - { "ik19", 0x08000, 0x566242ec, 6 | BRF_GRA }, // 12 - { "20.rom", 0x08000, 0x5da7ec1a, 6 | BRF_GRA }, // 13 - - { "ik8", 0x08000, 0x75d796d0, 9 | BRF_GRA }, // 14 16x16 Sprite Tiles - { "ik9", 0x08000, 0x2c34903b, 9 | BRF_GRA }, // 15 - { "ik10", 0x08000, 0xda9ccc94, 9 | BRF_GRA }, // 16 - - { "11.rom", 0x08000, 0x5c75ea8f, 10 | BRF_GRA }, // 17 32x32 Sprite Tiles - { "14.rom", 0x08000, 0x3293fde4, 10 | BRF_GRA }, // 18 - { "12.rom", 0x08000, 0x95138498, 10 | BRF_GRA }, // 19 - { "15.rom", 0x08000, 0x65a61c99, 10 | BRF_GRA }, // 20 - { "13.rom", 0x08000, 0x315383d7, 10 | BRF_GRA }, // 21 - { "16.rom", 0x08000, 0xe9b03e07, 10 | BRF_GRA }, // 22 -}; - -STD_ROM_PICK(ikarijpb) -STD_ROM_FN(ikarijpb) - -struct BurnDriver BurnDrvIkarijpb = { - "ikarijpb", "ikari", NULL, NULL, "1986", - "Ikari (Joystick hack bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikarijpbRomInfo, ikarijpbRomName, NULL, NULL, IkariaInputInfo, IkariDIPInfo, - IkarijoyInit, DrvExit, AthenaFrame, IkariDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Rambo 3 (bootleg of Ikari, Joystick hack) - -static struct BurnRomInfo ikariramRomDesc[] = { - { "1.bin", 0x04000, 0xce97e30f, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "up03_k4.rom", 0x08000, 0x26948850, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "ik3", 0x04000, 0x9bb385f8, 2 | BRF_ESS | BRF_PRG }, // 2 Z80 #1 Code - { "ik4", 0x08000, 0x3a144bca, 2 | BRF_ESS | BRF_PRG }, // 3 - - { "ik5", 0x04000, 0x863448fa, 3 | BRF_ESS | BRF_PRG }, // 4 Z80 #2 Code - { "ik6", 0x08000, 0x9b16aa57, 3 | BRF_ESS | BRF_PRG }, // 5 - - { "7122er.prm", 0x00400, 0xb9bf2c2c, 14 | BRF_GRA }, // 6 Color Data - { "7122eg.prm", 0x00400, 0x0703a770, 14 | BRF_GRA }, // 7 - { "7122eb.prm", 0x00400, 0x0a11cdde, 14 | BRF_GRA }, // 8 - - { "ik7", 0x04000, 0x9e88f536, 4 | BRF_GRA }, // 9 Text Characters - - { "17.rom", 0x08000, 0xe0dba976, 6 | BRF_GRA }, // 10 Background Tiles - { "18.rom", 0x08000, 0x24947d5f, 6 | BRF_GRA }, // 11 - { "ik19", 0x08000, 0x566242ec, 6 | BRF_GRA }, // 12 - { "20.rom", 0x08000, 0x5da7ec1a, 6 | BRF_GRA }, // 13 - - { "ik8", 0x08000, 0x75d796d0, 9 | BRF_GRA }, // 14 16x16 Sprite Tiles - { "ik9", 0x08000, 0x2c34903b, 9 | BRF_GRA }, // 15 - { "ik10", 0x08000, 0xda9ccc94, 9 | BRF_GRA }, // 16 - - { "11.rom", 0x08000, 0x5c75ea8f, 10 | BRF_GRA }, // 17 32x32 Sprite Tiles - { "14.rom", 0x08000, 0x3293fde4, 10 | BRF_GRA }, // 18 - { "12.rom", 0x08000, 0x95138498, 10 | BRF_GRA }, // 19 - { "15.rom", 0x08000, 0x65a61c99, 10 | BRF_GRA }, // 20 - { "13.rom", 0x08000, 0x315383d7, 10 | BRF_GRA }, // 21 - { "16.rom", 0x08000, 0xe9b03e07, 10 | BRF_GRA }, // 22 - - { "82s191.bin", 0x00800, 0x072f8622, 0 | BRF_OPT }, // 23 Bootleg Proms -}; - -STD_ROM_PICK(ikariram) -STD_ROM_FN(ikariram) - -struct BurnDriver BurnDrvIkariram = { - "ikariram", "ikari", NULL, NULL, "1986", - "Rambo 3 (bootleg of Ikari, Joystick hack)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikariramRomInfo, ikariramRomName, NULL, NULL, IkariaInputInfo, IkariDIPInfo, - IkarijoyInit, DrvExit, AthenaFrame, IkariDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Victory Road - -static struct BurnRomInfo victroadRomDesc[] = { - { "p1.p4", 0x10000, 0xe334acef, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "p2.p8", 0x10000, 0x907fac83, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "p3.k7", 0x10000, 0xbac745f6, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "mb7122e.1k", 0x00400, 0x491ab831, 14 | BRF_GRA }, // 3 Color Data - { "mb7122e.2l", 0x00400, 0x8feca424, 14 | BRF_GRA }, // 4 - { "mb7122e.1l", 0x00400, 0x220076ca, 14 | BRF_GRA }, // 5 - - { "p7.b3", 0x04000, 0x2b6ed95b, 4 | BRF_GRA }, // 6 Text Characters - - { "p17.cd4", 0x08000, 0x19d4518c, 6 | BRF_GRA }, // 7 Background Characters - { "p18.cd2", 0x08000, 0xd818be43, 6 | BRF_GRA }, // 8 - { "p19.b4", 0x08000, 0xd64e0f89, 6 | BRF_GRA }, // 9 - { "p20.b2", 0x08000, 0xedba0f31, 6 | BRF_GRA }, // 10 - - { "p8.d3", 0x08000, 0xdf7f252a, 9 | BRF_GRA }, // 11 16x16 Sprites - { "p9.ef3", 0x08000, 0x9897bc05, 9 | BRF_GRA }, // 12 - { "p10.gh3", 0x08000, 0xecd3c0ea, 9 | BRF_GRA }, // 13 - - { "p11.m4", 0x08000, 0x668b25a4, 10 | BRF_GRA }, // 14 32x32 Sprites - { "p14.m2", 0x08000, 0xa7031d4a, 10 | BRF_GRA }, // 15 - { "p12.np4", 0x08000, 0xf44e95fa, 10 | BRF_GRA }, // 16 - { "p15.np2", 0x08000, 0x120d2450, 10 | BRF_GRA }, // 17 - { "p13.r4", 0x08000, 0x980ca3d8, 10 | BRF_GRA }, // 18 - { "p16.r2", 0x08000, 0x9f820e8a, 10 | BRF_GRA }, // 19 - - { "p4.ef5", 0x10000, 0xe10fb8cc, 15 | BRF_SND }, // 20 Samples - { "p5.g5", 0x10000, 0x93e5f110, 15 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(victroad) -STD_ROM_FN(victroad) - -struct BurnDriver BurnDrvVictroad = { - "victroad", NULL, NULL, NULL, "1986", - "Victory Road\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, victroadRomInfo, victroadRomName, NULL, NULL, VictroadInputInfo, VictroadDIPInfo, - VictroadInit, DrvExit, AthenaFrame, IkariDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Dogou Souken - -static struct BurnRomInfo dogosokeRomDesc[] = { - { "up03_p4.rom", 0x10000, 0x37867ad2, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "p2", 0x10000, 0x907fac83, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "up03_k7.rom", 0x10000, 0x173fa571, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "up03_k1.rom", 0x00400, 0x10a2ce2b, 14 | BRF_GRA }, // 3 Color Data - { "up03_l2.rom", 0x00400, 0x99dc9792, 14 | BRF_GRA }, // 4 - { "up03_l1.rom", 0x00400, 0xe7213160, 14 | BRF_GRA }, // 5 - - { "up02_b3.rom", 0x04000, 0x51a4ec83, 4 | BRF_GRA }, // 6 Text Characters - - { "p17", 0x08000, 0x19d4518c, 6 | BRF_GRA }, // 7 Background Tiles - { "p18", 0x08000, 0xd818be43, 6 | BRF_GRA }, // 8 - { "p19", 0x08000, 0xd64e0f89, 6 | BRF_GRA }, // 9 - { "p20", 0x08000, 0xedba0f31, 6 | BRF_GRA }, // 10 - - { "up02_d3.rom", 0x08000, 0xd43044f8, 9 | BRF_GRA }, // 11 16x16 Sprites - { "up02_e3.rom", 0x08000, 0x365ed2d8, 9 | BRF_GRA }, // 12 - { "up02_g3.rom", 0x08000, 0x92579bf3, 9 | BRF_GRA }, // 13 - - { "p11", 0x08000, 0x668b25a4, 10 | BRF_GRA }, // 14 32x32 Sprites - { "p14", 0x08000, 0xa7031d4a, 10 | BRF_GRA }, // 15 - { "p12", 0x08000, 0xf44e95fa, 10 | BRF_GRA }, // 16 - { "p15", 0x08000, 0x120d2450, 10 | BRF_GRA }, // 17 - { "p13", 0x08000, 0x980ca3d8, 10 | BRF_GRA }, // 18 - { "p16", 0x08000, 0x9f820e8a, 10 | BRF_GRA }, // 19 - - { "up03_f5.rom", 0x10000, 0x5b43fe9f, 15 | BRF_SND }, // 20 Samples - { "up03_g5.rom", 0x10000, 0xaae30cd6, 15 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(dogosoke) -STD_ROM_FN(dogosoke) - -struct BurnDriver BurnDrvDogosoke = { - "dogosoke", "victroad", NULL, NULL, "1986", - "Dogou Souken\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, dogosokeRomInfo, dogosokeRomName, NULL, NULL, VictroadInputInfo, VictroadDIPInfo, - VictroadInit, DrvExit, AthenaFrame, IkariDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Dogou Souken (Joystick hack bootleg) - -static struct BurnRomInfo dogosokbRomDesc[] = { - { "01", 0x10000, 0x53b0ad90, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "p2", 0x10000, 0x907fac83, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "up03_k7.rom", 0x10000, 0x173fa571, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 Code - - { "up03_k1.rom", 0x00400, 0x10a2ce2b, 14 | BRF_GRA }, // 3 Color Data - { "up03_l2.rom", 0x00400, 0x99dc9792, 14 | BRF_GRA }, // 4 - { "up03_l1.rom", 0x00400, 0xe7213160, 14 | BRF_GRA }, // 5 - - { "up02_b3.rom", 0x04000, 0x51a4ec83, 4 | BRF_GRA }, // 6 Text Characters - - { "p17", 0x08000, 0x19d4518c, 6 | BRF_GRA }, // 7 Background Tiles - { "p18", 0x08000, 0xd818be43, 6 | BRF_GRA }, // 8 - { "p19", 0x08000, 0xd64e0f89, 6 | BRF_GRA }, // 9 - { "p20", 0x08000, 0xedba0f31, 6 | BRF_GRA }, // 10 - - { "up02_d3.rom", 0x08000, 0xd43044f8, 9 | BRF_GRA }, // 11 16x16 Sprites - { "up02_e3.rom", 0x08000, 0x365ed2d8, 9 | BRF_GRA }, // 12 - { "up02_g3.rom", 0x08000, 0x92579bf3, 9 | BRF_GRA }, // 13 - - { "p11", 0x08000, 0x668b25a4, 10 | BRF_GRA }, // 14 32x32 Sprites - { "p14", 0x08000, 0xa7031d4a, 10 | BRF_GRA }, // 15 - { "p12", 0x08000, 0xf44e95fa, 10 | BRF_GRA }, // 16 - { "p15", 0x08000, 0x120d2450, 10 | BRF_GRA }, // 17 - { "p13", 0x08000, 0x980ca3d8, 10 | BRF_GRA }, // 18 - { "p16", 0x08000, 0x9f820e8a, 10 | BRF_GRA }, // 19 - - { "up03_f5.rom", 0x10000, 0x5b43fe9f, 15 | BRF_SND }, // 20 Samples - { "up03_g5.rom", 0x10000, 0xaae30cd6, 15 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(dogosokb) -STD_ROM_FN(dogosokb) - -struct BurnDriver BurnDrvDogosokb = { - "dogosokb", "victroad", NULL, NULL, "1986", - "Dogou Souken (Joystick hack bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, dogosokbRomInfo, dogosokbRomName, NULL, NULL, VictroadInputInfo, VictroadDIPInfo, - VictroadInit, DrvExit, AthenaFrame, IkariDraw, DrvScan, &DrvRecalc, 0x400, - 216, 288, 3, 4 -}; - - -// Chopper I (US set 1) - -static struct BurnRomInfo chopperRomDesc[] = { - { "kk_01.rom", 0x10000, 0x8fa2f839, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "kk_04.rom", 0x10000, 0x004f7d9a, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "kk_03.rom", 0x10000, 0xdbaafb87, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "up03_k1.rom", 0x00400, 0x7f07a45c, 14 | BRF_GRA }, // 3 Color Data - { "up03_l1.rom", 0x00400, 0x15359fc3, 14 | BRF_GRA }, // 4 - { "up03_k2.rom", 0x00400, 0x79b50f7d, 14 | BRF_GRA }, // 5 - - { "kk_05.rom", 0x08000, 0xdefc0987, 4 | BRF_GRA }, // 6 Text Characters - - { "kk_10.rom", 0x10000, 0x5cf4d22b, 6 | BRF_GRA }, // 7 Background Tiles - { "kk_11.rom", 0x10000, 0x9af4cad0, 6 | BRF_GRA }, // 8 - { "kk_12.rom", 0x10000, 0x02fec778, 6 | BRF_GRA }, // 9 - { "kk_13.rom", 0x10000, 0x2756817d, 6 | BRF_GRA }, // 10 - - { "kk_09.rom", 0x08000, 0x653c4342, 7 | BRF_GRA }, // 11 16x16 Sprites - { "kk_08.rom", 0x08000, 0x2da45894, 7 | BRF_GRA }, // 12 - { "kk_07.rom", 0x08000, 0xa0ebebdf, 7 | BRF_GRA }, // 13 - { "kk_06.rom", 0x08000, 0x284fad9e, 7 | BRF_GRA }, // 14 - - { "kk_18.rom", 0x10000, 0x6abbff36, 8 | BRF_GRA }, // 15 32x32 Sprites - { "kk_19.rom", 0x10000, 0x5283b4d3, 8 | BRF_GRA }, // 16 - { "kk_20.rom", 0x10000, 0x6403ddf2, 8 | BRF_GRA }, // 17 - { "kk_21.rom", 0x10000, 0x9f411940, 8 | BRF_GRA }, // 18 - { "kk_14.rom", 0x10000, 0x9bad9e25, 8 | BRF_GRA }, // 19 - { "kk_15.rom", 0x10000, 0x89faf590, 8 | BRF_GRA }, // 20 - { "kk_16.rom", 0x10000, 0xefb1fb6c, 8 | BRF_GRA }, // 21 - { "kk_17.rom", 0x10000, 0x6b7fb0a5, 8 | BRF_GRA }, // 22 - - { "kk_02.rom", 0x10000, 0x06169ae0, 15 | BRF_SND }, // 23 Samples - - { "pal16r6b.2c", 0x00104, 0x311e5ae6, 0 | BRF_OPT }, // 24 PLDs -}; - -STD_ROM_PICK(chopper) -STD_ROM_FN(chopper) - -struct BurnDriver BurnDrvChopper = { - "chopper", NULL, NULL, NULL, "1988", - "Chopper I (US set 1)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, chopperRomInfo, chopperRomName, NULL, NULL, ChopperInputInfo, ChopperDIPInfo, - Chopper1Init, DrvExit, ChopperFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// Chopper I (US set 2) - -static struct BurnRomInfo chopperaRomDesc[] = { - { "1a.rom", 0x10000, 0xdc325860, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "4a.rom", 0x10000, 0x56d10ba3, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "kk_03.rom", 0x10000, 0xdbaafb87, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "up03_k1.rom", 0x00400, 0x7f07a45c, 14 | BRF_GRA }, // 3 Color Data - { "up03_l1.rom", 0x00400, 0x15359fc3, 14 | BRF_GRA }, // 4 - { "up03_k2.rom", 0x00400, 0x79b50f7d, 14 | BRF_GRA }, // 5 - - { "kk_05.rom", 0x08000, 0xdefc0987, 4 | BRF_GRA }, // 6 Text Characters - - { "kk_10.rom", 0x10000, 0x5cf4d22b, 6 | BRF_GRA }, // 7 Background Tiles - { "11a.rom", 0x10000, 0x881ac259, 6 | BRF_GRA }, // 8 - { "12a.rom", 0x10000, 0xde96b331, 6 | BRF_GRA }, // 9 - { "kk_13.rom", 0x10000, 0x2756817d, 6 | BRF_GRA }, // 10 - - { "9a.rom", 0x08000, 0x106c2dcc, 7 | BRF_GRA }, // 11 16x16 Sprites - { "8a.rom", 0x08000, 0xd4f88f62, 7 | BRF_GRA }, // 12 - { "7a.rom", 0x08000, 0x28ae39f9, 7 | BRF_GRA }, // 13 - { "6a.rom", 0x08000, 0x16774a36, 7 | BRF_GRA }, // 14 - - { "kk_18.rom", 0x10000, 0x6abbff36, 8 | BRF_GRA }, // 15 32x32 Sprites - { "kk_19.rom", 0x10000, 0x5283b4d3, 8 | BRF_GRA }, // 16 - { "kk_20.rom", 0x10000, 0x6403ddf2, 8 | BRF_GRA }, // 17 - { "kk_21.rom", 0x10000, 0x9f411940, 8 | BRF_GRA }, // 18 - { "kk_14.rom", 0x10000, 0x9bad9e25, 8 | BRF_GRA }, // 19 - { "kk_15.rom", 0x10000, 0x89faf590, 8 | BRF_GRA }, // 20 - { "kk_16.rom", 0x10000, 0xefb1fb6c, 8 | BRF_GRA }, // 21 - { "kk_17.rom", 0x10000, 0x6b7fb0a5, 8 | BRF_GRA }, // 22 - - { "kk_02.rom", 0x10000, 0x06169ae0, 15 | BRF_SND }, // 23 Samples - - { "pal16r6b.2c", 0x00104, 0x311e5ae6, 0 | BRF_OPT }, // 24 PLDs -}; - -STD_ROM_PICK(choppera) -STD_ROM_FN(choppera) - -struct BurnDriver BurnDrvChoppera = { - "choppera", "chopper", NULL, NULL, "1988", - "Chopper I (US set 2)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, chopperaRomInfo, chopperaRomName, NULL, NULL, ChopperaInputInfo, ChopperaDIPInfo, - ChopperaInit, DrvExit, ChopperFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// Chopper I (US set 3) - -static struct BurnRomInfo chopperbRomDesc[] = { - { "chpri-1.bin", 0x10000, 0xa4e6e978, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "chpri-4.bin", 0x10000, 0x56d10ba3, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "kk_03.rom", 0x10000, 0xdbaafb87, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "up03_k1.rom", 0x00400, 0x7f07a45c, 14 | BRF_GRA }, // 3 Color Data - { "up03_l1.rom", 0x00400, 0x15359fc3, 14 | BRF_GRA }, // 4 - { "up03_k2.rom", 0x00400, 0x79b50f7d, 14 | BRF_GRA }, // 5 - - { "kk_05.rom", 0x08000, 0xdefc0987, 4 | BRF_GRA }, // 6 Text Characters - - { "kk_10.rom", 0x10000, 0x5cf4d22b, 6 | BRF_GRA }, // 7 bBackground Tiles - { "chpri-11.bin", 0x10000, 0x881ac259, 6 | BRF_GRA }, // 8 - { "chpri-12.bin", 0x10000, 0xde96b331, 6 | BRF_GRA }, // 9 - { "kk_13.rom", 0x10000, 0x2756817d, 6 | BRF_GRA }, // 10 - - { "chpri-9.bin", 0x08000, 0x106c2dcc, 7 | BRF_GRA }, // 11 16x16 Sprites - { "chpri-8.bin", 0x08000, 0xd4f88f62, 7 | BRF_GRA }, // 12 - { "chpri-7.bin", 0x08000, 0x28ae39f9, 7 | BRF_GRA }, // 13 - { "chpri-6.bin", 0x08000, 0x16774a36, 7 | BRF_GRA }, // 14 - - { "kk_18.rom", 0x10000, 0x6abbff36, 8 | BRF_GRA }, // 15 32x32 Sprites - { "kk_19.rom", 0x10000, 0x5283b4d3, 8 | BRF_GRA }, // 16 - { "kk_20.rom", 0x10000, 0x6403ddf2, 8 | BRF_GRA }, // 17 - { "kk_21.rom", 0x10000, 0x9f411940, 8 | BRF_GRA }, // 18 - { "kk_14.rom", 0x10000, 0x9bad9e25, 8 | BRF_GRA }, // 19 - { "kk_15.rom", 0x10000, 0x89faf590, 8 | BRF_GRA }, // 20 - { "kk_16.rom", 0x10000, 0xefb1fb6c, 8 | BRF_GRA }, // 21 - { "kk_17.rom", 0x10000, 0x6b7fb0a5, 8 | BRF_GRA }, // 22 - - { "kk_02.rom", 0x10000, 0x06169ae0, 15 | BRF_SND }, // 23 Samples - - { "pal16r6b.2c", 0x00104, 0x311e5ae6, 0 | BRF_OPT }, // 24 PLDs -}; - -STD_ROM_PICK(chopperb) -STD_ROM_FN(chopperb) - -struct BurnDriver BurnDrvChopperb = { - "chopperb", "chopper", NULL, NULL, "1988", - "Chopper I (US set 3)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, chopperbRomInfo, chopperbRomName, NULL, NULL, ChopperInputInfo, ChopperDIPInfo, - Chopper1Init, DrvExit, ChopperFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// Koukuu Kihei Monogatari - The Legend of Air Cavalry (Japan) - -static struct BurnRomInfo legofairRomDesc[] = { - { "up03_m4.rom", 0x10000, 0x79a485c0, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "up03_m8.rom", 0x10000, 0x96d3a4d9, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "kk_03.rom", 0x10000, 0xdbaafb87, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "up03_k1.rom", 0x00400, 0x7f07a45c, 14 | BRF_GRA }, // 3 Color Data - { "up03_l1.rom", 0x00400, 0x15359fc3, 14 | BRF_GRA }, // 4 - { "up03_k2.rom", 0x00400, 0x79b50f7d, 14 | BRF_GRA }, // 5 - - { "kk_05.rom", 0x08000, 0xdefc0987, 4 | BRF_GRA }, // 6 Text Tiles - - { "kk_10.rom", 0x10000, 0x5cf4d22b, 6 | BRF_GRA }, // 7 Background Tiles - { "kk_11.rom", 0x10000, 0x9af4cad0, 6 | BRF_GRA }, // 8 - { "kk_12.rom", 0x10000, 0x02fec778, 6 | BRF_GRA }, // 9 - { "kk_13.rom", 0x10000, 0x2756817d, 6 | BRF_GRA }, // 10 - - { "kk_09.rom", 0x08000, 0x653c4342, 7 | BRF_GRA }, // 11 16x16 Sprites - { "kk_08.rom", 0x08000, 0x2da45894, 7 | BRF_GRA }, // 12 - { "kk_07.rom", 0x08000, 0xa0ebebdf, 7 | BRF_GRA }, // 13 - { "kk_06.rom", 0x08000, 0x284fad9e, 7 | BRF_GRA }, // 14 - - { "kk_18.rom", 0x10000, 0x6abbff36, 8 | BRF_GRA }, // 15 32x32 Sprites - { "kk_19.rom", 0x10000, 0x5283b4d3, 8 | BRF_GRA }, // 16 - { "kk_20.rom", 0x10000, 0x6403ddf2, 8 | BRF_GRA }, // 17 - { "kk_21.rom", 0x10000, 0x9f411940, 8 | BRF_GRA }, // 18 - { "kk_14.rom", 0x10000, 0x9bad9e25, 8 | BRF_GRA }, // 19 - { "kk_15.rom", 0x10000, 0x89faf590, 8 | BRF_GRA }, // 20 - { "kk_16.rom", 0x10000, 0xefb1fb6c, 8 | BRF_GRA }, // 21 - { "kk_17.rom", 0x10000, 0x6b7fb0a5, 8 | BRF_GRA }, // 22 - - { "kk_02.rom", 0x10000, 0x06169ae0, 15 | BRF_SND }, // 23 Samples -}; - -STD_ROM_PICK(legofair) -STD_ROM_FN(legofair) - -struct BurnDriver BurnDrvLegofair = { - "legofair", "chopper", NULL, NULL, "1988", - "Koukuu Kihei Monogatari - The Legend of Air Cavalry (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, legofairRomInfo, legofairRomName, NULL, NULL, ChopperInputInfo, ChopperDIPInfo, - Chopper1Init, DrvExit, ChopperFrame, GwarDraw, DrvScan, &DrvRecalc, 0x400, - 224, 400, 3, 4 -}; - - -// TouchDown Fever (US) - -static struct BurnRomInfo tdfeverRomDesc[] = { - { "td2-ver3u.6c", 0x10000, 0x92138fe4, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "td1-ver3u.2c", 0x10000, 0x798711f5, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "td3-ver2u.3j", 0x10000, 0x5d13e0b1, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "2t.8e", 0x00400, 0x67bdf8a0, 14 | BRF_GRA }, // 3 Color Data - { "1t.8d", 0x00400, 0x9c4a9198, 14 | BRF_GRA }, // 4 - { "3t.9e", 0x00400, 0xc93c18e8, 14 | BRF_GRA }, // 5 - - { "td14-u.4n", 0x08000, 0xe841bf1a, 4 | BRF_GRA }, // 6 Text Characters - - { "td15.8d", 0x10000, 0xad6e0927, 6 | BRF_GRA }, // 7 Background Tiles - { "td16.8e", 0x10000, 0x181db036, 6 | BRF_GRA }, // 8 - { "td17.8f", 0x10000, 0xc5decca3, 6 | BRF_GRA }, // 9 - { "td18-ver2u.8g", 0x10000, 0x3924da37, 6 | BRF_GRA }, // 10 - { "td19.8j", 0x10000, 0xbc17ea7f, 6 | BRF_GRA }, // 11 - - { "td13.2t", 0x10000, 0x88e2e819, 8 | BRF_GRA }, // 12 32x32 Sprites - { "td12-1.2s", 0x10000, 0xf6f83d63, 8 | BRF_GRA }, // 13 - { "td11.2r", 0x10000, 0xa0d53fbd, 8 | BRF_GRA }, // 14 - { "td10-1.20", 0x10000, 0xc8c71c7b, 8 | BRF_GRA }, // 15 - { "td9.2n", 0x10000, 0xa8979657, 8 | BRF_GRA }, // 16 - { "td8-1.2l", 0x10000, 0x28f49182, 8 | BRF_GRA }, // 17 - { "td7.2k", 0x10000, 0x72a5590d, 8 | BRF_GRA }, // 18 - { "td6-1.2j", 0x10000, 0x9b6d4053, 8 | BRF_GRA }, // 19 - - { "td5.7p", 0x10000, 0x04794557, 15 | BRF_SND }, // 20 Samples - { "td4.7n", 0x10000, 0x155e472e, 15 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(tdfever) -STD_ROM_FN(tdfever) - -struct BurnDriver BurnDrvTdfever = { - "tdfever", NULL, NULL, NULL, "1987", - "TouchDown Fever (US)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - /*BDF_GAME_WORKING |*/0, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, tdfeverRomInfo, tdfeverRomName, NULL, NULL, ChopperInputInfo, ChopperDIPInfo, //TdfeverInputInfo, TdfeverDIPInfo, - TdfeverInit, DrvExit, GwarFrame, TdfeverDraw, DrvScan, &DrvRecalc, 0x400, - 400, 224, 4, 3 -}; - - -// TouchDown Fever (Japan) - -static struct BurnRomInfo tdfeverjRomDesc[] = { - { "up02_c6.rom", 0x10000, 0x88d88ec4, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "up02_c2.rom", 0x10000, 0x191e6442, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "up02_j3.rom", 0x10000, 0x4e4d71c7, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "2t.8e", 0x00400, 0x67bdf8a0, 14 | BRF_GRA }, // 3 Color Data - { "1t.8d", 0x00400, 0x9c4a9198, 14 | BRF_GRA }, // 4 - { "3t.9e", 0x00400, 0xc93c18e8, 14 | BRF_GRA }, // 5 - - { "td14.4n", 0x08000, 0xaf9bced5, 4 | BRF_GRA }, // 6 Text Characters - - { "td15.8d", 0x10000, 0xad6e0927, 6 | BRF_GRA }, // 7 Background Tiles - { "td16.8e", 0x10000, 0x181db036, 6 | BRF_GRA }, // 8 - { "td17.8f", 0x10000, 0xc5decca3, 6 | BRF_GRA }, // 9 - { "up01.8g", 0x10000, 0x4512cdfb, 6 | BRF_GRA }, // 10 - { "td19.8j", 0x10000, 0xbc17ea7f, 6 | BRF_GRA }, // 11 - - { "td13.2t", 0x10000, 0x88e2e819, 8 | BRF_GRA }, // 12 32x32 Sprites - { "td12-1.2s", 0x10000, 0xf6f83d63, 8 | BRF_GRA }, // 13 - { "td11.2r", 0x10000, 0xa0d53fbd, 8 | BRF_GRA }, // 14 - { "td10-1.20", 0x10000, 0xc8c71c7b, 8 | BRF_GRA }, // 15 - { "td9.2n", 0x10000, 0xa8979657, 8 | BRF_GRA }, // 16 - { "td8-1.2l", 0x10000, 0x28f49182, 8 | BRF_GRA }, // 17 - { "td7.2k", 0x10000, 0x72a5590d, 8 | BRF_GRA }, // 18 - { "td6-1.2j", 0x10000, 0x9b6d4053, 8 | BRF_GRA }, // 19 - - { "td5.7p", 0x10000, 0x04794557, 15 | BRF_SND }, // 20 Samples - { "td4.7n", 0x10000, 0x155e472e, 15 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(tdfeverj) -STD_ROM_FN(tdfeverj) - -struct BurnDriver BurnDrvTdfeverj = { - "tdfeverj", "tdfever", NULL, NULL, "1987", - "TouchDown Fever (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - /*BDF_GAME_WORKING |*/0 | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, tdfeverjRomInfo, tdfeverjRomName, NULL, NULL, ChopperInputInfo, ChopperDIPInfo, //TdfeverInputInfo, TdfeverDIPInfo, - TdfeverInit, DrvExit, GwarFrame, TdfeverDraw, DrvScan, &DrvRecalc, 0x400, - 400, 224, 4, 3 -}; - - -// TouchDown Fever 2 - -static struct BurnRomInfo tdfever2RomDesc[] = { - { "td02.6c", 0x10000, 0x9e3eaed8, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "td01.1c", 0x10000, 0x0ec294c0, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "td03.2j", 0x10000, 0x4092f16c, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "up03-2.8e", 0x00400, 0x1593c302, 14 | BRF_GRA }, // 3 Color Data - { "up03-2.8d", 0x00400, 0xac9df947, 14 | BRF_GRA }, // 4 - { "up03-2.9e", 0x00400, 0x73cdf192, 14 | BRF_GRA }, // 5 - - { "td06.3n", 0x08000, 0xd6521b0d, 4 | BRF_GRA }, // 6 Text Characters - - { "td15.8d", 0x10000, 0xad6e0927, 6 | BRF_GRA }, // 7 Background Tiles - { "td16.8e", 0x10000, 0x181db036, 6 | BRF_GRA }, // 8 - { "td17.8f", 0x10000, 0xc5decca3, 6 | BRF_GRA }, // 9 - { "td18.8g", 0x10000, 0x1a5a2200, 6 | BRF_GRA }, // 10 - { "td19-2.8j", 0x10000, 0xf1081329, 6 | BRF_GRA }, // 11 - { "td20.8k", 0x10000, 0x86cbb2e6, 6 | BRF_GRA }, // 12 - - { "td14.2t", 0x10000, 0x88e2e819, 8 | BRF_GRA }, // 13 32x32 Sprites - { "td13.2s", 0x10000, 0xc9bb9138, 8 | BRF_GRA }, // 14 - { "td12.2r", 0x10000, 0xa0d53fbd, 8 | BRF_GRA }, // 15 - { "td11.2p", 0x10000, 0xd43abc81, 8 | BRF_GRA }, // 16 - { "td10.2n", 0x10000, 0xa8979657, 8 | BRF_GRA }, // 17 - { "td09.2l", 0x10000, 0xc93b6cd3, 8 | BRF_GRA }, // 18 - { "td08.2k", 0x10000, 0x72a5590d, 8 | BRF_GRA }, // 19 - { "td07.2j", 0x10000, 0x4845e78b, 8 | BRF_GRA }, // 20 - - { "td05.7p", 0x10000, 0xe332e41f, 15 | BRF_SND }, // 21 Samples - { "td04.7n", 0x10000, 0x98af6d2d, 15 | BRF_SND }, // 22 - { "td22.7l", 0x10000, 0x34b4bce9, 15 | BRF_SND }, // 23 - { "td21.7k", 0x10000, 0xf5a96d8e, 15 | BRF_SND }, // 24 -}; - -STD_ROM_PICK(tdfever2) -STD_ROM_FN(tdfever2) - -struct BurnDriver BurnDrvTdfever2 = { - "tdfever2", "tdfever", NULL, NULL, "1988", - "TouchDown Fever 2\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - /*BDF_GAME_WORKING |*/0 | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, tdfever2RomInfo, tdfever2RomName, NULL, NULL, ChopperInputInfo, ChopperDIPInfo, //TdfeverInputInfo, TdfeverDIPInfo, - TdfeverInit, DrvExit, GwarFrame, TdfeverDraw, DrvScan, &DrvRecalc, 0x400, - 400, 224, 4, 3 -}; - - -// Fighting Soccer (version 4) - -static struct BurnRomInfo fsoccerRomDesc[] = { - { "fs3_ver4.bin", 0x10000, 0x94c3f918, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "fs1_ver4.bin", 0x10000, 0x97830108, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "fs2.3j", 0x10000, 0x9ee54ea1, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "2.8e", 0x00400, 0xbf4ac706, 14 | BRF_GRA }, // 3 Color Data - { "1.8d", 0x00400, 0x1bac8010, 14 | BRF_GRA }, // 4 - { "3.9e", 0x00400, 0xdbeddb14, 14 | BRF_GRA }, // 5 - - { "fs13.4n", 0x08000, 0x0de7b7ad, 4 | BRF_GRA }, // 6 Text Characters - - { "fs14.8d", 0x10000, 0x38c38b40, 6 | BRF_GRA }, // 7 Background Tiles - { "fs15.8e", 0x10000, 0xa614834f, 6 | BRF_GRA }, // 8 - - { "fs12.2t", 0x10000, 0xb2442c30, 8 | BRF_GRA }, // 9 32x32 Sprites - { "fs11.2s", 0x10000, 0x022f3e96, 8 | BRF_GRA }, // 10 - { "fs10.2r", 0x10000, 0xe42864d8, 8 | BRF_GRA }, // 11 - { "fs9.2p", 0x10000, 0xd8112aa6, 8 | BRF_GRA }, // 12 - { "fs8.2n", 0x10000, 0x11156a7d, 8 | BRF_GRA }, // 13 - { "fs7.2l", 0x10000, 0xd584964b, 8 | BRF_GRA }, // 14 - { "fs6.2k", 0x10000, 0x588d14b3, 8 | BRF_GRA }, // 15 - { "fs5.2j", 0x10000, 0xdef2f1d8, 8 | BRF_GRA }, // 16 - - { "fs4.bin", 0x10000, 0x435c3716, 15 | BRF_SND }, // 17 Samples -}; - -STD_ROM_PICK(fsoccer) -STD_ROM_FN(fsoccer) - -struct BurnDriver BurnDrvFsoccer = { - "fsoccer", NULL, NULL, NULL, "1988", - "Fighting Soccer (version 4)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - /*BDF_GAME_WORKING |*/0, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, fsoccerRomInfo, fsoccerRomName, NULL, NULL, ChopperInputInfo, ChopperDIPInfo, //FsoccerInputInfo, FsoccerDIPInfo, - TdfeverInit, DrvExit, GwarFrame, FsoccerDraw, DrvScan, &DrvRecalc, 0x400, - 400, 224, 4, 3 -}; - - -// Fighting Soccer (Japan) - -static struct BurnRomInfo fsoccerjRomDesc[] = { - { "fs3.6c", 0x10000, 0xc5f505fa, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "fs1.2c", 0x10000, 0x2f68e38b, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "fs2.3j", 0x10000, 0x9ee54ea1, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "2.8e", 0x00400, 0xbf4ac706, 14 | BRF_GRA }, // 3 Color Data - { "1.8d", 0x00400, 0x1bac8010, 14 | BRF_GRA }, // 4 - { "3.9e", 0x00400, 0xdbeddb14, 14 | BRF_GRA }, // 5 - - { "fs13.4n", 0x08000, 0x0de7b7ad, 4 | BRF_GRA }, // 6 Text Characters - - { "fs14.8d", 0x10000, 0x38c38b40, 6 | BRF_GRA }, // 7 Background Tiles - { "fs15.8e", 0x10000, 0xa614834f, 6 | BRF_GRA }, // 8 - - { "fs12.2t", 0x10000, 0xb2442c30, 8 | BRF_GRA }, // 9 32x32 Sprites - { "fs11.2s", 0x10000, 0x022f3e96, 8 | BRF_GRA }, // 10 - { "fs10.2r", 0x10000, 0xe42864d8, 8 | BRF_GRA }, // 11 - { "fs9.2p", 0x10000, 0xd8112aa6, 8 | BRF_GRA }, // 12 - { "fs8.2n", 0x10000, 0x11156a7d, 8 | BRF_GRA }, // 13 - { "fs7.2l", 0x10000, 0xd584964b, 8 | BRF_GRA }, // 14 - { "fs6.2k", 0x10000, 0x588d14b3, 8 | BRF_GRA }, // 15 - { "fs5.2j", 0x10000, 0xdef2f1d8, 8 | BRF_GRA }, // 16 - - { "fs4.7p", 0x10000, 0x435c3716, 15 | BRF_SND }, // 17 Samples -}; - -STD_ROM_PICK(fsoccerj) -STD_ROM_FN(fsoccerj) - -struct BurnDriver BurnDrvFsoccerj = { - "fsoccerj", "fsoccer", NULL, NULL, "1988", - "Fighting Soccer (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - /* |*/ BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, fsoccerjRomInfo, fsoccerjRomName, NULL, NULL, ChopperInputInfo, ChopperDIPInfo, //FsoccerInputInfo, FsoccerDIPInfo, - TdfeverInit, DrvExit, GwarFrame, FsoccerDraw, DrvScan, &DrvRecalc, 0x400, - 400, 224, 4, 3 -}; - - -// Fighting Soccer (Joystick hack bootleg) - -static struct BurnRomInfo fsoccerbRomDesc[] = { - { "ft-003.bin", 0x10000, 0x649d4448, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "ft-001.bin", 0x10000, 0x2f68e38b, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "fs2.3j", 0x10000, 0x9ee54ea1, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "2.8e", 0x00400, 0xbf4ac706, 14 | BRF_GRA }, // 3 Color Data - { "1.8d", 0x00400, 0x1bac8010, 14 | BRF_GRA }, // 4 - { "3.9e", 0x00400, 0xdbeddb14, 14 | BRF_GRA }, // 5 - - { "fs13.4n", 0x08000, 0x0de7b7ad, 4 | BRF_GRA }, // 6 Text Characters - - { "fs14.8d", 0x10000, 0x38c38b40, 6 | BRF_GRA }, // 7 Background Tiles - { "fs15.8e", 0x10000, 0xa614834f, 6 | BRF_GRA }, // 8 - - { "fs12.2t", 0x10000, 0xb2442c30, 8 | BRF_GRA }, // 9 32x32 Sprites - { "fs11.2s", 0x10000, 0x022f3e96, 8 | BRF_GRA }, // 10 - { "fs10.2r", 0x10000, 0xe42864d8, 8 | BRF_GRA }, // 11 - { "fs9.2p", 0x10000, 0xd8112aa6, 8 | BRF_GRA }, // 12 - { "fs8.2n", 0x10000, 0x11156a7d, 8 | BRF_GRA }, // 13 - { "fs7.2l", 0x10000, 0xd584964b, 8 | BRF_GRA }, // 14 - { "fs6.2k", 0x10000, 0x588d14b3, 8 | BRF_GRA }, // 15 - { "fs5.2j", 0x10000, 0xdef2f1d8, 8 | BRF_GRA }, // 16 - - { "fs4.bin", 0x10000, 0x435c3716, 15 | BRF_SND }, // 17 Samples -}; - -STD_ROM_PICK(fsoccerb) -STD_ROM_FN(fsoccerb) - -struct BurnDriver BurnDrvFsoccerb = { - "fsoccerb", "fsoccer", NULL, NULL, "1988", - "Fighting Soccer (Joystick hack bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, fsoccerbRomInfo, fsoccerbRomName, NULL, NULL, FsoccerInputInfo, FsoccerDIPInfo, - TdfeverInit, DrvExit, GwarFrame, FsoccerDraw, DrvScan, &DrvRecalc, 0x400, - 400, 224, 4, 3 -}; - - -// Fighting Soccer (Joystick hack bootleg, alt) - -static struct BurnRomInfo fsoccerbaRomDesc[] = { - { "fs3.c6", 0x10000, 0xe644d207, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 code - - { "fs1_ver4.bin", 0x10000, 0x97830108, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 code - - { "fs2.3j", 0x10000, 0x9ee54ea1, 3 | BRF_ESS | BRF_PRG }, // 2 Z80 #2 code - - { "2.8e", 0x00400, 0xbf4ac706, 14 | BRF_GRA }, // 3 Color Data - { "1.8d", 0x00400, 0x1bac8010, 14 | BRF_GRA }, // 4 - { "3.9e", 0x00400, 0xdbeddb14, 14 | BRF_GRA }, // 5 - - { "fs13.4n", 0x08000, 0x0de7b7ad, 4 | BRF_GRA }, // 6 Text Characters - - { "fs14.8d", 0x10000, 0x38c38b40, 6 | BRF_GRA }, // 7 Background Tiles - { "fs15.8e", 0x10000, 0xa614834f, 6 | BRF_GRA }, // 8 - - { "fs12.2t", 0x10000, 0xb2442c30, 8 | BRF_GRA }, // 9 32x32 Sprites - { "fs11.2s", 0x10000, 0x022f3e96, 8 | BRF_GRA }, // 10 - { "fs10.2r", 0x10000, 0xe42864d8, 8 | BRF_GRA }, // 11 - { "fs9.2p", 0x10000, 0xd8112aa6, 8 | BRF_GRA }, // 12 - { "fs8.2n", 0x10000, 0x11156a7d, 8 | BRF_GRA }, // 13 - { "fs7.2l", 0x10000, 0xd584964b, 8 | BRF_GRA }, // 14 - { "fs6.2k", 0x10000, 0x588d14b3, 8 | BRF_GRA }, // 15 - { "fs5.2j", 0x10000, 0xdef2f1d8, 8 | BRF_GRA }, // 16 - - { "fs4.7p", 0x10000, 0x435c3716, 15 | BRF_SND }, // 17 Samples -}; - -STD_ROM_PICK(fsoccerba) -STD_ROM_FN(fsoccerba) - -struct BurnDriver BurnDrvFsoccerba = { - "fsoccerba", "fsoccer", NULL, NULL, "1988", - "Fighting Soccer (Joystick hack bootleg, alt)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, fsoccerbaRomInfo, fsoccerbaRomName, NULL, NULL, FsoccerInputInfo, FsoccerDIPInfo, - TdfeverInit, DrvExit, GwarFrame, FsoccerDraw, DrvScan, &DrvRecalc, 0x400, - 400, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_snk68.cpp b/jan/src/burn/drv/pre90s/d_snk68.cpp deleted file mode 100644 index 5a63d193a..000000000 --- a/jan/src/burn/drv/pre90s/d_snk68.cpp +++ /dev/null @@ -1,2162 +0,0 @@ -// FB Alpha SNK 68k-based (pre-Neo-Geo) driver module -// Based on MAME driver by Bryan McPhail, Acho A. Tang, Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "upd7759.h" - -// Notes: -// March 11, 2016: hooked up rotational code to SAR and Ikari 3, left in old -// analogue rotational code (see #if 0's) just incase we need to base -// something else off of it in the future. - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -#if 0 -static UINT32 nAnalogAxis[2] = {0,0}; -static UINT16 DrvAxis[2]; -#endif - -static INT32 Rotary1 = 0; -static INT32 Rotary1OldVal = 0; -static INT32 Rotary2 = 0; -static INT32 Rotary2OldVal = 0; - -static UINT8 *Mem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KRom; -static UINT8 *Drv68KRomBank; -static UINT8 *DrvZ80Rom; -static UINT8 *Drv68KRam; -static UINT8 *DrvVidRam; -static UINT8 *DrvSprRam; -static UINT8 *DrvPalRam; -static UINT8 *DrvZ80Ram; -static UINT8 *DrvGfx0; -static UINT8 *DrvGfx0Trans; -static UINT8 *DrvGfx1; -static UINT8 *DrvSnd0; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 game_select; - -static INT32 invert_controls; -static INT32 soundlatch; -static INT32 flipscreen; -static INT32 sprite_flip; -static INT32 pow_charbase; - -// Rotation stuff! -dink -static UINT8 DrvFakeInput[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 nRotateHoldInput[2] = {0, 0}; -static INT32 nRotate[2] = {0, 0}; -static INT32 nRotateTarget[2] = {0, 0}; -static INT32 nRotateTry[2] = {0, 0}; -static UINT32 nRotateTime[2] = {0, 0}; -static UINT8 game_rotates = 0; -static UINT8 game_rotates_inverted = 0; - -#define A(a, b, c, d) { a, b, (UINT8*)(c), d } - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL , DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL , DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL , DrvJoy1 + 0, "p1 up", }, - {"P1 Down", BIT_DIGITAL , DrvJoy1 + 1, "p1 down", }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL , DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL , DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL , DrvJoy2 + 0, "p2 up", }, - {"P2 Down", BIT_DIGITAL , DrvJoy2 + 1, "p2 down", }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy2 + 6, "p2 fire 3"}, - - {"Service 1", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo IkariInputList[] = { - {"P1 Coin", BIT_DIGITAL , DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL , DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL , DrvJoy1 + 0, "p1 up", }, - {"P1 Down", BIT_DIGITAL , DrvJoy1 + 1, "p1 down", }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4 (rotate)" , BIT_DIGITAL , DrvFakeInput + 4, "p1 fire 4" }, - - //A("P1 Right / left", BIT_ANALOG_REL, DrvAxis + 0, "p1 z-axis"), - - {"P2 Coin", BIT_DIGITAL , DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL , DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL , DrvJoy2 + 0, "p2 up", }, - {"P2 Down", BIT_DIGITAL , DrvJoy2 + 1, "p2 down", }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Button 4 (rotate)" , BIT_DIGITAL , DrvFakeInput + 5, "p2 fire 4" }, - - //A("P2 Right / left", BIT_ANALOG_REL, DrvAxis + 1, "p2 z-axis"), - - {"Service 1", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ikari) - - -static struct BurnDIPInfo PowDIPList[]= -{ - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x03, 0x00, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0x0c, 0x0c, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x04, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x00, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x14, 0x01, 0x10, 0x00, "2" }, - {0x14, 0x01, 0x10, 0x10, "3" }, - - {0 , 0xfe, 0 , 2 , "Bonus Ocurrence" }, - {0x14, 0x01, 0x14, 0x00, "1st & 2nd only" }, - {0x14, 0x01, 0x14, 0x14, "1st & every 2nd" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x14, 0x01, 0x40, 0x00, "English" }, - {0x14, 0x01, 0x40, 0x40, "Japanese" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x01, 0x00, "Off" }, - {0x15, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x02, 0x02, "No" }, - {0x15, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x00, "20k 50k" }, - {0x15, 0x01, 0x0c, 0x08, "40k 100k" }, - {0x15, 0x01, 0x0c, 0x04, "60k 150k" }, - {0x15, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4 , "Game Mode" }, - {0x15, 0x01, 0x30, 0x00, "Demo Sounds On" }, - {0x15, 0x01, 0x30, 0x14, "Demo Sounds Off" }, - {0x15, 0x01, 0x30, 0x30, "Freeze" }, - {0x15, 0x01, 0x30, 0x10, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0xc0, 0x80, "Easy" }, - {0x15, 0x01, 0xc0, 0x00, "Normal" }, - {0x15, 0x01, 0xc0, 0x40, "Hard" }, - {0x15, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Pow) - - -static struct BurnDIPInfo PowjDIPList[]= -{ - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x03, 0x00, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0x0c, 0x0c, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x04, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x00, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x14, 0x01, 0x10, 0x00, "2" }, - {0x14, 0x01, 0x10, 0x10, "3" }, - - {0 , 0xfe, 0 , 2 , "Bonus Ocurrence" }, - {0x14, 0x01, 0x14, 0x00, "1st & 2nd only" }, - {0x14, 0x01, 0x14, 0x14, "1st & every 2nd" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x01, 0x00, "Off" }, - {0x15, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x02, 0x02, "No" }, - {0x15, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x00, "20k 50k" }, - {0x15, 0x01, 0x0c, 0x08, "40k 100k" }, - {0x15, 0x01, 0x0c, 0x04, "60k 150k" }, - {0x15, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4 , "Game Mode" }, - {0x15, 0x01, 0x30, 0x00, "Demo Sounds On" }, - {0x15, 0x01, 0x30, 0x14, "Demo Sounds Off" }, - {0x15, 0x01, 0x30, 0x30, "Freeze" }, - {0x15, 0x01, 0x30, 0x10, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0xc0, 0x80, "Easy" }, - {0x15, 0x01, 0xc0, 0x00, "Normal" }, - {0x15, 0x01, 0xc0, 0x40, "Hard" }, - {0x15, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Powj) - -static struct BurnDIPInfo StreetsmDIPList[]= -{ - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x03, 0x02, "1" }, - {0x14, 0x01, 0x03, 0x00, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 4 , "Coin A & B" }, - {0x14, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x00, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "Free Play" }, - - {0 , 0xfe, 0 , 2 , "Bonus Ocurrence" }, - {0x14, 0x01, 0x14, 0x00, "1st & 2nd only" }, - {0x14, 0x01, 0x14, 0x14, "1st & every 2nd" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x01, 0x00, "Off" }, - {0x15, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x02, 0x02, "No" }, - {0x15, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x00, "200k 400k" }, - {0x15, 0x01, 0x0c, 0x08, "400k 500k" }, - {0x15, 0x01, 0x0c, 0x04, "600k 800k" }, - {0x15, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4 , "Game Mode" }, - {0x15, 0x01, 0x30, 0x14, "Demo Sounds Off" }, - {0x15, 0x01, 0x30, 0x00, "Demo Sounds On" }, - {0x15, 0x01, 0x30, 0x30, "Freeze" }, - {0x15, 0x01, 0x30, 0x10, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0xc0, 0x80, "Easy" }, - {0x15, 0x01, 0xc0, 0x00, "Normal" }, - {0x15, 0x01, 0xc0, 0x40, "Hard" }, - {0x15, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Streetsm) - -static struct BurnDIPInfo StreetsjDIPList[]= -{ - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x03, 0x02, "1" }, - {0x14, 0x01, 0x03, 0x00, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x03, "4" }, - - {0 , 0xfe, 0 , 4 , "Coin A & B" }, - {0x14, 0x01, 0x0c, 0x0c, "A 4/1 B 1/4" }, - {0x14, 0x01, 0x0c, 0x04, "A 3/1 B 1/3" }, - {0x14, 0x01, 0x0c, 0x08, "A 2/1 B 1/2" }, - {0x14, 0x01, 0x0c, 0x00, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Bonus Ocurrence" }, - {0x14, 0x01, 0x14, 0x00, "1st & 2nd only" }, - {0x14, 0x01, 0x14, 0x14, "1st & every 2nd" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x01, 0x00, "Off" }, - {0x15, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x02, 0x02, "No" }, - {0x15, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x00, "200k 400k" }, - {0x15, 0x01, 0x0c, 0x08, "400k 500k" }, - {0x15, 0x01, 0x0c, 0x04, "600k 800k" }, - {0x15, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4 , "Game Mode" }, - {0x15, 0x01, 0x30, 0x14, "Demo Sounds Off" }, - {0x15, 0x01, 0x30, 0x00, "Demo Sounds On" }, - {0x15, 0x01, 0x30, 0x30, "Freeze" }, - {0x15, 0x01, 0x30, 0x10, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0xc0, 0x80, "Easy" }, - {0x15, 0x01, 0xc0, 0x00, "Normal" }, - {0x15, 0x01, 0xc0, 0x40, "Hard" }, - {0x15, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Streetsj) - -static struct BurnDIPInfo SarDIPList[]= -{ - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2 , "Joystick" }, - {0x16, 0x01, 0x01, 0x00, "Rotary" }, - {0x16, 0x01, 0x01, 0x01, "Standard" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x0c, 0x08, "2" }, - {0x16, 0x01, 0x0c, 0x00, "3" }, - {0x16, 0x01, 0x0c, 0x04, "4" }, - {0x16, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4 , "Coin A & B" }, - {0x16, 0x01, 0x30, 0x16, "2 Coins 1 Credit" }, - {0x16, 0x01, 0x30, 0x00, "1 Coin 1 Credit" }, - {0x16, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x30, 0x30, "Free Play" }, - - {0 , 0xfe, 0 , 2 , "Bonus Ocurrence" }, - {0x16, 0x01, 0x40, 0x00, "1st & 2nd only" }, - {0x16, 0x01, 0x40, 0x40, "1st & every 2nd" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x16, 0x01, 0x80, 0x00, "Off" }, - {0x16, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x17, 0x01, 0x01, 0x00, "Off" }, - {0x17, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x02, 0x02, "No" }, - {0x17, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x17, 0x01, 0x0c, 0x00, "50k 200k" }, - {0x17, 0x01, 0x0c, 0x08, "70k 270k" }, - {0x17, 0x01, 0x0c, 0x04, "90k 350k" }, - {0x17, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4 , "Game Mode" }, - {0x17, 0x01, 0x30, 0x16, "Demo Sounds Off" }, - {0x17, 0x01, 0x30, 0x00, "Demo Sounds On" }, - {0x17, 0x01, 0x30, 0x30, "Freeze" }, - {0x17, 0x01, 0x30, 0x10, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x17, 0x01, 0xc0, 0x80, "Easy" }, - {0x17, 0x01, 0xc0, 0x00, "Normal" }, - {0x17, 0x01, 0xc0, 0x40, "Hard" }, - {0x17, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Sar) - -static struct BurnDIPInfo IkariDIPList[]= -{ - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x00, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 4 , "Coin A & B" }, - {0x16, 0x01, 0x0c, 0x08, "First 2C_1C, then 1C_1C"}, - {0x16, 0x01, 0x0c, 0x00, "1 Coin 1 Credit" }, - {0x16, 0x01, 0x0c, 0x04, "First 1C_2C, then 1C_1C"}, - {0x16, 0x01, 0x0c, 0x0c, "Free Play" }, - - {0 , 0xfe, 0 , 2 , "Bonus Ocurrence" }, - {0x16, 0x01, 0x16, 0x00, "1st & 2nd only" }, - {0x16, 0x01, 0x16, 0x16, "1st & every 2nd" }, - - {0 , 0xfe, 0 , 2 , "Blood" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x16, 0x01, 0x80, 0x00, "Off" }, - {0x16, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x17, 0x01, 0x01, 0x00, "Off" }, - {0x17, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x02, 0x02, "No" }, - {0x17, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x17, 0x01, 0x0c, 0x00, "20k 50k" }, - {0x17, 0x01, 0x0c, 0x08, "40k 100k" }, - {0x17, 0x01, 0x0c, 0x04, "60k 150k" }, - {0x17, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4 , "Game Mode" }, - {0x17, 0x01, 0x30, 0x16, "Demo Sounds Off" }, - {0x17, 0x01, 0x30, 0x00, "Demo Sounds On" }, - {0x17, 0x01, 0x30, 0x30, "Freeze" }, - {0x17, 0x01, 0x30, 0x10, "Infinite Lives (Cheat)" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x17, 0x01, 0xc0, 0x00, "Easy" }, - {0x17, 0x01, 0xc0, 0x80, "Normal" }, - {0x17, 0x01, 0xc0, 0x40, "Hard" }, - {0x17, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Ikari) - -// Rotation-handler code - -static void RotateReset() { - for (INT32 playernum = 0; playernum < 2; playernum++) { - nRotate[playernum] = 0; // start out pointing straight up (0=up) - nRotateTarget[playernum] = -1; - nRotateTime[playernum] = 0; - nRotateHoldInput[0] = nRotateHoldInput[1] = 0; - } -} - -static void RotateStateload() { - for (INT32 playernum = 0; playernum < 2; playernum++) { - nRotateTarget[playernum] = -1; - } -} - -static UINT32 RotationTimer(void) { - return nCurrentFrame; -} - -static void RotateRight(INT32 *v) { - (*v)--; - if (*v < 0) *v = 11; -} - -static void RotateLeft(INT32 *v) { - (*v)++; - if (*v > 11) *v = 0; -} - -static UINT8 Joy2RotateInvert(UINT8 *joy) { - if (joy[0] && joy[2]) return 1; // up left - if (joy[0] && joy[3]) return 7; // up right - - if (joy[1] && joy[2]) return 3; // down left - if (joy[1] && joy[3]) return 5; // down right - - if (joy[0]) return 0; // up - if (joy[1]) return 4; // down - if (joy[2]) return 2; // left - if (joy[3]) return 6; // right - - return 0xff; -} - -static UINT8 Joy2Rotate(UINT8 *joy) { // ugly code, but the effect is awesome. -dink - if (game_rotates_inverted) - return Joy2RotateInvert(joy); - - if (joy[0] && joy[2]) return 7; // up left - if (joy[0] && joy[3]) return 1; // up right - - if (joy[1] && joy[2]) return 5; // down left - if (joy[1] && joy[3]) return 3; // down right - - if (joy[0]) return 0; // up - if (joy[1]) return 4; // down - if (joy[2]) return 6; // left - if (joy[3]) return 2; // right - - return 0xff; -} - -static int dialRotation(INT32 playernum) { - // p1 = 0, p2 = 1 - UINT8 player[2] = { 0, 0 }; - static UINT8 lastplayer[2][2] = { { 0, 0 }, { 0, 0 } }; - - if ((playernum != 0) && (playernum != 1)) { - bprintf(PRINT_NORMAL, _T("Strange Rotation address => %06X\n"), playernum); - return 0; - } - if (playernum == 0) { - player[0] = DrvFakeInput[0]; player[1] = DrvFakeInput[1]; - } - if (playernum == 1) { - player[0] = DrvFakeInput[2]; player[1] = DrvFakeInput[3]; - } - - if (player[0] && (player[0] != lastplayer[playernum][0] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateLeft(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Left => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - if (player[1] && (player[1] != lastplayer[playernum][1] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateRight(&nRotate[playernum]); - //bprintf(PRINT_NORMAL, _T("Player %d Rotate Right => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - lastplayer[playernum][0] = player[0]; - lastplayer[playernum][1] = player[1]; - - return (nRotate[playernum]); -} - -static UINT8 *rotate_gunpos[2] = {NULL, NULL}; -static UINT8 rotate_gunpos_multiplier = 1; - -// Gun-rotation memory locations - do not remove this tag. - dink :) -// game p1 p2 clockwise value in memory multiplier -// sar 0x40196 0x4019a 0 1 2 3 4 5 6 7 -// ikari3* 0x4004c 0x4005e 0 7 6 5 4 3 2 1 - -static void RotateSetGunPosRAM(UINT8 *p1, UINT8 *p2, UINT8 multiplier) { - rotate_gunpos[0] = p1; - rotate_gunpos[1] = p2; - rotate_gunpos_multiplier = multiplier; -} - -static INT32 get_distance(INT32 from, INT32 to) { -// this function finds the easiest way to get from "from" to "to", wrapping at 0 and 7 - INT32 countA = 0; - INT32 countB = 0; - INT32 fromtmp = from / rotate_gunpos_multiplier; - INT32 totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp++; - countA++; - if(fromtmp>7) fromtmp = 0; - if(fromtmp == totmp || countA > 32) break; - } - - fromtmp = from / rotate_gunpos_multiplier; - totmp = to / rotate_gunpos_multiplier; - - while (1) { - fromtmp--; - countB++; - if(fromtmp<0) fromtmp = 7; - if(fromtmp == totmp || countB > 32) break; - } - - if (game_rotates_inverted) { - return ((countA > countB) ? 0 : 1); - } - - if (countA > countB) { - return 1; // go negative - } else { - return 0; // go positive - } -} - -static void RotateDoTick() { - // since the game only allows for 1 rotation every other frame, we have to - // do this. - if (nCurrentFrame&1) return; - - for (INT32 i = 0; i < 2; i++) { - if (rotate_gunpos[i] && (nRotateTarget[i] != -1) && (nRotateTarget[i] != (*rotate_gunpos[i] & 0xff))) { - if (get_distance(nRotateTarget[i], *rotate_gunpos[i] & 0xff)) { - RotateRight(&nRotate[i]); // -- - } else { - RotateLeft(&nRotate[i]); // ++ - } - bprintf(0, _T("p%X target %X mempos %X nRotate %X.\n"), i, nRotateTarget[0], *rotate_gunpos[0] & 0xff, nRotate[0]); - nRotateTry[i]++; - if (nRotateTry[i] > 10) nRotateTarget[i] = -1; // don't get stuck in a loop if something goes horribly wrong here. - } else { - nRotateTarget[i] = -1; - } - } -} - -static void SuperJoy2Rotate() { - for (INT32 i = 0; i < 2; i++) { // p1 = 0, p2 = 1 - if (DrvFakeInput[4 + i]) { // rotate-button had been pressed - UINT8 rot = Joy2Rotate(((!i) ? &DrvJoy1[0] : &DrvJoy2[0])); - if (rot != 0xff) { - nRotateTarget[i] = rot * rotate_gunpos_multiplier; - } - //DrvInput[i] &= ~0xf; // cancel out directionals since they are used to rotate here. - DrvInputs[i] = (DrvInputs[i] & ~0xf) | (nRotateHoldInput[i] & 0xf); // for midnight resistance! be able to duck + change direction of gun. - nRotateTry[i] = 0; - } else { // cache joystick UDLR if the rotate button isn't pressed. - // This feature is for Midnight Resistance, if you are crawling on the - // ground and need to rotate your gun WITHOUT getting up. - nRotateHoldInput[i] = DrvInputs[i]; - } - } - - RotateDoTick(); -} - -// end Rotation-handler - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - DrvRecalc = 1; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - UPD7759Reset(); - - soundlatch = 0; - flipscreen = 0; - sprite_flip = 0; - pow_charbase = 0; - invert_controls = 0; - -#if 0 - nAnalogAxis[1] = 0; - nAnalogAxis[0] = 0; -#endif - - RotateReset(); - - return 0; -} - -void pow_paletteram16_word_w(UINT32 address) -{ - INT32 r,g,b; - UINT16 data = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRam + (address & 0x0ffe)))); - - r = ((data >> 7) & 0x1e) | ((data >> 14) & 0x01); - g = ((data >> 3) & 0x1e) | ((data >> 13) & 0x01); - b = ((data << 1) & 0x1e) | ((data >> 12) & 0x01); - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[(address >> 1) & 0x7ff] = BurnHighCol(r, g, b, 0); -} - -void __fastcall pow_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffff8000) == 0x100000 && game_select & 1) { - if (!(address & 2)) - data |= 0xff00; - - *((UINT16 *)(DrvSprRam + (address & 0x7fff))) = BURN_ENDIAN_SWAP_INT16(data); - - return; - } - - if ((address & 0xfffff000) == 0x400000) { - *((UINT16 *)(DrvPalRam + (address & 0x0ffe))) = BURN_ENDIAN_SWAP_INT16(data); - - pow_paletteram16_word_w(address); - - return; - } -} - -void __fastcall pow_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffff8000) == 0x100000 && game_select == 1) { - if ((address & 3) == 3) data = 0xff; - - DrvSprRam[address & 0x7fff] = data; - - return; - } - - if ((address & 0xfffff000) == 0x400000) { - DrvPalRam[address & 0x0fff] = data; - - pow_paletteram16_word_w(address); - - return; - } - - switch (address) - { - case 0x080000: - soundlatch = data; - ZetNmi(); - return; - - case 0x080007: - invert_controls = ((data & 0xff) == 0x07) ? 0xff : 0x00; - return; - - case 0x0c0001: - flipscreen = data & 8; - sprite_flip = data & 4; - pow_charbase = (data & 0x70) << 4; - return; - } -} - - -UINT16 __fastcall pow_read_word(UINT32 address) -{ - if (address != 0xe0000) - bprintf (PRINT_NORMAL, _T("read %x, w\n"), address); - - return 0; -} - -UINT8 __fastcall pow_read_byte(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[1]; - - case 0x080001: - return DrvInputs[0]; - - case 0x0c0000: - case 0x0c0001: - return DrvInputs[2]; - - case 0x0e0000: - case 0x0e0001: - case 0x0e8000: - case 0x0e8001: - return 0xff; - - case 0x0f0000: - case 0x0f0001: - return DrvDips[0]; - - case 0x0f0008: - case 0x0f0009: - return DrvDips[1]; - } - - return 0; -} - -UINT8 __fastcall sar_read_byte(UINT32 address) -{ - switch (address) - { - case 0x080001: - case 0x080003: - case 0x080005: - return DrvInputs[(address >> 1) & 3] ^ invert_controls; - - case 0x0c0000: { - INT32 RetVal = Rotary1 = dialRotation(0); - RetVal = (~(1 << RetVal)) & 0xff; - return (UINT8)RetVal; - } - - case 0x0c8000: { - INT32 RetVal = Rotary2 = dialRotation(1); - RetVal = (~(1 << RetVal)) & 0xff; - return (UINT8)RetVal; - } - - case 0x0d0000: { - INT32 RetVal = 0xff; - - if (Rotary1 == 8) RetVal -= 0x01; - if (Rotary1 == 9) RetVal -= 0x02; - if (Rotary1 == 10) RetVal -= 0x04; - if (Rotary1 == 11) RetVal -= 0x08; - - if (Rotary2 == 8) RetVal -= 0x10; - if (Rotary2 == 9) RetVal -= 0x20; - if (Rotary2 == 10) RetVal -= 0x40; - if (Rotary2 == 11) RetVal -= 0x80; - return (UINT8)RetVal; - } - - case 0x0f0000: - case 0x0f0001: - return DrvDips[0]; - - case 0x0f0008: - case 0x0f0009: - return DrvDips[1]; - - case 0x0f8000: - return 1; - } - - return 0; -} - -void __fastcall pow_sound_write(UINT16, UINT8) -{ -} - -void __fastcall pow_sound_out(UINT16 address, UINT8 data) -{ - switch (address & 0xff) - { - case 0x00: - case 0x20: - BurnYM3812Write(0, (address >> 5) & 1, data); - return; - - case 0x40: - UPD7759PortWrite(0, data); - UPD7759StartWrite(0, 0); - UPD7759StartWrite(0, 1); - return; - - case 0x80: - UPD7759ResetWrite(0, data); - return; - } - -} - -UINT8 __fastcall pow_sound_read(UINT16 address) -{ - if (address == 0xf800) return soundlatch; - - return 0; -} - -UINT8 __fastcall pow_sound_in(UINT16 address) -{ - address &= 0xff; - - if (address == 0x0000) return BurnYM3812Read(0, 0); - - return 0; -} - -static void powFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 powSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static INT32 DrvGfxDecode(INT32 *spriPlanes, INT32 *spriXOffs, INT32 *spriYOffs, INT32 modulo) -{ - static INT32 tilePlanes[4] = { 0x00000, 0x00004, 0x40000, 0x40004 }; - static INT32 tileXOffs[8] = { 0x43, 0x42, 0x41, 0x40, 0x03, 0x02, 0x01, 0x00 }; - static INT32 tileYOffs[8] = { 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x300000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfx0, 0x010000); - - GfxDecode(0x0800, 4, 8, 8, tilePlanes, tileXOffs, tileYOffs, 0x0080, tmp, DrvGfx0); - - memcpy (tmp, DrvGfx1, 0x300000); - - GfxDecode(0x6000, 4, 16, 16, spriPlanes, spriXOffs, spriYOffs, modulo, tmp, DrvGfx1); - - BurnFree (tmp); - - memset (DrvGfx0Trans, 1, 0x800); - for (INT32 i = 0; i < 0x20000; i++) { - if (DrvGfx0[i]) { - DrvGfx0Trans[i>>6] = 0; - i|=0x3f; - } - } - - return 0; -} - -static INT32 PowGfxDecode() -{ - static INT32 spriPlanes[4] = { 0x000000, 0x400000, 0x800000, 0xc00000 }; - static INT32 spriXOffs[16] = { 0x87, 0x86, 0x85, 0x84, 0x83, 0x82, 0x81, 0x80, - 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; - static INT32 spriYOffs[16] = { 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, - 0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78 }; - - return DrvGfxDecode(spriPlanes, spriXOffs, spriYOffs, 0x100); -} - -static INT32 SarGfxDecode() -{ - static INT32 spriPlanes[4] = { 0x000000, 0x000008,0xc00000, 0xc00008 }; - static INT32 spriXOffs[16] = { 0x107, 0x106, 0x105, 0x104, 0x103, 0x102, 0x101, 0x100, - 0x007, 0x006, 0x005, 0x004, 0x003, 0x002, 0x001, 0x000 }; - static INT32 spriYOffs[16] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, - 0x080, 0x090, 0x0a0, 0x0b0, 0x0c0, 0x0d0, 0x0e0, 0x0f0 }; - - return DrvGfxDecode(spriPlanes, spriXOffs, spriYOffs, 0x200); -} - -static INT32 IkariGfxDecode() -{ - static INT32 spriPlanes[4] = { 0xa00000, 0x000000, 0x500000, 0xf00000 }; - static INT32 spriXOffs[16] = { 0x87, 0x86, 0x85, 0x84, 0x83, 0x82, 0x81, 0x80, - 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; - static INT32 spriYOffs[16] = { 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, - 0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78 }; - - return DrvGfxDecode(spriPlanes, spriXOffs, spriYOffs, 0x100); -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x040000; - Drv68KRomBank = Next; Next += 0x040000; - DrvZ80Rom = Next; Next += 0x010000; - - DrvGfx0 = Next; Next += 0x020000; - DrvGfx1 = Next; Next += 0x600000; - - DrvGfx0Trans = Next; Next += 0x000800; - - DrvSnd0 = Next; Next += 0x020000; - - AllRam = Next; - - Drv68KRam = Next; Next += 0x004000; - DrvVidRam = Next; Next += 0x001000; - DrvSprRam = Next; Next += 0x008000; - DrvPalRam = Next; Next += 0x001000; - - DrvZ80Ram = Next; Next += 0x000800; - - RamEnd = Next; - - DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - - -static void pow_map_68k() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRam, 0x040000, 0x043fff, MAP_RAM); - SekMapMemory(DrvVidRam, 0x100000, 0x100fff, MAP_RAM); // video ram - SekMapMemory(DrvSprRam, 0x200000, 0x207fff, MAP_RAM); // sprite ram - SekMapMemory(DrvPalRam, 0x400000, 0x400fff, MAP_ROM); // palette ram - SekSetWriteByteHandler(0, pow_write_byte); - SekSetWriteWordHandler(0, pow_write_word); - SekSetReadByteHandler(0, pow_read_byte); - SekSetReadWordHandler(0, pow_read_word); - SekClose(); -} - -static void sar_map_68k() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRam, 0x040000, 0x043fff, MAP_RAM); - SekMapMemory(DrvSprRam, 0x100000, 0x107fff, MAP_ROM); // sprite ram - SekMapMemory(DrvVidRam, 0x200000, 0x200fff, MAP_RAM); // video ram - SekMapMemory(DrvVidRam, 0x201000, 0x201fff, MAP_WRITE); // video ram mirror - SekMapMemory(Drv68KRomBank, 0x300000, 0x33ffff, MAP_ROM); // extra rom - SekMapMemory(DrvPalRam, 0x400000, 0x400fff, MAP_ROM); // palette ram - SekSetWriteByteHandler(0, pow_write_byte); - SekSetWriteWordHandler(0, pow_write_word); - SekSetReadByteHandler(0, sar_read_byte); - SekSetReadWordHandler(0, pow_read_word); - SekClose(); -} - - -static INT32 DrvGetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *LoadP0 = Drv68KRom; - UINT8 *LoadP1 = DrvZ80Rom; - UINT8 *LoadG0 = DrvGfx0; - UINT8 *LoadG1 = DrvGfx1; - UINT8 *LoadS0 = DrvSnd0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(LoadP0 + 1, i + 0, 2)) return 1; - if (BurnLoadRom(LoadP0 + 0, i + 1, 2)) return 1; - LoadP0 += ri.nLen * 2; - i++; - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(LoadP1, i, 1)) return 1; - LoadP1 += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(LoadG0, i, 1)) return 1; - LoadG0 += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(LoadG1, i, 1)) return 1; - LoadG1 += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 5) { - if (BurnLoadRom(LoadS0, i, 1)) return 1; - LoadS0 += ri.nLen; - continue; - } - } - - return 0; -} - -static INT32 DrvInit(INT32 game) -{ - game_select = game; - - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - if (DrvGetRoms()) return 1; - - switch (game_select) - { - case 0: // Pow - if (PowGfxDecode()) return 1; - pow_map_68k(); - break; - - case 1: // searchar - if (SarGfxDecode()) return 1; - sar_map_68k(); - game_rotates = 1; - RotateSetGunPosRAM(Drv68KRam + (0x196), Drv68KRam + (0x19a), 1); - break; - - case 2: // streets - if (SarGfxDecode()) return 1; - pow_map_68k(); - break; - - case 3: // ikari - if (IkariGfxDecode()) return 1; - sar_map_68k(); - game_rotates = 1; - game_rotates_inverted = 1; - RotateSetGunPosRAM(Drv68KRam + (0x4c), Drv68KRam + (0x5e), 1); - break; - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80Rom); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80Rom); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80Ram); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80Ram); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80Ram); - ZetSetWriteHandler(pow_sound_write); - ZetSetReadHandler(pow_sound_read); - ZetSetInHandler(pow_sound_in); - ZetSetOutHandler(pow_sound_out); - ZetClose(); - - BurnYM3812Init(1, 4000000, &powFMIRQHandler, &powSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - UPD7759Init(0, UPD7759_STANDARD_CLOCK, DrvSnd0); - UPD7759SetRoute(0, ((game_select == 1) ? 1.50 : 0.50), BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - UPD7759Exit(); - - GenericTilesExit(); - SekExit(); - ZetExit(); - - BurnFree (Mem); - - game_select = 0; - game_rotates = 0; - game_rotates_inverted = 0; - - return 0; -} - - -static void pow_sprites(INT32 j, INT32 pos) -{ - INT32 offs,mx,my,color,tile,fx,fy,i; - - UINT16 *spriteram16 = (UINT16*)(DrvSprRam); - - for (offs = pos; offs < pos+0x800; offs += 0x80 ) - { - mx=(BURN_ENDIAN_SWAP_INT16(spriteram16[(offs+4+(4*j))>>1])&0xff)<<4; - my=BURN_ENDIAN_SWAP_INT16(spriteram16[(offs+6+(4*j))>>1]); - mx=mx+(my>>12); - mx=((mx+16)&0x1ff)-16; - - mx=((mx+0x100)&0x1ff)-0x100; - my=((my+0x100)&0x1ff)-0x100; - - my=0x200 - my; - my-=0x200; - - if (flipscreen) { - mx=240-mx; - my=240-my; - } - - my -= 16; - - for (i = 0; i < 0x80; i+=4) - { - color = BURN_ENDIAN_SWAP_INT16(spriteram16[(offs+i+(0x1000*j)+0x1000)>>1])&0x7f; - - if (color) - { - tile=BURN_ENDIAN_SWAP_INT16(spriteram16[(offs+2+i+(0x1000*j)+0x1000)>>1]); - fy=tile&0x8000; - fx=tile&0x4000; - tile&=0x3fff; - - if (flipscreen) { - if (fx) fx=0; else fx=1; - if (fy) fy=0; else fy=1; - } - - if (mx > -16 && mx < 256 && my > -16 && my < 224) { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, tile, mx, my, color, 4, 0, 0, DrvGfx1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, tile, mx, my, color, 4, 0, 0, DrvGfx1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, tile, mx, my, color, 4, 0, 0, DrvGfx1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, tile, mx, my, color, 4, 0, 0, DrvGfx1); - } - } - } - } - - if (flipscreen) { - my-=16; - if (my < -0x100) my+=0x200; - } - else { - my+=16; - if (my > 0x100) my-=0x200; - } - } - } -} - -static void sar_sprites(INT32 j, INT32 z, INT32 pos) -{ - INT32 offs,mx,my,color,tile,fx,fy,i; - - UINT16 *spriteram16 = (UINT16*)(DrvSprRam); - - for (offs = pos; offs < pos+0x800 ; offs += 0x80 ) - { - mx=BURN_ENDIAN_SWAP_INT16(spriteram16[(offs+j)>>1]); - my=BURN_ENDIAN_SWAP_INT16(spriteram16[(offs+j+2)>>1]); - - mx=mx<<4; - mx=mx|((my>>12)&0xf); - my=my&0x1ff; - - mx=(mx+0x100)&0x1ff; - my=(my+0x100)&0x1ff; - mx-=0x100; - my-=0x100; - my=0x200 - my; - my-=0x200; - - if (flipscreen) { - mx=240-mx; - my=240-my; - } - - my -= 16; - - for (i = 0; i < 0x80; i += 4) - { - color = BURN_ENDIAN_SWAP_INT16(spriteram16[(offs+i+z)>>1]) & 0x7f; - - if (color) - { - tile = BURN_ENDIAN_SWAP_INT16(spriteram16[(offs+2+i+z)>>1]); - - if (sprite_flip) { - fx=0; - fy=tile&0x8000; - } else { - fy=0; - fx=tile&0x8000; - } - - if (flipscreen) { - if (fx) fx=0; else fx=1; - if (fy) fy=0; else fy=1; - } - - tile&=0x7fff; - if (tile>0x5fff) break; - - if (mx > -16 && mx < 256 && my > -16 && my < 224) { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, tile, mx, my, color, 4, 0, 0, DrvGfx1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, tile, mx, my, color, 4, 0, 0, DrvGfx1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, tile, mx, my, color, 4, 0, 0, DrvGfx1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, tile, mx, my, color, 4, 0, 0, DrvGfx1); - } - } - } - } - - if (flipscreen) { - my-=16; - if (my < -0x100) my+=0x200; - } - else { - my+=16; - if (my > 0x100) my-=0x200; - } - } - } -} - -static void pow_foreground() -{ - UINT16 *vidram = (UINT16*)DrvVidRam; - - for (INT32 offs = 0; offs < 0x1000 / 2; offs+=2) - { - INT32 sy = (offs << 2) & 0xf8; - INT32 sx = (offs >> 3) & 0xf8; - - if (flipscreen) { - sy ^= 0xf8; - sx ^= 0xf8; - } - - if (sy < 16 || sy > 239) continue; - sy -= 16; - - INT32 code = (BURN_ENDIAN_SWAP_INT16(vidram[offs | 0]) & 0xff) | pow_charbase; - INT32 color = BURN_ENDIAN_SWAP_INT16(vidram[offs | 1]) & 0x0f; - - if (DrvGfx0Trans[code]) continue; - - if (flipscreen) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfx0); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfx0); - } - } -} - -static void sar_foreground() -{ - UINT16 *vidram = (UINT16*)DrvVidRam; - - for (INT32 offs = 0; offs < 0x1000 / 2; offs+=2) - { - INT32 sy = (offs << 2) & 0xf8; - INT32 sx = (offs >> 3) & 0xf8; - - if (flipscreen) { - sy ^= 0xf8; - sx ^= 0xf8; - } - - if (sy < 16 || sy > 239) continue; - sy -= 16; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vidram[offs]); - INT32 color = code >> 12; - - // kludge for bad tile (ikari) - if (code == 0x80ff) { - code = 0x02ca; - color = 0x07; - } - - code &= 0x0fff; - - if (DrvGfx0Trans[code]) continue; - - if (flipscreen) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfx0); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfx0); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - pow_paletteram16_word_w(i); - } - DrvRecalc = 0; - } - - for (INT32 offs = 0; offs < nScreenHeight * nScreenWidth; offs++) { - pTransDraw[offs] = 0x7ff; - } - - if (!game_select) { - pow_sprites(1, 0x000); - pow_sprites(1, 0x800); - pow_sprites(2, 0x000); - pow_sprites(2, 0x800); - pow_sprites(0, 0x000); - pow_sprites(0, 0x800); - } else { - sar_sprites(8, 0x2000, 0x000); - sar_sprites(8, 0x2000, 0x800); - sar_sprites(12,0x3000, 0x000); - sar_sprites(12,0x3000, 0x800); - sar_sprites(4, 0x1000, 0x000); - sar_sprites(4, 0x1000, 0x800); - } - - if (game_select & 1) { - sar_foreground(); - } else { - pow_foreground(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = DrvInputs[1] = DrvInputs[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - -#if 0 - nAnalogAxis[0] -= DrvAxis[0]; - DrvInputs[6] = (~nAnalogAxis[0] >> 8) & 0xfe; - - nAnalogAxis[1] -= DrvAxis[1]; - DrvInputs[7] = (~nAnalogAxis[1] >> 8) & 0xfe; -#endif - } - -#if 0 - if (game_select == 1 || game_select == 3) { - if ((DrvInputs[6] >> 4) < Rotary1OldVal) { - Rotary1++; - } - - if ((DrvInputs[6] >> 4) > Rotary1OldVal) { - Rotary1--; - } - Rotary1OldVal = DrvInputs[6] >> 4; - if (Rotary1 > 11) Rotary1 = 0; - if (Rotary1 < 0) Rotary1 = 11; - - if ((DrvInputs[7] >> 4) < Rotary2OldVal) { - Rotary2++; - } - - if ((DrvInputs[7] >> 4) > Rotary2OldVal) { - Rotary2--; - } - Rotary2OldVal = DrvInputs[7] >> 4; - if (Rotary2 > 11) Rotary2 = 0; - if (Rotary2 < 0) Rotary2 = 11; - } -#endif - - if (game_rotates) { - SuperJoy2Rotate(); - } - - INT32 nTotalCycles[2] = { ((game_select == 1) ? 9000000 : 10000000) / 60, 4000000 / 60 }; - - SekOpen(0); - ZetOpen(0); - - SekNewFrame(); - ZetNewFrame(); - - SekRun(nTotalCycles[0]); - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrameYM3812(nTotalCycles[1]); - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - UPD7759Update(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029682; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - if (nAction & ACB_WRITE) - DrvRecalc = 1; - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - UPD7759Scan(0, nAction, pnMin); - - SCAN_VAR(invert_controls); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(sprite_flip); - SCAN_VAR(pow_charbase); -#if 0 - SCAN_VAR(nAnalogAxis[0]); - SCAN_VAR(nAnalogAxis[1]); -#endif - SCAN_VAR(Rotary1); - SCAN_VAR(Rotary1OldVal); - SCAN_VAR(Rotary2); - SCAN_VAR(Rotary2OldVal); - SCAN_VAR(nRotate); - SCAN_VAR(nRotateTry); - - if (nAction & ACB_WRITE) { - RotateStateload(); - } - } - - return 0; -} - - -// P.O.W. - Prisoners of War (US version 1) - -static struct BurnRomInfo powRomDesc[] = { - { "dg1ver1.j14", 0x20000, 0x8e71a8af, 1 | BRF_PRG }, // 0 68k Code - { "dg2ver1.l14", 0x20000, 0x4287affc, 1 | BRF_PRG }, // 1 - - { "dg8.e25", 0x10000, 0xd1d61da3, 2 | BRF_PRG }, // 2 Z80 Code - - { "dg9.l25", 0x08000, 0xdf864a08, 3 | BRF_GRA }, // 3 Characters - { "dg10.m25", 0x08000, 0x9e470d53, 3 | BRF_GRA }, // 4 - - { "snk880.11a", 0x20000, 0xe70fd906, 4 | BRF_GRA }, // 5 Sprites - { "snk880.12a", 0x20000, 0x628b1aed, 4 | BRF_GRA }, // 6 - { "snk880.13a", 0x20000, 0x19dc8868, 4 | BRF_GRA }, // 7 - { "snk880.14a", 0x20000, 0x47cd498b, 4 | BRF_GRA }, // 8 - { "snk880.15a", 0x20000, 0x7a90e957, 4 | BRF_GRA }, // 9 - { "snk880.16a", 0x20000, 0xe40a6c13, 4 | BRF_GRA }, // 10 - { "snk880.17a", 0x20000, 0xc7931cc2, 4 | BRF_GRA }, // 11 - { "snk880.18a", 0x20000, 0xeed72232, 4 | BRF_GRA }, // 12 - { "snk880.19a", 0x20000, 0x1775b8dd, 4 | BRF_GRA }, // 13 - { "snk880.20a", 0x20000, 0xf8e752ec, 4 | BRF_GRA }, // 14 - { "snk880.21a", 0x20000, 0x27e9fffe, 4 | BRF_GRA }, // 15 - { "snk880.22a", 0x20000, 0xaa9c00d8, 4 | BRF_GRA }, // 16 - { "snk880.23a", 0x20000, 0xadb6ad68, 4 | BRF_GRA }, // 17 - { "snk880.24a", 0x20000, 0xdd41865a, 4 | BRF_GRA }, // 18 - { "snk880.25a", 0x20000, 0x055759ad, 4 | BRF_GRA }, // 19 - { "snk880.26a", 0x20000, 0x9bc261c5, 4 | BRF_GRA }, // 20 - - { "dg7.d20", 0x10000, 0xaba9a9d3, 5 | BRF_SND }, // 21 upd7759 samples - - { "pal20l10.a6", 0x000cc, 0xc3d9e729, 0 | BRF_OPT }, // 22 pld -}; - -STD_ROM_PICK(pow) -STD_ROM_FN(pow) - -static INT32 powInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvpow = { - "pow", NULL, NULL, NULL, "1988", - "P.O.W. - Prisoners of War (US version 1)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, powRomInfo, powRomName, NULL, NULL, DrvInputInfo, PowDIPInfo, - powInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; - - -// Datsugoku - Prisoners of War (Japan) - -static struct BurnRomInfo powjRomDesc[] = { - { "1-2", 0x20000, 0x2f17bfb0, 1 | BRF_PRG }, // 0 68k Code - { "2-2", 0x20000, 0xbaa32354, 1 | BRF_PRG }, // 1 - - { "dg8.e25", 0x10000, 0xd1d61da3, 2 | BRF_PRG }, // 2 Z80 Code - - { "dg9.l25", 0x08000, 0xdf864a08, 3 | BRF_GRA }, // 3 Characters - { "dg10.m25", 0x08000, 0x9e470d53, 3 | BRF_GRA }, // 4 - - { "snk880.11a", 0x20000, 0xe70fd906, 4 | BRF_GRA }, // 5 Sprites - { "snk880.12a", 0x20000, 0x628b1aed, 4 | BRF_GRA }, // 6 - { "snk880.13a", 0x20000, 0x19dc8868, 4 | BRF_GRA }, // 7 - { "snk880.14a", 0x20000, 0x47cd498b, 4 | BRF_GRA }, // 8 - { "snk880.15a", 0x20000, 0x7a90e957, 4 | BRF_GRA }, // 9 - { "snk880.16a", 0x20000, 0xe40a6c13, 4 | BRF_GRA }, // 10 - { "snk880.17a", 0x20000, 0xc7931cc2, 4 | BRF_GRA }, // 11 - { "snk880.18a", 0x20000, 0xeed72232, 4 | BRF_GRA }, // 12 - { "snk880.19a", 0x20000, 0x1775b8dd, 4 | BRF_GRA }, // 13 - { "snk880.20a", 0x20000, 0xf8e752ec, 4 | BRF_GRA }, // 14 - { "snk880.21a", 0x20000, 0x27e9fffe, 4 | BRF_GRA }, // 15 - { "snk880.22a", 0x20000, 0xaa9c00d8, 4 | BRF_GRA }, // 16 - { "snk880.23a", 0x20000, 0xadb6ad68, 4 | BRF_GRA }, // 17 - { "snk880.24a", 0x20000, 0xdd41865a, 4 | BRF_GRA }, // 18 - { "snk880.25a", 0x20000, 0x055759ad, 4 | BRF_GRA }, // 19 - { "snk880.26a", 0x20000, 0x9bc261c5, 4 | BRF_GRA }, // 20 - - { "dg7.d20", 0x10000, 0xaba9a9d3, 5 | BRF_SND }, // 21 upd7759 samples - - { "pal20l10.a6", 0x000cc, 0xc3d9e729, 0 | BRF_OPT }, // 22 pld -}; - -STD_ROM_PICK(powj) -STD_ROM_FN(powj) - -struct BurnDriver BurnDrvpowj = { - "powj", "pow", NULL, NULL, "1988", - "Datsugoku - Prisoners of War (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, powjRomInfo, powjRomName, NULL, NULL, DrvInputInfo, PowjDIPInfo, - powInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; - - -// SAR - Search And Rescue (World) - -static struct BurnRomInfo searcharRomDesc[] = { - { "bhw.2", 0x20000, 0xe1430138, 1 | BRF_PRG }, // 0 68k Code - { "bhw.3", 0x20000, 0xee1f9374, 1 | BRF_PRG }, // 1 - { "bhw.1", 0x20000, 0x62b60066, 1 | BRF_PRG }, // 2 - { "bhw.4", 0x20000, 0x16d8525c, 1 | BRF_PRG }, // 3 - - { "bh.5", 0x10000, 0x53e2fa76, 2 | BRF_PRG }, // 4 Z80 Code - - { "bh.7", 0x08000, 0xb0f1b049, 3 | BRF_GRA }, // 5 Characters - { "bh.8", 0x08000, 0x174ddba7, 3 | BRF_GRA }, // 6 - - { "bh.c1", 0x80000, 0x1fb8f0ae, 4 | BRF_GRA }, // 7 Sprites - { "bh.c3", 0x80000, 0xfd8bc407, 4 | BRF_GRA }, // 8 - { "bh.c5", 0x80000, 0x1d30acc3, 4 | BRF_GRA }, // 9 - { "bh.c2", 0x80000, 0x7c803767, 4 | BRF_GRA }, // 10 - { "bh.c4", 0x80000, 0xeede7c43, 4 | BRF_GRA }, // 11 - { "bh.c6", 0x80000, 0x9f785cd9, 4 | BRF_GRA }, // 12 - - { "bh.v1", 0x20000, 0x07a6114b, 5 | BRF_SND }, // 13 upd7759 samples -}; - -STD_ROM_PICK(searchar) -STD_ROM_FN(searchar) - -static INT32 searcharInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvsearchar = { - "searchar", NULL, NULL, NULL, "1989", - "SAR - Search And Rescue (World)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, searcharRomInfo, searcharRomName, NULL, NULL, IkariInputInfo, SarDIPInfo, - searcharInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 224, 256, 3, 4 -}; - - -// SAR - Search And Rescue (US) - -static struct BurnRomInfo sercharuRomDesc[] = { - { "bh.2", 0x20000, 0xc852e2e2, 1 | BRF_PRG }, // 0 68k Code - { "bh.3", 0x20000, 0xbc04a4a1, 1 | BRF_PRG }, // 1 - { "bh.1", 0x20000, 0xba9ca70b, 1 | BRF_PRG }, // 2 - { "bh.4", 0x20000, 0xeabc5ddf, 1 | BRF_PRG }, // 3 - - { "bh.5", 0x10000, 0x53e2fa76, 2 | BRF_PRG }, // 4 Z80 Code - - { "bh.7", 0x08000, 0xb0f1b049, 3 | BRF_GRA }, // 5 Characters - { "bh.8", 0x08000, 0x174ddba7, 3 | BRF_GRA }, // 6 - - { "bh.c1", 0x80000, 0x1fb8f0ae, 4 | BRF_GRA }, // 7 Sprites - { "bh.c3", 0x80000, 0xfd8bc407, 4 | BRF_GRA }, // 8 - { "bh.c5", 0x80000, 0x1d30acc3, 4 | BRF_GRA }, // 9 - { "bh.c2", 0x80000, 0x7c803767, 4 | BRF_GRA }, // 10 - { "bh.c4", 0x80000, 0xeede7c43, 4 | BRF_GRA }, // 11 - { "bh.c6", 0x80000, 0x9f785cd9, 4 | BRF_GRA }, // 12 - - { "bh.v1", 0x20000, 0x07a6114b, 5 | BRF_SND }, // 13 upd7759 samples -}; - -STD_ROM_PICK(sercharu) -STD_ROM_FN(sercharu) - -struct BurnDriver BurnDrvsercharu = { - "searcharu", "searchar", NULL, NULL, "1989", - "SAR - Search And Rescue (US)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, sercharuRomInfo, sercharuRomName, NULL, NULL, IkariInputInfo, SarDIPInfo, - searcharInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 224, 256, 3, 4 -}; - - -// SAR - Search And Rescue (Japan) - -static struct BurnRomInfo sercharjRomDesc[] = { - { "bh2ver3j.9c", 0x20000, 0x7ef7b172, 1 | BRF_PRG }, // 0 68k Code - { "bh3ver3j.10c",0x20000, 0x3fdea793, 1 | BRF_PRG }, // 1 - { "bhw.1", 0x20000, 0x62b60066, 1 | BRF_PRG }, // 2 - { "bhw.4", 0x20000, 0x16d8525c, 1 | BRF_PRG }, // 3 - - { "bh.5", 0x10000, 0x53e2fa76, 2 | BRF_PRG }, // 4 Z80 Code - - { "bh.7", 0x08000, 0xb0f1b049, 3 | BRF_GRA }, // 5 Characters - { "bh.8", 0x08000, 0x174ddba7, 3 | BRF_GRA }, // 6 - - { "bh.c1", 0x80000, 0x1fb8f0ae, 4 | BRF_GRA }, // 7 Sprites - { "bh.c3", 0x80000, 0xfd8bc407, 4 | BRF_GRA }, // 8 - { "bh.c5", 0x80000, 0x1d30acc3, 4 | BRF_GRA }, // 9 - { "bh.c2", 0x80000, 0x7c803767, 4 | BRF_GRA }, // 10 - { "bh.c4", 0x80000, 0xeede7c43, 4 | BRF_GRA }, // 11 - { "bh.c6", 0x80000, 0x9f785cd9, 4 | BRF_GRA }, // 12 - - { "bh.v1", 0x20000, 0x07a6114b, 5 | BRF_SND }, // 13 upd7759 samples -}; - -STD_ROM_PICK(sercharj) -STD_ROM_FN(sercharj) - -struct BurnDriver BurnDrvsercharj = { - "searcharj", "searchar", NULL, NULL, "1989", - "SAR - Search And Rescue (Japan)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, sercharjRomInfo, sercharjRomName, NULL, NULL, IkariInputInfo, SarDIPInfo, - searcharInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 224, 256, 3, 4 -}; - - - -// Street Smart (US version 2) - -static struct BurnRomInfo streetsmRomDesc[] = { - { "s2-1ver2.14h", 0x20000, 0x655f4773, 1 | BRF_PRG }, // 0 68k Code - { "s2-2ver2.14k", 0x20000, 0xefae4823, 1 | BRF_PRG }, // 1 - - { "s2-5.16c", 0x10000, 0xca4b171e, 2 | BRF_PRG }, // 2 Z80 Code - - { "s2-9.25l", 0x08000, 0x09b6ac67, 3 | BRF_GRA }, // 3 Characters - { "s2-10.25m", 0x08000, 0x89e4ee6f, 3 | BRF_GRA }, // 4 - - { "stsmart.900", 0x80000, 0xa8279a7e, 4 | BRF_GRA }, // 5 Sprites - { "stsmart.902", 0x80000, 0x2f021aa1, 4 | BRF_GRA }, // 6 - { "stsmart.904", 0x80000, 0x167346f7, 4 | BRF_GRA }, // 7 - { "stsmart.901", 0x80000, 0xc305af12, 4 | BRF_GRA }, // 8 - { "stsmart.903", 0x80000, 0x73c16d35, 4 | BRF_GRA }, // 9 - { "stsmart.905", 0x80000, 0xa5beb4e2, 4 | BRF_GRA }, // 10 - - { "s2-6.18d", 0x20000, 0x47db1605, 5 | BRF_SND }, // 11 upd7759 samples - - { "pl20l10a.1n", 0x000cc, 0x00000000, 0 | BRF_NODUMP }, /* PAL is read protected */ -}; - -STD_ROM_PICK(streetsm) -STD_ROM_FN(streetsm) - -static INT32 streetsmInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvstreetsm = { - "streetsm", NULL, NULL, NULL, "1989", - "Street Smart (US version 2)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_VSFIGHT, 0, - NULL, streetsmRomInfo, streetsmRomName, NULL, NULL, DrvInputInfo, StreetsmDIPInfo, - streetsmInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; - - -// Street Smart (US version 1) - -static struct BurnRomInfo streets1RomDesc[] = { - { "s2-1ver1.9c", 0x20000, 0xb59354c5, 1 | BRF_PRG }, // 0 68k Code - { "s2-2ver1.10c", 0x20000, 0xe448b68b, 1 | BRF_PRG }, // 1 - - { "s2-5.16c", 0x10000, 0xca4b171e, 2 | BRF_PRG }, // 2 Z80 Code - - { "s2-7.15l", 0x08000, 0x22bedfe5, 3 | BRF_GRA }, // 3 Characters - { "s2-8.15m", 0x08000, 0x6a1c70ab, 3 | BRF_GRA }, // 4 - - { "stsmart.900", 0x80000, 0xa8279a7e, 4 | BRF_GRA }, // 5 Sprites - { "stsmart.902", 0x80000, 0x2f021aa1, 4 | BRF_GRA }, // 6 - { "stsmart.904", 0x80000, 0x167346f7, 4 | BRF_GRA }, // 7 - { "stsmart.901", 0x80000, 0xc305af12, 4 | BRF_GRA }, // 8 - { "stsmart.903", 0x80000, 0x73c16d35, 4 | BRF_GRA }, // 9 - { "stsmart.905", 0x80000, 0xa5beb4e2, 4 | BRF_GRA }, // 10 - - { "s2-6.18d", 0x20000, 0x47db1605, 5 | BRF_SND }, // 11 upd7759 samples -}; - -STD_ROM_PICK(streets1) -STD_ROM_FN(streets1) - -struct BurnDriver BurnDrvstreets1 = { - "streetsm1", "streetsm", NULL, NULL, "1989", - "Street Smart (US version 1)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_VSFIGHT, 0, - NULL, streets1RomInfo, streets1RomName, NULL, NULL, DrvInputInfo, StreetsmDIPInfo, - searcharInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; - - -// Street Smart (World version 1) - -static struct BurnRomInfo streetswRomDesc[] = { - { "s-smart1.bin", 0x20000, 0xa1f5ceab, 1 | BRF_PRG }, // 0 68k Code - { "s-smart2.bin", 0x20000, 0x263f615d, 1 | BRF_PRG }, // 1 - - { "s2-5.16c", 0x10000, 0xca4b171e, 2 | BRF_PRG }, // 2 Z80 Code - - { "s2-7.15l", 0x08000, 0x22bedfe5, 3 | BRF_GRA }, // 3 Characters - { "s2-8.15m", 0x08000, 0x6a1c70ab, 3 | BRF_GRA }, // 4 - - { "stsmart.900", 0x80000, 0xa8279a7e, 4 | BRF_GRA }, // 5 Sprites - { "stsmart.902", 0x80000, 0x2f021aa1, 4 | BRF_GRA }, // 6 - { "stsmart.904", 0x80000, 0x167346f7, 4 | BRF_GRA }, // 7 - { "stsmart.901", 0x80000, 0xc305af12, 4 | BRF_GRA }, // 8 - { "stsmart.903", 0x80000, 0x73c16d35, 4 | BRF_GRA }, // 9 - { "stsmart.905", 0x80000, 0xa5beb4e2, 4 | BRF_GRA }, // 10 - - { "s2-6.18d", 0x20000, 0x47db1605, 5 | BRF_SND }, // 11 upd7759 samples -}; - -STD_ROM_PICK(streetsw) -STD_ROM_FN(streetsw) - -struct BurnDriver BurnDrvstreetsw = { - "streetsmw", "streetsm", NULL, NULL, "1989", - "Street Smart (World version 1)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_VSFIGHT, 0, - NULL, streetswRomInfo, streetswRomName, NULL, NULL, DrvInputInfo, StreetsjDIPInfo, - searcharInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; - - -// Street Smart (Japan version 1) - -static struct BurnRomInfo streetsjRomDesc[] = { - { "s2v1j_01.bin", 0x20000, 0xf031413c, 1 | BRF_PRG }, // 0 68k Code - { "s2v1j_02.bin", 0x20000, 0xe403a40b, 1 | BRF_PRG }, // 1 - - { "s2-5.16c", 0x10000, 0xca4b171e, 2 | BRF_PRG }, // 2 Z80 Code - - { "s2-7.15l", 0x08000, 0x22bedfe5, 3 | BRF_GRA }, // 3 Characters - { "s2-8.15m", 0x08000, 0x6a1c70ab, 3 | BRF_GRA }, // 4 - - { "stsmart.900", 0x80000, 0xa8279a7e, 4 | BRF_GRA }, // 5 Sprites - { "stsmart.902", 0x80000, 0x2f021aa1, 4 | BRF_GRA }, // 6 - { "stsmart.904", 0x80000, 0x167346f7, 4 | BRF_GRA }, // 7 - { "stsmart.901", 0x80000, 0xc305af12, 4 | BRF_GRA }, // 8 - { "stsmart.903", 0x80000, 0x73c16d35, 4 | BRF_GRA }, // 9 - { "stsmart.905", 0x80000, 0xa5beb4e2, 4 | BRF_GRA }, // 10 - - { "s2-6.18d", 0x20000, 0x47db1605, 5 | BRF_SND }, // 11 upd7759 samples -}; - -STD_ROM_PICK(streetsj) -STD_ROM_FN(streetsj) - -struct BurnDriver BurnDrvstreetsj = { - "streetsmj", "streetsm", NULL, NULL, "1989", - "Street Smart (Japan version 1)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_VSFIGHT, 0, - NULL, streetsjRomInfo, streetsjRomName, NULL, NULL, DrvInputInfo, StreetsjDIPInfo, - searcharInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; - -// Ikari III - The Rescue (8-Way Joystick) - -static struct BurnRomInfo ikari3RomDesc[] = { - { "ik3-2-ver1.c10", 0x20000, 0x1bae8023, 1 | BRF_PRG }, // 0 68k Code - { "ik3-3-ver1.c9", 0x20000, 0x10e38b66, 1 | BRF_PRG }, // 1 - { "ik3-1.c8", 0x10000, 0x47e4d256, 1 | BRF_PRG }, // 2 - { "ik3-4.c12", 0x10000, 0xa43af6b5, 1 | BRF_PRG }, // 3 - - { "ik3-5.16d", 0x10000, 0xce6706fc, 2 | BRF_PRG }, // 4 Z80 Code - - { "ik3-7.16l", 0x08000, 0x0b4804df, 3 | BRF_GRA }, // 5 Characters - { "ik3-8.16m", 0x08000, 0x10ab4e50, 3 | BRF_GRA }, // 6 - - { "ik3-13.bin", 0x20000, 0x9a56bd32, 4 | BRF_GRA }, // 7 Sprites - { "ik3-12.bin", 0x20000, 0x0ce6a10a, 4 | BRF_GRA }, // 8 - { "ik3-11.bin", 0x20000, 0xe4e2be43, 4 | BRF_GRA }, // 9 - { "ik3-10.bin", 0x20000, 0xac222372, 4 | BRF_GRA }, // 10 - { "ik3-9.bin", 0x20000, 0xc33971c2, 4 | BRF_GRA }, // 11 - { "ik3-14.bin", 0x20000, 0x453bea77, 4 | BRF_GRA }, // 12 - { "ik3-15.bin", 0x20000, 0x781a81fc, 4 | BRF_GRA }, // 13 - { "ik3-16.bin", 0x20000, 0x80ba400b, 4 | BRF_GRA }, // 14 - { "ik3-17.bin", 0x20000, 0x0cc3ce4a, 4 | BRF_GRA }, // 15 - { "ik3-18.bin", 0x20000, 0xba106245, 4 | BRF_GRA }, // 16 - { "ik3-23.bin", 0x20000, 0xd0fd5c77, 4 | BRF_GRA }, // 17 - { "ik3-22.bin", 0x20000, 0x4878d883, 4 | BRF_GRA }, // 18 - { "ik3-21.bin", 0x20000, 0x50d0fbf0, 4 | BRF_GRA }, // 19 - { "ik3-20.bin", 0x20000, 0x9a851efc, 4 | BRF_GRA }, // 20 - { "ik3-19.bin", 0x20000, 0x4ebdba89, 4 | BRF_GRA }, // 21 - { "ik3-24.bin", 0x20000, 0xe9b26d68, 4 | BRF_GRA }, // 22 - { "ik3-25.bin", 0x20000, 0x073b03f1, 4 | BRF_GRA }, // 23 - { "ik3-26.bin", 0x20000, 0x9c613561, 4 | BRF_GRA }, // 24 - { "ik3-27.bin", 0x20000, 0x16dd227e, 4 | BRF_GRA }, // 25 - { "ik3-28.bin", 0x20000, 0x711715ae, 4 | BRF_GRA }, // 26 - - { "ik3-6.18e", 0x20000, 0x59d256a4, 5 | BRF_SND }, // 27 upd7759 samples -}; - -STD_ROM_PICK(ikari3) -STD_ROM_FN(ikari3) - -static INT32 ikari3Init() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvikari3 = { - "ikari3", NULL, NULL, NULL, "1989", - "Ikari III - The Rescue (8-Way Joystick)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikari3RomInfo, ikari3RomName, NULL, NULL, IkariInputInfo, IkariDIPInfo, - ikari3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; - -// Ikari III - The Rescue (US, Rotary Joystick) - -static struct BurnRomInfo ikari3uRomDesc[] = { - { "ik3-2.c10", 0x20000, 0xa7b34dcd, 1 | BRF_PRG }, // 0 68k Code - { "ik3-3.c9", 0x20000, 0x50f2b83d, 1 | BRF_PRG }, // 1 - { "ik3-1.c8", 0x10000, 0x47e4d256, 1 | BRF_PRG }, // 2 - { "ik3-4.c12", 0x10000, 0xa43af6b5, 1 | BRF_PRG }, // 3 - - { "ik3-5.15d", 0x10000, 0xce6706fc, 2 | BRF_PRG }, // 4 Z80 Code - - { "ik3-7.16l", 0x08000, 0x0b4804df, 3 | BRF_GRA }, // 5 Characters - { "ik3-8.16m", 0x08000, 0x10ab4e50, 3 | BRF_GRA }, // 6 - - { "ik3-13.bin", 0x20000, 0x9a56bd32, 4 | BRF_GRA }, // 7 Sprites - { "ik3-12.bin", 0x20000, 0x0ce6a10a, 4 | BRF_GRA }, // 8 - { "ik3-11.bin", 0x20000, 0xe4e2be43, 4 | BRF_GRA }, // 9 - { "ik3-10.bin", 0x20000, 0xac222372, 4 | BRF_GRA }, // 10 - { "ik3-9.bin", 0x20000, 0xc33971c2, 4 | BRF_GRA }, // 11 - { "ik3-14.bin", 0x20000, 0x453bea77, 4 | BRF_GRA }, // 12 - { "ik3-15.bin", 0x20000, 0x781a81fc, 4 | BRF_GRA }, // 13 - { "ik3-16.bin", 0x20000, 0x80ba400b, 4 | BRF_GRA }, // 14 - { "ik3-17.bin", 0x20000, 0x0cc3ce4a, 4 | BRF_GRA }, // 15 - { "ik3-18.bin", 0x20000, 0xba106245, 4 | BRF_GRA }, // 16 - { "ik3-23.bin", 0x20000, 0xd0fd5c77, 4 | BRF_GRA }, // 17 - { "ik3-22.bin", 0x20000, 0x4878d883, 4 | BRF_GRA }, // 18 - { "ik3-21.bin", 0x20000, 0x50d0fbf0, 4 | BRF_GRA }, // 19 - { "ik3-20.bin", 0x20000, 0x9a851efc, 4 | BRF_GRA }, // 20 - { "ik3-19.bin", 0x20000, 0x4ebdba89, 4 | BRF_GRA }, // 21 - { "ik3-24.bin", 0x20000, 0xe9b26d68, 4 | BRF_GRA }, // 22 - { "ik3-25.bin", 0x20000, 0x073b03f1, 4 | BRF_GRA }, // 23 - { "ik3-26.bin", 0x20000, 0x9c613561, 4 | BRF_GRA }, // 24 - { "ik3-27.bin", 0x20000, 0x16dd227e, 4 | BRF_GRA }, // 25 - { "ik3-28.bin", 0x20000, 0x711715ae, 4 | BRF_GRA }, // 26 - - { "ik3-6.18e", 0x20000, 0x59d256a4, 5 | BRF_SND }, // 27 upd7759 samples -}; - -STD_ROM_PICK(ikari3u) -STD_ROM_FN(ikari3u) - -struct BurnDriver BurnDrvikari3u = { - "ikari3u", "ikari3", NULL, NULL, "1989", - "Ikari III - The Rescue (US, Rotary Joystick)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikari3uRomInfo, ikari3uRomName, NULL, NULL, IkariInputInfo, IkariDIPInfo, - ikari3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; - -// Ikari Three - The Rescue (Japan, Rotary Joystick) - -static struct BurnRomInfo ikari3jRomDesc[] = { - { "ik3-2-j.c10", 0x20000, 0x7b1b4be4, 1 | BRF_PRG }, // 0 68k Code - { "ik3-3-j.c9", 0x20000, 0x8e6e2aa9, 1 | BRF_PRG }, // 1 - { "ik3-1.c8", 0x10000, 0x47e4d256, 1 | BRF_PRG }, // 2 - { "ik3-4.c12", 0x10000, 0xa43af6b5, 1 | BRF_PRG }, // 3 - - { "ik3-5.16d", 0x10000, 0xce6706fc, 2 | BRF_PRG }, // 4 Z80 Code - - { "ik3-7.16l", 0x08000, 0x0b4804df, 3 | BRF_GRA }, // 5 Characters - { "ik3-8.16m", 0x08000, 0x10ab4e50, 3 | BRF_GRA }, // 6 - - { "ik3-13.bin", 0x20000, 0x9a56bd32, 4 | BRF_GRA }, // 7 Sprites - { "ik3-12.bin", 0x20000, 0x0ce6a10a, 4 | BRF_GRA }, // 8 - { "ik3-11.bin", 0x20000, 0xe4e2be43, 4 | BRF_GRA }, // 9 - { "ik3-10.bin", 0x20000, 0xac222372, 4 | BRF_GRA }, // 10 - { "ik3-9.bin", 0x20000, 0xc33971c2, 4 | BRF_GRA }, // 11 - { "ik3-14.bin", 0x20000, 0x453bea77, 4 | BRF_GRA }, // 12 - { "ik3-15.bin", 0x20000, 0x781a81fc, 4 | BRF_GRA }, // 13 - { "ik3-16.bin", 0x20000, 0x80ba400b, 4 | BRF_GRA }, // 14 - { "ik3-17.bin", 0x20000, 0x0cc3ce4a, 4 | BRF_GRA }, // 15 - { "ik3-18.bin", 0x20000, 0xba106245, 4 | BRF_GRA }, // 16 - { "ik3-23.bin", 0x20000, 0xd0fd5c77, 4 | BRF_GRA }, // 17 - { "ik3-22.bin", 0x20000, 0x4878d883, 4 | BRF_GRA }, // 18 - { "ik3-21.bin", 0x20000, 0x50d0fbf0, 4 | BRF_GRA }, // 19 - { "ik3-20.bin", 0x20000, 0x9a851efc, 4 | BRF_GRA }, // 20 - { "ik3-19.bin", 0x20000, 0x4ebdba89, 4 | BRF_GRA }, // 21 - { "ik3-24.bin", 0x20000, 0xe9b26d68, 4 | BRF_GRA }, // 22 - { "ik3-25.bin", 0x20000, 0x073b03f1, 4 | BRF_GRA }, // 23 - { "ik3-26.bin", 0x20000, 0x9c613561, 4 | BRF_GRA }, // 24 - { "ik3-27.bin", 0x20000, 0x16dd227e, 4 | BRF_GRA }, // 25 - { "ik3-28.bin", 0x20000, 0x711715ae, 4 | BRF_GRA }, // 26 - - { "ik3-6.18e", 0x20000, 0x59d256a4, 5 | BRF_SND }, // 27 upd7759 samples -}; - -STD_ROM_PICK(ikari3j) -STD_ROM_FN(ikari3j) - -struct BurnDriver BurnDrvikari3j = { - "ikari3j", "ikari3", NULL, NULL, "1989", - "Ikari Three - The Rescue (Japan, Rotary Joystick)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikari3jRomInfo, ikari3jRomName, NULL, NULL, IkariInputInfo, IkariDIPInfo, - ikari3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; - -// Ikari III - The Rescue (Korea, 8-Way Joystick) - -static struct BurnRomInfo ikari3kRomDesc[] = { - { "ik3-2k.c10", 0x20000, 0xa15d2222, 1 | BRF_PRG }, // 0 68k Code - { "ik3-3k.c9", 0x20000, 0xe3fc006e, 1 | BRF_PRG }, // 1 - { "ik3-1.c8", 0x10000, 0x47e4d256, 1 | BRF_PRG }, // 2 - { "ik3-4.c12", 0x10000, 0xa43af6b5, 1 | BRF_PRG }, // 3 - - { "ik3-5.16d", 0x10000, 0xce6706fc, 2 | BRF_PRG }, // 4 Z80 Code - - { "ik3-7k.16l", 0x08000, 0x8bfb399b, 3 | BRF_GRA }, // 5 Characters - { "ik3-8k.16m", 0x08000, 0x3f0fe576, 3 | BRF_GRA }, // 6 - - { "ik3-13.bin", 0x20000, 0x9a56bd32, 4 | BRF_GRA }, // 7 Sprites - { "ik3-12.bin", 0x20000, 0x0ce6a10a, 4 | BRF_GRA }, // 8 - { "ik3-11.bin", 0x20000, 0xe4e2be43, 4 | BRF_GRA }, // 9 - { "ik3-10.bin", 0x20000, 0xac222372, 4 | BRF_GRA }, // 10 - { "ik3-9.bin", 0x20000, 0xc33971c2, 4 | BRF_GRA }, // 11 - { "ik3-14.bin", 0x20000, 0x453bea77, 4 | BRF_GRA }, // 12 - { "ik3-15.bin", 0x20000, 0x781a81fc, 4 | BRF_GRA }, // 13 - { "ik3-16.bin", 0x20000, 0x80ba400b, 4 | BRF_GRA }, // 14 - { "ik3-17.bin", 0x20000, 0x0cc3ce4a, 4 | BRF_GRA }, // 15 - { "ik3-18.bin", 0x20000, 0xba106245, 4 | BRF_GRA }, // 16 - { "ik3-23.bin", 0x20000, 0xd0fd5c77, 4 | BRF_GRA }, // 17 - { "ik3-22.bin", 0x20000, 0x4878d883, 4 | BRF_GRA }, // 18 - { "ik3-21.bin", 0x20000, 0x50d0fbf0, 4 | BRF_GRA }, // 19 - { "ik3-20.bin", 0x20000, 0x9a851efc, 4 | BRF_GRA }, // 20 - { "ik3-19.bin", 0x20000, 0x4ebdba89, 4 | BRF_GRA }, // 21 - { "ik3-24.bin", 0x20000, 0xe9b26d68, 4 | BRF_GRA }, // 22 - { "ik3-25.bin", 0x20000, 0x073b03f1, 4 | BRF_GRA }, // 23 - { "ik3-26.bin", 0x20000, 0x9c613561, 4 | BRF_GRA }, // 24 - { "ik3-27.bin", 0x20000, 0x16dd227e, 4 | BRF_GRA }, // 25 - { "ik3-28.bin", 0x20000, 0x711715ae, 4 | BRF_GRA }, // 26 - - { "ik3-6.18e", 0x20000, 0x59d256a4, 5 | BRF_SND }, // 27 upd7759 samples -}; - -STD_ROM_PICK(ikari3k) -STD_ROM_FN(ikari3k) - -struct BurnDriver BurnDrvikari3k = { - "ikari3k", "ikari3", NULL, NULL, "1989", - "Ikari III - The Rescue (Korea, 8-Way Joystick)\0", NULL, "SNK", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0, - NULL, ikari3kRomInfo, ikari3kRomName, NULL, NULL, IkariInputInfo, IkariDIPInfo, - ikari3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_solomon.cpp b/jan/src/burn/drv/pre90s/d_solomon.cpp deleted file mode 100644 index b27ec678b..000000000 --- a/jan/src/burn/drv/pre90s/d_solomon.cpp +++ /dev/null @@ -1,787 +0,0 @@ -// FB Alpha Solomon's Key driver module -// Based on MAME driver by Mirko Buffoni - -#include "tiles_generic.h" -#include "z80_intf.h" - -#include "driver.h" -extern "C" { - #include "ay8910.h" -} - -static UINT8 SolomonInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 SolomonInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 SolomonInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 SolomonDip[2] = {0, 0}; -static UINT8 SolomonInput[3] = {0x00, 0x00, 0x00}; -static UINT8 SolomonReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *SolomonZ80Rom1 = NULL; -static UINT8 *SolomonZ80Rom2 = NULL; -static UINT8 *SolomonZ80Ram1 = NULL; -static UINT8 *SolomonZ80Ram2 = NULL; -static UINT8 *SolomonColourRam = NULL; -static UINT8 *SolomonVideoRam = NULL; -static UINT8 *SolomonBgColourRam = NULL; -static UINT8 *SolomonBgVideoRam = NULL; -static UINT8 *SolomonSpriteRam = NULL; -static UINT8 *SolomonPaletteRam = NULL; -static UINT32 *SolomonPalette = NULL; -static UINT8 *SolomonBgTiles = NULL; -static UINT8 *SolomonFgTiles = NULL; -static UINT8 *SolomonSprites = NULL; -static UINT8 *SolomonTempRom = NULL; - -static INT32 SolomonIrqFire = 0; - -static INT32 SolomonFlipScreen = 0; - -static INT32 SolomonSoundLatch = 0; -static INT16* pFMBuffer; -static INT16* pAY8910Buffer[9]; - - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo SolomonInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , SolomonInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , SolomonInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , SolomonInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , SolomonInputPort2 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , SolomonInputPort0 + 2, "p1 up" }, - {"Down" , BIT_DIGITAL , SolomonInputPort0 + 3, "p1 down" }, - {"Left" , BIT_DIGITAL , SolomonInputPort0 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , SolomonInputPort0 + 0, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , SolomonInputPort0 + 5, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , SolomonInputPort0 + 4, "p1 fire 2" }, - - {"Up (Cocktail)" , BIT_DIGITAL , SolomonInputPort1 + 2, "p2 up" }, - {"Down (Cocktail)" , BIT_DIGITAL , SolomonInputPort1 + 3, "p2 down" }, - {"Left (Cocktail)" , BIT_DIGITAL , SolomonInputPort1 + 1, "p2 left" }, - {"Right (Cocktail)" , BIT_DIGITAL , SolomonInputPort1 + 0, "p2 right" }, - {"Fire 1 (Cocktail)" , BIT_DIGITAL , SolomonInputPort1 + 5, "p2 fire 1" }, - {"Fire 2 (Cocktail)" , BIT_DIGITAL , SolomonInputPort1 + 4, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &SolomonReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, SolomonDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, SolomonDip + 1 , "dip" }, -}; - -STDINPUTINFO(Solomon) - -inline void SolomonClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -inline void SolomonMakeInputs() -{ - // Reset Inputs - SolomonInput[0] = SolomonInput[1] = SolomonInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - SolomonInput[0] |= (SolomonInputPort0[i] & 1) << i; - SolomonInput[1] |= (SolomonInputPort1[i] & 1) << i; - SolomonInput[2] |= (SolomonInputPort2[i] & 1) << i; - } - - // Clear Opposites - SolomonClearOpposites(&SolomonInput[0]); - SolomonClearOpposites(&SolomonInput[1]); -} - -static struct BurnDIPInfo SolomonDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x02, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x02, 0x02, "Upright" }, - {0x11, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x0c, 0x0c, "2" }, - {0x11, 0x01, 0x0c, 0x00, "3" }, - {0x11, 0x01, 0x0c, 0x08, "4" }, - {0x11, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0xc0, 0x80, "2 Coins 1 Play" }, - {0x11, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - {0x11, 0x01, 0xc0, 0x40, "1 Coin 2 Play" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 3 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0x30, 0x20, "2 Coins 1 Play" }, - {0x11, 0x01, 0x30, 0x00, "1 Coin 1 Play" }, - {0x11, 0x01, 0x30, 0x10, "1 Coin 2 Play" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 3 Play" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x00, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Harder" }, - {0x12, 0x01, 0x03, 0x03, "Difficult" }, - - {0 , 0xfe, 0 , 4 , "Timer Speed" }, - {0x12, 0x01, 0x0c, 0x08, "Slow" }, - {0x12, 0x01, 0x0c, 0x00, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Faster" }, - {0x12, 0x01, 0x0c, 0x0c, "Fastest" }, - - {0 , 0xfe, 0 , 2 , "Extra" }, - {0x12, 0x01, 0x10, 0x00, "Normal" }, - {0x12, 0x01, 0x10, 0x10, "Difficult" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x12, 0x01, 0xe0, 0x00, "30k 200k 500k" }, - {0x12, 0x01, 0xe0, 0x80, "100k 300k 800k" }, - {0x12, 0x01, 0xe0, 0x40, "30k 200k" }, - {0x12, 0x01, 0xe0, 0xc0, "100k 300k" }, - {0x12, 0x01, 0xe0, 0x20, "30k" }, - {0x12, 0x01, 0xe0, 0xa0, "100k" }, - {0x12, 0x01, 0xe0, 0x60, "200k" }, - {0x12, 0x01, 0xe0, 0xe0, "None" }, -}; - -STDDIPINFO(Solomon) - -static struct BurnRomInfo SolomonRomDesc[] = { - { "6.3f", 0x04000, 0x645eb0f3, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "7.3h", 0x08000, 0x1bf5c482, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "8.3jk", 0x08000, 0x0a6cdefc, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "1.3jk", 0x04000, 0xfa6e562e, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "12.3t", 0x08000, 0xb371291c, BRF_GRA }, // 4 Characters - { "11.3r", 0x08000, 0x6f94d2af, BRF_GRA }, // 5 Characters - { "10.3p", 0x08000, 0x8310c2a1, BRF_GRA }, // 6 Characters - { "9.3m", 0x08000, 0xab7e6c42, BRF_GRA }, // 7 Characters - { "2.5lm", 0x04000, 0x80fa2be3, BRF_GRA }, // 8 Sprites - { "3.6lm", 0x04000, 0x236106b4, BRF_GRA }, // 9 Sprites - { "4.7lm", 0x04000, 0x088fe5d9, BRF_GRA }, // 10 Sprites - { "5.8lm", 0x04000, 0x8366232a, BRF_GRA }, // 11 Sprites -}; - - -STD_ROM_PICK(Solomon) -STD_ROM_FN(Solomon) - -static struct BurnRomInfo SolomonjRomDesc[] = { - { "slmn_06.bin", 0x04000, 0xe4d421ff, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "slmn_07.bin", 0x08000, 0xd52d7e38, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "slmn_08.bin", 0x01000, 0xb924d162, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "slmn_01.bin", 0x04000, 0xfa6e562e, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "slmn_12.bin", 0x08000, 0xaa26dfcb, BRF_GRA }, // 4 Characters - { "slmn_11.bin", 0x08000, 0x6f94d2af, BRF_GRA }, // 5 Characters - { "slmn_10.bin", 0x08000, 0x8310c2a1, BRF_GRA }, // 6 Characters - { "slmn_09.bin", 0x08000, 0xab7e6c42, BRF_GRA }, // 7 Characters - { "slmn_02.bin", 0x04000, 0x80fa2be3, BRF_GRA }, // 8 Sprites - { "slmn_03.bin", 0x04000, 0x236106b4, BRF_GRA }, // 9 Sprites - { "slmn_04.bin", 0x04000, 0x088fe5d9, BRF_GRA }, // 10 Sprites - { "slmn_05.bin", 0x04000, 0x8366232a, BRF_GRA }, // 11 Sprites -}; - - -STD_ROM_PICK(Solomonj) -STD_ROM_FN(Solomonj) - -INT32 SolomonDoReset() -{ - SolomonIrqFire = 0; - SolomonFlipScreen = 0; - SolomonSoundLatch = 0; - - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - for (INT32 i = 0; i < 3; i++) { - AY8910Reset(i); - } - - HiscoreReset(); - - return 0; -} - -UINT8 __fastcall SolomonRead1(UINT16 a) -{ - switch (a) { - case 0xe600: { - return SolomonInput[0]; - } - - case 0xe601: { - return SolomonInput[1]; - } - - case 0xe602: { - return SolomonInput[2]; - } - - case 0xe604: { - return SolomonDip[0]; - } - - case 0xe605: { - return SolomonDip[1]; - } - } - - return 0; -} - -void __fastcall SolomonWrite1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe600: { - SolomonIrqFire = d; - return; - } - - case 0xe604: { - SolomonFlipScreen = d & 1; - return; - } - - case 0xe800: { - SolomonSoundLatch = d; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - } - } -} - -UINT8 __fastcall SolomonRead2(UINT16 a) -{ - switch (a) { - case 0x8000: { - return SolomonSoundLatch; - } - } - - return 0; -} - -void __fastcall SolomonPortWrite2(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x10: { - AY8910Write(0, 0, d); - return; - } - - case 0x11: { - AY8910Write(0, 1, d); - return; - } - - case 0x20: { - AY8910Write(1, 0, d); - return; - } - - case 0x21: { - AY8910Write(1, 1, d); - return; - } - - case 0x30: { - AY8910Write(2, 0, d); - return; - } - - case 0x31: { - AY8910Write(2, 1, d); - return; - } - } -} - -static INT32 SolomonMemIndex() -{ - UINT8 *Next; Next = Mem; - - SolomonZ80Rom1 = Next; Next += 0x10000; - SolomonZ80Rom2 = Next; Next += 0x04000; - - RamStart = Next; - - SolomonZ80Ram1 = Next; Next += 0x01000; - SolomonZ80Ram2 = Next; Next += 0x00800; - SolomonColourRam = Next; Next += 0x00400; - SolomonVideoRam = Next; Next += 0x00400; - SolomonBgColourRam = Next; Next += 0x00400; - SolomonBgVideoRam = Next; Next += 0x00400; - SolomonSpriteRam = Next; Next += 0x00080; - SolomonPaletteRam = Next; Next += 0x00200; - - RamEnd = Next; - - SolomonBgTiles = Next; Next += 2048 * 8 * 8; - SolomonFgTiles = Next; Next += 2048 * 8 * 8; - SolomonSprites = Next; Next += 2048 * 8 * 8; - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 9 * sizeof(INT16); - SolomonPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 TilePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TileXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 TileYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 SpritePlaneOffsets[4] = { 0, 131072, 262144, 393216 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71 }; -static INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 128, 136, 144, 152, 160, 168, 176, 184 }; - -INT32 SolomonInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - SolomonMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - SolomonMemIndex(); - - SolomonTempRom = (UINT8 *)BurnMalloc(0x10000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(SolomonZ80Rom1, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(SolomonTempRom, 1, 1); if (nRet != 0) return 1; - memcpy(SolomonZ80Rom1 + 0x4000, SolomonTempRom + 0x4000, 0x4000); - memcpy(SolomonZ80Rom1 + 0x8000, SolomonTempRom + 0x0000, 0x4000); - memset(SolomonTempRom, 0, 0x10000); - nRet = BurnLoadRom(SolomonTempRom, 2, 1); if (nRet != 0) return 1; - memcpy(SolomonZ80Rom1 + 0xf000, SolomonTempRom, 0x1000); - - // Load Z80 #2 Program Rom - nRet = BurnLoadRom(SolomonZ80Rom2, 3, 1); if (nRet != 0) return 1; - - // Load and decode Bg Tiles - memset(SolomonTempRom, 0, 0x10000); - nRet = BurnLoadRom(SolomonTempRom + 0x0000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(SolomonTempRom + 0x8000, 7, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, SolomonTempRom, SolomonBgTiles); - - // Load and decode Fg Tiles - memset(SolomonTempRom, 0, 0x10000); - nRet = BurnLoadRom(SolomonTempRom + 0x0000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(SolomonTempRom + 0x8000, 5, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, SolomonTempRom, SolomonFgTiles); - - // Load and decode Sprite Tiles - memset(SolomonTempRom, 0, 0x10000); - nRet = BurnLoadRom(SolomonTempRom + 0x0000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(SolomonTempRom + 0x4000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(SolomonTempRom + 0x8000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(SolomonTempRom + 0xc000, 11, 1); if (nRet != 0) return 1; -// SolomonDecodeSprites(SolomonSprites, 2048, 0x0000, 0x4000, 0x8000, 0xc000); - GfxDecode(512, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, SolomonTempRom, SolomonSprites); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(SolomonRead1); - ZetSetWriteHandler(SolomonWrite1); - ZetMapArea(0x0000, 0xbfff, 0, SolomonZ80Rom1 ); - ZetMapArea(0x0000, 0xbfff, 2, SolomonZ80Rom1 ); - ZetMapArea(0xc000, 0xcfff, 0, SolomonZ80Ram1 ); - ZetMapArea(0xc000, 0xcfff, 1, SolomonZ80Ram1 ); - ZetMapArea(0xc000, 0xcfff, 2, SolomonZ80Ram1 ); - ZetMapArea(0xd000, 0xd3ff, 0, SolomonColourRam ); - ZetMapArea(0xd000, 0xd3ff, 1, SolomonColourRam ); - ZetMapArea(0xd000, 0xd3ff, 2, SolomonColourRam ); - ZetMapArea(0xd400, 0xd7ff, 0, SolomonVideoRam ); - ZetMapArea(0xd400, 0xd7ff, 1, SolomonVideoRam ); - ZetMapArea(0xd400, 0xd7ff, 2, SolomonVideoRam ); - ZetMapArea(0xd800, 0xdbff, 0, SolomonBgColourRam ); - ZetMapArea(0xd800, 0xdbff, 1, SolomonBgColourRam ); - ZetMapArea(0xd800, 0xdbff, 2, SolomonBgColourRam ); - ZetMapArea(0xdc00, 0xdfff, 0, SolomonBgVideoRam ); - ZetMapArea(0xdc00, 0xdfff, 1, SolomonBgVideoRam ); - ZetMapArea(0xdc00, 0xdfff, 2, SolomonBgVideoRam ); - ZetMapArea(0xe000, 0xe07f, 0, SolomonSpriteRam ); - ZetMapArea(0xe000, 0xe07f, 1, SolomonSpriteRam ); - ZetMapArea(0xe000, 0xe07f, 2, SolomonSpriteRam ); - ZetMapArea(0xe400, 0xe5ff, 0, SolomonPaletteRam ); - ZetMapArea(0xe400, 0xe5ff, 1, SolomonPaletteRam ); - ZetMapArea(0xe400, 0xe5ff, 2, SolomonPaletteRam ); - ZetMapArea(0xf000, 0xffff, 0, SolomonZ80Rom1 + 0xf000); - ZetMapArea(0xf000, 0xffff, 2, SolomonZ80Rom1 + 0xf000); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(SolomonRead2); - ZetSetOutHandler(SolomonPortWrite2); - ZetMapArea(0x0000, 0x3fff, 0, SolomonZ80Rom2 ); - ZetMapArea(0x0000, 0x3fff, 2, SolomonZ80Rom2 ); - ZetMapArea(0x4000, 0x47ff, 0, SolomonZ80Ram2 ); - ZetMapArea(0x4000, 0x47ff, 1, SolomonZ80Ram2 ); - ZetMapArea(0x4000, 0x47ff, 2, SolomonZ80Ram2 ); - ZetClose(); - - BurnFree(SolomonTempRom); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - pAY8910Buffer[6] = pFMBuffer + nBurnSoundLen * 6; - pAY8910Buffer[7] = pFMBuffer + nBurnSoundLen * 7; - pAY8910Buffer[8] = pFMBuffer + nBurnSoundLen * 8; - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.12, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.12, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(2, 0.12, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - SolomonDoReset(); - - return 0; -} - -INT32 SolomonExit() -{ - ZetExit(); - - for (INT32 i = 0; i < 3; i++) { - AY8910Exit(i); - } - - GenericTilesExit(); - - BurnFree(Mem); - - return 0; -} - -void SolomonRenderBgLayer() -{ - for (INT32 Offs = 0; Offs < 0x400; Offs++) { - INT32 sx, sy, Attr, Code, Colour, FlipX, FlipY; - - sx = (Offs % 32); - sy = (Offs / 32); - Attr = SolomonBgColourRam[Offs]; - Code = SolomonBgVideoRam[Offs] + 256 * (Attr & 0x07); - Colour = (Attr & 0x70) >> 4; - FlipX = Attr & 0x80; - FlipY = Attr & 0x08; - - if (SolomonFlipScreen) { - sx = 31 - sx; - sy = 31 - sy; - FlipX = !FlipX; - FlipY = !FlipY; - } - - sx *= 8; - sy *= 8; - sy -= 16; - - if (sx >= 0 && sx < 247 && sy >= 0 && sy < 215) { - if (!FlipY) { - if (!FlipX) { - Render8x8Tile_Mask(pTransDraw, Code, sx, sy, Colour, 4, 0, 128, SolomonBgTiles); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, 4, 0, 128, SolomonBgTiles); - } - } else { - if (!FlipX) { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, sx, sy, Colour, 4, 0, 128, SolomonBgTiles); - } else { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, sx, sy, Colour, 4, 0, 128, SolomonBgTiles); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render8x8Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 128, SolomonBgTiles); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 128, SolomonBgTiles); - } - } else { - if (!FlipX) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 128, SolomonBgTiles); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 128, SolomonBgTiles); - } - } - } - } -} - -void SolomonRenderFgLayer() -{ - for (INT32 Offs = 0x400 - 1; Offs >= 0; Offs--) { - INT32 sx, sy, Code, Colour; - - sx = (Offs % 32); - sy = (Offs / 32); - Code = SolomonVideoRam[Offs] + 256 * (SolomonColourRam[Offs] & 0x07); - Colour = (SolomonColourRam[Offs] & 0x70) >> 4; - - if (SolomonFlipScreen) { - sx = 31 - sx; - sy = 31 - sy; - } - - sx *= 8; - sy *= 8; - sy -= 16; - - if (sx >= 0 && sx < 247 && sy >= 0 && sy < 215) { - if (!SolomonFlipScreen) { - Render8x8Tile_Mask(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonFgTiles); - } else { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonFgTiles); - } - } else { - if (!SolomonFlipScreen) { - Render8x8Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonFgTiles); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonFgTiles); - } - } - } -} - -void SolomonRenderSpriteLayer() -{ - for (INT32 Offs = 0x80 - 4; Offs >= 0; Offs -= 4) { - INT32 sx, sy, Attr, Code, Colour, FlipX, FlipY; - - sx = SolomonSpriteRam[Offs + 3]; - sy = 241 - SolomonSpriteRam[Offs + 2]; - Attr = SolomonSpriteRam[Offs + 1]; - Code = SolomonSpriteRam[Offs] + 16 * (Attr & 0x10); - Colour = (Attr & 0x0e) >> 1; - FlipX = Attr & 0x40; - FlipY = Attr & 0x80; - - if (SolomonFlipScreen & 1) { - sx = 240 - sx; - sy = 240 - sy; - FlipX = !FlipX; - FlipY = !FlipY; - } - - sy -= 16; - - if (sx >= 0 && sx < 239 && sy >= 0 && sy < 207) { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonSprites); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonSprites); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonSprites); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, SolomonSprites); - } - } - } - } -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 0) & 0x0f; - g = (nColour >> 4) & 0x0f; - b = (nColour >> 8) & 0x0f; - - r = (r << 4) | r; - g = (g << 4) | g; - b = (b << 4) | b; - - return BurnHighCol(r, g, b, 0); -} - -INT32 SolomonCalcPalette() -{ - for (INT32 i = 0; i < 0x200; i++) { - SolomonPalette[i / 2] = CalcCol(SolomonPaletteRam[i & ~1] | (SolomonPaletteRam[i | 1] << 8)); - } - - return 0; -} - -void SolomonDraw() -{ - BurnTransferClear(); - SolomonCalcPalette(); - SolomonRenderBgLayer(); - SolomonRenderFgLayer(); - SolomonRenderSpriteLayer(); - BurnTransferCopy(SolomonPalette); -} - -INT32 SolomonFrame() -{ - INT32 nInterleave = 2; - INT32 nSoundBufferPos = 0; - - if (SolomonReset) SolomonDoReset(); - - SolomonMakeInputs(); - - nCyclesTotal[0] = 4000000 / 60; - nCyclesTotal[1] = 3072000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 1) if(SolomonIrqFire) ZetNmi(); - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) SolomonDraw(); - - return 0; -} - -static INT32 SolomonScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x02945; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); // Scan Z80 - - // Scan critical driver variables - SCAN_VAR(SolomonIrqFire); - SCAN_VAR(SolomonFlipScreen); - SCAN_VAR(SolomonSoundLatch); - SCAN_VAR(SolomonInput); - SCAN_VAR(SolomonDip); - } - - return 0; -} - -struct BurnDriver BurnDrvSolomon = { - "solomon", NULL, NULL, NULL, "1986", - "Solomon's Key (US)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, SolomonRomInfo, SolomonRomName, NULL, NULL, SolomonInputInfo, SolomonDIPInfo, - SolomonInit, SolomonExit, SolomonFrame, NULL, SolomonScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSolomonj = { - "solomonj", "solomon", NULL, NULL, "1986", - "Solomon's Key (Japan)\0", NULL, "Tecmo", "Miscellaneous", - L"Solomon's Key (Japan)\0Solomon's Key \u30BD\u30ED\u30E2\u30F3\u306E\u9375\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, SolomonjRomInfo, SolomonjRomName, NULL, NULL, SolomonInputInfo, SolomonDIPInfo, - SolomonInit, SolomonExit, SolomonFrame, NULL, SolomonScan, - NULL, 0x200, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_sonson.cpp b/jan/src/burn/drv/pre90s/d_sonson.cpp deleted file mode 100644 index 97abb6e0f..000000000 --- a/jan/src/burn/drv/pre90s/d_sonson.cpp +++ /dev/null @@ -1,740 +0,0 @@ -// FB Alpha Son Son driver module -// Based on MAME driver by Mirko Buffoni - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *DrvM6809RAM0; -static UINT8 *DrvM6809RAM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvScrollX; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; -static INT16 *pFMBuffer; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInps[3]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static UINT8 soundlatch; -static UINT8 flipscreen; - -static UINT8 DrvSoundTrigger; -static UINT8 DrvSoundIrqTrigger; - -static INT32 sonsonj; - -static struct BurnInputInfo SonsonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Sonson) - -static struct BurnDIPInfo SonsonDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xdf, NULL }, - {0x10, 0xff, 0xff, 0xeb, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x0f, 0x01, 0x0f, 0x02, "4C_1C" }, - {0x0f, 0x01, 0x0f, 0x05, "3C_1C" }, - {0x0f, 0x01, 0x0f, 0x08, "2C_1C" }, - {0x0f, 0x01, 0x0f, 0x04, "3C_2C" }, - {0x0f, 0x01, 0x0f, 0x01, "4C_3C" }, - {0x0f, 0x01, 0x0f, 0x0f, "1C_1C" }, - {0x0f, 0x01, 0x0f, 0x03, "3C_4C" }, - {0x0f, 0x01, 0x0f, 0x07, "2C_3C" }, - {0x0f, 0x01, 0x0f, 0x0e, "1C_2C" }, - {0x0f, 0x01, 0x0f, 0x06, "2C_5C" }, - {0x0f, 0x01, 0x0f, 0x0d, "1C_3C" }, - {0x0f, 0x01, 0x0f, 0x0c, "1C_4C" }, - {0x0f, 0x01, 0x0f, 0x0b, "1C_5C" }, - {0x0f, 0x01, 0x0f, 0x0a, "1C_6C" }, - {0x0f, 0x01, 0x0f, 0x09, "1C_7C" }, - {0x0f, 0x01, 0x0f, 0x00, "Free_Play" }, - - {0 , 0xfe, 0 , 2, "Coinage affects" }, - {0x0f, 0x01, 0x10, 0x10, "Coin A" }, - {0x0f, 0x01, 0x10, 0x00, "Coin B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x03, "3" }, - {0x10, 0x01, 0x03, 0x02, "4" }, - {0x10, 0x01, 0x03, 0x01, "5" }, - {0x10, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x10, 0x01, 0x04, 0x04, "1 Credit" }, - {0x10, 0x01, 0x04, 0x00, "2 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus_Life" }, - {0x10, 0x01, 0x18, 0x08, "20000 80000 100000" }, - {0x10, 0x01, 0x18, 0x00, "30000 90000 120000" }, - {0x10, 0x01, 0x18, 0x18, "20000" }, - {0x10, 0x01, 0x18, 0x10, "30000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x60, 0x60, "Easy" }, - {0x10, 0x01, 0x60, 0x40, "Medium" }, - {0x10, 0x01, 0x60, 0x20, "Hard" }, - {0x10, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Sonson) - -static void sonson_sound_irqtrigger(UINT8 data) -{ - data &= 1; - - if (DrvSoundTrigger == 0 && data == 1) - { - DrvSoundIrqTrigger = 1; - } - - DrvSoundTrigger = data; -} - -void sonson_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3000: - for (INT32 i = 5; i < 32; i++) { - DrvScrollX[i] = data; - } - return; - - case 0x3008: - return; - - case 0x3010: - soundlatch = data; - return; - - case 0x3018: - flipscreen = ~data & 1; - return; - - case 0x3019: - sonson_sound_irqtrigger(data); - return; - } -} - -UINT8 sonson_main_read(UINT16 address) -{ - switch (address) - { - case 0x3002: - case 0x3003: - case 0x3004: - return DrvInps[address - 0x3002]; - - case 0x3005: - case 0x3006: - return DrvDips[address - 0x3005]; - } - - return 0; -} - -void sonson_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - AY8910Write(0, 0, data); - return; - - case 0x2001: - AY8910Write(0, 1, data); - return; - - case 0x4000: - AY8910Write(1, 0, data); - return; - - case 0x4001: - AY8910Write(1, 1, data); - return; - } -} - -UINT8 sonson_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return soundlatch; - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0x10000, 0x00000 }; - INT32 Plane1[3] = { 0x40000, 0x20000, 0x00000 }; - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 XOffs[16] = { 8*16+7, 8*16+6, 8*16+5, 8*16+4, 8*16+3, 8*16+2, 8*16+1, 8*16+0, 7, 6, 5, 4, 3, 2, 1, 0 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xC000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x400, 2, 8, 8, Plane0, XOffs0, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0xc000); - - GfxDecode(0x200, 3, 16, 16, Plane1, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvPaletteInit() -{ - UINT32 *tmp = (UINT32*)BurnMalloc(0x20 * sizeof (UINT32)); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x20; i++) - { - INT32 bit0, bit1, bit2, bit3; - INT32 r, g, b; - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x000] >> 4) & 0x01; - bit1 = (DrvColPROM[i + 0x000] >> 5) & 0x01; - bit2 = (DrvColPROM[i + 0x000] >> 6) & 0x01; - bit3 = (DrvColPROM[i + 0x000] >> 7) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x000] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x000] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x000] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x000] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - tmp[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x200; i++) { - DrvPalette[i] = tmp[(DrvColPROM[0x200 + i] & 0x0f) | ((i >> 4) & 0x10)]; - } - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x010000; - DrvM6809ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000400; - - DrvPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM0 = Next; Next += 0x001000; - DrvM6809RAM1 = Next; Next += 0x001800; - - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000100; - - DrvScrollX = Next; Next += 0x000020; - - RamEnd = Next; - - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 6 * sizeof (INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - for (INT32 i = 0; i < 2; i++) { - M6809Open(i); - M6809Reset(); - M6809Close(); - } - - AY8910Reset(0); - AY8910Reset(1); - - soundlatch = 0; - flipscreen = 0; - - DrvSoundIrqTrigger = 0; - DrvSoundTrigger = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - for (INT32 i = 0; i < 6; i++) { - pAY8910Buffer[i] = pFMBuffer + nBurnSoundLen * i; - } - - if (sonsonj) - { - for (INT32 i = 0; i < 6; i++) { - if (BurnLoadRom(DrvM6809ROM0 + 0x4000 + i * 0x2000, i, 1)) return 1; - } - - if (BurnLoadRom(DrvM6809ROM1 + 0xe000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 8, 1)) return 1; - - for (INT32 i = 0; i < 6; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x2000, i + 9, 1)) return 1; - } - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvColPROM + i * 0x0100, i + 15, 1)) return 1; - } - } else { - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x8000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0xc000, 2, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0xe000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 5, 1)) return 1; - - for (INT32 i = 0; i < 6; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x2000, i + 6, 1)) return 1; - } - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvColPROM + i * 0x0100, i + 12, 1)) return 1; - } - } - - DrvPaletteInit(); - DrvGfxDecode(); - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvM6809RAM0, 0x0000, 0x0fff, MAP_RAM); - M6809MapMemory(DrvVidRAM, 0x1000, 0x13ff, MAP_RAM); - M6809MapMemory(DrvColRAM, 0x1400, 0x17ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x2020, 0x207f, MAP_RAM); // 0x100 min - M6809MapMemory(DrvM6809ROM0 + 0x04000, 0x4000, 0xffff, MAP_ROM); - M6809SetReadHandler(sonson_main_read); - M6809SetWriteHandler(sonson_main_write); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvM6809RAM1, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvM6809ROM1 + 0x0e000, 0xe000, 0xffff, MAP_ROM); - M6809SetReadHandler(sonson_sound_read); - M6809SetWriteHandler(sonson_sound_write); - M6809Close(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - sonsonj = 0; - - return 0; -} - -static void draw_background() -{ - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - if (flipscreen) - { - sx ^= 0xf8; - sy ^= 0xf8; - - sx += DrvScrollX[sy >> 3]; - if (sx > 255) sx -= 256; - } else { - sx -= DrvScrollX[sy >> 3]; - if (sx < -7) sx += 256; - } - - sy -= 8; - sx -= 8; - - INT32 attr = DrvColRAM[offs]; - INT32 code = DrvVidRAM[offs] | ((attr & 0x03) << 8); - INT32 color = attr >> 2; - - if (flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x80 - 4; offs >= 0x20; offs -= 4) - { - INT32 color = DrvSprRAM[offs + 1]; - INT32 code = DrvSprRAM[offs + 2] + ((color & 0x20) << 3); - INT32 flipx = ~color & 0x40; - INT32 flipy = ~color & 0x80; - INT32 sx = DrvSprRAM[offs + 3]; - INT32 sy = DrvSprRAM[offs + 0]; - - color &= 0x1f; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 8; - sx -= 8; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x100, DrvGfxROM1); - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx-256, sy, color, 3, 0, 0x100, DrvGfxROM1); - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy-256, color, 3, 0, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x100, DrvGfxROM1); - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx-256, sy, color, 3, 0, 0x100, DrvGfxROM1); - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy-256, color, 3, 0, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x100, DrvGfxROM1); - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx-256, sy, color, 3, 0, 0x100, DrvGfxROM1); - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy-256, color, 3, 0, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x100, DrvGfxROM1); - Render16x16Tile_Mask_Clip(pTransDraw, code, sx-256, sy, color, 3, 0, 0x100, DrvGfxROM1); - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy-256, color, 3, 0, 0x100, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_background(); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - INT32 nInterleave = 16; - - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInps[0] = DrvInps[1] = DrvInps[2] = 0xff; - - for (INT32 i = 0 ; i < 8; i++) { - DrvInps[0] ^= (DrvJoy1[i] & 1) << i; - DrvInps[1] ^= (DrvJoy2[i] & 1) << i; - DrvInps[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nCyclesSegment = 0; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 2000000 / 60, 2000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - M6809Open(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += M6809Run(nCyclesSegment); - if (i == (nInterleave - 1)) { - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - M6809Close(); - - nCurrentCPU = 1; - M6809Open(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (DrvSoundIrqTrigger) { - M6809SetIRQLine(1, CPU_IRQSTATUS_AUTO); - DrvSoundIrqTrigger = 0; - } - nCyclesDone[nCurrentCPU] += M6809Run(nCyclesSegment); - if (i == 3 || i == 7 || i == 11 || i == 15) { - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - M6809Close(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029695; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(DrvSoundTrigger); - } - - return 0; -} - - -// Son Son - -static struct BurnRomInfo sonsonRomDesc[] = { - { "ss.01e", 0x4000, 0xcd40cc54, 1 | BRF_PRG | BRF_ESS }, // 0 Main m6809 - { "ss.02e", 0x4000, 0xc3476527, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ss.03e", 0x4000, 0x1fd0e729, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ss_6.c11", 0x2000, 0x1135c48a, 2 | BRF_PRG | BRF_ESS }, // 3 Sound m6809 - - { "ss_7.b6", 0x2000, 0x990890b1, 3 | BRF_GRA }, // 4 Characters - { "ss_8.b5", 0x2000, 0x9388ff82, 3 | BRF_GRA }, // 5 - - { "ss_9.m5", 0x2000, 0x8cb1cacf, 4 | BRF_GRA }, // 6 Sprites - { "ss_10.m6", 0x2000, 0xf802815e, 4 | BRF_GRA }, // 7 - { "ss_11.m3", 0x2000, 0x4dbad88a, 4 | BRF_GRA }, // 8 - { "ss_12.m4", 0x2000, 0xaa05e687, 4 | BRF_GRA }, // 9 - { "ss_13.m1", 0x2000, 0x66119bfa, 4 | BRF_GRA }, // 10 - { "ss_14.m2", 0x2000, 0xe14ef54e, 4 | BRF_GRA }, // 11 - - { "ssb4.b2", 0x0020, 0xc8eaf234, 5 | BRF_GRA }, // 12 Color Proms - { "ssb5.b1", 0x0020, 0x0e434add, 5 | BRF_GRA }, // 13 - { "ssb2.c4", 0x0100, 0xc53321c6, 5 | BRF_GRA }, // 14 - { "ssb3.h7", 0x0100, 0x7d2c324a, 5 | BRF_GRA }, // 15 - - { "ssb1.k11", 0x0100, 0xa04b0cfe, 0 | BRF_OPT }, // 16 Timing Prom -}; - -STD_ROM_PICK(sonson) -STD_ROM_FN(sonson) - -struct BurnDriver BurnDrvSonson = { - "sonson", NULL, NULL, NULL, "1984", - "Son Son\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, sonsonRomInfo, sonsonRomName, NULL, NULL, SonsonInputInfo, SonsonDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 240, 240, 4, 3 -}; - - -// Son Son (Japan) - -static struct BurnRomInfo sonsonjRomDesc[] = { - { "ss_0.l9", 0x2000, 0x705c168f, 1 | BRF_PRG | BRF_ESS }, // 0 Main m6809 - { "ss_1.j9", 0x2000, 0x0f03b57d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ss_2.l8", 0x2000, 0xa243a15d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ss_3.j8", 0x2000, 0xcb64681a, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ss_4.l7", 0x2000, 0x4c3e9441, 1 | BRF_PRG | BRF_ESS }, // 4 - { "ss_5.j7", 0x2000, 0x847f660c, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "ss_6.c11", 0x2000, 0x1135c48a, 2 | BRF_PRG | BRF_ESS }, // 6 Sound m6809 - - { "ss_7.b6", 0x2000, 0x990890b1, 3 | BRF_GRA }, // 7 Characters - { "ss_8.b5", 0x2000, 0x9388ff82, 3 | BRF_GRA }, // 8 - - { "ss_9.m5", 0x2000, 0x8cb1cacf, 4 | BRF_GRA }, // 9 Sprites - { "ss_10.m6", 0x2000, 0xf802815e, 4 | BRF_GRA }, // 10 - { "ss_11.m3", 0x2000, 0x4dbad88a, 4 | BRF_GRA }, // 11 - { "ss_12.m4", 0x2000, 0xaa05e687, 4 | BRF_GRA }, // 12 - { "ss_13.m1", 0x2000, 0x66119bfa, 4 | BRF_GRA }, // 13 - { "ss_14.m2", 0x2000, 0xe14ef54e, 4 | BRF_GRA }, // 14 - - { "ssb4.b2", 0x0020, 0xc8eaf234, 5 | BRF_GRA }, // 15 Color Proms - { "ssb5.b1", 0x0020, 0x0e434add, 5 | BRF_GRA }, // 16 - { "ssb2.c4", 0x0100, 0xc53321c6, 5 | BRF_GRA }, // 17 - { "ssb3.h7", 0x0100, 0x7d2c324a, 5 | BRF_GRA }, // 18 - - { "ssb1.k11", 0x0100, 0xa04b0cfe, 0 | BRF_OPT }, // 19 Timing Prom -}; - -STD_ROM_PICK(sonsonj) -STD_ROM_FN(sonsonj) - -static INT32 SonsonjInit() -{ - sonsonj = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvSonsonj = { - "sonsonj", "sonson", NULL, NULL, "1984", - "Son Son (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_PLATFORM, 0, - NULL, sonsonjRomInfo, sonsonjRomName, NULL, NULL, SonsonInputInfo, SonsonDIPInfo, - SonsonjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 240, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_srumbler.cpp b/jan/src/burn/drv/pre90s/d_srumbler.cpp deleted file mode 100644 index 11dca38bd..000000000 --- a/jan/src/burn/drv/pre90s/d_srumbler.cpp +++ /dev/null @@ -1,924 +0,0 @@ -// FB Alpha The Speed Rumbler driver module -// Based on MAME driver by Paul Leaman -// Note: main cpu oc'd otherwise there is terrible slowdown, I wonder if our -// m6809 is cycle accurate or not? (I tried several different timing/irq methods) -dink - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvPROM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; -static UINT8 DrvPalRAMWrite; - -static UINT8 *DrvBank; -static UINT8 *DrvScroll; -static UINT8 *flipscreen; -static UINT8 *soundlatch; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo SrumblerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Srumbler) - -static struct BurnDIPInfo SrumblerDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x73, NULL }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x08, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - {0x12, 0x01, 0x03, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x04, 0x00, "Upright" }, - {0x12, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x18, 0x18, "20k 70k and every 70k"}, - {0x12, 0x01, 0x18, 0x10, "30k 80k and every 80k"}, - {0x12, 0x01, 0x18, 0x08, "20k 80k" }, - {0x12, 0x01, 0x18, 0x00, "30k 80k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x60, 0x40, "Easy" }, - {0x12, 0x01, 0x60, 0x60, "Normal" }, - {0x12, 0x01, 0x60, 0x20, "Difficult" }, - {0x12, 0x01, 0x60, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x80, 0x00, "No" }, - {0x12, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Srumbler) - -static void bankswitch(INT32 data) -{ - DrvBank[0] = data; - - for (INT32 i = 0x05; i < 0x10; i++) - { - INT32 bank = DrvPROM[(data & 0xf0) | i] | DrvPROM[0x100 | ((data & 0x0f) << 4) | i]; - - M6809MapMemory(DrvM6809ROM + bank * 0x1000, 0x1000 * i, 0x1000 * i + 0x0fff, MAP_ROM); - } -} - -void srumbler_main_write(UINT16 address, UINT8 data) -{ - if (address >= 0x7000 && address <= 0x73ff) { - DrvPalRAM[address - 0x7000] = data; - //bprintf(0, _T("%X,"), address); - DrvPalRAMWrite = 1; - DrvRecalc = 1; - } - switch (address) - { - case 0x4008: - bankswitch(data); - return; - - case 0x4009: - *flipscreen = data & 1; - return; - - case 0x400a: - case 0x400b: - case 0x400c: - case 0x400d: - DrvScroll[address - 0x400a] = data; - return; - - case 0x400e: - *soundlatch = data; - return; - } -} - -UINT8 srumbler_main_read(UINT16 address) -{ - switch (address) - { - case 0x4008: - return DrvInputs[0]; - - case 0x4009: - return DrvInputs[1]; - - case 0x400a: - return DrvInputs[2]; - - case 0x400b: - return DrvDips[0]; - - case 0x400c: - return DrvDips[1]; - } - - return 0; -} - -void __fastcall srumbler_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8000: - case 0x8001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xa000: - case 0xa001: - BurnYM2203Write(1, address & 1, data); - return; - } -} - -UINT8 __fastcall srumbler_sound_read(UINT16 address) -{ - if (address == 0xe000) { - return *soundlatch; - } - - return 0; -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 3000000); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3000000; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x200; i++) { - UINT8 r = ((i & 1) ? 0xff : 0); - UINT8 g = ((i & 2) ? 0xff : 0); - UINT8 b = ((i & 4) ? 0xff : 0); - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - DrvPalRAMWrite = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - bankswitch(0); - M6809Reset(); - M6809Close(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - DrvPaletteInit(); - - BurnYM2203Reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x080000; - - DrvPROM = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - - AllRam = Next; - - DrvM6809RAM = Next; Next += 0x001e00; - DrvSprRAM = Next; Next += 0x000200; - DrvSprBuf = Next; Next += 0x000200; - - DrvBgRAM = Next; Next += 0x002000; - DrvFgRAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x000400; - - DrvZ80RAM = Next; Next += 0x000800; - - DrvBank = Next; Next += 0x000001; - DrvScroll = Next; Next += 0x000004; - - flipscreen = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[2] = { 0x000004, 0x000000 }; - INT32 Plane1[4] = { 0x100004, 0x100000, 0x000004, 0x000000 }; - INT32 Plane2[4] = { 0x180000, 0x100000, 0x080000, 0x000000 }; - INT32 XOffs0[16] = { 0x000, 0x001, 0x002, 0x003, 0x008, 0x009, 0x00a, 0x00b, - 0x100, 0x101, 0x102, 0x103, 0x108, 0x109, 0x10a, 0x10b }; - INT32 XOffs1[16] = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, - 0x080, 0x081, 0x082, 0x083, 0x084, 0x085, 0x086, 0x087 }; - INT32 YOffs0[16] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, - 0x080, 0x090, 0x0a0, 0x0b0, 0x0c0, 0x0d0, 0x0e0, 0x0f0 }; - INT32 YOffs1[16] = { 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038, - 0x040, 0x048, 0x050, 0x058, 0x060, 0x068, 0x070, 0x078 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x400, 2, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x800, 4, 16, 16, Plane1, XOffs0, YOffs0, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x800, 4, 16, 16, Plane2, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x08000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x10000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x18000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x20000, 4, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x28000, 5, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x30000, 6, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x38000, 7, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x28000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x38000, 17, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x28000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x38000, 25, 1)) return 1; - - if (BurnLoadRom(DrvPROM + 0x00000, 26, 1)) return 1; - if (BurnLoadRom(DrvPROM + 0x00100, 27, 1)) return 1; - - for (INT32 i = 0; i < 0x100; i++) { - DrvPROM[i + 0x000] = (DrvPROM[i] & 0x03) << 4; - DrvPROM[i + 0x100] &= 0x0f; - } - - DrvGfxDecode(); - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvM6809RAM, 0x0000, 0x1dff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x1e00, 0x1fff, MAP_RAM); - M6809MapMemory(DrvBgRAM, 0x2000, 0x3fff, MAP_RAM); - M6809MapMemory(DrvFgRAM, 0x5000, 0x5fff, MAP_WRITE); - //M6809MapMemory(DrvPalRAM, 0x7000, 0x73ff, MAP_WRITE); - M6809SetReadHandler(srumbler_main_read); - M6809SetWriteHandler(srumbler_main_write); - M6809Close(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(srumbler_sound_write); - ZetSetReadHandler(srumbler_sound_read); - ZetClose(); - - BurnYM2203Init(2, 4000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.30, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.30, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.10, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.10, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - ZetExit(); - - BurnYM2203Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_background_layer(INT32 type) -{ - INT32 scrollx = ((DrvScroll[1] << 8) | DrvScroll[0]) & 0x3ff; - INT32 scrolly = ((DrvScroll[3] << 8) | DrvScroll[2]) & 0x3ff; - - INT32 masks[4] = { 0xffff, 0x0000, 0x07ff, 0xf800 }; // 0, 1 - INT32 mask = masks[type]; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sy = (offs & 0x3f) << 4; - INT32 sx = (offs >> 6) << 4; - - sy -= scrolly + 8; - if (sy < -15) sy += 1024; - sx -= scrollx + 80; - if (sx < -15) sx += 1024; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 attr = DrvBgRAM[offs * 2 + 0]; - INT32 code = DrvBgRAM[offs * 2 + 1] | ((attr & 0x07) << 8); - INT32 color = attr >> 5; - INT32 flipy = attr & 0x08; - - INT32 group = (attr & 0x10) >> 4; - if ((type >> 1) != group) continue; - - { - color = (color << 4) + 0x80; - if (flipy) flipy = 0xf0; - UINT8 *src = DrvGfxROM1 + (code << 8); - UINT16 *dst; - - if (*flipscreen) { - flipy ^= 0xff; - sx = 336 - sx; - sy = 224 - sy; - } - - for (INT32 y = 0; y < 16; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - dst = pTransDraw + sy * nScreenWidth; - - for (INT32 x = 0; x < 16; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = src[((y << 4) | x) ^ flipy]; - - if (mask & (1 << pxl)) continue; - - dst[sx] = pxl | color; - } - - sx -= 16; - } - } - } -} - -static void draw_foreground_layer(INT32 priority) -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sy = (offs & 0x1f) << 3; - INT32 sx = (offs >> 5) << 3; - - sx -= 80; - sy -= 8; - - if (sx < -15 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvFgRAM[offs * 2 + 0]; - - INT32 code = DrvFgRAM[offs * 2 + 1] | ((attr & 0x03) << 8); - INT32 color = (attr & 0x3c) >> 2; - INT32 prio = (attr & 0x40) >> 6; - - if (prio != priority) continue; - - if (*flipscreen) { - sx = 344 - sx; - sy = 232 - sy; - - if (priority) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0x1c0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx - 80, sy, color, 2, 3, 0x1c0, DrvGfxROM0); - } - } else { - if (priority) { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, 0x1c0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 3, 0x1c0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x200-4; offs >= 0; offs -= 4) - { - INT32 attr = DrvSprBuf[offs + 1]; - INT32 code = DrvSprBuf[offs + 0] | ((attr & 0xe0) << 3); - INT32 sy = DrvSprBuf[offs + 2]; - INT32 sx = DrvSprBuf[offs + 3] | ((attr & 0x01) << 8); - INT32 color = (attr & 0x1c) >> 2; - INT32 flipy = (attr & 0x02); - INT32 flipx = 0; - - if (*flipscreen) - { - sx = 496 - sx; - sy = 240 - sy; - flipy ^= 2; - flipx = 1; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx - 80, sy - 8, color, 4, 15, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx - 80, sy - 8, color, 4, 15, 0x100, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx - 80, sy - 8, color, 4, 15, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx - 80, sy - 8, color, 4, 15, 0x100, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - if (DrvPalRAMWrite) { - UINT8 r,g,b; - for (INT32 i = 0; i < 0x400; i+=2) { - INT32 d = DrvPalRAM[i + 1] | (DrvPalRAM[i + 0] << 8); - - r = (d >> 12); - g = (d >> 8) & 0x0f; - b = (d >> 4) & 0x0f; - - DrvPalette[i >> 1] = BurnHighCol((r << 4) | r, (g << 4) | g, (b << 4) | b, 0); - } - } else { - DrvPaletteInit(); - } - DrvRecalc = 0; - } - - if (nSpriteEnable & 1) draw_background_layer(1); // opaque - else BurnTransferClear(); - - if (nBurnLayer & 2) draw_background_layer(3); - - draw_sprites(); - - if (nSpriteEnable & 2) draw_background_layer(0); - if (nSpriteEnable & 4) draw_background_layer(2); - if (nBurnLayer & 8) draw_foreground_layer(0); - if (nBurnLayer & 4) draw_foreground_layer(1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 262; - INT32 nCyclesTotal[2] = { 3000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - M6809Open(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave / 2) - 1) { - M6809SetIRQLine(1, CPU_IRQSTATUS_AUTO); - memcpy (DrvSprBuf, DrvSprRAM, 0x200); - } - if (i == (nInterleave / 1) - 1) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - - if (i % (nInterleave/4) == (nInterleave/4) - 1) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - - ZetClose(); - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029706; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - M6809Scan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - } - - { - M6809Open(0); - bankswitch(DrvBank[0]); - M6809Close(); - } - - return 0; -} - - -// The Speed Rumbler (set 1) - -static struct BurnRomInfo srumblerRomDesc[] = { - { "rc04.14e", 0x8000, 0xa68ce89c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "rc03.13e", 0x8000, 0x87bda812, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rc02.12e", 0x8000, 0xd8609cca, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rc01.11e", 0x8000, 0x27ec4776, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rc09.14f", 0x8000, 0x2146101d, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rc08.13f", 0x8000, 0x838369a6, 1 | BRF_PRG | BRF_ESS }, // 5 - { "rc07.12f", 0x8000, 0xde785076, 1 | BRF_PRG | BRF_ESS }, // 6 - { "rc06.11f", 0x8000, 0xa70f4fd4, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "rc05.2f", 0x8000, 0x0177cebe, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "rc10.6g", 0x4000, 0xadabe271, 3 | BRF_GRA }, // 9 Characters - - { "rc11.11a", 0x8000, 0x5fa042ba, 4 | BRF_GRA }, // 10 Tiles - { "rc12.13a", 0x8000, 0xa2db64af, 4 | BRF_GRA }, // 11 - { "rc13.14a", 0x8000, 0xf1df5499, 4 | BRF_GRA }, // 12 - { "rc14.15a", 0x8000, 0xb22b31b3, 4 | BRF_GRA }, // 13 - { "rc15.11c", 0x8000, 0xca3a3af3, 4 | BRF_GRA }, // 14 - { "rc16.13c", 0x8000, 0xc49a4a11, 4 | BRF_GRA }, // 15 - { "rc17.14c", 0x8000, 0xaa80aaab, 4 | BRF_GRA }, // 16 - { "rc18.15c", 0x8000, 0xce67868e, 4 | BRF_GRA }, // 17 - - { "rc20.15e", 0x8000, 0x3924c861, 5 | BRF_GRA }, // 18 Sprites - { "rc19.14e", 0x8000, 0xff8f9129, 5 | BRF_GRA }, // 19 - { "rc22.15f", 0x8000, 0xab64161c, 5 | BRF_GRA }, // 20 - { "rc21.14f", 0x8000, 0xfd64bcd1, 5 | BRF_GRA }, // 21 - { "rc24.15h", 0x8000, 0xc972af3e, 5 | BRF_GRA }, // 22 - { "rc23.14h", 0x8000, 0x8c9abf57, 5 | BRF_GRA }, // 23 - { "rc26.15j", 0x8000, 0xd4f1732f, 5 | BRF_GRA }, // 24 - { "rc25.14j", 0x8000, 0xd2a4ea4f, 5 | BRF_GRA }, // 25 - - { "63s141.12a", 0x0100, 0x8421786f, 6 | BRF_PRG | BRF_ESS }, // 26 Rom Bank Proms - { "63s141.13a", 0x0100, 0x6048583f, 6 | BRF_PRG | BRF_ESS }, // 27 - - { "63s141.8j", 0x0100, 0x1a89a7ff, 0 | BRF_OPT }, // 28 Priority Prom -}; - -STD_ROM_PICK(srumbler) -STD_ROM_FN(srumbler) - -struct BurnDriver BurnDrvSrumbler = { - "srumbler", NULL, NULL, NULL, "1986", - "The Speed Rumbler (set 1)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SHOOT, 0, - NULL, srumblerRomInfo, srumblerRomName, NULL, NULL, SrumblerInputInfo, SrumblerDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x200, 240, 352, 3, 4 -}; - - -// The Speed Rumbler (set 2) - -static struct BurnRomInfo srumblr2RomDesc[] = { - { "rc04.14e", 0x8000, 0xa68ce89c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "rc03.13e", 0x8000, 0xe82f78d4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rc02.12e", 0x8000, 0x009a62d8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rc01.11e", 0x8000, 0x2ac48d1d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rc09.14f", 0x8000, 0x64f23e72, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rc08.13f", 0x8000, 0x74c71007, 1 | BRF_PRG | BRF_ESS }, // 5 - { "rc07.12f", 0x8000, 0xde785076, 1 | BRF_PRG | BRF_ESS }, // 6 - { "rc06.11f", 0x8000, 0xa70f4fd4, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "rc05.2f", 0x8000, 0xea04fa07, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "rc10.6g", 0x4000, 0xadabe271, 3 | BRF_GRA }, // 9 Characters - - { "rc11.11a", 0x8000, 0x5fa042ba, 4 | BRF_GRA }, // 10 Tiles - { "rc12.13a", 0x8000, 0xa2db64af, 4 | BRF_GRA }, // 11 - { "rc13.14a", 0x8000, 0xf1df5499, 4 | BRF_GRA }, // 12 - { "rc14.15a", 0x8000, 0xb22b31b3, 4 | BRF_GRA }, // 13 - { "rc15.11c", 0x8000, 0xca3a3af3, 4 | BRF_GRA }, // 14 - { "rc16.13c", 0x8000, 0xc49a4a11, 4 | BRF_GRA }, // 15 - { "rc17.14c", 0x8000, 0xaa80aaab, 4 | BRF_GRA }, // 16 - { "rc18.15c", 0x8000, 0xce67868e, 4 | BRF_GRA }, // 17 - - { "rc20.15e", 0x8000, 0x3924c861, 5 | BRF_GRA }, // 18 Sprites - { "rc19.14e", 0x8000, 0xff8f9129, 5 | BRF_GRA }, // 19 - { "rc22.15f", 0x8000, 0xab64161c, 5 | BRF_GRA }, // 20 - { "rc21.14f", 0x8000, 0xfd64bcd1, 5 | BRF_GRA }, // 21 - { "rc24.15h", 0x8000, 0xc972af3e, 5 | BRF_GRA }, // 22 - { "rc23.14h", 0x8000, 0x8c9abf57, 5 | BRF_GRA }, // 23 - { "rc26.15j", 0x8000, 0xd4f1732f, 5 | BRF_GRA }, // 24 - { "rc25.14j", 0x8000, 0xd2a4ea4f, 5 | BRF_GRA }, // 25 - - { "63s141.12a", 0x0100, 0x8421786f, 6 | BRF_PRG | BRF_ESS }, // 26 Rom Bank Proms - { "63s141.13a", 0x0100, 0x6048583f, 6 | BRF_PRG | BRF_ESS }, // 27 - - { "63s141.8j", 0x0100, 0x1a89a7ff, 0 | BRF_OPT }, // 28 Priority Prom -}; - -STD_ROM_PICK(srumblr2) -STD_ROM_FN(srumblr2) - -struct BurnDriver BurnDrvSrumblr2 = { - "srumbler2", "srumbler", NULL, NULL, "1986", - "The Speed Rumbler (set 2)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SHOOT, 0, - NULL, srumblr2RomInfo, srumblr2RomName, NULL, NULL, SrumblerInputInfo, SrumblerDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x200, 240, 352, 3, 4 -}; - - -// The Speed Rumbler (set 3) - -static struct BurnRomInfo srumblr3RomDesc[] = { - { "rc04.14e", 0x8000, 0xa68ce89c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "rc03.13e", 0x8000, 0x0a21992b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rc02.12e", 0x8000, 0x009a62d8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rc01.11e", 0x8000, 0x2ac48d1d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rc09.14f", 0x8000, 0x64f23e72, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rc08.13f", 0x8000, 0xe361b55c, 1 | BRF_PRG | BRF_ESS }, // 5 - { "rc07.12f", 0x8000, 0xde785076, 1 | BRF_PRG | BRF_ESS }, // 6 - { "rc06.11f", 0x8000, 0xa70f4fd4, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "rc05.2f", 0x8000, 0xea04fa07, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "rc10.6g", 0x4000, 0xadabe271, 3 | BRF_GRA }, // 9 Characters - - { "rc11.11a", 0x8000, 0x5fa042ba, 4 | BRF_GRA }, // 10 Tiles - { "rc12.13a", 0x8000, 0xa2db64af, 4 | BRF_GRA }, // 11 - { "rc13.14a", 0x8000, 0xf1df5499, 4 | BRF_GRA }, // 12 - { "rc14.15a", 0x8000, 0xb22b31b3, 4 | BRF_GRA }, // 13 - { "rc15.11c", 0x8000, 0xca3a3af3, 4 | BRF_GRA }, // 14 - { "rc16.13c", 0x8000, 0xc49a4a11, 4 | BRF_GRA }, // 15 - { "rc17.14c", 0x8000, 0xaa80aaab, 4 | BRF_GRA }, // 16 - { "rc18.15c", 0x8000, 0xce67868e, 4 | BRF_GRA }, // 17 - - { "rc20.15e", 0x8000, 0x3924c861, 5 | BRF_GRA }, // 18 Sprites - { "rc19.14e", 0x8000, 0xff8f9129, 5 | BRF_GRA }, // 19 - { "rc22.15f", 0x8000, 0xab64161c, 5 | BRF_GRA }, // 20 - { "rc21.14f", 0x8000, 0xfd64bcd1, 5 | BRF_GRA }, // 21 - { "rc24.15h", 0x8000, 0xc972af3e, 5 | BRF_GRA }, // 22 - { "rc23.14h", 0x8000, 0x8c9abf57, 5 | BRF_GRA }, // 23 - { "rc26.15j", 0x8000, 0xd4f1732f, 5 | BRF_GRA }, // 24 - { "rc25.14j", 0x8000, 0xd2a4ea4f, 5 | BRF_GRA }, // 25 - - { "63s141.12a", 0x0100, 0x8421786f, 6 | BRF_PRG | BRF_ESS }, // 26 Rom Bank Proms - { "63s141.13a", 0x0100, 0x6048583f, 6 | BRF_PRG | BRF_ESS }, // 27 - - { "63s141.8j", 0x0100, 0x1a89a7ff, 0 | BRF_OPT }, // 28 Priority Prom -}; - -STD_ROM_PICK(srumblr3) -STD_ROM_FN(srumblr3) - -struct BurnDriver BurnDrvSrumblr3 = { - "srumbler3", "srumbler", NULL, NULL, "1986", - "The Speed Rumbler (set 3)\0", NULL, "Capcom (Tecfri license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SHOOT, 0, - NULL, srumblr3RomInfo, srumblr3RomName, NULL, NULL, SrumblerInputInfo, SrumblerDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x200, 240, 352, 3, 4 -}; - - -// Rush & Crash (Japan) - -static struct BurnRomInfo rushcrshRomDesc[] = { - { "rc04.14e", 0x8000, 0xa68ce89c, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "rc03.13e", 0x8000, 0xa49c9be0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rc02.12e", 0x8000, 0x009a62d8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rc01.11e", 0x8000, 0x2ac48d1d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rc09.14f", 0x8000, 0x64f23e72, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rc08.13f", 0x8000, 0x2c25874b, 1 | BRF_PRG | BRF_ESS }, // 5 - { "rc07.12f", 0x8000, 0xde785076, 1 | BRF_PRG | BRF_ESS }, // 6 - { "rc06.11f", 0x8000, 0xa70f4fd4, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "rc05.2f", 0x8000, 0xea04fa07, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "rc10.6g", 0x4000, 0x0a3c0b0d, 3 | BRF_GRA }, // 9 Characters - - { "rc11.11a", 0x8000, 0x5fa042ba, 4 | BRF_GRA }, // 10 Tiles - { "rc12.13a", 0x8000, 0xa2db64af, 4 | BRF_GRA }, // 11 - { "rc13.14a", 0x8000, 0xf1df5499, 4 | BRF_GRA }, // 12 - { "rc14.15a", 0x8000, 0xb22b31b3, 4 | BRF_GRA }, // 13 - { "rc15.11c", 0x8000, 0xca3a3af3, 4 | BRF_GRA }, // 14 - { "rc16.13c", 0x8000, 0xc49a4a11, 4 | BRF_GRA }, // 15 - { "rc17.14c", 0x8000, 0xaa80aaab, 4 | BRF_GRA }, // 16 - { "rc18.15c", 0x8000, 0xce67868e, 4 | BRF_GRA }, // 17 - - { "rc20.15e", 0x8000, 0x3924c861, 5 | BRF_GRA }, // 18 Sprites - { "rc19.14e", 0x8000, 0xff8f9129, 5 | BRF_GRA }, // 19 - { "rc22.15f", 0x8000, 0xab64161c, 5 | BRF_GRA }, // 20 - { "rc21.14f", 0x8000, 0xfd64bcd1, 5 | BRF_GRA }, // 21 - { "rc24.15h", 0x8000, 0xc972af3e, 5 | BRF_GRA }, // 22 - { "rc23.14h", 0x8000, 0x8c9abf57, 5 | BRF_GRA }, // 23 - { "rc26.15j", 0x8000, 0xd4f1732f, 5 | BRF_GRA }, // 24 - { "rc25.14j", 0x8000, 0xd2a4ea4f, 5 | BRF_GRA }, // 25 - - { "63s141.12a", 0x0100, 0x8421786f, 6 | BRF_PRG | BRF_ESS }, // 26 Rom Bank Proms - { "63s141.13a", 0x0100, 0x6048583f, 6 | BRF_PRG | BRF_ESS }, // 27 - - { "63s141.8j", 0x0100, 0x1a89a7ff, 0 | BRF_OPT }, // 28 Priority Prom -}; - -STD_ROM_PICK(rushcrsh) -STD_ROM_FN(rushcrsh) - -struct BurnDriver BurnDrvRushcrsh = { - "rushcrsh", "srumbler", NULL, NULL, "1986", - "Rush & Crash (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SHOOT, 0, - NULL, rushcrshRomInfo, rushcrshRomName, NULL, NULL, SrumblerInputInfo, SrumblerDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x200, 240, 352, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_ssozumo.cpp b/jan/src/burn/drv/pre90s/d_ssozumo.cpp deleted file mode 100644 index b615a2510..000000000 --- a/jan/src/burn/drv/pre90s/d_ssozumo.cpp +++ /dev/null @@ -1,743 +0,0 @@ -// FB Alpha Syusse Oozumou driver module -// Based on MAME driver by Takahiro Nogi (nogi@kt.rim.or.jp) - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6502_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv6502ROM0; -static UINT8 *Drv6502ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvColRAM0; -static UINT8 *DrvColRAM1; -static UINT8 *Drv6502RAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static INT32 palette_written; -static UINT8 nmi_mask; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 bgscrolly; - -static INT32 vblank; -static INT32 previous_coin = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo SsozumoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ssozumo) - -static struct BurnDIPInfo SsozumoDIPList[]= -{ - {0x11, 0xff, 0xff, 0x1f, NULL }, - {0x12, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x20, 0x00, "Upright" }, - {0x11, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x11, 0x01, 0x40, 0x00, "Single" }, - {0x11, 0x01, 0x40, 0x40, "Dual" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x12, 0x01, 0x01, 0x01, "Normal" }, - {0x12, 0x01, 0x01, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, -}; - -STDDIPINFO(Ssozumo) - -static void ssozumo_main_write(UINT16 address, UINT8 data) -{ - if (address >= 0x4050 && address <= 0x407f) { - if (DrvPalRAM[address - 0x4050] != data) { - palette_written = 1; - } - DrvPalRAM[address - 0x4050] = data; - return; - } - - switch (address) - { - case 0x4000: - flipscreen = data >> 7; - return; - - case 0x4010: { - soundlatch = data; - M6502Close(); - M6502Open(1); - M6502SetIRQLine(0, CPU_IRQSTATUS_HOLD); - M6502Close(); - M6502Open(0); - } - return; - - case 0x4020: - bgscrolly = data; - return; - - case 0x4030: - return; // nop - } -} - -static UINT8 ssozumo_main_read(UINT16 address) -{ - if (address >= 0x4050 && address <= 0x407f) { - return DrvPalRAM[address - 0x4050]; - } - - switch (address) - { - case 0x4000: - return DrvInputs[0]; - - case 0x4010: - return DrvInputs[1]; - - case 0x4020: - return DrvDips[1]; - - case 0x4030: - return (DrvDips[0] & 0x7f) | (vblank ? 0x80 : 0); - } - - return 0; -} - -static void ssozumo_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - case 0x2001: - case 0x2002: - case 0x2003: - AY8910Write((address >> 1) & 1, (~address & 1), data); - return; - - case 0x2004: - DACSignedWrite(0, data); - return; - - case 0x2005: - nmi_mask = data & 1; - return; - } -} - -static UINT8 ssozumo_sound_read(UINT16 address) -{ - switch (address) - { - case 0x2007: - return soundlatch; - } - - return 0; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (M6502TotalCycles() / (975000.000 / (nBurnFPS / 100.000)))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6502Open(0); - M6502Reset(); - M6502Close(); - - M6502Open(1); - M6502Reset(); - DACReset(); - M6502Close(); - - AY8910Reset(0); - AY8910Reset(1); - - palette_written = 1; - nmi_mask = 0; - soundlatch = 0; - flipscreen = 0; - bgscrolly = 0; - previous_coin = 0xc0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv6502ROM0 = Next; Next += 0x010000; - Drv6502ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x110000; - DrvGfxROM1 = Next; Next += 0x110000; - DrvGfxROM2 = Next; Next += 0x150000; - - DrvColPROM = Next; Next += 0x000080; - - DrvPalette = (UINT32*)Next; Next += 0x0050 * sizeof(UINT32); - - AllRam = Next; - - DrvPalRAM = Next; Next += 0x000030; - DrvSprRAM = Next; Next += 0x000800; - DrvVidRAM0 = Next; Next += 0x000200; - DrvVidRAM1 = Next; Next += 0x000400; - DrvColRAM0 = Next; Next += 0x000600; - DrvColRAM1 = Next; Next += 0x000400; - - Drv6502RAM1 = Next; Next += 0x000200; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { 0x20000, 0x10000, 0x00000 }; - INT32 Plane1[3] = { 0xa0000, 0x50000, 0x00000 }; - INT32 XOffsc[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };//STEP8(16,1), STEP8(0,1) }; - INT32 YOffsc[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 };//STEP8(0,8), STEP8(64,8) }; - - INT32 XOffst[16] = { 16*8 + 0, 16*8 + 1, 16*8 + 2, 16*8 + 3, 16*8 + 4, 16*8 + 5, 16*8 + 6, 16*8 + 7, - 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffst[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }; - - INT32 XOffss[16] = { 16*8 + 0, 16*8 + 1, 16*8 + 2, 16*8 + 3, 16*8 + 4, 16*8 + 5, 16*8 + 6, 16*8 + 7, - 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffss[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x1e000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x06000); - - GfxDecode(0x0400, 3, 8, 8, Plane0, XOffsc, YOffsc, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x06000); - - GfxDecode(0x0100, 3, 16, 16, Plane0, XOffst, YOffst, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x1e000); - - GfxDecode(0x0500, 3, 16, 16, Plane1, XOffss, YOffss, 0x100, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv6502ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(Drv6502ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(Drv6502ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(Drv6502ROM0 + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(Drv6502ROM0 + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(Drv6502ROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(Drv6502ROM1 + 0x02000, 6, 1)) return 1; - if (BurnLoadRom(Drv6502ROM1 + 0x04000, 7, 1)) return 1; - if (BurnLoadRom(Drv6502ROM1 + 0x06000, 8, 1)) return 1; - if (BurnLoadRom(Drv6502ROM1 + 0x08000, 9, 1)) return 1; - if (BurnLoadRom(Drv6502ROM1 + 0x0a000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 16, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x06000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0a000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0e000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 25, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x12000, 26, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x14000, 27, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x16000, 28, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 29, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x1a000, 30, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x1c000, 31, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 32, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00020, 33, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00040, 34, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00060, 35, 1)) return 1; - - DrvGfxDecode(); - } - - M6502Init(0, TYPE_M6502); - M6502Open(0); - M6502MapMemory(DrvSprRAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvVidRAM1, 0x2000, 0x23ff, MAP_RAM); - M6502MapMemory(DrvColRAM1, 0x2400, 0x27ff, MAP_RAM); - M6502MapMemory(DrvVidRAM0, 0x3000, 0x31ff, MAP_RAM); - M6502MapMemory(DrvColRAM0, 0x3200, 0x37ff, MAP_RAM); - M6502MapMemory(Drv6502ROM0, 0x6000, 0xffff, MAP_ROM); - M6502SetWriteHandler(ssozumo_main_write); - M6502SetReadHandler(ssozumo_main_read); - M6502Close(); - - M6502Init(1, TYPE_M6502); - M6502Open(1); - M6502MapMemory(Drv6502RAM1, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(Drv6502ROM1, 0x4000, 0xffff, MAP_ROM); - M6502SetWriteHandler(ssozumo_sound_write); - M6502SetReadHandler(ssozumo_sound_read); - - M6502Close(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6502Exit(); - - AY8910Exit(0); - AY8910Exit(1); - DACExit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0 ; i < 0x40 ; i++) - { - INT32 bit0, bit1, bit2, bit3; - - bit0 = (DrvColPROM[i+0x00] >> 0) & 0x01; - bit1 = (DrvColPROM[i+0x00] >> 1) & 0x01; - bit2 = (DrvColPROM[i+0x00] >> 2) & 0x01; - bit3 = (DrvColPROM[i+0x00] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i+0x00] >> 4) & 0x01; - bit1 = (DrvColPROM[i+0x00] >> 5) & 0x01; - bit2 = (DrvColPROM[i+0x00] >> 6) & 0x01; - bit3 = (DrvColPROM[i+0x00] >> 7) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i+0x40] >> 0) & 0x01; - bit1 = (DrvColPROM[i+0x40] >> 1) & 0x01; - bit2 = (DrvColPROM[i+0x40] >> 2) & 0x01; - bit3 = (DrvColPROM[i+0x40] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 0x10; i++) - { - INT32 bit0, bit1, bit2, bit3, val; - - val = DrvPalRAM[i]; - bit0 = (val >> 0) & 0x01; - bit1 = (val >> 1) & 0x01; - bit2 = (val >> 2) & 0x01; - bit3 = (val >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - val = DrvPalRAM[i + 0x10]; - bit0 = (val >> 0) & 0x01; - bit1 = (val >> 1) & 0x01; - bit2 = (val >> 2) & 0x01; - bit3 = (val >> 3) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - val = DrvPalRAM[i + 0x20]; - bit0 = (val >> 0) & 0x01; - bit1 = (val >> 1) & 0x01; - bit2 = (val >> 2) & 0x01; - bit3 = (val >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[0x40 + i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 16 * 32; offs++) - { - INT32 sx = (0xf - (offs / 0x20)) * 16; - INT32 sy = (offs & 0x1f) * 16; - - sy -= bgscrolly; - sy -= 8; //offset - - if (sy < -15) sy += 512; - - INT32 attr = DrvColRAM0[offs]; - INT32 code = DrvVidRAM0[offs] + ((attr & 0x08) << 5); - INT32 color = (attr & 0x30) >> 4; - INT32 flipy = (offs % 32) >= 16; - code &= 0x4ff; - - if (flipy) - { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0x20, DrvGfxROM1); - } - else - { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0x20, DrvGfxROM1); - } - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = 239-((offs / 0x20) * 8); - INT32 sy = (offs & 0x1f) * 8; - - sx += 9; //offsets (8 + 1 to give the screen a 3d-effect) - sy -= 8; - - INT32 color = (DrvColRAM1[offs] & 0x30) >> 4; - INT32 code = DrvVidRAM1[offs] + 256 * (DrvColRAM1[offs] & 0x07); - code &= 0x3ff; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - UINT8 *spriteram = DrvSprRAM + 0x780; - - for (INT32 offs = 0; offs < 0x80; offs += 4) - { - if (spriteram[offs] & 0x01) - { - INT32 code = spriteram[offs + 1] + ((spriteram[offs] & 0xf0) << 4); - INT32 color = (spriteram[offs] & 0x08) >> 3; - INT32 flipx = spriteram[offs] & 0x04; - INT32 flipy = spriteram[offs] & 0x02; - INT32 sx = 239 - spriteram[offs + 3]; - INT32 sy = (240 - spriteram[offs + 2]) & 0xff; - - sy -= 8; //offset - - if (code >= 0x500) code = (code & 0xff) | (((code/0x100)%6)*0x100); // better to mod, and, or blank? - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc || palette_written) { - DrvPaletteUpdate(); - palette_written = 0; - } - - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_bg_layer(); - if (nBurnLayer & 2) draw_fg_layer(); - if (nBurnLayer & 4) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6502NewFrame(); - - { - memset (DrvInputs, 0xff, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - if ((((DrvInputs[0] & 0x40) == 0x00) || ((DrvInputs[0] & 0x80) == 0x00)) && previous_coin == 0xc0) { - M6502Open(0); - M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // nmi - M6502Close(); - } - - previous_coin = DrvInputs[0] & 0xc0; - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 1200000 / 60, 975000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSegment = 0; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - M6502Open(0); - if (i == 240) { - vblank = 1; - M6502SetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += M6502Run(nSegment); - M6502Close(); - - M6502Open(1); - nCyclesDone[1] += M6502Run(nCyclesTotal[1] / nInterleave); - if (nmi_mask && (i & 0xf) == 0xf) M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); // nmi (16.15 times per frame) - M6502Close(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6502Scan(nAction); - DACScan(nAction, pnMin); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(palette_written); - SCAN_VAR(nmi_mask); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(bgscrolly); - } - - return 0; -} - - -// Syusse Oozumou (Japan) - -static struct BurnRomInfo ssozumoRomDesc[] = { - { "ic61.g01", 0x2000, 0x86968f46, 1 | BRF_PRG | BRF_ESS }, // 0 M6502 #0 Code - { "ic60.g11", 0x2000, 0x1a5143dd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic59.g21", 0x2000, 0xd3df04d7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic58.g31", 0x2000, 0x0ee43a78, 1 | BRF_PRG | BRF_ESS }, // 3 - { "ic57.g41", 0x2000, 0xac77aa4c, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "ic47.g50", 0x2000, 0xb64ec829, 2 | BRF_PRG | BRF_ESS }, // 5 M6502 #1 Code - { "ic46.g60", 0x2000, 0x630d7380, 2 | BRF_PRG | BRF_ESS }, // 6 - { "ic45.g70", 0x2000, 0x1854b657, 2 | BRF_PRG | BRF_ESS }, // 7 - { "ic44.g80", 0x2000, 0x40b9a0da, 2 | BRF_PRG | BRF_ESS }, // 8 - { "ic43.g90", 0x2000, 0x20262064, 2 | BRF_PRG | BRF_ESS }, // 9 - { "ic42.ga0", 0x2000, 0x98d7e998, 2 | BRF_PRG | BRF_ESS }, // 10 - - { "ic22.gq0", 0x2000, 0xb4c7e612, 3 | BRF_GRA }, // 11 Characters - { "ic23.gr0", 0x2000, 0x90bb9fda, 3 | BRF_GRA }, // 12 - { "ic21.gs0", 0x2000, 0xd8cd5c78, 3 | BRF_GRA }, // 13 - - { "ic69.gt0", 0x2000, 0x771116ca, 4 | BRF_GRA }, // 14 Background Tiles - { "ic59.gu0", 0x2000, 0x68035bfd, 4 | BRF_GRA }, // 15 - { "ic81.gv0", 0x2000, 0xcdda1f9f, 4 | BRF_GRA }, // 16 - - { "ic06.gg0", 0x2000, 0xd2342c50, 5 | BRF_GRA }, // 17 Sprites - { "ic05.gh0", 0x2000, 0x14a3cb10, 5 | BRF_GRA }, // 18 - { "ic04.gi0", 0x2000, 0x169276c1, 5 | BRF_GRA }, // 19 - { "ic03.gj0", 0x2000, 0xe71b9f28, 5 | BRF_GRA }, // 20 - { "ic02.gk0", 0x2000, 0x6e94773c, 5 | BRF_GRA }, // 21 - { "ic29.gl0", 0x2000, 0x40f67cc4, 5 | BRF_GRA }, // 22 - { "ic28.gm0", 0x2000, 0x8c97b1a2, 5 | BRF_GRA }, // 23 - { "ic27.gn0", 0x2000, 0xbe8bb3dd, 5 | BRF_GRA }, // 24 - { "ic26.go0", 0x2000, 0x9c098a2c, 5 | BRF_GRA }, // 25 - { "ic25.gp0", 0x2000, 0xf73f8a76, 5 | BRF_GRA }, // 26 - { "ic44.gb0", 0x2000, 0xcdd7f2eb, 5 | BRF_GRA }, // 27 - { "ic43.gc0", 0x2000, 0x7b4c632e, 5 | BRF_GRA }, // 28 - { "ic42.gd0", 0x2000, 0xcd1c8fe6, 5 | BRF_GRA }, // 29 - { "ic41.ge0", 0x2000, 0x935578d0, 5 | BRF_GRA }, // 30 - { "ic40.gf0", 0x2000, 0x5a3bf1ba, 5 | BRF_GRA }, // 31 - - { "ic33.gz0", 0x0020, 0x523d29ad, 6 | BRF_GRA }, // 32 Color data - { "ic30.gz2", 0x0020, 0x0de202e1, 6 | BRF_GRA }, // 33 - { "ic32.gz1", 0x0020, 0x6fbff4d2, 6 | BRF_GRA }, // 34 - { "ic31.gz3", 0x0020, 0x18e7fe63, 6 | BRF_GRA }, // 35 -}; - -STD_ROM_PICK(ssozumo) -STD_ROM_FN(ssozumo) - -struct BurnDriver BurnDrvSsozumo = { - "ssozumo", NULL, NULL, NULL, "1984", - "Syusse Oozumou (Japan)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, ssozumoRomInfo, ssozumoRomName, NULL, NULL, SsozumoInputInfo, SsozumoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x50, - 240, 256, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_sub.cpp b/jan/src/burn/drv/pre90s/d_sub.cpp deleted file mode 100644 index 739a87500..000000000 --- a/jan/src/burn/drv/pre90s/d_sub.cpp +++ /dev/null @@ -1,574 +0,0 @@ -// FB Alpha Submarine (Sigma) driver module -// Based on MAME driver by Angelo Salese and David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvLutPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvAttrRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvScrollY; -static UINT8 *DrvSprRAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 *soundlatch; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static UINT8 sound_nmi_mask; - -static struct BurnInputInfo SubInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Sub) - -static struct BurnDIPInfo SubDIPList[]= -{ - {0x10, 0xff, 0xff, 0x1f, NULL }, - {0x11, 0xff, 0xff, 0xbc, NULL }, - - {0 , 0xfe, 0 , 11, "Coinage" }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x20, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "4 Coins 5 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "2 Coins 3 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x00, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x20, 0x20, "Upright" }, - {0x11, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - -}; - -STDDIPINFO(Sub) - -static UINT8 __fastcall sub_main_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - return DrvDips[0]; - - case 0xf020: - return DrvDips[1]; - - case 0xf040: - return DrvInputs[0] ^ 0xc0; - - case 0xf060: - return DrvInputs[1]; - } - - return 0; -} - -static void __fastcall sub_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - soundlatch[0] = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - } -} - -static UINT8 __fastcall sub_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return soundlatch[1]; - } - - return 0; -} - -static void __fastcall sub_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x6000: - sound_nmi_mask = data & 1; - return; - } -} - -static void __fastcall sub_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - soundlatch[1] = data; - return; - - case 0x40: - case 0x41: - AY8910Write(0, port & 1, data); - return; - - case 0x80: - case 0x81: - AY8910Write(1, port & 1, data); - return; - } -} - -static UINT8 __fastcall sub_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch[0]; - - case 0x40: - case 0x41: - return AY8910Read(0); - - case 0x80: - case 0x81: - return AY8910Read(1); - } - - return 0; -} - -static tilemap_callback( background ) -{ - INT32 attr = DrvAttrRAM[offs]; - - TILE_SET_INFO(0, DrvVidRAM[offs] + ((attr & 0xe0) << 3), attr & 0x1f, 0); -} - -static INT32 DrvDoReset() -{ - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - sound_nmi_mask = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x00b000; - DrvZ80ROM1 = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000300; - DrvLutPROM = Next; Next += 0x000800; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000400; - DrvAttrRAM = Next; Next += 0x000400; - DrvSprRAM0 = Next; Next += 0x000100; - DrvScrollY = Next + 0x40; - DrvSprRAM1 = Next; Next += 0x000100; - - soundlatch = Next; Next += 0x000002; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { RGN_FRAC(0xc000, 2,3), RGN_FRAC(0xc000, 1,3), RGN_FRAC(0xc000, 0,3) }; - INT32 XOffs[16] = { STEP8(64,1), STEP8(0,1) }; - INT32 YOffs[32] = { STEP8(55*8,-8), STEP8(39*8,-8), STEP8(23*8,-8), STEP8(7*8,-8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0xc000); - - GfxDecode(0x0800, 3, 8, 8, Plane, XOffs + 8, YOffs + 24, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0xc000); - - GfxDecode(0x0100, 3, 16, 32, Plane, XOffs + 0, YOffs + 0, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x4000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x8000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x8000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0200, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0000, 12, 1)) return 1; - - if (BurnLoadRom(DrvLutPROM + 0x0000, 13, 1)) return 1; - if (BurnLoadRom(DrvLutPROM + 0x0200, 14, 1)) return 1; - if (BurnLoadRom(DrvLutPROM + 0x0400, 15, 1)) return 1; - if (BurnLoadRom(DrvLutPROM + 0x0600, 16, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xafff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xb000, 0xbfff, MAP_RAM); - ZetMapMemory(DrvAttrRAM, 0xc000, 0xc3ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xc400, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM0, 0xd000, 0xd0ff, MAP_RAM); - ZetMapMemory(DrvSprRAM1, 0xd800, 0xd8ff, MAP_RAM); - ZetSetReadHandler(sub_main_read); - ZetSetInHandler(sub_main_read_port); - ZetSetOutHandler(sub_main_write_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvZ80ROM1, 0x2000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x4000, 0x47ff, MAP_RAM); - ZetSetWriteHandler(sub_sound_write); - ZetSetInHandler(sub_sound_read_port); - ZetSetOutHandler(sub_sound_write_port); - ZetClose(); - - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.23, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.23, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 8, 8, 32, 32); - GenericTilemapSetOffsets(0, 0, -16); - GenericTilemapSetScrollCols(0, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 3, 8, 8, 0x20000, 0x200, 0x1f); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 tmp[0x100]; - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 r = DrvColPROM[i + 0x000] & 0xf; - INT32 g = DrvColPROM[i + 0x100] & 0xf; - INT32 b = DrvColPROM[i + 0x200] & 0xf; - - tmp[i] = BurnHighCol(r+r*16,g+g*16,b+b*16,0); - } - - for (INT32 i = 0; i < 0x400; i++) - { - DrvPalette[i] = tmp[DrvLutPROM[i + 0x400] + (DrvLutPROM[i] << 4)]; - } -} - -static void draw_sprites() -{ - for (INT32 i = 0;i < 0x40; i+=2) - { - INT32 code = DrvSprRAM0[i+1]; - INT32 sx = DrvSprRAM0[i+0]; - INT32 sy = (0xe0 - DrvSprRAM1[i+1]) - 16; - INT32 color = DrvSprRAM1[i+0] & 0x3f; - INT32 flipx =~DrvSprRAM1[i+0] & 0x80; - INT32 flipy =~DrvSprRAM1[i+0] & 0x40; - - if (flipx) { - sx = 0xe0 - sx; - } - - if (flipy) { - if (flipx) { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 16, 32, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } else { - RenderCustomTile_Mask_FlipY_Clip(pTransDraw, 16, 32, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(pTransDraw, 16, 32, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 16, 32, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - for (INT32 i = 0; i < 32; i++) { - GenericTilemapSetScrollCol(0, i, DrvScrollY[i]); - } - - if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, 0); - - if (nBurnLayer & 2) draw_sprites(); - - GenericTilesSetClip(28*8, -1, -1, -1); - if (nBurnLayer & 4) GenericTilemapDraw(0, pTransDraw, 0); - GenericTilesClearClip(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 16; - INT32 nCyclesTotal[2] = { 3072000 / 60, 3072000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - if ((i % (nInterleave / 2)) == ((nInterleave / 2) - 1)) { - if (sound_nmi_mask) { - ZetNmi(); - } - } - - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(sound_nmi_mask); - } - - return 0; -} - - - -// Submarine (Sigma) - -static struct BurnRomInfo subRomDesc[] = { - { "temp 1 pos b6 27128.bin", 0x4000, 0x6875b31d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "temp 2 pos c6 27128.bin", 0x4000, 0xbc7f8f43, 1 | BRF_PRG | BRF_ESS }, // 1 - { "temp 3 pos d6 2764.bin", 0x2000, 0x3546c226, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "m sound pos f14 2764.bin", 0x2000, 0x61536a97, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #0 Code - - { "vram 1 pos f12 27128 version3.bin", 0x4000, 0x8d176ba0, 3 | BRF_GRA }, // 4 Background Tiles - { "vram 2 pos f14 27128 version3.bin", 0x4000, 0x0677cf3a, 3 | BRF_GRA }, // 5 - { "vram 3 pos f15 27128 version3.bin", 0x4000, 0x9a4cd1a0, 3 | BRF_GRA }, // 6 - - { "obj 1 pos h1 27128 version3.bin", 0x4000, 0x63173e65, 4 | BRF_GRA }, // 7 Sprites - { "obj 2 pos h3 27128 version3.bin", 0x4000, 0x3898d1a8, 4 | BRF_GRA }, // 8 - { "obj 3 pos h4 27128 version3.bin", 0x4000, 0x304e2145, 4 | BRF_GRA }, // 9 - - { "prom pos a9 n82s129", 0x0100, 0x8df9cefe, 5 | BRF_GRA }, // 10 Color data - { "prom pos a10 n82s129", 0x0100, 0x3c834094, 5 | BRF_GRA }, // 11 - { "prom pos a11 n82s129", 0x0100, 0x339afa95, 5 | BRF_GRA }, // 12 - - { "prom pos e5 n82s131", 0x0200, 0x0024b5dd, 6 | BRF_GRA }, // 13 Color lookup data - { "prom pos c7 n82s129", 0x0100, 0x9072d259, 6 | BRF_GRA }, // 14 - { "prom pos e4 n82s131", 0x0200, 0x307aa2cf, 6 | BRF_GRA }, // 15 - { "prom pos c8 n82s129", 0x0100, 0x351e1ef8, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(sub) -STD_ROM_FN(sub) - -struct BurnDriver BurnDrvSub = { - "sub", NULL, NULL, NULL, "1985", - "Submarine (Sigma)\0", NULL, "Sigma Enterprises Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, subRomInfo, subRomName, NULL, NULL, SubInputInfo, SubDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_suna8.cpp b/jan/src/burn/drv/pre90s/d_suna8.cpp deleted file mode 100644 index 8b5904cfe..000000000 --- a/jan/src/burn/drv/pre90s/d_suna8.cpp +++ /dev/null @@ -1,2630 +0,0 @@ -// FB Alpha SunA 8-bit driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "bitswap.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "burn_ym3812.h" -#include "dac.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -/* - The samples do really sound that bad. Compare to MAME (sparkman has most obvious samples) - - Needs cleaned. Badly. - Missing Brick Zone - Bugs: - Star Fighter (v1) - the first boss has some broken tiles -*/ - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80Decrypted; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSampleROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; -static UINT8 *flipscreen; -static UINT8 *nmi_enable; -static UINT8 *mainbank; - -static INT16 *DrvSamplesExp; -static INT16 *pAY8910Buffer[3]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 vblank; -static INT32 watchdog_enable = 0; -static INT32 watchdog; - -static INT32 sample_start = -1; -static INT32 sample_offset = 0; -static UINT8 sample_number = 0; - -static UINT8 m_gfxbank = 0; -static UINT8 m_palettebank = 0; -static UINT8 m_spritebank = 0; -static UINT8 m_spritebank_latch = 0; -static UINT8 m_rombank_latch = 0; -static UINT8 m_rambank = 0; -static UINT8 disable_mainram_write = 0; -static UINT8 protection_val = 0; -static UINT8 hardhead_ip = 0; -static UINT8 Sparkman = 0, Hardhead2 = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo SparkmanInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, -}; - -STDINPUTINFO(Sparkman) - -static struct BurnDIPInfo HardheadDIPList[]= -{ - {0x11, 0xff, 0xff, 0xfc, NULL }, - {0x12, 0xff, 0xff, 0x77, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x11, 0x01, 0x0e, 0x0e, "No Bonus" }, - {0x11, 0x01, 0x0e, 0x0c, "10K" }, - {0x11, 0x01, 0x0e, 0x0a, "20K" }, - {0x11, 0x01, 0x0e, 0x08, "50K" }, - {0x11, 0x01, 0x0e, 0x06, "50K, Every 50K" }, - {0x11, 0x01, 0x0e, 0x04, "100K, Every 50K" }, - {0x11, 0x01, 0x0e, 0x02, "100K, Every 100K" }, - {0x11, 0x01, 0x0e, 0x00, "200K, Every 100K" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x70, 0x00, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x70, 0x10, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x70, 0x20, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x70, 0x30, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x70, 0x70, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x70, 0x60, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x70, 0x50, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x70, 0x40, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x02, 0x02, "Upright" }, - {0x12, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Play Together" }, - {0x12, 0x01, 0x04, 0x00, "No" }, - {0x12, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x18, 0x18, "2" }, - {0x12, 0x01, 0x18, 0x10, "3" }, - {0x12, 0x01, 0x18, 0x08, "4" }, - {0x12, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x12, 0x01, 0xe0, 0xe0, "Easiest" }, - {0x12, 0x01, 0xe0, 0xc0, "Very Easy" }, - {0x12, 0x01, 0xe0, 0xa0, "Easy" }, - {0x12, 0x01, 0xe0, 0x80, "Moderate" }, - {0x12, 0x01, 0xe0, 0x60, "Normal" }, - {0x12, 0x01, 0xe0, 0x40, "Harder" }, - {0x12, 0x01, 0xe0, 0x20, "Very Hard" }, - {0x12, 0x01, 0xe0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Hardhead) - -static struct BurnDIPInfo RrangerDIPList[]= -{ - {0x11, 0xff, 0xff, 0xe7, NULL }, - {0x12, 0xff, 0xff, 0xaf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x11, 0x01, 0x38, 0x30, "10K" }, - {0x11, 0x01, 0x38, 0x28, "30K" }, - {0x11, 0x01, 0x38, 0x20, "50K" }, - {0x11, 0x01, 0x38, 0x18, "50K, Every 50K" }, - {0x11, 0x01, 0x38, 0x10, "100K, Every 50K" }, - {0x11, 0x01, 0x38, 0x08, "100K, Every 100K" }, - {0x11, 0x01, 0x38, 0x00, "100K, Every 200K" }, - {0x11, 0x01, 0x38, 0x38, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0xc0, 0xc0, "Normal" }, - {0x11, 0x01, 0xc0, 0x80, "Hard" }, - {0x11, 0x01, 0xc0, 0x40, "Harder" }, - {0x11, 0x01, 0xc0, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x02, 0x02, "Upright" }, - {0x12, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Play Together" }, - {0x12, 0x01, 0x04, 0x00, "No" }, - {0x12, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x08, 0x00, "No" }, - {0x12, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x30, "2" }, - {0x12, 0x01, 0x30, 0x20, "3" }, - {0x12, 0x01, 0x30, 0x10, "4" }, - {0x12, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Rranger) - -static struct BurnDIPInfo Hardhea2DIPList[]= -{ - {0x11, 0xff, 0xff, 0x5f, NULL }, - {0x12, 0xff, 0xff, 0xf7, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x11, 0x01, 0x38, 0x38, "Easiest" }, - {0x11, 0x01, 0x38, 0x30, "Very Easy" }, - {0x11, 0x01, 0x38, 0x28, "Easy" }, - {0x11, 0x01, 0x38, 0x20, "Moderate" }, - {0x11, 0x01, 0x38, 0x18, "Normal" }, - {0x11, 0x01, 0x38, 0x10, "Harder" }, - {0x11, 0x01, 0x38, 0x08, "Very Hard" }, - {0x11, 0x01, 0x38, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x02, 0x02, "Upright" }, - {0x12, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Play Together" }, - {0x12, 0x01, 0x04, 0x00, "No" }, - {0x12, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x12, 0x01, 0x38, 0x30, "10K" }, - {0x12, 0x01, 0x38, 0x28, "30K" }, - {0x12, 0x01, 0x38, 0x18, "50K, Every 50K" }, - {0x12, 0x01, 0x38, 0x20, "50K" }, - {0x12, 0x01, 0x38, 0x10, "100K, Every 50K" }, - {0x12, 0x01, 0x38, 0x08, "100K, Every 100K" }, - {0x12, 0x01, 0x38, 0x00, "200K, Every 100K" }, - {0x12, 0x01, 0x38, 0x38, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x80, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x40, "4" }, - {0x12, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Hardhea2) - -static struct BurnDIPInfo SparkmanDIPList[]= -{ - {0x13, 0xff, 0xff, 0x5f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x13, 0x01, 0x38, 0x20, "Easiest" }, - {0x13, 0x01, 0x38, 0x30, "Very Easy" }, - {0x13, 0x01, 0x38, 0x28, "Easy" }, - {0x13, 0x01, 0x38, 0x38, "Moderate" }, - {0x13, 0x01, 0x38, 0x18, "Normal" }, - {0x13, 0x01, 0x38, 0x10, "Harder" }, - {0x13, 0x01, 0x38, 0x08, "Very Hard" }, - {0x13, 0x01, 0x38, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x02, 0x02, "Upright" }, - {0x14, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Play Together" }, - {0x14, 0x01, 0x04, 0x00, "No" }, - {0x14, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x14, 0x01, 0x38, 0x38, "10K" }, - {0x14, 0x01, 0x38, 0x28, "30K" }, - {0x14, 0x01, 0x38, 0x18, "50K, Every 50K" }, - {0x14, 0x01, 0x38, 0x20, "50K" }, - {0x14, 0x01, 0x38, 0x10, "100K, Every 50K" }, - {0x14, 0x01, 0x38, 0x08, "100K, Every 100K" }, - {0x14, 0x01, 0x38, 0x00, "200K, Every 100K" }, - {0x14, 0x01, 0x38, 0x30, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0xc0, 0x80, "2" }, - {0x14, 0x01, 0xc0, 0xc0, "3" }, - {0x14, 0x01, 0xc0, 0x40, "4" }, - {0x14, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Sparkman) - -static struct BurnDIPInfo StarfighDIPList[]= -{ - {0x11, 0xff, 0xff, 0x5f, NULL }, - {0x12, 0xff, 0xff, 0xf7, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x11, 0x01, 0x38, 0x38, "Easiest" }, - {0x11, 0x01, 0x38, 0x30, "Very Easy" }, - {0x11, 0x01, 0x38, 0x28, "Easy" }, - {0x11, 0x01, 0x38, 0x20, "Moderate" }, - {0x11, 0x01, 0x38, 0x18, "Normal" }, - {0x11, 0x01, 0x38, 0x10, "Harder" }, - {0x11, 0x01, 0x38, 0x08, "Very Hard" }, - {0x11, 0x01, 0x38, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x02, 0x02, "Upright" }, - {0x12, 0x01, 0x02, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Play Together" }, - {0x12, 0x01, 0x04, 0x00, "No" }, - {0x12, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x12, 0x01, 0x38, 0x30, "10K" }, - {0x12, 0x01, 0x38, 0x28, "30K" }, - {0x12, 0x01, 0x38, 0x18, "50K, Every 50K" }, - {0x12, 0x01, 0x38, 0x20, "50K" }, - {0x12, 0x01, 0x38, 0x10, "100K, Every 50K" }, - {0x12, 0x01, 0x38, 0x08, "100K, Every 100K" }, - {0x12, 0x01, 0x38, 0x00, "200K, Every 100K" }, - {0x12, 0x01, 0x38, 0x38, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x80, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x40, "4" }, - {0x12, 0x01, 0xc0, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "3: Copyright Screen Color + ?" }, - {0x13, 0x01, 0x08, 0x08, "Green" }, - {0x13, 0x01, 0x08, 0x00, "Blue" }, -}; - -STDDIPINFO(Starfigh) - -static void play_sample(INT32 sample) -{ - //bprintf (0, _T("Play sample: %d\n"), sample); - sample_start = sample * 0x1000; - sample_offset = 0; -} - -static void sample_render(INT16 *buffer, INT32 nLen) -{ - if (sample_start < 0) return; // stopped - - if (sample_start + (sample_offset >> 16) >= 0x20000 ) { - bprintf(0, _T("Bad sample start!\n")); - sample_start = -1; // stop - sample_offset = 0; - return; - } - - INT32 step = (8000 << 16) / nBurnSoundRate; // 8khz - INT32 pos = 0; - INT16 *rom = DrvSamplesExp + sample_start; - - while (pos < nLen) - { - INT32 sample = (INT32)(rom[(sample_offset >> 16)] * 0.2); - - buffer[0] = BURN_SND_CLIP((INT32)(buffer[0] + sample)); - buffer[1] = BURN_SND_CLIP((INT32)(buffer[1] + sample)); - - sample_offset += step; - - buffer+=2; - pos++; - - if (sample_offset >= 0xfff0000) { - sample_start = -1; // stop - sample_offset = 0; - break; - } - } -} - -static void bankswitch(INT32 bank) -{ - bank &= 0x0f; - *mainbank = bank; - - ZetMapMemory(DrvZ80ROM0 + 0x10000 + (bank * 0x4000), 0x8000, 0xbfff, MAP_ROM); // bank -} - -static void palette_update(UINT16 offset) -{ - UINT16 p = DrvPalRAM[(offset & ~1) + 1] + (DrvPalRAM[(offset & ~1) + 0] * 256); - - UINT8 r = (p >> 12) & 0xf; - UINT8 g = (p >> 8) & 0xf; - UINT8 b = (p >> 4) & 0xf; - - DrvPalette[offset/2] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0); -} - -static UINT8 hardhead_protection_read(UINT8 offset) -{ - if (protection_val & 0x80) - return (~offset & 0x20) | ((protection_val & 0x04) << 5) | ((protection_val & 0x01) << 2); - else - return (~offset & 0x20) | (((offset ^ protection_val) & 0x01) ? 0x84 : 0); -} - -static void __fastcall hardhead_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfe00) == 0xd800) { - DrvPalRAM[address & 0x1ff] = data; - palette_update(address & 0x1ff); - return; - } - - if ((address & 0xff80) == 0xdd80) { - protection_val = (data & 0x80) ? data : (address & 1); - return; - } - - switch (address) - { - case 0xda00: - hardhead_ip = data; - return; - - case 0xda80: - bankswitch(data); - return; - - case 0xdb00: - *soundlatch = data; - return; - - case 0xdb80: - *flipscreen = data & 0x04; - return; - } -} - -static UINT8 __fastcall hardhead_read(UINT16 address) -{ - if ((address & 0xff80) == 0xdd80) { - return hardhead_protection_read(address); - } - - switch (address) - { - case 0xda00: - switch (hardhead_ip) { - case 0: return DrvInputs[0]; - case 1: return DrvInputs[1]; - case 2: return DrvDips[0]; - case 3: return DrvDips[1]; - } - return 0xff; - - case 0xda80: - return *soundlatch2; - } - - return 0; -} - - -static void __fastcall rranger_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfe00) == 0xc600) { - DrvPalRAM[address & 0x1ff] = data; - palette_update(address & 0x1ff); - return; - } - - switch (address) - { - case 0xc000: - *soundlatch = data; - return; - - case 0xc002: - *flipscreen = data & 0x20; - bankswitch((data & 0x07) + (((data & 0x14) == 0x04) ? 4 : 0)); // weird - return; - - case 0xc200: - ZetWriteByte(0xcd99, 0xff); // really? - return; - - case 0xc280: // nop - return; - } -} - -static UINT8 __fastcall rranger_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - watchdog_enable = 1; - watchdog = 0; - return 0; - - case 0xc002: - case 0xc003: - return DrvInputs[address & 1]; - - case 0xc004: - // return *soundlatch2; - return 0x02; // hacky - - case 0xc280: - return DrvDips[0]; - - case 0xc2c0: - return DrvDips[1]; - } - - return 0; -} - - -static void __fastcall hardhea2_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfe00) == 0xc600) { - DrvPalRAM[address & 0x1ff] = data; - palette_update(address & 0x1ff); - return; - } - - switch (address) - { - case 0xc200: - m_spritebank = ((data & 0x02) ? 1 : 0); - ZetMapMemory(DrvSprRAM + (m_spritebank * 0x2000), 0xe000, 0xffff, MAP_RAM); - return; - - case 0xc280: - case 0xc28c: - bankswitch(data); - return; - - case 0xc300: - *flipscreen = data & 0x01; - return; - - case 0xc380: - *nmi_enable = data & 0x01; - return; - - case 0xc400: - // leds, coin counters - return; - - case 0xc480: - // ? - return; - - case 0xc500: - *soundlatch = data; - return; - - case 0xc508: - m_spritebank = 0; - ZetMapMemory(DrvSprRAM + 0x0000, 0xe000, 0xffff, MAP_RAM); - return; - - case 0xc50f: - m_spritebank = 1; - ZetMapMemory(DrvSprRAM + 0x2000, 0xe000, 0xffff, MAP_RAM); - return; - - case 0xc507: - case 0xc556: - case 0xc560: - m_rambank = 1; - ZetMapMemory(DrvZ80RAM0 + 0x1800, 0xc800, 0xdfff, MAP_RAM); - return; - - case 0xc522: - case 0xc528: - case 0xc533: - m_rambank = 0; - ZetMapMemory(DrvZ80RAM0 + 0x0000, 0xc800, 0xdfff, MAP_RAM); - return; - } -} - -static UINT8 __fastcall hardhea2_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - return DrvInputs[address & 1]; - - case 0xc002: - case 0xc003: - return DrvDips[address & 1]; - - case 0xc080: - return (DrvInputs[2] & ~0x40) | (vblank ? 0x40 : 0); - } - - return 0; -} - - - -static void __fastcall sparkman_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfe00) == 0xc600) { - DrvPalRAM[address & 0x1ff] = data; - palette_update(address & 0x1ff); - return; - } - - if (address >= 0xc200) address &= ~0x007f; // mirror misc. writes - - switch (address) - { - case 0xc200: { - m_spritebank = ((data >> 1) & 0x01) | ((data << 1) & 0x02); - if ((m_spritebank_latch >> 1) & 0x01) - m_spritebank ^= 0x03; - - INT32 bank = m_spritebank * 0x2000; - - ZetMapMemory(DrvSprRAM + bank, 0xe000, 0xffff, MAP_RAM); - } - return; - - case 0xc280: - m_rombank_latch = data; - return; - - case 0xc300: - *flipscreen = data & 0x01; - m_spritebank_latch = (data >> 4) & 0x03; - return; - - case 0xc380: - disable_mainram_write = (data & 0x01); - *nmi_enable = data & 0x20; - if (disable_mainram_write) { - ZetUnmapMemory(0xc800,0xdfff, MAP_WRITE); - } else { - ZetMapMemory(DrvZ80RAM0,0xc800,0xdfff, MAP_WRITE); - } - return; - - case 0xc400: - // leds, 0, 1, 0x01, 0x02 - bankswitch(m_rombank_latch & 0x0f); - return; - - case 0xc480: - // coin counters - return; - - case 0xc500: - if (~m_rombank_latch & 0x20) - *soundlatch = data; - return; - } -} - -static UINT8 __fastcall sparkman_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - return DrvInputs[address & 1]; - - case 0xc002: - case 0xc003: - return DrvDips[address & 1]; - - case 0xc080: - return (DrvInputs[2] & 0x3) | (vblank ? 0x40 : 0); - - case 0xc0a3: - return (nCurrentFrame & 1) ? 0x80 : 0; - } - - return 0; -} - - -static void __fastcall starfigh_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfe00) == 0xc600) { - DrvPalRAM[address & 0x1ff] = data; - palette_update(address & 0x1ff); - return; - } - - if (address >= 0xc200) address &= ~0x007f; // mirror misc. writes - - switch (address) - { - case 0xc200: - m_spritebank = m_spritebank_latch; - ZetMapMemory(DrvSprRAM + m_spritebank * 0x2000, 0xe000, 0xffff, MAP_RAM); - return; - - case 0xc280: - m_rombank_latch = data; - return; - - case 0xc300: - *flipscreen = data & 0x01; - return; - - case 0xc380: - m_spritebank_latch =(data & 0x04) >> 2; - *nmi_enable = data & 0x20; - return; - - case 0xc400: - // leds -> 0,1, 0x01, 0x02 - // coin counter 0x04 - m_gfxbank = (data & 0x08) ? 4 : 0; - bankswitch(m_rombank_latch & 0x0f); - return; - - case 0xc500: - if (~m_rombank_latch & 0x20) - *soundlatch = data; - return; - } -} - - - -static void __fastcall hardhead_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - BurnYM3812Write(0, address & 1, data); - return; - - case 0xa002: - case 0xa003: - AY8910Write(0, address & 1, data); - return; - - case 0xd000: - *soundlatch2 = data; - return; - } -} - -static UINT8 __fastcall hardhead_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - case 0xa001: - return BurnYM3812Read(0, address & 1); - - case 0xa002: - case 0xa003: - return AY8910Read(0); - - case 0xc800: - return BurnYM3812Read(0, address & 1); // 3812 status_port ??????????????????????????? - - case 0xd800: - return *soundlatch; - } - - return 0; -} - -static void __fastcall rranger_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xa002: - case 0xa003: - BurnYM2203Write(1, address & 1, data); - return; - - case 0xd000: - *soundlatch2 = data; - return; - } -} - -static UINT8 __fastcall rranger_sound_read(UINT16 address) -{ - switch (address) - { - case 0xd800: - return *soundlatch; - } - - return 0; -} - -static void __fastcall hardhea2_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - case 0xc001: - BurnYM3812Write(0, address & 1, data); - return; - - case 0xc002: - case 0xc003: - AY8910Write(0, address & 1, data); - return; - - case 0xf000: - *soundlatch2 = data; - return; - } -} - -static UINT8 __fastcall hardhea2_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - return BurnYM3812Read(0, address & 1); - - case 0xc002: - case 0xc003: - return AY8910Read(0); - - case 0xf800: - return *soundlatch; - } - - return 0; -} - -static void __fastcall hardhea2_pcm_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - DACSignedWrite(port & 3, data); - return; - } -} - -static UINT8 __fastcall hardhea2_pcm_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return *soundlatch2; - } - - return 0; -} - -static void hardhead_ay8910_write_A(UINT32, UINT32 data) -{ - if (data) - { - if ( ~data & 0x10 ) - { - play_sample(sample_number); - } - else if ( ~data & 0x08 ) - { - play_sample((sample_number& 3) + 7); - } - else if ( ~data & 0x40 ) // sparkman, second sample rom - { - play_sample(sample_number + 0x10); - } - } -} - -static void hardhead_ay8910_write_B(UINT32, UINT32 data) -{ - sample_number = data & 0x0f; -} - -static void rranger_ay8910_write_A(UINT32, UINT32 data) -{ - if (data) - { - if ((sample_number != 0) && (~data & 0x30)) - { - play_sample(sample_number); - } - } -} - -static void sound_type1_fm_irq_handler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static INT32 hardhead_fm_syncronize(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3000000; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (6000000.000 / (nBurnFPS / 100.000)))); -} - -inline static INT32 rranger_fm_syncronize(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -inline static double rranger_get_time() -{ - return (double)ZetTotalCycles() / 6000000.0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x050000; - DrvZ80Decrypted = Next; Next += 0x050000; - DrvZ80ROM1 = Next; Next += 0x010000; - DrvZ80ROM2 = Next; Next += 0x010000; - - DrvSampleROM = Next; Next += 0x010000; - DrvSamplesExp = (INT16*)Next; Next += 0x20000 * sizeof(INT16); - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x008000; - DrvZ80RAM0 = Next; Next += 0x004800; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000200; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - nmi_enable = Next; Next += 0x000001; - mainbank = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvExpandSamples(INT32 len) -{ - for (INT32 i = 0; i < len; i++) { - DrvSamplesExp[i] = (INT8)(((DrvSampleROM[i/2] << ((i & 1) ? 0 : 4)) & 0xf0) ^ 0x80) * 0x100; - } -} - -static INT32 DrvGfxDecode(UINT8 *src, INT32 len) -{ - INT32 Plane[4] = { (len/2)*8 + 0, (len/2)*8 + 4, 0, 4 }; - INT32 XOffs[8] = { STEP4(3,-1), STEP4(11,-1) }; - INT32 YOffs[8] = { STEP8(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, src, len); - - GfxDecode((len*2)/0x40, 4, 8, 8, Plane, XOffs, YOffs, 0x080, tmp, src); - - BurnFree(tmp); - - return 0; -} - -static void HardheadDecrypt() -{ - for (INT32 i = 0; i < 0x8000; i++) - { - static const UINT8 swaptable[8] = - { - 1,1,0,1,1,1,1,0 - }; - int table = ((i & 0x0c00) >> 10) | ((i & 0x4000) >> 12); - - if (swaptable[table]) { - DrvZ80ROM0[i] = BITSWAP08(DrvZ80ROM0[i], 7,6,5,3,4,2,1,0) ^ 0x58; - } - } -} - -static void hardhea2_decrypt() -{ - UINT8 *RAM = DrvZ80ROM0; - UINT8 *decrypt = DrvZ80Decrypted; - - memcpy (decrypt, RAM, 0x50000); - - for (INT32 i = 0x00000; i < 0x50000; i++) - { - static const UINT8 swaptable[0x50] = - { - 1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0, - 1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,0,0,0,0,0,0,1,1,0,0,1,1,0,0 - }; - int addr = i; - - if (swaptable[(i & 0xff000) >> 12]) - addr = (addr & 0xf0000) | BITSWAP16(addr, 15,14,13,12,11,10,9,8,6,7,5,4,3,2,1,0); - - RAM[i] = decrypt[addr]; - } - - for (INT32 i = 0; i < 0x8000; i++) - { - static const UINT8 swaptable[32] = - { - 1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1, - 1,1,0,1,1,1,1,1,1,1,1,1,0,1,0,0 - }; - static const UINT8 xortable[32] = - { - 0x04,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x04,0x45,0x00,0x04,0x00,0x04,0x00,0x00, - 0x04,0x45,0x00,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x04,0x00,0x00 - }; - int table = (i & 1) | ((i & 0x400) >> 9) | ((i & 0x7000) >> 10); - - UINT8 x = RAM[i]; - - x = BITSWAP08(x, 7,6,5,3,4,2,1,0) ^ 0x41 ^ xortable[table]; - if (swaptable[table]) - x = BITSWAP08(x, 5,6,7,4,3,2,1,0); - - decrypt[i] = x; - } - - for (INT32 i = 0; i < 0x8000; i++) - { - static const UINT8 swaptable[8] = { 1,1,0,1,0,1,1,0 }; - - if (swaptable[(i & 0x7000) >> 12]) - RAM[i] = BITSWAP08(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x41; - } -} - -static void sparkman_decrypt() -{ - UINT8 *RAM = DrvZ80ROM0; - size_t size = 0x50000; - UINT8 *decrypt = DrvZ80Decrypted; - UINT8 x; - int i; - - memcpy(decrypt, RAM, size); - for (i = 0; i < 0x50000; i++) - { - static const UINT8 swaptable[0x50] = - { - 1,1,1,1, 0,0,1,1, 0,0,0,0, 0,0,0,0, // 8000-ffff not used - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, - 0,0,0,0, 0,0,0,0, 1,1,0,0, 0,0,0,0 // bank $0e, $8xxx, $9xxx (hand in title screen) - }; - int addr = i; - - if (swaptable[(i & 0xff000) >> 12]) - addr = BITSWAP24(addr, 23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,7,8,6,5,4,3,2,1,0); - - RAM[i] = decrypt[addr]; - } - - /* Opcodes */ - for (i = 0; i < 0x8000; i++) - { - static const UINT8 swaptable[32] = - { - 0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1, - 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0 - }; - static const UINT8 xortable[32] = - { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00 - }; - int table = (i & 0x7c00) >> 10; - - x = RAM[i]; - - x = BITSWAP08(x, 5,6,7,3,4,2,1,0) ^ 0x44 ^ xortable[table]; - if (swaptable[table]) - x = BITSWAP08(x, 5,6,7,4,3,2,1,0) ^ 0x04; - - decrypt[i] = x; - } - - /* Data */ - for (i = 0; i < 0x8000; i++) - { - static const UINT8 swaptable[8] = { 1,1,1,0,1,1,0,1 }; - - if (swaptable[(i & 0x7000) >> 12]) - RAM[i] = BITSWAP08(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x44; - } - - // !!!!!! PATCHES !!!!!! - - // c083 bit 7 protection - decrypt[0x0ee0] = 0x00; - decrypt[0x0ee1] = 0x00; - decrypt[0x0ee2] = 0x00; - - // c083 bit 7 protection - decrypt[0x1ac3] = 0x00; - decrypt[0x1ac4] = 0x00; - decrypt[0x1ac5] = 0x00; -} - - -static void CommonDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - watchdog_enable = 0; - watchdog = 0; - - sample_start = -1; - sample_offset = 0; - sample_number = 0; - - m_gfxbank = 0; - m_palettebank = 0; - m_spritebank = 0; - m_spritebank_latch = 0; - m_rombank_latch = 0; - m_rambank = 0; - disable_mainram_write = 0; - protection_val = 0; - hardhead_ip = 0; - - HiscoreReset(); -} - -static INT32 HardheadDoReset() -{ - CommonDoReset(1); - - AY8910Reset(0); - BurnYM3812Reset(); - - return 0; -} - -static INT32 HardheadInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x18000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x28000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x30000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x38000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x40000, 7, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x30000, 12, 1)) return 1; - - for (INT32 i = 0x3ffff; i >= 0; i--) { // invert & mirror - DrvGfxROM0[i] = (DrvGfxROM0[i & ~0x8000]) ^ 0xff; - } - - if (BurnLoadRom(DrvSampleROM + 0x000, 13, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x40000); - HardheadDecrypt(); - DrvExpandSamples(0x10000); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - bankswitch(0); // ? - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd800, 0xd9ff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xffff, MAP_RAM); - ZetSetWriteHandler(hardhead_write); - ZetSetReadHandler(hardhead_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(hardhead_sound_write); - ZetSetReadHandler(hardhead_sound_read); - ZetClose(); - - BurnYM3812Init(1, 3000000, (0 ? &sound_type1_fm_irq_handler : NULL), hardhead_fm_syncronize, 0); - BurnTimerAttachZetYM3812(3000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &hardhead_ay8910_write_A, &hardhead_ay8910_write_B); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - HardheadDoReset(); - - return 0; -} - -static INT32 SparkmanInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x30000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x40000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 5, 1)) return 1; - - memset (DrvGfxROM0,0xff,0x100000); - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x90000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xc0000, 11, 1)) return 1; - - for (INT32 i = 0xfffff; i >= 0; i--) { // invert - DrvGfxROM0[i] ^= 0xff; - } - - memset (DrvGfxROM1,0xff,0x100000); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000, 13, 1)) return 1; - - for (INT32 i = 0xfffff; i >= 0; i--) { // invert - DrvGfxROM1[i] = DrvGfxROM1[i & ~0x60000] ^ 0xff; - } - - if (BurnLoadRom(DrvSampleROM + 0x0000, 14, 1)) return 1; - if (BurnLoadRom(DrvSampleROM + 0x8000, 15, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x100000); - DrvGfxDecode(DrvGfxROM1, 0x100000); - sparkman_decrypt(); - DrvExpandSamples(0x20000); - } - - ZetInit(0); - ZetOpen(0); - //ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Decrypted, DrvZ80ROM0); - //bankswitch(0); // ? - ZetMapMemory(DrvPalRAM, 0xc600, 0xc7ff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc800, 0xdfff, MAP_ROM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xffff, MAP_RAM); // banked - ZetSetWriteHandler(sparkman_write); - ZetSetReadHandler(sparkman_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(hardhead_sound_write); - ZetSetReadHandler(hardhead_sound_read); - ZetClose(); - - BurnYM3812Init(1, 4000000, NULL, rranger_fm_syncronize, 0); - BurnTimerAttachZetYM3812(6000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &hardhead_ay8910_write_A, &hardhead_ay8910_write_B); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - HardheadDoReset(); - - Sparkman = 1; - - return 0; -} - -static void starfigh_decrypt() -{ - UINT8 *RAM = DrvZ80ROM0; - INT32 size = 0x50000; - UINT8 *decrypt = DrvZ80Decrypted; - UINT8 x; - int i; - - /* Address lines scrambling */ - memcpy(decrypt, RAM, size); - for (i = 0; i < 0x50000; i++) - { - static const UINT8 swaptable[0x50] = - { - 1,1,1,1, 1,1,0,0, 0,0,0,0, 0,0,0,0, // 8000-ffff not used - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, - 0,0,0,0, 0,0,0,0, 1,1,0,0, 0,0,0,0 // bank $0e, 9c80 (boss 1) and 8350 (first wave) - }; - int addr = i; - - if (swaptable[(i & 0xff000) >> 12]) - addr = BITSWAP24(addr, 23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,6,7,5,4,3,2,1,0); - - RAM[i] = decrypt[addr]; - } - - /* Opcodes */ - for (i = 0; i < 0x8000; i++) - { - static const UINT8 swaptable[32] = - { - 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0, - 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - }; - static const UINT8 xortable[32] = - { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x41,0x01,0x00,0x00,0x00,0x00, - 0x01,0x01,0x41,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - int table = (i & 0x7c00) >> 10; - - x = RAM[i]; - - x = BITSWAP08(x, 5,6,7,3,4,2,1,0) ^ 0x45 ^ xortable[table]; - if (swaptable[table]) - x = BITSWAP08(x, 5,6,7,4,3,2,1,0) ^ 0x04; - - decrypt[i] = x; - } - - /* Data */ - for (i = 0; i < 0x8000; i++) - { - static const UINT8 swaptable[8] = { 1,1,0,1,0,1,1,0 }; - - if (swaptable[(i & 0x7000) >> 12]) - RAM[i] = BITSWAP08(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x45; - } - - - // !!!!!! PATCHES !!!!!! - - decrypt[0x07c0] = 0xc9; // c080 bit 7 protection check - -// decrypt[0x083e] = 0x00; // sound latch disabling -// decrypt[0x083f] = 0x00; // "" -// decrypt[0x0840] = 0x00; // "" - -// decrypt[0x0cef] = 0xc9; // rombank latch check, corrupt d12d - - decrypt[0x2696] = 0xc9; // work ram writes disable, corrupt next routine - decrypt[0x4e9a] = 0x00; // work ram writes disable, flip background sprite -} - - -static INT32 StarfighInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x30000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x40000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 7, 1)) return 1; - memcpy (DrvGfxROM0 + 0x20000, DrvGfxROM0 + 0x00000, 0x20000); - if (BurnLoadRom(DrvGfxROM0 + 0x40000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x50000, 9, 1)) return 1; - memcpy (DrvGfxROM0 + 0x60000, DrvGfxROM0 + 0x40000, 0x20000); - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x90000, 11, 1)) return 1; - memcpy (DrvGfxROM0 + 0xa0000, DrvGfxROM0 + 0x80000, 0x20000); - if (BurnLoadRom(DrvGfxROM0 + 0xc0000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xd0000, 13, 1)) return 1; - memcpy (DrvGfxROM0 + 0xe0000, DrvGfxROM0 + 0xc0000, 0x20000); - - for (INT32 i = 0xfffff; i >= 0; i--) { // invert - DrvGfxROM0[i] ^= 0xff; - } - - if (BurnLoadRom(DrvSampleROM + 0x0000, 14, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x100000); - starfigh_decrypt(); - DrvExpandSamples(0x10000); - } - - ZetInit(0); - ZetOpen(0); - //ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Decrypted, DrvZ80ROM0); - //bankswitch(0); // ? - ZetMapMemory(DrvPalRAM, 0xc600, 0xc7ff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xffff, MAP_RAM); // banked - ZetSetWriteHandler(starfigh_write); - ZetSetReadHandler(sparkman_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(hardhead_sound_write); - ZetSetReadHandler(hardhead_sound_read); - ZetClose(); - - BurnYM3812Init(1, 4000000, NULL, rranger_fm_syncronize, 0); - BurnTimerAttachZetYM3812(6000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &hardhead_ay8910_write_A, &hardhead_ay8910_write_B); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - HardheadDoReset(); - - return 0; -} - -static INT32 HardheadExit() -{ - GenericTilesExit(); - ZetExit(); - BurnYM3812Exit(); - AY8910Exit(0); - - BurnFree(AllMem); - - Sparkman = 0; - - return 0; -} - -static INT32 RrangerDoReset(INT32 clear_ram) -{ - CommonDoReset(clear_ram); - - BurnYM2203Reset(); - - return 0; -} - -static INT32 RrangerInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x18000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x30000, 3, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x20000, DrvZ80ROM0 + 0x38000, 0x08000); - if (BurnLoadRom(DrvZ80ROM0 + 0x38000, 4, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x28000, DrvZ80ROM0 + 0x40000, 0x08000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x18000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x28000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x30000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x38000, 13, 1)) return 1; - - for (INT32 i = 0x3ffff; i >= 0; i--) { // invert - DrvGfxROM0[i] = DrvGfxROM0[i] ^ 0xff; - } - - if (BurnLoadRom(DrvSampleROM + 0x000, 14, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x40000); - DrvExpandSamples(0x10000); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - bankswitch(0); // ? - ZetMapMemory(DrvPalRAM, 0xc600, 0xc7ff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xffff, MAP_RAM); - ZetSetWriteHandler(rranger_write); - ZetSetReadHandler(rranger_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(rranger_sound_write); - ZetSetReadHandler(rranger_sound_read); - ZetClose(); - - BurnYM2203Init(2, 4000000, NULL, rranger_fm_syncronize, rranger_get_time, 0); - BurnYM2203SetPorts(0, NULL, NULL, &rranger_ay8910_write_A, &hardhead_ay8910_write_B); - BurnTimerAttachZet(6000000); - BurnYM2203SetAllRoutes(0, 0.90, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.90, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - RrangerDoReset(1); - - return 0; -} - - -static INT32 RrangerExit() -{ - GenericTilesExit(); - ZetExit(); - BurnYM2203Exit(); - - BurnFree(AllMem); - - return 0; -} - -static INT32 Hardhea2DoReset() -{ - CommonDoReset(1); - - ZetOpen(2); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - BurnYM3812Reset(); - DACReset(); - - return 0; -} - -static INT32 Hardhea2Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x30000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x40000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x30000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x50000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x60000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x70000, 14, 1)) return 1; - - for (INT32 i = 0x7ffff; i >= 0; i--) { // invert - DrvGfxROM0[i] ^= 0xff; - } - - DrvGfxDecode(DrvGfxROM0, 0x80000); - hardhea2_decrypt(); - } - - ZetInit(0); - ZetOpen(0); - //ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Decrypted, DrvZ80ROM0); - bankswitch(0); // ? - m_rambank = 0; - ZetMapMemory(DrvPalRAM, 0xc600, 0xc7ff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe000, 0xffff, MAP_RAM); - ZetSetWriteHandler(hardhea2_write); - ZetSetReadHandler(hardhea2_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xe000, 0xe7ff, MAP_RAM); - ZetSetWriteHandler(hardhea2_sound_write); - ZetSetReadHandler(hardhea2_sound_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xffff, MAP_ROM); - ZetSetOutHandler(hardhea2_pcm_write_port); - ZetSetInHandler(hardhea2_pcm_read_port); - ZetClose(); - - BurnYM3812Init(1, 3000000, sound_type1_fm_irq_handler, rranger_fm_syncronize, 0); - BurnTimerAttachZetYM3812(6000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.33, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvSyncDAC); - DACSetRoute(0, 0.17, BURN_SND_ROUTE_LEFT); - DACInit(1, 0, 1, DrvSyncDAC); - DACSetRoute(1, 0.17, BURN_SND_ROUTE_RIGHT); - DACInit(2, 0, 1, DrvSyncDAC); - DACSetRoute(2, 0.17, BURN_SND_ROUTE_LEFT); - DACInit(3, 0, 1, DrvSyncDAC); - DACSetRoute(3, 0.17, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - Hardhea2DoReset(); - - Hardhead2 = 1; - - return 0; -} - -static INT32 Hardhea2Exit() -{ - GenericTilesExit(); - ZetExit(); - BurnYM3812Exit(); - AY8910Exit(0); - DACExit(); - - BurnFree(AllMem); - - Hardhead2 = 0; - - return 0; -} - -static void draw_single_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - if (sy == 0 || sy >= 240) return; - - sy -= 16; - - UINT8 *rom = (code & 0x8000) ? DrvGfxROM1 : DrvGfxROM0; - code &= 0x7fff; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0, rom); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0, rom); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0, rom); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0, rom); - } - } -} - -static void draw_normal_sprites(INT32 which, INT32 new_style, INT32 gfxbank_type) -{ - UINT8 *spriteram = DrvSprRAM + which * 0x2000 * 2; - - int i; - int mx = 0; // multisprite x counter - - int max_x = nScreenWidth - 8; - int max_y = nScreenHeight - 8; - - for (i = 0x1d00; i < 0x2000; i += 4) - { - int srcpg, srcx,srcy, dimx,dimy, tx, ty; - int gfxbank, colorbank = 0, flipx,flipy, multisprite; - - int y = spriteram[i + 0]; - int code = spriteram[i + 1]; - int x = spriteram[i + 2]; - int bank = spriteram[i + 3]; - - if (!new_style) - { - flipx = 0; - flipy = 0; - gfxbank = bank & 0x3f; - switch( code & 0x80 ) - { - case 0x80: - dimx = 2; dimy = 32; - srcx = (code & 0xf) * 2; srcy = 0; - srcpg = (code >> 4) & 3; - break; - case 0x00: - default: - dimx = 2; dimy = 2; - srcx = (code & 0xf) * 2; srcy = ((code >> 5) & 0x3) * 8 + 6; - srcpg = (code >> 4) & 1; - break; - } - multisprite = ((code & 0x80) && (code & 0x40)); - } - else - { - switch( code & 0xc0 ) - { - case 0xc0: - dimx = 4; dimy = 32; - srcx = (code & 0xe) * 2; srcy = 0; - flipx = (code & 0x1); - flipy = 0; - gfxbank = bank & 0x1f; - srcpg = (code >> 4) & 3; - break; - case 0x80: - dimx = 2; dimy = 32; - srcx = (code & 0xf) * 2; srcy = 0; - flipx = 0; - flipy = 0; - gfxbank = bank & 0x1f; - srcpg = (code >> 4) & 3; - break; - case 0x40: - dimx = 4; dimy = 4; - srcx = (code & 0xe) * 2; - flipx = code & 0x01; - flipy = bank & 0x10; - srcy = (((bank & 0x80)>>4) + (bank & 0x04) + ((~bank >> 4)&2)) * 2; - srcpg = ((code >> 4) & 3) + 4; - gfxbank = (bank & 0x3); - switch (gfxbank_type) - { - case 0: //suna8_state::GFXBANK_TYPE_SPARKMAN: - break; - - case 1: //suna8_state::GFXBANK_TYPE_BRICKZN: - gfxbank += 4; - break; - - case 2: //suna8_state::GFXBANK_TYPE_STARFIGH: - if (gfxbank == 3) gfxbank += m_gfxbank; - break; - } - colorbank = (bank & 8) >> 3; - break; - case 0x00: - default: - dimx = 2; dimy = 2; - srcx = (code & 0xf) * 2; - flipx = 0; - flipy = 0; - srcy = (((bank & 0x80)>>4) + (bank & 0x04) + ((~bank >> 4)&3)) * 2; - srcpg = (code >> 4) & 3; - gfxbank = bank & 0x03; - switch (gfxbank_type) - { - case 2: // suna8_state::GFXBANK_TYPE_STARFIGH: - // starfigh: boss 2 tail, p2 g7: - // 61 20 1b 27 - if (gfxbank == 3) - gfxbank += m_gfxbank; - break; - - default: - break; - } - break; - } - multisprite = ((code & 0x80) && (bank & 0x80)); - } - - x = x - ((bank & 0x40) ? 0x100 : 0); - y = (0x100 - y - dimy*8 ) & 0xff; - - /* Multi Sprite */ - if ( multisprite ) { mx += dimx*8; x = mx; } - else mx = x; - - gfxbank *= 0x400; - - for (ty = 0; ty < dimy; ty ++) - { - for (tx = 0; tx < dimx; tx ++) - { - int addr = (srcpg * 0x20 * 0x20) + - ((srcx + (flipx?dimx-tx-1:tx)) & 0x1f) * 0x20 + - ((srcy + (flipy?dimy-ty-1:ty)) & 0x1f); - - int tile = spriteram[addr*2 + 0]; - int attr = spriteram[addr*2 + 1]; - - int tile_flipx = attr & 0x40; - int tile_flipy = attr & 0x80; - - int sx = x + tx * 8; - int sy = (y + ty * 8) & 0xff; - - if (flipx) tile_flipx = !tile_flipx; - if (flipy) tile_flipy = !tile_flipy; - - if (*flipscreen) - { - sx = max_x - sx; tile_flipx = !tile_flipx; - sy = max_y - sy; tile_flipy = !tile_flipy; - } - - draw_single_sprite(tile + (attr & 0x3)*0x100 + gfxbank + (which*0x8000), (((attr >> 2) & 0xf) ^ colorbank) + 0x10 * m_palettebank, sx, sy, tile_flipx, tile_flipy); - } - } - - } -} - -static void draw_text_sprites(INT32 text_dim) -{ - UINT8 *spriteram = DrvSprRAM; - int i; - - int max_x = nScreenWidth - 8; - int max_y = nScreenHeight - 8; - - for (i = 0x1900; i < 0x19ff; i += 4) - { - int srcpg, srcx,srcy, dimx,dimy, tx, ty; - - int y = spriteram[i + 0]; - int code = spriteram[i + 1]; - int x = spriteram[i + 2]; - int bank = spriteram[i + 3]; - - if (~code & 0x80) continue; - - dimx = 2; dimy = text_dim; - srcx = (code & 0xf) * 2; srcy = (y & 0xf0) / 8; - srcpg = (code >> 4) & 3; - - x = x - ((bank & 0x40) ? 0x100 : 0); - y = 0; - - bank = (bank & 0x3f) * 0x400; - - for (ty = 0; ty < dimy; ty ++) - { - for (tx = 0; tx < dimx; tx ++) - { - int real_ty = (ty < (dimy/2)) ? ty : (ty + 0x20 - dimy); - - int addr = (srcpg * 0x20 * 0x20) + - ((srcx + tx) & 0x1f) * 0x20 + - ((srcy + real_ty) & 0x1f); - - int tile = spriteram[addr*2 + 0]; - int attr = spriteram[addr*2 + 1]; - - int flipx = attr & 0x40; - int flipy = attr & 0x80; - - int sx = x + tx * 8; - int sy = (y + real_ty * 8) & 0xff; - - if (*flipscreen) - { - sx = max_x - sx; flipx = !flipx; - sy = max_y - sy; flipy = !flipy; - } - - draw_single_sprite(tile + (attr & 0x3)*0x100 + bank, (attr >> 2) & 0xf, sx, sy, flipx, flipy); - } - } - } -} - -static INT32 DrvDraw(INT32 sprite2x, INT32 sprite_new, INT32 sprite_type, INT32 text_mode) -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x200; i+=2) { - palette_update(i); - } - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0xff; - } - - draw_normal_sprites(0,sprite_new,sprite_type); - if (sprite2x) draw_normal_sprites(1,sprite_new,sprite_type); - draw_text_sprites(text_mode); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 HardheadDraw() -{ - return DrvDraw(0,0,0,12); -} - -static INT32 RrangerDraw() -{ - return DrvDraw(0,0,0,8); -} - -static INT32 Hardhea2Draw() -{ - return DrvDraw(0,1,1,8); -} - -static INT32 SparkmanDraw() -{ - return DrvDraw(1,1,0,0); -} - -static INT32 StarfighDraw() -{ - return DrvDraw(0,1,2,0); -} - -static INT32 HardheadFrame() -{ - if (DrvReset) { - HardheadDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0 ; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nCyclesSegment; - INT32 nInterleave = 16; - INT32 nCyclesTotal[2] = { 6000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nCyclesSegment); - if (i == (nInterleave-1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nCyclesSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - BurnTimerUpdateYM3812(nCyclesSegment); - if ((i % (nInterleave/4)) == ((nInterleave / 4) - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); - sample_render(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - HardheadDraw(); - } - - return 0; -} - -static INT32 RrangerFrame() -{ - watchdog++; - if (watchdog >= 180 && watchdog_enable) { - RrangerDoReset(0); - } - - if (DrvReset) { - RrangerDoReset(1); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2); - - for (INT32 i = 0 ; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nCyclesSegment; - INT32 nInterleave = 16; - INT32 nCyclesTotal[2] = { 6000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nCyclesSegment); - if (i == (nInterleave-1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nCyclesSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - BurnTimerUpdate(nCyclesSegment); - if ((i % (nInterleave/4)) == ((nInterleave / 4) - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - sample_render(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - RrangerDraw(); - } - - return 0; -} - -static INT32 Hardhea2Frame() -{ - if (DrvReset) { - Hardhea2DoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2); - - for (INT32 i = 0 ; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nCyclesSegment; - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 6000000 / 60, 6000000 / 60, 6000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nCyclesSegment); - if (i == 112 && *nmi_enable) ZetNmi(); - if (i == 240) { vblank = 1; ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); } - ZetClose(); - - ZetOpen(1); - nCyclesSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - BurnTimerUpdateYM3812(nCyclesSegment); - if ((i % (nInterleave/4)) == ((nInterleave / 4) - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - ZetOpen(2); - nCyclesSegment = nCyclesTotal[2] / nInterleave; - nCyclesDone[2] += ZetRun(nCyclesSegment); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - ZetClose(); - - if (pBurnSoundOut) { - ZetOpen(1); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); - ZetClose(); - ZetOpen(2); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } - - if (pBurnDraw) { - Hardhea2Draw(); - } - - return 0; -} - - -static INT32 SparkmanFrame() // & starfigh -{ - if (DrvReset) { - HardheadDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0 ; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - DrvInputs[2] = (DrvInputs[2] & 0x03) | (DrvDips[2] & 0xbc); - } - - INT32 nCyclesSegment; - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { (Sparkman ? 6000000 : 9000000) / 60, 6000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nCyclesSegment); - if (i == 112 && *nmi_enable) ZetNmi(); - if (i == (Sparkman ? 250 : 255)) { // any other value and the sprites glitch (MAME uses 240 here, hmmm) - vblank = 1; - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - ZetOpen(1); - nCyclesSegment = (nCyclesTotal[1] / nInterleave) * (i + 1); - BurnTimerUpdateYM3812(nCyclesSegment); - if ((i % (nInterleave/4)) == ((nInterleave / 4) - 1)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); - sample_render(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029672; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); // Scan Z80 - - if (Hardhead2) { - DACScan(nAction, pnMin); - } - - ZetOpen(1); - if (strstr(BurnDrvGetTextA(DRV_NAME), "ranger")) { - BurnYM2203Scan(nAction, pnMin); - } else { - AY8910Scan(nAction, pnMin); - BurnYM3812Scan(nAction, pnMin); - } - ZetClose(); - - // Scan critical driver variables - SCAN_VAR(m_gfxbank); - SCAN_VAR(m_palettebank); - SCAN_VAR(m_spritebank); - SCAN_VAR(m_spritebank_latch); - SCAN_VAR(m_rombank_latch); - SCAN_VAR(m_rambank); - SCAN_VAR(disable_mainram_write); - SCAN_VAR(protection_val); - SCAN_VAR(hardhead_ip); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(*mainbank); - ZetMapMemory(DrvSprRAM + (m_spritebank * 0x2000), 0xe000, 0xffff, MAP_RAM); - if (Sparkman) { - if (disable_mainram_write) { - ZetUnmapMemory(0xc800,0xdfff, MAP_WRITE); - } else { - ZetMapMemory(DrvZ80RAM0,0xc800,0xdfff, MAP_WRITE); - } - } - if (Hardhead2) { - ZetMapMemory(DrvZ80RAM0 + (m_rambank * 0x1800), 0xc800, 0xdfff, MAP_RAM); - } - ZetClose(); - } - - return 0; -} - - -// Hard Head - -static struct BurnRomInfo hardheadRomDesc[] = { - { "p1", 0x8000, 0xc6147926, 1 }, // 0 maincpu - { "p2", 0x8000, 0xfaa2cf9a, 1 }, // 1 - { "p3", 0x8000, 0x3d24755e, 1 }, // 2 - { "p4", 0x8000, 0x0241ac79, 1 }, // 3 - { "p7", 0x8000, 0xbeba8313, 1 }, // 4 - { "p8", 0x8000, 0x211a9342, 1 }, // 5 - { "p9", 0x8000, 0x2ad430c4, 1 }, // 6 - { "p10", 0x8000, 0xb6894517, 1 }, // 7 - - { "p13", 0x8000, 0x493c0b41, 2 }, // 8 audiocpu - - { "p5", 0x8000, 0xe9aa6fba, 3 }, // 9 gfx1 - { "p6", 0x8000, 0x15d5f5dd, 3 }, // 10 - { "p11", 0x8000, 0x055f4c29, 3 }, // 11 - { "p12", 0x8000, 0x9582e6db, 3 }, // 12 - - { "p14", 0x8000, 0x41314ac1, 4 }, // 13 samples -}; - -STD_ROM_PICK(hardhead) -STD_ROM_FN(hardhead) - -struct BurnDriver BurnDrvHardhead = { - "hardhead", NULL, NULL, NULL, "1988", - "Hard Head\0", NULL, "SunA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, hardheadRomInfo, hardheadRomName, NULL, NULL, DrvInputInfo, HardheadDIPInfo, - HardheadInit, HardheadExit, HardheadFrame, HardheadDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Super Ranger (v2.0) - -static struct BurnRomInfo srangerRomDesc[] = { - { "1.e2", 0x08000, 0x4eef1ede, 1 }, // 0 maincpu - { "2.f2", 0x08000, 0xff65af29, 1 }, // 1 - { "3.h2", 0x08000, 0x64e09436, 1 }, // 2 - { "4.i2", 0x10000, 0x4346fae6, 1 }, // 3 - { "5.j2", 0x10000, 0x6a7ca1c3, 1 }, // 4 - - { "14.j13", 0x08000, 0x11c83aa1, 2 }, // 5 audiocpu - - { "6.p5", 0x08000, 0x4f11fef3, 3 }, // 6 gfx1 - { "7.p6", 0x08000, 0x9f35dbfa, 3 }, // 7 - { "8.p7", 0x08000, 0xf400db89, 3 }, // 8 - { "9.p8", 0x08000, 0xfa2a11ea, 3 }, // 9 - { "10.p9", 0x08000, 0x1b204d6b, 3 }, // 10 - { "11.p10", 0x08000, 0x19037a7b, 3 }, // 11 - { "12.p11", 0x08000, 0xc59c0ec7, 3 }, // 12 - { "13.p12", 0x08000, 0x9809fee8, 3 }, // 13 - - { "15.e13", 0x08000, 0x28c2c87e, 4 }, // 14 samples -}; - -STD_ROM_PICK(sranger) -STD_ROM_FN(sranger) - -struct BurnDriver BurnDrvSranger = { - "sranger", NULL, NULL, NULL, "1988", - "Super Ranger (v2.0)\0", NULL, "SunA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, srangerRomInfo, srangerRomName, NULL, NULL, DrvInputInfo, RrangerDIPInfo, - RrangerInit, RrangerExit, RrangerFrame, RrangerDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Hard Head 2 (v2.0) - -static struct BurnRomInfo hardhea2RomDesc[] = { - { "hrd-hd9", 0x08000, 0x69c4c307, 1 }, // 0 maincpu - { "hrd-hd10", 0x10000, 0x77ec5b0a, 1 }, // 1 - { "hrd-hd11", 0x10000, 0x12af8f8e, 1 }, // 2 - { "hrd-hd12", 0x10000, 0x35d13212, 1 }, // 3 - { "hrd-hd13", 0x10000, 0x3225e7d7, 1 }, // 4 - - { "hrd-hd14", 0x08000, 0x79a3be51, 2 }, // 5 audiocpu - - { "hrd-hd15", 0x10000, 0xbcbd88c3, 3 }, // 6 pcm - - { "hrd-hd1", 0x10000, 0x7e7b7a58, 4 }, // 7 gfx1 - { "hrd-hd2", 0x10000, 0x303ec802, 4 }, // 8 - { "hrd-hd3", 0x10000, 0x3353b2c7, 4 }, // 9 - { "hrd-hd4", 0x10000, 0xdbc1f9c1, 4 }, // 10 - { "hrd-hd5", 0x10000, 0xf738c0af, 4 }, // 11 - { "hrd-hd6", 0x10000, 0xbf90d3ca, 4 }, // 12 - { "hrd-hd7", 0x10000, 0x992ce8cb, 4 }, // 13 - { "hrd-hd8", 0x10000, 0x359597a4, 4 }, // 14 -}; - -STD_ROM_PICK(hardhea2) -STD_ROM_FN(hardhea2) - -struct BurnDriver BurnDrvHardhea2 = { - "hardhea2", NULL, NULL, NULL, "1991", - "Hard Head 2 (v2.0)\0", NULL, "SunA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, hardhea2RomInfo, hardhea2RomName, NULL, NULL, DrvInputInfo, Hardhea2DIPInfo, - Hardhea2Init, Hardhea2Exit, Hardhea2Frame, Hardhea2Draw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Spark Man (v2.0, set 1) - -static struct BurnRomInfo sparkmanRomDesc[] = { - { "sparkman.e7", 0x08000, 0xd89c5780, 1 }, // 0 maincpu - { "10.g7", 0x10000, 0x48b4a31e, 1 }, // 1 - { "12.g8", 0x10000, 0xb8a4a557, 1 }, // 2 - { "11.i7", 0x10000, 0xf5f38e1f, 1 }, // 3 - { "13.i8", 0x10000, 0xe54eea25, 1 }, // 4 - - { "14.h11", 0x08000, 0x06822f3d, 2 }, // 5 audiocpu - - { "p3.u1", 0x10000, 0x39dbd414, 3 }, // 6 gfx1 - { "p2.t1", 0x10000, 0x2e474203, 3 }, // 7 - { "p1.r1", 0x08000, 0x7115cfe7, 3 }, // 8 - { "p6.u2", 0x10000, 0xe6551db9, 3 }, // 9 - { "p5.t2", 0x10000, 0x0df5da2a, 3 }, // 10 - { "p4.r2", 0x08000, 0x6904bde2, 3 }, // 11 - - { "p7.u4", 0x10000, 0x17c16ce4, 4 }, // 12 gfx2 - { "p8.u6", 0x10000, 0x414222ea, 4 }, // 13 - - { "15.b10", 0x08000, 0x46c7d4d8, 5 }, // 14 samples - { "16.b11", 0x08000, 0xd6823a62, 5 }, // 15 -}; - -STD_ROM_PICK(sparkman) -STD_ROM_FN(sparkman) - -struct BurnDriver BurnDrvSparkman = { - "sparkman", NULL, NULL, NULL, "1989", - "Spark Man (v2.0, set 1)\0", NULL, "SunA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, sparkmanRomInfo, sparkmanRomName, NULL, NULL, SparkmanInputInfo, SparkmanDIPInfo, - SparkmanInit, HardheadExit, SparkmanFrame, SparkmanDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - - -// Star Fighter (v1) - -static struct BurnRomInfo starfighRomDesc[] = { - { "starfgtr.l1", 0x08000, 0xf93802c6, 1 }, // 0 maincpu - { "starfgtr.j1", 0x10000, 0xfcfcf08a, 1 }, // 1 - { "starfgtr.i1", 0x10000, 0x6935fcdb, 1 }, // 2 - { "starfgtr.l3", 0x10000, 0x50c072a4, 1 }, // 3 - { "starfgtr.j3", 0x10000, 0x3fe3c714, 1 }, // 4 - - { "starfgtr.m8", 0x08000, 0xae3b0691, 2 }, // 5 audiocpu - - { "starfgtr.e4", 0x10000, 0x54c0ca3d, 3 }, // 6 gfx1 - { "starfgtr.d4", 0x10000, 0x4313ba40, 3 }, // 7 - { "starfgtr.b4", 0x10000, 0xad8d0f21, 3 }, // 8 - { "starfgtr.a4", 0x10000, 0x6d8f74c8, 3 }, // 9 - { "starfgtr.e6", 0x10000, 0xceff00ff, 3 }, // 10 - { "starfgtr.d6", 0x10000, 0x7aaa358a, 3 }, // 11 - { "starfgtr.b6", 0x10000, 0x47d6049c, 3 }, // 12 - { "starfgtr.a6", 0x10000, 0x4a33f6f3, 3 }, // 13 - - { "starfgtr.q10", 0x08000, 0xfa510e94, 4 }, // 14 samples -}; - -STD_ROM_PICK(starfigh) -STD_ROM_FN(starfigh) - -struct BurnDriver BurnDrvStarfigh = { - "starfigh", NULL, NULL, NULL, "1990", - "Star Fighter (v1)\0", NULL, "SunA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, starfighRomInfo, starfighRomName, NULL, NULL, DrvInputInfo, StarfighDIPInfo, - StarfighInit, HardheadExit, SparkmanFrame, StarfighDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_tail2nose.cpp b/jan/src/burn/drv/pre90s/d_tail2nose.cpp deleted file mode 100644 index 619351ce7..000000000 --- a/jan/src/burn/drv/pre90s/d_tail2nose.cpp +++ /dev/null @@ -1,770 +0,0 @@ -// FB Alpha Tail to Nose driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2608.h" -#include "konamiic.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvISndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZoomRAM; -static UINT8 *DrvZoomRAMExp; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[1]; - -static UINT8 *soundlatch; -static UINT8 *char_bank; -static UINT8 *pal_bank; -static UINT8 *video_enable; -static UINT8 *DrvZ80Bank; - -static INT32 redraw_zoom_tiles; - -static struct BurnInputInfo Tail2nosInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 10, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 11, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 14, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tail2nos) - -static struct BurnDIPInfo Tail2nosDIPList[]= -{ - {0x09, 0xff, 0xff, 0x00, NULL }, - {0x0a, 0xff, 0xff, 0x50, NULL }, - - {0 , 0xfe, 0 , 15, "Coin A" }, - {0x09, 0x01, 0x0f, 0x09, "5 Coins 1 Credits" }, - {0x09, 0x01, 0x0f, 0x08, "4 Coins 1 Credits" }, - {0x09, 0x01, 0x0f, 0x07, "3 Coins 1 Credits" }, - {0x09, 0x01, 0x0f, 0x06, "2 Coins 1 Credits" }, - {0x09, 0x01, 0x0f, 0x0b, "6 Coins/4 Credits" }, - {0x09, 0x01, 0x0f, 0x0c, "4 Coins 3 Credits" }, - {0x09, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x09, 0x01, 0x0f, 0x0d, "5 Coins/6 Credits" }, - {0x09, 0x01, 0x0f, 0x0e, "4 Coins 5 Credits" }, - {0x09, 0x01, 0x0f, 0x0a, "2 Coins 3 Credits" }, - {0x09, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x09, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x09, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x09, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x09, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x09, 0x01, 0xf0, 0x90, "5 Coins 1 Credits" }, - {0x09, 0x01, 0xf0, 0x80, "4 Coins 1 Credits" }, - {0x09, 0x01, 0xf0, 0x70, "3 Coins 1 Credits" }, - {0x09, 0x01, 0xf0, 0x60, "2 Coins 1 Credits" }, - {0x09, 0x01, 0xf0, 0xb0, "6 Coins/4 Credits" }, - {0x09, 0x01, 0xf0, 0xc0, "4 Coins 3 Credits" }, - {0x09, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x09, 0x01, 0xf0, 0xd0, "5 Coins/6 Credits" }, - {0x09, 0x01, 0xf0, 0xe0, "4 Coins 5 Credits" }, - {0x09, 0x01, 0xf0, 0xa0, "2 Coins 3 Credits" }, - {0x09, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x09, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x09, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x09, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x09, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0a, 0x01, 0x03, 0x01, "Easy" }, - {0x0a, 0x01, 0x03, 0x00, "Normal" }, - {0x0a, 0x01, 0x03, 0x02, "Hard" }, - {0x0a, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0a, 0x01, 0x08, 0x00, "Off" }, - {0x0a, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Game Mode" }, - {0x0a, 0x01, 0x10, 0x10, "Single" }, - {0x0a, 0x01, 0x10, 0x00, "Multiple" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x0a, 0x01, 0x20, 0x00, "Off" }, -// {0x0a, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Control Panel" }, - {0x0a, 0x01, 0x40, 0x40, "Standard" }, - {0x0a, 0x01, 0x40, 0x00, "Original" }, - - {0 , 0xfe, 0 , 2, "Country" }, - {0x0a, 0x01, 0x80, 0x00, "Domestic" }, - {0x0a, 0x01, 0x80, 0x80, "Overseas" }, -}; - -STDDIPINFO(Tail2nos) - -static inline void graphics_ram_expand_one(INT32 offset) -{ - offset &= 0x1fffe; - - DrvZoomRAMExp[offset * 2 + 3] = DrvZoomRAM[offset + 0] & 0x0f; - DrvZoomRAMExp[offset * 2 + 2] = DrvZoomRAM[offset + 0] >> 4; - DrvZoomRAMExp[offset * 2 + 1] = DrvZoomRAM[offset + 1] & 0x0f; - DrvZoomRAMExp[offset * 2 + 0] = DrvZoomRAM[offset + 1] >> 4; - - redraw_zoom_tiles = 1; -} - -static inline void palette_update(INT32 offset) -{ - INT32 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (p >> 10) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -static void __fastcall tail2nose_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffe0000) == 0x400000) { - UINT16 *p = (UINT16*)DrvZoomRAM; - if (p[(address & 0x1ffff)/2] != data) { - p[(address & 0x1ffff)/2] = data; - graphics_ram_expand_one(address); - } - return; - } - - if ((address & 0xffff000) == 0x500000) { - K051316Write(0, (address & 0xffe)/2, data & 0xff); - return; - } - - if ((address & 0xfffffe0) == 0x510000) { - K051316WriteCtrl(0, (address & 0x1e)/2, data); - return; - } - - if ((address & 0xffff000) == 0xffe000) { - *((UINT16*)(DrvPalRAM + (address & 0xffe))) = data; - palette_update(address & 0xffe); - return; - } -} - -static void __fastcall tail2nose_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffe0000) == 0x400000) { - if (DrvZoomRAM[(address & 0x1ffff)^1] != data) { - DrvZoomRAM[(address & 0x1ffff)^1] = data; - graphics_ram_expand_one(address); - } - return; - } - - if ((address & 0xffff000) == 0x500000) { - K051316Write(0, (address & 0xffe)/2, data); - return; - } - - if ((address & 0xfffffe0) == 0x510000) { - K051316WriteCtrl(0, (address & 0x1e)/2, data); - return; - } - - if ((address & 0xffff000) == 0xffe000) { - DrvPalRAM[(address & 0xfff)^1] = data; - palette_update(address & 0xffe); - return; - } - - switch (address) - { - case 0xfff001: - { - static const INT32 banks[6] = { 0, 1, -1, -1, 2, 2 }; - - *char_bank = banks[data & 0x05]; - *video_enable = data & 0x10; - *pal_bank = (data & 0x20) ? 7 : 3; - } - - return; - - case 0xfff009: - *soundlatch = data; - ZetNmi(); - return; - } -} - -static UINT8 __fastcall tail2nose_main_read_byte(UINT32 address) -{ - if ((address & 0xffff000) == 0x500000) { - return K051316Read(0, (address & 0xffe)/2); - } - - switch (address) - { - case 0xfff000: - return DrvInputs[0] >> 8; - - case 0xfff001: - return DrvInputs[0]; - - case 0xfff004: - return DrvDips[0]; - - case 0xfff005: - return DrvDips[1]; - } - - return 0; -} - -static UINT16 __fastcall tail2nose_main_read_word(UINT32 address) -{ - if ((address & 0xffff000) == 0x500000) { - return K051316Read(0, (address & 0xffe)/2); - } - - switch (address) - { - case 0xfff000: - return DrvInputs[0]; - - case 0xfff004: - return (DrvDips[1] << 8) | (DrvDips[0] << 0); - } - - return 0; -} - -static void __fastcall tail2nose_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: - BurnYM2608Write(port & 0x03, data); - return; - } -} - -static UINT8 __fastcall tail2nose_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x07: - return *soundlatch; - } - - return 0; -} - -static void tail2noseFMIRQHandler(INT32, INT32 status) -{ - ZetSetIRQLine(0, (status & 1) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE ); -} - -static INT32 tail2noseSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 5000000; -} - -static double tail2noseGetTime() -{ - return (double)ZetTotalCycles() / 5000000; -} - -static void tail2nos_zoom_callback(INT32 *code, INT32 *color, INT32 */*flags*/) -{ - *code |= ((*color & 0x03) << 8); - *color = 0x20 + ((*color & 0x38) >> 3); -} - -static void bankswitch(UINT32, UINT32 data) -{ - if (ZetGetActive() == -1) return; // bypass crash on init - - DrvZ80Bank[0] = data & 1; - - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + 0x10000 + (data & 1) * 0x8000); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + 0x10000 + (data & 1) * 0x8000); -} - -static void DrvGfxExpand(UINT8 *s, INT32 len) -{ - for (INT32 i = len - 1; i >= 0; i--) { - INT32 d = s[i]; - s[i * 2 + 0] = d & 0xf; - s[i * 2 + 1] = d >> 4; - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM2608Reset(); - bankswitch(0,0); - ZetClose(); - - K051316Reset(); - - redraw_zoom_tiles = 1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x100000; - - DrvISndROM = Next; Next += 0x002000; - DrvSndROM = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(int); - - AllRam = Next; - - soundlatch = Next; Next += 0x000001; - char_bank = Next; Next += 0x000001; - video_enable = Next; Next += 0x000001; - pal_bank = Next; Next += 0x000001; - DrvZ80Bank = Next; Next += 0x000001; - - DrvSprRAM = Next; Next += 0x001000; - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x001000; - DrvZoomRAM = Next; Next += 0x020000; - DrvZoomRAMExp = Next; Next += 0x040000; - - DrvZ80RAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 4, 1)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0c0001, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0c0000, 6, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x010000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 12, 2)) return 1; - - if (BurnLoadRom(DrvSndROM, 13, 1)) return 1; - - if (BurnLoadRom(DrvISndROM, 0x80, 1)) return 1; - - for (INT32 i = 0; i < 0x80000; i+=4) { - BurnByteswap(DrvGfxROM1 + i + 1, 2); - } - - DrvGfxExpand(DrvGfxROM0, 0x100000); - DrvGfxExpand(DrvGfxROM1, 0x080000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KROM + 0x040000, 0x200000, 0x27ffff, MAP_ROM); - SekMapMemory(Drv68KROM + 0x0c0000, 0x2c0000, 0x2dffff, MAP_ROM); - SekMapMemory(DrvZoomRAM, 0x400000, 0x41ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0xff8000, 0xffbfff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0xffc000, 0xffcfff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0xffd000, 0xffdfff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xffe000, 0xffefff, MAP_ROM); - SekSetWriteWordHandler(0, tail2nose_main_write_word); - SekSetWriteByteHandler(0, tail2nose_main_write_byte); - SekSetReadWordHandler(0, tail2nose_main_read_word); - SekSetReadByteHandler(0, tail2nose_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x77ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x77ff, 2, DrvZ80ROM); - ZetMapArea(0x7800, 0x7fff, 0, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 1, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 2, DrvZ80RAM); - ZetSetOutHandler(tail2nose_sound_out); - ZetSetInHandler(tail2nose_sound_in); - - INT32 nSndROMLen = 0x20000; - BurnYM2608Init(8000000, DrvSndROM, &nSndROMLen, DrvISndROM, &tail2noseFMIRQHandler, tail2noseSynchroniseStream, tail2noseGetTime, 0); - AY8910SetPorts(0, NULL, NULL, NULL, bankswitch); // Really YM2608 - BurnTimerAttachZet(5000000); - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_1, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2608SetRoute(BURN_SND_YM2608_AY8910_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - ZetClose(); - - K051316Init(0, DrvZoomRAM, DrvZoomRAMExp, 0x3ff, tail2nos_zoom_callback, 4, 0); - K051316SetOffset(0, -89, -24); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetOpen(0); - BurnYM2608Exit(); - ZetClose(); - - K051316Exit(); - - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - UINT16 *ram = (UINT16*)DrvVidRAM; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - if (sx >= nScreenWidth) { - offs |= 0x3f; - continue; - } - - if (sy >= nScreenHeight) break; - - INT32 code = (ram[offs] & 0x1fff) + (*char_bank << 13); - INT32 color = (ram[offs] >> 13) + (*pal_bank << 4); - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 4, 0x0f, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x300 / 2; offs += 4) - { - INT32 sx = ram[offs + 1]; - if (sx >= 0x8000) sx -= 0x10000; - - INT32 sy = 0x10000 - ram[offs + 0]; - if (sy >= 0x8000) sy -= 0x10000; - - INT32 attr = ram[offs + 2]; - INT32 code = attr & 0x07ff; - INT32 color =((attr & 0xe000) >> 13) + 0x28; - INT32 flipx = attr & 0x1000; - INT32 flipy = attr & 0x0800; - - if (flipy) { - if (flipx) { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 16, 32, 0, sx+4, sy-9, color, 4, 0x0f, 0, DrvGfxROM1 + (code * 0x200)); - } else { - RenderCustomTile_Mask_FlipY_Clip(pTransDraw, 16, 32, 0, sx+4, sy-9, color, 4, 0x0f, 0, DrvGfxROM1 + (code * 0x200)); - } - } else { - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(pTransDraw, 16, 32, 0, sx+4, sy-9, color, 4, 0x0f, 0, DrvGfxROM1 + (code * 0x200)); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 16, 32, 0, sx+4, sy-9, color, 4, 0x0f, 0, DrvGfxROM1 + (code * 0x200)); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_update(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (*video_enable) - { - K051316WrapEnable(0, 1); - - if (redraw_zoom_tiles) { - K051316RedrawTiles(0); - redraw_zoom_tiles = 0; - } - - K051316_zoom_draw(0, 0 | K051316_16BIT); - draw_sprites(); - draw_layer(); - } else { - BurnTransferClear(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 1 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - } - - SekNewFrame(); - ZetNewFrame(); - - INT32 nSegment; - INT32 nInterleave = 100; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 10000000 / 60, 5000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - - BurnTimerUpdate(SekTotalCycles() / 2); - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2608Update(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029730; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) - { - SekScan(nAction); - ZetScan(nAction); - - K051316Scan(nAction); - BurnYM2608Scan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(0, DrvZ80Bank[0]); - ZetClose(); - - DrvRecalc = 1; - - for (INT32 i = 0; i < 0x20000; i+=2) { - graphics_ram_expand_one(i); - } - } - - return 0; -} - -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; - -static struct BurnRomInfo Ym2608RomDesc[] = { -#if !defined (ROM_VERIFY) - { "ym2608_adpcm_rom.bin", 0x002000, 0x23c9e0d8, BRF_ESS | BRF_PRG | BRF_BIOS }, -#else - { "", 0x000000, 0x00000000, BRF_ESS | BRF_PRG | BRF_BIOS }, -#endif -}; - - -// Tail to Nose - Great Championship - -static struct BurnRomInfo tail2nosRomDesc[] = { - { "v4", 0x10000, 0x1d4240c2, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "v7", 0x10000, 0x0fb70066, 1 | BRF_PRG | BRF_ESS }, // 1 - { "v3", 0x10000, 0xe2e0abad, 1 | BRF_PRG | BRF_ESS }, // 2 - { "v6", 0x10000, 0x069817a7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "a23", 0x80000, 0xd851cf04, 1 | BRF_PRG | BRF_ESS }, // 4 - { "v5", 0x10000, 0xa9fe15a1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "v8", 0x10000, 0x4fb6a43e, 1 | BRF_PRG | BRF_ESS }, // 6 - - { "v2", 0x08000, 0x920d8920, 2 | BRF_PRG | BRF_ESS }, // 7 Z80 Code - { "v1", 0x10000, 0xbf35c1a4, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "a24", 0x80000, 0xb1e9de43, 3 | BRF_GRA }, // 9 Foreground Tiles - { "o1s", 0x40000, 0xe27a8eb4, 3 | BRF_GRA }, // 10 - - { "oj1", 0x40000, 0x39c36b35, 4 | BRF_GRA }, // 11 Sprites - { "oj2", 0x40000, 0x77ccaea2, 4 | BRF_GRA }, // 12 - - { "osb", 0x20000, 0xd49ab2f5, 5 | BRF_GRA }, // 13 Samples -}; - -STDROMPICKEXT(tail2nos, tail2nos, Ym2608) -STD_ROM_FN(tail2nos) - -struct BurnDriver BurnDrvTail2nos = { - "tail2nos", NULL, "ym2608", NULL, "1989", - "Tail to Nose - Great Championship\0", NULL, "V-System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, tail2nosRomInfo, tail2nosRomName, NULL, NULL, Tail2nosInputInfo, Tail2nosDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Super Formula (Japan) - -static struct BurnRomInfo sformulaRomDesc[] = { - { "ic129.4", 0x10000, 0x672bf690, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ic130.7", 0x10000, 0x73f0c91c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "v3", 0x10000, 0xe2e0abad, 1 | BRF_PRG | BRF_ESS }, // 2 - { "v6", 0x10000, 0x069817a7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "a23", 0x80000, 0xd851cf04, 1 | BRF_PRG | BRF_ESS }, // 4 - { "v5", 0x10000, 0xa9fe15a1, 1 | BRF_PRG | BRF_ESS }, // 5 - { "v8", 0x10000, 0x4fb6a43e, 1 | BRF_PRG | BRF_ESS }, // 6 - - { "v2", 0x08000, 0x920d8920, 2 | BRF_PRG | BRF_ESS }, // 7 Z80 Code - { "v1", 0x10000, 0xbf35c1a4, 2 | BRF_PRG | BRF_ESS }, // 8 - - { "a24", 0x80000, 0xb1e9de43, 3 | BRF_GRA }, // 9 Foreground Tiles - { "o1s", 0x40000, 0xe27a8eb4, 3 | BRF_GRA }, // 10 - - { "oj1", 0x40000, 0x39c36b35, 4 | BRF_GRA }, // 11 Sprites - { "oj2", 0x40000, 0x77ccaea2, 4 | BRF_GRA }, // 12 - - { "osb", 0x20000, 0xd49ab2f5, 5 | BRF_GRA }, // 13 Samples -}; - -STDROMPICKEXT(sformula, sformula, Ym2608) -STD_ROM_FN(sformula) - -struct BurnDriver BurnDrvSformula = { - "sformula", "tail2nos", "ym2608", NULL, "1989", - "Super Formula (Japan)\0", NULL, "V-System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, sformulaRomInfo, sformulaRomName, NULL, NULL, Tail2nosInputInfo, Tail2nosDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_tbowl.cpp b/jan/src/burn/drv/pre90s/d_tbowl.cpp deleted file mode 100644 index 27dd54135..000000000 --- a/jan/src/burn/drv/pre90s/d_tbowl.cpp +++ /dev/null @@ -1,882 +0,0 @@ -// FB Alpha Tecmo Bowl driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "msm5205.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvBgRAM2; -static UINT8 *DrvBgRAM; -static UINT8 *DrvTxRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *DrvBank; -static UINT8 *DrvScroll; - -static INT32 adpcm_data[2]; -static INT32 adpcm_pos[2]; -static INT32 adpcm_end[2]; - -static UINT8 *soundlatch; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[5]; - -static struct BurnInputInfo TbowlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy5 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 7, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 3, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 2, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 0, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy5 + 3, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 7, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 3, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 2, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 0, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service (General)", BIT_DIGITAL, DrvJoy5 + 4, "service" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy2 + 6, "service" }, - {"Service 3", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Service 4", BIT_DIGITAL, DrvJoy4 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Tbowl) - -static struct BurnDIPInfo TbowlDIPList[]= -{ - {0x26, 0xff, 0xff, 0xbf, NULL }, - {0x27, 0xff, 0xff, 0xff, NULL }, - {0x28, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x26, 0x01, 0x07, 0x00, "8 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x01, "7 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x02, "6 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x03, "5 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 31, "Time (Players)" }, - {0x26, 0x01, 0xf8, 0x00, "7:00" }, - {0x26, 0x01, 0xf8, 0x08, "6:00" }, - {0x26, 0x01, 0xf8, 0x10, "5:00" }, - {0x26, 0x01, 0xf8, 0x18, "4:30" }, - {0x26, 0x01, 0xf8, 0x20, "3:40" }, - {0x26, 0x01, 0xf8, 0x28, "3:20" }, - {0x26, 0x01, 0xf8, 0x30, "3:00" }, - {0x26, 0x01, 0xf8, 0x38, "2:50" }, - {0x26, 0x01, 0xf8, 0x40, "2:40" }, - {0x26, 0x01, 0xf8, 0x48, "2:30" }, - {0x26, 0x01, 0xf8, 0x50, "2:20" }, - {0x26, 0x01, 0xf8, 0x58, "2:10" }, - {0x26, 0x01, 0xf8, 0x60, "2:00" }, - {0x26, 0x01, 0xf8, 0x68, "1:55" }, - {0x26, 0x01, 0xf8, 0x70, "1:50" }, - {0x26, 0x01, 0xf8, 0x78, "1:45" }, - {0x26, 0x01, 0xf8, 0x80, "1:40" }, - {0x26, 0x01, 0xf8, 0x88, "1:35" }, - {0x26, 0x01, 0xf8, 0x90, "1:25" }, - {0x26, 0x01, 0xf8, 0x98, "1:20" }, - {0x26, 0x01, 0xf8, 0xa0, "1:15" }, - {0x26, 0x01, 0xf8, 0xa8, "1:10" }, - {0x26, 0x01, 0xf8, 0xb0, "1:05" }, - {0x26, 0x01, 0xf8, 0xb8, "1:00" }, - {0x26, 0x01, 0xf8, 0xc0, "0:55" }, - {0x26, 0x01, 0xf8, 0xc8, "0:50" }, - {0x26, 0x01, 0xf8, 0xd0, "0:45" }, - {0x26, 0x01, 0xf8, 0xd8, "0:40" }, - {0x26, 0x01, 0xf8, 0xe0, "0:35" }, - {0x26, 0x01, 0xf8, 0xe8, "0:30" }, - {0x26, 0x01, 0xf8, 0xf0, "0:25" }, - - {0 , 0xfe, 0 , 4, "Difficulty (unused ?)"}, - {0x27, 0x01, 0x03, 0x00, "0x00" }, - {0x27, 0x01, 0x03, 0x01, "0x01" }, - {0x27, 0x01, 0x03, 0x02, "0x02" }, - {0x27, 0x01, 0x03, 0x03, "0x03" }, - - {0 , 0xfe, 0 , 4, "Extra Time (Players)" }, - {0x27, 0x01, 0x0c, 0x00, "0:30" }, - {0x27, 0x01, 0x0c, 0x04, "0:20" }, - {0x27, 0x01, 0x0c, 0x08, "0:10" }, - {0x27, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Timer Speed" }, - {0x27, 0x01, 0x30, 0x00, "56/60" }, - {0x27, 0x01, 0x30, 0x10, "51/60" }, - {0x27, 0x01, 0x30, 0x30, "47/60" }, - {0x27, 0x01, 0x30, 0x20, "42/60" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x27, 0x01, 0x40, 0x00, "Off" }, - {0x27, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Hi-Score Reset" }, - {0x27, 0x01, 0x80, 0x00, "Off" }, - {0x27, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Time (Quarter)" }, - {0x28, 0x01, 0x03, 0x00, "8:00" }, - {0x28, 0x01, 0x03, 0x01, "5:00" }, - {0x28, 0x01, 0x03, 0x03, "4:00" }, - {0x28, 0x01, 0x03, 0x02, "3:00" }, -}; - -STDDIPINFO(Tbowl) - -static void bankswitch(INT32 n, INT32 data) -{ - DrvBank[n] = data; - - INT32 bank = 0x10000 + (data & 0xf8) * 256; - - ZetMapMemory((n ? DrvZ80ROM1 : DrvZ80ROM0) + bank, 0xf000, 0xf7ff, MAP_ROM); -} - -static void __fastcall tbowl_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xfc00: - bankswitch(0, data); - return; - - case 0xfc03: // coin counter - return; - - case 0xfc0d: - *soundlatch = data; - ZetClose(); - ZetOpen(2); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - } - - if ((address & 0xfff8) == 0xfc10) { - DrvScroll[address & 0x07] = data; - return; - } -} - -static UINT8 __fastcall tbowl_main_read(UINT16 address) -{ - switch (address) - { - case 0xfc00: - return DrvInputs[0]; - - case 0xfc01: - return DrvInputs[1]; - - case 0xfc02: - return DrvInputs[2]; - - case 0xfc03: - return DrvInputs[3]; - - case 0xfc07: - return DrvInputs[4]; - - case 0xfc08: - return DrvDips[0]; - - case 0xfc09: - return DrvDips[1]; - - case 0xfc0a: - return DrvDips[2]; - } - - return 0; -} - -static void __fastcall tbowl_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xfc00: - bankswitch(1, data); - return; - - case 0xfc02: - ZetClose(); - ZetOpen(0); - ZetNmi(); - ZetClose(); - ZetOpen(1); - return; - } -} - -static void __fastcall tbowl_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xd000: - case 0xd001: - BurnYM3812Write(0, address & 1, data); - return; - - case 0xd800: - case 0xd801: - BurnYM3812Write(1, address & 1, data); - return; - - case 0xe000: - case 0xe001: - adpcm_end[address & 1] = (data + 1) << 8; - return; - - case 0xe002: - case 0xe003: - adpcm_pos[address & 1] = data << 8; - MSM5205ResetWrite(address & 1, 0); - return; - - case 0xe004: - case 0xe005: - data &= 0x7f; - MSM5205SetRoute(address & 1, (double)data / 0x7f, BURN_SND_ROUTE_BOTH); - return; - } -} - -static UINT8 __fastcall tbowl_sound_read(UINT16 address) -{ - if (address == 0xe010) return *soundlatch; - - return 0; -} - -static void tbowl_adpcm_int(INT32 num) -{ - if (adpcm_pos[num] >= adpcm_end[num] || adpcm_pos[num] >= 0x10000) - { - MSM5205ResetWrite(num, 1); - } - else if (adpcm_data[num] != -1) - { - MSM5205DataWrite(num, adpcm_data[num] & 0x0f); - adpcm_data[num] = -1; - } - else - { - UINT8 *ROM = DrvSndROM + 0x10000 * num; - - adpcm_data[num] = ROM[adpcm_pos[num]++ & 0xffff]; - MSM5205DataWrite(num, adpcm_data[num] >> 4); - } -} - -static void tbowl_vclk_0() -{ - tbowl_adpcm_int(0); -} - -static void tbowl_vclk_1() -{ - tbowl_adpcm_int(1); -} - -static void DrvFMIRQHandler(int, INT32 nStatus) -{ - ZetSetIRQLine(0, ((nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE)); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - bankswitch(0, 0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - bankswitch(1, 0); - ZetClose(); - - ZetOpen(2); - ZetReset(); - BurnYM3812Reset(); - MSM5205Reset(); - ZetClose(); - - adpcm_pos[0] = adpcm_pos[1] = 0; - adpcm_end[0] = adpcm_end[1] = 0; - adpcm_data[0] = adpcm_data[1] = -1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x020000; - DrvZ80ROM2 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROM3 = Next; Next += 0x100000; - - DrvSndROM = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x02000; - DrvZ80RAM1 = Next; Next += 0x01800; - DrvZ80RAM2 = Next; Next += 0x00800; - - DrvBgRAM2 = Next; Next += 0x02000; - DrvBgRAM = Next; Next += 0x02000; - DrvTxRAM = Next; Next += 0x01000; - DrvShareRAM = Next; Next += 0x00400; - - DrvPalRAM = Next; Next += 0x01000; - DrvSprRAM = Next; Next += 0x00800; - - DrvBank = Next; Next += 0x00002; - DrvScroll = Next; Next += 0x00008; - - soundlatch = Next; Next += 0x00001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - static INT32 Planes[4] = { STEP4(0,1) }; - static INT32 XOffs[16] = { STEP8(0,4), STEP8(256,4) }; - static INT32 YOffs[16] = { STEP8(0,32), STEP8(512,32) }; - - memcpy (tmp, DrvGfxROM0, 0x10000); - - GfxDecode(0x0800, 4, 8, 8, Planes, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Planes, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x4000, 4, 8, 8, Planes, XOffs, YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x10000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x40001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 14, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x60001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40001, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20001, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 21, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 22, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 23, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x10000, 24, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x9fff, MAP_RAM); - ZetMapMemory(DrvBgRAM2, 0xa000, 0xbfff, MAP_RAM); - ZetMapMemory(DrvBgRAM, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvTxRAM, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xf800, 0xfbff, MAP_RAM); - ZetSetWriteHandler(tbowl_main_write); - ZetSetReadHandler(tbowl_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xf800, 0xfbff, MAP_RAM); - ZetSetWriteHandler(tbowl_sub_write); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xc7ff, MAP_RAM); - ZetSetWriteHandler(tbowl_sound_write); - ZetSetReadHandler(tbowl_sound_read); - ZetClose(); - - BurnYM3812Init(2, 4000000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM3812SetRoute(1, BURN_SND_YM3812_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, DrvSynchroniseStream, 384000, tbowl_vclk_0, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - MSM5205Init(1, DrvSynchroniseStream, 384000, tbowl_vclk_1, MSM5205_S48_4B, 1); - MSM5205SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM5205Exit(); - BurnYM3812Exit(); - - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x1000 / 2; i++) { - UINT16 d = (p[i] << 8) | (p[i] >> 8); - - g = (d >> 0) & 0x0f; - r = (d >> 4) & 0x0f; - b = (d >> 8) & 0x0f; - - DrvPalette[i] = BurnHighCol((r << 4) | r, (g << 4) | g, (b << 4) | b, 0); - } -} - -static void draw_background_layer(UINT8 *src, INT32 xr, INT32 coloff, UINT8 *scroll) -{ - INT32 scrollx = ((scroll[1] << 8) | scroll[0]) & 0x7ff; - INT32 scrolly = ((scroll[3] << 8) | scroll[2]) & 0x1ff; - - for (INT32 offs = 0; offs < 128 * 32; offs++) { - INT32 sx = (offs & 0x7f) << 4; - INT32 sy = (offs >> 7) << 4; - - sx -= scrollx; - if (sx < -15) sx += 0x800; - sy -= scrolly + 16; - if (sy < -15) sy += 0x200; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = src[offs + 0x1000]; - INT32 code = src[offs] + ((attr & 0x0f) << 8); - INT32 color= attr >> 4; - - if (!code) continue; - - Render16x16Tile_Mask_Clip(pTransDraw, code ^ xr, sx, sy, color, 4, 0, coloff, DrvGfxROM1); - } -} - -static void draw_text_layer() -{ - for (INT32 offs = 0x80; offs < 0x780; offs++) { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - INT32 attr = DrvTxRAM[offs + 0x800]; - INT32 code = DrvTxRAM[offs] | ((attr & 0x07) << 8); - INT32 color= attr >> 4; - - if (!code) continue; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x100, DrvGfxROM0); - } -} - -static inline INT32 calc_sprite_offset(INT32 code, INT32 x, INT32 y) -{ - INT32 ofst = ((y & 4) << 3) | ((x & 4) << 2) | ((y & 2) << 2) | ((x & 2) << 1) | ((y & 1) << 1) | (x & 1); - return (ofst + code) & 0x3fff; -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x800; offs+=8) - { - if (DrvSprRAM[offs+0] & 0x80) - { - INT32 code = DrvSprRAM[offs + 2] | (DrvSprRAM[offs + 1] << 8); - INT32 color = DrvSprRAM[offs + 3] & 0x1f; - INT32 sizex = 1 << ((DrvSprRAM[offs] & 0x03)); - INT32 sizey = 1 << ((DrvSprRAM[offs] & 0x0c) >> 2); - - INT32 flipx = DrvSprRAM[offs] & 0x20; - INT32 xpos = DrvSprRAM[offs + 6] | ((DrvSprRAM[offs + 4] & 0x03) << 8); - INT32 ypos = DrvSprRAM[offs + 5] | ((DrvSprRAM[offs + 4] & 0x10) << 4); - - for (INT32 y = 0; y < sizey; y++) - { - for (INT32 x = 0; x < sizex; x++) - { - INT32 sx = xpos + 8 * (flipx ? (sizex - 1 - x) : x); - INT32 sy = (ypos + 8 * y) - 16; - - INT32 tile = calc_sprite_offset(code, x, y); - - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, tile, sx, sy, color, 4, 0, 0, DrvGfxROM2); - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, tile, sx, sy - 0x200, color, 4, 0, 0, DrvGfxROM2); - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, tile, sx - 0x400, sy, color, 4, 0, 0, DrvGfxROM2); - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, tile, sx - 0x400, sy - 0x200, color, 4, 0, 0, DrvGfxROM2); - } - else - { - Render8x8Tile_Mask_Clip(pTransDraw, tile, sx, sy, color, 4, 0, 0, DrvGfxROM2); - Render8x8Tile_Mask_Clip(pTransDraw, tile, sx, sy - 0x200, color, 4, 0, 0, DrvGfxROM2); - Render8x8Tile_Mask_Clip(pTransDraw, tile, sx - 0x400, sy, color, 4, 0, 0, DrvGfxROM2); - Render8x8Tile_Mask_Clip(pTransDraw, tile, sx - 0x400, sy - 0x200, color, 4, 0, 0, DrvGfxROM2); - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x0100; - } - - draw_background_layer(DrvBgRAM, 0x000, 0x300, DrvScroll + 4); - draw_sprites(); - draw_background_layer(DrvBgRAM2, 0x400, 0x200, DrvScroll + 0); - draw_text_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - ZetNewFrame(); - - INT32 nSegment; - INT32 nInterleave = MSM5205CalcInterleave(0, 4000000); - INT32 nTotalCycles[3] = { 8000000 / 60, 8000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i); - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave-1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - nSegment = (nTotalCycles[1] - nCyclesDone[1]) / (nInterleave - i); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment); - if (i == (nInterleave-1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(2); - BurnTimerUpdateYM3812((i + 1) * (nTotalCycles[2] / nInterleave)); - MSM5205Update(); - ZetClose(); - } - - ZetOpen(2); - - BurnTimerEndFrameYM3812(nTotalCycles[2]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - MSM5205Render(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - BurnYM3812Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - - SCAN_VAR(adpcm_data); - SCAN_VAR(adpcm_pos); - SCAN_VAR(adpcm_end); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(0, DrvBank[0]); - ZetClose(); - - ZetOpen(1); - bankswitch(1, DrvBank[1]); - ZetClose(); - } - - return 0; -} - - -// Tecmo Bowl (World?) - -static struct BurnRomInfo tbowlRomDesc[] = { - { "4.11b", 0x08000, 0xdb8a4f5d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "6206b.5", 0x10000, 0x133c5c11, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "6206c.24", 0x10000, 0x040c8138, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - { "6206c.25", 0x10000, 0x92c3cef5, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "6206a.1", 0x08000, 0x4370207b, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "14.13l", 0x08000, 0xf9cf60b9, 4 | BRF_GRA }, // 5 Characters - { "15.15l", 0x08000, 0xa23f6c53, 4 | BRF_GRA }, // 6 - - { "6206b.6", 0x10000, 0xb9615ffa, 5 | BRF_GRA }, // 7 Tiles - { "6206b.8", 0x10000, 0x6389c719, 5 | BRF_GRA }, // 8 - { "6206b.7", 0x10000, 0xd139c397, 5 | BRF_GRA }, // 9 - { "6206b.9", 0x10000, 0x975ded4c, 5 | BRF_GRA }, // 10 - { "6206b.10", 0x10000, 0x9b4fa82e, 5 | BRF_GRA }, // 11 - { "6206b.12", 0x10000, 0x7d0030f6, 5 | BRF_GRA }, // 12 - { "6206b.11", 0x10000, 0x06bf07bb, 5 | BRF_GRA }, // 13 - { "6206b.13", 0x10000, 0x4ad72c16, 5 | BRF_GRA }, // 14 - - { "6206c.16", 0x10000, 0x1a2fb925, 6 | BRF_GRA }, // 15 Sprites - { "6206c.20", 0x10000, 0x70bb38a3, 6 | BRF_GRA }, // 16 - { "6206c.17", 0x10000, 0xde16bc10, 6 | BRF_GRA }, // 17 - { "6206c.21", 0x10000, 0x41b2a910, 6 | BRF_GRA }, // 18 - { "6206c.18", 0x10000, 0x0684e188, 6 | BRF_GRA }, // 19 - { "6206c.22", 0x10000, 0xcf660ebc, 6 | BRF_GRA }, // 20 - { "6206c.19", 0x10000, 0x71795604, 6 | BRF_GRA }, // 21 - { "6206c.23", 0x10000, 0x97fba168, 6 | BRF_GRA }, // 22 - - { "6206a.3", 0x10000, 0x3aa24744, 7 | BRF_SND }, // 23 Samples - { "6206a.2", 0x10000, 0x1e9e5936, 7 | BRF_SND }, // 24 -}; - -STD_ROM_PICK(tbowl) -STD_ROM_FN(tbowl) - -struct BurnDriver BurnDrvTbowl = { - "tbowl", NULL, NULL, NULL, "1987", - "Tecmo Bowl (World?)\0", NULL, "Tecmo", "hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, tbowlRomInfo, tbowlRomName, NULL, NULL, TbowlInputInfo, TbowlDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 512, 224, 16, 9 -}; - - -// Tecmo Bowl (Japan) - -static struct BurnRomInfo tbowljRomDesc[] = { - { "6206b.4", 0x08000, 0x7ed3eff7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "6206b.5", 0x10000, 0x133c5c11, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "6206c.24", 0x10000, 0x040c8138, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - { "6206c.25", 0x10000, 0x92c3cef5, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "6206a.1", 0x08000, 0x4370207b, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "6206b.14", 0x08000, 0xcf99d0bf, 4 | BRF_GRA }, // 5 Characters - { "6206b.15", 0x08000, 0xd69248cf, 4 | BRF_GRA }, // 6 - - { "6206b.6", 0x10000, 0xb9615ffa, 5 | BRF_GRA }, // 7 Tiles - { "6206b.8", 0x10000, 0x6389c719, 5 | BRF_GRA }, // 8 - { "6206b.7", 0x10000, 0xd139c397, 5 | BRF_GRA }, // 9 - { "6206b.9", 0x10000, 0x975ded4c, 5 | BRF_GRA }, // 10 - { "6206b.10", 0x10000, 0x9b4fa82e, 5 | BRF_GRA }, // 11 - { "6206b.12", 0x10000, 0x7d0030f6, 5 | BRF_GRA }, // 12 - { "6206b.11", 0x10000, 0x06bf07bb, 5 | BRF_GRA }, // 13 - { "6206b.13", 0x10000, 0x4ad72c16, 5 | BRF_GRA }, // 14 - - { "6206c.16", 0x10000, 0x1a2fb925, 6 | BRF_GRA }, // 15 Sprites - { "6206c.20", 0x10000, 0x70bb38a3, 6 | BRF_GRA }, // 16 - { "6206c.17", 0x10000, 0xde16bc10, 6 | BRF_GRA }, // 17 - { "6206c.21", 0x10000, 0x41b2a910, 6 | BRF_GRA }, // 18 - { "6206c.18", 0x10000, 0x0684e188, 6 | BRF_GRA }, // 19 - { "6206c.22", 0x10000, 0xcf660ebc, 6 | BRF_GRA }, // 20 - { "6206c.19", 0x10000, 0x71795604, 6 | BRF_GRA }, // 21 - { "6206c.23", 0x10000, 0x97fba168, 6 | BRF_GRA }, // 22 - - { "6206a.3", 0x10000, 0x3aa24744, 7 | BRF_SND }, // 23 Samples - { "6206a.2", 0x10000, 0x1e9e5936, 7 | BRF_SND }, // 24 -}; - -STD_ROM_PICK(tbowlj) -STD_ROM_FN(tbowlj) - -struct BurnDriver BurnDrvTbowlj = { - "tbowlj", "tbowl", NULL, NULL, "1987", - "Tecmo Bowl (Japan)\0", NULL, "Tecmo", "hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, tbowljRomInfo, tbowljRomName, NULL, NULL, TbowlInputInfo, TbowlDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 512, 224, 16, 9 -}; diff --git a/jan/src/burn/drv/pre90s/d_tecmo.cpp b/jan/src/burn/drv/pre90s/d_tecmo.cpp deleted file mode 100644 index dc20928cf..000000000 --- a/jan/src/burn/drv/pre90s/d_tecmo.cpp +++ /dev/null @@ -1,1741 +0,0 @@ -// FB Alpha Tecmo driver Module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "msm5205.h" - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvJoy6[8]; -static UINT8 DrvJoy11[8]; -static UINT8 DrvReset; -static UINT8 DrvInputs[11]; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvTextRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvForeRAM; -static UINT8 *DrvBackRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 *DrvBgScroll; -static UINT16 *DrvFgScroll; - -static INT32 tecmo_video_type; - -static UINT32 adpcm_pos; -static UINT32 adpcm_end; -static UINT32 adpcm_size; -static INT32 adpcm_data; -static UINT8 DrvHasADPCM; - -static UINT32 DrvZ80Bank; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 DrvEnableNmi; - -static struct BurnInputInfo RygarInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy5 + 3, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy5 + 1, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 1, "p1 right" }, - {"P1 Down", BIT_DIGITAL , DrvJoy1 + 2, "p1 down", }, - {"P1 Up", BIT_DIGITAL , DrvJoy1 + 3, "p1 up", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 1, "p1 fire 2"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy5 + 2, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy5 + 0, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 1, "p2 right" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down", }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy4 + 0, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy4 + 1, "p2 fire 2"}, - - {"Service", BIT_DIGITAL , DrvJoy2 + 2, "diag" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvInputs + 6, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvInputs + 7, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvInputs + 8, "dip" }, - {"Dip 4", BIT_DIPSWITCH, DrvInputs + 9, "dip" }, -}; - -STDINPUTINFO(Rygar) - -static struct BurnInputInfo BackfirtInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy6 + 2, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy6 + 1, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 1, "p1 right" }, - {"P1 Down", BIT_DIGITAL , DrvJoy1 + 2, "p1 down", }, - {"P1 Up", BIT_DIGITAL , DrvJoy1 + 3, "p1 up", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 1, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy2 + 2, "p1 fire 3"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy6 + 3, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy6 + 0, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 1, "p2 right" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down", }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy4 + 0, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy4 + 1, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy4 + 2, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvInputs + 6, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvInputs + 7, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvInputs + 8, "dip" }, - {"Dip 4", BIT_DIPSWITCH, DrvInputs + 9, "dip" }, -}; - -STDINPUTINFO(Backfirt) - -static struct BurnInputInfo GeminiInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy6 + 2, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy6 + 0, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 1, "p1 right" }, - {"P1 Down", BIT_DIGITAL , DrvJoy1 + 2, "p1 down", }, - {"P1 Up", BIT_DIGITAL , DrvJoy1 + 3, "p1 up", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 1, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 0, "p1 fire 2"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy6 + 3, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy6 + 1, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 1, "p2 right" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down", }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy4 + 1, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy4 + 0, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvInputs + 6, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvInputs + 7, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvInputs + 8, "dip" }, - {"Dip 4", BIT_DIPSWITCH, DrvInputs + 9, "dip" }, -}; - -STDINPUTINFO(Gemini) - -static struct BurnInputInfo SilkwormInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy11 + 2, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy11 + 0, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 1, "p1 right" }, - {"P1 Down", BIT_DIGITAL , DrvJoy1 + 2, "p1 down", }, - {"P1 Up", BIT_DIGITAL , DrvJoy1 + 3, "p1 up", }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 1, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 0, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy2 + 2, "p1 fire 3"}, - - {"P2 Coin" , BIT_DIGITAL , DrvJoy11 + 3, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy11 + 1, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 1, "p2 right" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down", }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up", }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy4 + 1, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy4 + 0, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy4 + 2, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvInputs + 6, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvInputs + 7, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvInputs + 8, "dip" }, - {"Dip 4", BIT_DIPSWITCH, DrvInputs + 9, "dip" }, - -}; - -STDINPUTINFO(Silkworm) - -static struct BurnDIPInfo RygarDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0x12, 0xfe, 0, 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x01, "2C 1C" }, - {0x12, 0x01, 0x03, 0x00, "1C 1C" }, - {0x12, 0x01, 0x03, 0x02, "1C 2C" }, - {0x12, 0x01, 0x03, 0x03, "1C 3C" }, - - {0x12, 0xfe, 0, 4, "Coin B" }, - {0x12, 0x01, 0x0C, 0x04, "2C 1C" }, - {0x12, 0x01, 0x0C, 0x00, "1C 1C" }, - {0x12, 0x01, 0x0C, 0x08, "1C 2C" }, - {0x12, 0x01, 0x0C, 0x0C, "1C 3C" }, - - {0x13, 0xfe, 0, 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x00, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x02, "5" }, - - {0x13, 0xfe, 0, 2, "Cabinet" }, - {0x13, 0x01, 0x04, 0x04, "Upright" }, - {0x13, 0x01, 0x04, 0x00, "Cocktail" }, - - {0x14, 0xfe, 0, 4, "Bonus Life" }, - {0x14, 0x01, 0x03, 0x00, "50000 200000 500000" }, - {0x14, 0x01, 0x03, 0x01, "100000 300000 600000" }, - {0x14, 0x01, 0x03, 0x02, "200000 500000" }, - {0x14, 0x01, 0x03, 0x03, "100000" }, - - {0x15, 0xfe, 0, 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x00, "Easy" }, - {0x15, 0x01, 0x03, 0x01, "Normal" }, - {0x15, 0x01, 0x03, 0x02, "Hard" }, - {0x15, 0x01, 0x03, 0x03, "Hardest" }, - - {0x15, 0xfe, 0, 2, "2P Can Start Anytime" }, - {0x15, 0x01, 0x04, 0x00, "No" }, - {0x15, 0x01, 0x04, 0x04, "Yes" }, - - {0x15, 0xfe, 0, 2, "Allow Continue" }, - {0x15, 0x01, 0x08, 0x00, "No" }, - {0x15, 0x01, 0x08, 0x08, "Yes" }, -}; - -STDDIPINFO(Rygar) - -static struct BurnDIPInfo GeminiDIPList[]= -{ - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0x11, 0xfe, 0, 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x06, "2C 1C" }, - {0x11, 0x01, 0x07, 0x00, "1C 1C" }, - {0x11, 0x01, 0x07, 0x07, "2C 3C" }, - {0x11, 0x01, 0x07, 0x01, "1C 2C" }, - {0x11, 0x01, 0x07, 0x02, "1C 3C" }, - {0x11, 0x01, 0x07, 0x03, "1C 4C" }, - {0x11, 0x01, 0x07, 0x04, "1C 5C" }, - {0x11, 0x01, 0x07, 0x05, "1C 6C" }, - - {0x11, 0xfe, 0, 2, "Final Round Continuation" }, - {0x11, 0x01, 0x08, 0x00, "Round 6" }, - {0x11, 0x01, 0x08, 0x08, "Round 7" }, - - {0x12, 0xfe, 0, 8, "Coin B" }, - {0x12, 0x01, 0x07, 0x06, "2C 1C" }, - {0x12, 0x01, 0x07, 0x00, "1C 1C" }, - {0x12, 0x01, 0x07, 0x07, "2C 3C" }, - {0x12, 0x01, 0x07, 0x01, "1C 2C" }, - {0x12, 0x01, 0x07, 0x02, "1C 3C" }, - {0x12, 0x01, 0x07, 0x03, "1C 4C" }, - {0x12, 0x01, 0x07, 0x04, "1C 5C" }, - {0x12, 0x01, 0x07, 0x05, "1C 6C" }, - - {0x12, 0xfe, 0, 2, "Buy in During Final Round" }, - {0x12, 0x01, 0x08, 0x00, "No" }, - {0x12, 0x01, 0x08, 0x08, "Yes" }, - - {0x13, 0xfe, 0, 4, "Lives" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x00, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x02, "5" }, - - {0x13, 0xfe, 0, 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x00, "Easy" }, - {0x13, 0x01, 0x0c, 0x04, "Normal" }, - {0x13, 0x01, 0x0c, 0x08, "Hard" }, - {0x13, 0x01, 0x0c, 0x0c, "Hardest" }, - - {0x14, 0xfe, 0, 8, "Bonus Life" }, - {0x14, 0x01, 0x07, 0x00, "50000 200000" }, - {0x14, 0x01, 0x07, 0x01, "50000 300000" }, - {0x14, 0x01, 0x07, 0x02, "100000 500000" }, - {0x14, 0x01, 0x07, 0x03, "50000" }, - {0x14, 0x01, 0x07, 0x04, "100000" }, - {0x14, 0x01, 0x07, 0x05, "200000" }, - {0x14, 0x01, 0x07, 0x06, "300000" }, - {0x14, 0x01, 0x07, 0x07, "None" }, - - {0x14, 0xfe, 0, 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Gemini) - -static struct BurnDIPInfo SilkwormDIPList[]= -{ - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0x13, 0xfe, 0, 4, "Coin A" }, - {0x13, 0x01, 0x3, 0x01, "2C 1C" }, - {0x13, 0x01, 0x3, 0x00, "1C 1C" }, - {0x13, 0x01, 0x3, 0x02, "1C 2C" }, - {0x13, 0x01, 0x3, 0x03, "1C 3C" }, - - {0x13, 0xfe, 0, 4, "Coin B" }, - {0x13, 0x01, 0xC, 0x04, "2C 1C" }, - {0x13, 0x01, 0xC, 0x00, "1C 1C" }, - {0x13, 0x01, 0xC, 0x08, "1C 2C" }, - {0x13, 0x01, 0xC, 0x0C, "1C 3C" }, - - {0x14, 0xfe, 0, 4 , "Lives" }, - {0x14, 0x01, 0x3, 0x03, "2" }, - {0x14, 0x01, 0x3, 0x00, "3" }, - {0x14, 0x01, 0x3, 0x01, "4" }, - {0x14, 0x01, 0x3, 0x02, "5" }, - - {0x14, 0xfe, 0, 2 , "Demo Sounds" }, - {0x14, 0x01, 0x8, 0x00, "Off" }, - {0x14, 0x01, 0x8, 0x08, "On" }, - - {0x15, 0xfe, 0, 8, "Bonus Life" }, - {0x15, 0x01, 0x7, 0x00, "50000 200000 500000" }, - {0x15, 0x01, 0x7, 0x01, "100000 300000 800000" }, - {0x15, 0x01, 0x7, 0x02, "50000 200000" }, - {0x15, 0x01, 0x7, 0x03, "100000 300000" }, - {0x15, 0x01, 0x7, 0x04, "50000" }, - {0x15, 0x01, 0x7, 0x05, "100000" }, - {0x15, 0x01, 0x7, 0x06, "200000" }, - {0x15, 0x01, 0x7, 0x07, "None" }, - - {0x16, 0xfe, 0, 6, "Difficulty" }, - {0x16, 0x01, 0x7, 0x00, "0" }, - {0x16, 0x01, 0x7, 0x01, "1" }, - {0x16, 0x01, 0x7, 0x02, "2" }, - {0x16, 0x01, 0x7, 0x03, "3" }, - {0x16, 0x01, 0x7, 0x04, "4" }, - {0x16, 0x01, 0x7, 0x05, "5" }, - - {0x16, 0xfe, 0, 2, "Allow Continue" }, - {0x16, 0x01, 0x8, 0x08, "No" }, - {0x16, 0x01, 0x8, 0x00, "Yes" }, -}; - -STDDIPINFO(Silkworm) - -static struct BurnDIPInfo BackfirtDIPList[]= -{ - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x10, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0x13, 0xfe, 0, 4, "Coin A" }, - {0x13, 0x01, 0x3, 0x00, "1C 1C" }, - {0x13, 0x01, 0x3, 0x01, "1C 2C" }, - {0x13, 0x01, 0x3, 0x02, "1C 3C" }, - {0x13, 0x01, 0x3, 0x03, "1C 6C" }, - - {0x13, 0xfe, 0, 4, "Coin B" }, - {0x13, 0x01, 0xC, 0x04, "2C 1C" }, - {0x13, 0x01, 0xC, 0x00, "1C 1C" }, - {0x13, 0x01, 0xC, 0x08, "1C 2C" }, - {0x13, 0x01, 0xC, 0x0C, "1C 3C" }, - - {0x14, 0xfe, 0, 2, "Cabinet" }, - {0x14, 0x01, 0x10, 0x10, "Upright" }, - {0x14, 0x01, 0x10, 0x00, "Cocktail" }, - - {0x15, 0xfe, 0, 8, "Bonus Life" }, - {0x15, 0x01, 0x07, 0x00, "50000 200000 500000" }, - {0x15, 0x01, 0x07, 0x01, "100000 300000 800000" }, - {0x15, 0x01, 0x07, 0x02, "50000 200000" }, - {0x15, 0x01, 0x07, 0x03, "100000 300000" }, - {0x15, 0x01, 0x07, 0x04, "50000" }, - {0x15, 0x01, 0x07, 0x05, "100000" }, - {0x15, 0x01, 0x07, 0x06, "200000" }, - {0x15, 0x01, 0x07, 0x07, "None" }, - - // not verified - {0x15, 0xfe, 0, 6, "Difficulty" }, - {0x15, 0x01, 0x38, 0x00, "0" }, - {0x15, 0x01, 0x38, 0x08, "1" }, - {0x15, 0x01, 0x38, 0x10, "2" }, - {0x15, 0x01, 0x38, 0x18, "3" }, - {0x15, 0x01, 0x38, 0x20, "4" }, - {0x15, 0x01, 0x38, 0x28, "5" }, - - {0x16, 0xfe, 0, 2, "Allow Continue" }, - {0x16, 0x01, 0x04, 0x04, "No" }, - {0x16, 0x01, 0x04, 0x00, "Yes" }, - - {0x16, 0xfe, 0, 2, "Invincibility (Cheat)" }, - {0x16, 0x01, 0x08, 0x08, "No" }, - {0x16, 0x01, 0x08, 0x00, "Yes" }, -}; - -STDDIPINFO(Backfirt) - -UINT8 __fastcall rygar_main_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - case 0xf801: - case 0xf802: - case 0xf803: - case 0xf804: - case 0xf805: - case 0xf806: - case 0xf807: - case 0xf808: - case 0xf809: - return DrvInputs[address & 0x0f]; - - case 0xf80f: - return DrvInputs[10]; - } - - return 0; -} - -static void bankswitch_w(INT32 data) -{ - DrvZ80Bank = 0x10000 + ((data & 0xf8) << 8); - - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80ROM0 + DrvZ80Bank); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80ROM0 + DrvZ80Bank); -} - -static inline void palette_write(INT32 offset) -{ - UINT16 data; - UINT8 r,g,b; - - data = *((UINT16*)(DrvPalRAM + (offset & ~1))); - -#ifdef LSB_FIRST - data = (data << 8) | (data >> 8); -#endif - - r = (data >> 4) & 0x0f; - g = (data >> 0) & 0x0f; - b = (data >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[offset >> 1] = BurnHighCol(r, g, b, 0); -} - -void __fastcall rygar_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xe000) { - DrvPalRAM[address & 0x7ff] = data; - palette_write(address & 0x7ff); - return; - } - - switch (address) - { - case 0xf800: - DrvFgScroll[0] = (DrvFgScroll[0] & 0xff00) | data; - return; - - case 0xf801: - DrvFgScroll[0] = (DrvFgScroll[0] & 0x00ff) | (data << 8); - return; - - case 0xf802: - DrvFgScroll[1] = data; - return; - - case 0xf803: - DrvBgScroll[0] = (DrvBgScroll[0] & 0xff00) | data; - return; - - case 0xf804: - DrvBgScroll[0] = (DrvBgScroll[0] & 0x00ff) | (data << 8); - return; - - case 0xf805: - DrvBgScroll[1] = data; - return; - - case 0xf806: - soundlatch = data; - DrvEnableNmi = 1; - return; - - case 0xf807: - flipscreen = data & 1; - return; - - case 0xf808: - bankswitch_w(data); - return; - - case 0xf80b: - // watchdog reset - return; - } - - return; -} - -UINT8 __fastcall rygar_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return soundlatch; - } - - return 0; -} - -void __fastcall rygar_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff80) == 0x2000) { - DrvZ80ROM1[address] = data; - return; - } - - switch (address) - { - case 0x8000: - case 0xa000: - BurnYM3812Write(0, 0, data); - return; - - case 0x8001: - case 0xa001: - BurnYM3812Write(0, 1, data); - return; - - case 0xc000: - if (DrvHasADPCM) { - adpcm_pos = data << 8; - MSM5205ResetWrite(0, 0); - } - return; - - case 0xc400: - case 0xd000: - adpcm_end = (data + 1) << 8; - return; - - case 0xc800: - case 0xe000: - if (DrvHasADPCM) { - MSM5205SetRoute(0, (double)(data & 0x0f) / 15, BURN_SND_ROUTE_BOTH); - } - return; - - case 0xf000: - return; - } - - return; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x20000; - DrvZ80ROM1 = Next; Next += 0x08000; - - DrvSndROM = Next; Next += adpcm_size; - - DrvGfxROM0 = Next; Next += 0x10000; - DrvGfxROM1 = Next; Next += 0x80000; - DrvGfxROM2 = Next; Next += 0x80000; - DrvGfxROM3 = Next; Next += 0x80000; - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x01000; - DrvZ80RAM1 = Next; Next += 0x00800; - - DrvPalRAM = Next; Next += 0x00800; - DrvTextRAM = Next; Next += 0x00800; - DrvBackRAM = Next; Next += 0x00400; - DrvForeRAM = Next; Next += 0x00400; - DrvSprRAM = Next; Next += 0x00800; - - DrvBgScroll = (UINT16*)Next; Next += 0x00002 * sizeof(UINT16); - DrvFgScroll = (UINT16*)Next; Next += 0x00002 * sizeof(UINT16); - - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - static INT32 Planes[4] = { - 0x000, 0x001, 0x002, 0x003 - }; - - static INT32 XOffs[16] = { - 0x000, 0x004, 0x008, 0x00c, 0x010, 0x014, 0x018, 0x01c, - 0x100, 0x104, 0x108, 0x10c, 0x110, 0x114, 0x118, 0x11c - }; - - static INT32 YOffs[16] = { - 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0 - }; - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 4, 8, 8, Planes, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x2000, 4, 8, 8, Planes, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Planes, XOffs, YOffs, 0x400, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Planes, XOffs, YOffs, 0x400, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - bankswitch_w(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - if (DrvHasADPCM) MSM5205Reset(); - BurnYM3812Reset(); - - if (tecmo_video_type) { - memset (DrvZ80ROM1 + 0x2000, 0, 0x80); - } - - soundlatch = 0; - flipscreen = 0; - - adpcm_pos = 0; - adpcm_end = 0; - adpcm_data = -1; - - HiscoreReset(); - - return 0; -} - -static void TecmoFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 TecmoSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(double)ZetTotalCycles() * nSoundRate / 4000000; -} - -static void TecmoMSM5205Vck() -{ - if (adpcm_pos >= adpcm_end || adpcm_pos >= adpcm_size) { - MSM5205ResetWrite(0, 1); - } else { - if (adpcm_data != -1) { - MSM5205DataWrite(0, adpcm_data & 0x0f); - adpcm_data = -1; - } else { - adpcm_data = DrvSndROM[adpcm_pos++ & (adpcm_size - 1)]; - MSM5205DataWrite(0, adpcm_data >> 4); - } - } -} - -static INT32 RygarInit() -{ - tecmo_video_type = 0; - DrvHasADPCM = 1; - adpcm_size = 0x4000; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM0); - ZetMapArea(0xc000, 0xcfff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 2, DrvZ80RAM0); - ZetMapArea(0xd000, 0xd7ff, 0, DrvTextRAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvTextRAM); - ZetMapArea(0xd800, 0xdbff, 0, DrvForeRAM); - ZetMapArea(0xd800, 0xdbff, 1, DrvForeRAM); - ZetMapArea(0xdc00, 0xdfff, 0, DrvBackRAM); - ZetMapArea(0xdc00, 0xdfff, 1, DrvBackRAM); - ZetMapArea(0xe000, 0xe7ff, 0, DrvSprRAM); - ZetMapArea(0xe000, 0xe7ff, 1, DrvSprRAM); - ZetMapArea(0xe800, 0xefff, 0, DrvPalRAM); - ZetSetWriteHandler(rygar_main_write); - ZetSetReadHandler(rygar_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM1); - ZetMapArea(0x4000, 0x47ff, 0, DrvZ80RAM1); - ZetMapArea(0x4000, 0x47ff, 1, DrvZ80RAM1); - ZetMapArea(0x4000, 0x47ff, 2, DrvZ80RAM1); - ZetSetWriteHandler(rygar_sound_write); - ZetSetReadHandler(rygar_sound_read); - ZetClose(); - - { - for (INT32 i = 0; i < 3; i++) { - if (BurnLoadRom(DrvZ80ROM0 + i * 0x8000, i + 0, 1)) return 1; - } - - if (BurnLoadRom(DrvZ80ROM1, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 4, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x8000, i + 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + i * 0x8000, i + 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + i * 0x8000, i + 13, 1)) return 1; - } - - if (BurnLoadRom(DrvSndROM, 17, 1)) return 1; - - DrvGfxDecode(); - } - - BurnYM3812Init(1, 4000000, &TecmoFMIRQHandler, &TecmoSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, TecmoSynchroniseStream, 400000, TecmoMSM5205Vck, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - - -static INT32 SilkwormInit() -{ - tecmo_video_type = 1; - DrvHasADPCM = 1; - adpcm_size = 0x8000; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM0); - ZetMapArea(0xc000, 0xc3ff, 0, DrvBackRAM); - ZetMapArea(0xc000, 0xc3ff, 1, DrvBackRAM); - ZetMapArea(0xc400, 0xc7ff, 0, DrvForeRAM); - ZetMapArea(0xc400, 0xc7ff, 1, DrvForeRAM); - ZetMapArea(0xc800, 0xcfff, 0, DrvTextRAM); - ZetMapArea(0xc800, 0xcfff, 1, DrvTextRAM); - ZetMapArea(0xd000, 0xdfff, 0, DrvZ80RAM0); - ZetMapArea(0xd000, 0xdfff, 1, DrvZ80RAM0); - ZetMapArea(0xd000, 0xdfff, 2, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe7ff, 0, DrvSprRAM); - ZetMapArea(0xe000, 0xe7ff, 1, DrvSprRAM); - ZetMapArea(0xe800, 0xefff, 0, DrvPalRAM); - ZetSetWriteHandler(rygar_main_write); - ZetSetReadHandler(rygar_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); - ZetSetWriteHandler(rygar_sound_write); - ZetSetReadHandler(rygar_sound_read); - ZetClose(); - - { - for (INT32 i = 0; i < 2; i++) { - if (BurnLoadRom(DrvZ80ROM0 + i * 0x10000, i + 0, 1)) return 1; - } - - if (BurnLoadRom(DrvZ80ROM1, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 3, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x10000, i + 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + i * 0x10000, i + 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + i * 0x10000, i + 12, 1)) return 1; - } - - if (BurnLoadRom(DrvSndROM, 16, 1)) return 1; - - DrvGfxDecode(); - } - - BurnYM3812Init(1, 4000000, &TecmoFMIRQHandler, &TecmoSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, TecmoSynchroniseStream, 400000, TecmoMSM5205Vck, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 GeminiInit() -{ - tecmo_video_type = 2; - DrvHasADPCM = 1; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "backfirt")) DrvHasADPCM = 0; - if (DrvHasADPCM) adpcm_size = 0x8000; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM0); - ZetMapArea(0xc000, 0xcfff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 2, DrvZ80RAM0); - ZetMapArea(0xd000, 0xd7ff, 0, DrvTextRAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvTextRAM); - ZetMapArea(0xd800, 0xdbff, 0, DrvForeRAM); - ZetMapArea(0xd800, 0xdbff, 1, DrvForeRAM); - ZetMapArea(0xdc00, 0xdfff, 0, DrvBackRAM); - ZetMapArea(0xdc00, 0xdfff, 1, DrvBackRAM); - ZetMapArea(0xe000, 0xe7ff, 0, DrvPalRAM); - ZetMapArea(0xe800, 0xefff, 0, DrvSprRAM); - ZetMapArea(0xe800, 0xefff, 1, DrvSprRAM); - ZetSetWriteHandler(rygar_main_write); - ZetSetReadHandler(rygar_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); - ZetSetWriteHandler(rygar_sound_write); - ZetSetReadHandler(rygar_sound_read); - ZetClose(); - - { - for (INT32 i = 0; i < 2; i++) { - if (BurnLoadRom(DrvZ80ROM0 + i * 0x10000, i + 0, 1)) return 1; - } - - if (BurnLoadRom(DrvZ80ROM1, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 3, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x10000, i + 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + i * 0x10000, i + 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + i * 0x10000, i + 12, 1)) return 1; - } - - BurnLoadRom(DrvSndROM, 16, 1); - - DrvGfxDecode(); - } - - BurnYM3812Init(1, 4000000, &TecmoFMIRQHandler, &TecmoSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - if (DrvHasADPCM) { - MSM5205Init(0, TecmoSynchroniseStream, 400000, TecmoMSM5205Vck, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - } - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - if (DrvHasADPCM) MSM5205Exit(); - BurnYM3812Exit(); - - GenericTilesExit(); - - ZetExit(); - - BurnFree (AllMem); - - DrvHasADPCM = 0; - - return 0; -} - -static inline INT32 calc_sprite_offset(INT32 code, INT32 x, INT32 y) -{ - INT32 ofst = 0; - if (x & 0x001) ofst |= 0x01; - if (y & 0x001) ofst |= 0x02; - if (x & 0x002) ofst |= 0x04; - if (y & 0x002) ofst |= 0x08; - if (x & 0x004) ofst |= 0x10; - if (y & 0x004) ofst |= 0x20; - - return (ofst + code) & 0x1fff; -} - -static void draw_sprites(INT32 priority) -{ - for (INT32 offs = 0; offs < 0x800; offs += 8) - { - INT32 flags = DrvSprRAM[offs+3]; - if (priority != (flags >> 6)) continue; - - INT32 bank = DrvSprRAM[offs+0]; - - if (bank & 4) - { - INT32 which = DrvSprRAM[offs+1]; - INT32 code, xpos, ypos, flipx, flipy, x, y; - INT32 size = DrvSprRAM[offs + 2] & 3; - - if (tecmo_video_type) - code = which + ((bank & 0xf8) << 5); - else - code = which + ((bank & 0xf0) << 4); - - code &= ~((1 << (size << 1)) - 1); - size = 1 << size; - - xpos = DrvSprRAM[offs + 5] - ((flags & 0x10) << 4); - ypos = DrvSprRAM[offs + 4] - ((flags & 0x20) << 3); - flipx = bank & 1; - flipy = bank & 2; - - for (y = 0; y < size; y++) - { - for (x = 0; x < size; x++) - { - INT32 sx = xpos + ((flipx ? (size - 1 - x) : x) << 3); - INT32 sy = ypos + ((flipy ? (size - 1 - y) : y) << 3); - sy -= 16; - - if (sy < -7 || sx < -7 || sx > 255 || sy > 223) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, calc_sprite_offset(code, x, y), sx, sy, flags & 0x0f, 4, 0, 0, DrvGfxROM1); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, calc_sprite_offset(code, x, y), sx, sy, flags & 0x0f, 4, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, calc_sprite_offset(code, x, y), sx, sy, flags & 0x0f, 4, 0, 0, DrvGfxROM1); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, calc_sprite_offset(code, x, y), sx, sy, flags & 0x0f, 4, 0, 0, DrvGfxROM1); - } - } - } - } - } - } -} - -static INT32 draw_layer(UINT8 *vidram, UINT8 *gfx_base, INT32 paloffs, UINT16 *scroll) -{ - for (INT32 offs = 0; offs < 32 * 16; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scroll[0] & 0x1ff; - - if (flipscreen) { - sx += 48 + 256; - } else { - sx -= 48; - } - - if (sx < -15) sx += 0x200; - if (sx > 511) sx -= 0x200; - sy -= scroll[1] + 16; - if (sy < -15) sy += 0x100; - - if (sx > nScreenWidth || sy > nScreenHeight) continue; - - UINT8 color = vidram[0x200 | offs]; - INT32 code = vidram[offs]; - - if (tecmo_video_type == 2) { - color = (color << 4) | (color >> 4); - } - - code |= ((color & 7) << 8); - color >>= 4; - - if (sx < 0 || sy < 0 || sx > nScreenWidth - 16 || sy > nScreenHeight - 16) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, paloffs, gfx_base); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, paloffs, gfx_base); - } - } - - return 0; -} - -static void draw_text_layer() -{ - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 color = DrvTextRAM[offs | 0x400]; - - INT32 code = DrvTextRAM[offs] | ((color & 3) << 8); - - color >>= 4; - - if (sy < 16 || sy > 239) continue; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy-16, color, 4, 0, 0x100, DrvGfxROM0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x100; - } - - if (nSpriteEnable & 1) draw_sprites(3); - - if (nBurnLayer & 2) draw_layer(DrvBackRAM, DrvGfxROM3, 0x300, DrvBgScroll); - - if (nSpriteEnable & 2) draw_sprites(2); - - if (nBurnLayer & 4) draw_layer(DrvForeRAM, DrvGfxROM2, 0x200, DrvFgScroll); - - if (nSpriteEnable & 4) draw_sprites(1); - - if (nBurnLayer & 8) draw_text_layer(); - - if (nSpriteEnable & 8) draw_sprites(0); - - if (flipscreen) { - INT32 nSize = (nScreenWidth * nScreenHeight) - 1; - for (INT32 i = 0; i < nSize >> 1; i++) { - INT32 n = pTransDraw[i]; - pTransDraw[i] = pTransDraw[nSize - i]; - pTransDraw[nSize - i] = n; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 6); - DrvInputs[10] = 0; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[ 0] ^= DrvJoy1[i] << i; - DrvInputs[ 1] ^= DrvJoy2[i] << i; - DrvInputs[ 2] ^= DrvJoy3[i] << i; - DrvInputs[ 3] ^= DrvJoy4[i] << i; - DrvInputs[ 4] ^= DrvJoy5[i] << i; - DrvInputs[ 5] ^= DrvJoy6[i] << i; - DrvInputs[10] ^= DrvJoy11[i] << i; - } - } - - ZetNewFrame(); - - INT32 nSegment; - INT32 nInterleave = 10; - if (DrvHasADPCM) nInterleave = MSM5205CalcInterleave(0, 4000000); - INT32 nTotalCycles[2] = { 6000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i); - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave-1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - if (DrvEnableNmi) { - ZetNmi(); - DrvEnableNmi = 0; - } - BurnTimerUpdateYM3812((i + 1) * (nTotalCycles[1] / nInterleave)); - if (DrvHasADPCM) MSM5205Update(); - ZetClose(); - } - - ZetOpen(1); - BurnTimerEndFrameYM3812(nTotalCycles[1]); - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - if (DrvHasADPCM) MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029622; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ba.Data = DrvZ80ROM1 + 0x2000; - ba.nLen = 0x80; - ba.szName = "Sound Z80 RAM"; - BurnAcb(&ba); - - ZetScan(nAction); - BurnYM3812Scan(nAction, pnMin); - if (DrvHasADPCM) MSM5205Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(DrvZ80Bank); - - SCAN_VAR(adpcm_pos); - SCAN_VAR(adpcm_end); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80ROM0 + DrvZ80Bank); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80ROM0 + DrvZ80Bank); - ZetClose(); - } - - return 0; -} - - -// Rygar (US set 1) - -static struct BurnRomInfo rygarRomDesc[] = { - { "5.5p", 0x08000, 0x062cd55d, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "cpu_5m.bin", 0x04000, 0x7ac5191b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cpu_5j.bin", 0x08000, 0xed76d606, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "cpu_4h.bin", 0x02000, 0xe4a2fa87, 2 | BRF_PRG | BRF_ESS }, // 3 - Z80 Code - - { "cpu_8k.bin", 0x08000, 0x4d482fb6, 3 | BRF_GRA }, // 4 - Characters - - { "vid_6k.bin", 0x08000, 0xaba6db9e, 4 | BRF_GRA }, // 5 - Sprites - { "vid_6j.bin", 0x08000, 0xae1f2ed6, 4 | BRF_GRA }, // 6 - { "vid_6h.bin", 0x08000, 0x46d9e7df, 4 | BRF_GRA }, // 7 - { "vid_6g.bin", 0x08000, 0x45839c9a, 4 | BRF_GRA }, // 8 - - { "vid_6p.bin", 0x08000, 0x9eae5f8e, 5 | BRF_GRA }, // 9 - Foreground Tiles - { "vid_6o.bin", 0x08000, 0x5a10a396, 5 | BRF_GRA }, // 10 - { "vid_6n.bin", 0x08000, 0x7b12cf3f, 5 | BRF_GRA }, // 11 - { "vid_6l.bin", 0x08000, 0x3cea7eaa, 5 | BRF_GRA }, // 12 - - { "vid_6f.bin", 0x08000, 0x9840edd8, 6 | BRF_GRA }, // 13 - Background Tiles - { "vid_6e.bin", 0x08000, 0xff65e074, 6 | BRF_GRA }, // 14 - { "vid_6c.bin", 0x08000, 0x89868c85, 6 | BRF_GRA }, // 15 - { "vid_6b.bin", 0x08000, 0x35389a7b, 6 | BRF_GRA }, // 16 - - { "cpu_1f.bin", 0x04000, 0x3cc98c5a, 7 | BRF_SND }, // 17 - Samples -}; - -STD_ROM_PICK(rygar) -STD_ROM_FN(rygar) - -struct BurnDriver BurnDrvRygar = { - "rygar", NULL, NULL, NULL, "1986", - "Rygar (US set 1)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, rygarRomInfo, rygarRomName, NULL, NULL, RygarInputInfo, RygarDIPInfo, - RygarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Rygar (US set 2) - -static struct BurnRomInfo rygar2RomDesc[] = { - { "5p.bin", 0x08000, 0x151ffc0b, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "cpu_5m.bin", 0x04000, 0x7ac5191b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cpu_5j.bin", 0x08000, 0xed76d606, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "cpu_4h.bin", 0x02000, 0xe4a2fa87, 2 | BRF_PRG | BRF_ESS }, // 3 - Z80 Code - - { "cpu_8k.bin", 0x08000, 0x4d482fb6, 3 | BRF_GRA }, // 4 - Characters - - { "vid_6k.bin", 0x08000, 0xaba6db9e, 4 | BRF_GRA }, // 5 - Sprites - { "vid_6j.bin", 0x08000, 0xae1f2ed6, 4 | BRF_GRA }, // 6 - { "vid_6h.bin", 0x08000, 0x46d9e7df, 4 | BRF_GRA }, // 7 - { "vid_6g.bin", 0x08000, 0x45839c9a, 4 | BRF_GRA }, // 8 - - { "vid_6p.bin", 0x08000, 0x9eae5f8e, 5 | BRF_GRA }, // 9 - Foreground Tiles - { "vid_6o.bin", 0x08000, 0x5a10a396, 5 | BRF_GRA }, // 10 - { "vid_6n.bin", 0x08000, 0x7b12cf3f, 5 | BRF_GRA }, // 11 - { "vid_6l.bin", 0x08000, 0x3cea7eaa, 5 | BRF_GRA }, // 12 - - { "vid_6f.bin", 0x08000, 0x9840edd8, 6 | BRF_GRA }, // 13 - Background Tiles - { "vid_6e.bin", 0x08000, 0xff65e074, 6 | BRF_GRA }, // 14 - { "vid_6c.bin", 0x08000, 0x89868c85, 6 | BRF_GRA }, // 15 - { "vid_6b.bin", 0x08000, 0x35389a7b, 6 | BRF_GRA }, // 16 - - { "cpu_1f.bin", 0x04000, 0x3cc98c5a, 7 | BRF_SND }, // 17 - Samples -}; - -STD_ROM_PICK(rygar2) -STD_ROM_FN(rygar2) - -struct BurnDriver BurnDrvRygar2 = { - "rygar2", "rygar", NULL, NULL, "1986", - "Rygar (US set 2)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, rygar2RomInfo, rygar2RomName, NULL, NULL, RygarInputInfo, RygarDIPInfo, - RygarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Rygar (US set 3 Old Version) - -static struct BurnRomInfo rygar3RomDesc[] = { - { "cpu_5p.bin", 0x08000, 0xe79c054a, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "cpu_5m.bin", 0x04000, 0x7ac5191b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cpu_5j.bin", 0x08000, 0xed76d606, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "cpu_4h.bin", 0x02000, 0xe4a2fa87, 2 | BRF_PRG | BRF_ESS }, // 3 - Z80 Code - - { "cpu_8k.bin", 0x08000, 0x4d482fb6, 3 | BRF_GRA }, // 4 - Characters - - { "vid_6k.bin", 0x08000, 0xaba6db9e, 4 | BRF_GRA }, // 5 - Sprites - { "vid_6j.bin", 0x08000, 0xae1f2ed6, 4 | BRF_GRA }, // 6 - { "vid_6h.bin", 0x08000, 0x46d9e7df, 4 | BRF_GRA }, // 7 - { "vid_6g.bin", 0x08000, 0x45839c9a, 4 | BRF_GRA }, // 8 - - { "vid_6p.bin", 0x08000, 0x9eae5f8e, 5 | BRF_GRA }, // 9 - Foreground Tiles - { "vid_6o.bin", 0x08000, 0x5a10a396, 5 | BRF_GRA }, // 10 - { "vid_6n.bin", 0x08000, 0x7b12cf3f, 5 | BRF_GRA }, // 11 - { "vid_6l.bin", 0x08000, 0x3cea7eaa, 5 | BRF_GRA }, // 12 - - { "vid_6f.bin", 0x08000, 0x9840edd8, 6 | BRF_GRA }, // 13 - Background Tiles - { "vid_6e.bin", 0x08000, 0xff65e074, 6 | BRF_GRA }, // 14 - { "vid_6c.bin", 0x08000, 0x89868c85, 6 | BRF_GRA }, // 15 - { "vid_6b.bin", 0x08000, 0x35389a7b, 6 | BRF_GRA }, // 16 - - { "cpu_1f.bin", 0x04000, 0x3cc98c5a, 7 | BRF_SND }, // 17 - Samples -}; - -STD_ROM_PICK(rygar3) -STD_ROM_FN(rygar3) - -struct BurnDriver BurnDrvRygar3 = { - "rygar3", "rygar", NULL, NULL, "1986", - "Rygar (US set 3 Old Version)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, rygar3RomInfo, rygar3RomName, NULL, NULL, RygarInputInfo, RygarDIPInfo, - RygarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Argus no Senshi (Japan) - -static struct BurnRomInfo rygarjRomDesc[] = { - { "cpuj_5p.bin",0x08000, 0xb39698ba, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "cpuj_5m.bin",0x04000, 0x3f180979, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cpuj_5j.bin",0x08000, 0x69e44e8f, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "cpu_4h.bin", 0x02000, 0xe4a2fa87, 2 | BRF_PRG | BRF_ESS }, // 3 - Z80 Code - - { "cpuj_8k.bin",0x08000, 0x45047707, 3 | BRF_GRA }, // 4 - Characters - - { "vid_6k.bin", 0x08000, 0xaba6db9e, 4 | BRF_GRA }, // 5 - Sprites - { "vid_6j.bin", 0x08000, 0xae1f2ed6, 4 | BRF_GRA }, // 6 - { "vid_6h.bin", 0x08000, 0x46d9e7df, 4 | BRF_GRA }, // 7 - { "vid_6g.bin", 0x08000, 0x45839c9a, 4 | BRF_GRA }, // 8 - - { "vid_6p.bin", 0x08000, 0x9eae5f8e, 5 | BRF_GRA }, // 9 - Foreground Tiles - { "vid_6o.bin", 0x08000, 0x5a10a396, 5 | BRF_GRA }, // 10 - { "vid_6n.bin", 0x08000, 0x7b12cf3f, 5 | BRF_GRA }, // 11 - { "vid_6l.bin", 0x08000, 0x3cea7eaa, 5 | BRF_GRA }, // 12 - - { "vid_6f.bin", 0x08000, 0x9840edd8, 6 | BRF_GRA }, // 13 - Background Tiles - { "vid_6e.bin", 0x08000, 0xff65e074, 6 | BRF_GRA }, // 14 - { "vid_6c.bin", 0x08000, 0x89868c85, 6 | BRF_GRA }, // 15 - { "vid_6b.bin", 0x08000, 0x35389a7b, 6 | BRF_GRA }, // 16 - - { "cpu_1f.bin", 0x04000, 0x3cc98c5a, 7 | BRF_SND }, // 17 - Samples -}; - -STD_ROM_PICK(rygarj) -STD_ROM_FN(rygarj) - -struct BurnDriver BurnDrvRygarj = { - "rygarj", "rygar", NULL, NULL, "1986", - "Argus no Senshi (Japan)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, rygarjRomInfo, rygarjRomName, NULL, NULL, RygarInputInfo, RygarDIPInfo, - RygarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Rygar (US, bootleg) - -static struct BurnRomInfo rygarbRomDesc[] = { - { "5.u64", 0x08000, 0x0e13e0e4, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "4.u63", 0x04000, 0x7ac5191b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.u61", 0x08000, 0xed76d606, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "2.u72", 0x02000, 0xe4a2fa87, 2 | BRF_PRG | BRF_ESS }, // 3 - Z80 Code - - { "6.u19", 0x08000, 0x4d482fb6, 3 | BRF_GRA }, // 4 - Characters - - { "11.u82", 0x08000, 0xaba6db9e, 4 | BRF_GRA }, // 5 - Sprites - { "12.u81", 0x08000, 0xae1f2ed6, 4 | BRF_GRA }, // 6 - { "13.u80", 0x08000, 0x46d9e7df, 4 | BRF_GRA }, // 7 - { "14.u79", 0x08000, 0x45839c9a, 4 | BRF_GRA }, // 8 - - { "7.u86", 0x08000, 0x9eae5f8e, 5 | BRF_GRA }, // 9 - Foreground Tiles - { "8.u85", 0x08000, 0x5a10a396, 5 | BRF_GRA }, // 10 - { "9.u84", 0x08000, 0x7b12cf3f, 5 | BRF_GRA }, // 11 - { "10.u83", 0x08000, 0x3cea7eaa, 5 | BRF_GRA }, // 12 - - { "15.u78", 0x08000, 0x9840edd8, 6 | BRF_GRA }, // 13 - Background Tiles - { "16.u77", 0x08000, 0xff65e074, 6 | BRF_GRA }, // 14 - { "17.u76", 0x08000, 0x89868c85, 6 | BRF_GRA }, // 15 - { "18.u75", 0x08000, 0x35389a7b, 6 | BRF_GRA }, // 16 - - { "1.u102", 0x04000, 0x3cc98c5a, 7 | BRF_SND }, // 17 - Samples -}; - -STD_ROM_PICK(rygarb) -STD_ROM_FN(rygarb) - -struct BurnDriver BurnDrvRygarb = { - "rygarb", "rygar", NULL, NULL, "1986", - "Rygar (US, bootleg)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, rygarbRomInfo, rygarbRomName, NULL, NULL, RygarInputInfo, RygarDIPInfo, - RygarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Silk Worm (World) - -static struct BurnRomInfo silkwormRomDesc[] = { - { "silkworm.4", 0x10000, 0xa5277cce, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "silkworm.5", 0x10000, 0xa6c7bb51, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "silkworm.3", 0x08000, 0xb589f587, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "silkworm.2", 0x08000, 0xe80a1cd9, 3 | BRF_GRA }, // 3 - Characters - - { "silkworm.6", 0x10000, 0x1138d159, 4 | BRF_GRA }, // 4 - Sprites - { "silkworm.7", 0x10000, 0xd96214f7, 4 | BRF_GRA }, // 5 - { "silkworm.8", 0x10000, 0x0494b38e, 4 | BRF_GRA }, // 6 - { "silkworm.9", 0x10000, 0x8ce3cdf5, 4 | BRF_GRA }, // 7 - - { "silkworm.10", 0x10000, 0x8c7138bb, 5 | BRF_GRA }, // 8 - Foreground Tiles - { "silkworm.11", 0x10000, 0x6c03c476, 5 | BRF_GRA }, // 9 - { "silkworm.12", 0x10000, 0xbb0f568f, 5 | BRF_GRA }, // 10 - { "silkworm.13", 0x10000, 0x773ad0a4, 5 | BRF_GRA }, // 11 - - { "silkworm.14", 0x10000, 0x409df64b, 6 | BRF_GRA }, // 12 - Background Tiles - { "silkworm.15", 0x10000, 0x6e4052c9, 6 | BRF_GRA }, // 13 - { "silkworm.16", 0x10000, 0x9292ed63, 6 | BRF_GRA }, // 14 - { "silkworm.17", 0x10000, 0x3fa4563d, 6 | BRF_GRA }, // 15 - - { "silkworm.1", 0x08000, 0x5b553644, 7 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(silkworm) -STD_ROM_FN(silkworm) - -struct BurnDriver BurnDrvSilkworm = { - "silkworm", NULL, NULL, NULL, "1988", - "Silk Worm (World)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, silkwormRomInfo, silkwormRomName, NULL, NULL, SilkwormInputInfo, SilkwormDIPInfo, - SilkwormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Silk Worm (Japan) - -static struct BurnRomInfo silkwrmjRomDesc[] = { - { "silkwormj.4", 0x10000, 0x6df3df22, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "silkworm.5", 0x10000, 0xa6c7bb51, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "silkwormj.3", 0x08000, 0xb79848d0, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "silkworm.2", 0x08000, 0xe80a1cd9, 3 | BRF_GRA }, // 3 - Characters - - { "silkworm.6", 0x10000, 0x1138d159, 4 | BRF_GRA }, // 4 - Sprites - { "silkworm.7", 0x10000, 0xd96214f7, 4 | BRF_GRA }, // 5 - { "silkworm.8", 0x10000, 0x0494b38e, 4 | BRF_GRA }, // 6 - { "silkworm.9", 0x10000, 0x8ce3cdf5, 4 | BRF_GRA }, // 7 - - { "silkworm.10", 0x10000, 0x8c7138bb, 5 | BRF_GRA }, // 8 - Foreground Tiles - { "silkworm.11", 0x10000, 0x6c03c476, 5 | BRF_GRA }, // 9 - { "silkworm.12", 0x10000, 0xbb0f568f, 5 | BRF_GRA }, // 10 - { "silkworm.13", 0x10000, 0x773ad0a4, 5 | BRF_GRA }, // 11 - - { "silkworm.14", 0x10000, 0x409df64b, 6 | BRF_GRA }, // 12 - Background Tiles - { "silkworm.15", 0x10000, 0x6e4052c9, 6 | BRF_GRA }, // 13 - { "silkworm.16", 0x10000, 0x9292ed63, 6 | BRF_GRA }, // 14 - { "silkworm.17", 0x10000, 0x3fa4563d, 6 | BRF_GRA }, // 15 - - { "silkworm.1", 0x08000, 0x5b553644, 7 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(silkwrmj) -STD_ROM_FN(silkwrmj) - -struct BurnDriver BurnDrvSilkwrmj = { - "silkwormj", "silkworm", NULL, NULL, "1988", - "Silk Worm (Japan)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, silkwrmjRomInfo, silkwrmjRomName, NULL, NULL, SilkwormInputInfo, SilkwormDIPInfo, - SilkwormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - -// Silk Worm (prototype?) -// 6217A -// SILKWORM H T737 -// board have Japanese label "ADONO" - -static struct BurnRomInfo silkwrmpRomDesc[] = { - { "silkworm_pr4ma.4.4", 0x10000, 0x5e2a39cc, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "silkworm.5", 0x10000, 0xa6c7bb51, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "silkworm_sound.3", 0x08000, 0xc67c5644, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "sw.2", 0x08000, 0x1acc54be, 3 | BRF_GRA }, // 3 - Characters - - { "silkworm.6", 0x10000, 0x1138d159, 4 | BRF_GRA }, // 4 - Sprites - { "silkworm.7", 0x10000, 0xd96214f7, 4 | BRF_GRA }, // 5 - { "silkworm.8", 0x10000, 0x0494b38e, 4 | BRF_GRA }, // 6 - { "silkworm.9", 0x10000, 0x8ce3cdf5, 4 | BRF_GRA }, // 7 - - { "silkworm.10", 0x10000, 0x8c7138bb, 5 | BRF_GRA }, // 8 - Foreground Tiles - { "silkworm.11", 0x10000, 0x6c03c476, 5 | BRF_GRA }, // 9 - { "silkworm.12", 0x10000, 0xbb0f568f, 5 | BRF_GRA }, // 10 - { "silkworm.13", 0x10000, 0x773ad0a4, 5 | BRF_GRA }, // 11 - - { "silkworm.14", 0x10000, 0x409df64b, 6 | BRF_GRA }, // 12 - Background Tiles - { "silkworm.15", 0x10000, 0x6e4052c9, 6 | BRF_GRA }, // 13 - { "silkworm.16", 0x10000, 0x9292ed63, 6 | BRF_GRA }, // 14 - { "silkworm.17", 0x10000, 0x3fa4563d, 6 | BRF_GRA }, // 15 - - { "silkworm.1", 0x08000, 0x5b553644, 7 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(silkwrmp) -STD_ROM_FN(silkwrmp) - -struct BurnDriver BurnDrvSilkwrmp = { - "silkwormp", "silkworm", NULL, NULL, "1988", - "Silk Worm (prototype?)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, silkwrmpRomInfo, silkwrmpRomName, NULL, NULL, SilkwormInputInfo, SilkwormDIPInfo, - SilkwormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - -// Silk Worm (bootleg) - -static struct BurnRomInfo silkwormbRomDesc[] = { - { "e3.4", 0x10000, 0x3d86fd58, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "e4.5", 0x10000, 0xa6c7bb51, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "e2.3", 0x08000, 0xb7a3fb80, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "e1.2", 0x08000, 0xe80a1cd9, 3 | BRF_GRA }, // 3 - Characters - - { "e5.6", 0x10000, 0x1138d159, 4 | BRF_GRA }, // 4 - Sprites - { "e6.7", 0x10000, 0xd96214f7, 4 | BRF_GRA }, // 5 - { "e7.8", 0x10000, 0x0494b38e, 4 | BRF_GRA }, // 6 - { "e8.9", 0x10000, 0x8ce3cdf5, 4 | BRF_GRA }, // 7 - - { "e9.10", 0x10000, 0x8c7138bb, 5 | BRF_GRA }, // 8 - Foreground Tiles - { "e10.11", 0x08000, 0xc0c4687d, 5 | BRF_GRA }, // 9 - { "e11.12", 0x10000, 0xbb0f568f, 5 | BRF_GRA }, // 10 - { "e12.13", 0x08000, 0xfc472811, 5 | BRF_GRA }, // 11 - - { "e13.14", 0x10000, 0x409df64b, 6 | BRF_GRA }, // 12 - Background Tiles - { "e14.15", 0x08000, 0xb02acdb6, 6 | BRF_GRA }, // 13 - { "e15.16", 0x08000, 0xcaf7b25e, 6 | BRF_GRA }, // 14 - { "e16.17", 0x08000, 0x7ec93873, 6 | BRF_GRA }, // 15 - -}; - -STD_ROM_PICK(silkwormb) -STD_ROM_FN(silkwormb) - -struct BurnDriver BurnDrvSilkwormb = { - "silkwormb", "silkworm", NULL, NULL, "1988", - "Silk Worm (bootleg)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, silkwormbRomInfo, silkwormbRomName, NULL, NULL, SilkwormInputInfo, SilkwormDIPInfo, - SilkwormInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - -// Back Fire (Tecmo, bootleg) - -static struct BurnRomInfo backfirtRomDesc[] = { - { "b5-e3.bin", 0x10000, 0x0ab3bd4d, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "b4-f3.bin", 0x10000, 0x150B6949, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b2-e10.bin", 0x08000, 0x9b2ac54f, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "b3-c10.bin", 0x08000, 0x08ce729f, 3 | BRF_GRA }, // 3 - Characters - - { "b6-c2.bin", 0x10000, 0xc8c25e45, 4 | BRF_GRA }, // 4 - Sprites - { "b7-d2.bin", 0x10000, 0x25fb6a57, 4 | BRF_GRA }, // 5 - { "b8-e2.bin", 0x10000, 0x6bccac4e, 4 | BRF_GRA }, // 6 - { "b9-h2.bin", 0x10000, 0x566a99b8, 4 | BRF_GRA }, // 7 - - { "b13-p1.bin", 0x10000, 0x8c7138bb, 5 | BRF_GRA }, // 8 - Foreground Tiles - { "b12-p2.bin", 0x10000, 0x6c03c476, 5 | BRF_GRA }, // 9 - { "b11-p2.bin", 0x10000, 0x0bc84b4b, 5 | BRF_GRA }, // 10 - { "b10-p3.bin", 0x10000, 0xec149ec3, 5 | BRF_GRA }, // 11 - - { "b17-s1.bin", 0x10000, 0x409df64b, 6 | BRF_GRA }, // 12 - Background Tiles - { "b16-s2.bin", 0x10000, 0x6e4052c9, 6 | BRF_GRA }, // 13 - { "b15-s2.bin", 0x10000, 0x2b6cc20e, 6 | BRF_GRA }, // 14 - { "b14-s3.bin", 0x08000, 0x4d29637a, 6 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(backfirt) -STD_ROM_FN(backfirt) - -struct BurnDriver BurnDrvbackfirt = { - "backfirt", NULL, NULL, NULL, "1988", - "Back Fire (Tecmo, bootleg)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, backfirtRomInfo, backfirtRomName, NULL, NULL, BackfirtInputInfo, BackfirtDIPInfo, - GeminiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Gemini Wing (Japan) - -static struct BurnRomInfo geminiRomDesc[] = { - { "gw04-5s.rom", 0x10000, 0xff9de855, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "gw05-6s.rom", 0x10000, 0x5a6947a9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gw03-5h.rom", 0x08000, 0x9bc79596, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "gw02-3h.rom", 0x08000, 0x7acc8d35, 3 | BRF_GRA }, // 3 - Characters - - { "gw06-1c.rom", 0x10000, 0x4ea51631, 4 | BRF_GRA }, // 4 - Sprites - { "gw07-1d.rom", 0x10000, 0xda42637e, 4 | BRF_GRA }, // 5 - { "gw08-1f.rom", 0x10000, 0x0b4e8d70, 4 | BRF_GRA }, // 6 - { "gw09-1h.rom", 0x10000, 0xb65c5e4c, 4 | BRF_GRA }, // 7 - - { "gw10-1n.rom", 0x10000, 0x5e84cd4f, 5 | BRF_GRA }, // 8 - Foreground Tiles - { "gw11-2na.rom", 0x10000, 0x08b458e1, 5 | BRF_GRA }, // 9 - { "gw12-2nb.rom", 0x10000, 0x229c9714, 5 | BRF_GRA }, // 10 - { "gw13-3n.rom", 0x10000, 0xc5dfaf47, 5 | BRF_GRA }, // 11 - - { "gw14-1r.rom", 0x10000, 0x9c10e5b5, 6 | BRF_GRA }, // 12 - Background Tiles - { "gw15-2ra.rom", 0x10000, 0x4cd18cfa, 6 | BRF_GRA }, // 13 - { "gw16-2rb.rom", 0x10000, 0xf911c7be, 6 | BRF_GRA }, // 14 - { "gw17-3r.rom", 0x10000, 0x79a9ce25, 6 | BRF_GRA }, // 15 - - { "gw01-6a.rom", 0x08000, 0xd78afa05, 7 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(gemini) -STD_ROM_FN(gemini) - -struct BurnDriver BurnDrvGemini = { - "gemini", NULL, NULL, NULL, "1987", - "Gemini Wing (Japan)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, geminiRomInfo, geminiRomName, NULL, NULL, GeminiInputInfo, GeminiDIPInfo, - GeminiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; - - -// Gemini Wing (World, bootleg) -// f205v id 1293 - -static struct BurnRomInfo geminibRomDesc[] = { - { "G-2.6d", 0x10000, 0xcd79c5b3, 1 | BRF_PRG | BRF_ESS }, // 0 - Z80 Code - { "gw05-6s.rom", 0x10000, 0x5a6947a9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gw03-5h.rom", 0x08000, 0x9bc79596, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "gw02-3h.rom", 0x08000, 0x7acc8d35, 3 | BRF_GRA }, // 3 - Characters - - { "gw06-1c.rom", 0x10000, 0x4ea51631, 4 | BRF_GRA }, // 4 - Sprites - { "gw07-1d.rom", 0x10000, 0xda42637e, 4 | BRF_GRA }, // 5 - { "gw08-1f.rom", 0x10000, 0x0b4e8d70, 4 | BRF_GRA }, // 6 - { "gw09-1h.rom", 0x10000, 0xb65c5e4c, 4 | BRF_GRA }, // 7 - - { "gw10-1n.rom", 0x10000, 0x5e84cd4f, 5 | BRF_GRA }, // 8 - Foreground Tiles - { "gw11-2na.rom", 0x10000, 0x08b458e1, 5 | BRF_GRA }, // 9 - { "gw12-2nb.rom", 0x10000, 0x229c9714, 5 | BRF_GRA }, // 10 - { "gw13-3n.rom", 0x10000, 0xc5dfaf47, 5 | BRF_GRA }, // 11 - - { "gw14-1r.rom", 0x10000, 0x9c10e5b5, 6 | BRF_GRA }, // 12 - Background Tiles - { "gw15-2ra.rom", 0x10000, 0x4cd18cfa, 6 | BRF_GRA }, // 13 - { "gw16-2rb.rom", 0x10000, 0xf911c7be, 6 | BRF_GRA }, // 14 - { "gw17-3r.rom", 0x10000, 0x79a9ce25, 6 | BRF_GRA }, // 15 - - { "gw01-6a.rom", 0x08000, 0xd78afa05, 7 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(geminib) -STD_ROM_FN(geminib) - -struct BurnDriver BurnDrvGeminib = { - "geminib", "gemini", NULL, NULL, "1987", - "Gemini Wing (World, bootleg)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, geminibRomInfo, geminibRomName, NULL, NULL, GeminiInputInfo, GeminiDIPInfo, - GeminiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_terracre.cpp b/jan/src/burn/drv/pre90s/d_terracre.cpp deleted file mode 100644 index 05f8c1871..000000000 --- a/jan/src/burn/drv/pre90s/d_terracre.cpp +++ /dev/null @@ -1,1903 +0,0 @@ -// FB Alpha Terra Cresta driver module -// Based on MAME driver by Carlos A. Lozano - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3526.h" -#include "burn_ym2203.h" -#include "dac.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[3] = {0, 0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *DrvZ80Rom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvZ80Ram = NULL; -static UINT8 *DrvProms = NULL; -static UINT8 *DrvSpritePalBank = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvBgVideoRam = NULL; -static UINT8 *DrvFgVideoRam = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvRecalcPal = 0; -static UINT16 DrvScrollX = 0; -static UINT16 DrvScrollY = 0; -static UINT16 DrvDisableBg = 0; -static UINT16 DrvFlipScreen = 0; -static UINT8 DrvSoundLatch = 0; - -static UINT8 AmazonProtCmd; -static UINT8 AmazonProtReg[6]; - -static UINT8 DrvUseYM2203 = 0; -static UINT8 DrvIsHorekid = 0; -static UINT16 *AmazonProtDataPtr = NULL; - -typedef INT32 (*TerracreLoadRomsType)(); -static TerracreLoadRomsType LoadRomsFunction; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 4, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo AmazonInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort2 + 1, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 4, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Amazon) - -static struct BurnInputInfo HorekidInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 4, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, -}; - -STDINPUTINFO(Horekid) - -static inline void DrvMakeInputs() -{ - DrvInput[0] = DrvInput[1] = 0xff; - DrvInput[2] = 0xdf; - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] -= (DrvInputPort0[i] & 1) << i; - DrvInput[1] -= (DrvInputPort1[i] & 1) << i; - DrvInput[2] -= (DrvInputPort2[i] & 1) << i; - } -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0x20, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x0c, "20k then every 60k" }, - {0x13, 0x01, 0x0c, 0x08, "30k then every 70k" }, - {0x13, 0x01, 0x0c, 0x04, "40k then every 80k" }, - {0x13, 0x01, 0x0c, 0x00, "50k then every 90k" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x20, 0x00, "Upright" }, - {0x13, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0x0c, 0x00, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x04, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x10, 0x10, "Easy" }, - {0x14, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Complete Invulnerability"}, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Base Ship Invulnerability"}, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo AmazonDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0x20, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x0c, "20k then every 40k" }, - {0x13, 0x01, 0x0c, 0x08, "50k then every 40k" }, - {0x13, 0x01, 0x0c, 0x04, "20k then every 70k" }, - {0x13, 0x01, 0x0c, 0x00, "50k then every 70k" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x20, 0x00, "Upright" }, - {0x13, 0x01, 0x20, 0x20, "Cocktail" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0x0c, 0x00, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x0c, 0x04, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x10, 0x10, "Easy" }, - {0x14, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Level" }, - {0x14, 0x01, 0x40, 0x40, "Low" }, - {0x14, 0x01, 0x40, 0x00, "High" }, - - {0 , 0xfe, 0 , 2 , "Sprite Test" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Amazon) - -static struct BurnDIPInfo HorekidDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0x20, NULL }, - {0x13, 0xff, 0xff, 0xef, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x0c, "20k then every 60k" }, - {0x13, 0x01, 0x0c, 0x08, "50k then every 60k" }, - {0x13, 0x01, 0x0c, 0x04, "20k then every 90k" }, - {0x13, 0x01, 0x0c, 0x00, "50k then every 90k" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x20, 0x00, "Upright" }, - {0x13, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0xc0, 0xc0, "Easy" }, - {0x13, 0x01, 0xc0, 0x80, "Normal" }, - {0x13, 0x01, 0xc0, 0x40, "Hard" }, - {0x13, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0x0c, 0x04, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Debug Mode" }, - {0x14, 0x01, 0xc0, 0xc0, "Off" }, - {0x14, 0x01, 0xc0, 0x80, "On" }, -}; - -STDDIPINFO(Horekid) - -static struct BurnRomInfo DrvRomDesc[] = { - { "bk1_1.4b", 0x08000, 0x60932770, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "bk1_3.4d", 0x08000, 0xcb36240e, BRF_ESS | BRF_PRG }, // 1 - { "bk1_2.6b", 0x08000, 0x539352f2, BRF_ESS | BRF_PRG }, // 2 - { "bk1_4.6d", 0x08000, 0x19387586, BRF_ESS | BRF_PRG }, // 3 - - { "bk2_11.15b", 0x04000, 0x604c3b11, BRF_ESS | BRF_PRG }, // 4 Z80 Program Code - { "bk2_12.17b", 0x04000, 0xaffc898d, BRF_ESS | BRF_PRG }, // 5 - { "bk2_13.18b", 0x04000, 0x302dc0ab, BRF_ESS | BRF_PRG }, // 6 - - { "bk2_14.16g", 0x02000, 0x591a3804, BRF_GRA }, // 7 Chars - - { "bk1_5.15f", 0x08000, 0x984a597f, BRF_GRA }, // 8 Tiles - { "bk1_6.17f", 0x08000, 0x30e297ff, BRF_GRA }, // 9 - - { "bk2_7.6e", 0x04000, 0xbcf7740b, BRF_GRA }, // 10 Sprites - { "bk2_8.7e", 0x04000, 0xa70b565c, BRF_GRA }, // 11 - { "bk2_9.6g", 0x04000, 0x4a9ec3e6, BRF_GRA }, // 12 - { "bk2_10.7g", 0x04000, 0x450749fc, BRF_GRA }, // 13 - - { "bk1_3.10f", 0x00100, 0xce07c544, BRF_GRA }, // 14 PROMs - { "bk1_2.11f", 0x00100, 0x566d323a, BRF_GRA }, // 15 - { "bk1_1.12f", 0x00100, 0x7ea63946, BRF_GRA }, // 16 - { "bk2_4.2g", 0x00100, 0x08609bad, BRF_GRA }, // 17 - - { "bk2_5.4e", 0x00100, 0x2c43991f, BRF_GRA }, // 18 Sprite Palette Bank -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvoRomDesc[] = { - { "1a_4b.rom", 0x04000, 0x76f17479, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "1a_4d.rom", 0x04000, 0x8119f06e, BRF_ESS | BRF_PRG }, // 1 - { "1a_6b.rom", 0x04000, 0xba4b5822, BRF_ESS | BRF_PRG }, // 2 - { "1a_6d.rom", 0x04000, 0xca4852f6, BRF_ESS | BRF_PRG }, // 3 - { "1a_7b.rom", 0x04000, 0xd0771bba, BRF_ESS | BRF_PRG }, // 4 - { "1a_7d.rom", 0x04000, 0x029d59d9, BRF_ESS | BRF_PRG }, // 5 - { "1a_9b.rom", 0x04000, 0x69227b56, BRF_ESS | BRF_PRG }, // 6 - { "1a_9d.rom", 0x04000, 0x5a672942, BRF_ESS | BRF_PRG }, // 7 - - { "2a_15b.rom", 0x04000, 0x604c3b11, BRF_ESS | BRF_PRG }, // 8 Z80 Program Code - { "2a_17b.rom", 0x04000, 0xaffc898d, BRF_ESS | BRF_PRG }, // 9 - { "2a_18b.rom", 0x04000, 0x302dc0ab, BRF_ESS | BRF_PRG }, // 10 - - { "2a_16b.rom", 0x02000, 0x591a3804, BRF_GRA }, // 11 Chars - - { "1a_15f.rom", 0x08000, 0x984a597f, BRF_GRA }, // 12 Tiles - { "1a_17f.rom", 0x08000, 0x30e297ff, BRF_GRA }, // 13 - - { "2a_6e.rom", 0x04000, 0xbcf7740b, BRF_GRA }, // 14 Sprites - { "2a_7e.rom", 0x04000, 0xa70b565c, BRF_GRA }, // 15 - { "2a_6g.rom", 0x04000, 0x4a9ec3e6, BRF_GRA }, // 16 - { "2a_7g.rom", 0x04000, 0x450749fc, BRF_GRA }, // 17 - - { "tc1a_10f.bin", 0x00100, 0xce07c544, BRF_GRA }, // 18 PROMs - { "tc1a_11f.bin", 0x00100, 0x566d323a, BRF_GRA }, // 19 - { "tc1a_12f.bin", 0x00100, 0x7ea63946, BRF_GRA }, // 20 - { "tc2a_2g.bin", 0x00100, 0x08609bad, BRF_GRA }, // 21 - - { "tc2a_4e.bin", 0x00100, 0x2c43991f, BRF_GRA }, // 22 Sprite Palette Bank -}; - -STD_ROM_PICK(Drvo) -STD_ROM_FN(Drvo) - -static struct BurnRomInfo DrvaRomDesc[] = { - { "1a_4b.rom", 0x04000, 0x76f17479, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "1a_4d.rom", 0x04000, 0x8119f06e, BRF_ESS | BRF_PRG }, // 1 - { "1a_6b.rom", 0x04000, 0xba4b5822, BRF_ESS | BRF_PRG }, // 2 - { "1a_6d.rom", 0x04000, 0xca4852f6, BRF_ESS | BRF_PRG }, // 3 - { "1a_7b.rom", 0x04000, 0xd0771bba, BRF_ESS | BRF_PRG }, // 4 - { "1a_7d.rom", 0x04000, 0x029d59d9, BRF_ESS | BRF_PRG }, // 5 - { "1a_9b.rom", 0x04000, 0x69227b56, BRF_ESS | BRF_PRG }, // 6 - { "1a_9d.rom", 0x04000, 0x5a672942, BRF_ESS | BRF_PRG }, // 7 - - { "2a_15b.rom", 0x04000, 0x604c3b11, BRF_ESS | BRF_PRG }, // 8 Z80 Program Code - { "dg.12", 0x04000, 0x9e9b3808, BRF_ESS | BRF_PRG }, // 9 - { "2a_18b.rom", 0x04000, 0x302dc0ab, BRF_ESS | BRF_PRG }, // 10 - - { "2a_16b.rom", 0x02000, 0x591a3804, BRF_GRA }, // 11 Chars - - { "1a_15f.rom", 0x08000, 0x984a597f, BRF_GRA }, // 12 Tiles - { "1a_17f.rom", 0x08000, 0x30e297ff, BRF_GRA }, // 13 - - { "2a_6e.rom", 0x04000, 0xbcf7740b, BRF_GRA }, // 14 Sprites - { "2a_7e.rom", 0x04000, 0xa70b565c, BRF_GRA }, // 15 - { "2a_6g.rom", 0x04000, 0x4a9ec3e6, BRF_GRA }, // 16 - { "2a_7g.rom", 0x04000, 0x450749fc, BRF_GRA }, // 17 - - { "tc1a_10f.bin", 0x00100, 0xce07c544, BRF_GRA }, // 18 PROMs - { "tc1a_11f.bin", 0x00100, 0x566d323a, BRF_GRA }, // 19 - { "tc1a_12f.bin", 0x00100, 0x7ea63946, BRF_GRA }, // 20 - { "tc2a_2g.bin", 0x00100, 0x08609bad, BRF_GRA }, // 21 - - { "tc2a_4e.bin", 0x00100, 0x2c43991f, BRF_GRA }, // 22 Sprite Palette Bank -}; - -STD_ROM_PICK(Drva) -STD_ROM_FN(Drva) - -static struct BurnRomInfo DrvnRomDesc[] = { - { "1a_4b.rom", 0x04000, 0x76f17479, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "1a_4d.rom", 0x04000, 0x8119f06e, BRF_ESS | BRF_PRG }, // 1 - { "1a_6b.rom", 0x04000, 0xba4b5822, BRF_ESS | BRF_PRG }, // 2 - { "1a_6d.rom", 0x04000, 0xca4852f6, BRF_ESS | BRF_PRG }, // 3 - { "1a_7b.rom", 0x04000, 0xd0771bba, BRF_ESS | BRF_PRG }, // 4 - { "1a_7d.rom", 0x04000, 0x029d59d9, BRF_ESS | BRF_PRG }, // 5 - { "1a_9b.rom", 0x04000, 0x69227b56, BRF_ESS | BRF_PRG }, // 6 - { "1a_9d.rom", 0x04000, 0x5a672942, BRF_ESS | BRF_PRG }, // 7 - - { "tc2a_15b.bin", 0x04000, 0x790ddfa9, BRF_ESS | BRF_PRG }, // 8 Z80 Program Code - { "tc2a_17b.bin", 0x04000, 0xd4531113, BRF_ESS | BRF_PRG }, // 9 - - { "2a_16b.rom", 0x02000, 0x591a3804, BRF_GRA }, // 10 Chars - - { "1a_15f.rom", 0x08000, 0x984a597f, BRF_GRA }, // 11 Tiles - { "1a_17f.rom", 0x08000, 0x30e297ff, BRF_GRA }, // 12 - - { "2a_6e.rom", 0x04000, 0xbcf7740b, BRF_GRA }, // 13 Sprites - { "2a_7e.rom", 0x04000, 0xa70b565c, BRF_GRA }, // 14 - { "2a_6g.rom", 0x04000, 0x4a9ec3e6, BRF_GRA }, // 15 - { "2a_7g.rom", 0x04000, 0x450749fc, BRF_GRA }, // 16 - - { "tc1a_10f.bin", 0x00100, 0xce07c544, BRF_GRA }, // 17 PROMs - { "tc1a_11f.bin", 0x00100, 0x566d323a, BRF_GRA }, // 18 - { "tc1a_12f.bin", 0x00100, 0x7ea63946, BRF_GRA }, // 19 - { "tc2a_2g.bin", 0x00100, 0x08609bad, BRF_GRA }, // 20 - - { "tc2a_4e.bin", 0x00100, 0x2c43991f, BRF_GRA }, // 21 Sprite Palette Bank -}; - -STD_ROM_PICK(Drvn) -STD_ROM_FN(Drvn) - -static struct BurnRomInfo AmazonRomDesc[] = { - { "11.4d", 0x08000, 0x6c7f85c5, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "9.4b", 0x08000, 0xe1b7a989, BRF_ESS | BRF_PRG }, // 1 - { "12.6d", 0x08000, 0x4de8a3ee, BRF_ESS | BRF_PRG }, // 2 - { "10.6b", 0x08000, 0xd86bad81, BRF_ESS | BRF_PRG }, // 3 - - { "1.15b", 0x04000, 0x55a8b5e7, BRF_ESS | BRF_PRG }, // 4 Z80 Program Code - { "2.17b", 0x04000, 0x427a7cca, BRF_ESS | BRF_PRG }, // 5 - { "3.18b", 0x04000, 0xb8cceaf7, BRF_ESS | BRF_PRG }, // 6 - - { "8.16g", 0x02000, 0x0cec8644, BRF_GRA }, // 7 Chars - - { "13.15f", 0x08000, 0x415ff4d9, BRF_GRA }, // 8 Tiles - { "14.17f", 0x08000, 0x492b5c48, BRF_GRA }, // 9 - { "15.18f", 0x08000, 0xb1ac0b9d, BRF_GRA }, // 10 - - { "4.6e", 0x04000, 0xf77ced7a, BRF_GRA }, // 11 Sprites - { "5.7e", 0x04000, 0x16ef1465, BRF_GRA }, // 12 - { "6.6g", 0x04000, 0x936ec941, BRF_GRA }, // 13 - { "7.7g", 0x04000, 0x66dd718e, BRF_GRA }, // 14 - - { "clr.10f", 0x00100, 0x6440b341, BRF_GRA }, // 15 PROMs - { "clr.11f", 0x00100, 0x271e947f, BRF_GRA }, // 16 - { "clr.12f", 0x00100, 0x7d38621b, BRF_GRA }, // 17 - { "2g", 0x00100, 0x44ca16b9, BRF_GRA }, // 18 - - { "4e", 0x00100, 0x035f2c7b, BRF_GRA }, // 19 Sprite Palette Bank - - { "16.18g", 0x02000, 0x1d8d592b, BRF_OPT }, // 20 Unknown -}; - -STD_ROM_PICK(Amazon) -STD_ROM_FN(Amazon) - -static struct BurnRomInfo AmatelasRomDesc[] = { - { "a11.4d", 0x08000, 0x3d226d0b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "a9.4b", 0x08000, 0xe2a0d21d, BRF_ESS | BRF_PRG }, // 1 - { "a12.6d", 0x08000, 0xe6607c51, BRF_ESS | BRF_PRG }, // 2 - { "a10.6b", 0x08000, 0xdbc1f1b4, BRF_ESS | BRF_PRG }, // 3 - - { "1.15b", 0x04000, 0x55a8b5e7, BRF_ESS | BRF_PRG }, // 4 Z80 Program Code - { "2.17b", 0x04000, 0x427a7cca, BRF_ESS | BRF_PRG }, // 5 - { "3.18b", 0x04000, 0xb8cceaf7, BRF_ESS | BRF_PRG }, // 6 - - { "a8.16g", 0x02000, 0xaeba2102, BRF_GRA }, // 7 Chars - - { "13.15f", 0x08000, 0x415ff4d9, BRF_GRA }, // 8 Tiles - { "14.17f", 0x08000, 0x492b5c48, BRF_GRA }, // 9 - { "15.18f", 0x08000, 0xb1ac0b9d, BRF_GRA }, // 10 - - { "4.6e", 0x04000, 0xf77ced7a, BRF_GRA }, // 11 Sprites - { "a5.7e", 0x04000, 0x5fbf9a16, BRF_GRA }, // 12 - { "6.6g", 0x04000, 0x936ec941, BRF_GRA }, // 13 - { "7.7g", 0x04000, 0x66dd718e, BRF_GRA }, // 14 - - { "clr.10f", 0x00100, 0x6440b341, BRF_GRA }, // 15 PROMs - { "clr.11f", 0x00100, 0x271e947f, BRF_GRA }, // 16 - { "clr.12f", 0x00100, 0x7d38621b, BRF_GRA }, // 17 - { "2g", 0x00100, 0x44ca16b9, BRF_GRA }, // 18 - - { "4e", 0x00100, 0x035f2c7b, BRF_GRA }, // 19 Sprite Palette Bank - - { "16.18g", 0x02000, 0x1d8d592b, BRF_OPT }, // 20 Unknown -}; - -STD_ROM_PICK(Amatelas) -STD_ROM_FN(Amatelas) - -static struct BurnRomInfo HorekidRomDesc[] = { - { "horekid.03", 0x08000, 0x90ec840f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "horekid.01", 0x08000, 0xa282faf8, BRF_ESS | BRF_PRG }, // 1 - { "horekid.04", 0x08000, 0x375c0c50, BRF_ESS | BRF_PRG }, // 2 - { "horekid.02", 0x08000, 0xee7d52bb, BRF_ESS | BRF_PRG }, // 3 - - { "horekid.09", 0x04000, 0x49cd3b81, BRF_ESS | BRF_PRG }, // 4 Z80 Program Code - { "horekid.10", 0x04000, 0xc1eaa938, BRF_ESS | BRF_PRG }, // 5 - { "horekid.11", 0x04000, 0x0a2bc702, BRF_ESS | BRF_PRG }, // 6 - - { "horekid.16", 0x02000, 0x104b77cc, BRF_GRA }, // 7 Chars - - { "horekid.05", 0x08000, 0xda25ae10, BRF_GRA }, // 8 Tiles - { "horekid.06", 0x08000, 0x616e4321, BRF_GRA }, // 9 - { "horekid.07", 0x08000, 0x8c7d2be2, BRF_GRA }, // 10 - { "horekid.08", 0x08000, 0xa0066b02, BRF_GRA }, // 11 - - { "horekid.12", 0x08000, 0xa3caa07a, BRF_GRA }, // 12 Sprites - { "horekid.13", 0x08000, 0x0e48ff8e, BRF_GRA }, // 13 - { "horekid.14", 0x08000, 0xe300747a, BRF_GRA }, // 14 - { "horekid.15", 0x08000, 0x51105741, BRF_GRA }, // 15 - - { "kid_prom.10f", 0x00100, 0xca13ce23, BRF_GRA }, // 16 PROMs - { "kid_prom.11f", 0x00100, 0xfb44285a, BRF_GRA }, // 17 - { "kid_prom.12f", 0x00100, 0x40d41237, BRF_GRA }, // 18 - { "kid_prom.2g", 0x00100, 0x4b9be0ed, BRF_GRA }, // 19 - - { "kid_prom.4e", 0x00100, 0xe4fb54ee, BRF_GRA }, // 20 Sprite Palette Bank - - { "horekid.17", 0x02000, 0x1d8d592b, BRF_OPT }, // 21 Unknown -}; - -STD_ROM_PICK(Horekid) -STD_ROM_FN(Horekid) - -static struct BurnRomInfo HorekidbRomDesc[] = { - { "knhhd5", 0x08000, 0x786619c7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "knhhd7", 0x08000, 0x3bbb475b, BRF_ESS | BRF_PRG }, // 1 - { "horekid.04", 0x08000, 0x375c0c50, BRF_ESS | BRF_PRG }, // 2 - { "horekid.02", 0x08000, 0xee7d52bb, BRF_ESS | BRF_PRG }, // 3 - - { "horekid.09", 0x04000, 0x49cd3b81, BRF_ESS | BRF_PRG }, // 4 Z80 Program Code - { "horekid.10", 0x04000, 0xc1eaa938, BRF_ESS | BRF_PRG }, // 5 - { "horekid.11", 0x04000, 0x0a2bc702, BRF_ESS | BRF_PRG }, // 6 - - { "horekid.16", 0x02000, 0x104b77cc, BRF_GRA }, // 7 Chars - - { "horekid.05", 0x08000, 0xda25ae10, BRF_GRA }, // 8 Tiles - { "horekid.06", 0x08000, 0x616e4321, BRF_GRA }, // 9 - { "horekid.07", 0x08000, 0x8c7d2be2, BRF_GRA }, // 10 - { "horekid.08", 0x08000, 0xa0066b02, BRF_GRA }, // 11 - - { "horekid.12", 0x08000, 0xa3caa07a, BRF_GRA }, // 12 Sprites - { "horekid.13", 0x08000, 0x0e48ff8e, BRF_GRA }, // 13 - { "horekid.14", 0x08000, 0xe300747a, BRF_GRA }, // 14 - { "horekid.15", 0x08000, 0x51105741, BRF_GRA }, // 15 - - { "kid_prom.10f", 0x00100, 0xca13ce23, BRF_GRA }, // 16 PROMs - { "kid_prom.11f", 0x00100, 0xfb44285a, BRF_GRA }, // 17 - { "kid_prom.12f", 0x00100, 0x40d41237, BRF_GRA }, // 18 - { "kid_prom.2g", 0x00100, 0x4b9be0ed, BRF_GRA }, // 19 - - { "kid_prom.4e", 0x00100, 0xe4fb54ee, BRF_GRA }, // 20 Sprite Palette Bank - - { "horekid.17", 0x02000, 0x1d8d592b, BRF_OPT }, // 21 Unknown -}; - -STD_ROM_PICK(Horekidb) -STD_ROM_FN(Horekidb) - -static struct BurnRomInfo BoobhackRomDesc[] = { - { "1-c.bin", 0x08000, 0x786619c7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "1-b.bin", 0x08000, 0x3bbb475b, BRF_ESS | BRF_PRG }, // 1 - { "1-d.bin", 0x08000, 0x375c0c50, BRF_ESS | BRF_PRG }, // 2 - { "1-a.bin", 0x08000, 0xee7d52bb, BRF_ESS | BRF_PRG }, // 3 - - { "1-i.bin", 0x04000, 0x49cd3b81, BRF_ESS | BRF_PRG }, // 4 Z80 Program Code - { "1-j.bin", 0x04000, 0xc1eaa938, BRF_ESS | BRF_PRG }, // 5 - { "1-k.bin", 0x04000, 0x0a2bc702, BRF_ESS | BRF_PRG }, // 6 - - { "1-p.bin", 0x02000, 0x104b77cc, BRF_GRA }, // 7 Chars - - { "1-e.bin", 0x08000, 0xda25ae10, BRF_GRA }, // 8 Tiles - { "1-f.bin", 0x08000, 0x616e4321, BRF_GRA }, // 9 - { "1-g.bin", 0x08000, 0x8c7d2be2, BRF_GRA }, // 10 - { "1-h.bin", 0x08000, 0xa0066b02, BRF_GRA }, // 11 - - { "1-l.bin", 0x08000, 0xa3caa07a, BRF_GRA }, // 12 Sprites - { "1-m.bin", 0x08000, 0x15b6cbdf, BRF_GRA }, // 13 - { "1-n.bin", 0x08000, 0xe300747a, BRF_GRA }, // 14 - { "1-o.bin", 0x08000, 0xcddc6a6c, BRF_GRA }, // 15 - - { "kid_prom.10f", 0x00100, 0xca13ce23, BRF_GRA }, // 16 PROMs - { "kid_prom.11f", 0x00100, 0xfb44285a, BRF_GRA }, // 17 - { "kid_prom.12f", 0x00100, 0x40d41237, BRF_GRA }, // 18 - { "kid_prom.2g", 0x00100, 0x4b9be0ed, BRF_GRA }, // 19 - - { "kid_prom.4e", 0x00100, 0xe4fb54ee, BRF_GRA }, // 20 Sprite Palette Bank -}; - -STD_ROM_PICK(Boobhack) -STD_ROM_FN(Boobhack) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x020000; - DrvZ80Rom = Next; Next += 0x00c000; - DrvProms = Next; Next += 0x000400; - DrvSpritePalBank = Next; Next += 0x000100; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x001000; - DrvSpriteRam = Next; Next += 0x002000; - DrvBgVideoRam = Next; Next += 0x001000; - DrvFgVideoRam = Next; Next += 0x001000; - DrvZ80Ram = Next; Next += 0x001000; - - RamEnd = Next; - - DrvChars = Next; Next += 0x100 * 8 * 8; - DrvTiles = Next; Next += 0x400 * 16 * 16; - DrvSprites = Next; Next += 0x400 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x1110 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - if (DrvUseYM2203) { - BurnYM2203Reset(); - } else { - BurnYM3526Reset(); - } - ZetClose(); - - DACReset(); - - DrvScrollX = 0; - DrvScrollY = 0; - DrvDisableBg = 0; - DrvFlipScreen = 0; - DrvSoundLatch = 0; - AmazonProtCmd = 0; - memset(AmazonProtReg, 0, 6); - - HiscoreReset(); - - return 0; -} - -UINT8 __fastcall Terracre68KReadByte(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Terracre68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Terracre68KReadWord(UINT32 a) -{ - switch (a) { - case 0x024000: { - return DrvInput[0]; - } - - case 0x024002: { - return DrvInput[1]; - } - - case 0x024004: { - return (DrvInput[2] | DrvDip[0]) << 8; - } - - case 0x024006: { - return (DrvDip[2] << 8) | DrvDip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Terracre68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x026000: { - DrvFlipScreen = d & 0x04; - return; - } - - case 0x026002: { - DrvScrollX = d & 0x3ff; - DrvDisableBg = (d & 0x2000) ? 1 : 0; - return; - } - - case 0x026004: { - DrvScrollY = d & 0x1ff; - return; - } - - case 0x02600a: { - // ??? - return; - } - - case 0x02600c: { - DrvSoundLatch = ((d & 0x7f) << 1) | 1; - return; - } - - case 0x02600e: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Amazon68KReadByte(UINT32 a) -{ - switch (a) { - case 0x070001: { - INT32 Offset = AmazonProtReg[2]; - if (Offset <= 0x56) { - UINT16 Data; - Data = AmazonProtDataPtr[Offset >> 1]; - if (Offset & 0x01) return Data & 0xff; - return Data >> 8; - } - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Amazon68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x070001: { - if (AmazonProtCmd >= 0x32 && AmazonProtCmd <= 0x37) { - AmazonProtReg[AmazonProtCmd - 0x32] = d; - } - return; - } - - case 0x070003: { - AmazonProtCmd = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Amazon68KReadWord(UINT32 a) -{ - switch (a) { - case 0x044000: { - if (DrvIsHorekid) { - return (DrvDip[2] << 8) | DrvDip[1]; - } - return DrvInput[0]; - } - - case 0x044002: { - if (DrvIsHorekid) { - return (DrvInput[2] | DrvDip[0]) << 8; - } - return DrvInput[1]; - } - - case 0x044004: { - if (DrvIsHorekid) { - return DrvInput[1]; - } - return (DrvInput[2] | DrvDip[0]) << 8; - } - - case 0x044006: { - if (DrvIsHorekid) { - return DrvInput[0]; - } - return (DrvDip[2] << 8) | DrvDip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Amazon68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x046000: { - DrvFlipScreen = d & 0x04; - return; - } - - case 0x046002: { - DrvScrollX = d & 0x3ff; - DrvDisableBg = (d & 0x2000) ? 1 : 0; - return; - } - - case 0x046004: { - DrvScrollY = d & 0x1ff; - return; - } - - case 0x04600a: { - // ??? - return; - } - - case 0x04600c: { - DrvSoundLatch = ((d & 0x7f) << 1) | 1; - return; - } - - case 0x04600e: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall TerracreZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x04: { - DrvSoundLatch = 0; - return 0; - } - - case 0x06: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall TerracreZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - BurnYM3526Write(0, d); - return; - } - - case 0x01: { - BurnYM3526Write(1, d); - return; - } - - case 0x02: { - DACSignedWrite(0, d); - return; - } - - case 0x03: { - DACSignedWrite(1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -void __fastcall TerracreYM2203Z80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x01: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0x02: { - DACSignedWrite(0, d); - return; - } - - case 0x03: { - DACSignedWrite(1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static INT32 TerracreSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (4000000.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[8] = { 4, 0, 12, 8, 20, 16, 28, 24 }; -static INT32 CharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 TilePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TileXOffsets[16] = { 4, 0, 12, 8, 20, 16, 28, 24, 36, 32, 44, 40, 52, 48, 60, 56 }; -static INT32 TileYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 SpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 SpriteXOffsets[16] = { 4, 0, RGN_FRAC(0x10000,1,2)+4,RGN_FRAC(0x10000,1,2)+0, 12, 8, RGN_FRAC(0x10000,1,2)+12, RGN_FRAC(0x10000,1,2)+8, 20, 16, RGN_FRAC(0x10000,1,2)+20, RGN_FRAC(0x10000,1,2)+16, 28, 24, RGN_FRAC(0x10000,1,2)+28, RGN_FRAC(0x10000,1,2)+24 }; -static INT32 HorekidSpriteXOffsets[16] = { 4, 0, RGN_FRAC(0x20000,1,2)+4,RGN_FRAC(0x20000,1,2)+0, 12, 8, RGN_FRAC(0x20000,1,2)+12, RGN_FRAC(0x20000,1,2)+8, 20, 16, RGN_FRAC(0x20000,1,2)+20, RGN_FRAC(0x20000,1,2)+16, 28, 24, RGN_FRAC(0x20000,1,2)+28, RGN_FRAC(0x20000,1,2)+24 }; -static INT32 SpriteYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480 }; - -static INT32 DrvInit() -{ - INT32 nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - if (LoadRomsFunction()) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0x020000, 0x021fff, MAP_RAM); - SekMapMemory(DrvBgVideoRam , 0x022000, 0x022fff, MAP_RAM); -// SekMapMemory(Drv68KRam , 0x023000, 0x023fff, MAP_RAM); - SekMapMemory(DrvFgVideoRam , 0x028000, 0x0287ff, MAP_RAM); - SekSetReadWordHandler(0, Terracre68KReadWord); - SekSetWriteWordHandler(0, Terracre68KWriteWord); - SekSetReadByteHandler(0, Terracre68KReadByte); - SekSetWriteByteHandler(0, Terracre68KWriteByte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(TerracreZ80PortRead); - if (DrvUseYM2203) { - ZetSetOutHandler(TerracreYM2203Z80PortWrite); - } else { - ZetSetOutHandler(TerracreZ80PortWrite); - } - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom); - ZetMapArea(0xc000, 0xcfff, 0, DrvZ80Ram); - ZetMapArea(0xc000, 0xcfff, 1, DrvZ80Ram); - ZetMapArea(0xc000, 0xcfff, 2, DrvZ80Ram); - ZetClose(); - - if (DrvUseYM2203) { - BurnYM2203Init(1, 4000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.20, BURN_SND_ROUTE_BOTH); - } else { - BurnYM3526Init(4000000, NULL, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - } - - DACInit(0, 0, 1, TerracreSyncDAC); - DACInit(1, 0, 1, TerracreSyncDAC); - DACSetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvRecalcPal = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 DrvAmazonInit() -{ - INT32 nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - if (LoadRomsFunction()) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0x040000, 0x040fff, MAP_RAM); - SekMapMemory(DrvBgVideoRam , 0x042000, 0x042fff, MAP_RAM); - SekMapMemory(DrvFgVideoRam , 0x050000, 0x050fff, MAP_RAM); - SekSetReadWordHandler(0, Amazon68KReadWord); - SekSetWriteWordHandler(0, Amazon68KWriteWord); - SekSetReadByteHandler(0, Amazon68KReadByte); - SekSetWriteByteHandler(0, Amazon68KWriteByte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(TerracreZ80PortRead); - ZetSetOutHandler(TerracreZ80PortWrite); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom); - ZetMapArea(0xc000, 0xcfff, 0, DrvZ80Ram); - ZetMapArea(0xc000, 0xcfff, 1, DrvZ80Ram); - ZetMapArea(0xc000, 0xcfff, 2, DrvZ80Ram); - ZetClose(); - - BurnYM3526Init(4000000, NULL, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3526(4000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, TerracreSyncDAC); - DACInit(1, 0, 1, TerracreSyncDAC); - DACSetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvRecalcPal = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 TerracreLoadRoms() -{ - INT32 nRet; - - DrvTempRom = (UINT8 *)BurnMalloc(0x10000); - - nRet = BurnLoadRom(Drv68KRom + 0x000000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000001, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010001, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvZ80Rom + 0x000000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x004000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x008000, 6, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 9, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvTiles); - - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 13, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvProms + 0x00000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00100, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00200, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00300, 17, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvSpritePalBank , 18, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 TerracreoLoadRoms() -{ - INT32 nRet; - - DrvTempRom = (UINT8 *)BurnMalloc(0x10000); - - nRet = BurnLoadRom(Drv68KRom + 0x000000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000001, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x008000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x008001, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010001, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x018000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x018001, 7, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvZ80Rom + 0x000000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x004000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x008000, 10, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 13, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvTiles); - - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 17, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvProms + 0x00000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00100, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00200, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00300, 21, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvSpritePalBank , 22, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 TerracrenLoadRoms() -{ - INT32 nRet; - - DrvTempRom = (UINT8 *)BurnMalloc(0x10000); - - nRet = BurnLoadRom(Drv68KRom + 0x000000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000001, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x008000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x008001, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010001, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x018000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x018001, 7, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvZ80Rom + 0x000000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x004000, 9, 1); if (nRet != 0) return 1; - memset(DrvZ80Rom + 0x8000, 0xff, 0x4000); - - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 12, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvTiles); - - memset(DrvTempRom, 0, 0x10000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 16, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvProms + 0x00000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00100, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00200, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00300, 20, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvSpritePalBank , 21, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 AmazonLoadRoms() -{ - INT32 nRet; - - DrvTempRom = (UINT8 *)BurnMalloc(0x20000); - - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvZ80Rom + 0x000000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x004000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x008000, 6, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvTiles); - - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x04000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c000, 14, 1); if (nRet != 0) return 1; - GfxDecode(0x200, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvProms + 0x00000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00100, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00200, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00300, 18, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvSpritePalBank , 19, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 HorekidLoadRoms() -{ - INT32 nRet; - - DrvTempRom = (UINT8 *)BurnMalloc(0x20000); - - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x010000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvZ80Rom + 0x000000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x004000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom + 0x008000, 6, 1); if (nRet != 0) return 1; - - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - GfxDecode(0x100, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 11, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, DrvTempRom, DrvTiles); - - memset(DrvTempRom, 0, 0x20000); - nRet = BurnLoadRom(DrvTempRom + 0x00000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 15, 1); if (nRet != 0) return 1; - GfxDecode(0x400, 4, 16, 16, SpritePlaneOffsets, HorekidSpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvProms + 0x00000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00100, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00200, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvProms + 0x00300, 19, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvSpritePalBank , 20, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static UINT16 AmazonProtData[] = { - 0x0000, 0x5000, 0x5341, 0x4b45, 0x5349, 0x4755, 0x5245, - 0x0000, 0x4000, 0x0e4b, 0x4154, 0x5544, 0x4f4e, 0x0e0e, - 0x0000, 0x3000, 0x414e, 0x4b41, 0x4b45, 0x5544, 0x4f4e, - 0x0000, 0x2000, 0x0e0e, 0x4b49, 0x5455, 0x4e45, 0x0e0e, - 0x0000, 0x1000, 0x0e4b, 0x414b, 0x4553, 0x4f42, 0x410e, - - 0x4ef9, 0x0000, 0x62fa, 0x0000, 0x4ef9, 0x0000, 0x805E, 0x0000, 0xc800 -}; - -static UINT16 AmatelasProtData[] = { - 0x0000, 0x5000, 0x5341, 0x4b45, 0x5349, 0x4755, 0x5245, - 0x0000, 0x4000, 0x0e4b, 0x4154, 0x5544, 0x4f4e, 0x0e0e, - 0x0000, 0x3000, 0x414e, 0x4b41, 0x4b45, 0x5544, 0x4f4e, - 0x0000, 0x2000, 0x0e0e, 0x4b49, 0x5455, 0x4e45, 0x0e0e, - 0x0000, 0x1000, 0x0e4b, 0x414b, 0x4553, 0x4f42, 0x410e, - - 0x4ef9, 0x0000, 0x632e, 0x0000, 0x4ef9, 0x0000, 0x80C2, 0x0000, 0x6100 -}; - -static UINT16 HorekidProtData[] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - - 0x4e75, 0x4e75, 0x4e75, 0x4e75, 0x4e75, 0x4e75, 0x4e75, 0x4e75, 0x1800 -}; - -static INT32 TerracreInit() -{ - LoadRomsFunction = TerracreLoadRoms; - - return DrvInit(); -} - -static INT32 TerracreoInit() -{ - LoadRomsFunction = TerracreoLoadRoms; - - return DrvInit(); -} - -static INT32 TerracrenInit() -{ - LoadRomsFunction = TerracrenLoadRoms; - DrvUseYM2203 = 1; - - return DrvInit(); -} - -static INT32 AmazonInit() -{ - LoadRomsFunction = AmazonLoadRoms; - AmazonProtDataPtr = AmazonProtData; - - return DrvAmazonInit(); -} - -static INT32 AmatelasInit() -{ - LoadRomsFunction = AmazonLoadRoms; - AmazonProtDataPtr = AmatelasProtData; - - return DrvAmazonInit(); -} - -static INT32 HorekidInit() -{ - LoadRomsFunction = HorekidLoadRoms; - AmazonProtDataPtr = HorekidProtData; - DrvIsHorekid = 1; - - return DrvAmazonInit(); -} - -static INT32 DrvExit() -{ - SekExit(); - ZetExit(); - - if (DrvUseYM2203) { - BurnYM2203Exit(); - } else { - BurnYM3526Exit(); - } - DACExit(); - - GenericTilesExit(); - - BurnFree(Mem); - - DrvScrollX = 0; - DrvScrollY = 0; - DrvDisableBg = 0; - DrvFlipScreen = 0; - DrvSoundLatch = 0; - AmazonProtCmd = 0; - memset(AmazonProtReg, 0, 6); - - DrvUseYM2203 = 0; - DrvIsHorekid = 0; - - LoadRomsFunction = NULL; - AmazonProtDataPtr = NULL; - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -static void DrvCalcPalette() -{ - UINT32 PalLookup[0x100]; - INT32 i; - - for (i = 0; i < 0x100; i++) { - INT32 r = pal4bit(DrvProms[i + 0x000]); - INT32 g = pal4bit(DrvProms[i + 0x100]); - INT32 b = pal4bit(DrvProms[i + 0x200]); - - PalLookup[i] = BurnHighCol(r, g, b, 0); - } - - for (i = 0; i < 0x10; i++) { - DrvPalette[i] = PalLookup[i]; - } - - for (i = 0; i < 0x100; i++) { - UINT8 ctabentry; - - if (i & 0x08) { - ctabentry = 0xc0 | (i & 0x0f) | ((i & 0xc0) >> 2); - } else { - ctabentry = 0xc0 | (i & 0x0f) | ((i & 0x30) >> 0); - } - - DrvPalette[0x10 + i] = PalLookup[ctabentry]; - } - - for (i = 0; i < 0x1000; i++) { - UINT8 ctabentry; - INT32 i_swapped = ((i & 0x0f) << 8) | ((i & 0xff0) >> 4); - - if (i & 0x80) { - ctabentry = 0x80 | ((i & 0x0c) << 2) | (DrvProms[0x300 + (i >> 4)] & 0x0f); - } else { - ctabentry = 0x80 | ((i & 0x03) << 4) | (DrvProms[0x300 + (i >> 4)] & 0x0f); - } - - DrvPalette[0x110 + i_swapped] = PalLookup[ctabentry]; - } - - DrvRecalcPal = 0; -} - -static void DrvRenderBgLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex; - - UINT16 *VideoRam = (UINT16*)DrvBgVideoRam; - - for (mx = 0; mx < 32; mx++) { - for (my = 0; my < 64; my++) { - TileIndex = (my * 32) + mx; - Code = VideoRam[TileIndex]; - Colour = (Code >> 11) + (0x10 >> 4); - Code &= 0x3ff; - - y = 16 * mx; - x = 16 * my; - - x -= DrvScrollX; - y -= DrvScrollY; - if (x < -16) x += 1024; - if (y < -16) y += 512; - - if (DrvFlipScreen) { - x = 240 - x; - y = 240 - y; - } - - y -= 16; - - if (DrvFlipScreen) { - if (x > 16 && x < 240 && y > 16 && y < 208) { - Render16x16Tile_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, DrvTiles); - } else { - Render16x16Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, DrvTiles); - } - } else { - if (x > 16 && x < 240 && y > 16 && y < 208) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 0, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0, DrvTiles); - } - } - } - } -} - -static void DrvRenderFgLayer() -{ - INT32 mx, my, Code, x, y, TileIndex; - - UINT16 *VideoRam = (UINT16*)DrvFgVideoRam; - - for (mx = 0; mx < 32; mx++) { - for (my = 0; my < 64; my++) { - TileIndex = (my * 32) + mx; - Code = VideoRam[TileIndex] & 0xff; - - y = 8 * mx; - x = 8 * my; - - if (DrvFlipScreen) { - x = 248 - x; - y = 248 - y; - } - - y -= 16; - - if (DrvFlipScreen) { - if (x > 8 && x < 248 && y > 8 && y < 216) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, 0, 4, 0x0f, 0, DrvChars); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, 0, 4, 0x0f, 0, DrvChars); - } - } else { - if (x > 8 && x < 248 && y > 8 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, 0, 4, 0x0f, 0, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, 0, 4, 0x0f, 0, DrvChars); - } - } - } - } -} - -static void DrawSprites() -{ - UINT16 *pSource = (UINT16*)DrvSpriteRam; - INT32 TransparentPen = 0x00; - if (DrvIsHorekid) TransparentPen = 0x0f; - - for (INT32 i = 0; i < 0x200; i += 8) { - INT32 Tile = pSource[1] & 0xff; - INT32 Attrs = pSource[2]; - INT32 xFlip = Attrs & 0x04; - INT32 yFlip = Attrs & 0x08; - INT32 Colour = (Attrs & 0xf0) >> 4; - INT32 sx = (pSource[3] & 0xff) - 0x80 + 256 * (Attrs & 1); - INT32 sy = 240 - (pSource[0] & 0xff); - - if (DrvIsHorekid) { - INT32 Bank; - - if (Attrs & 0x02) Tile |= 0x200; - if (Attrs & 0x10) Tile |= 0x100; - - Bank = (Tile & 0xfc) >> 1; - if (Tile & 0x200) Bank |= 0x80; - if (Tile & 0x100) Bank |= 0x01; - - Colour &= 0xe; - Colour += 16 * (DrvSpritePalBank[Bank] & 0x0f); - } else { - if (Attrs & 0x02) Tile |= 0x100; - Colour += 16 * (DrvSpritePalBank[(Tile >> 1) & 0xff] & 0x0f); - } - - Colour += (0x110) >> 4; - - if (DrvFlipScreen) { - sx = 240 - sx; - sy = 240 - sy; - xFlip = !xFlip; - yFlip = !yFlip; - } - - sy -= 16; - - if (sx > 16 && sx < 240 && sy > 16 && sy < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Tile, sx, sy, Colour, 4, TransparentPen, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Tile, sx, sy, Colour, 4, TransparentPen, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile, sx, sy, Colour, 4, TransparentPen, 0, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Tile, sx, sy, Colour, 4, TransparentPen, 0, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Tile, sx, sy, Colour, 4, TransparentPen, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Tile, sx, sy, Colour, 4, TransparentPen, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile, sx, sy, Colour, 4, TransparentPen, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Tile, sx, sy, Colour, 4, TransparentPen, 0, DrvSprites); - } - } - } - - pSource += 4; - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - if (DrvRecalcPal) DrvCalcPalette(); - if (nBurnLayer & 0x01 && !DrvDisableBg) DrvRenderBgLayer(); - if (nSpriteEnable & 0x01) DrawSprites(); - if (nBurnLayer & 0x02) DrvRenderFgLayer(); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nCyclesTotal[2] = { 8000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nInterleave = 17*8; // 136 - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - SekClose(); - - nCurrentCPU = 1; - ZetOpen(0); - if (DrvUseYM2203) { - BurnTimerUpdate((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - } else { - BurnTimerUpdateYM3526((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - } - { // 136 times per frame. - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - nCyclesDone[1] += ZetRun(100); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - ZetClose(); - } - - ZetOpen(0); - if (DrvUseYM2203) { - BurnTimerEndFrame(nCyclesTotal[1]); - } else { - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - } - if (pBurnSoundOut) { - if (DrvUseYM2203) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } else { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - if (DrvUseYM2203) { - BurnYM2203Scan(nAction, pnMin); - } else { - BurnYM3526Scan(nAction, pnMin); - } - - DACScan(nAction, pnMin); - - SCAN_VAR(DrvScrollX); - SCAN_VAR(DrvScrollY); - SCAN_VAR(DrvDisableBg); - SCAN_VAR(DrvFlipScreen); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(AmazonProtCmd); - SCAN_VAR(AmazonProtReg); - - if (nAction & ACB_WRITE) { - DrvRecalcPal = 1; - } - } - - return 0; -} - -struct BurnDriver BurnDrvTerracre = { - "terracre", NULL, NULL, NULL, "1985", - "Terra Cresta (YM3526 set 1)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - TerracreInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalcPal, 0x1110, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTerracreo = { - "terracreo", "terracre", NULL, NULL, "1985", - "Terra Cresta (YM3526 set 2)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, DrvoRomInfo, DrvoRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - TerracreoInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalcPal, 0x1110, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTerracrea = { - "terracrea", "terracre", NULL, NULL, "1985", - "Terra Cresta (YM3526 set 3)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, DrvaRomInfo, DrvaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - TerracreoInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalcPal, 0x1110, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTerracren = { - "terracren", "terracre", NULL, NULL, "1985", - "Terra Cresta (YM2203)\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, DrvnRomInfo, DrvnRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - TerracrenInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalcPal, 0x1110, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAmazon = { - "amazon", NULL, NULL, NULL, "1986", - "Soldier Girl Amazon\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, AmazonRomInfo, AmazonRomName, NULL, NULL, AmazonInputInfo, AmazonDIPInfo, - AmazonInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalcPal, 0x1110, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvAmatelas = { - "amatelas", "amazon", NULL, NULL, "1986", - "Sei Senshi Amatelass\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, AmatelasRomInfo, AmatelasRomName, NULL, NULL, AmazonInputInfo, AmazonDIPInfo, - AmatelasInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalcPal, 0x1110, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHorekid = { - "horekid", NULL, NULL, NULL, "1987", - "Kid no Hore Hore Daisakusen\0", NULL, "Nichibutsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, HorekidRomInfo, HorekidRomName, NULL, NULL, HorekidInputInfo, HorekidDIPInfo, - HorekidInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalcPal, 0x1110, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHorekidb = { - "horekidb", "horekid", NULL, NULL, "1987", - "Kid no Hore Hore Daisakusen (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, HorekidbRomInfo, HorekidbRomName, NULL, NULL, HorekidInputInfo, HorekidDIPInfo, - HorekidInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalcPal, 0x1110, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvBoobhack = { - "boobhack", "horekid", NULL, NULL, "1987", - "Booby Kids (Italian manufactured graphic hack / bootleg of Kid no Hore Hore Daisakusen (bootleg))\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, BoobhackRomInfo, BoobhackRomName, NULL, NULL, HorekidInputInfo, HorekidDIPInfo, - HorekidInit, DrvExit, DrvFrame, NULL, DrvScan, - &DrvRecalcPal, 0x1110, 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_thedeep.cpp b/jan/src/burn/drv/pre90s/d_thedeep.cpp deleted file mode 100644 index 0ddfc091a..000000000 --- a/jan/src/burn/drv/pre90s/d_thedeep.cpp +++ /dev/null @@ -1,838 +0,0 @@ -// FB Alpha The Deep driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6502_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvM6502ROM; -static UINT8 *DrvMCUROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvM6502RAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvScrollRAM; - -static UINT8 *scroll; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 rom_bank; -static UINT8 nmi_enable; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 protection_data; -static UINT8 protection_command; -static INT32 protection_index; -static UINT8 protection_irq; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[5]; -static UINT8 DrvInput4; -static UINT8 DrvReset; - -static INT32 hold_coin[4]; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 2, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 3, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x03, 0x00, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x0c, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Start Stage" }, - {0x12, 0x01, 0x20, 0x20, "1" }, - {0x12, 0x01, 0x20, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Harder" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x0c, 0x0c, "3" }, - {0x13, 0x01, 0x0c, 0x08, "4" }, - {0x13, 0x01, 0x0c, 0x04, "5" }, - {0x13, 0x01, 0x0c, 0x00, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x00, "50k" }, - {0x13, 0x01, 0x30, 0x30, "50k 70k" }, - {0x13, 0x01, 0x30, 0x20, "60k 80k" }, - {0x13, 0x01, 0x30, 0x10, "80k 100k" }, - - {0 , 0xfe, 0 , 0, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static void bankswitch(INT32 data) -{ - rom_bank = data; - - ZetMapMemory(DrvZ80ROM + 0x10000 + (rom_bank * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void protection_write(UINT8 data) -{ - protection_command = data; - - switch (protection_command) - { - case 0x11: - case 0x20: - flipscreen = protection_command & 1; - break; - - case 0x30: - case 0x31: - case 0x32: - case 0x33: - bankswitch(protection_command & 3); - break; - - case 0x59: - { - if (protection_index < 0) protection_index = 0; - - if (protection_index < 0x19b) - protection_data = DrvMCUROM[0x185 + protection_index++]; - else - protection_data = 0xc9; - - protection_irq = 1; - } - break; - } -} - -static void __fastcall thedeep_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - protection_write(data); - return; - - case 0xe004: - nmi_enable = data; - return; - - case 0xe00c: - soundlatch = data; - M6502SetIRQLine(0x20, CPU_IRQSTATUS_ACK); - return; - - case 0xe100: - return; // nop - - case 0xe210: - case 0xe211: - case 0xe212: - case 0xe213: - scroll[address & 3] = data; - return; - } -} - -static UINT8 __fastcall thedeep_main_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - protection_irq = 0; - return protection_data; - - case 0xe004: - return protection_irq ? 1 : 0; - - case 0xe008: - case 0xe009: - case 0xe00a: - case 0xe00b: - return DrvInputs[address & 3]; - } - - return 0; -} - -static void thedeep_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0800: - case 0x0801: - BurnYM2203Write(0, address & 1, data); - return; - } -} - -static UINT8 thedeep_sound_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - M6502SetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - M6502SetIRQLine(0, ((nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE)); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(M6502TotalCycles() * nSoundRate / 1500000); -} - -inline static double DrvGetTime() -{ - return (double)M6502TotalCycles() / 1500000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - bankswitch(0); - ZetReset(); - ZetClose(); - - M6502Open(0); - M6502Reset(); - BurnYM2203Reset(); - M6502Close(); - - nmi_enable = 0; - soundlatch = 0; - flipscreen = 0; - protection_data = 0; - protection_command = 0; - protection_index = -1; - protection_irq = 0; - - memset (hold_coin, 0, 4 * sizeof(INT32)); - DrvInput4 = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x020000; - DrvM6502ROM = Next; Next += 0x008000; - DrvMCUROM = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000400; - - DrvPalette = (UINT32*)Next; Next += 0x000201 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x002000; - DrvM6502RAM = Next; Next += 0x000800; - DrvVidRAM0 = Next; Next += 0x000800; - DrvVidRAM1 = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000400; - DrvScrollRAM = Next; Next += 0x000800; - - scroll = Next; Next += 0x000004; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0, 4 }; - INT32 XOffs0[8] = { STEP4((0x4000*8)/2,1), STEP4(0,1) }; - INT32 YOffs0[8] = { STEP8(0,8) }; - - INT32 Plane1[4] = { 0x80000 * 0, 0x80000 * 1, 0x80000 * 2, 0x80000 * 3 }; - INT32 XOffs1[16] = { STEP8(128,1), STEP8(0,1) }; - INT32 YOffs1[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x04000); - - GfxDecode(0x0400, 2, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6502ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvMCUROM, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x30000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1; - - // if (BurnLoadRom(DrvColPROM + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 15, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe400, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvVidRAM1, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvVidRAM0, 0xf000, 0xf7ff, MAP_RAM); - ZetMapMemory(DrvScrollRAM, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(thedeep_main_write); - ZetSetReadHandler(thedeep_main_read); - ZetClose(); - - M6502Init(0, TYPE_M65C02); - M6502Open(0); - M6502MapMemory(DrvM6502RAM, 0x0000, 0x07ff, MAP_RAM); - M6502MapMemory(DrvM6502ROM, 0x8000, 0xffff, MAP_ROM); - M6502SetWriteHandler(thedeep_sound_write); - M6502SetReadHandler(thedeep_sound_read); - M6502Close(); - - BurnYM2203Init(1, 3000000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachM6502(1500000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - M6502Exit(); - - BurnYM2203Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 512; i++) - { - UINT8 r = DrvColPROM[0x200 + i] & 0xf; - INT32 g = DrvColPROM[0x200 + i] >> 4; - INT32 b = DrvColPROM[0x000 + i] & 0xf; - - DrvPalette[i] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); - } - - DrvPalette[0x200] = 0; // black -} - -static void draw_background() -{ - INT32 scrollx = (scroll[0] + (scroll[1] << 8)) & 0x1ff; - INT32 scrolly = (scroll[2] + (scroll[3] << 8)) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 col = offs & 0x1f; // sx - INT32 row = offs / 0x20; // sy - - INT32 ofst = (col & 0x0f) + ((col & 0x10) << 5) + (row << 4); - - INT32 sx = col * 16; - INT32 sy = row * 16; - - INT32 yscroll = (scrolly + (DrvScrollRAM[col*2+0] + ((DrvScrollRAM[col*2+1] & 1) * 256))) & 0x1ff; - - sx -= scrollx; - if (sx < -15) sx += 512; - sy -= yscroll; - if (sy < -15) sy += 512; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 attr = DrvVidRAM0[ofst * 2 + 1]; - INT32 code = DrvVidRAM0[ofst * 2 + 0] + ((attr & 0x0f) << 8); - INT32 color = attr >> 4; - - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code & 0x7ff, sx, sy, color, 4, 0, 0x100, DrvGfxROM1); - } -} - -static void draw_foreground() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvVidRAM1[offs * 2 + 1]; - INT32 code = DrvVidRAM1[offs * 2 + 0] + ((attr & 0x0f) << 8); - INT32 color = attr >> 4; - - Render8x8Tile_Mask_Clip(pTransDraw, code & 0x3ff, sx, sy, color, 2, 0, 0, DrvGfxROM2); - } -} - -static void draw_sprites() -{ - int offs = 0; - UINT16 *spriteram = (UINT16*)DrvSprRAM; - - while (offs < (0x400 / 2)) - { - int sx, sy, code, color, w, h, flipx, flipy, incy, flash, mult, x, y; - - sy = spriteram[offs]; - sx = spriteram[offs + 2]; - color = sx >> 12; - - flash = sx & 0x800; - - flipx = sy & 0x2000; - flipy = sy & 0x4000; - h = (1 << ((sy & 0x1800) >> 11)); - w = (1 << ((sy & 0x0600) >> 9)); - - sx = sx & 0x01ff; - sy = sy & 0x01ff; - if (sx >= 256) sx -= 512; - if (sy >= 256) sy -= 512; - sx = 240 - sx; - sy = 240 - sy; - - if (flipscreen) - { - sy = 240 - sy; - sx = 240 - sx; - if (flipx) flipx = 0; else flipx = 1; - if (flipy) flipy = 0; else flipy = 1; - mult = 16; - } - else - mult = -16; - - // thedeep strongly suggests that this check goes here, otherwise the radar breaks - if (!(spriteram[offs] & 0x8000)) - { - offs += 4; - continue; - } - - for (x = 0; x < w; x++) - { - code = (spriteram[offs + 1] & 0x1fff) & ~(h - 1); - - if (flipy) - incy = -1; - else - { - code += h - 1; - incy = 1; - } - - for (y = 0; y < h; y++) - { - int draw = 0; - - if (!flash || (nCurrentFrame & 1)) - { - draw = 1; - } - - if (draw) - { - INT32 code2 = (code - y * incy) & 0x7ff; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code2, sx + (mult * x), sy + (mult * y), color+8, 4, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code2, sx + (mult * x), sy + (mult * y), color+8, 4, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code2, sx + (mult * x), sy + (mult * y), color+8, 4, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code2, sx + (mult * x), sy + (mult * y), color+8, 4, 0, 0, DrvGfxROM0); - } - } - } - } - - offs += 4; - if (offs >= (0x400 / 2)) - return; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x200; - } - - draw_background(); - draw_sprites(); - draw_foreground(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void interrupt_handler(INT32 param) -{ - INT32 scanline = param; - - if (scanline == 124) // TODO: clean this - { - if (protection_command != 0x59) - { - int coins = DrvInput4; - if (coins & 1) protection_data = 1; - else if (coins & 2) protection_data = 2; - else if (coins & 4) protection_data = 3; - else protection_data = 0; - - if (protection_data) - protection_irq = 1; - } - if (protection_irq) - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - else if(scanline == 0) - { - if (nmi_enable) - { - ZetNmi(); - } - } -} - -static INT32 previous_coin = 0; - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - M6502NewFrame(); - - { - DrvInputs[0] = 0xff; - DrvInputs[1] = 0xff; - DrvInputs[4] = 0; // real inputs #4 - DrvInput4 = 0; // hold coin for 1 single frame-processed. - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy3[i] & 1) << i; - } - - for (INT32 i = 0; i < 4; i++) { - if ((previous_coin != (DrvInputs[4]&7)) && DrvJoy3[i] && !hold_coin[i]) { - hold_coin[i] = 2; // frames to hold coin + 1 - } - - if (hold_coin[i]) { - hold_coin[i]--; - DrvInput4 |= 1<> 8) & 0x0f; - g = (data >> 4) & 0x0f; - b = (data >> 0) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[offset / 2] = BurnHighCol(r, g, b, 0); -} - -static const UINT16 f1dream_613ea_lookup[16] = { -0x0052, 0x0031, 0x00a7, 0x0043, 0x0007, 0x008a, 0x00b1, 0x0066, 0x009f, 0x00cc, 0x0009, 0x004d, 0x0033, 0x0028, 0x00d0, 0x0025}; - -static const UINT16 f1dream_613eb_lookup[256] = { -0x0001, 0x00b5, 0x00b6, 0x00b6, 0x00b6, 0x00b6, 0x00b6, 0x00b6, 0x00b7, 0x0001, 0x00b8, 0x002f, 0x002f, 0x002f, 0x002f, 0x00b9, -0x00aa, 0x0031, 0x00ab, 0x00ab, 0x00ab, 0x00ac, 0x00ad, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x0091, -0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x009b, 0x0091, -0x00bc, 0x0092, 0x000b, 0x0009, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0073, 0x0001, 0x0098, 0x0099, 0x009a, 0x009b, 0x0091, -0x00bc, 0x007b, 0x000b, 0x0008, 0x0087, 0x0088, 0x0089, 0x008a, 0x007f, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, -0x00bd, 0x007b, 0x000b, 0x0007, 0x007c, 0x007d, 0x007e, 0x0001, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, -0x00bc, 0x0070, 0x000b, 0x0006, 0x0071, 0x0072, 0x0073, 0x0001, 0x0074, 0x000d, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, -0x00bc, 0x00ba, 0x000a, 0x0005, 0x0065, 0x0066, 0x0067, 0x0068, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, -0x00bc, 0x0059, 0x0001, 0x0004, 0x005a, 0x005b, 0x0001, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, -0x0014, 0x004d, 0x0001, 0x0003, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0001, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, -0x0014, 0x0043, 0x0001, 0x0002, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x00bb, 0x004a, 0x004b, 0x004c, 0x0001, 0x0001, -0x0014, 0x002b, 0x0001, 0x0038, 0x0039, 0x003a, 0x003b, 0x0031, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0001, -0x0014, 0x002d, 0x0001, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0001, 0x0014, 0x0037, 0x0001, -0x0014, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x0001, 0x0001, 0x0001, 0x002a, 0x002b, 0x002c, -0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001e, 0x001e, 0x001e, 0x001f, 0x0020, -0x000c, 0x000d, 0x000e, 0x0001, 0x000f, 0x0010, 0x0011, 0x0012, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x0013 }; - -static const UINT16 f1dream_17b74_lookup[128] = { -0x0003, 0x0040, 0x0005, 0x0080, 0x0003, 0x0080, 0x0005, 0x00a0, 0x0003, 0x0040, 0x0005, 0x00c0, 0x0003, 0x0080, 0x0005, 0x00e0, -0x0003, 0x0040, 0x0006, 0x0000, 0x0003, 0x0080, 0x0006, 0x0020, 0x0003, 0x0040, 0x0006, 0x0040, 0x0003, 0x0080, 0x0006, 0x0060, -0x0000, 0x00a0, 0x0009, 0x00e0, 0x0000, 0x00e0, 0x000a, 0x0000, 0x0000, 0x00a0, 0x000a, 0x0020, 0x0000, 0x00e0, 0x000a, 0x0040, -0x0000, 0x00a0, 0x000a, 0x0060, 0x0000, 0x00e0, 0x000a, 0x0080, 0x0000, 0x00a0, 0x000a, 0x00a0, 0x0000, 0x00e0, 0x000a, 0x00c0, -0x0003, 0x0040, 0x0005, 0x0080, 0x0003, 0x0080, 0x0005, 0x00a0, 0x0003, 0x0040, 0x0005, 0x00c0, 0x0003, 0x0080, 0x0005, 0x00e0, -0x0003, 0x0040, 0x0006, 0x0000, 0x0003, 0x0080, 0x0006, 0x0020, 0x0003, 0x0040, 0x0006, 0x0040, 0x0003, 0x0080, 0x0006, 0x0060, -0x0000, 0x00a0, 0x0009, 0x00e0, 0x0000, 0x00e0, 0x000a, 0x0000, 0x0000, 0x00a0, 0x000a, 0x0020, 0x0000, 0x00e0, 0x000a, 0x0040, -0x0000, 0x00a0, 0x000a, 0x0060, 0x0000, 0x00e0, 0x000a, 0x0080, 0x0000, 0x00a0, 0x000a, 0x00a0, 0x0000, 0x00e0, 0x000a, 0x00c0 }; - -static const UINT16 f1dream_2450_lookup[32] = { -0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, -0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0 }; - -static void f1dream_protection_w() -{ - INT32 indx; - INT32 value = 255; - INT32 prevpc = SekGetPC(0)-8; - UINT16* ram16 = (UINT16*)Drv68KRAM; - - if (prevpc == 0x244c) - { - indx = ram16[0x3ff0/2]; - ram16[0x3fe6/2] = f1dream_2450_lookup[indx]; - ram16[0x3fe8/2] = f1dream_2450_lookup[++indx]; - ram16[0x3fea/2] = f1dream_2450_lookup[++indx]; - ram16[0x3fec/2] = f1dream_2450_lookup[++indx]; - } - else if (prevpc == 0x613a) - { - if (ram16[0x3ff6/2] < 15) - { - indx = f1dream_613ea_lookup[ram16[0x3ff6/2]] - ram16[0x3ff4/2]; - if (indx > 255) - { - indx <<= 4; - indx += ram16[0x3ff6/2] & 0x00ff; - value = f1dream_613eb_lookup[indx & 0xff]; - } - } - - ram16[0x3ff2/2] = value; - } - else if (prevpc == 0x17b70) - { - if (ram16[0x3ff0/2] >= 0x04) indx = 128; - else if (ram16[0x3ff0/2] > 0x02) indx = 96; - else if (ram16[0x3ff0/2] == 0x02) indx = 64; - else if (ram16[0x3ff0/2] == 0x01) indx = 32; - else indx = 0; - - indx += ram16[0x3fee/2]; - if (indx < 128) - { - ram16[0x3fe6/2] = f1dream_17b74_lookup[indx]; - ram16[0x3fe8/2] = f1dream_17b74_lookup[++indx]; - ram16[0x3fea/2] = f1dream_17b74_lookup[++indx]; - ram16[0x3fec/2] = f1dream_17b74_lookup[++indx]; - } - else - { - ram16[0x3fe6/2] = 0x00ff; - ram16[0x3fe8/2] = 0x00ff; - ram16[0x3fea/2] = 0x00ff; - ram16[0x3fec/2] = 0x00ff; - } - } - else if ((prevpc == 0x27f8) || (prevpc == 0x511a) || (prevpc == 0x5142) || (prevpc == 0x516a)) - { - *soundlatch = ram16[0x3ffc/2] & 0xff; - } -} - -void __fastcall tigeroad_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xfe4000: - *flipscreen = data & 0x02; - *bgcharbank = (data & 0x04) >> 2; - *coin_lockout = (~data & 0x30) << 1; - return; - - case 0xfe4002: - if (nF1dream) { - f1dream_protection_w(); - } else { - *soundlatch = data; - } - return; - } -} - -void __fastcall tigeroad_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0xff8200 && address <= 0xff867f) { - *((UINT16*)(DrvPalRAM + (address - 0xff8000))) = data; - - palette_write(address - 0xff8200); - - return; - } - - switch (address) - { - case 0xfe8000: - case 0xfe8002: - *((UINT16 *)(DrvScrollRAM + (address & 2))) = data; - return; - - case 0xfe800e: - // watchdog - return; - } -} - -UINT8 __fastcall tigeroad_read_byte(UINT32 address) -{ - switch (address) - { - case 0xfe4000: - case 0xfe4001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0xfe4002: - case 0xfe4003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0xfe4004: - case 0xfe4005: - return DrvDip[~address & 1]; - } - - return 0; -} - -UINT16 __fastcall tigeroad_read_word(UINT32 address) -{ - switch (address) - { - case 0xfe4000: - return DrvInputs[0]; - - case 0xfe4002: - return DrvInputs[1]; - - case 0xfe4004: - return ((DrvDip[1] << 8) | DrvDip[0]); - } - - return 0; -} - -void __fastcall tigeroad_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8000: - BurnYM2203Write(0, 0, data); - return; - - case 0x8001: - BurnYM2203Write(0, 1, data); - return; - - case 0xa000: - BurnYM2203Write(1, 0, data); - return; - - case 0xa001: - BurnYM2203Write(1, 1, data); - return; - } -} - -void __fastcall tigeroad_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x7f: - *soundlatch2 = data; - return; - } -} - -UINT8 __fastcall tigeroad_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8000: - return BurnYM2203Read(0, 0); - - case 0xa000: - return BurnYM2203Read(1, 0); - - case 0xe000: - return *soundlatch; - } - - return 0; -} - -void __fastcall tigeroad_sample_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x01: - SekOpen(0); - MSM5205ResetWrite(0, (data >> 7) & 1); - MSM5205DataWrite(0, data); - MSM5205VCLKWrite(0, 1); - MSM5205VCLKWrite(0, 0); - SekClose(); - return; - } -} - -UINT8 __fastcall tigeroad_sample_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return *soundlatch2; - } - - return 0; -} - -static void TigeroadIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 TigeroadSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -static double TigeroadGetTime() -{ - return (double)ZetTotalCycles() / 3579545; -} - -inline static INT32 DrvMSM5205SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)SekTotalCycles() * nSoundRate / 10000000); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - - if (toramich) { - ZetOpen(1); - ZetReset(); - ZetClose(); - - MSM5205Reset(); - } - - if (pBurnSoundOut) { // fix ym2203 junk.. - memset (pBurnSoundOut, 0, nBurnSoundLen); - } - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x008000; - DrvSndROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROM3 = Next; Next += 0x008000; - - DrvPalette = (UINT32*)Next; Next += 0x0240 * sizeof(UINT32); - - DrvTransMask = Next; Next += 0x000010; - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001400; - DrvSprBuf = Next; Next += 0x000500; - - DrvZ80RAM = Next; Next += 0x000800; - - DrvScrollRAM = Next; Next += 0x000004; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - bgcharbank = Next; Next += 0x000001; - coin_lockout = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { ((0x20000 * 8) * 4) + 4, ((0x20000 * 8) * 4) + 0, 4, 0 }; - INT32 XOffs0[32] = { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3, - 64*8+0, 64*8+1, 64*8+2, 64*8+3, 64*8+8+0, 64*8+8+1, 64*8+8+2, 64*8+8+3, - 2*64*8+0, 2*64*8+1, 2*64*8+2, 2*64*8+3, 2*64*8+8+0, 2*64*8+8+1, 2*64*8+8+2, 2*64*8+8+3, - 3*64*8+0, 3*64*8+1, 3*64*8+2, 3*64*8+3, 3*64*8+8+0, 3*64*8+8+1, 3*64*8+8+2, 3*64*8+8+3 }; - INT32 YOffs0[32] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16, - 16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16, - 24*16, 25*16, 26*16, 27*16, 28*16, 29*16, 30*16, 31*16 }; - - INT32 Plane1[4] = { (0x20000*8)*3, (0x20000*8)*2, (0x20000*8)*1, (0x20000*8)*0 }; - INT32 XOffs1[16] = { 0, 1, 2, 3, 4, 5, 6, 7, - 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 }; - INT32 YOffs1[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }; - - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x008000); - - GfxDecode(0x0800, 2, 8, 8, Plane0 + 2, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x100000); - - GfxDecode(0x0800, 4, 32, 32, Plane0 + 0, XOffs0, YOffs0, 0x800, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane1 + 0, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM2); - - for (INT32 i = 0; i < 16; i++) { - DrvTransMask[i] = (0xfe00 >> i) & 1; - } - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(INT32 (*pInitCallback)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (pInitCallback()) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0xfe0800, 0xfe1bff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0xfec000, 0xfec7ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xff8000, 0xff87ff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0xffc000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, tigeroad_write_byte); - SekSetWriteWordHandler(0, tigeroad_write_word); - SekSetReadByteHandler(0, tigeroad_read_byte); - SekSetReadWordHandler(0, tigeroad_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(tigeroad_sound_write); - ZetSetReadHandler(tigeroad_sound_read); - ZetSetOutHandler(tigeroad_sound_out); - ZetClose(); - - if (toramich) { - ZetInit(1); - - ZetOpen(1); - ZetMapArea(0x0000, 0xffff, 0, DrvSndROM); - ZetMapArea(0x0000, 0xffff, 2, DrvSndROM); - ZetSetOutHandler(tigeroad_sample_out); - ZetSetInHandler(tigeroad_sample_in); - ZetClose(); - } - - BurnYM2203Init(2, 3579545, &TigeroadIRQHandler, TigeroadSynchroniseStream, TigeroadGetTime, 0); - BurnTimerAttachZet(3579545); - BurnYM2203SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - if (!toramich) { // toramich has a low psg volume by default - BurnYM2203SetPSGVolume(0, 0.11); - BurnYM2203SetPSGVolume(1, 0.11); - } - - if (toramich) { - MSM5205Init(0, DrvMSM5205SynchroniseStream, 384000, NULL, MSM5205_SEX_4B, 1); - MSM5205SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - } - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2203Exit(); - if (toramich) MSM5205Exit(); - - GenericTilesExit(); - - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - nF1dream = 0; - toramich = 0; - - return 0; -} - -static void draw_sprites() -{ - UINT16 *source = (UINT16*)DrvSprBuf; - - for (INT32 offs = (0x500 - 8) / 2; offs >= 0; offs -=4) - { - INT32 tile_number = BURN_ENDIAN_SWAP_INT16(source[offs + 0]); - - if (tile_number != 0xfff) { - INT32 attr = BURN_ENDIAN_SWAP_INT16(source[offs + 1]); - INT32 sy = BURN_ENDIAN_SWAP_INT16(source[offs + 2]) & 0x1ff; - INT32 sx = BURN_ENDIAN_SWAP_INT16(source[offs + 3]) & 0x1ff; - - INT32 flipx = attr & 0x02; - INT32 flipy = attr & 0x01; - INT32 color = (attr >> 2) & 0x0f; - - if (sx > 0x100) sx -= 0x200; - if (sy > 0x100) sy -= 0x200; - - if (*flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy = (240 - sy) - 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, tile_number, sx, sy, color, 4, 15, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, tile_number, sx, sy, color, 4, 15, 0x100, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, tile_number, sx, sy, color, 4, 15, 0x100, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, tile_number, sx, sy, color, 4, 15, 0x100, DrvGfxROM2); - } - } - } - } -} - -static void draw_32x32_mask_tile(INT32 sx, INT32 sy, INT32 code, INT32 color, INT32 flipx, INT32 flipy) -{ - UINT8 *src = DrvGfxROM1 + (code * 0x400) + (flipy * 0x3e0); - UINT16 *dst; - - INT32 increment = flipy ? -32 : 32; - - for (INT32 y = 0; y < 32; y++, sy++) - { - if (sy >= nScreenHeight) break; - - if (sy >= 0) - { - dst = pTransDraw + (sy * nScreenWidth); - - if (flipx) { - for (INT32 x = 31; x >= 0; x--) - { - if ((sx+x) < 0 || (sx+x) >= nScreenWidth) continue; - - if (DrvTransMask[src[x^0x1f]]) - dst[sx+x] = src[x^0x1f] | color; - } - } else { - for (INT32 x = 0; x < 32; x++) - { - if ((sx+x) < 0 || (sx+x) >= nScreenWidth) continue; - - if (DrvTransMask[src[x]]) - dst[sx+x] = src[x] | color; - } - } - } - - src += increment; - } -} - -static void draw_background(INT32 priority) -{ - INT32 scrollx = *((UINT16*)(DrvScrollRAM + 0)); - INT32 scrolly = *((UINT16*)(DrvScrollRAM + 2)); - - scrollx &= 0xfff; - - scrolly = 0 - scrolly; - scrolly -= 0x100; - scrolly &= 0xfff; - - for (INT32 y = 0; y < 8+1; y++) - { - for (INT32 x = 0; x < 8+1; x++) - { - INT32 sx = (x + (scrollx >> 5)) & 0x7f; - INT32 sy = (y + (scrolly >> 5)) & 0x7f; - - INT32 ofst = ((sx & 7) << 1) + (((127 - sy) & 7) << 4) + ((sx >> 3) << 7) + (((127 - sy) >> 3) << 11); - - INT32 attr = DrvGfxROM3[ofst + 1]; - INT32 prio = attr & 0x10; - if (priority && !prio) continue; - - INT32 data = DrvGfxROM3[ofst]; - INT32 code = data + ((attr & 0xc0) << 2) + (*bgcharbank << 10); - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x20; - INT32 flipy = 0; - - sx = (x << 5) - (scrollx & 0x1f); - sy = (y << 5) - (scrolly & 0x1f); - - if (*flipscreen) { - flipx ^= 0x20; - flipy ^= 1; - - sx = 224 - sx; - sy = 224 - sy; - } - - if (!priority) { - if (flipy) { - if (flipx) { - Render32x32Tile_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM1); - } else { - Render32x32Tile_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render32x32Tile_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM1); - } else { - Render32x32Tile_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM1); - } - } - } else { - draw_32x32_mask_tile(sx, sy - 16, code, color << 4, flipx, flipy); - } - } - } -} - -static void draw_text_layer() -{ - UINT16 *vram = (UINT16*)DrvVidRAM; - - for (INT32 offs = 0x40; offs < 0x3c0; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 data = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 attr = data >> 8; - INT32 code = (data & 0xff) + ((attr & 0xc0) << 2) + ((attr & 0x20) << 5); - if (code == 0x400) continue; - - INT32 color = attr & 0x0f; - INT32 flipx = attr & 0x10; - INT32 flipy = 0; - - if (*flipscreen) { - sx ^= 0xf8; - sy ^= 0xf8; - flipx ^= 0x10; - flipy ^= 0x01; - } - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 3, 0x200, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 3, 0x200, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx - 16, sy, color, 2, 3, 0x200, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 2, 3, 0x200, DrvGfxROM0); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x240 * 2; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - memset (pTransDraw, 0, nScreenWidth * nScreenHeight * 2); - - draw_background(0); - draw_sprites(); - draw_background(1); - draw_text_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = ~0; - DrvInputs[1] = ~0; - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - DrvInputs[1] |= *coin_lockout << 8; - } - - INT32 nCyclesTotal[3] = { 10000000 / 60, 3579545 / 60, 3579545 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - SekNewFrame(); - ZetNewFrame(); - - INT32 nInterleave = 10; - INT32 MSMIRQSlice[67]; - - if (toramich) { - nInterleave = MSM5205CalcInterleave(0, 10000000); - - for (INT32 i = 0; i < 67; i++) { - MSMIRQSlice[i] = (INT32)((double)((nInterleave * (i + 1)) / 68)); - } - } - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (toramich) MSM5205Update(); - SekClose(); - - ZetOpen(0); - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - ZetClose(); - - if (toramich) { - nCurrentCPU = 2; - ZetOpen(1); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - for (INT32 j = 0; j < 67; j++) { - if (i == MSMIRQSlice[j]) { - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - nCyclesDone[nCurrentCPU] += ZetRun(1000); - } - } - ZetClose(); - } - } - - ZetOpen(0); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - if (toramich) { - SekOpen(0); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - SekClose(); - } - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x500); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - if (toramich) { - MSM5205Scan(nAction, pnMin); - } - } - - return 0; -} - - -// Tiger Road (US) * ECT program roms * - -static struct BurnRomInfo tigeroadRomDesc[] = { - { "tre_02.6j", 0x20000, 0xc394add0, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tre_04.6k", 0x20000, 0x73bfbf4a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tru_05.12k", 0x08000, 0xf9a7c9bf, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "tr_01.10d", 0x08000, 0x74a9f08c, 3 | BRF_GRA }, // 3 Character Tiles - - { "tr-01a.3f", 0x20000, 0xa8aa2e59, 4 | BRF_GRA }, // 4 Background Tiles - { "tr-04a.3h", 0x20000, 0x8863a63c, 4 | BRF_GRA }, // 5 - { "tr-02a.3j", 0x20000, 0x1a2c5f89, 4 | BRF_GRA }, // 6 - { "tr-05.3l", 0x20000, 0x5bf453b3, 4 | BRF_GRA }, // 7 - { "tr-03a.2f", 0x20000, 0x1e0537ea, 4 | BRF_GRA }, // 8 - { "tr-06a.2h", 0x20000, 0xb636c23a, 4 | BRF_GRA }, // 9 - { "tr-07a.2j", 0x20000, 0x5f907d4d, 4 | BRF_GRA }, // 10 - { "tr_08.2l", 0x20000, 0xadee35e2, 4 | BRF_GRA }, // 11 EPROM - - { "tr-09a.3b", 0x20000, 0x3d98ad1e, 5 | BRF_GRA }, // 12 Sprites - { "tr-10a.2b", 0x20000, 0x8f6f03d7, 5 | BRF_GRA }, // 13 - { "tr-11a.3d", 0x20000, 0xcd9152e5, 5 | BRF_GRA }, // 14 - { "tr-12a.2d", 0x20000, 0x7d8a99d0, 5 | BRF_GRA }, // 15 - - { "tr_13.7l", 0x08000, 0xa79be1eb, 6 | BRF_GRA }, // 16 Background Tilemaps - - { "tr.9e", 0x00100, 0xec80ae36, 7 | BRF_GRA | BRF_OPT }, // 17 Priority Proms (unused) -}; - -STD_ROM_PICK(tigeroad) -STD_ROM_FN(tigeroad) - -static INT32 TigeroadLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x20000, 4 + i, 1)) return 1; - } - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM2 + i * 0x20000, 12 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 16, 1)) return 1; - - if (toramich) if (BurnLoadRom(DrvSndROM + 0x000000, 18, 1)) return 1; - - return 0; -} - -static INT32 TigeroadInit() -{ - return DrvInit(TigeroadLoadRoms); -} - -struct BurnDriver BurnDrvTigeroad = { - "tigeroad", NULL, NULL, NULL, "1987", - "Tiger Road (US)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, tigeroadRomInfo, tigeroadRomName, NULL, NULL, TigeroadInputInfo, TigeroadDIPInfo, - TigeroadInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// Tiger Road (US, Romstar license) * US ROMSTAR program roms * - -static struct BurnRomInfo tigeroaduRomDesc[] = { - { "tru_02.6j", 0x20000, 0x8d283a95, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tru_04.6k", 0x20000, 0x72e2ef20, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tru_05.12k", 0x08000, 0xf9a7c9bf, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "tr_01.10d", 0x08000, 0x74a9f08c, 3 | BRF_GRA }, // 3 Character Tiles - - { "tr-01a.3f", 0x20000, 0xa8aa2e59, 4 | BRF_GRA }, // 4 Background Tiles - { "tr-04a.3h", 0x20000, 0x8863a63c, 4 | BRF_GRA }, // 5 - { "tr-02a.3j", 0x20000, 0x1a2c5f89, 4 | BRF_GRA }, // 6 - { "tr-05.3l", 0x20000, 0x5bf453b3, 4 | BRF_GRA }, // 7 - { "tr-03a.2f", 0x20000, 0x1e0537ea, 4 | BRF_GRA }, // 8 - { "tr-06a.2h", 0x20000, 0xb636c23a, 4 | BRF_GRA }, // 9 - { "tr-07a.2j", 0x20000, 0x5f907d4d, 4 | BRF_GRA }, // 10 - { "tr_08.2l", 0x20000, 0xadee35e2, 4 | BRF_GRA }, // 11 EPROM - - { "tr-09a.3b", 0x20000, 0x3d98ad1e, 5 | BRF_GRA }, // 12 Sprites - { "tr-10a.2b", 0x20000, 0x8f6f03d7, 5 | BRF_GRA }, // 13 - { "tr-11a.3d", 0x20000, 0xcd9152e5, 5 | BRF_GRA }, // 14 - { "tr-12a.2d", 0x20000, 0x7d8a99d0, 5 | BRF_GRA }, // 15 - - { "tr_13.7l", 0x08000, 0xa79be1eb, 6 | BRF_GRA }, // 16 Background Tilemaps - - { "tr.9e", 0x00100, 0xec80ae36, 7 | BRF_GRA | BRF_OPT }, // 17 Priority Proms (unused) -}; - -STD_ROM_PICK(tigeroadu) -STD_ROM_FN(tigeroadu) - -struct BurnDriver BurnDrvTigeroadu = { - "tigeroadu", "tigeroad", NULL, NULL, "1987", - "Tiger Road (US, Romstar license)\0", NULL, "Capcom (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, tigeroaduRomInfo, tigeroaduRomName, NULL, NULL, TigeroadInputInfo, TigeroadDIPInfo, - TigeroadInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// Tora e no Michi (Japan) - -static struct BurnRomInfo toramichRomDesc[] = { - { "tr_02.6j", 0x20000, 0xb54723b1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tr_04.6k", 0x20000, 0xab432479, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tr_05.12k", 0x08000, 0x3ebe6e62, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "tr_01.10d", 0x08000, 0x74a9f08c, 3 | BRF_GRA }, // 3 Character Tiles - - { "tr-01a.3f", 0x20000, 0xa8aa2e59, 4 | BRF_GRA }, // 4 Background Tiles - { "tr-04a.3h", 0x20000, 0x8863a63c, 4 | BRF_GRA }, // 5 - { "tr-02a.3j", 0x20000, 0x1a2c5f89, 4 | BRF_GRA }, // 6 - { "tr-05.3l", 0x20000, 0x5bf453b3, 4 | BRF_GRA }, // 7 - { "tr-03a.2f", 0x20000, 0x1e0537ea, 4 | BRF_GRA }, // 8 - { "tr-06a.2h", 0x20000, 0xb636c23a, 4 | BRF_GRA }, // 9 - { "tr-07a.2j", 0x20000, 0x5f907d4d, 4 | BRF_GRA }, // 10 - { "tr_08.2l", 0x20000, 0xadee35e2, 4 | BRF_GRA }, // 11 EPROM - - { "tr-09a.3b", 0x20000, 0x3d98ad1e, 5 | BRF_GRA }, // 12 Sprites - { "tr-10a.2b", 0x20000, 0x8f6f03d7, 5 | BRF_GRA }, // 13 - { "tr-11a.3d", 0x20000, 0xcd9152e5, 5 | BRF_GRA }, // 14 - { "tr-12a.2d", 0x20000, 0x7d8a99d0, 5 | BRF_GRA }, // 15 - - { "tr_13.7l", 0x08000, 0xa79be1eb, 6 | BRF_GRA }, // 16 Background Tilemaps - - { "tr.9e", 0x00100, 0xec80ae36, 7 | BRF_GRA | BRF_OPT }, // 17 Priority Proms (unused) - - { "tr_03.11j", 0x10000, 0xea1807ef, 8 | BRF_PRG | BRF_ESS }, // 18 Sample Z80 Code -}; - -STD_ROM_PICK(toramich) -STD_ROM_FN(toramich) - -static INT32 ToramichInit() -{ - toramich = 1; - - return DrvInit(TigeroadLoadRoms); -} - -struct BurnDriver BurnDrvToramich = { - "toramich", "tigeroad", NULL, NULL, "1987", - "Tora e no Michi (Japan)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, toramichRomInfo, toramichRomName, NULL, NULL, TigeroadInputInfo, ToramichDIPInfo, - ToramichInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// Tiger Road (US bootleg) - -static struct BurnRomInfo tigeroadbRomDesc[] = { - { "tgrroad.3", 0x10000, 0x14c87e07, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tgrroad.5", 0x10000, 0x0904254c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tgrroad.2", 0x10000, 0xcedb1f46, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tgrroad.4", 0x10000, 0xe117f0b1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "tru05.bin", 0x08000, 0xf9a7c9bf, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "tr01.bin", 0x08000, 0x74a9f08c, 3 | BRF_GRA }, // 5 Character Tiles - - { "tr-01a.bin", 0x20000, 0xa8aa2e59, 4 | BRF_GRA }, // 6 Background Tiles - { "tr-04a.bin", 0x20000, 0x8863a63c, 4 | BRF_GRA }, // 7 - { "tr-02a.bin", 0x20000, 0x1a2c5f89, 4 | BRF_GRA }, // 8 - { "tr05.bin", 0x20000, 0x5bf453b3, 4 | BRF_GRA }, // 9 - { "tr-03a.bin", 0x20000, 0x1e0537ea, 4 | BRF_GRA }, // 10 - { "tr-06a.bin", 0x20000, 0xb636c23a, 4 | BRF_GRA }, // 11 - { "tr-07a.bin", 0x20000, 0x5f907d4d, 4 | BRF_GRA }, // 12 - { "tgrroad.17", 0x10000, 0x3f7539cc, 4 | BRF_GRA }, // 13 - { "tgrroad.18", 0x10000, 0xe2e053cb, 4 | BRF_GRA }, // 14 - - { "tr-09a.bin", 0x20000, 0x3d98ad1e, 5 | BRF_GRA }, // 15 Sprites - { "tr-10a.bin", 0x20000, 0x8f6f03d7, 5 | BRF_GRA }, // 16 - { "tr-11a.bin", 0x20000, 0xcd9152e5, 5 | BRF_GRA }, // 17 - { "tr-12a.bin", 0x20000, 0x7d8a99d0, 5 | BRF_GRA }, // 18 - - { "tr13.bin", 0x08000, 0xa79be1eb, 6 | BRF_GRA }, // 19 Background Tilemaps - - { "trprom.bin", 0x00100, 0xec80ae36, 7 | BRF_GRA | BRF_OPT }, // 20 Priority Proms (unused) -}; - -STD_ROM_PICK(tigeroadb) -STD_ROM_FN(tigeroadb) - -static INT32 TigeroadbLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x20000, 6 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvGfxROM1 + 0xf0000, 14, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM2 + i * 0x20000, 15 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 19, 1)) return 1; - - return 0; -} - -static INT32 TigeroadbInit() -{ - return DrvInit(TigeroadbLoadRoms); -} - -struct BurnDriver BurnDrvTigeroadb = { - "tigeroadb", "tigeroad", NULL, NULL, "1987", - "Tiger Road (US bootleg, set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, tigeroadbRomInfo, tigeroadbRomName, NULL, NULL, TigeroadInputInfo, TigeroadDIPInfo, - TigeroadbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// Tiger Road (US bootleg, set 2) - -static struct BurnRomInfo tigeroadb2RomDesc[] = { - { "2.bin", 0x10000, 0x14c87e07, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "5.bin", 0x10000, 0x0904254c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.bin", 0x10000, 0xcedb1f46, 1 | BRF_PRG | BRF_ESS }, // 2 - { "6.bin", 0x10000, 0xe117f0b1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "4.bin", 0x08000, 0xf9a7c9bf, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "1.bin", 0x08000, 0x74a9f08c, 3 | BRF_GRA }, // 5 Character Tiles - - { "15.bin", 0x10000, 0x3db68b96, 4 | BRF_GRA }, // 6 Background Tiles - { "17.bin", 0x10000, 0xa12fa19d, 4 | BRF_GRA }, // 7 - { "19.bin", 0x10000, 0xc9c396aa, 4 | BRF_GRA }, // 8 - { "21.bin", 0x10000, 0x6bfc90a4, 4 | BRF_GRA }, // 9 - { "23.bin", 0x10000, 0xdccf34bb, 4 | BRF_GRA }, // 10 - { "25.bin", 0x10000, 0xa1cee4cd, 4 | BRF_GRA }, // 11 - { "28.bin", 0x10000, 0x7266e3ad, 4 | BRF_GRA }, // 12 - { "30.bin", 0x10000, 0x5ec867a6, 4 | BRF_GRA }, // 13 - { "16.bin", 0x10000, 0x95c69541, 4 | BRF_GRA }, // 14 - { "18.bin", 0x10000, 0xecb67157, 4 | BRF_GRA }, // 15 - { "20.bin", 0x10000, 0x53f24910, 4 | BRF_GRA }, // 16 - { "22.bin", 0x10000, 0x5a309d8b, 4 | BRF_GRA }, // 17 - { "24.bin", 0x10000, 0x710feda8, 4 | BRF_GRA }, // 18 - { "26.bin", 0x10000, 0x24b08a7e, 4 | BRF_GRA }, // 19 - { "29.bin", 0x10000, 0x3f7539cc, 4 | BRF_GRA }, // 20 - { "31.bin", 0x10000, 0xe2e053cb, 4 | BRF_GRA }, // 21 - - { "7.bin", 0x10000, 0x12437511, 5 | BRF_GRA }, // 22 Sprites - { "9.bin", 0x10000, 0x9207b4eb, 5 | BRF_GRA }, // 23 - { "8.bin", 0x10000, 0x1e8eb4be, 5 | BRF_GRA }, // 24 - { "10.bin", 0x10000, 0x486a7528, 5 | BRF_GRA }, // 25 - { "11.bin", 0x10000, 0xffb2c34c, 5 | BRF_GRA }, // 26 - { "13.bin", 0x10000, 0x312a40e9, 5 | BRF_GRA }, // 27 - { "12.bin", 0x10000, 0xe5039e3b, 5 | BRF_GRA }, // 28 - { "14.bin", 0x10000, 0x5e564954, 5 | BRF_GRA }, // 29 - - { "27.bin", 0x08000, 0xa79be1eb, 6 | BRF_GRA }, // 30 Background Tilemaps - - { "trprom.bin", 0x00100, 0xec80ae36, 7 | BRF_GRA | BRF_OPT }, // 31 Priority Proms (unused) -}; - -STD_ROM_PICK(tigeroadb2) -STD_ROM_FN(tigeroadb2) - -static INT32 Tigeroadb2LoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - for (INT32 i = 0; i < 16; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x10000, 6 + i, 1)) return 1; - } - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(DrvGfxROM2 + i * 0x10000, 22 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 30, 1)) return 1; - - return 0; -} - -static INT32 Tigeroadb2Init() -{ - return DrvInit(Tigeroadb2LoadRoms); -} - -struct BurnDriver BurnDrvTigeroadb2 = { - "tigeroadb2", "tigeroad", NULL, NULL, "1987", - "Tiger Road (US bootleg, set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_SCRFIGHT | GBF_PLATFORM, 0, - NULL, tigeroadb2RomInfo, tigeroadb2RomName, NULL, NULL, TigeroadInputInfo, TigeroadDIPInfo, - Tigeroadb2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// F-1 Dream - -static struct BurnRomInfo f1dreamRomDesc[] = { - { "06j_02.bin", 0x20000, 0x3c2ec697, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "06k_03.bin", 0x20000, 0x85ebad91, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "12k_04.bin", 0x08000, 0x4b9a7524, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "10d_01.bin", 0x08000, 0x361caf00, 3 | BRF_GRA }, // 3 Character Tiles - - { "03f_12.bin", 0x10000, 0xbc13e43c, 4 | BRF_GRA }, // 4 Background Tiles - { "01f_10.bin", 0x10000, 0xf7617ad9, 4 | BRF_GRA }, // 5 - { "03h_14.bin", 0x10000, 0xe33cd438, 4 | BRF_GRA }, // 6 - { "02f_11.bin", 0x10000, 0x4aa49cd7, 4 | BRF_GRA }, // 7 - { "17f_09.bin", 0x10000, 0xca622155, 4 | BRF_GRA }, // 8 - { "02h_13.bin", 0x10000, 0x2a63961e, 4 | BRF_GRA }, // 9 - - { "03b_06.bin", 0x10000, 0x5e54e391, 5 | BRF_GRA }, // 10 Sprites - { "02b_05.bin", 0x10000, 0xcdd119fd, 5 | BRF_GRA }, // 11 - { "03d_08.bin", 0x10000, 0x811f2e22, 5 | BRF_GRA }, // 12 - { "02d_07.bin", 0x10000, 0xaa9a1233, 5 | BRF_GRA }, // 13 - - { "07l_15.bin", 0x08000, 0x978758b7, 6 | BRF_GRA }, // 14 Background Tilemaps - - { "09e_tr.bin", 0x00100, 0xec80ae36, 7 | BRF_GRA | BRF_OPT }, // 15 Priority Proms (unused) - - { "c8751h-88", 0x01000, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(f1dream) -STD_ROM_FN(f1dream) - -static INT32 F1dreamLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - for (INT32 i = 0; i < 3; i++) { - if (BurnLoadRom(DrvGfxROM1 + 0x00000 + i * 0x10000, 4 + i, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000 + i * 0x10000, 7 + i, 1)) return 1; - } - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM2 + i * 0x20000, 10 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 14, 1)) return 1; - - return 0; -} - -static INT32 F1dreamInit() -{ - nF1dream = 1; - - return DrvInit(F1dreamLoadRoms); -} - -struct BurnDriver BurnDrvF1dream = { - "f1dream", NULL, NULL, NULL, "1988", - "F-1 Dream\0", "Game is bugged, use the bootleg instead.", "Capcom (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARWARE_CAPCOM_MISC, GBF_RACING, 0, - NULL, f1dreamRomInfo, f1dreamRomName, NULL, NULL, TigeroadInputInfo, F1dreamDIPInfo, - F1dreamInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// F-1 Dream (bootleg, set 1) - -static struct BurnRomInfo f1dreambRomDesc[] = { - { "f1d_04.bin", 0x10000, 0x903febad, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "f1d_05.bin", 0x10000, 0x666fa2a7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "f1d_02.bin", 0x10000, 0x98973c4c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "f1d_03.bin", 0x10000, 0x3d21c78a, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "12k_04.bin", 0x08000, 0x4b9a7524, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "10d_01.bin", 0x08000, 0x361caf00, 3 | BRF_GRA }, // 5 Character Tiles - - { "03f_12.bin", 0x10000, 0xbc13e43c, 4 | BRF_GRA }, // 6 Background Tiles - { "01f_10.bin", 0x10000, 0xf7617ad9, 4 | BRF_GRA }, // 7 - { "03h_14.bin", 0x10000, 0xe33cd438, 4 | BRF_GRA }, // 8 - { "02f_11.bin", 0x10000, 0x4aa49cd7, 4 | BRF_GRA }, // 9 - { "17f_09.bin", 0x10000, 0xca622155, 4 | BRF_GRA }, // 10 - { "02h_13.bin", 0x10000, 0x2a63961e, 4 | BRF_GRA }, // 11 - - { "03b_06.bin", 0x10000, 0x5e54e391, 5 | BRF_GRA }, // 12 Sprites - { "02b_05.bin", 0x10000, 0xcdd119fd, 5 | BRF_GRA }, // 13 - { "03d_08.bin", 0x10000, 0x811f2e22, 5 | BRF_GRA }, // 14 - { "02d_07.bin", 0x10000, 0xaa9a1233, 5 | BRF_GRA }, // 15 - - { "07l_15.bin", 0x08000, 0x978758b7, 6 | BRF_GRA }, // 16 Background Tilemaps - - { "09e_tr.bin", 0x00100, 0xec80ae36, 7 | BRF_GRA | BRF_OPT }, // 17 Priority Proms (unused) -}; - -STD_ROM_PICK(f1dreamb) -STD_ROM_FN(f1dreamb) - -static INT32 F1dreambLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - for (INT32 i = 0; i < 3; i++) { - if (BurnLoadRom(DrvGfxROM1 + 0x00000 + i * 0x10000, 6 + i, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000 + i * 0x10000, 9 + i, 1)) return 1; - } - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM2 + i * 0x20000, 12 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 16, 1)) return 1; - - return 0; -} - -static INT32 F1dreambInit() -{ - return DrvInit(F1dreambLoadRoms); -} - -struct BurnDriver BurnDrvF1dreamb = { - "f1dreamb", "f1dream", NULL, NULL, "1988", - "F-1 Dream (bootleg, set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_RACING, 0, - NULL, f1dreambRomInfo, f1dreambRomName, NULL, NULL, TigeroadInputInfo, F1dreamDIPInfo, - F1dreambInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// F-1 Dream (bootleg, set 2) - -static struct BurnRomInfo f1dreambaRomDesc[] = { - { "3.bin", 0x10000, 0xbdfbbbec, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "5.bin", 0x10000, 0xcc47cfb2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2.bin", 0x10000, 0xa34f63fb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.bin", 0x10000, 0xf98db083, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "12k_04.bin", 0x08000, 0x4b9a7524, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "10d_01.bin", 0x08000, 0x361caf00, 3 | BRF_GRA }, // 5 Character Tiles - - { "03f_12.bin", 0x10000, 0xbc13e43c, 4 | BRF_GRA }, // 6 Background Tiles - { "01f_10.bin", 0x10000, 0xf7617ad9, 4 | BRF_GRA }, // 7 - { "03h_14.bin", 0x10000, 0xe33cd438, 4 | BRF_GRA }, // 8 - { "02f_11.bin", 0x10000, 0x4aa49cd7, 4 | BRF_GRA }, // 9 - { "17f_09.bin", 0x10000, 0xca622155, 4 | BRF_GRA }, // 10 - { "02h_13.bin", 0x10000, 0x2a63961e, 4 | BRF_GRA }, // 11 - - { "03b_06.bin", 0x10000, 0x5e54e391, 5 | BRF_GRA }, // 12 Sprites - { "02b_05.bin", 0x10000, 0xcdd119fd, 5 | BRF_GRA }, // 13 - { "03d_08.bin", 0x10000, 0x811f2e22, 5 | BRF_GRA }, // 14 - { "02d_07.bin", 0x10000, 0xaa9a1233, 5 | BRF_GRA }, // 15 - - { "07l_15.bin", 0x08000, 0x978758b7, 6 | BRF_GRA }, // 16 Background Tilemaps - - { "09e_tr.bin", 0x00100, 0xec80ae36, 7 | BRF_GRA | BRF_OPT }, // 17 Priority Proms (unused) -}; - -STD_ROM_PICK(f1dreamba) -STD_ROM_FN(f1dreamba) - -struct BurnDriver BurnDrvF1dreamba = { - "f1dreamba", "f1dream", NULL, NULL, "1988", - "F-1 Dream (bootleg, set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_RACING, 0, - NULL, f1dreambaRomInfo, f1dreambaRomName, NULL, NULL, TigeroadInputInfo, F1dreamDIPInfo, - F1dreambInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_timelimt.cpp b/jan/src/burn/drv/pre90s/d_timelimt.cpp deleted file mode 100644 index fa0cff5cd..000000000 --- a/jan/src/burn/drv/pre90s/d_timelimt.cpp +++ /dev/null @@ -1,741 +0,0 @@ -// FB Alpha Time Limit driver module -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvColPROM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static UINT8 soundlatch; -static UINT8 nmi_enable; -static UINT8 scrolly; -static UINT16 scrollx; -static INT32 watchdog; - -static INT32 TimelimtMode = 0; - -static struct BurnInputInfo TimelimtInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dips", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Timelimt) - -static struct BurnInputInfo ProgressInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dips", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Progress) - -static struct BurnDIPInfo TimelimtDIPList[]= -{ - {0x08, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x08, 0x01, 0x07, 0x00, "2 Coins 1 Credits" }, - {0x08, 0x01, 0x07, 0x01, "1 Coin 1 Credits" }, - {0x08, 0x01, 0x07, 0x02, "1 Coin 2 Credits" }, - {0x08, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x08, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x08, 0x01, 0x07, 0x05, "1 Coin 5 Credits" }, - {0x08, 0x01, 0x07, 0x06, "1 Coin 6 Credits" }, - {0x08, 0x01, 0x07, 0x07, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x08, 0x01, 0x10, 0x00, "3" }, - {0x08, 0x01, 0x10, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invincibility (Cheat)" }, - {0x08, 0x01, 0x80, 0x00, "Off" }, - {0x08, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Timelimt) - -static struct BurnDIPInfo ProgressDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0a, 0x01, 0x07, 0x00, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x07, 0x01, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x07, 0x02, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x0a, 0x01, 0x07, 0x05, "1 Coin 5 Credits" }, - {0x0a, 0x01, 0x07, 0x06, "1 Coin 6 Credits" }, - {0x0a, 0x01, 0x07, 0x07, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0a, 0x01, 0x10, 0x00, "3" }, - {0x0a, 0x01, 0x10, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x0a, 0x01, 0x20, 0x00, "20,000 & 100,000" }, - {0x0a, 0x01, 0x20, 0x20, "50,000 & 200,000" }, - - {0 , 0xfe, 0 , 2, "Invincibility (Cheat)" }, - {0x0a, 0x01, 0x80, 0x00, "Off" }, - {0x0a, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Progress) - -static void __fastcall timelimt_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xb000: - nmi_enable = data & 1; - return; - - case 0xb003: - if (data & 1) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xb800: - soundlatch = data; - return; - - case 0xc800: - scrollx = (scrollx & 0xff00) + data; - return; - - case 0xc801: - scrollx = (scrollx & 0x00ff) + ((data & 1) << 8); - return; - - case 0xc802: - scrolly = data; - return; - - case 0xc803: // nop - case 0xc804: - return; - } -} - -static UINT8 __fastcall timelimt_main_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return DrvInputs[0]; - - case 0xa800: - return DrvInputs[1]; - - case 0xb000: - return DrvDips[0]; - } - - return 0; -} - -static UINT8 __fastcall timelimt_main_read_port(UINT16 port) -{ - if ((port & 0xff) == 0) { - watchdog = 0; - return 0; - } - - return 0; -} - -static void __fastcall timelimt_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - soundlatch = 0; - return; - - case 0x8c: - case 0x8d: - case 0x8e: - case 0x8f: - AY8910Write((port & 2) ? 1 : 0, port & 1, data); - return; - } -} - -static UINT8 __fastcall timelimt_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x8c: - case 0x8d: - case 0x8e: - case 0x8f: - return AY8910Read((port & 2) ? 1 : 0); - } - - return 0; -} - -static UINT8 timelimt_ay8910_1_portA_read(UINT32) -{ - return soundlatch; -} - -static INT32 DrvDoReset(INT32 clear_ram) -{ - if (clear_ram) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - soundlatch = 0; - nmi_enable = 0; - scrollx = 0; - scrolly = 0; - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x008000; - DrvZ80ROM1 = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x004000; - DrvGfxROM1 = Next; Next += 0x004000; - DrvGfxROM2 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000060; - - DrvPalette = (UINT32*)Next; Next += 0x0060 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x000800; - DrvZ80RAM1 = Next; Next += 0x000c00; - - DrvVidRAM0 = Next; Next += 0x000400; - DrvVidRAM1 = Next; Next += 0x000800; - - DrvSprRAM = Next; Next += 0x000100; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x60; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x4f * bit0 + 0xa8 * bit1; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void DrvGfxDecode() -{ - static INT32 Planes0[4] = { 0, 4, (0x1000*8)+0, (0x1000*8)+4 }; - static INT32 Planes1[3] = { 0, (0x2000*8), (0x4000*8) }; - static INT32 XOffs0[8] = { STEP4(0,1), STEP4(8,1) }; - static INT32 YOffs0[8] = { STEP8(0,16) }; - static INT32 XOffs1[16] = { STEP8(0,1), STEP8(64,1) }; - static INT32 YOffs1[16] = { STEP8(0,8), STEP8(128,8) }; - - UINT8 *tmp = (UINT8 *)BurnMalloc(0x6000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x0100, 4, 8, 8, Planes0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x4000); - - GfxDecode(0x0100, 4, 8, 8, Planes0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x6000); - - GfxDecode(0x0100, 3, 16, 16, Planes1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x4000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 12, 1)) return 1; - - if (!TimelimtMode) - if (BurnLoadRom(DrvColPROM + 0x0040, 13, 1)) return 1; - - if (TimelimtMode) - { // fill in missing timelimt prom with color values, values (c) 2017 -dink - const UINT8 color_data[32] = { - //0 1 2 3 4 5 6 7 8 9 a b c d e f - 0x00, 0x00, 0xA4, 0xF6, 0xC0, 0x2F, 0x07, 0xFF, 0x00, 0x99, 0x99, 0xF6, 0x0A, 0x1F, 0x58, 0xFF, - 0x00, 0x0F, 0xB5, 0x54, 0xE1, 0x50, 0x5F, 0x64, 0x00, 0x0B, 0x53, 0x0F, 0x80, 0x08, 0x0D, 0xAE - }; - - memcpy (DrvColPROM + 0x40, color_data, 0x20); - } - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 14, 1)) return 1; - - if (TimelimtMode) - if (BurnLoadRom(DrvZ80ROM1 + 0x1000, 15, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvVidRAM0, 0x8800, 0x8bff, MAP_RAM); - ZetMapMemory(DrvVidRAM1, 0x9000, 0x97ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x9800, 0x98ff, MAP_RAM); - ZetSetWriteHandler(timelimt_main_write); - ZetSetReadHandler(timelimt_main_read); - ZetSetInHandler(timelimt_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x3000, 0x3bff, MAP_RAM); - ZetSetOutHandler(timelimt_sound_write_port); - ZetSetInHandler(timelimt_sound_read_port); - ZetClose(); - - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - - AY8910Init(1, 1536000, nBurnSoundRate, &timelimt_ay8910_1_portA_read, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - - TimelimtMode = 0; - - return 0; -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= scrollx; - if (sx < -7) sx += 512; - if (sx >= nScreenWidth) continue; - - sy -= (scrolly + 16) & 0xff; - if (sy < -7) sy += 256; - if (sy >= nScreenHeight) continue; - - INT32 code = DrvVidRAM1[offs]; - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, 0, 4, 0, DrvGfxROM1); - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = ((offs & 0x1f) * 8); - INT32 sy = ((offs / 0x20) * 8) - 16; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = DrvVidRAM0[offs]; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 4, 0, 0x20, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x100-4; offs >= 0; offs -= 4 ) - { - INT32 sy = (240 - DrvSprRAM[offs]) - 16; - INT32 sx = DrvSprRAM[offs+3]; - INT32 attr = DrvSprRAM[offs+2]; - INT32 code =(DrvSprRAM[offs+1] & 0x3f) | ((attr & 0x40) << 1) | ((attr & 0x80) >> 1); - INT32 flipy = DrvSprRAM[offs+1] & 0x80; - INT32 flipx = DrvSprRAM[offs+1] & 0x40; - INT32 color = attr & 0x07; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_bg_layer(); - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 4) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - /* -- save until 100% sure colors jive well. -- - static UINT8 oldj = 0; - static INT32 selektor = 0; - - if (DrvJoy1[4] && oldj == 0) { - selektor++; - } - if (counter!=0) DrvColPROM[0x40 + selektor] = counter; - bprintf(0, _T("DrvColPROM[0x40 + %X] = %X.\n"), selektor, counter); - oldj = DrvJoy1[4]; - - // 0x40 + 2 = windows in police car - // + 3 = tires - // 5 = hubcaps - // 6 = headlights - // 7 = body - // 8 - // 9 = police pants 0x99 - // A = police coat "" - // B = shoes/hair - // C = Holster/belt 0xa ? - // D = Face 0x1f - // E = gun 0x58 - // F = cuff 0x65 - // 10 = nothing - // 11 = gang suit 0xf - // 12 = gang face 0xb5 - // 13 = gang shoes 0x54 - // 14 = gang tie/knife 0xe1 - // 15 = killr shirt 0x50 - // 16 = gang shirt 0x5f - // 17 = "" pants 0x64 - // 18 = ? - // 19 = bomb clock 0xb - // 1a = skull border 0x53 - // 1b = bomb wrapper 0xf - // 1c = bomb border/wire, 0x80 - // 1d = clock hands 0x8 - // 1e = bomb wrapper 2 0xd - // 1f = skull 0xae - */ - - { - DrvInputs[0] = 0; - DrvInputs[1] = 0x03; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - - - INT32 nInterleave = 50; // 3000 hz - INT32 nCyclesTotal[2] = { 5000000 / 60, 3072000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1) && nmi_enable && nCurrentFrame & 1) ZetNmi(); - ZetClose(); - - nSegment = nCyclesTotal[1] / nInterleave; - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(nmi_enable); - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - } - - return 0; -} - - -// Time Limit - -static struct BurnRomInfo timelimtRomDesc[] = { - { "t8", 0x2000, 0x006767ca, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 code - { "t7", 0x2000, 0xcbe7cd86, 1 | BRF_PRG | BRF_ESS }, // 1 - { "t6", 0x2000, 0xf5f17e39, 1 | BRF_PRG | BRF_ESS }, // 2 - { "t9", 0x2000, 0x2d72ab45, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "tl11", 0x1000, 0x46676307, 2 | BRF_GRA }, // 4 Foreground Tiles - { "tl10", 0x1000, 0x2336908a, 2 | BRF_GRA }, // 5 - - { "tl13", 0x1000, 0x072e4053, 3 | BRF_GRA }, // 6 Background Tiles - { "tl12", 0x1000, 0xce960389, 3 | BRF_GRA }, // 7 - - { "tl3", 0x2000, 0x01a9fd95, 4 | BRF_GRA }, // 8 Sprites - { "tl2", 0x2000, 0x4693b849, 4 | BRF_GRA }, // 9 - { "tl1", 0x2000, 0xc4007caf, 4 | BRF_GRA }, // 10 - - { "clr.35", 0x0020, 0x9c9e6073, 5 | BRF_GRA }, // 11 Color proms - { "clr.48", 0x0020, 0xa0bcac59, 5 | BRF_GRA }, // 12 - { "clr.57", 0x0020, 0x00000000, 5 | BRF_NODUMP | BRF_GRA }, // 13 - - { "tl5", 0x1000, 0x5b782e4a, 6 | BRF_PRG | BRF_ESS }, // 14 Z80 #1 code - { "tl4", 0x1000, 0xa32883a9, 6 | BRF_PRG | BRF_ESS }, // 15 -}; - -STD_ROM_PICK(timelimt) -STD_ROM_FN(timelimt) - -static INT32 TimelimtInit() -{ - TimelimtMode = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvTimelimt = { - "timelimt", NULL, NULL, NULL, "1983", - "Time Limit\0", NULL, "Chuo Co. Ltd", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, timelimtRomInfo, timelimtRomName, NULL, NULL, TimelimtInputInfo, TimelimtDIPInfo, - TimelimtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 224, 256, 3, 4 -}; - - -// Progress - -static struct BurnRomInfo progressRomDesc[] = { - { "pg8.bin", 0x2000, 0xe8779658, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 code - { "pg7.bin", 0x2000, 0x5dcf6b6f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pg6.bin", 0x2000, 0xf21d2a08, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pg9.bin", 0x2000, 0x052ab4ac, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "pg11.bin", 0x1000, 0xbd8462e4, 2 | BRF_GRA }, // 4 Foreground Tiles - { "pg10.bin", 0x1000, 0xc4bbf0b8, 2 | BRF_GRA }, // 5 - - { "pg13.bin", 0x1000, 0x25ec45be, 3 | BRF_GRA }, // 6 Background Tiles - { "pg12.bin", 0x1000, 0xc837c5f5, 3 | BRF_GRA }, // 7 - - { "pg1.bin", 0x2000, 0x155c8f7f, 4 | BRF_GRA }, // 8 Sprites - { "pg2.bin", 0x2000, 0xa6ca4dfc, 4 | BRF_GRA }, // 9 - { "pg3.bin", 0x2000, 0x2b21c2fb, 4 | BRF_GRA }, // 10 - - { "35.bin", 0x0020, 0x8c5ca730, 5 | BRF_GRA }, // 11 Color proms - { "48.bin", 0x0020, 0x12dd62cd, 5 | BRF_GRA }, // 12 - { "57.bin", 0x0020, 0x18455a79, 5 | BRF_GRA }, // 13 - - { "pg4.bin", 0x1000, 0xb1cc2fe8, 6 | BRF_PRG | BRF_ESS }, // 14 Z80 #1 code -}; - -STD_ROM_PICK(progress) -STD_ROM_FN(progress) - -struct BurnDriver BurnDrvProgress = { - "progress", NULL, NULL, NULL, "1984", - "Progress\0", NULL, "Chuo Co. Ltd", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, progressRomInfo, progressRomName, NULL, NULL, ProgressInputInfo, ProgressDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_toki.cpp b/jan/src/burn/drv/pre90s/d_toki.cpp deleted file mode 100644 index fb6d9d511..000000000 --- a/jan/src/burn/drv/pre90s/d_toki.cpp +++ /dev/null @@ -1,1881 +0,0 @@ -// FB Alpha Toki driver module -// Based on MAME driver by Jarek Parchanski - -// Why isn't sound working for jujuba? - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "seibusnd.h" -#include "msm5205.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80DecROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvBg1RAM; -static UINT8 *DrvBg2RAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvScrollRAM; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[3]; -static UINT8 DrvDips[3]; -static UINT16 DrvInps[2]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; - -static INT32 is_bootleg = 0; - -static UINT8 TokibMSM5205Next = 0; -static UINT8 TokibMSM5205Toggle = 0; - -static struct BurnInputInfo TokiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Toki) - -static struct BurnInputInfo TokibInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tokib) - -static struct BurnDIPInfo TokiDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xdf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 20, "Coinage" }, - {0x12, 0x01, 0x1f, 0x15, "6 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x17, "5 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x19, "4 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x1b, "3 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x03, "8 Coins 3 Credits " }, - {0x12, 0x01, 0x1f, 0x1d, "2 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x05, "5 Coins 3 Credits " }, - {0x12, 0x01, 0x1f, 0x07, "3 Coins 2 Credits " }, - {0x12, 0x01, 0x1f, 0x1f, "1 Coin 1 Credits " }, - {0x12, 0x01, 0x1f, 0x09, "2 Coins 3 Credits " }, - {0x12, 0x01, 0x1f, 0x13, "1 Coin 2 Credits " }, - {0x12, 0x01, 0x1f, 0x11, "1 Coin 3 Credits " }, - {0x12, 0x01, 0x1f, 0x0f, "1 Coin 4 Credits " }, - {0x12, 0x01, 0x1f, 0x0d, "1 Coin 5 Credits " }, - {0x12, 0x01, 0x1f, 0x0b, "1 Coin 6 Credits " }, - {0x12, 0x01, 0x1f, 0x1e, "A 1/1 B 1/2" }, - {0x12, 0x01, 0x1f, 0x14, "A 2/1 B 1/3" }, - {0x12, 0x01, 0x1f, 0x0a, "A 3/1 B 1/5" }, - {0x12, 0x01, 0x1f, 0x00, "A 5/1 B 1/6" }, - {0x12, 0x01, 0x1f, 0x01, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Joysticks" }, - {0x12, 0x01, 0x20, 0x20, "1" }, - {0x12, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x40, 0x40, "Upright" }, - {0x12, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x08, "50000 150000" }, - {0x13, 0x01, 0x0c, 0x00, "70000 140000 210000" }, - {0x13, 0x01, 0x0c, 0x0c, "70000" }, - {0x13, 0x01, 0x0c, 0x04, "100000 200000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x20, "Easy" }, - {0x13, 0x01, 0x30, 0x30, "Medium" }, - {0x13, 0x01, 0x30, 0x10, "Hard" }, - {0x13, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x40, 0x00, "No" }, - {0x13, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Debug Mode (Hack)" }, - {0x14, 0x01, 0x0f, 0x00, "Off" }, - {0x14, 0x01, 0x0f, 0x0f, "On" }, -}; - -STDDIPINFO(Toki) - -static struct BurnDIPInfo TokibDIPList[]= -{ - {0x12, 0xff, 0xff, 0xdf, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 20, "Coinage" }, - {0x12, 0x01, 0x1f, 0x15, "6 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x17, "5 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x19, "4 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x1b, "3 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x03, "8 Coins 3 Credits " }, - {0x12, 0x01, 0x1f, 0x1d, "2 Coins 1 Credits " }, - {0x12, 0x01, 0x1f, 0x05, "5 Coins 3 Credits " }, - {0x12, 0x01, 0x1f, 0x07, "3 Coins 2 Credits " }, - {0x12, 0x01, 0x1f, 0x1f, "1 Coin 1 Credits " }, - {0x12, 0x01, 0x1f, 0x09, "2 Coins 3 Credits " }, - {0x12, 0x01, 0x1f, 0x13, "1 Coin 2 Credits " }, - {0x12, 0x01, 0x1f, 0x11, "1 Coin 3 Credits " }, - {0x12, 0x01, 0x1f, 0x0f, "1 Coin 4 Credits " }, - {0x12, 0x01, 0x1f, 0x0d, "1 Coin 5 Credits " }, - {0x12, 0x01, 0x1f, 0x0b, "1 Coin 6 Credits " }, - {0x12, 0x01, 0x1f, 0x1e, "A 1/1 B 1/2" }, - {0x12, 0x01, 0x1f, 0x14, "A 2/1 B 1/3" }, - {0x12, 0x01, 0x1f, 0x0a, "A 3/1 B 1/5" }, - {0x12, 0x01, 0x1f, 0x00, "A 5/1 B 1/6" }, - {0x12, 0x01, 0x1f, 0x01, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Joysticks" }, - {0x12, 0x01, 0x20, 0x20, "1" }, - {0x12, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x40, 0x40, "Upright" }, - {0x12, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x08, "50000 150000" }, - {0x13, 0x01, 0x0c, 0x00, "70000 140000 210000" }, - {0x13, 0x01, 0x0c, 0x0c, "70000" }, - {0x13, 0x01, 0x0c, 0x04, "100000 200000" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x20, "Easy" }, - {0x13, 0x01, 0x30, 0x30, "Medium" }, - {0x13, 0x01, 0x30, 0x10, "Hard" }, - {0x13, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x40, 0x00, "No" }, - {0x13, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Tokib) - -static inline void palette_write(INT32 offset) -{ - UINT16 p = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + offset))); - - UINT8 r = (p >> 0) & 0x0f; - UINT8 g = (p >> 4) & 0x0f; - UINT8 b = (p >> 8) & 0x0f; - - DrvPalette[offset / 2] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0); -} - -static void __fastcall toki_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xff800) == 0x6e000) { - DrvPalRAM[address & 0x7ff] = data; - palette_write(address & 0x7fe); - return; - } - - switch (address) - { - case 0x75001: // bootleg - { - *soundlatch = data & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - } - return; - - case 0x80000: - case 0x80001: - case 0x80002: - case 0x80003: - case 0x80004: - case 0x80005: - case 0x80006: - case 0x80007: - case 0x80008: - case 0x80009: - case 0x8000a: - case 0x8000b: - case 0x8000c: - case 0x8000d: - seibu_main_word_write(address & 0xf, data); - return; - } -} - -static void __fastcall toki_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xff800) == 0x6e000) { - *((UINT16*)(DrvPalRAM + (address & 0x7fe))) = BURN_ENDIAN_SWAP_INT16(data); - palette_write(address & 0x7fe); - return; - } - - switch (address) - { - case 0x75004: // bootleg - case 0x75006: - case 0x75008: - case 0x7500a: - *((UINT16*)(DrvScrollRAM + (address - 0x75004))) = BURN_ENDIAN_SWAP_INT16(data); - return; - - case 0x80000: - case 0x80001: - case 0x80002: - case 0x80003: - case 0x80004: - case 0x80005: - case 0x80006: - case 0x80007: - case 0x80008: - case 0x80009: - case 0x8000a: - case 0x8000b: - case 0x8000c: - case 0x8000d: - seibu_main_word_write(address & 0xf, data); - return; - } -} - -static UINT8 __fastcall toki_read_byte(UINT32 address) -{ - switch (address) - { - case 0x80000: - case 0x80001: - case 0x80002: - case 0x80003: - case 0x80004: - case 0x80005: - case 0x80006: - case 0x80007: - case 0x80008: - case 0x80009: - case 0x8000a: - case 0x8000b: - case 0x8000c: - case 0x8000d: - return seibu_main_word_read(address & 0x0f); - - case 0xc0000: - case 0xc0001: - return DrvDips[~address & 1]; - - case 0xc0002: return DrvInps[0] >> 8; - case 0xc0003: return DrvInps[0]; - - case 0xc0004: return DrvInps[1] >> 8; - case 0xc0005: return DrvInps[1]; - - case 0xc000f: - return 0xff; - } - - return 0; -} - -static UINT16 __fastcall toki_read_word(UINT32 address) -{ - switch (address) - { - case 0x72000:// watchdog (bootleg) - return 0; - - case 0x80000: - case 0x80001: - case 0x80002: - case 0x80003: - case 0x80004: - case 0x80005: - case 0x80006: - case 0x80007: - case 0x80008: - case 0x80009: - case 0x8000a: - case 0x8000b: - case 0x8000c: - case 0x8000d: - return seibu_main_word_read(address & 0x0f); - - case 0xc0000: - return (DrvDips[1] << 8) | (DrvDips[0]); - - case 0xc0002: - return DrvInps[0]; - - case 0xc0004: - return DrvInps[1]; - } - - return 0; -} - -static void toki_adpcm_control_w(INT32 data) -{ - INT32 bankaddress = data & 1; - - UINT8 *RAM = DrvZ80ROM + 0x8000 + bankaddress * 0x4000; - - ZetMapArea(0x8000, 0xbfff, 0, RAM); - ZetMapArea(0x8000, 0xbfff, 2, RAM); - - MSM5205ResetWrite(0, data & 0x08); -} - -static void __fastcall tokib_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - toki_adpcm_control_w(data); - return; - - case 0xe400: - TokibMSM5205Next = data; - return; - - case 0xec00: - case 0xec08: - BurnYM3812Write(0, 0, data); - return; - - case 0xec01: - case 0xec09: - BurnYM3812Write(0, 1, data); - return; - } -} - -static UINT8 __fastcall tokib_sound_read(UINT16 address) -{ - switch (address) - { - case 0xec00: - return BurnYM3812Read(0, 0); - - case 0xf800: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -inline static INT32 TokibSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate / 4000000); -} - -static void toki_adpcm_int() -{ - MSM5205DataWrite(0, TokibMSM5205Next); - TokibMSM5205Next >>= 4; - - TokibMSM5205Toggle ^= 1; - if (TokibMSM5205Toggle) ZetNmi(); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - if (is_bootleg) - { - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - } - else - { - seibu_sound_reset(); - } - - return 0; -} - -static INT32 TokibDoReset() -{ - TokibMSM5205Next = 0; - TokibMSM5205Toggle = 0; - - MSM5205Reset(); - - return DrvDoReset(); -} - -static void tokib_rom_decode() -{ - UINT8 *temp = (UINT8*)BurnMalloc(65536 * 2); - INT32 i, offs, len; - UINT8 *rom; - - len = 0x100000; - rom = DrvGfxROM1; - for (i = 0; i < len; i++) rom[i] ^= 0xff; - - len = 0x080000; - rom = DrvGfxROM2; - for (offs = 0; offs < len; offs += 0x20000) - { - UINT8 *base = &rom[offs]; - memcpy (temp, base, 65536 * 2); - for (i = 0; i < 16; i++) - { - memcpy (&base[0x00000 + i * 0x800], &temp[0x0000 + i * 0x2000], 0x800); - memcpy (&base[0x10000 + i * 0x800], &temp[0x0800 + i * 0x2000], 0x800); - memcpy (&base[0x08000 + i * 0x800], &temp[0x1000 + i * 0x2000], 0x800); - memcpy (&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800); - } - } - len = 0x080000; - rom = DrvGfxROM3; - for (offs = 0; offs < len; offs += 0x20000) - { - UINT8 *base = &rom[offs]; - memcpy (temp, base, 65536 * 2); - for (i = 0; i < 16; i++) - { - memcpy (&base[0x00000 + i * 0x800], &temp[0x0000 + i * 0x2000], 0x800); - memcpy (&base[0x10000 + i * 0x800], &temp[0x0800 + i * 0x2000], 0x800); - memcpy (&base[0x08000 + i * 0x800], &temp[0x1000 + i * 0x2000], 0x800); - memcpy (&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800); - } - } - - BurnFree (temp); -} - - -static INT32 TokibGfxDecode() -{ - INT32 Plane0[4] = { 4096*8*8*3, 4096*8*8*2, 4096*8*8*1, 4096*8*8*0 }; - INT32 Plane1[4] = { 8192*16*16*3,8192*16*16*2,8192*16*16*1,8192*16*16*0 }; - INT32 Plane2[4] = { 4096*16*16*3,4096*16*16*2,4096*16*16*1,4096*16*16*0 }; - INT32 XOffs0[16] = { STEP8(0,1), STEP8(128,1) }; - INT32 YOffs0[16] = { STEP16(0,8) }; - INT32 XOffs1[16] = { STEP8(0,1), STEP8(0x8000*8,1) }; - INT32 YOffs1[16] = { STEP8(0,8), STEP8(0x10000*8,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x020000); - - GfxDecode(4096, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x100000); - - GfxDecode(8192, 4, 16, 16, Plane1, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x080000); - - GfxDecode(4096, 4, 16, 16, Plane2, XOffs1, YOffs1, 0x040, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x080000); - - GfxDecode(4096, 4, 16, 16, Plane2, XOffs1, YOffs1, 0x040, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 4096*16*8+0, 4096*16*8+4, 0, 4 }; - INT32 Plane1[4] = { 2*4, 3*4, 0*4, 1*4 }; - INT32 XOffs0[8] = { STEP4(3,-1), STEP4(11,-1) }; - INT32 YOffs0[8] = { STEP8(0, 16) }; - INT32 XOffs1[16] = { STEP4(3,-1), STEP4(19,-1), STEP4((64*8)+3, -1), STEP4((64*8+16+3),-1) }; - INT32 YOffs1[32] = { STEP16(0,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x020000); - - GfxDecode(4096, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x100000); - - GfxDecode(8192, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x080000); - - GfxDecode(4096, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x080000); - - GfxDecode(4096, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x060000; - - SeibuZ80ROM = Next; - DrvZ80ROM = Next; Next += 0x020000; - SeibuZ80DecROM = Next; - DrvZ80DecROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROM3 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - AllRam = Next; - - DrvBg1RAM = Next; Next += 0x000800; - DrvBg2RAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x000800; - Drv68KRAM = Next; Next += 0x00e000; - SeibuZ80RAM = Next; - DrvZ80RAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - DrvSprBuf = Next; Next += 0x000800; - - DrvScrollRAM = Next; Next += 0x000400; - - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - is_bootleg = 0; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x10000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 12, 1)) return 1; - - DrvGfxDecode(); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x060000, 0x06d7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x06d800, 0x06dfff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x06e000, 0x06e7ff, MAP_ROM); - SekMapMemory(DrvBg1RAM, 0x06e800, 0x06efff, MAP_RAM); - SekMapMemory(DrvBg2RAM, 0x06f000, 0x06f7ff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x06f800, 0x06ffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x0a0000, 0x0a0057, MAP_RAM); - SekSetWriteByteHandler(0, toki_write_byte); - SekSetWriteWordHandler(0, toki_write_word); - SekSetReadByteHandler(0, toki_read_byte); - SekSetReadWordHandler(0, toki_read_word); - SekClose(); - - UINT8 *Temp = (UINT8*)BurnMalloc(0x20000); - memcpy(Temp, DrvSndROM, 0x20000); - for (INT32 i = 0; i < 0x20000; i++ ) { - DrvSndROM[i] = Temp[BITSWAP24(i, 23, 22, 21, 20, 19, 18, 17, 16, 13, 14, 15, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; - } - BurnFree(Temp); - - seibu_sound_init(0, 0x2000, 3579545, 3579545, 1000000 / 132); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 TokipInit() -{ - is_bootleg = 0; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x10000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xc0000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xc0001, 15, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40001, 19, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x00001, 21, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x40000, 22, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x40001, 23, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 24, 1)) return 1; - - DrvGfxDecode(); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x060000, 0x06d7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x06d800, 0x06dfff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x06e000, 0x06e7ff, MAP_ROM); - SekMapMemory(DrvBg1RAM, 0x06e800, 0x06efff, MAP_RAM); - SekMapMemory(DrvBg2RAM, 0x06f000, 0x06f7ff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x06f800, 0x06ffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x0a0000, 0x0a0057, MAP_RAM); - SekSetWriteByteHandler(0, toki_write_byte); - SekSetWriteWordHandler(0, toki_write_word); - SekSetReadByteHandler(0, toki_read_byte); - SekSetReadWordHandler(0, toki_read_word); - SekClose(); - - UINT8 *Temp = (UINT8*)BurnMalloc(0x20000); - memcpy(Temp, DrvSndROM, 0x20000); - for (INT32 i = 0; i < 0x20000; i++ ) { - DrvSndROM[i] = Temp[BITSWAP24(i, 23, 22, 21, 20, 19, 18, 17, 16, 13, 14, 15, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; - } - BurnFree(Temp); - - seibu_sound_init(0, 0x2000, 3579545, 3579545, 1000000 / 132); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 JujubaInit() -{ - is_bootleg = 0; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (BurnLoadRom(Drv68KROM + 0x20001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x20000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 5, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x10000, 7, 1)) return 1; - memcpy(DrvZ80ROM, DrvZ80ROM + 0x2000, 0x2000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xc0000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xc0001, 17, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20001, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40001, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60001, 21, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 22, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 23, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 24, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000, 25, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00001, 26, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20001, 27, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x40001, 28, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x60001, 29, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 30, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 31, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x40000, 32, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x60000, 33, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x00000, 34, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x10000, 35, 1)) return 1; - - UINT16 *PrgRom = (UINT16*)Drv68KROM; - for (INT32 i = 0; i < 0x30000; i++) { - PrgRom[i] = BITSWAP16(PrgRom[i], 15, 12, 13, 14, 11, 10, 9, 8, 7, 6, 5, 3, 4, 2, 1, 0); - } - - UINT8 *Decrypt = DrvZ80DecROM; - UINT8 *Rom = DrvZ80ROM; - memcpy(Decrypt, Rom, 0x2000); - for (INT32 i = 0;i < 0x2000; i++) { - UINT8 Src = Decrypt[i]; - Rom[i] = Src ^ 0x55; - } - - DrvGfxDecode(); - - UINT8 *Temp = (UINT8*)BurnMalloc(0x20000); - memcpy(Temp, DrvSndROM, 0x20000); - for (INT32 i = 0; i < 0x20000; i++ ) { - DrvSndROM[i] = Temp[BITSWAP24(i, 23, 22, 21, 20, 19, 18, 17, 16, 13, 14, 15, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; - } - BurnFree(Temp); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x060000, 0x06d7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x06d800, 0x06dfff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x06e000, 0x06e7ff, MAP_ROM); - SekMapMemory(DrvBg1RAM, 0x06e800, 0x06efff, MAP_RAM); - SekMapMemory(DrvBg2RAM, 0x06f000, 0x06f7ff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x06f800, 0x06ffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x0a0000, 0x0a0057, MAP_RAM); - SekSetWriteByteHandler(0, toki_write_byte); - SekSetWriteWordHandler(0, toki_write_word); - SekSetReadByteHandler(0, toki_read_byte); - SekSetReadWordHandler(0, toki_read_word); - SekClose(); - - seibu_sound_init(0, 0x2000, 3579545, 3579545, 1000000 / 132); - - ZetOpen(0); - ZetMapArea(0x0000, 0x1fff, 2, DrvZ80DecROM, DrvZ80ROM ); - ZetClose(); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 TokibInit() -{ - is_bootleg = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x40000, 3, 2)) return 1; - - for (INT32 i = 0; i < 4; i++) - if (BurnLoadRom(DrvGfxROM0 + i * 0x8000, 5 + i, 1)) return 1; - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x20000, 9 + i, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + i * 0x10000, 17 + i, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + i * 0x10000, 25 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 4, 1)) return 1; - - tokib_rom_decode(); - - TokibGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x060000, 0x06dfff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x06e000, 0x06e7ff, MAP_ROM); - SekMapMemory(DrvBg1RAM, 0x06e800, 0x06efff, MAP_RAM); - SekMapMemory(DrvBg2RAM, 0x06f000, 0x06f7ff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x06f800, 0x06ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x071800, 0x0718ff, MAP_RAM); - SekSetWriteByteHandler(0, toki_write_byte); - SekSetWriteWordHandler(0, toki_write_word); - SekSetReadByteHandler(0, toki_read_byte); - SekSetReadWordHandler(0, toki_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + 0x8000); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(tokib_sound_write); - ZetSetReadHandler(tokib_sound_read); - ZetClose(); - - BurnYM3812Init(1, 3579545, NULL, &TokibSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3579545); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, TokibSynchroniseStream, 384000, toki_adpcm_int, MSM5205_S96_4B, 1); - MSM5205SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - TokibDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - if (is_bootleg) { - BurnYM3812Exit(); - MSM5205Exit(); - ZetExit(); - } else { - seibu_sound_exit(); - } - - SekExit(); - - BurnFree (AllMem); - - TokibMSM5205Next = 0; - TokibMSM5205Toggle = 0; - is_bootleg = 0; - - return 0; -} - -static void draw_text_layer() -{ - UINT16 *vram = (UINT16*)DrvFgRAM; - - for (INT32 offs = 0x040; offs < 0x3c0; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - sy -= 16; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 color = code >> 12; - code &= 0xfff; - - if (code == 0) continue; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x100, DrvGfxROM0); - } -} - -static void draw_bg_layer(UINT8 *vidsrc, UINT8 *gfxbase, INT32 transp, INT32 gfxoffs, INT32 scrollx, INT32 scrolly) -{ - UINT16 *vram = (UINT16*)vidsrc; - - scrollx &= 0x1ff; - scrolly &= 0x1ff; - - for (INT32 offs = 0; offs < 0x800 / 2; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scrollx; - if (sx < -15) sx += 0x200; - sy -= scrolly; - if (sy < -15) sy += 0x200; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 color = code >> 12; - - if (transp) { - Render16x16Tile_Mask_Clip(pTransDraw, code & 0xfff, sx, sy, color, 4, 0x0f, gfxoffs, gfxbase); - } else { - Render16x16Tile_Clip(pTransDraw, code & 0xfff, sx, sy, color, 4, gfxoffs, gfxbase); - } - } -} - -static void draw_bg_layer_by_line(UINT8 *vidsrc, UINT8 *gfxbase, INT32 transp, INT32 gfxoffs, INT32 scrollx, INT32 scrolly, INT32 line) -{ - UINT8 *src; - UINT16 *vram = (UINT16*)vidsrc; - - INT32 starty = line + scrolly; - if (starty > 0x1ff) starty -= 0x200; - starty = (starty & 0x1f0) << 1; - - for (INT32 offs = starty; offs < starty + 0x20; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scrollx; - if (sx < -15) sx += 0x200; - sy -= scrolly; - if (sy < -15) sy += 0x200; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 color = ((code >> 8) & 0xf0) | gfxoffs; - - if (sx < -15 || sx >= nScreenWidth) continue; - src = gfxbase + ((code & 0xfff) << 8) + ((line - sy) << 4); - - sy = line * nScreenWidth; - - if (transp) { - for (INT32 x = 0; x < 16; x++, sx++) { - if (src[x] != 0x0f && sx >= 0 && sx < nScreenWidth) { - pTransDraw[sy + sx] = color | src[x]; - } - } - } else { - for (INT32 x = 0; x < 16; x++, sx++) { - if (sx >= 0 && sx < nScreenWidth) { - pTransDraw[sy + sx] = color | src[x]; - } - } - } - } -} - -static void tokib_draw_sprites() -{ - INT32 x,y,code,flipx,color,offs; - UINT16 *sprite_buffer = (UINT16*)(DrvSprBuf + 0xe); - UINT16 *sprite_word; - - for (offs = 0;offs < 0x642 / 2;offs += 4) - { - sprite_word = &sprite_buffer[offs]; - - if (BURN_ENDIAN_SWAP_INT16(sprite_word[0]) == 0xf100) - break; - - if (BURN_ENDIAN_SWAP_INT16(sprite_word[2])) - { - x = BURN_ENDIAN_SWAP_INT16(sprite_word[3]) & 0x1ff; - if (x > 256) - x -= 512; - - y = BURN_ENDIAN_SWAP_INT16(sprite_word[0]) & 0x1ff; - if (y > 256) - y = (512-y)+240; - else - y = 240-y; - - flipx = BURN_ENDIAN_SWAP_INT16(sprite_word[1]) & 0x4000; - code = BURN_ENDIAN_SWAP_INT16(sprite_word[1]) & 0x1fff; - color = BURN_ENDIAN_SWAP_INT16(sprite_word[2]) >> 12; - - y-=1+16; - - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, 4, 0x0f, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, 4, 0x0f, 0, DrvGfxROM1); - } - } - } -} - -static void toki_draw_sprites() -{ - INT32 x,y,xoffs,yoffs,code,flipx,flipy,color,offs; - UINT16 *sprite_buffer = (UINT16*)DrvSprBuf; - UINT16 *sprite_word; - - for (offs = (0x800/2)-4;offs >= 0;offs -= 4) - { - sprite_word = &sprite_buffer[offs]; - - if ((BURN_ENDIAN_SWAP_INT16(sprite_word[2]) != 0xf000) && (BURN_ENDIAN_SWAP_INT16(sprite_word[0]) != 0xffff)) - { - xoffs = (BURN_ENDIAN_SWAP_INT16(sprite_word[0]) &0xf0); - x = (BURN_ENDIAN_SWAP_INT16(sprite_word[2]) + xoffs) & 0x1ff; - if (x > 256) - x -= 512; - - yoffs = (BURN_ENDIAN_SWAP_INT16(sprite_word[0]) &0xf) << 4; - y = (BURN_ENDIAN_SWAP_INT16(sprite_word[3]) + yoffs) & 0x1ff; - if (y > 256) - y -= 512; - - color = BURN_ENDIAN_SWAP_INT16(sprite_word[1]) >> 12; - flipx = BURN_ENDIAN_SWAP_INT16(sprite_word[0]) & 0x100; - flipy = 0; - code = (BURN_ENDIAN_SWAP_INT16(sprite_word[1]) & 0xfff) + ((BURN_ENDIAN_SWAP_INT16(sprite_word[2]) & 0x8000) >> 3); - - if (0) { // flipscreen - x=240-x; - y=240-y; - if (flipx) flipx=0; else flipx=1; - flipy=1; - } - - y-=16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, color, 4, 0x0f, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, color, 4, 0x0f, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, 4, 0x0f, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, 4, 0x0f, 0, DrvGfxROM1); - } - } - } - } -} - -static INT32 TokibDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - UINT16 *scrollram = (UINT16 *)DrvScrollRAM; - - if (BURN_ENDIAN_SWAP_INT16(scrollram[3]) & 0x2000) { - draw_bg_layer(DrvBg1RAM, DrvGfxROM2, 0, 0x200, BURN_ENDIAN_SWAP_INT16(scrollram[1])-0x103, BURN_ENDIAN_SWAP_INT16(scrollram[0])+1+16); - draw_bg_layer(DrvBg2RAM, DrvGfxROM3, 1, 0x300, BURN_ENDIAN_SWAP_INT16(scrollram[3])-0x101, BURN_ENDIAN_SWAP_INT16(scrollram[2])+1+16); - } else { - draw_bg_layer(DrvBg2RAM, DrvGfxROM3, 0, 0x300, BURN_ENDIAN_SWAP_INT16(scrollram[3])-0x101, BURN_ENDIAN_SWAP_INT16(scrollram[2])+1+16); - draw_bg_layer(DrvBg1RAM, DrvGfxROM2, 1, 0x200, BURN_ENDIAN_SWAP_INT16(scrollram[1])-0x103, BURN_ENDIAN_SWAP_INT16(scrollram[0])+1+16); - } - - tokib_draw_sprites(); - - draw_text_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - UINT16 *scrollram = (UINT16*)DrvScrollRAM; - INT32 bgscrolly,bgscrollx,fgscrolly,fgscrollx; - - bgscrollx = ((BURN_ENDIAN_SWAP_INT16(scrollram[0x06]) & 0x7f) << 1) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x06]) & 0x80) >> 7) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x05]) & 0x10) << 4); - bgscrolly = ((BURN_ENDIAN_SWAP_INT16(scrollram[0x0e]) & 0x7f) << 1) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x0e]) & 0x80) >> 7) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x0d]) & 0x10) << 4); - - fgscrollx = ((BURN_ENDIAN_SWAP_INT16(scrollram[0x16]) & 0x7f) << 1) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x16]) & 0x80) >> 7) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x15]) & 0x10) << 4); - fgscrolly = ((BURN_ENDIAN_SWAP_INT16(scrollram[0x1e]) & 0x7f) << 1) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x1e]) & 0x80) >> 7) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x1d]) & 0x10) << 4); - - if (~nBurnLayer & 1) memset (pTransDraw, 0, nScreenWidth * nScreenHeight * 2); - - if (BURN_ENDIAN_SWAP_INT16(scrollram[0x28]) & 0x0100) { - if (nBurnLayer & 1) draw_bg_layer(DrvBg1RAM, DrvGfxROM2, 0, 0x200, bgscrollx, bgscrolly+16); - if (nBurnLayer & 2) draw_bg_layer(DrvBg2RAM, DrvGfxROM3, 1, 0x300, fgscrollx, fgscrolly+16); - } else { - if (nBurnLayer & 2) draw_bg_layer(DrvBg2RAM, DrvGfxROM3, 0, 0x300, fgscrollx, fgscrolly+16); - if (nBurnLayer & 1) draw_bg_layer(DrvBg1RAM, DrvGfxROM2, 1, 0x200, bgscrollx, bgscrolly+16); - } - - //flipscreen = (scrollram[0x28]&0x8000)==0); - - toki_draw_sprites(); - - draw_text_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrawByLine(INT32 line) -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - UINT16 *scrollram = (UINT16*)DrvScrollRAM; - INT32 bgscrolly,bgscrollx,fgscrolly,fgscrollx; - - bgscrollx = ((BURN_ENDIAN_SWAP_INT16(scrollram[0x06]) & 0x7f) << 1) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x06]) & 0x80) >> 7) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x05]) & 0x10) << 4); - bgscrolly = ((BURN_ENDIAN_SWAP_INT16(scrollram[0x0e]) & 0x7f) << 1) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x0e]) & 0x80) >> 7) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x0d]) & 0x10) << 4); - - fgscrollx = ((BURN_ENDIAN_SWAP_INT16(scrollram[0x16]) & 0x7f) << 1) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x16]) & 0x80) >> 7) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x15]) & 0x10) << 4); - fgscrolly = ((BURN_ENDIAN_SWAP_INT16(scrollram[0x1e]) & 0x7f) << 1) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x1e]) & 0x80) >> 7) | ((BURN_ENDIAN_SWAP_INT16(scrollram[0x1d]) & 0x10) << 4); - -// memset (pTransDraw + line * 2, 0, nScreenWidth * 2); - if (~nBurnLayer & 1) memset (pTransDraw, 0, nScreenWidth * nScreenHeight * 2); - - if (BURN_ENDIAN_SWAP_INT16(scrollram[0x28]) & 0x0100) { - if (nBurnLayer & 1) draw_bg_layer_by_line(DrvBg1RAM, DrvGfxROM2, 0, 0x200, bgscrollx, bgscrolly+16, line); - if (nBurnLayer & 2) draw_bg_layer_by_line(DrvBg2RAM, DrvGfxROM3, 1, 0x300, fgscrollx, fgscrolly+16, line); - } else { - if (nBurnLayer & 2) draw_bg_layer_by_line(DrvBg2RAM, DrvGfxROM3, 0, 0x300, fgscrollx, fgscrolly+16, line); - if (nBurnLayer & 1) draw_bg_layer_by_line(DrvBg1RAM, DrvGfxROM2, 1, 0x200, bgscrollx, bgscrolly+16, line); - } - - return 0; -} - -static void assemble_inputs(UINT16 in0base, UINT16 in1base) -{ - DrvInps[0] = in0base; - DrvInps[1] = in1base; - - for (INT32 i = 0; i < 16; i++) { - DrvInps[0] ^= (DrvJoy1[i] & 1) << i; - DrvInps[1] ^= (DrvJoy2[i] & 1) << i; - } - - seibu_coin_input = ((DrvJoy3[1]&1)<<1)|(DrvJoy3[0]&1); -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - Drv68KROM[0x488] = ((DrvDips[2]) ? 0x0f : 0x00); // debug mode dip - - SekNewFrame(); - ZetNewFrame(); - - assemble_inputs(0xffff, 0xffff); - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { (10000000 * 100) / 5961, 3579545 / 60 }; // 59.61 fps - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 segment = (nCyclesTotal[0] / nInterleave) * (i + 1); - if (SekTotalCycles() < segment) { - nCyclesDone[0] += SekRun(segment - SekTotalCycles()); - } - - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - - if (pTransDraw && i >= 16 && i < 240) { - DrawByLine(i - 16); - } - - // when the line clears, the timer starts counting for the scroll regs to be written! - if (i == nInterleave-1) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - seibu_sound_update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - toki_draw_sprites(); - draw_text_layer(); - BurnTransferCopy(DrvPalette); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - - return 0; -} - -static INT32 TokibFrame() -{ - if (DrvReset) { - TokibDoReset(); - } - - INT32 nInterleave = MSM5205CalcInterleave(0, 4000000); - - SekNewFrame(); - ZetNewFrame(); - - assemble_inputs(0x3f3f, 0xff1f); - - INT32 nCyclesToDo[2] = { 10000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesToDo[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekClose(); - - ZetOpen(0); - BurnTimerUpdateYM3812((i + 1) * (nCyclesToDo[1] / nInterleave)); - MSM5205Update(); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrameYM3812(nCyclesToDo[1]); - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - TokibDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x800); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); - - if (is_bootleg) { - BurnYM3812Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - ZetScan(nAction); - } else { - seibu_sound_scan(pnMin, nAction); - } - - SCAN_VAR(TokibMSM5205Next); - SCAN_VAR(TokibMSM5205Toggle); - - DrvRecalc = 1; - } - - return 0; -} - - -// Toki (World, set 1) - -static struct BurnRomInfo tokiRomDesc[] = { - { "6e.m10", 0x20000, 0x94015d91, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "4e.k10", 0x20000, 0x531bd3ef, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5.m12", 0x10000, 0xd6a82808, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3.k12", 0x10000, 0xa01a5b10, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8.m3", 0x02000, 0x6c87c4c5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code (encrypted) - { "7.m7", 0x10000, 0xa67969c4, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "1.c5", 0x10000, 0x8aa964a2, 3 | BRF_GRA }, // 6 Characters - { "2.c3", 0x10000, 0x86e87e48, 3 | BRF_GRA }, // 7 - - { "toki_obj1.c20", 0x80000, 0xa27a80ba, 4 | BRF_GRA }, // 8 Background Tiles - { "toki_obj2.c22", 0x80000, 0xfa687718, 4 | BRF_GRA }, // 9 - - { "toki_bk1.cd8", 0x80000, 0xfdaa5f4b, 5 | BRF_GRA }, // 10 Foreground Tiles - - { "toki_bk2.ef8", 0x80000, 0xd86ac664, 6 | BRF_GRA }, // 11 Sprites - - { "9.m1", 0x20000, 0xae7a6b8b, 7 | BRF_SND }, // 12 MSM6295 Samples - - { "PROM27.J3", 0x00100, 0xe616ae85, 0 | BRF_OPT }, - { "PROM26.B6", 0x00100, 0xea6312c6, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(toki) -STD_ROM_FN(toki) - -struct BurnDriver BurnDrvToki = { - "toki", NULL, NULL, NULL, "1989", - "Toki (World, set 1)\0", NULL, "TAD Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, tokiRomInfo, tokiRomName, NULL, NULL, TokiInputInfo, TokiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Toki (World, set 2) - -static struct BurnRomInfo tokiaRomDesc[] = { - { "6.m10", 0x20000, 0x03d726b1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "4c.k10", 0x20000, 0xb2c345c5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5.m12", 0x10000, 0xd6a82808, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3.k12", 0x10000, 0xa01a5b10, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8.m3", 0x02000, 0x6c87c4c5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code (encrypted) - { "7.m7", 0x10000, 0xa67969c4, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "1.c5", 0x10000, 0x8aa964a2, 3 | BRF_GRA }, // 6 Characters - { "2.c3", 0x10000, 0x86e87e48, 3 | BRF_GRA }, // 7 - - { "toki_obj1.c20", 0x80000, 0xa27a80ba, 4 | BRF_GRA }, // 8 Background Tiles - { "toki_obj2.c22", 0x80000, 0xfa687718, 4 | BRF_GRA }, // 9 - - { "toki_bk1.cd8", 0x80000, 0xfdaa5f4b, 5 | BRF_GRA }, // 10 Foreground Tiles - - { "toki_bk2.ef8", 0x80000, 0xd86ac664, 6 | BRF_GRA }, // 11 Sprites - - { "9.m1", 0x20000, 0xae7a6b8b, 7 | BRF_SND }, // 12 MSM6295 Samples - - { "PROM27.J3", 0x00100, 0xe616ae85, 0 | BRF_OPT }, - { "PROM26.B6", 0x00100, 0xea6312c6, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(tokia) -STD_ROM_FN(tokia) - -struct BurnDriver BurnDrvTokia = { - "tokia", "toki", NULL, NULL, "1989", - "Toki (World, set 2)\0", NULL, "TAD Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, tokiaRomInfo, tokiaRomName, NULL, NULL, TokiInputInfo, TokiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Toki (US, set 1) - -static struct BurnRomInfo tokiuRomDesc[] = { - { "6b.10m", 0x20000, 0x3674d9fe, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "14.10k", 0x20000, 0xbfdd48af, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5.m12", 0x10000, 0xd6a82808, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3.k12", 0x10000, 0xa01a5b10, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8.m3", 0x02000, 0x6c87c4c5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code (encrypted) - { "7.m7", 0x10000, 0xa67969c4, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "1.c5", 0x10000, 0x8aa964a2, 3 | BRF_GRA }, // 6 Characters - { "2.c3", 0x10000, 0x86e87e48, 3 | BRF_GRA }, // 7 - - { "toki_obj1.c20", 0x80000, 0xa27a80ba, 4 | BRF_GRA }, // 8 Background Tiles - { "toki_obj2.c22", 0x80000, 0xfa687718, 4 | BRF_GRA }, // 9 - - { "toki_bk1.cd8", 0x80000, 0xfdaa5f4b, 5 | BRF_GRA }, // 10 Foreground Tiles - - { "toki_bk2.ef8", 0x80000, 0xd86ac664, 6 | BRF_GRA }, // 11 Sprites - - { "9.m1", 0x20000, 0xae7a6b8b, 7 | BRF_SND }, // 12 MSM6295 Samples - - { "PROM27.J3", 0x00100, 0xe616ae85, 0 | BRF_OPT }, - { "PROM26.B6", 0x00100, 0xea6312c6, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(tokiu) -STD_ROM_FN(tokiu) - -struct BurnDriver BurnDrvTokiu = { - "tokiu", "toki", NULL, NULL, "1989", - "Toki (US, set 1)\0", NULL, "TAD Corporation (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, tokiuRomInfo, tokiuRomName, NULL, NULL, TokiInputInfo, TokiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Toki (US, set 2) - -static struct BurnRomInfo tokiuaRomDesc[] = { - { "6.m10", 0x20000, 0x03d726b1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "4u.k10", 0x20000, 0xca2f50d9, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5.m12", 0x10000, 0xd6a82808, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3.k12", 0x10000, 0xa01a5b10, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8.m3", 0x02000, 0x6c87c4c5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code (encrypted) - { "7.m7", 0x10000, 0xa67969c4, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "1.c5", 0x10000, 0x8aa964a2, 3 | BRF_GRA }, // 6 Characters - { "2.c3", 0x10000, 0x86e87e48, 3 | BRF_GRA }, // 7 - - { "toki_obj1.c20", 0x80000, 0xa27a80ba, 4 | BRF_GRA }, // 8 Background Tiles - { "toki_obj2.c22", 0x80000, 0xfa687718, 4 | BRF_GRA }, // 9 - - { "toki_bk1.cd8", 0x80000, 0xfdaa5f4b, 5 | BRF_GRA }, // 10 Foreground Tiles - - { "toki_bk2.ef8", 0x80000, 0xd86ac664, 6 | BRF_GRA }, // 11 Sprites - - { "9.m1", 0x20000, 0xae7a6b8b, 7 | BRF_SND }, // 12 MSM6295 Samples - - { "PROM27.J3", 0x00100, 0xe616ae85, 0 | BRF_OPT }, - { "PROM26.B6", 0x00100, 0xea6312c6, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(tokiua) -STD_ROM_FN(tokiua) - -struct BurnDriver BurnDrvTokiua = { - "tokiua", "toki", NULL, NULL, "1989", - "Toki (US, set 2)\0", NULL, "TAD Corporation (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, tokiuaRomInfo, tokiuaRomName, NULL, NULL, TokiInputInfo, TokiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Toki (US, prototype?) - -static struct BurnRomInfo tokipRomDesc[] = { - { "6 10-M", 0x20000, 0x91b554a3, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "4 10-K", 0x20000, 0x404220f7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5 12-M", 0x10000, 0xd6a82808, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3 12-K", 0x10000, 0xa01a5b10, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8 3-M", 0x02000, 0x6c87c4c5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code (encrypted) - { "7 7-M", 0x10000, 0xa67969c4, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "1 5-C", 0x10000, 0xfd0ff303, 3 | BRF_GRA }, // 6 Characters - { "2 3-C", 0x10000, 0x86e87e48, 3 | BRF_GRA }, // 7 - - { "OBJ 1-0.ROM10", 0x20000, 0xa027bd8e, 4 | BRF_GRA }, // 8 Background Tiles - { "OBJ 1-1.ROM9", 0x20000, 0x43a767ea, 4 | BRF_GRA }, // 9 - { "OBJ 1-2.ROM12", 0x20000, 0x1aecc9d8, 4 | BRF_GRA }, // 10 - { "OBJ 1-3.ROM11", 0x20000, 0xd65c0c6d, 4 | BRF_GRA }, // 11 - { "OBJ 2-0.ROM14", 0x20000, 0xcedaccaf, 4 | BRF_GRA }, // 12 - { "OBJ 2-1.ROM13", 0x20000, 0x013f539b, 4 | BRF_GRA }, // 13 - { "OBJ 2-2.ROM16", 0x20000, 0x6a8e6e22, 4 | BRF_GRA }, // 14 - { "OBJ 2-3.ROM15", 0x20000, 0x25d9a16c, 4 | BRF_GRA }, // 15 - - { "BACK 1-0.ROM5", 0x20000, 0xfac7e32f, 5 | BRF_GRA }, // 16 Foreground Tiles - { "BACK 1-1.ROM6", 0x20000, 0xee1135d6, 5 | BRF_GRA }, // 17 - { "BACK 1-2.ROM7", 0x20000, 0x78db8d57, 5 | BRF_GRA }, // 18 - { "BACK 1-3.ROM8", 0x20000, 0xd719de71, 5 | BRF_GRA }, // 19 - - { "BACK 2-0.ROM1", 0x20000, 0x949d8025, 6 | BRF_GRA }, // 20 Sprites - { "BACK 2-1.ROM2", 0x20000, 0x4b28b4b4, 6 | BRF_GRA }, // 21 - { "BACK 2-2.ROM3", 0x20000, 0x1aa9a5cf, 6 | BRF_GRA }, // 22 - { "BACK 2-3.ROM4", 0x20000, 0x6759571f, 6 | BRF_GRA }, // 23 - - { "9 1-M", 0x20000, 0xae7a6b8b, 7 | BRF_SND }, // 24 MSM6295 Samples - - { "PROM27.J3", 0x00100, 0xe616ae85, 0 | BRF_OPT }, - { "PROM26.B6", 0x00100, 0xea6312c6, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(tokip) -STD_ROM_FN(tokip) - -struct BurnDriver BurnDrvTokip = { - "tokip", "toki", NULL, NULL, "1989", - "Toki (US, prototype?)\0", NULL, "TAD Corporation (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, tokipRomInfo, tokipRomName, NULL, NULL, TokiInputInfo, TokiDIPInfo, - TokipInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// JuJu Densetsu (Japan) - -static struct BurnRomInfo jujuRomDesc[] = { - { "6.m10", 0x20000, 0x03d726b1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "4.k10", 0x20000, 0x54a45e12, 1 | BRF_PRG | BRF_ESS }, // 1 - { "5.m12", 0x10000, 0xd6a82808, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3.k12", 0x10000, 0xa01a5b10, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8.m3", 0x02000, 0x6c87c4c5, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code (encrypted) - { "7.m7", 0x10000, 0xa67969c4, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "1.c5", 0x10000, 0x8aa964a2, 3 | BRF_GRA }, // 6 Characters - { "2.c3", 0x10000, 0x86e87e48, 3 | BRF_GRA }, // 7 - - { "toki_obj1.c20", 0x80000, 0xa27a80ba, 4 | BRF_GRA }, // 8 Background Tiles - { "toki_obj2.c22", 0x80000, 0xfa687718, 4 | BRF_GRA }, // 9 - - { "toki_bk1.cd8", 0x80000, 0xfdaa5f4b, 5 | BRF_GRA }, // 10 Foreground Tiles - - { "toki_bk2.ef8", 0x80000, 0xd86ac664, 6 | BRF_GRA }, // 11 Sprites - - { "9.m1", 0x20000, 0xae7a6b8b, 7 | BRF_SND }, // 12 MSM6295 Samples - - { "PROM27.J3", 0x00100, 0xe616ae85, 0 | BRF_OPT }, - { "PROM26.B6", 0x00100, 0xea6312c6, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(juju) -STD_ROM_FN(juju) - -struct BurnDriver BurnDrvJuju = { - "juju", "toki", NULL, NULL, "1989", - "JuJu Densetsu (Japan)\0", NULL, "TAD Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, jujuRomInfo, jujuRomName, NULL, NULL, TokiInputInfo, TokiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// JuJu Densetsu (Playmark bootleg) - -static struct BurnRomInfo jujubRomDesc[] = { - { "jujub_playmark.e3", 0x20000, 0xb50c73ec, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "jujub_playmark.e5", 0x20000, 0xb2812942, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tokijp.005", 0x10000, 0xd6a82808, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tokijp.003", 0x10000, 0xa01a5b10, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "toki.e1", 0x10000, 0x2832ef75, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code (encrypted) - - { "toki.e21", 0x08000, 0xbb8cacbd, 3 | BRF_GRA }, // 5 Characters - { "toki.e13", 0x08000, 0x052ad275, 3 | BRF_GRA }, // 6 - { "toki.e22", 0x08000, 0x04dcdc21, 3 | BRF_GRA }, // 7 - { "toki.e7", 0x08000, 0x70729106, 3 | BRF_GRA }, // 8 - - { "toki.e26", 0x20000, 0xa8ba71fc, 4 | BRF_GRA }, // 9 Background Tiles - { "toki.e28", 0x20000, 0x29784948, 4 | BRF_GRA }, // 10 - { "toki.e34", 0x20000, 0xe5f6e19b, 4 | BRF_GRA }, // 11 - { "toki.e36", 0x20000, 0x96e8db8b, 4 | BRF_GRA }, // 12 - { "toki.e30", 0x20000, 0x770d2b1b, 4 | BRF_GRA }, // 13 - { "toki.e32", 0x20000, 0xc289d246, 4 | BRF_GRA }, // 14 - { "toki.e38", 0x20000, 0x87f4e7fb, 4 | BRF_GRA }, // 15 - { "toki.e40", 0x20000, 0x96e87350, 4 | BRF_GRA }, // 16 - - { "toki.e23", 0x10000, 0xfeb13d35, 5 | BRF_GRA }, // 17 Foreground Tiles - { "toki.e24", 0x10000, 0x5b365637, 5 | BRF_GRA }, // 18 - { "toki.e15", 0x10000, 0x617c32e6, 5 | BRF_GRA }, // 19 - { "toki.e16", 0x10000, 0x2a11c0f0, 5 | BRF_GRA }, // 20 - { "toki.e17", 0x10000, 0xfbc3d456, 5 | BRF_GRA }, // 21 - { "toki.e18", 0x10000, 0x4c2a72e1, 5 | BRF_GRA }, // 22 - { "toki.e8", 0x10000, 0x46a1b821, 5 | BRF_GRA }, // 23 - { "toki.e9", 0x10000, 0x82ce27f6, 5 | BRF_GRA }, // 24 - - { "toki.e25", 0x10000, 0x63026cad, 6 | BRF_GRA }, // 25 Sprites - { "toki.e20", 0x10000, 0xa7f2ce26, 6 | BRF_GRA }, // 26 - { "toki.e11", 0x10000, 0x48989aa0, 6 | BRF_GRA }, // 27 - { "toki.e12", 0x10000, 0xc2ad9342, 6 | BRF_GRA }, // 28 - { "toki.e19", 0x10000, 0x6cd22b18, 6 | BRF_GRA }, // 29 - { "toki.e14", 0x10000, 0x859e313a, 6 | BRF_GRA }, // 30 - { "toki.e10", 0x10000, 0xe15c1d0f, 6 | BRF_GRA }, // 31 - { "toki.e6", 0x10000, 0x6f4b878a, 6 | BRF_GRA }, // 32 -}; - -STD_ROM_PICK(jujub) -STD_ROM_FN(jujub) - -struct BurnDriver BurnDrvJujub = { - "jujub", "toki", NULL, NULL, "1989", - "JuJu Densetsu (Playmark bootleg)\0", NULL, "bootleg (Playmark)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, jujubRomInfo, jujubRomName, NULL, NULL, TokibInputInfo, TokibDIPInfo, - TokibInit, DrvExit, TokibFrame, TokibDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// JuJu Densetsu (Japan, bootleg) - -static struct BurnRomInfo jujubaRomDesc[] = { - { "8.19g", 0x10000, 0x208fb08a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "5.19e", 0x10000, 0x722e5183, 1 | BRF_PRG | BRF_ESS }, // 1 - { "9.20g", 0x10000, 0xcb82cc33, 1 | BRF_PRG | BRF_ESS }, // 2 - { "6.20e", 0x10000, 0x826ab39d, 1 | BRF_PRG | BRF_ESS }, // 3 - { "10.21g", 0x10000, 0x6c7a3ffe, 1 | BRF_PRG | BRF_ESS }, // 4 - { "7.21e", 0x10000, 0xb0628230, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "3.9c", 0x08000, 0x808f5e44, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 Code (encrypted) - { "4.11c", 0x10000, 0xa67969c4, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "5.19h", 0x10000, 0x8aa964a2, 3 | BRF_GRA }, // 8 Characters - { "6.20h", 0x10000, 0x86e87e48, 3 | BRF_GRA }, // 9 - - { "1.17d", 0x20000, 0xa027bd8e, 4 | BRF_GRA }, // 10 Background Tiles - { "27.17b", 0x20000, 0x43a767ea, 4 | BRF_GRA }, // 11 - { "2.18d", 0x20000, 0x1aecc9d8, 4 | BRF_GRA }, // 12 - { "28.18b", 0x20000, 0xd65c0c6d, 4 | BRF_GRA }, // 13 - { "3.20d", 0x20000, 0xcedaccaf, 4 | BRF_GRA }, // 14 - { "29.20b", 0x20000, 0x013f539b, 4 | BRF_GRA }, // 15 - { "4.21d", 0x20000, 0x6a8e6e22, 4 | BRF_GRA }, // 16 - { "30.21b", 0x20000, 0x25d9a16c, 4 | BRF_GRA }, // 17 - - { "11.1j", 0x10000, 0x6ad15560, 5 | BRF_GRA }, // 18 Foreground Tiles - { "12.2j", 0x10000, 0x68534844, 5 | BRF_GRA }, // 19 - { "13.4j", 0x10000, 0xf271be5a, 5 | BRF_GRA }, // 20 - { "14.5j", 0x10000, 0x5d4c187a, 5 | BRF_GRA }, // 21 - { "19.1l", 0x10000, 0x10afdf03, 5 | BRF_GRA }, // 22 - { "20.2l", 0x10000, 0x2dc54f41, 5 | BRF_GRA }, // 23 - { "21.4l", 0x10000, 0x946862a3, 5 | BRF_GRA }, // 24 - { "22.5l", 0x10000, 0xb45f5608, 5 | BRF_GRA }, // 25 - - { "15.18j", 0x10000, 0xcb8b1d31, 6 | BRF_GRA }, // 26 Sprites - { "16.19j", 0x10000, 0x81594e0a, 6 | BRF_GRA }, // 27 - { "17.20j", 0x10000, 0x4acd44ce, 6 | BRF_GRA }, // 28 - { "18.21j", 0x10000, 0x25cfe9c3, 6 | BRF_GRA }, // 29 - { "23.18l", 0x10000, 0x06c8d622, 6 | BRF_GRA }, // 30 - { "24.19l", 0x10000, 0x362a0506, 6 | BRF_GRA }, // 31 - { "25.20l", 0x10000, 0xbe064c4b, 6 | BRF_GRA }, // 32 - { "26.21l", 0x10000, 0xf8b5b38d, 6 | BRF_GRA }, // 33 - - { "1.6a", 0x10000, 0x377153ad, 7 | BRF_SND }, // 34 oki - { "2.7a", 0x10000, 0x093ca15d, 7 | BRF_SND }, // 35 -}; - -STD_ROM_PICK(jujuba) -STD_ROM_FN(jujuba) - -struct BurnDriverD BurnDrvJujuba = { - "jujuba", "toki", NULL, NULL, "1989", - "JuJu Densetsu (Japan, bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, jujubaRomInfo, jujubaRomName, NULL, NULL, TokiInputInfo, TokiDIPInfo, - JujubaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - -// Toki (Datsu bootleg) - -static struct BurnRomInfo tokibRomDesc[] = { - { "toki.e3", 0x20000, 0xae9b3da4, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "toki.e5", 0x20000, 0x66a5a1d6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tokijp.005", 0x10000, 0xd6a82808, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tokijp.003", 0x10000, 0xa01a5b10, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "toki.e1", 0x10000, 0x2832ef75, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code (encrypted) - - { "toki.e21", 0x08000, 0xbb8cacbd, 3 | BRF_GRA }, // 5 Characters - { "toki.e13", 0x08000, 0x052ad275, 3 | BRF_GRA }, // 6 - { "toki.e22", 0x08000, 0x04dcdc21, 3 | BRF_GRA }, // 7 - { "toki.e7", 0x08000, 0x70729106, 3 | BRF_GRA }, // 8 - - { "toki.e26", 0x20000, 0xa8ba71fc, 4 | BRF_GRA }, // 9 Background Tiles - { "toki.e28", 0x20000, 0x29784948, 4 | BRF_GRA }, // 10 - { "toki.e34", 0x20000, 0xe5f6e19b, 4 | BRF_GRA }, // 11 - { "toki.e36", 0x20000, 0x96e8db8b, 4 | BRF_GRA }, // 12 - { "toki.e30", 0x20000, 0x770d2b1b, 4 | BRF_GRA }, // 13 - { "toki.e32", 0x20000, 0xc289d246, 4 | BRF_GRA }, // 14 - { "toki.e38", 0x20000, 0x87f4e7fb, 4 | BRF_GRA }, // 15 - { "toki.e40", 0x20000, 0x96e87350, 4 | BRF_GRA }, // 16 - - { "toki.e23", 0x10000, 0xfeb13d35, 5 | BRF_GRA }, // 17 Foreground Tiles - { "toki.e24", 0x10000, 0x5b365637, 5 | BRF_GRA }, // 18 - { "toki.e15", 0x10000, 0x617c32e6, 5 | BRF_GRA }, // 19 - { "toki.e16", 0x10000, 0x2a11c0f0, 5 | BRF_GRA }, // 20 - { "toki.e17", 0x10000, 0xfbc3d456, 5 | BRF_GRA }, // 21 - { "toki.e18", 0x10000, 0x4c2a72e1, 5 | BRF_GRA }, // 22 - { "toki.e8", 0x10000, 0x46a1b821, 5 | BRF_GRA }, // 23 - { "toki.e9", 0x10000, 0x82ce27f6, 5 | BRF_GRA }, // 24 - - { "toki.e25", 0x10000, 0x63026cad, 6 | BRF_GRA }, // 25 Sprites - { "toki.e20", 0x10000, 0xa7f2ce26, 6 | BRF_GRA }, // 26 - { "toki.e11", 0x10000, 0x48989aa0, 6 | BRF_GRA }, // 27 - { "toki.e12", 0x10000, 0xc2ad9342, 6 | BRF_GRA }, // 28 - { "toki.e19", 0x10000, 0x6cd22b18, 6 | BRF_GRA }, // 29 - { "toki.e14", 0x10000, 0x859e313a, 6 | BRF_GRA }, // 30 - { "toki.e10", 0x10000, 0xe15c1d0f, 6 | BRF_GRA }, // 31 - { "toki.e6", 0x10000, 0x6f4b878a, 6 | BRF_GRA }, // 32 -}; - -STD_ROM_PICK(tokib) -STD_ROM_FN(tokib) - -struct BurnDriver BurnDrvTokib = { - "tokib", "toki", NULL, NULL, "1989", - "Toki (bootleg)\0", NULL, "bootleg (Datsu)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, tokibRomInfo, tokibRomName, NULL, NULL, TokibInputInfo, TokibDIPInfo, - TokibInit, DrvExit, TokibFrame, TokibDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_toypop.cpp b/jan/src/burn/drv/pre90s/d_toypop.cpp deleted file mode 100644 index 7a5cfe0f1..000000000 --- a/jan/src/burn/drv/pre90s/d_toypop.cpp +++ /dev/null @@ -1,956 +0,0 @@ -// FB Alpha "Universal System 16" hardware driver module -// Based on MAME driver by Angelo Salese - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "m68000_intf.h" -#include "namco_snd.h" -#include "namcoio.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM0; -static UINT8 *DrvM6809ROM1; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvSndPROM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvShareRAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvBgVRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 slave_in_reset; -static UINT16 sound_in_reset; -static UINT16 palette_bank; -static UINT16 master_irq_enable; -static UINT16 slave_irq_enable; -static UINT16 flipscreen; - -static UINT16 address_xor = 0; // toypop = 0x800 - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvJoy6[8]; -static UINT8 DrvDips[4]; -static UINT8 DrvInputs[7]; -static UINT8 DrvReset; - -static struct BurnInputInfo LiblrablInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy6 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy5 + 2, "p1 start" }, - {"P1 Left Up", BIT_DIGITAL, DrvJoy3 + 0, "p1 up" }, - {"P1 Left Down", BIT_DIGITAL, DrvJoy3 + 2, "p1 down" }, - {"P1 Left Left", BIT_DIGITAL, DrvJoy3 + 3, "p1 left" }, - {"P1 Left Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right" }, - {"P1 Right Up", BIT_DIGITAL, DrvJoy1 + 0, "p3 up" }, - {"P1 Right Down", BIT_DIGITAL, DrvJoy1 + 2, "p3 down" }, - {"P1 Right Left", BIT_DIGITAL, DrvJoy1 + 3, "p3 left" }, - {"P1 Right Right", BIT_DIGITAL, DrvJoy1 + 1, "p3 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy5 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy6 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy5 + 3, "p2 start" }, - {"P2 Left Up", BIT_DIGITAL, DrvJoy4 + 0, "p2 up" }, - {"P2 Left Down", BIT_DIGITAL, DrvJoy4 + 2, "p2 down" }, - {"P2 Left Left", BIT_DIGITAL, DrvJoy4 + 3, "p2 left" }, - {"P2 Left Right", BIT_DIGITAL, DrvJoy4 + 1, "p2 right" }, - {"P2 Right Up", BIT_DIGITAL, DrvJoy2 + 0, "p4 up" }, - {"P2 Right Down", BIT_DIGITAL, DrvJoy2 + 2, "p4 down" }, - {"P2 Right Left", BIT_DIGITAL, DrvJoy2 + 3, "p4 left" }, - {"P2 Right Right", BIT_DIGITAL, DrvJoy2 + 1, "p4 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy5 + 1, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Liblrabl) - -static struct BurnInputInfo ToypopInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy6 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy5 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy5 + 0, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy6 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy5 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy5 + 1, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy6 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Toypop) - -static struct BurnDIPInfo LiblrablDIPList[]= -{ - {0x17, 0xff, 0xff, 0xff, NULL }, - {0x18, 0xff, 0xff, 0xff, NULL }, - {0x19, 0xff, 0xff, 0x0f, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x17, 0x01, 0x03, 0x02, "1" }, - {0x17, 0x01, 0x03, 0x00, "2" }, - {0x17, 0x01, 0x03, 0x03, "3" }, - {0x17, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 13, "Bonus Life" }, - {0x17, 0x01, 0x1c, 0x1c, "40k 120k 200k 400k 600k 1m" }, - {0x17, 0x01, 0x1c, 0x0c, "40k 140k 250k 400k 700k 1m" }, - {0x17, 0x01, 0x1c, 0x14, "50k 150k 300k 500k 700k 1m" }, - {0x17, 0x01, 0x1c, 0x04, "40k 120k and every 120k" }, - {0x17, 0x01, 0x1c, 0x18, "40k 150k and every 150k" }, - {0x17, 0x01, 0x1c, 0x08, "50k 150k 300k" }, - {0x17, 0x01, 0x1c, 0x10, "40k 120k 200k" }, - {0x17, 0x01, 0x1c, 0x14, "40k 120k" }, - {0x17, 0x01, 0x1c, 0x04, "50k 150k" }, - {0x17, 0x01, 0x1c, 0x18, "50k 150k and every 150k" }, - {0x17, 0x01, 0x1c, 0x08, "60k 200k and every 200k" }, - {0x17, 0x01, 0x1c, 0x10, "50k" }, - {0x17, 0x01, 0x1c, 0x00, "None" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x17, 0x01, 0xe0, 0x80, "3 Coins 1 Credits" }, - {0x17, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x17, 0x01, 0xe0, 0x00, "3 Coins 2 Credits" }, - {0x17, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x17, 0x01, 0xe0, 0x40, "2 Coins 3 Credits" }, - {0x17, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x17, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x17, 0x01, 0xe0, 0x20, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x18, 0x01, 0x01, 0x01, "Off" }, - {0x18, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Rack Test" }, - {0x18, 0x01, 0x02, 0x02, "Off" }, - {0x18, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x18, 0x01, 0x04, 0x00, "Off" }, - {0x18, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x18, 0x01, 0x18, 0x00, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x18, 0x01, 0x18, 0x08, "1 Coin 5 Credits" }, - {0x18, 0x01, 0x18, 0x10, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Practice" }, - {0x18, 0x01, 0x20, 0x00, "Off" }, - {0x18, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x18, 0x01, 0xc0, 0xc0, "A" }, - {0x18, 0x01, 0xc0, 0x40, "B" }, - {0x18, 0x01, 0xc0, 0x80, "C" }, - {0x18, 0x01, 0xc0, 0x00, "D" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x19, 0x01, 0x04, 0x04, "Upright" }, - {0x19, 0x01, 0x04, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x19, 0x01, 0x08, 0x00, "On" }, - {0x19, 0x01, 0x08, 0x08, "Off" }, -}; - -STDDIPINFO(Liblrabl) - -static struct BurnDIPInfo ToypopDIPList[]= -{ - {0x10, 0xff, 0xff, 0xbf, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x02, "1" }, - {0x10, 0x01, 0x03, 0x01, "2" }, - {0x10, 0x01, 0x03, 0x03, "3" }, - {0x10, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x10, 0x01, 0x0c, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0c, 0x04, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x10, 0x01, 0x30, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x10, 0x01, 0x40, 0x00, "Off" }, - {0x10, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x11, 0x01, 0x04, 0x00, "1 Credit" }, - {0x11, 0x01, 0x04, 0x04, "2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Entering" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x60, 0x40, "Easy" }, - {0x11, 0x01, 0x60, 0x60, "Normal" }, - {0x11, 0x01, 0x60, 0x20, "Hard" }, - {0x11, 0x01, 0x60, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x80, 0x80, "Every 15000 points" }, - {0x11, 0x01, 0x80, 0x00, "Every 20000 points" }, -}; - -STDDIPINFO(Toypop) - -static void toypop_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0x8000) { - slave_in_reset = address & 0x800; - if (!slave_in_reset) { - SekReset(); - } - return; - } - - if ((address & 0xf000) == 0x9000) { - sound_in_reset = address & 0x800; - if (sound_in_reset) { - M6809Close(); - M6809Open(1); - M6809Reset(); - M6809Close(); - M6809Open(0); - } - return; - } - - switch (address) - { - case 0xa000: - case 0xa001: - palette_bank = address & 1; - return; - } - - if ((address & 0xf000) == 0x6000) address ^= address_xor; - - if ((address & 0xfc00) == 0x6000) { - namco_15xx_sharedram_write(address,data); - return; - } - - if ((address & 0xfff0) == 0x6800) { - namcoio_write(0, address & 0xf, data); - return; - } - - if ((address & 0xfff0) == 0x6810) { - namcoio_write(1, address & 0xf, data); - return; - } - - if ((address & 0xfff0) == 0x6820) { - namcoio_write(2, address & 0xf, data); - return; - } - - if ((address & 0xf000) == 0x7000) { - master_irq_enable = (address & 0x0800) ? 0 : 1; - return; - } -} - -static UINT8 toypop_main_read(UINT16 address) -{ - if ((address & 0xf000) == 0x6000) address ^= address_xor; - - if ((address & 0xfc00) == 0x6000) { - return namco_15xx_sharedram_read(address); - } - - if ((address & 0xfff0) == 0x6800) { - return namcoio_read(0, address & 0xf); - } - - if ((address & 0xfff0) == 0x6810) { - return namcoio_read(1, address & 0xf); - } - - if ((address & 0xfff0) == 0x6820) { - return namcoio_read(2, address & 0xf); - } - - if ((address & 0xf000) == 0x7000 && (address_xor == 0x800)) { // only toypop! - master_irq_enable = 1; - return 0; - } - - return 0; -} - -static void __fastcall toypop_slave_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x100000) { - DrvShareRAM[(address / 2) & 0x7ff] = data & 0xff; - return; - } - - if ((address & 0xff8000) == 0x180000) { - address = (address & 0x7ffe) * 2; - *((UINT16*)(DrvBgVRAM + (address+0))) = ((data & 0x00f0) << 4) | ((data & 0x000f)); - *((UINT16*)(DrvBgVRAM + (address+2))) = ((data & 0xf000) >> 4) | ((data & 0xf00) >> 8); - return; - } - - if ((address & 0xf00000) == 0x300000) { - slave_irq_enable = (address & 0x40000) ? 0 : 1; - return; - } -} - -static void __fastcall toypop_slave_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff001) == 0x100001) { - DrvShareRAM[(address / 2) & 0x7ff] = data; - return; - } - - if ((address & 0xf00000) == 0x300000) { - slave_irq_enable = (address & 0x40000) ? 0 : 1; - return; - } -} - -static UINT16 __fastcall toypop_slave_read_word(UINT32 address) -{ - if ((address & 0xfff000) == 0x100000) { - return DrvShareRAM[(address / 2) & 0x7ff]; - } - - if ((address & 0xff8000) == 0x180000) { - UINT16 *p = (UINT16*)DrvBgVRAM; - UINT16 ret; - ret = (p[(address & 0x7ffe)+0] & 0xf00) >> 4; - ret |= (p[(address & 0x7ffe)+0] & 0x00f) >> 0; - ret |= (p[(address & 0x7ffe)+1] & 0xf00) << 4; - ret |= (p[(address & 0x7ffe)+1] & 0x00f) << 8; - - return ret; - } - - return 0; -} - -static UINT8 __fastcall toypop_slave_read_byte(UINT32 address) -{ - if ((address & 0xfff001) == 0x100001) { - return DrvShareRAM[(address / 2) & 0x7ff]; - } - - return 0; -} - -static void toypop_sound_write(UINT16 address, UINT8 data) -{ - if (address <= 0x03ff) { - namco_15xx_sharedram_write(address,data); - return; - } -} - -static UINT8 toypop_sound_read(UINT16 address) -{ - if (address <= 0x03ff) { - return namco_15xx_sharedram_read(address); - } - - return 0; -} - -static tilemap_scan( foreground ) -{ - INT32 offs; - - row += 2; - col -= 2; - if (col & 0x20) - offs = row + ((col & 0x1f) << 5); - else - offs = col + (row << 5); - - return offs; -} - -static tilemap_callback( foreground ) -{ - UINT8 attr = DrvFgRAM[offs + 0x400] & 0x3f; - UINT8 code = DrvFgRAM[offs] & 0x1ff; - - TILE_SET_INFO(0, code, attr + palette_bank * 0x40, 0); -} - -static UINT8 nio0_i0(UINT8) { return DrvInputs[5] & 0xf; } // COINS -static UINT8 nio0_i1(UINT8) { return DrvInputs[0] & 0xf; } // P1_RIGHT -static UINT8 nio0_i2(UINT8) { return DrvInputs[1] & 0xf; } // P2_RIGHT -static UINT8 nio0_i3(UINT8) { return DrvInputs[4] & 0xf; } // BUTTONS - -static UINT8 nio1_i0(UINT8) { return DrvDips[0] >> 4; } -static UINT8 nio1_i1(UINT8) { return DrvDips[1] & 0xf; } -static UINT8 nio1_i2(UINT8) { return DrvDips[1] >> 4; } -static UINT8 nio1_i3(UINT8) { return DrvDips[0] & 0xf; } -static void nio1_o0(UINT8, UINT8 data) { flipscreen = data; } - -static UINT8 nio2_i1(UINT8) { return DrvInputs[2] & 0xf; } // P1_LEFT -static UINT8 nio2_i2(UINT8) { return DrvInputs[3] & 0xf; } // P2_LEFT -static UINT8 nio2_i3(UINT8) { return DrvDips[2] & 0xf; } // SERVICE - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - SekOpen(0); - SekReset(); - SekClose(); - - M6809Open(1); - M6809Reset(); - NamcoSoundReset(); - M6809Close(); - - namcoio_reset(0); - namcoio_reset(1); - namcoio_reset(2); - - slave_in_reset = 1; // start with slave turned off - sound_in_reset = 1; // start with sound turned off - palette_bank = 0; - master_irq_enable = 0; - slave_irq_enable = 0; - flipscreen = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM0 = Next; Next += 0x008000; - DrvM6809ROM1 = Next; Next += 0x002000; - Drv68KROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000600; - - NamcoSoundProm = Next; - DrvSndPROM = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0320 * sizeof(UINT32); - - AllRam = Next; - - DrvFgRAM = Next; Next += 0x002000; - DrvShareRAM = Next; Next += 0x000800; - Drv68KRAM = Next; Next += 0x040000; - DrvBgVRAM = Next; Next += 0x050000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[2] = { 0, 4 }; - INT32 XOffs0[8] = { STEP4(64,1), STEP4(0,1) }; - INT32 XOffs1[16]= { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 2, 8, 8, Plane, XOffs0, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x4000); - - GfxDecode(0x0100, 2, 16, 16, Plane, XOffs1, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit(INT32 addr_xor) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvM6809ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM0 + 0x4000, 1, 1)) return 1; - - if (BurnLoadRom(DrvM6809ROM1 + 0x0000, 2, 1)) return 1; - - if (BurnLoadRom(Drv68KROM + 0x0001, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000, 4, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 8, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 9, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0300, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0400, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndPROM + 0x0000, 12, 1)) return 1; - - DrvGfxDecode(); - } - - address_xor = addr_xor; - - M6809Init(2); - M6809Open(0); - M6809MapMemory(DrvFgRAM, 0x0000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvShareRAM, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM0, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(toypop_main_write); - M6809SetReadHandler(toypop_main_read); - M6809Close(); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x007fff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x0bffff, MAP_RAM); - SekMapMemory(DrvBgVRAM, 0x190000, 0x1dffff, MAP_RAM); - SekSetWriteWordHandler(0, toypop_slave_write_word); - SekSetWriteByteHandler(0, toypop_slave_write_byte); - SekSetReadWordHandler(0, toypop_slave_read_word); - SekSetReadByteHandler(0, toypop_slave_read_byte); - SekClose(); - - M6809Open(1); - M6809MapMemory(DrvM6809ROM1, 0xe000, 0xffff, MAP_ROM); - M6809SetWriteHandler(toypop_sound_write); - M6809SetReadHandler(toypop_sound_read); - M6809Close(); - - NamcoSoundInit(24000, 8, 0); - NacmoSoundSetAllRoutes(0.50 * 10.0 / 16.0, BURN_SND_ROUTE_BOTH); - - namcoio_init(0, NAMCO58xx, nio0_i0, nio0_i1, nio0_i2, nio0_i3, NULL, NULL); - namcoio_init(1, NAMCO56xx, nio1_i0, nio1_i1, nio1_i2, nio1_i3, nio1_o0, NULL); - namcoio_init(2, NAMCO56xx, NULL, nio2_i1, nio2_i2, nio2_i3, NULL, NULL); - - GenericTilesInit(); - GenericTilemapInit(0, foreground_map_scan, foreground_map_callback, 8, 8, 36, 28); - GenericTilemapSetGfx(0, DrvGfxROM0, 2, 8, 8, 0x8000, 0, 0x7f); - GenericTilemapSetTransparent(0, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - SekExit(); - - NamcoSoundExit(); - NamcoSoundProm = NULL; - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 pal[0x100]; - - for (INT32 i = 0;i < 256;i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i+0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i+0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i+0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i+0x100] >> 3) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i+0x200] >> 0) & 0x01; - bit1 = (DrvColPROM[i+0x200] >> 1) & 0x01; - bit2 = (DrvColPROM[i+0x200] >> 2) & 0x01; - bit3 = (DrvColPROM[i+0x200] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - pal[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0;i < 256;i++) - { - DrvPalette[i + 0x000] = pal[(DrvColPROM[i+0x300] & 0xf) + 0x70]; - DrvPalette[i + 0x100] = pal[(DrvColPROM[i+0x300] & 0xf) + 0xf0]; - DrvPalette[i + 0x200] = pal[(DrvColPROM[i+0x500])]; - } - - for (INT32 i = 0;i < 16;i++) - { - DrvPalette[i + 0x300] = pal[i + 0x60]; - DrvPalette[i + 0x310] = pal[i + 0xe0]; - } -} - -static void draw_bg_layer() -{ - const UINT16 pal_base = 0x300 + (palette_bank * 16); - const UINT32 src_base = 0x200/2; - const UINT32 src_pitch = 288 / 2; - UINT16 *ram = (UINT16*)DrvBgVRAM; - - for (INT32 y = 0; y < nScreenHeight; ++y) - { - UINT16 *src = &ram[y * src_pitch + src_base]; - UINT16 *dst = pTransDraw + (((flipscreen) ? (nScreenHeight - 1 - y) : y) * nScreenWidth); - - for (INT32 x = 0; x < nScreenWidth; x += 2) - { - UINT32 srcpix = *src++; - *dst++ = ((srcpix >> 8) & 0xf) + pal_base; - *dst++ = (srcpix & 0xf) + pal_base; - } - } -} - -static void draw_sprites() -{ - UINT8 *base_spriteram = (DrvFgRAM + 0x800); - const uint16_t bank1 = 0x0800; - const uint16_t bank2 = 0x1000; - - for (INT32 count = 0x780; count < 0x800; count+=2) - { - bool enabled = (base_spriteram[count+bank2+1] & 2) == 0; - - if (enabled == false) - continue; - - UINT8 tile = base_spriteram[count]; - UINT8 color = base_spriteram[count+1]; - INT32 x = base_spriteram[count+bank1+1] + (base_spriteram[count+bank2+1] << 8); - x -= 71; - - INT32 y = 224 - (base_spriteram[count+bank1+0] + 7); - bool fx = (base_spriteram[count+bank2] & 1) == 1; - bool fy = (base_spriteram[count+bank2] & 2) == 2; - UINT8 width = ((base_spriteram[count+bank2] & 4) >> 2) + 1; - UINT8 height = ((base_spriteram[count+bank2] & 8) >> 3) + 1; - - if (height == 2) y -=16; - - for (INT32 yi = 0; yi < height; yi++) - { - for (INT32 xi = 0; xi < width; xi++) - { - UINT16 code = tile + (xi ^ ((width - 1) & fx)) + yi * 2; - - RenderTileTranstab(pTransDraw, DrvGfxROM1, code, (color << 2) + 0x200, 0xff, x + xi*16, y + yi *16, fx, fy, 16, 16, DrvColPROM + 0x300); // sprites starts at DrvColPROM + 0x200, but must deduct the color offset in this case. - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - GenericTilemapSetFlip(0, flipscreen); - - if (nBurnLayer & 1) draw_bg_layer(); - if (nBurnLayer & 2) GenericTilemapDraw(0, pTransDraw, 0); - if (nSpriteEnable & 1) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void master_scanline_callback(INT32 scanline) -{ - if (scanline == 224 && master_irq_enable) - M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if (scanline == 0) - { - if (!namcoio_read_reset_line(0)) - namcoio_run(0); - - if (!namcoio_read_reset_line(1)) - namcoio_run(1); - - if (!namcoio_read_reset_line(2)) - namcoio_run(2); - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6809NewFrame(); - SekNewFrame(); - - { - memset (DrvInputs, 0xff, 6); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy6[i] & 1) << i; - } - } - - INT32 nInterleave = 264; - INT32 nCyclesTotal[3] = { (6144000 / 4) / 60, 6144000 / 60, (6144000 / 4) / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = 0; - - M6809Open(0); - master_scanline_callback(i); - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - nSegment = M6809TotalCycles(); - M6809Close(); - - if (slave_in_reset) { - SekIdle((nSegment * 4) - SekTotalCycles()); - } else { - nCyclesDone[1] += SekRun(nCyclesTotal[1] / nInterleave); - if (i == 223 && slave_irq_enable) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - - if (sound_in_reset) { - nCyclesDone[2] += nSegment - nCyclesDone[2]; - } else { - M6809Open(1); - nCyclesDone[2] += M6809Run(nCyclesTotal[2] / nInterleave); - if (i == 223) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809Close(); - } - } - - SekClose(); - - if (pBurnSoundOut) { - NamcoSoundUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - SekScan(nAction); - NamcoSoundScan(nAction, pnMin); - - namcoio_scan(0); - namcoio_scan(1); - namcoio_scan(2); - - SCAN_VAR(slave_in_reset); - SCAN_VAR(sound_in_reset); - SCAN_VAR(palette_bank); - SCAN_VAR(master_irq_enable); - SCAN_VAR(slave_irq_enable); - SCAN_VAR(flipscreen); - } - - return 0; -} - - -// Libble Rabble - -static struct BurnRomInfo liblrablRomDesc[] = { - { "5b.rom", 0x4000, 0xda7a93c2, 1 | BRF_GRA }, // 0 M6809 Code (master) - { "5c.rom", 0x4000, 0x6cae25dc, 1 | BRF_GRA }, // 1 - - { "2c.rom", 0x2000, 0x7c09e50a, 2 | BRF_GRA }, // 2 M6809 Code (sound) - - { "8c.rom", 0x4000, 0xa00cd959, 3 | BRF_GRA }, // 3 M68000 Code (slave) - { "10c.rom", 0x4000, 0x09ce209b, 3 | BRF_GRA }, // 4 - - { "5p.rom", 0x2000, 0x3b4937f0, 4 | BRF_GRA }, // 5 Foreground Tiles - - { "9t.rom", 0x4000, 0xa88e24ca, 5 | BRF_GRA }, // 6 Sprites - - { "lr1-3.1r", 0x0100, 0xf3ec0d07, 6 | BRF_GRA }, // 7 Color Data - { "lr1-2.1s", 0x0100, 0x2ae4f702, 6 | BRF_GRA }, // 8 - { "lr1-1.1t", 0x0100, 0x7601f208, 6 | BRF_GRA }, // 9 - { "lr1-5.5l", 0x0100, 0x940f5397, 6 | BRF_GRA }, // 10 - { "lr1-6.2p", 0x0200, 0xa6b7f850, 6 | BRF_GRA }, // 11 - - { "lr1-4.3d", 0x0100, 0x16a9166a, 7 | BRF_GRA }, // 12 Sound data -}; - -STD_ROM_PICK(liblrabl) -STD_ROM_FN(liblrabl) - -static INT32 LiblrablInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvLiblrabl = { - "liblrabl", NULL, NULL, NULL, "1983", - "Libble Rabble\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, liblrablRomInfo, liblrablRomName, NULL, NULL, LiblrablInputInfo, LiblrablDIPInfo, - LiblrablInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x320, - 288, 224, 4, 3 -}; - - -// Toypop - -static struct BurnRomInfo toypopRomDesc[] = { - { "tp1-2.5b", 0x4000, 0x87469620, 1 | BRF_GRA }, // 0 M6809 Code (master) - { "tp1-1.5c", 0x4000, 0xdee2fd6e, 1 | BRF_GRA }, // 1 - - { "tp1-3.2c", 0x2000, 0x5f3bf6e2, 2 | BRF_GRA }, // 2 M6809 Code (sound) - - { "tp1-4.8c", 0x4000, 0x76997db3, 3 | BRF_GRA }, // 3 M68000 Code (slave) - { "tp1-5.10c", 0x4000, 0x37de8786, 3 | BRF_GRA }, // 4 - - { "tp1-7.5p", 0x2000, 0x95076f9e, 4 | BRF_GRA }, // 5 Foreground Tiles - - { "tp1-6.9t", 0x4000, 0x481ffeaf, 5 | BRF_GRA }, // 6 Sprites - - { "tp1-3.1r", 0x0100, 0xcfce2fa5, 6 | BRF_GRA }, // 7 Color Data - { "tp1-2.1s", 0x0100, 0xaeaf039d, 6 | BRF_GRA }, // 8 - { "tp1-1.1t", 0x0100, 0x08e7cde3, 6 | BRF_GRA }, // 9 - { "tp1-4.5l", 0x0100, 0x74138973, 6 | BRF_GRA }, // 10 - { "tp1-5.2p", 0x0200, 0x4d77fa5a, 6 | BRF_GRA }, // 11 - - { "tp1-6.3d", 0x0100, 0x16a9166a, 7 | BRF_GRA }, // 12 Sound data -}; - -STD_ROM_PICK(toypop) -STD_ROM_FN(toypop) - -static INT32 ToypopInit() -{ - return DrvInit(0x800); -} - -struct BurnDriver BurnDrvToypop = { - "toypop", NULL, NULL, NULL, "1986", - "Toypop\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PUZZLE, 0, - NULL, toypopRomInfo, toypopRomName, NULL, NULL, ToypopInputInfo, ToypopDIPInfo, - ToypopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x320, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_travrusa.cpp b/jan/src/burn/drv/pre90s/d_travrusa.cpp deleted file mode 100644 index a6eaba2cd..000000000 --- a/jan/src/burn/drv/pre90s/d_travrusa.cpp +++ /dev/null @@ -1,1103 +0,0 @@ -// FB Alpha Traverse USA driver module -// Based on MAME driver by Lee Taylor (with thanks to John Clegg and Tomasz Slanina) - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6800_intf.h" -#include "msm5205.h" -#include "driver.h" -#include "bitswap.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvTransTable[2]; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *M62M6803Ram; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 m6803_port1; -static UINT8 m6803_port2; -static UINT8 flipscreen; -static UINT8 soundlatch; -static UINT16 scrollx; - -static UINT32 YFlipping = 0; // shtrider has a weird screen layout - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static struct BurnInputInfo TravrusaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 7, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 3, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 4, "dip" }, -}; - -STDINPUTINFO(Travrusa) - -static struct BurnInputInfo ShtriderInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInputs + 3, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInputs + 4, "dip" }, -}; - -STDINPUTINFO(Shtrider) - -static struct BurnDIPInfo TravrusaDIPList[]= -{ - {0x0d, 0xff, 0xff, 0xf7, NULL }, - {0x0e, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 4, "Fuel Reduced on Collision" }, - {0x0d, 0x01, 0x03, 0x03, "Low" }, - {0x0d, 0x01, 0x03, 0x02, "Med" }, - {0x0d, 0x01, 0x03, 0x01, "Hi" }, - {0x0d, 0x01, 0x03, 0x00, "Max" }, - - {0 , 0xfe, 0 , 2, "Fuel Consumption" }, - {0x0d, 0x01, 0x04, 0x04, "Low" }, - {0x0d, 0x01, 0x04, 0x00, "Hi" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0d, 0x01, 0x08, 0x08, "No" }, - {0x0d, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 32, "Coinage" }, - {0x0d, 0x01, 0xf0, 0x80, "Not Used" }, - {0x0d, 0x01, 0xf0, 0x90, "Not Used" }, - {0x0d, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x0d, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x0d, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x0d, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x0d, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0xf0, 0x60, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0xf0, 0x50, "1 Coin 4 Credits" }, - {0x0d, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x0d, 0x01, 0xf0, 0x30, "1 Coin 6 Credits" }, - {0x0d, 0x01, 0xf0, 0x20, "1 Coin 7 Credits" }, - {0x0d, 0x01, 0xf0, 0x10, "Not Used" }, - {0x0d, 0x01, 0xf0, 0x00, "Free Play" }, - {0x0d, 0x01, 0xf0, 0x80, "Free Play" }, - {0x0d, 0x01, 0xf0, 0x90, "A 3C 1C / B 1C 3C" }, - {0x0d, 0x01, 0xf0, 0xa0, "A 2C 1C / B 1C 3C" }, - {0x0d, 0x01, 0xf0, 0xb0, "A 1C 1C / B 1C 3C" }, - {0x0d, 0x01, 0xf0, 0xc0, "Free Play" }, - {0x0d, 0x01, 0xf0, 0xd0, "A 3C 1C / B 1C 2C" }, - {0x0d, 0x01, 0xf0, 0xe0, "A 2C 1C / B 1C 2C" }, - {0x0d, 0x01, 0xf0, 0xf0, "A 1C 1C / B 1C 2C" }, - {0x0d, 0x01, 0xf0, 0x70, "A 1C 1C / B 1C 5C" }, - {0x0d, 0x01, 0xf0, 0x60, "A 2C 1C / B 1C 5C" }, - {0x0d, 0x01, 0xf0, 0x50, "A 3C 1C / B 1C 5C" }, - {0x0d, 0x01, 0xf0, 0x40, "Free Play" }, - {0x0d, 0x01, 0xf0, 0x30, "A 1C 1C / B 1C 6C" }, - {0x0d, 0x01, 0xf0, 0x20, "A 2C 1C / B 1C 6C" }, - {0x0d, 0x01, 0xf0, 0x10, "A 3C 1C / B 1C 6C" }, - {0x0d, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0e, 0x01, 0x01, 0x01, "Off" }, - {0x0e, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x02, 0x00, "Upright" }, - {0x0e, 0x01, 0x02, 0x02, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x0e, 0x01, 0x04, 0x04, "Mode 1" }, - {0x0e, 0x01, 0x04, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 2, "Speed Type" }, - {0x0e, 0x01, 0x08, 0x08, "M/H" }, - {0x0e, 0x01, 0x08, 0x00, "Km/H" }, - - {0 , 0xfe, 0 , 2, "Stop Mode (Cheat)" }, - {0x0e, 0x01, 0x10, 0x10, "Off" }, - {0x0e, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Title" }, - {0x0e, 0x01, 0x20, 0x20, "Traverse USA" }, - {0x0e, 0x01, 0x20, 0x00, "Zippy Race" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x0e, 0x01, 0x40, 0x40, "Off" }, - {0x0e, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Travrusa) - -static struct BurnDIPInfo ShtriderDIPList[]= -{ - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0d, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x0d, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x0d, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x0d, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0d, 0x01, 0x18, 0x00, "3 Coins 1 Credits" }, - {0x0d, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x18, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0e, 0x01, 0x01, 0x01, "Off" }, - {0x0e, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Speed Display" }, - {0x0e, 0x01, 0x02, 0x02, "km/h" }, - {0x0e, 0x01, 0x02, 0x00, "mph" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x08, 0x08, "Upright" }, - {0x0e, 0x01, 0x08, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Shtrider) - -static void __fastcall travrusa_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - scrollx = (scrollx & 0x0100) | data; - return; - - case 0xa000: - scrollx = (scrollx & 0x00ff) | ((data << 8) & 0x100); - return; - - case 0xd000: - { - if (data & 0x80) { - M6803SetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - soundlatch = data & 0x7f; - } - } - return; - - case 0xd001: - flipscreen = (data & 1) ^ ((DrvInputs[4] & 1) ^ 1); - return; - } -} - -static UINT8 __fastcall travrusa_main_read(UINT16 address) -{ - switch (address) - { - case 0xd000: - case 0xd001: - case 0xd002: - case 0xd003: - case 0xd004: - return DrvInputs[address & 7]; - } - - return 0; -} - -static UINT8 __fastcall travrusa_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x11: - return 0x88; // shtriderb - } - - return 0; -} - -static UINT8 m6803_read(UINT16 address) -{ - address &= 0x7fff; - - if (address < 0x20) { - return m6803_internal_registers_r(address); - } - - if (address >= 0x0080 && address <= 0x00ff) { - return M62M6803Ram[address & 0x7f]; - } - - if (address >= 0x7000 && address <= 0x7fff) { - return DrvSndROM[address - 0x7000]; - } - - return 0; -} - -static void m6803_write(UINT16 address, UINT8 data) -{ - address &= 0x7fff; - - if (address < 0x20) { - m6803_internal_registers_w(address, data); - return; - } - - if (address >= 0x0080 && address <= 0x00ff) { - M62M6803Ram[address & 0x7f] = data; - return; - } - - if (address < 0x80) return; - - if ((address & 0x7001) == 0x0001) { - MSM5205DataWrite(0, data); - return; - } - - if ((address & 0x7000) == 0x1000) { - M6803SetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static void m6803_write_port(UINT16 port, UINT8 data) -{ - switch (port) - { - case M6803_PORT1: - m6803_port1 = data; - return; - - case M6803_PORT2: - { - if ((m6803_port2 & 0x01) && !(data & 0x01)) - { - if (m6803_port2 & 0x04) - { - if (m6803_port2 & 0x08) - AY8910Write(0, 0, m6803_port1); - - if (m6803_port2 & 0x10) - AY8910Write(1, 0, m6803_port1); - } - else - { - if (m6803_port2 & 0x08) - AY8910Write(0, 1, m6803_port1); - - if (m6803_port2 & 0x10) - AY8910Write(1, 1, m6803_port1); - } - } - - m6803_port2 = data; - } - return; - } -} - -static UINT8 m6803_read_port(UINT16 port) -{ - switch (port) - { - case M6803_PORT1: - if (m6803_port2 & 0x08) - return AY8910Read(0); - - if (m6803_port2 & 0x10) - return AY8910Read(1); - return 0xff; - - case M6803_PORT2: - return 0; - } - - return 0; -} - -static UINT8 ay8910_0_read_A(UINT32) -{ - return soundlatch; -} - -static void ay8910_0_write_B(UINT32, UINT32 data) -{ - MSM5205PlaymodeWrite(0, (data >> 2) & 7); - MSM5205ResetWrite(0, data & 1); -} - -static void ay8910_1_write_B(UINT32, UINT32 /*data*/) -{ -// if (m_audio_BD) m_audio_BD->write_line(data & 0x01 ? 1: 0); -// if (m_audio_SD) m_audio_SD->write_line(data & 0x02 ? 1: 0); -// if (m_audio_OH) m_audio_OH->write_line(data & 0x04 ? 1: 0); -// if (m_audio_CH) m_audio_CH->write_line(data & 0x08 ? 1: 0); -} - -static void adpcm_int() -{ - M6803SetIRQLine(M6800_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO); // adpcm interrupt -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(double)M6800TotalCycles() * nSoundRate / 3579545; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - -// M6803Open(0); - M6803Reset(); -// M6803Close(); - - AY8910Reset(0); - AY8910Reset(1); - MSM5205Reset(); - - m6803_port1 = 0; - m6803_port2 = 0; - flipscreen = 0; - soundlatch = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x008000; - DrvSndROM = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvTransTable[0] = Next; Next += 0x000100; - DrvTransTable[1] = Next; Next += 0x000080; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - DrvColPROM = Next; Next += 0x000400; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x001000; - M62M6803Ram = Next; Next += 0x000100; - DrvVidRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000200; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(INT32 type) -{ - INT32 Plane[3] = { (0x2000*2*8), (0x2000*1*8), (0x2000*0*8) }; - INT32 XOffs0[16] = { STEP8(0,1), STEP8(16*8,1) }; - INT32 YOffs0[16] = { STEP16(0,8) }; - INT32 XOffs1[16] = { STEP8(0,1), STEP8(8*8,1) }; - INT32 YOffs1[16] = { STEP8(0,8), STEP8(16*8,8) }; - - INT32 *Xptr = (type) ? XOffs1 : XOffs0; - INT32 *Yptr = (type) ? YOffs1 : YOffs0; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x6000); - - GfxDecode(0x0400, 3, 8, 8, Plane, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x6000); - - GfxDecode(0x0100, 3, 16, 16, Plane, Xptr, Yptr, 0x100, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static void shtrider_palette_decode() -{ - for (INT32 i = 0; i < 0x80; i++) { - DrvColPROM[i] <<= 4; - DrvColPROM[i] |= DrvColPROM[i+0x100]; - } -} - -static void motoraceDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x2000); - - memcpy (tmp, DrvZ80ROM, 0x2000); - - for (INT32 A = 0; A < 0x2000; A++) - { - INT32 j = BITSWAP16(A,15,14,13,9,7,5,3,1,12,10,8,6,4,2,0,11); - DrvZ80ROM[j] = BITSWAP08(tmp[A],2,7,4,1,6,3,0,5); - } - - BurnFree(tmp); -} - -static void shtrideraDecode() -{ - for (INT32 A = 0; A < 0x2000; A++) - { - DrvZ80ROM[A] = BITSWAP08(DrvZ80ROM[A],7,5,6,3,4,2,1,0); - } -} - -static void build_transtables() -{ - for (INT32 i = 0; i < 0x80; i++) { - DrvTransTable[0][i] = 1; // opaque - DrvTransTable[1][i] = (0xc0 >> (i & 7)) & 1; - DrvTransTable[0][i+0x80] = DrvColPROM[0x80+(DrvColPROM[0x200+i]&0xf)] ? 1 : 0; - } -} - -static tilemap_callback( layer0 ) -{ - INT32 attr = DrvVidRAM[offs * 2 + 1]; - INT32 code = DrvVidRAM[offs * 2 + 0] | ((attr << 2) & 0x300); - - INT32 color = attr & 0xf; - - TILE_SET_INFO(0, code, color, TILE_FLIPXY((attr & 0x30) >> 4)); -} - -static tilemap_callback( layer1 ) -{ - INT32 attr = DrvVidRAM[offs * 2 + 1]; - INT32 code = DrvVidRAM[offs * 2 + 0] | ((attr << 2) & 0x300); - - INT32 color = attr & 0xf; - - INT32 flags = TILE_FLIPXY((attr & 0x30) >> 4); - if (color == 0xf) flags |= TILE_GROUP(1); - - TILE_SET_INFO(0, code, color, flags); -} - - -static INT32 DrvInit(void (*pRomCallback)(), INT32 sndromsmall, INT32 gfxtype) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000, 4, 1)) return 1; - if (sndromsmall) memcpy (DrvSndROM + 0x1000, DrvSndROM + 0x0000, 0x1000); - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 11, 1)) return 1; - - if (gfxtype) { - if (BurnLoadRom(DrvColPROM + 0x0100, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0080, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 14, 1)) return 1; - - shtrider_palette_decode(); - } else { - if (BurnLoadRom(DrvColPROM + 0x0080, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 13, 1)) return 1; - } - - if (pRomCallback) { - pRomCallback(); - } - - DrvGfxDecode(gfxtype); - build_transtables(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0x8000, 0x8fff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xc800, 0xc9ff, MAP_WRITE); - ZetMapMemory(DrvZ80RAM, 0xe000, 0xefff, MAP_RAM); - ZetSetWriteHandler(travrusa_main_write); - ZetSetReadHandler(travrusa_main_read); - ZetSetInHandler(travrusa_main_read_port); - ZetClose(); - - M6803Init(1); -// M6803Open(0); - M6803MapMemory(DrvSndROM, 0x6000, 0x7fff, MAP_ROM); - M6803MapMemory(DrvSndROM, 0xe000, 0xffff, MAP_ROM); - M6803SetWriteHandler(m6803_write); - M6803SetReadHandler(m6803_read); - M6803SetWritePortHandler(m6803_write_port); - M6803SetReadPortHandler(m6803_read_port); -// M6803Close(); - - MSM5205Init(0, DrvSynchroniseStream, 384000, adpcm_int, MSM5205_S96_4B, 1); - MSM5205SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 3579545/4, nBurnSoundRate, &ay8910_0_read_A, NULL, NULL, &ay8910_0_write_B); - AY8910Init(1, 3579545/4, nBurnSoundRate, NULL, NULL, NULL, &ay8910_1_write_B); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, layer0_map_callback, 8, 8, 64, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, layer1_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 3, 8, 8, 0x10000, 0, 0xf); - GenericTilemapSetGfx(1, DrvGfxROM0, 3, 8, 8, 0x10000, 0, 0xf); // this needed? -dink - GenericTilemapSetScrollRows(0, 4); - GenericTilemapSetScrollRows(1, 4); - GenericTilemapSetTransMask(1, 0x3f); - GenericTilemapSetScrollRow(0, 3, 0); - GenericTilemapSetScrollRow(1, 3, 0); - GenericTilemapSetOffsets(0, -8, 0); - GenericTilemapSetOffsets(1, -8, 0); - if (YFlipping) GenericTilemapSetFlip(TMAP_GLOBAL, TMAP_FLIPY); - DrvDoReset(); - - return 0; -} - -static INT32 travrusaInit() { return DrvInit(NULL, 1, 0); } -static INT32 motoraceInit() { return DrvInit(motoraceDecode, 1, 0); } -static INT32 shtriderInit() { YFlipping = 1; return DrvInit(NULL, 0, 1); } -static INT32 shtrideraInit() { YFlipping = 1; return DrvInit(shtrideraDecode, 0, 1); } -static INT32 shtriderbInit() { YFlipping = 1; return DrvInit(NULL, 0, 0); } - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - M6803Exit(); - - AY8910Exit(0); - AY8910Exit(1); - MSM5205Exit(); - - BurnFree(AllMem); - - YFlipping = 0; - - return 0; -} - -static void DrvPaletteInit() -{ - UINT32 tmp[0x10]; - UINT8 *color_prom = DrvColPROM; - - for (INT32 i = 0; i < 0x90; i++) - { - INT32 bit0 = 0; - INT32 bit1 = (color_prom[i] >> 6) & 0x01; - INT32 bit2 = (color_prom[i] >> 7) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (color_prom[i] >> 3) & 0x01; - bit1 = (color_prom[i] >> 4) & 0x01; - bit2 = (color_prom[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - if (i < 0x80) - DrvPalette[i] = BurnHighCol(r,g,b,0); - else - tmp[i-0x80] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0x80; i < 0x100; i++) - { - DrvPalette[i] = tmp[DrvColPROM[i + 0x180] & 0x0f]; - } -} - -static void draw_sprites() -{ - if (YFlipping) { - GenericTilesSetClip(0,240,64,256); // shtrider - } else { - GenericTilesSetClip(0,240,0,192); // everything else - } - - for (INT32 offs = 0x200 - 4; offs >= 0; offs -= 4) - { - int sx = ((DrvSprRAM[offs + 3] + 8) & 0xff) - 16; - int sy = 240 - DrvSprRAM[offs]; - int code = DrvSprRAM[offs + 2]; - int attr = DrvSprRAM[offs + 1]; - int flipx = attr & 0x40; - int flipy = attr & 0x80; - int color = attr & 0x0f; - - if (YFlipping) { - sy = 240 - sy; - flipy = !flipy; - } - - RenderTileTranstab(pTransDraw, DrvGfxROM1, code, (color<<3)+0x80, 0, sx, sy, flipx, flipy, 16, 16, DrvTransTable[0]); - } - - GenericTilesClearClip(); -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - for (INT32 i = 0; i < 3; i++) { - GenericTilemapSetScrollRow(0, i, scrollx); - GenericTilemapSetScrollRow(1, i, scrollx); - } - - if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, TMAP_FORCEOPAQUE); - - if (nSpriteEnable & 1) draw_sprites(); - - if (nBurnLayer & 2) GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(1)); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6803NewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); // dips 3,4! - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = MSM5205CalcInterleave(0, 3579545); - INT32 nCyclesTotal[2] = { 4000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); -// M6803Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - - nCyclesDone[1] += M6803Run(nCyclesTotal[1] / nInterleave); - MSM5205Update(); // adpcm update samples - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); -// M6803Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - M6800Scan(nAction); - - AY8910Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - - SCAN_VAR(m6803_port1); - SCAN_VAR(m6803_port2); - SCAN_VAR(flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(scrollx); - } - - return 0; -} - - -// Traverse USA / Zippy Race - -static struct BurnRomInfo travrusaRomDesc[] = { - { "zr1-0.m3", 0x2000, 0xbe066c0a, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "zr1-5.l3", 0x2000, 0x145d6b34, 1 | BRF_PRG | BRF_ESS }, // 1 - { "zr1-6a.k3", 0x2000, 0xe1b51383, 1 | BRF_PRG | BRF_ESS }, // 2 - { "zr1-7.j3", 0x2000, 0x85cd1a51, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mr10.1a", 0x1000, 0xa02ad8a0, 2 | BRF_GRA }, // 4 M6803 Code - - { "zippyrac.001", 0x2000, 0xaa8994dd, 3 | BRF_GRA }, // 5 Background tiles - { "mr8.3c", 0x2000, 0x3a046dd1, 3 | BRF_GRA }, // 6 - { "mr9.3a", 0x2000, 0x1cc3d3f4, 3 | BRF_GRA }, // 7 - - { "zr1-8.n3", 0x2000, 0x3e2c7a6b, 4 | BRF_GRA }, // 8 Sprite tiles - { "zr1-9.l3", 0x2000, 0x13be6a14, 4 | BRF_GRA }, // 9 - { "zr1-10.k3", 0x2000, 0x6fcc9fdb, 4 | BRF_GRA }, // 10 - - { "mmi6349.ij", 0x0200, 0xc9724350, 5 | BRF_GRA }, // 11 Color data - { "tbp18s.2", 0x0020, 0xa1130007, 5 | BRF_GRA }, // 12 - { "tbp24s10.3", 0x0100, 0x76062638, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(travrusa) -STD_ROM_FN(travrusa) - -struct BurnDriver BurnDrvTravrusa = { - "travrusa", NULL, NULL, NULL, "1983", - "Traverse USA / Zippy Race\0", NULL, "Irem", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, travrusaRomInfo, travrusaRomName, NULL, NULL, TravrusaInputInfo, TravrusaDIPInfo, - travrusaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 240, 3, 4 -}; - - -// Traverse USA (bootleg) - -static struct BurnRomInfo travrusabRomDesc[] = { - { "at4.m3", 0x2000, 0x704ce6e4, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "at5.l3", 0x2000, 0x686cb0e6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "at6.k3", 0x2000, 0xbaf87d80, 1 | BRF_PRG | BRF_ESS }, // 2 - { "at7.h3", 0x2000, 0x48091ebe, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "11.a1", 0x1000, 0xd2c0bc33, 2 | BRF_GRA }, // 4 M6803 Code - - { "zippyrac.001", 0x2000, 0xaa8994dd, 3 | BRF_GRA }, // 5 Background tiles - { "mr8.3c", 0x2000, 0x3a046dd1, 3 | BRF_GRA }, // 6 - { "mr9.3a", 0x2000, 0x1cc3d3f4, 3 | BRF_GRA }, // 7 - - { "8.n3", 0x2000, 0x00c0f46b, 4 | BRF_GRA }, // 8 Sprite tiles - { "9.m3", 0x2000, 0x73ade73b, 4 | BRF_GRA }, // 9 - { "10.k3", 0x2000, 0xfcfeaa69, 4 | BRF_GRA }, // 10 - - { "mmi6349.ij", 0x0200, 0xc9724350, 5 | BRF_GRA }, // 11 Color data - { "tbp18s.2", 0x0020, 0xa1130007, 5 | BRF_GRA }, // 12 - { "tbp24s10.3", 0x0100, 0x76062638, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(travrusab) -STD_ROM_FN(travrusab) - -struct BurnDriver BurnDrvTravrusab = { - "travrusab", "travrusa", NULL, NULL, "1983", - "Traverse USA (bootleg)\0", NULL, "bootleg (I.P.)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, travrusabRomInfo, travrusabRomName, NULL, NULL, TravrusaInputInfo, TravrusaDIPInfo, - travrusaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 240, 3, 4 -}; - - -// MotoRace USA - -static struct BurnRomInfo motoraceRomDesc[] = { - { "mr.cpu", 0x2000, 0x89030b0c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "mr1.3l", 0x2000, 0x0904ed58, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mr2.3k", 0x2000, 0x8a2374ec, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mr3.3j", 0x2000, 0x2f04c341, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "mr10.1a", 0x1000, 0xa02ad8a0, 2 | BRF_GRA }, // 4 M6803 Code - - { "mr7.3e", 0x2000, 0x492a60be, 3 | BRF_GRA }, // 5 Background tiles - { "mr8.3c", 0x2000, 0x3a046dd1, 3 | BRF_GRA }, // 6 - { "mr9.3a", 0x2000, 0x1cc3d3f4, 3 | BRF_GRA }, // 7 - - { "mr4.3n", 0x2000, 0x5cf1a0d6, 4 | BRF_GRA }, // 8 Sprite tiles - { "mr5.3m", 0x2000, 0xf75f2aad, 4 | BRF_GRA }, // 9 - { "mr6.3k", 0x2000, 0x518889a0, 4 | BRF_GRA }, // 10 - - { "mmi6349.ij", 0x0200, 0xc9724350, 5 | BRF_GRA }, // 11 Color data - { "tbp18s.2", 0x0020, 0xa1130007, 5 | BRF_GRA }, // 12 - { "tbp24s10.3", 0x0100, 0x76062638, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(motorace) -STD_ROM_FN(motorace) - -struct BurnDriver BurnDrvMotorace = { - "motorace", "travrusa", NULL, NULL, "1983", - "MotoRace USA\0", NULL, "Irem (Williams license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, motoraceRomInfo, motoraceRomName, NULL, NULL, TravrusaInputInfo, TravrusaDIPInfo, - motoraceInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 240, 3, 4 -}; - - -// MotoTour / Zippy Race (Tecfri license) - -static struct BurnRomInfo mototourRomDesc[] = { - { "mt1-4.m3", 0x2000, 0xfe643567, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "mt1-5.l3", 0x2000, 0x38d9d0f5, 1 | BRF_PRG | BRF_ESS }, // 1 - { "mt1-6.k3", 0x2000, 0xefd325f2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "mt1-7.j3", 0x2000, 0xab8a3a33, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "snd.a1", 0x1000, 0xa02ad8a0, 2 | BRF_GRA }, // 4 M6803 Code - - { "mt1-1.e3", 0x2000, 0xaa8994dd, 3 | BRF_GRA }, // 5 Background tiles - { "mt1-2.c3", 0x2000, 0x3a046dd1, 3 | BRF_GRA }, // 6 - { "mt1-3.a3", 0x2000, 0x1cc3d3f4, 3 | BRF_GRA }, // 7 - - { "mt1-8..n3", 0x2000, 0x600a57f5, 4 | BRF_GRA }, // 8 Sprite tiles - { "mt1-9..m3", 0x2000, 0x6f9f2a4e, 4 | BRF_GRA }, // 9 - { "mt1-10..k3", 0x2000, 0xd958def5, 4 | BRF_GRA }, // 10 - - { "mmi6349.k2", 0x0200, 0xc9724350, 5 | BRF_GRA }, // 11 Color data - { "prom1.f1", 0x0020, 0xa1130007, 5 | BRF_GRA }, // 12 - { "prom2.h2", 0x0100, 0x76062638, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(mototour) -STD_ROM_FN(mototour) - -struct BurnDriver BurnDrvMototour = { - "mototour", "travrusa", NULL, NULL, "1983", - "MotoTour / Zippy Race (Tecfri license)\0", NULL, "Irem (Tecfri license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, mototourRomInfo, mototourRomName, NULL, NULL, TravrusaInputInfo, TravrusaDIPInfo, - travrusaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 240, 3, 4 -}; - - -// Shot Rider - -static struct BurnRomInfo shtriderRomDesc[] = { - { "sr01a.bin", 0x2000, 0xde76d537, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "sr02a.bin", 0x2000, 0xcd1e1bfc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sr03a.bin", 0x2000, 0x3ade11b9, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sr04a.bin", 0x2000, 0x02b96eaa, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sr11a.bin", 0x2000, 0xa8396b76, 2 | BRF_GRA }, // 4 M6803 Code - - { "sr05a.bin", 0x2000, 0x34449f79, 3 | BRF_GRA }, // 5 Background tiles - { "sr06a.bin", 0x2000, 0xde43653d, 3 | BRF_GRA }, // 6 - { "sr07a.bin", 0x2000, 0x3445b81c, 3 | BRF_GRA }, // 7 - - { "sr08a.bin", 0x2000, 0x4072b096, 4 | BRF_GRA }, // 8 Sprite tiles - { "sr09a.bin", 0x2000, 0xfd4cc7e6, 4 | BRF_GRA }, // 9 - { "sr10b.bin", 0x2000, 0x0a117925, 4 | BRF_GRA }, // 10 - - { "1.bpr", 0x0100, 0xe9e258e5, 5 | BRF_GRA }, // 11 Color data - { "2.bpr", 0x0100, 0x6cf4591c, 5 | BRF_GRA }, // 12 - { "4.bpr", 0x0020, 0xee97c581, 5 | BRF_GRA }, // 13 - { "3.bpr", 0x0100, 0x5db47092, 5 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(shtrider) -STD_ROM_FN(shtrider) - -struct BurnDriver BurnDrvShtrider = { - "shtrider", NULL, NULL, NULL, "1985", - "Shot Rider\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, shtriderRomInfo, shtriderRomName, NULL, NULL, ShtriderInputInfo, ShtriderDIPInfo, - shtriderInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 240, 3, 4 -}; - - -// Shot Rider (Sigma license) - -static struct BurnRomInfo shtrideraRomDesc[] = { - { "1.bin", 0x2000, 0xeb51315c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "2.bin", 0x2000, 0x97675d19, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.bin", 0x2000, 0x78d051cd, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.bin", 0x2000, 0x02b96eaa, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "11.bin", 0x2000, 0xa8396b76, 2 | BRF_GRA }, // 4 M6803 Code - - { "5.bin", 0x2000, 0x34449f79, 3 | BRF_GRA }, // 5 Background tiles - { "6.bin", 0x2000, 0xde43653d, 3 | BRF_GRA }, // 6 - { "7.bin", 0x2000, 0x3445b81c, 3 | BRF_GRA }, // 7 - - { "8.bin", 0x2000, 0x4072b096, 4 | BRF_GRA }, // 8 Sprite tiles - { "9.bin", 0x2000, 0xfd4cc7e6, 4 | BRF_GRA }, // 9 - { "10.bin", 0x2000, 0x0a117925, 4 | BRF_GRA }, // 10 - - { "1.bpr", 0x0100, 0xe9e258e5, 5 | BRF_GRA }, // 11 Color data - { "2.bpr", 0x0100, 0x6cf4591c, 5 | BRF_GRA }, // 12 - { "4.bpr", 0x0020, 0xee97c581, 5 | BRF_GRA }, // 13 - { "3.bpr", 0x0100, 0x5db47092, 5 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(shtridera) -STD_ROM_FN(shtridera) - -struct BurnDriver BurnDrvShtridera = { - "shtridera", "shtrider", NULL, NULL, "1984", - "Shot Rider (Sigma license)\0", NULL, "Seibu Kaihatsu (Sigma license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, shtrideraRomInfo, shtrideraRomName, NULL, NULL, ShtriderInputInfo, ShtriderDIPInfo, - shtrideraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 240, 3, 4 -}; - - -// Shot Rider (bootleg) - -static struct BurnRomInfo shtriderbRomDesc[] = { - { "sr1.20.m3", 0x2000, 0x8bca38d7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "sr2.21.l3", 0x2000, 0x56d4a66a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sr3.22.k3", 0x2000, 0x44cab4cc, 1 | BRF_PRG | BRF_ESS }, // 2 - { "sr4.23.h3", 0x2000, 0x02b96eaa, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sr11.7.a1", 0x2000, 0xa8396b76, 2 | BRF_GRA }, // 4 M6803 Code - - { "sr5.f3", 0x2000, 0x34449f79, 3 | BRF_GRA }, // 5 Background tiles - { "sr6.c3", 0x2000, 0xde43653d, 3 | BRF_GRA }, // 6 - { "sr7.a3", 0x2000, 0x3445b81c, 3 | BRF_GRA }, // 7 - - { "sr8.17.n3", 0x2000, 0x4072b096, 4 | BRF_GRA }, // 8 Sprite tiles - { "sr9.18.m3", 0x2000, 0xfd4cc7e6, 4 | BRF_GRA }, // 9 - { "sr10.19.k3", 0x2000, 0x0a117925, 4 | BRF_GRA }, // 10 - - { "6349-2.k2", 0x0200, 0x854487a7, 5 | BRF_GRA }, // 11 Color data - { "prom1.6.f1", 0x0020, 0xee97c581, 5 | BRF_GRA }, // 12 - { "prom2.12.h2", 0x0100, 0x5db47092, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(shtriderb) -STD_ROM_FN(shtriderb) - -struct BurnDriver BurnDrvShtriderb = { - "shtriderb", "shtrider", NULL, NULL, "1985", - "Shot Rider (bootleg)\0", "Graphics issues", "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, shtriderbRomInfo, shtriderbRomName, NULL, NULL, ShtriderInputInfo, ShtriderDIPInfo, - shtriderbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 240, 3, 4 -}; - diff --git a/jan/src/burn/drv/pre90s/d_tsamurai.cpp b/jan/src/burn/drv/pre90s/d_tsamurai.cpp deleted file mode 100644 index 97adead65..000000000 --- a/jan/src/burn/drv/pre90s/d_tsamurai.cpp +++ /dev/null @@ -1,2034 +0,0 @@ -// FB Alpha Samurai Nihon-Ichi driver module -// Based on MAME driver by Phil Stroffolino - -// vsgongf - player is black (normal!) -// sound volumes seem a bit off (music should be quieter?) - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "dac.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvZ80ROM3; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvZ80RAM3; -static UINT8 *DrvFgVidRAM; -static UINT8 *DrvFgColRAM; -static UINT8 *DrvBgVidRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 flipscreen; -static UINT8 scrollx; -static UINT8 scrolly; -static UINT8 nmi_enable; -static UINT8 nmi_enable2; -static UINT8 soundlatch0; -static UINT8 soundlatch1; -static UINT8 soundlatch2; -static UINT8 back_color; -static UINT8 textbank0; -static UINT8 textbank1; - -static INT32 game_select = 0; -static UINT16 vsgongf_protval = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo TsamuraiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tsamurai) - -static struct BurnInputInfo YamagchiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Yamagchi) - -static struct BurnDIPInfo TsamuraiDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x05, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x38, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x02, "7" }, - {0x13, 0x01, 0x03, 0x03, "254 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Tsamurai) - -static struct BurnDIPInfo LadymstrDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x05, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x38, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x02, "7" }, - {0x13, 0x01, 0x03, 0x03, "254 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Ladymstr) - -static struct BurnDIPInfo NunchakuDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x05, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x38, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x02, "7" }, - {0x13, 0x01, 0x03, 0x03, "255 (Cheat)" }, -}; - -STDDIPINFO(Nunchaku) - -static struct BurnDIPInfo YamagchiDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x05, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x38, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x02, "7" }, - {0x13, 0x01, 0x03, 0x03, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x13, 0x01, 0x10, 0x10, "English" }, - {0x13, 0x01, 0x10, 0x00, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Yamagchi) - -static struct BurnDIPInfo M660DIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0xbc, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x04, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x20, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Continues" }, - {0x12, 0x01, 0x80, 0x00, "Off" }, - {0x12, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x02, "5" }, - {0x13, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Bonus" }, - {0x13, 0x01, 0x0c, 0x00, "10,30,50" }, - {0x13, 0x01, 0x0c, 0x04, "20,50,80" }, - {0x13, 0x01, 0x0c, 0x08, "30,70,110" }, - {0x13, 0x01, 0x0c, 0x0c, "50,100,150" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x00, "Easy" }, - {0x13, 0x01, 0x30, 0x10, "Normal" }, - {0x13, 0x01, 0x30, 0x20, "Hard" }, - {0x13, 0x01, 0x30, 0x30, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x40, 0x00, "Upright" }, - {0x13, 0x01, 0x40, 0x40, "Cocktail" }, -}; - -STDDIPINFO(M660) - -static struct BurnDIPInfo VsgongfDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x05, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x38, "6 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, - {0x12, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Vsgongf) - -static void __fastcall tsamurai_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf400: // nop - return; - - case 0xf401: - soundlatch0 = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0xf402: - soundlatch1 = data; - ZetClose(); - ZetOpen(2); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0xf801: - back_color = data; - return; - - case 0xf802: - scrolly = data; - return; - - case 0xf803: - scrollx = data; - return; - - case 0xfc00: - flipscreen = data ? 1 : 0; - return; - - case 0xfc01: - nmi_enable = data ? 1 : 0; - return; - - case 0xfc02: - textbank0 = data; - return; - - case 0xfc03: - case 0xfc04: - // coin_counter - return; - } -} - -static UINT8 __fastcall tsamurai_main_read(UINT16 address) -{ - switch (address) - { - case 0xa003: - return 0; - - case 0xa006: - return vsgongf_protval & 0xff; - - case 0xa100: - return vsgongf_protval >> 8; - - case 0xd803: - return 0x6b; - - case 0xd806: - return 0x40; - - case 0xd900: - return 0x6a; - - case 0xd938: - return 0xfb; - - case 0xf800: - case 0xf801: - case 0xf802: - return DrvInputs[address & 3]; - - case 0xf804: - case 0xf805: - return DrvDips[address & 1]; - } - - return 0; -} - -static void __fastcall m660_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf401: - soundlatch2 = data; - ZetClose(); - ZetOpen(3); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0xf402: - soundlatch1 = data; - ZetClose(); - ZetOpen(2); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0xf403: - soundlatch0 = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0xfc07: - textbank1 = data; - return; - } - - tsamurai_main_write(address, data); -} - -static UINT8 __fastcall m660_main_read(UINT16 address) -{ - switch (address) - { - case 0xd803: - return 0x53; - } - - return tsamurai_main_read(address); -} - -static void __fastcall vsgongf_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe800: - soundlatch0 = data; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - - case 0xec00: // nop - case 0xec01: - case 0xec02: - case 0xec03: - case 0xec04: - case 0xec05: - case 0xec06: - return; - - case 0xf000: - back_color = data; - return; - - case 0xf400: // nop - case 0xf800: - case 0xf801: - case 0xf803: - case 0xfc00: - return; - - case 0xfc01: - nmi_enable = data ? 1 : 0; - return; - - case 0xfc02: // coin counter - case 0xfc03: - return; - - case 0xfc04: - textbank0 = data; - return; - } -} - -static void __fastcall tsamurai_main_out_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - AY8910Write(0, port & 1, data); - return; - } -} - - -static void __fastcall m660_main_out_port(UINT16 port, UINT8 /*data*/) -{ - switch (port & 0xff) - { - case 0x00: // ? - case 0x01: // ? - case 0x02: // ? - return; - } -} - -static void __fastcall tsamurai_sound0_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x6001: // nop - case 0xc001: - return; - - case 0x6002: - case 0xc002: - DACWrite(0, data); - return; - } -} - -static UINT8 __fastcall tsamurai_sound0_read(UINT16 address) -{ - switch (address) - { - case 0x6000: - case 0xc000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch0; - } - - return 0; -} - -static void __fastcall tsamurai_sound1_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x6001: // nop - case 0xc001: - return; - - case 0x6002: - case 0xc002: - DACWrite(1, data); - return; - } -} - -static UINT8 __fastcall tsamurai_sound1_read(UINT16 address) -{ - switch (address) - { - case 0x6000: - case 0xc000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch1; - } - - return 0; -} - -static UINT8 __fastcall m660_sound2_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch2; - } - - return 0; -} - -static void __fastcall vsgongf_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8000: - nmi_enable2 = data ? 1 : 0; - return; - - case 0xa000: - DACWrite(0, data); - return; - } -} - -static UINT8 __fastcall vsgongf_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8000: - return soundlatch0; - } - - return 0; -} - -static INT32 DrvSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3000000.000 / 60))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - if (game_select == 1 || game_select == 2) { - ZetOpen(2); - ZetReset(); - ZetClose(); - } - - if (game_select == 2) { - ZetOpen(3); - ZetReset(); - ZetClose(); - } - - AY8910Reset(0); - DACReset(); - - flipscreen = 0; - scrollx = 0; - scrolly = 0; - nmi_enable = 0; - nmi_enable2 = 0; - soundlatch0 = 0; - soundlatch1 = 0; - soundlatch2 = 0; - back_color = 0; - textbank0 = 0; - textbank1 = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x00c000; - DrvZ80ROM1 = Next; Next += 0x004000; - DrvZ80ROM2 = Next; Next += 0x004000; - DrvZ80ROM3 = Next; Next += 0x004000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(INT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvZ80RAM2 = Next; Next += 0x000800; - DrvZ80RAM3 = Next; Next += 0x000800; - DrvFgVidRAM = Next; Next += 0x000400; - DrvFgColRAM = Next; Next += 0x000400; - DrvBgVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000400; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x100] >> 3) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 2*0x100] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 2*0x100] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 2*0x100] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 2*0x100] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvGfxDecode(INT32 nLen0, INT32 nLen1, INT32 nLen2) -{ - INT32 Plane0[3] = { (nLen0/3)*8*2, (nLen0/3)*8*1, (nLen0/3)*8*0 }; - INT32 Plane1[3] = { (nLen1/3)*8*2, (nLen1/3)*8*1, (nLen1/3)*8*0 }; - INT32 Plane2[3] = { (nLen2/3)*8*2, (nLen2/3)*8*1, (nLen2/3)*8*0 }; - INT32 XOffs[32] = { STEP8(0,1), STEP8(64, 1), STEP8(128,1), STEP8(192,1) }; - INT32 YOffs[32] = { STEP8(0,8), STEP8(256,8), STEP8(512,8), STEP8(768,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, nLen0); - - GfxDecode(((nLen0/3)*8)/0x040, 3, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - if (nLen0 == 0x6000) memcpy (DrvGfxROM0 + 0x10000, DrvGfxROM0, 0x10000); // mirror - - memcpy (tmp, DrvGfxROM1, nLen1); - - GfxDecode(((nLen1/3)*8)/0x040, 3, 8, 8, Plane1, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - if (nLen1 == 0x3000) memcpy (DrvGfxROM1 + 0x08000, DrvGfxROM1, 0x08000); // mirror - - memcpy (tmp, DrvGfxROM2, nLen2); - - GfxDecode(((nLen2/3)*8)/0x400, 3, 32, 32, Plane2, XOffs, YOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(INT32 game) -{ - game_select = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (game == 0) { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x01000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 14, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 17, 1)) return 1; - } - else if (game == 1) - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM2 + 0x02000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x01000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 15, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 18, 1)) return 1; - } - else if (game == 2) - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x01000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 13, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 16, 1)) return 1; - } - - DrvGfxDecode(0x6000, 0x3000, 0xc000); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvFgVidRAM, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvFgColRAM, 0xe400, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvBgVidRAM, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xf000, 0xf3ff, MAP_RAM); - ZetSetWriteHandler(tsamurai_main_write); - ZetSetReadHandler(tsamurai_main_read); - ZetSetOutHandler(tsamurai_main_out_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x7f00, 0x7fff, MAP_RAM); - ZetSetWriteHandler(tsamurai_sound0_write); - ZetSetReadHandler(tsamurai_sound0_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0x7f00, 0x7fff, MAP_RAM); - ZetSetWriteHandler(tsamurai_sound1_write); - ZetSetReadHandler(tsamurai_sound1_read); - ZetClose(); - - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 0, DrvSyncDAC); - DACInit(1, 1, 0, DrvSyncDAC); - DACSetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - DACSetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 m660CommonInit(INT32 game) -{ - game_select = 2; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (game == 0) - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM3 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 14, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 17, 1)) return 1; - } else { // m660j - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM3 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM3 + 0x04000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 15, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 18, 1)) return 1; - } - - DrvGfxDecode(0xc000, 0x6000, 0xc000); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvFgVidRAM, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvFgColRAM, 0xe400, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvBgVidRAM, 0xe800, 0xefff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xf000, 0xf3ff, MAP_RAM); - ZetSetWriteHandler(m660_main_write); - ZetSetReadHandler(m660_main_read); - ZetSetOutHandler(m660_main_out_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(tsamurai_sound0_write); - ZetSetReadHandler(tsamurai_sound0_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0x8000, 0x87ff, MAP_RAM); - ZetSetWriteHandler(tsamurai_sound1_write); - ZetSetReadHandler(tsamurai_sound1_read); - ZetClose(); - - ZetInit(3); - ZetOpen(3); - ZetMapMemory(DrvZ80ROM3, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM3, 0x8000, 0x87ff, MAP_RAM); -// ZetSetWriteHandler(m660_sound2_write); // nothing useful written... - ZetSetReadHandler(m660_sound2_read); - ZetSetOutHandler(tsamurai_main_out_port); // re-use this since it's the same - ZetClose(); - - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 0, DrvSyncDAC); - DACSetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - - DACInit(1, 1, 0, DrvSyncDAC); - DACSetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 VsgongfCommonInit(INT32 game) -{ - game_select = 3; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (game == 0) - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x01000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 14, 1)) return 1; - } else { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x01000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 12, 1)) return 1; - } - - DrvGfxDecode(0x0300, 0x3000, 0x6000); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvFgVidRAM, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xe400, 0xe4ff, MAP_RAM); - ZetSetWriteHandler(vsgongf_main_write); - ZetSetReadHandler(tsamurai_main_read); // mostly the same - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x6000, 0x63ff, MAP_RAM); - ZetSetWriteHandler(vsgongf_sound_write); - ZetSetReadHandler(vsgongf_sound_read); - ZetSetOutHandler(tsamurai_main_out_port); // re-use this since it's the same - ZetClose(); - - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 0, DrvSyncDAC); - DACSetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - DACExit(); - AY8910Exit(0); - - ZetExit(); - - BurnFree(AllMem); - - return 0; -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sx -= scrollx; - if (sx < -7) sx += 256; - sy -= (scrolly + 16) & 0xff; - if (sy < -7) sy += 256; - - INT32 attr = DrvBgVidRAM[offs * 2 + 1]; - INT32 code = DrvBgVidRAM[offs * 2 + 0] + ((attr & 0xc0) << 2) + ((attr & 0x20) << 5); - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, attr & 0x1f, 3, 0, DrvGfxROM0); - } -} - -static void draw_bg_layer_type2() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 code = DrvFgVidRAM[offs] + (textbank0 ? 0x100 : 0); - - Render8x8Tile_Clip(pTransDraw, code, sx, sy - 16, back_color & 0x1f, 3, 0, DrvGfxROM1); - } -} - -static void draw_fg_layer() -{ - INT32 bank = ((textbank0 & 1) * 0x100) + ((textbank1 & 1) * 0x200); - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sy -= (DrvFgColRAM[((offs&0x1f)*2)+0] + 16) & 0xff; - if (sy < -7) sy += 256; - - INT32 code = DrvFgVidRAM[offs] + bank; - INT32 color = DrvFgColRAM[((offs&0x1f)*2)+1] & 0x1f; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - - } -} - -static void draw_sprites() -{; - UINT8 *source = DrvSprRAM + 31*4; - UINT8 *finish = DrvSprRAM; - - while (source >= finish) - { - INT32 sx = source[3] - 16; - INT32 sy = 240 - source[0]; - INT32 code = source[1]; - INT32 color = source[2] & 0x1f; - - if (sy<-16) sy += 256; - - INT32 flipy = code & 0x80; - - if (flipscreen) - { - flipy ^= 0x80; - sx = 256-32-sx; - sy = 256-32-sy; - } - - if (flipy) { - if (flipscreen) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code & 0x7f, sx, sy - 16, color, 3, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code & 0x7f, sx, sy - 16, color, 3, 0, 0, DrvGfxROM2); - } - } else { - if (flipscreen) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code & 0x7f, sx, sy - 16, color, 3, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code & 0x7f, sx, sy - 16, color, 3, 0, 0, DrvGfxROM2); - } - } - - source -= 4; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (game_select == 3) - { - draw_bg_layer_type2(); - draw_sprites(); - } - else - { - for (INT32 i = 0; i < 0x100; i+=8) { - DrvPalette[i] = DrvPalette[back_color]; - } - - draw_bg_layer(); - draw_sprites(); - draw_fg_layer(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - ZetNewFrame(); - - INT32 nInterleave = 100; - INT32 nCyclesTotal[4] = { 3000000 / 60, 3000000 / 60, 3000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[4] = { 0, 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 10) && nmi_enable) ZetNmi(); - ZetClose(); - - nSegment = nCyclesTotal[1] / nInterleave; - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment); - if (game_select == 3 && nmi_enable2 && (i == 33 || i == 66 || i == 99)) ZetNmi(); - ZetClose(); - - if (game_select == 1 || game_select == 2) { - nSegment = nCyclesTotal[2] / nInterleave; - - ZetOpen(2); - nCyclesDone[2] += ZetRun(nSegment); - ZetClose(); - } - - if (game_select == 2) { - nSegment = nCyclesTotal[3] / nInterleave; - - ZetOpen(3); - nCyclesDone[3] += ZetRun(nSegment); - if (i == (nInterleave - 10)) ZetNmi(); - ZetClose(); - } - } - - if (pBurnSoundOut) { - DACUpdate(pBurnSoundOut, nBurnSoundLen); - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(flipscreen); - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - SCAN_VAR(nmi_enable); - SCAN_VAR(nmi_enable2); - SCAN_VAR(soundlatch0); - SCAN_VAR(soundlatch1); - SCAN_VAR(soundlatch2); - SCAN_VAR(back_color); - SCAN_VAR(textbank0); - SCAN_VAR(textbank1); - } - - return 0; -} - - -// Samurai Nihon-Ichi (set 1) - -static struct BurnRomInfo tsamuraiRomDesc[] = { - { "01.3r", 0x4000, 0xd09c8609, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "02.3t", 0x4000, 0xd0f2221c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "03.3v", 0x4000, 0xeee8b0c9, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "14.4e", 0x2000, 0x220e9c04, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "a35-15.4c", 0x2000, 0x1e0d1e33, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "13.4j", 0x2000, 0x73feb0e2, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 #2 Code - - { "a35-04.10a", 0x2000, 0xb97ce9b1, 4 | BRF_GRA }, // 6 Background Tiles - { "a35-05.10b", 0x2000, 0x55a17b08, 4 | BRF_GRA }, // 7 - { "a35-06.10d", 0x2000, 0xf5ee6f8f, 4 | BRF_GRA }, // 8 - - { "a35-10.11n", 0x1000, 0x0b5a0c45, 5 | BRF_GRA }, // 9 Foreground Tiles - { "a35-11.11q", 0x1000, 0x93346d75, 5 | BRF_GRA }, // 10 - { "a35-12.11r", 0x1000, 0xf4c69d8a, 5 | BRF_GRA }, // 11 - - { "a35-07.12h", 0x4000, 0x38fc349f, 6 | BRF_GRA }, // 12 Sprites - { "a35-08.12j", 0x4000, 0xa07d6dc3, 6 | BRF_GRA }, // 13 - { "a35-09.12k", 0x4000, 0xc0784a0e, 6 | BRF_GRA }, // 14 - - { "a35-16.2j", 0x0100, 0x72d8b332, 7 | BRF_GRA }, // 15 Color Proms - { "a35-17.2l", 0x0100, 0x9bf1829e, 7 | BRF_GRA }, // 16 - { "a35-18.2m", 0x0100, 0x918e4732, 7 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(tsamurai) -STD_ROM_FN(tsamurai) - -static INT32 tsamuraiInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvTsamurai = { - "tsamurai", NULL, NULL, NULL, "1985", - "Samurai Nihon-Ichi (set 1)\0", NULL, "Kaneko / Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, tsamuraiRomInfo, tsamuraiRomName, NULL, NULL, TsamuraiInputInfo, TsamuraiDIPInfo, - tsamuraiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Samurai Nihon-Ichi (set 2) - -static struct BurnRomInfo tsamurai2RomDesc[] = { - { "a35-01.3r", 0x4000, 0x282d96ad, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a35-02.3t", 0x4000, 0xe3fa0cfa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a35-03.3v", 0x4000, 0x2fff1e0a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a35-14.4e", 0x2000, 0xf10aee3b, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "a35-15.4c", 0x2000, 0x1e0d1e33, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "a35-13.4j", 0x2000, 0x3828f4d2, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 #2 Code - - { "a35-04.10a", 0x2000, 0xb97ce9b1, 4 | BRF_GRA }, // 6 Background Tiles - { "a35-05.10b", 0x2000, 0x55a17b08, 4 | BRF_GRA }, // 7 - { "a35-06.10d", 0x2000, 0xf5ee6f8f, 4 | BRF_GRA }, // 8 - - { "a35-10.11n", 0x1000, 0x0b5a0c45, 5 | BRF_GRA }, // 9 Foreground Tiles - { "a35-11.11q", 0x1000, 0x93346d75, 5 | BRF_GRA }, // 10 - { "a35-12.11r", 0x1000, 0xf4c69d8a, 5 | BRF_GRA }, // 11 - - { "a35-07.12h", 0x4000, 0x38fc349f, 6 | BRF_GRA }, // 12 Sprites - { "a35-08.12j", 0x4000, 0xa07d6dc3, 6 | BRF_GRA }, // 13 - { "a35-09.12k", 0x4000, 0xc0784a0e, 6 | BRF_GRA }, // 14 - - { "a35-16.2j", 0x0100, 0x72d8b332, 7 | BRF_GRA }, // 15 Color Proms - { "a35-17.2l", 0x0100, 0x9bf1829e, 7 | BRF_GRA }, // 16 - { "a35-18.2m", 0x0100, 0x918e4732, 7 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(tsamurai2) -STD_ROM_FN(tsamurai2) - -struct BurnDriver BurnDrvTsamurai2 = { - "tsamurai2", "tsamurai", NULL, NULL, "1985", - "Samurai Nihon-Ichi (set 2)\0", NULL, "Kaneko / Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, tsamurai2RomInfo, tsamurai2RomName, NULL, NULL, TsamuraiInputInfo, TsamuraiDIPInfo, - tsamuraiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Samurai Nihon-Ichi (bootleg, harder) - -static struct BurnRomInfo tsamuraihRomDesc[] = { - { "a35-01h.3r", 0x4000, 0x551e1fd1, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a35-02.3t", 0x4000, 0xe3fa0cfa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a35-03.3v", 0x4000, 0x2fff1e0a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a35-14.4e", 0x2000, 0xf10aee3b, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "a35-15.4c", 0x2000, 0x1e0d1e33, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "a35-13.4j", 0x2000, 0x3828f4d2, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 #2 Code - - { "a35-04.10a", 0x2000, 0xb97ce9b1, 4 | BRF_GRA }, // 6 Background Tiles - { "a35-05.10b", 0x2000, 0x55a17b08, 4 | BRF_GRA }, // 7 - { "a35-06.10d", 0x2000, 0xf5ee6f8f, 4 | BRF_GRA }, // 8 - - { "a35-10.11n", 0x1000, 0x0b5a0c45, 5 | BRF_GRA }, // 9 Foreground Tiles - { "a35-11.11q", 0x1000, 0x93346d75, 5 | BRF_GRA }, // 10 - { "a35-12.11r", 0x1000, 0xf4c69d8a, 5 | BRF_GRA }, // 11 - - { "a35-07.12h", 0x4000, 0x38fc349f, 6 | BRF_GRA }, // 12 Sprites - { "a35-08.12j", 0x4000, 0xa07d6dc3, 6 | BRF_GRA }, // 13 - { "a35-09.12k", 0x4000, 0xc0784a0e, 6 | BRF_GRA }, // 14 - - { "a35-16.2j", 0x0100, 0x72d8b332, 7 | BRF_GRA }, // 15 Color Proms - { "a35-17.2l", 0x0100, 0x9bf1829e, 7 | BRF_GRA }, // 16 - { "a35-18.2m", 0x0100, 0x918e4732, 7 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(tsamuraih) -STD_ROM_FN(tsamuraih) - -struct BurnDriver BurnDrvTsamuraih = { - "tsamuraih", "tsamurai", NULL, NULL, "1985", - "Samurai Nihon-Ichi (bootleg, harder)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, tsamuraihRomInfo, tsamuraihRomName, NULL, NULL, TsamuraiInputInfo, TsamuraiDIPInfo, - tsamuraiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Lady Master of Kung Fu - -static struct BurnRomInfo ladymstrRomDesc[] = { - { "a49-01-1.3r", 0x4000, 0xacbd0b64, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a49-02.3t", 0x4000, 0xb0a9020b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a49-03.3v", 0x4000, 0x641c94ed, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a49-14.4e", 0x2000, 0xd83a3c02, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "a49-15.4c", 0x2000, 0xd24ee5fd, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "a49-13.4j", 0x2000, 0x7942bd7c, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 #2 Code - - { "a49-04.10a", 0x2000, 0x1fed96e6, 4 | BRF_GRA }, // 6 Background Tiles - { "a49-05.10c", 0x2000, 0xe0fce676, 4 | BRF_GRA }, // 7 - { "a49-06.10d", 0x2000, 0xf895672e, 4 | BRF_GRA }, // 8 - - { "a49-10.11n", 0x1000, 0xa7a361ba, 5 | BRF_GRA }, // 9 Foreground Tiles - { "a49-11.11q", 0x1000, 0x801902e3, 5 | BRF_GRA }, // 10 - { "a49-12.11r", 0x1000, 0xcef75565, 5 | BRF_GRA }, // 11 - - { "a49-07.12h", 0x4000, 0x8c749828, 6 | BRF_GRA }, // 12 Sprites - { "a49-08.12j", 0x4000, 0x03c10aed, 6 | BRF_GRA }, // 13 - { "a49-09.12k", 0x4000, 0xf61316d2, 6 | BRF_GRA }, // 14 - - { "a49-16.2j", 0x0100, 0xa7b077d4, 7 | BRF_GRA }, // 15 Color Proms - { "a49-17.2l", 0x0100, 0x1c04c087, 7 | BRF_GRA }, // 16 - { "a49-18.2m", 0x0100, 0xf5ce3c45, 7 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(ladymstr) -STD_ROM_FN(ladymstr) - -struct BurnDriver BurnDrvLadymstr = { - "ladymstr", NULL, NULL, NULL, "1985", - "Lady Master of Kung Fu\0", NULL, "Kaneko / Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, ladymstrRomInfo, ladymstrRomName, NULL, NULL, TsamuraiInputInfo, LadymstrDIPInfo, - tsamuraiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Nunchackun - -static struct BurnRomInfo nunchakuRomDesc[] = { - { "nunchack.p1", 0x4000, 0x4385aca6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "nunchack.p2", 0x4000, 0xf9beb72c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "nunchack.p3", 0x4000, 0xcde5d674, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "nunchack.m3", 0x2000, 0x9036c945, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - { "nunchack.m4", 0x2000, 0xe7206724, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "nunchack.m1", 0x2000, 0xb53d73f6, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 #2 Code - { "nunchack.m2", 0x2000, 0xf37d7c49, 3 | BRF_PRG | BRF_ESS }, // 6 - - { "nunchack.b1", 0x2000, 0x48c88fea, 4 | BRF_GRA }, // 7 Background Tiles - { "nunchack.b2", 0x2000, 0xeec818e4, 4 | BRF_GRA }, // 8 - { "nunchack.b3", 0x2000, 0x5f16473f, 4 | BRF_GRA }, // 9 - - { "nunchack.v1", 0x1000, 0x358a3714, 5 | BRF_GRA }, // 10 Foreground Tiles - { "nunchack.v2", 0x1000, 0x54c18d8e, 5 | BRF_GRA }, // 11 - { "nunchack.v3", 0x1000, 0xf7ac203a, 5 | BRF_GRA }, // 12 - - { "nunchack.c1", 0x4000, 0x797cbc8a, 6 | BRF_GRA }, // 13 Sprites - { "nunchack.c2", 0x4000, 0x701a0cc3, 6 | BRF_GRA }, // 14 - { "nunchack.c3", 0x4000, 0xffb841fc, 6 | BRF_GRA }, // 15 - - { "nunchack.016", 0x0100, 0xa7b077d4, 7 | BRF_GRA }, // 16 Color Proms - { "nunchack.017", 0x0100, 0x1c04c087, 7 | BRF_GRA }, // 17 - { "nunchack.018", 0x0100, 0xf5ce3c45, 7 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(nunchaku) -STD_ROM_FN(nunchaku) - -static INT32 nunchakuInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvNunchaku = { - "nunchaku", "ladymstr", NULL, NULL, "1985", - "Nunchackun\0", NULL, "Kaneko / Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, nunchakuRomInfo, nunchakuRomName, NULL, NULL, TsamuraiInputInfo, NunchakuDIPInfo, - nunchakuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Go Go Mr. Yamaguchi / Yuke Yuke Yamaguchi-kun - -static struct BurnRomInfo yamagchiRomDesc[] = { - { "a38-01.3s", 0x4000, 0x1a6c8498, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a38-02.3t", 0x4000, 0xfa66b396, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a38-03.3v", 0x4000, 0x6a4239cf, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a38-14.4e", 0x2000, 0x5a758992, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "a38-13.4j", 0x2000, 0xa26445bb, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "a38-04.10a", 0x2000, 0x6bc69d4d, 4 | BRF_GRA }, // 5 Background Tiles - { "a38-05.10b", 0x2000, 0x047fb315, 4 | BRF_GRA }, // 6 - { "a38-06.10d", 0x2000, 0xa636afb2, 4 | BRF_GRA }, // 7 - - { "a38-10.11n", 0x1000, 0x51ab4671, 5 | BRF_GRA }, // 8 Foreground Tiles - { "a38-11.11p", 0x1000, 0x27890169, 5 | BRF_GRA }, // 9 - { "a38-12.11r", 0x1000, 0xc98d5cf2, 5 | BRF_GRA }, // 10 - - { "a38-07.12h", 0x4000, 0xa3a521b6, 6 | BRF_GRA }, // 11 Sprites - { "a38-08.12j", 0x4000, 0x553afc66, 6 | BRF_GRA }, // 12 - { "a38-09.12l", 0x4000, 0x574156ae, 6 | BRF_GRA }, // 13 - - { "mb7114e.2k", 0x0100, 0xe7648110, 7 | BRF_GRA }, // 14 Color Proms - { "mb7114e.2l", 0x0100, 0x7b874ee6, 7 | BRF_GRA }, // 15 - { "mb7114e.2m", 0x0100, 0x938d0fce, 7 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(yamagchi) -STD_ROM_FN(yamagchi) - -static INT32 yamagchiInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvYamagchi = { - "yamagchi", NULL, NULL, NULL, "1985", - "Go Go Mr. Yamaguchi / Yuke Yuke Yamaguchi-kun\0", NULL, "Kaneko / Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, yamagchiRomInfo, yamagchiRomName, NULL, NULL, YamagchiInputInfo, YamagchiDIPInfo, - yamagchiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Mission 660 (US) - -static struct BurnRomInfo m660RomDesc[] = { - { "660l.bin", 0x4000, 0x57c0d1cc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "660m.bin", 0x4000, 0x628c6686, 1 | BRF_PRG | BRF_ESS }, // 1 - { "660n.bin", 0x4000, 0x1b418a97, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "14.4n", 0x4000, 0x5734db5a, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "13.4j", 0x4000, 0xfba51cf7, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "660x.bin", 0x8000, 0xb82f0cfa, 4 | BRF_PRG | BRF_ESS }, // 5 Z80 #3 Code - - { "4.7k", 0x4000, 0xe24e431a, 5 | BRF_GRA }, // 6 Background Tiles - { "5.6k", 0x4000, 0xb2c93d46, 5 | BRF_GRA }, // 7 - { "6.5k", 0x4000, 0x763c5983, 5 | BRF_GRA }, // 8 - - { "660u.bin", 0x2000, 0x030af716, 6 | BRF_GRA }, // 9 Foreground Tiles - { "660v.bin", 0x2000, 0x51a6e160, 6 | BRF_GRA }, // 10 - { "660w.bin", 0x2000, 0x8a45b469, 6 | BRF_GRA }, // 11 - - { "7.15e", 0x4000, 0x990c0cee, 7 | BRF_GRA }, // 12 Sprites - { "8.15d", 0x4000, 0xd9aa7834, 7 | BRF_GRA }, // 13 - { "9.15b", 0x4000, 0x27b26905, 7 | BRF_GRA }, // 14 - - { "4r.bpr", 0x0100, 0xcd16d0f1, 8 | BRF_GRA }, // 15 Color Proms - { "4p.bpr", 0x0100, 0x22e8b22c, 8 | BRF_GRA }, // 16 - { "5r.bpr", 0x0100, 0xb7d6fdb5, 8 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(m660) -STD_ROM_FN(m660) - -static INT32 m660Init() -{ - return m660CommonInit(0); -} - -struct BurnDriver BurnDrvM660 = { - "m660", NULL, NULL, NULL, "1986", - "Mission 660 (US)\0", NULL, "Wood Place Inc. (Taito America Corporation license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, m660RomInfo, m660RomName, NULL, NULL, TsamuraiInputInfo, M660DIPInfo, - m660Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Mission 660 (Japan) - -static struct BurnRomInfo m660jRomDesc[] = { - { "1.3c", 0x4000, 0x4c8f96aa, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.3d", 0x4000, 0xe6661504, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.3f", 0x4000, 0x3a389ccd, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "14.4n", 0x4000, 0x5734db5a, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "13.4j", 0x4000, 0xfba51cf7, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "d.4e", 0x4000, 0x93f3d852, 4 | BRF_PRG | BRF_ESS }, // 5 Z80 #3 Code - { "e.4d", 0x4000, 0x12f5c077, 4 | BRF_PRG | BRF_ESS }, // 6 - - { "4.7k", 0x4000, 0xe24e431a, 5 | BRF_GRA }, // 7 Background Tiles - { "5.6k", 0x4000, 0xb2c93d46, 5 | BRF_GRA }, // 8 - { "6.5k", 0x4000, 0x763c5983, 5 | BRF_GRA }, // 9 - - { "a.16j", 0x2000, 0x06f44c8c, 6 | BRF_GRA }, // 10 Foreground Tiles - { "b.16k", 0x2000, 0x94b8b69f, 6 | BRF_GRA }, // 11 - { "c.16m", 0x2000, 0xd6768c68, 6 | BRF_GRA }, // 12 - - { "7.15e", 0x4000, 0x990c0cee, 7 | BRF_GRA }, // 13 Sprites - { "8.15d", 0x4000, 0xd9aa7834, 7 | BRF_GRA }, // 14 - { "9.15b", 0x4000, 0x27b26905, 7 | BRF_GRA }, // 15 - - { "4r.bpr", 0x0100, 0xcd16d0f1, 8 | BRF_GRA }, // 16 Color Proms - { "4p.bpr", 0x0100, 0x22e8b22c, 8 | BRF_GRA }, // 17 - { "5r.bpr", 0x0100, 0xb7d6fdb5, 8 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(m660j) -STD_ROM_FN(m660j) - -static INT32 m660jInit() -{ - return m660CommonInit(1); -} - -struct BurnDriver BurnDrvM660j = { - "m660j", "m660", NULL, NULL, "1986", - "Mission 660 (Japan)\0", NULL, "Wood Place Inc. (Taito Corporation license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, m660jRomInfo, m660jRomName, NULL, NULL, TsamuraiInputInfo, M660DIPInfo, - m660jInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Mission 660 (bootleg) - -static struct BurnRomInfo m660bRomDesc[] = { - { "m660-1.bin", 0x4000, 0x18f6c4be, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.3d", 0x4000, 0xe6661504, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.3f", 0x4000, 0x3a389ccd, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "14.4n", 0x4000, 0x5734db5a, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "13.4j", 0x4000, 0xfba51cf7, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "660x.bin", 0x8000, 0xb82f0cfa, 4 | BRF_PRG | BRF_ESS }, // 5 Z80 #3 Code - - { "4.7k", 0x4000, 0xe24e431a, 5 | BRF_GRA }, // 6 Background Tiles - { "5.6k", 0x4000, 0xb2c93d46, 5 | BRF_GRA }, // 7 - { "6.5k", 0x4000, 0x763c5983, 5 | BRF_GRA }, // 8 - - { "m660-10.bin", 0x2000, 0xb11405a6, 6 | BRF_GRA }, // 9 Foreground Tiles - { "b.16k", 0x2000, 0x94b8b69f, 6 | BRF_GRA }, // 10 - { "c.16m", 0x2000, 0xd6768c68, 6 | BRF_GRA }, // 11 - - { "7.15e", 0x4000, 0x990c0cee, 7 | BRF_GRA }, // 12 Sprites - { "8.15d", 0x4000, 0xd9aa7834, 7 | BRF_GRA }, // 13 - { "9.15b", 0x4000, 0x27b26905, 7 | BRF_GRA }, // 14 - - { "4r.bpr", 0x0100, 0xcd16d0f1, 8 | BRF_GRA }, // 15 Color Proms - { "4p.bpr", 0x0100, 0x22e8b22c, 8 | BRF_GRA }, // 16 - { "5r.bpr", 0x0100, 0xb7d6fdb5, 8 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(m660b) -STD_ROM_FN(m660b) - -struct BurnDriver BurnDrvM660b = { - "m660b", "m660", NULL, NULL, "1986", - "Mission 660 (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, m660bRomInfo, m660bRomName, NULL, NULL, TsamuraiInputInfo, M660DIPInfo, - m660Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// The Alphax Z (Japan) - -static struct BurnRomInfo alphaxzRomDesc[] = { - { "az-01.bin", 0x4000, 0x5336f842, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "az-02.bin", 0x4000, 0xa0779b6b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "az-03.bin", 0x4000, 0x2797bc7b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "14.4n", 0x4000, 0x5734db5a, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "13.4j", 0x4000, 0xfba51cf7, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "660x.bin", 0x8000, 0xb82f0cfa, 4 | BRF_PRG | BRF_ESS }, // 5 Z80 #3 Code - - { "az-04.bin", 0x4000, 0x23da4e3d, 5 | BRF_GRA }, // 6 Background Tiles - { "az-05.bin", 0x4000, 0x8746ff69, 5 | BRF_GRA }, // 7 - { "az-06.bin", 0x4000, 0x6e494964, 5 | BRF_GRA }, // 8 - - { "az-10.bin", 0x2000, 0x10b499bb, 6 | BRF_GRA }, // 9 Foreground Tiles - { "az-11.bin", 0x2000, 0xd91993f6, 6 | BRF_GRA }, // 10 - { "az-12.bin", 0x2000, 0x8ea48ef3, 6 | BRF_GRA }, // 11 - - { "az-07.bin", 0x4000, 0x5f9cc65e, 7 | BRF_GRA }, // 12 Sprites - { "az-08.bin", 0x4000, 0x23e3a6ba, 7 | BRF_GRA }, // 13 - { "az-09.bin", 0x4000, 0x7096fa71, 7 | BRF_GRA }, // 14 - - { "4r.bpr", 0x0100, 0xcd16d0f1, 8 | BRF_GRA }, // 15 Color Proms - { "4p.bpr", 0x0100, 0x22e8b22c, 8 | BRF_GRA }, // 16 - { "5r.bpr", 0x0100, 0xb7d6fdb5, 8 | BRF_GRA }, // 17 -}; - -STD_ROM_PICK(alphaxz) -STD_ROM_FN(alphaxz) - -struct BurnDriver BurnDrvAlphaxz = { - "alphaxz", "m660", NULL, NULL, "1986", - "The Alphax Z (Japan)\0", NULL, "Ed Co. Ltd. (Wood Place Inc. license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, alphaxzRomInfo, alphaxzRomName, NULL, NULL, TsamuraiInputInfo, M660DIPInfo, - m660Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// VS Gong Fight - -static struct BurnRomInfo vsgongfRomDesc[] = { - { "1.5a", 0x2000, 0x2c056dee, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2", 0x2000, 0x1a634daf, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.5d", 0x2000, 0x5ac16861, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.5f", 0x2000, 0x1d1baf7b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "6.5n", 0x2000, 0x785b9000, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - { "5.5l", 0x2000, 0x76dbfde9, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "7.6f", 0x1000, 0x6ec68692, 3 | BRF_GRA }, // 6 Background Tiles - { "8.7f", 0x1000, 0xafba16c8, 3 | BRF_GRA }, // 7 - { "9.8f", 0x1000, 0x536bf710, 3 | BRF_GRA }, // 8 - - { "13.15j", 0x2000, 0xa2451a31, 4 | BRF_GRA }, // 9 Sprites - { "14.15h", 0x2000, 0xb387403e, 4 | BRF_GRA }, // 10 - { "15.15f", 0x2000, 0x0e649334, 4 | BRF_GRA }, // 11 - - { "clr.6s", 0x0100, 0x578bfbea, 5 | BRF_GRA }, // 12 Color Proms - { "clr.6r", 0x0100, 0x3ec00739, 5 | BRF_GRA }, // 13 - { "clr.6p", 0x0100, 0x0e4fd17a, 5 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(vsgongf) -STD_ROM_FN(vsgongf) - -static INT32 VsgongfInit() -{ - vsgongf_protval = 0xaa80; - - return VsgongfCommonInit(0); -} - -struct BurnDriver BurnDrvVsgongf = { - "vsgongf", NULL, NULL, NULL, "1984", - "VS Gong Fight\0", NULL, "Kaneko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, vsgongfRomInfo, vsgongfRomName, NULL, NULL, TsamuraiInputInfo, VsgongfDIPInfo, - VsgongfInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Ring Fighter (set 1) - -static struct BurnRomInfo ringfgtRomDesc[] = { - { "rft04-1", 0x2000, 0x11030866, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "rft03-1", 0x2000, 0x357a2085, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "6.5n", 0x2000, 0x785b9000, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - { "5.5l", 0x2000, 0x76dbfde9, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "rft05", 0x1000, 0xa7b732fd, 3 | BRF_GRA }, // 4 Background Tiles - { "rft06", 0x1000, 0xff2721f7, 3 | BRF_GRA }, // 5 - { "rft07", 0x1000, 0xec1d7ba4, 3 | BRF_GRA }, // 6 - - { "rft08", 0x2000, 0x80d67d28, 4 | BRF_GRA }, // 7 Sprites - { "rft09", 0x2000, 0xea8f0656, 4 | BRF_GRA }, // 8 - { "rft10", 0x2000, 0x833ca89f, 4 | BRF_GRA }, // 9 - - { "clr.6s", 0x0100, 0x578bfbea, 5 | BRF_GRA }, // 10 Color Proms - { "clr.6r", 0x0100, 0x3ec00739, 5 | BRF_GRA }, // 11 - { "clr.6p", 0x0100, 0x0e4fd17a, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(ringfgt) -STD_ROM_FN(ringfgt) - -static INT32 RingfgtInit() -{ - vsgongf_protval = 0x6380; - - return VsgongfCommonInit(1); -} - -struct BurnDriver BurnDrvRingfgt = { - "ringfgt", "vsgongf", NULL, NULL, "1984", - "Ring Fighter (set 1)\0", NULL, "Kaneko (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, ringfgtRomInfo, ringfgtRomName, NULL, NULL, TsamuraiInputInfo, VsgongfDIPInfo, - RingfgtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Ring Fighter (set 2) - -static struct BurnRomInfo ringfgt2RomDesc[] = { - { "rft.04", 0x2000, 0x6b9b3f3d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "rft.03", 0x2000, 0x1821974b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "6.5n", 0x2000, 0x785b9000, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - { "5.5l", 0x2000, 0x76dbfde9, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "rft05", 0x1000, 0xa7b732fd, 3 | BRF_GRA }, // 4 Background Tiles - { "rft06", 0x1000, 0xff2721f7, 3 | BRF_GRA }, // 5 - { "rft07", 0x1000, 0xec1d7ba4, 3 | BRF_GRA }, // 6 - - { "rft08", 0x2000, 0x80d67d28, 4 | BRF_GRA }, // 7 Sprites - { "rft09", 0x2000, 0xea8f0656, 4 | BRF_GRA }, // 8 - { "rft10", 0x2000, 0x833ca89f, 4 | BRF_GRA }, // 9 - - { "clr.6s", 0x0100, 0x578bfbea, 5 | BRF_GRA }, // 10 Color Proms - { "clr.6r", 0x0100, 0x3ec00739, 5 | BRF_GRA }, // 11 - { "clr.6p", 0x0100, 0x0e4fd17a, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(ringfgt2) -STD_ROM_FN(ringfgt2) - -static INT32 Ringfgt2Init() -{ - vsgongf_protval = 0x6ac0; - - return VsgongfCommonInit(1); -} - -struct BurnDriver BurnDrvRingfgt2 = { - "ringfgt2", "vsgongf", NULL, NULL, "1984", - "Ring Fighter (set 2)\0", NULL, "Kaneko (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSMISC, 0, - NULL, ringfgt2RomInfo, ringfgt2RomName, NULL, NULL, TsamuraiInputInfo, VsgongfDIPInfo, - Ringfgt2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_usgames.cpp b/jan/src/burn/drv/pre90s/d_usgames.cpp deleted file mode 100644 index c49600830..000000000 --- a/jan/src/burn/drv/pre90s/d_usgames.cpp +++ /dev/null @@ -1,614 +0,0 @@ -// FB Alpha US Games - Trivia / Quiz / 'Amusement Only' Gambling Games Driver Module -// Based on MAME driver by David Haywood and Nicola Salmoria - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvCharExp; -static UINT8 *DrvNVRAM; -static UINT8 *DrvCharRAM; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 bankdata; -static INT32 vblank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvInputs[1]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 5" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x07, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 2, "Service Keyboard Attached?" }, - {0x07, 0x01, 0x01, 0x01, "No" }, - {0x07, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x07, 0x01, 0x02, 0x00, "Off" }, - {0x07, 0x01, 0x02, 0x02, "On" }, -}; - -STDDIPINFO(Drv) - -static void bankswitch(INT32 data) -{ - INT32 bank = (data & 0xf) * 0x4000; - - bankdata = data; - - M6809MapMemory(DrvM6809ROM + 0x10000 + bank, 0x4000, 0x7fff, MAP_ROM); -} - -static void decode_char(INT32 offset, UINT8 data) -{ - for (INT32 i = 0; i < 8; i++) { - DrvCharExp[(offset * 8) + i] = (data >> (7 - i)) & 1; - } -} - -static void usgames_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0x2800) { - if (DrvCharRAM[address & 0x7ff] != data) { - DrvCharRAM[address & 0x7ff] = data; - decode_char(address & 0x7ff, data); - } - return; - } - - switch (address & ~0x0400) - { - case 0x2000: - case 0x2001: - AY8910Write(0, address & 1, data); - return; - - case 0x2020: // lamps1 - case 0x2030: // lamps2 - return; - - case 0x2040: // mc6845 address_w - case 0x2041: // mc6845 register_w - return; - - case 0x2060: - bankswitch(data); - return; - } -} - -static UINT8 usgames_read(UINT16 address) -{ - switch (address & ~0x0400) - { - case 0x2000: - return (DrvDips[0] & 0x7f) | (vblank ? 0x80 : 0); - - case 0x2010: - return DrvInputs[0]; - - case 0x2041: - case 0x2070: - return 0xff; - } - - return 0; -} - -static tilemap_callback( background ) -{ - TILE_SET_INFO(0, DrvVidRAM[offs*2], DrvVidRAM[offs*2+1], 0); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - memset (DrvCharExp, 0, 0x4000); - - M6809Open(0); - M6809Reset(); - bankswitch(0); - M6809Close(); - - AY8910Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvM6809ROM = Next; Next += 0x080000; - - DrvCharExp = Next; Next += 0x004000; - - DrvPalette = (UINT32*)Next; Next += 0x200 * sizeof(UINT32); - - DrvNVRAM = Next; Next += 0x002000; - - AllRam = Next; - - DrvCharRAM = Next; Next += 0x000800; - DrvVidRAM = Next; Next += 0x001000; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 game_select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (BurnLoadRom(DrvM6809ROM + 0x00000, 0, 1)) return 1; - - switch (game_select) - { - case 0: // usg32 - { - if (BurnLoadRom(DrvM6809ROM + 0x18000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x28000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x38000, 3, 1)) return 1; - } - break; - - case 1: // superten, usg83x, usg82 - { - if (BurnLoadRom(DrvM6809ROM + 0x18000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x28000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x38000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x48000, 4, 1)) return 1; - } - break; - - case 2: // usg187c - { - if (BurnLoadRom(DrvM6809ROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x30000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x40000, 4, 1)) return 1; - } - break; - - case 3: // usg182, usg185 - { - if (BurnLoadRom(DrvM6809ROM + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x30000, 3, 1)) return 1; - if (BurnLoadRom(DrvM6809ROM + 0x48000, 4, 1)) return 1; - } - break; - - case 4: // usgames (0x4000-sized chunks loaded in reverse order) - { - if (BurnLoadRom(DrvM6809ROM + 0x70000, 1, 1)) return 1; - for (INT32 i = 0; i < 0x10000; i++) - DrvM6809ROM[0x10000 + i] = DrvM6809ROM[0x7c000^i]; - - if (BurnLoadRom(DrvM6809ROM + 0x70000, 2, 1)) return 1; - for (INT32 i = 0; i < 0x10000; i++) - DrvM6809ROM[0x20000 + i] = DrvM6809ROM[0x7c000^i]; - - if (BurnLoadRom(DrvM6809ROM + 0x70000, 3, 1)) return 1; - for (INT32 i = 0; i < 0x10000; i++) - DrvM6809ROM[0x30000 + i] = DrvM6809ROM[0x7c000^i]; - - if (BurnLoadRom(DrvM6809ROM + 0x70000, 4, 1)) return 1; - for (INT32 i = 0; i < 0x10000; i++) - DrvM6809ROM[0x40000 + i] = DrvM6809ROM[0x7c000^i]; - } - break; - } - - M6809Init(1); - M6809Open(0); - M6809MapMemory(DrvNVRAM, 0x0000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvCharRAM, 0x2800, 0x2fff, MAP_ROM); - M6809MapMemory(DrvVidRAM, 0x3000, 0x3fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(usgames_write); - M6809SetReadHandler(usgames_read); - M6809Close(); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(0, DrvCharExp, 1, 8, 8, 0x800*8, 0, 0xff); - GenericTilemapSetOffsets(0, -56, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - - AY8910Exit(0); - - BurnFree(AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 j = 0; j < 0x200; j++) - { - UINT8 data = (j >> ((j & 1) ? 5 : 1)) & 0x0f; - - UINT8 r = (data & 1) >> 0; - UINT8 g = (data & 2) >> 1; - UINT8 b = (data & 4) >> 2; - UINT8 i = (data & 8) >> 3; - - r = 0xff * r; - g = 0x7f * g * (i + 1); - b = 0x7f * b * (i + 1); - - DrvPalette[j] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - GenericTilemapDraw(0, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal = 2000000 / 60; - INT32 nCyclesDone = 0; - - M6809Open(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone += M6809Run(nCyclesTotal / nInterleave); - - if (i & 1) M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if (i == 8) vblank = 1; - } - - M6809Close(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(bankdata); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNVRAM; - ba.nLen = 0x02000; - ba.nAddress = 0; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_WRITE) { - M6809Open(0); - bankswitch(bankdata); - M6809Close(); - - for (INT32 i = 0; i < 0x800; i++) { - usgames_write(0x2800 + i, DrvCharRAM[i]); - } - } - - return 0; -} - -// Super Duper Casino (California V3.2) - -static struct BurnRomInfo usg32RomDesc[] = { - { "usg32-0.bin", 0x08000, 0xbc313387, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "usg32-1.bin", 0x08000, 0xbaaea800, 1 | BRF_PRG | BRF_ESS }, // 1 - { "usg32-2.bin", 0x08000, 0xd73d7f48, 1 | BRF_PRG | BRF_ESS }, // 2 - { "usg32-3.bin", 0x08000, 0x22747804, 1 | BRF_PRG | BRF_ESS }, // 3 -}; - -STD_ROM_PICK(usg32) -STD_ROM_FN(usg32) - -static INT32 Usg32Init() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvUsg32 = { - "usg32", NULL, NULL, NULL, "1987", - "Super Duper Casino (California V3.2)\0", NULL, "U.S. Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, usg32RomInfo, usg32RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - Usg32Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 400, 256, 4, 3 -}; - - -// Super Ten V8.3 - -static struct BurnRomInfo supertenRomDesc[] = { - { "usg83-rom0.bin", 0x08000, 0xaae84186, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "usg83-rom1.bin", 0x08000, 0x7b520b6f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "usg83-rom2.bin", 0x08000, 0x29fbb23b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "usg83-rom3.bin", 0x10000, 0x4e110844, 1 | BRF_PRG | BRF_ESS }, // 3 - { "usg83-rom4.bin", 0x08000, 0x437697c4, 1 | BRF_PRG | BRF_ESS }, // 4 -}; - -STD_ROM_PICK(superten) -STD_ROM_FN(superten) - -static INT32 SupertenInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvSuperten = { - "superten", NULL, NULL, NULL, "1988", - "Super Ten V8.3\0", NULL, "U.S. Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, supertenRomInfo, supertenRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - SupertenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 400, 256, 4, 3 -}; - - -// Super Ten V8.3X - -static struct BurnRomInfo usg83xRomDesc[] = { - { "usg83x-rom0.bin", 0x8000, 0x4ad9b6e0, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "usg83-rom1.bin", 0x8000, 0x7b520b6f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "usg83-rom2.bin", 0x8000, 0x29fbb23b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "usg83x-rom3.bin", 0x8000, 0x41c475ac, 1 | BRF_PRG | BRF_ESS }, // 3 - { "usg83-rom4.bin", 0x8000, 0x437697c4, 1 | BRF_PRG | BRF_ESS }, // 4 -}; - -STD_ROM_PICK(usg83x) -STD_ROM_FN(usg83x) - -struct BurnDriver BurnDrvUsg83x = { - "usg83x", "superten", NULL, NULL, "1988", - "Super Ten V8.3X\0", NULL, "U.S. Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, usg83xRomInfo, usg83xRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - SupertenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 400, 256, 4, 3 -}; - - -// Super Ten V8.2 - -static struct BurnRomInfo usg82RomDesc[] = { - { "usg82-rom0.bin", 0x08000, 0x09c20b78, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "usg82-rom1.bin", 0x08000, 0x915a9ff4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "usg82-rom2.bin", 0x08000, 0x29fbb23b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "usg82-rom3.bin", 0x10000, 0x4e110844, 1 | BRF_PRG | BRF_ESS }, // 3 - { "usg82-rom4.bin", 0x08000, 0x437697c4, 1 | BRF_PRG | BRF_ESS }, // 4 -}; - -STD_ROM_PICK(usg82) -STD_ROM_FN(usg82) - -struct BurnDriver BurnDrvUsg82 = { - "usg82", "superten", NULL, NULL, "1988", - "Super Ten V8.2\0", NULL, "U.S. Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, usg82RomInfo, usg82RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - SupertenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 400, 256, 4, 3 -}; - - -// Games V25.4X - -static struct BurnRomInfo usgamesRomDesc[] = { - { "version_25.4x_rom0_cs=324591.u12", 0x08000, 0x766a855a, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "version_25.4x_rom2_cs=6a42e7.u28", 0x10000, 0xd44d2ffa, 1 | BRF_PRG | BRF_ESS }, // 1 - { "version_25.4x_rom1_cs=31a223.u18", 0x10000, 0x2fff1da2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "version_25.4x_rom4_cs=5a447e.u36", 0x10000, 0xb6d007be, 1 | BRF_PRG | BRF_ESS }, // 3 - { "version_25.4x_rom3_cs=7924ba.u35", 0x10000, 0x9542295b, 1 | BRF_PRG | BRF_ESS }, // 4 -}; - -STD_ROM_PICK(usgames) -STD_ROM_FN(usgames) - -static INT32 UsgamesInit() -{ - return DrvInit(4); -} - -struct BurnDriver BurnDrvUsgames = { - "usgames", NULL, NULL, NULL, "1992", - "Games V25.4X\0", NULL, "U.S. Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, usgamesRomInfo, usgamesRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - UsgamesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 400, 256, 4, 3 -}; - - -// Games V18.7C - -static struct BurnRomInfo usg187cRomDesc[] = { - { "version_18.7c_rom0_cs=30a6ba.u12", 0x08000, 0x2f4ed125, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "version_18.7c_rom4_cs=90b95e.u36", 0x10000, 0xb104744d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "version_18.7c_rom3_cs=76aebf.u35", 0x10000, 0x795e71c8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "version_18.7c_rom2_cs=8973c0.u28", 0x10000, 0xc6ba8a81, 1 | BRF_PRG | BRF_ESS }, // 3 - { "version_18.7c_rom1_cs=6dcfd3.u18", 0x10000, 0x1cfd934d, 1 | BRF_PRG | BRF_ESS }, // 4 -}; - -STD_ROM_PICK(usg187c) -STD_ROM_FN(usg187c) - -static INT32 Usg187cInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvUsg187c = { - "usg187c", "usgames", NULL, NULL, "1991", - "Games V18.7C\0", NULL, "U.S. Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, usg187cRomInfo, usg187cRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - Usg187cInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 400, 256, 4, 3 -}; - - -// Games V18.5 - -static struct BurnRomInfo usg185RomDesc[] = { - { "version_18.5_rom0_cs=315d5c.u12", 0x08000, 0x2cc68502, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "version_18.5_rom4_cs=90b95e.u36", 0x10000, 0xb104744d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "version_18.5_rom3_cs=76aebf.u35", 0x10000, 0x795e71c8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "version_18.5_rom2_cs=8973c0.u28", 0x10000, 0xc6ba8a81, 1 | BRF_PRG | BRF_ESS }, // 3 - { "version_18.5_rom1_cs=2cb91d.u18", 0x08000, 0xbd384e5a, 1 | BRF_PRG | BRF_ESS }, // 4 -}; - -STD_ROM_PICK(usg185) -STD_ROM_FN(usg185) - -static INT32 Usg185Init() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvUsg185 = { - "usg185", "usgames", NULL, NULL, "1990", - "Games V18.5\0", NULL, "U.S. Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, usg185RomInfo, usg185RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - Usg185Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 400, 256, 4, 3 -}; - - -// Games V18.2 - -static struct BurnRomInfo usg182RomDesc[] = { - { "version_18.2_rom0_cs=2e6ae3.u12", 0x08000, 0xf5a053c1, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code - { "version_18.2_rom4_cs=90b95e.u36", 0x10000, 0xb104744d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "version_18.2_rom3_cs=76aebf.u35", 0x10000, 0x795e71c8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "version_18.2_rom2_cs=8973c0.u28", 0x10000, 0xc6ba8a81, 1 | BRF_PRG | BRF_ESS }, // 3 - { "version_18.2_rom1_cs=2bf00d.u18", 0x08000, 0x73bbc1c8, 1 | BRF_PRG | BRF_ESS }, // 4 -}; - -STD_ROM_PICK(usg182) -STD_ROM_FN(usg182) - -struct BurnDriver BurnDrvUsg182 = { - "usg182", "usgames", NULL, NULL, "1989", - "Games V18.2\0", NULL, "U.S. Games", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0, - NULL, usg182RomInfo, usg182RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - Usg185Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 400, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_vastar.cpp b/jan/src/burn/drv/pre90s/d_vastar.cpp deleted file mode 100644 index 018938349..000000000 --- a/jan/src/burn/drv/pre90s/d_vastar.cpp +++ /dev/null @@ -1,1116 +0,0 @@ -// FB Alpha Vastar driver module -// Based on MAME driver by Allard Van Der Bas - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvColPROM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvVidRAM2; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static UINT8 flipscreen; -static UINT8 nmi_mask; -static UINT8 sprite_priority; -static UINT8 sound_reset; - -static INT32 watchdog; - -static struct BurnInputInfo VastarInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Vastar) - -static struct BurnInputInfo PprobeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pprobe) - - -static struct BurnDIPInfo VastarDIPList[]= -{ - {0x11, 0xff, 0xff, 0xbf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - {0x11, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Show Author Credits" }, - {0x11, 0x01, 0x08, 0x08, "No" }, - {0x11, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Slow Motion (Cheat)" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x20, 0x20, "20000 50000" }, - {0x11, 0x01, 0x20, 0x00, "40000 70000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x00, "Upright" }, - {0x11, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Vastar) - -static struct BurnDIPInfo Vastar4DIPList[]= -{ - {0x11, 0xff, 0xff, 0xbf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "1" }, - {0x11, 0x01, 0x03, 0x02, "2" }, - {0x11, 0x01, 0x03, 0x01, "3" }, - {0x11, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x04, 0x00, "Off" }, - {0x11, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Show Author Credits" }, - {0x11, 0x01, 0x08, 0x08, "No" }, - {0x11, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Slow Motion (Cheat)" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x11, 0x01, 0x20, 0x20, "20000 50000" }, - {0x11, 0x01, 0x20, 0x00, "40000 70000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x00, "Upright" }, - {0x11, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Vastar4) - -static struct BurnDIPInfo PprobeDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbd, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x03, "1" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x01, "3" }, - {0x12, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Player Controls Demo (Cheat)" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x12, 0x01, 0x20, 0x20, "20000 then every 40000" }, - {0x12, 0x01, 0x20, 0x00, "30000 then every 70000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x40, 0x00, "Upright" }, - {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Rom Test / STOP" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x13, 0x01, 0xf0, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, -}; - -STDDIPINFO(Pprobe) - -static void __fastcall vastar_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - sprite_priority = data; - return; - - case 0xe000: - watchdog = 0; - return; - } -} - -static UINT8 __fastcall vastar_main_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - watchdog = 0; - return 0; - } - - return 0; -} - -static void __fastcall vastar_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0x0f) - { - case 0x00: - nmi_mask = data & 0x01; - return; - - case 0x01: - flipscreen = data & 0x01; - return; - - case 0x02: - sound_reset = ~data & 0x01; - if (sound_reset) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - } - return; - } -} - -static UINT8 __fastcall vastar_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8000: - return DrvInputs[1]; - - case 0x8040: - return DrvInputs[0]; - - case 0x8080: - return DrvInputs[2]; - } - - return 0; -} - -static void __fastcall vastar_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0x0f) - { - case 0x00: - case 0x01: - AY8910Write(0, port & 1, data); - return; - } -} - -static UINT8 __fastcall vastar_sound_read_port(UINT16 port) -{ - switch (port & 0x0f) - { - case 0x02: - return AY8910Read(0); - } - - return 0; -} - -static UINT8 vastar_ay8910_read_A(UINT32) -{ - return DrvDips[0]; -} - -static UINT8 vastar_ay8910_read_B(UINT32) -{ - return DrvDips[1]; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - watchdog = 0; - sound_reset = 1; - - flipscreen = 0; - nmi_mask = 0; - sprite_priority = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x008000; - DrvZ80ROM1 = Next; Next += 0x002000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x008000; - DrvGfxROM3 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvShareRAM = Next; Next += 0x000800; - DrvVidRAM0 = Next; Next += 0x001000; - DrvVidRAM1 = Next; Next += 0x001000; - DrvVidRAM2 = Next; Next += 0x000c00; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Planes[2] = { 0, 4 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(64,1), STEP4(128,1), STEP4(192,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(256,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x200, 2, 8, 8, Planes, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x4000); - - GfxDecode(0x100, 2, 16, 16, Planes, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x2000); - - GfxDecode(0x200, 2, 8, 8, Planes, XOffs, YOffs, 0x080, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x2000); - - GfxDecode(0x200, 2, 8, 8, Planes, XOffs, YOffs, 0x080, tmp, DrvGfxROM3); - - BurnFree (tmp); -} - -static inline void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[0x000 + i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[0x000 + i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[0x000 + i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[0x000 + i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[0x100 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[0x100 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[0x100 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[0x100 + i] >> 3) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[0x200 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[0x200 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[0x200 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[0x200 + i] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvInit(INT32 load_type) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - switch (load_type) - { - case 0: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x01000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x03000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x05000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x07000, 7, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x01000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 14, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 17, 1)) return 1; - } - break; - - case 1: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x01000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 10, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 13, 1)) return 1; - } - break; - - case 2: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 12, 1)) return 1; - } - break; - } - - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvVidRAM1, 0x8000, 0x8fff, MAP_RAM); - ZetMapMemory(DrvVidRAM0, 0x9000, 0x9fff, MAP_RAM); - ZetMapMemory(DrvVidRAM1, 0xa000, 0xafff, MAP_RAM); - ZetMapMemory(DrvVidRAM0, 0xb000, 0xbfff, MAP_RAM); - ZetMapMemory(DrvVidRAM2, 0xc400, 0xcfff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(vastar_main_write); - ZetSetReadHandler(vastar_main_read); - ZetSetOutHandler(vastar_main_write_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0x4000, 0x47ff, MAP_RAM); - ZetSetReadHandler(vastar_sound_read); - ZetSetOutHandler(vastar_sound_write_port); - ZetSetInHandler(vastar_sound_read_port); - ZetClose(); - - AY8910Init(0, 1536000, nBurnSoundRate, &vastar_ay8910_read_A, &vastar_ay8910_read_B, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - AY8910Exit(0); - - BurnFree(AllMem); - - return 0; -} - -static void draw_layer(UINT8 *ram, UINT8 *gfx, UINT8 *cscroll, INT32 ofst0, INT32 ofst1, INT32 opaque) -{ - INT32 trans = (opaque) ? 0xff : 0; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - if (cscroll) { - sy -= (cscroll[sx/8] + 16) & 0xff; - if (sy < -7) sy += 256; - } else { - sy -= 16; - if (sy < -7) sy += 256; - } - - if (sy >= nScreenHeight) continue; - - INT32 attr = ram[offs + ofst0]; - INT32 code = ram[offs + 0x800] + ((attr & 0x01) * 256); - INT32 color = ram[offs + ofst1] & 0x3f; - INT32 flipx = attr & 0x08; - INT32 flipy = attr & 0x04; - - if (flipscreen) { - sy = 216 - sy; - sx = 248 - sx; - flipx = !flipx; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, trans, 0, gfx); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, trans, 0, gfx); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, trans, 0, gfx); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, trans, 0, gfx); - } - } - } -} - -static void draw_sprite_tile(INT32 code, INT32 sx, INT32 sy, INT32 color, INT32 flipx, INT32 flipy) -{ - sy -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvGfxROM1); - } - } -} - -static void draw_sprites() -{ - UINT8 *spriteram = DrvVidRAM2 + 0x000; - UINT8 *spriteram_2 = DrvVidRAM2 + 0x400; - UINT8 *spriteram_3 = DrvVidRAM2 + 0x800; - - for (INT32 offs = 0x40-2; offs >=0; offs -= 2) - { - INT32 code, sx, sy, color, flipx, flipy; - - code = ((spriteram_3[offs] & 0xfc) >> 2) + ((spriteram_2[offs] & 0x01) << 6) - + ((offs & 0x20) << 2); - - sx = spriteram_3[offs + 1]; - sy = spriteram[offs]; - color = spriteram[offs + 1] & 0x3f; - flipx = spriteram_3[offs] & 0x02; - flipy = spriteram_3[offs] & 0x01; - - if (flipscreen) - { - flipx = !flipx; - flipy = !flipy; - } - - if (spriteram_2[offs] & 0x08) - { - if (!flipscreen) - sy = 224 - sy; - - if (flipy) { - draw_sprite_tile((code & ~1) | 1, sx, sy, color, flipx, flipy); - draw_sprite_tile((code & ~1) | 0, sx, sy + 16, color, flipx, flipy); - draw_sprite_tile((code & ~1) | 1, sx, sy + 256, color, flipx, flipy); - draw_sprite_tile((code & ~1) | 0, sx, sy + 16 + 256, color, flipx, flipy); - } else { - draw_sprite_tile((code & ~1) | 0, sx, sy, color, flipx, flipy); - draw_sprite_tile((code & ~1) | 1, sx, sy+ 16, color, flipx, flipy); - draw_sprite_tile((code & ~1) | 0, sx, sy + 256, color, flipx, flipy); - draw_sprite_tile((code & ~1) | 1, sx, sy + 16 + 256, color, flipx, flipy); - } - } - else - { - if (!flipscreen) - sy = 240 - sy; - - draw_sprite_tile(code, sx, sy, color, flipx, flipy); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(DrvVidRAM0, DrvGfxROM3, DrvVidRAM2 + 0x3c0, 0, 0xc00, 1); - - switch (sprite_priority) - { - case 0: - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 2) draw_layer(DrvVidRAM1, DrvGfxROM2, DrvVidRAM2 + 0x3e0, 0, 0xc00, 0); - if (nBurnLayer & 4) draw_layer(DrvVidRAM2, DrvGfxROM0, NULL, 0x400, 0, 0); - break; - - case 1: - if (nBurnLayer & 2) draw_layer(DrvVidRAM1, DrvGfxROM2, DrvVidRAM2 + 0x3e0, 0, 0xc00, 0); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 4) draw_layer(DrvVidRAM2, DrvGfxROM0, NULL, 0x400, 0, 0); - break; - - case 2: - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 1) draw_layer(DrvVidRAM0, DrvGfxROM3, DrvVidRAM2 + 0x3c0, 0, 0xc00, 0); - if (nBurnLayer & 2) draw_layer(DrvVidRAM1, DrvGfxROM2, DrvVidRAM2 + 0x3e0, 0, 0xc00, 0); - if (nBurnLayer & 4) draw_layer(DrvVidRAM2, DrvGfxROM0, NULL, 0x400, 0, 0); - break; - - case 3: - if (nBurnLayer & 2) draw_layer(DrvVidRAM1, DrvGfxROM2, DrvVidRAM2 + 0x3e0, 0, 0xc00, 0); - if (nBurnLayer & 4) draw_layer(DrvVidRAM2, DrvGfxROM0, NULL, 0x400, 0, 0); - if (nSpriteEnable & 1) draw_sprites(); - break; - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 120) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 3072000 / 60, 3072000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(((nCyclesTotal[0] * (i + 1)) / nInterleave) - nCyclesDone[0]); - if (i == (nInterleave - 1) && nmi_mask) ZetNmi(); - ZetClose(); - - if (sound_reset) - { - nCyclesDone[1] += ((nCyclesTotal[1] * (i + 1)) / nInterleave) - nCyclesDone[1]; - } - else - { - ZetOpen(1); - nCyclesDone[1] += ZetRun(((nCyclesTotal[1] * (i + 1)) / nInterleave) - nCyclesDone[1]); - if ((i % (nInterleave / 4)) == ((nInterleave / 4) - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - SCAN_VAR(nmi_mask); - SCAN_VAR(sprite_priority); - SCAN_VAR(sound_reset); - } - - return 0; -} - - -// Vastar (set 1) - -static struct BurnRomInfo vastarRomDesc[] = { - { "e_f4.rom", 0x1000, 0x45fa5075, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "e_k4.rom", 0x1000, 0x84531982, 1 | BRF_PRG | BRF_ESS }, // 1 - { "e_h4.rom", 0x1000, 0x94a4f778, 1 | BRF_PRG | BRF_ESS }, // 2 - { "e_l4.rom", 0x1000, 0x40e4d57b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "e_j4.rom", 0x1000, 0xbd607651, 1 | BRF_PRG | BRF_ESS }, // 4 - { "e_n4.rom", 0x1000, 0x7a3779a4, 1 | BRF_PRG | BRF_ESS }, // 5 - { "e_n7.rom", 0x1000, 0x31b6be39, 1 | BRF_PRG | BRF_ESS }, // 6 - { "e_n5.rom", 0x1000, 0xf63f0e78, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "e_f2.rom", 0x1000, 0x713478d8, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - { "e_j2.rom", 0x1000, 0xe4535442, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "c_c9.rom", 0x2000, 0x34f067b6, 3 | BRF_GRA }, // 10 Foreground Tiles - - { "c_f7.rom", 0x2000, 0xedbf3b13, 4 | BRF_GRA }, // 11 Sprites - { "c_f9.rom", 0x2000, 0x8f309e22, 4 | BRF_GRA }, // 12 - - { "c_n4.rom", 0x2000, 0xb5f9c866, 5 | BRF_GRA }, // 13 Background #2 Tiles - - { "c_s4.rom", 0x2000, 0xc9fbbfc9, 6 | BRF_GRA }, // 14 Background #1 Tiles - - { "tbp24s10.6p", 0x0100, 0xa712d73a, 7 | BRF_GRA }, // 15 Color PROMs - { "tbp24s10.6s", 0x0100, 0x0a7d48ec, 7 | BRF_GRA }, // 16 - { "tbp24s10.6m", 0x0100, 0x4c3db907, 7 | BRF_GRA }, // 17 - - { "tbp24s10.8n", 0x0100, 0xb5297a3b, 8 | BRF_GRA }, // 18 Unknown PROM -}; - -STD_ROM_PICK(vastar) -STD_ROM_FN(vastar) - -static INT32 vastarInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvVastar = { - "vastar", NULL, NULL, NULL, "1983", - "Vastar (set 1)\0", NULL, "Sesame Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, vastarRomInfo, vastarRomName, NULL, NULL, VastarInputInfo, VastarDIPInfo, - vastarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Vastar (set 2) - -static struct BurnRomInfo vastar2RomDesc[] = { - { "3.4f", 0x1000, 0x6741ff9c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "6.4k", 0x1000, 0x5027619b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4.4h", 0x1000, 0xfdaa44e6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "7.4l", 0x1000, 0x29bef91c, 1 | BRF_PRG | BRF_ESS }, // 3 - { "5.4j", 0x1000, 0xc17c2458, 1 | BRF_PRG | BRF_ESS }, // 4 - { "8.4n", 0x1000, 0x8ca25c37, 1 | BRF_PRG | BRF_ESS }, // 5 - { "10.6n", 0x1000, 0x80df74ba, 1 | BRF_PRG | BRF_ESS }, // 6 - { "9.5n", 0x1000, 0x239ec84e, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "e_f2.rom", 0x1000, 0x713478d8, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - { "e_j2.rom", 0x1000, 0xe4535442, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "c_c9.rom", 0x2000, 0x34f067b6, 3 | BRF_GRA }, // 10 Foreground Tiles - - { "c_f7.rom", 0x2000, 0xedbf3b13, 4 | BRF_GRA }, // 11 Sprites - { "c_f9.rom", 0x2000, 0x8f309e22, 4 | BRF_GRA }, // 12 - - { "c_n4.rom", 0x2000, 0xb5f9c866, 5 | BRF_GRA }, // 13 Background #2 Tiles - - { "c_s4.rom", 0x2000, 0xc9fbbfc9, 6 | BRF_GRA }, // 14 Background #1 Tiles - - { "tbp24s10.6p", 0x0100, 0xa712d73a, 7 | BRF_GRA }, // 15 Color PROMs - { "tbp24s10.6s", 0x0100, 0x0a7d48ec, 7 | BRF_GRA }, // 16 - { "tbp24s10.6m", 0x0100, 0x4c3db907, 7 | BRF_GRA }, // 17 - - { "tbp24s10.8n", 0x0100, 0xb5297a3b, 8 | BRF_OPT }, // 18 Unknown PROM -}; - -STD_ROM_PICK(vastar2) -STD_ROM_FN(vastar2) - -struct BurnDriver BurnDrvVastar2 = { - "vastar2", "vastar", NULL, NULL, "1983", - "Vastar (set 2)\0", NULL, "Sesame Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, vastar2RomInfo, vastar2RomName, NULL, NULL, VastarInputInfo, VastarDIPInfo, - vastarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Vastar (set 3) - -static struct BurnRomInfo vastar3RomDesc[] = { - { "vst_2.4f", 0x2000, 0xad4e512a, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "vst_3.4h", 0x2000, 0x2276c5d0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "vst_4.4j", 0x2000, 0xdeca2aa1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "vst_5.6n", 0x2000, 0x743ed1c7, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "vst_0.2f", 0x1000, 0x713478d8, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - { "vst_1.2j", 0x1000, 0xe4535442, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "c_c9.rom", 0x2000, 0x34f067b6, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "c_f7.rom", 0x2000, 0xedbf3b13, 4 | BRF_GRA }, // 7 Sprites - { "c_f9.rom", 0x2000, 0x8f309e22, 4 | BRF_GRA }, // 8 - - { "c_n4.rom", 0x2000, 0xb5f9c866, 5 | BRF_GRA }, // 9 Background #2 Tiles - - { "c_s4.rom", 0x2000, 0xc9fbbfc9, 6 | BRF_GRA }, // 10 Background #1 Tiles - - { "tbp24s10.6p", 0x0100, 0xa712d73a, 7 | BRF_GRA }, // 11 Color PROMs - { "tbp24s10.6s", 0x0100, 0x0a7d48ec, 7 | BRF_GRA }, // 12 - { "tbp24s10.6m", 0x0100, 0x4c3db907, 7 | BRF_GRA }, // 13 - - { "tbp24s10.8n", 0x0100, 0xb5297a3b, 8 | BRF_OPT }, // 14 Unknown PROM -}; - -STD_ROM_PICK(vastar3) -STD_ROM_FN(vastar3) - -static INT32 vastar3Init() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvVastar3 = { - "vastar3", "vastar", NULL, NULL, "1983", - "Vastar (set 3)\0", NULL, "Sesame Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, vastar3RomInfo, vastar3RomName, NULL, NULL, VastarInputInfo, VastarDIPInfo, - vastar3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Vastar (set 4) - -static struct BurnRomInfo vastar4RomDesc[] = { - { "3.bin", 0x1000, 0xd2b8f177, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "e_k4.rom", 0x1000, 0x84531982, 1 | BRF_PRG | BRF_ESS }, // 1 - { "e_h4.rom", 0x1000, 0x94a4f778, 1 | BRF_PRG | BRF_ESS }, // 2 - { "e_l4.rom", 0x1000, 0x40e4d57b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "e_j4.rom", 0x1000, 0xbd607651, 1 | BRF_PRG | BRF_ESS }, // 4 - { "e_n4.rom", 0x1000, 0x7a3779a4, 1 | BRF_PRG | BRF_ESS }, // 5 - { "e_n7.rom", 0x1000, 0x31b6be39, 1 | BRF_PRG | BRF_ESS }, // 6 - { "e_n5.rom", 0x1000, 0xf63f0e78, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "e_f2.rom", 0x1000, 0x713478d8, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 #1 Code - { "e_j2.rom", 0x1000, 0xe4535442, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "c_c9.rom", 0x2000, 0x34f067b6, 3 | BRF_GRA }, // 10 Foreground Tiles - - { "c_f7.rom", 0x2000, 0xedbf3b13, 4 | BRF_GRA }, // 11 Sprites - { "c_f9.rom", 0x2000, 0x8f309e22, 4 | BRF_GRA }, // 12 - - { "c_n4.rom", 0x2000, 0xb5f9c866, 5 | BRF_GRA }, // 13 Background #2 Tiles - - { "c_s4.rom", 0x2000, 0xc9fbbfc9, 6 | BRF_GRA }, // 14 Background #1 Tiles - - { "tbp24s10.6p", 0x0100, 0xa712d73a, 7 | BRF_GRA }, // 15 Color PROMs - { "tbp24s10.6s", 0x0100, 0x0a7d48ec, 7 | BRF_GRA }, // 16 - { "tbp24s10.6m", 0x0100, 0x4c3db907, 7 | BRF_GRA }, // 17 - - { "tbp24s10.8n", 0x0100, 0xb5297a3b, 8 | BRF_OPT }, // 18 Unknown PROM -}; - -STD_ROM_PICK(vastar4) -STD_ROM_FN(vastar4) - -struct BurnDriver BurnDrvVastar4 = { - "vastar4", "vastar", NULL, NULL, "1983", - "Vastar (set 4)\0", NULL, "Sesame Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, vastar4RomInfo, vastar4RomName, NULL, NULL, VastarInputInfo, Vastar4DIPInfo, - vastarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; - - -// Planet Probe (prototype?) - -static struct BurnRomInfo pprobeRomDesc[] = { - { "pb2.bin", 0x2000, 0xa88592aa, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "pb3.bin", 0x2000, 0xe4e20f74, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pb4.bin", 0x2000, 0x4e40e3fe, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pb5.bin", 0x2000, 0xb26ff0fd, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "pb1.bin", 0x2000, 0xcd624df9, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - - { "pb9.bin", 0x2000, 0x82294dd6, 3 | BRF_GRA }, // 5 Foreground Tiles - - { "pb8.bin", 0x2000, 0x8d809e45, 4 | BRF_GRA }, // 6 Sprites - { "pb10.bin", 0x2000, 0x895f9dd3, 4 | BRF_GRA }, // 7 - - { "pb6.bin", 0x2000, 0xff309239, 5 | BRF_GRA }, // 8 Background #2 Tiles - - { "pb7.bin", 0x2000, 0x439978f7, 6 | BRF_GRA }, // 9 Background #1 Tiles - - { "n82s129.3", 0x0100, 0xdfb6b97c, 7 | BRF_GRA }, // 10 Color PROMs - { "n82s129.1", 0x0100, 0x3cc696a2, 7 | BRF_GRA }, // 11 - { "dm74s287.2", 0x0100, 0x64fea033, 7 | BRF_GRA }, // 12 - - { "mmi6301-1.bin", 0x0100, 0xb5297a3b, 8 | BRF_OPT }, // 13 Unknown PROM -}; - -STD_ROM_PICK(pprobe) -STD_ROM_FN(pprobe) - -static INT32 pprobeInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvPprobe = { - "pprobe", NULL, NULL, NULL, "1985", - "Planet Probe (prototype?)\0", NULL, "Crux / Kyugo?", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, pprobeRomInfo, pprobeRomName, NULL, NULL, PprobeInputInfo, PprobeDIPInfo, - pprobeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_vulgus.cpp b/jan/src/burn/drv/pre90s/d_vulgus.cpp deleted file mode 100644 index 7b3bde41e..000000000 --- a/jan/src/burn/drv/pre90s/d_vulgus.cpp +++ /dev/null @@ -1,805 +0,0 @@ -// FB Alpha Vulgus drive module -// Based on MAME driver by Mirko Buffoni - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *Mem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvSprRAM; - -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT16 scroll[2]; -static INT32 palette_bank; - -static UINT8 DrvInputs[5]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 7, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 6, "p2 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 0, "p1 right" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 1, "p1 left" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy2 + 2, "p1 down" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy2 + 3, "p1 up" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 0, "p2 right" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 1, "p2 left" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 2, "p2 down" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 3, "p2 up" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p2 fire 2"}, - - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvInputs + 3, "dip 1" }, - {"Dip 2" , BIT_DIPSWITCH, DrvInputs + 4, "dip 2" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x03, 0x01, "1" }, - {0x11, 0x01, 0x03, 0x02, "2" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 7 , "Coin B" }, - {0x11, 0x01, 0x1c, 0x10, "5 Coins 1 Play" }, - {0x11, 0x01, 0x1c, 0x08, "4 Coins 1 Play" }, - {0x11, 0x01, 0x1c, 0x18, "3 Coins 1 Play" }, - {0x11, 0x01, 0x1c, 0x04, "2 Coins 1 Play" }, - {0x11, 0x01, 0x1c, 0x1c, "1 Coin 1 Play" }, - {0x11, 0x01, 0x1c, 0x0c, "1 Coin 2 Plays" }, - {0x11, 0x01, 0x1c, 0x14, "1 Coin 3 Plays" }, -// {0x11, 0x01, 0x1c, 0x00, "Invalid" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x11, 0x01, 0xe0, 0x80, "5 Coins 1 Play" }, - {0x11, 0x01, 0xe0, 0x40, "4 Coins 1 Play" }, - {0x11, 0x01, 0xe0, 0xc0, "3 Coins 1 Play" }, - {0x11, 0x01, 0xe0, 0x20, "2 Coins 1 Play" }, - {0x11, 0x01, 0xe0, 0xe0, "1 Coin 1 Play" }, - {0x11, 0x01, 0xe0, 0x60, "1 Coin 2 Plays" }, - {0x11, 0x01, 0xe0, 0xa0, "1 Coin 3 Plays" }, - {0x11, 0x01, 0xe0, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 4 , "Difficulty?" }, - {0x12, 0x01, 0x03, 0x02, "Easy?" }, - {0x12, 0x01, 0x03, 0x03, "Normal?" }, - {0x12, 0x01, 0x03, 0x01, "Hard?" }, - {0x12, 0x01, 0x03, 0x00, "Hardest?" }, - - {0 , 0xfe, 0 , 2 , "Demo Music" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x12, 0x01, 0x70, 0x30, "10000 50000" }, - {0x12, 0x01, 0x70, 0x50, "10000 60000" }, - {0x12, 0x01, 0x70, 0x10, "10000 70000" }, - {0x12, 0x01, 0x70, 0x70, "20000 60000" }, - {0x12, 0x01, 0x70, 0x60, "20000 70000" }, - {0x12, 0x01, 0x70, 0x20, "20000 80000" }, - {0x12, 0x01, 0x70, 0x40, "30000 70000" }, - {0x12, 0x01, 0x70, 0x00, "None" }, - - {0 , 0xfe, 0 , 1 , "Cabinet" }, - {0x12, 0x01, 0x80, 0x00, "Upright" }, -// {0x12, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Drv) - -static void __fastcall vulgus_write_main(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc800: - soundlatch = data; - break; - - case 0xc802: - case 0xc803: - scroll[address & 1] = (scroll[address & 1] & 0x100) | data; - break; - - case 0xc804: - flipscreen = data & 0x80; - break; - - case 0xc805: - palette_bank = data & 3; - break; - - case 0xc902: - case 0xc903: - scroll[address & 1] = (scroll[address & 1] & 0x0ff) | ((data & 1) << 8); - break; - } -} - -static UINT8 __fastcall vulgus_read_main(UINT16 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - case 0xc002: - case 0xc003: - case 0xc004: - return DrvInputs[address - 0xc000]; - } - - return 0; -} - -static void __fastcall vulgus_write_sound(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8000: - case 0x8001: - case 0xc000: - case 0xc001: - AY8910Write((address >> 14) & 1, address & 1, data); - break; - } -} - -static UINT8 __fastcall vulgus_read_sound(UINT16 address) -{ - switch (address) - { - case 0x6000: - return soundlatch; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - AY8910Reset(0); - AY8910Reset(1); - ZetClose(); - - flipscreen = 0; - soundlatch = 0; - palette_bank = 0; - - scroll[0] = 0; - scroll[1] = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next = Mem; - - DrvZ80ROM0 = Next; Next += 0x0a000; - DrvZ80ROM1 = Next; Next += 0x02000; - DrvGfxROM0 = Next; Next += 0x08000; - DrvGfxROM1 = Next; Next += 0x20000; - DrvGfxROM2 = Next; Next += 0x10000; - DrvColPROM = Next; Next += 0x00600; - - DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x01000; - DrvZ80RAM1 = Next; Next += 0x00800; - DrvSprRAM = Next; Next += 0x00100; - DrvFgRAM = Next; Next += 0x00800; - DrvBgRAM = Next; Next += 0x00800; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[1] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[2] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[3] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[4] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[5] = (INT16*) Next; Next += nBurnSoundLen; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); - if (tmp == NULL) { - return 1; - } - - INT32 SpriPlanes[4] = { 0x20004, 0x20000, 0x00004, 0x00000 }; - INT32 SpriXOffs[16] = { STEP4(0,1), STEP4(8,1), STEP4(256,1), STEP4(264,1) }; - INT32 SpriYOffs[16] = { STEP16(0,16) }; - - INT32 TilePlanes[3] = { 0x00000, 0x20000, 0x40000 }; - INT32 TileXOffs[16] = { STEP8(0,1), STEP8(128,1) }; - INT32 TileYOffs[16] = { STEP16(0,8) }; - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x200, 2, 8, 8, SpriPlanes + 2, SpriXOffs, SpriYOffs, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0xc000); - - GfxDecode(0x200, 3, 16, 16, TilePlanes + 0, TileXOffs, TileYOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x8000); - - GfxDecode(0x100, 4, 16, 16, SpriPlanes + 0, SpriXOffs, SpriYOffs, 0x200, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x6000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x8000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x6000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x8000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xa000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x2000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x4000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x6000, 16, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 17, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 18, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0200, 19, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0300, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0400, 21, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0500, 22, 1)) return 1; - - if (DrvGfxDecode()) return 1; - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x9fff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xcc00, 0xccff, MAP_RAM); - ZetMapMemory(DrvFgRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvBgRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xe000, 0xefff, MAP_RAM); - ZetSetWriteHandler(vulgus_write_main); - ZetSetReadHandler(vulgus_read_main); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x1fff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0x4000, 0x47ff, MAP_RAM); - ZetSetWriteHandler(vulgus_write_sound); - ZetSetReadHandler(vulgus_read_sound); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - - AY8910Exit(0); - AY8910Exit(1); - - GenericTilesExit(); - - BurnFree (Mem); - - return 0; -} - -static INT32 DrvPaletteInit() -{ - UINT32 tmp[0x100]; - - for (INT32 i = 0; i < 256; i++) - { - INT32 bit0,bit1,bit2,bit3,r,g,b; - - bit0 = (DrvColPROM[ 0 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[ 0 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[ 0 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[ 0 + i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[256 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[256 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[256 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[256 + i] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[512 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[512 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[512 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[512 + i] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - tmp[i] = BurnHighCol(r,g,b,0); - } - - for (INT32 i = 0; i < 0x100; i++) { - DrvPalette[i] = tmp[32 + DrvColPROM[0x300 + i]]; - } - - for (INT32 i = 0; i < 0x100; i++) { - DrvPalette[0x100 + i] = tmp[16 + DrvColPROM[0x400 + i]]; - } - - for (INT32 i = 0; i < 0x100; i++) { - DrvPalette[0x400 + i] = tmp[DrvColPROM[0x500 + i] + 0x00]; - DrvPalette[0x500 + i] = tmp[DrvColPROM[0x500 + i] + 0x40]; - DrvPalette[0x600 + i] = tmp[DrvColPROM[0x500 + i] + 0x80]; - DrvPalette[0x700 + i] = tmp[DrvColPROM[0x500 + i] + 0xc0]; - } - - return 0; -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = ((offs / 32) * 16) - scroll[1]; - INT32 sy = ((offs & 31) * 16) - scroll[0]; - - if (sx < -15) sx += 512; - if (sy < -15) sy += 512; - - INT32 color = DrvBgRAM[0x400 + offs]; - INT32 code = DrvBgRAM[0x000 + offs] | ((color & 0x80) << 1); - - INT32 flipx = color & 0x20; - INT32 flipy = color & 0x40; - - color = (color & 0x1f) | (palette_bank << 5); - - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 3, 0x400, DrvGfxROM1); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 3, 0x400, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 3, 0x400, DrvGfxROM1); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy - 16, color, 3, 0x400, DrvGfxROM1); - } - } - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 2 * 32; offs < (32 * 32) - (2 * 32); offs++) - { - INT32 sx = (offs & 31) * 8; - INT32 sy = ((offs / 32) * 8) - 16; - - INT32 color = DrvFgRAM[0x400 + offs]; - INT32 code = DrvFgRAM[0x000 + offs] | ((color & 0x80) << 1); - - RenderTileTranstab(pTransDraw, DrvGfxROM0, code, (color&0x3f)<<2, 0xf, sx, sy, 0, 0, 8, 8, DrvColPROM + 0x300); - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x80 - 4; offs >= 0; offs -= 4) - { - INT32 code = DrvSprRAM[0x00 + offs]; - INT32 color = DrvSprRAM[0x01 + offs] & 0x0f; - INT32 sx = DrvSprRAM[0x03 + offs]; - INT32 sy = DrvSprRAM[0x02 + offs]; - - INT32 i = (DrvSprRAM[0x01 + offs] >> 6) & 3; - if (i == 2) i = 3; - - for (; i >= 0; i--) { - INT32 ssy = (sy + (i * 16)) - 16; - Render16x16Tile_Mask_Clip(pTransDraw, code + i, sx, ssy, color, 4, 0x0f, 0x100, DrvGfxROM2); - if (ssy > 240) { // wrap - Render16x16Tile_Mask_Clip(pTransDraw, code + i, sx, ssy - 256, color, 4, 0x0f, 0x100, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_bg_layer(); - draw_sprites(); - draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 8; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 3000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == ((nInterleave / 2) - 1)) { - ZetSetVector(0xd7); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - if (i == ( nInterleave - 1)) { - ZetSetVector(0xcf); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] -= ZetRun(nCyclesTotal[1] / nInterleave); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(palette_bank); - SCAN_VAR(scroll[0]); - SCAN_VAR(scroll[1]); - } - - return 0; -} - - -// Vulgus (set 1) - -static struct BurnRomInfo vulgusRomDesc[] = { - { "vulgus.002", 0x2000, 0xe49d6c5d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "vulgus.003", 0x2000, 0x51acef76, 1 | BRF_PRG | BRF_ESS }, // 1 - { "vulgus.004", 0x2000, 0x489e7f60, 1 | BRF_PRG | BRF_ESS }, // 2 - { "vulgus.005", 0x2000, 0xde3a24a8, 1 | BRF_PRG | BRF_ESS }, // 3 - { "1-8n.bin", 0x2000, 0x6ca5ca41, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "1-11c.bin", 0x2000, 0x3bd2acf4, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "1-3d.bin", 0x2000, 0x8bc5d7a5, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "2-2a.bin", 0x2000, 0xe10aaca1, 4 | BRF_GRA }, // 7 Background Tiles - { "2-3a.bin", 0x2000, 0x8da520da, 4 | BRF_GRA }, // 8 - { "2-4a.bin", 0x2000, 0x206a13f1, 4 | BRF_GRA }, // 9 - { "2-5a.bin", 0x2000, 0xb6d81984, 4 | BRF_GRA }, // 10 - { "2-6a.bin", 0x2000, 0x5a26b38f, 4 | BRF_GRA }, // 11 - { "2-7a.bin", 0x2000, 0x1e1ca773, 4 | BRF_GRA }, // 12 - - { "2-2n.bin", 0x2000, 0x6db1b10d, 5 | BRF_GRA }, // 13 Sprites - { "2-3n.bin", 0x2000, 0x5d8c34ec, 5 | BRF_GRA }, // 14 - { "2-4n.bin", 0x2000, 0x0071a2e3, 5 | BRF_GRA }, // 15 - { "2-5n.bin", 0x2000, 0x4023a1ec, 5 | BRF_GRA }, // 16 - - { "e8.bin", 0x0100, 0x06a83606, 6 | BRF_GRA }, // 17 Color DrvColPROMs - { "e9.bin", 0x0100, 0xbeacf13c, 6 | BRF_GRA }, // 18 - { "e10.bin", 0x0100, 0xde1fb621, 6 | BRF_GRA }, // 19 - { "d1.bin", 0x0100, 0x7179080d, 6 | BRF_GRA }, // 20 - { "j2.bin", 0x0100, 0xd0842029, 6 | BRF_GRA }, // 21 - { "c9.bin", 0x0100, 0x7a1f0bd6, 6 | BRF_GRA }, // 22 - - { "82s126.9k", 0x0100, 0x32b10521, 0 | BRF_OPT }, // 23 Misc. DrvColPROMs - { "82s129.8n", 0x0100, 0x4921635c, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(vulgus) -STD_ROM_FN(vulgus) - -struct BurnDriver BurnDrvvulgus = { - "vulgus", NULL, NULL, NULL, "1984", - "Vulgus (set 1)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, vulgusRomInfo, vulgusRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Vulgus (set 2) - -static struct BurnRomInfo vulgusaRomDesc[] = { - { "v2", 0x2000, 0x3e18ff62, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "v3", 0x2000, 0xb4650d82, 1 | BRF_PRG | BRF_ESS }, // 1 - { "v4", 0x2000, 0x5b26355c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "v5", 0x2000, 0x4ca7f10e, 1 | BRF_PRG | BRF_ESS }, // 3 - { "1-8n.bin", 0x2000, 0x6ca5ca41, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "1-11c.bin", 0x2000, 0x3bd2acf4, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "1-3d.bin", 0x2000, 0x8bc5d7a5, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "2-2a.bin", 0x2000, 0xe10aaca1, 4 | BRF_GRA }, // 7 Background Tiles - { "2-3a.bin", 0x2000, 0x8da520da, 4 | BRF_GRA }, // 8 - { "2-4a.bin", 0x2000, 0x206a13f1, 4 | BRF_GRA }, // 9 - { "2-5a.bin", 0x2000, 0xb6d81984, 4 | BRF_GRA }, // 10 - { "2-6a.bin", 0x2000, 0x5a26b38f, 4 | BRF_GRA }, // 11 - { "2-7a.bin", 0x2000, 0x1e1ca773, 4 | BRF_GRA }, // 12 - - { "2-2n.bin", 0x2000, 0x6db1b10d, 5 | BRF_GRA }, // 13 Sprites - { "2-3n.bin", 0x2000, 0x5d8c34ec, 5 | BRF_GRA }, // 14 - { "2-4n.bin", 0x2000, 0x0071a2e3, 5 | BRF_GRA }, // 15 - { "2-5n.bin", 0x2000, 0x4023a1ec, 5 | BRF_GRA }, // 16 - - { "e8.bin", 0x0100, 0x06a83606, 6 | BRF_GRA }, // 17 Color DrvColPROMs - { "e9.bin", 0x0100, 0xbeacf13c, 6 | BRF_GRA }, // 18 - { "e10.bin", 0x0100, 0xde1fb621, 6 | BRF_GRA }, // 19 - { "d1.bin", 0x0100, 0x7179080d, 6 | BRF_GRA }, // 20 - { "j2.bin", 0x0100, 0xd0842029, 6 | BRF_GRA }, // 21 - { "c9.bin", 0x0100, 0x7a1f0bd6, 6 | BRF_GRA }, // 22 - - { "82s126.9k", 0x0100, 0x32b10521, 0 | BRF_OPT }, // 23 Misc. DrvColPROMs - { "82s129.8n", 0x0100, 0x4921635c, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(vulgusa) -STD_ROM_FN(vulgusa) - -struct BurnDriver BurnDrvvulgusa = { - "vulgusa", "vulgus", NULL, NULL, "1984", - "Vulgus (set 2)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, vulgusaRomInfo, vulgusaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Vulgus (Japan) - -static struct BurnRomInfo vulgusjRomDesc[] = { - { "1-4n.bin", 0x2000, 0xfe5a5ca5, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "1-5n.bin", 0x2000, 0x847e437f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "1-6n.bin", 0x2000, 0x4666c436, 1 | BRF_PRG | BRF_ESS }, // 2 - { "1-7n.bin", 0x2000, 0xff2097f9, 1 | BRF_PRG | BRF_ESS }, // 3 - { "1-8n.bin", 0x2000, 0x6ca5ca41, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "1-11c.bin", 0x2000, 0x3bd2acf4, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "1-3d.bin", 0x2000, 0x8bc5d7a5, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "2-2a.bin", 0x2000, 0xe10aaca1, 4 | BRF_GRA }, // 7 Background Tiles - { "2-3a.bin", 0x2000, 0x8da520da, 4 | BRF_GRA }, // 8 - { "2-4a.bin", 0x2000, 0x206a13f1, 4 | BRF_GRA }, // 9 - { "2-5a.bin", 0x2000, 0xb6d81984, 4 | BRF_GRA }, // 10 - { "2-6a.bin", 0x2000, 0x5a26b38f, 4 | BRF_GRA }, // 11 - { "2-7a.bin", 0x2000, 0x1e1ca773, 4 | BRF_GRA }, // 12 - - { "2-2n.bin", 0x2000, 0x6db1b10d, 5 | BRF_GRA }, // 13 Sprites - { "2-3n.bin", 0x2000, 0x5d8c34ec, 5 | BRF_GRA }, // 14 - { "2-4n.bin", 0x2000, 0x0071a2e3, 5 | BRF_GRA }, // 15 - { "2-5n.bin", 0x2000, 0x4023a1ec, 5 | BRF_GRA }, // 16 - - { "e8.bin", 0x0100, 0x06a83606, 6 | BRF_GRA }, // 17 Color DrvColPROMs - { "e9.bin", 0x0100, 0xbeacf13c, 6 | BRF_GRA }, // 18 - { "e10.bin", 0x0100, 0xde1fb621, 6 | BRF_GRA }, // 19 - { "d1.bin", 0x0100, 0x7179080d, 6 | BRF_GRA }, // 20 - { "j2.bin", 0x0100, 0xd0842029, 6 | BRF_GRA }, // 21 - { "c9.bin", 0x0100, 0x7a1f0bd6, 6 | BRF_GRA }, // 22 - - { "82s126.9k", 0x0100, 0x32b10521, 0 | BRF_OPT }, // 23 Misc. DrvColPROMs - { "82s129.8n", 0x0100, 0x4921635c, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(vulgusj) -STD_ROM_FN(vulgusj) - -struct BurnDriver BurnDrvvulgusj = { - "vulgusj", "vulgus", NULL, NULL, "1984", - "Vulgus (Japan?)\0", NULL, "Capcom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, vulgusjRomInfo, vulgusjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Mach-9 (bootleg of Vulgus) - -static struct BurnRomInfo mach9RomDesc[] = { - { "02_4n.bin", 0x2000, 0xb3310b0c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "03_5n.bin", 0x2000, 0x51acef76, 1 | BRF_PRG | BRF_ESS }, // 1 - { "04_6n.bin", 0x2000, 0x489e7f60, 1 | BRF_PRG | BRF_ESS }, // 2 - { "05_7n.bin", 0x2000, 0xef3e4278, 1 | BRF_PRG | BRF_ESS }, // 3 - { "06_8n.bin", 0x2000, 0x6ca5ca41, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "07_11c.bin", 0x2000, 0x3bd2acf4, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "01_3d.bin", 0x2000, 0xbe556775, 3 | BRF_GRA }, // 6 Foreground Tiles - - { "08_2a.bin", 0x2000, 0xe10aaca1, 4 | BRF_GRA }, // 7 Background Tiles - { "09_3a.bin", 0x2000, 0x9193f2f1, 4 | BRF_GRA }, // 8 - { "10_4a.bin", 0x2000, 0x206a13f1, 4 | BRF_GRA }, // 9 - { "11_5a.bin", 0x2000, 0xd729b5b7, 4 | BRF_GRA }, // 10 - { "12_6a.bin", 0x2000, 0x5a26b38f, 4 | BRF_GRA }, // 11 - { "13_7a.bin", 0x2000, 0x8033cd4f, 4 | BRF_GRA }, // 12 - - { "14_2n.bin", 0x2000, 0x6db1b10d, 5 | BRF_GRA }, // 13 Sprites - { "15_3n.bin", 0x2000, 0x5d8c34ec, 5 | BRF_GRA }, // 14 - { "16_4n.bin", 0x2000, 0x0071a2e3, 5 | BRF_GRA }, // 15 - { "17_5n.bin", 0x2000, 0x4023a1ec, 5 | BRF_GRA }, // 16 - - { "82s129_8e.bin", 0x0100, 0x06a83606, 6 | BRF_GRA }, // 17 Color DrvColPROMs - { "82s129_9e.bin", 0x0100, 0xbeacf13c, 6 | BRF_GRA }, // 18 - { "82s129_10e.bin", 0x0100, 0x8404067c, 6 | BRF_GRA }, // 19 - { "82s129_1d.bin", 0x0100, 0x7179080d, 6 | BRF_GRA }, // 20 - { "82s129_2j.bin", 0x0100, 0xd0842029, 6 | BRF_GRA }, // 21 - { "82s129_9c.bin", 0x0100, 0x7a1f0bd6, 6 | BRF_GRA }, // 22 - - { "82s129_9k.bin", 0x0100, 0x32b10521, 0 | BRF_OPT }, // 23 Misc. DrvColPROMs - { "82s129_8n.bin", 0x0100, 0x4921635c, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(mach9) -STD_ROM_FN(mach9) - -struct BurnDriver BurnDrvmach9 = { - "mach9", "vulgus", NULL, NULL, "1984", - "Mach-9 (bootleg of Vulgus)\0", NULL, "bootleg (ITISA)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARWARE_CAPCOM_MISC, GBF_VERSHOOT, 0, - NULL, mach9RomInfo, mach9RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; \ No newline at end of file diff --git a/jan/src/burn/drv/pre90s/d_wallc.cpp b/jan/src/burn/drv/pre90s/d_wallc.cpp deleted file mode 100644 index 939431807..000000000 --- a/jan/src/burn/drv/pre90s/d_wallc.cpp +++ /dev/null @@ -1,452 +0,0 @@ -// FB Alpha Wall Crash driver module -// Based on MAME driver by Jarek Burczynski - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "bitswap.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static UINT8 Dial1; - -static struct BurnInputInfo WallcInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 2" }, - - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Wallc) - -static struct BurnDIPInfo WallcDIPList[]= -{ - {0x08, 0xff, 0xff, 0x55, NULL }, - {0x09, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x08, 0x01, 0x03, 0x03, "5" }, - {0x08, 0x01, 0x03, 0x02, "4" }, - {0x08, 0x01, 0x03, 0x01, "3" }, - {0x08, 0x01, 0x03, 0x00, "2" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x08, 0x01, 0x0c, 0x0c, "100K/200K/400K/800K" }, - {0x08, 0x01, 0x0c, 0x08, "80K/160K/320K/640K" }, - {0x08, 0x01, 0x0c, 0x04, "60K/120K/240K/480K" }, - {0x08, 0x01, 0x0c, 0x00, "Off" }, - - {0 , 0xfe, 0 , 2 , "Curve Effect" }, - {0x08, 0x01, 0x10, 0x10, "Normal" }, - {0x08, 0x01, 0x10, 0x00, "More" }, - - {0 , 0xfe, 0 , 4 , "Timer Speed" }, - {0x08, 0x01, 0x60, 0x60, "Slow" }, - {0x08, 0x01, 0x60, 0x40, "Normal" }, - {0x08, 0x01, 0x60, 0x20, "Fast" }, - {0x08, 0x01, 0x60, 0x00, "Super Fast" }, - - {0 , 0xfe, 0 , 2 , "Service" }, - {0x08, 0x01, 0x80, 0x80, "Free Play and Level Select" }, - {0x08, 0x01, 0x80, 0x00, "Normal" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x09, 0x01, 0x03, 0x03, "2C 1C" }, - {0x09, 0x01, 0x03, 0x00, "1C 1C" }, - {0x09, 0x01, 0x03, 0x01, "1C 2C" }, - {0x09, 0x01, 0x03, 0x02, "1C 5C" }, -}; - -STDDIPINFO(Wallc) - -void __fastcall wallc_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xb500: - AY8910Write(0, 0, data); - break; - - case 0xb600: - AY8910Write(0, 1, data); - break; - } -} - -UINT8 __fastcall wallc_read(UINT16 address) -{ - switch (address) - { - case 0xb000: - return DrvDips[0]; - - case 0xb200: - return DrvInputs[0]; - - case 0xb400: - return DrvInputs[1]; - - case 0xb600: - return DrvDips[1]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - Dial1 = 0; - - memset(AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { 0x04000, 0x0c000, 0x14000 }; - INT32 XOffs[8] = { 7, 6, 5, 4, 3, 2, 1, 0 }; - INT32 YOffs[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x3000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM, 0x3000); - - GfxDecode(0x0100, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 8; i < 16; i++) - { - INT32 bit0,bit1,bit7,r,g,b; - - bit0 = (DrvColPROM[i] >> 5) & 0x01; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - r = ((77 * bit1) + (115 * bit0)) + 1; - - bit0 = (DrvColPROM[i] >> 2) & 0x01; - bit1 = (DrvColPROM[i] >> 3) & 0x01; - g = ((77 * bit1) + (115 * bit0)) + 1; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit7 = (DrvColPROM[i] >> 7) & 0x01; - b = ((54 * bit7) + (84 * bit1) + (115 * bit0)); - - DrvPalette[i-8] = BurnHighCol(r,g,b,0); - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM = Next; Next += 0x004000; - - DrvColPROM = Next; Next += 0x000020; - - DrvPalette = (UINT32*)Next; Next += 0x0008 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x000400; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit(INT32 incr) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000 + incr, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000 + incr, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2000 + incr, 4, 1)) return 1; - - if (BurnLoadRom(DrvColPROM, 5, 1)) return 1; - - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0x8000, 0x83ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x8400, 0x87ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x8800, 0x8bff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x8c00, 0x8fff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0xa000, 0xa3ff, MAP_RAM); - - ZetSetWriteHandler(wallc_write); - ZetSetReadHandler(wallc_read); - ZetClose(); - - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - AY8910Exit(0); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 offs = 0; offs < 0x400; offs ++) - { - INT32 sy = (~offs & 0x1f) << 3; - INT32 sx = ( offs >> 5) << 3; - INT32 code = DrvVidRAM[offs]; - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, 0, 0, 0, DrvGfxROM); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0xff; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - - if (DrvJoy2[0]) Dial1 += 0x02; - if (DrvJoy2[1]) Dial1 -= 0x02; - - // bounds 0x50 - 0xcf - if (Dial1 > 0xcf) Dial1 = 0xcf; - if (Dial1 < 0x50) Dial1 = 0x50; - - DrvInputs[1] = Dial1; - - } - - ZetOpen(0); - ZetRun(3000000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetRun(72000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(Dial1); - } - - return 0; -} - - -// Wall Crash (set 1) - -static struct BurnRomInfo wallcRomDesc[] = { - { "wac05.h7", 0x2000, 0xab6e472e, 0 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "wac1-52.h6", 0x2000, 0x988eaa6d, 0 | BRF_ESS | BRF_PRG }, // 1 - - { "wc1.e3", 0x1000, 0xca5c4b53, 1 | BRF_GRA }, // 2 Graphics - { "wc2.e2", 0x1000, 0xb7f52a59, 1 | BRF_GRA }, // 3 - { "wc3.e1", 0x1000, 0xf6854b3a, 1 | BRF_GRA }, // 4 - - { "74s288.c2", 0x0020, 0x83e3e293, 2 | BRF_GRA }, // 5 Color Prom -}; - -STD_ROM_PICK(wallc) -STD_ROM_FN(wallc) - -static void wallcDecode() -{ - for (INT32 i = 0; i < 0x4000; i++) { - DrvZ80ROM[i] = BITSWAP08(DrvZ80ROM[i] ^ 0xaa, 4,2,6,0,7,1,3,5); - } -} - -static INT32 wallcInit() -{ - INT32 nRet = DrvInit(0); - - if (nRet == 0) { - wallcDecode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvWallc = { - "wallc", NULL, NULL, NULL, "1984", - "Wall Crash (set 1)\0", NULL, "Midcoin", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, wallcRomInfo, wallcRomName, NULL, NULL, WallcInputInfo, WallcDIPInfo, - wallcInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x08, - 256, 256, 4, 3 -}; - - -// Wall Crash (set 2) - -static struct BurnRomInfo wallcaRomDesc[] = { - { "rom4.rom", 0x2000, 0xce43af1b, 0 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "rom5.rom", 0x2000, 0xb789a705, 0 | BRF_ESS | BRF_PRG }, // 1 - - { "rom3.rom", 0x0800, 0x6634db73, 1 | BRF_GRA }, // 2 Graphics - { "rom2.rom", 0x0800, 0x79f49c2c, 1 | BRF_GRA }, // 3 - { "rom1.rom", 0x0800, 0x3884fd4f, 1 | BRF_GRA }, // 4 - - { "74s288.c2", 0x0020, 0x83e3e293, 2 | BRF_GRA }, // 5 Color Prom -}; - -STD_ROM_PICK(wallca) -STD_ROM_FN(wallca) - -static void wallcaDecode() -{ - for (INT32 i = 0; i < 0x4000; i++) { - if (i & 0x100) { - DrvZ80ROM[i] = BITSWAP08(DrvZ80ROM[i] ^ 0x4a, 4,7,1,3,2,0,5,6); - } else { - DrvZ80ROM[i] = BITSWAP08(DrvZ80ROM[i] ^ 0xa5, 0,2,3,6,1,5,7,4); - } - } -} - -static INT32 wallcaInit() -{ - INT32 nRet = DrvInit(0x800); - - if (nRet == 0) { - wallcaDecode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvWallca = { - "wallca", "wallc", NULL, NULL, "1984", - "Wall Crash (set 2)\0", NULL, "Midcoin", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_MISC_PRE90S, GBF_BREAKOUT, 0, - NULL, wallcaRomInfo, wallcaRomName, NULL, NULL, WallcInputInfo, WallcDIPInfo, - wallcaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x08, - 256, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_warpwarp.cpp b/jan/src/burn/drv/pre90s/d_warpwarp.cpp deleted file mode 100644 index c53410299..000000000 --- a/jan/src/burn/drv/pre90s/d_warpwarp.cpp +++ /dev/null @@ -1,1678 +0,0 @@ -// Warp Warp emu-layer for FB Alpha by dink, based on Mirko & Chris Hardy's MAME driver. -// Notes: - -#include "tiles_generic.h" -#include "driver.h" -#include "z80_intf.h" -#include "bitswap.h" -#include - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvGFX1ROM; -static UINT8 *DrvCharGFX; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT32 m_ball_on; -static UINT32 m_ball_h; -static UINT32 m_ball_v; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[5]; -static INT32 DrvAnalogPort0 = 0; -static UINT8 use_paddle = 0; -static UINT8 DrvReset; - -static UINT32 rockola = 0; -static UINT32 navaronemode = 0; -static UINT32 bombbeemode = 0; -static UINT32 kaiteimode = 0; - -static UINT8 ball_size_x; -static UINT8 ball_size_y; -static UINT32 ball_color; -static UINT8 geebee_bgw; - -static struct BurnInputInfo WarpwarpInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 0, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Warpwarp) - - -static struct BurnDIPInfo WarpwarpDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x85, NULL }, - {0x0b, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0a, 0x01, 0x03, 0x03, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x03, 0x01, "1 Coin 1 Credit" }, - {0x0a, 0x01, 0x03, 0x02, "1 Coin 2 Credits"}, - {0x0a, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0a, 0x01, 0x0c, 0x00, "2" }, - {0x0a, 0x01, 0x0c, 0x04, "3" }, - {0x0a, 0x01, 0x0c, 0x08, "4" }, - {0x0a, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0a, 0x01, 0x30, 0x00, "8k 30k 30k+" }, - {0x0a, 0x01, 0x30, 0x10, "10k 40k 40k+" }, - {0x0a, 0x01, 0x30, 0x20, "15k 60k 60k+" }, - {0x0a, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0a, 0x01, 0x40, 0x40, "Off" }, - {0x0a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Level Selection" }, - {0x0a, 0x01, 0x80, 0x80, "Off" }, - {0x0a, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x20, 0x20, "Off" }, - {0x0b, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Warpwarp) - -static struct BurnDIPInfo WarpwarprDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x05, NULL }, - {0x0b, 0xff, 0xff, 0xa0, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0a, 0x01, 0x03, 0x03, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x03, 0x01, "1 Coin 1 Credit" }, - {0x0a, 0x01, 0x03, 0x02, "1 Coin 2 Credits"}, - {0x0a, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0a, 0x01, 0x0c, 0x00, "2" }, - {0x0a, 0x01, 0x0c, 0x04, "3" }, - {0x0a, 0x01, 0x0c, 0x08, "4" }, - {0x0a, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0a, 0x01, 0x30, 0x00, "8k 30k 30k+" }, - {0x0a, 0x01, 0x30, 0x10, "10k 40k 40k+" }, - {0x0a, 0x01, 0x30, 0x20, "15k 60k 60k+" }, - {0x0a, 0x01, 0x30, 0x30, "None" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0a, 0x01, 0x40, 0x40, "Off" }, - {0x0a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "High Score Name" }, - {0x0a, 0x01, 0x80, 0x80, "No" }, - {0x0a, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x20, 0x20, "Off" }, - {0x0b, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Warpwarpr) - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo GeebeeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start"}, - A("P1 Paddle", BIT_ANALOG_REL, &DrvAnalogPort0,"p1 z-axis"), - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, -}; - -STDINPUTINFO(Geebee) - - -static struct BurnDIPInfo GeebeeDIPList[]= -{ - {0x05, 0xff, 0xff, 0xd0, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x05, 0x01, 0x02, 0x00, "3" }, - {0x05, 0x01, 0x02, 0x02, "5" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x05, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x05, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x05, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - {0x05, 0x01, 0x0c, 0x0c, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Replay" }, - {0x05, 0x01, 0x30, 0x10, "40k 80k" }, - {0x05, 0x01, 0x30, 0x20, "70k 140k" }, - {0x05, 0x01, 0x30, 0x30, "100k 200k" }, - {0x05, 0x01, 0x30, 0x00, "None" }, - {0x05, 0x01, 0x30, 0x10, "60k 120k" }, - {0x05, 0x01, 0x30, 0x20, "100k 200k" }, - {0x05, 0x01, 0x30, 0x30, "150k 300k" }, - {0x05, 0x01, 0x30, 0x00, "None" }, -}; - -STDDIPINFO(Geebee) - -static struct BurnInputInfo BombbeeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start"}, - A("P1 Paddle", BIT_ANALOG_REL, &DrvAnalogPort0,"p1 z-axis"), - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Bombbee) -#undef A - - -static struct BurnDIPInfo BombbeeDIPList[]= -{ - {0x06, 0xff, 0xff, 0x03, NULL }, - {0x07, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x06, 0x01, 0x03, 0x02, "2 Coins 1 Credit" }, - {0x06, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x06, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x06, 0x01, 0x03, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 3, "Lives" }, - {0x06, 0x01, 0x0c, 0x00, "3" }, - {0x06, 0x01, 0x0c, 0x04, "4" }, - {0x06, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x06, 0x01, 0x10, 0x10, "Off" }, - {0x06, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Replay" }, - {0x06, 0x01, 0xe0, 0x00, "50000" }, - {0x06, 0x01, 0xe0, 0x20, "60000" }, - {0x06, 0x01, 0xe0, 0x40, "70000" }, - {0x06, 0x01, 0xe0, 0x60, "80000" }, - {0x06, 0x01, 0xe0, 0x80, "100000" }, - {0x06, 0x01, 0xe0, 0xa0, "120000" }, - {0x06, 0x01, 0xe0, 0xc0, "150000" }, - {0x06, 0x01, 0xe0, 0xe0, "None" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x07, 0x01, 0x20, 0x20, "Off" }, - {0x07, 0x01, 0x20, 0x00, "On" }, - -}; - -STDDIPINFO(Bombbee) - -static struct BurnInputInfo NavaroneInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start"}, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, -}; - -STDINPUTINFO(Navarone) - - -static struct BurnDIPInfo NavaroneDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x16, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0b, 0x01, 0x02, 0x00, "2" }, - {0x0b, 0x01, 0x02, 0x02, "3" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0b, 0x01, 0x0c, 0x04, "5000/2, 6000/3" }, - {0x0b, 0x01, 0x0c, 0x08, "6000/2, 7000/3" }, - {0x0b, 0x01, 0x0c, 0x0c, "7000/2, 8000/3" }, - {0x0b, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0b, 0x01, 0x30, 0x30, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x10, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0x30, 0x00, "Free Play" }, -}; - -STDDIPINFO(Navarone) - -static struct BurnInputInfo KaiteinInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, -}; - -STDINPUTINFO(Kaitein) - - -static struct BurnDIPInfo KaiteinDIPList[]= -{ - {0x07, 0xff, 0xff, 0x15, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x07, 0x01, 0x03, 0x00, "2" }, - {0x07, 0x01, 0x03, 0x01, "3" }, - {0x07, 0x01, 0x03, 0x02, "4" }, - {0x07, 0x01, 0x03, 0x03, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x07, 0x01, 0x0c, 0x04, "2000" }, - {0x07, 0x01, 0x0c, 0x08, "4000" }, - {0x07, 0x01, 0x0c, 0x0c, "6000" }, - {0x07, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x07, 0x01, 0x30, 0x30, "2 Coins 1 Credit" }, - {0x07, 0x01, 0x30, 0x10, "1 Coin 1 Credit" }, - {0x07, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x07, 0x01, 0x30, 0x00, "Free Play" }, -}; - -STDDIPINFO(Kaitein) - -static struct BurnInputInfo KaiteiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, -}; - -STDINPUTINFO(Kaitei) - - -static struct BurnDIPInfo KaiteiDIPList[]= -{ - {0x06, 0xff, 0xff, 0x1e, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x06, 0x01, 0x06, 0x06, "4" }, - {0x06, 0x01, 0x06, 0x04, "5" }, - {0x06, 0x01, 0x06, 0x02, "6" }, - {0x06, 0x01, 0x06, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x06, 0x01, 0x18, 0x18, "4000" }, - {0x06, 0x01, 0x18, 0x10, "6000" }, - {0x06, 0x01, 0x18, 0x08, "8000" }, - {0x06, 0x01, 0x18, 0x00, "10000" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x06, 0x01, 0x20, 0x00, "Off" }, - {0x06, 0x01, 0x20, 0x20, "On" }, -}; - -STDDIPINFO(Kaitei) - -static struct BurnInputInfo SosInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, -}; - -STDINPUTINFO(Sos) - - -static struct BurnDIPInfo SosDIPList[]= -{ - {0x07, 0xff, 0xff, 0x2a, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x07, 0x01, 0x06, 0x00, "2" }, - {0x07, 0x01, 0x06, 0x02, "3" }, - {0x07, 0x01, 0x06, 0x04, "4" }, - {0x07, 0x01, 0x06, 0x06, "5" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x07, 0x01, 0x18, 0x18, "2 Coins 1 Credit" }, - {0x07, 0x01, 0x18, 0x08, "1 Coin 1 Credit" }, - {0x07, 0x01, 0x18, 0x10, "1 Coin 2 Credits" }, - {0x07, 0x01, 0x18, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Nudity" }, - {0x07, 0x01, 0x20, 0x00, "Off" }, - {0x07, 0x01, 0x20, 0x20, "On" }, -}; - -STDDIPINFO(Sos) - - -// Warp Warp soundchip emulation -static INT16 *decay = NULL; -static INT32 sound_latch = 0; -static INT32 music1_latch = 0; -static INT32 music2_latch = 0; -static INT32 sound_signal = 0; -static INT32 sound_volume = 0; -static INT32 sound_volume_timer = 0; -static INT32 music_signal = 0; -static INT32 music_volume = 0; -static INT32 music_volume_timer = 0; -static INT32 noise = 0; - -static void warpwarp_sound_reset() -{ - sound_latch = 0; - music1_latch = 0; - music2_latch = 0; - sound_signal = 0; - sound_volume = 0; - sound_volume_timer = 0; - music_signal = 0; - music_volume = 0; - music_volume_timer = 0; - noise = 0; -} - -static void warpwarp_sound_scan() -{ - SCAN_VAR(sound_latch); - SCAN_VAR(music1_latch); - SCAN_VAR(music2_latch); - SCAN_VAR(sound_signal); - SCAN_VAR(sound_volume); - SCAN_VAR(sound_volume_timer); - SCAN_VAR(music_signal); - SCAN_VAR(music_volume); - SCAN_VAR(music_volume_timer); - SCAN_VAR(noise); -} - -static void sound_volume_decay() -{ - if( --sound_volume < 0 ) - sound_volume = 0; -} - -static void warpwarp_sound_w(UINT8 data) -{ - sound_latch = data & 0x0f; - sound_volume = 0x7fff; /* set sound_volume */ - noise = 0x0000; /* reset noise shifter */ - - if( sound_latch & 8 ) { - sound_volume_timer = 1; - } else { - sound_volume_timer = 2; - } -} - -static void warpwarp_music1_w(UINT8 data) -{ - music1_latch = data & 0x3f; -} - -static void music_volume_decay() -{ - if( --music_volume < 0 ) - music_volume = 0; -} - -static void warpwarp_music2_w(UINT8 data) -{ - music2_latch = data & 0x3f; - music_volume = 0x7fff; - - if( music2_latch & 0x10 ) { - music_volume_timer = 1; - } else { - music_volume_timer = 3; - } -} - -static void warpwarp_timer_tiktiktik(INT32 /*ticks*/) -{// warpwarp_timer_tiktiktik(); must be called 256 times per frame - switch (music_volume_timer) { - case 1: music_volume_decay(); // no breaks! - case 2: music_volume_decay(); - case 3: music_volume_decay(); - } - switch (sound_volume_timer) { - case 1: sound_volume_decay(); - case 2: sound_volume_decay(); - case 3: sound_volume_decay(); - } -} - -static void warpwarp_sound_update(INT16 *buffer, INT32 length) -{ - static int vcarry = 0; - static int vcount = 0; - static int mcarry = 0; - static int mcount = 0; - - memset(buffer, 0, length * 2 * sizeof(INT16)); - - while (length--) - { - *buffer++ = (sound_signal + music_signal) / 4; - *buffer++ = (sound_signal + music_signal) / 4; - - mcarry -= (18432000/3/2/16) / (4 * (64 - music1_latch)); - while( mcarry < 0 ) - { - mcarry += nBurnSoundRate; - mcount++; - music_signal = (mcount & ~music2_latch & 15) ? decay[music_volume] : 0; - /* override by noise gate? */ - if( (music2_latch & 32) && (noise & 0x8000) ) - music_signal = decay[music_volume]; - } - - /* clock 1V = 8kHz */ - vcarry -= (18432000/3/2/384); - while (vcarry < 0) - { - vcarry += nBurnSoundRate; - vcount++; - - /* noise is clocked with raising edge of 2V */ - if ((vcount & 3) == 2) - { - /* bit0 = bit0 ^ !bit10 */ - if ((noise & 1) == ((noise >> 10) & 1)) - noise = (noise << 1) | 1; - else - noise = noise << 1; - } - - switch (sound_latch & 7) - { - case 0: /* 4V */ - sound_signal = (vcount & 0x04) ? decay[sound_volume] : 0; - break; - case 1: /* 8V */ - sound_signal = (vcount & 0x08) ? decay[sound_volume] : 0; - break; - case 2: /* 16V */ - sound_signal = (vcount & 0x10) ? decay[sound_volume] : 0; - break; - case 3: /* 32V */ - sound_signal = (vcount & 0x20) ? decay[sound_volume] : 0; - break; - case 4: /* TONE1 */ - sound_signal = !(vcount & 0x01) && !(vcount & 0x10) ? decay[sound_volume] : 0; - break; - case 5: /* TONE2 */ - sound_signal = !(vcount & 0x02) && !(vcount & 0x20) ? decay[sound_volume] : 0; - break; - case 6: /* TONE3 */ - sound_signal = !(vcount & 0x04) && !(vcount & 0x40) ? decay[sound_volume] : 0; - break; - default: /* NOISE */ - sound_signal = (noise & 0x8000) ? decay[sound_volume] : 0; - } - } - } -} - -static void warpwarp_sound_init() -{ - decay = (INT16 *) BurnMalloc(32768 * sizeof(INT16)); - - for(INT32 i = 0; i < 0x8000; i++ ) - decay[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096)); - - sound_volume_timer = 0; - music_volume_timer = 0; -} - -static void warpwarp_sound_deinit() -{ - if (decay) - BurnFree(decay); - decay = NULL; -} - -#define MAX_NETS 3 -#define MAX_RES_PER_NET 18 -#define Combine2Weights(tab,w0,w1) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5)) -#define Combine3Weights(tab,w0,w1,w2) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5)) - -static double ComputeResistorWeights(INT32 MinVal, INT32 MaxVal, double Scaler, INT32 Count1, const INT32 *Resistances1, double *Weights1, INT32 PullDown1, INT32 PullUp1, INT32 Count2, const INT32 *Resistances2, double *Weights2, INT32 PullDown2, INT32 PullUp2, INT32 Count3, const INT32 *Resistances3, double *Weights3, INT32 PullDown3, INT32 PullUp3) -{ - INT32 NetworksNum; - - INT32 ResCount[MAX_NETS]; - double r[MAX_NETS][MAX_RES_PER_NET]; - double w[MAX_NETS][MAX_RES_PER_NET]; - double ws[MAX_NETS][MAX_RES_PER_NET]; - INT32 r_pd[MAX_NETS]; - INT32 r_pu[MAX_NETS]; - - double MaxOut[MAX_NETS]; - double *Out[MAX_NETS]; - - INT32 i, j, n; - double Scale; - double Max; - - NetworksNum = 0; - for (n = 0; n < MAX_NETS; n++) { - INT32 Count, pd, pu; - const INT32 *Resistances; - double *Weights; - - switch (n) { - case 0: { - Count = Count1; - Resistances = Resistances1; - Weights = Weights1; - pd = PullDown1; - pu = PullUp1; - break; - } - - case 1: { - Count = Count2; - Resistances = Resistances2; - Weights = Weights2; - pd = PullDown2; - pu = PullUp2; - break; - } - - case 2: - default: { - Count = Count3; - Resistances = Resistances3; - Weights = Weights3; - pd = PullDown3; - pu = PullUp3; - break; - } - } - - if (Count > 0) { - ResCount[NetworksNum] = Count; - for (i = 0; i < Count; i++) { - r[NetworksNum][i] = 1.0 * Resistances[i]; - } - Out[NetworksNum] = Weights; - r_pd[NetworksNum] = pd; - r_pu[NetworksNum] = pu; - NetworksNum++; - } - } - - for (i = 0; i < NetworksNum; i++) { - double R0, R1, Vout, Dst; - - for (n = 0; n < ResCount[i]; n++) { - R0 = (r_pd[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pd[i]; - R1 = (r_pu[i] == 0) ? 1.0 / 1e12 : 1.0 / r_pu[i]; - - for (j = 0; j < ResCount[i]; j++) { - if (j == n) { - if (r[i][j] != 0.0) R1 += 1.0 / r[i][j]; - } else { - if (r[i][j] != 0.0) R0 += 1.0 / r[i][j]; - } - } - - R0 = 1.0/R0; - R1 = 1.0/R1; - Vout = (MaxVal - MinVal) * R0 / (R1 + R0) + MinVal; - - Dst = (Vout < MinVal) ? MinVal : (Vout > MaxVal) ? MaxVal : Vout; - - w[i][n] = Dst; - } - } - - j = 0; - Max = 0.0; - for (i = 0; i < NetworksNum; i++) { - double Sum = 0.0; - - for (n = 0; n < ResCount[i]; n++) Sum += w[i][n]; - - MaxOut[i] = Sum; - if (Max < Sum) { - Max = Sum; - j = i; - } - } - - if (Scaler < 0.0) { - Scale = ((double)MaxVal) / MaxOut[j]; - } else { - Scale = Scaler; - } - - for (i = 0; i < NetworksNum; i++) { - for (n = 0; n < ResCount[i]; n++) { - ws[i][n] = w[i][n] * Scale; - (Out[i])[n] = ws[i][n]; - } - } - - return Scale; -} - - -static void warpwarp_palette_init() -{ - static const int resistances_tiles_rg[3] = { 1600, 820, 390 }; - static const int resistances_tiles_b[2] = { 820, 390 }; - static const int resistance_ball[1] = { 220 }; - - double weights_tiles_rg[3], weights_tiles_b[2], weight_ball[1]; - - ComputeResistorWeights(0, 0xff, -1.0, - 3, &resistances_tiles_rg[0], weights_tiles_rg, 150, 0, - 2, &resistances_tiles_b[0], weights_tiles_b, 150, 0, - 1, &resistance_ball[0], weight_ball, 150, 0); - - for (INT32 i = 0; i < 0x100; i++) - { - int bit0, bit1, bit2; - int r,g,b; - - /* red component */ - bit0 = (i >> 0) & 0x01; - bit1 = (i >> 1) & 0x01; - bit2 = (i >> 2) & 0x01; - r = Combine3Weights(weights_tiles_rg, bit0, bit1, bit2); - - /* green component */ - bit0 = (i >> 3) & 0x01; - bit1 = (i >> 4) & 0x01; - bit2 = (i >> 5) & 0x01; - g = Combine3Weights(weights_tiles_rg, bit0, bit1, bit2); - - /* blue component */ - bit0 = (i >> 6) & 0x01; - bit1 = (i >> 7) & 0x01; - b = Combine2Weights(weights_tiles_b, bit0, bit1); - - DrvPalette[(i * 2) + 0] = BurnHighCol(0, 0, 0, 0);; - DrvPalette[(i * 2) + 1] = BurnHighCol(r, g, b, 0);; - } - - DrvPalette[0x200] = BurnHighCol((INT32)weight_ball[0], (INT32)weight_ball[0], (INT32)weight_ball[0], 0); -} - -static UINT32 geebee_palette[3]; - -static void geebee_palette_common() -{ - geebee_palette[0] = BurnHighCol(0x00, 0x00, 0x00, 0); /* black */ - geebee_palette[1] = BurnHighCol(0xff, 0xff, 0xff, 0); /* white */ - geebee_palette[2] = BurnHighCol(0x7f, 0x7f, 0x7f, 0); /* grey */ -} - -#if 0 -static void geebee_palette_init() -{ - geebee_palette_common(); - DrvPalette[0] = geebee_palette[0]; - DrvPalette[1] = geebee_palette[1]; - DrvPalette[2] = geebee_palette[1]; - DrvPalette[3] = geebee_palette[0]; - DrvPalette[4] = geebee_palette[0]; - DrvPalette[5] = geebee_palette[2]; - DrvPalette[6] = geebee_palette[2]; - DrvPalette[7] = geebee_palette[0]; -} -#endif - -static void navarone_palette_init() -{ - geebee_palette_common(); - DrvPalette[0] = geebee_palette[0]; - DrvPalette[1] = geebee_palette[1]; - DrvPalette[2] = geebee_palette[0]; - DrvPalette[3] = geebee_palette[2]; - DrvPalette[4] = geebee_palette[0]; - DrvPalette[5] = geebee_palette[1]; - DrvPalette[6] = geebee_palette[0]; - DrvPalette[7] = geebee_palette[2]; - DrvPalette[8] = geebee_palette[1]; -} - -#undef MAX_NETS -#undef MAX_RES_PER_NET -#undef Combine2Weights -#undef Combine3Weights - -static void DrvMakeInputs() -{ - UINT8 *DrvJoy[4] = { DrvJoy1, DrvJoy2, DrvJoy3, DrvJoy4 }; - UINT32 DrvJoyInit[4] = { 0xff, 0xff, 0x00, 0x00 }; - - CompileInput(DrvJoy, (void*)DrvInput, 4, 8, DrvJoyInit); // first two are active low - - ProcessJoystick(&DrvInput[2], 0, 3,2,1,0, INPUT_4WAY); - ProcessJoystick(&DrvInput[3], 1, 3,2,1,0, INPUT_4WAY); -} - -static UINT32 scalerange_skns(UINT32 x, UINT32 in_min, UINT32 in_max, UINT32 out_min, UINT32 out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -static UINT8 in_paddle() -{ - UINT8 Temp = 0x7f - (DrvAnalogPort0 >> 4); - if (Temp < 0x01) Temp = 0x01; - if (Temp > 0xfe) Temp = 0xfe; - return scalerange_skns(Temp, 0x3f, 0xbe, 0x10, 0xa0); -} - -#if 0 // kaitei protection needs fixing. -static UINT8 geebee_in_r(UINT8 offset) -{ - INT32 res; - //static const char *const portnames[] = { "SW0", "SW1", "DSW2", "PLACEHOLDER" }; // "IN1" & "IN2" are read separately when offset==3 - - offset &= 3; - switch (offset) { - case 0: res = DrvInput[0] | 0x20 | 0xa0; break; - case 1: res = ((kaiteimode) ? DrvInput[2] | 0x80 : 0xff); break; - case 2: res = ((kaiteimode) ? DrvDip[0] | 0x80 : DrvDip[0]); break; - } - -// bprintf(0, _T("%X: res = %X di0 %X \n"), offset, res, DrvInput[0]); - if (offset == 3) - { - res = (use_paddle) ? in_paddle() : DrvInput[2]; - if (kaiteimode) { return 0xc0; } - //if (res) bprintf(0, _T("res = %X.."), res); - if (!use_paddle) // joystick-mode - { - /* map digital two-way joystick to two fixed VOLIN values */ - if (res & 2) return 0x9f; - if (res & 1) return 0x0f; - return 0x60; - } - } - return res; -} -#endif - -static UINT8 geebee_in_r(UINT8 offset) -{ - INT32 res = 0; - //static const char *const portnames[] = { "SW0", "SW1", "DSW2", "PLACEHOLDER" }; // "IN1" & "IN2" are read separately when offset==3 - - offset &= 3; - switch (offset) { - case 0: res = DrvInput[0] | 0x20; break; - case 1: res = 0xff; break; - case 2: res = DrvDip[0]; break; - } - -// bprintf(0, _T("%X: res = %X di0 %X \n"), offset, res, DrvInput[0]); - if (offset == 3) - { - res = (use_paddle) ? in_paddle() : DrvInput[2]; - - //if (res) bprintf(0, _T("res = %X.."), res); - if (!use_paddle) // joystick-mode - { - /* map digital two-way joystick to two fixed VOLIN values */ - if (res & 2) return 0x9f; - if (res & 1) return 0x0f; - return 0x60; - } - } - return res; -} - -static void geebee_out6_w(UINT16 offset, UINT8 data) -{ - switch (offset & 3) - { - case 0: - m_ball_h = data; - break; - case 1: - m_ball_v = data; - break; - case 2: - /* n.c. */ - break; - case 3: - warpwarp_sound_w(data); // need to port geebee sound core! - break; - } -} - -static void geebee_out7_w(UINT16 offset, UINT8 data) -{ - switch (offset & 7) - { - case 5: - geebee_bgw = data & 1; - break; - case 6: - m_ball_on = data & 1; - break; - case 7: - //flip_screen_set(space->machine, data & 1); - break; - } -} - -static UINT8 warpwarp_sw_r(UINT8 offset) -{ - return (DrvInput[0] >> (offset & 7)) & 1; -} - -static UINT8 warpwarp_dsw1_r(UINT8 offset) -{ - return (DrvDip[0] >> (offset & 7)) & 1; -} - -static UINT8 warpwarp_vol_r(UINT8 /*offset*/) -{ - INT32 res; - - res = (use_paddle) ? in_paddle() : DrvInput[2]; - if (!use_paddle) { - if (res & 1) return 0x0f; - if (res & 2) return 0x3f; - if (res & 4) return 0x6f; - if (res & 8) return 0x9f; - return 0xff; - } - //if (res) bprintf(0, _T("res = %X.."), res); - return res; -} - -static void warpwarp_out0_w(UINT16 offset, UINT8 data) -{ - switch (offset & 3) - { - case 0: - m_ball_h = data; - break; - case 1: - m_ball_v = data; - break; - case 2: - warpwarp_sound_w(data); - break; - case 3: - // watchdog reset - break; - } -} - -static void warpwarp_out3_w(UINT16 offset, UINT8 data) -{ - switch (offset & 7) - { - case 6: - m_ball_on = data & 1; - if (~data & 1) { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - break; - case 7: - // flipscreen = data & 1; - break; - } -} - -static void __fastcall main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0x6000) address = (address&0xfff) + 0xc000; // bombee/cutieq map - - if (address >= 0xc000 && address <= 0xc00f) { - warpwarp_out0_w(address - 0xc000, data); - return; - } - if (address >= 0xc010 && address <= 0xc01f) { - warpwarp_music1_w(data); - return; - } - if (address >= 0xc020 && address <= 0xc02f) { - warpwarp_music2_w(data); - return; - } - if (address >= 0xc030 && address <= 0xc03f) { - warpwarp_out3_w(address - 0xc030, data); - return; - } -} - -static UINT8 __fastcall main_read(UINT16 address) -{ - if ((address&0xf000) == 0x6000) address = (address&0xfff) + 0xc000; // bombee/cutieq map - - //bprintf(0, _T("new: %X\n"), address); - if (address >= 0xc000 && address <= 0xc00f) { - //bprintf(0, _T("sw_r %X "), address - 0xc000); - return warpwarp_sw_r(address - 0xc000); - } - if (address >= 0xc010 && address <= 0xc01f) { - return warpwarp_vol_r(address - 0xc010); - } - if (address >= 0xc020 && address <= 0xc02f) { - return warpwarp_dsw1_r(address - 0xc020); - } - - return 0; -} - -static void __fastcall geebee_write(UINT16 address, UINT8 data) -{ - if (address >= 0x6000 && address <= 0x6fff) { - geebee_out6_w(address - 0x6000, data); - return; - } - if (address >= 0x7000 && address <= 0x7fff) { - geebee_out7_w(address - 0x7000, data); - return; - } -} - -static UINT8 __fastcall geebee_read(UINT16 address) -{ - if (address >= 0x5000 && address <= 0x53ff) { - return geebee_in_r(address - 0x5000); - } - - return 0; -} - -static void __fastcall geebee_out(UINT16 address, UINT8 data) -{ - address &= 0xff; - - if (address >= 0x60 && address <= 0x6f) { - geebee_out6_w(address, data); - return; - } - - if (address >= 0x70 && address <= 0x7f) { - geebee_out7_w(address, data); - return; - } -} - -static UINT8 __fastcall geebee_in(UINT16 address) -{ - address &= 0xff; - - if (address >= 0x50 && address <= 0x53) { - return geebee_in_r(address); - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - m_ball_on = 0; - m_ball_h = 0; - m_ball_v = 0; - - warpwarp_sound_reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x08000; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - DrvCharGFX = Next; Next += 0x40000; - DrvGFX1ROM = Next; Next += 0x01000; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x01000; - DrvVidRAM = Next; Next += 0x01000; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 CharPlaneOffsets[1] = { 0 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 CharYOffsets[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }; - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (!strncmp(BurnDrvGetTextA(DRV_NAME), "geebee", 6)) { - bprintf(0, _T("geebee mode")); - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvGFX1ROM , 1, 1)) return 1; - if (BurnLoadRom(DrvGFX1ROM + 0x0400, 2, 1)) return 1; - GfxDecode(0x100, 1, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvGFX1ROM, DrvCharGFX); - } else - if (bombbeemode) { - bprintf(0, _T("bombbee/cutieq mode\n")); - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvGFX1ROM , 1, 1)) return 1; - GfxDecode(0x100, 1, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvGFX1ROM, DrvCharGFX); - - } else - if (navaronemode) { - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "kaitei")) { - bprintf(0, _T("original kaitei mode.\n")); - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x0800, 0, 1)) return 1; // re-load - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1400, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1800, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1c00, 4, 1)) return 1; - if (BurnLoadRom(DrvGFX1ROM , 5, 1)) return 1; - if (BurnLoadRom(DrvGFX1ROM+ 0x0400, 6, 1)) return 1; - } else { - bprintf(0, _T("original navalone/kaitein mode.\n")); - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x0800, 1, 1)) return 1; - if (BurnLoadRom(DrvGFX1ROM , 2 + rockola, 1)) return 1; - } - GfxDecode(0x100, 1, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvGFX1ROM, DrvCharGFX); - - } else { // Load ROMS parse GFX - bprintf(0, _T("load roms: warpwarp mode\n")); - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 2, 1)) return 1; - if (rockola) - if (BurnLoadRom(DrvZ80ROM + 0x3000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGFX1ROM , 3 + rockola, 1)) return 1; - GfxDecode(0x100, 1, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, DrvGFX1ROM, DrvCharGFX); - } - - ZetInit(0); - ZetOpen(0); - if (bombbeemode) { - bprintf(0, _T("mapping: bombbee/cutieq mode\n")); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x1fff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0x2000, 0x23ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x4000, 0x47ff, MAP_RAM); - ZetMapMemory(DrvGFX1ROM, 0x4800, 0x4fff, MAP_RAM); - ZetSetWriteHandler(main_write); - ZetSetReadHandler(main_read); - ball_color = 0x200; - ball_size_x = 4; - ball_size_y = 4; - } else - if (navaronemode) { - bprintf(0, _T("mapping: navarone mode\n")); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x1fff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0x4000, 0x40ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x2000, 0x23ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x2400, 0x27ff, MAP_RAM); - ZetMapMemory(DrvGFX1ROM, 0x3000, 0x37ff, MAP_RAM); - ZetSetInHandler(geebee_in); - ZetSetOutHandler(geebee_out); - ZetSetWriteHandler(geebee_write); - ZetSetReadHandler(geebee_read); - ball_color = 7; - } else { //warpwarp - bprintf(0, _T("mapping: warpwarp mode\n")); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3fff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x83ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0x4000, 0x47ff, MAP_RAM); - ZetMapMemory(DrvGFX1ROM, 0x4800, 0x4fff, MAP_RAM); - ZetSetWriteHandler(main_write); - ZetSetReadHandler(main_read); - ball_color = 0x200; - ball_size_x = 4; - ball_size_y = 4; - } - ZetClose(); - - GenericTilesInit(); - - warpwarp_sound_init(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnFree(AllMem); - - warpwarp_sound_deinit(); - - rockola = 0; - navaronemode = 0; - bombbeemode = 0; - kaiteimode = 0; - use_paddle = 0; - - return 0; -} - -static void plot_pixel(INT32 x, INT32 y, INT32 pen) -{ - if (x < 0 || x > nScreenWidth) return; - if (y < 0 || y > nScreenHeight) return; - - UINT16 *pPixel = pTransDraw + (y * nScreenWidth) + x; - *pPixel = pen; -} - -static void draw_bullet() -{ - if (m_ball_on) { - INT32 x = 264 - m_ball_h; - INT32 y = 240 - m_ball_v; - - for (INT32 i = ball_size_y; i > 0; i--) - for (INT32 j = ball_size_x; j > 0; j--) { - plot_pixel(x - j, y - i, ball_color); - } - } -} - -static void draw_chars() -{ - INT32 mx, my, code, color, x, y, offs, row, col; - - for (mx = 0; mx < 28; mx++) { - for (my = 0; my < 34; my++) { - row = mx + 2; - col = my - 1; - - if (col & 0x20) - offs = row + ((col & 1) << 5); - else - offs = col + (row << 5); - - code = DrvVidRAM[offs]; - if (navaronemode) { - color = ((geebee_bgw & 1) << 1) | ((code & 0x80) >> 7); - } else { //warpwarp - color = DrvVidRAM[offs + 0x400]; - } - - y = 8 * mx; - x = 8 * my; - Render8x8Tile_Clip(pTransDraw, code, x, y, color, 1, 0, DrvCharGFX); - } - } -} - - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - if (navaronemode) { - navarone_palette_init(); - } else { - warpwarp_palette_init(); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - draw_chars(); - draw_bullet(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvMakeInputs(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal = 2048000 / 60; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - ZetRun(nCyclesTotal / nInterleave); - - if (i == nInterleave - 1 && m_ball_on) - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - - if (navaronemode && i == 0 && bombbeemode == 0) // weird timing. - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - - warpwarp_timer_tiktiktik(nCyclesTotal / nInterleave); - } - ZetClose(); - - if (pBurnSoundOut) { - warpwarp_sound_update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - warpwarp_sound_scan(); - - SCAN_VAR(m_ball_on); - SCAN_VAR(m_ball_h); - SCAN_VAR(m_ball_v); - SCAN_VAR(geebee_bgw); - } - - return 0; -} - -// Warp & Warp - -static struct BurnRomInfo warpwarpRomDesc[] = { - { "ww1_prg1.s10", 0x1000, 0xf5262f38, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "ww1_prg2.s8", 0x1000, 0xde8355dd, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ww1_prg3.s4", 0x1000, 0xbdd1dec5, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ww1_chg1.s12", 0x0800, 0x380994c8, 2 | BRF_GRA }, // 3 gfx1 -}; - -STD_ROM_PICK(warpwarp) -STD_ROM_FN(warpwarp) - -struct BurnDriver BurnDrvWarpwarp = { - "warpwarp", NULL, NULL, NULL, "1981", - "Warp & Warp\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, warpwarpRomInfo, warpwarpRomName, NULL, NULL, WarpwarpInputInfo, WarpwarpDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - -INT32 warpwarprDrvInit() -{ - rockola = 1; - - return DrvInit(); -} - -// Warp Warp (Rock-Ola set 1) - -static struct BurnRomInfo warpwarprRomDesc[] = { - { "g-09601.2r", 0x1000, 0x916ffa35, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "g-09602.2m", 0x1000, 0x398bb87b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "g-09603.1p", 0x1000, 0x6b962fc4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "g-09613.1t", 0x0800, 0x60a67e76, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "g-9611.4c", 0x0800, 0x00e6a326, 2 | BRF_GRA }, // 4 gfx1 -}; - -STD_ROM_PICK(warpwarpr) -STD_ROM_FN(warpwarpr) - -struct BurnDriver BurnDrvWarpwarpr = { - "warpwarpr", "warpwarp", NULL, NULL, "1981", - "Warp Warp (Rock-Ola set 1)\0", NULL, "Namco (Rock-Ola license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, warpwarprRomInfo, warpwarprRomName, NULL, NULL, WarpwarpInputInfo, WarpwarprDIPInfo, - warpwarprDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - - -// Warp Warp (Rock-Ola set 2) - -static struct BurnRomInfo warpwarpr2RomDesc[] = { - { "g-09601.2r", 0x1000, 0x916ffa35, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "g-09602.2m", 0x1000, 0x398bb87b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "g-09603.1p", 0x1000, 0x6b962fc4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "g-09612.1t", 0x0800, 0xb91e9e79, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "g-9611.4c", 0x0800, 0x00e6a326, 2 | BRF_GRA }, // 4 gfx1 -}; - -STD_ROM_PICK(warpwarpr2) -STD_ROM_FN(warpwarpr2) - -struct BurnDriver BurnDrvWarpwarpr2 = { - "warpwarpr2", "warpwarp", NULL, NULL, "1981", - "Warp Warp (Rock-Ola set 2)\0", NULL, "Namco (Rock-Ola license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, warpwarpr2RomInfo, warpwarpr2RomName, NULL, NULL, WarpwarpInputInfo, WarpwarprDIPInfo, - warpwarprDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - -INT32 GeebeeInit() -{ - navaronemode = 1; - ball_size_x = 4; - ball_size_y = 4; - use_paddle = 1; - - return DrvInit(); -} - -// Gee Bee - -static struct BurnRomInfo geebeeRomDesc[] = { - { "geebee.1k", 0x1000, 0x8a5577e0, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "geebee.3a", 0x0400, 0xf257b21b, 1 | BRF_GRA }, // 1 gfx1 -}; - -STD_ROM_PICK(geebee) -STD_ROM_FN(geebee) - -struct BurnDriver BurnDrvGeebee = { - "geebee", NULL, NULL, NULL, "1978", - "Gee Bee\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, geebeeRomInfo, geebeeRomName, NULL, NULL, GeebeeInputInfo, GeebeeDIPInfo, - GeebeeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - - -// Gee Bee (Gremlin) - -static struct BurnRomInfo geebeegRomDesc[] = { - { "geebee.1k", 0x1000, 0x8a5577e0, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "geebeeg.3a", 0x0400, 0xa45932ba, 1 | BRF_GRA }, // 1 gfx1 -}; - -STD_ROM_PICK(geebeeg) -STD_ROM_FN(geebeeg) - -struct BurnDriver BurnDrvGeebeeg = { - "geebeeg", "geebee", NULL, NULL, "1978", - "Gee Bee (Gremlin)\0", NULL, "[Namco] (Gremlin license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, geebeegRomInfo, geebeegRomName, NULL, NULL, GeebeeInputInfo, GeebeeDIPInfo, - GeebeeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - -INT32 NavaroneInit() -{ - navaronemode = 1; - ball_size_x = 4; - ball_size_y = 4; - - return DrvInit(); -} - -// Navarone - -static struct BurnRomInfo navaroneRomDesc[] = { - { "navalone.p1", 0x0800, 0x5a32016b, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "navalone.p2", 0x0800, 0xb1c86fe3, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "navalone.chr", 0x0800, 0xb26c6170, 2 | BRF_GRA }, // 2 gfx1 -}; - -STD_ROM_PICK(navarone) -STD_ROM_FN(navarone) - -struct BurnDriver BurnDrvNavarone = { - "navarone", NULL, NULL, NULL, "1980", - "Navarone\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_16BIT_ONLY, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, navaroneRomInfo, navaroneRomName, NULL, NULL, NavaroneInputInfo, NavaroneDIPInfo, - NavaroneInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - -INT32 KaiteinInit() -{ - navaronemode = 1; - ball_size_x = 1; - ball_size_y = 16; - - return DrvInit(); -} - -// Kaitei Takara Sagashi (Namco license) - -static struct BurnRomInfo kaiteinRomDesc[] = { - { "kaitein.p1", 0x0800, 0xd88e10ae, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "kaitein.p2", 0x0800, 0xaa9b5763, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "kaitein.chr", 0x0800, 0x3125af4d, 2 | BRF_GRA }, // 2 gfx1 -}; - -STD_ROM_PICK(kaitein) -STD_ROM_FN(kaitein) - -struct BurnDriver BurnDrvKaitein = { - "kaitein", "kaitei", NULL, NULL, "1980", - "Kaitei Takara Sagashi (Namco license)\0", NULL, "K.K. Tokki (Namco license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, kaiteinRomInfo, kaiteinRomName, NULL, NULL, KaiteinInputInfo, KaiteinDIPInfo, - KaiteinInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - -INT32 KaiteiInit() -{ - kaiteimode = 1; - - return KaiteinInit(); -} - -// Kaitei Takara Sagashi - -static struct BurnRomInfo kaiteiRomDesc[] = { - { "kaitei_7.1k", 0x0800, 0x32f70d48, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "kaitei_1.1m", 0x0400, 0x9a7ab3b9, 1 | BRF_PRG | BRF_ESS }, // 1 - { "kaitei_2.1p", 0x0400, 0x5eeb0fff, 1 | BRF_PRG | BRF_ESS }, // 2 - { "kaitei_3.1s", 0x0400, 0x5dff4df7, 1 | BRF_PRG | BRF_ESS }, // 3 - { "kaitei_4.1t", 0x0400, 0xe5f303d6, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "kaitei_5.bin", 0x0400, 0x60fdb795, 2 | BRF_GRA }, // 5 gfx1 - { "kaitei_6.bin", 0x0400, 0x21399ace, 2 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(kaitei) -STD_ROM_FN(kaitei) - -struct BurnDriver BurnDrvKaitei = { - "kaitei", NULL, NULL, NULL, "1980", - "Kaitei Takara Sagashi\0", "Freezes up, use kaitein instead!", "K.K. Tokki", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, kaiteiRomInfo, kaiteiRomName, NULL, NULL, KaiteiInputInfo, KaiteiDIPInfo, - KaiteiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - -INT32 SOSInit() -{ - navaronemode = 1; - - ball_size_x = 4; - ball_size_y = 2; - - return DrvInit(); -} - - -// SOS - -static struct BurnRomInfo sosRomDesc[] = { - { "sos.p1", 0x0800, 0xf70bdafb, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "sos.p2", 0x0800, 0x58e9c480, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sos.chr",0x0800, 0x66f983e4, 2 | BRF_GRA }, // 2 gfx1 -}; - -STD_ROM_PICK(sos) -STD_ROM_FN(sos) - -struct BurnDriver BurnDrvSos = { - "sos", NULL, NULL, NULL, "1980", - "SOS\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, sosRomInfo, sosRomName, NULL, NULL, SosInputInfo, SosDIPInfo, - SOSInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - -INT32 BombbeeInit() -{ - navaronemode = 0; - bombbeemode = 1; - ball_size_x = 4; - ball_size_y = 4; - use_paddle = 1; - - return DrvInit(); -} - -// Bomb Bee - -static struct BurnRomInfo bombbeeRomDesc[] = { - { "bombbee.1k", 0x2000, 0x9f8cd7af, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "bombbee.4c", 0x0800, 0x5f37d569, 1 | BRF_GRA }, // 1 gfx1 -}; - -STD_ROM_PICK(bombbee) -STD_ROM_FN(bombbee) - -struct BurnDriver BurnDrvBombbee = { - "bombbee", NULL, NULL, NULL, "1979", - "Bomb Bee\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, bombbeeRomInfo, bombbeeRomName, NULL, NULL, BombbeeInputInfo, BombbeeDIPInfo, - BombbeeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; - - -// Cutie Q - -static struct BurnRomInfo cutieqRomDesc[] = { - { "cutieq.1k", 0x2000, 0x6486cdca, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - - { "cutieq.4c", 0x0800, 0x0e1618c9, 1 | BRF_GRA }, // 1 gfx1 -}; - -STD_ROM_PICK(cutieq) -STD_ROM_FN(cutieq) - -struct BurnDriver BurnDrvCutieq = { - "cutieq", NULL, NULL, NULL, "1979", - "Cutie Q\0", NULL, "Namco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, cutieqRomInfo, cutieqRomName, NULL, NULL, BombbeeInputInfo, BombbeeDIPInfo, - BombbeeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 224, 272, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_wc90.cpp b/jan/src/burn/drv/pre90s/d_wc90.cpp deleted file mode 100644 index 169c8633f..000000000 --- a/jan/src/burn/drv/pre90s/d_wc90.cpp +++ /dev/null @@ -1,1328 +0,0 @@ -// FB Alpha - World Cup '90 driver -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2608.h" - -static UINT8 Wc90InputPort0[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 Wc90InputPort1[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 Wc90InputPort2[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 Wc90Dip[2] = {0, 0}; -static UINT8 Wc90Input[3] = {0x00, 0x00, 0x00}; -static UINT8 Wc90Reset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Wc90Z80Rom1 = NULL; -static UINT8 *Wc90Z80Rom2 = NULL; -static UINT8 *Wc90Z80Rom3 = NULL; -static UINT8 *Wc90Z80Ram1 = NULL; -static UINT8 *Wc90Z80Ram2 = NULL; -static UINT8 *Wc90Z80Ram3 = NULL; -static UINT8 *Wc90FgVideoRam = NULL; -static UINT8 *Wc90BgVideoRam = NULL; -static UINT8 *Wc90TextVideoRam = NULL; -static UINT8 *Wc90SpriteRam = NULL; -static UINT8 *Wc90PaletteRam = NULL; -static UINT8 *Wc90SharedRam = NULL; -static UINT32 *Wc90Palette = NULL; -static UINT8 *Wc90CharTiles = NULL; -static UINT8 *Wc90BgTiles = NULL; -static UINT8 *Wc90FgTiles = NULL; -static UINT8 *Wc90Sprites = NULL; -static UINT8 *Wc90TempGfx = NULL; -static UINT8 *Wc90YM2608Rom = NULL; -static UINT8 *Wc90YM2608IRom = NULL; - -static INT32 Wc90Scroll0YLo; -static INT32 Wc90Scroll0YHi; -static INT32 Wc90Scroll0XLo; -static INT32 Wc90Scroll0XHi; -static INT32 Wc90Scroll1YLo; -static INT32 Wc90Scroll1YHi; -static INT32 Wc90Scroll1XLo; -static INT32 Wc90Scroll1XHi; -static INT32 Wc90Scroll2YLo; -static INT32 Wc90Scroll2YHi; -static INT32 Wc90Scroll2XLo; -static INT32 Wc90Scroll2XHi; - -static INT32 Wc90SoundLatch = 0; - -static INT32 Wc90Z80BankAddress1; -static INT32 Wc90Z80BankAddress2; - -static INT32 nCyclesDone[3], nCyclesTotal[3]; -static INT32 nCyclesSegment; - -static INT32 nTileType; - -static struct BurnInputInfo Wc90InputList[] = { - {"Coin 1" , BIT_DIGITAL , Wc90InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , Wc90InputPort2 + 2, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , Wc90InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , Wc90InputPort2 + 3, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , Wc90InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Wc90InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Wc90InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Wc90InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , Wc90InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , Wc90InputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , Wc90InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Wc90InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Wc90InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Wc90InputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , Wc90InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , Wc90InputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &Wc90Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, Wc90Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, Wc90Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Wc90) - -inline static void Wc90ClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -inline static void Wc90MakeInputs() -{ - Wc90Input[0] = Wc90Input[1] = 0x00; - Wc90Input[2] = 0x03; - - for (INT32 i = 0; i < 6; i++) { - Wc90Input[0] |= (Wc90InputPort0[i] & 1) << i; - Wc90Input[1] |= (Wc90InputPort1[i] & 1) << i; - } - - if (Wc90InputPort2[0]) Wc90Input[2] -= 0x01; - if (Wc90InputPort2[1]) Wc90Input[2] -= 0x02; - if (Wc90InputPort2[2]) Wc90Input[2] |= 0x04; - if (Wc90InputPort2[3]) Wc90Input[2] |= 0x08; - - Wc90ClearOpposites(&Wc90Input[0]); - Wc90ClearOpposites(&Wc90Input[1]); -} - -static struct BurnDIPInfo Wc90DIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Coinage" }, - {0x11, 0x01, 0x0f, 0x00, "10 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x08, " 9 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x04, " 8 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0c, " 7 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x02, " 6 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0a, " 5 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x06, " 4 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0e, " 3 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x01, " 2 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x09, " 2 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0f, " 1 Coin 1 Credit" }, - {0x11, 0x01, 0x0f, 0x07, " 1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, " 1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x03, " 1 Coin 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, " 1 Coin 5 Credits" }, - {0x11, 0x01, 0x0f, 0x05, " 1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x30, 0x30, "Easy" }, - {0x11, 0x01, 0x30, 0x10, "Normal" }, - {0x11, 0x01, 0x30, 0x20, "Hard" }, - {0x11, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Countdown Speed" }, - {0x11, 0x01, 0x40, 0x40, "Normal" }, - {0x11, 0x01, 0x40, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "1 Player Game Time" }, - {0x12, 0x01, 0x03, 0x01, "1:00" }, - {0x12, 0x01, 0x03, 0x02, "1:30" }, - {0x12, 0x01, 0x03, 0x03, "2:00" }, - {0x12, 0x01, 0x03, 0x00, "2:30" }, - - {0 , 0xfe, 0 , 8 , "2 Players Game Time" }, - {0x12, 0x01, 0x1c, 0x0c, "1:00" }, - {0x12, 0x01, 0x1c, 0x14, "1:30" }, - {0x12, 0x01, 0x1c, 0x04, "2:00" }, - {0x12, 0x01, 0x1c, 0x18, "2:30" }, - {0x12, 0x01, 0x1c, 0x1c, "3:00" }, - {0x12, 0x01, 0x1c, 0x08, "3:30" }, - {0x12, 0x01, 0x1c, 0x10, "4:00" }, - {0x12, 0x01, 0x1c, 0x00, "5:00" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x12, 0x01, 0x80, 0x00, "English" }, - {0x12, 0x01, 0x80, 0x80, "Japanese" }, -}; - -STDDIPINFO(Wc90) - -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; - -static struct BurnRomInfo Ym2608RomDesc[] = { -#if !defined (ROM_VERIFY) - { "ym2608_adpcm_rom.bin", 0x002000, 0x23c9e0d8, BRF_ESS | BRF_PRG | BRF_BIOS }, -#else - { "", 0x000000, 0x00000000, BRF_ESS | BRF_PRG | BRF_BIOS }, -#endif -}; - -STD_ROM_PICK(Ym2608) -STD_ROM_FN(Ym2608) - -static struct BurnRomInfo Wc90RomDesc[] = { - { "ic87_01.bin", 0x08000, 0x4a1affbc, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ic95_02.bin", 0x10000, 0x847d439c, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "ic67_04.bin", 0x10000, 0xdc6eaf00, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - { "ic56_03.bin", 0x10000, 0x1ac02b3b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "ic54_05.bin", 0x10000, 0x27c348b3, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program Code - - { "ic85_07v.bin", 0x10000, 0xc5219426, BRF_GRA }, // 5 Characters - { "ic86_08v.bin", 0x20000, 0x8fa1a1ff, BRF_GRA }, // 6 Fg Tiles - { "ic90_09v.bin", 0x20000, 0x99f8841c, BRF_GRA }, // 7 Fg Tiles - { "ic87_10v.bin", 0x20000, 0x8232093d, BRF_GRA }, // 8 Bg Tiles - { "ic91_11v.bin", 0x20000, 0x188d3789, BRF_GRA }, // 9 Bg Tiles - { "ic50_12v.bin", 0x20000, 0xda1fe922, BRF_GRA }, // 10 Sprites - { "ic54_13v.bin", 0x20000, 0x9ad03c2c, BRF_GRA }, // 11 Sprites - { "ic60_14v.bin", 0x20000, 0x499dfb1b, BRF_GRA }, // 12 Sprites - { "ic65_15v.bin", 0x20000, 0xd8ea5c81, BRF_GRA }, // 13 Sprites - - { "ic82_06.bin", 0x20000, 0x2fd692ed, BRF_SND }, // 14 ADPCM Samples -}; - -STDROMPICKEXT(Wc90, Wc90, Ym2608) -STD_ROM_FN(Wc90) - -static struct BurnRomInfo Wc90aRomDesc[] = { - { "wc90-1.bin", 0x08000, 0xd1804e1a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ic95_02.bin", 0x10000, 0x847d439c, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "ic67_04.bin", 0x10000, 0xdc6eaf00, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - { "ic56_03.bin", 0x10000, 0x1ac02b3b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "ic54_05.bin", 0x10000, 0x27c348b3, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program Code - - { "ic85_07v.bin", 0x10000, 0xc5219426, BRF_GRA }, // 5 Characters - { "ic86_08v.bin", 0x20000, 0x8fa1a1ff, BRF_GRA }, // 6 Fg Tiles - { "ic90_09v.bin", 0x20000, 0x99f8841c, BRF_GRA }, // 7 Fg Tiles - { "ic87_10v.bin", 0x20000, 0x8232093d, BRF_GRA }, // 8 Bg Tiles - { "ic91_11v.bin", 0x20000, 0x188d3789, BRF_GRA }, // 9 Bg Tiles - { "ic50_12v.bin", 0x20000, 0xda1fe922, BRF_GRA }, // 10 Sprites - { "ic54_13v.bin", 0x20000, 0x9ad03c2c, BRF_GRA }, // 11 Sprites - { "ic60_14v.bin", 0x20000, 0x499dfb1b, BRF_GRA }, // 12 Sprites - { "ic65_15v.bin", 0x20000, 0xd8ea5c81, BRF_GRA }, // 13 Sprites - - { "ic82_06.bin", 0x20000, 0x2fd692ed, BRF_SND }, // 14 ADPCM Samples -}; - -STDROMPICKEXT(Wc90a, Wc90a, Ym2608) -STD_ROM_FN(Wc90a) - -static struct BurnRomInfo Wc90bRomDesc[] = { - { "ic87-1b.bin", 0x08000, 0xd024a971, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ic95_02.bin", 0x10000, 0x847d439c, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "ic67_04.bin", 0x10000, 0xdc6eaf00, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - { "ic56_03.bin", 0x10000, 0x1ac02b3b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "ic54_05.bin", 0x10000, 0x27c348b3, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program Code - - { "ic85_07v.bin", 0x10000, 0xc5219426, BRF_GRA }, // 5 Characters - { "ic86_08v.bin", 0x20000, 0x8fa1a1ff, BRF_GRA }, // 6 Fg Tiles - { "ic90_09v.bin", 0x20000, 0x99f8841c, BRF_GRA }, // 7 Fg Tiles - { "ic87_10v.bin", 0x20000, 0x8232093d, BRF_GRA }, // 8 Bg Tiles - { "ic91_11v.bin", 0x20000, 0x188d3789, BRF_GRA }, // 9 Bg Tiles - { "ic50_12v.bin", 0x20000, 0xda1fe922, BRF_GRA }, // 10 Sprites - { "ic54_13v.bin", 0x20000, 0x9ad03c2c, BRF_GRA }, // 11 Sprites - { "ic60_14v.bin", 0x20000, 0x499dfb1b, BRF_GRA }, // 12 Sprites - { "ic65_15v.bin", 0x20000, 0xd8ea5c81, BRF_GRA }, // 13 Sprites - - { "ic82_06.bin", 0x20000, 0x2fd692ed, BRF_SND }, // 14 ADPCM Samples -}; - -STDROMPICKEXT(Wc90b, Wc90b, Ym2608) -STD_ROM_FN(Wc90b) - -static struct BurnRomInfo Wc90tRomDesc[] = { - { "wc90a-1.bin", 0x08000, 0xb6f51a68, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "wc90a-2.bin", 0x10000, 0xc50f2a98, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "ic67_04.bin", 0x10000, 0xdc6eaf00, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - { "wc90a-3.bin", 0x10000, 0x8c7a9542, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "ic54_05.bin", 0x10000, 0x27c348b3, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program Code - - { "ic85_07v.bin", 0x10000, 0xc5219426, BRF_GRA }, // 5 Characters - { "ic86_08v.bin", 0x20000, 0x8fa1a1ff, BRF_GRA }, // 6 Fg Tiles - { "ic90_09v.bin", 0x20000, 0x99f8841c, BRF_GRA }, // 7 Fg Tiles - { "ic87_10v.bin", 0x20000, 0x8232093d, BRF_GRA }, // 8 Bg Tiles - { "ic91_11v.bin", 0x20000, 0x188d3789, BRF_GRA }, // 9 Bg Tiles - { "ic50_12v.bin", 0x20000, 0xda1fe922, BRF_GRA }, // 10 Sprites - { "ic54_13v.bin", 0x20000, 0x9ad03c2c, BRF_GRA }, // 11 Sprites - { "ic60_14v.bin", 0x20000, 0x499dfb1b, BRF_GRA }, // 12 Sprites - { "ic65_15v.bin", 0x20000, 0xd8ea5c81, BRF_GRA }, // 13 Sprites - - { "ic82_06.bin", 0x20000, 0x2fd692ed, BRF_SND }, // 14 ADPCM Samples -}; - -STDROMPICKEXT(Wc90t, Wc90t, Ym2608) -STD_ROM_FN(Wc90t) - -static INT32 Wc90DoReset() -{ - Wc90Scroll0XLo = Wc90Scroll0XHi = Wc90Scroll0YLo = Wc90Scroll0YHi = 0; - Wc90Scroll1XLo = Wc90Scroll1XHi = Wc90Scroll1YLo = Wc90Scroll1YHi = 0; - Wc90Scroll2XLo = Wc90Scroll2XHi = Wc90Scroll2YLo = Wc90Scroll2YHi = 0; - - Wc90SoundLatch = 0; - - for (INT32 i = 0; i < 3; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - BurnYM2608Reset(); - - HiscoreReset(); - - return 0; -} - -static void wc90FMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static inline void wc90SendSoundCommand(INT32 nCommand) -{ - Wc90SoundLatch = nCommand; - - ZetClose(); - - ZetOpen(2); - ZetNmi(); - ZetClose(); - - ZetOpen(0); -} - -static INT32 wc90SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double wc90GetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -UINT8 __fastcall Wc90Read1(UINT16 a) -{ - switch (a) { - case 0xfc00: { - return 0xff - Wc90Input[0]; - } - - case 0xfc02: { - return 0xff - Wc90Input[1]; - } - - case 0xfc05: { - return 0xff - Wc90Input[2]; - } - - case 0xfc06: { - return Wc90Dip[0]; - } - - case 0xfc07: { - return Wc90Dip[1]; - } - } - - return 0; -} - -void __fastcall Wc90Write1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xfc02: { - Wc90Scroll0YLo = d; - return; - } - - case 0xfc03: { - Wc90Scroll0YHi = d; - return; - } - - case 0xfc06: { - Wc90Scroll0XLo = d; - return; - } - - case 0xfc07: { - Wc90Scroll0XHi = d; - return; - } - - case 0xfc22: { - Wc90Scroll1YLo = d; - return; - } - - case 0xfc23: { - Wc90Scroll1YHi = d; - return; - } - - case 0xfc26: { - Wc90Scroll1XLo = d; - return; - } - - case 0xfc27: { - Wc90Scroll1XHi = d; - return; - } - - case 0xfc42: { - Wc90Scroll2YLo = d; - return; - } - - case 0xfc43: { - Wc90Scroll2YHi = d; - return; - } - - case 0xfc46: { - Wc90Scroll2XLo = d; - return; - } - - case 0xfc47: { - Wc90Scroll2XHi = d; - return; - } - - case 0xfcc0: { - wc90SendSoundCommand(d); - return; - } - - case 0xfce0: { - Wc90Z80BankAddress1 = 0x10000 + ((d & 0xf8) << 8); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90Z80Rom1 + Wc90Z80BankAddress1); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90Z80Rom1 + Wc90Z80BankAddress1); - return; - } - } -} - -void __fastcall Wc90Write2(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xfc00: { - Wc90Z80BankAddress2 = 0x10000 + ((d & 0xf8) << 8); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90Z80Rom2 + Wc90Z80BankAddress2); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90Z80Rom2 + Wc90Z80BankAddress2); - return; - } - } -} - -UINT8 __fastcall Wc90Read3(UINT16 a) -{ - switch (a) { - case 0xf800: { - return BurnYM2608Read(0); - } - - case 0xf802: { - return BurnYM2608Read(2); - } - - case 0xfc10: { - return Wc90SoundLatch; - } - } - - return 0; -} - -void __fastcall Wc90Write3(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xf800: { - BurnYM2608Write(0, d); - return; - } - - case 0xf801: { - BurnYM2608Write(1, d); - return; - } - - case 0xf802: { - BurnYM2608Write(2, d); - return; - } - - case 0xf803: { - BurnYM2608Write(3, d); - return; - } - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Wc90Z80Rom1 = Next; Next += 0x20000; - Wc90Z80Rom2 = Next; Next += 0x20000; - Wc90Z80Rom3 = Next; Next += 0x10000; - Wc90YM2608Rom = Next; Next += 0x20000; - Wc90YM2608IRom = Next; Next += 0x02000; - - RamStart = Next; - - Wc90Z80Ram1 = Next; Next += 0x04000; - Wc90Z80Ram2 = Next; Next += 0x01800; - Wc90Z80Ram3 = Next; Next += 0x00800; - Wc90FgVideoRam = Next; Next += 0x01000; - Wc90BgVideoRam = Next; Next += 0x01000; - Wc90TextVideoRam = Next; Next += 0x01000; - Wc90SpriteRam = Next; Next += 0x00800; - Wc90PaletteRam = Next; Next += 0x00800; - Wc90SharedRam = Next; Next += 0x00400; - - RamEnd = Next; - - Wc90CharTiles = Next; Next += (2048 * 8 * 8); - Wc90BgTiles = Next; Next += (2048 * 16 * 16); - Wc90FgTiles = Next; Next += (2048 * 16 * 16); - Wc90Sprites = Next; Next += (4096 * 16 * 16); - Wc90Palette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static void Wc90RenderBgLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = Wc90BgVideoRam[TileIndex]; - Code = Wc90BgVideoRam[TileIndex + 0x800] + 256 * ((Attr & 3) + ((Attr >> 1) & 4)); - Colour = Attr >> 4; - - x = 16 * mx; - y = 16 * my; - - x -= Wc90Scroll2XLo + 256 * Wc90Scroll2XHi; - y -= Wc90Scroll2YLo + 256 * Wc90Scroll2YHi; - - x &= 0x3ff; - y &= 0x1ff; - - y -= 16; - if (x > 968) x -= 1024; - - if (x > 15 && x < 240 && y > 15 && y < 208) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 768, Wc90BgTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 768, Wc90BgTiles); - } - - TileIndex++; - } - } -} - -static void Wc90tRenderBgLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = Wc90BgVideoRam[TileIndex]; - Code = Wc90BgVideoRam[TileIndex + 0x800] + 256 * (Attr & 7); - Colour = Attr >> 4; - - x = 16 * mx; - y = 16 * my; - - x -= Wc90Scroll2XLo + 256 * Wc90Scroll2XHi; - y -= Wc90Scroll2YLo + 256 * Wc90Scroll2YHi; - - x &= 0x3ff; - y &= 0x1ff; - - y -= 16; - if (x > 968) x -= 1024; - - if (x > 15 && x < 240 && y > 15 && y < 208) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 768, Wc90BgTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 768, Wc90BgTiles); - } - - TileIndex++; - } - } -} - -static void Wc90RenderFgLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = Wc90FgVideoRam[TileIndex]; - Code = Wc90FgVideoRam[TileIndex + 0x800] + 256 * ((Attr & 3) + ((Attr >> 1) & 4)); - Colour = Attr >> 4; - - x = 16 * mx; - y = 16 * my; - - x -= Wc90Scroll1XLo + 256 * Wc90Scroll1XHi; - y -= Wc90Scroll1YLo + 256 * Wc90Scroll1YHi; - - x &= 0x3ff; - y &= 0x1ff; - - y -= 16; - if (x > 968) x -= 1024; - - if (x > 15 && x < 240 && y > 15 && y < 208) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 512, Wc90FgTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 512, Wc90FgTiles); - } - - TileIndex++; - } - } -} - -static void Wc90tRenderFgLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = Wc90FgVideoRam[TileIndex]; - Code = Wc90FgVideoRam[TileIndex + 0x800] + 256 * (Attr & 7); - Colour = Attr >> 4; - - x = 16 * mx; - y = 16 * my; - - x -= Wc90Scroll1XLo + 256 * Wc90Scroll1XHi; - y -= Wc90Scroll1YLo + 256 * Wc90Scroll1YHi; - - x &= 0x3ff; - y &= 0x1ff; - - y -= 16; - if (x > 968) x -= 1024; - - if (x > 15 && x < 240 && y > 15 && y < 208) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 512, Wc90FgTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 512, Wc90FgTiles); - } - - TileIndex++; - } - } -} - -static void Wc90RenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = Wc90TextVideoRam[TileIndex + 0x800] + ((Wc90TextVideoRam[TileIndex] & 0x07) << 8); - Colour = Wc90TextVideoRam[TileIndex] >> 4; - - x = 8 * mx; - y = 8 * my; - - x -= Wc90Scroll0XLo + 256 * Wc90Scroll0XHi; - y -= Wc90Scroll0YLo + 256 * Wc90Scroll0YHi; - - x &= 0x1ff; - y &= 0x0ff; - - y -= 16; - - if (x > 7 && x < 248 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, Wc90CharTiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, Wc90CharTiles); - } - - TileIndex++; - } - } -} - -static void Wc90RenderSprite(INT32 Code, INT32 Colour, INT32 FlipX, INT32 FlipY, INT32 x, INT32 y) -{ - if (x > 15 && x < 240 && y > 15 && y < 208) { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, Wc90Sprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, Wc90Sprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, Wc90Sprites); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, Wc90Sprites); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, Wc90Sprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, Wc90Sprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, Wc90Sprites); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, Wc90Sprites); - } - } - } -} - -static const char p32x32[4][4] = { - { 0, 1, 2, 3 }, - { 1, 0, 3, 2 }, - { 2, 3, 0, 1 }, - { 3, 2, 1, 0 } -}; - -static const char p32x64[4][8] = { - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 5, 4, 7, 6, 1, 0, 3, 2 }, - { 2, 3, 0, 1, 6, 7, 4, 5 }, - { 7, 6, 5, 4, 3, 2, 1, 0 } -}; - -static const char p64x32[4][8] = { - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 1, 0, 3, 2, 5, 4, 7, 6 }, - { 6, 7, 4, 5, 2, 3, 0, 1 }, - { 7, 6, 5, 4, 3, 2, 1, 0 } -}; - -static const char p64x64[4][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 5, 4, 7, 6, 1, 0, 3, 2, 13, 12, 15, 14, 9, 8, 11, 10 }, - { 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, 1, 6, 7, 4, 5 }, - { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 } -}; - -static void drawsprite_16x16(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) -{ - Wc90RenderSprite(Code, Attr >> 4, Bank & 1, Bank & 2, x, y); -} - -static void drawsprite_16x32(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) -{ - if (Bank & 2) { - Wc90RenderSprite(Code + 1, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 16); - Wc90RenderSprite(Code + 0, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - } else { - Wc90RenderSprite(Code + 0, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - Wc90RenderSprite(Code + 1, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 16); - } -} - -static void drawsprite_16x64(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) -{ - if (Bank & 2) { - Wc90RenderSprite(Code + 3, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 48); - Wc90RenderSprite(Code + 2, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 32); - Wc90RenderSprite(Code + 1, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 16); - Wc90RenderSprite(Code + 0, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - } else { - Wc90RenderSprite(Code + 0, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - Wc90RenderSprite(Code + 1, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 16); - Wc90RenderSprite(Code + 2, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 32); - Wc90RenderSprite(Code + 3, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 48); - } -} - -static void drawsprite_32x16(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) -{ - if (Bank & 1) { - Wc90RenderSprite(Code + 1, Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 0); - Wc90RenderSprite(Code + 0, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - } else { - Wc90RenderSprite(Code + 0, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - Wc90RenderSprite(Code + 1, Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 0); - } -} - -static void drawsprite_32x32(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) -{ - const char *p = p32x32[Bank & 3]; - - Wc90RenderSprite(Code + p[0], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - Wc90RenderSprite(Code + p[1], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 0); - Wc90RenderSprite(Code + p[2], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 16); - Wc90RenderSprite(Code + p[3], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 16); -} - -static void drawsprite_32x64(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) -{ - const char *p = p32x64[Bank & 3]; - - Wc90RenderSprite(Code + p[0], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - Wc90RenderSprite(Code + p[1], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 0); - Wc90RenderSprite(Code + p[2], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 16); - Wc90RenderSprite(Code + p[3], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 16); - Wc90RenderSprite(Code + p[4], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 32); - Wc90RenderSprite(Code + p[5], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 32); - Wc90RenderSprite(Code + p[6], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 48); - Wc90RenderSprite(Code + p[7], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 48); -} - -static void drawsprite_64x16(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) -{ - if (Bank & 1) { - Wc90RenderSprite(Code + 3, Attr >> 4, Bank & 1, Bank & 2, x + 48, y + 0); - Wc90RenderSprite(Code + 2, Attr >> 4, Bank & 1, Bank & 2, x + 32, y + 0); - Wc90RenderSprite(Code + 1, Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 0); - Wc90RenderSprite(Code + 0, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - } else { - Wc90RenderSprite(Code + 0, Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - Wc90RenderSprite(Code + 1, Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 0); - Wc90RenderSprite(Code + 2, Attr >> 4, Bank & 1, Bank & 2, x + 32, y + 0); - Wc90RenderSprite(Code + 3, Attr >> 4, Bank & 1, Bank & 2, x + 48, y + 0); - } -} - -static void drawsprite_64x32(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) -{ - const char *p = p64x32[Bank & 3]; - - Wc90RenderSprite(Code + p[0], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - Wc90RenderSprite(Code + p[1], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 0); - Wc90RenderSprite(Code + p[2], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 16); - Wc90RenderSprite(Code + p[3], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 16); - Wc90RenderSprite(Code + p[4], Attr >> 4, Bank & 1, Bank & 2, x + 32, y + 0); - Wc90RenderSprite(Code + p[5], Attr >> 4, Bank & 1, Bank & 2, x + 48, y + 0); - Wc90RenderSprite(Code + p[6], Attr >> 4, Bank & 1, Bank & 2, x + 32, y + 16); - Wc90RenderSprite(Code + p[7], Attr >> 4, Bank & 1, Bank & 2, x + 48, y + 16); -} - -static void drawsprite_64x64(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) -{ - const char *p = p64x64[Bank & 3]; - - Wc90RenderSprite(Code + p[ 0], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 0); - Wc90RenderSprite(Code + p[ 1], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 0); - Wc90RenderSprite(Code + p[ 2], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 16); - Wc90RenderSprite(Code + p[ 3], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 16); - Wc90RenderSprite(Code + p[ 4], Attr >> 4, Bank & 1, Bank & 2, x + 32, y + 0); - Wc90RenderSprite(Code + p[ 5], Attr >> 4, Bank & 1, Bank & 2, x + 48, y + 0); - Wc90RenderSprite(Code + p[ 6], Attr >> 4, Bank & 1, Bank & 2, x + 32, y + 16); - Wc90RenderSprite(Code + p[ 7], Attr >> 4, Bank & 1, Bank & 2, x + 48, y + 16); - Wc90RenderSprite(Code + p[ 8], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 32); - Wc90RenderSprite(Code + p[ 9], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 32); - Wc90RenderSprite(Code + p[10], Attr >> 4, Bank & 1, Bank & 2, x + 0, y + 48); - Wc90RenderSprite(Code + p[11], Attr >> 4, Bank & 1, Bank & 2, x + 16, y + 48); - Wc90RenderSprite(Code + p[12], Attr >> 4, Bank & 1, Bank & 2, x + 32, y + 32); - Wc90RenderSprite(Code + p[13], Attr >> 4, Bank & 1, Bank & 2, x + 48, y + 32); - Wc90RenderSprite(Code + p[14], Attr >> 4, Bank & 1, Bank & 2, x + 32, y + 48); - Wc90RenderSprite(Code + p[15], Attr >> 4, Bank & 1, Bank & 2, x + 48, y + 48); -} - -static void drawsprite_invalid(INT32 Code, INT32 x, INT32 y, INT32 Bank, INT32 Attr) { -#ifdef FBA_DEBUG - bprintf(PRINT_NORMAL, _T("8 Pixel Size not Supported! %X, %d, %d, %X, %X\n"), Code, x, y, Bank, Attr); -#else - (void)Code; (void)x; (void)y; (void)Bank; (void)Attr; -#endif -} - -typedef void (*drawsprites_procdef)(int, int, int, int, int); - -static drawsprites_procdef drawsprites_proc[16] = { - drawsprite_invalid, /* 0000 = 08x08 */ - drawsprite_invalid, /* 0001 = 16x08 */ - drawsprite_invalid, /* 0010 = 32x08 */ - drawsprite_invalid, /* 0011 = 64x08 */ - drawsprite_invalid, /* 0100 = 08x16 */ - drawsprite_16x16, /* 0101 = 16x16 */ - drawsprite_32x16, /* 0110 = 32x16 */ - drawsprite_64x16, /* 0111 = 64x16 */ - drawsprite_invalid, /* 1000 = 08x32 */ - drawsprite_16x32, /* 1001 = 16x32 */ - drawsprite_32x32, /* 1010 = 32x32 */ - drawsprite_64x32, /* 1011 = 64x32 */ - drawsprite_invalid, /* 1100 = 08x64 */ - drawsprite_16x64, /* 1101 = 16x64 */ - drawsprite_32x64, /* 1110 = 32x64 */ - drawsprite_64x64 /* 1111 = 64x64 */ -}; - -static void Wc90RenderSprites(INT32 Priority) -{ - INT32 Code, Attr, x, y; - - for (INT32 Offs = 0; Offs < 0x800; Offs += 16) { - INT32 Bank = Wc90SpriteRam[Offs + 0]; - - if ((Bank >> 4) == Priority) { - if (Bank & 4) { - Code = (Wc90SpriteRam[Offs + 2] >> 2) + (Wc90SpriteRam[Offs + 3] << 6); - - x = Wc90SpriteRam[Offs + 8] + ((Wc90SpriteRam[Offs + 9] & 3) << 8); - y = Wc90SpriteRam[Offs + 6] + ((Wc90SpriteRam[Offs + 7] & 1) << 8); - - if (x >= 0x300) x -= 0x400; - - y -= 16; - - Attr = Wc90SpriteRam[Offs + 4]; - (*(drawsprites_proc[Attr & 0x0f]))(Code, x, y, Bank, Attr); - } - } - } -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 4) & 0x0f; - g = (nColour >> 0) & 0x0f; - b = (nColour >> 8) & 0x0f; - - r = (r << 4) | r; - g = (g << 4) | g; - b = (b << 4) | b; - - return BurnHighCol(r, g, b, 0); -} - -static INT32 Wc90CalcPalette() -{ - INT32 i; - - for (i = 0; i < 0x800; i++) { - Wc90Palette[i / 2] = CalcCol(Wc90PaletteRam[i | 1] | (Wc90PaletteRam[i & ~1] << 8)); - } - - return 0; -} - -static void Wc90Draw() -{ - Wc90CalcPalette(); - Wc90RenderBgLayer(); - Wc90RenderSprites(2); - Wc90RenderFgLayer(); - Wc90RenderSprites(1); - Wc90RenderCharLayer(); - Wc90RenderSprites(0); - BurnTransferCopy(Wc90Palette); -} - -static void Wc90tDraw() -{ - Wc90CalcPalette(); - Wc90tRenderBgLayer(); - Wc90RenderSprites(2); - Wc90tRenderFgLayer(); - Wc90RenderSprites(1); - Wc90RenderCharLayer(); - Wc90RenderSprites(0); - BurnTransferCopy(Wc90Palette); -} - -typedef void (*drawscreen_procdef)(void); - -static drawscreen_procdef drawscreen_proc[2] = { - Wc90Draw, - Wc90tDraw, -}; - -static INT32 Wc90Frame() -{ - INT32 nInterleave = 262; - - if (Wc90Reset) Wc90DoReset(); - - Wc90MakeInputs(); - - nCyclesTotal[0] = (INT32)((INT64)8000000 * nBurnCPUSpeedAdjust / (0x0100 * 59.17)); - nCyclesTotal[1] = (INT32)((INT64)8000000 * nBurnCPUSpeedAdjust / (0x0100 * 59.17)); - nCyclesTotal[2] = (INT32)(double)(4000000 / 59.17); - - nCyclesDone[0] = nCyclesDone[1] = nCyclesDone[2] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCurrentCPU; - - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 261) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 261) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - nCurrentCPU = 2; - ZetOpen(nCurrentCPU); - BurnTimerUpdate(i * (nCyclesTotal[2] / nInterleave)); - ZetClose(); - } - - ZetOpen(2); - BurnTimerEndFrame(nCyclesTotal[2]); - if (pBurnSoundOut) { - BurnYM2608Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) (*(drawscreen_proc[nTileType]))(); - - return 0; -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 CharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 TilePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TileXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 256, 260, 264, 268, 272, 276, 280, 284 }; -static INT32 TileYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; -static INT32 SpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 SpriteXOffsets[16] = { 0, 4, 0x200000, 0x200004, 8, 12, 0x200008, 0x20000c, 128, 132, 0x200080, 0x200084, 136, 140, 0x200088, 0x20008c }; -static INT32 SpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 256, 272, 288, 304, 320, 336, 352, 368 }; - -static INT32 Wc90Init() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - Wc90TempGfx = (UINT8*)BurnMalloc(0x80000); - if (Wc90TempGfx == NULL) return 1; - - nRet = BurnLoadRom(Wc90Z80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90Z80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(Wc90Z80Rom2 + 0x00000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90Z80Rom2 + 0x10000, 3, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(Wc90Z80Rom3 + 0x00000, 4, 1); if (nRet != 0) return 1; - - memset(Wc90TempGfx, 0, 0x80000); - nRet = BurnLoadRom(Wc90TempGfx + 0x00000, 5, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, Wc90TempGfx, Wc90CharTiles); - - memset(Wc90TempGfx, 0, 0x80000); - nRet = BurnLoadRom(Wc90TempGfx + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90TempGfx + 0x20000, 7, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, Wc90TempGfx, Wc90FgTiles); - - memset(Wc90TempGfx, 0, 0x80000); - nRet = BurnLoadRom(Wc90TempGfx + 0x00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90TempGfx + 0x20000, 9, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, Wc90TempGfx, Wc90BgTiles); - - memset(Wc90TempGfx, 0, 0x80000); - nRet = BurnLoadRom(Wc90TempGfx + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90TempGfx + 0x20000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90TempGfx + 0x40000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90TempGfx + 0x60000, 13, 1); if (nRet != 0) return 1; - GfxDecode(4096, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, Wc90TempGfx, Wc90Sprites); - - BurnFree(Wc90TempGfx); - - nRet = BurnLoadRom(Wc90YM2608Rom, 14, 1); if (nRet !=0) return 1; - - nRet = BurnLoadRom(Wc90YM2608IRom, 0x80, 1); if (nRet !=0) return 1; - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Wc90Read1); - ZetSetWriteHandler(Wc90Write1); - ZetMapArea(0x0000, 0x7fff, 0, Wc90Z80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, Wc90Z80Rom1 ); - ZetMapArea(0x8000, 0x9fff, 0, Wc90Z80Ram1 + 0x00000); - ZetMapArea(0x8000, 0x9fff, 1, Wc90Z80Ram1 + 0x00000); - ZetMapArea(0x8000, 0x9fff, 2, Wc90Z80Ram1 + 0x00000); - ZetMapArea(0xa000, 0xafff, 0, Wc90FgVideoRam ); - ZetMapArea(0xa000, 0xafff, 1, Wc90FgVideoRam ); - ZetMapArea(0xa000, 0xafff, 2, Wc90FgVideoRam ); - ZetMapArea(0xb000, 0xbfff, 0, Wc90Z80Ram1 + 0x02000); - ZetMapArea(0xb000, 0xbfff, 1, Wc90Z80Ram1 + 0x02000); - ZetMapArea(0xb000, 0xbfff, 2, Wc90Z80Ram1 + 0x02000); - ZetMapArea(0xc000, 0xcfff, 0, Wc90BgVideoRam ); - ZetMapArea(0xc000, 0xcfff, 1, Wc90BgVideoRam ); - ZetMapArea(0xc000, 0xcfff, 2, Wc90BgVideoRam ); - ZetMapArea(0xd000, 0xdfff, 0, Wc90Z80Ram1 + 0x03000); - ZetMapArea(0xd000, 0xdfff, 1, Wc90Z80Ram1 + 0x03000); - ZetMapArea(0xd000, 0xdfff, 2, Wc90Z80Ram1 + 0x03000); - ZetMapArea(0xe000, 0xefff, 0, Wc90TextVideoRam ); - ZetMapArea(0xe000, 0xefff, 1, Wc90TextVideoRam ); - ZetMapArea(0xe000, 0xefff, 2, Wc90TextVideoRam ); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90Z80Rom1 + 0x10000); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90Z80Rom1 + 0x10000); - ZetMapArea(0xf800, 0xfbff, 0, Wc90SharedRam ); - ZetMapArea(0xf800, 0xfbff, 1, Wc90SharedRam ); - ZetMapArea(0xf800, 0xfbff, 2, Wc90SharedRam ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetWriteHandler(Wc90Write2); - ZetMapArea(0x0000, 0xbfff, 0, Wc90Z80Rom2 ); - ZetMapArea(0x0000, 0xbfff, 2, Wc90Z80Rom2 ); - ZetMapArea(0xc000, 0xcfff, 0, Wc90Z80Ram2 + 0x00000); - ZetMapArea(0xc000, 0xcfff, 1, Wc90Z80Ram2 + 0x00000); - ZetMapArea(0xc000, 0xcfff, 2, Wc90Z80Ram2 + 0x00000); - ZetMapArea(0xd000, 0xd7ff, 0, Wc90SpriteRam ); - ZetMapArea(0xd000, 0xd7ff, 1, Wc90SpriteRam ); - ZetMapArea(0xd000, 0xd7ff, 2, Wc90SpriteRam ); - ZetMapArea(0xd800, 0xdfff, 0, Wc90Z80Ram2 + 0x01000); - ZetMapArea(0xd800, 0xdfff, 1, Wc90Z80Ram2 + 0x01000); - ZetMapArea(0xd800, 0xdfff, 2, Wc90Z80Ram2 + 0x01000); - ZetMapArea(0xe000, 0xe7ff, 0, Wc90PaletteRam ); - ZetMapArea(0xe000, 0xe7ff, 1, Wc90PaletteRam ); - ZetMapArea(0xe000, 0xe7ff, 2, Wc90PaletteRam ); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90Z80Rom2 + 0x10000); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90Z80Rom2 + 0x10000); - ZetMapArea(0xf800, 0xfbff, 0, Wc90SharedRam ); - ZetMapArea(0xf800, 0xfbff, 1, Wc90SharedRam ); - ZetMapArea(0xf800, 0xfbff, 2, Wc90SharedRam ); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetSetReadHandler(Wc90Read3); - ZetSetWriteHandler(Wc90Write3); - ZetMapArea(0x0000, 0xbfff, 0, Wc90Z80Rom3 ); - ZetMapArea(0x0000, 0xbfff, 2, Wc90Z80Rom3 ); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90Z80Ram3 ); - ZetMapArea(0xf000, 0xf7ff, 1, Wc90Z80Ram3 ); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90Z80Ram3 ); - ZetClose(); - - GenericTilesInit(); - - BurnSetRefreshRate(59.17); - - INT32 Wc90YM2608RomSize = 0x20000; - BurnYM2608Init(8000000, Wc90YM2608Rom, &Wc90YM2608RomSize, Wc90YM2608IRom, &wc90FMIRQHandler, wc90SynchroniseStream, wc90GetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2608SetRoute(BURN_SND_YM2608_AY8910_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - - Wc90DoReset(); - - return 0; -} - -static INT32 Wc90tInit() -{ - nTileType = 1; - - return Wc90Init(); -} - -static INT32 Wc90Exit() -{ - ZetExit(); - GenericTilesExit(); - BurnYM2608Exit(); - - BurnFree(Mem); - - Wc90Scroll0YLo = 0; - Wc90Scroll0YHi = 0; - Wc90Scroll0XLo = 0; - Wc90Scroll0XHi = 0; - Wc90Scroll1YLo = 0; - Wc90Scroll1YHi = 0; - Wc90Scroll1XLo = 0; - Wc90Scroll1XHi = 0; - Wc90Scroll2YLo = 0; - Wc90Scroll2YHi = 0; - Wc90Scroll2XLo = 0; - Wc90Scroll2XHi = 0; - Wc90SoundLatch = 0; - - nTileType = 0; - - return 0; -} - -static INT32 Wc90Scan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029721; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnYM2608Scan(nAction, pnMin); - - SCAN_VAR(Wc90SoundLatch); - SCAN_VAR(Wc90Input); - SCAN_VAR(Wc90Dip); - SCAN_VAR(Wc90Scroll0YLo); - SCAN_VAR(Wc90Scroll0YHi); - SCAN_VAR(Wc90Scroll0XLo); - SCAN_VAR(Wc90Scroll0XHi); - SCAN_VAR(Wc90Scroll1YLo); - SCAN_VAR(Wc90Scroll1YHi); - SCAN_VAR(Wc90Scroll1XLo); - SCAN_VAR(Wc90Scroll1XHi); - SCAN_VAR(Wc90Scroll2YLo); - SCAN_VAR(Wc90Scroll2YHi); - SCAN_VAR(Wc90Scroll2XLo); - SCAN_VAR(Wc90Scroll2XHi); - SCAN_VAR(Wc90Z80BankAddress1); - SCAN_VAR(Wc90Z80BankAddress2); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90Z80Rom1 + Wc90Z80BankAddress1); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90Z80Rom1 + Wc90Z80BankAddress1); - ZetClose(); - - ZetOpen(1); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90Z80Rom2 + Wc90Z80BankAddress2); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90Z80Rom2 + Wc90Z80BankAddress2); - ZetClose(); - } - } - - return 0; -} - -struct BurnDriver BurnDrvYm2608 = { - "ym2608", NULL, NULL, NULL, "1989", - "YM2608 Internal ROM\0", "Internal ROM only", "Yamaha", "YM2608 Internal ROM", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_BOARDROM, 0, HARDWARE_MISC_PRE90S, GBF_BIOS, 0, - NULL, Ym2608RomInfo, Ym2608RomName, NULL, NULL, Wc90InputInfo, NULL, - NULL, NULL, NULL, NULL, NULL, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWc90 = { - "wc90", NULL, "ym2608", NULL, "1989", - "World Cup '90 (World)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, Wc90RomInfo, Wc90RomName, NULL, NULL, Wc90InputInfo, Wc90DIPInfo, - Wc90Init, Wc90Exit, Wc90Frame, NULL, Wc90Scan, - NULL, 0x400, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWc90a = { - "wc90a", "wc90", "ym2608", NULL, "1989", - "World Cup '90 (Euro set 1)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, Wc90aRomInfo, Wc90aRomName, NULL, NULL, Wc90InputInfo, Wc90DIPInfo, - Wc90Init, Wc90Exit, Wc90Frame, NULL, Wc90Scan, - NULL, 0x400, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWc90b = { - "wc90b", "wc90", "ym2608", NULL, "1989", - "World Cup '90 (Euro set 2)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, Wc90bRomInfo, Wc90bRomName, NULL, NULL, Wc90InputInfo, Wc90DIPInfo, - Wc90Init, Wc90Exit, Wc90Frame, NULL, Wc90Scan, - NULL, 0x400, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWc90t = { - "wc90t", "wc90", "ym2608", NULL, "1989", - "World Cup '90 (trackball)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, Wc90tRomInfo, Wc90tRomName, NULL, NULL, Wc90InputInfo, Wc90DIPInfo, - Wc90tInit, Wc90Exit, Wc90Frame, NULL, Wc90Scan, - NULL, 0x400, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_wc90b.cpp b/jan/src/burn/drv/pre90s/d_wc90b.cpp deleted file mode 100644 index eab328d06..000000000 --- a/jan/src/burn/drv/pre90s/d_wc90b.cpp +++ /dev/null @@ -1,1120 +0,0 @@ -// FB Alpha World Cup 90 (bootleg) driver module -// Based on MAME driver by Ernesto Corvi - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "msm5205.h" - -static UINT8 Wc90b1InputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 Wc90b1InputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 Wc90b1Dip[2] = {0, 0}; -static UINT8 Wc90b1Input[2] = {0x00, 0x00}; -static UINT8 Wc90b1Reset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Wc90b1Z80Rom1 = NULL; -static UINT8 *Wc90b1Z80Rom2 = NULL; -static UINT8 *Wc90b1Z80Rom3 = NULL; -static UINT8 *Wc90b1Z80Ram1 = NULL; -static UINT8 *Wc90b1Z80Ram2 = NULL; -static UINT8 *Wc90b1Z80Ram3 = NULL; -static UINT8 *Wc90b1FgVideoRam = NULL; -static UINT8 *Wc90b1BgVideoRam = NULL; -static UINT8 *Wc90b1TextVideoRam = NULL; -static UINT8 *Wc90b1SpriteRam = NULL; -static UINT8 *Wc90b1PaletteRam = NULL; -static UINT8 *Wc90b1SharedRam = NULL; -static UINT32 *Wc90b1Palette = NULL; -static UINT8 *Wc90b1CharTiles = NULL; -static UINT8 *Wc90b1Tiles = NULL; -static UINT8 *Wc90b1Sprites = NULL; -static UINT8 *Wc90b1TempGfx = NULL; - -static UINT8 Wc90b1Scroll0Y; -static UINT8 Wc90b1Scroll0X; -static UINT8 Wc90b1Scroll1Y; -static UINT8 Wc90b1Scroll1X; -static UINT8 Wc90b1ScrollXLo; - -static UINT8 Wc90b1SoundLatch = 0; -static INT32 Wc90b1MSM5205Next; - -static INT32 nCyclesDone[3], nCyclesTotal[3]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo Wc90b1InputList[] = { - {"Coin 1" , BIT_DIGITAL , Wc90b1InputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , Wc90b1InputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , Wc90b1InputPort1 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , Wc90b1InputPort1 + 6, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , Wc90b1InputPort0 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Wc90b1InputPort0 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Wc90b1InputPort0 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Wc90b1InputPort0 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , Wc90b1InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , Wc90b1InputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , Wc90b1InputPort1 + 3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Wc90b1InputPort1 + 2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Wc90b1InputPort1 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Wc90b1InputPort1 + 0, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , Wc90b1InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , Wc90b1InputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &Wc90b1Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, Wc90b1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, Wc90b1Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Wc90b1) - -inline static void Wc90b1ClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -inline static void Wc90b1MakeInputs() -{ - Wc90b1Input[0] = Wc90b1Input[1] = 0x00; - - for (INT32 i = 0; i < 8; i++) { - Wc90b1Input[0] |= (Wc90b1InputPort0[i] & 1) << i; - Wc90b1Input[1] |= (Wc90b1InputPort1[i] & 1) << i; - } - - Wc90b1ClearOpposites(&Wc90b1Input[0]); - Wc90b1ClearOpposites(&Wc90b1Input[1]); -} - -static struct BurnDIPInfo Wc90b1DIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 16 , "Coinage" }, - {0x11, 0x01, 0x0f, 0x00, "10 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x08, " 9 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x04, " 8 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0c, " 7 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x02, " 6 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0a, " 5 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x06, " 4 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0e, " 3 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x01, " 2 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x09, " 2 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0f, " 1 Coin 1 Credit" }, - {0x11, 0x01, 0x0f, 0x07, " 1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, " 1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x03, " 1 Coin 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, " 1 Coin 5 Credits" }, - {0x11, 0x01, 0x0f, 0x05, " 1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x30, 0x30, "Easy" }, - {0x11, 0x01, 0x30, 0x10, "Normal" }, - {0x11, 0x01, 0x30, 0x20, "Hard" }, - {0x11, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Countdown Speed" }, - {0x11, 0x01, 0x40, 0x40, "Normal" }, - {0x11, 0x01, 0x40, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "1 Player Game Time" }, - {0x12, 0x01, 0x03, 0x01, "1:00" }, - {0x12, 0x01, 0x03, 0x02, "1:30" }, - {0x12, 0x01, 0x03, 0x03, "2:00" }, - {0x12, 0x01, 0x03, 0x00, "2:30" }, - - {0 , 0xfe, 0 , 8 , "2 Players Game Time" }, - {0x12, 0x01, 0x1c, 0x0c, "1:00" }, - {0x12, 0x01, 0x1c, 0x14, "1:30" }, - {0x12, 0x01, 0x1c, 0x04, "2:00" }, - {0x12, 0x01, 0x1c, 0x18, "2:30" }, - {0x12, 0x01, 0x1c, 0x1c, "3:00" }, - {0x12, 0x01, 0x1c, 0x08, "3:30" }, - {0x12, 0x01, 0x1c, 0x10, "4:00" }, - {0x12, 0x01, 0x1c, 0x00, "5:00" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x12, 0x01, 0x80, 0x00, "English" }, - {0x12, 0x01, 0x80, 0x80, "Japanese" }, -}; - -STDDIPINFO(Wc90b1) - -static struct BurnRomInfo Wc90b1RomDesc[] = { - { "a02.bin", 0x10000, 0x192a03dd, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a03.bin", 0x10000, 0xf54ff17a, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "a04.bin", 0x10000, 0x3d535e2f, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - { "a05.bin", 0x10000, 0x9e421c4b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "a01.bin", 0x10000, 0x3d317622, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program Code - - { "a06.bin", 0x04000, 0x3b5387b7, BRF_GRA }, // 5 Characters - { "a08.bin", 0x04000, 0xc622a5a3, BRF_GRA }, // 6 Characters - { "a10.bin", 0x04000, 0x0923d9f6, BRF_GRA }, // 7 Characters - { "a20.bin", 0x04000, 0xb8dec83e, BRF_GRA }, // 8 Characters - { "a07.bin", 0x20000, 0x38c31817, BRF_GRA }, // 9 Fg Tiles - { "a09.bin", 0x20000, 0x32e39e29, BRF_GRA }, // 10 Fg Tiles - { "a11.bin", 0x20000, 0x5ccec796, BRF_GRA }, // 11 Bg Tiles - { "a21.bin", 0x20000, 0x0c54a091, BRF_GRA }, // 12 Bg Tiles - { "146_a12.bin", 0x10000, 0xd5a60096, BRF_GRA }, // 13 Sprites - { "147_a13.bin", 0x10000, 0x36bbf467, BRF_GRA }, // 14 Sprites - { "148_a14.bin", 0x10000, 0x26371c18, BRF_GRA }, // 15 Sprites - { "149_a15.bin", 0x10000, 0x75aa9b86, BRF_GRA }, // 16 Sprites - { "150_a16.bin", 0x10000, 0x0da825f9, BRF_GRA }, // 17 Sprites - { "151_a17.bin", 0x10000, 0x228429d8, BRF_GRA }, // 18 Sprites - { "152_a18.bin", 0x10000, 0x516b6c09, BRF_GRA }, // 19 Sprites - { "153_a19.bin", 0x10000, 0xf36390a9, BRF_GRA }, // 20 Sprites - - { "el_ic39_gal16v8_0.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 21 PLDs - { "el_ic44_gal16v8_1.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 22 PLDs - { "el_ic54_gal16v8_2.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 23 PLDs - { "el_ic100_gal16v8_3.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 24 PLDs - { "el_ic143_gal16v8_4.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 25 PLDs -}; - -STD_ROM_PICK(Wc90b1) -STD_ROM_FN(Wc90b1) - -static struct BurnRomInfo Wc90b2RomDesc[] = { - { "a02", 0x10000, 0x1e6e94c9, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a03.bin", 0x10000, 0xf54ff17a, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "a04.bin", 0x10000, 0x3d535e2f, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - { "a05.bin", 0x10000, 0x9e421c4b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "a01.bin", 0x10000, 0x3d317622, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program Code - - { "a06", 0x08000, 0x0c054481, BRF_GRA }, // 5 Characters - { "a08", 0x08000, 0xebb3eb48, BRF_GRA }, // 6 Characters - { "a10", 0x08000, 0xc0232af8, BRF_GRA }, // 7 Characters - { "a20", 0x08000, 0xa36e17fb, BRF_GRA }, // 8 Characters - { "a07.bin", 0x20000, 0x38c31817, BRF_GRA }, // 9 Fg Tiles - { "a09.bin", 0x20000, 0x32e39e29, BRF_GRA }, // 10 Fg Tiles - { "a11.bin", 0x20000, 0x5ccec796, BRF_GRA }, // 11 Bg Tiles - { "a21.bin", 0x20000, 0x0c54a091, BRF_GRA }, // 12 Bg Tiles - { "146_a12.bin", 0x10000, 0xd5a60096, BRF_GRA }, // 13 Sprites - { "147_a13", 0x10000, 0x5b16fd48, BRF_GRA }, // 14 Sprites - { "148_a14.bin", 0x10000, 0x26371c18, BRF_GRA }, // 15 Sprites - { "149_a15", 0x10000, 0xb2423962, BRF_GRA }, // 16 Sprites - { "150_a16.bin", 0x10000, 0x0da825f9, BRF_GRA }, // 17 Sprites - { "151_a17", 0x10000, 0xaf98778e, BRF_GRA }, // 18 Sprites - { "152_a18.bin", 0x10000, 0x516b6c09, BRF_GRA }, // 19 Sprites - { "153_a19", 0x10000, 0x8caa2745, BRF_GRA }, // 20 Sprites - - { "el_ic39_gal16v8_0.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 21 PLDs - { "el_ic44_gal16v8_1.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 22 PLDs - { "el_ic54_gal16v8_2.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 23 PLDs - { "el_ic100_gal16v8_3.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 24 PLDs - { "el_ic143_gal16v8_4.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 25 PLDs -}; - -STD_ROM_PICK(Wc90b2) -STD_ROM_FN(Wc90b2) - -static struct BurnRomInfo Wc90b3RomDesc[] = { - { "2.bin", 0x08000, 0x84cb2bf5, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a03.bin", 0x10000, 0xf54ff17a, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "a04.bin", 0x10000, 0x3d535e2f, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - { "a05.bin", 0x10000, 0x9e421c4b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "a01.bin", 0x10000, 0x3d317622, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program Code - - { "a06", 0x08000, 0x0c054481, BRF_GRA }, // 5 Characters - { "a08", 0x08000, 0xebb3eb48, BRF_GRA }, // 6 Characters - { "a10", 0x08000, 0xc0232af8, BRF_GRA }, // 7 Characters - { "a20", 0x08000, 0xa36e17fb, BRF_GRA }, // 8 Characters - { "a07.bin", 0x20000, 0x38c31817, BRF_GRA }, // 9 Fg Tiles - { "a09.bin", 0x20000, 0x32e39e29, BRF_GRA }, // 10 Fg Tiles - { "a11.bin", 0x20000, 0x5ccec796, BRF_GRA }, // 11 Bg Tiles - { "a21.bin", 0x20000, 0x0c54a091, BRF_GRA }, // 12 Bg Tiles - { "146_a12.bin", 0x10000, 0xd5a60096, BRF_GRA }, // 13 Sprites - { "147_a13", 0x10000, 0x5b16fd48, BRF_GRA }, // 14 Sprites - { "148_a14.bin", 0x10000, 0x26371c18, BRF_GRA }, // 15 Sprites - { "149_a15", 0x10000, 0xb2423962, BRF_GRA }, // 16 Sprites - { "150_a16.bin", 0x10000, 0x0da825f9, BRF_GRA }, // 17 Sprites - { "151_a17", 0x10000, 0xaf98778e, BRF_GRA }, // 18 Sprites - { "152_a18.bin", 0x10000, 0x516b6c09, BRF_GRA }, // 19 Sprites - { "153_a19", 0x10000, 0x8caa2745, BRF_GRA }, // 20 Sprites - - { "el_ic39_gal16v8_0.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 21 PLDs - { "el_ic44_gal16v8_1.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 22 PLDs - { "el_ic54_gal16v8_2.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 23 PLDs - { "el_ic100_gal16v8_3.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 24 PLDs - { "el_ic143_gal16v8_4.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 25 PLDs -}; - -STD_ROM_PICK(Wc90b3) -STD_ROM_FN(Wc90b3) - -static struct BurnRomInfo Wc90b4RomDesc[] = { - { "a02", 0x10000, 0x1e6e94c9, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a03.bin", 0x10000, 0xf54ff17a, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "a04.bin", 0x10000, 0x3d535e2f, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - { "a05.bin", 0x10000, 0x9e421c4b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "1.bin", 0x10000, 0x521e1b1c, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program Code - - { "a06", 0x08000, 0x0c054481, BRF_GRA }, // 5 Characters - { "a08", 0x08000, 0xebb3eb48, BRF_GRA }, // 6 Characters - { "a10", 0x08000, 0xc0232af8, BRF_GRA }, // 7 Characters - { "a20", 0x08000, 0xa36e17fb, BRF_GRA }, // 8 Characters - { "a07.bin", 0x20000, 0x38c31817, BRF_GRA }, // 9 Fg Tiles - { "a09.bin", 0x20000, 0x32e39e29, BRF_GRA }, // 10 Fg Tiles - { "a11.bin", 0x20000, 0x5ccec796, BRF_GRA }, // 11 Bg Tiles - { "a21.bin", 0x20000, 0x0c54a091, BRF_GRA }, // 12 Bg Tiles - { "146_a12.bin", 0x10000, 0xd5a60096, BRF_GRA }, // 13 Sprites - { "147_a13", 0x10000, 0x5b16fd48, BRF_GRA }, // 14 Sprites - { "148_a14.bin", 0x10000, 0x26371c18, BRF_GRA }, // 15 Sprites - { "149_a15", 0x10000, 0xb2423962, BRF_GRA }, // 16 Sprites - { "150_a16.bin", 0x10000, 0x0da825f9, BRF_GRA }, // 17 Sprites - { "151_a17", 0x10000, 0xaf98778e, BRF_GRA }, // 18 Sprites - { "152_a18.bin", 0x10000, 0x516b6c09, BRF_GRA }, // 19 Sprites - { "153_a19", 0x10000, 0x8caa2745, BRF_GRA }, // 20 Sprites - - { "el_ic39_gal16v8_0.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 21 PLDs - { "el_ic44_gal16v8_1.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 22 PLDs - { "el_ic54_gal16v8_2.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 23 PLDs - { "el_ic100_gal16v8_3.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 24 PLDs - { "el_ic143_gal16v8_4.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 25 PLDs -}; - -STD_ROM_PICK(Wc90b4) -STD_ROM_FN(Wc90b4) - -static struct BurnRomInfo Wc90baRomDesc[] = { - { "a02.bin", 0x10000, 0x192a03dd, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a03.bin", 0x10000, 0xf54ff17a, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "a04.bin", 0x10000, 0x3d535e2f, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - { "el_ic98_27c512_05.bin", 0x10000, 0xc70d8c13, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "a01.bin", 0x10000, 0x3d317622, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program Code - - { "a06.bin", 0x04000, 0x3b5387b7, BRF_GRA }, // 5 Characters - { "a08.bin", 0x04000, 0xc622a5a3, BRF_GRA }, // 6 Characters - { "a10.bin", 0x04000, 0x0923d9f6, BRF_GRA }, // 7 Characters - { "a20.bin", 0x04000, 0xb8dec83e, BRF_GRA }, // 8 Characters - { "a07.bin", 0x20000, 0x38c31817, BRF_GRA }, // 9 Fg Tiles - { "a09.bin", 0x20000, 0x32e39e29, BRF_GRA }, // 10 Fg Tiles - { "a11.bin", 0x20000, 0x5ccec796, BRF_GRA }, // 11 Bg Tiles - { "a21.bin", 0x20000, 0x0c54a091, BRF_GRA }, // 12 Bg Tiles - { "146_a12.bin", 0x10000, 0xd5a60096, BRF_GRA }, // 13 Sprites - { "147_a13.bin", 0x10000, 0x36bbf467, BRF_GRA }, // 14 Sprites - { "148_a14.bin", 0x10000, 0x26371c18, BRF_GRA }, // 15 Sprites - { "149_a15.bin", 0x10000, 0x75aa9b86, BRF_GRA }, // 16 Sprites - { "150_a16.bin", 0x10000, 0x0da825f9, BRF_GRA }, // 17 Sprites - { "151_a17.bin", 0x10000, 0x228429d8, BRF_GRA }, // 18 Sprites - { "152_a18.bin", 0x10000, 0x516b6c09, BRF_GRA }, // 19 Sprites - { "153_a19.bin", 0x10000, 0xf36390a9, BRF_GRA }, // 20 Sprites - - { "el_ic39_gal16v8_0.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 21 PLDs - { "el_ic44_gal16v8_1.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 22 PLDs - { "el_ic54_gal16v8_2.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 23 PLDs - { "el_ic100_gal16v8_3.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 24 PLDs - { "el_ic143_gal16v8_4.bin", 0x00117, 0x00000000, BRF_OPT | BRF_NODUMP }, // 25 PLDs -}; - -STD_ROM_PICK(Wc90ba) -STD_ROM_FN(Wc90ba) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Wc90b1Z80Rom1 = Next; Next += 0x20000; - Wc90b1Z80Rom2 = Next; Next += 0x20000; - Wc90b1Z80Rom3 = Next; Next += 0x10000; - - RamStart = Next; - - Wc90b1Z80Ram1 = Next; Next += 0x04000; - Wc90b1Z80Ram2 = Next; Next += 0x01800; - Wc90b1Z80Ram3 = Next; Next += 0x00800; - Wc90b1FgVideoRam = Next; Next += 0x01000; - Wc90b1BgVideoRam = Next; Next += 0x01000; - Wc90b1TextVideoRam = Next; Next += 0x01000; - Wc90b1SpriteRam = Next; Next += 0x00800; - Wc90b1PaletteRam = Next; Next += 0x00800; - Wc90b1SharedRam = Next; Next += 0x00400; - - RamEnd = Next; - - Wc90b1CharTiles = Next; Next += (2048 * 8 * 8); - Wc90b1Tiles = Next; Next += (4096 * 16 * 16); - Wc90b1Sprites = Next; Next += (4096 * 16 * 16); - Wc90b1Palette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 Wc90b1DoReset() -{ - Wc90b1Scroll0X = Wc90b1Scroll0Y = 0; - Wc90b1Scroll1X = Wc90b1Scroll1Y = 0; - Wc90b1ScrollXLo = 0; - - Wc90b1SoundLatch = 0; - Wc90b1MSM5205Next = 0; - - for (INT32 i = 0; i < 3; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - BurnYM2203Reset(); - MSM5205Reset(); - -// HiscoreReset(); - - return 0; -} - -UINT8 __fastcall Wc90b1Read1(UINT16 a) -{ - switch (a) { - case 0xfd00: { - return 0xff - Wc90b1Input[0]; - } - - case 0xfd02: { - return 0xff - Wc90b1Input[1]; - } - - case 0xfd06: { - return Wc90b1Dip[0]; - } - - case 0xfd08: { - return Wc90b1Dip[1]; - } - - case 0xfd0c: { - // ??? - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Wc90b1Write1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xfc00: { - INT32 BankAddress; - - BankAddress = 0x10000 + ((d & 0xf8) << 8); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90b1Z80Rom1 + BankAddress); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90b1Z80Rom1 + BankAddress); - return; - } - - case 0xfd00: { - Wc90b1SoundLatch = d; - ZetClose(); - ZetOpen(2); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - } - - case 0xfd04: { - Wc90b1Scroll0Y = d; - return; - } - - case 0xfd06: { - Wc90b1Scroll0X = d; - return; - } - - case 0xfd08: { - Wc90b1Scroll1Y = d; - return; - } - - case 0xfd0a: { - Wc90b1Scroll1X = d; - return; - } - - case 0xfd0e: { - Wc90b1ScrollXLo = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Wc90b1Read2(UINT16 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Wc90b1Write2(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xfc00: { - INT32 BankAddress; - - BankAddress = 0x10000 + ((d & 0xf8) << 8); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90b1Z80Rom2 + BankAddress); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90b1Z80Rom2 + BankAddress); - return; - } - - case 0xfd0c: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Wc90b1Read3(UINT16 a) -{ - switch (a) { - case 0xe800: { - return BurnYM2203Read(0, 0); - } - - case 0xf800: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return Wc90b1SoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #3 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Wc90b1Write3(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - INT32 BankAddress; - - BankAddress = 0x8000 + ((d & 0x01) * 0x4000); - ZetMapArea(0x8000, 0xbfff, 0, Wc90b1Z80Rom3 + BankAddress); - ZetMapArea(0x8000, 0xbfff, 2, Wc90b1Z80Rom3 + BankAddress); - - MSM5205ResetWrite(0, d & 0x08); - return; - } - - case 0xe400: { - Wc90b1MSM5205Next = d; - return; - } - - case 0xe800: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0xe801: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xec00: - case 0xec01: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #3 Write => %04X, %02X\n"), a, d); - } - } -} - -inline static INT32 Wc90b1SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(double)ZetTotalCycles() * nSoundRate / 5000000; -} - -inline static double Wc90b1GetTime() -{ - return (double)ZetTotalCycles() / 5000000; -} - -static void Wc90b1MSM5205Vck0() -{ - static INT32 Toggle = 0; - - Toggle ^= 1; - - if (Toggle) { - MSM5205DataWrite(0, (Wc90b1MSM5205Next & 0xf0) >> 4); - ZetNmi(); - } else { - MSM5205DataWrite(0, Wc90b1MSM5205Next & 0x0f); - } -} - -static INT32 CharPlaneOffsets[4] = { 0, 0x20000, 0x40000, 0x60000 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 TilePlaneOffsets[4] = { 0, 0x100000, 0x200000, 0x300000 }; -static INT32 TileXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007 }; -static INT32 TileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 0x4000, 0x4008, 0x4010, 0x4018, 0x4020, 0x4028, 0x4030, 0x4038 }; -static INT32 SpritePlaneOffsets[4] = { 0x300000, 0x200000, 0x100000, 0 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; - -static INT32 Wc90b1Init() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - Wc90b1TempGfx = (UINT8*)BurnMalloc(0x80000); - if (Wc90b1TempGfx == NULL) return 1; - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(Wc90b1Z80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1Z80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(Wc90b1Z80Rom2 + 0x00000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1Z80Rom2 + 0x10000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Rom - nRet = BurnLoadRom(Wc90b1Z80Rom3 + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and Decode Char Tile Roms - memset(Wc90b1TempGfx, 0, 0x80000); - nRet = BurnLoadRom(Wc90b1TempGfx + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x04000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x08000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x0c000, 8, 1); if (nRet != 0) return 1; - GfxDecode(2048, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x40, Wc90b1TempGfx, Wc90b1CharTiles); - - // Load and Decode Tile Roms - memset(Wc90b1TempGfx, 0, 0x80000); - nRet = BurnLoadRom(Wc90b1TempGfx + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x20000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x40000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x60000, 12, 1); if (nRet != 0) return 1; - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x00000, Wc90b1Tiles + ( 0 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x02000, Wc90b1Tiles + ( 1 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x04000, Wc90b1Tiles + ( 2 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x06000, Wc90b1Tiles + ( 3 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x08000, Wc90b1Tiles + ( 4 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x0a000, Wc90b1Tiles + ( 5 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x0c000, Wc90b1Tiles + ( 6 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x0e000, Wc90b1Tiles + ( 7 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x10000, Wc90b1Tiles + ( 8 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x12000, Wc90b1Tiles + ( 9 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x14000, Wc90b1Tiles + (10 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x16000, Wc90b1Tiles + (11 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x18000, Wc90b1Tiles + (12 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x1a000, Wc90b1Tiles + (13 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x1c000, Wc90b1Tiles + (14 * 256 * 16 * 16)); - GfxDecode(256, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, Wc90b1TempGfx + 0x1e000, Wc90b1Tiles + (15 * 256 * 16 * 16)); - - // Load and Decode Sprite Roms - memset(Wc90b1TempGfx, 0, 0x80000); - nRet = BurnLoadRom(Wc90b1TempGfx + 0x00000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x10000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x20000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x30000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x40000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x50000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x60000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Wc90b1TempGfx + 0x70000, 20, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x80000; i++) { - Wc90b1TempGfx[i] ^= 0xff; - } - GfxDecode(4096, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, Wc90b1TempGfx, Wc90b1Sprites); - - BurnFree(Wc90b1TempGfx); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Wc90b1Read1); - ZetSetWriteHandler(Wc90b1Write1); - ZetMapArea(0x0000, 0x7fff, 0, Wc90b1Z80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, Wc90b1Z80Rom1 ); - ZetMapArea(0x8000, 0x9fff, 0, Wc90b1Z80Ram1 + 0x00000); - ZetMapArea(0x8000, 0x9fff, 1, Wc90b1Z80Ram1 + 0x00000); - ZetMapArea(0x8000, 0x9fff, 2, Wc90b1Z80Ram1 + 0x00000); - ZetMapArea(0xa000, 0xafff, 0, Wc90b1FgVideoRam ); - ZetMapArea(0xa000, 0xafff, 1, Wc90b1FgVideoRam ); - ZetMapArea(0xa000, 0xafff, 2, Wc90b1FgVideoRam ); - ZetMapArea(0xc000, 0xcfff, 0, Wc90b1BgVideoRam ); - ZetMapArea(0xc000, 0xcfff, 1, Wc90b1BgVideoRam ); - ZetMapArea(0xc000, 0xcfff, 2, Wc90b1BgVideoRam ); - ZetMapArea(0xd000, 0xdfff, 0, Wc90b1Z80Ram1 + 0x03000); - ZetMapArea(0xd000, 0xdfff, 1, Wc90b1Z80Ram1 + 0x03000); - ZetMapArea(0xd000, 0xdfff, 2, Wc90b1Z80Ram1 + 0x03000); - ZetMapArea(0xe000, 0xefff, 0, Wc90b1TextVideoRam ); - ZetMapArea(0xe000, 0xefff, 1, Wc90b1TextVideoRam ); - ZetMapArea(0xe000, 0xefff, 2, Wc90b1TextVideoRam ); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90b1Z80Rom1 + 0x10000); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90b1Z80Rom1 + 0x10000); - ZetMapArea(0xf800, 0xfbff, 0, Wc90b1SharedRam ); - ZetMapArea(0xf800, 0xfbff, 1, Wc90b1SharedRam ); - ZetMapArea(0xf800, 0xfbff, 2, Wc90b1SharedRam ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(Wc90b1Read2); - ZetSetWriteHandler(Wc90b1Write2); - ZetMapArea(0x0000, 0xbfff, 0, Wc90b1Z80Rom2 ); - ZetMapArea(0x0000, 0xbfff, 2, Wc90b1Z80Rom2 ); - ZetMapArea(0xc000, 0xcfff, 0, Wc90b1Z80Ram2 + 0x00000); - ZetMapArea(0xc000, 0xcfff, 1, Wc90b1Z80Ram2 + 0x00000); - ZetMapArea(0xc000, 0xcfff, 2, Wc90b1Z80Ram2 + 0x00000); - ZetMapArea(0xd000, 0xd7ff, 0, Wc90b1SpriteRam ); - ZetMapArea(0xd000, 0xd7ff, 1, Wc90b1SpriteRam ); - ZetMapArea(0xd000, 0xd7ff, 2, Wc90b1SpriteRam ); - ZetMapArea(0xd800, 0xdfff, 0, Wc90b1Z80Ram2 + 0x01000); - ZetMapArea(0xd800, 0xdfff, 1, Wc90b1Z80Ram2 + 0x01000); - ZetMapArea(0xd800, 0xdfff, 2, Wc90b1Z80Ram2 + 0x01000); - ZetMapArea(0xe000, 0xe7ff, 0, Wc90b1PaletteRam ); - ZetMapArea(0xe000, 0xe7ff, 1, Wc90b1PaletteRam ); - ZetMapArea(0xe000, 0xe7ff, 2, Wc90b1PaletteRam ); - ZetMapArea(0xe800, 0xefff, 0, Wc90b1Z80Rom2 + 0x0e800); - ZetMapArea(0xe800, 0xefff, 2, Wc90b1Z80Rom2 + 0x0e800); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90b1Z80Rom2 + 0x10000); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90b1Z80Rom2 + 0x10000); - ZetMapArea(0xf800, 0xfbff, 0, Wc90b1SharedRam ); - ZetMapArea(0xf800, 0xfbff, 1, Wc90b1SharedRam ); - ZetMapArea(0xf800, 0xfbff, 2, Wc90b1SharedRam ); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetSetReadHandler(Wc90b1Read3); - ZetSetWriteHandler(Wc90b1Write3); - ZetMapArea(0x0000, 0x7fff, 0, Wc90b1Z80Rom3 ); - ZetMapArea(0x0000, 0x7fff, 2, Wc90b1Z80Rom3 ); - ZetMapArea(0x8000, 0xbfff, 0, Wc90b1Z80Rom3 + 0x8000 ); - ZetMapArea(0x8000, 0xbfff, 2, Wc90b1Z80Rom3 + 0x8000 ); - ZetMapArea(0xf000, 0xf7ff, 0, Wc90b1Z80Ram3 ); - ZetMapArea(0xf000, 0xf7ff, 1, Wc90b1Z80Ram3 ); - ZetMapArea(0xf000, 0xf7ff, 2, Wc90b1Z80Ram3 ); - ZetClose(); - - GenericTilesInit(); - - BurnYM2203Init(1, 1250000, NULL, Wc90b1SynchroniseStream, Wc90b1GetTime, 0); - BurnTimerAttachZet(5000000); - BurnYM2203SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, Wc90b1SynchroniseStream, 384000, Wc90b1MSM5205Vck0, MSM5205_S96_4B, 1); - MSM5205SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - - Wc90b1DoReset(); - - return 0; -} - -static INT32 Wc90b1Exit() -{ - ZetExit(); - GenericTilesExit(); - BurnYM2203Exit(); - MSM5205Exit(); - - BurnFree(Mem); - - Wc90b1Scroll0X = Wc90b1Scroll0Y = 0; - Wc90b1Scroll1X = Wc90b1Scroll1Y = 0; - Wc90b1ScrollXLo = 0; - Wc90b1SoundLatch = 0; - Wc90b1MSM5205Next = 0; - - return 0; -} - -static void Wc90b1RenderBgLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = Wc90b1BgVideoRam[TileIndex]; - Code = Wc90b1BgVideoRam[TileIndex + 0x800]; - Colour = Attr >> 4; - - Code |= ((Attr & 3) + ((Attr >> 1) & 4)) * 256; - Code |= 2048; - - x = 16 * mx; - y = 16 * my; - - x -= 8 * (Wc90b1Scroll1X & 0x7f) + 256 - 4 + (Wc90b1ScrollXLo & 0x07); - y -= Wc90b1Scroll1Y + 1 + ((Wc90b1Scroll1X & 0x80) ? 256 : 0); - - x &= 0x3ff; - y &= 0x1ff; - - y -= 16; - if (x > 968) x -= 1024; - - if (x > 15 && x < 240 && y > 15 && y < 208) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 768, Wc90b1Tiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 768, Wc90b1Tiles); - } - - TileIndex++; - } - } -} - -static void Wc90b1RenderFgLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = Wc90b1FgVideoRam[TileIndex]; - Code = Wc90b1FgVideoRam[TileIndex + 0x800]; - Colour = Attr >> 4; - - Code |= ((Attr & 3) + ((Attr >> 1) & 4)) * 256; - - x = 16 * mx; - y = 16 * my; - - x -= 8 * (Wc90b1Scroll0X & 0x7f) + 256 - 6 + ((Wc90b1ScrollXLo & 0x38) >> 3); - y -= Wc90b1Scroll0Y + 1 + ((Wc90b1Scroll0X & 0x80) ? 256 : 0); - - x &= 0x3ff; - y &= 0x1ff; - - y -= 16; - if (x > 968) x -= 1024; - - if (x > 15 && x < 240 && y > 15 && y < 208) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 15, 512, Wc90b1Tiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 15, 512, Wc90b1Tiles); - } - - TileIndex++; - } - } -} - -static void Wc90b1RenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = Wc90b1TextVideoRam[TileIndex + 0x800] + ((Wc90b1TextVideoRam[TileIndex] & 0x07) << 8); - Colour = Wc90b1TextVideoRam[TileIndex] >> 4; - - x = 8 * mx; - y = 8 * my; - - x &= 0x1ff; - y &= 0x0ff; - - y -= 16; - - if (x > 7 && x < 248 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 15, 256, Wc90b1CharTiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 15, 256, Wc90b1CharTiles); - } - - TileIndex++; - } - } -} - -static void Wc90b1RenderSpriteLayer(INT32 Priority) -{ - INT32 Offset, sx, sy; - - for (Offset = 0x800 - 8; Offset >= 0; Offset -= 8) { - if ((~(Wc90b1SpriteRam[Offset + 3] >> 7) & 1) == Priority) { - INT32 Code = (Wc90b1SpriteRam[Offset + 3] & 0x3f) << 4; - INT32 Bank = Wc90b1SpriteRam[Offset + 0]; - INT32 Flags = Wc90b1SpriteRam[Offset + 4]; - INT32 xFlip = Bank & 0x01; - INT32 yFlip = Bank & 0x02; - - Code += (Bank & 0xf0) >> 4; - Code <<= 2; - Code += (Bank & 0x0f) >> 2; - - sx = Wc90b1SpriteRam[Offset + 2]; - if (!(Wc90b1SpriteRam[Offset + 3] & 0x40)) sx -= 0x100; - - sy = 240 - Wc90b1SpriteRam[Offset + 1]; - - sy -= 16; - - if (sx > 15 && sx < 240 && sy > 15 && sy < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, sx, sy, Flags >> 4, 4, 15, 0, Wc90b1Sprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Flags >> 4, 4, 15, 0, Wc90b1Sprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, sx, sy, Flags >> 4, 4, 15, 0, Wc90b1Sprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Flags >> 4, 4, 15, 0, Wc90b1Sprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Flags >> 4, 4, 15, 0, Wc90b1Sprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Flags >> 4, 4, 15, 0, Wc90b1Sprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, sy, Flags >> 4, 4, 15, 0, Wc90b1Sprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Flags >> 4, 4, 15, 0, Wc90b1Sprites); - } - } - } - } - } -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 0) & 0x0f; - g = (nColour >> 4) & 0x0f; - b = (nColour >> 8) & 0x0f; - - r = (r << 4) | r; - g = (g << 4) | g; - b = (b << 4) | b; - - return BurnHighCol(r, g, b, 0); -} - -static INT32 Wc90b1CalcPalette() -{ - INT32 i; - - for (i = 0; i < 0x800; i++) { - Wc90b1Palette[i / 2] = CalcCol(Wc90b1PaletteRam[i | 1] | (Wc90b1PaletteRam[i & ~1] << 8)); - } - - return 0; -} - -static void Wc90b1Draw() -{ - BurnTransferClear(); - Wc90b1CalcPalette(); - Wc90b1RenderBgLayer(); - Wc90b1RenderFgLayer(); - Wc90b1RenderSpriteLayer(1); - Wc90b1RenderCharLayer(); - Wc90b1RenderSpriteLayer(0); - BurnTransferCopy(Wc90b1Palette); -} - -static INT32 Wc90b1Frame() -{ - INT32 nInterleave = MSM5205CalcInterleave(0, 5000000); - INT32 nVBlankIRQFire = (INT32)((double)242 / 260 * nInterleave); - - if (Wc90b1Reset) Wc90b1DoReset(); - - Wc90b1MakeInputs(); - - nCyclesTotal[0] = (INT32)((INT64)7159090 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)7159090 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[2] = (INT32)(double)(5000000 / 60); - - nCyclesDone[0] = nCyclesDone[1] = nCyclesDone[2] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext, nCurrentCPU; - - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == nVBlankIRQFire) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == nVBlankIRQFire + 1) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == nVBlankIRQFire) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == nVBlankIRQFire + 1) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - nCurrentCPU = 2; - ZetOpen(nCurrentCPU); - BurnTimerUpdate(i * (nCyclesTotal[2] / nInterleave)); - MSM5205Update(); - ZetClose(); - } - - ZetOpen(2); - BurnTimerEndFrame(nCyclesTotal[2]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) Wc90b1Draw(); - - return 0; -} - -static INT32 Wc90b1Scan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029709; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(Wc90b1SoundLatch); - SCAN_VAR(Wc90b1MSM5205Next); - SCAN_VAR(Wc90b1Input); - SCAN_VAR(Wc90b1Dip); - SCAN_VAR(Wc90b1Scroll0Y); - SCAN_VAR(Wc90b1Scroll0X); - SCAN_VAR(Wc90b1Scroll1Y); - SCAN_VAR(Wc90b1Scroll1X); - SCAN_VAR(Wc90b1ScrollXLo); - } - - return 0; -} - -struct BurnDriver BurnDrvWc90b1 = { - "wc90b1", "wc90", NULL, NULL, "1989", - "Euro League (Italian hack of Tecmo World Cup '90)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, Wc90b1RomInfo, Wc90b1RomName, NULL, NULL, Wc90b1InputInfo, Wc90b1DIPInfo, - Wc90b1Init, Wc90b1Exit, Wc90b1Frame, NULL, Wc90b1Scan, - NULL, 0x400, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWc90b2 = { - "wc90b2", "wc90", NULL, NULL, "1989", - "World Cup '90 (bootleg, set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, Wc90b2RomInfo, Wc90b2RomName, NULL, NULL, Wc90b1InputInfo, Wc90b1DIPInfo, - Wc90b1Init, Wc90b1Exit, Wc90b1Frame, NULL, Wc90b1Scan, - NULL, 0x400, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWc90b3 = { - "wc90b3", "wc90", NULL, NULL, "1989", - "World Cup '90 (bootleg, set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, Wc90b3RomInfo, Wc90b3RomName, NULL, NULL, Wc90b1InputInfo, Wc90b1DIPInfo, - Wc90b1Init, Wc90b1Exit, Wc90b1Frame, NULL, Wc90b1Scan, - NULL, 0x400, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWc90b4 = { - "wc90b4", "wc90", NULL, NULL, "1989", - "World Cup '90 (bootleg, set 3)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, Wc90b4RomInfo, Wc90b4RomName, NULL, NULL, Wc90b1InputInfo, Wc90b1DIPInfo, - Wc90b1Init, Wc90b1Exit, Wc90b1Frame, NULL, Wc90b1Scan, - NULL, 0x400, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWc90ba = { - "wc90ba", "wc90", NULL, NULL, "1989", - "Euro League (Italian hack of Tecmo World Cup '90 - alt version)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_PRE90S, GBF_SPORTSFOOTBALL, 0, - NULL, Wc90baRomInfo, Wc90baRomName, NULL, NULL, Wc90b1InputInfo, Wc90b1DIPInfo, - Wc90b1Init, Wc90b1Exit, Wc90b1Frame, NULL, Wc90b1Scan, - NULL, 0x400, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_wiz.cpp b/jan/src/burn/drv/pre90s/d_wiz.cpp deleted file mode 100644 index 59cd22918..000000000 --- a/jan/src/burn/drv/pre90s/d_wiz.cpp +++ /dev/null @@ -1,1562 +0,0 @@ -// FB Alpha Wiz driver module -// Based on MAME driver by Zsolt Vasvari - -// Wiz Todo: -// scion: static in audio is normal (no kidding), use scionc! -// - -#include "tiles_generic.h" -#include "bitswap.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "samples.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80Dec; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvColRAM0; -static UINT8 *DrvColRAM1; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *sprite_bank; -static UINT8 *interrupt_enable; -static UINT8 *palette_bank; -static UINT8 *char_bank_select; -static UINT8 *screen_flip; -static UINT8 *background_color; - -static INT16 *pAY8910Buffer[9]; - -static UINT8 DrvInputs[2]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static UINT8 bHasSamples = 0; - -static UINT8 Wizmode = 0; -static UINT8 Scionmodeoffset = 0; - -static struct BurnInputInfo WizInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Wiz) - -static struct BurnInputInfo ScionInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Scion) - -static struct BurnInputInfo StingerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Stinger) - -static struct BurnInputInfo KungfutInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Kungfut) - -static struct BurnDIPInfo StingerDIPList[]= -{ - {0x11, 0xff, 0xff, 0xef, NULL }, - {0x12, 0xff, 0xff, 0xae, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x00, "3 Coins 2 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x18, 0x00, "2" }, - {0x11, 0x01, 0x18, 0x08, "3" }, - {0x11, 0x01, 0x18, 0x10, "4" }, - {0x11, 0x01, 0x18, 0x18, "5" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x11, 0x01, 0xe0, 0xe0, "20000 50000" }, - {0x11, 0x01, 0xe0, 0xc0, "20000 60000" }, - {0x11, 0x01, 0xe0, 0xa0, "20000 70000" }, - {0x11, 0x01, 0xe0, 0x80, "20000 80000" }, - {0x11, 0x01, 0xe0, 0x60, "20000 90000" }, - {0x11, 0x01, 0xe0, 0x40, "30000 80000" }, - {0x11, 0x01, 0xe0, 0x20, "30000 90000" }, - {0x11, 0x01, 0xe0, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Debug Mode" }, - {0x12, 0x01, 0x01, 0x00, "Off" }, - {0x12, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x0e, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x0e, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0e, 0x0c, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0e, 0x0a, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0e, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0e, 0x0e, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0e, 0x02, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0e, 0x06, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Bongo Time" }, - {0x12, 0x01, 0x30, 0x30, "Long" }, - {0x12, 0x01, 0x30, 0x20, "Medium" }, - {0x12, 0x01, 0x30, 0x10, "Short" }, - {0x12, 0x01, 0x30, 0x00, "Shortest" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x12, 0x01, 0x40, 0x00, "Normal" }, - {0x12, 0x01, 0x40, 0x40, "Hard" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x80, "Upright" }, - {0x12, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Stinger) - -static struct BurnDIPInfo Stinger2DIPList[]= -{ - {0x11, 0xff, 0xff, 0xef, NULL }, - {0x12, 0xff, 0xff, 0xa0, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x00, "3 Coins 2 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x18, 0x00, "2" }, - {0x11, 0x01, 0x18, 0x08, "3" }, - {0x11, 0x01, 0x18, 0x10, "4" }, - {0x11, 0x01, 0x18, 0x18, "5" }, - - {0 , 0xfe, 0 , 8, "Bonus Life" }, - {0x11, 0x01, 0xe0, 0xe0, "20000 50000" }, - {0x11, 0x01, 0xe0, 0xc0, "20000 60000" }, - {0x11, 0x01, 0xe0, 0xa0, "20000 70000" }, - {0x11, 0x01, 0xe0, 0x80, "20000 80000" }, - {0x11, 0x01, 0xe0, 0x60, "20000 90000" }, - {0x11, 0x01, 0xe0, 0x40, "30000 80000" }, - {0x11, 0x01, 0xe0, 0x20, "30000 90000" }, - {0x11, 0x01, 0xe0, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Debug Mode" }, - {0x12, 0x01, 0x01, 0x00, "Off" }, - {0x12, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x70, 0x70, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x70, 0x60, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x70, 0x50, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x70, 0x40, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x70, 0x30, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x70, 0x20, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x70, 0x10, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x70, 0x00, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x80, 0x80, "Upright" }, - {0x12, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(Stinger2) - -static struct BurnDIPInfo ScionDIPList[]= -{ - {0x11, 0xff, 0xff, 0x05, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x01, 0x01, "Upright" }, - {0x11, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x11, 0x01, 0x02, 0x00, "Easy" }, - {0x11, 0x01, 0x02, 0x02, "Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x0c, 0x00, "2" }, - {0x11, 0x01, 0x0c, 0x04, "3" }, - {0x11, 0x01, 0x0c, 0x08, "4" }, - {0x11, 0x01, 0x0c, 0x0c, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x11, 0x01, 0x30, 0x00, "20000 40000" }, - {0x11, 0x01, 0x30, 0x20, "20000 60000" }, - {0x11, 0x01, 0x30, 0x10, "20000 80000" }, - {0x11, 0x01, 0x30, 0x30, "30000 90000" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x18, 0x18, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x18, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x18, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x18, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 1, "Unused" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - - {0 , 0xfe, 0 , 1, "Unused" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - - {0 , 0xfe, 0 , 1, "Unused" }, - {0x12, 0x01, 0x80, 0x00, "Off" }, -}; - -STDDIPINFO(Scion) - -static struct BurnDIPInfo KungfutDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x20, NULL }, - {0x0f, 0xff, 0xff, 0x0c, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0e, 0x01, 0x07, 0x07, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x03, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0e, 0x01, 0x18, 0x18, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x18, 0x08, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x18, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x18, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x0e, 0x01, 0x20, 0x00, "1 Credit" }, - {0x0e, 0x01, 0x20, 0x20, "2 Credits" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0e, 0x01, 0x40, 0x00, "Off" }, - {0x0e, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0e, 0x01, 0x80, 0x00, "Off" }, - {0x0e, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x0f, 0x01, 0x01, 0x00, "Easy" }, - {0x0f, 0x01, 0x01, 0x01, "Hard" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0f, 0x01, 0x02, 0x00, "Off" }, - {0x0f, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Microphone" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x18, 0x00, "2" }, - {0x0f, 0x01, 0x18, 0x08, "3" }, - {0x0f, 0x01, 0x18, 0x10, "4" }, - {0x0f, 0x01, 0x18, 0x18, "5" }, - - {0 , 0xfe, 0 , 3, "Bonus Life" }, - {0x0f, 0x01, 0x60, 0x00, "20000 40000" }, - {0x0f, 0x01, 0x60, 0x10, "20000 80000" }, - {0x0f, 0x01, 0x60, 0x30, "30000 90000" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0f, 0x01, 0x80, 0x00, "Off" }, - {0x0f, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Kungfut) - - -static struct BurnDIPInfo WizDIPList[]= -{ - {0x11, 0xff, 0xff, 0x00, NULL }, - {0x12, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x07, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0x18, 0x08, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x18, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x18, 0x18, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x18, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x01, 0x00, "Upright" }, - {0x12, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x06, 0x00, "Easy" }, - {0x12, 0x01, 0x06, 0x02, "Normal" }, - {0x12, 0x01, 0x06, 0x04, "Hard" }, - {0x12, 0x01, 0x06, 0x06, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x18, 0x08, "1" }, - {0x12, 0x01, 0x18, 0x10, "3" }, - {0x12, 0x01, 0x18, 0x18, "5" }, - {0x12, 0x01, 0x18, 0x00, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x12, 0x01, 0x60, 0x00, "10000 30000" }, - {0x12, 0x01, 0x60, 0x20, "20000 40000" }, - {0x12, 0x01, 0x60, 0x40, "30000 60000" }, - {0x12, 0x01, 0x60, 0x60, "40000 80000" }, -}; - -STDDIPINFO(Wiz) - -void __fastcall wiz_main_write(UINT16 address, UINT8 data) -{ - static INT32 lastboom = 0; - - switch (address) - { - case 0xc800: - case 0xc801: // coin counter - return; - - case 0xf000: - *sprite_bank = data; - return; - - case 0xf001: - interrupt_enable[0] = data; - return; - - case 0xf002: - case 0xf003: - palette_bank[address & 1] = data & 1; - return; - - case 0xf004: - case 0xf005: - char_bank_select[address & 1] = data & 1; - return; - - case 0xf006: // x - case 0xf007: // y - screen_flip[address & 1] = data; - //bprintf(PRINT_NORMAL, _T("address %04d screen_flip %04d\n"),address,data ); - - return; - - case 0xf008: - case 0xf009: - case 0xf00a: - case 0xf00b: - case 0xf00c: - case 0xf00d: - case 0xf00e: - case 0xf00f: // nop - return; - - case 0xf800: - *soundlatch = data; - return; - - case 0xf808: { // Explosions! - switch (ZetGetPC(-1)) { - case 0x3394: if (!BurnSampleGetStatus(2)) BurnSamplePlay(2); break; // plr death - - default: { // enemy death (scion/scionc) - if (lastboom + 1 == nCurrentFrame || lastboom == nCurrentFrame) { - lastboom = nCurrentFrame; - } else { - BurnSamplePlay(1); - lastboom = nCurrentFrame; - } - break; - } - } - } - return; - - case 0xf80a: { - // Pew! Pew! - BurnSamplePlay(0); - lastboom = 0; - } - return; - - case 0xf818: - *background_color = data; - return; - } -} - -UINT8 __fastcall wiz_main_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - return DrvDips[0]; - - case 0xf008: - return DrvDips[1]; - - case 0xf010: - return DrvInputs[0]; - - case 0xf018: - return DrvInputs[1]; - - case 0xf800: - return 0; // watchdog - } - - // Wiz protection - if ((address & 0xfc00) == 0xd400) - { - if ((address & 0xff) == 0) - { - switch (DrvColRAM1[0]) - { - case 0x35: - return 0x25; - - case 0x8f: - return 0x1f; - - case 0xa0: - return 0x00; - } - } - - return DrvColRAM1[address & 0x3ff]; - } - - return 0; -} - -void __fastcall wiz_sound_write(UINT16 address, UINT8 data) -{ - address &= 0x7fff; - - switch (address) - { - case 0x3000: - case 0x7000: - interrupt_enable[1] = data; - return; - - case 0x4000: - case 0x4001: if (Wizmode) - AY8910Write(2, address & 1, data); - return; - - case 0x5000: - case 0x5001: - AY8910Write(0, address & 1, data); - return; - - case 0x6000: - case 0x6001: - AY8910Write(1, address & 1, data); - return; - } -} - -UINT8 __fastcall wiz_sound_read(UINT16 address) -{ - address &= 0x7fff; - - switch (address) - { - case 0x3000: - case 0x7000: - return *soundlatch; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - AY8910Reset(2); - - BurnSampleReset(); - - return 0; -} - -static void DrvPaletteInit() -{ - for (UINT32 i = 0; i < 0x100; i++) - { - UINT32 bit0 = (DrvColPROM[0x000 + i] >> 0) & 0x01; - UINT32 bit1 = (DrvColPROM[0x000 + i] >> 1) & 0x01; - UINT32 bit2 = (DrvColPROM[0x000 + i] >> 2) & 0x01; - UINT32 bit3 = (DrvColPROM[0x000 + i] >> 3) & 0x01; - UINT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3; - - bit0 = (DrvColPROM[0x100 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[0x100 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[0x100 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[0x100 + i] >> 3) & 0x01; - UINT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3; - - bit0 = (DrvColPROM[0x200 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[0x200 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[0x200 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[0x200 + i] >> 3) & 0x01; - UINT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80Dec = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 6 * 8 * 8 * 256; // 6 banks, 8x8 tiles, 256 tiles (characters) - DrvGfxROM1 = Next; Next += 3 * 16 * 16 * 256; // 3 banks, 16x16 tiles, 256 tiles (sprites) - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (unsigned int*)Next; Next += 0x0100 * sizeof(INT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x000800; - DrvZ80RAM1 = Next; Next += 0x000400; - - DrvVidRAM0 = Next; Next += 0x000400; - DrvVidRAM1 = Next; Next += 0x000400; - - DrvColRAM0 = Next; Next += 0x000400; - DrvColRAM1 = Next; Next += 0x000400; - - DrvSprRAM0 = Next; Next += 0x000100; - DrvSprRAM1 = Next; Next += 0x000100; - - soundlatch = Next; Next += 0x000001; - - sprite_bank = Next; Next += 0x000001; - interrupt_enable= Next; Next += 0x000002; - palette_bank = Next; Next += 0x000002; - char_bank_select= Next; Next += 0x000002; - screen_flip = Next; Next += 0x000002; - background_color= Next; Next += 0x000001; - - RamEnd = Next; - - { - for (INT32 i = 0; i < 9; i++) { - pAY8910Buffer[i] = (INT16*)Next; Next += nBurnSoundLen * sizeof(UINT16); - } - } - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode(UINT32 type) -{ - INT32 Plane[3] = { 0x4000*8, 0x2000*8, 0 }; - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }; - - UINT8 *tmp0 = (UINT8*)BurnMalloc(0x6000); - UINT8 *tmp1 = (UINT8*)BurnMalloc(0xc000); - - memcpy (tmp0, DrvGfxROM0, 0x6000); - memcpy (tmp1, DrvGfxROM1, 0xc000); - memset (DrvGfxROM0, 0, 0x6000); - memset (DrvGfxROM1, 0, 0xc000); - - GfxDecode(256, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp0 + 0x0000, DrvGfxROM0 + 0 * 8 * 8 * 256); - GfxDecode(256, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp0 + 0x0800, DrvGfxROM0 + 1 * 8 * 8 * 256); - if (type == 0) - { - GfxDecode(256, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp1 + 0x6000, DrvGfxROM0 + 2 * 8 * 8 * 256); - GfxDecode(256, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp1 + 0x0000, DrvGfxROM0 + 3 * 8 * 8 * 256); - GfxDecode(256, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp1 + 0x0800, DrvGfxROM0 + 4 * 8 * 8 * 256); - GfxDecode(256, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp1 + 0x6800, DrvGfxROM0 + 5 * 8 * 8 * 256); - } else { - GfxDecode(256, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp1 + 0x0000, DrvGfxROM0 + 2 * 8 * 8 * 256); - GfxDecode(256, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp1 + 0x0800, DrvGfxROM0 + 3 * 8 * 8 * 256); - } - - GfxDecode(256, 3, 16, 16, Plane, XOffs, YOffs, 0x100, tmp0 + 0x0000, DrvGfxROM1 + 0 * 16 * 16 * 256); - GfxDecode(256, 3, 16, 16, Plane, XOffs, YOffs, 0x100, tmp1 + 0x0000, DrvGfxROM1 + 1 * 16 * 16 * 256); - GfxDecode(256, 3, 16, 16, Plane, XOffs, YOffs, 0x100, tmp1 + 0x6000, DrvGfxROM1 + 2 * 16 * 16 * 256); - - BurnFree (tmp0); - BurnFree (tmp1); -} - -static INT32 WizLoadRoms() -{ - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 9, 1)) return 1; - - for (UINT32 i = 0; i < 0xc000; i++) { - DrvGfxROM1[((i & 0x2000) * 3) + ((i & 0xc000) >> 1) + (i & 0x1fff)] = DrvGfxROM0[i]; - } - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 12, 1)) return 1; - - DrvGfxDecode(0); - - return 0; -} - -static INT32 KungfutLoadRoms() -{ - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 11, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 12, 1)) return 1; - - DrvGfxDecode(1); - - return 0; -} - -static INT32 StingerLoadRoms() -{ - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 14, 1)) return 1; - - DrvGfxDecode(1); - - return 0; -} - -static INT32 DrvInit(int (*RomLoadCallback)()) -{ - AllMem = NULL; - MemIndex(); - UINT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (RomLoadCallback()) return 1; - - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvVidRAM1, 0xd000, 0xd3ff, MAP_RAM); - ZetMapMemory(DrvColRAM1, 0xd400, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM1, 0xd800, 0xd8ff, MAP_RAM); // 00 - 3f attributs, 40-5f sprites, 60+ junk - ZetMapMemory(DrvVidRAM0, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvColRAM0, 0xe400, 0xe7ff, MAP_RAM); //just ram? - ZetMapMemory(DrvSprRAM0, 0xe800, 0xe8ff, MAP_RAM); // 00 - 3f attributs, 40-5f sprites, 60+ junk - - ZetSetWriteHandler(wiz_main_write); - ZetSetReadHandler(wiz_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x2000, 0x23ff, MAP_RAM); - ZetSetWriteHandler(wiz_sound_write); - ZetSetReadHandler(wiz_sound_read); - ZetClose(); - - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(2, 0.10, BURN_SND_ROUTE_BOTH); - - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.05, BURN_SND_ROUTE_BOTH); - bHasSamples = BurnSampleGetStatus(0) != -1; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - AY8910Exit(0); - AY8910Exit(1); - AY8910Exit(2); - BurnSampleExit(); - - BurnFree (AllMem); - - Wizmode = 0; - Scionmodeoffset = 0; - bHasSamples = 0; - - return 0; -} - - -static void draw_background(INT16 bank, INT16 palbank, INT16 colortype) -{ - for (INT16 offs = 0x3ff; offs >= 0; offs--) - { - INT16 sx = (offs & 0x1f); - UINT8 sy = (((offs / 32)<<3) - DrvSprRAM0[2 * sx + 0]) &0xff; - INT16 color; - - if (colortype) - { - color = (DrvSprRAM0[2 * sx | 1] & 0x07) | (palbank << 3); - } - else - { - color = (DrvSprRAM0[2 * sx + 1] & 0x04) | (DrvVidRAM0[offs] & 3) | (palbank << 3); - } - - INT16 code = DrvVidRAM0[offs] | (bank << 8); - - - if (screen_flip[1]) { // flipy - if (screen_flip[0]) { // flipx - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, (sx << 3) ^ 0xf8, sy - 16, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx << 3, sy - 16, color, 3, 0, 0, DrvGfxROM0); - } - } else { - if (screen_flip[0]) { // flipx - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, (sx << 3) ^ 0xf8, sy - 16, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, (sx << 3)-Scionmodeoffset, sy - 16, color, 3, 0, 0, DrvGfxROM0); - } - } - - } -} - -static void draw_foreground(INT16 palbank, INT16 colortype) -{ - for (INT16 offs = 0x3ff; offs >= 0; offs--) - { - INT16 sx = (offs & 0x1f); - UINT8 sy = (((offs / 32)<<3) - DrvSprRAM1[2 * sx + 0]); - INT16 code = DrvVidRAM1[offs] | (char_bank_select[1] << 8); - INT16 color = DrvColRAM1[sx << 1 | 1] & 7; - INT16 scroll; - - if (colortype) - { - color = (DrvSprRAM1[2 * sx + 1] & 0x07); - } - else - { - color = (DrvColRAM1[offs] & 0x07); - } - - color |= (palbank << 3); - scroll = (8*sy + 256 - DrvVidRAM1[2 * sx]) % 256; - if (screen_flip[1]) - { - scroll = (248 - scroll) % 256; - } - - if (screen_flip[0]) sx = 31 - sx; - - Render8x8Tile_Mask_Clip(pTransDraw, code, (sx << 3)-Scionmodeoffset, sy-16, color, 3, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites(UINT8 *ram, INT16 palbank, INT16 bank) -{ - for (INT16 offs = 0x1c; offs >= 0; offs -= 4) - { - INT16 sy = 240 - ram[offs + 0]; - INT16 code = ram[offs + 1] | (bank << 8); - INT16 color = (ram[offs + 2] & 0x07) | (palbank << 3); - INT16 sx = ram[offs + 3]; - if (!sx || !sy) continue; - - if (screen_flip[1]) { // flipy - if (screen_flip[0]) { // flipx - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, 240 - sx, (240 - sy) - 16, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, (240 - sy) - 16, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (screen_flip[0]) { // flipx - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, 240 - sx, sy - 16, color, 3, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx-Scionmodeoffset, sy - 16, color, 3, 0, 0, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - INT16 palbank = (palette_bank[0] << 0) | (palette_bank[1] << 1); - - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = *background_color; - } - - draw_background(2 + ((char_bank_select[0] << 1) | char_bank_select[1]), palbank, 0); - draw_foreground(palbank, 0); - - draw_sprites(DrvSprRAM1 + 0x40, palbank, 0); - draw_sprites(DrvSprRAM0 + 0x40, palbank, 1 + *sprite_bank); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 StingerDraw() -{ - INT16 palbank = (palette_bank[0] << 0) | (palette_bank[1] << 1); - - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = *background_color; - } - - draw_background(2 + char_bank_select[0], palbank, 1); - draw_foreground(palbank, 1); - - draw_sprites(DrvSprRAM1 + 0x40, palbank, 0); - draw_sprites(DrvSprRAM0 + 0x40, palbank, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 KungfutDraw() -{ - INT16 palbank = (palette_bank[0] << 0) | (palette_bank[1] << 1); - - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = *background_color; - } - - draw_background(2 + char_bank_select[0], palbank, 0); - draw_foreground(palbank, 0); - - draw_sprites(DrvSprRAM1 + 0x40, palbank, 0); - draw_sprites(DrvSprRAM0 + 0x40, palbank, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 2); - for (INT16 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 16; - INT32 nCyclesTotal[2] = { 3072000 / 60, 3072000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1) && interrupt_enable[0]) ZetNmi(); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - if ((i % 4) == 0x03 && interrupt_enable[1]) ZetNmi(); - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - if (bHasSamples) BurnSampleRender(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - if (bHasSamples) BurnSampleRender(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - BurnSampleScan(nAction, pnMin); - } - - return 0; -} - -static struct BurnSampleInfo stingerSampleDesc[] = { -#if !defined ROM_VERIFY - {"pewpew", SAMPLE_NOLOOP }, - {"boomshort", SAMPLE_NOLOOP }, - {"boomlong", SAMPLE_NOLOOP }, -#endif - {"", 0 } -}; - -STD_SAMPLE_PICK(stinger) -STD_SAMPLE_FN(stinger) - -// Wiz - -static struct BurnRomInfo wizRomDesc[] = { - { "ic07_01.bin", 0x4000, 0xc05f2c78, 1 }, // 0 maincpu - { "ic05_03.bin", 0x4000, 0x7978d879, 1 }, // 1 - { "ic06_02.bin", 0x4000, 0x9c406ad2, 1 }, // 2 - - { "ic57_10.bin", 0x2000, 0x8a7575bd, 2 }, // 3 audiocpu - - { "ic12_04.bin", 0x2000, 0x8969acdd, 3 }, // 4 gfx1 - { "ic13_05.bin", 0x2000, 0x2868e6a5, 3 }, // 5 - { "ic14_06.bin", 0x2000, 0xb398e142, 3 }, // 6 - - { "ic03_07.bin", 0x4000, 0x297c02fc, 4 }, // 7 gfx2 - { "ic02_08.bin", 0x4000, 0xede77d37, 4 }, // 8 - { "ic01_09.bin", 0x4000, 0x4d86b041, 4 }, // 9 - - { "ic23_3-1.bin", 0x0100, 0x2dd52fb2, 5 }, // 10 proms - { "ic23_3-2.bin", 0x0100, 0x8c2880c9, 5 }, // 11 - { "ic23_3-3.bin", 0x0100, 0xa488d761, 5 }, // 12 -}; - -STD_ROM_PICK(wiz) -STD_ROM_FN(wiz) - -static INT32 WizInit() -{ - Wizmode = 1; - - return DrvInit(WizLoadRoms); -} - -struct BurnDriver BurnDrvWiz = { - "wiz", NULL, NULL, NULL, "1985", - "Wiz\0", NULL, "Seibu Kaihatsu Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, wizRomInfo, wizRomName, NULL, NULL, WizInputInfo, WizDIPInfo, - WizInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x100, 224, 256, 3, 4 -}; - -// Wiz (Taito, set 1) - -static struct BurnRomInfo wiztRomDesc[] = { - { "wiz1.bin", 0x4000, 0x5a6d3c60, 1 }, // 0 maincpu - { "ic05_03.bin", 0x4000, 0x7978d879, 1 }, // 1 - { "ic06_02.bin", 0x4000, 0x9c406ad2, 1 }, // 2 - - { "ic57_10.bin", 0x2000, 0x8a7575bd, 2 }, // 3 audiocpu - - { "wiz4.bin", 0x2000, 0xe6c636b3, 3 }, // 4 gfx1 - { "wiz5.bin", 0x2000, 0x77986058, 3 }, // 5 - { "wiz6.bin", 0x2000, 0xf6970b23, 3 }, // 6 - - { "wiz7.bin", 0x4000, 0x601f2f3f, 4 }, // 7 gfx2 - { "wiz8.bin", 0x4000, 0xf5ab982d, 4 }, // 8 - { "wiz9.bin", 0x4000, 0xf6c662e2, 4 }, // 9 - - { "ic23_3-1.bin", 0x0100, 0x2dd52fb2, 5 }, // 10 proms - { "ic23_3-2.bin", 0x0100, 0x8c2880c9, 5 }, // 11 - { "ic23_3-3.bin", 0x0100, 0xa488d761, 5 }, // 12 -}; - -STD_ROM_PICK(wizt) -STD_ROM_FN(wizt) - -struct BurnDriver BurnDrvWizt = { - "wizt", "wiz", NULL, NULL, "1985", - "Wiz (Taito, set 1)\0", NULL, "[Seibu] (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, wiztRomInfo, wiztRomName, NULL, NULL, WizInputInfo, WizDIPInfo, - WizInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x100, 224, 256, 3, 4 -}; - - -// Wiz (Taito, set 2) - -static struct BurnRomInfo wiztaRomDesc[] = { - { "ic7", 0x4000, 0xb2ec49ad, 1 }, // 0 maincpu - { "ic5", 0x4000, 0xf7e8f792, 1 }, // 1 - { "ic6", 0x4000, 0x9c406ad2, 1 }, // 2 - - { "ic57", 0x2000, 0x8a7575bd, 2 }, // 3 audiocpu - - { "ic12", 0x2000, 0xe6c636b3, 3 }, // 4 gfx1 - { "ic13", 0x2000, 0x77986058, 3 }, // 5 - { "ic14", 0x2000, 0xf6970b23, 3 }, // 6 - - { "ic3", 0x4000, 0x601f2f3f, 4 }, // 7 gfx2 - { "ic2", 0x4000, 0xf5ab982d, 4 }, // 8 - { "ic1", 0x4000, 0xf6c662e2, 4 }, // 9 - - { "ic23_3-1.bin", 0x0100, 0x2dd52fb2, 5 }, // 10 proms - { "ic23_3-2.bin", 0x0100, 0x8c2880c9, 5 }, // 11 - { "ic23_3-3.bin", 0x0100, 0xa488d761, 5 }, // 12 -}; - -STD_ROM_PICK(wizta) -STD_ROM_FN(wizta) - -struct BurnDriver BurnDrvWizta = { - "wizta", "wiz", NULL, NULL, "1985", - "Wiz (Taito, set 2)\0", NULL, "[Seibu] (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, wiztaRomInfo, wiztaRomName, NULL, NULL, WizInputInfo, WizDIPInfo, - WizInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x100, 224, 256, 3, 4 -}; - -// Kung-Fu Taikun - -static struct BurnRomInfo kungfutRomDesc[] = { - { "p1.bin", 0x4000, 0xb1e56960, 1 }, // 0 maincpu - { "p3.bin", 0x4000, 0x6fc346f8, 1 }, // 1 - { "p2.bin", 0x4000, 0x042cc9c5, 1 }, // 2 - - { "1.bin", 0x2000, 0x68028a5d, 2 }, // 3 audiocpu - - { "2.bin", 0x2000, 0x5c3ef697, 3 }, // 4 gfx1 - { "3.bin", 0x2000, 0x905e81fa, 3 }, // 5 - { "4.bin", 0x2000, 0x965bb5d1, 3 }, // 6 - - { "5.bin", 0x2000, 0x763bb61a, 4 }, // 7 gfx2 - { "6.bin", 0x2000, 0xc9649fce, 4 }, // 8 - { "7.bin", 0x2000, 0x32f02c13, 4 }, // 9 - - { "82s129.0", 0x0100, 0xeb823177, 5 }, // 10 proms - { "82s129.1", 0x0100, 0x6eec5dd9, 5 }, // 11 - { "82s129.2", 0x0100, 0xc31eb3e6, 5 }, // 12 -}; - -STD_ROM_PICK(kungfut) -STD_ROM_FN(kungfut) - -static INT32 KungfutInit() -{ - Wizmode = 1; - return DrvInit(KungfutLoadRoms); -} - -struct BurnDriver BurnDrvKungfut = { - "kungfut", NULL, NULL, NULL, "1984", - "Kung-Fu Taikun\0", NULL, "Seibu Kaihatsu Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, kungfutRomInfo, kungfutRomName, NULL, NULL, KungfutInputInfo, KungfutDIPInfo, - KungfutInit, DrvExit, DrvFrame, KungfutDraw, DrvScan, - &DrvRecalc, 0x100, 256, 224, 4, 3 -}; - -// Kung-Fu Taikun (alt) - -static struct BurnRomInfo kungfutaRomDesc[] = { - { "kungfu.01", 0x4000, 0x48dada70, 1 }, // 0 maincpu - { "kungfu.02", 0x4000, 0xc08c5152, 1 }, // 1 - { "kungfu.03", 0x4000, 0x09b8670c, 1 }, // 2 - - { "kungfu.04", 0x2000, 0x352bff48, 2 }, // 3 audiocpu - - { "kungfu.08", 0x2000, 0x60b91d2f, 3 }, // 4 gfx1 - { "kungfu.09", 0x2000, 0x121ba029, 3 }, // 5 - { "kungfu.10", 0x2000, 0x146df9de, 3 }, // 6 - - { "kungfu.07", 0x2000, 0x1df48de5, 4 }, // 7 gfx2 - { "kungfu.06", 0x2000, 0x1921d49b, 4 }, // 8 - { "kungfu.05", 0x2000, 0xff9aced4, 4 }, // 9 - - { "82s129.0", 0x0100, 0xeb823177, 5 }, // 10 proms - { "82s129.1", 0x0100, 0x6eec5dd9, 5 }, // 11 - { "82s129.2", 0x0100, 0xc31eb3e6, 5 }, // 12 -}; - -STD_ROM_PICK(kungfuta) -STD_ROM_FN(kungfuta) - -struct BurnDriver BurnDrvKungfuta = { - "kungfuta", "kungfut", NULL, NULL, "1984", - "Kung-Fu Taikun (alt)\0", NULL, "Seibu Kaihatsu Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, kungfutaRomInfo, kungfutaRomName, NULL, NULL, KungfutInputInfo, KungfutDIPInfo, - KungfutInit, DrvExit, DrvFrame, KungfutDraw, DrvScan, - &DrvRecalc, 0x100, 256, 224, 4, 3 -}; - -// Stinger - -static struct BurnRomInfo stingerRomDesc[] = { - { "1-5j.bin", 0x2000, 0x1a2ca600, 1 }, // 0 maincpu - { "2-6j.bin", 0x2000, 0x957cd39c, 1 }, // 1 - { "3-8j.bin", 0x2000, 0x404c932e, 1 }, // 2 - { "4-9j.bin", 0x2000, 0x2d570f91, 1 }, // 3 - { "5-10j.bin", 0x2000, 0xc841795c, 1 }, // 4 - - { "6-9f.bin", 0x2000, 0x79757f0c, 2 }, // 5 audiocpu - - { "7-9e.bin", 0x2000, 0x775489be, 3 }, // 6 gfx1 - { "8-11e.bin", 0x2000, 0x43c61b3f, 3 }, // 7 - { "9-14e.bin", 0x2000, 0xc9ed8fc7, 3 }, // 8 - - { "10-9h.bin", 0x2000, 0x6fc3a22d, 4 }, // 9 gfx2 - { "11-11h.bin", 0x2000, 0x3df1f57e, 4 }, // 10 - { "12-14h.bin", 0x2000, 0x2fbe1391, 4 }, // 11 - - { "stinger.a7", 0x0100, 0x52c06fc2, 5 }, // 12 proms - { "stinger.b7", 0x0100, 0x9985e575, 5 }, // 13 - { "stinger.a8", 0x0100, 0x76b57629, 5 }, // 14 -}; - -STD_ROM_PICK(stinger) -STD_ROM_FN(stinger) - -static void StingerDecode() -{ - INT32 swap_xor_table[4][4] = - { - { 7,3,5, 0xa0 }, - { 3,7,5, 0x88 }, - { 5,3,7, 0x80 }, - { 5,7,3, 0x28 } - }; - - for (INT32 A = 0; A < 0x10000; A++) - { - if (A & 0x2040) - { - DrvZ80Dec[A] = DrvZ80ROM0[A]; - } - else - { - INT32 *tbl = swap_xor_table[((A >> 3) & 1) + (((A >> 5) & 1) << 1)]; - - DrvZ80Dec[A] = BITSWAP08(DrvZ80ROM0[A],tbl[0],6,tbl[1],4,tbl[2],2,1,0) ^ tbl[3]; - } - } - - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Dec, DrvZ80ROM0); - ZetClose(); -} - -static INT32 StingerInit() -{ - INT32 nRet = DrvInit(StingerLoadRoms); - - if (nRet == 0) { - StingerDecode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvStinger = { - "stinger", NULL, NULL, "stinger", "1983", - "Stinger\0", NULL, "Seibu Denshi", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, stingerRomInfo, stingerRomName, stingerSampleInfo, stingerSampleName, StingerInputInfo, StingerDIPInfo, - StingerInit, DrvExit, DrvFrame, StingerDraw, DrvScan, - &DrvRecalc, 0x100, 224, 256, 3, 4 -}; - -// Stinger (prototype?) - -static struct BurnRomInfo stinger2RomDesc[] = { - { "n1.bin", 0x2000, 0xf2d2790c, 1 }, // 0 maincpu - { "n2.bin", 0x2000, 0x8fd2d8d8, 1 }, // 1 - { "n3.bin", 0x2000, 0xf1794d36, 1 }, // 2 - { "n4.bin", 0x2000, 0x230ba682, 1 }, // 3 - { "n5.bin", 0x2000, 0xa03a01da, 1 }, // 4 - - { "6-9f.bin", 0x2000, 0x79757f0c, 2 }, // 5 audiocpu - - { "7-9e.bin", 0x2000, 0x775489be, 3 }, // 6 gfx1 - { "8-11e.bin", 0x2000, 0x43c61b3f, 3 }, // 7 - { "9-14e.bin", 0x2000, 0xc9ed8fc7, 3 }, // 8 - - { "10.bin", 0x2000, 0xf6721930, 4 }, // 9 gfx2 - { "11.bin", 0x2000, 0xa4404e63, 4 }, // 10 - { "12.bin", 0x2000, 0xb60fa88c, 4 }, // 11 - - { "stinger.a7", 0x0100, 0x52c06fc2, 5 }, // 12 proms - { "stinger.b7", 0x0100, 0x9985e575, 5 }, // 13 - { "stinger.a8", 0x0100, 0x76b57629, 5 }, // 14 -}; - -STD_ROM_PICK(stinger2) -STD_ROM_FN(stinger2) - -struct BurnDriver BurnDrvStinger2 = { - "stinger2", "stinger", NULL, "stinger", "1983", - "Stinger (prototype?)\0", NULL, "Seibu Denshi", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, stinger2RomInfo, stinger2RomName, stingerSampleInfo, stingerSampleName, StingerInputInfo, Stinger2DIPInfo, - StingerInit, DrvExit, DrvFrame, StingerDraw, DrvScan, - &DrvRecalc, 0x100, 224, 256, 3, 4 -}; - -// Scion - -static struct BurnRomInfo scionRomDesc[] = { - { "sc1", 0x2000, 0x8dcad575, 1 }, // 0 maincpu - { "sc2", 0x2000, 0xf608e0ba, 1 }, // 1 - { "sc3", 0x2000, 0x915289b9, 1 }, // 2 - { "4.9j", 0x2000, 0x0f40d002, 1 }, // 3 - { "5.10j", 0x2000, 0xdc4923b7, 1 }, // 4 - - { "sc6", 0x2000, 0x09f5f9c1, 2 }, // 5 audiocpu - - { "7.10e", 0x2000, 0x223e0d2a, 3 }, // 6 gfx1 - { "8.12e", 0x2000, 0xd3e39b48, 3 }, // 7 - { "9.15e", 0x2000, 0x630861b5, 3 }, // 8 - - { "10.10h", 0x2000, 0x0d2a0d1e, 4 }, // 9 gfx2 - { "11.12h", 0x2000, 0xdc6ef8ab, 4 }, // 10 - { "12.15h", 0x2000, 0xc82c28bf, 4 }, // 11 - - { "82s129.7a", 0x0100, 0x2f89d9ea, 5 }, // 12 proms - { "82s129.7b", 0x0100, 0xba151e6a, 5 }, // 13 - { "82s129.8a", 0x0100, 0xf681ce59, 5 }, // 14 -}; - -STD_ROM_PICK(scion) -STD_ROM_FN(scion) - -static INT32 ScionInit() -{ - Scionmodeoffset = 8*2; // 2 8x8char offset - - return DrvInit(StingerLoadRoms); -} - -struct BurnDriver BurnDrvScion = { - "scion", NULL, NULL, "stinger", "1984", - "Scion\0", "Music horribly broken, use scionc instead!", "Seibu Denshi", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, scionRomInfo, scionRomName, stingerSampleInfo, stingerSampleName, ScionInputInfo, ScionDIPInfo, - ScionInit, DrvExit, DrvFrame, StingerDraw, DrvScan, - &DrvRecalc, 0x100, 240, 224, 4, 3 -}; - -// Scion (Cinematronics) - -static struct BurnRomInfo scioncRomDesc[] = { - { "1.5j", 0x2000, 0x5aaf571e, 1 }, // 0 maincpu - { "2.6j", 0x2000, 0xd5a66ac9, 1 }, // 1 - { "3.8j", 0x2000, 0x6e616f28, 1 }, // 2 - { "4.9j", 0x2000, 0x0f40d002, 1 }, // 3 - { "5.10j", 0x2000, 0xdc4923b7, 1 }, // 4 - - { "6.9f", 0x2000, 0xa66a0ce6, 2 }, // 5 audiocpu - - { "7.10e", 0x2000, 0x223e0d2a, 3 }, // 6 gfx1 - { "8.12e", 0x2000, 0xd3e39b48, 3 }, // 7 - { "9.15e", 0x2000, 0x630861b5, 3 }, // 8 - - { "10.10h", 0x2000, 0x0d2a0d1e, 4 }, // 9 gfx2 - { "11.12h", 0x2000, 0xdc6ef8ab, 4 }, // 10 - { "12.15h", 0x2000, 0xc82c28bf, 4 }, // 11 - - { "82s129.7a", 0x0100, 0x2f89d9ea, 5 }, // 12 proms - { "82s129.7b", 0x0100, 0xba151e6a, 5 }, // 13 - { "82s129.8a", 0x0100, 0xf681ce59, 5 }, // 14 -}; - -STD_ROM_PICK(scionc) -STD_ROM_FN(scionc) - -struct BurnDriver BurnDrvScionc = { - "scionc", "scion", NULL, "stinger", "1984", - "Scion (Cinematronics)\0", NULL, "Seibu Denshi (Cinematronics license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, scioncRomInfo, scioncRomName, stingerSampleInfo, stingerSampleName, ScionInputInfo, ScionDIPInfo, - ScionInit, DrvExit, DrvFrame, StingerDraw, DrvScan, - &DrvRecalc, 0x100, 240, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_wwfsstar.cpp b/jan/src/burn/drv/pre90s/d_wwfsstar.cpp deleted file mode 100644 index 7c128e78e..000000000 --- a/jan/src/burn/drv/pre90s/d_wwfsstar.cpp +++ /dev/null @@ -1,992 +0,0 @@ -// FB Alpha WWF Superstars driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; - -static UINT32 *DrvPalette; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT16 *scroll; - -static UINT16 DrvInputs[3]; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 vblank = 0; - -static struct BurnInputInfo WwfsstarInputList[] = { - {"Start 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"Start 2", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"Start 3", BIT_DIGITAL, DrvJoy2 + 6, "p3 start" }, - - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"} , - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p2 coin" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Wwfsstar) - -static struct BurnDIPInfo WwfsstarDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x04, 0x00, "Off" }, - {0x14, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Super Techniques" }, - {0x14, 0x01, 0x08, 0x08, "Normal" }, - {0x14, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x14, 0x01, 0x30, 0x20, "+2:30" }, - {0x14, 0x01, 0x30, 0x30, "Default" }, - {0x14, 0x01, 0x30, 0x10, "-2:30" }, - {0x14, 0x01, 0x30, 0x00, "-5:00" }, - - {0 , 0xfe, 0 , 2, "Health For Winning" }, - {0x14, 0x01, 0x80, 0x80, "No" }, - {0x14, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Wwfsstar) - -void __fastcall wwfsstar_main_write_byte(UINT32 , UINT8 ) -{ - -} - -void __fastcall wwfsstar_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x180000: - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - return; - - case 0x180002: - SekSetIRQLine(5, CPU_IRQSTATUS_NONE); - return; - - case 0x180004: - scroll[0] = data & 0x1ff; - return; - - case 0x180006: - scroll[1] = data & 0x1ff; - return; - - case 0x180008: - *soundlatch = data; - ZetNmi(); - return; - - case 0x18000a: - *flipscreen = data & 1; - return; - } -} - -UINT8 __fastcall wwfsstar_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x180003: - return DrvDips[1]; - - case 0x180004: - return DrvInputs[0] >> 8; - - case 0x180005: - return DrvInputs[0]; - - case 0x180006: - return DrvInputs[1] >> 8; - - case 0x180007: - return DrvInputs[1]; - - case 0x180008: - return DrvInputs[2] >> 8; - - case 0x180009: - return (DrvInputs[2] & 0xfe) | vblank; - } - - return 0; -} - -UINT16 __fastcall wwfsstar_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x180000: - return 0xff00 | DrvDips[0]; - - case 0x180002: - return 0xff00 | DrvDips[1]; - - case 0x180004: - return DrvInputs[0]; - - case 0x180006: - return DrvInputs[1]; - - case 0x180008: - return (DrvInputs[2] & 0xfffe) | vblank; - } - - return 0; -} - -void __fastcall wwfsstar_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8800: - BurnYM2151SelectRegister(data); - return; - - case 0x8801: - BurnYM2151WriteRegister(data); - return; - - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall wwfsstar_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8800: - case 0x8801: - return BurnYM2151ReadStatus(); - - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - return *soundlatch; - } - - return 0; -} - -static void DrvYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - MSM6295Reset(0); - - vblank = 1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROM2 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x180 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvZ80RAM = Next; Next += 0x000800; - - DrvSprRAM = Next; Next += 0x000400; - DrvPalRAM = Next; Next += 0x001000; - DrvFgRAM = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x001000; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - scroll = (UINT16*)Next; Next += 2 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x000000, 0x000002, 0x000004, 0x000006 }; - INT32 Plane1[4] = { 0x800000, 0x800004, 0x000000, 0x000004 }; - INT32 Plane2[4] = { 0x200000, 0x200004, 0x000000, 0x000004 }; - - INT32 XOffs0[8] = { 0x001, 0x000, 0x041, 0x040, 0x081, 0x080, 0x0c1, 0x0c0 }; - INT32 YOffs[16] = { 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038, - 0x040, 0x048, 0x050, 0x058, 0x060, 0x068, 0x070, 0x078 }; - INT32 XOffs1[16] = { 0x003, 0x002, 0x001, 0x000, 0x083, 0x082, 0x081, 0x080, - 0x103, 0x102, 0x101, 0x100, 0x183, 0x182, 0x181, 0x180 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x020000); - - GfxDecode(0x1000, 4, 8, 8, Plane0, XOffs0, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane1, XOffs1, YOffs, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane2, XOffs1, YOffs, 0x200, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (strcmp(BurnDrvGetTextA(DRV_NAME), "wwfsstarb") == 0) { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020001, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x020000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x010000, 6, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x020000, 7, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x030000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x010000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x030000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x050000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x070000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x090000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0a0000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0b0000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0d0000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0e0000, 25, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0f0000, 26, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 27, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x110000, 28, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x120000, 29, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x130000, 30, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x140000, 31, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x150000, 32, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x160000, 33, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x170000, 34, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 35, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x190000, 36, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1a0000, 37, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1b0000, 38, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c0000, 39, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1d0000, 40, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1e0000, 41, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1f0000, 42, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 43, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 44, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020000, 45, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x030000, 46, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 47, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x050000, 48, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x060000, 49, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x070000, 50, 1)) return 1; - } else { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x020000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1c0000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 13, 1)) return 1; - } - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvFgRAM, 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x0c0000, 0x0c0fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x100000, 0x1003ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x140000, 0x140fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x1c0000, 0x1c3fff, MAP_RAM); - SekSetReadWordHandler(0, wwfsstar_main_read_word); - SekSetReadByteHandler(0, wwfsstar_main_read_byte); - SekSetWriteWordHandler(0, wwfsstar_main_write_word); - SekSetWriteByteHandler(0, wwfsstar_main_write_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(wwfsstar_sound_write); - ZetSetReadHandler(wwfsstar_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.47, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - - MSM6295Exit(0); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_fg_layer() -{ - UINT16 *vram = (UINT16*)DrvFgRAM; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 attr = vram[(offs * 2) + 0]; - INT32 code = (vram[(offs * 2) + 1] & 0xff) | ((attr & 0x0f) << 8); - INT32 color = (attr & 0xf0) >> 4; - - if (*flipscreen) { - sy = (sy ^ 0xf8) - 16; - sx = sx ^ 0xf8; - - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } - } -} - -static void draw_bg_layer() -{ - UINT16 *vram = (UINT16*)DrvBgRAM; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 row = offs >> 5; - INT32 col = offs & 0x1f; - - INT32 sx = col << 4; - INT32 sy = row << 4; - - sx -= scroll[0]; - if (sx < -15) sx += 512; - sy -= scroll[1]; - if (sy < -15) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 ofst = (col & 0x0f) | ((row & 0x0f) << 4) | ((col & 0x10) << 4) | ((row & 0x10) << 5); - - INT32 attr = vram[(ofst * 2) + 0]; - INT32 code = (vram[(ofst * 2) + 1] & 0xff) | ((attr & 0x0f) << 8); - INT32 color = (attr & 0x70) >> 4; - INT32 flipx = attr & 0x80; - - if (*flipscreen) { - sy = (240 - sy) - 16; - sx = 240 - sx; - - if (flipx) { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM2); // 0 transparent? - } else { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM2); // 0 transparent? - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM2); // 0 transparent? - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x100, DrvGfxROM2); // 0 transparent? - } - } - } -} - -static void draw_sprites() -{ - UINT16 *source = (UINT16*)DrvSprRAM; - UINT16 *finish = source + 0x3ff / 2; - - while (source < finish) - { - if (source[1] & 0x0001) - { - INT32 ypos = (source[0] & 0xff) | ((source[1] & 0x04) << 6); - INT32 xpos = (source[4] & 0xff) | ((source[1] & 0x08) << 5); - INT32 flipx = (source[2] & 0x80 ) >> 7; - INT32 flipy = (source[2] & 0x40 ) >> 6; - INT32 chain = (source[1] & 0x02 ) >> 1; - INT32 number = (source[3] & 0xff) | ((source[2] & 0x3f) << 8); - INT32 color = ((source[1] & 0xf0) + 0x80) >> 4; - - ypos = (((256 - ypos) & 0x1ff) - 16) ; - xpos = (((256 - xpos) & 0x1ff) - 16); - chain += 1; - number &= ~(chain - 1); - - if (*flipscreen) - { - flipy = !flipy; - flipx = !flipx; - ypos = 240 - ypos; - xpos = 240 - xpos; - ypos -= 16; - } - - for (INT32 count = 0; count < chain; count++) - { - INT32 yy = ypos; - - if (*flipscreen) { - if (flipy) { - yy += (16*(chain-1))-(16*count); - } else { - yy += 16 * count; - } - } else { - if (flipy) { - yy -= 16 * count; - } else { - yy -= (16*(chain-1))-(16*count); - } - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, number+count, xpos, yy, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, number+count, xpos, yy, color, 4, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, number+count, xpos, yy, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, number+count, xpos, yy, color, 4, 0, 0, DrvGfxROM1); - } - } - } - } - - source+=5; - } -} - -static void DrvPaletteRecalculate() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x180; i++) { - r = (p[i] >> 0) & 0x0f; - b = (p[i] >> 8) & 0x0f; - g = (p[i] >> 4) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalculate(); - - draw_bg_layer(); - - draw_sprites(); - - draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static inline void interrupt(INT32 scanline) -{ - if (scanline == 0) vblank = 0; - if (scanline == (240-1)) vblank = 1; - if ((scanline & 0x0f) == 0) SekSetIRQLine(5, CPU_IRQSTATUS_ACK); - if (scanline == 240) SekSetIRQLine(6, CPU_IRQSTATUS_ACK); -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3 * sizeof(INT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - } - - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 10000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nSegment; - - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - if (i >= 8 && i <= 248) interrupt(i - 8); - - nSegment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(nSegment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0,pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0,pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029706; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(vblank); - } - - return 0; -} - - -// WWF Superstars (Europe) - -static struct BurnRomInfo wwfsstarRomDesc[] = { - { "24ac-0_j-1.34", 0x20000, 0xec8fd2c9, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "24ad-0_j-1.35", 0x20000, 0x54e614e4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "24ab-0.12", 0x08000, 0x1e44f8aa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "24a9-0.46", 0x20000, 0x703ff08f, 3 | BRF_SND }, // 3 oki - { "24j8-0.45", 0x20000, 0x61138487, 3 | BRF_SND }, // 4 - - { "24aa-0.58", 0x20000, 0xcb12ba40, 4 | BRF_GRA }, // 5 Characters - - { "c951.114", 0x80000, 0xfa76d1f0, 5 | BRF_GRA }, // 6 Sprites - { "24j4-0.115", 0x40000, 0xc4a589a3, 5 | BRF_GRA }, // 7 - { "24j5-0.116", 0x40000, 0xd6bca436, 5 | BRF_GRA }, // 8 - { "c950.117", 0x80000, 0xcca5703d, 5 | BRF_GRA }, // 9 - { "24j2-0.118", 0x40000, 0xdc1b7600, 5 | BRF_GRA }, // 10 - { "24j3-0.119", 0x40000, 0x3ba12d43, 5 | BRF_GRA }, // 11 - - { "24j7-0.113", 0x40000, 0xe0a1909e, 6 | BRF_GRA }, // 12 Tiles - { "24j6-0.112", 0x40000, 0x77932ef8, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(wwfsstar) -STD_ROM_FN(wwfsstar) - -struct BurnDriver BurnDrvWwfsstar = { - "wwfsstar", NULL, NULL, NULL, "1989", - "WWF Superstars (Europe)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, wwfsstarRomInfo, wwfsstarRomName, NULL, NULL, WwfsstarInputInfo, WwfsstarDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x180, - 256, 240, 4, 3 -}; - - -// WWF Superstars (US, newer) - -static struct BurnRomInfo wwfsstaruRomDesc[] = { - { "24ac-06.34", 0x20000, 0x924a50e4, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "24ad-07.35", 0x20000, 0x9a76a50e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "24ab-0.12", 0x08000, 0x1e44f8aa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "24a9-0.46", 0x20000, 0x703ff08f, 3 | BRF_SND }, // 3 oki - { "24j8-0.45", 0x20000, 0x61138487, 3 | BRF_SND }, // 4 - - { "24aa-0.58", 0x20000, 0xcb12ba40, 4 | BRF_GRA }, // 5 Characters - - { "c951.114", 0x80000, 0xfa76d1f0, 5 | BRF_GRA }, // 6 Sprites - { "24j4-0.115", 0x40000, 0xc4a589a3, 5 | BRF_GRA }, // 7 - { "24j5-0.116", 0x40000, 0xd6bca436, 5 | BRF_GRA }, // 8 - { "c950.117", 0x80000, 0xcca5703d, 5 | BRF_GRA }, // 9 - { "24j2-0.118", 0x40000, 0xdc1b7600, 5 | BRF_GRA }, // 10 - { "24j3-0.119", 0x40000, 0x3ba12d43, 5 | BRF_GRA }, // 11 - - { "24j7-0.113", 0x40000, 0xe0a1909e, 6 | BRF_GRA }, // 12 Tiles - { "24j6-0.112", 0x40000, 0x77932ef8, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(wwfsstaru) -STD_ROM_FN(wwfsstaru) - -struct BurnDriver BurnDrvWwfsstaru = { - "wwfsstaru", "wwfsstar", NULL, NULL, "1989", - "WWF Superstars (US, newer)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, wwfsstaruRomInfo, wwfsstaruRomName, NULL, NULL, WwfsstarInputInfo, WwfsstarDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x180, - 256, 240, 4, 3 -}; - - -// WWF Superstars (US) - -static struct BurnRomInfo wwfsstaruaRomDesc[] = { - { "24ac-04.34", 0x20000, 0xee9b850e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "24ad-04.35", 0x20000, 0x057c2eef, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "24ab-0.12", 0x08000, 0x1e44f8aa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "24a9-0.46", 0x20000, 0x703ff08f, 3 | BRF_SND }, // 3 oki - { "24j8-0.45", 0x20000, 0x61138487, 3 | BRF_SND }, // 4 - - { "24aa-0.58", 0x20000, 0xcb12ba40, 4 | BRF_GRA }, // 5 Characters - - { "c951.114", 0x80000, 0xfa76d1f0, 5 | BRF_GRA }, // 6 Sprites - { "24j4-0.115", 0x40000, 0xc4a589a3, 5 | BRF_GRA }, // 7 - { "24j5-0.116", 0x40000, 0xd6bca436, 5 | BRF_GRA }, // 8 - { "c950.117", 0x80000, 0xcca5703d, 5 | BRF_GRA }, // 9 - { "24j2-0.118", 0x40000, 0xdc1b7600, 5 | BRF_GRA }, // 10 - { "24j3-0.119", 0x40000, 0x3ba12d43, 5 | BRF_GRA }, // 11 - - { "24j7-0.113", 0x40000, 0xe0a1909e, 6 | BRF_GRA }, // 12 Tiles - { "24j6-0.112", 0x40000, 0x77932ef8, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(wwfsstarua) -STD_ROM_FN(wwfsstarua) - -struct BurnDriver BurnDrvWwfsstarua = { - "wwfsstarua", "wwfsstar", NULL, NULL, "1989", - "WWF Superstars (US)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, wwfsstaruaRomInfo, wwfsstaruaRomName, NULL, NULL, WwfsstarInputInfo, WwfsstarDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x180, - 256, 240, 4, 3 -}; - - -// WWF Superstars (Japan) - -static struct BurnRomInfo wwfsstarjRomDesc[] = { - { "24ac-0_j-1_japan.34",0x20000, 0xf872e968, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "24ad-0_j-1_japan.35",0x20000, 0xc70bcd23, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "24ab-0.12", 0x08000, 0x1e44f8aa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "24a9-0.46", 0x20000, 0x703ff08f, 3 | BRF_SND }, // 3 oki - { "24j8-0.45", 0x20000, 0x61138487, 3 | BRF_SND }, // 4 - - { "24aa-0_j.58", 0x20000, 0xb9201b36, 4 | BRF_GRA }, // 5 Characters - - { "c951.114", 0x80000, 0xfa76d1f0, 5 | BRF_GRA }, // 6 Sprites - { "24j4-0.115", 0x40000, 0xc4a589a3, 5 | BRF_GRA }, // 7 - { "24j5-0.116", 0x40000, 0xd6bca436, 5 | BRF_GRA }, // 8 - { "c950.117", 0x80000, 0xcca5703d, 5 | BRF_GRA }, // 9 - { "24j2-0.118", 0x40000, 0xdc1b7600, 5 | BRF_GRA }, // 10 - { "24j3-0.119", 0x40000, 0x3ba12d43, 5 | BRF_GRA }, // 11 - - { "24j7-0.113", 0x40000, 0xe0a1909e, 6 | BRF_GRA }, // 12 Tiles - { "24j6-0.112", 0x40000, 0x77932ef8, 6 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(wwfsstarj) -STD_ROM_FN(wwfsstarj) - -struct BurnDriver BurnDrvWwfsstarj = { - "wwfsstarj", "wwfsstar", NULL, NULL, "1989", - "WWF Superstars (Japan)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, wwfsstarjRomInfo, wwfsstarjRomName, NULL, NULL, WwfsstarInputInfo, WwfsstarDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x180, - 256, 240, 4, 3 -}; - -// WWF Superstars (bootleg) - -static struct BurnRomInfo wwfsstarbRomDesc[] = { - { "wwfs08.bin", 0x10000, 0x621df265, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "wwfs10.bin", 0x10000, 0xa3382dfe, 1 | BRF_PRG | BRF_ESS }, // 1 - { "wwfs07.bin", 0x10000, 0x369559e6, 1 | BRF_PRG | BRF_ESS }, // 2 - { "wwfs09.bin", 0x10000, 0x8cbcd5aa, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "wwfs01.bin", 0x08000, 0x1e44f8aa, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "wwfs02.bin", 0x10000, 0x6e63c457, 3 | BRF_SND }, // 5 oki - { "wwfs04.bin", 0x10000, 0xd7018a9c, 3 | BRF_SND }, // 6 - { "wwfs03.bin", 0x10000, 0x8a35a20e, 3 | BRF_SND }, // 7 - { "wwfs05.bin", 0x10000, 0x6df08962, 3 | BRF_SND }, // 8 - - { "wwfs06.bin", 0x10000, 0x154ca5ce, 4 | BRF_GRA }, // 9 Characters - { "wwfs11.bin", 0x10000, 0x3d4684dc, 4 | BRF_GRA }, // 10 - - { "wwfs39.bin", 0x10000, 0xd807b09a, 5 | BRF_GRA }, // 11 Sprites - { "wwfs38.bin", 0x10000, 0xd8ea94d3, 5 | BRF_GRA }, // 12 - { "wwfs37.bin", 0x10000, 0x5e8d7407, 5 | BRF_GRA }, // 13 - { "wwfs36.bin", 0x10000, 0x9005e942, 5 | BRF_GRA }, // 14 - { "wwfs43.bin", 0x10000, 0xaafc4a38, 5 | BRF_GRA }, // 15 - { "wwfs42.bin", 0x10000, 0xe48b88fb, 5 | BRF_GRA }, // 16 - { "wwfs41.bin", 0x10000, 0xed7f69d5, 5 | BRF_GRA }, // 17 - { "wwfs40.bin", 0x10000, 0x4d75fd89, 5 | BRF_GRA }, // 18 - { "wwfs19.bin", 0x10000, 0x7426d444, 5 | BRF_GRA }, // 19 - { "wwfs18.bin", 0x10000, 0xaf11ad2a, 5 | BRF_GRA }, // 20 - { "wwfs17.bin", 0x10000, 0xef12069f, 5 | BRF_GRA }, // 21 - { "wwfs16.bin", 0x10000, 0x08343e7f, 5 | BRF_GRA }, // 22 - { "wwfs15.bin", 0x10000, 0xaac5a928, 5 | BRF_GRA }, // 23 - { "wwfs14.bin", 0x10000, 0x67eb7bea, 5 | BRF_GRA }, // 24 - { "wwfs13.bin", 0x10000, 0x970b6e76, 5 | BRF_GRA }, // 25 - { "wwfs12.bin", 0x10000, 0x242caff5, 5 | BRF_GRA }, // 26 - { "wwfs27.bin", 0x10000, 0xf3eb8ab9, 5 | BRF_GRA }, // 27 - { "wwfs26.bin", 0x10000, 0x2ca91eaf, 5 | BRF_GRA }, // 28 - { "wwfs25.bin", 0x10000, 0xbbf69c6a, 5 | BRF_GRA }, // 29 - { "wwfs24.bin", 0x10000, 0x76b08bcd, 5 | BRF_GRA }, // 30 - { "wwfs23.bin", 0x10000, 0x681f5b5e, 5 | BRF_GRA }, // 31 - { "wwfs22.bin", 0x10000, 0x81fe1bf7, 5 | BRF_GRA }, // 32 - { "wwfs21.bin", 0x10000, 0xc52eee5e, 5 | BRF_GRA }, // 33 - { "wwfs20.bin", 0x10000, 0xb2a8050e, 5 | BRF_GRA }, // 34 - { "wwfs35.bin", 0x10000, 0x9d648d82, 5 | BRF_GRA }, // 35 - { "wwfs34.bin", 0x10000, 0x742a79db, 5 | BRF_GRA }, // 36 - { "wwfs33.bin", 0x10000, 0xf6923db6, 5 | BRF_GRA }, // 37 - { "wwfs32.bin", 0x10000, 0x9becd621, 5 | BRF_GRA }, // 38 - { "wwfs31.bin", 0x10000, 0xf94c74d5, 5 | BRF_GRA }, // 39 - { "wwfs30.bin", 0x10000, 0x94094518, 5 | BRF_GRA }, // 40 - { "wwfs29.bin", 0x10000, 0x7b5b9d83, 5 | BRF_GRA }, // 41 - { "wwfs28.bin", 0x10000, 0x70fda626, 5 | BRF_GRA }, // 42 - - { "wwfs51.bin", 0x10000, 0x51157385, 6 | BRF_GRA }, // 43 Tiles - { "wwfs50.bin", 0x10000, 0x7fc79df5, 6 | BRF_GRA }, // 44 - { "wwfs49.bin", 0x10000, 0xa14076b0, 6 | BRF_GRA }, // 45 - { "wwfs48.bin", 0x10000, 0x251372fd, 6 | BRF_GRA }, // 46 - { "wwfs47.bin", 0x10000, 0x6fd7b6ea, 6 | BRF_GRA }, // 47 - { "wwfs46.bin", 0x10000, 0x985e5180, 6 | BRF_GRA }, // 48 - { "wwfs45.bin", 0x10000, 0xb2fad792, 6 | BRF_GRA }, // 49 - { "wwfs44.bin", 0x10000, 0x4f965fa9, 6 | BRF_GRA }, // 50 -}; - -STD_ROM_PICK(wwfsstarb) -STD_ROM_FN(wwfsstarb) - -struct BurnDriver BurnDrvWwfsstarb = { - "wwfsstarb", "wwfsstar", NULL, NULL, "1989", - "WWF Superstars (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, wwfsstarbRomInfo, wwfsstarbRomName, NULL, NULL, WwfsstarInputInfo, WwfsstarDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x180, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_xain.cpp b/jan/src/burn/drv/pre90s/d_xain.cpp deleted file mode 100644 index c66d88b6d..000000000 --- a/jan/src/burn/drv/pre90s/d_xain.cpp +++ /dev/null @@ -1,1336 +0,0 @@ -// FB Alpha Xain'd Sleena driver module -// Based on MAME driver by Carlos A. Lozano, Rob Rosenbrock, Phil Stroffolino, and Bryan McPhail - -#include "tiles_generic.h" -#include "m6809_intf.h" -#include "m6805_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvSubROM; -static UINT8 *DrvSoundROM; -static UINT8 *DrvMcuROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvShareRAM; -static UINT8 *DrvCharRAM; -static UINT8 *DrvBgRAM0; -static UINT8 *DrvBgRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSoundRAM; -static UINT8 *DrvMcuRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 nBankAData; -static UINT8 nBankBData; -static UINT16 scrollxp1; -static UINT16 scrollyp1; -static UINT16 scrollxp0; -static UINT16 scrollyp0; -static INT32 vblank; -static UINT8 soundlatch; -static UINT8 flipscreen; -static UINT8 xain_pri; - -static UINT8 port_a_out; -static UINT8 port_b_out; -static UINT8 port_c_out; -static UINT8 port_a_in; -static UINT8 port_b_in; -static UINT8 port_c_in; -static UINT8 ddr_a; -static UINT8 ddr_b; -static UINT8 ddr_c; -static UINT8 from_mcu; -static UINT8 from_main; -static UINT8 mcu_ready; -static UINT8 mcu_accept; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 is_bootleg; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p1 coin" }, - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin" }, - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p3 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x12, 0xff, 0xff, 0x3f, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x03, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x12, 0x01, 0x40, 0x00, "Upright" }, -// {0x12, 0x01, 0x40, 0x40, "Cocktail" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x80, 0x00, "Off" }, -// {0x12, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x03, "Easy" }, - {0x13, 0x01, 0x03, 0x02, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Game Time" }, - {0x13, 0x01, 0x0c, 0x0c, "Slow" }, - {0x13, 0x01, 0x0c, 0x08, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Fast" }, - {0x13, 0x01, 0x0c, 0x00, "Very Fast" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x30, "20k 70k and every 70k"}, - {0x13, 0x01, 0x30, 0x20, "30k 80k and every 80k"}, - {0x13, 0x01, 0x30, 0x10, "20k and 80k" }, - {0x13, 0x01, 0x30, 0x00, "30k and 80k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x80, "4" }, - {0x13, 0x01, 0xc0, 0x40, "6" }, - {0x13, 0x01, 0xc0, 0x00, "Infinite (Cheat)" }, -}; - -STDDIPINFO(Drv) - -static inline void palette_update(INT32 offset) -{ - INT32 b = DrvPalRAM[offset + 0x200] & 0x0f; - INT32 g = DrvPalRAM[offset] >> 4; - INT32 r = DrvPalRAM[offset] & 0x0f; - - DrvPalette[offset] = BurnHighCol(r+(r*16),g+(g*16),b+(b*16),0); -} - -static void bankswitchA(INT32 data) -{ - nBankAData = data; - M6809MapMemory(DrvMainROM + ((data & 0x08) ? 0x14000 : 0x10000), 0x4000, 0x7fff, MAP_ROM); -} - -static void xain_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0x3c00) { - DrvPalRAM[address & 0x3ff] = data; - palette_update(address & 0x1ff); - return; - } - - switch (address) - { - case 0x3a00: - case 0x3a01: - scrollxp1 = ((data << ((address & 1) * 8)) | (scrollxp1 & (0xff00 >> ((address & 1) * 8)))) & 0x1ff; - return; - - case 0x3a02: - case 0x3a03: - scrollyp1 = ((data << ((address & 1) * 8)) | (scrollyp1 & (0xff00 >> ((address & 1) * 8)))) & 0x1ff; - return; - - case 0x3a04: - case 0x3a05: - scrollxp0 = ((data << ((address & 1) * 8)) | (scrollxp0 & (0xff00 >> ((address & 1) * 8)))) & 0x1ff; - return; - - case 0x3a06: - case 0x3a07: - scrollyp0 = ((data << ((address & 1) * 8)) | (scrollyp0 & (0xff00 >> ((address & 1) * 8)))) & 0x1ff; - return; - - case 0x3a08: - { - INT32 cycles = M6809TotalCycles(); - M6809Close(); - M6809Open(2); - BurnTimerUpdate(cycles); - soundlatch = data; - // M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6809SetIRQLine(0, CPU_IRQSTATUS_ACK); // hold line until soundlatch is read to ensure commands are read - M6809Close(); - M6809Open(0); - } - return; - - case 0x3a09: - M6809SetIRQLine(0x20, CPU_IRQSTATUS_NONE); - return; - - case 0x3a0a: - M6809SetIRQLine(0x01, CPU_IRQSTATUS_NONE); - return; - - case 0x3a0b: - M6809SetIRQLine(0x00, CPU_IRQSTATUS_NONE); - return; - - case 0x3a0c: - { - M6809Close(); - M6809Open(1); - M6809SetIRQLine(0x00, CPU_IRQSTATUS_ACK); - M6809Close(); - M6809Open(0); - } - return; - - case 0x3a0d: - flipscreen = data & 0x01; - return; - - case 0x3a0e: - { - from_main = data; - mcu_accept = 0; - - if (is_bootleg == 0) - { - m6805Run((M6809TotalCycles() * 2) - m6805TotalCycles()); - m68705SetIrqLine(0, 1 /*ASSERT_LINE*/); - } - } - return; - - case 0x3a0f: - xain_pri = data & 0x07; - bankswitchA(data); - return; - } -} - -static UINT8 xain_main_read(UINT16 address) -{ - switch (address) - { - case 0x3a00: - return DrvInputs[0]; - - case 0x3a01: - return DrvInputs[1]; - - case 0x3a02: - return DrvDips[0]; - - case 0x3a03: - return DrvDips[1]; - - case 0x3a04: - m6805Run((M6809TotalCycles() * 2) - m6805TotalCycles()); - mcu_ready = 1; - return from_mcu; - - case 0x3a05: - { - UINT8 ret = DrvInputs[2] & ~0x38; - - ret |= vblank ? 0x20 : 0; - - if (is_bootleg) - { - ret |= 0x18; - } - else - { - m6805Run((M6809TotalCycles() * 2) - m6805TotalCycles()); - if (mcu_ready == 1) ret |= 0x08; - if (mcu_accept == 1) ret |= 0x10; - } - - return ret; - } - - case 0x3a06: - { - if (is_bootleg == 0) - { - m6805Run((M6809TotalCycles() * 2) - m6805TotalCycles()); - - mcu_ready = 1; - mcu_accept = 1; - m68705SetIrqLine(0, 0 /*CLEAR_LINE*/); - } - return 0xff; - } - } - - return 0; -} - -static void bankswitchB(INT32 data) -{ - nBankBData = data; - M6809MapMemory(DrvSubROM + ((data & 0x01) ? 0x14000 : 0x10000), 0x4000, 0x7fff, MAP_ROM); -} - -static void xain_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: - { - M6809Close(); - M6809Open(0); - M6809SetIRQLine(0x00, CPU_IRQSTATUS_ACK); // maincpu irq - M6809Close(); - M6809Open(1); - } - return; - - case 0x2800: - M6809SetIRQLine(0x00, CPU_IRQSTATUS_NONE); - return; - - case 0x3000: - bankswitchB(data); - return; - } -} - -static UINT8 xain_sub_read(UINT16 /*address*/) -{ - return 0; -} - -static void xain_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2800: - case 0x2801: - BurnYM2203Write(0, address & 1, data); - return; - - case 0x3000: - case 0x3001: - BurnYM2203Write(1, address & 1, data); - return; - } -} - -static UINT8 xain_sound_read(UINT16 address) -{ - switch (address) - { - case 0x1000: - M6809SetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static void xain_68705_port_b_write(UINT8 data) // ripped directly from MAME -{ - if ((ddr_b & 0x02) && (~data & 0x02)) - { - port_a_in = from_main; - } - else if ((ddr_b & 0x02) && (~port_b_out & 0x02) && (data & 0x02)) - { - mcu_accept = 1; - m68705SetIrqLine(0, 0 /*CLEAR_LINE*/); - } - - if ((ddr_b & 0x04) && (~port_b_out & 0x04) && (data & 0x04)) - { - mcu_ready = 0; - from_mcu = port_a_out; - } - - port_b_out = data; -} - -static void xain_68705_write_ports(UINT16 address, UINT8 data) -{ - switch (address & 0x7ff) - { - case 0: - port_a_out = data; - return; - - case 1: - xain_68705_port_b_write(data); - return; - - case 2: - port_c_out = data; - return; - - case 4: - ddr_a = data; - return; - - case 5: - ddr_b = data; - return; - - case 6: - ddr_c = data; - return; - } -} - -static UINT8 xain_68705_read_ports(UINT16 address) -{ - switch (address & 0x7ff) - { - case 0: - return (port_a_out & ddr_a) | (port_a_in & ~ddr_a); - - case 1: - return (port_b_out & ddr_b) | (port_b_in & ~ddr_b); - - case 2: - { - port_c_in = 0; - - if (!mcu_accept) port_c_in |= 0x01; - if (mcu_ready) port_c_in |= 0x02; - - return (port_c_out & ddr_c) | (port_c_in & ~ddr_c); - } - } - - return 0; -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - M6809SetIRQLine(0x01, ((nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE)); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(M6809TotalCycles() * nSoundRate / 1500000); -} - -inline static double DrvGetTime() -{ - return (double)M6809TotalCycles() / 1500000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - M6809Open(0); - M6809Reset(); - bankswitchA(0); - M6809Close(); - - M6809Open(1); - M6809Reset(); - bankswitchB(0); - M6809Close(); - - M6809Open(2); - M6809Reset(); - BurnYM2203Reset(); - M6809Close(); - - m6805Open(0); - m68705Reset(); - m6805Close(); - - scrollxp1 = 0; - scrollyp1 = 0; - scrollxp0 = 0; - scrollyp0 = 0; - vblank = 0; - soundlatch = 0; - flipscreen = 0; - xain_pri = 0; - - port_a_out = 0; - port_b_out = 0; - port_c_out = 0; - port_a_in = 0; - port_b_in = 0; - port_c_in = 0; - ddr_a = 0; - ddr_b = 0; - ddr_c = 0; - from_mcu = 0; - from_main = 0; - mcu_ready = 0; - mcu_accept = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x018000; - DrvSubROM = Next; Next += 0x018000; - DrvSoundROM = Next; Next += 0x010000; - DrvMcuROM = Next; Next += 0x000800; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvShareRAM = Next; Next += 0x002000; - DrvCharRAM = Next; Next += 0x000800; - DrvBgRAM0 = Next; Next += 0x000800; - DrvBgRAM1 = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000200; - DrvPalRAM = Next; Next += 0x000400; - DrvSoundRAM = Next; Next += 0x000800; - DrvMcuRAM = Next; Next += 0x000080; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0, 2, 4, 6 }; - INT32 Plane1[4] = { RGN_FRAC(0x40000, 1,2)+0, RGN_FRAC(0x40000, 1,2)+4, 0, 4 }; - INT32 XOffs0[8] = { STEP2(0*8+1,-1), STEP2(8*8+1,-1), STEP2(16*8+1,-1), STEP2(24*8+1,-1) }; - INT32 YOffs0[8] = { STEP8(0,8) }; - INT32 XOffs1[16] = { STEP4(0*8+3,-1), STEP4(16*8+3,-1), STEP4(32*8+3,-1), STEP4(48*8+3,-1) }; - INT32 YOffs1[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0400, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM3); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x08000, 0, 1)) return 1; - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvSubROM + 0x08000, 2, 1)) return 1; - if (BurnLoadRom(DrvSubROM + 0x10000, 3, 1)) return 1; - - if (BurnLoadRom(DrvSoundROM + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x008000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x018000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x028000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x030000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x038000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x008000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x028000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x030000, 19, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x008000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x010000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x018000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x020000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x028000, 25, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x030000, 26, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x038000, 27, 1)) return 1; - - is_bootleg = (BurnLoadRom(DrvMcuROM, 29, 1)) ? 1 : 0; - - DrvGfxDecode(); - } - - M6809Init(3); - M6809Open(0); - M6809MapMemory(DrvShareRAM, 0x0000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvCharRAM, 0x2000, 0x27ff, MAP_RAM); - M6809MapMemory(DrvBgRAM1, 0x2800, 0x2fff, MAP_RAM); - M6809MapMemory(DrvBgRAM0, 0x3000, 0x37ff, MAP_RAM); - M6809MapMemory(DrvSprRAM, 0x3800, 0x39ff, MAP_RAM); - M6809MapMemory(DrvPalRAM, 0x3c00, 0x3fff, MAP_ROM); - M6809MapMemory(DrvMainROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(xain_main_write); - M6809SetReadHandler(xain_main_read); - M6809Close(); - - M6809Open(1); - M6809MapMemory(DrvShareRAM, 0x0000, 0x1fff, MAP_RAM); - M6809MapMemory(DrvSubROM + 0x08000, 0x8000, 0xffff, MAP_ROM); - M6809SetWriteHandler(xain_sub_write); - M6809SetReadHandler(xain_sub_read); - M6809Close(); - - M6809Open(2); - M6809MapMemory(DrvSoundRAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(DrvSoundROM + 0x4000, 0x4000, 0xffff, MAP_ROM); - M6809SetWriteHandler(xain_sound_write); - M6809SetReadHandler(xain_sound_read); - M6809Close(); - - m6805Init(1, 0x800); - m6805Open(0); - m6805MapMemory(DrvMcuRAM, 0x0010, 0x007f, MAP_RAM); - m6805MapMemory(DrvMcuROM + 0x80, 0x0080, 0x07ff, MAP_ROM); - m6805SetWriteHandler(xain_68705_write_ports); - m6805SetReadHandler(xain_68705_read_ports); - m6805Close(); - - BurnYM2203Init(2, 6000000/2, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachM6809(1500000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - M6809Exit(); - m6805Exit(); - - BurnYM2203Exit(); - - BurnFree (AllMem); - - return 0; -} - -static inline INT32 scanline_to_vcount(INT32 scanline) // ripped directly from MAME -{ - INT32 vcount = scanline + 8; - - if (vcount < 0x100) - return vcount; - else - return (vcount - 0x18) | 0x100; -} - -static void xain_scanline(INT32 scanline) // ripped directly from MAME -{ - INT32 screen_height = 240; - INT32 vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1); - INT32 vcount = scanline_to_vcount(scanline); - - if (!(vcount_old & 8) && (vcount & 8)) - { - M6809SetIRQLine(0x01, CPU_IRQSTATUS_ACK); - } - - if (vcount == 0xf8) - { - M6809SetIRQLine(0x20, CPU_IRQSTATUS_ACK); - } - - vblank = (vcount >= (248 - 1)) ? 1 : 0; // -1 is a hack -} - -static void draw_layer_8x8(INT32 transparent) -{ - if ((nBurnLayer & 0x01) == 0) return; - - for (INT32 offs = 32; offs < 32 * 31; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvCharRAM[offs + 0x400]; - INT32 code = DrvCharRAM[offs + 0x000] + ((attr & 0x03) * 256); - INT32 color = (attr & 0xe0) >> 5; - - if (transparent) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy - 8, color, 4, 0, DrvGfxROM0); - } - } -} - -static void draw_layer_16x16(UINT8 *ram, UINT8 *rom, INT32 color_offset, INT32 scrollx, INT32 scrolly, INT32 transparent) -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f); - INT32 sy = (offs / 0x20); - - INT32 ofst = (sx & 0x0f) + (((sy & 0x0f) + (sx & 0x10)) << 4) + ((sy & 0x10) << 5); - - sx = (sx * 16) - scrollx; - if (sx < -15) sx += 0x200; - sy = ((sy * 16) - scrolly) - 8; - if (sy < -15) sy += 0x200; - - if (sx >= nScreenWidth || sy >= nScreenHeight || sx < -15 || sy < -15) continue; - - INT32 attr = ram[ofst + 0x400]; - INT32 code = ram[ofst + 0x000] + ((attr & 0x07) * 256); - INT32 flipx = attr & 0x80; - INT32 color = (attr & 0x70) >> 4; - - if (transparent) { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_offset, rom); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, color_offset, rom); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, color_offset, rom); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, color_offset, rom); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x180; offs += 4) - { - INT32 attr = DrvSprRAM[offs+1]; - INT32 code = DrvSprRAM[offs+2] | ((attr & 7) << 8); - INT32 color = (attr & 0x38) >> 3; - - INT32 sx = 238 - DrvSprRAM[offs+3]; - if (sx <= -7) sx += 256; - INT32 sy = 240 - DrvSprRAM[offs]; - if (sy <= -7) sy += 256; - INT32 flipx = attr & 0x40; - INT32 flipy = 0; - - if (attr & 0x80) - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, (flipy ? sy+16:sy-16)-8, color, 4, 0, 0x80, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, (flipy ? sy+16:sy-16)-8, color, 4, 0, 0x80, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, (flipy ? sy+16:sy-16)-8, color, 4, 0, 0x80, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, (flipy ? sy+16:sy-16)-8, color, 4, 0, 0x80, DrvGfxROM3); - } - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code+1, sx, sy-8, color, 4, 0, 0x80, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code+1, sx, sy-8, color, 4, 0, 0x80, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code+1, sx, sy-8, color, 4, 0, 0x80, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code+1, sx, sy-8, color, 4, 0, 0x80, DrvGfxROM3); - } - } - } - else - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 8, color, 4, 0, 0x80, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 8, color, 4, 0, 0x80, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 8, color, 4, 0, 0x80, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 8, color, 4, 0, 0x80, DrvGfxROM3); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x200; i++) { - palette_update(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - switch (xain_pri & 0x07) - { - case 0: - if (nBurnLayer & 1) draw_layer_16x16(DrvBgRAM0, DrvGfxROM2, 0x180, scrollxp0, scrollyp0, 0); - if (nBurnLayer & 2) draw_layer_16x16(DrvBgRAM1, DrvGfxROM1, 0x100, scrollxp1, scrollyp1, 1); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 4) draw_layer_8x8(1); - break; - - case 1: - if (nBurnLayer & 2) draw_layer_16x16(DrvBgRAM1, DrvGfxROM1, 0x100, scrollxp1, scrollyp1, 0); - if (nBurnLayer & 1) draw_layer_16x16(DrvBgRAM0, DrvGfxROM2, 0x180, scrollxp0, scrollyp0, 1); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 4) draw_layer_8x8(1); - break; - - case 2: - if (nBurnLayer & 4) draw_layer_8x8(0); - if (nBurnLayer & 1) draw_layer_16x16(DrvBgRAM0, DrvGfxROM2, 0x180, scrollxp0, scrollyp0, 1); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 2) draw_layer_16x16(DrvBgRAM1, DrvGfxROM1, 0x100, scrollxp1, scrollyp1, 1); - break; - - case 3: - if (nBurnLayer & 4) draw_layer_8x8(0); - if (nBurnLayer & 2) draw_layer_16x16(DrvBgRAM1, DrvGfxROM1, 0x100, scrollxp1, scrollyp1, 1); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 1) draw_layer_16x16(DrvBgRAM0, DrvGfxROM2, 0x180, scrollxp0, scrollyp0, 1); - break; - - case 4: - if (nBurnLayer & 1) draw_layer_16x16(DrvBgRAM0, DrvGfxROM2, 0x180, scrollxp0, scrollyp0, 0); - if (nBurnLayer & 4) draw_layer_8x8(1); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 2) draw_layer_16x16(DrvBgRAM1, DrvGfxROM1, 0x100, scrollxp1, scrollyp1, 1); - break; - - case 5: - if (nBurnLayer & 2) draw_layer_16x16(DrvBgRAM1, DrvGfxROM1, 0x100, scrollxp1, scrollyp1, 0); - if (nBurnLayer & 4) draw_layer_8x8(1); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 1) draw_layer_16x16(DrvBgRAM0, DrvGfxROM2, 0x180, scrollxp0, scrollyp0, 1); - break; - - case 6: - if (nBurnLayer & 1) draw_layer_16x16(DrvBgRAM0, DrvGfxROM2, 0x180, scrollxp0, scrollyp0, 0); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 2) draw_layer_16x16(DrvBgRAM1, DrvGfxROM1, 0x100, scrollxp1, scrollyp1, 1); - if (nBurnLayer & 4) draw_layer_8x8(1); - break; - - case 7: - if (nBurnLayer & 2) draw_layer_16x16(DrvBgRAM1, DrvGfxROM1, 0x100, scrollxp1, scrollyp1, 0); - if (nSpriteEnable & 1) draw_sprites(); - if (nBurnLayer & 1) draw_layer_16x16(DrvBgRAM0, DrvGfxROM2, 0x180, scrollxp0, scrollyp0, 1); - if (nBurnLayer & 4) draw_layer_8x8(1); - break; - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6809NewFrame(); - m6805NewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 272*8; - INT32 nCyclesTotal[4] = { (INT32)((double)1500000 / 57.44), (INT32)((double)1500000 / 57.44), (INT32)((double)1500000 / 57.44), (INT32)((double)3000000 / 57.44) }; - INT32 nCyclesDone[4] = { 0, 0, 0, 0 }; - - m6805Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - M6809Open(0); - if ((i%8) == 7) - xain_scanline(i/8); - nCyclesDone[0] += M6809Run(nCyclesTotal[0] / nInterleave); - M6809Close(); - - M6809Open(1); - nCyclesDone[1] += M6809Run(nCyclesTotal[1] / nInterleave); - M6809Close(); - - m6805Run(nCyclesTotal[3] / nInterleave); - - M6809Open(2); - BurnTimerUpdate((i + 1) * (nCyclesTotal[2] / nInterleave)); - M6809Close(); - } - - m6805Close(); - - M6809Open(2); - BurnTimerEndFrame(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - M6809Close(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029722; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - M6809Scan(nAction); - m6805Scan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(nBankAData); - SCAN_VAR(nBankBData); - SCAN_VAR(scrollxp1); - SCAN_VAR(scrollyp1); - SCAN_VAR(scrollxp0); - SCAN_VAR(scrollyp0); - SCAN_VAR(vblank); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(xain_pri); - SCAN_VAR(port_a_out); - SCAN_VAR(port_b_out); - SCAN_VAR(port_c_out); - SCAN_VAR(port_a_in); - SCAN_VAR(port_b_in); - SCAN_VAR(port_c_in); - SCAN_VAR(ddr_a); - SCAN_VAR(ddr_b); - SCAN_VAR(ddr_c); - SCAN_VAR(from_mcu); - SCAN_VAR(from_main); - SCAN_VAR(mcu_ready); - SCAN_VAR(mcu_accept); - } - - if (nAction & ACB_WRITE) - { - M6809Open(0); - bankswitchA(nBankAData); - M6809Close(); - - M6809Open(1); - bankswitchB(nBankBData); - M6809Close(); - - DrvRecalc = 1; - } - - return 0; -} - - -// Xain'd Sleena (World) - -static struct BurnRomInfo xsleenaRomDesc[] = { - { "p9-08.ic66", 0x8000, 0x5179ae3f, 1 | BRF_PRG | BRF_ESS }, // 0 Master M6809 Code - { "pa-09.ic65", 0x8000, 0x10a7c800, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "p1-0.ic29", 0x8000, 0xa1a860e2, 2 | BRF_PRG | BRF_ESS }, // 2 Slave M6809 code - { "p0-0.ic15", 0x8000, 0x948b9757, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "p2-0.ic49", 0x8000, 0xa5318cb8, 3 | BRF_PRG | BRF_ESS }, // 4 Sound M6809 Code - - { "pb-01.ic24", 0x8000, 0x83c00dd8, 4 | BRF_GRA }, // 5 Character - - { "pk-0.ic136", 0x8000, 0x11eb4247, 5 | BRF_GRA }, // 6 Background Layer 1 tiles - { "pl-0.ic135", 0x8000, 0x422b536e, 5 | BRF_GRA }, // 7 - { "pm-0.ic134", 0x8000, 0x828c1b0c, 5 | BRF_GRA }, // 8 - { "pn-0.ic133", 0x8000, 0xd37939e0, 5 | BRF_GRA }, // 9 - { "pc-0.ic114", 0x8000, 0x8f0aa1a7, 5 | BRF_GRA }, // 10 - { "pd-0.ic113", 0x8000, 0x45681910, 5 | BRF_GRA }, // 11 - { "pe-0.ic112", 0x8000, 0xa8eeabc8, 5 | BRF_GRA }, // 12 - { "pf-0.ic111", 0x8000, 0xe59a2f27, 5 | BRF_GRA }, // 13 - - { "p5-0.ic44", 0x8000, 0x5c6c453c, 6 | BRF_GRA }, // 14 Background Layer 0 tiles - { "p4-0.ic45", 0x8000, 0x59d87a9a, 6 | BRF_GRA }, // 15 - { "p3-0.ic46", 0x8000, 0x84884a2e, 6 | BRF_GRA }, // 16 - { "p6-0.ic43", 0x8000, 0x8d637639, 6 | BRF_GRA }, // 17 - { "p7-0.ic42", 0x8000, 0x71eec4e6, 6 | BRF_GRA }, // 18 - { "p8-0.ic41", 0x8000, 0x7fc9704f, 6 | BRF_GRA }, // 19 - - { "po-0.ic131", 0x8000, 0x252976ae, 7 | BRF_GRA }, // 20 Sprite tiles - { "pp-0.ic130", 0x8000, 0xe6f1e8d5, 7 | BRF_GRA }, // 21 - { "pq-0.ic129", 0x8000, 0x785381ed, 7 | BRF_GRA }, // 22 - { "pr-0.ic128", 0x8000, 0x59754e3d, 7 | BRF_GRA }, // 23 - { "pg-0.ic109", 0x8000, 0x4d977f33, 7 | BRF_GRA }, // 24 - { "ph-0.ic108", 0x8000, 0x3f3b62a0, 7 | BRF_GRA }, // 25 - { "pi-0.ic107", 0x8000, 0x76641ee3, 7 | BRF_GRA }, // 26 - { "pj-0.ic106", 0x8000, 0x37671f36, 7 | BRF_GRA }, // 27 - - { "pt-0.ic59", 0x0100, 0xfed32888, 8 | BRF_GRA | BRF_OPT }, // 28 Priority Prom - - { "pz-0.113", 0x0800, 0xa432a907, 9 | BRF_PRG | BRF_ESS }, // 29 M68705 Code -}; - -STD_ROM_PICK(xsleena) -STD_ROM_FN(xsleena) - -struct BurnDriver BurnDrvXsleena = { - "xsleena", NULL, NULL, NULL, "1986", - "Xain'd Sleena (World)\0", NULL, "Technos Japan (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TECHNOS, GBF_HORSHOOT, 0, - NULL, xsleenaRomInfo, xsleenaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 240, 4, 3 -}; - - -// Xain'd Sleena (Japan) - -static struct BurnRomInfo xsleenajRomDesc[] = { - { "p9-01.ic66", 0x8000, 0x370164be, 1 | BRF_PRG | BRF_ESS }, // 0 Master M6809 Code - { "pa-0.ic65", 0x8000, 0xd22bf859, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "p1-0.ic29", 0x8000, 0xa1a860e2, 2 | BRF_PRG | BRF_ESS }, // 2 Slave M6809 code - { "p0-0.ic15", 0x8000, 0x948b9757, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "p2-0.ic49", 0x8000, 0xa5318cb8, 3 | BRF_PRG | BRF_ESS }, // 4 Sound M6809 Code - - { "pb-01.ic24", 0x8000, 0x83c00dd8, 4 | BRF_GRA }, // 5 Character - - { "pk-0.ic136", 0x8000, 0x11eb4247, 5 | BRF_GRA }, // 6 Background Layer 1 tiles - { "pl-0.ic135", 0x8000, 0x422b536e, 5 | BRF_GRA }, // 7 - { "pm-0.ic134", 0x8000, 0x828c1b0c, 5 | BRF_GRA }, // 8 - { "pn-0.ic133", 0x8000, 0xd37939e0, 5 | BRF_GRA }, // 9 - { "pc-0.ic114", 0x8000, 0x8f0aa1a7, 5 | BRF_GRA }, // 10 - { "pd-0.ic113", 0x8000, 0x45681910, 5 | BRF_GRA }, // 11 - { "pe-0.ic112", 0x8000, 0xa8eeabc8, 5 | BRF_GRA }, // 12 - { "pf-0.ic111", 0x8000, 0xe59a2f27, 5 | BRF_GRA }, // 13 - - { "p5-0.ic44", 0x8000, 0x5c6c453c, 6 | BRF_GRA }, // 14 Background Layer 0 tiles - { "p4-0.ic45", 0x8000, 0x59d87a9a, 6 | BRF_GRA }, // 15 - { "p3-0.ic46", 0x8000, 0x84884a2e, 6 | BRF_GRA }, // 16 - { "p6-0.ic43", 0x8000, 0x8d637639, 6 | BRF_GRA }, // 17 - { "p7-0.ic42", 0x8000, 0x71eec4e6, 6 | BRF_GRA }, // 18 - { "p8-0.ic41", 0x8000, 0x7fc9704f, 6 | BRF_GRA }, // 19 - - { "po-0.ic131", 0x8000, 0x252976ae, 7 | BRF_GRA }, // 20 Sprite tiles - { "pp-0.ic130", 0x8000, 0xe6f1e8d5, 7 | BRF_GRA }, // 21 - { "pq-0.ic129", 0x8000, 0x785381ed, 7 | BRF_GRA }, // 22 - { "pr-0.ic128", 0x8000, 0x59754e3d, 7 | BRF_GRA }, // 23 - { "pg-0.ic109", 0x8000, 0x4d977f33, 7 | BRF_GRA }, // 24 - { "ph-0.ic108", 0x8000, 0x3f3b62a0, 7 | BRF_GRA }, // 25 - { "pi-0.ic107", 0x8000, 0x76641ee3, 7 | BRF_GRA }, // 26 - { "pj-0.ic106", 0x8000, 0x37671f36, 7 | BRF_GRA }, // 27 - - { "pt-0.ic59", 0x0100, 0xfed32888, 8 | BRF_GRA | BRF_OPT }, // 28 Priority Prom - - { "pz-0.113", 0x0800, 0xa432a907, 9 | BRF_PRG | BRF_ESS }, // 29 M68705 Code -}; - -STD_ROM_PICK(xsleenaj) -STD_ROM_FN(xsleenaj) - -struct BurnDriver BurnDrvXsleenaj = { - "xsleenaj", "xsleena", NULL, NULL, "1986", - "Xain'd Sleena (Japan)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_HORSHOOT, 0, - NULL, xsleenajRomInfo, xsleenajRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 240, 4, 3 -}; - - -// Solar-Warrior (US) - -static struct BurnRomInfo solrwarrRomDesc[] = { - { "p9-02.ic66", 0x8000, 0x8ff372a8, 1 | BRF_PRG | BRF_ESS }, // 0 Master M6809 code - { "pa-03.ic65", 0x8000, 0x154f946f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "p1-02.ic29", 0x8000, 0xf5f235a3, 2 | BRF_PRG | BRF_ESS }, // 2 Slave M6809 code - { "p0-02.ic133", 0x8000, 0x51ae95ae, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "p2-0.ic49", 0x8000, 0xa5318cb8, 3 | BRF_PRG | BRF_ESS }, // 4 Sound M6809 Code - - { "pb-01.ic24", 0x8000, 0x83c00dd8, 4 | BRF_GRA }, // 5 Character - - { "pk-0.ic136", 0x8000, 0x11eb4247, 5 | BRF_GRA }, // 6 Background Layer 1 tiles - { "pl-0.ic135", 0x8000, 0x422b536e, 5 | BRF_GRA }, // 7 - { "pm-0.ic134", 0x8000, 0x828c1b0c, 5 | BRF_GRA }, // 8 - { "pn-02.ic133", 0x8000, 0xd2ed6f94, 5 | BRF_GRA }, // 9 - { "pc-0.ic114", 0x8000, 0x8f0aa1a7, 5 | BRF_GRA }, // 10 - { "pd-0.ic113", 0x8000, 0x45681910, 5 | BRF_GRA }, // 11 - { "pe-0.ic112", 0x8000, 0xa8eeabc8, 5 | BRF_GRA }, // 12 - { "pf-02.ic111", 0x8000, 0x6e627a77, 5 | BRF_GRA }, // 13 - - { "p5-0.ic44", 0x8000, 0x5c6c453c, 6 | BRF_GRA }, // 14 Background Layer 0 tiles - { "p4-0.ic45", 0x8000, 0x59d87a9a, 6 | BRF_GRA }, // 15 - { "p3-0.ic46", 0x8000, 0x84884a2e, 6 | BRF_GRA }, // 16 - { "p6-0.ic43", 0x8000, 0x8d637639, 6 | BRF_GRA }, // 17 - { "p7-0.ic42", 0x8000, 0x71eec4e6, 6 | BRF_GRA }, // 18 - { "p8-0.ic41", 0x8000, 0x7fc9704f, 6 | BRF_GRA }, // 19 - - { "po-0.ic131", 0x8000, 0x252976ae, 7 | BRF_GRA }, // 20 Sprite tiles - { "pp-0.ic130", 0x8000, 0xe6f1e8d5, 7 | BRF_GRA }, // 21 - { "pq-0.ic129", 0x8000, 0x785381ed, 7 | BRF_GRA }, // 22 - { "pr-0.ic128", 0x8000, 0x59754e3d, 7 | BRF_GRA }, // 23 - { "pg-0.ic109", 0x8000, 0x4d977f33, 7 | BRF_GRA }, // 24 - { "ph-0.ic108", 0x8000, 0x3f3b62a0, 7 | BRF_GRA }, // 25 - { "pi-0.ic107", 0x8000, 0x76641ee3, 7 | BRF_GRA }, // 26 - { "pj-0.ic106", 0x8000, 0x37671f36, 7 | BRF_GRA }, // 27 - - { "pt-0.ic59", 0x0100, 0xfed32888, 8 | BRF_GRA | BRF_OPT }, // 28 Priority Prom - - { "pz-0.113", 0x0800, 0xa432a907, 9 | BRF_PRG | BRF_ESS }, // 29 M68705 Code -}; - -STD_ROM_PICK(solrwarr) -STD_ROM_FN(solrwarr) - -struct BurnDriver BurnDrvSolrwarr = { - "solrwarr", "xsleena", NULL, NULL, "1986", - "Solar-Warrior (US)\0", NULL, "Technos Japan (Taito / Memetron license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_HORSHOOT, 0, - NULL, solrwarrRomInfo, solrwarrRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 240, 4, 3 -}; - - -// Xain'd Sleena (bootleg) - -static struct BurnRomInfo xsleenabRomDesc[] = { - { "1.rom", 0x8000, 0x79f515a7, 1 | BRF_PRG | BRF_ESS }, // 0 Master M6809 Code - { "pa-0.ic65", 0x8000, 0xd22bf859, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "p1-0.ic29", 0x8000, 0xa1a860e2, 2 | BRF_PRG | BRF_ESS }, // 2 Slave M6809 code - { "p0-0.ic15", 0x8000, 0x948b9757, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "p2-0.ic49", 0x8000, 0xa5318cb8, 3 | BRF_PRG | BRF_ESS }, // 4 Sound M6809 Code - - { "pb-01.ic24", 0x8000, 0x83c00dd8, 4 | BRF_GRA }, // 5 Character - - { "pk-0.ic136", 0x8000, 0x11eb4247, 5 | BRF_GRA }, // 6 Background Layer 1 tiles - { "pl-0.ic135", 0x8000, 0x422b536e, 5 | BRF_GRA }, // 7 - { "pm-0.ic134", 0x8000, 0x828c1b0c, 5 | BRF_GRA }, // 8 - { "pn-0.ic133", 0x8000, 0xd37939e0, 5 | BRF_GRA }, // 9 - { "pc-0.ic114", 0x8000, 0x8f0aa1a7, 5 | BRF_GRA }, // 10 - { "pd-0.ic113", 0x8000, 0x45681910, 5 | BRF_GRA }, // 11 - { "pe-0.ic112", 0x8000, 0xa8eeabc8, 5 | BRF_GRA }, // 12 - { "pf-0.ic111", 0x8000, 0xe59a2f27, 5 | BRF_GRA }, // 13 - - { "p5-0.ic44", 0x8000, 0x5c6c453c, 6 | BRF_GRA }, // 14 Background Layer 0 tiles - { "p4-0.ic45", 0x8000, 0x59d87a9a, 6 | BRF_GRA }, // 15 - { "p3-0.ic46", 0x8000, 0x84884a2e, 6 | BRF_GRA }, // 16 - { "p6-0.ic43", 0x8000, 0x8d637639, 6 | BRF_GRA }, // 17 - { "p7-0.ic42", 0x8000, 0x71eec4e6, 6 | BRF_GRA }, // 18 - { "p8-0.ic41", 0x8000, 0x7fc9704f, 6 | BRF_GRA }, // 19 - - { "po-0.ic131", 0x8000, 0x252976ae, 7 | BRF_GRA }, // 20 Sprite tiles - { "pp-0.ic130", 0x8000, 0xe6f1e8d5, 7 | BRF_GRA }, // 21 - { "pq-0.ic129", 0x8000, 0x785381ed, 7 | BRF_GRA }, // 22 - { "pr-0.ic128", 0x8000, 0x59754e3d, 7 | BRF_GRA }, // 23 - { "pg-0.ic109", 0x8000, 0x4d977f33, 7 | BRF_GRA }, // 24 - { "ph-0.ic108", 0x8000, 0x3f3b62a0, 7 | BRF_GRA }, // 25 - { "pi-0.ic107", 0x8000, 0x76641ee3, 7 | BRF_GRA }, // 26 - { "pj-0.ic106", 0x8000, 0x37671f36, 7 | BRF_GRA }, // 27 - - { "pt-0.ic59", 0x0100, 0xfed32888, 8 | BRF_GRA | BRF_OPT }, // 28 Priority Prom -}; - -STD_ROM_PICK(xsleenab) -STD_ROM_FN(xsleenab) - -struct BurnDriverD BurnDrvXsleenab = { - "xsleenab", "xsleena", NULL, NULL, "1986", - "Xain'd Sleena (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_HORSHOOT, 0, - NULL, xsleenabRomInfo, xsleenabRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 240, 4, 3 -}; - - -// Xain'd Sleena (bootleg, bugfixed) -// newer bootleg, fixes some of the issues with the other one -// f205v id 1016 - -static struct BurnRomInfo xsleenabaRomDesc[] = { - { "xs87b-10.7d", 0x8000, 0x3d5f9fb4, 1 | BRF_PRG | BRF_ESS }, // 0 Master M6809 Code - { "xs87b-11.7c", 0x8000, 0x81c80d54, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "p1-0.ic29", 0x8000, 0xa1a860e2, 2 | BRF_PRG | BRF_ESS }, // 2 Slave M6809 code - { "p0-0.ic15", 0x8000, 0x948b9757, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "p2-0.ic49", 0x8000, 0xa5318cb8, 3 | BRF_PRG | BRF_ESS }, // 4 Sound M6809 Code - - { "pb-01.ic24", 0x8000, 0x83c00dd8, 4 | BRF_GRA }, // 5 Character - - { "pk-0.ic136", 0x8000, 0x11eb4247, 5 | BRF_GRA }, // 6 Background Layer 1 tiles - { "pl-0.ic135", 0x8000, 0x422b536e, 5 | BRF_GRA }, // 7 - { "pm-0.ic134", 0x8000, 0x828c1b0c, 5 | BRF_GRA }, // 8 - { "pn-0.ic133", 0x8000, 0xd37939e0, 5 | BRF_GRA }, // 9 - { "pc-0.ic114", 0x8000, 0x8f0aa1a7, 5 | BRF_GRA }, // 10 - { "pd-0.ic113", 0x8000, 0x45681910, 5 | BRF_GRA }, // 11 - { "pe-0.ic112", 0x8000, 0xa8eeabc8, 5 | BRF_GRA }, // 12 - { "pf-0.ic111", 0x8000, 0xe59a2f27, 5 | BRF_GRA }, // 13 - - { "p5-0.ic44", 0x8000, 0x5c6c453c, 6 | BRF_GRA }, // 14 Background Layer 0 tiles - { "p4-0.ic45", 0x8000, 0x59d87a9a, 6 | BRF_GRA }, // 15 - { "p3-0.ic46", 0x8000, 0x84884a2e, 6 | BRF_GRA }, // 16 - { "p6-0.ic43", 0x8000, 0x8d637639, 6 | BRF_GRA }, // 17 - { "p7-0.ic42", 0x8000, 0x71eec4e6, 6 | BRF_GRA }, // 18 - { "p8-0.ic41", 0x8000, 0x7fc9704f, 6 | BRF_GRA }, // 19 - - { "po-0.ic131", 0x8000, 0x252976ae, 7 | BRF_GRA }, // 20 Sprite tiles - { "pp-0.ic130", 0x8000, 0xe6f1e8d5, 7 | BRF_GRA }, // 21 - { "pq-0.ic129", 0x8000, 0x785381ed, 7 | BRF_GRA }, // 22 - { "pr-0.ic128", 0x8000, 0x59754e3d, 7 | BRF_GRA }, // 23 - { "pg-0.ic109", 0x8000, 0x4d977f33, 7 | BRF_GRA }, // 24 - { "ph-0.ic108", 0x8000, 0x3f3b62a0, 7 | BRF_GRA }, // 25 - { "pi-0.ic107", 0x8000, 0x76641ee3, 7 | BRF_GRA }, // 26 - { "pj-0.ic106", 0x8000, 0x37671f36, 7 | BRF_GRA }, // 27 - - { "pt-0.ic59", 0x0100, 0xfed32888, 8 | BRF_GRA | BRF_OPT }, // 28 Priority Prom -}; - -STD_ROM_PICK(xsleenaba) -STD_ROM_FN(xsleenaba) - -struct BurnDriverD BurnDrvXsleenaba = { - "xsleenaba", "xsleena", NULL, NULL, "1987", - "Xain'd Sleena (bootleg, bugfixed)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_HORSHOOT, 0, - NULL, xsleenabaRomInfo, xsleenabaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pre90s/d_xxmissio.cpp b/jan/src/burn/drv/pre90s/d_xxmissio.cpp deleted file mode 100644 index 9ece7169a..000000000 --- a/jan/src/burn/drv/pre90s/d_xxmissio.cpp +++ /dev/null @@ -1,693 +0,0 @@ -// FB Alpha XX Mission driver module -// Based on MAME driver by Uki -// Todo: -// Figure out why the scrolling "hiccups" when something blows up running @ -// 3mhz. Tried every variation of timing I could think of. grr! -dink feb. 3 2016 - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvShareRAM0; -static UINT8 *DrvShareRAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 scrollx; -static UINT8 scrollx_shifted; -static UINT8 scrolly; -static UINT8 cpu_bank; -static UINT8 cpu_status; -static UINT8 flipscreen; - -static INT32 vblank; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[2]; - -static struct BurnInputInfo XxmissioInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Xxmissio) - -static struct BurnDIPInfo XxmissioDIPList[]= -{ - {0x10, 0xff, 0xff, 0xd7, NULL }, - {0x11, 0xff, 0xff, 0xef, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x10, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x10, 0x01, 0x04, 0x04, "Off" }, -// {0x10, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x08, 0x08, "Off" }, - {0x10, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x10, 0x01, 0x10, 0x10, "Normal" }, - {0x10, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x20, 0x00, "Upright" }, - {0x10, 0x01, 0x20, 0x20, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Endless Game (Cheat)" }, - {0x10, 0x01, 0x40, 0x40, "Off" }, - {0x10, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x01, "2" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "First Bonus" }, - {0x11, 0x01, 0x04, 0x04, "30000" }, - {0x11, 0x01, 0x04, 0x00, "40000" }, - - {0 , 0xfe, 0 , 4, "Bonus Every" }, - {0x11, 0x01, 0x18, 0x18, "50000" }, - {0x11, 0x01, 0x18, 0x08, "70000" }, - {0x11, 0x01, 0x18, 0x10, "90000" }, - {0x11, 0x01, 0x18, 0x00, "None" }, -}; - -STDDIPINFO(Xxmissio) - -static void palette_update(INT32 entry) -{ - UINT8 i = (DrvPalRAM[entry] >> 0) & 0x03; - UINT8 r =((DrvPalRAM[entry] >> 0) & 0x0c) | i; - UINT8 g =((DrvPalRAM[entry] >> 2) & 0x0c) | i; - UINT8 b =((DrvPalRAM[entry] >> 4) & 0x0c) | i; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[entry] = BurnHighCol(r,g,b,0); -} - -static void __fastcall xxmission_main_write(UINT16 address, UINT8 data) -{ - if (address >= 0xd800 && address <= 0xdaff) { - DrvPalRAM[address & 0x3ff] = data; - palette_update(address & 0x3ff); - return; - } - - if ((address & 0xf800) == 0xc800) { - DrvBgRAM[(address & 0x7e0) | (((address & 0x1f) + scrollx_shifted) & 0x1f)] = data; - return; - } - - switch (address) - { - case 0x8000: - case 0x8001: - case 0x8002: - case 0x8003: - BurnYM2203Write((address/2)&1, address & 1, data); - return; - - case 0xa002: - { - switch (data) - { - case 0x00: cpu_status |= 0x20; break; - case 0x80: cpu_status |= 0x04; break; - - case 0x40: { - cpu_status &= ~0x08; - ZetClose(); - ZetOpen(1); - ZetSetVector(0x10); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(0); - } - break; - } - } - return; - - case 0xa003: - flipscreen = data & 0x01; - return; - } -} - -static void bankswitch(INT32 data) -{ - cpu_bank = (data & 0x07); - - ZetMapMemory(DrvZ80ROM1 + 0x10000 + (cpu_bank * 0x4000), 0x4000, 0x7fff, MAP_ROM); -} - -static void __fastcall xxmission_sub_write(UINT16 address, UINT8 data) -{ - if (address >= 0xd800 && address <= 0xdaff) { - DrvPalRAM[address & 0x3ff] = data; - palette_update(address & 0x3ff); - return; - } - - if ((address & 0xf800) == 0xc800) { - DrvBgRAM[(address & 0x7e0) | (((address & 0x1f) + scrollx_shifted) & 0x1f)] = data; - return; - } - - switch (address) - { - case 0x8000: - case 0x8001: - case 0x8002: - case 0x8003: - BurnYM2203Write((address/2)&1, address & 1, data); - return; - - case 0x8006: - bankswitch(data); - return; - - case 0xa002: - { - switch (data) - { - case 0x00: cpu_status |= 0x10; break; - case 0x40: cpu_status |= 0x08; break; - - case 0x80: { - cpu_status &= ~0x04; - ZetClose(); - ZetOpen(0); - ZetSetVector(0x10); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(1); - } - break; - } - } - return; - - case 0xa003: - flipscreen = data & 0x01; - return; - } -} - -static UINT8 __fastcall xxmission_read(UINT16 address) -{ - if ((address & 0xf800) == 0xc800) { - return DrvBgRAM[(address & 0x7e0) | (((address & 0x1f) + scrollx_shifted) & 0x1f)]; - } - - switch (address) - { - case 0x8000: - case 0x8001: - case 0x8002: - case 0x8003: - return BurnYM2203Read((address/2)&1, address & 1); - - case 0xa000: - case 0xa001: - return DrvInputs[address & 1]; - - case 0xa002: - return (cpu_status & 0xfd) | ((vblank) ? 0x00 : 0x02); // status! - } - - return 0; -} - -static UINT8 DrvYM2203ReadPortA(UINT32) -{ - return DrvDips[0]; -} - -static UINT8 DrvYM2203ReadPortB(UINT32) -{ - return DrvDips[1]; -} - -static void DrvYM2203WritePortA(UINT32, UINT32 data) -{ - scrollx = data; - scrollx_shifted = scrollx >> 3; -} - -static void DrvYM2203WritePortB(UINT32, UINT32 data) -{ - scrolly = data; -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 3000000); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - bankswitch(0); - BurnYM2203Reset(); - ZetClose(); - - scrollx = 0; - scrollx_shifted = 0; - scrolly = 0; - cpu_status = 0; - flipscreen = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x008000; - DrvZ80ROM1 = Next; Next += 0x028000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x040000; - DrvGfxROM2 = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - AllRam = Next; - - DrvBgRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x000300; - DrvShareRAM0 = Next; Next += 0x001000; - DrvShareRAM1 = Next; Next += 0x001000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Planes[4] = { STEP4(0,1) }; - INT32 XOffs[32] = { STEP16(0,4), STEP16((64*8),4) }; - INT32 YOffs[16] = { STEP8(0,64), STEP8((64*16), 64) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM1, 0x20000); - - GfxDecode(0x0100, 4, 16, 8, Planes, XOffs, YOffs, 0x200, tmp, DrvGfxROM0); - GfxDecode(0x0200, 4, 32, 16, Planes, XOffs, YOffs, 0x800, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x10000); - - GfxDecode(0x0400, 4, 16, 8, Planes, XOffs, YOffs, 0x200, tmp, DrvGfxROM2); - - BurnFree (tmp); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x10000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x18000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x20000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 10, 2)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvFgRAM, 0xc000, 0xc7ff, MAP_RAM); -// ZetMapMemory(DrvBgRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd800, 0xdaff, MAP_ROM); - ZetMapMemory(DrvShareRAM0, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvShareRAM1, 0xf000, 0xffff, MAP_RAM); - ZetSetWriteHandler(xxmission_main_write); - ZetSetReadHandler(xxmission_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvFgRAM, 0xc000, 0xc7ff, MAP_RAM); -// ZetMapMemory(DrvBgRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd000, 0xd7ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd800, 0xdaff, MAP_ROM); - ZetMapMemory(DrvShareRAM1, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvShareRAM0, 0xf000, 0xffff, MAP_RAM); - ZetSetWriteHandler(xxmission_sub_write); - ZetSetReadHandler(xxmission_read); - ZetClose(); - - BurnYM2203Init(2, 1500000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, &DrvYM2203ReadPortA, &DrvYM2203ReadPortB, NULL, NULL); - BurnYM2203SetPorts(1, NULL, NULL, &DrvYM2203WritePortA, &DrvYM2203WritePortB); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnYM2203Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_bg_layer() -{ - INT32 xscroll = scrollx * 2; - INT32 yscroll = (scrolly + 32) & 0xff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 16; - INT32 sy = (offs / 0x20) * 8; - - sx -= xscroll; - if (sx < -15) sx += 512; - sy -= yscroll; - if (sy < -7) sy += 256; - - INT32 code = DrvBgRAM[offs] + ((DrvBgRAM[0x400 + offs] & 0xc0) << 2); - INT32 color = DrvBgRAM[0x400 + offs] & 0x0f; - - RenderCustomTile_Clip(pTransDraw, 16, 8, code, sx, sy, color, 4, 0x200, DrvGfxROM2); - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = (2*32); offs < (32 * 32)-(2*32); offs++) - { - INT32 sx = (offs & 0x1f) * 16; - INT32 sy = ((offs / 0x20) * 8) - 32; - - INT32 code = DrvFgRAM[offs]; - INT32 color = DrvFgRAM[0x400 + offs] & 0x07; - - RenderCustomTile_Mask_Clip(pTransDraw, 16, 8, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM0); - } -} - -static inline void draw_single_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - if (flipy) { - if (flipx) { - RenderCustomTile_Mask_FlipXY_Clip(pTransDraw, 32, 16, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } else { - RenderCustomTile_Mask_FlipY_Clip(pTransDraw, 32, 16, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(pTransDraw, 32, 16, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } else { - RenderCustomTile_Mask_Clip(pTransDraw, 32, 16, code, sx, sy, color, 4, 0, 0, DrvGfxROM1); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x800; offs += 0x20) - { - INT32 attr = DrvSprRAM[offs + 3]; - INT32 sy = DrvSprRAM[offs + 2] - 32; - INT32 sx =((DrvSprRAM[offs + 1] << 1) - 8) & 0x1ff; - INT32 code = DrvSprRAM[offs + 0] | ((attr & 0x40) << 2); - INT32 color = attr & 0x07; - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - - if (sy < -15 || sy > 192) continue; - - draw_single_sprite(code, color, sx, sy, flipx, flipy); - - if (sx > 0x1e0) // wrap - draw_single_sprite(code, color, sx - 0x200, sy, flipx, flipy); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x300; i++) { - palette_update(i); - } - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - if ( nBurnLayer & 1) draw_bg_layer(); - if (nSpriteEnable & 1) draw_sprites(); - if ( nBurnLayer & 2) draw_fg_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = (nCyclesTotal[0] / nInterleave); - - ZetOpen(0); - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += ZetRun(nSegment); - - if (i == 235) { // not smoothe-scrolling in fs unless 235? -dink - vblank = 1; - cpu_status &= ~0x20; - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - ZetOpen(1); - BurnTimerUpdate((i + 1) * nCyclesTotal[1] / nInterleave); - if (i == ((nInterleave / 2) - 2) || i == (nInterleave - 2)) { // 120hz - cpu_status &= ~0x10; - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - } - - ZetOpen(1); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029709; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(flipscreen); - SCAN_VAR(cpu_status); - SCAN_VAR(cpu_bank); - SCAN_VAR(scrollx); - SCAN_VAR(scrollx_shifted); - SCAN_VAR(scrolly); - } - - if (nAction & ACB_WRITE) { - ZetOpen(1); - bankswitch(cpu_bank); - ZetClose(); - } - - return 0; -} - - -// XX Mission - -static struct BurnRomInfo xxmissioRomDesc[] = { - { "xx1.4l", 0x8000, 0x86e07709, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "xx2.4b", 0x4000, 0x13fa7049, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - { "xx3.6a", 0x8000, 0x16fdacab, 2 | BRF_PRG | BRF_ESS }, // 2 - { "xx4.6b", 0x8000, 0x274bd4d2, 2 | BRF_PRG | BRF_ESS }, // 3 - { "xx5.6d", 0x8000, 0xc5f35535, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "xx6.8j", 0x8000, 0xdc954d01, 3 | BRF_GRA }, // 5 Characters & Sprites - { "xx8.8f", 0x8000, 0xa9587cc6, 3 | BRF_GRA }, // 6 - { "xx7.8h", 0x8000, 0xabe9cd68, 3 | BRF_GRA }, // 7 - { "xx9.8e", 0x8000, 0x854e0e5f, 3 | BRF_GRA }, // 8 - - { "xx10.4c", 0x8000, 0xd27d7834, 4 | BRF_GRA }, // 9 Background Tiles - { "xx11.4b", 0x8000, 0xd9dd827c, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(xxmissio) -STD_ROM_FN(xxmissio) - -struct BurnDriver BurnDrvXxmissio = { - "xxmissio", NULL, NULL, NULL, "1986", - "XX Mission\0", NULL, "UPL", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, xxmissioRomInfo, xxmissioRomName, NULL, NULL, XxmissioInputInfo, XxmissioDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 192, 512, 3, 4 -}; diff --git a/jan/src/burn/drv/pre90s/d_zodiack.cpp b/jan/src/burn/drv/pre90s/d_zodiack.cpp deleted file mode 100644 index 94d30efe0..000000000 --- a/jan/src/burn/drv/pre90s/d_zodiack.cpp +++ /dev/null @@ -1,1174 +0,0 @@ -// Zodiack emu-layer for FB Alpha by dink, based on the MAME driver by Zsolt Vasvari. - -#include "tiles_generic.h" -#include "driver.h" -#include "z80_intf.h" -#include "bitswap.h" - -extern "C" { - #include "ay8910.h" -} -static INT16 *pAY8910Buffer[6]; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvVid2RAM; -static UINT8 *DrvAttrRAM; -static UINT8 *DrvBulletRAM; -static UINT8 *DrvExtraRAM; -static UINT8 *DrvSpriteRAM; -static UINT8 *DrvColorPROM; -static UINT8 *DrvCharGFX; -static UINT8 *DrvChar2GFX; -static UINT8 *DrvSpriteGFX; - -static INT32 DrvGfxROM0Len; - -static UINT8 *nmi_mask; -static UINT8 *sub_nmi_mask; -static UINT8 *soundlatch; - -static UINT8 moguchan = 0; -static UINT8 percuss_hardware = 0; -static UINT8 flipscreen = 0; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2] = { 0, 0 }; -static UINT8 DrvInput[5]; -static UINT8 DrvReset; - -static struct BurnInputInfo ZodiackInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 7, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 6, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Zodiack) - - -static struct BurnDIPInfo ZodiackDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "3" }, - {0x0e, 0x01, 0x03, 0x01, "4" }, - {0x0e, 0x01, 0x03, 0x02, "5" }, - {0x0e, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x1c, 0x14, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x1c, 0x18, "2 Coins/1 Credit 3 Coins/2 Credits" }, - {0x0e, 0x01, 0x1c, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x1c, 0x04, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x1c, 0x08, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x1c, 0x0c, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x1c, 0x10, "1 Coin 6 Credits" }, - {0x0e, 0x01, 0x1c, 0x1c, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x0e, 0x01, 0x20, 0x00, "20000 50000" }, - {0x0e, 0x01, 0x20, 0x20, "40000 70000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x40, 0x40, "Upright" }, - {0x0e, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0e, 0x01, 0x80, 0x00, "Off" }, - {0x0e, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Zodiack) - -static struct BurnInputInfo DogfightInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 7, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Dogfight) - - -static struct BurnDIPInfo DogfightDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x00, NULL }, - {0x0c, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x0b, 0x01, 0x07, 0x05, "2 Coins 1 Credits" }, - {0x0b, 0x01, 0x07, 0x06, "3 Coins 2 Credits" }, - {0x0b, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x0b, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x0b, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x0b, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - {0x0b, 0x01, 0x07, 0x07, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0b, 0x01, 0x38, 0x38, "5 Coins 1 Credits" }, - {0x0b, 0x01, 0x38, 0x30, "4 Coins 1 Credits" }, - {0x0b, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x0b, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x0b, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x0b, 0x01, 0x38, 0x18, "3 Coins 4 Credits" }, - {0x0b, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0b, 0x01, 0x40, 0x00, "Off" }, - {0x0b, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0b, 0x01, 0x80, 0x00, "Off" }, - {0x0b, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0c, 0x01, 0x03, 0x00, "3" }, - {0x0c, 0x01, 0x03, 0x01, "4" }, - {0x0c, 0x01, 0x03, 0x02, "5" }, - {0x0c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0c, 0x01, 0x04, 0x00, "Off" }, - {0x0c, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x0c, 0x01, 0x08, 0x00, "Off" }, - {0x0c, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x0c, 0x01, 0x10, 0x00, "Off" }, - {0x0c, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x0c, 0x01, 0x20, 0x00, "20000 50000" }, - {0x0c, 0x01, 0x20, 0x20, "40000 70000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0c, 0x01, 0x40, 0x40, "Upright" }, - {0x0c, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x0c, 0x01, 0x80, 0x00, "Off" }, - {0x0c, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Dogfight) - -static struct BurnInputInfo MoguchanInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 7, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 6, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Moguchan) - - -static struct BurnDIPInfo MoguchanDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0e, 0x01, 0x03, 0x00, "3" }, - {0x0e, 0x01, 0x03, 0x01, "4" }, - {0x0e, 0x01, 0x03, 0x02, "5" }, - {0x0e, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x1c, 0x14, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x1c, 0x18, "2 Coins/1 Credit 3 Coins/2 Credits" }, - {0x0e, 0x01, 0x1c, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x1c, 0x04, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x1c, 0x08, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x1c, 0x0c, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x1c, 0x10, "1 Coin 6 Credits" }, - {0x0e, 0x01, 0x1c, 0x1c, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x0e, 0x01, 0x20, 0x00, "20000 50000" }, - {0x0e, 0x01, 0x20, 0x20, "40000 70000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x40, 0x40, "Upright" }, - {0x0e, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x0e, 0x01, 0x80, 0x00, "Off" }, - {0x0e, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Moguchan) - -static struct BurnInputInfo PercussInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 7, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 2"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 6, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Percuss) - - -static struct BurnDIPInfo PercussDIPList[]= -{ - {0x10, 0xff, 0xff, 0x10, NULL }, - {0x11, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x01, 0x00, "Off" }, - {0x10, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x0c, 0x00, "20000 100000" }, - {0x10, 0x01, 0x0c, 0x04, "20000 200000" }, - {0x10, 0x01, 0x0c, 0x08, "40000 100000" }, - {0x10, 0x01, 0x0c, 0x0c, "40000 200000" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x10, 0x10, "Upright" }, - {0x10, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x20, 0x00, "Off" }, - {0x10, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x80, 0x00, "Off" }, - {0x10, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x00, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, - {0x11, 0x01, 0x03, 0x02, "6" }, - {0x11, 0x01, 0x03, 0x03, "7" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0c, 0x0c, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Percuss) - -static struct BurnInputInfo BountyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 7, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 2"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 6, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Bounty) - - -static struct BurnDIPInfo BountyDIPList[]= -{ - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x01, 0x00, "Off" }, - {0x10, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x08, 0x00, "Off" }, - {0x10, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x10, 0x00, "Off" }, - {0x10, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x20, 0x00, "Off" }, - {0x10, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x10, 0x01, 0x80, 0x00, "Off" }, - {0x10, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x00, "3" }, - {0x11, 0x01, 0x03, 0x01, "4" }, - {0x11, 0x01, 0x03, 0x02, "5" }, - {0x11, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0c, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0c, 0x0c, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x40, 0x40, "Upright" }, - {0x11, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Bounty) - -static void DrvPaletteInit() -{ - const UINT8 *color_prom = DrvColorPROM; - - INT32 pal[0x100]; - - for (INT32 i = 0; i < 0x30; i++) - { - INT32 bit0, bit1, bit2, r, g, b; - - /* red component */ - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* green component */ - bit0 = (color_prom[i] >> 3) & 0x01; - bit1 = (color_prom[i] >> 4) & 0x01; - bit2 = (color_prom[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* blue component */ - bit0 = 0; - bit1 = (color_prom[i] >> 6) & 0x01; - bit2 = (color_prom[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - pal[i] = BurnHighCol(r, g, b, 0); - } - - pal[0x30] = BurnHighCol(0xff, 0xff, 0xff, 0); // bullet - - for (INT32 i = 0; i < 0x20; i++) - DrvPalette[i] = pal[(i & 3) ? i : 0]; - - for (INT32 i = 0; i < 0x10; i += 2) - { - DrvPalette[0x20 + i] = pal[32 + (i / 2)]; - DrvPalette[0x21 + i] = pal[40 + (i / 2)]; - } - - /* bullet */ - DrvPalette[0x30] = pal[0]; - DrvPalette[0x31] = pal[0x30]; -} - -#define WB(a1,a2,dest) if (address >= a1 && address <= a2) { \ - dest[address - a1] = data; \ - return; \ - } -#define RB(a1,a2,dest) if (address >= a1 && address <= a2) \ - return dest[address - a1]; - -static void __fastcall main_write(UINT16 address, UINT8 data) -{ - WB(0x9000, 0x903f, DrvAttrRAM); - WB(0x9040, 0x905f, DrvSpriteRAM); - WB(0x9060, 0x907f, DrvBulletRAM); - WB(0x9080, 0x93ff, DrvExtraRAM); - - switch (address) - { - case 0x7100: *nmi_mask = (data & 1) ^ 1; return; - case 0x7200: flipscreen = data; return; - case 0x6090: { - *soundlatch = data & 0xff; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - ZetOpen(0); - return; - } - } -} - -static UINT8 __fastcall main_read(UINT16 address) -{ - RB(0x9000, 0x903f, DrvAttrRAM); - RB(0x9040, 0x905f, DrvSpriteRAM); - RB(0x9060, 0x907f, DrvBulletRAM); - RB(0x9080, 0x93ff, DrvExtraRAM); - - switch (address) - { - case 0x6081: return DrvDips[0] | (DrvInput[2] & 0x40); - case 0x6082: return DrvDips[1]; - case 0x6083: return DrvInput[0]; - case 0x6084: return DrvInput[1]; - case 0x6090: return *soundlatch; - } - - return 0; -} - -static void __fastcall audio_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x4000: { - *sub_nmi_mask = data & 1; - return; - } - case 0x6000: { - *soundlatch = data; - return; - } - } -} - -static UINT8 __fastcall audio_read(UINT16 address) -{ - switch (address) - { - case 0x6000: return *soundlatch; - } - - return 0; -} - -static void __fastcall audio_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - AY8910Write(0, port & 1, data); - return; - } - - return; -} - - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x10000; - DrvZ80ROM1 = Next; Next += 0x10000; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - DrvCharGFX = Next; Next += 0x40000; - DrvChar2GFX = Next; Next += 0x40000; - DrvSpriteGFX = Next; Next += 0x40000; - DrvColorPROM = Next; Next += 0x00400; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x01000; - DrvZ80RAM1 = Next; Next += 0x01000; - DrvAttrRAM = Next; Next += 0x00400; - DrvVidRAM = Next; Next += 0x00400; - DrvVid2RAM = Next; Next += 0x00400; - DrvBulletRAM = Next; Next += 0x00400; - DrvSpriteRAM = Next; Next += 0x00400; - DrvExtraRAM = Next; Next += 0x00400; - - nmi_mask = Next; Next += 0x00001; - sub_nmi_mask = Next; Next += 0x00001; - soundlatch = Next; Next += 0x00001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 GetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *Load0 = DrvZ80ROM; // 1 main - UINT8 *Load1 = DrvZ80ROM1; // 2 audio - UINT8 *Loadg0 = DrvCharGFX; // 3 gfx - UINT8 *Loadc = DrvColorPROM; // 4 prom - - DrvGfxROM0Len = 0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(Load0, i, 1)) return 1; - Load0 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(Load1, i, 1)) return 1; - Load1 += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(Loadg0, i, 1)) return 1; - Loadg0 += ri.nLen; - DrvGfxROM0Len += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(Loadc, i, 1)) return 1; - Loadc += ri.nLen; - - continue; - } - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 charPlane[2] = { 0, 512*8*8 }; - INT32 spritePlane[2] = { 0, 128*32*8 }; - - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return 1; - } - memset(tmp, 0, 0x20000); - memcpy(tmp, DrvCharGFX, 0x2800); - - GfxDecode(0x100, 1, 8, 8, charPlane, XOffs, YOffs, 0x40, tmp + 0x0000, DrvCharGFX); - GfxDecode(0x40, 2, 16, 16, spritePlane, XOffs, YOffs, 0x100, tmp + 0x0800, DrvSpriteGFX); - GfxDecode(0x100, 2, 8, 8, charPlane, XOffs, YOffs, 0x40, tmp + 0x1000, DrvChar2GFX); - - BurnFree (tmp); - - return 0; -} - - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (GetRoms()) return 1; - - DrvGfxDecode(); - - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x4fff, MAP_ROM); - ZetMapMemory(DrvZ80ROM + 0x5000,0xc000, 0xcfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x5800, 0x5fff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xa000, 0xa3ff, MAP_RAM); - ZetMapMemory(DrvVid2RAM, 0xb000, 0xb3ff, MAP_RAM); - ZetSetWriteHandler(main_write); - ZetSetReadHandler(main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x1fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x2000, 0x23ff, MAP_RAM); - ZetSetWriteHandler(audio_write); - ZetSetReadHandler(audio_read); - ZetSetOutHandler(audio_out); - ZetClose(); - - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree(AllMem); - percuss_hardware = 0; - moguchan = 0; - - return 0; -} - -static void draw_bg() -{ - UINT8 bits = 1; // fg 2bit, bg 1 bit - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - - sy -= 16; //offsets - if (sy < -7) sy += 256; - if (sx < -7) sx += 256; - - INT32 flipy = 0; - INT32 flipx = 0; - - INT32 code = DrvVid2RAM[offs]; - INT32 color = (DrvAttrRAM[(offs & 0x1f) << 1 | 1] >> 4) & 0x07; - - if (sx > nScreenWidth || sy > nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, bits, 8*4, DrvCharGFX); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, bits, 8*4, DrvCharGFX); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, bits, 8*4, DrvCharGFX); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, bits, 8*4, DrvCharGFX); - } - } - } -} - -static void draw_fg() -{ - UINT8 bits = 2; // fg 2bit, bg 1 bit - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= DrvAttrRAM[(sx >> 3) * 2]; // col scroll - sy -= 16; //offsets - if (sy < -7) sy += 256; - if (sx < -7) sx += 256; - - INT32 flipy = 0; - INT32 flipx = 0; - - INT32 code = DrvVidRAM[offs]; - INT32 color = (DrvAttrRAM[(offs & 0x1f) << 1 | 1] >> 0) & 0x07; - - if (sx > nScreenWidth || sy > nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, bits, 0, 0, DrvChar2GFX); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, bits, 0, 0, DrvChar2GFX); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, bits, 0, 0, DrvChar2GFX); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, bits, 0, 0, DrvChar2GFX); - } - } - } -} - -static void draw_bullets() -{ - for (INT32 offs = 0; offs < 0x20; offs += 4) - { - INT32 sx = DrvBulletRAM[offs + 3]; - INT32 sy = DrvBulletRAM[offs + 1]; - if (!sx && !sy) continue; - - if (moguchan) { - sy -= 16; - } else { - sy += 16; // everyone else - } - sx += 7; - - if (!(flipscreen && percuss_hardware)) - sy = 255 - sy; - if (!flipscreen && percuss_hardware) sx = 255 - sx; - - if (sx >= nScreenWidth || sx < 0 || sy >= nScreenHeight || sy < 0) continue; - - pTransDraw[(sy * nScreenWidth) + sx] = 0x31; - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x20-4; offs >= 0; offs -= 4) - { - INT32 sx = 240 - DrvSpriteRAM[offs + 3]; - INT32 sy = 240 - DrvSpriteRAM[offs]; - sy -= 16; //offsets - - INT32 code = DrvSpriteRAM[offs + 1] & 0x3f; - INT32 color = DrvSpriteRAM[offs + 2] & 0x07; - INT32 flipx = !(DrvSpriteRAM[offs + 1] & 0x40); - INT32 flipy = DrvSpriteRAM[offs + 1] & 0x80; - - if (!flipscreen && percuss_hardware) - { - sx = DrvSpriteRAM[offs + 3]; - flipx = !flipx; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvSpriteGFX); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvSpriteGFX); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvSpriteGFX); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, DrvSpriteGFX); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_bg(); - if (nBurnLayer & 2) draw_fg(); - if (nBurnLayer & 4) draw_bullets(); - if (nBurnLayer & 8) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void DrvMakeInputs() -{ - // Reset Inputs (all active HIGH) - DrvInput[0] = 0; - DrvInput[1] = 0; - DrvInput[2] = 0; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvJoy3[i] & 1) << i; - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - DrvMakeInputs(); - - INT32 nInterleave = 256; - INT32 nCyclesTotal = 3072000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - ZetOpen(0); - ZetRun(nCyclesTotal / nInterleave); - - if (i == 235 && *nmi_mask) - ZetNmi(); - - if (i == 0) - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - - ZetClose(); - - ZetOpen(1); - ZetRun(nCyclesTotal / nInterleave); - - if ((i % (nInterleave / 8) == (nInterleave / 8) - 1) && *sub_nmi_mask) - ZetNmi(); - - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029735; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - } - - return 0; -} - -// Zodiack - -static struct BurnRomInfo zodiackRomDesc[] = { - { "ovg30c.2", 0x2000, 0xa2125e99, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "ovg30c.3", 0x2000, 0xaee2b77f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ovg30c.6", 0x0800, 0x1debb278, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ovg20c.1", 0x1000, 0x2d3c3baf, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "ovg40c.7", 0x0800, 0xed9d3be7, 3 | BRF_GRA }, // 4 gfx1 - { "orca40c.8", 0x1000, 0x88269c94, 3 | BRF_GRA }, // 5 - { "orca40c.9", 0x1000, 0xa3bd40c9, 3 | BRF_GRA }, // 6 - - { "ovg40c.2a", 0x0020, 0x703821b8, 4 | BRF_GRA }, // 7 proms - { "ovg40c.2b", 0x0020, 0x21f77ec7, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(zodiack) -STD_ROM_FN(zodiack) - -struct BurnDriver BurnDrvZodiack = { - "zodiack", NULL, NULL, NULL, "1983", - "Zodiack\0", NULL, "Orca (Esco Trading Co., Inc. license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, zodiackRomInfo, zodiackRomName, NULL, NULL, ZodiackInputInfo, ZodiackDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 224, 256, 3, 4 -}; - - -// Dog Fight (Thunderbolt) - -static struct BurnRomInfo dogfightRomDesc[] = { - { "df-2.4f", 0x2000, 0xad24b28b, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "df-3.4h", 0x2000, 0xcd172707, 1 | BRF_PRG | BRF_ESS }, // 1 - { "df-5.4n", 0x1000, 0x874dc6bf, 1 | BRF_PRG | BRF_ESS }, // 2 - { "df-4.4m", 0x1000, 0xd8aa3d6d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "df-1.4n", 0x1000, 0xdcbb1c5b, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - - { "df-6.3s", 0x0800, 0x3059b515, 3 | BRF_GRA }, // 5 gfx1 - { "df-7.7n", 0x1000, 0xffe05fee, 3 | BRF_GRA }, // 6 - { "df-8.7r", 0x1000, 0x2cb51793, 3 | BRF_GRA }, // 7 - - { "mmi6331.2a", 0x0020, 0x69a35aa5, 4 | BRF_GRA }, // 8 proms - { "mmi6331.2b", 0x0020, 0x596ae457, 4 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(dogfight) -STD_ROM_FN(dogfight) - -struct BurnDriver BurnDrvDogfight = { - "dogfight", NULL, NULL, NULL, "1983", - "Dog Fight (Thunderbolt)\0", NULL, "Orca / Thunderbolt", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, dogfightRomInfo, dogfightRomName, NULL, NULL, DogfightInputInfo, DogfightDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 224, 256, 3, 4 -}; - -static INT32 moguchanInit() -{ - moguchan = 1; - percuss_hardware = 1; - - return DrvInit(); -} - -static INT32 percussInit() -{ - percuss_hardware = 1; - - return DrvInit(); -} - -// Mogu Chan (bootleg?) - -static struct BurnRomInfo moguchanRomDesc[] = { - { "2.5r", 0x1000, 0x85d0cb7e, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "4.5m", 0x1000, 0x359ef951, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.5np", 0x1000, 0xc8776f77, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "1.7hj", 0x1000, 0x1a88d35f, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - - { "5.4r", 0x0800, 0x1b7febd8, 3 | BRF_GRA }, // 4 gfx1 - { "6.7p", 0x1000, 0xc8060ffe, 3 | BRF_GRA }, // 5 - { "7.7m", 0x1000, 0xbfca00f4, 3 | BRF_GRA }, // 6 - - { "moguchan.2a", 0x0020, 0xe83daab3, 4 | BRF_GRA }, // 7 proms - { "moguchan.2b", 0x0020, 0x9abfdf40, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(moguchan) -STD_ROM_FN(moguchan) - -struct BurnDriver BurnDrvMoguchan = { - "moguchan", NULL, NULL, NULL, "1982", - "Mogu Chan (bootleg?)\0", NULL, "Orca (Eastern Commerce Inc. license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, moguchanRomInfo, moguchanRomName, NULL, NULL, MoguchanInputInfo, MoguchanDIPInfo, - moguchanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 224, 256, 3, 4 -}; - - -// The Percussor - -static struct BurnRomInfo percussRomDesc[] = { - { "percuss.1", 0x1000, 0xff0364f7, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "percuss.3", 0x1000, 0x7f646c59, 1 | BRF_PRG | BRF_ESS }, // 1 - { "percuss.2", 0x1000, 0x6bf72dd2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "percuss.4", 0x1000, 0xfb1b15ba, 1 | BRF_PRG | BRF_ESS }, // 3 - { "percuss.5", 0x1000, 0x8e5a9692, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "percuss.8", 0x0800, 0xd63f56f3, 2 | BRF_PRG | BRF_ESS }, // 5 audiocpu - { "percuss.9", 0x0800, 0xe08fef2f, 2 | BRF_PRG | BRF_ESS }, // 6 - - { "percuss.10", 0x0800, 0x797598aa, 3 | BRF_GRA }, // 7 gfx1 - { "percuss.6", 0x1000, 0x5285a580, 3 | BRF_GRA }, // 8 - { "percuss.7", 0x1000, 0x8fc4175d, 3 | BRF_GRA }, // 9 - - { "percus2a.prm", 0x0020, 0xe2ee9637, 4 | BRF_GRA }, // 10 proms - { "percus2b.prm", 0x0020, 0xe561b029, 4 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(percuss) -STD_ROM_FN(percuss) - -struct BurnDriver BurnDrvPercuss = { - "percuss", NULL, NULL, NULL, "1981", - "The Percussor\0", NULL, "Orca", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, percussRomInfo, percussRomName, NULL, NULL, PercussInputInfo, PercussDIPInfo, - percussInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 224, 256, 3, 4 -}; - - -// The Bounty - -static struct BurnRomInfo bountyRomDesc[] = { - { "1.4f", 0x1000, 0xf495b19d, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "3.4k", 0x1000, 0xfa3086c3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2.4h", 0x1000, 0x52ab5314, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.4m", 0x1000, 0x5c9d3f07, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "7.4n", 0x1000, 0x45e369b8, 2 | BRF_PRG | BRF_ESS }, // 4 audiocpu - { "8.4r", 0x1000, 0x4f52c87d, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "9.4r", 0x0800, 0x4b4acde5, 3 | BRF_GRA }, // 6 gfx1 - { "5.7m", 0x1000, 0xa5ce2a24, 3 | BRF_GRA }, // 7 - { "6.7p", 0x1000, 0x43183301, 3 | BRF_GRA }, // 8 - - { "mb7051.2a", 0x0020, 0x0de11a46, 4 | BRF_GRA }, // 9 proms - { "mb7051.2b", 0x0020, 0x465e31d4, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(bounty) -STD_ROM_FN(bounty) - -struct BurnDriver BurnDrvBounty = { - "bounty", NULL, NULL, NULL, "1982", - "The Bounty\0", NULL, "Orca", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, bountyRomInfo, bountyRomName, NULL, NULL, BountyInputInfo, BountyDIPInfo, - percussInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x40, - 256, 224, 4, 3 -}; - - diff --git a/jan/src/burn/drv/psikyo/d_psikyo.cpp b/jan/src/burn/drv/psikyo/d_psikyo.cpp deleted file mode 100644 index 2c27acaa0..000000000 --- a/jan/src/burn/drv/psikyo/d_psikyo.cpp +++ /dev/null @@ -1,2517 +0,0 @@ -// Psikyo MC68EC020 based hardware -// Based by MAME driver by Luca Elia,Olivier Galibert,Paul Priest -#include "psikyo.h" -#include "burn_ym2610.h" -#include "burn_ymf278b.h" - -INT32 PsikyoHardwareVersion; - -static UINT8 DrvJoy1[8] = {0, }; -static UINT8 DrvJoy2[8] = {0, }; -static UINT8 DrvInp1[8] = {0, }; -static UINT8 DrvInp2[8] = {0, }; -static UINT16 DrvInput[4] = {0, }; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Psikyo68KROM, *PsikyoZ80ROM; -static UINT8 *Psikyo68KRAM, *PsikyoZ80RAM; -static UINT8 *PsikyoSampleROM01, *PsikyoSampleROM02; - -static INT32 PsikyoSampleROM01Size, PsikyoSampleROM02Size; -static INT32 PsikyoTileROMSize, PsikyoSpriteROMSize; - -static UINT8 DrvReset = 0; -static UINT16 bVBlank; - -static INT32 nPsikyoZ80Bank; - -static INT32 nSoundlatch, nSoundlatchAck; - -static INT32 nCyclesDone[2]; -static INT32 nCyclesTotal[2]; -static INT32 nCyclesSegment; -static INT32 nCycles68KSync; - -static INT32 nPrevBurnCPUSpeedAdjust; - -static INT32 (*CheckSleep)(INT32); - -// ---------------------------------------------------------------------------- -// Input definitions - -static struct BurnInputInfo gunbirdInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInp1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvInp1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Test", BIT_DIGITAL, DrvInp1 + 5, "diag"}, - {"Service", BIT_DIGITAL, DrvInp1 + 4, "service"}, -// {"Tilt", BIT_DIGITAL, DrvInp1 + 6, "tilt"}, - - {"Dip 1", BIT_DIPSWITCH, ((UINT8*)(DrvInput + 2)) + 1, "dip"}, - {"Dip 2", BIT_DIPSWITCH, ((UINT8*)(DrvInput + 2)) + 0, "dip"}, - {"Dip 3", BIT_DIPSWITCH, ((UINT8*)(DrvInput + 3)) + 0, "dip"}, -}; - -STDINPUTINFO(gunbird) - -static struct BurnInputInfo btlkroadInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInp1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right"}, - {"P1 Weak punch", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1"}, - {"P1 Medium punch", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2"}, - {"P1 Strong punch", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3"}, - {"P1 Weak kick", BIT_DIGITAL, DrvInp2 + 7, "p1 fire 4"}, - {"P1 Medium kick", BIT_DIGITAL, DrvInp2 + 6, "p1 fire 5"}, - {"P1 Strong kick", BIT_DIGITAL, DrvInp2 + 5, "p1 fire 6"}, - - {"P2 Coin", BIT_DIGITAL, DrvInp1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right"}, - {"P2 Weak punch", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1"}, - {"P2 Medium punch", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2"}, - {"P2 Strong punch", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3"}, - {"P2 Weak kick", BIT_DIGITAL, DrvInp2 + 3, "p2 fire 4"}, - {"P2 Medium kick", BIT_DIGITAL, DrvInp2 + 2, "p2 fire 5"}, - {"P2 Strong kick", BIT_DIGITAL, DrvInp2 + 1, "p2 fire 6"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Test", BIT_DIGITAL, DrvInp1 + 5, "diag"}, - {"Service", BIT_DIGITAL, DrvInp1 + 4, "service"}, -// {"Tilt", BIT_DIGITAL, DrvInp1 + 6, "tilt"}, - - {"Dip 1", BIT_DIPSWITCH, ((UINT8*)(DrvInput + 2)) + 1, "dip"}, - {"Dip 2", BIT_DIPSWITCH, ((UINT8*)(DrvInput + 2)) + 0, "dip"}, - {"Region", BIT_DIPSWITCH, ((UINT8*)(DrvInput + 3)) + 0, "dip"}, - {"Debug Dip", BIT_DIPSWITCH, ((UINT8*)(DrvInput + 3)) + 1, "dip"}, -}; - -STDINPUTINFO(btlkroad) - -static struct BurnDIPInfo samuraiaDIPList[] = { - // Defaults - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x02, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Coin slot"}, - {0x15, 0x82, 0x01, 0x00, "Same"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x01, 0x01, "Individual"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0, 0xFE, 0, 9, "Coin 1"}, - {0x15, 0x01, 0x0E, 0x00, "1 coin = 1 credit"}, - {0x15, 0x01, 0x0E, 0x02, "2 coins = 1 credit"}, - {0x15, 0x01, 0x0E, 0x04, "3 coins = 1 credit"}, - {0x15, 0x01, 0x0E, 0x08, "1 coin = 2 credits"}, - {0x15, 0x01, 0x0E, 0x06, "1 coin = 3 credits"}, - {0x15, 0x01, 0x0E, 0x0A, "1 coin = 4 credits"}, - {0x15, 0x01, 0x0E, 0x0C, "1 coin = 5 credits"}, - {0x15, 0x82, 0x0E, 0x0E, "1 coin = 6 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x01, 0xFF, 0xFF, "Free play"}, - {0, 0xFE, 0, 9, "Coin 2"}, - {0x15, 0x82, 0x70, 0x00, "1 coin = 1 credit"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x10, "2 coins = 1 credit"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x20, "3 coins = 1 credit"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x40, "1 coin = 2 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x30, "1 coin = 3 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x50, "1 coin = 4 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x60, "1 coin = 5 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x70, "1 coin = 6 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0xFF, 0xFF, "Free play"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0, 0xFE, 0, 2, "Continue coin"}, - {0x15, 0x82, 0x80, 0x00, "Normal mode"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x80, 0x80, "Continue mode"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - // DIP 2 - {0, 0xFE, 0, 2, "Screen reverse"}, - {0x16, 0x01, 0x01, 0x00, "Invert"}, - {0x16, 0x01, 0x01, 0x01, "Normal"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x16, 0x01, 0x02, 0x00, "Off"}, - {0x16, 0x01, 0x02, 0x02, "On"}, - {0, 0xFE, 0, 4, "Difficulty"}, - {0x16, 0x01, 0x0C, 0x00, "Normal"}, - {0x16, 0x01, 0x0C, 0x04, "Easy"}, - {0x16, 0x01, 0x0C, 0x08, "Hard"}, - {0x16, 0x01, 0x0C, 0x0C, "Super hard"}, - {0, 0xFE, 0, 4, "Fighters"}, - {0x16, 0x01, 0x30, 0x00, "3"}, - {0x16, 0x01, 0x30, 0x10, "1"}, - {0x16, 0x01, 0x30, 0x20, "2"}, - {0x16, 0x01, 0x30, 0x30, "4"}, - {0, 0xFE, 0, 2, "Extend player"}, - {0x16, 0x01, 0x40, 0x00, "Every 400,000 points"}, - {0x16, 0x01, 0x40, 0x40, "Every 600,000 points"}, - {0, 0xFE, 0, 2, "Test mode"}, - {0x16, 0x01, 0x80, 0x00, "Off"}, - {0x16, 0x01, 0x80, 0x80, "On"}, -}; - -static struct BurnDIPInfo gunbirdDIPList[] = { - // Defaults - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x02, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Coin slot"}, - {0x15, 0x82, 0x01, 0x00, "Same"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x01, 0x01, "Individual"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0, 0xFE, 0, 9, "Coin 1"}, - {0x15, 0x01, 0x0E, 0x00, "1 coin = 1 credit"}, - {0x15, 0x01, 0x0E, 0x02, "2 coins = 1 credit"}, - {0x15, 0x01, 0x0E, 0x04, "3 coins = 1 credit"}, - {0x15, 0x01, 0x0E, 0x08, "1 coin = 2 credits"}, - {0x15, 0x01, 0x0E, 0x06, "1 coin = 3 credits"}, - {0x15, 0x01, 0x0E, 0x0A, "1 coin = 4 credits"}, - {0x15, 0x01, 0x0E, 0x0C, "1 coin = 5 credits"}, - {0x15, 0x82, 0x0E, 0x0E, "1 coin = 6 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x01, 0xFF, 0xFF, "Free play"}, - {0, 0xFE, 0, 9, "Coin 2"}, - {0x15, 0x82, 0x70, 0x00, "1 coin = 1 credit"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x10, "2 coins = 1 credit"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x20, "3 coins = 1 credit"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x40, "1 coin = 2 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x30, "1 coin = 3 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x50, "1 coin = 4 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x60, "1 coin = 5 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x70, "1 coin = 6 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0xFF, 0xFF, "Free play"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0, 0xFE, 0, 2, "Continue coin"}, - {0x15, 0x82, 0x80, 0x00, "Normal mode"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x80, 0x80, "Continue mode"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - // DIP 2 - {0, 0xFE, 0, 2, "Screen"}, - {0x16, 0x01, 0x01, 0x00, "Normal"}, - {0x16, 0x01, 0x01, 0x01, "Reverse"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x16, 0x01, 0x02, 0x00, "Off"}, - {0x16, 0x01, 0x02, 0x02, "On"}, - {0, 0xFE, 0, 4, "Difficulty"}, - {0x16, 0x01, 0x0C, 0x00, "Normal"}, - {0x16, 0x01, 0x0C, 0x04, "Easy"}, - {0x16, 0x01, 0x0C, 0x08, "Difficult"}, - {0x16, 0x01, 0x0C, 0x0C, "More Difficult"}, - {0, 0xFE, 0, 4, "Number of fighters"}, - {0x16, 0x01, 0x30, 0x00, "3"}, - {0x16, 0x01, 0x30, 0x10, "1"}, - {0x16, 0x01, 0x30, 0x20, "2"}, - {0x16, 0x01, 0x30, 0x30, "4"}, - {0, 0xFE, 0, 2, "Extend fighters"}, - {0x16, 0x01, 0x40, 0x00, "Every 400,000 points"}, - {0x16, 0x01, 0x40, 0x40, "Every 600,000 points"}, - {0, 0xFE, 0, 2, "Test mode"}, - {0x16, 0x01, 0x80, 0x00, "Off"}, - {0x16, 0x01, 0x80, 0x80, "On"}, -}; - -static struct BurnDIPInfo btlkroadDIPList[] = { - // Defaults - {0x1B, 0xFF, 0xFF, 0x00, NULL}, - {0x1C, 0xFF, 0xFF, 0x02, NULL}, - {0x1D, 0xFF, 0xFF, 0x0F, NULL}, - {0x1E, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Coin slot"}, - {0x1B, 0x82, 0x01, 0x00, "Same"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0x01, 0x01, "Individual"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0, 0xFE, 0, 9, "Coin 1"}, - {0x1B, 0x01, 0x0E, 0x00, "1 coin = 1 credit"}, - {0x1B, 0x01, 0x0E, 0x02, "2 coins = 1 credit"}, - {0x1B, 0x01, 0x0E, 0x04, "3 coins = 1 credit"}, - {0x1B, 0x01, 0x0E, 0x08, "1 coin = 2 credits"}, - {0x1B, 0x01, 0x0E, 0x06, "1 coin = 3 credits"}, - {0x1B, 0x01, 0x0E, 0x0A, "1 coin = 4 credits"}, - {0x1B, 0x01, 0x0E, 0x0C, "1 coin = 5 credits"}, - {0x1B, 0x82, 0x0E, 0x0E, "1 coin = 6 credits"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x01, 0xFF, 0xFF, "Free play"}, - {0, 0xFE, 0, 9, "Coin 2"}, - {0x1B, 0x82, 0x70, 0x00, "1 coin = 1 credit"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0x70, 0x10, "2 coins = 1 credit"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0x70, 0x20, "3 coins = 1 credit"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0x70, 0x40, "1 coin = 2 credits"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0x70, 0x30, "1 coin = 3 credits"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0x70, 0x50, "1 coin = 4 credits"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0x70, 0x60, "1 coin = 5 credits"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0x70, 0x70, "1 coin = 6 credits"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0xFF, 0xFF, "Free play"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0, 0xFE, 0, 2, "Continue coin"}, - {0x1B, 0x82, 0x80, 0x00, "Normal mode"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - {0x1B, 0x82, 0x80, 0x80, "Continue mode"}, - {0x1B, 0x00, 0xFF, 0xFF, NULL}, - // DIP 2 - {0, 0xFE, 0, 2, NULL}, - {0x1C, 0x01, 0x01, 0x00, "Normal screen"}, - {0x1C, 0x01, 0x01, 0x01, "Invert screen"}, - {0, 0xFE, 0, 2, "Demo sounds"}, - {0x1C, 0x01, 0x02, 0x00, "Disabled"}, - {0x1C, 0x01, 0x02, 0x02, "Enabled"}, - {0, 0xFE, 0, 4, "Difficulty"}, - {0x1C, 0x01, 0x0C, 0x00, "Normal"}, - {0x1C, 0x01, 0x0C, 0x04, "Easy"}, - {0x1C, 0x01, 0x0C, 0x08, "Hard"}, - {0x1C, 0x01, 0x0C, 0x0C, "Hardest"}, - {0, 0xFE, 0, 2, "Enable debug dip"}, - {0x1C, 0x01, 0x40, 0x00, "Off"}, - {0x1C, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Test mode"}, - {0x1C, 0x01, 0x80, 0x00, "Off"}, - {0x1C, 0x01, 0x80, 0x80, "On"}, - - // Region - {0, 0xFE, 0, 6, "Region"}, - {0x1D, 0x01, 0xFF, 0x00, "Japan"}, - {0x1D, 0x01, 0xFF, 0x01, "USA / Canada (Jaleco license)"}, - {0x1D, 0x01, 0xFF, 0x03, "Korea"}, - {0x1D, 0x01, 0xFF, 0x05, "Hong Kong"}, - {0x1D, 0x01, 0xFF, 0x09, "Taiwan"}, - {0x1D, 0x01, 0xFF, 0x0F, "World"}, - - // Debug Dip - {0, 0xFE, 0, 2, "Debug test menu"}, - {0x1E, 0x82, 0x80, 0x00, "Off"}, - {0x1C, 0x00, 0x40, 0x00, NULL}, - {0x1E, 0x82, 0x80, 0x80, "On"}, - {0x1C, 0x00, 0x40, 0x00, NULL}, -}; - -static struct BurnDIPInfo s1945DIPList[] = { - // Defaults - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x02, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Coin slot"}, - {0x15, 0x01, 0x01, 0x00, "Same"}, - {0x15, 0x01, 0x01, 0x01, "Individual"}, - {0, 0xFE, 0, 8, "Coin 1"}, - {0x15, 0x01, 0x0E, 0x00, "1 coin = 1 credit"}, - {0x15, 0x01, 0x0E, 0x02, "2 coins = 1 credit"}, - {0x15, 0x01, 0x0E, 0x04, "3 coins = 1 credit"}, - {0x15, 0x01, 0x0E, 0x08, "1 coin = 2 credits"}, - {0x15, 0x01, 0x0E, 0x06, "1 coin = 3 credits"}, - {0x15, 0x01, 0x0E, 0x0A, "1 coin = 4 credits"}, - {0x15, 0x01, 0x0E, 0x0C, "1 coin = 5 credits"}, - {0x15, 0x82, 0x0E, 0x0E, "1 coin = 6 credits"}, - {0, 0xFE, 0, 8, "Coin 2"}, - {0x15, 0x01, 0x70, 0x00, "1 coin = 1 credit"}, - {0x15, 0x01, 0x70, 0x10, "2 coins = 1 credit"}, - {0x15, 0x01, 0x70, 0x20, "3 coins = 1 credit"}, - {0x15, 0x01, 0x70, 0x40, "1 coin = 2 credits"}, - {0x15, 0x01, 0x70, 0x30, "1 coin = 3 credits"}, - {0x15, 0x01, 0x70, 0x50, "1 coin = 4 credits"}, - {0x15, 0x01, 0x70, 0x60, "1 coin = 5 credits"}, - {0x15, 0x01, 0x70, 0x70, "1 coin = 6 credits"}, - {0, 0xFE, 0, 2, "Continue coin"}, - {0x15, 0x01, 0x80, 0x00, "Normal mode"}, - {0x15, 0x01, 0x80, 0x80, "Continue mode"}, - // DIP 2 - {0, 0xFE, 0, 2, "Screen"}, - {0x16, 0x01, 0x01, 0x00, "Normal"}, - {0x16, 0x01, 0x01, 0x01, "Reverse"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x16, 0x01, 0x02, 0x00, "Off"}, - {0x16, 0x01, 0x02, 0x02, "On"}, - {0, 0xFE, 0, 4, "Difficulty"}, - {0x16, 0x01, 0x0C, 0x00, "Normal"}, - {0x16, 0x01, 0x0C, 0x04, "Easy"}, - {0x16, 0x01, 0x0C, 0x08, "Difficult"}, - {0x16, 0x01, 0x0C, 0x0C, "More Difficult"}, - {0, 0xFE, 0, 4, "Number of fighters"}, - {0x16, 0x01, 0x30, 0x00, "3"}, - {0x16, 0x01, 0x30, 0x10, "1"}, - {0x16, 0x01, 0x30, 0x20, "2"}, - {0x16, 0x01, 0x30, 0x30, "4"}, - {0, 0xFE, 0, 2, "Extend fighters"}, - {0x16, 0x01, 0x40, 0x00, "Every 600,000 points"}, - {0x16, 0x01, 0x40, 0x40, "Every 800,000 points"}, - {0, 0xFE, 0, 2, "Test mode"}, - {0x16, 0x01, 0x80, 0x00, "Off"}, - {0x16, 0x01, 0x80, 0x80, "On"}, -}; - -static struct BurnDIPInfo tengaiDIPList[] = { - // Defaults - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x02, NULL}, - {0x17, 0xFF, 0xFF, 0x0F, NULL}, - - {0, 0xFE, 0, 2, "Coin slot"}, - {0x15, 0x82, 0x01, 0x00, "Same"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x01, 0x01, "Individual"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0, 0xFE, 0, 9, "Coin 1"}, - {0x15, 0x01, 0x0E, 0x00, "1 coin = 1 credit"}, - {0x15, 0x01, 0x0E, 0x02, "2 coins = 1 credit"}, - {0x15, 0x01, 0x0E, 0x04, "3 coins = 1 credit"}, - {0x15, 0x01, 0x0E, 0x08, "1 coin = 2 credits"}, - {0x15, 0x01, 0x0E, 0x06, "1 coin = 3 credits"}, - {0x15, 0x01, 0x0E, 0x0A, "1 coin = 4 credits"}, - {0x15, 0x01, 0x0E, 0x0C, "1 coin = 5 credits"}, - {0x15, 0x82, 0x0E, 0x0E, "1 coin = 6 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x01, 0xFF, 0xFF, "Free play"}, - {0, 0xFE, 0, 9, "Coin 2"}, - {0x15, 0x82, 0x70, 0x00, "1 coin = 1 credit"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x10, "2 coins = 1 credit"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x20, "3 coins = 1 credit"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x40, "1 coin = 2 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x30, "1 coin = 3 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x50, "1 coin = 4 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x60, "1 coin = 5 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x70, 0x70, "1 coin = 6 credits"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0xFF, 0xFF, "Free play"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0, 0xFE, 0, 2, "Continue coin"}, - {0x15, 0x82, 0x80, 0x00, "Normal mode"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - {0x15, 0x82, 0x80, 0x80, "Continue mode"}, - {0x15, 0x00, 0xFF, 0xFF, NULL}, - // DIP 2 - {0, 0xFE, 0, 2, NULL}, - {0x16, 0x01, 0x01, 0x00, "Normal screen"}, - {0x16, 0x01, 0x01, 0x01, "Invert screen"}, - {0, 0xFE, 0, 2, "Demo sounds"}, - {0x16, 0x01, 0x02, 0x00, "Disabled"}, - {0x16, 0x01, 0x02, 0x02, "Enabled"}, - {0, 0xFE, 0, 4, "Difficulty"}, - {0x16, 0x01, 0x0C, 0x00, "Normal"}, - {0x16, 0x01, 0x0C, 0x04, "Easy"}, - {0x16, 0x01, 0x0C, 0x08, "Hard"}, - {0x16, 0x01, 0x0C, 0x0C, "Hardest"}, - {0, 0xFE, 0, 4, "Lives"}, - {0x16, 0x01, 0x30, 0x00, "3"}, - {0x16, 0x01, 0x30, 0x10, "1"}, - {0x16, 0x01, 0x30, 0x20, "2"}, - {0x16, 0x01, 0x30, 0x30, "4"}, - {0, 0xFE, 0, 2, "Bonus life"}, - {0x16, 0x01, 0x40, 0x00, "600K"}, - {0x16, 0x01, 0x40, 0x40, "800K"}, -}; - -static struct BurnDIPInfo NoRegionDIPList[] = { - // Defaults - {0x17, 0xFF, 0xFF, 0x00, NULL}, -}; - -static struct BurnDIPInfo samuraiaRegionDIPList[] = { - // Defaults - {0x17, 0xFF, 0xFF, 0x00, NULL}, - - // Region - {0, 0xFE, 0, 5, "Region"}, - {0x17, 0x01, 0xFF, 0x00, "World"}, - {0x17, 0x01, 0xFF, 0x10, "USA / Canada"}, - {0x17, 0x01, 0xFF, 0x20, "Korea"}, - {0x17, 0x01, 0xFF, 0x40, "Hong Kong"}, - {0x17, 0x01, 0xFF, 0x80, "Taiwan"}, -}; - -static struct BurnDIPInfo gunbirdRegionDIPList[] = { - // Defaults - {0x17, 0xFF, 0xFF, 0x00, NULL}, - - // Region - {0, 0xFE, 0, 5, "Region"}, - {0x17, 0x01, 0xFF, 0x00, "World"}, - {0x17, 0x01, 0xFF, 0x01, "USA / Canada"}, - {0x17, 0x01, 0xFF, 0x02, "Korea"}, - {0x17, 0x01, 0xFF, 0x04, "Hong Kong"}, - {0x17, 0x01, 0xFF, 0x08, "Taiwan"}, -}; - -static struct BurnDIPInfo s1945aRegionDIPList[] = { - // Defaults - {0x17, 0xFF, 0xFF, 0x01, NULL}, - - // Region - {0, 0xFE, 0, 2, "Region"}, - {0x17, 0x01, 0xFF, 0x00, "Japan"}, - {0x17, 0x01, 0xFF, 0x01, "World"}, -}; - -static struct BurnDIPInfo tengaiRegionDIPList[] = { - // Defaults - {0x17, 0xFF, 0xFF, 0x00, NULL}, - - // Region - {0, 0xFE, 0, 5, "Region"}, - {0x17, 0x01, 0xFF, 0x01, "U.S.A. & Canada"}, - {0x17, 0x01, 0xFF, 0x02, "Korea"}, - {0x17, 0x01, 0xFF, 0x04, "Hong Kong"}, - {0x17, 0x01, 0xFF, 0x08, "Taiwan"}, - {0x17, 0x01, 0xFF, 0x00, "World"}, -}; - -static struct BurnDIPInfo tengaijRegionDIPList[] = { - // Defaults - {0x17, 0xFF, 0xFF, 0x00, NULL}, - - // Region - {0, 0xFE, 0, 2, "Region"}, - {0x17, 0x01, 0xFF, 0x00, "Japan"}, - {0x17, 0x01, 0xFF, 0x0F, "World"}, -}; - -STDDIPINFOEXT(samuraia, samuraia, samuraiaRegion) -STDDIPINFOEXT(sngkace, samuraia, NoRegion) - -STDDIPINFO(btlkroad) - -STDDIPINFOEXT(gunbirdWorld, gunbird, gunbirdRegion) -STDDIPINFOEXT(gunbird, gunbird, NoRegion) - -STDDIPINFOEXT(s1945World, s1945, gunbirdRegion) -STDDIPINFOEXT(s1945, s1945, NoRegion) -STDDIPINFOEXT(s1945a, s1945, s1945aRegion) - -//STDDIPINFO(tengai) -STDDIPINFOEXT(tengai, tengai, tengaiRegion) -STDDIPINFOEXT(tengaij, tengai, tengaijRegion) - -// ---------------------------------------------------------------------------- -// Z80 banswitch - -static void samuraiaZ80SetBank(INT32 nBank) -{ - nBank &= 0x03; - if (nBank != nPsikyoZ80Bank) { - UINT8* nStartAddress = PsikyoZ80ROM + (nBank << 15); - ZetMapArea(0x8000, 0xFFFF, 0, nStartAddress); - ZetMapArea(0x8000, 0xFFFF, 2, nStartAddress); - - nPsikyoZ80Bank = nBank; - } - - return; -} - -static void gunbirdZ80SetBank(INT32 nBank) -{ - nBank &= 0x03; - if (nBank != nPsikyoZ80Bank) { - UINT8* nStartAddress = PsikyoZ80ROM + 0x00200 + (nBank << 15); - ZetMapArea(0x8200, 0xFFFF, 0, nStartAddress); - ZetMapArea(0x8200, 0xFFFF, 2, nStartAddress); - - nPsikyoZ80Bank = nBank; - } - - return; -} - -// ---------------------------------------------------------------------------- -// CPU synchronisation - -static inline void PsikyoSynchroniseZ80(INT32 nExtraCycles) -{ - INT32 nCycles = ((INT64)SekTotalCycles() * nCyclesTotal[1] / nCyclesTotal[0]) + nExtraCycles; - - if (nCycles <= ZetTotalCycles()) { - return; - } - - nCycles68KSync = nCycles - nExtraCycles; - - BurnTimerUpdate(nCycles); -} - -// Callbacks for the FM chip - -static void PsikyoFMIRQHandler(INT32, INT32 nStatus) -{ -// bprintf(PRINT_NORMAL, _T(" - IRQ -> %i.\n"), nStatus); - - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 PsikyoSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double PsikyoGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -// ---------------------------------------------------------------------------- -// Z80 I/O handlers - -UINT8 __fastcall samuraiaZ80In(UINT16 nAddress) -{ - switch (nAddress & 0xFF) { - case 0x00: - return BurnYM2610Read(0); - case 0x02: - return BurnYM2610Read(2); - case 0x08: // Read sound command -// bprintf(PRINT_NORMAL, _T(" - Sound command received (0x%02X).\n"), nSoundlatch); - return nSoundlatch; - -// default: { -// bprintf(PRINT_NORMAL, _T(" - Z80 read port 0x%04X.\n"), nAddress); -// } - } - - return 0; -} - -void __fastcall samuraiaZ80Out(UINT16 nAddress, UINT8 nValue) -{ - switch (nAddress & 0x0FF) { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - BurnYM2610Write(nAddress & 3, nValue); - break; - - case 0x04: - samuraiaZ80SetBank(nValue); - break; - - case 0x0C: // Write reply to sound commands -// bprintf(PRINT_NORMAL, _T(" - Sound reply sent (0x%02X).\n"), nValue); - - nSoundlatchAck = 1; - - break; - -// default: { -// bprintf(PRINT_NORMAL, _T(" - Z80 port 0x%04X -> 0x%02X.\n"), nAddress, nValue); -// } - } -} - -UINT8 __fastcall gunbirdZ80In(UINT16 nAddress) -{ - switch (nAddress & 0xFF) { - case 0x04: -// bprintf(PRINT_NORMAL, _T(" read 0 %6i\n"), ZetTotalCycles()); - return BurnYM2610Read(0); - case 0x06: -// bprintf(PRINT_NORMAL, _T(" read 2 %6i\n"), ZetTotalCycles()); - return BurnYM2610Read(2); - case 0x08: // Read sound command -// bprintf(PRINT_NORMAL, _T(" - Sound command received (0x%02X).\n"), nSoundlatch); - return nSoundlatch; - -// default: { -// bprintf(PRINT_NORMAL, _T(" - Z80 read port 0x%04X.\n"), nAddress); -// } - } - - return 0; -} - -void __fastcall gunbirdZ80Out(UINT16 nAddress, UINT8 nValue) -{ - switch (nAddress & 0x0FF) { - case 0x00: - gunbirdZ80SetBank(nValue >> 4); - break; - case 0x04: - case 0x05: - case 0x06: - case 0x07: { - BurnYM2610Write(nAddress & 3, nValue); - break; - } - case 0x0C: // Write reply to sound commands -// bprintf(PRINT_NORMAL, _T(" - Sound reply sent (0x%02X).\n"), nValue); - - nSoundlatchAck = 1; - - break; - -// default: { -// bprintf(PRINT_NORMAL, _T(" - Z80 port 0x%04X -> 0x%02X.\n"), nAddress, nValue); -// } - } -} - -UINT8 __fastcall tengaiZ80In(UINT16 nAddress) -{ - switch (nAddress & 0xFF) { - case 0x08: -// bprintf(PRINT_NORMAL, _T(" read 0 %6i\n"), ZetTotalCycles()); - return BurnYMF278BReadStatus(); - case 0x10: // Read sound command -// bprintf(PRINT_NORMAL, _T(" - Sound command received (0x%02X).\n"), nSoundlatch); - return nSoundlatch; - -// default: { -// bprintf(PRINT_NORMAL, _T(" - Z80 read port 0x%04X.\n"), nAddress); -// } - } - - return 0; -} - -void __fastcall tengaiZ80Out(UINT16 nAddress, UINT8 nValue) -{ - switch (nAddress & 0x0FF) { - case 0x00: - gunbirdZ80SetBank(nValue >> 4); - break; - case 0x08: - case 0x0A: - case 0x0C: { - BurnYMF278BSelectRegister((nAddress >> 1) & 3, nValue); - break; - } - case 0x09: - case 0x0B: - case 0x0D: { - BurnYMF278BWriteRegister((nAddress >> 1) & 3, nValue); - break; - } - case 0x18: // Write reply to sound commands -// bprintf(PRINT_NORMAL, _T(" - Sound reply sent (0x%02X).\n"), nValue); - - nSoundlatchAck = 1; - - break; - -// default: { -// bprintf(PRINT_NORMAL, _T(" - Z80 port 0x%04X -> 0x%02X.\n"), nAddress, nValue); -// } - } -} - -// ---------------------------------------------------------------------------- -// 68K memory handlers - -static inline void SendSoundCommand(const INT8 nCommand) -{ -// bprintf(PRINT_NORMAL, _T(" - Sound command sent (0x%02X).\n"), nCommand); - - PsikyoSynchroniseZ80(0); - - nSoundlatch = nCommand; - nSoundlatchAck = 0; - - ZetNmi(); -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall samuraiaReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xC00000: // Joysticks - return ~DrvInput[0] >> 8; - case 0xC00001: - return ~DrvInput[0] & 0xFF; - case 0xC00004: // DIPs - return ~DrvInput[2] >> 8; - case 0xC00005: - return ~DrvInput[2] & 0xFF; - case 0xC00006: // Region - return ~DrvInput[3] >> 8; - case 0xC00007: - return ~DrvInput[3] & 0xFF; - case 0xC00008: { // Inputs / Sound CPU status - return ~DrvInput[1] >> 8; - case 0xC80009: -// bprintf(PRINT_NORMAL, _T(" - Sound reply read.\n")); - PsikyoSynchroniseZ80(0); - if (!nSoundlatchAck) { - return ~DrvInput[1] & 0xFF; - } - return ~(DrvInput[1] | 0x80) & 0xFF; - } - case 0xC0000B: // VBlank - return ~bVBlank; - -// default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); -// } - } - return 0; -} - -UINT16 __fastcall samuraiaReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xC00000: // Joysticks - return ~DrvInput[0]; - case 0xC00004: // DIPs - return ~DrvInput[2]; - case 0xC00006: // - return ~DrvInput[3]; - case 0xC00008: { // Inputs / Sound CPU status -// bprintf(PRINT_NORMAL, _T(" - Sound reply read.\n")); - PsikyoSynchroniseZ80(0); - if (!nSoundlatchAck) { - return ~DrvInput[1]; - } - return ~(DrvInput[1] | 0x80); - } - case 0xC0000A: // VBlank - return ~bVBlank; - - -// default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); -// } - } - return 0; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall gunbirdReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xC00000: // Joysticks - return ~DrvInput[0] >> 8; - case 0xC00001: - return ~DrvInput[0] & 0xFF; - case 0xC00002: // Inputs / Sound CPU status - return ~DrvInput[1] >> 8; - case 0xC00003: -// bprintf(PRINT_NORMAL, _T(" - Sound reply read.\n")); - PsikyoSynchroniseZ80(0); - if (!nSoundlatchAck) { - return ~DrvInput[1] & 0xFF; - } - return ~(DrvInput[1] | 0x80) & 0xFF; - case 0xC00004: // DIPs - return ~DrvInput[2] >> 8; - case 0xC00005: - return ~DrvInput[2] & 0xFF; - case 0xC00006: // Region / VBlank - return ~DrvInput[3] >> 8; - case 0xC00007: - return ~(DrvInput[3] | (bVBlank << 7)) & 0xFF; - -// default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); -// } - } - return 0; -} - -UINT16 __fastcall gunbirdReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xC00000: // Joysticks - return ~DrvInput[0]; - case 0xC00002: { // Inputs / Sound CPU status -// bprintf(PRINT_NORMAL, _T(" - Sound reply read.\n")); - PsikyoSynchroniseZ80(0); - if (!nSoundlatchAck) { - return ~DrvInput[1]; - } - return ~(DrvInput[1] | 0x80); - } - case 0xC00004: // DIPs - return ~DrvInput[2]; - case 0xC00006: // Region / VBlank - return ~(DrvInput[3] | (bVBlank << 7)); - -// default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); -// } - } - return 0; -} - -void __fastcall gunbirdWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0xC00011: // Sound latch - SendSoundCommand(byteValue); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall gunbirdWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0xC00012: // Sound latch - SendSoundCommand(wordValue & 0xFF); - break; - -// default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); -// } - } -} - -// ---------------------------------------------------------------------------- - -static UINT8 s1945_table[256] = { - 0x00, 0x00, 0x64, 0xae, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc, - 0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc5, 0x1e, - 0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xac, 0x5c, 0x00, 0x00, 0x2b, 0xc0 -}; - -static UINT8 s1945j_table[256] = { - 0x00, 0x00, 0x64, 0xb6, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc, - 0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc5, 0x92, - 0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xac, 0x64, 0x00, 0x00, 0x2b, 0xc0 -}; - -static UINT8 s1945a_table[256] = { - 0x00, 0x00, 0x64, 0xbe, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc, - 0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc7, 0x2a, - 0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xad, 0x4c, 0x00, 0x00, 0x2b, 0xc0 -}; - -static UINT8 s1945_mcu_direction, s1945_mcu_latch1, s1945_mcu_latch2, s1945_mcu_inlatch, s1945_mcu_index; -static UINT8 s1945_mcu_latching, s1945_mcu_mode, s1945_mcu_control, s1945_mcu_bctrl; -static const UINT8 *s1945_mcu_table; - -static INT32 TengaiMCUScan(INT32 nAction, INT32 *pnMin) -{ - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020998; - } - - SCAN_VAR(s1945_mcu_direction); - SCAN_VAR(s1945_mcu_latch1); - SCAN_VAR(s1945_mcu_latch2); - SCAN_VAR(s1945_mcu_inlatch); - SCAN_VAR(s1945_mcu_index); - SCAN_VAR(s1945_mcu_latching); - SCAN_VAR(s1945_mcu_mode); - SCAN_VAR(s1945_mcu_control); - SCAN_VAR(s1945_mcu_bctrl); - - if (nAction & ACB_WRITE) { - PsikyoSetTileBank(1, (s1945_mcu_bctrl >> 6) & 3); - PsikyoSetTileBank(0, (s1945_mcu_bctrl >> 4) & 3); - } - - return 0; -} - -static void TengaiMCUInit(const UINT8 *mcu_table) -{ - s1945_mcu_direction = 0x00; - s1945_mcu_inlatch = 0xff; - s1945_mcu_latch1 = 0xff; - s1945_mcu_latch2 = 0xff; - s1945_mcu_latching = 0x5; - s1945_mcu_control = 0xff; - s1945_mcu_index = 0; - s1945_mcu_mode = 0; - s1945_mcu_table = mcu_table; - s1945_mcu_bctrl = 0x00; -} - -void tengaiMCUWrite(UINT32 offset, UINT8 data) -{ - switch (offset) { - case 0x06: - s1945_mcu_inlatch = data; - break; - case 0x07: - PsikyoSetTileBank(1, (data >> 6) & 3); - PsikyoSetTileBank(0, (data >> 4) & 3); - s1945_mcu_bctrl = data; - break; - case 0x08: - s1945_mcu_control = data; - break; - case 0x09: - s1945_mcu_direction = data; - break; - case 0x0b: - switch (data | (s1945_mcu_direction ? 0x100 : 0)) { - case 0x11c: - s1945_mcu_latching = 5; - s1945_mcu_index = s1945_mcu_inlatch; - break; - case 0x013: -// logerror("MCU: Table read index %02x\n", s1945_mcu_index); - s1945_mcu_latching = 1; - s1945_mcu_latch1 = s1945_mcu_table[s1945_mcu_index]; - break; - case 0x113: - s1945_mcu_mode = s1945_mcu_inlatch; - if(s1945_mcu_mode == 1) { - s1945_mcu_latching &= ~1; - s1945_mcu_latch2 = 0x55; - } else { - // Go figure. - s1945_mcu_latching &= ~1; - s1945_mcu_latching |= 2; - } - s1945_mcu_latching &= ~4; - s1945_mcu_latch1 = s1945_mcu_inlatch; - break; - case 0x010: - case 0x110: - s1945_mcu_latching |= 4; - break; - default: -// logerror("MCU: function %02x, direction %02x, latch1 %02x, latch2 %02x (%x)\n", data, s1945_mcu_direction, s1945_mcu_latch1, s1945_mcu_latch2, activecpu_get_pc()); - break; - } - break; -// default: -// logerror("MCU.w %x, %02x (%x)\n", offset, data, activecpu_get_pc()); - } -} - -UINT16 tengaiMCURead(UINT32 offset) -{ - switch (offset) { - case 0: { - UINT16 res; - if (s1945_mcu_control & 16) { - res = (s1945_mcu_latching & 4) ? 0xff00 : s1945_mcu_latch1 << 8; - s1945_mcu_latching |= 4; - } else { - res = (s1945_mcu_latching & 1) ? 0xff00 : s1945_mcu_latch2 << 8; - s1945_mcu_latching |= 1; - } - res |= s1945_mcu_bctrl & 0x00f0; - return res; - } - case 1: - return (s1945_mcu_latching << 8) | 0x0800; - } - - return 0; -} - -UINT8 __fastcall tengaiReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xC00000: // Joysticks - return ~DrvInput[0] >> 8; - case 0xC00001: - return ~DrvInput[0] & 0xFF; - case 0xC00002: // Inputs / Sound CPU status - return ~DrvInput[1] >> 8; - case 0xC00003: -// bprintf(PRINT_NORMAL, _T(" - Sound reply read.\n")); - PsikyoSynchroniseZ80(0); - if (!nSoundlatchAck) { - return ~(DrvInput[1] | 0x04) & 0xFF; - } - return ~(DrvInput[1] | 0x84) & 0xFF; - case 0xC00004: // DIPs - return ~DrvInput[2] >> 8; - case 0xC00005: - return ~DrvInput[2] & 0xFF; - case 0xC00006: // Region / MCU - return tengaiMCURead(0) >> 8; - case 0xC00007: - return ((~DrvInput[3] & 0x0F) | tengaiMCURead(0)) & 0xFF; - case 0xC00008: // MCU - return tengaiMCURead(1) >> 8; - case 0xC00009: - return tengaiMCURead(1) & 0xFF; - -// default: { -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); -// } - } - return 0; -} - -UINT16 __fastcall tengaiReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xC00000: // Joysticks - return ~DrvInput[0]; - case 0xC00002: { // Inputs / Sound CPU status -// bprintf(PRINT_NORMAL, _T(" - Sound reply read.\n")); - PsikyoSynchroniseZ80(0); - if (!nSoundlatchAck) { - return ~(DrvInput[1] | 0x04); - } - return ~(DrvInput[1] | 0x84); - } - case 0xC00004: // DIPs - return ~DrvInput[2]; - case 0xC00006: // Region / MCU - return (~DrvInput[3] & 0x0F) | tengaiMCURead(0); - case 0xC00008: // MCU - return tengaiMCURead(1); - -// default: { -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); -// } - } - return 0; -} - -void __fastcall tengaiWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0xC00004: - case 0xC00005: - case 0xC00006: - case 0xC00007: - case 0xC00008: - case 0xC00009: - case 0xC0000A: - case 0xC0000B: - tengaiMCUWrite(sekAddress & 0x0F, byteValue); - break; - - case 0xC00011: // Sound latch - SendSoundCommand(byteValue); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall tengaiWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0xC00004: - case 0xC00005: - case 0xC00006: - case 0xC00007: - case 0xC00008: - case 0xC00009: - case 0xC0000A: - case 0xC0000B: - tengaiMCUWrite((sekAddress & 0x0F), wordValue >> 8); - tengaiMCUWrite((sekAddress & 0x0F) + 1, wordValue & 0xFF); - break; - - case 0xC00010: // Sound latch - SendSoundCommand(wordValue & 0xFF); - break; - -// default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); -// } - } -} - -// ---------------------------------------------------------------------------- - -void __fastcall PsikyoWriteBytePalette(UINT32 sekAddress, UINT8 byteValue) -{ - PsikyoPalWriteByte(sekAddress & 0x1FFF, byteValue); -} - -void __fastcall PsikyoWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - PsikyoPalWriteWord(sekAddress & 0x1FFF, wordValue); -} - -// ---------------------------------------------------------------------------- - -static INT32 DrvExit() -{ - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: - case PSIKYO_HW_GUNBIRD: { - BurnYM2610Exit(); - break; - } - case PSIKYO_HW_S1945: - case PSIKYO_HW_TENGAI: { - BurnYMF278BExit(); - break; - } - } - - PsikyoSpriteExit(); - PsikyoTileExit(); - PsikyoPalExit(); - - SekExit(); - ZetExit(); - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - { - SekOpen(0); - SekReset(); - SekClose(); - } - - { - ZetOpen(0); - - nPsikyoZ80Bank = -1; - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: { - samuraiaZ80SetBank(0); - break; - } - case PSIKYO_HW_GUNBIRD: - case PSIKYO_HW_S1945: - case PSIKYO_HW_TENGAI: { - gunbirdZ80SetBank(0); - break; - } - } - - ZetReset(); - - ZetClose(); - } - - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: - case PSIKYO_HW_GUNBIRD: { - BurnYM2610Reset(); - break; - } - case PSIKYO_HW_S1945: - case PSIKYO_HW_TENGAI: { - BurnYMF278BReset(); - break; - } - } - - nSoundlatch = 0; - nSoundlatchAck = 1; - - nCyclesDone[0] = nCyclesDone[1] = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - PsikyoPalUpdate(); - PsikyoTileRender(); - - return 0; -} - -static INT32 samuraiaCheckSleep(INT32) -{ - return 0; -} - -static INT32 gunbirdCheckSleep(INT32) -{ - return 0; -} - -static INT32 gunbirdjCheckSleep(INT32) -{ - return 0; -} - -static INT32 gunbirdkCheckSleep(INT32) -{ - return 0; -} - -static INT32 s1945jnCheckSleep(INT32) -{ - return 0; -} - -static INT32 psikyoCheckSleep(INT32) -{ -// bprintf(PRINT_NORMAL, "0x%06X\n", SekGetPC(-1)); - - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nCyclesVBlank; - INT32 nInterleave = 16; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x0000; // Joysticks - DrvInput[1] = 0x0000; - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << (i + 8); - DrvInput[0] |= (DrvJoy2[i] & 1) << (i + 0); - - DrvInput[1] |= (DrvInp1[i] & 1) << (i + 0); - DrvInput[1] |= (DrvInp2[i] & 1) << (i + 8); - } - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - - if (nPrevBurnCPUSpeedAdjust != nBurnCPUSpeedAdjust) { - // 68K CPU clock is 16MHz, modified by nBurnCPUSpeedAdjust - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (INT32)(256.0 * 15625.0 / 263.5)); - // Z80 CPU clock is always 4MHz - nCyclesTotal[1] = (INT32)(4000000.0 / (15625.0 / 263.5)); - - // 68K cycles executed each scanline - SekSetCyclesScanline((INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (256 * 15625))); - - nPrevBurnCPUSpeedAdjust = nBurnCPUSpeedAdjust; - } - - nCyclesVBlank = nCyclesTotal[0] * (INT32)(224.0 * 2.0) / (INT32)(263.5 * 2.0); - bVBlank = 0x01; - - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - for (INT32 i = 1; i <= nInterleave; i++) { - - // Run 68000 - INT32 nNext = i * nCyclesTotal[0] / nInterleave; - - // See if we need to trigger the VBlank interrupt - if (bVBlank && nNext >= nCyclesVBlank) { - if (nCyclesDone[0] < nCyclesVBlank) { - nCyclesSegment = nCyclesVBlank - nCyclesDone[0]; - if (!CheckSleep(0)) { // See if this CPU is busywaiting - nCyclesDone[0] += SekRun(nCyclesSegment); - } else { - nCyclesDone[0] += SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - PsikyoSpriteBuffer(); - - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - bVBlank = 0x00; - } - - nCyclesSegment = nNext - nCyclesDone[0]; - if (!CheckSleep(0)) { // See if this CPU is busywaiting - nCyclesDone[0] += SekRun(nCyclesSegment); - } else { - nCyclesDone[0] += SekIdle(nCyclesSegment); - } - } - - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: - case PSIKYO_HW_GUNBIRD: { - nCycles68KSync = SekTotalCycles(); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - break; - } - case PSIKYO_HW_S1945: - case PSIKYO_HW_TENGAI: { - nCycles68KSync = SekTotalCycles(); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYMF278BUpdate(nBurnSoundLen); - break; - } - default: { - ZetIdle(nCyclesTotal[1] - ZetTotalCycles()); - } - } - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesDone[1] = ZetTotalCycles() - nCyclesTotal[1]; - - ZetClose(); - SekClose(); - - return 0; -} - -// ---------------------------------------------------------------------------- -// Loading - -static void Nibbleswap(UINT8* pData, INT32 nLen) -{ - for (INT32 i = nLen -2 ; i >= 0; i -= 2) { - UINT16 c = ((pData[i + 0] >> 4) | (pData[i + 0] << 8)) & 0x0F0F; - ((UINT16*)pData)[i + 0] = BURN_ENDIAN_SWAP_INT16(((pData[i + 1] >> 4) | (pData[i + 1] << 8))) & 0x0F0F; - ((UINT16*)pData)[i + 1] = BURN_ENDIAN_SWAP_INT16(c); - } - - return; -} - -static INT32 samuraiaLoadRoms() -{ - // Load 68000 ROM - UINT8* pTemp = (UINT8*)BurnMalloc(0x080000); - if (pTemp == NULL) { - return 1; - } - - BurnLoadRom(pTemp + 0x000000, 0, 1); - BurnLoadRom(pTemp + 0x040000, 1, 1); - - for (INT32 i = 0; i < 0x020000; i++) { - ((UINT16*)Psikyo68KROM)[2 * i + 0] = ((UINT16*)pTemp)[0x000000 + i]; - ((UINT16*)Psikyo68KROM)[2 * i + 1] = ((UINT16*)pTemp)[0x020000 + i]; - } - - BurnFree(pTemp); - - BurnLoadRom(PsikyoSpriteROM + 0x000000, 2, 1); - Nibbleswap(PsikyoSpriteROM, 0x200000); - - BurnLoadRom(PsikyoSpriteLUT, 3, 1); - - BurnLoadRom(PsikyoTileROM + 0x000000, 4, 1); - BurnLoadRom(PsikyoTileROM + 0x100000, 5, 1); - Nibbleswap(PsikyoTileROM, 0x200000); - - BurnLoadRom(PsikyoZ80ROM, 6, 1); - - BurnLoadRom(PsikyoSampleROM02, 7, 1); - - for (INT32 i = 0; i < 0x100000; i++) { - PsikyoSampleROM02[i] = ((PsikyoSampleROM02[i] & 0x80) >> 1) | ((PsikyoSampleROM02[i] & 0x40) << 1) | (PsikyoSampleROM02[i] & 0x3F); - } - - return 0; -} - -static INT32 gunbirdLoadRoms() -{ - // Load 68000 ROM - UINT8* pTemp = (UINT8*)BurnMalloc(0x100000); - if (pTemp == NULL) { - return 1; - } - - BurnLoadRom(pTemp + 0x000000, 0, 1); - BurnLoadRom(pTemp + 0x080000, 1, 1); - - for (INT32 i = 0; i < 0x040000; i++) { - ((UINT16*)Psikyo68KROM)[2 * i + 0] = ((UINT16*)pTemp)[0x000000 + i]; - ((UINT16*)Psikyo68KROM)[2 * i + 1] = ((UINT16*)pTemp)[0x040000 + i]; - } - - BurnFree(pTemp); - - BurnLoadRom(PsikyoSpriteROM + 0x000000, 2, 1); - BurnLoadRom(PsikyoSpriteROM + 0x200000, 3, 1); - BurnLoadRom(PsikyoSpriteROM + 0x400000, 4, 1); - if (PsikyoSpriteROMSize > 0x0C00000) { - BurnLoadRom(PsikyoSpriteROM + 0x600000, 5, 1); - } - Nibbleswap(PsikyoSpriteROM, PsikyoSpriteROMSize >> 1); - - BurnLoadRom(PsikyoSpriteLUT, 6, 1); - - BurnLoadRom(PsikyoTileROM, 7, 1); - Nibbleswap(PsikyoTileROM, 0x200000); - - BurnLoadRom(PsikyoZ80ROM, 8, 1); - - BurnLoadRom(PsikyoSampleROM01, 9, 1); - BurnLoadRom(PsikyoSampleROM02, 10, 1); - - return 0; -} - -static INT32 s1945LoadRoms() -{ - // Load 68000 ROM - UINT8* pTemp = (UINT8*)BurnMalloc(0x100000); - if (pTemp == NULL) { - return 1; - } - - BurnLoadRom(pTemp + 0x000000, 0, 1); - BurnLoadRom(pTemp + 0x080000, 1, 1); - - for (INT32 i = 0; i < 0x040000; i++) { - ((UINT16*)Psikyo68KROM)[2 * i + 0] = ((UINT16*)pTemp)[0x000000 + i]; - ((UINT16*)Psikyo68KROM)[2 * i + 1] = ((UINT16*)pTemp)[0x040000 + i]; - } - - BurnFree(pTemp); - - BurnLoadRom(PsikyoSpriteROM + 0x000000, 2, 1); - BurnLoadRom(PsikyoSpriteROM + 0x200000, 3, 1); - BurnLoadRom(PsikyoSpriteROM + 0x400000, 4, 1); - BurnLoadRom(PsikyoSpriteROM + 0x600000, 5, 1); - Nibbleswap(PsikyoSpriteROM, 0x800000); - - BurnLoadRom(PsikyoSpriteLUT, 6, 1); - - BurnLoadRom(PsikyoTileROM, 7, 1); - Nibbleswap(PsikyoTileROM, 0x200000); - - BurnLoadRom(PsikyoZ80ROM, 8, 1); - - BurnLoadRom(PsikyoSampleROM02, 9, 1); - - return 0; -} - -static void tengaiNibbleswap(UINT8* pData, INT32 nLen) -{ - for (INT32 i = nLen - 1; i >= 0; i--) { - ((UINT16*)pData)[i] = BURN_ENDIAN_SWAP_INT16(((pData[i] >> 4) | (pData[i] << 8))) & 0x0F0F; - } - - return; -} - -static INT32 tengaiLoadRoms() -{ - // Load 68000 ROM - UINT8* pTemp = (UINT8*)BurnMalloc(0x100000); - if (pTemp == NULL) { - return 1; - } - - BurnLoadRom(pTemp + 0x000000, 0, 1); - BurnLoadRom(pTemp + 0x080000, 1, 1); - - for (INT32 i = 0; i < 0x040000; i++) { - ((UINT16*)Psikyo68KROM)[2 * i + 0] = ((UINT16*)pTemp)[0x000000 + i]; - ((UINT16*)Psikyo68KROM)[2 * i + 1] = ((UINT16*)pTemp)[0x040000 + i]; - } - - BurnFree(pTemp); - - BurnLoadRom(PsikyoSpriteROM + 0x000000, 2, 1); - BurnLoadRom(PsikyoSpriteROM + 0x200000, 3, 1); - BurnLoadRom(PsikyoSpriteROM + 0x400000, 4, 1); - tengaiNibbleswap(PsikyoSpriteROM, 0x600000); - - BurnLoadRom(PsikyoSpriteLUT, 5, 1); - - BurnLoadRom(PsikyoTileROM, 6, 1); - tengaiNibbleswap(PsikyoTileROM, 0x400000); - - BurnLoadRom(PsikyoZ80ROM, 7, 1); - - BurnLoadRom(PsikyoSampleROM02 + 0x000000, 8, 1); - BurnLoadRom(PsikyoSampleROM02 + 0x200000, 9, 1); - - return 0; -} - -// ---------------------------------------------------------------------------- - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers - -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - - Psikyo68KROM = Next; Next += 0x100000; // 68K program - PsikyoZ80ROM = Next; Next += 0x020000; // Z80 program - PsikyoSpriteROM = Next; Next += PsikyoSpriteROMSize; - PsikyoSpriteLUT = Next; Next += 0x040000; - PsikyoTileROM = Next; Next += PsikyoTileROMSize; - PsikyoSampleROM01 = Next; Next += PsikyoSampleROM01Size; - PsikyoSampleROM02 = Next; Next += PsikyoSampleROM02Size; - RamStart = Next; - Psikyo68KRAM = Next; Next += 0x020000; // 68K work RAM - if (PsikyoHardwareVersion == PSIKYO_HW_SAMURAIA) { - PsikyoZ80RAM = Next; Next += 0x000800; // Z80 work RAM - } else { - PsikyoZ80RAM = Next; Next += 0x000200; // Z80 work RAM - } - PsikyoTileRAM[0] = Next; Next += 0x002000; // Tile layer 0 - PsikyoTileRAM[1] = Next; Next += 0x002000; // Tile layer 1 - PsikyoTileRAM[2] = Next; Next += 0x004000; // Tile attribute RAM - PsikyoSpriteRAM = Next; Next += 0x002000; - PsikyoPalSrc = Next; Next += 0x002000; // palette - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - BurnSetRefreshRate(15625.0 / 263.5); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "samuraia") || !strcmp(BurnDrvGetTextA(DRV_NAME), "sngkace") || !strcmp(BurnDrvGetTextA(DRV_NAME), "sngkacea")) { - PsikyoHardwareVersion = PSIKYO_HW_SAMURAIA; - - CheckSleep = samuraiaCheckSleep; - - PsikyoTileROMSize = 0x0400000; - PsikyoSpriteROMSize = 0x0400000; - - PsikyoSampleROM01Size = 0; - PsikyoSampleROM02Size = 0x100000; - - bPsikyoClearBackground = false; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gunbird") || !strcmp(BurnDrvGetTextA(DRV_NAME), "gunbirdj") || !strcmp(BurnDrvGetTextA(DRV_NAME), "gunbirdk") || !strcmp(BurnDrvGetTextA(DRV_NAME), "btlkroad") || !strcmp(BurnDrvGetTextA(DRV_NAME), "btlkroadk") || !strcmp(BurnDrvGetTextA(DRV_NAME), "s1945jn")) { - PsikyoHardwareVersion = PSIKYO_HW_GUNBIRD; - - CheckSleep = psikyoCheckSleep; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gunbird")) { - CheckSleep = gunbirdCheckSleep; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gunbirdj")) { - CheckSleep = gunbirdjCheckSleep; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gunbirdk")) { - CheckSleep = gunbirdkCheckSleep; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "s1945jn")) { - CheckSleep = s1945jnCheckSleep; - } - - PsikyoTileROMSize = 0x0400000; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "btlkroad") || !strcmp(BurnDrvGetTextA(DRV_NAME), "btlkroadk")) { - PsikyoSpriteROMSize = 0x0C00000; - } else { - PsikyoSpriteROMSize = 0x1000000; - } - - PsikyoSampleROM01Size = 0x080000; - PsikyoSampleROM02Size = 0x100000; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "s1945jn")) { - bPsikyoClearBackground = false; - } else { - bPsikyoClearBackground = true; - } - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "s1945") || !strcmp(BurnDrvGetTextA(DRV_NAME), "s1945j") || !strcmp(BurnDrvGetTextA(DRV_NAME), "s1945k") || !strcmp(BurnDrvGetTextA(DRV_NAME), "s1945a")) { - PsikyoHardwareVersion = PSIKYO_HW_S1945; - - CheckSleep = psikyoCheckSleep; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "s1945j")) TengaiMCUInit(s1945j_table); - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "s1945") || !strcmp(BurnDrvGetTextA(DRV_NAME), "s1945k")) TengaiMCUInit(s1945_table); - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "s1945a")) TengaiMCUInit(s1945a_table); - - PsikyoTileROMSize = 0x0400000; - PsikyoSpriteROMSize = 0x1000000; - - PsikyoSampleROM01Size = 0; - PsikyoSampleROM02Size = 0x200000; - - bPsikyoClearBackground = false; - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "tengai") || !strcmp(BurnDrvGetTextA(DRV_NAME), "tengaij")) { - PsikyoHardwareVersion = PSIKYO_HW_TENGAI; - - CheckSleep = psikyoCheckSleep; - - TengaiMCUInit(s1945_table); - - PsikyoTileROMSize = 0x0800000; - PsikyoSpriteROMSize = 0x0C00000; - - PsikyoSampleROM01Size = 0; - PsikyoSampleROM02Size = 0x400000; - - bPsikyoClearBackground = false; - } - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: { - if (samuraiaLoadRoms()) { - return 1; - } - break; - } - case PSIKYO_HW_GUNBIRD: { - if (gunbirdLoadRoms()) { - return 1; - } - break; - } - case PSIKYO_HW_S1945: { - if (s1945LoadRoms()) { - return 1; - } - break; - } - case PSIKYO_HW_TENGAI: { - if (tengaiLoadRoms()) { - return 1; - } - break; - } - } - - { - // 68EC020 setup - SekInit(0, 0x68EC020); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Psikyo68KROM, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(PsikyoSpriteRAM, 0x400000, 0x401FFF, MAP_RAM); - SekMapMemory(PsikyoTileRAM[0], 0x800000, 0x801FFF, MAP_RAM); - SekMapMemory(PsikyoTileRAM[1], 0x802000, 0x803FFF, MAP_RAM); - SekMapMemory(PsikyoTileRAM[2], 0x804000, 0x807FFF, MAP_RAM); - SekMapMemory(Psikyo68KRAM, 0xFE0000, 0xFFFFFF, MAP_RAM); - - SekMapMemory(PsikyoPalSrc, 0x600000, 0x601FFF, MAP_ROM); // Palette RAM (write goes through handler) - SekMapHandler(1, 0x600000, 0x601FFF, MAP_WRITE); // - - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: { - SekSetReadWordHandler(0, samuraiaReadWord); - SekSetReadByteHandler(0, samuraiaReadByte); - SekSetWriteWordHandler(0, gunbirdWriteWord); - SekSetWriteByteHandler(0, gunbirdWriteByte); - break; - } - case PSIKYO_HW_GUNBIRD: { - SekSetReadWordHandler(0, gunbirdReadWord); - SekSetReadByteHandler(0, gunbirdReadByte); - SekSetWriteWordHandler(0, gunbirdWriteWord); - SekSetWriteByteHandler(0, gunbirdWriteByte); - break; - } - case PSIKYO_HW_S1945: - case PSIKYO_HW_TENGAI: { - SekSetReadWordHandler(0, tengaiReadWord); - SekSetReadByteHandler(0, tengaiReadByte); - SekSetWriteWordHandler(0, tengaiWriteWord); - SekSetWriteByteHandler(0, tengaiWriteByte); - break; - } - } - - SekSetWriteWordHandler(1, PsikyoWriteWordPalette); - SekSetWriteByteHandler(1, PsikyoWriteBytePalette); - - SekClose(); - } - - { - // Z80 setup - ZetInit(0); - ZetOpen(0); - - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: { - // fixed ROM - ZetMapArea(0x0000, 0x77FF, 0, PsikyoZ80ROM); - ZetMapArea(0x0000, 0x77FF, 2, PsikyoZ80ROM); - // Work RAM - ZetMapArea(0x7800, 0x7FFF, 0, PsikyoZ80RAM); - ZetMapArea(0x7800, 0x7FFF, 1, PsikyoZ80RAM); - ZetMapArea(0x7800, 0x7FFF, 2, PsikyoZ80RAM); - - - ZetSetInHandler(samuraiaZ80In); - ZetSetOutHandler(samuraiaZ80Out); - break; - } - case PSIKYO_HW_GUNBIRD: { - // fixed ROM - ZetMapArea(0x0000, 0x7FFF, 0, PsikyoZ80ROM); - ZetMapArea(0x0000, 0x7FFF, 2, PsikyoZ80ROM); - // Work RAM - ZetMapArea(0x8000, 0x81FF, 0, PsikyoZ80RAM); - ZetMapArea(0x8000, 0x81FF, 1, PsikyoZ80RAM); - ZetMapArea(0x8000, 0x81FF, 2, PsikyoZ80RAM); - - - ZetSetInHandler(gunbirdZ80In); - ZetSetOutHandler(gunbirdZ80Out); - break; - } - case PSIKYO_HW_S1945: - case PSIKYO_HW_TENGAI: { - // fixed ROM - ZetMapArea(0x0000, 0x7FFF, 0, PsikyoZ80ROM); - ZetMapArea(0x0000, 0x7FFF, 2, PsikyoZ80ROM); - // Work RAM - ZetMapArea(0x8000, 0x81FF, 0, PsikyoZ80RAM); - ZetMapArea(0x8000, 0x81FF, 1, PsikyoZ80RAM); - ZetMapArea(0x8000, 0x81FF, 2, PsikyoZ80RAM); - - ZetSetInHandler(tengaiZ80In); - ZetSetOutHandler(tengaiZ80Out); - break; - } - } - - ZetClose(); - } - - PsikyoPalInit(); - - PsikyoTileInit(PsikyoTileROMSize); - PsikyoSpriteInit(PsikyoSpriteROMSize); - - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: - case PSIKYO_HW_GUNBIRD: { - BurnYM2610Init(8000000, PsikyoSampleROM02, &PsikyoSampleROM02Size, PsikyoSampleROM01, &PsikyoSampleROM01Size, &PsikyoFMIRQHandler, PsikyoSynchroniseStream, PsikyoGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 1.20, BURN_SND_ROUTE_BOTH); - break; - } - case PSIKYO_HW_S1945: - case PSIKYO_HW_TENGAI: { - BurnYMF278BInit(0, PsikyoSampleROM02, PsikyoSampleROM02Size, &PsikyoFMIRQHandler, PsikyoSynchroniseStream); - BurnYMF278BSetRoute(BURN_SND_YMF278B_YMF278B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYMF278BSetRoute(BURN_SND_YMF278B_YMF278B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnTimerAttachZet(4000000); - break; - } - } - - nPrevBurnCPUSpeedAdjust = -1; - - DrvDoReset(); // Reset machine - - return 0; -} - -// ---------------------------------------------------------------------------- -// Savestates / scanning - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029521; - } - - if (nAction & ACB_MEMORY_ROM) { // Scan all memory, devices & variables - ba.Data = Psikyo68KROM; - ba.nLen = 0x00100000; - ba.nAddress = 0; - ba.szName = "68K ROM"; - BurnAcb(&ba); - - ba.Data = PsikyoZ80ROM; - ba.nLen = 0x00020000; - ba.nAddress = 0; - ba.szName = "Z80 ROM"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { // Scan all memory, devices & variables - ba.Data = Psikyo68KRAM; - ba.nLen = 0x00020000; - ba.nAddress = 0; - ba.szName = "68K RAM"; - BurnAcb(&ba); - - ba.Data = PsikyoZ80RAM; - if (PsikyoHardwareVersion == PSIKYO_HW_SAMURAIA) { - ba.nLen = 0x0000800; - } else { - ba.nLen = 0x0000200; - } - ba.nAddress = 0; - ba.szName = "Z80 RAM"; - BurnAcb(&ba); - - ba.Data = PsikyoTileRAM[0]; - ba.nLen = 0x00002000; - ba.nAddress = 0; - ba.szName = "Tilemap 0"; - BurnAcb(&ba); - - ba.Data = PsikyoTileRAM[1]; - ba.nLen = 0x00002000; - ba.nAddress = 0; - ba.szName = "Tilemap 1"; - BurnAcb(&ba); - - ba.Data = PsikyoTileRAM[2]; - ba.nLen = 0x00004000; - ba.nAddress = 0; - ba.szName = "Tilemap attributes"; - BurnAcb(&ba); - - ba.Data = PsikyoSpriteRAM; - ba.nLen = 0x00002000; - ba.nAddress = 0; - ba.szName = "Sprite tables"; - BurnAcb(&ba); - - ba.Data = PsikyoPalSrc; - ba.nLen = 0x00002000; - ba.nAddress = 0; - ba.szName = "Palette"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); // Scan 68000 state - - ZetScan(nAction); // Scan Z80 state - - SCAN_VAR(nCyclesDone); - - SCAN_VAR(bVBlank); - - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: - case PSIKYO_HW_GUNBIRD: { - BurnYM2610Scan(nAction, pnMin); - break; - } - case PSIKYO_HW_S1945: - case PSIKYO_HW_TENGAI: { - BurnYMF278BScan(nAction, pnMin); - break; - } - } - - SCAN_VAR(nSoundlatch); SCAN_VAR(nSoundlatchAck); - - SCAN_VAR(nPsikyoZ80Bank); - - if (PsikyoHardwareVersion == PSIKYO_HW_TENGAI || PsikyoHardwareVersion == PSIKYO_HW_S1945) { - TengaiMCUScan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - int nBank = nPsikyoZ80Bank; - nPsikyoZ80Bank = -1; - - switch (PsikyoHardwareVersion) { - case PSIKYO_HW_SAMURAIA: { - ZetOpen(0); - samuraiaZ80SetBank(nBank); - ZetClose(); - break; - } - case PSIKYO_HW_GUNBIRD: - case PSIKYO_HW_S1945: - case PSIKYO_HW_TENGAI: { - ZetOpen(0); - gunbirdZ80SetBank(nBank); - ZetClose(); - break; - } - } - - PsikyoRecalcPalette = 1; - } - } - - return 0; -} - -// ---------------------------------------------------------------------------- -// Rom information - -// Samurai Aces / Sengoku Ace - -static struct BurnRomInfo samuraiaRomDesc[] = { - { "4-u127.bin", 0x040000, 0x8c9911ca, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "5-u126.bin", 0x040000, 0xd20c3ef0, BRF_ESS | BRF_PRG }, // 1 - - { "u14.bin", 0x200000, 0x00a546cb, BRF_GRA }, // 2 Sprite data - - { "u11.bin", 0x040000, 0x11a04d91, BRF_GRA }, // 3 Sprite LUT - - { "u34.bin", 0x100000, 0xe6a75bd8, BRF_GRA }, // 4 Tile data - { "u35.bin", 0x100000, 0xc4ca0164, BRF_GRA }, // 5 - - { "3-u58.bin", 0x020000, 0x310f5c76, BRF_ESS | BRF_PRG }, // 6 CPU #1 code - - { "u68.bin", 0x100000, 0x9a7f6c34, BRF_SND }, // 7 YM2610 (delta-t) ADPCM data -}; - -STD_ROM_PICK(samuraia) -STD_ROM_FN(samuraia) - -static struct BurnRomInfo sngkaceRomDesc[] = { - { "1-u127.bin", 0x040000, 0x6c45b2f8, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "2-u126.bin", 0x040000, 0x845a6760, BRF_ESS | BRF_PRG }, // 1 - - { "u14.bin", 0x200000, 0x00a546cb, BRF_GRA }, // 2 Sprite data - - { "u11.bin", 0x040000, 0x11a04d91, BRF_GRA }, // 3 Sprite LUT - - { "u34.bin", 0x100000, 0xe6a75bd8, BRF_GRA }, // 4 Tile data - { "u35.bin", 0x100000, 0xc4ca0164, BRF_GRA }, // 5 - - { "3-u58.bin", 0x020000, 0x310f5c76, BRF_ESS | BRF_PRG }, // 6 CPU #1 code - - { "u68.bin", 0x100000, 0x9a7f6c34, BRF_SND }, // 7 YM2610 (delta-t) ADPCM data -}; - -STD_ROM_PICK(sngkace) -STD_ROM_FN(sngkace) - -static struct BurnRomInfo sngkaceaRomDesc[] = { - // the roms have a very visible "." symbol after the number, it might indicate a newer revision. - { "1.-u127.bin", 0x040000, 0x3a43708d, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "2.-u126.bin", 0x040000, 0x7aa50c46, BRF_ESS | BRF_PRG }, // 1 - - { "u14.bin", 0x200000, 0x00a546cb, BRF_GRA }, // 2 Sprite data - - { "u11.bin", 0x040000, 0x11a04d91, BRF_GRA }, // 3 Sprite LUT - - { "u34.bin", 0x100000, 0xe6a75bd8, BRF_GRA }, // 4 Tile data - { "u35.bin", 0x100000, 0xc4ca0164, BRF_GRA }, // 5 - - { "3-u58.bin", 0x020000, 0x310f5c76, BRF_ESS | BRF_PRG }, // 6 CPU #1 code - - { "u68.bin", 0x100000, 0x9a7f6c34, BRF_SND }, // 7 YM2610 (delta-t) ADPCM data -}; - -STD_ROM_PICK(sngkacea) -STD_ROM_FN(sngkacea) - -struct BurnDriver BurnDrvSamuraiA = { - "samuraia", NULL, NULL, NULL, "1993", - "Samurai Aces (World)\0", NULL, "Psikyo / Banpresto", "Psikyo 68EC020", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, samuraiaRomInfo, samuraiaRomName, NULL, NULL, gunbirdInputInfo, samuraiaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvSngkAce = { - "sngkace", "samuraia", NULL, NULL, "1993", - "Sengoku Ace (Japan, set 1)\0", NULL, "Psikyo / Banpresto", "Psikyo 68EC020", - L"\u6226\u56FD\u30A8\u30FC\u30B9 (Japan, set 1)\0Sengoku Ace\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, sngkaceRomInfo, sngkaceRomName, NULL, NULL, gunbirdInputInfo, sngkaceDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvSngkAcea = { - "sngkacea", "samuraia", NULL, NULL, "1993", - "Sengoku Ace (Japan, set 2)\0", NULL, "Psikyo / Banpresto", "Psikyo 68EC020", - L"\u6226\u56FD\u30A8\u30FC\u30B9 (Japan, set 2)\0Sengoku Ace\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, sngkaceaRomInfo, sngkaceaRomName, NULL, NULL, gunbirdInputInfo, sngkaceDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -// Gunbird - -static struct BurnRomInfo gunbirdRomDesc[] = { - { "4.u46", 0x040000, 0xb78ec99d, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "5.u39", 0x040000, 0x925f095d, BRF_ESS | BRF_PRG }, // 1 - - { "u14.bin", 0x200000, 0x7d7e8a00, BRF_GRA }, // 2 Sprite data - { "u24.bin", 0x200000, 0x5e3ffc9d, BRF_GRA }, // 3 - { "u15.bin", 0x200000, 0xa827bfb5, BRF_GRA }, // 4 - { "u25.bin", 0x100000, 0xef652e0c, BRF_GRA }, // 5 - - { "u3.bin", 0x040000, 0x0905aeb2, BRF_GRA }, // 6 Sprite LUT - - { "u33.bin", 0x200000, 0x54494e6b, BRF_GRA }, // 7 Tile data - - { "3.u71", 0x020000, 0x2168e4ba, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u64.bin", 0x080000, 0xe187ed4f, BRF_SND }, // 9 YM2610 ADPCM (delta-t) data - { "u56.bin", 0x100000, 0x9e07104d, BRF_SND }, // 10 YM2610 ADPCM data - - { "3020.u19", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP },// 11 - { "3021.u69", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP },// 12 -}; - -STD_ROM_PICK(gunbird) -STD_ROM_FN(gunbird) - -static struct BurnRomInfo gunbirdjRomDesc[] = { - { "1.u46", 0x040000, 0x474abd69, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "2.u39", 0x040000, 0x3e3e661f, BRF_ESS | BRF_PRG }, // 1 - - { "u14.bin", 0x200000, 0x7d7e8a00, BRF_GRA }, // 2 Sprite data - { "u24.bin", 0x200000, 0x5e3ffc9d, BRF_GRA }, // 3 - { "u15.bin", 0x200000, 0xa827bfb5, BRF_GRA }, // 4 - { "u25.bin", 0x100000, 0xef652e0c, BRF_GRA }, // 5 - - { "u3.bin", 0x040000, 0x0905aeb2, BRF_GRA }, // 6 Sprite LUT - - { "u33.bin", 0x200000, 0x54494e6b, BRF_GRA }, // 7 Tile data - - { "3.u71", 0x020000, 0x2168e4ba, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u64.bin", 0x080000, 0xe187ed4f, BRF_SND }, // 9 YM2610 ADPCM (delta-t) data - { "u56.bin", 0x100000, 0x9e07104d, BRF_SND }, // 10 YM2610 ADPCM data -}; - -STD_ROM_PICK(gunbirdj) -STD_ROM_FN(gunbirdj) - -static struct BurnRomInfo gunbirdkRomDesc[] = { - { "1k.u46", 0x080000, 0x745cee52, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "2k.u39", 0x080000, 0x669632fb, BRF_ESS | BRF_PRG }, // 1 - - { "u14.bin", 0x200000, 0x7d7e8a00, BRF_GRA }, // 2 Sprite data - { "u24.bin", 0x200000, 0x5e3ffc9d, BRF_GRA }, // 3 - { "u15.bin", 0x200000, 0xa827bfb5, BRF_GRA }, // 4 - { "u25.bin", 0x100000, 0xef652e0c, BRF_GRA }, // 5 - - { "u3.bin", 0x040000, 0x0905aeb2, BRF_GRA }, // 6 Sprite LUT - - { "u33.bin", 0x200000, 0x54494e6b, BRF_GRA }, // 7 Tile data - - { "k3.u71", 0x020000, 0x11994055, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u64.bin", 0x080000, 0xe187ed4f, BRF_SND }, // 9 YM2610 ADPCM (delta-t) data - { "u56.bin", 0x100000, 0x9e07104d, BRF_SND }, // 10 YM2610 ADPCM data -}; - -STD_ROM_PICK(gunbirdk) -STD_ROM_FN(gunbirdk) - -struct BurnDriver BurnDrvGunbird = { - "gunbird", NULL, NULL, NULL, "1994", - "Gunbird (World)\0", NULL, "Psikyo", "Psikyo 68EC020", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, gunbirdRomInfo, gunbirdRomName, NULL, NULL, gunbirdInputInfo, gunbirdWorldDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvGunbirdj = { - "gunbirdj", "gunbird", NULL, NULL, "1994", - "Gunbird (Japan)\0", NULL, "Psikyo", "Psikyo 68EC020", - L"Gunbird (Japan)\0\u30AC\u30F3\u30D0\u30FC\u30C9\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, gunbirdjRomInfo, gunbirdjRomName, NULL, NULL, gunbirdInputInfo, gunbirdDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvGunbirdk = { - "gunbirdk", "gunbird", NULL, NULL, "1994", - "Gunbird (Korea)\0", NULL, "Psikyo", "Psikyo 68EC020", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, gunbirdkRomInfo, gunbirdkRomName, NULL, NULL, gunbirdInputInfo, gunbirdDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -// Battle K-Road - -static struct BurnRomInfo btlkroadRomDesc[] = { - { "4-u46.bin", 0x040000, 0x8a7a28b4, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "5-u39.bin", 0x040000, 0x933561fa, BRF_ESS | BRF_PRG }, // 1 - - { "u14.bin", 0x200000, 0x282d89c3, BRF_GRA }, // 2 Sprite data - { "u24.bin", 0x200000, 0xbbe9d3d1, BRF_GRA }, // 3 - { "u15.bin", 0x200000, 0xd4d1b07c, BRF_GRA }, // 4 - { "", 0, 0, 0 }, // 5 - - { "u3.bin", 0x040000, 0x30d541ed, BRF_GRA }, // 6 Sprite LUT - - { "u33.bin", 0x200000, 0x4c8577f1, BRF_GRA }, // 7 Tile data - - { "3-u71.bin", 0x020000, 0x22411fab, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u64.bin", 0x080000, 0x0f33049f, BRF_SND }, // 9 YM2610 ADPCM (delta-t) data - { "u56.bin", 0x100000, 0x51d73682, BRF_SND }, // 10 YM2610 ADPCM data - - { "tibpal16l8.u69", 260, 0x00000000, BRF_NODUMP }, // NO DUMP - { "tibpal16l8.u19", 260, 0x00000000, BRF_NODUMP }, // NO DUMP -}; - -STD_ROM_PICK(btlkroad) -STD_ROM_FN(btlkroad) - -struct BurnDriver BurnDrvBtlKRoad = { - "btlkroad", NULL, NULL, NULL, "1994", - "Battle K-Road\0", NULL, "Psikyo", "Psikyo 68EC020", - L"Battle K-Road\0Battle K-Road \u30D0\u30C8\u30EB\u30AF\u30ED\u30FC\u30C9\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VSFIGHT, 0, - NULL, btlkroadRomInfo, btlkroadRomName, NULL, NULL, btlkroadInputInfo, btlkroadDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 320, 224, 4, 3 -}; - -// Battle K-Road (Korean PCB)) -// f205v id 1266 -static struct BurnRomInfo btlkroadkRomDesc[] = { - { "4(dot).u46", 0x040000, 0xe724d429, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "5(dot).u39", 0x040000, 0xc0d65765, BRF_ESS | BRF_PRG }, // 1 - - { "u14.bin", 0x200000, 0x282d89c3, BRF_GRA }, // 2 Sprite data - { "u24.bin", 0x200000, 0xbbe9d3d1, BRF_GRA }, // 3 - { "u15.bin", 0x200000, 0xd4d1b07c, BRF_GRA }, // 4 - { "", 0, 0, 0 }, // 5 - - { "u3.bin", 0x040000, 0x30d541ed, BRF_GRA }, // 6 Sprite LUT - - { "u33.bin", 0x200000, 0x4c8577f1, BRF_GRA }, // 7 Tile data - - { "3(k).u71", 0x020000, 0xe0f0c597, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u64.bin", 0x080000, 0x0f33049f, BRF_SND }, // 9 YM2610 ADPCM (delta-t) data - { "u56.bin", 0x100000, 0x51d73682, BRF_SND }, // 10 YM2610 ADPCM data - - { "tibpal16l8.u69", 260, 0x00000000, BRF_NODUMP }, // NO DUMP - { "tibpal16l8.u19", 260, 0x00000000, BRF_NODUMP }, // NO DUMP -}; - -STD_ROM_PICK(btlkroadk) -STD_ROM_FN(btlkroadk) - -struct BurnDriver BurnDrvBtlKRoadk = { - "btlkroadk", "btlkroad", NULL, NULL, "1994", - "Battle K-Road (Korean PCB)\0", NULL, "Psikyo", "Psikyo 68EC020", - L"Battle K-Road\0Battle K-Road \u30D0\u30C8\u30EB\u30AF\u30ED\u30FC\u30C9 (Korean PCB)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VSFIGHT, 0, - NULL, btlkroadkRomInfo, btlkroadkRomName, NULL, NULL, btlkroadInputInfo, btlkroadDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 320, 224, 4, 3 -}; - -// Strikers 1945 (gunbird hardware) - -static struct BurnRomInfo s1945jnRomDesc[] = { - { "1-u46.bin", 0x080000, 0x45fa8086, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "2-u39.bin", 0x080000, 0x0152ab8c, BRF_ESS | BRF_PRG }, // 1 - - { "u20.bin", 0x200000, 0x28a27fee, BRF_GRA }, // 2 Sprite data - { "u22.bin", 0x200000, 0xca152a32, BRF_GRA }, // 3 - { "u21.bin", 0x200000, 0xc5d60ea9, BRF_GRA }, // 4 - { "u23.bin", 0x200000, 0x48710332, BRF_GRA }, // 5 - - { "u1.bin", 0x040000, 0xdee22654, BRF_GRA }, // 6 Sprite LUT - - { "u34.bin", 0x200000, 0xaaf83e23, BRF_GRA }, // 7 Tile data - - { "3-u71.bin", 0x020000, 0xe3e366bd, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u64.bin", 0x080000, 0xa44a4a9b, BRF_SND }, // 9 YM2610 ADPCM (delta-t) data - { "u56.bin", 0x100000, 0xfe1312c2, BRF_SND }, // 10 YM2610 ADPCM data -}; - -STD_ROM_PICK(s1945jn) -STD_ROM_FN(s1945jn) - -struct BurnDriver BurnDrvS1945jn = { - "s1945jn", "s1945", NULL, NULL, "1995", - "Strikers 1945 (Japan, unprotected)\0", NULL, "Psikyo", "Psikyo 68EC020", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, s1945jnRomInfo, s1945jnRomName, NULL, NULL, gunbirdInputInfo, s1945DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -// Strikers 1945 - -static struct BurnRomInfo s1945RomDesc[] = { - { "2s.u40", 0x040000, 0x9b10062a, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "3s.u41", 0x040000, 0xf87e871a, BRF_ESS | BRF_PRG }, // 1 - - { "u20.bin", 0x200000, 0x28a27fee, BRF_GRA }, // 2 Sprite data - { "u22.bin", 0x200000, 0xca152a32, BRF_GRA }, // 3 - { "u21.bin", 0x200000, 0xc5d60ea9, BRF_GRA }, // 4 - { "u23.bin", 0x200000, 0x48710332, BRF_GRA }, // 5 - - { "u1.bin", 0x040000, 0xdee22654, BRF_GRA }, // 6 Sprite LUT - - { "u34.bin", 0x200000, 0xaaf83e23, BRF_GRA }, // 7 Tile data - - { "3-u63.bin", 0x020000, 0x42d40ae1, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u61.bin", 0x200000, 0xa839cf47, BRF_SND }, // 9 PCM data - - { "4-u59.bin", 256, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(s1945) -STD_ROM_FN(s1945) - -static struct BurnRomInfo s1945jRomDesc[] = { - { "1-u40.bin", 0x040000, 0xc00eb012, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "2-u41.bin", 0x040000, 0x3f5a134b, BRF_ESS | BRF_PRG }, // 1 - - { "u20.bin", 0x200000, 0x28a27fee, BRF_GRA }, // 2 Sprite data - { "u22.bin", 0x200000, 0xca152a32, BRF_GRA }, // 3 - { "u21.bin", 0x200000, 0xc5d60ea9, BRF_GRA }, // 4 - { "u23.bin", 0x200000, 0x48710332, BRF_GRA }, // 5 - - { "u1.bin", 0x040000, 0xdee22654, BRF_GRA }, // 6 Sprite LUT - - { "u34.bin", 0x200000, 0xaaf83e23, BRF_GRA }, // 7 Tile data - - { "3-u63.bin", 0x020000, 0x42d40ae1, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u61.bin", 0x200000, 0xa839cf47, BRF_SND }, // 9 PCM data - - { "4-u59.bin", 256, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(s1945j) -STD_ROM_FN(s1945j) - -static struct BurnRomInfo s1945kRomDesc[] = { - { "10.u40", 0x040000, 0x5a32af36, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "9.u41", 0x040000, 0x29cc6d7d, BRF_ESS | BRF_PRG }, // 1 - - { "u20.bin", 0x200000, 0x28a27fee, BRF_GRA }, // 2 Sprite data - { "u22.bin", 0x200000, 0xca152a32, BRF_GRA }, // 3 - { "u21.bin", 0x200000, 0xc5d60ea9, BRF_GRA }, // 4 - { "u23.bin", 0x200000, 0x48710332, BRF_GRA }, // 5 - - { "u1.bin", 0x040000, 0xdee22654, BRF_GRA }, // 6 Sprite LUT - - { "u34.bin", 0x200000, 0xaaf83e23, BRF_GRA }, // 7 Tile data - - { "3-u63.bin", 0x020000, 0x42d40ae1, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u61.bin", 0x200000, 0xa839cf47, BRF_SND }, // 9 PCM data - - { "4-u59.bin", 256, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(s1945k) -STD_ROM_FN(s1945k) - -static struct BurnRomInfo s1945aRomDesc[] = { - { "4-u40.bin", 0x040000, 0x29ffc217, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "5-u41.bin", 0x040000, 0xc3d3fb64, BRF_ESS | BRF_PRG }, // 1 - - { "u20.bin", 0x200000, 0x28a27fee, BRF_GRA }, // 2 Sprite data - { "u22.bin", 0x200000, 0xca152a32, BRF_GRA }, // 3 - { "u21.bin", 0x200000, 0xc5d60ea9, BRF_GRA }, // 4 - { "u23.bin", 0x200000, 0x48710332, BRF_GRA }, // 5 - - { "u1.bin", 0x040000, 0xdee22654, BRF_GRA }, // 6 Sprite LUT - - { "u34.bin", 0x200000, 0xaaf83e23, BRF_GRA }, // 7 Tile data - - { "3-u63.bin", 0x020000, 0x42d40ae1, BRF_ESS | BRF_PRG }, // 8 CPU #1 code - - { "u61.bin", 0x200000, 0xa839cf47, BRF_SND }, // 9 PCM data - - { "4-u59.bin", 256, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(s1945a) -STD_ROM_FN(s1945a) - -struct BurnDriver BurnDrvS1945 = { - "s1945", NULL, NULL, NULL, "1995", - "Strikers 1945\0", NULL, "Psikyo", "Psikyo 68EC020", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, s1945RomInfo, s1945RomName, NULL, NULL, gunbirdInputInfo, s1945WorldDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvS1945j = { - "s1945j", "s1945", NULL, NULL, "1995", - "Strikers 1945 (Japan)\0", NULL, "Psikyo", "Psikyo 68EC020", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, s1945jRomInfo, s1945jRomName, NULL, NULL, gunbirdInputInfo, s1945DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvS1945k = { - "s1945k", "s1945", NULL, NULL, "1995", - "Strikers 1945 (Korea)\0", NULL, "Psikyo", "Psikyo 68EC020", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, s1945kRomInfo, s1945kRomName, NULL, NULL, gunbirdInputInfo, s1945DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvS1945a = { - "s1945a", "s1945", NULL, NULL, "1995", - "Strikers 1945 (Alt)\0", NULL, "Psikyo", "Psikyo 68EC020", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, s1945aRomInfo, s1945aRomName, NULL, NULL, gunbirdInputInfo, s1945aDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 224, 320, 3, 4 -}; - -// Tengai - -static struct BurnRomInfo tengaiRomDesc[] = { - { "5-u40.bin", 0x080000, 0x90088195, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "4-u41.bin", 0x080000, 0x0d53196c, BRF_ESS | BRF_PRG }, // 1 - - { "u20.bin", 0x200000, 0xed42ef73, BRF_GRA }, // 2 Sprite data - { "u22.bin", 0x200000, 0x8d21caee, BRF_GRA }, // 3 - { "u21.bin", 0x200000, 0xefe34eed, BRF_GRA }, // 4 - - { "u1.bin", 0x040000, 0x681d7d55, BRF_GRA }, // 5 Sprite LUT - - { "u34.bin", 0x400000, 0x2a2e2eeb, BRF_GRA }, // 6 Tile data - - { "1-u63.bin", 0x020000, 0x2025e387, BRF_ESS | BRF_PRG }, // 7 CPU #1 code - - { "u61.bin", 0x200000, 0xa63633c5, BRF_SND }, // 8 PCM data - { "u62.bin", 0x200000, 0x3ad0c357, BRF_SND }, // 9 - - { "4-u59.bin", 256, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(tengai) -STD_ROM_FN(tengai) - -struct BurnDriver BurnDrvTengai = { - "tengai", NULL, NULL, NULL, "1996", - "Tengai (world)\0", NULL, "Psikyo", "Psikyo 68EC020", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_HORSHOOT, 0, - NULL, tengaiRomInfo, tengaiRomName, NULL, NULL, gunbirdInputInfo, tengaiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 320, 224, 4, 3 -}; - -static struct BurnRomInfo tengaijRomDesc[] = { - { "2-u40.bin", 0x080000, 0xab6fe58a, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "3-u41.bin", 0x080000, 0x02e42e39, BRF_ESS | BRF_PRG }, // 1 - - { "u20.bin", 0x200000, 0xed42ef73, BRF_GRA }, // 2 Sprite data - { "u22.bin", 0x200000, 0x8d21caee, BRF_GRA }, // 3 - { "u21.bin", 0x200000, 0xefe34eed, BRF_GRA }, // 4 - - { "u1.bin", 0x040000, 0x681d7d55, BRF_GRA }, // 5 Sprite LUT - - { "u34.bin", 0x400000, 0x2a2e2eeb, BRF_GRA }, // 6 Tile data - - { "1-u63.bin", 0x020000, 0x2025e387, BRF_ESS | BRF_PRG }, // 7 CPU #1 code - - { "u61.bin", 0x200000, 0xa63633c5, BRF_SND }, // 8 PCM data - { "u62.bin", 0x200000, 0x3ad0c357, BRF_SND }, // 9 - - { "4-u59.bin", 256, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(tengaij) -STD_ROM_FN(tengaij) - -struct BurnDriver BurnDrvTengaij = { - "tengaij", "tengai", NULL, NULL, "1996", - "Tengai\0Sengoku Blade - sengoku ace episode II\0", NULL, "Psikyo", "Psikyo 68EC020", - L"Tengai\0\u6226\u56FD\u30D6\u30EC\u30FC\u30C9 - sengoku ace episode II\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_HORSHOOT, 0, - NULL, tengaijRomInfo, tengaijRomName, NULL, NULL, gunbirdInputInfo, tengaijDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &PsikyoRecalcPalette, 0x1000, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/psikyo/d_psikyo4.cpp b/jan/src/burn/drv/psikyo/d_psikyo4.cpp deleted file mode 100644 index 8d7b3c410..000000000 --- a/jan/src/burn/drv/psikyo/d_psikyo4.cpp +++ /dev/null @@ -1,1423 +0,0 @@ -// FB Alpha Psikyo PS4 harware driver module -// Based on MAME driver by David Haywood and Paul Priest - -#include "tiles_generic.h" -#include "burn_ymf278b.h" -#include "eeprom.h" -#include "sh2_intf.h" - -static UINT8 *AllMem; -static UINT8 *DrvSh2ROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvSndBanks; -static UINT8 *AllRam; -static UINT8 *DrvSh2RAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRegs; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT32 *DrvPalette; - -static UINT16 *pTempDraw; - -static UINT8 *DrvBrightVal; -static UINT16 *tile_bank; -static UINT8 *ioselect; - -static INT32 sample_offs; -static UINT32 pcmbank_previous; - -static UINT8 DrvJoy1[32]; -static UINT8 DrvJoy2[32]; -static UINT8 DrvMah1[8]; -static UINT8 DrvMah2[8]; -static UINT8 DrvMah3[8]; -static UINT8 DrvMah4[8]; -static UINT8 DrvMah5[8]; -static UINT8 DrvMah6[8]; -static UINT8 DrvMah7[8]; -static UINT8 DrvMah8[8]; -static UINT8 DrvMah9[8]; -static UINT8 DrvMahs[10]; -static UINT32 DrvInputs[2]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 mahjong = 0; -static INT32 nGfxMask; - -static UINT32 speedhack_address = ~0; -static UINT32 speedhack_pc[4] = { 0, 0, 0, 0 }; - -static struct BurnInputInfo LoderndfInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 31, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 24, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 25, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 26, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 27, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 28, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 29, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 30, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 23, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 16, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 17, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 18, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 19, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 20, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 21, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 22, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy2 + 31, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy2 + 24, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy2 + 25, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy2 + 26, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy2 + 27, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 28, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy2 + 29, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy2 + 30, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy2 + 23, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy2 + 16, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy2 + 17, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy2 + 18, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy2 + 19, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy2 + 20, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy2 + 21, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy2 + 22, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Loderndf) - -static struct BurnInputInfo HotdebutInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 31, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 24, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 25, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 26, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 27, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 23, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 16, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 17, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 18, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy1 + 19, "p2 fire 4" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy2 + 31, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 24, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy2 + 25, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy2 + 26, "p3 fire 3" }, - {"P3 Button 4", BIT_DIGITAL, DrvJoy2 + 27, "p3 fire 4" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy2 + 23, "p4 start" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy2 + 16, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy2 + 17, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy2 + 18, "p4 fire 3" }, - {"P4 Button 4", BIT_DIGITAL, DrvJoy2 + 19, "p4 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Hotdebut) - -static struct BurnInputInfo HotgmckInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvMah1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvMah2 + 5, "p1 start" }, - {"A", BIT_DIGITAL, DrvMah2 + 0, "mah a" }, - {"B", BIT_DIGITAL, DrvMah3 + 0, "mah b" }, - {"C", BIT_DIGITAL, DrvMah4 + 0, "mah c" }, - {"D", BIT_DIGITAL, DrvMah5 + 0, "mah d" }, - {"E", BIT_DIGITAL, DrvMah2 + 1, "mah e" }, - {"F", BIT_DIGITAL, DrvMah3 + 1, "mah f" }, - {"G", BIT_DIGITAL, DrvMah4 + 1, "mah g" }, - {"H", BIT_DIGITAL, DrvMah5 + 1, "mah h" }, - {"I", BIT_DIGITAL, DrvMah2 + 2, "mah i" }, - {"J", BIT_DIGITAL, DrvMah3 + 2, "mah j" }, - {"K", BIT_DIGITAL, DrvMah2 + 4, "mah k" }, - {"L", BIT_DIGITAL, DrvMah5 + 2, "mah l" }, - {"M", BIT_DIGITAL, DrvMah2 + 3, "mah m" }, - {"N", BIT_DIGITAL, DrvMah3 + 3, "mah n" }, - {"Pon", BIT_DIGITAL, DrvMah5 + 3, "mah pon" }, - {"Chi", BIT_DIGITAL, DrvMah4 + 3, "mah chi" }, - {"Kan", BIT_DIGITAL, DrvMah2 + 4, "mah kan" }, - {"Ron", BIT_DIGITAL, DrvMah4 + 4, "mah ron" }, - {"Reach", BIT_DIGITAL, DrvMah3 + 4, "mah reach" }, - - {"P2 Coin", BIT_DIGITAL, DrvMah1 + 2, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvMah6 + 5, "p2 start" }, - {"A", BIT_DIGITAL, DrvMah6 + 0, "mah a" }, - {"B", BIT_DIGITAL, DrvMah7 + 0, "mah b" }, - {"C", BIT_DIGITAL, DrvMah8 + 0, "mah c" }, - {"D", BIT_DIGITAL, DrvMah9 + 0, "mah d" }, - {"E", BIT_DIGITAL, DrvMah6 + 1, "mah e" }, - {"F", BIT_DIGITAL, DrvMah7 + 1, "mah f" }, - {"G", BIT_DIGITAL, DrvMah8 + 1, "mah g" }, - {"H", BIT_DIGITAL, DrvMah9 + 1, "mah h" }, - {"I", BIT_DIGITAL, DrvMah6 + 2, "mah i" }, - {"J", BIT_DIGITAL, DrvMah7 + 2, "mah j" }, - {"K", BIT_DIGITAL, DrvMah6 + 4, "mah k" }, - {"L", BIT_DIGITAL, DrvMah9 + 2, "mah l" }, - {"M", BIT_DIGITAL, DrvMah6 + 3, "mah m" }, - {"N", BIT_DIGITAL, DrvMah7 + 3, "mah n" }, - {"Pon", BIT_DIGITAL, DrvMah9 + 3, "mah pon" }, - {"Chi", BIT_DIGITAL, DrvMah8 + 3, "mah chi" }, - {"Kan", BIT_DIGITAL, DrvMah6 + 4, "mah kan" }, - {"Ron", BIT_DIGITAL, DrvMah8 + 4, "mah ron" }, - {"Reach", BIT_DIGITAL, DrvMah7 + 4, "mah reach" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvMah1 + 4, "service" }, - {"Service", BIT_DIGITAL, DrvMah1 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Hotgmck) - -static struct BurnDIPInfo LoderndfDIPList[]= -{ - {0x27, 0xff, 0xff, 0x60, NULL }, - {0x28, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x27, 0x01, 0x20, 0x20, "Off" }, - {0x27, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x27, 0x01, 0x40, 0x40, "Off" }, - {0x27, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Region" }, - {0x28, 0x01, 0x03, 0x00, "Japan (Shows Version Number)" }, - {0x28, 0x01, 0x03, 0x01, "World (Does Not Show Version Number)" }, -}; - -STDDIPINFO(Loderndf) - -static struct BurnDIPInfo HotdebutDIPList[]= -{ - {0x1b, 0xff, 0xff, 0x60, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1b, 0x01, 0x20, 0x20, "Off" }, - {0x1b, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x1b, 0x01, 0x40, 0x40, "Off" }, - {0x1b, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Hotdebut) - -static struct BurnDIPInfo HotgmckDIPList[]= -{ - {0x2d, 0xff, 0xff, 0x60, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x2d, 0x01, 0x20, 0x20, "Off" }, - {0x2d, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x2d, 0x01, 0x40, 0x40, "Off" }, - {0x2d, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Hotgmck) - -#ifndef LSB_FIRST -static void le_to_be(unsigned char * p, int size) -{ - unsigned char c; - - for(int i=0; i> 0) & 7) << 20; - INT32 bank1 = ((ioselect[0] >> 4) & 7) << 20; - - pcmbank_previous = ioselect[0] & 0x77; - memcpy (DrvSndROM + 0x200000, DrvSndBanks + bank0, 0x100000); - memcpy (DrvSndROM + 0x300000, DrvSndBanks + bank1, 0x100000); - } - } -} - -static UINT32 psikyo4_read_inputs(INT32 bsel) -{ - if (mahjong) { - UINT32 ret = 0xff; - - if (ioselect[2] & 1) ret &= bsel ? DrvMahs[5] : DrvMahs[1]; - if (ioselect[2] & 2) ret &= bsel ? DrvMahs[6] : DrvMahs[2]; - if (ioselect[2] & 4) ret &= bsel ? DrvMahs[7] : DrvMahs[3]; - if (ioselect[2] & 8) ret &= bsel ? DrvMahs[8] : DrvMahs[4]; - - return (ret << 24) | 0x00ffff00 | DrvMahs[0]; - } else { - return DrvInputs[bsel]; - } - - return 0; -} - -UINT32 __fastcall ps4_read_long(UINT32 address) -{ - address &= 0xc7fffffc; - - if (address >= 0x03000000 && address <= 0x030037ff) { - return *((UINT32 *)(DrvSprRAM + (address & 0x3ffc))); - } - - if ((address & 0xffffe000) == 0x03004000) { - return *((UINT32 *)(DrvPalRAM + (address & 0x1ffc))); - } - - if ((address & 0xffffe000) == 0x03006000) { - INT32 bank = (tile_bank[0] & 0x1fff) << 13; - bank |= address & 0x1ffc; - if (bank >= ((nGfxMask + 1) << 8)) return 0; - - return *((UINT32 *)(DrvGfxROM + bank)); - } - - return 0; -} - -void __fastcall ps4_write_long(UINT32 address, UINT32 data) -{ - address &= 0xc7fffffc; - - if (address >= 0x03000000 && address <= 0x030037ff) { - *((UINT32 *)(DrvSprRAM + (address & 0x3ffc))) = data; - return; - } - - if ((address & 0xffffe000) == 0x03004000) { - *((UINT32 *)(DrvPalRAM + (address & 0x1ffc))) = data; - return; - } - - if (address >= 0x03003fe4 && address <= 0x03003fef) { - address -= 0x3003fe4; - *((UINT32 *)(DrvVidRegs + address)) = data; - return; - } -} - -UINT16 __fastcall ps4_read_word(UINT32 address) -{ - address &= 0xc7fffffe; -#ifdef LSB_FIRST - address ^= 2; -#endif - if (address >= 0x03000000 && address <= 0x030037ff) { - return *((UINT16 *)(DrvSprRAM + (address & 0x3ffe))); - } - - if ((address & 0xffffe000) == 0x03004000) { - return *((UINT16 *)(DrvPalRAM + (address & 0x1ffe))); - } - - switch (address) - { - case 0x03003fe2: - return DrvDips[1] | ((EEPROMRead() & 1) << 4); - - case 0x05800000: // used? - return psikyo4_read_inputs(0); - - case 0x05800002: - return psikyo4_read_inputs(0) >> 16; - - case 0x05800004: // used? - return psikyo4_read_inputs(1); - - case 0x05800006: - return psikyo4_read_inputs(1) >> 16; - } - - return 0; -} - -UINT8 __fastcall ps4_read_byte(UINT32 address) -{ - address &= 0xc7ffffff; - - - if (address >= 0x03000000 && address <= 0x030037ff) { -#ifdef LSB_FIRST - address ^= 3; -#endif - return DrvSprRAM[address & 0x3fff]; - } - - if ((address & 0xffffe000) == 0x03004000) { -#ifdef LSB_FIRST - address ^= 3; -#endif - return DrvPalRAM[address & 0x1fff]; - } - - switch (address) - { - case 0x03003fe1: - return DrvDips[1] | ((EEPROMRead() & 1) << 4); - - case 0x05000000: - return BurnYMF278BReadStatus(); - - case 0x05000005: - return DrvSndROM[sample_offs++ & 0x3fffff]; - - case 0x05800000: - case 0x05800001: - case 0x05800002: - case 0x05800003: - return psikyo4_read_inputs(0) >> ((~address & 3) << 3); - - case 0x05800004: - case 0x05800005: - case 0x05800006: - case 0x05800007: - return psikyo4_read_inputs(1) >> ((~address & 3) << 3); - } - - return 0; -} - -void __fastcall ps4_write_word(UINT32 address, UINT16 data) -{ - address &= 0xc7fffffe; -#ifdef LSB_FIRST - address ^= 2; -#endif - - if (address >= 0x03000000 && address <= 0x030037ff) { - *((UINT16 *)(DrvSprRAM + (address & 0x3ffe))) = data; - return; - } - - if ((address & 0xffffe000) == 0x03004000) { - *((UINT16 *)(DrvPalRAM + (address & 0x1ffe))) = data; - return; - } - - if (address >= 0x03003fe4 && address <= 0x03003fef) { - address -= 0x03003fe4; - *((UINT16 *)(DrvVidRegs + address)) = data; - return; - } - - if (address == 0x3003fe2) { - EEPROMWrite((data & 0x40), (data & 0x80), (data & 0x20)); - return; - } -} - -void __fastcall ps4_write_byte(UINT32 address, UINT8 data) -{ - address &= 0xc7ffffff; - -// bprintf (0, _T("%8.8x, wb\n"), address); - - if (address >= 0x03000000 && address <= 0x030037ff) { -#ifdef LSB_FIRST - DrvSprRAM[(address ^ 3) & 0x3fff] = data; -#else - DrvSprRAM[(address) & 0x3fff] = data; -#endif - return; - } - - if ((address & 0xffffe000) == 0x03004000) { -#ifdef LSB_FIRST - DrvPalRAM[(address ^ 3) & 0x1fff] = data; -#else - DrvPalRAM[(address) & 0x1fff] = data; -#endif - return; - } - - if (address >= 0x03003fe4 && address <= 0x03003fef) { -#ifdef LSB_FIRST - DrvVidRegs[(address ^ 3) - 0x03003fe4] = data; -#else - DrvVidRegs[(address) - 0x03003fe4] = data; -#endif - return; - } - - switch (address) - { - case 0x03003fe1: - // EEPROMWrite((data & 0x40), (data & 0x80), (data & 0x20)); - return; - - case 0x03003ff3: - DrvBrightVal[0] = data; - if (DrvBrightVal[0] > 0x7f) DrvBrightVal[0] = 0x7f; - DrvBrightVal[0] ^= 0x7f; - return; - - case 0x03003ff4: - case 0x03003ff5: - case 0x03003ff6: - case 0x03003ff7: - DrvPalRAM[0x2000 + (~address & 3)] = data; - return; - - case 0x03003ffb: - DrvBrightVal[1] = data; - if (DrvBrightVal[1] > 0x7f) DrvBrightVal[1] = 0x7f; - DrvBrightVal[1] ^= 0x7f; - return; - - case 0x03003ffc: - case 0x03003ffd: - case 0x03003ffe: - case 0x03003fff: - DrvPalRAM[0x2004 + (~address & 3)] = data; - return; - - case 0x05000000: - case 0x05000002: - case 0x05000004: - case 0x05000006: - BurnYMF278BSelectRegister((address >> 1) & 3, data); - return; - - case 0x05000001: - case 0x05000003: - case 0x05000005: - case 0x05000007: - BurnYMF278BWriteRegister((address >> 1) & 3, data); - return; - - case 0x05800008: - set_pcm_bank(); - case 0x05800009: - case 0x0580000a: - case 0x0580000b: - ioselect[address & 3] = data; - return; - } -} - -UINT32 __fastcall ps4hack_read_long(UINT32 a) -{ - a &= 0xffffc; - - if (a == speedhack_address) { - UINT32 pc = Sh2GetPC(0); - - if (pc == speedhack_pc[0]) { - Sh2StopRun(); - } else if (pc == speedhack_pc[1]) { - Sh2StopRun(); - } - } - - return *((UINT32*)(DrvSh2RAM + a)); -} - -UINT16 __fastcall ps4hack_read_word(UINT32 a) -{ -#ifdef LSB_FIRST - return *((UINT16 *)(DrvSh2RAM + ((a & 0xffffe) ^ 2))); -#else - return *((UINT16 *)(DrvSh2RAM + ((a & 0xffffe)))); -#endif -} - -UINT8 __fastcall ps4hack_read_byte(UINT32 a) -{ -#ifdef LSB_FIRST - return DrvSh2RAM[(a & 0xfffff) ^ 3]; -#else - return DrvSh2RAM[(a & 0xfffff)]; -#endif -} - -static INT32 MemIndex(INT32 gfx_len) -{ - UINT8 *Next; Next = AllMem; - - DrvSh2ROM = Next; Next += 0x0300000; - - DrvGfxROM = Next; Next += gfx_len; - - DrvSndROM = Next; Next += 0x0400000; - - if (mahjong) { - DrvSndBanks = Next; Next += 0x0800000; - } - - AllRam = Next; - - DrvVidRegs = Next; Next += 0x000000c; - - DrvSh2RAM = Next; Next += 0x0100000; - DrvSprRAM = Next; Next += 0x0003800; - DrvPalRAM = Next; Next += 0x0002008; - - DrvBrightVal = Next; Next += 0x0000002; - ioselect = Next; Next += 0x0000004; - - RamEnd = Next; - - pTempDraw = (UINT16 *)Next; Next += 320 * 256 * sizeof(INT16); - DrvPalette = (UINT32 *)Next; Next += 0x1002 * sizeof(INT32); - - tile_bank = (UINT16 *)(DrvVidRegs + 0x0008); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - Sh2Reset(); - - memset (AllRam, 0, RamEnd - AllRam); - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvSh2RAM /*0 fill*/, 0, 0x100); - } - - BurnYMF278BReset(); - - sample_offs = 0; - memset (ioselect, 0xff, 4); - ioselect[2] = 0x32; - - if (mahjong) { - pcmbank_previous = ~0; - set_pcm_bank(); - } - - return 0; -} - -static const eeprom_interface eeprom_interface_93C56 = -{ - 8, // address bits 8 - 8, // data bits 8 - "*110x", // read 110x aaaaaaaa - "*101x", // write 101x aaaaaaaa dddddddd - "*111x", // erase 111x aaaaaaaa - "*10000xxxxxxx", // lock 100x 00xxxx - "*10011xxxxxxx", // unlock 100x 11xxxx - 0, - 0 -}; - -static void BurnSwap32(UINT8 *src, INT32 len) -{ - for (INT32 i = 0; i < len; i+=4) { - INT32 t = src[i+1]; - src[i+1] = src[i+2]; - src[i+2] = t; - } -} - -static void BurnSwapEndian() -{ - BurnSwap32(DrvSh2ROM, 0x100000); - BurnByteswap(DrvSh2ROM, 0x300000); - - for (INT32 i = 0; i < 0x300000; i+=4) { - INT32 t = DrvSh2ROM[i + 0]; - DrvSh2ROM[i + 0] = DrvSh2ROM[i+3]; - DrvSh2ROM[i + 3] = t; - t = DrvSh2ROM[i + 1]; - DrvSh2ROM[i + 1] = DrvSh2ROM[i + 2]; - DrvSh2ROM[i + 2] = t; - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (long long)Sh2TotalCycles() * nSoundRate / 28636350; -} - -static void DrvIRQCallback(INT32, INT32 nStatus) -{ - if (nStatus) - Sh2SetIRQLine(12, CPU_IRQSTATUS_AUTO); - else - Sh2SetIRQLine(12, CPU_IRQSTATUS_NONE); -} - -static INT32 DrvInit(INT32 (*LoadCallback)(), INT32 gfx_len) -{ - AllMem = NULL; - MemIndex(gfx_len); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(gfx_len); - - { - if (LoadCallback) { - if (LoadCallback()) return 1; - } - - BurnSwapEndian(); -#ifndef LSB_FIRST - le_to_be(DrvSh2ROM,0x0300000); -#endif - BurnSwap32(DrvGfxROM, gfx_len); - - if (mahjong) { - memcpy (DrvSndROM, DrvSndBanks, 0x200000); - } - } - - Sh2Init(1); - Sh2Open(0); - Sh2MapMemory(DrvSh2ROM, 0x00000000, 0x000fffff, MAP_ROM); - Sh2MapMemory(DrvSh2ROM + 0x100000, 0x02000000, 0x021fffff, MAP_ROM); - Sh2MapMemory(DrvSh2RAM, 0x06000000, 0x060fffff, MAP_RAM); - Sh2SetReadByteHandler (0, ps4_read_byte); - Sh2SetReadWordHandler (0, ps4_read_word); - Sh2SetReadLongHandler (0, ps4_read_long); - Sh2SetWriteByteHandler(0, ps4_write_byte); - Sh2SetWriteWordHandler(0, ps4_write_word); - Sh2SetWriteLongHandler(0, ps4_write_long); - - Sh2MapHandler(1, 0x06000000 | speedhack_address, 0x0600ffff | speedhack_address, MAP_ROM); - Sh2SetReadByteHandler (1, ps4hack_read_byte); - Sh2SetReadWordHandler (1, ps4hack_read_word); - Sh2SetReadLongHandler (1, ps4hack_read_long); - - BurnYMF278BInit(0, DrvSndROM, 0x400000, &DrvIRQCallback, DrvSynchroniseStream); - BurnYMF278BSetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - BurnTimerAttachSh2(28636350); - - EEPROMInit(&eeprom_interface_93C56); - - nGfxMask = (gfx_len - 1) >> 8; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - Sh2Exit(); - BurnYMF278BExit(); - - EEPROMExit(); - - BurnFree(AllMem); - - mahjong = 0; - - return 0; -} - -static void draw_sprites(UINT16 *dest, UINT32 scr) -{ - UINT32 *psikyo4_vidregs = (UINT32*)DrvVidRegs; - UINT32 *source = (UINT32 *)DrvSprRAM; - UINT16 *list = (UINT16 *)source + 0x2c00/2 + 0x04/2; - UINT16 listlen=(0xc00/2 - 0x04/2), listcntr=0; - - INT32 flipscreen1 = psikyo4_vidregs[1] & 0x40000000; - INT32 flipscreen2 = psikyo4_vidregs[1] & 0x00400000; - - while (listcntr < listlen) - { - UINT16 listdat = list[listcntr ^ 1]; - UINT16 sprnum = (listdat & 0x03ff) << 1; - - UINT16 thisscreen = 0; - if ((listdat & 0x2000) == (UINT16)scr) thisscreen = 1; - - if (!(listdat & 0x8000) && thisscreen) - { - INT32 xstart, ystart, xend, yend, xinc, yinc, loopnum=0; - - INT32 ypos = (source[sprnum+0] & 0x03ff0000) >> 16; - INT32 xpos = (source[sprnum+0] & 0x000003ff); - INT32 high = (source[sprnum+0] >> 28) + 1; - INT32 wide = ((source[sprnum+0] & 0x0000f000) >> 12) + 1; - INT32 tnum = (source[sprnum+1] & 0x0007ffff); - INT32 colr = (source[sprnum+1] & 0x3f000000) >> 24; - - UINT32 flipx = (source[sprnum+1] & 0x40000000); - UINT32 flipy = (source[sprnum+1] & 0x80000000); - - if (ypos & 0x200) ypos -= 0x400; - if (xpos & 0x200) xpos -= 0x400; - if (scr) colr += 0x040; - - if ((!scr && flipscreen1) || (scr && flipscreen2)) - { - ypos = nScreenHeight - ypos - high*16; - xpos = 40*8 - xpos - wide*16; - flipx = !flipx; - flipy = !flipy; - } - - if (flipx) { xstart = wide-1; xend = -1; xinc = -1; } - else { xstart = 0; xend = wide; xinc = +1; } - - if (flipy) { ystart = high-1; yend = -1; yinc = -1; } - else { ystart = 0; yend = high; yinc = +1; } - - for (INT32 j = ystart; j != yend; j += yinc) { - for (INT32 i = xstart; i != xend; i += xinc, loopnum++) { - INT32 sx = xpos+16*i; - INT32 sy = ypos+16*j; - INT32 code = tnum + loopnum; - - if (sx < -15 || sx >= 320 || sy < -15 || sy >= nScreenHeight || nGfxMask < code) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(dest, code, sx, sy, colr, 5, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_FlipY_Clip(dest, code, sx, sy, colr, 5, 0, 0, DrvGfxROM); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(dest, code, sx, sy, colr, 5, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_Clip(dest, code, sx, sy, colr, 5, 0, 0, DrvGfxROM); - } - } - } - } - } - - listcntr++; - if (listdat & 0x4000) break; - } -} - -static void DrvDoPalette(UINT32 *dst, INT32 c) -{ - UINT8 r,g,b; - UINT32 *p = (UINT32*)DrvPalRAM; - for (INT32 i = 0; i < 0x2000 / 4; i++) { - r = p[i] >> 24; - g = p[i] >> 16; - b = p[i] >> 8; - - if (c == 0x7f) { - dst[i] = BurnHighCol(r, g, b, 0); - } else { - dst[i] = BurnHighCol((r * c) / 0x7f, (g * c) / 0x7f, (b * c) / 0x7f, 0); - } - } -} - -static void DrvRecalcPalette() -{ - UINT32 *p = (UINT32*)DrvPalRAM; - - DrvDoPalette(DrvPalette + 0x000, DrvBrightVal[0]); - DrvDoPalette(DrvPalette + 0x800, DrvBrightVal[1]); - - DrvPalette[0x1000] = BurnHighCol(p[0x800] >> 24, p[0x800] >> 16, p[0x800] >> 8, 0); - DrvPalette[0x1001] = BurnHighCol(p[0x801] >> 24, p[0x801] >> 16, p[0x801] >> 8, 0); -} - -static INT32 DrvDraw() -{ - DrvRecalcPalette(); - BurnTransferClear(); - - for (INT32 y = 0; y < nScreenHeight; y++) { - for (INT32 x = 0; x < 320; x++) { - pTransDraw[y * 640 + x] = 0x1000; - pTempDraw[y * 320+x] = 0x1001; - } - } - - nScreenWidth = 640; - draw_sprites(pTransDraw, 0x0000); // left screen - - nScreenWidth = 320; - draw_sprites(pTempDraw, 0x2000); // right screen - - nScreenWidth = 640; - for (INT32 y = 0; y < nScreenHeight; y++) { - memcpy (pTransDraw + y * 640 + 320, pTempDraw + y * 320, 320 * sizeof(INT16)); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - Sh2NewFrame(); - - { - if (mahjong) { - memset (DrvMahs, 0xff, 10); - DrvMahs[0] = (~0x60) | (DrvDips[0] & 0x60); - for (INT32 i = 0; i < 8; i++) { - DrvMahs[0] ^= (DrvMah1[i] & 1) << i; - DrvMahs[1] ^= (DrvMah2[i] & 1) << i; - DrvMahs[2] ^= (DrvMah3[i] & 1) << i; - DrvMahs[3] ^= (DrvMah4[i] & 1) << i; - DrvMahs[4] ^= (DrvMah5[i] & 1) << i; - DrvMahs[5] ^= (DrvMah6[i] & 1) << i; - DrvMahs[6] ^= (DrvMah7[i] & 1) << i; - DrvMahs[7] ^= (DrvMah8[i] & 1) << i; - DrvMahs[8] ^= (DrvMah9[i] & 1) << i; - } - } else { - DrvInputs[0] = (~0x60) | (DrvDips[0] & 0x60); - DrvInputs[1] = ~0; - for (INT32 i = 0; i < 32; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - } - - BurnTimerEndFrame(28636350 / 60); - Sh2SetIRQLine(4, CPU_IRQSTATUS_AUTO); - Sh2Run(0); - Sh2SetIRQLine(4, CPU_IRQSTATUS_NONE); - if (pBurnSoundOut) { - BurnYMF278BUpdate(nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.nAddress = 0; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - Sh2Scan(nAction); - BurnYMF278BScan(nAction, pnMin); - - SCAN_VAR(sample_offs); - } - - if (nAction & ACB_WRITE) { - set_pcm_bank(); - } - - return 0; -} - - -// Taisen Hot Gimmick (Japan) - -static struct BurnRomInfo hotgmckRomDesc[] = { - { "2-u23.bin", 0x080000, 0x23ed4aa5, 1 | BRF_PRG | BRF_ESS }, // 0 Sh2 Code - { "1-u22.bin", 0x080000, 0x5db3649f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "prog.bin", 0x200000, 0x500f6b1b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "0l.bin", 0x400000, 0x91f9ba60, 2 | BRF_GRA }, // 3 Sprites - { "0h.bin", 0x400000, 0xbfa800b7, 2 | BRF_GRA }, // 4 - { "1l.bin", 0x400000, 0x4b670809, 2 | BRF_GRA }, // 5 - { "1h.bin", 0x400000, 0xab513a4d, 2 | BRF_GRA }, // 6 - { "2l.bin", 0x400000, 0x1a7d51e9, 2 | BRF_GRA }, // 7 - { "2h.bin", 0x400000, 0xbf866222, 2 | BRF_GRA }, // 8 - { "3l.bin", 0x400000, 0xa8a646f7, 2 | BRF_GRA }, // 9 - { "3h.bin", 0x400000, 0x8c32becd, 2 | BRF_GRA }, // 10 - - { "snd0.bin", 0x400000, 0xc090d51a, 3 | BRF_SND }, // 11 Samples - { "snd1.bin", 0x400000, 0xc24243b5, 3 | BRF_SND }, // 12 -}; - -STD_ROM_PICK(hotgmck) -STD_ROM_FN(hotgmck) - -static INT32 HotgmckLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0100000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0800000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0800001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1800000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1800001, 10, 2)) return 1; - - if (BurnLoadRom(DrvSndBanks+ 0x0000000, 11, 1)) return 1; - if (BurnLoadRom(DrvSndBanks+ 0x0400000, 12, 1)) return 1; - - return 0; -} - -static INT32 HotgmckInit() -{ - mahjong = 1; - - return DrvInit(HotgmckLoadCallback, 0x2000000); -} - -struct BurnDriver BurnDrvHotgmck = { - "hotgmck", NULL, NULL, NULL, "1997", - "Taisen Hot Gimmick (Japan)\0", NULL, "Psikyo", "PS4", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PSIKYO, GBF_MAHJONG, 0, - NULL, hotgmckRomInfo, hotgmckRomName, NULL, NULL, HotgmckInputInfo, HotgmckDIPInfo, - HotgmckInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1002, - 640, 224, 8, 3 -}; - - -// Taisen Hot Gimmick Kairakuten (Japan) - -static struct BurnRomInfo hgkairakRomDesc[] = { - { "2.u23", 0x080000, 0x1c1a034d, 1 | BRF_PRG | BRF_ESS }, // 0 Sh2 Code - { "1.u22", 0x080000, 0x24b04aa2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "prog.u1", 0x100000, 0x83cff542, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "0l.u2", 0x400000, 0xf7472212, 2 | BRF_GRA }, // 3 Sprites - { "0h.u11", 0x400000, 0x30019d0f, 2 | BRF_GRA }, // 4 - { "1l.u3", 0x400000, 0xf46d5002, 2 | BRF_GRA }, // 5 - { "1h.u12", 0x400000, 0x210592b6, 2 | BRF_GRA }, // 6 - { "2l.u4", 0x400000, 0xb98adf21, 2 | BRF_GRA }, // 7 - { "2h.u13", 0x400000, 0x8e3da1e1, 2 | BRF_GRA }, // 8 - { "3l.u5", 0x400000, 0xfa7ba4ed, 2 | BRF_GRA }, // 9 - { "3h.u14", 0x400000, 0xa5d400ea, 2 | BRF_GRA }, // 10 - { "4l.u6", 0x400000, 0x76c10026, 2 | BRF_GRA }, // 11 - { "4h.u15", 0x400000, 0x799f0889, 2 | BRF_GRA }, // 12 - { "5l.u7", 0x400000, 0x4639ef36, 2 | BRF_GRA }, // 13 - { "5h.u16", 0x400000, 0x549e9e9e, 2 | BRF_GRA }, // 14 - - { "snd0.u10", 0x400000, 0x0e8e5fdf, 3 | BRF_SND }, // 15 Samples - { "snd1.u19", 0x400000, 0xd8057d2f, 3 | BRF_SND }, // 16 -}; - -STD_ROM_PICK(hgkairak) -STD_ROM_FN(hgkairak) - -static INT32 HgkairakLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0100000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0800000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0800001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1800000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1800001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2000000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2000001, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2800000, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2800001, 14, 2)) return 1; - - if (BurnLoadRom(DrvSndBanks+ 0x0000000, 15, 1)) return 1; - if (BurnLoadRom(DrvSndBanks+ 0x0400000, 16, 1)) return 1; - - return 0; -} - -static INT32 HgkairakInit() -{ - mahjong = 1; - - return DrvInit(HgkairakLoadCallback, 0x3000000); -} - -struct BurnDriver BurnDrvHgkairak = { - "hgkairak", NULL, NULL, NULL, "1998", - "Taisen Hot Gimmick Kairakuten (Japan)\0", NULL, "Psikyo", "PS4", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PSIKYO, GBF_MAHJONG, 0, - NULL, hgkairakRomInfo, hgkairakRomName, NULL, NULL, HotgmckInputInfo, HotgmckDIPInfo, - HgkairakInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1002, - 640, 224, 8, 3 -}; - - -// Taisen Hot Gimmick 3 Digital Surfing (Japan) - -static struct BurnRomInfo hotgmck3RomDesc[] = { - { "2.u22", 0x080000, 0x3b06a4a3, 1 | BRF_PRG | BRF_ESS }, // 0 Sh2 Code - { "1.u23", 0x080000, 0x7aad6b24, 1 | BRF_PRG | BRF_ESS }, // 1 - { "prog.u1", 0x100000, 0x316c3356, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "0l.u2", 0x400000, 0xd4bbd035, 2 | BRF_GRA }, // 3 Sprites - { "0h.u11", 0x400000, 0xe8832b0b, 2 | BRF_GRA }, // 4 - { "1l.u3", 0x400000, 0x08426cb2, 2 | BRF_GRA }, // 5 - { "1h.u12", 0x400000, 0x112c6eea, 2 | BRF_GRA }, // 6 - { "2l.u4", 0x400000, 0x0f197cd4, 2 | BRF_GRA }, // 7 - { "2h.u13", 0x400000, 0xfc37808c, 2 | BRF_GRA }, // 8 - { "3l.u5", 0x400000, 0xc4d094dc, 2 | BRF_GRA }, // 9 - { "3h.u14", 0x400000, 0xef0dad0a, 2 | BRF_GRA }, // 10 - { "4l.u6", 0x400000, 0x5186790f, 2 | BRF_GRA }, // 11 - { "4h.u15", 0x400000, 0x187a6f43, 2 | BRF_GRA }, // 12 - { "5l.u7", 0x400000, 0xecf151f3, 2 | BRF_GRA }, // 13 - { "5h.u16", 0x400000, 0x720bf4ec, 2 | BRF_GRA }, // 14 - { "6l.u8", 0x400000, 0xe490404d, 2 | BRF_GRA }, // 15 - { "6h.u17", 0x400000, 0x7e8a141a, 2 | BRF_GRA }, // 16 - { "7l.u9", 0x400000, 0x2ec78fb2, 2 | BRF_GRA }, // 17 - { "7h.u18", 0x400000, 0xc1735612, 2 | BRF_GRA }, // 18 - - { "snd0.u10", 0x400000, 0xd62a0dba, 3 | BRF_SND }, // 19 Samples - { "snd1.u19", 0x400000, 0x1df91fb4, 3 | BRF_SND }, // 20 -}; - -STD_ROM_PICK(hotgmck3) -STD_ROM_FN(hotgmck3) - -static INT32 Hotgmck3LoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 0, 2)) return 1; // swapped - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 1, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0100000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0800000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0800001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1800000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1800001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2000000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2000001, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2800000, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x2800001, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x3000000, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x3000001, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x3800000, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x3800001, 18, 2)) return 1; - - if (BurnLoadRom(DrvSndBanks+ 0x0000000, 19, 1)) return 1; - if (BurnLoadRom(DrvSndBanks+ 0x0400000, 20, 1)) return 1; - - return 0; -} - -static INT32 Hotgmck3Init() -{ - mahjong = 1; - - return DrvInit(Hotgmck3LoadCallback, 0x4000000); -} - -struct BurnDriver BurnDrvHotgmck3 = { - "hotgmck3", NULL, NULL, NULL, "1999", - "Taisen Hot Gimmick 3 Digital Surfing (Japan)\0", NULL, "Psikyo", "PS4", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PSIKYO, GBF_MAHJONG, 0, - NULL, hotgmck3RomInfo, hotgmck3RomName, NULL, NULL, HotgmckInputInfo, HotgmckDIPInfo, - Hotgmck3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1002, - 640, 224, 8, 3 -}; - - -// Taisen Hot Gimmick 4 Ever (Japan) - -static struct BurnRomInfo hotgm4evRomDesc[] = { - { "2.u22", 0x080000, 0x3334c21e, 1 | BRF_PRG | BRF_ESS }, // 0 Sh2 Code - { "1.u23", 0x080000, 0xb1a1c643, 1 | BRF_PRG | BRF_ESS }, // 1 - { "prog.u1", 0x400000, 0xad556d8e, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "0l.u2", 0x400000, 0xf65986f7, 2 | BRF_GRA }, // 3 Sprites - { "0h.u11", 0x400000, 0x51fd07a9, 2 | BRF_GRA }, // 4 - { "1l.u3", 0x400000, 0xf59d21d7, 2 | BRF_GRA }, // 5 - { "1h.u12", 0x400000, 0x60ea4797, 2 | BRF_GRA }, // 6 - { "2l.u4", 0x400000, 0xfbaf05e3, 2 | BRF_GRA }, // 7 - { "2h.u13", 0x400000, 0x61281612, 2 | BRF_GRA }, // 8 - { "3l.u5", 0x400000, 0xe2e1bd9f, 2 | BRF_GRA }, // 9 - { "3h.u14", 0x400000, 0xc4426542, 2 | BRF_GRA }, // 10 - { "4l.u6", 0x400000, 0x7298a242, 2 | BRF_GRA }, // 11 - { "4h.u15", 0x400000, 0xfe91b459, 2 | BRF_GRA }, // 12 - { "5l.u7", 0x400000, 0xcc714a7d, 2 | BRF_GRA }, // 13 - { "5h.u16", 0x400000, 0x2f149cf9, 2 | BRF_GRA }, // 14 - { "6l.u8", 0x400000, 0xbfe97dfe, 2 | BRF_GRA }, // 15 - { "6h.u17", 0x400000, 0x3473052a, 2 | BRF_GRA }, // 16 - { "7l.u9", 0x400000, 0x022a8a31, 2 | BRF_GRA }, // 17 - { "7h.u18", 0x400000, 0x77e47409, 2 | BRF_GRA }, // 18 - - { "snd0.u10", 0x400000, 0x051e2fed, 3 | BRF_SND }, // 19 Samples - { "snd1.u19", 0x400000, 0x0de0232d, 3 | BRF_SND }, // 20 -}; - -STD_ROM_PICK(hotgm4ev) -STD_ROM_FN(hotgm4ev) - -struct BurnDriver BurnDrvHotgm4ev = { - "hotgm4ev", NULL, NULL, NULL, "2000", - "Taisen Hot Gimmick 4 Ever (Japan)\0", NULL, "Psikyo", "PS4", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PSIKYO, GBF_MAHJONG, 0, - NULL, hotgm4evRomInfo, hotgm4evRomName, NULL, NULL, HotgmckInputInfo, HotgmckDIPInfo, - Hotgmck3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1002, - 640, 224, 8, 3 -}; - - -// Mahjong Hot Gimmick Integral (Japan) - -static struct BurnRomInfo hotgmckiRomDesc[] = { - { "2.u22", 0x080000, 0xabc192dd, 1 | BRF_PRG | BRF_ESS }, // 0 Sh2 Code - { "1.u23", 0x080000, 0x8be896d0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "prog.u1", 0x200000, 0x9017ae8e, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "0l.u2", 0x200000, 0x58ae45eb, 2 | BRF_GRA }, // 3 Sprites - { "0h.u11", 0x200000, 0xd7bbb929, 2 | BRF_GRA }, // 4 - { "1l.u3", 0x200000, 0x27576360, 2 | BRF_GRA }, // 5 - { "1h.u12", 0x200000, 0x7439a63f, 2 | BRF_GRA }, // 6 - { "2l.u4", 0x200000, 0xfda64e24, 2 | BRF_GRA }, // 7 - { "2h.u13", 0x200000, 0x8be54ea6, 2 | BRF_GRA }, // 8 - { "3l.u5", 0x200000, 0x92507b3f, 2 | BRF_GRA }, // 9 - { "3h.u14", 0x200000, 0x042bef5e, 2 | BRF_GRA }, // 10 - { "4l.u6", 0x200000, 0x023b6d70, 2 | BRF_GRA }, // 11 - { "4h.u15", 0x200000, 0x9be7e8b1, 2 | BRF_GRA }, // 12 - { "5l.u7", 0x200000, 0x7aa54306, 2 | BRF_GRA }, // 13 - { "5h.u16", 0x200000, 0xe6b48e52, 2 | BRF_GRA }, // 14 - { "6l.u8", 0x200000, 0xdfe675e9, 2 | BRF_GRA }, // 15 - { "6h.u17", 0x200000, 0x45919576, 2 | BRF_GRA }, // 16 - { "7l.u9", 0x200000, 0xcd3af598, 2 | BRF_GRA }, // 17 - { "7h.u18", 0x200000, 0xa3fd4ae5, 2 | BRF_GRA }, // 18 - - { "snd0.u10", 0x400000, 0x5f275f35, 3 | BRF_SND }, // 19 Samples - { "snd1.u19", 0x400000, 0x98608779, 3 | BRF_SND }, // 20 -}; - -STD_ROM_PICK(hotgmcki) -STD_ROM_FN(hotgmcki) - -static INT32 HotgmckiLoadCallback() -{ - if (Hotgmck3LoadCallback()) return 1; - - // mirror gfx roms - for (INT32 i = 0; i < 0x4000000; i += 0x0800000) { - memcpy (DrvGfxROM + 0x0400000 + i, DrvGfxROM + i, 0x0400000); - } - - return 0; -} - -static INT32 HotgmckiInit() -{ - mahjong = 1; - - return DrvInit(HotgmckiLoadCallback, 0x4000000); -} - -struct BurnDriver BurnDrvHotgmcki = { - "hotgmcki", NULL, NULL, NULL, "2001", - "Mahjong Hot Gimmick Integral (Japan)\0", NULL, "Psikyo", "PS4", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PSIKYO, GBF_MAHJONG, 0, - NULL, hotgmckiRomInfo, hotgmckiRomName, NULL, NULL, HotgmckInputInfo, HotgmckDIPInfo, - HotgmckiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1002, - 640, 224, 8, 3 -}; - - -// Lode Runner - The Dig Fight (ver. B) - -static struct BurnRomInfo loderndfRomDesc[] = { - { "1b.u23", 0x080000, 0xfae92286, 1 | BRF_PRG | BRF_ESS }, // 0 Sh2 Code - { "2b.u22", 0x080000, 0xfe2424c0, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "0l.u2", 0x800000, 0xccae855d, 2 | BRF_GRA }, // 2 Sprites - { "0h.u11", 0x800000, 0x7a146c59, 2 | BRF_GRA }, // 3 - { "1l.u3", 0x800000, 0x7a9cd21e, 2 | BRF_GRA }, // 4 - { "1h.u12", 0x800000, 0x78f40d0d, 2 | BRF_GRA }, // 5 - - { "snd0.u10", 0x800000, 0x2da3788f, 3 | BRF_SND }, // 6 Samples -}; - -STD_ROM_PICK(loderndf) -STD_ROM_FN(loderndf) - -static INT32 LoderndfLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000000, 6, 1)) return 1; - memcpy (DrvSndROM, DrvGfxROM, 0x400000); // otherwise we have to waste 4mb - - if (BurnLoadRom(DrvGfxROM + 0x0000000, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000001, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000001, 5, 2)) return 1; - - return 0; -} - -static INT32 LoderndfInit() -{ - speedhack_address = 0x0020; - speedhack_pc[0] = 0x00001B3E; - speedhack_pc[1] = 0x00001B40; - - return DrvInit(LoderndfLoadCallback, 0x2000000); -} - -struct BurnDriver BurnDrvLoderndf = { - "loderndf", NULL, NULL, NULL, "2000", - "Lode Runner - The Dig Fight (ver. B)\0", NULL, "Psikyo", "PS4", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PSIKYO, GBF_PLATFORM, 0, - NULL, loderndfRomInfo, loderndfRomName, NULL, NULL, LoderndfInputInfo, LoderndfDIPInfo, - LoderndfInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1002, - 640, 240, 8, 3 -}; - - -// Lode Runner - The Dig Fight (ver. A) - -static struct BurnRomInfo loderndfaRomDesc[] = { - { "12.u23", 0x080000, 0x661d372e, 1 | BRF_PRG | BRF_ESS }, // 0 Sh2 Code - { "3.u22", 0x080000, 0x0a63529f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "0l.u2", 0x800000, 0xccae855d, 2 | BRF_GRA }, // 2 Sprites - { "0h.u11", 0x800000, 0x7a146c59, 2 | BRF_GRA }, // 3 - { "1l.u3", 0x800000, 0x7a9cd21e, 2 | BRF_GRA }, // 4 - { "1h.u12", 0x800000, 0x78f40d0d, 2 | BRF_GRA }, // 5 - - { "snd0.u10", 0x800000, 0x2da3788f, 3 | BRF_SND }, // 6 Samples -}; - -STD_ROM_PICK(loderndfa) -STD_ROM_FN(loderndfa) - -static INT32 LoderndfaInit() -{ - speedhack_address = 0x0020; - speedhack_pc[0] = 0x00001B4A; - speedhack_pc[1] = 0x00001B4C; - - return DrvInit(LoderndfLoadCallback, 0x2000000); -} - -struct BurnDriver BurnDrvLoderndfa = { - "loderndfa", "loderndf", NULL, NULL, "2000", - "Lode Runner - The Dig Fight (ver. A)\0", NULL, "Psikyo", "PS4", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PSIKYO, GBF_PLATFORM, 0, - NULL, loderndfaRomInfo, loderndfaRomName, NULL, NULL, LoderndfInputInfo, LoderndfDIPInfo, - LoderndfaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1002, - 640, 240, 8, 3 -}; - - -// Quiz de Idol! Hot Debut (Japan) - -static struct BurnRomInfo hotdebutRomDesc[] = { - { "1.u23", 0x080000, 0x0b0d0027, 1 | BRF_PRG | BRF_ESS }, // 0 Sh2 Code - { "2.u22", 0x080000, 0xc3b5180b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "0l.u2", 0x400000, 0x15da9983, 2 | BRF_GRA }, // 2 Sprites - { "0h.u11", 0x400000, 0x76d7b73f, 2 | BRF_GRA }, // 3 - { "1l.u3", 0x400000, 0x76ea3498, 2 | BRF_GRA }, // 4 - { "1h.u12", 0x400000, 0xa056859f, 2 | BRF_GRA }, // 5 - { "2l.u4", 0x400000, 0x9d2d1bb1, 2 | BRF_GRA }, // 6 - { "2h.u13", 0x400000, 0xa7753c4d, 2 | BRF_GRA }, // 7 - - { "snd0.u10", 0x400000, 0xeef28aa7, 3 | BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(hotdebut) -STD_ROM_FN(hotdebut) - -static INT32 HotdebutLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000000, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000001, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0800000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0800001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1000001, 7, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 8, 1)) return 1; - - return 0; -} - -static INT32 HotdebutInit() -{ - speedhack_address = 0x0001c; - speedhack_pc[0] = 0x000029EE; - speedhack_pc[1] = 0x000029F0; - - return DrvInit(HotdebutLoadCallback, 0x1800000); -} - -struct BurnDriver BurnDrvHotdebut = { - "hotdebut", NULL, NULL, NULL, "2000", - "Quiz de Idol! Hot Debut (Japan)\0", NULL, "Psikyo / Moss", "PS4", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_PSIKYO, GBF_QUIZ, 0, - NULL, hotdebutRomInfo, hotdebutRomName, NULL, NULL, HotdebutInputInfo, HotdebutDIPInfo, - HotdebutInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1002, - 640, 240, 8, 3 -}; diff --git a/jan/src/burn/drv/psikyo/d_psikyosh.cpp b/jan/src/burn/drv/psikyo/d_psikyosh.cpp deleted file mode 100644 index 8f4d91adf..000000000 --- a/jan/src/burn/drv/psikyo/d_psikyosh.cpp +++ /dev/null @@ -1,1665 +0,0 @@ -// FB Alpha Psikyo Sh2-based hardware driver module -// Based on MAME driver by Paul Priest, David Haywood - -// To do! -// implement background zooming update. - - -#include "tiles_generic.h" -#include "psikyosh_render.h" -#include "burn_ymf278b.h" -#include "eeprom.h" -#include "sh2_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvSh2ROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvEEPROM; -static UINT8 *DrvSh2RAM; -static UINT8 *DrvZoomRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvBgRAM; -static UINT8 *DrvVidRegs; - -static INT32 sample_offs; - -static INT32 graphics_min_max[2]; -static INT32 previous_graphics_bank; - -static UINT32 speedhack_address = ~0; -static UINT32 speedhack_pc[4] = { 0, 0, 0, 0 }; - -static UINT8 DrvReset; -static UINT32 DrvInputs; -static UINT8 DrvDips[2]; -static UINT8 DrvJoy1[32]; - -static struct BurnInputInfo Common2ButtonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 24, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 31, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 30, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 28, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 29, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 27, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 26, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 16, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 23, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 22, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 20, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 21, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 19, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 18, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common2Button) - -static struct BurnInputInfo Common3ButtonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 24, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 31, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 30, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 28, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 29, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 27, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 26, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 25, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 16, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 23, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 22, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 20, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 21, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 19, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 18, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 17, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common3Button) - -static struct BurnInputInfo Common4ButtonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 24, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 31, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 30, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 28, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 29, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 27, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 26, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 15, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 14, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 16, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 23, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 22, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 20, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 21, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 19, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 18, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 11, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy1 + 10, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common4Button) - -static struct BurnDIPInfo DarakuDIPList[]= -{ - {0x16, 0xff, 0xff, 0x60, NULL }, - {0x17, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Region" }, - {0x17, 0x01, 0x01, 0x00, "Japan" }, - {0x17, 0x01, 0x01, 0x01, "World" }, -}; - -STDDIPINFO(Daraku) - -static struct BurnDIPInfo S1945iiDIPList[]= -{ - {0x12, 0xff, 0xff, 0x60, NULL }, - {0x13, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Region" }, - {0x13, 0x01, 0x01, 0x00, "Japan" }, - {0x13, 0x01, 0x01, 0x01, "World" }, -}; - -STDDIPINFO(S1945ii) - -static struct BurnDIPInfo DragnblzDIPList[]= -{ - {0x14, 0xff, 0xff, 0x20, NULL }, - {0x15, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Debug" }, -// {0x14, 0x01, 0x40, 0x40, "Off" }, -// {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Region" }, - {0x15, 0x01, 0x01, 0x00, "Japan" }, - {0x15, 0x01, 0x01, 0x01, "World" }, -}; - -STDDIPINFO(Dragnblz) - -static struct BurnDIPInfo SoldividDIPList[]= -{ - {0x14, 0xff, 0xff, 0x60, NULL }, - {0x15, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Region" }, - {0x15, 0x01, 0x01, 0x00, "Japan" }, - {0x15, 0x01, 0x01, 0x01, "World" }, -}; - -STDDIPINFO(Soldivid) - -static struct BurnDIPInfo SoldividkDIPList[]= -{ - {0x14, 0xff, 0xff, 0x60, NULL }, - {0x15, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Region" }, /* Game is hard coded to Korea */ -// {0x15, 0x01, 0x01, 0x00, "Japan" }, -// {0x15, 0x01, 0x01, 0x01, "World" }, -}; - -STDDIPINFO(Soldividk) - -static struct BurnDIPInfo Gunbird2DIPList[]= -{ - {0x14, 0xff, 0xff, 0x60, NULL }, - {0x15, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Region" }, - {0x15, 0x01, 0x03, 0x00, "Japan" }, - {0x15, 0x01, 0x03, 0x01, "International Ver A." }, - {0x15, 0x01, 0x03, 0x02, "International Ver B." }, -}; - -STDDIPINFO(Gunbird2) - -static struct BurnDIPInfo S1945iiiDIPList[]= -{ - {0x14, 0xff, 0xff, 0x60, NULL }, - {0x15, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Region" }, - {0x15, 0x01, 0x03, 0x00, "Japan" }, - {0x15, 0x01, 0x03, 0x02, "International Ver A." }, - {0x15, 0x01, 0x03, 0x01, "International Ver B." }, -}; - -STDDIPINFO(S1945iii) - -static struct BurnDIPInfo Tgm2DIPList[]= -{ - {0x14, 0xff, 0xff, 0x60, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Tgm2) - -//------------------------------------------------------------------------------------- - -#ifndef LSB_FIRST -static void le_to_be(unsigned char * p, int size) -{ - unsigned char c; - for(int i=0; i= graphics_min_max[1]) - bank = graphics_min_max[1] - graphics_min_max[0]; - - Sh2MapMemory(pPsikyoshTiles + bank, 0x3060000, 0x307ffff, MAP_ROM); - Sh2MapMemory(pPsikyoshTiles + bank, 0x4060000, 0x407ffff, MAP_ROM); - } -} - -void __fastcall psx_write_long(UINT32 , UINT32) -{ - // Keep sh2 from crashing with Space Bomber -} - -void __fastcall ps3v1_write_word(UINT32 address, UINT16 data) -{ - address &= 0xc7ffffff; -#ifdef LSB_FIRST - address ^= 2; -#endif - - if ((address & 0xfffffe00) == 0x3050000) { - *((UINT16 *)(DrvZoomRAM + (address & 0x1fe))) = data; - return; - } -} - -void __fastcall ps3v1_write_byte(UINT32 address, UINT8 data) -{ - address &= 0xc7ffffff; - - if ((address & 0xfffffe00) == 0x3050000) { -#ifdef LSB_FIRST - address ^= 3; -#endif - DrvZoomRAM[address & 0x1ff] = data; - return; - } - - if ((address & 0xffffffe0) == 0x305ffe0) { -#ifdef LSB_FIRST - address ^= 3; -#endif - DrvVidRegs[address & 0x1f] = data; - DrvZoomRAM[address & 0xffff] = data; - - if ((address & 0x1c) == 0x10) { - graphics_bank(); - } - - return; - } - - switch (address) - { - case 0x305ffdc: - case 0x305ffdd: - if (!(data & 0xc0)) Sh2SetIRQLine(4, CPU_IRQSTATUS_NONE); - return; - - case 0x5000000: - case 0x5000002: - case 0x5000004: - case 0x5000006: - BurnYMF278BSelectRegister((address >> 1) & 3, data); - return; - - case 0x5000001: - case 0x5000003: - case 0x5000005: - case 0x5000007: - BurnYMF278BWriteRegister((address >> 1) & 3, data); - return; - - case 0x5800004: - EEPROMWrite((data & 0x40), (data & 0x80), (data & 0x20)); - return; - } -} - -UINT8 __fastcall ps3v1_read_byte(UINT32 address) -{ - address &= 0xc7ffffff; - - switch (address) - { - case 0x5000000: - return BurnYMF278BReadStatus(); - - case 0x5800000: - case 0x5800001: - case 0x5800002: - case 0x5800003: - return DrvInputs >> ((~address & 3) << 3); - - case 0x5800004: - return DrvDips[1] | ((EEPROMRead() & 1) << 4); - - case 0x5000005: - return DrvSndROM[(sample_offs++) & 0x3fffff]; - } - - return 0; -} - -//----------------------------------------------------------------------------------------- - -void __fastcall ps5_write_word(UINT32 address, UINT16 data) -{ - address &= 0xc7ffffff; -#ifdef LSB_FIRST - address ^= 2; -#endif - - if ((address & 0xfffffe00) == 0x4050000) { - *((UINT16 *)(DrvZoomRAM + (address & 0x1fe))) = data; - return; - } -} - -void __fastcall ps5_write_byte(UINT32 address, UINT8 data) -{ - address &= 0xc7ffffff; - - if ((address & 0xfffffe00) == 0x4050000) { -#ifdef LSB_FIRST - address ^= 3; -#endif - DrvZoomRAM[address & 0x1ff] = data; - return; - } - - if ((address & 0xffffffe0) == 0x405ffe0) { -#ifdef LSB_FIRST - address ^= 3; -#endif - DrvVidRegs[address & 0x1f] = data; - DrvZoomRAM[address & 0xffff] = data; - - if ((address & 0x1c) == 0x10) { - graphics_bank(); - } - - return; - } - - switch (address) - { - case 0x405ffdd: - if (!(data & 0xc0)) Sh2SetIRQLine(4, CPU_IRQSTATUS_NONE); - return; - - case 0x3100000: - case 0x3100002: - case 0x3100004: - case 0x3100006: - BurnYMF278BSelectRegister((address >> 1) & 3, data); - return; - - case 0x3100001: - case 0x3100003: - case 0x3100005: - case 0x3100007: - BurnYMF278BWriteRegister((address >> 1) & 3, data); - return; - - case 0x3000004: - EEPROMWrite((data & 0x40), (data & 0x80), (data & 0x20)); - return; - } -} - -UINT8 __fastcall ps5_read_byte(UINT32 address) -{ - address &= 0xc7ffffff; - - switch (address) - { - case 0x3100000: - return BurnYMF278BReadStatus(); - - case 0x3000000: - case 0x3000001: - case 0x3000002: - case 0x3000003: - return DrvInputs >> ((~address & 3) << 3); - - case 0x3000004: - return DrvDips[1] | ((EEPROMRead() & 1) << 4); - - case 0x3100005: - return DrvSndROM[(sample_offs++) & 0x3fffff]; - } - - return 0; -} - -//------------------------------------------------------------------------------------- -// Some hackery to eat up some idle cycles. - -UINT32 __fastcall hack_read_long(UINT32 a) -{ - a &= 0xfffff; - - if (a == speedhack_address) { - UINT32 pc = Sh2GetPC(0); - - if (pc == speedhack_pc[0]) { - Sh2BurnUntilInt(0); - } else if (pc == speedhack_pc[1]) { - Sh2BurnUntilInt(0); - } else if (pc == speedhack_pc[2]) { - Sh2BurnUntilInt(0); - } else if (pc == speedhack_pc[3]) { - Sh2BurnUntilInt(0); - } - } - - return *((UINT32*)(DrvSh2RAM + a)); -} - -UINT16 __fastcall hack_read_word(UINT32 a) -{ -#ifdef LSB_FIRST - return *((UINT16 *)(DrvSh2RAM + ((a & 0xfffff) ^ 2))); -#else - return *((UINT16 *)(DrvSh2RAM + ((a & 0xfffff)))); -#endif -} - -UINT8 __fastcall hack_read_byte(UINT32 a) -{ -#ifdef LSB_FIRST - return DrvSh2RAM[(a & 0xfffff) ^ 3]; -#else - return DrvSh2RAM[(a & 0xfffff)]; -#endif -} - -//------------------------------------------------------------------------------------- - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)Sh2TotalCycles() * nSoundRate / 28636350; -} - -static void DrvIRQCallback(INT32, INT32 nStatus) -{ - if (nStatus) - Sh2SetIRQLine(12, CPU_IRQSTATUS_AUTO); - else - Sh2SetIRQLine(12, CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDoReset() -{ - Sh2Reset(); - - memset (AllRam, 0, RamEnd - AllRam); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvEEPROM, 0, 0x100); - } - - BurnYMF278BReset(); - - sample_offs = 0; - previous_graphics_bank = -1; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex(INT32 gfxsize) -{ - UINT8 *Next; Next = AllMem; - - DrvSh2ROM = Next; Next += 0x0200000; - - pPsikyoshTiles = Next; Next += gfxsize + 0x20000 /* empty banking */; - - DrvSndROM = Next; Next += 0x0400000; - - DrvEEPROM = Next; Next += 0x0000100; - - AllRam = Next; - - DrvZoomRAM = Next; Next += 0x0010000; - DrvPalRAM = Next; Next += 0x0010000; - DrvSprRAM = Next; Next += 0x0010000; - DrvVidRegs = Next; Next += 0x0000200; - DrvSh2RAM = Next; Next += 0x0100000; - DrvSprBuf = Next; Next += 0x0004000; - - RamEnd = Next; - - pBurnDrvPalette = (UINT32 *)Next; Next += 0x1400 * sizeof(UINT32); - - DrvBgRAM = DrvSprRAM + 0x004000; - - pPsikyoshPalRAM = (UINT32*)DrvPalRAM; - pPsikyoshSpriteBuffer = (UINT32*)DrvSprBuf; - pPsikyoshBgRAM = (UINT32*)DrvBgRAM; - pPsikyoshVidRegs = (UINT32*)DrvVidRegs; - pPsikyoshZoomRAM = (UINT32*)DrvZoomRAM; - - MemEnd = Next; - - return 0; -} - -static const eeprom_interface eeprom_interface_93C56 = -{ - 8, // address bits 8 - 8, // data bits 8 - "*110x", // read 110x aaaaaaaa - "*101x", // write 101x aaaaaaaa dddddddd - "*111x", // erase 111x aaaaaaaa - "*10000xxxxxxx", // lock 100x 00xxxx - "*10011xxxxxxx", // unlock 100x 11xxxx - 0, - 0 -}; - -static void BurnSwap32(UINT8 *src, INT32 len) -{ - for (INT32 i = 0; i < len; i+=4) { - INT32 t = src[i+1]; - src[i+1] = src[i+2]; - src[i+2] = t; - } -} - -static void BurnSwapEndian(INT32 len) -{ - BurnByteswap(DrvSh2ROM, 0x200000); - - for (INT32 i = 0; i < len; i+=4) { - INT32 t = DrvSh2ROM[i + 0]; - DrvSh2ROM[i + 0] = DrvSh2ROM[i+3]; - DrvSh2ROM[i + 3] = t; - t = DrvSh2ROM[i + 1]; - DrvSh2ROM[i + 1] = DrvSh2ROM[i + 2]; - DrvSh2ROM[i + 2] = t; - } -} - -static void DrvGfxDecode(INT32 size) -{ - BurnSwap32(pPsikyoshTiles, size); - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "soldivid") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "soldividk") == 0) { - BurnByteswap(pPsikyoshTiles, size); - } -} - -static INT32 DrvInit(INT32 (*LoadCallback)(), INT32 type, INT32 gfx_max, INT32 gfx_min) -{ - AllMem = NULL; - MemIndex(gfx_max - gfx_min); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(gfx_max - gfx_min); - - { - if (LoadCallback) { - if (LoadCallback()) return 1; - } - - BurnSwap32(DrvSh2ROM, 0x100000); -#ifndef LSB_FIRST - le_to_be(DrvSh2ROM,0x200000); -#endif - BurnSwapEndian(0x200000); - DrvGfxDecode(gfx_max - gfx_min); - graphics_min_max[0] = gfx_min; - graphics_min_max[1] = gfx_max; - } - - if (type == 0) - { - Sh2Init(1); - Sh2Open(0); - Sh2MapMemory(DrvSh2ROM, 0x00000000, 0x000fffff, MAP_ROM); - Sh2MapMemory(DrvSh2ROM + 0x100000, 0x02000000, 0x020fffff, MAP_ROM); - Sh2MapMemory(DrvSprRAM, 0x03000000, 0x0300ffff, MAP_RAM); - Sh2MapMemory(DrvPalRAM, 0x03040000, 0x0304ffff, MAP_RAM); - Sh2MapMemory(DrvZoomRAM, 0x03050000, 0x0305ffff, MAP_ROM); - Sh2MapMemory(DrvSh2RAM, 0x06000000, 0x060fffff, MAP_RAM); - Sh2SetReadByteHandler (0, ps3v1_read_byte); - Sh2SetWriteByteHandler(0, ps3v1_write_byte); - Sh2SetWriteWordHandler(0, ps3v1_write_word); - Sh2SetWriteLongHandler(0, psx_write_long); - } else { - Sh2Init(1); - Sh2Open(0); - Sh2MapMemory(DrvSh2ROM, 0x00000000, 0x000fffff, MAP_ROM); - Sh2MapMemory(DrvSprRAM, 0x04000000, 0x0400ffff, MAP_RAM); - Sh2MapMemory(DrvPalRAM, 0x04040000, 0x0404ffff, MAP_RAM); - Sh2MapMemory(DrvZoomRAM, 0x04050000, 0x0405ffff, MAP_ROM); - Sh2MapMemory(DrvSh2ROM + 0x100000, 0x05000000, 0x0507ffff, MAP_ROM); - Sh2MapMemory(DrvSh2RAM, 0x06000000, 0x060fffff, MAP_RAM); - Sh2SetReadByteHandler (0, ps5_read_byte); - Sh2SetWriteByteHandler(0, ps5_write_byte); - Sh2SetWriteWordHandler(0, ps5_write_word); - Sh2SetWriteLongHandler(0, psx_write_long); - } - - Sh2MapHandler(1, 0x06000000 | speedhack_address, 0x0600ffff | speedhack_address, MAP_ROM); - Sh2SetReadByteHandler (1, hack_read_byte); - Sh2SetReadWordHandler (1, hack_read_word); - Sh2SetReadLongHandler (1, hack_read_long); - - BurnYMF278BInit(0, DrvSndROM, 0x400000, &DrvIRQCallback, DrvSynchroniseStream); - BurnYMF278BSetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - BurnTimerAttachSh2(28636350); - - EEPROMInit(&eeprom_interface_93C56); - - PsikyoshVideoInit(gfx_max, gfx_min); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - PsikyoshVideoExit(); - - Sh2Exit(); - BurnYMF278BExit(); - - EEPROMExit(); - - BurnFree(AllMem); - - speedhack_address = ~0; - memset (speedhack_pc, 0, 4 * sizeof(UINT32)); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - Sh2NewFrame(); - - { - DrvInputs = ~0x60 | (DrvDips[0] & 0x60); - for (INT32 i = 0; i < 32; i++) { - DrvInputs ^= (DrvJoy1[i] & 1) << i; - } - } - - BurnTimerEndFrame(28636350 / 60); - - Sh2SetIRQLine(4, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - BurnYMF278BUpdate(nBurnSoundLen); - } - - if (pBurnDraw) { - PsikyoshDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x4000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.nAddress = 0; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - Sh2Scan(nAction); - BurnYMF278BScan(nAction, pnMin); - - SCAN_VAR(sample_offs); - } - - if (nAction & ACB_WRITE) { - previous_graphics_bank = -1; - graphics_bank(); - } - - return 0; -} - - -// Sol Divide - The Sword Of Darkness - -static struct BurnRomInfo soldividRomDesc[] = { - { "2-prog_l.u18", 0x080000, 0xcf179b04, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "1-prog_h.u17", 0x080000, 0xf467d1c4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "4l.u10", 0x400000, 0x9eb9f269, 2 | BRF_GRA }, // 2 Graphics - { "4h.u31", 0x400000, 0x7c76cfe7, 2 | BRF_GRA }, // 3 - { "5l.u9", 0x400000, 0xc59c6858, 2 | BRF_GRA }, // 4 - { "5h.u30", 0x400000, 0x73bc66d0, 2 | BRF_GRA }, // 5 - { "6l.u8", 0x400000, 0xf01b816e, 2 | BRF_GRA }, // 6 - { "6h.u37", 0x400000, 0xfdd57361, 2 | BRF_GRA }, // 7 - - { "sound.bin", 0x400000, 0xe98f8d45, 3 | BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(soldivid) -STD_ROM_FN(soldivid) - -static int SoldividLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(pPsikyoshTiles + 0x2000000 - 0x2000000, 2, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000001 - 0x2000000, 3, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2800000 - 0x2000000, 4, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2800001 - 0x2000000, 5, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x3000000 - 0x2000000, 6, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x3000001 - 0x2000000, 7, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 8, 1)) return 1; - - return 0; -} - -static INT32 SoldividInit() -{ - speedhack_address = 0x00000c; - speedhack_pc[0] = 0x0001AFAC; - speedhack_pc[1] = 0x0001AE76; - - return DrvInit(SoldividLoadCallback, 0, 0x3800000, 0x2000000); -} - -struct BurnDriver BurnDrvSoldivid = { - "soldivid", NULL, NULL, NULL, "1997", - "Sol Divide - The Sword Of Darkness\0", NULL, "Psikyo", "PS3-V1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_HORSHOOT, 0, - NULL, soldividRomInfo, soldividRomName, NULL, NULL, Common3ButtonInputInfo, SoldividDIPInfo, - SoldividInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 320, 224, 4, 3 -}; - -static INT32 SoldividkInit() -{ - speedhack_address = 0x00000c; - speedhack_pc[0] = 0x0001AFB0; - speedhack_pc[1] = 0x0001AE7A; - - return DrvInit(SoldividLoadCallback, 0, 0x3800000, 0x2000000); -} - -// Sol Divide - The Sword Of Darkness (Korea) - -static struct BurnRomInfo soldividkRomDesc[] = { - { "9-prog_lk.u18", 0x080000, 0xb534029d, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "8-prog_hk.u17", 0x080000, 0xa48e3206, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "4l.u10", 0x400000, 0x9eb9f269, 2 | BRF_GRA }, // 2 Graphics - { "4h.u31", 0x400000, 0x7c76cfe7, 2 | BRF_GRA }, // 3 - { "5l.u9", 0x400000, 0xc59c6858, 2 | BRF_GRA }, // 4 - { "5h.u30", 0x400000, 0x73bc66d0, 2 | BRF_GRA }, // 5 - { "6l.u8", 0x400000, 0xf01b816e, 2 | BRF_GRA }, // 6 - { "6h.u37", 0x400000, 0xfdd57361, 2 | BRF_GRA }, // 7 - - { "sound.bin", 0x400000, 0xe98f8d45, 3 | BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(soldividk) -STD_ROM_FN(soldividk) - -struct BurnDriver BurnDrvSoldividk = { - "soldividk", "soldivid", NULL, NULL, "1997", - "Sol Divide - The Sword Of Darkness (Korea)\0", NULL, "Psikyo", "PS3-V1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_HORSHOOT, 0, - NULL, soldividkRomInfo, soldividkRomName, NULL, NULL, Common3ButtonInputInfo, SoldividkDIPInfo, - SoldividkInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 320, 224, 4, 3 -}; - - -// Strikers 1945 II - -static struct BurnRomInfo s1945iiRomDesc[] = { - { "2_prog_l.u18", 0x080000, 0x20a911b8, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "1_prog_h.u17", 0x080000, 0x4c0fe85e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "0l.u4", 0x400000, 0xbfacf98d, 2 | BRF_GRA }, // 2 Graphics - { "0h.u13", 0x400000, 0x1266f67c, 2 | BRF_GRA }, // 3 - { "1l.u3", 0x400000, 0x2d3332c9, 2 | BRF_GRA }, // 4 - { "1h.u12", 0x400000, 0x27b32c3e, 2 | BRF_GRA }, // 5 - { "2l.u2", 0x400000, 0x91ba6d23, 2 | BRF_GRA }, // 6 - { "2h.u20", 0x400000, 0xfabf4334, 2 | BRF_GRA }, // 7 - { "3l.u1", 0x400000, 0xa6c3704e, 2 | BRF_GRA }, // 8 - { "3h.u19", 0x400000, 0x4cd3ca70, 2 | BRF_GRA }, // 9 - - { "sound.u32", 0x400000, 0xba680ca7, 3 | BRF_SND }, // 10 Samples - - { "eeprom-s1945ii.bin", 0x000100, 0x7ac38846, BRF_OPT }, -}; - -STD_ROM_PICK(s1945ii) -STD_ROM_FN(s1945ii) - -static const UINT8 factory_eeprom[16] = { - 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -static INT32 S1945iiLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(pPsikyoshTiles + 0x0000000, 2, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0000001, 3, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800000, 4, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800001, 5, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000000, 6, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000001, 7, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800000, 8, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800001, 9, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 10, 1)) return 1; - - memcpy (DrvEEPROM, factory_eeprom, 0x10); - - return 0; -} - -static INT32 S1945iiInit() -{ - speedhack_address = 0x00000c; - speedhack_pc[0] = 0x0609fc6a; - speedhack_pc[1] = 0x0609fed4; - speedhack_pc[2] = 0x060A0172; - - return DrvInit(S1945iiLoadCallback, 0, 0x2000000, 0); -} - -struct BurnDriver BurnDrvS1945ii = { - "s1945ii", NULL, NULL, NULL, "1997", - "Strikers 1945 II\0", NULL, "Psikyo", "PS3-V1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, s1945iiRomInfo, s1945iiRomName, NULL, NULL, Common2ButtonInputInfo, S1945iiDIPInfo, - S1945iiInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 224, 320, 3, 4 -}; - - -// Daraku Tenshi - The Fallen Angels - -static struct BurnRomInfo darakuRomDesc[] = { - { "4_prog_l.u18", 0x080000, 0x660b4609, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "3_prog_h.u17", 0x080000, 0x7a9cf601, 1 | BRF_PRG | BRF_ESS }, // 1 - { "prog.u16", 0x100000, 0x3742e990, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "0l.u4", 0x400000, 0x565d8427, 2 | BRF_GRA }, // 3 Graphics - { "0h.u13", 0x400000, 0x9a602630, 2 | BRF_GRA }, // 4 - { "1l.u3", 0x400000, 0xac5ce8e1, 2 | BRF_GRA }, // 5 - { "1h.u12", 0x400000, 0xb0a59f7b, 2 | BRF_GRA }, // 6 - { "2l.u2", 0x400000, 0x2daa03b2, 2 | BRF_GRA }, // 7 - { "2h.u20", 0x400000, 0xe98e185a, 2 | BRF_GRA }, // 8 - { "3l.u1", 0x400000, 0x1d372aa1, 2 | BRF_GRA }, // 9 - { "3h.u19", 0x400000, 0x597f3f15, 2 | BRF_GRA }, // 10 - { "4l.u10", 0x400000, 0xe3d58cd8, 2 | BRF_GRA }, // 11 - { "4h.u31", 0x400000, 0xaebc9cd0, 2 | BRF_GRA }, // 12 - { "5l.u9", 0x400000, 0xeab5a50b, 2 | BRF_GRA }, // 13 - { "5h.u30", 0x400000, 0xf157474f, 2 | BRF_GRA }, // 14 - { "6l.u8", 0x200000, 0x9f008d1b, 2 | BRF_GRA }, // 15 - { "6h.u37", 0x200000, 0xacd2d0e3, 2 | BRF_GRA }, // 16 - - { "sound.u32", 0x400000, 0xef2c781d, 3 | BRF_SND }, // 17 Samples - - { "eeprom-daraku.bin", 0x000100, 0xa9715297, BRF_OPT }, -}; - -STD_ROM_PICK(daraku) -STD_ROM_FN(daraku) - -static const UINT8 daraku_eeprom[16] = { - 0x03, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -static INT32 DarakuLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0100000, 2, 1)) return 1; - - if (BurnLoadRom(pPsikyoshTiles + 0x0000000, 3, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0000001, 4, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800000, 5, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800001, 6, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000000, 7, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000001, 8, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800000, 9, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800001, 10, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000000, 11, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000001, 12, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2800000, 13, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2800001, 14, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x3000000, 15, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x3000001, 16, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 17, 1)) return 1; - - memcpy (DrvEEPROM, daraku_eeprom, 0x10); - - return 0; -} - -static INT32 DarakuInit() -{ - speedhack_address = 0x00000c; - speedhack_pc[0] = 0x0004761c; - speedhack_pc[1] = 0x00047978; - - return DrvInit(DarakuLoadCallback, 0, 0x3400000, 0); -} - -struct BurnDriver BurnDrvDaraku = { - "daraku", NULL, NULL, NULL, "1998", - "Daraku Tenshi - The Fallen Angels\0", NULL, "Psikyo", "PS3-V1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VSFIGHT, 0, - NULL, darakuRomInfo, darakuRomName, NULL, NULL, Common4ButtonInputInfo, DarakuDIPInfo, - DarakuInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 320, 224, 4, 3 -}; - - -// Space Bomber (ver. B) - -static struct BurnRomInfo sbomberRomDesc[] = { - { "1-b_pr_l.u18", 0x080000, 0x52d12225, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "1-b_pr_h.u17", 0x080000, 0x1bbd0345, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "0l.u4", 0x400000, 0xb7e4ac51, 2 | BRF_GRA }, // 2 Graphics - { "0h.u13", 0x400000, 0x235e6c27, 2 | BRF_GRA }, // 3 - { "1l.u3", 0x400000, 0x3c88c48c, 2 | BRF_GRA }, // 4 - { "1h.u12", 0x400000, 0x15626a6e, 2 | BRF_GRA }, // 5 - { "2l.u2", 0x400000, 0x41e92f64, 2 | BRF_GRA }, // 6 - { "2h.u20", 0x400000, 0x4ae62e84, 2 | BRF_GRA }, // 7 - { "3l.u1", 0x400000, 0x43ba5f0f, 2 | BRF_GRA }, // 8 - { "3h.u19", 0x400000, 0xff01bb12, 2 | BRF_GRA }, // 9 - { "4l.u10", 0x400000, 0xe491d593, 2 | BRF_GRA }, // 10 - { "4h.u31", 0x400000, 0x7bdd377a, 2 | BRF_GRA }, // 11 - - { "sound.u32", 0x400000, 0x85cbff69, 3 | BRF_SND }, // 12 Samples - - { "eeprom-sbomber.bin", 0x000100, 0x7ac38846, BRF_OPT }, -}; - -STD_ROM_PICK(sbomber) -STD_ROM_FN(sbomber) - -static struct BurnRomInfo sbomberaRomDesc[] = { - { "2.u18", 0x080000, 0x57819a26, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "1.u17", 0x080000, 0xc388e847, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "0l.u4", 0x400000, 0xb7e4ac51, 2 | BRF_GRA }, // 2 Graphics - { "0h.u13", 0x400000, 0x235e6c27, 2 | BRF_GRA }, // 3 - { "1l.u3", 0x400000, 0x3c88c48c, 2 | BRF_GRA }, // 4 - { "1h.u12", 0x400000, 0x15626a6e, 2 | BRF_GRA }, // 5 - { "2l.u2", 0x400000, 0x41e92f64, 2 | BRF_GRA }, // 6 - { "2h.u20", 0x400000, 0x4ae62e84, 2 | BRF_GRA }, // 7 - { "3l.u1", 0x400000, 0x43ba5f0f, 2 | BRF_GRA }, // 8 - { "3h.u19", 0x400000, 0xff01bb12, 2 | BRF_GRA }, // 9 - { "4l.u10", 0x400000, 0xe491d593, 2 | BRF_GRA }, // 10 - { "4h.u31", 0x400000, 0x7bdd377a, 2 | BRF_GRA }, // 11 - - { "sound.u32", 0x400000, 0x85cbff69, 3 | BRF_SND }, // 12 Samples - - { "eeprom-sbomber.bin", 0x000100, 0x7ac38846, BRF_OPT }, -}; - -STD_ROM_PICK(sbombera) -STD_ROM_FN(sbombera) - -static INT32 SbomberLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(pPsikyoshTiles + 0x0000000, 2, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0000001, 3, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800000, 4, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800001, 5, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000000, 6, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000001, 7, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800000, 8, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800001, 9, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000000, 10, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000001, 11, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 12, 1)) return 1; - - memcpy (DrvEEPROM, factory_eeprom, 0x10); - - return 0; -} - -static INT32 SbomberInit() -{ - speedhack_address = 0x00000c; - speedhack_pc[0] = 0x060A10EE; - speedhack_pc[1] = 0x060A165A; - speedhack_pc[2] = 0x060A1382; - - return DrvInit(SbomberLoadCallback, 0, 0x2800000, 0); -} - -struct BurnDriver BurnDrvSbomber = { - "sbomber", NULL, NULL, NULL, "1998", - "Space Bomber (ver. B)\0", NULL, "Psikyo", "PS3-V1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_SHOOT, 0, - NULL, sbomberRomInfo, sbomberRomName, NULL, NULL, Common2ButtonInputInfo, S1945iiDIPInfo, - SbomberInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvSbombera = { - "sbombera", "sbomber", NULL, NULL, "1998", - "Space Bomber\0", NULL, "Psikyo", "PS3-V1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_SHOOT, 0, - NULL, sbomberaRomInfo, sbomberaRomName, NULL, NULL, Common2ButtonInputInfo, S1945iiDIPInfo, - SbomberInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 224, 320, 3, 4 -}; - - -// Gunbird 2 - -static struct BurnRomInfo gunbird2RomDesc[] = { - { "2_prog_l.u16", 0x080000, 0x76f934f0, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "1_prog_h.u17", 0x080000, 0x7328d8bf, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3_pdata.u1", 0x080000, 0xa5b697e6, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "0l.u3", 0x800000, 0x5c826bc8, 2 | BRF_GRA }, // 3 Graphics - { "0h.u10", 0x800000, 0x3df0cb6c, 2 | BRF_GRA }, // 4 - { "1l.u4", 0x800000, 0x1558358d, 2 | BRF_GRA }, // 5 - { "1h.u11", 0x800000, 0x4ee0103b, 2 | BRF_GRA }, // 6 - { "2l.u5", 0x800000, 0xe1c7a7b8, 2 | BRF_GRA }, // 7 - { "2h.u12", 0x800000, 0xbc8a41df, 2 | BRF_GRA }, // 8 - { "3l.u6", 0x400000, 0x0229d37f, 2 | BRF_GRA }, // 9 - { "3h.u13", 0x400000, 0xf41bbf2b, 2 | BRF_GRA }, // 10 - - { "sound.u9", 0x400000, 0xf19796ab, 3 | BRF_SND }, // 11 Samples - - { "eeprom-gunbird2.bin",0x000100, 0x7ac38846, BRF_OPT }, -}; - -STD_ROM_PICK(gunbird2) -STD_ROM_FN(gunbird2) - -static INT32 Gunbird2LoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0100000, 2, 1)) return 1; - - if (BurnLoadRom(pPsikyoshTiles + 0x0000000, 3, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0000001, 4, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000000, 5, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000001, 6, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000000, 7, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000001, 8, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x3000000, 9, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x3000001, 10, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 11, 1)) return 1; - - memcpy (DrvEEPROM, factory_eeprom, 0x10); - - return 0; -} - -static INT32 Gunbird2Init() -{ - speedhack_address = 0x004000c; - speedhack_pc[0] = 0x06028be6; - speedhack_pc[1] = 0x06028974; - speedhack_pc[2] = 0x06028e64; - - return DrvInit(Gunbird2LoadCallback, 1, 0x3800000, 0); -} - -struct BurnDriver BurnDrvGunbird2 = { - "gunbird2", NULL, NULL, NULL, "1998", - "Gunbird 2\0", NULL, "Psikyo", "PS5", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, gunbird2RomInfo, gunbird2RomName, NULL, NULL, Common3ButtonInputInfo, Gunbird2DIPInfo, - Gunbird2Init, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 224, 320, 3, 4 -}; - - -// Strikers 1945 III (World) / Strikers 1999 (Japan) - -static struct BurnRomInfo s1945iiiRomDesc[] = { - { "2_progl.u16", 0x080000, 0x5d5d385f, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "1_progh.u17", 0x080000, 0x1b8a5a18, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3_data.u1", 0x080000, 0x8ff5f7d3, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "0l.u3", 0x800000, 0x70a0d52c, 2 | BRF_GRA }, // 3 Graphics - { "0h.u10", 0x800000, 0x4dcd22b4, 2 | BRF_GRA }, // 4 - { "1l.u4", 0x800000, 0xde1042ff, 2 | BRF_GRA }, // 5 - { "1h.u11", 0x800000, 0xb51a4430, 2 | BRF_GRA }, // 6 - { "2l.u5", 0x800000, 0x23b02dca, 2 | BRF_GRA }, // 7 - { "2h.u12", 0x800000, 0x9933ab04, 2 | BRF_GRA }, // 8 - { "3l.u6", 0x400000, 0xf693438c, 2 | BRF_GRA }, // 9 - { "3h.u13", 0x400000, 0x2d0c334f, 2 | BRF_GRA }, // 10 - - { "sound.u9", 0x400000, 0xc5374beb, 3 | BRF_SND }, // 11 Samples - - { "eeprom-s1945iii.bin",0x000100, 0xb39f3604, BRF_OPT }, -}; - -STD_ROM_PICK(s1945iii) -STD_ROM_FN(s1945iii) - -static const UINT8 s1945iii_eeprom[16] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x70, - 0x25, 0x25, 0x25, 0x00, 0x01, 0x00, 0x11, 0xe0 -}; - -static INT32 S1945iiiLoadCallback() -{ - INT32 nRet = Gunbird2LoadCallback(); - - memcpy (DrvEEPROM + 0x00, factory_eeprom, 0x10); - memcpy (DrvEEPROM + 0xf0, s1945iii_eeprom, 0x10); - - return nRet; -} - -static INT32 S1945iiiInit() -{ - speedhack_address = 0x6000c; - speedhack_pc[0] = 0x0602b464; - speedhack_pc[1] = 0x0602b97c; - speedhack_pc[2] = 0x0602b6e2; - speedhack_pc[3] = 0x0602bc1e; - - return DrvInit(S1945iiiLoadCallback, 1, 0x3800000, 0); -} - -struct BurnDriver BurnDrvS1945iii = { - "s1945iii", NULL, NULL, NULL, "1999", - "Strikers 1945 III (World) / Strikers 1999 (Japan)\0", NULL, "Psikyo", "PS5", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, s1945iiiRomInfo, s1945iiiRomName, NULL, NULL, Common3ButtonInputInfo, S1945iiiDIPInfo, - S1945iiiInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 224, 320, 3, 4 -}; - - -// Dragon Blaze - -static struct BurnRomInfo dragnblzRomDesc[] = { - { "1prog_l.u22", 0x080000, 0x95d6fd02, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "2prog_h.u21", 0x080000, 0xfc5eade8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1l.u4", 0x200000, 0xc2eb565c, 2 | BRF_GRA }, // 2 Graphics - { "1h.u12", 0x200000, 0x23cb46b7, 2 | BRF_GRA }, // 3 - { "2l.u5", 0x200000, 0xbc256aea, 2 | BRF_GRA }, // 4 - { "2h.u13", 0x200000, 0xb75f59ec, 2 | BRF_GRA }, // 5 - { "3l.u6", 0x200000, 0x4284f008, 2 | BRF_GRA }, // 6 - { "3h.u14", 0x200000, 0xabe5cbbf, 2 | BRF_GRA }, // 7 - { "4l.u7", 0x200000, 0xc9fcf2e5, 2 | BRF_GRA }, // 8 - { "4h.u15", 0x200000, 0x0ab0a12a, 2 | BRF_GRA }, // 9 - { "5l.u8", 0x200000, 0x68d03ccf, 2 | BRF_GRA }, // 10 - { "5h.u16", 0x200000, 0x5450fbca, 2 | BRF_GRA }, // 11 - { "6l.u1", 0x200000, 0x8b52c90b, 2 | BRF_GRA }, // 12 - { "6h.u2", 0x200000, 0x7362f929, 2 | BRF_GRA }, // 13 - { "7l.u19", 0x200000, 0xb4f4d86e, 2 | BRF_GRA }, // 14 - { "7h.u20", 0x200000, 0x44b7b9cc, 2 | BRF_GRA }, // 15 - { "8l.u28", 0x200000, 0xcd079f89, 2 | BRF_GRA }, // 16 - { "8h.u29", 0x200000, 0x3edb508a, 2 | BRF_GRA }, // 17 - { "9l.u41", 0x200000, 0x0b53cd78, 2 | BRF_GRA }, // 18 - { "9h.u42", 0x200000, 0xbc61998a, 2 | BRF_GRA }, // 19 - { "10l.u58", 0x200000, 0xa3f5c7f8, 2 | BRF_GRA }, // 20 - { "10h.u59", 0x200000, 0x30e304c4, 2 | BRF_GRA }, // 21 - - { "snd0.u52", 0x200000, 0x7fd1b225, 3 | BRF_SND }, // 22 Samples - - { "eeprom-dragnblz.u44",0x000100, 0x46e85da9, BRF_OPT }, -}; - -STD_ROM_PICK(dragnblz) -STD_ROM_FN(dragnblz) - -static const UINT8 dragnblz_eeprom[16] = { - 0x00, 0x01, 0x11, 0x70, 0x25, 0x25, 0x25, 0x00, - 0x01, 0x00, 0x11, 0xe0, 0x00, 0x00, 0x00, 0x00 -}; - -static INT32 DragnblzLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(pPsikyoshTiles + 0x0400000 - 0x0400000, 2, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0400001 - 0x0400000, 3, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800000 - 0x0400000, 4, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800001 - 0x0400000, 5, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0c00000 - 0x0400000, 6, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0c00001 - 0x0400000, 7, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000000 - 0x0400000, 8, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000001 - 0x0400000, 9, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1400000 - 0x0400000, 10, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1400001 - 0x0400000, 11, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800000 - 0x0400000, 12, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800001 - 0x0400000, 13, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1c00000 - 0x0400000, 14, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1c00001 - 0x0400000, 15, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000000 - 0x0400000, 16, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000001 - 0x0400000, 17, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2400000 - 0x0400000, 18, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2400001 - 0x0400000, 19, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2800000 - 0x0400000, 20, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2800001 - 0x0400000, 21, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 22, 1)) return 1; - - memcpy (DrvEEPROM + 0x00, factory_eeprom, 0x10); - memcpy (DrvEEPROM + 0xf0, dragnblz_eeprom, 0x10); - - return 0; -} - -static INT32 DragnblzInit() -{ - speedhack_address = 0x6000c; - speedhack_pc[0] = 0x06027440; - speedhack_pc[1] = 0x060276e6; - speedhack_pc[2] = 0x06027C74; - speedhack_pc[3] = 0x060279A8; - - return DrvInit(DragnblzLoadCallback, 1, 0x2c00000, 0x0400000); -} - -struct BurnDriver BurnDrvDragnblz = { - "dragnblz", NULL, NULL, NULL, "2000", - "Dragon Blaze\0", NULL, "Psikyo", "PS5V2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_VERSHOOT, 0, - NULL, dragnblzRomInfo, dragnblzRomName, NULL, NULL, Common3ButtonInputInfo, DragnblzDIPInfo, - DragnblzInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 224, 320, 3, 4 -}; - - -// Gunbarich - -static struct BurnRomInfo gnbarichRomDesc[] = { - { "1-prog_h.u22", 0x080000, 0x6588fc96, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "2-prog_l.u21", 0x080000, 0xc136cd9c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "6l.u1", 0x200000, 0x0432e1a8, 2 | BRF_GRA }, // 2 Graphics - { "6h.u2", 0x200000, 0xf90fa3ea, 2 | BRF_GRA }, // 3 - { "7l.u19", 0x200000, 0x36bf9a58, 2 | BRF_GRA }, // 4 - { "7h.u20", 0x200000, 0x4b3eafd8, 2 | BRF_GRA }, // 5 - { "8l.u28", 0x200000, 0x026754da, 2 | BRF_GRA }, // 6 - { "8h.u29", 0x200000, 0x8cd7aaa0, 2 | BRF_GRA }, // 7 - { "9l.u41", 0x200000, 0x02c066fe, 2 | BRF_GRA }, // 8 - { "9h.u42", 0x200000, 0x5433385a, 2 | BRF_GRA }, // 9 - - { "snd0.u52", 0x200000, 0x7b10436b, 3 | BRF_SND }, // 10 Samples - - { "eeprom-gnbarich.bin",0x000100, 0x0f5bf42f, BRF_OPT }, -}; - -STD_ROM_PICK(gnbarich) -STD_ROM_FN(gnbarich) - -static const UINT8 gnbarich_eeprom[16] = { - 0x00, 0x0f, 0x42, 0x40, 0x08, 0x0a, 0x00, 0x00, - 0x01, 0x06, 0x42, 0x59, 0x00, 0x00, 0x00, 0x00 -}; - -static INT32 GnbarichLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(pPsikyoshTiles + 0x1800000 - 0x1800000, 2, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800001 - 0x1800000, 3, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1c00000 - 0x1800000, 4, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1c00001 - 0x1800000, 5, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000000 - 0x1800000, 6, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000001 - 0x1800000, 7, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2400000 - 0x1800000, 8, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2400001 - 0x1800000, 9, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 10, 1)) return 1; - - memcpy (DrvEEPROM + 0x00, factory_eeprom, 0x10); - memcpy (DrvEEPROM + 0xf0, gnbarich_eeprom, 0x10); - - return 0; -} - -static INT32 GnbarichInit() -{ - speedhack_address = 0x6000c; - speedhack_pc[0] = 0x0602CAE8; - speedhack_pc[1] = 0x0602CD88; - speedhack_pc[2] = 0x0602D2F0; - speedhack_pc[3] = 0x0602D042; - - return DrvInit(GnbarichLoadCallback, 1, 0x2800000, 0x1800000); -} - -struct BurnDriver BurnDrvGnbarich = { - "gnbarich", NULL, NULL, NULL, "2001", - "Gunbarich\0", NULL, "Psikyo", "PS5V2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_BREAKOUT, 0, - NULL, gnbarichRomInfo, gnbarichRomName, NULL, NULL, Common3ButtonInputInfo, S1945iiiDIPInfo, - GnbarichInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 224, 320, 3, 4 -}; - - -// Mahjong G-Taste - -static struct BurnRomInfo mjgtasteRomDesc[] = { - { "1.u22", 0x080000, 0xf5ff7876, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "2.u21", 0x080000, 0x5f2041dc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1l.u4", 0x200000, 0x30da42b1, 2 | BRF_GRA }, // 2 Graphics - { "1h.u12", 0x200000, 0x629c1d44, 2 | BRF_GRA }, // 3 - { "2l.u5", 0x200000, 0x1f6126ab, 2 | BRF_GRA }, // 4 - { "2h.u13", 0x200000, 0xdba34e46, 2 | BRF_GRA }, // 5 - { "3l.u6", 0x200000, 0x1023e35e, 2 | BRF_GRA }, // 6 - { "3h.u14", 0x200000, 0x8aebec7f, 2 | BRF_GRA }, // 7 - { "4l.u7", 0x200000, 0x9acf018b, 2 | BRF_GRA }, // 8 - { "4h.u15", 0x200000, 0xf93e154c, 2 | BRF_GRA }, // 9 - - { "snd0.u52", 0x400000, 0x0179f018, 3 | BRF_SND }, // 10 Samples - - { "eeprom-mjgtaste.u44",0x000100, 0xd35586f2, BRF_OPT }, -}; - -STD_ROM_PICK(mjgtaste) -STD_ROM_FN(mjgtaste) - -static const UINT8 mjgtaste_eeprom[16] = { - 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -}; - -static INT32 MjgtasteLoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(pPsikyoshTiles + 0x0400000 - 0x0400000, 2, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0400001 - 0x0400000, 3, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800000 - 0x0400000, 4, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0800001 - 0x0400000, 5, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0c00000 - 0x0400000, 6, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0c00001 - 0x0400000, 7, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000000 - 0x0400000, 8, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000001 - 0x0400000, 9, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 10, 1)) return 1; - - memcpy (DrvEEPROM + 0x00, mjgtaste_eeprom, 0x10); - memcpy (DrvEEPROM + 0xf0, mjgtaste_eeprom, 0x10); - - return 0; -} - -static INT32 MjgtasteInit() -{ - speedhack_address = 0x6000c; - speedhack_pc[0] = 0x06031f04; - speedhack_pc[1] = 0x0603214c; - - return DrvInit(MjgtasteLoadCallback, 1, 0x1400000, 0x0400000); -} - -struct BurnDriver BurnDrvMjgtaste = { - "mjgtaste", NULL, NULL, NULL, "2002", - "Mahjong G-Taste\0", NULL, "Psikyo", "PS5V2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_MAHJONG, 0, - NULL, mjgtasteRomInfo, mjgtasteRomName, NULL, NULL, Common3ButtonInputInfo, Tgm2DIPInfo, - MjgtasteInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 320, 224, 4, 3 -}; - - -// Tetris the Absolute The Grand Master 2 - -static struct BurnRomInfo tgm2RomDesc[] = { - { "1.u22", 0x080000, 0xc521bf24, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "2.u21", 0x080000, 0xb19f6c31, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "81ts_3l.u6", 0x200000, 0xd77cff9c, 2 | BRF_GRA }, // 2 Graphics - { "82ts_3h.u14", 0x200000, 0xf012b583, 2 | BRF_GRA }, // 3 - { "83ts_4l.u7", 0x200000, 0x078cafc3, 2 | BRF_GRA }, // 4 - { "84ts_4h.u15", 0x200000, 0x1f91446b, 2 | BRF_GRA }, // 5 - { "85ts_5l.u8", 0x200000, 0x40fbd259, 2 | BRF_GRA }, // 6 - { "86ts_5h.u16", 0x200000, 0x186c935f, 2 | BRF_GRA }, // 7 - { "87ts_6l.u1", 0x200000, 0xc17dc48a, 2 | BRF_GRA }, // 8 - { "88ts_6h.u2", 0x200000, 0xe4dba5da, 2 | BRF_GRA }, // 9 - { "89ts_7l.u19", 0x200000, 0xdab1b2c5, 2 | BRF_GRA }, // 10 - { "90ts_7h.u20", 0x200000, 0xaae696b3, 2 | BRF_GRA }, // 11 - { "91ts_8l.u28", 0x200000, 0xe953ace1, 2 | BRF_GRA }, // 12 - { "92ts_8h.u29", 0x200000, 0x9da3b976, 2 | BRF_GRA }, // 13 - { "93ts_9l.u41", 0x200000, 0x233087fe, 2 | BRF_GRA }, // 14 - { "94ts_9h.u42", 0x200000, 0x9da831c7, 2 | BRF_GRA }, // 15 - { "95ts_10l.u58", 0x200000, 0x303a5240, 2 | BRF_GRA }, // 16 - { "96ts_10h.u59", 0x200000, 0x2240ebf6, 2 | BRF_GRA }, // 17 - - { "97ts_snd.u52", 0x400000, 0x9155eca6, 3 | BRF_SND }, // 18 Samples - - { "tgm2.default.nv", 0x000100, 0x50e2348c, 4 | BRF_PRG | BRF_ESS }, // 19 EEPROM data -}; - -STD_ROM_PICK(tgm2) -STD_ROM_FN(tgm2) - -static INT32 Tgm2LoadCallback() -{ - if (BurnLoadRom(DrvSh2ROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(DrvSh2ROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(pPsikyoshTiles + 0x0c00000 - 0x0c00000, 2, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x0c00001 - 0x0c00000, 3, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000000 - 0x0c00000, 4, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1000001 - 0x0c00000, 5, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1400000 - 0x0c00000, 6, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1400001 - 0x0c00000, 7, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800000 - 0x0c00000, 8, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1800001 - 0x0c00000, 9, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1c00000 - 0x0c00000, 10, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x1c00001 - 0x0c00000, 11, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000000 - 0x0c00000, 12, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2000001 - 0x0c00000, 13, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2400000 - 0x0c00000, 14, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2400001 - 0x0c00000, 15, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2800000 - 0x0c00000, 16, 2)) return 1; - if (BurnLoadRom(pPsikyoshTiles + 0x2800001 - 0x0c00000, 17, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 18, 1)) return 1; - - if (BurnLoadRom(DrvEEPROM + 0x0000000, 19, 1)) return 1; - - return 0; -} - -static INT32 Tgm2Init() -{ - speedhack_address = 0x6000c; - speedhack_pc[0] = 0x0602895a; - speedhack_pc[1] = 0x06028cac; - speedhack_pc[2] = 0x06029272; - speedhack_pc[3] = 0x06028ef2; - - return DrvInit(Tgm2LoadCallback, 1, 0x2c00000, 0x0c00000); -} - -struct BurnDriver BurnDrvTgm2 = { - "tgm2", NULL, NULL, NULL, "2000", - "Tetris the Absolute The Grand Master 2\0", NULL, "Arika", "PS5V2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_PUZZLE, 0, - NULL, tgm2RomInfo, tgm2RomName, NULL, NULL, Common3ButtonInputInfo, Tgm2DIPInfo, - Tgm2Init, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 320, 240, 4, 3 -}; - - -// Tetris the Absolute The Grand Master 2 Plus - -static struct BurnRomInfo tgm2pRomDesc[] = { - { "1b.u22", 0x080000, 0x7599fb19, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "2b.u21", 0x080000, 0x38bc626c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "81ts_3l.u6", 0x200000, 0xd77cff9c, 2 | BRF_GRA }, // 2 Graphics - { "82ts_3h.u14", 0x200000, 0xf012b583, 2 | BRF_GRA }, // 3 - { "83ts_4l.u7", 0x200000, 0x078cafc3, 2 | BRF_GRA }, // 4 - { "84ts_4h.u15", 0x200000, 0x1f91446b, 2 | BRF_GRA }, // 5 - { "85ts_5l.u8", 0x200000, 0x40fbd259, 2 | BRF_GRA }, // 6 - { "86ts_5h.u16", 0x200000, 0x186c935f, 2 | BRF_GRA }, // 7 - { "87ts_6l.u1", 0x200000, 0xc17dc48a, 2 | BRF_GRA }, // 8 - { "88ts_6h.u2", 0x200000, 0xe4dba5da, 2 | BRF_GRA }, // 9 - { "89ts_7l.u19", 0x200000, 0xdab1b2c5, 2 | BRF_GRA }, // 10 - { "90ts_7h.u20", 0x200000, 0xaae696b3, 2 | BRF_GRA }, // 11 - { "91ts_8l.u28", 0x200000, 0xe953ace1, 2 | BRF_GRA }, // 12 - { "92ts_8h.u29", 0x200000, 0x9da3b976, 2 | BRF_GRA }, // 13 - { "93ts_9l.u41", 0x200000, 0x233087fe, 2 | BRF_GRA }, // 14 - { "94ts_9h.u42", 0x200000, 0x9da831c7, 2 | BRF_GRA }, // 15 - { "95ts_10l.u58", 0x200000, 0x303a5240, 2 | BRF_GRA }, // 16 - { "96ts_10h.u59", 0x200000, 0x2240ebf6, 2 | BRF_GRA }, // 17 - - { "97ts_snd.u52", 0x400000, 0x9155eca6, 3 | BRF_SND }, // 18 Samples - - { "tgm2p.default.nv", 0x000100, 0xb2328b40, 4 | BRF_PRG | BRF_ESS }, // 19 EEPROM data -}; - -STD_ROM_PICK(tgm2p) -STD_ROM_FN(tgm2p) - -static INT32 Tgm2pInit() -{ - speedhack_address = 0x6000c; - speedhack_pc[0] = 0x0602ae5a; - speedhack_pc[1] = 0x0602b1ac; - speedhack_pc[2] = 0x0602b772; - speedhack_pc[3] = 0x0602b3f2; - - return DrvInit(Tgm2LoadCallback, 1, 0x2c00000, 0x0c00000); -} - -struct BurnDriver BurnDrvTgm2p = { - "tgm2p", "tgm2", NULL, NULL, "2000", - "Tetris the Absolute The Grand Master 2 Plus\0", NULL, "Arika", "PS5V2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PSIKYO, GBF_PUZZLE, 0, - NULL, tgm2pRomInfo, tgm2pRomName, NULL, NULL, Common3ButtonInputInfo, Tgm2DIPInfo, - Tgm2pInit, DrvExit, DrvFrame, PsikyoshDraw, DrvScan, NULL, 0x1400, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/psikyo/psikyo.h b/jan/src/burn/drv/psikyo/psikyo.h deleted file mode 100644 index 7d130bab9..000000000 --- a/jan/src/burn/drv/psikyo/psikyo.h +++ /dev/null @@ -1,46 +0,0 @@ -#include "burnint.h" -#include "m68000_intf.h" -#include "z80_intf.h" - -// General -enum { - PSIKYO_HW_SAMURAIA, - PSIKYO_HW_GUNBIRD, - PSIKYO_HW_S1945, - PSIKYO_HW_TENGAI -}; - -extern INT32 PsikyoHardwareVersion; - -// palette -INT32 PsikyoPalInit(); -INT32 PsikyoPalExit(); -INT32 PsikyoPalUpdate(); - -void PsikyoPalWriteByte(UINT32 nAddress, UINT8 byteValue); -void PsikyoPalWriteWord(UINT32 nAddress, UINT16 wordValue); - -extern UINT8* PsikyoPalSrc; -extern UINT8 PsikyoRecalcPalette; -extern UINT32* PsikyoPalette; - -// Tile rendering -INT32 PsikyoTileRender(); -void PsikyoSetTileBank(INT32 nLayer, INT32 nBank); -INT32 PsikyoTileInit(UINT32 nROMSize); -void PsikyoTileExit(); - -extern UINT8* PsikyoTileROM; -extern UINT8* PsikyoTileRAM[3]; - -extern bool bPsikyoClearBackground; - -// Sprite rendering -INT32 PsikyoSpriteInit(INT32 nROMSize); -void PsikyoSpriteExit(); -INT32 PsikyoSpriteBuffer(); -INT32 PsikyoSpriteRender(INT32 nLowPriority, INT32 nHighPriority); - -extern UINT8* PsikyoSpriteROM; -extern UINT8* PsikyoSpriteRAM; -extern UINT8* PsikyoSpriteLUT; diff --git a/jan/src/burn/drv/psikyo/psikyo_palette.cpp b/jan/src/burn/drv/psikyo/psikyo_palette.cpp deleted file mode 100644 index 1c935b9a8..000000000 --- a/jan/src/burn/drv/psikyo/psikyo_palette.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include "psikyo.h" - -UINT8* PsikyoPalSrc; -UINT8 PsikyoRecalcPalette; // Set to 1 to force recalculation of the entire palette - -UINT32* PsikyoPalette; -static UINT16* PsikyoPalCopy; - -INT32 PsikyoPalInit() -{ - PsikyoPalette = (UINT32*)BurnMalloc(0x1000 * sizeof(UINT32)); - memset(PsikyoPalette, 0, 0x1000 * sizeof(UINT32)); - - PsikyoPalCopy = (UINT16*)BurnMalloc(0x1000 * sizeof(UINT16)); - memset(PsikyoPalCopy, 0, 0x1000 * sizeof(UINT16)); - - pBurnDrvPalette = PsikyoPalette; - - return 0; -} - -INT32 PsikyoPalExit() -{ - BurnFree(PsikyoPalette); - BurnFree(PsikyoPalCopy); - - return 0; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x7C00) >> 7; // Red - r |= r >> 5; - g = (nColour & 0x03E0) >> 2; // Green - g |= g >> 5; - b = (nColour & 0x001F) << 3; // Blue - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -INT32 PsikyoPalUpdate() -{ - if (PsikyoRecalcPalette) { - UINT16 c; - - for (INT32 i = 0; i < 0x1000; i++) { - c = ((UINT16*)PsikyoPalSrc)[i]; - PsikyoPalCopy[i] = c; - PsikyoPalette[i] = CalcCol(c); - } - - PsikyoRecalcPalette = 0; - } - - return 0; -} - -// Update the PC copy of the palette on writes to the palette memory -void PsikyoPalWriteByte(UINT32 nAddress, UINT8 byteValue) -{ - nAddress ^= 1; - PsikyoPalSrc[nAddress] = byteValue; // write byte - - if (*((UINT8*)(PsikyoPalCopy + nAddress)) != byteValue) { - *((UINT8*)(PsikyoPalCopy + nAddress)) = byteValue; - PsikyoPalette[nAddress >> 1] = CalcCol(*(UINT16*)(PsikyoPalSrc + (nAddress & ~0x01))); - } -} - -void PsikyoPalWriteWord(UINT32 nAddress, UINT16 wordValue) -{ - nAddress >>= 1; - - ((UINT16*)PsikyoPalSrc)[nAddress] = wordValue; // write word - - if (PsikyoPalCopy[nAddress] != wordValue) { - PsikyoPalCopy[nAddress] = wordValue; - PsikyoPalette[nAddress] = CalcCol(wordValue); - } -} diff --git a/jan/src/burn/drv/psikyo/psikyo_render.h b/jan/src/burn/drv/psikyo/psikyo_render.h deleted file mode 100644 index 6ed27cefd..000000000 --- a/jan/src/burn/drv/psikyo/psikyo_render.h +++ /dev/null @@ -1,284 +0,0 @@ -// Graphics format: 16 16 pixel tiles, 4 bits/pixel. - -// Create a unique name for each of the functions -#define FN(a,b,c,d,e,f,g,h) RenderTile ## a ## b ## c ## _ROT ## d ## e ## f ## g ## h -#define FUNCTIONNAME(a,b,c,d,e,f,g,h) FN(a,b,c,d,e,f,g,h) - -#if FLIP == 0 - #define DOFLIP _NOFLIP - #define FLIPX 0 - #define FLIPY 0 -#elif FLIP == 1 - #define DOFLIP _FLIPX - #define FLIPX 1 - #define FLIPY 0 -#elif FLIP == 2 - #define DOFLIP _FLIPY - #define FLIPX 0 - #define FLIPY 1 -#elif FLIP == 3 - #define DOFLIP _FLIPXY - #define FLIPX 1 - #define FLIPY 1 -#else - #error unsupported flip mode specified. -#endif - -#if ZOOM == 0 - #define ZOOMMODE _NOZOOM - #define CHECKX(x) - #if FLIPX == 0 - #define OFFSET(x) (x) - #else - #define OFFSET(x) (15 - (x)) - #endif -#elif ZOOM == 1 - #define ZOOMMODE _ZOOM - #define CHECKX(x) if (x >= nTileXSize) { continue; } - #if FLIPX == 0 - #define OFFSET(x) (pXZoomInfo[x]) - #else - #define OFFSET(x) (15 - pXZoomInfo[x]) - #endif -#else - #error unsupported zoom mode specified. -#endif - -#if ROT == 0 - #if FLIPY == 0 - #define ADVANCEROW pTileRow += ((BPP >> 3) * 320) - #else - #define ADVANCEROW pTileRow -= ((BPP >> 3) * 320) - #endif -#else - #error unsupported rotation angle specified -#endif - -#if DOCLIP == 0 - #define CLIP _NOCLIP -#elif DOCLIP == 1 - #define CLIP _CLIP -#else - #error illegal doclip value. -#endif - -#if TRANS == 15 || TRANS == 0 - #define TESTCOLOUR(x) ((x) != TRANS) - #if TRANS == 0 - #define TRANSMODE _TRANS0 - #else - #define TRANSMODE _TRANS15 - #endif -#elif TRANS == -1 - #define TESTCOLOUR(x) 1 - #define TRANSMODE _SOLID -#else - #error unsupported transparency mode specified -#endif - -#if ZBUFFER == 0 - #define ZBUF _NOZBUFFER - #define ADVANCEZROW - #define TESTZBUF(a) 1 - #define WRITEZBUF(a) -#elif ZBUFFER == 1 - #define ZBUF _RZBUFFER - #define TESTZBUF(a) (pZTileRow[a] <= nZPos) - #define WRITEZBUF(a) -#elif ZBUFFER == 2 - #define ZBUF _WZBUFFER - #define TESTZBUF(a) 1 - #define WRITEZBUF(a) pZTileRow[a] = nZPos -#elif ZBUFFER == 3 - #define ZBUF _RWZBUFFER - #define TESTZBUF(a) (pZTileRow[a] <= nZPos) - #define WRITEZBUF(a) pZTileRow[a] = nZPos -#else - #error unsupported zbuffer mode specified. -#endif - -#if ZBUFFER != 0 - #if FLIPY == 0 - #define ADVANCEZROW pZTileRow += 320 - #else - #define ADVANCEZROW pZTileRow -= 320 - #endif -#endif - -#if BPP == 16 - #define PLOTPIXEL(a, b) if (TESTCOLOUR(b) && TESTZBUF(a)) { \ - WRITEZBUF(a); \ - ((UINT16*)pTileRow)[a] = (UINT16)pTilePalette[b]; \ - } -#elif BPP == 24 - #define PLOTPIXEL(a, b) if (TESTCOLOUR(b) && TESTZBUF(a)) { \ - UINT32 nRGB = pTilePalette[b]; \ - WRITEZBUF(a); \ - pTileRow[3 * a + 0] = (UINT8)nRGB; \ - pTileRow[3 * a + 1] = (UINT8)(nRGB >> 8); \ - pTileRow[3 * a + 2] = (UINT8)(nRGB >> 16); \ - } -#elif BPP == 32 - #define PLOTPIXEL(a, b) if (TESTCOLOUR(b) && TESTZBUF(a)) { \ - WRITEZBUF(a); \ - ((UINT32*)pTileRow)[a] = (UINT32)pTilePalette[b]; \ - } -#else - #error unsupported bitdepth specified. -#endif - -// For decorating the function name -#if ROWSCROLL == 0 - #define SCROLL _NOROWSCROLL -#elif ROWSCROLL == 1 - #define SCROLL _ROWSCROLL -#else - #error unsupported rowscroll mode specified. -#endif - -static void FUNCTIONNAME(BPP,TRANSMODE,DOFLIP,ROT,SCROLL,ZOOMMODE,ZBUF,CLIP)() -{ -// Create an empty function if unsupported features are requested -#if ROT == 0 - - UINT8* pTileRow; - #if ZBUFFER != 0 - UINT16* pZTileRow; - #endif - - #if ROWSCROLL == 1 - INT32 nRowOffset; - #endif - INT32 y; - - #if ZOOM == 1 - #if ZBUFFER == 0 - #if FLIPY == 0 - for (y = 0, pTileRow = pTile; y < nTileYSize; ADVANCEROW, pTileData += pYZoomInfo[y], y++) { - #else - for (y = nTileYSize - 1, pTileRow = pTile + ((BPP >> 3) * 320 * (nTileYSize - 1)); y >= 0; ADVANCEROW, pTileData += pYZoomInfo[nTileYSize - 1 - y], y--) { - #endif - #else - #if FLIPY == 0 - for (y = 0, pTileRow = pTile, pZTileRow = pZTile; y < nTileYSize; ADVANCEROW, ADVANCEZROW, pTileData += pYZoomInfo[y], y++) { - #else - for (y = nTileYSize - 1, pTileRow = pTile + ((BPP >> 3) * 320 * (nTileYSize - 1)), pZTileRow = pZTile + (320 * (nTileYSize - 1)); y >= 0; ADVANCEROW, ADVANCEZROW, pTileData += pYZoomInfo[nTileYSize - 1 - y], y--) { - #endif - #endif - #else - #if ZBUFFER == 0 - #if FLIPY == 0 - for (y = 0, pTileRow = pTile; y < 16; y++, ADVANCEROW, pTileData += 16) { - #else - for (y = 15, pTileRow = pTile + ((BPP >> 3) * 320 * 15); y >= 0; y--, ADVANCEROW, pTileData += 16) { - #endif - #else - #if FLIPY == 0 - for (y = 0, pTileRow = pTile, pZTileRow = pZTile; y < 16; y++, ADVANCEROW, ADVANCEZROW, pTileData += 16) { - #else - for (y = 15, pTileRow = pTile + ((BPP >> 3) * 320 * 15), pZTileRow = pZTile + (320 * 15); y >= 0; y--, ADVANCEROW, ADVANCEZROW, pTileData += 16) { - #endif - #endif - #endif - - #if DOCLIP == 1 - if (nTileYPos + y < 0) { - #if FLIPY == 0 - continue; - #else - return; - #endif - } - - if (nTileYPos + y >= 224) { - #if FLIPY == 0 - return; - #else - continue; - #endif - } - #endif - - #if ROWSCROLL == 1 - nRowOffset = (nTileXPos - BURN_ENDIAN_SWAP_INT16(pTileRowInfo[(nTileYPos + y) & 0xFF])) & nTilemapWith; - if (nRowOffset >= 320) { - nRowOffset -= nTilemapWith + 1; - } - if (nRowOffset <= -16) { - continue; - } - #endif - - #if ROWSCROLL == 1 - #define XPOS nRowOffset - #define ROWOFFSET nRowOffset - #else - #define XPOS nTileXPos - #define ROWOFFSET 0 - #endif - - #if DOCLIP == 1 || ROWSCROLL == 1 - #define CLIPPIXEL(a,b) if (XPOS >= 0 - (a) && XPOS < 320 - (a)) { PLOTPIXEL(ROWOFFSET + a,b); } - CLIPPIXEL( 0, pTileData[OFFSET( 0)]); - CLIPPIXEL( 1, pTileData[OFFSET( 1)]); - CLIPPIXEL( 2, pTileData[OFFSET( 2)]); - CLIPPIXEL( 3, pTileData[OFFSET( 3)]); - CLIPPIXEL( 4, pTileData[OFFSET( 4)]); - CLIPPIXEL( 5, pTileData[OFFSET( 5)]); - CLIPPIXEL( 6, pTileData[OFFSET( 6)]); - CLIPPIXEL( 7, pTileData[OFFSET( 7)]); CHECKX( 8); - CLIPPIXEL( 8, pTileData[OFFSET( 8)]); CHECKX( 9); - CLIPPIXEL( 9, pTileData[OFFSET( 9)]); CHECKX(10); - CLIPPIXEL(10, pTileData[OFFSET(10)]); CHECKX(11); - CLIPPIXEL(11, pTileData[OFFSET(11)]); CHECKX(12); - CLIPPIXEL(12, pTileData[OFFSET(12)]); CHECKX(13); - CLIPPIXEL(13, pTileData[OFFSET(13)]); CHECKX(14); - CLIPPIXEL(14, pTileData[OFFSET(14)]); CHECKX(15); - CLIPPIXEL(15, pTileData[OFFSET(15)]); - #undef CLIPPIXEL - #else - PLOTPIXEL( 0, pTileData[OFFSET( 0)]); - PLOTPIXEL( 1, pTileData[OFFSET( 1)]); - PLOTPIXEL( 2, pTileData[OFFSET( 2)]); - PLOTPIXEL( 3, pTileData[OFFSET( 3)]); - PLOTPIXEL( 4, pTileData[OFFSET( 4)]); - PLOTPIXEL( 5, pTileData[OFFSET( 5)]); - PLOTPIXEL( 6, pTileData[OFFSET( 6)]); - PLOTPIXEL( 7, pTileData[OFFSET( 7)]); CHECKX( 8); - PLOTPIXEL( 8, pTileData[OFFSET( 8)]); CHECKX( 9); - PLOTPIXEL( 9, pTileData[OFFSET( 9)]); CHECKX(10); - PLOTPIXEL(10, pTileData[OFFSET(10)]); CHECKX(11); - PLOTPIXEL(11, pTileData[OFFSET(11)]); CHECKX(12); - PLOTPIXEL(12, pTileData[OFFSET(12)]); CHECKX(13); - PLOTPIXEL(13, pTileData[OFFSET(13)]); CHECKX(14); - PLOTPIXEL(14, pTileData[OFFSET(14)]); CHECKX(15); - PLOTPIXEL(15, pTileData[OFFSET(15)]); - #endif - - #undef ROWOFFSET - #undef XPOS - } -#endif -} - -#undef DOFLIP -#undef FLIPX -#undef FLIPY -#undef OFFSET -#undef CHECKX -#undef ZOOMMODE -#undef ZBUF -#undef TRANSMODE -#undef CLIP -#undef WRITEZBUF -#undef PLOTPIXEL -#undef TESTCOLOUR -#undef TESTZBUF -#undef ADVANCEROW -#undef ADVANCEZROW -#undef SCROLL -#undef SELECT -#undef DEPTH -#undef FUNCTIONNAME -#undef FN - diff --git a/jan/src/burn/drv/psikyo/psikyo_sprite.cpp b/jan/src/burn/drv/psikyo/psikyo_sprite.cpp deleted file mode 100644 index d77d87ab3..000000000 --- a/jan/src/burn/drv/psikyo/psikyo_sprite.cpp +++ /dev/null @@ -1,515 +0,0 @@ -// Psikyo hardware sprites -#include "psikyo.h" - -UINT8* PsikyoSpriteROM = NULL; -UINT8* PsikyoSpriteRAM = NULL; -UINT8* PsikyoSpriteLUT = NULL; - -struct PsikyoSprite { - INT8 flip; - INT8 priority; - INT16 palette; - INT32 x; INT32 y; - INT32 xsize; INT32 ysize; - INT32 xzoom; INT32 yzoom; - INT32 address; -}; - -static INT32 nFrame; - -static INT8* PsikyoSpriteAttrib = NULL; -static INT32 nSpriteAddressMask; - -static PsikyoSprite* pSpriteLists = NULL; -static PsikyoSprite* pSpriteList = NULL; - -static INT32* PsikyoZoomXTable = NULL; -static INT32* PsikyoZoomYTable = NULL; - -static UINT8* pTile; -static UINT8* pTileData; -static UINT32* pTilePalette; - -static UINT16* pZBuffer = NULL; -static UINT16* pZTile; - -static INT32 *pXZoomInfo, *pYZoomInfo; - -static INT32 nTileXPos, nTileYPos, nZPos, nTileXSize, nTileYSize; -static INT32 nXSize, nYSize; - -static INT32 nFirstSprites[8], nLastSprites[8]; -static INT32 *nFirstSprite, *nLastSprite; - -static INT32 nTopSprite; -static INT32 nZOffset; - -typedef void (*RenderSpriteFunction)(); - -// Include the tile rendering functions -#include "psikyo_sprite_func.h" - -static void GetBuffers(INT32 nBuffer) -{ - pSpriteList = pSpriteLists + (nBuffer << 10); - nFirstSprite = nFirstSprites + (nBuffer << 2); - nLastSprite = nLastSprites + (nBuffer << 2); -} - -INT32 PsikyoSpriteRender(INT32 nLowPriority, INT32 nHighPriority) -{ - static INT32 nMaskLeft, nMaskRight, nMaskTop, nMaskBottom; - PsikyoSprite* pBuffer; - INT32 nRenderFunction; - - UINT8* pStart; - UINT16* pZStart = NULL; - - INT32 nAddress, nTransColour, nNextTileX, nNextTileY, nXZoom, nYZoom, nStartXPos; - INT32 nPriorityMask = 0; - INT32 nMaxZPos = -1; - INT32 nMinZPos = 0x00010000; - INT32 nUseBuffer = 0x00010000; - INT32 nCurrentZPos; - - if ((nBurnLayer & 1) == 0) { - return 0; - } - - if (nLowPriority == 0) { - nZPos = -1; - nTopSprite = -1; - - nMaskLeft = nMaskTop = 9999; - nMaskRight = nMaskBottom = -1; - - GetBuffers(nFrame ^ 1); - } - - if (nHighPriority < 3) { - for (INT32 i = nHighPriority + 1; i < 4; i++) { - if (nUseBuffer > nFirstSprite[i]) { - nUseBuffer = nFirstSprite[i]; - } - } - } - - nRenderFunction = (BURN_ENDIAN_SWAP_INT16(((UINT16*)PsikyoSpriteRAM)[0x0FFF]) & 4) << 4; - nTransColour = (nRenderFunction & 64) ? 0 : 15; - - for (INT32 i = nLowPriority; i <= nHighPriority; i++) { - if (nMinZPos > nFirstSprite[i]) { - nMinZPos = nFirstSprite[i]; - } - if (nMaxZPos < nLastSprite[i]) { - nMaxZPos = nLastSprite[i]; - } - nPriorityMask |= 1 << i; - } - - nCurrentZPos = nMinZPos; - - nPriorityMask &= nSpriteEnable; - if (nPriorityMask == 0) { - return 0; - } - - for (pBuffer = pSpriteList + nCurrentZPos; nCurrentZPos <= nMaxZPos; pBuffer++, nCurrentZPos++) { - - if ((pBuffer->priority & nPriorityMask) == 0) { - continue; - } - - nTileXPos = pBuffer->x; - nTileYPos = pBuffer->y; - - pTilePalette = PsikyoPalette + pBuffer->palette; - - nXSize = pBuffer->xsize; - nYSize = pBuffer->ysize; - - nRenderFunction &= 64; - nRenderFunction |= pBuffer->flip << 3; - - nAddress = pBuffer->address; - - switch (pBuffer->flip) { - case 1: - nNextTileX = -1; - nNextTileY = nXSize << 1; - nAddress -= nXSize + 1; - break; - case 2: - nNextTileX = 1; - nNextTileY = -nXSize << 1; - nAddress += (nYSize + 1) * nXSize; - break; - case 3: - nNextTileX = -1; - nNextTileY = 0; - nAddress += nYSize * nXSize - 1; - break; - default: - nNextTileX = 1; - nNextTileY = 0; - } - - if (pBuffer->xzoom == 0 && pBuffer->yzoom == 0) { // This sprite doesn't use zooming - - if (nTopSprite > nCurrentZPos) { // Test ZBuffer - if (nTileXPos < nMaskRight && (nTileXPos + nXSize * 16) >= nMaskLeft && nTileYPos < nMaskBottom && (nTileYPos + nYSize * 16) >= nMaskTop) { - nRenderFunction |= 2; - } - } - - if (nUseBuffer < nCurrentZPos) { // Write ZBuffer - nRenderFunction |= 4; - - if (nTileXPos < nMaskLeft) { - nMaskLeft = nTileXPos; - } - if ((nTileXPos + nXSize) > nMaskRight) { - nMaskRight = nTileXPos + nXSize * 16; - } - if (nTileYPos < nMaskTop) { - nMaskTop = nTileYPos; - } - if ((nTileYPos + nYSize) > nMaskBottom) { - nMaskBottom = nTileYPos + nYSize * 16; - } - } - - if (nRenderFunction & 6) { - pZStart = pZBuffer + (nTileYPos * 320) + nTileXPos; - nZPos = nZOffset + nCurrentZPos; - } - - pStart = pBurnDraw + (nTileYPos * nBurnPitch) + (nTileXPos * nBurnBpp); - - for (INT32 y = 0; y < nYSize; y++, nTileYPos += 16, pStart += 16 * nBurnPitch, pZStart += 16 * 320) { - nTileXPos = pBuffer->x; - - pTile = pStart; - pZTile = pZStart; - - nAddress += nNextTileY; - - for (INT32 x = 0; x < nXSize; x++, nTileXPos += 16, nAddress += nNextTileX, pTile += nBurnBpp << 4, pZTile += 16) { - - if (PsikyoSpriteAttrib[BURN_ENDIAN_SWAP_INT16(((UINT16*)PsikyoSpriteLUT)[nAddress])] == nTransColour) { - continue; - } - - pTileData = PsikyoSpriteROM + ((BURN_ENDIAN_SWAP_INT16(((UINT16*)PsikyoSpriteLUT)[nAddress]) << 8) & nSpriteAddressMask); - if (nTileYPos < 0 || nTileYPos > 208 || nTileXPos < 0 || nTileXPos > 304) { - if (nTileYPos > -16 && nTileYPos < 224 && nTileXPos > -16 && nTileXPos < 320) { - RenderSprite[nRenderFunction + 1](); - } - } else { - RenderSprite[nRenderFunction + 0](); - } - } - } - } else { // This sprite uses zooming - nXZoom = pBuffer->xzoom; - nYZoom = pBuffer->yzoom; - - nTileXPos += (nXSize * nXZoom + 3) >> 2; - nTileYPos += (nYSize * nYZoom + 3) >> 2; - - nXZoom = 32 - nXZoom; - nYZoom = 32 - nYZoom; - - if (nTopSprite > nCurrentZPos) { // Test ZBuffer - if (nTileXPos < nMaskRight && (nTileXPos + nXSize * nXZoom / 2) >= nMaskLeft && nTileYPos < nMaskBottom && (nTileYPos + nYSize * nXZoom / 2) >= nMaskTop) { - nRenderFunction |= 2; - } - } - - if (nUseBuffer < nCurrentZPos) { // Write ZBuffer - nRenderFunction |= 4; - - if (nTileXPos < nMaskLeft) { - nMaskLeft = nTileXPos; - } - if ((nTileXPos + nXSize) > nMaskRight) { - nMaskRight = nTileXPos + nXSize * nXZoom / 2; - } - if (nTileYPos < nMaskTop) { - nMaskTop = nTileYPos; - } - if ((nTileYPos + nYSize) > nMaskBottom) { - nMaskBottom = nTileYPos + nYSize * nYZoom / 2; - } - } - - if (nRenderFunction & 6) { - pZStart = pZBuffer + (nTileYPos * 320) + nTileXPos; - nZPos = nZOffset + nCurrentZPos; - } - - pStart = pBurnDraw + (nTileYPos * nBurnPitch) + (nTileXPos * nBurnBpp); - nStartXPos = nTileXPos; - - for (INT32 y = 0; y < nYSize; y++, nTileYPos += nTileYSize, pStart += nTileYSize * nBurnPitch, pZStart += nTileYSize * 320) { - nTileXPos = nStartXPos; - - pTile = pStart; - pZTile = pZStart; - - nAddress += nNextTileY; - - nTileYSize = (y + 1) * nYZoom / 2 - (y * nYZoom / 2); - pYZoomInfo = PsikyoZoomYTable + (nTileYSize << 4); - - for (INT32 x = 0; x < nXSize; x++, nTileXPos += nTileXSize, nAddress += nNextTileX, pTile += nBurnBpp * nTileXSize, pZTile += nTileXSize) { - - nTileXSize = (x + 1) * nXZoom / 2 - (x * nXZoom / 2); - - if (PsikyoSpriteAttrib[BURN_ENDIAN_SWAP_INT16(((UINT16*)PsikyoSpriteLUT)[nAddress])] == nTransColour) { - continue; - } - - pXZoomInfo = PsikyoZoomXTable + (nTileXSize << 4); - pTileData = PsikyoSpriteROM + ((BURN_ENDIAN_SWAP_INT16(((UINT16*)PsikyoSpriteLUT)[nAddress]) << 8) & nSpriteAddressMask); - if (nTileYPos < 0 || nTileYPos > (224 - nTileYSize) || nTileXPos < 0 || nTileXPos > (320 - nTileXSize)) { - if (nTileYPos > -nTileYSize && nTileYPos < 224 && nTileXPos > -nTileXSize && nTileXPos < 320) { - RenderSprite[nRenderFunction + 33](); - } - } else { - RenderSprite[nRenderFunction + 32](); - } - } - } - } - } - - if (nMaxZPos > nTopSprite) { - nTopSprite = nMaxZPos; - } - - if (nHighPriority == 3) { - if (nZPos >= 0) { - nZOffset += nTopSprite; - if (nZOffset > 0xFC00) { - memset(pZBuffer, 0, 320 * 224 * sizeof(UINT16)); - nZOffset = 0; - } - } - } - - return 0; -} - -INT32 PsikyoSpriteBuffer() -{ - UINT16* pSprite; - PsikyoSprite* pBuffer; - INT32 nPriority; - - UINT16 word; - INT32 x, y, xs, ys; - - nFrame ^= 1; - - GetBuffers(nFrame); - - pBuffer = pSpriteList; - - nFirstSprite[0] = 0x00010000; - nFirstSprite[1] = 0x00010000; - nFirstSprite[2] = 0x00010000; - nFirstSprite[3] = 0x00010000; - - nLastSprite[0] = -1; - nLastSprite[1] = -1; - nLastSprite[2] = -1; - nLastSprite[3] = -1; - - // Check if sprites are disabled - if (BURN_ENDIAN_SWAP_INT16(((UINT16*)PsikyoSpriteRAM)[0x0FFF]) & 1) { - return 0; - } - - for (INT32 i = 0x0C00, z = 0; i < 0x0FFF; i++) { - - word = BURN_ENDIAN_SWAP_INT16(((UINT16*)PsikyoSpriteRAM)[i]); - - // Check for end-marker - if (word == 0xFFFF) { - break; - } - - if (word >= 0x0300) { - continue; - } - - // Point to sprite - pSprite = &(((UINT16*)PsikyoSpriteRAM)[word * 4]); - - x = BURN_ENDIAN_SWAP_INT16(pSprite[1]) & 0x01FF; - y = BURN_ENDIAN_SWAP_INT16(pSprite[0]) & 0x01FF; - - xs = ((BURN_ENDIAN_SWAP_INT16(pSprite[1]) >> 9) & 0x0007) + 1; - ys = ((BURN_ENDIAN_SWAP_INT16(pSprite[0]) >> 9) & 0x0007) + 1; - - if (x >= 320) { - x -= 512; - if (x + (xs << 4) < 0) { - continue; - } - } - if (y >= 224) { - y -= 512; - if (y + (ys << 4) < 0) { - continue; - } - } - - // Sprite is active and most likely on screen, so add it to the buffer - - word = BURN_ENDIAN_SWAP_INT16(pSprite[2]); - - nPriority = 3 - ((word >> 6) & 0x03); - - if (nLastSprite[nPriority] == -1) { - nFirstSprite[nPriority] = z; - } - nLastSprite[nPriority] = z; - - pBuffer->priority = 1 << nPriority; - - pBuffer->xzoom = BURN_ENDIAN_SWAP_INT16(pSprite[1]) >> 12; - pBuffer->yzoom = BURN_ENDIAN_SWAP_INT16(pSprite[0]) >> 12; - - pBuffer->xsize = xs; - pBuffer->ysize = ys; - - pBuffer->x = x; - pBuffer->y = y; - - pBuffer->flip = (word >> 14) & 0x03; - pBuffer->palette = (word >> 4) & 0x01F0; - - pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[3]) | ((word & 1) << 16); - - pBuffer++; - z++; - } - - return 0; -} - -void PsikyoSpriteExit() -{ - BurnFree(PsikyoZoomXTable); - BurnFree(PsikyoZoomYTable); - BurnFree(PsikyoSpriteAttrib); - BurnFree(pSpriteLists); - BurnFree(pZBuffer); - - return; -} - -INT32 PsikyoSpriteInit(INT32 nROMSize) -{ - const INT32 nTileSize = 256; - INT32 nNumTiles = nROMSize / nTileSize; - - if (pSpriteLists) { - BurnFree(pSpriteLists); - } - pSpriteLists = (PsikyoSprite*)BurnMalloc(0x0800 * sizeof(PsikyoSprite)); - if (pSpriteLists == NULL) { - PsikyoSpriteExit(); - return 1; - } - - for (INT32 i = 0; i < 8; i++) { - nFirstSprites[i] = 0x00010000; - nLastSprites[i] = -1; - } - - if (pZBuffer) { - BurnFree(pZBuffer); - } - pZBuffer = (UINT16*)BurnMalloc(320 * 224 * sizeof(UINT16)); - if (pZBuffer == NULL) { - PsikyoSpriteExit(); - return 1; - } - - memset(pZBuffer, 0, 320 * 224 * sizeof(UINT16)); - nZOffset = 0; - - for (nSpriteAddressMask = 1; nSpriteAddressMask < nROMSize; nSpriteAddressMask <<= 1) {} - nSpriteAddressMask--; - - if (PsikyoSpriteAttrib) { - BurnFree(PsikyoSpriteAttrib); - } - PsikyoSpriteAttrib = (INT8*)BurnMalloc(nSpriteAddressMask + 1); - if (PsikyoSpriteAttrib == NULL) { - return 1; - } - - for (INT32 i = 0; i < nNumTiles; i++) { - bool bTransparent0 = true; - bool bTransparent15 = true; - for (INT32 j = i * nTileSize; j < (i + 1) * nTileSize; j++) { - if (PsikyoSpriteROM[j] != 0x00) { - bTransparent0 = false; - if (!bTransparent15) { - break; - } - } - if (PsikyoSpriteROM[j] != 0xFF) { - bTransparent15 = false; - if (!bTransparent0) { - break; - } - } - } - PsikyoSpriteAttrib[i] = (INT8)0xFF; - if (bTransparent0) { - PsikyoSpriteAttrib[i] = 0; - } - if (bTransparent15) { - PsikyoSpriteAttrib[i] = 15; - } - } - - for (INT32 i = nNumTiles; i <= nSpriteAddressMask; i++) { - PsikyoSpriteAttrib[i] = (INT8)0xFF; - } - - PsikyoZoomXTable = (INT32*)BurnMalloc(272 * sizeof(INT32)); - PsikyoZoomYTable = (INT32*)BurnMalloc(272 * sizeof(INT32)); - if (PsikyoZoomXTable == NULL || PsikyoZoomYTable == NULL) { - PsikyoSpriteExit(); - return 1; - } - - memset(PsikyoZoomXTable, 0, 272 * sizeof(INT32)); - memset(PsikyoZoomYTable, 0, 272 * sizeof(INT32)); - - for (INT32 z = 8; z < 16; z++) { - for (INT32 i = 0, x = 0; i < z; i++, x += 0x100000 / z) { - PsikyoZoomXTable[(z << 4) + i] = (x + 0x8000) >> 16; - } - for (INT32 i = 1; i < z; i++) { - PsikyoZoomYTable[(z << 4) + i - 1] = (PsikyoZoomXTable[(z << 4) + i] - PsikyoZoomXTable[(z << 4) + i - 1]) << 4; -// bprintf(PRINT_NORMAL, "%2i:%2i - ", PsikyoZoomXTable[(z << 4) + i - 1], PsikyoZoomYTable[(z << 4) + i - 1]); - } - PsikyoZoomYTable[(z << 4) + z - 1] = PsikyoZoomYTable[(z << 4)]; -// bprintf(PRINT_NORMAL, "%2i:%2i\n", PsikyoZoomXTable[(z << 4) + z - 1], PsikyoZoomYTable[(z << 4) + z - 1]); - } - for (INT32 i = 0; i < 16; i++) { - PsikyoZoomXTable[256 + i] = i; - PsikyoZoomYTable[256 + i] = 16; - } - - nFrame = 0; - - return 0; -} diff --git a/jan/src/burn/drv/psikyo/psikyo_sprite_func.h b/jan/src/burn/drv/psikyo/psikyo_sprite_func.h deleted file mode 100644 index 8192f263a..000000000 --- a/jan/src/burn/drv/psikyo/psikyo_sprite_func.h +++ /dev/null @@ -1,761 +0,0 @@ -#define ROT 0 -#define BPP 16 -#define ROWSCROLL 0 - -#define TRANS 0 - -#define ZOOM 0 - -#define FLIP 0 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 1 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 2 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 3 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP - -#undef ZOOM -#define ZOOM 1 - -#define FLIP 0 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 1 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 2 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 3 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP - -#undef ZOOM - -#undef TRANS -#define TRANS 15 - -#define ZOOM 0 - -#define FLIP 0 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 1 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 2 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 3 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP - -#undef ZOOM -#define ZOOM 1 - -#define FLIP 0 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 1 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 2 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP -#define FLIP 3 - -#define ZBUFFER 0 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 1 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 2 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER -#define ZBUFFER 3 - -#define DOCLIP 0 -#include "psikyo_render.h" -#undef DOCLIP -#define DOCLIP 1 -#include "psikyo_render.h" -#undef DOCLIP - -#undef ZBUFFER - -#undef FLIP - -#undef ZOOM - -#undef TRANS - -#undef ROWSCROLL -#undef ROT -#undef BPP - -// no zbuffer/no clip, no zbuffer/clip, read zbuffer/no clip, read zbuffer/clip, write zbuffer/no clip, write zbuffer/clip, read/write zbuffer/no clip, read/write zbuffer/clip, -static RenderSpriteFunction RenderSprite[] = { - // Transparency 15, no zooming - &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_CLIP, - // Transparency 15, zooming - &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS15_NOFLIP_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPX_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPY_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS15_FLIPXY_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_CLIP, - - // Transparency 0, no zooming - &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_NOZOOM_RWZBUFFER_CLIP, - // Transparency 0, zooming - &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS0_NOFLIP_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPX_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPY_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_CLIP, - &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_ZOOM_NOZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_ZOOM_RZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_ZOOM_WZBUFFER_CLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_NOCLIP, &RenderTile16_TRANS0_FLIPXY_ROT0_NOROWSCROLL_ZOOM_RWZBUFFER_CLIP, -}; diff --git a/jan/src/burn/drv/psikyo/psikyo_tile.cpp b/jan/src/burn/drv/psikyo/psikyo_tile.cpp deleted file mode 100644 index 614abdfc0..000000000 --- a/jan/src/burn/drv/psikyo/psikyo_tile.cpp +++ /dev/null @@ -1,283 +0,0 @@ -// Psikyo hardware tilemaps - -#include "psikyo.h" - -UINT8* PsikyoTileROM; -UINT8* PsikyoTileRAM[3] = { NULL, }; - -bool bPsikyoClearBackground; - -static UINT32 PsikyoLayerAttrib[3] = { 0, }; -static INT32 PsikyoLayerXOffset[2] = { 0, }; -static INT32 PsikyoLayerYOffset[2] = { 0, }; - -static INT8* PsikyoTileAttrib = { NULL, }; -static INT32 PsikyoTileMask; - -static UINT32 PsikyoTileBank[2]; - -static UINT8* pTile; -static UINT8* pTileData; -static UINT32* pTilePalette; -static INT16* pTileRowInfo; - -typedef void (*RenderTileFunction)(); - -static INT32 nTilemapWith, nTileXPos, nTileYPos; - -// Include the tile rendering functions -#include "psikyo_tile_func.h" - -static void PsikyoRenderLayer(INT32 nLayer) -{ - static INT32 nLayerXSize[] = { 0x0040, 0x0080, 0x0100, 0x0020 }; -// static INT32 nLayerYSize[] = { 0x0040, 0x0020, 0x0010, 0x0080 }; - - INT32 x, y; - INT32 ax, bx, ay, by, cx, cy, mx; - INT32 minx, maxx; - INT32 nTileColumn, nTileRow; - UINT32 nTileNumber, nTilePalette, nTileBank; - INT32 nRenderFunction, nTransColour; - bool bClip; - - UINT16* pTileRAM = (UINT16*)(PsikyoTileRAM[nLayer]); - - UINT32* LayerPalette = PsikyoPalette + (nLayer ? 0x0C00 : 0x0800); - - nTileBank = PsikyoTileBank[nLayer]; - - mx = nLayerXSize[(PsikyoLayerAttrib[nLayer] & 0xC0) >> 6]; - - pTileRowInfo = (INT16*)(PsikyoTileRAM[2] + (nLayer << 9)); - nTilemapWith = (mx << 4) - 1; - - nRenderFunction = 8; - nTransColour = 99; - if ((bPsikyoClearBackground || nLayer) && (PsikyoLayerAttrib[nLayer] & 0x02) == 0) { - if (PsikyoLayerAttrib[nLayer] & 0x08) { - nRenderFunction = 0; - nTransColour = 0; - } else { - nRenderFunction = 4; - nTransColour = 15; - } - } - - // Compute the tile offsets - ax = PsikyoLayerXOffset[nLayer]; - bx = 16 - (ax & 0x0F); - cx = (ax >> 4) + 1; - - ay = PsikyoLayerYOffset[nLayer]; - by = 16 - (ay & 0x0F); - cy = ((ay >> 4) + 1) * mx; - - for (nTileYPos = -16 + by, y = -mx; nTileYPos < 224; nTileYPos += 16, y += mx) { - - if (nTileYPos <= -16) { - continue; - } - - nTileRow = (cy + y) & 0x0FFF; - - bClip = (nTileYPos < 0 || nTileYPos > 208); - - if (PsikyoLayerAttrib[nLayer] & 0x0300) { - if (PsikyoLayerAttrib[nLayer] & 0x0200) { - - // per-tile rowscroll; each tilerow has it's own offset to the tilemap x offset - - minx = (INT16)BURN_ENDIAN_SWAP_INT16(pTileRowInfo[(nTileYPos >> 4) & 0x0F]); - } else { - - // Rowscroll enabled - - minx = 32767; maxx = -32768; - - // Compute the min/max row offsets - for (INT32 i = 0; i < 16; i++) { - if ((INT16)BURN_ENDIAN_SWAP_INT16(pTileRowInfo[(nTileYPos + i) & 0xFF]) > maxx) { - maxx = (INT16)BURN_ENDIAN_SWAP_INT16(pTileRowInfo[(nTileYPos + i) & 0xFF]); - } - if ((INT16)BURN_ENDIAN_SWAP_INT16(pTileRowInfo[(nTileYPos + i) & 0xFF]) < minx) { - minx = (INT16)BURN_ENDIAN_SWAP_INT16(pTileRowInfo[(nTileYPos + i) & 0xFF]); - } - } - - // If rowscroll is enabled, but each line of the tilerow has the - // same offset, we can use the normal tilemap rendering - // Otherwise, use specific rowscroll rendering - if (minx != maxx) { - - // Compute the tile offsets - ax = PsikyoLayerXOffset[nLayer]; - bx = 16 - (ax & 0x0F); - cx = (ax >> 4) + 1; - - maxx = 21 + (maxx >> 4); - minx = (minx - 16) >> 4; - - for (x = minx, nTileXPos = (minx << 4) + bx; x < maxx; x++, nTileXPos += 16) { - - nTileColumn = (cx + x) & (mx - 1); - nTileNumber = BURN_ENDIAN_SWAP_INT16(pTileRAM[nTileRow + nTileColumn]); - nTilePalette = nTileNumber >> 13; - nTileNumber = (nTileNumber & 0x1FFF) + nTileBank; - - if (PsikyoTileAttrib[nTileNumber] == nTransColour) { - continue; - } - - pTile = pBurnDraw + (nTileYPos * nBurnPitch); - pTileData = PsikyoTileROM + (nTileNumber << 8); - pTilePalette = LayerPalette + (nTilePalette << 4); - - if (bClip) { - RenderTile[nRenderFunction + 3](); - } else { - RenderTile[nRenderFunction + 2](); - } - } - - continue; - } - } - - // Compute the tile offsets - ax = PsikyoLayerXOffset[nLayer] + minx; - bx = 16 - (ax & 0x0F); - cx = (ax >> 4) + 1; - } - - for (nTileXPos = -16 + bx, x = -1; nTileXPos < 320; nTileXPos += 16, x++) { - - if (nTileXPos <= -16) { - continue; - } - - nTileColumn = (cx + x) & (mx - 1); - nTileNumber = BURN_ENDIAN_SWAP_INT16(pTileRAM[nTileRow + nTileColumn]); - nTilePalette = nTileNumber >> 13; - nTileNumber = (nTileNumber & 0x1FFF) + nTileBank; - - if (PsikyoTileAttrib[nTileNumber] == nTransColour) { - continue; - } - - pTile = pBurnDraw + (nTileYPos * nBurnPitch) + (nTileXPos * nBurnBpp); - pTileData = PsikyoTileROM + (nTileNumber << 8); - pTilePalette = LayerPalette + (nTilePalette << 4); - - if (bClip || nTileXPos < 0 || nTileXPos > 304) { - RenderTile[nRenderFunction + 1](); - } else { - RenderTile[nRenderFunction + 0](); - } - } - } - - return; -} - -void PsikyoSetTileBank(INT32 nLayer, INT32 nBank) -{ - PsikyoTileBank[nLayer] = nBank << 13; -} - -INT32 PsikyoTileRender() -{ - INT32 nPriority, nLowPriority = 0; - - PsikyoLayerAttrib[0] = BURN_ENDIAN_SWAP_INT16(*((INT16*)(PsikyoTileRAM[2] + 0x0412))); - PsikyoLayerXOffset[0] = BURN_ENDIAN_SWAP_INT16(*((INT16*)(PsikyoTileRAM[2] + 0x0406))); - PsikyoLayerYOffset[0] = BURN_ENDIAN_SWAP_INT16(*((INT16*)(PsikyoTileRAM[2] + 0x0402))); - - PsikyoLayerAttrib[1] = BURN_ENDIAN_SWAP_INT16(*((INT16*)(PsikyoTileRAM[2] + 0x0416))); - PsikyoLayerXOffset[1] = BURN_ENDIAN_SWAP_INT16(*((INT16*)(PsikyoTileRAM[2] + 0x040E))); - PsikyoLayerYOffset[1] = BURN_ENDIAN_SWAP_INT16(*((INT16*)(PsikyoTileRAM[2] + 0x040A))); - - if (PsikyoHardwareVersion == PSIKYO_HW_GUNBIRD) { - PsikyoTileBank[0] = (PsikyoLayerAttrib[0] & 0x0400) << 3; - PsikyoTileBank[1] = (PsikyoLayerAttrib[1] & 0x0400) << 3; - } - - if (bPsikyoClearBackground || ((PsikyoLayerAttrib[0] & 0x01) && (PsikyoLayerAttrib[1] & 0x02)) || (nBurnLayer & 0x0C) != 0x0C) { - BurnClearScreen(); - } - - for (nPriority = 1; nPriority < 4; nPriority++) { - - INT32 nLayer = nPriority - 1; - - if ((PsikyoLayerAttrib[nLayer] & 1) == 0 || nPriority == 3) { - PsikyoSpriteRender(nLowPriority, nPriority); - nLowPriority = nPriority + 1; - } - - if (nLayer < 2 && (PsikyoLayerAttrib[nLayer] & 1) == 0 && (PsikyoLayerAttrib[nLayer + 1] & 0x02) == 0 && (nBurnLayer & (4 << nLayer))) { - PsikyoRenderLayer(nLayer); - } - } - - return 0; -} - -void PsikyoTileExit() -{ - BurnFree(PsikyoTileAttrib); - - return; -} - -INT32 PsikyoTileInit(UINT32 nROMSize) -{ - const INT32 nTileSize = 256; - INT32 nNumTiles = nROMSize / nTileSize; - - for (PsikyoTileMask = 1; PsikyoTileMask < nNumTiles; PsikyoTileMask <<= 1) { } - PsikyoTileMask--; - - if (PsikyoTileAttrib) { - BurnFree(PsikyoTileAttrib); - } - PsikyoTileAttrib = (INT8*)BurnMalloc(PsikyoTileMask + 1); - if (PsikyoTileAttrib == NULL) { - return 1; - } - - for (INT32 i = 0; i < nNumTiles; i++) { - bool bTransparent0 = true; - bool bTransparent15 = true; - for (INT32 j = i * nTileSize; j < (i + 1) * nTileSize; j++) { - if (PsikyoTileROM[j] != 0x00) { - bTransparent0 = false; - if (!bTransparent15) { - break; - } - } - if (PsikyoTileROM[j] != 0xFF) { - bTransparent15 = false; - if (!bTransparent0) { - break; - } - } - } - PsikyoTileAttrib[i] = (INT8)0xFF; - if (bTransparent0) { - PsikyoTileAttrib[i] = 0; - } - if (bTransparent15) { - PsikyoTileAttrib[i] = 15; - } - } - - for (INT32 i = nNumTiles; i <= PsikyoTileMask; i++) { - PsikyoTileAttrib[i] = (INT8)0xFF; - } - - PsikyoTileBank[0] = 0x0000; - PsikyoTileBank[1] = 0x2000; - - return 0; -} diff --git a/jan/src/burn/drv/psikyo/psikyosh_render.cpp b/jan/src/burn/drv/psikyo/psikyosh_render.cpp deleted file mode 100644 index d038b7a32..000000000 --- a/jan/src/burn/drv/psikyo/psikyosh_render.cpp +++ /dev/null @@ -1,744 +0,0 @@ -// Video rendering module for Psikyo SH2 games -// Lots of code here and there ripped directly from MAME -// Thanks to David Haywood for the initial MAME driver -// as well as some other valuable pointers. - -#include "tiles_generic.h" // nScreenWidth & nScreenHeight -#include "psikyosh_render.h" // contains loads of macros - -UINT8 *pPsikyoshTiles; -UINT32 *pPsikyoshSpriteBuffer; -UINT32 *pPsikyoshBgRAM; -UINT32 *pPsikyoshVidRegs; -UINT32 *pPsikyoshPalRAM; -UINT32 *pPsikyoshZoomRAM; - -static UINT8 *DrvTransTab; -static UINT8 alphatable[0x100]; - -static UINT16 *DrvPriBmp; -static UINT8 *DrvZoomBmp; -static INT32 nDrvZoomPrev = -1; -static UINT32 *DrvTmpDraw; -static UINT32 *DrvTmpDraw_ptr; - -static INT32 nGraphicsMin0; // minimum tile number 4bpp -static INT32 nGraphicsMin1; // for 8bpp -static INT32 nGraphicsSize; // normal -static INT32 nGraphicsSize0; // for 4bpp -static INT32 nGraphicsSize1; // for 8bpp - -//-------------------------------------------------------------------------------- - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s, UINT32 p) -{ - if (p == 0) return d; - - INT32 a = 256 - p; - - return (((((s & 0xff00ff) * p) + ((d & 0xff00ff) * a)) & 0xff00ff00) | - ((((s & 0x00ff00) * p) + ((d & 0x00ff00) * a)) & 0x00ff0000)) >> 8; -} - -//-------------------------------------------------------------------------------- - -static void draw_blendy_tile(INT32 gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 alpha, INT32 z) -{ - color <<= 4; - UINT32 *pal = pBurnDrvPalette + color; - - if (gfx == 0) { - code &= 0x7ffff; - code -= nGraphicsMin0; - if (code < 0 || code > nGraphicsSize0) return; - - if (DrvTransTab[code >> 3] & (1 << (code & 7))) return; - - UINT8 *src = pPsikyoshTiles + (code << 7); - - INT32 inc = 8; - if (fy) { - inc = -8; - src += 0x78; - } - - if (sx >= 0 && sx < (nScreenWidth-15) && sy >= 0 && sy <= (nScreenHeight-15)) { - if (z > 0) { - if (fx) { - if (alpha == 0xff) { - PUTPIXEL_4BPP_NORMAL_PRIO_FLIPX() - } else if (alpha >= 0) { - PUTPIXEL_4BPP_ALPHA_PRIO_FLIPX() - } else { - PUTPIXEL_4BPP_ALPHATAB_PRIO_FLIPX() - } - } else { - if (alpha == 0xff) { - PUTPIXEL_4BPP_NORMAL_PRIO() - } else if (alpha >= 0) { - PUTPIXEL_4BPP_ALPHA_PRIO() - } else { - PUTPIXEL_4BPP_ALPHATAB_PRIO() - } - } - } else { - if (fx) { - if (alpha == 0xff) { - PUTPIXEL_4BPP_NORMAL_FLIPX() - } else if (alpha >= 0) { - PUTPIXEL_4BPP_ALPHA_FLIPX() - } else { - PUTPIXEL_4BPP_ALPHATAB_FLIPX() - } - } else { - if (alpha == 0xff) { - PUTPIXEL_4BPP_NORMAL() - } else if (alpha >= 0) { - PUTPIXEL_4BPP_ALPHA() - } else { - PUTPIXEL_4BPP_ALPHATAB() - } - } - } - } else { - if (z > 0) { - if (fx) { - if (alpha == 0xff) { - PUTPIXEL_4BPP_NORMAL_PRIO_FLIPX_CLIP() - } else if (alpha >= 0) { - PUTPIXEL_4BPP_ALPHA_PRIO_FLIPX_CLIP() - } else { - PUTPIXEL_4BPP_ALPHATAB_PRIO_FLIPX_CLIP() - } - } else { - if (alpha == 0xff) { - PUTPIXEL_4BPP_NORMAL_PRIO_CLIP() - } else if (alpha >= 0) { - PUTPIXEL_4BPP_ALPHA_PRIO_CLIP() - } else { - PUTPIXEL_4BPP_ALPHATAB_PRIO_CLIP() - } - } - } else { - if (fx) { - if (alpha == 0xff) { - PUTPIXEL_4BPP_NORMAL_FLIPX_CLIP() - } else if (alpha >= 0) { - PUTPIXEL_4BPP_ALPHA_FLIPX_CLIP() - } else { - PUTPIXEL_4BPP_ALPHATAB_FLIPX_CLIP() - } - } else { - if (alpha == 0xff) { - PUTPIXEL_4BPP_NORMAL_CLIP() - } else if (alpha >= 0) { - PUTPIXEL_4BPP_ALPHA_CLIP() - } else { - PUTPIXEL_4BPP_ALPHATAB_CLIP() - } - } - } - } - } else { - code &= 0x3ffff; - code -= nGraphicsMin1; - if (code < 0 || code > nGraphicsSize0) return; - - if (DrvTransTab[(code >> 3) + 0x10000] & (1 << (code & 7))) return; - - UINT8 *src = pPsikyoshTiles + (code << 8); - - INT32 inc = 16; - if (fy) { - inc = -16; - src += 0xf0; - } - - if (sx >= 0 && sx < (nScreenWidth-15) && sy >= 0 && sy < (nScreenHeight-15)) { - if (z > 0) { - if (fx) { - if (alpha == 0xff) { - PUTPIXEL_8BPP_NORMAL_PRIO_FLIPX() - } else if (alpha >= 0) { - PUTPIXEL_8BPP_ALPHA_PRIO_FLIPX() - } else { - PUTPIXEL_8BPP_ALPHATAB_PRIO_FLIPX() - } - } else { - if (alpha == 0xff) { - PUTPIXEL_8BPP_NORMAL_PRIO() - } else if (alpha >= 0) { - PUTPIXEL_8BPP_ALPHA_PRIO() - } else { - PUTPIXEL_8BPP_ALPHATAB_PRIO() - } - } - } else { - if (fx) { - if (alpha == 0xff) { - PUTPIXEL_8BPP_NORMAL_FLIPX() - } else if (alpha >= 0) { - PUTPIXEL_8BPP_ALPHA_FLIPX() - } else { - PUTPIXEL_8BPP_ALPHATAB_FLIPX() - } - } else { - if (alpha == 0xff) { - PUTPIXEL_8BPP_NORMAL() - } else if (alpha >= 0) { - PUTPIXEL_8BPP_ALPHA() - } else { - PUTPIXEL_8BPP_ALPHATAB() - } - } - } - } else { - if (z > 0) { - if (fx) { - if (alpha == 0xff) { - PUTPIXEL_8BPP_NORMAL_PRIO_FLIPX_CLIP() - } else if (alpha >= 0) { - PUTPIXEL_8BPP_ALPHA_PRIO_FLIPX_CLIP() - } else { - PUTPIXEL_8BPP_ALPHATAB_PRIO_FLIPX_CLIP() - } - } else { - if (alpha == 0xff) { - PUTPIXEL_8BPP_NORMAL_PRIO_CLIP() - } else if (alpha >= 0) { - PUTPIXEL_8BPP_ALPHA_PRIO_CLIP() - } else { - PUTPIXEL_8BPP_ALPHATAB_PRIO_CLIP() - } - } - } else { - if (fx) { - if (alpha == 0xff) { - PUTPIXEL_8BPP_NORMAL_FLIPX_CLIP() - } else if (alpha >= 0) { - PUTPIXEL_8BPP_ALPHA_FLIPX_CLIP() - } else { - PUTPIXEL_8BPP_ALPHATAB_FLIPX_CLIP() - } - } else { - if (alpha == 0xff) { - PUTPIXEL_8BPP_NORMAL_CLIP() - } else if (alpha >= 0) { - PUTPIXEL_8BPP_ALPHA_CLIP() - } else { - PUTPIXEL_8BPP_ALPHATAB_CLIP() - } - } - } - - } - } -} - -static void draw_prezoom(INT32 gfx, INT32 code, INT32 high, INT32 wide) -{ - // these probably aren't the safest routines, but they should be pretty fast. - - if (gfx) { - INT32 tileno = (code & 0x3ffff) - nGraphicsMin1; - if (tileno < 0 || tileno > nGraphicsSize1) tileno = 0; - if (nDrvZoomPrev == tileno) return; - nDrvZoomPrev = tileno; - UINT32 *gfxptr = (UINT32*)(pPsikyoshTiles + (tileno << 8)); - - for (INT32 ytile = 0; ytile < high; ytile++) - { - for (INT32 xtile = 0; xtile < wide; xtile++) - { - UINT32 *dest = (UINT32*)(DrvZoomBmp + (ytile << 12) + (xtile << 4)); - - for (INT32 ypixel = 0; ypixel < 16; ypixel++, gfxptr += 4) { - - dest[0] = gfxptr[0]; - dest[1] = gfxptr[1]; - dest[2] = gfxptr[2]; - dest[3] = gfxptr[3]; - - dest += 64; - } - } - } - } else { - INT32 tileno = (code & 0x7ffff) - nGraphicsMin0; - if (tileno < 0 || tileno > nGraphicsSize0) tileno = 0; - if (nDrvZoomPrev == tileno) return; - nDrvZoomPrev = tileno; - UINT8 *gfxptr = pPsikyoshTiles + (tileno << 7); - for (INT32 ytile = 0; ytile < high; ytile++) - { - for (INT32 xtile = 0; xtile < wide; xtile++) - { - UINT8 *dest = DrvZoomBmp + (ytile << 12) + (xtile << 4); - - for (INT32 ypixel = 0; ypixel < 16; ypixel++, gfxptr += 8) - { - for (INT32 xpixel = 0; xpixel < 16; xpixel+=2) - { - INT32 c = gfxptr[xpixel>>1]; - dest[xpixel ] = c >> 4; - dest[xpixel + 1] = c & 0x0f; - } - - dest += 256; - } - } - } - } -} - -static void psikyosh_drawgfxzoom(INT32 gfx, UINT32 code, INT32 color, INT32 flipx, INT32 flipy, INT32 offsx, - INT32 offsy, INT32 alpha, INT32 zoomx, INT32 zoomy, INT32 wide, INT32 high, INT32 z) -{ - if (~nBurnLayer & 8) return; - if (!zoomx || !zoomy) return; - - if (zoomx == 0x400 && zoomy == 0x400) - { - INT32 xstart, ystart, xend, yend, xinc, yinc, code_offset = 0; - - if (flipx) { xstart = wide-1; xend = -1; xinc = -1; } - else { xstart = 0; xend = wide; xinc = +1; } - - if (flipy) { ystart = high-1; yend = -1; yinc = -1; } - else { ystart = 0; yend = high; yinc = +1; } - - for (INT32 ytile = ystart; ytile != yend; ytile += yinc ) - { - for (INT32 xtile = xstart; xtile != xend; xtile += xinc ) - { - INT32 sx = offsx + (xtile << 4); - INT32 sy = offsy + (ytile << 4); - - draw_blendy_tile(gfx, code + code_offset++, color, sx, sy, flipx, flipy, alpha, z); - } - } - } - else - { - draw_prezoom(gfx, code, high, wide); - - { - UINT32 *pal = pBurnDrvPalette + (color << 4); - - INT32 sprite_screen_height = ((high << 24) / zoomy + 0x200) >> 10; - INT32 sprite_screen_width = ((wide << 24) / zoomx + 0x200) >> 10; - - if (sprite_screen_width && sprite_screen_height) - { - INT32 sx = offsx; - INT32 sy = offsy; - INT32 ex = sx + sprite_screen_width; - INT32 ey = sy + sprite_screen_height; - - INT32 x_index_base; - INT32 y_index; - - INT32 dx, dy; - - if (flipx) { x_index_base = (sprite_screen_width-1)*zoomx; dx = -zoomx; } - else { x_index_base = 0; dx = zoomx; } - - if (flipy) { y_index = (sprite_screen_height-1)*zoomy; dy = -zoomy; } - else { y_index = 0; dy = zoomy; } - - { - if (sx < 0) { - INT32 pixels = 0-sx; - sx += pixels; - x_index_base += pixels*dx; - } - if (sy < 0 ) { - INT32 pixels = 0-sy; - sy += pixels; - y_index += pixels*dy; - } - if (ex > nScreenWidth) { - INT32 pixels = ex-(nScreenWidth-1)-1; - ex -= pixels; - } - if (ey > nScreenHeight) { - INT32 pixels = ey-(nScreenHeight-1)-1; - ey -= pixels; - } - } - - if (ex > sx) - { - if (alpha == 0xff) { - if (z > 0) { - PUTPIXEL_ZOOM_NORMAL_PRIO() - } else { - PUTPIXEL_ZOOM_NORMAL() - } - } else if (alpha >= 0) { - if (z > 0) { - PUTPIXEL_ZOOM_ALPHA_PRIO() - } else { - PUTPIXEL_ZOOM_ALPHA() - } - } else { - if (z > 0) { - PUTPIXEL_ZOOM_ALPHATAB_PRIO() - } else { - PUTPIXEL_ZOOM_ALPHATAB() - } - } - } - } - } - } -} - -static void draw_sprites(UINT8 req_pri) -{ - UINT32 *src = pPsikyoshSpriteBuffer; - UINT16 *list = (UINT16 *)src + 0x3800/2; - UINT16 listlen = 0x800/2; - UINT16 listcntr = 0; - UINT16 *zoom_table = (UINT16 *)pPsikyoshZoomRAM; - UINT8 *alpha_table = (UINT8 *)pPsikyoshVidRegs; - - while (listcntr < listlen) - { - UINT32 xpos, ypos, high, wide, flpx, flpy, zoomx, zoomy, tnum, colr, dpth, pri; - INT32 alpha; - -#ifdef LSB_FIRST - UINT32 listdat = list[listcntr ^ 1]; -#else - UINT32 listdat = list[listcntr]; -#endif - UINT32 sprnum = (listdat & 0x03ff) << 2; - - pri = (src[sprnum+1] & 0x00003000) >> 12; - pri = (pPsikyoshVidRegs[2] << (pri << 2)) >> 28; - - if (pri == req_pri) - { - ypos = (src[sprnum+0] & 0x03ff0000) >> 16; - xpos = (src[sprnum+0] & 0x000003ff); - high =((src[sprnum+1] & 0x0f000000) >> 24) + 1; - wide =((src[sprnum+1] & 0x00000f00) >> 8) + 1; - flpy = (src[sprnum+1] & 0x80000000) >> 31; - flpx = (src[sprnum+1] & 0x00008000) >> 15; - zoomy = (src[sprnum+1] & 0x00ff0000) >> 16; - zoomx = (src[sprnum+1] & 0x000000ff); - tnum = (src[sprnum+2] & 0x0007ffff); - dpth = (src[sprnum+2] & 0x00800000) >> 23; - colr = (src[sprnum+2] & 0xff000000) >> 24; - alpha = (src[sprnum+2] & 0x00700000) >> 20; - - if (ypos & 0x200) ypos -= 0x400; - if (xpos & 0x200) xpos -= 0x400; - -#ifdef LSB_FIRST - alpha = alpha_table[alpha ^ 3]; -#else - alpha = alpha_table[alpha]; -#endif - - if (alpha & 0x80) { - alpha = -1; - } else { - alpha = alphatable[alpha | 0xc0]; - } - -#ifdef LSB_FIRST - if (zoom_table[zoomy ^ 1] && zoom_table[zoomx ^ 1]) -#else - if (zoom_table[zoomy] && zoom_table[zoomx]) -#endif - { -#ifdef LSB_FIRST - psikyosh_drawgfxzoom(dpth, tnum, colr, flpx, flpy, xpos, ypos, alpha, - (UINT32)zoom_table[zoomx ^ 1],(UINT32)zoom_table[zoomy ^ 1], wide, high, listcntr); -#else - psikyosh_drawgfxzoom(dpth, tnum, colr, flpx, flpy, xpos, ypos, alpha, - (UINT32)zoom_table[zoomx],(UINT32)zoom_table[zoomy], wide, high, listcntr); -#endif - } - } - - listcntr++; - if (listdat & 0x4000) break; - } -} - -static void draw_layer(INT32 layer, INT32 bank, INT32 alpha, INT32 scrollx, INT32 scrolly) -{ - if ((bank < 0x0c) || (bank > 0x1f)) return; - - if (alpha & 0x80) { - alpha = -1; - } else { - alpha = alphatable[alpha | 0xc0]; - } - - INT32 attr = pPsikyoshVidRegs[7] << (layer << 2); - INT32 gfx = attr & 0x00004000; - INT32 size =(attr & 0x00001000) ? 32 : 16; - INT32 wide = size * 16; - - for (INT32 offs = 0; offs < size * 32; offs++) { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx = (sx + scrollx) & 0x1ff; - sy = (sy + scrolly) & (wide-1); - if (sx >= nScreenWidth) sx -= 0x200; - if (sy >= nScreenHeight) sy -= wide; - if (sx < -15 || sy < -15) continue; - - UINT32 code = pPsikyoshBgRAM[(bank*0x800)/4 + offs - 0x4000/4]; - - draw_blendy_tile(gfx, code & 0x7ffff, (code >> 24), sx, sy, 0, 0, alpha, 0); - } -} - -static void draw_bglayer(INT32 layer) -{ - if (!(nBurnLayer & 1)) return; - - INT32 scrollx, scrolly, bank, alpha; - INT32 scrollbank = ((pPsikyoshVidRegs[6] << (layer << 3)) >> 24) & 0x7f; - INT32 offset = (scrollbank == 0x0b) ? 0x200 : 0; - - bank = (pPsikyoshBgRAM[0x17f0/4 + offset + layer] & 0x000000ff); - alpha = (pPsikyoshBgRAM[0x17f0/4 + offset + layer] & 0x0000bf00) >> 8; - scrollx = (pPsikyoshBgRAM[0x13f0/4 + offset + layer] & 0x000001ff); - scrolly = (pPsikyoshBgRAM[0x13f0/4 + offset + layer] & 0x03ff0000) >> 16; - - if (scrollbank == 0x0d) scrollx += 0x08; - - draw_layer(layer, bank, alpha, scrollx, scrolly); -} - -static void draw_bglayertext(INT32 layer) -{ - if (~nBurnLayer & 2) return; - - INT32 scrollx, scrolly, bank, alpha; - INT32 scrollbank = ((pPsikyoshVidRegs[6] << (layer << 3)) >> 24) & 0x7f; - - bank = (pPsikyoshBgRAM[(scrollbank*0x800)/4 + 0x0400/4 - 0x4000/4] & 0x000000ff); - alpha = (pPsikyoshBgRAM[(scrollbank*0x800)/4 + 0x0400/4 - 0x4000/4] & 0x0000bf00) >> 8; - scrollx = (pPsikyoshBgRAM[(scrollbank*0x800)/4 - 0x4000/4 ] & 0x000001ff); - scrolly = (pPsikyoshBgRAM[(scrollbank*0x800)/4 - 0x4000/4 ] & 0x03ff0000) >> 16; - - draw_layer(layer, bank, alpha, scrollx, scrolly); - - bank = (pPsikyoshBgRAM[(scrollbank*0x800)/4 + 0x0400/4 + 0x20/4 - 0x4000/4] & 0x000000ff); - alpha = (pPsikyoshBgRAM[(scrollbank*0x800)/4 + 0x0400/4 + 0x20/4 - 0x4000/4] & 0x0000bf00) >> 8; - scrollx = (pPsikyoshBgRAM[(scrollbank*0x800)/4 - 0x4000/4 + 0x20/4 ] & 0x000001ff); - scrolly = (pPsikyoshBgRAM[(scrollbank*0x800)/4 - 0x4000/4 + 0x20/4 ] & 0x03ff0000) >> 16; - - draw_layer(layer, bank, alpha, scrollx, scrolly); -} - -static void draw_bglayerscroll(INT32 layer) -{ - if (!(nBurnLayer & 4)) return; - - INT32 scrollx, bank, alpha; - INT32 scrollbank = ((pPsikyoshVidRegs[6] << (layer << 3)) >> 24) & 0x7f; - - bank = (pPsikyoshBgRAM[(scrollbank*0x800)/4 + 0x0400/4 - 0x4000/4] & 0x000000ff); - alpha = (pPsikyoshBgRAM[(scrollbank*0x800)/4 + 0x0400/4 - 0x4000/4] & 0x0000bf00) >> 8; - scrollx = (pPsikyoshBgRAM[(scrollbank*0x800)/4 - 0x4000/4 ] & 0x000001ff); -// scrolly = (pPsikyoshBgRAM[(scrollbank*0x800)/4 - 0x4000/4 ] & 0x03ff0000) >> 16; - - draw_layer(layer, bank, alpha, scrollx, 0); -} - -static void draw_background(UINT8 req_pri) -{ - for (INT32 i = 0; i < 3; i++) - { - if (!((pPsikyoshVidRegs[7] << (i << 2)) & 0x8000)) - continue; - - INT32 bgtype = ((pPsikyoshVidRegs[6] << (i << 3)) >> 24) & 0x7f; - - switch (bgtype) - { - case 0x0a: // Normal - if((pPsikyoshBgRAM[0x17f0/4 + (i*0x04)/4] >> 24) == req_pri) - draw_bglayer(i); - break; - - case 0x0b: // Alt / Normal - if((pPsikyoshBgRAM[0x1ff0/4 + (i*0x04)/4] >> 24) == req_pri) - draw_bglayer(i); - break; - - case 0x0c: // Using normal for now - case 0x0d: // Using normal for now - if((pPsikyoshBgRAM[(bgtype*0x800)/4 + 0x400/4 - 0x4000/4] >> 24) == req_pri) - draw_bglayertext(i); - break; - - case 0x0e: - case 0x10: case 0x11: case 0x12: case 0x13: - case 0x14: case 0x15: case 0x16: case 0x17: - case 0x18: case 0x19: case 0x1a: case 0x1b: - case 0x1c: case 0x1d: case 0x1e: case 0x1f: - if((pPsikyoshBgRAM[(bgtype*0x800)/4 + 0x400/4 - 0x4000/4] >> 24) == req_pri) - draw_bglayerscroll(i); - break; - } - } -} - -static void prelineblend() -{ - UINT32 *linefill = pPsikyoshBgRAM; - UINT32 *destline = DrvTmpDraw; - - for (INT32 y = 0; y < nScreenHeight; y++, destline+=nScreenWidth) { - if (linefill[y] & 0xff) { - for (INT32 x = 0; x < nScreenWidth; x++) { - destline[x] = linefill[y] >> 8; - } - } - } -} - -static void postlineblend() -{ - UINT32 *lineblend = pPsikyoshBgRAM + 0x0400/4; - UINT32 *destline = DrvTmpDraw; - - for (INT32 y = 0; y < nScreenHeight; y++, destline+=nScreenWidth) { - if (lineblend[y] & 0x80) { - for (INT32 x = 0; x < nScreenWidth; x++) { - destline[x] = lineblend[y] >> 8; - } - } - else if (lineblend[y] & 0x7f) { - for (INT32 x = 0; x < nScreenWidth; x++) { - destline[x] = alpha_blend(destline[x], lineblend[y] >> 8, (lineblend[y] & 0x7f) << 1); - } - } - } -} - -INT32 PsikyoshDraw() -{ - { - for (INT32 i = 0; i < 0x5000 / 4; i++) { - pBurnDrvPalette[i] = pPsikyoshPalRAM[i] >> 8; - } - } - - if (nBurnBpp == 4) { - DrvTmpDraw = (UINT32*)pBurnDraw; - } else { - DrvTmpDraw = DrvTmpDraw_ptr; - } - - memset (DrvTmpDraw, 0, nScreenWidth * nScreenHeight * sizeof(UINT32)); - memset (DrvPriBmp, 0, nScreenWidth * nScreenHeight * sizeof(INT16)); - - UINT32 *psikyosh_vidregs = pPsikyoshVidRegs; - - prelineblend(); - - for (UINT32 i = 0; i < 8; i++) { - draw_sprites(i); - draw_background(i); - if ((psikyosh_vidregs[2] & 0x0f) == i) postlineblend(); - } - - if (nBurnBpp < 4) { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - INT32 d = DrvTmpDraw[i]; - PutPix(pBurnDraw + i * nBurnBpp, BurnHighCol(d>>16, d>>8, d, 0)); - } - } - - return 0; -} - -static void fill_alphatable() -{ - for (INT32 i = 0; i < 0xc0; i++) - alphatable[i] = 0xff; - - for (INT32 i = 0; i < 0x40; i++) { - alphatable[i | 0xc0] = ((0x3f - i) * 0xff) / 0x3f; - } -} - -static void calculate_transtab() -{ - DrvTransTab = (UINT8*)BurnMalloc(0x18000); - - memset (DrvTransTab, 0xff, 0x18000); - - // first calculate all 4bpp tiles - for (INT32 i = 0; i < nGraphicsSize; i+= 0x80) { - for (INT32 j = 0; j < 0x80; j++) { - if (pPsikyoshTiles[i + j]) { - DrvTransTab[(i>>10) + 0x00000] &= ~(1 << ((i >> 7) & 7)); - break; - } - } - } - - // next, calculate all 8bpp tiles - for (INT32 i = 0; i < nGraphicsSize; i+= 0x100) { - for (INT32 j = 0; j < 0x100; j++) { - if (pPsikyoshTiles[i + j]) { - DrvTransTab[(i>>11) + 0x10000] &= ~(1 << ((i >> 8) & 7)); - break; - } - } - } -} - -void PsikyoshVideoInit(INT32 gfx_max, INT32 gfx_min) -{ - DrvZoomBmp = (UINT8 *)BurnMalloc(16 * 16 * 16 * 16); - DrvPriBmp = (UINT16*)BurnMalloc(320 * 240 * sizeof(INT16)); - DrvTmpDraw_ptr = (UINT32 *)BurnMalloc(320 * 240 * sizeof(UINT32)); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nScreenHeight, &nScreenWidth); - } else { - BurnDrvGetVisibleSize(&nScreenWidth, &nScreenHeight); - } - - nGraphicsSize = gfx_max - gfx_min; - nGraphicsMin0 = (gfx_min / 128); - nGraphicsMin1 = (gfx_min / 256); - nGraphicsSize0 = (nGraphicsSize / 128) - 1; - nGraphicsSize1 = (nGraphicsSize / 256) - 1; - - calculate_transtab(); - fill_alphatable(); -} - -void PsikyoshVideoExit() -{ - BurnFree (DrvZoomBmp); - BurnFree (DrvPriBmp); - BurnFree (DrvTmpDraw_ptr); - DrvTmpDraw = NULL; - BurnFree (DrvTransTab); - - nDrvZoomPrev = -1; - pPsikyoshTiles = NULL; - pPsikyoshSpriteBuffer = NULL; - pPsikyoshBgRAM = NULL; - pPsikyoshVidRegs = NULL; - pPsikyoshPalRAM = NULL; - pPsikyoshZoomRAM = NULL; - pBurnDrvPalette = NULL; - - nScreenWidth = nScreenHeight = 0; -} diff --git a/jan/src/burn/drv/psikyo/psikyosh_render.h b/jan/src/burn/drv/psikyo/psikyosh_render.h deleted file mode 100644 index 8d1649389..000000000 --- a/jan/src/burn/drv/psikyo/psikyosh_render.h +++ /dev/null @@ -1,270 +0,0 @@ -extern UINT8 *pPsikyoshTiles; -extern UINT32 *pPsikyoshSpriteBuffer; -extern UINT32 *pPsikyoshBgRAM; -extern UINT32 *pPsikyoshVidRegs; -extern UINT32 *pPsikyoshPalRAM; -extern UINT32 *pPsikyoshZoomRAM; - -void PsikyoshVideoInit(INT32 gfx_max, INT32 gfx_min); -void PsikyoshVideoExit(); -INT32 PsikyoshDraw(); - - -//-------------------------------------------------------------------------------- -// Macro hell. - -// Standard tile drawing with full clipping. -//----------------------------------------------------------------------- -#define PUTPIXEL_CLIP(forloop, splitpixel, putpixel) \ - UINT32 *dest; \ - for (INT32 y = 0; y < 16; y++, sy++, src+=inc) { \ - if (sy < 0 || sy >= nScreenHeight) continue; \ - \ - dest = DrvTmpDraw + sy * nScreenWidth; \ - \ -forloop \ - { \ - if (sx < 0 || sx >= nScreenWidth) continue; \ - \ -splitpixel \ - \ - if (c) { \ -putpixel \ - } \ - } \ - \ - sx -= 16; \ - } - -// Tile drawing with clipping and priority -//----------------------------------------------------------------------- -#define PUTPIXEL_PRIO_CLIP(forloop, splitpixel, putpixel) \ - UINT32 *dest; \ - UINT16 *pri; \ - for (INT32 y = 0; y < 16; y++, sy++, src+=inc) { \ - if (sy < 0 || sy >= nScreenHeight) continue; \ - \ - dest = DrvTmpDraw + sy * nScreenWidth; \ - pri = DrvPriBmp + sy * nScreenWidth; \ - \ - forloop { \ - if (sx < 0 || sx >= nScreenWidth) continue; \ - \ - if (z >= pri[sx]) { \ -splitpixel \ - \ - if (c) { \ -putpixel \ - pri[sx] = z; \ - } \ - } \ - } \ - \ - sx -= 16; \ - } - -// Standard tile drawing with no clipping. -//----------------------------------------------------------------------- -#define PUTPIXEL(forloop, splitpixel, putpixel) \ - UINT32 *dest = DrvTmpDraw + sy * nScreenWidth; \ - for (INT32 y = 0; y < 16; y++, sy++, src+=inc) { \ -forloop \ - { \ - \ -splitpixel \ - \ - if (c) { \ -putpixel \ - } \ - } \ - \ - dest += nScreenWidth; \ - sx -= 16; \ - } - -// Tile drawing with no clipping and with priorities. -//----------------------------------------------------------------------- -#define PUTPIXEL_PRIO(forloop, splitpixel, putpixel) \ - UINT32 *dest = DrvTmpDraw + sy * nScreenWidth; \ - UINT16 *pri = DrvPriBmp + sy * nScreenWidth; \ - for (INT32 y = 0; y < 16; y++, sy++, src+=inc) { \ - forloop { \ - if (z >= pri[sx]) { \ -splitpixel \ - \ - if (c) { \ -putpixel \ - pri[sx] = z; \ - } \ - } \ - } \ - dest += nScreenWidth; \ - pri += nScreenWidth; \ - sx -= 16; \ - } - -// Zoom drawing with priorities. -//----------------------------------------------------------------------- -#define ZOOMPIXEL_PRIO(putpixel) \ - for (INT32 y = sy; y < ey; y++) \ - { \ - UINT8 *source = DrvZoomBmp + (y_index >> 10) * 256; \ - UINT32 *dest = DrvTmpDraw + y * nScreenWidth; \ - UINT16 *pri = DrvPriBmp + y * nScreenWidth; \ - \ - INT32 x_index = x_index_base; \ - for (INT32 x = sx; x < ex; x++) \ - { \ - if (z >= pri[x]) \ - { \ - INT32 c = source[x_index>>10]; \ - if (c) \ - { \ -putpixel \ - pri[x] = z; \ - } \ - } \ - x_index += dx; \ - } \ - y_index += dy; \ - } - -// Standard Zoom drawing -//----------------------------------------------------------------------- -#define ZOOMPIXEL_NORMAL(putpixel) \ - for (INT32 y = sy; y < ey; y++) \ - { \ - UINT8 *source = DrvZoomBmp + (y_index >> 10) * 256; \ - UINT32 *dest = DrvTmpDraw + y * nScreenWidth; \ - INT32 x_index = x_index_base; \ - \ - for (INT32 x = sx; x < ex; x++) \ - { \ - INT32 c = source[x_index>>10]; \ - if(c) { \ -putpixel \ - } \ - x_index += dx; \ - } \ - y_index += dy; \ - } - -//-------------------------------------------------------------------------------- - -// split up a 4bpp pixel -#define SPLITPIXEL \ - INT32 c = src[(x >> 1)]; \ - if (x & 1) { \ - c &= 0xf; \ - } else { \ - c >>= 4; \ - } - -// use 8bpp pixel -#define NORMALPIXEL INT32 c = src[x]; - -#define SETNORMALPIXEL dest[sx] = pal[c]; - -#define SETBLENDPIXEL dest[sx] = alpha_blend(dest[sx], pal[c], alpha); - -#define SETVARIABLEPIXEL \ - if (alphatable[c] == 0xff) { \ - dest[sx] = pal[c]; \ - } else { \ - dest[sx] = alpha_blend(dest[sx], pal[c], alphatable[c]); \ - } - -#define FORLOOP_NORMAL for (INT32 x = 0; x < 16; x++, sx++) - -#define FORLOOP_FLIPX for (INT32 x = 15; x >= 0; x--, sx++) - -// set pixels for zoom routines -#define ZSETNORMALPIXEL dest[x] = pal[c]; - -#define ZSETBLENDPIXEL dest[x] = alpha_blend(dest[x], pal[c], alpha); - -#define ZSETVARIABLEPIXEL \ - if (alphatable[c] == 0xff) { \ - dest[x] = pal[c]; \ - } else { \ - dest[x] = alpha_blend(dest[x], pal[c], alphatable[c]); \ - } - -//-------------------------------------------------------------------------------- - -// these aren't really necessary, they just help me keep track of what things do... - -#define PUTPIXEL_4BPP_NORMAL_CLIP() PUTPIXEL_CLIP(FORLOOP_NORMAL, SPLITPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_4BPP_ALPHA_CLIP() PUTPIXEL_CLIP(FORLOOP_NORMAL, SPLITPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_4BPP_ALPHATAB_CLIP() PUTPIXEL_CLIP(FORLOOP_NORMAL, SPLITPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_4BPP_NORMAL_PRIO_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_NORMAL, SPLITPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_4BPP_ALPHA_PRIO_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_NORMAL, SPLITPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_4BPP_ALPHATAB_PRIO_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_NORMAL, SPLITPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_8BPP_NORMAL_CLIP() PUTPIXEL_CLIP(FORLOOP_NORMAL, NORMALPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_8BPP_ALPHA_CLIP() PUTPIXEL_CLIP(FORLOOP_NORMAL, NORMALPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_8BPP_ALPHATAB_CLIP() PUTPIXEL_CLIP(FORLOOP_NORMAL, NORMALPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_8BPP_NORMAL_PRIO_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_NORMAL, NORMALPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_8BPP_ALPHA_PRIO_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_NORMAL, NORMALPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_8BPP_ALPHATAB_PRIO_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_NORMAL, NORMALPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_4BPP_NORMAL_FLIPX_CLIP() PUTPIXEL_CLIP(FORLOOP_FLIPX, SPLITPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_4BPP_ALPHA_FLIPX_CLIP() PUTPIXEL_CLIP(FORLOOP_FLIPX, SPLITPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_4BPP_ALPHATAB_FLIPX_CLIP() PUTPIXEL_CLIP(FORLOOP_FLIPX, SPLITPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_4BPP_NORMAL_PRIO_FLIPX_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_FLIPX, SPLITPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_4BPP_ALPHA_PRIO_FLIPX_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_FLIPX, SPLITPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_4BPP_ALPHATAB_PRIO_FLIPX_CLIP()PUTPIXEL_PRIO_CLIP(FORLOOP_FLIPX, SPLITPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_8BPP_NORMAL_FLIPX_CLIP() PUTPIXEL_CLIP(FORLOOP_FLIPX, NORMALPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_8BPP_ALPHA_FLIPX_CLIP() PUTPIXEL_CLIP(FORLOOP_FLIPX, NORMALPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_8BPP_ALPHATAB_FLIPX_CLIP() PUTPIXEL_CLIP(FORLOOP_FLIPX, NORMALPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_8BPP_NORMAL_PRIO_FLIPX_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_FLIPX, NORMALPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_8BPP_ALPHA_PRIO_FLIPX_CLIP() PUTPIXEL_PRIO_CLIP(FORLOOP_FLIPX, NORMALPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_8BPP_ALPHATAB_PRIO_FLIPX_CLIP()PUTPIXEL_PRIO_CLIP(FORLOOP_FLIPX, NORMALPIXEL, SETVARIABLEPIXEL) - - -#define PUTPIXEL_4BPP_NORMAL() PUTPIXEL(FORLOOP_NORMAL, SPLITPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_4BPP_ALPHA() PUTPIXEL(FORLOOP_NORMAL, SPLITPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_4BPP_ALPHATAB() PUTPIXEL(FORLOOP_NORMAL, SPLITPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_4BPP_NORMAL_PRIO() PUTPIXEL_PRIO(FORLOOP_NORMAL, SPLITPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_4BPP_ALPHA_PRIO() PUTPIXEL_PRIO(FORLOOP_NORMAL, SPLITPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_4BPP_ALPHATAB_PRIO() PUTPIXEL_PRIO(FORLOOP_NORMAL, SPLITPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_8BPP_NORMAL() PUTPIXEL(FORLOOP_NORMAL, NORMALPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_8BPP_ALPHA() PUTPIXEL(FORLOOP_NORMAL, NORMALPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_8BPP_ALPHATAB() PUTPIXEL(FORLOOP_NORMAL, NORMALPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_8BPP_NORMAL_PRIO() PUTPIXEL_PRIO(FORLOOP_NORMAL, NORMALPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_8BPP_ALPHA_PRIO() PUTPIXEL_PRIO(FORLOOP_NORMAL, NORMALPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_8BPP_ALPHATAB_PRIO() PUTPIXEL_PRIO(FORLOOP_NORMAL, NORMALPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_4BPP_NORMAL_FLIPX() PUTPIXEL(FORLOOP_FLIPX, SPLITPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_4BPP_ALPHA_FLIPX() PUTPIXEL(FORLOOP_FLIPX, SPLITPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_4BPP_ALPHATAB_FLIPX() PUTPIXEL(FORLOOP_FLIPX, SPLITPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_4BPP_NORMAL_PRIO_FLIPX() PUTPIXEL_PRIO(FORLOOP_FLIPX, SPLITPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_4BPP_ALPHA_PRIO_FLIPX() PUTPIXEL_PRIO(FORLOOP_FLIPX, SPLITPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_4BPP_ALPHATAB_PRIO_FLIPX() PUTPIXEL_PRIO(FORLOOP_FLIPX, SPLITPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_8BPP_NORMAL_FLIPX() PUTPIXEL(FORLOOP_FLIPX, NORMALPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_8BPP_ALPHA_FLIPX() PUTPIXEL(FORLOOP_FLIPX, NORMALPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_8BPP_ALPHATAB_FLIPX() PUTPIXEL(FORLOOP_FLIPX, NORMALPIXEL, SETVARIABLEPIXEL) - -#define PUTPIXEL_8BPP_NORMAL_PRIO_FLIPX() PUTPIXEL_PRIO(FORLOOP_FLIPX, NORMALPIXEL, SETNORMALPIXEL) -#define PUTPIXEL_8BPP_ALPHA_PRIO_FLIPX() PUTPIXEL_PRIO(FORLOOP_FLIPX, NORMALPIXEL, SETBLENDPIXEL) -#define PUTPIXEL_8BPP_ALPHATAB_PRIO_FLIPX()PUTPIXEL_PRIO(FORLOOP_FLIPX, NORMALPIXEL, SETVARIABLEPIXEL) - - -#define PUTPIXEL_ZOOM_NORMAL_PRIO() ZOOMPIXEL_PRIO(ZSETNORMALPIXEL) -#define PUTPIXEL_ZOOM_NORMAL() ZOOMPIXEL_NORMAL(ZSETNORMALPIXEL) - -#define PUTPIXEL_ZOOM_ALPHA_PRIO() ZOOMPIXEL_PRIO(ZSETBLENDPIXEL) -#define PUTPIXEL_ZOOM_ALPHA() ZOOMPIXEL_NORMAL(ZSETBLENDPIXEL) - -#define PUTPIXEL_ZOOM_ALPHATAB_PRIO() ZOOMPIXEL_PRIO(ZSETVARIABLEPIXEL) -#define PUTPIXEL_ZOOM_ALPHATAB() ZOOMPIXEL_NORMAL(ZSETVARIABLEPIXEL) diff --git a/jan/src/burn/drv/pst90s/d_1945kiii.cpp b/jan/src/burn/drv/pst90s/d_1945kiii.cpp deleted file mode 100644 index 21e5526e7..000000000 --- a/jan/src/burn/drv/pst90s/d_1945kiii.cpp +++ /dev/null @@ -1,742 +0,0 @@ -// FB Alpha 1945K-III driver module -// Based on MAME driver by David Haywood -// Port to Finalburn Alpha by OopsWare. 2007 - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart; -static UINT8 *RamEnd; -static UINT8 *Rom68K; -static UINT8 *RomBg; -static UINT8 *RomSpr; -static UINT8 *Ram68K; -static UINT16 *RamPal; -static UINT16 *RamSpr0; -static UINT16 *RamSpr1; -static UINT16 *RamBg; - -static UINT32 *RamCurPal; -static UINT8 bRecalcPalette; - -static UINT16 *scrollx; -static UINT16 *scrolly; -static UINT8 *m6295bank; - -static INT32 nGameSelect = 0; - -static UINT8 DrvReset; -static UINT8 DrvButton[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvJoy1[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvJoy2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvInput[6] = { 0, 0, 0, 0, 0, 0 }; - -static struct BurnInputInfo _1945kiiiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 2, "p1 start" }, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 4" }, - - {"P2 Start", BIT_DIGITAL, DrvButton + 3, "p2 start" }, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 4, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 5, "dip" }, -}; - -STDINPUTINFO(_1945kiii) - -static struct BurnInputInfo FlagrallInputList[] = { - {"P1 Coin 1", BIT_DIGITAL, DrvButton + 0, "p1 coin" }, - {"P1 Coin 2", BIT_DIGITAL, DrvButton + 1, "p2 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 2, "p1 start" }, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 4, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 5, "dip" }, -}; - -STDINPUTINFO(Flagrall) - -static struct BurnDIPInfo _1945kiiiDIPList[] = { - {0x14, 0xFF, 0xFF, 0xef, NULL }, - {0x15, 0xFF, 0xFF, 0xff, NULL }, - - {0, 0xFE, 0, 8, "Coin 1" }, - {0x14, 0x01, 0x07, 0x07, "1 coin 1 credit" }, - {0x14, 0x01, 0x07, 0x06, "2 coins 1 credit" }, - {0x14, 0x01, 0x07, 0x05, "3 coins 1 credit" }, - {0x14, 0x01, 0x07, 0x04, "1 coin 2 credits" }, - {0x14, 0x01, 0x07, 0x03, "Free Play" }, - {0x14, 0x01, 0x07, 0x02, "5 coins 1 credit" }, - {0x14, 0x01, 0x07, 0x01, "4 coins 1 credit" }, - {0x14, 0x01, 0x07, 0x00, "1 coin 3 credits" }, - {0, 0xFE, 0, 4, "Difficulty" }, - {0x14, 0x01, 0x18, 0x18, "Hardest" }, - {0x14, 0x01, 0x18, 0x10, "Hard" }, - {0x14, 0x01, 0x18, 0x08, "Normal" }, - {0x14, 0x01, 0x18, 0x00, "Easy" }, - {0, 0xFE, 0, 4, "Lives" }, - {0x14, 0x01, 0x60, 0x60, "3" }, - {0x14, 0x01, 0x60, 0x40, "2" }, - {0x14, 0x01, 0x60, 0x20, "4" }, - {0x14, 0x01, 0x60, 0x00, "5" }, - {0, 0xFE, 0, 2, "Service" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0, 0xFE, 0, 2, "Demo sound" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - {0, 0xFE, 0, 2, "Allow Continue" }, - {0x15, 0x01, 0x02, 0x02, "Yes" }, - {0x15, 0x01, 0x02, 0x00, "No" }, -}; - -STDDIPINFO(_1945kiii) - -static struct BurnDIPInfo FlagrallDIPList[]= -{ - {0x0a, 0xff, 0xff, 0xa3, NULL }, - {0x0b, 0xff, 0xff, 0xb7, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0a, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x0a, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x0a, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x0a, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0a, 0x01, 0x10, 0x10, "Off" }, - {0x0a, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Dip Control" }, - {0x0a, 0x01, 0x20, 0x20, "Off" }, - {0x0a, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Picture Test" }, - {0x0a, 0x01, 0x80, 0x80, "Off" }, - {0x0a, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0b, 0x01, 0x03, 0x02, "1" }, - {0x0b, 0x01, 0x03, 0x01, "2" }, - {0x0b, 0x01, 0x03, 0x03, "3" }, - {0x0b, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Type" }, - {0x0b, 0x01, 0x04, 0x04, "0" }, - {0x0b, 0x01, 0x04, 0x00, "1" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0b, 0x01, 0x30, 0x00, "Very Hard" }, - {0x0b, 0x01, 0x30, 0x10, "Hard" }, - {0x0b, 0x01, 0x30, 0x20, "Easy" }, - {0x0b, 0x01, 0x30, 0x30, "Normal" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0b, 0x01, 0x80, 0x80, "Off" }, - {0x0b, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Flagrall) - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x001F) << 3; - r |= r >> 5; - g = (nColour & 0x03E0) >> 2; - g |= g >> 5; - b = (nColour & 0x7C00) >> 7; - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -static void sndSetBank(UINT8 bank0, UINT8 bank1) -{ - if (bank0 != m6295bank[0]) { - m6295bank[0] = bank0; - MSM6295SetBank(0, MSM6295ROM + 0x00000 + 0x040000 * bank0, 0x00000, 0x3ffff); - } - - if (bank1 != m6295bank[1] && nGameSelect < 2) { //1945kiii only - m6295bank[1] = bank1; - MSM6295SetBank(1, MSM6295ROM + 0x80000 + 0x040000 * bank1, 0x00000, 0x3ffff); - } -} - -UINT16 __fastcall k1945iiiReadWord(UINT32 sekAddress) -{ - switch (sekAddress) - { - case 0x400000: - return DrvInput[0] | (DrvInput[1] << 8); - - case 0x440000: - return DrvInput[2] | (DrvInput[3] << 8); - - case 0x480000: - return DrvInput[4] | (DrvInput[5] << 8); - - case 0x4C0000: - return MSM6295ReadStatus(0); - - case 0x500000: - return MSM6295ReadStatus(1); - } - - return 0; -} - -void __fastcall k1945iiiWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) - { - case 0x4C0000: - case 0x4C0001: // flagrall - MSM6295Command(0, byteValue); - return; - - case 0x500000: - MSM6295Command(1, byteValue); - return; - - case 0x9ce: - case 0x9cf: - case 0x9d0: - case 0x9d1: - case 0x9d2: // nop - return; - } -} - -void __fastcall k1945iiiWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) - { - case 0x340000: - scrollx[0] = wordValue; - return; - - case 0x380000: - scrolly[0] = wordValue; - return; - - case 0x3C0000: { - if (nGameSelect == 2) //flagrall - sndSetBank((wordValue & 6) >> 1, 0); - else - sndSetBank((wordValue & 2) >> 1, (wordValue & 4) >> 2); - } - return; - - case 0x4C0000: // flagrall - MSM6295Command(0, wordValue); - return; - } -} - -void __fastcall k1945iiiWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - sekAddress = (sekAddress & 0xffe) / 2; - RamPal[sekAddress] = BURN_ENDIAN_SWAP_INT16(wordValue); - if (sekAddress < 0x200) RamCurPal[sekAddress] = CalcCol(wordValue); -} - -static INT32 MemIndex() -{ - UINT8 *Next; - - Next = Mem; - - Rom68K = Next; Next += 0x0100000; - RomBg = Next; Next += 0x0200000; - RomSpr = Next; Next += 0x0400000; - MSM6295ROM = Next; Next += 0x0100000; - - RamCurPal = (UINT32 *) Next; Next += 0x00200 * sizeof(UINT32); - - RamStart = Next; - - Ram68K = Next; Next += 0x020000; - RamPal = (UINT16 *) Next; Next += 0x000800 * sizeof(UINT16); - RamSpr0 = (UINT16 *) Next; Next += 0x000800 * sizeof(UINT16); - RamSpr1 = (UINT16 *) Next; Next += 0x000800 * sizeof(UINT16); - RamBg = (UINT16 *) Next; Next += 0x000800 * sizeof(UINT16); - - m6295bank = Next; Next += 0x000002; - scrollx = (UINT16 *) Next; Next += 0x000001 * sizeof(UINT16); - scrolly = (UINT16 *) Next; Next += 0x000001 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - MSM6295Reset(1); - - m6295bank[0] = 1; - m6295bank[1] = 1; - sndSetBank(0, 0); - - return 0; -} - -static INT32 DrvInit(INT32 game_select) -{ - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - nGameSelect = game_select; - - if (nGameSelect == 0) // 1945kiii - { - if (BurnLoadRom(Rom68K + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Rom68K + 0x000001, 1, 2)) return 1; - - if (BurnLoadRomExt(RomSpr + 0x000000, 2, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(RomSpr + 0x000002, 3, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRom(RomBg + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(MSM6295ROM + 0x080000, 6, 1)) return 1; - - //decode_sprites(); - } - else if (nGameSelect == 1) // 1945kiiio - { - if (BurnLoadRom(Rom68K + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Rom68K + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(RomSpr + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x000001, 3, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x000002, 4, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x000003, 5, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x200000, 6, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x200001, 7, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x200002, 8, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x200003, 9, 4)) return 1; - - if (BurnLoadRom(RomBg + 0x000000, 10, 4)) return 1; - if (BurnLoadRom(RomBg + 0x000001, 11, 4)) return 1; - if (BurnLoadRom(RomBg + 0x000002, 12, 4)) return 1; - if (BurnLoadRom(RomBg + 0x000003, 13, 4)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x000000, 14, 1)) return 1; - if (BurnLoadRom(MSM6295ROM + 0x080000, 15, 1)) return 1; - - } - else if (nGameSelect == 2) // flagrall - { - if (BurnLoadRom(Rom68K + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Rom68K + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(RomSpr + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x000001, 3, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x000002, 4, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x000003, 5, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x200000, 6, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x200001, 7, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x200002, 8, 4)) return 1; - if (BurnLoadRom(RomSpr + 0x200003, 9, 4)) return 1; - - if (BurnLoadRom(RomBg + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(RomBg + 0x080000, 11, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x000000, 12, 1)) return 1; - if (BurnLoadRom(MSM6295ROM + 0x080000, 13, 1)) return 1; - } - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Rom68K, 0x000000, 0x0FFFFF, MAP_ROM); - SekMapMemory(Ram68K, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory((UINT8 *)RamPal, 0x200000, 0x200FFF, MAP_ROM); - SekMapHandler(1, 0x200000, 0x200FFF, MAP_WRITE); // palette write - SekMapMemory((UINT8 *)RamSpr0, 0x240000, 0x240FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr1, 0x280000, 0x280FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamBg, 0x2C0000, 0x2C0FFF, MAP_RAM); - SekMapMemory(Ram68K + 0x10000, 0x8C0000, 0x8CFFFF, MAP_RAM); - - SekSetReadWordHandler(0, k1945iiiReadWord); -// SekSetReadByteHandler(0, k1945iiiReadByte); - SekSetWriteWordHandler(0, k1945iiiWriteWord); - SekSetWriteByteHandler(0, k1945iiiWriteByte); - -// SekSetWriteByteHandler(1, k1945iiiWriteBytePalette); - SekSetWriteWordHandler(1, k1945iiiWriteWordPalette); - SekClose(); - } - - MSM6295Init(0, 7500, 1); - MSM6295Init(1, 7500, 1); - MSM6295SetBank(0, MSM6295ROM + 0x000000, 0, 0x3ffff); - MSM6295SetBank(1, MSM6295ROM + 0x080000, 0, 0x3ffff); - if (nGameSelect < 2) { // 1945kiii - MSM6295SetRoute(0, 2.50, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 2.50, BURN_SND_ROUTE_BOTH); - } else { // flagrall - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - } - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - - MSM6295Exit(0); - MSM6295Exit(1); - - nGameSelect = 0; - - BurnFree(Mem); - - return 0; -} - -static void DrawBackground() -{ - for (INT32 offs = 0; offs < 32*32; offs++) - { - INT32 sx = ((offs & 0x1f) * 16) - (scrollx[0] & 0x1ff); - if (sx <= -192) sx += 512; - - INT32 sy = ((offs / 0x20) * 16) - (scrolly[0] & 0x1ff); - if (sy <= -192) sy += 512; - - if (sx <= -16 || sx >= nScreenWidth || sy <= -16 || sy >= nScreenHeight) - continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(RamBg[offs]) & 0x1fff; - - if (sx >= 0 && sx <= 304 && sy >= 0 && sy <= 208) { - Render16x16Tile(pTransDraw, code, sx, sy, 0, 8, 0, RomBg); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, 0, 8, 0, RomBg); - } - } -} - -static void DrawSprites() -{ - for (INT32 i = 0; i < 0x1000/2; i++) - { - INT32 sx = BURN_ENDIAN_SWAP_INT16(RamSpr0[i]) >> 8; - INT32 sy = BURN_ENDIAN_SWAP_INT16(RamSpr0[i]) & 0xff; - INT32 code = (BURN_ENDIAN_SWAP_INT16(RamSpr1[i]) & 0x7ffe) >> 1; - sx |= (BURN_ENDIAN_SWAP_INT16(RamSpr1[i]) & 0x0001) << 8; - - if (sx >= 336) sx -= 512; - if (sy >= 240) sy -= 256; - - if (sx >= 0 && sx <= 304 && sy > 0 && sy <= 208) { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, 0, 8, 0, 0x100, RomSpr); - } else if (sx >= -16 && sx < nScreenWidth && sy >= -16 && sy < nScreenHeight) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 8, 0, 0x100, RomSpr); - } - } -} - -static INT32 DrvDraw() -{ - if (bRecalcPalette) { - for (INT32 i = 0; i < 0x200; i++) { - RamCurPal[i] = CalcCol(RamPal[i]); - } - - bRecalcPalette = 0; - } - - BurnTransferClear(); - - DrawBackground(); - DrawSprites(); - - BurnTransferCopy(RamCurPal); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInput, 0xff, 4); - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] ^= (DrvJoy1[i] & 1) << i; - DrvInput[1] ^= (DrvJoy2[i] & 1) << i; - DrvInput[2] ^= (DrvButton[i] & 1) << i; - } - } - - INT32 nTotalCycles = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - - SekOpen(0); - SekRun(nTotalCycles); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - memset(pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - if (pnMin) *pnMin = 0x029671; - - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - if (nAction & ACB_WRITE) { - INT32 bank0 = m6295bank[0]; - INT32 bank1 = m6295bank[1]; - m6295bank[0] = ~0; - m6295bank[1] = ~0; - - sndSetBank(bank0, bank1); - - bRecalcPalette = 1; - } - } - - return 0; -} - - -// 1945k III (newer, OPCX2 PCB) - -static struct BurnRomInfo _1945kiiiRomDesc[] = { - { "prg-1.u51", 0x080000, 0x6b345f27, BRF_ESS | BRF_PRG }, // 0 68000 code - { "prg-2.u52", 0x080000, 0xce09b98c, BRF_ESS | BRF_PRG }, // 1 - - { "m16m-1.u62", 0x200000, 0x0b9a6474, BRF_GRA }, // 2 Sprites - { "m16m-2.u63", 0x200000, 0x368a8c2e, BRF_GRA }, // 3 - - { "m16m-3.u61", 0x200000, 0x32fc80dd, BRF_GRA }, // 4 Background Layer - - { "snd-1.su7", 0x080000, 0xbbb7f0ff, BRF_SND }, // 5 MSM #0 Samples - - { "snd-2.su4", 0x080000, 0x47e3952e, BRF_SND }, // 6 MSM #1 Samples -}; - -STD_ROM_PICK(_1945kiii) -STD_ROM_FN(_1945kiii) - -static INT32 _1945kiiiInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrv1945kiii = { - "1945kiii", NULL, NULL, NULL, "2000", - "1945k III (newer, OPCX2 PCB)\0", NULL, "Oriental Soft", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, _1945kiiiRomInfo, _1945kiiiRomName, NULL, NULL, _1945kiiiInputInfo, _1945kiiiDIPInfo, - _1945kiiiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x200, - 224, 320, 3, 4 -}; - - - -// 1945k III (older, OPCX1 PCB) - -static struct BurnRomInfo _1945kiiioRomDesc[] = { - { "3.U34", 0x80000, 0x5515baa0, 1 | BRF_PRG | BRF_ESS }, // 0 68000 code - { "4.U35", 0x80000, 0xfd177664, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "9.U5", 0x80000, 0xbe0f432e, 2 | BRF_GRA }, // 2 Sprites - { "10.U6", 0x80000, 0xcf9127b2, 2 | BRF_GRA }, // 3 - { "11.U7", 0x80000, 0x644ee8cc, 2 | BRF_GRA }, // 4 - { "12.U8", 0x80000, 0x0900c208, 2 | BRF_GRA }, // 5 - { "13.U58", 0x80000, 0x8ea9c6be, 2 | BRF_GRA }, // 6 - { "14.U59", 0x80000, 0x10c18fb4, 2 | BRF_GRA }, // 7 - { "15.U60", 0x80000, 0x86ab6c7c, 2 | BRF_GRA }, // 8 - { "16.U61", 0x80000, 0xff419080, 2 | BRF_GRA }, // 9 - - { "5.U102", 0x80000, 0x91b70a6b, 3 | BRF_GRA }, // 10 Background Layer - { "6.U103", 0x80000, 0x7b5bfb85, 3 | BRF_GRA }, // 11 - { "7.U104", 0x80000, 0xcdafcedf, 3 | BRF_GRA }, // 12 - { "8.U105", 0x80000, 0x2c3895d5, 3 | BRF_GRA }, // 13 - - { "S13.SU4", 0x80000, 0xd45aec3b, 4 | BRF_SND }, // 14 MSM #0 Samples - - { "S21.SU5", 0x80000, 0x9d96fd55, 5 | BRF_SND }, // 15 MSM #1 Samples -}; - -STD_ROM_PICK(_1945kiiio) -STD_ROM_FN(_1945kiiio) - -static INT32 _1945kiiioInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrv1945kiiio = { - "1945kiiio", "1945kiii", NULL, NULL, "1999", - "1945k III (older, OPCX1 PCB)\0", NULL, "Oriental Soft", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, _1945kiiioRomInfo, _1945kiiioRomName, NULL, NULL, _1945kiiiInputInfo, _1945kiiiDIPInfo, - _1945kiiioInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x200, - 224, 320, 3, 4 -}; - - -// 1945k III (newer, OPCX1 PCB) - -static struct BurnRomInfo _1945kiiinRomDesc[] = { - { "U34", 0x80000, 0xd0cf4f03, 1 | BRF_PRG | BRF_ESS }, // 0 68000 code - { "U35", 0x80000, 0x056c64ed, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "U5", 0x80000, 0xf328f85e, 2 | BRF_GRA }, // 2 Sprites - { "U6", 0x80000, 0xcfdabf1b, 2 | BRF_GRA }, // 3 - { "U7", 0x80000, 0x59a6a944, 2 | BRF_GRA }, // 4 - { "U8", 0x80000, 0x59995aaf, 2 | BRF_GRA }, // 5 - { "U58", 0x80000, 0x6acf2ce4, 2 | BRF_GRA }, // 6 - { "U59", 0x80000, 0xca6ff210, 2 | BRF_GRA }, // 7 - { "U60", 0x80000, 0x91eb038a, 2 | BRF_GRA }, // 8 - { "U61", 0x80000, 0x1b358c6d, 2 | BRF_GRA }, // 9 - - { "5.U102", 0x80000, 0x91b70a6b, 3 | BRF_GRA }, // 10 Background Layer - { "6.U103", 0x80000, 0x7b5bfb85, 3 | BRF_GRA }, // 11 - { "7.U104", 0x80000, 0xcdafcedf, 3 | BRF_GRA }, // 12 - { "8.U105", 0x80000, 0x2c3895d5, 3 | BRF_GRA }, // 13 - - { "snd-1.su7", 0x80000, 0xbbb7f0ff, 4 | BRF_SND }, // 14 MSM #0 Samples - - { "snd-2.su4", 0x80000, 0x47e3952e, 5 | BRF_SND }, // 15 MSM #1 Samples -}; - -STD_ROM_PICK(_1945kiiin) -STD_ROM_FN(_1945kiiin) - -struct BurnDriver BurnDrv1945kiiin = { - "1945kiiin", "1945kiii", NULL, NULL, "2000", - "1945k III (newer, OPCX1 PCB)\0", NULL, "Oriental Soft", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, _1945kiiinRomInfo, _1945kiiinRomName, NULL, NULL, _1945kiiiInputInfo, _1945kiiiDIPInfo, - _1945kiiioInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x200, - 224, 320, 3, 4 -}; - - -// '96 Flag Rally - -static struct BurnRomInfo flagrallRomDesc[] = { - { "11_u34.bin", 0x040000, 0x24dd439d, BRF_ESS | BRF_PRG }, // 0 68000 code - { "12_u35.bin", 0x040000, 0x373b71a5, BRF_ESS | BRF_PRG }, // 1 - - { "1_u5.bin", 0x080000, 0x9377704b, BRF_GRA }, // 2 Sprites - { "5_u6.bin", 0x080000, 0x1ac0bd0c, BRF_GRA }, // 3 - { "2_u7.bin", 0x080000, 0x5f6db2b3, BRF_GRA }, // 4 - { "6_u8.bin", 0x080000, 0x79e4643c, BRF_GRA }, // 5 - { "3_u58.bin", 0x040000, 0xc913df7d, BRF_GRA }, // 6 - { "4_u59.bin", 0x040000, 0xcb192384, BRF_GRA }, // 7 - { "7_u60.bin", 0x040000, 0xf187a7bf, BRF_GRA }, // 8 - { "8_u61.bin", 0x040000, 0xb73fa441, BRF_GRA }, // 9 - - { "10_u102.bin",0x080000, 0xb1fd3279, BRF_GRA }, // 10 Background Layer - { "9_u103.bin", 0x080000, 0x01e6d654, BRF_GRA }, // 11 - - { "13_su4.bin", 0x080000, 0x7b0630b3, BRF_SND }, // 12 MSM #0 Samples - { "14_su6.bin", 0x040000, 0x593b038f, BRF_SND }, // 13 -}; - -STD_ROM_PICK(flagrall) -STD_ROM_FN(flagrall) - -static INT32 flagrallInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvFlagrall = { - "flagrall", NULL, NULL, NULL, "1996", - "'96 Flag Rally\0", NULL, "unknown", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, flagrallRomInfo, flagrallRomName, NULL, NULL, FlagrallInputInfo, FlagrallDIPInfo, - flagrallInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x200, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_aerofgt.cpp b/jan/src/burn/drv/pst90s/d_aerofgt.cpp deleted file mode 100644 index 256da28ca..000000000 --- a/jan/src/burn/drv/pst90s/d_aerofgt.cpp +++ /dev/null @@ -1,3462 +0,0 @@ -/* - * Aero Fighters driver for FB Alpha 0.2.96.71 - * based on MAME driver by Nicola Salmoria - * Port by OopsWare. 2007 - * http://oopsware.googlepages.com - * http://oopsware.ys168.com - * - * - * 12.08.2014, 8.13.2016 - revisited. - * Add sprite priority bitmap for Turbo Force - see notes in turbofrcDraw(); - * - * 6.04.2014 - * Overhaul graphics routines, now supports multiple color depths and sprite zooming - * Clean and merge routines - * - * 6.13.2007 - * Add driver Spinal Breakers (spinlbrk) - * - * 6.12.2007 - * Add driver Karate Blazers (karatblz) - * - * 6.11.2007 - * Add driver Turbo Force (turbofrc) - * - * 6.10.2007 - * Add BurnHighCol support, and add BDF_16BIT_ONLY into driver. thanks to KEV - * - * - * Priorities and row scroll are not implemented - * - */ - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2610.h" - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy4[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - -static UINT8 DrvInput[10] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *RomZ80; -static UINT8 *RomBg; -static UINT8 *RomSpr1; -static UINT8 *RomSpr2; -static UINT8 *RomSnd1; -static UINT8 *RomSnd2; - -static UINT8 *RamPal; -static UINT16 *RamRaster; -static UINT16 *RamBg1V, *RamBg2V; -static UINT16 *RamSpr1; -static UINT16 *RamSpr2; -static UINT16 *RamSpr3; -static UINT8 *Ram01; -static UINT8 *RamZ80; - -static INT32 nCyclesTotal[2]; - -static UINT8 RamGfxBank[8]; - -static UINT32 *RamCurPal; -static UINT8 DrvRecalc; - -static UINT8 *DeRomBg; -static UINT8 *DeRomSpr1; -static UINT8 *DeRomSpr2; -static UINT8 *RamPrioBitmap; - -static UINT32 RamSpr1SizeMask; -static UINT32 RamSpr2SizeMask; -static UINT32 RomSpr1SizeMask; -static UINT32 RomSpr2SizeMask; - -static void (*pAssembleInputs)(); - -static INT32 pending_command = 0; -static INT32 RomSndSize1, RomSndSize2; - -static UINT16 bg1scrollx, bg2scrollx; -static UINT16 bg1scrolly, bg2scrolly; - -static INT32 nAerofgtZ80Bank; -static UINT8 nSoundlatch; - -static UINT8 spritepalettebank; -static UINT8 charpalettebank; - -static struct BurnInputInfo aerofgtInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 2, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 3, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"P3 Coin", BIT_DIGITAL, DrvButton + 6, "p3 coin"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(aerofgt) - -static struct BurnDIPInfo aerofgtDIPList[] = { - // Defaults - {0x12, 0xFF, 0xFF, 0x00, NULL}, - {0x13, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Coin Slot"}, - {0x12, 0x01, 0x01, 0x00, "Same"}, - {0x12, 0x01, 0x01, 0x01, "Individual"}, - {0, 0xFE, 0, 8, "Coin 1"}, - {0x12, 0x01, 0x0E, 0x00, "1 coin 1 credits"}, - {0x12, 0x01, 0x0E, 0x02, "2 coin 1 credits"}, - {0x12, 0x01, 0x0E, 0x04, "3 coin 1 credit"}, - {0x12, 0x01, 0x0E, 0x06, "1 coin 2 credits"}, - {0x12, 0x01, 0x0E, 0x08, "1 coins 3 credit"}, - {0x12, 0x01, 0x0E, 0x0A, "1 coins 4 credit"}, - {0x12, 0x01, 0x0E, 0x0C, "1 coins 5 credit"}, - {0x12, 0x01, 0x0E, 0x0E, "1 coins 6 credit"}, - {0, 0xFE, 0, 8, "Coin 2"}, - {0x12, 0x01, 0x70, 0x00, "1 coin 1 credits"}, - {0x12, 0x01, 0x70, 0x10, "2 coin 1 credits"}, - {0x12, 0x01, 0x70, 0x20, "3 coin 1 credit"}, - {0x12, 0x01, 0x70, 0x30, "1 coin 2 credits"}, - {0x12, 0x01, 0x70, 0x40, "1 coins 3 credit"}, - {0x12, 0x01, 0x70, 0x50, "1 coins 4 credit"}, - {0x12, 0x01, 0x70, 0x60, "1 coins 5 credit"}, - {0x12, 0x01, 0x70, 0x70, "1 coins 6 credit"}, - {0, 0xFE, 0, 2, "2 Coins to Start, 1 to Continue"}, - {0x12, 0x01, 0x80, 0x00, "Off"}, - {0x12, 0x01, 0x80, 0x80, "On"}, - - // DIP 2 - {0, 0xFE, 0, 2, "Screen flip"}, - {0x13, 0x01, 0x01, 0x00, "Off"}, - {0x13, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x13, 0x01, 0x02, 0x00, "Off"}, - {0x13, 0x01, 0x02, 0x02, "On"}, - {0, 0xFE, 0, 4, "Difficulty"}, - {0x13, 0x01, 0x0C, 0x00, "Normal"}, - {0x13, 0x01, 0x0C, 0x04, "Easy"}, - {0x13, 0x01, 0x0C, 0x08, "Hard"}, - {0x13, 0x01, 0x0C, 0x0C, "Hardest"}, - {0, 0xFE, 0, 4, "Lives"}, - {0x13, 0x01, 0x30, 0x00, "3"}, - {0x13, 0x01, 0x30, 0x10, "1"}, - {0x13, 0x01, 0x30, 0x20, "2"}, - {0x13, 0x01, 0x30, 0x30, "4"}, - {0, 0xFE, 0, 2, "Bonus Life"}, - {0x13, 0x01, 0x40, 0x00, "200000"}, - {0x13, 0x01, 0x40, 0x40, "300000"}, - {0, 0xFE, 0, 2, "Service"}, - {0x13, 0x01, 0x80, 0x00, "Off"}, - {0x13, 0x01, 0x80, 0x80, "On"}, - -}; - -static struct BurnDIPInfo aerofgt_DIPList[] = { - {0x14, 0xFF, 0xFF, 0x0F, NULL}, - - // DIP 3 - {0, 0xFE, 0, 5, "Region"}, - {0x14, 0x01, 0x0F, 0x00, "USA"}, - {0x14, 0x01, 0x0F, 0x01, "Korea"}, - {0x14, 0x01, 0x0F, 0x02, "Hong Kong"}, - {0x14, 0x01, 0x0F, 0x04, "Taiwan"}, - {0x14, 0x01, 0x0F, 0x0F, "Any"}, -}; - -STDDIPINFOEXT(aerofgt, aerofgt, aerofgt_) - -static struct BurnInputInfo turbofrcInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"P3 Coin", BIT_DIGITAL, DrvButton + 7, "p3 start"}, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 7, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 0, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 2, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 3, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(turbofrc) - -static struct BurnDIPInfo turbofrcDIPList[] = { - - // Defaults - {0x16, 0xFF, 0xFF, 0x00, NULL}, - {0x17, 0xFF, 0xFF, 0x06, NULL}, - - // DIP 1 - {0, 0xFE, 0, 8, "Coin 1"}, - {0x16, 0x01, 0x07, 0x00, "1 coins 1 credit"}, - {0x16, 0x01, 0x07, 0x01, "2 coins 1 credit"}, - {0x16, 0x01, 0x07, 0x02, "3 coins 1 credit"}, - {0x16, 0x01, 0x07, 0x03, "4 coins 1 credit"}, - {0x16, 0x01, 0x07, 0x04, "1 coin 2 credits"}, - {0x16, 0x01, 0x07, 0x05, "1 coin 3 credits"}, - {0x16, 0x01, 0x07, 0x06, "1 coin 5 credits"}, - {0x16, 0x01, 0x07, 0x07, "1 coin 6 credits"}, - {0, 0xFE, 0, 2, "2 Coins to Start, 1 to Continue"}, - {0x16, 0x01, 0x08, 0x00, "Off"}, - {0x16, 0x01, 0x08, 0x08, "On"}, - {0, 0xFE, 0, 2, "Coin Slot"}, - {0x16, 0x01, 0x10, 0x00, "Same"}, - {0x16, 0x01, 0x10, 0x10, "Individual"}, - {0, 0xFE, 0, 2, "Play Mode"}, - {0x16, 0x01, 0x20, 0x00, "2 Players"}, - {0x16, 0x01, 0x20, 0x20, "3 Players"}, - {0, 0xFE, 0, 2, "Demo_Sounds"}, - {0x16, 0x01, 0x40, 0x00, "Off"}, - {0x16, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Service"}, - {0x16, 0x01, 0x80, 0x00, "Off"}, - {0x16, 0x01, 0x80, 0x80, "On"}, - - // DIP 2 - {0, 0xFE, 0, 2, "Screen flip"}, - {0x17, 0x01, 0x01, 0x00, "Off"}, - {0x17, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 8, "Difficulty"}, - {0x17, 0x01, 0x0E, 0x00, "1 (Easiest)"}, - {0x17, 0x01, 0x0E, 0x02, "2"}, - {0x17, 0x01, 0x0E, 0x04, "3"}, - {0x17, 0x01, 0x0E, 0x06, "4 (Normal)"}, - {0x17, 0x01, 0x0E, 0x08, "5"}, - {0x17, 0x01, 0x0E, 0x0A, "6"}, - {0x17, 0x01, 0x0E, 0x0C, "7"}, - {0x17, 0x01, 0x0E, 0x0E, "8 (Hardest)"}, - {0, 0xFE, 0, 2, "Lives"}, - {0x17, 0x01, 0x10, 0x00, "3"}, - {0x17, 0x01, 0x10, 0x10, "2"}, - {0, 0xFE, 0, 2, "Bonus Life"}, - {0x17, 0x01, 0x20, 0x00, "300000"}, - {0x17, 0x01, 0x20, 0x20, "200000"}, - -}; - -STDDIPINFO(turbofrc) - -static struct BurnInputInfo karatblzInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 2, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 3, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 4"}, - - {"P3 Coin", BIT_DIGITAL, DrvButton + 4, "p3 coin"}, - {"P3 Start", BIT_DIGITAL, DrvButton + 6, "p3 start"}, - - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 0, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 2, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 3, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p3 fire 3"}, - {"P3 Button 4", BIT_DIGITAL, DrvJoy3 + 7, "p3 fire 4"}, - - {"P4 Coin", BIT_DIGITAL, DrvButton + 5, "p4 coin"}, - {"P4 Start", BIT_DIGITAL, DrvButton + 7, "p4 start"}, - - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 0, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 1, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 2, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 3, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p4 fire 3"}, - {"P4 Button 4", BIT_DIGITAL, DrvJoy4 + 7, "p4 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 6, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 7, "dip"}, -}; - -STDINPUTINFO(karatblz) - -static struct BurnDIPInfo karatblzDIPList[] = { - - // Defaults - {0x29, 0xFF, 0xFF, 0x00, NULL}, - {0x2A, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 8, "Coinage"}, - {0x29, 0x01, 0x07, 0x00, "1 coin 1 credit"}, - {0x29, 0x01, 0x07, 0x01, "2 coins 1 credit"}, - {0x29, 0x01, 0x07, 0x02, "3 coins 1 credit"}, - {0x29, 0x01, 0x07, 0x03, "4 coins 1 credit"}, - {0x29, 0x01, 0x07, 0x04, "1 coin 2 credit"}, - {0x29, 0x01, 0x07, 0x05, "1 coin 3 credit"}, - {0x29, 0x01, 0x07, 0x06, "1 coin 5 credit"}, - {0x29, 0x01, 0x07, 0x07, "1 coin 6 credit"}, - {0, 0xFE, 0, 2, "2 Coins to Start, 1 to Continue"}, - {0x29, 0x01, 0x08, 0x00, "Off"}, - {0x29, 0x01, 0x08, 0x08, "On"}, - {0, 0xFE, 0, 2, "Lives"}, - {0x29, 0x01, 0x10, 0x00, "2"}, - {0x29, 0x01, 0x10, 0x10, "1"}, - {0, 0xFE, 0, 4, "Cabinet"}, - {0x29, 0x01, 0x60, 0x00, "2 Players"}, - {0x29, 0x01, 0x60, 0x20, "3 Players"}, - {0x29, 0x01, 0x60, 0x40, "4 Players"}, - {0x29, 0x01, 0x60, 0x60, "4 Players (Team)"}, - {0, 0xFE, 0, 2, "Coin Slot"}, - {0x29, 0x01, 0x80, 0x00, "Same"}, - {0x29, 0x01, 0x80, 0x80, "Individual"}, - - // DIP 2 - {0, 0xFE, 0, 2, "Unknown"}, - {0x2A, 0x01, 0x01, 0x00, "Off"}, - {0x2A, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 4, "Number of Enemies"}, - {0x2A, 0x01, 0x06, 0x00, "Normal"}, - {0x2A, 0x01, 0x06, 0x02, "Easy"}, - {0x2A, 0x01, 0x06, 0x04, "Hard"}, - {0x2A, 0x01, 0x06, 0x06, "Hardest"}, - {0, 0xFE, 0, 4, "Strength of Enemies"}, - {0x2A, 0x01, 0x18, 0x00, "Normal"}, - {0x2A, 0x01, 0x18, 0x08, "Easy"}, - {0x2A, 0x01, 0x18, 0x10, "Hard"}, - {0x2A, 0x01, 0x18, 0x18, "Hardest"}, - {0, 0xFE, 0, 2, "Freeze"}, - {0x2A, 0x01, 0x20, 0x00, "Off"}, - {0x2A, 0x01, 0x20, 0x20, "On"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x2A, 0x01, 0x40, 0x00, "Off"}, - {0x2A, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Flip Screen"}, - {0x2A, 0x01, 0x80, 0x00, "Off"}, - {0x2A, 0x01, 0x80, 0x80, "On"}, -}; - -STDDIPINFO(karatblz) - -static struct BurnInputInfo spinlbrkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 2, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 3, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, -}; - -STDINPUTINFO(spinlbrk) - -static struct BurnDIPInfo spinlbrkDIPList[] = { - - // Defaults - {0x13, 0xFF, 0xFF, 0x00, NULL}, - {0x14, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 16, "Coin A"}, - {0x13, 0x01, 0x0F, 0x00, "1-1C 1-2 HPs"}, - {0x13, 0x01, 0x0F, 0x01, "1-1-1-1C 1-1-1-2 HPs"}, - {0x13, 0x01, 0x0F, 0x02, "1-1-1-1-1C 1-1-1-1-2 HPs"}, - {0x13, 0x01, 0x0F, 0x03, "2-2C 1-2 HPs"}, - {0x13, 0x01, 0x0F, 0x04, "2-1-1C 1-1-1 HPs"}, - {0x13, 0x01, 0x0F, 0x05, "2 Credits 2 Health Packs"}, - {0x13, 0x01, 0x0F, 0x06, "5 Credits 1 Health Pack"}, - {0x13, 0x01, 0x0F, 0x07, "4 Credits 1 Health Pack"}, - {0x13, 0x01, 0x0F, 0x08, "3 Credits 1 Health Pack"}, - {0x13, 0x01, 0x0F, 0x09, "2 Credits 1 Health Pack"}, - {0x13, 0x01, 0x0F, 0x0A, "1 Credit 6 Health Packs"}, - {0x13, 0x01, 0x0F, 0x0B, "1 Credit 5 Health Packs"}, - {0x13, 0x01, 0x0F, 0x0C, "1 Credit 4 Health Packs"}, - {0x13, 0x01, 0x0F, 0x0D, "1 Credit 3 Health Packs"}, - {0x13, 0x01, 0x0F, 0x0E, "1 Credit 2 Health Packs"}, - {0x13, 0x01, 0x0F, 0x0F, "1 Credit 1 Health Pack"}, - {0, 0xFE, 0, 16, "Coin A"}, - {0x13, 0x01, 0xF0, 0x00, "1-1C 1-2 HPs"}, - {0x13, 0x01, 0xF0, 0x10, "1-1-1-1C 1-1-1-2 HPs"}, - {0x13, 0x01, 0xF0, 0x20, "1-1-1-1-1C 1-1-1-1-2 HPs"}, - {0x13, 0x01, 0xF0, 0x30, "2-2C 1-2 HPs"}, - {0x13, 0x01, 0xF0, 0x40, "2-1-1C 1-1-1 HPs"}, - {0x13, 0x01, 0xF0, 0x50, "2 Credits 2 Health Packs"}, - {0x13, 0x01, 0xF0, 0x60, "5 Credits 1 Health Pack"}, - {0x13, 0x01, 0xF0, 0x70, "4 Credits 1 Health Pack"}, - {0x13, 0x01, 0xF0, 0x80, "3 Credits 1 Health Pack"}, - {0x13, 0x01, 0xF0, 0x90, "2 Credits 1 Health Pack"}, - {0x13, 0x01, 0xF0, 0xA0, "1 Credit 6 Health Packs"}, - {0x13, 0x01, 0xF0, 0xB0, "1 Credit 5 Health Packs"}, - {0x13, 0x01, 0xF0, 0xC0, "1 Credit 4 Health Packs"}, - {0x13, 0x01, 0xF0, 0xD0, "1 Credit 3 Health Packs"}, - {0x13, 0x01, 0xF0, 0xE0, "1 Credit 2 Health Packs"}, - {0x13, 0x01, 0xF0, 0xF0, "1 Credit 1 Health Pack"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Difficulty"}, - {0x14, 0x01, 0x03, 0x00, "Normal"}, - {0x14, 0x01, 0x03, 0x01, "Easy"}, - {0x14, 0x01, 0x03, 0x02, "Hard"}, - {0x14, 0x01, 0x03, 0x03, "Hardest"}, -}; - -static struct BurnDIPInfo spinlbrk_DIPList[] = { - - {0, 0xFE, 0, 2, "Coin Slot"}, - {0x14, 0x01, 0x04, 0x00, "Individuala"}, - {0x14, 0x01, 0x04, 0x04, "Same"}, - {0, 0xFE, 0, 2, "Flip Screen"}, - {0x14, 0x01, 0x08, 0x00, "Off"}, - {0x14, 0x01, 0x08, 0x08, "On"}, - - {0, 0xFE, 0, 2, "Lever Type"}, - {0x14, 0x01, 0x10, 0x00, "Digital"}, - {0x14, 0x01, 0x10, 0x10, "Analog"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x20, 0x00, "Off"}, - {0x14, 0x01, 0x20, 0x20, "On"}, - {0, 0xFE, 0, 2, "Health Pack"}, - {0x14, 0x01, 0x40, 0x00, "32 Hitpoints"}, - {0x14, 0x01, 0x40, 0x40, "40 Hitpoints"}, - {0, 0xFE, 0, 2, "Life Restoration"}, - {0x14, 0x01, 0x80, 0x00, "10 Points"}, - {0x14, 0x01, 0x80, 0x80, "5 Points"}, -}; - -STDDIPINFOEXT(spinlbrk, spinlbrk, spinlbrk_) - -static struct BurnDIPInfo spinlbru_DIPList[] = { - - {0, 0xFE, 0, 2, "Coin Slot"}, - {0x14, 0x01, 0x04, 0x00, "Individuala"}, - {0x14, 0x01, 0x04, 0x04, "Same"}, - {0, 0xFE, 0, 2, "Flip Screen"}, - {0x14, 0x01, 0x08, 0x00, "Off"}, - {0x14, 0x01, 0x08, 0x08, "On"}, - - {0, 0xFE, 0, 2, "Lever Type"}, - {0x14, 0x01, 0x10, 0x00, "Digital"}, - {0x14, 0x01, 0x10, 0x10, "Analog"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x20, 0x00, "Off"}, - {0x14, 0x01, 0x20, 0x20, "On"}, - {0, 0xFE, 0, 2, "Health Pack"}, - {0x14, 0x01, 0x40, 0x00, "20 Hitpoints"}, - {0x14, 0x01, 0x40, 0x40, "32 Hitpoints"}, - {0, 0xFE, 0, 2, "Life Restoration"}, - {0x14, 0x01, 0x80, 0x00, "10 Points"}, - {0x14, 0x01, 0x80, 0x80, "5 Points"}, -}; - -STDDIPINFOEXT(spinlbru, spinlbrk, spinlbru_) - -static struct BurnDIPInfo spinlbrj_DIPList[] = { - - {0, 0xFE, 0, 2, "Continue"}, - {0x14, 0x01, 0x04, 0x00, "Unlimited"}, - {0x14, 0x01, 0x04, 0x04, "6 Times"}, - {0, 0xFE, 0, 2, "Flip Screen"}, - {0x14, 0x01, 0x08, 0x00, "Off"}, - {0x14, 0x01, 0x08, 0x08, "On"}, - - {0, 0xFE, 0, 2, "Lever Type"}, - {0x14, 0x01, 0x10, 0x00, "Digital"}, - {0x14, 0x01, 0x10, 0x10, "Analog"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x20, 0x00, "Off"}, - {0x14, 0x01, 0x20, 0x20, "On"}, - {0, 0xFE, 0, 2, "Health Pack"}, - {0x14, 0x01, 0x40, 0x00, "32 Hitpoints"}, - {0x14, 0x01, 0x40, 0x40, "40 Hitpoints"}, - {0, 0xFE, 0, 2, "Life Restoration"}, - {0x14, 0x01, 0x80, 0x00, "10 Points"}, - {0x14, 0x01, 0x80, 0x80, "5 Points"}, -}; - -STDDIPINFOEXT(spinlbrj, spinlbrk, spinlbrj_) - -static struct BurnInputInfo PspikesInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 3, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy2 + 6, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(Pspikes) - -static struct BurnDIPInfo aerofgtb_DIPList[] = { - - {0x14, 0xFF, 0xFF, 0x01, NULL}, - - // DIP 3 - {0, 0xFE, 0, 2, "Region"}, - {0x14, 0x01, 0x01, 0x00, "Taiwan"}, - {0x14, 0x01, 0x01, 0x01, "Japan"}, -}; - -STDDIPINFOEXT(aerofgtb, aerofgt, aerofgtb_) - -static struct BurnDIPInfo PspikesDIPList[]= -{ - {0x14, 0xff, 0xff, 0xbf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x03, 0x01, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x03, 0x02, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x03, 0x00, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x0c, 0x04, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0c, 0x00, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x80, 0x80, "Off" }, -// {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "1 Player Starting Score" }, - {0x15, 0x01, 0x06, 0x06, "12-12" }, - {0x15, 0x01, 0x06, 0x04, "11-11" }, - {0x15, 0x01, 0x06, 0x02, "11-12" }, - {0x15, 0x01, 0x06, 0x00, "10-12" }, - - {0 , 0xfe, 0 , 4, "2 Players Starting Score" }, - {0x15, 0x01, 0x18, 0x18, "9-9" }, - {0x15, 0x01, 0x18, 0x10, "7-7" }, - {0x15, 0x01, 0x18, 0x08, "5-5" }, - {0x15, 0x01, 0x18, 0x00, "0-0" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x15, 0x01, 0x20, 0x20, "Normal" }, - {0x15, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "2 Players Time Per Credit" }, - {0x15, 0x01, 0x40, 0x40, "3 min" }, - {0x15, 0x01, 0x40, 0x00, "2 min" }, - - {0 , 0xfe, 0 , 2, "Debug" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Pspikes) - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x001F) << 3; // Red - r |= r >> 5; - g = (nColour & 0x03E0) >> 2; // Green - g |= g >> 5; - b = (nColour & 0x7C00) >> 7; // Blue - b |= b >> 5; - - return BurnHighCol(b, g, r, 0); -} - -static UINT8 __fastcall aerofgtReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xFFFFA1: - return ~DrvInput[0]; - case 0xFFFFA3: - return ~DrvInput[1]; - case 0xFFFFA5: - return ~DrvInput[2]; - case 0xFFFFA7: - return ~DrvInput[3]; - case 0xFFFFA9: - return ~DrvInput[4]; - case 0xFFFFAD: - //printf("read pending_command %d addr %08x\n", pending_command, sekAddress); - return pending_command; - case 0xFFFFAF: - return ~DrvInput[5]; -// default: -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - return 0; -} - -static void SoundCommand(UINT8 nCommand) -{ -// bprintf(PRINT_NORMAL, _T(" - Sound command sent (0x%02X).\n"), nCommand); - INT32 nCycles = ((INT64)SekTotalCycles() * nCyclesTotal[1] / nCyclesTotal[0]); - if (nCycles <= ZetTotalCycles()) return; - - BurnTimerUpdate(nCycles); - - nSoundlatch = nCommand; - ZetNmi(); -} - -static void __fastcall aerofgtWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (( sekAddress & 0xFF0000 ) == 0x1A0000) { - sekAddress &= 0xFFFF; - if (sekAddress < 0x800) { - RamPal[sekAddress^1] = byteValue; - // palette byte write at boot self-test only ?! - // if (sekAddress & 1) - // RamCurPal[sekAddress>>1] = CalcCol( *((UINT16 *)&RamPal[sekAddress]) ); - } - return; - } - - switch (sekAddress) { - case 0xFFFFC1: - pending_command = 1; - SoundCommand(byteValue); - break; -/* - case 0xFFFFB9: - case 0xFFFFBB: - case 0xFFFFBD: - case 0xFFFFBF: - break; - case 0xFFFFAD: - // NOP - break; - default: - printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); -*/ - } -} - -static void __fastcall aerofgtWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (( sekAddress & 0xFF0000 ) == 0x1A0000) { - sekAddress &= 0xFFFF; - if (sekAddress < 0x800) { - *((UINT16 *)&RamPal[sekAddress]) = BURN_ENDIAN_SWAP_INT16(wordValue); - RamCurPal[sekAddress>>1] = CalcCol( wordValue ); - } - return; - } - - switch (sekAddress) { - case 0xFFFF80: - RamGfxBank[0] = wordValue >> 0x08; - RamGfxBank[1] = wordValue & 0xFF; - break; - case 0xFFFF82: - RamGfxBank[2] = wordValue >> 0x08; - RamGfxBank[3] = wordValue & 0xFF; - break; - case 0xFFFF84: - RamGfxBank[4] = wordValue >> 0x08; - RamGfxBank[5] = wordValue & 0xFF; - break; - case 0xFFFF86: - RamGfxBank[6] = wordValue >> 0x08; - RamGfxBank[7] = wordValue & 0xFF; - break; - case 0xFFFF88: - bg1scrolly = wordValue; - break; - case 0xFFFF90: - bg2scrolly = wordValue; - break; -/* - case 0xFFFF40: - case 0xFFFF42: - case 0xFFFF44: - case 0xFFFF48: - case 0xFFFF4A: - case 0xFFFF4C: - case 0xFFFF50: - case 0xFFFF52: - case 0xFFFF60: - break; - default: - printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); -*/ - } -} - -static UINT8 __fastcall turbofrcReadByte(UINT32 sekAddress) -{ - sekAddress &= 0x0FFFFF; - switch (sekAddress) { - case 0x0FF000: - return ~DrvInput[3]; - case 0x0FF001: - return ~DrvInput[0]; - case 0x0FF002: - return 0xFF; - case 0x0FF003: - return ~DrvInput[1]; - case 0x0FF004: - return ~DrvInput[5]; - case 0x0FF005: - return ~DrvInput[4]; - case 0x0FF007: - return pending_command; - case 0x0FF009: - return ~DrvInput[2]; -// default: -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - return 0; -} - -static void __fastcall turbofrcWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (( sekAddress & 0x0FF000 ) == 0x0FE000) { - sekAddress &= 0x07FF; - RamPal[sekAddress^1] = byteValue; - // palette byte write at boot self-test only ?! - //if (sekAddress & 1) - // RamCurPal[sekAddress>>1] = CalcCol( *((UINT16 *)&RamPal[sekAddress & 0xFFE]) ); - return; - } - - sekAddress &= 0x0FFFFF; - - switch (sekAddress) { - - case 0x0FF00E: - pending_command = 1; - SoundCommand(byteValue); - break; -// default: -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } -} - -static void __fastcall turbofrcWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (( sekAddress & 0x0FF000 ) == 0x0FE000) { - sekAddress &= 0x07FE; - *((UINT16 *)&RamPal[sekAddress]) = BURN_ENDIAN_SWAP_INT16(wordValue); - RamCurPal[sekAddress>>1] = CalcCol( wordValue ); - return; - } - - sekAddress &= 0x0FFFFF; - - switch (sekAddress) { - case 0x0FF002: - bg1scrolly = wordValue; - break; - case 0x0FF004: - bg2scrollx = wordValue; - break; - case 0x0FF006: - bg2scrolly = wordValue; - break; - - case 0x0FF008: - RamGfxBank[0] = (wordValue >> 0) & 0x0f; - RamGfxBank[1] = (wordValue >> 4) & 0x0f; - RamGfxBank[2] = (wordValue >> 8) & 0x0f; - RamGfxBank[3] = (wordValue >> 12) & 0x0f; - break; - case 0x0FF00A: - RamGfxBank[4] = (wordValue >> 0) & 0x0f; - RamGfxBank[5] = (wordValue >> 4) & 0x0f; - RamGfxBank[6] = (wordValue >> 8) & 0x0f; - RamGfxBank[7] = (wordValue >> 12) & 0x0f; - break; - case 0x0FF00C: - // NOP - break; -// default: -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -static UINT8 __fastcall karatblzReadByte(UINT32 sekAddress) -{ - sekAddress &= 0x0FFFFF; - - switch (sekAddress) { - case 0x0FF000: - return ~DrvInput[4]; - case 0x0FF001: - return ~DrvInput[0]; - case 0x0FF002: - return 0xFF; - case 0x0FF003: - return ~DrvInput[1]; - case 0x0FF004: - return ~DrvInput[5]; - case 0x0FF005: - return ~DrvInput[2]; - case 0x0FF006: - return 0xFF; - case 0x0FF007: - return ~DrvInput[3]; - case 0x0FF008: - return ~DrvInput[7]; - case 0x0FF009: - return ~DrvInput[6]; - case 0x0FF00B: - return pending_command; - -// default: -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - return 0; -} - -static void __fastcall karatblzWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - sekAddress &= 0x0FFFFF; - - switch (sekAddress) { - case 0x0FF000: - case 0x0FF401: - case 0x0FF403: - - break; - - case 0x0FF002: - //if (ACCESSING_MSB) { - // setbank(bg1_tilemap,0,(data & 0x0100) >> 8); - // setbank(bg2_tilemap,1,(data & 0x0800) >> 11); - //} - RamGfxBank[0] = (byteValue & 0x1); - RamGfxBank[1] = (byteValue & 0x8) >> 3; - break; - case 0x0FF007: - pending_command = 1; - SoundCommand(byteValue); - break; -// default: -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } -} - -static void __fastcall karatblzWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (( sekAddress & 0x0FF000 ) == 0x0FE000) { - sekAddress &= 0x07FF; - *((UINT16 *)&RamPal[sekAddress]) = wordValue; - RamCurPal[sekAddress>>1] = CalcCol( wordValue ); - return; - } - - sekAddress &= 0x0FFFFF; - - switch (sekAddress) { - case 0x0ff008: - bg1scrollx = wordValue; - break; - case 0x0ff00A: - bg1scrolly = wordValue; - break; - case 0x0ff00C: - bg2scrollx = wordValue; - break; - case 0x0ff00E: - bg2scrolly = wordValue; - break; -// default: -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -static UINT8 __fastcall aerofgtbReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x0FE000: - return ~DrvInput[2]; - case 0x0FE001: - return ~DrvInput[0]; - case 0x0FE002: - return 0xFF; - case 0x0FE003: - return ~DrvInput[1]; - case 0x0FE004: - return ~DrvInput[4]; - case 0x0FE005: - return ~DrvInput[3]; - case 0x0FE007: - return pending_command; - case 0x0FE009: - return ~DrvInput[5]; - - default: - printf("Attempt to read byte value of location %x\n", sekAddress); - } - return 0; -} - -static UINT16 __fastcall aerofgtbReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - - default: - printf("Attempt to read word value of location %x\n", sekAddress); - } - return 0; -} - -static void __fastcall aerofgtbWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (( sekAddress & 0x0FF000 ) == 0x0FD000) { - sekAddress &= 0x07FF; - RamPal[sekAddress^1] = byteValue; - // palette byte write at boot self-test only ?! - //if (sekAddress & 1) - // RamCurPal[sekAddress>>1] = CalcCol( *((UINT16 *)&RamPal[sekAddress & 0xFFE]) ); - return; - } - - switch (sekAddress) { - case 0x0FE001: - case 0x0FE401: - case 0x0FE403: - // NOP - break; - - case 0x0FE00E: - pending_command = 1; - SoundCommand(byteValue); - break; - - default: - printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } -} - -static void __fastcall aerofgtbWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (( sekAddress & 0x0FF000 ) == 0x0FD000) { - sekAddress &= 0x07FE; - *((UINT16 *)&RamPal[sekAddress]) = BURN_ENDIAN_SWAP_INT16(wordValue); - RamCurPal[sekAddress>>1] = CalcCol( wordValue ); - return; - } - - switch (sekAddress) { - case 0x0FE002: - bg1scrolly = wordValue; - break; - case 0x0FE004: - bg2scrollx = wordValue; - break; - case 0x0FE006: - bg2scrolly = wordValue; - break; - case 0x0FE008: - RamGfxBank[0] = (wordValue >> 0) & 0x0f; - RamGfxBank[1] = (wordValue >> 4) & 0x0f; - RamGfxBank[2] = (wordValue >> 8) & 0x0f; - RamGfxBank[3] = (wordValue >> 12) & 0x0f; - break; - case 0x0FE00A: - RamGfxBank[4] = (wordValue >> 0) & 0x0f; - RamGfxBank[5] = (wordValue >> 4) & 0x0f; - RamGfxBank[6] = (wordValue >> 8) & 0x0f; - RamGfxBank[7] = (wordValue >> 12) & 0x0f; - break; - case 0x0FE00C: - // NOP - break; - - default: - printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -static UINT16 __fastcall spinlbrkReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xFFF000: - return ~(DrvInput[0] | (DrvInput[2] << 8)); - case 0xFFF002: - return ~(DrvInput[1]); - case 0xFFF004: - return ~(DrvInput[3] | (DrvInput[4] << 8)); - -// default: -// printf("Attempt to read word value of location %x\n", sekAddress); - } - return 0; -} - - -static void __fastcall spinlbrkWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0xFFF401: - case 0xFFF403: - // NOP - break; - - case 0xFFF007: - pending_command = 1; - SoundCommand(byteValue); - break; - -// default: -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } -} - -static void __fastcall spinlbrkWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (( sekAddress & 0xFFF000 ) == 0xFFE000) { - sekAddress &= 0x07FF; - *((UINT16 *)&RamPal[sekAddress]) = BURN_ENDIAN_SWAP_INT16(wordValue); - RamCurPal[sekAddress>>1] = CalcCol( wordValue ); - return; - } - - switch (sekAddress) { - case 0xFFF000: - RamGfxBank[0] = (wordValue & 0x07); - RamGfxBank[1] = (wordValue & 0x38) >> 3; - break; - case 0xFFF002: - bg2scrollx = wordValue; - break; - case 0xFFF008: - // NOP - break; - -// default: -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -static void __fastcall pspikesWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if (( sekAddress & 0xFFF000 ) == 0xFFE000) { - sekAddress &= 0x0FFE; - *((UINT16 *)&RamPal[sekAddress]) = BURN_ENDIAN_SWAP_INT16(wordValue); - RamCurPal[sekAddress>>1] = CalcCol( wordValue ); - return; - } -} - -static void __fastcall pspikesWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if (( sekAddress & 0xFFF000 ) == 0xFFE000) { - sekAddress &= 0x0FFF; - RamPal[sekAddress^1] = byteValue; - - UINT16 wordValue = *((UINT16 *)&RamPal[sekAddress & ~1]); - RamCurPal[sekAddress>>1] = CalcCol( wordValue ); - return; - } - - switch (sekAddress) - { - case 0xfff001: - spritepalettebank = byteValue & 0x03; - charpalettebank = (byteValue & 0x1c) >> 2; - return; - - case 0xfff003: - RamGfxBank[0] = (byteValue >> 4) & 0x0f; - RamGfxBank[1] = byteValue & 0x0f; - return; - - case 0xfff005: - bg1scrolly = byteValue; - return; - - case 0xfff007: - pending_command = 1; - SoundCommand(byteValue); - return; - } -} - - -static UINT8 __fastcall pspikesReadByte(UINT32 sekAddress) -{ - bprintf (0, _T("RB: %5.5x\n"), sekAddress); - - switch (sekAddress) - { - case 0xFFF001: - return ~DrvInput[0]; - - case 0xFFF000: - return ~DrvInput[1]; - - case 0xFFF003: - return ~DrvInput[2]; - - case 0xFFF005: - return DrvInput[4]; - - case 0xFFF004: - return DrvInput[5]; - - - case 0xFFF007: - return pending_command; - } - - return 0; -} - -static void aerofgtFMIRQHandler(INT32, INT32 nStatus) -{ - if (ZetGetActive() == -1) return; -// bprintf(PRINT_NORMAL, _T(" - IRQ -> %i.\n"), nStatus); - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 aerofgtSynchroniseStream(INT32 nSoundRate) -{ - if (ZetGetActive() == -1) return 0; - return (INT64)ZetTotalCycles() * nSoundRate / 5000000; -} - -static double aerofgtGetTime() -{ - if (ZetGetActive() == -1) return 0; - return (double)ZetTotalCycles() / 5000000.0; -} - -static void aerofgtSndBankSwitch(UINT8 v) -{ - v &= 0x03; - - if (v != nAerofgtZ80Bank) { - UINT8* nStartAddress = RomZ80 + 0x10000 + (v << 15); - ZetMapArea(0x8000, 0xFFFF, 0, nStartAddress); - ZetMapArea(0x8000, 0xFFFF, 2, nStartAddress); - nAerofgtZ80Bank = v; - } -} - -static UINT8 __fastcall aerofgtZ80PortRead(UINT16 p) -{ - switch (p & 0xFF) { - case 0x00: - return BurnYM2610Read(0); - case 0x02: - return BurnYM2610Read(2); - case 0x0C: - return nSoundlatch; -// default: -// printf("Z80 Attempt to read port %04x\n", p); - } - return 0; -} - -static void __fastcall aerofgtZ80PortWrite(UINT16 p, UINT8 v) -{ - switch (p & 0x0FF) { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - BurnYM2610Write(p & 3, v); - break; - case 0x04: - aerofgtSndBankSwitch(v); - break; - case 0x08: - pending_command = 0; - break; -// default: -// printf("Z80 Attempt to write %02x to port %04x\n", v, p); - } -} - -static UINT8 __fastcall turbofrcZ80PortRead(UINT16 p) -{ - switch (p & 0xFF) { - case 0x14: - return nSoundlatch; - case 0x18: - return BurnYM2610Read(0); - case 0x1A: - return BurnYM2610Read(2); -// default: -// printf("Z80 Attempt to read port %04x\n", p); - } - return 0; -} - -static void __fastcall turbofrcZ80PortWrite(UINT16 p, UINT8 v) -{ - switch (p & 0x0FF) { - case 0x18: - case 0x19: - case 0x1A: - case 0x1B: - BurnYM2610Write((p - 0x18) & 3, v); - break; - case 0x00: - aerofgtSndBankSwitch(v); - break; - case 0x14: - pending_command = 0; - break; -// default: -// printf("Z80 Attempt to write %02x to port %04x\n", v, p); - } -} - - -static void aerofgtAssembleInputs() -{ - DrvInput[0] = 0x00; - DrvInput[1] = 0x00; - DrvInput[2] = 0x00; - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } -} - -static void karatblzAssembleInputs() -{ - DrvInput[0] = 0x00; - DrvInput[1] = 0x00; - DrvInput[2] = 0x00; - DrvInput[3] = 0x00; - DrvInput[4] = 0x00; - DrvInput[5] = 0x00; - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvJoy3[i] & 1) << i; - DrvInput[3] |= (DrvJoy4[i] & 1) << i; - } - for (INT32 i = 0; i < 4; i++) { - DrvInput[4] |= (DrvButton[i] & 1) << i; - DrvInput[5] |= (DrvButton[i+4] & 1) << i; - } -} - -static void turbofrcAssembleInputs() -{ - DrvInput[0] = 0x00; - DrvInput[1] = 0x00; - DrvInput[2] = 0x00; - DrvInput[3] = 0x00; - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvJoy3[i] & 1) << i; - DrvInput[3] |= (DrvButton[i] & 1) << i; - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // 68000 ROM - RomZ80 = Next; Next += 0x030000; // Z80 ROM - RomBg = Next; Next += 0x200040; // Background, 1M 8x8x4bit decode to 2M + 64Byte safe - DeRomBg = RomBg + 0x000040; - RomSpr1 = Next; Next += 0x200000; // Sprite 1 , 1M 16x16x4bit decode to 2M + 256Byte safe - RomSpr2 = Next; Next += 0x100100; // Sprite 2 - - DeRomSpr1 = RomSpr1 + 0x000100; - DeRomSpr2 = RomSpr2 += 0x000100; - - RomSnd1 = Next; Next += 0x040000; // ADPCM data - RomSndSize1 = 0x040000; - RomSnd2 = Next; Next += 0x100000; // ADPCM data - RomSndSize2 = 0x100000; - RamStart = Next; - - RamPal = Next; Next += 0x000800; // 1024 of X1R5G5B5 Palette - RamRaster = (UINT16 *)Next; Next += 0x000800 * sizeof(UINT16); // 0x1b0000~0x1b07ff, Raster - // 0x1b0800~0x1b0801, NOP - // 0x1b0ff0~0x1b0fff, stack area during boot - RamBg1V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG1 Video Ram - RamBg2V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG2 Video Ram - RamSpr1 = (UINT16 *)Next; Next += 0x004000 * sizeof(UINT16); // Sprite 1 Ram - RamSpr2 = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // Sprite 2 Ram - Ram01 = Next; Next += 0x010000; // Work Ram - RamZ80 = Next; Next += 0x000800; // Z80 Ram 2K - - RamEnd = Next; - - RamCurPal = (UINT32 *)Next; Next += 0x000400 * sizeof(UINT32); // 1024 colors - - MemEnd = Next; - return 0; -} - -static INT32 turbofrcMemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x0C0000; // 68000 ROM - RomZ80 = Next; Next += 0x030000; // Z80 ROM - - RomBg = Next; Next += 0x400040; // - DeRomBg = RomBg + 0x000040; - - RomSpr1 = Next; Next += 0x400000; // Sprite 1 - RomSpr2 = Next; Next += 0x200100; // Sprite 2 - - DeRomSpr1 = RomSpr1 + 0x000100; - DeRomSpr2 = RomSpr2 += 0x000100; - - RomSnd1 = Next; Next += 0x020000; // ADPCM data - RomSndSize1 = 0x020000; - RomSnd2 = Next; Next += 0x100000; // ADPCM data - RomSndSize2 = 0x100000; - - RamStart = Next; - - RamBg1V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG1 Video Ram - RamBg2V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG2 Video Ram - RamSpr1 = (UINT16 *)Next; Next += 0x002000 * sizeof(UINT16); // Sprite 1 Ram - RamSpr2 = (UINT16 *)Next; Next += 0x002000 * sizeof(UINT16); // Sprite 2 Ram - RamSpr3 = (UINT16 *)Next; Next += 0x000400 * sizeof(UINT16); // Sprite 3 Ram - RamRaster = (UINT16 *)Next; Next += 0x000800 * sizeof(UINT16); // Raster Ram - - RamSpr1SizeMask = 0x1FFF; - RamSpr2SizeMask = 0x1FFF; - RomSpr1SizeMask = 0x3FFF; - RomSpr2SizeMask = 0x1FFF; - - Ram01 = Next; Next += 0x014000; // Work Ram - - RamPal = Next; Next += 0x000800; // 1024 of X1R5G5B5 Palette - RamZ80 = Next; Next += 0x000800; // Z80 Ram 2K - - RamEnd = Next; - - RamPrioBitmap = Next; Next += 352 * 240 * 2; // For turbofrc - RamCurPal = (UINT32 *)Next; Next += 0x000400 * sizeof(UINT32); - - MemEnd = Next; - return 0; -} - -static INT32 karatblzMemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // 68000 ROM - RomZ80 = Next; Next += 0x030000; // Z80 ROM - - RomBg = Next; Next += 0x200040; // Background, 1M 8x8x4bit decode to 2M + 64Byte safe - DeRomBg = RomBg + 0x000040; - - RomSpr1 = Next; Next += 0x800000; // Sprite 1 , 1M 16x16x4bit decode to 2M + 256Byte safe - RomSpr2 = Next; Next += 0x200100; // Sprite 2 - - DeRomSpr1 = RomSpr1 + 0x000100; - DeRomSpr2 = RomSpr2 += 0x000100; - - RomSnd1 = Next; Next += 0x080000; // ADPCM data - RomSndSize1 = 0x080000; - RomSnd2 = Next; Next += 0x100000; // ADPCM data - RomSndSize2 = 0x100000; - - RamStart = Next; - - RamBg1V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG1 Video Ram - RamBg2V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG2 Video Ram - RamSpr1 = (UINT16 *)Next; Next += 0x008000 * sizeof(UINT16); // Sprite 1 Ram - RamSpr2 = (UINT16 *)Next; Next += 0x008000 * sizeof(UINT16); // Sprite 2 Ram - RamSpr3 = (UINT16 *)Next; Next += 0x000400 * sizeof(UINT16); // Sprite 3 Ram - Ram01 = Next; Next += 0x014000; // Work Ram 1 + Work Ram 1 - RamPal = Next; Next += 0x000800; // 1024 of X1R5G5B5 Palette - RamZ80 = Next; Next += 0x000800; // Z80 Ram 2K - - RamSpr1SizeMask = 0x7FFF; - RamSpr2SizeMask = 0x7FFF; - RomSpr1SizeMask = 0x7FFF; - RomSpr2SizeMask = 0x1FFF; - - RamEnd = Next; - - RamCurPal = (UINT32 *)Next; Next += 0x000400 * sizeof(UINT32); - - MemEnd = Next; - return 0; -} - -static INT32 spinlbrkMemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x040000; // 68000 ROM - RomZ80 = Next; Next += 0x030000; // Z80 ROM - - RomBg = Next; Next += 0x500050; // Background, 2.5M 8x8x4bit - DeRomBg = RomBg + 0x000040; - - RomSpr1 = Next; Next += 0x200000; // Sprite 1 - RomSpr2 = Next; Next += 0x400110; // Sprite 2 - - DeRomSpr1 = RomSpr1 + 0x000100; - DeRomSpr2 = RomSpr2 + 0x000100; - - RomSnd2 = Next; Next += 0x100000; // ADPCM data - RomSnd1 = RomSnd2; - - RomSndSize1 = 0x100000; - RomSndSize2 = 0x100000; - - RamSpr2 = (UINT16 *)Next; Next += 0x010000 * sizeof(UINT16); // Sprite 2 Ram - RamSpr1 = (UINT16 *)Next; Next += 0x002000 * sizeof(UINT16); // Sprite 1 Ram - - RamStart = Next; - - RamBg1V = (UINT16 *)Next; Next += 0x000800 * sizeof(UINT16); // BG1 Video Ram - RamBg2V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG2 Video Ram - Ram01 = Next; Next += 0x004000; // Work Ram - RamSpr3 = (UINT16 *)Next; Next += 0x000400 * sizeof(UINT16); // Sprite 3 Ram - RamRaster = (UINT16 *)Next; Next += 0x000100 * sizeof(UINT16); // Raster - RamPal = Next; Next += 0x000800; // 1024 of X1R5G5B5 Palette - RamZ80 = Next; Next += 0x000800; // Z80 Ram 2K - - RamSpr1SizeMask = 0x1FFF; - RamSpr2SizeMask = 0xFFFF; - - RomSpr1SizeMask = 0x1FFF; - RomSpr2SizeMask = 0x3FFF; - - RamEnd = Next; - - RamCurPal = (UINT32 *)Next; Next += 0x000400 * sizeof(UINT32); - - MemEnd = Next; - return 0; -} - -static INT32 aerofgtbMemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // 68000 ROM - RomZ80 = Next; Next += 0x030000; // Z80 ROM - RomBg = Next; Next += 0x400040; // Background, 1M 8x8x4bit decode to 2M + 64Byte safe - DeRomBg = RomBg + 0x000040; - RomSpr1 = Next; Next += 0x200000; // Sprite 1 , 1M 16x16x4bit decode to 2M + 256Byte safe - RomSpr2 = Next; Next += 0x100100; // Sprite 2 - - DeRomSpr1 = RomSpr1 + 0x000100; - DeRomSpr2 = RomSpr2 += 0x000100; - - RomSnd1 = Next; Next += 0x040000; // ADPCM data - RomSndSize1 = 0x040000; - RomSnd2 = Next; Next += 0x100000; // ADPCM data - RomSndSize2 = 0x100000; - - RamStart = Next; - - Ram01 = Next; Next += 0x014000; // Work Ram - RamBg1V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG1 Video Ram - RamBg2V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG2 Video Ram - RamSpr1 = (UINT16 *)Next; Next += 0x002000 * sizeof(UINT16); // Sprite 1 Ram - RamSpr2 = (UINT16 *)Next; Next += 0x002000 * sizeof(UINT16); // Sprite 2 Ram - RamSpr3 = (UINT16 *)Next; Next += 0x000400 * sizeof(UINT16); // Sprite 3 Ram - RamPal = Next; Next += 0x000800; // 1024 of X1R5G5B5 Palette - RamRaster = (UINT16 *)Next; Next += 0x000800 * sizeof(UINT16); // Raster - - RamSpr1SizeMask = 0x1FFF; - RamSpr2SizeMask = 0x1FFF; - RomSpr1SizeMask = 0x1FFF; - RomSpr2SizeMask = 0x0FFF; - - RamZ80 = Next; Next += 0x000800; // Z80 Ram 2K - - RamEnd = Next; - - RamCurPal = (UINT32 *)Next; Next += 0x000400 * sizeof(UINT32); // 1024 colors - - MemEnd = Next; - return 0; -} - -static INT32 pspikesMemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x040000; // 68000 ROM - RomZ80 = Next; Next += 0x030000; // Z80 ROM - RomBg = Next; Next += 0x100040; // Background, 1M 8x8x4bit decode to 2M + 64Byte safe - DeRomBg = RomBg + 0x000040; - RomSpr1 = Next; Next += 0x200000; // Sprite 1 , 1M 16x16x4bit decode to 2M + 256Byte safe - RomSpr2 = RomSpr1; // Sprite 2 - - DeRomSpr1 = RomSpr1 + 0x000100; - DeRomSpr2 = RomSpr2 += 0x000100; - - RomSnd1 = Next; Next += 0x040000; // ADPCM data - RomSndSize1 = 0x040000; - RomSnd2 = Next; Next += 0x100000; // ADPCM data - RomSndSize2 = 0x100000; - - RamStart = Next; - - Ram01 = Next; Next += 0x010000; // Work Ram - RamBg1V = (UINT16 *)Next; Next += 0x001000 * sizeof(UINT16); // BG1 Video Ram - - RamSpr1 = (UINT16 *)Next; Next += 0x002000 * sizeof(UINT16); // Sprite 1 Ram - RamSpr2 = (UINT16 *)Next; Next += 0x002000 * sizeof(UINT16); // Sprite 2 Ram - RamSpr3 = (UINT16 *)Next; Next += 0x000400 * sizeof(UINT16); // Sprite 3 Ram - RamPal = Next; Next += 0x001000; // 1024 of X1R5G5B5 Palette - RamRaster = (UINT16 *)Next; Next += 0x000800 * sizeof(UINT16); // Raster - - RamSpr1SizeMask = 0x1FFF; - RamSpr2SizeMask = 0x1FFF; - RomSpr1SizeMask = 0x1FFF; - RomSpr2SizeMask = 0x1FFF; - - RamZ80 = Next; Next += 0x000800; // Z80 Ram 2K - - RamEnd = Next; - - RamCurPal = (UINT32 *)Next; Next += 0x000800 * sizeof(UINT32); // 1024 colors - - MemEnd = Next; - return 0; -} - -static void pspikesDecodeBg(INT32 cnt) -{ - for (INT32 c=cnt-1; c>=0; c--) { - for (INT32 y=7; y>=0; y--) { - DeRomBg[(c * 64) + (y * 8) + 7] = RomBg[0x00003 + (y * 4) + (c * 32)] >> 4; - DeRomBg[(c * 64) + (y * 8) + 6] = RomBg[0x00003 + (y * 4) + (c * 32)] & 0x0f; - DeRomBg[(c * 64) + (y * 8) + 5] = RomBg[0x00002 + (y * 4) + (c * 32)] >> 4; - DeRomBg[(c * 64) + (y * 8) + 4] = RomBg[0x00002 + (y * 4) + (c * 32)] & 0x0f; - DeRomBg[(c * 64) + (y * 8) + 3] = RomBg[0x00001 + (y * 4) + (c * 32)] >> 4; - DeRomBg[(c * 64) + (y * 8) + 2] = RomBg[0x00001 + (y * 4) + (c * 32)] & 0x0f; - DeRomBg[(c * 64) + (y * 8) + 1] = RomBg[0x00000 + (y * 4) + (c * 32)] >> 4; - DeRomBg[(c * 64) + (y * 8) + 0] = RomBg[0x00000 + (y * 4) + (c * 32)] & 0x0f; - } - } -} - -static void pspikesDecodeSpr(UINT8 *d, UINT8 *s, INT32 cnt) -{ - for (INT32 c=cnt-1; c>=0; c--) - for (INT32 y=15; y>=0; y--) { - d[(c * 256) + (y * 16) + 15] = s[0x00007 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 14] = s[0x00007 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 13] = s[0x00005 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 12] = s[0x00005 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 11] = s[0x00006 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 10] = s[0x00006 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 9] = s[0x00004 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 8] = s[0x00004 + (y * 8) + (c * 128)] & 0x0f; - - d[(c * 256) + (y * 16) + 7] = s[0x00003 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 6] = s[0x00003 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 5] = s[0x00001 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 4] = s[0x00001 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 3] = s[0x00002 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 2] = s[0x00002 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 1] = s[0x00000 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 0] = s[0x00000 + (y * 8) + (c * 128)] & 0x0f; - } -} - - -static void DecodeBg() -{ - for (INT32 c=0x8000-1; c>=0; c--) { - for (INT32 y=7; y>=0; y--) { - DeRomBg[(c * 64) + (y * 8) + 7] = RomBg[0x00002 + (y * 4) + (c * 32)] & 0x0f; - DeRomBg[(c * 64) + (y * 8) + 6] = RomBg[0x00002 + (y * 4) + (c * 32)] >> 4; - DeRomBg[(c * 64) + (y * 8) + 5] = RomBg[0x00003 + (y * 4) + (c * 32)] & 0x0f; - DeRomBg[(c * 64) + (y * 8) + 4] = RomBg[0x00003 + (y * 4) + (c * 32)] >> 4; - DeRomBg[(c * 64) + (y * 8) + 3] = RomBg[0x00000 + (y * 4) + (c * 32)] & 0x0f; - DeRomBg[(c * 64) + (y * 8) + 2] = RomBg[0x00000 + (y * 4) + (c * 32)] >> 4; - DeRomBg[(c * 64) + (y * 8) + 1] = RomBg[0x00001 + (y * 4) + (c * 32)] & 0x0f; - DeRomBg[(c * 64) + (y * 8) + 0] = RomBg[0x00001 + (y * 4) + (c * 32)] >> 4; - } - } -} - -static void DecodeSpr(UINT8 *d, UINT8 *s, INT32 cnt) -{ - for (INT32 c=cnt-1; c>=0; c--) - for (INT32 y=15; y>=0; y--) { - d[(c * 256) + (y * 16) + 15] = s[0x00006 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 14] = s[0x00006 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 13] = s[0x00007 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 12] = s[0x00007 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 11] = s[0x00004 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 10] = s[0x00004 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 9] = s[0x00005 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 8] = s[0x00005 + (y * 8) + (c * 128)] >> 4; - - d[(c * 256) + (y * 16) + 7] = s[0x00002 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 6] = s[0x00002 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 5] = s[0x00003 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 4] = s[0x00003 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 3] = s[0x00000 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 2] = s[0x00000 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 1] = s[0x00001 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 0] = s[0x00001 + (y * 8) + (c * 128)] >> 4; - } -} - -static void aerofgtbDecodeSpr(UINT8 *d, UINT8 *s, INT32 cnt) -{ - for (INT32 c=cnt-1; c>=0; c--) - for (INT32 y=15; y>=0; y--) { - d[(c * 256) + (y * 16) + 15] = s[0x00005 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 14] = s[0x00005 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 13] = s[0x00007 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 12] = s[0x00007 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 11] = s[0x00004 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 10] = s[0x00004 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 9] = s[0x00006 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 8] = s[0x00006 + (y * 8) + (c * 128)] & 0x0f; - - d[(c * 256) + (y * 16) + 7] = s[0x00001 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 6] = s[0x00001 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 5] = s[0x00003 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 4] = s[0x00003 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 3] = s[0x00000 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 2] = s[0x00000 + (y * 8) + (c * 128)] & 0x0f; - d[(c * 256) + (y * 16) + 1] = s[0x00002 + (y * 8) + (c * 128)] >> 4; - d[(c * 256) + (y * 16) + 0] = s[0x00002 + (y * 8) + (c * 128)] & 0x0f; - } -} - -static INT32 DrvDoReset() -{ - nAerofgtZ80Bank = -1; - - SekOpen(0); - //SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - aerofgtSndBankSwitch(0); - ZetClose(); - BurnYM2610Reset(); - - memset(RamGfxBank, 0 , sizeof(RamGfxBank)); - - spritepalettebank = 0; - charpalettebank = 0; - - nSoundlatch = 0; - bg1scrollx = 0; - bg2scrollx = 0; - bg1scrolly = 0; - bg2scrolly = 0; - - HiscoreReset(); - - return 0; -} - -static void aerofgt_sound_init() -{ - ZetInit(0); - ZetOpen(0); - ZetMapMemory(RomZ80, 0x0000, 0x77ff, MAP_ROM); - ZetMapMemory(RamZ80, 0x7800, 0x7fff, MAP_RAM); - ZetSetInHandler(aerofgtZ80PortRead); - ZetSetOutHandler(aerofgtZ80PortWrite); - ZetClose(); - - BurnYM2610Init(8000000, RomSnd2, &RomSndSize2, RomSnd1, &RomSndSize1, &aerofgtFMIRQHandler, aerofgtSynchroniseStream, aerofgtGetTime, 0); - BurnTimerAttachZet(5000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); -} - -static void turbofrc_sound_init() -{ - ZetInit(0); - ZetOpen(0); - ZetMapMemory(RomZ80, 0x0000, 0x77ff, MAP_ROM); - ZetMapMemory(RamZ80, 0x7800, 0x7fff, MAP_RAM); - ZetSetInHandler(turbofrcZ80PortRead); - ZetSetOutHandler(turbofrcZ80PortWrite); - ZetClose(); - - BurnYM2610Init(8000000, RomSnd2, &RomSndSize2, RomSnd1, &RomSndSize1, &aerofgtFMIRQHandler, aerofgtSynchroniseStream, aerofgtGetTime, 0); - BurnTimerAttachZet(5000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); -} - -static INT32 aerofgtInit() -{ - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); - MemIndex(); - - // Load the roms into memory - - // Load 68000 ROM - if (BurnLoadRom(Rom01, 0, 1)) { - return 1; - } - - // Load Graphic - BurnLoadRom(RomBg, 1, 1); - BurnLoadRom(RomBg+0x80000, 2, 1); - DecodeBg(); - - BurnLoadRom(RomSpr1+0x000000, 3, 1); - BurnLoadRom(RomSpr1+0x100000, 4, 1); - DecodeSpr(DeRomSpr1, RomSpr1, 8192+4096); - - // Load Z80 ROM - if (BurnLoadRom(RomZ80+0x10000, 5, 1)) return 1; - memcpy(RomZ80, RomZ80+0x10000, 0x10000); - - BurnLoadRom(RomSnd1, 6, 1); - BurnLoadRom(RomSnd2, 7, 1); - - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(RamPal, 0x1A0000, 0x1A07FF, MAP_ROM); // Palette - SekMapMemory((UINT8 *)RamRaster, 0x1B0000, 0x1B0FFF, MAP_RAM); // Raster / MRA_NOP / MRA_BANK7 - SekMapMemory((UINT8 *)RamBg1V, 0x1B2000, 0x1B3FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamBg2V, 0x1B4000, 0x1B5FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr1, 0x1C0000, 0x1C7FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr2, 0x1D0000, 0x1D1FFF, MAP_RAM); - SekMapMemory(Ram01, 0xFEF000, 0xFFEFFF, MAP_RAM); // 64K Work RAM -// SekSetReadWordHandler(0, aerofgtReadWord); - SekSetReadByteHandler(0, aerofgtReadByte); - SekSetWriteWordHandler(0, aerofgtWriteWord); - SekSetWriteByteHandler(0, aerofgtWriteByte); - SekClose(); - } - - aerofgt_sound_init(); - - pAssembleInputs = aerofgtAssembleInputs; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 turbofrcInit() -{ - Mem = NULL; - turbofrcMemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - turbofrcMemIndex(); - - // Load 68000 ROM - if (BurnLoadRom(Rom01+0x00000, 0, 1)) return 1; - if (BurnLoadRom(Rom01+0x40000, 1, 1)) return 1; - if (BurnLoadRom(Rom01+0x80000, 2, 1)) return 1; - - // Load Graphic - BurnLoadRom(RomBg+0x000000, 3, 1); - BurnLoadRom(RomBg+0x080000, 4, 1); - BurnLoadRom(RomBg+0x0A0000, 5, 1); - BurnLoadRom(RomBg+0x120000, 6, 1); - pspikesDecodeBg(0x14000); - - BurnLoadRom(RomSpr1+0x000000, 7, 2); - BurnLoadRom(RomSpr1+0x000001, 9, 2); - BurnLoadRom(RomSpr1+0x100000, 8, 2); - BurnLoadRom(RomSpr1+0x100001, 10, 2); - BurnLoadRom(RomSpr1+0x200000, 11, 2); - BurnLoadRom(RomSpr1+0x200001, 12, 2); - pspikesDecodeSpr(DeRomSpr1, RomSpr1, 0x6000); - - // Load Z80 ROM - if (BurnLoadRom(RomZ80+0x10000, 13, 1)) return 1; - memcpy(RomZ80, RomZ80+0x10000, 0x10000); - - BurnLoadRom(RomSnd1, 14, 1); - BurnLoadRom(RomSnd2, 15, 1); - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x0BFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x0C0000, 0x0CFFFF, MAP_RAM); // 64K Work RAM - SekMapMemory((UINT8 *)RamBg1V, 0x0D0000, 0x0D1FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamBg2V, 0x0D2000, 0x0D3FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr1, 0x0E0000, 0x0E3FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr2, 0x0E4000, 0x0E7FFF, MAP_RAM); - SekMapMemory(Ram01+0x10000, 0x0F8000, 0x0FBFFF, MAP_RAM); // Work RAM - SekMapMemory(Ram01+0x10000, 0xFF8000, 0xFFBFFF, MAP_RAM); // Work RAM - SekMapMemory((UINT8 *)RamSpr3, 0x0FC000, 0x0FC7FF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr3, 0xFFC000, 0xFFC7FF, MAP_RAM); - SekMapMemory((UINT8 *)RamRaster, 0x0FD000, 0x0FDFFF, MAP_RAM); - SekMapMemory((UINT8 *)RamRaster, 0xFFD000, 0xFFDFFF, MAP_RAM); - SekMapMemory(RamPal, 0x0FE000, 0x0FE7FF, MAP_ROM); // Palette -// SekSetReadWordHandler(0, turbofrcReadWord); - SekSetReadByteHandler(0, turbofrcReadByte); - SekSetWriteWordHandler(0, turbofrcWriteWord); - SekSetWriteByteHandler(0, turbofrcWriteByte); - SekClose(); - } - - turbofrc_sound_init(); - - pAssembleInputs = turbofrcAssembleInputs; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 karatblzInit() -{ - Mem = NULL; - karatblzMemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - karatblzMemIndex(); - - // Load 68000 ROM - if (BurnLoadRom(Rom01+0x00000, 0, 1)) return 1; - if (BurnLoadRom(Rom01+0x40000, 1, 1)) return 1; - - // Load Graphic - BurnLoadRom(RomBg+0x00000, 2, 1); - BurnLoadRom(RomBg+0x80000, 3, 1); - pspikesDecodeBg(0x10000); - - BurnLoadRom(RomSpr1+0x000000, 4, 2); - BurnLoadRom(RomSpr1+0x000001, 6, 2); - BurnLoadRom(RomSpr1+0x200000, 5, 2); - BurnLoadRom(RomSpr1+0x200001, 7, 2); - BurnLoadRom(RomSpr1+0x400000, 8, 2); - BurnLoadRom(RomSpr1+0x400001, 9, 2); - pspikesDecodeSpr(DeRomSpr1, RomSpr1, 0xA000); - - // Load Z80 ROM - if (BurnLoadRom(RomZ80+0x10000, 10, 1)) return 1; - memcpy(RomZ80, RomZ80+0x10000, 0x10000); - - BurnLoadRom(RomSnd1, 11, 1); - BurnLoadRom(RomSnd2, 12, 1); - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory((UINT8 *)RamBg1V, 0x080000, 0x081FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamBg2V, 0x082000, 0x083FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr1, 0x0A0000, 0x0AFFFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr2, 0x0B0000, 0x0BFFFF, MAP_RAM); - SekMapMemory(Ram01, 0x0C0000, 0x0CFFFF, MAP_RAM); // 64K Work RAM - SekMapMemory(Ram01+0x10000, 0x0F8000, 0x0FBFFF, MAP_RAM); // Work RAM - SekMapMemory(Ram01+0x10000, 0xFF8000, 0xFFBFFF, MAP_RAM); // Work RAM - SekMapMemory((UINT8 *)RamSpr3, 0x0FC000, 0x0FC7FF, MAP_RAM); - SekMapMemory(RamPal, 0x0FE000, 0x0FE7FF, MAP_ROM); // Palette -// SekSetReadWordHandler(0, karatblzReadWord); - SekSetReadByteHandler(0, karatblzReadByte); - SekSetWriteWordHandler(0, karatblzWriteWord); - SekSetWriteByteHandler(0, karatblzWriteByte); - SekClose(); - } - - turbofrc_sound_init(); - - pAssembleInputs = karatblzAssembleInputs; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 spinlbrkInit() -{ - Mem = NULL; - spinlbrkMemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - spinlbrkMemIndex(); - - // Load 68000 ROM - if (BurnLoadRom(Rom01+0x00001, 0, 2)) return 1; - if (BurnLoadRom(Rom01+0x00000, 1, 2)) return 1; - if (BurnLoadRom(Rom01+0x20001, 2, 2)) return 1; - if (BurnLoadRom(Rom01+0x20000, 3, 2)) return 1; - - // Load Graphic - BurnLoadRom(RomBg+0x000000, 4, 1); - BurnLoadRom(RomBg+0x080000, 5, 1); - BurnLoadRom(RomBg+0x100000, 6, 1); - BurnLoadRom(RomBg+0x180000, 7, 1); - BurnLoadRom(RomBg+0x200000, 8, 1); - pspikesDecodeBg(0x14000); - - BurnLoadRom(RomSpr1+0x000000, 9, 2); - BurnLoadRom(RomSpr1+0x000001, 10, 2); - BurnLoadRom(RomSpr1+0x100000, 11, 2); - BurnLoadRom(RomSpr1+0x100001, 13, 2); - BurnLoadRom(RomSpr1+0x200000, 12, 2); - BurnLoadRom(RomSpr1+0x200001, 14, 2); - pspikesDecodeSpr(DeRomSpr1, RomSpr1, 0x6000); - - BurnLoadRom((UINT8 *)RamSpr2+0x000001, 15, 2); - BurnLoadRom((UINT8 *)RamSpr2+0x000000, 16, 2); - - // Load Z80 ROM - if (BurnLoadRom(RomZ80+0x00000, 17, 1)) return 1; - if (BurnLoadRom(RomZ80+0x10000, 18, 1)) return 1; - - BurnLoadRom(RomSnd2+0x00000, 19, 1); - BurnLoadRom(RomSnd2+0x80000, 20, 1); - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x04FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory((UINT8 *)RamBg1V, 0x080000, 0x080FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamBg2V, 0x082000, 0x083FFF, MAP_RAM); - SekMapMemory(Ram01, 0xFF8000, 0xFFBFFF, MAP_RAM); // Work RAM - SekMapMemory((UINT8 *)RamSpr3, 0xFFC000, 0xFFC7FF, MAP_RAM); - SekMapMemory((UINT8 *)RamRaster, 0xFFD000, 0xFFD1FF, MAP_RAM); - SekMapMemory(RamPal, 0xFFE000, 0xFFE7FF, MAP_ROM); // Palette - SekSetReadWordHandler(0, spinlbrkReadWord); -// SekSetReadByteHandler(0, spinlbrkReadByte); - SekSetWriteWordHandler(0, spinlbrkWriteWord); - SekSetWriteByteHandler(0, spinlbrkWriteByte); - SekClose(); - } - - turbofrc_sound_init(); - - pAssembleInputs = aerofgtAssembleInputs; - - // Fix sprite glitches... - for (unsigned short i=0; i<0x2000;i++) - RamSpr1[i] = i; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 aerofgtbInit() -{ - Mem = NULL; - aerofgtbMemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); - aerofgtbMemIndex(); - - if (BurnLoadRom(Rom01 + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Rom01 + 0x00000, 1, 2)) return 1; - - BurnLoadRom(RomBg+0x00000, 2, 1); - BurnLoadRom(RomBg+0x80000, 3, 1); - pspikesDecodeBg(0x8000); - - BurnLoadRom(RomSpr1+0x000000, 4, 2); - BurnLoadRom(RomSpr1+0x000001, 5, 2); - BurnLoadRom(RomSpr1+0x100000, 6, 2); - BurnLoadRom(RomSpr1+0x100001, 7, 2); - aerofgtbDecodeSpr(DeRomSpr1, RomSpr1, 0x3000); - - if (BurnLoadRom(RomZ80+0x10000, 8, 1)) return 1; - memcpy(RomZ80, RomZ80+0x10000, 0x10000); - - BurnLoadRom(RomSnd1, 9, 1); - BurnLoadRom(RomSnd2, 10, 1); - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x0C0000, 0x0CFFFF, MAP_RAM); // 64K Work RAM - SekMapMemory((UINT8 *)RamBg1V, 0x0D0000, 0x0D1FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamBg2V, 0x0D2000, 0x0D3FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr1, 0x0E0000, 0x0E3FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr2, 0x0E4000, 0x0E7FFF, MAP_RAM); - SekMapMemory(Ram01+0x10000, 0x0F8000, 0x0FBFFF, MAP_RAM); // Work RAM - SekMapMemory((UINT8 *)RamSpr3, 0x0FC000, 0x0FC7FF, MAP_RAM); - SekMapMemory(RamPal, 0x0FD000, 0x0FD7FF, MAP_ROM); // Palette - SekMapMemory((UINT8 *)RamRaster, 0x0FF000, 0x0FFFFF, MAP_RAM); // Raster - SekSetReadWordHandler(0, aerofgtbReadWord); - SekSetReadByteHandler(0, aerofgtbReadByte); - SekSetWriteWordHandler(0, aerofgtbWriteWord); - SekSetWriteByteHandler(0, aerofgtbWriteByte); - SekClose(); - } - - aerofgt_sound_init(); - - pAssembleInputs = aerofgtAssembleInputs; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 pspikesInit() -{ - Mem = NULL; - pspikesMemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); - pspikesMemIndex(); - - if (BurnLoadRom(Rom01 + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(RomZ80+0x10000, 1, 1)) return 1; - memcpy(RomZ80, RomZ80+0x10000, 0x10000); - - BurnLoadRom(RomBg+0x00000, 2, 1); - pspikesDecodeBg(0x4000); - - BurnLoadRom(RomSpr1+0x000000, 3, 2); - BurnLoadRom(RomSpr1+0x000001, 4, 2); - pspikesDecodeSpr(DeRomSpr1, RomSpr1, 0x2000); - - BurnLoadRom(RomSnd1, 5, 1); - BurnLoadRom(RomSnd2, 6, 1); - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x03FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); // 64K Work RAM - SekMapMemory((UINT8 *)RamSpr1, 0x200000, 0x203FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamBg1V, 0xFF8000, 0xFF8FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr3, 0xFFC000, 0xFFC7FF, MAP_RAM); - SekMapMemory((UINT8 *)RamRaster, 0xFFD000, 0xFFDFFF, MAP_RAM); // Raster - SekMapMemory(RamPal, 0xFFE000, 0xFFEFFF, MAP_ROM); // Palette - // SekSetReadWordHandler(0, pspikesReadWord); - SekSetReadByteHandler(0, pspikesReadByte); - SekSetWriteWordHandler(0, pspikesWriteWord); - SekSetWriteByteHandler(0, pspikesWriteByte); - SekClose(); - } - - turbofrc_sound_init(); - - pAssembleInputs = turbofrcAssembleInputs; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2610Exit(); - - ZetExit(); - SekExit(); - - BurnFree(Mem); - - return 0; -} - - - -static void aerofgt_drawsprites(INT32 priority) -{ - priority <<= 12; - INT32 offs = 0; - - while (offs < 0x0400 && (BURN_ENDIAN_SWAP_INT16(RamSpr2[offs]) & 0x8000) == 0) { - INT32 attr_start = (BURN_ENDIAN_SWAP_INT16(RamSpr2[offs]) & 0x03ff) * 4; - - if ((BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 2]) & 0x3000) == priority) { - INT32 map_start; - INT32 ox,oy,x,y,xsize,ysize,zoomx,zoomy,flipx,flipy,color; - - ox = BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 1]) & 0x01ff; - xsize = (BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 1]) & 0x0e00) >> 9; - zoomx = (BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 1]) & 0xf000) >> 12; - oy = BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 0]) & 0x01ff; - ysize = (BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 0]) & 0x0e00) >> 9; - zoomy = (BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 0]) & 0xf000) >> 12; - flipx = BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 2]) & 0x4000; - flipy = BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 2]) & 0x8000; - color = (BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 2]) & 0x0f00) >> 4; - map_start = BURN_ENDIAN_SWAP_INT16(RamSpr2[attr_start + 3]) & 0x3fff; - INT32 bank = map_start & 0x2000; - - ox += (xsize*zoomx+2)/4; - oy += (ysize*zoomy+2)/4; - - zoomx = 32 - zoomx; - zoomy = 32 - zoomy; - - UINT8 *gfxbase; - - if (bank) { - gfxbase = DeRomSpr2; - color += 768; - } else { - gfxbase = DeRomSpr1; - color += 512; - } - - for (y = 0;y <= ysize;y++) { - INT32 sx,sy; - - if (flipy) sy = ((oy + zoomy * (ysize - y)/2 + 16) & 0x1ff) - 16; - else sy = ((oy + zoomy * y / 2 + 16) & 0x1ff) - 16; - - for (x = 0;x <= xsize;x++) { - if (flipx) sx = ((ox + zoomx * (xsize - x) / 2 + 16) & 0x1ff) - 16; - else sx = ((ox + zoomx * x / 2 + 16) & 0x1ff) - 16; - - INT32 code = BURN_ENDIAN_SWAP_INT16(RamSpr1[map_start]) & 0x1fff; - - RenderZoomedTile(pTransDraw, gfxbase, code, color, 0xf, sx, sy, flipx, flipy, 16, 16, zoomx<<11, zoomy<<11); - - map_start++; - } - } - } - offs++; - } -} - -void RenderZoomedTilePrio(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, UINT8 *pri, INT32 prio, INT32 /*turbofrc_layer*/) -{ - // Based on MAME sources for tile zooming - UINT8 *gfx_base = gfx + (code * width * height); - int dh = (zoomy * height + 0x8000) / 0x10000; - int dw = (zoomx * width + 0x8000) / 0x10000; - - if (dw && dh) - { - int dx = (width * 0x10000) / dw; - int dy = (height * 0x10000) / dh; - int ex = sx + dw; - int ey = sy + dh; - int x_index_base = 0; - int y_index = 0; - - if (fx) { - x_index_base = (dw - 1) * dx; - dx = -dx; - } - - if (fy) { - y_index = (dh - 1) * dy; - dy = -dy; - } - - for (INT32 y = sy; y < ey; y++) - { - UINT8 *src = gfx_base + (y_index / 0x10000) * width; - UINT16 *dst = dest + y * nScreenWidth; - - if (y >= 0 && y < nScreenHeight) - { - for (INT32 x = sx, x_index = x_index_base; x < ex; x++) - { - if (x >= 0 && x < nScreenWidth) { - INT32 pxl = src[x_index>>16]; - - // new! - if ((prio & (1 << pri[y * nScreenWidth + x])) == 0/* && pri[y * nScreenWidth + x] < 0x80 */) { - if (pxl != t) { - dst[x] = pxl + color; - } - } - // !new - } - - x_index += dx; - } - } - - y_index += dy; - } - } -} - -static void turbofrc_drawsprites(INT32 chip, INT32 turbofrc_layer, INT32 paloffset, INT32 chip_disabled_pri) -{ - INT32 attr_start,base,first; - - base = chip * 0x0200; - first = 4 * BURN_ENDIAN_SWAP_INT16(RamSpr3[0x1fe + base]); - - //for (attr_start = base + 0x0200-8;attr_start >= first + base;attr_start -= 4) { - for (attr_start = first + base; attr_start <= base + 0x0200-8; attr_start += 4) { - INT32 map_start; - INT32 ox,oy,x,y,xsize,ysize,zoomx,zoomy,flipx,flipy,color,pri; - - if (!(BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 2]) & 0x0080)) continue; - pri = BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 2]) & 0x0010; - if ( chip_disabled_pri & !pri) continue; - if ((!chip_disabled_pri) & (pri>>4)) continue; - ox = BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 1]) & 0x01ff; - xsize = (BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 2]) & 0x0700) >> 8; - zoomx = (BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 1]) & 0xf000) >> 12; - oy = BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 0]) & 0x01ff; - ysize = (BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 2]) & 0x7000) >> 12; - zoomy = (BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 0]) & 0xf000) >> 12; - flipx = BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 2]) & 0x0800; - flipy = BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 2]) & 0x8000; - color = ((BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 2]) & 0x000f) + (spritepalettebank*16)) * 16; - color += paloffset; - - map_start = BURN_ENDIAN_SWAP_INT16(RamSpr3[attr_start + 3]); - - UINT8 *gfxbase; - if (chip) { - gfxbase = DeRomSpr2; - } else { - gfxbase = DeRomSpr1; - } - - zoomx = 32 - zoomx; - zoomy = 32 - zoomy; - - for (y = 0;y <= ysize;y++) { - INT32 sx,sy; - - if (flipy) sy = ((oy + zoomy * (ysize - y)/2 + 16) & 0x1ff) - 16; - else sy = ((oy + zoomy * y / 2 + 16) & 0x1ff) - 16; - - for (x = 0;x <= xsize;x++) { - INT32 code; - - if (flipx) sx = ((ox + zoomx * (xsize - x) / 2 + 16) & 0x1ff) - 16 - 8; - else sx = ((ox + zoomx * x / 2 + 16) & 0x1ff) - 16 - 8; - - if (chip == 0) code = BURN_ENDIAN_SWAP_INT16(RamSpr1[map_start & RamSpr1SizeMask]) & RomSpr1SizeMask; - else code = BURN_ENDIAN_SWAP_INT16(RamSpr2[map_start & RamSpr2SizeMask]) & RomSpr2SizeMask; - - if (turbofrc_layer) - RenderZoomedTilePrio(pTransDraw, gfxbase, code, color, 0xf, sx, sy, flipx, flipy, 16, 16, zoomx<<11, zoomy<<11, RamPrioBitmap, (pri) ? 0 : 2, turbofrc_layer); - else - RenderZoomedTile(pTransDraw, gfxbase, code, color, 0xf, sx, sy, flipx, flipy, 16, 16, zoomx<<11, zoomy<<11); - - - map_start++; - } - - if (xsize == 2) map_start += 1; - if (xsize == 4) map_start += 3; - if (xsize == 5) map_start += 2; - if (xsize == 6) map_start += 1; - } - } -} - -static void RenderTilePrio(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 trans_col, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, UINT8 *pribmp, UINT8 prio) -{ - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - if (pxl == trans_col) continue; - - pribmp[sy * nScreenWidth + sx] = prio; - dest[sy * nScreenWidth + sx] = pxl | color; - } - - sx -= width; - } -} - -static void TileBackgroundPrio(UINT16 *bgram, UINT8 *gfx, INT32 transp, UINT16 pal, INT32 scrollx, INT32 scrolly, UINT8 *bankbase) -{ - scrollx &= 0x1ff; - scrolly &= 0x1ff; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(bgram[offs]); - INT32 code = (attr & 0x07FF) + ((bankbase[((attr & 0x1800) >> 11)] & 0xf) << 11); - INT32 color = attr >> 13; - - if (transp) { // only this layer does prio - RenderTilePrio(pTransDraw, gfx, code, (color << 4) | pal, 0x0f, sx, sy, 0, 0, 8, 8, RamPrioBitmap, 1); - } else { - if (sx >= 0 && sx < (nScreenWidth - 7) && sy >= 0 && sy < (nScreenHeight - 7)) { - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, pal, gfx); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, pal, gfx); - } - } - } -} - -static void TileBackground(UINT16 *bgram, UINT8 *gfx, INT32 transp, UINT16 pal, INT32 scrollx, INT32 scrolly, UINT8 *bankbase) -{ - scrollx &= 0x1ff; - scrolly &= 0x1ff; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(bgram[offs]); - INT32 code = (attr & 0x07FF) + ((bankbase[((attr & 0x1800) >> 11)] & 0xf) << 11); - INT32 color = attr >> 13; - - if (transp) { - if (sx >= 0 && sx < (nScreenWidth - 7) && sy >= 0 && sy < (nScreenHeight - 7)) { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0x0f, pal, gfx); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, pal, gfx); - } - } else { - if (sx >= 0 && sx < (nScreenWidth - 7) && sy >= 0 && sy < (nScreenHeight - 7)) { - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, pal, gfx); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, pal, gfx); - } - } - } -} - -static void karatblzTileBackground(UINT16 *bgram, UINT8 *gfx, INT32 transp, UINT16 pal, INT32 scrollx, INT32 scrolly, UINT8 bankbase) -{ - scrollx &= 0x1ff; - scrolly &= 0x1ff; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(bgram[offs]); - INT32 code = (attr & 0x1fff) + (bankbase << 13); - INT32 color = attr >> 13; - - if (transp) { - if (sx >= 0 && sx < (nScreenWidth - 7) && sy >= 0 && sy < (nScreenHeight - 7)) { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0x0f, pal, gfx); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, pal, gfx); - } - } else { - if (sx >= 0 && sx < (nScreenWidth - 7) && sy >= 0 && sy < (nScreenHeight - 7)) { - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, pal, gfx); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, pal, gfx); - } - } - } -} - -static void spinlbrkTileBackground() -{ - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= BURN_ENDIAN_SWAP_INT16(RamRaster[sy]) & 0x1ff; - if (sx < -7) sx += 512; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(RamBg1V[offs]); - INT32 code = (attr & 0x0fff) + ((RamGfxBank[0] & 0x0f) << 12); - INT32 color = attr >> 12; - - if (sx >= nScreenWidth) continue; - if (sy >= nScreenHeight) break; - - if (sx >= 0 && sx < (nScreenWidth - 7) && sy >= 0 && sy < (nScreenHeight - 7)) { - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, 0, DeRomBg); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DeRomBg); - } - } -} - -static void pspikesTileBackground() -{ - INT32 scrolly = bg1scrolly + 2; - - for (INT32 sy = 0; sy < nScreenHeight; sy++) - { - UINT16 *dst = pTransDraw + sy * nScreenWidth; - - for (INT32 sx = 0; sx < nScreenWidth + 8; sx++) - { - INT32 yy = (sy + scrolly) & 0xff; - INT32 xx = (sx + BURN_ENDIAN_SWAP_INT16(RamRaster[yy])) & 0x1ff; - - INT32 offs = ((yy/8)*64) + (xx/8); - - INT32 attr = BURN_ENDIAN_SWAP_INT16(RamBg1V[offs]); - INT32 code = (attr & 0x0FFF) + ((RamGfxBank[((attr & 0x1000) >> 12)] & 0xf) << 12); - INT32 color = (((attr >> 13) + (charpalettebank * 8)) * 16); - - { - xx = sx - (xx & 7); - UINT8 *rom = DeRomBg + (code * 0x40) + ((yy&7) * 8); - - for (INT32 x = 0; x < 8; x++, xx++) { - if (xx >= 0 && xx < nScreenWidth) { - dst[xx] = rom[x] + color; - } - } - } - } - } -} - -static inline void DrvRecalcPalette() -{ - UINT16* ps = (UINT16*) RamPal; - UINT32* pd = RamCurPal; - for (INT32 i=0; i> 5) & 0x1f; - g = (d >> 10) & 0x1f; - b = (d >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i / 2] = BurnHighCol(r, g, b, 0); - } -} - -static void airbustr_bankswitch(UINT8 *rom, INT32 data) -{ - ZetMapArea(0x8000, 0xbfff, 0, rom + 0x4000 * (data & 0x07)); - ZetMapArea(0x8000, 0xbfff, 2, rom + 0x4000 * (data & 0x07)); -} - -void __fastcall airbustr_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xc000) { // pandora - - DrvSprRAM[address & 0xfff] = data; - - address = (address & 0x800) | ((address & 0xff) << 3) | ((address & 0x700) >> 8); - - DrvPandoraRAM[address] = data; - - return; - } -} - -UINT8 __fastcall airbustr_main_read(UINT16 address) -{ - if ((address & 0xf000) == 0xe000) { - - INT32 offset = address & 0xfff; - switch (offset) - { - case 0xfe0: - watchdog = 180; - return 0; - - case 0xff2: - case 0xff3: - { - INT32 r = (DrvDevRAM[0xff0] + DrvDevRAM[0xff1] * 256) * (DrvDevRAM[0xff2] + DrvDevRAM[0xff3] * 256); - - if (offset & 1) return r >> 8; - return r; - } - - case 0xff4: - return BurnRandom(); - } - - return DrvDevRAM[offset]; - } - - return 0; -} - -void __fastcall airbustr_main_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - airbustr_bankswitch(DrvZ80ROM0, data); - return; - - case 0x01: - return; // nop - - case 0x02: - { - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - } - return; - } -} - -void __fastcall airbustr_sub_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - { - airbustr_bankswitch(DrvZ80ROM1, data); - - *flipscreen = data & 0x10; - - pandora_set_clear(data & 0x20); - } - return; - - case 0x02: // soundcommand_w - { - *soundlatch = data; - *sound_status = 1; - ZetClose(); - ZetOpen(2); - ZetNmi(); - ZetClose(); - ZetOpen(1); - } - return; - - case 0x04: - case 0x06: - case 0x08: - case 0x0a: - case 0x0c: - DrvScrollRegs[((port & 0x0f) - 0x04) / 2] = data; - return; - - case 0x28: - *coin_lockout = ~data & 0x0c; - // coINT32 counter also (0x03) - return; - - case 0x38: - return; // nop - } -} - -UINT8 __fastcall airbustr_sub_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x02: - *sound_status2 = 0; - return *soundlatch2; - - case 0x0e: - return (4 + *sound_status * 2 + (1 - *sound_status2)); - - case 0x20: - return DrvInputs[0]; - - case 0x22: - return DrvInputs[1]; - - case 0x24: - return DrvInputs[2] | *coin_lockout; - } - - return 0; -} - -void __fastcall airbustr_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - airbustr_bankswitch(DrvZ80ROM2, data); - return; - - case 0x02: - BurnYM2203Write(0, 0, data); - return; - - case 0x03: - BurnYM2203Write(0, 1, data); - return; - - case 0x04: - MSM6295Command(0, data); - return; - - case 0x06: - *soundlatch2 = data; - *sound_status2 = 1; - return; - } -} - -UINT8 __fastcall airbustr_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x02: - return BurnYM2203Read(0, 0); - - case 0x03: - return BurnYM2203Read(0, 1); - - case 0x04: - return MSM6295ReadStatus(0); - - case 0x06: - *sound_status = 0; - return *soundlatch; - } - - return 0; -} - -static UINT8 DrvYM2203PortA(UINT32) -{ - return DrvDips[0]; -} - -static UINT8 DrvYM2203PortB(UINT32) -{ - return DrvDips[1]; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 6000000; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - -// UINT8 *rom[3] = { DrvZ80ROM0, DrvZ80ROM1, DrvZ80ROM2 }; - - for (INT32 i = 0; i < 3; i++) { - ZetOpen(i); - ZetReset(); -// if (full_reset) airbustr_bankswitch(rom[i], 2); - ZetClose(); - } - - MSM6295Reset(0); - ZetOpen(2); - BurnYM2203Reset(); - ZetClose(); - - interrupt_vectors[0] = 0xff; - interrupt_vectors[1] = 0xfd; - - watchdog = 180; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x020000; - DrvZ80ROM2 = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x400000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM0 = Next; Next += 0x000800; - DrvVidRAM1 = Next; Next += 0x000800; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x001000; - DrvZ80RAM2 = Next; Next += 0x002000; - - DrvShareRAM = Next; Next += 0x001000; - DrvDevRAM = Next; Next += 0x001000; - - DrvPandoraRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x001000; - - DrvScrollRegs = Next; Next += 0x000006; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - sound_status = Next; Next += 0x000001; - sound_status2 = Next; Next += 0x000001; - - coin_lockout = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - static INT32 Plane[4] = { 0, 1, 2, 3 }; - static INT32 XOffs[16] = { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, - 0*4+32*8, 1*4+32*8, 2*4+32*8, 3*4+32*8, 4*4+32*8, 5*4+32*8, 6*4+32*8, 7*4+32*8 }; - static INT32 YOffs[16] = { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, - 0*32+64*8, 1*32+64*8, 2*32+64*8, 3*32+64*8, 4*32+64*8, 5*32+64*8, 6*32+64*8, 7*32+64*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x080000; i++) { - tmp[i] = (DrvGfxROM0[i] << 4) | (DrvGfxROM0[i] >> 4); - } - - GfxDecode(0x1000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static tilemap_callback( airbustr0 ) -{ - INT32 attr = DrvVidRAM0[offs + 0x400]; - - TILE_SET_INFO(0, DrvVidRAM0[offs] + ((attr & 0x0f) << 8), (attr >> 4) + 0x10, 0); -} - -static tilemap_callback( airbustr1 ) -{ - INT32 attr = DrvVidRAM1[offs + 0x400]; - - TILE_SET_INFO(0, DrvVidRAM1[offs] + ((attr & 0x0f) << 8), (attr >> 4), 0); -} - -static INT32 DrvInit() -{ - is_bootleg = BurnDrvGetFlags() & BDF_BOOTLEG; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x000000, 2, 1)) return 1; - - if (is_bootleg) - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040001, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 12, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x020000, 13, 1)) return 1; - } - else - { - // mcu... - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 7, 1)) return 1; - } - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0xc000, 0xcfff, 0, DrvSprRAM); -// ZetMapArea(0xc000, 0xcfff, 1, DrvSprRAM); // handler - ZetMapArea(0xc000, 0xcfff, 2, DrvSprRAM); - ZetMapArea(0xd000, 0xdfff, 0, DrvZ80RAM0); - ZetMapArea(0xd000, 0xdfff, 1, DrvZ80RAM0); - ZetMapArea(0xd000, 0xdfff, 2, DrvZ80RAM0); - if (is_bootleg) ZetMapArea(0xe000, 0xefff, 0, DrvDevRAM); - ZetMapArea(0xe000, 0xefff, 1, DrvDevRAM); - ZetMapArea(0xe000, 0xefff, 2, DrvDevRAM); - ZetMapArea(0xf000, 0xffff, 0, DrvShareRAM); - ZetMapArea(0xf000, 0xffff, 1, DrvShareRAM); - ZetMapArea(0xf000, 0xffff, 2, DrvShareRAM); - ZetSetWriteHandler(airbustr_main_write); - ZetSetReadHandler(airbustr_main_read); - ZetSetOutHandler(airbustr_main_out); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0xc000, 0xc7ff, 0, DrvVidRAM1); - ZetMapArea(0xc000, 0xc7ff, 1, DrvVidRAM1); - ZetMapArea(0xc000, 0xc7ff, 2, DrvVidRAM1); - ZetMapArea(0xc800, 0xcfff, 0, DrvVidRAM0); - ZetMapArea(0xc800, 0xcfff, 1, DrvVidRAM0); - ZetMapArea(0xc800, 0xcfff, 2, DrvVidRAM0); - ZetMapArea(0xd000, 0xdfff, 0, DrvPalRAM); - ZetMapArea(0xd000, 0xdfff, 1, DrvPalRAM); - ZetMapArea(0xd000, 0xdfff, 2, DrvPalRAM); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80RAM1); - ZetMapArea(0xe000, 0xefff, 1, DrvZ80RAM1); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80RAM1); - ZetMapArea(0xf000, 0xffff, 0, DrvShareRAM); - ZetMapArea(0xf000, 0xffff, 1, DrvShareRAM); - ZetMapArea(0xf000, 0xffff, 2, DrvShareRAM); - ZetSetOutHandler(airbustr_sub_out); - ZetSetInHandler(airbustr_sub_in); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM2); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM2); - ZetMapArea(0xc000, 0xdfff, 0, DrvZ80RAM2); - ZetMapArea(0xc000, 0xdfff, 1, DrvZ80RAM2); - ZetMapArea(0xc000, 0xdfff, 2, DrvZ80RAM2); - ZetSetOutHandler(airbustr_sound_out); - ZetSetInHandler(airbustr_sound_in); - ZetClose(); - - BurnYM2203Init(1, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, &DrvYM2203PortA, &DrvYM2203PortB, NULL, NULL); - BurnTimerAttachZet(6000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.25, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 3000000 / 132, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - pandora_init(DrvPandoraRAM, DrvGfxROM1, (0x400000/0x100)-1, 0x200, 0, -16); - - GenericTilemapInit(0, scan_rows_map_scan, airbustr0_map_callback, 16, 16, 32, 32); - GenericTilemapInit(1, scan_rows_map_scan, airbustr1_map_callback, 16, 16, 32, 32); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetGfx(0, DrvGfxROM0, 4, 16, 16, 0x100000, 0, 0x1f); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - pandora_exit(); - - GenericTilesExit(); - - ZetExit(); - MSM6295Exit(0); - - BurnYM2203Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void draw_layer(INT32 layer, INT32 r0, INT32 r1, INT32 r2, INT32 r3) -{ - INT32 scrollx = DrvScrollRegs[r0] + ((~DrvScrollRegs[4] << r1) & 0x100); - INT32 scrolly = DrvScrollRegs[r2] + ((~DrvScrollRegs[4] << r3) & 0x100) + 16; - - if (*flipscreen) { - scrollx = (scrollx + 0x06a) & 0x1ff; - scrolly = (scrolly + 0x1ff) & 0x1ff; - } else { - scrollx = (scrollx - 0x094) & 0x1ff; - scrolly = (scrolly - 0x100) & 0x1ff; - } - - GenericTilemapSetFlip(layer, (*flipscreen) ? TMAP_FLIPXY : 0); - GenericTilemapSetScrollX(layer, scrollx); - GenericTilemapSetScrollY(layer, scrolly); - GenericTilemapDraw(layer, pTransDraw, 0); -} - -static INT32 DrvDraw() -{ - DrvRecalcPalette(); - - draw_layer(0, 3, 6, 2, 5); - draw_layer(1, 1, 8, 0, 7); - - pandora_flipscreen = *flipscreen; - pandora_update(pTransDraw); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(1); - } - - if (watchdog == 0 && is_bootleg == 0) { - DrvDoReset(0); - } - watchdog--; - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[3] = { 6000000 * 2 / 60, 6000000 * 2 / 60, 6000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - - INT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment - nCyclesDone[0]); - if (i == 49 || i == 99) { - interrupt_vectors[0] ^= 2; - ZetSetVector(interrupt_vectors[0]); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]); - if (i == 49 || i == 99) { - interrupt_vectors[1] ^= 2; - ZetSetVector(interrupt_vectors[1]); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - ZetClose(); - - ZetOpen(2); - BurnTimerUpdate(nCyclesDone[1] /*sync with sub cpu*/); - if (i == 99) { - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - ZetClose(); - } - - ZetOpen(2); - - BurnTimerEndFrame(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - pandora_buffer_sprites(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - SCAN_VAR(interrupt_vectors); - - BurnRandomScan(nAction); - } - - return 0; -} - - -// Air Buster: Trouble Specialty Raid Unit (World) - -static struct BurnRomInfo airbustrRomDesc[] = { - { "pr12.h19", 0x20000, 0x91362eb2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "pr13.l15", 0x20000, 0x13b2257b, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "pr-21.bin", 0x20000, 0x6e0a5df0, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "i80c51", 0x01000, 0x00000000, 4 | BRF_NODUMP }, // 3 80c51 MCU - - { "pr-000.bin", 0x80000, 0x8ca68f0d, 5 | BRF_GRA }, // 4 Tiles - - { "pr-001.bin", 0x80000, 0x7e6cb377, 6 | BRF_GRA }, // 5 Sprites - { "pr-02.bin", 0x10000, 0x6bbd5e46, 6 | BRF_GRA }, // 6 - - { "pr-200.bin", 0x40000, 0xa4dd3390, 7 | BRF_SND }, // 7 OKI M6295 -}; - -STD_ROM_PICK(airbustr) -STD_ROM_FN(airbustr) - -struct BurnDriver BurnDrvAirbustr = { - "airbustr", NULL, NULL, NULL, "1990", - "Air Buster: Trouble Specialty Raid Unit (World)\0", NULL, "Kaneko (Namco license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO_MISC, GBF_MISC, 0, - NULL, airbustrRomInfo, airbustrRomName, NULL, NULL, AirbustrInputInfo, AirbustrDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x0300, - 256, 224, 4, 3 -}; - - -// Air Buster: Trouble Specialty Raid Unit (Japan) - -static struct BurnRomInfo airbustrjRomDesc[] = { - { "pr-14j.bin", 0x20000, 0x6b9805bd, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "pr-11j.bin", 0x20000, 0x85464124, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "pr-21.bin", 0x20000, 0x6e0a5df0, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "i80c51", 0x01000, 0x00000000, 4 | BRF_NODUMP }, // 3 80c51 MCU - - { "pr-000.bin", 0x80000, 0x8ca68f0d, 5 | BRF_GRA }, // 4 Tiles - - { "pr-001.bin", 0x80000, 0x7e6cb377, 6 | BRF_GRA }, // 5 Sprites - { "pr-02.bin", 0x10000, 0x6bbd5e46, 6 | BRF_GRA }, // 6 - - { "pr-200.bin", 0x40000, 0xa4dd3390, 7 | BRF_SND }, // 7 OKI M6295 -}; - -STD_ROM_PICK(airbustrj) -STD_ROM_FN(airbustrj) - -struct BurnDriver BurnDrvAirbustrj = { - "airbustrj", "airbustr", NULL, NULL, "1990", - "Air Buster: Trouble Specialty Raid Unit (Japan)\0", NULL, "Kaneko (Namco license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO_MISC, GBF_MISC, 0, - NULL, airbustrjRomInfo, airbustrjRomName, NULL, NULL, AirbustrInputInfo, AirbustjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x0300, - 256, 224, 4, 3 -}; - - -// Air Buster: Trouble Specialty Raid Unit (bootleg) - -static struct BurnRomInfo airbustrbRomDesc[] = { - { "5.bin", 0x20000, 0x9e4216a2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "1.bin", 0x20000, 0x85464124, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "2.bin", 0x20000, 0x6e0a5df0, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "7.bin", 0x20000, 0x2e3bf0a2, 4 | BRF_GRA }, // 3 Tiles - { "9.bin", 0x20000, 0x2c23c646, 4 | BRF_GRA }, // 4 - { "6.bin", 0x20000, 0x0d6cd470, 4 | BRF_GRA }, // 5 - { "8.bin", 0x20000, 0xb3372e51, 4 | BRF_GRA }, // 6 - - { "13.bin", 0x20000, 0x75dee86d, 5 | BRF_GRA }, // 7 Sprites - { "12.bin", 0x20000, 0xc98a8333, 5 | BRF_GRA }, // 8 - { "11.bin", 0x20000, 0x4e9baebd, 5 | BRF_GRA }, // 9 - { "10.bin", 0x20000, 0x63dc8cd8, 5 | BRF_GRA }, // 10 - { "14.bin", 0x10000, 0x6bbd5e46, 5 | BRF_GRA }, // 11 - - { "4.bin", 0x20000, 0x21d9bfe3, 6 | BRF_SND }, // 12 OKI M6295 - { "3.bin", 0x20000, 0x58cd19e2, 6 | BRF_SND }, // 13 -}; - -STD_ROM_PICK(airbustrb) -STD_ROM_FN(airbustrb) - -struct BurnDriver BurnDrvAirbustrb = { - "airbustrb", "airbustr", NULL, NULL, "1990", - "Air Buster: Trouble Specialty Raid Unit (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_KANEKO_MISC, GBF_MISC, 0, - NULL, airbustrbRomInfo, airbustrbRomName, NULL, NULL, AirbustrInputInfo, AirbustjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x0300, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_aquarium.cpp b/jan/src/burn/drv/pst90s/d_aquarium.cpp deleted file mode 100644 index c90d1b415..000000000 --- a/jan/src/burn/drv/pst90s/d_aquarium.cpp +++ /dev/null @@ -1,803 +0,0 @@ -// FB Alpha Aquarium driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80Bank; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvPalRAM; -static UINT8 *DrvMidRAM; -static UINT8 *DrvBakRAM; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvSprRAM; -static UINT16 *DrvScroll; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static UINT8 *soundlatch; -static UINT8 *soundack; -static UINT8 *flipscreen; - -static struct BurnInputInfo AquariumInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 15, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 8, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 9, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 10, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 11, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Aquarium) - -static struct BurnDIPInfo AquariumDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 3, "Winning Rounds (Player VS CPU)" }, - {0x12, 0x01, 0x0c, 0x0c, "1/1" }, - {0x12, 0x01, 0x0c, 0x08, "2/3" }, - {0x12, 0x01, 0x0c, 0x04, "3/5" }, - - {0 , 0xfe, 0 , 3, "Winning Rounds (Player VS Player)" }, - {0x12, 0x01, 0x30, 0x30, "1/1" }, - {0x12, 0x01, 0x30, 0x20, "2/3" }, - {0x12, 0x01, 0x30, 0x10, "3/5" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0x07, 0x00, "5 Coins 1 Credits " }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits " }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits " }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits " }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits " }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits " }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x14, 0x01, 0xff, 0x00, "Japanese" }, - {0x14, 0x01, 0xff, 0xff, "English" }, -}; - -STDDIPINFO(Aquarium) - -UINT8 __fastcall aquarium_read_byte(UINT32 address) -{ - switch (address) - { - case 0xd80080: - return DrvDips[1]; - - case 0xd80081: - return DrvDips[0]; - - case 0xd80086: - { - INT32 data = DrvInputs[1] | *soundack; - *soundack = 0; - return data; - } - } - - return 0; -} - -UINT16 __fastcall aquarium_read_word(UINT32 address) -{ - switch (address) - { - case 0xd80084: - return DrvInputs[0]; - } - - return 0; -} - -void __fastcall aquarium_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xd8008b: - *soundlatch = data; - ZetNmi(); - return; - } -} - -void __fastcall aquarium_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0xd80014: - case 0xd80016: - case 0xd80018: - case 0xd8001a: - case 0xd8001c: - case 0xd8001e: - DrvScroll[(address - 0xd80014)/2] = data; - return; - - case 0xd80056: - *flipscreen = ~data & 1; // seems right? - return; - } -} - -static void sound_bankswitch(INT32 nBank) -{ - *DrvZ80Bank = nBank & 7; - - nBank = ((nBank & 7) + 1) * 0x8000; - - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + nBank); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + nBank); -} - -void __fastcall aquarium_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM2151SelectRegister(data); - return; - - case 0x01: - BurnYM2151WriteRegister(data); - return; - - case 0x02: - MSM6295Command(0, BITSWAP08(data, 0, 1, 2, 3, 4, 5, 6, 7)); - return; - - case 0x06: - *soundack = 0x80; - return; - - case 0x08: - sound_bankswitch(data); - return; - } -} - -UINT8 __fastcall aquarium_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x01: - return BurnYM2151ReadStatus(); - - case 0x02: - return BITSWAP08(MSM6295ReadStatus(0), 0, 1, 2, 3, 4, 5, 6, 7); - - case 0x04: - return *soundlatch; - } - - return 0; -} - -void aquariumYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - Drv68KROM[0x000a5c] = DrvDips[2]; // set region (hack) - Drv68KROM[0x000a5d] = DrvDips[2]; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[5] = { 0x400000, 0, 1, 2, 3 }; - INT32 Plane2[4] = { 48, 16, 32, 0 }; - INT32 XOffs0[16] = { 8, 12, 0, 4, 24, 28, 16, 20, 40, 44, 32, 36, 56, 60, 48, 52 }; - INT32 XOffs2[16] = { 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs0[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; - INT32 YOffs1[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x100000); - - GfxDecode(0x1000, 5, 16, 16, Plane0 , XOffs0, YOffs0, 0x400, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x020000); - - GfxDecode(0x1000, 4, 8, 8, Plane0 + 1, XOffs0, YOffs1, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane2 , XOffs2, YOffs0, 0x400, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x100000); - - GfxDecode(0x1000, 5, 16, 16, Plane0 , XOffs0, YOffs0, 0x400, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x040000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x040000; - DrvGfxROM2 = Next; Next += 0x200000; - DrvGfxROM3 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x001000; - DrvMidRAM = Next; Next += 0x001000; - DrvBakRAM = Next; Next += 0x001000; - DrvTxtRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x002000; - - DrvZ80RAM = Next; Next += 0x000800; - - soundack = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - DrvZ80Bank = Next; Next += 0x000001; - - DrvScroll = (UINT16*)Next; Next += 0x000008 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvLoad5bpp(UINT8 *gfx, INT32 num) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return 1; - } - - if (BurnLoadRom(tmp, num, 1)) return 1; - - for (INT32 len = 0; len < 0x020000; len++) - { - gfx[len*4+0] = ((tmp[len] & 0x20) << 2) | ((tmp[len] & 0x10) >> 1); - gfx[len*4+1] = ((tmp[len] & 0x80) << 0) | ((tmp[len] & 0x40) >> 3); - gfx[len*4+2] = ((tmp[len] & 0x02) << 6) | ((tmp[len] & 0x01) << 3); - gfx[len*4+3] = ((tmp[len] & 0x08) << 4) | ((tmp[len] & 0x04) << 1); - } - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 2, 1)) return 1; - if (DrvLoad5bpp(DrvGfxROM0 + 0x80000, 3 )) return 1; - - if (BurnLoadRom(DrvGfxROM1, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3, 6, 1)) return 1; - if (DrvLoad5bpp(DrvGfxROM3 + 0x80000, 7 )) return 1; - - if (BurnLoadRom(DrvSndROM, 8, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvMidRAM, 0xc00000, 0xc00fff, MAP_RAM); - SekMapMemory(DrvBakRAM, 0xc01000, 0xc01fff, MAP_RAM); - SekMapMemory(DrvTxtRAM, 0xc02000, 0xc03fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0xc80000, 0xc81fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xd00000, 0xd00fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, aquarium_write_byte); - SekSetWriteWordHandler(0, aquarium_write_word); - SekSetReadByteHandler(0, aquarium_read_byte); - SekSetReadWordHandler(0, aquarium_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM); - ZetMapArea(0x7800, 0x7fff, 0, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 1, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 2, DrvZ80RAM); - ZetSetOutHandler(aquarium_sound_out); - ZetSetInHandler(aquarium_sound_in); - ZetClose(); - - MSM6295Init(0, 1122000 / 132, 1); - MSM6295SetRoute(0, 0.47, BURN_SND_ROUTE_BOTH); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&aquariumYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static inline void palette_write(INT32 offset) -{ - UINT8 r,g,b; - UINT16 data = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + offset))); - - r = ((data >> 11) & 0x1e) | ((data >> 3) & 0x01); - g = ((data >> 7) & 0x1e) | ((data >> 2) & 0x01); - b = ((data >> 3) & 0x1e) | ((data >> 1) & 0x01); - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -static void draw_bg_layer(UINT8 *src, UINT8 *gfx_base, INT32 scrollx, INT32 scrolly, INT32 transp, INT32 priority) -{ - UINT16 *vram = (UINT16*)src; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[(offs * 2) + 1]); - INT32 prior = (color & 0x0020) >> 5; - if (prior != priority) continue; - - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scrollx + 16; - if (sx < -15) sx += 0x200; - sy -= scrolly + 16; - if (sy < -15) sy += 0x200; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 flipx = color & 0x0100; - INT32 flipy = color & 0x0200; - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2]) & 0x0fff; - - if (transp) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color & 0x001f, 5, 0, 0x400, gfx_base); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color & 0x001f, 5, 0, 0x400, gfx_base); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color & 0x001f, 5, 0, 0x400, gfx_base); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color & 0x001f, 5, 0, 0x400, gfx_base); - } - } - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color & 0x001f, 5, 0x400, gfx_base); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color & 0x001f, 5, 0x400, gfx_base); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color & 0x001f, 5, 0x400, gfx_base); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color & 0x001f, 5, 0x400, gfx_base); - } - } - } - } -} - -static void draw_tx_layer(INT32 scrollx, INT32 scrolly) -{ - UINT16 *vram = (UINT16*)DrvTxtRAM; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= scrollx + 16; - if (sx < -7) sx += 0x200; - sy -= scrolly + 16; - if (sy < -7) sy += 0x200; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]) & 0xfff; - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[offs]) >> 12; - - if (sx >= nScreenWidth || sy >= nScreenHeight || code == 0) continue; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x200, DrvGfxROM1); - } -} - -static void draw_sprites() -{ - UINT16 *sram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x0800; offs += 8) - { - INT32 code = (BURN_ENDIAN_SWAP_INT16(sram[offs+5]) & 0xff) | ((BURN_ENDIAN_SWAP_INT16(sram[offs+6]) & 0x3f) << 8); - - if (~BURN_ENDIAN_SWAP_INT16(sram[offs+4]) & 0x80) - { - INT32 x = (((BURN_ENDIAN_SWAP_INT16(sram[offs+0]) & 0xff) | ((BURN_ENDIAN_SWAP_INT16(sram[offs+1]) & 0x7f) << 8)) - ((BURN_ENDIAN_SWAP_INT16(sram[offs+1]) & 0x80) << 9)) - 16; - INT32 y = (((BURN_ENDIAN_SWAP_INT16(sram[offs+2]) & 0xff) | ((BURN_ENDIAN_SWAP_INT16(sram[offs+3]) & 0x7f) << 8)) - ((BURN_ENDIAN_SWAP_INT16(sram[offs+3]) & 0x80) << 9)) - 16; - - INT32 col = BURN_ENDIAN_SWAP_INT16(sram[offs+7]) & 0x0f; - INT32 chain = BURN_ENDIAN_SWAP_INT16(sram[offs+4]) & 0x07; - INT32 flipy = BURN_ENDIAN_SWAP_INT16(sram[offs+4]) & 0x10; - INT32 flipx = BURN_ENDIAN_SWAP_INT16(sram[offs+4]) & 0x20; - - if (~BURN_ENDIAN_SWAP_INT16(sram[offs+4]) & 0x08) { - if (flipy) y += chain << 4; - if (flipx) x += chain << 4; - } - - for (INT32 pos = chain; pos >= 0; pos--) - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, col, 4, 0, 0x300, DrvGfxROM2); - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y + 256, col, 4, 0, 0x300, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, col, 4, 0, 0x300, DrvGfxROM2); - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y + 256, col, 4, 0, 0x300, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, col, 4, 0, 0x300, DrvGfxROM2); - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y + 256, col, 4, 0, 0x300, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, col, 4, 0, 0x300, DrvGfxROM2); - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y + 256, col, 4, 0, 0x300, DrvGfxROM2); - } - } - - code++; - - if (BURN_ENDIAN_SWAP_INT16(sram[offs+4]) & 0x08) - { - if (flipy) y -= 16; - else y += 16; - } - else - { - if (flipx) x -= 16; - else x += 16; - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_write(i); - } - } - - draw_bg_layer(DrvBakRAM, DrvGfxROM3, DrvScroll[2] & 0x1ff, DrvScroll[3] & 0x1ff, 0, 0); - draw_bg_layer(DrvMidRAM, DrvGfxROM0, DrvScroll[0] & 0x1ff, DrvScroll[1] & 0x1ff, 1, 0); - - draw_sprites(); - - draw_bg_layer(DrvBakRAM, DrvGfxROM3, DrvScroll[2] & 0x1ff, DrvScroll[3] & 0x1ff, 1, 1); - draw_bg_layer(DrvMidRAM, DrvGfxROM0, DrvScroll[0] & 0x1ff, DrvScroll[1] & 0x1ff, 1, 1); - - draw_tx_layer(DrvScroll[4] & 0x1ff, DrvScroll[5] & 0x1ff); - - if (*flipscreen) { - INT32 len = nScreenWidth * nScreenHeight; - for (INT32 i = 0; i < len / 2; i++) { - INT32 t = pTransDraw[i + 0]; - pTransDraw[i + 0] = pTransDraw[len-(1+i)]; - pTransDraw[len-(1+i)] = t; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 4); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[1] &= 0x7f; - } - - INT32 nSegment; - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 16000000 / 60, 6000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nSegment); - - nSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - nCyclesDone[1] += ZetRun(nSegment); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - } - - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - sound_bankswitch(*DrvZ80Bank); - ZetClose(); - } - - return 0; -} - - -// Aquarium (US) - -static struct BurnRomInfo aquariumRomDesc[] = { - { "aquar3.13h", 0x080000, 0xf197991e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - - { "excellent_5.10c", 0x040000, 0xfa555be1, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "excellent_1.15b", 0x080000, 0x575df6ac, 3 | BRF_GRA }, // 2 Midground Tiles - { "excellent_6.15d", 0x020000, 0x9065b146, 3 | BRF_GRA }, // 3 - - { "excellent_2.17e", 0x020000, 0xaa071b05, 4 | BRF_GRA }, // 6 Foreground Tiles - - { "d23c8000.1f", 0x100000, 0x14758b3c, 5 | BRF_GRA }, // 7 Sprites - - { "excellent_8.14g", 0x080000, 0x915520c4, 6 | BRF_GRA }, // 4 Background Tiles - { "excellent_7.17g", 0x020000, 0xb96b2b82, 6 | BRF_GRA }, // 5 - - { "excellent_4.7d", 0x080000, 0x9a4af531, 7 | BRF_SND }, // 8 MSM6295 Samples -}; - -STD_ROM_PICK(aquarium) -STD_ROM_FN(aquarium) - -struct BurnDriver BurnDrvAquarium = { - "aquarium", NULL, NULL, NULL, "1996", - "Aquarium (US)\0", NULL, "Excellent System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, aquariumRomInfo, aquariumRomName, NULL, NULL, AquariumInputInfo, AquariumDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// Aquarium (Japan) - -static struct BurnRomInfo aquariumjRomDesc[] = { - { "excellent_3.13h", 0x080000, 0x344509a1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - - { "excellent_5.10c", 0x040000, 0xfa555be1, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 Code - - { "excellent_1.15b", 0x080000, 0x575df6ac, 3 | BRF_GRA }, // 2 Midground Tiles - { "excellent_6.15d", 0x020000, 0x9065b146, 3 | BRF_GRA }, // 3 - - { "excellent_2.17e", 0x020000, 0xaa071b05, 4 | BRF_GRA }, // 6 Foreground Tiles - - { "d23c8000.1f", 0x100000, 0x14758b3c, 5 | BRF_GRA }, // 7 Sprites - - { "excellent_8.14g", 0x080000, 0x915520c4, 6 | BRF_GRA }, // 4 Background Tiles - { "excellent_7.17g", 0x020000, 0xb96b2b82, 6 | BRF_GRA }, // 5 - - { "excellent_4.7d", 0x080000, 0x9a4af531, 7 | BRF_SND }, // 8 MSM6295 Samples -}; - -STD_ROM_PICK(aquariumj) -STD_ROM_FN(aquariumj) - -struct BurnDriver BurnDrvAquariumj = { - "aquariumj", "aquarium", NULL, NULL, "1996", - "Aquarium (Japan)\0", NULL, "Excellent System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, aquariumjRomInfo, aquariumjRomName, NULL, NULL, AquariumInputInfo, AquariumDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_bestleag.cpp b/jan/src/burn/drv/pst90s/d_bestleag.cpp deleted file mode 100644 index 74826143a..000000000 --- a/jan/src/burn/drv/pst90s/d_bestleag.cpp +++ /dev/null @@ -1,626 +0,0 @@ -// FB Alpha Best League (Big Striker bootleg) driver module -// Based on MAME driver by David Haywood & Angelo Salese - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" -#include "burn_pal.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvTxRAM; -static UINT8 *DrvSprRAM; - -static UINT8 DrvRecalc; - -static UINT8 okibank; -static UINT16 scroll[8]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo BestleagInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bestleag) - -static struct BurnDIPInfo BestleagDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x13, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x13, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x06, 0x02, "Easy" }, - {0x14, 0x01, 0x06, 0x06, "Normal" }, - {0x14, 0x01, 0x06, 0x04, "Hard" }, - {0x14, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Timer Speed" }, - {0x14, 0x01, 0x18, 0x08, "Slow" }, - {0x14, 0x01, 0x18, 0x18, "Normal" }, - {0x14, 0x01, 0x18, 0x10, "Fast" }, - {0x14, 0x01, 0x18, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x14, 0x01, 0x40, 0x40, "1 Credit" }, - {0x14, 0x01, 0x40, 0x00, "2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Bestleag) - -static void oki_bankswitch(UINT32 data) -{ - data--; - - if (data > 2) return; - - okibank = data + 1; - - MSM6295SetBank(0, MSM6295ROM + 0x20000 + (data * 0x20000), 0x20000, 0x3ffff); -} - -static void __fastcall bestleag_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x0f8000: - case 0x0f8002: - case 0x0f8004: - case 0x0f8006: - case 0x0f8008: - case 0x0f800a: - scroll[(address / 2) & 7] = data; - return; - } -} - -static void __fastcall bestleag_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x30001d: - oki_bankswitch(data); - return; - - case 0x30001f: - MSM6295Command(0, data); - return; - - case 0x304000: - return; // nop - } -} - -static UINT16 __fastcall bestleag_read_word(UINT32 address) -{ - switch (address) - { - case 0x300010: - return DrvInputs[0]; - - case 0x300012: - return DrvInputs[1]; - - case 0x300014: - return DrvInputs[2]; - - case 0x300016: - return DrvDips[0]; - - case 0x300018: - return DrvDips[1]; - } - - return 0; -} - -static UINT8 __fastcall bestleag_read_byte(UINT32 address) -{ - switch (address) - { - case 0x30001f: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static tilemap_scan( tilemap ) -{ - int offset; - - offset = ((col&0xf)*16) + (row&0xf); - offset += (col >> 4) * 0x100; - offset += (row >> 4) * 0x800; - - return offset; -} - -static tilemap_callback( text ) -{ - UINT16 *ram = (UINT16*)DrvTxRAM; - - UINT16 code = ram[offs]; - - TILE_SET_INFO(0, code & 0xfff, code >> 12, 0); -} - -static tilemap_callback( background ) -{ - UINT16 *ram = (UINT16*)DrvBgRAM; - - UINT16 code = ram[offs]; - - TILE_SET_INFO(1, code & 0xfff, code >> 12, 0); -} - -static tilemap_callback( foreground ) -{ - UINT16 *ram = (UINT16*)DrvFgRAM; - - UINT16 code = ram[offs]; - - TILE_SET_INFO(2, code & 0xfff, code >> 12, 0); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - oki_bankswitch(0); - - memset (scroll, 0, 8 * sizeof(INT16)); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x080000; - - BurnPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x020000; - BurnPalRAM = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x004000; - DrvFgRAM = Next; Next += 0x004000; - DrvTxRAM = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x001000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { (0x40000 * 8) * 3, (0x40000 * 8) * 2, (0x40000 * 8) * 1, (0x40000 * 8) * 0 }; - INT32 XOffs[16] = { STEP8(0,1), STEP8(128,1) }; - INT32 YOffs[16] = { STEP16(0,8) }; - INT32 YOffs0[8] = { 0, 16, 32, 48, 8, 24, 40, 56 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp + 0x000000, DrvGfxROM1 + 0x040000, 0x040000); - memcpy (tmp + 0x040000, DrvGfxROM1 + 0x0c0000, 0x040000); - memcpy (tmp + 0x080000, DrvGfxROM1 + 0x140000, 0x040000); - memcpy (tmp + 0x0c0000, DrvGfxROM1 + 0x1c0000, 0x040000); - - GfxDecode(0x1000, 4, 8, 8, Plane, XOffs, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp + 0x000000, DrvGfxROM1 + 0x000000, 0x040000); - memcpy (tmp + 0x040000, DrvGfxROM1 + 0x080000, 0x040000); - memcpy (tmp + 0x080000, DrvGfxROM1 + 0x100000, 0x040000); - memcpy (tmp + 0x0c0000, DrvGfxROM1 + 0x180000, 0x040000); - - GfxDecode(0x2000, 4, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x100000); - - GfxDecode(0x1000, 4, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c0000, 9, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 10, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvBgRAM, 0x0e0000, 0x0e3fff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x0e8000, 0x0ebfff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x0f0000, 0x0f3fff, MAP_RAM); - SekMapMemory(BurnPalRAM, 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xfe0000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, bestleag_write_word); - SekSetWriteByteHandler(0, bestleag_write_byte); - SekSetReadWordHandler(0, bestleag_read_word); - SekSetReadByteHandler(0, bestleag_read_byte); - SekClose(); - - MSM6295Init(0, 1000000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_COLS, text_map_callback, 8, 8, 256, 32); - GenericTilemapInit(1, tilemap_map_scan, background_map_callback, 16, 16, 128, 64); - GenericTilemapInit(2, tilemap_map_scan, foreground_map_callback, 16, 16, 128, 64); - GenericTilemapSetGfx(0, DrvGfxROM0 + 0x000000, 4, 8, 8, 0x040000, 0x200, 0xf); - GenericTilemapSetGfx(1, DrvGfxROM1 + 0x000000, 4, 16, 16, 0x100000, 0x000, 0xf); - GenericTilemapSetGfx(2, DrvGfxROM1 + 0x100000, 4, 16, 16, 0x100000, 0x100, 0xf); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -16); - GenericTilemapSetTransparent(0, 0xf); - GenericTilemapSetTransparent(2, 0xf); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - SekExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_single_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy) -{ - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0x300, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0x300, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0x300, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0x300, DrvGfxROM2); - } - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - INT32 color_mask = (scroll[0] & 0x1000) ? 0x7 : 0xf; - - for (INT32 offs = 0x16/2;offs < 0x1000/2;offs += 4) - { - if (ram[offs] & 0x2000) break; - - INT32 code = (ram[offs+3] & 0xfff); - INT32 color = (ram[offs+2] >> 12) & color_mask; - INT32 sx = (ram[offs+2] & 0x1ff) - 20; - INT32 sy = (0xff - (ram[offs] & 0xff)) - (15 + 16); - INT32 flipx = (ram[offs] & 0x4000) >> 14; - - draw_single_sprite(code+0, color, flipx ? (sx+16) : (sx), sy, flipx, 0); - draw_single_sprite(code+1, color, flipx ? (sx) : (sx+16), sy, flipx, 0); - draw_single_sprite(code+0, color, flipx ? (sx+16 - 512) : (sx - 512), sy, flipx, 0); - draw_single_sprite(code+1, color, flipx ? (sx - 512) : (sx+16 - 512), sy, flipx, 0); - } -} - -static INT32 BestleagDraw() -{ - if (DrvRecalc) { - BurnPaletteUpdate_RRRRGGGGBBBBRGBx(); - DrvRecalc = 1; - } - - GenericTilemapSetScrollX(1, (scroll[0] & 0xfff) + ((scroll[4] & 7) - 3)); - GenericTilemapSetScrollY(1, scroll[1]); - GenericTilemapSetScrollX(0, scroll[2]); - GenericTilemapSetScrollY(0, scroll[3]); - GenericTilemapSetScrollX(2, scroll[4] & 0xfff8); - GenericTilemapSetScrollY(2, scroll[5]); - - if ((nBurnLayer & 1) == 0) BurnTransferClear(); - - if (nBurnLayer & 1) GenericTilemapDraw(1, pTransDraw, 0); - if (nBurnLayer & 2) GenericTilemapDraw(2, pTransDraw, 0); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, 0); - - BurnTransferCopy(BurnPalette); - - return 0; -} - -static INT32 BestleawDraw() -{ - if (DrvRecalc) { - BurnPaletteUpdate_RRRRGGGGBBBBRGBx(); - DrvRecalc = 1; - } - - GenericTilemapSetScrollX(1, scroll[4]); - GenericTilemapSetScrollY(1, scroll[5]); - GenericTilemapSetScrollX(0, scroll[0]); - GenericTilemapSetScrollY(0, scroll[1]); - GenericTilemapSetScrollX(2, scroll[2]); - GenericTilemapSetScrollY(2, scroll[3]); - - if ((nBurnLayer & 1) == 0) BurnTransferClear(); - - if (nBurnLayer & 1) GenericTilemapDraw(1, pTransDraw, 0); - if (nBurnLayer & 2) GenericTilemapDraw(2, pTransDraw, 0); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, 0); - - BurnTransferCopy(BurnPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - SekOpen(0); - SekRun(12000000 / 60); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - MSM6295Scan(0, nAction); - - SCAN_VAR(scroll); - SCAN_VAR(okibank); - } - - if (nAction & ACB_WRITE) { - oki_bankswitch(okibank); - } - - return 0; -} - - -// Best League (bootleg of Big Striker, Italian Serie A) - -static struct BurnRomInfo bestleagRomDesc[] = { - { "2.bin", 0x20000, 0xd2be3431, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "3.bin", 0x20000, 0xf29c613a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "4.bin", 0x80000, 0x47f7c9bc, 2 | BRF_GRA }, // 2 Layer tiles - { "5.bin", 0x80000, 0x6a6f499d, 2 | BRF_GRA }, // 3 - { "6.bin", 0x80000, 0x0c3d2609, 2 | BRF_GRA }, // 4 - { "7.bin", 0x80000, 0xdcece871, 2 | BRF_GRA }, // 5 - - { "27_27c010.u86", 0x20000, 0xa463422a, 3 | BRF_GRA }, // 6 Sprites - { "28_27c010.u85", 0x20000, 0xebec74ed, 3 | BRF_GRA }, // 7 - { "29_27c010.u84", 0x20000, 0x7ea4e22d, 3 | BRF_GRA }, // 8 - { "30_27c010.u83", 0x20000, 0x283d9ba6, 3 | BRF_GRA }, // 9 - - { "20_27c040.u16", 0x80000, 0xe152138e, 4 | BRF_SND }, // 10 MSM6295 samples -}; - -STD_ROM_PICK(bestleag) -STD_ROM_FN(bestleag) - -struct BurnDriver BurnDrvBestleag = { - "bestleag", "bigstrik", NULL, NULL, "1993", - "Best League (bootleg of Big Striker, Italian Serie A)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_SPORTSFOOTBALL, 0, - NULL, bestleagRomInfo, bestleagRomName, NULL, NULL, BestleagInputInfo, BestleagDIPInfo, - DrvInit, DrvExit, DrvFrame, BestleagDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Best League (bootleg of Big Striker, World Cup) - -static struct BurnRomInfo bestleawRomDesc[] = { - { "21_27c101.u67", 0x20000, 0xab5abd37, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "22_27c010.u66", 0x20000, 0x4abc0580, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "23_27c040.u36", 0x80000, 0xdcd53a97, 2 | BRF_GRA }, // 2 Layer tiles - { "24_27c040.u42", 0x80000, 0x2984c1a0, 2 | BRF_GRA }, // 3 - { "25_27c040.u38", 0x80000, 0x8bb5d73a, 2 | BRF_GRA }, // 4 - { "26_27c4001.u45", 0x80000, 0xa82c905d, 2 | BRF_GRA }, // 5 - - { "27_27c010.u86", 0x20000, 0xa463422a, 3 | BRF_GRA }, // 6 Sprites - { "28_27c010.u85", 0x20000, 0xebec74ed, 3 | BRF_GRA }, // 7 - { "29_27c010.u84", 0x20000, 0x7ea4e22d, 3 | BRF_GRA }, // 8 - { "30_27c010.u83", 0x20000, 0x283d9ba6, 3 | BRF_GRA }, // 9 - - { "20_27c040.u16", 0x80000, 0xe152138e, 4 | BRF_SND }, // 10 MSM6295 samples - - { "85c060.bin", 0x0032f, 0x537100ac, 5 | BRF_OPT }, // 11 plds - { "gal16v8-25hb1.u182", 0x00117, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 12 - { "gal16v8-25hb1.u183", 0x00117, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 13 - { "gal16v8-25hb1.u58", 0x00117, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 14 - { "palce20v8h-15pc-4.u38",0x157, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 15 -}; - -STD_ROM_PICK(bestleaw) -STD_ROM_FN(bestleaw) - -struct BurnDriver BurnDrvBestleaw = { - "bestleaw", "bigstrik", NULL, NULL, "1993", - "Best League (bootleg of Big Striker, World Cup)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_SPORTSFOOTBALL, 0, - NULL, bestleawRomInfo, bestleawRomName, NULL, NULL, BestleagInputInfo, BestleagDIPInfo, - DrvInit, DrvExit, DrvFrame, BestleawDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_bigstrkb.cpp b/jan/src/burn/drv/pst90s/d_bigstrkb.cpp deleted file mode 100644 index 8d48fae40..000000000 --- a/jan/src/burn/drv/pst90s/d_bigstrkb.cpp +++ /dev/null @@ -1,604 +0,0 @@ -// FB Alpha Big Striker bootleg Hardware -// Based on MAME driver by David Haywood - -// note: -// the dots in place of the title are normal -// note the glitches on the black on boot are normal - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" -#include "burn_pal.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *Drv68KRAM2; -static UINT8 *Drv68KRAM3; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvTxRAM; -static UINT8 *DrvSprRAM; - -static UINT16 scroll[2][2]; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo BigstrkbInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bigstrkb) - -static struct BurnDIPInfo BigstrkbDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x13, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x13, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x06, 0x02, "Easy" }, - {0x14, 0x01, 0x06, 0x06, "Normal" }, - {0x14, 0x01, 0x06, 0x04, "Hard" }, - {0x14, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Timer Speed" }, - {0x14, 0x01, 0x18, 0x08, "Slow" }, - {0x14, 0x01, 0x18, 0x18, "Normal" }, - {0x14, 0x01, 0x18, 0x10, "Fast" }, - {0x14, 0x01, 0x18, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x14, 0x01, 0x40, 0x00, "1 Credit" }, - {0x14, 0x01, 0x40, 0x40, "2 Credits" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Bigstrkb) - -static void __fastcall bigstrkb_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x700020: - scroll[0][0] = data; - return; - - case 0x700022: - scroll[0][1] = data; - return; - - case 0x700030: - scroll[1][0] = data; - return; - - case 0x700032: - scroll[1][1] = data; - return; - - case 0xe00000: - MSM6295Command(0, data); - return; - - case 0xe00002: - MSM6295Command(1, data); - return; - - } -} - -static void __fastcall bigstrkb_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("%5.5x, %2.2x\n"), address,data); -} - -static UINT16 __fastcall bigstrkb_read_word(UINT32 address) -{ - switch (address) - { - case 0x700000: - return DrvDips[0]; - - case 0x700002: - return DrvDips[1]; - - case 0x700004: - return DrvInputs[0]; - - case 0x70000a: - return DrvInputs[2]; - - case 0x70000c: - return DrvInputs[1]; - - case 0xe00000: - return MSM6295ReadStatus(0); - - case 0xe00002: - return MSM6295ReadStatus(1); - } - - - bprintf (0, _T("Read unmapped word: %5.5x\n"), address); - - return 0; -} - -static UINT8 __fastcall bigstrkb_read_byte(UINT32 address) -{ - bprintf (0, _T("Read unmapped byte: %5.5x\n"), address); - - return 0; -} - -static tilemap_scan( layer ) -{ - static INT32 offset; - - offset = ((col & 0xf) * 16) + (row & 0xf); - offset += (col >> 4) * 0x100; - offset += (row >> 4) * 0x800; - - return offset; -} - -static tilemap_callback( tx ) -{ - UINT16 *ram = (UINT16*)DrvTxRAM; - - INT32 code = ram[offs]; - - TILE_SET_INFO(0, code & 0xfff, code >> 12, 0); -} - -static tilemap_callback( fg ) -{ - UINT16 *ram = (UINT16*)DrvFgRAM; - - INT32 code = ram[offs]; - - TILE_SET_INFO(1, code & 0xfff, code >> 12, 0); -} - -static tilemap_callback( bg ) -{ - UINT16 *ram = (UINT16*)DrvBgRAM; - - INT32 code = ram[offs]; - - TILE_SET_INFO(2, code & 0xfff, code >> 12, 0); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - - memset (scroll, 0, 2 * 2 * sizeof(UINT16)); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROM2 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x040000; - DrvSndROM1 = Next; Next += 0x040000; - - BurnPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x010000; - Drv68KRAM1 = Next; Next += 0x010000; - Drv68KRAM2 = Next; Next += 0x010000; - Drv68KRAM3 = Next; Next += 0x100000; - DrvFgRAM = Next; Next += 0x004000; - DrvBgRAM = Next; Next += 0x004000; - DrvTxRAM = Next; Next += 0x004000; - - BurnPalRAM = Drv68KRAM1 + 0x8000; - DrvSprRAM = Drv68KRAM2 + 0x8000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { (0x10000 * 8 * 3), (0x10000 * 8 * 2), (0x10000 * 8 * 1), (0x10000 * 8 * 0) }; - INT32 Plane1[4] = { (0x80000 * 8 * 3), (0x80000 * 8 * 2), (0x80000 * 8 * 1), (0x80000 * 8 * 0) }; - INT32 Plane2[4] = { (0x20000 * 8 * 3), (0x20000 * 8 * 2), (0x20000 * 8 * 1), (0x20000 * 8 * 0) }; - INT32 XOffs[16] = { STEP16(0, 1) }; - INT32 YOffs0[8] = { STEP8(0, 8) }; - INT32 YOffs1[16] = { STEP16(0, 16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x040000); - - GfxDecode(0x2000, 4, 8, 8, Plane0, XOffs, YOffs0, 0x040, tmp, DrvGfxROM0); - - for (INT32 i = 0; i < 0x200000; i++) tmp[i] = DrvGfxROM1[i] ^ 0xff; //memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane1, XOffs, YOffs1, 0x100, tmp, DrvGfxROM1); - - for (INT32 i = 0; i < 0x100000; i++) tmp[i] = DrvGfxROM2[i] ^ 0xff; //memcpy (tmp, DrvGfxROM2, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane2, XOffs, YOffs1, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x030000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x010000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x060000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x020000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 14, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 15, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x0d0000, 0x0dffff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x0e0000, 0x0e3fff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x0e8000, 0x0ebfff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x0ec000, 0x0effff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x0f0000, 0x0fffff, MAP_RAM); -// SekMapMemory(BurnPalRAM, 0x0f8000, 0x0f87ff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x1f0000, 0x1fffff, MAP_RAM); -// SekMapMemory(DrvSprRAM, 0x1f8000, 0x1f87ff, MAP_RAM); - SekMapMemory(Drv68KRAM3, 0xf00000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, bigstrkb_write_word); - SekSetWriteByteHandler(0, bigstrkb_write_byte); - SekSetReadWordHandler(0, bigstrkb_read_word); - SekSetReadByteHandler(0, bigstrkb_read_byte); - SekClose(); - - MSM6295Init(0, 4000000 / 132, 1); - MSM6295Init(1, 4000000 / 132, 1); - MSM6295SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.30, BURN_SND_ROUTE_BOTH); - MSM6295SetBank(0, DrvSndROM0, 0, 0x3ffff); - MSM6295SetBank(1, DrvSndROM1, 0, 0x3ffff); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_COLS, tx_map_callback, 8, 8, 64, 32); - GenericTilemapInit(1, layer_map_scan, bg_map_callback, 16, 16, 128, 64); - GenericTilemapInit(2, layer_map_scan, fg_map_callback, 16, 16, 128, 64); - GenericTilemapSetGfx(0, DrvGfxROM0 + 0x000000, 4, 8, 8, 0x080000, 0x200, 0xf); - GenericTilemapSetGfx(1, DrvGfxROM1 + 0x000000, 4, 16, 16, 0x200000, 0x000, 0xf); - GenericTilemapSetGfx(2, DrvGfxROM1 + 0x200000, 4, 16, 16, 0x200000, 0x100, 0xf); - GenericTilemapSetTransparent(0, 0xf); - GenericTilemapSetTransparent(1, 0xf); - GenericTilemapSetTransparent(2, 0xf); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - MSM6295Exit(1); - SekExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 i = 0; i < 0x800 / 2; i+=8) - { - INT32 code = ram[i + 0] & 0x0fff; - INT32 attr = ram[i + 1]; - INT32 sx = ram[i + 2] - 126; - INT32 sy =(ram[i + 3] ^ 0xffff) - 32; - INT32 flipx = attr & 0x0100; - INT32 color = attr & 0x000f; - - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0x300, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0x300, DrvGfxROM2); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - BurnPaletteUpdate_RRRRGGGGBBBBRGBx(); - DrvRecalc = 1; - } - - GenericTilemapSetScrollX(2, scroll[0][0] + (256 - 14)); - GenericTilemapSetScrollY(2, scroll[1][0]); - GenericTilemapSetScrollX(1, scroll[0][1] + (256 - 14)); - GenericTilemapSetScrollY(1, scroll[1][1]); - - if ((nBurnLayer & 1) == 0) BurnTransferClear(); - - if ((nBurnLayer & 1) == 1) GenericTilemapDraw(2, pTransDraw, 0); - if ((nBurnLayer & 2) == 2) GenericTilemapDraw(1, pTransDraw, 0); - if ((nBurnLayer & 4) == 4) draw_sprites(); - if ((nBurnLayer & 8) == 8) GenericTilemapDraw(0, pTransDraw, 0); - - BurnTransferCopy(BurnPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - UINT32 nCycles = 12000000 / 60; - - SekOpen(0); - SekRun((nCycles * 240)/256); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekRun((nCycles * 16 )/256); - SekClose(); - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - SCAN_VAR(scroll); - } - - return 0; -} - - -// Big Striker (bootleg) - -static struct BurnRomInfo bigstrkbRomDesc[] = { - { "footgaa.015", 0x40000, 0x33b1d7f3, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "footgaa.016", 0x40000, 0x1c6b8709, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "footgaa.005", 0x10000, 0xd97c9bfe, 2 | BRF_GRA }, // 2 Characters - { "footgaa.006", 0x10000, 0x1ae56e8b, 2 | BRF_GRA }, // 3 - { "footgaa.007", 0x10000, 0xa45fa6b6, 2 | BRF_GRA }, // 4 - { "footgaa.008", 0x10000, 0x2700888c, 2 | BRF_GRA }, // 5 - - { "footgaa.001", 0x80000, 0x0e440841, 3 | BRF_GRA }, // 6 Tiles - { "footgaa.002", 0x80000, 0x92a15164, 3 | BRF_GRA }, // 7 - { "footgaa.003", 0x80000, 0xda127b89, 3 | BRF_GRA }, // 8 - { "footgaa.004", 0x80000, 0x3e6b0d92, 3 | BRF_GRA }, // 9 - - { "footgaa.011", 0x20000, 0xc3924fea, 4 | BRF_GRA }, // 10 Sprites - { "footgaa.012", 0x20000, 0xa581e9d7, 4 | BRF_GRA }, // 11 - { "footgaa.013", 0x20000, 0x26ce4b7f, 4 | BRF_GRA }, // 12 - { "footgaa.014", 0x20000, 0xc3cfc500, 4 | BRF_GRA }, // 13 - - { "footgaa.010", 0x40000, 0x53014576, 5 | BRF_SND }, // 14 MSM6295 #0 Samples - - { "footgaa.009", 0x40000, 0x19bf0896, 6 | BRF_SND }, // 15 MSM6295 #1 Samples -}; - -STD_ROM_PICK(bigstrkb) -STD_ROM_FN(bigstrkb) - -struct BurnDriver BurnDrvBigstrkb = { - "bigstrkb", "bigstrik", NULL, NULL, "1992", - "Big Striker (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_SPORTSFOOTBALL, 0, - NULL, bigstrkbRomInfo, bigstrkbRomName, NULL, NULL, BigstrkbInputInfo, BigstrkbDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Big Striker (bootleg w/Italian teams) - -static struct BurnRomInfo bigstrkbaRomDesc[] = { - { "16.cpu17", 0x40000, 0x3ba6997b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "15.cpu16", 0x40000, 0x204551b5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "5.bin", 0x10000, 0xf51ea151, 2 | BRF_GRA }, // 2 Characters - { "6.bin", 0x10000, 0x754d750e, 2 | BRF_GRA }, // 3 - { "7.bin", 0x10000, 0xfbc52546, 2 | BRF_GRA }, // 4 - { "8.bin", 0x10000, 0x62c63eaa, 2 | BRF_GRA }, // 5 - - { "1.bin", 0x80000, 0xc4eb9746, 3 | BRF_GRA }, // 6 Tiles - { "2.bin", 0x80000, 0xaa0beb78, 3 | BRF_GRA }, // 7 - { "3.bin", 0x80000, 0xd02298c5, 3 | BRF_GRA }, // 8 - { "4.bin", 0x80000, 0x069ac008, 3 | BRF_GRA }, // 9 - - { "footgaa.011", 0x20000, 0xc3924fea, 4 | BRF_GRA }, // 10 Sprites - { "12.bin", 0x20000, 0x8e15ea09, 4 | BRF_GRA }, // 11 - { "footgaa.013", 0x20000, 0x26ce4b7f, 4 | BRF_GRA }, // 12 - { "footgaa.014", 0x20000, 0xc3cfc500, 4 | BRF_GRA }, // 13 - - { "footgaa.010", 0x40000, 0x53014576, 5 | BRF_SND }, // 14 MSM6295 #0 Samples - - { "footgaa.009", 0x40000, 0x19bf0896, 6 | BRF_SND }, // 15 MSM6295 #1 Samples -}; - -STD_ROM_PICK(bigstrkba) -STD_ROM_FN(bigstrkba) - -struct BurnDriver BurnDrvBigstrkba = { - "bigstrkba", "bigstrik", NULL, NULL, "1992", - "Big Striker (bootleg w/Italian teams)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_SPORTSFOOTBALL, 0, - NULL, bigstrkbaRomInfo, bigstrkbaRomName, NULL, NULL, BigstrkbInputInfo, BigstrkbDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_blmbycar.cpp b/jan/src/burn/drv/pst90s/d_blmbycar.cpp deleted file mode 100644 index 6603ff6dc..000000000 --- a/jan/src/burn/drv/pst90s/d_blmbycar.cpp +++ /dev/null @@ -1,846 +0,0 @@ -// FB Alpha Bomby Car driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[2] = {0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvMSM6295ROMSrc = NULL; -static UINT8 *DrvVRam0 = NULL; -static UINT8 *DrvVRam1 = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvScroll0 = NULL; -static UINT8 *DrvScroll1 = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvEncrypted = 0; -static UINT8 DrvIsWatrball = 0; -static UINT8 BlmbyPotWheel = 0; -static UINT32 DrvOkiBank = 0; -static INT32 DrvToggle = 0; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort1 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static inline void DrvMakeInputs() -{ - DrvInput[0] = DrvInput[1] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] -= (DrvInputPort0[i] & 1) << i; - DrvInput[1] -= (DrvInputPort1[i] & 1) << i; - } -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xdf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x03, 0x02, "Easy" }, - {0x11, 0x01, 0x03, 0x03, "Normal" }, - {0x11, 0x01, 0x03, 0x01, "Hard" }, - {0x11, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Joysticks" }, - {0x11, 0x01, 0x04, 0x00, "1" }, - {0x11, 0x01, 0x04, 0x04, "2" }, - - {0 , 0xfe, 0 , 1 , "Controls" }, - {0x11, 0x01, 0x18, 0x18, "Joystick" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x12, 0x01, 0x38, 0x10, "6 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x18, "5 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x28, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x30, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x08, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x38, 0x00, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Credits to Start" }, - {0x12, 0x01, 0x40, 0x40, "1" }, - {0x12, 0x01, 0x40, 0x00, "2" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo WatrballDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xdf, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x03, 0x02, "Easy" }, - {0x11, 0x01, 0x03, 0x03, "Normal" }, - {0x11, 0x01, 0x03, 0x01, "Hard" }, - {0x11, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x07, 0x00, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x07, 0x01, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x12, 0x01, 0x38, 0x10, "6 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x18, "5 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x28, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x30, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x08, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x38, 0x00, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, -}; - -STDDIPINFO(Watrball) - -static struct BurnRomInfo DrvRomDesc[] = { - { "bcrom4.bin", 0x80000, 0x06d490ba, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "bcrom6.bin", 0x80000, 0x33aca664, BRF_ESS | BRF_PRG }, // 1 - - { "bc_rom7", 0x80000, 0xe55ca79b, BRF_GRA }, // 2 Sprites - { "bc_rom8", 0x80000, 0xcdf38c96, BRF_GRA }, // 3 - { "bc_rom9", 0x80000, 0x0337ab3d, BRF_GRA }, // 4 - { "bc_rom10", 0x80000, 0x5458917e, BRF_GRA }, // 5 - - { "bc_rom1", 0x80000, 0xac6f8ba1, BRF_SND }, // 6 Samples - { "bc_rom2", 0x80000, 0xa4bc31bf, BRF_SND }, // 7 -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvuRomDesc[] = { - { "bc_rom4", 0x80000, 0x76f054a2, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "bc_rom6", 0x80000, 0x2570b4c5, BRF_ESS | BRF_PRG }, // 1 - - { "bc_rom7", 0x80000, 0xe55ca79b, BRF_GRA }, // 2 Sprites - { "bc_rom8", 0x80000, 0xcdf38c96, BRF_GRA }, // 3 - { "bc_rom9", 0x80000, 0x0337ab3d, BRF_GRA }, // 4 - { "bc_rom10", 0x80000, 0x5458917e, BRF_GRA }, // 5 - - { "bc_rom1", 0x80000, 0xac6f8ba1, BRF_SND }, // 6 Samples - { "bc_rom2", 0x80000, 0xa4bc31bf, BRF_SND }, // 7 -}; - -STD_ROM_PICK(Drvu) -STD_ROM_FN(Drvu) - -static struct BurnRomInfo WatrballRomDesc[] = { - { "rom4.bin", 0x20000, 0xbfbfa720, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "rom6.bin", 0x20000, 0xacff9b01, BRF_ESS | BRF_PRG }, // 1 - - { "rom7.bin", 0x80000, 0xe7e5c311, BRF_GRA }, // 2 Sprites - { "rom8.bin", 0x80000, 0xfd27ce6e, BRF_GRA }, // 3 - { "rom9.bin", 0x80000, 0x122cc0ad, BRF_GRA }, // 4 - { "rom10.bin", 0x80000, 0x22a2a706, BRF_GRA }, // 5 - - { "rom1.bin", 0x80000, 0x7f88dee7, BRF_SND }, // 6 Samples -}; - -STD_ROM_PICK(Watrball) -STD_ROM_FN(Watrball) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x100000; - MSM6295ROM = Next; Next += 0x040000; - DrvMSM6295ROMSrc = Next; Next += 0x100000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x00e000; - DrvVRam0 = Next; Next += 0x002000; - DrvVRam1 = Next; Next += 0x002000; - DrvSpriteRam = Next; Next += 0x002000; - DrvPaletteRam = Next; Next += 0x000600; - DrvScroll0 = Next; Next += 0x000004; - DrvScroll1 = Next; Next += 0x000004; - - RamEnd = Next; - - DrvSprites = Next; Next += 0x4000 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00300 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static void DrvDoOkiBank(UINT8 Bank) -{ - DrvOkiBank = Bank; - memcpy(MSM6295ROM + 0x30000, DrvMSM6295ROMSrc + (0x10000 * DrvOkiBank), 0x10000); -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - DrvDoOkiBank(0); - - BlmbyPotWheel = 0; - DrvToggle = 0; - - return 0; -} - -UINT8 __fastcall Blmbycar68KReadByte(UINT32 a) -{ - if (a >= 0x204000 && a <= 0x2045ff) { - UINT16 *RAM = (UINT16*)DrvPaletteRam; - return RAM[(a - 0x204000) >> 1] & 0xff; - } - - if (a >= 0x204600 && a <= 0x207fff) { - UINT16 *RAM = (UINT16*)Drv68KRam + (0x8000 / 2); - return RAM[(a - 0x204600) >> 1] & 0xff; - } - - switch (a) { - case 0x700006: { - return 0x00; - } - - case 0x700009: { - if (DrvIsWatrball) { - DrvToggle ^= 0x08; - return DrvToggle & 0xff; - } - return ((BlmbyPotWheel & 0x80) ? 0x04 : 0x00) | (rand() & 0x08); - } - - case 0x70000f: { - return MSM6295ReadStatus(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Blmbycar68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x100000 && a <= 0x103fff) { - // ??? - return; - } - - if (a >= 0x200000 && a <= 0x2005ff) { - UINT16 *RAM = (UINT16*)DrvPaletteRam; - RAM[(a - 0x200000) >> 1] = d; - return; - } - - if (a >= 0x200600 && a <= 0x203fff) { - UINT16 *RAM = (UINT16*)Drv68KRam + (0x4000 / 2); - RAM[(a - 0x200600) >> 1] = d; - return; - } - - switch (a) { - case 0x70000a: { - // nop - return; - } - - case 0x70000d: { - DrvDoOkiBank(d & 0x0f); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Blmbycar68KReadWord(UINT32 a) -{ - if (a >= 0x204000 && a <= 0x2045ff) { - UINT16 *RAM = (UINT16*)DrvPaletteRam; - return BURN_ENDIAN_SWAP_INT16(RAM[(a - 0x204000) >> 1]); - } - - if (a >= 0x204600 && a <= 0x207fff) { - UINT16 *RAM = (UINT16*)Drv68KRam + (0x8000 / 2); - return BURN_ENDIAN_SWAP_INT16(RAM[(a - 0x204600) >> 1]); - } - - switch (a) { - case 0x700000: { - return (DrvDip[1] << 8) | DrvDip[0]; - } - - case 0x700002: { - return (DrvInput[1] << 8) | DrvInput[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Blmbycar68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x108000 && a <= 0x10bfff) { - // ??? - return; - } - - if (a >= 0x200000 && a <= 0x2005ff) { - UINT16 *RAM = (UINT16*)DrvPaletteRam; - RAM[(a - 0x200000) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - if (a >= 0x204000 && a <= 0x2045ff) { - UINT16 *RAM = (UINT16*)DrvPaletteRam; - RAM[(a - 0x204000) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - if (a >= 0x204600 && a <= 0x207fff) { - UINT16 *RAM = (UINT16*)Drv68KRam + (0x8000 / 2); - RAM[(a - 0x204600) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - switch (a) { - case 0x10c000: - case 0x10c002: { - UINT16 *RAM = (UINT16*)DrvScroll1; - RAM[(a - 0x10c000) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x10c004: - case 0x10c006: { - UINT16 *RAM = (UINT16*)DrvScroll0; - RAM[(a - 0x10c004) >> 1] = BURN_ENDIAN_SWAP_INT16(d); - return; - } - - case 0x70000e: { - MSM6295Command(0, d & 0xff); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -static INT32 SpritePlaneOffsets[4] = { RGN_FRAC(0x200000,3,4),RGN_FRAC(0x200000,2,4),RGN_FRAC(0x200000,1,4),RGN_FRAC(0x200000,0,4) }; -static INT32 SpriteXOffsets[16] = { STEP8(0,1), STEP8(8*8*2,1) }; -static INT32 SpriteYOffsets[16] = { STEP8(0,8), STEP8(8*8*1,8) }; - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x200000); - - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - - memset(DrvTempRom, 0, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 5, 1); if (nRet != 0) return 1; - GfxDecode(0x4000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, DrvTempRom, DrvSprites); - - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x000000, 6, 1); if (nRet != 0) return 1; - if (!DrvIsWatrball) { nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x080000, 7, 1); if (nRet != 0) return 1; } - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x040000); - - BurnFree(DrvTempRom); - - if (DrvEncrypted) { - UINT16 *RAM = (UINT16*)Drv68KRom; - for (INT32 i = 0; i < 0x80000; i++) { - UINT16 x = BURN_ENDIAN_SWAP_INT16(RAM[i]); - x = (x & ~0x0606) | ((x & 0x0202) << 1) | ((x & 0x0404) >> 1); - RAM[i] = BURN_ENDIAN_SWAP_INT16(x); - } - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvVRam1 , 0x104000, 0x105fff, MAP_RAM); - SekMapMemory(DrvVRam0 , 0x106000, 0x107fff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x00c000, 0x440000, 0x441fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x444000, 0x445fff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x000000, 0xfec000, 0xfeffff, MAP_RAM); - SekSetReadWordHandler(0, Blmbycar68KReadWord); - SekSetWriteWordHandler(0, Blmbycar68KWriteWord); - SekSetReadByteHandler(0, Blmbycar68KReadByte); - SekSetWriteByteHandler(0, Blmbycar68KWriteByte); - SekClose(); - - MSM6295Init(0, 1056000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 BlmbycarInit() -{ - DrvEncrypted = 1; - - return DrvInit(); -} - -static INT32 WatrballInit() -{ - DrvIsWatrball = 1; - - return DrvInit(); -} - -static INT32 DrvExit() -{ - SekExit(); - - MSM6295Exit(0); - - GenericTilesExit(); - - BurnFree(Mem); - - DrvEncrypted = 0; - DrvIsWatrball = 0; - BlmbyPotWheel = 0; - DrvOkiBank = 0; - DrvToggle = 0; - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 4); - g = pal4bit(nColour >> 0); - b = pal4bit(nColour >> 8); - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x300; i++, ps++, pd++) { - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*ps)); - } -} - -static void DrvRenderBgLayer(INT32 RenderCategory) -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, xFlip, yFlip, Category; - - UINT16 *RAM = (UINT16*)DrvVRam0; - UINT16 *ScrollRAM = (UINT16*)DrvScroll0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = BURN_ENDIAN_SWAP_INT16(RAM[(TileIndex << 1) + 0]); - Attr = BURN_ENDIAN_SWAP_INT16(RAM[(TileIndex << 1) + 1]); - Colour = Attr & 0x1f; - xFlip = (Attr >> 6) & 0x01; - yFlip = (Attr >> 6) & 0x02; - Category = (Attr >> 5) & 0x01; - - if (Category == RenderCategory) { - x = 16 * mx; - y = 16 * my; - - x -= BURN_ENDIAN_SWAP_INT16(ScrollRAM[1]) & 0x3ff; - y -= BURN_ENDIAN_SWAP_INT16(ScrollRAM[0]) & 0x1ff; - if (x < -16) x += 1024; - if (y < -16) y += 512; - - if (DrvIsWatrball) y -= 16; - - if (x > 16 && x < 368 && y > 16 && y < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } - } - } - - TileIndex++; - } - } -} - -static void DrvRenderFgLayer(INT32 RenderCategory) -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, xFlip, yFlip, Category; - - UINT16 *RAM = (UINT16*)DrvVRam1; - UINT16 *ScrollRAM = (UINT16*)DrvScroll1; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = BURN_ENDIAN_SWAP_INT16(RAM[(TileIndex << 1) + 0]); - Attr = BURN_ENDIAN_SWAP_INT16(RAM[(TileIndex << 1) + 1]); - Colour = Attr & 0x1f; - xFlip = (Attr >> 6) & 0x01; - yFlip = (Attr >> 6) & 0x02; - Category = (Attr >> 5) & 0x01; - - if (Category == RenderCategory) { - x = 16 * mx; - y = 16 * my; - - x -= (BURN_ENDIAN_SWAP_INT16(ScrollRAM[1]) + 5) & 0x3ff; - y -= (BURN_ENDIAN_SWAP_INT16(ScrollRAM[0]) + 1) & 0x1ff; - if (x < -16) x += 1024; - if (y < -16) y += 512; - - if (DrvIsWatrball) y -= 16; - - if (x > 16 && x < 368 && y > 16 && y < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } - } - } - - TileIndex++; - } - } -} - -static void DrawSprites(INT32 RenderPriority) -{ - UINT16 *Source, *Finish; - UINT16 *RAM = (UINT16*)DrvSpriteRam; - - Source = RAM + 0x06 / 2; - Finish = RAM + (0x2000 / 2) - (8 / 2); - - for (; Source < Finish; Source += 8 / 2) { - if (BURN_ENDIAN_SWAP_INT16(Source[0]) & 0x8000) break; - } - - Source -= 8 / 2; - Finish = RAM; - - for (; Source >= Finish; Source -= 8 / 2) { - INT32 y = BURN_ENDIAN_SWAP_INT16(Source[0]); - INT32 Code = BURN_ENDIAN_SWAP_INT16(Source[1]); - INT32 Attr = BURN_ENDIAN_SWAP_INT16(Source[2]); - INT32 x = BURN_ENDIAN_SWAP_INT16(Source[3]); - - INT32 xFlip = Attr & 0x4000; - INT32 yFlip = Attr & 0x8000; - INT32 Pri = (~Attr >> 3) & 0x1; - - if (RenderPriority == Pri) { - INT32 Colour = 0x20 + (Attr & 0x0f); - - if (x & 0x4000) continue; - - x = (x & 0x1ff) - 0x10; - y = 0xf0 - ((y & 0xff) - (y & 0x100)); - - if (DrvIsWatrball) y -= 16; - - if (x > 16 && x < 368 && y > 16 && y < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvSprites); - } - } - } - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - if (nBurnLayer & 0x01) DrvRenderBgLayer(0); - if (nBurnLayer & 0x02) DrvRenderBgLayer(1); - if (nBurnLayer & 0x04) DrvRenderFgLayer(0); - if (nSpriteEnable & 0x01) DrawSprites(0); - if (nBurnLayer & 0x08) DrvRenderFgLayer(1); - if (nSpriteEnable & 0x02) DrawSprites(1); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nCyclesTotal = 10000000 / 60; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - SekNewFrame(); - SekOpen(0); - SekRun(nCyclesTotal); - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029717; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(DrvInput); - SCAN_VAR(DrvDip); - SCAN_VAR(BlmbyPotWheel); - SCAN_VAR(DrvOkiBank); - SCAN_VAR(DrvToggle); - - if (nAction & ACB_WRITE) { - DrvDoOkiBank(DrvOkiBank); - } - } - - return 0; -} - -struct BurnDriver BurnDrvBlmbycar = { - "blmbycar", NULL, NULL, NULL, "1994", - "Blomby Car\0", NULL, "ABM & Gecas", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - BlmbycarInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x300, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvBlmbycaru = { - "blmbycaru", "blmbycar", NULL, NULL, "1994", - "Blomby Car (not encrypted)\0", NULL, "ABM & Gecas", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, DrvuRomInfo, DrvuRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x300, 384, 256, 4, 3 -}; - -struct BurnDriver BurnDrvWatrball = { - "watrball", NULL, NULL, NULL, "1996", - "Water Balls\0", NULL, "ABM", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, WatrballRomInfo, WatrballRomName, NULL, NULL, DrvInputInfo, WatrballDIPInfo, - WatrballInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x300, 384, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_bloodbro.cpp b/jan/src/burn/drv/pst90s/d_bloodbro.cpp deleted file mode 100644 index 93910825c..000000000 --- a/jan/src/burn/drv/pst90s/d_bloodbro.cpp +++ /dev/null @@ -1,1095 +0,0 @@ -// FB Alpha Blood Bros. driver module -// Based on MAME driver by Carlos A. Lozano Baides and Richard Bush - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "seibusnd.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvPalRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvTxRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvScrollRAM; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[2]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static INT32 nGameSelect = 0; - -static struct BurnInputInfo BloodbroInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 12, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bloodbro) - -static struct BurnInputInfo WeststryInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Weststry) - -static struct BurnInputInfo SkysmashInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 12, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Skysmash) - -static struct BurnDIPInfo BloodbroDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x14, 0x01, 0x01, 0x01, "1" }, - {0x14, 0x01, 0x01, 0x00, "2" }, - - // Coinage condition: Coin Mode 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x14, 0x02, 0x1e, 0x14, "6 Coins 1 Credit" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x16, "5 Coins 1 Credit" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x18, "4 Coins 1 Credit" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x1a, "3 Coins 1 Credit" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x02, "8 Coins 3 Credits" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x1c, "2 Coins 1 Credit" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x04, "5 Coins 3 Credits" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x06, "3 Coins 2 Credits" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x1e, "1 Coin 1 Credit" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x08, "2 Coins 3 Credits" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x12, "1 Coin 2 Credits" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x10, "1 Coin 3 Credits" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x0e, "1 Coin 4 Credits" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x0c, "1 Coin 5 Credits" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - {0x14, 0x02, 0x1e, 0x00, "Free Play" }, - {0x14, 0x00, 0x01, 0x01, NULL}, - - // Coin A condition: Coin Mode 2 - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x02, 0x06, 0x00, "5 Coins 1 Credit" }, - {0x14, 0x00, 0x01, 0x00, NULL}, - {0x14, 0x02, 0x06, 0x02, "3 Coins 1 Credit" }, - {0x14, 0x00, 0x01, 0x00, NULL}, - {0x14, 0x02, 0x06, 0x04, "2 Coins 1 Credit" }, - {0x14, 0x00, 0x01, 0x00, NULL}, - {0x14, 0x02, 0x06, 0x06, "1 Coin 1 Credit" }, - {0x14, 0x00, 0x01, 0x00, NULL}, - - // Coin B condition: Coin Mode 2 - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x02, 0x18, 0x18, "1 Coin 2 Credits" }, - {0x14, 0x00, 0x01, 0x00, NULL}, - {0x14, 0x02, 0x18, 0x10, "1 Coin 3 Credits" }, - {0x14, 0x00, 0x01, 0x00, NULL}, - {0x14, 0x02, 0x18, 0x08, "1 Coin 5 Credits" }, - {0x14, 0x00, 0x01, 0x00, NULL}, - {0x14, 0x02, 0x18, 0x00, "1 Coin 6 Credits" }, - {0x14, 0x00, 0x01, 0x00, NULL}, - - {0 , 0xfe, 0 , 2, "Starting Coin" }, - {0x14, 0x01, 0x20, 0x20, "Normal" }, - {0x14, 0x01, 0x20, 0x00, "x2" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x00, "1" }, - {0x15, 0x01, 0x03, 0x02, "2" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x0c, "300K, 500K Every" }, - {0x15, 0x01, 0x0c, 0x08, "500K, 500K Every" }, - {0x15, 0x01, 0x0c, 0x04, "500K Only" }, - {0x15, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x30, 0x20, "Easy" }, - {0x15, 0x01, 0x30, 0x30, "Normal" }, - {0x15, 0x01, 0x30, 0x10, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x40, 0x00, "No" }, - {0x15, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Bloodbro) - -static struct BurnDIPInfo WeststryDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x01, 0x01, "1" }, - {0x13, 0x01, 0x01, 0x00, "2" }, - - // Coinage condition: Coin Mode 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x02, 0x1e, 0x14, "6 Coins 1 Credit" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x16, "5 Coins 1 Credit" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x18, "4 Coins 1 Credit" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x1a, "3 Coins 1 Credit" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x02, "8 Coins 3 Credits" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x1c, "2 Coins 1 Credit" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x04, "5 Coins 3 Credits" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x06, "3 Coins 2 Credits" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x1e, "1 Coin 1 Credit" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x08, "2 Coins 3 Credits" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x12, "1 Coin 2 Credits" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x10, "1 Coin 3 Credits" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x0e, "1 Coin 4 Credits" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x0c, "1 Coin 5 Credits" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x0a, "1 Coin 6 Credits" }, - {0x13, 0x00, 0x01, 0x01, NULL}, - {0x13, 0x02, 0x1e, 0x00, "Free Play" }, - {0x13, 0x00, 0x01, 0x01, NULL }, - - // Coin A condition: Coin Mode 2 - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x02, 0x06, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x00, 0x01, 0x00, NULL}, - {0x13, 0x02, 0x06, 0x02, "3 Coins 1 Credit" }, - {0x13, 0x00, 0x01, 0x00, NULL}, - {0x13, 0x02, 0x06, 0x04, "2 Coins 1 Credit" }, - {0x13, 0x00, 0x01, 0x00, NULL}, - {0x13, 0x02, 0x06, 0x06, "1 Coin 1 Credit" }, - {0x13, 0x00, 0x01, 0x00, NULL}, - - // Coin B condition: Coin Mode 2 - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x02, 0x18, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x00, 0x01, 0x00, NULL }, - {0x13, 0x02, 0x18, 0x10, "1 Coin 3 Credits" }, - {0x13, 0x00, 0x01, 0x00, NULL }, - {0x13, 0x02, 0x18, 0x08, "1 Coin 5 Credits" }, - {0x13, 0x00, 0x01, 0x00, NULL }, - {0x13, 0x02, 0x18, 0x00, "1 Coin 6 Credits" }, - {0x13, 0x00, 0x01, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Starting Coin" }, - {0x13, 0x01, 0x20, 0x20, "Normal" }, - {0x13, 0x01, 0x20, 0x00, "x2" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x00, "1" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "300K, 500K Every" }, - {0x14, 0x01, 0x0c, 0x08, "500K, 500K Every" }, - {0x14, 0x01, 0x0c, 0x04, "500K Only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x20, "Easy" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - {0x14, 0x01, 0x30, 0x10, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "No" }, - {0x14, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Weststry) - -static struct BurnDIPInfo SkysmashDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x12, 0x01, 0x01, 0x01, "1" }, - {0x12, 0x01, 0x01, 0x00, "2" }, - - // Coinage condition: Coin Mode 1 - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x12, 0x02, 0x1e, 0x14, "6 Coins 1 Credit" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x16, "5 Coins 1 Credit" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x18, "4 Coins 1 Credit" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x1a, "3 Coins 1 Credit" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x02, "8 Coins 3 Credits" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x1c, "2 Coins 1 Credit" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x04, "5 Coins 3 Credits" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x06, "3 Coins 2 Credits" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x1e, "1 Coin 1 Credit" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x08, "2 Coins 3 Credits" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x12, "1 Coin 2 Credits" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x10, "1 Coin 3 Credits" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x0e, "1 Coin 4 Credits" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x0c, "1 Coin 5 Credits" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - {0x12, 0x02, 0x1e, 0x00, "Free Play" }, - {0x12, 0x00, 0x01, 0x01, NULL}, - - // Coin A condition: Coin Mode 2 - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x12, 0x02, 0x06, 0x00, "5 Coins 1 Credit" }, - {0x12, 0x00, 0x01, 0x00, NULL }, - {0x12, 0x02, 0x06, 0x02, "3 Coins 1 Credit" }, - {0x12, 0x00, 0x01, 0x00, NULL }, - {0x12, 0x02, 0x06, 0x04, "2 Coins 1 Credit" }, - {0x12, 0x00, 0x01, 0x00, NULL}, - {0x12, 0x02, 0x06, 0x06, "1 Coin 1 Credit" }, - {0x12, 0x00, 0x01, 0x00, NULL}, - - // Coin B condition: Coin Mode 2 - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x02, 0x18, 0x18, "1 Coin 2 Credits" }, - {0x12, 0x00, 0x01, 0x00, NULL}, - {0x12, 0x02, 0x18, 0x10, "1 Coin 3 Credits" }, - {0x12, 0x00, 0x01, 0x00, NULL}, - {0x12, 0x02, 0x18, 0x08, "1 Coin 5 Credits" }, - {0x12, 0x00, 0x01, 0x00, NULL}, - {0x12, 0x02, 0x18, 0x00, "1 Coin 6 Credits" }, - {0x12, 0x00, 0x01, 0x00, NULL}, - - {0 , 0xfe, 0 , 2, "Starting Coin" }, - {0x12, 0x01, 0x20, 0x20, "Normal" }, - {0x12, 0x01, 0x20, 0x00, "x2" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - {0x13, 0x01, 0x03, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x0c, "120K, 200K Every" }, - {0x13, 0x01, 0x0c, 0x08, "200K, 200K Every" }, - {0x13, 0x01, 0x0c, 0x04, "250K, 250K Every" }, - {0x13, 0x01, 0x0c, 0x00, "200K Only" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x00, "Easy" }, - {0x13, 0x01, 0x30, 0x30, "Normal" }, - {0x13, 0x01, 0x30, 0x20, "Hard" }, - {0x13, 0x01, 0x30, 0x10, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x40, 0x00, "No" }, - {0x13, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Skysmash) - -static void __fastcall bloodbro_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffffff0) == 0xa0000) { - seibu_main_word_write(address, data); - return; - } -} - -static void __fastcall bloodbro_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffff0) == 0xa0000) { - seibu_main_word_write(address, data); - return; - } - - if ((address & 0xfffff80) == 0xc0000) { - *((UINT16*)(DrvScrollRAM + (address & 0x7e))) = BURN_ENDIAN_SWAP_INT16(data); - return; - } -} - -static UINT8 __fastcall bloodbro_read_byte(UINT32 address) -{ - if ((address & 0xffffff0) == 0xa0000) { - return seibu_main_word_read(address); - } - - return 0; -} - -static UINT16 __fastcall bloodbro_read_word(UINT32 address) -{ - if ((address & 0xffffff0) == 0xa0000) { - return seibu_main_word_read(address); - } - - switch (address) - { - case 0xe0000: - return ((DrvDips[1] << 8) | DrvDips[0]); - - case 0xe0002: - return DrvInputs[1]; - - case 0xe0004: - return DrvInputs[2]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - seibu_sound_reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x00000, 0x00004, 0x80000, 0x80004 }; - INT32 XOffs0[8] = { 0x003, 0x002, 0x001, 0x000, 0x00b, 0x00a, 0x009, 0x008 }; - INT32 YOffs0[8] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070 }; - - INT32 Plane1[4] = { 0x008, 0x00c, 0x000, 0x004 }; - INT32 XOffs1[16] = { 0x003, 0x002, 0x001, 0x000, 0x013, 0x012, 0x011, 0x010, - 0x203, 0x202, 0x201, 0x200, 0x213, 0x212, 0x211, 0x210 }; - INT32 YOffs1[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x020000); - - GfxDecode(0x1000, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - SeibuZ80ROM = Next; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM2 = Next; Next += 0x200000; - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x00b800; - Drv68KRAM1 = Next; Next += 0x009000; - - DrvPalRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x001000; - DrvTxRAM = Next; Next += 0x002800; - DrvFgRAM = Next; Next += 0x001000; - - DrvScrollRAM = Next; Next += 0x000080; - - SeibuZ80RAM = Next; - DrvZ80RAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static tilemap_callback( background ) -{ - UINT16 *ram = (UINT16*)DrvBgRAM; - - TILE_SET_INFO(1, BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0xfff, BURN_ENDIAN_SWAP_INT16(ram[offs]) >> 12, 0); -} - -static tilemap_callback( foreground ) -{ - UINT16 *ram = (UINT16*)DrvFgRAM; - - TILE_SET_INFO(2, (BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0xfff) + 0x1000, BURN_ENDIAN_SWAP_INT16(ram[offs]) >> 12, 0); -} - -static tilemap_callback( text ) -{ - UINT16 *ram = (UINT16*)DrvTxRAM; - - TILE_SET_INFO(0, BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0xfff, BURN_ENDIAN_SWAP_INT16(ram[offs]) >> 12, 0); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "weststry")) - { - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x10000, DrvZ80ROM + 0x8000, 0x8000); - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x8000, 0x8000); - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x10000); - if (BurnLoadRom(pTemp + 0x00000, 5, 1)) return 1; - memcpy(DrvGfxROM0 + 0x00000, pTemp + 0x8000, 0x8000); - if (BurnLoadRom(pTemp + 0x00000, 6, 1)) return 1; - memcpy(DrvGfxROM0 + 0x08000, pTemp + 0x8000, 0x8000); - if (BurnLoadRom(pTemp + 0x00000, 7, 1)) return 1; - memcpy(DrvGfxROM0 + 0x10000, pTemp + 0x8000, 0x8000); - if (BurnLoadRom(pTemp + 0x00000, 8, 1)) return 1; - memcpy(DrvGfxROM0 + 0x18000, pTemp + 0x8000, 0x8000); - BurnFree(pTemp); - - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x60000,10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xa0000,11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xe0000,12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00000,13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000,14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000,15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0xc0000,16, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000,17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000,18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000,19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x60000,20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x80000,21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0xa0000,22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0xc0000,23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0xe0000,24, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000,25, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x08afff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x08b000, 0x08bfff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x08c000, 0x08cfff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x08d000, 0x08d7ff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x08d800, 0x08ffff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0xb000, 0x0c1000, 0x0c17ff, MAP_RAM); - SekMapMemory(Drv68KRAM1 + 0x0000, 0x120000, 0x127fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x128000, 0x1287ff, MAP_RAM); - SekMapMemory(Drv68KRAM1 + 0x8800, 0x128800, 0x128fff, MAP_RAM); - SekClose(); - - nGameSelect = 2; - } - else - { - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x10000, DrvZ80ROM + 0x8000, 0x8000); - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x8000, 0x8000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 8, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 9, 1)) return 1; - - DrvGfxDecode(); - } - - nGameSelect = 0; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "skysmash")) nGameSelect = 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x08afff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x08b000, 0x08bfff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x08c000, 0x08cfff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x08d000, 0x08d7ff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x08d800, 0x08e7ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x08e800, 0x08f7ff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0xb000, 0x08f800, 0x08ffff, MAP_RAM); - SekSetWriteByteHandler(0, bloodbro_write_byte); - SekSetWriteWordHandler(0, bloodbro_write_word); - SekSetReadByteHandler(0, bloodbro_read_byte); - SekSetReadWordHandler(0, bloodbro_read_word); - SekClose(); - } - - seibu_sound_init(0, 0, 3579545, 3579545, 1000000/132); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 16, 16, 32, 16); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, foreground_map_callback, 16, 16, 32, 16); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, text_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 4, 8, 8, 8 * 8 * 0x1000, 0x700, 0xf); - GenericTilemapSetGfx(1, DrvGfxROM1, 4, 16, 16, 16 * 16 * 0x1000, 0x400, 0xf); - GenericTilemapSetGfx(2, DrvGfxROM1 + 0x100000, 4, 16, 16, 16 * 16 * 0x1000, 0x500, 0xf); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -16); - GenericTilemapSetTransparent(1, 0xf); - GenericTilemapSetTransparent(2, 0xf); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - SekExit(); - - seibu_sound_exit(); - - BurnFree (AllMem); - - nGameSelect = 0; - - return 0; -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x1000/2; i++) - { - INT32 data = BURN_ENDIAN_SWAP_INT16(p[i]); - - r = (data >> 0) & 0x0f; - g = (data >> 4) & 0x0f; - b = (data >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x800; offs += 4) - { - INT32 attr = BURN_ENDIAN_SWAP_INT16(ram[offs]); - INT32 pri_mask = (attr & 0x0800) ? 2 : 0; - - if (attr & 0x8000) continue; - - INT32 width = (attr >> 7) & 7; - INT32 height = (attr >> 4) & 7; - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs+1]) & 0x1fff; - INT32 sx = BURN_ENDIAN_SWAP_INT16(ram[offs+2]) & 0x01ff; - INT32 sy = BURN_ENDIAN_SWAP_INT16(ram[offs+3]) & 0x01ff; - if (sx > 255) sx -= 512; - if (sy > 255) sy -= 512; - sy -= 16; - - INT32 flipx = attr & 0x2000; - INT32 flipy = attr & 0x4000; - INT32 color = attr & 0x000f; - - for (INT32 x = 0; x <= width; x++) - { - for (INT32 y = 0; y <= height; y++) - { - INT32 syy = sy + 16 * ((flipy) ? (height - y) : y); - INT32 sxx = sx + 16 * ((flipx) ? (width - x) : x); - - RenderPrioSprite(pTransDraw, DrvGfxROM2, (code++) & 0x1fff, (color << 4), 15, sxx, syy, flipx, flipy, 16, 16, pri_mask); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - UINT16 *scroll = (UINT16*)DrvScrollRAM; - scroll += 0x10 >> (nGameSelect & 1); // skysmash - - BurnTransferClear(); - - GenericTilemapSetScrollX(0, BURN_ENDIAN_SWAP_INT16(scroll[0])); - GenericTilemapSetScrollY(0, BURN_ENDIAN_SWAP_INT16(scroll[1])); - GenericTilemapSetScrollX(1, BURN_ENDIAN_SWAP_INT16(scroll[2])); - GenericTilemapSetScrollY(1, BURN_ENDIAN_SWAP_INT16(scroll[3])); - - if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, 0); - if (nBurnLayer & 2) GenericTilemapDraw(1, pTransDraw, 1); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) GenericTilemapDraw(2, pTransDraw, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - if (nGameSelect == 2) { - UINT16 *ram = (UINT16*)(Drv68KRAM + 0xb000); - ram[0] = (DrvDips[1] << 8) | (DrvDips[0]); - ram[1] = DrvInputs[1]; - ram[2] = DrvInputs[2]; - } - - seibu_coin_input = (DrvJoy1[1] << 1) | DrvJoy1[0]; - } - - INT32 nSegment; - INT32 nInterleave = 1000; - INT32 nTotalCycles[2] = { 10000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nTotalCycles[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - - BurnTimerUpdateYM3812((nTotalCycles[1] / nInterleave) * (i+1)); - } - - if (nGameSelect == 0) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); // bloodbro - if (nGameSelect == 1) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); // skysmash - if (nGameSelect == 2) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); // weststry - - BurnTimerEndFrameYM3812(nTotalCycles[1]); - - if (pBurnSoundOut) { - seibu_sound_update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029706; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - seibu_sound_scan(pnMin, nAction); - } - - return 0; -} - - -// Blood Bros. (set 1) - -static struct BurnRomInfo bloodbroRomDesc[] = { - { "2j.u021.7n", 0x020000, 0xc0fdc3e4, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "1j.u022.8n", 0x020000, 0x2d7e0fdf, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bb_04.u023.7l", 0x020000, 0xfd951c2c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bb_03.u024.8l", 0x020000, 0x18d3c460, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bb_07.u1016.6a", 0x010000, 0x411b94e8, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "bb_05.u061.6f", 0x010000, 0x04ba6d19, 3 | BRF_GRA }, // 5 Characters - { "bb_06.u063.6d", 0x010000, 0x7092e35b, 3 | BRF_GRA }, // 6 - - { "blood_bros_bk__(c)1990_tad_corp.u064.4d", 0x100000, 0x1aa87ee6, 4 | BRF_GRA }, // 7 Tiles - - { "blood_bros_obj__(c)1990_tad_corp.u078.2n", 0x100000, 0xd27c3952, 5 | BRF_GRA }, // 8 Sprites - - { "bb_08.u095.5a", 0x020000, 0xdeb1b975, 6 | BRF_SND }, // 9 Samples - - { "cb006.u083.6c", 0x000100, 0xb2b89a74, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(bloodbro) -STD_ROM_FN(bloodbro) - -struct BurnDriver BurnDrvBloodbro = { - "bloodbro", NULL, NULL, NULL, "1990", - "Blood Bros. (set 1)\0", NULL, "Tad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, bloodbroRomInfo, bloodbroRomName, NULL, NULL, BloodbroInputInfo, BloodbroDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Blood Bros. (set 2) - -static struct BurnRomInfo bloodbroaRomDesc[] = { - { "2j_a.u021.7n", 0x020000, 0xe8ca21b8, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "1j_a.u022.8n", 0x020000, 0x6b28cfc7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bb_04.u023.7l", 0x020000, 0xfd951c2c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bb_03.u024.8l", 0x020000, 0x18d3c460, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bb_07.u1016.6a", 0x010000, 0x411b94e8, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "bb_05.u061.6f", 0x010000, 0x04ba6d19, 3 | BRF_GRA }, // 5 Characters - { "bb_06.u063.6d", 0x010000, 0x7092e35b, 3 | BRF_GRA }, // 6 - - { "blood_bros_bk__(c)1990_tad_corp.u064.4d", 0x100000, 0x1aa87ee6, 4 | BRF_GRA }, // 7 Tiles - - { "blood_bros_obj__(c)1990_tad_corp.u078.2n", 0x100000, 0xd27c3952, 5 | BRF_GRA }, // 8 Sprites - - { "bb_08.u095.5a", 0x020000, 0xdeb1b975, 6 | BRF_SND }, // 9 Samples - - { "cb006.u083.6c", 0x000100, 0xb2b89a74, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(bloodbroa) -STD_ROM_FN(bloodbroa) - -struct BurnDriver BurnDrvBloodbroa = { - "bloodbroa", "bloodbro", NULL, NULL, "1990", - "Blood Bros. (set 2)\0", NULL, "Tad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, bloodbroaRomInfo, bloodbroaRomName, NULL, NULL, BloodbroInputInfo, BloodbroDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Blood Bros. (set 3) - -static struct BurnRomInfo bloodbrobRomDesc[] = { - { "bloodbros02.u021.7n", 0x020000, 0x204dca6e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bloodbros01.u022.8n", 0x020000, 0xac6719e7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bb_04.u023.7l", 0x020000, 0xfd951c2c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bb_03.u024.8l", 0x020000, 0x18d3c460, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bb_07.u1016.6a", 0x010000, 0x411b94e8, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "bb_05.u061.6f", 0x010000, 0x04ba6d19, 3 | BRF_GRA }, // 5 Characters - { "bb_06.u063.6d", 0x010000, 0x7092e35b, 3 | BRF_GRA }, // 6 - - { "blood_bros_bk__(c)1990_tad_corp.u064.4d", 0x100000, 0x1aa87ee6, 4 | BRF_GRA }, // 7 Tiles - - { "blood_bros_obj__(c)1990_tad_corp.u078.2n", 0x100000, 0xd27c3952, 5 | BRF_GRA }, // 8 Sprites - - { "bb_08.u095.5a", 0x020000, 0xdeb1b975, 6 | BRF_SND }, // 9 Samples - - { "cb006.u083.6c", 0x000100, 0xb2b89a74, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(bloodbrob) -STD_ROM_FN(bloodbrob) - -struct BurnDriver BurnDrvBloodbrob = { - "bloodbrob", "bloodbro", NULL, NULL, "1990", - "Blood Bros. (set 3)\0", NULL, "Tad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, bloodbrobRomInfo, bloodbrobRomName, NULL, NULL, BloodbroInputInfo, BloodbroDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// West Story - -static struct BurnRomInfo weststryRomDesc[] = { - { "ws13.bin", 0x20000, 0x158e302a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ws15.bin", 0x20000, 0x672e9027, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bb_04.bin", 0x20000, 0xfd951c2c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bb_03.bin", 0x20000, 0x18d3c460, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "ws17.bin", 0x10000, 0xe00a8f09, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ws09.bin", 0x10000, 0xf05b2b3e, 3 | BRF_GRA }, // 5 Characters - { "ws11.bin", 0x10000, 0x2b10e3d2, 3 | BRF_GRA }, // 6 - { "ws10.bin", 0x10000, 0xefdf7c82, 3 | BRF_GRA }, // 7 - { "ws12.bin", 0x10000, 0xaf993578, 3 | BRF_GRA }, // 8 - - { "ws05.bin", 0x20000, 0x007c8dc0, 4 | BRF_GRA }, // 9 Tiles - { "ws07.bin", 0x20000, 0x0f0c8d9a, 4 | BRF_GRA }, // 10 - { "ws06.bin", 0x20000, 0x459d075e, 4 | BRF_GRA }, // 11 - { "ws08.bin", 0x20000, 0x4d6783b3, 4 | BRF_GRA }, // 12 - { "ws01.bin", 0x20000, 0x32bda4bc, 4 | BRF_GRA }, // 13 - { "ws03.bin", 0x20000, 0x046b51f8, 4 | BRF_GRA }, // 14 - { "ws02.bin", 0x20000, 0xed9d682e, 4 | BRF_GRA }, // 15 - { "ws04.bin", 0x20000, 0x75f082e5, 4 | BRF_GRA }, // 16 - - { "ws25.bin", 0x20000, 0x8092e8e9, 5 | BRF_GRA }, // 17 Sprites - { "ws26.bin", 0x20000, 0xf6a1f42c, 5 | BRF_GRA }, // 18 - { "ws23.bin", 0x20000, 0x43d58e24, 5 | BRF_GRA }, // 19 - { "ws24.bin", 0x20000, 0x20a867ea, 5 | BRF_GRA }, // 20 - { "ws21.bin", 0x20000, 0xe23d7296, 5 | BRF_GRA }, // 21 - { "ws22.bin", 0x20000, 0x7150a060, 5 | BRF_GRA }, // 22 - { "ws19.bin", 0x20000, 0xc5dd0a96, 5 | BRF_GRA }, // 23 - { "ws20.bin", 0x20000, 0xf1245c16, 5 | BRF_GRA }, // 24 - - { "bb_08.bin", 0x20000, 0xdeb1b975, 6 | BRF_SND }, // 25 Samples -}; - -STD_ROM_PICK(weststry) -STD_ROM_FN(weststry) - -struct BurnDriverD BurnDrvWeststry = { - "weststry", "bloodbro", NULL, NULL, "1991", - "West Story (bootleg of Blood Bros.)\0", NULL, "Datsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, weststryRomInfo, weststryRomName, NULL, NULL, WeststryInputInfo, WeststryDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 256, 224, 4, 3 -}; - - -// Sky Smasher - -static struct BurnRomInfo skysmashRomDesc[] = { - { "rom6", 0x020000, 0xe9c1d308, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "rom5", 0x020000, 0x867f9897, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rom8", 0x020000, 0xd3646728, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rom7", 0x020000, 0xd209db4d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "rom2", 0x010000, 0x75b194cf, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "rom3", 0x010000, 0xfbb241be, 3 | BRF_GRA }, // 5 Characters - { "rom4", 0x010000, 0xad3cde81, 3 | BRF_GRA }, // 6 - - { "rom9", 0x100000, 0xb0a5eecf, 4 | BRF_GRA }, // 7 Tiles - - { "rom10", 0x080000, 0x1bbcda5d, 5 | BRF_GRA }, // 8 Sprites - - { "rom1", 0x020000, 0xe69986f6, 6 | BRF_SND }, // 9 Samples - - { "ss006.u083.4j", 0x00100, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(skysmash) -STD_ROM_FN(skysmash) - -struct BurnDriver BurnDrvSkysmash = { - "skysmash", NULL, NULL, NULL, "1990", - "Sky Smasher\0", NULL, "Nihon System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, skysmashRomInfo, skysmashRomName, NULL, NULL, SkysmashInputInfo, SkysmashDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pst90s/d_crospang.cpp b/jan/src/burn/drv/pst90s/d_crospang.cpp deleted file mode 100644 index f0e460ab9..000000000 --- a/jan/src/burn/drv/pst90s/d_crospang.cpp +++ /dev/null @@ -1,791 +0,0 @@ -// FB Alpha Cross Pang driver module -// Based on MAME driver by Pierpaolo Prazzoli and David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" -#include "burn_ym3812.h" - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvSprRAM; -static UINT32 *DrvPalette; - -static UINT8 *soundlatch; -static UINT8 *tile_bank; -static UINT16 *fg_scroll_x; -static UINT16 *fg_scroll_y; -static UINT16 *bg_scroll_x; -static UINT16 *bg_scroll_y; - -static UINT8 DrvRecalc; - -static INT32 bestri = 0; - -static struct BurnInputInfo CrospangInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 9, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Crospang) - -static struct BurnDIPInfo CrospangDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x7e, NULL }, - {0x12, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Number of Powers" }, - {0x11, 0x01, 0x20, 0x00, "1" }, - {0x11, 0x01, 0x20, 0x20, "2" }, - - {0 , 0xfe, 0 , 4, "Extra Balls" }, - {0x11, 0x01, 0xc0, 0xc0, "1" }, - {0x11, 0x01, 0xc0, 0x80, "2" }, - {0x11, 0x01, 0xc0, 0x40, "3" }, - {0x11, 0x01, 0xc0, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Minimum Balls per Row"}, - {0x12, 0x01, 0x18, 0x18, "3" }, - {0x12, 0x01, 0x18, 0x10, "4" }, - {0x12, 0x01, 0x18, 0x08, "5" }, - {0x12, 0x01, 0x18, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Crospang) - -static struct BurnDIPInfo HeuksunDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Heuksun) - -static struct BurnDIPInfo BestriDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfb, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x06, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x06, 0x04, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x06, 0x02, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x06, 0x06, "1 Coin 2 Credits" }, -}; - -STDDIPINFO(Bestri) - -void __fastcall crospang_write_byte(UINT32 address, UINT8 data) -{ - if (bestri == 0) return; - - switch (address) - { - case 0x10000e: - *tile_bank = (data >> 2) & 0x0f; - return; - } -} - -void __fastcall crospang_write_word(UINT32 address, UINT16 data) -{ - if (bestri == 0) { - switch (address) - { - case 0x100002: - *fg_scroll_y = (data + 8) & 0x1ff; - return; - - case 0x100004: - *bg_scroll_x = (data + 4) & 0x1ff; - return; - - case 0x100006: - *bg_scroll_y = (data + 8) & 0x1ff; - return; - - case 0x100008: - *fg_scroll_x = (data + 0) & 0x1ff; - return; - - case 0x270000: - *soundlatch = data & 0xff; - return; - } - } else { - switch (address) - { - case 0x100004: - *fg_scroll_x = ((data ^ 0x0000) + 32) & 0x1ff; - return; - - case 0x100006: - *fg_scroll_y = ((data ^ 0xff54) + 7) & 0x1ff; - return; - - case 0x10000a: - *bg_scroll_y = ((data ^ 0xfeaa) + 7) & 0x1ff; - return; - - case 0x10000c: - *bg_scroll_x = ((data ^ 0x0000) - 60) & 0x1ff; - return; - - case 0x270000: - *soundlatch = data & 0xff; - return; - } - } -} - -UINT8 __fastcall crospang_read_byte(UINT32 address) -{ - switch (address) - { - case 0x280002: - return DrvInputs[1] >> 8; - } - - return 0; -} - -UINT16 __fastcall crospang_read_word(UINT32 address) -{ - switch (address) - { - case 0x280000: - case 0x280002: - case 0x280004: - return DrvInputs[(address >> 1) & 3]; - } - - return 0; -} - -void __fastcall crospang_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM3812Write(0, 0, data); - return; - - case 0x01: - BurnYM3812Write(0, 1, data); - return; - - case 0x02: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall crospang_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return BurnYM3812Read(0, 0); - - case 0x02: - return MSM6295ReadStatus(0); - - case 0x06: - return *soundlatch; - } - - return 0; -} - -inline static INT32 crospangSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 3579545); -} - -void crospangYM3812IrqHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - MSM6295Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - tile_bank = Next; Next += 0x000001; - - fg_scroll_x = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - bg_scroll_x = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - fg_scroll_y = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - bg_scroll_y = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(INT32 gfx0len, INT32 gfx1len, INT32 type) -{ - INT32 Plane0[4] = { ((gfx0len / 2) * 8) + 8, ((gfx0len / 2) * 8) + 0, 8, 0 }; - INT32 Plane1[4] = { ((gfx1len / 2) * 8) + 8, ((gfx1len / 2) * 8) + 0, 8, 0 }; - INT32 XOffs[16] = { 32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7, - 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(((gfx0len - 1) | (gfx1len - 1)) + 1); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < gfx0len; i++) { // rearrange tiles a bit - INT32 k = (type) ? (((i & 0x40000) << 2) | ((i & 0x180000) >> 1) | (i & 0x3ffff)) : i; - tmp[k ^ (gfx0len/2) ^ 0x20] = DrvGfxROM0[i]; - } - - GfxDecode((gfx0len * 2) / (16 * 16), 4, 16, 16, Plane0, XOffs, YOffs, 0x200, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, gfx1len); - - GfxDecode((gfx1len * 2) / (16 * 16), 4, 16, 16, Plane1, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 crospangLoadRoms() -{ - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 9, 2)) return 1; - - DrvGfxDecode(0x80000, 0x200000, 0); - - return 0; -} - -static INT32 heuksunLoadRoms() -{ - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080001, 9, 2)) return 1; - - DrvGfxDecode(0x200000, 0x100000, 1); - - return 0; -} - -static INT32 bestriLoadRoms() -{ - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100001, 7, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 11, 2)) return 1; - - DrvGfxDecode(0x200000, 0x200000, 1); - - return 0; -} - -static INT32 DrvInit(INT32 (*pRomLoadCallback)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvSndROM, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 5, 2)) return 1; - - if (pRomLoadCallback) { - if (pRomLoadCallback()) return 1; - } - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvFgRAM, 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x122000, 0x1227ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x200000, 0x2005ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x210000, 0x2107ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x320000, 0x32ffff, MAP_RAM); // crospang, heuksun - SekMapMemory(Drv68KRAM, 0x3a0000, 0x3affff, MAP_RAM); // bestri - SekSetWriteByteHandler(0, crospang_write_byte); - SekSetWriteWordHandler(0, crospang_write_word); - SekSetReadByteHandler(0, crospang_read_byte); - SekSetReadWordHandler(0, crospang_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM); - ZetSetOutHandler(crospang_sound_out); - ZetSetInHandler(crospang_sound_in); - ZetClose(); - - BurnYM3812Init(1, 3579545, &crospangYM3812IrqHandler, crospangSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3579545); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM3812Exit(); - MSM6295Exit(0); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - bestri = 0; - - return 0; -} - -static void draw_layer(UINT8 *src, INT32 coloffs, INT32 scrollx, INT32 scrolly, INT32 transp) -{ - UINT16 *vram = (UINT16*)src; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scrollx; - if (sx < -15) sx += 0x200; - sy -= scrolly; - if (sy < -15) sy += 0x200; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 data = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 code = (data & 0xfff) + (*tile_bank << 12); - INT32 color = (data >> 12) + coloffs; - - if (transp) { - if (!(code&0xfff)) continue; - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0;offs < 0x400;offs += 4) - { - INT32 sprite = BURN_ENDIAN_SWAP_INT16(ram[offs + 1]) & 0x7fff; - if (!sprite) continue; - - INT32 y = BURN_ENDIAN_SWAP_INT16(ram[offs]); - if ((y & 0x1000) && (GetCurrentFrame() & 1)) continue; // flash - - INT32 x = BURN_ENDIAN_SWAP_INT16(ram[offs + 2]); - INT32 color = (x >>9) & 0xf; - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi = (1 << ((y & 0x0600) >> 9)) - 1; - - x &= 0x01ff; - y &= 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - y = (240 - y) - 7; - x = (304 - x) - 5; - - INT32 inc = -1; - - if (!fy) - { - sprite += multi; - inc = 1; - } - - while (multi >= 0) - { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sprite - multi * inc, x, y - 16 * multi, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sprite - multi * inc, x, y - 16 * multi, color, 4, 0, 0, DrvGfxROM1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sprite - multi * inc, x, y - 16 * multi, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sprite - multi * inc, x, y - 16 * multi, color, 4, 0, 0, DrvGfxROM1); - } - } - - multi--; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - UINT16 *pal = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x300; i++) { - r = (BURN_ENDIAN_SWAP_INT16(pal[i]) >> 10) & 0x1f; - g = (BURN_ENDIAN_SWAP_INT16(pal[i]) >> 5) & 0x1f; - b = (BURN_ENDIAN_SWAP_INT16(pal[i]) >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - } - - draw_layer(DrvBgRAM, 0x20, *bg_scroll_x, *bg_scroll_y, 0); - draw_layer(DrvFgRAM, 0x10, *fg_scroll_x, *fg_scroll_y, 1); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = DrvInputs[1] = 0xffff; - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - DrvInputs[2] = (DrvDips[1] << 8) | DrvDips[0]; - } - - INT32 nTotalCycles[2] = { 7159090 / 60, 3579545 / 60 }; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekRun(nTotalCycles[0]); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - BurnTimerEndFrameYM3812(nTotalCycles[1]); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - } - - return 0; -} - - -// Cross Pang - -static struct BurnRomInfo crospangRomDesc[] = { - { "p1.bin", 0x20000, 0x0bcbbaad, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "p2.bin", 0x20000, 0x0947d204, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "s1.bin", 0x10000, 0xd61a224c, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "s2.bin", 0x20000, 0x9f9ecd22, 3 | BRF_SND }, // 3 Oki Samples - - { "rom1.bin", 0x40000, 0x905042bb, 4 | BRF_GRA }, // 4 Background Tiles - { "rom2.bin", 0x40000, 0xbc4381e9, 4 | BRF_GRA }, // 5 - - { "rom3.bin", 0x80000, 0xcc6e1fce, 5 | BRF_GRA }, // 6 Sprites - { "rom4.bin", 0x80000, 0x9a91d494, 5 | BRF_GRA }, // 7 - { "rom5.bin", 0x80000, 0x53a34dc5, 5 | BRF_GRA }, // 8 - { "rom6.bin", 0x80000, 0x9c633082, 5 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(crospang) -STD_ROM_FN(crospang) - -static INT32 crospangInit() -{ - return DrvInit(crospangLoadRoms); -} - -struct BurnDriver BurnDrvCrospang = { - "crospang", NULL, NULL, NULL, "1998", - "Cross Pang\0", NULL, "F2 System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, crospangRomInfo, crospangRomName, NULL, NULL, CrospangInputInfo, CrospangDIPInfo, - crospangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; - - -// Heuk Sun Baek Sa (Korea) - -static struct BurnRomInfo heuksunRomDesc[] = { - { "ua02.j3", 0x80000, 0xdb2b9c8e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ua03.j5", 0x80000, 0xde9f01e8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "us02.r4", 0x10000, 0xc7cc05fa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "us08.u7", 0x40000, 0xae177589, 3 | BRF_SND }, // 3 Oki Samples - - { "uc07.t11", 0x80000, 0x4d1ed885, 4 | BRF_GRA }, // 4 Background Tiles - { "uc08.r11", 0x80000, 0x242cee69, 4 | BRF_GRA }, // 5 - - { "ud14.p11", 0x40000, 0x4fc2b574, 5 | BRF_GRA }, // 6 Sprites - { "ud15.m11", 0x40000, 0x1d6187a6, 5 | BRF_GRA }, // 7 - { "ud16.l11", 0x40000, 0xeabec43e, 5 | BRF_GRA }, // 8 - { "ud17.j11", 0x40000, 0xc6b04171, 5 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(heuksun) -STD_ROM_FN(heuksun) - -static INT32 heuksunInit() -{ - return DrvInit(heuksunLoadRoms); -} - -struct BurnDriver BurnDrvHeuksun = { - "heuksun", NULL, NULL, NULL, "199?", - "Heuk Sun Baek Sa (Korea)\0", NULL, "Oksan / F2 System", "Miscellaneous", - L"\uD751\uC120\uBC31\uC0AC (Korea)\0Heuk Sun Baek Sa\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, heuksunRomInfo, heuksunRomName, NULL, NULL, CrospangInputInfo, HeuksunDIPInfo, - heuksunInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; - - -// Bestri (Korea) - -static struct BurnRomInfo bestriRomDesc[] = { - { "ua02.i3", 0x80000, 0x9e94023d, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ua03.i5", 0x80000, 0x08cfa8d8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "us02.p3", 0x10000, 0xc7cc05fa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "us08.q7", 0x40000, 0x85d8f3de, 3 | BRF_SND }, // 3 Oki Samples - - { "uc07 p12", 0x80000, 0x3d299954, 4 | BRF_GRA }, // 4 Background Tiles - { "uc08.m12", 0x80000, 0x2fc0c30e, 4 | BRF_GRA }, // 5 - { "uc29.k12", 0x80000, 0x0260c321, 4 | BRF_GRA }, // 6 - { "uc28.n12", 0x80000, 0x9938be27, 4 | BRF_GRA }, // 7 - - { "ud14.j12", 0x80000, 0x141c696e, 5 | BRF_GRA }, // 8 Sprites - { "ud15.h12", 0x80000, 0x7c04adc0, 5 | BRF_GRA }, // 9 - { "ud16.g12", 0x80000, 0x3282ea76, 5 | BRF_GRA }, // 10 - { "ud17.e12", 0x80000, 0x3a3a3f1a, 5 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(bestri) -STD_ROM_FN(bestri) - -static INT32 bestriInit() -{ - bestri = 1; - - return DrvInit(bestriLoadRoms); -} - -struct BurnDriver BurnDrvBestri = { - "bestri", NULL, NULL, NULL, "1998", - "Bestri (Korea)\0", NULL, "F2 System", "Miscellaneous", - L"Bestri\0\uBCA0\uC2A4\uD2B8\uB77C\uC774 (Korea)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, bestriRomInfo, bestriRomName, NULL, NULL, CrospangInputInfo, BestriDIPInfo, - bestriInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_crshrace.cpp b/jan/src/burn/drv/pst90s/d_crshrace.cpp deleted file mode 100644 index 39c22f5d4..000000000 --- a/jan/src/burn/drv/pst90s/d_crshrace.cpp +++ /dev/null @@ -1,891 +0,0 @@ -// FB Alpha Lethal Crash Race driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2610.h" - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[4]; -static UINT16 DrvInputs[6]; -static UINT8 DrvReset; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvVidRAM2; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvSprRAM2; -static UINT8 *DrvSprBuf1a; -static UINT8 *DrvSprBuf2a; -static UINT8 *DrvSprBuf1b; -static UINT8 *DrvSprBuf2b; -static UINT8 *DrvZ80RAM; -static UINT16 *DrvGfxCtrl; -static UINT16 *DrvBgTmp; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 *nSoundBank; -static UINT8 *pending_command; -static UINT8 *roz_bank; -static UINT8 *gfx_priority; -static UINT8 *soundlatch; -static UINT8 *flipscreen; - -static struct BurnInputInfo CrshraceInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 11, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 9, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 12, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy1 + 10, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 7, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p3 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 15, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 14, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Region", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Crshrace) - -static struct BurnDIPInfo CrshraceDIPList[]= -{ - {0x1e, 0xff, 0xff, 0xff, NULL }, - {0x1f, 0xff, 0xff, 0xff, NULL }, - {0x20, 0xff, 0xff, 0xff, NULL }, - {0x21, 0xff, 0xff, 0x01, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x1e, 0x01, 0x01, 0x01, "Off" }, -// {0x1e, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1e, 0x01, 0x02, 0x00, "Off" }, - {0x1e, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x1e, 0x01, 0x04, 0x04, "Off" }, - {0x1e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1e, 0x01, 0x08, 0x08, "Off" }, - {0x1e, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1e, 0x01, 0xc0, 0x80, "Easy" }, - {0x1e, 0x01, 0xc0, 0xc0, "Normal" }, - {0x1e, 0x01, 0xc0, 0x40, "Hard" }, - {0x1e, 0x01, 0xc0, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Coin Slot" }, - {0x1f, 0x01, 0x01, 0x01, "Same" }, - {0x1f, 0x01, 0x01, 0x00, "Individual" }, - - // Coinage condition: Coin Slot Individual - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x1f, 0x02, 0x0e, 0x0a, "3 Coins 1 Credit" }, - {0x1f, 0x00, 0x01, 0x00, NULL}, - {0x1f, 0x02, 0x0e, 0x0c, "2 Coins 1 Credit" }, - {0x1f, 0x00, 0x01, 0x00, NULL}, - {0x1f, 0x02, 0x0e, 0x0e, "1 Coin 1 Credit" }, - {0x1f, 0x00, 0x01, 0x00, NULL}, - {0x1f, 0x02, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x1f, 0x00, 0x01, 0x00, NULL}, - {0x1f, 0x02, 0x0e, 0x06, "1 Coin 3 Credits" }, - {0x1f, 0x00, 0x01, 0x00, NULL}, - {0x1f, 0x02, 0x0e, 0x04, "1 Coin 4 Credits" }, - {0x1f, 0x00, 0x01, 0x00, NULL}, - {0x1f, 0x02, 0x0e, 0x02, "1 Coin 5 Credits" }, - {0x1f, 0x00, 0x01, 0x00, NULL}, - {0x1f, 0x02, 0x0e, 0x00, "1 Coin 6 Credits" }, - {0x1f, 0x00, 0x01, 0x00, NULL}, - - // Coin A condition: Coin Slot Same - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x1f, 0x02, 0x0e, 0x0a, "3 Coins 1 Credit" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x0e, 0x0c, "2 Coins 1 Credit" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x0e, 0x0e, "1 Coin 1 Credit" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x0e, 0x06, "1 Coin 3 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x0e, 0x04, "1 Coin 4 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x0e, 0x02, "1 Coin 5 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x0e, 0x00, "1 Coin 6 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - - // Coin B condition: Coin Slot Same - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x1f, 0x02, 0x70, 0x50, "3 Coins 1 Credit" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x70, 0x40, "1 Coin 2 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x70, 0x30, "1 Coin 3 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x70, 0x20, "1 Coin 4 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x70, 0x10, "1 Coin 5 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - {0x1f, 0x02, 0x70, 0x00, "1 Coin 6 Credits" }, - {0x1f, 0x00, 0x01, 0x01, NULL}, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x1f, 0x01, 0x80, 0x80, "Off" }, - {0x1f, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Reset on P.O.S.T. Error" }, - {0x20, 0x01, 0x80, 0x00, "No" }, - {0x20, 0x01, 0x80, 0x80, "Yes" }, - - {0 , 0xfe, 0 , 5, "Country" }, - {0x21, 0x01, 0x0f, 0x01, "World" }, - {0x21, 0x01, 0x0f, 0x08, "USA & Canada" }, - {0x21, 0x01, 0x0f, 0x00, "Japan" }, - {0x21, 0x01, 0x0f, 0x02, "Korea" }, - {0x21, 0x01, 0x0f, 0x04, "Hong Kong & Taiwan" }, -}; - -STDDIPINFO(Crshrace) - -static void crshrace_drawtile(INT32 offset) -{ - INT32 sx = (offset & 0x3f) << 4; - INT32 sy = (offset >> 6) << 4; - - INT32 code = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvVidRAM1 + (offset << 1)))); - INT32 color = code >> 12; - code = (code & 0xfff) | (*roz_bank << 12); - color = (color << 4) | 0x100; - - UINT8 *src = DrvGfxROM1 + (code << 8); - UINT16 *dst = DrvBgTmp + (sy << 10) + sx; - - for (INT32 y = 0; y < 16; y++) { - for (INT32 x = 0; x < 16; x++) { - INT32 pxl = *src++; - if (pxl == 0x0f) pxl = ~0; - - dst[x] = BURN_ENDIAN_SWAP_INT16(pxl | color); - } - dst += 1024; - } -} - -void __fastcall crshrace_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0xfff020 && address <= 0xfff03f) { // K053936_0_ctrl - DrvGfxCtrl[(address & 0x1f)/2] = BURN_ENDIAN_SWAP_INT16(data); - return; - } - - if ((address & 0xfffe000) == 0xd00000) { - *((UINT16*)(DrvVidRAM1 + (address & 0x1ffe))) = BURN_ENDIAN_SWAP_INT16(data); - crshrace_drawtile((address & 0x1ffe)/2); - return; - } -} - -void __fastcall crshrace_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffe000) == 0xd00000) { - DrvVidRAM1[(address & 0x1fff) ^ 1] = data; - crshrace_drawtile((address & 0x1ffe)/2); - return; - } - - switch (address) - { - case 0xffc001: - *roz_bank = data; - return; - - case 0xfff001: - *gfx_priority = data & 0xdf; - *flipscreen = data & 0x20; - return; - - case 0xfff009: - *pending_command = 1; - *soundlatch = data; - ZetNmi(); - return; - } -} - -UINT16 __fastcall crshrace_read_word(UINT32) -{ - return 0; -} - -UINT8 __fastcall crshrace_read_byte(UINT32 address) -{ - switch (address) - { - case 0xfff000: - return DrvInputs[0] >> 8; - - case 0xfff001: - return DrvInputs[0]; - - case 0xfff002: - return DrvInputs[1] >> 8; - - case 0xfff003: - return DrvInputs[1]; - - case 0xfff004: - return DrvDips[1]; - - case 0xfff005: - return DrvDips[0]; - - case 0xfff00b: - return DrvDips[2]; - - case 0xfff00f: - return DrvInputs[2]; - - case 0xfff006: - return DrvDips[3] | (*pending_command << 7); - } - - return 0; -} - -static void sound_bankswitch(INT32 bank) -{ - *nSoundBank = bank & 0x03; - INT32 nBank = (*nSoundBank & 0x03) << 15; - - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + nBank); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + nBank); -} - -void __fastcall crshrace_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - sound_bankswitch(data); - return; - - case 0x04: - *pending_command = 0; - return; - - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: - BurnYM2610Write(port & 3, data); - return; - } -} - -UINT8 __fastcall crshrace_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x04: - return *soundlatch; - - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: - return BurnYM2610Read(port & 3); - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x300000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x800000; - DrvGfxROM2 = Next; Next += 0x800000; - - DrvSndROM = Next; Next += 0x200000; - - DrvPalette = (UINT32 *)Next; Next += 0x000401 * sizeof(UINT32); - DrvBgTmp = (UINT16*)Next; Next += 0x100000 * sizeof(UINT16); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x001000; - DrvVidRAM1 = Next; Next += 0x002000; - DrvVidRAM2 = Next; Next += 0x001000; - - DrvSprRAM1 = Next; Next += 0x002000; - DrvSprRAM2 = Next; Next += 0x010000; - - DrvSprBuf1a = Next; Next += 0x002000; - DrvSprBuf2a = Next; Next += 0x010000; - DrvSprBuf1b = Next; Next += 0x002000; - DrvSprBuf2b = Next; Next += 0x010000; - - DrvZ80RAM = Next; Next += 0x000800; - - nSoundBank = Next; Next += 0x000001; - roz_bank = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - gfx_priority = Next; Next += 0x000001; - pending_command = Next; Next += 0x000001; - - DrvGfxCtrl = (UINT16*)Next; Next += 0x000010 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - memset (DrvBgTmp, 0xff, 0x200000); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2610Reset(); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[8] = { 0x000, 0x001, 0x002, 0x003 }; - INT32 XOffs[16] = { 0x004, 0x000, 0x00c, 0x008, 0x014, 0x010, 0x01c, 0x018, - 0x024, 0x020, 0x02c, 0x028, 0x034, 0x030, 0x03c, 0x038 }; - INT32 YOffs[16] = { 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, - 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x300000; i++) { - tmp[i^1] = (DrvGfxROM1[i] << 4) | (DrvGfxROM1[i] >> 4); - } - - GfxDecode(0x6000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x400000); - - GfxDecode(0x8000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x0000000, 0, 1)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0100000, 1, 1)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0200000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 9, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 10, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x0100000, 11, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KROM + 0x100000, 0x300000, 0x3fffff, MAP_ROM); - SekMapMemory(Drv68KROM + 0x200000, 0x400000, 0x4fffff, MAP_ROM); - SekMapMemory(Drv68KROM + 0x200000, 0x500000, 0x5fffff, MAP_ROM); - SekMapMemory(DrvSprRAM2, 0xa00000, 0xa0ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0xd00000, 0xd01fff, MAP_ROM); - SekMapMemory(DrvSprRAM1, 0xe00000, 0xe01fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xfe0000, 0xfeffff, MAP_RAM); - SekMapMemory(DrvVidRAM2, 0xffd000, 0xffdfff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xffe000, 0xffefff, MAP_RAM); - SekSetWriteWordHandler(0, crshrace_write_word); - SekSetWriteByteHandler(0, crshrace_write_byte); - SekSetReadWordHandler(0, crshrace_read_word); - SekSetReadByteHandler(0, crshrace_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x77ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x77ff, 2, DrvZ80ROM); - ZetMapArea(0x7800, 0x7fff, 0, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 1, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 2, DrvZ80RAM); - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + 0x10000); - ZetMapArea(0x8000, 0xffff, 1, DrvZ80ROM + 0x10000); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + 0x10000); - ZetSetOutHandler(crshrace_sound_out); - ZetSetInHandler(crshrace_sound_in); - ZetClose(); - - INT32 DrvSndROMLen = 0x100000; - BurnYM2610Init(8000000, DrvSndROM + 0x100000, &DrvSndROMLen, DrvSndROM, &DrvSndROMLen, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2610Exit(); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - INT32 offs = 0; - UINT16 *sprbuf1 = (UINT16*)DrvSprBuf1a; - UINT16 *sprbuf2 = (UINT16*)DrvSprBuf2a; - - static const INT32 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 }; - - while (offs < 0x0400 && (BURN_ENDIAN_SWAP_INT16(sprbuf1[offs]) & 0x4000) == 0) - { - INT32 attr_start = 4 * (BURN_ENDIAN_SWAP_INT16(sprbuf1[offs++]) & 0x03ff); - - INT32 ox = BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 1]) & 0x01ff; - INT32 xsize = (BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 1]) & 0x0e00) >> 9; - INT32 zoomx = (BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 1]) & 0xf000) >> 12; - INT32 oy = BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 0]) & 0x01ff; - INT32 ysize = (BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 0]) & 0x0e00) >> 9; - INT32 zoomy = (BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 0]) & 0xf000) >> 12; - INT32 flipx = BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 2]) & 0x4000; - INT32 flipy = BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 2]) & 0x8000; - INT32 color = (BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 2]) & 0x1f00) >> 8; - INT32 map_start = BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 3]) & 0x7fff; - - zoomx = 16 - zoomtable[zoomx]/8; - zoomy = 16 - zoomtable[zoomy]/8; - - if (BURN_ENDIAN_SWAP_INT16(sprbuf1[attr_start + 2]) & 0x20ff) color = 1; // what?? mame_rand? why? - - for (INT32 y = 0;y <= ysize;y++) - { - INT32 sx,sy; - - if (flipy) sy = ((oy + zoomy * (ysize - y) + 16) & 0x1ff) - 16; - else sy = ((oy + zoomy * y + 16) & 0x1ff) - 16; - - for (INT32 x = 0;x <= xsize;x++) - { - if (flipx) - sx = ((ox + zoomx * (xsize - x) + 16) & 0x1ff) - 16; - else - sx = ((ox + zoomx * x + 16) & 0x1ff) - 16; - - INT32 code = BURN_ENDIAN_SWAP_INT16(sprbuf2[map_start & 0x7fff]) & 0x7fff; - map_start++; - - RenderZoomedTile(pTransDraw, DrvGfxROM2, code, (color << 4) | 0x200, 0x0f, sx, sy, flipx, flipy, 16, 16, zoomx << 12, zoomy << 12); - } - } - } -} - -static void draw_background() -{ - UINT16 *vram = (UINT16*)DrvVidRAM2; - - for (INT32 offs = 0; offs < 64*28; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - if (sx >= 320) continue; - - INT32 sy = (offs >> 6) << 3; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]) & 0x3fff; - if (code == 0) continue; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy, 0, 4, 0xff, 0, DrvGfxROM0); - } -} - -static inline void copy_roz(UINT32 startx, UINT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy) -{ - UINT16 *dst = pTransDraw; - UINT16 *src = DrvBgTmp; - - for (INT32 sy = 0; sy < nScreenHeight; sy++, startx+=incyx, starty+=incyy) - { - UINT32 cx = startx; - UINT32 cy = starty; - - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++) - { - INT32 p = BURN_ENDIAN_SWAP_INT16(src[(((cy >> 16) & 0x3ff) * 1024) + ((cx >> 16) & 0x3ff)]); - - if (p != 0xffff) { - *dst = p; - } - } - } -} - -static void draw_foreground() -{ - UINT16 *ctrl = DrvGfxCtrl; - - UINT32 startx,starty; - INT32 incxx,incxy,incyx,incyy; - - startx = 256 * (INT16)(BURN_ENDIAN_SWAP_INT16(ctrl[0x00])); - starty = 256 * (INT16)(BURN_ENDIAN_SWAP_INT16(ctrl[0x01])); - incyx = (INT16)(BURN_ENDIAN_SWAP_INT16(ctrl[0x02])); - incyy = (INT16)(BURN_ENDIAN_SWAP_INT16(ctrl[0x03])); - incxx = (INT16)(BURN_ENDIAN_SWAP_INT16(ctrl[0x04])); - incxy = (INT16)(BURN_ENDIAN_SWAP_INT16(ctrl[0x05])); - - if (BURN_ENDIAN_SWAP_INT16(ctrl[0x06]) & 0x4000) { incyx *= 256; incyy *= 256; } - if (BURN_ENDIAN_SWAP_INT16(ctrl[0x06]) & 0x0040) { incxx *= 256; incxy *= 256; } - - startx -= -21 * incyx; - starty -= -21 * incyy; - - startx -= -48 * incxx; - starty -= -48 * incxy; - - copy_roz(startx << 5, starty << 5, incxx << 5, incxy << 5, incyx << 5, incyy << 5); -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x400; i++) { - r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x1f; - g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 10) & 0x1f; - b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 5) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - DrvPalette[0x400] = 0; - } - - if (*gfx_priority & 0x04) - { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x400; - } - - BurnTransferCopy(DrvPalette); - - return 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x01ff; - } - - switch (*gfx_priority & 0xfb) - { - case 0x00: - draw_sprites(); - draw_background(); - draw_foreground(); - break; - - case 0x01: - case 0x02: - draw_background(); - draw_foreground(); - draw_sprites(); - break; - - default: - break; - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 6 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[3] = (DrvDips[0]) | (DrvDips[1] << 8); - DrvInputs[4] = DrvDips[2]; - DrvInputs[5] = (DrvDips[3] << 8); - } - - INT32 nCyclesTotal[2] = { 16000000 / 60, 4000000 / 60 }; - - SekOpen(0); - ZetOpen(0); - - SekRun(nCyclesTotal[0]); - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - // double buffer sprites - memcpy (DrvSprBuf1b, DrvSprBuf1a, 0x002000); - memcpy (DrvSprBuf1a, DrvSprRAM1, 0x002000); - memcpy (DrvSprBuf2b, DrvSprBuf2a, 0x010000); - memcpy (DrvSprBuf2a, DrvSprRAM2, 0x010000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - for (INT32 i = 0; i < 0x1000; i++) { - crshrace_drawtile(i); - } - - ZetOpen(0); - sound_bankswitch(*nSoundBank); - ZetClose(); - } - - return 0; -} - - -// Lethal Crash Race (set 1) - -static struct BurnRomInfo crshraceRomDesc[] = { - { "1", 0x080000, 0x21e34fb7, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "w21", 0x100000, 0xa5df7325, 1 | BRF_PRG | BRF_ESS }, // 1 - { "w22", 0x100000, 0xfc9d666d, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "2", 0x020000, 0xe70a900f, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "h895", 0x100000, 0x36ad93c3, 3 | BRF_GRA }, // 4 Background Tiles - - { "w18", 0x100000, 0xb15df90d, 4 | BRF_GRA }, // 5 Foreground Tiles - { "w19", 0x100000, 0x28326b93, 4 | BRF_GRA }, // 6 - { "w20", 0x100000, 0xd4056ad1, 4 | BRF_GRA }, // 7 - - { "h897", 0x200000, 0xe3230128, 5 | BRF_GRA }, // 8 Sprites - { "h896", 0x200000, 0xfff60233, 5 | BRF_GRA }, // 9 - - { "h894", 0x100000, 0xd53300c1, 6 | BRF_SND }, // 10 YM2610 Samples - { "h893", 0x100000, 0x32513b63, 6 | BRF_SND }, // 11 -}; - -STD_ROM_PICK(crshrace) -STD_ROM_FN(crshrace) - -struct BurnDriver BurnDrvCrshrace = { - "crshrace", NULL, NULL, NULL, "1993", - "Lethal Crash Race (set 1)\0", NULL, "Video System Co.", "Miscellaneous", - L"Lethal Crash Race\0\u7206\u70C8 \u30AF\u30E9\u30C3\u30B7\u30E5 \u30EC\u30FC\u30B9 (set 1)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, crshraceRomInfo, crshraceRomName, NULL, NULL, CrshraceInputInfo, CrshraceDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x401, - 224, 320, 3, 4 -}; - - -// Lethal Crash Race (set 2) - -static struct BurnRomInfo crshrace2RomDesc[] = { - { "01-ic10.bin", 0x080000, 0xb284aacd, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "w21", 0x100000, 0xa5df7325, 1 | BRF_PRG | BRF_ESS }, // 1 - { "w22", 0x100000, 0xfc9d666d, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "2", 0x020000, 0xe70a900f, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "h895", 0x100000, 0x36ad93c3, 3 | BRF_GRA }, // 4 Background Tiles - - { "w18", 0x100000, 0xb15df90d, 4 | BRF_GRA }, // 5 Foreground Tiles - { "w19", 0x100000, 0x28326b93, 4 | BRF_GRA }, // 6 - { "w20", 0x100000, 0xd4056ad1, 4 | BRF_GRA }, // 7 - - { "h897", 0x200000, 0xe3230128, 5 | BRF_GRA }, // 8 Sprites - { "h896", 0x200000, 0xfff60233, 5 | BRF_GRA }, // 9 - - { "h894", 0x100000, 0xd53300c1, 6 | BRF_SND }, // 10 YM2610 Samples - { "h893", 0x100000, 0x32513b63, 6 | BRF_SND }, // 11 -}; - -STD_ROM_PICK(crshrace2) -STD_ROM_FN(crshrace2) - -struct BurnDriver BurnDrvCrshrace2 = { - "crshrace2", "crshrace", NULL, NULL, "1993", - "Lethal Crash Race (set 2)\0", NULL, "Video System Co.", "Miscellaneous", - L"Lethal Crash Race\0\u7206\u70C8 \u30AF\u30E9\u30C3\u30B7\u30E5 \u30EC\u30FC\u30B9 (set 2)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, crshrace2RomInfo, crshrace2RomName, NULL, NULL, CrshraceInputInfo, CrshraceDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x401, - 224, 320, 3, 4 -}; - diff --git a/jan/src/burn/drv/pst90s/d_dcon.cpp b/jan/src/burn/drv/pst90s/d_dcon.cpp deleted file mode 100644 index 2b2874496..000000000 --- a/jan/src/burn/drv/pst90s/d_dcon.cpp +++ /dev/null @@ -1,806 +0,0 @@ -// FB Alpha D-Con / SD Gundam Psycho Salamander no Kyoui driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "seibusnd.h" - -static UINT8 *AllMem; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvMgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvTxRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 *scroll; - -static INT32 gfx_bank; -static INT32 gfx_enable; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT16 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 is_sdgndmps = 0; - -static struct BurnInputInfo DconInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 12, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dcon) - -static struct BurnDIPInfo DconDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Dcon) - -static struct BurnDIPInfo SdgndmpsDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xdf, NULL }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0x0f, 0x04, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "5 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x02, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0xf0, 0x40, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x20, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x20, 0x20, "No" }, - {0x13, 0x01, 0x20, 0x00, "Yes" }, - -}; - -STDDIPINFO(Sdgndmps) - -void __fastcall dcon_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff0) == 0x0a0000) { - seibu_main_word_write(address & 0xf, data); - return; - } - - if ((address & 0xfff800) == 0x09d000) { - gfx_bank = (data & 1) << 12; - return; - } - - if ((address & 0xfffff0) == 0x0c0020) { - scroll[(address & 0x0f) >> 1] = data; - return; - } - - if (address == 0x0c001c) { - gfx_enable = data; - return; - } -} - -UINT16 __fastcall dcon_main_read_word(UINT32 address) -{ - if ((address & 0xfffff0) == 0x0a0000) { - return seibu_main_word_read(address & 0xf); - } - - switch (address) - { - case 0x0e0000: - return (DrvDips[1] << 8) | DrvDips[0]; - - case 0x0e0002: - return DrvInputs[1]; - - case 0x0e0004: - return DrvInputs[2]; - } - - if (address == 0x0c001c) { - return gfx_enable; - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x00000, 0x00004, 0x80000, 0x80004 }; - INT32 XOffs0[8] = { 0x003, 0x002, 0x001, 0x000, 0x00b, 0x00a, 0x009, 0x008 }; - INT32 YOffs0[8] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070 }; - - INT32 Plane1[4] = { 0x008, 0x00c, 0x000, 0x004 }; - INT32 XOffs1[16] = { 0x003, 0x002, 0x001, 0x000, 0x013, 0x012, 0x011, 0x010, - 0x203, 0x202, 0x201, 0x200, 0x213, 0x212, 0x211, 0x210 }; - INT32 YOffs1[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x020000); - - GfxDecode(0x1000, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x80000); - - GfxDecode(0x1000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM3); - - memcpy (tmp, DrvGfxROM4, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM4); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - seibu_sound_reset(); - - gfx_bank = 0; - gfx_enable = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - SeibuZ80ROM = Next; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROM3 = Next; Next += 0x200000; - DrvGfxROM4 = Next; Next += 0x400000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x000800; - DrvMgRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x000800; - DrvTxRAM = Next; Next += 0x001000; - Drv68KRAM = Next; Next += 0x00c000; - DrvPalRAM = Next; Next += 0x001000; - - scroll = (UINT16*)Next; Next += 0x000010; - - SeibuZ80RAM = Next; - DrvZ80RAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - memcpy (DrvZ80ROM + 0x10000, DrvZ80ROM + 0x08000, 0x08000); - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x08000, 0x08000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x010000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 9, 1)) return 1; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "sdgndmps")) { - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x100000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 12, 1)) return 1; - - is_sdgndmps = 1; - } else { - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x080000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x100000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x180000, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 14, 1)) return 1; - } - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x08bfff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x08c000, 0x08c7ff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x08c800, 0x08cfff, MAP_RAM); - SekMapMemory(DrvMgRAM, 0x08d000, 0x08d7ff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x08d800, 0x08e7ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x08e800, 0x08f7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x08f800, 0x08ffff, MAP_RAM); - SekSetWriteWordHandler(0, dcon_main_write_word); - SekSetReadWordHandler(0, dcon_main_read_word); - SekClose(); - - seibu_sound_init(is_sdgndmps, 0, 3579545, 3579545, 1320000/132); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - SekExit(); - - seibu_sound_exit(); - - BurnFree (AllMem); - - is_sdgndmps = 0; - - return 0; -} - -static void draw_txt_layer(INT32 scrollx, INT32 scrolly) -{ - UINT16 *vram = (UINT16*)DrvTxRAM; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 color = code >> 12; - code &= 0xfff; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0x700, DrvGfxROM0); - } -} - -static void draw_layer(UINT8 *ram, UINT8 *gfx, INT32 col, INT32 scrollx, INT32 scrolly, INT32 trans, INT32 bank) -{ - scrollx &= 0x1ff; - scrolly &= 0x1ff; - - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scrollx; - if (sx < -15) sx += 512; - sy -= scrolly; - if (sy < -15) sy += 512; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 color = (code >> 12) & 0x0f; - code &= 0xfff; - code |= bank; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - if (trans) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, col, gfx); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, col, gfx); - } - } -} - -static inline void draw_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 fx, INT32 fy) -{ - if (sx < -15 || sy < -15 || sx >= nScreenWidth || sy >= nScreenHeight) return; - - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0, DrvGfxROM4); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0, DrvGfxROM4); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0, DrvGfxROM4); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0xf, 0, DrvGfxROM4); - } - } -} - -static void draw_sprites(INT32 priority, INT32 yoffset) -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0x400; offs >= 0; offs -= 4) - { - INT32 attr = BURN_ENDIAN_SWAP_INT16(ram[offs]); - if (~attr & 0x8000) continue; - - INT32 sprite = BURN_ENDIAN_SWAP_INT16(ram[offs+1]); - - INT32 prio = (sprite >> 14) & 3; - if (prio != priority) continue; - - sprite &= 0x3fff; - - INT32 y = BURN_ENDIAN_SWAP_INT16(ram[offs+3]); - INT32 x = BURN_ENDIAN_SWAP_INT16(ram[offs+2]); - - if (x & 0x8000) x = 0 - (0x200 - (x & 0x1ff)); - else x &= 0x1ff; - if (y & 0x8000) y = 0 - (0x200 - (y & 0x1ff)); - else y &= 0x1ff; - - INT32 color = attr & 0x003f; - INT32 fx = attr & 0x4000; - INT32 fy = attr & 0x2000; - INT32 dy = ((attr & 0x0380) >> 7) + 1; - INT32 dx = ((attr & 0x1c00) >> 10) + 1; - - y -= yoffset; - - for (INT32 ax = 0; ax < dx; ax++) - { - for (INT32 ay = 0; ay < dy; ay++) - { - if (!fx && !fy) - { - draw_sprite(sprite, color, x+ax*16, y+ay*16, fx, fy); - draw_sprite(sprite, color, x+ax*16, y+ay*16 + 512, fx, fy); - draw_sprite(sprite, color, x+ax*16, y+ay*16 - 512, fx, fy); - } - else if (fx && !fy) - { - draw_sprite(sprite, color, x+(dx-1-ax)*16, y+ay*16, fx, fy); - draw_sprite(sprite, color, x+(dx-1-ax)*16, y+ay*16 + 512, fx, fy); - draw_sprite(sprite, color, x+(dx-1-ax)*16, y+ay*16 - 512, fx, fy); - } - else if (!fx && fy) - { - draw_sprite(sprite, color, x+ax*16, y+(dy-1-ay)*16, fx, fy); - draw_sprite(sprite, color, x+ax*16, y+(dy-1-ay)*16 + 512, fx, fy); - draw_sprite(sprite, color, x+ax*16, y+(dy-1-ay)*16 - 512, fx, fy); - } - else - { - draw_sprite(sprite, color, x+(dx-1-ax)*16, y+(dy-1-ay)*16, fx, fy); - draw_sprite(sprite, color, x+(dx-1-ax)*16, y+(dy-1-ay)*16 + 512, fx, fy); - draw_sprite(sprite, color, x+(dx-1-ax)*16, y+(dy-1-ay)*16 - 512, fx, fy); - } - - sprite++; - sprite &= 0x3fff; - } - } - } -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x1000/2; i++) { - INT32 d = BURN_ENDIAN_SWAP_INT16(p[i]); - - b = (d >> 10) & 0x1f; - g = (d >> 5) & 0x1f; - r = (d >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void DrvDraw(INT32 xoffset, INT32 yoffset) -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - if (~gfx_enable & 1) { - draw_layer(DrvBgRAM, DrvGfxROM1, 0x400, scroll[0] + xoffset, scroll[1] + yoffset, 0, 0); - } else { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) - pTransDraw[i] = 0x0f; - } - - draw_sprites(2, yoffset); - - if (~gfx_enable & 2) draw_layer(DrvMgRAM, DrvGfxROM3, 0x500, scroll[2] + xoffset, scroll[3] + yoffset, 1, gfx_bank); - - draw_sprites(1, yoffset); - - if (~gfx_enable & 4) draw_layer(DrvFgRAM, DrvGfxROM2, 0x600, scroll[4] + xoffset, scroll[5] + yoffset, 1, 0); - - draw_sprites(0, yoffset); - - draw_txt_layer(xoffset, yoffset); - - draw_sprites(3, yoffset); - - BurnTransferCopy(DrvPalette); -} - -static INT32 DconDraw() -{ - DrvDraw(0, 0); - - return 0; -} - -static INT32 SdgndmpsDraw() -{ - DrvDraw(128, 16); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - seibu_coin_input = (DrvJoy1[1] << 1) | DrvJoy1[0]; - } - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nTotalCycles[2] = { 10000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - if (is_sdgndmps) - { - for (INT32 i = 0; i < nInterleave; i++) - { - SekRun(nTotalCycles[0] / nInterleave); - ZetRun(nTotalCycles[1] / nInterleave); - - if (i == 240) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - seibu_sound_update(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - } - else - { - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nTotalCycles[0] / nInterleave; - - nCyclesDone[0] += SekRun(nSegment); - - BurnTimerUpdateYM3812((i + 1) * (nTotalCycles[1] / nInterleave)); - - if (i == nInterleave-1) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - BurnTimerEndFrameYM3812(nTotalCycles[1]); - } - - if (pBurnSoundOut && !is_sdgndmps) { - seibu_sound_update(pBurnSoundOut, nBurnSoundLen); - } else { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - seibu_sound_update(pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029706; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - seibu_sound_scan(pnMin, nAction); - - SCAN_VAR(gfx_bank); - SCAN_VAR(gfx_enable); - } - - return 0; -} - - -// D-Con - -static struct BurnRomInfo dconRomDesc[] = { - { "p0-0", 0x020000, 0xa767ec15, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "p0-1", 0x020000, 0xa7efa091, 1 | BRF_PRG | BRF_ESS }, // 1 - { "p1-0", 0x020000, 0x3ec1ef7d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "p1-1", 0x020000, 0x4b8de320, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "fmsnd", 0x010000, 0x50450faa, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "fix0", 0x010000, 0xab30061f, 3 | BRF_GRA }, // 5 Characters - { "fix1", 0x010000, 0xa0582115, 3 | BRF_GRA }, // 6 - - { "bg1", 0x080000, 0xeac43283, 4 | BRF_GRA }, // 7 Background Tiles - - { "bg3", 0x080000, 0x1408a1e0, 5 | BRF_GRA }, // 8 Foreground Tiles - - { "bg2", 0x080000, 0x01864eb6, 6 | BRF_GRA }, // 9 Midground Tiles - - { "obj0", 0x080000, 0xc3af37db, 7 | BRF_GRA }, // 10 Sprites - { "obj1", 0x080000, 0xbe1f53ba, 7 | BRF_GRA }, // 11 - { "obj2", 0x080000, 0x24e0b51c, 7 | BRF_GRA }, // 12 - { "obj3", 0x080000, 0x5274f02d, 7 | BRF_GRA }, // 13 - - { "pcm", 0x020000, 0xd2133b85, 8 | BRF_SND }, // 14 OKIM6295 Samples -}; - -STD_ROM_PICK(dcon) -STD_ROM_FN(dcon) - -struct BurnDriver BurnDrvDcon = { - "dcon", NULL, NULL, NULL, "1992", - "D-Con\0", NULL, "Success", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, dconRomInfo, dconRomName, NULL, NULL, DconInputInfo, DconDIPInfo, - DrvInit, DrvExit, DrvFrame, DconDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; - - -// SD Gundam Psycho Salamander no Kyoui - -static struct BurnRomInfo sdgndmpsRomDesc[] = { - { "911-a01.25", 0x020000, 0x3362915d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "911-a02.29", 0x020000, 0xfbc78285, 1 | BRF_PRG | BRF_ESS }, // 1 - { "911-a03.27", 0x020000, 0x6c24b4f2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "911-a04.28", 0x020000, 0x6ff9d716, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "911-a05.010", 0x010000, 0x90455406, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "911-a08.66", 0x010000, 0xe7e04823, 3 | BRF_GRA }, // 5 Characters - { "911-a07.73", 0x010000, 0x6f40d4a9, 3 | BRF_GRA }, // 6 - - { "911-a12.63", 0x080000, 0x8976bbb6, 4 | BRF_GRA }, // 7 Background Tiles - - { "911-a11.65", 0x080000, 0x3f3b7810, 5 | BRF_GRA }, // 8 Foreground Tiles - - { "911-a13.64", 0x100000, 0xf38a584a, 6 | BRF_GRA }, // 9 Midground Tiles - - { "911-a10.73", 0x100000, 0x80e341fb, 7 | BRF_GRA }, // 10 Sprites - { "911-a09.74", 0x100000, 0x98f34519, 7 | BRF_GRA }, // 11 - - { "911-a06.97", 0x040000, 0x12c79440, 8 | BRF_SND }, // 12 OKIM6295 Samples - - { "bnd-007.88", 0x000200, 0x96f7646e, 0 | BRF_OPT }, // 13 Priority Prom (not used) -}; - -STD_ROM_PICK(sdgndmps) -STD_ROM_FN(sdgndmps) - -static INT32 SdgndmpsInit() -{ - INT32 nRet = DrvInit(); - - if (nRet == 0) - { - // Patch out protection? - *((UINT16 *)(Drv68KROM + 0x04de)) = 0x4245; - *((UINT16 *)(Drv68KROM + 0x04e0)) = 0x4e71; - *((UINT16 *)(Drv68KROM + 0x04e2)) = 0x4e71; - *((UINT16 *)(Drv68KROM + 0x1356)) = 0x4e71; - *((UINT16 *)(Drv68KROM + 0x1358)) = 0x4e71; - } - - return nRet; -} - -struct BurnDriver BurnDrvSdgndmps = { - "sdgndmps", NULL, NULL, NULL, "1991", - "SD Gundam Psycho Salamander no Kyoui\0", NULL, "Banpresto / Bandai", "Miscellaneous", - L"\u30AC\u30F3\u30C0\u30E0 \u30B5\u30A4\u30B3\u30B5\u30E9\u30DE\uF303\u30C0\u30FC\u306E\u8105\u5A01\0SD Gundam Psycho Salamander no Kyoui\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, sdgndmpsRomInfo, sdgndmpsRomName, NULL, NULL, DconInputInfo, SdgndmpsDIPInfo, - SdgndmpsInit, DrvExit, DrvFrame, SdgndmpsDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_ddragon3.cpp b/jan/src/burn/drv/pst90s/d_ddragon3.cpp deleted file mode 100644 index 421476acf..000000000 --- a/jan/src/burn/drv/pst90s/d_ddragon3.cpp +++ /dev/null @@ -1,2157 +0,0 @@ -// FB Alpha Double Dragon 3 driver module -// Based on MAME driver by Bryan McPhail, David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[4] = {0, 0, 0, 0}; -static UINT8 DrvInput[4] = {0x00, 0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvMSM6295ROMSrc = NULL; -static UINT8 *DrvFgVideoRam = NULL; -static UINT8 *DrvBgVideoRam = NULL; -static UINT8 *DrvZ80Rom = NULL; -static UINT8 *DrvZ80Ram = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT16 DrvBgTileBase; -static UINT16 DrvBgScrollX; -static UINT16 DrvBgScrollY; -static UINT16 DrvFgScrollX; -static UINT16 DrvFgScrollY; -static UINT16 DrvVReg; -static UINT8 DrvSoundLatch; -static UINT8 DrvOkiBank; -static UINT8 DrvVBlank; - -typedef void (*Render)(); -static Render DrawFunction; -static void DrvDraw(); -static void CtribeDraw(); - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo DrvInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort2 + 6, "p2 fire 3" }, - - {"P3 Start" , BIT_DIGITAL , DrvInputPort3 + 7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , DrvInputPort3 + 2, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , DrvInputPort3 + 3, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , DrvInputPort3 + 1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , DrvInputPort3 + 0, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , DrvInputPort3 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , DrvInputPort3 + 5, "p3 fire 2" }, - {"P3 Fire 3" , BIT_DIGITAL , DrvInputPort3 + 6, "p3 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort1 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, DrvDip + 2 , "dip" }, - {"Dip 4" , BIT_DIPSWITCH, DrvDip + 3 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = DrvInput[3] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - DrvInput[3] |= (DrvInputPort3[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[2]); - DrvClearOpposites(&DrvInput[3]); -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x1c, 0xff, 0xff, 0xff, NULL }, - {0x1d, 0xff, 0xff, 0xff, NULL }, - {0x1e, 0xff, 0xff, 0xff, NULL }, - {0x1f, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x1c, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x1c, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x1c, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x1c, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Continue Discount" }, - {0x1c, 0x01, 0x10, 0x10, "Off" }, - {0x1c, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1c, 0x01, 0x20, 0x00, "Off" }, - {0x1c, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1c, 0x01, 0x40, 0x40, "Off" }, - {0x1c, 0x01, 0x40, 0x00, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1d, 0x01, 0x03, 0x02, "Easy" }, - {0x1d, 0x01, 0x03, 0x03, "Normal" }, - {0x1d, 0x01, 0x03, 0x01, "Hard" }, - {0x1d, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Player vs Player Damage"}, - {0x1d, 0x01, 0x04, 0x04, "Off" }, - {0x1d, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x1d, 0x01, 0x10, 0x10, "Off" }, - {0x1d, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Stage Clear Energy" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "50" }, - - {0 , 0xfe, 0 , 2 , "Starting Energy" }, - {0x1d, 0x01, 0x40, 0x00, "200" }, - {0x1d, 0x01, 0x40, 0x40, "230" }, - - {0 , 0xfe, 0 , 2 , "Number of Players" }, - {0x1d, 0x01, 0x80, 0x80, "2" }, - {0x1d, 0x01, 0x80, 0x00, "3" }, -}; - -STDDIPINFO(Drv) - -static struct BurnDIPInfo DrvbDIPList[]= -{ - // Default Values - {0x1c, 0xff, 0xff, 0x10, NULL }, - {0x1d, 0xff, 0xff, 0xff, NULL }, - {0x1e, 0xff, 0xff, 0xff, NULL }, - {0x1f, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1c, 0x01, 0x10, 0x10, "Off" }, - {0x1c, 0x01, 0x10, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x1d, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x1d, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x1d, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x1d, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Continue Discount" }, - {0x1d, 0x01, 0x10, 0x10, "Off" }, - {0x1d, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1e, 0x01, 0x03, 0x02, "Easy" }, - {0x1e, 0x01, 0x03, 0x03, "Normal" }, - {0x1e, 0x01, 0x03, 0x01, "Hard" }, - {0x1e, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Player vs Player Damage"}, - {0x1e, 0x01, 0x04, 0x04, "Off" }, - {0x1e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x1e, 0x01, 0x10, 0x10, "Off" }, - {0x1e, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Stage Clear Energy" }, - {0x1e, 0x01, 0x20, 0x00, "Off" }, - {0x1e, 0x01, 0x20, 0x20, "50" }, - - // Dip 4 - {0 , 0xfe, 0 , 2 , "Starting Energy" }, - {0x1f, 0x01, 0x01, 0x00, "200" }, - {0x1f, 0x01, 0x01, 0x01, "230" }, - - {0 , 0xfe, 0 , 2 , "Number of Players" }, - {0x1f, 0x01, 0x02, 0x02, "2" }, - {0x1f, 0x01, 0x02, 0x00, "3" }, -}; - -STDDIPINFO(Drvb) - -static struct BurnDIPInfo CtribeDIPList[]= -{ - // Default Values - {0x1c, 0xff, 0xff, 0x10, NULL }, - {0x1d, 0xff, 0xff, 0xff, NULL }, - {0x1e, 0xff, 0xff, 0xff, NULL }, - {0x1f, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1c, 0x01, 0x10, 0x10, "Off" }, - {0x1c, 0x01, 0x10, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x1d, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x1d, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x1d, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x1d, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Continue Discount" }, - {0x1d, 0x01, 0x10, 0x10, "Off" }, - {0x1d, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1e, 0x01, 0x03, 0x02, "Easy" }, - {0x1e, 0x01, 0x03, 0x03, "Normal" }, - {0x1e, 0x01, 0x03, 0x01, "Hard" }, - {0x1e, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Timer Speed" }, - {0x1e, 0x01, 0x04, 0x04, "Normal" }, - {0x1e, 0x01, 0x04, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "FBI Logo" }, - {0x1e, 0x01, 0x08, 0x00, "Off" }, - {0x1e, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x1e, 0x01, 0x10, 0x10, "Off" }, - {0x1e, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Stage Clear Energy" }, - {0x1e, 0x01, 0x20, 0x20, "0" }, - {0x1e, 0x01, 0x20, 0x00, "50" }, - - // Dip 4 - {0 , 0xfe, 0 , 2 , "More Stage Clear Energy"}, - {0x1f, 0x01, 0x01, 0x01, "Off" }, - {0x1f, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Number of Players" }, - {0x1f, 0x01, 0x02, 0x02, "2" }, - {0x1f, 0x01, 0x02, 0x00, "3" }, -}; - -STDDIPINFO(Ctribe) - -static struct BurnRomInfo DrvRomDesc[] = { - { "30a14-0.ic78", 0x40000, 0xf42fe016, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "30a15-0.ic79", 0x20000, 0xad50e92c, BRF_ESS | BRF_PRG }, // 1 - - { "30a13-0.ic43", 0x10000, 0x1e974d9b, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "30j-7.ic4", 0x40000, 0x89d58d32, BRF_GRA }, // 3 Tiles - { "30j-6.ic5", 0x40000, 0x9bf1538e, BRF_GRA }, // 4 - { "30j-5.ic6", 0x40000, 0x8f671a62, BRF_GRA }, // 5 - { "30j-4.ic7", 0x40000, 0x0f74ea1c, BRF_GRA }, // 6 - - { "30j-3.ic9", 0x80000, 0xb3151871, BRF_GRA }, // 7 Sprites - { "30a12-0.ic8", 0x10000, 0x20d64bea, BRF_GRA }, // 8 - { "30j-2.ic11", 0x80000, 0x41c6fb08, BRF_GRA }, // 9 - { "30a11-0.ic10", 0x10000, 0x785d71b0, BRF_GRA }, // 10 - { "30j-1.ic13", 0x80000, 0x67a6f114, BRF_GRA }, // 11 - { "30a10-0.ic12", 0x10000, 0x15e43d12, BRF_GRA }, // 12 - { "30j-0.ic15", 0x80000, 0xf15dafbe, BRF_GRA }, // 13 - { "30a9-0.ic14", 0x10000, 0x5a47e7a4, BRF_GRA }, // 14 - - { "30j-8.ic73", 0x80000, 0xc3ad40f3, BRF_SND }, // 15 Samples - - { "mb7114h.ic38", 0x00100, 0x113c7443, BRF_GRA }, // 16 PROM -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvjRomDesc[] = { - { "30j15.ic78", 0x40000, 0x40618cbc, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "30j14.ic79", 0x20000, 0x96827e80, BRF_ESS | BRF_PRG }, // 1 - - { "30j13.ic43", 0x10000, 0x1e974d9b, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "30j-7.ic4", 0x40000, 0x89d58d32, BRF_GRA }, // 3 Tiles - { "30j-6.ic5", 0x40000, 0x9bf1538e, BRF_GRA }, // 4 - { "30j-5.ic6", 0x40000, 0x8f671a62, BRF_GRA }, // 5 - { "30j-4.ic7", 0x40000, 0x0f74ea1c, BRF_GRA }, // 6 - - { "30j-3.ic9", 0x80000, 0xb3151871, BRF_GRA }, // 7 Sprites - { "30j12-0.ic8", 0x10000, 0x1e9290d7, BRF_GRA }, // 8 - { "30j-2.ic11", 0x80000, 0x41c6fb08, BRF_GRA }, // 9 - { "30j11-0.ic10", 0x10000, 0x99195b2a, BRF_GRA }, // 10 - { "30j-1.ic13", 0x80000, 0x67a6f114, BRF_GRA }, // 11 - { "30j10-0.ic12", 0x10000, 0xe3879b5d, BRF_GRA }, // 12 - { "30j-0.ic15", 0x80000, 0xf15dafbe, BRF_GRA }, // 13 - { "30j9-0.ic14", 0x10000, 0x2759ae84, BRF_GRA }, // 14 - - { "30j-8.ic73", 0x80000, 0xc3ad40f3, BRF_SND }, // 15 Samples - - { "mb7114h.ic38", 0x00100, 0x113c7443, BRF_GRA }, // 16 PROM -}; - -STD_ROM_PICK(Drvj) -STD_ROM_FN(Drvj) - -static struct BurnRomInfo DrvpRomDesc[] = { - { "30a14-0.ic80", 0x40000, 0xf42fe016, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "30a15-0.ic79", 0x20000, 0xad50e92c, BRF_ESS | BRF_PRG }, // 1 - - { "30a13-0.ic43", 0x10000, 0x1e974d9b, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "14.ic45", 0x20000, 0xb036a27b, BRF_GRA }, // 3 Tiles - { "15.ic46", 0x20000, 0x24d0bf41, BRF_GRA }, // 4 - { "30.ic13", 0x20000, 0x72fe2b16, BRF_GRA }, // 5 - { "31.ic14", 0x20000, 0xab48a0c8, BRF_GRA }, // 6 - { "23.ic29", 0x20000, 0x0768fedd, BRF_GRA }, // 7 - { "24.ic30", 0x20000, 0xec9db18a, BRF_GRA }, // 8 - { "21.ic25", 0x20000, 0x902744b9, BRF_GRA }, // 9 - { "22.ic26", 0x20000, 0x5b142d4d, BRF_GRA }, // 10 - - { "9.ic39", 0x20000, 0x726c49b7, BRF_GRA }, // 11 Sprites - { "10.ic40", 0x20000, 0x37a1c335, BRF_GRA }, // 12 - { "11.ic41", 0x20000, 0x2bcfe63c, BRF_GRA }, // 13 - { "12.ic42", 0x20000, 0xb864cf17, BRF_GRA }, // 14 - { "4.ic33", 0x20000, 0x8c71eb06, BRF_GRA }, // 15 - { "5.ic34", 0x20000, 0x3e134be9, BRF_GRA }, // 16 - { "6.ic35", 0x20000, 0xb4115ef0, BRF_GRA }, // 17 - { "7.ic36", 0x20000, 0x4639333d, BRF_GRA }, // 18 - { "16.ic19", 0x20000, 0x04420cc8, BRF_GRA }, // 19 - { "17.ic20", 0x20000, 0x33f97b2f, BRF_GRA }, // 20 - { "18.ic21", 0x20000, 0x0f9a8f2a, BRF_GRA }, // 21 - { "19.ic22", 0x20000, 0x15c91772, BRF_GRA }, // 22 - { "25.ic3", 0x20000, 0x894734b3, BRF_GRA }, // 23 - { "26.ic4", 0x20000, 0xcd504584, BRF_GRA }, // 24 - { "27.ic5", 0x20000, 0x38e8a9ad, BRF_GRA }, // 25 - { "28.ic6", 0x20000, 0x80c1cb74, BRF_GRA }, // 26 - { "30a12-0.ic43", 0x20000, 0x91da004c, BRF_GRA }, // 27 - { "30a11-0.ic37", 0x20000, 0x5f419232, BRF_GRA }, // 28 - { "30a10-0.ic23", 0x20000, 0x12f641ba, BRF_GRA }, // 29 - { "30a9-0.ic7", 0x20000, 0x9199a77b, BRF_GRA }, // 30 - - { "2.ic73", 0x40000, 0x3af21dbe, BRF_SND }, // 31 Samples - { "3.ic74", 0x40000, 0xc28b53cd, BRF_SND }, // 32 - - { "30.ic38", 0x00100, 0x113c7443, BRF_GRA }, // 33 PROM -}; - -STD_ROM_PICK(Drvp) -STD_ROM_FN(Drvp) - -static struct BurnRomInfo DrvbRomDesc[] = { - { "dd3.01", 0x20000, 0x68321d8b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "dd3.03", 0x20000, 0xbc05763b, BRF_ESS | BRF_PRG }, // 1 - { "dd3.02", 0x20000, 0x38d9ae75, BRF_ESS | BRF_PRG }, // 2 - - { "dd3.06", 0x10000, 0x1e974d9b, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "dd3.f", 0x40000, 0x89d58d32, BRF_GRA }, // 4 Tiles - { "dd3.e", 0x40000, 0x9bf1538e, BRF_GRA }, // 5 - { "dd3.b", 0x40000, 0x8f671a62, BRF_GRA }, // 6 - { "dd3.a", 0x40000, 0x0f74ea1c, BRF_GRA }, // 7 - - { "dd3.3e", 0x20000, 0x726c49b7, BRF_GRA }, // 8 Sprites - { "dd3.3d", 0x20000, 0x37a1c335, BRF_GRA }, // 9 - { "dd3.3c", 0x20000, 0x2bcfe63c, BRF_GRA }, // 10 - { "dd3.3b", 0x20000, 0xb864cf17, BRF_GRA }, // 11 - { "dd3.3a", 0x10000, 0x20d64bea, BRF_GRA }, // 12 - { "dd3.2e", 0x20000, 0x8c71eb06, BRF_GRA }, // 13 - { "dd3.2d", 0x20000, 0x3e134be9, BRF_GRA }, // 14 - { "dd3.2c", 0x20000, 0xb4115ef0, BRF_GRA }, // 15 - { "dd3.2b", 0x20000, 0x4639333d, BRF_GRA }, // 16 - { "dd3.2a", 0x10000, 0x785d71b0, BRF_GRA }, // 17 - { "dd3.1e", 0x20000, 0x04420cc8, BRF_GRA }, // 18 - { "dd3.1d", 0x20000, 0x33f97b2f, BRF_GRA }, // 19 - { "dd3.1c", 0x20000, 0x0f9a8f2a, BRF_GRA }, // 20 - { "dd3.1b", 0x20000, 0x15c91772, BRF_GRA }, // 21 - { "dd3.1a", 0x10000, 0x15e43d12, BRF_GRA }, // 22 - { "dd3.0e", 0x20000, 0x894734b3, BRF_GRA }, // 23 - { "dd3.0d", 0x20000, 0xcd504584, BRF_GRA }, // 24 - { "dd3.0c", 0x20000, 0x38e8a9ad, BRF_GRA }, // 25 - { "dd3.0b", 0x20000, 0x80c1cb74, BRF_GRA }, // 26 - { "dd3.0a", 0x10000, 0x5a47e7a4, BRF_GRA }, // 27 - - { "dd3.j7", 0x40000, 0x3af21dbe, BRF_SND }, // 28 Samples - { "dd3.j8", 0x40000, 0xc28b53cd, BRF_SND }, // 29 - - { "mb7114h.38", 0x00100, 0x113c7443, BRF_GRA }, // 30 PROM -}; - -STD_ROM_PICK(Drvb) -STD_ROM_FN(Drvb) - -static struct BurnRomInfo CtribeRomDesc[] = { - { "28a16-2.ic26", 0x20000, 0xc46b2e63, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "28a15-2.ic25", 0x20000, 0x3221c755, BRF_ESS | BRF_PRG }, // 1 - { "28j17-0.104", 0x10000, 0x8c2c6dbd, BRF_ESS | BRF_PRG }, // 2 - - { "28a10-0.ic89", 0x08000, 0x4346de13, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "28j7-0.ic11", 0x40000, 0xa8b773f1, BRF_GRA }, // 4 Tiles - { "28j6-0.ic13", 0x40000, 0x617530fc, BRF_GRA }, // 5 - { "28j5-0.ic12", 0x40000, 0xcef0a821, BRF_GRA }, // 6 - { "28j4-0.ic14", 0x40000, 0xb84fda09, BRF_GRA }, // 7 - - { "28j3-0.ic77", 0x80000, 0x1ac2a461, BRF_GRA }, // 8 Sprites - { "28a14-0.ic60", 0x10000, 0x972faddb, BRF_GRA }, // 9 - { "28j2-0.ic78", 0x80000, 0x8c796707, BRF_GRA }, // 10 - { "28a13-0.ic61", 0x10000, 0xeb3ab374, BRF_GRA }, // 11 - { "28j1-0.ic97", 0x80000, 0x1c9badbd, BRF_GRA }, // 12 - { "28a12-0.ic85", 0x10000, 0xc602ac97, BRF_GRA }, // 13 - { "28j0-0.ic98", 0x80000, 0xba73c49e, BRF_GRA }, // 14 - { "28a11-0.ic86", 0x10000, 0x4da1d8e5, BRF_GRA }, // 15 - - { "28j9-0.ic83", 0x20000, 0xf92a7f4a, BRF_SND }, // 16 Samples - { "28j8-0.ic82", 0x20000, 0x1a3a0b39, BRF_SND }, // 17 - - { "28.ic44", 0x00100, 0x964329ef, BRF_GRA }, // 18 PROM -}; - -STD_ROM_PICK(Ctribe) -STD_ROM_FN(Ctribe) - -static struct BurnRomInfo Ctribe1RomDesc[] = { - { "1_28a16-2.ic26",0x20000, 0xf00f8443, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "1_28a15-2.ic25",0x20000, 0xdd70079f, BRF_ESS | BRF_PRG }, // 1 - { "28j17-0.104", 0x10000, 0x8c2c6dbd, BRF_ESS | BRF_PRG }, // 2 - - { "28a10-0.ic89", 0x08000, 0x4346de13, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "28j7-0.ic11", 0x40000, 0xa8b773f1, BRF_GRA }, // 4 Tiles - { "28j6-0.ic13", 0x40000, 0x617530fc, BRF_GRA }, // 5 - { "28j5-0.ic12", 0x40000, 0xcef0a821, BRF_GRA }, // 6 - { "28j4-0.ic14", 0x40000, 0xb84fda09, BRF_GRA }, // 7 - - { "28j3-0.ic77", 0x80000, 0x1ac2a461, BRF_GRA }, // 8 Sprites - { "28a14-0.ic60", 0x10000, 0x972faddb, BRF_GRA }, // 9 - { "28j2-0.ic78", 0x80000, 0x8c796707, BRF_GRA }, // 10 - { "28a13-0.ic61", 0x10000, 0xeb3ab374, BRF_GRA }, // 11 - { "28j1-0.ic97", 0x80000, 0x1c9badbd, BRF_GRA }, // 12 - { "28a12-0.ic85", 0x10000, 0xc602ac97, BRF_GRA }, // 13 - { "28j0-0.ic98", 0x80000, 0xba73c49e, BRF_GRA }, // 14 - { "28a11-0.ic86", 0x10000, 0x4da1d8e5, BRF_GRA }, // 15 - - { "28j9-0.ic83", 0x20000, 0xf92a7f4a, BRF_SND }, // 16 Samples - { "28j8-0.ic82", 0x20000, 0x1a3a0b39, BRF_SND }, // 17 - - { "28.ic44", 0x00100, 0x964329ef, BRF_GRA }, // 18 PROM -}; - -STD_ROM_PICK(Ctribe1) -STD_ROM_FN(Ctribe1) - -static struct BurnRomInfo CtribeoRomDesc[] = { - // only main program code differs from ctribe1 set - { "28a16-1.ic26", 0x20000, 0xd108f36f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "28a15-1.ic25", 0x20000, 0x3f5693a3, BRF_ESS | BRF_PRG }, // 1 - { "28j17-0.104", 0x10000, 0x8c2c6dbd, BRF_ESS | BRF_PRG }, // 2 - - { "28a10-0.ic89", 0x08000, 0x4346de13, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "28j7-0.ic11", 0x40000, 0xa8b773f1, BRF_GRA }, // 4 Tiles - { "28j6-0.ic13", 0x40000, 0x617530fc, BRF_GRA }, // 5 - { "28j5-0.ic12", 0x40000, 0xcef0a821, BRF_GRA }, // 6 - { "28j4-0.ic14", 0x40000, 0xb84fda09, BRF_GRA }, // 7 - - { "28j3-0.ic77", 0x80000, 0x1ac2a461, BRF_GRA }, // 8 Sprites - { "28a14-0.ic60", 0x10000, 0x972faddb, BRF_GRA }, // 9 - { "28j2-0.ic78", 0x80000, 0x8c796707, BRF_GRA }, // 10 - { "28a13-0.ic61", 0x10000, 0xeb3ab374, BRF_GRA }, // 11 - { "28j1-0.ic97", 0x80000, 0x1c9badbd, BRF_GRA }, // 12 - { "28a12-0.ic85", 0x10000, 0xc602ac97, BRF_GRA }, // 13 - { "28j0-0.ic98", 0x80000, 0xba73c49e, BRF_GRA }, // 14 - { "28a11-0.ic86", 0x10000, 0x4da1d8e5, BRF_GRA }, // 15 - - { "28j9-0.ic83", 0x20000, 0xf92a7f4a, BRF_SND }, // 16 Samples - { "28j8-0.ic82", 0x20000, 0x1a3a0b39, BRF_SND }, // 17 - - { "28.ic44", 0x00100, 0x964329ef, BRF_GRA }, // 18 PROM -}; - -STD_ROM_PICK(Ctribeo) -STD_ROM_FN(Ctribeo) - -static struct BurnRomInfo CtribejRomDesc[] = { - { "28j16-02.26", 0x20000, 0x658b8568, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "28j15-12.25", 0x20000, 0x50aac7e7, BRF_ESS | BRF_PRG }, // 1 - { "28j17-0.104", 0x10000, 0x8c2c6dbd, BRF_ESS | BRF_PRG }, // 2 - - { "28j10-0.89", 0x08000, 0x4346de13, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "28j7-0.ic11", 0x40000, 0xa8b773f1, BRF_GRA }, // 4 Tiles - { "28j6-0.ic13", 0x40000, 0x617530fc, BRF_GRA }, // 5 - { "28j5-0.ic12", 0x40000, 0xcef0a821, BRF_GRA }, // 6 - { "28j4-0.ic14", 0x40000, 0xb84fda09, BRF_GRA }, // 7 - - { "28j3-0.ic77", 0x80000, 0x1ac2a461, BRF_GRA }, // 8 Sprites - { "28j14-0.60", 0x10000, 0x6869050a, BRF_GRA }, // 9 - { "28j2-0.ic78", 0x80000, 0x8c796707, BRF_GRA }, // 10 - { "28j13-0.61", 0x10000, 0x8b8addea, BRF_GRA }, // 11 - { "28j1-0.ic97", 0x80000, 0x1c9badbd, BRF_GRA }, // 12 - { "28j12-0.85", 0x10000, 0x422b041c, BRF_GRA }, // 13 - { "28j0-0.ic98", 0x80000, 0xba73c49e, BRF_GRA }, // 14 - { "28j11-0.86", 0x10000, 0x4a391c5b, BRF_GRA }, // 15 - - { "28j9-0.ic83", 0x20000, 0xf92a7f4a, BRF_SND }, // 16 Samples - { "28j8-0.ic82", 0x20000, 0x1a3a0b39, BRF_SND }, // 17 - - { "28.ic44", 0x00100, 0x964329ef, BRF_GRA }, // 18 PROM -}; - -STD_ROM_PICK(Ctribej) -STD_ROM_FN(Ctribej) - -static struct BurnRomInfo CtribebRomDesc[] = { - { "ct_ep1.rom", 0x20000, 0x9cfa997f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ct_ep3.rom", 0x20000, 0x2ece8681, BRF_ESS | BRF_PRG }, // 1 - { "ct_ep2.rom", 0x10000, 0x8c2c6dbd, BRF_ESS | BRF_PRG }, // 2 - - { "ct_ep4.rom", 0x08000, 0x4346de13, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "ct_mr7.rom", 0x40000, 0xa8b773f1, BRF_GRA }, // 4 Tiles - { "ct_mr6.rom", 0x40000, 0x617530fc, BRF_GRA }, // 5 - { "ct_mr5.rom", 0x40000, 0xcef0a821, BRF_GRA }, // 6 - { "ct_mr4.rom", 0x40000, 0xb84fda09, BRF_GRA }, // 7 - - { "ct_mr3.rom", 0x80000, 0x1ac2a461, BRF_GRA }, // 8 Sprites - { "ct_ep5.rom", 0x10000, 0x972faddb, BRF_GRA }, // 9 - { "ct_mr2.rom", 0x80000, 0x8c796707, BRF_GRA }, // 10 - { "ct_ep6.rom", 0x10000, 0xeb3ab374, BRF_GRA }, // 11 - { "ct_mr1.rom", 0x80000, 0x1c9badbd, BRF_GRA }, // 12 - { "ct_ep7.rom", 0x10000, 0xc602ac97, BRF_GRA }, // 13 - { "ct_mr0.rom", 0x80000, 0xba73c49e, BRF_GRA }, // 14 - { "ct_ep8.rom", 0x10000, 0x4da1d8e5, BRF_GRA }, // 15 - - { "ct_mr8.rom", 0x40000, 0x9963a6be, BRF_SND }, // 16 Samples -}; - -STD_ROM_PICK(Ctribeb) -STD_ROM_FN(Ctribeb) - -static struct BurnRomInfo Ctribeb2RomDesc[] = { - { "1.bin", 0x20000, 0x9cfa997f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "3.bin", 0x20000, 0x2ece8681, BRF_ESS | BRF_PRG }, // 1 - { "2.bin", 0x10000, 0x8c2c6dbd, BRF_ESS | BRF_PRG }, // 2 - - { "6.bin", 0x10000, 0x0101df2d, BRF_ESS | BRF_PRG }, // 3 Z80 Program - - { "7.bin", 0x40000, 0xa8b773f1, BRF_GRA }, // 4 Tiles - { "8.bin", 0x40000, 0x617530fc, BRF_GRA }, // 5 - { "11.bin", 0x40000, 0xcef0a821, BRF_GRA }, // 6 - { "12.bin", 0x40000, 0xb84fda09, BRF_GRA }, // 7 - { "9.bin", 0x20000, 0x2719d7ce, BRF_GRA }, // 8 - { "10.bin", 0x20000, 0x753a4f53, BRF_GRA }, // 9 - { "13.bin", 0x20000, 0x59e01fe1, BRF_GRA }, // 10 - { "14.bin", 0x20000, 0xa69ab4f3, BRF_GRA }, // 11 - - { "34.bin", 0x20000, 0x5b498f0e, BRF_GRA }, // 12 Sprites - { "33.bin", 0x20000, 0x14d79049, BRF_GRA }, // 13 - { "32.bin", 0x20000, 0x9631ea23, BRF_GRA }, // 14 - { "31.bin", 0x20000, 0x0ca8d3b9, BRF_GRA }, // 15 - { "30.bin", 0x10000, 0x972faddb, BRF_GRA }, // 16 - { "29.bin", 0x20000, 0x479ae8ea, BRF_GRA }, // 17 - { "28.bin", 0x20000, 0x95598bbf, BRF_GRA }, // 18 - { "27.bin", 0x20000, 0x4a3d006d, BRF_GRA }, // 19 - { "26.bin", 0x20000, 0xaa34a3cb, BRF_GRA }, // 20 - { "25.bin", 0x10000, 0xeb3ab374, BRF_GRA }, // 21 - { "24.bin", 0x20000, 0xd60bbff0, BRF_GRA }, // 22 - { "23.bin", 0x20000, 0xd9595c47, BRF_GRA }, // 23 - { "22.bin", 0x20000, 0x5a19a911, BRF_GRA }, // 24 - { "21.bin", 0x20000, 0x071360f9, BRF_GRA }, // 25 - { "20.bin", 0x10000, 0xc602ac97, BRF_GRA }, // 26 - { "19.bin", 0x20000, 0x8d22736a, BRF_GRA }, // 27 - { "18.bin", 0x20000, 0x0f157822, BRF_GRA }, // 28 - { "17.bin", 0x20000, 0x7f48c824, BRF_GRA }, // 29 - { "16.bin", 0x20000, 0xcd1e9bd5, BRF_GRA }, // 30 - { "15.bin", 0x10000, 0x4da1d8e5, BRF_GRA }, // 31 - - { "5.bin", 0x20000, 0xf92a7f4a, BRF_SND }, // 32 Samples - { "4.bin", 0x20000, 0x1a3a0b39, BRF_SND }, // 33 -}; - -STD_ROM_PICK(Ctribeb2) -STD_ROM_FN(Ctribeb2) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x80000; - DrvZ80Rom = Next; Next += 0x10000; - MSM6295ROM = Next; Next += 0x40000; - DrvMSM6295ROMSrc = Next; Next += 0x80000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x04800; - DrvZ80Ram = Next; Next += 0x00800; - DrvFgVideoRam = Next; Next += 0x01000; - DrvSpriteRam = Next; Next += 0x01000; - DrvBgVideoRam = Next; Next += 0x00800; - DrvPaletteRam = Next; Next += 0x00600; - - RamEnd = Next; - - DrvTiles = Next; Next += 8192 * 16 * 16; - DrvSprites = Next; Next += 0x4800 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00600 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - - DrvBgTileBase = 0; - DrvBgScrollX = 0; - DrvBgScrollY = 0; - DrvFgScrollX = 0; - DrvFgScrollY = 0; - DrvVReg = 0; - DrvSoundLatch = 0; - DrvOkiBank = 0; - DrvVBlank = 0; - - return 0; -} - -UINT8 __fastcall Ddragon368KReadByte(UINT32 a) -{ - switch (a) { - case 0x100000: { - return 0xff - DrvInput[2]; - } - - case 0x100001: { - return 0xff - DrvInput[0]; - } - - case 0x100003: { - return 0xff - DrvInput[1]; - } - - case 0x100007: { - return 0xff - DrvInput[3]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ddragon368KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x100003: { - DrvSoundLatch = d; - ZetOpen(0); - ZetNmi(); - nCyclesDone[1] += ZetRun(100); - ZetClose(); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Ddragon368KReadWord(UINT32 a) -{ - switch (a) { - case 0x100002: { - return (0xff << 8) | (0xff - DrvInput[1]); - } - - case 0x100004: { - return (DrvDip[1] << 8) | DrvDip[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ddragon368KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x000004: - case 0x000006: { - // ??? - return; - } - - case 0x0c0000: { - DrvFgScrollX = d & 0x1ff; - return; - } - - case 0x0c0002: { - DrvFgScrollY = d & 0x1ff; - return; - } - - case 0x0c0004: { - DrvBgScrollX = d & 0x1ff; - return; - } - - case 0x0c0006: { - DrvBgScrollY = d & 0x1ff; - return; - } - - case 0x0c0008: { - return; - } - - case 0x0c000c: { - DrvBgTileBase = d & 0x1ff; - return; - } - - case 0x100000: { - DrvVReg = d; - return; - } - - case 0x100002: { - DrvSoundLatch = d; - ZetOpen(0); - ZetNmi(); - nCyclesDone[1] += ZetRun(100); - ZetClose(); - return; - } - - case 0x100004: - case 0x100006: - case 0x100008: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Ddragon3b68KReadByte(UINT32 a) -{ - switch (a) { - case 0x180000: { - return 0xef - DrvInput[1] + (DrvDip[0] & 0x10); - } - - case 0x180001: { - return 0xff - DrvInput[0]; - } - - case 0x180002: { - return DrvDip[1]; - } - - case 0x180003: { - return 0xff - DrvInput[2]; - } - - case 0x180005: { - return 0xff - DrvInput[3]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ddragon3b68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x140003: { - DrvSoundLatch = d; - ZetOpen(0); - ZetNmi(); - nCyclesDone[1] += ZetRun(100); - ZetClose(); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Ddragon3b68KReadWord(UINT32 a) -{ - switch (a) { - case 0x180000: { - return (((0xef - DrvInput[1]) + (DrvDip[0] & 0x10)) << 8) | (0xff - DrvInput[0]); - } - - case 0x180004: { - return (DrvDip[2] << 8) | (0xff - DrvInput[3]); - } - - case 0x180006: { - return (DrvDip[3] << 8) | 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ddragon3b68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x000004: - case 0x000006: { - // ??? - return; - } - - case 0x0c0000: { - DrvFgScrollX = d & 0x1ff; - return; - } - - case 0x0c0002: { - DrvFgScrollY = d & 0x1ff; - return; - } - - case 0x0c0004: { - DrvBgScrollX = d & 0x1ff; - return; - } - - case 0x0c0006: { - DrvBgScrollY = d & 0x1ff; - return; - } - - case 0x0c0008: { - return; - } - - case 0x0c000c: { - DrvBgTileBase = d & 0x1ff; - return; - } - - case 0x140000: { - DrvVReg = d; - return; - } - - case 0x140002: { - DrvSoundLatch = d; - ZetOpen(0); - ZetNmi(); - nCyclesDone[1] += ZetRun(100); - ZetClose(); - return; - } - - case 0x140004: - case 0x140006: - case 0x140008: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Ddragon3Z80Read(UINT16 a) -{ - switch (a) { - case 0xc801: { - return BurnYM2151ReadStatus(); - } - - case 0xd800: { - return MSM6295ReadStatus(0); - } - - case 0xe000: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Ddragon3Z80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xc800: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xc801: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xd800: { - MSM6295Command(0, d); - return; - } - - case 0xe800: { - DrvOkiBank = d & 1; - memcpy(MSM6295ROM + 0x00000, DrvMSM6295ROMSrc + (0x40000 * DrvOkiBank), 0x40000); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Ctribeb68KReadByte(UINT32 a) -{ - switch (a) { - case 0x180000: { - if (DrvVBlank) return 0xe7 - DrvInput[1] + (DrvDip[0] & 0x10); - return 0xef - DrvInput[1] + (DrvDip[0] & 0x10); - } - - case 0x180001: { - return 0xff - DrvInput[0]; - } - - case 0x180003: { - return 0xff - DrvInput[2]; - } - - case 0x180004: { - return DrvDip[2]; - } - - case 0x180005: { - return 0xff - DrvInput[3]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ctribeb68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x0c000d: { - DrvBgTileBase = d; - return; - } - - case 0x140001: { - DrvVReg = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Ctribeb68KReadWord(UINT32 a) -{ - switch (a) { - case 0x180000: { - if (DrvVBlank) return ((0xe7 - DrvInput[1] + (DrvDip[0] & 0x10)) << 8) | (0xff - DrvInput[0]); - return ((0xef - DrvInput[1] + (DrvDip[0] & 0x10)) << 8) | (0xff - DrvInput[0]); - } - - case 0x180002: { - return (DrvDip[1] << 8) | (0xff - DrvInput[2]); - } - - case 0x180004: { - return (DrvDip[2] << 8) | (0xff - DrvInput[3]); - } - - case 0x180006: { - return (DrvDip[3] << 8) | 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ctribeb68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x0c0000: { - DrvFgScrollX = d & 0x1ff; - return; - } - - case 0x0c0002: { - DrvFgScrollY = d & 0x1ff; - return; - } - - case 0x0c0004: { - DrvBgScrollX = d & 0x1ff; - return; - } - - case 0x0c0006: { - DrvBgScrollY = d & 0x1ff; - return; - } - - case 0x0c0008: { - return; - } - - case 0x0c000c: { - DrvBgTileBase = d & 0x1ff; - return; - } - - case 0x140000: { - DrvVReg = d; - return; - } - - case 0x140002: { - DrvSoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - nCyclesDone[1] += ZetRun(100); - ZetClose(); - return; - } - - case 0x140004: - case 0x140006: - case 0x140008: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall CtribeZ80Read(UINT16 a) -{ - switch (a) { - case 0x8801: { - return BurnYM2151ReadStatus(); - } - - case 0x9800: { - return MSM6295ReadStatus(0); - } - - case 0xa000: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall CtribeZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x8800: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x8801: { - BurnYM2151WriteRegister(d); - return; - } - - case 0x9800: { - MSM6295Command(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 TilePlaneOffsets[4] = { 0, 0x200000, 0x400000, 0x600000 }; -static INT32 TileXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 TileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 SpritePlaneOffsets[4] = { 0, 0x800000, 0x1000000, 0x1800000 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; - -static void DrvYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - BurnSetRefreshRate(57.0); - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x400000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(8192, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x400000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x280000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x380000, 14, 1); if (nRet != 0) return 1; - GfxDecode(0x4800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 15, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvFgVideoRam , 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvBgVideoRam , 0x082000, 0x0827ff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x1405ff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x180000, 0x180fff, MAP_RAM); - SekMapMemory(Drv68KRam , 0x1c0000, 0x1c3fff, MAP_RAM); - SekSetReadWordHandler(0, Ddragon368KReadWord); - SekSetWriteWordHandler(0, Ddragon368KWriteWord); - SekSetReadByteHandler(0, Ddragon368KReadByte); - SekSetWriteByteHandler(0, Ddragon368KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Ddragon3Z80Read); - ZetSetWriteHandler(Ddragon3Z80Write); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 1.50, BURN_SND_ROUTE_BOTH); - - DrawFunction = DrvDraw; - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvpInit() -{ - INT32 nRet = 0, nLen; - - BurnSetRefreshRate(57.0); - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x400000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x020000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x060000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0a0000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c0000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0e0000, 10, 1); if (nRet != 0) return 1; - GfxDecode(8192, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x400000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x020000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x060000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x120000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x140000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x160000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x220000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x240000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x260000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x320000, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x340000, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x360000, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 28, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x280000, 29, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x380000, 30, 1); if (nRet != 0) return 1; - GfxDecode(0x4800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 31, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x40000, 32, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvFgVideoRam , 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvBgVideoRam , 0x082000, 0x0827ff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x1405ff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x180000, 0x180fff, MAP_RAM); - SekMapMemory(Drv68KRam , 0x1c0000, 0x1c3fff, MAP_RAM); - SekSetReadWordHandler(0, Ddragon368KReadWord); - SekSetWriteWordHandler(0, Ddragon368KWriteWord); - SekSetReadByteHandler(0, Ddragon368KReadByte); - SekSetWriteByteHandler(0, Ddragon368KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Ddragon3Z80Read); - ZetSetWriteHandler(Ddragon3Z80Write); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 1.50, BURN_SND_ROUTE_BOTH); - - DrawFunction = DrvDraw; - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvbInit() -{ - INT32 nRet = 0, nLen; - - BurnSetRefreshRate(57.0); - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x400000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00001, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 2, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 3, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c0000, 7, 1); if (nRet != 0) return 1; - GfxDecode(8192, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x400000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x020000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x060000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x120000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x140000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x160000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x220000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x240000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x260000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x280000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x320000, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x340000, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x360000, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x380000, 27, 1); if (nRet != 0) return 1; - GfxDecode(0x4800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 28, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x40000, 29, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvFgVideoRam , 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x081000, 0x081fff, MAP_RAM); - SekMapMemory(DrvBgVideoRam , 0x082000, 0x0827ff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x100000, 0x1005ff, MAP_RAM); - SekMapMemory(Drv68KRam , 0x1c0000, 0x1c3fff, MAP_RAM); - SekSetReadWordHandler(0, Ddragon3b68KReadWord); - SekSetWriteWordHandler(0, Ddragon3b68KWriteWord); - SekSetReadByteHandler(0, Ddragon3b68KReadByte); - SekSetWriteByteHandler(0, Ddragon3b68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Ddragon3Z80Read); - ZetSetWriteHandler(Ddragon3Z80Write); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 1.50, BURN_SND_ROUTE_BOTH); - - DrawFunction = DrvDraw; - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 CtribeInit() -{ - INT32 nRet = 0, nLen; - - BurnSetRefreshRate(57.0); - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x400000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00001, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x40000, 2, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 3, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x0c0000, 7, 1); if (nRet != 0) return 1; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "ctribeb2")) { - nRet = BurnLoadRom(DrvTempRom + 0x100000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x140000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x1c0000, 11, 1); if (nRet != 0) return 1; - } - GfxDecode(8192, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x400000); - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "ctribeb2")) { - nRet = BurnLoadRom(DrvTempRom + 0x000000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x020000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x060000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x120000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x140000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x160000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 22, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x220000, 23, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x240000, 24, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x260000, 25, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x280000, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 27, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x320000, 28, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x340000, 29, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x360000, 30, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x380000, 31, 1); if (nRet != 0) return 1; - } else { - nRet = BurnLoadRom(DrvTempRom + 0x000000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x180000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x280000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x380000, 15, 1); if (nRet != 0) return 1; - } - GfxDecode(0x4800, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, DrvTempRom, DrvSprites); - - // Load Sample Roms - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "ctribeb")) { - memset(DrvTempRom, 0, 0x400000); - nRet = BurnLoadRom(DrvTempRom, 16, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM + 0x20000, DrvTempRom + 0x00000, 0x20000); - memcpy(MSM6295ROM + 0x00000, DrvTempRom + 0x20000, 0x20000); - } else { - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "ctribeb2")) { - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 32, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x20000, 33, 1); if (nRet != 0) return 1; - } else { - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x20000, 17, 1); if (nRet != 0) return 1; - } - } - memcpy(DrvMSM6295ROMSrc, MSM6295ROM, 0x40000); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvFgVideoRam , 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x081000, 0x081fff, MAP_RAM); - SekMapMemory(DrvBgVideoRam , 0x082000, 0x0827ff, MAP_RAM); - SekMapMemory(Drv68KRam , 0x082800, 0x082fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x100000, 0x1005ff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x800 , 0x1c0000, 0x1c3fff, MAP_RAM); - SekSetReadWordHandler(0, Ctribeb68KReadWord); - SekSetWriteWordHandler(0, Ctribeb68KWriteWord); - SekSetReadByteHandler(0, Ctribeb68KReadByte); - SekSetWriteByteHandler(0, Ctribeb68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(CtribeZ80Read); - ZetSetWriteHandler(CtribeZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.20, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.20, BURN_SND_ROUTE_RIGHT); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - DrawFunction = CtribeDraw; - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - ZetExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - - GenericTilesExit(); - - DrawFunction = NULL; - - DrvBgTileBase = 0; - DrvBgScrollX = 0; - DrvBgScrollY = 0; - DrvFgScrollX = 0; - DrvFgScrollY = 0; - DrvVReg = 0; - DrvSoundLatch = 0; - DrvOkiBank = 0; - DrvVBlank = 0; - - BurnFree(Mem); - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal5bit(nColour >> 0); - g = pal5bit(nColour >> 5); - b = pal5bit(nColour >> 10); - - return BurnHighCol(r, g, b, 0); -} - -inline static UINT32 CtribeCalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 0); - g = pal4bit(nColour >> 4); - b = pal4bit(nColour >> 8); - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x600; i++, ps++, pd++) { - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*ps)); - } -} - -static void CtribeCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x600; i++, ps++, pd++) { - *pd = CtribeCalcCol(BURN_ENDIAN_SWAP_INT16(*ps)); - } -} - -static void DrvRenderBgLayer(INT32 Opaque) -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvBgVideoRam; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Code = (Attr & 0xfff) | ((DrvBgTileBase & 0x01) << 12); - Colour = ((Attr & 0xf000) >> 12); - - x = 16 * mx; - y = 16 * my; - - x -= DrvBgScrollX; - y -= DrvBgScrollY; - if (x < -16) x += 512; - if (y < -16) y += 512; - - y -= 8; - - if (Opaque) { - if (x > 16 && x < 304 && y > 16 && y < 224) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles); - } - } else { - if (x > 16 && x < 304 && y > 16 && y < 224) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 512, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 512, DrvTiles); - } - } - - TileIndex++; - } - } -} - -static void DrvRenderFgLayer(INT32 Opaque) -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, Offset, xFlip; - - UINT16 *VideoRam = (UINT16*)DrvFgVideoRam; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Offset = TileIndex * 2; - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & 0x1fff; - Colour = Attr & 0x0f; - xFlip = Attr & 0x40; - - x = 16 * mx; - y = 16 * my; - - x -= DrvFgScrollX; - y -= DrvFgScrollY; - if (x < -16) x += 512; - if (y < -16) y += 512; - - y -= 8; - - if (Opaque) { - if (x > 16 && x < 304 && y > 16 && y < 224) { - if (xFlip) { - Render16x16Tile_FlipX(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } else { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } - } else { - if (xFlip) { - Render16x16Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 256, DrvTiles); - } - } - } else { - if (x > 16 && x < 304 && y > 16 && y < 224) { - if (xFlip) { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles); - } - } else { - if (xFlip) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles); - } - } - } - - TileIndex++; - } - } -} - -static void DrvRenderSprites() -{ - UINT16 *Source = (UINT16*)DrvSpriteRam; - UINT16 *Finish = Source + 0x800; - - while (Source < Finish) { - UINT16 Attr = BURN_ENDIAN_SWAP_INT16(Source[1]); - - if (Attr & 0x01) { - INT32 i; - INT32 Bank = BURN_ENDIAN_SWAP_INT16(Source[3]) & 0xff; - INT32 Code = (BURN_ENDIAN_SWAP_INT16(Source[2]) & 0xff) + (Bank * 256); - INT32 Colour = BURN_ENDIAN_SWAP_INT16(Source[4]) & 0xf; - INT32 xFlip = Attr & 0x10; - INT32 yFlip = Attr & 0x08; - INT32 sx = BURN_ENDIAN_SWAP_INT16(Source[5]) & 0xff; - INT32 sy = BURN_ENDIAN_SWAP_INT16(Source[0]) & 0xff; - INT32 Height = (Attr >> 5) & 0x07; - - if (Attr & 0x04) sx |= 0x100; - if (Attr & 0x02) { - sy = 239 + (0x100 - sy); - } else { - sy = 240 - sy; - } - if (sx > 0x17f) sx = 0 - (0x200 - sx); - - sy -= 8; - - for (i = 0; i <= Height; i++) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code + i, sx, sy - (i * 16), Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code + i, sx, sy - (i * 16), Colour, 4, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code + i, sx, sy - (i * 16), Colour, 4, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code + i, sx, sy - (i * 16), Colour, 4, 0, 0, DrvSprites); - } - } - } - } - - Source += 8; - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - - if ((DrvVReg & 0x60) == 0x40) { - DrvRenderBgLayer(1); - DrvRenderFgLayer(0); - DrvRenderSprites(); - } else if ((DrvVReg & 0x60) == 0x60) { - DrvRenderFgLayer(1); - DrvRenderBgLayer(0); - DrvRenderSprites(); - } else { - DrvRenderBgLayer(1); - DrvRenderSprites(); - DrvRenderFgLayer(0); - } - - BurnTransferCopy(DrvPalette); -} - -static void CtribeDraw() -{ - BurnTransferClear(); - CtribeCalcPalette(); - - if (DrvVReg & 0x08) { - DrvRenderFgLayer(1); - DrvRenderSprites(); - DrvRenderBgLayer(0); - } else { - DrvRenderBgLayer(1); - DrvRenderFgLayer(0); - DrvRenderSprites(); - } - - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = 12000000 / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - DrvVBlank = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 5) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - if (i == 5) DrvVBlank = 1; - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekOpen(0); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) DrawFunction(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029674; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); // Scan Z80 - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(DrvDip); - SCAN_VAR(DrvInput); - SCAN_VAR(DrvBgTileBase); - SCAN_VAR(DrvBgScrollX); - SCAN_VAR(DrvBgScrollY); - SCAN_VAR(DrvFgScrollX); - SCAN_VAR(DrvFgScrollY); - SCAN_VAR(DrvVReg); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvOkiBank); - SCAN_VAR(DrvVBlank); - } - - if (nAction & ACB_WRITE) { - memcpy(MSM6295ROM + 0x00000, DrvMSM6295ROMSrc + (0x40000 * DrvOkiBank), 0x40000); - } - - return 0; -} - -struct BurnDriver BurnDrvDdragon3 = { - "ddragon3", NULL, NULL, NULL, "1990", - "Double Dragon 3 - The Rosetta Stone (US)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdrago3j = { - "ddragon3j", "ddragon3", NULL, NULL, "1990", - "Double Dragon 3 - The Rosetta Stone (Japan)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvjRomInfo, DrvjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdrago3p = { - "ddragon3p", "ddragon3", NULL, NULL, "1990", - "Double Dragon 3 - The Rosetta Stone (prototype)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvpRomInfo, DrvpRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvpInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDdrago3b = { - "ddragon3b", "ddragon3", NULL, NULL, "1990", - "Double Dragon 3 - The Rosetta Stone (bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, DrvbRomInfo, DrvbRomName, NULL, NULL, DrvInputInfo, DrvbDIPInfo, - DrvbInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvCtribe = { - "ctribe", NULL, NULL, NULL, "1990", - "The Combatribes (US)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, CtribeRomInfo, CtribeRomName, NULL, NULL, DrvInputInfo, CtribeDIPInfo, - CtribeInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvCtribe1 = { - "ctribe1", "ctribe", NULL, NULL, "1990", - "The Combatribes (US set 1?)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, Ctribe1RomInfo, Ctribe1RomName, NULL, NULL, DrvInputInfo, CtribeDIPInfo, - CtribeInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvCtribeo = { - "ctribeo", "ctribe", NULL, NULL, "1990", - "The Combatribes (US , older)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, CtribeoRomInfo, CtribeoRomName, NULL, NULL, DrvInputInfo, CtribeDIPInfo, - CtribeInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvCtribej = { - "ctribej", "ctribe", NULL, NULL, "1990", - "The Combatribes (Japan)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, CtribejRomInfo, CtribejRomName, NULL, NULL, DrvInputInfo, CtribeDIPInfo, - CtribeInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvCtribeb = { - "ctribeb", "ctribe", NULL, NULL, "1990", - "The Combatribes (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, CtribebRomInfo, CtribebRomName, NULL, NULL, DrvInputInfo, CtribeDIPInfo, - CtribeInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvCtribeb2 = { - "ctribeb2", "ctribe", NULL, NULL, "1990", - "The Combatribes (bootleg set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, Ctribeb2RomInfo, Ctribeb2RomName, NULL, NULL, DrvInputInfo, CtribeDIPInfo, - CtribeInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x600, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_deniam.cpp b/jan/src/burn/drv/pst90s/d_deniam.cpp deleted file mode 100644 index a4a262221..000000000 --- a/jan/src/burn/drv/pst90s/d_deniam.cpp +++ /dev/null @@ -1,999 +0,0 @@ -// FB Alpha Deniam-16 Hardware driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvTxtRAM; -static UINT32 *DrvPalette; -static INT16 *DrvTxtTable; -static INT16 *DrvLayerTable; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static INT32 nCyclesDone[2]; - -static UINT8 *soundlatch; -static UINT8 *coin_control; -static UINT8 *okibank; - -static INT32 bg_scrollx_offs; -static INT32 bg_scrolly_offs; -static INT32 fg_scrollx_offs; -static INT32 fg_scrolly_offs; -static INT32 bg_scrollx_reg; -static INT32 bg_scrolly_reg; -static INT32 bg_page_reg; -static INT32 fg_scrollx_reg; -static INT32 fg_scrolly_reg; -static INT32 fg_page_reg; - -static INT32 nGame = 0; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 5, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 4, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 7, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 6, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 5, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 4, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 7, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 6, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 2, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo KarianxDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x07, 0x02, "3 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x04, "3 Coins 2 Credits " }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x14, 0x01, 0x07, 0x06, "2 Coins 3 Credits " }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 2 Credits " }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits " }, - {0x14, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x18, 0x08, "Very Easy" }, - {0x14, 0x01, 0x18, 0x10, "Easy" }, - {0x14, 0x01, 0x18, 0x18, "Normal" }, - {0x14, 0x01, 0x18, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Music" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 1, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Karianx) - -static struct BurnDIPInfo Logicpr2DIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x07, 0x02, "3 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x04, "3 Coins 2 Credits " }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x14, 0x01, 0x07, 0x06, "2 Coins 3 Credits " }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 2 Credits " }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits " }, - {0x14, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Play Time" }, - {0x14, 0x01, 0x18, 0x08, "Slow" }, - {0x14, 0x01, 0x18, 0x18, "Normal" }, - {0x14, 0x01, 0x18, 0x10, "Fast" }, - {0x14, 0x01, 0x18, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x60, 0x20, "Easy" }, - {0x14, 0x01, 0x60, 0x60, "Normal" }, - {0x14, 0x01, 0x60, 0x40, "Hard" }, - {0x14, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Logicpr2) - -static void deniam16_set_okibank(INT32 bank) -{ - *okibank = bank; - - MSM6295ROM = DrvSndROM + (*okibank ? 0x40000 : 0x00000); -} - -UINT8 __fastcall deniam16_read_byte(UINT32 address) -{ - switch (address) - { - case 0xc40001: - return MSM6295ReadStatus(0); // logicpr2 - - case 0xc40003: - return *coin_control; - - case 0xc44001: - return DrvInputs[0] & 0xff; - - case 0xc44003: - return DrvInputs[1] & 0xff; - - case 0xc44005: - return DrvInputs[2] & 0xff; - - case 0xc4400b: - return DrvDips[0]; - } - - return 0; -} - -void __fastcall deniam16_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xc40000: - if (nGame != 2) { - *soundlatch = data; - ZetNmi(); - } - return; - - case 0xc40001: - if (nGame == 2) { - MSM6295Command(0, data); - } - return; - - case 0xc40003: - *coin_control = data; - return; - - case 0xc40007: - deniam16_set_okibank(data & 0x01); // logicpr2 - return; - - case 0xc40008: - BurnYM3812Write(0, 0, data); // logicpr2 - return; - - case 0xc4000a: - BurnYM3812Write(0, 1, data); // logicpr2 - return; - } -} - -void __fastcall deniam16_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x02: - BurnYM3812Write(0, 0, data); - return; - - case 0x03: - BurnYM3812Write(0, 1, data); - return; - - case 0x05: - MSM6295Command(0, data); - return; - - case 0x07: - deniam16_set_okibank(data & 0x40); - return; - } -} - -UINT8 __fastcall deniam16_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x01: - return *soundlatch; - - case 0x05: - return MSM6295ReadStatus(0); - } - - return 0; -} - -inline static INT32 deniam16ZetSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 6250000); -} - -inline static INT32 deniam16SekSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(SekTotalCycles() * nSoundRate / 12500000); -} - -void deniam16YM3812IrqHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM3812Reset(); - - deniam16_set_okibank(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - DrvTxtTable = (INT16*)Next; Next += 0x0800 * sizeof(INT16); - DrvLayerTable = (INT16*)Next; Next += 0x2000 * sizeof(INT16); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x000800; - DrvTxtRAM = Next; Next += 0x001000; - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x010000; - - DrvZ80RAM = Next; Next += 0x000800; - - coin_control = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - okibank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void create_offset_tables() -{ - for (INT32 offs = 0; offs < 128 * 64; offs++) - { - INT32 sx = (offs & 0x7f); - INT32 sy = (offs >> 7); - - DrvLayerTable[offs] = (sx & 0x3f) + ((sy & 0x1f) << 6) + ((sx & 0x40) << 5) + ((sy & 0x20) << 7); - } - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f); - INT32 sy = (offs >> 6); - - DrvTxtTable[offs] = (sx & 0x3f) + ((sy & 0x1f) << 6) + ((sx & 0x40) << 5) + ((sy & 0x20) << 7); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[3] = { (0x80000 * 8) * 2, (0x80000 * 8) * 1, 0 }; - INT32 XOffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x180000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x180000); - - GfxDecode(0x10000, 3, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - switch (nGame) - { - case 0: - { - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 8, 1)) return 1; - } - break; - - case 1: - { - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200001, 11, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 12, 1)) return 1; - } - break; - - case 2: - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - BurnByteswap(DrvGfxROM1, 0x400000); - - if (BurnLoadRom(DrvSndROM + 0x000000, 6, 1)) return 1; - } - break; - } - - DrvGfxDecode(); - create_offset_tables(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(DrvTxtRAM, 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x440000, 0x4407ff, MAP_WRITE); - SekMapMemory(DrvPalRAM, 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, deniam16_write_byte); - SekSetReadByteHandler(0, deniam16_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xf7ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xf7ff, 2, DrvZ80ROM); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM); - ZetSetOutHandler(deniam16_sound_out); - ZetSetInHandler(deniam16_sound_in); - ZetClose(); - - if (nGame != 2) { - BurnYM3812Init(1, 3125000, &deniam16YM3812IrqHandler, deniam16ZetSynchroniseStream, 0); - BurnTimerAttachZetYM3812(6250000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.60, BURN_SND_ROUTE_BOTH); - } else { - BurnYM3812Init(1, 3125000, NULL, deniam16SekSynchroniseStream, 0); - BurnTimerAttachSekYM3812(12500000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.60, BURN_SND_ROUTE_BOTH); - } - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM3812Exit(); - MSM6295Exit(0); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - nGame = 0; - - return 0; -} - -static void palette_write(INT32 offset) -{ - UINT8 r,g,b; - UINT16 data = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + offset))); - - r = ((data << 1) & 0x1e) | ((data >> 12) & 1); - g = ((data >> 3) & 0x1e) | ((data >> 13) & 1); - b = ((data >> 7) & 0x1e) | ((data >> 14) & 1); - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -static void draw_sprites(INT32 priority) -{ - UINT16 *source = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0;offs < 0x800/2;offs += 8) - { - if (priority != ((BURN_ENDIAN_SWAP_INT16(source[offs+4])&0xc0) >> 6)) continue; - - INT32 sx = (BURN_ENDIAN_SWAP_INT16(source[offs+1]) & 0x01ff) + 16*8 - 1; - if (sx >= 512) sx -= 512; - sx -= 192; - INT32 starty = BURN_ENDIAN_SWAP_INT16(source[offs+0]) & 0xff; - if (starty >= nScreenHeight) continue; - INT32 endy = BURN_ENDIAN_SWAP_INT16(source[offs+0]) >> 8; - if (endy >= nScreenHeight) endy = nScreenHeight-1; - - INT32 width = BURN_ENDIAN_SWAP_INT16(source[offs+2]) & 0x007f; - INT32 flipx = BURN_ENDIAN_SWAP_INT16(source[offs+2]) & 0x0100; - if (flipx) sx++; - - INT32 color = (0x40 + (BURN_ENDIAN_SWAP_INT16(source[offs+4]) & 0x3f)) << 4; - - INT32 start = BURN_ENDIAN_SWAP_INT16(source[offs+3]) + ((BURN_ENDIAN_SWAP_INT16(source[offs+4]) & 0x1f00) << 8); - UINT8 *rom = DrvGfxROM1 + start * 2; - - for (INT32 y = starty+1;y <= endy;y++) - { - INT32 drawing = 0; - INT32 i=0; - - rom += 2 * width; - INT32 x = 0; - - UINT16 *dest = pTransDraw + (y * nScreenWidth); - - while (i < 512) - { - if (flipx) - { - if ((rom[i] & 0x0f) == 0x0f) - { - if (!drawing) drawing = 1; - else break; - } - else - { - if (rom[i] & 0x0f) - { - if (sx+x >= 0 && sx+x < nScreenWidth) { - dest[(sx+x)] = color | (rom[i] & 0x0f); - } - } - x++; - } - - if ((rom[i] & 0xf0) == 0xf0) - { - if (!drawing) drawing = 1; - else break; - } - else - { - if (rom[i] & 0xf0) - { - if (sx+x >= 0 && sx+x < nScreenWidth) { - dest[(sx+x)] = color | (rom[i]>>4); - } - } - x++; - } - - i--; - } - else - { - if ((rom[i] & 0xf0) == 0xf0) - { - if (!drawing) drawing = 1; - else break; - } - else - { - if (rom[i] & 0xf0) - { - if (sx+x >= 0 && sx+x < nScreenWidth) { - dest[(sx+x)] = color | (rom[i]>>4); - } - } - x++; - } - - if ((rom[i] & 0x0f) == 0x0f) - { - if (!drawing) drawing = 1; - else break; - } - else - { - if (rom[i] & 0x0f) - { - if (sx+x >= 0 && sx+x < nScreenWidth) { - dest[(sx+x)] = color | (rom[i] & 0x0f); - } - } - x++; - } - - i++; - } - } - } - } -} - -static void draw_layer(INT32 *in_page, INT32 scrollx, INT32 scrolly, INT32 transp) -{ - UINT16 *vram = (UINT16*)DrvVidRAM; - - for (INT32 offs = 0; offs < 128 * 64; offs++) - { - INT32 sx = ((offs & 0x7f) << 3) - scrollx; - INT32 sy = ((offs >> 7) << 3) - scrolly; - - INT32 ofst = DrvLayerTable[offs]; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[in_page[ofst>>11] * 0x0800 + (ofst & 0x7ff)]); - INT32 code = attr; - if (transp && !code) continue; - INT32 color = (attr & 0x1fc0) >> 6; - - if (sx >= nScreenWidth || sy >= nScreenHeight || sy < -7 || sx < -7) continue; - - if (sx >= 0 && sx < (nScreenWidth - 7) && sy >= 0 && sy < (nScreenHeight - 7)) { - if (transp) { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } - } else { - if (transp) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM0); - } - } - } -} - -static void draw_text() -{ - UINT16 *vram = (UINT16*)DrvTxtRAM; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = ((offs & 0x3f) << 3) - 192; - INT32 sy = (offs >> 6) << 3; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[DrvTxtTable[offs]]); - INT32 code = attr & 0xf1ff; - INT32 color = (attr & 0x0e00) >> 9; - - if (sx < 0 || sy >= nScreenHeight || sx >= nScreenWidth || !code) continue; - - if (sx >= 0 && sx < (nScreenWidth - 7) && sy >= 0 && sy < (nScreenHeight - 7)) { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_write(i); - } - } - - if (~*coin_control & 0x20) return 0; - - { - INT32 pages[4]; - UINT16 *txtram = (UINT16*)DrvTxtRAM; - - // draw_sprites(0); - - INT32 bg_scrollx = (BURN_ENDIAN_SWAP_INT16(txtram[bg_scrollx_reg]) - bg_scrollx_offs) & 0x1ff; - INT32 bg_scrolly = ((BURN_ENDIAN_SWAP_INT16(txtram[bg_scrolly_reg]) & 0xff) - bg_scrolly_offs) & 0xff; - INT32 page = BURN_ENDIAN_SWAP_INT16(txtram[bg_page_reg]); - - pages[3] = (page >> 12) & 0x0f; - pages[2] = (page >> 8) & 0x0f; - pages[1] = (page >> 4) & 0x0f; - pages[0] = (page >> 0) & 0x0f; - - draw_layer(pages, bg_scrollx+192, bg_scrolly, 0); - - draw_sprites(1); - - INT32 fg_scrollx = (BURN_ENDIAN_SWAP_INT16(txtram[fg_scrollx_reg]) - fg_scrollx_offs) & 0x1ff; - INT32 fg_scrolly = ((BURN_ENDIAN_SWAP_INT16(txtram[fg_scrolly_reg]) & 0xff) - fg_scrolly_offs) & 0xff; - page = BURN_ENDIAN_SWAP_INT16(txtram[fg_page_reg]); - - pages[3] = (page >> 12) & 0x0f; - pages[2] = (page >> 8) & 0x0f; - pages[1] = (page >> 4) & 0x0f; - pages[0] = (page >> 0) & 0x0f; - - draw_layer(pages, fg_scrollx+192, fg_scrolly, 1); - - draw_sprites(2); - draw_text(); - draw_sprites(3); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - SekNewFrame(); - ZetNewFrame(); - - INT32 nInterleave = 10; - INT32 nCyclesSegment; - INT32 nCyclesTotal[2] = { 12500000 / 60, 6250000 / 60 }; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesSegment = nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] = SekRun(nCyclesSegment); - - if (nGame == 2) continue; - - nCyclesSegment = nCyclesTotal[1] / nInterleave; - - BurnTimerUpdateYM3812(i * nCyclesSegment); - } - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - if (nGame != 2) BurnTimerEndFrameYM3812(nCyclesTotal[1]); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - SCAN_VAR(nCyclesDone[0]); - SCAN_VAR(nCyclesDone[1]); - - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - deniam16_set_okibank(*okibank); - } - - return 0; -} - - -// Logic Pro (Japan) - -static struct BurnRomInfo logicproRomDesc[] = { - { "logicpro.r4", 0x40000, 0xc506d484, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "logicpro.r3", 0x40000, 0xd5a4cf62, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "logicpro.r2", 0x10000, 0x000d624b, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "logicpro.r5", 0x80000, 0xdedf18c9, 3 | BRF_GRA }, // 3 Graphics Tiles - { "logicpro.r6", 0x80000, 0x3ecbd1c2, 3 | BRF_GRA }, // 4 - { "logicpro.r7", 0x80000, 0x47135521, 3 | BRF_GRA }, // 5 - - { "logicpro.r9", 0x80000, 0xa98bc1d2, 4 | BRF_GRA }, // 6 Sprites - { "logicpro.r8", 0x80000, 0x1de46298, 4 | BRF_GRA }, // 7 - - { "logicpro.r1", 0x80000, 0xa1fec4d4, 5 | BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(logicpro) -STD_ROM_FN(logicpro) - -static INT32 logicproInit() -{ - bg_scrollx_reg = 0x00a4/2; - bg_scrolly_reg = 0x00a8/2; - bg_page_reg = 0x00ac/2; - fg_scrollx_reg = 0x00a2/2; - fg_scrolly_reg = 0x00a6/2; - fg_page_reg = 0x00aa/2; - - bg_scrollx_offs = 0x00d; - bg_scrolly_offs = 0x000; - fg_scrollx_offs = 0x009; - fg_scrolly_offs = 0x000; - - return DrvInit(); -} - -struct BurnDriver BurnDrvLogicpro = { - "logicpro", NULL, NULL, NULL, "1996", - "Logic Pro (Japan)\0", NULL, "Deniam", "Deniam-16b Hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, logicproRomInfo, logicproRomName, NULL, NULL, DrvInputInfo, Logicpr2DIPInfo, - logicproInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; - - -// Croquis (Germany) - -static struct BurnRomInfo croquisRomDesc[] = { - { "r4.bin", 0x40000, 0x03c9055e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "r3.bin", 0x40000, 0xa98ae4f6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "logicpro.r2", 0x10000, 0x000d624b, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "logicpro.r5", 0x80000, 0xdedf18c9, 3 | BRF_GRA }, // 3 Graphics Tiles - { "logicpro.r6", 0x80000, 0x3ecbd1c2, 3 | BRF_GRA }, // 4 - { "logicpro.r7", 0x80000, 0x47135521, 3 | BRF_GRA }, // 5 - - { "logicpro.r9", 0x80000, 0xa98bc1d2, 4 | BRF_GRA }, // 6 Sprites - { "logicpro.r8", 0x80000, 0x1de46298, 4 | BRF_GRA }, // 7 - - { "logicpro.r1", 0x80000, 0xa1fec4d4, 5 | BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(croquis) -STD_ROM_FN(croquis) - -struct BurnDriver BurnDrvCroquis = { - "croquis", "logicpro", NULL, NULL, "1996", - "Croquis (Germany)\0", NULL, "Deniam", "Deniam-16b Hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, croquisRomInfo, croquisRomName, NULL, NULL, DrvInputInfo, Logicpr2DIPInfo, - logicproInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; - - -// Karian Cross (Rev. 1.0) - -static struct BurnRomInfo karianxRomDesc[] = { - { "even", 0x80000, 0xfd0ce238, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "odd", 0x80000, 0xbe173cdc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "snd", 0x10000, 0xfedd3375, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "bkg1", 0x80000, 0x5cb8558a, 3 | BRF_GRA }, // 3 Graphics Tiles - { "bkg2", 0x80000, 0x95ff297c, 3 | BRF_GRA }, // 4 - { "bkg3", 0x80000, 0x6c81f1b2, 3 | BRF_GRA }, // 5 - - { "obj4", 0x80000, 0x5f8d75a9, 4 | BRF_GRA }, // 6 Sprites - { "obj1", 0x80000, 0x967ee97d, 4 | BRF_GRA }, // 7 - { "obj5", 0x80000, 0xe9fc22f9, 4 | BRF_GRA }, // 8 - { "obj2", 0x80000, 0xd39eb04e, 4 | BRF_GRA }, // 9 - { "obj6", 0x80000, 0xc1ec35a5, 4 | BRF_GRA }, // 10 - { "obj3", 0x80000, 0x6ac1ac87, 4 | BRF_GRA }, // 11 - - { "voi", 0x80000, 0xc6506a80, 5 | BRF_SND }, // 12 Samples -}; - -STD_ROM_PICK(karianx) -STD_ROM_FN(karianx) - -static INT32 karianxInit() -{ - nGame = 1; - - bg_scrollx_reg = 0x00a4/2; - bg_scrolly_reg = 0x00a8/2; - bg_page_reg = 0x00ac/2; - fg_scrollx_reg = 0x00a2/2; - fg_scrolly_reg = 0x00a6/2; - fg_page_reg = 0x00aa/2; - - bg_scrollx_offs = 0x10d; - bg_scrolly_offs = 0x080; - fg_scrollx_offs = 0x109; - fg_scrolly_offs = 0x080; - - return DrvInit(); -} - -struct BurnDriver BurnDrvKarianx = { - "karianx", NULL, NULL, NULL, "1996", - "Karian Cross (Rev. 1.0)\0", NULL, "Deniam", "Deniam-16b Hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, karianxRomInfo, karianxRomName, NULL, NULL, DrvInputInfo, KarianxDIPInfo, - karianxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; - - -// Logic Pro 2 (Japan) - -static struct BurnRomInfo logicpr2RomDesc[] = { - { "lp2-2", 0x080000, 0xcc1880bf, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "lp2-1", 0x080000, 0x46d5e954, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "log2-b01", 0x080000, 0xfe789e07, 3 | BRF_GRA }, // 2 Graphics Tiles - { "log2-b02", 0x080000, 0x1e0c51cd, 3 | BRF_GRA }, // 3 - { "log2-b03", 0x080000, 0x916f2928, 3 | BRF_GRA }, // 4 - - { "obj", 0x400000, 0xf221f305, 4 | BRF_GRA }, // 5 Sprites - - { "log2-s01", 0x100000, 0x2875c435, 5 | BRF_SND }, // 6 Samples -}; - -STD_ROM_PICK(logicpr2) -STD_ROM_FN(logicpr2) - -static INT32 logicpr2Init() -{ - nGame = 2; - - return logicproInit(); -} - -struct BurnDriver BurnDrvLogicpr2 = { - "logicpr2", NULL, NULL, NULL, "1997", - "Logic Pro 2 (Japan)\0", NULL, "Deniam", "Deniam-16c Hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, logicpr2RomInfo, logicpr2RomName, NULL, NULL, DrvInputInfo, Logicpr2DIPInfo, - logicpr2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_diverboy.cpp b/jan/src/burn/drv/pst90s/d_diverboy.cpp deleted file mode 100644 index b375a4d36..000000000 --- a/jan/src/burn/drv/pst90s/d_diverboy.cpp +++ /dev/null @@ -1,498 +0,0 @@ -// FB Alpha Diverboy driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static UINT8 *soundlatch; -static UINT8 *samplebank; - -static struct BurnInputInfo DiverboyInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"Coin 3", BIT_DIGITAL, DrvJoy2 + 2, "p3 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Diverboy) - -static struct BurnDIPInfo DiverboyDIPList[]= -{ - {0x12, 0xff, 0xff, 0xb8, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x12, 0x01, 0x07, 0x07, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x05, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x08, 0x00, "2" }, - {0x12, 0x01, 0x08, 0x08, "3" }, - - {0 , 0xfe, 0 , 2, "Display Copyright" }, - {0x12, 0x01, 0x10, 0x00, "No" }, - {0x12, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x60, 0x00, "Easy" }, - {0x12, 0x01, 0x60, 0x20, "Normal" }, - {0x12, 0x01, 0x60, 0x40, "Hard" }, - {0x12, 0x01, 0x60, 0x60, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x80, 0x80, "No" }, - {0x12, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Diverboy) - -void __fastcall diverboy_write_byte(UINT32 /*address*/, UINT8 /*data*/) -{ -} - -void __fastcall diverboy_write_word(UINT32 address, UINT16 data) -{ - if (address == 0x100000) { - *soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - return; - } -} - -UINT8 __fastcall diverboy_read_byte(UINT32 address) -{ - switch (address) - { - case 0x180000: - return DrvInputs[0] >> 8; - - case 0x180001: - return DrvInputs[0] & 0xff; - - case 0x180009: - return DrvInputs[1] & 0xf7; - } - - return 0; -} - -UINT16 __fastcall diverboy_read_word(UINT32 address) -{ - switch (address) - { - case 0x180002: - return DrvDips[0]; - - case 0x180008: - return DrvInputs[1]; - } - - return 0; -} - -static inline void sample_bank(INT32 data) -{ - *samplebank = data & 3; - - MSM6295ROM = DrvSndROM + ((data & 3) << 18); -} - -void __fastcall diverboy_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - sample_bank(data); - return; - - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall diverboy_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - return *soundlatch; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - sample_bank(0); - MSM6295Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x004000; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - samplebank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0, 1, 2, 3 }; - INT32 XOffs[16] = { 56, 60, 48, 52, 40, 44, 32, 36, 24, 28, 16, 20, 8, 12, 0, 4 }; - INT32 YOffs[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - memcpy (DrvZ80ROM, DrvZ80ROM + 0x8000, 0x8000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 9, 1)) return 1; - memcpy (DrvSndROM + 0xc0000, DrvSndROM + 0x60000, 0x20000); - memcpy (DrvSndROM + 0x80000, DrvSndROM + 0x40000, 0x20000); - memcpy (DrvSndROM + 0x40000, DrvSndROM + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM + 0x020000, 10, 1)) return 1; - memcpy (DrvSndROM + 0xe0000, DrvSndROM + 0x20000, 0x20000); - memcpy (DrvSndROM + 0xa0000, DrvSndROM + 0x20000, 0x20000); - memcpy (DrvSndROM + 0x60000, DrvSndROM + 0x20000, 0x20000); - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x040000, 0x04ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x080000, 0x083fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x140000, 0x1407ff, MAP_RAM); - SekSetWriteByteHandler(0, diverboy_write_byte); - SekSetWriteWordHandler(0, diverboy_write_word); - SekSetReadByteHandler(0, diverboy_read_byte); - SekSetReadWordHandler(0, diverboy_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(diverboy_sound_write); - ZetSetReadHandler(diverboy_sound_read); - ZetClose(); - - MSM6295Init(0, 1320000 / 132, 0); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_sprites() -{ - UINT16 *vram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x4000 / 2; offs+=8) - { - INT32 sy = ( 256 - BURN_ENDIAN_SWAP_INT16(vram[offs + 4])) - 16; - INT32 sx = ((480 - BURN_ENDIAN_SWAP_INT16(vram[offs + 0])) & 0x1ff) - 173; - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs + 1]); - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs + 3]); - INT32 color = ((attr & 0x00f0) >> 4) | ((attr & 0x000c) << 2); - INT32 flash = (attr & 0x1000); - INT32 bank = (attr & 0x0002) >> 1; - - if (flash && (GetCurrentFrame() & 1)) continue; - if (sx >= nScreenWidth || sy >= nScreenHeight || sx < -15 || sy < -15) continue; - - if (attr & 0x0008) { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, bank ? DrvGfxROM1 : DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, bank ? DrvGfxROM1 : DrvGfxROM0); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - UINT16 *pal = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x800 / 2; i++, pal++) { - r = ((BURN_ENDIAN_SWAP_INT16(*pal) << 4) & 0xf0) | ((BURN_ENDIAN_SWAP_INT16(*pal) << 0) & 0x0f); - g = ((BURN_ENDIAN_SWAP_INT16(*pal) >> 0) & 0xf0) | ((BURN_ENDIAN_SWAP_INT16(*pal) >> 4) & 0x0f); - b = ((BURN_ENDIAN_SWAP_INT16(*pal) >> 4) & 0xf0) | ((BURN_ENDIAN_SWAP_INT16(*pal) >> 8) & 0x0f); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - } - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = ~0; - DrvInputs[1] = ~8; - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 10; - INT32 nTotalCycles[2] = { 12000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i); - - nCyclesDone[0] += SekRun(nSegment); - - nSegment = (nTotalCycles[1] - nCyclesDone[1]) / (nInterleave - i); - - nCyclesDone[1] += ZetRun(nSegment); - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - MSM6295Scan(0, nAction); - - if (nAction & ACB_WRITE) { - sample_bank(*samplebank); - } - } - - return 0; -} - - -// Diver Boy - -static struct BurnRomInfo diverboyRomDesc[] = { - { "db_01.bin", 0x20000, 0x6aa11366, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "db_02.bin", 0x20000, 0x45f8a673, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "db_05.bin", 0x10000, 0xffeb49ec, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "db_08.bin", 0x80000, 0x7bb96220, 3 | BRF_GRA }, // 3 Bank 0 Graphics - { "db_09.bin", 0x80000, 0x12b15476, 3 | BRF_GRA }, // 4 - - { "db_07.bin", 0x20000, 0x18485741, 4 | BRF_GRA }, // 5 Bank 1 Graphics - { "db_10.bin", 0x20000, 0xc381d1cc, 4 | BRF_GRA }, // 6 - { "db_06.bin", 0x20000, 0x21b4e352, 4 | BRF_GRA }, // 7 - { "db_11.bin", 0x20000, 0x41d29c81, 4 | BRF_GRA }, // 8 - - { "db_03.bin", 0x80000, 0x50457505, 5 | BRF_SND }, // 9 Oki6295 Samples - { "db_04.bin", 0x20000, 0x01b81da0, 5 | BRF_SND }, // 10 -}; - -STD_ROM_PICK(diverboy) -STD_ROM_FN(diverboy) - -struct BurnDriver BurnDrvDiverboy = { - "diverboy", NULL, NULL, NULL, "1992", - "Diver Boy\0", NULL, "Electronic Devices Italy", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, diverboyRomInfo, diverboyRomName, NULL, NULL, DiverboyInputInfo, DiverboyDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_dooyong.cpp b/jan/src/burn/drv/pst90s/d_dooyong.cpp deleted file mode 100644 index 7dfca1fd4..000000000 --- a/jan/src/burn/drv/pst90s/d_dooyong.cpp +++ /dev/null @@ -1,4089 +0,0 @@ -// FB Alpha Dooyong driver module -// Based on MAME driver by Nicola Salmoria - -/* - Notes: - A seriously ugly hack has been used to get sound+music in Pollux and Gulf Storm - After 2 days of hacking, I couldn't find a better way. - Jan 9, 2015 Dink -*/ - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvGfxROM5; -static UINT8 *DrvTMapROM0; -static UINT8 *DrvTMapROM1; -static UINT8 *DrvTMapROM2; -static UINT8 *DrvTMapROM3; -static UINT8 *DrvTMapROM4; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvTxtRAM; - -static UINT8 *scrollregs[4]; -static UINT8 *sound_irq_line; -static UINT8 *z80_bank_select; -static UINT8 sprite_enable; -static UINT8 soundlatch; -static UINT8 priority_select; -static UINT8 text_layer_enable; -static UINT8 gulf_storm = 0; -static UINT8 vblank = 0; -static UINT8 pollux_gulfstrm_irq_kicker_hack = 0; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static INT32 global_y = 8; -static INT32 main_cpu_clock = 8000000; - -static INT32 gfxmask[6] = { 0, 0, 0, 0, 0, 0 }; -static UINT8 *DrvTransTab[6] = { NULL, NULL, NULL, NULL, NULL, NULL }; - - -static struct BurnInputInfo LastdayInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 2, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Lastday) - -static struct BurnInputInfo GulfstrmInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Gulfstrm) - -static struct BurnInputInfo PolluxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pollux) - -static struct BurnInputInfo BluehawkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bluehawk) - -static struct BurnInputInfo RsharkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 2, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy1 + 15, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Rshark) - -static struct BurnDIPInfo LastdayDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Type" }, - {0x13, 0x01, 0x02, 0x02, "A" }, - {0x13, 0x01, 0x02, 0x00, "B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x00, "1" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x08, "Easy" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x04, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "Every 200000" }, - {0x14, 0x01, 0x30, 0x20, "Every 240000" }, - {0x14, 0x01, 0x30, 0x10, "280000" }, - {0x14, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Speed" }, - {0x14, 0x01, 0x40, 0x00, "Low" }, - {0x14, 0x01, 0x40, 0x40, "High" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Lastday) - -static struct BurnDIPInfo GulfstrmDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Type" }, - {0x12, 0x01, 0x02, 0x02, "A" }, - {0x12, 0x01, 0x02, 0x00, "B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x30, "Every 300,000" }, - {0x13, 0x01, 0x30, 0x20, "Every 400,000" }, - {0x13, 0x01, 0x30, 0x10, "Every 500,000" }, - {0x13, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Power Rise(?)" }, - {0x13, 0x01, 0x40, 0x40, "1" }, - {0x13, 0x01, 0x40, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x80, 0x00, "No" }, - {0x13, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Gulfstrm) - -static struct BurnDIPInfo PolluxDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Type" }, - {0x12, 0x01, 0x02, 0x02, "A" }, - {0x12, 0x01, 0x02, 0x00, "B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 0, "Allow Continue" }, - {0x13, 0x01, 0x80, 0x00, "No" }, - {0x13, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Pollux) - -static struct BurnDIPInfo FlytigerDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xcf, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Type" }, - {0x12, 0x01, 0x02, 0x02, "A" }, - {0x12, 0x01, 0x02, 0x00, "B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Auto Fire" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x80, 0x00, "No" }, - {0x13, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Flytiger) - -static struct BurnDIPInfo BluehawkDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Type" }, - {0x12, 0x01, 0x02, 0x02, "A" }, - {0x12, 0x01, 0x02, 0x00, "B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 0, "Allow Continue" }, - {0x13, 0x01, 0x80, 0x00, "No" }, - {0x13, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Bluehawk) - -static struct BurnDIPInfo PrimellaDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x9d, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Type" }, - {0x12, 0x01, 0x02, 0x02, "A" }, - {0x12, 0x01, 0x02, 0x00, "B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Show Girl" }, - {0x13, 0x01, 0x03, 0x00, "Skip Skip Skip" }, - {0x13, 0x01, 0x03, 0x03, "Dress Dress Dress" }, - {0x13, 0x01, 0x03, 0x02, "Dress Half Half" }, - {0x13, 0x01, 0x03, 0x01, "Dress Half Naked" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x10, 0x10, "Upright" }, - {0x13, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x80, 0x00, "No" }, - {0x13, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Primella) - -static struct BurnDIPInfo RsharkDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Type" }, - {0x16, 0x01, 0x02, 0x02, "A" }, - {0x16, 0x01, 0x02, 0x00, "B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x16, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x16, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x17, 0x01, 0x03, 0x00, "1" }, - {0x17, 0x01, 0x03, 0x02, "2" }, - {0x17, 0x01, 0x03, 0x03, "3" }, - {0x17, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x0c, 0x08, "Easy" }, - {0x17, 0x01, 0x0c, 0x0c, "Normal" }, - {0x17, 0x01, 0x0c, 0x04, "Hard" }, - {0x17, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 0, "Allow Continue" }, - {0x17, 0x01, 0x80, 0x00, "No" }, - {0x17, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Rshark) - -static struct BurnDIPInfo SuperxDIPList[]= -{ - {0x16, 0xff, 0xff, 0xfe, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Coin Type" }, - {0x16, 0x01, 0x02, 0x02, "A" }, - {0x16, 0x01, 0x02, 0x00, "B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x16, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x16, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x17, 0x01, 0x03, 0x00, "1" }, - {0x17, 0x01, 0x03, 0x02, "2" }, - {0x17, 0x01, 0x03, 0x03, "3" }, - {0x17, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x0c, 0x08, "Easy" }, - {0x17, 0x01, 0x0c, 0x0c, "Normal" }, - {0x17, 0x01, 0x0c, 0x04, "Hard" }, - {0x17, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 0, "Allow Continue" }, - {0x17, 0x01, 0x80, 0x00, "No" }, - {0x17, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Superx) - -static struct BurnDIPInfo PopbingoDIPList[]= -{ - {0x16, 0xff, 0xff, 0xfb, NULL }, - {0x17, 0xff, 0xff, 0x4d, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Type" }, - {0x16, 0x01, 0x02, 0x02, "A" }, - {0x16, 0x01, 0x02, 0x00, "B" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x16, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x16, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "VS Max Round" }, - {0x17, 0x01, 0x01, 0x01, "3" }, - {0x17, 0x01, 0x01, 0x00, "1" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x0c, 0x08, "Easy" }, - {0x17, 0x01, 0x0c, 0x0c, "Normal" }, - {0x17, 0x01, 0x0c, 0x04, "Hard" }, - {0x17, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Blocks Don't Drop" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Popbingo) - -static inline void palette_write_4bgr(INT32 offset) -{ - UINT16 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = p & 0x0f; - INT32 g = (p >> 4) & 0x0f; - INT32 b = (p >> 8) & 0x0f; - - DrvPalette[offset/2] = BurnHighCol(r+(r*16),g+(g*16),b+(b*16),0); -} - -static inline void palette_write_5rgb(INT32 offset) -{ - UINT16 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 b = (p >> 0) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 r = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r,g,b,0); -} - -static void bankswitch(INT32 data) -{ - z80_bank_select[0] = data; - - ZetMapMemory(DrvZ80ROM0 + ((data & 0x07) * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall lastday_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xc800) { - DrvPalRAM[address & 0x7ff] = data; - palette_write_4bgr(address & 0x7fe); - return; - } - - if ((address & 0xfff8) == 0xc000) { - scrollregs[0][address & 7] = data; - return; - } - - if ((address & 0xfff8) == 0xc008) { - scrollregs[1][address & 7] = data; - return; - } - - switch (address) - { - case 0xc010: - // coin counters = data & 0x03; - sprite_enable = data & 0x10; - // flipscreen = data & 0x40; - return; - - case 0xc011: - bankswitch(data); - return; - - case 0xc012: - soundlatch = data; - return; - } -} - -static UINT8 __fastcall lastday_main_read(UINT16 address) -{ - switch (address) - { - case 0xc010: - return DrvInputs[0] ^ 0x08; - - case 0xc011: - return DrvInputs[1]; - - case 0xc012: - return DrvInputs[2]; - - case 0xc013: - return DrvDips[0]; - - case 0xc014: - return DrvDips[1]; - } - - return 0; -} - -static void __fastcall gulfstrm_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xf800) { - DrvPalRAM[address & 0x7ff] = data; - palette_write_5rgb(address & 0x7fe); - return; - } - - if ((address & 0xfff8) == 0xf018) { - scrollregs[0][address & 7] = data; - return; - } - - if ((address & 0xfff8) == 0xf020) { - scrollregs[1][address & 7] = data; - return; - } - - switch (address) - { - case 0xf000: - bankswitch(data); - return; - - case 0xf008: - // flipscreen = data & 0x01; - return; - - case 0xf010: - soundlatch = data; - return; - } -} - -static UINT8 __fastcall gulfstrm_main_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - return DrvDips[0]; - - case 0xf001: - return DrvDips[1]; - - case 0xf002: - return DrvInputs[2]; - - case 0xf003: - return DrvInputs[1]; - - case 0xf004: - return (DrvInputs[0] & ~0x10) | (vblank ? 0 : 0x10); // vblank - } - - return 0; -} - -static UINT8 __fastcall pollux_main_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - return DrvDips[0]; - - case 0xf001: - return DrvDips[1]; - - case 0xf002: - return DrvInputs[1]; - - case 0xf003: - return DrvInputs[2]; - - case 0xf004: - return DrvInputs[0]; - } - - return 0; -} - -static void __fastcall flytiger_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xe800) { - if (z80_bank_select[1]) { - DrvPalRAM[address & 0x7ff] = data; - palette_write_5rgb(address & 0x7fe); - } - return; - } - - if ((address & 0xfff8) == 0xe030) { - scrollregs[0][address & 7] = data; - return; - } - - if ((address & 0xfff8) == 0xe040) { - scrollregs[1][address & 7] = data; - return; - } - - switch (address) - { - case 0xe000: - bankswitch(data); - return; - - case 0xe010: - priority_select = data & 0x10; - z80_bank_select[1] = data & 0x08; - // flipscreen = data & 0x01; - return; - - case 0xe020: - soundlatch = data; - return; - } -} - -static UINT8 __fastcall flytiger_main_read(UINT16 address) -{ - switch (address) - { - case 0xe004: - return DrvInputs[0]; - - case 0xe000: - return DrvInputs[1]; - - case 0xe002: - return DrvInputs[2]; - - case 0xe006: - return DrvDips[0]; - - case 0xe008: - return DrvDips[1]; - } - - return 0; -} - -static void __fastcall bluehawk_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xc800) { - DrvPalRAM[address & 0x7ff] = data; - palette_write_5rgb(address & 0x7fe); - return; - } - - if ((address & 0xfff8) == 0xc018) { - scrollregs[2][address & 7] = data; - return; - } - - if ((address & 0xfff8) == 0xc040) { - scrollregs[0][address & 7] = data; - return; - } - - if ((address & 0xfff8) == 0xc048) { - scrollregs[1][address & 7] = data; - return; - } - - switch (address) - { - case 0xc000: - // flipscreen = data & 0x01; - return; - - case 0xc008: - bankswitch(data); - return; - - case 0xc010: - soundlatch = data; - return; - } -} - -static UINT8 __fastcall bluehawk_main_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return DrvDips[0]; - - case 0xc001: - return DrvDips[1]; - - case 0xc002: - return DrvInputs[1]; - - case 0xc003: - return DrvInputs[2]; - - case 0xc004: - return DrvInputs[0]; - } - - return 0; -} - -static void __fastcall primella_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xf000) { - DrvPalRAM[address & 0x7ff] = data; - palette_write_5rgb(address & 0x7fe); - return; - } - - if ((address & 0xfff8) == 0xfc00) { - scrollregs[0][address & 7] = data; - return; - } - - if ((address & 0xfff8) == 0xfc08) { - scrollregs[1][address & 7] = data; - return; - } - - switch (address) - { - case 0xf800: - bankswitch(data); - text_layer_enable = ~data & 0x08; - // flipscreen = data & 0x10; - return; - - case 0xf810: - soundlatch = data; - return; - } -} - -static UINT8 __fastcall primella_main_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return DrvDips[0]; - - case 0xf810: - return DrvDips[1]; - - case 0xf820: - return DrvInputs[1]; - - case 0xf830: - return DrvInputs[2]; - - case 0xf840: - return DrvInputs[0]; - } - - return 0; -} - -static void __fastcall superx_main_write_word(UINT32 address, UINT16 data) -{ - if (address & 0xff00000) { // Mirror top address bits. - SekWriteWord(address & 0xfffff, data); - return; - } - - if ((address & 0x0f0000) == 0x0c0000) address = (address & 0xffff) | 0x80000; // fix address for rshark - - if ((address & 0x0ff000) == 0x088000) { - *((UINT16*)(DrvPalRAM + (address & 0xffe))) = data; - palette_write_5rgb(address & 0xffe); - return; - } - - if ((address & 0x0ffff0) == 0x084000) { - scrollregs[0][(address & 0x0e) / 2] = data; - return; - } - - if ((address & 0x0ffff0) == 0x084010) { - scrollregs[2][(address & 0x0e) / 2] = data; - return; - } - if ((address & 0x0ffff0) == 0x08c000) { - scrollregs[1][(address & 0x0e) / 2] = data; - return; - } - - if ((address & 0x0ffff0) == 0x08c010) { - scrollregs[3][(address & 0x0e) / 2] = data; - return; - } - - switch (address) - { - case 0x080012: - case 0x080013: - soundlatch = data; - return; - - case 0x080014: - case 0x080015: - // flipscreen = data & 0x01; - priority_select = data & 0x10; - return; - } -} - -static void __fastcall superx_main_write_byte(UINT32 address, UINT8 data) -{ - if (address & 0xff00000) { // Mirror top address bits. - SekWriteByte(address & 0xfffff, data); - return; - } - - if ((address & 0x0f0000) == 0x0c0000) address = (address & 0xffff) | 0x80000; // fix address for rshark - - if ((address & 0x0ff000) == 0x088000) { - DrvPalRAM[(address & 0xfff)^1] = data; - palette_write_5rgb(address & 0xffe); - return; - } - - if ((address & 0x0ffff1) == 0x084001) { - scrollregs[0][(address & 0x0e) / 2] = data; - return; - } - - if ((address & 0x0ffff1) == 0x084011) { - scrollregs[2][(address & 0x0e) / 2] = data; - return; - } - if ((address & 0x0ffff1) == 0x08c001) { - scrollregs[1][(address & 0x0e) / 2] = data; - return; - } - - if ((address & 0x0ffff1) == 0x08c011) { - scrollregs[3][(address & 0x0e) / 2] = data; - return; - } - - switch (address) - { - case 0x080012: - case 0x080013: - soundlatch = data; - return; - - case 0x080014: - case 0x080015: - // flipscreen = data & 0x01; - priority_select = data & 0x10; - return; - } -} - -static UINT16 __fastcall superx_main_read_word(UINT32 address) -{ - if (address & 0xff00000) { // Mirror top address bits. - return SekReadWord(address & 0xfffff); - } - - if ((address & 0x0f0000) == 0x0c0000) address = (address & 0xffff) | 0x80000; // fix address for rshark - - switch (address) - { - case 0x080002: - case 0x080003: - return (DrvDips[1] << 8) | DrvDips[0]; - - case 0x080004: - case 0x080005: - return DrvInputs[0]; - - case 0x080006: - case 0x080007: - return DrvInputs[1]; - } - - return 0; -} - -static UINT8 __fastcall superx_main_read_byte(UINT32 address) -{ - if (address & 0xff00000) { // Mirror top address bits. - return SekReadByte(address & 0xfffff); - } - - if ((address & 0x0f0000) == 0x0c0000) address = (address & 0xffff) | 0x80000; // fix address for rshark - - switch (address) - { - case 0x080002: - return DrvDips[1]; - - case 0x080003: - return DrvDips[0]; - - case 0x080004: - return (DrvInputs[0] >> 8) & 0xff; - - case 0x080005: - return DrvInputs[0] & 0xff; - - case 0x080006: - return (DrvInputs[1] >> 8) & 0xff; - - case 0x080007: - return DrvInputs[1] & 0xff; - } - - return 0; -} - -static void __fastcall sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - case 0xf001: - case 0xf002: - case 0xf003: - BurnYM2203Write((address & 2) / 2, address & 1, data); - return; - - // pollux - case 0xf802: - case 0xf803: - case 0xf804: - case 0xf805: - BurnYM2203Write((address & 4) / 4, address & 1, data); - return; - - // flytiger - case 0xf808: - BurnYM2151SelectRegister(data); - return; - - case 0xf809: - BurnYM2151WriteRegister(data); - return; - - case 0xf80a: - MSM6295Command(0, data); - return; - } -} - -static UINT8 __fastcall sound_read(UINT16 address) -{ - switch (address) - { - case 0xc800: - case 0xf800: - return soundlatch; - - case 0xf000: - case 0xf001: - case 0xf002: - case 0xf003: - return BurnYM2203Read((address & 2) / 2, address & 1); - - // pollux - case 0xf802: - case 0xf803: - case 0xf804: - case 0xf805: - return BurnYM2203Read((address & 4) / 4, address & 1); - - // flytiger - case 0xf808: - case 0xf809: - return BurnYM2151ReadStatus(); - - case 0xf80a: - return MSM6295ReadStatus(0); - } - - return 0; -} - -inline static void DrvYM2203IRQHandler(INT32 n, INT32 nStatus) -{ - sound_irq_line[n] = nStatus; - - ZetSetIRQLine(0, ((sound_irq_line[0] | sound_irq_line[1]) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE)); -} - -static void DrvYM2151IrqHandler(INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE)); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -inline static INT32 DrvSynchroniseStream8Mhz(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 8000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -inline static double DrvGetTime8Mhz() -{ - return (double)ZetTotalCycles() / 8000000.0; -} - -static INT32 Z80YM2203DoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - BurnYM2203Reset(); - ZetClose(); - - sound_irq_line[0] = sound_irq_line[1] = 0; - sprite_enable = 0; - soundlatch = 0; - priority_select = 0; - text_layer_enable = 0; - - return 0; -} - -static INT32 Z80YM2151DoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - - sprite_enable = 0; - soundlatch = 0; - priority_select = 0; - text_layer_enable = 0; - - return 0; -} - -static INT32 Drv68KDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - sprite_enable = 0; - soundlatch = 0; - priority_select = 0; - text_layer_enable = 0; - - return 0; -} - -static INT32 DrvZ80MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x100000; - DrvGfxROM3 = Next; Next += 0x100000; - DrvGfxROM4 = Next; Next += 0x100000; - - DrvTMapROM0 = Next; Next += 0x020000; - DrvTMapROM1 = Next; Next += 0x020000; - DrvTMapROM2 = Next; Next += 0x020000; - - MSM6295ROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x00401 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x01400; - DrvZ80RAM1 = Next; Next += 0x00800; - - DrvSprRAM = Next; Next += 0x01000; - DrvSprBuf = Next; Next += 0x01000; - DrvTxtRAM = Next; Next += 0x01000; - DrvPalRAM = Next; Next += 0x00800; - - scrollregs[0] = Next; Next += 0x00008; - scrollregs[1] = Next; Next += 0x00008; - scrollregs[2] = Next; Next += 0x00008; - scrollregs[3] = Next; Next += 0x00008; - sound_irq_line = Next; Next += 0x00002; - z80_bank_select = Next; Next += 0x00002; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 Drv68KMemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROM2 = Next; Next += 0x200000; - DrvGfxROM3 = Next; Next += 0x200000; - DrvGfxROM4 = Next; Next += 0x200000; - DrvGfxROM5 = Next; Next += 0x200000; - - DrvTMapROM0 = Next; Next += 0x080000; - DrvTMapROM1 = Next; Next += 0x080000; - DrvTMapROM2 = Next; Next += 0x080000; - DrvTMapROM3 = Next; Next += 0x080000; - DrvTMapROM4 = Next; Next += 0x080000; - - MSM6295ROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x00801 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x0d000; - Drv68KRAM1 = Next; Next += 0x02000; - DrvZ80RAM1 = Next; Next += 0x00800; - - DrvSprRAM = Next; Next += 0x01000; - DrvSprBuf = Next; Next += 0x01000; - DrvPalRAM = Next; Next += 0x01000; - - scrollregs[0] = Next; Next += 0x00008; - scrollregs[1] = Next; Next += 0x00008; - scrollregs[2] = Next; Next += 0x00008; - scrollregs[3] = Next; Next += 0x00008; - sound_irq_line = Next; Next += 0x00002; - z80_bank_select = Next; Next += 0x00002; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode(INT32 gfx, UINT8 *src, INT32 nLen, INT32 nType) -{ - INT32 Plane0[4] = { 0, 4, (nLen/2)*8, (nLen/2)*8+4 }; - INT32 XOffs0[8] = { STEP4(0,1), STEP4(8,1) }; - INT32 YOffs0[8] = { STEP8(0,16) }; - - INT32 Plane1[4] = { STEP4(0,4) }; - INT32 XOffs1[32] = { STEP4(0,1), STEP4(16,1), STEP4(1024,1), STEP4(1040,1), STEP4(2048,1), STEP4(2064,1), STEP4(3072,1), STEP4(3088,1) }; - INT32 YOffs1[32] = { STEP32(0,32) }; - - INT32 Plane2[4] = { STEP4(0,4) }; - INT32 XOffs2[16] = { STEP4(0,1), STEP4(16,1), STEP4(512,1), STEP4(528,1) }; - INT32 YOffs2[16] = { STEP16(0,32) }; - - INT32 Plane3[4] = { STEP4(0,1) }; - INT32 XOffs3[8] = { STEP8(0,4) }; - INT32 YOffs3[8] = { STEP8(0,32) }; - - INT32 Plane4[4] = { STEP4(0,1) }; - INT32 XOffs4[16] = { STEP8(0,4), STEP8(512,4) }; - INT32 YOffs4[16] = { STEP16(0,32) }; - - INT32 Plane5[8] = { STEP4(0,4), STEP4((nLen/2)*8, 4) }; - - INT32 TileSizes[6] = { 8, 32, 16, 8, 16, 32 }; - INT32 TileDepths[6] = { 4, 4, 4, 4, 4, 8 }; - - INT32 tilesize = TileSizes[nType]; - INT32 tilebpp = TileDepths[nType]; - - UINT8 *tmp = (UINT8*)BurnMalloc(nLen); - if (tmp == NULL) { - return; - } - - memcpy (tmp, src, nLen); - - gfxmask[gfx] = (((nLen * 8) / tilebpp) / (tilesize * tilesize)) - 1; - - switch (nType) - { - case 0: // lastday characters - GfxDecode(gfxmask[gfx]+1, tilebpp, tilesize, tilesize, Plane0, XOffs0, YOffs0, 0x0080, tmp, src); - break; - - case 1: // tiles - GfxDecode(gfxmask[gfx]+1, tilebpp, tilesize, tilesize, Plane1, XOffs1, YOffs1, 0x1000, tmp, src); - break; - - case 2: // sprites - GfxDecode(gfxmask[gfx]+1, tilebpp, tilesize, tilesize, Plane2, XOffs2, YOffs2, 0x0400, tmp, src); - break; - - case 3: // bluehawk characters - GfxDecode(gfxmask[gfx]+1, tilebpp, tilesize, tilesize, Plane3, XOffs3, YOffs3, 0x0100, tmp, src); - break; - - case 4: // rshark sprites - GfxDecode(gfxmask[gfx]+1, tilebpp, tilesize, tilesize, Plane4, XOffs4, YOffs4, 0x0400, tmp, src); - break; - - case 5: // popbingo tiles - GfxDecode(gfxmask[gfx]+1, tilebpp, tilesize, tilesize, Plane5, XOffs1, YOffs1, 0x1000, tmp, src); - break; - } - - // Calculate transparency tables - { - INT32 count = 0; - - DrvTransTab[gfx] = (UINT8*)BurnMalloc(gfxmask[gfx]+1); - - memset (DrvTransTab[gfx], 1, gfxmask[gfx]+1); - - for (INT32 i = 0; i < (gfxmask[gfx]+1)*tilesize*tilesize; i+=tilesize*tilesize) { - - int advcnt = 1; - - for (INT32 j = 0; j < tilesize*tilesize; j++) { - if (src[i+j] != ((1< 0) { - SekMapMemory(Drv68KRAM0, 0x040000, 0x04cfff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x04d000, 0x04dfff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x04e000, 0x04ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0c8000, 0x0c8fff, MAP_ROM); - } else { - SekMapMemory(DrvPalRAM, 0x088000, 0x088fff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x0d0000, 0x0dcfff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x0dd000, 0x0ddfff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x0de000, 0x0dffff, MAP_RAM); - } - - SekSetWriteWordHandler(0, superx_main_write_word); - SekSetWriteByteHandler(0, superx_main_write_byte); - SekSetReadWordHandler(0, superx_main_read_word); - SekSetReadByteHandler(0, superx_main_read_byte); - SekClose(); - - DrvSoundCPUInit(0,1); - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - Drv68KDoReset(); - - return 0; -} - -static void DrvFreeTransTab() -{ - for (INT32 i = 0; i < 6; i++) { - if (DrvTransTab[i]) { - BurnFree(DrvTransTab[i]); - } - } -} - -static INT32 Z80YM2203Exit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnYM2203Exit(); - - BurnFree (AllMem); - - DrvFreeTransTab(); - - memset (gfxmask, 0, 6 * sizeof(INT32)); - - global_y = 8; - main_cpu_clock = 8000000; - vblank = 0; - gulf_storm = 0; - pollux_gulfstrm_irq_kicker_hack = 0; - - return 0; -} - -static INT32 Z80YM2151Exit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - MSM6295ROM = NULL; - - BurnFree (AllMem); - - DrvFreeTransTab(); - - memset (gfxmask, 0, 6 * sizeof(INT32)); - - global_y = 8; - main_cpu_clock = 8000000; - - return 0; -} - -static INT32 Drv68KExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - MSM6295ROM = NULL; - - memset (gfxmask, 0, 6 * sizeof(INT32)); - - BurnFree (AllMem); - - DrvFreeTransTab(); - - global_y = 8; - main_cpu_clock = 8000000; - - return 0; -} - -static void DrawLayer(UINT8 *rom, UINT8 *scroll, UINT8 *gfxbase, INT32 gfxlenmask, INT32 colorbase, UINT8 *transtab, INT32 transp, INT32 depth, INT32 /*pri*/) -{ - if (scroll[6] & 0x10) return; - - INT32 scrollx = scroll[0] + 64; - INT32 scrolly = scroll[3] + global_y; - - INT32 format = scroll[6] & 0x20; - - for (INT32 offs = 0; offs < 32 * 8; offs++) - { - INT32 sy = (offs & 0x07) * 32; - INT32 sx = (offs / 0x08) * 32; - - sy -= scrolly; - if (sy < -31) sy += 256; - sx -= scrollx; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 ofst = (offs + ((INT32)scroll[1] * 0x40)) * 2; - - INT32 attr = rom[ofst]; - - INT32 code, color, flipx, flipy; - - if (format) - { - code = rom[ofst + 1] | ((attr & 0x01) * 256) | ((attr & 0x80) * 4); - color = (attr & 0x78) / 8; - flipy = attr & 0x04; - flipx = attr & 0x02; - } - else - { - INT32 codemask = 0x03; - INT32 colormask = 0x3c; - - if (depth == 8) { - codemask = 0x07; - colormask = 0; - } - - code = rom[ofst + 1] | ((attr & codemask) * 256); - color = (attr & colormask) / 4; - flipy = attr & 0x80; - flipx = attr & 0x40; - } - - code &= gfxlenmask; - if (transtab[code] && transp != -1) continue; // let's skip transparent tiles - - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, depth, transp, colorbase, gfxbase); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, depth, transp, colorbase, gfxbase); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, depth, transp, colorbase, gfxbase); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, depth, transp, colorbase, gfxbase); - } - } - - if (sy >= 0) continue; - - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy + 256, color, depth, transp, colorbase, gfxbase); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy + 256, color, depth, transp, colorbase, gfxbase); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy + 256, color, depth, transp, colorbase, gfxbase); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy + 256, color, depth, transp, colorbase, gfxbase); - } - } - } -} - -static void draw_layer_rshark(UINT8 *tmaprom0, UINT8 *tmaprom1, UINT8 *scroll, UINT8 *gfxbase, INT32 gfxlenmask, INT32 colorbase, UINT8 *transtab, INT32 transp, INT32 /*pri*/) -{ - INT32 scrollx = scroll[0] + 64; - INT32 scrolly = (scroll[3] + (scroll[4] * 256) + global_y) & 0x1ff; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sy = (offs & 0x1f) * 16; - INT32 sx = (offs / 0x20) * 16; - - sy -= scrolly; - if (sy < -15) sy += 512; - sx -= scrollx; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 ofst = (offs + ((INT32)scroll[1] * 0x200)) * 2; - INT32 attr = tmaprom0[ofst + 0]; - INT32 code =(tmaprom0[ofst + 1] + ((attr & 0x1f) * 256)) & gfxlenmask; - INT32 color = tmaprom1[ofst/2] & 0x0f; - INT32 flipy = attr & 0x80; - INT32 flipx = attr & 0x40; - - code &= gfxlenmask; - if (transtab[code] && transp != -1) continue; // let's skip transparent tiles - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, transp, colorbase, gfxbase); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, transp, colorbase, gfxbase); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, transp, colorbase, gfxbase); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, transp, colorbase, gfxbase); - } - } - - if (sy >= 0) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy + 512, color, 4, transp, colorbase, gfxbase); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy + 512, color, 4, transp, colorbase, gfxbase); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy + 512, color, 4, transp, colorbase, gfxbase); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy + 512, color, 4, transp, colorbase, gfxbase); - } - } - } -} - -static void DrawTextLayer(INT32 mode, INT32 /*pri*/, INT32 scroll_adj) -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sy = ((((offs & 0x1f) * 8) - global_y) - scroll_adj) & 0xff; - INT32 sx = ((offs / 0x20) * 8) - 64; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code; - - if (mode) - { - code = DrvTxtRAM[offs * 2] + (DrvTxtRAM[offs * 2 + 1] << 8); - } - else - { - code = DrvTxtRAM[offs] + (DrvTxtRAM[offs | 0x800] << 8); - } - - if (DrvTransTab[0][code & gfxmask[0]]) continue; - - Render8x8Tile_Mask_Clip(pTransDraw, code & gfxmask[0], sx, sy, (code >> 12) & 0xf, 4, 0x0f, 0, DrvGfxROM0); - } -} - -static void draw_sprites(INT32 priority, UINT8 extensions) -{ - UINT8 *ram = DrvSprBuf; - - for (INT32 offs = 0x1000-32; offs >= 0; offs -= 32) - { - INT32 color = ram[offs+1] & 0x0f; - - INT32 pri = (((color == 0x00) || (color == 0x0f)) ? 0: 1); - if (pri != priority) continue; - - INT32 sx = ram[offs+3] | ((ram[offs+1] & 0x10) << 4); - INT32 sy = ram[offs+2]; - INT32 code = ram[offs] | ((ram[offs+1] & 0xe0) << 3); - - INT32 flipy = 0; - INT32 flipx = 0; - INT32 height = 0; - - if (extensions) - { - UINT8 ext = ram[offs+0x1c]; - - if (extensions & 0x01) // 12 bit sprites - code |= ((ext & 0x01) << 11); - - if (extensions & 0x02) // height - { - height = (ext & 0x70) >> 4; - code &= ~height; - - flipx = ext & 0x08; - flipy = ext & 0x04; - } - - if (extensions & 0x04) // bluehawk y shift - sy += 6 - ((~ext & 0x02) << 7); - - if (extensions & 0x08) // flytiger y shift - sy -=(ext & 0x02) << 7; - } - - sy -= global_y; - - for (INT32 y = 0; y <= height; y++) - { - if (DrvTransTab[1][(code + y)&gfxmask[1]]) continue; // skip transparent tiles - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, (code + y)&gfxmask[1], sx - 64, sy + (16 * (flipy ? (height - y) : y)), color, 4, 0xf, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, (code + y)&gfxmask[1], sx - 64, sy + (16 * (flipy ? (height - y) : y)), color, 4, 0xf, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, (code + y)&gfxmask[1], sx - 64, sy + (16 * (flipy ? (height - y) : y)), color, 4, 0xf, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, (code + y)&gfxmask[1], sx - 64, sy + (16 * (flipy ? (height - y) : y)), color, 4, 0xf, 0x100, DrvGfxROM1); - } - } - } - } -} - -static void draw_sprites_rshark(INT32 priority) -{ - UINT16 *ram = (UINT16*)DrvSprBuf; - - for (INT32 offs = 0; offs < 0x1000 / 2; offs += 8) - { - if (ram[offs] & 0x0001) - { - INT32 color = ram[offs+7] & 0x000f; - - INT32 pri (((color == 0x00) || (color == 0x0f)) ? 0 : 1); - if (priority != pri) continue; - - INT32 code = ram[offs+3]; - INT32 width = ram[offs+1] & 0x000f; - INT32 height = (ram[offs+1] & 0x00f0) >> 4; - INT32 sx = ram[offs+4] & 0x01ff; - INT32 sy = (INT16)ram[offs+6] & 0x01ff; - if (sy & 0x0100) sy |= ~(int)0x01ff; - - for (INT32 y = 0; y <= height; y++) - { - INT32 _y = sy + (16 * y); - - for (INT32 x = 0; x <= width; x++) - { - INT32 _x = sx + (16 * x); - - if (DrvTransTab[1][code & gfxmask[1]] == 0) // skip transparent tiles - Render16x16Tile_Mask_Clip(pTransDraw, code & gfxmask[1], _x - 64, _y - global_y, color, 4, 0xf, 0, DrvGfxROM1); - - code++; - } - } - } - } -} -static inline void DrvPaletteRecalc4BGR() -{ - for (INT32 i = 0; i < BurnDrvGetPaletteEntries()*2; i+=2) { - palette_write_4bgr(i); - } - - DrvPalette[BurnDrvGetPaletteEntries()] = 0; // black -} - -static inline void DrvPaletteRecalc5RGB() -{ - for (INT32 i = 0; i < BurnDrvGetPaletteEntries()*2; i+=2) { - palette_write_5rgb(i); - } - - DrvPalette[BurnDrvGetPaletteEntries()] = 0; // black -} - -static INT32 LastdayDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc4BGR(); - DrvRecalc = 0; - } - - UINT32 black = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = black; - } - - if (nBurnLayer & 1) DrawLayer(DrvTMapROM0, scrollregs[0], DrvGfxROM2, gfxmask[2], 0x300, DrvTransTab[2], -1, 4, 1); - if (!sprite_enable) draw_sprites(0,0); - if (nBurnLayer & 2) DrawLayer(DrvTMapROM1, scrollregs[1], DrvGfxROM3, gfxmask[3], 0x200, DrvTransTab[3], 0x0f, 4, 2); - if (!sprite_enable) draw_sprites(1,0); - if (nBurnLayer & 4) DrawTextLayer(0, 4, 8); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 GulfstrmDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc5RGB(); - DrvRecalc = 0; - } - - UINT32 black = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = black; - } - - if (nBurnLayer & 1) DrawLayer(DrvTMapROM0, scrollregs[0], DrvGfxROM2, gfxmask[2], 0x300, DrvTransTab[2], -1, 4, 1); - draw_sprites(0,1); - if (nBurnLayer & 2) DrawLayer(DrvTMapROM1, scrollregs[1], DrvGfxROM3, gfxmask[3], 0x200, DrvTransTab[3], 0x0f, 4, 2); - draw_sprites(1,1); - if (nBurnLayer & 4) DrawTextLayer(0, 4, 8); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 PolluxDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc5RGB(); - DrvRecalc = 0; - } - - UINT32 black = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = black; - } - - if (nBurnLayer & 1) DrawLayer(DrvTMapROM0, scrollregs[0], DrvGfxROM2, gfxmask[2], 0x300, DrvTransTab[2], -1, 4, 1); - draw_sprites(0,1|2); - if (nBurnLayer & 2) DrawLayer(DrvTMapROM1, scrollregs[1], DrvGfxROM3, gfxmask[3], 0x200, DrvTransTab[3], 0x0f, 4, 2); - draw_sprites(1,1|2); - if (nBurnLayer & 4) DrawTextLayer(0, 4, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 FlytigerDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc5RGB(); - DrvRecalc = 0; - } - - UINT32 black = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = black; - } - - if (priority_select) - { - if (nBurnLayer & 2) DrawLayer(DrvTMapROM1, scrollregs[1], DrvGfxROM3, gfxmask[3], 0x200, DrvTransTab[3], 0x0f, 4, 1); - draw_sprites(0,1|2|8); - if (nBurnLayer & 1) DrawLayer(DrvTMapROM0, scrollregs[0], DrvGfxROM2, gfxmask[2], 0x300, DrvTransTab[2], 0x0f, 4, 2); - } - else - { - if (nBurnLayer & 1) DrawLayer(DrvTMapROM0, scrollregs[0], DrvGfxROM2, gfxmask[2], 0x300, DrvTransTab[2], 0x0f, 4, 1); - draw_sprites(0,1|2|8); - if (nBurnLayer & 2) DrawLayer(DrvTMapROM1, scrollregs[1], DrvGfxROM3, gfxmask[3], 0x200, DrvTransTab[3], 0x0f, 4, 2); - } - - draw_sprites(1,1|2|8); - - if (nBurnLayer & 4) DrawTextLayer(0, 4, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 BluehawkDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc5RGB(); - DrvRecalc = 0; - } - - UINT32 black = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = black; - } - - if (nBurnLayer & 1) DrawLayer(DrvTMapROM0, scrollregs[0], DrvGfxROM2, gfxmask[2], 0x300, DrvTransTab[2], -1, 4, 1); - draw_sprites(0,1|2|4); - if (nBurnLayer & 2) DrawLayer(DrvTMapROM1, scrollregs[1], DrvGfxROM3, gfxmask[3], 0x200, DrvTransTab[3], 0x0f, 4, 2); - draw_sprites(1,1|2|4); - if (nBurnLayer & 2) DrawLayer(DrvTMapROM2, scrollregs[2], DrvGfxROM4, gfxmask[4], 0x000, DrvTransTab[4], 0x0f, 4, 4); - if (nBurnLayer & 4) DrawTextLayer(1, 4, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 PrimellaDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc5RGB(); - DrvRecalc = 0; - } - - UINT32 black = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = black; - } - - if (nBurnLayer & 1) DrawLayer(DrvTMapROM0, scrollregs[0], DrvGfxROM2, gfxmask[2], 0x300, DrvTransTab[2], -1, 4, 0); - if (nBurnLayer & 4) if (!text_layer_enable) DrawTextLayer(1, 0, 0); - if (nBurnLayer & 2) DrawLayer(DrvTMapROM1, scrollregs[1], DrvGfxROM3, gfxmask[3], 0x200, DrvTransTab[3], 0x0f, 4, 0); - if (nBurnLayer & 4) if ( text_layer_enable) DrawTextLayer(1, 0, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 RsharkDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc5RGB(); - DrvRecalc = 0; - } - - UINT32 black = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = black; - } - - if (nBurnLayer & 1) draw_layer_rshark(DrvTMapROM3, DrvTMapROM4 + 0x60000, scrollregs[0], DrvGfxROM5, gfxmask[5], 0x400, DrvTransTab[5], -1, 1); - if ((nSpriteEnable & 1) && (priority_select == 0)) draw_sprites_rshark(0); - if (nBurnLayer & 2) draw_layer_rshark(DrvTMapROM2, DrvTMapROM4 + 0x40000, scrollregs[2], DrvGfxROM4, gfxmask[4], 0x300, DrvTransTab[4], 0x0f, (priority_select) ? 2 : 1); - if ((nSpriteEnable & 1) && (priority_select != 0)) draw_sprites_rshark(0); - if (nBurnLayer & 4) draw_layer_rshark(DrvTMapROM1, DrvTMapROM4 + 0x20000, scrollregs[1], DrvGfxROM3, gfxmask[3], 0x200, DrvTransTab[3], 0x0f, 2); - if (nBurnLayer & 8) draw_layer_rshark(DrvTMapROM0, DrvTMapROM4 + 0x00000, scrollregs[3], DrvGfxROM2, gfxmask[2], 0x100, DrvTransTab[2], 0x0f, 2); - if (nSpriteEnable & 2) draw_sprites_rshark(1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 PopbingoDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc5RGB(); - DrvRecalc = 0; - } - - UINT32 black = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = black; - } - - if (nBurnLayer & 1) DrawLayer(DrvTMapROM0, scrollregs[0], DrvGfxROM2, gfxmask[2], 0x100, DrvTransTab[2], -1, 8, 1); - if (nSpriteEnable & 1) draw_sprites_rshark(0); - if (nSpriteEnable & 2) draw_sprites_rshark(1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 LastdayFrame() -{ - if (DrvReset) { - Z80YM2203DoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3*sizeof(INT16)); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { main_cpu_clock / 60, 8000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (gulf_storm) { - if (i == 92) { ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); vblank = 1; } - if (i == 93) { ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); vblank = 0; } - } else { - if (i == (nInterleave - 2)) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - ZetClose(); - - ZetOpen(1); - BurnTimerUpdate((i + 1) * nCyclesTotal[1] / nInterleave); - if (pollux_gulfstrm_irq_kicker_hack && (i % pollux_gulfstrm_irq_kicker_hack) == 0) { // ugly hack for pollux musix+sfx - if (!(sound_irq_line[0] | sound_irq_line[1])) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetRun(60); - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - } - ZetClose(); - } - - ZetOpen(1); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - - return 0; -} - -static INT32 FlytigerFrame() -{ - if (DrvReset) { - Z80YM2151DoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3*sizeof(INT16)); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSegment = 0; - INT32 nInterleave = 100; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 8000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 2)) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - ZetOpen(1); - - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - - ZetClose(); - } - - ZetOpen(1); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - - return 0; -} - -static inline void JoyClearOpposites(UINT8* nJoystickInputs) -{ // works on active-high - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static INT32 RsharkFrame() -{ - if (DrvReset) { - Drv68KDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3*sizeof(INT16)); - DrvInputs[0] = 0; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - UINT8 *p1p2 = (UINT8 *)&DrvInputs[0]; - JoyClearOpposites(p1p2 + 0); - JoyClearOpposites(p1p2 + 1); - - DrvInputs[0] ^= 0xffff; // convert to active-low - } - - INT32 nSegment = 0; - INT32 nInterleave = 256; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { main_cpu_clock / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - if (i == 250) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - if (i == 120) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - } - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - SekClose(); - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - - return 0; -} - -static INT32 Z80YM2203Scan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(sprite_enable); - SCAN_VAR(soundlatch); - SCAN_VAR(priority_select); - SCAN_VAR(text_layer_enable); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(z80_bank_select[0]); - ZetClose(); - } - - return 0; -} - -static INT32 Z80YM2151Scan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(sprite_enable); - SCAN_VAR(soundlatch); - SCAN_VAR(priority_select); - SCAN_VAR(text_layer_enable); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(z80_bank_select[0]); - ZetClose(); - } - - return 0; -} - -static INT32 Drv68KScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(sprite_enable); - SCAN_VAR(soundlatch); - SCAN_VAR(priority_select); - SCAN_VAR(text_layer_enable); - } - - return 0; -} - - -// The Last Day (set 1) - -static struct BurnRomInfo lastdayRomDesc[] = { - { "lday3.s5", 0x10000, 0xa06dfb1e, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "4.u5", 0x10000, 0x70961ea6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.d3", 0x10000, 0xdd4316fd, 2 | BRF_PRG | BRF_ESS }, // 2 Audio CPU Code - - { "2.j4", 0x10000, 0x83eb572c, 3 | BRF_GRA }, // 3 Characters - - { "16.d14", 0x20000, 0xdf503504, 4 | BRF_GRA }, // 4 Sprites - { "15.a14", 0x20000, 0xcd990442, 4 | BRF_GRA }, // 5 - - { "6.s9", 0x20000, 0x1054361d, 5 | BRF_GRA }, // 6 Tiles - { "9.s11", 0x20000, 0x6952ef4d, 5 | BRF_GRA }, // 7 - { "7.u9", 0x20000, 0x6e57a888, 5 | BRF_GRA }, // 8 - { "10.u11", 0x20000, 0xa5548dca, 5 | BRF_GRA }, // 9 - - { "12.s13", 0x20000, 0x992bc4af, 6 | BRF_GRA }, // 10 Tiles - { "14.s14", 0x20000, 0xa79abc85, 6 | BRF_GRA }, // 11 - - { "5.r9", 0x10000, 0x4789bae8, 7 | BRF_GRA }, // 12 Tiles - { "8.r11", 0x10000, 0x92402b9a, 7 | BRF_GRA }, // 13 - - { "11.r13", 0x10000, 0x04b961de, 8 | BRF_GRA }, // 14 Tiles - { "13.r14", 0x10000, 0x6bdbd887, 8 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(lastday) -STD_ROM_FN(lastday) - -struct BurnDriver BurnDrvLastday = { - "lastday", NULL, NULL, NULL, "1990", - "The Last Day (set 1)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, lastdayRomInfo, lastdayRomName, NULL, NULL, LastdayInputInfo, LastdayDIPInfo, - LastdayInit, Z80YM2203Exit, LastdayFrame, LastdayDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// The Last Day (set 2) - -static struct BurnRomInfo lastdayaRomDesc[] = { - { "lday3.s5", 0x10000, 0xa06dfb1e, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "4.u5", 0x10000, 0x70961ea6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "e1.d3", 0x10000, 0xce96e106, 2 | BRF_PRG | BRF_ESS }, // 2 Audio CPU Code - - { "2.j4", 0x10000, 0x83eb572c, 3 | BRF_GRA }, // 3 Characters - - { "16.d14", 0x20000, 0xdf503504, 4 | BRF_GRA }, // 4 Sprites - { "15.a14", 0x20000, 0xcd990442, 4 | BRF_GRA }, // 5 - - { "e6.s9", 0x20000, 0x7623c443, 5 | BRF_GRA }, // 6 Tiles - { "e9.s11", 0x20000, 0x717f6a0e, 5 | BRF_GRA }, // 7 - { "7.u9", 0x20000, 0x6e57a888, 5 | BRF_GRA }, // 8 - { "10.u11", 0x20000, 0xa5548dca, 5 | BRF_GRA }, // 9 - - { "12.s13", 0x20000, 0x992bc4af, 6 | BRF_GRA }, // 10 Tiles - { "14.s14", 0x20000, 0xa79abc85, 6 | BRF_GRA }, // 11 - - { "e5.r9", 0x10000, 0x5f801410, 7 | BRF_GRA }, // 12 Tiles - { "e8.r11", 0x10000, 0xa7b8250b, 7 | BRF_GRA }, // 13 - - { "11.r13", 0x10000, 0x04b961de, 8 | BRF_GRA }, // 14 Tiles - { "13.r14", 0x10000, 0x6bdbd887, 8 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(lastdaya) -STD_ROM_FN(lastdaya) - -struct BurnDriver BurnDrvLastdaya = { - "lastdaya", "lastday", NULL, NULL, "1990", - "The Last Day (set 2)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, lastdayaRomInfo, lastdayaRomName, NULL, NULL, LastdayInputInfo, LastdayDIPInfo, - LastdayInit, Z80YM2203Exit, LastdayFrame, LastdayDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Chulgyeok D-Day (Korea) - -static struct BurnRomInfo ddaydooRomDesc[] = { - { "3.s5", 0x10000, 0x7817d4f3, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "4.u5", 0x10000, 0x70961ea6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.d3", 0x10000, 0xdd4316fd, 2 | BRF_PRG | BRF_ESS }, // 2 Audio CPU Code - - { "2.j4", 0x10000, 0x83eb572c, 3 | BRF_GRA }, // 3 Characters - - { "16.d14", 0x20000, 0xdf503504, 4 | BRF_GRA }, // 4 Sprites - { "15.a14", 0x20000, 0xcd990442, 4 | BRF_GRA }, // 5 - - { "6.s9", 0x20000, 0x1054361d, 5 | BRF_GRA }, // 6 Tiles - { "9.s11", 0x20000, 0x6952ef4d, 5 | BRF_GRA }, // 7 - { "7.u9", 0x20000, 0x6e57a888, 5 | BRF_GRA }, // 8 - { "10.u11", 0x20000, 0xa5548dca, 5 | BRF_GRA }, // 9 - - { "12.s13", 0x20000, 0x992bc4af, 6 | BRF_GRA }, // 10 Tiles - { "14.s14", 0x20000, 0xa79abc85, 6 | BRF_GRA }, // 11 - - { "5.r9", 0x10000, 0x4789bae8, 7 | BRF_GRA }, // 12 Tiles - { "8.r11", 0x10000, 0x92402b9a, 7 | BRF_GRA }, // 13 - - { "11.r13", 0x10000, 0x04b961de, 8 | BRF_GRA }, // 14 Tiles - { "13.r14", 0x10000, 0x6bdbd887, 8 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(ddaydoo) -STD_ROM_FN(ddaydoo) - -struct BurnDriver BurnDrvDdaydoo = { - "ddaydoo", "lastday", NULL, NULL, "1990", - "Chulgyeok D-Day (Korea)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, ddaydooRomInfo, ddaydooRomName, NULL, NULL, LastdayInputInfo, LastdayDIPInfo, - LastdayInit, Z80YM2203Exit, LastdayFrame, LastdayDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Gulf Storm (set 1) - -static struct BurnRomInfo gulfstrmRomDesc[] = { - { "1.l4", 0x20000, 0x59e0478b, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "3.c5", 0x10000, 0xc029b015, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "2.s4", 0x10000, 0xc2d65a25, 3 | BRF_GRA }, // 2 Characters - - { "14.b1", 0x20000, 0x67bdf73d, 4 | BRF_GRA }, // 3 Sprites - { "16.c1", 0x20000, 0x7770a76f, 4 | BRF_GRA }, // 4 - { "15.b1", 0x20000, 0x84803f7e, 4 | BRF_GRA }, // 5 - { "17.e1", 0x20000, 0x94706500, 4 | BRF_GRA }, // 6 - - { "4.d8", 0x20000, 0x858fdbb6, 5 | BRF_GRA }, // 7 Tiles - { "5.b9", 0x20000, 0xc0a552e8, 5 | BRF_GRA }, // 8 - { "6.d8", 0x20000, 0x20eedda3, 5 | BRF_GRA }, // 9 - { "7.d9", 0x20000, 0x294f8c40, 5 | BRF_GRA }, // 10 - - { "12.r8", 0x20000, 0xec3ad3e7, 6 | BRF_GRA }, // 11 Tiles - { "13.r9", 0x20000, 0xc64090cb, 6 | BRF_GRA }, // 12 - - { "8.e8", 0x10000, 0x8d7f4693, 7 | BRF_GRA }, // 13 Tiles - { "9.e9", 0x10000, 0x34d440c4, 7 | BRF_GRA }, // 14 - - { "10.n8", 0x10000, 0xb4f15bf4, 8 | BRF_GRA }, // 15 Tiles - { "11.n9", 0x10000, 0x7dfe4a9c, 8 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(gulfstrm) -STD_ROM_FN(gulfstrm) - -struct BurnDriver BurnDrvGulfstrm = { - "gulfstrm", NULL, NULL, NULL, "1991", - "Gulf Storm (set 1)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, gulfstrmRomInfo, gulfstrmRomName, NULL, NULL, GulfstrmInputInfo, GulfstrmDIPInfo, - GulfstrmInit, Z80YM2203Exit, LastdayFrame, GulfstrmDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Gulf Storm (set 2) - -static struct BurnRomInfo gulfstrmaRomDesc[] = { - { "1.bin", 0x20000, 0xd04fb06b, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "3.c5", 0x10000, 0xc029b015, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "2.s4", 0x10000, 0xc2d65a25, 3 | BRF_GRA }, // 2 Characters - - { "14.b1", 0x20000, 0x67bdf73d, 4 | BRF_GRA }, // 3 Sprites - { "16.c1", 0x20000, 0x7770a76f, 4 | BRF_GRA }, // 4 - { "15.b1", 0x20000, 0x84803f7e, 4 | BRF_GRA }, // 5 - { "17.e1", 0x20000, 0x94706500, 4 | BRF_GRA }, // 6 - - { "4.d8", 0x20000, 0x858fdbb6, 5 | BRF_GRA }, // 7 Tiles - { "5.b9", 0x20000, 0xc0a552e8, 5 | BRF_GRA }, // 8 - { "6.d8", 0x20000, 0x20eedda3, 5 | BRF_GRA }, // 9 - { "7.d9", 0x20000, 0x294f8c40, 5 | BRF_GRA }, // 10 - - { "12.bin", 0x20000, 0x3e3d3b57, 6 | BRF_GRA }, // 11 Tiles - { "13.bin", 0x20000, 0x66fcce80, 6 | BRF_GRA }, // 12 - - { "8.e8", 0x10000, 0x8d7f4693, 7 | BRF_GRA }, // 13 Tiles - { "9.e9", 0x10000, 0x34d440c4, 7 | BRF_GRA }, // 14 - - { "10.bin", 0x10000, 0x08149140, 8 | BRF_GRA }, // 15 Tiles - { "11.bin", 0x10000, 0x2ed7545b, 8 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(gulfstrma) -STD_ROM_FN(gulfstrma) - -struct BurnDriver BurnDrvGulfstrma = { - "gulfstrma", "gulfstrm", NULL, NULL, "1991", - "Gulf Storm (set 2)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, gulfstrmaRomInfo, gulfstrmaRomName, NULL, NULL, GulfstrmInputInfo, GulfstrmDIPInfo, - GulfstrmInit, Z80YM2203Exit, LastdayFrame, GulfstrmDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Gulf Storm (set 3) - -static struct BurnRomInfo gulfstrmbRomDesc[] = { - { "1.l4", 0x20000, 0xaabd95a5, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "3.c5", 0x10000, 0xc029b015, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "2.s4", 0x10000, 0xc2d65a25, 3 | BRF_GRA }, // 2 Characters - - { "14.b1", 0x20000, 0x67bdf73d, 4 | BRF_GRA }, // 3 Sprites - { "16.c1", 0x20000, 0x7770a76f, 4 | BRF_GRA }, // 4 - { "15.b1", 0x20000, 0x84803f7e, 4 | BRF_GRA }, // 5 - { "17.e1", 0x20000, 0x94706500, 4 | BRF_GRA }, // 6 - - { "4.d8", 0x20000, 0x858fdbb6, 5 | BRF_GRA }, // 7 Tiles - { "5.b9", 0x20000, 0xc0a552e8, 5 | BRF_GRA }, // 8 - { "6.d8", 0x20000, 0x20eedda3, 5 | BRF_GRA }, // 9 - { "7.d9", 0x20000, 0x294f8c40, 5 | BRF_GRA }, // 10 - - { "12.bin", 0x20000, 0x3e3d3b57, 6 | BRF_GRA }, // 11 Tiles - { "13.bin", 0x20000, 0x66fcce80, 6 | BRF_GRA }, // 12 - - { "8.e8", 0x10000, 0x8d7f4693, 7 | BRF_GRA }, // 13 Tiles - { "9.e9", 0x10000, 0x34d440c4, 7 | BRF_GRA }, // 14 - - { "10.bin", 0x10000, 0x08149140, 8 | BRF_GRA }, // 15 Tiles - { "11.bin", 0x10000, 0x2ed7545b, 8 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(gulfstrmb) -STD_ROM_FN(gulfstrmb) - -struct BurnDriver BurnDrvGulfstrmb = { - "gulfstrmb", "gulfstrm", NULL, NULL, "1991", - "Gulf Storm (set 3)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, gulfstrmbRomInfo, gulfstrmbRomName, NULL, NULL, GulfstrmInputInfo, GulfstrmDIPInfo, - GulfstrmInit, Z80YM2203Exit, LastdayFrame, GulfstrmDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Gulf Storm (Media Shoji) - -static struct BurnRomInfo gulfstrmmRomDesc[] = { - { "18.l4", 0x20000, 0xd38e2667, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "3.c5", 0x10000, 0xc029b015, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "2.bin", 0x10000, 0xcb555d96, 3 | BRF_GRA }, // 2 Characters - - { "14.b1", 0x20000, 0x67bdf73d, 4 | BRF_GRA }, // 3 Sprites - { "16.c1", 0x20000, 0x7770a76f, 4 | BRF_GRA }, // 4 - { "15.b1", 0x20000, 0x84803f7e, 4 | BRF_GRA }, // 5 - { "17.e1", 0x20000, 0x94706500, 4 | BRF_GRA }, // 6 - - { "4.d8", 0x20000, 0x858fdbb6, 5 | BRF_GRA }, // 7 Tiles - { "5.b9", 0x20000, 0xc0a552e8, 5 | BRF_GRA }, // 8 - { "6.d8", 0x20000, 0x20eedda3, 5 | BRF_GRA }, // 9 - { "7.d9", 0x20000, 0x294f8c40, 5 | BRF_GRA }, // 10 - - { "12.bin", 0x20000, 0x3e3d3b57, 6 | BRF_GRA }, // 11 Tiles - { "13.bin", 0x20000, 0x66fcce80, 6 | BRF_GRA }, // 12 - - { "8.e8", 0x10000, 0x8d7f4693, 7 | BRF_GRA }, // 13 Tiles - { "9.e9", 0x10000, 0x34d440c4, 7 | BRF_GRA }, // 14 - - { "10.bin", 0x10000, 0x08149140, 8 | BRF_GRA }, // 15 Tiles - { "11.bin", 0x10000, 0x2ed7545b, 8 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(gulfstrmm) -STD_ROM_FN(gulfstrmm) - -struct BurnDriver BurnDrvGulfstrmm = { - "gulfstrmm", "gulfstrm", NULL, NULL, "1991", - "Gulf Storm (Media Shoji)\0", NULL, "Dooyong (Media Shoji license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, gulfstrmmRomInfo, gulfstrmmRomName, NULL, NULL, GulfstrmInputInfo, GulfstrmDIPInfo, - GulfstrmInit, Z80YM2203Exit, LastdayFrame, GulfstrmDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Gulf Storm (Korea) - -static struct BurnRomInfo gulfstrmkRomDesc[] = { - { "18.4L", 0x20000, 0x02bcf56d, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "3.c5", 0x10000, 0xc029b015, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "2.bin", 0x10000, 0xcb555d96, 3 | BRF_GRA }, // 2 Characters - - { "14.b1", 0x20000, 0x67bdf73d, 4 | BRF_GRA }, // 3 Sprites - { "16.c1", 0x20000, 0x7770a76f, 4 | BRF_GRA }, // 4 - { "15.b1", 0x20000, 0x84803f7e, 4 | BRF_GRA }, // 5 - { "17.e1", 0x20000, 0x94706500, 4 | BRF_GRA }, // 6 - - { "4.d8", 0x20000, 0x858fdbb6, 5 | BRF_GRA }, // 7 Tiles - { "5.b9", 0x20000, 0xc0a552e8, 5 | BRF_GRA }, // 8 - { "6.d8", 0x20000, 0x20eedda3, 5 | BRF_GRA }, // 9 - { "7.d9", 0x20000, 0x294f8c40, 5 | BRF_GRA }, // 10 - - { "12.bin", 0x20000, 0x3e3d3b57, 6 | BRF_GRA }, // 11 Tiles - { "13.bin", 0x20000, 0x66fcce80, 6 | BRF_GRA }, // 12 - - { "8.e8", 0x10000, 0x8d7f4693, 7 | BRF_GRA }, // 13 Tiles - { "9.e9", 0x10000, 0x34d440c4, 7 | BRF_GRA }, // 14 - - { "10.bin", 0x10000, 0x08149140, 8 | BRF_GRA }, // 15 Tiles - { "11.bin", 0x10000, 0x2ed7545b, 8 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(gulfstrmk) -STD_ROM_FN(gulfstrmk) - -struct BurnDriver BurnDrvGulfstrmk = { - "gulfstrmk", "gulfstrm", NULL, NULL, "1991", - "Gulf Storm (Korea)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, gulfstrmkRomInfo, gulfstrmkRomName, NULL, NULL, GulfstrmInputInfo, GulfstrmDIPInfo, - GulfstrmInit, Z80YM2203Exit, LastdayFrame, GulfstrmDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Pollux (set 1) - -static struct BurnRomInfo polluxRomDesc[] = { - { "pollux2.bin", 0x10000, 0x45e10d4e, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "pollux3.bin", 0x10000, 0x85a9dc98, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "pollux1.bin", 0x10000, 0x7f7135da, 3 | BRF_GRA }, // 2 Characters - - { "dy-pl-m2_be023.bin", 0x80000, 0xbdea6f7d, 4 | BRF_GRA }, // 3 Sprites - - { "dy-pl-m1_be015.bin", 0x80000, 0x1d2dedd2, 5 | BRF_GRA }, // 4 Tiles - - { "pollux6.bin", 0x20000, 0xb0391db5, 6 | BRF_GRA }, // 5 Tiles - { "pollux7.bin", 0x20000, 0x632f6e10, 6 | BRF_GRA }, // 6 - - { "pollux9.bin", 0x10000, 0x378d8914, 7 | BRF_GRA }, // 7 Tiles - { "pollux8.bin", 0x10000, 0x8859fa70, 7 | BRF_GRA }, // 8 - - { "pollux5.bin", 0x10000, 0xac090d34, 8 | BRF_GRA }, // 9 Tiles - { "pollux4.bin", 0x10000, 0x2c6bd3be, 8 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(pollux) -STD_ROM_FN(pollux) - -struct BurnDriver BurnDrvPollux = { - "pollux", NULL, NULL, NULL, "1991", - "Pollux (set 1)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, polluxRomInfo, polluxRomName, NULL, NULL, PolluxInputInfo, PolluxDIPInfo, - PolluxInit, Z80YM2203Exit, LastdayFrame, PolluxDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Pollux (set 2) - -static struct BurnRomInfo polluxaRomDesc[] = { - { "dooyong2.bin", 0x10000, 0xe4ea8dbd, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "pollux3.bin", 0x10000, 0x85a9dc98, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "dooyong1.bin", 0x10000, 0xa7d820b2, 3 | BRF_GRA }, // 2 Characters - - { "dy-pl-m2_be023.bin", 0x80000, 0xbdea6f7d, 4 | BRF_GRA }, // 3 Sprites - - { "dy-pl-m1_be015.bin", 0x80000, 0x1d2dedd2, 5 | BRF_GRA }, // 4 Tiles - - { "pollux6.bin", 0x20000, 0xb0391db5, 6 | BRF_GRA }, // 5 Tiles - { "pollux7.bin", 0x20000, 0x632f6e10, 6 | BRF_GRA }, // 6 - - { "pollux9.bin", 0x10000, 0x378d8914, 7 | BRF_GRA }, // 7 Tiles - { "pollux8.bin", 0x10000, 0x8859fa70, 7 | BRF_GRA }, // 8 - - { "pollux5.bin", 0x10000, 0xac090d34, 8 | BRF_GRA }, // 9 Tiles - { "pollux4.bin", 0x10000, 0x2c6bd3be, 8 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(polluxa) -STD_ROM_FN(polluxa) - -struct BurnDriver BurnDrvPolluxa = { - "polluxa", "pollux", NULL, NULL, "1991", - "Pollux (set 2)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, polluxaRomInfo, polluxaRomName, NULL, NULL, PolluxInputInfo, PolluxDIPInfo, - PolluxInit, Z80YM2203Exit, LastdayFrame, PolluxDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Pollux (set 3) - -static struct BurnRomInfo polluxa2RomDesc[] = { - { "dooyong16_tms27c512.bin", 0x10000, 0xdffe5173, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "pollux3.bin", 0x10000, 0x85a9dc98, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "dooyong1.bin", 0x10000, 0xa7d820b2, 3 | BRF_GRA }, // 2 Characters - - { "dy-pl-m2_be023.bin", 0x80000, 0xbdea6f7d, 4 | BRF_GRA }, // 3 Sprites - - { "dy-pl-m1_be015.bin", 0x80000, 0x1d2dedd2, 5 | BRF_GRA }, // 4 Tiles - - { "pollux6.bin", 0x20000, 0xb0391db5, 6 | BRF_GRA }, // 5 Tiles - { "pollux7.bin", 0x20000, 0x632f6e10, 6 | BRF_GRA }, // 6 - - { "pollux9.bin", 0x10000, 0x378d8914, 7 | BRF_GRA }, // 7 Tiles - { "pollux8.bin", 0x10000, 0x8859fa70, 7 | BRF_GRA }, // 8 - - { "pollux5.bin", 0x10000, 0xac090d34, 8 | BRF_GRA }, // 9 Tiles - { "pollux4.bin", 0x10000, 0x2c6bd3be, 8 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(polluxa2) -STD_ROM_FN(polluxa2) - -struct BurnDriver BurnDrvPolluxa2 = { - "polluxa2", "pollux", NULL, NULL, "1991", - "Pollux (set 3)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, polluxa2RomInfo, polluxa2RomName, NULL, NULL, PolluxInputInfo, PolluxDIPInfo, - PolluxInit, Z80YM2203Exit, LastdayFrame, PolluxDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Pollux (Japan, NTC license) - -static struct BurnRomInfo polluxnRomDesc[] = { - { "polluxntc_2.3g", 0x10000, 0x96d3e3af, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "polluxntc_3.6t", 0x10000, 0x85a9dc98, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "polluxntc_1.3r", 0x10000, 0x7f7135da, 3 | BRF_GRA }, // 2 Characters - - { "polluxntc_dy-pl-m2_be023.3t", 0x80000, 0xbdea6f7d, 4 | BRF_GRA }, // 3 Sprites - - { "polluxntc_dy-pl-m1_be002.8a", 0x80000, 0x1d2dedd2, 5 | BRF_GRA }, // 4 Tiles - - { "polluxntc_6.8m", 0x20000, 0xb0391db5, 6 | BRF_GRA }, // 5 Tiles - { "polluxntc_7.8l", 0x20000, 0x632f6e10, 6 | BRF_GRA }, // 6 - - { "polluxntc_9.8b", 0x10000, 0x378d8914, 7 | BRF_GRA }, // 7 Tiles - { "polluxntc_8.8j", 0x10000, 0x8859fa70, 7 | BRF_GRA }, // 8 - - { "polluxntc_5.8p", 0x10000, 0xac090d34, 8 | BRF_GRA }, // 9 Tiles - { "polluxntc_4.8r", 0x10000, 0x0195dc4e, 8 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(polluxn) -STD_ROM_FN(polluxn) - -struct BurnDriver BurnDrvPolluxn = { - "polluxn", "pollux", NULL, NULL, "1991", - "Pollux (Japan, NTC license)\0", NULL, "Dooyong (NTC license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, polluxnRomInfo, polluxnRomName, NULL, NULL, PolluxInputInfo, PolluxDIPInfo, - PolluxInit, Z80YM2203Exit, LastdayFrame, PolluxDraw, Z80YM2203Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Flying Tiger (set 1) - -static struct BurnRomInfo flytigerRomDesc[] = { - { "1.3c", 0x20000, 0x2d634c8e, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "3.6p", 0x10000, 0xd238df5e, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "2.4h", 0x10000, 0x2fb72912, 3 | BRF_GRA }, // 2 Characters - - { "16.4h", 0x20000, 0x8a158b95, 4 | BRF_GRA }, // 3 Sprites - { "15.2h", 0x20000, 0x399f6043, 4 | BRF_GRA }, // 4 - { "14.4k", 0x20000, 0xdf66b6f3, 4 | BRF_GRA }, // 5 - { "13.2k", 0x20000, 0xf24a5099, 4 | BRF_GRA }, // 6 - - { "dy-ft-m1.11n", 0x80000, 0xf06589c2, 5 | BRF_GRA }, // 7 Tiles - - { "dy-ft-m2.11g", 0x80000, 0x7545f9c9, 6 | BRF_GRA }, // 8 Tiles - - { "4.9n", 0x20000, 0xcd95cf9a, 7 | BRF_SND }, // 9 Samples -}; - -STD_ROM_PICK(flytiger) -STD_ROM_FN(flytiger) - -static INT32 FlytigerInit() -{ - return FlytigerCommonInit(0); -} - -struct BurnDriver BurnDrvFlytiger = { - "flytiger", NULL, NULL, NULL, "1992", - "Flying Tiger (set 1)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, flytigerRomInfo, flytigerRomName, NULL, NULL, BluehawkInputInfo, FlytigerDIPInfo, - FlytigerInit, Z80YM2151Exit, FlytigerFrame, FlytigerDraw, Z80YM2151Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Flying Tiger (set 2) - -static struct BurnRomInfo flytigeraRomDesc[] = { - { "ftiger_1.3c", 0x20000, 0x02acd1ce, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "ftiger_11.6p", 0x10000, 0xd238df5e, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "ftiger_2.4h", 0x10000, 0xca9d6713, 3 | BRF_GRA }, // 2 Characters - - { "ftiger_16.4h", 0x20000, 0x8a158b95, 4 | BRF_GRA }, // 3 Sprites - { "ftiger_15.2h", 0x20000, 0x399f6043, 4 | BRF_GRA }, // 4 - { "ftiger_14.4k", 0x20000, 0xdf66b6f3, 4 | BRF_GRA }, // 5 - { "ftiger_13.2k", 0x20000, 0xf24a5099, 4 | BRF_GRA }, // 6 - - { "ftiger_3.10p", 0x20000, 0x9fc12ebd, 5 | BRF_GRA }, // 7 Tiles - { "ftiger_5.10l", 0x20000, 0x06c9dd2a, 5 | BRF_GRA }, // 8 - { "ftiger_4.11p", 0x20000, 0xfb30e884, 5 | BRF_GRA }, // 9 - { "ftiger_6.11l", 0x20000, 0xdfb85152, 5 | BRF_GRA }, // 10 - - { "ftiger_8.11h", 0x20000, 0xcbd8c22f, 6 | BRF_GRA }, // 11 Tiles - { "ftiger_10.11f", 0x20000, 0xe2175f3b, 6 | BRF_GRA }, // 12 - { "ftiger_7.10h", 0x20000, 0xbe431c61, 6 | BRF_GRA }, // 13 - { "ftiger_9.10f", 0x20000, 0x91bcd84f, 6 | BRF_GRA }, // 14 - - { "ftiger_12.9n", 0x20000, 0xcd95cf9a, 7 | BRF_SND }, // 15 Samples -}; - -STD_ROM_PICK(flytigera) -STD_ROM_FN(flytigera) - -static INT32 FlytigeraInit() -{ - return FlytigerCommonInit(1); -} - -struct BurnDriver BurnDrvFlytigera = { - "flytigera", "flytiger", NULL, NULL, "1992", - "Flying Tiger (set 2)\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, flytigeraRomInfo, flytigeraRomName, NULL, NULL, BluehawkInputInfo, FlytigerDIPInfo, - FlytigeraInit, Z80YM2151Exit, FlytigerFrame, FlytigerDraw, Z80YM2151Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Blue Hawk - -static struct BurnRomInfo bluehawkRomDesc[] = { - { "rom19", 0x20000, 0x24149246, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "rom1", 0x10000, 0xeef22920, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "rom3", 0x10000, 0xc192683f, 3 | BRF_GRA }, // 2 Characters - - { "dy-bh-m3", 0x80000, 0x8809d157, 4 | BRF_GRA }, // 3 Sprites - - { "dy-bh-m1", 0x80000, 0x51816b2c, 5 | BRF_GRA }, // 4 Tiles - - { "dy-bh-m2", 0x80000, 0xf9daace6, 6 | BRF_GRA }, // 5 Tiles - - { "rom6", 0x20000, 0xe6bd9daa, 7 | BRF_GRA }, // 6 Tiles - { "rom5", 0x20000, 0x5c654dc6, 7 | BRF_GRA }, // 7 - - { "rom4", 0x20000, 0xf7318919, 8 | BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(bluehawk) -STD_ROM_FN(bluehawk) - -struct BurnDriver BurnDrvBluehawk = { - "bluehawk", NULL, NULL, NULL, "1993", - "Blue Hawk\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, bluehawkRomInfo, bluehawkRomName, NULL, NULL, BluehawkInputInfo, BluehawkDIPInfo, - BluehawkInit, Z80YM2151Exit, FlytigerFrame, BluehawkDraw, Z80YM2151Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Blue Hawk (NTC) - -static struct BurnRomInfo bluehawknRomDesc[] = { - { "rom19", 0x20000, 0x24149246, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "rom1", 0x10000, 0xeef22920, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "rom3ntc", 0x10000, 0x31eb221a, 3 | BRF_GRA }, // 2 Characters - - { "dy-bh-m3", 0x80000, 0x8809d157, 4 | BRF_GRA }, // 3 Sprites - - { "dy-bh-m1", 0x80000, 0x51816b2c, 5 | BRF_GRA }, // 4 Tiles - - { "dy-bh-m2", 0x80000, 0xf9daace6, 6 | BRF_GRA }, // 5 Tiles - - { "rom6", 0x20000, 0xe6bd9daa, 7 | BRF_GRA }, // 6 Tiles - { "rom5", 0x20000, 0x5c654dc6, 7 | BRF_GRA }, // 7 - - { "rom4", 0x20000, 0xf7318919, 8 | BRF_SND }, // 8 Samples -}; - -STD_ROM_PICK(bluehawkn) -STD_ROM_FN(bluehawkn) - -struct BurnDriver BurnDrvBluehawkn = { - "bluehawkn", "bluehawk", NULL, NULL, "1993", - "Blue Hawk (NTC)\0", NULL, "Dooyong (NTC license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, bluehawknRomInfo, bluehawknRomName, NULL, NULL, BluehawkInputInfo, BluehawkDIPInfo, - BluehawkInit, Z80YM2151Exit, FlytigerFrame, BluehawkDraw, Z80YM2151Scan, &DrvRecalc, 0x400, - 240, 384, 3, 4 -}; - - -// Sadari - -static struct BurnRomInfo sadariRomDesc[] = { - { "1.3d", 0x20000, 0xbd953217, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "3.6r", 0x10000, 0x4786fca6, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "2.4c", 0x20000, 0xb2a3f1c6, 3 | BRF_GRA }, // 2 Characters - - { "10.10l", 0x20000, 0x70269ab1, 4 | BRF_GRA }, // 3 Sprites - { "5.8l", 0x20000, 0xceceb4c3, 4 | BRF_GRA }, // 4 - { "9.10n", 0x20000, 0x21bd1bda, 4 | BRF_GRA }, // 5 - { "4.8n", 0x20000, 0xcd318ae5, 4 | BRF_GRA }, // 6 - - { "11.10j", 0x20000, 0x62a1d580, 5 | BRF_GRA }, // 7 Tiles - { "6.8j", 0x20000, 0xc4b13ed7, 5 | BRF_GRA }, // 8 - { "12.10g", 0x20000, 0x547b7645, 5 | BRF_GRA }, // 9 - { "7.8g", 0x20000, 0x14f20fa3, 5 | BRF_GRA }, // 10 - - { "8.10r", 0x20000, 0x9c29a093, 6 | BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(sadari) -STD_ROM_FN(sadari) - -static INT32 SadariInit() -{ - return PrimellaCommonInit(0); -} - -struct BurnDriver BurnDrvSadari = { - "sadari", NULL, NULL, NULL, "1993", - "Sadari\0", NULL, "Dooyong (NTC license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, sadariRomInfo, sadariRomName, NULL, NULL, BluehawkInputInfo, PrimellaDIPInfo, - SadariInit, Z80YM2151Exit, FlytigerFrame, PrimellaDraw, Z80YM2151Scan, &DrvRecalc, 0x400, - 384, 256, 4, 3 -}; - - -// Gun Dealer '94 - -static struct BurnRomInfo gundl94RomDesc[] = { - { "gd94_001.d3", 0x20000, 0x3a5cc045, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "gd94_003.r6", 0x10000, 0xea41c4ad, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "gd94_002.c5", 0x20000, 0x8575e64b, 3 | BRF_GRA }, // 2 Characters - - { "gd94_009.n9", 0x20000, 0x40eabf55, 4 | BRF_GRA }, // 3 Sprites - { "gd94_004.n7", 0x20000, 0x0654abb9, 4 | BRF_GRA }, // 4 - - { "gd94_012.g9", 0x20000, 0x117c693c, 5 | BRF_GRA }, // 5 Tiles - { "gd94_007.g7", 0x20000, 0x96a72c6d, 5 | BRF_GRA }, // 6 - - { "gd94_008.r9", 0x20000, 0xf92e5803, 6 | BRF_SND }, // 7 Samples - - { "gd94_011.j9", 0x20000, 0xd8ad0208, 7 | BRF_OPT }, // 8 cpu2 - - { "gd94_006.j7", 0x20000, 0x1d9536fe, 8 | BRF_OPT }, // 9 Tiles - { "gd94_010.l7", 0x20000, 0x4b74857f, 8 | BRF_OPT }, // 10 -}; - -STD_ROM_PICK(gundl94) -STD_ROM_FN(gundl94) - -static INT32 PrimellaInit() -{ - return PrimellaCommonInit(1); -} - -struct BurnDriver BurnDrvGundl94 = { - "gundl94", NULL, NULL, NULL, "1994", - "Gun Dealer '94\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, gundl94RomInfo, gundl94RomName, NULL, NULL, BluehawkInputInfo, PrimellaDIPInfo, - PrimellaInit, Z80YM2151Exit, FlytigerFrame, PrimellaDraw, Z80YM2151Scan, &DrvRecalc, 0x400, - 384, 256, 4, 3 -}; - - -// Primella - -static struct BurnRomInfo primellaRomDesc[] = { - { "1_d3.bin", 0x20000, 0x82fea4e0, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - - { "gd94_003.r6", 0x10000, 0xea41c4ad, 2 | BRF_PRG | BRF_ESS }, // 1 Audio CPU Code - - { "gd94_002.c5", 0x20000, 0x8575e64b, 3 | BRF_GRA }, // 2 Characters - - { "7_n9.bin", 0x20000, 0x20b6a574, 4 | BRF_GRA }, // 3 Sprites - { "4_n7.bin", 0x20000, 0xfe593666, 4 | BRF_GRA }, // 4 - - { "8_g9.bin", 0x20000, 0x542ecb83, 5 | BRF_GRA }, // 5 Tiles - { "5_g7.bin", 0x20000, 0x058ecac6, 5 | BRF_GRA }, // 6 - - { "gd94_008.r9", 0x20000, 0xf92e5803, 6 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(primella) -STD_ROM_FN(primella) - -struct BurnDriver BurnDrvPrimella = { - "primella", "gundl94", NULL, NULL, "1994", - "Primella\0", NULL, "Dooyong (NTC license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, primellaRomInfo, primellaRomName, NULL, NULL, BluehawkInputInfo, PrimellaDIPInfo, - PrimellaInit, Z80YM2151Exit, FlytigerFrame, PrimellaDraw, Z80YM2151Scan, &DrvRecalc, 0x400, - 384, 256, 4, 3 -}; - - -// Super-X (NTC) - -static struct BurnRomInfo superxRomDesc[] = { - { "2.3m", 0x020000, 0xbe7aebe7, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "3.3l", 0x020000, 0xdc4a25fc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.5u", 0x010000, 0x6894ce05, 2 | BRF_PRG | BRF_ESS }, // 2 Audio CPU Code - - { "spxo-m05.10m", 0x200000, 0x9120dd84, 3 | BRF_GRA }, // 3 Characters - - { "spxb-m04.8f", 0x100000, 0x91a7ac6e, 4 | BRF_GRA }, // 4 Sprites - - { "spxb-m03.8j", 0x100000, 0x8b42861b, 5 | BRF_GRA }, // 5 Tiles - - { "spxb-m02.8a", 0x100000, 0x21b8db78, 6 | BRF_GRA }, // 6 Tiles - - { "spxb-m01.8c", 0x100000, 0x60c69129, 7 | BRF_GRA }, // 7 Tiles - - { "spxb-ms3.10f", 0x020000, 0x8bf8c77d, 8 | BRF_GRA }, // 8 Tiles - { "spxb-ms4.10j", 0x020000, 0xd418a900, 8 | BRF_GRA }, // 9 - { "spxb-ms2.10a", 0x020000, 0x5ec87adf, 8 | BRF_GRA }, // 10 - { "spxb-ms1.10c", 0x020000, 0x40b4fe6c, 8 | BRF_GRA }, // 11 - - { "4.7v", 0x020000, 0x434290b5, 9 | BRF_SND }, // 12 Samples - { "5.7u", 0x020000, 0xebe6abb4, 9 | BRF_SND }, // 13 -}; - -STD_ROM_PICK(superx) -STD_ROM_FN(superx) - -static INT32 SuperxInit() -{ - return RsharkCommonInit(0); -} - -struct BurnDriver BurnDrvSuperx = { - "superx", NULL, NULL, NULL, "1994", - "Super-X (NTC)\0", NULL, "Dooyong (NTC license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, superxRomInfo, superxRomName, NULL, NULL, RsharkInputInfo, SuperxDIPInfo, - SuperxInit, Drv68KExit, RsharkFrame, RsharkDraw, Drv68KScan, &DrvRecalc, 0x800, - 240, 384, 3, 4 -}; - - -// Super-X (Mitchell) - -static struct BurnRomInfo superxmRomDesc[] = { - { "2_m.3m", 0x020000, 0x41c50aac, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "3_m.3l", 0x020000, 0x6738b703, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1_m.5u", 0x010000, 0x319fa632, 2 | BRF_PRG | BRF_ESS }, // 2 Audio CPU Code - - { "spxo-m05.10m", 0x200000, 0x9120dd84, 3 | BRF_GRA }, // 3 Characters - - { "spxb-m04.8f", 0x100000, 0x91a7ac6e, 4 | BRF_GRA }, // 4 Sprites - - { "spxb-m03.8j", 0x100000, 0x8b42861b, 5 | BRF_GRA }, // 5 Tiles - - { "spxb-m02.8a", 0x100000, 0x21b8db78, 6 | BRF_GRA }, // 6 Tiles - - { "spxb-m01.8c", 0x100000, 0x60c69129, 7 | BRF_GRA }, // 7 Tiles - - { "spxb-ms3.10f", 0x020000, 0x8bf8c77d, 8 | BRF_GRA }, // 8 Tiles - { "spxb-ms4.10j", 0x020000, 0xd418a900, 8 | BRF_GRA }, // 9 - { "spxb-ms2.10a", 0x020000, 0x5ec87adf, 8 | BRF_GRA }, // 10 - { "spxb-ms1.10c", 0x020000, 0x40b4fe6c, 8 | BRF_GRA }, // 11 - - { "4.7v", 0x020000, 0x434290b5, 9 | BRF_SND }, // 12 Samples - { "5.7u", 0x020000, 0xebe6abb4, 9 | BRF_SND }, // 13 -}; - -STD_ROM_PICK(superxm) -STD_ROM_FN(superxm) - -struct BurnDriver BurnDrvSuperxm = { - "superxm", "superx", NULL, NULL, "1994", - "Super-X (Mitchell)\0", NULL, "Dooyong (Mitchell license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, superxmRomInfo, superxmRomName, NULL, NULL, RsharkInputInfo, SuperxDIPInfo, - SuperxInit, Drv68KExit, RsharkFrame, RsharkDraw, Drv68KScan, &DrvRecalc, 0x800, - 240, 384, 3, 4 -}; - - -// R-Shark - -static struct BurnRomInfo rsharkRomDesc[] = { - { "rspl00.bin", 0x20000, 0x40356b9d, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "rspu00.bin", 0x20000, 0x6635c668, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "rse3.bin", 0x10000, 0x03c8fd17, 2 | BRF_PRG | BRF_ESS }, // 2 Audio CPU Code - - { "rse4.bin", 0x80000, 0xb857e411, 3 | BRF_GRA }, // 3 Characters - { "rse5.bin", 0x80000, 0x7822d77a, 3 | BRF_GRA }, // 4 - { "rse6.bin", 0x80000, 0x80215c52, 3 | BRF_GRA }, // 5 - { "rse7.bin", 0x80000, 0xbd28bbdc, 3 | BRF_GRA }, // 6 - - { "rse11.bin", 0x80000, 0x8a0c572f, 4 | BRF_GRA }, // 7 Sprites - { "rse10.bin", 0x80000, 0x139d5947, 4 | BRF_GRA }, // 8 - - { "rse15.bin", 0x80000, 0xd188134d, 5 | BRF_GRA }, // 9 Tiles - { "rse14.bin", 0x80000, 0x0ef637a7, 5 | BRF_GRA }, // 10 - - { "rse17.bin", 0x80000, 0x7ff0f3c7, 6 | BRF_GRA }, // 11 Tiles - { "rse16.bin", 0x80000, 0xc176c8bc, 6 | BRF_GRA }, // 12 - - { "rse21.bin", 0x80000, 0x2ea665af, 7 | BRF_GRA }, // 13 Tiles - { "rse20.bin", 0x80000, 0xef93e3ac, 7 | BRF_GRA }, // 14 - - { "rse12.bin", 0x20000, 0xfadbf947, 8 | BRF_GRA }, // 15 Tiles - { "rse13.bin", 0x20000, 0x323d4df6, 8 | BRF_GRA }, // 16 - { "rse18.bin", 0x20000, 0xe00c9171, 8 | BRF_GRA }, // 17 - { "rse19.bin", 0x20000, 0xd214d1d0, 8 | BRF_GRA }, // 18 - - { "rse1.bin", 0x20000, 0x0291166f, 9 | BRF_SND }, // 19 Samples - { "rse2.bin", 0x20000, 0x5a26ee72, 9 | BRF_SND }, // 20 -}; - -STD_ROM_PICK(rshark) -STD_ROM_FN(rshark) - -static INT32 RsharkInit() -{ - return RsharkCommonInit(1); -} - -struct BurnDriver BurnDrvRshark = { - "rshark", NULL, NULL, NULL, "1995", - "R-Shark\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, rsharkRomInfo, rsharkRomName, NULL, NULL, RsharkInputInfo, RsharkDIPInfo, - RsharkInit, Drv68KExit, RsharkFrame, RsharkDraw, Drv68KScan, &DrvRecalc, 0x800, - 240, 384, 3, 4 -}; - - -// Pop Bingo - -static struct BurnRomInfo popbingoRomDesc[] = { - { "rom2.3f", 0x20000, 0xb24513c6, 1 | BRF_PRG | BRF_ESS }, // 0 Main CPU Code - { "rom3.3e", 0x20000, 0x48070081, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "rom1.3p", 0x10000, 0x46e8d2c4, 2 | BRF_PRG | BRF_ESS }, // 2 Audio CPU Code - - { "rom5.9m", 0x80000, 0xe8d73e07, 3 | BRF_GRA }, // 3 Characters - { "rom6.9l", 0x80000, 0xc3db3975, 3 | BRF_GRA }, // 4 - - { "rom10.9a", 0x80000, 0x135ab90a, 4 | BRF_GRA }, // 5 Sprites - { "rom9.9c", 0x80000, 0xc9d90007, 4 | BRF_GRA }, // 6 - { "rom7.9h", 0x80000, 0xb2b4c13b, 4 | BRF_GRA }, // 7 - { "rom8.9e", 0x80000, 0x66c4b00f, 4 | BRF_GRA }, // 8 - - { "rom4.4r", 0x20000, 0x0fdee034, 5 | BRF_SND }, // 9 Samples -}; - -STD_ROM_PICK(popbingo) -STD_ROM_FN(popbingo) - -static INT32 PopbingoInit() -{ - return RsharkCommonInit(2); -} - -struct BurnDriver BurnDrvPopbingo = { - "popbingo", NULL, NULL, NULL, "1996", - "Pop Bingo\0", NULL, "Dooyong", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, popbingoRomInfo, popbingoRomName, NULL, NULL, RsharkInputInfo, PopbingoDIPInfo, - PopbingoInit, Drv68KExit, RsharkFrame, PopbingoDraw, Drv68KScan, &DrvRecalc, 0x800, - 384, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_dreamwld.cpp b/jan/src/burn/drv/pst90s/d_dreamwld.cpp deleted file mode 100644 index 5d11f6aa3..000000000 --- a/jan/src/burn/drv/pst90s/d_dreamwld.cpp +++ /dev/null @@ -1,1194 +0,0 @@ -// FB Alpha Dream World / Baryon driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvProtData; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvSprBuf2; -static UINT8 *DrvPalRAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvBg1RAM; -static UINT8 *DrvBg2RAM; -static UINT8 *DrvBgScrollRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[32]; -static UINT32 DrvInputs; -static UINT8 DrvDips[2]; - -static UINT8 *DrvOkiBank; -static INT32 protindex = 0; -static INT32 protsize; - -static struct BurnInputInfo CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 24, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 31, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 30, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 28, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 29, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 27, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 26, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 25, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 16, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 23, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 22, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 20, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 21, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 19, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 18, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 17, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common) - -static struct BurnDIPInfo DreamwldDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x0e, 0x00, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x04, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x06, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0e, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0a, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0e, 0x0c, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0e, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dreamwld) - -static struct BurnDIPInfo BaryonDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Bomb Stock" }, - {0x13, 0x01, 0x04, 0x04, "2" }, - {0x13, 0x01, 0x04, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x0e, 0x00, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x04, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x06, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0e, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0a, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0e, 0x0c, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0e, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Baryon) - -static struct BurnDIPInfo RolcrushDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x0e, 0x00, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x04, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x06, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0e, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0a, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0e, 0x0c, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0e, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x14, 0x01, 0x70, 0x20, "Level 1" }, - {0x14, 0x01, 0x70, 0x10, "Level 2" }, - {0x14, 0x01, 0x70, 0x00, "Level 3" }, - {0x14, 0x01, 0x70, 0x70, "Level 4" }, - {0x14, 0x01, 0x70, 0x60, "Level 5" }, - {0x14, 0x01, 0x70, 0x50, "Level 6" }, - {0x14, 0x01, 0x70, 0x40, "Level 7" }, - {0x14, 0x01, 0x70, 0x30, "Level 8" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Rolcrush) - -static struct BurnDIPInfo CutefghtDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 4, "Ticket Payout" }, - {0x13, 0x01, 0x60, 0x00, "No" }, - {0x13, 0x01, 0x60, 0x20, "Little" }, - {0x13, 0x01, 0x60, 0x60, "Normal" }, - {0x13, 0x01, 0x60, 0x40, "Much" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x0e, 0x00, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x04, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x06, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0e, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0a, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0e, 0x0c, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0e, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x14, 0x01, 0x70, 0x20, "Level 1" }, - {0x14, 0x01, 0x70, 0x10, "Level 2" }, - {0x14, 0x01, 0x70, 0x00, "Level 3" }, - {0x14, 0x01, 0x70, 0x70, "Level 4" }, - {0x14, 0x01, 0x70, 0x60, "Level 5" }, - {0x14, 0x01, 0x70, 0x50, "Level 6" }, - {0x14, 0x01, 0x70, 0x40, "Level 7" }, - {0x14, 0x01, 0x70, 0x30, "Level 8" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Cutefght) - -static struct BurnDIPInfo GaialastDIPList[]= -{ - {0x13, 0xff, 0xff, 0xf1, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "1" }, - {0x13, 0x01, 0x03, 0x03, "2" }, - {0x13, 0x01, 0x03, 0x01, "3" }, - {0x13, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Bomb Stock" }, - {0x13, 0x01, 0x04, 0x04, "2" }, - {0x13, 0x01, 0x04, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Lock Vertical Scroll" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x0e, 0x00, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x04, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x06, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0e, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0e, 0x0a, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0e, 0x0c, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0e, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x14, 0x01, 0x70, 0x20, "Level 1" }, - {0x14, 0x01, 0x70, 0x10, "Level 2" }, - {0x14, 0x01, 0x70, 0x00, "Level 3" }, - {0x14, 0x01, 0x70, 0x70, "Level 4" }, - {0x14, 0x01, 0x70, 0x60, "Level 5" }, - {0x14, 0x01, 0x70, 0x50, "Level 6" }, - {0x14, 0x01, 0x70, 0x40, "Level 7" }, - {0x14, 0x01, 0x70, 0x30, "Level 8" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Gaialast) - -inline static void palette_write(INT32 offset) -{ - offset &= 0x1ffe; - - UINT16 data = *((UINT16 *)(DrvPalRAM + offset)); - UINT8 r, g, b; - offset >>= 1; - - r = (data >> 10) & 0x1f; - g = (data >> 5) & 0x1f; - b = (data >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset] = BurnHighCol(r, g, b, 0); -} - -static void dreamwld_oki_setbank(INT32 chip, INT32 bank) -{ - DrvOkiBank[chip] = bank & 3; - UINT8 *sound = (chip) ? DrvSndROM1 : DrvSndROM0; - - MSM6295SetBank(chip, sound + 0x30000 + (0x10000 * DrvOkiBank[chip]), 0x30000, 0x3ffff); -} - -static UINT8 __fastcall dreamwld_read_byte(UINT32 address) -{ - switch (address) - { - case 0xc00000: - case 0xc00001: - case 0xc00002: - case 0xc00003: - return DrvInputs >> (8 * (~address & 0x3)); - - case 0xc00004: - case 0xc00005: - case 0xc00006: - case 0xc00007: - return DrvDips[address & 1]; - - case 0xc00018: - return MSM6295ReadStatus(0); - - case 0xc00028: - return MSM6295ReadStatus(1); - - case 0xc00030: - protindex++; - return DrvProtData[(protindex-1) % protsize]; - } - - bprintf (PRINT_NORMAL, _T("%5.5x, rb\n"), address); - - return 0; -} - -static UINT16 __fastcall dreamwld_read_word(UINT32 address) -{ - switch (address) - { - case 0xc00000: - case 0xc00002: - return DrvInputs >> (((~address >> 1) & 1) * 16); - - case 0xc00004: - case 0xc00006: - return (DrvDips[1] << 8) | DrvDips[0]; - } - - bprintf (PRINT_NORMAL, _T("%5.5x, rw\n"), address); - - return 0; -} - -static void __fastcall dreamwld_write_byte(UINT32 address, UINT8 data) -{ - - if ((address&0xffff00) == 0xb300) return; // garbage writes (cute fighter) - - switch (address) - { - case 0xc0000c: - case 0xc0000f: - dreamwld_oki_setbank(0, data & 3); - return; - - case 0xc00018: - MSM6295Command(0, data); - return; - - case 0x000001: - case 0x000002: - case 0x00000c: - case 0xc0fffc: - case 0xc0fffd: - case 0xc0fffe: - case 0xc0ffff: - case 0xc00010: - case 0xc00020: - // NOP - return; - - case 0xc0002c: - case 0xc0002f: - dreamwld_oki_setbank(1, data & 3); - return; - - case 0xc00028: - MSM6295Command(1, data); - return; - } - - bprintf (PRINT_NORMAL, _T("%5.5x, %2.2x wb\n"), address, data); -} - -static tilemap_callback( background ) -{ - UINT16 *ram = (UINT16*)DrvBg1RAM; - UINT32 *lnscroll = (UINT32 *)DrvBgScrollRAM; - INT32 bank = (lnscroll[0x104] >> 9) & 0x2000; - - TILE_SET_INFO(0, (ram[offs] & 0x1fff) + bank, (ram[offs] >> 13) + 0x80, 0); -} - -static tilemap_callback( foreground ) -{ - UINT16 *ram = (UINT16*)DrvBg2RAM; - UINT32 *lnscroll = (UINT32 *)DrvBgScrollRAM; - INT32 bank = (lnscroll[0x105] >> 9) & 0x2000; - - TILE_SET_INFO(0, (ram[offs] & 0x1fff) + bank, (ram[offs] >> 13) + 0xc0, 0); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - MSM6295Reset(1); // dreamwld - - protindex = 0; - - dreamwld_oki_setbank(0, 0); - dreamwld_oki_setbank(1, 0); // dreamwld - - return 0; -} - -static void DrvGfxDecode(UINT8 *src, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i-=2) { - src[i + 0] = src[i/2] >> 4; - src[i + 1] = src[i/2] & 0x0f; - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x0200000; - - DrvProtData = Next; Next += 0x0001000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x0080000; - DrvSndROM1 = Next; Next += 0x0080000; - - DrvGfxROM0 = Next; Next += 0x1000000; - DrvGfxROM1 = Next; Next += 0x0800000; - DrvGfxROM2 = Next; Next += 0x0040000; - - DrvPalette = (UINT32*)Next; Next += 0x02000 * sizeof(UINT32); - - AllRam = Next; - - DrvBgScrollRAM = Next; Next += 0x0002000; - DrvSprRAM = Next; Next += 0x0002000; - DrvSprBuf = Next; Next += 0x0002000; - DrvSprBuf2 = Next; Next += 0x0002000; - DrvPalRAM = Next; Next += 0x0002000; - DrvBg1RAM = Next; Next += 0x0002000; - DrvBg2RAM = Next; Next += 0x0002000; - Drv68KRAM = Next; Next += 0x0020000; - - DrvOkiBank = Next; Next += 0x0000002; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DreamwldRomLoad() -{ - if (BurnLoadRom(Drv68KROM + 0x000003, 0, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000002, 1, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 2, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 3, 4)) return 1; - - if (BurnLoadRom(DrvProtData, 5, 1)) return 1; - protsize = 0x6c9; - - if (BurnLoadRom(DrvSndROM0, 6, 1)) return 1; - if (BurnLoadRom(DrvSndROM1, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 11, 2)) return 1; - - return 0; -} - -static INT32 BaryonRomLoad() -{ - if (BurnLoadRom(Drv68KROM + 0x000003, 0, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000002, 2, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 3, 4)) return 1; - - if (BurnLoadRom(DrvProtData, 5, 1)) return 1; - protsize = 0x6bd; - - if (BurnLoadRom(DrvSndROM0, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 11, 2)) return 1; - - return 0; -} - -static INT32 CutefghtRomLoad() -{ - if (BurnLoadRom(Drv68KROM + 0x000003, 0, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000002, 2, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 3, 4)) return 1; - - if (BurnLoadRom(DrvProtData, 5, 1)) return 1; - protsize = 0x701; - - if (BurnLoadRom(DrvSndROM0, 6, 1)) return 1; - if (BurnLoadRom(DrvSndROM1, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x600000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 14, 2)) return 1; - - return 0; -} - -static INT32 RolcrushRomLoad() -{ - if (BurnLoadRom(Drv68KROM + 0x000003, 0, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000002, 2, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 3, 4)) return 1; - - if (BurnLoadRom(DrvProtData, 5, 1)) return 1; - protsize = 0x745; - - if (BurnLoadRom(DrvSndROM0, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 10, 2)) return 1; - - return 0; -} - -static INT32 GaialastRomLoad() -{ - if (BurnLoadRom(Drv68KROM + 0x000003, 0, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000002, 2, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 3, 4)) return 1; - - if (BurnLoadRom(DrvProtData, 5, 1)) return 1; - protsize = 0x6c9; - - if (BurnLoadRom(DrvSndROM0, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 12, 2)) return 1; - - return 0; -} - -static INT32 DrvInit(INT32 (*pInitCallback)()) -{ - BurnSetRefreshRate(57.79); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (pInitCallback) { - if (pInitCallback()) return 1; - } - - DrvGfxDecode(DrvGfxROM0, 0x800000); - DrvGfxDecode(DrvGfxROM1, 0x400000); - } - - SekInit(0, 0x68ec020); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x600000, 0x601fff, MAP_RAM); - SekMapMemory(DrvBg1RAM, 0x800000, 0x801fff, MAP_RAM); - SekMapMemory(DrvBg2RAM, 0x802000, 0x803fff, MAP_RAM); - SekMapMemory(DrvBgScrollRAM, 0x804000, 0x805fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xfe0000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, dreamwld_write_byte); - //SekSetWriteWordHandler(0, dreamwld_write_word); - //SekSetWriteLongHandler(0, dreamwld_write_long); - SekSetReadByteHandler(0, dreamwld_read_byte); - SekSetReadWordHandler(0, dreamwld_read_word); - //SekSetReadLongHandler(0, dreamwld_read_long); - SekClose(); - - MSM6295Init(0, 1000000 / 165, 1); - MSM6295Init(1, 1000000 / 165, 1); // dreamwld - MSM6295SetRoute(0, 0.45, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.45, BURN_SND_ROUTE_BOTH); - MSM6295SetBank(0, DrvSndROM0, 0, 0x2ffff); - MSM6295SetBank(1, DrvSndROM1, 0, 0x2ffff); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 16, 16, 64, 64); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, foreground_map_callback, 16, 16, 64, 64); - GenericTilemapSetGfx(0, DrvGfxROM1, 4, 16, 16, 0x400000, 0, 0xff); - GenericTilemapSetTransparent(1, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - - MSM6295Exit(0); - MSM6295Exit(1); - - GenericTilesExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(INT32 layer) -{ - UINT32 *scroll = (UINT32 *)DrvBgScrollRAM; - UINT16 *lnscroll = (UINT16 *)DrvBgScrollRAM; - - INT32 ctrl = scroll[0x104 + layer] >> 16; - - INT32 scrolly = scroll[0x100 + (layer * 2)] >> 16; - INT32 scrollx = (scroll[0x101 + (layer * 2)] >> 16) + (layer ? 5 : 3); - - GenericTilemapSetScrollY(layer, scrolly + 32); - - //bprintf (0, _T("CTRL %d %8.8x\n"), layer, scroll[0x104 + layer] >> 16); - - if ((ctrl & 0x0200) == 0x200) // row scroll - { - GenericTilemapSetScrollRows(layer, 1024/16); - - scroll += layer * 0x100; - - for (INT32 y = 0; y < 256; y += 16) - { - GenericTilemapSetScrollRow(layer, ((y + scrolly + 32) & 0xff) / 16, scrollx + (scroll[y / 16] >> 16)); - } - } - else if ((ctrl & 0x0300) == 0x100) // line scroll - { - GenericTilemapSetScrollRows(layer, 1024); - - scroll += layer * 0x100; - - for (INT32 y = 0; y < 256; y++) - { - GenericTilemapSetScrollRow(layer, (y + scrolly + 32) & 0x3ff, (scrollx + (lnscroll[(y + 32) & 0xff]))); - } - } - else if ((ctrl & 0x0300) == 0) // normal scroll - { - GenericTilemapSetScrollRows(layer, 1); - - GenericTilemapSetScrollX(layer, scrollx); - } - - GenericTilemapDraw(layer, pTransDraw, 0); -} - -static void draw_sprites() -{ - UINT16 *source = (UINT16*)DrvSprBuf2; - UINT16 *finish = source + 0x2000/2; - UINT16 *redirect = (UINT16 *)DrvGfxROM2; - - while (source < finish) - { - INT32 xpos, ypos, tileno, code, colour, xflip, yflip; - INT32 xsize, ysize, xinc, yinc, xct, yct; - - xpos = (source[1]&0x01ff); - ypos = (source[0]&0x01ff); - xsize = (source[1]&0x0e00) >> 9; - ysize = (source[0]&0x0e00) >> 9; - tileno = (source[3]&0xffff); - if (source[2]&1) tileno += 0x10000; // fix sprites in cute fighter -dink - colour = (source[2]&0x3f00) >> 8; - xflip = (source[2]&0x4000); - yflip = (source[2]&0x8000); - - xinc = 16; - yinc = 16; - - if (xflip) - { - xinc = -16; - xpos += 16*xsize; - } - - if (yflip) - { - yinc = -16; - ypos += 16 * ysize; - } - - xpos -= 16; - - for (yct=0;yct> 8) & 0x0f; - r |= r << 4; - - g = (data >> 4) & 0x0f; - g |= g << 4; - - b = (data >> 0) & 0x0f; - b |= b << 4; - - Palette[offset >> 1] = (r << 16) | (g << 8) | b; - DrvPalette[offset >> 1] = BurnHighCol(r, g, b, 0); -} - -void __fastcall drgnmst_write_byte(UINT32 address, UINT8 data) -{ - - if ((address & 0xffc000) == 0x900000) { - DrvPalRAM[(address & 0x3fff)] = data; - - palette_write(address & 0x3ffe); - - return; - } - - if (address >= 0x800100 && address <= 0x80011f) { - DrvVidRegs[address & 0x1f] = data; - return; - } - - - switch (address) - { - case 0x800030: - case 0x800031: - *coin_lockout = (~data >> 2) & 3; - return; - - case 0x800154: - case 0x800155: - // priority control - return; - - case 0x800181: - //bprintf (PRINT_NORMAL, _T("%5.5x %2.2x, wb\n"), address, data); - drgnmst_snd_command = data; - // hack = 1; - // pic16c5xRun(1000); - SekRunEnd();//? - // cpu_yield(); - return; - - case 0x800188: - case 0x800189: - drgnmst_snd_flag = 1; - return; - } -} - -void __fastcall drgnmst_write_word(UINT32 address, UINT16 data) -{ - - if ((address & 0xffc000) == 0x900000) { - *((UINT16 *)(DrvPalRAM + (address & 0x3ffe))) = data; - - palette_write(address & 0x3ffe); - - return; - } - - - if (address >= 0x800100 && address <= 0x80011f) { - *((UINT16*)(DrvVidRegs + (address & 0x1e))) = data; - return; - } - - switch (address) - { - case 0x800154: - *priority_control = data; - return; - - case 0x800180: - case 0x800181: - { - bprintf (PRINT_NORMAL, _T("%5.5x %4.4x, ww\n"), address, data); - - drgnmst_snd_command = (data & 0xff); - INT32 cycles = (SekTotalCycles() / 3) - nCyclesDone[1]; - nCyclesDone[1] += pic16c5xRun(cycles); - //SekRunEnd(); - // cpu_yield(); - } - return; - - case 0x800188: - case 0x800189: - drgnmst_snd_flag = 1; - return; - } -} - -UINT8 __fastcall drgnmst_read_byte(UINT32 address) -{ -// bprintf (PRINT_NORMAL, _T("%5.5x rb\n"), address); - - switch (address) - { - case 0x800000: - case 0x800001: - return (DrvInps[0] >> ((~address & 1) << 3)); - - case 0x800018: - case 0x800019: - return (DrvInps[1] >> ((~address & 1) << 3)); - - case 0x80001a: - return DrvDips[0]; - - case 0x80001c: - return DrvDips[1]; - - case 0x80001b: - case 0x80001d: - return 0xff; - - case 0x800176: - case 0x800177: - return (DrvInps[2] >> ((~address & 1) << 3));; - - } - - return 0; -} - -UINT16 __fastcall drgnmst_read_word(UINT32 address) -{ -// bprintf (PRINT_NORMAL, _T("%5.5x rw\n"), address); - - switch (address) - { - case 0x800000: - return DrvInps[0]; - - case 0x800018: - return DrvInps[1]; - - case 0x80001a: - return 0xff | (DrvDips[0] << 8); - - case 0x80001c: - return 0xff | (DrvDips[1] << 8); - - case 0x800176: - return DrvInps[2]; - } - - return 0; -} - -static void set_oki_bank0(INT32 bank) -{ - INT32 nBank = 0x40000 * (bank & 3); - - memcpy (MSM6295ROM + 0x000000, DrvSndROM0 + nBank, 0x40000); -} - -static void set_oki_bank1(INT32 bank) -{ - INT32 nBank = 0x40000 * (bank & 7); - - memcpy (MSM6295ROM + 0x100000, DrvSndROM1 + nBank, 0x40000); -} - -static UINT8 drgnmst_snd_command_r() -{ - INT32 data = 0; - - switch (drgnmst_oki_control & 0x1f) - { - case 0x12: data = MSM6295ReadStatus(1) & 0x0f; break;//(okim6295_status_1_r(machine, 0) & 0x0f); break; - case 0x16: data = MSM6295ReadStatus(0) & 0x0f; break;//(okim6295_status_0_r(machine, 0) & 0x0f); break; - case 0x0b: - case 0x0f: data = drgnmst_snd_command; break; - default: break; - } - - return data; -} - -static void drgnmst_snd_control_w(INT32 data) -{ - INT32 oki_new_bank; - drgnmst_oki_control = data; - - oki_new_bank = ((pic16c5x_port0 & 0xc) >> 2) | ((drgnmst_oki_control & 0x80) >> 5); - if (oki_new_bank != drgnmst_oki0_bank) { - drgnmst_oki0_bank = oki_new_bank; - if (drgnmst_oki0_bank) oki_new_bank--; - bprintf (PRINT_NORMAL, _T("bank0, %2.2x\n"), oki_new_bank); - set_oki_bank0(oki_new_bank); - } - oki_new_bank = ((pic16c5x_port0 & 0x3) >> 0) | ((drgnmst_oki_control & 0x20) >> 3); - if (oki_new_bank != drgnmst_oki1_bank) { - drgnmst_oki1_bank = oki_new_bank; - bprintf (PRINT_NORMAL, _T("bank1, %2.2x\n"), oki_new_bank); - set_oki_bank1(oki_new_bank); - } - - switch (drgnmst_oki_control & 0x1f) - { - case 0x15: - bprintf (PRINT_NORMAL, _T("0, %2.2x\n"), drgnmst_oki_command); - MSM6295Command(0, drgnmst_oki_command); - break; - - case 0x11: - bprintf (PRINT_NORMAL, _T("1, %2.2x\n"), drgnmst_oki_command); - MSM6295Command(1, drgnmst_oki_command); - break; - } -} - - -UINT8 drgnmst_sound_readport(UINT16 port) -{ -// if (port != 0x10)bprintf (PRINT_NORMAL, _T("%4.4x rp\n"), port); - - switch (port) - { - case 0x00: - return pic16c5x_port0; - - case 0x01: - return drgnmst_snd_command_r(); - - case 0x02: - if (drgnmst_snd_flag) { - drgnmst_snd_flag = 0; - return 0x40; - } - return 0; - - - case 0x10: - return 0; - } - - return 0; -} - -void drgnmst_sound_writeport(UINT16 port, UINT8 data) -{ -// bprintf (PRINT_NORMAL, _T("%4.4x %2.2x wp\n"), port, data); - - switch (port & 0xff) - { - case 0x00: - pic16c5x_port0 = data; - return; - - case 0x01: - drgnmst_oki_command = data; - return; - - case 0x02: - drgnmst_snd_control_w(data); - return; - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 24, 8, 16, 0 }; - INT32 XOffs0[32] = { 0x800000,0x800001,0x800002,0x800003,0x800004,0x800005,0x800006,0x800007, - 0x000000,0x000001,0x000002,0x000003,0x000004,0x000005,0x000006,0x000007, - 0x800020,0x800021,0x800022,0x800023,0x800024,0x800025,0x800026,0x800027, - 0x000020,0x000021,0x000022,0x000023,0x000024,0x000025,0x000026,0x000027 }; - INT32 YOffs0[16] = { 0*32,1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, - 8*32,9*32,10*32,11*32,12*32,13*32,14*32,15*32 }; - - - INT32 XOffs1[16] = { 0x2000000,0x2000001,0x2000002,0x2000003,0x2000004,0x2000005,0x2000006,0x2000007, - 0x0000000,0x0000001,0x0000002,0x0000003,0x0000004,0x0000005,0x0000006,0x0000007 }; - - INT32 YOffs1[32] = { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64,10*64,11*64,12*64,13*64,14*64,15*64, - 16*64,17*64,18*64,19*64,20*64,21*64,22*64,23*64, - 24*64,25*64,26*64,27*64,28*64,29*64,30*64,31*64 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x800000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x800000); - - GfxDecode(0x10000, 4, 16, 16, Plane, XOffs1 + 0, YOffs0, 0x200, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x10000, 4, 8, 8, Plane, XOffs0 + 8, YOffs0, 0x100, tmp, DrvGfxROM1); - GfxDecode(0x04000, 4, 16, 16, Plane, XOffs0 + 0, YOffs0, 0x200, tmp, DrvGfxROM2); - GfxDecode(0x01000, 4, 32, 32, Plane, XOffs0 + 0, YOffs1, 0x800, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - pic16c5xReset(); - - set_oki_bank0(0); - set_oki_bank1(0); - - MSM6295Reset(0); - MSM6295Reset(1); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - - DrvPicROM = Next; Next += 0x000400; - - MSM6295ROM = Next; Next += 0x140000; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x200000; - - DrvGfxROM0 = Next; Next += 0x1000000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROM2 = Next; Next += 0x400000; - DrvGfxROM3 = Next; Next += 0x400000; - - DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x000800; - - DrvBgRAM = Next; Next += 0x004000; - DrvMidRAM = Next; Next += 0x004000; - DrvFgRAM = Next; Next += 0x004000; - DrvRowScroll = Next; Next += 0x004000; - - DrvVidRegs = Next; Next += 0x000020; - priority_control= (UINT16*)Next; Next += 0x0002 /*1*/ * sizeof(UINT16); - - coin_lockout = Next; Next += 0x000004; // 1 - - Palette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - if (BurnLoadRom(tmp + 0, 2, 2)) return 1; - if (BurnLoadRom(tmp + 1, 3, 2)) return 1; - memcpy (DrvGfxROM0 + 0x000000, tmp + 0x000000, 0x100000); - memcpy (DrvGfxROM0 + 0x400000, tmp + 0x100000, 0x100000); - memcpy (DrvGfxROM0 + 0x100000, tmp + 0x200000, 0x100000); - memcpy (DrvGfxROM0 + 0x500000, tmp + 0x300000, 0x100000); - if (BurnLoadRom(tmp + 0, 4, 2)) return 1; - if (BurnLoadRom(tmp + 1, 5, 2)) return 1; - memcpy (DrvGfxROM0 + 0x200000, tmp + 0x000000, 0x080000); - memcpy (DrvGfxROM0 + 0x600000, tmp + 0x080000, 0x080000); - - if (BurnLoadRom(DrvGfxROM1 + 1, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0, 7, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0, 9, 1)) return 1; - if (BurnLoadRom(DrvSndROM1, 10, 1)) return 1; - BurnFree (tmp); - - if (BurnLoadPicROM(DrvPicROM, 8, 0xb7b)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x900000, 0x903fff, MAP_ROM); - SekMapMemory(DrvMidRAM, 0x904000, 0x907fff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x908000, 0x90bfff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x90c000, 0x90ffff, MAP_RAM); - SekMapMemory(DrvRowScroll, 0x920000, 0x923fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x930000, 0x9307ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, drgnmst_write_byte); - SekSetWriteWordHandler(0, drgnmst_write_word); - SekSetReadByteHandler(0, drgnmst_read_byte); - SekSetReadWordHandler(0, drgnmst_read_word); - SekClose(); - - pic16c5xInit(0, 0x16C55, DrvPicROM); - pic16c5xSetReadPortHandler(drgnmst_sound_readport); - pic16c5xSetWritePortHandler(drgnmst_sound_writeport); - - MSM6295Init(0, 1000000 / 132, 0); - MSM6295Init(1, 1000000 / 132, 0); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - pic16c5xExit(); - MSM6295Exit(0); - MSM6295Exit(1); - - BurnFree (AllMem); - - return 0; -} - -static void draw_background() -{ - UINT16 *ram = (UINT16*)DrvBgRAM; - INT32 scrollx = *((UINT16*)(DrvVidRegs + 0x14)) - 18; - INT32 scrolly = *((UINT16*)(DrvVidRegs + 0x16)); - - scrollx = (scrollx & 0x7ff) + 64; - scrolly = (scrolly & 0x7ff) + 16; - - for (INT32 offs = 0; offs < 0x1000; offs++) - { - INT32 sy = (offs & 0x3f) << 5; - INT32 sx = (offs >> 6) << 5; - - INT32 ofst = ((sx>>2)+((sy>>5)&7)+((sy>>8)<<9))<<1; - - INT32 code = (ram[ofst] & 0x1fff) + 0x800; - INT32 color = ram[ofst+1]; - INT32 flipy = color & 0x40; - INT32 flipx = color & 0x20; - - color &= 0x3f; - - sy -= scrolly; - if (sy < -31) sy += 0x800; - sx -= scrollx; - if (sx < -31) sx += 0x800; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x600, DrvGfxROM3); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x600, DrvGfxROM3); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x600, DrvGfxROM3); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x600, DrvGfxROM3); - } - } - } -} - -static void draw_16x16_rowscroll(INT32 code, INT32 sx, INT32 sy, INT32 color, INT32 flipx, INT32 flipy, INT32 scrolly, INT32 scroll_x, UINT16 *rowscroll) -{ - UINT8 *src = DrvGfxROM2 + code * 0x100; - INT32 flip = (flipx ? 0x0f : 0) | (flipy ? 0xf0 : 0); - - color = (color << 4) | 0x400; - - for (INT32 y = 0, off = 0; y < 16; y++) - { - INT32 yy = y + sy; - - INT32 px = sx - ((scroll_x + rowscroll[yy]) & 0x3ff); - - yy -= scrolly + 16; - - if (yy < -15) yy += 0x400; - if (yy >= nScreenHeight) break; - - for (INT32 x = 0; x < 16; x++, off++) - { - INT32 xx = (x + px); - - if (xx < -15) xx += 0x400; - - if (xx < 0 || yy < 0 || xx >= nScreenWidth) continue; - - if (src[off ^ flip] == 0x0f) continue; - - pTransDraw[(yy * nScreenWidth) + xx] = src[off ^ flip] | color; - } - } -} - -static void draw_midground() -{ - UINT16 *ram = (UINT16*)DrvMidRAM; - INT32 scrollx = *((UINT16*)(DrvVidRegs + 0x10)) - 16; - INT32 scrolly = *((UINT16*)(DrvVidRegs + 0x12)) & 0x3ff; - UINT16 *rowscroll = (UINT16*)(DrvRowScroll + ((DrvVidRegs[0x13] & 0x30) << 8)); - - for (INT32 offs = 0; offs < 0x1000; offs++) - { - INT32 sy = (offs & 0x3f) << 4; - INT32 sx = (offs >> 6) << 4; - - INT32 ofst = (sx+((sy>>4)&0x0f)+(((sy>>4)&0xf0)<<6))<<1; - - INT32 code = (ram[ofst] & 0x7fff) - 0x2000; - if (code == 0x800) continue; - INT32 color = ram[ofst+1]; - INT32 flipy = color & 0x40; - INT32 flipx = color & 0x20; - - color &= 0x1f; - - draw_16x16_rowscroll(code, sx - 64, sy, color, flipx, flipy, scrolly, scrollx, rowscroll); - } -} - -static void draw_foreground() -{ - UINT16 *ram = (UINT16*)DrvFgRAM; - INT32 scrollx = *((UINT16*)(DrvVidRegs + 0x0c)) - 18; - INT32 scrolly = *((UINT16*)(DrvVidRegs + 0x0e)); - - scrollx = (scrollx & 0x1ff) + 64; - scrolly = (scrolly & 0x1ff) + 16; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sy = (offs & 0x3f) << 3; - INT32 sx = (offs >> 6) << 3; - - INT32 ofst = ((sx<<2)+((sy>>3)&0x1f)+((sy&0x300)<<3))<<1; - - INT32 code = ram[ofst] & 0x0fff; - if (code == 0x0020) continue; - - INT32 color = ram[ofst+1]; - INT32 flipy = color & 0x40; - INT32 flipx = color & 0x20; - - color &= 0x1f; - - sy -= scrolly; - if (sy < -7) sy += 0x200; - sx -= scrollx; - if (sx < -7) sx += 0x200; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x200, DrvGfxROM1); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x200, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x200, DrvGfxROM1); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x200, DrvGfxROM1); - } - } - } -} - -static void draw_sprites() -{ - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - UINT16 *source = spriteram16; - UINT16 *finish = source + 0x800/2; - - while (source < finish) - { - INT32 incx,incy; - - INT32 number = source[2]; - INT32 xpos = source[0]-64; - INT32 ypos = source[1]-16; - INT32 flipx = source[3] & 0x0020; - INT32 flipy = source[3] & 0x0040; - INT32 wide = (source[3] & 0x0f00)>>8; - INT32 high = (source[3] & 0xf000)>>12; - INT32 colr = (source[3] & 0x001f); - - if ((source[3] & 0xff00) == 0xff00) break; - - if (!flipx) { incx = 16;} else { incx = -16; xpos += 16*wide; } - if (!flipy) { incy = 16;} else { incy = -16; ypos += 16*high; } - - for (INT32 y=0;y<=high;y++) { - for (INT32 x=0;x<=wide;x++) { - INT32 realx, realy, realnumber; - - realx = (xpos+incx*x); - realy = (ypos+incy*y); - realnumber = number+x+y*16; - - if (realy < -15 || realx < -15 || realy >= nScreenHeight || realx >= nScreenWidth) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, realnumber, realx, realy, colr, 4, 15, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, realnumber, realx, realy, colr, 4, 15, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, realnumber, realx, realy, colr, 4, 15, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, realnumber, realx, realy, colr, 4, 15, 0, DrvGfxROM0); - } - } - } - } - - source+=4; - } -} - - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x2000; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x000f; - - } - - switch (*priority_control) - { - case 0x2451: - case 0x2d9a: - case 0x2440: - case 0x245a: - draw_foreground(); - draw_midground(); - draw_background(); - break; - - case 0x23c0: - draw_background(); - draw_foreground(); - draw_midground(); - break; - - case 0x38da: - case 0x215a: - case 0x2140: - draw_foreground(); - draw_background(); - draw_midground(); - break; - - case 0x2d80: - draw_midground(); - draw_background(); - draw_foreground(); - break; - } - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - - { - memset (DrvInps, 0xff, 3 * sizeof(short)); - - for (INT32 i = 0; i < 16; i++) { - DrvInps[0] ^= (DrvJoy1[i] & 1) << i; - DrvInps[1] ^= (DrvJoy2[i] & 1) << i; - DrvInps[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInps[1] |= *coin_lockout; - } - - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 60, 4000000 / 60 }; -// INT32 nCyclesDone[2] = { 0, 0 }; - nCyclesDone[0] = 0; - nCyclesDone[1] = 0; - INT32 nCycleSegment; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCycleSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nCycleSegment); - - nCycleSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - nCyclesDone[1] += pic16c5xRun(nCycleSegment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - // memset (pSoundBuf, 0, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - // memset (pSoundBuf, 0, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029697; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - pic16c5xScan(nAction); - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - SCAN_VAR(pic16c5x_port0); - SCAN_VAR(drgnmst_oki_control); - SCAN_VAR(drgnmst_snd_command); - SCAN_VAR(drgnmst_snd_flag); - SCAN_VAR(drgnmst_oki0_bank); - SCAN_VAR(drgnmst_oki1_bank); - SCAN_VAR(drgnmst_oki_command); - - set_oki_bank0(drgnmst_oki0_bank); - set_oki_bank1(drgnmst_oki1_bank); - } - - return 0; -} - -// Dragon Master - -static struct BurnRomInfo drgnmstRomDesc[] = { - { "dm1000e", 0x080000, 0x29467dac, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "dm1000o", 0x080000, 0xba48e9cf, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "dm1003", 0x200000, 0x0ca10e81, 2 | BRF_GRA }, // 2 Sprites - { "dm1005", 0x200000, 0x4c2b1db5, 2 | BRF_GRA }, // 3 - { "dm1004", 0x080000, 0x1a9ac249, 2 | BRF_GRA }, // 4 - { "dm1006", 0x080000, 0xc46da6fc, 2 | BRF_GRA }, // 5 - - { "dm1007", 0x100000, 0xd5ad81c4, 3 | BRF_GRA }, // 6 Background Tiles - { "dm1008", 0x100000, 0xb8572be3, 3 | BRF_GRA }, // 7 - - { "pic16c55.hex", 0x000b7b, 0xf17011e7, 4 | BRF_PRG | BRF_ESS }, // 8 pic16c55 Hex data - - { "dm1001", 0x100000, 0x63566f7f, 5 | BRF_SND }, // 9 OKI6295 #0 Samples - - { "dm1002", 0x200000, 0x0f1a874e, 6 | BRF_SND }, // 10 OKI6295 #1 Samples -}; - -STD_ROM_PICK(drgnmst) -STD_ROM_FN(drgnmst) - -struct BurnDriver BurnDrvDrgnmst = { - "drgnmst", NULL, NULL, NULL, "1994", - "Dragon Master\0", NULL, "Unico", "Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, drgnmstRomInfo, drgnmstRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x2000, 384, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_drtomy.cpp b/jan/src/burn/drv/pst90s/d_drtomy.cpp deleted file mode 100644 index d217fc6f2..000000000 --- a/jan/src/burn/drv/pst90s/d_drtomy.cpp +++ /dev/null @@ -1,491 +0,0 @@ -// FB Alpha Dr. Tomy driver module -// Based on MAME driver by Pierpaolo Prazzoli - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" - -static UINT8 *Mem; -static UINT8 *MemEnd; -static UINT8 *RamStart; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvVidRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; - -static INT32 m6295bank; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 7, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy2 + 6, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 2"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 7, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy2 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 5, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xaf, NULL }, - - {0 , 0xfe, 0 , 11 , "Coin A" }, - {0x11, 0x01, 0x0f, 0x0a, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x07, "3 Coins 2 Credits" }, - {0x11, 0x01, 0x0f, 0x00, "5 Coins 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x0f, 0x06, "3 Coins 4 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "2 Coins 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 11 , "Coin B" }, - {0x11, 0x01, 0xf0, 0xa0, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xf0, 0x70, "3 Coins 2 Credits" }, - {0x11, 0x01, 0xf0, 0x00, "5 Coins 4 Credits" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xf0, 0x60, "3 Coins 4 Credits" }, - {0x11, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xf0, 0x80, "2 Coins 5 Credits" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2 , "Time" }, - {0x12, 0x01, 0x01, 0x00, "Less" }, - {0x12, 0x01, 0x01, 0x01, "More" }, - - {0 , 0xfe, 0 , 2 , "Number of Virus" }, - {0x12, 0x01, 0x02, 0x02, "Less" }, - {0x12, 0x01, 0x02, 0x00, "More" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x12, 0x01, 0x20, 0x20, "English" }, - {0x12, 0x01, 0x20, 0x00, "Italian" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x12, 0x01, 0x40, 0x40, "No" }, - {0x12, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Drv) - -static inline void drtomy_okibank(UINT8 data) -{ - m6295bank = data & 3; - - MSM6295SetBank(0, DrvSndROM + (m6295bank * 0x20000), 0x20000, 0x3ffff); -} - -static inline void palette_write(INT32 offset, UINT16 pal) -{ - INT32 r = (pal >> 10) & 0x1f; - INT32 g = (pal >> 5) & 0x1f; - INT32 b = (pal >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset] = BurnHighCol(r, g, b, 0); -} - -static UINT8 __fastcall drtomy_read_byte(UINT32 address) -{ - switch (address) - { - case 0x700001: - return DrvDips[0]; - - case 0x700003: - return DrvDips[1]; - - case 0x700005: - return DrvInputs[0]; - - case 0x700007: - return DrvInputs[1]; - - case 0x70000f: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static void __fastcall drtomy_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x70000d: - drtomy_okibank(data); - return; - - case 0x70000f: - MSM6295Command(0, data); - return; - } -} - -static void __fastcall drtomy_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff800) == 0x200000) { - *((UINT16*)(DrvPalRAM + (address & 0x7fe))) = data; - if (address < 0x200600) palette_write((address / 2) & 0x3ff, data); - return; - } -} - -static tilemap_callback( background ) -{ - UINT16 *ram = (UINT16*)(DrvVidRAM + 0x1000); - - INT32 attr = BURN_ENDIAN_SWAP_INT16(ram[offs]); - - TILE_SET_INFO(0, attr, attr >> 12, 0); -} - -static tilemap_callback( foreground ) -{ - UINT16 *ram = (UINT16*)(DrvVidRAM + 0x0000); - - INT32 attr = BURN_ENDIAN_SWAP_INT16(ram[offs]); - - INT32 flags = ((attr & 0xfff) == 0) ? TILE_SKIP : 0; - - TILE_SET_INFO(1, attr, attr >> 12, flags); -} - -static INT32 DrvDoReset() -{ - memset (RamStart, 0, RamEnd - RamStart); - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - - drtomy_okibank(0); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - static INT32 Planes[4] = { STEP4(0,0x200000) }; - static INT32 XOffs[16] = { STEP8(0,1), STEP8(128,1) }; - static INT32 YOffs[16] = { STEP16(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x100000); - - GfxDecode(0x8000, 4, 8, 8, Planes, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - GfxDecode(0x1000, 4, 16, 16, Planes, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KROM = Next; Next += 0x040000; - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x00300 * sizeof(UINT32); - - RamStart = Next; - - DrvVidRAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001000; - Drv68KRAM = Next; Next += 0x004000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xc0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 6, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0x100000, 0x101fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x200000, 0x1007ff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x440000, 0x440fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xffc000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, drtomy_write_byte); - SekSetWriteWordHandler(0, drtomy_write_word); - SekSetReadByteHandler(0, drtomy_read_byte); - SekClose(); - - MSM6295Init(0, 1625000 / 132, 0); - MSM6295SetBank(0, DrvSndROM, 0, 0x3ffff); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 16, 16, 32, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, foreground_map_callback, 16, 16, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM1, 4, 16, 16, 0x100000, 0x000, 0xf); - GenericTilemapSetGfx(1, DrvGfxROM1, 4, 16, 16, 0x100000, 0x200, 0xf); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - GenericTilesExit(); - MSM6295Exit(0); - - BurnFree (Mem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_sprites() -{ - UINT16 *spriteram = (UINT16*)DrvSprRAM; - - for (INT32 i = 3; i < 0x1000/2; i+=4) - { - INT32 sx = BURN_ENDIAN_SWAP_INT16(spriteram[i+2]) & 0x01ff; - INT32 sy = (240 - (BURN_ENDIAN_SWAP_INT16(spriteram[i]) & 0x00ff)) & 0x00ff; - INT32 number= BURN_ENDIAN_SWAP_INT16(spriteram[i+3]); - INT32 color = (BURN_ENDIAN_SWAP_INT16(spriteram[i+2]) & 0x1e00) >> 9; - INT32 attr = (BURN_ENDIAN_SWAP_INT16(spriteram[i]) & 0xfe00) >> 9; - - INT32 xflip = attr & 0x20; - INT32 yflip = attr & 0x40; - INT32 spr_size; - - if (attr & 0x04){ - spr_size = 1; - } else { - spr_size = 2; - number &= (~3); - } - - for (INT32 y = 0; y < spr_size; y++) - { - for (INT32 x = 0; x < spr_size; x++) - { - INT32 ex = xflip ? (spr_size-1-x) : x; - INT32 ey = yflip ? (spr_size-1-y) : y; - - INT32 sxx = sx-0x09+x*8; - INT32 syy = sy+y*8; - - syy -= 0x10; - - INT32 code = number + (ex * 2) + ey; - - if (yflip) { - if (xflip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sxx, syy, color, 4, 0, 0x100, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sxx, syy, color, 4, 0, 0x100, DrvGfxROM0); - } - } else { - if (xflip) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sxx, syy, color, 4, 0, 0x100, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sxx, syy, color, 4, 0, 0x100, DrvGfxROM0); - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT16 *ram = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x600/2; i++) { - palette_write(i,ram[i]); - } - } - - GenericTilemapDraw(0, pTransDraw, 0); - GenericTilemapDraw(1, pTransDraw, 0); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = DrvInputs[1] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - SekOpen(0); - SekRun(12000000 / 60); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) - { - SekScan(nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(m6295bank); - - if (nAction & ACB_WRITE) - drtomy_okibank(m6295bank); - } - - return 0; -} - - -// Dr. Tomy - -static struct BurnRomInfo drtomyRomDesc[] = { - { "15.u21", 0x20000, 0x0b8d763b, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "16.u22", 0x20000, 0x206f4d65, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "20.u80", 0x40000, 0x4d4d86ff, 2 | BRF_GRA }, // 2 Graphics - { "19.u81", 0x40000, 0x49ecbfe2, 2 | BRF_GRA }, // 3 - { "18.u82", 0x40000, 0x8ee5c921, 2 | BRF_GRA }, // 4 - { "17.u83", 0x40000, 0x42044b1c, 2 | BRF_GRA }, // 5 - - { "14.u23", 0x80000, 0x479614ec, 3 | BRF_SND }, // 6 Samples -}; - -STD_ROM_PICK(drtomy) -STD_ROM_FN(drtomy) - -struct BurnDriver BurnDrvDrtomy = { - "drtomy", NULL, NULL, NULL, "1993", - "Dr. Tomy\0", NULL, "Playmark", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, drtomyRomInfo, drtomyRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_egghunt.cpp b/jan/src/burn/drv/pst90s/d_egghunt.cpp deleted file mode 100644 index e5fe05e87..000000000 --- a/jan/src/burn/drv/pst90s/d_egghunt.cpp +++ /dev/null @@ -1,554 +0,0 @@ -// FB Alpha Egg Hunt driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM0; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; - -static UINT8 ram_bank; -static UINT8 gfx_bank; -static UINT8 oki_bank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo EgghuntInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Egghunt) - -static struct BurnDIPInfo EgghuntDIPList[]= -{ - {0x10, 0xff, 0xff, 0x61, NULL }, - {0x11, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Debug Mode" }, - {0x10, 0x01, 0x01, 0x01, "Off" }, - {0x10, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Credits per Player" }, - {0x10, 0x01, 0x60, 0x60, "1" }, - {0x10, 0x01, 0x60, 0x40, "2" }, - {0x10, 0x01, 0x60, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Censor Pictures" }, - {0x11, 0x01, 0x80, 0x00, "No" }, - {0x11, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Egghunt) - -static inline void palette_write(INT32 offset) -{ - INT32 d = (DrvPalRAM[offset + 1] << 8) | (DrvPalRAM[offset + 0]); - - INT32 r = (d >> 10) & 0x1f; - INT32 g = (d >> 5) & 0x1f; - INT32 b = (d >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -void __fastcall egghunt_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xc000) { - DrvPalRAM[address & 0x7ff] = data; - palette_write(address & 0x7fe); - return; - } -} - -static void set_ram_bank(INT32 data) -{ - ram_bank = data & 1; - - if (ram_bank) { - ZetMapArea(0xd000, 0xdfff, 0, DrvSprRAM); - ZetMapArea(0xd000, 0xdfff, 1, DrvSprRAM); - ZetMapArea(0xd000, 0xdfff, 2, DrvSprRAM); - } else { - ZetMapArea(0xd000, 0xdfff, 0, DrvVidRAM); - ZetMapArea(0xd000, 0xdfff, 1, DrvVidRAM); - ZetMapArea(0xd000, 0xdfff, 2, DrvVidRAM); - } -} - -void __fastcall egghunt_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - set_ram_bank(data); - return; - - case 0x01: - gfx_bank = data & 0x33; - return; - - case 0x03: - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - *soundlatch = data; - return; - } -} - -UINT8 __fastcall egghunt_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return DrvDips[0]; - - case 0x01: - return DrvInputs[0]; - - case 0x02: - return DrvInputs[1]; - - case 0x03: - return DrvInputs[2]; - - case 0x04: - return DrvDips[1]; - - case 0x06: - return 0xff; - } - - return 0; -} - -static void set_oki_bank(INT32 data) -{ - MSM6295SetBank(0, DrvSndROM0 + ((data & 0x10) >> 4) * 0x40000, 0x00000, 0x3ffff); -} - -void __fastcall egghunt_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe001: - oki_bank = data; - set_oki_bank(data); - return; - - case 0xe004: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall egghunt_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xe001: - return oki_bank; - - case 0xe004: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - set_oki_bank(0); - MSM6295Reset(0); - - oki_bank = 0; - ram_bank = 0; - gfx_bank = 0; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0x400000, 0x600000, 0x000000, 0x200000 }; - INT32 XOffs0[8] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; - INT32 XOffs1[16]= { 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x84, 0x85, 0x86, 0x87, 0x80, 0x81, 0x82, 0x83 }; - INT32 YOffs[16] = { 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, 0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x100000; i++) tmp[i] = DrvGfxROM0[i] ^ 0xff; - - GfxDecode(0x08000, 4, 8, 8, Plane, XOffs0, YOffs, 0x040, tmp, DrvGfxROM0); - - for (INT32 i = 0; i < 0x100000; i++) tmp[i] = DrvGfxROM1[i] ^ 0xff; - - GfxDecode(0x01000, 4, 16, 16, Plane, XOffs1, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x100000; - - DrvSndROM0 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x002000; - DrvVidRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - DrvColRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM1 = Next; Next += 0x001000; - - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(58.0); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, 9, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 10, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0xc000, 0xc7ff, 0, DrvPalRAM); -// ZetMapArea(0xc000, 0xc7ff, 1, DrvPalRAM); - ZetMapArea(0xc000, 0xc7ff, 2, DrvPalRAM); - ZetMapArea(0xc800, 0xcfff, 0, DrvColRAM); - ZetMapArea(0xc800, 0xcfff, 1, DrvColRAM); - ZetMapArea(0xc800, 0xcfff, 2, DrvColRAM); - ZetMapArea(0xd000, 0xdfff, 0, DrvVidRAM); - ZetMapArea(0xd000, 0xdfff, 1, DrvVidRAM); - ZetMapArea(0xd000, 0xdfff, 2, DrvVidRAM); - ZetMapArea(0xe000, 0xffff, 0, DrvZ80RAM0); - ZetMapArea(0xe000, 0xffff, 1, DrvZ80RAM0); - ZetMapArea(0xe000, 0xffff, 2, DrvZ80RAM0); - ZetSetWriteHandler(egghunt_main_write); - ZetSetOutHandler(egghunt_main_write_port); - ZetSetInHandler(egghunt_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80RAM1); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80RAM1); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80RAM1); - ZetSetWriteHandler(egghunt_sound_write); - ZetSetReadHandler(egghunt_sound_read); - ZetClose(); - - MSM6295Init(0, 1056000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - MSM6295ROM = NULL; - - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - for (INT32 offs = 0x1000 - 0x40; offs >= 0; offs -= 0x20) - { - INT32 attr = DrvSprRAM[offs + 1]; - INT32 code = DrvSprRAM[offs + 0] | ((attr & 0xe0) << 3); - INT32 sx = DrvSprRAM[offs + 3] | ((attr & 0x10) << 4); - INT32 sy = ((DrvSprRAM[offs + 2] + 8) & 0xff) - 8; - - if (attr & 0xe0) { - if (gfx_bank & 0x20) { - code += 0x400 << (gfx_bank & 1); - } - } - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx - 64, sy - 8, attr & 0x0f, 4, 15, 0, DrvGfxROM1); - } -} - -static void draw_background_layer() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = ((offs & 0x3f) << 3) - 64; - INT32 sy = ((offs >> 6) << 3) - 8; - - if (sy < 0 || sy >= nScreenHeight || sx < 0 || sx >= nScreenWidth) continue; - - INT32 code = ((DrvVidRAM[offs * 2 + 1] & 0x3f) << 8) | (DrvVidRAM[offs * 2 + 0]); - INT32 color = DrvColRAM[offs] & 0x3f; - - if (code & 0x2000) { - if (gfx_bank & 0x02) { - code += 0x2000 << (gfx_bank & 1); - } - } - - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - draw_background_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 6000000 / 60, 6000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment); - ZetClose(); - } - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - MSM6295Scan(0, nAction); - - SCAN_VAR(oki_bank); - SCAN_VAR(gfx_bank); - SCAN_VAR(ram_bank); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - set_ram_bank(ram_bank); - ZetClose(); - - set_oki_bank(oki_bank); - } - - return 0; -} - - -// Egg Hunt - -static struct BurnRomInfo egghuntRomDesc[] = { - { "prg.bin", 0x20000, 0xeb647145, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - - { "rom2.bin", 0x10000, 0x88a71bc3, 2 | BRF_ESS | BRF_PRG }, // 1 Z80 #1 Code - - { "rom3.bin", 0x40000, 0x9d51ac49, 3 | BRF_GRA }, // 2 Tiles - { "rom4.bin", 0x40000, 0x41c63041, 3 | BRF_GRA }, // 3 - { "rom5.bin", 0x40000, 0x6f96cb97, 3 | BRF_GRA }, // 4 - { "rom6.bin", 0x40000, 0xb5a41d4b, 3 | BRF_GRA }, // 5 - - { "rom7.bin", 0x20000, 0x1b43fb57, 4 | BRF_GRA }, // 6 Sprites - { "rom8.bin", 0x20000, 0xf8122d0d, 4 | BRF_GRA }, // 7 - { "rom9.bin", 0x20000, 0xdbfa0ffe, 4 | BRF_GRA }, // 8 - { "rom10.bin", 0x20000, 0x14f5fc74, 4 | BRF_GRA }, // 9 - - { "rom1.bin", 0x80000, 0xf03589bc, 5 | BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(egghunt) -STD_ROM_FN(egghunt) - -struct BurnDriver BurnDrvEgghunt = { - "egghunt", NULL, NULL, NULL, "1995", - "Egg Hunt\0", NULL, "Invi Image", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, egghuntRomInfo, egghuntRomName, NULL, NULL, EgghuntInputInfo, EgghuntDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 384, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_esd16.cpp b/jan/src/burn/drv/pst90s/d_esd16.cpp deleted file mode 100644 index 0a57ff2dd..000000000 --- a/jan/src/burn/drv/pst90s/d_esd16.cpp +++ /dev/null @@ -1,1951 +0,0 @@ -// FB Alpha ESD 16-bit hardware driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "eeprom.h" -#include "burn_ym3812.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfx0Trans; -static UINT8 *DrvGfx1Trans; -static UINT8 *DrvGfx2Trans; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvEepROM; - -static UINT32 *DrvPalette; -static UINT32 *Palette; -static UINT8 DrvRecalc; -static UINT16 *esd16_scroll_0; -static UINT16 *esd16_scroll_1; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT16 DrvInputs[3]; - -static UINT8 flipscreen; -static UINT8 soundlatch; -static UINT8 esd16_tilemap0_color; -static UINT16 head_layersize; -static UINT16 headpanic_platform_x; -static UINT16 headpanic_platform_y; -static UINT8 esd16_z80_bank; - -static INT32 game_select; -static INT32 weird_offsets = 0; - -static struct BurnInputInfo MultchmpInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 1, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy2 + 2, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 3, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy1 + 8, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy1 + 9, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy1 + 10, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy1 + 12, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy1 + 13, "p2 fire 2"}, - - {"Service" , BIT_DIGITAL , DrvJoy3 + 0, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Multchmp) - -static struct BurnInputInfo HedpanicInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 1, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy2 + 2, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 3, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy1 + 8, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy1 + 9, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy1 + 10, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy1 + 12, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy1 + 13, "p2 fire 2"}, - - {"Service" , BIT_DIGITAL , DrvJoy2 + 4, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, -}; - -STDINPUTINFO(Hedpanic) - -static struct BurnInputInfo SwatpolcInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 1, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy2 + 2, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 3, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy1 + 8, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy1 + 9, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy1 + 10, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy1 + 12, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy1 + 13, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy1 + 14, "p2 fire 3"}, - - {"Service" , BIT_DIGITAL , DrvJoy2 + 4, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, -}; - -STDINPUTINFO(Swatpolc) - -static struct BurnDIPInfo MultchmpDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL}, - {0x13, 0xff, 0xff, 0xff, NULL}, - - {0x12, 0xfe, 0, 2, "Coinage Type" }, - {0x12, 0x01, 0x02, 0x02, "1" }, - {0x12, 0x01, 0x02, 0x00, "2" }, - - {0x12, 0xfe, 0, 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0x12, 0xfe, 0, 2, "Flip Screen" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0x12, 0xfe, 0, 4, "Coin A" }, - {0x12, 0x01, 0x30, 0x10, "2C 1C" }, - {0x12, 0x01, 0x30, 0x30, "1C 1C" }, - {0x12, 0x01, 0x30, 0x00, "2C 3C" }, - {0x12, 0x01, 0x30, 0x20, "1C 2C" }, - - {0x12, 0xfe, 0, 4, "Coin B" }, - {0x12, 0x01, 0xc0, 0x40, "2C 1C" }, - {0x12, 0x01, 0xc0, 0xc0, "1C 1C" }, - {0x12, 0x01, 0xc0, 0x00, "2C 3C" }, - {0x12, 0x01, 0xc0, 0x80, "1C 2C" }, - - {0x13, 0xfe, 0, 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0x13, 0xfe, 0, 4, "Lives" }, - {0x13, 0x01, 0x0c, 0x00, "2" }, - {0x13, 0x01, 0x0c, 0x0c, "3" }, - {0x13, 0x01, 0x0c, 0x08, "4" }, - {0x13, 0x01, 0x0c, 0x04, "5" }, - - {0x13, 0xfe, 0, 2, "Selectable Games" }, - {0x13, 0x01, 0x10, 0x10, "3" }, - {0x13, 0x01, 0x10, 0x00, "4" }, - - {0x13, 0xfe, 0, 2, "Free Play" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Multchmp) - -//---------------------------------------------------------------------------------------------------------- - -static void palette_write(INT32 offset, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + offset)) = data; - - INT32 r = (data >> 10) & 0x1f; - INT32 g = (data >> 5) & 0x1f; - INT32 b = (data >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - Palette[offset>>1] = (r << 16) | (g << 8) | b; - DrvPalette[offset>>1] = BurnHighCol(r, g, b, 0); -} - -static inline void esd_sound_command_w(UINT8 data) -{ - soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); -} - -//---------------------------------------------------------------------------------------------------------- - -void __fastcall multchmp_write_byte(UINT32, UINT8) -{ - return; -} - -void __fastcall multchmp_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff800) == 0x200000) { - palette_write(address & 0x7ff, data); - return; - } - - switch (address) - { - case 0x500000: - case 0x500002: - esd16_scroll_0[(address>>1)&1] = data; - return; - - case 0x500004: - case 0x500006: - esd16_scroll_1[(address>>1)&1] = data; - return; - - case 0x600008: - esd16_tilemap0_color = data & 3; - flipscreen = data & 0x80; - return; - - case 0x60000c: - esd_sound_command_w(data); - return; - } - return; -} - -UINT8 __fastcall multchmp_read_byte(UINT32 address) -{ - switch (address) - { - case 0x600002: - case 0x600003: - case 0x600004: - case 0x600005: - case 0x600006: - case 0x600007: - return DrvInputs[(address - 0x600002) >> 1] >> ((~address & 1) << 3); - } - - return 0; -} - -UINT16 __fastcall multchmp_read_word(UINT32 address) -{ - switch (address) - { - case 0x600002: - case 0x600004: - case 0x600006: - return DrvInputs[(address - 0x600002) >> 1]; - } - - return 0; -} - -//---------------------------------------------------------------------------------------------------------- - -void __fastcall hedpanic_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xc0000e: - EEPROMWrite(data & 0x02, data & 0x01, (data & 0x04) >> 2); - return; - } - - return; -} - -void __fastcall hedpanic_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff000) == 0x800000) { - palette_write(address & 0xfff, data); - return; - } - - switch (address) - { - case 0xb00000: - case 0xb00002: - esd16_scroll_0[(address>>1)&1] = data; - return; - - case 0xb00004: - case 0xb00006: - esd16_scroll_1[(address>>1)&1] = data; - return; - - case 0xb00008: - headpanic_platform_x = data; - return; - - case 0xb0000a: - headpanic_platform_y = data; - return; - - case 0xb0000e: - head_layersize = data; - return; - - case 0xc00008: - esd16_tilemap0_color = data & 3; - flipscreen = data & 0x80; - return; - - case 0xc0000c: - esd_sound_command_w(data); - return; - - case 0xd00008: - INT32 ofst = (headpanic_platform_x + 0x40 * headpanic_platform_y) << 1; - - *((UINT16*)(DrvVidRAM1 + ofst)) = BURN_ENDIAN_SWAP_INT16(data); - return; - } - return; -} - -UINT8 __fastcall hedpanic_read_byte(UINT32 address) -{ - switch (address) - { - case 0xc00002: - case 0xc00003: - case 0xc00004: - case 0xc00005: - return DrvInputs[(address - 0xc00002) >> 1] >> ((~address & 1) << 3); - - case 0xc00006: - return (EEPROMRead() & 1) << 7; - } - //bprintf(0, _T("rb %X.\n"), address); - return 0; -} - -UINT16 __fastcall hedpanic_read_word(UINT32 /*address*/) -{ - //bprintf(0, _T("rw %X.\n"), address); - return 0; -} - -//---------------------------------------------------------------------------------------------------------- - -void __fastcall mchampdx_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x50000e: - EEPROMWrite(data & 0x02, data & 0x01, (data & 0x04) >> 6); - return; - } - - return; -} - -void __fastcall mchampdx_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff000) == 0x400000) { - palette_write(address & 0xfff, data); - return; - } - - switch (address) - { - case 0x500008: - esd16_tilemap0_color = data & 3; - flipscreen = data & 0x80; - return; - - case 0x50000c: - esd_sound_command_w(data); - return; - - case 0x700000: - case 0x700002: - esd16_scroll_0[(address>>1)&1] = data; - return; - - case 0x700004: - case 0x700006: - esd16_scroll_1[(address>>1)&1] = data; - return; - - case 0x700008: - headpanic_platform_x = data; - return; - - case 0x70000a: - headpanic_platform_y = data; - return; - - case 0x70000e: - head_layersize = data; - return; - - case 0xd00008: - INT32 ofst = (headpanic_platform_x + 0x40 * headpanic_platform_y) << 1; - - *((UINT16*)(DrvVidRAM1 + ofst)) = BURN_ENDIAN_SWAP_INT16(data); - return; - } - return; -} - -UINT8 __fastcall mchampdx_read_byte(UINT32 address) -{ - switch (address) - { - case 0x500002: - case 0x500003: - case 0x500004: - case 0x500005: - return DrvInputs[(address - 0x500002) >> 1] >> ((~address & 1) << 3); - - case 0x500006: - return (EEPROMRead() & 1) << 7; - - } - - return 0; -} - -UINT16 __fastcall mchampdx_read_word(UINT32 address) -{ - switch (address) - { - case 0x500002: - case 0x500004: - return DrvInputs[(address - 0x500002) >> 1]; - } - - return 0; -} - -//---------------------------------------------------------------------------------------------------------- - -void __fastcall tangtang_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x50000e: - EEPROMWrite(data & 0x02, data & 0x01, (data & 0x04) >> 6); - return; - } - return; -} - -void __fastcall tangtang_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff000) == 0x100000) { - palette_write(address & 0xfff, data); - return; - } - - switch (address) - { - case 0x400000: - case 0x400002: - esd16_scroll_0[(address>>1)&1] = data; - return; - - case 0x400004: - case 0x400006: - esd16_scroll_1[(address>>1)&1] = data; - return; - - case 0x400008: - headpanic_platform_x = data; - return; - - case 0x40000a: - headpanic_platform_y = data; - return; - - case 0x40000e: - head_layersize = data; - return; - - case 0x500008: - esd16_tilemap0_color = data & 3; - flipscreen = data & 0x80; - return; - - case 0x50000c: - esd_sound_command_w(data); - return; - - case 0x600008: - INT32 ofst = (headpanic_platform_x + 0x40 * headpanic_platform_y) << 1; - - *((UINT16*)(DrvVidRAM1 + ofst)) = BURN_ENDIAN_SWAP_INT16(data); - return; - } - return; -} - -UINT8 __fastcall tangtang_read_byte(UINT32 address) -{ - switch (address) - { - case 0x500002: - case 0x500003: - case 0x500004: - case 0x500005: - return DrvInputs[(address - 0x500002) >> 1] >> ((~address & 1) << 3); - - case 0x500006: - return (EEPROMRead() & 1) << 7; - } - - return 0; -} - -UINT16 __fastcall tangtang_read_word(UINT32 address) -{ - switch (address) - { - case 0x500002: - case 0x500004: - return DrvInputs[(address - 0x500002) >> 1]; - } - - return 0; -} - -//---------------------------------------------------------------------------------------------------------- - -static void esd16_sound_rombank_w(INT32 data) -{ - esd16_z80_bank = data & 0xf; - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + 0x4000 * esd16_z80_bank); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + 0x4000 * esd16_z80_bank); -} - -void __fastcall esd16_sound_write(UINT16, UINT8) -{ -} - -UINT8 __fastcall esd16_sound_read(UINT16) -{ - return 0; -} - -void __fastcall esd16_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM3812Write(0, 0, data); - return; - - case 0x01: - BurnYM3812Write(0, 1, data); - return; - - case 0x02: - MSM6295Command(0, data); - return; - - case 0x05: - esd16_sound_rombank_w(data); - return; - } -} - -UINT8 __fastcall esd16_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x02: - return MSM6295ReadStatus(0); - - case 0x03: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - - case 0x06: - return 0; - } - - return 0; -} - -//---------------------------------------------------------------------------------------------------------- - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - EEPROMReset(); - - if (game_select == 1 && EEPROMAvailable() == 0) { - EEPROMFill(DrvEepROM, 0, 0x80); - } - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - esd16_sound_rombank_w(0); - ZetClose(); - - MSM6295Reset(0); - BurnYM3812Reset(); - - soundlatch = 0; - flipscreen = 0; - esd16_tilemap0_color = 0; - esd16_z80_bank = 0; - head_layersize = 0; - headpanic_platform_x = 0; - headpanic_platform_y = 0; - - return 0; -} - -static void calculate_transparency_tables() -{ - memset (DrvGfx0Trans, 1, 0x08000); - memset (DrvGfx1Trans, 1, 0x10000); - memset (DrvGfx2Trans, 1, 0x06000); - - for (INT32 i = 0; i < 0x800000; i++) { - if (DrvGfxROM0[i]) DrvGfx0Trans[i>>8] = 0; - } - - for (INT32 i = 0; i < 0x400000; i++) { - if (DrvGfxROM1[i]) DrvGfx1Trans[i>>6] = 0; - } - - for (INT32 i = 0; i < 0x600000; i++) { - if (DrvGfxROM2[i]) DrvGfx2Trans[i>>8] = 0; - } -} - -static INT32 DrvGfxDecode() -{ - static INT32 Planes0[5] = { - 0x800000, 0x600000, 0x400000, 0x200000, 0x000000 - }; - - static INT32 XOffs0[16] = { - 0x007, 0x006, 0x005, 0x004, 0x003, 0x002, 0x001, 0x000, - 0x087, 0x086, 0x085, 0x084, 0x083, 0x082, 0x081, 0x080 - }; - - static INT32 YOffs0[16] = { - 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038, - 0x040, 0x048, 0x050, 0x058, 0x060, 0x068, 0x070, 0x078 - }; - - static INT32 Planes1[8] = { - 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007 - }; - - static INT32 XOffs1[8] = { - 0x1800000, 0x1000000, 0x0800000, 0x0000000, - 0x1800008, 0x1000008, 0x0800008, 0x0000008 - }; - - static INT32 YOffs1[8] = { - 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070 - }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x140000); - - GfxDecode(0x02000, 5, 16, 16, Planes0, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x400000); - - GfxDecode(0x10000, 8, 8, 8, Planes1, XOffs1, YOffs1, 0x080, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 HedpanicGfxDecode() -{ - static INT32 Planes0[5] = { 0x2000000, 0x0000000, 0x0000008, 0x1000000, 0x1000008 }; - - static INT32 XOffs0[16] = { - 0x007, 0x006, 0x005, 0x004, 0x003, 0x002, 0x001, 0x000, - 0x107, 0x106, 0x105, 0x104, 0x103, 0x102, 0x101, 0x100 - }; - - static INT32 YOffs0[16] = { - 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, - 0x080, 0x090, 0x0a0, 0x0b0, 0x0c0, 0x0d0, 0x0e0, 0x0f0 - }; - - static INT32 Planes1[8] = { - 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007 - }; - - static INT32 XOffs1[16] = { - 0x000, 0x010, 0x008, 0x018, 0x020, 0x030, 0x028, 0x038, - 0x200, 0x210, 0x208, 0x218, 0x220, 0x230, 0x228, 0x238 - }; - - static INT32 YOffs1[16] = { - 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, - 0x400, 0x440, 0x480, 0x4c0, 0x500, 0x540, 0x580, 0x5c0 - }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x600000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x500000); - - GfxDecode(0x08000, 5, 16, 16, Planes0, XOffs0, YOffs0, 0x200, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x400000); - - GfxDecode(0x10000, 8, 8, 8, Planes1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM1); - GfxDecode(0x04000, 8, 16, 16, Planes1, XOffs1, YOffs1, 0x800, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 TangtangGfxDecode() -{ - static INT32 Planes0[5] = { - 0x1000000, 0x0c00000, 0x0800000, 0x0400000, 0x0000000 - }; - - static INT32 XOffs0[16] = { - 0x007, 0x006, 0x005, 0x004, 0x003, 0x002, 0x001, 0x000, - 0x087, 0x086, 0x085, 0x084, 0x083, 0x082, 0x081, 0x080 - }; - - static INT32 YOffs0[16] = { - 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038, - 0x040, 0x048, 0x050, 0x058, 0x060, 0x068, 0x070, 0x078 - }; - - static INT32 Planes1[8] = { - 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007 - }; - - static INT32 XOffs1[16] = { - 0x000, 0x010, 0x008, 0x018, 0x020, 0x030, 0x028, 0x038, - 0x200, 0x210, 0x208, 0x218, 0x220, 0x230, 0x228, 0x238 - }; - - static INT32 YOffs1[16] = { - 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, - 0x400, 0x440, 0x480, 0x4c0, 0x500, 0x540, 0x580, 0x5c0 - }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x600000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x280000); - - GfxDecode(0x04000, 5, 16, 16, Planes0, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x400000); - - GfxDecode(0x10000, 8, 8, 8, Planes1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM1); - GfxDecode(0x04000, 8, 16, 16, Planes1, XOffs1, YOffs1, 0x800, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x0080000; - DrvZ80ROM = Next; Next += 0x0040000; - - DrvGfxROM0 = Next; Next += 0x0800000; - DrvGfxROM1 = Next; Next += 0x0400000; - DrvGfxROM2 = Next; Next += 0x0600000; - - DrvGfx0Trans = Next; Next += 0x0008000; - DrvGfx1Trans = Next; Next += 0x0010000; - DrvGfx2Trans = Next; Next += 0x0006000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x0080000; - DrvEepROM = Next; Next += 0x0000100; // from romset - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x0010000; - DrvZ80RAM = Next; Next += 0x0000800; - - DrvPalRAM = Next; Next += 0x0001000; - - DrvSprRAM = Next; Next += 0x0000800; - - DrvVidRAM0 = Next; Next += 0x0004000; - DrvVidRAM1 = Next; Next += 0x0004000; - - esd16_scroll_0 = (UINT16*)Next; Next += 0x0000004; - esd16_scroll_1 = (UINT16*)Next; Next += 0x0000004; - - Palette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static INT32 DrvInit(INT32 (*pInitCallback)()) -{ - INT32 nLen; - - AllMem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pInitCallback()) return 1; - - calculate_transparency_tables(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM); - ZetSetWriteHandler(esd16_sound_write); - ZetSetReadHandler(esd16_sound_read); - ZetSetInHandler(esd16_sound_in); - ZetSetOutHandler(esd16_sound_out); - ZetClose(); - - BurnYM3812Init(1, 4000000, NULL, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.30, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&eeprom_interface_93C46); // not used in multchmp - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - EEPROMExit(); - MSM6295Exit(0); - BurnYM3812Exit(); - SekExit(); - ZetExit(); - GenericTilesExit(); - - BurnFree (AllMem); - - weird_offsets = 0; - - return 0; -} - -//---------------------------------------------------------------------------------------------------------- - -static void esd16_draw_sprites(INT32 priority) -{ - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x800/2 - 8/2; offs += 8/2 ) - { - INT32 y, starty, endy; - - INT32 sx = BURN_ENDIAN_SWAP_INT16(spriteram16[ offs + 2 ]); - - if ((sx >> 15) != priority) continue; - - int sy = BURN_ENDIAN_SWAP_INT16(spriteram16[ offs ]); - int code = BURN_ENDIAN_SWAP_INT16(spriteram16[ offs + 1 ]); - int flash = sy & 0x1000; - - if (flash && nCurrentFrame & 1) continue; - - INT32 dimy = 0x10 << ((sy >> 9) & 3); - - INT32 flipx = 0; - - if (game_select) { - flipx = sy & 0x2000; - } - - INT32 color = (sx >> 9) & 0xf; - - sx = sx & 0x1ff; - if (sx >= 0x180) sx -= 0x200; - - if (game_select) { - sx -= 24; - sy = 0x1ff - (sy & 0x1ff); - starty = sy - dimy; - endy = sy; - } else { - sy = 0x100 - ((sy & 0xff) - (sy & 0x100)); - sy -= dimy; - starty = sy; - endy = sy + dimy; - } - - if (sx >= nScreenWidth || sx < -15) continue; - - for (y = starty - 8; y != endy - 8; y += 16, code++) - { - if (y >= nScreenHeight || y < -15 || DrvGfx0Trans[code]) continue; - - if (sx >= 0 && y >= 0 && sx <= 303 && y <= 223) { - - if (flipx) { - Render16x16Tile_Mask_FlipX(pTransDraw, code, sx, y, color, 5, 0, 0x200, DrvGfxROM0); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, y, color, 5, 0, 0x200, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, y, color, 5, 0, 0x200, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, y, color, 5, 0, 0x200, DrvGfxROM0); - } - } - } - } -} - -static void draw_layer_8x8(UINT8 *vidram, INT32 color, INT32 transp, INT32 scrollx, INT32 scrolly, INT32 fg) -{ - UINT16 *vram = (UINT16*)vidram; - - //scrollx &= 0x3ff; breaks a few frames of scrolling in hedpanic - scrolly &= 0x1ff; - - if (weird_offsets && fg == 0) scrollx += -3; //hedpanic - - for (INT32 offs = 0; offs < 0x4000 / 2; offs++) { - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - - if (DrvGfx1Trans[code] && transp) continue; - - INT32 sx = (offs & 0x7f) << 3; - INT32 sy = (offs >> 7) << 3; - - sx -= scrollx; - sy -= scrolly; - if (sx > 0x3ff) sx -= 0x400; - if (sy > 0x1ff) sy -= 0x200; - if (sx < -0x07) sx += 0x400; - if (sy < -0x07) sy += 0x200; - - if (sx < -7 || sy < -7 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (sx >= 0 && sy >= 0 && sx <= 311 && sy <= 231) { - if (transp) { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 8, 0, 0, DrvGfxROM1); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, color, 8, 0, DrvGfxROM1); - } - } else { - if (transp) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 8, 0, 0, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 8, 0, DrvGfxROM1); - } - } - } - - return; -} - -static void draw_layer_16x16(UINT8 *vidram, INT32 color, INT32 transp, INT32 scrollx, INT32 scrolly, INT32 fg) -{ - UINT16 *vram = (UINT16*)vidram; - - scrollx &= 0x3ff; - scrolly &= 0x3ff; - - if (weird_offsets && fg == 1) scrollx += 4; //hedpanic - - for (INT32 offs = 0; offs < 0x1000 / 2; offs++) { - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]) & 0x3fff; - - if (DrvGfx2Trans[code] && transp) continue; - - INT32 sx = (offs & 0x3f) << 4; - INT32 sy = (offs >> 6) << 4; - - sx -= scrollx-4; - sy -= scrolly; - - if (sx > 0x3ff) sx -= 0x400; - if (sy > 0x3ff) sy -= 0x400; - if (sx < -0x0f) sx += 0x400; - if (sy < -0x0f) sy += 0x400; - - if (sx < -15 || sy < -15 || sx >= nScreenWidth || sy >= nScreenHeight) continue; - - if (sx >= 0 && sy >= 0 && sx <= 303 && sy <= 223) { - if (transp) { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 8, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile(pTransDraw, code, sx, sy, color, 8, 0, DrvGfxROM2); - } - } else { - if (transp) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 8, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 8, 0, DrvGfxROM2); - } - } - } - - return; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16&0xff, rgb >> 8&0xff, rgb&0xff, 0); - } - } - - BurnTransferClear(); - - if (head_layersize & 0x0001) { - if (nBurnLayer & 1) draw_layer_16x16(DrvVidRAM0, esd16_tilemap0_color, 0, esd16_scroll_0[0] + 0x62, esd16_scroll_0[1]+8, 0); - } else { - if (nBurnLayer & 1) draw_layer_8x8(DrvVidRAM0, esd16_tilemap0_color, 0, esd16_scroll_0[0] + 0x62, esd16_scroll_0[1]+8, 0); - } - - if (nSpriteEnable & 1) esd16_draw_sprites(1); - - if (head_layersize & 0x0002) { - if (nBurnLayer & 2) draw_layer_16x16(DrvVidRAM1, 0, 1, esd16_scroll_1[0] + 0x60, esd16_scroll_1[1]+8, 1); - } else { - if (nBurnLayer & 2) draw_layer_8x8(DrvVidRAM1, 0, 1, esd16_scroll_1[0] + 0x60, esd16_scroll_1[1]+8, 1); - } - - if (nSpriteEnable & 2) esd16_draw_sprites(0); - - if (flipscreen) { - INT32 screensize = nScreenWidth * nScreenHeight; - for (INT32 i = 0; i < screensize>>1; i++) { - INT32 t = pTransDraw[i]; - pTransDraw[i] = pTransDraw[screensize-(i+1)]; - pTransDraw[screensize-(i+1)] = t; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = DrvInputs[1] = DrvInputs[2] = ~0; - - if (game_select == 0) { - DrvInputs[2] = (DrvDips[1] << 8) | DrvDips[0]; - } - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - } - - SekNewFrame(); - ZetNewFrame(); - - INT32 nCyclesSegment; - INT32 nInterleave = 64; - INT32 nCyclesTotal[2] = { 16000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - - nCyclesDone[0] += SekRun(nCyclesSegment); - - nCyclesSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - if (i & 1) ZetNmi(); - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -//---------------------------------------------------------------------------------------------------------- - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029692; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - EEPROMScan(nAction, pnMin); - - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - SCAN_VAR(flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(esd16_tilemap0_color); - SCAN_VAR(head_layersize); - SCAN_VAR(headpanic_platform_x); - SCAN_VAR(headpanic_platform_y); - SCAN_VAR(game_select); - SCAN_VAR(esd16_z80_bank); - - ZetOpen(0); - esd16_sound_rombank_w(esd16_z80_bank); - ZetClose(); - } - - return 0; -} - -//---------------------------------------------------------------------------------------------------------- - -// Multi Champ (World) - -static struct BurnRomInfo multchmpRomDesc[] = { - { "esd2.cu02", 0x040000, 0x2d1b098a, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd1.cu03", 0x040000, 0x10974063, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x020000, 0x7c178bd7, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "esd14.ju03", 0x040000, 0xa6122225, 3 | BRF_GRA }, // 3 - Sprites - { "esd15.ju04", 0x040000, 0x88b7a97c, 3 | BRF_GRA }, // 4 - { "esd16.ju05", 0x040000, 0xe670a6da, 3 | BRF_GRA }, // 5 - { "esd17.ju06", 0x040000, 0xa69d4399, 3 | BRF_GRA }, // 6 - { "esd13.ju07", 0x040000, 0x22071594, 3 | BRF_GRA }, // 7 - - { "esd5.fu27", 0x080000, 0x299f32c2, 4 | BRF_GRA }, // 8 - Tiles - { "esd6.fu32", 0x080000, 0xe2689bb2, 4 | BRF_GRA }, // 9 - { "esd11.fu29", 0x080000, 0x9bafd8ee, 4 | BRF_GRA }, // 10 - { "esd12.fu33", 0x080000, 0xc6b86001, 4 | BRF_GRA }, // 11 - { "esd7.fu26", 0x080000, 0xa783a003, 4 | BRF_GRA }, // 12 - { "esd8.fu30", 0x080000, 0x22861af2, 4 | BRF_GRA }, // 13 - { "esd9.fu28", 0x080000, 0x6652c04a, 4 | BRF_GRA }, // 14 - { "esd10.fu31", 0x080000, 0xd815974b, 4 | BRF_GRA }, // 15 - - { "esd4.su10", 0x020000, 0x6e741fcd, 5 | BRF_SND }, // 16 - OKI Samples -}; - -STD_ROM_PICK(multchmp) -STD_ROM_FN(multchmp) - -static INT32 multchmpCallback() -{ - game_select = 0; - weird_offsets = 1; - - { - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvGfxROM0 + i * 0x40000, i + 3, 1)) return 1; - } - - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x80000, i + 8, 1)) return 1; - } - - if (BurnLoadRom(DrvSndROM, 16, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x200000, 0x2005ff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x300000, 0x3007ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x300800, 0x300fff, MAP_RAM); // mirror - SekMapMemory(DrvVidRAM0, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x420000, 0x423fff, MAP_RAM); - SekSetWriteByteHandler(0, multchmp_write_byte); - SekSetWriteWordHandler(0, multchmp_write_word); - SekSetReadByteHandler(0, multchmp_read_byte); - SekSetReadWordHandler(0, multchmp_read_word); - SekClose(); - - return 0; -} - -static INT32 MultchmpInit() -{ - return DrvInit(multchmpCallback); -} - -struct BurnDriver BurnDrvMultchmp = { - "multchmp", NULL, NULL, NULL, "1999", - "Multi Champ (World)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, multchmpRomInfo, multchmpRomName, NULL, NULL, MultchmpInputInfo, MultchmpDIPInfo, - MultchmpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Multi Champ (Korea, older) - -static struct BurnRomInfo multchmkRomDesc[] = { - { "multchmp.u02", 0x040000, 0x7da8c0df, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "multchmp.u03", 0x040000, 0x5dc62799, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x020000, 0x7c178bd7, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "multchmp.u36", 0x040000, 0xd8f06fa8, 3 | BRF_GRA }, // 3 - Sprites - { "multchmp.u37", 0x040000, 0xb1ae7f08, 3 | BRF_GRA }, // 4 - { "multchmp.u38", 0x040000, 0x88e252e8, 3 | BRF_GRA }, // 5 - { "multchmp.u39", 0x040000, 0x51f01067, 3 | BRF_GRA }, // 6 - { "multchmp.u35", 0x040000, 0x9d1590a6, 3 | BRF_GRA }, // 7 - - { "multchmp.u27", 0x080000, 0xdc42704e, 4 | BRF_GRA }, // 8 - Tiles - { "multchmp.u28", 0x080000, 0x449991fa, 4 | BRF_GRA }, // 9 - { "multchmp.u33", 0x080000, 0xe4c0ec96, 4 | BRF_GRA }, // 10 - { "multchmp.u34", 0x080000, 0xbffaaccc, 4 | BRF_GRA }, // 11 - { "multchmp.u29", 0x080000, 0x01bd1399, 4 | BRF_GRA }, // 12 - { "multchmp.u30", 0x080000, 0xc6b4cc18, 4 | BRF_GRA }, // 13 - { "multchmp.u31", 0x080000, 0xb1e4e9e3, 4 | BRF_GRA }, // 14 - { "multchmp.u32", 0x080000, 0xf05cb5b4, 4 | BRF_GRA }, // 15 - - { "esd4.su10", 0x020000, 0x6e741fcd, 5 | BRF_SND }, // 16 - OKI Samples -}; - -STD_ROM_PICK(multchmk) -STD_ROM_FN(multchmk) - -struct BurnDriver BurnDrvMultchmk = { - "multchmpk", "multchmp", NULL, NULL, "1999", - "Multi Champ (Korea, older)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, multchmkRomInfo, multchmkRomName, NULL, NULL, MultchmpInputInfo, MultchmpDIPInfo, - MultchmpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Multi Champ (World, older) - -static struct BurnRomInfo multchmaRomDesc[] = { - { "esd2.cu02", 0x040000, 0xbfd39198, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd1.cu03", 0x040000, 0xcd769077, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su01", 0x020000, 0x7c178bd7, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "esd14.ju03", 0x040000, 0xd8f06fa8, 3 | BRF_GRA }, // 3 - Sprites - { "esd15.ju04", 0x040000, 0xb1ae7f08, 3 | BRF_GRA }, // 4 - { "esd16.ju05", 0x040000, 0x88e252e8, 3 | BRF_GRA }, // 5 - { "esd17.ju06", 0x040000, 0x51f01067, 3 | BRF_GRA }, // 6 - { "esd13.ju07", 0x040000, 0x9d1590a6, 3 | BRF_GRA }, // 7 - - { "esd5.fu27", 0x080000, 0xed5b4e58, 4 | BRF_GRA }, // 8 - Tiles - { "esd6.fu32", 0x080000, 0x97fde7b1, 4 | BRF_GRA }, // 9 - { "esd11.fu29", 0x080000, 0xd3c1855e, 4 | BRF_GRA }, // 10 - { "esd12.fu33", 0x080000, 0xa68848a8, 4 | BRF_GRA }, // 11 - { "esd7.fu26", 0x080000, 0x042d59ff, 4 | BRF_GRA }, // 12 - { "esd8.fu30", 0x080000, 0xfa8cd2d3, 4 | BRF_GRA }, // 13 - { "esd9.fu28", 0x080000, 0xa3cfe895, 4 | BRF_GRA }, // 14 - { "esd10.fu31", 0x080000, 0x396d77b6, 4 | BRF_GRA }, // 15 - - { "esd4.su08", 0x020000, 0x6e741fcd, 5 | BRF_SND }, // 16 - OKI Samples -}; - -STD_ROM_PICK(multchma) -STD_ROM_FN(multchma) - -struct BurnDriver BurnDrvMultchma = { - "multchmpa", "multchmp", NULL, NULL, "1999", - "Multi Champ (World, older)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, multchmaRomInfo, multchmaRomName, NULL, NULL, MultchmpInputInfo, MultchmpDIPInfo, - MultchmpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Head Panic (ver. 0117, 17/01/2000) - -static struct BurnRomInfo hedpanicRomDesc[] = { - { "esd2.cu03", 0x040000, 0x7c7be3bb, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd1.cu02", 0x040000, 0x42405e9d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0xa88d4424, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "esd7.ju02", 0x200000, 0x055d525f, 3 | BRF_GRA }, // 3 - Sprites - { "esd6.ju01", 0x200000, 0x5858372c, 3 | BRF_GRA }, // 4 - { "esd5.ju07", 0x080000, 0xbd785921, 3 | BRF_GRA }, // 5 - - { "esd8.fu35", 0x200000, 0x23aceb4f, 4 | BRF_GRA }, // 6 - Tiles - { "esd9.fu34", 0x200000, 0x76b46cd2, 4 | BRF_GRA }, // 7 - - { "esd4.su10", 0x020000, 0x3c11c590, 5 | BRF_SND }, // 8 - OKI Samples - - { "hedpanic.nv", 0x000080, 0xe91f4038, 6 | BRF_GRA }, // 9 - Default EEPROM -}; - -STD_ROM_PICK(hedpanic) -STD_ROM_FN(hedpanic) - -static INT32 hedpanicCallback() -{ - game_select = 1; - weird_offsets = 1; - - { - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400000, 5, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 2)) return 1; - - if (BurnLoadRom(DrvSndROM, 8, 1)) return 1; - if (BurnLoadRom(DrvEepROM, 9, 1)) return 1; - - - HedpanicGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x800000, 0x8007ff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x900000, 0x9007ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x900800, 0x900fff, MAP_RAM); // mirror - SekMapMemory(DrvVidRAM0, 0xa00000, 0xa03fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0xa20000, 0xa23fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0xa24000, 0xa27fff, MAP_RAM); // mirror - SekSetWriteByteHandler(0, hedpanic_write_byte); - SekSetWriteWordHandler(0, hedpanic_write_word); - SekSetReadByteHandler(0, hedpanic_read_byte); - SekSetReadWordHandler(0, hedpanic_read_word); - SekClose(); - - return 0; -} - -static INT32 HedpanicInit() -{ - return DrvInit(hedpanicCallback); -} - -struct BurnDriver BurnDrvHedpanic = { - "hedpanic", NULL, NULL, NULL, "2000", - "Head Panic (ver. 0117, 17/01/2000)\0", "Story line & game instructions in English", "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, hedpanicRomInfo, hedpanicRomName, NULL, NULL, HedpanicInputInfo, NULL, - HedpanicInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Head Panic (ver. 0702, 02/07/1999) - -static struct BurnRomInfo hedpanicaRomDesc[] = { - { "esd12.cu03", 0x040000, 0xdeb7e0a0, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd11.cu02", 0x040000, 0xe1418f23, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0xa88d4424, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "ju06", 0x200000, 0x9f6f6193, 3 | BRF_GRA }, // 3 - Sprites - { "ju04", 0x200000, 0x4f3503d7, 3 | BRF_GRA }, // 4 - { "esd5.bin", 0x080000, 0x6968265a, 3 | BRF_GRA }, // 5 - - { "fu35", 0x200000, 0x9b5a45c5, 4 | BRF_GRA }, // 6 - Tiles - { "fu34", 0x200000, 0x8f2099cc, 4 | BRF_GRA }, // 7 - - { "esd4.bin", 0x080000, 0x5692fe92, 5 | BRF_SND }, // 8 - OKI Samples - - { "hedpanic.nv", 0x000080, 0xe91f4038, 0 | BRF_OPT }, // 9 - Default EEPROM -}; - -STD_ROM_PICK(hedpanica) -STD_ROM_FN(hedpanica) - -struct BurnDriver BurnDrvHedpanica = { - "hedpanica", "hedpanic", NULL, NULL, "1999", - "Head Panic (ver. 0702, 02/07/1999)\0", "Story line & game instructions in English", "ESD / Fuuki", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, hedpanicaRomInfo, hedpanicaRomName, NULL, NULL, HedpanicInputInfo, NULL, - HedpanicInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Head Panic (ver. 0315, 15/03/2000) - -static struct BurnRomInfo hedpanifRomDesc[] = { - { "esd2", 0x040000, 0x8cccc691, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd1", 0x040000, 0xd8574925, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0xa88d4424, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "esd7.ju02", 0x200000, 0x055d525f, 3 | BRF_GRA }, // 3 - Sprites - { "esd6.ju01", 0x200000, 0x5858372c, 3 | BRF_GRA }, // 4 - { "esd5.ju07", 0x080000, 0xbd785921, 3 | BRF_GRA }, // 5 - - { "esd8.fu35", 0x200000, 0x23aceb4f, 4 | BRF_GRA }, // 6 - Tiles - { "esd9.fu34", 0x200000, 0x76b46cd2, 4 | BRF_GRA }, // 7 - - { "esd4.su10", 0x020000, 0x3c11c590, 5 | BRF_SND }, // 8 - OKI Samples - - { "hedpanic.nv", 0x000080, 0xe91f4038, 0 | BRF_OPT }, // 9 - Default EEPROM -}; - -STD_ROM_PICK(hedpanif) -STD_ROM_FN(hedpanif) - -struct BurnDriver BurnDrvHedpanif = { - "hedpanicf", "hedpanic", NULL, NULL, "2000", - "Head Panic (ver. 0315, 15/03/2000)\0", "Story line in Japanese, game instructions in English", "ESD / Fuuki", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, hedpanifRomInfo, hedpanifRomName, NULL, NULL, HedpanicInputInfo, NULL, - HedpanicInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Multi Champ Deluxe (ver. 0106, 06/01/2000) - -static struct BurnRomInfo mchampdxRomDesc[] = { - { "ver0106_esd2.cu02", 0x040000, 0xea98b3fd, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "ver0106_esd1.cu03", 0x040000, 0xc6e4546b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0x1b22568c, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "ver0106_ju02.bin", 0x200000, 0xb27a4977, 3 | BRF_GRA }, // 3 - Sprites - { "ver0106_ju01.bin", 0x200000, 0x55841d90, 3 | BRF_GRA }, // 4 - { "ver0106_esd5.ju07", 0x040000, 0x7a3ac887, 3 | BRF_GRA }, // 5 - - { "rom.fu35", 0x200000, 0xba46f3dc, 4 | BRF_GRA }, // 6 - Tiles - { "rom.fu34", 0x200000, 0x2895cf09, 4 | BRF_GRA }, // 7 - - { "ver0106_esd4.su10", 0x040000, 0xac8ae009, 5 | BRF_SND }, // 8 - OKI Samples -}; - -STD_ROM_PICK(mchampdx) -STD_ROM_FN(mchampdx) - -static INT32 mchampdxCallback() -{ - game_select = 3; - - { - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400000, 5, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 2)) return 1; - - if (BurnLoadRom(DrvSndROM, 8, 1)) return 1; - - HedpanicGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x300000, 0x303fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x320000, 0x323fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x324000, 0x327fff, MAP_RAM); // mirror - SekMapMemory(DrvPalRAM, 0x400000, 0x400fff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x600000, 0x6007ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x600800, 0x6007ff, MAP_RAM); // mirror - SekSetWriteByteHandler(0, mchampdx_write_byte); - SekSetWriteWordHandler(0, mchampdx_write_word); - SekSetReadByteHandler(0, mchampdx_read_byte); - SekSetReadWordHandler(0, mchampdx_read_word); - SekClose(); - - return 0; -} - -static INT32 MchampdxInit() -{ - return DrvInit(mchampdxCallback); -} - -struct BurnDriver BurnDrvMchampdx = { - "mchampdx", NULL, NULL, NULL, "2000", - "Multi Champ Deluxe (ver. 0106, 06/01/2000)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, mchampdxRomInfo, mchampdxRomName, NULL, NULL, HedpanicInputInfo, NULL, - MchampdxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Multi Champ Deluxe (ver. 1126, 26/11/1999) - -static struct BurnRomInfo mchampdaRomDesc[] = { - { "esd2.cu02", 0x040000, 0x4cca802c, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd1.cu03", 0x040000, 0x0af1cd0a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0x1b22568c, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "rom.ju01", 0x200000, 0x1a749fc2, 3 | BRF_GRA }, // 3 - Sprites - { "rom.ju02", 0x200000, 0x7e87e332, 3 | BRF_GRA }, // 4 - { "esd5.ju07", 0x080000, 0x6cc871cc, 3 | BRF_GRA }, // 5 - - { "rom.fu35", 0x200000, 0xba46f3dc, 4 | BRF_GRA }, // 6 - Tiles - { "rom.fu34", 0x200000, 0x2895cf09, 4 | BRF_GRA }, // 7 - - { "esd4.su10", 0x040000, 0x2fbe94ab, 5 | BRF_SND }, // 8 - OKI Samples -}; - -STD_ROM_PICK(mchampda) -STD_ROM_FN(mchampda) - -struct BurnDriver BurnDrvMchampda = { - "mchampdxa", "mchampdx", NULL, NULL, "1999", - "Multi Champ Deluxe (ver. 1126, 26/11/1999)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, mchampdaRomInfo, mchampdaRomName, NULL, NULL, HedpanicInputInfo, NULL, - MchampdxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Tang Tang (ver. 0526, 26/05/2000) - -static struct BurnRomInfo tangtangRomDesc[] = { - { "esd2.cu02", 0x040000, 0xb6dd6e3d, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd1.cu03", 0x040000, 0xb6c0f2f4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0xd48ecc5c, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "xju04.bin", 0x040000, 0xf999b9d7, 3 | BRF_GRA }, // 3 - Sprites - { "xju05.bin", 0x040000, 0x679302cf, 3 | BRF_GRA }, // 4 - { "xju06.bin", 0x040000, 0x01f59ff7, 3 | BRF_GRA }, // 5 - { "xju07.bin", 0x040000, 0x556acac3, 3 | BRF_GRA }, // 6 - { "xju08.bin", 0x040000, 0xecc2d8c7, 3 | BRF_GRA }, // 7 - - { "fu35.bin", 0x200000, 0x84f3f833, 4 | BRF_GRA }, // 8 - Tiles - { "fu34.bin", 0x200000, 0xbf91f543, 4 | BRF_GRA }, // 9 - - { "esd4.su10", 0x020000, 0xf2dfb02d, 5 | BRF_SND }, // 10 - OKI Samples - - { "eeprom", 0x000080, 0x00514989, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(tangtang) -STD_ROM_FN(tangtang) - -static INT32 tangtangCallback() -{ - game_select = 4; - weird_offsets = 1; - - { - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvGfxROM0 + i * 0x80000, 3 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 9, 2)) return 1; - - if (BurnLoadRom(DrvSndROM, 10, 1)) return 1; - - TangtangGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x100000, 0x100fff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x200000, 0x2007ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x200800, 0x200fff, MAP_RAM); // mirror - SekMapMemory(DrvVidRAM0, 0x300000, 0x303fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x320000, 0x323fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x324000, 0x327fff, MAP_RAM); // mirror - SekMapMemory(Drv68KRAM, 0x700000, 0x70ffff, MAP_RAM); - SekSetWriteByteHandler(0, tangtang_write_byte); - SekSetWriteWordHandler(0, tangtang_write_word); - SekSetReadByteHandler(0, tangtang_read_byte); - SekSetReadWordHandler(0, tangtang_read_word); - SekClose(); - - return 0; -} - -static INT32 TangtangInit() -{ - return DrvInit(tangtangCallback); -} - -struct BurnDriver BurnDrvTangtang = { - "tangtang", NULL, NULL, NULL, "2000", - "Tang Tang (ver. 0526, 26/05/2000)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, tangtangRomInfo, tangtangRomName, NULL, NULL, HedpanicInputInfo, NULL, - TangtangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Deluxe 5 (ver. 0107, 07/01/2000, set 1) - -static struct BurnRomInfo deluxe5RomDesc[] = { - { "esd2.cu02", 0x040000, 0xd077dc13, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd1.cu03", 0x040000, 0x15d6644f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0x31de379a, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "am27c020.ju03", 0x040000, 0xaa130fd3, 3 | BRF_GRA }, // 3 - Sprites - { "am27c020.ju04", 0x040000, 0x40fa2c2f, 3 | BRF_GRA }, // 4 - { "am27c020.ju05", 0x040000, 0xbbe81779, 3 | BRF_GRA }, // 5 - { "am27c020.ju06", 0x040000, 0x8b853bce, 3 | BRF_GRA }, // 6 - { "am27c020.ju07", 0x040000, 0xd414c3af, 3 | BRF_GRA }, // 7 - - { "fu35", 0x200000, 0xae10242a, 4 | BRF_GRA }, // 8 - Tiles - { "fu34", 0x200000, 0x248b8c05, 4 | BRF_GRA }, // 9 - - { "esd4.su10", 0x020000, 0x23f2b7d9, 5 | BRF_SND }, // 10 - OKI Samples -}; - -STD_ROM_PICK(deluxe5) -STD_ROM_FN(deluxe5) - -struct BurnDriver BurnDrvDeluxe5 = { - "deluxe5", NULL, NULL, NULL, "2000", - "Deluxe 5 (ver. 0107, 07/01/2000, set 1)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, deluxe5RomInfo, deluxe5RomName, NULL, NULL, HedpanicInputInfo, NULL, - TangtangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Deluxe 5 (ver. 0107, 07/01/2000, set 2) - -static struct BurnRomInfo deluxe5aRomDesc[] = { - { "esd2.cu02", 0x040000, 0xc67bf757, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd1.cu03", 0x040000, 0x24f4d7b9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0x31de379a, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "am27c020.ju03", 0x040000, 0xaa130fd3, 3 | BRF_GRA }, // 3 - Sprites - { "am27c020.ju04", 0x040000, 0x40fa2c2f, 3 | BRF_GRA }, // 4 - { "am27c020.ju05", 0x040000, 0xbbe81779, 3 | BRF_GRA }, // 5 - { "am27c020.ju06", 0x040000, 0x8b853bce, 3 | BRF_GRA }, // 6 - { "am27c020.ju07", 0x040000, 0xd414c3af, 3 | BRF_GRA }, // 7 - - { "fu35", 0x200000, 0xae10242a, 4 | BRF_GRA }, // 8 - Tiles - { "fu34", 0x200000, 0x248b8c05, 4 | BRF_GRA }, // 9 - - { "esd4.su10", 0x020000, 0x23f2b7d9, 5 | BRF_SND }, // 10 - OKI Samples -}; - -STD_ROM_PICK(deluxe5a) -STD_ROM_FN(deluxe5a) - -struct BurnDriver BurnDrvDeluxe5a = { - "deluxe5a", "deluxe5", NULL, NULL, "2000", - "Deluxe 5 (ver. 0107, 07/01/2000, set 2)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, deluxe5aRomInfo, deluxe5aRomName, NULL, NULL, HedpanicInputInfo, NULL, - TangtangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Deluxe 5 (ver. 0107, 07/01/2000, set 3) - -static struct BurnRomInfo deluxe5bRomDesc[] = { - { "esd2.cu02", 0x040000, 0x72a67495, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd1.cu03", 0x040000, 0x7cc119c8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0x31de379a, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "am27c020.ju03", 0x040000, 0xaa130fd3, 3 | BRF_GRA }, // 3 - Sprites - { "am27c020.ju04", 0x040000, 0x40fa2c2f, 3 | BRF_GRA }, // 4 - { "am27c020.ju05", 0x040000, 0xbbe81779, 3 | BRF_GRA }, // 5 - { "am27c020.ju06", 0x040000, 0x8b853bce, 3 | BRF_GRA }, // 6 - { "am27c020.ju07", 0x040000, 0xd414c3af, 3 | BRF_GRA }, // 7 - - { "fu35", 0x200000, 0xae10242a, 4 | BRF_GRA }, // 8 - Tiles - { "fu34", 0x200000, 0x248b8c05, 4 | BRF_GRA }, // 9 - - { "esd4.su10", 0x020000, 0x23f2b7d9, 5 | BRF_SND }, // 10 - OKI Samples -}; - -STD_ROM_PICK(deluxe5b) -STD_ROM_FN(deluxe5b) - -struct BurnDriver BurnDrvDeluxe5b = { - "deluxe5b", "deluxe5", NULL, NULL, "2000", - "Deluxe 5 (ver. 0107, 07/01/2000, set 3)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, deluxe5bRomInfo, deluxe5bRomName, NULL, NULL, HedpanicInputInfo, NULL, - TangtangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// Deluxe 4 U (ver. 0107, 07/01/2000) - -static struct BurnRomInfo deluxe4uRomDesc[] = { - { "2.cu02", 0x040000, 0xdb213e1f, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "1.cu03", 0x040000, 0xfbf14d74, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0x31de379a, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "am27c020.ju03", 0x040000, 0xaa130fd3, 3 | BRF_GRA }, // 3 - Sprites - { "am27c020.ju04", 0x040000, 0x40fa2c2f, 3 | BRF_GRA }, // 4 - { "am27c020.ju05", 0x040000, 0xbbe81779, 3 | BRF_GRA }, // 5 - { "am27c020.ju06", 0x040000, 0x8b853bce, 3 | BRF_GRA }, // 6 - { "am27c020.ju07", 0x040000, 0xd414c3af, 3 | BRF_GRA }, // 7 - - { "fu35", 0x200000, 0x6df14570, 4 | BRF_GRA }, // 8 - Tiles - { "fu34", 0x200000, 0x93175d6d, 4 | BRF_GRA }, // 9 - - { "esd4.su10", 0x020000, 0x23f2b7d9, 5 | BRF_SND }, // 10 - OKI Samples -}; - -STD_ROM_PICK(deluxe4u) -STD_ROM_FN(deluxe4u) - -struct BurnDriver BurnDrvDeluxe4u = { - "deluxe4u", "deluxe5", NULL, NULL, "2000", - "Deluxe 4 U (ver. 0107, 07/01/2000)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, deluxe4uRomInfo, deluxe4uRomName, NULL, NULL, HedpanicInputInfo, NULL, - TangtangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; - - -// SWAT Police - -static struct BurnRomInfo swatpolcRomDesc[] = { - { "esd.cu02", 0x040000, 0x29e0c126, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "esd.cu03", 0x040000, 0x1070208b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "esd3.su06", 0x040000, 0x80e97dbe, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "esd1.ju03", 0x080000, 0x17fcc5e7, 3 | BRF_GRA }, // 3 - Sprites - { "esd2.ju04", 0x080000, 0x9c1752f2, 3 | BRF_GRA }, // 4 - { "esd3.ju05", 0x080000, 0xe8d9c092, 3 | BRF_GRA }, // 5 - { "esd4.ju06", 0x080000, 0xbde1b130, 3 | BRF_GRA }, // 6 - { "esd5.ju07", 0x080000, 0xd2c27f03, 3 | BRF_GRA }, // 7 - - { "fu35", 0x200000, 0xc55897c5, 4 | BRF_GRA }, // 8 - Tiles - { "fu34", 0x200000, 0x7117a6a2, 4 | BRF_GRA }, // 9 - - { "at27c020.su10", 0x040000, 0xc43efec2, 5 | BRF_SND }, // 10 - OKI Samples -}; - -STD_ROM_PICK(swatpolc) -STD_ROM_FN(swatpolc) - -static INT32 swatpolcCallback() -{ - game_select = 5; - - { - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvGfxROM0 + i * 0x80000, 3 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 9, 2)) return 1; - - if (BurnLoadRom(DrvSndROM, 10, 1)) return 1; - - TangtangGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x800000, 0x8007ff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x900000, 0x9007ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x900800, 0x900fff, MAP_RAM); // mirror - SekMapMemory(DrvVidRAM0, 0xa00000, 0xa03fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0xa20000, 0xa23fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0xa24000, 0xa27fff, MAP_RAM); // mirror - SekSetWriteByteHandler(0, hedpanic_write_byte); - SekSetWriteWordHandler(0, hedpanic_write_word); - SekSetReadByteHandler(0, hedpanic_read_byte); - SekSetReadWordHandler(0, hedpanic_read_word); - SekClose(); - - return 0; -} - -static INT32 SwatpolcInit() -{ - return DrvInit(swatpolcCallback); -} - -struct BurnDriver BurnDrvSwatpolc = { - "swatpolc", NULL, NULL, NULL, "2001", - "SWAT Police\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, swatpolcRomInfo, swatpolcRomName, NULL, NULL, SwatpolcInputInfo, NULL, - SwatpolcInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x800, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_f1gp.cpp b/jan/src/burn/drv/pst90s/d_f1gp.cpp deleted file mode 100644 index 5bca63e7e..000000000 --- a/jan/src/burn/drv/pst90s/d_f1gp.cpp +++ /dev/null @@ -1,1391 +0,0 @@ -// FB Alpha F-1 Grand Prix driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2610.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM0; -static UINT8 *Drv68KROM1; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZoomRAM; -static UINT8 *DrvRozVidRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvSprVRAM1; -static UINT8 *DrvSprVRAM2; -static UINT8 *DrvSprCGRAM1; -static UINT8 *DrvSprCGRAM2; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvBgDirty; -static UINT8 *DrvBgTileDirty; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 *DrvBgTmp; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *gfxctrl; -static UINT8 *pending_command; -static UINT8 *roz_bank; -static UINT8 *DrvZ80Bank; -static UINT16 *DrvFgScrollX; -static UINT16 *DrvFgScrollY; -static UINT16 *DrvBgCtrl; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvDips[4]; -static UINT16 DrvInputs[3]; -static UINT8 DrvReset; - -static INT16 zoom_table[32][33]; - -static INT32 nScreenStartY = 8; - -static struct BurnInputInfo F1gpInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 9, "p2 coin" }, - {"Start", BIT_DIGITAL, DrvJoy1 + 10, "p1 start" }, - {"Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 14, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Region", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(F1gp) - -static struct BurnInputInfo F1gp2InputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 9, "p2 coin" }, - {"Start", BIT_DIGITAL, DrvJoy1 + 10, "p1 start" }, - {"Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - {"Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 14, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Region", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(F1gp2) - -static struct BurnDIPInfo F1gpDIPList[]= -{ - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xfb, NULL }, - {0x0c, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0a, 0x01, 0x01, 0x01, "Off" }, - {0x0a, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0a, 0x01, 0x0e, 0x0a, "3 Coins 1 Credit" }, - {0x0a, 0x01, 0x0e, 0x0c, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x0e, 0x0e, "1 Coin 1 Credit" }, - {0x0a, 0x01, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x0e, 0x06, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0x0e, 0x04, "1 Coin 4 Credits" }, - {0x0a, 0x01, 0x0e, 0x02, "1 Coin 5 Credits" }, - {0x0a, 0x01, 0x0e, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x0a, 0x01, 0x70, 0x50, "3 Coins 1 Credit" }, - {0x0a, 0x01, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x0a, 0x01, 0x70, 0x40, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x70, 0x30, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0x70, 0x20, "1 Coin 4 Credits" }, - {0x0a, 0x01, 0x70, 0x10, "1 Coin 5 Credits" }, - {0x0a, 0x01, 0x70, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x0a, 0x01, 0x80, 0x80, "Off" }, - {0x0a, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x09, 0x01, 0x03, 0x02, "Easy" }, - {0x09, 0x01, 0x03, 0x03, "Normal" }, - {0x09, 0x01, 0x03, 0x01, "Hard" }, - {0x09, 0x01, 0x03, 0x00, "Hardest" }, - -// {0 , 0xfe, 0 , 2, "Game Mode" }, -// {0x09, 0x01, 0x04, 0x04, "Single" }, -// {0x09, 0x01, 0x04, 0x00, "Multiple" }, // ID CHECK ERROR - - {0 , 0xfe, 0 , 2, "Mode Select" }, - {0x09, 0x01, 0x08, 0x00, "Off" }, - {0x09, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x0b, 0x01, 0x02, 0x02, "Off" }, -// {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 6, "Country" }, - {0x0c, 0x01, 0x1f, 0x10, "World" }, - {0x0c, 0x01, 0x1f, 0x01, "USA & Canada"}, - {0x0c, 0x01, 0x1f, 0x00, "Japan" }, - {0x0c, 0x01, 0x1f, 0x02, "Korea" }, - {0x0c, 0x01, 0x1f, 0x04, "Hong Kong" }, - {0x0c, 0x01, 0x1f, 0x08, "Taiwan" }, -}; - -STDDIPINFO(F1gp) - -static struct BurnDIPInfo F1gp2DIPList[]= -{ - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xfb, NULL }, - {0x0d, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0b, 0x01, 0x0e, 0x0a, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x0e, 0x0c, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x0e, 0x0e, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0x0e, 0x06, "1 Coin 3 Credits" }, - {0x0b, 0x01, 0x0e, 0x04, "1 Coin 4 Credits" }, - {0x0b, 0x01, 0x0e, 0x02, "1 Coin 5 Credits" }, - {0x0b, 0x01, 0x0e, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x0b, 0x01, 0x70, 0x50, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x70, 0x40, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0x70, 0x30, "1 Coin 3 Credits" }, - {0x0b, 0x01, 0x70, 0x20, "1 Coin 4 Credits" }, - {0x0b, 0x01, 0x70, 0x10, "1 Coin 5 Credits" }, - {0x0b, 0x01, 0x70, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x0b, 0x01, 0x80, 0x80, "Off" }, - {0x0b, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0a, 0x01, 0x03, 0x02, "Easy" }, - {0x0a, 0x01, 0x03, 0x03, "Normal" }, - {0x0a, 0x01, 0x03, 0x01, "Hard" }, - {0x0a, 0x01, 0x03, 0x00, "Hardest" }, - -// {0 , 0xfe, 0 , 2, "Game Mode" }, -// {0x0a, 0x01, 0x04, 0x04, "Single" }, -// {0x0a, 0x01, 0x04, 0x00, "Multiple" }, // ID CHECK ERROR - - {0 , 0xfe, 0 , 2, "Mode Select" }, - {0x0a, 0x01, 0x08, 0x00, "Off" }, - {0x0a, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0c, 0x01, 0x01, 0x01, "Off" }, - {0x0c, 0x01, 0x01, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x0c, 0x01, 0x02, 0x02, "Off" }, -// {0x0c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Country" }, - {0x0d, 0x01, 0x01, 0x01, "World" }, - {0x0d, 0x01, 0x01, 0x00, "Japan" }, -}; - -STDDIPINFO(F1gp2) - -static inline void expand_dynamic_tiles(INT32 offset) -{ - UINT16 data = *((UINT16*)(DrvZoomRAM + offset)); - - offset <<= 1; - - DrvGfxROM3[offset + 0] = (data >> 12) & 0x0f; - DrvGfxROM3[offset + 1] = (data >> 8) & 0x0f; - DrvGfxROM3[offset + 2] = (data >> 4) & 0x0f; - DrvGfxROM3[offset + 3] = (data >> 0) & 0x0f; - - DrvBgTileDirty[offset >> 8] = 1; -} - -void __fastcall f1gp_main_write_word(UINT32 address, UINT16 data) -{ - if (((address & 0xfffffe0) == 0xfff040 && nScreenStartY == 8) || // f1gp - ((address & 0xffffff0) == 0xfff020 && nScreenStartY == 0)) { // f1gp2 - DrvBgCtrl[(address >> 1) & 0x0f] = data; - return; - } - - if ((address & 0xfc0000) == 0xc00000) { - UINT16 *p = (UINT16*)(DrvZoomRAM + (address & 0x3fffe)); - - if (p[0] == data) return; - - p[0] = data; - - expand_dynamic_tiles(address & 0x3fffe); - - return; - } - - if ((address & 0xff8000) == 0xd00000) { - UINT16 *p = (UINT16*)(DrvRozVidRAM + (address & 0x1ffe)); - - if (p[0] == data) return; - - p[0] = data; - - DrvBgDirty[(address >> 1) & 0xfff] = 1; - - return; - } - - switch (address) - { - case 0xfff002: // f1gp - case 0xfff003: - *DrvFgScrollX = data & 0x1ff; - return; - - case 0xfff004: - case 0xfff005: - *DrvFgScrollY = data & 0x0ff; - return; - - case 0xfff044: // f1gp2 - case 0xfff045: - *DrvFgScrollX = (data+80) & 0x1ff; - return; - - case 0xfff046: - case 0xfff047: - *DrvFgScrollY = (data+26) & 0x0ff; - return; - } -} - -void __fastcall f1gp_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xff8000) == 0xd00000) { - address = (address & 0x1fff) ^ 1; - - INT32 d = DrvRozVidRAM[address]; - - if (d == data) return; - - DrvRozVidRAM[address] = data; - DrvBgDirty[(address >> 1) & 0xfff] = 1; - - return; - } - - switch (address) - { - case 0xfff000: - if (*roz_bank != data) { - *roz_bank = data; - memset (DrvBgDirty, 1, 0x1000); - } - return; - - case 0xfff001: - *flipscreen = data & 0x20; - *gfxctrl = data & 0xdf; - return; - - case 0xfff009: - { - INT32 t = (SekTotalCycles() / 2) - ZetTotalCycles(); - if (t > 0) ZetRun(t); - *pending_command = 0xff; - *soundlatch = data; - ZetNmi(); - } - return; - } -} - -UINT16 __fastcall f1gp_main_read_word(UINT32 address) -{ - switch (address) - { - case 0xfff004: - return (DrvDips[1] << 8) | DrvDips[0]; - - case 0xfff006: - return (DrvDips[2] << 8); - } - - return 0; -} - -UINT8 __fastcall f1gp_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xfff000: - case 0xfff001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0xfff004: - return DrvDips[0]; - - case 0xfff005: - return DrvDips[1]; - - case 0xfff006: - return DrvDips[2]; - - case 0xfff009: - return *pending_command; - - case 0xfff00b: - case 0xfff051: - return DrvDips[3]; - } - - return 0; -} - -static void sound_bankswitch(INT32 data) -{ - INT32 nBank = ((data & 1) << 15) + 0x8000; - - *DrvZ80Bank = data & 1; - - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + nBank); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + nBank); -} - -void __fastcall f1gp_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x0c: - sound_bankswitch(data); - return; - - case 0x14: - *pending_command = 0; - return; - - case 0x18: - case 0x19: - case 0x1a: - case 0x1b: - BurnYM2610Write(port & 3, data); - return; - } -} - -UINT8 __fastcall f1gp_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x14: - return *soundlatch; - - case 0x18: - case 0x19: - case 0x1a: - case 0x1b: - return BurnYM2610Read(port & 3); - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 5000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 5000000.0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - memset (DrvBgDirty, 1, 0x1000); - memset (DrvBgTileDirty, 1, 0x0800); - - SekOpen(0); - SekReset(); - SekClose(); - - SekOpen(1); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2610Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM0 = Next; Next += 0x500000; - Drv68KROM1 = Next; Next += 0x020000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROM2 = Next; Next += 0x200000; - DrvGfxROM3 = Next; Next += 0x800000; - - DrvSndROM = Next; Next += 0x200000; - - DrvPalette = (UINT32 *)Next; Next += 0x000401 * sizeof(UINT32); - - DrvBgDirty = Next; Next += 0x001000; - DrvBgTileDirty = Next; Next += 0x000800; - DrvBgTmp = (UINT16*)Next; Next += 0x100000 * sizeof(UINT16); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x004000; - Drv68KRAM1 = Next; Next += 0x004000; - DrvShareRAM = Next; Next += 0x001000; - DrvZoomRAM = Next; Next += 0x040000; - DrvPalRAM = Next; Next += 0x001000; - DrvRozVidRAM = Next; Next += 0x002000; - DrvVidRAM = Next; Next += 0x001000; - - DrvSprVRAM1 = Next; Next += 0x001000; - DrvSprVRAM2 = Next; Next += 0x000400; - - DrvSprCGRAM1 = Next; Next += 0x008000; - DrvSprCGRAM2 = Next; Next += 0x004000; - - DrvZ80RAM = Next; Next += 0x000800; - - pending_command = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - gfxctrl = Next; Next += 0x000001; - roz_bank = Next; Next += 0x000001; - - DrvZ80Bank = Next; Next += 0x000001; - - DrvFgScrollX = (UINT16*)Next; Next += 0x000001 * sizeof(UINT16); - DrvFgScrollY = (UINT16*)Next; Next += 0x000001 * sizeof(UINT16); - DrvBgCtrl = (UINT16*)Next; Next += 0x000010 * sizeof(UINT16); - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvInitZoomTable() -{ - zoom_table[0][0] = -1; - - for (INT32 x = 1; x < 32; x++) { - for (INT32 y = 0; y < 16; y++) { - float t = ((16.0000-1.0000) / x) * y; - zoom_table[x][y] = (t >= 16) ? -1 : (INT32)t; - } - } -} - -static void WordSwap(UINT8 *src, INT32 len) -{ - for (INT32 i = 0; i < len; i+=4) { - INT32 d = src[i+1]; - src[i+1] = src[i+2]; - src[i+2] = d; - } -} - -static INT32 F1gpGfxDecode() -{ - INT32 Plane[8] = { 0x000, 0x001, 0x002, 0x003 }; - INT32 XOffs[16] = { 0x004, 0x000, 0x00c, 0x008, 0x014, 0x010, 0x01c, 0x018, - 0x024, 0x020, 0x02c, 0x028, 0x034, 0x030, 0x03c, 0x038 }; - INT32 YOffs[16] = { 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, - 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM1, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x080000); - - GfxDecode(0x1000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 F1gp2GfxDecode() -{ - INT32 Plane[8] = { 0x000, 0x001, 0x002, 0x003 }; - INT32 XOffs[16] = { 0x008, 0x00c, 0x000, 0x004, 0x018, 0x01c, 0x010, 0x014, - 0x028, 0x02c, 0x020, 0x024, 0x038, 0x03c, 0x030, 0x034 }; - INT32 YOffs[16] = { 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, - 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x200000; i++) { - tmp[i^1] = (DrvGfxROM1[i] << 4) | (DrvGfxROM1[i] >> 4); - } - - GfxDecode(0x4000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM3, 0x400000); - - GfxDecode(0x8000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(INT32 nGame) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (nGame) { - nScreenStartY = 0; - - if (BurnLoadRom(Drv68KROM0 + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0300000, 2, 1)) return 1; - memcpy (Drv68KROM0 + 0x100000, Drv68KROM0 + 0x400000, 0x100000); - memcpy (Drv68KROM0 + 0x200000, Drv68KROM0 + 0x300000, 0x100000); - - if (BurnLoadRom(Drv68KROM1, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x100000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x300000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 11, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x0100000, 12, 1)) return 1; - - F1gp2GfxDecode(); - } else { - if (BurnLoadRom(Drv68KROM0 + 0x0000000, 0, 1)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0100000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0180000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0180001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0200000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0200001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0280000, 7, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0280001, 8, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0300000, 9, 1)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0400000, 10, 1)) return 1; - - if (BurnLoadRom(Drv68KROM1, 11, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 16, 2)) return 1; - WordSwap(DrvGfxROM1, 0x100000); - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 18, 2)) return 1; - WordSwap(DrvGfxROM2, 0x080000); - - if (BurnLoadRom(DrvSndROM + 0x0000000, 19, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x0100000, 20, 1)) return 1; - - F1gpGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KROM0 + 0x100000, 0x100000, 0x2fffff, MAP_ROM); - SekMapMemory(DrvRozVidRAM, 0xd00000, 0xd01fff, MAP_ROM); - SekMapMemory(DrvRozVidRAM, 0xd02000, 0xd03fff, MAP_ROM); - SekMapMemory(DrvRozVidRAM, 0xd04000, 0xd05fff, MAP_ROM); - SekMapMemory(DrvRozVidRAM, 0xd06000, 0xd07fff, MAP_ROM); - - if (nGame) { - SekMapMemory(DrvSprCGRAM1, 0xa00000, 0xa07fff, MAP_RAM); - SekMapMemory(DrvSprVRAM1, 0xe00000, 0xe00fff, MAP_RAM); - } else { - SekMapMemory(Drv68KROM0 + 0x300000, 0xa00000, 0xbfffff, MAP_ROM); - SekMapMemory(DrvZoomRAM, 0xc00000, 0xc3ffff, MAP_ROM); - SekMapMemory(DrvSprCGRAM1, 0xe00000, 0xe03fff, MAP_RAM); - SekMapMemory(DrvSprCGRAM2, 0xe04000, 0xe07fff, MAP_RAM); - SekMapMemory(DrvSprVRAM1, 0xf00000, 0xf003ff, MAP_RAM); - SekMapMemory(DrvSprVRAM2, 0xf10000, 0xf103ff, MAP_RAM); - } - - SekMapMemory(Drv68KRAM0, 0xff8000, 0xffbfff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0xffc000, 0xffcfff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0xffd000, 0xffdfff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xffe000, 0xffefff, MAP_RAM); - SekSetWriteWordHandler(0, f1gp_main_write_word); - SekSetWriteByteHandler(0, f1gp_main_write_byte); - SekSetReadWordHandler(0, f1gp_main_read_word); - SekSetReadByteHandler(0, f1gp_main_read_byte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Drv68KROM1, 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0xff8000, 0xffbfff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0xffc000, 0xffcfff, MAP_RAM); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x77ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x77ff, 2, DrvZ80ROM); - ZetMapArea(0x7800, 0x7fff, 0, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 1, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 2, DrvZ80RAM); - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + 0x8000); - ZetSetOutHandler(f1gp_sound_out); - ZetSetInHandler(f1gp_sound_in); - ZetClose(); - - INT32 DrvSndROMLen = 0x100000; - BurnYM2610Init(8000000, DrvSndROM + 0x100000, &DrvSndROMLen, DrvSndROM, &DrvSndROMLen, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(5000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - DrvInitZoomTable(); - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2610Exit(); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - nScreenStartY = 8; - - return 0; -} - -static void draw_foreground(INT32 transp) -{ - transp *= 0xff; - - UINT16 *vram = (UINT16*)DrvVidRAM; - - for (INT32 offs = nScreenStartY; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = ((offs >> 6) << 3) - nScreenStartY; - - sx -= *DrvFgScrollX; - if (sx < -7) sx += 512; - sy -= *DrvFgScrollY; - if (sy < -7) sy += 256; - - INT32 code = vram[offs] & 0x7fff; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 flipy = vram[offs] & 0x8000; - - if (transp) { - if (flipy) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, 0, 8, transp, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 8, transp, 0, DrvGfxROM0); - } - } else { - if (flipy) { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM0); - } - } - } -} - -static void draw_16x16_zoom(UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 xz, INT32 yz, INT32 fx, INT32 fy) -{ - if (yz <= 1 || xz <= 1) return; - - if (yz == 16 && xz == 16) { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, gfx); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, gfx); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, gfx); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, gfx); - } - } - - return; - } - - fx = (fx * 0x0f); - fy = (fy >> 1) * 0x0f; - - color = (color << 4); - UINT8 *src = gfx + (code << 8); - - INT16 *xm = zoom_table[xz-1]; - INT16 *ym = zoom_table[yz-1]; - - for (INT32 y = 0; y < 16; y++) - { - INT32 yy = sy + y; - - if (ym[(y ^ fy) % 16] == -1 || yy < 0 || yy >= nScreenHeight) continue; - - INT32 yyz = (ym[(y ^ fy) % 16] << 4); - - for (INT32 x = 0; x < 16; x++) - { - INT16 xxz = xm[(x ^ fx) % 16]; - if (xxz == -1) continue; - - INT32 xx = sx + x; - - INT32 pxl = src[yyz|xxz]; - - if (pxl == 15 || xx < 0 || xx >= nScreenWidth || yy < 0 || yy >= nScreenHeight) continue; - - pTransDraw[(yy * nScreenWidth) + xx] = pxl | color; - } - } -} - -static void f1gp_draw_sprites(UINT8 *ram0, UINT8 *ram1, UINT8 *gfx, INT32 colo) -{ - INT32 attr_start,first; - UINT16 *spram = (UINT16*)ram0; - UINT16 *spram2 = (UINT16*)ram1; - - static const INT32 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 }; - - first = 4 * spram[0x1fe]; - - for (attr_start = first; attr_start < 0x0200; attr_start += 4) - { - INT32 map_start; - INT32 ox,oy,x,y,xsize,ysize,zoomx,zoomy,flipx,flipy,color; - - if (!(spram[attr_start + 2] & 0x0080)) continue; - - oy = spram[attr_start + 0] & 0x01ff; - zoomy = (spram[attr_start + 0] & 0xf000) >> 12; - ox = spram[attr_start + 1] & 0x01ff; - zoomx = (spram[attr_start + 1] & 0xf000) >> 12; - xsize = (spram[attr_start + 2] & 0x0700) >> 8; - flipx = spram[attr_start + 2] & 0x0800; - ysize = (spram[attr_start + 2] & 0x7000) >> 12; - flipy = spram[attr_start + 2] & 0x8000; - color = (spram[attr_start + 2] & 0x000f) | colo; - map_start = spram[attr_start + 3]; - - zoomx = 16 - zoomtable[zoomx]/8; - zoomy = 16 - zoomtable[zoomy]/8; - - for (y = 0;y <= ysize;y++) - { - INT32 sx,sy; - - if (flipy) sy = ((oy + zoomy * (ysize - y) + 16) & 0x1ff) - 16; - else sy = ((oy + zoomy * y + 16) & 0x1ff) - 16; - - for (x = 0;x <= xsize;x++) - { - INT32 code; - - if (flipx) sx = ((ox + zoomx * (xsize - x) + 16) & 0x1ff) - 16; - else sx = ((ox + zoomx * x + 16) & 0x1ff) - 16; - - code = spram2[map_start & 0x1fff] & 0x1fff; - map_start++; - - draw_16x16_zoom(gfx, code, color, sx, sy-8, zoomx, zoomy, flipx, flipy); - } - - if (xsize == 2) map_start += 1; - if (xsize == 4) map_start += 3; - if (xsize == 5) map_start += 2; - if (xsize == 6) map_start += 1; - } - } -} - -static void f1gp2_draw_sprites() -{ - INT32 offs = 0; - UINT16 *spram = (UINT16*)DrvSprVRAM1; - UINT16 *spram2 = (UINT16*)DrvSprCGRAM1; - - while (offs < 0x0400 && (spram[offs] & 0x4000) == 0) - { - INT32 attr_start; - INT32 map_start; - INT32 ox,oy,x,y,xsize,ysize,zoomx,zoomy,flipx,flipy,color; - - attr_start = 4 * (spram[offs++] & 0x01ff); - - oy = spram[attr_start + 0] & 0x01ff; - ysize = (spram[attr_start + 0] & 0x0e00) >> 9; - zoomy = (spram[attr_start + 0] & 0xf000) >> 12; - ox = spram[attr_start + 1] & 0x01ff; - xsize = (spram[attr_start + 1] & 0x0e00) >> 9; - zoomx = (spram[attr_start + 1] & 0xf000) >> 12; - flipx = spram[attr_start + 2] & 0x4000; - flipy = spram[attr_start + 2] & 0x8000; - color = (spram[attr_start + 2] & 0x1f00) >> 8; - map_start = spram[attr_start + 3] & 0x7fff; - - zoomx = 32 - zoomx; - zoomy = 32 - zoomy; - - if (spram[attr_start + 2] & 0x20ff) color = GetCurrentFrame() & 0x0f; // good enough? - - for (y = 0;y <= ysize;y++) - { - INT32 sx,sy; - - if (flipy) sy = ((oy + zoomy * (ysize - y)/2 + 16) & 0x1ff) - 16; - else sy = ((oy + zoomy * y / 2 + 16) & 0x1ff) - 16; - - for (x = 0;x <= xsize;x++) - { - INT32 code; - - if (flipx) sx = ((ox + zoomx * (xsize - x) / 2 + 16) & 0x1ff) - 16; - else sx = ((ox + zoomx * x / 2 + 16) & 0x1ff) - 16; - - code = spram2[map_start & 0x3fff] & 0x3fff; - map_start++; - - if (*flipscreen) { - flipx = !flipx; - flipy = !flipy; - sx = 304-sx; - sy = 208-sy; - } - - draw_16x16_zoom(DrvGfxROM1, code, color | 0x20, sx, sy, 16, 16, flipx, flipy); - } - } - } -} - -static void predraw_roz_tile(INT32 offset) -{ - UINT16 data = *((UINT16*)(DrvRozVidRAM + offset)); - - offset >>= 1; - - INT32 sx = (offset & 0x3f) << 4; - INT32 sy = (offset >> 6) << 4; - - UINT16 *dst = DrvBgTmp + (sy * 1024) + sx; - - INT32 code = (data & 0x7ff) | (*roz_bank << 11); - INT32 color = ((data >> 12) << 4) | ((nScreenStartY) ? 0x300 : 0x100); - UINT8 *src = DrvGfxROM3 + (code << 8); - - for (INT32 y = 0; y < 16; y++) { - for (INT32 x = 0; x < 16; x++) { - dst[x] = src[x] | color; - if (src[x] == 0x0f) dst[x] |= 0x8000; - } - dst += 1024; - src += 16; - } -} - -static void predraw_background() -{ - UINT16 *ptr = (UINT16*)DrvRozVidRAM; - for (INT32 i = 0; i < 0x2000; i+=2, ptr++) { - if (DrvBgDirty[i/2] || DrvBgTileDirty[*ptr & 0x7ff]) { - predraw_roz_tile(i); - DrvBgDirty[i/2] = 0; - } - } - - memset (DrvBgTileDirty, 0, 0x800); -} - -static inline void copy_roz(UINT32 startx, UINT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, INT32 transp) -{ - UINT16 *dst = pTransDraw; - UINT16 *src = DrvBgTmp; - - for (INT32 sy = 0; sy < nScreenHeight; sy++, startx+=incyx, starty+=incyy) - { - UINT32 cx = startx; - UINT32 cy = starty; - - if (transp) { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++) - { - INT32 pxl = src[(((cy >> 16) & 0x3ff) << 10) + ((cx >> 16) & 0x3ff)]; - - if (!(pxl & 0x8000)) { - *dst = pxl; - } - } - } else { - for (INT32 x = 0; x < nScreenWidth; x++, cx+=incxx, cy+=incxy, dst++) { - *dst = src[(((cy >> 16) & 0x3ff) << 10) + ((cx >> 16) & 0x3ff)] & 0x3ff; - } - } - } -} - -static void draw_background(INT32 transp) -{ - UINT16 *ctrl = DrvBgCtrl; - - UINT32 startx,starty; - INT32 incxx,incxy,incyx,incyy; - - startx = 256 * (INT16)(ctrl[0x00]); - starty = 256 * (INT16)(ctrl[0x01]); - incyx = (INT16)(ctrl[0x02]); - incyy = (INT16)(ctrl[0x03]); - incxx = (INT16)(ctrl[0x04]); - incxy = (INT16)(ctrl[0x05]); - - if (ctrl[0x06] & 0x4000) { incyx *= 256; incyy *= 256; } - if (ctrl[0x06] & 0x0040) { incxx *= 256; incxy *= 256; } - - if (nScreenStartY) { - startx -= -10 * incyx; - starty -= -10 * incyy; - startx -= -58 * incxx; - starty -= -58 * incxy; - } else { - startx -= -21 * incyx; - starty -= -21 * incyy; - startx -= -48 * incxx; - starty -= -48 * incxy; - } - - copy_roz(startx << 5, starty << 5, incxx << 5, incxy << 5, incyx << 5, incyy << 5, transp); -} - -static void recalculate_palette() -{ - if (DrvRecalc) { - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x400; i++) { - r = (p[i] >> 10) & 0x1f; - g = (p[i] >> 5) & 0x1f; - b = (p[i] >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - DrvPalette[0x400] = 0; - } -} - -static INT32 F1gpDraw() -{ - recalculate_palette(); - predraw_background(); - draw_background(0); - - if (*gfxctrl == 0x00) { - if (nBurnLayer & 2) f1gp_draw_sprites(DrvSprVRAM2, DrvSprCGRAM2, DrvGfxROM2, 0x20); - if (nBurnLayer & 1) f1gp_draw_sprites(DrvSprVRAM1, DrvSprCGRAM1, DrvGfxROM1, 0x10); - if (nBurnLayer & 4) draw_foreground(1); - } else { - if (nBurnLayer & 2) f1gp_draw_sprites(DrvSprVRAM2, DrvSprCGRAM2, DrvGfxROM2, 0x20); - if (nBurnLayer & 4) draw_foreground(1); - if (nBurnLayer & 1) f1gp_draw_sprites(DrvSprVRAM1, DrvSprCGRAM1, DrvGfxROM1, 0x10); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 F1gp2Draw() -{ - recalculate_palette(); - predraw_background(); - - if (!(*gfxctrl & 4)) { - switch (*gfxctrl & 3) - { - case 0: - if (nBurnLayer & 1) draw_background(0); - if (nBurnLayer & 4) f1gp2_draw_sprites(); - if (nBurnLayer & 2) draw_foreground(1); - break; - - case 1: - if (nBurnLayer & 1) draw_background(0); - if (nBurnLayer & 2) draw_foreground(1); - if (nBurnLayer & 4) f1gp2_draw_sprites(); - break; - - case 2: - if (nBurnLayer & 2) draw_foreground(0); - if (nBurnLayer & 1) draw_background(1); - if (nBurnLayer & 4) f1gp2_draw_sprites(); - break; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 F1gpbDraw() -{ - recalculate_palette(); - BurnTransferClear(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - DrvInputs[0] = 0xffff; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[3] = { 10000000 / 60, 10000000 / 60, 5000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCycleSegment = ((nCyclesTotal[0] / nInterleave) * (i+1)) - nCyclesDone[0]; - - SekOpen(0); - nCyclesDone[0] += SekRun(nCycleSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - SekClose(); - - SekOpen(1); - nCyclesDone[1] += SekRun(nCycleSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - BurnTimerEndFrame(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - if (nScreenStartY) { - for (INT32 i = 0; i < 0x40000; i+=2) { - expand_dynamic_tiles(i); - } - } - - ZetOpen(0); - sound_bankswitch(*DrvZ80Bank); - ZetClose(); - } - - return 0; -} - - -// F-1 Grand Prix - -static struct BurnRomInfo f1gpRomDesc[] = { - { "rom1-a.3", 0x020000, 0x2d8f785b, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "rom11-a.2", 0x040000, 0x53df8ea1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rom10-a.1", 0x040000, 0x46a289fb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rom13-a.4", 0x040000, 0x7d92e1fa, 1 | BRF_PRG | BRF_ESS }, // 3 - { "rom12-a.3", 0x040000, 0xd8c1bcf4, 1 | BRF_PRG | BRF_ESS }, // 4 - { "rom6-a.6", 0x040000, 0x6d947a3f, 1 | BRF_PRG | BRF_ESS }, // 5 - { "rom7-a.5", 0x040000, 0x7a014ba6, 1 | BRF_PRG | BRF_ESS }, // 6 - { "rom9-a.8", 0x040000, 0x49286572, 1 | BRF_PRG | BRF_ESS }, // 7 - { "rom8-a.7", 0x040000, 0x0ed783c7, 1 | BRF_PRG | BRF_ESS }, // 8 - { "rom2-a.06", 0x100000, 0x747dd112, 1 | BRF_PRG | BRF_ESS }, // 9 - { "rom3-a.05", 0x100000, 0x264aed13, 1 | BRF_PRG | BRF_ESS }, // 10 - - { "rom4-a.4", 0x020000, 0x8e811d36, 2 | BRF_PRG | BRF_ESS }, // 11 68K #1 Code - - { "rom5-a.8", 0x020000, 0x9ea36e35, 3 | BRF_PRG | BRF_ESS }, // 12 Z80 Code - - { "rom3-b.07", 0x100000, 0xffb1d489, 4 | BRF_GRA }, // 13 Character Tiles - { "rom2-b.04", 0x100000, 0xd1b3471f, 4 | BRF_GRA }, // 14 - - { "rom5-b.2", 0x080000, 0x17572b36, 5 | BRF_GRA }, // 15 Sprite Bank 0 - { "rom4-b.3", 0x080000, 0x72d12129, 5 | BRF_GRA }, // 16 - - { "rom7-b.17", 0x040000, 0x2aed9003, 6 | BRF_GRA }, // 17 Sprite Bank 1 - { "rom6-b.16", 0x040000, 0x6789ef12, 6 | BRF_GRA }, // 18 - - { "rom14-a.09", 0x100000, 0xb4c1ac31, 7 | BRF_SND }, // 19 YM2610 Samples - { "rom17-a.08", 0x100000, 0xea70303d, 7 | BRF_SND }, // 20 -}; - -STD_ROM_PICK(f1gp) -STD_ROM_FN(f1gp) - -static INT32 F1gpInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvF1gp = { - "f1gp", NULL, NULL, NULL, "1991", - "F-1 Grand Prix\0", NULL, "Video System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, f1gpRomInfo, f1gpRomName, NULL, NULL, F1gpInputInfo, F1gpDIPInfo, - F1gpInit, DrvExit, DrvFrame, F1gpDraw, DrvScan, &DrvRecalc, 0x401, - 240, 320, 3, 4 -}; - - -// F-1 Grand Prix (Playmark bootleg) - -static struct BurnRomInfo f1gpbRomDesc[] = { - { "1.ic38", 0x020000, 0x046dd83a, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 code - { "7.ic39", 0x020000, 0x960f5db4, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2.ic48", 0x080000, 0xb3b315c3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "8.ic41", 0x080000, 0x39af8180, 1 | BRF_PRG | BRF_ESS }, // 3 - { "3.ic165", 0x080000, 0xb7295a30, 1 | BRF_PRG | BRF_ESS }, // 4 - { "9.ic166", 0x080000, 0xbb596d5b, 1 | BRF_PRG | BRF_ESS }, // 5 - { "4.ic42", 0x080000, 0x5dbde98a, 1 | BRF_PRG | BRF_ESS }, // 6 - { "10.ic43", 0x080000, 0xd60e7706, 1 | BRF_PRG | BRF_ESS }, // 7 - { "5.ic167", 0x080000, 0x48c36293, 1 | BRF_PRG | BRF_ESS }, // 8 - { "11.ic168", 0x080000, 0x92a28e52, 1 | BRF_PRG | BRF_ESS }, // 9 - - { "16.u7", 0x010000, 0x7609d818, 2 | BRF_PRG | BRF_ESS }, // 10 68K #1 Code - { "17.u6", 0x010000, 0x951befde, 2 | BRF_PRG | BRF_ESS }, // 11 - - { "13.ic151", 0x080000, 0x4238074b, 3 | BRF_GRA }, // 12 Character Tiles - { "12.ic152", 0x080000, 0xe97c2b6e, 3 | BRF_GRA }, // 13 - { "15.ic153", 0x080000, 0xc2867d7f, 3 | BRF_GRA }, // 14 - { "14.ic154", 0x080000, 0x0cd20423, 3 | BRF_GRA }, // 15 - - { "rom21", 0x080000, 0x7a08c3b7, 4 | BRF_GRA }, // 16 Sprite Banks - { "rom20", 0x080000, 0xbd1273d0, 4 | BRF_GRA }, // 17 - { "19.ic141", 0x080000, 0xaa4ebdfe, 4 | BRF_GRA }, // 18 - { "18.ic140", 0x080000, 0x9b2a4325, 4 | BRF_GRA }, // 19 - - { "6.ic13", 0x080000, 0x6e83ffd8, 5 | BRF_SND }, // 20 OKI MSM6295 Samples -}; - -STD_ROM_PICK(f1gpb) -STD_ROM_FN(f1gpb) - -static INT32 F1gpbInit() -{ - return 1; -} - -struct BurnDriverD BurnDrvF1gpb = { - "f1gpb", "f1gp", NULL, NULL, "1991", - "F-1 Grand Prix (Playmark bootleg)\0", NULL, "[Video System Co.] (Playmark bootleg)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_BOOTLEG, 1, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, f1gpbRomInfo, f1gpbRomName, NULL, NULL, F1gpInputInfo, F1gpDIPInfo, - F1gpbInit, DrvExit, DrvFrame, F1gpbDraw, DrvScan, &DrvRecalc, 0x401, - 240, 320, 3, 4 -}; - - -// F-1 Grand Prix Part II - -static struct BurnRomInfo f1gp2RomDesc[] = { - { "rom12.v1", 0x020000, 0xc5c5f199, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "rom14.v2", 0x020000, 0xdd5388e2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rom2", 0x200000, 0x3b0cfa82, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "rom13.v3", 0x020000, 0xc37aa303, 2 | BRF_PRG | BRF_ESS }, // 3 68K #1 Code - - { "rom5.v4", 0x020000, 0x6a9398a1, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "rom1", 0x200000, 0xf2d55ad7, 4 | BRF_GRA }, // 5 Character Tiles - - { "rom15", 0x200000, 0x1ac03e2e, 5 | BRF_GRA }, // 6 Sprites - - { "rom11", 0x100000, 0xb22a2c1f, 6 | BRF_GRA }, // 7 Background Tiles - { "rom10", 0x100000, 0x43fcbe23, 6 | BRF_GRA }, // 8 - { "rom9", 0x100000, 0x1bede8a1, 6 | BRF_GRA }, // 9 - { "rom8", 0x100000, 0x98baf2a1, 6 | BRF_GRA }, // 10 - - { "rom4", 0x080000, 0xc2d3d7ad, 7 | BRF_SND }, // 11 YM2610 Samples - { "rom3", 0x100000, 0x7f8f066f, 7 | BRF_SND }, // 12 -}; - -STD_ROM_PICK(f1gp2) -STD_ROM_FN(f1gp2) - -static INT32 F1gp2Init() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvF1gp2 = { - "f1gp2", NULL, NULL, NULL, "1992", - "F-1 Grand Prix Part II\0", NULL, "Video System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, f1gp2RomInfo, f1gp2RomName, NULL, NULL, F1gp2InputInfo, F1gp2DIPInfo, - F1gp2Init, DrvExit, DrvFrame, F1gp2Draw, DrvScan, &DrvRecalc, 0x401, - 224, 320, 3, 4 -}; - diff --git a/jan/src/burn/drv/pst90s/d_funybubl.cpp b/jan/src/burn/drv/pst90s/d_funybubl.cpp deleted file mode 100644 index 767c2d9d8..000000000 --- a/jan/src/burn/drv/pst90s/d_funybubl.cpp +++ /dev/null @@ -1,623 +0,0 @@ -// FB Alpha Funny Bubble driver module -// Based on MAME driver by Pierpaolo Prazzoli and David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "msm6295.h" - -// To do: -// Fix sound after save state - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInps[3]; - -static UINT32 *DrvPalette; -static UINT32 *Palette; - -static UINT8 DrvRecalc; - -static UINT8 soundlatch; -static INT32 nDrvRomBank; -static INT32 nDrvVidRAMBank; -static INT32 nDrvOkiBank; - -static struct BurnInputInfo FunybublInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Funybubl) - - -static struct BurnDIPInfo FunybublDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin_A" }, - {0x0f, 0x01, 0x07, 0x01, "3 Coins 1 Credits " }, - {0x0f, 0x01, 0x07, 0x02, "2 Coins 1 Credits " }, - {0x0f, 0x01, 0x07, 0x03, "3 Coins 2 Credits " }, - {0x0f, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x0f, 0x01, 0x07, 0x04, "2 Coins 3 Credits " }, - {0x0f, 0x01, 0x07, 0x06, "1 Coin 2 Credits " }, - {0x0f, 0x01, 0x07, 0x05, "1 Coin 3 Credits " }, - {0x0f, 0x01, 0x07, 0x00, "Free_Play" }, - - {0 , 0xfe, 0 , 7, "Difficulty" }, - {0x0f, 0x01, 0x38, 0x30, "Very_Easy" }, - {0x0f, 0x01, 0x38, 0x28, "Easy" }, - {0x0f, 0x01, 0x38, 0x38, "Normal" }, - {0x0f, 0x01, 0x38, 0x20, "Hard 1" }, - {0x0f, 0x01, 0x38, 0x18, "Hard 2" }, - {0x0f, 0x01, 0x38, 0x10, "Hard 3" }, - {0x0f, 0x01, 0x38, 0x08, "Hard 4" }, - - {0 , 0xfe, 0 , 2, "Demo_Sounds" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Nudity" }, - {0x0f, 0x01, 0x80, 0x80, "Semi" }, - {0x0f, 0x01, 0x80, 0x00, "Full" }, -}; - -STDDIPINFO(Funybubl) - - -UINT8 __fastcall funybubl_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - return DrvInps[port & 3]; - - case 0x03: - return DrvDips[0]; - - case 0x06: - return 0; - } - - return 0; -} - -void __fastcall funybubl_write(UINT16 address, UINT8 data) -{ - if (address >= 0xc400 && address <= 0xcfff) { - - INT32 offset = address - 0xc400; - - DrvPalRAM[offset] = data; - - UINT32 coldat; - - offset &= 0xfffc; - - coldat = DrvPalRAM[offset] | (DrvPalRAM[offset+1] << 8) | (DrvPalRAM[offset+2] << 16) | (DrvPalRAM[offset+3] << 24); - - UINT8 r, g, b; - - r = (coldat >> 12) << 2; - r |= r >> 6; - - g = (coldat >> 0) << 2; - g |= g >> 6; - - b = (coldat >> 6) << 2; - b |= b >> 6; - - Palette[offset >> 2] = (r << 16) | (g << 8) | b; - DrvPalette[offset >> 2] = BurnHighCol(r, g, b, 0); - - return; - } -} - -static void funybubl_set_vidram_bank(INT32 data) -{ - nDrvVidRAMBank = data & 1; - - ZetMapArea(0xd000, 0xdfff, 0, DrvVidRAM + nDrvVidRAMBank * 0x1000); - ZetMapArea(0xd000, 0xdfff, 1, DrvVidRAM + nDrvVidRAMBank * 0x1000); - ZetMapArea(0xd000, 0xdfff, 2, DrvVidRAM + nDrvVidRAMBank * 0x1000); -} - -static void funybubl_set_rom_bank(INT32 data) -{ - nDrvRomBank = data & 0x3f; - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + nDrvRomBank * 0x4000); - ZetMapArea(0x8000, 0xbfff, 1, DrvZ80ROM0 + nDrvRomBank * 0x4000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM0 + nDrvRomBank * 0x4000); -} - -static void funybubl_set_oki_bank(INT32 data) -{ - nDrvOkiBank = data & 1; - - MSM6295SetBank(0, DrvSndROM + (nDrvOkiBank * 0x40000), 0x00000, 0x3ffff); -} - -void __fastcall funybubl_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - funybubl_set_vidram_bank(data); - return; - - case 0x01: - funybubl_set_rom_bank(data); - return; - - case 0x03: - soundlatch = data; - - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - ZetOpen(0); - return; - - case 0x06: - case 0x07: - return; - } -} - -void __fastcall funybubl_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - funybubl_set_oki_bank(data); - return; - - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall funybubl_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - return soundlatch; - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[8] = { 0x200000 * 3, 0x200000 * 2, 0x200000 * 1, 0x200000 * 0, - 0x200000 * 7, 0x200000 * 6, 0x200000 * 5, 0x200000 * 4 }; - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs0[8] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }; - - INT32 Plane1[8] = { 0x400000 * 3 + 4, 0x400000 * 3 + 0, 0x400000 * 2 + 4, 0x400000 * 2 + 0, - 0x400000 * 1 + 4, 0x400000 * 1 + 0, 0x400000 * 0 + 4, 0x400000 * 0 + 0 }; - INT32 XOffs1[16] = { 0, 1,2,3, 8,9,10,11, 256,257,258,259, 264,265,266,267 }; - INT32 YOffs1[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16,10*16,11*16,12*16,13*16,14*16,15*16 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x200000; i++) { // invert - DrvGfxROM0[i] ^= 0xff; - DrvGfxROM1[i] ^= 0xff; - } - - memcpy (tmp, DrvGfxROM0, 0x200000); - - GfxDecode(0x8000, 8, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x2000, 8, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x040000; - DrvZ80ROM1 = Next; Next += 0x008000; - - DrvSndROM = Next; Next += 0x080000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x000c00; - DrvVidRAM = Next; Next += 0x002000; - - DrvZ80RAM1 = Next; Next += 0x000800; - - Palette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - funybubl_set_vidram_bank(0); - funybubl_set_rom_bank(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - funybubl_set_oki_bank(0); - MSM6295Reset(0); - - soundlatch = 0; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0, 0, 1)) return 1; - - for (INT32 i = 0; i < 8; i++) - if (BurnLoadRom(DrvGfxROM0 + i * 0x40000, i + 1, 1)) return 1; - - for (INT32 i = 0; i < 4; i++) - if (BurnLoadRom(DrvGfxROM1 + i * 0x80000, i + 9, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM, 14, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x20000, 15, 1)) return 1; - - memcpy (DrvSndROM + 0x60000, DrvSndROM + 0x40000, 0x20000); - memcpy (DrvSndROM + 0x40000, DrvSndROM + 0x00000, 0x20000); - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0xc400, 0xcfff, 0, DrvPalRAM); - ZetMapArea(0xc400, 0xcfff, 2, DrvPalRAM); - ZetMapArea(0xe000, 0xffff, 0, DrvZ80RAM0); - ZetMapArea(0xe000, 0xffff, 1, DrvZ80RAM0); - ZetMapArea(0xe000, 0xffff, 2, DrvZ80RAM0); - ZetSetWriteHandler(funybubl_write); - ZetSetOutHandler(funybubl_out); - ZetSetInHandler(funybubl_in); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); - ZetSetWriteHandler(funybubl_sound_write); - ZetSetReadHandler(funybubl_sound_read); - ZetClose(); - - MSM6295Init(0, 1056000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - UINT8 *source = &DrvVidRAM[0x2000-0x20]; - UINT8 *finish = source - 0x1000; - - while (source > finish) - { - INT32 sx, sy, code; - - sy = source[2]; - sx = source[3]; - code = source[0] | ( (source[1] & 0x0f) <<8); - if (source[1] & 0x80) code += 0x1000; - if (source[1] & 0x20) { if (sx < 0xe0) sx += 0x100; } - - sx -= 96; - sy -= 16; - - if ((sx >= 0 && sx < 305) || (sy >= 0 && sy < 208)) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 8, 0xff, 0, DrvGfxROM1); - } - - source -= 0x20; - } -} - -static void draw_background() -{ - for (INT32 offs = 0; offs < 0x1000; offs+=2) - { - INT32 sx = ((offs >> 1) & 0x3f) << 3; - INT32 sy = (offs >> 7) << 3; - - sx -= 96; - sy -= 16; - if (sx < 0 || sx > 312 || sy < 0 || sy > 216) continue; - - INT32 code = DrvVidRAM[offs] | (DrvVidRAM[offs + 1] << 8); - - Render8x8Tile_Mask_Clip(pTransDraw, code & 0x7fff, sx, sy, 1+(code>>15), 8, 0, 0, DrvGfxROM0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x300; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - } - - memset (pTransDraw, 0, nScreenWidth * nScreenHeight * 2); - - draw_background(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInps, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInps[0] ^= (DrvJoy1[i] & 1) << i; - DrvInps[1] ^= (DrvJoy2[i] & 1) << i; - DrvInps[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 6000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment; - - ZetOpen(0); - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - nCyclesDone[1] += ZetRun(nSegment); - ZetClose(); - } - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029697; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - MSM6295Scan(0, nAction); - - SCAN_VAR(soundlatch); - SCAN_VAR(nDrvOkiBank); - SCAN_VAR(nDrvRomBank); - SCAN_VAR(nDrvVidRAMBank); - } - - if (nAction & ACB_WRITE) { - funybubl_set_oki_bank(nDrvOkiBank); - ZetOpen(0); - funybubl_set_rom_bank(nDrvRomBank); - funybubl_set_vidram_bank(nDrvVidRAMBank); - ZetClose(); - } - - return 0; -} - -// Funny Bubble - -static struct BurnRomInfo funybublRomDesc[] = { - { "a.ub16", 0x40000, 0x4e799cdd, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "f.ug13", 0x40000, 0x64d7163d, 2 | BRF_GRA }, // 1 Background Tiles - { "g.uh13", 0x40000, 0x6891e2b8, 2 | BRF_GRA }, // 2 - { "h.ug15", 0x40000, 0xca7f7528, 2 | BRF_GRA }, // 3 - { "i.uh15", 0x40000, 0x23608ec6, 2 | BRF_GRA }, // 4 - { "l.ug16", 0x40000, 0x0acf8143, 2 | BRF_GRA }, // 5 - { "m.uh16", 0x40000, 0x55ed8d9c, 2 | BRF_GRA }, // 6 - { "n.ug17", 0x40000, 0x52398b68, 2 | BRF_GRA }, // 7 - { "o.uh17", 0x40000, 0x446e31b2, 2 | BRF_GRA }, // 8 - - { "d.ug1", 0x80000, 0xb7ebbc00, 3 | BRF_GRA }, // 9 Sprites - { "e.ug2", 0x80000, 0x28afc396, 3 | BRF_GRA }, // 10 - { "j.ug3", 0x80000, 0x9e8687cd, 3 | BRF_GRA }, // 11 - { "k.ug4", 0x80000, 0x63f0e810, 3 | BRF_GRA }, // 12 - - { "p.su6", 0x08000, 0x33169d4d, 4 | BRF_PRG | BRF_ESS }, // 13 Z80 #1 Code - - { "b.su12", 0x20000, 0xa2d780f4, 5 | BRF_SND }, // 14 Samples - { "c.su13", 0x40000, 0x1f7e9269, 5 | BRF_SND }, // 15 -}; - -STD_ROM_PICK(funybubl) -STD_ROM_FN(funybubl) - -struct BurnDriver BurnDrvFunybubl = { - "funybubl", NULL, NULL, NULL, "1999", - "Funny Bubble\0", NULL, "In Chang Electronic Co", "misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, funybublRomInfo, funybublRomName, NULL, NULL, FunybublInputInfo, FunybublDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 224, 4, 3 -}; - - -// Funny Bubble (Comad version) - -static struct BurnRomInfo funybubcRomDesc[] = { - { "2.ub16", 0x40000, 0xd684c13f, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "7.ug12", 0x40000, 0x87603d7b, 2 | BRF_GRA }, // 1 Background Tiles - { "8.uh13", 0x40000, 0xab6031bd, 2 | BRF_GRA }, // 2 - { "9.ug15", 0x40000, 0x0e8352ff, 2 | BRF_GRA }, // 3 - { "10.uh15", 0x40000, 0xdf7dd356, 2 | BRF_GRA }, // 4 - { "13.ug16", 0x40000, 0x9f57bdd5, 2 | BRF_GRA }, // 5 - { "14.uh16", 0x40000, 0x2ac15ea3, 2 | BRF_GRA }, // 6 - { "15.ug17", 0x40000, 0x9a5e66a6, 2 | BRF_GRA }, // 7 - { "16.uh17", 0x40000, 0x218060b3, 2 | BRF_GRA }, // 8 - - { "5.ug1", 0x80000, 0xb7ebbc00, 3 | BRF_GRA }, // 9 Sprites - { "6.ug2", 0x80000, 0x28afc396, 3 | BRF_GRA }, // 10 - { "11.ug3", 0x80000, 0x9e8687cd, 3 | BRF_GRA }, // 11 - { "12.ug4", 0x80000, 0x63f0e810, 3 | BRF_GRA }, // 12 - - { "1.su6", 0x08000, 0x33169d4d, 4 | BRF_PRG | BRF_ESS }, // 13 Z80 #1 Code - - { "3.su12", 0x20000, 0xa2d780f4, 5 | BRF_SND }, // 14 Samples - { "4.su13", 0x40000, 0x1f7e9269, 5 | BRF_SND }, // 15 -}; - -STD_ROM_PICK(funybubc) -STD_ROM_FN(funybubc) - -struct BurnDriver BurnDrvFunybubc = { - "funybublc", "funybubl", NULL, NULL, "1999", - "Funny Bubble (Comad version)\0", NULL, "Comad Industry Co Ltd", "misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, funybubcRomInfo, funybubcRomName, NULL, NULL, FunybublInputInfo, FunybublDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_fuukifg2.cpp b/jan/src/burn/drv/pst90s/d_fuukifg2.cpp deleted file mode 100644 index 60d04f468..000000000 --- a/jan/src/burn/drv/pst90s/d_fuukifg2.cpp +++ /dev/null @@ -1,1075 +0,0 @@ -// FB Alpha Fuuki 16 Bit driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "burn_ym2203.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvVidRAM2; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRegs; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvPriority; -static UINT8 DrvBank; -static UINT8 soundlatch; -static UINT8 DrvOkiBank; -static UINT8 raster_timer; - -static INT32 flipscreen; -static INT32 video_char_bank; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT16 DrvInputs[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo GogomileInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 1, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Gogomile) - -static struct BurnInputInfo PbanchoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up " }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 8, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pbancho) - - -static struct BurnDIPInfo GogomileDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x01, 0x01, "Off" }, - {0x10, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Music" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x0c, 0x00, "Easy" }, - {0x10, 0x01, 0x0c, 0x0c, "Normal" }, - {0x10, 0x01, 0x0c, 0x08, "Hard" }, - {0x10, 0x01, 0x0c, 0x04, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Language" }, - {0x10, 0x01, 0x30, 0x10, "Chinese" }, - {0x10, 0x01, 0x30, 0x30, "Japanese" }, - {0x10, 0x01, 0x30, 0x00, "Korean" }, - {0x10, 0x01, 0x30, 0x20, "English" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0xc0, 0x00, "2" }, - {0x10, 0x01, 0xc0, 0xc0, "3" }, - {0x10, 0x01, 0xc0, 0x80, "4" }, - {0x10, 0x01, 0xc0, 0x40, "5" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x1c, 0x04, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x14, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x0c, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x1c, 0x18, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x1c, 0x08, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x1c, 0x10, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x1c, 0x00, "Free Play" }, -}; - -STDDIPINFO(Gogomile) - -static struct BurnDIPInfo GogomileoDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x01, 0x01, "Off" }, - {0x10, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Music" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x0c, 0x00, "Easy" }, - {0x10, 0x01, 0x0c, 0x0c, "Normal" }, - {0x10, 0x01, 0x0c, 0x08, "Hard" }, - {0x10, 0x01, 0x0c, 0x04, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Language" }, - {0x10, 0x01, 0x30, 0x10, "Chinese" }, - {0x10, 0x01, 0x30, 0x30, "Japanese" }, - {0x10, 0x01, 0x30, 0x00, "Korean" }, - {0x10, 0x01, 0x30, 0x20, "English" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0xc0, 0x00, "2" }, - {0x10, 0x01, 0xc0, 0xc0, "3" }, - {0x10, 0x01, 0xc0, 0x80, "4" }, - {0x10, 0x01, 0xc0, 0x40, "5" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x1c, 0x18, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x14, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x1c, 0x04, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x1c, 0x08, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x1c, 0x0c, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x1c, 0x00, "Free Play" }, -}; - -STDDIPINFO(Gogomileo) - -static struct BurnDIPInfo PbanchoDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x01, 0x01, "Off" }, - {0x10, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 5, "Difficulty" }, - {0x10, 0x01, 0x1c, 0x08, "Easiest" }, - {0x10, 0x01, 0x1c, 0x10, "Easy" }, - {0x10, 0x01, 0x1c, 0x1c, "Normal" }, - {0x10, 0x01, 0x1c, 0x18, "Hard" }, - {0x10, 0x01, 0x1c, 0x04, "Hardest" }, - - {0 , 0xfe, 0 , 3, "Lives (Vs Mode)" }, - {0x10, 0x01, 0x60, 0x00, "1" }, - {0x10, 0x01, 0x60, 0x60, "2" }, - {0x10, 0x01, 0x60, 0x40, "3" }, - - {0 , 0xfe, 0 , 2, "? Senin Mode ?" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Versus Mode" }, - {0x11, 0x01, 0x02, 0x00, "No" }, - {0x11, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x1c, 0x0c, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x14, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x04, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x1c, 0x10, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x1c, 0x08, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x1c, 0x18, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0xe0, 0x60, "4 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0xa0, "3 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0x20, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xe0, 0x80, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xe0, 0x40, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xe0, 0xc0, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xe0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Pbancho) - -static inline void palette_update(INT32 offset) -{ - offset &= 0x3ffe; - UINT16 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (p >> 10) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r,g,b,0); -} - -static void __fastcall fuuki16_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffc000) == 0x700000) { - *((UINT16*)(DrvPalRAM + (address & 0x3ffe))) = data; - palette_update(address); - return; - } - - if ((address & 0xffffe0) == 0x8c0000) { - INT32 offset = (address / 2) & 0xf; - UINT16 *regs = (UINT16*)DrvVidRegs; - if (regs[offset] != data) { - if (offset == 0x0e) { - raster_timer = data & 0xff; // 8 bits or lock up! - } - } - regs[offset] = data; - return; - } - - switch (address) - { - case 0x8a0000: - soundlatch = data; - ZetNmi(); - return; - - case 0x8d0000: - case 0x8d0002: // unk - return; - - case 0x8e0000: - DrvPriority = data & 0x000f; - return; - } -} - -static void __fastcall fuuki16_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffc000) == 0x700000) { - DrvPalRAM[(address & 0x3fff)^1] = data; - palette_update(address); - return; - } - switch (address) - { - case 0x8a0001: - soundlatch = data; - ZetNmi(); - return; - } - - bprintf (0, _T("MWB: %5.5x, %2.2x\n"), address, data); -} - -static UINT8 __fastcall fuuki16_main_read_byte(UINT32 address) -{ - bprintf (0, _T("MRB: %5.5x\n"), address); - - return 0; -} - -static UINT16 __fastcall fuuki16_main_read_word(UINT32 address) -{ - if ((address & 0xffffe0) == 0x8c0000) { - //return *((UINT16*)(DrvVidRegs) + ((address / 2) & 0xf)); - INT32 offset = (address / 2) & 0xf; - UINT16 *regs = (UINT16*)DrvVidRegs; - return regs[offset]; - } - - switch (address) - { - case 0x800000: - return DrvInputs[0]; - - case 0x810000: - return DrvInputs[1]; - - case 0x880000: - return (DrvDips[1] * 256) + DrvDips[0]; - } - - bprintf (0, _T("MRW: %5.5x\n"), address); - - return 0; -} - -static void bankswitch(INT32 data) -{ - if (data < 3) - { - DrvBank = data; - - INT32 bank = 0x8000 + (data * 0x8000); - ZetMapMemory(DrvZ80ROM + bank, 0x8000, 0xffff, MAP_ROM); - } -} - -static void oki_bankswitch(INT32 data) -{ - INT32 bank = ((data & 6) >> 1) * 0x40000; - - DrvOkiBank = data; - - MSM6295SetBank(0, DrvSndROM + bank, 0, 0x3ffff); -} - -static void __fastcall fuuki16_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - bankswitch(data); - return; - - case 0x11: - return; // nop - - case 0x20: - oki_bankswitch(data); - return; - - case 0x30: - return; // nop - - case 0x40: - case 0x41: - BurnYM2203Write(0, port & 1, data); - return; - - case 0x50: - case 0x51: - BurnYM3812Write(0, port & 1, data); - return; - - case 0x61: - MSM6295Command(0, data); - return; - } -} - -static UINT8 __fastcall fuuki16_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x11: - return soundlatch; - - case 0x40: - case 0x41: - return BurnYM2203Read(0, port & 1); - - case 0x50: - case 0x51: - return BurnYM3812Read(0, port & 1); - - case 0x60: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static tilemap_callback( layer0 ) -{ - UINT16 *ram = (UINT16*)DrvVidRAM0; - UINT16 attr = ram[2 * offs + 1]; - - TILE_SET_INFO(0, ram[offs * 2], attr, TILE_FLIPYX((attr >> 6) & 3)); // hack! y flipping is broken. see the waves and highscore table in pbancho -} - -static tilemap_callback( layer1 ) -{ - UINT16 *ram = (UINT16*)DrvVidRAM1; - UINT16 attr = ram[2 * offs + 1]; - - TILE_SET_INFO(1, ram[offs * 2], attr, TILE_FLIPYX((attr >> 6) & 3)); -} - -static tilemap_callback( layer2 ) -{ - UINT16 *ram = (UINT16*)(DrvVidRAM2 + video_char_bank); - UINT16 attr = ram[2 * offs + 1]; - - TILE_SET_INFO(2, ram[offs * 2], attr, TILE_FLIPYX((attr >> 6) & 3)); -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvYM2203SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)SekTotalCycles() * nSoundRate / 16000000; -} - -static double DrvYM2203GetTime() -{ - return (double)SekTotalCycles() / 16000000; -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -static int DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - BurnYM2203Reset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM3812Reset(); - ZetClose(); - - soundlatch = 0; - flipscreen = 0; - DrvPriority = 0; - DrvBank = 0; - raster_timer = 0; - - oki_bankswitch(0); - MSM6295Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - DrvGfxROM2 = Next; Next += 0x800000; - DrvGfxROM3 = Next; Next += 0x400000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x2001 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvZ80RAM = Next; Next += 0x002000; - DrvVidRAM0 = Next; Next += 0x002000; - DrvVidRAM1 = Next; Next += 0x002000; - DrvVidRAM2 = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x004000; - DrvVidRegs = Next; Next += 0x000020; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - - -static void expand_4bpp_pixels(UINT8 *src, INT32 len) -{ - // byteswap (each rom is byteswapped) - BurnByteswap(src,len); - - // expand byte into nibbles - for (INT32 i = (len - 1); i >= 0; i--) { - src[i*2+0] = src[i] >> 4; - src[i*2+1] = src[i] & 0xf; - } -} - -static void expand_8bpp_pixels(UINT8 *src, INT32 len) -{ - // swap words (each rom is byteswapped) - for (INT32 i = 0; i < len; i+=4) { - UINT16 t = *((UINT16*)(src + i + 0)); - *((UINT16*)(src + i + 0)) = *((UINT16*)(src + i + 2)); - *((UINT16*)(src + i + 2)) = t; - } - - // swap nibbles around a bit - for (INT32 i = 0; i < len; i+=2) { - UINT8 a = src[i]; - UINT8 b = src[i+1]; - - src[i+1] = ((b << 4) & 0xf0) | (a & 0xf); - src[i+0] = (b & 0xf0) | ((a >> 4) & 0xf); - } -} - -static INT32 DrvInit(INT32 nGame) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x0000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000000, 5, 2)) return 1; - - if (nGame == 0) - { - if (BurnLoadRom(DrvGfxROM2 + 0x0400000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0400001, 8, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x0000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 10, 1)) return 1; - } - else - { - if (BurnLoadRom(DrvGfxROM2 + 0x0000001, 6, 2)) return 1; - //memcpy (DrvGfxROM2 + 0x400000, DrvGfxROM2, 0x400000); - - if (BurnLoadRom(DrvGfxROM3 + 0x0000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 8, 1)) return 1; - } - - expand_4bpp_pixels(DrvGfxROM0, 0x200000); - expand_4bpp_pixels(DrvGfxROM1, 0x200000); - expand_8bpp_pixels(DrvGfxROM2, 0x800000); - expand_4bpp_pixels(DrvGfxROM3, 0x200000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x500000, 0x501fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x502000, 0x503fff, MAP_RAM); - SekMapMemory(DrvVidRAM2, 0x504000, 0x507fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x600000, 0x601fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x608000, 0x609fff, MAP_RAM); // mirror - SekMapMemory(DrvPalRAM, 0x700000, 0x703fff, MAP_ROM); // written in handler - SekSetWriteWordHandler(0, fuuki16_main_write_word); - SekSetWriteByteHandler(0, fuuki16_main_write_byte); - SekSetReadWordHandler(0, fuuki16_main_read_word); - SekSetReadByteHandler(0, fuuki16_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x6000, 0x7fff, MAP_RAM); - // bank 8000-ffff - ZetSetOutHandler(fuuki16_sound_write_port); - ZetSetInHandler(fuuki16_sound_read_port); - ZetClose(); - - BurnYM3812Init(1, 3580000, &DrvFMIRQHandler, DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(6000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.30, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 3580000, NULL, DrvYM2203SynchroniseStream, DrvYM2203GetTime, 1); - BurnTimerAttachSek(16000000); - BurnYM2203SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.85, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, layer0_map_callback, 16, 16, 64, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, layer1_map_callback, 16, 16, 64, 32); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, layer2_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(0, DrvGfxROM1, 4, 16, 16, 0x400000, 0x000, 0x3f); - GenericTilemapSetGfx(1, DrvGfxROM2, 4, 16, 16, 0x800000, 0x400, 0x3f); // bpp is actually, 8, but handled as 4 - GenericTilemapSetGfx(2, DrvGfxROM3, 4, 8, 8, 0x400000, 0xc00, 0x3f); - GenericTilemapSetTransparent(0, 0x0f); - GenericTilemapSetTransparent(1, 0xff); - GenericTilemapSetTransparent(2, 0x0f); - - // enable line drawing. line drawing is fastest for single scanline updates - GenericTilemapSetScrollRows(0, 512); - GenericTilemapSetScrollRows(1, 512); - GenericTilemapSetScrollRows(2, 256); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - - BurnYM3812Exit(); - BurnYM2203Exit(); - MSM6295Exit(0); - MSM6295ROM = NULL; - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x4000/2; i++) - { - INT32 r = (p[i] >> 10) & 0x1f; - INT32 g = (p[i] >> 5) & 0x1f; - INT32 b = (p[i] >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_sprites() -{ - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - - int max_x = nScreenWidth; - int max_y = nScreenHeight; - - for (INT32 offs = (0x2000 - 8) / 2; offs >=0; offs -= 8 / 2) - { - INT32 x, y, xstart, ystart, xend, yend, xinc, yinc; - INT32 xnum, ynum, xzoom, yzoom, flipx, flipy; - INT32 pri_mask; - - INT32 sx = spriteram16[offs + 0]; - INT32 sy = spriteram16[offs + 1]; - INT32 attr = spriteram16[offs + 2]; - INT32 code = spriteram16[offs + 3]; - - INT32 color = (attr & 0x3f) * 16 + 0x800; - - if (sx & 0x400) - continue; - - flipx = sx & 0x0800; - flipy = sy & 0x0800; - - xnum = ((sx >> 12) & 0xf) + 1; - ynum = ((sy >> 12) & 0xf) + 1; - - xzoom = 16 * 8 - (8 * ((attr >> 12) & 0xf)) / 2; - yzoom = 16 * 8 - (8 * ((attr >> 8) & 0xf)) / 2; - - switch ((attr >> 6) & 3) - { - case 3: pri_mask = 0xf0 | 0xcc | 0xaa; break; // behind all layers - case 2: pri_mask = 0xf0 | 0xcc; break; // behind fg + middle layer - case 1: pri_mask = 0xf0; break; // behind fg layer - case 0: - default: pri_mask = 0; // above all - } - - sx = (sx & 0x1ff) - (sx & 0x200); - sy = (sy & 0x1ff) - (sy & 0x200); - - if (flipscreen) - { - flipx = !flipx; sx = max_x - sx - xnum * 16; - flipy = !flipy; sy = max_y - sy - ynum * 16; - } - - if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; } - else { xstart = 0; xend = xnum; xinc = +1; } - - if (flipy) { ystart = ynum-1; yend = -1; yinc = -1; } - else { ystart = 0; yend = ynum; yinc = +1; } - - for (y = ystart; y != yend; y += yinc) - { - for (x = xstart; x != xend; x += xinc) - { - if (xzoom == (16*8) && yzoom == (16*8)) { - RenderPrioSprite(pTransDraw, DrvGfxROM0, code++, color, 0xf, sx + x * 16, sy + y * 16, flipx, flipy, 16, 16, pri_mask); - } else { - RenderZoomedPrioSprite(pTransDraw, DrvGfxROM0, code++, color, 0xf, sx + (x * xzoom) / 8, sy + (y * yzoom) / 8, flipx, flipy, 16, 16, (0x10000/0x10/8) * (xzoom + 8),(0x10000/0x10/8) * (yzoom + 8), pri_mask); - } - } - } - } -} - -static INT32 previous_previous_line = 0; -static INT32 previous_line = 0; - -static void set_clipping(INT32 scanline) -{ - // Set the clip to the current scanline as the final point, and the starting point is one pixel higher than the - // last drawing pass. This allows for a partial screen update - GenericTilesSetClip(-1, -1, previous_line, scanline+1); - - // save parameters for use later (updating scroll rows) - previous_previous_line = previous_line; - previous_line = scanline+1; -} - -static INT32 DrvDraw() -{ - static const int pri_table[6][3] = { - { 0, 1, 2 }, { 0, 2, 1 }, { 1, 0, 2 }, { 1, 2, 0 }, { 2, 0, 1 }, { 2, 1, 0 } - }; - - UINT16 *regs = (UINT16*)DrvVidRegs; - - flipscreen = regs[0xf] & 1; - - INT32 layer[3] = { pri_table[DrvPriority][2], pri_table[DrvPriority][1], pri_table[DrvPriority][0] }; - - INT32 scrolly_offs = regs[6] - 0x1f3; - INT32 scrollx_offs = regs[7] - 0x3f6; - - GenericTilemapSetScrollY(0, regs[0] + scrolly_offs); - GenericTilemapSetScrollY(1, regs[2] + scrolly_offs); - GenericTilemapSetScrollY(2, regs[4] + scrolly_offs); - - for (INT32 i = previous_previous_line; i < previous_line; i++) { - GenericTilemapSetScrollRow(0, (i + regs[0] + scrolly_offs) & 0x1ff, regs[1] + scrollx_offs); - GenericTilemapSetScrollRow(1, (i + regs[2] + scrolly_offs) & 0x1ff, regs[3] + scrollx_offs); - GenericTilemapSetScrollRow(2, (i + regs[4] + scrolly_offs) & 0x0ff, regs[5] + scrollx_offs + 0x10); - } - - video_char_bank = (regs[0xf] & 0x40) * 0x80; // 0x2000 - - for (INT32 i = 0; i < 3; i++) { - if (nBurnLayer & (1 << layer[i])) GenericTilemapDraw(layer[i], pTransDraw, 1 << i); - } - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2 * sizeof (UINT16)); - - for (INT32 i = 0 ; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 16000000 / 60, 6000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - // set up drawing for this frame - // we are on line 0 - previous_line = 0; - - // clear drawing surface - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x1fff; - pPrioDraw[i] = 0; - } - - for (INT32 i = 0; i < nInterleave; i++) - { - BurnTimerUpdate((nCyclesTotal[0] / nInterleave) * (i + 1)); - - if (i == 239+3) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); // vblank - +3 for occasional coin-up issues in gogomile in demo mode - if (i == 0) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); // level 1 - start at line 0, fixes glitches during bootup/huge tilemap animations - if (i == raster_timer+1) { - // update layers when calling for a raster update - if (i < nScreenHeight) { - set_clipping(i); - BurnDrvRedraw(); - } - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - raster_timer = nInterleave - 2; // fix glitch in middle of pink x+y scroll "mile smile" screen - } - - nCyclesDone[1] += BurnTimerUpdateYM3812((nCyclesTotal[1] / nInterleave) * (i + 1)); - } - - BurnTimerEndFrame(nCyclesTotal[0]); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) - { - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; - } - - set_clipping(nScreenHeight-1); - - DrvDraw(); - - GenericTilesClearClip(); - - if (nSpriteEnable & 1) draw_sprites(); - - BurnTransferCopy(DrvPalette); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - ZetOpen(0); - SekOpen(0); - BurnYM3812Scan(nAction, pnMin); - BurnYM2203Scan(nAction, pnMin); - SekClose(); - ZetClose(); - - MSM6295Scan(0, nAction); - - SCAN_VAR(DrvBank); - SCAN_VAR(DrvOkiBank); - SCAN_VAR(DrvPriority); - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - SCAN_VAR(raster_timer); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(DrvBank); - ZetClose(); - - oki_bankswitch(DrvOkiBank); - } - - return 0; -} - - -// Susume! Mile Smile / Go Go! Mile Smile (newer) - -static struct BurnRomInfo gogomileRomDesc[] = { - { "fp2n.rom2", 0x080000, 0xe73583a0, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "fp1n.rom1", 0x080000, 0x7b110824, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "fs1.rom24", 0x020000, 0x4e4bd371, 2 | BRF_PRG | BRF_ESS }, // 2 z80 code - - { "lh537k2r.rom20", 0x200000, 0x525dbf51, 3 | BRF_GRA }, // 3 sprites - - { "lh5370h6.rom3", 0x200000, 0xe2ca7107, 4 | BRF_GRA }, // 4 16 x 16 x 4bpp (layer 0) tiles - - { "lh5370h8.rom11", 0x200000, 0x9961c925, 5 | BRF_GRA }, // 5 16 x 16 x 8bpp (layer 1) tiles - { "lh5370ha.rom12", 0x200000, 0x5f2a87de, 5 | BRF_GRA }, // 6 - { "lh5370h7.rom15", 0x200000, 0x34921680, 5 | BRF_GRA }, // 7 - { "lh5370h9.rom16", 0x200000, 0xe0118483, 5 | BRF_GRA }, // 8 - - { "lh5370hb.rom19", 0x200000, 0xbd1e896f, 6 | BRF_GRA }, // 9 8 x 8 x 4bpp (layer 2) tiles - - { "lh538n1d.rom25", 0x100000, 0x01622a95, 7 | BRF_SND }, // 10 oki samples -}; - -STD_ROM_PICK(gogomile) -STD_ROM_FN(gogomile) - -static INT32 GogomileInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvGogomile = { - "gogomile", NULL, NULL, NULL, "1995", - "Susume! Mile Smile / Go Go! Mile Smile (newer)\0", NULL, "Fuuki", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, gogomileRomInfo, gogomileRomName, NULL, NULL, GogomileInputInfo, GogomileDIPInfo, - GogomileInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 320, 240, 4, 3 -}; - - -// Susume! Mile Smile / Go Go! Mile Smile (older) - -static struct BurnRomInfo gogomileoRomDesc[] = { - { "fp2.rom2", 0x080000, 0x28fd3e4e, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "fp1.rom1", 0x080000, 0x35a5fc45, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "fs1.rom24", 0x020000, 0x4e4bd371, 2 | BRF_PRG | BRF_ESS }, // 2 z80 code - - { "lh537k2r.rom20", 0x200000, 0x525dbf51, 3 | BRF_GRA }, // 3 sprites - - { "lh5370h6.rom3", 0x200000, 0xe2ca7107, 4 | BRF_GRA }, // 4 16 x 16 x 4bpp (layer 0) tiles - - { "lh5370h8.rom11", 0x200000, 0x9961c925, 5 | BRF_GRA }, // 5 16 x 16 x 8bpp (layer 1) tiles - { "lh5370ha.rom12", 0x200000, 0x5f2a87de, 5 | BRF_GRA }, // 6 - { "lh5370h7.rom15", 0x200000, 0x34921680, 5 | BRF_GRA }, // 7 - { "lh5370h9.rom16", 0x200000, 0xe0118483, 5 | BRF_GRA }, // 8 - - { "lh5370hb.rom19", 0x200000, 0xbd1e896f, 6 | BRF_GRA }, // 9 8 x 8 x 4bpp (layer 2) tiles - - { "lh538n1d.rom25", 0x100000, 0x01622a95, 7 | BRF_SND }, // 10 oki samples -}; - -STD_ROM_PICK(gogomileo) -STD_ROM_FN(gogomileo) - -struct BurnDriver BurnDrvGogomileo = { - "gogomileo", "gogomile", NULL, NULL, "1995", - "Susume! Mile Smile / Go Go! Mile Smile (older)\0", NULL, "Fuuki", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, gogomileoRomInfo, gogomileoRomName, NULL, NULL, GogomileInputInfo, GogomileoDIPInfo, - GogomileInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 320, 240, 4, 3 -}; - - -// Gyakuten!! Puzzle Bancho (Japan) - -static struct BurnRomInfo pbanchoRomDesc[] = { - { "no1.rom2", 0x080000, 0x1b4fd178, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "no2,rom1", 0x080000, 0x9cf510a5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "no4.rom23", 0x020000, 0xdfbfdb81, 2 | BRF_PRG | BRF_ESS }, // 2 z80 code - - { "58.rom20", 0x200000, 0x4dad0a2e, 3 | BRF_GRA }, // 3 sprites - - { "60.rom3", 0x200000, 0xa50a3c1b, 4 | BRF_GRA }, // 4 16 x 16 x 4bpp (layer 0) tiles - - { "61.rom11", 0x200000, 0x7f1213b9, 5 | BRF_GRA }, // 5 16 x 16 x 8bpp (layer 1) tiles - { "59.rom15", 0x200000, 0xb83dcb70, 5 | BRF_GRA }, // 6 - - { "60.rom3", 0x200000, 0xa50a3c1b, 6 | BRF_GRA }, // 7 8 x 8 x 4bpp (layer 2) tiles - - { "n03.rom25", 0x040000, 0xa7bfb5ea, 7 | BRF_SND }, // 8 oki samples -}; - -STD_ROM_PICK(pbancho) -STD_ROM_FN(pbancho) - -static INT32 PbanchoInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvPbancho = { - "pbancho", NULL, NULL, NULL, "1996", - "Gyakuten!! Puzzle Bancho (Japan)\0", NULL, "Fuuki", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, pbanchoRomInfo, pbanchoRomName, NULL, NULL, PbanchoInputInfo, PbanchoDIPInfo, - PbanchoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_fuukifg3.cpp b/jan/src/burn/drv/pst90s/d_fuukifg3.cpp deleted file mode 100644 index dda7917dd..000000000 --- a/jan/src/burn/drv/pst90s/d_fuukifg3.cpp +++ /dev/null @@ -1,1490 +0,0 @@ -// FB Alpha Fuuki FG-3 driver module -// Based on MAME driver by Paul Priest and David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ymf278b.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf0; -static UINT8 *DrvSprBuf1; -static UINT8 *DrvFgRAM1; -static UINT8 *DrvFgRAM2; -static UINT8 *DrvBgRAM1; -static UINT8 *DrvBgRAM2; -static UINT8 *DrvVidRegs; -static UINT8 *DrvShareRAM; -static UINT8 *DrvZ80RAM; -static UINT32 *DrvScrollBuf; -static UINT8 *DrvTransTab1; -static UINT8 *DrvTransTab2; -static UINT8 *DrvTransTab3; - -static UINT16 *DrvRasterPos; -static UINT8 *nDrvZ80Bank; -static UINT16 *tilebank; -static UINT16 *tilebank_buf; -static UINT8 *priority; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 DrvInputs[4]; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[4]; -static UINT8 DrvReset; - -static INT32 nEnableRaster[3]; - -static INT32 asurablade = 0; - -static struct BurnInputInfo AsurabldInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 8, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Asurabld) - -static struct BurnInputInfo AsurabusaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 15, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 8, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Asurabusa) - -static struct BurnDIPInfo AsurabldDIPList[]= -{ - {0x14, 0xff, 0xff, 0x3f, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Blood Colour" }, - {0x14, 0x01, 0x02, 0x02, "Red" }, - {0x14, 0x01, 0x02, 0x00, "Green" }, - - {0 , 0xfe, 0 , 4, "Demo Sounds & Music" }, - {0x14, 0x01, 0x0c, 0x0c, "Both On" }, - {0x14, 0x01, 0x0c, 0x08, "Music Off" }, - {0x14, 0x01, 0x0c, 0x04, "Both Off" }, - {0x14, 0x01, 0x0c, 0x00, "Both Off" }, /* Duplicate setting */ - - {0 , 0xfe, 0 , 4, "Timer" }, - {0x14, 0x01, 0x30, 0x00, "Slow" }, - {0x14, 0x01, 0x30, 0x30, "Medium" }, - {0x14, 0x01, 0x30, 0x10, "Fast" }, - {0x14, 0x01, 0x30, 0x20, "Very Fast" }, - - {0 , 0xfe, 0 , 2, "Coinage Mode" }, - {0x14, 0x01, 0xc0, 0xc0, "Split" }, - {0x14, 0x01, 0xc0, 0x00, "Joint" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x15, 0x01, 0x01, 0x01, "Off" }, -// {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x15, 0x01, 0x0e, 0x00, "Easiest" }, // Level 1 - {0x15, 0x01, 0x0e, 0x08, "Very_Easy" }, // Level 2 - {0x15, 0x01, 0x0e, 0x04, "Easier" }, // Level 3 - {0x15, 0x01, 0x0e, 0x0c, "Easy" }, // Level 4 - {0x15, 0x01, 0x0e, 0x0e, "Normal" }, // Level 5 - {0x15, 0x01, 0x0e, 0x02, "Hard" }, // Level 6 - {0x15, 0x01, 0x0e, 0x0a, "Very_Hard" }, // Level 7 - {0x15, 0x01, 0x0e, 0x06, "Hardest" }, // Level 8 - - {0 , 0xfe, 0 , 4, "Damage" }, - {0x15, 0x01, 0x30, 0x20, "75%" }, - {0x15, 0x01, 0x30, 0x30, "100%" }, - {0x15, 0x01, 0x30, 0x10, "125%" }, - {0x15, 0x01, 0x30, 0x00, "150%" }, - - {0 , 0xfe, 0 , 3, "Max Rounds" }, - {0x15, 0x01, 0xc0, 0x00, "1" }, - {0x15, 0x01, 0xc0, 0x40, "3" }, - {0x15, 0x01, 0xc0, 0x80, "5" }, - - {0 , 0xfe, 0 , 14, "Coin B" }, - {0x16, 0x01, 0x0f, 0x08, "8 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x09, "7 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0a, "6 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0c, "4 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0d, "3 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0e, "2 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits " }, - {0x16, 0x01, 0x0f, 0x06, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x0f, 0x05, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x0f, 0x04, "1 Coin 4 Credits" }, - {0x16, 0x01, 0x0f, 0x03, "1 Coin 5 Credits" }, - {0x16, 0x01, 0x0f, 0x02, "2 Coin Start / 1 Credit Continue" }, - {0x16, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 14, "Coin A" }, - {0x16, 0x01, 0xf0, 0x80, "8 Coins 1 Credit" }, - {0x16, 0x01, 0xf0, 0x90, "7 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xf0, 0x60, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xf0, 0x50, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xf0, 0x40, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xf0, 0x30, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xf0, 0x20, "2 Coin Start / 1 Credit Continue" }, - {0x16, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Asurabld) - -static struct BurnDIPInfo AsurabusDIPList[]= -{ - {0x14, 0xff, 0xff, 0x3f, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Blood Colour" }, - {0x14, 0x01, 0x02, 0x02, "Red" }, - {0x14, 0x01, 0x02, 0x00, "Green" }, - - {0 , 0xfe, 0 , 4, "Demo Sounds & Music" }, - {0x14, 0x01, 0x0c, 0x0c, "Both On" }, - {0x14, 0x01, 0x0c, 0x08, "Sounds Off" }, - {0x14, 0x01, 0x0c, 0x04, "Music Off" }, - {0x14, 0x01, 0x0c, 0x00, "Both Off" }, - - {0 , 0xfe, 0 , 4, "Timer" }, - {0x14, 0x01, 0x30, 0x00, "Slow" }, - {0x14, 0x01, 0x30, 0x30, "Medium" }, - {0x14, 0x01, 0x30, 0x10, "Fast" }, - {0x14, 0x01, 0x30, 0x20, "Very Fast" }, - - {0 , 0xfe, 0 , 2, "Coinage Mode" }, - {0x14, 0x01, 0xc0, 0xc0, "Split" }, - {0x14, 0x01, 0xc0, 0x00, "Joint" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x15, 0x01, 0x01, 0x01, "Off" }, -// {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x15, 0x01, 0x0e, 0x00, "Easiest" }, // Level 1 - {0x15, 0x01, 0x0e, 0x08, "Very_Easy" }, // Level 2 - {0x15, 0x01, 0x0e, 0x04, "Easier" }, // Level 3 - {0x15, 0x01, 0x0e, 0x0c, "Easy" }, // Level 4 - {0x15, 0x01, 0x0e, 0x0e, "Normal" }, // Level 5 - {0x15, 0x01, 0x0e, 0x02, "Hard" }, // Level 6 - {0x15, 0x01, 0x0e, 0x0a, "Very_Hard" }, // Level 7 - {0x15, 0x01, 0x0e, 0x06, "Hardest" }, // Level 8 - - {0 , 0xfe, 0 , 4, "Damage" }, - {0x15, 0x01, 0x30, 0x20, "75%" }, - {0x15, 0x01, 0x30, 0x30, "100%" }, - {0x15, 0x01, 0x30, 0x10, "125%" }, - {0x15, 0x01, 0x30, 0x00, "150%" }, - - {0 , 0xfe, 0 , 3, "Max Rounds" }, - {0x15, 0x01, 0xc0, 0x00, "1" }, - {0x15, 0x01, 0xc0, 0x40, "3" }, - {0x15, 0x01, 0xc0, 0x80, "5" }, - - {0 , 0xfe, 0 , 14, "Coin B" }, - {0x16, 0x01, 0x0f, 0x08, "8 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x09, "7 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0a, "6 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0c, "4 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0d, "3 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0e, "2 Coins 1 Credits " }, - {0x16, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits " }, - {0x16, 0x01, 0x0f, 0x06, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x0f, 0x05, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x0f, 0x04, "1 Coin 4 Credits" }, - {0x16, 0x01, 0x0f, 0x03, "1 Coin 5 Credits" }, - {0x16, 0x01, 0x0f, 0x02, "2 Coin Start / 1 Credit Continue" }, - {0x16, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 14, "Coin A" }, - {0x16, 0x01, 0xf0, 0x80, "8 Coins 1 Credit" }, - {0x16, 0x01, 0xf0, 0x90, "7 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xf0, 0x60, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xf0, 0x50, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xf0, 0x40, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xf0, 0x30, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xf0, 0x20, "2 Coin Start / 1 Credit Continue" }, - {0x16, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Asurabus) - -static inline void cpu_sync() // sync z80 & 68k -{ - INT32 t = ((SekTotalCycles() * 3) / 10) - ZetTotalCycles(); - - if (t > 0) { - BurnTimerUpdate(t); - } -} - -void __fastcall fuuki32_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffe0) == 0x8c0000) { - - if (address == 0x8c001c) { - DrvRasterPos[0] = data & 0xff; - } - - *((UINT16*)(DrvVidRegs + (address & 0x1e))) = BURN_ENDIAN_SWAP_INT16(data); - - return; - } - - if ((address & 0xffffe0) == 0x903fe0) { - cpu_sync(); - - DrvShareRAM[(address & 0x1f) >> 1] = data & 0xff; - return; - } - - switch (address) - { - case 0x8e0000: - priority[0] = data & 0x000f; - return; - - case 0xa00000: - tilebank[0] = data; - return; - } -} - -void __fastcall fuuki32_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffffe0) == 0x903fe0) { - cpu_sync(); - - DrvShareRAM[(address & 0x1f) >> 1] = data; - return; - } -} - -UINT16 __fastcall fuuki32_read_word(UINT32 address) -{ - switch (address) - { - case 0x800000: - return DrvInputs[0]; - - case 0x810000: - return DrvInputs[1]; - - case 0x880000: - return DrvInputs[2]; - - case 0x890000: - return DrvInputs[3]; - - case 0x8c001e: - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvVidRegs + 0x1e))); - } - - return 0; -} - -UINT8 __fastcall fuuki32_read_byte(UINT32 address) -{ - if ((address & 0xffffe0) == 0x903fe0) { - cpu_sync(); - return DrvShareRAM[(address & 0x1f) >> 1]; - } - - return 0; -} - -static void bankswitch(INT32 data) -{ - nDrvZ80Bank[0] = data; - - INT32 nBank = (data & 0x0f) * 0x8000; - - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + nBank); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + nBank); -} - -void __fastcall fuuki32_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0x7ff0) { - DrvShareRAM[address & 0x0f] = data; - return; - } -} - -UINT8 __fastcall fuuki32_sound_read(UINT16 address) -{ - if ((address & 0xfff0) == 0x7ff0) { - return DrvShareRAM[address & 0x0f]; - } - - return 0; -} - -void __fastcall fuuki32_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - bankswitch(data); - return; - - case 0x40: - case 0x42: - case 0x44: - BurnYMF278BSelectRegister((port >> 1) & 3, data); - return; - - case 0x41: - case 0x43: - case 0x45: - BurnYMF278BWriteRegister((port >> 1) & 3, data); - return; - } -} - -UINT8 __fastcall fuuki32_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x40: - return BurnYMF278BReadStatus(); - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYMF278BReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x200000; - DrvZ80ROM = Next; Next += 0x080000; - - DrvTransTab1 = Next; Next += 0x008000; - DrvTransTab2 = Next; Next += 0x008000; - DrvTransTab3 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x4000000; - DrvGfxROM1 = Next; Next += 0x800000; - DrvGfxROM2 = Next; Next += 0x800000; - DrvGfxROM3 = Next; Next += 0x400000; - - DrvSndROM = Next; Next += 0x400000; - - DrvPalette = (UINT32 *)Next; Next += 0x2000 * sizeof(UINT32); - DrvScrollBuf = (UINT32 *)Next; Next += 256 * 4 * sizeof(UINT32); - DrvRasterPos = (UINT16*)Next; Next += 0x0001 * sizeof(UINT16); - - AllRam = Next; - - DrvVidRegs = Next; Next += 0x000400; - DrvShareRAM = Next; Next += 0x000010; - DrvZ80RAM = Next; Next += 0x001000; - - Drv68KRAM = Next; Next += 0x020000; - DrvPalRAM = Next; Next += 0x004000; - DrvFgRAM1 = Next; Next += 0x002000; - DrvFgRAM2 = Next; Next += 0x020000; - DrvBgRAM1 = Next; Next += 0x002000; - DrvBgRAM2 = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x002000; - DrvSprBuf0 = Next; Next += 0x002000; - DrvSprBuf1 = Next; Next += 0x002000; - - priority = Next; Next += 0x000001; - - tilebank = (UINT16*)Next; Next += 0x0001 * sizeof(UINT16); - tilebank_buf = (UINT16*)Next; Next += 0x0002 * sizeof(UINT16); - - nDrvZ80Bank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[ 8] = { 0x0000000, 0x0000001, 0x0000002, 0x0000003, - 0x2000000, 0x2000001, 0x2000002, 0x2000003 }; - INT32 XOffs[16] = { 0x008, 0x00c, 0x000, 0x004, 0x018, 0x01c, 0x010, 0x014, - 0x028, 0x02c, 0x020, 0x024, 0x038, 0x03c, 0x030, 0x034 }; - INT32 YOffs0[ 8] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0 }; - INT32 YOffs1[16] = { 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, - 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0 }; - - UINT8 *tmp = DrvGfxROM0 + 0x2000000; - - memcpy (tmp, DrvGfxROM1, 0x800000); - - GfxDecode(0x08000, 8, 16, 16, Plane, XOffs, YOffs1, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x800000); - - GfxDecode(0x08000, 8, 16, 16, Plane, XOffs, YOffs1, 0x400, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x200000); - - GfxDecode(0x10000, 4, 8, 8, Plane, XOffs, YOffs0, 0x100, tmp, DrvGfxROM3); - - return 0; -} - -static void DrvSpriteExpand() -{ - BurnByteswap(DrvGfxROM0, 0x4000000); - UINT8 *tmp; - - for (INT32 i = 0x2000000 - 0x80; i >= 0; i -= 0x80) - { - tmp = DrvGfxROM0 + i; - - for (INT32 j = 0x7f; j >= 0; j--) { - INT32 t = tmp[j]; - DrvGfxROM0[((i + j) << 1) + 0] = t >> 4; - DrvGfxROM0[((i + j) << 1) + 1] = t & 0x0f; - } - } -} - -static void DrvCalculateTransTab(UINT8 *src, UINT8 *dst, INT32 t, INT32 w, INT32 len) -{ - UINT8 *dptr = dst; - for (INT32 i = 0; i < len; i+= w) - { - INT32 a = 0, b = 0; - for (INT32 j = 0; j < w; j++) { - a|=src[i+j]^t; - - if (src[i+j] != t) { - b++; - } - } - - dptr[0] = a ? 0 : 2; - if (b == w) dptr[0] |= 1; - - dptr++; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000003, 2, 4)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000002, 3, 4)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0400000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0400000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x0000000, 10, 1)) return 1; - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "asurabld") == 0) { - if (BurnLoadRom(DrvGfxROM0 + 0x0400000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0800000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1400000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1800000, 16, 1)) return 1; - } else { - if (BurnLoadRom(DrvGfxROM0 + 0x0000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0400000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0800000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1400000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1800000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1c00000, 18, 1)) return 1; - } - - DrvGfxDecode(); - DrvSpriteExpand(); - - DrvCalculateTransTab(DrvGfxROM1, DrvTransTab1, 0xff, 0x100, 0x800000); - DrvCalculateTransTab(DrvGfxROM2, DrvTransTab2, 0xff, 0x100, 0x800000); - DrvCalculateTransTab(DrvGfxROM3, DrvTransTab3, 0x0f, 0x040, 0x400000); - } - - SekInit(0, 0x68ec020); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x410000, 0x41ffff, MAP_RAM); - SekMapMemory(DrvBgRAM1, 0x500000, 0x501fff, MAP_RAM); - SekMapMemory(DrvBgRAM2, 0x502000, 0x503fff, MAP_RAM); - SekMapMemory(DrvFgRAM1, 0x504000, 0x505fff, MAP_RAM); - SekMapMemory(DrvFgRAM2, 0x506000, 0x507fff, MAP_RAM); - SekMapMemory(DrvFgRAM2 + 0x2000,0x508000, 0x517fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x600000, 0x601fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700000, 0x703fff, MAP_RAM); - SekSetWriteWordHandler(0, fuuki32_write_word); - SekSetWriteByteHandler(0, fuuki32_write_byte); - SekSetReadWordHandler(0, fuuki32_read_word); - SekSetReadByteHandler(0, fuuki32_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM); - ZetMapArea(0x6000, 0x6fff, 0, DrvZ80RAM); - ZetMapArea(0x6000, 0x6fff, 1, DrvZ80RAM); - ZetMapArea(0x6000, 0x6fff, 2, DrvZ80RAM); - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + 0x8000); - ZetSetWriteHandler(fuuki32_sound_write); - ZetSetReadHandler(fuuki32_sound_read); - ZetSetOutHandler(fuuki32_sound_out); - ZetSetInHandler(fuuki32_sound_in); - ZetClose(); - - if (asurablade) { - BurnYMF278BInit((INT32)(YMF278B_STD_CLOCK * 1.93), DrvSndROM, 0x400000, &DrvFMIRQHandler, DrvSynchroniseStream); - } else { - BurnYMF278BInit((INT32)(YMF278B_STD_CLOCK * 1.80), DrvSndROM, 0x400000, &DrvFMIRQHandler, DrvSynchroniseStream); - } - BurnYMF278BSetRoute(BURN_SND_YMF278B_YMF278B_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYMF278BSetRoute(BURN_SND_YMF278B_YMF278B_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - BurnTimerAttachZet(6000000); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYMF278BExit(); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - asurablade = 0; - - return 0; -} - -static void draw_sprites(INT32 prio) -{ - UINT16 *src = (UINT16*)DrvSprBuf1; - - for (INT32 offs = 0; offs < 0x2000 / 2; offs += 4) - { - INT32 sx = BURN_ENDIAN_SWAP_INT16(src[offs + 0]); - INT32 sy = BURN_ENDIAN_SWAP_INT16(src[offs + 1]); - INT32 attr = BURN_ENDIAN_SWAP_INT16(src[offs + 2]); - INT32 code = BURN_ENDIAN_SWAP_INT16(src[offs + 3]); - - if (prio != ((attr >> 6) & 0x0003) || sx & 0x0400) continue; - - INT32 bank = (tilebank_buf[1] >> ((code >> 12) & 0x0c)) & 0xf; - - code = (code & 0x3fff) | (bank << 14); - - INT32 flipx = sx & 0x0800; - INT32 flipy = sy & 0x0800; - INT32 xnum = ((sx >> 12) & 0xf) + 1; - INT32 ynum = ((sy >> 12) & 0xf) + 1; - INT32 xzoom = 128 - ((attr >> 10) & 0x3c); - INT32 yzoom = 128 - ((attr >> 6) & 0x3c); - - sx = (sx & 0x1ff) - (sx & 0x200); - sy = (sy & 0x1ff) - (sy & 0x200); - - INT32 xstart, ystart, xend, yend, xinc, yinc; - if (flipx) { xstart = (xnum-1) * 16; xend = -16; xinc = -16; } - else { xstart = 0; xend = xnum * 16; xinc = +16; } - - if (flipy) { ystart = (ynum-1) * 16; yend = -16; yinc = -16; } - else { ystart = 0; yend = ynum * 16; yinc = +16; } - - for (INT32 y = ystart; y != yend; y += yinc) - { - for (INT32 x = xstart; x != xend; x += xinc) - { - if (xzoom == 128 && yzoom == 128) { - if (sx + x >= 0 && sx + x < nScreenWidth - 15 && sy + y >= 0 && sy + y < nScreenHeight - 15) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY(pTransDraw, code++, sx + x, sy + y, attr & 0x3f, 4, 0x0f, 0x800, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY(pTransDraw, code++, sx + x, sy + y, attr & 0x3f, 4, 0x0f, 0x800, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX(pTransDraw, code++, sx + x, sy + y, attr & 0x3f, 4, 0x0f, 0x800, DrvGfxROM0); - } else { - Render16x16Tile_Mask(pTransDraw, code++, sx + x, sy + y, attr & 0x3f, 4, 0x0f, 0x800, DrvGfxROM0); - } - } - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code++, sx + x, sy + y, attr & 0x3f, 4, 0x0f, 0x800, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code++, sx + x, sy + y, attr & 0x3f, 4, 0x0f, 0x800, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code++, sx + x, sy + y, attr & 0x3f, 4, 0x0f, 0x800, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code++, sx + x, sy + y, attr & 0x3f, 4, 0x0f, 0x800, DrvGfxROM0); - } - } - } - } else { - RenderZoomedTile(pTransDraw, DrvGfxROM0, code++, ((attr & 0x3f) << 4) | 0x800, 15, sx + (x * xzoom) / 128, sy + (y * yzoom) / 128, flipx, flipy, 16, 16, (xzoom + 8) << 9, (yzoom + 8) << 9); - } - } - } - } -} - -static void draw_background_layer(UINT8 *ram, UINT8 *gfx, UINT8 *tab, INT32 coloff, INT32 soff) -{ - INT32 yoff = (DrvScrollBuf[0x300] & 0xffff) - 0x1f3; - INT32 xoff = (DrvScrollBuf[0x300] >> 16) - 0x3f6; - INT32 scrolly = ((DrvScrollBuf[soff*256] & 0xffff) + yoff) & 0x1ff; - INT32 scrollx = ((DrvScrollBuf[soff*256] >> 16) + xoff) & 0x3ff; - - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 4; - INT32 sy = (offs >> 6) << 4; - - sx -= scrollx; - if (sx < -15) sx += 1024; - sy -= scrolly; - if (sy < -15) sy += 512; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs*2]) & 0x7fff; - if (tab[code] == 2) continue; - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs*2 + 1]); - - INT32 color = (attr & 0x30) >> 4; - INT32 flipx = (attr >> 6) & 1; - INT32 flipy = (attr >> 7) & 1; - - if (sx >= 0 && sx < nScreenWidth - 15 && sy >= 0 && sy < nScreenHeight - 15) { - if (tab[code]) { - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY(pTransDraw, code, sx, sy, color, 8, coloff, gfx); - } else { - Render16x16Tile_FlipY(pTransDraw, code, sx, sy, color, 8, coloff, gfx); - } - } else { - if (flipx) { - Render16x16Tile_FlipX(pTransDraw, code, sx, sy, color, 8, coloff, gfx); - } else { - Render16x16Tile(pTransDraw, code, sx, sy, color, 8, coloff, gfx); - } - } - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 8, 0xff, coloff, gfx); - } else { - Render16x16Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 8, 0xff, coloff, gfx); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 8, 0xff, coloff, gfx); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 8, 0xff, coloff, gfx); - } - } - } - } else { - if (sx >= nScreenWidth || sy >= nScreenWidth) continue; - - if (tab[code]) { - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 8, coloff, gfx); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 8, coloff, gfx); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 8, coloff, gfx); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 8, coloff, gfx); - } - } - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 8, 0xff, coloff, gfx); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 8, 0xff, coloff, gfx); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 8, 0xff, coloff, gfx); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 8, 0xff, coloff, gfx); - } - } - } - } - } -} - -static void draw_background_layer_byline(UINT8 *ram, UINT8 *gfx, UINT8 *tab, INT32 coloff, INT32 soff) -{ - UINT16 *vram = (UINT16*)ram; - UINT16 *dst = pTransDraw; - - for (INT32 y = 0; y < nScreenHeight; y++) - { - INT32 yoff = (DrvScrollBuf[0x300 + y] & 0xffff) - 0x1f3; - INT32 xoff = (DrvScrollBuf[0x300 + y] >> 16) - 0x3f6; - INT32 scrolly = ((DrvScrollBuf[(soff*256) + y] & 0xffff) + yoff + y) & 0x1ff; - INT32 scrollx = ((DrvScrollBuf[(soff*256) + y] >> 16) + xoff) & 0x3ff; - - INT32 yy = scrolly & 0x1f0; - INT32 yo = (scrolly & 0x0f) << 4; - INT32 xo = scrollx & 0x0f; - - for (INT32 x = 0; x < nScreenWidth + 16; x+=16) - { - INT32 xx = ((scrollx + x) >> 3) & 0x7e; - - INT32 ofst = (yy << 3) | xx; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[ofst]) & 0x7fff; - if (tab[code] == 2) continue; - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[ofst + 1]); - - INT32 color = (attr & 0x30) << 4; - INT32 flipx = ((attr >> 6) & 1) * 0x0f; - INT32 flipy = ((attr >> 7) & 1) * 0xf0; - - color |= coloff; - - UINT8 *src = gfx + (code << 8) + (yo ^ flipy); - - INT32 xxx = x - xo; - - if (tab[code]) { - if (xxx >= 0 && xxx < (nScreenWidth - 15)) { - dst[xxx++] = src[ 0 ^ flipx] | color; - dst[xxx++] = src[ 1 ^ flipx] | color; - dst[xxx++] = src[ 2 ^ flipx] | color; - dst[xxx++] = src[ 3 ^ flipx] | color; - dst[xxx++] = src[ 4 ^ flipx] | color; - dst[xxx++] = src[ 5 ^ flipx] | color; - dst[xxx++] = src[ 6 ^ flipx] | color; - dst[xxx++] = src[ 7 ^ flipx] | color; - dst[xxx++] = src[ 8 ^ flipx] | color; - dst[xxx++] = src[ 9 ^ flipx] | color; - dst[xxx++] = src[10 ^ flipx] | color; - dst[xxx++] = src[11 ^ flipx] | color; - dst[xxx++] = src[12 ^ flipx] | color; - dst[xxx++] = src[13 ^ flipx] | color; - dst[xxx++] = src[14 ^ flipx] | color; - dst[xxx ] = src[15 ^ flipx] | color; - } else { - for (INT32 sx = 0; sx < 16; sx++, xxx++) - { - if (xxx >= 0 && xxx < nScreenWidth) { - dst[xxx] = src[sx ^ flipx] | color; - } - } - } - } else { - if (xxx >= 0 && xxx < (nScreenWidth - 15)) { - for (INT32 sx = 0; sx < 16; sx++, xxx++) { - INT32 pxl = src[sx ^ flipx]; - - if (pxl != 0xff) { - dst[xxx] = pxl | color; - } - } - } else { - for (INT32 sx = 0; sx < 16; sx++, xxx++) { - INT32 pxl = src[sx ^ flipx]; - - if (xxx >= 0 && xxx < nScreenWidth && pxl != 0xff) { - dst[xxx] = pxl | color; - } - } - } - } - } - - dst += nScreenWidth; - } -} - -static void draw_foreground_layer(UINT8 *ram) -{ - UINT16 *vram = (UINT16*)ram; - - INT32 scrolly = DrvScrollBuf[0x200] & 0xff; - INT32 scrollx = (DrvScrollBuf[0x200] >> 16) & 0x1ff; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs*2]); - if (DrvTransTab3[code] == 2) continue; - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs*2+1]); - - INT32 color = attr & 0x3f; - INT32 flipx = (attr >> 6) & 1; - INT32 flipy = (attr >> 7) & 1; - - if (sx >= 0 && sx < nScreenWidth - 15 && sy >= 0 && sy < nScreenHeight - 15) { - if (DrvTransTab3[code]) { - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy, color, 4, 0xc00, DrvGfxROM3); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy, color, 4, 0xc00, DrvGfxROM3); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy, color, 4, 0xc00, DrvGfxROM3); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, 0xc00, DrvGfxROM3); - } - } - } else { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 0x0f, 0xc00, DrvGfxROM3); - } else { - Render8x8Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 4, 0x0f, 0xc00, DrvGfxROM3); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 4, 0x0f, 0xc00, DrvGfxROM3); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0x0f, 0xc00, DrvGfxROM3); - } - } - } - } else { - if (DrvTransTab3[code]) { - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0xc00, DrvGfxROM3); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0xc00, DrvGfxROM3); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0xc00, DrvGfxROM3); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0xc00, DrvGfxROM3); - } - } - } else { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0xc00, DrvGfxROM3); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0xc00, DrvGfxROM3); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0xc00, DrvGfxROM3); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0xc00, DrvGfxROM3); - } - } - } - } - } -} - -static void draw_foreground_layer_byline(UINT8 *ram) -{ - UINT16 *vram = (UINT16*)ram; - UINT16 *dst = pTransDraw; - - for (INT32 y = 0; y < nScreenHeight; y++) - { - INT32 scrolly = ((DrvScrollBuf[512 + y] & 0xffff) + y) & 0x0ff; - INT32 scrollx = (DrvScrollBuf[512 + y] >> 16) & 0x1ff; - - INT32 yy = scrolly & 0xf8; - INT32 yo = (scrolly & 0x07) << 3; - INT32 xo = scrollx & 0x07; - - for (INT32 x = 0; x < nScreenWidth + 8; x+=8) - { - INT32 xx = ((scrollx + x) >> 2) & 0x7e; - - INT32 ofst = (yy << 4) | xx; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[ofst]); - if (DrvTransTab3[code] == 2) continue; - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[ofst + 1]); - - INT32 color = attr & 0x3f; - INT32 flipx = ((attr >> 6) & 1) * 0x07; - INT32 flipy = ((attr >> 7) & 1) * 0x38; - - color <<= 4; - color |= 0xc00; - - UINT8 *src = DrvGfxROM3 + (code << 6) + (yo ^ flipy); - - INT32 xxx = x - xo; - - if (DrvTransTab3[code]) { - if (xxx >= 0 && xxx < (nScreenWidth - 7)) { - dst[xxx++] = src[0 ^ flipx] | color; - dst[xxx++] = src[1 ^ flipx] | color; - dst[xxx++] = src[2 ^ flipx] | color; - dst[xxx++] = src[3 ^ flipx] | color; - dst[xxx++] = src[4 ^ flipx] | color; - dst[xxx++] = src[5 ^ flipx] | color; - dst[xxx++] = src[6 ^ flipx] | color; - dst[xxx++] = src[7 ^ flipx] | color; - } else { - for (INT32 sx = 0; sx < 8; sx++, xxx++) - { - if (xxx >= 0 && xxx < nScreenWidth) { - dst[xxx] = src[sx ^ flipx] | color; - } - } - } - } else { - if (xxx >= 0 && xxx < (nScreenWidth - 7)) { - for (INT32 sx = 0; sx < 8; sx++, xxx++) { - INT32 pxl = src[sx ^ flipx]; - if (pxl != 0x0f) { - dst[xxx] = pxl | color; - } - } - } else { - for (INT32 sx = 0; sx < 8; sx++, xxx++) { - INT32 pxl = src[sx ^ flipx]; - if (xxx >= 0 && xxx < nScreenWidth && pxl != 0x0f) { - dst[xxx] = pxl | color; - } - } - } - } - } - - dst += nScreenWidth; - } -} - -static void fuuki32_draw_layer(INT32 layer, INT32 buffer) -{ - switch (layer) - { - case 0: - if (nEnableRaster[0]) { - draw_background_layer_byline(DrvBgRAM1, DrvGfxROM1, DrvTransTab1, 0x000, 0); - } else { - draw_background_layer(DrvBgRAM1, DrvGfxROM1, DrvTransTab1, 0x000, 0); - } - return; - - case 1: - if (nEnableRaster[1]) { - draw_background_layer_byline(DrvBgRAM2, DrvGfxROM2, DrvTransTab2, 0x400, 1); - } else { - draw_background_layer(DrvBgRAM2, DrvGfxROM2, DrvTransTab2, 0x400, 1); - } - return; - - case 2: - if (buffer) { - if (nEnableRaster[2]) { - draw_foreground_layer_byline(DrvFgRAM2); - } else { - draw_foreground_layer(DrvFgRAM2); - } - } else { - if (nEnableRaster[2]) { - draw_foreground_layer_byline(DrvFgRAM1); - } else { - draw_foreground_layer(DrvFgRAM1); - } - } - return; - } -} - -static void enable_rasters() -{ - nEnableRaster[0] = nEnableRaster[1] = nEnableRaster[2] = 0; - - for (INT32 i = 0; i < nScreenHeight; i++) { - if (DrvScrollBuf[0x000] != DrvScrollBuf[0x000 + i]) { - nEnableRaster[0] |= 1; - } - - if (DrvScrollBuf[0x100] != DrvScrollBuf[0x100 + i]) { - nEnableRaster[1] |= 1; - } - - if (DrvScrollBuf[0x200] != DrvScrollBuf[0x200 + i]) { - nEnableRaster[2] |= 1; - } - - if (DrvScrollBuf[0x300] != DrvScrollBuf[0x300 + i]) { - nEnableRaster[0] |= 1; - nEnableRaster[1] |= 1; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x2000 / 2; i++) { - r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 10) & 0x1f; - g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 5) & 0x1f; - b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - } - - UINT32 *vregs = (UINT32*)DrvVidRegs; - - static const INT32 pri_table[6][3] = { - { 0, 1, 2 }, - { 0, 2, 1 }, - { 1, 0, 2 }, - { 1, 2, 0 }, // ? - { 2, 0, 1 }, - { 2, 1, 0 } - }; - - INT32 tm_front = pri_table[ priority[0] ][0]; - INT32 tm_middle = pri_table[ priority[0] ][1]; - INT32 tm_back = pri_table[ priority[0] ][2]; - INT32 buffer = BURN_ENDIAN_SWAP_INT32(vregs[0x1e/4]) & 0x40; - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x1fff; - } - - enable_rasters(); - - if (nSpriteEnable & 1) draw_sprites(3); - - fuuki32_draw_layer(tm_back, buffer); - - if (nSpriteEnable & 2) draw_sprites(2); - - fuuki32_draw_layer(tm_middle, buffer); - - if (nSpriteEnable & 4) draw_sprites(1); - - fuuki32_draw_layer(tm_front, buffer); - - if (nSpriteEnable & 8) draw_sprites(0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 0x04); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - DrvInputs[2] = 0xff00 | DrvDips[0]; - DrvInputs[3] = (DrvDips[2] << 8) | DrvDips[1]; - } - - SekNewFrame(); - ZetNewFrame(); - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 20000000 / 60, 6000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - UINT32 *vregs = (UINT32*)DrvVidRegs; - - SekOpen(0); - ZetOpen(0); - - // 68ec020 timing probably not right... - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1); - nCyclesDone[0] += SekRun(nSegment - nCyclesDone[0]); - - if (i == DrvRasterPos[0]) { - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - DrvRasterPos[0] = 0x1000; - } - - if (i == 247) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); // level 1 - if (i == 239) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); // vblank - - //BurnTimerUpdate((i + 1) * nCyclesTotal[1] / nInterleave); // not needed - see cpu_sync() - - // hack -- save scroll/offset registers so the - // lines can be drawn in one pass -- should save - // quite a few cycles... - DrvScrollBuf[i + 0x000] = BURN_ENDIAN_SWAP_INT32(vregs[0]); - DrvScrollBuf[i + 0x100] = BURN_ENDIAN_SWAP_INT32(vregs[1]); - DrvScrollBuf[i + 0x200] = BURN_ENDIAN_SWAP_INT32(vregs[2]); - DrvScrollBuf[i + 0x300] = BURN_ENDIAN_SWAP_INT32(vregs[3]); - - if (i == 0xf0) { // eliminate glitches in sprites, backgrounds - if (pBurnDraw) DrvDraw(); - - memcpy (DrvSprBuf1, DrvSprBuf0, 0x2000); - memcpy (DrvSprBuf0, DrvSprRAM, 0x2000); - tilebank_buf[1] = tilebank_buf[0]; - tilebank_buf[0] = tilebank[0]; - } - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYMF278BUpdate(nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029704; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYMF278BScan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(nDrvZ80Bank[0]); - ZetClose(); - } - - return 0; -} - - -// Asura Blade - Sword of Dynasty (Japan) - -static struct BurnRomInfo asurabldRomDesc[] = { - { "pgm3.u1", 0x080000, 0x053e9758, 1 | BRF_PRG | BRF_ESS }, // 0 68ec020 Code - { "pgm2.u2", 0x080000, 0x16b656ca, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pgm1.u3", 0x080000, 0x35104452, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pgm0.u4", 0x080000, 0x68615497, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "srom.u7", 0x080000, 0xbb1deb89, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "pcm.u6", 0x400000, 0xac72225a, 3 | BRF_SND }, // 5 Samples - - { "bg1113.u23", 0x400000, 0x94338267, 4 | BRF_GRA }, // 6 Background Tiles 0 - { "bg1012.u22", 0x400000, 0xd717a0a1, 4 | BRF_GRA }, // 7 - - { "bg2123.u24", 0x400000, 0x4acfc469, 5 | BRF_GRA }, // 8 Background Tiles 1 - { "bg2022.u25", 0x400000, 0xee312cd3, 5 | BRF_GRA }, // 9 - - { "map.u5", 0x200000, 0xe681155e, 6 | BRF_GRA }, // 10 Character Tiles - - { "sp23.u14", 0x400000, 0x7df492eb, 7 | BRF_GRA }, // 11 Sprite Tiles - { "sp45.u15", 0x400000, 0x1890f42a, 7 | BRF_GRA }, // 12 - { "sp67.u16", 0x400000, 0xa48f1ef0, 7 | BRF_GRA }, // 13 - { "sp89.u17", 0x400000, 0x6b024362, 7 | BRF_GRA }, // 14 - { "spab.u18", 0x400000, 0x803d2d8c, 7 | BRF_GRA }, // 15 - { "spcd.u19", 0x400000, 0x42e5c26e, 7 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(asurabld) -STD_ROM_FN(asurabld) - -static INT32 BladeDrvInit() -{ - asurablade = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvAsurabld = { - "asurabld", NULL, NULL, NULL, "1998", - "Asura Blade - Sword of Dynasty (Japan)\0", NULL, "Fuuki", "FG-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, asurabldRomInfo, asurabldRomName, NULL, NULL, AsurabldInputInfo, AsurabldDIPInfo, - BladeDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 320, 240, 4, 3 -}; - - -// Asura Buster - Eternal Warriors (Japan) - -static struct BurnRomInfo asurabusRomDesc[] = { - { "pgm3.u1", 0x080000, 0x2c6b5271, 1 | BRF_PRG | BRF_ESS }, // 0 68ec020 Code - { "pgm2.u2", 0x080000, 0x8f8694ec, 1 | BRF_PRG | BRF_ESS }, // 1 - { "pgm1.u3", 0x080000, 0x0a040f0f, 1 | BRF_PRG | BRF_ESS }, // 2 - { "pgm0.u4", 0x080000, 0x9b71e9d8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "srom.u7", 0x080000, 0x368da389, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "opm.u6", 0x400000, 0x31b05be4, 3 | BRF_SND }, // 5 Samples - - { "bg1113.u23", 0x400000, 0x5f8657e6, 4 | BRF_GRA }, // 6 Background Tiles 0 - { "bg1012.u22", 0x400000, 0xe3fb9af0, 4 | BRF_GRA }, // 7 - - { "bg2123.u24", 0x400000, 0xc4ebb86b, 5 | BRF_GRA }, // 8 Background Tiles 1 - { "bg2022.u25", 0x400000, 0xf46eda52, 5 | BRF_GRA }, // 9 - - { "map.u5", 0x200000, 0xbd179dc5, 6 | BRF_GRA }, // 10 Character Tiles - - { "sp01.u13", 0x400000, 0x5edea463, 7 | BRF_GRA }, // 11 Sprite Tiles - { "sp23.u14", 0x400000, 0x91b1b0de, 7 | BRF_GRA }, // 12 - { "sp45.u15", 0x400000, 0x96c69aac, 7 | BRF_GRA }, // 13 - { "sp67.u16", 0x400000, 0x7c3d83bf, 7 | BRF_GRA }, // 14 - { "sp89.u17", 0x400000, 0xcb1e14f8, 7 | BRF_GRA }, // 15 - { "spab.u18", 0x400000, 0xe5a4608d, 7 | BRF_GRA }, // 16 - { "spcd.u19", 0x400000, 0x99bfbe32, 7 | BRF_GRA }, // 17 - { "spef.u20", 0x400000, 0xc9c799cc, 7 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(asurabus) -STD_ROM_FN(asurabus) - -struct BurnDriver BurnDrvAsurabus = { - "asurabus", NULL, NULL, NULL, "2000", - "Asura Buster - Eternal Warriors (Japan)\0", NULL, "Fuuki", "FG-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, asurabusRomInfo, asurabusRomName, NULL, NULL, AsurabldInputInfo, AsurabusDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 320, 240, 4, 3 -}; - - -// Asura Buster - Eternal Warriors (Japan) (ARCADIA review build) - -static struct BurnRomInfo asurabusaRomDesc[] = { - { "24-31.pgm3", 0x080000, 0xcfcb9c75, 1 | BRF_PRG | BRF_ESS }, // 0 68ec020 Code - { "16-23.pgm2", 0x080000, 0xe4d07738, 1 | BRF_PRG | BRF_ESS }, // 1 - { "8-15.pgm1", 0x080000, 0x1dd67fe7, 1 | BRF_PRG | BRF_ESS }, // 2 - { "0-7.pgm0", 0x080000, 0x3af08de3, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "srom.u7", 0x080000, 0x368da389, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "opm.u6", 0x400000, 0x31b05be4, 3 | BRF_SND }, // 5 Samples - - { "bg1113.u23", 0x400000, 0x5f8657e6, 4 | BRF_GRA }, // 6 Background Tiles 0 - { "bg1012.u22", 0x400000, 0xe3fb9af0, 4 | BRF_GRA }, // 7 - - { "bg2123.u24", 0x400000, 0xc4ebb86b, 5 | BRF_GRA }, // 8 Background Tiles 1 - { "bg2022.u25", 0x400000, 0xf46eda52, 5 | BRF_GRA }, // 9 - - { "map.u5", 0x200000, 0xbd179dc5, 6 | BRF_GRA }, // 10 Character Tiles - - { "sp01.u13", 0x400000, 0x5edea463, 7 | BRF_GRA }, // 11 Sprite Tiles - { "sp23.u14", 0x400000, 0x91b1b0de, 7 | BRF_GRA }, // 12 - { "sp45.u15", 0x400000, 0x96c69aac, 7 | BRF_GRA }, // 13 - { "sp67.u16", 0x400000, 0x7c3d83bf, 7 | BRF_GRA }, // 14 - { "sp89.u17", 0x400000, 0xcb1e14f8, 7 | BRF_GRA }, // 15 - { "spab.u18", 0x400000, 0xe5a4608d, 7 | BRF_GRA }, // 16 - { "spcd.u19", 0x400000, 0x99bfbe32, 7 | BRF_GRA }, // 17 - { "spef.u20", 0x400000, 0xc9c799cc, 7 | BRF_GRA }, // 18 -}; - -STD_ROM_PICK(asurabusa) -STD_ROM_FN(asurabusa) - -struct BurnDriver BurnDrvAsurabusa = { - "asurabusa", "asurabus", NULL, NULL, "2000", - "Asura Buster - Eternal Warriors (Japan) (ARCADIA review build)\0", NULL, "Fuuki", "FG-3", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, asurabusaRomInfo, asurabusaRomName, NULL, NULL, AsurabusaInputInfo, AsurabusDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_gaelco.cpp b/jan/src/burn/drv/pst90s/d_gaelco.cpp deleted file mode 100644 index c7ce28bb2..000000000 --- a/jan/src/burn/drv/pst90s/d_gaelco.cpp +++ /dev/null @@ -1,1315 +0,0 @@ -// FB Alpha Gaelco hardware driver module -// Based on MAME driver by Manuel Abadia with various bits by Nicola Salmoria and Andreas Naive - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "m6809_intf.h" -#include "msm6295.h" -#include "burn_ym3812.h" -#include "gaelco_crypt.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv6809ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRegs; -static UINT8 *Drv6809RAM; - -static UINT8 *soundlatch; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static INT32 nOkiBank; - -static INT32 gaelco_encryption_param1; -static INT32 has_sound_cpu = 0; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo BigkarnkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Bigkarnk) - -static struct BurnDIPInfo BigkarnkDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xce, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x12, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play (if Coin B too)" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x12, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "Free Play (if Coin A too)" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x13, 0x01, 0x07, 0x07, "0" }, - {0x13, 0x01, 0x07, 0x06, "1" }, - {0x13, 0x01, 0x07, 0x05, "2" }, - {0x13, 0x01, 0x07, 0x04, "3" }, - {0x13, 0x01, 0x07, 0x03, "4" }, - {0x13, 0x01, 0x07, 0x02, "5" }, - {0x13, 0x01, 0x07, 0x01, "6" }, - {0x13, 0x01, 0x07, 0x00, "7" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x18, 0x18, "1" }, - {0x13, 0x01, 0x18, 0x10, "2" }, - {0x13, 0x01, 0x18, 0x08, "3" }, - {0x13, 0x01, 0x18, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Impact" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Go to test mode now" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, -}; - -STDDIPINFO(Bigkarnk) - -static struct BurnDIPInfo ManiacsqDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xf5, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x11, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x11, 0x01, 0x0f, 0x00, "Free Play (if Coin B too)" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x11, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x11, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x11, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x11, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x11, 0x01, 0xf0, 0x00, "Free Play (if Coin A too)" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Sound Type" }, - {0x12, 0x01, 0x08, 0x00, "Stereo" }, - {0x12, 0x01, 0x08, 0x08, "Mono" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0xc0, 0x40, "Easy" }, - {0x12, 0x01, 0xc0, 0xc0, "Normal" }, - {0x12, 0x01, 0xc0, 0x80, "Hard" }, - {0x12, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Maniacsq) - -static struct BurnDIPInfo BiomtoyDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x11, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x11, 0x01, 0x0f, 0x00, "Free Play (if Coin B too)" }, - - {0 , 0xfe, 0 , 11, "Coin B" }, - {0x11, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x11, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x11, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x11, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x11, 0x01, 0xf0, 0x00, "Free Play (if Coin A too)" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x08, 0x00, "Off" }, - {0x12, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x30, 0x20, "0" }, - {0x12, 0x01, 0x30, 0x10, "1" }, - {0x12, 0x01, 0x30, 0x30, "2" }, - {0x12, 0x01, 0x30, 0x00, "3" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0xc0, 0x40, "Easy" }, - {0x12, 0x01, 0xc0, 0xc0, "Normal" }, - {0x12, 0x01, 0xc0, 0x80, "Hard" }, - {0x12, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Biomtoy) - -static struct BurnDIPInfo SquashDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xdf, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x02, "6 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "5 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x11, 0x01, 0x07, 0x00, "4 Coins 3 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x00, "3 Coins 4 Credits" }, - {0x11, 0x01, 0x38, 0x08, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "2 Player Continue" }, - {0x11, 0x01, 0x40, 0x40, "2 Credits / 5 Games" }, - {0x11, 0x01, 0x40, 0x00, "1 Credit / 3 Games" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Number of Faults" }, - {0x12, 0x01, 0x0c, 0x08, "4" }, - {0x12, 0x01, 0x0c, 0x0c, "5" }, - {0x12, 0x01, 0x0c, 0x04, "6" }, - {0x12, 0x01, 0x0c, 0x00, "7" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Squash) - -static struct BurnDIPInfo ThoopDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xcf, NULL }, - - {0 , 0xfe, 0 , 11, "Coin A" }, - {0x11, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x11, 0x01, 0x0f, 0x00, "Free Play (if Coin B too)" }, - - {0 , 0xfe, 0 , 2, "2 Cr. Start, 1 Continue" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x03, "Easy" }, - {0x12, 0x01, 0x03, 0x02, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Player Controls" }, - {0x12, 0x01, 0x04, 0x04, "2 Joysticks" }, - {0x12, 0x01, 0x04, 0x00, "1 Joystick" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x18, 0x00, "4" }, - {0x12, 0x01, 0x18, 0x08, "3" }, - {0x12, 0x01, 0x18, 0x10, "2" }, - {0x12, 0x01, 0x18, 0x18, "1" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x40, 0x40, "Upright" }, - {0x12, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Thoop) - -static void oki_bankswitch(INT32 data) -{ - if (nOkiBank != (data & 0x0f)) { - nOkiBank = data & 0x0f; - memcpy (DrvSndROM + 0x30000, DrvSndROM + 0x40000 + (data & 0x0f) * 0x10000, 0x10000); - } -} - -static void palette_write(INT32 offset) -{ - offset = offset & 0x7fe; - - UINT16 p = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + offset))); - - INT32 r = (p >> 0) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -static void __fastcall main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffc000) == 0x100000) { - *((UINT16*)(DrvVidRAM + (address & 0x3ffe))) = gaelco_decrypt((address & 0x3ffe)/2, data, gaelco_encryption_param1, 0x4228); - return; - } - - switch (address) - { - case 0x108000: - case 0x108001: - case 0x108002: - case 0x108003: - case 0x108004: - case 0x108005: - case 0x108006: - case 0x108007: - *((UINT16*)(DrvVidRegs + (address & 0x06))) = BURN_ENDIAN_SWAP_INT16(data); - return; - - case 0x10800c: - case 0x10800d: - // watchdog - return; - - case 0x70000c: - case 0x70000d: - oki_bankswitch(data); - return; - - case 0x70000e: - case 0x70000f: - MSM6295Command(0, data); - return; - } -} - -static void __fastcall main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffc000) == 0x100000) { - return; // encrypted ram write - } - - switch (address) - { - case 0x108000: - case 0x108001: - case 0x108002: - case 0x108003: - case 0x108004: - case 0x108005: - case 0x108006: - case 0x108007: - //DrvVidRegs[(address & 0x07)^1] = data; - return; - - case 0x10800c: - case 0x10800d: - // watchdog - return; - - case 0x70000c: - case 0x70000d: - oki_bankswitch(data); - return; - - case 0x70000e: - case 0x70000f: - if (has_sound_cpu) { - *soundlatch = data; - M6809SetIRQLine(1, CPU_IRQSTATUS_AUTO); - } else { - MSM6295Command(0, data); - } - return; - } -} - -static UINT16 __fastcall main_read_word(UINT32 address) -{ - switch (address) - { - case 0x700000: - case 0x700001: - return DrvDips[1]; - - case 0x700002: - case 0x700003: - return DrvDips[0]; - - case 0x700004: - case 0x700005: - return DrvInputs[0]; - - case 0x700006: - case 0x700007: - return DrvInputs[1]; - - case 0x700008: - case 0x700009: - return DrvInputs[2]; - - case 0x70000e: - case 0x70000f: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static UINT8 __fastcall main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x700000: - case 0x700001: - return DrvDips[1]; - - case 0x700002: - case 0x700003: - return DrvDips[0]; - - case 0x700004: - case 0x700005: - return DrvInputs[0]; - - case 0x700006: - case 0x700007: - return DrvInputs[1]; - - case 0x700008: - case 0x700009: - return DrvInputs[2]; - - case 0x70000e: - case 0x70000f: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static void __fastcall palette_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff800) == 0x200000) { - *((UINT16 *)(DrvPalRAM + (address & 0x7fe))) = BURN_ENDIAN_SWAP_INT16(data); - palette_write(address); - return; - } -} - -static void __fastcall palette_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff800) == 0x200000) { - DrvPalRAM[(address & 0x7ff) ^ 1] = data; - palette_write(address); - return; - } -} - -static void sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0800: - case 0x0801: - MSM6295Command(0, data); - return; - - case 0x0a00: - case 0x0a01: - BurnYM3812Write(0, address & 1, data); - return; - } -} - -static UINT8 sound_read(UINT16 address) -{ - switch (address) - { - case 0x0800: - case 0x0801: - return MSM6295ReadStatus(0); - - case 0x0a00: - case 0x0a01: - return BurnYM3812Read(0, address & 1); - - case 0x0b00: - return *soundlatch; - } - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)nM6809CyclesTotal * nSoundRate / 2216750; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - M6809Open(0); - M6809Reset(); - M6809Close(); - - BurnYM3812Reset(); - MSM6295Reset(0); - - memcpy (DrvSndROM, DrvSndROM + 0x040000, 0x030000); - - nOkiBank = -1; - oki_bankswitch(3); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - Drv6809ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x140000; - - AllRam = Next; - - DrvPalRAM = Next; Next += 0x000800; - Drv68KRAM = Next; Next += 0x010000; - DrvVidRAM = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x001000; - - DrvVidRegs = Next; Next += 0x000008; - - Drv6809RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x0000000, 0x0800000, 0x1000000, 0x1800000 }; - INT32 Plane1[4] = { 0x0400000, 0x0c00000, 0x1400000, 0x1c00000 }; - INT32 XOffs[16] = { 0,1,2,3,4,5,6,7, 16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7 }; - INT32 YOffs[16] = { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8, 8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x400000); - - GfxDecode(0x10000, 4, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - GfxDecode(0x04000, 4, 16, 16, Plane1, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static tilemap_callback( screen0 ) -{ - UINT16 *ram = (UINT16*)(DrvVidRAM + 0x0000); - - INT32 attr0 = BURN_ENDIAN_SWAP_INT16(ram[offs * 2 + 0]); - INT32 attr1 = BURN_ENDIAN_SWAP_INT16(ram[offs * 2 + 1]); - - INT32 flags = TILE_FLIPYX(attr0 & 0x0003) | TILE_GROUP((attr1 >> 6) & 3); - - TILE_SET_INFO(1, (attr0 & 0xfffc) >> 2, (attr1 & 0x003f), flags); -} - -static tilemap_callback( screen1 ) -{ - UINT16 *ram = (UINT16*)(DrvVidRAM + 0x1000); - - INT32 attr0 = BURN_ENDIAN_SWAP_INT16(ram[offs * 2 + 0]); - INT32 attr1 = BURN_ENDIAN_SWAP_INT16(ram[offs * 2 + 1]); - - INT32 flags = TILE_FLIPYX(attr0 & 0x0003) | TILE_GROUP((attr1 >> 6) & 3); - - TILE_SET_INFO(1, (attr0 & 0xfffc) >> 2, (attr1 & 0x003f), flags); -} - -static INT32 DrvInit(INT32 (*pRomLoadCallback)(), INT32 encrypted_ram, INT32 sound_cpu) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pRomLoadCallback) { - if (pRomLoadCallback()) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0x100000, 0x103fff, encrypted_ram ? MAP_ROM : MAP_RAM); - SekMapMemory(DrvPalRAM, 0x200000, 0x2007ff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x440000, 0x440fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, main_write_word); - SekSetWriteByteHandler(0, main_write_byte); - SekSetReadWordHandler(0, main_read_word); - SekSetReadByteHandler(0, main_read_byte); - - SekMapHandler(1, 0x200000, 0x2007FF, MAP_WRITE); - SekSetWriteWordHandler(1, palette_write_word); - SekSetWriteByteHandler(1, palette_write_byte); - SekClose(); - - has_sound_cpu = sound_cpu ? 1 : 0; - - // big karnak - { - M6809Init(1); - M6809Open(0); - M6809MapMemory(Drv6809RAM, 0x0000, 0x07ff, MAP_RAM); - M6809MapMemory(Drv6809ROM + 0x0c00, 0x0c00, 0xffff, MAP_ROM); - M6809SetReadHandler(sound_read); - M6809SetWriteHandler(sound_write); - M6809Close(); - - BurnYM3812Init(1, 3580000, NULL, &DrvSynchroniseStream, 0); - BurnTimerAttachM6809YM3812(2216750); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - } - - MSM6295Init(0, 1056000 / 132, has_sound_cpu ? 1 : 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - gaelco_encryption_param1 = encrypted_ram; - - GenericTilesInit(); - - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, screen0_map_callback, 16, 16, 32, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, screen1_map_callback, 16, 16, 32, 32); - GenericTilemapSetGfx(1, DrvGfxROM1, 4, 16, 16, 0x400000, 0, 0x3f); - - DrvDoReset(); - - return 0; -} - -static void DrvGfxReorder() -{ - for (INT32 i = 0; i < 0x400000; i++) { - DrvGfxROM0[(i & 0xf3ffff) | ((i & 0x80000) >> 1) | ((i & 0x40000) << 1)] = DrvGfxROM1[i]; - } -} - -static INT32 ThoopRomLoad() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - - DrvGfxReorder(); - - if (BurnLoadRom(DrvSndROM + 0x040000, 6, 1)) return 1; - - return 0; -} - -static INT32 SquashRomLoad() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x180000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x280000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x300000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x380000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x040000, 6, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x0c0000, 6, 1)) return 1; - - return 0; -} - -static INT32 BiomtoyRomLoad() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x280000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x380000, 8, 1)) return 1; - - DrvGfxReorder(); - - if (BurnLoadRom(DrvSndROM + 0x040000, 10, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x0c0000, 11, 1)) return 1; - - return 0; -} - -static INT32 BigkarnkRomLoad() -{ - if (BurnLoadRom(Drv6809ROM + 0x000000, 7, 1)) return 1; - - return SquashRomLoad(); -} - -static INT32 ThoopInit() -{ - return DrvInit(ThoopRomLoad, 0x0e, 0); -} - -static INT32 SquashInit() -{ - return DrvInit(SquashRomLoad, 0x0f, 0); -} - -static INT32 BiomtoyInit() -{ - return DrvInit(BiomtoyRomLoad, 0 /* Ram is not encrypted! */, 0); -} - -static INT32 ManiacspInit() -{ - return DrvInit(SquashRomLoad, 0 /* Ram is not encrypted! */, 0); -} - -static INT32 BigkarnkInit() -{ - return DrvInit(BigkarnkRomLoad, 0 /* Ram is not encrypted! */, 1 /* M6809 Sound CPU */); -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM3812Exit(); - MSM6295Exit(0); - MSM6295ROM = NULL; - - SekExit(); - M6809Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - UINT16 *spriteram = (UINT16*)DrvSprRAM; - - for (INT32 i = 0x800 - 4 - 1; i >= 3; i -= 4) - { - INT32 sx = BURN_ENDIAN_SWAP_INT16(spriteram[i + 2]) & 0x01ff; - INT32 sy = (240 - (BURN_ENDIAN_SWAP_INT16(spriteram[i]) & 0x00ff)) & 0x00ff; - INT32 number = BURN_ENDIAN_SWAP_INT16(spriteram[i + 3]); - INT32 color = (BURN_ENDIAN_SWAP_INT16(spriteram[i + 2]) & 0x7e00) >> 9; - INT32 attr = (BURN_ENDIAN_SWAP_INT16(spriteram[i]) & 0xfe00) >> 9; - INT32 priority = (BURN_ENDIAN_SWAP_INT16(spriteram[i]) & 0x3000) >> 12; - - INT32 xflip = attr & 0x20; - INT32 yflip = attr & 0x40; - INT32 spr_size, pri_mask; - - if (color >= 0x38) priority = 4; - - switch (priority) - { - case 0: pri_mask = 0xff00; break; - case 1: pri_mask = 0xfff0; break; - case 2: pri_mask = 0xfffc; break; - case 3: pri_mask = 0xfffe; break; - default: - case 4: pri_mask = 0; break; - } - - if (attr & 0x04) - spr_size = 1; - else - { - spr_size = 2; - number &= ~3; - } - - for (INT32 y = 0; y < spr_size; y++) - { - for (INT32 x = 0; x < spr_size; x++) - { - INT32 ex = xflip ? (spr_size - 1 - x) : x; - INT32 ey = yflip ? (spr_size - 1 - y) : y; - - RenderPrioSprite(pTransDraw, DrvGfxROM0, number + (ex * 2) + ey, (color * 16), 0, sx-0x0f+x*8, sy+y*8-16, xflip, yflip, 8, 8, pri_mask); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - UINT16 *reg = (UINT16*)DrvVidRegs; - - GenericTilemapSetScrollY(0, (BURN_ENDIAN_SWAP_INT16(reg[0]) + 16)); - GenericTilemapSetScrollX(0, (BURN_ENDIAN_SWAP_INT16(reg[1]) + 4)); - GenericTilemapSetScrollY(1, (BURN_ENDIAN_SWAP_INT16(reg[2]) + 16)); - GenericTilemapSetScrollX(1, (BURN_ENDIAN_SWAP_INT16(reg[3]) + 0)); - - GenericTilemapSetTransparent(0, 0); - GenericTilemapSetTransparent(1, 0); - -#if 1 - GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(3) | 0); - GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(3) | 0); - - GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(2) | 1); - GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(2) | 1); - - GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(1) | 2); - GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(1) | 2); - - GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(0) | 4); - GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(0) | 4); -#endif - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void draw_layer(INT32 layer, INT32 mask, INT32 category, INT32 priority) -{ - GenericTilemapSetTransMask(layer, mask); - - GenericTilemapDraw(layer, pTransDraw, priority | TMAP_SET_GROUP(category)); -} - -static INT32 BigkarnkDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - UINT16 *reg = (UINT16*)DrvVidRegs; - - GenericTilemapSetScrollY(0, (BURN_ENDIAN_SWAP_INT16(reg[0]) + 16)); - GenericTilemapSetScrollX(0, (BURN_ENDIAN_SWAP_INT16(reg[1]) + 4)); - GenericTilemapSetScrollY(1, (BURN_ENDIAN_SWAP_INT16(reg[2]) + 16)); - GenericTilemapSetScrollX(1, (BURN_ENDIAN_SWAP_INT16(reg[3]) + 0)); - - draw_layer(1, 0x00ff, 3, 0); - draw_layer(0, 0x00ff, 3, 0); - draw_layer(1, 0xff01, 3, 1); - draw_layer(0, 0xff01, 3, 1); - draw_layer(1, 0x00ff, 2, 1); - draw_layer(0, 0x00ff, 2, 1); - draw_layer(1, 0xff01, 2, 2); - draw_layer(0, 0xff01, 2, 2); - draw_layer(1, 0x00ff, 1, 2); - draw_layer(0, 0x00ff, 1, 2); - draw_layer(1, 0xff01, 1, 4); - draw_layer(0, 0xff01, 1, 4); - draw_layer(1, 0x00ff, 0, 4); - draw_layer(0, 0x00ff, 0, 4); - draw_layer(1, 0xff01, 0, 8); - draw_layer(0, 0xff01, 0, 8); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - SekOpen(0); - SekRun(12000000 / 60); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 BigkarnkFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - M6809NewFrame(); - - { - memset (DrvInputs, 0xff, 3 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[2] = (DrvInputs[2] & ~0x02) | (DrvDips[2] & 0x02); - } - - SekOpen(0); - M6809Open(0); - - SekRun(10000000 / 60); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - BurnTimerEndFrameYM3812(2216750 / 60); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - M6809Close(); - - if (pBurnDraw) { - BigkarnkDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - M6809Scan(nAction); - - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - SCAN_VAR(nOkiBank); - } - - if (nAction & ACB_WRITE) { - INT32 bank = nOkiBank; - nOkiBank = -1; - oki_bankswitch(bank); - DrvRecalc = 1; - } - - return 0; -} - - -// Big Karnak - -static struct BurnRomInfo bigkarnkRomDesc[] = { - { "d16", 0x40000, 0x44fb9c73, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "d19", 0x40000, 0xff79dfdd, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "h5", 0x80000, 0x20e239ff, 2 | BRF_GRA }, // 2 Tiles and Sprites - { "h10", 0x80000, 0xab442855, 2 | BRF_GRA }, // 3 - { "h8", 0x80000, 0x83dce5a3, 2 | BRF_GRA }, // 4 - { "h6", 0x80000, 0x24e84b24, 2 | BRF_GRA }, // 5 - - { "d1", 0x40000, 0x26444ad1, 3 | BRF_SND }, // 6 M6295 Samples - - { "d5", 0x10000, 0x3b73b9c5, 4 | BRF_PRG | BRF_ESS }, // 7 M6809 Code -}; - -STD_ROM_PICK(bigkarnk) -STD_ROM_FN(bigkarnk) - -struct BurnDriver BurnDrvBigkarnk = { - "bigkarnk", NULL, NULL, NULL, "1991", - "Big Karnak\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM | GBF_SCRFIGHT, 0, - NULL, bigkarnkRomInfo, bigkarnkRomName, NULL, NULL, BigkarnkInputInfo, BigkarnkDIPInfo, - BigkarnkInit, DrvExit, BigkarnkFrame, BigkarnkDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Maniac Square (prototype) - -static struct BurnRomInfo maniacspRomDesc[] = { - { "d18", 0x20000, 0x740ecab2, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "d16", 0x20000, 0xc6c42729, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "f3", 0x40000, 0xe7f6582b, 2 | BRF_GRA }, // 2 Tiles and Sprites - { "f2", 0x40000, 0xca43a5ae, 2 | BRF_GRA }, // 3 - { "f1", 0x40000, 0xfca112e8, 2 | BRF_GRA }, // 4 - { "f0", 0x40000, 0x6e829ee8, 2 | BRF_GRA }, // 5 - - { "c1", 0x80000, 0x2557f2d6, 3 | BRF_SND }, // 6 M6295 Samples -}; - -STD_ROM_PICK(maniacsp) -STD_ROM_FN(maniacsp) - -struct BurnDriver BurnDrvManiacsp = { - "maniacsp", "maniacsq", NULL, NULL, "1996", - "Maniac Square (prototype)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, maniacspRomInfo, maniacspRomName, NULL, NULL, DrvInputInfo, ManiacsqDIPInfo, - ManiacspInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Biomechanical Toy (Ver. 1.0.1885) - -static struct BurnRomInfo biomtoyRomDesc[] = { - { "d18", 0x80000, 0x4569ce64, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "d16", 0x80000, 0x739449bd, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "h6", 0x80000, 0x9416a729, 2 | BRF_GRA }, // 2 Tiles and Sprites - { "j6", 0x80000, 0xe923728b, 2 | BRF_GRA }, // 3 - { "h7", 0x80000, 0x9c984d7b, 2 | BRF_GRA }, // 4 - { "j7", 0x80000, 0x0e18fac2, 2 | BRF_GRA }, // 5 - { "h9", 0x80000, 0x8c1f6718, 2 | BRF_GRA }, // 6 - { "j9", 0x80000, 0x1c93f050, 2 | BRF_GRA }, // 7 - { "h10", 0x80000, 0xaca1702b, 2 | BRF_GRA }, // 8 - { "j10", 0x80000, 0x8e3e96cc, 2 | BRF_GRA }, // 9 - - { "c1", 0x80000, 0x0f02de7e, 3 | BRF_SND }, // 10 M6295 Samples - { "c3", 0x80000, 0x914e4bbc, 3 | BRF_SND }, // 11 -}; - -STD_ROM_PICK(biomtoy) -STD_ROM_FN(biomtoy) - -struct BurnDriver BurnDrvBiomtoy = { - "biomtoy", NULL, NULL, NULL, "1995", - "Biomechanical Toy (Ver. 1.0.1885)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, biomtoyRomInfo, biomtoyRomName, NULL, NULL, DrvInputInfo, BiomtoyDIPInfo, - BiomtoyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Biomechanical Toy (Ver. 1.0.1884) - -static struct BurnRomInfo biomtoyaRomDesc[] = { - { "biomtoya.d18", 0x80000, 0x39b6cdbd, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "biomtoya.d16", 0x80000, 0xab340671, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "h6", 0x80000, 0x9416a729, 2 | BRF_GRA }, // 2 Tiles and Sprites - { "j6", 0x80000, 0xe923728b, 2 | BRF_GRA }, // 3 - { "h7", 0x80000, 0x9c984d7b, 2 | BRF_GRA }, // 4 - { "j7", 0x80000, 0x0e18fac2, 2 | BRF_GRA }, // 5 - { "h9", 0x80000, 0x8c1f6718, 2 | BRF_GRA }, // 6 - { "j9", 0x80000, 0x1c93f050, 2 | BRF_GRA }, // 7 - { "h10", 0x80000, 0xaca1702b, 2 | BRF_GRA }, // 8 - { "j10", 0x80000, 0x8e3e96cc, 2 | BRF_GRA }, // 9 - - { "c1", 0x80000, 0xedf77532, 3 | BRF_SND }, // 10 M6295 Samples - { "c3", 0x80000, 0xc3aea660, 3 | BRF_SND }, // 11 -}; - -STD_ROM_PICK(biomtoya) -STD_ROM_FN(biomtoya) - -struct BurnDriver BurnDrvBiomtoya = { - "biomtoya", "biomtoy", NULL, NULL, "1995", - "Biomechanical Toy (Ver. 1.0.1884)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, biomtoyaRomInfo, biomtoyaRomName, NULL, NULL, DrvInputInfo, BiomtoyDIPInfo, - BiomtoyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Squash (Ver. 1.0) - -static struct BurnRomInfo squashRomDesc[] = { - { "squash.d18", 0x20000, 0xce7aae96, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "squash.d16", 0x20000, 0x8ffaedd7, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "squash.c12", 0x80000, 0x5c440645, 2 | BRF_GRA }, // 2 Tiles and Sprites - { "squash.c11", 0x80000, 0x9e19694d, 2 | BRF_GRA }, // 3 - { "squash.c10", 0x80000, 0x892a035c, 2 | BRF_GRA }, // 4 - { "squash.c09", 0x80000, 0x0bb91c69, 2 | BRF_GRA }, // 5 - - { "squash.d01", 0x80000, 0xa1b9651b, 3 | BRF_SND }, // 6 M6295 Samples -}; - -STD_ROM_PICK(squash) -STD_ROM_FN(squash) - -struct BurnDriver BurnDrvSquash = { - "squash", NULL, NULL, NULL, "1992", - "Squash (Ver. 1.0)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, squashRomInfo, squashRomName, NULL, NULL, DrvInputInfo, SquashDIPInfo, - SquashInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; - - -// Thunder Hoop (Ver. 1) - -static struct BurnRomInfo thoopRomDesc[] = { - { "th18dea1.040", 0x080000, 0x59bad625, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "th161eb4.020", 0x040000, 0x6add61ed, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "c09", 0x100000, 0x06f0edbf, 2 | BRF_GRA }, // 2 Tiles and Sprites - { "c10", 0x100000, 0x2d227085, 2 | BRF_GRA }, // 3 - { "c11", 0x100000, 0x7403ef7e, 2 | BRF_GRA }, // 4 - { "c12", 0x100000, 0x29a5ca36, 2 | BRF_GRA }, // 5 - - { "sound", 0x100000, 0x99f80961, 3 | BRF_SND }, // 6 M6295 Samples -}; - -STD_ROM_PICK(thoop) -STD_ROM_FN(thoop) - -struct BurnDriver BurnDrvThoop = { - "thoop", NULL, NULL, NULL, "1992", - "Thunder Hoop (Ver. 1)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, thoopRomInfo, thoopRomName, NULL, NULL, DrvInputInfo, ThoopDIPInfo, - ThoopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_gaelco2.cpp b/jan/src/burn/drv/pst90s/d_gaelco2.cpp deleted file mode 100644 index 16c9cc08f..000000000 --- a/jan/src/burn/drv/pst90s/d_gaelco2.cpp +++ /dev/null @@ -1,1772 +0,0 @@ -// FB Alpha Gaelco system 2 driver module -// Based on MAME driver by Manuel Abadia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "eeprom.h" -#include "gaelco.h" -#include "burn_gun.h" - -// Todo/tofix: -// EEPROM save doesn't seem to work in Snowboard - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPalRAM; -static UINT8 *Drv68KRAM; -static UINT8 *Drv68KRAM2; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 *DrvVidRegs; - -static INT32 gun_interrupt; -static UINT32 snowboar_latch; - -static INT32 game_select = 0; -static void (*pIRQCallback)(INT32 line); -static UINT8 m_dual_monitor = 0; -static UINT32 gfxmask = ~0; -static INT32 nCPUClockSpeed = 0; -static INT32 global_y_offset = -16; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT16 DrvInputs[4]; - -// Lightgun stuff -static INT32 LethalGun0 = 0; -static INT32 LethalGun1 = 0; -static INT32 LethalGun2 = 0; -static INT32 LethalGun3 = 0; - -static struct BurnInputInfo AlighuntInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy3 + 5, "service" }, - - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Alighunt) - -static struct BurnInputInfo SnowboarInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 4, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service Mode", BIT_DIGITAL, DrvJoy3 + 2, "service"}, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service"}, -// {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Snowboar) - -static struct BurnInputInfo ManiacsqInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy3 + 5, "service" }, - - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Maniacsq) - -static struct BurnInputInfo TouchgoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 9, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy3 + 10, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 7, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 3, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 2, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy3 + 11, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 7, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 0, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 1, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 3, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 2, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 8, "service" }, - {"Service1", BIT_DIGITAL, DrvJoy4 + 10, "service" }, - {"Service2", BIT_DIGITAL, DrvJoy4 + 9, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Touchgo) - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo BangInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 4, "p1 start" }, - {"P1 Button", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - A("P1 Gun X", BIT_ANALOG_REL, &LethalGun0, "mouse x-axis" ), - A("P1 Gun Y", BIT_ANALOG_REL, &LethalGun1, "mouse y-axis" ), - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 5, "p2 start" }, - {"P2 Button", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - A("P2 Gun X", BIT_ANALOG_REL, &LethalGun2, "p2 x-axis" ), - A("P2 Gun Y", BIT_ANALOG_REL, &LethalGun3, "p2 y-axis" ), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Bang) -#undef A - -static struct BurnDIPInfo TouchgoDIPList[]= -{ - {0x28, 0xff, 0xff, 0xff, NULL }, - {0x29, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x28, 0x01, 0x03, 0x02, "Easy" }, - {0x28, 0x01, 0x03, 0x03, "Normal" }, - {0x28, 0x01, 0x03, 0x01, "Hard" }, - {0x28, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Credit configuration" }, - {0x28, 0x01, 0x04, 0x04, "1 Credit Start/1 Credit Continue" }, - {0x28, 0x01, 0x04, 0x00, "2 Credits Start/1 Credit Continue" }, - - {0 , 0xfe, 0 , 2, "Coin Slot" }, - {0x28, 0x01, 0x08, 0x08, "Independent" }, - {0x28, 0x01, 0x08, 0x00, "Common" }, - - {0 , 0xfe, 0 , 3, "Monitor Type" }, - {0x28, 0x01, 0x30, 0x00, "Double monitor, 4 players" }, - {0x28, 0x01, 0x30, 0x20, "Single monitor, 4 players" }, - {0x28, 0x01, 0x30, 0x30, "Single monitor, 2 players" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x28, 0x01, 0x40, 0x00, "Off" }, - {0x28, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x28, 0x01, 0x80, 0x80, "Off" }, - {0x28, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x29, 0x01, 0x0f, 0x00, "Disabled/Free Play (if Coin B)"}, - {0x29, 0x01, 0x0f, 0x03, "4 Coins 1 Credits" }, - {0x29, 0x01, 0x0f, 0x06, "3 Coins 1 Credits" }, - {0x29, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x29, 0x01, 0x0f, 0x05, "3 Coins 2 Credits" }, - {0x29, 0x01, 0x0f, 0x02, "4 Coins 3 Credits" }, - {0x29, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x29, 0x01, 0x0f, 0x01, "4 Coins 5 Credits" }, - {0x29, 0x01, 0x0f, 0x04, "3 Coins 4 Credits" }, - {0x29, 0x01, 0x0f, 0x08, "2 Coins 3 Credits" }, - {0x29, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x29, 0x01, 0x0f, 0x07, "2 Coins 5 Credits" }, - {0x29, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x29, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x29, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x29, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x29, 0x01, 0xf0, 0x00, "Disabled/Free Play (if Coin A)"}, - {0x29, 0x01, 0xf0, 0x30, "4 Coins 1 Credits" }, - {0x29, 0x01, 0xf0, 0x60, "3 Coins 1 Credits" }, - {0x29, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x29, 0x01, 0xf0, 0x50, "3 Coins 2 Credits" }, - {0x29, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, - {0x29, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x29, 0x01, 0xf0, 0x10, "4 Coins 5 Credits" }, - {0x29, 0x01, 0xf0, 0x40, "3 Coins 4 Credits" }, - {0x29, 0x01, 0xf0, 0x80, "2 Coins 3 Credits" }, - {0x29, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x29, 0x01, 0xf0, 0x70, "2 Coins 5 Credits" }, - {0x29, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x29, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x29, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x29, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, -}; - -STDDIPINFO(Touchgo) - -static struct BurnDIPInfo AlighuntDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 12, "Coinage" }, - {0x15, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0f, 0x05, "3 Coins 2 Credit" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coins 6 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "Free Plan if Coin B too" }, - - {0 , 0xfe, 0 , 12, "Coinage" }, - {0x15, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xf0, 0x50, "3 Coins 2 Credit" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coins 6 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Plan if Coin A too" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Normal" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x0c, 0x08, "1" }, - {0x16, 0x01, 0x0c, 0x0c, "2" }, - {0x16, 0x01, 0x0c, 0x04, "3" }, - {0x16, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Sound Type", }, - {0x16, 0x01, 0x10, 0x00, "Mono" }, - {0x16, 0x01, 0x10, 0x10, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x20, 0x00, "Off" }, - {0x16, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Joystick" }, - {0x16, 0x01, 0x40, 0x00, "Analog (Unemulated)" }, - {0x16, 0x01, 0x40, 0x40, "Standard" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Alighunt) - -static struct BurnDIPInfo ManiacsqDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 12, "Coinage" }, - {0x11, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x05, "3 Coins 2 Credit" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coins 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coins 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0a, "1 Coins 6 Credits" }, - {0x11, 0x01, 0x0f, 0x00, "Free Plan if Coin B too" }, - - {0 , 0xfe, 0 , 12, "Coinage" }, - {0x11, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, - {0x11, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xf0, 0x50, "3 Coins 2 Credit" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xf0, 0x60, "2 Coin 3 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coins 4 Credits" }, - {0x11, 0x01, 0xf0, 0xb0, "1 Coins 5 Credits" }, - {0x11, 0x01, 0xf0, 0xa0, "1 Coins 6 Credits" }, - {0x11, 0x01, 0xf0, 0x00, "Free Plan if Coin A too" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "1P Continue" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Maniacsq) - -// Snowboard protection sim. engineered by Samuel Neves & Peter Wilhelmsen - -static UINT16 get_lo(UINT32 x) -{ - return ((x & 0x00000010) << 1) | - ((x & 0x00000800) << 3) | - ((x & 0x40000000) >> 27) | - ((x & 0x00000005) << 6) | - ((x & 0x00000008) << 8) | - ((x & 0x00000040) << 9) | - ((x & 0x04000000) >> 16) | - ((x & 0x00008000) >> 14) | - ((x & 0x00002000) >> 11) | - ((x & 0x00020000) >> 10) | - ((x & 0x00100000) >> 8) | - ((x & 0x00044000) >> 5) | - ((x & 0x00800000) >> 23) | - ((x & 0x00000020) >> 1); -} - -static UINT16 get_hi(UINT32 x) -{ - return ((x & 0x00001400) >> 0) | - ((x & 0x10000000) >> 26) | - ((x & 0x02000000) >> 24) | - ((x & 0x08000000) >> 21) | - ((x & 0x00000002) << 12) | - ((x & 0x01000000) >> 19) | - ((x & 0x20000000) >> 18) | - ((x & 0x80000000) >> 16) | - ((x & 0x00200000) >> 13) | - ((x & 0x00010000) >> 12) | - ((x & 0x00080000) >> 10) | - ((x & 0x00000200) >> 9) | - ((x & 0x00400000) >> 8) | - ((x & 0x00000080) >> 4) | - ((x & 0x00000100) >> 1); -} - -static UINT16 get_out(UINT16 x) -{ - return ((x & 0xc840) << 0) | - ((x & 0x0080) << 2) | - ((x & 0x0004) << 3) | - ((x & 0x0008) << 5) | - ((x & 0x0010) << 8) | - ((x & 0x0002) << 9) | - ((x & 0x0001) << 13) | - ((x & 0x0200) >> 9) | - ((x & 0x1400) >> 8) | - ((x & 0x0100) >> 7) | - ((x & 0x2000) >> 6) | - ((x & 0x0020) >> 2); -} - -static void __fastcall gaelco2_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x218004: - case 0x218005: - case 0x218006: - case 0x218007: - case 0x218008: - case 0x218009: { - UINT8 *r = (UINT8*)DrvVidRegs; - r[(address - 0x218004) ^ 1] = data; - } - return; - - case 0x300008: - case 0x300009: - EEPROMWriteBit(data & 1); - return; - - case 0x30000a: - case 0x30000b: - EEPROMSetClockLine(data & 0x01); - return; - - case 0x30000c: - case 0x30000d: - EEPROMSetCSLine(data & 0x01); - return; - - case 0x500000: - case 0x500001: - // coin counter - return; - - case 0x30004a: - case 0x30004b: - return; // NOP - maniacsq - - case 0x310000: - case 0x310001: - gun_interrupt = 1; - return; - - case 0x500006: - case 0x500007: - return; // NOP - alligator - } -} - -static void __fastcall gaelco2_main_write_word(UINT32 address, UINT16 data) -{ - if ((game_select == 2 || game_select == 3) && (address & 0xff0000) == 0x310000) { - snowboar_latch = (snowboar_latch << 16) | data; - return; - } - - switch (address) - { - case 0x218004: - case 0x218006: - case 0x218008: - DrvVidRegs[(address - 0x218004) / 2] = data; - return; - - case 0x500000: - // coin counter - return; - - case 0x300008: - EEPROMWriteBit(data & 1); - return; - - case 0x30000a: - EEPROMSetClockLine(data & 0x01); - return; - - case 0x30000c: - EEPROMSetCSLine(data & 0x01); - return; - - case 0x310000: - gun_interrupt = 1; - return; - - case 0x30004a: - return; // NOP - maniacsq - - case 0x500006: - return; // NOP - alligator - } -} - -static UINT16 bang_analog_read(INT32 port) -{ - port = (port / 2) & 3; - - INT32 analog_value = 0x80; // placeholder until analog inputs hooked up! - - const INT32 adjust[6] = { 320, 240, 1, -4, 0, 0}; - - switch (port & 3) - { - case 0: analog_value = BurnGunReturnX(0);// input 0, x - break; - case 1: analog_value = BurnGunReturnX(1);// input 1, x - break; - case 2: analog_value = BurnGunReturnY(0);// input 0, y - break; - case 3: analog_value = BurnGunReturnY(1);// input 1, y - break; - } - - return ((analog_value * adjust[port]) / 256) + adjust[(port)+2]; -} - -static UINT8 __fastcall gaelco2_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x218004: - case 0x218005: - case 0x218006: - case 0x218007: - case 0x218008: - case 0x218009: { - UINT8 *r = (UINT8*)DrvVidRegs; - return r[(address - 0x218004) ^ 1]; - } - - case 0x300000: - case 0x300001: - return DrvInputs[0] >> ((~address & 1) * 8); - - case 0x300002: - case 0x300003: - case 0x300010: - case 0x300011: - return DrvInputs[1] >> ((~address & 1) * 8); - - case 0x300004: - case 0x300005: - return DrvInputs[2] >> ((~address & 1) * 8); - - case 0x300006: - case 0x300007: - return DrvInputs[3] >> ((~address & 1) * 8); - - case 0x300020: - case 0x300021: - case 0x320000: - case 0x320001: - return ((DrvInputs[2] & ~0x40) | (EEPROMRead() ? 0x40 : 0)) >> ((~address & 1) * 8); - - case 0x310000: - case 0x310001: - case 0x310002: - case 0x310003: - case 0x310004: - case 0x310005: - case 0x310006: - case 0x310007: - return bang_analog_read(address) >> ((~address & 1) * 8); - } - - return 0; -} - -static UINT16 __fastcall gaelco2_main_read_word(UINT32 address) -{ - if ((game_select == 2 || game_select == 3) && (address & 0xff0000) == 0x310000) { - UINT16 ret = get_out(((get_lo(snowboar_latch) ^ 0x0010) - (get_hi(snowboar_latch) ^ 0x0024)) ^ 0x5496); - return (ret >> 8) | (ret << 8); - } - - switch (address) - { - case 0x218004: - case 0x218006: - case 0x218008: - return DrvVidRegs[(address - 0x218004) / 2]; - - case 0x300000: - return DrvInputs[0]; - - case 0x300002: - case 0x300010: - return DrvInputs[1]; - - case 0x300004: - return DrvInputs[0]; - - case 0x300006: - return DrvInputs[1]; - - case 0x320000: - case 0x300020: - return (DrvInputs[2] & ~0x40) | (EEPROMRead() ? 0x40 : 0); - - case 0x310000: - case 0x310002: - case 0x310004: - case 0x310006: - return bang_analog_read(address); - } - - return 0; -} - -static void __fastcall gaelco2_sound_write_byte(UINT32 address, UINT8 data) -{ - DrvSprRAM[(address & 0xffff) ^ 1] = data; - - if (address >= 0x202890 && address <= 0x2028ff) { - // not used. - return; - } -} - -static void __fastcall gaelco2_sound_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvSprRAM + (address & 0xfffe))) = data; - - if (address >= 0x202890 && address <= 0x2028ff) { - gaelcosnd_w((address - 0x202890) >> 1, data); - return; - } -} - -static UINT8 __fastcall gaelco2_sound_read_byte(UINT32 address) -{ - if (address >= 0x202890 && address <= 0x2028ff) { - // not used. - } - return DrvSprRAM[(address & 0xffff) ^ 1]; -} - -static UINT16 __fastcall gaelco2_sound_read_word(UINT32 address) -{ - if (address >= 0x202890 && address <= 0x2028ff) { - return gaelcosnd_r((address - 0x202890) >> 1); - } - return *((UINT16*)(DrvSprRAM + (address & 0xfffe))); -} - -static void palette_update(INT32 offset) -{ - static const int pen_color_adjust[16] = { - 0, -8, -16, -24, -32, -40, -48, -56, 64, 56, 48, 40, 32, 24, 16, 8 - }; - - offset = (offset & 0x1ffe); - - UINT16 color = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (color >> 10) & 0x1f; - INT32 g = (color >> 5) & 0x1f; - INT32 b = (color >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r,g,b,0); - - if (offset >= 0x211fe0) return; - -#define ADJUST_COLOR(c) ((c < 0) ? 0 : ((c > 255) ? 255 : c)) - - for (INT32 i = 1; i < 16; i++) { - INT32 auxr = ADJUST_COLOR(r + pen_color_adjust[i]); - INT32 auxg = ADJUST_COLOR(g + pen_color_adjust[i]); - INT32 auxb = ADJUST_COLOR(b + pen_color_adjust[i]); - - DrvPalette[0x1000 + (offset/2) * i] = BurnHighCol(auxr,auxg,auxb,0); - } -} - -static void __fastcall gaelco2_palette_write_byte(UINT32 address, UINT8 data) -{ - DrvPalRAM[(address & 0x1fff) ^ 1] = data; - palette_update(address); -} - -static void __fastcall gaelco2_palette_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + (address & 0x1ffe))) = data; - palette_update(address); -} - -static void pIRQLine6Callback(INT32 line) -{ - if (line == 255) // ?? - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); -} - -static void pBangIRQLineCallback(INT32 line) -{ - line++; - - if (line == 256) { - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - gun_interrupt = 0; - } - - if ((line % 64) == 0 && gun_interrupt) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } -} - - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - HiscoreReset(); - - gaelcosnd_reset(); - - gun_interrupt = 0; - snowboar_latch = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x0100000; - - DrvGfxROM0 = Next; Next += 0x1400000; - DrvGfxROM = Next; Next += 0x2000000; - - DrvPalette = (UINT32*)Next; Next += 0x10000 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x0010000; - DrvSprBuf = Next; Next += 0x0010000; - DrvPalRAM = Next; Next += 0x0002000; - Drv68KRAM = Next; Next += 0x0020000; - Drv68KRAM2 = Next; Next += 0x0002000; - - DrvVidRegs = (UINT16*)Next; Next += 0x00003 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode(INT32 size) -{ - INT32 Planes[5] = { (size/5)*8*4, (size/5)*8*3, (size/5)*8*2, (size/5)*8*1, (size/5)*8*0 }; - INT32 XOffs[16] = { STEP8(0,1), STEP8(128,1) }; - INT32 YOffs[16] = { STEP16(0,8) }; - - GfxDecode(((size*8)/5)/(16*16), 5, 16, 16, Planes, XOffs, YOffs, 0x100, DrvGfxROM0, DrvGfxROM); - - gfxmask = (((size * 8) / 5) / (16 * 16)) - 1; -} - -static void gaelco2_split_gfx(UINT8 *src, UINT8 *dst, INT32 start, INT32 length, INT32 dest1, INT32 dest2) -{ - for (INT32 i = 0; i < length/2; i++){ - dst[dest1 + i] = src[start + i*2 + 0]; - dst[dest2 + i] = src[start + i*2 + 1]; - } -} - - -static const eeprom_interface gaelco2_eeprom_interface = -{ - 8, /* address bits */ - 16, /* data bits */ - "*110", /* read command */ - "*101", /* write command */ - "*111", /* erase command */ - "*10000xxxxxx", /* lock command */ - "*10011xxxxxx", /* unlock command */ - 0,// "*10001xxxxxx", /* write all */ - 0// "*10010xxxxxx", /* erase all */ -}; - -static INT32 DrvInit(INT32 game_selector) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - game_select = game_selector; - - switch (game_select) - { - case 0: // aligatorun - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x400000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x800000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0xc00000, 5, 1)) return 1; - - memset (DrvGfxROM0, 0, 0x1400000); - - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0000000, 0x0400000, 0x0000000, 0x0400000); - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0400000, 0x0400000, 0x0200000, 0x0600000); - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0800000, 0x0400000, 0x0800000, 0x0c00000); - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0c00000, 0x0400000, 0x0a00000, 0x0e00000); - - memset (DrvGfxROM, 0, 0x2000000); - - DrvGfxDecode(0x1400000); - - nCPUClockSpeed = 13000000; - pIRQCallback = pIRQLine6Callback; - - gaelcosnd_start(DrvGfxROM0, 0 * 0x0400000, 1 * 0x0400000, 2 * 0x0400000, 3 * 0x0400000); - } - break; - - case 1: // maniacsq - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x180000, 5, 1)) return 1; - - DrvGfxDecode(0x280000); - - nCPUClockSpeed = 13000000; - pIRQCallback = pIRQLine6Callback; - - gaelcosnd_start(DrvGfxROM0, 0 * 0x0080000, 1 * 0x0080000, 0, 0); - } - break; - - case 2: // snowboara - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x400000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x800000, 5, 1)) return 1; - - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0000000, 0x0400000, 0x0000000, 0x0400000); - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0400000, 0x0400000, 0x0200000, 0x0600000); - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0800000, 0x0400000, 0x0800000, 0x0c00000); - - if (BurnLoadRom(DrvGfxROM0 + 0x1000000, 2, 1)) return 1; - - DrvGfxDecode(0x1400000); - - nCPUClockSpeed = 15000000; - pIRQCallback = pIRQLine6Callback; - - gaelcosnd_start(DrvGfxROM0, 0 * 0x0400000, 1 * 0x0400000, 0, 0); - } - break; - - case 3: // snowboar - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0080000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0100000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0180000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0200000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0280000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0400000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0480000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0500000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0580000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0600000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0680000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0800000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0880000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0900000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0980000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c00000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c80000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0d00000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0d80000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1080000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1100000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1180000, 25, 1)) return 1; - - // no split needed for this set. - - DrvGfxDecode(0x1400000); - - nCPUClockSpeed = 15000000; - pIRQCallback = pIRQLine6Callback; - - gaelcosnd_start(DrvGfxROM0, 0 * 0x0400000, 1 * 0x0400000, 0, 0); - } - break; - - case 4: // touchgo - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x1000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0400000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0800000, 5, 1)) return 1; - - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0000000, 0x0400000, 0x0000000, 0x0400000); - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0400000, 0x0200000, 0x0200000, 0x0600000); - gaelco2_split_gfx(DrvGfxROM, DrvGfxROM0, 0x0800000, 0x0400000, 0x0800000, 0x0c00000); - - DrvGfxDecode(0x1400000); - - nCPUClockSpeed = 16000000; - pIRQCallback = pIRQLine6Callback; - - gaelcosnd_start(DrvGfxROM0, 0 * 0x0400000, 1 * 0x0400000, 0, 0); - } - break; - - case 6: // bang - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0080000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0100000, 4, 1)) return 1; - memset (DrvGfxROM0 + 0x180000, 0, 0x80000); - if (BurnLoadRom(DrvGfxROM0 + 0x0200000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0280000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0300000, 7, 1)) return 1; - memset (DrvGfxROM0 + 0x380000, 0, 0x80000); - if (BurnLoadRom(DrvGfxROM0 + 0x0400000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0480000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0500000, 10, 1)) return 1; - memset (DrvGfxROM0 + 0x580000, 0, 0x80000); - if (BurnLoadRom(DrvGfxROM0 + 0x0600000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0680000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0700000, 13, 1)) return 1; - memset (DrvGfxROM0 + 0x780000, 0, 0x80000); - if (BurnLoadRom(DrvGfxROM0 + 0x0800000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0880000, 15, 1)) return 1; - memset (DrvGfxROM0 + 0x900000, 0, 0x100000); - - DrvGfxDecode(0x0a00000); - - nCPUClockSpeed = 15000000; - pIRQCallback = pBangIRQLineCallback; - - gaelcosnd_start(DrvGfxROM0, 0 * 0x0200000, 1 * 0x0200000, 2 * 0x0200000, 3 * 0x0200000); - } - break; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x210000, 0x211fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xfe0000, 0xffffff, MAP_RAM); - if (game_select == 2 || game_select == 3) // snowboard champ. extra ram - SekMapMemory(Drv68KRAM2, 0x212000, 0x213fff, MAP_RAM); - - SekSetWriteWordHandler(0, gaelco2_main_write_word); - SekSetWriteByteHandler(0, gaelco2_main_write_byte); - SekSetReadWordHandler(0, gaelco2_main_read_word); - SekSetReadByteHandler(0, gaelco2_main_read_byte); - - SekMapHandler(1, 0x202800, 0x202bff, MAP_WRITE | MAP_READ); - SekSetWriteWordHandler(1, gaelco2_sound_write_word); - SekSetWriteByteHandler(1, gaelco2_sound_write_byte); - SekSetReadWordHandler(1, gaelco2_sound_read_word); - SekSetReadByteHandler(1, gaelco2_sound_read_byte); - - SekMapHandler(2, 0x210000, 0x211fff, MAP_WRITE); - SekSetWriteWordHandler(2, gaelco2_palette_write_word); - SekSetWriteByteHandler(2, gaelco2_palette_write_byte); - SekClose(); - - EEPROMInit(&gaelco2_eeprom_interface); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - - EEPROMExit(); - - if (game_select == 6) - BurnGunExit(); - - BurnFree (AllMem); - - gaelcosnd_exit(); - game_select = 0; - - return 0; -} - -static void draw_layer(INT32 layer) -{ - INT32 offset = ((DrvVidRegs[layer] >> 9) & 0x07) * 0x1000; - - UINT16 *ram = (UINT16*)DrvSprRAM; - - INT32 scrolly = (ram[(0x2800 + (layer * 4))/2] + 0x01 - global_y_offset) & 0x1ff; - - if ((DrvVidRegs[layer] & 0x8000) == 0) - { - INT32 scrollx = (ram[(0x2802 + (layer * 4))/2] + 0x10 + (layer ? 0 : 4)) & 0x3ff; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 16; - INT32 sy = (offs / 0x40) * 16; - - sx -= scrollx; - if (sx < -15) sx += 1024; - sy -= scrolly; - if (sy < -15) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr0 = ram[offset + (offs * 2) + 0]; - INT32 attr1 = ram[offset + (offs * 2) + 1]; - - INT32 code = (attr1 + ((attr0 & 0x07) << 16)) & gfxmask; - - INT32 color = (attr0 & 0xfe00) >> 9; - INT32 flipx = (attr0 & 0x0080) ? 0xf : 0; - INT32 flipy = (attr0 & 0x0040) ? 0xf : 0; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 5, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 5, 0, 0, DrvGfxROM); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 5, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 5, 0, 0, DrvGfxROM); - } - } - } - } - else - { - if (game_select == 4) - scrolly += 32; // for touch n go alignment - - for (INT32 sy = 0; sy < nScreenHeight; sy++) - { - INT32 yy = (sy + scrolly) & 0x1ff; - INT32 yy2 = (game_select == 4) ? yy : sy; - - INT32 scrollx = (ram[(0x2802 + (layer * 4))/2] + 0x10 + (layer ? 0 : 4)) & 0x3ff; - if (DrvVidRegs[layer] & 0x8000) { - if (layer) { - scrollx = (ram[(0x2400/2) + yy2] + 0x10) & 0x3ff; - } else { - scrollx = (ram[(0x2000/2) + yy2] + 0x14) & 0x3ff; - } - } - - UINT16 *dst = pTransDraw + sy * nScreenWidth; - - for (INT32 sx = 0; sx < nScreenWidth + 16; sx += 16) - { - INT32 sxx = (sx + scrollx) & 0x3ff; - INT32 xx = sx - (scrollx & 0xf); - - INT32 index = ((sxx / 16) + ((yy / 16) * 64)) * 2; - - INT32 attr0 = ram[offset + index + 0]; - INT32 attr1 = ram[offset + index + 1]; - - INT32 code = (attr1 + ((attr0 & 0x07) << 16)) & gfxmask; - - INT32 color = ((attr0 >> 9) & 0x7f) * 0x20; - INT32 flipx = (attr0 & 0x80) ? 0xf : 0; - INT32 flipy = (attr0 & 0x40) ? 0xf : 0; - - UINT8 *gfx = DrvGfxROM + (code * 256) + (((yy & 0x0f) ^ flipy) * 16); - - for (INT32 x = 0; x < 16; x++, xx++) - { - if (xx >= 0 && xx < nScreenWidth) { - if (gfx[x^flipx]) { - dst[xx] = gfx[x^flipx] + color; - } - } - } - } - } - } -} - -static void draw_sprites(INT32 mask, INT32 xoffs) -{ - UINT16 *buffered_spriteram16 = (UINT16*)DrvSprBuf; - int j, x, y, ex, ey, px, py; - - INT32 start_offset = (DrvVidRegs[1] & 0x10)*0x100; - INT32 end_offset = start_offset + 0x1000; - - INT32 spr_x_adjust = ((nScreenWidth-1) - 320 + 1) - (511 - 320 - 1) - ((DrvVidRegs[0] >> 4) & 0x01) + xoffs; - - for (j = start_offset; j < end_offset; j += 8) - { - int data = buffered_spriteram16[(j/2) + 0]; - int data2 = buffered_spriteram16[(j/2) + 1]; - int data3 = buffered_spriteram16[(j/2) + 2]; - int data4 = buffered_spriteram16[(j/2) + 3]; - - int sx = data3 & 0x3ff; - int sy = data2 & 0x1ff; - - int xflip = data2 & 0x800; - int yflip = data2 & 0x400; - - int xsize = ((data3 >> 12) & 0x0f) + 1; - int ysize = ((data2 >> 12) & 0x0f) + 1; - - if (m_dual_monitor && ((data & 0x8000) != mask)) continue; - - if ((data2 & 0x0200) != 0) - { - for (y = 0; y < ysize; y++) - { - for (x = 0; x < xsize; x++) - { - int data5 = buffered_spriteram16[((data4/2) + (y*xsize + x)) & 0x7fff]; - int number = (((data & 0x1ff) << 10) + (data5 & 0x0fff)) & gfxmask; - int color = ((data >> 9) & 0x7f) + ((data5 >> 12) & 0x0f); - int color_effect = m_dual_monitor ? ((color & 0x3f) == 0x3f) : (color == 0x7f); - - ex = xflip ? (xsize - 1 - x) : x; - ey = yflip ? (ysize - 1 - y) : y; - - if (color_effect == 0) // iq_132 - { - if (yflip) { - if (xflip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, number, ((sx + ex*16) & 0x3ff) + spr_x_adjust, ((sy + ey*16) & 0x1ff) + global_y_offset, color, 5, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, number, ((sx + ex*16) & 0x3ff) + spr_x_adjust, ((sy + ey*16) & 0x1ff) + global_y_offset, color, 5, 0, 0, DrvGfxROM); - } - } else { - if (xflip) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, number, ((sx + ex*16) & 0x3ff) + spr_x_adjust, ((sy + ey*16) & 0x1ff) + global_y_offset, color, 5, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, number, ((sx + ex*16) & 0x3ff) + spr_x_adjust, ((sy + ey*16) & 0x1ff) + global_y_offset, color, 5, 0, 0, DrvGfxROM); - } - } - } else { - const UINT8 *gfx_src = DrvGfxROM + number * 0x100; - - for (py = 0; py < 16; py++) - { - int ypos = ((sy + ey*16 + py) & 0x1ff) + global_y_offset; - if ((ypos < 0) || (ypos >= nScreenHeight)) continue; - - UINT16 *srcy = pTransDraw + ypos * nScreenWidth; - - int gfx_py = yflip ? (16 - 1 - py) : py; - - for (px = 0; px < 16; px++) - { - int xpos = (((sx + ex*16 + px) & 0x3ff) + spr_x_adjust) & 0x3ff; - UINT16 *pixel = srcy + xpos; - int src_color = *pixel; - - int gfx_px = xflip ? (16 - 1 - px) : px; - - int gfx_pen = gfx_src[16*gfx_py + gfx_px]; - - if ((gfx_pen == 0) || (gfx_pen >= 16)) continue; - - if ((xpos < 0) || (xpos >= nScreenWidth)) continue; - - *pixel = src_color + 4096*gfx_pen; - } - } - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x2000; i+=2) { - palette_update(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_layer(1); - if (nBurnLayer & 2) draw_layer(0); - if (nBurnLayer & 4) draw_sprites(0,0); - - BurnTransferCopy(DrvPalette); - - if (game_select == 6) { - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } - } - - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - - { - memset (DrvInputs, 0xff, 4 * sizeof(UINT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - DrvInputs[0] = (DrvInputs[0] & 0xff) | (DrvDips[0] << 8); - DrvInputs[1] = (DrvInputs[1] & 0xff) | (DrvDips[1] << 8); - - if (game_select == 6) { - BurnGunMakeInputs(0, (INT16)LethalGun0, (INT16)LethalGun1); - BurnGunMakeInputs(1, (INT16)LethalGun2, (INT16)LethalGun3); - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[1] = { (nCPUClockSpeed * 10) / 591 }; // ?? MHZ @ 59.1 HZ - INT32 nCyclesDone[1] = { 0 }; - INT32 nSegment = 0; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nSegment); - - pIRQCallback(i); - - } - - if (pBurnSoundOut) { - gaelcosnd_update(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x10000); - - return 0; -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - EEPROMScan(nAction, pnMin); - - if (game_select == 6) - BurnGunScan(); - - SCAN_VAR(snowboar_latch); - SCAN_VAR(gun_interrupt); - gaelcosnd_scan(); - } - - return 0; -} - - -// Maniac Square (unprotected) - -static struct BurnRomInfo maniacsqRomDesc[] = { - { "d8-d15.1m", 0x020000, 0x9121d1b6, 0 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "d0-d7.1m", 0x020000, 0xa95cfd2a, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "d0-d7.4m", 0x080000, 0xd8551b2f, 1 | BRF_GRA }, // 2 Graphics & Samples - { "d8-d15.4m", 0x080000, 0xb269c427, 1 | BRF_GRA }, // 3 - { "d16-d23.1m", 0x020000, 0xaf4ea5e7, 1 | BRF_GRA }, // 4 - { "d24-d31.1m", 0x020000, 0x578c3588, 1 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(maniacsq) -STD_ROM_FN(maniacsq) - -static INT32 maniacsqInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvManiacsq = { - "maniacsq", NULL, NULL, NULL, "1996", - "Maniac Square (unprotected)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, maniacsqRomInfo, maniacsqRomName, NULL, NULL, ManiacsqInputInfo, ManiacsqDIPInfo, - maniacsqInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 320, 240, 4, 3 -}; - - -// Alligator Hunt - -static struct BurnRomInfo aligatorRomDesc[] = { - { "u45", 0x080000, 0x61c47c56, 0 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u44", 0x080000, 0xf0be007a, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "u48", 0x400000, 0x19e03bf1, 1 | BRF_GRA }, // 2 Graphics & Samples - { "u47", 0x400000, 0x74a5a29f, 1 | BRF_GRA }, // 3 - { "u50", 0x400000, 0x85daecf9, 1 | BRF_GRA }, // 4 - { "u49", 0x400000, 0x70a4ee0b, 1 | BRF_GRA }, // 5 - - { "aligator_ds5002fp.bin", 0x080000, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(aligator) -STD_ROM_FN(aligator) - -static INT32 aligatorInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvAligator = { - "aligator", NULL, NULL, NULL, "1994", - "Alligator Hunt\0", "Play the unprotected clone, instead!", "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, aligatorRomInfo, aligatorRomName, NULL, NULL, AlighuntInputInfo, AlighuntDIPInfo, - aligatorInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 320, 240, 4, 3 -}; - - -// Alligator Hunt (unprotected) - -static struct BurnRomInfo aligatorunRomDesc[] = { - { "ahntu45n.040", 0x080000, 0xfc02cb2d, 0 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ahntu44n.040", 0x080000, 0x7fbea3a3, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "u48", 0x400000, 0x19e03bf1, 1 | BRF_GRA }, // 2 Graphics & Samples - { "u47", 0x400000, 0x74a5a29f, 1 | BRF_GRA }, // 3 - { "u50", 0x400000, 0x85daecf9, 1 | BRF_GRA }, // 4 - { "u49", 0x400000, 0x70a4ee0b, 1 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(aligatorun) -STD_ROM_FN(aligatorun) - -struct BurnDriver BurnDrvAligatorun = { - "aligatorun", "aligator", NULL, NULL, "1994", - "Alligator Hunt (unprotected)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, aligatorunRomInfo, aligatorunRomName, NULL, NULL, AlighuntInputInfo, AlighuntDIPInfo, - aligatorInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 320, 240, 4, 3 -}; - - - -// Snow Board Championship (Version 2.0) - -static struct BurnRomInfo snowboaraRomDesc[] = { - { "sb53", 0x080000, 0xe4eaefd4, 0 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sb55", 0x080000, 0xe2476994, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "sb43", 0x200000, 0xafce54ed, 1 | BRF_GRA }, // 2 Graphics & Samples - { "sb44", 0x400000, 0x1bbe88bc, 1 | BRF_GRA }, // 3 - { "sb45", 0x400000, 0x373983d9, 1 | BRF_GRA }, // 4 - { "sb46", 0x400000, 0x22e7c648, 1 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(snowboara) -STD_ROM_FN(snowboara) - -static INT32 snowboaraInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvSnowboara = { - "snowboara", "snowboar", NULL, NULL, "1994", - "Snow Board Championship (Version 2.0)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, snowboaraRomInfo, snowboaraRomName, NULL, NULL, SnowboarInputInfo, NULL, - snowboaraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 384, 240, 4, 3 -}; - - -// Snow Board Championship (Version 2.1) - -static struct BurnRomInfo snowboarRomDesc[] = { - { "sb.53", 0x080000, 0x4742749e, 0 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sb.55", 0x080000, 0x6ddc431f, 0 | BRF_PRG | BRF_ESS }, // 1 - - { "sb.a0", 0x080000, 0xaa476e44, 1 | BRF_GRA }, // 2 Graphics & Samples - { "sb.a1", 0x080000, 0x6bc99195, 1 | BRF_GRA }, // 3 - { "sb.a2", 0x080000, 0xfae2ebba, 1 | BRF_GRA }, // 4 - { "sb.a3", 0x080000, 0x17ed9cf8, 1 | BRF_GRA }, // 5 - { "sb.a4", 0x080000, 0x2ba3a5c8, 1 | BRF_GRA }, // 6 - { "sb.a5", 0x080000, 0xae011eb3, 1 | BRF_GRA }, // 7 - { "sb.b0", 0x080000, 0x96c714cd, 1 | BRF_GRA }, // 8 - { "sb.b1", 0x080000, 0x39a4c30c, 1 | BRF_GRA }, // 9 - { "sb.b2", 0x080000, 0xb58fcdd6, 1 | BRF_GRA }, // 10 - { "sb.b3", 0x080000, 0x96afdebf, 1 | BRF_GRA }, // 11 - { "sb.b4", 0x080000, 0xe62cf8df, 1 | BRF_GRA }, // 12 - { "sb.b5", 0x080000, 0xcaa90856, 1 | BRF_GRA }, // 13 - { "sb.c0", 0x080000, 0xc9d57a71, 1 | BRF_GRA }, // 14 - { "sb.c1", 0x080000, 0x1d14a3d4, 1 | BRF_GRA }, // 15 - { "sb.c2", 0x080000, 0x55026352, 1 | BRF_GRA }, // 16 - { "sb.c3", 0x080000, 0xd9b62dee, 1 | BRF_GRA }, // 17 - { "sb.d0", 0x080000, 0x7434c1ae, 1 | BRF_GRA }, // 18 - { "sb.d1", 0x080000, 0xf00cc6c8, 1 | BRF_GRA }, // 19 - { "sb.d2", 0x080000, 0x019f9aec, 1 | BRF_GRA }, // 20 - { "sb.d3", 0x080000, 0xd05bd286, 1 | BRF_GRA }, // 21 - { "sb.e0", 0x080000, 0xe6195323, 1 | BRF_GRA }, // 22 - { "sb.e1", 0x080000, 0x9f38910b, 1 | BRF_GRA }, // 23 - { "sb.e2", 0x080000, 0xf5948c6c, 1 | BRF_GRA }, // 24 - { "sb.e3", 0x080000, 0x4baa678f, 1 | BRF_GRA }, // 25 -}; - -STD_ROM_PICK(snowboar) -STD_ROM_FN(snowboar) - -static INT32 snowboarInit() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvSnowboar = { - "snowboar", NULL, NULL, NULL, "1994", - "Snow Board Championship (Version 2.1)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, snowboarRomInfo, snowboarRomName, NULL, NULL, SnowboarInputInfo, NULL, - snowboarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 384, 240, 4, 3 -}; - - - -// Touch & Go (World) - -static struct BurnRomInfo touchgoRomDesc[] = { - { "tg_56", 0x080000, 0x8ab065f3, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tg_57", 0x080000, 0x0dfd3f65, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ic69", 0x200000, 0x18bb12d4, 2 | BRF_GRA }, // 2 Graphics & Samples - { "ic65", 0x400000, 0x91b89c7c, 2 | BRF_GRA }, // 3 - { "ic66", 0x200000, 0x52682953, 2 | BRF_GRA }, // 4 - { "ic67", 0x400000, 0xc0a2ce5b, 2 | BRF_GRA }, // 5 - - { "touchgo_ds5002fp.bin", 0x8000, 0x00000000, 4 | BRF_NODUMP }, // 6 Dallas MCU -}; - -STD_ROM_PICK(touchgo) -STD_ROM_FN(touchgo) - -static INT32 touchgoInit() -{ - return DrvInit(4); -} - -struct BurnDriver BurnDrvTouchgo = { - "touchgo", NULL, NULL, NULL, "1995", - "Touch & Go (World)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 4, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, touchgoRomInfo, touchgoRomName, NULL, NULL, TouchgoInputInfo, TouchgoDIPInfo, - touchgoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 480, 240, 4, 3 -}; - - -// Touch & Go (Non North America) - -static struct BurnRomInfo touchgonRomDesc[] = { - { "tg56.bin", 0x080000, 0xfd3b4642, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tg57.bin", 0x080000, 0xee891835, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ic69", 0x200000, 0x18bb12d4, 2 | BRF_GRA }, // 2 Graphics & Samples - { "ic65", 0x400000, 0x91b89c7c, 2 | BRF_GRA }, // 3 - { "ic66", 0x200000, 0x52682953, 2 | BRF_GRA }, // 4 - { "ic67", 0x400000, 0xc0a2ce5b, 2 | BRF_GRA }, // 5 - - { "touchgo_ds5002fp.bin", 0x8000, 0x00000000, 4 | BRF_NODUMP }, // 6 Dallas MCU -}; - -STD_ROM_PICK(touchgon) -STD_ROM_FN(touchgon) - -struct BurnDriver BurnDrvTouchgon = { - "touchgon", "touchgo", NULL, NULL, "1995", - "Touch & Go (Non North America)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE, 4, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, touchgonRomInfo, touchgonRomName, NULL, NULL, TouchgoInputInfo, TouchgoDIPInfo, - touchgoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 480, 240, 4, 3 -}; - - -// Touch & Go (earlier revision) - -static struct BurnRomInfo touchgoeRomDesc[] = { - { "tg56", 0x080000, 0x6d0f5c65, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tg57", 0x080000, 0x845787b5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ic69", 0x200000, 0x18bb12d4, 2 | BRF_GRA }, // 2 Graphics & Samples - { "ic65", 0x400000, 0x91b89c7c, 2 | BRF_GRA }, // 3 - { "ic66", 0x200000, 0x52682953, 2 | BRF_GRA }, // 4 - { "ic67", 0x400000, 0xc0a2ce5b, 2 | BRF_GRA }, // 5 - - { "touchgo_ds5002fp.bin", 0x8000, 0x00000000, 4 | BRF_NODUMP }, // 6 Dallas MCU -}; - -STD_ROM_PICK(touchgoe) -STD_ROM_FN(touchgoe) - -struct BurnDriver BurnDrvTouchgoe = { - "touchgoe", "touchgo", NULL, NULL, "1995", - "Touch & Go (earlier revision)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE, 4, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, touchgoeRomInfo, touchgoeRomName, NULL, NULL, TouchgoInputInfo, TouchgoDIPInfo, - touchgoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 480, 240, 4, 3 -}; - - -// Touch & Go (Korea, unprotected) - -static struct BurnRomInfo touchgokRomDesc[] = { - { "56.IC56", 0x080000, 0xcbb87505, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "57.IC57", 0x080000, 0x36bcc7e7, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ic69", 0x200000, 0x18bb12d4, 2 | BRF_GRA }, // 2 Graphics & Samples - { "ic65", 0x400000, 0x91b89c7c, 2 | BRF_GRA }, // 3 - { "ic66", 0x200000, 0x52682953, 2 | BRF_GRA }, // 4 - { "ic67", 0x400000, 0xc0a2ce5b, 2 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(touchgok) -STD_ROM_FN(touchgok) - -struct BurnDriver BurnDrvTouchgok = { - "touchgok", "touchgo", NULL, NULL, "1995", - "Touch & Go (Korea, unprotected)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, touchgokRomInfo, touchgokRomName, NULL, NULL, TouchgoInputInfo, TouchgoDIPInfo, - touchgoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 480, 240, 4, 3 -}; - - -// Bang! - -static struct BurnRomInfo bangRomDesc[] = { - { "bang53.ic53", 0x80000, 0x014bb939, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bang55.ic55", 0x80000, 0x582f8b1e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bang16.ic16", 0x80000, 0x6ee4b878, 2 | BRF_GRA }, // 2 Graphics & Samples - { "bang17.ic17", 0x80000, 0x0c35aa6f, 2 | BRF_GRA }, // 3 - { "bang18.ic18", 0x80000, 0x2056b1ad, 2 | BRF_GRA }, // 4 - { "bang9.ic9", 0x80000, 0x078195dc, 2 | BRF_GRA }, // 5 - { "bang10.ic10", 0x80000, 0x06711eeb, 2 | BRF_GRA }, // 6 - { "bang11.ic11", 0x80000, 0x2088d15c, 2 | BRF_GRA }, // 7 - { "bang1.ic1", 0x80000, 0xe7b97b0f, 2 | BRF_GRA }, // 8 - { "bang2.ic2", 0x80000, 0xff297a8f, 2 | BRF_GRA }, // 9 - { "bang3.ic3", 0x80000, 0xd3da5d4f, 2 | BRF_GRA }, // 10 - { "bang20.ic20", 0x80000, 0xa1145df8, 2 | BRF_GRA }, // 11 - { "bang13.ic13", 0x80000, 0xfe3e8d07, 2 | BRF_GRA }, // 12 - { "bang5.ic5", 0x80000, 0x9bee444c, 2 | BRF_GRA }, // 13 - { "bang21.ic21", 0x80000, 0xfd93d7f2, 2 | BRF_GRA }, // 14 - { "bang14.ic14", 0x80000, 0x858fcbf9, 2 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(bang) -STD_ROM_FN(bang) - -static INT32 bangInit() -{ - INT32 rc = DrvInit(6); - - if (!rc) { - BurnGunInit(2, true); - } - - return rc; -} - -struct BurnDriver BurnDrvBang = { - "bang", NULL, NULL, NULL, "1998", - "Bang!\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, bangRomInfo, bangRomName, NULL, NULL, BangInputInfo, NULL, - bangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 320, 240, 4, 3 -}; - - -// Gun Gabacho (Japan) - -static struct BurnRomInfo bangjRomDesc[] = { - { "bang-a.ic53", 0x80000, 0x5ee514e9, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bang-a.ic55", 0x80000, 0xb90223ab, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bang-a.ic16", 0x80000, 0x3b63acfc, 2 | BRF_GRA }, // 2 Graphics & Samples - { "bang-a.ic17", 0x80000, 0x72865b80, 2 | BRF_GRA }, // 3 - { "bang18.ic18", 0x80000, 0x2056b1ad, 2 | BRF_GRA }, // 4 - { "bang-a.ic9", 0x80000, 0x3cb86360, 2 | BRF_GRA }, // 5 - { "bang-a.ic10", 0x80000, 0x03fdd777, 2 | BRF_GRA }, // 6 - { "bang11.ic11", 0x80000, 0x2088d15c, 2 | BRF_GRA }, // 7 - { "bang-a.ic1", 0x80000, 0x965d0ad9, 2 | BRF_GRA }, // 8 - { "bang-a.ic2", 0x80000, 0x8ea261a7, 2 | BRF_GRA }, // 9 - { "bang3.ic3", 0x80000, 0xd3da5d4f, 2 | BRF_GRA }, // 10 - { "bang-a.ic20", 0x80000, 0x4b828f3c, 2 | BRF_GRA }, // 11 - { "bang-a.ic13", 0x80000, 0xd1146b92, 2 | BRF_GRA }, // 12 - { "bang5.ic5", 0x80000, 0x9bee444c, 2 | BRF_GRA }, // 13 - { "bang-a.ic21", 0x80000, 0x531ce3b6, 2 | BRF_GRA }, // 14 - { "bang-a.ic14", 0x80000, 0xf8e1cf84, 2 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(bangj) -STD_ROM_FN(bangj) - -struct BurnDriver BurnDrvBangj = { - "bangj", "bang", NULL, NULL, "1998", - "Gun Gabacho (Japan)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, bangjRomInfo, bangjRomName, NULL, NULL, BangInputInfo, NULL, - bangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x10000, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_gaiden.cpp b/jan/src/burn/drv/pst90s/d_gaiden.cpp deleted file mode 100644 index 11b92aa11..000000000 --- a/jan/src/burn/drv/pst90s/d_gaiden.cpp +++ /dev/null @@ -1,2207 +0,0 @@ -// FB Alpha Ninja Gaiden driver module -// Based on MAME driver by Alex Pasadyn, Phil Stroffolino, Nicola Salmoria, and various others - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" -#include "burn_ym2151.h" -#include "burn_ym2203.h" -#include "bitswap.h" - -static INT32 game = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static UINT8 *Mem, *MemEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; - -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; - -static UINT16 *bitmap[3]; -static UINT32 *output; -static INT32 sprite_sizey = 0; - -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvVidRAM2; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT32 *Palette; -static UINT8 DrvRecalc; - -static INT32 flipscreen; -static UINT8 soundlatch; - -static INT32 prot; -static INT32 jumpcode; -static INT32 jumppointer; - -static INT32 tx_scroll_x; -static INT32 tx_scroll_y; -static INT32 fg_scroll_x; -static INT32 fg_scroll_y; -static INT32 bg_scroll_x; -static INT32 bg_scroll_y; -static INT32 tx_offset_y; -static INT32 fg_offset_y; -static INT32 bg_offset_y; -static INT32 sproffsety; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 7, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 1, "p1 right" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy2 + 2, "p1 down" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy2 + 3, "p1 up" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 5, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 6, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 3"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 1, "p2 right" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 2, "p2 down" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 3, "p2 up" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 5, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 6, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy3 + 4, "p2 fire 3"}, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo RaigaInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 7, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 1, "p1 right" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy2 + 2, "p1 down" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy2 + 3, "p1 up" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p1 fire 2"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 1, "p2 right" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 2, "p2 down" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 3, "p2 up" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p2 fire 2"}, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Raiga) - -static struct BurnDIPInfo GaidenDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0xe0, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x1c, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x04, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4 , "Energy" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - {0x14, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0xc0, 0x00, "1" }, - {0x14, 0x01, 0xc0, 0xc0, "2" }, - {0x14, 0x01, 0xc0, 0x40, "3" }, - {0x14, 0x01, 0xc0, 0x80, "4" }, -}; - -STDDIPINFO(Gaiden) - -static struct BurnDIPInfo WildfangDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0xe0, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x1c, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x04, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2 , "Title" }, - {0x14, 0x01, 0x01, 0x01, "Wild Fang" }, - {0x14, 0x01, 0x01, 0x00, "Tecmo Knight" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, // Wild Fang - {0x14, 0x02, 0x0c, 0x0c, "Easy" }, - {0x14, 0x00, 0x01, 0x01, NULL }, - {0x14, 0x02, 0x0c, 0x04, "Normal" }, - {0x14, 0x00, 0x01, 0x01, NULL }, - {0x14, 0x02, 0x0c, 0x08, "Hard" }, - {0x14, 0x00, 0x01, 0x01, NULL }, - {0x14, 0x02, 0x0c, 0x00, "Hardest" }, - {0x14, 0x00, 0x01, 0x01, NULL }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, // Tecmo Knight - {0x14, 0x02, 0x30, 0x30, "Easy" }, - {0x14, 0x00, 0x01, 0x00, NULL }, - {0x14, 0x02, 0x30, 0x10, "Normal" }, - {0x14, 0x00, 0x01, 0x00, NULL }, - {0x14, 0x02, 0x30, 0x20, "Hard" }, - {0x14, 0x00, 0x01, 0x00, NULL }, - {0x14, 0x02, 0x30, 0x00, "Hardest" }, - {0x14, 0x00, 0x01, 0x00, NULL }, - - {0 , 0xfe, 0 , 3 , "Lives" }, - {0x14, 0x01, 0xc0, 0x80, "1" }, - {0x14, 0x01, 0xc0, 0xc0, "2" }, - {0x14, 0x01, 0xc0, 0x40, "3" }, -// {0x14, 0x01, 0xc0, 0x00, "2" }, -}; - -STDDIPINFO(Wildfang) - -static struct BurnDIPInfo TknightDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0xe0, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x1c, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x04, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x30, 0x30, "Easy" }, - {0x14, 0x01, 0x30, 0x10, "Normal" }, - {0x14, 0x01, 0x30, 0x20, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 3 , "Lives" }, - {0x14, 0x01, 0xc0, 0x80, "1" }, - {0x14, 0x01, 0xc0, 0xc0, "2" }, - {0x14, 0x01, 0xc0, 0x40, "3" }, -// {0x14, 0x01, 0xc0, 0x00, "2" }, -}; - -STDDIPINFO(Tknight) - -static struct BurnDIPInfo DrgnbowlDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0xe0, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x1c, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x04, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4 , "Energy" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - {0x14, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0xc0, 0x00, "1" }, - {0x14, 0x01, 0xc0, 0xc0, "2" }, - {0x14, 0x01, 0xc0, 0x40, "3" }, - {0x14, 0x01, 0xc0, 0x80, "4" }, -}; - -STDDIPINFO(Drgnbowl) - -static struct BurnDIPInfo RaigaDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x5f, NULL }, - - {0 , 0xfe, 0 , 16 , "Coin A" }, - {0x11, 0x01, 0xf0, 0x00, "5 Coins 1 Credit" }, - {0x11, 0x01, 0xf0, 0x40, "4 Coins 1 Credit" }, - {0x11, 0x01, 0xf0, 0xa0, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xf0, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xf0, 0x20, "3 Coins 2 Credits" }, - {0x11, 0x01, 0xf0, 0x80, "4 Coins 3 Credits" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xf0, 0xc0, "3 Coins 4 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x11, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, - {0x11, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x11, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16 , "Coin B" }, - {0x11, 0x01, 0x0f, 0x00, "5 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x04, "4 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0a, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x01, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x0f, 0x02, "3 Coins 2 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "4 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0c, "3 Coins 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x12, 0x01, 0x03, 0x03, "50k 200k" }, - {0x12, 0x01, 0x03, 0x01, "100k 300k" }, - {0x12, 0x01, 0x03, 0x02, "50k only" }, - {0x12, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x00, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x08, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Easy" }, - {0x12, 0x01, 0x30, 0x10, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Raiga) - -static const INT32 jumppoints_00[0x100] = -{ - 0x6669, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1,0x4a46, -1, - -1,0x6704, -2, -1, -1, -1, -1, -1, - -1, -2, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -2, -1, -1, -1, -1,0x4e75, -1, -1, - -1, -2, -1,0x4e71,0x60fc, -1,0x7288, -1, - -1, -1, -1, -1, -1, -1, -1, -1 -}; - -static const INT32 jumppoints_other[0x100] = -{ - 0x5457,0x494e,0x5f4b,0x4149,0x5345,0x525f,0x4d49,0x5941, - 0x5241,0x5349,0x4d4f,0x4a49, -1, -1, -1, -1, - -1, -1, -2,0x594f, -1,0x4e75, -1, -1, - -1, -2, -1, -1,0x4e75, -1,0x5349, -1, - -1, -1, -1,0x4e75, -1,0x4849, -1, -1, - -2, -1, -1,0x524f, -1, -1, -1, -1, - -1, -2, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1 -}; - -static const INT32 wildfang_jumppoints[0x100] = -{ - 0x0c0c,0x0cac,0x0d42,0x0da2,0x0eea,0x112e,0x1300,0x13fa, - 0x159a,0x1630,0x109a,0x1700,0x1750,0x1806,0x18d6,0x1a44, - 0x1b52, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1 -}; - -static const INT32 *jumppoints; - -static void protection_w(UINT8 data) -{ - switch (data & 0xf0) - { - case 0x00: // init - prot = 0x00; - break; - - case 0x10: // high 4 bits of jump code - jumpcode = (data & 0x0f) << 4; - prot = 0x10; - break; - - case 0x20: // low 4 bits of jump code - jumpcode |= data & 0x0f; - if (jumppoints[jumpcode] == -2) { - jumppoints = jumppoints_other; - jumppointer = 1; - } - - if (jumppoints[jumpcode] == -1) { - jumpcode = 0; - } - prot = 0x20; - break; - - case 0x30: // bits 12-15 of function address - prot = 0x40 | ((jumppoints[jumpcode] >> 12) & 0x0f); - break; - - case 0x40: // bits 8-11 of function address - prot = 0x50 | ((jumppoints[jumpcode] >> 8) & 0x0f); - break; - - case 0x50: // bits 4-7 of function address - prot = 0x60 | ((jumppoints[jumpcode] >> 4) & 0x0f); - break; - - case 0x60: // bits 0-3 of function address - prot = 0x70 | ((jumppoints[jumpcode] >> 0) & 0x0f); - break; - } -} - -static void palette_write(INT32 offset, UINT16 pal) -{ - UINT8 b = (pal >> 8) & 0x0f; - UINT8 g = (pal >> 4) & 0x0f; - UINT8 r = (pal >> 0) & 0x0f; - - Palette[offset] = (r<<8) | (g<<4) | b; -} - -static UINT8 __fastcall gaiden_read_byte(UINT32 address) -{ - switch (address) - { - case 0x07a001: - return DrvInputs[0]; - - case 0x07a002: - return DrvInputs[2]; - - case 0x07a003: - return DrvInputs[1]; - - case 0x07a004: - return DrvDips[1]; - - case 0x07a005: - return DrvDips[0]; - - case 0x07a007: // Raiga, Wild Fang - return prot; - } - - return 0; -} - -static UINT16 __fastcall gaiden_read_word(UINT32 address) -{ - switch (address) - { - case 0x07a000: - return DrvInputs[0]; - - case 0x07a002: - return (DrvInputs[2] << 8) | DrvInputs[1]; - - case 0x07a004: - return (DrvDips[1] << 8) | DrvDips[0]; - } - - return 0; -} - -static void __fastcall gaiden_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffffe000) == 0x78000) { - address &= 0x1fff; - - DrvPalRAM[address ^ 1] = data; - - palette_write(address>>1, *((UINT16*)(DrvPalRAM + (address & ~1)))); - - return; - } - - switch (address) - { - case 0x7a002: - case 0x7a003: - bprintf (0, _T("wb: %5.5x, %2.2x\n"), address, data); - sproffsety = data; - return; - - case 0x7a00e: // Dragon Bowl - soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - return; - - case 0x7a802: // Tecmo Knight - case 0x7a803: // Ninja Gaiden - soundlatch = data; - ZetNmi(); - return; - - case 0x7a804: // Raiga, Wild Fang - protection_w(data); - return; - - } -} - -static void __fastcall gaiden_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffe000) == 0x78000) { - address &= 0x1ffe; - - *((UINT16*)(DrvPalRAM + address)) = data; - - palette_write(address>>1, *((UINT16*)(DrvPalRAM + address))); - - return; - } - - switch (address & 0xfffffffe) - { - case 0x7a002: - sproffsety = data; - return; - - case 0x7a104: - tx_scroll_y = data & 0x1ff; - return; - - case 0x7a108: - tx_offset_y = data & 0x1ff; - return; - - case 0x7a10c: - tx_scroll_x = data & 0x3ff; - return; - - case 0x7a204: - fg_scroll_y = data & 0x1ff; - return; - - case 0x7a208: - fg_offset_y = data & 0x1ff; - return; - - case 0x7a20c: - fg_scroll_x = data & 0x3ff; - return; - - case 0x7a304: - bg_scroll_y = data & 0x1ff; - return; - - case 0x7a308: - bg_offset_y = data & 0x1ff; - return; - - case 0x7a30c: - bg_scroll_x = data & 0x3ff; - return; - - case 0x7a808: - flipscreen = data & 1; - return; - - // Dragon Bowl - case 0x7f000: - bg_scroll_y = data & 0x1ff; - return; - - case 0x7f002: - bg_scroll_x = (data + 248) & 0x3ff; - return; - - case 0x7f004: - fg_scroll_y = data & 0x1ff; - return; - - case 0x7f006: - fg_scroll_x = (data + 252) & 0x3ff; - return; - } -} - -static void __fastcall gaiden_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf800: - MSM6295Command(0, data); - return; - - case 0xf810: - BurnYM2203Write(0, 0, data); - return; - - case 0xf811: - BurnYM2203Write(0, 1, data); - return; - - case 0xf820: - BurnYM2203Write(1, 0, data); - return; - - case 0xf821: - BurnYM2203Write(1, 1, data); - return; - } -} - -static UINT8 __fastcall gaiden_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return MSM6295ReadStatus(0); - - case 0xfc00: - return 0; - - case 0xfc20: - return soundlatch; - } - - return 0; -} - -static void __fastcall drgnbowl_sound_write(UINT16 address, UINT8 data) -{ - switch (address & 0xff) - { - case 0x00: - BurnYM2151SelectRegister(data); - return; - - case 0x01: - BurnYM2151WriteRegister(data); - return; - - case 0x80: - MSM6295Command(0, data); - return; - } -} - -static UINT8 __fastcall drgnbowl_sound_read(UINT16 address) -{ - switch (address & 0xff) - { - case 0x01: - return BurnYM2151ReadStatus(); - - case 0x80: - return MSM6295ReadStatus(0); - - case 0xc0: - return soundlatch; - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KROM = Next; Next += 0x0040000; - DrvZ80ROM = Next; Next += 0x0010000; - - DrvGfxROM0 = Next; Next += 0x0020000; - DrvGfxROM1 = Next; Next += 0x0100000; - DrvGfxROM2 = Next; Next += 0x0100000; - DrvGfxROM3 = Next; Next += 0x0200000; - - bitmap[0] = (UINT16*)Next; Next += 256 * 256 * sizeof(UINT16); - bitmap[1] = (UINT16*)Next; Next += 256 * 256 * sizeof(UINT16); - bitmap[2] = (UINT16*)Next; Next += 256 * 256 * sizeof(UINT16); - - output = (UINT32*)Next; Next += 256 * 256 * sizeof(UINT32); - - MSM6295ROM = Next; Next += 0x0040000; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x0004000; - DrvVidRAM0 = Next; Next += 0x0001000; - DrvVidRAM1 = Next; Next += 0x0002000; - DrvVidRAM2 = Next; Next += 0x0002000; - DrvSprRAM = Next; Next += 0x0002000; - DrvPalRAM = Next; Next += 0x0002000; - - DrvZ80RAM = Next; Next += 0x0000800; - - Palette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - soundlatch = 0; - tx_scroll_x = 0; - tx_scroll_y = 0; - fg_scroll_x = 0; - fg_scroll_y = 0; - bg_scroll_x = 0; - bg_scroll_y = 0; - tx_offset_y = 0; - fg_offset_y = 0; - bg_offset_y = 0; - sproffsety = 0; - - flipscreen = 0; - - prot = 0; - jumpcode = 0; - jumppointer = 0; - - if (game == 2) { - jumppoints = jumppoints_00; - } else { - jumppoints = wildfang_jumppoints; - } - - prot = 0; - jumpcode = 0; - - DrvReset = 0; - - DrvRecalc = 1; - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - if (game == 1) { - BurnYM2151Reset(); - } else { - BurnYM2203Reset(); - } - - HiscoreReset(); - - SetCurrentFrame(0); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - static INT32 Planes[4] = { 0x000, 0x001, 0x002, 0x003 }; - static INT32 TileXOffsets[16] = { 0x000, 0x004, 0x008, 0x00c, 0x010, 0x014, 0x018, 0x01c, - 0x100, 0x104, 0x108, 0x10c, 0x110, 0x114, 0x118, 0x11c }; - static INT32 TileYOffsets[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0 }; - - static INT32 SpriteXOffsets[8] = { 0x000000, 0x000004, 0x400000, 0x400004, - 0x000008, 0x00000c, 0x400008, 0x40000c }; - static INT32 SpriteYOffsets[8] = { 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x010000); - - GfxDecode(0x00800, 4, 8, 8, Planes, TileXOffsets, TileYOffsets, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x080000); - - GfxDecode(0x01000, 4, 16, 16, Planes, TileXOffsets, TileYOffsets, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x080000); - - GfxDecode(0x01000, 4, 16, 16, Planes, TileXOffsets, TileYOffsets, 0x400, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x100000); - - GfxDecode(0x08000, 4, 8, 8, Planes, SpriteXOffsets, SpriteYOffsets, 0x080, tmp, DrvGfxROM3); - - BurnFree (tmp); - - return 0; -} - -static INT32 drgnbowlDecode(INT32 decode_cpu) -{ - UINT8 *buf = (UINT8*)BurnMalloc(0x100000); - if (buf == NULL) { - return 1; - } - - if (decode_cpu) { - memcpy (buf, Drv68KROM, 0x40000); - - for (INT32 i = 0; i < 0x40000; i++) { - Drv68KROM[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,15,16,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)]; - } - } - - for (INT32 i = 0; i < 0x100000; i++) { - buf[i] = DrvGfxROM1[BITSWAP24(i,23,22,21,20,19,18,16,17,15,14,13,4,3,12,11,10,9,8,7,6,5,2,1,0)]; - } - - static INT32 CharPlanes[4] = { 0, 1, 2, 3 }; - static INT32 CharXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; - static INT32 CharYOffsets[8] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0 }; - - static INT32 Planes[4] = { 0x600000, 0x400000, 0x200000, 0x000000 }; - static INT32 XOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; - static INT32 YOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; - - GfxDecode(0x02000, 4, 16, 16, Planes, XOffsets, YOffsets, 0x100, buf, DrvGfxROM1); - - memcpy (buf, DrvGfxROM3, 0x100000); - - for (INT32 i = 0; i < 0x100000; i++) buf[i] ^= 0xff; - - GfxDecode(0x02000, 4, 16, 16, Planes, XOffsets, YOffsets, 0x100, buf, DrvGfxROM3); - - memcpy (buf, DrvGfxROM0, 0x010000); - - GfxDecode(0x00800, 4, 8, 8, CharPlanes, CharXOffsets, CharYOffsets, 0x100, buf, DrvGfxROM0); - - BurnFree (buf); - - return 0; -} - -static INT32 DrvGetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *Load68K = Drv68KROM; - UINT8 *LoadZ80 = DrvZ80ROM; - UINT8 *LoadG0 = DrvGfxROM0; - UINT8 *LoadG1 = DrvGfxROM1; - UINT8 *LoadG2 = DrvGfxROM2; - UINT8 *LoadG3 = DrvGfxROM3; - UINT8 *LoadSND = MSM6295ROM; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(Load68K + 1, i + 0, 2)) return 1; - if (BurnLoadRom(Load68K + 0, i + 1, 2)) return 1; - Load68K += ri.nLen * 2; - i++; - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(LoadZ80, i, 1)) return 1; - LoadZ80 += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(LoadG0, i, 1)) return 1; - LoadG0 += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(LoadG1, i, 1)) return 1; - LoadG1 += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 5) { - if (BurnLoadRom(LoadG2, i, 1)) return 1; - LoadG2 += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 6) { - if (BurnLoadRom(LoadG3, i, 1)) return 1; - LoadG3 += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 7) { - if (BurnLoadRom(LoadSND, i, 1)) return 1; - LoadSND += ri.nLen; - continue; - } - } - - return 0; -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - if (DrvGetRoms()) return 1; - - if (game == 1||game==3) { - if (drgnbowlDecode((game==1)?1:0)) return 1; - - game = 1; - } else { - if (DrvGfxDecode()) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x060000, 0x063fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x070000, 0x070fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x072000, 0x073fff, MAP_RAM); - SekMapMemory(DrvVidRAM2, 0x074000, 0x075fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x076000, 0x077fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x078000, 0x079fff, MAP_ROM); - SekSetWriteByteHandler(0, gaiden_write_byte); - SekSetWriteWordHandler(0, gaiden_write_word); - SekSetReadByteHandler(0, gaiden_read_byte); - SekSetReadWordHandler(0, gaiden_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - if (game == 1) { - ZetMapArea(0x0000, 0xf7ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xf7ff, 2, DrvZ80ROM); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM); - ZetSetOutHandler(drgnbowl_sound_write); - ZetSetInHandler(drgnbowl_sound_read); - } else { - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(gaiden_sound_write); - ZetSetReadHandler(gaiden_sound_read); - } - ZetClose(); - - if (game == 1) { - BurnYM2151Init(4000000); - BurnYM2151SetAllRoutes(0.40, BURN_SND_ROUTE_BOTH); - } else { - BurnYM2203Init(2, 4000000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.60, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.60, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - } - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - ZetExit(); - - MSM6295Exit(0); - if (game == 1) { - BurnYM2151Exit(); - } else { - BurnYM2203Exit(); - } - - GenericTilesExit(); - - BurnFree (Mem); - - game = 0; - sprite_sizey = 0; - - return 0; -} - -static void drgnbowl_draw_sprites(INT32 priority) -{ - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - - INT32 i, code, color, x, y, flipx, flipy; - - for (i = 0x400 - 4; i >= 0; i -= 4) - { - if ((BURN_ENDIAN_SWAP_INT16(spriteram16[i + 3]) & 0x20) != priority) - continue; - - code = (BURN_ENDIAN_SWAP_INT16(spriteram16[i]) & 0xff) | ((BURN_ENDIAN_SWAP_INT16(spriteram16[i + 3]) & 0x1f) << 8); - y = 256 - (BURN_ENDIAN_SWAP_INT16(spriteram16[i + 1]) & 0xff) - 12; - x = BURN_ENDIAN_SWAP_INT16(spriteram16[i + 2]) & 0xff; - color = BURN_ENDIAN_SWAP_INT16(spriteram16[0x400 + i]) & 0x0f; - flipx = BURN_ENDIAN_SWAP_INT16(spriteram16[i + 3]) & 0x40; - flipy = BURN_ENDIAN_SWAP_INT16(spriteram16[i + 3]) & 0x80; - - if(BURN_ENDIAN_SWAP_INT16(spriteram16[0x400 + i]) & 0x80) - x -= 256; - - x += 256; - - y -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x100, DrvGfxROM3); - if (x >= 497) Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x - 512, y, color, 4, 0xf, 0x100, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x100, DrvGfxROM3); - if (x >= 497) Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x - 512, y, color, 4, 0xf, 0x100, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x100, DrvGfxROM3); - if (x >= 497) Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x - 512, y, color, 4, 0xf, 0x100, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, 4, 0xf, 0x100, DrvGfxROM3); - if (x >= 497) Render16x16Tile_Mask_Clip(pTransDraw, code, x - 512, y, color, 4, 0xf, 0x100, DrvGfxROM3); - } - } - } -} - -static void draw_layer(UINT16 *dest, UINT16 *vidram, UINT8 *gfxbase, INT32 palette_offset, UINT16 scrollx, UINT16 scrolly, INT32 transp) -{ - for (INT32 offs = 0; offs < 0x800; offs++) - { - INT32 sx = (offs & 0x3f) << 4; - INT32 sy = (offs >> 6) << 4; - sx -= scrollx; - sy -= scrolly; - - if (sx < -15) sx += 1024; - if (sy < -15) sy += 512; - if (sy >= 0x100 || sx >= 0x100) continue; - - if (flipscreen) { - sy = 0x1ff - sy; - sx = 0x3ff - sx; - sy -= 0x110; - sx -= 0x310; - } - - sy -= 32; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vidram[0x0800 + offs]) & 0x0fff; - INT32 color = (BURN_ENDIAN_SWAP_INT16(vidram[offs]) >> 4) & 0x0f; - - if (game == 2 && gfxbase == DrvGfxROM2) { //raiga - color |= (BURN_ENDIAN_SWAP_INT16(vidram[offs]) & 0x08) << 1; - } - - if (sy >= 0 && sy <= 208 && sx >= 0 && sx <= 240) { - if (transp == -1) { - if (flipscreen) { - Render16x16Tile_FlipXY(dest, code, sx, sy, color, 4, palette_offset, gfxbase); - } else { - Render16x16Tile(dest, code, sx, sy, color, 4, palette_offset, gfxbase); - } - } else { - if (flipscreen) { - Render16x16Tile_Mask_FlipXY(dest, code, sx, sy, color, 4, transp, palette_offset, gfxbase); - } else { - Render16x16Tile_Mask(dest, code, sx, sy, color, 4, transp, palette_offset, gfxbase); - } - } - } else { - if (transp == -1) { - if (flipscreen) { - Render16x16Tile_FlipXY_Clip(dest, code, sx, sy, color, 4, palette_offset, gfxbase); - } else { - Render16x16Tile_Clip(dest, code, sx, sy, color, 4, palette_offset, gfxbase); - } - } else { - if (flipscreen) { - Render16x16Tile_Mask_FlipXY_Clip(dest, code, sx, sy, color, 4, transp, palette_offset, gfxbase); - } else { - Render16x16Tile_Mask_Clip(dest, code, sx, sy, color, 4, transp, palette_offset, gfxbase); - } - } - } - } -} - -static void draw_text(INT32 paloffset, INT32 transp) -{ - UINT16 *vidram = (UINT16*)DrvVidRAM0; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 2) & 0xf8; - - if (flipscreen) { - sy = 0xf8 - sy; - sx = 0xf8 - sx; - } - - sx -= tx_scroll_x; - sy -= (tx_scroll_y - tx_offset_y) + ((game == 1) ? 16 : 32); - - INT32 code = BURN_ENDIAN_SWAP_INT16(vidram[0x400 + offs]) & 0x07ff; - INT32 color = (BURN_ENDIAN_SWAP_INT16(vidram[0x000 + offs]) >> 4) & 0x0f; - - if (sy >= 0 && sy <= 216 && sx >= 0 && sx <= 248) { - if (transp == -1) { - if (flipscreen) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy, color, 4, paloffset, DrvGfxROM0); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, paloffset, DrvGfxROM0); - } - } else { - if (flipscreen) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, transp, paloffset, DrvGfxROM0); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, transp, paloffset, DrvGfxROM0); - } - } - } else { - if (transp == -1) { - if (flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, paloffset, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, paloffset, DrvGfxROM0); - } - } else { - if (flipscreen) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, transp, paloffset, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, transp, paloffset, DrvGfxROM0); - } - } - } - } -} - -static void gaiden_draw_sprites(INT32 spr_sizey, INT32 spr_offset_y) -{ - static const UINT8 layout[8][8] = { - { 0, 1, 4, 5, 16, 17, 20, 21 }, - { 2, 3, 6, 7, 18, 19, 22, 23 }, - { 8, 9, 12, 13, 24, 25, 28, 29 }, - { 10, 11, 14, 15, 26, 27, 30, 31 }, - { 32, 33, 36, 37, 48, 49, 52, 53 }, - { 34, 35, 38, 39, 50, 51, 54, 55 }, - { 40, 41, 44, 45, 56, 57, 60, 61 }, - { 42, 43, 46, 47, 58, 59, 62, 63 } - }; - - INT32 count = 256; - UINT16 *source = (UINT16*)DrvSprRAM; - - while (count--) - { - UINT32 attributes = source[0]; - - if (attributes & 0x04) - { - UINT32 flipx = (attributes & 1); - UINT32 flipy = (attributes & 2); - - UINT32 color = source[2]; - UINT32 sizex = 1 << ((color >> 0) & 3); - UINT32 sizey = 1 << ((color >> spr_sizey) & 3); - - UINT32 number = (source[1]); - if (sizex >= 2) number &= ~0x01; - if (sizey >= 2) number &= ~0x02; - if (sizex >= 4) number &= ~0x04; - if (sizey >= 4) number &= ~0x08; - if (sizex >= 8) number &= ~0x10; - if (sizey >= 8) number &= ~0x20; - - int ypos = (source[3] + spr_offset_y) & 0x1ff; - int xpos = source[4] & 0x1ff; - - color = (color >> 4) & 0x0f; - - if (xpos >= 256) xpos -= 512; - if (ypos >= 256) ypos -= 512; - - if (flipscreen) - { - flipx = !flipx; - flipy = !flipy; - - xpos = 256 - (8 * sizex) - xpos; - ypos = 256 - (8 * sizey) - ypos; - - if (xpos <= -256) xpos += 512; - if (ypos <= -256) ypos += 512; - } - - color |= attributes & 0x03f0; - - for (INT32 row = 0; row < (INT32)sizey; row++) - { - for (INT32 col = 0; col < (INT32)sizex; col++) - { - INT32 sx = xpos + 8 * (flipx ? (sizex - 1 - col) : col); - INT32 sy =(ypos + 8 * (flipy ? (sizey - 1 - row) : row)) - 32; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(bitmap[2], number + layout[row][col], sx, sy, color, 4, 0, 0, DrvGfxROM3); - } else { - Render8x8Tile_Mask_FlipY_Clip(bitmap[2], number + layout[row][col], sx, sy, color, 4, 0, 0, DrvGfxROM3); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(bitmap[2], number + layout[row][col], sx, sy, color, 4, 0, 0, DrvGfxROM3); - } else { - Render8x8Tile_Mask_Clip(bitmap[2], number + layout[row][col], sx, sy, color, 4, 0, 0, DrvGfxROM3); - } - } - } - } - } - - source += 8; - } -} - -static void mix_bitmaps(UINT32 *paldata, UINT16* bitmap_bg, UINT16* bitmap_fg, UINT16* bitmap_tx, UINT16* bitmap_sp) -{ - for (INT32 y = 0; y < nScreenHeight; y++) - { - UINT16 *sd2 = bitmap_sp + y * 256; - UINT16 *fg = bitmap_fg + y * 256; - UINT16 *bg = bitmap_bg + y * 256; - UINT16 *tx = bitmap_tx + y * 256; - - UINT8 *pdst = pBurnDraw + (y * nScreenWidth * nBurnBpp); - - for (INT32 x = 0; x < nScreenWidth; x++) - { - UINT16 sprpixel = (sd2[x]); - - UINT16 m_sprpri = (sprpixel >> 10) & 0x3; - UINT16 m_sprbln = (sprpixel >> 9) & 0x1; - UINT16 m_sprcol = (sprpixel >> 4) & 0xf; - - UINT32 dest = paldata[0x200]; - - sprpixel = (sprpixel & 0xf) | (m_sprcol << 4); - - UINT16 fgpixel = (fg[x]); - UINT16 fgbln = (fgpixel & 0x0100) >> 8; - fgpixel &= 0xff; - - UINT16 bgpixel = (bg[x]); - bgpixel &= 0xff; - - if (sprpixel&0xf) - { - if (m_sprpri == 3) - { - if (fgpixel & 0xf) - { - if (fgbln) - { - dest = rand(); - } - else - { - dest = paldata[fgpixel + 0x200]; - } - } - else if (bgpixel & 0x0f) - { - dest = paldata[bgpixel + 0x300]; - } - else - { - if (m_sprbln) - { - dest = rand(); - } - else - { - dest = paldata[sprpixel]; - } - - } - } - else if (m_sprpri == 2) - { - if (fgpixel & 0xf) - { - if (fgbln) - { - if (m_sprbln) - { - dest = paldata[bgpixel + 0x700] + paldata[sprpixel + 0x800]; - } - else - { - dest = paldata[fgpixel + 0xa00] + paldata[sprpixel + 0x400]; - } - } - else - { - dest = paldata[fgpixel + 0x200]; - } - - } - else - { - if (m_sprbln) - { - dest = paldata[bgpixel + 0x700] + paldata[sprpixel + 0x800]; - } - else - { - dest = paldata[sprpixel]; - } - } - - - } - else if (m_sprpri == 1) - { - if (m_sprbln) - { - if (fgpixel & 0xf) - { - if (fgbln) - { - dest = rand(); - } - else - { - dest = paldata[fgpixel + 0x600] + paldata[sprpixel + 0x800]; - } - } - else - { - dest = paldata[bgpixel + 0x700] + paldata[sprpixel + 0x800]; - } - } - else - { - dest = paldata[sprpixel]; - } - } - - else if (m_sprpri == 0) - { - if (m_sprbln) - { - dest = rand(); - } - else - { - dest = paldata[sprpixel]; - } - - } - } - else - { - if (fgpixel & 0x0f) - { - if (fgbln) - { - dest = paldata[fgpixel + 0xa00] + paldata[bgpixel + 0x700]; - - } - else - { - dest = paldata[fgpixel + 0x200]; - } - - } - else if (bgpixel & 0x0f) - { - dest = paldata[bgpixel + 0x300]; - } - } - - if (tx[x] & 0xf) { - dest = paldata[tx[x]]; - } - - // draw screen - PutPix(pdst + x * nBurnBpp, DrvPalette[dest & 0xfff]); - } - } -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x1000; i++) - { - INT32 r = (i >> 8) & 0xf; - INT32 g = (i >> 4) & 0xf; - INT32 b = (i >> 0) & 0xf; - - r += r * 16; - g += g * 16; - b += b * 16; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - pBurnDrvPalette = DrvPalette; - - memset (bitmap[2], 0, 256 * 256 * sizeof(UINT16)); // clear sprite bitmap - - if (nBurnLayer & 1) draw_layer(bitmap[0], (UINT16*)DrvVidRAM2, DrvGfxROM1, 0x000, bg_scroll_x, (bg_scroll_y - bg_offset_y) & 0x1ff, -1); - if (nBurnLayer & 2) draw_layer(bitmap[1], (UINT16*)DrvVidRAM1, DrvGfxROM2, 0x000, fg_scroll_x, (fg_scroll_y - fg_offset_y) & 0x1ff, -1); - if (nBurnLayer & 4) gaiden_draw_sprites(sprite_sizey, sproffsety); - if (nBurnLayer & 8) draw_text(0x100,-1); - - mix_bitmaps(Palette, bitmap[0], bitmap[1], pTransDraw, bitmap[2]); - - return 0; -} - -static INT32 DrgnbowlDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i++) { - INT32 rgb = Palette[i]; - - UINT8 r = (rgb >> 8); - UINT8 g = (rgb >> 4) & 0xf; - UINT8 b = (rgb) & 0xf; - - r = (r << 4) | r; - g = (g << 4) | g; - b = (b << 4) | b; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - } - - draw_layer(pTransDraw, (UINT16*)DrvVidRAM2, DrvGfxROM1, 0x300, bg_scroll_x, (bg_scroll_y - 16) & 0x1ff, -1); // no transp - drgnbowl_draw_sprites(0x20); - draw_layer(pTransDraw, (UINT16*)DrvVidRAM1, DrvGfxROM2, 0x200, fg_scroll_x, (fg_scroll_y - 16) & 0x1ff, 0xf); - drgnbowl_draw_sprites(0x00); - draw_text(0, 0x0f); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - { - DrvInputs[0] = DrvInputs[1] = DrvInputs[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nCyclesTotal[2] = { (game == 1 ? 10000000 : 9216000) / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - nCurrentCPU = 1; - if (game == 1) { - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - } else { - BurnTimerUpdate(i * (nCyclesTotal[nCurrentCPU] / nInterleave)); - } - - if (pBurnSoundOut && game == 1) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (game != 1) BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - if (game == 1) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } else { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029523; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - MSM6295Scan(0, nAction); - - if (game == 1) { - BurnYM2151Scan(nAction); - } else { - BurnYM2203Scan(nAction, pnMin); - } - - SCAN_VAR(prot); - SCAN_VAR(jumpcode); - SCAN_VAR(jumppointer); - - SCAN_VAR(tx_scroll_x); - SCAN_VAR(tx_scroll_y); - SCAN_VAR(fg_scroll_x); - SCAN_VAR(fg_scroll_y); - SCAN_VAR(bg_scroll_x); - SCAN_VAR(bg_scroll_y); - - SCAN_VAR(tx_offset_y); - SCAN_VAR(fg_offset_y); - SCAN_VAR(bg_offset_y); - SCAN_VAR(sproffsety); - - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen); - - if (jumppointer) { - jumppoints = jumppoints_other; - } - } - - return 0; -} - - -// Shadow Warriors (World, set 1) - -static struct BurnRomInfo shadowwRomDesc[] = { - { "shadowa_1.3s", 0x20000, 0x8290d567, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "shadowa_2.4s", 0x20000, 0xf3f08921, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gaiden_3.4b", 0x10000, 0x75fd3e6a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "gaiden_5.7a", 0x10000, 0x8d4035f7, 3 | BRF_GRA }, // 3 Characters - - { "14.3a", 0x20000, 0x1ecfddaa, 4 | BRF_GRA }, // 4 Foreground Tiles - { "15.3b", 0x20000, 0x1291a696, 4 | BRF_GRA }, // 5 - { "16.1a", 0x20000, 0x140b47ca, 4 | BRF_GRA }, // 6 - { "17.1b", 0x20000, 0x7638cccb, 4 | BRF_GRA }, // 7 - - { "18.6a", 0x20000, 0x3fadafd6, 5 | BRF_GRA }, // 8 Background Tiles - { "19.6b", 0x20000, 0xddae9d5b, 5 | BRF_GRA }, // 9 - { "20.4b", 0x20000, 0x08cf7a93, 5 | BRF_GRA }, // 10 - { "21.4b", 0x20000, 0x1ac892f5, 5 | BRF_GRA }, // 11 - - { "6.3m", 0x20000, 0xe7ccdf9f, 6 | BRF_GRA }, // 12 Sprites - { "8.3n", 0x20000, 0x7ef7f880, 6 | BRF_GRA }, // 13 - { "10.3r", 0x20000, 0xa6451dec, 6 | BRF_GRA }, // 14 - { "shadoww_12a.xx", 0x10000, 0x9bb07731, 6 | BRF_GRA }, // 15 - { "shadoww_12b.xx", 0x10000, 0xa4a950a2, 6 | BRF_GRA }, // 16 - { "7.1m", 0x20000, 0x016bec95, 6 | BRF_GRA }, // 17 - { "9.1n", 0x20000, 0x6e9b7fd3, 6 | BRF_GRA }, // 18 - { "11.1r", 0x20000, 0x7fbfdf5e, 6 | BRF_GRA }, // 19 - { "shadoww_13a.xx", 0x10000, 0x996d2fa5, 6 | BRF_GRA }, // 20 - { "shadoww_13b.xx", 0x10000, 0xb8df8a34, 6 | BRF_GRA }, // 21 - - { "4.4a", 0x20000, 0xb0e0faf9, 7 | BRF_SND }, // 22 MSM6295 Samples -}; - -STD_ROM_PICK(shadoww) -STD_ROM_FN(shadoww) - -struct BurnDriver BurnDrvShadoww = { - "shadoww", NULL, NULL, NULL, "1988", - "Shadow Warriors (World, set 1)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, shadowwRomInfo, shadowwRomName, NULL, NULL, DrvInputInfo, GaidenDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Shadow Warriors (World, set 2) - -static struct BurnRomInfo shadowwaRomDesc[] = { - { "shadoww_1.3s", 0x20000, 0xfefba387, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "shadoww_2.4s", 0x20000, 0x9b9d6b18, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gaiden_3.4b", 0x10000, 0x75fd3e6a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "gaiden_5.7a", 0x10000, 0x8d4035f7, 3 | BRF_GRA }, // 3 Characters - - { "14.3a", 0x20000, 0x1ecfddaa, 4 | BRF_GRA }, // 4 Foreground Tiles - { "15.3b", 0x20000, 0x1291a696, 4 | BRF_GRA }, // 5 - { "16.1a", 0x20000, 0x140b47ca, 4 | BRF_GRA }, // 6 - { "17.1b", 0x20000, 0x7638cccb, 4 | BRF_GRA }, // 7 - - { "18.6a", 0x20000, 0x3fadafd6, 5 | BRF_GRA }, // 8 Background Tiles - { "19.6b", 0x20000, 0xddae9d5b, 5 | BRF_GRA }, // 9 - { "20.4b", 0x20000, 0x08cf7a93, 5 | BRF_GRA }, // 10 - { "21.4b", 0x20000, 0x1ac892f5, 5 | BRF_GRA }, // 11 - - { "6.3m", 0x20000, 0xe7ccdf9f, 6 | BRF_GRA }, // 12 Sprites - { "8.3n", 0x20000, 0x7ef7f880, 6 | BRF_GRA }, // 13 - { "10.3r", 0x20000, 0xa6451dec, 6 | BRF_GRA }, // 14 - { "shadoww_12a.xx", 0x10000, 0x9bb07731, 6 | BRF_GRA }, // 15 - { "shadoww_12b.xx", 0x10000, 0xa4a950a2, 6 | BRF_GRA }, // 16 - { "7.1m", 0x20000, 0x016bec95, 6 | BRF_GRA }, // 17 - { "9.1n", 0x20000, 0x6e9b7fd3, 6 | BRF_GRA }, // 18 - { "11.1r", 0x20000, 0x7fbfdf5e, 6 | BRF_GRA }, // 19 - { "shadoww_13a.xx", 0x10000, 0x996d2fa5, 6 | BRF_GRA }, // 20 - { "shadoww_13b.xx", 0x10000, 0xb8df8a34, 6 | BRF_GRA }, // 21 - - { "4.4a", 0x20000, 0xb0e0faf9, 7 | BRF_SND }, // 22 MSM6295 Samples -}; - -STD_ROM_PICK(shadowwa) -STD_ROM_FN(shadowwa) - -struct BurnDriver BurnDrvShadowwa = { - "shadowwa", "shadoww", NULL, NULL, "1988", - "Shadow Warriors (World, set 2)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, shadowwaRomInfo, shadowwaRomName, NULL, NULL, DrvInputInfo, GaidenDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Ninja Gaiden (US) - -static struct BurnRomInfo gaidenRomDesc[] = { - { "gaiden_1.3s", 0x20000, 0xe037ff7c, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gaiden_2.4s", 0x20000, 0x454f7314, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gaiden_3.4b", 0x10000, 0x75fd3e6a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "gaiden_5.7a", 0x10000, 0x8d4035f7, 3 | BRF_GRA }, // 3 Characters - - { "14.3a", 0x20000, 0x1ecfddaa, 4 | BRF_GRA }, // 4 Foreground Tiles - { "15.3b", 0x20000, 0x1291a696, 4 | BRF_GRA }, // 5 - { "16.1a", 0x20000, 0x140b47ca, 4 | BRF_GRA }, // 6 - { "17.1b", 0x20000, 0x7638cccb, 4 | BRF_GRA }, // 7 - - { "18.6a", 0x20000, 0x3fadafd6, 5 | BRF_GRA }, // 8 Background Tiles - { "19.6b", 0x20000, 0xddae9d5b, 5 | BRF_GRA }, // 9 - { "20.4b", 0x20000, 0x08cf7a93, 5 | BRF_GRA }, // 10 - { "21.4b", 0x20000, 0x1ac892f5, 5 | BRF_GRA }, // 11 - - { "6.3m", 0x20000, 0xe7ccdf9f, 6 | BRF_GRA }, // 12 Sprites - { "8.3n", 0x20000, 0x7ef7f880, 6 | BRF_GRA }, // 13 - { "10.3r", 0x20000, 0xa6451dec, 6 | BRF_GRA }, // 14 - { "gaiden_12.3s", 0x20000, 0x90f1e13a, 6 | BRF_GRA }, // 15 - { "7.1m", 0x20000, 0x016bec95, 6 | BRF_GRA }, // 16 - { "9.1n", 0x20000, 0x6e9b7fd3, 6 | BRF_GRA }, // 17 - { "11.1r", 0x20000, 0x7fbfdf5e, 6 | BRF_GRA }, // 18 - { "gaiden_13.1s", 0x20000, 0x7d9f5c5e, 6 | BRF_GRA }, // 19 - - { "4.4a", 0x20000, 0xb0e0faf9, 7 | BRF_SND }, // 20 MSM6295 Samples -}; - -STD_ROM_PICK(gaiden) -STD_ROM_FN(gaiden) - -struct BurnDriver BurnDrvGaiden = { - "gaiden", "shadoww", NULL, NULL, "1988", - "Ninja Gaiden (US)\0", NULL, "Tecmo", "Miscellaneous", - L"Ninja \u5916\u4F1D Gaiden (US)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, gaidenRomInfo, gaidenRomName, NULL, NULL, DrvInputInfo, GaidenDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Ninja Ryukenden (Japan, set 1) - -static struct BurnRomInfo ryukendnRomDesc[] = { - { "ryukendn_1.3s", 0x20000, 0x6203a5e2, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ryukendn_2.4s", 0x20000, 0x9e99f522, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "3.4b", 0x10000, 0x6b686b69, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "hn27512p.7a", 0x10000, 0x765e7baa, 3 | BRF_GRA }, // 3 Characters - - { "14.3a", 0x20000, 0x1ecfddaa, 4 | BRF_GRA }, // 4 Foreground Tiles - { "15.3b", 0x20000, 0x1291a696, 4 | BRF_GRA }, // 5 - { "16.1a", 0x20000, 0x140b47ca, 4 | BRF_GRA }, // 6 - { "17.1b", 0x20000, 0x7638cccb, 4 | BRF_GRA }, // 7 - - { "18.6a", 0x20000, 0x3fadafd6, 5 | BRF_GRA }, // 8 Background Tiles - { "19.6b", 0x20000, 0xddae9d5b, 5 | BRF_GRA }, // 9 - { "20.4b", 0x20000, 0x08cf7a93, 5 | BRF_GRA }, // 10 - { "21.4b", 0x20000, 0x1ac892f5, 5 | BRF_GRA }, // 11 - - { "6.3m", 0x20000, 0xe7ccdf9f, 6 | BRF_GRA }, // 12 Sprites - { "8.3n", 0x20000, 0x7ef7f880, 6 | BRF_GRA }, // 13 - { "10.3r", 0x20000, 0xa6451dec, 6 | BRF_GRA }, // 14 - { "shadoww_12a.xx", 0x10000, 0x9bb07731, 6 | BRF_GRA }, // 15 - { "ryukendn_12b.xx",0x10000, 0x1773628a, 6 | BRF_GRA }, // 16 - { "7.1m", 0x20000, 0x016bec95, 6 | BRF_GRA }, // 17 - { "9.1n", 0x20000, 0x6e9b7fd3, 6 | BRF_GRA }, // 18 - { "11.1r", 0x20000, 0x7fbfdf5e, 6 | BRF_GRA }, // 19 - { "shadoww_13a.xx", 0x10000, 0x996d2fa5, 6 | BRF_GRA }, // 20 - { "ryukendn_13b.xx",0x10000, 0x1f43c507, 6 | BRF_GRA }, // 21 - - { "4.4a", 0x20000, 0xb0e0faf9, 7 | BRF_SND }, // 22 MSM6295 Samples -}; - -STD_ROM_PICK(ryukendn) -STD_ROM_FN(ryukendn) - -struct BurnDriver BurnDrvRyukendn = { - "ryukendn", "shadoww", NULL, NULL, "1989", - "Ninja Ryukenden (Japan, set 1)\0", NULL, "Tecmo", "Miscellaneous", - L"\u5FCD\u8005 \u9F8D\u5263\u4F1D (Japan, set 1)\0Ninja Ryukenden\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, ryukendnRomInfo, ryukendnRomName, NULL, NULL, DrvInputInfo, GaidenDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Ninja Ryukenden (Japan, set 2) - -static struct BurnRomInfo ryukendnaRomDesc[] = { - { "1.3s", 0x20000, 0x5532e302, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2.4s", 0x20000, 0xa93a8256, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "3.4b", 0x10000, 0x6b686b69, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "hn27512p.7a", 0x10000, 0x765e7baa, 3 | BRF_GRA }, // 3 Characters - - { "14.3a", 0x20000, 0x1ecfddaa, 4 | BRF_GRA }, // 4 Foreground Tiles - { "15.3b", 0x20000, 0x1291a696, 4 | BRF_GRA }, // 5 - { "16.1a", 0x20000, 0x140b47ca, 4 | BRF_GRA }, // 6 - { "17.1b", 0x20000, 0x7638cccb, 4 | BRF_GRA }, // 7 - - { "18.6a", 0x20000, 0x3fadafd6, 5 | BRF_GRA }, // 8 Background Tiles - { "19.6b", 0x20000, 0xddae9d5b, 5 | BRF_GRA }, // 9 - { "20.4b", 0x20000, 0x08cf7a93, 5 | BRF_GRA }, // 10 - { "21.4b", 0x20000, 0x1ac892f5, 5 | BRF_GRA }, // 11 - - { "6.3m", 0x20000, 0xe7ccdf9f, 6 | BRF_GRA }, // 12 Sprites - { "8.3n", 0x20000, 0x7ef7f880, 6 | BRF_GRA }, // 13 - { "10.3r", 0x20000, 0xa6451dec, 6 | BRF_GRA }, // 14 - { "12.3s", 0x20000, 0x277204f0, 6 | BRF_GRA }, // 15 - { "7.1m", 0x20000, 0x016bec95, 6 | BRF_GRA }, // 16 - { "9.1n", 0x20000, 0x6e9b7fd3, 6 | BRF_GRA }, // 17 - { "11.1r", 0x20000, 0x7fbfdf5e, 6 | BRF_GRA }, // 18 - { "13.1s", 0x20000, 0x4e56a508, 6 | BRF_GRA }, // 19 - - { "4.4a", 0x20000, 0xb0e0faf9, 7 | BRF_SND }, // 20 MSM6295 Samples -}; - -STD_ROM_PICK(ryukendna) -STD_ROM_FN(ryukendna) - -struct BurnDriver BurnDrvRyukendna = { - "ryukendna", "shadoww", NULL, NULL, "1989", - "Ninja Ryukenden (Japan, set 2)\0", NULL, "Tecmo", "Miscellaneous", - L"\u5FCD\u8005 \u9F8D\u5263\u4F1D (Japan, set 2)\0Ninja Ryukenden\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, ryukendnaRomInfo, ryukendnaRomName, NULL, NULL, DrvInputInfo, GaidenDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Wild Fang / Tecmo Knight - -static struct BurnRomInfo wildfangRomDesc[] = { - { "1.3st", 0x20000, 0xab876c9b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2.5st", 0x20000, 0x1dc74b3b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tkni3.bin", 0x10000, 0x15623ec7, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "tkni5.bin", 0x10000, 0x5ed15896, 3 | BRF_GRA }, // 3 Characters - - { "14.3a", 0x20000, 0x0d20c10c, 4 | BRF_GRA }, // 4 Foreground Tiles - { "15.3b", 0x20000, 0x3f40a6b4, 4 | BRF_GRA }, // 5 - { "16.1a", 0x20000, 0x0f31639e, 4 | BRF_GRA }, // 6 - { "17.1b", 0x20000, 0xf32c158e, 4 | BRF_GRA }, // 7 - - { "tkni6.bin", 0x80000, 0xf68fafb1, 5 | BRF_GRA }, // 8 - - { "tkni9.bin", 0x80000, 0xd22f4239, 6 | BRF_GRA }, // 9 Sprites - { "tkni8.bin", 0x80000, 0x4931b184, 6 | BRF_GRA }, // 10 - - { "tkni4.bin", 0x20000, 0xa7a1dbcf, 7 | BRF_SND }, // 11 MSM6295 Samples - - { "a-6v.mcu", 0x01000, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(wildfang) -STD_ROM_FN(wildfang) - -struct BurnDriver BurnDrvWildfang = { - "wildfang", NULL, NULL, NULL, "1989", - "Wild Fang / Tecmo Knight\0", NULL, "Tecmo", "Miscellaneous", - L"Wild Fang\0Tecmo Knight\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, wildfangRomInfo, wildfangRomName, NULL, NULL, DrvInputInfo, WildfangDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Tecmo Knight - -static struct BurnRomInfo tknightRomDesc[] = { - { "tkni1.bin", 0x20000, 0x9121daa8, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tkni2.bin", 0x20000, 0x6669cd87, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tkni3.bin", 0x10000, 0x15623ec7, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "tkni5.bin", 0x10000, 0x5ed15896, 3 | BRF_GRA }, // 3 Characters - - { "tkni7.bin", 0x80000, 0x4b4d4286, 4 | BRF_GRA }, // 4 Foreground Tiles - - { "tkni6.bin", 0x80000, 0xf68fafb1, 5 | BRF_GRA }, // 5 - - { "tkni9.bin", 0x80000, 0xd22f4239, 6 | BRF_GRA }, // 6 Sprites - { "tkni8.bin", 0x80000, 0x4931b184, 6 | BRF_GRA }, // 7 - - { "tkni4.bin", 0x20000, 0xa7a1dbcf, 7 | BRF_SND }, // 8 MSM6295 Samples - - { "a-6v.mcu", 0x01000, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(tknight) -STD_ROM_FN(tknight) - -struct BurnDriver BurnDrvTknight = { - "tknight", "wildfang", NULL, NULL, "1989", - "Tecmo Knight\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, tknightRomInfo, tknightRomName, NULL, NULL, DrvInputInfo, TknightDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Raiga - Strato Fighter (US) - -static struct BurnRomInfo stratofRomDesc[] = { - { "1.3s", 0x20000, 0x060822a4, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2.4s", 0x20000, 0x339358fa, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a-4b.3", 0x10000, 0x18655c95, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "b-7a.5", 0x10000, 0x6d2e4bf1, 3 | BRF_GRA }, // 3 Characters - - { "b-1b", 0x80000, 0x781d1bd2, 4 | BRF_GRA }, // 4 Foreground Tiles - - { "b-4b", 0x80000, 0x89468b84, 5 | BRF_GRA }, // 5 - - { "b-2m", 0x80000, 0x5794ec32, 6 | BRF_GRA }, // 6 Sprites - { "b-1m", 0x80000, 0xb0de0ded, 6 | BRF_GRA }, // 7 - - { "a-4a.4", 0x20000, 0xef9acdcf, 7 | BRF_SND }, // 8 MSM6295 Samples - - { "a-6v.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 9 MCU -}; - -STD_ROM_PICK(stratof) -STD_ROM_FN(stratof) - -static INT32 stratofInit() -{ - game = 2; - sprite_sizey = 2; - - return DrvInit(); -} - -struct BurnDriver BurnDrvStratof = { - "stratof", NULL, NULL, NULL, "1991", - "Raiga - Strato Fighter (US)\0", NULL, "Tecmo", "Miscellaneous", - L"\u96F7\u7259 Strato Fighter (US)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, stratofRomInfo, stratofRomName, NULL, NULL, RaigaInputInfo, RaigaDIPInfo, - stratofInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Raiga - Strato Fighter (Japan) - -static struct BurnRomInfo raigaRomDesc[] = { - { "a-3s.1", 0x20000, 0x303c2a6c, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "a-4s.2", 0x20000, 0x5f31fecb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a-4b.3", 0x10000, 0x18655c95, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "b-7a.5", 0x10000, 0x6d2e4bf1, 3 | BRF_GRA }, // 3 Characters - - { "b-1b", 0x80000, 0x781d1bd2, 4 | BRF_GRA }, // 4 Foreground Tiles - - { "b-4b", 0x80000, 0x89468b84, 5 | BRF_GRA }, // 5 - - { "b-2m", 0x80000, 0x5794ec32, 6 | BRF_GRA }, // 6 Sprites - { "b-1m", 0x80000, 0xb0de0ded, 6 | BRF_GRA }, // 7 - - { "a-4a.4", 0x20000, 0xef9acdcf, 7 | BRF_SND }, // 8 MSM6295 Samples - - { "a-6v.mcu", 0x01000, 0x00000000, 0 | BRF_NODUMP }, // 9 MCU -}; - -STD_ROM_PICK(raiga) -STD_ROM_FN(raiga) - -struct BurnDriver BurnDrvRaiga = { - "raiga", "stratof", NULL, NULL, "1991", - "Raiga - Strato Fighter (Japan)\0", NULL, "Tecmo", "Miscellaneous", - L"\u96F7\u7259 Strato Fighter (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, raigaRomInfo, raigaRomName, NULL, NULL, RaigaInputInfo, RaigaDIPInfo, - stratofInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Dragon Bowl - -static struct BurnRomInfo drgnbowlRomDesc[] = { - { "4.3h", 0x20000, 0x90730008, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "5.4h", 0x20000, 0x193cc915, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.2r", 0x10000, 0xd9cbf84a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "22.6m", 0x10000, 0x86e41198, 3 | BRF_GRA }, // 3 Characters - - { "6.5a", 0x20000, 0xb15759f7, 4 | BRF_GRA }, // 4 Foreground & Background Tiles - { "7.5b", 0x20000, 0x2541d445, 4 | BRF_GRA }, // 5 - { "8.6a", 0x20000, 0x51a2f5c4, 4 | BRF_GRA }, // 6 - { "9.6b", 0x20000, 0xf4c8850f, 4 | BRF_GRA }, // 7 - { "10.7a", 0x20000, 0x9e4b3c61, 4 | BRF_GRA }, // 8 - { "11.7b", 0x20000, 0x0d33d083, 4 | BRF_GRA }, // 9 - { "12.8a", 0x20000, 0x6c497ad3, 4 | BRF_GRA }, // 10 - { "13.8b", 0x20000, 0x7a84adff, 4 | BRF_GRA }, // 11 - - { "21.8r", 0x20000, 0x0cee8711, 6 | BRF_GRA }, // 18 Sprites - { "20.8q", 0x20000, 0x9647e02a, 6 | BRF_GRA }, // 19 - { "19.7r", 0x20000, 0x5082ceff, 6 | BRF_GRA }, // 16 - { "18.7q", 0x20000, 0xd18a7ffb, 6 | BRF_GRA }, // 17 - { "17.6r", 0x20000, 0x9088af09, 6 | BRF_GRA }, // 14 - { "16.6q", 0x20000, 0x8ade4e01, 6 | BRF_GRA }, // 15 - { "15.5r", 0x20000, 0x7429371c, 6 | BRF_GRA }, // 12 - { "14.5q", 0x20000, 0x4301b97f, 6 | BRF_GRA }, // 13 - - { "3.3q", 0x20000, 0x489c6d0e, 7 | BRF_SND }, // 20 MSM6295 Samples - { "2.3r", 0x20000, 0x7710ce39, 7 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(drgnbowl) -STD_ROM_FN(drgnbowl) - -static INT32 drgnbowlInit() -{ - game = 1; - - INT32 nRet = DrvInit(); - - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -struct BurnDriver BurnDrvDrgnbowl = { - "drgnbowl", NULL, NULL, NULL, "1992", - "Dragon Bowl\0", NULL, "Nics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, drgnbowlRomInfo, drgnbowlRomName, NULL, NULL, DrvInputInfo, DrgnbowlDIPInfo, - drgnbowlInit, DrvExit, DrvFrame, DrgnbowlDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Dragon Bowl (set 2, unencrypted program) - -static struct BurnRomInfo drgnbowlaRomDesc[] = { - { "dbowl_4.u4", 0x20000, 0x58d69235, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "dbowl_5.u3", 0x20000, 0xe3176ebb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.2r", 0x10000, 0xd9cbf84a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "22.6m", 0x10000, 0x86e41198, 3 | BRF_GRA }, // 3 Characters - - { "6.5a", 0x20000, 0xb15759f7, 4 | BRF_GRA }, // 4 Foreground & Background Tiles - { "7.5b", 0x20000, 0x2541d445, 4 | BRF_GRA }, // 5 - { "8.6a", 0x20000, 0x51a2f5c4, 4 | BRF_GRA }, // 6 - { "9.6b", 0x20000, 0xf4c8850f, 4 | BRF_GRA }, // 7 - { "10.7a", 0x20000, 0x9e4b3c61, 4 | BRF_GRA }, // 8 - { "11.7b", 0x20000, 0x0d33d083, 4 | BRF_GRA }, // 9 - { "12.8a", 0x20000, 0x6c497ad3, 4 | BRF_GRA }, // 10 - { "13.8b", 0x20000, 0x7a84adff, 4 | BRF_GRA }, // 11 - - { "21.8r", 0x20000, 0x0cee8711, 6 | BRF_GRA }, // 18 Sprites - { "20.8q", 0x20000, 0x9647e02a, 6 | BRF_GRA }, // 19 - { "19.7r", 0x20000, 0x5082ceff, 6 | BRF_GRA }, // 16 - { "18.7q", 0x20000, 0xd18a7ffb, 6 | BRF_GRA }, // 17 - { "17.6r", 0x20000, 0x9088af09, 6 | BRF_GRA }, // 14 - { "16.6q", 0x20000, 0x8ade4e01, 6 | BRF_GRA }, // 15 - { "15.5r", 0x20000, 0x7429371c, 6 | BRF_GRA }, // 12 - { "14.5q", 0x20000, 0x4301b97f, 6 | BRF_GRA }, // 13 - - { "3.3q", 0x20000, 0x489c6d0e, 7 | BRF_SND }, // 20 MSM6295 Samples - { "2.3r", 0x20000, 0x7710ce39, 7 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(drgnbowla) -STD_ROM_FN(drgnbowla) - -static INT32 drgnbowlaInit() -{ - game = 3; - - INT32 nRet = DrvInit(); - - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -struct BurnDriver BurnDrvDrgnbowla = { - "drgnbowla", "drgnbowl", NULL, NULL, "1992", - "Dragon Bowl (set 2, unencrypted program)\0", NULL, "Nics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, drgnbowlaRomInfo, drgnbowlaRomName, NULL, NULL, DrvInputInfo, DrgnbowlDIPInfo, - drgnbowlaInit, DrvExit, DrvFrame, DrgnbowlDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_galpanic.cpp b/jan/src/burn/drv/pst90s/d_galpanic.cpp deleted file mode 100644 index c0876a982..000000000 --- a/jan/src/burn/drv/pst90s/d_galpanic.cpp +++ /dev/null @@ -1,2380 +0,0 @@ -/* - * Gals Panic (set 1) driver for FB Alpha 0.2.96.71 - * Based on MAME driver by Nicola Salmoria - * Port by OopsWare. 2007 - */ - -#include "burnint.h" -#include "m68000_intf.h" -#include "driver.h" - -#include "msm6295.h" - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; - -static UINT8 *Rom68K; -static UINT8 *RomGfx; -static UINT8 *DeRomGfx; -static UINT8 *RomSnd; - -static UINT16 *Ram68K; -static UINT16 *RamPal; -static UINT16 *RamFg; -static UINT16 *RamBg; -static UINT16 *RamSpr; -static UINT16 *RamBgM; - -static UINT32 *RamCurPal; -static UINT32 *RamCTB64k; - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 DrvReset = 0; -//static UINT16 GalPanicCoin = 0; - -UINT8 RecalcBgPalette; - -static INT32 nCyclesDone[1], nCyclesTotal[1]; -static INT32 nCyclesSegment; -static INT32 SndBank; - -static struct BurnInputInfo GalpanicInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 2, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 0, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 3, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 1, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvButton + 6, "service"}, - {"Tilt", BIT_DIGITAL, DrvButton + 5, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 2, "dip"}, -}; - -STDINPUTINFO(Galpanic) - -static struct BurnInputInfo GalhustlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 2, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 0, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 3, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 1, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 2, "dip"}, -}; - -STDINPUTINFO(Galhustl) - -inline void ComadClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static struct BurnDIPInfo GalpanicDIPList[] = { - - // Defaults - {0x11, 0xFF, 0xFF, 0x00, NULL}, - {0x12, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Service mode"}, - {0x11, 0x01, 0x04, 0x00, "Off"}, - {0x11, 0x01, 0x04, 0x04, "On"}, - {0, 0xFE, 0, 4, "Coin 1"}, - {0x11, 0x01, 0x30, 0x00, "1 coin 1 credit"}, - {0x11, 0x01, 0x30, 0x10, "2 coins 1 credit"}, - {0x11, 0x01, 0x30, 0x20, "3 coins 1 credit"}, - {0x11, 0x01, 0x30, 0x30, "4 coins 1 credit"}, - {0, 0xFE, 0, 4, "Coin 2"}, - {0x11, 0x01, 0xC0, 0x00, "1 coin 2 credits"}, - {0x11, 0x01, 0xC0, 0x40, "1 coin 3 credits"}, - {0x11, 0x01, 0xC0, 0x80, "1 coin 4 credits"}, - {0x11, 0x01, 0xC0, 0xC0, "1 coin 6 credits"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Difficulty"}, - {0x12, 0x01, 0x03, 0x00, "Normal"}, - {0x12, 0x01, 0x03, 0x01, "Easy"}, - {0x12, 0x01, 0x03, 0x02, "Hard"}, - {0x12, 0x01, 0x03, 0x03, "Hardest"}, - {0, 0xFE, 0, 4, "Lives"}, - {0x12, 0x01, 0x30, 0x00, "3"}, - {0x12, 0x01, 0x30, 0x10, "4"}, - {0x12, 0x01, 0x30, 0x20, "2"}, - {0x12, 0x01, 0x30, 0x30, "5"}, -// {0, 0xFE, 0, 2, "Unknown"}, // demo sounds? -// {0x12, 0x01, 0x40, 0x00, "Off"}, -// {0x12, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Character test"}, - {0x12, 0x01, 0x80, 0x00, "Off"}, - {0x12, 0x01, 0x80, 0x80, "On"}, -}; - -STDDIPINFO(Galpanic) - -static struct BurnDIPInfo ComadDIPList[] = { - - // Defaults - {0x11, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 4, "Difficulty"}, - {0x11, 0x01, 0x03, 0x01, "Easy"}, - {0x11, 0x01, 0x03, 0x00, "Normal"}, - {0x11, 0x01, 0x03, 0x02, "Hard"}, - {0x11, 0x01, 0x03, 0x03, "Hardest"}, -// {0, 0xFE, 0, 2, "Unknown"}, // freeze/vblank? -// {0x11, 0x01, 0x08, 0x00, "Off"}, -// {0x11, 0x01, 0x08, 0x08, "On"}, - {0, 0xFE, 0, 4, "Lives"}, - {0x11, 0x01, 0x30, 0x20, "2"}, - {0x11, 0x01, 0x30, 0x00, "3"}, - {0x11, 0x01, 0x30, 0x10, "4"}, - {0x11, 0x01, 0x30, 0x30, "5"}, - {0, 0xFE, 0, 2, "Demo sounds"}, - {0x11, 0x01, 0x40, 0x40, "Off"}, - {0x11, 0x01, 0x40, 0x00, "On"}, -}; - -static struct BurnDIPInfo FantasiaDIPList[] = { - - // Defaults - {0x12, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 2 - {0, 0xFE, 0, 2, "Service mode"}, - {0x12, 0x01, 0x04, 0x00, "Off"}, - {0x12, 0x01, 0x04, 0x04, "On"}, - {0, 0xFE, 0, 2, "Coin mode"}, - {0x12, 0x01, 0x08, 0x00, "Mode 1"}, - {0x12, 0x01, 0x08, 0x08, "Mode 2"}, - // Coin mode 1 condition - {0, 0xFE, 0, 4, "Coin 1"}, - {0x12, 0x02, 0x30, 0x00, "1 coin 1 credit"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0x30, 0x10, "2 coins 1 credit"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0x30, 0x20, "1 coin 2 credits"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0x30, 0x30, "1 coin 6 credits"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0, 0xFE, 0, 4, "Coin 2"}, - {0x12, 0x02, 0xC0, 0x00, "1 coin 1 credit"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0xC0, 0x40, "2 coins 1 credit"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0xC0, 0x80, "1 coin 2 credits"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0xC0, 0xC0, "1 coin 6 credits"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - // Coin mode 2 condition - {0, 0xFE, 0, 4, "Coin 1"}, - {0x12, 0x02, 0x30, 0x00, "1 coin 1 credit"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0x30, 0x10, "2 coins 1 credit"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0x30, 0x20, "1 coin 3 credits"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0x30, 0x30, "1 coin 4 credits"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0, 0xFE, 0, 4, "Coin 2"}, - {0x12, 0x02, 0xC0, 0x00, "1 coin 1 credit"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0xC0, 0x40, "2 coins 1 credit"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0xC0, 0x80, "1 coin 3 credits"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0xC0, 0xC0, "1 coin 4 credits"}, - {0x12, 0x00, 0x08, 0x08, NULL}, -}; - -static struct BurnDIPInfo Missw96DIPList[] = { - - // Defaults - {0x12, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 2 - {0, 0xFE, 0, 2, "Coin mode"}, - {0x12, 0x01, 0x08, 0x00, "Mode 1"}, - {0x12, 0x01, 0x08, 0x08, "Mode 2"}, - // Coin mode 1 condition - {0, 0xFE, 0, 4, "Coin 1"}, - {0x12, 0x02, 0x30, 0x00, "1 coin 1 credit"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0x30, 0x10, "2 coins 1 credit"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0x30, 0x20, "1 coin 2 credits"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0x30, 0x30, "1 coin 6 credits"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0, 0xFE, 0, 4, "Coin 2"}, - {0x12, 0x02, 0xC0, 0x00, "1 coin 1 credit"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0xC0, 0x40, "2 coins 1 credit"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0xC0, 0x80, "1 coin 2 credits"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - {0x12, 0x02, 0xC0, 0xC0, "1 coin 6 credits"}, - {0x12, 0x00, 0x08, 0x00, NULL}, - // Coin mode 2 condition - {0, 0xFE, 0, 4, "Coin 1"}, - {0x12, 0x02, 0x30, 0x00, "1 coin 1 credit"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0x30, 0x10, "2 coins 1 credit"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0x30, 0x20, "1 coin 3 credits"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0x30, 0x30, "1 coin 4 credits"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0, 0xFE, 0, 4, "Coin 2"}, - {0x12, 0x02, 0xC0, 0x00, "1 coin 1 credit"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0xC0, 0x40, "2 coins 1 credit"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0xC0, 0x80, "1 coin 3 credits"}, - {0x12, 0x00, 0x08, 0x08, NULL}, - {0x12, 0x02, 0xC0, 0xC0, "1 coin 4 credits"}, - {0x12, 0x00, 0x08, 0x08, NULL}, -}; - -STDDIPINFOEXT(Fantasia, Comad, Fantasia) -STDDIPINFOEXT(Missw96, Comad, Missw96) - -static struct BurnDIPInfo GalhustlDIPList[] = { - - // Defaults - {0x13, 0xFF, 0xFF, 0x00, NULL}, - {0x14, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 4, "Lives"}, - {0x13, 0x01, 0x03, 0x03, "6"}, - {0x13, 0x01, 0x03, 0x02, "7"}, - {0x13, 0x01, 0x03, 0x00, "8"}, - {0x13, 0x01, 0x03, 0x01, "10"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x13, 0x01, 0x40, 0x40, "Off"}, - {0x13, 0x01, 0x40, 0x00, "On"}, - {0, 0xFE, 0, 2, "Service mode"}, - {0x13, 0x01, 0x80, 0x00, "Off"}, - {0x13, 0x01, 0x80, 0x80, "On"}, - - // DIP 2 - {0, 0xFE, 0, 8, "Coinage"}, - {0x14, 0x01, 0x07, 0x00, "1 coin 1 credit"}, - {0x14, 0x01, 0x07, 0x01, "1 coin 2 credits"}, - {0x14, 0x01, 0x07, 0x02, "1 coin 3 credits"}, - {0x14, 0x01, 0x07, 0x03, "3 coins 2 credits"}, - {0x14, 0x01, 0x07, 0x04, "2 coins 3 credits"}, - {0x14, 0x01, 0x07, 0x05, "2 coins 1 credit"}, - {0x14, 0x01, 0x07, 0x06, "3 coins 1 credit"}, - {0x14, 0x01, 0x07, 0x07, "4 coins 1 credit"}, - {0, 0xFE, 0, 4, "Difficulty"}, - {0x14, 0x01, 0x18, 0x08, "Easy"}, - {0x14, 0x01, 0x18, 0x00, "Normal"}, - {0x14, 0x01, 0x18, 0x10, "Hard"}, - {0x14, 0x01, 0x18, 0x18, "Hardest"}, - {0, 0xFE, 0, 4, "Play time"}, - {0x14, 0x01, 0x60, 0x60, "70 Sec"}, - {0x14, 0x01, 0x60, 0x40, "80 Sec"}, - {0x14, 0x01, 0x60, 0x00, "100 Sec"}, - {0x14, 0x01, 0x60, 0x20, "120 Sec"}, -}; - -STDDIPINFO(Galhustl) - -static struct BurnDIPInfo ZipzapDIPList[] = { - - // Defaults - {0x13, 0xFF, 0xFF, 0x00, NULL}, - {0x14, 0xFF, 0xFF, 0x10, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Additional obsticals"}, - {0x13, 0x01, 0x02, 0x00, "Off"}, - {0x13, 0x01, 0x02, 0x02, "On"}, - {0, 0xFE, 0, 4, "Lives"}, - {0x13, 0x01, 0x0C, 0x0C, "1"}, - {0x13, 0x01, 0x0C, 0x04, "2"}, - {0x13, 0x01, 0x0C, 0x00, "3"}, - {0x13, 0x01, 0x0C, 0x08, "4"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Coinage"}, - {0x14, 0x01, 0x03, 0x00, "1 coin 1 credit"}, - {0x14, 0x01, 0x03, 0x01, "1 coin 2 credits"}, - {0x14, 0x01, 0x03, 0x02, "2 coins 1 credit"}, - {0x14, 0x01, 0x03, 0x03, "3 coins 1 credit"}, - {0, 0xFE, 0, 2, "Select player mode"}, - {0x14, 0x01, 0x04, 0x04, "Off"}, - {0x14, 0x01, 0x04, 0x00, "On"}, - {0, 0xFE, 0, 2, "Demo sounds"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - {0x14, 0x01, 0x08, 0x00, "On"}, -}; - -STDDIPINFO(Zipzap) - -// Rom information -static struct BurnRomInfo GalpanicRomDesc[] = { - { "pm110.4m2", 0x080000, 0xae6b17a8, BRF_ESS | BRF_PRG }, // 68000 code - { "pm109.4m1", 0x080000, 0xb85d792d, BRF_ESS | BRF_PRG }, - { "pm112.subic6", 0x020000, 0x7b972b58, BRF_ESS | BRF_PRG }, - { "pm111.subic5", 0x020000, 0x4eb7298d, BRF_ESS | BRF_PRG }, - { "pm004e.8", 0x080000, 0xd3af52bc, BRF_ESS | BRF_PRG }, - { "pm005e.7", 0x080000, 0xd7ec650c, BRF_ESS | BRF_PRG }, - { "pm000e.15", 0x080000, 0x5d220f3f, BRF_ESS | BRF_PRG }, - { "pm001e.14", 0x080000, 0x90433eb1, BRF_ESS | BRF_PRG }, - { "pm002e.17", 0x080000, 0x713ee898, BRF_ESS | BRF_PRG }, - { "pm003e.16", 0x080000, 0x6bb060fd, BRF_ESS | BRF_PRG }, - - { "pm006e.67", 0x100000, 0x57aec037, BRF_GRA }, // graphics - - { "pm008e.l", 0x080000, 0xd9379ba8, BRF_SND }, // PCM - { "pm007e.u", 0x080000, 0xc7ed7950, BRF_SND }, -}; - -STD_ROM_PICK(Galpanic) -STD_ROM_FN(Galpanic) - -// Rom information -static struct BurnRomInfo FantasiaRomDesc[] = { - { "16.pro2", 0x080000, 0xe27c6c57, BRF_ESS | BRF_PRG }, // 68000 code - { "13.pro1", 0x080000, 0x68d27413, BRF_ESS | BRF_PRG }, - { "9.fg_ind87", 0x080000, 0x2a588393, BRF_ESS | BRF_PRG }, - { "5.fg_ind83", 0x080000, 0x6160e0f0, BRF_ESS | BRF_PRG }, - { "8.fg_ind86", 0x080000, 0xf776b743, BRF_ESS | BRF_PRG }, - { "4.fg_ind82", 0x080000, 0x5df0dff2, BRF_ESS | BRF_PRG }, - { "7.fg_ind85", 0x080000, 0x5707d861, BRF_ESS | BRF_PRG }, - { "3.fg_ind81", 0x080000, 0x36cb811a, BRF_ESS | BRF_PRG }, - { "10.imag2", 0x080000, 0x1f14a395, BRF_ESS | BRF_PRG }, - { "6.imag1", 0x080000, 0xfaf870e4, BRF_ESS | BRF_PRG }, - - { "17.scr3", 0x080000, 0xaadb6eb7, BRF_GRA }, // graphics - - { "2.music1", 0x080000, 0x22955efb, BRF_SND }, // PCM - { "1.music2", 0x080000, 0x4cd4d6c3, BRF_SND }, - - { "15.obj3", 0x080000, 0x46666768, BRF_OPT }, // unknown - { "12.obj1", 0x080000, 0x4bd25be6, BRF_OPT }, - { "14.obj4", 0x080000, 0x4e7e6ed4, BRF_OPT }, - { "11.obj2", 0x080000, 0x6d00a4c5, BRF_OPT }, -}; - -STD_ROM_PICK(Fantasia) -STD_ROM_FN(Fantasia) - -// Rom information -static struct BurnRomInfo FantasiaaRomDesc[] = { - { "prog2_16.ue17", 0x080000, 0x0b41ad10, BRF_ESS | BRF_PRG }, // 68000 code - { "prog1_13.ud17", 0x080000, 0xa3748726, BRF_ESS | BRF_PRG }, - { "i-scr6_9.ue16b", 0x080000, 0x2a588393, BRF_ESS | BRF_PRG }, - { "i-scr5_5.ue16a", 0x080000, 0x6160e0f0, BRF_ESS | BRF_PRG }, - { "i-scr4_8.ue15b", 0x080000, 0xf776b743, BRF_ESS | BRF_PRG }, - { "i-scr3_4.ue15a", 0x080000, 0x5df0dff2, BRF_ESS | BRF_PRG }, - { "i-scr2_7.ue14b", 0x080000, 0x5707d861, BRF_ESS | BRF_PRG }, - { "i-scr1_3.ue14a", 0x080000, 0x36cb811a, BRF_ESS | BRF_PRG }, - { "imag2_10.ue20b", 0x080000, 0x1f14a395, BRF_ESS | BRF_PRG }, - { "imag1_6.ue20a", 0x080000, 0xfaf870e4, BRF_ESS | BRF_PRG }, - - { "obj1_17.u5", 0x080000, 0xaadb6eb7, BRF_GRA }, // graphics - - { "music1_1.ub6", 0x080000, 0xaf0be817, BRF_SND }, // PCM - { "music2_2.uc6", 0x080000, 0x4cd4d6c3, BRF_SND }, - - { "g-scr2_15.ul16b", 0x080000, 0x46666768, BRF_OPT }, // unknown - { "g-scr1_12.ul16a", 0x080000, 0x4bd25be6, BRF_OPT }, - { "g-scr4_14.ul19b", 0x080000, 0x4e7e6ed4, BRF_OPT }, - { "g-scr3_11.ul19a", 0x080000, 0x6d00a4c5, BRF_OPT }, -}; - -STD_ROM_PICK(Fantasiaa) -STD_ROM_FN(Fantasiaa) - -// Rom information -static struct BurnRomInfo FantasiabRomDesc[] = { - { "fantasia_16", 0x080000, 0xc5d93077, BRF_ESS | BRF_PRG }, // 68000 code - { "fantasia_13", 0x080000, 0xd88529bd, BRF_ESS | BRF_PRG }, - { "9.fg_ind87", 0x080000, 0x2a588393, BRF_ESS | BRF_PRG }, - { "5.fg_ind83", 0x080000, 0x6160e0f0, BRF_ESS | BRF_PRG }, - { "8.fg_ind86", 0x080000, 0xf776b743, BRF_ESS | BRF_PRG }, - { "4.fg_ind82", 0x080000, 0x5df0dff2, BRF_ESS | BRF_PRG }, - { "7.fg_ind85", 0x080000, 0x5707d861, BRF_ESS | BRF_PRG }, - { "3.fg_ind81", 0x080000, 0x36cb811a, BRF_ESS | BRF_PRG }, - { "10.imag2", 0x080000, 0x1f14a395, BRF_ESS | BRF_PRG }, - { "6.imag1", 0x080000, 0xfaf870e4, BRF_ESS | BRF_PRG }, - - { "17.scr3", 0x080000, 0xaadb6eb7, BRF_GRA }, // graphics - - { "2.music1", 0x080000, 0x22955efb, BRF_SND }, // PCM - { "1.music2", 0x080000, 0x4cd4d6c3, BRF_SND }, - - { "15.obj3", 0x080000, 0x46666768, BRF_OPT }, // unknown - { "12.obj1", 0x080000, 0x4bd25be6, BRF_OPT }, - { "14.obj4", 0x080000, 0x4e7e6ed4, BRF_OPT }, - { "11.obj2", 0x080000, 0x6d00a4c5, BRF_OPT }, -}; - -STD_ROM_PICK(Fantasiab) -STD_ROM_FN(Fantasiab) - -// Rom information -static struct BurnRomInfo FantasianRomDesc[] = { - { "prog2_12.ue17", 0x080000, 0x8bb70be1, BRF_ESS | BRF_PRG }, // 68000 code - { "prog1_7.ud17", 0x080000, 0xd1616a3e, BRF_ESS | BRF_PRG }, - { "i-scr2_10.ue16b", 0x080000, 0x2a588393, BRF_ESS | BRF_PRG }, - { "i-scr1_5.ue16a", 0x080000, 0x6160e0f0, BRF_ESS | BRF_PRG }, - { "i-scr4_9.ue15b", 0x080000, 0xf776b743, BRF_ESS | BRF_PRG }, - { "i-scr3_4.ue15a", 0x080000, 0x5df0dff2, BRF_ESS | BRF_PRG }, - { "i-scr6_8.ue14b", 0x080000, 0x5707d861, BRF_ESS | BRF_PRG }, - { "i-scr5_3.ue14a", 0x080000, 0x36cb811a, BRF_ESS | BRF_PRG }, - { "i-scr8_11.ue20b", 0x080000, 0x1f14a395, BRF_ESS | BRF_PRG }, - { "i-scr7_6.ue20a", 0x080000, 0xfaf870e4, BRF_ESS | BRF_PRG }, - - { "obj1_13.u5", 0x080000, 0xf99751f5, BRF_GRA }, // graphics - - { "music1_1.ub6", 0x080000, 0x22955efb, BRF_SND }, // PCM - { "music2_2.uc6", 0x080000, 0x4cd4d6c3, BRF_SND }, -}; - -STD_ROM_PICK(Fantasian) -STD_ROM_FN(Fantasian) - -// Rom information -static struct BurnRomInfo SupmodelRomDesc[] = { - { "prog2.12", 0x080000, 0x714b7e74, BRF_ESS | BRF_PRG }, // 68000 code - { "prog1.7", 0x080000, 0x0bb858de, BRF_ESS | BRF_PRG }, - { "i-scr2.10", 0x080000, 0xd07ec0ce, BRF_ESS | BRF_PRG }, - { "i-scr1.5", 0x080000, 0xa96a8bde, BRF_ESS | BRF_PRG }, - { "i-scr4.9", 0x080000, 0xe959cab5, BRF_ESS | BRF_PRG }, - { "i-scr3.4", 0x080000, 0x4bf5e082, BRF_ESS | BRF_PRG }, - { "i-scr6.8", 0x080000, 0xe71337c2, BRF_ESS | BRF_PRG }, - { "i-scr5.3", 0x080000, 0x641ccdfb, BRF_ESS | BRF_PRG }, - { "i-scr8.11", 0x080000, 0x7c1813c8, BRF_ESS | BRF_PRG }, - { "i-scr7.6", 0x080000, 0x19c73268, BRF_ESS | BRF_PRG }, - - { "obj1.13", 0x080000, 0x832cd451, BRF_GRA }, // graphics - - { "music1.1", 0x080000, 0x2b1f6655, BRF_SND }, // PCM - { "music2.2", 0x080000, 0xcccae65a, BRF_SND }, -}; - -STD_ROM_PICK(Supmodel) -STD_ROM_FN(Supmodel) - -// Rom information -static struct BurnRomInfo NewfantRomDesc[] = { - { "prog2.12", 0x080000, 0xde43a457, BRF_ESS | BRF_PRG }, // 68000 code - { "prog1.07", 0x080000, 0x370b45be, BRF_ESS | BRF_PRG }, - { "iscr2.10", 0x080000, 0x4f2da2eb, BRF_ESS | BRF_PRG }, - { "iscr1.05", 0x080000, 0x63c6894f, BRF_ESS | BRF_PRG }, - { "iscr4.09", 0x080000, 0x725741ec, BRF_ESS | BRF_PRG }, - { "iscr3.04", 0x080000, 0x51d6b362, BRF_ESS | BRF_PRG }, - { "iscr6.08", 0x080000, 0x178b2ef3, BRF_ESS | BRF_PRG }, - { "iscr5.03", 0x080000, 0xd2b5c5fa, BRF_ESS | BRF_PRG }, - { "iscr8.11", 0x080000, 0xf4148528, BRF_ESS | BRF_PRG }, - { "iscr7.06", 0x080000, 0x2dee0c31, BRF_ESS | BRF_PRG }, - - { "nf95obj1.13", 0x080000, 0xe6d1bc71, BRF_GRA }, // graphics - - { "musc1.01", 0x080000, 0x10347fce, BRF_SND }, // PCM - { "musc2.02", 0x080000, 0xb9646a8c, BRF_SND }, -}; - -STD_ROM_PICK(Newfant) -STD_ROM_FN(Newfant) - -// Rom information -static struct BurnRomInfo NewfantaRomDesc[] = { - { "prog2.12", 0x080000, 0xde43a457, BRF_ESS | BRF_PRG }, // 68000 code - { "prog1.07", 0x080000, 0x370b45be, BRF_ESS | BRF_PRG }, - { "iscr2.10", 0x080000, 0x4f2da2eb, BRF_ESS | BRF_PRG }, - { "iscr1.05", 0x080000, 0x63c6894f, BRF_ESS | BRF_PRG }, - { "iscr4.09", 0x080000, 0x725741ec, BRF_ESS | BRF_PRG }, - { "iscr3.04", 0x080000, 0x51d6b362, BRF_ESS | BRF_PRG }, - { "iscr6.08", 0x080000, 0x178b2ef3, BRF_ESS | BRF_PRG }, - { "iscr5.03", 0x080000, 0xd2b5c5fa, BRF_ESS | BRF_PRG }, - { "iscr8.11", 0x080000, 0xf4148528, BRF_ESS | BRF_PRG }, - { "iscr7.06", 0x080000, 0x2dee0c31, BRF_ESS | BRF_PRG }, - - { "obj1.13", 0x080000, 0x832cd451, BRF_GRA }, // graphics - - { "musc1.01", 0x080000, 0x10347fce, BRF_SND }, // PCM - { "musc2.02", 0x080000, 0xb9646a8c, BRF_SND }, -}; - -STD_ROM_PICK(Newfanta) -STD_ROM_FN(Newfanta) - -// Rom information -static struct BurnRomInfo Fantsy95RomDesc[] = { - { "prog2.12", 0x080000, 0x1e684da7, BRF_ESS | BRF_PRG }, // 68000 code - { "prog1.7", 0x080000, 0xdc4e4f6b, BRF_ESS | BRF_PRG }, - { "i-scr2.10", 0x080000, 0xab8756ff, BRF_ESS | BRF_PRG }, - { "i-scr1.5", 0x080000, 0xd8e2ef77, BRF_ESS | BRF_PRG }, - { "i-scr4.9", 0x080000, 0x4e52eb23, BRF_ESS | BRF_PRG }, - { "i-scr3.4", 0x080000, 0x797731f8, BRF_ESS | BRF_PRG }, - { "i-scr6.8", 0x080000, 0x6f8e5239, BRF_ESS | BRF_PRG }, - { "i-scr5.3", 0x080000, 0x85420e3f, BRF_ESS | BRF_PRG }, - { "i-scr8.11", 0x080000, 0x33db8177, BRF_ESS | BRF_PRG }, - { "i-scr7.6", 0x080000, 0x8662dd01, BRF_ESS | BRF_PRG }, - - { "obj1.13", 0x080000, 0x832cd451, BRF_GRA }, // graphics - - { "music1.1", 0x080000, 0x3117e2ef, BRF_SND }, // PCM - { "music2.2", 0x080000, 0x0c1109f9, BRF_SND }, -}; - -STD_ROM_PICK(Fantsy95) -STD_ROM_FN(Fantsy95) - -// Rom information -static struct BurnRomInfo Missw96RomDesc[] = { - { "mw96_10.bin", 0x080000, 0xb1309bb1, BRF_ESS | BRF_PRG }, // 68000 code - { "mw96_06.bin", 0x080000, 0xa5892bb3, BRF_ESS | BRF_PRG }, - { "mw96_09.bin", 0x080000, 0x7032dfdf, BRF_ESS | BRF_PRG }, - { "mw96_05.bin", 0x080000, 0x91de5ab5, BRF_ESS | BRF_PRG }, - { "mw96_08.bin", 0x080000, 0xb8e66fb5, BRF_ESS | BRF_PRG }, - { "mw96_04.bin", 0x080000, 0xe77a04f8, BRF_ESS | BRF_PRG }, - { "mw96_07.bin", 0x080000, 0x26112ed3, BRF_ESS | BRF_PRG }, - { "mw96_03.bin", 0x080000, 0xe9374a46, BRF_ESS | BRF_PRG }, - - { "mw96_11.bin", 0x080000, 0x3983152f, BRF_GRA }, // graphics - - { "mw96_01.bin", 0x080000, 0xe78a659e, BRF_SND }, // PCM - { "mw96_02.bin", 0x080000, 0x60fa0c00, BRF_SND }, -}; - -STD_ROM_PICK(Missw96) -STD_ROM_FN(Missw96) - -// Rom information -static struct BurnRomInfo Missw96aRomDesc[] = { - { "mw96n2_10.prog2", 0x080000, 0x563ce811, BRF_ESS | BRF_PRG }, // 68000 code - { "mw96n2_6.prog1", 0x080000, 0x98e91a3b, BRF_ESS | BRF_PRG }, - { "mw96_09.bin", 0x080000, 0x7032dfdf, BRF_ESS | BRF_PRG }, - { "mw96_05.bin", 0x080000, 0x91de5ab5, BRF_ESS | BRF_PRG }, - { "mw96_08.bin", 0x080000, 0xb8e66fb5, BRF_ESS | BRF_PRG }, - { "mw96_04.bin", 0x080000, 0xe77a04f8, BRF_ESS | BRF_PRG }, - { "mw96_07.bin", 0x080000, 0x26112ed3, BRF_ESS | BRF_PRG }, - { "mw96_03.bin", 0x080000, 0xe9374a46, BRF_ESS | BRF_PRG }, - - { "mw96_11.bin", 0x080000, 0x3983152f, BRF_GRA }, // graphics - - { "mw96_01.bin", 0x080000, 0xe78a659e, BRF_SND }, // PCM - { "mw96_02.bin", 0x080000, 0x60fa0c00, BRF_SND }, -}; - -STD_ROM_PICK(Missw96a) -STD_ROM_FN(Missw96a) - -// Rom information -static struct BurnRomInfo Missw96bRomDesc[] = { - { "mw96n3_10.prog2", 0x080000, 0x67bde86b, BRF_ESS | BRF_PRG }, // 68000 code - { "mw96n3_6.prog1", 0x080000, 0xde99cc48, BRF_ESS | BRF_PRG }, - { "mw96_09.bin", 0x080000, 0x7032dfdf, BRF_ESS | BRF_PRG }, - { "mw96_05.bin", 0x080000, 0x91de5ab5, BRF_ESS | BRF_PRG }, - { "mw96_08.bin", 0x080000, 0xb8e66fb5, BRF_ESS | BRF_PRG }, - { "mw96_04.bin", 0x080000, 0xe77a04f8, BRF_ESS | BRF_PRG }, - { "mw96_07.bin", 0x080000, 0x26112ed3, BRF_ESS | BRF_PRG }, - { "mw96_03.bin", 0x080000, 0xe9374a46, BRF_ESS | BRF_PRG }, - - { "mw96_11.bin", 0x080000, 0x3983152f, BRF_GRA }, // graphics - - { "mw96_01.bin", 0x080000, 0xe78a659e, BRF_SND }, // PCM - { "mw96_02.bin", 0x080000, 0x60fa0c00, BRF_SND }, -}; - -STD_ROM_PICK(Missw96b) -STD_ROM_FN(Missw96b) - -// Rom information -static struct BurnRomInfo Missw96cRomDesc[] = { - { "10_PROG2.UE17", 0x080000, 0x36a7beb6, BRF_ESS | BRF_PRG }, // 68000 code - { "6_PROG1.UD17", 0x080000, 0xe70b562f, BRF_ESS | BRF_PRG }, - { "9_IM1-B.UE16B", 0x080000, 0xeedc24f8, BRF_ESS | BRF_PRG }, - { "5_IM1-A.UE16A", 0x080000, 0xbb0eb7d7, BRF_ESS | BRF_PRG }, - { "8_IM2-B.UE15B", 0x080000, 0x68dd67b2, BRF_ESS | BRF_PRG }, - { "4_IM2-A.UE15A", 0x080000, 0x2b39ec56, BRF_ESS | BRF_PRG }, - { "7_IM3_B.UE14B", 0x080000, 0x7fd5ca2c, BRF_ESS | BRF_PRG }, - { "3_IM3-A.UE14A", 0x080000, 0x4ba5dab7, BRF_ESS | BRF_PRG }, - - { "20_OBJ1.U5", 0x080000, 0x3983152f, BRF_GRA }, // graphics - - { "1_MUSIC1.UB6", 0x080000, 0xe78a659e, BRF_SND }, // PCM - { "2_MUSIC2.UC6", 0x080000, 0x60fa0c00, BRF_SND }, -}; - -STD_ROM_PICK(Missw96c) -STD_ROM_FN(Missw96c) - -// Rom information -static struct BurnRomInfo Missmw96RomDesc[] = { - { "mmw96_10.bin", 0x080000, 0x45ed1cd9, BRF_ESS | BRF_PRG }, // 68000 code - { "mmw96_06.bin", 0x080000, 0x52ec9e5d, BRF_ESS | BRF_PRG }, - { "mmw96_09.bin", 0x080000, 0x6c458b05, BRF_ESS | BRF_PRG }, - { "mmw96_05.bin", 0x080000, 0x48159555, BRF_ESS | BRF_PRG }, - { "mmw96_08.bin", 0x080000, 0x1dc72b07, BRF_ESS | BRF_PRG }, - { "mmw96_04.bin", 0x080000, 0xfc3e18fa, BRF_ESS | BRF_PRG }, - { "mmw96_07.bin", 0x080000, 0x001572bf, BRF_ESS | BRF_PRG }, - { "mmw96_03.bin", 0x080000, 0x22204025, BRF_ESS | BRF_PRG }, - - { "mmw96_11.bin", 0x080000, 0x7d491f8c, BRF_GRA }, // graphics - - { "mw96_01.bin", 0x080000, 0xe78a659e, BRF_SND }, // PCM - { "mw96_02.bin", 0x080000, 0x60fa0c00, BRF_SND }, -}; - -STD_ROM_PICK(Missmw96) -STD_ROM_FN(Missmw96) - -// Rom information -static struct BurnRomInfo Fantsia2RomDesc[] = { - { "prog2.g17", 0x080000, 0x57c59972, BRF_ESS | BRF_PRG }, // 68000 code - { "prog1.f17", 0x080000, 0xbf2d9a26, BRF_ESS | BRF_PRG }, - { "scr2.g16", 0x080000, 0x887b1bc5, BRF_ESS | BRF_PRG }, - { "scr1.f16", 0x080000, 0xcbba3182, BRF_ESS | BRF_PRG }, - { "scr4.g15", 0x080000, 0xce97e411, BRF_ESS | BRF_PRG }, - { "scr3.f15", 0x080000, 0x480cc2e8, BRF_ESS | BRF_PRG }, - { "scr6.g14", 0x080000, 0xb29d49de, BRF_ESS | BRF_PRG }, - { "scr5.f14", 0x080000, 0xd5f88b83, BRF_ESS | BRF_PRG }, - { "scr8.g20", 0x080000, 0x694ae2b3, BRF_ESS | BRF_PRG }, - { "scr7.f20", 0x080000, 0x6068712c, BRF_ESS | BRF_PRG }, - - { "obj1.1i", 0x080000, 0x52e6872a, BRF_GRA }, // graphics - { "obj2.2i", 0x080000, 0xea6e3861, BRF_GRA }, - - { "music2.1b", 0x080000, 0x23cc4f9c, BRF_SND }, // PCM - { "music1.1a", 0x080000, 0x864167c2, BRF_SND }, -}; - -STD_ROM_PICK(Fantsia2) -STD_ROM_FN(Fantsia2) - -// Rom information -static struct BurnRomInfo Fantsia2aRomDesc[] = { - { "fnt2-22.bin", 0x080000, 0xa3a92c4b, BRF_ESS | BRF_PRG }, // 68000 code - { "fnt2-17.bin", 0x080000, 0xd0ce4493, BRF_ESS | BRF_PRG }, - { "fnt2-21.bin", 0x080000, 0xe989c2e7, BRF_ESS | BRF_PRG }, - { "fnt2-16.bin", 0x080000, 0x8c06d372, BRF_ESS | BRF_PRG }, - { "fnt2-20.bin", 0x080000, 0x6e9f1e65, BRF_ESS | BRF_PRG }, - { "fnt2-15.bin", 0x080000, 0x85cbeb2b, BRF_ESS | BRF_PRG }, - { "fnt2-19.bin", 0x080000, 0x7953226a, BRF_ESS | BRF_PRG }, - { "fnt2-14.bin", 0x080000, 0x10d8ccff, BRF_ESS | BRF_PRG }, - { "fnt2-18.bin", 0x080000, 0x4cdaeda3, BRF_ESS | BRF_PRG }, - { "fnt2-13.bin", 0x080000, 0x68c7f042, BRF_ESS | BRF_PRG }, - - { "obj1.1i", 0x080000, 0x52e6872a, BRF_GRA }, // graphics - { "obj2.2i", 0x080000, 0xea6e3861, BRF_GRA }, - - { "music2.1b", 0x080000, 0x23cc4f9c, BRF_SND }, // PCM - { "music1.1a", 0x080000, 0x864167c2, BRF_SND }, -}; - -STD_ROM_PICK(Fantsia2a) -STD_ROM_FN(Fantsia2a) - -// Rom information -/* sole change seems to be copyright date, PCB has chip references instead of grid references. -Not correcting all labels in other sets in case these are legitimate labels */ -static struct BurnRomInfo Fantsia2nRomDesc[] = { - { "prog2.g17", 0x080000, 0x57c59972, BRF_ESS | BRF_PRG }, // 68000 code - { "prog1.f17", 0x080000, 0xbf2d9a26, BRF_ESS | BRF_PRG }, - { "scr2.g16", 0x080000, 0x887b1bc5, BRF_ESS | BRF_PRG }, - { "scr1.f16", 0x080000, 0xcbba3182, BRF_ESS | BRF_PRG }, - { "scr4.g15", 0x080000, 0xce97e411, BRF_ESS | BRF_PRG }, - { "scr3.f15", 0x080000, 0x480cc2e8, BRF_ESS | BRF_PRG }, - { "scr6.g14", 0x080000, 0xb29d49de, BRF_ESS | BRF_PRG }, - { "scr5.f14", 0x080000, 0xd5f88b83, BRF_ESS | BRF_PRG }, - { "scr8.g20", 0x080000, 0x694ae2b3, BRF_ESS | BRF_PRG }, - { "scr7.f20", 0x080000, 0x6068712c, BRF_ESS | BRF_PRG }, - - { "23_OBJ1.U5", 0x080000, 0xB45C9234, BRF_GRA }, // graphics - { "obj2.2i", 0x080000, 0xea6e3861, BRF_GRA }, - - { "music2.1b", 0x080000, 0x23cc4f9c, BRF_SND }, // PCM - { "music1.1a", 0x080000, 0x864167c2, BRF_SND }, -}; - -STD_ROM_PICK(Fantsia2n) -STD_ROM_FN(Fantsia2n) - -// Rom information -static struct BurnRomInfo WownfantRomDesc[] = { - { "ep-4001 42750001 u81.bin", 0x080000, 0x9942d200, BRF_ESS | BRF_PRG }, // 68000 code - { "ep-4001 42750001 u80.bin", 0x080000, 0x17359eeb, BRF_ESS | BRF_PRG }, - { "ep-061 43750002 - 1.bin", 0x200000, 0xc318e841, BRF_ESS | BRF_PRG }, - { "ep-061 43750002 - 2.bin", 0x200000, 0x8871dc3a, BRF_ESS | BRF_PRG }, - - { "ep-4001 42750001 u113.bin", 0x080000, 0x3e77ca1f, BRF_GRA }, // graphics - { "ep-4001 42750001 u112.bin", 0x080000, 0x51f4b604, BRF_GRA }, - - { "ep-4001 42750001 u4.bin", 0x080000, 0x06dc889e, BRF_SND }, // PCM - { "ep-4001 42750001 u1.bin", 0x080000, 0x864167c2, BRF_SND }, -}; - -STD_ROM_PICK(Wownfant) -STD_ROM_FN(Wownfant) - -// Rom information -static struct BurnRomInfo Missw02RomDesc[] = { - { "8.u81", 0x080000, 0x316666d0, BRF_ESS | BRF_PRG }, // 68000 code - { "7.u80", 0x080000, 0xd61f4d18, BRF_ESS | BRF_PRG }, - { "3.bin", 0x200000, 0xfdfe36ba, BRF_ESS | BRF_PRG }, - { "4.bin", 0x200000, 0xaa769a81, BRF_ESS | BRF_PRG }, - - { "6.u113", 0x080000, 0x3e77ca1f, BRF_GRA }, // graphics - { "5.u112", 0x080000, 0xead3411d, BRF_GRA }, - - { "2.u4", 0x080000, 0x06dc889e, BRF_SND }, // PCM - { "1.u1", 0x080000, 0x864167c2, BRF_SND }, -}; - -STD_ROM_PICK(Missw02) -STD_ROM_FN(Missw02) - -// Rom information -static struct BurnRomInfo GalhustlRomDesc[] = { - { "ue17.3", 0x080000, 0xb2583dbb, BRF_ESS | BRF_PRG }, // 68000 code - { "ud17.4", 0x080000, 0x470a3668, BRF_ESS | BRF_PRG }, - - { "galhstl5.u5", 0x080000, 0x44a18f15, BRF_GRA }, // graphics - - { "galhstl1.ub6", 0x080000, 0x23848790, BRF_SND }, // PCM - { "galhstl2.uc6", 0x080000, 0x2168e54a, BRF_SND }, -}; - -STD_ROM_PICK(Galhustl) -STD_ROM_FN(Galhustl) - - -// Rom information -static struct BurnRomInfo PgalvipRomDesc[] = { - { "afega_15.ue17", 0x20000, 0x050060ca, BRF_ESS | BRF_PRG }, // 68000 code - { "afega_16.ud17", 0x20000, 0xd32e4052, BRF_ESS | BRF_PRG }, - - { "afega_17.u5", 0x80000, 0xa8a50745, BRF_GRA }, // graphics - - { "afega_12.ub6", 0x20000, 0xd32a6c0c, BRF_SND }, // PCM - { "afega_11.uc6", 0x80000, 0x2168e54a, BRF_SND }, - - { "afega_13.rob1", 0x80000, 0xac51ef72, BRF_ESS | BRF_PRG }, // more 68000 code - { "afega_14.roa1", 0x80000, 0x0877c00f, BRF_ESS | BRF_PRG }, -}; - -STD_ROM_PICK(Pgalvip) -STD_ROM_FN(Pgalvip) - -// Rom information -static struct BurnRomInfo PgalvipaRomDesc[] = { - { "pgalvip_3.ue17", 0x80000, 0xa48e8255, BRF_ESS | BRF_PRG }, // 68000 code - { "pgalvip_4.ud17", 0x80000, 0x829a2085, BRF_ESS | BRF_PRG }, - - { "pgalvip_5.u5", 0x80000, 0x2d6e5a90, BRF_GRA }, // graphics - - { "pgalvip_1.ub6", 0x20000, 0xd32a6c0c, BRF_SND }, // PCM - { "pgalvip_2.uc6", 0x80000, 0x2168e54a, BRF_SND }, -}; - -STD_ROM_PICK(Pgalvipa) -STD_ROM_FN(Pgalvipa) - -// Rom information -static struct BurnRomInfo ZipzapRomDesc[] = { - { "ue17.bin", 0x040000, 0xda6c3fc8, BRF_ESS | BRF_PRG }, // 68000 code - { "ud17.bin", 0x040000, 0x2901fae1, BRF_ESS | BRF_PRG }, - { "937.bin", 0x080000, 0x61dd653f, BRF_ESS | BRF_PRG }, - { "941.bin", 0x080000, 0x320321ed, BRF_ESS | BRF_PRG }, - { "936.bin", 0x080000, 0x596543cc, BRF_ESS | BRF_PRG }, - { "940.bin", 0x080000, 0x0c9dfb53, BRF_ESS | BRF_PRG }, - { "934.bin", 0x080000, 0x1e65988a, BRF_ESS | BRF_PRG }, - { "939.bin", 0x080000, 0x8790a6a3, BRF_ESS | BRF_PRG }, - { "938.bin", 0x080000, 0x61c06b60, BRF_ESS | BRF_PRG }, - { "942.bin", 0x080000, 0x282413b8, BRF_ESS | BRF_PRG }, - - { "u5.bin", 0x080000, 0xc274d8b5, BRF_GRA }, // graphics - - { "snd.bin", 0x080000, 0xbc20423e, BRF_SND }, // PCM -}; - -STD_ROM_PICK(Zipzap) -STD_ROM_FN(Zipzap) - - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom68K = Next; Next += 0x400000; // 68000 ROM - RomGfx = Next; Next += 0x200100; // Graphics, 1M 16x16x4bit decode to 2M + 64byte safe - DeRomGfx = RomGfx + 0x000100; - RomSnd = Next; Next += 0x140000; // ADPCM - OKI6295 - - RamStart = Next; - - RamFg = (UINT16 *) Next; Next += 0x010000 * sizeof(UINT16); - RamBg = (UINT16 *) Next; Next += 0x010000 * sizeof(UINT16); - RamPal = (UINT16 *) Next; Next += 0x000400 * sizeof(UINT16); - RamSpr = (UINT16 *) Next; Next += 0x002400 * sizeof(UINT16); - - RamEnd = Next; - - RamCurPal = (UINT32 *) Next; Next += 0x000400 * sizeof(UINT32); - RamCTB64k = (UINT32 *) Next; Next += 0x008000 * sizeof(UINT32); - - MemEnd = Next; - return 0; -} - -static INT32 MemIndex2() -{ - UINT8 *Next; Next = Mem; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "galhustl")) { - Rom68K = Next; Next += 0x200000; // 68000 ROM - } else { - Rom68K = Next; Next += 0x500000; // 68000 ROM - } - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "fantsia2") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fantsia2a") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fantsia2n") || !strcmp(BurnDrvGetTextA(DRV_NAME), "wownfant") || !strcmp(BurnDrvGetTextA(DRV_NAME), "missw02")) { - RomGfx = Next; Next += 0x200100; // Graphics, 1M 16x16x4bit decode to 2M + 64byte safe - } else { - RomGfx = Next; Next += 0x100100; // Graphics, 1/2M 16x16x4bit decode to 1M + 64byte safe - } - DeRomGfx = RomGfx + 0x000100; - RomSnd = Next; Next += 0x140000; // ADPCM - OKI6295 - - RamStart = Next; - - Ram68K = (UINT16 *) Next; Next += 0x008020 * sizeof(UINT16); - RamFg = (UINT16 *) Next; Next += 0x010000 * sizeof(UINT16); - RamBg = (UINT16 *) Next; Next += 0x010000 * sizeof(UINT16); - RamPal = (UINT16 *) Next; Next += 0x000800 * sizeof(UINT16); - RamSpr = (UINT16 *) Next; Next += 0x000800 * sizeof(UINT16); - RamBgM = (UINT16 *) Next; Next += 0x002000 * sizeof(UINT16); - - RamEnd = Next; - - RamCurPal = (UINT32 *) Next; Next += 0x000400 * sizeof(UINT32); - RamCTB64k = (UINT32 *) Next; Next += 0x008000 * sizeof(UINT32); - - MemEnd = Next; - return 0; -} - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -UINT8 __fastcall GalpanicReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x400001: - return MSM6295ReadStatus(0); - //default: - // printf("Attempt to read byte value of location %x\n", sekAddress); - } - return 0; -} - -UINT16 __fastcall GalpanicReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x800000: - return ~(DrvInput[0] | (DrvInput[1] << 8)); - case 0x800002: - return ~(DrvInput[2] | (DrvInput[3] << 8)); - case 0x800004: - return ~(DrvInput[4] | (DrvInput[5] << 8)); - //default: - // printf("Attempt to read word value of location %x\n", sekAddress); - } - return 0; -} - -void __fastcall GalpanicWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x900000: - SndBank = (byteValue & 0x0f); - memcpy(&RomSnd[0x30000], &RomSnd[0x40000 + SndBank * 0x10000], 0x10000); - break; - case 0x400001: - MSM6295Command(0, byteValue); - break; - //case 0xB00000: - //case 0xC00000: - //case 0xD00000: - // /* NOP */ - // break; - //default: - // printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } -} - -UINT8 __fastcall ComadReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xC80000: - case 0xD00000: - case 0xF00000: - case 0xF80000: - return MSM6295ReadStatus(0); - - case 0x80000a: - case 0x80000c: - return BurnRandom() & 0xffff; - - case 0x800006: - case 0x800008: - return BurnRandom() & 0xffff; -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall ComadWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x900000: - case 0x900001: - SndBank = (byteValue & 0x0f); - memcpy(&RomSnd[0x30000], &RomSnd[0x40000 + SndBank * 0x10000], 0x10000); - break; - case 0xC00000: - case 0xC80000: - case 0xD00000: - case 0xF00000: - case 0xF80000: - MSM6295Command(0, byteValue & 0xff); - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall GalhustlWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - -if (sekAddress >= 0x580000 && sekAddress <= 0x583fff) { - for (INT32 i = 0; i < 8; i++) { - INT32 Offs = (sekAddress - 0x580000) >> 1; - RamBgM = (UINT16*)RamBg; - RamBgM[Offs * 8 + i] = wordValue; - } - - return; - } - - switch (sekAddress) { - case 0xA00000: -// GalPanicCoin = wordValue; - break; - - case 0xE00012: - return; // NOP? - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -UINT16 __fastcall GalhustlReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x800000: - SEK_DEF_READ_WORD(0, sekAddress); - return 0; - case 0x800002: - SEK_DEF_READ_WORD(0, sekAddress); - return 0; - case 0x800004: - SEK_DEF_READ_WORD(0, sekAddress); - return 0; -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -UINT8 __fastcall GalhustlReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0xC00000: - case 0xD00000: - return MSM6295ReadStatus(0); - - case 0x800000: - return ~(DrvInput[1]); - case 0x800001: - return ~(DrvInput[0]); - case 0x800002: - return ~(DrvInput[3]); - case 0x800003: - return ~(DrvInput[2]); - case 0x800004: - case 0x800005: - return 0xff - DrvInput[5]; - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - SekReset(); - SekClose(); - SndBank = 0; - MSM6295Reset(0); - - return 0; -} - -void DeCodeGfx() -{ - for (INT32 c=8192-1; c>=0; c--) { - INT32 fx = 8; - for (INT32 y=15; y>=0; y--) { - if (y == 7) fx = 0; - DeRomGfx[(c * 256) + (y * 16) + 15] = RomGfx[0x00023 + ((y + fx) * 4) + (c * 128)] & 0x0f; - DeRomGfx[(c * 256) + (y * 16) + 14] = RomGfx[0x00023 + ((y + fx) * 4) + (c * 128)] >> 4; - DeRomGfx[(c * 256) + (y * 16) + 13] = RomGfx[0x00022 + ((y + fx) * 4) + (c * 128)] & 0x0f; - DeRomGfx[(c * 256) + (y * 16) + 12] = RomGfx[0x00022 + ((y + fx) * 4) + (c * 128)] >> 4; - DeRomGfx[(c * 256) + (y * 16) + 11] = RomGfx[0x00021 + ((y + fx) * 4) + (c * 128)] & 0x0f; - DeRomGfx[(c * 256) + (y * 16) + 10] = RomGfx[0x00021 + ((y + fx) * 4) + (c * 128)] >> 4; - DeRomGfx[(c * 256) + (y * 16) + 9] = RomGfx[0x00020 + ((y + fx) * 4) + (c * 128)] & 0x0f; - DeRomGfx[(c * 256) + (y * 16) + 8] = RomGfx[0x00020 + ((y + fx) * 4) + (c * 128)] >> 4; - - DeRomGfx[(c * 256) + (y * 16) + 7] = RomGfx[0x00003 + ((y + fx) * 4) + (c * 128)] & 0x0f; - DeRomGfx[(c * 256) + (y * 16) + 6] = RomGfx[0x00003 + ((y + fx) * 4) + (c * 128)] >> 4; - DeRomGfx[(c * 256) + (y * 16) + 5] = RomGfx[0x00002 + ((y + fx) * 4) + (c * 128)] & 0x0f; - DeRomGfx[(c * 256) + (y * 16) + 4] = RomGfx[0x00002 + ((y + fx) * 4) + (c * 128)] >> 4; - DeRomGfx[(c * 256) + (y * 16) + 3] = RomGfx[0x00001 + ((y + fx) * 4) + (c * 128)] & 0x0f; - DeRomGfx[(c * 256) + (y * 16) + 2] = RomGfx[0x00001 + ((y + fx) * 4) + (c * 128)] >> 4; - DeRomGfx[(c * 256) + (y * 16) + 1] = RomGfx[0x00000 + ((y + fx) * 4) + (c * 128)] & 0x0f; - DeRomGfx[(c * 256) + (y * 16) + 0] = RomGfx[0x00000 + ((y + fx) * 4) + (c * 128)] >> 4; - } - } -} - -static INT32 GalpanicInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(Rom68K + 0x100000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300001, 9, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomGfx + 0x000000, 10, 1); if (nRet != 0) return 1; - DeCodeGfx(); - - BurnLoadRom(RomSnd + 0x040000, 11, 1); - BurnLoadRom(RomSnd + 0x0C0000, 12, 1); - memcpy(RomSnd, RomSnd + 0x040000, 0x040000); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x3FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory((UINT8 *)RamFg, - 0x500000, 0x51FFFF, MAP_RAM); // f ground - SekMapMemory((UINT8 *)RamBg, - 0x520000, 0x53FFFF, MAP_RAM); // b ground - SekMapMemory((UINT8 *)RamPal, - 0x600000, 0x6007FF, MAP_RAM); // palette - SekMapMemory((UINT8 *)RamSpr, - 0x700000, 0x7047FF, MAP_RAM); // sprites - - SekSetReadWordHandler(0, GalpanicReadWord); - SekSetReadByteHandler(0, GalpanicReadByte); - SekSetWriteByteHandler(0, GalpanicWriteByte); - - SekClose(); - } - - MSM6295ROM = RomSnd; - MSM6295Init(0, 12000, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - RecalcBgPalette = 1; - - DrvDoReset(); - return 0; -} - -static INT32 FantasiaInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex2(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex2(); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300000, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x400001, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x400000, 9, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomGfx + 0x000000, 10, 1); if (nRet != 0) return 1; - DeCodeGfx(); - - BurnLoadRom(RomSnd + 0x040000, 11, 1); - BurnLoadRom(RomSnd + 0x0C0000, 12, 1); - memcpy(RomSnd, RomSnd + 0x040000, 0x040000); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x4FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory((UINT8 *)RamFg, - 0x500000, 0x51FFFF, MAP_RAM); // f ground - SekMapMemory((UINT8 *)RamBg, - 0x520000, 0x53FFFF, MAP_RAM); // b ground - SekMapMemory((UINT8 *)RamBgM, - 0x580000, 0x583FFF, MAP_RAM); // another tilemap? - SekMapMemory((UINT8 *)RamPal, - 0x600000, 0x600FFF, MAP_RAM); // palette - SekMapMemory((UINT8 *)Ram68K, - 0x680000, 0x68001F, MAP_WRITE); // regs? - SekMapMemory((UINT8 *)RamSpr, - 0x700000, 0x700FFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)Ram68K+0x000020, - 0x780000, 0x78001F, MAP_WRITE); // regs? - SekMapMemory((UINT8 *)Ram68K+0x000040, - 0xC80000, 0xC8FFFF, MAP_RAM); // work ram? - - - SekSetReadWordHandler(0, GalpanicReadWord); - SekSetReadByteHandler(0, ComadReadByte); - SekSetWriteByteHandler(0, ComadWriteByte); - - SekClose(); - } - - MSM6295ROM = RomSnd; - MSM6295Init(0, 12000, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - RecalcBgPalette = 1; - - DrvDoReset(); - return 0; -} - -static INT32 Missw96Init() -{ - INT32 nRet; - - Mem = NULL; - MemIndex2(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex2(); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300000, 7, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomGfx + 0x000000, 8, 1); if (nRet != 0) return 1; - DeCodeGfx(); - - BurnLoadRom(RomSnd + 0x040000, 9, 1); - BurnLoadRom(RomSnd + 0x0C0000, 10, 1); - memcpy(RomSnd, RomSnd + 0x040000, 0x040000); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x4FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory((UINT8 *)RamFg, - 0x500000, 0x51FFFF, MAP_RAM); // f ground - SekMapMemory((UINT8 *)RamBg, - 0x520000, 0x53FFFF, MAP_RAM); // b ground - SekMapMemory((UINT8 *)RamBgM, - 0x580000, 0x583FFF, MAP_RAM); // another tilemap? - SekMapMemory((UINT8 *)RamPal, - 0x600000, 0x600FFF, MAP_RAM); // palette - SekMapMemory((UINT8 *)RamSpr, - 0x700000, 0x700FFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)Ram68K, - 0xC00000, 0xC0FFFF, MAP_RAM); // work ram? - SekMapMemory((UINT8 *)Ram68K+0x010000, - 0x680000, 0x68001F, MAP_RAM); // regs? - SekMapMemory((UINT8 *)Ram68K+0x010020, - 0x780000, 0x78001F, MAP_RAM); // regs? - - SekSetReadWordHandler(0, GalpanicReadWord); - SekSetReadByteHandler(0, ComadReadByte); - SekSetWriteByteHandler(0, ComadWriteByte); - - SekClose(); - } - - MSM6295ROM = RomSnd; - MSM6295Init(0, 12000, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - RecalcBgPalette = 1; - - DrvDoReset(); - return 0; -} - -static INT32 Fantsia2Init() -{ - INT32 nRet; - - Mem = NULL; - MemIndex2(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex2(); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300000, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x400001, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x400000, 9, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomGfx + 0x000000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(RomGfx + 0x080000, 11, 1); if (nRet != 0) return 1; - DeCodeGfx(); - - BurnLoadRom(RomSnd + 0x040000, 12, 1); - BurnLoadRom(RomSnd + 0x0C0000, 13, 1); - memcpy(RomSnd, RomSnd + 0x040000, 0x040000); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x4FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory((UINT8 *)RamFg, - 0x500000, 0x51FFFF, MAP_RAM); // f ground - SekMapMemory((UINT8 *)RamBg, - 0x520000, 0x53FFFF, MAP_RAM); // b ground - SekMapMemory((UINT8 *)RamBgM, - 0x580000, 0x583FFF, MAP_RAM); // another tilemap? - SekMapMemory((UINT8 *)RamPal, - 0x600000, 0x600FFF, MAP_RAM); // palette - SekMapMemory((UINT8 *)RamSpr, - 0x700000, 0x700FFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)Ram68K, - 0xF80000, 0xF8FFFF, MAP_RAM); // work ram? - SekMapMemory((UINT8 *)Ram68K+0x010000, - 0x680000, 0x68001F, MAP_RAM); // regs? - SekMapMemory((UINT8 *)Ram68K+0x010020, - 0x780000, 0x78001F, MAP_RAM); // regs? - - SekSetReadWordHandler(0, GalpanicReadWord); - SekSetReadByteHandler(0, ComadReadByte); - SekSetWriteByteHandler(0, ComadWriteByte); - - SekClose(); - } - - MSM6295ROM = RomSnd; - MSM6295Init(0, 12000, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - RecalcBgPalette = 1; - - DrvDoReset(); - return 0; -} - -static INT32 WownfantInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex2(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex2(); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300000, 3, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomGfx + 0x000000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(RomGfx + 0x080000, 5, 1); if (nRet != 0) return 1; - DeCodeGfx(); - - BurnLoadRom(RomSnd + 0x040000, 6, 1); - BurnLoadRom(RomSnd + 0x0C0000, 7, 1); - memcpy(RomSnd, RomSnd + 0x040000, 0x040000); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x4FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory((UINT8 *)RamFg, - 0x500000, 0x51FFFF, MAP_RAM); // f ground - SekMapMemory((UINT8 *)RamBg, - 0x520000, 0x53FFFF, MAP_RAM); // b ground - SekMapMemory((UINT8 *)RamBgM, - 0x580000, 0x583FFF, MAP_RAM); // another tilemap? - SekMapMemory((UINT8 *)RamPal, - 0x600000, 0x600FFF, MAP_RAM); // palette - SekMapMemory((UINT8 *)RamSpr, - 0x700000, 0x700FFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)Ram68K, - 0xF80000, 0xF8FFFF, MAP_RAM); // work ram? - SekMapMemory((UINT8 *)Ram68K+0x010000, - 0x680000, 0x68001F, MAP_RAM); // regs? - SekMapMemory((UINT8 *)Ram68K+0x010020, - 0x780000, 0x78001F, MAP_RAM); // regs? - - SekSetReadWordHandler(0, GalpanicReadWord); - SekSetReadByteHandler(0, ComadReadByte); - SekSetWriteByteHandler(0, ComadWriteByte); - - SekClose(); - } - - MSM6295ROM = RomSnd; - MSM6295Init(0, 12000, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - RecalcBgPalette = 1; - - DrvDoReset(); - return 0; -} - -static INT32 GalhustlInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex2(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex2(); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - DeCodeGfx(); - - BurnLoadRom(RomSnd + 0x040000, 3, 1); - BurnLoadRom(RomSnd + 0x0C0000, 4, 1); - memcpy(RomSnd, RomSnd + 0x040000, 0x040000); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "pgalvip")) { - nRet = BurnLoadRom(Rom68K + 0x100001, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 6, 2); if (nRet != 0) return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Rom68K + 0x100000, 0x200000, 0x2fffff, MAP_ROM); // pgalvip - SekMapMemory((UINT8 *)RamFg, - 0x500000, 0x51FFFF, MAP_RAM); // f ground - SekMapMemory((UINT8 *)RamBg, - 0x520000, 0x53FFFF, MAP_RAM); // b ground -// SekMapMemory((UINT8 *)RamBgM, -// 0x580000, 0x583FFF, MAP_RAM); // another tilemap? -// SekMapHandler(1, 0x580000, 0x583FFF, MAP_WRITE); - SekMapMemory((UINT8 *)RamPal, - 0x600000, 0x600FFF, MAP_RAM); // palette - SekMapMemory((UINT8 *)RamSpr, - 0x700000, 0x700FFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)Ram68K, - 0x680000, 0x68001F, MAP_RAM); // regs? - SekMapMemory((UINT8 *)Ram68K+0x000020, - 0x780000, 0x78001F, MAP_RAM); // regs? - SekMapMemory((UINT8 *)Ram68K+0x000040, - 0xE80000, 0xE8FFFF, MAP_RAM); // work ram? - - SekSetReadWordHandler(0, GalhustlReadWord); - SekSetReadByteHandler(0, GalhustlReadByte); - SekSetWriteWordHandler(0, GalhustlWriteWord); - SekSetWriteByteHandler(0, ComadWriteByte); - - SekClose(); - } - - MSM6295ROM = RomSnd; - MSM6295Init(0, 12000, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - RecalcBgPalette = 1; - - DrvDoReset(); - return 0; -} - -static INT32 ZipzapInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex2(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex2(); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x300000, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x400001, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x400000, 9, 2); if (nRet != 0) return 1; - -// Rom68K[0x0bc4] = 0x71; -// Rom68K[0x0bc5] = 0x4e; - - nRet = BurnLoadRom(RomGfx + 0x000000, 10, 1); if (nRet != 0) return 1; - DeCodeGfx(); - -// BurnLoadRom(RomSnd + 0x040000, 11, 1); -// BurnLoadRom(RomSnd + 0x0C0000, 11, 1); -// memcpy(RomSnd, RomSnd + 0x040000, 0x040000); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x4FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory((UINT8 *)RamFg, - 0x500000, 0x51FFFF, MAP_RAM); // f ground - SekMapMemory((UINT8 *)RamBg, - 0x520000, 0x53FFFF, MAP_RAM); // b ground - SekMapMemory((UINT8 *)RamBgM, - 0x580000, 0x583FFF, MAP_RAM); // another tilemap? -// SekMapHandler(1, 0x580000, 0x583FFF, MAP_WRITE); - SekMapMemory((UINT8 *)RamPal, - 0x600000, 0x600FFF, MAP_RAM); // palette - SekMapMemory((UINT8 *)RamSpr, - 0x700000, 0x700FFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)Ram68K, - 0xC80000, 0xC8FFFF, MAP_RAM); // work ram? - SekMapMemory((UINT8 *)Ram68K+0x010000, - 0x680000, 0x68001F, MAP_RAM); // regs? - SekMapMemory((UINT8 *)Ram68K+0x010020, - 0x780000, 0x78001F, MAP_RAM); // regs? -// SekMapMemory((UINT8 *)Ram68K+0x010040, -// 0x701000, 0x71FFFF, MAP_RAM); // work ram? - - SekSetReadWordHandler(0, GalhustlReadWord); - SekSetReadByteHandler(0, GalhustlReadByte); - SekSetWriteByteHandler(0, ComadWriteByte); - - SekClose(); - } - - MSM6295ROM = RomSnd; - MSM6295Init(0, 8000, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - RecalcBgPalette = 1; - - DrvDoReset(); - return 0; -} - -static INT32 GalpanicExit() -{ - SekExit(); - MSM6295Exit(0); - - BurnFree(Mem); - - RecalcBgPalette = 0; - return 0; -} - -static void drawgfx(UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 sx,INT32 sy) -{ - UINT16 * p = (UINT16 *) pBurnDraw; - UINT8 * q = DeRomGfx + (code) * 256; - UINT32 * pal = RamCurPal + 256; - - p += sy * 256 + sx; - - if ((sx < 0) || (sx >= 240) || (sy < 0) || (sy >= 208)) { - - if ((sx <= -16) || (sx >= 256) || (sy <= -16) || (sy >= 224)) - return ; - - // clip - if (!flipy) { - p += 256 * 15; - - if (!flipx) { - - for (INT32 i=15;i>=0;i--) { - if (((sy+i)>=0) && ((sy+i)<224)) { - if (q[ 0] && ((sx + 15) >= 0) && ((sx + 15)<256)) p[15] = pal[ q[ 0] | color]; - if (q[ 1] && ((sx + 14) >= 0) && ((sx + 14)<256)) p[14] = pal[ q[ 1] | color]; - if (q[ 2] && ((sx + 13) >= 0) && ((sx + 13)<256)) p[13] = pal[ q[ 2] | color]; - if (q[ 3] && ((sx + 12) >= 0) && ((sx + 12)<256)) p[12] = pal[ q[ 3] | color]; - if (q[ 4] && ((sx + 11) >= 0) && ((sx + 11)<256)) p[11] = pal[ q[ 4] | color]; - if (q[ 5] && ((sx + 10) >= 0) && ((sx + 10)<256)) p[10] = pal[ q[ 5] | color]; - if (q[ 6] && ((sx + 9) >= 0) && ((sx + 9)<256)) p[ 9] = pal[ q[ 6] | color]; - if (q[ 7] && ((sx + 8) >= 0) && ((sx + 8)<256)) p[ 8] = pal[ q[ 7] | color]; - - if (q[ 8] && ((sx + 7) >= 0) && ((sx + 7)<256)) p[ 7] = pal[ q[ 8] | color]; - if (q[ 9] && ((sx + 6) >= 0) && ((sx + 6)<256)) p[ 6] = pal[ q[ 9] | color]; - if (q[10] && ((sx + 5) >= 0) && ((sx + 5)<256)) p[ 5] = pal[ q[10] | color]; - if (q[11] && ((sx + 4) >= 0) && ((sx + 4)<256)) p[ 4] = pal[ q[11] | color]; - if (q[12] && ((sx + 3) >= 0) && ((sx + 3)<256)) p[ 3] = pal[ q[12] | color]; - if (q[13] && ((sx + 2) >= 0) && ((sx + 2)<256)) p[ 2] = pal[ q[13] | color]; - if (q[14] && ((sx + 1) >= 0) && ((sx + 1)<256)) p[ 1] = pal[ q[14] | color]; - if (q[15] && ((sx + 0) >= 0) && ((sx + 0)<256)) p[ 0] = pal[ q[15] | color]; - } - p -= 256; - q += 16; - } - - } else { - - for (INT32 i=15;i>=0;i--) { - if (((sy+i)>=0) && ((sy+i)<224)) { - if (q[ 0] && ((sx + 0) >= 0) && ((sx + 0)<256)) p[ 0] = pal[ q[ 0] | color]; - if (q[ 1] && ((sx + 1) >= 0) && ((sx + 1)<256)) p[ 1] = pal[ q[ 1] | color]; - if (q[ 2] && ((sx + 2) >= 0) && ((sx + 2)<256)) p[ 2] = pal[ q[ 2] | color]; - if (q[ 3] && ((sx + 3) >= 0) && ((sx + 3)<256)) p[ 3] = pal[ q[ 3] | color]; - if (q[ 4] && ((sx + 4) >= 0) && ((sx + 4)<256)) p[ 4] = pal[ q[ 4] | color]; - if (q[ 5] && ((sx + 5) >= 0) && ((sx + 5)<256)) p[ 5] = pal[ q[ 5] | color]; - if (q[ 6] && ((sx + 6) >= 0) && ((sx + 6)<256)) p[ 6] = pal[ q[ 6] | color]; - if (q[ 7] && ((sx + 7) >= 0) && ((sx + 7)<256)) p[ 7] = pal[ q[ 7] | color]; - - if (q[ 8] && ((sx + 8) >= 0) && ((sx + 8)<256)) p[ 8] = pal[ q[ 8] | color]; - if (q[ 9] && ((sx + 9) >= 0) && ((sx + 9)<256)) p[ 9] = pal[ q[ 9] | color]; - if (q[10] && ((sx + 10) >= 0) && ((sx + 10)<256)) p[10] = pal[ q[10] | color]; - if (q[11] && ((sx + 11) >= 0) && ((sx + 11)<256)) p[11] = pal[ q[11] | color]; - if (q[12] && ((sx + 12) >= 0) && ((sx + 12)<256)) p[12] = pal[ q[12] | color]; - if (q[13] && ((sx + 13) >= 0) && ((sx + 13)<256)) p[13] = pal[ q[13] | color]; - if (q[14] && ((sx + 14) >= 0) && ((sx + 14)<256)) p[14] = pal[ q[14] | color]; - if (q[15] && ((sx + 15) >= 0) && ((sx + 15)<256)) p[15] = pal[ q[15] | color]; - } - p -= 256; - q += 16; - } - } - - } else { - - if (!flipx) { - - for (INT32 i=0;i<16;i++) { - if (((sy+i)>=0) && ((sy+i)<224)) { - if (q[ 0] && ((sx + 15) >= 0) && ((sx + 15)<256)) p[15] = pal[ q[ 0] | color]; - if (q[ 1] && ((sx + 14) >= 0) && ((sx + 14)<256)) p[14] = pal[ q[ 1] | color]; - if (q[ 2] && ((sx + 13) >= 0) && ((sx + 13)<256)) p[13] = pal[ q[ 2] | color]; - if (q[ 3] && ((sx + 12) >= 0) && ((sx + 12)<256)) p[12] = pal[ q[ 3] | color]; - if (q[ 4] && ((sx + 11) >= 0) && ((sx + 11)<256)) p[11] = pal[ q[ 4] | color]; - if (q[ 5] && ((sx + 10) >= 0) && ((sx + 10)<256)) p[10] = pal[ q[ 5] | color]; - if (q[ 6] && ((sx + 9) >= 0) && ((sx + 9)<256)) p[ 9] = pal[ q[ 6] | color]; - if (q[ 7] && ((sx + 8) >= 0) && ((sx + 8)<256)) p[ 8] = pal[ q[ 7] | color]; - - if (q[ 8] && ((sx + 7) >= 0) && ((sx + 7)<256)) p[ 7] = pal[ q[ 8] | color]; - if (q[ 9] && ((sx + 6) >= 0) && ((sx + 6)<256)) p[ 6] = pal[ q[ 9] | color]; - if (q[10] && ((sx + 5) >= 0) && ((sx + 5)<256)) p[ 5] = pal[ q[10] | color]; - if (q[11] && ((sx + 4) >= 0) && ((sx + 4)<256)) p[ 4] = pal[ q[11] | color]; - if (q[12] && ((sx + 3) >= 0) && ((sx + 3)<256)) p[ 3] = pal[ q[12] | color]; - if (q[13] && ((sx + 2) >= 0) && ((sx + 2)<256)) p[ 2] = pal[ q[13] | color]; - if (q[14] && ((sx + 1) >= 0) && ((sx + 1)<256)) p[ 1] = pal[ q[14] | color]; - if (q[15] && ((sx + 0) >= 0) && ((sx + 0)<256)) p[ 0] = pal[ q[15] | color]; - } - p += 256; - q += 16; - } - - } else { - - for (INT32 i=0;i<16;i++) { - if (((sy+i)>=0) && ((sy+i)<224)) { - if (q[ 0] && ((sx + 0) >= 0) && ((sx + 0)<256)) p[ 0] = pal[ q[ 0] | color]; - if (q[ 1] && ((sx + 1) >= 0) && ((sx + 1)<256)) p[ 1] = pal[ q[ 1] | color]; - if (q[ 2] && ((sx + 2) >= 0) && ((sx + 2)<256)) p[ 2] = pal[ q[ 2] | color]; - if (q[ 3] && ((sx + 3) >= 0) && ((sx + 3)<256)) p[ 3] = pal[ q[ 3] | color]; - if (q[ 4] && ((sx + 4) >= 0) && ((sx + 4)<256)) p[ 4] = pal[ q[ 4] | color]; - if (q[ 5] && ((sx + 5) >= 0) && ((sx + 5)<256)) p[ 5] = pal[ q[ 5] | color]; - if (q[ 6] && ((sx + 6) >= 0) && ((sx + 6)<256)) p[ 6] = pal[ q[ 6] | color]; - if (q[ 7] && ((sx + 7) >= 0) && ((sx + 7)<256)) p[ 7] = pal[ q[ 7] | color]; - - if (q[ 8] && ((sx + 8) >= 0) && ((sx + 8)<256)) p[ 8] = pal[ q[ 8] | color]; - if (q[ 9] && ((sx + 9) >= 0) && ((sx + 9)<256)) p[ 9] = pal[ q[ 9] | color]; - if (q[10] && ((sx + 10) >= 0) && ((sx + 10)<256)) p[10] = pal[ q[10] | color]; - if (q[11] && ((sx + 11) >= 0) && ((sx + 11)<256)) p[11] = pal[ q[11] | color]; - if (q[12] && ((sx + 12) >= 0) && ((sx + 12)<256)) p[12] = pal[ q[12] | color]; - if (q[13] && ((sx + 13) >= 0) && ((sx + 13)<256)) p[13] = pal[ q[13] | color]; - if (q[14] && ((sx + 14) >= 0) && ((sx + 14)<256)) p[14] = pal[ q[14] | color]; - if (q[15] && ((sx + 15) >= 0) && ((sx + 15)<256)) p[15] = pal[ q[15] | color]; - } - p += 256; - q += 16; - } - } - } - - return; - } - - if (!flipy) { - - p += 256 * 15; - - if (!flipx) { - - for (INT32 i=0;i<16;i++) { - if (q[ 0]) p[15] = pal[ q[ 0] | color]; - if (q[ 1]) p[14] = pal[ q[ 1] | color]; - if (q[ 2]) p[13] = pal[ q[ 2] | color]; - if (q[ 3]) p[12] = pal[ q[ 3] | color]; - if (q[ 4]) p[11] = pal[ q[ 4] | color]; - if (q[ 5]) p[10] = pal[ q[ 5] | color]; - if (q[ 6]) p[ 9] = pal[ q[ 6] | color]; - if (q[ 7]) p[ 8] = pal[ q[ 7] | color]; - - if (q[ 8]) p[ 7] = pal[ q[ 8] | color]; - if (q[ 9]) p[ 6] = pal[ q[ 9] | color]; - if (q[10]) p[ 5] = pal[ q[10] | color]; - if (q[11]) p[ 4] = pal[ q[11] | color]; - if (q[12]) p[ 3] = pal[ q[12] | color]; - if (q[13]) p[ 2] = pal[ q[13] | color]; - if (q[14]) p[ 1] = pal[ q[14] | color]; - if (q[15]) p[ 0] = pal[ q[15] | color]; - - p -= 256; - q += 16; - } - - } else { - - for (INT32 i=0;i<16;i++) { - if (q[ 0]) p[ 0] = pal[ q[ 0] | color]; - if (q[ 1]) p[ 1] = pal[ q[ 1] | color]; - if (q[ 2]) p[ 2] = pal[ q[ 2] | color]; - if (q[ 3]) p[ 3] = pal[ q[ 3] | color]; - if (q[ 4]) p[ 4] = pal[ q[ 4] | color]; - if (q[ 5]) p[ 5] = pal[ q[ 5] | color]; - if (q[ 6]) p[ 6] = pal[ q[ 6] | color]; - if (q[ 7]) p[ 7] = pal[ q[ 7] | color]; - - if (q[ 8]) p[ 8] = pal[ q[ 8] | color]; - if (q[ 9]) p[ 9] = pal[ q[ 9] | color]; - if (q[10]) p[10] = pal[ q[10] | color]; - if (q[11]) p[11] = pal[ q[11] | color]; - if (q[12]) p[12] = pal[ q[12] | color]; - if (q[13]) p[13] = pal[ q[13] | color]; - if (q[14]) p[14] = pal[ q[14] | color]; - if (q[15]) p[15] = pal[ q[15] | color]; - - p -= 256; - q += 16; - } - } - - } else { - - if (!flipx) { - - for (INT32 i=0;i<16;i++) { - if (q[ 0]) p[15] = pal[ q[ 0] | color]; - if (q[ 1]) p[14] = pal[ q[ 1] | color]; - if (q[ 2]) p[13] = pal[ q[ 2] | color]; - if (q[ 3]) p[12] = pal[ q[ 3] | color]; - if (q[ 4]) p[11] = pal[ q[ 4] | color]; - if (q[ 5]) p[10] = pal[ q[ 5] | color]; - if (q[ 6]) p[ 9] = pal[ q[ 6] | color]; - if (q[ 7]) p[ 8] = pal[ q[ 7] | color]; - - if (q[ 8]) p[ 7] = pal[ q[ 8] | color]; - if (q[ 9]) p[ 6] = pal[ q[ 9] | color]; - if (q[10]) p[ 5] = pal[ q[10] | color]; - if (q[11]) p[ 4] = pal[ q[11] | color]; - if (q[12]) p[ 3] = pal[ q[12] | color]; - if (q[13]) p[ 2] = pal[ q[13] | color]; - if (q[14]) p[ 1] = pal[ q[14] | color]; - if (q[15]) p[ 0] = pal[ q[15] | color]; - - p += 256; - q += 16; - } - - } else { - - for (INT32 i=0;i<16;i++) { - if (q[ 0]) p[ 0] = pal[ q[ 0] | color]; - if (q[ 1]) p[ 1] = pal[ q[ 1] | color]; - if (q[ 2]) p[ 2] = pal[ q[ 2] | color]; - if (q[ 3]) p[ 3] = pal[ q[ 3] | color]; - if (q[ 4]) p[ 4] = pal[ q[ 4] | color]; - if (q[ 5]) p[ 5] = pal[ q[ 5] | color]; - if (q[ 6]) p[ 6] = pal[ q[ 6] | color]; - if (q[ 7]) p[ 7] = pal[ q[ 7] | color]; - - if (q[ 8]) p[ 8] = pal[ q[ 8] | color]; - if (q[ 9]) p[ 9] = pal[ q[ 9] | color]; - if (q[10]) p[10] = pal[ q[10] | color]; - if (q[11]) p[11] = pal[ q[11] | color]; - if (q[12]) p[12] = pal[ q[12] | color]; - if (q[13]) p[13] = pal[ q[13] | color]; - if (q[14]) p[14] = pal[ q[14] | color]; - if (q[15]) p[15] = pal[ q[15] | color]; - - p += 256; - q += 16; - } - - } - - } - -} - -static INT32 GalpanicDraw() -{ - if (RecalcBgPalette) { - for (INT32 i = 0; i < 32768; i++) { - INT32 r = pal5bit(i >> 5); - INT32 g = pal5bit(i >> 10); - INT32 b = pal5bit(i >> 0); - RamCTB64k[i] = BurnHighCol(r, g, b, 0); - } - - RecalcBgPalette = 0; - } - - for (INT32 i = 0; i < 1024; i++) { - UINT16 nColour = RamPal[i]; - INT32 r = pal5bit(nColour >> 6); - INT32 g = pal5bit(nColour >> 11); - INT32 b = pal5bit(nColour >> 1); - RamCurPal[i] = BurnHighCol(r, g, b, 0); - } - - UINT16 * d = (UINT16 *)pBurnDraw + ( 224 * 256 ) - 1; - UINT16 * s = (UINT16 *)RamBg; - UINT16 * f = (UINT16 *)RamFg; - for (INT32 j=0;j<224;j++) { - for (INT32 i=0;i<256;i++) { - if (*f) *d = RamCurPal[*f]; - else *d = RamCTB64k[*s >> 1]; - d--; - s++; - f++; - } - } - - INT32 sx, sy; - sx = sy = 0; - for (INT32 offs=0; offs<0x002400; offs+=0x08) { - INT32 x,y,code,color,flipx,flipy,attr1,attr2; - - attr1 = RamSpr[offs + 3]; - x = RamSpr[offs + 4] - ((attr1 & 0x01) << 8); - y = RamSpr[offs + 5] + ((attr1 & 0x02) << 7); - if (attr1 & 0x04) /* multi sprite */ - { - sx += x; - sy += y; - } - else - { - sx = x; - sy = y; - } - - color = (attr1 & 0xf0); - - /* bit 0 [offs + 0] is used but I don't know what for */ - - attr2 = RamSpr[offs + 7]; - code = RamSpr[offs + 6] + ((attr2 & 0x1f) << 8); - flipx = attr2 & 0x80; - flipy = attr2 & 0x40; - - drawgfx(code, color, flipx, flipy, 256-sx-16, 224-(sy - 16)-16); - //drawgfx(code, color, flipx, flipy, sx, (sy - 16)); - } - - return 0; -} - -static INT32 ComadDraw() -{ - if (RecalcBgPalette) { - for (INT32 i = 0; i < 32768; i++) { - INT32 r = pal5bit(i >> 5); - INT32 g = pal5bit(i >> 10); - INT32 b = pal5bit(i >> 0); - RamCTB64k[i] = BurnHighCol(r, g, b, 0); - } - - RecalcBgPalette = 0; - } - - for (INT32 i = 0; i < 1024; i++) { - UINT16 nColour = RamPal[i]; - INT32 r = pal5bit(nColour >> 6); - INT32 g = pal5bit(nColour >> 11); - INT32 b = pal5bit(nColour >> 1); - RamCurPal[i] = BurnHighCol(r, g, b, 0); - } - - UINT16 * d = (UINT16 *)pBurnDraw + ( 224 * 256 ) - 1; - UINT16 * s = (UINT16 *)RamBg; - UINT16 * f = (UINT16 *)RamFg; - for (INT32 j=0;j<224;j++) { - for (INT32 i=0;i<256;i++) { - if (*f) *d = RamCurPal[*f]; - else *d = RamCTB64k[*s >> 1]; - d--; - s++; - f++; - } - } - - INT32 sx, sy; - sx = sy = 0; - for (INT32 offs=0; offs<0x000800; offs+=4) { - INT32 code,color,flipx,flipy; - - code = RamSpr[offs + 1] & 0x1fff; - color = (RamSpr[offs] & 0x003c) << 2; - flipx = RamSpr[offs] & 0x0002; - flipy = RamSpr[offs] & 0x0001; - - if((RamSpr[offs] & 0x6000) == 0x6000) /* Link bits */ - { - sx += RamSpr[offs + 2] >> 6; - sy += RamSpr[offs + 3] >> 6; - } - else - { - sx = RamSpr[offs + 2] >> 6; - sy = RamSpr[offs + 3] >> 6; - } - - sx = (sx&0x1ff) - (sx&0x200); - sy = (sy&0x1ff) - (sy&0x200); - - drawgfx(code, color, flipx, flipy, 256-sx-16, 224-sy-16); - } - - return 0; -} - -static INT32 GalpanicFrame() -{ - if (DrvReset) // Reset machine - DrvDoReset(); - - DrvInput[1] = 0x0000; // Joy1 - DrvInput[3] = 0x0000; // Joy2 - DrvInput[5] = 0x0000; // Buttons - for (INT32 i = 0; i < 5; i++) { - DrvInput[1] |= (DrvJoy1[i] & 1) << i; - DrvInput[3] |= (DrvJoy2[i] & 1) << i; - } - for (INT32 i = 0; i < 7; i++) { - DrvInput[5] |= (DrvButton[i] & 1) << i; - } - - nCyclesTotal[0] = (INT32)((INT64)12000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - - SekNewFrame(); - - SekOpen(0); - - SekRun(nCyclesTotal[0] / 2); - SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); // let game run ??? - SekRun(nCyclesTotal[0] / 2); - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); // update palette - - SekClose(); - - if (pBurnDraw) - GalpanicDraw(); // Draw screen if needed - if (pBurnSoundOut) - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - - return 0; -} - -static INT32 ComadFrame() -{ - if (DrvReset) // Reset machine - DrvDoReset(); - - DrvInput[1] = 0x0000; // Joy1 - DrvInput[3] = 0x0000; // Joy2 - DrvInput[5] = 0x0000; // Buttons - for (INT32 i = 0; i < 5; i++) { - DrvInput[1] |= (DrvJoy1[i] & 1) << i; - DrvInput[3] |= (DrvJoy2[i] & 1) << i; - } - for (INT32 i = 0; i < 7; i++) { - DrvInput[5] |= (DrvButton[i] & 1) << i; - } - - // Clear Opposites - ComadClearOpposites(&DrvInput[1]); - ComadClearOpposites(&DrvInput[3]); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "supmodel") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fantsia2") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fantsia2a") || !strcmp(BurnDrvGetTextA(DRV_NAME), "fantsia2n") || !strcmp(BurnDrvGetTextA(DRV_NAME), "wownfant") || !strcmp(BurnDrvGetTextA(DRV_NAME), "missw02")) { - nCyclesTotal[0] = (INT32)((INT64)12000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - } else { - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - } - - SekOpen(0); - SekNewFrame(); - - SekRun(nCyclesTotal[0] / 4); - SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); // let game run - SekRun(nCyclesTotal[0] / 4); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); // enable icons - SekRun(nCyclesTotal[0] / 4); - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); // update palette - SekRun(nCyclesTotal[0] / 4); - - SekClose(); - - if (pBurnSoundOut) - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - - if (pBurnDraw) - ComadDraw(); // Draw screen if needed - - return 0; -} - -static INT32 GalhustlFrame() -{ - if (DrvReset) // Reset machine - DrvDoReset(); - - DrvInput[1] = 0x0000; // Joy1 - DrvInput[3] = 0x0000; // Joy2 - DrvInput[5] = 0x0000; // Buttons - for (INT32 i = 0; i < 8; i++) { - DrvInput[1] |= (DrvJoy1[i] & 1) << i; - DrvInput[3] |= (DrvJoy2[i] & 1) << i; - } - for (INT32 i = 0; i < 7; i++) { - DrvInput[5] |= (DrvButton[i] & 1) << i; - } - - INT32 nInterleave = 4; - - nCyclesTotal[0] = (INT32)((INT64)12000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesDone[0] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 1) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 2) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 3) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - if (pBurnSoundOut) - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - - if (pBurnDraw) - ComadDraw(); // Draw screen if needed - - return 0; -} - -static INT32 GalpanicScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029671; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // Scan 68000 - - MSM6295Scan(0, nAction); // Scan OKIM6295 - - // Scan critical driver variables - SCAN_VAR(SndBank); - SCAN_VAR(DrvInput); - SCAN_VAR(RamCurPal); - SCAN_VAR(RamCTB64k); - - BurnRandomScan(nAction); - - if (nAction & ACB_WRITE) { - memcpy(&RomSnd[0x30000], &RomSnd[0x40000 + SndBank * 0x10000], 0x10000); - } - } - - return 0; -} - -struct BurnDriver BurnDrvGalpanic = { - "galpanic", NULL, NULL, NULL, "1990", - "Gals Panic (Unprotected)\0", NULL, "Kaneko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, GalpanicRomInfo, GalpanicRomName, NULL, NULL, GalpanicInputInfo, GalpanicDIPInfo, - GalpanicInit, GalpanicExit, GalpanicFrame, GalpanicDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFantasia = { - "fantasia", NULL, NULL, NULL, "1994", - "Fantasia (940429 PCB, set 1)\0", NULL, "Comad / New Japan System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, FantasiaRomInfo, FantasiaRomName, NULL, NULL, GalpanicInputInfo, FantasiaDIPInfo, - FantasiaInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFantasiaa = { - "fantasiaa", "fantasia", NULL, NULL, "1994", - "Fantasia (940307 PCB)\0", NULL, "Comad / New Japan System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, FantasiaaRomInfo, FantasiaaRomName, NULL, NULL, GalpanicInputInfo, FantasiaDIPInfo, - FantasiaInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFantasiab = { - "fantasiab", "fantasia", NULL, NULL, "1994", - "Fantasia (940429 PCB, set 2)\0", NULL, "Comad / New Japan System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, FantasiabRomInfo, FantasiabRomName, NULL, NULL, GalpanicInputInfo, FantasiaDIPInfo, - FantasiaInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFantasian = { - "fantasian", "fantasia", NULL, NULL, "1994", - "Fantasia (940803 PCB)\0", NULL, "Comad / New Japan System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, FantasianRomInfo, FantasianRomName, NULL, NULL, GalpanicInputInfo, FantasiaDIPInfo, - FantasiaInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvSupmodel = { - "supmodel", NULL, NULL, NULL, "1994", - "Super Model\0", NULL, "Comad / New Japan System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, SupmodelRomInfo, SupmodelRomName, NULL, NULL, GalpanicInputInfo, FantasiaDIPInfo, - FantasiaInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNewfant = { - "newfant", NULL, NULL, NULL, "1995", - "New Fantasia (1995 copyright)\0", NULL, "Comad / New Japan System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, NewfantRomInfo, NewfantRomName, NULL, NULL, GalpanicInputInfo, FantasiaDIPInfo, - FantasiaInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvNewfanta = { - "newfanta", "newfant", NULL, NULL, "1995", - "New Fantasia (1994 copyright)\0", NULL, "Comad / New Japan System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, NewfantaRomInfo, NewfantaRomName, NULL, NULL, GalpanicInputInfo, FantasiaDIPInfo, - FantasiaInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFantsy95 = { - "fantsy95", "newfant", NULL, NULL, "1995", - "Fantasy '95\0", NULL, "Hi-max Technology Inc.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Fantsy95RomInfo, Fantsy95RomName, NULL, NULL, GalpanicInputInfo, FantasiaDIPInfo, - FantasiaInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvMissw96 = { - "missw96", NULL, NULL, NULL, "1996", - "Miss World '96 (Nude) (set1)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Missw96RomInfo, Missw96RomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - Missw96Init, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMissw96a = { - "missw96a", "missw96", NULL, NULL, "1996", - "Miss World '96 (Nude) (set 2)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Missw96aRomInfo, Missw96aRomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - Missw96Init, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMissw96b = { - "missw96b", "missw96", NULL, NULL, "1996", - "Miss World '96 (Nude) (set 3)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Missw96bRomInfo, Missw96bRomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - Missw96Init, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMissw96c = { - "missw96c", "missw96", NULL, NULL, "1996", - "Miss World '96 (Nude) (set 4)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Missw96cRomInfo, Missw96cRomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - Missw96Init, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMissmw96 = { - "missmw96", "missw96", NULL, NULL, "1996", - "Miss Mister World '96 (Nude)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Missmw96RomInfo, Missmw96RomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - Missw96Init, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantsia2 = { - "fantsia2", NULL, NULL, NULL, "1997", - "Fantasia II (Explicit)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Fantsia2RomInfo, Fantsia2RomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - Fantsia2Init, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantsia2a = { - "fantsia2a", "fantsia2", NULL, NULL, "1997", - "Fantasia II (Less Explicit)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Fantsia2aRomInfo, Fantsia2aRomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - Fantsia2Init, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantsia2n = { - "fantsia2n", "fantsia2", NULL, NULL, "1998", - "Fantasia II (1998)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Fantsia2nRomInfo, Fantsia2nRomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - Fantsia2Init, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWownfant = { - "wownfant", NULL, NULL, NULL, "2002", - "WOW New Fantasia\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, WownfantRomInfo, WownfantRomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - WownfantInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMissw02 = { - "missw02", NULL, NULL, NULL, "2002", - "Miss World 2002\0", NULL, "Daigom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Missw02RomInfo, Missw02RomName, NULL, NULL, GalpanicInputInfo, Missw96DIPInfo, - WownfantInit, GalpanicExit, ComadFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPgalvip = { - "pgalvip", NULL, NULL, NULL, "1996", - "Pocket Gals V.I.P (set 1)\0", NULL, "ACE International / Afega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, PgalvipRomInfo, PgalvipRomName, NULL, NULL, GalhustlInputInfo, GalhustlDIPInfo, - GalhustlInit, GalpanicExit, GalhustlFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGalhustl = { - "galhustl", "pgalvip", NULL, NULL, "1997", - "Gals Hustler\0", NULL, "ACE International", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, GalhustlRomInfo, GalhustlRomName, NULL, NULL, GalhustlInputInfo, GalhustlDIPInfo, - GalhustlInit, GalpanicExit, GalhustlFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPgalvipa = { - "pgalvipa", "pgalvip", NULL, NULL, "1996", - "Pocket Gals V.I.P (set 2)\0", NULL, "unknown", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_16BIT_ONLY | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, PgalvipaRomInfo, PgalvipaRomName, NULL, NULL, GalhustlInputInfo, GalhustlDIPInfo, - GalhustlInit, GalpanicExit, GalhustlFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvZipzap = { - "zipzap", NULL, NULL, NULL, "1995", - "Zip & Zap\0", "Imperfect GFXs, No Sound", "Barko Corp", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_MISC_POST90S, GBF_BREAKOUT, 0, - NULL, ZipzapRomInfo, ZipzapRomName, NULL, NULL, GalhustlInputInfo, ZipzapDIPInfo, - ZipzapInit, GalpanicExit, GalhustlFrame, ComadDraw, GalpanicScan, &RecalcBgPalette, 0x400, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pst90s/d_galspnbl.cpp b/jan/src/burn/drv/pst90s/d_galspnbl.cpp deleted file mode 100644 index 5fb7031b9..000000000 --- a/jan/src/burn/drv/pst90s/d_galspnbl.cpp +++ /dev/null @@ -1,676 +0,0 @@ -// FB Alpha Gals Pinball driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "msm6295.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; - -static UINT16 DrvInputs[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 game_select; - -static struct BurnInputInfo GalspnblInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"Left Flippers", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"Right Flippers", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"Launch Ball / Tilt", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Galspnbl) - -static struct BurnDIPInfo GalspnblDIPList[]= -{ - {0x07, 0xff, 0xff, 0xff, NULL }, - {0x08, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x07, 0x01, 0x03, 0x02, "Easy" }, - {0x07, 0x01, 0x03, 0x03, "Normal" }, - {0x07, 0x01, 0x03, 0x01, "Hard" }, - {0x07, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Extra Ball" }, - {0x07, 0x01, 0x0c, 0x04, "100K 500K" }, - {0x07, 0x01, 0x0c, 0x0c, "200K 800K" }, - {0x07, 0x01, 0x0c, 0x08, "200K only" }, - {0x07, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Hit Difficulty" }, - {0x07, 0x01, 0x10, 0x10, "Normal" }, - {0x07, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Slide Show" }, - {0x07, 0x01, 0x20, 0x20, "Off" }, - {0x07, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x07, 0x01, 0x40, 0x00, "Off" }, - {0x07, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x08, 0x01, 0x07, 0x02, "4 Coins 1 Credits" }, - {0x08, 0x01, 0x07, 0x03, "3 Coins 1 Credits" }, - {0x08, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x08, 0x01, 0x07, 0x01, "2 Coins/1 Credit 3/2" }, - {0x08, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x08, 0x01, 0x07, 0x06, "1 Coin/1 Credit 2/3" }, - {0x08, 0x01, 0x07, 0x00, "1 Coin/1 Credit 5/6" }, - {0x08, 0x01, 0x07, 0x05, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x08, 0x01, 0x38, 0x10, "4 Coins 1 Credits" }, - {0x08, 0x01, 0x38, 0x18, "3 Coins 1 Credits" }, - {0x08, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x08, 0x01, 0x38, 0x08, "2 Coins/1 Credit 3/2" }, - {0x08, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x08, 0x01, 0x38, 0x30, "1 Coin/1 Credit 2/3" }, - {0x08, 0x01, 0x38, 0x00, "1 Coin/1 Credit 5/6" }, - {0x08, 0x01, 0x38, 0x28, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Balls" }, - {0x08, 0x01, 0xc0, 0x00, "2" }, - {0x08, 0x01, 0xc0, 0xc0, "3" }, - {0x08, 0x01, 0xc0, 0x80, "4" }, - {0x08, 0x01, 0xc0, 0x40, "5" }, -}; - -STDDIPINFO(Galspnbl) - -void __fastcall galspnbl_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xa80011: - *soundlatch = data; - ZetNmi(); - return; - - case 0xa80051: // scroll (unused) - return; - } -} - -UINT8 __fastcall galspnbl_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xa80001: - return DrvInputs[0]; - - case 0xa80011: - return DrvInputs[1]; - - case 0xa80021: - return DrvInputs[2] ^ 0x03; - - case 0xa80031: - return DrvDips[0]; - - case 0xa80041: - return DrvDips[1]; - } - - return 0; -} - -static inline void palette_update(UINT16 i) -{ - UINT16 p = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + i))); - - INT32 b = (p >> 8) & 0x0f; - INT32 g = (p >> 4) & 0x0f; - INT32 r = (p >> 0) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[0x8000+(i/2)] = BurnHighCol(r, g, b, 0); -} - -void __fastcall galspnbl_palette_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + (address & 0x7fe))) = BURN_ENDIAN_SWAP_INT16(data); - palette_update(address & 0x7fe); -} - -void __fastcall galspnbl_palette_write_byte(UINT32 address, UINT8 data) -{ - DrvPalRAM[(address & 0x7ff) ^ 1] = data; - palette_update(address & 0x7fe); -} - -void __fastcall galspnbl_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf800: - MSM6295Command(0, data); - return; - - case 0xf810: - case 0xf811: - BurnYM3812Write(0, address & 1, data); - return; - } -} - -UINT8 __fastcall galspnbl_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return MSM6295ReadStatus(0); - - case 0xf810: - case 0xf811: - return BurnYM3812Read(0, address & 1); - - case 0xfc20: - return *soundlatch; - } - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static void DrvYM3812IrqHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM3812Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x400000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x080000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x8400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x004000; - Drv68KRAM1 = Next; Next += 0x008000; - DrvVidRAM0 = Next; Next += 0x004000; - DrvVidRAM1 = Next; Next += 0x040000; - DrvColRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvStaticPaletteInit() -{ - for (INT32 i = 0; i < 0x8000; i++) - { - INT32 r = (BURN_ENDIAN_SWAP_INT16(i) >> 5) & 0x1f; - INT32 g = (BURN_ENDIAN_SWAP_INT16(i) >> 10) & 0x1f; - INT32 b = (BURN_ENDIAN_SWAP_INT16(i) >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void DrvGfxExpand(UINT8 *s, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i -= 2) - { - s[i+1] = s[i/2] & 0x0f; - s[i+0] = s[i/2] >> 4; - } -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 3, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x200001, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x200000, 5, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x300001, 6, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x300000, 7, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 10, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 12, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 13, 1)) return 1; - - DrvGfxExpand(DrvGfxROM0, 0x80000); - DrvGfxExpand(DrvGfxROM1, 0x40000); - DrvStaticPaletteInit(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x3fffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x700000, 0x703fff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x708000, 0x70ffff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x800000, 0x803fff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x808000, 0x80ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x880000, 0x880fff, MAP_RAM); - SekMapMemory(DrvColRAM, 0x900000, 0x900fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x904000, 0x904fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x980000, 0x9bffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xa01000, 0xa017ff, MAP_ROM); - SekMapHandler(1, 0xa01000, 0xa017ff, MAP_WRITE); -// SekSetWriteWordHandler(0, galspnbl_main_write_word); - SekSetWriteByteHandler(0, galspnbl_main_write_byte); -// SekSetReadWordHandler(0, galspnbl_main_read_word); - SekSetReadByteHandler(0, galspnbl_main_read_byte); - SekSetWriteByteHandler(1, galspnbl_palette_write_byte); - SekSetWriteWordHandler(1, galspnbl_palette_write_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(galspnbl_sound_write); - ZetSetReadHandler(galspnbl_sound_read); - ZetClose(); - - BurnYM3812Init(1, 3579545, &DrvYM3812IrqHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - game_select = select; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - MSM6295Exit(0); - BurnYM3812Exit(); - - SekExit(); - ZetExit(); - - GenericTilesExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_pixel_layer() -{ - UINT16 *ram = ((UINT16*)DrvVidRAM1) + 16 * 512; - UINT16 *dst = pTransDraw; - - for (INT32 y = 0; y < 224; y++) - { - for (INT32 x = 0; x < nScreenWidth; x++) - { - dst[x] = ram[x] >> 1; - } - - dst += nScreenWidth; - ram += 512; - } -} - -static void draw_fg_layer() -{ - UINT16 *vid = (UINT16*)DrvVidRAM0; - UINT16 *col = (UINT16*)DrvColRAM; - - for (INT32 offs = 0; offs < 0x1000 / 2; offs++) - { - INT32 sx = (offs & 0x3f) * 16; - INT32 sy = (offs / 0x40) * 8 - 16; - - if (sx >= nScreenWidth || sy < 0) continue; - if (sy >= nScreenHeight) break; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vid[offs]) & 0x1fff; - INT32 attr = BURN_ENDIAN_SWAP_INT16(col[offs]); - INT32 color = (attr & 0x00f0) >> 4; - - if (attr & 0x0008) continue; - - Render8x8Tile_Mask_Clip(pTransDraw, code*2+0, sx + 0, sy, color, 4, 0, 0x8200, DrvGfxROM0); - Render8x8Tile_Mask_Clip(pTransDraw, code*2+1, sx + 8, sy, color, 4, 0, 0x8200, DrvGfxROM0); - } -} - -static void draw_sprites(int priority) -{ - UINT16 *spriteram = (UINT16*)DrvSprRAM; - - for (INT32 offs = (0x1000 - 16) / 2; offs >= 0; offs -= 8) - { - INT32 attr = BURN_ENDIAN_SWAP_INT16(spriteram[offs]); - - if ((attr & 0x0004) && ((attr & 0x0040) == 0 || (nCurrentFrame & 1)) && (attr & 0x0020) == priority) - { - INT32 code = BURN_ENDIAN_SWAP_INT16(spriteram[offs + 1]) & 0x3fff; - INT32 color = BURN_ENDIAN_SWAP_INT16(spriteram[offs + 2]); - INT32 sy = BURN_ENDIAN_SWAP_INT16(spriteram[offs + 3]) - 16; - INT32 sx = BURN_ENDIAN_SWAP_INT16(spriteram[offs + 4]); - INT32 size = 1 << (color & 0x0003); - color = (color & 0x00f0) >> 4; - INT32 flipx = attr & 0x0001; - INT32 flipy = attr & 0x0002; - - for (INT32 row = 0; row < size; row++) - { - for (INT32 col = 0; col < size; col++) - { - INT32 x = sx + 8 * (flipx ? (size - 1 - col) : col); - INT32 y = sy + 8 * (flipy ? (size - 1 - row) : row); - - INT32 tile = code + ((row & 1) << 1) + ((row & 2) << 2) + ((row & 4) << 3) + (col & 1) + ((col & 2) << 1) + ((col & 4) << 2); - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, tile, x, y, color, 4, 0, 0x8000, DrvGfxROM1); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, tile, x, y, color, 4, 0, 0x8000, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, tile, x, y, color, 4, 0, 0x8000, DrvGfxROM1); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, tile, x, y, color, 4, 0, 0x8000, DrvGfxROM1); - } - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvStaticPaletteInit(); - - for (INT32 i = 0; i < 0x800; i+=2) { - palette_update(i); - } - - DrvRecalc = 0; - } - - if(~nBurnLayer & 1) BurnTransferClear(); - if (nBurnLayer & 1) draw_pixel_layer(); - if (nBurnLayer & 2) draw_sprites(0x00); - if (nBurnLayer & 4) draw_fg_layer(); - if (nBurnLayer & 8) draw_sprites(0x20); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3 * sizeof(UINT16)); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - - if (game_select) { // Right flipper button is swapped - DrvInputs[1] = ((DrvInputs[1] & 0x20) >> 1) | (DrvInputs[1] & 0xcf) | 0x20; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 10000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - - nSegment = nCyclesTotal[1] / nInterleave; - BurnTimerUpdateYM3812((1 + i) * nSegment); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - } - - return 0; -} - - -// Gals Pinball - -static struct BurnRomInfo galspnblRomDesc[] = { - { "7.rom", 0x80000, 0xce0189bf, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "3.rom", 0x80000, 0x9b0a8744, 1 | BRF_PRG | BRF_ESS }, // 1 - { "8.rom", 0x80000, 0xeee2f087, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.rom", 0x80000, 0x56298489, 1 | BRF_PRG | BRF_ESS }, // 3 - { "9.rom", 0x80000, 0xd9e4964c, 1 | BRF_PRG | BRF_ESS }, // 4 - { "5.rom", 0x80000, 0xa5e71ee4, 1 | BRF_PRG | BRF_ESS }, // 5 - { "10.rom", 0x80000, 0x3a20e1e5, 1 | BRF_PRG | BRF_ESS }, // 6 - { "6.rom", 0x80000, 0x94927d20, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "2.rom", 0x10000, 0xfae688a7, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "17.rom", 0x40000, 0x7d435701, 3 | BRF_GRA }, // 9 Foreground Tiles - { "18.rom", 0x40000, 0x136adaac, 3 | BRF_GRA }, // 10 - - { "15.rom", 0x20000, 0x4beb840d, 4 | BRF_GRA }, // 11 Sprite Tiles - { "16.rom", 0x20000, 0x93d3c610, 4 | BRF_GRA }, // 12 - - { "1.rom", 0x40000, 0x93c06d3d, 5 | BRF_SND }, // 13 MSM6295 Samples -}; - -STD_ROM_PICK(galspnbl) -STD_ROM_FN(galspnbl) - -static INT32 galspnblInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvGalspnbl = { - "galspnbl", NULL, NULL, NULL, "1996", - "Gals Pinball\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_MISC_POST90S, GBF_PINBALL, 0, - NULL, galspnblRomInfo, galspnblRomName, NULL, NULL, GalspnblInputInfo, GalspnblDIPInfo, - galspnblInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8400, - 224, 512, 3, 4 -}; - - -// Hot Pinball - -static struct BurnRomInfo hotpinblRomDesc[] = { - { "hp_07.bin", 0x80000, 0x978cc13e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "hp_03.bin", 0x80000, 0x68388726, 1 | BRF_PRG | BRF_ESS }, // 1 - { "hp_08.bin", 0x80000, 0xbd16be12, 1 | BRF_PRG | BRF_ESS }, // 2 - { "hp_04.bin", 0x80000, 0x655b0cf0, 1 | BRF_PRG | BRF_ESS }, // 3 - { "hp_09.bin", 0x80000, 0xa6368624, 1 | BRF_PRG | BRF_ESS }, // 4 - { "hp_05.bin", 0x80000, 0x48efd028, 1 | BRF_PRG | BRF_ESS }, // 5 - { "hp_10.bin", 0x80000, 0xa5c63e34, 1 | BRF_PRG | BRF_ESS }, // 6 - { "hp_06.bin", 0x80000, 0x513eda91, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "hp_02.bin", 0x10000, 0x82698269, 2 | BRF_PRG | BRF_ESS }, // 8 Z80 Code - - { "hp_13.bin", 0x40000, 0xd53b64b9, 3 | BRF_GRA }, // 9 Foreground Tiles - { "hp_14.bin", 0x40000, 0x2fe3fcee, 3 | BRF_GRA }, // 10 - - { "hp_11.bin", 0x20000, 0xdeecd7f1, 4 | BRF_GRA }, // 11 Sprite Tiles - { "hp_12.bin", 0x20000, 0x5fd603c2, 4 | BRF_GRA }, // 12 - - { "hp_01.bin", 0x40000, 0x93c06d3d, 5 | BRF_SND }, // 13 MSM6295 Samples -}; - -STD_ROM_PICK(hotpinbl) -STD_ROM_FN(hotpinbl) - -static INT32 hotpinblInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvHotpinbl = { - "hotpinbl", NULL, NULL, NULL, "1995", - "Hot Pinball\0", NULL, "Comad & New Japan System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 1, HARDWARE_MISC_POST90S, GBF_PINBALL, 0, - NULL, hotpinblRomInfo, hotpinblRomName, NULL, NULL, GalspnblInputInfo, GalspnblDIPInfo, - hotpinblInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8400, - 224, 512, 3, 4 -}; diff --git a/jan/src/burn/drv/pst90s/d_gotcha.cpp b/jan/src/burn/drv/pst90s/d_gotcha.cpp deleted file mode 100644 index 1ca5ce1dd..000000000 --- a/jan/src/burn/drv/pst90s/d_gotcha.cpp +++ /dev/null @@ -1,666 +0,0 @@ -// FB Alpha "Got-ya" driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSndROM; -static UINT8 *DrvSndBank; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvGfxBank; -static UINT16 *DrvScrollx; -static UINT16 *DrvScrolly; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static UINT8 *bankselect; -static UINT8 *soundlatch; - -static struct BurnInputInfo GotchaInputList[] = { - {"Coin A", BIT_DIGITAL, DrvJoy2 + 8, "p1 coin" }, - {"Coin B", BIT_DIGITAL, DrvJoy2 + 9, "p2 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 3" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p2 fire 3" }, - - {"P3 Start", BIT_DIGITAL, DrvJoy1 + 11, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy1 + 8, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy1 + 9, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy1 + 10, "p3 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Gotcha) - -static struct BurnDIPInfo GotchaDIPList[]= -{ - {0x0f, 0xff, 0xff, 0x97, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x0f, 0x01, 0x07, 0x07, "1" }, - {0x0f, 0x01, 0x07, 0x06, "2" }, - {0x0f, 0x01, 0x07, 0x05, "3" }, - {0x0f, 0x01, 0x07, 0x04, "4" }, - {0x0f, 0x01, 0x07, 0x03, "5" }, - {0x0f, 0x01, 0x07, 0x02, "6" }, - {0x0f, 0x01, 0x07, 0x01, "7" }, - {0x0f, 0x01, 0x07, 0x00, "8" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x08, "Off" }, - {0x0f, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x30, "1" }, - {0x0f, 0x01, 0x30, 0x20, "2" }, - {0x0f, 0x01, 0x30, 0x10, "3" }, - {0x0f, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0f, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin/99 Credits" }, - - {0 , 0xfe, 0 , 2, "Info" }, - {0x10, 0x01, 0x01, 0x01, "Off" }, - {0x10, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Explane Type" }, - {0x10, 0x01, 0x02, 0x02, "Off" }, - {0x10, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Game Selection" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Gotcha) - -static void set_okibank(INT32 data) -{ - *DrvSndBank = data & 1; - - INT32 nBank = (~data & 1) << 18; - - memcpy(MSM6295ROM + 0x00000, DrvSndROM + nBank, 0x40000); -} - -void __fastcall gotcha_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x100004: - set_okibank(data); - return; - - case 0x300000: - *bankselect = data & 3; - return; - - case 0x30000e: - DrvGfxBank[*bankselect] = data & 0x0f; - return; - } -} - -void __fastcall gotcha_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x100000: - *soundlatch = data & 0xff; - return; - - case 0x300002: - case 0x300006: - DrvScrollx[(address >> 2) & 1] = data & 0x3ff; - return; - - case 0x300004: - case 0x300008: - DrvScrolly[(address >> 3) & 1] = (data + 8) & 0x1ff; - return; - } -} - -UINT8 __fastcall gotcha_read_byte(UINT32 address) -{ - switch (address) - { - case 0x180002: - return DrvInputs[1] >> 8; - } - - return 0; -} - -UINT16 __fastcall gotcha_read_word(UINT32 address) -{ - switch (address) - { - case 0x180000: - return DrvInputs[0]; - - case 0x180004: - return DrvInputs[2]; - } - - return 0; -} - -void __fastcall gotcha_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xc002: - case 0xc003: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall gotcha_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc001: - return BurnYM2151ReadStatus(); - - case 0xc006: - return *soundlatch; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - set_okibank(1); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - -// MSM6295ROM = Next; - MSM6295ROM = Next; Next += 0x040000; - DrvSndROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - DrvScrollx = (UINT16*)Next; Next += 0x000002 * sizeof(UINT16); - DrvScrolly = (UINT16*)Next; Next += 0x000002 * sizeof(UINT16); - - DrvGfxBank = Next; Next += 0x000004; - - DrvSndBank = Next; Next += 0x000001; - - bankselect = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0x000000, 0x400000, 0x800000, 0xc00000 }; - INT32 XOffs[16] = { 0x080, 0x081, 0x082, 0x083, 0x084, 0x085, 0x086, 0x087, - 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007 }; - INT32 YOffs[16] = { 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038, - 0x040, 0x048, 0x050, 0x058, 0x060, 0x068, 0x070, 0x078 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -void DrvYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; // gfx0 - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 4, 1)) return 1; // gfx0 - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 5, 1)) return 1; // gfx0 - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 6, 1)) return 1; // gfx0 - for (INT32 i = 0; i < 0x200000; i++) { - INT32 j = ((i & 0x20000) << 3) | ((i & 0x1c0000) >> 1) | ((i & 0x1ffff)^0x10); - DrvGfxROM0[j] = DrvGfxROM1[i]; - } - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; // gfx0 - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 8, 1)) return 1; // gfx0 - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 9, 1)) return 1; // gfx0 - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 10, 1)) return 1; // gfx0 - - if (BurnLoadRom(DrvSndROM, 11, 1)) return 1; - memcpy(MSM6295ROM, DrvSndROM, 0x40000); - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x120000, 0x12ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x160000, 0x1607ff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x320000, 0x320fff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x322000, 0x322fff, MAP_RAM); - SekSetWriteWordHandler(0, gotcha_write_word); - SekSetWriteByteHandler(0, gotcha_write_byte); - SekSetReadWordHandler(0, gotcha_read_word); - SekSetReadByteHandler(0, gotcha_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xd000, 0xd7ff, 0, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(gotcha_sound_write); - ZetSetReadHandler(gotcha_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetAllRoutes(0.80, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_layer(UINT8 *ram, INT32 col, INT32 scrollx, INT32 scrolly, INT32 transp) -{ - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 4; - INT32 sy = (offs >> 6) << 4; - - sx -= scrollx; - if (sx < -15) sx += 0x400; - sy -= scrolly; - if (sy < -15) sy += 0x200; - - INT32 ofst = (offs & 0x1f) | ((offs & 0x7c0)>>1) | ((offs & 0x20) << 5); - - INT32 attr = vram[ofst]; - INT32 code = (attr & 0x3ff) | (DrvGfxBank[(attr >> 10) & 3] << 10); - INT32 color = (attr >> 12) | col; - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, transp, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - UINT16 *vram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x800/2; offs += 4) - { - INT32 sx = 0x13b - ((vram[offs + 2] + 0x10) & 0x1ff); - INT32 sy = vram[offs + 0] + 8; - INT32 code = vram[offs + 1] & 0x3fff; - INT32 color = vram[offs + 2] >> 9; - INT32 height = 1 << ((vram[offs + 0] & 0x0600) >> 9); - INT32 flipx = vram[offs + 0] & 0x2000; - INT32 flipy = vram[offs + 0] & 0x4000; - - for (INT32 y = 0; y < height; y++) - { - INT32 yy = 0x101 - ((sy + 0x10 * (height - y)) & 0x1ff); - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code + height-1 - y, sx, yy, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code + height-1 - y, sx, yy, color, 4, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code + y, sx, yy, color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code + y, sx, yy, color, 4, 0, 0, DrvGfxROM1); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x600/2; i++) { - INT32 d = pal[i]; - - r = (d >> 10) & 0x1f; - g = (d >> 5) & 0x1f; - b = (d >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - } - - draw_layer(DrvBgRAM, 32, DrvScrollx[1]+5, DrvScrolly[1], ~0); - draw_layer(DrvFgRAM, 16, DrvScrollx[0]+1, DrvScrolly[0], 0); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - DrvInputs[2] = (DrvDips[0]) | (DrvDips[1] << 8); - } - - INT32 nSegment; - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 14318180 / 60, 6000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nSegment); - - nSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - nCyclesDone[1] += ZetRun(nSegment); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - set_okibank(*DrvSndBank); - } - - return 0; -} - - -// Got-cha Mini Game Festival - -static struct BurnRomInfo gotchaRomDesc[] = { - { "gotcha.u3", 0x40000, 0x5e5d52e0, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gotcha.u2", 0x40000, 0x3aa8eaff, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gotcha_u.z02", 0x10000, 0xf4f6e16b, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "gotcha-u.42a", 0x80000, 0x4ea822f0, 3 | BRF_GRA }, // 3 Tiles - { "gotcha-u.42b", 0x80000, 0x6bb529ac, 3 | BRF_GRA }, // 4 - { "gotcha-u.41a", 0x80000, 0x49299b7b, 3 | BRF_GRA }, // 5 - { "gotcha-u.41b", 0x80000, 0xc093f04e, 3 | BRF_GRA }, // 6 - - { "gotcha.u56", 0x80000, 0x85f6a062, 4 | BRF_GRA }, // 7 Sprites - { "gotcha.u55", 0x80000, 0x426b4e48, 4 | BRF_GRA }, // 8 - { "gotcha.u54", 0x80000, 0x903e05a4, 4 | BRF_GRA }, // 9 - { "gotcha.u53", 0x80000, 0x3c24d51e, 4 | BRF_GRA }, // 10 - - { "gotcha-u.z11", 0x80000, 0x6111c6ae, 5 | BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(gotcha) -STD_ROM_FN(gotcha) - -struct BurnDriver BurnDrvGotcha = { - "gotcha", NULL, NULL, NULL, "1997", - "Got-cha Mini Game Festival\0", NULL, "Dongsung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, gotchaRomInfo, gotchaRomName, NULL, NULL, GotchaInputInfo, GotchaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; - - -// Pasha Pasha Champ Mini Game Festival - -static struct BurnRomInfo ppchampRomDesc[] = { - { "u3", 0x40000, 0xf56c0fc2, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u2", 0x40000, 0xa941ffdc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "uz02", 0x10000, 0xf4f6e16b, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "u42a", 0x80000, 0xf0b521d1, 3 | BRF_GRA }, // 3 Tiles - { "u42b", 0x80000, 0x1107918e, 3 | BRF_GRA }, // 4 - { "u41a", 0x80000, 0x3f567d33, 3 | BRF_GRA }, // 5 - { "u41b", 0x80000, 0x18a3497e, 3 | BRF_GRA }, // 6 - - { "u56", 0x80000, 0x160e46b3, 4 | BRF_GRA }, // 7 Sprites - { "u55", 0x80000, 0x7351b61c, 4 | BRF_GRA }, // 8 - { "u54", 0x80000, 0xa3d8c5ef, 4 | BRF_GRA }, // 9 - { "u53", 0x80000, 0x10ca65c4, 4 | BRF_GRA }, // 10 - - { "uz11", 0x80000, 0x3d96274c, 5 | BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(ppchamp) -STD_ROM_FN(ppchamp) - -struct BurnDriver BurnDrvPpchamp = { - "ppchamp", "gotcha", NULL, NULL, "1997", - "Pasha Pasha Champ Mini Game Festival\0", NULL, "Dongsung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, ppchampRomInfo, ppchampRomName, NULL, NULL, GotchaInputInfo, GotchaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_gumbo.cpp b/jan/src/burn/drv/pst90s/d_gumbo.cpp deleted file mode 100644 index 954204876..000000000 --- a/jan/src/burn/drv/pst90s/d_gumbo.cpp +++ /dev/null @@ -1,776 +0,0 @@ -// FB Alpha Gumbo driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo GumboInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 6, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 7, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 2" }, - - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 12, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 13, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 14, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 15, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 10, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 11, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Gumbo) - -static struct BurnInputInfo DblpointInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 6, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 7, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 3" }, - - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 12, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 13, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 14, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 15, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 9, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 10, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 11, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Dblpoint) - -static struct BurnDIPInfo GumboDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0e, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Helps" }, - {0x0e, 0x01, 0x04, 0x00, "0" }, - {0x0e, 0x01, 0x04, 0x04, "1" }, - - {0 , 0xfe, 0 , 2, "Bonus Bar Level" }, - {0x0e, 0x01, 0x08, 0x08, "Normal" }, - {0x0e, 0x01, 0x08, 0x00, "High" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0e, 0x01, 0x30, 0x20, "Easy" }, - {0x0e, 0x01, 0x30, 0x30, "Normal" }, - {0x0e, 0x01, 0x30, 0x10, "Hard" }, - {0x0e, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Picture View" }, - {0x0e, 0x01, 0x40, 0x40, "Off" }, - {0x0e, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Gumbo) - -static struct BurnDIPInfo MsbingoDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0e, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Chance Count" }, - {0x0e, 0x01, 0x0c, 0x0c, "0" }, - {0x0e, 0x01, 0x0c, 0x08, "1" }, - {0x0e, 0x01, 0x0c, 0x04, "2" }, - {0x0e, 0x01, 0x0c, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Play Level" }, - {0x0e, 0x01, 0x10, 0x10, "Normal" }, - {0x0e, 0x01, 0x10, 0x00, "Easy" }, - - {0 , 0xfe, 0 , 2, "Play Speed" }, - {0x0e, 0x01, 0x20, 0x20, "Normal" }, - {0x0e, 0x01, 0x20, 0x00, "High" }, - - {0 , 0xfe, 0 , 2, "Left Count" }, - {0x0e, 0x01, 0x40, 0x40, "Normal" }, - {0x0e, 0x01, 0x40, 0x00, "Low" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Msbingo) - -static struct BurnDIPInfo MspuzzleDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 4, "Time Mode" }, - {0x0e, 0x01, 0x03, 0x03, "0" }, - {0x0e, 0x01, 0x03, 0x02, "1" }, - {0x0e, 0x01, 0x03, 0x01, "2" }, - {0x0e, 0x01, 0x03, 0x00, "3" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0e, 0x01, 0x0c, 0x00, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x0c, 0x0c, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Sound Test" }, - {0x0e, 0x01, 0x10, 0x10, "Off" }, - {0x0e, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "View Staff Credits" }, - {0x0e, 0x01, 0x20, 0x20, "Off" }, - {0x0e, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Picture View" }, - {0x0e, 0x01, 0x40, 0x40, "Off" }, - {0x0e, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Mspuzzle) - -static struct BurnDIPInfo DblpointDIPList[]= -{ - {0x10, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x10, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x0c, 0x0c, "Easy" }, - {0x10, 0x01, 0x0c, 0x08, "Normal" }, - {0x10, 0x01, 0x0c, 0x04, "Hard" }, - {0x10, 0x01, 0x0c, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Sound Test" }, - {0x10, 0x01, 0x10, 0x10, "Off" }, - {0x10, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Picture View" }, - {0x10, 0x01, 0x20, 0x20, "Off" }, - {0x10, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dblpoint) - -void __fastcall gumbo_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x1b0300: - case 0x1c0300: - MSM6295Command(0, data); - return; - } -} - -UINT16 __fastcall gumbo_read_word(UINT32 address) -{ - switch (address) - { - case 0x1b0100: - case 0x1c0100: - return DrvInputs[0]; - - case 0x1b0200: - case 0x1c0200: - return DrvInputs[1]; - - case 0x1b0300: - case 0x1c0300: - return MSM6295ReadStatus(0); - } - - return 0; -} - -void __fastcall gumbo_write_byte(UINT32, UINT8) -{ -} - -UINT8 __fastcall gumbo_read_byte(UINT32) -{ - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 XOffs0[8] = { 0, 0x800000, 8, 0x800008, 16, 0x800010, 24, 0x800018 }; - INT32 XOffs1[4] = { 0, 0x200000, 8, 0x200008 }; - INT32 YOffs0[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; - INT32 YOffs1[4] = { 0, 16, 32, 48 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x200000); - - GfxDecode(0x8000, 8, 8, 8, Plane, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x080000); - - GfxDecode(0x8000, 8, 4, 4, Plane, XOffs1, YOffs1, 0x040, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x080000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x000400; - DrvBgRAM = Next; Next += 0x002000; - DrvFgRAM = Next; Next += 0x008000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 GumboInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - INT32 dblpoin = strncmp(BurnDrvGetTextA(DRV_NAME), "dblpoin", 7) ? 0 : 0x10000; - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvSndROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 6, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x083fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x1b0000, 0x1b03ff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x1e0000^dblpoin, 0x1e0fff^dblpoin, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x1f0000^dblpoin, 0x1f3fff^dblpoin, MAP_RAM); - SekSetWriteByteHandler(0, gumbo_write_byte); - SekSetReadByteHandler(0, gumbo_read_byte); - SekSetWriteWordHandler(0, gumbo_write_word); - SekSetReadWordHandler(0, gumbo_read_word); - SekClose(); - - MSM6295Init(0, 1122000 / 132, 0); - MSM6295SetRoute(0, 0.47, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 MspuzzleInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvSndROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 4, 1)) return 1; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "msbingo")) { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 6, 1)) return 1; - } else { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x180000, 8, 1)) return 1; - } - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x1a0000, 0x1a03ff, MAP_RAM); - SekMapMemory(DrvFgRAM, 0x190000, 0x197fff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x1c0000, 0x1c1fff, MAP_RAM); - SekSetWriteByteHandler(0, gumbo_write_byte); - SekSetReadByteHandler(0, gumbo_read_byte); - SekSetWriteWordHandler(0, gumbo_write_word); - SekSetReadWordHandler(0, gumbo_read_word); - SekClose(); - - MSM6295Init(0, 1122000 / 132, 0); - MSM6295SetRoute(0, 0.47, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - SekExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_background() -{ - UINT16 *vram = (UINT16*)DrvBgRAM; - - for (INT32 offs = 0x80; offs < 0x780; offs++) - { - INT32 sx = ((offs & 0x3f) << 3) - 64; - INT32 sy = ((offs >> 6) << 3) - 16; - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 code = vram[offs] & 0x7fff; - - Render8x8Tile(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM0); - } -} - -static void draw_foreground() -{ - UINT16 *vram = (UINT16*)DrvFgRAM; - - for (INT32 offs = 0x200; offs < 0x1e00; offs++) - { - INT32 sx = ((offs & 0x7f) << 2) - 64; - INT32 sy = ((offs >> 7) << 2) - 16; - INT32 code = vram[offs] & 0x7fff; - - if (sx < 0 || sx >= nScreenWidth) continue; - - UINT16 *pDest = pTransDraw + (sy * nScreenWidth) + sx; - UINT8 *pSrc = DrvGfxROM1 + (code << 4); - - for (INT32 y = 0; y < 4; y++) - { - if (pSrc[0] != 0xff) pDest[0] = pSrc[0] | 0x100; - if (pSrc[1] != 0xff) pDest[1] = pSrc[1] | 0x100; - if (pSrc[2] != 0xff) pDest[2] = pSrc[2] | 0x100; - if (pSrc[3] != 0xff) pDest[3] = pSrc[3] | 0x100; - - pDest += nScreenWidth; - pSrc += 4; - } - } -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - UINT16 *pal = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x200; i++) { - INT32 d = pal[i]; - - r = (d >> 7) & 0xf8; - g = (d >> 2) & 0xf8; - b = (d << 3) & 0xf8; - - r |= (r >> 5); - g |= (g >> 5); - b |= (b >> 5); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - draw_background(); - draw_foreground(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = ~0; - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - DrvInputs[1] = (DrvDips[0] << 8) | 0x00ff; - } - - SekOpen(0); - SekRun(7159090 / 60); - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - MSM6295Scan(0, nAction); - } - - return 0; -} - - -// Gumbo - -static struct BurnRomInfo gumboRomDesc[] = { - { "u1.bin", 0x20000, 0xe09899e4, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u2.bin", 0x20000, 0x60e59acb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u210.bin", 0x40000, 0x16fbe06b, 2 | BRF_SND }, // 2 Samples - - { "u512.bin", 0x20000, 0x97741798, 3 | BRF_GRA }, // 3 Foreground Tiles - { "u511.bin", 0x20000, 0x1411451b, 3 | BRF_GRA }, // 4 - - { "u421.bin", 0x80000, 0x42445132, 4 | BRF_GRA }, // 5 Background Tiles - { "u420.bin", 0x80000, 0xde1f0e2f, 4 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(gumbo) -STD_ROM_FN(gumbo) - -struct BurnDriver BurnDrvGumbo = { - "gumbo", NULL, NULL, NULL, "1994", - "Gumbo\0", NULL, "Min Corp.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, gumboRomInfo, gumboRomName, NULL, NULL, GumboInputInfo, GumboDIPInfo, - GumboInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 320, 224, 4, 3 -}; - - -// Miss Puzzle (Clone of Gumbo) - -static struct BurnRomInfo mspuzzlgRomDesc[] = { - { "u1", 0x20000, 0x95218ff1, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u2", 0x20000, 0x7ea7d96c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u210.bin", 0x40000, 0x16fbe06b, 2 | BRF_SND }, // 2 Samples - - { "u512.bin", 0x20000, 0x97741798, 3 | BRF_GRA }, // 3 Foreground Tiles - { "u511.bin", 0x20000, 0x1411451b, 3 | BRF_GRA }, // 4 - - { "u420", 0x80000, 0x2b387153, 4 | BRF_GRA }, // 5 Background Tiles - { "u421", 0x80000, 0xafa06a93, 4 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(mspuzzlg) -STD_ROM_FN(mspuzzlg) - -struct BurnDriver BurnDrvMspuzzlg = { - "mspuzzleg", "gumbo", NULL, NULL, "1994", - "Miss Puzzle (Clone of Gumbo)\0", NULL, "Min Corp.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, mspuzzlgRomInfo, mspuzzlgRomName, NULL, NULL, GumboInputInfo, GumboDIPInfo, - GumboInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 320, 224, 4, 3 -}; - - -// Miss Bingo - -static struct BurnRomInfo msbingoRomDesc[] = { - { "u1.bin", 0x20000, 0x6eeb6d89, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u2.bin", 0x20000, 0xf15dd4b5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u210.bin", 0x40000, 0x55011f69, 2 | BRF_SND }, // 2 Samples - - { "u512.bin", 0x40000, 0x8a46d467, 3 | BRF_GRA }, // 3 Foreground Tiles - { "u511.bin", 0x40000, 0xd5fd3e2e, 3 | BRF_GRA }, // 4 - - { "u421.bin", 0x80000, 0xb73f21ab, 4 | BRF_GRA }, // 5 Background Tiles - { "u420.bin", 0x80000, 0xc2fe9175, 4 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(msbingo) -STD_ROM_FN(msbingo) - -struct BurnDriver BurnDrvMsbingo = { - "msbingo", NULL, NULL, NULL, "1994", - "Miss Bingo\0", NULL, "Min Corp.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, msbingoRomInfo, msbingoRomName, NULL, NULL, GumboInputInfo, MsbingoDIPInfo, - MspuzzleInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 320, 224, 4, 3 -}; - - -// Miss Puzzle - -static struct BurnRomInfo mspuzzleRomDesc[] = { - { "u1.bin", 0x40000, 0xd9e63f12, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u2.bin", 0x40000, 0x9c3fc677, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u210.bin", 0x40000, 0x0a223a38, 2 | BRF_SND }, // 2 Samples - - { "u512.bin", 0x40000, 0x505ee3c2, 3 | BRF_GRA }, // 3 Foreground Tiles - { "u511.bin", 0x40000, 0x3d6b6c78, 3 | BRF_GRA }, // 4 - - { "u421.bin", 0x80000, 0x5387ab3a, 4 | BRF_GRA }, // 5 Background Tiles - { "u425.bin", 0x80000, 0xf53a9042, 4 | BRF_GRA }, // 6 - { "u420.bin", 0x80000, 0xc3f892e6, 4 | BRF_GRA }, // 7 - { "u426.bin", 0x80000, 0xc927e8da, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(mspuzzle) -STD_ROM_FN(mspuzzle) - -struct BurnDriver BurnDrvMspuzzle = { - "mspuzzle", NULL, NULL, NULL, "1994", - "Miss Puzzle\0", NULL, "Min Corp.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, mspuzzleRomInfo, mspuzzleRomName, NULL, NULL, GumboInputInfo, MspuzzleDIPInfo, - MspuzzleInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 320, 3, 4 -}; - - -// Miss Puzzle (Nudes) - -static struct BurnRomInfo mspuzzlenRomDesc[] = { - { "u1.rom", 0x20000, 0xec940df4, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u2.rom", 0x20000, 0x7b9cac82, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u210.rom", 0x40000, 0x8826b018, 2 | BRF_SND }, // 2 Samples - - { "u512.bin", 0x40000, 0x505ee3c2, 3 | BRF_GRA }, // 3 Foreground Tiles - { "u511.bin", 0x40000, 0x3d6b6c78, 3 | BRF_GRA }, // 4 - - { "u421.rom", 0x80000, 0x3c567c55, 4 | BRF_GRA }, // 5 Background Tiles - { "u425.rom", 0x80000, 0x1c4c8fc1, 4 | BRF_GRA }, // 6 - { "u420.rom", 0x80000, 0xf52ab7fd, 4 | BRF_GRA }, // 7 - { "u426.rom", 0x80000, 0xc28b2743, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(mspuzzlen) -STD_ROM_FN(mspuzzlen) - -struct BurnDriverD BurnDrvMspuzzlen = { - "mspuzzlen", "mspuzzle", NULL, NULL, "1994", - "Miss Puzzle (Nudes)\0", NULL, "Min Corp.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, mspuzzlenRomInfo, mspuzzlenRomName, NULL, NULL, GumboInputInfo, MspuzzleDIPInfo, - MspuzzleInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 320, 3, 4 -}; - - -// Double Point - -static struct BurnRomInfo dblpointRomDesc[] = { - { "u1.bin", 0x20000, 0xb05c9e02, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u2.bin", 0x20000, 0xcab35cbe, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u210.rom", 0x40000, 0xd35f975c, 2 | BRF_SND }, // 2 Samples - - { "u512.bin", 0x40000, 0xb57b8534, 3 | BRF_GRA }, // 3 Foreground Tiles - { "u511.bin", 0x40000, 0x74ed13ff, 3 | BRF_GRA }, // 4 - - { "u421.bin", 0x80000, 0xb0e9271f, 4 | BRF_GRA }, // 5 Background Tiles - { "u420.bin", 0x80000, 0x252789e8, 4 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(dblpoint) -STD_ROM_FN(dblpoint) - -struct BurnDriver BurnDrvDblpoint = { - "dblpoint", NULL, NULL, NULL, "1995", - "Double Point\0", NULL, "Min Corp.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, dblpointRomInfo, dblpointRomName, NULL, NULL, DblpointInputInfo, DblpointDIPInfo, - GumboInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 320, 224, 4, 3 -}; - - -// Double Point (Dong Bang Electron, bootleg?) - -static struct BurnRomInfo dblpoindRomDesc[] = { - { "d12.bin", 0x20000, 0x44bc1bd9, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "d13.bin", 0x20000, 0x625a311b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "d11.bin", 0x40000, 0xd35f975c, 2 | BRF_SND }, // 2 Samples - - { "d14.bin", 0x40000, 0x41943db5, 3 | BRF_GRA }, // 3 Foreground Tiles - { "d15.bin", 0x40000, 0x6b899a51, 3 | BRF_GRA }, // 4 - - { "d16.bin", 0x80000, 0xafea0158, 4 | BRF_GRA }, // 5 Background Tiles - { "d17.bin", 0x80000, 0xc971dcb5, 4 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(dblpoind) -STD_ROM_FN(dblpoind) - -struct BurnDriver BurnDrvDblpoind = { - "dblpointd", "dblpoint", NULL, NULL, "1995", - "Double Point (Dong Bang Electron, bootleg?)\0", NULL, "Dong Bang Electron", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, dblpoindRomInfo, dblpoindRomName, NULL, NULL, DblpointInputInfo, DblpointDIPInfo, - GumboInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 320, 224, 4, 3 -}; - diff --git a/jan/src/burn/drv/pst90s/d_hyperpac.cpp b/jan/src/burn/drv/pst90s/d_hyperpac.cpp deleted file mode 100644 index 65f3d22c9..000000000 --- a/jan/src/burn/drv/pst90s/d_hyperpac.cpp +++ /dev/null @@ -1,4286 +0,0 @@ -// FB Alpha Snow Bros. driver module -// Based on MAME driver by David Haywood, Mike Coates - -// Todo: -// Figure out why the spriteram is spilling into the z80 ram for 4in1boot, see Memindex() - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "timer.h" -#include "msm6295.h" -#include "burn_ym2151.h" -#include "burn_ym3812.h" -#include "bitswap.h" - -static UINT8 HyperpacInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 HyperpacInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 HyperpacInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 HyperpacDip[2] = {0, 0}; -static UINT8 HyperpacInput[3] = {0x00, 0x00, 0x00}; -static UINT8 HyperpacReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *HyperpacRom = NULL; -static UINT8 *HyperpacZ80Rom = NULL; -static UINT8 *HyperpacRam = NULL; -static UINT8 *HyperpacPaletteRam = NULL; -static UINT8 *HyperpacSpriteRam = NULL; -static UINT8 *HyperpacZ80Ram = NULL; -static UINT32 *HyperpacPalette = NULL; -static UINT8 *HyperpacSprites = NULL; -static UINT8 *HyperpacSprites8bpp = NULL; -static UINT8 *HyperpacTempGfx = NULL; -static UINT8 *HyperpacProtData = NULL; - -static INT32 HyperpacSoundLatch; -static INT32 Moremore = 0; -static INT32 Threein1semi = 0; -static INT32 Cookbib3 = 0; -static INT32 Fourin1boot = 0; -static INT32 Finalttr = 0; -static INT32 Twinadv = 0; -static INT32 Honeydol = 0; -static INT32 Wintbob = 0; -static INT32 Snowbro3 = 0; -static INT32 Toto = 0; - -static INT32 HyperpacNumTiles = 0; -static INT32 HyperpacNumTiles8bpp = 0; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static INT32 Snowbro3MusicPlaying; -static INT32 Snowbro3Music; - -static struct BurnInputInfo HyperpacInputList[] = { - {"Coin 1" , BIT_DIGITAL , HyperpacInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , HyperpacInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , HyperpacInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , HyperpacInputPort2 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , HyperpacInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , HyperpacInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , HyperpacInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , HyperpacInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , HyperpacInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , HyperpacInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , HyperpacInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , HyperpacInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , HyperpacInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , HyperpacInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , HyperpacInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , HyperpacInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , HyperpacInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , HyperpacInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &HyperpacReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, HyperpacDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, HyperpacDip + 1 , "dip" }, -}; - -STDINPUTINFO(Hyperpac) - -static struct BurnInputInfo SnowbrosInputList[] = { - {"Coin 1" , BIT_DIGITAL , HyperpacInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , HyperpacInputPort2 + 0, "p1 start" }, - - {"P1 Up" , BIT_DIGITAL , HyperpacInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , HyperpacInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , HyperpacInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , HyperpacInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , HyperpacInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , HyperpacInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , HyperpacInputPort0 + 6, "p1 fire 3" }, - - {"Coin 2" , BIT_DIGITAL , HyperpacInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , HyperpacInputPort2 + 1, "p2 start" }, - - {"P2 Up" , BIT_DIGITAL , HyperpacInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , HyperpacInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , HyperpacInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , HyperpacInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , HyperpacInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , HyperpacInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , HyperpacInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &HyperpacReset , "reset" }, - {"Service" , BIT_DIGITAL , HyperpacInputPort2 + 6, "service" }, - {"Tilt" , BIT_DIGITAL , HyperpacInputPort2 + 5, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, HyperpacDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, HyperpacDip + 1 , "dip" }, -}; - -STDINPUTINFO(Snowbros) - -static inline void HyperpacClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void HyperpacMakeInputs() -{ - // Reset Inputs - HyperpacInput[0] = HyperpacInput[1] = HyperpacInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - HyperpacInput[0] |= (HyperpacInputPort0[i] & 1) << i; - HyperpacInput[1] |= (HyperpacInputPort1[i] & 1) << i; - HyperpacInput[2] |= (HyperpacInputPort2[i] & 1) << i; - } - - // Clear Opposites - HyperpacClearOpposites(&HyperpacInput[0]); - HyperpacClearOpposites(&HyperpacInput[1]); -} - -static struct BurnDIPInfo HyperpacDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfc, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x13, 0x01, 0x02, 0x02, "3" }, - {0x13, 0x01, 0x02, 0x00, "5" }, - - {0 , 0xfe, 0 , 8 , "Coin : Credit" }, - {0x13, 0x01, 0x1c, 0x00, "5 : 1" }, - {0x13, 0x01, 0x1c, 0x04, "4 : 1" }, - {0x13, 0x01, 0x1c, 0x08, "3 : 1" }, - {0x13, 0x01, 0x1c, 0x0c, "2 : 1" }, - {0x13, 0x01, 0x1c, 0x1c, "1 : 1" }, - {0x13, 0x01, 0x1c, 0x14, "2 : 3" }, - {0x13, 0x01, 0x1c, 0x18, "1 : 2" }, - {0x13, 0x01, 0x1c, 0x10, "1 : 3" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x60, 0x00, "Easy" }, - {0x13, 0x01, 0x60, 0x60, "Normal" }, - {0x13, 0x01, 0x60, 0x40, "Hard" }, - {0x13, 0x01, 0x60, 0x20, "Very Hard" }, - - {0 , 0xfe, 0 , 2 , "Mode" }, - {0x13, 0x01, 0x80, 0x80, "Game" }, - {0x13, 0x01, 0x80, 0x00, "Test" }, -}; - -STDDIPINFO(Hyperpac) - -static struct BurnDIPInfo Cookbib2DIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfc, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Max Vs Round" }, - {0x13, 0x01, 0x02, 0x02, "3" }, - {0x13, 0x01, 0x02, 0x00, "1" }, - - {0 , 0xfe, 0 , 8 , "Coin : Credit" }, - {0x13, 0x01, 0x1c, 0x00, "5 : 1" }, - {0x13, 0x01, 0x1c, 0x04, "4 : 1" }, - {0x13, 0x01, 0x1c, 0x08, "3 : 1" }, - {0x13, 0x01, 0x1c, 0x0c, "2 : 1" }, - {0x13, 0x01, 0x1c, 0x1c, "1 : 1" }, - {0x13, 0x01, 0x1c, 0x14, "2 : 3" }, - {0x13, 0x01, 0x1c, 0x18, "1 : 2" }, - {0x13, 0x01, 0x1c, 0x10, "1 : 3" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x60, 0x00, "Easy" }, - {0x13, 0x01, 0x60, 0x60, "Normal" }, - {0x13, 0x01, 0x60, 0x40, "Hard" }, - {0x13, 0x01, 0x60, 0x20, "Very Hard" }, - - {0 , 0xfe, 0 , 2 , "Mode" }, - {0x13, 0x01, 0x80, 0x80, "Game" }, - {0x13, 0x01, 0x80, 0x00, "Test" }, -}; - -STDDIPINFO(Cookbib2) - -static struct BurnDIPInfo Cookbib3DIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xee, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin : Credit" }, - {0x13, 0x01, 0x0e, 0x00, "5 : 1" }, - {0x13, 0x01, 0x0e, 0x02, "4 : 1" }, - {0x13, 0x01, 0x0e, 0x04, "3 : 1" }, - {0x13, 0x01, 0x0e, 0x06, "2 : 1" }, - {0x13, 0x01, 0x0e, 0x0e, "1 : 1" }, - {0x13, 0x01, 0x0e, 0x0a, "2 : 3" }, - {0x13, 0x01, 0x0e, 0x0c, "1 : 2" }, - {0x13, 0x01, 0x0e, 0x08, "1 : 3" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x13, 0x01, 0x70, 0x20, "Level 1" }, - {0x13, 0x01, 0x70, 0x10, "Level 2" }, - {0x13, 0x01, 0x70, 0x00, "Level 3" }, - {0x13, 0x01, 0x70, 0x70, "Level 4" }, - {0x13, 0x01, 0x70, 0x60, "Level 5" }, - {0x13, 0x01, 0x70, 0x50, "Level 6" }, - {0x13, 0x01, 0x70, 0x40, "Level 7" }, - {0x13, 0x01, 0x70, 0x30, "Level 8" }, - - {0 , 0xfe, 0 , 2 , "Mode" }, - {0x13, 0x01, 0x80, 0x80, "Game" }, - {0x13, 0x01, 0x80, 0x00, "Test" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Cookbib3) - -static struct BurnDIPInfo MoremoreDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xee, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin : Credit" }, - {0x13, 0x01, 0x0e, 0x00, "5 : 1" }, - {0x13, 0x01, 0x0e, 0x02, "4 : 1" }, - {0x13, 0x01, 0x0e, 0x04, "3 : 1" }, - {0x13, 0x01, 0x0e, 0x06, "2 : 1" }, - {0x13, 0x01, 0x0e, 0x0e, "1 : 1" }, - {0x13, 0x01, 0x0e, 0x0a, "2 : 3" }, - {0x13, 0x01, 0x0e, 0x0c, "1 : 2" }, - {0x13, 0x01, 0x0e, 0x08, "1 : 3" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x13, 0x01, 0x70, 0x20, "Level 1" }, - {0x13, 0x01, 0x70, 0x10, "Level 2" }, - {0x13, 0x01, 0x70, 0x00, "Level 3" }, - {0x13, 0x01, 0x70, 0x70, "Level 4" }, - {0x13, 0x01, 0x70, 0x60, "Level 5" }, - {0x13, 0x01, 0x70, 0x50, "Level 6" }, - {0x13, 0x01, 0x70, 0x40, "Level 7" }, - {0x13, 0x01, 0x70, 0x30, "Level 8" }, - - {0 , 0xfe, 0 , 2 , "Mode" }, - {0x13, 0x01, 0x80, 0x80, "Game" }, - {0x13, 0x01, 0x80, 0x00, "Test" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Moremore) - -static struct BurnDIPInfo ToppyrapDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin : Credit" }, - {0x13, 0x01, 0x1c, 0x00, "5 : 1" }, - {0x13, 0x01, 0x1c, 0x04, "4 : 1" }, - {0x13, 0x01, 0x1c, 0x08, "3 : 1" }, - {0x13, 0x01, 0x1c, 0x0c, "2 : 1" }, - {0x13, 0x01, 0x1c, 0x1c, "1 : 1" }, - {0x13, 0x01, 0x1c, 0x14, "2 : 3" }, - {0x13, 0x01, 0x1c, 0x18, "1 : 2" }, - {0x13, 0x01, 0x1c, 0x10, "1 : 3" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x60, 0x00, "Easy" }, - {0x13, 0x01, 0x60, 0x60, "Normal" }, - {0x13, 0x01, 0x60, 0x40, "Hard" }, - {0x13, 0x01, 0x60, 0x20, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Mode" }, - {0x13, 0x01, 0x80, 0x80, "Game" }, - {0x13, 0x01, 0x80, 0x00, "Test" }, - - {0 , 0xfe, 0 , 4 , "Player Count" }, - {0x14, 0x01, 0x03, 0x00, "2" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x02, "4" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 4 , "Game Time" }, - {0x14, 0x01, 0x0c, 0x04, "40 seconds" }, - {0x14, 0x01, 0x0c, 0x08, "50 seconds" }, - {0x14, 0x01, 0x0c, 0x0c, "60 seconds" }, - {0x14, 0x01, 0x0c, 0x00, "70 seconds" }, - - {0 , 0xfe, 0 , 2 , "God Mode" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Internal Test" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Toppyrap) - -static struct BurnDIPInfo Fourin1bootDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x06, 0x04, "1" }, - {0x13, 0x01, 0x06, 0x06, "2" }, - {0x13, 0x01, 0x06, 0x02, "3" }, - {0x13, 0x01, 0x06, 0x00, "4" }, - - {0 , 0xfe, 0 , 16 , "Coin : Credit" }, - {0x13, 0x01, 0x78, 0x18, "4 : 1" }, - {0x13, 0x01, 0x78, 0x38, "3 : 1" }, - {0x13, 0x01, 0x78, 0x10, "4 : 2" }, - {0x13, 0x01, 0x78, 0x58, "2 : 1" }, - {0x13, 0x01, 0x78, 0x30, "3 : 2" }, - {0x13, 0x01, 0x78, 0x08, "4 : 3" }, - {0x13, 0x01, 0x78, 0x00, "4 : 4" }, - {0x13, 0x01, 0x78, 0x28, "3 : 3" }, - {0x13, 0x01, 0x78, 0x50, "2 : 2" }, - {0x13, 0x01, 0x78, 0x78, "1 : 1" }, - {0x13, 0x01, 0x78, 0x20, "3 : 4" }, - {0x13, 0x01, 0x78, 0x48, "2 : 3" }, - {0x13, 0x01, 0x78, 0x40, "2 : 4" }, - {0x13, 0x01, 0x78, 0x70, "1 : 2" }, - {0x13, 0x01, 0x78, 0x68, "1 : 3" }, - {0x13, 0x01, 0x78, 0x60, "1 : 4" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x03, 0x02, "1" }, - {0x14, 0x01, 0x03, 0x00, "2" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 2 , "Mode" }, - {0x14, 0x01, 0x80, 0x80, "Game" }, - {0x14, 0x01, 0x80, 0x00, "Test" }, -}; - -STDDIPINFO(Fourin1boot) - -static struct BurnDIPInfo FinalttrDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 7 , "Coin : Credit" }, - {0x13, 0x01, 0x38, 0x00, "4 : 1" }, - {0x13, 0x01, 0x38, 0x10, "3 : 1" }, - {0x13, 0x01, 0x38, 0x30, "2 : 1" }, - {0x13, 0x01, 0x38, 0x38, "1 : 1" }, - {0x13, 0x01, 0x38, 0x20, "2 : 3" }, - {0x13, 0x01, 0x38, 0x28, "1 : 2" }, - {0x13, 0x01, 0x38, 0x08, "1 : 4" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Time" }, - {0x14, 0x01, 0x0c, 0x00, "60 seconds" }, - {0x14, 0x01, 0x0c, 0x0c, "90 seconds" }, - {0x14, 0x01, 0x0c, 0x08, "120 seconds" }, - {0x14, 0x01, 0x0c, 0x04, "150 seconds" }, -}; - -STDDIPINFO(Finalttr) - -static struct BurnDIPInfo TwinadvDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin : Credit" }, - {0x13, 0x01, 0x03, 0x00, "3 : 1" }, - {0x13, 0x01, 0x03, 0x01, "2 : 1" }, - {0x13, 0x01, 0x03, 0x03, "1 : 1" }, - {0x13, 0x01, 0x03, 0x02, "1 : 2" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Level Select" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x01, "Harder" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x14, 0x01, 0x04, 0x04, "3" }, - {0x14, 0x01, 0x04, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Ticket Mode 1" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Ticket Mode 2" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Twinadv) - -static struct BurnDIPInfo HoneydolDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xef, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x13, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Show Girls" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x10, 0x00, "Off" }, - {0x13, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Level Select" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Slide show on boot" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x01, "Harder" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Timer speed" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x08, "Fast" }, - {0x14, 0x01, 0x0c, 0x04, "Faster" }, - {0x14, 0x01, 0x0c, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x00, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x20, "3" }, - {0x14, 0x01, 0x30, 0x30, "5" }, - - {0 , 0xfe, 0 , 2 , "Max vs Round" }, - {0x14, 0x01, 0x80, 0x80, "3" }, - {0x14, 0x01, 0x80, 0x00, "1" }, -}; - -STDDIPINFO(Honeydol) - -static struct BurnDIPInfo SnowbrosDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0x01, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Country" }, - {0x15, 0x01, 0x01, 0x01, "Europ Type" }, - {0x15, 0x01, 0x01, 0x00, "America Type" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Invert Screen" }, - {0x15, 0x01, 0x02, 0x00, "Normal Screen" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Advertise Sound Off" }, - {0x15, 0x01, 0x08, 0x00, "Advertise Sound On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x30, "4 Coin 1 Play" }, - {0x15, 0x01, 0x30, 0x20, "3 Coin 1 Play" }, - {0x15, 0x01, 0x30, 0x10, "2 Coin 1 Play" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 2 Play" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 3 Play" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 4 Play" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 6 Play" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x01, "Game Difficulty A" }, - {0x16, 0x01, 0x03, 0x00, "Game Difficulty B" }, - {0x16, 0x01, 0x03, 0x02, "Game Difficulty C" }, - {0x16, 0x01, 0x03, 0x03, "Game Difficulty D" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x0c, "Extend No Extend" }, - {0x16, 0x01, 0x0c, 0x00, "Extend 100000 Only" }, - {0x16, 0x01, 0x0c, 0x08, "Extend 100000, 200000" }, - {0x16, 0x01, 0x0c, 0x04, "Extend 200000 Only" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x10, "Hero Counts 1" }, - {0x16, 0x01, 0x30, 0x30, "Hero Counts 2" }, - {0x16, 0x01, 0x30, 0x00, "Hero Counts 3" }, - {0x16, 0x01, 0x30, 0x20, "Hero Counts 4" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x16, 0x01, 0x40, 0x40, "No Death, Stop Mode" }, - {0x16, 0x01, 0x40, 0x00, "Normal Game" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x80, 0x00, "Continue Play On" }, - {0x16, 0x01, 0x80, 0x80, "Continue Play Off" }, -}; - -STDDIPINFO(Snowbros) - -static struct BurnDIPInfo SnowbrojDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet Type" }, - {0x15, 0x01, 0x01, 0x01, "Up-Right Type" }, - {0x15, 0x01, 0x01, 0x00, "Table Type" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Invert Screen" }, - {0x15, 0x01, 0x02, 0x00, "Normal Screen" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Advertise Sound Off" }, - {0x15, 0x01, 0x08, 0x00, "Advertise Sound On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x30, "2 Coin 3 Play" }, - {0x15, 0x01, 0x30, 0x20, "2 Coin 1 Play" }, - {0x15, 0x01, 0x30, 0x10, "1 Coin 2 Play" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0xc0, "2 Coin 3 Play" }, - {0x15, 0x01, 0xc0, 0x80, "2 Coin 1 Play" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 2 Play" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 1 Play" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x01, "Game Difficulty A" }, - {0x16, 0x01, 0x03, 0x00, "Game Difficulty B" }, - {0x16, 0x01, 0x03, 0x02, "Game Difficulty C" }, - {0x16, 0x01, 0x03, 0x03, "Game Difficulty D" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x0c, "Extend No Extend" }, - {0x16, 0x01, 0x0c, 0x00, "Extend 100000 Only" }, - {0x16, 0x01, 0x0c, 0x08, "Extend 100000, 200000" }, - {0x16, 0x01, 0x0c, 0x04, "Extend 200000 Only" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x10, "Hero Counts 1" }, - {0x16, 0x01, 0x30, 0x30, "Hero Counts 2" }, - {0x16, 0x01, 0x30, 0x00, "Hero Counts 3" }, - {0x16, 0x01, 0x30, 0x20, "Hero Counts 4" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x16, 0x01, 0x40, 0x40, "No Death, Stop Mode" }, - {0x16, 0x01, 0x40, 0x00, "Normal Game" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x80, 0x00, "Continue Play On" }, - {0x16, 0x01, 0x80, 0x80, "Continue Play Off" }, -}; - -STDDIPINFO(Snowbroj) - -static struct BurnRomInfo HyperpacRomDesc[] = { - { "hyperpac.h12", 0x20000, 0x2cf0531a, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "hyperpac.i12", 0x20000, 0x9c7d85b8, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "hyperpac.a4", 0x40000, 0xbd8673da, BRF_GRA }, // 2 Sprites - { "hyperpac.a5", 0x40000, 0x5d90cd82, BRF_GRA }, // 3 Sprites - { "hyperpac.a6", 0x40000, 0x61d86e63, BRF_GRA }, // 4 Sprites - - { "hyperpac.u1", 0x10000, 0x03faf88e, BRF_SND }, // 5 Z80 Program Code - - { "hyperpac.j15", 0x40000, 0xfb9f468d, BRF_SND }, // 6 Samples - - { "at89c52.bin", 0x02000, 0x291f9326, BRF_PRG | BRF_OPT }, -}; - - -STD_ROM_PICK(Hyperpac) -STD_ROM_FN(Hyperpac) - - -static struct BurnRomInfo TotoRomDesc[] = { - { "u60.5j", 0x20000, 0x39203792, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "u51.4j", 0x20000, 0x7b846cd4, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "u107.8k", 0x20000, 0x4486153b, BRF_GRA }, // 2 Sprites - { "u108.8l", 0x20000, 0x3286cf5f, BRF_GRA }, // 3 Sprites - { "u109.8m", 0x20000, 0x464d7251, BRF_GRA }, // 4 Sprites - { "u110.8n", 0x20000, 0x7dea56df, BRF_GRA }, // 5 Sprites - - { "u46.4c", 0x08000, 0x77b1ef42, BRF_SND }, // 6 Z80 Program Code -}; - - -STD_ROM_PICK(Toto) -STD_ROM_FN(Toto) - -static struct BurnRomInfo HyperpacbRomDesc[] = { - { "hpacuh12.bin", 0x20000, 0x633ab2c6, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "hpacui12.bin", 0x20000, 0x23dc00d1, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "hyperpac.a4", 0x40000, 0xbd8673da, BRF_GRA }, // 2 Sprites - { "hyperpac.a5", 0x40000, 0x5d90cd82, BRF_GRA }, // 3 Sprites - { "hyperpac.a6", 0x40000, 0x61d86e63, BRF_GRA }, // 4 Sprites - - { "hyperpac.u1", 0x10000, 0x03faf88e, BRF_SND }, // 5 Z80 Program Code - - { "hyperpac.j15", 0x40000, 0xfb9f468d, BRF_SND }, // 6 Samples -}; - - -STD_ROM_PICK(Hyperpacb) -STD_ROM_FN(Hyperpacb) - -static struct BurnRomInfo Cookbib2RomDesc[] = { - { "cookbib2.02", 0x40000, 0xb2909460, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "cookbib2.01", 0x40000, 0x65aafde2, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "cookbib2.05", 0x80000, 0x89fb38ce, BRF_GRA }, // 2 Sprites - { "cookbib2.04", 0x80000, 0xf240111f, BRF_GRA }, // 3 Sprites - { "cookbib2.03", 0x40000, 0xe1604821, BRF_GRA }, // 4 Sprites - - { "cookbib2.07", 0x10000, 0xf59f1c9a, BRF_SND }, // 5 Z80 Program Code - - { "cookbib2.06", 0x20000, 0x5e6f76b8, BRF_SND }, // 6 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, - - { "protdata.bin", 0x00200, 0xae6d8ed5, BRF_ESS | BRF_PRG }, // Data from shared RAM -}; - - -STD_ROM_PICK(Cookbib2) -STD_ROM_FN(Cookbib2) - -static struct BurnRomInfo Cookbib3RomDesc[] = { - { "u52.bin", 0x40000, 0x65134893, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "u74.bin", 0x40000, 0xc4ab8435, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "u75.bin", 0x80000, 0xcbe4d9c8, BRF_GRA }, // 2 Sprites - { "u76.bin", 0x80000, 0x1be17b57, BRF_GRA }, // 3 Sprites - { "u77.bin", 0x80000, 0x7823600d, BRF_GRA }, // 4 Sprites - - { "u35.bin", 0x10000, 0x5dfd2a98, BRF_SND }, // 5 Z80 Program Code - - { "u14.bin", 0x20000, 0xe5bf9288, BRF_SND }, // 6 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, - - { "protdata.bin", 0x00200, 0xc819b9a8, BRF_ESS | BRF_PRG }, // Data from shared RAM -}; - - -STD_ROM_PICK(Cookbib3) -STD_ROM_FN(Cookbib3) - -static struct BurnRomInfo MoremoreRomDesc[] = { - { "u52.bin", 0x40000, 0xcea4b246, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "u74.bin", 0x40000, 0x2acdcb88, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "u75.bin", 0x80000, 0xd671815c, BRF_GRA }, // 2 Sprites - { "u76.bin", 0x80000, 0xe0d479e8, BRF_GRA }, // 3 Sprites - { "u77.bin", 0x80000, 0x60a281da, BRF_GRA }, // 4 Sprites - { "u78.bin", 0x80000, 0xe2723b4e, BRF_GRA }, // 5 Sprites - - { "u35.bin", 0x10000, 0x92dc95fc, BRF_SND }, // 6 Z80 Program Code - - { "u14.bin", 0x40000, 0x90580088, BRF_SND }, // 7 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, - - { "protdata.bin", 0x00200, 0x782dd2aa, BRF_ESS | BRF_PRG }, // Data from shared RAM -}; - - -STD_ROM_PICK(Moremore) -STD_ROM_FN(Moremore) - -static struct BurnRomInfo MoremorpRomDesc[] = { - { "mmp_u52.bin", 0x40000, 0x66baf9b2, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "mmp_u74.bin", 0x40000, 0x7c6fede5, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "mmp_u75.bin", 0x80000, 0xaf9e824e, BRF_GRA }, // 2 Sprites - { "mmp_u76.bin", 0x80000, 0xc42af064, BRF_GRA }, // 3 Sprites - { "mmp_u77.bin", 0x80000, 0x1d7396e1, BRF_GRA }, // 4 Sprites - { "mmp_u78.bin", 0x80000, 0x5508d80b, BRF_GRA }, // 5 Sprites - - { "mmp_u35.bin", 0x10000, 0x4d098cad, BRF_SND }, // 6 Z80 Program Code - - { "mmp_u14.bin", 0x40000, 0x211a2566, BRF_SND }, // 7 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, - - { "protdata.bin", 0x00200, 0x782dd2aa, BRF_ESS | BRF_PRG }, // Data from shared RAM -}; - - -STD_ROM_PICK(Moremorp) -STD_ROM_FN(Moremorp) - -static struct BurnRomInfo ToppyrapRomDesc[] = { - { "uh12.bin", 0x40000, 0x6f5ad699, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ui12.bin", 0x40000, 0xcaf5a7e1, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "ua4.bin", 0x80000, 0xa9577bcf, BRF_GRA }, // 2 Sprites - { "ua5.bin", 0x80000, 0x7179d32d, BRF_GRA }, // 3 Sprites - { "ua6.bin", 0x80000, 0x4834e5b1, BRF_GRA }, // 4 Sprites - { "ua7.bin", 0x80000, 0x663dd099, BRF_GRA }, // 5 Sprites - - { "u1.bin", 0x10000, 0x07f50947, BRF_SND }, // 6 Z80 Program Code - - { "uj15.bin", 0x20000, 0xa3bacfd7, BRF_SND }, // 7 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, - - { "protdata.bin", 0x00200, 0x0704e6c7, BRF_ESS | BRF_PRG }, // Data from shared RAM -}; - - -STD_ROM_PICK(Toppyrap) -STD_ROM_FN(Toppyrap) - -static struct BurnRomInfo Threein1semiRomDesc[] = { - { "u52", 0x40000, 0xb0e4a0f7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "u74", 0x40000, 0x266862c4, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "u75", 0x80000, 0xb66a0db6, BRF_GRA }, // 2 Sprites - { "u76", 0x80000, 0x5f4b48ea, BRF_GRA }, // 3 Sprites - { "u77", 0x80000, 0xd44211e3, BRF_GRA }, // 4 Sprites - { "u78", 0x80000, 0xaf596afc, BRF_GRA }, // 5 Sprites - - { "u35", 0x10000, 0xe40481da, BRF_SND }, // 6 Z80 Program Code - - { "u14", 0x40000, 0xc83c11be, BRF_SND }, // 7 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, - - { "protdata.bin", 0x00200, 0x85deba7c, BRF_ESS | BRF_PRG }, // Data from shared RAM -}; - - -STD_ROM_PICK(Threein1semi) -STD_ROM_FN(Threein1semi) - -static struct BurnRomInfo TwinkleRomDesc[] = { - { "uh12.bin", 0x20000, 0xa99626fe, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ui12.bin", 0x20000, 0x5af73684, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "ua4.bin", 0x80000, 0x6b64bb09, BRF_GRA }, // 2 Sprites - - { "u1.bin", 0x10000, 0xe40481da, BRF_SND }, // 3 Z80 Program Code - - { "uj15.bin", 0x40000, 0x0a534b37, BRF_SND }, // 4 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, - - { "protdata.bin", 0x00200, 0x00d3e4b4, BRF_ESS | BRF_PRG }, // Data from shared RAM -}; - - -STD_ROM_PICK(Twinkle) -STD_ROM_FN(Twinkle) - -static struct BurnRomInfo PzlbreakRomDesc[] = { - { "4.uh12", 0x20000, 0xb3f04f80, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "5.ui12", 0x20000, 0x13c298a0, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "2.ua4", 0x80000, 0xd211705a, BRF_GRA }, // 2 Sprites - { "3.ua5", 0x80000, 0x6cdb73e9, BRF_GRA }, // 3 - - { "0.u1", 0x10000, 0x1ad646b7, BRF_SND }, // 4 Z80 Program Code - - { "1.uj15", 0x40000, 0xdbfae77c, BRF_SND }, // 5 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, - - { "protdata.bin", 0x00200, 0x092cb794, BRF_ESS | BRF_PRG }, // Data from shared RAM -}; - - -STD_ROM_PICK(Pzlbreak) -STD_ROM_FN(Pzlbreak) - -static struct BurnRomInfo Fourin1bootRomDesc[] = { - { "u52", 0x80000, 0x71815878, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "u74", 0x80000, 0xe22d3fa2, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "u78", 0x200000,0x6c1fbc9c, BRF_GRA }, // 2 Sprites - - { "u35", 0x10000, 0xc894ac80, BRF_SND }, // 3 Z80 Program Code - - { "u14", 0x40000, 0x94b09b0e, BRF_SND }, // 4 Samples -}; - - -STD_ROM_PICK(Fourin1boot) -STD_ROM_FN(Fourin1boot) - -static struct BurnRomInfo FinalttrRomDesc[] = { - { "10.7o", 0x20000, 0xeecc83e5, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "9.5o", 0x20000, 0x58d3640e, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "5.1d", 0x40000, 0x64a450f3, BRF_GRA }, // 2 Sprites - { "6.1f", 0x40000, 0x7281a3cc, BRF_GRA }, // 3 Sprites - { "7.1g", 0x40000, 0xec80f442, BRF_GRA }, // 4 Sprites - { "9.1h", 0x40000, 0x2ebd316d, BRF_GRA }, // 5 Sprites - - { "12.5r", 0x10000, 0x4bc21361, BRF_SND }, // 6 Z80 Program Code - - { "11.7p", 0x20000, 0x2e331022, BRF_SND }, // 7 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, - - { "protdata.bin", 0x00200, 0xd5bbb006, BRF_ESS | BRF_PRG }, // Data from shared RAM -}; - - -STD_ROM_PICK(Finalttr) -STD_ROM_FN(Finalttr) - -static struct BurnRomInfo TwinadvRomDesc[] = { - { "13.uh12", 0x20000, 0x9f70a39b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "12.ui12", 0x20000, 0xd8776495, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "16.ua4", 0x80000, 0xf491e171, BRF_GRA }, // 2 Sprites - { "15.ua5", 0x80000, 0x79a08b8d, BRF_GRA }, // 3 Sprites - { "14.ua6", 0x80000, 0x79faee0b, BRF_GRA }, // 4 Sprites - - { "uh15.bin", 0x08000, 0x3d5acd08, BRF_SND }, // 5 Z80 Program Code - - { "sra.bin", 0x40000, 0x82f452c4, BRF_SND }, // 6 Samples - { "srb.bin", 0x40000, 0x109e51e6, BRF_SND }, // 7 Samples -}; - - -STD_ROM_PICK(Twinadv) -STD_ROM_FN(Twinadv) - -static struct BurnRomInfo TwinadvkRomDesc[] = { - { "uh12", 0x20000, 0xe0bcc738, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ui12", 0x20000, 0xa3ee6451, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "ua4", 0x80000, 0xa5aff49b, BRF_GRA }, // 2 Sprites - { "ua5", 0x80000, 0xf83b3b97, BRF_GRA }, // 3 Sprites - { "ua6", 0x80000, 0x4dfcffb9, BRF_GRA }, // 4 Sprites - - { "uh15.bin", 0x08000, 0x3d5acd08, BRF_SND }, // 5 Z80 Program Code - - { "sra.bin", 0x40000, 0x82f452c4, BRF_SND }, // 6 Samples - { "srb.bin", 0x40000, 0x109e51e6, BRF_SND }, // 7 Samples -}; - - -STD_ROM_PICK(Twinadvk) -STD_ROM_FN(Twinadvk) - -static struct BurnRomInfo Multi96RomDesc[] = { - { "uh12", 0x20000, 0xe912ea4e, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ui12", 0x20000, 0xac99e837, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "ua4", 0x80000, 0x66cae586, BRF_GRA }, // 2 Sprites - { "ua5", 0x80000, 0x0bd9f6bb, BRF_GRA }, // 3 Sprites - { "ua6", 0x80000, 0x0e90b26c, BRF_GRA }, // 4 Sprites - - { "uh15.bin", 0x08000, 0x3d5acd08, BRF_SND }, // 5 Z80 Program Code - - { "sra.bin", 0x40000, 0x82f452c4, BRF_SND }, // 6 Samples - { "srb.bin", 0x40000, 0x109e51e6, BRF_SND }, // 7 Samples -}; - - -STD_ROM_PICK(Multi96) -STD_ROM_FN(Multi96) - -static struct BurnRomInfo HoneydolRomDesc[] = { - { "d-16.uh12", 0x20000, 0xcee1a2e3, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "d-17.ui12", 0x20000, 0xcac44154, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "d-13.1", 0x80000, 0xff6a57fb, BRF_GRA }, // 2 4bpp Sprites - - { "d-14.5", 0x80000, 0x2178996f, BRF_GRA }, // 3 8bpp Sprites - { "d-15.6", 0x80000, 0x6629239e, BRF_GRA }, // 4 8bpp Sprites - { "d-18.9", 0x80000, 0x0210507a, BRF_GRA }, // 5 8bpp Sprites - { "d-19.10", 0x80000, 0xd27375d5, BRF_GRA }, // 6 8bpp Sprites - - { "d-12.uh15", 0x08000, 0x386f1b63, BRF_SND }, // 7 Z80 Program Code - - { "d-11.u14", 0x40000, 0xf3ee4861, BRF_SND }, // 8 Samples -}; - - -STD_ROM_PICK(Honeydol) -STD_ROM_FN(Honeydol) - -static struct BurnRomInfo SnowbrosRomDesc[] = { - { "sn6.bin", 0x20000, 0x4899ddcf, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "sn5.bin", 0x20000, 0xad310d3f, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "sbros-1.41", 0x80000, 0x16f06b3a, BRF_GRA }, // 2 Sprites - - { "sbros-4.29", 0x08000, 0xe6eab4e4, BRF_SND }, // 3 Z80 Program Code -}; - - -STD_ROM_PICK(Snowbros) -STD_ROM_FN(Snowbros) - -static struct BurnRomInfo SnowbroaRomDesc[] = { - { "sbros-3a.5", 0x20000, 0x10cb37e1, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "sbros-2a.6", 0x20000, 0xab91cc1e, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "sbros-1.41", 0x80000, 0x16f06b3a, BRF_GRA }, // 2 Sprites - - { "sbros-4.29", 0x08000, 0xe6eab4e4, BRF_SND }, // 3 Z80 Program Code -}; - - -STD_ROM_PICK(Snowbroa) -STD_ROM_FN(Snowbroa) - -static struct BurnRomInfo SnowbrobRomDesc[] = { - { "sbros3-a", 0x20000, 0x301627d6, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "sbros2-a", 0x20000, 0xf6689f41, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "sbros-1.41", 0x80000, 0x16f06b3a, BRF_GRA }, // 2 Sprites - - { "sbros-4.29", 0x08000, 0xe6eab4e4, BRF_SND }, // 3 Z80 Program Code -}; - - -STD_ROM_PICK(Snowbrob) -STD_ROM_FN(Snowbrob) - -static struct BurnRomInfo SnowbrocRomDesc[] = { - { "3-a.ic5", 0x20000, 0xe1bc346b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "2-a.ic6", 0x20000, 0x1be27f9d, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "sbros-1.41", 0x80000, 0x16f06b3a, BRF_GRA }, // 2 Sprites - - { "sbros-4.29", 0x08000, 0xe6eab4e4, BRF_SND }, // 3 Z80 Program Code -}; - - -STD_ROM_PICK(Snowbroc) -STD_ROM_FN(Snowbroc) - -static struct BurnRomInfo SnowbrojRomDesc[] = { - { "snowbros.3", 0x20000, 0x3f504f9e, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "snowbros.2", 0x20000, 0x854b02bc, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "sbros-1.41", 0x80000, 0x16f06b3a, BRF_GRA }, // 2 Sprites - - { "sbros-4.29", 0x08000, 0xe6eab4e4, BRF_SND }, // 3 Z80 Program Code -}; - - -STD_ROM_PICK(Snowbroj) -STD_ROM_FN(Snowbroj) - -static struct BurnRomInfo SnowbrodRomDesc[] = { - { "sbk_3-a.bin", 0x20000, 0x97174d40, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "sbk_2-a.bin", 0x20000, 0x80cc80e5, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "sbros-1.41", 0x80000, 0x16f06b3a, BRF_GRA }, // 2 Sprites - - { "sbros-4.29", 0x08000, 0xe6eab4e4, BRF_SND }, // 3 Z80 Program Code -}; - - -STD_ROM_PICK(Snowbrod) -STD_ROM_FN(Snowbrod) - -static struct BurnRomInfo WintbobRomDesc[] = { - { "wb3", 0x10000, 0xb9719767, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "wb1", 0x10000, 0xa4488998, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - { "wb04.bin", 0x10000, 0x53be758d, BRF_ESS | BRF_PRG }, // 2 68000 Program Code - { "wb02.bin", 0x10000, 0xfc8e292e, BRF_ESS | BRF_PRG }, // 3 68000 Program Code - - { "wb13.bin", 0x10000, 0x426921de, BRF_GRA }, // 4 Sprites - { "wb06.bin", 0x10000, 0x68204937, BRF_GRA }, // 5 Sprites - { "wb12.bin", 0x10000, 0xef4e04c7, BRF_GRA }, // 6 Sprites - { "wb07.bin", 0x10000, 0x53f40978, BRF_GRA }, // 7 Sprites - { "wb11.bin", 0x10000, 0x41cb4563, BRF_GRA }, // 8 Sprites - { "wb08.bin", 0x10000, 0x9497b88c, BRF_GRA }, // 9 Sprites - { "wb10.bin", 0x10000, 0x5fa22b1e, BRF_GRA }, // 10 Sprites - { "wb09.bin", 0x10000, 0x9be718ca, BRF_GRA }, // 11 Sprites - - { "wb05.bin", 0x10000, 0x53fe59df, BRF_SND }, // 12 Z80 Program Code -}; - - -STD_ROM_PICK(Wintbob) -STD_ROM_FN(Wintbob) - -static struct BurnRomInfo SnowbroswbRomDesc[] = { - { "toa3.bin", 0x10000, 0x55d302da, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "toa1.bin", 0x10000, 0x3c64e145, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - { "wb04.bin", 0x10000, 0x53be758d, BRF_ESS | BRF_PRG }, // 2 68000 Program Code - { "wb02.bin", 0x10000, 0xfc8e292e, BRF_ESS | BRF_PRG }, // 3 68000 Program Code - - { "wb13.bin", 0x10000, 0x426921de, BRF_GRA }, // 4 Sprites - { "wb06.bin", 0x10000, 0x68204937, BRF_GRA }, // 5 Sprites - { "wb12.bin", 0x10000, 0xef4e04c7, BRF_GRA }, // 6 Sprites - { "wb07.bin", 0x10000, 0x53f40978, BRF_GRA }, // 7 Sprites - { "wb11.bin", 0x10000, 0x41cb4563, BRF_GRA }, // 8 Sprites - { "wb08.bin", 0x10000, 0x9497b88c, BRF_GRA }, // 9 Sprites - { "wb10.bin", 0x10000, 0x5fa22b1e, BRF_GRA }, // 10 Sprites - { "wb09.bin", 0x10000, 0x9be718ca, BRF_GRA }, // 11 Sprites - - { "wb05.bin", 0x10000, 0x53fe59df, BRF_SND }, // 12 Z80 Program Code -}; - - -STD_ROM_PICK(Snowbroswb) -STD_ROM_FN(Snowbroswb) - -static struct BurnRomInfo Snowbro3RomDesc[] = { - { "ur4", 0x020000, 0x19c13ffd, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ur3", 0x020000, 0x3f32fa15, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "ua5", 0x080000, 0x0604e385, BRF_GRA }, // 2 4bpp Sprites - - { "un7", 0x200000, 0x4a79da4c, BRF_GRA }, // 3 8bpp Sprites - { "un8", 0x200000, 0x7a4561a4, BRF_GRA }, // 4 8bpp Sprites - - { "us5", 0x080000, 0x7c6368ef, BRF_SND }, // 5 Samples - - { "sound.mcu", 0x010000, 0x00000000, BRF_PRG | BRF_NODUMP }, // 6 Sound MCU -}; - - -STD_ROM_PICK(Snowbro3) -STD_ROM_FN(Snowbro3) - -static struct BurnRomInfo BallboyRomDesc[] = { - { "27c010.ur4", 0x020000, 0x5fb51b99, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "27c010.ur3", 0x020000, 0xa9c1fdda, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "27c040.ua5", 0x080000, 0x0604e385, BRF_GRA }, // 2 4bpp Sprites - - { "27c160.un7", 0x200000, 0x4a79da4c, BRF_GRA }, // 3 8bpp Sprites - { "27c160.un8", 0x200000, 0xbfef8c44, BRF_GRA }, // 4 8bpp Sprites - - { "27c040.us5", 0x080000, 0x7c6368ef, BRF_SND }, // 5 Samples - - { "sound.mcu", 0x010000, 0x00000000, BRF_PRG | BRF_NODUMP }, // 6 Sound MCU -}; - - -STD_ROM_PICK(Ballboy) -STD_ROM_FN(Ballboy) - -static INT32 HyperpacDoReset() -{ - HyperpacSoundLatch = 0; - - if(HyperpacProtData && !Finalttr) memcpy(HyperpacRam + 0xf000, HyperpacProtData, 0x200); - if(HyperpacProtData && Finalttr) memcpy(HyperpacRam + 0x2000, HyperpacProtData, 0x200); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - if (Honeydol) BurnYM3812Reset(); - if (!Twinadv && !Honeydol) BurnYM2151Reset(); - - return 0; -} - -static INT32 SnowbrosDoReset() -{ - HyperpacSoundLatch = 0; - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - - return 0; -} - -static INT32 Snowbro3DoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - - Snowbro3Music = 0; - Snowbro3MusicPlaying = 0; - - return 0; -} - -static void HyperpacYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -// ---------------------------------------------------------------------------- -// CPU synchronisation - -static INT32 nCycles68KSync; - -static inline void snowbrosSynchroniseZ80(INT32 nExtraCycles) -{ - INT32 nCycles = ((INT64)SekTotalCycles() * nCyclesTotal[1] / nCyclesTotal[0]) + nExtraCycles; - - if (nCycles <= ZetTotalCycles()) { - return; - } - - nCycles68KSync = nCycles - nExtraCycles; - - BurnTimerUpdateYM3812(nCycles); -} - -// Callbacks for the FM chip - -static void snowbrosFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 snowbrosSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -static INT32 HoneydolSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static void Snowbro3PlayMusic(INT32 data) -{ - Snowbro3Music = data; - - bprintf(PRINT_NORMAL, _T("%x\n"), data); - - switch (data) { - case 0x23: { - memcpy(MSM6295ROM + 0x20000, MSM6295ROM + 0x80000, 0x20000); - Snowbro3MusicPlaying = 1; - break; - } - - case 0x24: { - memcpy(MSM6295ROM + 0x20000, MSM6295ROM + 0xa0000, 0x20000); - Snowbro3MusicPlaying = 1; - break; - } - - case 0x25: { - memcpy(MSM6295ROM + 0x20000, MSM6295ROM + 0xc0000, 0x20000); - Snowbro3MusicPlaying = 1; - break; - } - - case 0x26: { - memcpy(MSM6295ROM + 0x20000, MSM6295ROM + 0x80000, 0x20000); - Snowbro3MusicPlaying = 1; - break; - } - - case 0x27: - case 0x28: - case 0x29: - case 0x2a: - case 0x2b: - case 0x2c: - case 0x2d: { - memcpy(MSM6295ROM + 0x20000, MSM6295ROM + 0xc0000, 0x20000); - Snowbro3MusicPlaying = 1; - break; - } - - case 0x2e: { - Snowbro3MusicPlaying = 0; - break; - } - } -} - -static void Snowbro3PlaySound(INT32 data) -{ - INT32 Status = MSM6295ReadStatus(0); - - if ((Status & 0x01) == 0x00) { - MSM6295Command(0, 0x80 | data); - MSM6295Command(0, 0x12); - } else { - if ((Status & 0x02) == 0x00) { - MSM6295Command(0, 0x80 | data); - MSM6295Command(0, 0x12); - } else { - if ((Status & 0x04) == 0x00) { - MSM6295Command(0, 0x80 | data); - MSM6295Command(0, 0x42); - } - } - } -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall HyperpacReadByte(UINT32 a) -{ - switch (a) { - case 0x200000: { - if (Threein1semi) return 0x0a; - } - - case 0x200001: { - if (Moremore || Threein1semi) return 0x0a; - } - - case 0x500000: { - return HyperpacInput[0]; - } - - case 0x500001: { - return HyperpacDip[0]; - } - - case 0x500002: { - return HyperpacInput[1]; - } - - case 0x500003: { - return HyperpacDip[1]; - } - - case 0x500004: { - return HyperpacInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall HyperpacReadByteLow(UINT32 a) -{ - switch (a) { - case 0x200001: { - if (Fourin1boot) return 0x02; - } - - case 0x500000: { - return 0x7f - HyperpacInput[0]; - } - - case 0x500001: { - return HyperpacDip[0]; - } - - case 0x500002: { - return 0x7f - HyperpacInput[1]; - } - - case 0x500003: { - return HyperpacDip[1]; - } - - case 0x500004: { - return 0xff - HyperpacInput[2]; - } - - case 0x500005: { - return 0xff - HyperpacInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); - } - } - - return 0xff; -} - -void __fastcall HyperpacWriteByte(UINT32 a, UINT8 d) -{ - if (a < 0x100000) return; - - switch (a) { - case 0x300001: { - HyperpacSoundLatch = d & 0xff; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); - } - } -} - -void __fastcall TwinadvWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x200000: - case 0x200001: { - return; - } - - case 0x300001: { - HyperpacSoundLatch = d & 0xff; - ZetNmi(); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall HyperpacReadWord(UINT32 a) -{ - switch (a) { - case 0x200000: { - if (Cookbib3) return 0x2a2a; - } - - default: { - bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall HyperpacReadWordLow(UINT32 a) -{ - switch (a) { - case 0x500000: - case 0x500002: - case 0x500004: { - SEK_DEF_READ_WORD(0, a); - } - - default: { - bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); - } - - } - - return 0xffff; -} - -void __fastcall HyperpacWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x00b7d6: - case 0x00b7d8: { - if (Finalttr) return; - } - - case 0x200000: { - if (Fourin1boot) return; // Watchdog in original Snow Bros. - } - - case 0x300000: { - SEK_DEF_WRITE_WORD(0, a, d); - return; - } - - case 0x400000: { - return; - } - - case 0x800000: - case 0x900000: - case 0xa00000: { - // IRQ ACK - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write word -> %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall HoneydolReadByte(UINT32 a) -{ - switch (a) { - case 0x900000: { - return 0x7f - HyperpacInput[0]; - } - - case 0x900001: { - return HyperpacDip[0]; - } - - case 0x900002: { - return 0x7f - HyperpacInput[1]; - } - - case 0x900003: { - return HyperpacDip[1]; - } - - case 0x900004: { - return 0xff - HyperpacInput[2]; - } - - case 0x900005: { - return 0xff; - } - } - - bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); - - return 0; -} - -UINT16 __fastcall HoneydolReadWord(UINT32 a) -{ - switch (a) { - case 0x900000: - case 0x900002: - case 0x900004: { - SEK_DEF_READ_WORD(0, a); - } - } - - bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); - - return 0; -} - -void __fastcall HoneydolWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x300000: { - return; - } - - case 0x300001: { - HyperpacSoundLatch = d; - snowbrosSynchroniseZ80(0); - ZetNmi(); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); -} - -void __fastcall HoneydolWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x200000: { - return; // Watchdog? - } - - case 0x300000: { - SEK_DEF_WRITE_WORD(0, a, d); - return; - } - - case 0x400000: - case 0x500000: - case 0x600000: { - // IRQ Ack - return; - } - - case 0x800000: { - // ? - return; - } - } - - bprintf(PRINT_NORMAL, _T("Write word -> %06X, %04X\n"), a, d); -} - -UINT8 __fastcall HyperpacZ80Read(UINT16 a) -{ - switch (a) { - case 0xf001: { - return BurnYM2151ReadStatus(); - } - - case 0xf008: { - return HyperpacSoundLatch; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 Read -> %04X\n"), a); - } - } - - return 0; -} - -void __fastcall HyperpacZ80Write(UINT16 a, UINT8 d) -{ - d &= 0xff; - - switch (a) { - case 0xf000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xf001: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xf002: { - MSM6295Command(0, d); - return; - } - - default: { -// bprintf(PRINT_NORMAL, _T("Z80 Write -> %04X, %02x\n"), a, d); - } - } -} - -UINT8 __fastcall TwinadvZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x02: { - return HyperpacSoundLatch; - } - - case 0x06: { - return MSM6295ReadStatus(0); - } - } - - bprintf(PRINT_NORMAL, _T("Z80 Port Read -> %02X\n"), a); - - return 0; -} - -void __fastcall TwinadvZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x02: { - HyperpacSoundLatch = d; - return; - } - - case 0x04: { - INT32 bank = (d &0x02) >> 1; - memcpy(MSM6295ROM + 0x00000, MSM6295ROM + (0x40000 * bank), 0x40000); - return; - } - - case 0x06: { - MSM6295Command(0, d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Z80 Port Write -> %02X, %02x\n"), a, d); -} - -UINT8 __fastcall HoneydolZ80Read(UINT16 a) -{ - switch (a) { - case 0xe010: { - return MSM6295ReadStatus(0); - } - } - - bprintf(PRINT_NORMAL, _T("Z80 Read -> %04X\n"), a); - - return 0; -} - -void __fastcall HoneydolZ80Write(UINT16 a, UINT8 d) -{ - d &= 0xff; - - switch (a) { - case 0xe010: { - MSM6295Command(0, d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Z80 Write -> %04X, %02x\n"), a, d); -} - -UINT16 __fastcall SnowbrosReadWord(UINT32 a) -{ - switch (a) { - case 0x300000: - case 0x500000: - case 0x500002: - case 0x500004: { - SEK_DEF_READ_WORD(0, a); - } - case 0x500006: { // Toto Protection - return 0x07; - } - } - - return 0; -} - -UINT8 __fastcall SnowbrosReadByte(UINT32 a) -{ - switch (a) { - case 0x300001: { - snowbrosSynchroniseZ80(0x0100); - return HyperpacSoundLatch; - } - - case 0x500000: { - return 0x7f - HyperpacInput[0]; - } - - case 0x500001: { - return 0xff - HyperpacDip[0]; - } - - case 0x500002: { - return 0xff - HyperpacInput[1]; - } - - case 0x500003: { - return 0xff - HyperpacDip[1]; - } - - case 0x500004: { - return 0xff - HyperpacInput[2]; - } - case 0x500006: // Toto Protection - case 0x500007: { - return 0x07; - } - } - - return 0; -} - -void __fastcall SnowbrosWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x300000: { - SEK_DEF_WRITE_WORD(0, a, d); - return; - } - } -} - -void __fastcall SnowbrosWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x300001: { - HyperpacSoundLatch = d; - snowbrosSynchroniseZ80(0); - ZetNmi(); - return; - } - } -} - -UINT16 __fastcall Snowbro3ReadWord(UINT32 a) -{ - switch (a) { - case 0x300000: { - return 3; - } - - case 0x500000: - case 0x500002: - case 0x500004: { - SEK_DEF_READ_WORD(0, a); - } - } - - bprintf(PRINT_NORMAL, _T("68000 Read Word %06X\n"), a); - - return 0; -} - -UINT8 __fastcall Snowbro3ReadByte(UINT32 a) -{ - switch (a) { -/* case 0x300001: { - snowbrosSynchroniseZ80(0x0100); - return HyperpacSoundLatch; - }*/ - - case 0x500000: { - return 0x7f - HyperpacInput[0]; - } - - case 0x500001: { - return 0xff - HyperpacDip[0]; - } - - case 0x500002: { - return 0xff - HyperpacInput[1]; - } - - case 0x500003: { - return 0xff - HyperpacDip[1]; - } - - case 0x500004: { - return 0xff - HyperpacInput[2]; - } - - case 0x500005: { - return 0xff; - } - } - - bprintf(PRINT_NORMAL, _T("68000 Read Byte %06X\n"), a); - - return 0; -} - -void __fastcall Snowbro3WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x300000: { - if (d == 0xfe) { - Snowbro3MusicPlaying = 0; - MSM6295Command(0, 0x78); - } else { - d = d >> 8; - - if (d <= 0x21) Snowbro3PlaySound(d); - if (d >= 0x22 && d <= 0x31) Snowbro3PlayMusic(d); - if (d >= 0x30 && d <= 0x51) Snowbro3PlaySound(d - 0x30); - if (d >= 0x52 && d <= 0x5f) Snowbro3PlayMusic(d - 0x30); - } - return; - } - - case 0x200000: - case 0x800000: - case 0x900000: - case 0xa00000: { - return; - } - } - - bprintf(PRINT_NORMAL, _T("68000 Write Word %06X -> %04X\n"), a, d); -} - -void __fastcall Snowbro3WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x300000: { - if (d == 0xfe) { - Snowbro3MusicPlaying = 0; - MSM6295Command(0, 0x78); - } else { - //d = d >> 8; - - if (d <= 0x21) Snowbro3PlaySound(d); - if (d >= 0x22 && d <= 0x31) Snowbro3PlayMusic(d); - if (d >= 0x30 && d <= 0x51) Snowbro3PlaySound(d - 0x30); - if (d >= 0x52 && d <= 0x5f) Snowbro3PlayMusic(d - 0x30); - } - return; - } - } - - bprintf(PRINT_NORMAL, _T("68000 Write Byte %06X -> %02X\n"), a, d); -} - -UINT8 __fastcall SnowbrosZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x02: - return BurnYM3812Read(0, 0); - case 0x04: { - if (ZetTotalCycles() > nCycles68KSync) { - BurnTimerUpdateEndYM3812(); - } - return HyperpacSoundLatch; - } - } - - return 0; -} - -void __fastcall SnowbrosZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x02: { - BurnYM3812Write(0, 0, d); - return; - } - - case 0x03: { - BurnYM3812Write(0, 1, d); - return; - } - - case 0x04: { - HyperpacSoundLatch = d; - return; - } - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - HyperpacRom = Next; Next += 0x100000; - HyperpacZ80Rom = Next; Next += 0x10000; - if (Twinadv) { - MSM6295ROM = Next; Next += 0x80000; - } else { - MSM6295ROM = Next; Next += 0x40000; - } - - RamStart = Next; - - HyperpacRam = Next; Next += 0x10000; - if (Honeydol) { - HyperpacPaletteRam = Next; Next += 0x00800; - } else { - HyperpacPaletteRam = Next; Next += 0x00200; - } - HyperpacSpriteRam = Next; Next += 0x02000 * 2; // why is this spilling into z80 ram below? *2 to fix soundcpu for 4in1boot - HyperpacZ80Ram = Next; Next += 0x00800; - - RamEnd = Next; - - HyperpacSprites = Next; Next += (HyperpacNumTiles * 16 * 16); - HyperpacSprites8bpp = Next; Next += (HyperpacNumTiles8bpp * 16 * 16); - HyperpacProtData = Next; Next += 0x00200; - if (Honeydol) { - HyperpacPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - } else { - HyperpacPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - } - MemEnd = Next; - - return 0; -} - - -static INT32 SnowbrosMemIndex() -{ - UINT8 *Next; Next = Mem; - - HyperpacRom = Next; Next += 0x40000; - HyperpacZ80Rom = Next; Next += (Wintbob) ? 0x10000 : 0x08000; - - RamStart = Next; - - HyperpacRam = Next; Next += 0x04000; - HyperpacPaletteRam = Next; Next += 0x00200; - HyperpacSpriteRam = Next; Next += 0x02000; - HyperpacZ80Ram = Next; Next += 0x00800; - - RamEnd = Next; - - HyperpacSprites = Next; Next += (HyperpacNumTiles * 16 * 16); - HyperpacPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 Snowbro3MemIndex() -{ - UINT8 *Next; Next = Mem; - - HyperpacRom = Next; Next += 0x40000; - MSM6295ROM = Next; Next += 0xe0000; - - RamStart = Next; - - HyperpacRam = Next; Next += 0x04000; - HyperpacPaletteRam = Next; Next += 0x00400; - HyperpacSpriteRam = Next; Next += 0x02200; - - RamEnd = Next; - - HyperpacSprites = Next; Next += (HyperpacNumTiles * 16 * 16); - HyperpacSprites8bpp = Next; Next += (HyperpacNumTiles8bpp * 16 * 16); - HyperpacPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 HyperpacMachineInit() -{ - BurnSetRefreshRate(57.5); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(HyperpacRom , 0x000000, 0x0fffff, MAP_ROM); - if (Finalttr) { - SekMapMemory(HyperpacRam , 0x100000, 0x103fff, MAP_RAM); - } else { - SekMapMemory(HyperpacRam , 0x100000, 0x10ffff, MAP_RAM); - } - SekMapMemory(HyperpacPaletteRam, 0x600000, 0x6001ff, MAP_RAM); - SekMapMemory(HyperpacSpriteRam , 0x700000, 0x701fff, MAP_RAM); - if (Fourin1boot || Finalttr) { - SekSetReadByteHandler(0, HyperpacReadByteLow); - SekSetReadWordHandler(0, HyperpacReadWordLow); - } else { - SekSetReadByteHandler(0, HyperpacReadByte); - SekSetReadWordHandler(0, HyperpacReadWord); - } - SekSetWriteByteHandler(0, HyperpacWriteByte); - SekSetWriteWordHandler(0, HyperpacWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xcfff, 0, HyperpacZ80Rom); - ZetMapArea(0x0000, 0xcfff, 2, HyperpacZ80Rom); - ZetMapArea(0xd000, 0xd7ff, 0, HyperpacZ80Ram); - ZetMapArea(0xd000, 0xd7ff, 1, HyperpacZ80Ram); - ZetMapArea(0xd000, 0xd7ff, 2, HyperpacZ80Ram); - ZetSetReadHandler(HyperpacZ80Read); - ZetSetWriteHandler(HyperpacZ80Write); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&HyperpacYM2151IrqHandler); - BurnYM2151SetAllRoutes(0.10, BURN_SND_ROUTE_BOTH); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 999900 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - HyperpacDoReset(); - - return 0; -} - -static INT32 HyperpacSpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 HyperpacSpriteXOffsets[16] = { 4, 0, 260, 256, 20, 16, 276, 272, 12, 8, 268, 264, 28, 24, 284, 280 }; -static INT32 HyperpacSpriteYOffsets[16] = { 0, 64, 32, 96, 512, 576, 544, 608, 128, 192, 160, 224, 640, 704, 672, 736 }; -static INT32 SnowbrosSpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 SnowbrosSpriteXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 256, 260, 264, 268, 272, 276, 280, 284 }; -static INT32 SnowbrosSpriteYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; -static INT32 WintbobSpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 WintbobSpriteXOffsets[16] = { 12, 8, 4, 0, 28, 24, 20, 16, 44, 40, 36, 32, 60, 56, 52, 48 }; -static INT32 WintbobSpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 Honeydol8BppPlaneOffsets[8] = { 0, 1, 2, 3, 0x800000, 0x800001, 0x800002, 0x800003 }; -static INT32 Honeydol8BppXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 256, 260, 264, 268, 272, 276, 280, 284 }; -static INT32 Honeydol8BppYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; -static INT32 Snowbro38BppPlaneOffsets[8] = { 8, 9, 10, 11, 0, 1, 2, 3 }; -static INT32 Snowbro38BppXOffsets[16] = { 0, 4, 16, 20, 32, 36, 48, 52, 512, 516, 528, 532, 544, 548, 560, 564 }; -static INT32 Snowbro38BppYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 1024, 1088, 1152, 1216, 1280, 1344, 1408, 1472 }; - -static INT32 HyperpacInit() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 6144; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x0c0000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 5, 1); if (nRet != 0) return 1; - - // Simulate RAM initialisation done by the protection MCU (not needed for bootleg) - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "hyperpac")) { - HyperpacRam[0xe000 + 0] = 0xf9; - HyperpacRam[0xe000 + 1] = 0x4e; - HyperpacRam[0xe002 + 0] = 0x00; - HyperpacRam[0xe002 + 1] = 0x00; - HyperpacRam[0xe004 + 0] = 0x2c; - HyperpacRam[0xe004 + 1] = 0x06; - HyperpacRam[0xe080 + 0] = 0xdc; - HyperpacRam[0xe080 + 1] = 0xfe; - HyperpacRam[0xe082 + 0] = 0x98; - HyperpacRam[0xe082 + 1] = 0xba; - HyperpacRam[0xe084 + 0] = 0x54; - HyperpacRam[0xe084 + 1] = 0x76; - HyperpacRam[0xe086 + 0] = 0x10; - HyperpacRam[0xe086 + 1] = 0x32; - } - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x00000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x40000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x80000, 4, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, HyperpacSpritePlaneOffsets, HyperpacSpriteXOffsets, HyperpacSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 6, 1); if (nRet != 0) return 1; - - nRet = HyperpacMachineInit(); if (nRet) return 1; - - return 0; -} - -static INT32 Cookbib2Init() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 10240; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x140000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 5, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x080000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x100000, 4, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, HyperpacSpritePlaneOffsets, HyperpacSpriteXOffsets, HyperpacSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 6, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(HyperpacProtData, 8, 1); if (nRet) return 1; - BurnByteswap(HyperpacProtData, 0x200); - - nRet = HyperpacMachineInit(); if (nRet) return 1; - - return 0; -} - -static INT32 Cookbib3Init() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 16384; - - Cookbib3 = 1; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x200000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load and descramble Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 5, 1); if (nRet != 0) return 1; - UINT8 *pTemp = (UINT8*)BurnMalloc(0x10000); - memcpy(pTemp, HyperpacZ80Rom, 0x10000); - memcpy(HyperpacZ80Rom + 0xc000, pTemp + 0x0000, 0x4000); - memcpy(HyperpacZ80Rom + 0x8000, pTemp + 0x4000, 0x4000); - memcpy(HyperpacZ80Rom + 0x4000, pTemp + 0x8000, 0x4000); - memcpy(HyperpacZ80Rom + 0x0000, pTemp + 0xc000, 0x4000); - BurnFree(pTemp); - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x080000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x100000, 4, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, HyperpacSpritePlaneOffsets, HyperpacSpriteXOffsets, HyperpacSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 6, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(HyperpacProtData, 8, 1); if (nRet) return 1; - BurnByteswap(HyperpacProtData, 0x200); - - nRet = HyperpacMachineInit(); if (nRet) return 1; - - return 0; -} - -static INT32 MoremoreInit() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 16384; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "moremore") || !strcmp(BurnDrvGetTextA(DRV_NAME), "moremorp")) Moremore = 1; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "3in1semi")) Threein1semi = 1; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x200000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 6, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x080000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x100000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x180000, 5, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, HyperpacSpritePlaneOffsets, HyperpacSpriteXOffsets, HyperpacSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 7, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(HyperpacProtData, 9, 1); if (nRet) return 1; - BurnByteswap(HyperpacProtData, 0x200); - - nRet = HyperpacMachineInit(); if (nRet) return 1; - - return 0; -} - -static INT32 TwinkleInit() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 4096; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x080000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 3, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, HyperpacSpritePlaneOffsets, HyperpacSpriteXOffsets, HyperpacSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 4, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(HyperpacProtData, 6, 1); if (nRet) return 1; - BurnByteswap(HyperpacProtData, 0x200); - - nRet = HyperpacMachineInit(); if (nRet) return 1; - - return 0; -} - -static INT32 PzlbreakInit() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 8192; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x100000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 4, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x080000, 3, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, HyperpacSpritePlaneOffsets, HyperpacSpriteXOffsets, HyperpacSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 5, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(HyperpacProtData, 7, 1); if (nRet) return 1; - BurnByteswap(HyperpacProtData, 0x200); - - nRet = HyperpacMachineInit(); if (nRet) return 1; - - return 0; -} - -static void Fourin1bootDescrambleRom() -{ - UINT8 *buffer; - UINT8 *src = HyperpacRom; - INT32 len = 0x100000; - - /* strange order */ - if ((buffer = (UINT8*)BurnMalloc(len))) - { - INT32 i; - for (i = 0;i < len; i++) - if (i&1) buffer[i] = BITSWAP08(src[i],6,7,5,4,3,2,1,0); - else buffer[i] = src[i]; - - memcpy(src,buffer,len); - BurnFree(buffer); - } - - src = HyperpacZ80Rom; - len = 0x10000; - - /* strange order */ - if ((buffer = (UINT8*)BurnMalloc(len))) - { - INT32 i; - for (i = 0;i < len; i++) { - buffer[i] = src[i ^ 0x4000]; - } - memcpy(src,buffer,len); - BurnFree(buffer); - } -} - -static INT32 Fourin1bootInit() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 16384; - - Fourin1boot = 1; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x200000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load and Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 3, 1); if (nRet != 0) return 1; - - Fourin1bootDescrambleRom(); - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, SnowbrosSpritePlaneOffsets, SnowbrosSpriteXOffsets, SnowbrosSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 4, 1); if (nRet != 0) return 1; - - nRet = HyperpacMachineInit(); if (nRet) return 1; - - return 0; -} - -static INT32 FinalttrInit() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 8192; - - Finalttr = 1; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x100000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 6, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x040000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x080000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x0c0000, 5, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, HyperpacSpritePlaneOffsets, HyperpacSpriteXOffsets, HyperpacSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 7, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(HyperpacProtData, 9, 1); if (nRet) return 1; - BurnByteswap(HyperpacProtData, 0x200); - - nRet = HyperpacMachineInit(); if (nRet) return 1; - - BurnYM2151SetAllRoutes(0.08, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - - return 0; -} - -static INT32 TwinadvInit() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 12288; - - Twinadv = 1; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x180000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 5, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x080000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x100000, 4, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, SnowbrosSpritePlaneOffsets, SnowbrosSpriteXOffsets, SnowbrosSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x40000, 7, 1); if (nRet != 0) return 1; - - BurnSetRefreshRate(57.5); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(HyperpacRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(HyperpacRam , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(HyperpacPaletteRam, 0x600000, 0x6001ff, MAP_RAM); - SekMapMemory(HyperpacSpriteRam , 0x700000, 0x701fff, MAP_RAM); - SekSetReadByteHandler(0, HyperpacReadByteLow); - SekSetReadWordHandler(0, HyperpacReadWordLow); - SekSetWriteByteHandler(0, TwinadvWriteByte); - SekSetWriteWordHandler(0, HyperpacWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, HyperpacZ80Rom); - ZetMapArea(0x0000, 0x7fff, 2, HyperpacZ80Rom); - ZetMapArea(0x8000, 0x87ff, 0, HyperpacZ80Ram); - ZetMapArea(0x8000, 0x87ff, 1, HyperpacZ80Ram); - ZetMapArea(0x8000, 0x87ff, 2, HyperpacZ80Ram); - ZetSetInHandler(TwinadvZ80PortRead); - ZetSetOutHandler(TwinadvZ80PortWrite); - ZetClose(); - - // Setup the OKIM6295 emulation - MSM6295Init(0, (12000000/12) / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - HyperpacDoReset(); - - return 0; -} - -static INT32 HoneydolInit() -{ - INT32 nRet = 0, nLen; - - HyperpacNumTiles = 4096; - HyperpacNumTiles8bpp = 8192; - - Honeydol = 1; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x200000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 7, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 2, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, SnowbrosSpritePlaneOffsets, SnowbrosSpriteXOffsets, SnowbrosSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - - // Load and Decode 8bpp Sprite Roms - memset(HyperpacTempGfx, 0, 0x200000); - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x080000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x100000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x180000, 6, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles8bpp, 8, 16, 16, Honeydol8BppPlaneOffsets, Honeydol8BppXOffsets, Honeydol8BppYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites8bpp); - BurnFree(HyperpacTempGfx); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 8, 1); if (nRet != 0) return 1; - - BurnSetRefreshRate(57.5); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(HyperpacRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(HyperpacRam , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(HyperpacPaletteRam, 0xa00000, 0xa007ff, MAP_RAM); - SekMapMemory(HyperpacSpriteRam , 0xb00000, 0xb01fff, MAP_RAM); - SekSetReadByteHandler(0, HoneydolReadByte); - SekSetReadWordHandler(0, HoneydolReadWord); - SekSetWriteByteHandler(0, HoneydolWriteByte); - SekSetWriteWordHandler(0, HoneydolWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, HyperpacZ80Rom); - ZetMapArea(0x0000, 0x7fff, 2, HyperpacZ80Rom); - ZetMapArea(0x8000, 0x87ff, 0, HyperpacZ80Ram); - ZetMapArea(0x8000, 0x87ff, 1, HyperpacZ80Ram); - ZetMapArea(0x8000, 0x87ff, 2, HyperpacZ80Ram); - ZetSetInHandler(SnowbrosZ80PortRead); - ZetSetOutHandler(SnowbrosZ80PortWrite); - ZetSetReadHandler(HoneydolZ80Read); - ZetSetWriteHandler(HoneydolZ80Write); - ZetClose(); - - BurnYM3812Init(1, 3000000, &snowbrosFMIRQHandler, &HoneydolSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 999900 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - HyperpacDoReset(); - - return 0; -} - -static void DrvTotoRomDecode() -{ - // every single rom has bits 0x10 and 0x08 swapped - UINT8 *src = HyperpacRom; - int len = 0x40000; - - for (int i = 0; i < len; i++) - { - src[i] = BITSWAP08(src[i], 7, 6, 5, 3, 4, 2, 1, 0); - } - - src = HyperpacTempGfx; - len = 0x80000; - - for (int i = 0; i < len; i++) - { - src[i] = BITSWAP08(src[i], 7, 6, 5, 3, 4, 2, 1, 0); - } - - src = HyperpacZ80Rom; - len = 0x08000; - - for (int i = 0; i < len; i++) - { - src[i] = BITSWAP08(src[i], 7, 6, 5, 3, 4, 2, 1, 0); - } -} - - -static INT32 SnowbrosInit() -{ - INT32 nRet = 0, nLen; - - BurnSetRefreshRate(57.5); - - HyperpacNumTiles = 4096; - - // Allocate and Blank all required memory - Mem = NULL; - SnowbrosMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - SnowbrosMemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x80000); - - if (Toto) { - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 6, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x00000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x20000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x40000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x60000, 5, 1); if (nRet != 0) return 1; - DrvTotoRomDecode(); - GfxDecode(HyperpacNumTiles, 4, 16, 16, SnowbrosSpritePlaneOffsets, SnowbrosSpriteXOffsets, SnowbrosSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - } else - if (Wintbob) { - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x20001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x20000, 3, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 12, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x00000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x00001, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x20000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x20001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x40000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x40001, 9, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x60000, 10, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x60001, 11, 2); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, WintbobSpritePlaneOffsets, WintbobSpriteXOffsets, WintbobSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - } else { - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Rom - nRet = BurnLoadRom(HyperpacZ80Rom, 3, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x00000, 2, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, SnowbrosSpritePlaneOffsets, SnowbrosSpriteXOffsets, SnowbrosSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - BurnFree(HyperpacTempGfx); - } - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(HyperpacRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(HyperpacRam , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(HyperpacPaletteRam, 0x600000, 0x6001ff, MAP_RAM); - SekMapMemory(HyperpacSpriteRam , 0x700000, 0x701fff, MAP_RAM); - SekSetReadWordHandler(0, SnowbrosReadWord); - SekSetWriteWordHandler(0, SnowbrosWriteWord); - SekSetReadByteHandler(0, SnowbrosReadByte); - SekSetWriteByteHandler(0, SnowbrosWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, HyperpacZ80Rom); - ZetMapArea(0x0000, 0x7fff, 2, HyperpacZ80Rom); - ZetMapArea(0x8000, 0x87ff, 0, HyperpacZ80Ram); - ZetMapArea(0x8000, 0x87ff, 1, HyperpacZ80Ram); - ZetMapArea(0x8000, 0x87ff, 2, HyperpacZ80Ram); - ZetSetInHandler(SnowbrosZ80PortRead); - ZetSetOutHandler(SnowbrosZ80PortWrite); - ZetClose(); - - BurnYM3812Init(1, 3000000, &snowbrosFMIRQHandler, &snowbrosSynchroniseStream, 0); - BurnTimerAttachZetYM3812(6000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - SnowbrosDoReset(); - - return 0; -} - -static INT32 WintbobInit() -{ - Wintbob = 1; - - return SnowbrosInit(); -} - -static INT32 TotoInit() -{ - Toto = 1; - - return SnowbrosInit(); -} - -static INT32 Snowbro3Init() -{ - INT32 nRet = 0, nLen; - - Snowbro3 = 1; - - HyperpacNumTiles = 0x1000; - HyperpacNumTiles8bpp = 0x4000; - - // Allocate and Blank all required memory - Mem = NULL; - Snowbro3MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - Snowbro3MemIndex(); - - HyperpacTempGfx = (UINT8*)BurnMalloc(0x400000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(HyperpacRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Decode 68000 Program Rom - UINT8 *buffer; - buffer = (UINT8*)BurnMalloc(0x40000); - for (INT32 i = 0; i < 0x40000; i++) { - buffer[i] = HyperpacRom[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,3,4,1,2,0)]; - } - memcpy(HyperpacRom, buffer, 0x40000); - BurnFree(buffer); - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(HyperpacTempGfx + 0x00000, 2, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles, 4, 16, 16, SnowbrosSpritePlaneOffsets, SnowbrosSpriteXOffsets, SnowbrosSpriteYOffsets, 0x400, HyperpacTempGfx, HyperpacSprites); - - // Load and Decode 8bpp Sprite Roms - memset(HyperpacTempGfx, 0, 0x400000); - nRet = BurnLoadRom(HyperpacTempGfx + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(HyperpacTempGfx + 0x200000, 4, 1); if (nRet != 0) return 1; - GfxDecode(HyperpacNumTiles8bpp, 8, 16, 16, Snowbro38BppPlaneOffsets, Snowbro38BppXOffsets, Snowbro38BppYOffsets, 0x800, HyperpacTempGfx, HyperpacSprites8bpp); - - // Load Sample Roms - memset(HyperpacTempGfx, 0, 0x400000); - nRet = BurnLoadRom(HyperpacTempGfx, 5, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM + 0x00000, HyperpacTempGfx + 0x00000, 0x20000); - memcpy(MSM6295ROM + 0x80000, HyperpacTempGfx + 0x20000, 0x60000); - BurnFree(HyperpacTempGfx); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(HyperpacRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(HyperpacRam , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(HyperpacPaletteRam, 0x600000, 0x6003ff, MAP_RAM); - SekMapMemory(HyperpacSpriteRam , 0x700000, 0x7021ff, MAP_RAM); - SekSetReadWordHandler(0, Snowbro3ReadWord); - SekSetWriteWordHandler(0, Snowbro3WriteWord); - SekSetReadByteHandler(0, Snowbro3ReadByte); - SekSetWriteByteHandler(0, Snowbro3WriteByte); - SekClose(); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 999900 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - Snowbro3DoReset(); - - return 0; -} - -static INT32 HyperpacExit() -{ - MSM6295Exit(0); - - SekExit(); - ZetExit(); - - GenericTilesExit(); - - if (!Twinadv && !Honeydol) BurnYM2151Exit(); - if (Honeydol) BurnYM3812Exit(); - - BurnFree(Mem); - - HyperpacNumTiles = 0; - HyperpacNumTiles8bpp = 0; - - Moremore = 0; - Threein1semi = 0; - Cookbib3 = 0; - Fourin1boot = 0; - Finalttr = 0; - Twinadv = 0; - Honeydol = 0; - Snowbro3 = 0; - - return 0; -} - -static INT32 SnowbrosExit() -{ - if (!Snowbro3) BurnYM3812Exit(); - if (Snowbro3) MSM6295Exit(0); - - SekExit(); - if (!Snowbro3) ZetExit(); - - GenericTilesExit(); - - BurnFree(Mem); - - HyperpacNumTiles = 0; - HyperpacNumTiles8bpp = 0; - Wintbob = 0; - Toto = 0; - - Snowbro3Music = 0; - Snowbro3MusicPlaying = 0; - Snowbro3 = 0; - - return 0; -} - -static void HyperpacRenderSpriteLayer() -{ - INT32 x = 0, y = 0, Offs; - - for (Offs = 0; Offs < 0x2000; Offs += 16) { - INT32 dx = ((HyperpacSpriteRam[Offs + 9] << 8) + HyperpacSpriteRam[Offs + 8]) & 0xff; - INT32 dy = ((HyperpacSpriteRam[Offs + 11] << 8) + HyperpacSpriteRam[Offs + 10]) & 0xff; - INT32 TileColour = (HyperpacSpriteRam[Offs + 7] << 8) + HyperpacSpriteRam[Offs + 6]; - INT32 Attr = (HyperpacSpriteRam[Offs + 15] << 8) + HyperpacSpriteRam[Offs + 14]; - INT32 Attr2 = (HyperpacSpriteRam[Offs + 13] << 8) + HyperpacSpriteRam[Offs + 12]; - INT32 FlipX = Attr & 0x80; - INT32 FlipY = (Attr & 0x40) << 1; - INT32 Tile = ((Attr & 0x3f) << 8) + (Attr2 & 0xff); - INT32 Colour = (TileColour & 0xf0) >> 4; - - if (TileColour & 1) dx = -1 - (dx ^ 0xff); - if (TileColour & 2) dy = -1 - (dy ^ 0xff); - if (TileColour & 4) { - x += dx; - y += dy; - } else { - x = dx; - y = dy; - } - - if (x > 511) x &= 0x1ff; - if (y > 511) y &= 0x1ff; - - if (x > 15 && x < 240 && (y - 16) > 15 && (y - 16) <= 208) { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } - } -} - -static void TwinadvRenderSpriteLayer() -{ - INT32 x = 0, y = 0, Offs; - - for (Offs = 0; Offs < 0x2000; Offs += 16) { - INT32 dx = ((HyperpacSpriteRam[Offs + 9] << 8) + HyperpacSpriteRam[Offs + 8]) & 0xff; - INT32 dy = ((HyperpacSpriteRam[Offs + 11] << 8) + HyperpacSpriteRam[Offs + 10]) & 0xff; - INT32 TileColour = (HyperpacSpriteRam[Offs + 7] << 8) + HyperpacSpriteRam[Offs + 6]; - INT32 Attr = (HyperpacSpriteRam[Offs + 15] << 8) + HyperpacSpriteRam[Offs + 14]; - INT32 Attr2 = (HyperpacSpriteRam[Offs + 13] << 8) + HyperpacSpriteRam[Offs + 12]; - INT32 FlipX = Attr & 0x80; - INT32 FlipY = (Attr & 0x40) << 1; - INT32 Tile = ((Attr & 0x3f) << 8) + (Attr2 & 0xff); - INT32 Colour = (TileColour & 0xf0) >> 4; - Colour ^= 0xf; - - x = dx; - y = dy; - - if (x > 511) x &= 0x1ff; - if (y > 511) y &= 0x1ff; - - if (x > 15 && x < 240 && (y - 16) > 15 && (y - 16) <= 208) { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } - } -} - -static void HoneydolRenderSpriteLayer() -{ - INT32 x = 0, y = 0, Offs; - - for (Offs = 0; Offs < 0x2000; Offs += 16) { - INT32 dx = (((HyperpacSpriteRam[Offs + 9] << 8) + HyperpacSpriteRam[Offs + 8]) >> 8) & 0xff; - INT32 dy = (((HyperpacSpriteRam[Offs + 11] << 8) + HyperpacSpriteRam[Offs + 10]) >> 8) & 0xff; - INT32 TileColour = (((HyperpacSpriteRam[Offs + 7] << 8) + HyperpacSpriteRam[Offs + 6]) >> 8) & 3; - INT32 Attr = ((HyperpacSpriteRam[Offs + 15] << 8) + HyperpacSpriteRam[Offs + 14]) >> 8; - INT32 Attr2 = (((HyperpacSpriteRam[Offs + 13] << 8) + HyperpacSpriteRam[Offs + 12]) >> 8) & 0xff; - INT32 FlipX = Attr & 0x80; - INT32 FlipY = (Attr & 0x40) << 1; - INT32 Tile = ((Attr & 0x3f) << 8) + (Attr2 & 0xff); - INT32 Colour = TileColour; - - x = dx; - y = dy; - - if (x > 511) x &= 0x1ff; - if (y > 511) y &= 0x1ff; - - if (x > 15 && x < 240 && (y - 16) > 15 && (y - 16) <= 208) { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask(pTransDraw, Tile, x, y - 16, Colour, 8, 0, 0, HyperpacSprites8bpp); - - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Tile, x, y - 16, Colour, 8, 0, 0, HyperpacSprites8bpp); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile, x, y - 16, Colour, 8, 0, 0, HyperpacSprites8bpp); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Tile, x, y - 16, Colour, 8, 0, 0, HyperpacSprites8bpp); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask_Clip(pTransDraw, Tile, x, y - 16, Colour, 8, 0, 0, HyperpacSprites8bpp); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Tile, x, y - 16, Colour, 8, 0, 0, HyperpacSprites8bpp); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile, x, y - 16, Colour, 8, 0, 0, HyperpacSprites8bpp); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Tile, x, y - 16, Colour, 8, 0, 0, HyperpacSprites8bpp); - } - } - } - - - - - dx = ((HyperpacSpriteRam[Offs + 9] << 8) + HyperpacSpriteRam[Offs + 8]) & 0xff; - dy = ((HyperpacSpriteRam[Offs + 11] << 8) + HyperpacSpriteRam[Offs + 10]) & 0xff; - TileColour = (HyperpacSpriteRam[Offs + 7] << 8) + HyperpacSpriteRam[Offs + 6]; - Attr = (HyperpacSpriteRam[Offs + 15] << 8) + HyperpacSpriteRam[Offs + 14]; - Attr2 = (HyperpacSpriteRam[Offs + 13] << 8) + HyperpacSpriteRam[Offs + 12]; - FlipX = Attr & 0x80; - FlipY = (Attr & 0x40) << 1; - Tile = ((Attr & 0x3f) << 8) + (Attr2 & 0xff); - Colour = (TileColour & 0x3f0) >> 4; - Colour ^= 0x3f; - - x = dx; - y = dy; - - if (x > 511) x &= 0x1ff; - if (y > 511) y &= 0x1ff; - - if (x > 15 && x < 240 && (y - 16) > 15 && (y - 16) <= 208) { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } - } -} - -static void SnowbrosRenderSpriteLayer() -{ - INT32 x = 0, y = 0, Offs; - - for (Offs = 0; Offs < 0x2000; Offs += 16) { - INT32 dx = ((HyperpacSpriteRam[Offs + 9] << 8) + HyperpacSpriteRam[Offs + 8]) & 0xff; - INT32 dy = ((HyperpacSpriteRam[Offs + 11] << 8) + HyperpacSpriteRam[Offs + 10]) & 0xff; - INT32 TileColour = (HyperpacSpriteRam[Offs + 7] << 8) + HyperpacSpriteRam[Offs + 6]; - INT32 Attr = (HyperpacSpriteRam[Offs + 15] << 8) + HyperpacSpriteRam[Offs + 14]; - INT32 Attr2 = (HyperpacSpriteRam[Offs + 13] << 8) + HyperpacSpriteRam[Offs + 12]; - INT32 FlipX = Attr & 0x80; - INT32 FlipY = (Attr & 0x40) << 1; - INT32 Tile = ((Attr & 0x1f) << 8) + (Attr2 & 0xff); - INT32 Colour = (TileColour & 0xf0) >> 4; - - if (TileColour & 1) dx = -1 - (dx ^ 0xff); - if (TileColour & 2) dy = -1 - (dy ^ 0xff); - if (TileColour & 4) { - x += dx; - y += dy; - } else { - x = dx; - y = dy; - } - - if (x > 511) x &= 0x1ff; - if (y > 511) y &= 0x1ff; - - if (x > 15 && x < 240 && (y - 16) > 15 && (y - 16) <= 208) { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } - } -} - -static void WintbobRenderSpriteLayer() -{ - INT32 x = 0, y = 0, Offs; - - UINT16 *SpriteRam = (UINT16*)HyperpacSpriteRam; - - for (Offs = 0; Offs < 0x2000 >> 1; Offs += 8) { - x = SpriteRam[Offs + 0] & 0xff; - y = SpriteRam[Offs + 4] & 0xff; - INT32 Attr = SpriteRam[Offs + 1]; - INT32 Disbl = Attr & 0x02; - INT32 Wrapr = Attr & 0x08; - INT32 Colour = (Attr & 0xf0) >> 4; - INT32 Attr2 = SpriteRam[Offs + 2]; - INT32 Tile = (Attr2 << 8) | (SpriteRam[Offs + 3] & 0xff); - INT32 FlipX = Attr2 & 0x80; - INT32 FlipY = (Attr2 & 0x40) << 1; - - if (Wrapr == 8) x -= 256; - - Tile &= 0xfff; - - if (Disbl == 2) continue; - - if (x > 15 && x < 240 && (y - 16) > 15 && (y - 16) <= 208) { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Tile, x, y - 16, Colour, 4, 0, 0, HyperpacSprites); - } - } - } - } -} - -static void Snowbro3RenderSpriteLayer() -{ - INT32 x = 0, y = 0, Offs; - - UINT16 *SpriteRam = (UINT16*)HyperpacSpriteRam; - UINT8 *pTile = NULL; - INT32 ColourDepth = 0; - - for (Offs = 0; Offs < 0x2200 >> 1; Offs += 8) { - INT32 dx = SpriteRam[Offs + 4] & 0xff; - INT32 dy = SpriteRam[Offs + 5] & 0xff; - INT32 TileColour = SpriteRam[Offs + 3]; - INT32 Attr = SpriteRam[Offs + 7]; - INT32 Attr2 = SpriteRam[Offs + 6]; - INT32 FlipX = Attr & 0x80; - INT32 FlipY = (Attr & 0x40) << 1; - INT32 Tile = ((Attr & 0xff) << 8) + (Attr2 & 0xff); - - if (TileColour & 1) dx = -1 - (dx ^ 0xff); - if (TileColour & 2) dy = -1 - (dy ^ 0xff); - if (TileColour & 4) { - x += dx; - y += dy; - } else { - x = dx; - y = dy; - } - - if (x > 511) x &= 0x1ff; - if (y > 511) y &= 0x1ff; - - if (Offs < 0x800) { - TileColour = 0x10; - Tile &= 0x3fff; - ColourDepth = 8; - pTile = HyperpacSprites8bpp; - } else { - Tile &= 0xfff; - ColourDepth = 4; - pTile = HyperpacSprites; - } - - INT32 Colour = (TileColour & 0xf0) >> 4; - - if (x > 15 && x < 240 && (y - 16) > 15 && (y - 16) <= 208) { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask(pTransDraw, Tile, x, y - 16, Colour, ColourDepth, 0, 0, pTile); - - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Tile, x, y - 16, Colour, ColourDepth, 0, 0, pTile); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile, x, y - 16, Colour, ColourDepth, 0, 0, pTile); - } else { - Render16x16Tile_Mask_FlipXY(pTransDraw, Tile, x, y - 16, Colour, ColourDepth, 0, 0, pTile); - } - } - } else { - if (!FlipY) { - if (!FlipX) { - Render16x16Tile_Mask_Clip(pTransDraw, Tile, x, y - 16, Colour, ColourDepth, 0, 0, pTile); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Tile, x, y - 16, Colour, ColourDepth, 0, 0, pTile); - } - } else { - if (!FlipX) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile, x, y - 16, Colour, ColourDepth, 0, 0, pTile); - } else { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Tile, x, y - 16, Colour, ColourDepth, 0, 0, pTile); - } - } - } - } -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 0) & 0x1f; - g = (nColour >> 5) & 0x1f; - b = (nColour >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - return BurnHighCol(r, g, b, 0); -} - -static INT32 HyperpacCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)HyperpacPaletteRam, pd = HyperpacPalette; i < 0x200; i++, ps++, pd++) { - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*((UINT16*)ps))); - } - - return 0; -} - -static INT32 HoneydolCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)HyperpacPaletteRam, pd = HyperpacPalette; i < 0x800; i++, ps++, pd++) { - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*((UINT16*)ps))); - } - - return 0; -} - -static INT32 Snowbro3CalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)HyperpacPaletteRam, pd = HyperpacPalette; i < 0x400; i++, ps++, pd++) { - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*((UINT16*)ps))); - } - - return 0; -} - -static void HyperpacRender() -{ - HyperpacCalcPalette(); - - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0xf0; - } - - HyperpacRenderSpriteLayer(); - BurnTransferCopy(HyperpacPalette); -} - -static void PzlbreakRender() -{ - HyperpacCalcPalette(); - - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0xc0; - } - - HyperpacRenderSpriteLayer(); - BurnTransferCopy(HyperpacPalette); -} - -static void TwinadvRender() -{ - HyperpacCalcPalette(); - - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0xf0; - } - - TwinadvRenderSpriteLayer(); - BurnTransferCopy(HyperpacPalette); -} - -static void HoneydolRender() -{ - HoneydolCalcPalette(); - - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0xf0; - } - - HoneydolRenderSpriteLayer(); - BurnTransferCopy(HyperpacPalette); -} - -static void SnowbrosRender() -{ - HyperpacCalcPalette(); - - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0xf0; - } - - if (Wintbob) { - WintbobRenderSpriteLayer(); - } else { - SnowbrosRenderSpriteLayer(); - } - BurnTransferCopy(HyperpacPalette); -} - -static void Snowbro3Render() -{ - Snowbro3CalcPalette(); - - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0xf0; - - } - - Snowbro3RenderSpriteLayer(); - BurnTransferCopy(HyperpacPalette); -} - -static INT32 HyperpacFrame() -{ - INT32 nInterleave = 4; - - if (HyperpacReset) HyperpacDoReset(); - - HyperpacMakeInputs(); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesTotal[1] = 4000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - if (i == 1) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 2) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 3) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - SekClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - - if (pBurnDraw) HyperpacRender(); - - return 0; -} - -static INT32 PzlbreakFrame() -{ - INT32 nInterleave = 4; - - if (HyperpacReset) HyperpacDoReset(); - - HyperpacMakeInputs(); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesTotal[1] = 4000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - if (i == 1) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 2) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 3) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - SekClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - - if (pBurnDraw) PzlbreakRender(); - - return 0; -} - -static INT32 FinalttrFrame() -{ - INT32 nInterleave = 4; - - if (HyperpacReset) HyperpacDoReset(); - - HyperpacMakeInputs(); - - nCyclesTotal[0] = 12000000 / 60; - nCyclesTotal[1] = 3578545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - if (i == 1) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 2) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 3) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - SekClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - - if (pBurnDraw) HyperpacRender(); - - return 0; -} - -static INT32 TwinadvFrame() -{ - INT32 nInterleave = 4; - - if (HyperpacReset) HyperpacDoReset(); - - HyperpacMakeInputs(); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesTotal[1] = 4000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 2) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - if (i == 1) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 2) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 3) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - SekClose(); - ZetClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) TwinadvRender(); - - return 0; -} - -static INT32 HoneydolFrame() -{ - INT32 nInterleave = 4; - - if (HyperpacReset) HyperpacDoReset(); - - HyperpacMakeInputs(); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesTotal[1] = 4000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - SekTotalCycles(); - SekRun(nCyclesSegment); - - if (i == 1) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 2) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 3) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - nCycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesDone[1] = ZetTotalCycles() - nCyclesTotal[1]; - -// bprintf(PRINT_NORMAL, _T("%i\ %i\n"), nCyclesDone[0], nCyclesDone[1]); - - ZetClose(); - SekClose(); - - if (pBurnDraw) HoneydolRender(); - - return 0; -} - -static INT32 SnowbrosFrame() -{ - INT32 nInterleave = 256; - - if (HyperpacReset) SnowbrosDoReset(); - - HyperpacMakeInputs(); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - nCyclesTotal[0] = (Wintbob) ? 12000000 / 60 : 8000000 / 60; - nCyclesTotal[1] = 6000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - // Run 68000 - SekRun(nCyclesTotal[0] / nInterleave); - - if (i == 32) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 128) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 240) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - // Run Z80 - BurnTimerUpdateYM3812((i + 1) * nCyclesTotal[1] / nInterleave); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - - ZetClose(); - SekClose(); - - if (pBurnDraw) SnowbrosRender(); - - return 0; -} - -static INT32 Snowbro3Frame() -{ - INT32 nInterleave = 4; - - if (HyperpacReset) Snowbro3DoReset(); - - HyperpacMakeInputs(); - - SekOpen(0); - - SekNewFrame(); - - SekIdle(nCyclesDone[0]); - - nCyclesTotal[0] = 16000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - SekTotalCycles(); - SekRun(nCyclesSegment); - - if (i == 1) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 2) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 3) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - INT32 Status = MSM6295ReadStatus(0); - if (Snowbro3MusicPlaying) { - if ((Status & 0x08) == 0x00) { - MSM6295Command(0, 0x80 | Snowbro3Music); - MSM6295Command(0, 0x82); - } - } else { - if ((Status & 0x08) == 0x00) { - MSM6295Command(0, 0x40); - } - } - } - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - - SekClose(); - - if (pBurnSoundOut) MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - - if (pBurnDraw) Snowbro3Render(); - - return 0; -} - -static INT32 HyperpacScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x02944; - } - - if (nAction & ACB_MEMORY_RAM) { // Scan all memory, devices & variables - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); // Scan 68000 - ZetScan(nAction); // Scan Z80 - - MSM6295Scan(0, nAction); // Scan OKIM6295 - BurnYM2151Scan(nAction); - - // Scan critical driver variables - SCAN_VAR(HyperpacSoundLatch); - SCAN_VAR(HyperpacInput); - SCAN_VAR(HyperpacDip); - } - - return 0; -} - -static INT32 SnowbrosScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029519; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); // Scan 68000 - ZetScan(nAction); // Scan Z80 - - SCAN_VAR(nCyclesDone); - - BurnYM3812Scan(nAction, pnMin); - - // Scan critical driver variables - SCAN_VAR(HyperpacSoundLatch); - SCAN_VAR(HyperpacInput); - SCAN_VAR(HyperpacDip); - } - - return 0; -} - -static INT32 Snowbro3Scan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029672; - } - - if (nAction & ACB_MEMORY_RAM) { // Scan all memory, devices & variables - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); // Scan 68000 - - MSM6295Scan(0, nAction); // Scan OKIM6295 - - // Scan critical driver variables - SCAN_VAR(HyperpacSoundLatch); - SCAN_VAR(HyperpacInput); - SCAN_VAR(HyperpacDip); - SCAN_VAR(Snowbro3Music); - SCAN_VAR(Snowbro3MusicPlaying); - } - - return 0; -} - -struct BurnDriver BurnDrvHyperpac = { - "hyperpac", NULL, NULL, NULL, "1995", - "Hyper Pacman\0", NULL, "SemiCom", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, HyperpacRomInfo, HyperpacRomName, NULL, NULL, HyperpacInputInfo, HyperpacDIPInfo, - HyperpacInit, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHyperpacb = { - "hyperpacb", "hyperpac", NULL, NULL, "1995", - "Hyper Pacman (bootleg)\0", NULL, "SemiCom", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, HyperpacbRomInfo, HyperpacbRomName, NULL, NULL, HyperpacInputInfo, HyperpacDIPInfo, - HyperpacInit, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCookbib2 = { - "cookbib2", NULL, NULL, NULL, "1996", - "Cookie & Bibi 2\0", NULL, "SemiCom", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Cookbib2RomInfo, Cookbib2RomName, NULL, NULL, HyperpacInputInfo, Cookbib2DIPInfo, - Cookbib2Init, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCookbib3 = { - "cookbib3", NULL, NULL, NULL, "1997", - "Cookie & Bibi 3\0", NULL, "SemiCom", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, Cookbib3RomInfo, Cookbib3RomName, NULL, NULL, HyperpacInputInfo, Cookbib3DIPInfo, - Cookbib3Init, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMoremore = { - "moremore", NULL, NULL, NULL, "1999", - "More More\0", NULL, "SemiCom / Exit", "Kaneko Pandora based", - L"More More\0\uBAA8\uC544\uBAA8\uC544 More More\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, MoremoreRomInfo, MoremoreRomName, NULL, NULL, HyperpacInputInfo, MoremoreDIPInfo, - MoremoreInit, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMoremorp = { - "moremorp", NULL, NULL, NULL, "1999", - "More More Plus\0", NULL, "SemiCom / Exit", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, MoremorpRomInfo, MoremorpRomName, NULL, NULL, HyperpacInputInfo, MoremoreDIPInfo, - MoremoreInit, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThreein1semi = { - "3in1semi", NULL, NULL, NULL, "1997", - "XESS - The New Revolution (SemiCom 3-in-1)\0", NULL, "SemiCom", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, Threein1semiRomInfo, Threein1semiRomName, NULL, NULL, HyperpacInputInfo, MoremoreDIPInfo, - MoremoreInit, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToppyrap = { - "toppyrap", NULL, NULL, NULL, "1996", - "Toppy & Rappy\0", NULL, "SemiCom", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, ToppyrapRomInfo, ToppyrapRomName, NULL, NULL, HyperpacInputInfo, ToppyrapDIPInfo, - MoremoreInit, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTwinkle = { - "twinkle", NULL, NULL, NULL, "1997", - "Twinkle\0", NULL, "SemiCom", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, TwinkleRomInfo, TwinkleRomName, NULL, NULL, HyperpacInputInfo, MoremoreDIPInfo, - TwinkleInit, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPzlbreak = { - "pzlbreak", NULL, NULL, NULL, "1997", - "Puzzle Break\0", NULL, "SemiCom", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, PzlbreakRomInfo, PzlbreakRomName, NULL, NULL, HyperpacInputInfo, MoremoreDIPInfo, - PzlbreakInit, HyperpacExit, PzlbreakFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFourin1boot = { - "4in1boot", NULL, NULL, NULL, "2002", - "Puzzle King\0", NULL, "K1 Soft", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, Fourin1bootRomInfo, Fourin1bootRomName, NULL, NULL, HyperpacInputInfo, Fourin1bootDIPInfo, - Fourin1bootInit, HyperpacExit, HyperpacFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFinalttr = { - "finalttr", NULL, NULL, NULL, "1993", - "Final Tetris\0", NULL, "Jeil Computer System", "Kaneko Pandora based", - L"Final Tetris\0\uD30C\uC774\uB110 \uD14C\uD2B8\uB9AC\uC2A4\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, FinalttrRomInfo, FinalttrRomName, NULL, NULL, HyperpacInputInfo, FinalttrDIPInfo, - FinalttrInit, HyperpacExit, FinalttrFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTwinadv = { - "twinadv", NULL, NULL, NULL, "1995", - "Twin Adventure (World)\0", NULL, "Barko Corp", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, TwinadvRomInfo, TwinadvRomName, NULL, NULL, HyperpacInputInfo, TwinadvDIPInfo, - TwinadvInit, HyperpacExit, TwinadvFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTwinadvk = { - "twinadvk", "twinadv", NULL, NULL, "1995", - "Twin Adventure (Korea)\0", NULL, "Barko Corp", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, TwinadvkRomInfo, TwinadvkRomName, NULL, NULL, HyperpacInputInfo, TwinadvDIPInfo, - TwinadvInit, HyperpacExit, TwinadvFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMulti96 = { - "multi96", "twinadv", NULL, NULL, "1996", - "Multi Game '96 (Italy)\0", NULL, "Barko Corp", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, Multi96RomInfo, Multi96RomName, NULL, NULL, HyperpacInputInfo, TwinadvDIPInfo, - TwinadvInit, HyperpacExit, TwinadvFrame, NULL, HyperpacScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHoneydol = { - "honeydol", NULL, NULL, NULL, "1995", - "Honey Dolls\0", NULL, "Barko Corp", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, HoneydolRomInfo, HoneydolRomName, NULL, NULL, HyperpacInputInfo, HoneydolDIPInfo, - HoneydolInit, HyperpacExit, HoneydolFrame, NULL, HyperpacScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSnowbros = { - "snowbros", NULL, NULL, NULL, "1990", - "Snow Bros. - Nick & Tom (set 1)\0", NULL, "Toaplan", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, SnowbrosRomInfo, SnowbrosRomName, NULL, NULL, SnowbrosInputInfo, SnowbrosDIPInfo, - SnowbrosInit, SnowbrosExit, SnowbrosFrame, NULL, SnowbrosScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSnowbroa = { - "snowbrosa", "snowbros", NULL, NULL, "1990", - "Snow Bros. - Nick & Tom (set 2)\0", NULL, "Toaplan", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, SnowbroaRomInfo, SnowbroaRomName, NULL, NULL, SnowbrosInputInfo, SnowbrosDIPInfo, - SnowbrosInit, SnowbrosExit, SnowbrosFrame, NULL, SnowbrosScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSnowbrob = { - "snowbrosb", "snowbros", NULL, NULL, "1990", - "Snow Bros. - Nick & Tom (set 3)\0", NULL, "Toaplan", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, SnowbrobRomInfo, SnowbrobRomName, NULL, NULL, SnowbrosInputInfo, SnowbrosDIPInfo, - SnowbrosInit, SnowbrosExit, SnowbrosFrame, NULL, SnowbrosScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSnowbroc = { - "snowbrosc", "snowbros", NULL, NULL, "1990", - "Snow Bros. - Nick & Tom (set 4)\0", NULL, "Toaplan", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, SnowbrocRomInfo, SnowbrocRomName, NULL, NULL, SnowbrosInputInfo, SnowbrosDIPInfo, - SnowbrosInit, SnowbrosExit, SnowbrosFrame, NULL, SnowbrosScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSnowbroj = { - "snowbrosj", "snowbros", NULL, NULL, "1990", - "Snow Bros. - Nick & Tom (Japan)\0", NULL, "Toaplan", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, SnowbrojRomInfo, SnowbrojRomName, NULL, NULL, SnowbrosInputInfo, SnowbrojDIPInfo, - SnowbrosInit, SnowbrosExit, SnowbrosFrame, NULL, SnowbrosScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSnowbrod = { - "snowbrosd", "snowbros", NULL, NULL, "1990", - "Snow Bros. - Nick & Tom (Dooyong license)\0", NULL, "Toaplan (Dooyong license)", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, SnowbrodRomInfo, SnowbrodRomName, NULL, NULL, SnowbrosInputInfo, SnowbrojDIPInfo, - SnowbrosInit, SnowbrosExit, SnowbrosFrame, NULL, SnowbrosScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWintbob = { - "wintbob", "snowbros", NULL, NULL, "1990", - "The Winter Bobble (bootleg)\0", NULL, "bootleg", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, WintbobRomInfo, WintbobRomName, NULL, NULL, SnowbrosInputInfo, SnowbrosDIPInfo, - WintbobInit, SnowbrosExit, SnowbrosFrame, NULL, SnowbrosScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSnowbroswb = { - "snowbroswb", "snowbros", NULL, NULL, "1990", - "Snow Bros. - Nick & Tom (The Winter Bobble hardware bootleg)\0", NULL, "bootleg", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, SnowbroswbRomInfo, SnowbroswbRomName, NULL, NULL, SnowbrosInputInfo, SnowbrosDIPInfo, - WintbobInit, SnowbrosExit, SnowbrosFrame, NULL, SnowbrosScan, - NULL, 0x200, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSnowbro3 = { - "snowbro3", NULL, NULL, NULL, "2002", - "Snow Brothers 3 - Magical Adventure\0", NULL, "bootleg", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, Snowbro3RomInfo, Snowbro3RomName, NULL, NULL, SnowbrosInputInfo, SnowbrojDIPInfo, - Snowbro3Init, SnowbrosExit, Snowbro3Frame, NULL, Snowbro3Scan, - NULL, 0x400, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBallboy = { - "ballboy", "snowbro3", NULL, NULL, "2003", - "Ball Boy\0", NULL, "bootleg", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, BallboyRomInfo, BallboyRomName, NULL, NULL, SnowbrosInputInfo, SnowbrojDIPInfo, - Snowbro3Init, SnowbrosExit, Snowbro3Frame, NULL, Snowbro3Scan, - NULL, 0x400, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToto = { - "toto", NULL, NULL, NULL, "1996", - "Come Back Toto\0", NULL, "SoftClub", "Kaneko Pandora based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, TotoRomInfo, TotoRomName, NULL, NULL, SnowbrosInputInfo, SnowbrosDIPInfo, - TotoInit, SnowbrosExit, SnowbrosFrame, NULL, SnowbrosScan, - NULL, 0x200, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_jchan.cpp b/jan/src/burn/drv/pst90s/d_jchan.cpp deleted file mode 100644 index de64da651..000000000 --- a/jan/src/burn/drv/pst90s/d_jchan.cpp +++ /dev/null @@ -1,809 +0,0 @@ -// FB Alpha Jackie Chan driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "sknsspr.h" -#include "kaneko_tmap.h" -#include "ymz280b.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM0; -static UINT8 *Drv68KROM1; -static UINT8 *DrvMCUROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvTransTab; -static UINT8 *DrvNVRAM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvMCURAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprReg0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvSprReg1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvVidRegs; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 *mcu_com; - -static UINT16 enable_sub_irq; -static INT32 watchdog; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvDips[2]; -static UINT16 DrvInputs[4]; -static UINT8 DrvReset; - -static struct BurnInputInfo JchanInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 10, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 8, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 8, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 9, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 10, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 11, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy4 + 8, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 11, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 9, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy4 + 10, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 14, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 13, "tilt" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Jchan) - -static struct BurnDIPInfo JchanDIPList[]= -{ - {0x17, 0xff, 0xff, 0xdb, NULL }, - {0x18, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - -// Not yet. - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x02, 0x02, "Off" }, - {0x17, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x04, 0x04, "Off" }, - {0x17, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound" }, - {0x17, 0x01, 0x08, 0x00, "Mono" }, - {0x17, 0x01, 0x08, 0x08, "Stereo" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x17, 0x01, 0x10, 0x10, "Off" }, - {0x17, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Blood Mode" }, - {0x17, 0x01, 0x20, 0x20, "Normal" }, - {0x17, 0x01, 0x20, 0x00, "High" }, - - {0 , 0xfe, 0 , 2, "Special Prize Available" }, - {0x17, 0x01, 0x40, 0x40, "No" }, - {0x17, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Buttons Layout" }, - {0x17, 0x01, 0x80, 0x80, "3+1" }, - {0x17, 0x01, 0x80, 0x00, "2+2" }, -}; - -STDDIPINFO(Jchan) - -static struct BurnDIPInfo Jchan2DIPList[]= -{ - {0 , 0xfe, 0 , 2, "Unused" }, - {0x17, 0x01, 0x04, 0x04, "Off" }, - {0x17, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFOEXT(Jchan2, Jchan, Jchan2) - -static void toxboy_handle_04_subcommand(UINT8 mcu_subcmd, UINT16 *mcu_ram) -{ - INT32 offs = (mcu_subcmd & 0x3f) * 8; - - UINT8 *mcu_rom = DrvMCUROM + 0x10000; - - UINT16 romstart = mcu_rom[offs+2] | (mcu_rom[offs+3]<<8); - UINT16 romlength = mcu_rom[offs+4] | (mcu_rom[offs+5]<<8); - UINT16 ramdest = BURN_ENDIAN_SWAP_INT16(mcu_ram[0x0012/2]); - - for (INT32 x = 0; x < romlength; x++) { - DrvMCURAM[(ramdest+x)] = mcu_rom[(romstart+x)]; - } -} - -static void jchan_mcu_run() -{ - UINT16 *mcu_ram = (UINT16*)DrvMCURAM; - UINT16 mcu_command = BURN_ENDIAN_SWAP_INT16(mcu_ram[0x0010/2]); // command nb - UINT16 mcu_offset = BURN_ENDIAN_SWAP_INT16(mcu_ram[0x0012/2]) / 2; // offset in shared RAM where MCU will write - UINT16 mcu_subcmd = BURN_ENDIAN_SWAP_INT16(mcu_ram[0x0014/2]); // sub-command parameter, happens only for command #4 - - switch (mcu_command >> 8) - { - case 0x04: - toxboy_handle_04_subcommand(mcu_subcmd, mcu_ram); - break; - - case 0x03: - mcu_ram[mcu_offset] = BURN_ENDIAN_SWAP_INT16((DrvDips[1] << 8) | (DrvDips[0] << 0)); - break; - - case 0x02: - memcpy (DrvMCURAM + mcu_offset, DrvNVRAM, 0x80); - break; - - case 0x42: - memcpy (DrvNVRAM, DrvMCURAM + mcu_offset, 0x80); - break; - } -} - -void __fastcall jchan_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x330000: - case 0x340000: - case 0x350000: - case 0x360000: - mcu_com[(address - 0x330000) >> 16] = BURN_ENDIAN_SWAP_INT16(data); - if (mcu_com[0] == 0xffff && mcu_com[1] == 0xffff && mcu_com[2] == 0xffff && mcu_com[3] == 0xffff) { - memset (mcu_com, 0, 4 * sizeof(UINT16)); - jchan_mcu_run(); - } - return; - - case 0xf00000: - enable_sub_irq = data & 0x8000; - return; - - case 0xf80000: - watchdog = 0; - return; - } -} - -void __fastcall jchan_main_write_byte(UINT32 /*address*/, UINT8 /*data*/) -{ - -} - -UINT16 __fastcall jchan_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x370000: - return 0; // mcu status - } - - return 0; -} - -UINT8 __fastcall jchan_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xf00000: - return DrvInputs[0] >> 8; - - case 0xf00002: - return DrvInputs[1] >> 8; - - case 0xf00004: - return DrvInputs[2] >> 8; - - case 0xf00006: - return DrvInputs[3] >> 8; - } - - return 0; -} - -void __fastcall jchan_sub_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x800000: - YMZ280BWrite(0, data & 0xff); - return; - - case 0x800002: - YMZ280BWrite(1, data & 0xff); - return; - - case 0xa00000: - watchdog = 0; - return; - } -} - -void __fastcall jchan_sub_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x800001: - YMZ280BWrite(0, data); - return; - - case 0x800003: - YMZ280BWrite(1, data); - return; - } -} - -UINT16 __fastcall jchan_sub_read_word(UINT32 /*address*/) -{ - return 0; -} - -UINT8 __fastcall jchan_sub_read_byte(UINT32 /*address*/) -{ - return 0; -} - -void __fastcall jchan_main_command_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvShareRAM + (address & 0x3ffe))) = BURN_ENDIAN_SWAP_INT16(data); - - if (address == 0x403ffe) { - SekClose(); - SekOpen(1); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - SekOpen(0); - } -} - -void __fastcall jchan_main_command_write_byte(UINT32 address, UINT8 data) -{ - DrvShareRAM[(address & 0x3fff) ^ 1] = data; -} - -void __fastcall jchan_sub_command_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvShareRAM + (address & 0x3ffe))) = BURN_ENDIAN_SWAP_INT16(data); - - if (address == 0x400000) { // not used? - SekClose(); - SekOpen(0); - SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - SekClose(); - SekOpen(1); - } -} - -void __fastcall jchan_sub_command_write_byte(UINT32 address, UINT8 data) -{ - DrvShareRAM[(address & 0x3fff) ^ 1] = data; -} - -static inline void palette_update(UINT16 offset) -{ - INT32 p = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + offset))); - - INT32 r = (p >> 5) & 0x1f; - INT32 g = (p >> 10) & 0x1f; - INT32 b = (p >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -void __fastcall jchan_palette_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + (address & 0xfffe))) = BURN_ENDIAN_SWAP_INT16(data); - - palette_update(address); -} - -void __fastcall jchan_palette_write_byte(UINT32 address, UINT8 data) -{ - DrvPalRAM[(address & 0xffff)^1] = data; - - palette_update(address & ~1); -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - SekOpen(0); - SekReset(); - SekClose(); - - SekOpen(1); - SekReset(); - SekClose(); - - YMZ280BReset(); - - enable_sub_irq = 0; - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM0 = Next; Next += 0x200000; - Drv68KROM1 = Next; Next += 0x200000; - - DrvMCUROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x2000000; - DrvGfxROM2 = Next; Next += 0x1000000; - - DrvTransTab = Next; Next += 0x200000 / 0x100; - - YMZ280BROM = Next; Next += 0x1000000; - - DrvNVRAM = Next; Next += 0x000080; - - DrvPalette = (UINT32*)Next; Next += 0x8001 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x010000; - Drv68KRAM1 = Next; Next += 0x010000; - DrvMCURAM = Next; Next += 0x010000; - DrvShareRAM = Next; Next += 0x004000; - DrvSprRAM0 = Next; Next += 0x004000; - DrvSprReg0 = Next; Next += 0x000400; - DrvSprRAM1 = Next; Next += 0x004000; - DrvSprReg1 = Next; Next += 0x000400; - DrvPalRAM = Next; Next += 0x010000; - - DrvVidRAM = Next; Next += 0x004000; - DrvVidRegs = Next; Next += 0x000400; - - mcu_com = (UINT16*)Next; Next += 0x00004 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvDecodeMcuData() -{ - static const UINT8 toybox_mcu_decryption_table[0x100] = { - 0x7b,0x82,0xf0,0xbc,0x7f,0x1d,0xa2,0xc5,0x2a,0xfa,0x55,0xee,0x1a,0xd0,0x59,0x76, - 0x5e,0x75,0x79,0x16,0xa5,0xf6,0x84,0xed,0x0f,0x2e,0xf2,0x36,0x61,0xac,0xcd,0xab, - 0x01,0x3b,0x01,0x87,0x73,0xab,0xce,0x5d,0xd4,0x1d,0x68,0x2a,0x35,0xea,0x13,0x27, - 0x00,0xaa,0x46,0x36,0x6e,0x65,0x80,0x7e,0x19,0xe2,0x96,0xab,0xac,0xa5,0x6c,0x63, - 0x4a,0x6f,0x87,0xf6,0x6a,0xac,0x38,0xe2,0x1f,0x87,0xf9,0xaa,0xf5,0x41,0x60,0xa6, - 0x42,0xb9,0x30,0xf2,0xc3,0x1c,0x4e,0x4b,0x08,0x10,0x42,0x32,0xbf,0xb2,0xc5,0x0f, - 0x7a,0xab,0x97,0xf6,0xe7,0xb3,0x46,0xf8,0xec,0x2b,0x7d,0x5f,0xb1,0x10,0x03,0xe4, - 0x0f,0x22,0xdf,0x8d,0x10,0x66,0xa7,0x7e,0x96,0xbd,0x5a,0xaf,0xaa,0x43,0xdf,0x10, - 0x7c,0x04,0xe2,0x9d,0x66,0xd7,0xf0,0x02,0x58,0x8a,0x55,0x17,0x16,0xe2,0xe2,0x52, - 0xaf,0xd9,0xf9,0x0d,0x59,0x70,0x86,0x3c,0x05,0xd1,0x52,0xa7,0xf0,0xbf,0x17,0xd0, - 0x23,0x15,0xfe,0x23,0xf2,0x80,0x60,0x6f,0x95,0x89,0x67,0x65,0xc9,0x0e,0xfc,0x16, - 0xd6,0x8a,0x9f,0x25,0x2c,0x0f,0x2d,0xe4,0x51,0xb2,0xa8,0x18,0x3a,0x5d,0x66,0xa0, - 0x9f,0xb0,0x58,0xea,0x78,0x72,0x08,0x6a,0x90,0xb6,0xa4,0xf5,0x08,0x19,0x60,0x4e, - 0x92,0xbd,0xf1,0x05,0x67,0x4f,0x24,0x99,0x69,0x1d,0x0c,0x6d,0xe7,0x74,0x88,0x22, - 0x2d,0x15,0x7a,0xa2,0x37,0xa9,0xa0,0xb0,0x2c,0xfb,0x27,0xe5,0x4f,0xb6,0xcd,0x75, - 0xdc,0x39,0xce,0x6f,0x1f,0xfe,0xcc,0xb5,0xe6,0xda,0xd8,0xee,0x85,0xee,0x2f,0x04, - }; - - for (INT32 i = 0; i < 0x20000; i++) { - DrvMCUROM[i] = DrvMCUROM[i] + toybox_mcu_decryption_table[(i^1) & 0xff]; - } -} - -static void DrvFillTransTable() -{ - memset (DrvTransTab, 0, 0x2000); - - for (INT32 i = 0; i < 0x200000; i+= 0x100) { - DrvTransTab[i/0x100] = 1; // transparent - - for (INT32 j = 0; j < 0x100; j++) { - if (DrvGfxROM0[j + i]) { - DrvTransTab[i/0x100] = 0; - break; - } - } - } -} - -static INT32 DrvGfxDecode() -{ - static INT32 Planes[4] = { STEP4(0, 1) }; - static INT32 XOffs[16] = { 4, 0, 12, 8, 20, 16, 28, 24, 8*32+4, 8*32+0, 8*32+12, 8*32+8, 8*32+20, 8*32+16, 8*32+28, 8*32+24 }; - static INT32 YOffs[16] = { STEP8(0, 32), STEP8(16*32, 32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x100000); - - GfxDecode(0x02000, 4, 16, 16, Planes, XOffs, YOffs, 0x400, tmp, DrvGfxROM0); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM0 + 0x0000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0000001, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0100000, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x0100001, 3, 2)) return 1; - - if (BurnLoadRom(Drv68KROM1 + 0x0000000, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x0000001, 5, 2)) return 1; - - if (BurnLoadRom(DrvMCUROM + 0x0000000, 6, 1)) return 1; - BurnByteswap (DrvMCUROM, 0x20000); - - if (BurnLoadRom(DrvGfxROM0 + 0x0000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0400000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0800000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1200000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1400000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1600000, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1600001, 16, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0200000, 18, 1)) return 1; - - if (BurnLoadRom(YMZ280BROM + 0x0000000, 19, 1)) return 1; - if (BurnLoadRom(YMZ280BROM + 0x0100000, 19, 1)) return 1; // reload - if (BurnLoadRom(YMZ280BROM + 0x0200000, 20, 1)) return 1; - if (BurnLoadRom(YMZ280BROM + 0x0400000, 21, 1)) return 1; - - DrvGfxDecode(); - DrvDecodeMcuData(); - DrvFillTransTable(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM0, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvMCURAM, 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x500000, 0x503fff, MAP_RAM); - SekMapMemory(DrvSprReg0, 0x600000, 0x60003f|0x3ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700000, 0x70ffff, MAP_RAM); - SekSetWriteWordHandler(0, jchan_main_write_word); - SekSetWriteByteHandler(0, jchan_main_write_byte); - SekSetReadWordHandler(0, jchan_main_read_word); - SekSetReadByteHandler(0, jchan_main_read_byte); - - SekMapHandler(1, 0x403c00, 0x403fff, MAP_WRITE); - SekSetWriteWordHandler(1, jchan_main_command_write_word); - SekSetWriteByteHandler(1, jchan_main_command_write_byte); - - SekMapHandler(2, 0x700000, 0x70ffff, MAP_WRITE); - SekSetWriteWordHandler(2, jchan_palette_write_word); - SekSetWriteByteHandler(2, jchan_palette_write_byte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Drv68KROM1, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x500000, 0x503fff, MAP_RAM); - SekMapMemory(DrvVidRegs, 0x600000, 0x60001f|0x3ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0x700000, 0x703fff, MAP_RAM); - SekMapMemory(DrvSprReg1, 0x780000, 0x78003f|0x3ff, MAP_RAM); - SekSetWriteWordHandler(0, jchan_sub_write_word); - SekSetWriteByteHandler(0, jchan_sub_write_byte); - SekSetReadWordHandler(0, jchan_sub_read_word); - SekSetReadByteHandler(0, jchan_sub_read_byte); - - SekMapHandler(1, 0x400000, 0x4003ff, MAP_WRITE); - SekSetWriteWordHandler(1, jchan_sub_command_write_word); - SekSetWriteByteHandler(1, jchan_sub_command_write_byte); - SekClose(); - - YMZ280BInit(16000000, NULL); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - skns_init(); - kaneko_view2_init(0, DrvVidRAM, DrvVidRegs, DrvGfxROM0, 0, DrvTransTab, 25, 0); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - - YMZ280BExit(); - YMZ280BROM = NULL; - - kaneko_view2_exit(); - skns_exit(); - - BurnFree(AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) - { - for (INT32 i = 0; i < 0x10000; i+=2) { - palette_update(i); - } - - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x8000; // black - } - - for (INT32 i = 0; i < 8; i++) { - kaneko_view2_draw_layer(0, 0, i); - kaneko_view2_draw_layer(0, 1, i); - } - - skns_draw_sprites(pTransDraw, (UINT32*)DrvSprRAM1, 0x4000, DrvGfxROM2, 0x1000000, (UINT32*)DrvSprReg1, 0x4000); - skns_draw_sprites(pTransDraw, (UINT32*)DrvSprRAM0, 0x4000, DrvGfxROM1, 0x2000000, (UINT32*)DrvSprReg0, 0x4000); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - SekNewFrame(); - - { - memset (DrvInputs, 0xff, 4 * sizeof(UINT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nInterleave = 512; - INT32 nCyclesTotal[2] = { 16000000 / 60, 16000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - SekOpen(0); - nCyclesDone[0] += SekRun(nSegment); - if (i == 11) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == 240) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - nSegment = SekTotalCycles(); - SekClose(); - - SekOpen(1); - nCyclesDone[1] += SekRun(nSegment - SekTotalCycles()); - if (enable_sub_irq) { - if (i == 11) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 240) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - if (i == 249) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - SekClose(); - } - - if (pBurnSoundOut) { - YMZ280BRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - YMZ280BScan(); - - SCAN_VAR(enable_sub_irq); - } - - if (nAction & ACB_NVRAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvNVRAM; - ba.nLen = 0x80; - ba.szName = "NV Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_WRITE) { - DrvRecalc = 1; - } - - return 0; -} - - -// Jackie Chan - The Kung-Fu Master - -static struct BurnRomInfo jchanRomDesc[] = { - { "jm01x3.u67", 0x080000, 0xc0adb141, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "jm00x3.u68", 0x080000, 0xb1aadc5a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jm11x3.u69", 0x080000, 0xd2e3f913, 1 | BRF_PRG | BRF_ESS }, // 2 - { "jm10x3.u70", 0x080000, 0xee08fee1, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "jsp1x3.u86", 0x080000, 0xd15d2b8e, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "jsp0x3.u87", 0x080000, 0xebec50b1, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "jcd0x1.u13", 0x020000, 0x2a41da9c, 3 | BRF_PRG | BRF_ESS }, // 6 MCU Data - - { "jc-200.00", 0x100000, 0x1f30c24e, 4 | BRF_GRA }, // 7 Layer Tiles - - { "jc-100-00.179", 0x400000, 0x578d928c, 5 | BRF_GRA }, // 8 Sprite "A" Graphics - { "jc-101-00.180", 0x400000, 0x7f5e1aca, 5 | BRF_GRA }, // 9 - { "jc-102-00.181", 0x400000, 0x72caaa68, 5 | BRF_GRA }, // 10 - { "jc-103-00.182", 0x400000, 0x4e9e9fc9, 5 | BRF_GRA }, // 11 - { "jc-104-00.183", 0x200000, 0x6b2a2e93, 5 | BRF_GRA }, // 12 - { "jc-105-00.184", 0x200000, 0x73cad1f0, 5 | BRF_GRA }, // 13 - { "jc-108-00.185", 0x200000, 0x67dd1131, 5 | BRF_GRA }, // 14 - { "jcs0x3.164", 0x040000, 0x9a012cbc, 5 | BRF_GRA }, // 15 - { "jcs1x3.165", 0x040000, 0x57ae7c8d, 5 | BRF_GRA }, // 16 - - { "jc-106-00.171", 0x200000, 0xbc65661b, 6 | BRF_GRA }, // 17 Sprite "B" Graphics - { "jc-107-00.172", 0x200000, 0x92a86e8b, 6 | BRF_GRA }, // 18 - - { "jc-301-00.85", 0x100000, 0x9c5b3077, 7 | BRF_SND }, // 19 YMZ280b Samples - { "jc-300-00.84", 0x200000, 0x13d5b1eb, 7 | BRF_SND }, // 20 - { "jcw0x0.u56", 0x040000, 0xbcf25c2a, 7 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(jchan) -STD_ROM_FN(jchan) - -struct BurnDriver BurnDrvJchan = { - "jchan", NULL, NULL, NULL, "1995", - "Jackie Chan - The Kung-Fu Master\0", NULL, "Kaneko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO_MISC, GBF_VSFIGHT, 0, - NULL, jchanRomInfo, jchanRomName, NULL, NULL, JchanInputInfo, JchanDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 320, 240, 4, 3 -}; - - -// Jackie Chan in Fists of Fire - -static struct BurnRomInfo jchan2RomDesc[] = { - { "j2p1x1.u67", 0x080000, 0x5448c4bc, 1 | BRF_PRG | BRF_ESS }, // 0 68K #0 Code - { "j2p1x2.u68", 0x080000, 0x52104ab9, 1 | BRF_PRG | BRF_ESS }, // 1 - { "j2p1x3.u69", 0x080000, 0x8763ebca, 1 | BRF_PRG | BRF_ESS }, // 2 - { "j2p1x4.u70", 0x080000, 0x0f8e5e69, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "j2p1x5.u86", 0x080000, 0xdc897725, 2 | BRF_PRG | BRF_ESS }, // 4 68K #1 Code - { "j2p1x6.u87", 0x080000, 0x594224f9, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "j2d1x1.u13", 0x020000, 0xb2b7fc90, 3 | BRF_PRG | BRF_ESS }, // 6 MCU Data - - { "jc-200.00", 0x100000, 0x1f30c24e, 4 | BRF_GRA }, // 7 Layer Tiles - - { "jc-100-00.179", 0x400000, 0x578d928c, 5 | BRF_GRA }, // 8 Sprite "A" Graphics - { "jc-101-00.180", 0x400000, 0x7f5e1aca, 5 | BRF_GRA }, // 9 - { "jc-102-00.181", 0x400000, 0x72caaa68, 5 | BRF_GRA }, // 10 - { "jc-103-00.182", 0x400000, 0x4e9e9fc9, 5 | BRF_GRA }, // 11 - { "jc-104-00.183", 0x200000, 0x6b2a2e93, 5 | BRF_GRA }, // 12 - { "jc-105-00.184", 0x200000, 0x73cad1f0, 5 | BRF_GRA }, // 13 - { "jc-108-00.185", 0x200000, 0x67dd1131, 5 | BRF_GRA }, // 14 - { "j2g1x1.164", 0x080000, 0x66a7ea6a, 5 | BRF_GRA }, // 15 - { "j2g1x2.165", 0x080000, 0x660e770c, 5 | BRF_GRA }, // 16 - - { "jc-106-00.171", 0x200000, 0xbc65661b, 6 | BRF_GRA }, // 17 Sprite "B" Graphics - { "jc-107-00.172", 0x200000, 0x92a86e8b, 6 | BRF_GRA }, // 18 - - { "jc-301-00.85", 0x100000, 0x9c5b3077, 7 | BRF_SND }, // 19 YMZ280b Samples - { "jc-300-00.84", 0x200000, 0x13d5b1eb, 7 | BRF_SND }, // 20 - { "j2m1x1.u56", 0x040000, 0xbaf6e25e, 7 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(jchan2) -STD_ROM_FN(jchan2) - -struct BurnDriver BurnDrvJchan2 = { - "jchan2", NULL, NULL, NULL, "1995", - "Jackie Chan in Fists of Fire\0", NULL, "Kaneko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO_MISC, GBF_VSFIGHT, 0, - NULL, jchan2RomInfo, jchan2RomName, NULL, NULL, JchanInputInfo, Jchan2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_kaneko16.cpp b/jan/src/burn/drv/pst90s/d_kaneko16.cpp deleted file mode 100644 index 3406e449e..000000000 --- a/jan/src/burn/drv/pst90s/d_kaneko16.cpp +++ /dev/null @@ -1,7808 +0,0 @@ -// FB Alpha Kaneko 16-bit driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" -#include "burn_ym2151.h" -#include "eeprom.h" -#include "bitswap.h" -#include "kanekotb.h" - -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -/*============================================================================================== -Driver Variables -===============================================================================================*/ - -static UINT8 Kaneko16InputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 Kaneko16InputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 Kaneko16InputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 Kaneko16InputPort3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 Kaneko16Dip[3] = {0, 0, 0}; -static UINT8 Kaneko16Input[4] = {0x00, 0x00, 0x00, 0x00}; -static UINT8 Kaneko16Reset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Kaneko16Rom = NULL; -static UINT8 *Kaneko16McuRom = NULL; -static UINT8 *Kaneko16Z80Rom = NULL; -static UINT8 *MSM6295ROMData = NULL; -static UINT8 *MSM6295ROMData2 = NULL; -static UINT8 *Kaneko16Ram = NULL; -static UINT8 *Kaneko16Z80Ram = NULL; -static UINT8 *Kaneko16MCURam = NULL; -static UINT8 *Kaneko16NVRam = NULL; -static UINT8 *Kaneko16PaletteRam = NULL; -static UINT8 *Kaneko16SpriteRam = NULL; -static UINT8 *Kaneko16Video0Ram = NULL; -static UINT8 *Kaneko16Video1Ram = NULL; -static UINT8 *Kaneko16Video2Ram = NULL; -static UINT8 *Kaneko16Video3Ram = NULL; -static UINT8 *Kaneko16VScrl0Ram = NULL; -static UINT8 *Kaneko16VScrl1Ram = NULL; -static UINT8 *Kaneko16VScrl2Ram = NULL; -static UINT8 *Kaneko16VScrl3Ram = NULL; -static UINT32 *Kaneko16Palette = NULL; -static UINT8 *Kaneko16Tiles = NULL; -static UINT8 *Kaneko16Tiles2 = NULL; -static UINT8 *Kaneko16Sprites = NULL; -static UINT8 *Kaneko16TempGfx = NULL; -static UINT8 *DrvPrioBitmap = NULL; // Wing Force & BlaZeon - -static INT16* pFMBuffer; -static INT16* pAY8910Buffer[6]; - -static INT32 Kaneko16Brightness; -static UINT32 Kaneko16SoundLatch; -static INT32 MSM6295Bank0; -static INT32 MSM6295Bank1; - -static UINT16 ToyboxMCUCom[4]; - -static UINT16 Kaneko16Bg15Reg; -static UINT16 Kaneko16Bg15Select; -static UINT16 *Kaneko16Bg15Data = NULL; -static UINT8 Kaneko16RecalcBg15Palette; - -static UINT16 Kaneko16SpriteFlipX; -static UINT16 Kaneko16SpriteFlipY; -static INT32 Kaneko16SpriteFlipType; -static UINT16 Kaneko16SpriteRegs[0x20]; -static UINT16 Kaneko16Layer0Regs[0x10]; -static UINT16 Kaneko16Layer1Regs[0x10]; -static UINT32 Kaneko16SpritesColourOffset; -static UINT32 Kaneko16LayersColourOffset; -static UINT32 Kaneko16SpritesColourMask; -static UINT16 Kaneko16DisplayEnable; -static INT32 Kaneko16TilesXOffset; -static INT32 Kaneko16TilesYOffset; -static INT32 Kaneko16SpriteXOffset; - -static UINT32 *LayerQueueXY[4]; -static UINT32 *LayerQueueColour[4]; -static UINT8 *LayerQueuePriority[4]; -static INT32 LayerQueueSize[4]; - -static INT32 Kaneko16NumTiles; -static INT32 Kaneko16NumTiles2; -static INT32 Kaneko16NumSprites; -static INT32 Kaneko16SpriteRamSize; - -// Flags -static INT32 Kaneko168BppSprites; -static INT32 Kaneko16Eeprom = 0; -static INT32 Kaneko16Bg15; -static INT32 Gtmr = 0; -static INT32 Bloodwar = 0; -static INT32 Bonkadv = 0; -static INT32 Mgcrystl = 0; -static INT32 Shogwarr = 0; - -typedef void (*MCURun)(); -MCURun ToyboxMCURun; - -typedef void (*FrameRender)(); -FrameRender Kaneko16FrameRender; -static void BerlwallFrameRender(); -static void BlazeonFrameRender(); -static void BloodwarFrameRender(); -static void ExplbrkrFrameRender(); -static void GtmrFrameRender(); -static void MgcrystlFrameRender(); -static void ShogwarrFrameRender(); - -typedef INT32 (*ParseSprite)(INT32, struct tempsprite*); -ParseSprite Kaneko16ParseSprite; -static INT32 Kaneko16ParseSpriteType0(INT32 i, struct tempsprite *s); -static INT32 Kaneko16ParseSpriteType1(INT32 i, struct tempsprite *s); -static INT32 Kaneko16ParseSpriteType2(INT32 i, struct tempsprite *s); - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; -static INT32 nSoundBufferPos; - -static INT32 Kaneko16Watchdog; - -static void ShogwarrConfigSoundBank(INT32 oki, INT32 nBank, INT32 nStart, INT32 nSize); - -struct tempsprite -{ - INT32 code,color; - INT32 x,y; - INT32 xoffs,yoffs; - INT32 flipx,flipy; - INT32 priority; -}; - -static struct -{ - struct tempsprite *first_sprite; -} spritelist; - -/*============================================================================================== -Input Definitions -===============================================================================================*/ - -static struct BurnInputInfo BerlwallInputList[] = { - {"Coin 1" , BIT_DIGITAL , Kaneko16InputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , Kaneko16InputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , Kaneko16InputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , Kaneko16InputPort2 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , Kaneko16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Kaneko16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Kaneko16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Kaneko16InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , Kaneko16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , Kaneko16InputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , Kaneko16InputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , Kaneko16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Kaneko16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Kaneko16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Kaneko16InputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , Kaneko16InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , Kaneko16InputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , Kaneko16InputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &Kaneko16Reset , "reset" }, - {"Service" , BIT_DIGITAL , Kaneko16InputPort2 + 6, "service" }, - {"Test" , BIT_DIGITAL , Kaneko16InputPort2 + 4, "diag" }, - {"Tilt" , BIT_DIGITAL , Kaneko16InputPort2 + 5, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, Kaneko16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, Kaneko16Dip + 1 , "dip" }, - {"Fake DIP" , BIT_DIPSWITCH, Kaneko16Dip + 2 , "dip" }, -}; - -STDINPUTINFO(Berlwall) - -static struct BurnInputInfo BlazeonInputList[] = { - {"Coin 1" , BIT_DIGITAL , Kaneko16InputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , Kaneko16InputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , Kaneko16InputPort1 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , Kaneko16InputPort1 + 6, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , Kaneko16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Kaneko16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Kaneko16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Kaneko16InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , Kaneko16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , Kaneko16InputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , Kaneko16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Kaneko16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Kaneko16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Kaneko16InputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , Kaneko16InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , Kaneko16InputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &Kaneko16Reset , "reset" }, - {"Service" , BIT_DIGITAL , Kaneko16InputPort2 + 7, "service" }, - {"Test" , BIT_DIGITAL , Kaneko16InputPort2 + 5, "diag" }, - {"Tilt" , BIT_DIGITAL , Kaneko16InputPort2 + 6, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, Kaneko16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, Kaneko16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Blazeon) - -static struct BurnInputInfo BloodwarInputList[] = { - {"Coin 1" , BIT_DIGITAL , Kaneko16InputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , Kaneko16InputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , Kaneko16InputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , Kaneko16InputPort2 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , Kaneko16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Kaneko16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Kaneko16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Kaneko16InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , Kaneko16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , Kaneko16InputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , Kaneko16InputPort0 + 6, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , Kaneko16InputPort0 + 7, "p1 fire 4" }, - - {"P2 Up" , BIT_DIGITAL , Kaneko16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Kaneko16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Kaneko16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Kaneko16InputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , Kaneko16InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , Kaneko16InputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , Kaneko16InputPort1 + 6, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , Kaneko16InputPort3 + 2, "p2 fire 4" }, - - {"Reset" , BIT_DIGITAL , &Kaneko16Reset , "reset" }, - {"Service" , BIT_DIGITAL , Kaneko16InputPort2 + 6, "service" }, - {"Test" , BIT_DIGITAL , Kaneko16InputPort2 + 4, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, Kaneko16Dip + 0 , "dip" }, -}; - -STDINPUTINFO(Bloodwar) - -static struct BurnInputInfo BonkadvInputList[] = { - {"Coin 1" , BIT_DIGITAL , Kaneko16InputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , Kaneko16InputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , Kaneko16InputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , Kaneko16InputPort2 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , Kaneko16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Kaneko16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Kaneko16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Kaneko16InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , Kaneko16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , Kaneko16InputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , Kaneko16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Kaneko16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Kaneko16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Kaneko16InputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , Kaneko16InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , Kaneko16InputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &Kaneko16Reset , "reset" }, - {"Service" , BIT_DIGITAL , Kaneko16InputPort2 + 6, "service" }, - {"Test" , BIT_DIGITAL , Kaneko16InputPort2 + 4, "diag" }, - {"Tilt" , BIT_DIGITAL , Kaneko16InputPort2 + 5, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, Kaneko16Dip + 0 , "dip" }, -}; - -STDINPUTINFO(Bonkadv) - -static struct BurnInputInfo ExplbrkrInputList[] = { - {"Coin 1" , BIT_DIGITAL , Kaneko16InputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , Kaneko16InputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , Kaneko16InputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , Kaneko16InputPort2 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , Kaneko16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Kaneko16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Kaneko16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Kaneko16InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , Kaneko16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , Kaneko16InputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , Kaneko16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Kaneko16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Kaneko16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Kaneko16InputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , Kaneko16InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , Kaneko16InputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &Kaneko16Reset , "reset" }, - {"Service" , BIT_DIGITAL , Kaneko16InputPort2 + 6, "service" }, - {"Dip 1" , BIT_DIPSWITCH, Kaneko16Dip + 0 , "dip" }, -}; - -STDINPUTINFO(Explbrkr) - -static struct BurnInputInfo GtmrInputList[] = { - {"Coin 1" , BIT_DIGITAL , Kaneko16InputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , Kaneko16InputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , Kaneko16InputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , Kaneko16InputPort2 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , Kaneko16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Kaneko16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Kaneko16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Kaneko16InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , Kaneko16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , Kaneko16InputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , Kaneko16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Kaneko16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Kaneko16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Kaneko16InputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , Kaneko16InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , Kaneko16InputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &Kaneko16Reset , "reset" }, - {"Service" , BIT_DIGITAL , Kaneko16InputPort2 + 6, "service" }, - {"Test" , BIT_DIGITAL , Kaneko16InputPort2 + 4, "diag" }, - {"Tilt" , BIT_DIGITAL , Kaneko16InputPort2 + 5, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, Kaneko16Dip + 0 , "dip" }, -}; - -STDINPUTINFO(Gtmr) - -static struct BurnInputInfo MgcrystlInputList[] = { - {"Coin 1" , BIT_DIGITAL , Kaneko16InputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , Kaneko16InputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , Kaneko16InputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , Kaneko16InputPort2 + 1, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , Kaneko16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Kaneko16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Kaneko16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Kaneko16InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , Kaneko16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , Kaneko16InputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , Kaneko16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Kaneko16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Kaneko16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Kaneko16InputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , Kaneko16InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , Kaneko16InputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &Kaneko16Reset , "reset" }, - {"Service" , BIT_DIGITAL , Kaneko16InputPort2 + 6, "service" }, - {"Test" , BIT_DIGITAL , Kaneko16InputPort2 + 4, "diag" }, - {"Tilt" , BIT_DIGITAL , Kaneko16InputPort2 + 5, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, Kaneko16Dip + 0 , "dip" }, -}; - -STDINPUTINFO(Mgcrystl) - -static struct BurnInputInfo ShogwarrInputList[] = { - {"P1 Coin" , BIT_DIGITAL , Kaneko16InputPort0 + 7, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , Kaneko16InputPort0 + 6, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , Kaneko16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Kaneko16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Kaneko16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Kaneko16InputPort0 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , Kaneko16InputPort0 + 4, "p1 fire 1" }, - {"P1 Button 2" , BIT_DIGITAL , Kaneko16InputPort0 + 5, "p1 fire 2" }, - {"P1 Button 3" , BIT_DIGITAL , Kaneko16InputPort2 + 3, "p1 fire 3" }, - {"P1 Button 4" , BIT_DIGITAL , Kaneko16InputPort2 + 2, "p1 fire 4" }, - - {"P2 Coin" , BIT_DIGITAL , Kaneko16InputPort1 + 7, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , Kaneko16InputPort1 + 6, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , Kaneko16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Kaneko16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Kaneko16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Kaneko16InputPort1 + 3, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , Kaneko16InputPort1 + 4, "p2 fire 1" }, - {"P2 Button 2" , BIT_DIGITAL , Kaneko16InputPort1 + 5, "p2 fire 2" }, - {"P2 Button 3" , BIT_DIGITAL , Kaneko16InputPort2 + 4, "p2 fire 3" }, - {"P2 Button 4" , BIT_DIGITAL , Kaneko16InputPort2 + 5, "p2 fire 4" }, - - {"Reset" , BIT_DIGITAL , &Kaneko16Reset , "reset" }, - {"Service" , BIT_DIGITAL , Kaneko16InputPort2 + 6, "service" }, - {"Dip A" , BIT_DIPSWITCH, Kaneko16Dip + 0 , "dip" }, -}; - -STDINPUTINFO(Shogwarr) - -static struct BurnInputInfo BrapboysInputList[] = { - {"P1 Coin" , BIT_DIGITAL , Kaneko16InputPort0 + 7, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , Kaneko16InputPort0 + 6, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , Kaneko16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , Kaneko16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , Kaneko16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , Kaneko16InputPort0 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , Kaneko16InputPort0 + 4, "p1 fire 1" }, - {"P1 Button 2" , BIT_DIGITAL , Kaneko16InputPort0 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , Kaneko16InputPort1 + 7, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , Kaneko16InputPort1 + 6, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , Kaneko16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , Kaneko16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , Kaneko16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , Kaneko16InputPort1 + 3, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , Kaneko16InputPort1 + 4, "p2 fire 1" }, - {"P2 Button 2" , BIT_DIGITAL , Kaneko16InputPort1 + 5, "p2 fire 2" }, - - {"P3 Coin" , BIT_DIGITAL , Kaneko16InputPort2 + 7, "p3 coin" }, - {"P3 Start" , BIT_DIGITAL , Kaneko16InputPort2 + 6, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , Kaneko16InputPort2 + 0, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , Kaneko16InputPort2 + 1, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , Kaneko16InputPort2 + 2, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , Kaneko16InputPort2 + 3, "p3 right" }, - {"P3 Button 1" , BIT_DIGITAL , Kaneko16InputPort2 + 4, "p3 fire 1" }, - {"P3 Button 2" , BIT_DIGITAL , Kaneko16InputPort2 + 5, "p3 fire 2" }, - - {"Reset" , BIT_DIGITAL , &Kaneko16Reset , "reset" }, - {"Dip A" , BIT_DIPSWITCH, Kaneko16Dip + 0 , "dip" }, -}; - -STDINPUTINFO(Brapboys) - -inline void Kaneko16ClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -inline void Kaneko16MakeInputs() -{ - // Reset Inputs - Kaneko16Input[0] = Kaneko16Input[1] = Kaneko16Input[2] = Kaneko16Input[3] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - Kaneko16Input[0] |= (Kaneko16InputPort0[i] & 1) << i; - Kaneko16Input[1] |= (Kaneko16InputPort1[i] & 1) << i; - Kaneko16Input[2] |= (Kaneko16InputPort2[i] & 1) << i; - Kaneko16Input[3] |= (Kaneko16InputPort3[i] & 1) << i; - } - - // Clear Opposites - Kaneko16ClearOpposites(&Kaneko16Input[0]); - Kaneko16ClearOpposites(&Kaneko16Input[1]); - Kaneko16ClearOpposites(&Kaneko16Input[2]); -} - -/*============================================================================================== -Dip Switch Definitions -===============================================================================================*/ - -static struct BurnDIPInfo BerlwallDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Screen Direction" }, - {0x16, 0x01, 0x01, 0x01, "Normal" }, - {0x16, 0x01, 0x01, 0x00, "Reverse" }, - - {0 , 0xfe, 0 , 8 , "Coin Slot A" }, - {0x16, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" }, - {0x16, 0x01, 0x1c, 0x18, "1 Coins 2 Credits" }, - {0x16, 0x01, 0x1c, 0x14, "1 Coins 3 Credits" }, - {0x16, 0x01, 0x1c, 0x10, "1 Coins 4 Credits" }, - {0x16, 0x01, 0x1c, 0x0c, "2 Coins 1 Credit" }, - {0x16, 0x01, 0x1c, 0x08, "2 Coin 3 Credits" }, - {0x16, 0x01, 0x1c, 0x04, "3 Coins 1 Credit" }, - {0x16, 0x01, 0x1c, 0x00, "4 Coins 1 Credit" }, - - {0 , 0xfe, 0 , 8 , "Coin Slot B" }, - {0x16, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x16, 0x01, 0xe0, 0xc0, "1 Coins 2 Credits" }, - {0x16, 0x01, 0xe0, 0xa0, "1 Coins 3 Credits" }, - {0x16, 0x01, 0xe0, 0x80, "1 Coins 4 Credits" }, - {0x16, 0x01, 0xe0, 0x60, "2 Coins 1 Credit" }, - {0x16, 0x01, 0xe0, 0x40, "2 Coin 3 Credits" }, - {0x16, 0x01, 0xe0, 0x20, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xe0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Game Level" }, - {0x17, 0x01, 0x03, 0x03, "Standard" }, - {0x17, 0x01, 0x03, 0x02, "Easy" }, - {0x17, 0x01, 0x03, 0x01, "Difficult" }, - {0x17, 0x01, 0x03, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 4 , "Number of Players" }, - {0x17, 0x01, 0x0c, 0x0c, "3" }, - {0x17, 0x01, 0x0c, 0x08, "2" }, - {0x17, 0x01, 0x0c, 0x04, "5" }, - {0x17, 0x01, 0x0c, 0x00, "7" }, - - {0 , 0xfe, 0 , 4 , "Language Type" }, - {0x17, 0x01, 0x30, 0x30, "English" }, - {0x17, 0x01, 0x30, 0x20, "Italy" }, - {0x17, 0x01, 0x30, 0x10, "Germany" }, - {0x17, 0x01, 0x30, 0x00, "Pause Mode" }, - - {0 , 0xfe, 0 , 2 , "Demonstration Sound" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Testmode Switch" }, - {0x17, 0x01, 0x80, 0x80, "Normal Game" }, - {0x17, 0x01, 0x80, 0x00, "Testmode" }, - - {0 , 0xfe, 0 , 2, "Disable Background Fading (HACK)" }, - {0x18, 0x01, 0x01, 0x00, "Off" }, - {0x18, 0x01, 0x01, 0x01, "On" }, -}; - -STDDIPINFO(Berlwall) - -static struct BurnDIPInfo BerlwalltDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Screen Direction" }, - {0x16, 0x01, 0x01, 0x01, "Normal" }, - {0x16, 0x01, 0x01, 0x00, "Reverse" }, - - {0 , 0xfe, 0 , 8 , "Coin Slot A" }, - {0x16, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" }, - {0x16, 0x01, 0x1c, 0x18, "1 Coins 2 Credits" }, - {0x16, 0x01, 0x1c, 0x14, "1 Coins 3 Credits" }, - {0x16, 0x01, 0x1c, 0x10, "1 Coins 4 Credits" }, - {0x16, 0x01, 0x1c, 0x0c, "2 Coins 1 Credit" }, - {0x16, 0x01, 0x1c, 0x08, "2 Coin 3 Credits" }, - {0x16, 0x01, 0x1c, 0x04, "3 Coins 1 Credit" }, - {0x16, 0x01, 0x1c, 0x00, "4 Coins 1 Credit" }, - - {0 , 0xfe, 0 , 8 , "Coin Slot B" }, - {0x16, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x16, 0x01, 0xe0, 0xc0, "1 Coins 2 Credits" }, - {0x16, 0x01, 0xe0, 0xa0, "1 Coins 3 Credits" }, - {0x16, 0x01, 0xe0, 0x80, "1 Coins 4 Credits" }, - {0x16, 0x01, 0xe0, 0x60, "2 Coins 1 Credit" }, - {0x16, 0x01, 0xe0, 0x40, "2 Coin 3 Credits" }, - {0x16, 0x01, 0xe0, 0x20, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xe0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Game Level" }, - {0x17, 0x01, 0x03, 0x03, "Standard" }, - {0x17, 0x01, 0x03, 0x02, "Easy" }, - {0x17, 0x01, 0x03, 0x01, "Difficult" }, - {0x17, 0x01, 0x03, 0x00, "Very Difficult" }, - - {0 , 0xfe, 0 , 4 , "Number of Players" }, - {0x17, 0x01, 0x0c, 0x0c, "2" }, - {0x17, 0x01, 0x0c, 0x08, "3" }, - {0x17, 0x01, 0x0c, 0x04, "5" }, - {0x17, 0x01, 0x0c, 0x00, "1" }, - - {0 , 0xfe, 0 , 4 , "Language Type" }, - {0x17, 0x01, 0x30, 0x30, "English" }, - {0x17, 0x01, 0x30, 0x20, "Italy" }, - {0x17, 0x01, 0x30, 0x10, "Germany" }, - {0x17, 0x01, 0x30, 0x00, "Pause Mode" }, - - {0 , 0xfe, 0 , 2 , "Demonstration Sound" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Testmode Switch" }, - {0x17, 0x01, 0x80, 0x80, "Normal Game" }, - {0x17, 0x01, 0x80, 0x00, "Testmode" }, - - {0 , 0xfe, 0 , 2, "Disable Background Fading (HACK)" }, - {0x18, 0x01, 0x01, 0x00, "Off" }, - {0x18, 0x01, 0x01, 0x01, "On" }, -}; - -STDDIPINFO(Berlwallt) - -static struct BurnDIPInfo PackbangDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - {0x18, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x16, 0x01, 0x1c, 0x00, "4 Coins 1 Credits" }, - {0x16, 0x01, 0x1c, 0x04, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x1c, 0x0c, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x1c, 0x08, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x1c, 0x18, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x1c, 0x10, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x16, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xe0, 0x40, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xe0, 0x20, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xe0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x03, 0x02, "Easy" }, - {0x17, 0x01, 0x03, 0x03, "Normal" }, - {0x17, 0x01, 0x03, 0x01, "Hard" }, - {0x17, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Timer Speed" }, - {0x17, 0x01, 0x04, 0x00, "Slow" }, - {0x17, 0x01, 0x04, 0x04, "Standard" }, - - {0 , 0xfe, 0 , 4, "Language" }, - {0x17, 0x01, 0x18, 0x00, "Invalid" }, - {0x17, 0x01, 0x18, 0x08, "Korea" }, - {0x17, 0x01, 0x18, 0x10, "Japan" }, - {0x17, 0x01, 0x18, 0x18, "World" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x17, 0x01, 0x20, 0x20, "Off" }, - {0x17, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x80, 0x80, "Off" }, - {0x17, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Disable Background Fading (HACK)" }, - {0x18, 0x01, 0x01, 0x00, "Off" }, - {0x18, 0x01, 0x01, 0x01, "On" }, -}; - -STDDIPINFO(Packbang) - -static struct BurnDIPInfo BlazeonDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Standard" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Strong" }, - - {0 , 0xfe, 0 , 4 , "Number of Players" }, - {0x14, 0x01, 0x0c, 0x00, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Demonstration Sound" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 16 , "Coin Rate Slot A" }, - {0x15, 0x01, 0x0f, 0x00, "1 Coin 1 Play" }, - {0x15, 0x01, 0x0f, 0x01, "2 Coin 3 Play" }, - {0x15, 0x01, 0x0f, 0x02, "4 Coin 5 Play" }, - {0x15, 0x01, 0x0f, 0x03, "5 Coin 6 Play" }, - {0x15, 0x01, 0x0f, 0x04, "4 Coin 3 Play" }, - {0x15, 0x01, 0x0f, 0x05, "6 Coin 3 Play" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coin 3 Play" }, - {0x15, 0x01, 0x0f, 0x07, "4 Coin 1 Play" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coin 1 Play" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coin 1 Play" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Play" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Play" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Play" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Play" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Play" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Play" }, - - {0 , 0xfe, 0 , 16 , "Coin Rate Slot B" }, - {0x15, 0x01, 0xf0, 0x00, "1 Coin 1 Play" }, - {0x15, 0x01, 0xf0, 0x10, "2 Coin 3 Play" }, - {0x15, 0x01, 0xf0, 0x20, "4 Coin 5 Play" }, - {0x15, 0x01, 0xf0, 0x30, "5 Coin 6 Play" }, - {0x15, 0x01, 0xf0, 0x40, "4 Coin 3 Play" }, - {0x15, 0x01, 0xf0, 0x50, "6 Coin 3 Play" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coin 3 Play" }, - {0x15, 0x01, 0xf0, 0x70, "4 Coin 1 Play" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coin 1 Play" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coin 1 Play" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Play" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Play" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Play" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Play" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Play" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Play" }, -}; - -STDDIPINFO(Blazeon) - -static struct BurnDIPInfo BloodwarDIPList[]= -{ - // Default Values - {0x17, 0xff, 0xff, 0x01, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x17, 0x01, 0x01, 0x00, "Off" }, - {0x17, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x17, 0x01, 0x02, 0x00, "Off" }, - {0x17, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Screen Flip" }, - {0x17, 0x01, 0x04, 0x00, "Normal" }, - {0x17, 0x01, 0x04, 0x04, "Reverse" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x17, 0x01, 0x38, 0x00, "1 Easy" }, - {0x17, 0x01, 0x38, 0x08, "2" }, - {0x17, 0x01, 0x38, 0x10, "3" }, - {0x17, 0x01, 0x38, 0x18, "4" }, - {0x17, 0x01, 0x38, 0x20, "5" }, - {0x17, 0x01, 0x38, 0x28, "6" }, - {0x17, 0x01, 0x38, 0x30, "7" }, - {0x17, 0x01, 0x38, 0x38, "8 Hard" }, - - {0 , 0xfe, 0 , 2 , "Join During Game" }, - {0x17, 0x01, 0x40, 0x40, "Impossible" }, - {0x17, 0x01, 0x40, 0x00, "Possible" }, - - {0 , 0xfe, 0 , 2 , "Continue Coin" }, - {0x17, 0x01, 0x80, 0x00, "Normal" }, - {0x17, 0x01, 0x80, 0x80, "Continue coin" }, -}; - -STDDIPINFO(Bloodwar) - -static struct BurnDIPInfo BonkadvDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0x10, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Screen Direction" }, - {0x14, 0x01, 0x01, 0x00, "Standard" }, - {0x14, 0x01, 0x01, 0x01, "Reverse" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x02, 0x00, "Off" }, - {0x14, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Title Level Display" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Bonkadv) - -static struct BurnDIPInfo ExplbrkrDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, -}; - -STDDIPINFO(Explbrkr) - -static struct BurnDIPInfo GtmrDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x02, 0x00, "Off" }, - {0x14, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x04, 0x00, "Upright" }, - {0x14, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Controls" }, - {0x14, 0x01, 0x18, 0x00, "1 Joystick" }, - {0x14, 0x01, 0x18, 0x10, "2 Joysticks" }, - {0x14, 0x01, 0x18, 0x08, "Wheel (360)" }, - {0x14, 0x01, 0x18, 0x18, "Wheel (270)" }, - - {0 , 0xfe, 0 , 2 , "Use Brake" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "National Anthem & Flag" }, - {0x14, 0x01, 0xc0, 0x00, "Use Memory" }, - {0x14, 0x01, 0xc0, 0x40, "Anthem Only" }, - {0x14, 0x01, 0xc0, 0x80, "Flag Only" }, - {0x14, 0x01, 0xc0, 0xc0, "None" }, -}; - -STDDIPINFO(Gtmr) - -static struct BurnDIPInfo Gtmr2DIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 5 , "Communication" }, - {0x14, 0x01, 0x07, 0x00, "None" }, - {0x14, 0x01, 0x07, 0x01, "Machine 1" }, - {0x14, 0x01, 0x07, 0x02, "Machine 2" }, - {0x14, 0x01, 0x07, 0x03, "Machine 3" }, - {0x14, 0x01, 0x07, 0x04, "Machine 4" }, - - {0 , 0xfe, 0 , 4 , "Controls" }, - {0x14, 0x01, 0x18, 0x00, "Joystick" }, - {0x14, 0x01, 0x18, 0x10, "Wheel (360)" }, - {0x14, 0x01, 0x18, 0x08, "Wheel (270D)" }, - {0x14, 0x01, 0x18, 0x18, "Wheel (270A)" }, - - {0 , 0xfe, 0 , 2 , "Pedal Function" }, - {0x14, 0x01, 0x20, 0x00, "Microswitch" }, - {0x14, 0x01, 0x20, 0x20, "Potentiometer" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Gtmr2) - -static struct BurnDIPInfo MgcrystlDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, -}; - -STDDIPINFO(Mgcrystl) - -static struct BurnDIPInfo ShogwarrDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x16, 0x01, 0x38, 0x38, "1 Easy" }, - {0x16, 0x01, 0x38, 0x30, "2" }, - {0x16, 0x01, 0x38, 0x28, "3" }, - {0x16, 0x01, 0x38, 0x20, "4 Normal" }, - {0x16, 0x01, 0x38, 0x18, "5" }, - {0x16, 0x01, 0x38, 0x10, "6" }, - {0x16, 0x01, 0x38, 0x08, "7" }, - {0x16, 0x01, 0x38, 0x00, "8 Hard" }, - - {0 , 0xfe, 0 , 2, "Can Join During Game" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Continue Coin" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Shogwarr) - -static struct BurnDIPInfo BrapboysDIPList[]= -{ - {0x19, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x19, 0x01, 0x01, 0x01, "Off" }, - {0x19, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x19, 0x01, 0x02, 0x02, "Off" }, - {0x19, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Switch Test" }, - {0x19, 0x01, 0x04, 0x04, "Off" }, - {0x19, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 0, "Coin Slots" }, - {0x19, 0x01, 0x10, 0x10, "Separate Coins" }, - {0x19, 0x01, 0x10, 0x00, "Shared Coins" }, - - {0 , 0xfe, 0 , 2, "Players" }, - {0x19, 0x01, 0x20, 0x20, "3" }, - {0x19, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x19, 0x01, 0xc0, 0x80, "Easy" }, - {0x19, 0x01, 0xc0, 0xc0, "Normal" }, - {0x19, 0x01, 0xc0, 0x40, "Hard" }, - {0x19, 0x01, 0xc0, 0x00, "Very Hard" }, -}; - -STDDIPINFO(Brapboys) - -/*============================================================================================== -ROM Descriptions -===============================================================================================*/ - -static struct BurnRomInfo BerlwallRomDesc[] = { - { "bw100e_u23-01.u23", 0x020000, 0x76b526ce, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "bw101e_u39-01.u39", 0x020000, 0x78fa7ef2, BRF_ESS | BRF_PRG }, // 1 - - { "bw001.u84", 0x080000, 0xbc927260, BRF_GRA }, // 2 Sprites - { "bw002.u83", 0x080000, 0x223f5465, BRF_GRA }, // 3 -#if !defined ROM_VERIFY - { "bw300.u82", 0x020000, 0xb258737a, BRF_GRA }, // 4 Masked players, Japanese text -#endif - - { "bw003.u77", 0x080000, 0xfbb4b72d, BRF_GRA }, // 5 Tiles (scrambled) - - { "bw004.u73", 0x080000, 0x5300c34d, BRF_GRA }, // 6 High Color Background - { "bw008.u65", 0x080000, 0x9aaf2f2f, BRF_GRA }, // 7 FIXED BITS (xxxxxxx0) - { "bw005.u74", 0x080000, 0x16db6d43, BRF_GRA }, // 8 - { "bw009.u66", 0x080000, 0x1151a0b0, BRF_GRA }, // 9 FIXED BITS (xxxxxxx0) - { "bw006.u75", 0x080000, 0x73a35d1f, BRF_GRA }, // 10 - { "bw00a.u67", 0x080000, 0xf447dfc2, BRF_GRA }, // 11 FIXED BITS (xxxxxxx0) - { "bw007.u76", 0x080000, 0x97f85c87, BRF_GRA }, // 12 - { "bw00b.u68", 0x080000, 0xb0a48225, BRF_GRA }, // 13 FIXED BITS (xxxxxxx0) - - { "bw000.u46", 0x040000, 0xd8fe869d, BRF_SND }, // 14 Samples - - { "bw_u47.u47", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "bw_u48.u48", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "bw_u54.u54", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - - -STD_ROM_PICK(Berlwall) -STD_ROM_FN(Berlwall) - -static struct BurnRomInfo BerlwalltRomDesc[] = { - { "bw100a.u23", 0x020000, 0xe6bcb4eb, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "bw101a.u39", 0x020000, 0x38056fb2, BRF_ESS | BRF_PRG }, // 1 - - { "bw001.u84", 0x080000, 0xbc927260, BRF_GRA }, // 2 Sprites - { "bw002.u83", 0x080000, 0x223f5465, BRF_GRA }, // 3 - { "bw300.u82", 0x020000, 0xb258737a, BRF_GRA }, // 4 Masked players, Japanese text - - { "bw003.u77", 0x080000, 0xfbb4b72d, BRF_GRA }, // 5 Tiles (scrambled) - - { "bw004.u73", 0x080000, 0x5300c34d, BRF_GRA }, // 6 High Color Background - { "bw008.u65", 0x080000, 0x9aaf2f2f, BRF_GRA }, // 7 FIXED BITS (xxxxxxx0) - { "bw005.u74", 0x080000, 0x16db6d43, BRF_GRA }, // 8 - { "bw009.u66", 0x080000, 0x1151a0b0, BRF_GRA }, // 9 FIXED BITS (xxxxxxx0) - { "bw006.u75", 0x080000, 0x73a35d1f, BRF_GRA }, // 10 - { "bw00a.u67", 0x080000, 0xf447dfc2, BRF_GRA }, // 11 FIXED BITS (xxxxxxx0) - { "bw007.u76", 0x080000, 0x97f85c87, BRF_GRA }, // 12 - { "bw00b.u68", 0x080000, 0xb0a48225, BRF_GRA }, // 13 FIXED BITS (xxxxxxx0) - - { "bw000.u46", 0x040000, 0xd8fe869d, BRF_SND }, // 14 Samples - - { "bw_u47.u47", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "bw_u48.u48", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "bw_u54.u54", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - - -STD_ROM_PICK(Berlwallt) -STD_ROM_FN(Berlwallt) - -static struct BurnRomInfo BerlwallkRomDesc[] = { - { "bw100k.u23", 0x020000, 0x0ce1d336, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "bw101k.u39", 0x020000, 0x3355be65, BRF_ESS | BRF_PRG }, // 1 - - { "bw001.u84", 0x080000, 0xbc927260, BRF_GRA }, // 2 Sprites - { "bw002.u83", 0x080000, 0x223f5465, BRF_GRA }, // 3 - { "bw300k.u82", 0x020000, 0xb8de79d7, BRF_GRA }, // 4 - - { "bw003.u77", 0x080000, 0xfbb4b72d, BRF_GRA }, // 5 Tiles (scrambled) - - { "bw004.u73", 0x080000, 0x5300c34d, BRF_GRA }, // 6 High Color Background - { "bw008.u65", 0x080000, 0x9aaf2f2f, BRF_GRA }, // 7 FIXED BITS (xxxxxxx0) - { "bw005.u74", 0x080000, 0x16db6d43, BRF_GRA }, // 8 - { "bw009.u66", 0x080000, 0x1151a0b0, BRF_GRA }, // 9 FIXED BITS (xxxxxxx0) - { "bw006.u75", 0x080000, 0x73a35d1f, BRF_GRA }, // 10 - { "bw00a.u67", 0x080000, 0xf447dfc2, BRF_GRA }, // 11 FIXED BITS (xxxxxxx0) - { "bw007.u76", 0x080000, 0x97f85c87, BRF_GRA }, // 12 - { "bw00b.u68", 0x080000, 0xb0a48225, BRF_GRA }, // 13 FIXED BITS (xxxxxxx0) - - { "bw000k.u46", 0x040000, 0x52e81a50, BRF_SND }, // 14 Samples - - { "bw_u47.u47", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "bw_u48.u48", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "bw_u54.u54", 0x000117, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - - -STD_ROM_PICK(Berlwallk) -STD_ROM_FN(Berlwallk) - -static struct BurnRomInfo PackbangRomDesc[] = { - /* same PCB as Berlin Wall - BW-002 */ - { "bbp0x3.u23", 0x020000, 0x105e978a, BRF_ESS | BRF_PRG }, // 0 68000 Program Code /* hand written checksum on label - 527B */ - { "bbp1x3.u39", 0x020000, 0x465d36f5, BRF_ESS | BRF_PRG }, // 1 /* hand written checksum on label - C5C8 */ - - { "bb.u84", 0x080000, 0x97837aaa, BRF_GRA }, // 2 Sprites - { "pb_spr_ext_9_20_ver.u83", 0x040000, 0x666a1217, BRF_GRA }, // 3 /* hand written label plus checksum BA63 */ - - { "bbbox1.u77", 0x080000, 0xb2ffd081, BRF_GRA }, // 4 Titles (scrambled) /* 1ST AND 2ND HALF IDENTICAL */ - - { "bb.u73", 0x080000, 0x896d88cb, BRF_GRA }, // 5 High Color Background - { "bb.u65", 0x080000, 0xfe17c5b5, BRF_GRA }, // 6 FIXED BITS (xxxxxxx0) - { "bb.u74", 0x080000, 0xb01e77b9, BRF_GRA }, // 7 - { "bb.u66", 0x080000, 0xcaec5098, BRF_GRA }, // 8 FIXED BITS (xxxxxxx0) - { "bb.u75", 0x080000, 0x5cb4669f, BRF_GRA }, // 9 - { "bb.u67", 0x080000, 0xce5c9417, BRF_GRA }, // 10 FIXED BITS (xxxxxxx0) - - { "bw000.u46", 0x040000, 0xd8fe869d, BRF_SND }, // 11 Samples -}; - - -STD_ROM_PICK(Packbang) -STD_ROM_FN(Packbang) - -static struct BurnRomInfo BlazeonRomDesc[] = { - { "bz_prg1.u80", 0x040000, 0x8409e31d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "bz_prg2.u81", 0x040000, 0xb8a0a08b, BRF_ESS | BRF_PRG }, // 1 - - { "bz_sp1.u20", 0x100000, 0x0d5809a1, BRF_GRA }, // 2 Sprites - { "bz_sp2.u21", 0x100000, 0x56ead2bd, BRF_GRA }, // 3 - - { "bz_bg.u2", 0x100000, 0xfc67f19f, BRF_GRA }, // 4 Tiles (scrambled) - - { "3.u45", 0x020000, 0x52fe4c94, BRF_ESS | BRF_PRG }, // 5 Z80 Program Code - - { "bz_sp1.u68", 0x100000, 0x0d5809a1, BRF_OPT }, - { "bz_sp2.u86", 0x100000, 0x56ead2bd, BRF_OPT }, -}; - - -STD_ROM_PICK(Blazeon) -STD_ROM_FN(Blazeon) - -static struct BurnRomInfo WingforcRomDesc[] = { - { "e_2.24.u80", 0x080000, 0x837e0726, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "o_2.24.u81", 0x080000, 0xb6983437, BRF_ESS | BRF_PRG }, // 1 - - // two sprite chips, roms are doubled - { "sp0m.u69", 0x080000, 0x8be26a05, BRF_GRA }, // 2 Sprites - { "sp0m.u1", 0x080000, 0x8be26a05, BRF_GRA }, // 3 - - { "sp1m.u1", 0x080000, 0xad8c5b68, BRF_GRA }, // 4 - { "sp1m.u69", 0x080000, 0xad8c5b68, BRF_GRA }, // 5 - - { "sp2m.u20", 0x080000, 0xb5994bda, BRF_GRA }, // 6 - { "sp2m.u68", 0x080000, 0xb5994bda, BRF_GRA }, // 7 - - { "sp3m.u20", 0x080000, 0x889ddf72, BRF_GRA }, // 8 - { "sp3m.u68", 0x080000, 0x889ddf72, BRF_GRA }, // 9 - - { "bg0am.u2", 0x080000, 0xf4276860, BRF_GRA }, // 10 Tiles (scrambled) - { "bg0bm.u2", 0x080000, 0x9df92283, BRF_GRA }, // 11 Tiles (scrambled) - { "bg1am.u3", 0x080000, 0xa44fdebb, BRF_GRA }, // 12 Tiles (scrambled) - { "bg1bm.u3", 0x080000, 0xa9b9fc5d, BRF_GRA }, // 13 Tiles (scrambled) - - { "s-drv_2.22.u45", 0x010000, 0xccdc2758, BRF_ESS | BRF_PRG }, // 14 Z80 Program Code - - { "pcm.u5", 0x080000, 0x233569fd, BRF_SND }, // 15 Samples -}; - - -STD_ROM_PICK(Wingforc) -STD_ROM_FN(Wingforc) - -static struct BurnRomInfo BloodwarRomDesc[] = { - { "ofp0f3.514", 0x080000, 0x0c93da15, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ofp1f3.513", 0x080000, 0x894ecbe5, BRF_ESS | BRF_PRG }, // 1 - - { "ofd0x3.124", 0x020000, 0x399f2005, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "of-200-0201.8", 0x200000, 0xbba63025, BRF_GRA }, // 3 Sprites - { "of-201-0202.9", 0x200000, 0x4ffd9ddc, BRF_GRA }, // 4 - { "of-202-0203.10", 0x200000, 0xfbcc5363, BRF_GRA }, // 5 - { "of-203-0204.11", 0x200000, 0x8e818ce9, BRF_GRA }, // 6 - { "of-204-0205.12", 0x200000, 0x70c4a76b, BRF_GRA }, // 7 - { "of-205-0206.13", 0x200000, 0x80c667bb, BRF_GRA }, // 8 - { "of-206-0207.14", 0x200000, 0xc2028c97, BRF_GRA }, // 9 - { "of-207-0208.15", 0x200000, 0xb1f30c61, BRF_GRA }, // 10 - { "of-208-0209.28", 0x200000, 0xa8f29545, BRF_GRA }, // 11 - { "of-209e-0210.16", 0x100000, 0x93018468, BRF_GRA }, // 12 - { "of-2090-2011.17", 0x100000, 0x3fb226a1, BRF_GRA }, // 13 - { "of-210e-0212.18", 0x100000, 0x80f3fa1b, BRF_GRA }, // 14 - { "of-2100-0213.19", 0x100000, 0x8ca3a3d6, BRF_GRA }, // 15 - { "of-211e-0214.20", 0x100000, 0x8d3d96f7, BRF_GRA }, // 16 - { "of-2110-0215.21", 0x100000, 0x78268230, BRF_GRA }, // 17 - { "of-212e-0216.22", 0x100000, 0x5a013d99, BRF_GRA }, // 18 - { "of-2120-0217.23", 0x100000, 0x84ed25bd, BRF_GRA }, // 19 - { "of-213e-0218.24", 0x100000, 0x861bc5b1, BRF_GRA }, // 20 - { "of-2130-0219.25", 0x100000, 0xa79b8119, BRF_GRA }, // 21 - { "of-214e-0220.26", 0x100000, 0x43c622de, BRF_GRA }, // 22 - { "of-2140-0221.27", 0x100000, 0xd10bf03c, BRF_GRA }, // 23 - - { "of-300-0225.51", 0x100000, 0xfbc3c08a, BRF_GRA }, // 24 Tiles (scrambled) - - { "of-301-0226.55", 0x100000, 0xfcf215de, BRF_GRA }, // 25 Tiles (scrambled) (Layers 2 & 3) - - { "of-101-f-0223.101", 0x100000, 0x295f3c93, BRF_SND }, // 26 Samples, plus room for expansion - - { "of-100-0222.99", 0x100000, 0x42b12269, BRF_SND }, // 27 Samples -}; - - -STD_ROM_PICK(Bloodwar) -STD_ROM_FN(Bloodwar) - -static struct BurnRomInfo OedfightRomDesc[] = { - { "ofp0j3.514", 0x080000, 0x0c93da15, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ofp1j3.513", 0x080000, 0xcc59de49, BRF_ESS | BRF_PRG }, // 1 - - { "ofd0x3.124", 0x020000, 0x399f2005, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "of-200-0201.8", 0x200000, 0xbba63025, BRF_GRA }, // 3 Sprites - { "of-201-0202.9", 0x200000, 0x4ffd9ddc, BRF_GRA }, // 4 - { "of-202-0203.10", 0x200000, 0xfbcc5363, BRF_GRA }, // 5 - { "of-203-0204.11", 0x200000, 0x8e818ce9, BRF_GRA }, // 6 - { "of-204-0205.12", 0x200000, 0x70c4a76b, BRF_GRA }, // 7 - { "of-205-0206.13", 0x200000, 0x80c667bb, BRF_GRA }, // 8 - { "of-206-0207.14", 0x200000, 0xc2028c97, BRF_GRA }, // 9 - { "of-207-0208.15", 0x200000, 0xb1f30c61, BRF_GRA }, // 10 - { "of-208-0209.28", 0x200000, 0xa8f29545, BRF_GRA }, // 11 - { "of-209e-0210.16", 0x100000, 0x93018468, BRF_GRA }, // 12 - { "of-2090-2011.17", 0x100000, 0x3fb226a1, BRF_GRA }, // 13 - { "of-210e-0212.18", 0x100000, 0x80f3fa1b, BRF_GRA }, // 14 - { "of-2100-0213.19", 0x100000, 0x8ca3a3d6, BRF_GRA }, // 15 - { "of-211e-0214.20", 0x100000, 0x8d3d96f7, BRF_GRA }, // 16 - { "of-2110-0215.21", 0x100000, 0x78268230, BRF_GRA }, // 17 - { "of-212e-0216.22", 0x100000, 0x5a013d99, BRF_GRA }, // 18 - { "of-2120-0217.23", 0x100000, 0x84ed25bd, BRF_GRA }, // 19 - { "of-213e-0218.24", 0x100000, 0x861bc5b1, BRF_GRA }, // 20 - { "of-2130-0219.25", 0x100000, 0xa79b8119, BRF_GRA }, // 21 - { "of-214e-0220.26", 0x100000, 0x43c622de, BRF_GRA }, // 22 - { "of-2140-0221.27", 0x100000, 0xd10bf03c, BRF_GRA }, // 23 - - { "of-300-0225.51", 0x100000, 0xfbc3c08a, BRF_GRA }, // 24 Tiles (scrambled) - - { "of-301-0226.55", 0x100000, 0xfcf215de, BRF_GRA }, // 25 Tiles (scrambled) (Layers 2 & 3) - - { "of-101-j-0224.101", 0x100000, 0x83a1f826, BRF_SND }, // 26 Samples, plus room for expansion - - { "of-100-0222.99", 0x100000, 0x42b12269, BRF_SND }, // 27 Samples -}; - - -STD_ROM_PICK(Oedfight) -STD_ROM_FN(Oedfight) - -static struct BurnRomInfo BonkadvRomDesc[] = { - { "prg.8", 0x080000, 0xaf2e60f8, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "prg.7", 0x080000, 0xa1cc6a78, BRF_ESS | BRF_PRG }, // 1 - - { "mcu.124", 0x020000, 0x9d4e2724, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "pc100101.37", 0x200000, 0xc96e7c10, BRF_GRA }, // 3 Sprites - { "pc200102.40", 0x100000, 0xc2b7a26a, BRF_GRA }, // 4 - { "pc300103.38", 0x100000, 0x51ee162c, BRF_GRA }, // 5 - { "pc600106.42", 0x080000, 0x25877026, BRF_GRA }, // 6 - { "pc700107.43", 0x080000, 0xbfe21c44, BRF_GRA }, // 7 - - { "pc400104.51", 0x100000, 0x3b176f84, BRF_GRA }, // 8 Tiles (scrambled) - - { "pc500105.55", 0x100000, 0xbebb3edc, BRF_GRA }, // 9 Tiles (scrambled) (Layers 2 & 3) - - { "pc604109.101", 0x100000, 0x76025530, BRF_SND }, // 10 Samples, plus room for expansion - - { "pc601106.99", 0x100000, 0xa893651c, BRF_SND }, // 11 Samples - { "pc602107.100", 0x100000, 0x0fbb23aa, BRF_SND }, // 12 - { "pc603108.102", 0x100000, 0x58458985, BRF_SND }, // 13 -}; - - -STD_ROM_PICK(Bonkadv) -STD_ROM_FN(Bonkadv) - -static struct BurnRomInfo ExplbrkrRomDesc[] = { - { "ts100e.u18", 0x040000, 0xcc84a985, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ts101e.u19", 0x040000, 0x88f4afb7, BRF_ESS | BRF_PRG }, // 1 - - { "ts001e.u37", 0x080000, 0x70b66e7e, BRF_GRA }, // 2 Sprites - { "ts000e.u38", 0x080000, 0xa7a94143, BRF_GRA }, // 3 - { "ts002e.u36", 0x040000, 0x611271e6, BRF_GRA }, // 4 - - { "ts010.u4", 0x100000, 0xdf935324, BRF_GRA }, // 5 Tiles - - { "ts020.u33", 0x100000, 0xeb58c35d, BRF_GRA }, // 6 Tiles (Layers 2 & 3) - - { "ts030.u5", 0x100000, 0x1d68e9d1, BRF_SND }, // 7 OKI Sample ROM -}; - - -STD_ROM_PICK(Explbrkr) -STD_ROM_FN(Explbrkr) - -static struct BurnRomInfo BakubrkrRomDesc[] = { - { "ts100j.u18", 0x040000, 0x8cc0a4fd, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ts101j.u19", 0x040000, 0xaea92195, BRF_ESS | BRF_PRG }, // 1 - - { "ts001j.u37", 0x080000, 0x70b66e7e, BRF_GRA }, // 2 Sprites - { "ts000j.u38", 0x080000, 0xa7a94143, BRF_GRA }, // 3 - { "ts002j.u36", 0x040000, 0x611271e6, BRF_GRA }, // 4 - - { "ts010.u4", 0x100000, 0xdf935324, BRF_GRA }, // 5 Tiles - - { "ts020.u33", 0x100000, 0xeb58c35d, BRF_GRA }, // 6 Tiles (Layers 2 & 3) - - { "ts030.u5", 0x100000, 0x1d68e9d1, BRF_SND }, // 7 OKI Sample ROM -}; - - -STD_ROM_PICK(Bakubrkr) -STD_ROM_FN(Bakubrkr) - -static struct BurnRomInfo GtmrRomDesc[] = { - // this set shows 'PCB by Jinwei Co Ltd. ROC' - { "u2.bin", 0x080000, 0x031799f7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "u1.bin", 0x080000, 0x6238790a, BRF_ESS | BRF_PRG }, // 1 - - { "mmd0x2.u124.bin", 0x020000, 0x3d7cb329, BRF_PRG | BRF_OPT }, // 2 MCU Code // from gtmra - - { "mm-200-402-s0.bin", 0x200000, 0xc0ab3efc, BRF_GRA }, // 3 Sprites - { "mm-201-403-s1.bin", 0x200000, 0xcf6b23dc, BRF_GRA }, // 4 - { "mm-202-404-s2.bin", 0x200000, 0x8f27f5d3, BRF_GRA }, // 5 - { "mm-203-405-s3.bin", 0x080000, 0xe9747c8c, BRF_GRA }, // 6 - { "mms1x2.u30.bin", 0x020000, 0xb42b426f, BRF_GRA }, // 7 - { "mms0x2.u29.bin", 0x020000, 0xbd22b7d2, BRF_GRA }, // 8 - - { "mm-300-406-a0.bin", 0x200000, 0xb15f6b7f, BRF_GRA }, // 9 Tiles (scrambled) - - { "mm-100-401-e0.bin", 0x100000, 0xb9cbfbee, BRF_SND }, // 10 Samples -}; - - -STD_ROM_PICK(Gtmr) -STD_ROM_FN(Gtmr) - -static struct BurnRomInfo GtmraRomDesc[] = { - { "mmp0x2.u514.bin", 0x080000, 0xba4a77c8, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "mmp1x2.u513.bin", 0x080000, 0xa2b9034e, BRF_ESS | BRF_PRG }, // 1 - - { "mmd0x2.u124.bin", 0x020000, 0x3d7cb329, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "mm-200-402-s0.bin", 0x200000, 0xc0ab3efc, BRF_GRA }, // 3 Sprites - { "mm-201-403-s1.bin", 0x200000, 0xcf6b23dc, BRF_GRA }, // 4 - { "mm-202-404-s2.bin", 0x200000, 0x8f27f5d3, BRF_GRA }, // 5 - { "mm-203-405-s3.bin", 0x080000, 0xe9747c8c, BRF_GRA }, // 6 - { "mms1x2.u30.bin", 0x020000, 0xb42b426f, BRF_GRA }, // 7 - { "mms0x2.u29.bin", 0x020000, 0xbd22b7d2, BRF_GRA }, // 8 - - { "mm-300-406-a0.bin", 0x200000, 0xb15f6b7f, BRF_GRA }, // 9 Tiles (scrambled) - - { "mm-100-401-e0.bin", 0x100000, 0xb9cbfbee, BRF_SND }, // 10 Samples -}; - - -STD_ROM_PICK(Gtmra) -STD_ROM_FN(Gtmra) - -static struct BurnRomInfo GtmrbRomDesc[] = { - { "mmp0x1.u514", 0x080000, 0x6c163f12, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "mmp1x1.u513", 0x080000, 0x424dc7e1, BRF_ESS | BRF_PRG }, // 1 - - { "mmd0x1.u124", 0x020000, 0x3d7cb329, BRF_PRG | BRF_OPT }, // 2 MCU Code // == mmd0x2 - - { "mm-200-402-s0.bin", 0x200000, 0xc0ab3efc, BRF_GRA }, // 3 Sprites - { "mm-201-403-s1.bin", 0x200000, 0xcf6b23dc, BRF_GRA }, // 4 - { "mm-202-404-s2.bin", 0x200000, 0x8f27f5d3, BRF_GRA }, // 5 - { "mm-203-405-s3.bin", 0x080000, 0xe9747c8c, BRF_GRA }, // 6 - { "mms1x1.u30", 0x020000, 0x9463825c, BRF_GRA }, // 7 - { "mms0x1.u29", 0x020000, 0xbd22b7d2, BRF_GRA }, // 8 // == mms0x2 - - { "mm-300-406-a0.bin", 0x200000, 0xb15f6b7f, BRF_GRA }, // 9 Tiles (scrambled) - - { "mm-100-401-e0.bin", 0x100000, 0xb9cbfbee, BRF_SND }, // 10 Samples -}; - - -STD_ROM_PICK(Gtmrb) -STD_ROM_FN(Gtmrb) - -static struct BurnRomInfo GtmroRomDesc[] = { - // possible prototype - { "u514.bin", 0x080000, 0x2e857685, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "u513.bin", 0x080000, 0xd5003870, BRF_ESS | BRF_PRG }, // 1 - - { "mmd0x0.u124", 0x020000, 0xe1f6159e, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "mm200-e.bin", 0x100000, 0xeb104408, BRF_GRA }, // 3 Sprites - { "mm200-o.bin", 0x100000, 0xb6d04e7c, BRF_GRA }, // 4 - { "mm201-e.bin", 0x100000, 0xb8c64e14, BRF_GRA }, // 5 - { "mm201-o.bin", 0x100000, 0x3ecd6c0a, BRF_GRA }, // 6 - { "mm202-e.bin", 0x100000, 0xf0fd5688, BRF_GRA }, // 7 - { "mm202-o.bin", 0x100000, 0xe0fe1b2b, BRF_GRA }, // 8 - { "mm203-e.bin", 0x100000, 0xb9001f28, BRF_GRA }, // 9 - { "mm203-o.bin", 0x100000, 0x2ed6227d, BRF_GRA }, // 10 - - { "mm300-e.u53", 0x100000, 0xf9ee708d, BRF_GRA }, // 11 Tiles (scrambled) - { "mm300-o.u54", 0x100000, 0x76299353, BRF_GRA }, // 12 - - { "mm-100-401-e0.bin", 0x100000, 0xb9cbfbee, BRF_SND }, // 13 Samples -}; - - -STD_ROM_PICK(Gtmro) -STD_ROM_FN(Gtmro) - -static struct BurnRomInfo GtmreRomDesc[] = { - { "gmmu2.bin", 0x080000, 0x36dc4aa9, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "gmmu1.bin", 0x080000, 0x8653c144, BRF_ESS | BRF_PRG }, // 1 - - { "gtmrusa.u12", 0x020000, 0x2e1a06ff, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "gmmu27.bin", 0x200000, 0xc0ab3efc, BRF_GRA }, // 3 Sprites - { "gmmu28.bin", 0x200000, 0xcf6b23dc, BRF_GRA }, // 4 - { "gmmu29.bin", 0x200000, 0x8f27f5d3, BRF_GRA }, // 5 - { "gmmu30.bin", 0x080000, 0xe9747c8c, BRF_GRA }, // 6 - { "gmmu64.bin", 0x100000, 0x57d77b33, BRF_GRA }, // 7 - { "gmmu65.bin", 0x100000, 0x05b8bdca, BRF_GRA }, // 8 - - { "gmmu52.bin", 0x200000, 0xb15f6b7f, BRF_GRA }, // 9 Tiles - - { "gmmu23.bin", 0x100000, 0xb9cbfbee, BRF_SND }, // 10 Samples, plus room for expansion - - { "gmmu24.bin", 0x100000, 0x380cdc7c, BRF_SND }, // 11 Samples -}; - - -STD_ROM_PICK(Gtmre) -STD_ROM_FN(Gtmre) - -static struct BurnRomInfo GtmrusaRomDesc[] = { - { "mmp0x3.u2", 0x080000, 0x5be615c4, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "mmp1x3.u1", 0x080000, 0xae853e4e, BRF_ESS | BRF_PRG }, // 1 - - { "mmd0x3.u12", 0x020000, 0x2e1a06ff, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "mm-200-402-s0.bin", 0x200000, 0xc0ab3efc, BRF_GRA }, // 3 Sprites - { "mm-201-403-s1.bin", 0x200000, 0xcf6b23dc, BRF_GRA }, // 4 - { "mm-202-404-s2.bin", 0x200000, 0x8f27f5d3, BRF_GRA }, // 5 - { "mm-203-405-s3.bin", 0x080000, 0xe9747c8c, BRF_GRA }, // 6 - { "mm-204-564.bin", 0x100000, 0x57d77b33, BRF_GRA }, // 7 HALVES IDENTICAL - { "mm-204-406-565.bin", 0x100000, 0x05b8bdca, BRF_GRA }, // 8 HALVES IDENTICAL - - { "mm-300-406-a0.bin", 0x200000, 0xb15f6b7f, BRF_GRA }, // 9 Tiles (scrambled) - - { "mm-100-401-a0.bin", 0x100000, 0xb9cbfbee, BRF_SND }, // 10 Samples, plus room for expansion - - { "mm-101-402-e24.bin", 0x100000, 0x380cdc7c, BRF_SND }, // 11 Samples -}; - - -STD_ROM_PICK(Gtmrusa) -STD_ROM_FN(Gtmrusa) - -static struct BurnRomInfo Gtmr2RomDesc[] = { - { "m2p0x1a.u8", 0x080000, 0xc29039fb, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "m2p1x1a.u7", 0x080000, 0x8ef392c4, BRF_ESS | BRF_PRG }, // 1 - - { "m2d0x0.u31", 0x020000, 0x2e1a06ff, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "m2-200-0.u49", 0x400000, 0x93aafc53, BRF_GRA }, // 3 Sprites - { "m2-201-0.u50", 0x200000, 0x39b60a83, BRF_GRA }, // 4 - { "m2-202-0.u51", 0x200000, 0xfd06b339, BRF_GRA }, // 5 - { "m2s0x1a.u32", 0x080000, 0xa485eec6, BRF_GRA }, // 6 - { "m2s1x1a.u33", 0x080000, 0xc5b71bb2, BRF_GRA }, // 7 - - { "m2-300-0.u89", 0x200000, 0x4dc42fbb, BRF_GRA }, // 8 Tiles (scrambled) - { "m2-301-0.u90", 0x200000, 0xf4e894f2, BRF_GRA }, // 9 - { "m2b0x0.u93", 0x020000, 0xe023d51b, BRF_GRA }, // 10 - { "m2b1x0.u94", 0x020000, 0x03c48bdb, BRF_GRA }, // 11 - - { "m2-100-0.u48", 0x100000, 0x5250fa45, BRF_SND }, // 12 Samples, plus room for expansion - - { "m2w1x0.u47", 0x040000, 0x1b0513c5, BRF_SND }, // 13 Samples -}; - - -STD_ROM_PICK(Gtmr2) -STD_ROM_FN(Gtmr2) - -static struct BurnRomInfo Gtmr2aRomDesc[] = { - { "m2p0x1.u8", 0x080000, 0x525f6618, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "m2p1x1.u7", 0x080000, 0x914683e5, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "m2d0x0.u31", 0x020000, 0x2e1a06ff, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "m2-200-0.u49", 0x400000, 0x93aafc53, BRF_GRA }, // 3 Sprites - { "m2-201-0.u50", 0x200000, 0x39b60a83, BRF_GRA }, // 4 - { "m2-202-0.u51", 0x200000, 0xfd06b339, BRF_GRA }, // 5 - { "m2s0x1.u32", 0x080000, 0x4069d6c7, BRF_GRA }, // 6 - { "m2s1x1.u33", 0x080000, 0xc53fe269, BRF_GRA }, // 7 - - { "m2-300-0.u89", 0x200000, 0x4dc42fbb, BRF_GRA }, // 8 Tiles (scrambled) - { "m2-301-0.u90", 0x200000, 0xf4e894f2, BRF_GRA }, // 9 - { "m2b0x0.u93", 0x020000, 0xe023d51b, BRF_GRA }, // 10 - { "m2b1x0.u94", 0x020000, 0x03c48bdb, BRF_GRA }, // 11 - - { "m2-100-0.u48", 0x100000, 0x5250fa45, BRF_SND }, // 12 Samples, plus room for expansion - - { "m2w1x0.u47", 0x040000, 0x1b0513c5, BRF_SND }, // 13 Samples -}; - - -STD_ROM_PICK(Gtmr2a) -STD_ROM_FN(Gtmr2a) - -static struct BurnRomInfo Gtmr2uRomDesc[] = { - { "m2p0a1.u8", 0x080000, 0x813e1d5e, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "m2p1a1.u7", 0x080000, 0xbee63666, BRF_ESS | BRF_PRG }, // 1 - - { "m2d0x0.u31", 0x020000, 0x2e1a06ff, BRF_PRG | BRF_OPT }, // 2 MCU Code - - { "m2-200-0.u49", 0x400000, 0x93aafc53, BRF_GRA }, // 3 Sprites - { "m2-201-0.u50", 0x200000, 0x39b60a83, BRF_GRA }, // 4 - { "m2-202-0.u51", 0x200000, 0xfd06b339, BRF_GRA }, // 5 - { "m2s0a1.u32", 0x080000, 0x98977171, BRF_GRA }, // 6 - { "m2s1a1.u33", 0x080000, 0xc69a732e, BRF_GRA }, // 7 - - { "m2-300-0.u89", 0x200000, 0x4dc42fbb, BRF_GRA }, // 8 Tiles - { "m2-301-0.u90", 0x200000, 0xf4e894f2, BRF_GRA }, // 9 - { "m2b0x0.u93", 0x020000, 0xe023d51b, BRF_GRA }, // 10 - { "m2b1x0.u94", 0x020000, 0x03c48bdb, BRF_GRA }, // 11 - - { "m2-100-0.u48", 0x100000, 0x5250fa45, BRF_SND }, // 12 Samples, plus room for expansion - - { "m2w1a1.u47", 0x080000, 0x15f25342, BRF_SND }, // 13 Samples -}; - - -STD_ROM_PICK(Gtmr2u) -STD_ROM_FN(Gtmr2u) - -static struct BurnRomInfo MgcrystlRomDesc[] = { - { "mc100e02.u18", 0x020000, 0x246a1335, BRF_ESS | BRF_PRG }, // 0 68000 Program Code /* Labeled as MC100E/U18-02 */ - { "mc101e02.u19", 0x040000, 0x708ea1dc, BRF_ESS | BRF_PRG }, // 1 /* Labeled as MC101E/U19-02 */ - - { "mc000.u38", 0x100000, 0x28acf6f4, BRF_GRA }, // 2 Sprites - { "mc001.u37", 0x080000, 0x005bc43d, BRF_GRA }, // 3 - { "mc002e02.u36", 0x020000, 0x27ac1056, BRF_GRA }, // 4 /* Labeled as MC002E/U36-02 */ - - { "mc010.u04", 0x100000, 0x85072772, BRF_GRA }, // 5 Tiles (scrambled) - - { "mc020.u34", 0x100000, 0x1ea92ff1, BRF_GRA }, // 6 Tiles (scrambled) (Layers 2 & 3) - - { "mc030.u32", 0x040000, 0xc165962e, BRF_SND }, // 7 Samples -}; - - -STD_ROM_PICK(Mgcrystl) -STD_ROM_FN(Mgcrystl) - -static struct BurnRomInfo MgcrystloRomDesc[] = { - { "mc100h00.u18", 0x020000, 0xc7456ba7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code /* Labeled as MC100H/U18-00 */ - { "mc101h00.u19", 0x040000, 0xea8f9300, BRF_ESS | BRF_PRG }, // 1 /* Labeled as MC101H/U19-00 */ - - { "mc000.u38", 0x100000, 0x28acf6f4, BRF_GRA }, // 2 Sprites - { "mc001.u37", 0x080000, 0x005bc43d, BRF_GRA }, // 3 - { "mc002h00.u36", 0x020000, 0x22729037, BRF_GRA }, // 4 /* Labeled as MC002H/U36-00 */ - - { "mc010.u04", 0x100000, 0x85072772, BRF_GRA }, // 5 Tiles (scrambled) - - { "mc020.u34", 0x100000, 0x1ea92ff1, BRF_GRA }, // 6 Tiles (scrambled) (Layers 2 & 3) - - { "mc030.u32", 0x040000, 0xc165962e, BRF_SND }, // 7 Samples -}; - - -STD_ROM_PICK(Mgcrystlo) -STD_ROM_FN(Mgcrystlo) - -static struct BurnRomInfo MgcrystljRomDesc[] = { - { "kaneko__mc100-u18j-02.u18", 0x020000, 0xafe5882d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code /* Labeled as MC100J/U18-02 */ - { "kaneko__mc101-u19j-02.u19", 0x040000, 0x60da5492, BRF_ESS | BRF_PRG }, // 1 /* Labeled as MC101J/U19-02 */ - - { "kaneko__mc-000_0001.u38", 0x100000, 0x28acf6f4, BRF_GRA }, // 2 Sprites - { "kaneko__mc-001_0002_r44.u37", 0x080000, 0x005bc43d, BRF_GRA }, // 3 - { "kaneko__mc002j-u36-02.u36", 0x020000, 0x27ac1056, BRF_GRA }, // 4 /* Labeled as MC002J/U36-02, but same as MC002E/U36-02 */ - - { "kaneko__mc-010_0003.u04", 0x100000, 0x85072772, BRF_GRA }, // 5 Tiles (scrambled) - - { "kaneko__mc-020_0004.u34", 0x100000, 0x1ea92ff1, BRF_GRA }, // 6 Tiles (scrambled) (Layers 2 & 3) - - { "kaneko__mc-030_0005_t99.u32", 0x040000, 0xc165962e, BRF_SND }, // 7 Samples -}; - - -STD_ROM_PICK(Mgcrystlj) -STD_ROM_FN(Mgcrystlj) - -static struct BurnRomInfo shogwarrRomDesc[] = { - { "fb030e.u61", 0x020000, 0x32ce7909, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fb031e.u62", 0x020000, 0x228aeaf5, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "fb040e.u33", 0x020000, 0x299d0746, BRF_ESS | BRF_PRG }, // 2 MCU Data - - { "fb-020a.u1", 0x100000, 0x87e55c6d, BRF_GRA }, // 3 Sprites - { "fb020b.u2", 0x100000, 0x276b9d7b, BRF_GRA }, // 4 - { "fb021a.u3", 0x100000, 0x7da15d37, BRF_GRA }, // 5 - { "fb021b.u4", 0x100000, 0x6a512d7b, BRF_GRA }, // 6 - { "fb-22a.u5", 0x100000, 0x9039e5d3, BRF_GRA }, // 7 - { "fb-22b.u6", 0x100000, 0x96ac9e54, BRF_GRA }, // 8 - { "fb023.u7", 0x100000, 0x132794bd, BRF_GRA }, // 9 - - { "fb010.u65", 0x100000, 0x296ffd92, BRF_GRA }, // 10 Tiles (scrambled) - { "fb011.u66", 0x080000, 0x500a0367, BRF_GRA }, // 11 - - { "fb001e.u43", 0x080000, 0xf524aaa1, BRF_SND }, // 12 Samples - { "fb000e.u42", 0x080000, 0x969f1465, BRF_SND }, // 13 - - { "fb-002.u45", 0x100000, 0x010acc17, BRF_SND }, // 14 Samples - { "fb-003.u44", 0x100000, 0x0aea4ac5, BRF_SND }, // 15 -}; - -STD_ROM_PICK(shogwarr) -STD_ROM_FN(shogwarr) - -static struct BurnRomInfo shogwarrkRomDesc[] = { - { "fb-030a.U61", 0x020000, 0x32ce7909, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fb-031a.U62", 0x020000, 0xbbffe957, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "fb-040a.U33", 0x020000, 0x299d0746, BRF_ESS | BRF_PRG }, // 2 MCU Data - - { "fb-020a.u1", 0x100000, 0x87e55c6d, BRF_GRA }, // 3 Sprites - { "fb020b.u2", 0x100000, 0x276b9d7b, BRF_GRA }, // 4 - { "fb021a.u3", 0x100000, 0x7da15d37, BRF_GRA }, // 5 - { "fb021b.u4", 0x100000, 0x6a512d7b, BRF_GRA }, // 6 - { "fb-22a.u5", 0x100000, 0x9039e5d3, BRF_GRA }, // 7 - { "fb-22b.u6", 0x100000, 0x96ac9e54, BRF_GRA }, // 8 - { "fb023.u7", 0x100000, 0x132794bd, BRF_GRA }, // 9 - { "fb-024.U8", 0x080000, 0x4bf3282d, BRF_GRA }, // 10 - - { "fb010.u65", 0x100000, 0x296ffd92, BRF_GRA }, // 11 Tiles (scrambled) - { "fb011.u66", 0x080000, 0x500a0367, BRF_GRA }, // 12 - - { "fb-000.U43", 0x080000, 0xf524aaa1, BRF_SND }, // 13 Samples - { "fb-003.U101", 0x080000, 0x969f1465, BRF_SND }, // 14 - - { "fb-002.u45", 0x100000, 0x010acc17, BRF_SND }, // 15 Samples - { "fb-003.u44", 0x100000, 0x0aea4ac5, BRF_SND }, // 16 -}; - -STD_ROM_PICK(shogwarrk) -STD_ROM_FN(shogwarrk) - -static struct BurnRomInfo shogwarruRomDesc[] = { - { "fb030a.u61", 0x020000, 0xa04106c6, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fb031a.u62", 0x020000, 0xd1def5e2, BRF_ESS | BRF_PRG }, // 1 - - { "fb040a.u33", 0x020000, 0x4b62c4d9, BRF_ESS | BRF_PRG }, // 2 MCU Data - - { "fb-020a.u1", 0x100000, 0x87e55c6d, BRF_GRA }, // 3 Sprites - { "fb020b.u2", 0x100000, 0x276b9d7b, BRF_GRA }, // 4 - { "fb021a.u3", 0x100000, 0x7da15d37, BRF_GRA }, // 5 - { "fb021b.u4", 0x100000, 0x6a512d7b, BRF_GRA }, // 6 - { "fb-22a.u5", 0x100000, 0x9039e5d3, BRF_GRA }, // 7 - { "fb-22b.u6", 0x100000, 0x96ac9e54, BRF_GRA }, // 8 - { "fb023.u7", 0x100000, 0x132794bd, BRF_GRA }, // 9 - - { "fb010.u65", 0x100000, 0x296ffd92, BRF_GRA }, // 10 Tiles (scrambled) - { "fb011.u66", 0x080000, 0x500a0367, BRF_GRA }, // 11 - - { "fb001e.u43", 0x080000, 0xf524aaa1, BRF_SND }, // 12 Samples - { "fb000e.u42", 0x080000, 0x969f1465, BRF_SND }, // 13 - - { "fb-002.u45", 0x100000, 0x010acc17, BRF_SND }, // 14 Samples - { "fb-003.u44", 0x100000, 0x0aea4ac5, BRF_SND }, // 15 -}; - -STD_ROM_PICK(shogwarru) -STD_ROM_FN(shogwarru) - -static struct BurnRomInfo fjbusterRomDesc[] = { - // Fujiyama Buster - Japan version of Shogun Warriors - { "fb030j.u61", 0x020000, 0x32ce7909, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fb031j.u62", 0x020000, 0x000c8c08, BRF_ESS | BRF_PRG }, // 1 - - { "fb040j.u33", 0x020000, 0x299d0746, BRF_ESS | BRF_PRG }, // 2 MCU Data - - { "fb-020a.u1", 0x100000, 0x87e55c6d, BRF_GRA }, // 3 Sprites - { "fb020b.u2", 0x100000, 0x276b9d7b, BRF_GRA }, // 4 - { "fb021a.u3", 0x100000, 0x7da15d37, BRF_GRA }, // 5 - { "fb021b.u4", 0x100000, 0x6a512d7b, BRF_GRA }, // 6 - { "fb-22a.u5", 0x100000, 0x9039e5d3, BRF_GRA }, // 7 - { "fb-22b.u6", 0x100000, 0x96ac9e54, BRF_GRA }, // 8 - { "fb023.u7", 0x100000, 0x132794bd, BRF_GRA }, // 9 - - { "fb010.u65", 0x100000, 0x296ffd92, BRF_GRA }, // 10 Tiles (scrambled) - { "fb011.u66", 0x080000, 0x500a0367, BRF_GRA }, // 11 - - { "fb000j.u43", 0x080000, 0xa7522555, BRF_SND }, // 12 Samples - { "fb001j_u.101", 0x080000, 0x07d4e8e2, BRF_SND }, // 13 - - { "fb-002.u45", 0x100000, 0x010acc17, BRF_SND }, // 14 Samples - { "fb-003.u44", 0x100000, 0x0aea4ac5, BRF_SND }, // 15 -}; - -STD_ROM_PICK(fjbuster) -STD_ROM_FN(fjbuster) - -static struct BurnRomInfo brapboysRomDesc[] = { - { "rb-030.01.u61", 0x020000, 0xccbe9a53, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "rb-031.01.u62", 0x020000, 0xc72b8dda, BRF_ESS | BRF_PRG }, // 1 - - { "rb-040.00.u33", 0x020000, 0x757c6e19, BRF_ESS | BRF_PRG }, // 2 MCU Data - - { "rb-020.u100", 0x100000, 0xce220d38, BRF_GRA }, // 3 Sprites - { "rb-021.u76", 0x100000, 0x74001407, BRF_GRA }, // 4 - { "rb-022.u77", 0x100000, 0xcb3f42dc, BRF_GRA }, // 5 - { "rb-023.u78", 0x100000, 0x0e6530c5, BRF_GRA }, // 6 - { "rb-024.u79", 0x080000, 0x65fa6447, BRF_GRA }, // 7 - { "rb-025.01.u80", 0x040000, 0x36cd6b90, BRF_GRA }, // 8 - - { "rb-010.u65", 0x100000, 0xffd73f87, BRF_GRA }, // 9 Tiles (scrambled) - { "rb-011.u66", 0x100000, 0xd9325f78, BRF_GRA }, // 10 - { "rb-012.u67", 0x100000, 0xbfdbe0d1, BRF_GRA }, // 11 - { "rb-013.u68", 0x100000, 0x28c37fe8, BRF_GRA }, // 12 - - { "rb-000.u43", 0x080000, 0x58ad1a62, BRF_SND }, // 13 Samples - { "rb-003.00.u101", 0x080000, 0x2cac25d7, BRF_SND }, // 14 - - { "rb-001.u44", 0x100000, 0x7cf774b3, BRF_SND }, // 15 Samples - { "rb-002.u45", 0x100000, 0xe4b30444, BRF_SND }, // 16 -}; - -STD_ROM_PICK(brapboys) -STD_ROM_FN(brapboys) -static struct BurnRomInfo brapboysjRomDesc[] = { - { "rb-004.u61", 0x020000, 0x5432442c, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "rb-005.u62", 0x020000, 0x118b3cfb, BRF_ESS | BRF_PRG }, // 1 - - { "rb-006.u33", 0x020000, 0xf1d76b20, BRF_ESS | BRF_PRG }, // 2 MCU Data - - { "rb-020.u100", 0x100000, 0xce220d38, BRF_GRA }, // 3 Sprites - { "rb-021.u76", 0x100000, 0x74001407, BRF_GRA }, // 4 - { "rb-022.u77", 0x100000, 0xcb3f42dc, BRF_GRA }, // 5 - { "rb-023.u78", 0x100000, 0x0e6530c5, BRF_GRA }, // 6 - { "rb-024.u79", 0x080000, 0x65fa6447, BRF_GRA }, // 7 - { "rb-025.u80a", 0x080000, 0xaa795ba5, BRF_GRA }, // 8 - - { "rb-010.u65", 0x100000, 0xffd73f87, BRF_GRA }, // 9 Tiles (scrambled) - { "rb-011.u66", 0x100000, 0xd9325f78, BRF_GRA }, // 10 - { "rb-012.u67", 0x100000, 0xbfdbe0d1, BRF_GRA }, // 11 - { "rb-013.u68", 0x100000, 0x28c37fe8, BRF_GRA }, // 12 - - { "rb-000.u43", 0x080000, 0x58ad1a62, BRF_SND }, // 13 Samples - { "rb-003.00.u101", 0x080000, 0x2cac25d7, BRF_SND }, // 14 - - { "rb-001.u44", 0x100000, 0x7cf774b3, BRF_SND }, // 15 Samples - { "rb-002.u45", 0x100000, 0xe4b30444, BRF_SND }, // 16 - - { "rb-026.u80b", 0x080000, 0xbb7604d4, BRF_GRA }, // 17 Sprites (Extra) -}; - -STD_ROM_PICK(brapboysj) -STD_ROM_FN(brapboysj) - -static struct BurnRomInfo brapboysuRomDesc[] = { - { "rb-030.10.u61", 0x020000, 0x527eb92a, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "rb-031.10.u62", 0x020000, 0xd5962bdd, BRF_ESS | BRF_PRG }, // 1 - - { "rb-040.10.u33", 0x020000, 0x0c90d758, BRF_ESS | BRF_PRG }, // 2 MCU Data - - { "rb-020.u100", 0x100000, 0xce220d38, BRF_GRA }, // 3 Sprites - { "rb-021.u76", 0x100000, 0x74001407, BRF_GRA }, // 4 - { "rb-022.u77", 0x100000, 0xcb3f42dc, BRF_GRA }, // 5 - { "rb-023.u78", 0x100000, 0x0e6530c5, BRF_GRA }, // 6 - { "rb-024.u79", 0x080000, 0x65fa6447, BRF_GRA }, // 7 - { "rb-025.10.u80a", 0x080000, 0x140fe400, BRF_GRA }, // 8 - - { "rb-010.u65", 0x100000, 0xffd73f87, BRF_GRA }, // 9 Tiles (scrambled) - { "rb-011.u66", 0x100000, 0xd9325f78, BRF_GRA }, // 10 - { "rb-012.u67", 0x100000, 0xbfdbe0d1, BRF_GRA }, // 11 - { "rb-013.u68", 0x100000, 0x28c37fe8, BRF_GRA }, // 12 - - { "rb-000.u43", 0x080000, 0x58ad1a62, BRF_SND }, // 13 Samples - { "rb-003.00.u101", 0x080000, 0x2cac25d7, BRF_SND }, // 14 - - { "rb-001.u44", 0x100000, 0x7cf774b3, BRF_SND }, // 15 Samples - { "rb-002.u45", 0x100000, 0xe4b30444, BRF_SND }, // 16 - - { "rb-026.10.u80b", 0x080000, 0xbb7604d4, BRF_GRA }, // 17 Sprites (Extra) -}; - -STD_ROM_PICK(brapboysu) -STD_ROM_FN(brapboysu) - - -/*============================================================================================== -Graphics Decoding -===============================================================================================*/ - -static void Kaneko16DecodeBg15Bitmaps() -{ - INT32 sx, x, y; - - for (sx = 0; sx < 32; sx++) { - for (x = 0; x < 256; x++) { - for (y = 0; y < 256; y++) { - INT32 addr = (sx * 256 * 256) + (y * 256) + x; - INT32 data = (Kaneko16TempGfx[addr * 2 + 0] * 256) + Kaneko16TempGfx[addr * 2 + 1]; - INT32 r, g, b; - - r = (data & 0x07c0) >> 6; - g = (data & 0xf800) >> 11; - b = (data & 0x003e) >> 1; - - r ^= 0x09; - - if (~g & 0x08) g ^= 0x010; - g = (g - 1) & 0x1f; - - b ^= 0x03; - if (~b & 0x08) b ^= 0x10; - b = (b + 2) & 0x1f; - - if ((r & 0x10) && (b & 0x10)) g = (g - 1) & 0x1f; - - Kaneko16Bg15Data[addr] = 2048 + ((g << 10) | (r << 5) | b); - } - } - } -} - -INT32 spritepriomask[4] = { 2, 3, 5, 7 }; // Default for Wingforc - -static void Kaneko16SpritePrio(INT32 pri0, INT32 pri1, INT32 pri2, INT32 pri3) -{ - spritepriomask[0] = pri0; - spritepriomask[1] = pri1; - spritepriomask[2] = pri2; - spritepriomask[3] = pri3; -} - -/*============================================================================================== -Unscramble Tile/Sound ROM Functions -===============================================================================================*/ - -static void UnscrambleTiles(INT32 length) -{ - UINT8 *RAM = Kaneko16TempGfx; - INT32 i; - - if (RAM == NULL) return; - - for (i = 0; i < length; i ++) - { - RAM[i] = ((RAM[i] & 0xF0)>>4) + ((RAM[i] & 0x0F)<<4); - } -} - -static void ExpandSampleBanks() -{ - INT32 bank; - - for (bank = 15; bank > 0; bank--) - { - UINT8 *src0 = MSM6295ROMData; - UINT8 *srcn = src0 + 0x10000 * (bank < 3 ? 3 : bank); - UINT8 *dst = src0 + 0x40000 * bank; - - memcpy(dst + 0x30000, srcn + 0x00000, 0x10000); - memcpy(dst + 0x00000, src0 + 0x00000, 0x30000); - } -} - -/*============================================================================================== -Allocate Memory -===============================================================================================*/ - -static INT32 GtmrMemIndex() -{ - UINT8 *Next; Next = Mem; - - Kaneko16Rom = Next; Next += 0x100000; - MSM6295ROM = Next; Next += 0x140000; - MSM6295ROMData = Next; Next += 0x400000; - MSM6295ROMData2 = Next; Next += 0x300000; - - RamStart = Next; - - Kaneko16Ram = Next; Next += 0x028000; - Kaneko16MCURam = Next; Next += 0x010000; - Kaneko16NVRam = Next; Next += 0x000100; - Kaneko16PaletteRam = Next; Next += 0x010000; - Kaneko16SpriteRam = Next; Next += Kaneko16SpriteRamSize; - Kaneko16Video0Ram = Next; Next += 0x001000; - Kaneko16Video1Ram = Next; Next += 0x001000; - Kaneko16Video2Ram = Next; Next += 0x001000; - Kaneko16Video3Ram = Next; Next += 0x001000; - Kaneko16VScrl0Ram = Next; Next += 0x001000; - Kaneko16VScrl1Ram = Next; Next += 0x001000; - Kaneko16VScrl2Ram = Next; Next += 0x001000; - Kaneko16VScrl3Ram = Next; Next += 0x001000; - - RamEnd = Next; - - Kaneko16Sprites = Next; Next += (Kaneko16NumSprites * 16 * 16); - Kaneko16Tiles = Next; Next += (Kaneko16NumTiles * 16 * 16); - LayerQueueXY[0] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueXY[1] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[0] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[1] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueuePriority[0] = Next; Next += nScreenWidth * nScreenHeight; - LayerQueuePriority[1] = Next; Next += nScreenWidth * nScreenHeight; - if (Kaneko16NumTiles2) { - Kaneko16Tiles2 = Next; Next += (Kaneko16NumTiles2 * 16 * 16); - LayerQueueXY[2] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueXY[3] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[2] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[3] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueuePriority[2] = Next; Next += nScreenWidth * nScreenHeight; - LayerQueuePriority[3] = Next; Next += nScreenWidth * nScreenHeight; - } - Kaneko16Palette = (UINT32*)Next; Next += 0x010000 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 ExplbrkrMemIndex() -{ - UINT8 *Next; Next = Mem; - - Kaneko16Rom = Next; Next += 0x080000; - MSM6295ROM = Next; Next += 0x040000; - MSM6295ROMData = Next; Next += 0x200000; - - RamStart = Next; - - Kaneko16Ram = Next; Next += 0x010000; - Kaneko16PaletteRam = Next; Next += 0x001000; - Kaneko16SpriteRam = Next; Next += Kaneko16SpriteRamSize; - Kaneko16Video0Ram = Next; Next += 0x001000; - Kaneko16Video1Ram = Next; Next += 0x001000; - Kaneko16Video2Ram = Next; Next += 0x001000; - Kaneko16Video3Ram = Next; Next += 0x001000; - Kaneko16VScrl0Ram = Next; Next += 0x001000; - Kaneko16VScrl1Ram = Next; Next += 0x001000; - Kaneko16VScrl2Ram = Next; Next += 0x001000; - Kaneko16VScrl3Ram = Next; Next += 0x001000; - - RamEnd = Next; - - Kaneko16Sprites = Next; Next += (Kaneko16NumSprites * 16 * 16); - Kaneko16Tiles = Next; Next += (Kaneko16NumTiles * 16 * 16); - LayerQueueXY[0] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueXY[1] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[0] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[1] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueuePriority[0] = Next; Next += nScreenWidth * nScreenHeight; - LayerQueuePriority[1] = Next; Next += nScreenWidth * nScreenHeight; - if (Kaneko16NumTiles2) { - Kaneko16Tiles2 = Next; Next += (Kaneko16NumTiles2 * 16 * 16); - LayerQueueXY[2] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueXY[3] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[2] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[3] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueuePriority[2] = Next; Next += nScreenWidth * nScreenHeight; - LayerQueuePriority[3] = Next; Next += nScreenWidth * nScreenHeight; - } - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 6 * sizeof(INT16); - if (Kaneko16Bg15) { - Kaneko16Bg15Data = (UINT16*)Next; Next += (32 * 256 * 256) * sizeof(UINT16); // 32 bitmaps - 256 x 256 - Kaneko16Palette = (UINT32*)Next; Next += (0x001000 + 32768) * sizeof(UINT32); - } else { - Kaneko16Palette = (UINT32*)Next; Next += 0x001000 * sizeof(UINT32); - } - MemEnd = Next; - - return 0; -} - -static INT32 BlazeonMemIndex() -{ - UINT8 *Next; Next = Mem; - - Kaneko16Rom = Next; Next += 0x100000; - Kaneko16Z80Rom = Next; Next += 0x020000; - - MSM6295ROM = Next; Next += 0x040000; - MSM6295ROMData = Next; Next += 0x0c0000; - DrvPrioBitmap = Next; Next += 320 * 256; - - RamStart = Next; - - Kaneko16Ram = Next; Next += 0x010000; - Kaneko16Z80Ram = Next; Next += 0x002000; - Kaneko16PaletteRam = Next; Next += 0x001000; - Kaneko16SpriteRam = Next; Next += Kaneko16SpriteRamSize; - Kaneko16Video0Ram = Next; Next += 0x001000; - Kaneko16Video1Ram = Next; Next += 0x001000; - Kaneko16VScrl0Ram = Next; Next += 0x001000; - Kaneko16VScrl1Ram = Next; Next += 0x001000; - - RamEnd = Next; - - Kaneko16Sprites = Next; Next += (Kaneko16NumSprites * 16 * 16); - Kaneko16Tiles = Next; Next += (Kaneko16NumTiles * 16 * 16); - LayerQueueXY[0] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueXY[1] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[0] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[1] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueuePriority[0] = Next; Next += nScreenWidth * nScreenHeight; - LayerQueuePriority[1] = Next; Next += nScreenWidth * nScreenHeight; - Kaneko16Palette = (UINT32*)Next; Next += 0x001000 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 ShogwarrMemIndex() -{ - UINT8 *Next; Next = Mem; - - Kaneko16Rom = Next; Next += 0x040000; - Kaneko16McuRom = Next; Next += 0x020000; - MSM6295ROM = Next; Next += 0x140000; - MSM6295ROMData = Next; Next += 0x100000; - MSM6295ROMData2 = Next; Next += 0x200000; - - Kaneko16NVRam = Next; Next += 0x000100; - - RamStart = Next; - - Kaneko16Ram = Next; Next += 0x010000; - Kaneko16MCURam = Next; Next += 0x010000; - Kaneko16PaletteRam = Next; Next += 0x010000; - Kaneko16SpriteRam = Next; Next += Kaneko16SpriteRamSize; - Kaneko16Video0Ram = Next; Next += 0x001000; - Kaneko16Video1Ram = Next; Next += 0x001000; - Kaneko16VScrl0Ram = Next; Next += 0x001000; - Kaneko16VScrl1Ram = Next; Next += 0x001000; - - RamEnd = Next; - - Kaneko16Sprites = Next; Next += (Kaneko16NumSprites * 16 * 16); - Kaneko16Tiles = Next; Next += (Kaneko16NumTiles * 16 * 16); - LayerQueueXY[0] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueXY[1] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[0] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueueColour[1] = (UINT32*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT32); - LayerQueuePriority[0] = Next; Next += nScreenWidth * nScreenHeight; - LayerQueuePriority[1] = Next; Next += nScreenWidth * nScreenHeight; - - Kaneko16Palette = (UINT32*)Next; Next += 0x010000 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -/*============================================================================================== -Protection Calculator -===============================================================================================*/ - -static struct { - UINT16 x1p, y1p, x1s, y1s; - UINT16 x2p, y2p, x2s, y2s; - - INT16 x12, y12, x21, y21; - - UINT16 mult_a, mult_b; -} hit; - -static INT16 calc_compute_x(void) -{ - INT16 x_coll; - - // X distance - if ((hit.x2p >= hit.x1p) && (hit.x2p < (hit.x1p + hit.x1s))) // x2p inside x1 - x_coll = (hit.x1s - (hit.x2p - hit.x1p)); - else if ((hit.x1p >= hit.x2p) && (hit.x1p < (hit.x2p + hit.x2s))) // x1p inside x2 - x_coll = (hit.x2s - (hit.x1p - hit.x2p)); - else // normal/no overlap - x_coll = ((hit.x1s + hit.x2s)/2) - abs((hit.x1p + hit.x1s/2) - (hit.x2p + hit.x2s/2)); - - return x_coll; -} -static INT16 calc_compute_y(void) -{ - INT16 y_coll; - - // Y distance - if ((hit.y2p >= hit.y1p) && (hit.y2p < (hit.y1p + hit.y1s))) // y2p inside y1 - y_coll = (hit.y1s - (hit.y2p - hit.y1p)); - else if ((hit.y1p >= hit.y2p) && (hit.y1p < (hit.y2p + hit.y2s))) // y1p inside y2 - y_coll = (hit.y2s - (hit.y1p - hit.y2p)); - else // normal/no overlap - y_coll = ((hit.y1s + hit.y2s)/2) - abs((hit.y1p + hit.y1s/2) - (hit.y2p + hit.y2s/2)); - - return y_coll; -} - -static UINT16 BloodwarCalcRead(INT32 offset) -{ - UINT16 data = 0; - INT16 x_coll, y_coll; - - x_coll = calc_compute_x(); - y_coll = calc_compute_y(); - - switch (offset) - { - case 0x00/2: // X distance - return x_coll; - - case 0x02/2: // Y distance - return y_coll; - - case 0x04/2: // similar to the hit detection from SuperNova, but much simpler - - // 4th nibble: Y Absolute Collision -> possible values = 9,8,4,3,2 - if (hit.y1p > hit.y2p) data |= 0x2000; - else if (hit.y1p == hit.y2p) data |= 0x4000; - else if (hit.y1p < hit.y2p) data |= 0x8000; - if (y_coll<0) data |= 0x1000; - - // 3rd nibble: X Absolute Collision -> possible values = 9,8,4,3,2 - if (hit.x1p > hit.x2p) data |= 0x0200; - else if (hit.x1p == hit.x2p) data |= 0x0400; - else if (hit.x1p < hit.x2p) data |= 0x0800; - if (x_coll<0) data |= 0x0100; - - // 2nd nibble: always set to 4 - data |= 0x0040; - - // 1st nibble: XY Overlap Collision -> possible values = 0,2,4,f - if (x_coll>=0) data |= 0x0004; - if (y_coll>=0) data |= 0x0002; - if ((x_coll>=0)&&(y_coll>=0)) data |= 0x000F; - - return data; - - case 0x14/2: - return BurnRandom() & 0xffff; - - case 0x20/2: return hit.x1p; - case 0x22/2: return hit.x1s; - case 0x24/2: return hit.y1p; - case 0x26/2: return hit.y1s; - - case 0x2c/2: return hit.x2p; - case 0x2e/2: return hit.x2s; - case 0x30/2: return hit.y2p; - case 0x32/2: return hit.y2s; - } - - return 0; -} - -static UINT16 BonkadvCalcRead(INT32 offset) -{ - UINT16 data = 0; - - switch (offset) - { - case 0x00/2: // watchdog - return 0; - - case 0x02/2: // unknown (yet!), used by *MANY* games !!! - break; - - case 0x04/2: // similar to the hit detection from SuperNova, but much simpler - - // X Absolute Collision - if (hit.x1p > hit.x2p) data |= 0x0200; - else if (hit.x1p == hit.x2p) data |= 0x0400; - else if (hit.x1p < hit.x2p) data |= 0x0800; - - // Y Absolute Collision - if (hit.y1p > hit.y2p) data |= 0x2000; - else if (hit.y1p == hit.y2p) data |= 0x4000; - else if (hit.y1p < hit.y2p) data |= 0x8000; - - // XY Overlap Collision - hit.x12 = (hit.x1p) - (hit.x2p + hit.x2s); - hit.y12 = (hit.y1p) - (hit.y2p + hit.y2s); - hit.x21 = (hit.x1p + hit.x1s) - (hit.x2p); - hit.y21 = (hit.y1p + hit.y1s) - (hit.y2p); - - if ((hit.x12 < 0) && (hit.y12 < 0) && - (hit.x21 >= 0) && (hit.y21 >= 0)) - data |= 0x0001; - - return data; - - case 0x10/2: - return (((UINT32)hit.mult_a * (UINT32)hit.mult_b) >> 16); - case 0x12/2: - return (((UINT32)hit.mult_a * (UINT32)hit.mult_b) & 0xffff); - - case 0x14/2: - return BurnRandom() & 0xffff; - } - - return 0; -} - -static void BloodwarCalcWrite(INT32 offset, UINT16 data) -{ - switch (offset) { - case 0x20 >> 1: hit.x1p = data; return; - case 0x22 >> 1: hit.x1s = data; return; - case 0x24 >> 1: hit.y1p = data; return; - case 0x26 >> 1: hit.y1s = data; return; - - case 0x2c >> 1: hit.x2p = data; return; - case 0x2e >> 1: hit.x2s = data; return; - case 0x30 >> 1: hit.y2p = data; return; - case 0x32 >> 1: hit.y2s = data; return; - } -} - -static void BonkadvCalcWrite(INT32 offset, UINT16 data) -{ - switch (offset) { - case 0x00 >> 1: hit.x1p = data; return; - case 0x02 >> 1: hit.x1s = data; return; - case 0x04 >> 1: hit.y1p = data; return; - case 0x06 >> 1: hit.y1s = data; return; - case 0x08 >> 1: hit.x2p = data; return; - case 0x0a >> 1: hit.x2s = data; return; - case 0x0c >> 1: hit.y2p = data; return; - case 0x0e >> 1: hit.y2s = data; return; - case 0x10 >> 1: hit.mult_a = data; return; - case 0x12 >> 1: hit.mult_b = data; return; - } -} - -/*============================================================================================== -Protection Calculator - Brapboys & shogwarr -===============================================================================================*/ - -struct calc3_t -{ - int mcu_status; - int mcu_command_offset; - UINT16 mcu_crc; - UINT8 decryption_key_byte; - UINT8 alternateswaps; - UINT8 shift; - UINT8 subtracttype; - UINT8 mode; - UINT8 blocksize_offset; - UINT16 dataend; - UINT16 database; - int data_header[2]; - UINT32 writeaddress; - UINT32 writeaddress_current; - UINT16 dsw_addr; - UINT16 eeprom_addr; - UINT16 poll_addr; - UINT16 checksumaddress; -}; - -static calc3_t m_calc3; - -struct calc3_hit_t -{ - int x1p, y1p, z1p, x1s, y1s, z1s; - int x2p, y2p, z2p, x2s, y2s, z2s; - - int x1po, y1po, z1po, x1so, y1so, z1so; - int x2po, y2po, z2po, x2so, y2so, z2so; - - int x12, y12, z12, x21, y21, z21; - - int x_coll, y_coll, z_coll; - - int x1tox2, y1toy2, z1toz2; - - UINT16 mult_a, mult_b; - - UINT16 flags; - UINT16 mode; -}; - -static calc3_hit_t m_hit3; - -static int type2_calc_compute(int x1, int w1, int x2, int w2) -{ - int dist; - - if(x2>=x1 && x2+w2<=(x1+w1)) - { - //x2 inside x1 - dist=w2; - } - else - { - if(x1>=x2 && x1+w1<=(x2+w2)) - { - //x1 inside x2 - dist=w1; - } - else - { - if(x2>0)&3, hit3.x1po, hit3.x1so, &hit3.x1p, &hit3.x1s); - type2_calc_org((mode>>2)&3, hit3.y1po, hit3.y1so, &hit3.y1p, &hit3.y1s); - type2_calc_org((mode>>4)&3, hit3.z1po, hit3.z1so, &hit3.z1p, &hit3.z1s); - - type2_calc_org((mode>>8)&3, hit3.x2po, hit3.x2so, &hit3.x2p, &hit3.x2s); - type2_calc_org((mode>>10)&3, hit3.y2po, hit3.y2so, &hit3.y2p, &hit3.y2s); - type2_calc_org((mode>>12)&3, hit3.z2po, hit3.z2so, &hit3.z2p, &hit3.z2s); - - hit3.x1tox2=abs(hit3.x2po-hit3.x1po); - hit3.y1toy2=abs(hit3.y2po-hit3.y1po); - hit3.z1toz2=abs(hit3.z2po-hit3.z1po); - - hit3.x_coll = type2_calc_compute(hit3.x1p, hit3.x1s, hit3.x2p, hit3.x2s); - hit3.y_coll = type2_calc_compute(hit3.y1p, hit3.y1s, hit3.y2p, hit3.y2s); - hit3.z_coll = type2_calc_compute(hit3.z1p, hit3.z1s, hit3.z2p, hit3.z2s); - - // 4th nibble: Y Absolute Collision -> possible values = 9,8,4,3,2 - if (hit3.y1p > hit3.y2p) hit3.flags |= 0x2000; - else if (hit3.y1p == hit3.y2p) hit3.flags |= 0x4000; - else if (hit3.y1p < hit3.y2p) hit3.flags |= 0x8000; - if (hit3.y_coll<0) hit3.flags |= 0x1000; - - // 3rd nibble: X Absolute Collision -> possible values = 9,8,4,3,2 - if (hit3.x1p > hit3.x2p) hit3.flags |= 0x0200; - else if (hit3.x1p == hit3.x2p) hit3.flags |= 0x0400; - else if (hit3.x1p < hit3.x2p) hit3.flags |= 0x0800; - if (hit3.x_coll<0) hit3.flags |= 0x0100; - - // 2nd nibble: Z Absolute Collision -> possible values = 9,8,4,3,2 - if (hit3.z1p > hit3.z2p) hit3.flags |= 0x0020; - else if (hit3.z1p == hit3.z2p) hit3.flags |= 0x0040; - else if (hit3.z1p < hit3.z2p) hit3.flags |= 0x0080; - if (hit3.z_coll<0) hit3.flags |= 0x0010; - - // 1st nibble: XYZ Overlap Collision - if ((hit3.x_coll>=0)&&(hit3.y_coll>=0)&&(hit3.z_coll>=0)) hit3.flags |= 0x0008; - if ((hit3.x_coll>=0)&&(hit3.z_coll>=0)) hit3.flags |= 0x0004; - if ((hit3.y_coll>=0)&&(hit3.z_coll>=0)) hit3.flags |= 0x0002; - if ((hit3.x_coll>=0)&&(hit3.y_coll>=0)) hit3.flags |= 0x0001; -} - -static void kaneko_hit_type2_write(INT32 offset, UINT16 data) -{ - calc3_hit_t &hit3 = m_hit3; - int idx=offset*4; - switch (idx) - { - case 0x00: - case 0x28: hit3.x1po = data; break; - case 0x04: - case 0x2c: hit3.x1so = data; break; - case 0x08: - case 0x30: hit3.y1po = data; break; - case 0x0c: - case 0x34: hit3.y1so = data; break; - case 0x10: - case 0x58: hit3.x2po = data; break; - case 0x14: - case 0x5c: hit3.x2so = data; break; - case 0x18: - case 0x60: hit3.y2po = data; break; - case 0x1c: - case 0x64: hit3.y2so = data; break; - case 0x38: - case 0x50: hit3.z1po = data; break; - case 0x3c: - case 0x54: hit3.z1so = data; break; - case 0x20: - case 0x68: hit3.z2po = data; break; - case 0x24: - case 0x6c: hit3.z2so = data; break; - case 0x70: hit3.mode=data;break; - - // default: - // logerror("CPU #0 PC %06x: warning - write unmapped hit address %06x [ %06x] = %06x\n",space.device().safe_pc(),offset<<1, idx, data); - } - - type2_recalc_collisions(hit3); -} - -static UINT16 kaneko_hit_type2_read(INT32 offset) -{ - calc3_hit_t &hit3 = m_hit3; - int idx=offset*4; - -// bprintf (0, _T("HITR: %x\n"), idx); - - switch (idx) - { - case 0x00: // X distance - case 0x10: - return hit3.x_coll; - - case 0x04: // Y distance - case 0x14: - return hit3.y_coll; - - case 0x18: // Z distance - return hit3.z_coll; - - case 0x08: - case 0x1c: - return hit3.flags; - - case 0x28: - return (BurnRandom() & 0xffff); - - case 0x40: return hit3.x1po; - case 0x44: return hit3.x1so; - case 0x48: return hit3.y1po; - case 0x4c: return hit3.y1so; - case 0x50: return hit3.z1po; - case 0x54: return hit3.z1so; - - case 0x58: return hit3.x2po; - case 0x5c: return hit3.x2so; - case 0x60: return hit3.y2po; - case 0x64: return hit3.y2so; - case 0x68: return hit3.z2po; - case 0x6c: return hit3.z2so; - - case 0x80: return hit3.x1tox2; - case 0x84: return hit3.y1toy2; - case 0x88: return hit3.z1toz2; - - //default: - // logerror("CPU #0 PC %06x: warning - read unmapped calc address %06x [ %06x]\n",space.device().safe_pc(),offset<<1, idx); - } - - return 0; -} - -static UINT8 shift_bits(UINT8 dat, int bits) -{ - bits &=0x7; - - if (bits==0) return BITSWAP08(dat, 7,6,5,4,3,2,1,0); - if (bits==1) return BITSWAP08(dat, 6,5,4,3,2,1,0,7); - if (bits==2) return BITSWAP08(dat, 5,4,3,2,1,0,7,6); - if (bits==3) return BITSWAP08(dat, 4,3,2,1,0,7,6,5); - if (bits==4) return BITSWAP08(dat, 3,2,1,0,7,6,5,4); - if (bits==5) return BITSWAP08(dat, 2,1,0,7,6,5,4,3); - if (bits==6) return BITSWAP08(dat, 1,0,7,6,5,4,3,2); - if (bits==7) return BITSWAP08(dat, 0,7,6,5,4,3,2,1); - - return dat; -} - -static int calc3_decompress_table(int tabnum, UINT8* dstram, int dstoffset) -{ - calc3_t &calc3 = m_calc3; - - UINT8* datarom = Kaneko16McuRom; - - UINT8 numregions; - UINT16 length; - int local_counter=0; - int x; - int offset = 0; - - numregions = datarom[offset+0]; - - if (tabnum > numregions) - { - return 0; - } - - datarom++; - - for (x=0;x>4; - calc3.subtracttype = (calc3.alternateswaps &0x03); - calc3.alternateswaps &= 0x0c; - calc3.alternateswaps >>=2; - - calc3.decryption_key_byte = datarom[offset+3]; - - if (calc3.blocksize_offset>3) - { - inline_table_base = offset+4; - inline_table_size = calc3.blocksize_offset-3; - } - - offset+= calc3.blocksize_offset+1; - length = datarom[offset+0] | (datarom[offset+1]<<8); - offset+=2; - - { - int i; - - if (length==0x00) - { - if (calc3.mode==0x06) - { - calc3.writeaddress_current = 0x202000; - //calc3.writeaddress_current = 0x20c000; - } - else if (calc3.mode==0x07) - { - // also calls empty table with Mode? 07 - // maybe they reset to different points? - } - else if (calc3.mode==0x08 && !dstram) - { - UINT8 *eeprom = (UINT8*)Kaneko16NVRam; - - for (i=0;i<0x80;i++) - { - eeprom[i^1] = SekReadByte(calc3.eeprom_addr+0x200000+i); - } - } - - return 0; - } - - if (inline_table_size) - { - UINT8 extra[] = { 0x14,0xf0,0xf8,0xd2,0xbe,0xfc,0xac,0x86,0x64,0x08,0x0c,0x74,0xd6,0x6a,0x24,0x12,0x1a,0x72,0xba,0x48,0x76,0x66,0x4a,0x7c,0x5c,0x82,0x0a,0x86,0x82,0x02,0xe6 }; - UINT8 extra2[] = { 0x2f,0x04,0xd1,0x69,0xad,0xeb,0x10,0x95,0xb0,0x2f,0x0a,0x83,0x7d,0x4e,0x2a,0x07,0x89,0x52,0xca,0x41,0xf1,0x4f,0xaf,0x1c,0x01,0xe9,0x89,0xd2,0xaf,0xcd }; - - for (i=0;i>1]; - } - } - else - { - if ( ((i / inline_table_size)&1)==0) - { - if (((i%inline_table_size)&1)==1) - { - UINT8 inlinet = datarom[inline_table_base + (i%inline_table_size)]; - dat = datarom[offset+i]; - dat -= inlinet; - dat = shift_bits(dat, calc3.shift); - } - else - { - UINT8 inlinet = datarom[inline_table_base + (i%inline_table_size)]; - dat = datarom[offset+i]; - - if (calc3.subtracttype!=0x02) - { - dat -= inlinet; - dat -= extra[(i%inline_table_size)>>1]; - } - else - { - dat += inlinet; - dat += extra[(i%inline_table_size)>>1]; - } - - dat = shift_bits(dat, 8-calc3.shift); - } - } - else - { - if (((i%inline_table_size)&1)==0) - { - UINT8 inlinet = datarom[inline_table_base + (i%inline_table_size)]; - dat = datarom[offset+i]; - dat -= inlinet; - dat = shift_bits(dat, calc3.shift); - } - else - { - dat = datarom[offset+i]; - - if (calc3.subtracttype!=0x02) - { - dat -= extra2[(i%inline_table_size)>>1]; - } - else - { - dat += extra2[(i%inline_table_size)>>1]; - } - dat = shift_bits(dat, 8-calc3.shift); - } - } - } - - if(local_counter>1) - { - SekWriteByte((dstoffset+i), dat); - - // debug, used to output tables at the start - if (dstram) - { - dstram[(dstoffset+i)^1] = dat; - } - } - else - calc3.data_header[local_counter]=dat; - - ++local_counter; - } - } - else - { - const INT16* key = calc3_keydata+(calc3.decryption_key_byte*0x40); - - for (i=0;i1) - { - SekWriteByte((dstoffset+i), dat); - - // debug, used to output tables at the start - if (dstram) - { - dstram[(dstoffset+i)^1] = dat; - } - } - else - calc3.data_header[local_counter]=dat; - - ++local_counter; - } - } - } - - calc3.dataend = offset+length+1; - } - - return length; -} - -static void shogwarr_calc3_mcu_run() -{ - calc3_t &calc3 = m_calc3; - UINT16 mcu_command; - UINT16 *m_calc3_mcuram = (UINT16*)(Kaneko16MCURam); - - if (calc3.mcu_status != (1|2|4|8)) return; - - if (calc3.dsw_addr) SekWriteByte((calc3.dsw_addr+0x200000), (~Kaneko16Dip[0])&0xff); - - mcu_command = m_calc3_mcuram[calc3.mcu_command_offset/2 + 0]; - - if (mcu_command == 0) return; - - if (mcu_command>0) - { - if (mcu_command == 0xff) - { - // clear old command (handshake to main cpu) - m_calc3_mcuram[(calc3.mcu_command_offset>>1)+0] = 0x0000; - - calc3.dsw_addr = m_calc3_mcuram[(0>>1) + 1]; - calc3.eeprom_addr = m_calc3_mcuram[(0>>1) + 2]; - calc3.mcu_command_offset = m_calc3_mcuram[(0>>1) + 3]; - calc3.poll_addr = m_calc3_mcuram[(0>>1) + 4]; - calc3.checksumaddress = m_calc3_mcuram[(0>>1) + 5]; - calc3.writeaddress = (m_calc3_mcuram[(0>>1) + 6] << 16) | (m_calc3_mcuram[(0>>1) + 7]); - - // set our current write / stack pointer to the address specified - calc3.writeaddress_current = calc3.writeaddress; - - m_calc3_mcuram[calc3.checksumaddress / 2] = calc3.mcu_crc; // MCU Rom Checksum! - - UINT8 *eeprom = (UINT8*)Kaneko16NVRam; - - for (INT32 i=0;i<0x80;i++) - { - SekWriteByte((calc3.eeprom_addr+0x200000+i), eeprom[i^1]); - } - } - else - { - int num_transfers = mcu_command; - - // clear old command (handshake to main cpu) - m_calc3_mcuram[calc3.mcu_command_offset>>1] = 0x0000; - - for (INT32 i=0;i>1) + 1 + (2*i)]; - int param2 = m_calc3_mcuram[(calc3.mcu_command_offset>>1) + 2 + (2*i)]; - UINT8 commandtabl = (param1&0xff00) >> 8; - UINT16 commandaddr =param2; - UINT8 commandunk = (param1&0x00ff); - { - int length = calc3_decompress_table(commandtabl, 0, calc3.writeaddress_current-2); - - if (length) - { - int write=commandaddr; - - SekWriteByte((write+0x200000), calc3.data_header[0]); - SekWriteByte((write+0x200001), calc3.data_header[1]); - - write=commandaddr+(char)commandunk; - - SekWriteWord(write+0x200000, (calc3.writeaddress_current>>16)&0xffff); - SekWriteWord(write+0x200002, (calc3.writeaddress_current&0xffff)); - - calc3.writeaddress_current += ((length+3)&(~1)); - } - } - } - } - } - - if (Shogwarr == 0) { // Hack to get us past brapboys calc test - if (Kaneko16MCURam[0xE3] == 0x7F) { - Kaneko16MCURam[0xE3] |= 0x80; - } - } -} - -static void shogwarr_initial_scan_tables() -{ - calc3_t &calc3 = m_calc3; - - UINT8* datarom = Kaneko16McuRom; - - calc3.mcu_crc = 0; - - for (INT32 x=0;x<0x20000;x++) - { - calc3.mcu_crc+=datarom[x]; - } -} - -/*============================================================================================== -Toybox MCU -===============================================================================================*/ - -static void ToyboxMCUInit() -{ - memset(ToyboxMCUCom, 0, 4 * sizeof(UINT16)); -} - -static UINT16 ToyboxMCUStatusRead() -{ - return 0; -} - -#define MCU_RESPONSE(d) memcpy(&MCURam[MCUOffset], d, sizeof(d)) - -static void BloodwarMCURun() -{ - UINT16 *MCURam = (UINT16*)Kaneko16MCURam; - UINT16 *NVRam = (UINT16*)Kaneko16NVRam; - - UINT16 MCUCommand = MCURam[0x10/2]; - UINT16 MCUOffset = MCURam[0x12/2] >> 1; - UINT16 MCUData = MCURam[0x14/2]; - - switch (MCUCommand >> 8) { - case 0x02: { - memcpy(MCURam + MCUOffset, NVRam, 128); - return; - } - - case 0x03: { - MCURam[MCUOffset + 0] = 0xff00 - (Kaneko16Dip[0] << 8); - return; - } - - case 0x04: { - switch (MCUData) { - // unknown purpose data - case 0x01: MCU_RESPONSE(bloodwar_mcu_4_01); break; // Warrior 1 - case 0x02: MCU_RESPONSE(bloodwar_mcu_4_02); break; // Warrior 2 - case 0x03: MCU_RESPONSE(bloodwar_mcu_4_03); break; // Warrior 3 - case 0x04: MCU_RESPONSE(bloodwar_mcu_4_04); break; // Warrior 4 - case 0x05: MCU_RESPONSE(bloodwar_mcu_4_05); break; // Warrior 5 - case 0x06: MCU_RESPONSE(bloodwar_mcu_4_06); break; // Warrior 6 - case 0x07: MCU_RESPONSE(bloodwar_mcu_4_07); break; // Warrior 7 - case 0x08: MCU_RESPONSE(bloodwar_mcu_4_08); break; // Warrior 8 - case 0x09: MCU_RESPONSE(bloodwar_mcu_4_09); break; // Warrior 9 - - // palette data - case 0x0a: MCU_RESPONSE(bloodwar_mcu_4_0a); break; // Warrior 1 Player 1 - case 0x0b: MCU_RESPONSE(bloodwar_mcu_4_0b); break; // Warrior 1 Player 2 - case 0x0c: MCU_RESPONSE(bloodwar_mcu_4_0c); break; // Warrior 5 Player 1 - case 0x0d: MCU_RESPONSE(bloodwar_mcu_4_0d); break; // Warrior 5 Player 2 - case 0x0e: MCU_RESPONSE(bloodwar_mcu_4_0e); break; // Warrior 4 Player 2 - case 0x0f: MCU_RESPONSE(bloodwar_mcu_4_0f); break; // Warrior 4 Player 1 - case 0x10: MCU_RESPONSE(bloodwar_mcu_4_10); break; // Warrior 6 Player 1 - case 0x11: MCU_RESPONSE(bloodwar_mcu_4_11); break; // Warrior 6 Player 2 - case 0x12: MCU_RESPONSE(bloodwar_mcu_4_12); break; // Warrior 9 Player 1 - case 0x13: MCU_RESPONSE(bloodwar_mcu_4_13); break; // Warrior 9 Player 2 - case 0x14: MCU_RESPONSE(bloodwar_mcu_4_14); break; // Warrior 7 Player 1 - case 0x15: MCU_RESPONSE(bloodwar_mcu_4_15); break; // Warrior 7 Player 2 - case 0x16: MCU_RESPONSE(bloodwar_mcu_4_16); break; // Warrior 8 Player 1 - case 0x17: MCU_RESPONSE(bloodwar_mcu_4_17); break; // Warrior 8 Player 2 - case 0x18: MCU_RESPONSE(bloodwar_mcu_4_18); break; // Warrior 2 Player 2 - case 0x19: MCU_RESPONSE(bloodwar_mcu_4_19); break; // Warrior 2 Player 1 - case 0x1a: MCU_RESPONSE(bloodwar_mcu_4_1a); break; // Warrior 3 Player 1 - case 0x1b: MCU_RESPONSE(bloodwar_mcu_4_1b); break; // Warrior 3 Player 2 - - // tilemap data - case 0x1c: MCU_RESPONSE(bloodwar_mcu_4_1c); break; // Warrior 8 - case 0x1d: MCU_RESPONSE(bloodwar_mcu_4_1d); break; // Warrior 2 - case 0x1e: MCU_RESPONSE(bloodwar_mcu_4_1e); break; // Warrior 3 - case 0x1f: MCU_RESPONSE(bloodwar_mcu_4_1f); break; // Warrior 5 - case 0x20: MCU_RESPONSE(bloodwar_mcu_4_20); break; // Warrior 4 - case 0x21: MCU_RESPONSE(bloodwar_mcu_4_21); break; // Warrior 6 - case 0x22: MCU_RESPONSE(bloodwar_mcu_4_22); break; // Warrior 1 - case 0x23: MCU_RESPONSE(bloodwar_mcu_4_23); break; // Warrior 9 - case 0x24: MCU_RESPONSE(bloodwar_mcu_4_24); break; // Warrior 7 - - // fighter data: pointers to ROM data - case 0x25: MCU_RESPONSE(bloodwar_mcu_4_25); break; // Warrior 1 - case 0x26: MCU_RESPONSE(bloodwar_mcu_4_26); break; // Warrior 2 - case 0x27: MCU_RESPONSE(bloodwar_mcu_4_27); break; // Warrior 3 - case 0x28: MCU_RESPONSE(bloodwar_mcu_4_28); break; // Warrior 4 - case 0x29: MCU_RESPONSE(bloodwar_mcu_4_29); break; // Warrior 5 - case 0x2a: MCU_RESPONSE(bloodwar_mcu_4_2a); break; // Warrior 6 - case 0x2b: MCU_RESPONSE(bloodwar_mcu_4_2b); break; // Warrior 7 - case 0x2c: MCU_RESPONSE(bloodwar_mcu_4_2c); break; // Warrior 8 - case 0x2d: MCU_RESPONSE(bloodwar_mcu_4_2d); break; // Warrior 9 - } - return; - } - - case 0x42: { - memcpy(NVRam, MCURam + MCUOffset, 128); - return; - } - } -} - -static void BonkadvMCURun() -{ - UINT16 *MCURam = (UINT16*)Kaneko16MCURam; - UINT16 *NVRam = (UINT16*)Kaneko16NVRam; - - UINT16 MCUCommand = MCURam[0x10/2]; - UINT16 MCUOffset = MCURam[0x12/2] >> 1; - UINT16 MCUData = MCURam[0x14/2]; - - switch (MCUCommand >> 8) { - case 0x02: { - memcpy(MCURam + MCUOffset, NVRam, 128); - return; - } - - case 0x03: { - MCURam[MCUOffset + 0] = 0xff00 - (Kaneko16Dip[0] << 8); - return; - } - - case 0x04: { - switch (MCUData) { - // static, in this order, at boot/reset - case 0x34: MCU_RESPONSE(bonkadv_mcu_4_34); break; - case 0x30: MCU_RESPONSE(bonkadv_mcu_4_30); break; - case 0x31: MCU_RESPONSE(bonkadv_mcu_4_31); break; - case 0x32: MCU_RESPONSE(bonkadv_mcu_4_32); break; - case 0x33: MCU_RESPONSE(bonkadv_mcu_4_33); break; - - // dynamic, per-level (29), in level order - case 0x00: MCU_RESPONSE(bonkadv_mcu_4_00); break; - case 0x02: MCU_RESPONSE(bonkadv_mcu_4_02); break; - case 0x01: MCU_RESPONSE(bonkadv_mcu_4_01); break; - case 0x05: MCU_RESPONSE(bonkadv_mcu_4_05); break; - case 0x07: MCU_RESPONSE(bonkadv_mcu_4_07); break; - case 0x06: MCU_RESPONSE(bonkadv_mcu_4_06); break; - case 0x09: MCU_RESPONSE(bonkadv_mcu_4_09); break; - case 0x0D: MCU_RESPONSE(bonkadv_mcu_4_0D); break; - case 0x03: MCU_RESPONSE(bonkadv_mcu_4_03); break; - case 0x08: MCU_RESPONSE(bonkadv_mcu_4_08); break; - case 0x04: MCU_RESPONSE(bonkadv_mcu_4_04); break; - case 0x0C: MCU_RESPONSE(bonkadv_mcu_4_0C); break; - case 0x0A: MCU_RESPONSE(bonkadv_mcu_4_0A); break; - case 0x0B: MCU_RESPONSE(bonkadv_mcu_4_0B); break; - case 0x10: MCU_RESPONSE(bonkadv_mcu_4_10); break; - case 0x0E: MCU_RESPONSE(bonkadv_mcu_4_0E); break; - case 0x13: MCU_RESPONSE(bonkadv_mcu_4_13); break; - case 0x0F: MCU_RESPONSE(bonkadv_mcu_4_0F); break; - case 0x11: MCU_RESPONSE(bonkadv_mcu_4_11); break; - case 0x14: MCU_RESPONSE(bonkadv_mcu_4_14); break; - case 0x12: MCU_RESPONSE(bonkadv_mcu_4_12); break; - case 0x17: MCU_RESPONSE(bonkadv_mcu_4_17); break; - case 0x1A: MCU_RESPONSE(bonkadv_mcu_4_1A); break; - case 0x15: MCU_RESPONSE(bonkadv_mcu_4_15); break; - case 0x18: MCU_RESPONSE(bonkadv_mcu_4_18); break; - case 0x16: MCU_RESPONSE(bonkadv_mcu_4_16); break; - case 0x19: MCU_RESPONSE(bonkadv_mcu_4_19); break; - case 0x1B: MCU_RESPONSE(bonkadv_mcu_4_1B); break; - case 0x1C: MCU_RESPONSE(bonkadv_mcu_4_1C); break; - } - return; - } - - case 0x42: { - memcpy(NVRam, MCURam + MCUOffset, 128); - return; - } - - case 0x43: { - // Reset defaults - memcpy(NVRam, bonkadv_mcu_43, sizeof(bonkadv_mcu_43)); - return; - } - } -} - -#undef MCU_RESPONSE - -static void GtmrMCURun() -{ - UINT16 *MCURam = (UINT16*)Kaneko16MCURam; - UINT16 *NVRam = (UINT16*)Kaneko16NVRam; - - UINT16 MCUCommand = MCURam[0x10/2]; - UINT16 MCUOffset = MCURam[0x12/2] >> 1; - - switch (MCUCommand >> 8) { - case 0x02: { - memcpy(MCURam + MCUOffset, NVRam, 128); - return; - } - - case 0x03: { - MCURam[MCUOffset + 0] = 0xff00 - (Kaneko16Dip[0] << 8); - return; - } - - case 0x04: { - /* MCU writes the string "MM0525-TOYBOX199" to shared ram */ - MCURam[MCUOffset + 0] = 0x4d4d; - MCURam[MCUOffset + 1] = 0x3035; - MCURam[MCUOffset + 2] = 0x3235; - MCURam[MCUOffset + 3] = 0x2d54; - MCURam[MCUOffset + 4] = 0x4f59; - MCURam[MCUOffset + 5] = 0x424f; - MCURam[MCUOffset + 6] = 0x5831; - MCURam[MCUOffset + 7] = 0x3939; - return; - } - - case 0x42: { - memcpy(NVRam, MCURam + MCUOffset, 128); - return; - } - } -} - -static void GtmrevoMCURun() -{ - UINT16 *MCURam = (UINT16*)Kaneko16MCURam; - UINT16 *NVRam = (UINT16*)Kaneko16NVRam; - - UINT16 MCUCommand = MCURam[0x10/2]; - UINT16 MCUOffset = MCURam[0x12/2] >> 1; - - switch (MCUCommand >> 8) { - case 0x02: { - memcpy(MCURam + MCUOffset, NVRam, 128); - return; - } - - case 0x03: { - MCURam[MCUOffset + 0] = 0xff00 - (Kaneko16Dip[0] << 8); - return; - } - - case 0x04: { - /* MCU writes the string "USMM0713-TB1994 " to shared ram */ - MCURam[MCUOffset + 0] = 0x5553; - MCURam[MCUOffset + 1] = 0x4d4d; - MCURam[MCUOffset + 2] = 0x3037; - MCURam[MCUOffset + 3] = 0x3133; - MCURam[MCUOffset + 4] = 0x2d54; - MCURam[MCUOffset + 5] = 0x4231; - MCURam[MCUOffset + 6] = 0x3939; - MCURam[MCUOffset + 7] = 0x3420; - return; - } - - case 0x42: { - memcpy(NVRam, MCURam + MCUOffset, 128); - return; - } - } -} - -static void GtmroMCURun() -{ - UINT16 *MCURam = (UINT16*)Kaneko16MCURam; - UINT16 *NVRam = (UINT16*)Kaneko16NVRam; - - UINT16 MCUCommand = MCURam[0x10/2]; - UINT16 MCUOffset = MCURam[0x12/2] >> 1; - - switch (MCUCommand >> 8) { - case 0x02: { - memcpy(MCURam + MCUOffset, NVRam, 128); - return; - } - - case 0x03: { - MCURam[MCUOffset + 0] = 0xff00 - (Kaneko16Dip[0] << 8); - return; - } - - case 0x04: { - /* MCU writes the string 'TOYBOX1994-" [GS]W' to shared ram - [GS] = ASCII Group Separator */ - MCURam[MCUOffset + 0] = 0x544f; - MCURam[MCUOffset + 1] = 0x5942; - MCURam[MCUOffset + 2] = 0x4f58; - MCURam[MCUOffset + 3] = 0x3139; - MCURam[MCUOffset + 4] = 0x3934; - MCURam[MCUOffset + 5] = 0x9300; - MCURam[MCUOffset + 6] = 0xfa1d; - MCURam[MCUOffset + 7] = 0x9e57; - return; - } - - case 0x42: { - memcpy(NVRam, MCURam + MCUOffset, 128); - return; - } - } -} - -static void ToyboxMCUComWrite(INT32 which, UINT16 data) -{ - ToyboxMCUCom[which] = data; - if (ToyboxMCUCom[0] != 0xffff) return; - if (ToyboxMCUCom[1] != 0xffff) return; - if (ToyboxMCUCom[2] != 0xffff) return; - if (ToyboxMCUCom[3] != 0xffff) return; - - memset(ToyboxMCUCom, 0, 4 * sizeof(UINT16)); - ToyboxMCURun(); -} - -/*============================================================================================== -Reset Functions -===============================================================================================*/ - -static INT32 Kaneko16DoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - Kaneko16Brightness = 0xff; - - Kaneko16SpriteFlipX = 0; - Kaneko16SpriteFlipY = 0; - Kaneko16DisplayEnable = 0; - memset(Kaneko16SpriteRegs, 0, 0x20 * sizeof(UINT16)); - memset(Kaneko16Layer0Regs, 0, 0x10 * sizeof(UINT16)); - memset(Kaneko16Layer1Regs, 0, 0x10 * sizeof(UINT16)); - - return 0; -} - -static INT32 BerlwallDoReset() -{ - INT32 nRet = Kaneko16DoReset(); - - for (INT32 i = 0; i < 2; i++) { - AY8910Reset(i); - } - - MSM6295Reset(0); - MSM6295Bank0 = 0; - - Kaneko16Bg15Reg = 0; - Kaneko16Bg15Select = 0; - - return nRet; -} - -static INT32 BlazeonDoReset() -{ - INT32 nRet = Kaneko16DoReset(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - Kaneko16SoundLatch = 0; - - return nRet; -} - -static INT32 WingforcDoReset() -{ - INT32 nRet = Kaneko16DoReset(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - - MSM6295Reset(0); - MSM6295Bank0 = 0; - - Kaneko16SoundLatch = 0; - - return nRet; -} - -static INT32 ExplbrkrDoReset() -{ - INT32 nRet = Kaneko16DoReset(); - - for (INT32 i = 0; i < 2; i++) { - AY8910Reset(i); - } - - if (Kaneko16Eeprom) { - EEPROMReset(); - } - - MSM6295Reset(0); - MSM6295Bank0 = 0; - - return nRet; -} - -static INT32 GtmrDoReset() -{ - INT32 nRet = Kaneko16DoReset(); - - MSM6295Reset(0); - MSM6295Reset(1); - MSM6295Bank0 = 0; - MSM6295Bank1 = 0; - - ToyboxMCUInit(); - - return nRet; -} - -static INT32 ShogwarrDoReset() -{ - if (Kaneko16Watchdog < 180) { - memset (RamStart, 0, RamEnd - RamStart); - } - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Bank0 = -1; - MSM6295Bank1 = -1; - ShogwarrConfigSoundBank(0, 0, 0x30000, 0x10000); - if (Shogwarr) { - ShogwarrConfigSoundBank(1, 0, 0x00000, 0x40000); - } else { - ShogwarrConfigSoundBank(1, 0, 0x20000, 0x20000); - } - - MSM6295Reset(0); - MSM6295Reset(1); - - Kaneko16SpriteFlipX = 0; - Kaneko16SpriteFlipY = 0; - Kaneko16DisplayEnable = 0; - memset(Kaneko16SpriteRegs, 0, 0x20 * sizeof(UINT16)); - memset(Kaneko16Layer0Regs, 0, 0x10 * sizeof(UINT16)); - memset(Kaneko16Layer1Regs, 0, 0x10 * sizeof(UINT16)); - - Kaneko16Bg15Reg = 0; - Kaneko16Bg15Select = 0; - - memset(&m_hit3, 0, sizeof m_hit3); - memset (&m_calc3, 0, sizeof m_calc3); - - shogwarr_initial_scan_tables(); - - Kaneko16Watchdog = 0; - - return 0; -} - -/*============================================================================================== -Memory Handlers -===============================================================================================*/ - -UINT8 __fastcall BerlwallReadByte(UINT32 a) -{ - switch (a) { - case 0x500000: - case 0x500001: { - return Kaneko16Brightness; - } - - case 0x680000: { - return 0xff - Kaneko16Input[0]; - } - - case 0x680002: { - return 0xff - Kaneko16Input[1]; - } - - case 0x680004: { - return 0xff - Kaneko16Input[2]; - } - - case 0x800001: - case 0x80001f: { - AY8910Write(0, 0, (a - 0x800000) >> 1); - return AY8910Read(0); - } - - case 0x800400: - case 0x800401: { - return MSM6295ReadStatus(0); - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); -// } - } - - return 0; -} - -void __fastcall BerlwallWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x500000: - case 0x500001: { - Kaneko16RecalcBg15Palette = 1; - Kaneko16Brightness = d; - } - - case 0x700000: { - // Coin lockout - return; - } - - case 0x800010: - case 0x800012: - case 0x800014: { - AY8910Write(0, 0, (a - 0x800000) >> 1); - AY8910Write(0, 1, d & 0xff); - return; - } - - case 0x800210: - case 0x800212: - case 0x800214: { - AY8910Write(1, 0, (a - 0x800200) >> 1); - AY8910Write(1, 1, d & 0xff); - return; - } - - case 0x800400: - case 0x800401: { - MSM6295Command(0, d & 0xff); - return; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); -// } - } -} - -UINT16 __fastcall BerlwallReadWord(UINT32 a) -{ - switch (a) { - case 0x500000: { - return Kaneko16Brightness; - } - - case 0x780000: { - // watchdog reset - return 0; - } - - case 0x80000e: - case 0x80001c: - case 0x80001e: { - AY8910Write(0, 0, (a - 0x800000) >> 1); - return AY8910Read(0); - } - - case 0x80020e: { - AY8910Write(1, 0, (a - 0x800200) >> 1); - return AY8910Read(1); - } - - case 0x8003fe: { - // NOP - return 0; - } - - case 0x800400: { - return MSM6295ReadStatus(0); - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); -// } - } - - return 0; -} - -void __fastcall BerlwallWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x480000: { - // ?? - return; - } - - case 0x500000: { - Kaneko16RecalcBg15Palette = 1; - Kaneko16Brightness = d & 0xff; - return; - } - - case 0x580000: { - Kaneko16Bg15Select = d; - return; - } - - case 0x800000: - case 0x800002: - case 0x800004: - case 0x800006: - case 0x800008: - case 0x80000a: - case 0x80000c: - case 0x80000e: - case 0x800010: - case 0x800012: - case 0x800014: - case 0x800016: - case 0x800018: - case 0x80001a: { - AY8910Write(0, 0, (a - 0x800000) >> 1); - AY8910Write(0, 1, d & 0xff); - return; - } - - case 0x800200: - case 0x800202: - case 0x800204: - case 0x800206: - case 0x800208: - case 0x80020a: - case 0x80020c: - case 0x80020e: - case 0x800210: - case 0x800212: - case 0x800214: - case 0x800216: - case 0x800218: - case 0x80021a: { - AY8910Write(1, 0, (a - 0x800200) >> 1); - AY8910Write(1, 1, d & 0xff); - return; - } - - case 0x8003fe: { - // NOP - return; - } - - case 0x800400: { - MSM6295Command(0, d & 0xff); - return; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Write word -> %06X, %04X\n"), a, d); -// } - } -} - -UINT8 __fastcall BlazeonReadByte(UINT32 a) -{ - switch (a) { - case 0xc00000: { - return 0xff - Kaneko16Input[0]; - } - - case 0xc00001: { - return Kaneko16Dip[0]; - } - - case 0xc00002: { - return 0xff - Kaneko16Input[1]; - } - - case 0xc00003: { - return Kaneko16Dip[1]; - } - - case 0xc00006: { - return 0xff - Kaneko16Input[2]; - } - - case 0xc00007: { - return 0xff; - } - - case 0xec0000: { - // NOP - return 0; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); -// } - } - - return 0; -} - -void __fastcall BlazeonWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xd00000: { - // Coin lockout - return; - } - - case 0xe00000: { - Kaneko16SoundLatch = d; - ZetOpen(0); - ZetNmi(); - ZetClose(); - return; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); -// } - } -} - -UINT16 __fastcall BlazeonReadWord(UINT32 a) -{ - switch (a) { - case 0xc00000: { - SEK_DEF_READ_WORD(0, a); - return 0; - } - - case 0xc00002: { - SEK_DEF_READ_WORD(0, a); - return 0; - } - - case 0xc00004: { - return 0xffff; - } - - case 0xc00006: { - SEK_DEF_READ_WORD(0, a); - return 0; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); -// } - } - - return 0; -} - -void __fastcall BlazeonWriteWord(UINT32 a, UINT16 /*d*/) -{ - switch (a) { - case 0xd00000: { - // Coin lockout - return; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Write word -> %06X, %04X\n"), a, d); -// } - } -} - -UINT8 __fastcall ExplbrkrReadByte(UINT32 a) -{ - switch (a) { - case 0x400001: { - AY8910Write(0, 0, (a - 0x400000) >> 1); - return AY8910Read(0); - } - - case 0x40021d: { - AY8910Write(1, 0, (a - 0x400200) >> 1); - return AY8910Read(1); - } - - case 0x400401: { - return MSM6295ReadStatus(0); - } - - case 0xe00000: { - return 0xff - Kaneko16Input[0]; - } - - case 0xe00001: { - return Kaneko16Dip[0]; - } - - case 0xe00002: { - return 0xff - Kaneko16Input[1]; - } - - case 0xe00004: { - return 0xff - Kaneko16Input[2]; - } - - case 0xe00006: { - return 0xff; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); -// } - } - - return 0; -} - -void __fastcall ExplbrkrWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x40000f: - case 0x400010: - case 0x400012: - case 0x400014: { - AY8910Write(0, 0, (a - 0x400000) >> 1); - AY8910Write(0, 1, d & 0xff); - return; - } - - case 0x40020f: - case 0x400210: - case 0x400212: - case 0x400214: - case 0x40021f: { - AY8910Write(1, 0, (a - 0x400200) >> 1); - AY8910Write(1, 1, d & 0xff); - return; - } - - case 0x400401: { - MSM6295Command(0, d & 0xff); - return; - } - - case 0xd00000: return; - - case 0xd00001: { - EEPROMWriteBit(d & 0x02); - EEPROMSetClockLine((d & 0x01) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE ); - return; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); -// } - } -} - -UINT16 __fastcall ExplbrkrReadWord(UINT32 a) -{ - switch (a) { - case 0xa00000: { - // Magical crystals Watchdog reset - return 0; - } - - case 0xa80000: { - // Watchdog reset - return 0; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); -// } - } - - return 0; -} - -void __fastcall ExplbrkrWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x400000: - case 0x400002: - case 0x400004: - case 0x400006: - case 0x400008: - case 0x40000a: - case 0x40000c: - case 0x40000e: - case 0x400010: - case 0x400012: - case 0x400014: - case 0x400016: - case 0x400018: - case 0x40001a: - case 0x40001c: { - AY8910Write(0, 0, (a - 0x400000) >> 1); - AY8910Write(0, 1, d & 0xff); - return; - } - - case 0x40001e: { - if (Mgcrystl) { - AY8910Write(0, 0, (a - 0x400000) >> 1); - AY8910Write(0, 1, d & 0xff); - } else { - MSM6295Bank0 = d & 7; - memcpy(MSM6295ROM + 0x0000000, MSM6295ROMData + (0x40000 * (d & 7)), 0x40000); - } - return; - } - - case 0x400200: - case 0x400202: - case 0x400204: - case 0x400206: - case 0x400208: - case 0x40020a: - case 0x40020c: - case 0x40020e: - case 0x400210: - case 0x400212: - case 0x400214: - case 0x400216: - case 0x400218: - case 0x40021a: - case 0x40021c: - case 0x40021e: { - AY8910Write(1, 0, (a - 0x400200) >> 1); - AY8910Write(1, 1, d & 0xff); - return; - } - - case 0x900000: { - Kaneko16SpriteRegs[0] = d; - if (d & 0xff) { - Kaneko16SpriteFlipX = d & 2; - Kaneko16SpriteFlipY = d & 1; - } - return; - } - - case 0xd00000: { - SEK_DEF_WRITE_WORD(0, a, d); - return; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Write word -> %06X, %04X\n"), a, d); -// } - } -} - -UINT8 __fastcall MgcrystlReadByte(UINT32 a) -{ - switch (a) { - case 0x400001: { - AY8910Write(0, 0, (a - 0x400000) >> 1); - return AY8910Read(0); - } - - case 0x40021d: { - AY8910Write(1, 0, (a - 0x400200) >> 1); - return AY8910Read(1); - } - - case 0x400401: { - return MSM6295ReadStatus(0); - } - - case 0xc00000: { - return 0xff - Kaneko16Input[0]; - } - - case 0xc00001: { - return Kaneko16Dip[0]; - } - - case 0xc00002: { - return 0x3f - Kaneko16Input[1]; - } - - case 0xc00004: { - return 0xff - Kaneko16Input[2]; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); -// } - } - - return 0; -} - -UINT8 __fastcall GtmrReadByte(UINT32 a) -{ - switch (a) { - case 0x900014: { - if (Gtmr) return BurnRandom() & 0xff; - return 0; - } - - case 0x900015: { - if (Bonkadv) return BonkadvCalcRead((a - 0x900000) >> 1); - return 0; - } - - case 0xb00000: { - return 0xff - Kaneko16Input[0]; - } - - case 0xb00002: { - return 0xff - Kaneko16Input[1]; - } - - case 0xb00004: { - return 0xff - Kaneko16Input[2]; - } - - case 0xb00006: { - return 0xff - Kaneko16Input[3]; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); -// } - } - - return 0; -} - -void __fastcall GtmrWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x600000: - case 0x600002: - case 0x600004: - case 0x600006: - case 0x600008: - case 0x600009: - case 0x60000a: - case 0x60000b: - case 0x60000c: - case 0x60000e: - case 0x600010: - case 0x600012: - case 0x600014: - case 0x600016: - case 0x600018: - case 0x60001a: - case 0x60001c: - case 0x60001e: { - Kaneko16Layer0Regs[(a - 0x600000) >> 1] = d; - return; - } - - case 0x680000: - case 0x680002: - case 0x680004: - case 0x680006: - case 0x680008: - case 0x680009: - case 0x68000a: - case 0x68000b: - case 0x68000c: - case 0x68000e: - case 0x680010: - case 0x680012: - case 0x680014: - case 0x680016: - case 0x680018: - case 0x68001a: - case 0x68001c: - case 0x68001e: { - Kaneko16Layer1Regs[(a - 0x680000) >> 1] = d; - return; - } - - case 0x700000: - case 0x700002: - case 0x700004: - case 0x700006: - case 0x700008: - case 0x70000a: - case 0x70000c: - case 0x70000e: - case 0x700010: - case 0x700012: - case 0x700014: - case 0x700016: - case 0x700018: - case 0x70001a: - case 0x70001c: - case 0x70001e: { - UINT32 offset = (a - 0x700000) >> 1; - Kaneko16SpriteRegs[offset] = d; - if (offset == 0 && (d & 0xff)) { - Kaneko16SpriteFlipX = d & 2; - Kaneko16SpriteFlipY = d & 1; - } - return; - } - - case 0x800001: { - MSM6295Command(0, d); - return; - } - - case 0x880001: { - MSM6295Command(1, d); - return; - } - - case 0xb80000: { - // Coin lockout - return; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); -// } - } -} - -UINT16 __fastcall GtmrReadWord(UINT32 a) -{ - switch (a) { - case 0x800000: { - return MSM6295ReadStatus(0); - } - - case 0x880000: { - return MSM6295ReadStatus(1); - } - - case 0x900000: - case 0x900002: - case 0x900004: - case 0x900006: - case 0x900008: - case 0x90000a: - case 0x90000c: - case 0x90000e: - case 0x900010: - case 0x900012: - case 0x900014: - case 0x900016: - case 0x900018: - case 0x90001a: - case 0x90001c: - case 0x90001e: - case 0x900020: - case 0x900022: - case 0x900024: - case 0x900026: - case 0x900028: - case 0x90002a: - case 0x90002c: - case 0x90002e: - case 0x900030: - case 0x900032: - case 0x900034: - case 0x900036: - case 0x900038: { - if (Bloodwar) return BloodwarCalcRead((a - 0x900000) >> 1); - if (Bonkadv) return BonkadvCalcRead((a - 0x900000) >> 1); - if (Gtmr) return BurnRandom() & 0xffff; - return 0; - } - - case 0xa00000: { - // Watchdog read - return 0; - } - - case 0xb00000: { - return 0xff00 - (Kaneko16Input[0] << 8); - } - - case 0xb00002: { - return 0xff00 - (Kaneko16Input[1] << 8); - } - - case 0xb00004: { - return 0xff00 - (Kaneko16Input[2] << 8); - } - - case 0xb00006: { - return 0xffff; - } - - case 0xd00000: { - return ToyboxMCUStatusRead(); - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); -// } - } - - return 0; -} - -void __fastcall GtmrWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x2a0000: { - ToyboxMCUComWrite(0, d); - return; - } - - case 0x2b0000: { - ToyboxMCUComWrite(1, d); - return; - } - - case 0x2c0000: { - ToyboxMCUComWrite(2, d); - return; - } - - case 0x2d0000: { - ToyboxMCUComWrite(3, d); - return; - } - - case 0x700000: { - Kaneko16SpriteRegs[0] = d; - if (d & 0xff) { - Kaneko16SpriteFlipX = d & 2; - Kaneko16SpriteFlipY = d & 1; - } - return; - } - - case 0x800000: { - MSM6295Command(0, d); - return; - } - - case 0x880000: { - MSM6295Command(1, d); - return; - } - - case 0x900000: - case 0x900002: - case 0x900004: - case 0x900006: - case 0x900008: - case 0x90000a: - case 0x90000c: - case 0x90000e: - case 0x900010: - case 0x900012: - case 0x900014: - case 0x900016: - case 0x900018: - case 0x90001a: - case 0x90001c: - case 0x90001e: - case 0x900020: - case 0x900022: - case 0x900024: - case 0x900026: - case 0x900028: - case 0x90002a: - case 0x90002c: - case 0x90002e: - case 0x900030: - case 0x900032: - case 0x900034: - case 0x900036: - case 0x900038: { - if (Bonkadv) BonkadvCalcWrite((a - 0x900000) >> 1, d); - if (Bloodwar) BloodwarCalcWrite((a - 0x900000) >> 1, d); - return; - } - - case 0xa00000: { - // Watchdog write - return; - } - - case 0xb80000: { - // Coin lockout - return; - } - - case 0xc00000: { - Kaneko16DisplayEnable = d; - return; - } - - case 0xe00000: { - MSM6295Bank0 = d & 0xf; - memcpy(MSM6295ROM + 0x0000000, MSM6295ROMData + (0x40000 * (d & 0x0f)),0x40000); - return; - } - - case 0xe80000: { - if (Gtmr) { - MSM6295Bank1 = d & 1; - memcpy(MSM6295ROM + 0x0100000, MSM6295ROMData2 + (0x40000 * (d & 0x01)),0x40000); - } else { - MSM6295Bank1 = d; - memcpy(MSM6295ROM + 0x0100000, MSM6295ROMData2 + (0x40000 * d),0x40000); - } - return; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Write word -> %06X, %04X\n"), a, d); -// } - } -} - -UINT8 __fastcall Kaneko16Z80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x03: { - return BurnYM2151ReadStatus(); - } - - case 0x06: { - return Kaneko16SoundLatch; - } - - case 0x0a: { - return MSM6295ReadStatus(0); - } - } - - return 0; -} - -void __fastcall Kaneko16Z80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x02: { - BurnYM2151SelectRegister(d); - return; - } - case 0x03: { - BurnYM2151WriteRegister(d); - return; - } - case 0x0a: { - MSM6295Command(0, d); - return; - } - case 0x0c: { - MSM6295Bank0 = d & 0x7; - memcpy(MSM6295ROM + 0x0000000, MSM6295ROMData + (0x40000 * (d & 0x07)), 0x40000); - return; - } - } -} - -static void ShogwarrConfigSoundBank(INT32 oki, INT32 nBank, INT32 nStart, INT32 nSize) -{ - if (oki == 0 && MSM6295Bank0 == nBank) return; - if (oki == 1 && MSM6295Bank1 == nBank) return; - - if (oki == 0) MSM6295Bank0 = nBank; - if (oki == 1) MSM6295Bank1 = nBank; - - INT32 nBankAddress = nStart + (nSize * nBank); - - UINT8 *MSMData = (oki) ? MSM6295ROMData2 : MSM6295ROMData; - - memcpy (MSM6295ROM + (oki * 0x100000) + nStart, MSMData + nBankAddress, nSize); -} - -static UINT8 __fastcall ShogwarrReadByte(UINT32 sekAddress) -{ - if ((sekAddress & 0xffff80) == 0xa00000) { - if (Shogwarr) - return BloodwarCalcRead((sekAddress - 0xa00000) >> 1) >> ((~sekAddress & 1) * 8); - else - return kaneko_hit_type2_read((sekAddress - 0xa00000) >> 1) >> ((~sekAddress & 1) * 8); - } - - switch (sekAddress) - { - case 0xa80000: - case 0xa80001: - Kaneko16Watchdog = 0; - return 0; - - case 0xb80000: - return 0xff - Kaneko16Input[0]; - - case 0xb80002: - return 0xff - Kaneko16Input[1]; - - case 0xb80004: - return 0xff - Kaneko16Input[2]; - - case 0xb80006: - return 0xff; - } - - return 0; -} - -static UINT16 __fastcall ShogwarrReadWord(UINT32 sekAddress) -{ - if ((sekAddress & 0xffff80) == 0xa00000) { - if (Shogwarr) - return BloodwarCalcRead((sekAddress - 0xa00000) >> 1); - else - return kaneko_hit_type2_read((sekAddress - 0xa00000) >> 1); - } - - switch (sekAddress) - { - case 0x400000: - return MSM6295ReadStatus(0); - - case 0x480000: - return MSM6295ReadStatus(1); - - case 0xa80000: - Kaneko16Watchdog = 0; - return 0; - - case 0xb80000: - return ((0xff - Kaneko16Input[0])<<8); - - case 0xb80002: - return ((0xff - Kaneko16Input[1])<<8); - - case 0xb80004: - return ((0xff - Kaneko16Input[2])<<8); - - case 0xb80006: - return 0xff00; - } - - return 0; -} - -static void __fastcall ShogwarrWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if ((sekAddress & 0xffff80) == 0xa00000) { - if (Shogwarr) - BloodwarCalcWrite((sekAddress - 0xa00000) >> 1, byteValue); - else - kaneko_hit_type2_write((sekAddress - 0xa00000) >> 1, byteValue); - return; - } - - switch (sekAddress) - { - case 0x400000: - case 0x400001: - MSM6295Command(0, byteValue & 0xff); - return; - - case 0x480000: - case 0x480001: - MSM6295Command(1, byteValue & 0xff); - return; - - case 0xa80000: - case 0xa80001: - Kaneko16Watchdog = 0; - return; - - case 0xe00000: - case 0xe00001: - ShogwarrConfigSoundBank(0, (byteValue >> 4) & 0x0f, 0x30000, 0x10000); - if (Shogwarr) { - ShogwarrConfigSoundBank(1, (byteValue >> 0) & 0x0f, 0x00000, 0x40000); - } else { - ShogwarrConfigSoundBank(1, (byteValue >> 0) & 0x0f, 0x20000, 0x20000); - } - return; - } -} - - -static void __fastcall ShogwarrWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if ((sekAddress & 0xffff80) == 0xa00000) { - if (Shogwarr) - BloodwarCalcWrite((sekAddress - 0xa00000) >> 1, wordValue); - else - kaneko_hit_type2_write((sekAddress - 0xa00000) >> 1, wordValue); - return; - } - - calc3_t &calc3 = m_calc3; - - switch (sekAddress) - { - case 0x280000: - calc3.mcu_status |= (1 << 0); - return; - - case 0x290000: - calc3.mcu_status |= (1 << 1); - return; - - case 0x2b0000: - calc3.mcu_status |= (1 << 2); - return; - - case 0x2d0000: - calc3.mcu_status |= (1 << 3); - return; - - case 0x400000: - MSM6295Command(0, wordValue & 0xff); - return; - - case 0x480000: - MSM6295Command(1, wordValue & 0xff); - return; - - case 0xa80000: - Kaneko16Watchdog = 0; - return; - - case 0xe00000: - ShogwarrConfigSoundBank(0, (wordValue >> 4) & 0x0f, 0x30000, 0x10000); - if (Shogwarr) { - ShogwarrConfigSoundBank(1, (wordValue >> 0) & 0x0f, 0x00000, 0x40000); - } else { - ShogwarrConfigSoundBank(1, (wordValue >> 0) & 0x0f, 0x20000, 0x20000); - } - return; - } -} - -/*============================================================================================== -Sound Chip Handlers -===============================================================================================*/ - -static UINT8 Kaneko16EepromRead(UINT32 /*a*/) -{ - return EEPROMRead() & 0x01; -} - -static void Kaneko16EepromReset(UINT32 /*a*/, UINT32 d) -{ - EEPROMSetCSLine((d & 0x01) ? EEPROM_CLEAR_LINE : EEPROM_ASSERT_LINE ); -} - -static UINT8 Kaneko16Dip0Read(UINT32 /*a*/) -{ - return Kaneko16Dip[0]; -} - -static UINT8 Kaneko16Dip1Read(UINT32 /*a*/) -{ - return Kaneko16Dip[1]; -} - -/*============================================================================================== -Driver Inits -===============================================================================================*/ - -static void Kaneko16VideoInit() -{ - GenericTilesInit(); - - spritelist.first_sprite = (struct tempsprite *)BurnMalloc(0x400 * sizeof(spritelist.first_sprite[0])); - - Kaneko16ParseSprite = Kaneko16ParseSpriteType0; - - Kaneko16SpritesColourOffset = 0; - Kaneko16SpritesColourMask = 0x0fff; - Kaneko168BppSprites = 0; - if (Gtmr || Bloodwar || Bonkadv) { - Kaneko16SpritesColourOffset = 0x4000; - Kaneko16SpritesColourMask = 0xffff; - Kaneko168BppSprites = 1; - } - Kaneko16SpriteFlipType = 0; - - Kaneko16SpriteXOffset = 0; - Kaneko16SpriteRamSize = 0x2000; - - Kaneko16LayersColourOffset = 0x40 * 16; - if (Gtmr || Bloodwar || Bonkadv) Kaneko16LayersColourOffset = 0; - Kaneko16TilesXOffset = 0; - if (nScreenWidth == 256) Kaneko16TilesXOffset = 0x5b; - if (nScreenWidth == 320) Kaneko16TilesXOffset = 0x33; - Kaneko16TilesYOffset = 0; - if (nScreenHeight == 224 || nScreenHeight == 225 || nScreenHeight == 232) Kaneko16TilesYOffset = -0x08; - - Kaneko16Bg15 = 0; - Kaneko16Bg15Reg = 0; - Kaneko16Bg15Select = 0; - Kaneko16RecalcBg15Palette = 0; -} - -static INT32 GtmrMachineInit() -{ - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x0ffffd, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(Kaneko16MCURam , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(Kaneko16Ram + 0x10000, 0x310000, 0x327fff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0x501000, 0x501fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0x502000, 0x502fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0x503000, 0x503fff, MAP_RAM); - SekMapMemory(Kaneko16Video3Ram , 0x580000, 0x580fff, MAP_RAM); - SekMapMemory(Kaneko16Video2Ram , 0x581000, 0x581fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl3Ram , 0x582000, 0x582fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl2Ram , 0x583000, 0x583fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0x600000, 0x60001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16Layer1Regs , 0x680000, 0x68001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs + 2, 0x700002, 0x70001f, MAP_WRITE); - SekSetReadByteHandler(0, GtmrReadByte); - SekSetReadWordHandler(0, GtmrReadWord); - SekSetWriteByteHandler(0, GtmrWriteByte); - SekSetWriteWordHandler(0, GtmrWriteWord); - SekClose(); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 1980000 / 165, 0); - MSM6295Init(1, 1980000 / 165, 0); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - - return 0; -} - -static INT32 FourBppPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 FourBppXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 256, 260, 264, 268, 272, 276, 280, 284 }; -static INT32 FourBppYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; -static INT32 EightBppPlaneOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 EightBppXOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 512, 520, 528, 536, 544, 552, 560, 568 }; -static INT32 EightBppYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 1024, 1088, 1152, 1216, 1280, 1344, 1408, 1472 }; - -static INT32 BerlwallInit() -{ - INT32 nRet = 0, nLen; - - Kaneko16NumSprites = 0x2400; - Kaneko16NumTiles = 0x1000; - Kaneko16NumTiles2 = 0; - - Kaneko16VideoInit(); - Kaneko16ParseSprite = Kaneko16ParseSpriteType2; - Kaneko16Bg15 = 1; - Kaneko16RecalcBg15Palette = 1; - - // Allocate and Blank all required memory - Mem = NULL; - ExplbrkrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - ExplbrkrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x400000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0080000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 4, 1); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x400000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 5, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x080000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - - // Load bitmap roms - memset(Kaneko16TempGfx, 0, 0x400000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x100000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x100001, 9, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200000, 10, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200001, 11, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x300000, 12, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x300001, 13, 2); if (nRet != 0) return 1; - Kaneko16DecodeBg15Bitmaps(); - BurnFree(Kaneko16TempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 14, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROMData, MSM6295ROM, 0x40000); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x30e000, 0x30ffff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x400000, 0x400fff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0xc00000, 0xc00fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0xc01000, 0xc01fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0xc02000, 0xc02fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0xc03000, 0xc03fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0xd00000, 0xd0001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs + 2, 0x600002, 0x60003f, MAP_WRITE); - SekSetReadByteHandler(0, BerlwallReadByte); - SekSetReadWordHandler(0, BerlwallReadWord); - SekSetWriteByteHandler(0, BerlwallWriteByte); - SekSetWriteWordHandler(0, BerlwallWriteWord); - SekClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - AY8910Init(0, 2000000, nBurnSoundRate, &Kaneko16Dip0Read, &Kaneko16Dip1Read, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.40, BURN_SND_ROUTE_BOTH); - - // Setup the OKIM6295 emulation - MSM6295Init(0, (12000000 / 6) / 132, 1); - MSM6295SetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - - Kaneko16FrameRender = BerlwallFrameRender; - - // Reset the driver - BerlwallDoReset(); - - return 0; -} - -static INT32 PackbangInit() -{ - INT32 nRet = 0, nLen; - - Kaneko16NumSprites = 0x2400; - Kaneko16NumTiles = 0x1000; - Kaneko16NumTiles2 = 0; - - Kaneko16VideoInit(); - Kaneko16ParseSprite = Kaneko16ParseSpriteType2; - Kaneko16Bg15 = 1; - Kaneko16RecalcBg15Palette = 1; - - // Allocate and Blank all required memory - Mem = NULL; - ExplbrkrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - ExplbrkrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x400000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0080000, 3, 1); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x400000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 4, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x080000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - - // Load bitmap roms - memset(Kaneko16TempGfx, 0, 0x400000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x100000, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x100001, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200000, 9, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200001, 10, 2); if (nRet != 0) return 1; - Kaneko16DecodeBg15Bitmaps(); - BurnFree(Kaneko16TempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 11, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROMData, MSM6295ROM, 0x40000); - MSM6295Bank0 = 0; - MSM6295Bank1 = 0; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x30e000, 0x30ffff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x400000, 0x400fff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0xc00000, 0xc00fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0xc01000, 0xc01fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0xc02000, 0xc02fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0xc03000, 0xc03fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0xd00000, 0xd0001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs + 2, 0x600002, 0x60003f, MAP_WRITE); - SekSetReadByteHandler(0, BerlwallReadByte); - SekSetReadWordHandler(0, BerlwallReadWord); - SekSetWriteByteHandler(0, BerlwallWriteByte); - SekSetWriteWordHandler(0, BerlwallWriteWord); - SekClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - AY8910Init(0, 2000000, nBurnSoundRate, &Kaneko16Dip0Read, &Kaneko16Dip1Read, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.40, BURN_SND_ROUTE_BOTH); - - // Setup the OKIM6295 emulation - MSM6295Init(0, (12000000 / 6) / 132, 1); - MSM6295SetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - - Kaneko16FrameRender = BerlwallFrameRender; - - // Reset the driver - BerlwallDoReset(); - - return 0; -} - -static INT32 BlazeonInit() -{ - INT32 nRet = 0, nLen; - - Kaneko16NumSprites = 0x4000; - Kaneko16NumTiles = 0x2000; - Kaneko16NumTiles2 = 0; - - Kaneko16VideoInit(); - Kaneko16SpriteRamSize = 0x1000; - Kaneko16SpriteXOffset = 0x10000 - 0x680; - Kaneko16SpritePrio(1, 2, 8, 8); - - // Allocate and Blank all required memory - Mem = NULL; - BlazeonMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - BlazeonMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x200000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 3, 1); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x200000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 4, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x100000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - - BurnFree(Kaneko16TempGfx); - - // Load Z80 Rom - nRet = BurnLoadRom(Kaneko16Z80Rom, 5, 1); if (nRet != 0) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0x600000, 0x600fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0x601000, 0x601fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0x602000, 0x602fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0x603000, 0x603fff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x700000, 0x700fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0x800000, 0x80000f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs + 2, 0x900002, 0x90001f, MAP_WRITE); - SekSetReadByteHandler(0, BlazeonReadByte); - SekSetReadWordHandler(0, BlazeonReadWord); - SekSetWriteByteHandler(0, BlazeonWriteByte); - SekSetWriteWordHandler(0, BlazeonWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, Kaneko16Z80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, Kaneko16Z80Rom ); - ZetMapArea(0xc000, 0xdfff, 0, Kaneko16Z80Ram ); - ZetMapArea(0xc000, 0xdfff, 1, Kaneko16Z80Ram ); - ZetMapArea(0xc000, 0xdfff, 2, Kaneko16Z80Ram ); - ZetSetInHandler(Kaneko16Z80PortRead); - ZetSetOutHandler(Kaneko16Z80PortWrite); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(4000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - Kaneko16FrameRender = BlazeonFrameRender; - - // Reset the driver - BlazeonDoReset(); - - return 0; -} - -static INT32 WingforcInit() -{ - INT32 nRet = 0, nLen; - - Kaneko16NumSprites = 0x4000; - Kaneko16NumTiles = 0x4000; - Kaneko16NumTiles2 = 0; - - Kaneko16VideoInit(); - Kaneko16SpriteRamSize = 0x1000; - Kaneko16SpriteXOffset = 0x10000 - 0x680; - Kaneko16TilesYOffset = -0x09; - Kaneko16SpritePrio(2, 3, 5, 7); - - // Allocate and Blank all required memory - Mem = NULL; - BlazeonMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - BlazeonMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x400000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0080000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0080000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0180000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0180000, 9, 1); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x400000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000,10, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000001,11, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000,12, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100001,13, 2); if (nRet != 0) return 1; - UnscrambleTiles(0x200000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - - - // Load Z80 Rom - nRet = BurnLoadRom(Kaneko16Z80Rom, 14, 1); if (nRet != 0) return 1; - - // Load & un-derange Sample Rom - memset(Kaneko16TempGfx, 0, 0x80000); - nRet = BurnLoadRom(Kaneko16TempGfx, 15, 1); if (nRet != 0) return 1; - - memcpy(MSM6295ROMData + 0x00000, Kaneko16TempGfx + 0x00000, 0x20000); - memcpy(MSM6295ROMData + 0x20000, Kaneko16TempGfx + 0x20000, 0x20000); - memcpy(MSM6295ROMData + 0x40000, Kaneko16TempGfx + 0x00000, 0x20000); - memcpy(MSM6295ROMData + 0x60000, Kaneko16TempGfx + 0x40000, 0x20000); - memcpy(MSM6295ROMData + 0x80000, Kaneko16TempGfx + 0x00000, 0x20000); - memcpy(MSM6295ROMData + 0xa0000, Kaneko16TempGfx + 0x60000, 0x20000); - BurnFree(Kaneko16TempGfx); - - // Setup 68k emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0x600000, 0x600fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0x601000, 0x601fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0x602000, 0x602fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0x603000, 0x603fff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x700000, 0x700fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0x800000, 0x80000f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs + 2, 0x900002, 0x90001f, MAP_WRITE); - SekSetReadByteHandler(0, BlazeonReadByte); - SekSetReadWordHandler(0, BlazeonReadWord); - SekSetWriteByteHandler(0, BlazeonWriteByte); - SekSetWriteWordHandler(0, BlazeonWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, Kaneko16Z80Rom ); - ZetMapArea(0x0000, 0xbfff, 2, Kaneko16Z80Rom ); - ZetMapArea(0xc000, 0xdfff, 0, Kaneko16Z80Ram ); - ZetMapArea(0xc000, 0xdfff, 1, Kaneko16Z80Ram ); - ZetMapArea(0xc000, 0xdfff, 2, Kaneko16Z80Ram ); - ZetSetInHandler(Kaneko16Z80PortRead); - ZetSetOutHandler(Kaneko16Z80PortWrite); - ZetClose(); - -// BurnSetRefreshRate(59.1854); // hmm, this causes clicks in audio. let's just give it the cycles/per frame it wants instead. (see WingforcFrame()) - - // Setup the YM2151 emulation - BurnYM2151Init(4000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.40, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.40, BURN_SND_ROUTE_RIGHT); - - // Setup the OKIM6295 emulation - MSM6295Init(0, (16000000 / 16) / 132, 1); - MSM6295SetRoute(0, 0.55, BURN_SND_ROUTE_BOTH); - - Kaneko16FrameRender = BlazeonFrameRender; - - // Reset the driver - WingforcDoReset(); - - return 0; -} - -static INT32 BloodwarInit() -{ - INT32 nRet = 0, nLen; - - Bloodwar = 1; - - Kaneko16NumSprites = 0x1e000; - Kaneko16NumTiles = 0x2000; - Kaneko16NumTiles2 = 0x2000; - - Kaneko16VideoInit(); - Kaneko16ParseSprite = Kaneko16ParseSpriteType1; - - // Allocate and Blank all required memory - Mem = NULL; - GtmrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - GtmrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x1e00000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0200000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0400000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0600000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0800000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0a00000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0c00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0e00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1000000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1200000, 12, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1200001, 13, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1400000, 14, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1400001, 15, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1600000, 16, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1600001, 17, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1800000, 18, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1800001, 19, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1a00000, 20, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1a00001, 21, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1c00000, 22, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x1c00001, 23, 2); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 8, 16, 16, EightBppPlaneOffsets, EightBppXOffsets, EightBppYOffsets, 0x800, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x1e00000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 24, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x100000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - memset(Kaneko16TempGfx, 0, 0x1e00000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 25, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x100000); - GfxDecode(Kaneko16NumTiles2, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles2); - BurnFree(Kaneko16TempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROMData, 26, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2, 27, 1); if (nRet != 0) return 1; - ExpandSampleBanks(); - - ToyboxMCURun = BloodwarMCURun; - Kaneko16FrameRender = BloodwarFrameRender; - - nRet = GtmrMachineInit(); if (nRet != 0) return 1; - - // Reset the driver - GtmrDoReset(); - - return 0; -} - -static INT32 BonkadvInit() -{ - INT32 nRet = 0, nLen; - - Bonkadv = 1; - - Kaneko16NumSprites = 0x5000; - Kaneko16NumTiles = 0x4000; - Kaneko16NumTiles2 = 0x4000; - - Kaneko16VideoInit(); - Kaneko16ParseSprite = Kaneko16ParseSpriteType1; - - // Allocate and Blank all required memory - Mem = NULL; - GtmrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - GtmrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x500000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0200000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0300000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0400000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0400001, 7, 2); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 8, 16, 16, EightBppPlaneOffsets, EightBppXOffsets, EightBppYOffsets, 0x800, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x500000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 8, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x100000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - memset(Kaneko16TempGfx, 0, 0x500000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 9, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x100000); - GfxDecode(Kaneko16NumTiles2, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles2); - BurnFree(Kaneko16TempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROMData, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2 + 0x100000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2 + 0x200000, 13, 1); if (nRet != 0) return 1; - ExpandSampleBanks(); - - ToyboxMCURun = BonkadvMCURun; - Kaneko16FrameRender = BloodwarFrameRender; - - nRet = GtmrMachineInit(); if (nRet != 0) return 1; - - // Reset the driver - GtmrDoReset(); - - return 0; -} - -static INT32 ExplbrkrInit() -{ - INT32 nRet = 0, nLen; - - Kaneko16NumSprites = 0x4800; - Kaneko16NumTiles = 0x2000; - Kaneko16NumTiles2 = 0x2000; - - Kaneko16VideoInit(); - - // Allocate and Blank all required memory - Mem = NULL; - ExplbrkrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - ExplbrkrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x240000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0080000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0180000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0200000, 4, 1); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x240000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 5, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x100000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - memset(Kaneko16TempGfx, 0, 0x240000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 6, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x100000); - GfxDecode(Kaneko16NumTiles2, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles2); - - // Load Sample Rom - memset(Kaneko16TempGfx, 0, 0x240000); - nRet = BurnLoadRom(Kaneko16TempGfx, 7, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROMData + 0x000000, Kaneko16TempGfx + 0x000000, 0x20000); - memcpy(MSM6295ROMData + 0x020000, Kaneko16TempGfx + 0x020000, 0x20000); - memcpy(MSM6295ROMData + 0x040000, Kaneko16TempGfx + 0x000000, 0x20000); - memcpy(MSM6295ROMData + 0x060000, Kaneko16TempGfx + 0x040000, 0x20000); - memcpy(MSM6295ROMData + 0x080000, Kaneko16TempGfx + 0x000000, 0x20000); - memcpy(MSM6295ROMData + 0x0a0000, Kaneko16TempGfx + 0x060000, 0x20000); - memcpy(MSM6295ROMData + 0x0c0000, Kaneko16TempGfx + 0x000000, 0x20000); - memcpy(MSM6295ROMData + 0x0e0000, Kaneko16TempGfx + 0x080000, 0x20000); - memcpy(MSM6295ROMData + 0x100000, Kaneko16TempGfx + 0x000000, 0x20000); - memcpy(MSM6295ROMData + 0x120000, Kaneko16TempGfx + 0x0a0000, 0x20000); - memcpy(MSM6295ROMData + 0x140000, Kaneko16TempGfx + 0x000000, 0x20000); - memcpy(MSM6295ROMData + 0x160000, Kaneko16TempGfx + 0x0c0000, 0x20000); - memcpy(MSM6295ROMData + 0x180000, Kaneko16TempGfx + 0x000000, 0x20000); - memcpy(MSM6295ROMData + 0x1a0000, Kaneko16TempGfx + 0x0e0000, 0x20000); - BurnFree(Kaneko16TempGfx); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0x501000, 0x501fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0x502000, 0x502fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0x503000, 0x503fff, MAP_RAM); - SekMapMemory(Kaneko16Video3Ram , 0x580000, 0x580fff, MAP_RAM); - SekMapMemory(Kaneko16Video2Ram , 0x581000, 0x581fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl3Ram , 0x582000, 0x582fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl2Ram , 0x583000, 0x583fff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x600000, 0x601fff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x700000, 0x700fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0x800000, 0x80001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs + 2, 0x900002, 0x90001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16Layer1Regs , 0xb00000, 0xb0001f, MAP_WRITE); - SekSetReadByteHandler(0, ExplbrkrReadByte); - SekSetReadWordHandler(0, ExplbrkrReadWord); - SekSetWriteByteHandler(0, ExplbrkrWriteByte); - SekSetWriteWordHandler(0, ExplbrkrWriteWord); - SekClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - Kaneko16Eeprom = 1; - EEPROMInit(&eeprom_interface_93C46); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, &Kaneko16EepromRead, NULL, NULL, &Kaneko16EepromReset); - - // Setup the OKIM6295 emulation - MSM6295Init(0, (12000000 / 6) / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - Kaneko16FrameRender = ExplbrkrFrameRender; - - // Reset the driver - ExplbrkrDoReset(); - - return 0; -} - -static INT32 GtmrInit() -{ - INT32 nRet = 0, nLen; - - Gtmr = 1; - - Kaneko16NumSprites = 0x8400; - Kaneko16NumTiles = 0x4000; - Kaneko16NumTiles2 = 0x4000; - - Kaneko16VideoInit(); - Kaneko16ParseSprite = Kaneko16ParseSpriteType1; - - // Allocate and Blank all required memory - Mem = NULL; - GtmrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - GtmrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x840000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x600000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x800001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x800000, 8, 2); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 8, 16, 16, EightBppPlaneOffsets, EightBppXOffsets, EightBppYOffsets, 0x800, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x840000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 9, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x200000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - BurnFree(Kaneko16TempGfx); - memcpy(Kaneko16Tiles2, Kaneko16Tiles, Kaneko16NumTiles * 16 * 16); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROMData, 10, 1); if (nRet != 0) return 1; - ExpandSampleBanks(); - - ToyboxMCURun = GtmrMCURun; - Kaneko16FrameRender = GtmrFrameRender; - - nRet = GtmrMachineInit(); if (nRet != 0) return 1; - - // Reset the driver - GtmrDoReset(); - - return 0; -} - -static INT32 GtmroInit() -{ - INT32 nRet = 0, nLen; - - Gtmr = 1; - - Kaneko16NumSprites = 0x8400; - Kaneko16NumTiles = 0x4000; - Kaneko16NumTiles2 = 0x4000; - - Kaneko16VideoInit(); - Kaneko16ParseSprite = Kaneko16ParseSpriteType1; - - // Allocate and Blank all required memory - Mem = NULL; - GtmrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - GtmrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x840000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400000, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400001, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x600000, 9, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x600001, 10, 2); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 8, 16, 16, EightBppPlaneOffsets, EightBppXOffsets, EightBppYOffsets, 0x800, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x800000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 11, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000001, 12, 2); if (nRet != 0) return 1; - UnscrambleTiles(0x200000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - BurnFree(Kaneko16TempGfx); - memcpy(Kaneko16Tiles2, Kaneko16Tiles, Kaneko16NumTiles * 16 * 16); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROMData, 13, 1); if (nRet != 0) return 1; - ExpandSampleBanks(); - - ToyboxMCURun = GtmroMCURun; - Kaneko16FrameRender = GtmrFrameRender; - - nRet = GtmrMachineInit(); if (nRet != 0) return 1; - - // Reset the driver - GtmrDoReset(); - - return 0; -} - -static INT32 GtmrevoInit() -{ - INT32 nRet = 0, nLen; - - Gtmr = 1; - - Kaneko16NumSprites = 0x8000; - Kaneko16NumTiles = 0x4000; - Kaneko16NumTiles2 = 0x4000; - - Kaneko16VideoInit(); - Kaneko16ParseSprite = Kaneko16ParseSpriteType1; - - // Allocate and Blank all required memory - Mem = NULL; - GtmrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - GtmrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x800000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x600000, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x600001, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x600000, 6, 1); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 8, 16, 16, EightBppPlaneOffsets, EightBppXOffsets, EightBppYOffsets, 0x800, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x800000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 9, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x200000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - BurnFree(Kaneko16TempGfx); - memcpy(Kaneko16Tiles2, Kaneko16Tiles, Kaneko16NumTiles * 16 * 16); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROMData, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2, 11, 1); if (nRet != 0) return 1; - ExpandSampleBanks(); - - nRet = GtmrMachineInit(); if (nRet != 0) return 1; - - ToyboxMCURun = GtmrevoMCURun; - Kaneko16FrameRender = GtmrFrameRender; - - // Reset the driver - GtmrDoReset(); - - return 0; -} - -static INT32 Gtmr2Init() -{ - INT32 nRet = 0, nLen; - - Gtmr = 1; - - Kaneko16NumSprites = 0x8000; - Kaneko16NumTiles = 0x8800; - Kaneko16NumTiles2 = 0x8800; - - Kaneko16VideoInit(); - Kaneko16ParseSprite = Kaneko16ParseSpriteType1; - - // Allocate and Blank all required memory - Mem = NULL; - GtmrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - GtmrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x800000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x600000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x700000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x700001, 7, 2); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 8, 16, 16, EightBppPlaneOffsets, EightBppXOffsets, EightBppYOffsets, 0x800, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x800000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400000, 10, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400001, 11, 2); if (nRet != 0) return 1; - UnscrambleTiles(0x440000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - BurnFree(Kaneko16TempGfx); - memcpy(Kaneko16Tiles2, Kaneko16Tiles, Kaneko16NumTiles * 16 * 16); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROMData, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2 + 0x40000, 13, 1); if (nRet != 0) return 1; - ExpandSampleBanks(); - - nRet = GtmrMachineInit(); if (nRet != 0) return 1; - - ToyboxMCURun = GtmrevoMCURun; - Kaneko16FrameRender = GtmrFrameRender; - - // Reset the driver - GtmrDoReset(); - - return 0; -} - -static INT32 Gtmr2uInit() -{ - INT32 nRet = 0, nLen; - - Gtmr = 1; - - Kaneko16NumSprites = 0x8000; - Kaneko16NumTiles = 0x8800; - Kaneko16NumTiles2 = 0x8800; - - Kaneko16VideoInit(); - Kaneko16ParseSprite = Kaneko16ParseSpriteType1; - - // Allocate and Blank all required memory - Mem = NULL; - GtmrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - GtmrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x800000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x600000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x700000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x700001, 7, 2); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 8, 16, 16, EightBppPlaneOffsets, EightBppXOffsets, EightBppYOffsets, 0x800, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x800000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x200000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400000, 10, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x400001, 11, 2); if (nRet != 0) return 1; - UnscrambleTiles(0x440000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - BurnFree(Kaneko16TempGfx); - memcpy(Kaneko16Tiles2, Kaneko16Tiles, Kaneko16NumTiles * 16 * 16); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROMData, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2, 13, 1); if (nRet != 0) return 1; - ExpandSampleBanks(); - - nRet = GtmrMachineInit(); if (nRet != 0) return 1; - - ToyboxMCURun = GtmrevoMCURun; - Kaneko16FrameRender = GtmrFrameRender; - - // Reset the driver - GtmrDoReset(); - - return 0; -} - -static INT32 MgcrystlInit() -{ - INT32 nRet = 0, nLen; - - Mgcrystl = 1; - - Kaneko16NumSprites = 0x5000; - Kaneko16NumTiles = 0x2000; - Kaneko16NumTiles2 = 0x2000; - - Kaneko16VideoInit(); - - // Allocate and Blank all required memory - Mem = NULL; - ExplbrkrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - ExplbrkrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x280000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0180000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0200000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0220000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0240000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0260000, 4, 1); if (nRet != 0) return 1; - GfxDecode(Kaneko16NumSprites, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x280000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 5, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x100000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - memset(Kaneko16TempGfx, 0, 0x280000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x000000, 6, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x100000); - GfxDecode(Kaneko16NumTiles2, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles2); - BurnFree(Kaneko16TempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 7, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROMData, MSM6295ROM, 0x40000); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0x600000, 0x600fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0x601000, 0x601fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0x602000, 0x602fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0x603000, 0x603fff, MAP_RAM); - SekMapMemory(Kaneko16Video3Ram , 0x680000, 0x680fff, MAP_RAM); - SekMapMemory(Kaneko16Video2Ram , 0x681000, 0x681fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl3Ram , 0x682000, 0x682fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl2Ram , 0x683000, 0x683fff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x700000, 0x701fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0x800000, 0x80001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs + 2, 0x900002, 0x90001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16Layer1Regs , 0xb00000, 0xb0001f, MAP_WRITE); - SekSetReadByteHandler(0, MgcrystlReadByte); - SekSetReadWordHandler(0, ExplbrkrReadWord); - SekSetWriteByteHandler(0, ExplbrkrWriteByte); - SekSetWriteWordHandler(0, ExplbrkrWriteWord); - SekClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - Kaneko16Eeprom = 1; - EEPROMInit(&eeprom_interface_93C46); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, &Kaneko16EepromRead, NULL, NULL, &Kaneko16EepromReset); - - // Setup the OKIM6295 emulation - MSM6295Init(0, (12000000 / 4) / 165, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - Kaneko16FrameRender = MgcrystlFrameRender; - - // Reset the driver - ExplbrkrDoReset(); - - return 0; -} - -static INT32 ShogwarrInit() -{ - static const UINT16 shogwarr_default_eeprom[64] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x4B41, 0x4E45, 0x4B4F, 0x2F41, 0x544F, 0x5020, 0x3139, 0x3932, - 0x4655, 0x4A49, 0x5941, 0x4D41, 0x2042, 0x5553, 0x5445, 0x5220, - 0x2053, 0x484F, 0x4755, 0x4E20, 0x5741, 0x5252, 0x494F, 0x5253, - 0x636F, 0x7079, 0x7269, 0x6768, 0x7420, 0x4B41, 0x4E45, 0x4B4F, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000, 0xFFFF - }; - - Shogwarr = 1; - - INT32 nRet = 0, nLen; - - Kaneko16NumSprites = 0x10000; - Kaneko16NumTiles = 0x4000; - Kaneko16NumTiles2 = 0; - - Kaneko16VideoInit(); - Kaneko16SpriteXOffset = 0; - Kaneko16SpriteFlipType = 1; - - // Allocate and Blank all required memory - Mem = NULL; - ShogwarrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - ShogwarrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x800000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(Kaneko16McuRom, 2, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0200000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0300000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0400000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0500000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0600000, 9, 1); if (nRet != 0) return 1; - memset (Kaneko16TempGfx + 0x0700000, 0xff, 0x100000); - - GfxDecode(Kaneko16NumSprites, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x400000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 11, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x180000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - - BurnFree(Kaneko16TempGfx); - - nRet = BurnLoadRom(MSM6295ROMData + 0x000000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData + 0x080000, 13, 1); if (nRet != 0) return 1; - memcpy (MSM6295ROM + 0x000000, MSM6295ROMData, 0x30000); - - nRet = BurnLoadRom(MSM6295ROMData2 + 0x000000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2 + 0x100000, 15, 1); if (nRet != 0) return 1; - - memcpy (Kaneko16NVRam, shogwarr_default_eeprom, 0x80); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(Kaneko16MCURam , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x380000, 0x380fff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x580000, 0x581fff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0x600000, 0x600fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0x601000, 0x601fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0x602000, 0x602fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0x603000, 0x603fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0x800000, 0x80001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs , 0x900000, 0x90001f, MAP_WRITE); - SekSetReadByteHandler(0, ShogwarrReadByte); - SekSetReadWordHandler(0, ShogwarrReadWord); - SekSetWriteByteHandler(0, ShogwarrWriteByte); - SekSetWriteWordHandler(0, ShogwarrWriteWord); - SekClose(); - - MSM6295Init(0, (16000000 / 8) / 165, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(1, (16000000 / 8) / 165, 1); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - Kaneko16FrameRender = ShogwarrFrameRender; - - ShogwarrDoReset(); - - return 0; -} - -static INT32 ShogwarrkInit() -{ - static const UINT16 shogwarr_default_eeprom[64] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x4B41, 0x4E45, 0x4B4F, 0x2F41, 0x544F, 0x5020, 0x3139, 0x3932, - 0x4655, 0x4A49, 0x5941, 0x4D41, 0x2042, 0x5553, 0x5445, 0x5220, - 0x2053, 0x484F, 0x4755, 0x4E20, 0x5741, 0x5252, 0x494F, 0x5253, - 0x636F, 0x7079, 0x7269, 0x6768, 0x7420, 0x4B41, 0x4E45, 0x4B4F, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000, 0xFFFF - }; - - Shogwarr = 1; - - INT32 nRet = 0, nLen; - - Kaneko16NumSprites = 0x10000; - Kaneko16NumTiles = 0x4000; - Kaneko16NumTiles2 = 0; - - Kaneko16VideoInit(); - Kaneko16SpriteXOffset = 0; - Kaneko16SpriteFlipType = 1; - - // Allocate and Blank all required memory - Mem = NULL; - ShogwarrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - ShogwarrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x800000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(Kaneko16McuRom, 2, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0200000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0300000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0400000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0500000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0600000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0700000, 10, 1); if (nRet != 0) return 1; - memset (Kaneko16TempGfx + 0x0780000, 0xff, 0x080000); - - GfxDecode(Kaneko16NumSprites, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x400000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 12, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x180000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - - BurnFree(Kaneko16TempGfx); - - nRet = BurnLoadRom(MSM6295ROMData + 0x000000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData + 0x080000, 14, 1); if (nRet != 0) return 1; - memcpy (MSM6295ROM + 0x000000, MSM6295ROMData, 0x30000); - - nRet = BurnLoadRom(MSM6295ROMData2 + 0x000000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2 + 0x100000, 16, 1); if (nRet != 0) return 1; - - memcpy (Kaneko16NVRam, shogwarr_default_eeprom, 0x80); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(Kaneko16MCURam , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x380000, 0x380fff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x580000, 0x581fff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0x600000, 0x600fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0x601000, 0x601fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0x602000, 0x602fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0x603000, 0x603fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0x800000, 0x80001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs , 0x900000, 0x90001f, MAP_WRITE); - SekSetReadByteHandler(0, ShogwarrReadByte); - SekSetReadWordHandler(0, ShogwarrReadWord); - SekSetWriteByteHandler(0, ShogwarrWriteByte); - SekSetWriteWordHandler(0, ShogwarrWriteWord); - SekClose(); - - MSM6295Init(0, (16000000 / 8) / 165, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(1, (16000000 / 8) / 165, 1); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - Kaneko16FrameRender = ShogwarrFrameRender; - - ShogwarrDoReset(); - - return 0; -} - -static INT32 BrapboysInit() -{ - static const UINT16 brapboys_default_eeprom[64] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0005, 0x0006, 0x2030, 0x0003, 0x6818, 0x0101, 0x0101, - 0x0101, 0x0001, 0x0004, 0x0008, 0x4B41, 0x4E45, 0x4B4F, 0x2020, - 0x4265, 0x2052, 0x6170, 0x2042, 0x6F79, 0x7300, 0x3030, 0x302E, - 0x3038, 0x10FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0035, 0xFFFF, 0xFFFF, 0xFFFF - }; - - INT32 nRet = 0, nLen; - - Kaneko16NumSprites = 0x10000; - Kaneko16NumTiles = 0x8000; - Kaneko16NumTiles2 = 0; - - Kaneko16VideoInit(); - Kaneko16SpriteXOffset = 0; - Kaneko16SpriteFlipType = 1; - - // Allocate and Blank all required memory - Mem = NULL; - ShogwarrMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - ShogwarrMemIndex(); - - Kaneko16TempGfx = (UINT8*)BurnMalloc(0x800000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Kaneko16Rom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16Rom + 0x00000, 1, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(Kaneko16McuRom, 2, 1); if (nRet != 0) return 1; - - // Load and Decode Sprite Roms - memset (Kaneko16TempGfx, 0xff, 0x800000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0200000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0300000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0400000, 7, 1); if (nRet != 0) return 1; - memcpy (Kaneko16TempGfx + 0x0480000, Kaneko16TempGfx + 0x0400000, 0x0080000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0500000, 8, 1); if (nRet != 0) return 1; - - BurnLoadRom(Kaneko16TempGfx + 0x580000, 17, 1); // brapboysj / brapboysu - - GfxDecode(Kaneko16NumSprites, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Sprites); - - // Load and Decode Tile Roms - memset(Kaneko16TempGfx, 0, 0x400000); - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0000000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0100000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0200000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Kaneko16TempGfx + 0x0300000, 12, 1); if (nRet != 0) return 1; - UnscrambleTiles(0x400000); - GfxDecode(Kaneko16NumTiles, 4, 16, 16, FourBppPlaneOffsets, FourBppXOffsets, FourBppYOffsets, 0x400, Kaneko16TempGfx, Kaneko16Tiles); - - BurnFree(Kaneko16TempGfx); - - nRet = BurnLoadRom(MSM6295ROMData + 0x000000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData + 0x080000, 14, 1); if (nRet != 0) return 1; - memcpy (MSM6295ROM + 0x000000, MSM6295ROMData, 0x30000); - - nRet = BurnLoadRom(MSM6295ROMData2 + 0x000000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROMData2 + 0x100000, 16, 1); if (nRet != 0) return 1; - memcpy (MSM6295ROM + 0x100000, MSM6295ROMData2, 0x20000); - - memcpy (Kaneko16NVRam, brapboys_default_eeprom, 0x80); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Kaneko16Rom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Kaneko16Ram , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(Kaneko16MCURam , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(Kaneko16PaletteRam , 0x380000, 0x380fff, MAP_RAM); - SekMapMemory(Kaneko16SpriteRam , 0x580000, 0x581fff, MAP_RAM); - SekMapMemory(Kaneko16Video1Ram , 0x600000, 0x600fff, MAP_RAM); - SekMapMemory(Kaneko16Video0Ram , 0x601000, 0x601fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl1Ram , 0x602000, 0x602fff, MAP_RAM); - SekMapMemory(Kaneko16VScrl0Ram , 0x603000, 0x603fff, MAP_RAM); - SekMapMemory((UINT8*)Kaneko16Layer0Regs , 0x800000, 0x80001f, MAP_WRITE); - SekMapMemory((UINT8*)Kaneko16SpriteRegs , 0x900000, 0x90001f, MAP_WRITE); - SekSetReadByteHandler(0, ShogwarrReadByte); - SekSetReadWordHandler(0, ShogwarrReadWord); - SekSetWriteByteHandler(0, ShogwarrWriteByte); - SekSetWriteWordHandler(0, ShogwarrWriteWord); - SekClose(); - - MSM6295Init(0, (16000000 / 8) / 165, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(1, (16000000 / 8) / 165, 1); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - Kaneko16FrameRender = ShogwarrFrameRender; - - ShogwarrDoReset(); - - return 0; -} - -static INT32 Kaneko16Exit() -{ - SekExit(); - if (Kaneko16Eeprom) EEPROMExit(); - - GenericTilesExit(); - - BurnFree(Mem); - BurnFree(spritelist.first_sprite); - - Kaneko16NumTiles = 0; - Kaneko16NumTiles2 = 0; - Kaneko16NumSprites = 0; - Kaneko16SpriteFlipX = 0; - Kaneko16SpriteFlipY = 0; - Kaneko16SpritesColourOffset = 0; - Kaneko16SpritesColourMask = 0; - Kaneko16LayersColourOffset = 0; - Kaneko16DisplayEnable = 0; - Kaneko168BppSprites = 0; - Kaneko16Eeprom = 0; - Kaneko16NVRam = NULL; - Kaneko16TilesXOffset = 0; - Kaneko16TilesYOffset = 0; - Kaneko16Bg15 = 0; - Kaneko16Bg15Reg = 0; - Kaneko16Bg15Select = 0; - Kaneko16RecalcBg15Palette = 0; - Kaneko16SpriteRamSize = 0; - Kaneko16SpriteXOffset = 0; - Kaneko16SoundLatch = 0; - MSM6295Bank0 = 0; - MSM6295Bank1 = 0; - memset(Kaneko16SpriteRegs, 0, 0x20 * sizeof(UINT16)); - memset(Kaneko16Layer0Regs, 0, 0x10 * sizeof(UINT16)); - memset(Kaneko16Layer1Regs, 0, 0x10 * sizeof(UINT16)); - memset(ToyboxMCUCom, 0, 0x04 * sizeof(UINT16)); - - ToyboxMCURun = NULL; - Kaneko16FrameRender = NULL; - Kaneko16ParseSprite = NULL; - - Gtmr = 0; - Bloodwar = 0; - Bonkadv = 0; - Mgcrystl = 0; - Shogwarr = 0; - - return 0; -} - -static INT32 BerlwallExit() -{ - AY8910Exit(0); - AY8910Exit(1); - MSM6295Exit(0); - - return Kaneko16Exit(); -} - -static INT32 BlazeonExit() -{ - ZetExit(); - BurnYM2151Exit(); - - return Kaneko16Exit(); -} - -static INT32 WingforcExit() -{ - ZetExit(); - BurnYM2151Exit(); - MSM6295Exit(0); - - return Kaneko16Exit(); -} - -static INT32 GtmrMachineExit() -{ - MSM6295Exit(0); - MSM6295Exit(1); - - return Kaneko16Exit(); -} - -static INT32 ExplbrkrExit() -{ - AY8910Exit(0); - AY8910Exit(1); - MSM6295Exit(0); - - return Kaneko16Exit(); -} - -/*============================================================================================== -Sprite Rendering -===============================================================================================*/ - -#define USE_LATCHED_XY 1 -#define USE_LATCHED_CODE 2 -#define USE_LATCHED_COLOUR 4 - -static INT32 Kaneko16ParseSpriteType0(INT32 i, struct tempsprite *s) -{ - INT32 Attr, xOffs, Offset; - UINT16 *SpriteRam = (UINT16*)Kaneko16SpriteRam; - - Offset = (i * 8) >> 1; - - if (Offset >= (Kaneko16SpriteRamSize >> 1)) return -1; - - Attr = SpriteRam[Offset + 0]; - s->code = SpriteRam[Offset + 1]; - s->x = SpriteRam[Offset + 2]; - s->y = SpriteRam[Offset + 3]; - - s->color = (Attr & 0xfc) >> 2; - s->priority = (Attr & 0x300) >> 8; - s->flipy = Attr & 0x001; - s->flipx = Attr & 0x002; - - xOffs = (Attr & 0x1800) >> 11; - s->yoffs = Kaneko16SpriteRegs[0x08 + (xOffs * 2) + 1]; - s->xoffs = Kaneko16SpriteRegs[0x08 + (xOffs * 2) + 0]; - - s->yoffs -= Kaneko16SpriteRegs[0x01]; - - return ((Attr & 0x2000) ? USE_LATCHED_XY : 0) | ((Attr & 0x4000) ? USE_LATCHED_COLOUR: 0) | ((Attr & 0x8000) ? USE_LATCHED_CODE : 0); -} - -static INT32 Kaneko16ParseSpriteType1(INT32 i, struct tempsprite *s) -{ - INT32 Attr, xOffs, Offset; - UINT16 *SpriteRam = (UINT16*)Kaneko16SpriteRam; - - Offset = (i * 8) >> 1; - - if (Offset >= (Kaneko16SpriteRamSize >> 1)) return -1; - - Attr = SpriteRam[Offset + 0]; - s->code = SpriteRam[Offset + 1]; - s->x = SpriteRam[Offset + 2]; - s->y = SpriteRam[Offset + 3]; - - s->color = Attr & 0x3f; - s->priority = (Attr & 0xc0) >> 6; - s->flipy = Attr & 0x100; - s->flipx = Attr & 0x200; - s->code += (s->y & 1) << 16; - - xOffs = (Attr & 0x1800) >> 11; - s->yoffs = Kaneko16SpriteRegs[0x08 + (xOffs * 2) + 1]; - s->xoffs = Kaneko16SpriteRegs[0x08 + (xOffs * 2) + 0]; - - s->yoffs -= Kaneko16SpriteRegs[0x01]; - - return ((Attr & 0x2000) ? USE_LATCHED_XY : 0) | ((Attr & 0x4000) ? USE_LATCHED_COLOUR: 0) | ((Attr & 0x8000) ? USE_LATCHED_CODE : 0); -} - -static INT32 Kaneko16ParseSpriteType2(INT32 i, struct tempsprite *s) -{ - INT32 Attr, xOffs, Offset; - UINT16 *SpriteRam = (UINT16*)Kaneko16SpriteRam; - - Offset = (i * (16 >> 1)) + (8 >> 1); - - if (Offset >= (Kaneko16SpriteRamSize >> 1)) return -1; - - Attr = SpriteRam[Offset + 0]; - s->code = SpriteRam[Offset + 1]; - s->x = SpriteRam[Offset + 2]; - s->y = SpriteRam[Offset + 3]; - - s->color = (Attr & 0xfc) >> 2; - s->priority = (Attr & 0x300) >> 8; - s->flipy = Attr & 0x001; - s->flipx = Attr & 0x002; - - xOffs = (Attr & 0x1800) >> 11; - s->yoffs = Kaneko16SpriteRegs[0x08 + (xOffs * 2) + 1]; - s->xoffs = Kaneko16SpriteRegs[0x08 + (xOffs * 2) + 0]; - - s->yoffs -= Kaneko16SpriteRegs[0x01]; - - return ((Attr & 0x2000) ? USE_LATCHED_XY : 0) | ((Attr & 0x4000) ? USE_LATCHED_COLOUR: 0) | ((Attr & 0x8000) ? USE_LATCHED_CODE : 0); -} - -static void Kaneko16RenderSprite(UINT32 Code, UINT32 Colour, INT32 FlipX, INT32 FlipY, INT32 sx, INT32 sy) -{ - UINT8 *SourceBase = Kaneko16Sprites + ((Code % Kaneko16NumSprites) * 256); - - INT32 SpriteScreenHeight = ((1 << 16) * 16 + 0x8000) >> 16; - INT32 SpriteScreenWidth = ((1 << 16) * 16 + 0x8000) >> 16; - - if (Kaneko168BppSprites) { - Colour = 0x100 * (Colour % 0x40); - } else { - Colour = 0x10 * (Colour % 0x40); - } - - if (SpriteScreenHeight && SpriteScreenWidth) { - INT32 dx = (16 << 16) / SpriteScreenWidth; - INT32 dy = (16 << 16) / SpriteScreenHeight; - - INT32 ex = sx + SpriteScreenWidth; - INT32 ey = sy + SpriteScreenHeight; - - INT32 xIndexBase; - INT32 yIndex; - - if (FlipX) { - xIndexBase = (SpriteScreenWidth - 1) * dx; - dx = -dx; - } else { - xIndexBase = 0; - } - - if (FlipY) { - yIndex = (SpriteScreenHeight - 1) * dy; - dy = -dy; - } else { - yIndex = 0; - } - - if (sx < 0) { - INT32 Pixels = 0 - sx; - sx += Pixels; - xIndexBase += Pixels * dx; - } - - if (sy < 0) { - INT32 Pixels = 0 - sy; - sy += Pixels; - yIndex += Pixels * dy; - } - - if (ex > nScreenWidth + 1) { - INT32 Pixels = ex - nScreenWidth - 1; - ex -= Pixels; - } - - if (ey > nScreenHeight + 1) { - INT32 Pixels = ey - nScreenHeight - 1; - ey -= Pixels; - } - - if (ex > sx) { - INT32 y; - - for (y = sy; y < ey; y++) { - UINT8 *Source = SourceBase + ((yIndex >> 16) * 16); - UINT16* pPixel = pTransDraw + (y * nScreenWidth); - - if (y < 0 || y > (nScreenHeight - 1)) continue; - - INT32 x, xIndex = xIndexBase; - for (x = sx; x > 16]; - if (c != 0) { - if (x >= 0 && x < nScreenWidth) pPixel[x] = (c | Colour | Kaneko16SpritesColourOffset) & Kaneko16SpritesColourMask; - } - xIndex += dx; - } - - yIndex += dy; - } - } - } -} - -static void Kaneko16RenderSprites(INT32 PriorityDraw) -{ - struct tempsprite *s = spritelist.first_sprite; - - INT32 i = 0; - INT32 x = 0; - INT32 y = 0; - INT32 Colour = 0; - INT32 Code = 0; - INT32 Priority = 0; - INT32 xOffs = 0; - INT32 yOffs = 0; - INT32 FlipX = 0; - INT32 FlipY = 0; - - while (1) { - INT32 Flags; - - Flags = Kaneko16ParseSprite(i, s); - - if (Flags == -1) break; - - if (Flags & USE_LATCHED_CODE) { - s->code = ++Code; - } else { - Code = s->code; - } - - if (Flags & USE_LATCHED_COLOUR) { - s->color = Colour; - s->priority = Priority; - s->xoffs = xOffs; - s->yoffs = yOffs; - if (Kaneko16SpriteFlipType == 0) { - s->flipx = FlipX; - s->flipy = FlipY; - } - } else { - Colour = s->color; - Priority = s->priority; - xOffs = s->xoffs; - yOffs = s->yoffs; - if (Kaneko16SpriteFlipType == 0) { - FlipX = s->flipx; - FlipY = s->flipy; - } - } - - if (Kaneko16SpriteFlipType == 1) { - FlipX = s->flipx; - FlipY = s->flipy; - } - - if (Flags & USE_LATCHED_XY) - { - s->x += x; - s->y += y; - } - - x = s->x; - y = s->y; - - s->x = s->xoffs + s->x; - s->y = s->yoffs + s->y; - - s->x += Kaneko16SpriteXOffset; - - s->x = ((s->x & 0x7fc0) - (s->x & 0x8000)) / 0x40; - s->y = ((s->y & 0x7fc0) - (s->y & 0x8000)) / 0x40; - - i++; - s++; - } - - for (s = spritelist.first_sprite; s < spritelist.first_sprite + 0x400; s++) { - if (s->priority == PriorityDraw) Kaneko16RenderSprite(s->code, s->color, s->flipx, s->flipy, s->x, s->y); - } -} - -static void Kaneko16RenderSprite_Wingforc(UINT32 Code, UINT32 Colour, INT32 FlipX, INT32 FlipY, INT32 sx, INT32 sy, INT32 priority) -{ - UINT8 *SourceBase = Kaneko16Sprites + ((Code % Kaneko16NumSprites) * 256); - - INT32 SpriteScreenHeight = ((1 << 16) * 16 + 0x8000) >> 16; - INT32 SpriteScreenWidth = ((1 << 16) * 16 + 0x8000) >> 16; - - if (Kaneko168BppSprites) { - Colour = 0x100 * (Colour % 0x40); - } else { - Colour = 0x10 * (Colour % 0x40); - } - - if (SpriteScreenHeight && SpriteScreenWidth) { - INT32 dx = (16 << 16) / SpriteScreenWidth; - INT32 dy = (16 << 16) / SpriteScreenHeight; - - INT32 ex = sx + SpriteScreenWidth; - INT32 ey = sy + SpriteScreenHeight; - - INT32 xIndexBase; - INT32 yIndex; - - if (FlipX) { - xIndexBase = (SpriteScreenWidth - 1) * dx; - dx = -dx; - } else { - xIndexBase = 0; - } - - if (FlipY) { - yIndex = (SpriteScreenHeight - 1) * dy; - dy = -dy; - } else { - yIndex = 0; - } - - if (sx < 0) { - INT32 Pixels = 0 - sx; - sx += Pixels; - xIndexBase += Pixels * dx; - } - - if (sy < 0) { - INT32 Pixels = 0 - sy; - sy += Pixels; - yIndex += Pixels * dy; - } - - if (ex > nScreenWidth + 1) { - INT32 Pixels = ex - nScreenWidth - 1; - ex -= Pixels; - } - - if (ey > nScreenHeight + 1) { - INT32 Pixels = ey - nScreenHeight - 1; - ey -= Pixels; - } - - if (ex > sx) { - INT32 y; - - for (y = sy; y < ey; y++) { - UINT8 *Source = SourceBase + ((yIndex >> 16) * 16); - UINT16* pPixel = pTransDraw + (y * nScreenWidth); - UINT8 *pri = DrvPrioBitmap + (y * nScreenWidth); - - if (y < 0 || y > (nScreenHeight - 1)) continue; - - INT32 x, xIndex = xIndexBase; - for (x = sx; x > 16]; - if (c != 0) { - // If we haven't drawn a sprite here yet, do so. - if (!(pri[x] & 0x10)) - { - if (pri[x] < priority) { - if (x >= 0 && x < nScreenWidth) pPixel[x] = (c | Colour | Kaneko16SpritesColourOffset) & Kaneko16SpritesColourMask; - } - // Mark that we (tried to) draw a sprite. - pri[x] |= 0x10; - } - } - xIndex += dx; - } - - yIndex += dy; - } - } - } -} - -static void Kaneko16RenderSprites_Wingforc() -{ - struct tempsprite *s = spritelist.first_sprite; - - INT32 i = 0; - INT32 x = 0; - INT32 y = 0; - INT32 Colour = 0; - INT32 Code = 0; - INT32 Priority = 0; - INT32 xOffs = 0; - INT32 yOffs = 0; - INT32 FlipX = 0; - INT32 FlipY = 0; - - while (1) { - INT32 Flags; - - Flags = Kaneko16ParseSprite(i, s); - - if (Flags == -1) break; - - if (Flags & USE_LATCHED_CODE) { - s->code = ++Code; - } else { - Code = s->code; - } - - if (Flags & USE_LATCHED_COLOUR) { - s->color = Colour; - s->priority = Priority; - s->xoffs = xOffs; - s->yoffs = yOffs; - if (Kaneko16SpriteFlipType == 0) { - s->flipx = FlipX; - s->flipy = FlipY; - } - } else { - Colour = s->color; - Priority = s->priority; - xOffs = s->xoffs; - yOffs = s->yoffs; - if (Kaneko16SpriteFlipType == 0) { - FlipX = s->flipx; - FlipY = s->flipy; - } - } - - if (Kaneko16SpriteFlipType == 1) { - FlipX = s->flipx; - FlipY = s->flipy; - } - - if (Flags & USE_LATCHED_XY) - { - s->x += x; - s->y += y; - } - - x = s->x; - y = s->y; - - s->x = s->xoffs + s->x; - s->y = s->yoffs + s->y; - - s->x += Kaneko16SpriteXOffset; - - s->x = ((s->x & 0x7fc0) - (s->x & 0x8000)) / 0x40; - s->y = ((s->y & 0x7fc0) - (s->y & 0x8000)) / 0x40; - - i++; - s++; - } - - for (s--; s >= spritelist.first_sprite; s--) { - INT32 curr_pri = s->priority; - - UINT32 primask = spritepriomask[curr_pri]; - Kaneko16RenderSprite_Wingforc(s->code, s->color, s->flipx, s->flipy, s->x, s->y, primask); - } -} - -#undef USE_LATCHED_XY -#undef USE_LATCHED_CODE -#undef USE_LATCHED_COLOUR - -/*============================================================================================== -Tile Rendering -===============================================================================================*/ - -static INT32 Kaneko16GetLayerFlipOffset(INT32 curroffs) -{ - if (curroffs == 0) return 15; - if (curroffs == 1) return 14; - if (curroffs == 2) return 13; - if (curroffs == 3) return 12; - if (curroffs == 4) return 11; - if (curroffs == 5) return 10; - if (curroffs == 6) return 9; - if (curroffs == 7) return 8; - if (curroffs == 8) return 7; - if (curroffs == 9) return 6; - if (curroffs == 10) return 5; - if (curroffs == 11) return 4; - if (curroffs == 12) return 3; - if (curroffs == 13) return 2; - if (curroffs == 14) return 1; - if (curroffs == 15) return 0; - - return 0; -} - -static void Kaneko16QueueTilesLayer(INT32 Layer) -{ - INT32 x, y, mx, my, px, py, Code, Attr, Colour, Flip, Priority, LineScroll, TileIndex, pSrcXOffs, pSrcYOffs, xScroll, yScroll; - UINT8 pTileSrc; - - LayerQueueSize[Layer] = 0; - TileIndex = 0; - - UINT16 *VRAM = NULL; - UINT16 *VSCROLLRAM = NULL; - UINT16 *LAYERREGS = NULL; - UINT8 *TILEDATA = NULL; - INT32 xScrollReg = 0; - INT32 yScrollReg = 0; - INT32 xOffs = 0; - INT32 numTiles = 0; - - switch (Layer) { - case 0: { - VRAM = (UINT16*)Kaneko16Video0Ram; - VSCROLLRAM = (UINT16*)Kaneko16VScrl0Ram; - LAYERREGS = Kaneko16Layer0Regs; - TILEDATA = Kaneko16Tiles; - xScrollReg = 2; - yScrollReg = 3; - xOffs = 0; - numTiles = Kaneko16NumTiles; - break; - } - - case 1: { - VRAM = (UINT16*)Kaneko16Video1Ram; - VSCROLLRAM = (UINT16*)Kaneko16VScrl1Ram; - LAYERREGS = Kaneko16Layer0Regs; - TILEDATA = Kaneko16Tiles; - xScrollReg = 0; - yScrollReg = 1; - xOffs = 2; - numTiles = Kaneko16NumTiles; - break; - } - - case 2: { - VRAM = (UINT16*)Kaneko16Video2Ram; - VSCROLLRAM = (UINT16*)Kaneko16VScrl2Ram; - LAYERREGS = Kaneko16Layer1Regs; - TILEDATA = Kaneko16Tiles2; - xScrollReg = 2; - yScrollReg = 3; - xOffs = 0; - numTiles = Kaneko16NumTiles2; - break; - } - - case 3: { - VRAM = (UINT16*)Kaneko16Video3Ram; - VSCROLLRAM = (UINT16*)Kaneko16VScrl3Ram; - LAYERREGS = Kaneko16Layer1Regs; - TILEDATA = Kaneko16Tiles2; - xScrollReg = 0; - yScrollReg = 1; - xOffs = 2; - numTiles = Kaneko16NumTiles2; - break; - } - } - - xScroll = LAYERREGS[xScrollReg]; - xOffs = Kaneko16TilesXOffset + xOffs; - yScroll = ((LAYERREGS[yScrollReg] >> 6) & 0x1ff) - Kaneko16TilesYOffset; - - mx = my = -1; - for (y = 0; y < 512; y++) { - if (!(y % 16)) my++; - - LineScroll = VSCROLLRAM[y]; - py = y - yScroll; - - if (py < -30) py += 512; - - for (x = 0; x < 512; x++) { - if (!(x % 16)) mx++; - - if (py < 0 || py >= nScreenHeight) continue; - - px = x - (((xScroll + LineScroll) >> 6) & 0x1ff) - xOffs; - if (px < -7) px += 512; - - if (px < 0 || px >= nScreenWidth) continue; - - TileIndex = ((my * 32) + mx) * 2; - - if (numTiles & 0xfff) - { // gtmr2 - Code = VRAM[TileIndex + 1]; - if (Code >= numTiles) continue; - } else { - Code = VRAM[TileIndex + 1] & (numTiles - 1); - } - Attr = VRAM[TileIndex + 0]; - Priority = (Attr >> 8) & 7; - Colour = (Attr >> 2) & 0x3f; - Flip = Attr & 3; - - pSrcXOffs = x % 16; - pSrcYOffs = y % 16; - if (Flip & 1) pSrcYOffs = Kaneko16GetLayerFlipOffset(pSrcYOffs); - if (Flip & 2) pSrcXOffs = Kaneko16GetLayerFlipOffset(pSrcXOffs); - - pTileSrc = TILEDATA[(Code << 8) + (pSrcYOffs * 16) + pSrcXOffs]; - - if (pTileSrc != 0) { - LayerQueueXY[Layer][LayerQueueSize[Layer]] = (py << 9) | px; - LayerQueueColour[Layer][LayerQueueSize[Layer]] = (Colour << 4) | pTileSrc; - LayerQueuePriority[Layer][LayerQueueSize[Layer]] = Priority; - LayerQueueSize[Layer]++; - } - } - mx = -1; - } -} - -static void Kaneko16RenderLayerQueue(INT32 Layer, INT32 Priority) -{ - for (INT32 i = 0; i < LayerQueueSize[Layer]; i++) { - if (LayerQueuePriority[Layer][i] == Priority) { - INT32 x = (LayerQueueXY[Layer][i] & 0x1ff); - INT32 y = (LayerQueueXY[Layer][i] >> 9); - UINT16* pPixel = pTransDraw + (y * nScreenWidth) + x; - pPixel[0] = LayerQueueColour[Layer][i] | Kaneko16LayersColourOffset; - - if (DrvPrioBitmap) { - UINT8 *pri = DrvPrioBitmap + (y * nScreenWidth); - pri[x] = Priority; - } - } - } -} - -static void RenderTileCPMP(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, INT32 offset, INT32 priority, UINT8 *gfx) -{ - UINT16 *dest = pTransDraw; - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - if (!pxl) continue; // transparency - - dest[sy * nScreenWidth + sx] = pxl | (color << 4) | offset; - - if (DrvPrioBitmap) { - UINT8 *pri = DrvPrioBitmap + (sy * nScreenWidth); - pri[sx] = priority; - } - } - sx -= width; - } -} - -static void Kaneko16RenderTileLayer(INT32 Layer, INT32 PriorityDraw, INT32 xScroll) -{ - INT32 mx, my, Code, Attr, Colour, Flip, Priority, x, y, TileIndex = 0; - - UINT16 *VRAM = NULL; - UINT16 *LAYERREGS = NULL; - UINT8 *TILEDATA = NULL; - INT32 yScrollReg = 0; - INT32 xOffs = 0; - INT32 numTiles = 0; - - switch (Layer) { - case 0: { - VRAM = (UINT16*)Kaneko16Video0Ram; - LAYERREGS = Kaneko16Layer0Regs; - TILEDATA = Kaneko16Tiles; - yScrollReg = 3; - xOffs = 0; - numTiles = Kaneko16NumTiles; - break; - } - - case 1: { - VRAM = (UINT16*)Kaneko16Video1Ram; - LAYERREGS = Kaneko16Layer0Regs; - TILEDATA = Kaneko16Tiles; - yScrollReg = 1; - xOffs = 2; - numTiles = Kaneko16NumTiles; - break; - } - - case 2: { - VRAM = (UINT16*)Kaneko16Video2Ram; - LAYERREGS = Kaneko16Layer1Regs; - TILEDATA = Kaneko16Tiles2; - yScrollReg = 3; - xOffs = 0; - numTiles = Kaneko16NumTiles2; - break; - } - - case 3: { - VRAM = (UINT16*)Kaneko16Video3Ram; - LAYERREGS = Kaneko16Layer1Regs; - TILEDATA = Kaneko16Tiles2; - yScrollReg = 1; - xOffs = 2; - numTiles = Kaneko16NumTiles2; - break; - } - } - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - - if (numTiles & 0xfff) - { // gtmr2 - Code = VRAM[TileIndex + 1]; - if (Code >= numTiles) continue; - } else { - Code = VRAM[TileIndex + 1] & (numTiles - 1); - } - - Attr = VRAM[TileIndex + 0]; - Colour = (Attr >> 2) & 0x3f; - Flip = Attr & 3; - Priority = (Attr >> 8) & 7; - - if (Priority == PriorityDraw) { - x = 16 * mx; - y = 16 * my; - - x -= (xScroll >> 6) & 0x1ff; - y -= (LAYERREGS[yScrollReg] >> 6) & 0x1ff; - - if (x < -7) x += 512; - if (y < -30) y += 512; - - x -= Kaneko16TilesXOffset + xOffs; - y += Kaneko16TilesYOffset; - - if (Flip == 0) RenderTileCPMP(Code, Colour, x, y, 0, 0, 16, 16, Kaneko16LayersColourOffset, Priority, TILEDATA); - if (Flip == 1) RenderTileCPMP(Code, Colour, x, y, 0, 1, 16, 16, Kaneko16LayersColourOffset, Priority, TILEDATA); - if (Flip == 2) RenderTileCPMP(Code, Colour, x, y, 1, 0, 16, 16, Kaneko16LayersColourOffset, Priority, TILEDATA); - if (Flip == 3) RenderTileCPMP(Code, Colour, x, y, 1, 1, 16, 16, Kaneko16LayersColourOffset, Priority, TILEDATA); -#if 0 - if (x > 0 && x < (nScreenWidth - 16) && y > 0 && y < (nScreenHeight - 16)) { - if (Flip == 0) Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, Kaneko16LayersColourOffset, TILEDATA); - if (Flip == 1) Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, Kaneko16LayersColourOffset, TILEDATA); - if (Flip == 2) Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, Kaneko16LayersColourOffset, TILEDATA); - if (Flip == 3) Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, Kaneko16LayersColourOffset, TILEDATA); - } else { - if (Flip == 0) Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, Kaneko16LayersColourOffset, TILEDATA); - if (Flip == 1) Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, Kaneko16LayersColourOffset, TILEDATA); - if (Flip == 2) Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, Kaneko16LayersColourOffset, TILEDATA); - if (Flip == 3) Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, Kaneko16LayersColourOffset, TILEDATA); - } -#endif - } - - TileIndex += 2; - } - } -} - -/*============================================================================================== -Background Bitmap Rendering -===============================================================================================*/ - -static void Kaneko16RenderBg15Bitmap() -{ - INT32 Select = Kaneko16Bg15Select; - INT32 Flip = Select & 0x20; - INT32 x, y; - - if (Flip) Select ^= 0x1f; - Select &= 0x1f; - - for (y = 0; y < nScreenHeight; y++) { - UINT16 *pPixel = pTransDraw + (y * nScreenWidth); - UINT16 *data = Kaneko16Bg15Data + (Select * 256 * 256) + ((y + 16) * 256); - - for (x = 0; x < nScreenWidth; x++) { - pPixel[x] = data[x]; - } - } -} - -/*============================================================================================== -Palette Handling -===============================================================================================*/ - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal5bit(nColour >> 5); - g = pal5bit(nColour >> 10); - b = pal5bit(nColour >> 0); - - return BurnHighCol(r, g, b, 0); -} - -INT32 Kaneko16CalcPalette(INT32 num) -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)Kaneko16PaletteRam, pd = Kaneko16Palette; i < num; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } - - return 0; -} - -/*============================================================================================== -Graphics Rendering -===============================================================================================*/ - -// If the VScroll RAM is the same all the way through then just apply it as an xScroll value - much faster then doing line scroll on every line -#define HANDLE_VSCROLL(_N_) \ - if (Layer##_N_##Enabled) { \ - INT32 vScrollFast = 1; \ - UINT16 *VSCROLLRAM = (UINT16*)Kaneko16VScrl##_N_##Ram; \ - INT32 LineScroll = VSCROLLRAM[0]; \ - for (i = 0; i < 0x200; i++) { \ - if (VSCROLLRAM[i] != LineScroll) { \ - vScrollFast = 0; \ - break; \ - } \ - } \ - if (!vScrollFast) { \ - vScroll##_N_##Enabled = 1; \ - Kaneko16QueueTilesLayer(_N_); \ - } else { \ - vScroll##_N_##Enabled = 0; \ - xScroll##_N_ += LineScroll; \ - } \ - } \ -\ - -static void BerlwallFrameRender() -{ - INT32 i; - INT32 Layer0Enabled = 0; - INT32 Layer1Enabled = 0; - - INT32 vScroll0Enabled = 0; - INT32 vScroll1Enabled = 0; - - INT32 xScroll0 = Kaneko16Layer0Regs[2]; - INT32 xScroll1 = Kaneko16Layer0Regs[0]; - - if (~Kaneko16Layer0Regs[4] & 0x1000) Layer0Enabled = 1; - if (~Kaneko16Layer0Regs[4] & 0x0010) Layer1Enabled = 1; - - BurnTransferClear(); - Kaneko16CalcPalette(0x0800); - - - if (Kaneko16RecalcBg15Palette) { - INT32 nBrightness = (Kaneko16Brightness * 100) / 255; - - if (Kaneko16Dip[2] & 1) nBrightness = 100; // disable brightness - - if (nBrightness == 0) { - for (i = 0; i < 32768; i++) { - Kaneko16Palette[i + 2048] = 0; - } - } else { - for (i = 0; i < 32768; i++) { - INT32 r = (pal5bit(i >> 5) * nBrightness) / 100; - INT32 g = (pal5bit(i >> 10) * nBrightness) / 100; - INT32 b = (pal5bit(i >> 0) * nBrightness) / 100; - - Kaneko16Palette[i + 2048] = BurnHighCol(r, g, b, 0); - } - } - - Kaneko16RecalcBg15Palette = 0; - } - - if (Kaneko16Layer0Regs[4] & 0x800) { - HANDLE_VSCROLL(0) - } - - if (Kaneko16Layer0Regs[4] & 0x008) { - HANDLE_VSCROLL(1) - } - - Kaneko16RenderBg15Bitmap(); - - for (i = 0; i < 8; i++) { - if (Layer0Enabled) { if (vScroll0Enabled) { Kaneko16RenderLayerQueue(0, i); } else { Kaneko16RenderTileLayer(0, i, xScroll0); }} - if (Layer1Enabled) { if (vScroll1Enabled) { Kaneko16RenderLayerQueue(1, i); } else { Kaneko16RenderTileLayer(1, i, xScroll1); }} - - if (i == 0) Kaneko16RenderSprites(0); - if (i == 1) Kaneko16RenderSprites(1); - if (i == 2) Kaneko16RenderSprites(2); - if (i == 7) Kaneko16RenderSprites(3); - } - - BurnTransferCopy(Kaneko16Palette); -} - -static void BlazeonFrameRender() // and Wingforc -{ - INT32 i; - INT32 Layer0Enabled = 0; - INT32 Layer1Enabled = 0; - - INT32 vScroll0Enabled = 0; - INT32 vScroll1Enabled = 0; - - INT32 xScroll0 = Kaneko16Layer0Regs[2]; - INT32 xScroll1 = Kaneko16Layer0Regs[0]; - - if (~Kaneko16Layer0Regs[4] & 0x1000) Layer0Enabled = 1; - if (~Kaneko16Layer0Regs[4] & 0x0010) Layer1Enabled = 1; - - BurnTransferClear(); - Kaneko16CalcPalette(0x0800); - memset(DrvPrioBitmap, 0, 320 * 232); - - if (Kaneko16Layer0Regs[4] & 0x800) { - HANDLE_VSCROLL(0) - } - - if (Kaneko16Layer0Regs[4] & 0x008) { - HANDLE_VSCROLL(1) - } - - for (i = 0; i < 8; i++) { - if (Layer0Enabled) { if (vScroll0Enabled) { Kaneko16RenderLayerQueue(0, i); } else { Kaneko16RenderTileLayer(0, i, xScroll0); }} - if (Layer1Enabled) { if (vScroll1Enabled) { Kaneko16RenderLayerQueue(1, i); } else { Kaneko16RenderTileLayer(1, i, xScroll1); }} - } - - if (nSpriteEnable & 1) Kaneko16RenderSprites_Wingforc(); - - BurnTransferCopy(Kaneko16Palette); -} - -static void ShogwarrFrameRender() -{ - INT32 i; - INT32 Layer0Enabled = 0; - INT32 Layer1Enabled = 0; - - INT32 vScroll0Enabled = 0; - INT32 vScroll1Enabled = 0; - - INT32 xScroll0 = Kaneko16Layer0Regs[2]; - INT32 xScroll1 = Kaneko16Layer0Regs[0]; - - if (~Kaneko16Layer0Regs[4] & 0x1000) Layer0Enabled = 1; - if (~Kaneko16Layer0Regs[4] & 0x0010) Layer1Enabled = 1; - - BurnTransferClear(); - Kaneko16CalcPalette(0x0800); - - if (Kaneko16Layer0Regs[4] & 0x800) { - HANDLE_VSCROLL(0) - } - - if (Kaneko16Layer0Regs[4] & 0x008) { - HANDLE_VSCROLL(1) - } - - for (i = 0; i < 8; i++) { - if (nBurnLayer & 1) if (Layer0Enabled) { if (vScroll0Enabled) { Kaneko16RenderLayerQueue(0, i); } else { Kaneko16RenderTileLayer(0, i, xScroll0); }} - if (nBurnLayer & 2) if (Layer1Enabled) { if (vScroll1Enabled) { Kaneko16RenderLayerQueue(1, i); } else { Kaneko16RenderTileLayer(1, i, xScroll1); }} - - if (nSpriteEnable & 1) if (i == 0) Kaneko16RenderSprites(0); - if (nSpriteEnable & 2) if (i == 2) Kaneko16RenderSprites(1); - if (nSpriteEnable & 4) if (i == 4) Kaneko16RenderSprites(2); - if (nSpriteEnable & 8) if (i == 6) Kaneko16RenderSprites(3); - } - - BurnTransferCopy(Kaneko16Palette); -} - -static void BloodwarFrameRender() -{ - INT32 i; - INT32 Layer0Enabled = 0; - INT32 Layer1Enabled = 0; - INT32 Layer2Enabled = 0; - INT32 Layer3Enabled = 0; - - INT32 vScroll0Enabled = 0; - INT32 vScroll1Enabled = 0; - INT32 vScroll2Enabled = 0; - INT32 vScroll3Enabled = 0; - - INT32 xScroll0 = Kaneko16Layer0Regs[2]; - INT32 xScroll1 = Kaneko16Layer0Regs[0]; - INT32 xScroll2 = Kaneko16Layer1Regs[2]; - INT32 xScroll3 = Kaneko16Layer1Regs[0]; - - if (~Kaneko16Layer0Regs[4] & 0x1000) Layer0Enabled = 1; - if (~Kaneko16Layer0Regs[4] & 0x0010) Layer1Enabled = 1; - if (~Kaneko16Layer1Regs[4] & 0x1000) Layer2Enabled = 1; - if (~Kaneko16Layer1Regs[4] & 0x0010) Layer3Enabled = 1; - - BurnTransferClear(); - Kaneko16CalcPalette(0x10000); - - if (!Kaneko16DisplayEnable) return; - - if (Kaneko16Layer0Regs[4] & 0x800) { - HANDLE_VSCROLL(0) - } - - if (Kaneko16Layer0Regs[4] & 0x008) { - HANDLE_VSCROLL(1) - } - - if (Kaneko16Layer1Regs[4] & 0x800) { - HANDLE_VSCROLL(2) - } - - if (Kaneko16Layer1Regs[4] & 0x008) { - HANDLE_VSCROLL(3) - } - - for (i = 0; i < 8; i++) { - if (nBurnLayer & 1) if (Layer0Enabled) { if (vScroll0Enabled) { Kaneko16RenderLayerQueue(0, i); } else { Kaneko16RenderTileLayer(0, i, xScroll0); }} - if (nBurnLayer & 2) if (Layer1Enabled) { if (vScroll1Enabled) { Kaneko16RenderLayerQueue(1, i); } else { Kaneko16RenderTileLayer(1, i, xScroll1); }} - if (nBurnLayer & 4) if (Layer2Enabled) { if (vScroll2Enabled) { Kaneko16RenderLayerQueue(2, i); } else { Kaneko16RenderTileLayer(2, i, xScroll2); }} - if (nBurnLayer & 8) if (Layer3Enabled) { if (vScroll3Enabled) { Kaneko16RenderLayerQueue(3, i); } else { Kaneko16RenderTileLayer(3, i, xScroll3); }} - - if (nSpriteEnable & 1) if (i == 1) Kaneko16RenderSprites(0); - if (nSpriteEnable & 2) if (i == 2) Kaneko16RenderSprites(1); - if (nSpriteEnable & 4) if (i == 4) Kaneko16RenderSprites(2); - if (nSpriteEnable & 8) if (i == 6) Kaneko16RenderSprites(3); - } - - BurnTransferCopy(Kaneko16Palette); -} - -static void ExplbrkrFrameRender() -{ - INT32 i; - INT32 Layer0Enabled = 0; - INT32 Layer1Enabled = 0; - INT32 Layer2Enabled = 0; - INT32 Layer3Enabled = 0; - - INT32 vScroll0Enabled = 0; - INT32 vScroll1Enabled = 0; - INT32 vScroll2Enabled = 0; - INT32 vScroll3Enabled = 0; - - INT32 xScroll0 = Kaneko16Layer0Regs[2]; - INT32 xScroll1 = Kaneko16Layer0Regs[0]; - INT32 xScroll2 = Kaneko16Layer1Regs[2]; - INT32 xScroll3 = Kaneko16Layer1Regs[0]; - - if (~Kaneko16Layer0Regs[4] & 0x1000) Layer0Enabled = 1; - if (~Kaneko16Layer0Regs[4] & 0x0010) Layer1Enabled = 1; - if (~Kaneko16Layer1Regs[4] & 0x1000) Layer2Enabled = 1; - if (~Kaneko16Layer1Regs[4] & 0x0010) Layer3Enabled = 1; - - BurnTransferClear(); - Kaneko16CalcPalette(0x1000); - - if (Kaneko16Layer0Regs[4] & 0x800) { - HANDLE_VSCROLL(0) - } - - if (Kaneko16Layer0Regs[4] & 0x008) { - HANDLE_VSCROLL(1) - } - - if (Kaneko16Layer1Regs[4] & 0x800) { - HANDLE_VSCROLL(2) - } - - if (Kaneko16Layer1Regs[4] & 0x008) { - HANDLE_VSCROLL(3) - } - - for (i = 0; i < 8; i++) { - if (Layer0Enabled) { if (vScroll0Enabled) { Kaneko16RenderLayerQueue(0, i); } else { Kaneko16RenderTileLayer(0, i, xScroll0); }} - if (Layer1Enabled) { if (vScroll1Enabled) { Kaneko16RenderLayerQueue(1, i); } else { Kaneko16RenderTileLayer(1, i, xScroll1); }} - if (Layer2Enabled) { if (vScroll2Enabled) { Kaneko16RenderLayerQueue(2, i); } else { Kaneko16RenderTileLayer(2, i, xScroll2); }} - if (Layer3Enabled) { if (vScroll3Enabled) { Kaneko16RenderLayerQueue(3, i); } else { Kaneko16RenderTileLayer(3, i, xScroll3); }} - } - - Kaneko16RenderSprites(0); - Kaneko16RenderSprites(1); - Kaneko16RenderSprites(2); - Kaneko16RenderSprites(3); - - BurnTransferCopy(Kaneko16Palette); -} - -static void GtmrFrameRender() -{ - INT32 i; - INT32 Layer0Enabled = 0; - INT32 Layer1Enabled = 0; - INT32 Layer2Enabled = 0; - INT32 Layer3Enabled = 0; - - INT32 vScroll0Enabled = 0; - INT32 vScroll1Enabled = 0; - INT32 vScroll2Enabled = 0; - INT32 vScroll3Enabled = 0; - - INT32 xScroll0 = Kaneko16Layer0Regs[2]; - INT32 xScroll1 = Kaneko16Layer0Regs[0]; - INT32 xScroll2 = Kaneko16Layer1Regs[2]; - INT32 xScroll3 = Kaneko16Layer1Regs[0]; - - if (~Kaneko16Layer0Regs[4] & 0x1000) Layer0Enabled = 1; - if (~Kaneko16Layer0Regs[4] & 0x0010) Layer1Enabled = 1; - if (~Kaneko16Layer1Regs[4] & 0x1000) Layer2Enabled = 1; - if (~Kaneko16Layer1Regs[4] & 0x0010) Layer3Enabled = 1; - - BurnTransferClear(); - Kaneko16CalcPalette(0x10000); - - if (!Kaneko16DisplayEnable) return; - - if (Kaneko16Layer0Regs[4] & 0x800) { - HANDLE_VSCROLL(0) - } - - if (Kaneko16Layer0Regs[4] & 0x008) { - HANDLE_VSCROLL(1) - } - - if (Kaneko16Layer1Regs[4] & 0x800) { - HANDLE_VSCROLL(2) - } - - if (Kaneko16Layer1Regs[4] & 0x008) { - HANDLE_VSCROLL(3) - } - - for (i = 0; i < 8; i++) { - if (Layer0Enabled) { if (vScroll0Enabled) { Kaneko16RenderLayerQueue(0, i); } else { Kaneko16RenderTileLayer(0, i, xScroll0); }} - if (Layer1Enabled) { if (vScroll1Enabled) { Kaneko16RenderLayerQueue(1, i); } else { Kaneko16RenderTileLayer(1, i, xScroll1); }} - if (Layer2Enabled) { if (vScroll2Enabled) { Kaneko16RenderLayerQueue(2, i); } else { Kaneko16RenderTileLayer(2, i, xScroll2); }} - if (Layer3Enabled) { if (vScroll3Enabled) { Kaneko16RenderLayerQueue(3, i); } else { Kaneko16RenderTileLayer(3, i, xScroll3); }} - - if (i == 0) Kaneko16RenderSprites(0); - if (i == 1) Kaneko16RenderSprites(1); - if (i == 2) Kaneko16RenderSprites(2); - if (i == 7) Kaneko16RenderSprites(3); - } - - BurnTransferCopy(Kaneko16Palette); -} - -static void MgcrystlFrameRender() -{ - INT32 i; - INT32 Layer0Enabled = 0; - INT32 Layer1Enabled = 0; - INT32 Layer2Enabled = 0; - INT32 Layer3Enabled = 0; - - INT32 vScroll0Enabled = 0; - INT32 vScroll1Enabled = 0; - INT32 vScroll2Enabled = 0; - INT32 vScroll3Enabled = 0; - - INT32 xScroll0 = Kaneko16Layer0Regs[2]; - INT32 xScroll1 = Kaneko16Layer0Regs[0]; - INT32 xScroll2 = Kaneko16Layer1Regs[2]; - INT32 xScroll3 = Kaneko16Layer1Regs[0]; - - if (~Kaneko16Layer0Regs[4] & 0x1000) Layer0Enabled = 1; - if (~Kaneko16Layer0Regs[4] & 0x0010) Layer1Enabled = 1; - if (~Kaneko16Layer1Regs[4] & 0x1000) Layer2Enabled = 1; - if (~Kaneko16Layer1Regs[4] & 0x0010) Layer3Enabled = 1; - - BurnTransferClear(); - Kaneko16CalcPalette(0x1000); - - if (Kaneko16Layer0Regs[4] & 0x800) { - HANDLE_VSCROLL(0) - } - - if (Kaneko16Layer0Regs[4] & 0x008) { - HANDLE_VSCROLL(1) - } - - if (Kaneko16Layer1Regs[4] & 0x800) { - HANDLE_VSCROLL(2) - } - - if (Kaneko16Layer1Regs[4] & 0x008) { - HANDLE_VSCROLL(3) - } - - for (i = 0; i < 8; i++) { - if (Layer0Enabled) { if (vScroll0Enabled) { Kaneko16RenderLayerQueue(0, i); } else { Kaneko16RenderTileLayer(0, i, xScroll0); }} - if (Layer1Enabled) { if (vScroll1Enabled) { Kaneko16RenderLayerQueue(1, i); } else { Kaneko16RenderTileLayer(1, i, xScroll1); }} - if (Layer2Enabled) { if (vScroll2Enabled) { Kaneko16RenderLayerQueue(2, i); } else { Kaneko16RenderTileLayer(2, i, xScroll2); }} - if (Layer3Enabled) { if (vScroll3Enabled) { Kaneko16RenderLayerQueue(3, i); } else { Kaneko16RenderTileLayer(3, i, xScroll3); }} - - if (i == 1) Kaneko16RenderSprites(0); - if (i == 2) Kaneko16RenderSprites(1); - if (i == 4) Kaneko16RenderSprites(2); - if (i == 6) Kaneko16RenderSprites(3); - } - - BurnTransferCopy(Kaneko16Palette); -} - -/*============================================================================================== -Frame functions -===============================================================================================*/ - -static INT32 ExplbrkrFrame() -{ - INT32 nInterleave = 10; - nSoundBufferPos = 0; - - if (Kaneko16Reset) ExplbrkrDoReset(); - - Kaneko16MakeInputs(); - - nCyclesTotal[0] = 12000000 / 60; - nCyclesDone[0] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 3) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 6) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 9) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) Kaneko16FrameRender(); - - return 0; -} - -static INT32 BlazeonFrame() -{ - INT32 nInterleave = 10; - nSoundBufferPos = 0; - - if (Kaneko16Reset) BlazeonDoReset(); - - Kaneko16MakeInputs(); - - nCyclesTotal[0] = 12000000 / 60; - nCyclesTotal[1] = 4000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 3) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 6) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 9) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - } - } - - if (pBurnDraw) Kaneko16FrameRender(); - - return 0; -} - -static INT32 WingforcFrame() -{ - INT32 nInterleave = 256; - nSoundBufferPos = 0; - - if (Kaneko16Reset) WingforcDoReset(); - - Kaneko16MakeInputs(); - - nCyclesTotal[0] = ((UINT64)16000000 * (UINT64)10000) / 591854; - nCyclesTotal[1] = ((UINT64)4000000 * (UINT64)10000) / 591854; - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 144) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == 64) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - if (i == 224) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - } - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) Kaneko16FrameRender(); - - return 0; -} - -static INT32 GtmrFrame() -{ - if (Kaneko16Reset) GtmrDoReset(); - - Kaneko16MakeInputs(); - - SekOpen(0); - SekNewFrame(); - - SekRun((16000000 / 60) / 4); - SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - SekRun((16000000 / 60) / 4); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekRun((16000000 / 60) / 4); - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekRun((16000000 / 60) / 4); - - SekClose(); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) Kaneko16FrameRender(); - - return 0; -} - -static INT32 ShogwarrFrame() -{ - Kaneko16Watchdog++; - if (Kaneko16Watchdog > 180) { - // ShogwarrDoReset(); - } - - if (Kaneko16Reset) ShogwarrDoReset(); - - Kaneko16MakeInputs(); - - SekOpen(0); - SekNewFrame(); - - INT32 nInterleave = 256; - nCyclesTotal[0] = (12000000 * 100) / 5918; - nCyclesDone[0] = 0; - INT32 nSegment = 0; - - for (INT32 nScanline = 0; nScanline < nInterleave; nScanline++) - { - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - nScanline); - nCyclesDone[0] += SekRun(nSegment); - - if (nScanline == 64) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (nScanline == 144) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (nScanline == 223-16) { - shogwarr_calc3_mcu_run(); - } - - if (nScanline == 224-16) { // needs -16 otherwise sprite flicker in some shogunwarriors levels. - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - SekClose(); - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) Kaneko16FrameRender(); - - return 0; -} - - -/*============================================================================================== -Scan Driver -===============================================================================================*/ - -static INT32 Kaneko16Scan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029672; - } - - if (Kaneko16Eeprom) EEPROMScan(nAction, pnMin); - - if (nAction & ACB_NVRAM && Kaneko16NVRam) { - memset(&ba, 0, sizeof(ba)); - ba.Data = Kaneko16NVRam; - ba.nLen = 0x100; - ba.szName = "NVRam"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - SCAN_VAR(Kaneko16SoundLatch); - SCAN_VAR(Kaneko16SpriteFlipX); - SCAN_VAR(Kaneko16SpriteFlipY); - SCAN_VAR(Kaneko16DisplayEnable); - SCAN_VAR(Kaneko16SpriteRegs); - SCAN_VAR(Kaneko16Layer0Regs); - SCAN_VAR(Kaneko16Layer1Regs); - SCAN_VAR(Kaneko16Brightness); - - BurnRandomScan(nAction); - - if (Kaneko16Bg15) { - SCAN_VAR(Kaneko16Bg15Reg); - SCAN_VAR(Kaneko16Bg15Select); - } - } - - return 0; -} - -static INT32 BlazeonScan(INT32 nAction, INT32 *pnMin) -{ - if (pnMin != NULL) { - *pnMin = 0x029672; - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - BurnYM2151Scan(nAction); - } - - return Kaneko16Scan(nAction, pnMin);; -} - -static INT32 WingforcScan(INT32 nAction, INT32 *pnMin) -{ - if (pnMin != NULL) { - *pnMin = 0x029672; - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(MSM6295Bank0); - } - - if (nAction & ACB_WRITE) { - memcpy(MSM6295ROM + 0x0000000, MSM6295ROMData + (0x40000 * MSM6295Bank0),0x40000); - } - - return Kaneko16Scan(nAction, pnMin);; -} - -static INT32 ExplbrkrScan(INT32 nAction, INT32 *pnMin) -{ - if (pnMin != NULL) { - *pnMin = 0x029672; - } - - if (nAction & ACB_DRIVER_DATA) { - AY8910Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - SCAN_VAR(MSM6295Bank0); - } - - if (nAction & ACB_WRITE) { - memcpy(MSM6295ROM + 0x0000000, MSM6295ROMData + (0x40000 * MSM6295Bank0),0x40000); - } - - return Kaneko16Scan(nAction, pnMin);; -} - -static INT32 GtmrScan(INT32 nAction, INT32 *pnMin) -{ - if (pnMin != NULL) { - *pnMin = 0x029672; - } - - if (nAction & ACB_DRIVER_DATA) { - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - SCAN_VAR(ToyboxMCUCom); - SCAN_VAR(MSM6295Bank0); - SCAN_VAR(MSM6295Bank1); - } - - if (nAction & ACB_WRITE) { - memcpy(MSM6295ROM + 0x0000000, MSM6295ROMData + (0x40000 * MSM6295Bank0),0x40000); - memcpy(MSM6295ROM + 0x0100000, MSM6295ROMData2 + (0x40000 * MSM6295Bank1),0x40000); - } - - return Kaneko16Scan(nAction, pnMin);; -} - -static INT32 ShogwarrScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029672; - } - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - ba.Data = &m_calc3; - ba.nLen = sizeof (m_calc3); - ba.szName = "Calc3 Data"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = &m_hit3; - ba.nLen = sizeof (m_hit3); - ba.szName = "Hit2 Data"; - BurnAcb(&ba); - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - SCAN_VAR(MSM6295Bank0); - SCAN_VAR(MSM6295Bank1); - } - - if (nAction & ACB_WRITE) { - INT32 data0 = MSM6295Bank0; - INT32 data1 = MSM6295Bank1; - MSM6295Bank0 = MSM6295Bank1 = -1; - - ShogwarrConfigSoundBank(0, data0 & 0x0f, 0x30000, 0x10000); - if (Shogwarr) { - ShogwarrConfigSoundBank(1, data1 & 0x0f, 0x00000, 0x40000); - } else { - ShogwarrConfigSoundBank(1, data1 & 0x0f, 0x20000, 0x20000); - } - } - - return Kaneko16Scan(nAction, pnMin);; -} - -/*============================================================================================== -Driver defs -===============================================================================================*/ - -struct BurnDriver BurnDrvBerlwall = { - "berlwall", NULL, NULL, NULL, "1991", - "The Berlin Wall\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO16, GBF_PLATFORM, 0, - NULL, BerlwallRomInfo, BerlwallRomName, NULL, NULL, BerlwallInputInfo, BerlwallDIPInfo, - BerlwallInit, BerlwallExit, ExplbrkrFrame, NULL, ExplbrkrScan, - &Kaneko16RecalcBg15Palette, 0x9000, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBerlwallt = { - "berlwallt", "berlwall", NULL, NULL, "1991", - "The Berlin Wall (bootleg ?)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_KANEKO16, GBF_PLATFORM, 0, - NULL, BerlwalltRomInfo, BerlwalltRomName, NULL, NULL, BerlwallInputInfo, BerlwalltDIPInfo, - BerlwallInit, BerlwallExit, ExplbrkrFrame, NULL, ExplbrkrScan, - &Kaneko16RecalcBg15Palette, 0x9000, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBerlwallk = { - "berlwallk", "berlwall", NULL, NULL, "1991", - "The Berlin Wall (Korea)\0", NULL, "Kaneko (Inter license)", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_PLATFORM, 0, - NULL, BerlwallkRomInfo, BerlwallkRomName, NULL, NULL, BerlwallInputInfo, BerlwalltDIPInfo, - BerlwallInit, BerlwallExit, ExplbrkrFrame, NULL, ExplbrkrScan, - &Kaneko16RecalcBg15Palette, 0x9000, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPackbang = { - "packbang", NULL, NULL, NULL, "1994", - "Pack'n Bang Bang (Prototype)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KANEKO16, GBF_PLATFORM, 0, - NULL, PackbangRomInfo, PackbangRomName, NULL, NULL, BerlwallInputInfo, PackbangDIPInfo, - PackbangInit, BerlwallExit, ExplbrkrFrame, NULL, ExplbrkrScan, - &Kaneko16RecalcBg15Palette, 0x9000, 225, 256, 3, 4 -}; - -struct BurnDriver BurnDrvBlazeon = { - "blazeon", NULL, NULL, NULL, "1992", - "Blaze On (Japan)\0", NULL, "Atlus", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO16, GBF_HORSHOOT, 0, - NULL, BlazeonRomInfo, BlazeonRomName, NULL, NULL, BlazeonInputInfo, BlazeonDIPInfo, - BlazeonInit, BlazeonExit, BlazeonFrame, NULL, BlazeonScan, - NULL, 0x1000, 320, 232, 4, 3 -}; - -struct BurnDriver BurnDrvWingforc = { - "wingforc", NULL, NULL, NULL, "1993", - "Wing Force (Japan, prototype)\0", NULL, "Atlus", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_KANEKO16, GBF_HORSHOOT, 0, - NULL, WingforcRomInfo, WingforcRomName, NULL, NULL, BlazeonInputInfo, BlazeonDIPInfo, - WingforcInit, WingforcExit, WingforcFrame, NULL, WingforcScan, - NULL, 0x1000, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBloodwar = { - "bloodwar", NULL, NULL, NULL, "1994", - "Blood Warrior\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO16, GBF_VSFIGHT, 0, - NULL, BloodwarRomInfo, BloodwarRomName, NULL, NULL, BloodwarInputInfo, BloodwarDIPInfo, - BloodwarInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOedfight = { - "oedfight", "bloodwar", NULL, NULL, "1994", - "Oedo Fight (Japan Bloodshed Ver.)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_VSFIGHT, 0, - NULL, OedfightRomInfo, OedfightRomName, NULL, NULL, BloodwarInputInfo, BloodwarDIPInfo, - BloodwarInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBonkadv = { - "bonkadv", NULL, NULL, NULL, "1994", - "B.C. Kid / Bonk's Adventure / Kyukyoku!! PC Genjin\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO16, GBF_PLATFORM, 0, - NULL, BonkadvRomInfo, BonkadvRomName, NULL, NULL, BonkadvInputInfo, BonkadvDIPInfo, - BonkadvInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvExplbrkr = { - "explbrkr", NULL, NULL, NULL, "1992", - "Explosive Breaker\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KANEKO16, GBF_VERSHOOT, 0, - NULL, ExplbrkrRomInfo, ExplbrkrRomName, NULL, NULL, ExplbrkrInputInfo, ExplbrkrDIPInfo, - ExplbrkrInit, ExplbrkrExit, ExplbrkrFrame, NULL, ExplbrkrScan, - NULL, 0x1000, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvBakubrkr = { - "bakubrkr", "explbrkr", NULL, NULL, "1992", - "Bakuretsu Breaker\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KANEKO16, GBF_VERSHOOT, 0, - NULL, BakubrkrRomInfo, BakubrkrRomName, NULL, NULL, ExplbrkrInputInfo, ExplbrkrDIPInfo, - ExplbrkrInit, ExplbrkrExit, ExplbrkrFrame, NULL, ExplbrkrScan, - NULL, 0x1000, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGtmr = { - "gtmr", NULL, NULL, NULL, "1994", - "1000 Miglia: Great 1000 Miles Rally (94/07/18)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO16, GBF_RACING, 0, - NULL, GtmrRomInfo, GtmrRomName, NULL, NULL, GtmrInputInfo, GtmrDIPInfo, - GtmrInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGtmra = { - "gtmra", "gtmr", NULL, NULL, "1994", - "1000 Miglia: Great 1000 Miles Rally (94/06/13)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_RACING, 0, - NULL, GtmraRomInfo, GtmraRomName, NULL, NULL, GtmrInputInfo, GtmrDIPInfo, - GtmrInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGtmrb = { - "gtmrb", "gtmr", NULL, NULL, "1994", - "1000 Miglia: Great 1000 Miles Rally (94/05/26)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_RACING, 0, - NULL, GtmrbRomInfo, GtmrbRomName, NULL, NULL, GtmrInputInfo, GtmrDIPInfo, - GtmrInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGtmro = { - "gtmro", "gtmr", NULL, NULL, "1994", - "1000 Miglia: Great 1000 Miles Rally (94/05/10)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_RACING, 0, - NULL, GtmroRomInfo, GtmroRomName, NULL, NULL, GtmrInputInfo, GtmrDIPInfo, - GtmroInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGtmre = { - "gtmre", "gtmr", NULL, NULL, "1994", - "Great 1000 Miles Rally: Evolution Model!!! (94/09/06)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_RACING, 0, - NULL, GtmreRomInfo, GtmreRomName, NULL, NULL, GtmrInputInfo, GtmrDIPInfo, - GtmrevoInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGtmrusa = { - "gtmrusa", "gtmr", NULL, NULL, "1994", - "Great 1000 Miles Rally: U.S.A Version! (94/09/06)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_RACING, 0, - NULL, GtmrusaRomInfo, GtmrusaRomName, NULL, NULL, GtmrInputInfo, GtmrDIPInfo, - GtmrevoInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGtmr2 = { - "gtmr2", NULL, NULL, NULL, "1995", - "Mille Miglia 2: Great 1000 Miles Rally (95/05/24)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO16, GBF_RACING, 0, - NULL, Gtmr2RomInfo, Gtmr2RomName, NULL, NULL, GtmrInputInfo, Gtmr2DIPInfo, - Gtmr2Init, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGtmr2a = { - "gtmr2a", "gtmr2", NULL, NULL, "1995", - "Mille Miglia 2: Great 1000 Miles Rally (95/04/04)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_RACING, 0, - NULL, Gtmr2aRomInfo, Gtmr2aRomName, NULL, NULL, GtmrInputInfo, Gtmr2DIPInfo, - Gtmr2Init, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGtmr2u = { - "gtmr2u", "gtmr2", NULL, NULL, "1995", - "Great 1000 Miles Rally 2 USA (95/05/18)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_RACING, 0, - NULL, Gtmr2uRomInfo, Gtmr2uRomName, NULL, NULL, GtmrInputInfo, Gtmr2DIPInfo, - Gtmr2uInit, GtmrMachineExit, GtmrFrame, NULL, GtmrScan, - NULL, 0x10000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMgcrsytl = { - "mgcrystl", NULL, NULL, NULL, "1991", - "Magical Crystals (World, 92/01/10)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO16, GBF_PLATFORM, 0, - NULL, MgcrystlRomInfo, MgcrystlRomName, NULL, NULL, MgcrystlInputInfo, MgcrystlDIPInfo, - MgcrystlInit, ExplbrkrExit, ExplbrkrFrame, NULL, ExplbrkrScan, - NULL, 0x1000, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMgcrsytlo = { - "mgcrystlo", "mgcrystl", NULL, NULL, "1991", - "Magical Crystals (World, 91/12/10)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_PLATFORM, 0, - NULL, MgcrystloRomInfo, MgcrystloRomName, NULL, NULL, MgcrystlInputInfo, MgcrystlDIPInfo, - MgcrystlInit, ExplbrkrExit, ExplbrkrFrame, NULL, ExplbrkrScan, - NULL, 0x1000, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMgcrsytlj = { - "mgcrystlj", "mgcrystl", NULL, NULL, "1991", - "Magical Crystals (Japan, 92/01/13)\0", NULL, "Kaneko (Atlus license)", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_PLATFORM, 0, - NULL, MgcrystljRomInfo, MgcrystljRomName, NULL, NULL, MgcrystlInputInfo, MgcrystlDIPInfo, - MgcrystlInit, ExplbrkrExit, ExplbrkrFrame, NULL, ExplbrkrScan, - NULL, 0x1000, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShogwarr = { - "shogwarr", NULL, NULL, NULL, "1992", - "Shogun Warriors (World)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO16, GBF_VSFIGHT, 0, - NULL, shogwarrRomInfo, shogwarrRomName, NULL, NULL, ShogwarrInputInfo, ShogwarrDIPInfo, - ShogwarrInit, GtmrMachineExit, ShogwarrFrame, NULL, ShogwarrScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShogwarrk = { - "shogwarrk", "shogwarr", NULL, NULL, "1992", - "Shogun Warriors (Korea?)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_VSFIGHT, 0, - NULL, shogwarrkRomInfo, shogwarrkRomName, NULL, NULL, ShogwarrInputInfo, ShogwarrDIPInfo, - ShogwarrkInit, GtmrMachineExit, ShogwarrFrame, NULL, ShogwarrScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShogwarru = { - "shogwarru", "shogwarr", NULL, NULL, "1992", - "Shogun Warriors (US)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_VSFIGHT, 0, - NULL, shogwarruRomInfo, shogwarruRomName, NULL, NULL, ShogwarrInputInfo, ShogwarrDIPInfo, - ShogwarrInit, GtmrMachineExit, ShogwarrFrame, NULL, ShogwarrScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFjbuster = { - "fjbuster", "shogwarr", NULL, NULL, "1992", - "Fujiyama Buster (Japan)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KANEKO16, GBF_VSFIGHT, 0, - NULL, fjbusterRomInfo, fjbusterRomName, NULL, NULL, ShogwarrInputInfo, ShogwarrDIPInfo, - ShogwarrInit, GtmrMachineExit, ShogwarrFrame, NULL, ShogwarrScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBrapboys = { - "brapboys", NULL, NULL, NULL, "1992", - "B.Rap Boys (World)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_KANEKO16, GBF_SCRFIGHT, 0, - NULL, brapboysRomInfo, brapboysRomName, NULL, NULL, BrapboysInputInfo, BrapboysDIPInfo, - BrapboysInit, GtmrMachineExit, ShogwarrFrame, NULL, ShogwarrScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBrapboysj = { - "brapboysj", "brapboys", NULL, NULL, "1992", - "B.Rap Boys Special (Japan)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_KANEKO16, GBF_SCRFIGHT, 0, - NULL, brapboysjRomInfo, brapboysjRomName, NULL, NULL, BrapboysInputInfo, BrapboysDIPInfo, - BrapboysInit, GtmrMachineExit, ShogwarrFrame, NULL, ShogwarrScan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBrapboysu = { - "brapboysu", "brapboys", NULL, NULL, "1992", - "B.Rap Boys Special (US)\0", NULL, "Kaneko", "Kaneko16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_KANEKO16, GBF_SCRFIGHT, 0, - NULL, brapboysuRomInfo, brapboysuRomName, NULL, NULL, BrapboysInputInfo, BrapboysDIPInfo, - BrapboysInit, GtmrMachineExit, ShogwarrFrame, NULL, ShogwarrScan, - NULL, 0x800, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_lordgun.cpp b/jan/src/burn/drv/pst90s/d_lordgun.cpp deleted file mode 100644 index 9146f7b95..000000000 --- a/jan/src/burn/drv/pst90s/d_lordgun.cpp +++ /dev/null @@ -1,1597 +0,0 @@ -// FB Alpha Lord of Gun driver module -// Based on MAME driver by Luca Elia, XingXing, and David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ymf278b.h" -#include "burn_ym3812.h" -#include "msm6295.h" -#include "8255ppi.h" -#include "eeprom.h" -#include "burn_gun.h" - -static UINT8 *AllMem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *AllRam = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KROM = NULL; -static UINT8 *DrvZ80ROM = NULL; -static UINT8 *DrvGfxROM0 = NULL; -static UINT8 *DrvGfxROM1 = NULL; -static UINT8 *DrvGfxROM2 = NULL; -static UINT8 *DrvGfxROM3 = NULL; -static UINT8 *DrvSndROM0 = NULL; -static UINT8 *DrvSndROM1 = NULL; -static UINT8 *DrvSndROM2 = NULL; -static UINT8 *Drv68KRAM = NULL; -static UINT8 *DrvPriRAM = NULL; -static UINT8 *DrvPalRAM = NULL; -static UINT8 *DrvVidRAM0 = NULL; -static UINT8 *DrvVidRAM1 = NULL; -static UINT8 *DrvVidRAM2 = NULL; -static UINT8 *DrvVidRAM3 = NULL; -static UINT8 *DrvScrRAM = NULL; -static UINT8 *DrvSprRAM = NULL; -static UINT8 *DrvZ80RAM = NULL; - -static UINT32 *DrvPalette = NULL; -static UINT8 DrvRecalc; - -static UINT16 *scrollx = NULL; -static UINT16 *scrolly = NULL; -static UINT16 *priority = NULL; -static UINT8 *soundlatch = NULL; -static INT8 *okibank = NULL; - -static UINT8 *DrvTransTable[5] = { NULL, NULL, NULL, NULL, NULL }; -static UINT16 *draw_bitmap[5] = { NULL, NULL, NULL, NULL, NULL }; - -static UINT8 aliencha_dip_sel; -static UINT8 lordgun_whitescreen; - -static UINT16 lordgun_protection_data; - -static INT32 DrvAxis[4]; -static UINT16 DrvAnalogInput[4]; -static UINT16 DrvInputs[5]; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvJoy5[16]; -static UINT8 DrvDips[4]; -static UINT8 DrvReset; - -static INT32 lordgun_gun_hw_x[2]; -static INT32 lordgun_gun_hw_y[2]; - -#define A(a, b, c, d) { a, b, (UINT8*)(c), d } - -static struct BurnInputInfo LordgunInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - A("P1 Right / left", BIT_ANALOG_REL, DrvAxis + 0, "mouse x-axis"), - A("P1 Up / Down", BIT_ANALOG_REL, DrvAxis + 1, "mouse y-axis"), - {"P1 Button 1", BIT_DIGITAL, DrvJoy5 + 4, "mouse button" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - A("P2 Right / left", BIT_ANALOG_REL, DrvAxis + 2, "mouse x-axis"), - A("P2 Up / Down", BIT_ANALOG_REL, DrvAxis + 3, "mouse y-axis"), - {"P2 Button 1", BIT_DIGITAL, DrvJoy5 + 5, "mouse button" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Lordgun) - -#undef A - -static struct BurnInputInfo AlienchaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 1, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy4 + 2, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy4 + 3, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvJoy4 + 4, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 1, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 5" }, - {"P2 Button 6", BIT_DIGITAL, DrvJoy4 + 7, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 1, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Fake Dip", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Aliencha) - -static struct BurnDIPInfo LordgunDIPList[]= -{ - {0x0d, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Stage Select" }, - {0x0d, 0x01, 0x01, 0x01, "Off" }, - {0x0d, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Guns" }, - {0x0d, 0x01, 0x02, 0x02, "IGS" }, - {0x0d, 0x01, 0x02, 0x00, "Konami" }, - - {0 , 0xfe, 0 , 2, "Ranking Music" }, - {0x0d, 0x01, 0x04, 0x04, "Exciting" }, - {0x0d, 0x01, 0x04, 0x00, "Tender" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x0d, 0x01, 0x08, 0x00, "1" }, - {0x0d, 0x01, 0x08, 0x08, "2" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0d, 0x01, 0x40, 0x40, "Off" }, - {0x0d, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Lordgun) - -static struct BurnDIPInfo AlienchaDIPList[]= -{ - {0x1a, 0xff, 0xff, 0xff, NULL }, - {0x1b, 0xff, 0xff, 0xff, NULL }, - {0x1c, 0xff, 0xff, 0xff, NULL }, - {0x1d, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Credits To Start" }, - {0x1a, 0x01, 0x01, 0x01, "1" }, - {0x1a, 0x01, 0x01, 0x00, "2" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x1a, 0x01, 0x0e, 0x00, "5 Coins 1 Credits" }, - {0x1a, 0x01, 0x0e, 0x02, "4 Coins 1 Credits" }, - {0x1a, 0x01, 0x0e, 0x04, "3 Coins 1 Credits" }, - {0x1a, 0x01, 0x0e, 0x06, "2 Coins 1 Credits" }, - {0x1a, 0x01, 0x0e, 0x0e, "1 Coin 1 Credits" }, - {0x1a, 0x01, 0x0e, 0x0c, "1 Coin 2 Credits" }, - {0x1a, 0x01, 0x0e, 0x0a, "1 Coin 3 Credits" }, - {0x1a, 0x01, 0x0e, 0x08, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x1a, 0x01, 0x70, 0x00, "5 Coins 1 Credits" }, - {0x1a, 0x01, 0x70, 0x10, "4 Coins 1 Credits" }, - {0x1a, 0x01, 0x70, 0x20, "3 Coins 1 Credits" }, - {0x1a, 0x01, 0x70, 0x30, "2 Coins 1 Credits" }, - {0x1a, 0x01, 0x70, 0x70, "1 Coin 1 Credits" }, - {0x1a, 0x01, 0x70, 0x60, "1 Coin 2 Credits" }, - {0x1a, 0x01, 0x70, 0x50, "1 Coin 3 Credits" }, - {0x1a, 0x01, 0x70, 0x40, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x1a, 0x01, 0x80, 0x80, "1" }, - {0x1a, 0x01, 0x80, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1b, 0x01, 0x03, 0x03, "0" }, - {0x1b, 0x01, 0x03, 0x02, "1" }, - {0x1b, 0x01, 0x03, 0x01, "2" }, - {0x1b, 0x01, 0x03, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1b, 0x01, 0x04, 0x04, "Off" }, - {0x1b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Round Time" }, - {0x1b, 0x01, 0x08, 0x00, "32 s" }, - {0x1b, 0x01, 0x08, 0x08, "40 s" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1b, 0x01, 0x10, 0x00, "Off" }, - {0x1b, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x1b, 0x01, 0x20, 0x20, "Off" }, - {0x1b, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Join" }, - {0x1b, 0x01, 0x40, 0x00, "No" }, - {0x1b, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x1b, 0x01, 0x80, 0x00, "No" }, - {0x1b, 0x01, 0x80, 0x80, "Yes" }, - - {0 , 0xfe, 0 , 3, "Buttons" }, - {0x1c, 0x01, 0x03, 0x01, "3" }, - {0x1c, 0x01, 0x03, 0x02, "4" }, - {0x1c, 0x01, 0x03, 0x03, "6" }, - - {0 , 0xfe, 0 , 2, "Vs. Rounds" }, - {0x1c, 0x01, 0x04, 0x00, "3" }, - {0x1c, 0x01, 0x04, 0x04, "5" }, - - {0 , 0xfe, 0 , 2, "Language (text)" }, - {0x1d, 0x01, 0x01, 0x00, "English" }, - {0x1d, 0x01, 0x01, 0x01, "Chinese" }, - - {0 , 0xfe, 0 , 2, "Language (char names)"}, - {0x1d, 0x01, 0x02, 0x00, "English" }, - {0x1d, 0x01, 0x02, 0x02, "Chinese" }, - - {0 , 0xfe, 0 , 2, "Title" }, - {0x1d, 0x01, 0x04, 0x00, "Alien Challenge" }, - {0x1d, 0x01, 0x04, 0x04, "Round House Rumble" }, -}; - -STDDIPINFO(Aliencha) - -static struct BurnDIPInfo AlienchacDIPList[] = { - {0x1d, 0xff, 0xff, 0x03, NULL }, -}; - -STDDIPINFOEXT(Alienchac, Aliencha, Alienchac) - -static const short lordgun_gun_x_table[] = -{ - -100, 0x001,0x001,0x002,0x002,0x003,0x003,0x004,0x005,0x006,0x007,0x008,0x009,0x00A,0x00B,0x00C, - 0x00D,0x00E,0x00F,0x010,0x011,0x012,0x013,0x014,0x015,0x016,0x017,0x018,0x019,0x01A,0x01B,0x01C, - 0x01D,0x01E,0x01F,0x020,0x021,0x022,0x023,0x024,0x025,0x026,0x027,0x028,0x029,0x02A,0x02B,0x02C, - 0x02D,0x02E,0x02F,0x030,0x031,0x032,0x033,0x034,0x035,0x036,0x037,0x038,0x039,0x03A,0x03B,0x03C, - 0x03D,0x03E,0x03F,0x040,0x041,0x043,0x044,0x045,0x046,0x047,0x048,0x049,0x04A,0x04B,0x04C,0x04E, - 0x04F,0x050,0x051,0x052,0x053,0x054,0x055,0x056,0x057,0x059,0x05A,0x05B,0x05C,0x05D,0x05E,0x05F, - 0x060,0x061,0x05A,0x063,0x065,0x066,0x067,0x068,0x069,0x06A,0x06B,0x06C,0x06D,0x06E,0x06F,0x071, - 0x072,0x074,0x075,0x077,0x078,0x07A,0x07B,0x07D,0x07E,0x080,0x081,0x083,0x085,0x087,0x089,0x08B, - 0x08D,0x08E,0x08F,0x090,0x092,0x093,0x095,0x097,0x098,0x099,0x09A,0x09B,0x09C,0x09D,0x09E,0x0A0, - 0x0A1,0x0A2,0x0A3,0x0A4,0x0A5,0x0A6,0x0A7,0x0A8,0x0A9,0x0AA,0x0AC,0x0AD,0x0AE,0x0AF,0x0B0,0x0B1, - 0x0B2,0x0B3,0x0B4,0x0B5,0x0B6,0x0B8,0x0B9,0x0BA,0x0BB,0x0BC,0x0BD,0x0BE,0x0BF,0x0C0,0x0C1,0x0C2, - 0x0C4,0x0C5,0x0C6,0x0C7,0x0C8,0x0C9,0x0CA,0x0CB,0x0CC,0x0CD,0x0CF,0x0D0,0x0D1,0x0D2,0x0D3,0x0D4, - 0x0D5,0x0D6,0x0D7,0x0D8,0x0D9,0x0DB,0x0DC,0x0DD,0x0DE,0x0DF,0x0E0,0x0E1,0x0E2,0x0E3,0x0E4,0x0E5, - 0x0E7,0x0E8,0x0E9,0x0EA,0x0EB,0x0EC,0x0ED,0x0EE,0x0EF,0x0F0,0x0F1,0x0F3,0x0F4,0x0F5,0x0F6,0x0F7, - 0x0F8,0x0F9,0x0FA,0x0FB,0x0FC,0x0FE,0x0FF,0x100,0x101,0x102,0x103,0x104,0x105,0x106,0x107,0x108, - 0x10A,0x10B,0x10C,0x10D,0x10E,0x10F,0x110,0x111,0x112,0x113,0x114,0x116,0x117,0x118,0x119,0x11A, - 0x11B,0x11C,0x11D,0x11E,0x11F,0x120,0x122,0x123,0x124,0x125,0x126,0x127,0x128,0x129,0x12A,0x12B, - 0x12C,0x12E,0x12F,0x130,0x131,0x132,0x133,0x134,0x135,0x136,0x137,0x139,0x13A,0x13B,0x13C,0x13D, - 0x13E,0x13F,0x140,0x141,0x142,0x143,0x145,0x146,0x147,0x148,0x149,0x14A,0x14B,0x14C,0x14D,0x14E, - 0x14F,0x151,0x152,0x153,0x154,0x155,0x156,0x157,0x158,0x159,0x15A,0x15B,0x15D,0x15E,0x15F,0x160, - 0x161,0x162,0x163,0x164,0x165,0x166,0x167,0x169,0x16A,0x16B,0x16C,0x16D,0x16E,0x16F,0x170,0x171, - 0x172,0x174,0x175,0x176,0x177,0x178,0x179,0x17A,0x17B,0x17C,0x17D,0x17E,0x17F,0x180,0x181,0x182, - 0x183,0x184,0x185,0x186,0x187,0x188,0x189,0x18A,0x18B,0x18C,0x18D,0x18E,0x18F,0x190,0x191,0x192, - 0x193,0x194,0x195,0x196,0x197,0x198,0x199,0x19A,0x19B,0x19C,0x19D,0x19E,0x19F,0x1A0,0x1A1,0x1A2, - 0x1A3,0x1A4,0x1A5,0x1A6,0x1A7,0x1A8,0x1A9,0x1AA,0x1AB,0x1AC,0x1AD,0x1AE,0x1AF,0x1B0,0x1B1,0x1B2, - 0x1B3,0x1B4,0x1B5,0x1B6,0x1B7,0x1B8,0x1B9,0x1BA,0x1BB,0x1BC,0x1BD,0x1BE,0x1BF,0x1BF -}; - -static void lordgun_update_gun(INT32 i) -{ - INT32 x = DrvAnalogInput[i] - 0x3c; - - lordgun_gun_hw_x[i] = DrvAnalogInput[i]; - lordgun_gun_hw_y[i] = DrvAnalogInput[i+2]; - - if ((x < 0) || (x > (INT32)(sizeof(lordgun_gun_x_table)/sizeof(lordgun_gun_x_table[0]))) ) - x = 0; - - INT32 scrx = lordgun_gun_x_table[x]; - INT32 scry = DrvAnalogInput[i+2]; - - if ((scrx < 0) || (scrx >= nScreenWidth) || (scry < 0) || (scry > nScreenHeight)) { - lordgun_gun_hw_x[i] = lordgun_gun_hw_y[i] = 0; - } -} - -static void lordgun_protection_write(UINT32 offset) -{ - switch (offset & 0x60) - { - case 0x00/2: // increment counter - { - lordgun_protection_data++; - lordgun_protection_data &= 0x1f; - - return; - } - - case 0xc0/2: // reset protection device - { - lordgun_protection_data = 0; - - return; - } - } -} - -static UINT8 lordgun_protection_read(INT32 offset) -{ - switch (offset & 0x60) - { - case 0x40/2: // bitswap and xor counter - { - UINT8 x = lordgun_protection_data; - - lordgun_protection_data = ((( x >> 0) | ( x >> 1)) & 1) << 4; - lordgun_protection_data |= ((~x >> 2) & 1) << 3; - lordgun_protection_data |= (((~x >> 4) | ( x >> 0)) & 1) << 2; - lordgun_protection_data |= (( x >> 3) & 1) << 1; - lordgun_protection_data |= (((~x >> 0) | ( x >> 2)) & 1) << 0; - - return 0; - } - - case 0x80/2: // return value if conditions are met - { - if ((lordgun_protection_data & 0x11) == 0x01) return 0x10; - if ((lordgun_protection_data & 0x06) == 0x02) return 0x10; - if ((lordgun_protection_data & 0x09) == 0x08) return 0x10; - - return 0; - } - } - - return 0; -} - -static void aliencha_protection_write(UINT32 offset) -{ - switch (offset & 0x60) - { - case 0xc0/2: // reset protection device - { - lordgun_protection_data = 0; - - return; - } - } -} - -static UINT8 aliencha_protection_read(INT32 offset) -{ - switch (offset & 0x60) - { - case 0x00/2: // de-increment counter - { - lordgun_protection_data--; - lordgun_protection_data &= 0x1f; - - return 0; - } - - case 0x40/2: // bitswap and xor counter - { - UINT8 x = lordgun_protection_data; - - lordgun_protection_data = (((x >> 3) ^ (x >> 2)) & 1) << 4; - lordgun_protection_data |= (((x >> 2) ^ (x >> 1)) & 1) << 3; - lordgun_protection_data |= (((x >> 1) ^ (x >> 0)) & 1) << 2; - lordgun_protection_data |= (((x >> 4) ^ (x >> 0)) & 1) << 1; - lordgun_protection_data |= (((x >> 4) ^ (x >> 3)) & 1) << 0; - - return 0; - } - - case 0x80/2: // return value if conditions are met - { - if ((lordgun_protection_data & 0x11) == 0x00) return 0x20; - if ((lordgun_protection_data & 0x06) != 0x06) return 0x20; - if ((lordgun_protection_data & 0x18) == 0x00) return 0x20; - - return 0; - } - } - - return 0; -} -void __fastcall lordgun_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff00) == 0x50a900) { - lordgun_protection_write(address/2); - return; - } - - if ((address & 0xfffff00) == 0x50b900) { - aliencha_protection_write(address/2); - return; - } - - switch (address) - { - case 0x502000: - scrollx[0] = data; - return; - - case 0x502200: - scrollx[1] = data; - return; - - case 0x502400: - scrollx[2] = data; - return; - - case 0x502600: - scrollx[3] = data; - return; - - case 0x502800: - scrolly[0] = data; - return; - - case 0x502a00: - scrolly[1] = data; - return; - - case 0x502c00: - scrolly[2] = data; - return; - - case 0x502e00: - scrolly[3] = data; - return; - - case 0x503000: - priority[0] = data; - return; - - case 0x504000: - soundlatch[0] = data >> 8; - soundlatch[1] = data; - ZetNmi(); - return; - - case 0x506000: - case 0x506002: - case 0x506004: - case 0x506006: - ppi8255_w(0, (address >> 1) & 3, data); - return; - - case 0x508000: - case 0x508002: - case 0x508004: - case 0x508006: - ppi8255_w(1, (address >> 1) & 3, data); - return; - } -} - -void __fastcall lordgun_write_byte(UINT32 /*address*/, UINT8 /*data*/) -{ - -} - -UINT16 __fastcall lordgun_read_word(UINT32 address) -{ - if ((address & 0xfffff00) == 0x50a900) { - return lordgun_protection_read(address/2); - } - - if ((address & 0xfffff00) == 0x50b900) { - return aliencha_protection_read(address/2); - } - - switch (address) - { - case 0x503800: - return lordgun_gun_hw_x[0]; - - case 0x503a00: - return lordgun_gun_hw_x[1]; - - case 0x503c00: - return lordgun_gun_hw_y[0]; - - case 0x503e00: - return lordgun_gun_hw_y[1]; - - case 0x506000: - case 0x506002: - case 0x506004: - case 0x506006: - return ppi8255_r(0, (address >> 1) & 3); - - case 0x508000: - case 0x508002: - case 0x508004: - case 0x508006: - return ppi8255_r(1, (address >> 1) & 3); - } - - return 0; -} - -UINT8 __fastcall lordgun_read_byte(UINT32 address) -{ - switch (address) - { - case 0x506001: - case 0x506003: - case 0x506005: - case 0x506007: - return ppi8255_r(0, (address >> 1) & 3); - - case 0x508001: - case 0x508003: - case 0x508005: - case 0x508007: - return ppi8255_r(1, (address >> 1) & 3); - } - - return 0; -} - -static void set_oki_bank(INT32 bank) -{ - if (*okibank != (bank & 0x02)) { - *okibank = bank & 0x02; - - memcpy (DrvSndROM0, DrvSndROM0 + 0x40000 + *okibank * 0x40000, 0x40000); - } -} - -void __fastcall lordgun_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port) - { - case 0x1000: // lordgun - case 0x1001: - BurnYM3812Write(0, port & 1, data); - return; - - case 0x2000: // lordgun - MSM6295Command(0, data); - return; - - case 0x6000: // lordgun - set_oki_bank(data); - return; - - case 0x7000: // aliencha - case 0x7001: - case 0x7002: - BurnYMF278BSelectRegister(port & 3, data); - return; - - case 0x7003: - case 0x7004: - case 0x7005: - BurnYMF278BWriteRegister(port & 3, data); - return; - - case 0x7400: // aliencha - MSM6295Command(0, data); - return; - - case 0x7800: // aliencha - MSM6295Command(1, data); - return; - } -} - -UINT8 __fastcall lordgun_sound_read_port(UINT16 port) -{ - switch (port) - { - case 0x2000: // lordgun - return MSM6295ReadStatus(0); - - case 0x3000: - return soundlatch[0]; - - case 0x4000: - return soundlatch[1]; - - case 0x7000: // aliencha - return BurnYMF278BReadStatus(); - - case 0x7400: // aliencha - return MSM6295ReadStatus(0); - - case 0x7800: // aliencha - return MSM6295ReadStatus(1); - } - - return 0; -} - -// ppi8255 handlers - -static void aliencha_dip_select(UINT8 data) -{ - aliencha_dip_sel = data; -} - -static UINT8 lordgun_dip_read() -{ - return (DrvDips[0] & 0x4f) | (EEPROMRead() ? 0x80 : 0) | (DrvInputs[4] & 0x30); -} - -static void lordgun_eeprom_write(UINT8 data) -{ - static INT32 old; - - for (INT32 i = 0; i < 2; i++) - if ((data & (0x04 << i)) && !(old & (0x04 << i))) - lordgun_update_gun(i); - - // coin counter 0x01 (0) - - EEPROMWrite((data & 0x20), (data & 0x10), (data & 0x40)); - - lordgun_whitescreen = data & 0x80; - - old = data; -} - -static void aliencha_eeprom_write(UINT8 data) -{ - lordgun_whitescreen = !(data & 0x02); - - // coin counters 0x08 (0) and 0x10 (1) - - EEPROMWrite((data & 0x40), (data & 0x20), (data & 0x80)); -} - -static UINT8 lordgun_start1_read() { return DrvInputs[0]; } -static UINT8 lordgun_start2_read() { return DrvInputs[1]; } -static UINT8 lordgun_service_read(){ return DrvInputs[2]; } -static UINT8 lordgun_coin_read() { return DrvInputs[3]; } - -static UINT8 aliencha_service_read(){ return (DrvInputs[2] & 0xfe) | (EEPROMRead() ? 0x01 : 0); } // aliencha eeprom read... - -static UINT8 aliencha_dip_read() -{ - switch (aliencha_dip_sel & 0x70) { - case 0x30: return DrvDips[0]; - case 0x60: return DrvDips[1]; - case 0x50: return DrvDips[2]; - } - return 0xff; -} - -// sound irq / timing handlers - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, nStatus ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 5000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYMF278BReset(); // aliencha - BurnYM3812Reset(); - MSM6295Reset(0); - MSM6295Reset(1); // aliencha - - *okibank = -1; - set_oki_bank(0); // lordgun - - EEPROMReset(); - - aliencha_dip_sel = 0; - lordgun_whitescreen = 0; - - // rom hacks - if (!strncmp(BurnDrvGetTextA(DRV_NAME), "aliencha", 8)) { - *((UINT16*)(Drv68KROM + 0x00a34)) = BURN_ENDIAN_SWAP_INT16(0x7000) | ((DrvDips[3] >> 0) & 1); // text language - *((UINT16*)(Drv68KROM + 0x00a38)) = BURN_ENDIAN_SWAP_INT16(0x7000) | ((DrvDips[3] >> 1) & 1); // character name language - *((UINT16*)(Drv68KROM + 0x00a3c)) = BURN_ENDIAN_SWAP_INT16(0x7000) | ((DrvDips[3] >> 2) & 1); // title - } else { - - UINT8 lordgun_eepromdata[48] = { - 0xFF, 0x83, 0x5F, 0xFF, 0xFF, 0xBF, 0x14, 0xB7, 0xA3, 0xA4, 0x80, 0x29, 0x37, 0xA6, 0x32, 0x39, - 0x37, 0x90, 0x10, 0x33, 0xBA, 0xA3, 0x00, 0x37, 0x01, 0x00, 0xFF, 0xFF, 0x03, 0x42, 0xFF, 0xFF, - 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - }; - - if (EEPROMAvailable() == 0) { - EEPROMFill(lordgun_eepromdata, 0, 48); - } - } - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x200000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x800000; - DrvGfxROM2 = Next; Next += 0x800000; - DrvGfxROM3 = Next; Next += 0x1000000; - - DrvTransTable[0]= Next; Next += (0x0400000 / ( 8 * 8)); - DrvTransTable[1]= Next; Next += (0x0800000 / (16 * 16)); - DrvTransTable[2]= Next; Next += (0x0800000 / (32 * 32)); - DrvTransTable[3]= Next; Next += (0x1000000 / (16 * 16)); - DrvTransTable[4]= Next; Next += (0x0800000 / (16 * 16)) * 16; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x040000; - DrvSndROM2 = Next; Next += 0x200000; - - DrvPalette = (UINT32*)Next; Next += (0x0800 + 1) * sizeof(UINT32); - - draw_bitmap[0] = (UINT16*)Next; Next += 448 * 240 * 2; - draw_bitmap[1] = (UINT16*)Next; Next += 448 * 240 * 2; - draw_bitmap[2] = (UINT16*)Next; Next += 448 * 240 * 2; - draw_bitmap[3] = (UINT16*)Next; Next += 448 * 240 * 2; - draw_bitmap[4] = (UINT16*)Next; Next += 448 * 240 * 2; - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPriRAM = Next; Next += 0x010000; - DrvVidRAM0 = Next; Next += 0x010000; - DrvVidRAM1 = Next; Next += 0x004000; - DrvVidRAM2 = Next; Next += 0x004000; - DrvVidRAM3 = Next; Next += 0x002000; - DrvScrRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x001000; - - DrvZ80RAM = Next; Next += 0x001000; - - scrollx = (UINT16*)Next; Next += 0x000004 * sizeof(UINT16); - scrolly = (UINT16*)Next; Next += 0x000004 * sizeof(UINT16); - priority = (UINT16*)Next; Next += 0x000001 * sizeof(UINT16); - - soundlatch = Next; Next += 0x000002; - - okibank = (INT8*)Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvSetTransTab(UINT8 *gfx, INT32 tab, INT32 len, INT32 size) -{ - for (INT32 i = 0; i < len; i+= (size * size)) - { - DrvTransTable[tab][i/(size*size)] = 1; // transparent - - for (INT32 j = 0; j < (size * size); j++) { - if (gfx[i + j] != 0x3f) { - DrvTransTable[tab][i/(size*size)] = 0; - break; - } - } - } -} - -static void DrvGfxDecode(UINT8 *gfxsrc, UINT8 *gfxdest, INT32 len, INT32 size) -{ - INT32 Planes[6] = { - (((len * 8) / 3) * 2) + 8, (((len * 8) / 3) * 2) + 0, - (((len * 8) / 3) * 1) + 8, (((len * 8) / 3) * 1) + 0, - (((len * 8) / 3) * 0) + 8, (((len * 8) / 3) * 0) + 0 - }; - - INT32 XOffs1[16] = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, - 0x100, 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107 }; - INT32 XOffs2[32] = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, - 0x200, 0x201, 0x202, 0x203, 0x204, 0x205, 0x206, 0x207, - 0x400, 0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407, - 0x600, 0x601, 0x602, 0x603, 0x604, 0x605, 0x606, 0x607 }; - INT32 YOffs[32] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, - 0x080, 0x090, 0x0a0, 0x0b0, 0x0c0, 0x0d0, 0x0e0, 0x0f0, - 0x100, 0x110, 0x120, 0x130, 0x140, 0x150, 0x160, 0x170, - 0x180, 0x190, 0x1a0, 0x1b0, 0x1c0, 0x1d0, 0x1e0, 0x1f0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return; - } - - memcpy (tmp, gfxsrc, len); - - GfxDecode(((len * 8) / 6) / (size*size), 6, size, size, Planes, (size == 32) ? XOffs2 : XOffs1, YOffs, (size*size*2), tmp, gfxdest); - - BurnFree (tmp); -} - -static INT32 DrvInit(INT32 (*pInitCallback)(), INT32 lordgun) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pInitCallback) { - if (pInitCallback()) return 1; - } - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, 0x300000, 8); - DrvGfxDecode(DrvGfxROM2, DrvGfxROM1, 0x600000, 16); - DrvGfxDecode(DrvGfxROM2, DrvGfxROM2, 0x600000, 32); - DrvGfxDecode(DrvGfxROM3, DrvGfxROM3, 0xc00000, 16); - DrvSetTransTab(DrvGfxROM0, 0, 0x0400000, 8); - DrvSetTransTab(DrvGfxROM1, 1, 0x0800000, 16); - DrvSetTransTab(DrvGfxROM2, 2, 0x0800000, 32); - DrvSetTransTab(DrvGfxROM3, 3, 0x1000000, 16); - DrvSetTransTab(DrvGfxROM1, 4, 0x0800000, 16/4); // for line scroll - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvPriRAM, 0x210000, 0x21ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x310000, 0x313fff, MAP_RAM); - SekMapMemory(DrvVidRAM2 , 0x314000, 0x317fff, MAP_RAM); - SekMapMemory(DrvVidRAM3, 0x318000, 0x319fff, MAP_RAM); - SekMapMemory(DrvScrRAM, 0x31c000, 0x31c7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x400000, 0x4007ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x500000, 0x500fff, MAP_RAM); - SekSetWriteWordHandler(0, lordgun_write_word); - SekSetWriteByteHandler(0, lordgun_write_byte); - SekSetReadWordHandler(0, lordgun_read_word); - SekSetReadByteHandler(0, lordgun_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80RAM); - ZetSetOutHandler(lordgun_sound_write_port); - ZetSetInHandler(lordgun_sound_read_port); - ZetClose(); - - // aliencha - BurnYMF278BInit(0, DrvSndROM2, 0x200000, &DrvFMIRQHandler, DrvSynchroniseStream); - BurnYMF278BSetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - BurnTimerAttachZet(5000000); - - // lordgun - BurnYM3812Init(1, 3579545, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(5000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295Init(1, 1000000 / 132, 1); // aliencha - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - ppi8255_init(2); - if (lordgun) { - PPI0PortReadA = lordgun_dip_read; - PPI0PortWriteB = lordgun_eeprom_write; - PPI0PortReadC = lordgun_service_read; - } else { - PPI0PortReadA = aliencha_dip_read; - PPI0PortReadC = aliencha_service_read; - PPI0PortWriteB = aliencha_eeprom_write; - PPI0PortWriteC = aliencha_dip_select; - } - - PPI1PortReadA = lordgun_start1_read; - PPI1PortReadB = lordgun_start2_read; - PPI1PortReadC = lordgun_coin_read; - - EEPROMInit(&eeprom_interface_93C46); - - GenericTilesInit(); - - BurnGunInit(2, true); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYMF278BExit(); // aliencha - BurnYM3812Exit(); - MSM6295Exit(0); - MSM6295Exit(1); // aliencha - - ppi8255_exit(); - BurnGunExit(); - - SekExit(); - ZetExit(); - - EEPROMExit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 lordgunLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x200000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x400000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x600000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x800000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0xa00000, 14, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x040000, 15, 1)) return 1; - - UINT16 *rom = (UINT16*)Drv68KROM; - - for (INT32 i = 0; i < 0x100000/2; i++) { - if ((i & 0x0120) == 0x0100 || (i & 0x0a00) == 0x0800) - rom[i] ^= BURN_ENDIAN_SWAP_INT16(0x0010); - } - - return 0; -} - -static INT32 alienchaLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 1)) return 1; - BurnByteswap(Drv68KROM, 0x200000); - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x400000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x800000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x040000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 12, 1)) return 1; - - if (BurnLoadRom(DrvSndROM2 + 0x000000, 13, 1)) return 1; - - return 0; -} - -static INT32 alienchacLoadRoms() -{ - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 1)) return 1; - BurnByteswap(Drv68KROM, 0x200000); - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 2, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x400000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x800000, 12, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x040000, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 14, 1)) return 1; - - if (BurnLoadRom(DrvSndROM2 + 0x000000, 15, 1)) return 1; - - return 0; -} - -static void draw_layer_linescroll() -{ - UINT16 *vram = (UINT16*)DrvVidRAM1; - UINT16 *sram = (UINT16*)DrvScrRAM; - UINT16 *dest = draw_bitmap[1]; - - for (INT32 y = 0; y < nScreenHeight; y++, dest += nScreenWidth) - { - INT32 yscroll = (scrolly[1] + y) & 0x1ff; - - for (INT32 x = 0; x < nScreenWidth + 16; x+=16) { - - INT32 xscroll = (scrollx[1] + sram[y * 2 + 1] + x) & 0x7ff; - - INT32 ofst = (((yscroll >> 4) << 7) | (xscroll >> 4)) << 1; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[ofst]); - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[ofst + 1]) & 0x7fff; - INT32 pri = (attr & 0x0e00) >> 9; - - INT32 flipx = attr & 0x8000; - INT32 flipy = attr & 0x4000; - - INT32 color = ((attr & 0x0070) << 2)+0x600+pri*0x800; - - { - UINT8 *gfx = DrvGfxROM1 + (code << 8); - - if (flipy) gfx += ((yscroll & 0x0f)^0xf) << 4; - else gfx += ((yscroll & 0x0f) ) << 4; - - if (DrvTransTable[4][(gfx-DrvGfxROM1)/16]) continue; - - if (flipx) flipx = 0x0f; - - for (INT32 xx = 0, sx = x - (xscroll & 0x0f); xx < 16; xx++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[xx^flipx]; - - if (pxl == 0x3f) continue; - - dest[sx] = pxl | color; - } - } - } - } -} - -static void draw_layer(UINT8 *ram, UINT8 *gfx, INT32 size, INT32 wide, INT32 high, INT32 color_offset, INT32 color_and, INT32 layer) -{ - INT32 twidth = wide * size; - INT32 theight = high * size; - - INT32 code_and = (size == 32) ? 0x1fff : ((size == 16) ? 0x7fff : 0xffff); - - UINT16 *vram = (UINT16*)ram; - - for (INT32 sy = 0, offs = 0; sy < high * size; sy+=size) - { - for (INT32 sx = 0; sx < wide * size; sx+=size, offs++) - { - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 1]) & code_and; - if (DrvTransTable[layer][code]) continue; // transparent - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 0]); - - INT32 prio = (attr >> 9) & 0x07; - INT32 color= ((attr >> 4) & color_and) + color_offset / 0x40 + prio * 0x800 / 0x40; - - INT32 flipx= attr & 0x8000; - INT32 flipy= attr & 0x4000; - - INT32 xx = sx - (scrollx[layer] % twidth); - if (xx < (0 - (size - 1))) xx += twidth; - - INT32 yy = sy - (scrolly[layer] % theight); - if (yy < (0 - (size - 1))) yy += theight; - - if (xx >= nScreenWidth || yy >= nScreenHeight) continue; - - if (flipy) { - if (flipx) { - RenderCustomTile_Mask_FlipXY_Clip(draw_bitmap[layer], size, size, code, xx, yy, color, 6, 0x3f, 0, gfx); - } else { - RenderCustomTile_Mask_FlipY_Clip(draw_bitmap[layer], size, size, code, xx, yy, color, 6, 0x3f, 0, gfx); - } - } else { - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(draw_bitmap[layer], size, size, code, xx, yy, color, 6, 0x3f, 0, gfx); - } else { - RenderCustomTile_Mask_Clip(draw_bitmap[layer], size, size, code, xx, yy, color, 6, 0x3f, 0, gfx); - } - } - } - } -} - -static void draw_sprites() -{ - UINT16 *sprite = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x800 / 2; offs += 4) - { - INT32 x0, x1, dx, y0, y1, dy; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(sprite[offs + 1]); - if (attr & 0x0100) break; - - INT32 sy = BURN_ENDIAN_SWAP_INT16(sprite[offs + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(sprite[offs + 2]); - INT32 sx = BURN_ENDIAN_SWAP_INT16(sprite[offs + 3]); - INT32 flipx = (attr & 0x8000); - INT32 flipy = (attr & 0x4000); - INT32 pri = (attr & 0x0e00) >> 9; - INT32 color = (attr & 0x00f0) >> 4; - INT32 nx = (attr & 0x000f) + 1; - INT32 ny = ((sy & 0xf000) >> 12) + 1; - - if (flipx) { x0 = nx - 1; x1 = -1; dx = -1; } - else { x0 = 0; x1 = nx; dx = +1; } - - if (flipy) { y0 = ny - 1; y1 = -1; dy = -1; } - else { y0 = 0; y1 = ny; dy = +1; } - - sx -= 0x18; - sy = (sy & 0x7ff) - (sy & 0x800); - - for (INT32 y = y0; y != y1; y += dy, code += 1 - 0x10 * nx) - { - for (INT32 x = x0; x != x1; x += dx, code += 0x10) - { - if (DrvTransTable[3][code]) continue; - - if (flipy) { - if (flipx) { - RenderCustomTile_Mask_FlipXY_Clip(draw_bitmap[4], 16, 16, code, sx + x * 0x10, sy + y * 0x10, color + pri * 0x800/0x40, 6, 0x3f, 0, DrvGfxROM3); - } else { - RenderCustomTile_Mask_FlipY_Clip(draw_bitmap[4], 16, 16, code, sx + x * 0x10, sy + y * 0x10, color + pri * 0x800/0x40, 6, 0x3f, 0, DrvGfxROM3); - } - } else { - if (flipx) { - RenderCustomTile_Mask_FlipX_Clip(draw_bitmap[4], 16, 16, code, sx + x * 0x10, sy + y * 0x10, color + pri * 0x800/0x40, 6, 0x3f, 0, DrvGfxROM3); - } else { - RenderCustomTile_Mask_Clip(draw_bitmap[4], 16, 16, code, sx + x * 0x10, sy + y * 0x10, color + pri * 0x800/0x40, 6, 0x3f, 0, DrvGfxROM3); - } - } - } - } - } -} - -static void copy_layers() -{ - const UINT8 pri2layer[8] = { 0, 0, 0, 4, 3, 0, 1, 2 }; - const UINT8 layerpri[5] = { 0, 1, 2, 4, 3 }; - - UINT16 *dest = pTransDraw; - UINT16 *source[5] = { draw_bitmap[0], draw_bitmap[1], draw_bitmap[2], draw_bitmap[3], draw_bitmap[4] }; - UINT16 *pri_ram = (UINT16*)DrvPriRAM; - - for (INT32 y = 0; y < nScreenHeight; y++) - { - for (INT32 x = 0; x < nScreenWidth; x++) - { - UINT16 pens[5]; - INT32 pri_addr = 0; - - for (INT32 l = 0; l < 5; l++) { - pens[l] = *source[l]++; - if (pens[l] == 0x3f) pri_addr |= 1 << layerpri[l]; - } - - pri_addr |= (pens[1] >> 11) << 5; - pri_addr |= (pens[4] >> 11) << 8; - pri_addr |= (pens[0] >> 11) << 11; - pri_addr |= (pens[3] >> 11) << 14; - - *dest++ = pens[pri2layer[BURN_ENDIAN_SWAP_INT16(pri_ram[pri_addr & 0x7fff]) & 7]] & 0x7ff; - } - } -} - -static void DrvPaletteRecalc() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x1000 / 2; i++) { - INT32 r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x0f; - INT32 g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 4) & 0x0f; - INT32 b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - - DrvPalette[0x0800] = BurnHighCol(0xff, 0xff, 0xff, 0); // white -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - if (lordgun_whitescreen) { - for (INT32 o = 0; o < nScreenWidth * nScreenHeight; o++) { - pTransDraw[o] = 0x800; // white!! - } - - BurnTransferCopy(DrvPalette); - return 0; - } - - for (INT32 o = 0; o < nScreenWidth * nScreenHeight; o++) { - draw_bitmap[0][o] = draw_bitmap[1][o] = draw_bitmap[2][o] = draw_bitmap[3][o] = draw_bitmap[4][o] = 0x003f; - } - - INT32 line_enable = 0; - { - UINT16 *rs = (UINT16*)DrvScrRAM; - for (INT32 i = 0; i < nScreenHeight * 2; i+=2) { - if ((BURN_ENDIAN_SWAP_INT16(rs[i + 1]) & 0x7ff) != (BURN_ENDIAN_SWAP_INT16(rs[1]) & 0x7ff)) { - line_enable = 1; - break; - } - } - } - - draw_layer(DrvVidRAM0, DrvGfxROM0, 8, 0x100, 0x040, 0x500, 0x03, 0); - if (line_enable == 0) { - draw_layer(DrvVidRAM1, DrvGfxROM1, 16, 0x080, 0x020, 0x600, 0x07, 1); - } else { - draw_layer_linescroll(); - } - draw_layer(DrvVidRAM2, DrvGfxROM2, 32, 0x040, 0x010, 0x700, 0x03, 2); - draw_layer(DrvVidRAM3, DrvGfxROM0, 8, 0x040, 0x020, 0x400, 0x0f, 3); - draw_sprites(); - - copy_layers(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 lordgunDraw() -{ - DrvDraw(); - - for (INT32 i = 0; i < BurnDrvGetMaxPlayers(); i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } - - return 0; -} - -static inline void compile_inputs() -{ - memset (DrvInputs, 0xff, 5 * sizeof(INT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - - BurnGunMakeInputs(0, (INT16)DrvAxis[0], (INT16)DrvAxis[1]); - BurnGunMakeInputs(1, (INT16)DrvAxis[2], (INT16)DrvAxis[3]); - - float x0 = ((float)((BurnGunX[0] >> 8) + 8)) / 448 * 412; - float y0 = ((float)((BurnGunY[0] >> 8) + 8)) / 224 * 224; - float x1 = ((float)((BurnGunX[1] >> 8) + 8)) / 448 * 412; - float y1 = ((float)((BurnGunY[1] >> 8) + 8)) / 224 * 224; - DrvAnalogInput[0] = (UINT16)x0 + 0x3c; - DrvAnalogInput[2] = (UINT8)y0 + 0; - DrvAnalogInput[1] = (UINT16)x1 + 0x3c; - DrvAnalogInput[3] = (UINT8)y1 + 0; -} - -static INT32 lordgunFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - compile_inputs(); - - SekNewFrame(); - ZetNewFrame(); - - INT32 nTotalCycles[2] = { 10000000 / 60, 5000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - INT32 nInterleave = 50; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - nNext = (i + 1) * nTotalCycles[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - BurnTimerUpdateYM3812(i * (nTotalCycles[1] / nInterleave)); - } - - BurnTimerEndFrameYM3812(nTotalCycles[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - lordgunDraw(); - } - - return 0; -} - -static INT32 alienchaFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - compile_inputs(); - - SekNewFrame(); - ZetNewFrame(); - - INT32 nInterleave = 1000; - - INT32 nCyclesTotal[2] = { 10000000 / 60, 5000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYMF278BUpdate(nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029708; - } - - if (nAction & ACB_VOLATILE) { - - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYMF278BScan(nAction, pnMin); - - BurnGunScan(); - EEPROMScan(nAction, pnMin); - - SCAN_VAR(aliencha_dip_sel); - SCAN_VAR(lordgun_whitescreen); - SCAN_VAR(lordgun_protection_data); - - SCAN_VAR(lordgun_gun_hw_x[0]); - SCAN_VAR(lordgun_gun_hw_y[0]); - SCAN_VAR(lordgun_gun_hw_x[1]); - SCAN_VAR(lordgun_gun_hw_y[1]); - } - - if (nAction & ACB_WRITE) { - INT32 bank = *okibank; - *okibank = -1; - set_oki_bank(bank); - } - - return 0; -} - - -// Lord of Gun (USA) - -static struct BurnRomInfo lordgunRomDesc[] = { - { "lordgun.10", 0x080000, 0xacda77ef, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "lordgun.4", 0x080000, 0xa1a61254, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "lordgun.90", 0x010000, 0xd59b5e28, 2 | BRF_PRG | BRF_ESS }, // 2 z80 code - - { "igst001.108", 0x100000, 0x36dd96f3, 3 | BRF_GRA }, // 3 8x8 tiles - { "igst002.114", 0x100000, 0x816a7665, 3 | BRF_GRA }, // 4 - { "igst003.119", 0x100000, 0xcbfee543, 3 | BRF_GRA }, // 5 - - { "igsb001.82", 0x200000, 0x3096de1c, 4 | BRF_GRA }, // 6 16x16 and 32x32 tiles - { "igsb002.91", 0x200000, 0x2234531e, 4 | BRF_GRA }, // 7 - { "igsb003.97", 0x200000, 0x6cbf21ac, 4 | BRF_GRA }, // 8 - - { "igsa001.14", 0x200000, 0x400abe33, 5 | BRF_GRA }, // 9 Sprites - { "igsa004.13", 0x200000, 0x52687264, 5 | BRF_GRA }, // 10 - { "igsa002.9", 0x200000, 0xa4810e38, 5 | BRF_GRA }, // 11 - { "igsa005.8", 0x200000, 0xe32e79e3, 5 | BRF_GRA }, // 12 - { "igsa003.3", 0x200000, 0x649e48d9, 5 | BRF_GRA }, // 13 - { "igsa006.2", 0x200000, 0x39288eb6, 5 | BRF_GRA }, // 14 - - { "lordgun.100", 0x080000, 0xb4e0fa07, 6 | BRF_SND }, // 15 OKI #0 Samples -}; - -STD_ROM_PICK(lordgun) -STD_ROM_FN(lordgun) - -static INT32 lordgunInit() -{ - return DrvInit(lordgunLoadRoms, 1); -} - -struct BurnDriver BurnDrvLordgun = { - "lordgun", NULL, NULL, NULL, "1994", - "Lord of Gun (USA)\0", "Imperfect graphics and sound", "IGS", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, lordgunRomInfo, lordgunRomName, NULL, NULL, LordgunInputInfo, LordgunDIPInfo, - lordgunInit, DrvExit, lordgunFrame, lordgunDraw, DrvScan, &DrvRecalc, 0x800, - 448, 224, 4, 3 -}; - -// Alien Challenge (World) - -static struct BurnRomInfo alienchaRomDesc[] = { - { "igsc0102.u81", 0x200000, 0xe3432be3, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - - { "hfh_s.u86", 0x010000, 0x5728a9ed, 2 | BRF_PRG | BRF_ESS }, // 1 z80 code - - { "igst0101.u9", 0x100000, 0x2ce12d7b, 3 | BRF_GRA }, // 2 8x8 tiles - { "igst0102.u10", 0x100000, 0x542a76a0, 3 | BRF_GRA }, // 3 - { "igst0103.u11", 0x100000, 0xadf5698a, 3 | BRF_GRA }, // 4 - - { "igsb0101.u8", 0x200000, 0x5c995f7e, 4 | BRF_GRA }, // 5 16x16 and 32x32 tiles - { "igsb0102.u7", 0x200000, 0xa2ae9baf, 4 | BRF_GRA }, // 6 - { "igsb0103.u6", 0x200000, 0x11b927af, 4 | BRF_GRA }, // 7 - - { "igsa0101.u3", 0x400000, 0x374d07c4, 5 | BRF_GRA }, // 8 Sprites - { "igsa0102.u2", 0x400000, 0xdbeee7ac, 5 | BRF_GRA }, // 9 - { "igsa0103.u1", 0x400000, 0xe5f19041, 5 | BRF_GRA }, // 10 - - { "hfh_g.u65", 0x040000, 0xec469b57, 6 | BRF_SND }, // 11 OKI #0 Samples - - { "hfh_g.u66", 0x040000, 0x7cfcd98e, 7 | BRF_SND }, // 12 OKI #1 Samples - - { "yrw801-m", 0x200000, 0x2a9d8d43, 8 | BRF_SND }, // 13 YMF278b Samples -}; - -STD_ROM_PICK(aliencha) -STD_ROM_FN(aliencha) - -static INT32 alienchaInit() -{ - return DrvInit(alienchaLoadRoms, 0); -} - -struct BurnDriver BurnDrvAliencha = { - "aliencha", NULL, NULL, NULL, "1994", - "Alien Challenge (World)\0", "Imperfect sound", "IGS", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, alienchaRomInfo, alienchaRomName, NULL, NULL, AlienchaInputInfo, AlienchaDIPInfo, - alienchaInit, DrvExit, alienchaFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 448, 224, 4, 3 -}; - - -// Alien Challenge (China) - -static struct BurnRomInfo alienchacRomDesc[] = { - { "igsc0102.u81", 0x200000, 0xe3432be3, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "hfh_p.u80", 0x080000, 0x5175ebdc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "hfh_p.u79", 0x080000, 0x42ad978c, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "hfh_s.u86", 0x010000, 0x5728a9ed, 2 | BRF_PRG | BRF_ESS }, // 3 z80 code - - { "igst0101.u9", 0x100000, 0x2ce12d7b, 3 | BRF_GRA }, // 4 8x8 tiles - { "igst0102.u10", 0x100000, 0x542a76a0, 3 | BRF_GRA }, // 5 - { "igst0103.u11", 0x100000, 0xadf5698a, 3 | BRF_GRA }, // 6 - - { "igsb0101.u8", 0x200000, 0x5c995f7e, 4 | BRF_GRA }, // 7 16x16 and 32x32 tiles - { "igsb0102.u7", 0x200000, 0xa2ae9baf, 4 | BRF_GRA }, // 8 - { "igsb0103.u6", 0x200000, 0x11b927af, 4 | BRF_GRA }, // 9 - - { "igsa0101.u3", 0x400000, 0x374d07c4, 5 | BRF_GRA }, // 10 Sprites - { "igsa0102.u2", 0x400000, 0xdbeee7ac, 5 | BRF_GRA }, // 11 - { "igsa0103.u1", 0x400000, 0xe5f19041, 5 | BRF_GRA }, // 12 - - { "hfh_g.u65", 0x040000, 0xec469b57, 6 | BRF_SND }, // 11 OKI #0 Samples - - { "hfh_g.u66", 0x040000, 0x7cfcd98e, 7 | BRF_SND }, // 12 OKI #1 Samples - - { "yrw801-m", 0x200000, 0x2a9d8d43, 8 | BRF_SND }, // 13 YMF278b Samples -}; - -STD_ROM_PICK(alienchac) -STD_ROM_FN(alienchac) - -static INT32 alienchacInit() -{ - return DrvInit(alienchacLoadRoms, 0); -} - -struct BurnDriver BurnDrvAlienchac = { - "alienchac", "aliencha", NULL, NULL, "1994", - "Alien Challenge (China)\0", "Imperfect sound", "IGS", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, alienchacRomInfo, alienchacRomName, NULL, NULL, AlienchaInputInfo, AlienchacDIPInfo, - alienchacInit, DrvExit, alienchaFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 448, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_macrossp.cpp b/jan/src/burn/drv/pst90s/d_macrossp.cpp deleted file mode 100644 index 563259531..000000000 --- a/jan/src/burn/drv/pst90s/d_macrossp.cpp +++ /dev/null @@ -1,1275 +0,0 @@ -// FB Alpha Macross Plus driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "es5506.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM0; -static UINT8 *Drv68KROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvTransTab[5]; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM2; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM[4]; -static UINT8 *DrvZoomRAM[4]; -static UINT8 *DrvVidReg[4]; -static UINT8 *DrvPalRAM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvSprBuf[2]; - -static UINT16 *tilemaps[4]; -static UINT8 *dirty_tiles[4]; -static INT32 dirty_layer[4]; - -static UINT32 *Palette; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 palette_fade; -static UINT16 soundlatch; -static UINT8 sound_pending; -static UINT8 sound_toggle; - -static UINT8 DrvJoy1[32]; -static UINT8 DrvJoy2[32]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT32 DrvInputs[2]; - -static INT32 color_mask[3]; -static INT32 volume_mute = 0; - -static struct BurnInputInfo MacrosspInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 16, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 17, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 18, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 19, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 20, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 21, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 22, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 23, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 24, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 25, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 26, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 27, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 28, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 29, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 30, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy1 + 31, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Macrossp) - -static struct BurnDIPInfo MacrosspDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x16, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x16, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x16, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x16, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x16, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x16, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x16, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x16, 0x01, 0x0f, 0x09, "1 Coins/7 Credits" }, - {0x16, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x16, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x00, "5 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x16, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x16, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x16, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x16, 0x01, 0xf0, 0x90, "1 Coins/7 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x03, 0x02, "Easy" }, - {0x17, 0x01, 0x03, 0x03, "Normal" }, - {0x17, 0x01, 0x03, 0x01, "Hard" }, - {0x17, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x17, 0x01, 0x0c, 0x00, "2" }, - {0x17, 0x01, 0x0c, 0x0c, "3" }, - {0x17, 0x01, 0x0c, 0x08, "4" }, - {0x17, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x10, 0x00, "Off" }, - {0x17, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x20, 0x20, "Off" }, - {0x17, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x17, 0x01, 0x40, 0x40, "Japanese" }, - {0x17, 0x01, 0x40, 0x00, "English" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x80, 0x80, "Off" }, - {0x17, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Macrossp) - -static void __fastcall macrossp_main_write_long(UINT32 /*address*/, UINT32 /*data*/) -{ -// if (address != 0xfe0000 && (address < 0x900000 || address >= 0x920000)) -// bprintf (0, _T("MWL: %6.6x, %8.8x\n"), address,data); -} - -static void __fastcall macrossp_main_write_byte(UINT32 /*address*/, UINT8/* data*/) -{ -// if (address != 0x90000b) -// bprintf (0, _T("MWB: %6.6x, %2.2x\n"), address,data); -} - -static UINT32 __fastcall macrossp_main_read_long(UINT32 address) -{ -// if (address != 0xfe0000 && address != 0xb00000) -// bprintf (0, _T("MRL: %6.6x\n"), address); - - switch (address) - { - case 0xb00000: - return DrvInputs[0]; - } - - return 0; -} - -static void __fastcall macrossp_main_write_word(UINT32 address, UINT16 data) -{ -// bprintf (0, _T("MWW: %6.6x, %4.4x\n"), address, data); - - switch (address) - { - case 0xb00010: - // case 0xb00012: - { - data &= 0xff; - if (data != 0xff) { - palette_fade = (UINT8)(0xff - ((data & 0xff) - 40) / 212.0 * 255.0); - DrvRecalc = 1; - } - } - return; - - case 0xc00000: - soundlatch = data; - sound_pending = 1; - SekClose(); - SekOpen(1); - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - SekOpen(0); - return; - } -} - -static UINT16 __fastcall macrossp_main_read_word(UINT32 address) -{ -// bprintf (0, _T("MRW: %6.6x\n"), address); - - switch (address) - { - case 0xb00000: - return DrvInputs[0] >> 16; - - case 0xb00002: - return DrvInputs[0]; - - case 0xb00004: - sound_toggle ^= 1; - return sound_toggle + (sound_pending << 1); - - case 0xb0000c: - return DrvDips[0] | (DrvDips[1] << 8); - } - - return 0; -} - -static UINT8 __fastcall macrossp_main_read_byte(UINT32 address) -{ -// bprintf (0, _T("MRB: %6.6x\n"), address); - - switch (address) - { - case 0xb00007: - sound_toggle ^= 1; - return sound_toggle + (sound_pending << 1); - } - - return 0; -} - -static void __fastcall macrossp_vidram_write_long(UINT32 address, UINT32 data) -{ - INT32 select = (address / 0x8000) & 3; - address = (address & 0x3ffc) / 4; - - UINT32 *ram = (UINT32*)DrvVidRAM[select]; - - data = (data << 16) | (data >> 16); - - if (ram[address] != data) { - ram[address] = data; - dirty_tiles[select][address/1] = 1; - dirty_layer[select] = 1; - } -} - -static void __fastcall macrossp_vidram_write_word(UINT32 address, UINT16 data) -{ - INT32 select = (address / 0x8000) & 3; - - address = (address & 0x3ffe) / 2; - - UINT16 *ram = (UINT16*)DrvVidRAM[select]; - - if (ram[address] != data) { - ram[address] = data; - dirty_tiles[select][address/2] = 1; - dirty_layer[select] = 1; - } -} - - -static void __fastcall macrossp_vidram_write_byte(UINT32 address, UINT8 data) -{ - INT32 select = (address / 0x8000) & 3; - - address &= 0x3fff; - - if (DrvVidRAM[select][address^1] != data) { - DrvVidRAM[select][address^1] = data; - dirty_tiles[select][address/4] = 1; - dirty_layer[select] = 1; - } -} - -static inline void palette_write(INT32 offset) -{ - UINT32 p = *((UINT32*)(DrvPalRAM + offset)); - - UINT8 r = p >> 8; - UINT8 g = p >> 0; - UINT8 b = p >> 24; - - r = (r * palette_fade) / 255; - g = (g * palette_fade) / 255; - b = (b * palette_fade) / 255; - - Palette[offset/4] = (r * 0x10000) + (g * 0x100) + b; - DrvPalette[offset/4] = BurnHighCol(r,g,b,0); -} - -static void __fastcall macrossp_palette_write_long(UINT32 address, UINT32 data) -{ - *((UINT32*)(DrvPalRAM + (address & 0x3ffc))) = (data << 16) | (data >> 16); - palette_write(address & 0x3ffc); - -} - -static void __fastcall macrossp_palette_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + (address & 0x3ffe))) = data; - palette_write(address & 0x3ffc); -} - -static void __fastcall macrossp_palette_write_byte(UINT32 address, UINT8 data) -{ - DrvPalRAM[(address & 0x3fff)^1] = data; - palette_write(address & 0x3ffc); -} - -static UINT8 __fastcall macrossp_sound_read_byte(UINT32 /*address*/) -{ -// bprintf (0, _T("SRB: %6.6x\n"), address); - - return 0; -} - -static void __fastcall macrossp_sound_write_byte(UINT32 /*ddress*/, UINT8 /*data*/) -{ -// bprintf (0, _T("SWB: %6.6x, %2.2x\n"), address, data); -} - -static void __fastcall macrossp_sound_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffff80) == 0x400000) { - ES5506Write((address / 2) & 0x3f, data); - } -} - -static UINT16 __fastcall macrossp_sound_read_word(UINT32 address) -{ - if ((address & 0xffff80) == 0x400000) { - return ES5506Read((address / 2) & 0x3f); - } - - switch (address) - { - case 0x600000: - sound_pending = 0; - return soundlatch; - } - - return 0; -} - -static tilemap_callback( text ) -{ - UINT32 *ram = (UINT32*)(DrvVidRAM[3]); - - UINT16 code = ram[offs] >> 16; - INT32 color = (ram[offs] >> 1) & 0x7f; - - TILE_SET_INFO(4, code, color, DrvTransTab[4][code] ? TILE_SKIP : 0); -} - -static tilemap_callback( scra ) -{ - UINT32 *ram = (UINT32*)(DrvVidRAM[0]); - - UINT16 attr = ram[offs]; - UINT16 code = ram[offs] >> 16; - - INT32 color; - if (color_mask[0] == 7) - color = (attr << 1) & 0x1c; - else - color = (attr >> 1) & 0x1f; - - INT32 flags = TILE_FLIPYX(attr >> 14); - - flags |= DrvTransTab[1][code] ? TILE_SKIP : 0; - - TILE_SET_INFO(1, code, color, flags); -} - -static tilemap_callback( scrb ) -{ - UINT32 *ram = (UINT32*)(DrvVidRAM[1]); - - UINT16 attr = ram[offs]; - UINT16 code = ram[offs] >> 16; - - INT32 color; - if (color_mask[1] == 7) - color = (attr << 1) & 0x1c; - else - color = (attr >> 1) & 0x1f; - - INT32 flags = TILE_FLIPYX(attr >> 14); - - flags |= DrvTransTab[2][code] ? TILE_SKIP : 0; - - TILE_SET_INFO(2, code, color, flags); -} - -static tilemap_callback( scrc ) -{ - UINT32 *ram = (UINT32*)(DrvVidRAM[2]); - - UINT16 attr = ram[offs]; - UINT16 code = ram[offs] >> 16; - - INT32 color; - if (color_mask[2] == 7) - color = (attr << 1) & 0x1c; - else - color = (attr >> 1) & 0x1f; - - INT32 flags = TILE_FLIPYX(attr >> 14); - - flags |= DrvTransTab[3][code] ? TILE_SKIP : 0; - - TILE_SET_INFO(3, code, color, flags); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - memset (dirty_tiles[0], 1, 64*64); - memset (dirty_tiles[1], 1, 64*64); - memset (dirty_tiles[2], 1, 64*64); - dirty_layer[0] = dirty_layer[1] = dirty_layer[2] = 1; - - SekOpen(0); - SekReset(); - SekClose(); - - SekOpen(1); - SekReset(); - SekClose(); - - ES5506Reset(); - - volume_mute = 60; - ES5506SetRoute(0, 0.00, BURN_SND_ES5506_ROUTE_BOTH); - - palette_fade = 0xff; // quizmoon doesn't initialize! - soundlatch = 0; - sound_pending = 0; - sound_toggle = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM0 = Next; Next += 0x400000; - Drv68KROM1 = Next; Next += 0x100000; - - DrvGfxROM0 = Next; Next += 0x1000000; - DrvGfxROM1 = Next; Next += 0x800000; - DrvGfxROM2 = Next; Next += 0x800000; - DrvGfxROM3 = Next; Next += 0x800000; - DrvGfxROM4 = Next; Next += 0x100000; - - DrvTransTab[0] = Next; Next += 0x1000000 / 0x100; - DrvTransTab[1] = Next; Next += 0x0800000 / 0x100; - DrvTransTab[2] = Next; Next += 0x0800000 / 0x100; - DrvTransTab[3] = Next; Next += 0x0800000 / 0x100; - DrvTransTab[4] = Next; Next += 0x0100000 / 0x100; - - DrvSndROM0 = Next; Next += 0x800000; // ES5506 Banks 0 & 1 - DrvSndROM2 = Next; Next += 0x800000; // 2 & 3 - - Palette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x003000; - DrvSprBuf[0] = Next; Next += 0x003000; - DrvSprBuf[1] = Next; Next += 0x003000; - DrvVidRAM[0] = Next; Next += 0x004000; - DrvZoomRAM[0] = Next; Next += 0x000400; - DrvVidReg[0] = Next; Next += 0x000400; - DrvVidRAM[1] = Next; Next += 0x004000; - DrvZoomRAM[1] = Next; Next += 0x000400; - DrvVidReg[1] = Next; Next += 0x000400; - DrvVidRAM[2] = Next; Next += 0x004000; - DrvZoomRAM[2] = Next; Next += 0x000400; - DrvVidReg[2] = Next; Next += 0x000400; - DrvVidRAM[3] = Next; Next += 0x004000; - DrvZoomRAM[3] = Next; Next += 0x000400; - DrvVidReg[3] = Next; Next += 0x000400; - DrvPalRAM = Next; Next += 0x004000; - Drv68KRAM0 = Next; Next += 0x020000; - Drv68KRAM1 = Next; Next += 0x008000; - - RamEnd = Next; - - tilemaps[0] = (UINT16*)Next; Next += (16 * 64) * (16 * 64) * 2; - tilemaps[1] = (UINT16*)Next; Next += (16 * 64) * (16 * 64) * 2; - tilemaps[2] = (UINT16*)Next; Next += (16 * 64) * (16 * 64) * 2; - - dirty_tiles[0] = Next; Next += 64 * 64; - dirty_tiles[1] = Next; Next += 64 * 64; - dirty_tiles[2] = Next; Next += 64 * 64; - - MemEnd = Next; - - return 0; -} - -static void DrvBuildTransTab(INT32 tab, UINT8 *rom, INT32 len) -{ - for (INT32 i = 0; i < len; i+= 16*16) - { - DrvTransTab[tab][len/(16*16)] = 1; - - for (INT32 j = 0; j < 16*16; j++) { - if (rom[i+j]) { - DrvTransTab[tab][len/(16*16)] = 0; - break; - } - } - } -} - -static void DrvGfxExpand(UINT8 *rom, INT32 len) -{ - for (INT32 i = (len - 1) * 2; i >= 0; i -= 2) - { - rom[i+0] = rom[i/2] >> 4; - rom[i+1] = rom[i/2] & 0xf; - } -} - -static INT32 DrvInit(INT32 select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (select == 0) // macrossp - { - if (BurnLoadRom(Drv68KROM0 + 0x000002, 0, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000003, 1, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000001, 3, 4)) return 1; - - if (BurnLoadRom(Drv68KROM1 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x000001, 5, 2)) return 1; - - // if (BurnLoadRom(Drv68KROM0 + 0x000000, 6, 4)) return 1; // unused bios? - - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 9, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 10, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x400000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x400000, 16, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 17, 1)) return 1; - - memset (DrvSndROM0, 0xff, 0x800000); - if (BurnLoadRom(DrvSndROM0 + 0x000001, 18, 2)) return 1; - - DrvGfxExpand(DrvGfxROM4, 0x80000); - } - else - { - if (BurnLoadRom(Drv68KROM0 + 0x000002, 0, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000003, 1, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x000001, 3, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x200002, 4, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x200003, 5, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x200000, 6, 4)) return 1; - if (BurnLoadRom(Drv68KROM0 + 0x200001, 7, 4)) return 1; - - if (BurnLoadRom(Drv68KROM1 + 0x000000, 8, 2)) return 1; - if (BurnLoadRom(Drv68KROM1 + 0x000001, 9, 2)) return 1; - - // if (BurnLoadRom(Drv68KROM0 + 0x000000, 10, 4)) return 1; // unused bios? - - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 11, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 12, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 13, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 14, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 16, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 17, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000001, 18, 2)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x000000, 19, 2)) return 1; - - if (BurnLoadRom(DrvSndROM2 + 0x000001, 20, 2)) return 1; - if (BurnLoadRom(DrvSndROM2 + 0x000000, 21, 2)) return 1; - } - - DrvBuildTransTab(0, DrvGfxROM0, 0x1000000); - DrvBuildTransTab(1, DrvGfxROM1, 0x0800000); - DrvBuildTransTab(2, DrvGfxROM2, 0x0800000); - DrvBuildTransTab(3, DrvGfxROM3, 0x0800000); - DrvBuildTransTab(4, DrvGfxROM4, 0x0100000); - - SekInit(0, 0x68ec020); - SekOpen(0); - SekMapMemory(Drv68KROM0, 0x000000, 0x3fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x800000, 0x802fff, MAP_RAM); - SekMapMemory(DrvVidRAM[0], 0x900000, 0x903fff, MAP_RAM); // handler - SekMapMemory(DrvZoomRAM[0], 0x904000, 0x9043ff, MAP_RAM); // + 0x200 - SekMapMemory(DrvVidReg[0], 0x905000, 0x9053ff, MAP_RAM); // 0-b - SekMapMemory(DrvVidRAM[1], 0x908000, 0x90bfff, MAP_RAM); // handler - SekMapMemory(DrvZoomRAM[1], 0x90c000, 0x90c3ff, MAP_RAM); // + 0x200 - SekMapMemory(DrvVidReg[1], 0x90d000, 0x90d3ff, MAP_RAM); // 0-b - SekMapMemory(DrvVidRAM[1], 0x910000, 0x913fff, MAP_RAM); // handler - SekMapMemory(DrvZoomRAM[2], 0x914000, 0x9143ff, MAP_RAM); // + 0x200 - SekMapMemory(DrvVidReg[2], 0x915000, 0x9153ff, MAP_RAM); // 0-b - SekMapMemory(DrvVidRAM[3], 0x918000, 0x91bfff, MAP_RAM); - SekMapMemory(DrvZoomRAM[3], 0x91c000, 0x91c3ff, MAP_RAM); // + 0x200 - SekMapMemory(DrvVidReg[3], 0x91d000, 0x91d3ff, MAP_RAM); // 0-b - SekMapMemory(DrvPalRAM, 0xa00000, 0xa03fff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0xf00000, 0xf1ffff, MAP_RAM); - SekSetWriteLongHandler(0, macrossp_main_write_long); - SekSetWriteWordHandler(0, macrossp_main_write_word); - SekSetWriteByteHandler(0, macrossp_main_write_byte); - SekSetReadLongHandler(0, macrossp_main_read_long); - SekSetReadWordHandler(0, macrossp_main_read_word); - SekSetReadByteHandler(0, macrossp_main_read_byte); - - SekMapHandler(1, 0x900000, 0x903fff, MAP_WRITE); - SekSetWriteLongHandler(1, macrossp_vidram_write_long); - SekSetWriteWordHandler(1, macrossp_vidram_write_word); - SekSetWriteByteHandler(1, macrossp_vidram_write_byte); - - SekMapHandler(2, 0x908000, 0x90bfff, MAP_WRITE); - SekSetWriteLongHandler(2, macrossp_vidram_write_long); - SekSetWriteWordHandler(2, macrossp_vidram_write_word); - SekSetWriteByteHandler(2, macrossp_vidram_write_byte); - - SekMapHandler(3, 0x910000, 0x913fff, MAP_WRITE); - SekSetWriteLongHandler(3, macrossp_vidram_write_long); - SekSetWriteWordHandler(3, macrossp_vidram_write_word); - SekSetWriteByteHandler(3, macrossp_vidram_write_byte); - - SekMapHandler(4, 0xa00000, 0xa03fff, MAP_WRITE); - SekSetWriteLongHandler(4, macrossp_palette_write_long); - SekSetWriteWordHandler(4, macrossp_palette_write_word); - SekSetWriteByteHandler(4, macrossp_palette_write_byte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Drv68KROM1, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM1, 0x200000, 0x207fff, MAP_RAM); - SekSetWriteWordHandler(0, macrossp_sound_write_word); - SekSetWriteByteHandler(0, macrossp_sound_write_byte); - SekSetReadWordHandler(0, macrossp_sound_read_word); - SekSetReadByteHandler(0, macrossp_sound_read_byte); - SekClose(); - - ES5506Init(16000000, DrvSndROM0, DrvSndROM0 + 0x400000, DrvSndROM2, DrvSndROM2 + 0x400000, NULL); - ES5506SetRoute(0, 0.00, BURN_SND_ES5506_ROUTE_BOTH); // start at 0 because loud BRRRRPPPP! at reset. - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, text_map_callback, 16, 16, 64, 64); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, scra_map_callback, 16, 16, 64, 64); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, scrb_map_callback, 16, 16, 64, 64); - GenericTilemapInit(3, TILEMAP_SCAN_ROWS, scrc_map_callback, 16, 16, 64, 64); - GenericTilemapSetGfx(1, DrvGfxROM1, 6, 16, 16, 0x800000, 0x800, 0x1f); // actually 8bpp, not 6pp! this is fine! - GenericTilemapSetGfx(2, DrvGfxROM2, 6, 16, 16, 0x800000, 0x800, 0x1f); // actually 8bpp, not 6pp! this is fine! - GenericTilemapSetGfx(3, DrvGfxROM3, 6, 16, 16, 0x800000, 0x800, 0x1f); // actually 8bpp, not 6pp! this is fine! - GenericTilemapSetGfx(4, DrvGfxROM4, 4, 16, 16, 0x100000, 0x800, 0x7f); - GenericTilemapSetTransparent(0, 0); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetTransparent(2, 0); - GenericTilemapSetTransparent(3, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - - ES5506Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void palette_update() -{ - UINT32 *p = (UINT32*)DrvPalRAM; - - for (INT32 i = 0; i < 0x4000/4; i++) - { - UINT8 r = p[i] >> 8; - UINT8 g = p[i] >> 0; - UINT8 b = p[i] >> 24; - - r = (r * palette_fade) / 255; - g = (g * palette_fade) / 255; - b = (b * palette_fade) / 255; - - Palette[i] = (r * 0x10000) + (g * 0x100) + b; - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void tilemap_update(INT32 map) -{ - if (dirty_layer[map] == 0) return; - - dirty_layer[map] = 0; - - UINT32 *ram = (UINT32*)DrvVidRAM[map]; - - UINT8 *gfxbase[3] = { DrvGfxROM1, DrvGfxROM2, DrvGfxROM3 }; - - INT32 fliptab[4] = { 0, 0x0f, 0xf0, 0xff }; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - if (dirty_tiles[map][offs] == 0) continue; - dirty_tiles[map][offs] = 0; - - INT32 sx = (offs & 0x3f) * 16; - INT32 sy = (offs / 0x40) * 16; - - UINT16 attr = ram[offs]; - UINT16 code = (ram[offs] >> 16) & 0x7fff; - - INT32 color; - if (color_mask[map] == 7) - color = (attr << 1) & 0x1c; - else - color = (attr >> 1) & 0x1f; - - color = (color * 0x40) + 0x800; - UINT8 *gfx = gfxbase[map] + (code * 0x100); - UINT16 *dst = tilemaps[map] + (sy * 0x400) + sx; - - INT32 flip = fliptab[(attr >> 14) & 3]; - - for (INT32 y = 0; y < 16; y++) - { - for (INT32 x = 0; x < 16; x++) - { - INT32 pxl = gfx[((y*16)+x)^flip]; - - dst[x] = pxl + color; - if (pxl == 0) dst[x] |= 0x8000; - } - - dst += 0x400; - } - } -} - -static void draw_roz(UINT16 *sbitmap, INT32 sy, UINT32 startx, UINT32 starty, INT32 incxx, INT32 incyy, INT32 priority) -{ - starty += sy * incyy; - UINT32 cx = startx; - - UINT16 *src = sbitmap + ((starty >> 16) & 0x3ff) * 0x400; - UINT8 *pri = pPrioDraw + (sy * nScreenWidth); - UINT16 *dest = pTransDraw + (sy * nScreenWidth); - - INT32 x = 0; - - while (x < nScreenWidth) - { - if ((src[(cx >> 16) & 0x3ff] & 0x8000) == 0) - { - *dest = src[(cx >> 16) & 0x3ff]; - *pri = priority; - } - - cx += incxx; - x++; - ++dest; - pri++; - } -} - -static void draw_layer(INT32 layer, INT32 pri) -{ - UINT32 *reg = (UINT32*)DrvVidReg[layer]; - - if ((reg[2] & 0xf000) == 0xe000) - { - UINT16 *map = (UINT16*)tilemaps[layer]; - UINT32 *lz = (UINT32*)(DrvZoomRAM[layer] + 0x200); - - tilemap_update(layer); - - INT32 startx = (reg[0] & 0x3ff0000); - INT32 starty = (reg[0] & 0x00003ff) << 16; - INT32 incy = (reg[2] & 0x00001ff) << 10; - INT32 sy = starty - (240/2) * (incy - 0x10000); - - for (INT32 line = 0; line < 240; line++) - { - UINT32 incx; - - if (line & 1) - incx = (lz[line/2] & 0xffff0000)>>6; - else - incx = (lz[line/2] & 0x0000ffff)<<10; - - INT32 sx = startx - (368/2) * (incx - 0x10000); - - draw_roz(map, line, sx, sy, incx, incy, 1 << pri); - } - } - else - { - GenericTilemapSetScrollX(layer+1, reg[0] >> 16); - GenericTilemapSetScrollY(layer+1, reg[0] & 0xffff); - - if (nBurnLayer & (1 << (layer+1))) GenericTilemapDraw(layer+1, pTransDraw, 1 << pri); - } -} - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s) -{ - return (((((s & 0xff00ff) * 127) + ((d & 0xff00ff) * 128)) & 0xff00ff00) + ((((s & 0xff00) * 127) + ((d & 0xff00) * 128)) & 0xff0000)) / 0x100; -} - -static void render_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, INT32 priority, INT32 alpha) -{ - if (DrvTransTab[0][code & 0xffff]) - return; - - UINT8 *dest = pBurnDraw; - UINT16 *bg = pTransDraw; - UINT8 *gfx = DrvGfxROM0; - - // Based on MAME sources for tile zooming - UINT8 *gfx_base = gfx + (code * width * height); - int dh = (zoomy * height + 0x8000) / 0x10000; - int dw = (zoomx * width + 0x8000) / 0x10000; - - priority |= 1 << 31; - - if (dw && dh) - { - int dx = (width * 0x10000) / dw; - int dy = (height * 0x10000) / dh; - int ex = sx + dw; - int ey = sy + dh; - int x_index_base = 0; - int y_index = 0; - - if (fx) { - x_index_base = (dw - 1) * dx; - dx = -dx; - } - - if (fy) { - y_index = (dh - 1) * dy; - dy = -dy; - } - - for (INT32 y = sy; y < ey; y++) - { - UINT8 *src = gfx_base + (y_index / 0x10000) * width; - UINT8 *dst = dest + (y * nScreenWidth * nBurnBpp); - UINT16 *bgs = bg + y * nScreenWidth; - UINT8 *pri = pPrioDraw + y * nScreenWidth; - - if (y >= 0 && y < nScreenHeight) - { - for (INT32 x = sx, x_index = x_index_base; x < ex; x++) - { - if (x >= 0 && x < nScreenWidth) { - INT32 pxl = src[x_index>>16]; - - if (pxl) { - if (alpha == 0x80) { - if ((priority & (1 << pri[x])) == 0) { - UINT32 pixel = alpha_blend(Palette[bgs[x]], Palette[pxl + color]); - PutPix(dst + x * nBurnBpp, BurnHighCol(pixel/0x10000, pixel/0x100, pixel, 0)); - } - pri[x] = 0x1f; - } else { - if ((priority & (1 << pri[x])) == 0) { - PutPix(dst + x * nBurnBpp, DrvPalette[pxl + color]); - } - pri[x] = 0x1f; - } - } - } - - x_index += dx; - } - } - - y_index += dy; - } - } -} - -static void draw_sprites() -{ - UINT32 *spriteram = (UINT32*)DrvSprBuf[1]; - UINT32 *source = (spriteram + (0x3000/4)) - 3; /* buffered two frames */ - UINT32 *finish = spriteram; - - while (source >= finish) - { - INT32 wide = (source[0] >> 26) & 0xf; - INT32 high = (source[0] >> 10) & 0xf; - INT32 xpos = (source[0] >> 16) & 0x3ff; - INT32 ypos = (source[0] >> 0) & 0x3ff; - INT32 xzoom = (source[1] >> 16) & 0x3ff; - INT32 yzoom = (source[1] >> 0) & 0x3ff; - - int col; - INT32 tileno = (source[2] >> 16); - INT32 flipx = (source[2] >> 14) & 1; - INT32 flipy = (source[2] >> 15) & 1; - INT32 alpha = (source[2] & 0x2000) ? 0x80 : 0xff; - int loopno = 0; - int xcnt, ycnt; - int xoffset, yoffset; - INT32 pri = (source[2] >> 10) & 3; - int primask = 0; - if(pri <= 0) primask |= 0xaaaa; - if(pri <= 1) primask |= 0xcccc; - if(pri <= 2) primask |= 0xf0f0; - if(pri <= 3) primask |= 0xff00; - - switch (source[0] & 0xc0000000) - { - case 0x80000000: - col = (source[2] & 0x38) >> 1; - break; - - case 0x40000000: - col = (source[2] & 0xf8) >> 3; - break; - - default: - col = rand(); - break; - } - - if (xpos > 0x1ff) xpos -=0x400; - if (ypos > 0x1ff) ypos -=0x400; - - /* loop params */ - int ymin = 0; - int ymax = high+1; - int yinc = 1; - int yoffst = 0; - if(flipy) { - yoffst = (high * yzoom * 16); - ymin = high; - ymax = -1; - yinc = -1; - } - - int xmin = 0; - int xmax = wide+1; - int xinc = 1; - int xoffst = 0; - if(flipx) { - xoffst = (wide * xzoom * 16); - xmin = wide; - xmax = -1; - xinc = -1; - } - - yoffset = yoffst; - for (ycnt = ymin; ycnt != ymax; ycnt += yinc) - { - xoffset = xoffst; - for (xcnt = xmin; xcnt != xmax; xcnt += xinc) - { - int fudged_xzoom = xzoom<<8; - int fudged_yzoom = yzoom<<8; - - if(xzoom < 0x100) fudged_xzoom += 0x600; - if(yzoom < 0x100) fudged_yzoom += 0x600; - - render_sprite(tileno+loopno, col<<6, xpos+(xoffset>>8), ypos+(yoffset>>8), flipx, flipy, 16, 16, fudged_xzoom, fudged_yzoom, primask, alpha); - - xoffset += ((xzoom*16) * xinc); - loopno++; - } - yoffset += ((yzoom*16) * yinc); - } - - source -= 3; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - palette_update(); - DrvRecalc = 0; - } - - UINT32 reg[3] = { *((UINT32*)DrvVidReg[0]), *((UINT32*)DrvVidReg[1]), *((UINT32*)DrvVidReg[2]) }; - - UINT32 layerpri[3] = { (reg[0] >> 30) & 3, (reg[1] >> 30) & 3, (reg[2] >> 30) & 3 }; - - INT32 pcmask[3]; - - pcmask[0] = color_mask[0]; - pcmask[1] = color_mask[1]; - pcmask[2] = color_mask[2]; - - color_mask[0] = (reg[0] & 0x8000000) ? 0x7 : 0x1f; - color_mask[1] = (reg[1] & 0x8000000) ? 0x7 : 0x1f; - color_mask[2] = (reg[2] & 0x8000000) ? 0x7 : 0x1f; - - for (INT32 i = 0; i < 3; i++) { - if (color_mask[i] != pcmask[i]) { - memset (dirty_tiles[i], 1, 64*64); - dirty_layer[i] = 1; - } - } - - BurnTransferClear(); - - for (INT32 pri = 0; pri <= 3; pri++) - { - for (INT32 layer = 2; layer >= 0; layer--) - { - if (layerpri[layer] == (UINT32)pri) - { - draw_layer(layer, pri); - } - } - } - - if (nSpriteEnable & 2) GenericTilemapDraw(0, pTransDraw, 8); - - BurnTransferCopy(DrvPalette); - - if (nSpriteEnable & 1) draw_sprites(); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT32)); - for (INT32 i = 0; i < 32; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 262; - INT32 nCyclesTotal[2] = { 25000000 / 60, 16000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - SekOpen(0); - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - if (i == 240) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - SekClose(); - - SekOpen(1); - nCyclesDone[1] += SekRun(nCyclesTotal[1] / nInterleave); - SekClose(); - } - - if (pBurnSoundOut) { - if (volume_mute) volume_mute--; - if (volume_mute == 1) { - ES5506SetRoute(0, 3.00, BURN_SND_ES5506_ROUTE_BOTH); - } - ES5506Update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf[1], DrvSprBuf[0], 0x3000); - memcpy (DrvSprBuf[0], DrvSprRAM, 0x3000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029682; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - ES5506Scan(nAction, pnMin); - - SCAN_VAR(palette_fade); - SCAN_VAR(soundlatch); - SCAN_VAR(sound_pending); - SCAN_VAR(sound_toggle); - } - - if (nAction & ACB_WRITE) { - dirty_layer[0] = 1; - dirty_layer[1] = 1; - dirty_layer[2] = 1; - memset (dirty_tiles[0], 1, 64*64); - memset (dirty_tiles[1], 1, 64*64); - memset (dirty_tiles[1], 1, 64*64); - DrvRecalc = 1; - } - - return 0; -} - -// Macross Plus - -static struct BurnRomInfo macrosspRomDesc[] = { - { "bp964a-c.u1", 0x080000, 0x39da35e7, 1 | BRF_PRG | BRF_ESS }, // 0 68ec20 code - { "bp964a-c.u2", 0x080000, 0x86d0ca6a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "bp964a-c.u3", 0x080000, 0xfb895a7b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "bp964a-c.u4", 0x080000, 0x8c8b966c, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "bp964a.u20", 0x080000, 0x12960cbb, 2 | BRF_PRG | BRF_ESS }, // 4 68k code - { "bp964a.u21", 0x080000, 0x87bdd2fc, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "bp964a.u49", 0x020000, 0xad203f76, 3 | BRF_OPT }, // 6 Bios? code - - { "bp964a.u9", 0x400000, 0xbd51a70d, 4 | BRF_GRA }, // 7 Sprites - { "bp964a.u10", 0x400000, 0xab84bba7, 4 | BRF_GRA }, // 8 - { "bp964a.u11", 0x400000, 0xb9ae1d0b, 4 | BRF_GRA }, // 9 - { "bp964a.u12", 0x400000, 0x8dda1052, 4 | BRF_GRA }, // 10 - - { "bp964a.u13", 0x400000, 0xf4d3c5bf, 5 | BRF_GRA }, // 11 Layer 'A' tiles - { "bp964a.u14", 0x400000, 0x4f2dd1b2, 5 | BRF_GRA }, // 12 - - { "bp964a.u15", 0x400000, 0x5b97a870, 6 | BRF_GRA }, // 13 Layer 'B' tiles - { "bp964a.u16", 0x400000, 0xc8a0cd64, 6 | BRF_GRA }, // 14 - - { "bp964a.u17", 0x400000, 0xf2470876, 7 | BRF_GRA }, // 15 Layer 'C' tiles - { "bp964a.u18", 0x400000, 0x52ef21f3, 7 | BRF_GRA }, // 16 - - { "bp964a.u19", 0x080000, 0x19c7acd9, 8 | BRF_GRA }, // 17 Text tiles - - { "bp964a.u24", 0x400000, 0x93f90336, 9 | BRF_SND }, // 18 Ensoniq samples, bank 0 - - { "u8.u8", 0x000117, 0x99bd3cc1, 0 | BRF_OPT }, // 19 Unused plds - { "u9.u9", 0x000117, 0x480f4860, 0 | BRF_OPT }, // 20 - { "u200.u200", 0x000117, 0x9343ad76, 0 | BRF_OPT }, // 21 -}; - -STD_ROM_PICK(macrossp) -STD_ROM_FN(macrossp) - -static INT32 macrosspInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvMacrossp = { - "macrossp", NULL, NULL, NULL, "1996", - "Macross Plus\0", NULL, "MOSS / Banpresto", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, macrosspRomInfo, macrosspRomName, NULL, NULL, MacrosspInputInfo, MacrosspDIPInfo, - macrosspInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 240, 384, 3, 4 -}; - - -// Quiz Bisyoujo Senshi Sailor Moon - Chiryoku Tairyoku Toki no Un - -static struct BurnRomInfo quizmoonRomDesc[] = { - { "u1.bin", 0x020000, 0xea404553, 1 | BRF_PRG | BRF_ESS }, // 0 68ec20 code - { "u2.bin", 0x020000, 0x024eedff, 1 | BRF_PRG | BRF_ESS }, // 1 - { "u3.bin", 0x020000, 0x545b1d17, 1 | BRF_PRG | BRF_ESS }, // 2 - { "u4.bin", 0x020000, 0x60b3d18c, 1 | BRF_PRG | BRF_ESS }, // 3 - { "u5.bin", 0x080000, 0x4cc65f5e, 1 | BRF_PRG | BRF_ESS }, // 4 - { "u6.bin", 0x080000, 0xd84b7c6c, 1 | BRF_PRG | BRF_ESS }, // 5 - { "u7.bin", 0x080000, 0x656b2125, 1 | BRF_PRG | BRF_ESS }, // 6 - { "u8.bin", 0x080000, 0x944df309, 1 | BRF_PRG | BRF_ESS }, // 7 - - { "u20.bin", 0x020000, 0xd7ad1ffb, 2 | BRF_PRG | BRF_ESS }, // 8 68k code - { "u21.bin", 0x020000, 0x6fc625c6, 2 | BRF_PRG | BRF_ESS }, // 9 - - { "u49.bin", 0x020000, 0x1590ad81, 3 | BRF_GRA }, // 10 Bios? code - - { "u9.bin", 0x400000, 0xaaaf2ca9, 4 | BRF_GRA }, // 11 Sprites - { "u10.bin", 0x400000, 0xf0349691, 4 | BRF_GRA }, // 12 - { "u11.bin", 0x400000, 0x893ab178, 4 | BRF_GRA }, // 13 - { "u12.bin", 0x400000, 0x39b731b8, 4 | BRF_GRA }, // 14 - - { "u13.bin", 0x400000, 0x3dcbb041, 5 | BRF_GRA }, // 15 Layer 'A' tiles - - { "u15.bin", 0x400000, 0xb84224f0, 6 | BRF_GRA }, // 16 Layer 'B' tiles - - { "u17.bin", 0x200000, 0xff93c949, 7 | BRF_GRA }, // 17 Layer 'C' tiles - - { "u26.bin", 0x400000, 0x6c8f30d4, 8 | BRF_SND }, // 18 Ensoniq samples, bank 0 - { "u24.bin", 0x400000, 0x5b12d0b1, 8 | BRF_SND }, // 19 - - { "u27.bin", 0x400000, 0xbd75d165, 9 | BRF_SND }, // 20 Ensoniq samples, bank 2 - { "u25.bin", 0x400000, 0x3b9689bc, 9 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(quizmoon) -STD_ROM_FN(quizmoon) - -static INT32 quizmoonInit() -{ - return DrvInit(1); -} - -struct BurnDriverD BurnDrvQuizmoon = { - "quizmoon", NULL, NULL, NULL, "1997", - "Quiz Bisyoujo Senshi Sailor Moon - Chiryoku Tairyoku Toki no Un\0", NULL, "Banpresto", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, quizmoonRomInfo, quizmoonRomName, NULL, NULL, MacrosspInputInfo, MacrosspDIPInfo, //QuizmoonInputInfo, QuizmoonDIPInfo, - quizmoonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 384, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_mcatadv.cpp b/jan/src/burn/drv/pst90s/d_mcatadv.cpp deleted file mode 100644 index 82eb4e16e..000000000 --- a/jan/src/burn/drv/pst90s/d_mcatadv.cpp +++ /dev/null @@ -1,1208 +0,0 @@ -// FB Alpha Face "LINDA" hardware driver module -// Based on MAME driver by Paul Priest and David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2610.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPalRAM; -static UINT32 *DrvPalette; - -static UINT8 *DrvPrioBitmap; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[ 2]; -static UINT16 DrvInputs[2]; -static UINT8 DrvReset; - -static UINT16 *DrvScrollRAM0; -static UINT16 *DrvScrollRAM1; -static UINT16 *DrvVidRegs; -static UINT16 *DrvVidRegBuf; - -static UINT8 *nDrvZ80Bank; -static UINT8 *soundlatch; -static UINT8 *soundlatch2; - -static INT32 nCyclesTotal[2]; -static INT32 nCyclesDone[2]; -static INT32 watchdog; - -static INT32 nGame; - -static struct BurnInputInfo McatadvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Mcatadv) - -static struct BurnDIPInfo McatadvDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x13, 0x01, 0x02, 0x02, "Off" }, -// {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "Mode 1" }, - {0x13, 0x01, 0x08, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 7, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits " }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits " }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits " }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits " }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits " }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits " }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 4 Credits " }, - - {0 , 0xfe, 0 , 7, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "4 Coins 1 Credits " }, - {0x13, 0x01, 0xc0, 0x40, "3 Coins 1 Credits " }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits " }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits " }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits " }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits " }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits " }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x0c, 0x04, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Energy" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "8" }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x14, 0x01, 0xc0, 0x40, "Upright 1 Player" }, - {0x14, 0x01, 0xc0, 0xc0, "Upright 2 Players" }, - {0x14, 0x01, 0xc0, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Mcatadv) - -static struct BurnInputInfo NostInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 9, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Nost) - -static struct BurnDIPInfo NostDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x03, 0x02, "2" }, - {0x10, 0x01, 0x03, 0x03, "3" }, - {0x10, 0x01, 0x03, 0x01, "4" }, - {0x10, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x0c, 0x08, "Easy" }, - {0x10, 0x01, 0x0c, 0x0c, "Normal" }, - {0x10, 0x01, 0x0c, 0x04, "Hard" }, - {0x10, 0x01, 0x0c, 0x00, "Hardest" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x10, 0x01, 0x10, 0x10, "Off" }, -// {0x10, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x20, 0x00, "Off" }, - {0x10, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0xc0, 0x80, "500k 1000k" }, - {0x10, 0x01, 0xc0, 0xc0, "800k 1500k" }, - {0x10, 0x01, 0xc0, 0x40, "1000k 2000k" }, - {0x10, 0x01, 0xc0, 0x00, "None" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits " }, - {0x11, 0x01, 0x07, 0x04, "2 Coins 1 Credits " }, - {0x11, 0x01, 0x07, 0x01, "3 Coins 2 Credits " }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 3 Credits " }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits " }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits " }, - {0x11, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin_B" }, - {0x11, 0x01, 0x38, 0x00, "4 Coins 1 Credits " }, - {0x11, 0x01, 0x38, 0x10, "3 Coins 1 Credits " }, - {0x11, 0x01, 0x38, 0x20, "2 Coins 1 Credits " }, - {0x11, 0x01, 0x38, 0x08, "3 Coins 2 Credits " }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits " }, - {0x11, 0x01, 0x38, 0x18, "2 Coins 3 Credits " }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits " }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits " }, -}; - -STDDIPINFO(Nost) - -static inline void mcatadv_z80_sync() -{ -#if 0 - float nCycles = SekTotalCycles() * 1.0000; - nCycles /= nCyclesTotal[0]; - nCycles *= nCyclesTotal[1]; - nCycles -= nCyclesDone[1]; - if (nCycles > 0) { - nCyclesDone[1] += ZetRun((INT32)nCycles); - } -#endif -} - -static inline void palette_write(INT32 offset) -{ - UINT8 r,g,b; - UINT16 data = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + offset))); - - r = (data >> 5) & 0x1f; - r = (r << 3) | (r >> 2); - - g = (data >> 10) & 0x1f; - g = (g << 3) | (g >> 2); - - b = (data >> 0) & 0x1f; - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -void __fastcall mcatadv_write_byte(UINT32 /*address*/, UINT8 /*data*/) -{ - -} - -void __fastcall mcatadv_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x200000: - case 0x200002: - case 0x200004: - DrvScrollRAM0[(address & 6) >> 1] = data; - return; - - case 0x300000: - case 0x300002: - case 0x300004: - DrvScrollRAM1[(address & 6) >> 1] = data; - return; - - case 0xb00000: - case 0xb00002: - case 0xb00004: - case 0xb00006: - case 0xb00008: - case 0xb0000a: - case 0xb0000c: - case 0xb0000e: - DrvVidRegs[(address & 0x0e) >> 1] = data; - return; - - case 0xb00018: - watchdog = 0; - return; - - case 0xc00000: - { - mcatadv_z80_sync(); - - *soundlatch = data; - ZetNmi(); - } - return; - } -} - -UINT8 __fastcall mcatadv_read_byte(UINT32 address) -{ - switch (address) - { - case 0x800000: - return DrvInputs[0] >> 8; - - case 0x800001: - return DrvInputs[0] & 0xff; - - case 0x800002: - return DrvInputs[1] >> 8; - - case 0x800003: - return DrvInputs[1] & 0xff; - } - - return 0; -} - -UINT16 __fastcall mcatadv_read_word(UINT32 address) -{ - switch (address) - { - case 0x800000: - return DrvInputs[0]; - - case 0x800002: - return DrvInputs[1]; - - case 0xa00000: - return (DrvDips[0] << 8) | 0x00ff; - - case 0xa00002: - return (DrvDips[1] << 8) | 0x00ff; - - case 0xb0001e: - watchdog = 0; - return 0x0c00; - - case 0xc00000: - mcatadv_z80_sync(); - return *soundlatch2; - } - - return 0; -} - -static void sound_bankswitch(INT32 data) -{ - *nDrvZ80Bank = data; - - ZetMapArea(0x4000 << nGame, 0xbfff, 0, DrvZ80ROM + (data * 0x4000)); - ZetMapArea(0x4000 << nGame, 0xbfff, 2, DrvZ80ROM + (data * 0x4000)); -} - -void __fastcall mcatadv_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - BurnYM2610Write(address & 3, data); - return; - - case 0xf000: - sound_bankswitch(data); - return; - } -} - -UINT8 __fastcall mcatadv_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - case 0xe002: - return BurnYM2610Read(address & 2); - } - - return 0; -} - -void __fastcall mcatadv_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - BurnYM2610Write(port & 3, data); - return; - - case 0x40: - sound_bankswitch(data); - return; - - case 0x80: - *soundlatch2 = data; - return; - } -} - -UINT8 __fastcall mcatadv_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x04: - case 0x05: - case 0x06: - case 0x07: - return BurnYM2610Read(port & 3); - - case 0x80: - return *soundlatch; - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -static INT32 DrvGfxDecode() -{ - static INT32 Planes[4] = { 0, 1, 2, 3 }; - static INT32 XOffs[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 256, 260, 264, 268, 272, 276, 280, 284 }; - static INT32 YOffs[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x280000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM1, 0x180000); - - GfxDecode(0x3000, 4, 16, 16, Planes, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x280000); - - GfxDecode(0x5000, 4, 16, 16, Planes, XOffs, YOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x040000; - - DrvGfxROM0 = Next; Next += 0x600000; - DrvGfxROM1 = Next; Next += 0x300000; - DrvGfxROM2 = Next; Next += 0x500000; - - DrvSndROM = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x1001 * sizeof(UINT32); - - DrvPrioBitmap = Next; Next += 320 * 224; - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvZ80RAM = Next; Next += 0x002000; - - DrvVidRAM0 = Next; Next += 0x002000; - DrvVidRAM1 = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x003000; - DrvSprRAM = Next; Next += 0x010000; - DrvSprBuf = Next; Next += 0x008000; - - DrvScrollRAM0 = (UINT16*)Next; Next += 0x000004 * sizeof(UINT16); - DrvScrollRAM1 = (UINT16*)Next; Next += 0x000004 * sizeof(UINT16); - DrvVidRegs = (UINT16*)Next; Next += 0x000008 * sizeof(UINT16); - DrvVidRegBuf = (UINT16*)Next; Next += 0x000008 * sizeof(UINT16); - - nDrvZ80Bank = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - sound_bankswitch(1); - ZetClose(); - - BurnYM2610Reset(); - - watchdog = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400001, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 13, 1)) return 1; - - if (DrvZ80ROM[0x20000]) // Nostradamus - { - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 12, 1)) return 1; - - nGame = 1; - } - else - { - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 12, 1)) return 1; - - nGame = 0; - } - } - - DrvGfxDecode(); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x500000, 0x501fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x600000, 0x602fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x700000, 0x70ffff, MAP_RAM); - SekSetWriteByteHandler(0, mcatadv_write_byte); - SekSetWriteWordHandler(0, mcatadv_write_word); - SekSetReadByteHandler(0, mcatadv_read_byte); - SekSetReadWordHandler(0, mcatadv_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xdfff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xdfff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xdfff, 2, DrvZ80RAM); - ZetSetWriteHandler(mcatadv_sound_write); - ZetSetReadHandler(mcatadv_sound_read); - ZetSetInHandler(mcatadv_sound_in); - ZetSetOutHandler(mcatadv_sound_out); - ZetClose(); - - INT32 DrvSndROMLen = nGame ? 0x100000 : 0x80000; - BurnYM2610Init(8000000, DrvSndROM, &DrvSndROMLen, DrvSndROM, &DrvSndROMLen, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 2.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 2.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.28, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - BurnYM2610Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - UINT16 *finish = (UINT16*)DrvSprBuf; - UINT16 *source = finish + 0x2000-4; - UINT16 *vidregram = DrvVidRegs; - UINT16 *vidregbuf = DrvVidRegBuf; - UINT8 *prio = DrvPrioBitmap; - INT32 global_x = vidregram[0]-0x184; - INT32 global_y = vidregram[1]-0x1f1; - - UINT16 *destline; - - INT32 xstart, xend, xinc; - INT32 ystart, yend, yinc; - - if (BURN_ENDIAN_SWAP_INT16(vidregbuf[2]) == 0x0001) - { - source += 0x2000; - finish += 0x2000; - } - - while (source >= finish) - { - INT32 attr = BURN_ENDIAN_SWAP_INT16(source[0]); - INT32 pri = attr >> 14; - - pri |= 0x8; - - INT32 pen = (attr & 0x3f00) >> 4; - INT32 tileno = BURN_ENDIAN_SWAP_INT16(source[1]); - INT32 x = BURN_ENDIAN_SWAP_INT16(source[2]) & 0x03ff; - INT32 y = BURN_ENDIAN_SWAP_INT16(source[3]) & 0x03ff; - INT32 flipy = attr & 0x0040; - INT32 flipx = attr & 0x0080; - - INT32 height = (BURN_ENDIAN_SWAP_INT16(source[3]) & 0xf000) >> 8; - INT32 width = (BURN_ENDIAN_SWAP_INT16(source[2]) & 0xf000) >> 8; - INT32 offset = tileno << 8; - - UINT8 *sprdata = DrvGfxROM0; - - INT32 drawxpos, drawypos; - INT32 xcnt,ycnt; - INT32 pix; - - if (x & 0x200) x-=0x400; - if (y & 0x200) y-=0x400; - - if (BURN_ENDIAN_SWAP_INT16(source[3]) != BURN_ENDIAN_SWAP_INT16(source[0])) - { - if(!flipx) { xstart = 0; xend = width; xinc = 1; } - else { xstart = width-1; xend = -1; xinc = -1; } - if(!flipy) { ystart = 0; yend = height; yinc = 1; } - else { ystart = height-1; yend = -1; yinc = -1; } - - for (ycnt = ystart; ycnt != yend; ycnt += yinc) { - drawypos = y+ycnt-global_y; - - if ((drawypos >= 0) && (drawypos < 224)) { - destline = pTransDraw + drawypos * 320; - prio = DrvPrioBitmap + drawypos * 320; - - for (xcnt = xstart; xcnt != xend; xcnt += xinc) { - drawxpos = x+xcnt-global_x; - - if (drawxpos >= 0 && drawxpos < 320) { - if (!(prio[drawxpos] & 0x10)) { // if we haven't already drawn a sprite pixel here (sprite masking) - - if (offset >= 0xa00000) offset = 0; - pix = sprdata[offset >> 1]; - - if (offset & 1) pix >>= 4; - pix &= 0x0f; - - if (pix && drawxpos >= 0 && drawxpos < 320) { - if ((prio[drawxpos] < pri)) - destline[drawxpos] = pix | pen; - - prio[drawxpos] |= 0x10; - } - } - } - - offset++; - } - } else { - offset += width; - } - } - } - source-=4; - } - - return; -} - -static void draw_background(UINT8 *vidramsrc, UINT8 *gfxbase, UINT16 *scroll, INT32 priority, INT32 max_tile) -{ - UINT16 *vidram = (UINT16*)vidramsrc; - UINT16 *dest = pTransDraw; - UINT8 *prio = DrvPrioBitmap; - - INT32 yscroll = ((scroll[1] & 0x1ff) - 0x1df) & 0x1ff; - INT32 xscroll = ((scroll[0] & 0x1ff) - 0x194) & 0x1ff; - - if (~scroll[1] & 0x4000 && ~scroll[0] & 0x4000) { // row by row - yscroll &= 0x1ff; - xscroll &= 0x1ff; - - for (INT32 y = 0; y < 239; y+=16) - { - for (INT32 x = 0; x < 335; x+=16) - { - INT32 sy = y - (yscroll & 0x0f); - INT32 sx = x - (xscroll & 0x0f); - if (sy < -15 || sx < -15 || sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 offs = (((yscroll+y)&0x1f0) << 2) | (((xscroll+x)&0x1f0)>>3); - INT32 pri = BURN_ENDIAN_SWAP_INT16(vidram[offs]) >> 14; - pri |= 0x8; - if (pri != priority) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vidram[offs | 1]); - if (!code || code >= max_tile) continue; - INT32 color = ((BURN_ENDIAN_SWAP_INT16(vidram[offs]) >> 8) & 0x3f) | ((scroll[2] & 3) << 6); - - { - color <<= 4; - - UINT8 *gfx = gfxbase + code * 0x100; - - for (INT32 vy = 0; vy < 16; vy++, sy++, gfx+=16) { - if (sy < 0) continue; - if (sy >= nScreenHeight) break; - - dest = pTransDraw + nScreenWidth * sy; - prio = DrvPrioBitmap + nScreenWidth * sy; - - for (INT32 vx = 0; vx < 16; vx++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[vx]; - - if (pxl) { - dest[sx] = pxl | color; - prio[sx] = priority; - } - } - - sx -= 16; - } - } - - //Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, gfxbase); - } - } - - return; - } - - for (INT32 y = 0; y < 224; y++, dest += 320, prio += 320) // line by line - { - INT32 scrollx = xscroll; - INT32 scrolly = (yscroll + y) & 0x1ff; - - if (scroll[1] & 0x4000) scrolly = BURN_ENDIAN_SWAP_INT16(vidram[0x0800 + (scrolly * 2) + 1]) & 0x1ff; - if (scroll[0] & 0x4000) scrollx += BURN_ENDIAN_SWAP_INT16(vidram[0x0800 + (scrolly * 2) + 0]); - - INT32 srcy = (scrolly & 0x1ff) >> 4; - INT32 srcx = (scrollx & 0x1ff) >> 4; - - for (INT32 x = 0; x < 336; x+=16) - { - INT32 offs = ((srcy << 5) | ((srcx + (x >> 4)) & 0x1f)) << 1; - INT32 pri = BURN_ENDIAN_SWAP_INT16(vidram[offs]) >> 14; - pri |= 0x8; - if (pri != priority) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vidram[offs | 1]); - if (!code || code >= max_tile) continue; - - INT32 color = ((BURN_ENDIAN_SWAP_INT16(vidram[offs]) >> 4) & 0x3f0) | ((scroll[2] & 3) << 10); - - UINT8 *gfxsrc = gfxbase + (code << 8) + ((scrolly & 0x0f) << 4); - - for (INT32 dx = 0; dx < 16; dx++) - { - INT32 dst = (x + dx) - (scrollx & 0x0f); - if (dst < 0 || dst >= nScreenWidth) continue; - - if (gfxsrc[dx]) { - dest[dst] = color | gfxsrc[dx]; - prio[dst] = priority; - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x2000; i+=2) { - palette_write(i); - } - DrvPalette[0x1000] = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x3f0; - DrvPrioBitmap[i] = 0; - } - - for (INT32 i = 0; i < 4; i++) - { - if (!(DrvScrollRAM0[2] & 0x10)) - draw_background(DrvVidRAM0, DrvGfxROM1, DrvScrollRAM0, i|0x8, 0x3000); - if (!(DrvScrollRAM1[2] & 0x10)) - draw_background(DrvVidRAM1, DrvGfxROM2, DrvScrollRAM1, i|0x8, 0x5000); - } - - draw_sprites(); - - memcpy (DrvSprBuf, DrvSprRAM, 0x08000); - memcpy (DrvVidRegBuf, DrvVidRegs, 0x08 * sizeof(UINT16)); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = DrvInputs[1] = 0xffff; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - DrvInputs[0] ^= (nGame << 11); // nostradamus wants bit 11 off - } - - if (nGame == 1) { // Nostradamus 4mhz boost -dink - nCyclesTotal[0] = 20000000 / 60; - } else { - nCyclesTotal[0] = 16000000 / 60; - } - nCyclesTotal[1] = 4000000 / 60; - nCyclesDone[1 ] = 0; - - INT32 nInterleave = 30; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - watchdog++; - if (watchdog == 180) { - SekReset(); - ZetReset(); - watchdog = 0; - } - - for (INT32 i = 0; i < nInterleave; i++) { - SekRun(nCyclesTotal[0] / nInterleave); - BurnTimerUpdate((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - - SCAN_VAR(nCyclesDone[1]); - SCAN_VAR(watchdog); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - sound_bankswitch(*nDrvZ80Bank); - ZetClose(); - } - - return 0; -} - - -// Magical Cat Adventure - -static struct BurnRomInfo mcatadvRomDesc[] = { - { "mca-u30e", 0x080000, 0xc62fbb65, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "mca-u29e", 0x080000, 0xcf21227c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u9.bin", 0x020000, 0xfda05171, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "mca-u82.bin", 0x100000, 0x5f01d746, 3 | BRF_GRA }, // 3 Sprites - { "mca-u83.bin", 0x100000, 0x4e1be5a6, 3 | BRF_GRA }, // 4 - { "mca-u84.bin", 0x080000, 0xdf202790, 3 | BRF_GRA }, // 5 - { "mca-u85.bin", 0x080000, 0xa85771d2, 3 | BRF_GRA }, // 6 - { "mca-u86e", 0x080000, 0x017bf1da, 3 | BRF_GRA }, // 7 - { "mca-u87e", 0x080000, 0xbc9dc9b9, 3 | BRF_GRA }, // 8 - - { "mca-u58.bin", 0x080000, 0x3a8186e2, 4 | BRF_GRA }, // 9 Background Tiles - - { "mca-u60.bin", 0x100000, 0xc8942614, 5 | BRF_GRA }, // 10 Foreground Tiles - { "mca-u61.bin", 0x100000, 0x51af66c9, 5 | BRF_GRA }, // 11 - { "mca-u100", 0x080000, 0xb273f1b0, 5 | BRF_GRA }, // 12 - - { "mca-u53.bin", 0x080000, 0x64c76e05, 6 | BRF_SND }, // 13 YM2610 Samples -}; - -STD_ROM_PICK(mcatadv) -STD_ROM_FN(mcatadv) - -struct BurnDriver BurnDrvMcatadv = { - "mcatadv", NULL, NULL, NULL, "1993", - "Magical Cat Adventure\0", NULL, "Wintechno", "LINDA", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, mcatadvRomInfo, mcatadvRomName, NULL, NULL, McatadvInputInfo, McatadvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1001, - 320, 224, 4, 3 -}; - - -// Magical Cat Adventure (Japan) - -static struct BurnRomInfo mcatadvjRomDesc[] = { - { "u30.bin", 0x080000, 0x05762f42, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "u29.bin", 0x080000, 0x4c59d648, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u9.bin", 0x020000, 0xfda05171, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "mca-u82.bin", 0x100000, 0x5f01d746, 3 | BRF_GRA }, // 3 Sprites - { "mca-u83.bin", 0x100000, 0x4e1be5a6, 3 | BRF_GRA }, // 4 - { "mca-u84.bin", 0x080000, 0xdf202790, 3 | BRF_GRA }, // 5 - { "mca-u85.bin", 0x080000, 0xa85771d2, 3 | BRF_GRA }, // 6 - { "u86.bin", 0x080000, 0x2d3725ed, 3 | BRF_GRA }, // 7 - { "u87.bin", 0x080000, 0x4ddefe08, 3 | BRF_GRA }, // 8 - - { "mca-u58.bin", 0x080000, 0x3a8186e2, 4 | BRF_GRA }, // 9 Background Tiles - - { "mca-u60.bin", 0x100000, 0xc8942614, 5 | BRF_GRA }, // 10 Foreground Tiles - { "mca-u61.bin", 0x100000, 0x51af66c9, 5 | BRF_GRA }, // 11 - { "u100.bin", 0x080000, 0xe2c311da, 5 | BRF_GRA }, // 12 - - { "mca-u53.bin", 0x080000, 0x64c76e05, 6 | BRF_SND }, // 13 YM2610 Samples -}; - -STD_ROM_PICK(mcatadvj) -STD_ROM_FN(mcatadvj) - -struct BurnDriver BurnDrvMcatadvj = { - "mcatadvj", "mcatadv", NULL, NULL, "1993", - "Magical Cat Adventure (Japan)\0", NULL, "Wintechno", "LINDA", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, mcatadvjRomInfo, mcatadvjRomName, NULL, NULL, McatadvInputInfo, McatadvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1001, - 320, 224, 4, 3 -}; - - -// Catt (Japan) - -static struct BurnRomInfo cattRomDesc[] = { - { "catt-u30.bin", 0x080000, 0x8c921e1e, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "catt-u29.bin", 0x080000, 0xe725af6d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u9.bin", 0x020000, 0xfda05171, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "mca-u82.bin", 0x100000, 0x5f01d746, 3 | BRF_GRA }, // 3 Sprites - { "mca-u83.bin", 0x100000, 0x4e1be5a6, 3 | BRF_GRA }, // 4 - { "u84.bin", 0x100000, 0x843fd624, 3 | BRF_GRA }, // 5 - { "u85.bin", 0x100000, 0x5ee7b628, 3 | BRF_GRA }, // 6 - { "mca-u86e", 0x080000, 0x017bf1da, 3 | BRF_GRA }, // 7 - { "mca-u87e", 0x080000, 0xbc9dc9b9, 3 | BRF_GRA }, // 8 - - { "u58.bin", 0x100000, 0x73c9343a, 4 | BRF_GRA }, // 9 Background Tiles - - { "mca-u60.bin", 0x100000, 0xc8942614, 5 | BRF_GRA }, // 10 Foreground Tiles - { "mca-u61.bin", 0x100000, 0x51af66c9, 5 | BRF_GRA }, // 11 - { "mca-u100", 0x080000, 0xb273f1b0, 5 | BRF_GRA }, // 12 - - { "u53.bin", 0x100000, 0x99f2a624, 6 | BRF_SND }, // 13 YM2610 Samples - - { "peel18cv8.u1", 0x000155, 0x00000000, 7 | BRF_NODUMP | BRF_OPT }, // 14 plds - { "gal16v8a.u10", 0x000117, 0x00000000, 7 | BRF_NODUMP | BRF_OPT }, // 15 -}; - -STD_ROM_PICK(catt) -STD_ROM_FN(catt) - -struct BurnDriver BurnDrvCatt = { - "catt", "mcatadv", NULL, NULL, "1993", - "Catt (Japan)\0", NULL, "Wintechno", "LINDA", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, cattRomInfo, cattRomName, NULL, NULL, McatadvInputInfo, McatadvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1001, - 320, 224, 4, 3 -}; - - -// Nostradamus - -static struct BurnRomInfo nostRomDesc[] = { - { "nos-pe-u.bin", 0x080000, 0x4b080149, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "nos-po-u.bin", 0x080000, 0x9e3cd6d9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "nos-ps.u9", 0x040000, 0x832551e9, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "nos-se-0.u82", 0x100000, 0x9d99108d, 3 | BRF_GRA }, // 3 Sprites - { "nos-so-0.u83", 0x100000, 0x7df0fc7e, 3 | BRF_GRA }, // 4 - { "nos-se-1.u84", 0x100000, 0xaad07607, 3 | BRF_GRA }, // 5 - { "nos-so-1.u85", 0x100000, 0x83d0012c, 3 | BRF_GRA }, // 6 - { "nos-se-2.u86", 0x080000, 0xd99e6005, 3 | BRF_GRA }, // 7 - { "nos-so-2.u87", 0x080000, 0xf60e8ef3, 3 | BRF_GRA }, // 8 - - { "nos-b0-0.u58", 0x100000, 0x0214b0f2, 4 | BRF_GRA }, // 9 Background Tiles - { "nos-b0-1.u59", 0x080000, 0x3f8b6b34, 4 | BRF_GRA }, // 10 - - { "nos-b1-0.u60", 0x100000, 0xba6fd0c7, 5 | BRF_GRA }, // 11 Foreground Tiles - { "nos-b1-1.u61", 0x080000, 0xdabd8009, 5 | BRF_GRA }, // 12 - - { "nossn-00.u53", 0x100000, 0x3bd1bcbc, 6 | BRF_SND }, // 13 YM2610 Samples -}; - -STD_ROM_PICK(nost) -STD_ROM_FN(nost) - -static void NostPatch() -{ - // Can also be fixed overclocking the z80 to 4250000 and enabling - // z80 sync, but is slow and breaks sound in Mcatadv. - *((UINT16*)(Drv68KROM + 0x000122)) = BURN_ENDIAN_SWAP_INT16(0x0146); // Skip ROM Check -} - -static INT32 NostInit() -{ - INT32 nRet = DrvInit(); - - if (nRet == 0) { - NostPatch(); - } - - return nRet; -} - -struct BurnDriver BurnDrvNost = { - "nost", NULL, NULL, NULL, "1993", - "Nostradamus\0", NULL, "Face", "LINDA", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, nostRomInfo, nostRomName, NULL, NULL, NostInputInfo, NostDIPInfo, - NostInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1001, - 224, 320, 3, 4 -}; - - -// Nostradamus (Japan) - -static struct BurnRomInfo nostjRomDesc[] = { - { "nos-pe-j.u30", 0x080000, 0x4b080149, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "nos-po-j.u29", 0x080000, 0x7fe241de, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "nos-ps.u9", 0x040000, 0x832551e9, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "nos-se-0.u82", 0x100000, 0x9d99108d, 3 | BRF_GRA }, // 3 Sprites - { "nos-so-0.u83", 0x100000, 0x7df0fc7e, 3 | BRF_GRA }, // 4 - { "nos-se-1.u84", 0x100000, 0xaad07607, 3 | BRF_GRA }, // 5 - { "nos-so-1.u85", 0x100000, 0x83d0012c, 3 | BRF_GRA }, // 6 - { "nos-se-2.u86", 0x080000, 0xd99e6005, 3 | BRF_GRA }, // 7 - { "nos-so-2.u87", 0x080000, 0xf60e8ef3, 3 | BRF_GRA }, // 8 - - { "nos-b0-0.u58", 0x100000, 0x0214b0f2, 4 | BRF_GRA }, // 9 Background Tiles - { "nos-b0-1.u59", 0x080000, 0x3f8b6b34, 4 | BRF_GRA }, // 10 - - { "nos-b1-0.u60", 0x100000, 0xba6fd0c7, 5 | BRF_GRA }, // 11 Foreground Tiles - { "nos-b1-1.u61", 0x080000, 0xdabd8009, 5 | BRF_GRA }, // 12 - - { "nossn-00.u53", 0x100000, 0x3bd1bcbc, 6 | BRF_SND }, // 13 YM2610 Samples -}; - -STD_ROM_PICK(nostj) -STD_ROM_FN(nostj) - -struct BurnDriver BurnDrvNostj = { - "nostj", "nost", NULL, NULL, "1993", - "Nostradamus (Japan)\0", NULL, "Face", "LINDA", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, nostjRomInfo, nostjRomName, NULL, NULL, NostInputInfo, NostDIPInfo, - NostInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1001, - 224, 320, 3, 4 -}; - - -// Nostradamus (Korea) - -static struct BurnRomInfo nostkRomDesc[] = { - { "nos-pe-t.u30", 0x080000, 0xbee5fbc8, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "nos-po-t.u29", 0x080000, 0xf4736331, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "nos-ps.u9", 0x040000, 0x832551e9, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "nos-se-0.u82", 0x100000, 0x9d99108d, 3 | BRF_GRA }, // 3 Sprites - { "nos-so-0.u83", 0x100000, 0x7df0fc7e, 3 | BRF_GRA }, // 4 - { "nos-se-1.u84", 0x100000, 0xaad07607, 3 | BRF_GRA }, // 5 - { "nos-so-1.u85", 0x100000, 0x83d0012c, 3 | BRF_GRA }, // 6 - { "nos-se-2.u86", 0x080000, 0xd99e6005, 3 | BRF_GRA }, // 7 - { "nos-so-2.u87", 0x080000, 0xf60e8ef3, 3 | BRF_GRA }, // 8 - - { "nos-b0-0.u58", 0x100000, 0x0214b0f2, 4 | BRF_GRA }, // 9 Background Tiles - { "nos-b0-1.u59", 0x080000, 0x3f8b6b34, 4 | BRF_GRA }, // 10 - - { "nos-b1-0.u60", 0x100000, 0xba6fd0c7, 5 | BRF_GRA }, // 11 Foreground Tiles - { "nos-b1-1.u61", 0x080000, 0xdabd8009, 5 | BRF_GRA }, // 12 - - { "nossn-00.u53", 0x100000, 0x3bd1bcbc, 6 | BRF_SND }, // 13 YM2610 Samples -}; - -STD_ROM_PICK(nostk) -STD_ROM_FN(nostk) - -struct BurnDriver BurnDrvNostk = { - "nostk", "nost", NULL, NULL, "1993", - "Nostradamus (Korea)\0", NULL, "Face", "LINDA", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, nostkRomInfo, nostkRomName, NULL, NULL, NostInputInfo, NostDIPInfo, - NostInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1001, - 224, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/pst90s/d_metro.cpp b/jan/src/burn/drv/pst90s/d_metro.cpp deleted file mode 100644 index 2e3fc20f1..000000000 --- a/jan/src/burn/drv/pst90s/d_metro.cpp +++ /dev/null @@ -1,6208 +0,0 @@ -// FB Alpha Metro driver module -// Based on MAME driver by Luca Elia and David Haywood - -/* - Needs porting: - dokyusei (ym2413+msm6295 sound) - dokyusp (ym2413+msm6295 sound) - mouja (ym2413+msm6295 sound) - gakusai (ym2413+msm6295 sound) - gakusai2 (ym2413+msm6295 sound) - - Unemulated - puzzlet (h8 main cpu) - - Broken - daitorid, crashes in the blitter after the book opens(attract) -*/ - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "upd7810_intf.h" -#include "eeprom.h" -#include "konamiic.h" -#include "burn_ym2610.h" -#include "burn_ym2413.h" -#include "burn_ym2151.h" -#include "burn_ymf278b.h" -#include "msm6295.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvUpdROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvRozROM; -static UINT8 *DrvYMROMA; -static UINT8 *DrvYMROMB; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvVidRAM2; -static UINT8 *DrvUnkRAM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvTileRAM; -static UINT8 *DrvK053936RAM; -static UINT8 *DrvK053936LRAM; -static UINT8 *DrvK053936CRAM; -static UINT8 *DrvUpdRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvWindow; -static UINT8 *DrvScroll; -static UINT8 *DrvVidRegs; -static UINT8 *DrvBlitter; - -static UINT8 DrvRecalc; - -static UINT32 gfxrom_bank; -static UINT16 soundlatch; -static UINT16 irq_enable; -static UINT16 screen_control; -static UINT8 requested_int[8]; -static INT32 flip_screen; -static INT32 irq_levels[8]; -static INT32 blit_timer = -1; - -static UINT8 sound_status; -static UINT8 sound_busy; -static UINT8 updportA_data; -static UINT8 updportB_data; - -static INT32 sound_system = 0; // 1 = Z80 + YM2610, 2 = uPD7810 + YM2413 + M6295, 3 = YMF278B, 4 = YM2413 + M6295, 5 = uPD7810 + YM2151 + M6295 -static INT32 m_sprite_xoffs_dx = 0; -static INT32 m_sprite_yoffs_dx = 0; -static INT32 m_tilemap_scrolldx[3] = { 8, 8, 8 }; -static UINT32 graphics_length; -static INT32 vblank_bit = 0; -static INT32 irq_line = 1; -static INT32 blitter_bit = 0; -static INT32 support_8bpp = 1; -static INT32 support_16x16 = 1; -static INT32 has_zoom = 0; -static UINT32 main_cpu_cycles = 12000000 / 60; -static INT32 ymf278bint = 0; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvDips[4]; -static UINT16 DrvInputs[4]; -static UINT8 DrvReset; - -static struct BurnInputInfo BlzntrndInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy1 + 15, "p2 fire 4" }, - - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 6, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy2 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy2 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy2 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy2 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p3 fire 3" }, - {"P3 Button 4", BIT_DIGITAL, DrvJoy2 + 7, "p3 fire 4" }, - - {"P4 Start", BIT_DIGITAL, DrvJoy3 + 7, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy2 + 8, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy2 + 9, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy2 + 10, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy2 + 11, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p4 fire 3" }, - {"P4 Button 4", BIT_DIGITAL, DrvJoy2 + 15, "p4 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Blzntrnd) - -static struct BurnInputInfo Gstrik2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 1, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Gstrik2) - -static struct BurnInputInfo SkyalertInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Skyalert) - -static struct BurnInputInfo LadykillInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Ladykill) - -static struct BurnInputInfo PururunInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pururun) - -static struct BurnInputInfo KaratourInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, -}; - -STDINPUTINFO(Karatour) - -static struct BurnInputInfo DaitoridInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Daitorid) - -static struct BurnInputInfo GunmastInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Gunmast) - -static struct BurnInputInfo PuzzliInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Puzzli) - -static struct BurnInputInfo BalcubeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Balcube) - -static struct BurnDIPInfo BlzntrndDIPList[]= -{ - {0x28, 0xff, 0xff, 0x0e, NULL }, - {0x29, 0xff, 0xff, 0xff, NULL }, - {0x2a, 0xff, 0xff, 0xff, NULL }, - {0x2b, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x28, 0x01, 0x07, 0x07, "Beginner" }, - {0x28, 0x01, 0x07, 0x06, "Easiest" }, - {0x28, 0x01, 0x07, 0x05, "Easy" }, - {0x28, 0x01, 0x07, 0x04, "Normal" }, - {0x28, 0x01, 0x07, 0x03, "Hard" }, - {0x28, 0x01, 0x07, 0x02, "Hardest" }, - {0x28, 0x01, 0x07, 0x01, "Expert" }, - {0x28, 0x01, 0x07, 0x00, "Master" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x28, 0x01, 0x08, 0x08, "Off" }, - {0x28, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x28, 0x01, 0x10, 0x10, "Off" }, - {0x28, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x28, 0x01, 0x20, 0x20, "No" }, - {0x28, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 3, "Control Panel" }, - {0x28, 0x01, 0xc0, 0x00, "4 Players" }, - {0x28, 0x01, 0xc0, 0x80, "1P & 2P Tag only" }, - {0x28, 0x01, 0xc0, 0xc0, "1P & 2P vs only" }, - - {0 , 0xfe, 0 , 4, "Half Continue" }, - {0x29, 0x01, 0x03, 0x00, "6C to start, 3C to continue" }, - {0x29, 0x01, 0x03, 0x01, "4C to start, 2C to continue" }, - {0x29, 0x01, 0x03, 0x02, "2C to start, 1C to continue" }, - {0x29, 0x01, 0x03, 0x03, "Disabled" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x29, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x29, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x29, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x29, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x29, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x29, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x29, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x29, 0x01, 0x07, 0x00, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x29, 0x01, 0x38, 0x20, "4 Coins 1 Credits" }, - {0x29, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x29, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x29, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x29, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x29, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x29, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x29, 0x01, 0x38, 0x00, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x29, 0x01, 0x40, 0x40, "Off" }, - {0x29, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x29, 0x01, 0x80, 0x80, "Off" }, - {0x29, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "CP Single" }, - {0x2a, 0x01, 0x03, 0x03, "2:00" }, - {0x2a, 0x01, 0x03, 0x02, "2:30" }, - {0x2a, 0x01, 0x03, 0x01, "3:00" }, - {0x2a, 0x01, 0x03, 0x00, "3:30" }, - - {0 , 0xfe, 0 , 4, "CP Tag" }, - {0x2a, 0x01, 0x0c, 0x0c, "2:00" }, - {0x2a, 0x01, 0x0c, 0x08, "2:30" }, - {0x2a, 0x01, 0x0c, 0x04, "3:00" }, - {0x2a, 0x01, 0x0c, 0x00, "3:30" }, - - {0 , 0xfe, 0 , 4, "Vs Single" }, - {0x2a, 0x01, 0x30, 0x30, "2:30" }, - {0x2a, 0x01, 0x30, 0x20, "3:00" }, - {0x2a, 0x01, 0x30, 0x10, "4:00" }, - {0x2a, 0x01, 0x30, 0x00, "5:00" }, - - {0 , 0xfe, 0 , 4, "Vs Tag" }, - {0x2a, 0x01, 0xc0, 0xc0, "2:30" }, - {0x2a, 0x01, 0xc0, 0x80, "3:00" }, - {0x2a, 0x01, 0xc0, 0x40, "4:00" }, - {0x2a, 0x01, 0xc0, 0x00, "5:00" }, -}; - -STDDIPINFO(Blzntrnd) - -static struct BurnDIPInfo Gstrik2DIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xfc, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - {0x18, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Player Vs Com" }, - {0x15, 0x01, 0x03, 0x03, "1:00" }, - {0x15, 0x01, 0x03, 0x02, "1:30" }, - {0x15, 0x01, 0x03, 0x01, "2:00" }, - {0x15, 0x01, 0x03, 0x00, "2:30" }, - - {0 , 0xfe, 0 , 4, "1P Vs 2P" }, - {0x15, 0x01, 0x0c, 0x0c, "0:45" }, - {0x15, 0x01, 0x0c, 0x08, "1:00" }, - {0x15, 0x01, 0x0c, 0x04, "1:30" }, - {0x15, 0x01, 0x0c, 0x00, "2:00" }, - - {0 , 0xfe, 0 , 4, "Extra Time" }, - {0x15, 0x01, 0x30, 0x30, "0:30" }, - {0x15, 0x01, 0x30, 0x20, "0:45" }, - {0x15, 0x01, 0x30, 0x10, "1:00" }, - {0x15, 0x01, 0x30, 0x00, "Off" }, - - {0 , 0xfe, 0 , 2, "Time Period" }, - {0x15, 0x01, 0x80, 0x80, "Sudden Death" }, - {0x15, 0x01, 0x80, 0x00, "Full" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x16, 0x01, 0x07, 0x07, "Very Easy" }, - {0x16, 0x01, 0x07, 0x06, "Easier" }, - {0x16, 0x01, 0x07, 0x05, "Easy" }, - {0x16, 0x01, 0x07, 0x04, "Normal" }, - {0x16, 0x01, 0x07, 0x03, "Medium" }, - {0x16, 0x01, 0x07, 0x02, "Hard" }, - {0x16, 0x01, 0x07, 0x01, "Hardest" }, - {0x16, 0x01, 0x07, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x08, 0x00, "Off" }, - {0x16, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x16, 0x01, 0x10, 0x10, "Off" }, - {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 32, "Coin A" }, - {0x17, 0x01, 0x1f, 0x1c, "4 Coins 1 Credits" }, - {0x17, 0x01, 0x1f, 0x1d, "3 Coins 1 Credits" }, - {0x17, 0x01, 0x1f, 0x18, "4 Coins 2 Credits" }, - {0x17, 0x01, 0x1f, 0x1e, "2 Coins 1 Credits" }, - {0x17, 0x01, 0x1f, 0x19, "3 Coins 2 Credits" }, - {0x17, 0x01, 0x1f, 0x14, "4 Coins 3 Credits" }, - {0x17, 0x01, 0x1f, 0x10, "4 Coins 4 Credits" }, - {0x17, 0x01, 0x1f, 0x15, "3 Coins 3 Credits" }, - {0x17, 0x01, 0x1f, 0x1a, "2 Coins 2 Credits" }, - {0x17, 0x01, 0x1f, 0x1f, "1 Coin 1 Credits" }, - {0x17, 0x01, 0x1f, 0x0c, "4 Coins 5 Credits" }, - {0x17, 0x01, 0x1f, 0x11, "3 Coins 4 Credits" }, - {0x17, 0x01, 0x1f, 0x08, "4 Coins/6 Credits" }, - {0x17, 0x01, 0x1f, 0x16, "2 Coins 3 Credits" }, - {0x17, 0x01, 0x1f, 0x0d, "3 Coins/5 Credits" }, - {0x17, 0x01, 0x1f, 0x04, "4 Coins 7 Credits" }, - {0x17, 0x01, 0x1f, 0x00, "4 Coins/8 Credits" }, - {0x17, 0x01, 0x1f, 0x09, "3 Coins/6 Credits" }, - {0x17, 0x01, 0x1f, 0x12, "2 Coins 4 Credits" }, - {0x17, 0x01, 0x1f, 0x1b, "1 Coin 2 Credits" }, - {0x17, 0x01, 0x1f, 0x05, "3 Coins/7 Credits" }, - {0x17, 0x01, 0x1f, 0x0e, "2 Coins 5 Credits" }, - {0x17, 0x01, 0x1f, 0x01, "3 Coins/8 Credits" }, - {0x17, 0x01, 0x1f, 0x0a, "2 Coins 6 Credits" }, - {0x17, 0x01, 0x1f, 0x17, "1 Coin 3 Credits" }, - {0x17, 0x01, 0x1f, 0x06, "2 Coins 7 Credits" }, - {0x17, 0x01, 0x1f, 0x02, "2 Coins 8 Credits" }, - {0x17, 0x01, 0x1f, 0x13, "1 Coin 4 Credits" }, - {0x17, 0x01, 0x1f, 0x0f, "1 Coin 5 Credits" }, - {0x17, 0x01, 0x1f, 0x0b, "1 Coin 6 Credits" }, - {0x17, 0x01, 0x1f, 0x07, "1 Coin 7 Credits" }, - {0x17, 0x01, 0x1f, 0x03, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x17, 0x01, 0xe0, 0xc0, "1 Coin 1 Credits" }, - {0x17, 0x01, 0xe0, 0xa0, "1 Coin 2 Credits" }, - {0x17, 0x01, 0xe0, 0x80, "1 Coin 3 Credits" }, - {0x17, 0x01, 0xe0, 0x60, "1 Coin 4 Credits" }, - {0x17, 0x01, 0xe0, 0x40, "1 Coin 5 Credits" }, - {0x17, 0x01, 0xe0, 0x20, "1 Coin 6 Credits" }, - {0x17, 0x01, 0xe0, 0x00, "1 Coin 7 Credits" }, - {0x17, 0x01, 0xe0, 0xe0, "Same as Coin A" }, - - {0 , 0xfe, 0 , 4, "Credits to Start" }, - {0x18, 0x01, 0x03, 0x03, "1" }, - {0x18, 0x01, 0x03, 0x02, "2" }, - {0x18, 0x01, 0x03, 0x01, "3" }, - {0x18, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Credits to Continue" }, - {0x18, 0x01, 0x0c, 0x0c, "1" }, - {0x18, 0x01, 0x0c, 0x08, "2" }, - {0x18, 0x01, 0x0c, 0x04, "3" }, - {0x18, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Continue" }, - {0x18, 0x01, 0x10, 0x00, "Off" }, - {0x18, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x18, 0x01, 0x20, 0x20, "Off" }, - {0x18, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Playmode" }, - {0x18, 0x01, 0x40, 0x40, "1 Credit for 1 Player" }, - {0x18, 0x01, 0x40, 0x00, "1 Credit for 2 Players" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x18, 0x01, 0x80, 0x80, "Off" }, - {0x18, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Gstrik2) - -static struct BurnDIPInfo SkyalertDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x0c, 0x08, "1" }, - {0x14, 0x01, 0x0c, 0x04, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "100K, every 400K" }, - {0x14, 0x01, 0x30, 0x20, "200K, every 400K" }, - {0x14, 0x01, 0x30, 0x10, "200K" }, - {0x14, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "No" }, - {0x14, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Skyalert) - -static struct BurnDIPInfo PangpomsDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xef, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Time Speed" }, - {0x14, 0x01, 0x03, 0x00, "Slowest" }, - {0x14, 0x01, 0x03, 0x01, "Slow" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Fast" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x0c, 0x08, "1" }, - {0x14, 0x01, 0x0c, 0x04, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x30, 0x20, "400k and 800k" }, - {0x14, 0x01, 0x30, 0x30, "400k" }, - {0x14, 0x01, 0x30, 0x10, "800k" }, - {0x14, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "No" }, - {0x14, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Pangpoms) - -static struct BurnDIPInfo PoittoDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x00, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x02, "Hard" }, - {0x12, 0x01, 0x03, 0x01, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Poitto) - -static struct BurnDIPInfo LastfortDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Retry Level On Continue" }, - {0x14, 0x01, 0x08, 0x08, "Ask Player" }, - {0x14, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x14, 0x01, 0x10, 0x10, "2 Credits" }, - {0x14, 0x01, 0x10, 0x00, "1 Credit" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x20, 0x00, "No" }, - {0x14, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 1, "Tiles" }, -// {0x14, 0x01, 0x80, 0x00, "Cards" }, - {0x14, 0x01, 0x80, 0x80, "Mahjong" }, -}; - -STDDIPINFO(Lastfort) - -static struct BurnDIPInfo LastferoDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x00, "Easiest" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - - {0 , 0xfe, 0 , 2, "Retry Level On Continue" }, - {0x14, 0x01, 0x08, 0x08, "Ask Player" }, - {0x14, 0x01, 0x08, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x14, 0x01, 0x10, 0x10, "2 Credits" }, - {0x14, 0x01, 0x10, 0x00, "1 Credit" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x20, 0x00, "No" }, - {0x14, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 1, "Tiles" }, - //{0x14, 0x01, 0x80, 0x00, "Cards" }, - {0x14, 0x01, 0x80, 0x80, "Mahjong" }, -}; - -STDDIPINFO(Lastfero) - -static struct BurnDIPInfo LadykillDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x6f, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0b, 0x01, 0x03, 0x01, "1" }, - {0x0b, 0x01, 0x03, 0x00, "2" }, - {0x0b, 0x01, 0x03, 0x03, "3" }, - {0x0b, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0b, 0x01, 0x0c, 0x08, "Easy" }, - {0x0b, 0x01, 0x0c, 0x0c, "Normal" }, - {0x0b, 0x01, 0x0c, 0x04, "Hard" }, - {0x0b, 0x01, 0x0c, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Nudity" }, - {0x0b, 0x01, 0x10, 0x10, "Partial" }, - {0x0b, 0x01, 0x10, 0x00, "Full" }, - - {0 , 0xfe, 0 , 2, "Service Mode / Free Play" }, - {0x0b, 0x01, 0x20, 0x20, "Off" }, - {0x0b, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0b, 0x01, 0x40, 0x00, "No" }, - {0x0b, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0b, 0x01, 0x80, 0x80, "Off" }, - {0x0b, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0c, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x0c, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0c, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x0c, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x0c, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x0c, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x0c, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x0c, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x0c, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x0c, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x0c, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x0c, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x0c, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0c, 0x01, 0x40, 0x40, "Off" }, - {0x0c, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Ladykill) - -static struct BurnDIPInfo DharmaDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Timer" }, - {0x13, 0x01, 0x0c, 0x08, "Slow" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Fast" }, - {0x13, 0x01, 0x0c, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x13, 0x01, 0x10, 0x10, "2 Credits" }, - {0x13, 0x01, 0x10, 0x00, "1 Credit" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x20, 0x00, "No" }, - {0x13, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze (Cheat)" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dharma) - -static struct BurnDIPInfo PururunDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easiest" }, - {0x13, 0x01, 0x03, 0x01, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Join In" }, - {0x13, 0x01, 0x04, 0x00, "No" }, - {0x13, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x13, 0x01, 0x08, 0x00, "1 Credit" }, - {0x13, 0x01, 0x08, 0x08, "2 Credits" }, - - {0 , 0xfe, 0 , 2, "Bombs" }, - {0x13, 0x01, 0x10, 0x10, "1" }, - {0x13, 0x01, 0x10, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x20, 0x00, "No" }, - {0x13, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Pururun) - -static struct BurnDIPInfo KaratourDIPList[]= -{ - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x01, "1" }, - {0x13, 0x01, 0x03, 0x00, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Time" }, - {0x13, 0x01, 0x10, 0x10, "60" }, - {0x13, 0x01, 0x10, 0x00, "40" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x40, 0x00, "No" }, - {0x13, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x38, 0x10, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Karatour) - -static struct BurnDIPInfo DaitoridDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Timer Speed" }, - {0x12, 0x01, 0x03, 0x02, "Slower" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Fast" }, - {0x12, 0x01, 0x03, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 2, "Winning Rounds (P VS P)" }, - {0x12, 0x01, 0x08, 0x00, "1/1" }, - {0x12, 0x01, 0x08, 0x08, "2/3" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x12, 0x01, 0x30, 0x30, "Retry Level" }, - {0x12, 0x01, 0x30, 0x20, "Ask Player" }, - {0x12, 0x01, 0x30, 0x10, "No" }, - {0x12, 0x01, 0x30, 0x00, "Retry Level" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Daitorid) - -static struct BurnDIPInfo GunmastDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x03, "Normal" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x01, "Harder" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x04, 0x00, "No" }, - {0x16, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 2, "Allow P2 to Join Game" }, - {0x16, 0x01, 0x08, 0x00, "No" }, - {0x16, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x10, 0x00, "Off" }, - {0x16, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x16, 0x01, 0x20, 0x20, "1" }, - {0x16, 0x01, 0x20, 0x00, "2" }, -}; - -STDDIPINFO(Gunmast) - -static struct BurnDIPInfo _3kokushiDIPList[]= -{ - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x10, 0x00, "No" }, - {0x14, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode / Free Play" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Helps" }, - {0x14, 0x01, 0xc0, 0x00, "1" }, - {0x14, 0x01, 0xc0, 0x40, "2" }, - {0x14, 0x01, 0xc0, 0xc0, "3" }, - {0x14, 0x01, 0xc0, 0x80, "4" }, -}; - -STDDIPINFO(_3kokushi) - -static struct BurnDIPInfo PuzzliDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Join In" }, - {0x14, 0x01, 0x04, 0x00, "No" }, - {0x14, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x14, 0x01, 0x08, 0x00, "1 Credit" }, - {0x14, 0x01, 0x08, 0x08, "2 Credits" }, - - {0 , 0xfe, 0 , 2, "Winning Rounds (P VS P)" }, - {0x14, 0x01, 0x10, 0x00, "1/1" }, - {0x14, 0x01, 0x10, 0x10, "2/3" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x20, 0x00, "No" }, - {0x14, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Puzzli) - -static struct BurnDIPInfo Toride2gDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Timer Speed" }, - {0x14, 0x01, 0x03, 0x02, "Slower" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Fast" }, - {0x14, 0x01, 0x03, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 2, "Tile Arrangement" }, - {0x14, 0x01, 0x04, 0x04, "Normal" }, - {0x14, 0x01, 0x04, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Retry Level On Continue" }, - {0x14, 0x01, 0x08, 0x00, "Ask Player" }, - {0x14, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x14, 0x01, 0x10, 0x10, "2 Credits" }, - {0x14, 0x01, 0x10, 0x00, "1 Credit" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x20, 0x00, "No" }, - {0x14, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Toride2g) - -static struct BurnDIPInfo MsgogoDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow P2 to Join Game" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x20, 0x20, "2" }, - {0x14, 0x01, 0x20, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x14, 0x01, 0x80, 0x80, "Japanese" }, - {0x14, 0x01, 0x80, 0x00, "English" }, -}; - -STDDIPINFO(Msgogo) - -static struct BurnDIPInfo BalcubeDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "2 Players Game" }, - {0x12, 0x01, 0x04, 0x00, "1 Credit" }, - {0x12, 0x01, 0x04, 0x04, "2 Credits" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x08, 0x08, "2" }, - {0x12, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x10, 0x00, "No" }, - {0x12, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x00, "Off" }, - {0x12, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Balcube) - -static struct BurnDIPInfo BangballDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x04, "3" }, - {0x12, 0x01, 0x0c, 0x0c, "4" }, - {0x12, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x10, 0x00, "No" }, - {0x12, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x12, 0x01, 0x80, 0x80, "Japanese" }, - {0x12, 0x01, 0x80, 0x00, "English" }, -}; - -STDDIPINFO(Bangball) - -static struct BurnDIPInfo BatlbublDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x03, 0x02, "Easy" }, - {0x11, 0x01, 0x03, 0x03, "Normal" }, - {0x11, 0x01, 0x03, 0x01, "Hard" }, - {0x11, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x0c, 0x08, "2" }, - {0x11, 0x01, 0x0c, 0x04, "3" }, - {0x11, 0x01, 0x0c, 0x0c, "4" }, - {0x11, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x10, 0x00, "No" }, - {0x11, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Batlbubl) - -static UINT16 metro_irq_cause_r() -{ - UINT16 res = 0; - for (INT32 i = 0; i < 8; i++) - res |= (requested_int[i] << i); - - return res; -} - -static void update_irq_state() -{ - UINT16 irq = metro_irq_cause_r() & ~irq_enable; - - if (irq_line == -1) - { - UINT8 irq_level[8] = { 0,0,0,0,0,0,0,0 }; - - for (INT32 i = 0; i < 8; i++) - if (BIT(irq, i)) - irq_level[irq_levels[i] & 7] = 1; - - for (INT32 i = 0; i < 8; i++) - SekSetIRQLine(i, irq_level[i] ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - } - else - { - SekSetIRQLine(irq_line, irq ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - } -} - -static void metro_irq_cause_w(UINT16 data) -{ - data &= ~irq_enable; - - for (INT32 i = 0; i < 8; i++) - if (BIT(data, i)) requested_int[i] = 0; - - update_irq_state(); -} - -static void metro_blitter_write(INT32 offset) -{ - offset &= 0xe; - - if (offset == 0x0c) - { - UINT16 *m_blitter_regs = (UINT16*)DrvBlitter; - UINT8 *ramdst[4] = { NULL, DrvVidRAM0, DrvVidRAM1, DrvVidRAM2 }; - - UINT8 *src = DrvGfxROM; - size_t src_len = graphics_length; - - UINT32 tmap = (m_blitter_regs[0x00 / 2] << 16) + m_blitter_regs[0x02 / 2]; - UINT32 src_offs = (m_blitter_regs[0x04 / 2] << 16) + m_blitter_regs[0x06 / 2]; - UINT32 dst_offs = (m_blitter_regs[0x08 / 2] << 16) + m_blitter_regs[0x0a / 2]; - - UINT8 *dst = ramdst[tmap]; - - INT32 offs2 = (~dst_offs >> 7) & 1; - dst_offs >>= 8; - - while (1) - { - UINT16 b1, b2, count; - - src_offs %= src_len; - b1 = src[src_offs]; - src_offs++; - - count = ((~b1) & 0x3f) + 1; - - switch ((b1 & 0xc0) >> 6) - { - case 0: - { - if (b1 == 0) - { - requested_int[blitter_bit] = 1; - blit_timer = 1; - return; - } - - while (count--) - { - src_offs %= src_len; - b2 = src[src_offs]; - src_offs++; - - dst_offs &= 0xffff; - dst[dst_offs*2+offs2] = b2; - dst_offs = ((dst_offs + 1) & (0x100 - 1)) | (dst_offs & (~(0x100 - 1))); - } - break; - } - - case 1: - { - src_offs %= src_len; - b2 = src[src_offs]; - src_offs++; - - while (count--) - { - dst_offs &= 0xffff; - dst[dst_offs*2+offs2] = b2; - dst_offs = ((dst_offs + 1) & (0x100 - 1)) | (dst_offs & (~(0x100 - 1))); - b2++; - } - break; - } - - case 2: - { - src_offs %= src_len; - b2 = src[src_offs]; - src_offs++; - - while (count--) - { - dst_offs &= 0xffff; - dst[dst_offs*2+offs2] = b2; - dst_offs = ((dst_offs + 1) & (0x100 - 1)) | (dst_offs & (~(0x100 - 1))); - } - break; - } - - case 3: - { - if (b1 == 0xc0) - { - dst_offs += 0x100; - dst_offs &= ~(0x100 - 1); - dst_offs |= (0x100 - 1) & (m_blitter_regs[0x0a / 2] >> (7 + 1)); - } - else - { - dst_offs += count; - } - break; - } - } - } - } -} - -//------------------------------------------------------------------------------------------------------------------------------ - -static void palette_write(INT32 offset) -{ - offset &= 0x1ffe; - - UINT16 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (p >> 6) & 0x1f; - INT32 g = (p >> 11) & 0x1f; - INT32 b = (p >> 1) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - konami_palette32[offset/2] = r * 0x10000 | g * 0x100 | b; -} - -static void __fastcall metro_common_palette_write_byte(UINT32 address, UINT8 data) -{ - DrvPalRAM[(address & 0x1fff)^1] = data; - palette_write(address); -} - -static void __fastcall metro_common_palette_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + (address & 0x1ffe))) = data; - palette_write(address); -} - -static UINT8 __fastcall metro_common_read_byte(UINT32 address) -{ - address &= 0x7ffff; - - if ((address & 0xfff0000) == 0x060000) { - return DrvGfxROM[(gfxrom_bank + (address & 0xffff)) ^ 0]; - } - - switch (address) - { - case 0x0788a3: - return metro_irq_cause_r(); - } - - bprintf (0, _T("Common RB %5.5x\n"), address); - - return 0; -} - -static UINT16 __fastcall metro_common_read_word(UINT32 address) -{ - address &= 0x7ffff; - - if ((address & 0xfff0000) == 0x060000) { - INT32 offset = gfxrom_bank + (address & 0xfffe); - return DrvGfxROM[offset + 0] * 256 + DrvGfxROM[offset + 1]; - } - -// karatour - if ((address & 0xffff000) == 0x075000) { - UINT16 *dst = (UINT16*)DrvVidRAM0; - return dst[((address & 0x7f) + ((address & 0xf80) * 4)) / 2]; - } - - if ((address & 0xffff000) == 0x076000) { - UINT16 *dst = (UINT16*)DrvVidRAM1; - return dst[((address & 0x7f) + ((address & 0xf80) * 4)) / 2]; - } - - if ((address & 0xffff000) == 0x077000) { - UINT16 *dst = (UINT16*)DrvVidRAM2; - return dst[((address & 0x7f) + ((address & 0xf80) * 4)) / 2]; - } -// end - - switch (address) - { - case 0x0788a2: - return metro_irq_cause_r(); - } - - bprintf (0, _T("Common RW %5.5x\n"), address); - - return 0; -} - -static void __fastcall metro_common_write_word(UINT32 address, UINT16 data) -{ - address &= 0x7ffff; - -// karatour - if ((address & 0xffff000) == 0x075000) { - UINT16 *dst = (UINT16*)DrvVidRAM0; - dst[((address & 0x7f) + ((address & 0xf80) * 4)) / 2] = data; - return; - } - - if ((address & 0xffff000) == 0x076000) { - UINT16 *dst = (UINT16*)DrvVidRAM1; - dst[((address & 0x7f) + ((address & 0xf80) * 4)) / 2] = data; - return; - } - - if ((address & 0xffff000) == 0x077000) { - UINT16 *dst = (UINT16*)DrvVidRAM2; - dst[((address & 0x7f) + ((address & 0xf80) * 4)) / 2] = data; - return; - } -// end - - // mirror or due to chip revision? - if ((address >= 0x078800 && address <= 0x078813) || (address >= 0x079700 && address <= 0x079713)) { - *((UINT16*)(DrvVidRegs + (address & 0x1e))) = data; - return; - } - - if (address >= 0x078860 && address <= 0x07886b) { - *((UINT16*)(DrvWindow + (address & 0xe))) = data; - return; - } - - if (address >= 0x078870 && address <= 0x07887b) { - *((UINT16*)(DrvScroll + (address & 0xe))) = data; - return; - } - - if (address >= 0x078840 && address <= 0x07884d) { - *((UINT16*)(DrvBlitter + (address & 0xe))) = data; - metro_blitter_write(address); - return; - } - - switch (address) - { - case 0x078850: - case 0x078852: - case 0x078880: - case 0x078890: - case 0x0788a0: - case 0x0788a6: // crt registers? - return; - - case 0x0788a2: - metro_irq_cause_w(data); - return; - - case 0x0788a4: - irq_enable = data; - return; - - case 0x0788a8: - soundlatch = data; - sound_busy = 1; - if (sound_system == 2 || sound_system == 5) { - upd7810SetIRQLine(CPU_IRQLINE_NMI, CPU_IRQSTATUS_ACK); - } - return; - - case 0x0788aa: - gfxrom_bank = (data & 0x1ff) * 0x10000; - if (gfxrom_bank >= graphics_length) gfxrom_bank = graphics_length-0x10000; - return; - - case 0x0788ac: - screen_control = data; - return; - } - - bprintf (0, _T("Common WW %5.5x\n"), address); -} - -static void __fastcall metro_common_write_byte(UINT32 address, UINT8 data) -{ - address &= 0x7ffff; - - bprintf (0, _T("Common WB %5.5x, %2.2x\n"), address, data); -} - -// Map Imagetek I4100/I4220 and main RAM -static void metro_common_map_ram(UINT32 chip_address, INT32 main_ram_address) -{ - SekMapMemory(DrvVidRAM0, chip_address + 0x000000, chip_address + 0x01ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, chip_address + 0x020000, chip_address + 0x03ffff, MAP_RAM); - SekMapMemory(DrvVidRAM2, chip_address + 0x040000, chip_address + 0x05ffff, MAP_RAM); - SekMapMemory(Drv68KRAM0, chip_address + 0x070000, chip_address + 0x071fff, MAP_RAM); - SekMapMemory(DrvPalRAM, chip_address + 0x072000, chip_address + 0x073fff, MAP_ROM); - SekMapMemory(DrvSprRAM, chip_address + 0x074000, chip_address + 0x074fff, MAP_RAM); - SekMapMemory(DrvTileRAM, chip_address + 0x078000, chip_address + 0x0787ff, MAP_RAM); - - SekMapHandler(3, chip_address + 0x060000, chip_address + 0x06ffff, MAP_READ | MAP_WRITE); - SekMapHandler(1, chip_address + 0x075000, chip_address + 0x077fff, MAP_READ | MAP_WRITE); - SekMapHandler(2, chip_address + 0x078800, chip_address + 0x07ffff, MAP_READ | MAP_WRITE); - SekMapHandler(4, chip_address + 0x072000, chip_address + 0x073fff, MAP_WRITE); - - SekSetWriteWordHandler(1, metro_common_write_word); - SekSetWriteByteHandler(1, metro_common_write_byte); - SekSetWriteWordHandler(2, metro_common_write_word); - SekSetWriteByteHandler(2, metro_common_write_byte); - SekSetWriteWordHandler(4, metro_common_palette_write_word); - SekSetWriteByteHandler(4, metro_common_palette_write_byte); - - SekSetReadWordHandler(1, metro_common_read_word); - SekSetReadByteHandler(1, metro_common_read_byte); - SekSetReadWordHandler(2, metro_common_read_word); - SekSetReadByteHandler(2, metro_common_read_byte); - SekSetReadWordHandler(3, metro_common_read_word); - SekSetReadByteHandler(3, metro_common_read_byte); - - if (main_ram_address == -1) return; - - for (INT32 i = 0; i < 0x10; i++) { - SekMapMemory(Drv68KRAM1, main_ram_address + (i * 0x10000), main_ram_address + 0xffff + (i * 0x10000), MAP_RAM); - } - -} - -//------------------------------------------------------------------------------------------------------------------------------------------ - -static void __fastcall blzntrnd_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0xe00002: - soundlatch = data >> 8; - ZetNmi(); - return; - } -} - -static void __fastcall blzntrnd_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xe00001: - return; - } - - bprintf (0, _T("WB: %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall blzntrnd_main_read_word(UINT32 address) -{ - switch (address) - { - case 0xe00000: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0xe00002: - return (DrvDips[2] << 0) | (DrvDips[3] << 8); - - case 0xe00004: - return DrvInputs[0]; - - case 0xe00006: - return DrvInputs[1]; - - case 0xe00008: - return DrvInputs[2]; - } - - return 0; -} - -static UINT8 __fastcall blzntrnd_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xe00000: - case 0xe00001: - case 0xe00002: - case 0xe00003: - return DrvDips[(address & 3) ^ 1]; - - case 0xe00004: - case 0xe00005: - case 0xe00006: - case 0xe00007: - case 0xe00008: - case 0xe00009: - return DrvInputs[(address - 0xe00004)/2] >> ((~address & 1) * 8); - } - - return 0; -} - -static void __fastcall skyalert_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x400000: - sound_status = data & 0x01; - return; - - case 0x400002: - // coin lockout - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall skyalert_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x400001: - sound_status = data & 0x01; - return; - } - - bprintf (0, _T("WB: %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall skyalert_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x400000: - return ~sound_busy & 1; // sound status - - case 0x400002: - return 0; // nop - - case 0x400004: - return DrvInputs[0]; - - case 0x400006: - return DrvInputs[1]; - - case 0x400008: - return DrvInputs[2]; - - case 0x40000a: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0x40000c: - return (DrvDips[2] << 0) | (DrvDips[3] << 8); - - case 0x40000e: - return DrvInputs[3]; - } - - return 0; -} - -static UINT8 __fastcall skyalert_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x40000a: - case 0x40000b: - case 0x40000c: - case 0x40000d: - return DrvDips[(address - 0x40000a) ^ 1]; // dip0 - - case 0x400004: - case 0x400005: - case 0x400006: - case 0x400007: - case 0x400008: - case 0x400009: - return DrvInputs[(address - 0x400004)/2] >> ((~address & 1) * 8); - - case 0x40000e: - case 0x40000f: - return DrvInputs[3] >> ((~address & 1) * 8); - } - - return 0; -} - -static void __fastcall pangpoms_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x800000: - sound_status = data & 0x01; - return; - - case 0x800002: - // coin lockout - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall pangpoms_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall pangpoms_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x800000: - return ~sound_busy & 1; // sound status - - case 0x800002: - return 0; // nop - - case 0x800004: - return DrvInputs[0]; - - case 0x800006: - return DrvInputs[1]; - - case 0x800008: - return DrvInputs[2]; - - case 0x80000a: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0x80000c: - return (DrvDips[2] << 0) | (DrvDips[3] << 8); - - case 0x80000e: - return DrvInputs[3]; - } - - return 0; -} - -static UINT8 __fastcall pangpoms_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x80000a: - case 0x80000b: - case 0x80000c: - case 0x80000d: - return DrvDips[(address - 0x80000a) ^ 1]; // dip0 - - case 0x800004: - case 0x800005: - case 0x800006: - case 0x800007: - case 0x800008: - case 0x800009: - return DrvInputs[(address - 0x800004)/2] >> ((~address & 1) * 8); - - case 0x80000e: - case 0x80000f: - return DrvInputs[3] >> ((~address & 1) * 8); - } - - return 0; -} - -static void __fastcall poitto_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x800000: - sound_status = data & 0x01; - return; - - case 0x800002: - case 0x800004: - case 0x800006: - case 0x800008: - // coin lockout - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall poitto_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall poitto_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x800000: - return (DrvInputs[0] & 0xff7f) | ((sound_busy & 1) << 7); - - case 0x800002: - return DrvInputs[1]; - - case 0x800004: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0x800006: - return DrvInputs[2]; - } - - return 0; -} - -static UINT8 __fastcall poitto_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x800000: - return DrvInputs[0] >> 8; - - case 0x800001: - return (DrvInputs[0] & 0x7f) | ((sound_busy & 1) << 7); // sound status - - case 0x800002: - return DrvInputs[1] >> 8; - - case 0x800003: - return DrvInputs[1]; - - case 0x800004: - case 0x800005: - return DrvDips[(address & 1) ^ 1]; - - case 0x800006: - return DrvInputs[2] >> 8; - - case 0x800007: - return DrvInputs[2]; - } - - return 0; -} - -static void __fastcall lastforg_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x400000: - sound_status = data & 0x01; - return; - - case 0x400002: - // coin lockout - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall lastforg_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB: %5.5x, %2.2x\n"), address, data); - - switch (address) - { - case 0x400001: - sound_status = data & 0x01; - return; - } -} - -static UINT16 __fastcall lastforg_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x400000: - return ~sound_busy & 1; - - case 0x400002: - return DrvInputs[0]; - - case 0x400004: - return DrvInputs[1]; - - case 0x400006: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0x40000a: - return (DrvDips[2] << 0) | (DrvDips[3] << 8); - - case 0x40000c: - return DrvInputs[2]; - } - - bprintf (0, _T("RW: %5.5x\n"), address); - return 0; -} - -static UINT8 __fastcall lastforg_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x400001: - return ~sound_busy & 1; // sound status - - case 0x400002: - case 0x400003: - case 0x400004: - case 0x400005: - return DrvInputs[(address - 0x400002)/2] >> ((~address & 1) * 8); - - case 0x400006: - case 0x400007: - return DrvDips[(address - 0x400006) ^ 1]; // dip0 - - case 0x40000a: - case 0x40000b: - return DrvDips[((address - 0x40000a) ^ 1)+2]; // dip0 - - case 0x40000c: - case 0x40000d: - return DrvInputs[2] >> ((~address & 1) * 8); - } - - bprintf (0, _T("RB: %5.5x\n"), address); - return 0; -} - -static void __fastcall lastfort_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0xc00000: - sound_status = data & 0x01; - return; - - case 0xc00002: - // coin lockout - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall lastfort_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall lastfort_main_read_word(UINT32 address) -{ - switch (address) - { - case 0xc00000: - return ~sound_busy & 1; // sound status - - case 0xc00002: - return 0; // nop - - case 0xc00004: - return DrvInputs[0]; - - case 0xc00006: - return DrvInputs[1]; - - case 0xc00008: - return DrvInputs[2]; - - case 0xc0000a: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0xc0000c: - return (DrvDips[2] << 0) | (DrvDips[3] << 8); - - case 0xc0000e: - return DrvInputs[3]; - } - - return 0; -} - -static UINT8 __fastcall lastfort_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xc0000a: - case 0xc0000b: - case 0xc0000c: - case 0xc0000d: - return DrvDips[(address - 0xc0000a) ^ 1]; // dip0 - - case 0xc00004: - case 0xc00005: - case 0xc00006: - case 0xc00007: - case 0xc00008: - case 0xc00009: - return DrvInputs[(address - 0xc00004)/2] >> ((~address & 1) * 8); - - case 0xc0000e: - case 0xc0000f: - return DrvInputs[3] >> ((~address & 1) * 8); - } - - return 0; -} - -static void __fastcall dharma_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0xc00000: - sound_status = data & 0x01; - return; - - case 0xc00002: - // coin lockout - return; - - case 0xc00004: - // ? - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall dharma_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall dharma_main_read_word(UINT32 address) -{ - switch (address) - { - case 0xc00000: - return (DrvInputs[0] & 0xff7f) | ((sound_busy & 1) << 7); - - case 0xc00002: - return DrvInputs[1]; - - case 0xc00004: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0xc00006: - return DrvInputs[2]; - } - - return 0; -} - -static UINT8 __fastcall dharma_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xc00000: - return DrvInputs[0] >> 8; - - case 0xc00001: - return (DrvInputs[0] & 0x7f) | ((sound_busy & 1) << 7); - - case 0xc00002: - case 0xc00003: - return DrvInputs[1] >> ((~address & 1) * 8); - - case 0xc00004: - case 0xc00005: - return DrvDips[(address - 0xc00004) ^ 1]; // dip0 - - case 0xc00006: - case 0xc00007: - return DrvInputs[2] >> ((~address & 1) * 8); - } - - return 0; -} - -static void __fastcall pururun_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x400000: - sound_status = data & 0x01; - return; - - case 0x400002: - // coin lockout - return; - - case 0x400004: - // ? - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall pururun_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall pururun_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x400000: - return (DrvInputs[0] & 0xff7f) | ((sound_busy & 1) << 7); - - case 0x400002: - return DrvInputs[1]; - - case 0x400004: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0x400006: - return DrvInputs[2]; - } - - return 0; -} - -static UINT8 __fastcall pururun_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x400000: - return DrvInputs[0] >> 8; - - case 0x400001: - return (DrvInputs[0] & 0x7f) | ((sound_busy & 1) << 7); - - case 0x400002: - case 0x400003: - return DrvInputs[1] >> ((~address & 1) * 8); - - case 0x400004: - case 0x400005: - return DrvDips[(address - 0x400004) ^ 1]; // dip0 - - case 0x400006: - case 0x400007: - return DrvInputs[2] >> ((~address & 1) * 8); - } - - return 0; -} - -static void __fastcall karatour_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x400000: - sound_status = data & 0x01; - return; - - case 0x400002: - // coin lockout - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall karatour_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x400003: - // coin lockout - return; - } - - bprintf (0, _T("WB: %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall karatour_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x400000: - return ~sound_busy & 1; // sound status - - case 0x400002: - return DrvInputs[0]; - - case 0x400004: - return DrvInputs[1]; - - case 0x400006: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0x40000a: - return (DrvDips[2] << 0) | (DrvDips[3] << 8); - - case 0x40000c: - return DrvInputs[2]; - } - - return 0; -} - -static UINT8 __fastcall karatour_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x400001: - return ~sound_busy & 1; // sound status - - case 0x400006: - case 0x400007: - return DrvDips[(address & 1)^1]; // dip0 - - case 0x40000a: - case 0x40000b: - return DrvDips[((address & 1)^1)+2]; // dip0 - - case 0x400002: - case 0x400003: - case 0x400004: - case 0x400005: - return DrvInputs[(address - 0x400002)/2] >> ((~address & 1) * 8); - - case 0x40000c: - case 0x40000d: - return DrvInputs[2] >> ((~address & 1) * 8); - } - - return 0; -} - -static void __fastcall daitorid_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0xc00000: - sound_status = data & 0x01; - return; - - case 0xc00002: - // coin lockout - return; - - case 0xc00004: - // ? - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall daitorid_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall daitorid_main_read_word(UINT32 address) -{ - switch (address) - { - case 0xc00000: - return (DrvInputs[0] & 0xff7f) | ((sound_busy & 1) << 7); - - case 0xc00002: - return DrvInputs[1]; - - case 0xc00004: - return (DrvDips[0] << 0) | (DrvDips[1] << 8); - - case 0xc00006: - return DrvInputs[2]; - } - - return 0; -} - -static UINT8 __fastcall daitorid_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xc00000: - return DrvInputs[0] >> 8; - - case 0xc00001: - return (DrvInputs[0] & 0x7f) | ((sound_busy & 1) << 7); - - case 0xc00002: - case 0xc00003: - return DrvInputs[1] >> ((~address & 1) * 8); - - case 0xc00004: - case 0xc00005: - return DrvDips[(address - 0xc00004) ^ 1]; // dip0 - - case 0xc00006: - case 0xc00007: - return DrvInputs[2] >> ((~address & 1) * 8); - } - - return 0; -} - -static UINT16 balcube_dip_read(UINT32 address) -{ - UINT16 d0 = DrvDips[0] + (DrvDips[1] * 256); - UINT16 d1 = DrvInputs[3] & 0xff; - - address = ~address & 0x1fffe; - - for (UINT32 i = 1; i < 17; i++) { - if (address == (UINT32)(1 << i)) { - return (((d0 >> (i - 1)) & 1) * 0x40) + (((d1 >> (i - 1)) & 1) * 0x80); - } - } - - return 0xffff; -} - -static void __fastcall msgogo_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x200002: - case 0x200004: - case 0x200006: - case 0x200008: - // coin lockout - return; - - case 0x400000: - case 0x400004: - case 0x400008: - BurnYMF278BSelectRegister((address / 4) & 3, data & 0xff); - return; - - case 0x400002: - case 0x400006: - case 0x40000a: - BurnYMF278BWriteRegister((address / 4) & 3, data & 0xff); - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall msgogo_main_write_byte(UINT32 address, UINT8 data) -{ - - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); - - switch (address) - { - case 0x400001: - case 0x400003: - case 0x400005: - BurnYMF278BSelectRegister((address / 2) & 3, data & 0xff); - return; - - case 0x400007: - case 0x400009: - case 0x40000b: - BurnYMF278BWriteRegister(((address - 0x400007)/2) & 3, data & 0xff); - return; - } -} - -static UINT16 __fastcall msgogo_main_read_word(UINT32 address) -{ - if ((address & 0xfe0000) == 0x300000) { - return balcube_dip_read(address); - } - - switch (address) - { - case 0x400000: - return BurnYMF278BReadStatus(); - - case 0x200000: - return DrvInputs[0]; - - case 0x200002: - return DrvInputs[1]; - - case 0x200006: - return 0; - } - - bprintf (0, _T("RW %5.5x\n"), address); - - return 0; -} - -static UINT8 __fastcall msgogo_main_read_byte(UINT32 address) -{ - if ((address & 0xfe0000) == 0x300000) { - return balcube_dip_read(address); - } - - switch (address) - { - case 0x400001: - return BurnYMF278BReadStatus(); - - case 0x200000: - return DrvInputs[0] >> 8; - - case 0x200001: - return DrvInputs[0]; - - case 0x200002: - return DrvInputs[1] >> 8; - - case 0x200003: - return DrvInputs[1]; - - case 0x200006: - return 0; - - case 0x200007: - return 0; - } - - return 0; -} - -static void __fastcall balcube_main_write_word(UINT32 address, UINT16 data) -{ -// bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); - - switch (address) - { - case 0x500002: - case 0x500004: - case 0x500006: - case 0x500008: - // coin lockout - return; - - case 0x300000: - case 0x300004: - case 0x300008: - BurnYMF278BSelectRegister((address / 4) & 3, data & 0xff); - return; - - case 0x300002: - case 0x300006: - case 0x30000a: - BurnYMF278BWriteRegister((address / 4) & 3, data & 0xff); - return; - } -} - -static void __fastcall balcube_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); - - switch (address) - { - case 0x300001: - case 0x300003: - case 0x300005: - BurnYMF278BSelectRegister((address / 4) & 3, data & 0xff); - return; - - case 0x300007: - case 0x300009: - case 0x30000b: - BurnYMF278BWriteRegister((address / 4) & 3, data & 0xff); - return; - } -} - -static UINT16 __fastcall balcube_main_read_word(UINT32 address) -{ - if ((address & 0xfe0000) == 0x400000) { - return balcube_dip_read(address); - } - - switch (address) - { - case 0x300000: - return BurnYMF278BReadStatus(); - - case 0x500000: - return DrvInputs[0]; - - case 0x500002: - return DrvInputs[1]; - - case 0x500006: - return 0; - } - - bprintf (0, _T("RW %5.5x\n"), address); - - return 0; -} - -static UINT8 __fastcall balcube_main_read_byte(UINT32 address) -{ -// bprintf (0, _T("RB %5.5x\n"), address); - - if ((address & 0xfe0000) == 0x400000) { - return balcube_dip_read(address); - } - - switch (address) - { - case 0x300001: - return BurnYMF278BReadStatus(); - - case 0x500000: - return DrvInputs[0] >> 8; - - case 0x500001: - return DrvInputs[0]; - - case 0x500002: - return DrvInputs[1] >> 8; - - case 0x500003: - return DrvInputs[1]; - - case 0x500006: - return 0; - - case 0x500007: - return 0; - } - - return 0; -} - -static void __fastcall bangball_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0xd00002: - case 0xd00004: - case 0xd00006: - case 0xd00008: - // coin lockout - return; - - case 0xb00000: - case 0xb00004: - case 0xb00008: - BurnYMF278BSelectRegister((address / 4) & 3, data & 0xff); - return; - - case 0xb00002: - case 0xb00006: - case 0xb0000a: - BurnYMF278BWriteRegister((address / 4) & 3, data & 0xff); - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall bangball_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); - switch (address) - { - case 0xb00001: - case 0xb00003: - case 0xb00005: - BurnYMF278BSelectRegister((address / 2) & 3, data & 0xff); - return; - - case 0xb00007: - case 0xb00009: - case 0xb0000b: - BurnYMF278BWriteRegister(((address - 0xb00007)/2) & 3, data & 0xff); - return; - } -} - -static UINT16 __fastcall bangball_main_read_word(UINT32 address) -{ - if ((address & 0xfe0000) == 0xc00000) { - return balcube_dip_read(address); - } - - switch (address) - { - case 0xb00000: - return BurnYMF278BReadStatus(); - - case 0xd00000: - return DrvInputs[0]; - - case 0xd00002: - return DrvInputs[1]; - - case 0xd00006: - return 0; - } - - bprintf (0, _T("RW %5.5x\n"), address); - - return 0; -} - -static UINT8 __fastcall bangball_main_read_byte(UINT32 address) -{ - if ((address & 0xfe0000) == 0xc00000) { - return balcube_dip_read(address); - } - - switch (address) - { - case 0xb00001: - return BurnYMF278BReadStatus(); - - case 0xd00000: - return DrvInputs[0] >> 8; - - case 0xd00001: - return DrvInputs[0]; - - case 0xd00002: - return DrvInputs[1] >> 8; - - case 0xd00003: - return DrvInputs[1]; - - case 0xd00006: - return 0; - - case 0xd00007: - return 0; - } - - return 0; -} - -static UINT16 __fastcall batlbubl_main_read_word(UINT32 address) -{ - if ((address & 0xfe0000) == 0x300000) { - return balcube_dip_read(address); - } - - switch (address) - { - case 0x400000: - return BurnYMF278BReadStatus(); - - case 0x200000: - return DrvInputs[1]; - - case 0x200002: - return DrvDips[0] + (DrvDips[1] * 256); - - case 0x200004: - return DrvInputs[0]; - - case 0x200006: - return DrvInputs[2]; - } - - bprintf (0, _T("RW %5.5x\n"), address); - - return 0; -} - -static UINT8 __fastcall batlbubl_main_read_byte(UINT32 address) -{ - if ((address & 0xfe0000) == 0x300000) { - return balcube_dip_read(address); - } - - switch (address) - { - case 0x400001: - return BurnYMF278BReadStatus(); - - case 0x200000: - return DrvInputs[1] >> 8; - - case 0x200001: - return DrvInputs[1]; - - case 0x200002: - return DrvDips[1]; - - case 0x200003: - return DrvDips[0]; - - case 0x200004: - return DrvInputs[0] >> 8; - - case 0x200005: - return DrvInputs[0]; - - case 0x200006: - return DrvInputs[2] >> 8; - - case 0x200007: - return DrvInputs[2]; - } - - return 0; -} - - -static void __fastcall kokushi_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0xc00000: - sound_status = data & 0x01; - return; - - case 0xc00002: - case 0xc00004: - case 0xc00006: - case 0xc00008: - // coin lockout - return; - } - - bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); -} - -static void __fastcall kokushi_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("WB %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall kokushi_main_read_word(UINT32 address) -{ - switch (address) - { - case 0xc00000: - return (DrvInputs[0] & 0xff7f) | ((sound_busy & 1) << 7); - - case 0xc00002: - return DrvInputs[1]; - - case 0xc00004: - return DrvDips[0] + (DrvDips[1] * 256); - } - - bprintf (0, _T("RW %5.5x\n"), address); - - return 0; -} - -static UINT8 __fastcall kokushi_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xc00000: - return DrvInputs[0] >> 8; - - case 0xc00001: - return (DrvInputs[0] & 0x7f) | ((sound_busy & 1) << 7); - - case 0xc00002: - return DrvInputs[1] >> 8; - - case 0xc00003: - return DrvInputs[1]; - - case 0xc00004: - return DrvDips[1]; - - case 0xc00005: - return DrvDips[0]; - } - - bprintf (0, _T("RB %5.5x\n"), address); - - return 0; -} - - -static void z80_bankswitch(INT32 data) -{ - INT32 bank = (data & 0x3) * 0x4000 + 0x10000; - - ZetMapMemory(DrvZ80ROM + bank, 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall blzntrnd_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - z80_bankswitch(data); - return; - - case 0x80: - case 0x81: - case 0x82: - case 0x83: - BurnYM2610Write(port & 3, data); - return; - } -} - -static UINT8 __fastcall blzntrnd_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x40: - return soundlatch; - - case 0x80: - case 0x81: - case 0x82: - case 0x83: - return BurnYM2610Read(port & 3); - } - - return 0; -} - -static void pBlzntrnd_roz_callback(INT32 offset, UINT16 *ram, INT32 *code, INT32 *color, INT32 *, INT32 *, INT32 *, INT32 *) -{ - *code = ram[offset] & 0x7fff; - *color = 0xe00; -} - -static void pGstrik2_roz_callback(INT32 offset, UINT16 *ram, INT32 *code, INT32 *color, INT32 *sx, INT32 *sy, INT32 *, INT32 *) -{ - //bprintf(0, _T("%X,"), offset); - /**sy = (offset >> 9) & 0x3f; - *sy += (offset & 1) << 6; - *sy += (offset & 0x100) >> 1; - *sy *= 16; - - *sx = (offset >> 1) & 0x7f; - *sx *= 16; */ - int val; - int row = *sy; - int col = *sx; - - val = (row & 0x3f) * (256 * 2) + (col * 2); - - if (row & 0x40) val += 1; - if (row & 0x80) val += 256; - - *code = (ram[val] & 0x7fff) >> 2; - *color = 0xe00; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - SekSetIRQLine(2, nStatus ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); - SekRun(100); // lame hack for overlapped irq's causing the ymf278b timer to die -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)SekTotalCycles() * nSoundRate / 16000000; -} - -static void blzntrndFMIRQHandler(INT32, INT32 nStatus) -{ - if (ZetGetActive() == -1) return; - - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 blzntrndSynchroniseStream(INT32 nSoundRate) -{ - if (ZetGetActive() == -1) return 0; - - return (INT64)ZetTotalCycles() * nSoundRate / 8000000; -} - -static double blzntrndGetTime() -{ - if (ZetGetActive() == -1) return 0; - - return (double)ZetTotalCycles() / 8000000.0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - if (sound_system == 1) { - ZetOpen(0); - ZetReset(); - BurnYM2610Reset(); - ZetClose(); - } - - if (sound_system == 2) { - upd7810Reset(); - BurnYM2413Reset(); - MSM6295Reset(0); - } - - if (sound_system == 3) { - SekOpen(0); - BurnYMF278BReset(); - SekClose(); - } - - if (sound_system == 4) { - BurnYM2413Reset(); - MSM6295Reset(0); - } - - if (sound_system == 5) { - upd7810Reset(); - BurnYM2151Reset(); - MSM6295Reset(0); - } - - if (has_zoom) { - K053936Reset(); - } - - memset (requested_int, 0, 8); - - gfxrom_bank=0; - soundlatch=0; - sound_status=0; - sound_busy=0; - updportA_data = 0; - updportB_data = 0; - irq_enable = 0; - screen_control = 0; - flip_screen = 0; - blit_timer = -1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x200000; - - DrvUpdROM = Next; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM = Next; Next += graphics_length; - DrvGfxROM0 = Next; Next += graphics_length*2; - - DrvRozROM = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvYMROMA = Next; Next += 0x200000; - DrvYMROMB = Next; Next += 0x400000; - - konami_palette32 = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM0 = Next; Next += 0x020000; - DrvVidRAM1 = Next; Next += 0x020000; - DrvVidRAM2 = Next; Next += 0x020000; - DrvUnkRAM = Next; Next += 0x010000; - Drv68KRAM0 = Next; Next += 0x002000; - Drv68KRAM1 = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x001000; - DrvTileRAM = Next; Next += 0x000800; - DrvK053936RAM = Next; Next += 0x040000; - DrvK053936LRAM = Next; Next += 0x001000; - DrvK053936CRAM = Next; Next += 0x000400; - - DrvUpdRAM = Next; - DrvZ80RAM = Next; Next += 0x002000; - - DrvWindow = Next; Next += 0x000010; - DrvScroll = Next; Next += 0x000010; - DrvVidRegs = Next; Next += 0x000020; - DrvBlitter = Next; Next += 0x000010; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void expand_4bpp(INT32 len) -{ - for (INT32 i = 0; i < len; i++) - { - DrvGfxROM0[i*2+1] = DrvGfxROM[i] >> 4; - DrvGfxROM0[i*2+0] = DrvGfxROM[i] & 0xf; - } -} - -static INT32 blzntrndInit() -{ - graphics_length = 0x1800000; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0100000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x0000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM + 0x0000000, 5, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000002, 6, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000004, 7, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000006, 8, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0800000, 9, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0800002, 10, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0800004, 11, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0800006, 12, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x1000000, 13, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x1000002, 14, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x1000004, 15, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x1000006, 16, 8, LD_GROUP(2))) return 1; - - expand_4bpp(graphics_length); - - if (BurnLoadRom(DrvRozROM + 0x0000000, 17, 1)) return 1; - - if (BurnLoadRom(DrvYMROMA + 0x0000000, 18, 1)) return 1; - - if (BurnLoadRom(DrvYMROMB + 0x0000000, 19, 1)) return 1; - if (BurnLoadRom(DrvYMROMB + 0x0200000, 20, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - metro_common_map_ram(0x200000, 0xf00000); - SekMapMemory(DrvK053936RAM, 0x400000, 0x43ffff, MAP_RAM); - SekMapMemory(DrvK053936LRAM, 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(DrvK053936CRAM, 0x600000, 0x6003ff, MAP_RAM); - SekSetWriteWordHandler(0, blzntrnd_main_write_word); - SekSetWriteByteHandler(0, blzntrnd_main_write_byte); - SekSetReadWordHandler(0, blzntrnd_main_read_word); - SekSetReadByteHandler(0, blzntrnd_main_read_byte); - SekClose(); - - sound_system = 1; - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xe000, 0xffff, MAP_RAM); - ZetSetOutHandler(blzntrnd_sound_write_port); - ZetSetInHandler(blzntrnd_sound_read_port); - ZetClose(); - - INT32 RomSndSizeA = 0x80000; - INT32 RomSndSizeB = 0x400000; - BurnYM2610Init(8000000, DrvYMROMB, &RomSndSizeB, DrvYMROMA, &RomSndSizeA, &blzntrndFMIRQHandler, blzntrndSynchroniseStream, blzntrndGetTime, 0); - BurnTimerAttachZet(8000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - K053936Init(0, DrvK053936RAM, 0x40000, 256 * 8, 512 * 8, pBlzntrnd_roz_callback); - K053936SetOffset(0, -69-8, -21); - - m_sprite_xoffs_dx = 0; - m_sprite_yoffs_dx = 0; - m_tilemap_scrolldx[0] = m_tilemap_scrolldx[1] = m_tilemap_scrolldx[2] = 0; - vblank_bit = 0; - irq_line = 1; - blitter_bit = 0; - support_8bpp = 1; - support_16x16 = 1; - has_zoom = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 gstrik2Init() -{ - graphics_length = 0x1000000; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0100000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x0000000, 4, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM + 0x0000000, 5, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000002, 6, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000004, 7, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000006, 8, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0800000, 9, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0800002, 10, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0800004, 11, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0800006, 12, 8, LD_GROUP(2))) return 1; - - expand_4bpp(graphics_length); - - if (BurnLoadRom(DrvRozROM + 0x0000000, 13, 1)) return 1; - - if (BurnLoadRom(DrvYMROMA + 0x0000000, 14, 1)) return 1; - - if (BurnLoadRom(DrvYMROMB + 0x0000000, 15, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - metro_common_map_ram(0x200000, 0xf00000); - SekMapMemory(DrvK053936RAM, 0x400000, 0x43ffff, MAP_RAM); - SekMapMemory(DrvK053936LRAM, 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(DrvK053936CRAM, 0x600000, 0x6003ff, MAP_RAM); - SekSetWriteWordHandler(0, blzntrnd_main_write_word); - SekSetWriteByteHandler(0, blzntrnd_main_write_byte); - SekSetReadWordHandler(0, blzntrnd_main_read_word); - SekSetReadByteHandler(0, blzntrnd_main_read_byte); - SekClose(); - - sound_system = 1; - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xe000, 0xffff, MAP_RAM); - ZetSetOutHandler(blzntrnd_sound_write_port); - ZetSetInHandler(blzntrnd_sound_read_port); - ZetClose(); - - INT32 RomSndSizeA = 0x200000; - INT32 RomSndSizeB = 0x200000; - BurnYM2610Init(8000000, DrvYMROMB, &RomSndSizeB, DrvYMROMA, &RomSndSizeA, &blzntrndFMIRQHandler, blzntrndSynchroniseStream, blzntrndGetTime, 0); - BurnTimerAttachZet(8000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - K053936Init(0, DrvK053936RAM, 0x40000, 128 * 16, 256 * 16, pGstrik2_roz_callback); - K053936SetOffset(0, -69, -19); - - m_sprite_xoffs_dx = 0; - m_sprite_yoffs_dx = 0; - m_tilemap_scrolldx[0] = m_tilemap_scrolldx[1] = m_tilemap_scrolldx[2] = 8; - - vblank_bit = 0; - irq_line = 1; - blitter_bit = 0; - support_8bpp = 1; - support_16x16 = 1; - has_zoom = 2; - - DrvDoReset(); - - return 0; -} - -static INT32 metro_upd7810_callback(INT32 , INT32 ) -{ - UINT8 ret = soundlatch & 1; - - soundlatch >>= 1; - - return ret; -} - - -static void metro_sound_bankswitch(INT32 data) -{ - INT32 bank = ((data >> 4) & 0x7) * 0x4000; - - upd7810MapMemory(DrvUpdROM + bank, 0x4000, 0x7fff, MAP_ROM); -} - -static void metro_portB_write(UINT8 data) -{ - if (BIT(updportB_data, 7) && !BIT(data, 7)) - { - sound_busy = 0; - updportB_data = data; - return; - } - - if (BIT(updportB_data, 5) && !BIT(data, 5)) - { - if (!BIT(data, 2)) - { - BurnYM2413Write(BIT(data,1), updportA_data); - } - updportB_data = data; - return; - } - - if (BIT(updportB_data, 2) && !BIT(data, 2)) - { - if (!BIT(data, 4)) - MSM6295Command(0, updportA_data); - } - - updportB_data = data; -} - -static void ym2151_portB_write(UINT8 data) -{ - if (BIT(updportB_data, 7) && !BIT(data, 7)) /* clock 1->0 */ - { - sound_busy = 0; - updportB_data = data; - return; - } - - if (BIT(updportB_data, 6) && !BIT(data, 6)) /* clock 1->0 */ - { - if (!BIT(data, 2)) - { - if (BIT(data,1)) { - BurnYM2151WriteRegister(updportA_data); - } else { - BurnYM2151SelectRegister(updportA_data); - } - /* write */ - // downcast(m_ymsnd.target())->write(space, BIT(data, 1), updportA_data); - } - - if (!BIT(data, 3)) - { - /* read */ - updportA_data = (BIT(data,1) ? BurnYM2151ReadStatus() : 0xff); - } - - updportB_data = data; - return; - } - - if (BIT(updportB_data, 2) && !BIT(data, 2)) /* clock 1->0 */ - { - if (!BIT(data, 4)) - MSM6295Command(0, updportA_data); - } - - if (BIT(updportB_data, 3) && !BIT(data, 3)) /* clock 1->0 */ - { - if (!BIT(data, 4)) - updportA_data = MSM6295ReadStatus(0); - } - - updportB_data = data; -} - -static UINT8 metro_upd7810_read_port(UINT8 port) -{ -// bprintf (0, _T("IOR: %4.4x\n"), port); - switch (port) - { - case UPD7810_PORTA: - return updportA_data; - } - - return 0; -} - -static void metro_upd7810_write_port(UINT8 port, UINT8 data) -{ -// //bprintf (0, _T("IOW: %4.4x, %2.2x\n"), port, data); - switch (port) - { - case UPD7810_PORTA: - updportA_data = data; - return; - - case UPD7810_PORTB: - metro_portB_write(data); - return; - - case UPD7810_PORTC: - metro_sound_bankswitch(data); - return; - } -} - -static void ym2151_upd7810_write_port(UINT8 port, UINT8 data) -{ -// bprintf (0, _T("IOW: %4.4x, %2.2x\n"), port, data); - switch (port) - { - case UPD7810_PORTA: - updportA_data = data; - return; - - case UPD7810_PORTB: - ym2151_portB_write(data); - return; - - case UPD7810_PORTC: - metro_sound_bankswitch(data); - return; - } -} - - -static void YM2151IrqHandler(INT32 status) -{ -//bprintf (0, _T("irq in\n")); - upd7810SetIRQLine(UPD7810_INTF2, (status) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -//bprintf (0, _T("irq out\n")); -} - - -static INT32 common_type1_init(INT32 video_type, INT32 gfx_len, INT32 load_roms, void (*pMapCallback)(), void (*pRomCallback)(), INT32 sound_type) -{ - graphics_length = gfx_len; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (load_roms == 1) - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvUpdROM + 0x0000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x0000000, 3, 8)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000001, 4, 8)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000002, 5, 8)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000003, 6, 8)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000004, 7, 8)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000005, 8, 8)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000006, 9, 8)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0000007, 10, 8)) return 1; - - if (BurnLoadRom(DrvYMROMA + 0x0000000, 11, 1)) return 1; - } - else if (load_roms == 2) - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvUpdROM + 0x0000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM + 0x0000000, 3, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000002, 4, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000004, 5, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000006, 6, 8, LD_GROUP(2))) return 1; - - if (BurnLoadRom(DrvYMROMA + 0x0000000, 7, 1)) return 1; - } - else if (load_roms == 3) - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM + 0x0000000, 2, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000002, 3, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000004, 4, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000006, 5, 8, LD_GROUP(2))) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x0000000, 6, 1)) return 1; - } - else if (load_roms == 4) - { - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - - if (BurnLoadRomExt(DrvGfxROM + 0x0000000, 2, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000002, 3, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000004, 4, 8, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM + 0x0000006, 5, 8, LD_GROUP(2))) return 1; - - if (BurnLoadRom(DrvYMROMB + 0x0000000, 6, 1)) return 1; - if (BurnLoadRom(DrvYMROMB + 0x0200000, 7, 1)) return 1; - } - - if (pRomCallback) { - pRomCallback(); - } - - expand_4bpp(graphics_length); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - if (pMapCallback) { - pMapCallback(); - } - SekClose(); - - sound_system = sound_type; - - if (sound_system == 2) - { - upd7810Init(metro_upd7810_callback); - upd7810MapMemory(DrvUpdROM, 0x0000, 0x3fff, MAP_ROM); - // banked rom 4000-7ff - upd7810MapMemory(DrvUpdRAM, 0x8000, 0x87ff, MAP_RAM); - upd7810MapMemory(DrvUpdRAM + 0x800, 0xff00, 0xffff, MAP_RAM); - upd7810SetReadPortHandler(metro_upd7810_read_port); - upd7810SetWritePortHandler(metro_upd7810_write_port); - - BurnYM2413Init(3579545); - BurnYM2413SetAllRoutes(0.90, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.10, BURN_SND_ROUTE_BOTH); - } - - if (sound_system == 5) - { - upd7810Init(metro_upd7810_callback); - upd7810MapMemory(DrvUpdROM, 0x0000, 0x3fff, MAP_ROM); - // banked rom 4000-7ff - upd7810MapMemory(DrvUpdRAM, 0x8000, 0x87ff, MAP_RAM); - upd7810MapMemory(DrvUpdRAM + 0x800, 0xff00, 0xffff, MAP_RAM); - upd7810SetReadPortHandler(metro_upd7810_read_port); - upd7810SetWritePortHandler(ym2151_upd7810_write_port); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&YM2151IrqHandler); - BurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - } - - if (sound_system == 3) - { - BurnYMF278BInit(0, DrvYMROMB, 0x280000, &DrvFMIRQHandler, DrvSynchroniseStream); - BurnYMF278BSetAllRoutes(0.100, BURN_SND_ROUTE_BOTH); - BurnTimerAttachSek(16000000); - } - - if (sound_system == 4) - { - BurnYM2413Init(3579545); - BurnYM2413SetAllRoutes(0.90, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - } - - // video configuration - m_sprite_xoffs_dx = 0; - m_sprite_yoffs_dx = 0; - m_tilemap_scrolldx[0] = 0; - m_tilemap_scrolldx[1] = 0; - m_tilemap_scrolldx[2] = 0; - support_8bpp = (video_type > 4100) ? 1 : 0; - support_16x16 = (video_type >= 4100) ? 1 : 0; - has_zoom = 0; - - // irq configuration - vblank_bit = 0; - irq_line = 2; - blitter_bit = 2; - - GenericTilesInit(); - KonamiAllocateBitmaps(); - - DrvDoReset(); - - return 0; -} - -static void skyalertMapCallback() -{ - metro_common_map_ram(0x800000, 0xc00000); - SekSetWriteWordHandler(0, skyalert_main_write_word); - SekSetWriteByteHandler(0, skyalert_main_write_byte); - SekSetReadWordHandler(0, skyalert_main_read_word); - SekSetReadByteHandler(0, skyalert_main_read_byte); -} - -static INT32 skyalertInit() -{ - return common_type1_init(4100, 0x200000, 1, skyalertMapCallback, NULL, 2/*udp*/); -} - -static void pangpomsMapCallback() -{ - metro_common_map_ram(0x400000, 0xc00000); - SekSetWriteWordHandler(0, pangpoms_main_write_word); - SekSetWriteByteHandler(0, pangpoms_main_write_byte); - SekSetReadWordHandler(0, pangpoms_main_read_word); - SekSetReadByteHandler(0, pangpoms_main_read_byte); -} - -static INT32 pangpomsInit() -{ - return common_type1_init(4100, 0x100000, 1, pangpomsMapCallback, NULL, 2/*udp*/); -} - -static void poittoMapCallback() -{ - metro_common_map_ram(0xc00000, 0x400000); - SekSetWriteWordHandler(0, poitto_main_write_word); - SekSetWriteByteHandler(0, poitto_main_write_byte); - SekSetReadWordHandler(0, poitto_main_read_word); - SekSetReadByteHandler(0, poitto_main_read_byte); -} - -static INT32 poittoInit() -{ - return common_type1_init(4100, 0x200000, 2, poittoMapCallback, NULL, 2/*udp*/); -} - -static void lastfortMapCallback() -{ - metro_common_map_ram(0x800000, 0x400000); - SekSetWriteWordHandler(0, lastfort_main_write_word); - SekSetWriteByteHandler(0, lastfort_main_write_byte); - SekSetReadWordHandler(0, lastfort_main_read_word); - SekSetReadByteHandler(0, lastfort_main_read_byte); -} - -static INT32 lastfortInit() -{ - main_cpu_cycles = 12000000 / 58; - - return common_type1_init(4100, 0x200000, 1, lastfortMapCallback, NULL, 2/*udp*/); -} - -static void lastforgMapCallback() -{ - metro_common_map_ram(0x880000, 0xc00000); - SekSetWriteWordHandler(0, lastforg_main_write_word); - SekSetWriteByteHandler(0, lastforg_main_write_byte); - SekSetReadWordHandler(0, lastforg_main_read_word); - SekSetReadByteHandler(0, lastforg_main_read_byte); -} - -static INT32 lastforgInit() -{ - main_cpu_cycles = 12000000 / 58; - - return common_type1_init(4100, 0x200000, 2, lastforgMapCallback, NULL, 2/*udp*/); -} - -static void dharmaMapCallback() -{ - metro_common_map_ram(0x800000, 0x400000); - SekSetWriteWordHandler(0, dharma_main_write_word); - SekSetWriteByteHandler(0, dharma_main_write_byte); - SekSetReadWordHandler(0, dharma_main_read_word); - SekSetReadByteHandler(0, dharma_main_read_byte); -} - -static void dharmaRomCallback() -{ - for (INT32 i = 0; i < 0x200000; i += 4) - { - DrvGfxROM[i + 1] = BITSWAP08(DrvGfxROM[i + 1], 7,3,2,4, 5,6,1,0); - DrvGfxROM[i + 3] = BITSWAP08(DrvGfxROM[i + 3], 7,2,5,4, 3,6,1,0); - } -} - -static INT32 dharmaInit() -{ - return common_type1_init(4200, 0x200000, 2, dharmaMapCallback, dharmaRomCallback, 2/*udp*/); -} - -static INT32 dharmajInit() -{ - return common_type1_init(4200, 0x200000, 2, dharmaMapCallback, NULL, 2/*udp*/); -} - -static void pururunMapCallback() -{ - metro_common_map_ram(0xc00000, 0x800000); - SekSetWriteWordHandler(0, pururun_main_write_word); - SekSetWriteByteHandler(0, pururun_main_write_byte); - SekSetReadWordHandler(0, pururun_main_read_word); - SekSetReadByteHandler(0, pururun_main_read_byte); -} - -static INT32 pururunInit() -{ - return common_type1_init(4200, 0x200000, 2, pururunMapCallback, NULL, 5/*udp + ym2151*/); -} - -static void karatourMapCallback() -{ - metro_common_map_ram(0x800000, 0xf00000); - SekSetWriteWordHandler(0, karatour_main_write_word); - SekSetWriteByteHandler(0, karatour_main_write_byte); - SekSetReadWordHandler(0, karatour_main_read_word); - SekSetReadByteHandler(0, karatour_main_read_byte); -} - -static INT32 karatourInit() -{ - return common_type1_init(4200, 0x400000, 2, karatourMapCallback, NULL, 2/*udp*/); -} - -static void kokushiMapCallback() -{ - metro_common_map_ram(0x800000, 0x700000); - SekSetWriteWordHandler(0, kokushi_main_write_word); - SekSetWriteByteHandler(0, kokushi_main_write_byte); - SekSetReadWordHandler(0, kokushi_main_read_word); - SekSetReadByteHandler(0, kokushi_main_read_byte); -} - -static INT32 kokushiInit() -{ - INT32 nRet = common_type1_init(4200, 0x200000, 2, kokushiMapCallback, NULL, 2/*udp*/); - - for (INT32 i = 0; i < 0x20000; i++) { - DrvVidRAM0[i] = rand(); - DrvVidRAM1[i] = rand(); - DrvVidRAM2[i] = rand(); - } - - return nRet; -} - -static void daitoridMapCallback() -{ - metro_common_map_ram(0x400000, 0x800000); - SekSetWriteWordHandler(0, daitorid_main_write_word); - SekSetWriteByteHandler(0, daitorid_main_write_byte); - SekSetReadWordHandler(0, daitorid_main_read_word); - SekSetReadByteHandler(0, daitorid_main_read_byte); -} - -static INT32 daitoridInit() -{ - main_cpu_cycles = 16000000 / 58; - - INT32 nRet = common_type1_init(4200, 0x200000, 2, daitoridMapCallback, NULL, 5/*udp + ym2151*/); - - m_tilemap_scrolldx[0] = -2; - m_tilemap_scrolldx[1] = -2; - m_tilemap_scrolldx[2] = -2; - - return nRet; -} - -static void toride2gMapCallback() -{ - metro_common_map_ram(0xc00000, 0x400000); - SekSetWriteWordHandler(0, poitto_main_write_word); - SekSetWriteByteHandler(0, poitto_main_write_byte); - SekSetReadWordHandler(0, poitto_main_read_word); - SekSetReadByteHandler(0, poitto_main_read_byte); -} - -static INT32 toride2gInit() -{ - return common_type1_init(4200, 0x200000, 2, toride2gMapCallback, NULL, 2/*udp*/); -} - -static void msgogoMapCallback() -{ - metro_common_map_ram(0x100000, 0xf00000); - SekSetWriteWordHandler(0, msgogo_main_write_word); - SekSetWriteByteHandler(0, msgogo_main_write_byte); - SekSetReadWordHandler(0, msgogo_main_read_word); - SekSetReadByteHandler(0, msgogo_main_read_byte); -} - -static void balcubeRomCallback() -{ - for (unsigned i = 0; i < graphics_length; i+=2) - { - DrvGfxROM[i] = BITSWAP08(DrvGfxROM[i],0,1,2,3,4,5,6,7); - } -} - -static INT32 msgogoInit() -{ - main_cpu_cycles = 16000000 / 60; - - INT32 nRet = common_type1_init(4200, 0x200000, 4, msgogoMapCallback, balcubeRomCallback, 3/*ymf278b*/); - - irq_line = 1; - m_tilemap_scrolldx[0] = -2; - m_tilemap_scrolldx[1] = -2; - m_tilemap_scrolldx[2] = -2; - ymf278bint = 1; - - return nRet; -} - -static INT32 daitoridaInit() -{ - INT32 rc = msgogoInit(); - - ymf278bint = 8; - - return rc; -} - -static void balcubeMapCallback() -{ - metro_common_map_ram(0x600000, 0xf00000); - SekSetWriteWordHandler(0, balcube_main_write_word); - SekSetWriteByteHandler(0, balcube_main_write_byte); - SekSetReadWordHandler(0, balcube_main_read_word); - SekSetReadByteHandler(0, balcube_main_read_byte); -} - -static INT32 balcubeInit() -{ - main_cpu_cycles = 16000000 / 60; - - INT32 nRet = common_type1_init(4200, 0x200000, 4, balcubeMapCallback, balcubeRomCallback, 3/*ymf278b*/); - - irq_line = 1; - m_tilemap_scrolldx[0] = -2; - m_tilemap_scrolldx[1] = -2; - m_tilemap_scrolldx[2] = -2; - ymf278bint = 8; - - return nRet; -} - -static void bangballMapCallback() -{ - metro_common_map_ram(0xe00000, 0xf00000); - SekSetWriteWordHandler(0, bangball_main_write_word); - SekSetWriteByteHandler(0, bangball_main_write_byte); - SekSetReadWordHandler(0, bangball_main_read_word); - SekSetReadByteHandler(0, bangball_main_read_byte); -} - -static INT32 bangballInit() -{ - main_cpu_cycles = 16000000 / 60; - - INT32 nRet = common_type1_init(4200, 0x400000, 4, bangballMapCallback, balcubeRomCallback, 3/*ymf278b*/); - - irq_line = 1; - m_tilemap_scrolldx[0] = -2; - m_tilemap_scrolldx[1] = -2; - m_tilemap_scrolldx[2] = -2; - ymf278bint = 1; - - return nRet; -} - -static void batlbublMapCallback() -{ - metro_common_map_ram(0x100000, 0xf00000); - SekSetWriteWordHandler(0, msgogo_main_write_word); - SekSetWriteByteHandler(0, msgogo_main_write_byte); - SekSetReadWordHandler(0, batlbubl_main_read_word); - SekSetReadByteHandler(0, batlbubl_main_read_byte); -} - -static void batlbublRomCallback() -{ - BurnLoadRom(Drv68KROM + 0x000000, 0, 1); - BurnLoadRom(Drv68KROM + 0x080000, 1, 1); - - balcubeRomCallback(); -} - -static INT32 batlbublInit() -{ - main_cpu_cycles = 16000000 / 60; - - INT32 nRet = common_type1_init(4200, 0x800000, 4, batlbublMapCallback, batlbublRomCallback, 3/*ymf278b*/); - - irq_line = 1; - m_tilemap_scrolldx[0] = -2; - m_tilemap_scrolldx[1] = -2; - m_tilemap_scrolldx[2] = -2; - ymf278bint = 1; - - return nRet; -} - -static INT32 DrvExit() -{ - if (sound_system == 1) { - BurnYM2610Exit(); - ZetExit(); - } - - if (sound_system == 2) { - upd7810Exit(); - MSM6295Exit(0); - MSM6295ROM = NULL; - BurnYM2413Exit(); - } - - if (sound_system == 3) { - BurnYMF278BExit(); - } - - if (sound_system == 4) { - MSM6295Exit(0); - MSM6295ROM = NULL; - BurnYM2413Exit(); - } - - if (sound_system == 5) { - upd7810Exit(); - MSM6295Exit(0); - MSM6295ROM = NULL; - BurnYM2151Exit(); - } - - KonamiICExit(); - GenericTilesExit(); - - SekExit(); - - BurnFree(AllMem); - - sound_system = 0; - has_zoom = 0; - main_cpu_cycles = 12000000 / 60; - m_sprite_yoffs_dx = 0; - m_sprite_yoffs_dx = 0; - ymf278bint = 0; - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x2000 / 2; i++) - { - INT32 r = (p[i] >> 6) & 0x1f; - INT32 g = (p[i] >> 11) & 0x1f; - INT32 b = (p[i] >> 1) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - konami_palette32[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_sprites() -{ - UINT16 *m_videoregs = (UINT16*)DrvVidRegs; - UINT16 *m_spriteram = (UINT16*)DrvSprRAM; - - INT32 m_sprite_xoffs = m_videoregs[0x06 / 2] - nScreenWidth / 2 + m_sprite_xoffs_dx; - INT32 m_sprite_yoffs = m_videoregs[0x04 / 2] - nScreenHeight / 2 + m_sprite_yoffs_dx; - - UINT8 *base_gfx4 = DrvGfxROM0; - UINT8 *base_gfx8 = DrvGfxROM; - UINT32 gfx_size = graphics_length; - - int max_x = nScreenWidth; - int max_y = nScreenHeight; - - int max_sprites = 0x1000 / 8; - int sprites = m_videoregs[0x00/2] % max_sprites; - - int color_start = (m_videoregs[0x08/2] & 0x0f) << 4; - - int i, j, pri; - static const int primask[4] = { 0x0000, 0xff00, 0xff00 | 0xf0f0, 0xff00 | 0xf0f0 | 0xcccc }; - - UINT16 *src; - int inc; - - if (sprites == 0) - return; - - for (i = 0; i < 0x20; i++) - { - if (!(m_videoregs[0x02/2] & 0x8000)) - { - src = m_spriteram + (sprites - 1) * (8 / 2); - inc = -(8 / 2); - } else { - src = m_spriteram; - inc = (8 / 2); - } - - for (j = 0; j < sprites; j++) - { - int x, y, attr, code, color, flipx, flipy, zoom, curr_pri, width, height; - - static const int zoomtable[0x40] = { - 0xAAC,0x800,0x668,0x554,0x494,0x400,0x390,0x334,0x2E8,0x2AC,0x278,0x248,0x224,0x200,0x1E0,0x1C8, - 0x1B0,0x198,0x188,0x174,0x164,0x154,0x148,0x13C,0x130,0x124,0x11C,0x110,0x108,0x100,0x0F8,0x0F0, - 0x0EC,0x0E4,0x0DC,0x0D8,0x0D4,0x0CC,0x0C8,0x0C4,0x0C0,0x0BC,0x0B8,0x0B4,0x0B0,0x0AC,0x0A8,0x0A4, - 0x0A0,0x09C,0x098,0x094,0x090,0x08C,0x088,0x080,0x078,0x070,0x068,0x060,0x058,0x050,0x048,0x040 - }; - - x = src[0]; - curr_pri = (x & 0xf800) >> 11; - - if ((curr_pri == 0x1f) || (curr_pri != i)) - { - src += inc; - continue; - } - - pri = (m_videoregs[0x02/2] & 0x0300) >> 8; - - if (!(m_videoregs[0x02/2] & 0x8000)) - { - if (curr_pri > (m_videoregs[0x02/2] & 0x1f)) - pri = (m_videoregs[0x02/2] & 0x0c00) >> 10; - } - - y = src[1]; - attr = src[2]; - code = src[3]; - - flipx = attr & 0x8000; - flipy = attr & 0x4000; - color = (attr & 0xf0) >> 4; - - zoom = zoomtable[(y & 0xfc00) >> 10] << (16 - 8); - - x = (x & 0x07ff) - m_sprite_xoffs; - y = (y & 0x03ff) - m_sprite_yoffs; - - width = (((attr >> 11) & 0x7) + 1) * 8; - height = (((attr >> 8) & 0x7) + 1) * 8; - - UINT32 gfxstart = (8 * 8 * 4 / 8) * (((attr & 0x000f) << 16) + code); - - if (flip_screen) - { - flipx = !flipx; x = max_x - x - width; - flipy = !flipy; y = max_y - y - height; - } - - if (support_8bpp && color == 0xf) /* 8bpp */ - { - if ((gfxstart + width * height - 1) >= gfx_size) - continue; - - konami_draw_16x16_priozoom_tile(base_gfx8 + gfxstart, 0, 8, color_start >> 4, 255, x, y, flipx, flipy, width, height, zoom, zoom, primask[pri]); - } - else - { - if ((gfxstart + width / 2 * height - 1) >= gfx_size*2) - continue; - - konami_draw_16x16_priozoom_tile(base_gfx4 + 2 * gfxstart, 0, 4, color + color_start, 15, x, y, flipx, flipy, width, height, zoom, zoom, primask[pri]); - } - - src += inc; - } - } -} - -inline UINT8 get_tile_pix(UINT16 code, UINT8 x, UINT8 y, INT32 big, UINT16 *pix) -{ - UINT16 *tiletable = (UINT16*)DrvTileRAM; - - INT32 table_index = (code & 0x1ff0) >> 3; - UINT32 tile = (tiletable[table_index + 0] << 16) + tiletable[table_index + 1]; - - if (code & 0x8000) - { - *pix = code & 0x0fff; - - if ((*pix & 0xf) != 0xf) - return 1; - else - return 0; - } - else if (((tile & 0x00f00000) == 0x00f00000) && (support_8bpp)) - { - UINT32 tile2 = big ? ((((tile & 0xfffff) + (8*(code & 0xf))))) : ((((tile & 0xfffff) + (2*(code & 0xf))))); - - tile2 *= (big) ? 0x80 : 0x20; // big is a guess - - if (tile2 >= graphics_length) { - return 0; - } - - const UINT8 *data = DrvGfxROM + tile2; - - switch (code & 0x6000) - { - case 0x0000: *pix = data[(y * (big?16:8)) + x]; break; - case 0x2000: *pix = data[(((big?15:7)-y) * (big?16:8)) + x]; break; - case 0x4000: *pix = data[(y * (big?16:8)) + ((big?15:7)-x)]; break; - case 0x6000: *pix = data[(((big?15:7)-y) * (big?16:8)) + ((big?15:7)-x)]; break; - } - - if (*pix == 0xff) { - return 0; - } - - *pix |= (tile & 0x0f000000) >> 16; - - return 1; - } - else - { - UINT32 tile2 = big ? ((((tile & 0xfffff) + 4*(code & 0xf))) * 0x100) : ((((tile & 0xfffff) + (code & 0xf))) * 0x40); - - if (tile2 >= (graphics_length*2)) { - return 0; - } - - const UINT8 *data = DrvGfxROM0 + tile2; - - switch (code & 0x6000) - { - case 0x0000: *pix = data[(y * (big?16:8)) + x]; break; - case 0x2000: *pix = data[(((big?15:7)-y) * (big?16:8)) + x]; break; - case 0x4000: *pix = data[(y * (big?16:8)) + ((big?15:7)-x)]; break; - case 0x6000: *pix = data[(((big?15:7)-y) * (big?16:8)) + ((big?15:7)-x)]; break; - } - - if (*pix == 0xf) { - return 0; - } - - *pix |= (tile & 0x0ff00000) >> 16; - - return 1; - } -} - -static void draw_tilemap(UINT32 ,UINT32 pcode,int sx, int sy, int wx, int wy, int big, UINT16 *tilemapram, int layer) -{ - UINT8 * priority_bitmap = konami_priority_bitmap; - - int width = big ? 4096 : 2048; - int height = big ? 4096 : 2048; - - int scrwidth = nScreenWidth; - int scrheight = nScreenHeight; - - int windowwidth = width >> 2; - int windowheight = height >> 3; - - sx += m_tilemap_scrolldx[layer] * (flip_screen ? 1 : -1); - - for (INT32 y = 0; y < scrheight; y++) - { - int scrolly = (sy+y-wy)&(windowheight-1); - int x; - UINT32 *dst; - UINT8 *priority_baseaddr; - int srcline = (wy+scrolly)&(height-1); - int srctilerow = srcline >> (big ? 4 : 3); - - if (!flip_screen) - { - dst = konami_bitmap32 + (y * nScreenWidth); - priority_baseaddr = priority_bitmap + (y * nScreenWidth); - - for (x = 0; x < scrwidth; x++) - { - int scrollx = (sx+x-wx)&(windowwidth-1); - int srccol = (wx+scrollx)&(width-1); - int srctilecol = srccol >> (big ? 4 : 3); - int tileoffs = srctilecol + srctilerow * 0x100; - - UINT16 dat = 0; - - UINT16 tile = tilemapram[tileoffs]; - UINT8 draw = get_tile_pix(tile, big ? (srccol&0xf) : (srccol&0x7), big ? (srcline&0xf) : (srcline&0x7), big, &dat); - - if (draw) - { - dst[x] = konami_palette32[dat]; - priority_baseaddr[x] = (priority_baseaddr[x] & (pcode >> 8)) | pcode; - } - } - } - else // flipped case - { - dst = konami_bitmap32 + ((scrheight-y-1) * nScreenWidth); - priority_baseaddr = priority_bitmap + ((scrheight-y-1) * nScreenWidth); - - for (x = 0; x < scrwidth; x++) - { - int scrollx = (sx+x-wx)&(windowwidth-1); - int srccol = (wx+scrollx)&(width-1); - int srctilecol = srccol >> (big ? 4 : 3); - int tileoffs = srctilecol + srctilerow * 0x100; - - UINT16 dat = 0; - - UINT16 tile = tilemapram[tileoffs]; - UINT8 draw = get_tile_pix(tile, big ? (srccol&0xf) : (srccol&0x7), big ? (srcline&0xf) : (srcline&0x7), big, &dat); - - if (draw) - { - dst[scrwidth-x-1] = konami_palette32[dat]; - priority_baseaddr[scrwidth-x-1] = (priority_baseaddr[scrwidth-x-1] & (pcode >> 8)) | pcode; - } - } - } - } -} - -static void draw_layers(int pri) -{ - UINT16 *m_videoregs = (UINT16*)DrvVidRegs; - UINT16 *m_scroll = (UINT16*)DrvScroll; - UINT16 *m_window = (UINT16*)DrvWindow; - UINT16 layers_pri = m_videoregs[0x10 / 2]; - int layer; - - for (layer = 2; layer >= 0; layer--) - { - if (pri == ((layers_pri >> (layer * 2)) & 3)) - { - UINT16 sy = m_scroll[layer * 2 + 0]; - UINT16 sx = m_scroll[layer * 2 + 1]; - UINT16 wy = m_window[layer * 2 + 0]; - UINT16 wx = m_window[layer * 2 + 1]; - - UINT16 *tilemapram = NULL; - - switch (layer) - { - case 0: tilemapram = (UINT16*)DrvVidRAM0; break; - case 1: tilemapram = (UINT16*)DrvVidRAM1; break; - case 2: tilemapram = (UINT16*)DrvVidRAM2; break; - } - - int big = support_16x16 && (screen_control & (0x0020 << layer)); - - draw_tilemap(0, 1 << (3 - pri), sx, sy, wx, wy, big, tilemapram, layer); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) - { - DrvPaletteUpdate(); - DrvRecalc = 0; - } - - UINT16 *videoregs = (UINT16*)DrvVidRegs; - - KonamiClearBitmaps(konami_palette32[videoregs[0x12/2] & 0x0fff]); - - if ((screen_control & 2) == 0) - { - flip_screen = screen_control & 1; - - if (has_zoom == 1) K053936PredrawTiles3(0, DrvRozROM, 8, 8, 0); - if (has_zoom == 2) K053936PredrawTiles3(0, DrvRozROM, 16, 16, 0); - - if (has_zoom && (nBurnLayer & 1)) K053936Draw(0, (UINT16*)DrvK053936CRAM, (UINT16*)DrvK053936LRAM, (1 << 8) | 0); - - { - for (INT32 pri = 3; pri >= 0; pri--) - { - if (nBurnLayer & 2) draw_layers(pri); - } - } - - if (nBurnLayer & 4) draw_sprites(); - } - - KonamiBlendCopy(konami_palette32); - - return 0; -} - -static INT32 Z80Frame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3 * sizeof(short)); - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - if (DrvJoy3[0]) DrvInputs[2] ^= 0x02; - } - - SekNewFrame(); - ZetNewFrame(); - - INT32 nInterleave = 240; - INT32 nCyclesTotal[2] = { 16000000 / 58, 8000000 / 58 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekRun(nCyclesTotal[0] / nInterleave); - - if ((i % 28) == 26) { - requested_int[4] = 1; - update_irq_state(); - } - - if (i == 236) { - requested_int[vblank_bit] = 1; - requested_int[5] = 1; - update_irq_state(); - SekRun(500); - requested_int[5] = 0; - } - - BurnTimerUpdate((nCyclesTotal[1] * (i + 1)) / nInterleave); - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 NoZ80Frame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 4 * sizeof(short)); - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - SekNewFrame(); - upd7810NewFrame(); - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 240; - UINT32 nCyclesTotal[2] = { main_cpu_cycles, main_cpu_cycles }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekRun((nCyclesTotal[0] / nInterleave)); - - if (sound_system == 2 || sound_system == 5) { - upd7810Run((nCyclesTotal[1] / nInterleave)); - } - - if (i == 0 && requested_int[5] == 1) { - requested_int[5] = 0; - } - - if ((i % 28) == 0) { - requested_int[4] = 1; - update_irq_state(); - } - - if (i == 236) - { - requested_int[vblank_bit] = 1; - requested_int[5] = 1; - update_irq_state(); - } - - if (blit_timer >= 1) { - if (blit_timer == 0) { - update_irq_state(); - } - blit_timer--; - } - - if (pBurnSoundOut && (sound_system == 2 || sound_system == 4)) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2413Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - if (pBurnSoundOut && (sound_system == 5)) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut && (sound_system == 2 || sound_system == 4)) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2413Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnSoundOut && (sound_system == 5)) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 YMF278bFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 4 * sizeof(short)); - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - SekNewFrame(); - - INT32 nInterleave = 240; - UINT32 nCyclesTotal[1] = { main_cpu_cycles }; - - SekOpen(0); - - INT32 sound_int_mod = (ymf278bint == 1) ? sound_int_mod = nInterleave : 28; - - for (INT32 i = 0; i < nInterleave; i++) - { - BurnTimerUpdate((i + 1) * (nCyclesTotal[0] / nInterleave)); - - if ((i % sound_int_mod) == 0) { - requested_int[4] = 1; - update_irq_state(); - } - - if (i == 237) { - requested_int[vblank_bit] = 1; - update_irq_state(); - } - - if (blit_timer >= 0) { - if (blit_timer == 0) { - update_irq_state(); - } - blit_timer--; - } - } - - BurnTimerEndFrame(nCyclesTotal[0]); - - if (pBurnSoundOut) { - BurnYMF278BUpdate(nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_ROM) - { - ba.Data = Drv68KROM; - ba.nLen = 0x0200000; - ba.nAddress = 0; - ba.szName = "68K ROM"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) - { - ba.Data = DrvVidRAM0; - ba.nLen = 0x0020000; - ba.nAddress = 0x200000; - ba.szName = "Bg RAM 0"; - BurnAcb(&ba); - - ba.Data = DrvVidRAM1; - ba.nLen = 0x0020000; - ba.nAddress = 0x220000; - ba.szName = "Bg RAM 1"; - BurnAcb(&ba); - - ba.Data = DrvVidRAM2; - ba.nLen = 0x0020000; - ba.nAddress = 0x240000; - ba.szName = "Bg RAM 2"; - BurnAcb(&ba); - - ba.Data = DrvUnkRAM; - ba.nLen = 0x0010000; - ba.nAddress = 0x260000; - ba.szName = "Unk RAM"; - BurnAcb(&ba); - - ba.Data = Drv68KRAM0; - ba.nLen = 0x0002000; - ba.nAddress = 0x270000; - ba.szName = "68K RAM 0"; - BurnAcb(&ba); - - ba.Data = Drv68KRAM1; - ba.nLen = 0x0010000; - ba.nAddress = 0x300000; - ba.szName = "68K RAM 1"; - BurnAcb(&ba); - - ba.Data = DrvPalRAM; - ba.nLen = 0x0002000; - ba.nAddress = 0x272000; - ba.szName = "Palette RAM"; - BurnAcb(&ba); - - ba.Data = DrvSprRAM; - ba.nLen = 0x0001000; - ba.nAddress = 0x274000; - ba.szName = "Sprite RAM"; - BurnAcb(&ba); - - ba.Data = DrvTileRAM; - ba.nLen = 0x0000800; - ba.nAddress = 0x278000; - ba.szName = "Tile RAM"; - BurnAcb(&ba); - - ba.Data = DrvZ80RAM; - ba.nLen = 0x0002000; - ba.nAddress = 0xff000000; - ba.szName = "z80 / Upd RAM"; - BurnAcb(&ba); - - ba.Data = DrvWindow; - ba.nLen = 0x000010; - ba.nAddress = 0x278800; - ba.szName = "Window Regs"; - BurnAcb(&ba); - - ba.Data = DrvScroll; - ba.nLen = 0x000010; - ba.nAddress = 0x278810; - ba.szName = "Scroll Regs"; - BurnAcb(&ba); - - ba.Data = DrvVidRegs; - ba.nLen = 0x000020; - ba.nAddress = 0x278820; - ba.szName = "Video Regs"; - BurnAcb(&ba); - - ba.Data = DrvBlitter; - ba.nLen = 0x000010; - ba.nAddress = 0x278840; - ba.szName = "Blitter Regs"; - BurnAcb(&ba); - - if (has_zoom) - { - ba.Data = DrvK053936RAM; - ba.nLen = 0x0040000; - ba.nAddress = 0x400000; - ba.szName = "K053936 RAM"; - BurnAcb(&ba); - - ba.Data = DrvK053936LRAM; - ba.nLen = 0x0001000; - ba.nAddress = 0x500000; - ba.szName = "K053936 Line RAM"; - BurnAcb(&ba); - - ba.Data = DrvK053936CRAM; - ba.nLen = 0x0000400; - ba.nAddress = 0x600000; - ba.szName = "K053936 Ctrl RAM"; - BurnAcb(&ba); - } - } - - if (nAction & ACB_VOLATILE) - { - SekScan(nAction); - - if (sound_system == 1) - { - ZetScan(nAction); - - ZetOpen(0); - BurnYM2610Scan(nAction, pnMin); - ZetClose(); - } - - if (sound_system == 2) - { - upd7810Scan(nAction); - BurnYM2413Scan(nAction); - MSM6295Scan(0, nAction); - } - - if (sound_system == 3) - { - BurnYMF278BScan(nAction, pnMin); - } - - if (sound_system == 4) - { - BurnYM2413Scan(nAction); - MSM6295Scan(0, nAction); - } - - if (sound_system == 5) - { - upd7810Scan(nAction); - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - } - - KonamiICScan(nAction); - - SCAN_VAR(gfxrom_bank); - SCAN_VAR(soundlatch); - SCAN_VAR(irq_enable); - SCAN_VAR(screen_control); - SCAN_VAR(requested_int); - SCAN_VAR(flip_screen); - SCAN_VAR(irq_levels); - SCAN_VAR(blit_timer); - - SCAN_VAR(sound_status); - SCAN_VAR(sound_busy); - SCAN_VAR(updportA_data); - SCAN_VAR(updportB_data); - } - - return 0; -} - - -// Blazing Tornado - -static struct BurnRomInfo blzntrndRomDesc[] = { - { "1k.bin", 0x080000, 0xb007893b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2k.bin", 0x080000, 0xec173252, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3k.bin", 0x080000, 0x1e230ba2, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4k.bin", 0x080000, 0xe98ca99e, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "rom5.bin", 0x020000, 0x7e90b774, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "rom142.bin", 0x200000, 0xa7200598, 3 | BRF_GRA }, // 5 Graphics - { "rom186.bin", 0x200000, 0x6ee28ea7, 3 | BRF_GRA }, // 6 - { "rom131.bin", 0x200000, 0xc77e75d3, 3 | BRF_GRA }, // 7 - { "rom175.bin", 0x200000, 0x04a84f9b, 3 | BRF_GRA }, // 8 - { "rom242.bin", 0x200000, 0x1182463f, 3 | BRF_GRA }, // 9 - { "rom286.bin", 0x200000, 0x384424fc, 3 | BRF_GRA }, // 10 - { "rom231.bin", 0x200000, 0xf0812362, 3 | BRF_GRA }, // 11 - { "rom275.bin", 0x200000, 0x184cb129, 3 | BRF_GRA }, // 12 - { "rom342.bin", 0x200000, 0xe527fee5, 3 | BRF_GRA }, // 13 - { "rom386.bin", 0x200000, 0xd10b1401, 3 | BRF_GRA }, // 14 - { "rom331.bin", 0x200000, 0x4d909c28, 3 | BRF_GRA }, // 15 - { "rom375.bin", 0x200000, 0x6eb4f97c, 3 | BRF_GRA }, // 16 - - { "rom9.bin", 0x200000, 0x37ca3570, 4 | BRF_GRA }, // 17 Roz tiles - - { "rom8.bin", 0x080000, 0x565a4086, 5 | BRF_SND }, // 18 YM2610 Delta T Samples - - { "rom6.bin", 0x200000, 0x8b8819fc, 6 | BRF_SND }, // 19 YM2610 Samples - { "rom7.bin", 0x200000, 0x0089a52b, 6 | BRF_SND }, // 20 -}; - -STD_ROM_PICK(blzntrnd) -STD_ROM_FN(blzntrnd) - -struct BurnDriver BurnDrvBlzntrnd = { - "blzntrnd", NULL, NULL, NULL, "1994", - "Blazing Tornado\0", NULL, "Human Amusement", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, blzntrndRomInfo, blzntrndRomName, NULL, NULL, BlzntrndInputInfo, BlzntrndDIPInfo, - blzntrndInit, DrvExit, Z80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 304, 224, 4, 3 -}; - - -// Grand Striker 2 (Europe and Oceania) - -static struct BurnRomInfo gstrik2RomDesc[] = { - { "hum_003_g2f.rom1.u107", 0x080000, 0x2712d9ca, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "hum_003_g2f.rom2.u108", 0x080000, 0x86785c64, 1 | BRF_PRG | BRF_ESS }, // 1 - { "prg2.109", 0x080000, 0xead86919, 1 | BRF_PRG | BRF_ESS }, // 2 - { "prg3.110", 0x080000, 0xe0b026e3, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sprg.30", 0x020000, 0xaeef6045, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "chr0.80", 0x200000, 0xf63a52a9, 3 | BRF_GRA }, // 5 Graphics - { "chr1.79", 0x200000, 0x4110c184, 3 | BRF_GRA }, // 6 - { "chr2.78", 0x200000, 0xddb4b9ee, 3 | BRF_GRA }, // 7 - { "chr3.77", 0x200000, 0x5ab367db, 3 | BRF_GRA }, // 8 - { "chr4.84", 0x200000, 0x77d7ef99, 3 | BRF_GRA }, // 9 - { "chr5.83", 0x200000, 0xa4d49e95, 3 | BRF_GRA }, // 10 - { "chr6.82", 0x200000, 0x32eb33b0, 3 | BRF_GRA }, // 11 - { "chr7.81", 0x200000, 0x2d30a21e, 3 | BRF_GRA }, // 12 - - { "psacrom.60", 0x200000, 0x73f1f279, 4 | BRF_GRA }, // 13 Roz tiles - - { "sndpcm-b.22", 0x200000, 0xa5d844d2, 5 | BRF_SND }, // 14 YM2610 Delta T Samples - - { "sndpcm-a.23", 0x200000, 0xe6d32373, 6 | BRF_SND }, // 15 YM2610 Samples -}; - -STD_ROM_PICK(gstrik2) -STD_ROM_FN(gstrik2) - -struct BurnDriverD BurnDrvGstrik2 = { - "gstrik2", NULL, NULL, NULL, "1996", - "Grand Striker 2 (Europe and Oceania)\0", "ROZ layer broken", "Human Amusement", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_POST90S, GBF_SPORTSFOOTBALL, 0, - NULL, gstrik2RomInfo, gstrik2RomName, NULL, NULL, Gstrik2InputInfo, Gstrik2DIPInfo, - gstrik2Init, DrvExit, Z80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 304, 224, 4, 3 -}; - - -// Grand Striker 2 (Japan) - -static struct BurnRomInfo gstrik2jRomDesc[] = { - { "prg0.107", 0x080000, 0xe60a8c19, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "prg1.108", 0x080000, 0x853f6f7c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "prg2.109", 0x080000, 0xead86919, 1 | BRF_PRG | BRF_ESS }, // 2 - { "prg3.110", 0x080000, 0xe0b026e3, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "sprg.30", 0x020000, 0xaeef6045, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "chr0.80", 0x200000, 0xf63a52a9, 3 | BRF_GRA }, // 5 Graphics - { "chr1.79", 0x200000, 0x4110c184, 3 | BRF_GRA }, // 6 - { "chr2.78", 0x200000, 0xddb4b9ee, 3 | BRF_GRA }, // 7 - { "chr3.77", 0x200000, 0x5ab367db, 3 | BRF_GRA }, // 8 - { "chr4.84", 0x200000, 0x77d7ef99, 3 | BRF_GRA }, // 9 - { "chr5.83", 0x200000, 0xa4d49e95, 3 | BRF_GRA }, // 10 - { "chr6.82", 0x200000, 0x32eb33b0, 3 | BRF_GRA }, // 11 - { "chr7.81", 0x200000, 0x2d30a21e, 3 | BRF_GRA }, // 12 - - { "psacrom.60", 0x200000, 0x73f1f279, 4 | BRF_GRA }, // 13 Roz tiles - - { "sndpcm-b.22", 0x200000, 0xa5d844d2, 5 | BRF_SND }, // 14 YM2610 Delta T Samples - - { "sndpcm-a.23", 0x200000, 0xe6d32373, 6 | BRF_SND }, // 15 YM2610 Samples -}; - -STD_ROM_PICK(gstrik2j) -STD_ROM_FN(gstrik2j) - -struct BurnDriverD BurnDrvGstrik2j = { - "gstrik2j", "gstrik2", NULL, NULL, "1996", - "Grand Striker 2 (Japan)\0", "ROZ layer broken", "Human Amusement", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SPORTSFOOTBALL, 0, - NULL, gstrik2jRomInfo, gstrik2jRomName, NULL, NULL, Gstrik2InputInfo, Gstrik2DIPInfo, - gstrik2Init, DrvExit, Z80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 304, 224, 4, 3 -}; - - -// Sky Alert - -static struct BurnRomInfo skyalertRomDesc[] = { - { "sa_c_09.bin", 0x020000, 0x6f14d9ae, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "sa_c_10.bin", 0x020000, 0xf10bb216, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sa_b_12.bin", 0x020000, 0xf358175d, 2 | BRF_PRG | BRF_ESS }, // 2 UPD7810 - - { "sa_a_02.bin", 0x040000, 0xf4f81d41, 3 | BRF_GRA }, // 3 Graphics - { "sa_a_04.bin", 0x040000, 0x7d071e7e, 3 | BRF_GRA }, // 4 - { "sa_a_06.bin", 0x040000, 0x77e4d5e1, 3 | BRF_GRA }, // 5 - { "sa_a_08.bin", 0x040000, 0xf2a5a093, 3 | BRF_GRA }, // 6 - { "sa_a_01.bin", 0x040000, 0x41ec6491, 3 | BRF_GRA }, // 7 - { "sa_a_03.bin", 0x040000, 0xe0dff10d, 3 | BRF_GRA }, // 8 - { "sa_a_05.bin", 0x040000, 0x62169d31, 3 | BRF_GRA }, // 9 - { "sa_a_07.bin", 0x040000, 0xa6f5966f, 3 | BRF_GRA }, // 10 - - { "sa_a_11.bin", 0x020000, 0x04842a60, 4 | BRF_SND }, // 11 MSM6295 Samples -}; - -STD_ROM_PICK(skyalert) -STD_ROM_FN(skyalert) - -struct BurnDriver BurnDrvSkyalert = { - "skyalert", NULL, NULL, NULL, "1992", - "Sky Alert\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, skyalertRomInfo, skyalertRomName, NULL, NULL, SkyalertInputInfo, SkyalertDIPInfo, - skyalertInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 360, 3, 4 -}; - - -// Pang Pom's - -static struct BurnRomInfo pangpomsRomDesc[] = { - { "ppoms09.bin", 0x020000, 0x0c292dbc, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ppoms10.bin", 0x020000, 0x0bc18853, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ppoms12.bin", 0x020000, 0xa749357b, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "ppoms02.bin", 0x020000, 0x88f902f7, 3 | BRF_GRA }, // 3 Graphics - { "ppoms04.bin", 0x020000, 0x9190c2a0, 3 | BRF_GRA }, // 4 - { "ppoms06.bin", 0x020000, 0xed15c93d, 3 | BRF_GRA }, // 5 - { "ppoms08.bin", 0x020000, 0x9a3408b9, 3 | BRF_GRA }, // 6 - { "ppoms01.bin", 0x020000, 0x11ac3810, 3 | BRF_GRA }, // 7 - { "ppoms03.bin", 0x020000, 0xe595529e, 3 | BRF_GRA }, // 8 - { "ppoms05.bin", 0x020000, 0x02226214, 3 | BRF_GRA }, // 9 - { "ppoms07.bin", 0x020000, 0x48471c87, 3 | BRF_GRA }, // 10 - - { "ppoms11.bin", 0x020000, 0xe89bd565, 4 | BRF_SND }, // 11 MSM6295 Samples -}; - -STD_ROM_PICK(pangpoms) -STD_ROM_FN(pangpoms) - -struct BurnDriver BurnDrvPangpoms = { - "pangpoms", NULL, NULL, NULL, "1992", - "Pang Pom's\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, pangpomsRomInfo, pangpomsRomName, NULL, NULL, SkyalertInputInfo, PangpomsDIPInfo, - pangpomsInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 360, 224, 4, 3 -}; - - -// Pang Pom's (Mitchell) - -static struct BurnRomInfo pangpomsmRomDesc[] = { - { "pa.c09", 0x020000, 0xe01a7a08, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "pa.c10", 0x020000, 0x5e509cee, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ppoms12.bin", 0x020000, 0xa749357b, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "ppoms02.bin", 0x020000, 0x88f902f7, 3 | BRF_GRA }, // 3 Graphics - { "pj.e04", 0x020000, 0x54bf2f10, 3 | BRF_GRA }, // 4 - { "pj.e06", 0x020000, 0xc8b6347d, 3 | BRF_GRA }, // 5 - { "ppoms08.bin", 0x020000, 0x9a3408b9, 3 | BRF_GRA }, // 6 - { "ppoms01.bin", 0x020000, 0x11ac3810, 3 | BRF_GRA }, // 7 - { "pj.e03", 0x020000, 0xd126e774, 3 | BRF_GRA }, // 8 - { "pj.e05", 0x020000, 0x79c0ec1e, 3 | BRF_GRA }, // 9 - { "ppoms07.bin", 0x020000, 0x48471c87, 3 | BRF_GRA }, // 10 - - { "ppoms11.bin", 0x020000, 0xe89bd565, 4 | BRF_SND }, // 11 MSM6295 Samples -}; - -STD_ROM_PICK(pangpomsm) -STD_ROM_FN(pangpomsm) - -struct BurnDriver BurnDrvPangpomsm = { - "pangpomsm", "pangpoms", NULL, NULL, "1992", - "Pang Pom's (Mitchell)\0", NULL, "Metro (Mitchell license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, pangpomsmRomInfo, pangpomsmRomName, NULL, NULL, SkyalertInputInfo, PangpomsDIPInfo, - pangpomsInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 360, 224, 4, 3 -}; - - -// Poitto! - -static struct BurnRomInfo poittoRomDesc[] = { - { "pt-jd05.20e", 0x020000, 0x6b1be034, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "pt-jd06.20c", 0x020000, 0x3092d9d4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pt-jc08.3i", 0x020000, 0xf32d386a, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "pt-2.15i", 0x080000, 0x05d15d01, 3 | BRF_GRA }, // 3 Graphics - { "pt-4.19i", 0x080000, 0x8a39edb5, 3 | BRF_GRA }, // 4 - { "pt-1.13i", 0x080000, 0xea6e2289, 3 | BRF_GRA }, // 5 - { "pt-3.17i", 0x080000, 0x522917c1, 3 | BRF_GRA }, // 6 - - { "pt-jc07.3g", 0x040000, 0x5ae28b8d, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(poitto) -STD_ROM_FN(poitto) - -struct BurnDriver BurnDrvPoitto = { - "poitto", NULL, NULL, NULL, "1993", - "Poitto!\0", NULL, "Metro / Able Corp.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, poittoRomInfo, poittoRomName, NULL, NULL, PururunInputInfo, PoittoDIPInfo, - poittoInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 360, 224, 4, 3 -}; - - -// Last Fortress - Toride - -static struct BurnRomInfo lastfortRomDesc[] = { - { "tr_jc09", 0x020000, 0x8b98a49a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tr_jc10", 0x020000, 0x8d04da04, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tr_jb12", 0x020000, 0x8a8f5fef, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "tr_jc02", 0x020000, 0xdb3c5b79, 3 | BRF_GRA }, // 3 Graphics - { "tr_jc04", 0x020000, 0xf8ab2f9b, 3 | BRF_GRA }, // 4 - { "tr_jc06", 0x020000, 0x47a7f397, 3 | BRF_GRA }, // 5 - { "tr_jc08", 0x020000, 0xd7ba5e26, 3 | BRF_GRA }, // 6 - { "tr_jc01", 0x020000, 0x3e3dab03, 3 | BRF_GRA }, // 7 - { "tr_jc03", 0x020000, 0x87ac046f, 3 | BRF_GRA }, // 8 - { "tr_jc05", 0x020000, 0x3fbbe49c, 3 | BRF_GRA }, // 9 - { "tr_jc07", 0x020000, 0x05e1456b, 3 | BRF_GRA }, // 10 - - { "tr_jb11", 0x020000, 0x83786a09, 4 | BRF_SND }, // 11 MSM6295 Samples -}; - -STD_ROM_PICK(lastfort) -STD_ROM_FN(lastfort) - -struct BurnDriver BurnDrvLastfort = { - "lastfort", NULL, NULL, NULL, "1994", - "Last Fortress - Toride\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, lastfortRomInfo, lastfortRomName, NULL, NULL, SkyalertInputInfo, LastfortDIPInfo, - lastfortInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 360, 224, 4, 3 -}; - - -// Last Fortress - Toride (German) - -static struct BurnRomInfo lastfortgRomDesc[] = { - { "tr_ma02.8g", 0x020000, 0xe6f40918, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tr_ma03.10g", 0x020000, 0xb00fb126, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tr_ma01.1i", 0x020000, 0x8a8f5fef, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "tr_ma04.15f", 0x080000, 0x5feafc6f, 3 | BRF_GRA }, // 3 Graphics - { "tr_ma07.17d", 0x080000, 0x7519d569, 3 | BRF_GRA }, // 4 - { "tr_ma05.17f", 0x080000, 0x5d917ba5, 3 | BRF_GRA }, // 5 - { "tr_ma06.15d", 0x080000, 0xd366c04e, 3 | BRF_GRA }, // 6 - - { "tr_ma08.1d", 0x020000, 0x83786a09, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(lastfortg) -STD_ROM_FN(lastfortg) - -struct BurnDriver BurnDrvLastfortg = { - "lastfortg", "lastfort", NULL, NULL, "1994", - "Last Fortress - Toride (German)\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, lastfortgRomInfo, lastfortgRomName, NULL, NULL, LadykillInputInfo, LadykillDIPInfo, - lastforgInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 360, 224, 4, 3 -}; - - -// Last Fortress - Toride (Erotic, Rev C) - -static struct BurnRomInfo lastforteRomDesc[] = { - { "tr_hc09", 0x020000, 0x32f43390, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tr_hc10", 0x020000, 0x9536369c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tr_jb12", 0x020000, 0x8a8f5fef, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "tr_ha02", 0x020000, 0x11cfbc84, 3 | BRF_GRA }, // 3 Graphics - { "tr_ha04", 0x020000, 0x32bf9c26, 3 | BRF_GRA }, // 4 - { "tr_ha06", 0x020000, 0x16937977, 3 | BRF_GRA }, // 5 - { "tr_ha08", 0x020000, 0x6dd96a9b, 3 | BRF_GRA }, // 6 - { "tr_ha01", 0x020000, 0xaceb44b3, 3 | BRF_GRA }, // 7 - { "tr_ha03", 0x020000, 0xf18f1248, 3 | BRF_GRA }, // 8 - { "tr_ha05", 0x020000, 0x79f769dd, 3 | BRF_GRA }, // 9 - { "tr_ha07", 0x020000, 0xb6feacb2, 3 | BRF_GRA }, // 10 - - { "tr_jb11", 0x020000, 0x83786a09, 4 | BRF_SND }, // 11 MSM6295 Samples -}; - -STD_ROM_PICK(lastforte) -STD_ROM_FN(lastforte) - -struct BurnDriver BurnDrvLastforte = { - "lastforte", "lastfort", NULL, NULL, "1994", - "Last Fortress - Toride (Erotic, Rev C)\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, lastforteRomInfo, lastforteRomName, NULL, NULL, SkyalertInputInfo, LastferoDIPInfo, - lastfortInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 360, 224, 4, 3 -}; - - -// Last Fortress - Toride (Erotic, Rev A) - -static struct BurnRomInfo lastforteaRomDesc[] = { - { "tr_ha09", 0x020000, 0x61fe8fb2, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tr_ha10", 0x020000, 0x14a9fba2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tr_jb12", 0x020000, 0x8a8f5fef, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "tr_ha02", 0x020000, 0x11cfbc84, 3 | BRF_GRA }, // 3 Graphics - { "tr_ha04", 0x020000, 0x32bf9c26, 3 | BRF_GRA }, // 4 - { "tr_ha06", 0x020000, 0x16937977, 3 | BRF_GRA }, // 5 - { "tr_ha08", 0x020000, 0x6dd96a9b, 3 | BRF_GRA }, // 6 - { "tr_ha01", 0x020000, 0xaceb44b3, 3 | BRF_GRA }, // 7 - { "tr_ha03", 0x020000, 0xf18f1248, 3 | BRF_GRA }, // 8 - { "tr_ha05", 0x020000, 0x79f769dd, 3 | BRF_GRA }, // 9 - { "tr_ha07", 0x020000, 0xb6feacb2, 3 | BRF_GRA }, // 10 - - { "tr_jb11", 0x020000, 0x83786a09, 4 | BRF_SND }, // 11 MSM6295 Samples -}; - -STD_ROM_PICK(lastfortea) -STD_ROM_FN(lastfortea) - -struct BurnDriver BurnDrvLastfortea = { - "lastfortea", "lastfort", NULL, NULL, "1994", - "Last Fortress - Toride (Erotic, Rev A)\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, lastforteaRomInfo, lastforteaRomName, NULL, NULL, SkyalertInputInfo, LastferoDIPInfo, - lastfortInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 360, 224, 4, 3 -}; - - -// Last Fortress - Toride (Korea) - -static struct BurnRomInfo lastfortkRomDesc[] = { - { "7f-9", 0x020000, 0xd2894c1f, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "8f-10", 0x020000, 0x9696ea39, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tr_jb12", 0x020000, 0x8a8f5fef, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "7i-2", 0x040000, 0xd1fe8d7b, 3 | BRF_GRA }, // 3 Graphics - { "10i-4", 0x040000, 0x058126d4, 3 | BRF_GRA }, // 4 - { "13i-6", 0x040000, 0x39a9dea2, 3 | BRF_GRA }, // 5 - { "16i-8", 0x040000, 0x4c050baa, 3 | BRF_GRA }, // 6 - { "5i-1", 0x040000, 0x0d503f05, 3 | BRF_GRA }, // 7 - { "8i-3", 0x040000, 0xb6d4f753, 3 | BRF_GRA }, // 8 - { "12i-5", 0x040000, 0xce69c805, 3 | BRF_GRA }, // 9 - { "14i-7", 0x040000, 0x0cb38317, 3 | BRF_GRA }, // 10 - - { "tr_jb11", 0x020000, 0x83786a09, 4 | BRF_SND }, // 11 MSM6295 Samples -}; - -STD_ROM_PICK(lastfortk) -STD_ROM_FN(lastfortk) - -struct BurnDriver BurnDrvLastfortk = { - "lastfortk", "lastfort", NULL, NULL, "1994", - "Last Fortress - Toride (Korea)\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, lastfortkRomInfo, lastfortkRomName, NULL, NULL, SkyalertInputInfo, LastferoDIPInfo, - lastfortInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 360, 224, 4, 3 -}; - - -// Dharma Doujou - -static struct BurnRomInfo dharmaRomDesc[] = { - { "dd__wea5.u39", 0x020000, 0x960319d7, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "dd__wea6.u42", 0x020000, 0x386eb6b3, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "dd__wa-8.u9", 0x020000, 0xaf7ebc4c, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "dd__wa-2.u4", 0x080000, 0x2c67a5c8, 3 | BRF_GRA }, // 3 Graphics - { "dd__wa-4.u5", 0x080000, 0x36ca7848, 3 | BRF_GRA }, // 4 - { "dd__wa-1.u10", 0x080000, 0xd8034574, 3 | BRF_GRA }, // 5 - { "dd__wa-3.u11", 0x080000, 0xfe320fa3, 3 | BRF_GRA }, // 6 - - { "dd__wa-7.u3", 0x040000, 0x7ce817eb, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(dharma) -STD_ROM_FN(dharma) - -struct BurnDriver BurnDrvDharma = { - "dharma", NULL, NULL, NULL, "1994", - "Dharma Doujou\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, dharmaRomInfo, dharmaRomName, NULL, NULL, PururunInputInfo, DharmaDIPInfo, - dharmaInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Dharma Doujou (Japan) - -static struct BurnRomInfo dharmajRomDesc[] = { - { "dd_jc-5", 0x020000, 0xb5d44426, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "dd_jc-6", 0x020000, 0xbc5a202e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "dd_ja-8", 0x020000, 0xaf7ebc4c, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "dd_jb-2", 0x080000, 0x2c07c29b, 3 | BRF_GRA }, // 3 Graphics - { "dd_jb-4", 0x080000, 0xfe15538e, 3 | BRF_GRA }, // 4 - { "dd_jb-1", 0x080000, 0xe6ca9bf6, 3 | BRF_GRA }, // 5 - { "dd_jb-3", 0x080000, 0x6ecbe193, 3 | BRF_GRA }, // 6 - - { "dd_ja-7", 0x040000, 0x7ce817eb, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(dharmaj) -STD_ROM_FN(dharmaj) - -struct BurnDriver BurnDrvDharmaj = { - "dharmaj", "dharma", NULL, NULL, "1994", - "Dharma Doujou (Japan)\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, dharmajRomInfo, dharmajRomName, NULL, NULL, PururunInputInfo, DharmaDIPInfo, - dharmajInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Dharma Doujou (Korea) - -static struct BurnRomInfo dharmakRomDesc[] = { - { "5.bin", 0x020000, 0x7dec1f77, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "6.bin", 0x020000, 0xa194edbe, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "8.bin", 0x020000, 0xd0e0a8e2, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "2.bin", 0x080000, 0x3cc0bb6c, 3 | BRF_GRA }, // 3 Graphics - { "4.bin", 0x080000, 0x2cdcdf91, 3 | BRF_GRA }, // 4 - { "1.bin", 0x080000, 0x312ee2ec, 3 | BRF_GRA }, // 5 - { "3.bin", 0x080000, 0xb81aede8, 3 | BRF_GRA }, // 6 - - { "7.bin", 0x040000, 0x8af698d7, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(dharmak) -STD_ROM_FN(dharmak) - -struct BurnDriver BurnDrvDharmak = { - "dharmak", "dharma", NULL, NULL, "1994", - "Dharma Doujou (Korea)\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, dharmakRomInfo, dharmakRomName, NULL, NULL, PururunInputInfo, DharmaDIPInfo, - dharmaInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Pururun - -static struct BurnRomInfo pururunRomDesc[] = { - { "pu9-19-5.20e", 0x020000, 0x5a466a1b, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "pu9-19-6.20c", 0x020000, 0xd155a53c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pu9-19-8.3i", 0x020000, 0xedc3830b, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "pu9-19-2.14i", 0x080000, 0x21550b26, 3 | BRF_GRA }, // 3 Graphics - { "pu9-19-4.18i", 0x080000, 0x3f3e216d, 3 | BRF_GRA }, // 4 - { "pu9-19-1.12i", 0x080000, 0x7e83a75f, 3 | BRF_GRA }, // 5 - { "pu9-19-3.16i", 0x080000, 0xd15485c5, 3 | BRF_GRA }, // 6 - - { "pu9-19-7.3g", 0x040000, 0x51ae4926, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(pururun) -STD_ROM_FN(pururun) - -struct BurnDriver BurnDrvPururun = { - "pururun", NULL, NULL, NULL, "1995", - "Pururun\0", NULL, "Metro / Banpresto", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, pururunRomInfo, pururunRomName, NULL, NULL, PururunInputInfo, PururunDIPInfo, - pururunInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// The Karate Tournament - -static struct BurnRomInfo karatourRomDesc[] = { - { "2.2FAB.8G", 0x040000, 0x199a28d4, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "3.0560.10G", 0x040000, 0xb054e683, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "KT001.1I", 0x020000, 0x1dd2008c, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "361A04.15F", 0x100000, 0xf6bf20a5, 3 | BRF_GRA }, // 3 Graphics - { "361A07.17D", 0x100000, 0x794cc1c0, 3 | BRF_GRA }, // 4 - { "361A05.17F", 0x100000, 0xea9c11fc, 3 | BRF_GRA }, // 5 - { "361A06.15D", 0x100000, 0x7e15f058, 3 | BRF_GRA }, // 6 - - { "8.4A06.1D", 0x040000, 0x8d208179, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(karatour) -STD_ROM_FN(karatour) - -struct BurnDriver BurnDrvKaratour = { - "karatour", NULL, NULL, NULL, "1992", - "The Karate Tournament\0", NULL, "Mitchell", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, karatourRomInfo, karatourRomName, NULL, NULL, KaratourInputInfo, KaratourDIPInfo, - karatourInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 240, 4, 3 -}; - - -// The Karate Tournament (Japan) - -static struct BurnRomInfo karatourjRomDesc[] = { - { "kt002.8g", 0x040000, 0x316a97ec, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "kt003.10g", 0x040000, 0xabe1b991, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "kt001.1i", 0x020000, 0x1dd2008c, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "361a04.15f", 0x100000, 0xf6bf20a5, 3 | BRF_GRA }, // 3 Graphics - { "361a07.17d", 0x100000, 0x794cc1c0, 3 | BRF_GRA }, // 4 - { "361a05.17f", 0x100000, 0xea9c11fc, 3 | BRF_GRA }, // 5 - { "361a06.15d", 0x100000, 0x7e15f058, 3 | BRF_GRA }, // 6 - - { "kt008.1d", 0x040000, 0x47cf9fa1, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(karatourj) -STD_ROM_FN(karatourj) - -struct BurnDriver BurnDrvKaratourj = { - "karatourj", "karatour", NULL, NULL, "1992", - "The Karate Tournament (Japan)\0", NULL, "Mitchell", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, karatourjRomInfo, karatourjRomName, NULL, NULL, KaratourInputInfo, KaratourDIPInfo, - karatourInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 240, 4, 3 -}; - -// Lady Killer - -static struct BurnRomInfo ladykillRomDesc[] = { - { "e2.8g", 0x040000, 0x211a4865, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "e3.10g", 0x040000, 0x581a55ea, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "e1.1i", 0x020000, 0xa4d95cfb, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "ladyj-4.15f", 0x100000, 0x65e5906c, 3 | BRF_GRA }, // 3 Graphics - { "ladyj-7.17d", 0x100000, 0x56bd64a5, 3 | BRF_GRA }, // 4 - { "ladyj-5.17f", 0x100000, 0xa81ffaa3, 3 | BRF_GRA }, // 5 - { "ladyj-6.15d", 0x100000, 0x3a34913a, 3 | BRF_GRA }, // 6 - - { "e8.1d", 0x040000, 0xda88244d, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(ladykill) -STD_ROM_FN(ladykill) - -struct BurnDriver BurnDrvLadykill = { - "ladykill", NULL, NULL, NULL, "1993", - "Lady Killer\0", "Imperfect graphics", "Yanyaka (Mitchell license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, ladykillRomInfo, ladykillRomName, NULL, NULL, LadykillInputInfo, LadykillDIPInfo, - karatourInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 240, 320, 3, 4 -}; - - -// Moeyo Gonta!! (Japan) - -static struct BurnRomInfo moegontaRomDesc[] = { - { "j2.8g", 0x040000, 0xaa18d130, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "j3.10g", 0x040000, 0xb555e6ab, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "e1.1i", 0x020000, 0xa4d95cfb, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "ladyj-4.15f", 0x100000, 0x65e5906c, 3 | BRF_GRA }, // 3 Graphics - { "ladyj-7.17d", 0x100000, 0x56bd64a5, 3 | BRF_GRA }, // 4 - { "ladyj-5.17f", 0x100000, 0xa81ffaa3, 3 | BRF_GRA }, // 5 - { "ladyj-6.15d", 0x100000, 0x3a34913a, 3 | BRF_GRA }, // 6 - - { "e8j.1d", 0x040000, 0xf66c2a80, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(moegonta) -STD_ROM_FN(moegonta) - -struct BurnDriver BurnDrvMoegonta = { - "moegonta", "ladykill", NULL, NULL, "1993", - "Moeyo Gonta!! (Japan)\0", NULL, "Yanyaka", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, moegontaRomInfo, moegontaRomName, NULL, NULL, LadykillInputInfo, LadykillDIPInfo, - karatourInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 240, 320, 3, 4 -}; - - -// Daitoride - -static struct BurnRomInfo daitoridRomDesc[] = { - { "dt-ja-5.19e", 0x020000, 0x441efd77, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "dt-ja-6.19c", 0x020000, 0x494f9cc3, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "dt-ja-8.3h", 0x020000, 0x0351ad5b, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "dt-ja-2.14h", 0x080000, 0x56881062, 3 | BRF_GRA }, // 3 Graphics - { "dt-ja-4.18h", 0x080000, 0x85522e3b, 3 | BRF_GRA }, // 4 - { "dt-ja-1.12h", 0x080000, 0x2a220bf2, 3 | BRF_GRA }, // 5 - { "dt-ja-3.16h", 0x080000, 0xfd1f58e0, 3 | BRF_GRA }, // 6 - - { "dt-ja-7.3f", 0x040000, 0x0d888cde, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(daitorid) -STD_ROM_FN(daitorid) - -struct BurnDriver BurnDrvDaitorid = { - "daitorid", NULL, NULL, NULL, "1995", - "Daitoride\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, daitoridRomInfo, daitoridRomName, NULL, NULL, DaitoridInputInfo, DaitoridDIPInfo, - daitoridInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Daitoride (YMF278B version) - -static struct BurnRomInfo daitoridaRomDesc[] = { - { "dt_ja-6.6", 0x040000, 0xc753954e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "dt_ja-5.5", 0x040000, 0xc4340290, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "dt_ja-2.2", 0x080000, 0x6a262249, 2 | BRF_GRA }, // 2 Graphics - { "dt_ja-4.4", 0x080000, 0xcdcef57a, 2 | BRF_GRA }, // 3 - { "dt_ja-1.1", 0x080000, 0xa6ccb1d2, 2 | BRF_GRA }, // 4 - { "dt_ja-3.3", 0x080000, 0x32353e04, 2 | BRF_GRA }, // 5 - - { "yrw801-m", 0x200000, 0x2a9d8d43, 3 | BRF_GRA }, // 6 YMF278b Samples - { "dt_ja-7.7", 0x080000, 0x7a2d3222, 3 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(daitorida) -STD_ROM_FN(daitorida) - -struct BurnDriver BurnDrvDaitorida = { - "daitorida", "daitorid", NULL, NULL, "1996", - "Daitoride (YMF278B version)\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, daitoridaRomInfo, daitoridaRomName, NULL, NULL, DaitoridInputInfo, DaitoridDIPInfo, - daitoridaInit, DrvExit, YMF278bFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Gun Master - -static struct BurnRomInfo gunmastRomDesc[] = { - { "gmja-5.20e", 0x040000, 0x7334b2a3, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "gmja-6.20c", 0x040000, 0xc38d185e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gmja-8.3i", 0x020000, 0xab4bcc56, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "gmja-2.14i", 0x080000, 0xbc9acd54, 3 | BRF_GRA }, // 3 Graphics - { "gmja-4.18i", 0x080000, 0xf2d72d90, 3 | BRF_GRA }, // 4 - { "gmja-1.12i", 0x080000, 0x336d0a90, 3 | BRF_GRA }, // 5 - { "gmja-3.16i", 0x080000, 0xa6651297, 3 | BRF_GRA }, // 6 - - { "gmja-7.3g", 0x040000, 0x3a342312, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(gunmast) -STD_ROM_FN(gunmast) - -struct BurnDriver BurnDrvGunmast = { - "gunmast", NULL, NULL, NULL, "1994", - "Gun Master\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, gunmastRomInfo, gunmastRomName, NULL, NULL, GunmastInputInfo, GunmastDIPInfo, - pururunInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Sankokushi (Japan) - -static struct BurnRomInfo _3kokushiRomDesc[] = { - { "5.20e", 0x040000, 0x6104ea35, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "6.20c", 0x040000, 0xaac25540, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "8.3i", 0x020000, 0xf56cca45, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "2.14i", 0x080000, 0x291f8149, 3 | BRF_GRA }, // 3 Graphics - { "4.18i", 0x080000, 0x9317c359, 3 | BRF_GRA }, // 4 - { "1.12i", 0x080000, 0xd5495759, 3 | BRF_GRA }, // 5 - { "3.16i", 0x080000, 0x3d76bdf3, 3 | BRF_GRA }, // 6 - - { "7.3g", 0x040000, 0x78fe9d44, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(_3kokushi) -STD_ROM_FN(_3kokushi) - -struct BurnDriver BurnDrv_3kokushi = { - "3kokushi", NULL, NULL, NULL, "1996", - "Sankokushi (Japan)\0", "Graphics corruption on score/bonus screen is normal", "Mitchell", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, _3kokushiRomInfo, _3kokushiRomName, NULL, NULL, PuzzliInputInfo, _3kokushiDIPInfo, - kokushiInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 240, 4, 3 -}; - - -// Puzzli - -static struct BurnRomInfo puzzliRomDesc[] = { - { "pz_jb5.20e", 0x020000, 0x33bbbd28, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "pz_jb6.20c", 0x020000, 0xe0bdea18, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pz_jb8.3i", 0x020000, 0xc652da32, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "pz_jb2.14i", 0x080000, 0x0c0997d4, 3 | BRF_GRA }, // 3 Graphics - { "pz_jb4.18i", 0x080000, 0x576bc5c2, 3 | BRF_GRA }, // 4 - { "pz_jb1.12i", 0x080000, 0x29f01eb3, 3 | BRF_GRA }, // 5 - { "pz_jb3.16i", 0x080000, 0x6753e282, 3 | BRF_GRA }, // 6 - - { "pz_jb7.3g", 0x040000, 0xb3aab610, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(puzzli) -STD_ROM_FN(puzzli) - -struct BurnDriver BurnDrvPuzzli = { - "puzzli", NULL, NULL, NULL, "1995", - "Puzzli\0", NULL, "Metro / Banpresto", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, puzzliRomInfo, puzzliRomName, NULL, NULL, PuzzliInputInfo, PuzzliDIPInfo, - daitoridInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Toride II Adauchi Gaiden - -static struct BurnRomInfo toride2gRomDesc[] = { - { "tr2aja-5.20e", 0x040000, 0xb96a52f6, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tr2aja-6.20c", 0x040000, 0x2918b6b4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tr2aja-8.3i", 0x020000, 0xfdd29146, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "tr2aja-2.14i", 0x080000, 0x5c73f629, 3 | BRF_GRA }, // 3 Graphics - { "tr2aja-4.18i", 0x080000, 0x67ebaf1b, 3 | BRF_GRA }, // 4 - { "tr2aja-1.12i", 0x080000, 0x96245a5c, 3 | BRF_GRA }, // 5 - { "tr2aja-3.16i", 0x080000, 0x49013f5d, 3 | BRF_GRA }, // 6 - - { "tr2aja-7.3g", 0x020000, 0x630c6193, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(toride2g) -STD_ROM_FN(toride2g) - -struct BurnDriver BurnDrvToride2g = { - "toride2g", NULL, NULL, NULL, "1994", - "Toride II Adauchi Gaiden\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, toride2gRomInfo, toride2gRomName, NULL, NULL, PuzzliInputInfo, Toride2gDIPInfo, - toride2gInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Toride II Adauchi Gaiden (German) - -static struct BurnRomInfo toride2ggRomDesc[] = { - { "trii_ge_5.20e", 0x040000, 0x5e0815a8, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "trii_ge_6.20c", 0x040000, 0x55eba67d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tr2_jb-8.3i", 0x020000, 0x0168f46f, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "trii_gb_2.14i", 0x080000, 0x5949e65f, 3 | BRF_GRA }, // 3 Graphics - { "trii_gb_4.18i", 0x080000, 0xadc84c7b, 3 | BRF_GRA }, // 4 - { "trii_gb_1.12i", 0x080000, 0xbcf30944, 3 | BRF_GRA }, // 5 - { "trii_gb_3.16i", 0x080000, 0x138e68d0, 3 | BRF_GRA }, // 6 - - { "tr2_ja_7.3g", 0x020000, 0x6ee32315, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(toride2gg) -STD_ROM_FN(toride2gg) - -struct BurnDriver BurnDrvToride2gg = { - "toride2gg", "toride2g", NULL, NULL, "1994", - "Toride II Adauchi Gaiden (German)\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, toride2ggRomInfo, toride2ggRomName, NULL, NULL, PuzzliInputInfo, Toride2gDIPInfo, - toride2gInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Toride II Bok Su Oi Jeon Adauchi Gaiden (Korea) - -static struct BurnRomInfo toride2gkRomDesc[] = { - { "5", 0x040000, 0x7e3f943a, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "6", 0x040000, 0x92726910, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "8", 0x020000, 0xfdd29146, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "2", 0x080000, 0x5e7fb9db, 3 | BRF_GRA }, // 3 Graphics - { "4", 0x080000, 0x558c03e7, 3 | BRF_GRA }, // 4 - { "1", 0x080000, 0x5e819ccd, 3 | BRF_GRA }, // 5 - { "3", 0x080000, 0x24029583, 3 | BRF_GRA }, // 6 - - { "7", 0x020000, 0x630c6193, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(toride2gk) -STD_ROM_FN(toride2gk) - -struct BurnDriver BurnDrvToride2gk = { - "toride2gk", "toride2g", NULL, NULL, "1994", - "Toride II Bok Su Oi Jeon Adauchi Gaiden (Korea)\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, toride2gkRomInfo, toride2gkRomName, NULL, NULL, PuzzliInputInfo, Toride2gDIPInfo, - toride2gInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Toride II (Japan) - -static struct BurnRomInfo toride2jRomDesc[] = { - { "tr2_jk-5.20e", 0x040000, 0xf2668578, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tr2_jk-6.20c", 0x040000, 0x4c87629f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tr2_jb-8.3i", 0x020000, 0x0168f46f, 2 | BRF_PRG | BRF_ESS }, // 2 uPD7810 Code - - { "tr2_jb-2.14i", 0x080000, 0xb31754dc, 3 | BRF_GRA }, // 3 Graphics - { "tr2_jb-4.18i", 0x080000, 0xa855c3fa, 3 | BRF_GRA }, // 4 - { "tr2_jb-1.12i", 0x080000, 0x856f40b7, 3 | BRF_GRA }, // 5 - { "tr2_jb-3.16i", 0x080000, 0x78ba205f, 3 | BRF_GRA }, // 6 - - { "tr2_ja_7.3g", 0x020000, 0x6ee32315, 4 | BRF_SND }, // 7 MSM6295 Samples -}; - -STD_ROM_PICK(toride2j) -STD_ROM_FN(toride2j) - -struct BurnDriver BurnDrvToride2j = { - "toride2j", "toride2g", NULL, NULL, "1994", - "Toride II (Japan)\0", "No sound", "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, toride2jRomInfo, toride2jRomName, NULL, NULL, PuzzliInputInfo, Toride2gDIPInfo, - toride2gInit, DrvExit, NoZ80Frame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Mouse Shooter GoGo - -static struct BurnRomInfo msgogoRomDesc[] = { - { "ms_wa-6.6", 0x040000, 0x986acac8, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ms_wa-5.5", 0x040000, 0x746d9f99, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ms_wa-2.2", 0x080000, 0x0d36c2b9, 2 | BRF_GRA }, // 2 Graphics - { "ms_wa-4.4", 0x080000, 0xfd387126, 2 | BRF_GRA }, // 3 - { "ms_ja-1.1", 0x080000, 0x8ec4e81d, 2 | BRF_GRA }, // 4 - { "ms_wa-3.3", 0x080000, 0x06cb6807, 2 | BRF_GRA }, // 5 - - { "yrw801-m", 0x200000, 0x2a9d8d43, 3 | BRF_GRA }, // 6 YMF278b Samples - { "ms_wa-7.7", 0x080000, 0xe19941cb, 3 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(msgogo) -STD_ROM_FN(msgogo) - -struct BurnDriver BurnDrvMsgogo = { - "msgogo", NULL, NULL, NULL, "1995", - "Mouse Shooter GoGo\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, msgogoRomInfo, msgogoRomName, NULL, NULL, PuzzliInputInfo, MsgogoDIPInfo, - msgogoInit, DrvExit, YMF278bFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Bal Cube - -static struct BurnRomInfo balcubeRomDesc[] = { - { "bal-cube_06.6", 0x040000, 0xc400f84d, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bal-cube_05.5", 0x040000, 0x15313e3f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bal-cube_02.2", 0x080000, 0x492ca8f0, 2 | BRF_GRA }, // 2 Graphics - { "bal-cube_04.4", 0x080000, 0xd1acda2c, 2 | BRF_GRA }, // 3 - { "bal-cube_01.1", 0x080000, 0x0ea3d161, 2 | BRF_GRA }, // 4 - { "bal-cube_03.3", 0x080000, 0xeef1d3b4, 2 | BRF_GRA }, // 5 - - { "yrw801-m", 0x200000, 0x2a9d8d43, 3 | BRF_GRA }, // 6 YMF278b Samples - { "bal-cube_07.7", 0x080000, 0xf769287d, 3 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(balcube) -STD_ROM_FN(balcube) - -struct BurnDriver BurnDrvBalcube = { - "balcube", NULL, NULL, NULL, "1996", - "Bal Cube\0", NULL, "Metro", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, balcubeRomInfo, balcubeRomName, NULL, NULL, BalcubeInputInfo, BalcubeDIPInfo, - balcubeInit, DrvExit, YMF278bFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Bang Bang Ball (v1.05) - -static struct BurnRomInfo bangballRomDesc[] = { - { "b-ball_j_rom#006.u18", 0x040000, 0x0e4124bc, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "b-ball_j_rom#005.u19", 0x040000, 0x3fa08587, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bp963a_u30.u30", 0x100000, 0xb0ca8e39, 2 | BRF_GRA }, // 2 Graphics - { "bp963a_u29.u29", 0x100000, 0xd934468f, 2 | BRF_GRA }, // 3 - { "bp963a_u28.u28", 0x100000, 0x96d03c6a, 2 | BRF_GRA }, // 4 - { "bp963a_u27.u27", 0x100000, 0x5e3c7732, 2 | BRF_GRA }, // 5 - - { "yrw801-m", 0x200000, 0x2a9d8d43, 3 | BRF_GRA }, // 6 YMF278b Samples - { "b-ball_j_rom#007.u49", 0x080000, 0x04cc91a9, 3 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(bangball) -STD_ROM_FN(bangball) - -struct BurnDriver BurnDrvBangball = { - "bangball", NULL, NULL, NULL, "1996", - "Bang Bang Ball (v1.05)\0", NULL, "Banpresto / Kunihiko Tashiro+Goodhouse", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, bangballRomInfo, bangballRomName, NULL, NULL, BalcubeInputInfo, BangballDIPInfo, - bangballInit, DrvExit, YMF278bFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; - - -// Battle Bubble (v2.00) - -static struct BurnRomInfo batlbublRomDesc[] = { - { "lm-01.u11", 0x080000, 0x1d562807, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "lm-02.u12", 0x080000, 0x852e4750, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "lm-07.u30", 0x200000, 0x03d9dfd8, 2 | BRF_GRA }, // 2 Graphics - { "lm-06.u29", 0x200000, 0x5efb905b, 2 | BRF_GRA }, // 3 - { "lm-05.u28", 0x200000, 0xe53ba59f, 2 | BRF_GRA }, // 4 - { "lm-04.u27", 0x200000, 0x2e687cfb, 2 | BRF_GRA }, // 5 - - { "lm-08.u40", 0x200000, 0x2a9d8d43, 3 | BRF_GRA }, // 6 YMF278b Samples - { "lm-03.u42", 0x080000, 0x04cc91a9, 3 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(batlbubl) -STD_ROM_FN(batlbubl) - -struct BurnDriver BurnDrvBatlbubl = { - "batlbubl", "bangball", NULL, NULL, "1999", - "Battle Bubble (v2.00)\0", NULL, "Banpresto (Limenko license?)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, batlbublRomInfo, batlbublRomName, NULL, NULL, BalcubeInputInfo, BatlbublDIPInfo, - batlbublInit, DrvExit, YMF278bFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_midas.cpp b/jan/src/burn/drv/pst90s/d_midas.cpp deleted file mode 100644 index bc9f44d2d..000000000 --- a/jan/src/burn/drv/pst90s/d_midas.cpp +++ /dev/null @@ -1,671 +0,0 @@ -// FB Alpha Andamiro "Midas" hardware driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "eeprom.h" -#include "ymz280b.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvSprROM; -static UINT8 *DrvTxtROM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvGfxRAM; -static UINT32 *DrvPalette; -static UINT8 *DrvSprTransTab; -static UINT8 *DrvTxtTransTab; -static UINT16 *DrvGfxRegs; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvJoy5[16]; -static UINT8 DrvJoy6[16]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; -static UINT16 DrvInputs[6]; - -static INT32 DrvRecalc0 = 0; - -static short zoom_table[16][16]; - -static struct BurnInputInfo LivequizInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 8, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy6 + 10, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy6 + 11, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy6 + 8, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy6 + 9, "p1 fire 4" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 10, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 10, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 11, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 8, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy1 + 9, "p2 fire 4" }, - - {"P3 Start", BIT_DIGITAL, DrvJoy5 + 0, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 0, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 1, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy4 + 2, "p3 fire 3" }, - {"P3 Button 4", BIT_DIGITAL, DrvJoy4 + 3, "p3 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Livequiz) - -static struct BurnDIPInfo LivequizDIPList[] = -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Livequiz) - -inline static void palette_write(INT32 offs) -{ - DrvPalette[offs/4] = BurnHighCol(DrvPalRAM[offs + 0], DrvPalRAM[offs + 3], DrvPalRAM[offs + 2], 0); -} - -void __fastcall midas_write_byte(UINT32 address, UINT8 data) -{ - if (address >= 0xa00000 && address <= 0xa3ffff) { - DrvPalRAM[(address & 0x3ffff) ^ 1] = data; - palette_write(address & 0x3fffc); - return; - } - - switch (address) - { - case 0x9a0001: - EEPROMWrite(data & 0x02, data & 0x01, data & 0x04); - return; - - case 0xb80009: - YMZ280BSelectRegister(data); - return; - - case 0xb8000b: - YMZ280BWriteRegister(data); - return; - } -} - -void __fastcall midas_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0xa00000 && address <= 0xa3ffff) { - *((UINT16*)(DrvPalRAM + (address & 0x3fffe))) = BURN_ENDIAN_SWAP_INT16(data); - palette_write(address & 0x3fffc); - return; - } - - switch (address) - { - case 0x9c0000: - DrvGfxRegs[0] = data; - return; - - case 0x9c0002: - { - DrvGfxRegs[1] = data; - *((UINT16*)(DrvGfxRAM + (DrvGfxRegs[0] << 1))) = BURN_ENDIAN_SWAP_INT16(data); - DrvGfxRegs[0] += DrvGfxRegs[2]; - } - return; - - case 0x9c0004: - DrvGfxRegs[2] = data; - return; - } -} - -UINT8 __fastcall midas_read_byte(UINT32 address) -{ - switch (address) - { - case 0x900001: - return DrvInputs[5]; - - case 0x920001: - return DrvInputs[2] | (EEPROMRead() ? 8 : 0); - - case 0x940000: - return (DrvInputs[0] >> 8); - - case 0x980000: - return (DrvInputs[1] >> 8); - - case 0xb8000b: - return YMZ280BReadStatus(); - - case 0xba0001: - return DrvInputs[4]; - - case 0xbc0001: - return DrvInputs[3]; - } - - return 0; -} - -UINT16 __fastcall midas_read_word(UINT32 address) -{ - switch (address) - { - case 0x900000: - return DrvInputs[5]; - - case 0x980000: - return DrvInputs[1]; - - case 0xb00000: - case 0xb20000: - case 0xb40000: - case 0xb60000: - return 0xffff; - - case 0xbc0000: - return DrvInputs[3]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - YMZ280BReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x200000; - - DrvTxtROM = Next; Next += 0x040000; - DrvSprROM = Next; Next += 0x800000; - - DrvTxtTransTab = Next; Next += 0x040000 / 0x040; - DrvSprTransTab = Next; Next += 0x800000 / 0x100; - - YMZ280BROM = Next; Next += 0x200000; - - DrvPalette = (UINT32*)Next; Next += 0x10000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x020000; - Drv68KRAM1 = Next; Next += 0x040000; - DrvPalRAM = Next; Next += 0x080000; - DrvGfxRAM = Next; Next += 0x020000; - - DrvGfxRegs = (UINT16*)Next; Next += 3 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvInitZoomTable() -{ - zoom_table[0][0] = -1; - - for (INT32 x = 1; x < 16; x++) { - for (INT32 y = 0; y < 16; y++) { - float t = ((16.0000-1.0000) / x) * y; - zoom_table[x][y] = (t >= 16) ? -1 : (INT32)t; - } - } -} - -static void DrvFillTransTabs(UINT8 *tab, UINT8 *gfx, INT32 gfxlen, INT32 tilesize) -{ - for (INT32 i = 0; i < gfxlen; i+=tilesize) - { - tab[i/tilesize] = 0; - - INT32 count = 0; - - for (INT32 j = 0; j < tilesize; j++) { - if (gfx[i + j]) { - tab[i/tilesize] = 1; - count++; - } - } - - if (count >= (tilesize-1)) { - tab[i/tilesize] |= 2; - } - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[8] = { 0x3000008, 0x3000000, 0x1000008, 0x1000000, 0x2000008, 0x2000000, 0x0000008, 0x0000000 }; - INT32 XOffs0[16] = { 0x107, 0x106, 0x105, 0x104, 0x103, 0x102, 0x101, 0x100, 0x007, 0x006, 0x005, 0x004, 0x003, 0x002, 0x001, 0x000 }; - INT32 YOffs0[16] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080, 0x090, 0x0a0, 0x0b0, 0x0c0, 0x0d0, 0x0e0, 0x0f0 }; - - INT32 Plane1[8] = { 0x008, 0x009, 0x00a, 0x00b, 0x000, 0x001, 0x002, 0x003 }; - INT32 XOffs1[8] = { 0x104, 0x100, 0x184, 0x180, 0x004, 0x000, 0x084, 0x080 }; - INT32 YOffs1[8] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x800000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvSprROM, 0x800000); - - GfxDecode(0x8000, 8, 16, 16, Plane0, XOffs0, YOffs0, 0x200, tmp, DrvSprROM); - - memcpy (tmp, DrvTxtROM, 0x040000); - - GfxDecode(0x1000, 8, 8, 8, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvTxtROM); - - DrvFillTransTabs(DrvSprTransTab, DrvSprROM, 0x800000, 0x100); - DrvFillTransTabs(DrvTxtTransTab, DrvTxtROM, 0x040000, 0x040); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM, 0, 1)) return 1; - - if (BurnLoadRom(DrvTxtROM, 7, 1)) return 1; - - if (BurnLoadRom(DrvSprROM + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvSprROM + 0x200000, 4, 1)) return 1; - if (BurnLoadRom(DrvSprROM + 0x400000, 5, 1)) return 1; - if (BurnLoadRom(DrvSprROM + 0x600000, 6, 1)) return 1; - - if (BurnLoadRom(YMZ280BROM, 8, 1)) return 1; - - DrvGfxDecode(); - } - - *((UINT16*)(Drv68KROM + 0x13345a)) = BURN_ENDIAN_SWAP_INT16(0x4e75); // patch out protection - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0xa00000, 0xa3ffff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x3ffff, 0xa40000, 0xa7ffff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0xd00000, 0xd1ffff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0xe00000, 0xe3ffff, MAP_RAM); - SekMapMemory(DrvGfxRAM, 0xf90000, 0xfaffff, MAP_RAM); - SekSetWriteByteHandler(0, midas_write_byte); - SekSetWriteWordHandler(0, midas_write_word); - SekSetReadByteHandler(0, midas_read_byte); - SekSetReadWordHandler(0, midas_read_word); - SekClose(); - - YMZ280BInit(16934400, NULL); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 0.80, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 0.80, BURN_SND_ROUTE_RIGHT); - - EEPROMInit(&eeprom_interface_93C46); - - DrvInitZoomTable(); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - YMZ280BExit(); - YMZ280BROM = NULL; - - EEPROMExit(); - - SekExit(); - - BurnFree (AllMem); - - DrvRecalc0 = 0; - - return 0; -} - -static void draw_16x16_zoom(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 xz, INT32 yz, INT32 fx, INT32 fy) -{ - if (yz == 1 || xz == 1) return; - - fx = (fx * 0x0f); - fy = (fy >> 1) * 0x0f; - - UINT8 *src = DrvSprROM + (code << 8); - - INT16 *xm = zoom_table[xz-1]; - INT16 *ym = zoom_table[yz-1]; - - for (INT32 y = 0; y < 16; y++) - { - INT32 yy = sy + y; - - if (ym[y ^ fy] == -1 || yy < 0 || yy >= nScreenHeight) continue; - - INT32 yyz = (ym[y ^ fy] << 4); - - for (INT32 x = 0; x < 16; x++) - { - INT16 xxz = xm[x ^ fx]; - if (xxz == -1) continue; - - INT32 xx = sx + x; - - INT32 pxl = src[yyz|xxz]; - - if (!pxl || xx < 0 || xx >= nScreenWidth || yy < 0 || yy >= nScreenHeight) continue; - - pTransDraw[(yy * nScreenWidth) + xx] = pxl | color; - } - } -} - -static void draw_sprites() -{ - UINT16 *codes = (UINT16*)DrvGfxRAM; - UINT16 *s = codes + 0x8000; - - INT32 sx_old = 0, sy_old = 0, ynum_old = 0, xzoom_old = 0; - INT32 xdim, ydim, xscale, yscale, ynum; - - for (INT32 i = 0; i < 0x180; i++, s++, codes+=0x40) - { - INT32 zoom = BURN_ENDIAN_SWAP_INT16(s[0x000]); - INT32 sy = BURN_ENDIAN_SWAP_INT16(s[0x200]); - INT32 sx = BURN_ENDIAN_SWAP_INT16(s[0x400]); - - INT32 xzoom = ((zoom >> 8) & 0x0f) + 1; - INT32 yzoom = (zoom & 0x7f) + 1; - - if (sy & 0x40) { - ynum = ynum_old; - sx = sx_old + xzoom_old; - sy = sy_old; - } else { - ynum = sy & 0x3f; - sx = (sx >> 7); - sy = 0x200 - (sy >> 7); - - if (ynum > 0x20) ynum = 0x20; - } - - if (sx >= 0x1f0) sx -= 0x200; - - ynum_old = ynum; - sx_old = sx; - sy_old = sy; - xzoom_old = xzoom; - - sy <<= 16; - - xdim = xzoom << 16; - ydim = yzoom << 13; - - xscale = xzoom; - yscale = yzoom >> 3; - - for (INT32 y = 0; y < ynum; y++) - { - INT32 code = BURN_ENDIAN_SWAP_INT16(codes[y * 2]); - if (code & 0x8000) continue; // only 8mb of sprites... - - INT32 attr = BURN_ENDIAN_SWAP_INT16(codes[y * 2 + 1]); - - INT32 yy = (((sy + y * ydim) >> 16) & 0x1ff) - 16; - - if (sx >= nScreenWidth || yy >= nScreenHeight || !DrvSprTransTab[code]) continue; - - if (yscale != 16 || xscale != 16) { - draw_16x16_zoom(code, attr & 0xff00, sx, yy, xscale, yscale, attr & 1, attr & 2); - continue; - } - - if (DrvSprTransTab[code] & 2) { - if (sx < 0 || sx > (nScreenWidth-16) || yy < 0 || yy > (nScreenHeight-16)) { - if (attr & 2) { - if (attr & 1) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, yy, attr >> 8, 8, 0, DrvSprROM); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, yy, attr >> 8, 8, 0, DrvSprROM); - } - } else { - if (attr & 1) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, yy, attr >> 8, 8, 0, DrvSprROM); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, yy, attr >> 8, 8, 0, DrvSprROM); - } - } - } else { - if (attr & 2) { - if (attr & 1) { - Render16x16Tile_FlipXY(pTransDraw, code, sx, yy, attr >> 8, 8, 0, DrvSprROM); - } else { - Render16x16Tile_FlipY(pTransDraw, code, sx, yy, attr >> 8, 8, 0, DrvSprROM); - } - } else { - if (attr & 1) { - Render16x16Tile_FlipX(pTransDraw, code, sx, yy, attr >> 8, 8, 0, DrvSprROM); - } else { - Render16x16Tile(pTransDraw, code, sx, yy, attr >> 8, 8, 0, DrvSprROM); - } - } - } - } else { - if (sx < 0 || sx > (nScreenWidth-16) || yy < 0 || yy > (nScreenHeight-16)) { - if (attr & 2) { - if (attr & 1) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, yy, attr >> 8, 8, 0, 0, DrvSprROM); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, yy, attr >> 8, 8, 0, 0, DrvSprROM); - } - } else { - if (attr & 1) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, yy, attr >> 8, 8, 0, 0, DrvSprROM); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, yy, attr >> 8, 8, 0, 0, DrvSprROM); - } - } - } else { - if (attr & 2) { - if (attr & 1) { - Render16x16Tile_Mask_FlipXY(pTransDraw, code, sx, yy, attr >> 8, 8, 0, 0, DrvSprROM); - } else { - Render16x16Tile_Mask_FlipY(pTransDraw, code, sx, yy, attr >> 8, 8, 0, 0, DrvSprROM); - } - } else { - if (attr & 1) { - Render16x16Tile_Mask_FlipX(pTransDraw, code, sx, yy, attr >> 8, 8, 0, 0, DrvSprROM); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, yy, attr >> 8, 8, 0, 0, DrvSprROM); - } - } - } - } - } - } -} - -static void draw_layer() -{ - UINT16 *vram = (UINT16*)(DrvGfxRAM + 0xe000); - - for (INT32 offs = 0; offs < 0x28 * 0x20; offs++) - { - INT32 sx = (offs >> 5) << 3; - INT32 sy = ((offs & 0x1f) << 3) - 16; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]) & 0xfff; - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[offs]) >> 12; - - if (sy < 0 || sy >= nScreenHeight || !DrvTxtTransTab[code]) continue; - - if (DrvTxtTransTab[code] & 2) { - Render8x8Tile(pTransDraw, code, sx, sy, color, 8, 0, DrvTxtROM); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 8, 0, 0, DrvTxtROM); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc0 != nBurnBpp) { - for (INT32 i = 0; i < 0x40000; i+=4) { - palette_write(i); - } - - DrvRecalc0 = nBurnBpp; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) - pTransDraw[i] = 0xfff; - - draw_sprites(); - - draw_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 6 * sizeof(UINT16)); - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy6[i] & 1) << i; - } - - DrvInputs[2] &= ~0x0008; - DrvInputs[5] = (DrvInputs[5] & 0xff00) | DrvDips[0]; - } - - SekOpen(0); - SekRun(12000000 / 60); - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - YMZ280BRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - EEPROMScan(nAction, pnMin); - - if (nAction & ACB_VOLATILE) { - - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - - SekScan(nAction); - - YMZ280BScan(); - } - - return 0; -} - - -// Live Quiz Show - -static struct BurnRomInfo livequizRomDesc[] = { - { "flash.u1", 0x200000, 0x8ec44493, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - - { "main_pic12c508a.u27",0x000400, 0xa84f0a7e, 2 | BRF_PRG | BRF_OPT }, // 1 Mcu Code (not used) - { "sub_pic12c508a.u4", 0x000400, 0xe52ebdc4, 2 | BRF_PRG | BRF_OPT }, // 2 - - { "flash.u15", 0x200000, 0xd6eb56f1, 3 | BRF_GRA }, // 3 Sprites - { "flash.u16", 0x200000, 0x4c9fd873, 3 | BRF_GRA }, // 4 - { "flash.u19", 0x200000, 0xdaa81532, 3 | BRF_GRA }, // 5 - { "flash.u20", 0x200000, 0xb540a8c7, 3 | BRF_GRA }, // 6 - - { "27c4096.u23", 0x080000, 0x25121de8, 4 | BRF_GRA }, // 7 Characters - - { "flash.u5", 0x200000, 0xdc062792, 5 | BRF_SND }, // 8 YMZ280b Samples -}; - -STD_ROM_PICK(livequiz) -STD_ROM_FN(livequiz) - -struct BurnDriver BurnDrvLivequiz = { - "livequiz", NULL, NULL, NULL, "1999", - "Live Quiz Show\0", NULL, "Andamiro Entertainment Co. Ltd.", "Andamiro Midas", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, livequizRomInfo, livequizRomName, NULL, NULL, LivequizInputInfo, LivequizDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x10000, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_mugsmash.cpp b/jan/src/burn/drv/pst90s/d_mugsmash.cpp deleted file mode 100644 index 09c599071..000000000 --- a/jan/src/burn/drv/pst90s/d_mugsmash.cpp +++ /dev/null @@ -1,690 +0,0 @@ -// FB Alpha Mug Smashers driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvVidRegs; -static UINT8 *DrvSndRegs; - -static UINT32 *DrvPalette; -static UINT32 *Palette; - -static UINT8 DrvRecalc; - -static INT32 *DrvScrollX; -static INT32 *DrvScrollY; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[4]; -static UINT16 DrvInps[4]; - -static UINT8 *soundlatch; - -static struct BurnInputInfo MugsmashInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 9, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip"}, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip"}, -}; - -STDINPUTINFO(Mugsmash) - -static struct BurnDIPInfo MugsmashDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xe1, NULL }, - {0x15, 0xff, 0xff, 0xda, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Color Test" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Draw SF." }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x0e, 0x0c, "4 Coins 1 Credits " }, - {0x14, 0x01, 0x0e, 0x0a, "3 Coins 1 Credits " }, - {0x14, 0x01, 0x0e, 0x08, "2 Coins 1 Credits " }, - {0x14, 0x01, 0x0e, 0x00, "1 Coin 1 Credits " }, - {0x14, 0x01, 0x0e, 0x02, "1 Coin 2 Credits " }, - {0x14, 0x01, 0x0e, 0x04, "1 Coin 3 Credits " }, - {0x14, 0x01, 0x0e, 0x06, "1 Coin 4 Credits " }, - {0x14, 0x01, 0x0e, 0x0e, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Allow_Continue" }, - {0x14, 0x01, 0x10, 0x10, "No" }, - {0x14, 0x01, 0x10, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Sound Test" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo_Sounds" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x06, 0x00, "1" }, - {0x15, 0x01, 0x06, 0x02, "2" }, - {0x15, 0x01, 0x06, 0x04, "3" }, - {0x15, 0x01, 0x06, 0x06, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x30, 0x00, "Very_Easy" }, - {0x15, 0x01, 0x30, 0x10, "Easy" }, - {0x15, 0x01, 0x30, 0x20, "Hard" }, - {0x15, 0x01, 0x30, 0x30, "Very_Hard" }, - - {0 , 0xfe, 0 , 2, "Draw Objects" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, -}; - -STDDIPINFO(Mugsmash) - -UINT8 __fastcall mugsmash_read_byte(UINT32 address) -{ - switch (address) - { - case 0x180000: - case 0x180001: - case 0x180002: - case 0x180003: - case 0x180004: - case 0x180005: - case 0x180006: - case 0x180007: - return DrvInps[(address >> 1) & 3] >> ((~address & 1) << 3); - } - - return 0; -} - -UINT16 __fastcall mugsmash_read_word(UINT32 address) -{ - switch (address) - { - case 0x180000: - case 0x180002: - case 0x180004: - case 0x180006: - return DrvInps[(address >> 1) & 3]; - } - - return 0; -} - -static void palette_write(INT32 offset) -{ - UINT16 data = *((UINT16*)(DrvPalRAM + offset)); - - UINT8 r,g,b; - - r = (data >> 10); - r = (r << 3) | (r >> 2); - - g = (data >> 5); - g = (g << 3) | (r >> 2); - - b = (data >> 0); - b = (b << 3) | (b >> 2); - - Palette[offset >> 1] = (r << 16) | (g << 8) | (b); - DrvPalette[offset >> 1] = BurnHighCol(r, g, b, 0); -} - -void __fastcall mugsmash_write_byte(UINT32 address, UINT8 data) -{ - if (address >= 0x100000 && address <= 0x1005ff) { - DrvPalRAM[address & 0x7ff] = data; - - palette_write(address & 0x7ff); - - return; - } - - switch (address) - { - case 0x0c0000: - case 0x0c0001: - case 0x0c0002: - case 0x0c0003: - case 0x0c0004: - case 0x0c0005: - case 0x0c0006: - case 0x0c0007: - DrvVidRegs[address & 7] = data; - return; - - case 0x140002: - case 0x140003: - ZetNmi(); - case 0x140000: - case 0x140001: - case 0x140004: - case 0x140005: - case 0x140006: - case 0x140007: - DrvSndRegs[address & 7] = data; - return; - } -} - -void __fastcall mugsmash_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0x100000 && address <= 0x1005ff) { - *((UINT16*)(DrvPalRAM + (address & 0x7fe))) = data; - - palette_write(address & 0x7fe); - - return; - } - - switch (address) - { - case 0x0c0000: - *((UINT16*)(DrvVidRegs + (address & 7))) = BURN_ENDIAN_SWAP_INT16(data); - DrvScrollX[1] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvVidRegs + 4))) + 7; - return; - - case 0x0c0002: - *((UINT16*)(DrvVidRegs + (address & 7))) = BURN_ENDIAN_SWAP_INT16(data); - DrvScrollY[1] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvVidRegs + 6))) + 12; - return; - - case 0x0c0004: - *((UINT16*)(DrvVidRegs + (address & 7))) = BURN_ENDIAN_SWAP_INT16(data); - DrvScrollX[0] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvVidRegs + 0))) + 3; - return; - - case 0x0c0006: - *((UINT16*)(DrvVidRegs + (address & 7))) = BURN_ENDIAN_SWAP_INT16(data); - DrvScrollY[0] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvVidRegs + 2))) + 12; - return; - - case 0x140002: - ZetNmi(); - case 0x140000: - case 0x140004: - case 0x140006: - *((UINT16*)(DrvSndRegs + (address & 7))) = BURN_ENDIAN_SWAP_INT16(data); - return; - } -} - -void __fastcall mugsmash_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8800: - BurnYM2151SelectRegister(data); - return; - - case 0x8801: - BurnYM2151WriteRegister(data); - return; - - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall mugsmash_sound_read(UINT16 address) -{ - switch (address) - { - case 0x8801: - return BurnYM2151ReadStatus(); - - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - return *soundlatch; - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0, 1, 2, 3 }; - INT32 XOffs0[16] = { 16, 20, 24, 28, 0, 4, 8, 12, 48, 52, 56, 60, 32, 36, 40, 44 }; - INT32 YOffs0[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; - - INT32 Plane1[4] = { 0xc00000, 0x800000, 0x400000, 0x000000 }; - INT32 XOffs1[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; - INT32 YOffs1[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x300000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x300000); - - GfxDecode(0x6000, 4, 16, 16, Plane0, XOffs0, YOffs0, 0x400, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x010000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvGfxROM0 = Next; Next += 0x600000; - DrvGfxROM1 = Next; Next += 0x400000; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x004000; - DrvVidRAM0 = Next; Next += 0x001000; - DrvVidRAM1 = Next; Next += 0x001000; - - DrvVidRegs = Next; Next += 0x000008; - DrvSndRegs = Next; Next += 0x000008; - - DrvScrollX = (INT32*)Next; Next += 0x000002 * sizeof(INT32); - DrvScrollY = (INT32*)Next; Next += 0x000002 * sizeof(INT32); - - DrvZ80RAM = Next; Next += 0x000800; - - Palette = (UINT32*)Next; Next += 0x0300 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - return 0; -} - -void MugsmashYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - for (INT32 i = 0; i < 6; i+=2) { - if (BurnLoadRom(DrvGfxROM0 + i * 0x80000 + 0, i + 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + i * 0x80000 + 1, i + 4, 2)) return 1; - } - - for (INT32 i = 0; i < 4; i++) - if (BurnLoadRom(DrvGfxROM1 + i * 0x80000, i + 9, 1)) return 1; - - for (INT32 i = 0; i < 2; i++) - if (BurnLoadRom(DrvSndROM + i * 0x20000, i + 13, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvVidRAM0, 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x082000, 0x082fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x100000, 0x1005ff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x1c0000, 0x1cffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x200000, 0x203fff, MAP_RAM); - SekSetWriteByteHandler(0, mugsmash_write_byte); - SekSetWriteWordHandler(0, mugsmash_write_word); - SekSetReadByteHandler(0, mugsmash_read_byte); - SekSetReadWordHandler(0, mugsmash_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(mugsmash_sound_write); - ZetSetReadHandler(mugsmash_sound_read); - ZetClose(); - - GenericTilesInit(); - - soundlatch = DrvSndRegs + 2; - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&MugsmashYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1122000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - - MSM6295Exit(0); - BurnYM2151Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - const UINT16 *source = (const UINT16*)DrvSprRAM; - const UINT16 *finish = source + 0x2000; - - while (source < finish) - { - INT32 xpos = BURN_ENDIAN_SWAP_INT16(source[0]) & 0x00ff; - INT32 ypos = BURN_ENDIAN_SWAP_INT16(source[4]) & 0x00ff; - INT32 num = (BURN_ENDIAN_SWAP_INT16(source[3]) & 0x00ff) | ((BURN_ENDIAN_SWAP_INT16(source[2]) & 0x00ff) << 8); - INT32 attr = BURN_ENDIAN_SWAP_INT16(source[1]); - INT32 flipx = (attr & 0x0080)>>7; - INT32 color = attr & 0x000f; - - xpos += (attr & 0x0020) << 3; - ypos += (attr & 0x0010) << 4; - - xpos -= 28; - ypos -= 24; - - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, num, xpos, ypos, color, 4, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, num, xpos, ypos, color, 4, 0, 0, DrvGfxROM0); - } - - source += 8; - } -} - -static void draw_layer(UINT8 *source, INT32 colofst, INT32 scroll) -{ - UINT16 *vram = (UINT16*)source; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[(offs << 1) | 1]); - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[(offs << 1)]); - INT32 flipx = color & 0x40; - INT32 flipy = color & 0x80; - color &= 0x000f; - - sx -= DrvScrollX[scroll] & 0x1ff; - sy -= DrvScrollY[scroll] & 0x1ff; - if (sx < -15) sx += 0x200; - if (sy < -15) sy += 0x200; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, colofst, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, colofst, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, colofst, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, colofst, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x300; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - } - - memset (pTransDraw, 0, nScreenWidth * nScreenHeight * 2); - - draw_layer(DrvVidRAM1, 0x200, 1); - draw_layer(DrvVidRAM0, 0x100, 0); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - for (INT32 i = 0; i < 4; i++) { - DrvInps[i] = (DrvDips[i] << 8) | 0xff; - } - - for (INT32 i = 0; i < 16; i++) { - DrvInps[0] ^= (DrvJoy1[i] & 1) << i; - DrvInps[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 12000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment; - - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - nSegment = (nCyclesTotal[1] - nCyclesDone[1]) / (nInterleave - i); - nCyclesDone[1] += ZetRun(nSegment); - - nSegment = nBurnSoundLen / nInterleave; - - if (pBurnSoundOut) { - BurnYM2151Render(pBurnSoundOut + ((nSegment * i) << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + ((nSegment * i) << 1), nSegment); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029697; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - } - - return 0; -} - - -// Mug Smashers - -static struct BurnRomInfo mugsmashRomDesc[] = { - { "mugs_04.bin", 0x40000, 0x2498fd27, 1 | BRF_PRG | BRF_ESS }, // 0 68000 Code - { "mugs_05.bin", 0x40000, 0x95efb40b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mugs_03.bin", 0x10000, 0x0101df2d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "mugs_11.bin", 0x80000, 0x1c9f5acf, 3 | BRF_GRA }, // 3 Sprites - { "mugs_10.bin", 0x80000, 0x6b3c22d9, 3 | BRF_GRA }, // 4 - { "mugs_09.bin", 0x80000, 0x4e9490f3, 3 | BRF_GRA }, // 5 - { "mugs_08.bin", 0x80000, 0x716328d5, 3 | BRF_GRA }, // 6 - { "mugs_07.bin", 0x80000, 0x9e3167fd, 3 | BRF_GRA }, // 7 - { "mugs_06.bin", 0x80000, 0x8df75d29, 3 | BRF_GRA }, // 8 - - { "mugs_12.bin", 0x80000, 0xc0a6ed98, 4 | BRF_GRA }, // 9 Bg Tiles - { "mugs_13.bin", 0x80000, 0xe2be8595, 4 | BRF_GRA }, // 10 - { "mugs_14.bin", 0x80000, 0x24e81068, 4 | BRF_GRA }, // 11 - { "mugs_15.bin", 0x80000, 0x82e8187c, 4 | BRF_GRA }, // 12 - - { "mugs_02.bin", 0x20000, 0xf92a7f4a, 5 | BRF_GRA }, // 13 Samples - { "mugs_01.bin", 0x20000, 0x1a3a0b39, 5 | BRF_GRA }, // 14 -}; - -STD_ROM_PICK(mugsmash) -STD_ROM_FN(mugsmash) - -struct BurnDriver BurnDrvMugsmash = { - "mugsmash", NULL, NULL, NULL, "1990?", - "Mug Smashers\0", NULL, "Electronic Devices Italy / 3D Games England", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, mugsmashRomInfo, mugsmashRomName, NULL, NULL, MugsmashInputInfo, MugsmashDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_mwarr.cpp b/jan/src/burn/drv/pst90s/d_mwarr.cpp deleted file mode 100644 index e7be93266..000000000 --- a/jan/src/burn/drv/pst90s/d_mwarr.cpp +++ /dev/null @@ -1,1214 +0,0 @@ -// Fb Alpha Mighty Warrior / Steel Force / Twin Brats driver module -// Based on MAME drivers by Pierpaolo Prazzoli, David Haywood, and stephh -// -// for later: figure out why the 3rd tile layer needs prio-hack, otherwise -// mwarr title goes under the sprites in the attract mode. -// - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" -#include "eeprom.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvMloRAM; -static UINT8 *DrvMhiRAM; -static UINT8 *DrvVidAttrRAM; -static UINT8 *DrvMhiScrollRAM; -static UINT8 *DrvMloScrollRAM; -static UINT8 *DrvBgScrollRAM; -static UINT8 *DrvUnkRAM0; -static UINT8 *DrvUnkRAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT32 sprite_mask; -static INT32 sprite_command_switch; -static INT32 nSoundBank[2]; - -static INT32 game_select; -static INT32 DrvSpriteBpp; -static INT32 vblank; -static INT32 global_x_offset; - -static UINT32 bright; - -static UINT8 DrvReset; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT16 DrvInps[2]; - -static UINT8 DrvSrv[1] = { 0 }; // stlforce, twinbrat - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo StlforceInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service Mode",BIT_DIGITAL, DrvSrv + 0, "diag" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Stlforce) - -static struct BurnDIPInfo MwarrDIPList[]= -{ - {0x13, 0xff, 0xff, 0xbb, NULL }, - {0x14, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x03, "Very Easy" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Mutant" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "5 Coin 1 Credit" }, - {0x14, 0x01, 0x07, 0x01, "4 Coin 1 Credit" }, - {0x14, 0x01, 0x07, 0x02, "3 Coin 1 Credit" }, - {0x14, 0x01, 0x07, 0x03, "2 Coin 1 Credit" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "5 Coin 1 Credit" }, - {0x14, 0x01, 0x38, 0x08, "4 Coin 1 Credit" }, - {0x14, 0x01, 0x38, 0x10, "3 Coin 1 Credit" }, - {0x14, 0x01, 0x38, 0x18, "2 Coin 1 Credit" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow_Continue" }, - {0x14, 0x01, 0x40, 0x40, "No" }, - {0x14, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Mwarr) - -static inline void palette_write(INT32 offset) -{ - UINT16 p = *((UINT16*)(DrvPalRAM + offset)); - - UINT16 b = (p >> 10) & 0x1f; - b = (((b << 3) | (b >> 2)) * bright) / 256; - - UINT16 g = (p >> 5) & 0x1f; - g = (((g << 3) | (g >> 2)) * bright) / 256; - - UINT16 r = (p >> 0) & 0x1f; - r = (((r << 3) | (r >> 2)) * bright) / 256; - - DrvPalette[offset / 2] = BurnHighCol(r, g, b, 0); -} - -static void set_brightness(UINT16 data) -{ - bright = (data * 256) / 255; - - for (int i = 0; i < 0x1000; i+=2) { - palette_write(i); - } -} - -static void sprite_buffer_command(INT32 data) -{ - if (sprite_command_switch) - { - switch (data) - { - case 0x00: // clear sprites - memset (DrvSprBuf, 0, 0x1000); - sprite_command_switch = 0; // otherwise no sprites for mwarr - break; - - case 0x0d: // keep sprites - break; - - case 0x07: // mighty warrior / twin brats / steel force - case 0x09: // twin brats - case 0x0a: // mighty warrior - case 0x0b: // mighty warrior - case 0x0e: // mighty warrior - case 0x0f: // mighty warrior - default: - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - break; - } - } - - sprite_command_switch ^= 1; -} - -static void set_sound_bank(INT32 chip, INT32 data) -{ - if (nSoundBank[chip] == (data & 3)) return; - - nSoundBank[chip] = data & 0x03; - - INT32 nBank = (data & 0x03) * 0x20000; - - memcpy (MSM6295ROM + (chip * 0x100000) + 0x20000, ((chip) ? DrvSndROM1 : DrvSndROM0) + nBank, 0x20000); -} - -static void __fastcall mwarr_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0x104000) { - DrvPalRAM[(address & 0xfff)^1] = data; - palette_write(address & 0xffe); - return; - } - - if (address >= 0x110020 && address <= 0x11ffff) { - Drv68KRAM[(address & 0xffff)^1] = data; - return; - } - - switch (address) - { - case 0x110011: - set_sound_bank(1, data); - return; - - case 0x180001: - MSM6295Command(0, data); - return; - - case 0x190001: - MSM6295Command(1, data); - return; - - case 0x110017: - sprite_buffer_command(data); - break; - } - - if (address >= 0x110000 && address <= 0x11ffff) { - Drv68KRAM[(address & 0xffff)^1] = data; - return; - } -} - -static void __fastcall mwarr_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x104000) { - *((UINT16 *)(DrvPalRAM + (address & 0xffe))) = data; - palette_write(address & 0xffe); - return; - } - - if (address >= 0x110020 && address <= 0x11ffff) { - *((UINT16*)(Drv68KRAM + (address & 0xfffe))) = data; - return; - } - - switch (address) - { - case 0x110010: - set_sound_bank(1, data); - break; - - case 0x110014: - set_brightness(data); - break; - - case 0x110016: - sprite_buffer_command(data); - break; - } - - if (address >= 0x110000 && address <= 0x11ffff) { - *((UINT16*)(Drv68KRAM + (address & 0xfffe))) = data; - return; - } -} - -static UINT8 __fastcall mwarr_read_byte(UINT32 address) -{ - switch (address) - { - case 0x180001: - return MSM6295ReadStatus(0); - - case 0x190001: - return MSM6295ReadStatus(1); - } - - return 0; -} - -static void __fastcall stlforce_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0x104000) { - DrvPalRAM[(address & 0xfff)^1] = data; - palette_write(address & 0xffe); - return; - } - switch (address) - { - case 0x400011: - EEPROMWrite(data & 0x04, data & 0x02, data & 0x01); - return; - - case 0x410001: - MSM6295Command(0, data); - return; - - case 0x400012: - set_sound_bank(0, data); - return; - } -} - -static void __fastcall stlforce_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x104000) { - *((UINT16 *)(DrvPalRAM + (address & 0xffe))) = data; - palette_write(address & 0xffe); - return; - } - - switch (address) - { - case 0x400012: - // set_sound_bank(0, data); - return; - - case 0x40001e: - sprite_buffer_command(data); - return; - } -} - -static UINT8 __fastcall stlforce_read_byte(UINT32 address) -{ - switch (address) - { - case 0x400000: - return DrvInps[0] >> 8; - - case 0x400001: - return DrvInps[0]; - - case 0x400003: - return (DrvInps[1] & ~0x58) | (DrvSrv[0] ? 0x00 : 0x08) | (EEPROMRead() ? 0x40 : 0) | vblank; - - case 0x410001: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static int DrvGfxDecode(INT32 sprite_length, INT32 sprite_bpp) -{ - INT32 fract = (sprite_length / sprite_bpp) * 8; - - INT32 Plane0[6] = { fract * 5, fract * 4, fract * 3, fract * 2, fract * 1, fract * 0 }; - INT32 XOffs0[16] = { STEP8(128+7, -1), STEP8(7, -1) }; - INT32 YOffs0[16] = { STEP16(0, 8) }; - - INT32 Plane1[4] = { STEP4(0,1) }; - INT32 XOffs1[16] = { 12,8,4,0,28,24,20,16,16*32+12,16*32+8,16*32+4,16*32+0,16*32+28,16*32+24,16*32+20,16*32+16 }; - INT32 YOffs1[16] = { STEP16(0,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(sprite_length); - - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, sprite_length); - - sprite_mask = fract / (16 * 16); - GfxDecode(sprite_mask, sprite_bpp, 16, 16, Plane0 + (6 - sprite_bpp), XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - sprite_mask--; - //bprintf(0, _T("sprite mask: %X.\n"), sprite_mask); - memcpy (tmp, DrvGfxROM1, 0x040000); - - GfxDecode(0x2000, 4, 8, 8, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM3); - - memcpy (tmp, DrvGfxROM4, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM4); - - DrvSpriteBpp = sprite_bpp; - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex(INT32 mwarr) -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - - DrvGfxROM0 = Next; Next += (mwarr) ? 0xc00000 : 0x200000; - DrvGfxROM1 = Next; Next += 0x100000; - DrvGfxROM2 = Next; Next += 0x200000; - DrvGfxROM3 = Next; Next += 0x200000; - DrvGfxROM4 = Next; Next += 0x200000; - - MSM6295ROM = Next; Next += 0x140000; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(INT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x018000; - DrvPalRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - DrvSprBuf = Next; Next += 0x001000; - - DrvVidAttrRAM = Next; Next += 0x000400; - DrvMhiScrollRAM = Next; Next += 0x000400; - DrvMloScrollRAM = Next; Next += 0x000400; - DrvBgScrollRAM = Next; Next += 0x000400; - - DrvTxtRAM = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x000800; - DrvMloRAM = Next; Next += 0x000800; - DrvMhiRAM = Next; Next += 0x000800; - - DrvUnkRAM0 = Next; Next += 0x000800; - DrvUnkRAM1 = Next; Next += 0x003000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - - if (game_select == 0) - { - MSM6295Reset(1); - } - else - { - EEPROMReset(); - - if (!EEPROMAvailable()) - { - UINT8 eeprom[128]; - BurnLoadRom(eeprom, 11, 1); - EEPROMFill(eeprom, 0, 128); - } - } - - memcpy (MSM6295ROM + 0x000000, DrvSndROM0, 0x20000); - memcpy (MSM6295ROM + 0x100000, DrvSndROM1, 0x20000); - - nSoundBank[0] = nSoundBank[1] = 0xff; - set_sound_bank(0, 1); - set_sound_bank(1, 0); - - sprite_command_switch = 0; - - bright = 0xff; // start off at full brightness - - return 0; -} - -static tilemap_callback( bg ) -{ - UINT16 *ram = (UINT16*)DrvBgRAM; - - TILE_SET_INFO(4, ram[offs] & 0x1fff, ram[offs] >> 13, 0); -} - -static tilemap_callback( low ) -{ - UINT16 *ram = (UINT16*)DrvMloRAM; - - TILE_SET_INFO(3, ram[offs] & 0x1fff, ram[offs] >> 13, 0); -} - -static tilemap_callback( mid ) -{ - UINT16 *ram = (UINT16*)DrvMhiRAM; - - TILE_SET_INFO(2, ram[offs] & 0x1fff, ram[offs] >> 13, 0); -} - -static tilemap_callback( txt ) -{ - UINT16 *ram = (UINT16*)DrvTxtRAM; - - TILE_SET_INFO(1, ram[offs] & 0x1fff, ram[offs] >> 13, 0); -} - -static INT32 MwarrInit() -{ - game_select = 0; - - BurnSetRefreshRate(54.0); - - AllMem = NULL; - MemIndex(1); - int nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(1); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x180000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x280000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x300000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x380000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x480000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x500000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x580000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x600000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x680000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x700000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x780000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x800000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x880000, 19, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 21, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 22, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 23, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000001, 24, 2)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 25, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000001, 26, 2)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 27, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 28, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 29, 1)) return 1; - - DrvGfxDecode(0x900000, 6); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvBgRAM, 0x100000, 0x1007ff, MAP_RAM); - SekMapMemory(DrvMloRAM, 0x100800, 0x100fff, MAP_RAM); - SekMapMemory(DrvMhiRAM, 0x101000, 0x1017ff, MAP_RAM); - SekMapMemory(DrvTxtRAM, 0x101800, 0x1027ff, MAP_RAM); - SekMapMemory(DrvUnkRAM0, 0x102800, 0x102fff, MAP_RAM); - SekMapMemory(DrvBgScrollRAM, 0x103000, 0x1033ff, MAP_RAM); - SekMapMemory(DrvMloScrollRAM, 0x103400, 0x1037ff, MAP_RAM); - SekMapMemory(DrvMhiScrollRAM, 0x103800, 0x103bff, MAP_RAM); - SekMapMemory(DrvVidAttrRAM, 0x103c00, 0x103fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x104000, 0x104fff, MAP_ROM); // handler - SekMapMemory(DrvUnkRAM1, 0x105000, 0x107fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x108000, 0x108fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x110000, 0x1103ff, MAP_ROM); - SekMapMemory(Drv68KRAM + 0x400, 0x110400, 0x11ffff, MAP_RAM); - SekSetWriteByteHandler(0, mwarr_write_byte); - SekSetWriteWordHandler(0, mwarr_write_word); - SekSetReadByteHandler(0, mwarr_read_byte); -// SekSetReadWordHandler(0, mwarr_read_word); - SekClose(); - - MSM6295Init(0, 937500 / 132, 1); - MSM6295Init(1, 937500 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - global_x_offset = 8; - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_COLS, bg_map_callback, 16, 16, 64, 16); - GenericTilemapInit(1, TILEMAP_SCAN_COLS, low_map_callback, 16, 16, 64, 16); - GenericTilemapInit(2, TILEMAP_SCAN_COLS, mid_map_callback, 16, 16, 64, 16); - GenericTilemapInit(3, TILEMAP_SCAN_ROWS, txt_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(1, DrvGfxROM1, 4, 16, 16, 0x200000, 0x180, 0x07); - GenericTilemapSetGfx(2, DrvGfxROM2, 4, 16, 16, 0x200000, 0x100, 0x07); - GenericTilemapSetGfx(3, DrvGfxROM3, 4, 16, 16, 0x200000, 0x080, 0x07); - GenericTilemapSetGfx(4, DrvGfxROM4, 4, 8, 8, 0x100000, 0x000, 0x07); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetTransparent(2, 0); - GenericTilemapSetTransparent(3, 0); - GenericTilemapSetOffsets(TMAP_GLOBAL, -global_x_offset, 0); - GenericTilemapSetOffsets(3, -24, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 CommonInit(INT32 select, INT32 xoffset) -{ - game_select = select; - - BurnSetRefreshRate(58.0); - - AllMem = NULL; - MemIndex(0); - int nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(0); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x000001, 7, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 9, 2)) return 1; - - memcpy (DrvGfxROM1 + 0x000000, DrvGfxROM2 + 0x080000, 0x040000); - memcpy (DrvGfxROM3 + 0x000000, DrvGfxROM4 + 0x080000, 0x080000); - memcpy (DrvGfxROM3 + 0x080000, DrvGfxROM4 + 0x080000, 0x080000); - memcpy (DrvGfxROM4 + 0x080000, DrvGfxROM4 + 0x000000, 0x080000); - memcpy (DrvGfxROM2 + 0x080000, DrvGfxROM2 + 0x000000, 0x080000); - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 10, 1)) return 1; - - DrvGfxDecode(0x100000, 4); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvBgRAM, 0x100000, 0x1007ff, MAP_RAM); - SekMapMemory(DrvMloRAM, 0x100800, 0x100fff, MAP_RAM); - SekMapMemory(DrvMhiRAM, 0x101000, 0x1017ff, MAP_RAM); - SekMapMemory(DrvTxtRAM, 0x101800, 0x1027ff, MAP_RAM); - SekMapMemory(DrvUnkRAM0, 0x102800, 0x102fff, MAP_RAM); - SekMapMemory(DrvBgScrollRAM, 0x103000, 0x1033ff, MAP_RAM); - SekMapMemory(DrvMloScrollRAM, 0x103400, 0x1037ff, MAP_RAM); - SekMapMemory(DrvMhiScrollRAM, 0x103800, 0x103bff, MAP_RAM); - SekMapMemory(DrvVidAttrRAM, 0x103c00, 0x103fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x104000, 0x104fff, MAP_ROM); // handler - SekMapMemory(DrvUnkRAM1, 0x105000, 0x107fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x108000, 0x108fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x109000, 0x11ffff, MAP_RAM); - SekSetWriteByteHandler(0, stlforce_write_byte); - SekSetWriteWordHandler(0, stlforce_write_word); - SekSetReadByteHandler(0, stlforce_read_byte); - //SekSetReadWordHandler(0, stlforce_read_word); - SekClose(); - - MSM6295Init(0, 937500 / 132, 0); - MSM6295SetRoute(0, 0.70, BURN_SND_ROUTE_BOTH); // should be 1.00, way too loud. - - EEPROMInit(&eeprom_interface_93C46); - - global_x_offset = xoffset; - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_COLS, bg_map_callback, 16, 16, 64, 16); - GenericTilemapInit(1, TILEMAP_SCAN_COLS, low_map_callback, 16, 16, 64, 16); - GenericTilemapInit(2, TILEMAP_SCAN_COLS, mid_map_callback, 16, 16, 64, 16); - GenericTilemapInit(3, TILEMAP_SCAN_ROWS, txt_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(1, DrvGfxROM1, 4, 16, 16, 0x200000, 0x180, 0x07); - GenericTilemapSetGfx(2, DrvGfxROM2, 4, 16, 16, 0x200000, 0x100, 0x07); - GenericTilemapSetGfx(3, DrvGfxROM3, 4, 16, 16, 0x200000, 0x080, 0x07); - GenericTilemapSetGfx(4, DrvGfxROM4, 4, 8, 8, 0x100000, 0x000, 0x07); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetTransparent(2, 0); - GenericTilemapSetTransparent(3, 0); - GenericTilemapSetOffsets(TMAP_GLOBAL, -global_x_offset, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 StlforceInit() -{ - INT32 nRet = CommonInit(1, 8); - - GenericTilemapSetOffsets(3, -24, 0); - - return nRet; -} - -static INT32 TwinbratInit() -{ - INT32 nRet = CommonInit(2, 16); - - GenericTilemapSetOffsets(TMAP_GLOBAL, -global_x_offset, 1); - GenericTilemapSetOffsets(3, -32, 0); - - global_x_offset = 24+3; - - return nRet; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - - MSM6295Exit(0); - if (game_select == 0) - MSM6295Exit(1); - else - EEPROMExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - game_select = 0; - DrvSpriteBpp = 0; - - return 0; -} - -static void draw_sprites(INT32 use_priority) -{ - const UINT16 *source = (UINT16*)(DrvSprBuf + 0x1000-8); - const UINT16 *finish = (UINT16*)(DrvSprBuf); - - INT32 x_offset = global_x_offset; - - if (game_select == 2) x_offset -= 9; - if (game_select == 1) x_offset += 0; - if (game_select == 0) x_offset += 9; - - while (source >= finish) - { - if (source[0] & 0x0800) - { - INT32 y = 512 - (source[0] & 0x01ff); - INT32 x = (source[3] & 0x3ff) - x_offset; - INT32 color = ((source[1] & 0x000f) << DrvSpriteBpp) + 0x400; - INT32 flipx = source[1] & 0x0200; - INT32 dy = (source[0] & 0xf000) >> 12; - - INT32 pri_mask = ~((1 << (((source[1] & 0x3c00) >> 10) + 1)) - 1); - if (use_priority == 0) pri_mask = ~0xffff; // over everything except text layer - - for (INT32 i = 0; i <= dy; i++) - { - INT32 yy = y + i * 16; - INT32 code = (source[2]+i);// & sprite_mask; // breaks mwarr sprites. - RenderPrioSprite(pTransDraw, DrvGfxROM0, code, color, 0, x , yy , flipx, 0, 16, 16, pri_mask); - RenderPrioSprite(pTransDraw, DrvGfxROM0, code, color, 0, x-1024, yy , flipx, 0, 16, 16, pri_mask); - RenderPrioSprite(pTransDraw, DrvGfxROM0, code, color, 0, x-1024, yy-512, flipx, 0, 16, 16, pri_mask); - RenderPrioSprite(pTransDraw, DrvGfxROM0, code, color, 0, x , yy-512, flipx, 0, 16, 16, pri_mask); - } - } - - source -= 0x04; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - UINT16 *scroll = (UINT16 *)DrvVidAttrRAM; - UINT16 *bgscroll = (UINT16 *)DrvBgScrollRAM; - UINT16 *loscroll = (UINT16 *)DrvMloScrollRAM; - UINT16 *mgscroll = (UINT16 *)DrvMhiScrollRAM; - - if (scroll[6] & 0x01) { - GenericTilemapSetScrollRows(0, 256); - - for (INT32 y = 0; y < 256; y++) { - GenericTilemapSetScrollRow(0, y, bgscroll[y] + 20); - } - } else { - GenericTilemapSetScrollRows(0, 1); - GenericTilemapSetScrollX(0, bgscroll[0] + 19); - } - - if (scroll[6] & 0x04) { - GenericTilemapSetScrollRows(1, 256); - - for (INT32 y = 0; y < 256; y++) { - GenericTilemapSetScrollRow(1, y, loscroll[y] + 19); - } - } else { - GenericTilemapSetScrollRows(1, 1); - GenericTilemapSetScrollX(1, loscroll[0] + 19); - } - - if (scroll[6] & 0x10) { - GenericTilemapSetScrollRows(2, 256); - - for (INT32 y = 0; y < 256; y++) { - GenericTilemapSetScrollRow(2, y, mgscroll[y] + 19); - } - } else { - GenericTilemapSetScrollRows(2, 1); - GenericTilemapSetScrollX(2, mgscroll[0] + 19); - } - - GenericTilemapSetScrollX(3, scroll[0]); - - GenericTilemapSetScrollY(0, scroll[1] + 1); - GenericTilemapSetScrollY(1, scroll[2] + 1); - GenericTilemapSetScrollY(2, scroll[3] + 1); - GenericTilemapSetScrollY(3, scroll[4] + 1); - - if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, 0x01); - if (nBurnLayer & 2) GenericTilemapDraw(1, pTransDraw, 0x02); - if (nBurnLayer & 4) GenericTilemapDraw(2, pTransDraw, 0x08); // this should be 0x04, but something is wrong somewhere. -dink - if (nBurnLayer & 8) GenericTilemapDraw(3, pTransDraw, 0x10); - - if (nSpriteEnable & 1) draw_sprites((game_select) ? 0 : 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 stlforceFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInps, 0xff, 4); - - for (INT32 i = 0; i < 16; i++) { - DrvInps[0] ^= (DrvJoy1[i] & 1) << i; - DrvInps[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCycleSegment = 0; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal = (((game_select == 2) ? 14745600 : 15000000) / 58); - INT32 nCyclesDone = 0; - - SekOpen(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone += SekRun(((i + 1) * nCyclesTotal / nInterleave) - nCyclesDone); - - if (i == 240) { - vblank = 0x10; - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCycleSegment = nBurnSoundLen / nInterleave; - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut + nSoundBufferPos, nCycleSegment); - nSoundBufferPos += (nCycleSegment << 1); - } - } - - nCycleSegment = nBurnSoundLen - (nSoundBufferPos>>1); - if (pBurnSoundOut && nCycleSegment > 0) { - MSM6295Render(0, pBurnSoundOut + nSoundBufferPos, nCycleSegment); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (Drv68KRAM, 0xff, 4); - UINT16 *inps = (UINT16*)Drv68KRAM; - - for (INT32 i = 0; i < 16; i++) { - inps[0] ^= (DrvJoy1[i] & 1) << i; - inps[1] ^= (DrvJoy2[i] & 1) << i; - } - - Drv68KRAM[4] = DrvDips[0]; - Drv68KRAM[5] = DrvDips[1]; - } - - INT32 nInterleave = 256; - INT32 nCycleSegment = 0; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal = 12000000 / 54; - INT32 nCyclesDone = 0; - - SekOpen(0); - - Drv68KRAM[2] &= ~0x04; // vblank - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone += SekRun(((i + 1) * nCyclesTotal / nInterleave) - nCyclesDone); - - if (i == 240) { - Drv68KRAM[2] |= 0x04; // vblank - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCycleSegment = nBurnSoundLen / nInterleave; - - if (pBurnSoundOut) { - memset (pBurnSoundOut + nSoundBufferPos, 0, nCycleSegment * 2 * sizeof(INT16)); - MSM6295Render(0, pBurnSoundOut + nSoundBufferPos, nCycleSegment); - MSM6295Render(1, pBurnSoundOut + nSoundBufferPos, nCycleSegment); - nSoundBufferPos += (nCycleSegment << 1); - } - } - - nCycleSegment = nBurnSoundLen - (nSoundBufferPos>>1); - if (pBurnSoundOut && nCycleSegment > 0) { - memset (pBurnSoundOut + nSoundBufferPos, 0, nCycleSegment * 2 * sizeof(INT16)); - MSM6295Render(0, pBurnSoundOut + nSoundBufferPos, nCycleSegment); - MSM6295Render(1, pBurnSoundOut + nSoundBufferPos, nCycleSegment); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(int nAction,int *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029697; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - MSM6295Scan(0, nAction); - if (game_select == 0) MSM6295Scan(1, nAction); - - SCAN_VAR(sprite_command_switch); - SCAN_VAR(bright); - - SCAN_VAR(nSoundBank[0]); - SCAN_VAR(nSoundBank[1]); - } - - if (nAction & ACB_WRITE) { - INT32 t = nSoundBank[0]; - nSoundBank[0] = 0xff; - set_sound_bank(0, t); - - t = nSoundBank[1]; - nSoundBank[1] = 0xff; - set_sound_bank(1, t); - - DrvRecalc = 1; - } - - return 0; -} - - -// Mighty Warriors - -static struct BurnRomInfo mwarrRomDesc[] = { - { "prg_ev", 0x80000, 0xd1d5e0a6, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "prg_od", 0x80000, 0xe5217d91, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "obm-0", 0x80000, 0xb4707ba1, 2 | BRF_GRA }, // 2 Sprites - { "obm-6", 0x80000, 0xf9675acc, 2 | BRF_GRA }, // 3 - { "obm-12", 0x80000, 0x6239c4dd, 2 | BRF_GRA }, // 4 - { "obm-1", 0x80000, 0x817dcead, 2 | BRF_GRA }, // 5 - { "obm-7", 0x80000, 0x3a93c499, 2 | BRF_GRA }, // 6 - { "obm-13", 0x80000, 0xbac42f06, 2 | BRF_GRA }, // 7 - { "obm-2", 0x80000, 0x68cd29b0, 2 | BRF_GRA }, // 8 - { "obm-8", 0x80000, 0xf9482638, 2 | BRF_GRA }, // 9 - { "obm-14", 0x80000, 0x79ed46b8, 2 | BRF_GRA }, // 10 - { "obm-3", 0x80000, 0x6e924cb8, 2 | BRF_GRA }, // 11 - { "obm-9", 0x80000, 0xbe1fb64e, 2 | BRF_GRA }, // 12 - { "obm-15", 0x80000, 0x5e0efb71, 2 | BRF_GRA }, // 13 - { "obm-4", 0x80000, 0xf34b67bd, 2 | BRF_GRA }, // 14 - { "obm-10", 0x80000, 0x00c68a23, 2 | BRF_GRA }, // 15 - { "obm-16", 0x80000, 0xe9516379, 2 | BRF_GRA }, // 16 - { "obm-5", 0x80000, 0xb2b976f3, 2 | BRF_GRA }, // 17 - { "obm-11", 0x80000, 0x7bf1e4da, 2 | BRF_GRA }, // 18 - { "obm-17", 0x80000, 0x47bd56e8, 2 | BRF_GRA }, // 19 - - { "sf4-0", 0x80000, 0x25938b2d, 3 | BRF_GRA }, // 20 Characters - { "sf4-1", 0x80000, 0x2269ce5c, 3 | BRF_GRA }, // 21 - - { "sf3-0", 0x80000, 0x86cd162c, 4 | BRF_GRA }, // 22 Background High Tiles - { "sf3-1", 0x80000, 0x2e755e54, 4 | BRF_GRA }, // 23 - - { "sf2-0", 0x80000, 0x622a1816, 5 | BRF_GRA }, // 24 Background Low Tiles - { "sf2-1", 0x80000, 0x545f89e9, 5 | BRF_GRA }, // 25 - - { "dw-0", 0x80000, 0xb9b18d00, 6 | BRF_GRA }, // 26 Background Tiles - { "dw-1", 0x80000, 0x7aea0b12, 6 | BRF_GRA }, // 27 - - { "oki0", 0x40000, 0x005811ce, 7 | BRF_SND }, // 28 M6295 #0 Samples - - { "oki1", 0x80000, 0xbcde2330, 8 | BRF_SND }, // 29 M6295 #1 Samples -}; - -STD_ROM_PICK(mwarr) -STD_ROM_FN(mwarr) - -struct BurnDriver BurnDrvMwarr = { - "mwarr", NULL, NULL, NULL, "199?", - "Mighty Warriors\0", NULL, "Elettronica Video-Games S.R.L.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, mwarrRomInfo, mwarrRomName, NULL, NULL, DrvInputInfo, MwarrDIPInfo, - MwarrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 366, 240, 4, 3 -}; - - -// Steel Force - -static struct BurnRomInfo stlforceRomDesc[] = { - { "stlforce.105", 0x20000, 0x3ec804ca, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "stlforce.104", 0x20000, 0x69b5f429, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "stlforce.u36", 0x40000, 0x037dfa9f, 2 | BRF_GRA }, // 2 Sprites - { "stlforce.u31", 0x40000, 0x305a8eb5, 2 | BRF_GRA }, // 3 - { "stlforce.u32", 0x40000, 0x760e8601, 2 | BRF_GRA }, // 4 - { "stlforce.u33", 0x40000, 0x19415cf3, 2 | BRF_GRA }, // 5 - - { "stlforce.u28", 0x80000, 0x6a4b7c98, 3 | BRF_GRA }, // 6 Background Tiles - { "stlforce.u27", 0x80000, 0xc42ef365, 3 | BRF_GRA }, // 7 - { "stlforce.u30", 0x80000, 0xcf19d43a, 3 | BRF_GRA }, // 8 - { "stlforce.u29", 0x80000, 0x30488f44, 3 | BRF_GRA }, // 9 - - { "stlforce.u1", 0x80000, 0x0a55edf1, 4 | BRF_SND }, // 10 M6295 #0 Samples - - { "eeprom-stlforce.bin", 0x0080, 0x3fb83951, 5 | BRF_PRG | BRF_ESS }, // 11 Default Eeprom -}; - -STD_ROM_PICK(stlforce) -STD_ROM_FN(stlforce) - -struct BurnDriver BurnDrvStlforce = { - "stlforce", NULL, NULL, NULL, "1994", - "Steel Force\0", NULL, "Electronic Devices Italy / Ecogames S.L. Spain", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, stlforceRomInfo, stlforceRomName, NULL, NULL, StlforceInputInfo, NULL, - StlforceInit, DrvExit, stlforceFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 368, 240, 4, 3 -}; - - - -// Twin Brats (set 1) - -static struct BurnRomInfo twinbratRomDesc[] = { - { "2.u105", 0x20000, 0x33a9bb82, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "3.u104", 0x20000, 0xb1186a67, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "11.bin", 0x40000, 0x00eecb03, 2 | BRF_GRA }, // 2 Sprites - { "10.bin", 0x40000, 0x7556bee9, 2 | BRF_GRA }, // 3 - { "9.bin", 0x40000, 0x13194d89, 2 | BRF_GRA }, // 4 - { "8.bin", 0x40000, 0x79f14528, 2 | BRF_GRA }, // 5 - - { "6.bin", 0x80000, 0xaf10ddfd, 3 | BRF_GRA }, // 6 Background Tiles - { "7.bin", 0x80000, 0x3696345a, 3 | BRF_GRA }, // 7 - { "4.bin", 0x80000, 0x1ae8a751, 3 | BRF_GRA }, // 8 - { "5.bin", 0x80000, 0xcf235eeb, 3 | BRF_GRA }, // 9 - - { "1.bin", 0x80000, 0x76296578, 4 | BRF_SND }, // 10 M6295 #0 Samples - - { "eeprom-twinbrat.bin", 0x0080, 0x9366263d, 5 | BRF_PRG | BRF_ESS }, // 11 Default Eeprom -}; - -STD_ROM_PICK(twinbrat) -STD_ROM_FN(twinbrat) - -struct BurnDriver BurnDrvTwinbrat = { - "twinbrat", NULL, NULL, NULL, "1995", - "Twin Brats (set 1)\0", NULL, "Elettronica Video-Games S.R.L.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, twinbratRomInfo, twinbratRomName, NULL, NULL, StlforceInputInfo, NULL, - TwinbratInit, DrvExit, stlforceFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 334, 240, 4, 3 -}; - - -// Twin Brats (set 2) - -static struct BurnRomInfo twinbrataRomDesc[] = { - { "2.bin", 0x20000, 0x5e75f568, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "3.bin", 0x20000, 0x0e3fa9b0, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "11.bin", 0x40000, 0x00eecb03, 2 | BRF_GRA }, // 2 Sprites - { "10.bin", 0x40000, 0x7556bee9, 2 | BRF_GRA }, // 3 - { "9.bin", 0x40000, 0x13194d89, 2 | BRF_GRA }, // 4 - { "8.bin", 0x40000, 0x79f14528, 2 | BRF_GRA }, // 5 - - { "6.bin", 0x80000, 0xaf10ddfd, 3 | BRF_GRA }, // 6 Background Tiles - { "7.bin", 0x80000, 0x3696345a, 3 | BRF_GRA }, // 7 - { "4.bin", 0x80000, 0x1ae8a751, 3 | BRF_GRA }, // 8 - { "5.bin", 0x80000, 0xcf235eeb, 3 | BRF_GRA }, // 9 - - { "1.bin", 0x80000, 0x76296578, 4 | BRF_SND }, // 10 M6295 #0 Samples - - { "eeprom-twinbrat.bin", 0x0080, 0x9366263d, 5 | BRF_PRG | BRF_ESS }, // 11 Default Eeprom -}; - -STD_ROM_PICK(twinbrata) -STD_ROM_FN(twinbrata) - -struct BurnDriver BurnDrvTwinbrata = { - "twinbrata", "twinbrat", NULL, NULL, "1995", - "Twin Brats (set 2)\0", NULL, "Elettronica Video-Games S.R.L.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, twinbrataRomInfo, twinbrataRomName, NULL, NULL, StlforceInputInfo, NULL, - TwinbratInit, DrvExit, stlforceFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 334, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_namcos2.cpp b/jan/src/burn/drv/pst90s/d_namcos2.cpp deleted file mode 100644 index f5a319bbf..000000000 --- a/jan/src/burn/drv/pst90s/d_namcos2.cpp +++ /dev/null @@ -1,7182 +0,0 @@ -// FB Alpha Namco System 2 driver module -// Based on MAME driver by K.Wilkins - -//tested / good: -// assault -// burnforc -// cosmogng -// dsaber -// mirninja -// valkyrie -// ordyne -// phelious -// rthun2 -// marvland -// metlhawk -// kyukaidk -// sws & clones - bug: kanji text is solid blue when it should be white with black outline -// sgunner -// sgunner2 (needs old mcu) -// dirtfoxj -// finehour -// luckywld - -//wip: -// bubbletr - ok, missing artwork (flipped) -// gollygho - ok, missing artwork (flipped) - -//forget: -// finallap - some bad gfx (title sprites), bad sound, no inputs -// finalap2 - "...all finallap-based games (incl. fourtrax & suzuka) are bugged and unplayable, even in mame" -// finalap3 - "" -// fourtrax - "" -// suzuk8h - "" -// suzuk8h2 - "" - -//-timing notes- 240+16 fixes both -//vbl@240 sgunner after coin up, add more coins and coins# flickers -//vbl@240 sgunner2 attract mode before title screen, when its drawing the '2', -// it will flicker a frame (w/wrong palette) from previous scene. -// dsaber: all tmap glitches fixed with 240+16. -// dirtfoxj, cosmogng, rthun2, phelios needs 240+8 otherwise sprite glitches -//vbl@224 rthun2 needs vbl@224 or flickery explosion in intro is wrong, also signs/sprites flicker sometimes when they shouldn't - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "m6809_intf.h" -#include "m6805_intf.h" -#include "burn_ym2151.h" -#include "c140.h" -#include "c169.h" -#include "namco_c45.h" -#include "burn_gun.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM[2]; -static UINT8 *Drv68KData; -static UINT8 *DrvM6809ROM; -static UINT8 *DrvMCUROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvGfxROM5; -static UINT8 *DrvSndROM; -static UINT8 *DrvEEPROM; -static UINT8 *DrvC45PROM; -static UINT8 *Drv68KRAM[2]; -static UINT8 *DrvC123RAM; -static UINT8 *DrvC139RAM; -static UINT8 *DrvRozRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvDPRAM; -static UINT8 *DrvMCURAM; -static UINT8 *DrvM6809RAM; -static UINT8 *DrvC123Ctrl; -static UINT8 *DrvRozCtrl; - -static UINT8 *SpritePrio; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 gfx_ctrl; -// ...to keep track of spritebank changes & lines to draw them between -static UINT32 scanline, position; // current scanline, "pos-irq" position -static UINT32 sprite_bankSL[0x10][0x2]; -static UINT32 sprite_bankL; -static UINT32 lastsprite_bank; - -static UINT8 irq_reg[2]; -static UINT8 irq_cpu[2]; -static UINT8 irq_vblank[2]; -static UINT8 irq_ex[2]; -static UINT8 irq_pos[2]; -static UINT8 irq_sci[2]; -static UINT8 bus_reg[2]; - -static UINT16 c355_obj_position[4]; - -static INT32 audio_cpu_in_reset; -static INT32 sub_cpu_in_reset; // mcu & slave - -static UINT16 sound_bank = 0; - -static INT32 layer_color; -static UINT8 *roz_dirty_tile; // 0x10000 -static UINT16 *roz_bitmap; // (256 * 8) * (256 * 8) -static INT32 roz_update_tiles = 0; // - -static void (*pDrvDrawBegin)() = NULL; // optional line-drawing -static void (*pDrvDrawLine)(INT32) = NULL; - -static INT32 min_x = 0; // screen clipping -static INT32 max_x = 0; -static INT32 min_y = 0; -static INT32 max_y = 0; - -static UINT8 mcu_analog_ctrl; -static UINT8 mcu_analog_complete; -static UINT8 mcu_analog_data; - -static UINT32 maincpu_run_cycles = 0; -static UINT32 maincpu_run_ended = 0; - -static INT32 key_sendval; -static UINT16 (*key_prot_read)(UINT8 offset) = NULL; -static void (*key_prot_write)(UINT8 offset, UINT16 data) = NULL; - -static INT32 finallap_prot_count = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvInputs[4]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 DrvAnalogPort0 = 0; -static INT32 DrvAnalogPort1 = 0; -static INT32 DrvAnalogPort2 = 0; - -static INT32 uses_gun = 0; -static INT32 DrvGun0 = 0; -static INT32 DrvGun1 = 0; -static INT32 DrvGun2 = 0; -static INT32 DrvGun3 = 0; - -static INT32 is_dirtfoxj = 0; -static INT32 is_luckywld = 0; -static INT32 is_metlhawk = 0; - -static INT32 weird_vbl = 0; - -static INT32 nvramcheck = 0; // nvram init: 1 ordyne, 2 ordynej, 3 dirtfoxj. 0 after set! - -static void FinallapDrawBegin(); // forwards -static void FinallapDrawLine(INT32 line); // "" -static void LuckywldDrawBegin(); // forwards -static void LuckywldDrawLine(INT32 line); // "" - -static struct BurnInputInfo DefaultInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 5, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 7, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 3, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 1, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 6, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Debug", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Default) - -static struct BurnInputInfo AssaultInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Left Stick Up", BIT_DIGITAL, DrvJoy1 + 5, "p1 up" }, - {"P1 Left Stick Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left Stick Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Left Stick Right", BIT_DIGITAL, DrvJoy3 + 7, "p1 right" }, - {"P3 Right Stick Up", BIT_DIGITAL, DrvJoy3 + 3, "p3 up" }, - {"P3 Right Stick Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down" }, - {"P3 Right Stick Left", BIT_DIGITAL, DrvJoy4 + 3, "p3 left" }, - {"P3 Right Stick Right",BIT_DIGITAL, DrvJoy4 + 1, "p3 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - {"P2 Left Stick Up", BIT_DIGITAL, DrvJoy1 + 4, "p2 up" }, - {"P2 Left Stick Down", BIT_DIGITAL, DrvJoy1 + 2, "p2 down" }, - {"P2 Left Stick Left", BIT_DIGITAL, DrvJoy1 + 0, "p2 left" }, - {"P2 Left Stick Right", BIT_DIGITAL, DrvJoy3 + 6, "p2 right" }, - {"P4 Right Stick Up", BIT_DIGITAL, DrvJoy3 + 2, "p4 up" }, - {"P4 Right Stick Down", BIT_DIGITAL, DrvJoy3 + 0, "p4 down" }, - {"P4 Right Stick Left", BIT_DIGITAL, DrvJoy4 + 2, "p4 left" }, - {"P4 Right Stick Right",BIT_DIGITAL, DrvJoy4 + 0, "p4 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Debug", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Assault) - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo MetlhawkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 7, "p1 fire 2" }, - - A("P1 X Axis", BIT_ANALOG_REL, &DrvAnalogPort1 , "mouse x-axis"), - A("P1 Y Axis", BIT_ANALOG_REL, &DrvAnalogPort0 , "mouse y-axis"), - A("P1 Up/Down Axis", BIT_ANALOG_REL, &DrvAnalogPort2 , "p1 x-axis"), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Debug", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Metlhawk) - -static struct BurnInputInfo LuckywldInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - - A("P1 Steering", BIT_ANALOG_REL, &DrvAnalogPort0, "p1 x-axis" ), - A("P1 Break", BIT_ANALOG_REL, &DrvAnalogPort1, "p1 fire 5" ), - A("P1 Accelerator", BIT_ANALOG_REL, &DrvAnalogPort2, "p1 fire 6" ), - - A("P1 Gun X", BIT_ANALOG_REL, &DrvGun0, "mouse x-axis" ), - A("P1 Gun Y", BIT_ANALOG_REL, &DrvGun1, "mouse y-axis" ), - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - A("P2 Gun X", BIT_ANALOG_REL, &DrvGun2, "p2 x-axis" ), - A("P2 Gun Y", BIT_ANALOG_REL, &DrvGun3, "p2 y-axis" ), - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Debug", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Luckywld) - -static struct BurnInputInfo SgunnerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - A("P1 Gun X", BIT_ANALOG_REL, &DrvGun0, "mouse x-axis" ), - A("P1 Gun Y", BIT_ANALOG_REL, &DrvGun1, "mouse y-axis" ), - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 3, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 6, "p2 start" }, - A("P2 Gun X", BIT_ANALOG_REL, &DrvGun2, "p2 x-axis" ), - A("P2 Gun Y", BIT_ANALOG_REL, &DrvGun3, "p2 y-axis" ), - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Debug", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Sgunner) - -static struct BurnInputInfo DirtfoxInputList[] = { - {"Coin", BIT_DIGITAL, DrvJoy2 + 5, "p1 coin" }, - - A("Steering", BIT_ANALOG_REL, &DrvAnalogPort0 , "p1 x-axis" ), - A("Break", BIT_ANALOG_REL, &DrvAnalogPort1 , "p1 fire 5" ), - A("Accelerator", BIT_ANALOG_REL, &DrvAnalogPort2 , "p1 fire 6" ), - - {"Gear Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"Gear Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Debug", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dirtfox) - -static struct BurnDIPInfo DefaultDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Video Display" }, - {0x14, 0x01, 0x01, 0x01, "Normal" }, - {0x14, 0x01, 0x01, 0x00, "Frozen" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Default) - -static struct BurnDIPInfo AssaultDIPList[]= -{ - {0x18, 0xff, 0xff, 0xff, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Video Display" }, - {0x18, 0x01, 0x01, 0x01, "Normal" }, - {0x18, 0x01, 0x01, 0x00, "Frozen" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x19, 0x01, 0x40, 0x40, "Off" }, - {0x19, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Assault) - -static struct BurnDIPInfo MetlhawkDIPList[]= -{ - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Video Display" }, - {0x09, 0x01, 0x01, 0x01, "Normal" }, - {0x09, 0x01, 0x01, 0x00, "Frozen" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0a, 0x01, 0x40, 0x40, "Off" }, - {0x0a, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Metlhawk) - -static struct BurnDIPInfo LuckywldDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Video Display" }, - {0x0f, 0x01, 0x01, 0x01, "Normal" }, - {0x0f, 0x01, 0x01, 0x00, "Frozen" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x40, 0x40, "Off" }, - {0x10, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Luckywld) - -static struct BurnDIPInfo SgunnerDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Video Display" }, - {0x0e, 0x01, 0x01, 0x01, "Normal" }, - {0x0e, 0x01, 0x01, 0x00, "Frozen" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Sgunner) - -static struct BurnDIPInfo DirtfoxDIPList[]= -{ - {0x08, 0xff, 0xff, 0xff, NULL }, - {0x09, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Video Display" }, - {0x08, 0x01, 0x01, 0x01, "Normal" }, - {0x08, 0x01, 0x01, 0x00, "Frozen" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x09, 0x01, 0x40, 0x40, "Off" }, - {0x09, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Dirtfox) - -static inline void palette_write(UINT16 offset) -{ - offset /= 2; - - INT32 ofst = (offset & 0x67ff); - - offset = (offset & 0x7ff) | ((offset & 0x6000) >> 2); - - UINT16 *ram = (UINT16*)DrvPalRAM; - - UINT8 r = ram[ofst + 0x0000]; - UINT8 g = ram[ofst + 0x0800]; - UINT8 b = ram[ofst + 0x1000]; - - DrvPalette[offset] = BurnHighCol(r,g,b,0); - - DrvPalette[offset + 0x2000] = BurnHighCol(r/2,g/2,b/2,0); // shadow -} - -static void clear_all_irqs() -{ - for (INT32 i = 0; i < 8; i++) { - SekSetIRQLine(i, CPU_IRQSTATUS_NONE); - } -} - -static UINT16 c148_read_write(UINT32 offset, UINT16 data, INT32 w) -{ - INT32 a = SekGetActive(); - - switch (offset & 0x3e000) - { - case 0x00000: - return 0; - - case 0x04000: - if (w) bus_reg[a] = data & 7; - return bus_reg[a]; - - case 0x06000: - if (w) { irq_cpu[a] = data & 7; clear_all_irqs(); } - return irq_cpu[a]; - - case 0x08000: - if (w) { irq_ex[a] = data & 7; clear_all_irqs(); } - return irq_ex[a]; - - case 0x0a000: - if (w) { irq_pos[a] = data & 7; clear_all_irqs(); } - return irq_pos[a]; - - case 0x0c000: - if (w) { irq_sci[a] = data & 7; clear_all_irqs(); } - return irq_sci[a]; - - case 0x0e000: - if (w) { irq_vblank[a] = data & 7; clear_all_irqs(); } - return irq_vblank[a]; - - case 0x10000: - if (w) { - SekClose(); - SekOpen((a) ? 0 : 1); - SekSetIRQLine(irq_cpu[(a) ? 0 : 1], CPU_IRQSTATUS_ACK); - SekClose(); - SekOpen(a); - } - return 0; - - case 0x16000: - SekClose(); - SekOpen((a) ? 0 : 1); - SekSetIRQLine(irq_cpu[(a) ? 0 : 1], CPU_IRQSTATUS_NONE); - SekClose(); - SekOpen(a); - return 0; - - case 0x18000: - SekSetIRQLine(irq_ex[a], CPU_IRQSTATUS_NONE); - return 0; - - case 0x1a000: - SekSetIRQLine(irq_pos[a], CPU_IRQSTATUS_NONE); - return 0; - - case 0x1c000: - SekSetIRQLine(irq_sci[a], CPU_IRQSTATUS_NONE); - return 0; - - case 0x1e000: - SekSetIRQLine(irq_vblank[a], CPU_IRQSTATUS_NONE); - return 0; - - case 0x20000: - return 0xffff; // eeprom ready - - case 0x22000: - if (w && a == 0) - { - audio_cpu_in_reset = ~data & 1; - if (audio_cpu_in_reset) M6809Reset(); - else { - maincpu_run_cycles = SekTotalCycles(); - maincpu_run_ended = 1; - SekRunEnd(); - } - } - return 0; - - case 0x24000: - if (w && a == 0) - { - sub_cpu_in_reset = ~data & 1; - if (sub_cpu_in_reset) - { - hd63705Reset(); - - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - } - else - { - maincpu_run_cycles = SekTotalCycles(); - maincpu_run_ended = 1; - SekRunEnd(); - } - } - return 0; - - case 0x26000: - return 0; // watchdog - } - - return 0; -} - -static UINT16 __fastcall namcos2_68k_read_word(UINT32 address) -{ - if ((address & 0xffc000) == 0x180000) { - return DrvEEPROM[(address / 2) & 0x1fff]; - } - - if ((address & 0xfc0000) == 0x1c0000) { - return c148_read_write(address, 0, 0); - } - - if ((address & 0xffffc0) == 0x420000) { - return *((UINT16*)(DrvC123Ctrl + (address & 0x3e))); - } - - if ((address & 0xff0000) == 0x440000) { - if ((address & 0x301e) > 0x3016) return 0xff; - return *((UINT16*)(DrvPalRAM + (address & 0x301e))); - } - - if ((address & 0xff0000) == 0x460000) { - return DrvDPRAM[(address & 0xffe)/2]; - } - - if ((address & 0xfffff0) == 0xcc0000) { - return *((UINT16*)(DrvRozCtrl + (address & 0x0e))); - } - - if ((address & 0xfffff0) == 0xd00000) { - if (key_prot_read != NULL) - return key_prot_read(address/2); - - return BurnRandom(); - } - - switch (address) - { - case 0x4a0000: - return 0x04; // c139 status - - case 0xc40000: - return gfx_ctrl; - } - - return 0; -} - -static UINT8 __fastcall namcos2_68k_read_byte(UINT32 address) -{ - if ((address & 0xffc000) == 0x180000) { - return DrvEEPROM[(address / 2) & 0x1fff]; - } - - if ((address & 0xffffc0) == 0x420000) { - return DrvC123Ctrl[(address & 0x3f)^1]; - } - - if ((address & 0xff0000) == 0x440000) { - if ((address & 0x301e) > 0x3016) return 0xff; - return *((UINT16*)(DrvPalRAM + (address & 0x301e))); - } - - if ((address & 0xff0000) == 0x460000) { - return DrvDPRAM[(address & 0xffe)/2]; - } - - if ((address & 0xfc0000) == 0x1c0000) { - return c148_read_write(address, 0, 0); - } - - return 0; -} - -static void __fastcall namcos2_68k_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffc000) == 0x180000) { - DrvEEPROM[(address / 2) & 0x1fff] = data; - return; - } - - if ((address & 0xfc0000) == 0x1c0000) { - c148_read_write(address, data, 1); - return; - } - - if ((address & 0xffffc0) == 0x420000) { - *((UINT16*)(DrvC123Ctrl + (address & 0x3e))) = data; - return; - } - - if ((address & 0xff0000) == 0x440000) { - if ((address & 0x3000) >= 0x3000) { - *((UINT16*)(DrvPalRAM + (address & 0x301e))) = data & 0xff; - } else { - *((UINT16*)(DrvPalRAM + (address & 0xfffe))) = data; - palette_write(address); - } - return; - } - - if ((address & 0xff0000) == 0x460000) { - DrvDPRAM[(address & 0xffe)/2] = data & 0xff; - return; - } - - if ((address & 0xfffff0) == 0xcc0000) { - *((UINT16*)(DrvRozCtrl + (address & 0x0e))) = data; - return; - } - - if ((address & 0xfffff0) == 0xd00000) { - if (key_prot_write != NULL) - return key_prot_write(address/2,data); - return; - } - - switch (address) - { - case 0xc40000: - INT32 startpos = (scanline == position) ? scanline : 0; - gfx_ctrl = data; - - // notes: finehour is the only game that takes advantage of this technique. - // from game (finehour) / what we do - // scanline 188: 0xf draw bank 0xf from 188 to end of screen. note: things will look terrible if 0xf is drawn above line 188! - // scanline 251 & 261: 0 draw bank 0x0 from 0 to end of screen. note: really should draw from 0 - 188, but its not needed and the extra logic is cumbersome - - if ((gfx_ctrl & 0xf) != 0 && lastsprite_bank != (gfx_ctrl & 0xf)) - { - // ..to help dink find other games that change the spritebank *keep* - bprintf(0, _T("Spritebank change: %X @ %d. \n"), gfx_ctrl & 0xf, startpos); - lastsprite_bank = gfx_ctrl & 0xf; - } - - sprite_bankL |= 1 << (gfx_ctrl & 0xf); - sprite_bankSL[gfx_ctrl & 0xf][0] = (startpos >= nScreenHeight) ? 0 : startpos; // spritebank set past nScreenHeight means to use for next frame. - sprite_bankSL[gfx_ctrl & 0xf][1] = nScreenHeight; - return; - } -} - -static void __fastcall namcos2_68k_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffc000) == 0x180000) { - DrvEEPROM[(address / 2) & 0x1fff] = data; - return; - } - - if ((address & 0xff0000) == 0x440000) { - if ((address & 0x3000) >= 0x3000) { - *((UINT16*)(DrvPalRAM + (address & 0x301e))) = data; - } else { - DrvPalRAM[(address & 0xffff)^1] = data; - palette_write(address); - } - return; - } - - if ((address & 0xff0000) == 0x460000) { - DrvDPRAM[(address & 0xffe)/2] = data; - return; - } - - if (address == 0x0074) return; // NOP (phelios writes here in-game) -} - - -static UINT16 __fastcall sgunner_68k_read_word(UINT32 address) -{ - if ((address & 0xfffff0) == 0xa00000) { - if (key_prot_read != NULL) - return key_prot_read(address/2); - - return BurnRandom(); - } - - return namcos2_68k_read_word(address); -} - -static UINT8 __fastcall sgunner_68k_read_byte(UINT32 address) -{ - if ((address & 0xfffff0) == 0xa00000) { - if (key_prot_read != NULL) - return key_prot_read(address/2); - - return BurnRandom(); - } - - return namcos2_68k_read_byte(address); -} - -static void __fastcall luckywld_68k_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffe0) == 0xd00000) { - *((UINT16*)(DrvRozCtrl + (address & 0x1e))) = data; - return; - } - - if ((address & 0xfffff8) == 0xf00000) { - if (key_prot_write != NULL) - key_prot_write(address/2,data); - return; - } - - if ((address & 0xfffff8) == 0x900000) { - c355_obj_position[(address/2) & 3] = data; - return; - } - - switch (address) - { - case 0x818000: - case 0x818001: - case 0x81a000: - case 0x81a001: - return; - } - - namcos2_68k_write_word(address, data); -} - - -static void __fastcall luckywld_68k_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffffe0) == 0xd00000) { - DrvRozCtrl[(address & 0x1f)^1] = data; - return; - } - - if ((address & 0xfffff8) == 0xf00000) { - if (key_prot_write != NULL) - key_prot_write(address/2,data); - return; - } - - switch (address) - { - case 0x818000: - case 0x818001: - case 0x81a000: - case 0x81a001: - return; - } - - namcos2_68k_write_byte(address, data); -} - -static UINT16 __fastcall luckywld_68k_read_word(UINT32 address) -{ - if ((address & 0xffffe0) == 0xd00000) { - return *((UINT16*)(DrvRozCtrl + (address & 0x1e))); - } - - if ((address & 0xfffff8) == 0xf00000) { - if (key_prot_read != NULL) - return key_prot_read(address/2); - - return BurnRandom(); - } - - if ((address & 0xfffff8) == 0x900000) { - return c355_obj_position[(address/2) & 3]; - } - - return namcos2_68k_read_word(address); -} - -static UINT8 __fastcall luckywld_68k_read_byte(UINT32 address) -{ - return namcos2_68k_read_byte(address); -} - -static void __fastcall metlhawk_68k_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffe0) == 0xd00000) { - *((UINT16*)(DrvRozCtrl + (address & 0x1e))) = data; - return; - } - - switch (address) - { - case 0xe00000: - gfx_ctrl = data; - sprite_bankL |= 1<<(gfx_ctrl&0xf); - return; - } - - namcos2_68k_write_word(address,data); -} - -static void __fastcall metlhawk_68k_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffffe0) == 0xd00000) { - DrvRozCtrl[(address & 0x1f)^1] = data; - return; - } - - namcos2_68k_write_word(address,data); -} - - -static UINT16 __fastcall metlhawk_68k_read_word(UINT32 address) -{ - if ((address & 0xffffe0) == 0xd00000) { - return *((UINT16*)(DrvRozCtrl + (address & 0x0e))); - } - - switch (address) - { - case 0xe00000: - case 0xe00001: - return gfx_ctrl; - } - - return namcos2_68k_read_word(address); -} - -static UINT8 __fastcall metlhawk_68k_read_byte(UINT32 address) -{ - if ((address & 0xffffe0) == 0xd00000) { - return DrvRozCtrl[(address & 0x1f)^1]; - } - - return namcos2_68k_read_byte(address); -} - -static UINT16 namcos2_finallap_prot_read(INT32 offset) -{ - static const UINT16 table0[8] = { 0x0000,0x0040,0x0440,0x2440,0x2480,0xa080,0x8081,0x8041 }; - static const UINT16 table1[8] = { 0x0040,0x0060,0x0060,0x0860,0x0864,0x08e4,0x08e5,0x08a5 }; - - UINT16 data = 0; - - switch ((offset & 0x3ffff)/2) - { - case 0: - data = 0x0101; - break; - - case 1: - data = 0x3e55; - break; - - case 2: - data = table1[finallap_prot_count&7]; - data = (data&0xff00)>>8; - break; - - case 3: - data = table1[finallap_prot_count&7]; - finallap_prot_count++; - data = data&0x00ff; - break; - - case 0x3fffc/2: - data = table0[finallap_prot_count&7]; - data = data&0xff00; - break; - - case 0x3fffe/2: - data = table0[finallap_prot_count&7]; - finallap_prot_count++; - data = (data&0x00ff)<<8; - break; - - default: - data = 0; - } - return data; -} - -static void __fastcall finallap_68k_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x840000: - gfx_ctrl = data; - sprite_bankL |= 1<<(gfx_ctrl&0xf); - return; - } - - namcos2_68k_write_word(address,data); -} - -static void __fastcall finallap_68k_write_byte(UINT32 address, UINT8 data) -{ - namcos2_68k_write_byte(address,data); -} - -static UINT16 __fastcall finallap_68k_read_word(UINT32 address) -{ - if ((address & 0xfc0000) == 0x300000) { - return namcos2_finallap_prot_read(address); - } - - switch (address) - { - case 0x840000: - return gfx_ctrl; - } - - return namcos2_68k_read_word(address); -} - -static UINT8 __fastcall finallap_68k_read_byte(UINT32 address) -{ - if ((address & 0xfc0000) == 0x300000) { - return namcos2_finallap_prot_read(address) >> ((~address & 1) << 3); - } - - return namcos2_68k_read_byte(address); -} - -static INT32 AnalogClip(INT16 p) -{ - if (p > 1023) p = 1023; - else if (p < -1023) p = -1023; - return p; -} - -static INT16 AnalogClipExDelay = 0; - -static INT32 AnalogClipEx(INT16 p) -{ - if (is_metlhawk) // for the up/down axis & mouse wheel playability - { - if (p > 255) p = 1023; - else if (p < -255) p = -1023; - - if (p) AnalogClipExDelay = p; - - if (!p) // no change on wheel - use last value and decrement it - { - if (AnalogClipExDelay > 0) - { - AnalogClipExDelay -= 50; - if (AnalogClipExDelay < 0) AnalogClipExDelay = 0; - - } - else if (AnalogClipExDelay < 0) - { - AnalogClipExDelay += 50; - if (AnalogClipExDelay > 0) AnalogClipExDelay = 0; - } - - p = AnalogClipExDelay; - } - - } else { - if (p > 1023) p = 1023; - else if (p < -1023) p = -1023; - } - - return p; -} - -static UINT32 scalerange(UINT32 x, UINT32 in_min, UINT32 in_max, UINT32 out_min, UINT32 out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -static UINT8 luckywldsteer() -{ - UINT8 Temp = 0x7f + (AnalogClip(DrvAnalogPort0) >> 4); - UINT8 Temp2 = 0; - - Temp2 = scalerange(Temp, 0x3f, 0xc0, 0x00, 0xff); - - return Temp2; -} - -static void mcu_analog_ctrl_write(UINT8 data) -{ - mcu_analog_ctrl = data; - - if (data & 0x40) - { - mcu_analog_complete = 2; - - if (uses_gun && !is_luckywld) { - switch ((data >> 2) & 7) - { - case 0: mcu_analog_data = 0; break; // an0 - case 1: mcu_analog_data = 0; break; // an1 - case 2: mcu_analog_data = 0; break; // an2 - case 3: mcu_analog_data = 0; break; // an3 - case 4: mcu_analog_data = BurnGunReturnX(0); break; // an4 - case 5: mcu_analog_data = BurnGunReturnX(1); break; // an5 - case 6: mcu_analog_data = BurnGunReturnY(0); break; // an6 - case 7: mcu_analog_data = BurnGunReturnY(1); break; // an7 - } - } else if (is_dirtfoxj) { - switch ((data >> 2) & 7) - { - case 0: mcu_analog_data = 0; break; // an0 - case 1: mcu_analog_data = 0; break; // an1 - case 2: mcu_analog_data = 0; break; // an2 - case 3: mcu_analog_data = 0; break; // an3 - case 4: mcu_analog_data = 0; break; // an4 - case 5: mcu_analog_data = 0x7f + (AnalogClip(DrvAnalogPort0) >> 4); break; // an5 - case 6: mcu_analog_data = (AnalogClip(DrvAnalogPort1) >> 4); break; // an6 - case 7: mcu_analog_data = (AnalogClip(DrvAnalogPort2) >> 4); break; // an7 - } - } else if (is_luckywld) { - switch ((data >> 2) & 7) - { - case 0: mcu_analog_data = 0; break; // an0 - case 1: mcu_analog_data = BurnGunReturnY(1); break; // an1 - case 2: mcu_analog_data = BurnGunReturnY(0); break; // an2 - case 3: mcu_analog_data = BurnGunReturnX(1); break; // an3 - case 4: mcu_analog_data = BurnGunReturnX(0); break; // an4 - case 5: mcu_analog_data = luckywldsteer(); break; // an5 - case 6: mcu_analog_data = (AnalogClip(DrvAnalogPort1) >> 4); break; // an6 - case 7: mcu_analog_data = (AnalogClip(DrvAnalogPort2) >> 4); break; // an7 - } - } else { - switch ((data >> 2) & 7) - { - case 0: mcu_analog_data = 0; break; // an0 - case 1: mcu_analog_data = 0; break; // an1 - case 2: mcu_analog_data = 0; break; // an2 - case 3: mcu_analog_data = 0; break; // an3 - case 4: mcu_analog_data = 0; break; // an4 - case 5: mcu_analog_data = 0x7f + (AnalogClip(DrvAnalogPort0) >> 4); break; // an5 - case 6: mcu_analog_data = 0x7f + (AnalogClip(DrvAnalogPort1) >> 4); break; // an6 - case 7: mcu_analog_data = 0x7f + (AnalogClipEx(DrvAnalogPort2) >> 4); break; // an7 - } - //bprintf(0, _T("Port 0: %.06d Port 1: %.06d Port 2: %.06d \n"), DrvAnalogPort0, DrvAnalogPort1, DrvAnalogPort2); - } - } - - if (data & 0x20) - { - hd63705SetIrqLine(7, CPU_IRQSTATUS_ACK); - m6805Run(1); - hd63705SetIrqLine(7, CPU_IRQSTATUS_NONE); - } -} - -static UINT8 mcu_analog_ctrl_read() -{ - INT32 data = 0; - if (mcu_analog_complete == 2) mcu_analog_complete = 1; - if (mcu_analog_complete) data |= 0x80; - - return data | (mcu_analog_ctrl & 0x3f); -} - -static UINT8 mcu_port_d_r() // no games use this, but keep just in-case -{ - //INT32 threshold = 0x7f; - INT32 data = 0; - - return data; -} - -static UINT8 namcos2_mcu_analog_port_r() -{ - if (mcu_analog_complete==1) mcu_analog_complete=0; - return mcu_analog_data; -} - -static void namcos2_mcu_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0x5000) { - DrvDPRAM[address & 0x7ff] = data; - return; - } - - switch (address) - { - case 0x0003: - // namcos2_mcu_port_d_w (unused) - return; - - case 0x0010: - mcu_analog_ctrl_write(data); - return; - - case 0x0011: - // mcu_analog_port_w (unused) - return; - } - - if (address < 0x1c0) { - DrvMCURAM[address] = data; - return; - } -} - -static UINT8 namcos2_mcu_read(UINT16 address) -{ - if ((address & 0xf000) == 0x6000) { - return 0; // watchdog - } - - if ((address & 0xf800) == 0x5000) { - return DrvDPRAM[address & 0x7ff]; - } - - switch (address) - { - case 0x0000: - return 0; - - case 0x0001: - return DrvInputs[0]; // mcub - - case 0x0002: - return (DrvInputs[1] & ~0x40) | (DrvDips[1] & 0x40); // mcuc - - case 0x0003: - return mcu_port_d_r(); - - case 0x0007: - return DrvInputs[2]; // mcuh - - case 0x0010: - return mcu_analog_ctrl_read(); - - case 0x0011: - return namcos2_mcu_analog_port_r(); - - case 0x2000: - return DrvDips[0]; // dsw - - case 0x3000: - return DrvInputs[3]; // MCUDI0 - - case 0x3001: - return 0xff; // MCUDI1 - - case 0x3002: - return 0xff; // MCUDI2 - - case 0x3003: - return 0xff; // MCUDI3 - } - - if (address < 0x1c0) { - return DrvMCURAM[address]; - } else if (address < 0x2000) { - return DrvMCUROM[address]; - } - - return 0; -} - -static void sound_bankswitch(INT32 data) -{ - sound_bank = data; - INT32 bank = (data >> 4); - - M6809MapMemory(DrvM6809ROM + (bank * 0x4000), 0x0000, 0x3fff, MAP_ROM); -} - -static void namcos2_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0x7000) { - DrvDPRAM[address & 0x7ff] = data; - return; - } - - if (address >= 0x5000 && address <= 0x6fff) { - c140_write(address,data); - return; - } - - if ((address & 0xe000) == 0xa000) { - // amplifier enable (unemulated) - return; - } - - switch (address) - { - case 0x4000: - BurnYM2151SelectRegister(data); - return; - - case 0x4001: - BurnYM2151WriteRegister(data); - return; - - case 0xc000: - case 0xc001: - sound_bankswitch(data); - return; - - case 0xd001: // watchdog - return; - - case 0xe000: // nop - return; - } -} - -static UINT8 namcos2_sound_read(UINT16 address) -{ - if ((address & 0xf000) == 0x7000) { - return DrvDPRAM[address & 0x7ff]; - } - - if (address >= 0x5000 && address <= 0x6fff) { - return c140_read(address); - } - - switch (address) - { - case 0x4000: - case 0x4001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -static void __fastcall roz_write_word(UINT32 address, UINT16 data) -{ - UINT16 *ram = (UINT16*)DrvRozRAM; - - UINT16 offset = (address & 0x1ffff) / 2; - - if (ram[offset] != data) { - roz_dirty_tile[offset] = 1; - roz_update_tiles = 1; - ram[offset] = data; - } -} - -static void __fastcall roz_write_byte(UINT32 address, UINT8 data) -{ - INT32 offset = (address & 0x1ffff)^1; - - if (DrvRozRAM[offset] != data) { - roz_dirty_tile[offset/2] = 1; - roz_update_tiles = 1; - DrvRozRAM[offset] = data; - } -} - -static void default_68k_map(INT32 cpu) -{ - SekInit(cpu, 0x68000); - SekOpen(cpu); - SekMapMemory(Drv68KROM[cpu], 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM[cpu], 0x100000, 0x13ffff, MAP_RAM); - SekMapMemory(Drv68KData, 0x200000, 0x3fffff, MAP_ROM); - SekMapMemory(DrvC123RAM, 0x400000, 0x41ffff, MAP_RAM); - SekMapMemory(DrvPalRAM + 0x0000, 0x440000, 0x442fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x4000, 0x444000, 0x446fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x8000, 0x448000, 0x44afff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0xc000, 0x44c000, 0x44efff, MAP_ROM); - SekMapMemory(DrvC139RAM, 0x480000, 0x483fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0xc00000, 0xc03fff, MAP_RAM); - SekMapMemory(DrvRozRAM, 0xc80000, 0xc9ffff, MAP_RAM); - SekMapMemory(DrvRozRAM, 0xca0000, 0xcbffff, MAP_RAM); // mirror - SekSetWriteWordHandler(0, namcos2_68k_write_word); - SekSetWriteByteHandler(0, namcos2_68k_write_byte); - SekSetReadWordHandler(0, namcos2_68k_read_word); - SekSetReadByteHandler(0, namcos2_68k_read_byte); - - SekMapHandler(1, 0xc80000, 0xcbffff, MAP_WRITE); - SekSetWriteByteHandler(1, roz_write_byte); - SekSetWriteWordHandler(1, roz_write_word); - - SekClose(); -} - -static void sgunner_68k_map(INT32 cpu) -{ - default_68k_map(cpu); - - SekOpen(cpu); - SekMapMemory(DrvSprRAM, 0x800000, 0x8143ff, MAP_RAM); // c355 - SekSetReadWordHandler(0, sgunner_68k_read_word); - SekSetReadByteHandler(0, sgunner_68k_read_byte); - SekClose(); -} - -static void metlhawk_68k_map(INT32 cpu) -{ - SekInit(cpu, 0x68000); - SekOpen(cpu); - SekMapMemory(Drv68KROM[cpu], 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM[cpu], 0x100000, 0x13ffff, MAP_RAM); - SekMapMemory(Drv68KData, 0x200000, 0x3fffff, MAP_ROM); - SekMapMemory(DrvC123RAM, 0x400000, 0x41ffff, MAP_RAM); - SekMapMemory(DrvPalRAM + 0x0000, 0x440000, 0x442fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x4000, 0x444000, 0x446fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x8000, 0x448000, 0x44afff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0xc000, 0x44c000, 0x44efff, MAP_ROM); - SekMapMemory(DrvC139RAM, 0x480000, 0x483fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0xc00000, 0xc03fff, MAP_RAM); - SekMapMemory(DrvRozRAM, 0xc40000, 0xc4ffff, MAP_RAM); - SekSetWriteWordHandler(0, metlhawk_68k_write_word); - SekSetWriteByteHandler(0, metlhawk_68k_write_byte); - SekSetReadWordHandler(0, metlhawk_68k_read_word); - SekSetReadByteHandler(0, metlhawk_68k_read_byte); - SekClose(); -} - -static void luckywld_68k_map(INT32 cpu) -{ - SekInit(cpu, 0x68000); - SekOpen(cpu); - SekMapMemory(Drv68KROM[cpu], 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM[cpu], 0x100000, 0x13ffff, MAP_RAM); - SekMapMemory(Drv68KData, 0x200000, 0x3fffff, MAP_ROM); - SekMapMemory(DrvC123RAM, 0x400000, 0x41ffff, MAP_RAM); - SekMapMemory(DrvPalRAM + 0x0000, 0x440000, 0x442fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x4000, 0x444000, 0x446fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x8000, 0x448000, 0x44afff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0xc000, 0x44c000, 0x44efff, MAP_ROM); - SekMapMemory(DrvC139RAM, 0x480000, 0x483fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x800000, 0x8141ff, MAP_RAM); - SekMapMemory(c45RoadRAM, 0xa00000, 0xa1ffff, MAP_ROM); // handler in c45roadmap68k - SekMapMemory(DrvRozRAM, 0xc00000, 0xc0ffff, MAP_RAM); - SekSetWriteWordHandler(0, luckywld_68k_write_word); - SekSetWriteByteHandler(0, luckywld_68k_write_byte); - SekSetReadWordHandler(0, luckywld_68k_read_word); - SekSetReadByteHandler(0, luckywld_68k_read_byte); - - c45RoadMap68k(0xa00000); - - SekClose(); -} - -static void finallap_68k_map(INT32 cpu) -{ - SekInit(cpu, 0x68000); - SekOpen(cpu); - SekMapMemory(Drv68KROM[cpu], 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM[cpu], 0x100000, 0x13ffff, MAP_RAM); -// SekMapMemory(Drv68KData, 0x200000, 0x2fffff, MAP_ROM); -// SekMapMemory(Drv68KData + 0x140000, 0x340000, 0x3fffff, MAP_ROM); - SekMapMemory(DrvC123RAM, 0x400000, 0x41ffff, MAP_RAM); - SekMapMemory(DrvPalRAM + 0x0000, 0x440000, 0x442fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x4000, 0x444000, 0x446fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x8000, 0x448000, 0x44afff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0xc000, 0x44c000, 0x44efff, MAP_ROM); - SekMapMemory(DrvC139RAM, 0x480000, 0x483fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(c45RoadRAM, 0x880000, 0x89ffff, MAP_ROM); // handler in c45roadmap68k - SekSetWriteWordHandler(0, finallap_68k_write_word); - SekSetWriteByteHandler(0, finallap_68k_write_byte); - SekSetReadWordHandler(0, finallap_68k_read_word); - SekSetReadByteHandler(0, finallap_68k_read_byte); - - c45RoadMap68k(0x880000); - - SekClose(); -} - -static void namcos2_sound_init() -{ - M6809Init(1); - M6809Open(0); -// M6809MapMemory(DrvDPRAM, 0x7000, 0x77ff, MAP_RAM); -// M6809MapMemory(DrvDPRAM, 0x7800, 0x7fff, MAP_RAM); - M6809MapMemory(DrvM6809RAM, 0x8000, 0x9fff, MAP_RAM); - M6809MapMemory(DrvM6809ROM, 0xc000, 0xffff, MAP_ROM); - M6809SetWriteHandler(namcos2_sound_write); - M6809SetReadHandler(namcos2_sound_read); - M6809Close(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - c140_init(21333, C140_TYPE_SYSTEM2, DrvSndROM); -} - -static void namcos2_mcu_init() -{ - m6805Init(1, 1 << 16); - m6805Open(0); -// m6805MapMemory(DrvMCURAM + 0x0100, 0x0100, 0x01ff, MAP_RAM); - m6805MapMemory(DrvMCUROM + 0x0200, 0x0200, 0x1fff, MAP_ROM); -// m6805MapMemory(DrvDPRAM, 0x5000, 0x57ff, MAP_RAM); - m6805MapMemory(DrvMCUROM + 0x8000, 0x8000, 0xffff, MAP_ROM); - m6805SetWriteHandler(namcos2_mcu_write); - m6805SetReadHandler(namcos2_mcu_read); - m6805Close(); -} - -static void FreshEEPROMCheck() -{ - UINT8 ordyneeeprom[] = { - 0x96,0x44,0x01,0x01,0x00,0x18,0x00,0x80,0x4f,0x52,0x44,0x41,0x01,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0x04,0x9d,0x01,0x01,0x01,0x01,0x00,0x01,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; - - UINT8 ordynejeeprom[] = { - 0x96,0x44,0x01,0x01,0x00,0x18,0x00,0x80,0x4f,0x52,0x44,0x41,0x01,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0x05,0xeb,0x01,0x01,0x01,0x01,0x00,0x01,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x10,0x00,0x3e }; - - UINT8 dirtfoxjeeprom[] = { - 0x9a,0x49,0x01,0x01,0x00,0x18,0x00,0x80,0x44,0x41,0x52,0x54,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x01,0x04,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0x84,0xb8,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x01,0x04,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00 }; - - if (DrvEEPROM[0] == 0xff && nvramcheck) { - bprintf(0, _T("Setting default NVRAM for %S!\n"), BurnDrvGetTextA(DRV_NAME)); - - memset(DrvEEPROM, 0xff, 0x2000); - - switch (nvramcheck) { - case 1: memcpy(DrvEEPROM, ordyneeeprom, 6*16); break; - case 2: memcpy(DrvEEPROM, ordynejeeprom, 6*16); break; - case 3: memcpy(DrvEEPROM, dirtfoxjeeprom, 6*16); break; - } - } - - nvramcheck = 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - memset (roz_dirty_tile, 1, 0x10000); - roz_update_tiles = 1; - - SekOpen(0); - SekReset(); - SekClose(); - - SekOpen(1); - SekReset(); - SekClose(); - - M6809Open(0); - M6809Reset(); - sound_bankswitch(0); - BurnYM2151Reset(); - c140_reset(); - M6809Close(); - - m6805Open(0); - hd63705Reset(); - m6805Close(); - - c45RoadReset(); - - gfx_ctrl = 0; - sprite_bankL = 0; - lastsprite_bank = 0; - - irq_reg[1] = irq_reg[0] = 0; - irq_cpu[1] = irq_cpu[0] = 0; - irq_vblank[1] = irq_vblank[0] = 0; - irq_ex[1] = irq_ex[0] = 0; - irq_pos[1] = irq_pos[0] = 0; - irq_sci[1] = irq_sci[0] = 0; - bus_reg[1] = bus_reg[0] = 0; - - audio_cpu_in_reset = 1; - sub_cpu_in_reset = 1; // mcu & slave - - key_sendval = 0; - - mcu_analog_ctrl = 0; - mcu_analog_data = 0xaa; - mcu_analog_complete = 0; - - finallap_prot_count = 0; - - c355_obj_position[0] = c355_obj_position[1] = 0; - c355_obj_position[2] = c355_obj_position[3] = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM[0] = Next; Next += 0x040000; - Drv68KROM[1] = Next; Next += 0x040000; - Drv68KData = Next; Next += 0x200000; - DrvM6809ROM = Next; Next += 0x040000; - DrvMCUROM = Next; Next += 0x010000; - - DrvC45PROM = Next; Next += 0x000100; - - DrvGfxROM0 = Next; Next += 0x400000; // sprite 32x32 - DrvGfxROM1 = Next; Next += 0x400000; // sprite 16x16 - DrvGfxROM2 = Next; Next += 0x400000; // char - DrvGfxROM3 = Next; Next += 0x400000; // roz - - DrvGfxROM4 = Next; Next += 0x080000; // char mask - DrvGfxROM5 = Next; Next += 0x080000; // roz mask - - DrvSndROM = Next; Next += 0x100000; - - DrvEEPROM = Next; Next += 0x002000; - - roz_dirty_tile = Next; Next += 0x020000; - roz_bitmap = (UINT16*)Next; Next += ((256 * 16) * (256 * 16) * 2); - - SpritePrio = Next; Next += (300 * 300); - - DrvPalette = (UINT32*)Next; Next += 0x4001 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM[0] = Next; Next += 0x040000; - Drv68KRAM[1] = Next; Next += 0x040000; - DrvC123RAM = Next; Next += 0x020000; - DrvC139RAM = Next; Next += 0x004000; - DrvRozRAM = Next; Next += 0x020000; - DrvSprRAM = Next; Next += 0x004000 + 0x10400; - DrvPalRAM = Next; Next += 0x010000; - DrvDPRAM = Next; Next += 0x000800; - DrvMCURAM = Next; Next += 0x000200; - DrvM6809RAM = Next; Next += 0x002000; - - DrvC123Ctrl = Next; Next += 0x000040; - DrvRozCtrl = Next; Next += 0x000010; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DoMirror(UINT8 *rom, INT32 size, INT32 mirror_size) -{ - for (INT32 i = mirror_size; i < size; i+=mirror_size) - { - memcpy (rom + i, rom, mirror_size); - } -} - -static INT32 Namcos2GetRoms(INT32 gfx0_offset) -{ - char* pRomName; - struct BurnRomInfo ri; - struct BurnRomInfo pi; - - UINT8 *m6809 = DrvM6809ROM; - UINT8 *mcu = DrvMCUROM; - UINT8 *gfx[5] = { DrvGfxROM0 + gfx0_offset, DrvGfxROM2, DrvGfxROM3, DrvGfxROM4 }; - UINT8 *snd = DrvSndROM; - UINT8 *data = Drv68KData; - - memset (DrvEEPROM, 0xff, 0x002000); - memset (DrvGfxROM0, 0xff, 0x400000); - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) - { - BurnDrvGetRomInfo(&ri, i); - BurnDrvGetRomInfo(&pi, i+1); - - INT32 use_size = ri.nType & 0x10; - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) < 3) { - INT32 c = (ri.nType - 1) & 1; - if (BurnLoadRom(Drv68KROM[c] + 0x000001, i + 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM[c] + 0x000000, i + 1, 2)) return 1; - i++; - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 3) { - if (BurnLoadRom(m6809, i, 1)) return 1; - m6809 += ri.nLen; - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 4) { - if (BurnLoadRom(mcu, i, 1)) return 1; - mcu += 0x8000; - continue; - } - - if ((ri.nType & BRF_GRA) && ((ri.nType & 0x0f) >= 5 && (ri.nType & 0x0f) < 9)) { - if (BurnLoadRom(gfx[(ri.nType - 5) & 0xf], i, 1)) return 1; - - if (use_size) { - gfx[(ri.nType - 5) & 0xf] += ri.nLen; - } else { - if (ri.nLen < 0x80000) DoMirror(gfx[(ri.nType - 5) & 0xf], 0x80000, ri.nLen); - gfx[(ri.nType - 5) & 0xf] += 0x80000; - } - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 9) { - if (BurnLoadRom(data + 0x00001, i + 0, 2)) return 1; - - if ((pi.nType & BRF_PRG) && (pi.nType & 0x0f) == 9) { - if (BurnLoadRom(data + 0x00000, i + 1, 2)) return 1; - i++; - } - - if (ri.nLen < 0x80000) DoMirror(data, 0x100000, ri.nLen*2); - data += 0x100000; - continue; - } - - if ((ri.nType & BRF_SND) && (ri.nType & 0x0f) == 0x0a) { - if (BurnLoadRom(snd, i, 1)) return 1; - if (ri.nLen < 0x80000) DoMirror(snd, 0x80000, ri.nLen); - snd += 0x80000; - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 11) { - if (BurnLoadRom(DrvEEPROM, i, 1)) return 1; - continue; - } - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 12) { - if (BurnLoadRom(DrvC45PROM, i, 1)) return 1; - continue; - } - - if ((ri.nType & BRF_GRA) && ((ri.nType & 0x0f) == 13)) { - if (BurnLoadRom(DrvGfxROM5, i, 1)) return 1; - continue; - } - } - - if ((m6809 - DrvM6809ROM) == 0x20000) memcpy (DrvM6809ROM + 0x20000, DrvM6809ROM, 0x20000); // mirror - - if (strncmp(BurnDrvGetTextA(DRV_NAME), "ordyne", 6) == 0) { - memmove (DrvGfxROM2 + 0x280000, DrvGfxROM2 + 0x180000, 0x180000); - memmove (DrvGfxROM2 + 0x180000, DrvGfxROM2 + 0x100000, 0x080000); - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[8] = { - (0x400000*3),(0x400000*3)+4,(0x400000*2),(0x400000*2)+4, - (0x400000*1),(0x400000*1)+4,(0x400000*0),(0x400000*0)+4 - }; - INT32 XOffs0[32] = { - STEP4( 0,1), STEP4( 8,1), STEP4(16,1), STEP4(24,1), - STEP4(32,1), STEP4(40,1), STEP4(48,1), STEP4(56,1) - }; - INT32 YOffs0[32] = { STEP32(0,64) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x400000); - - GfxDecode(0x0800, 8, 32, 32, Plane0, XOffs0, YOffs0, 0x800, tmp + 0x0000000, DrvGfxROM0 + 0x0000000); - GfxDecode(0x0800, 8, 32, 32, Plane0, XOffs0, YOffs0, 0x800, tmp + 0x0200000, DrvGfxROM0 + 0x0200000); - - BurnFree(tmp); - - for (INT32 i = 0; i < 0x400000; i++) - { - INT32 j = (i & 0xffffe0f) | ((i & 0x10) << 4) | ((i & 0x1e0) >> 1); - - DrvGfxROM1[j] = DrvGfxROM0[i]; - } - - return 0; -} - -static void decode_layer_tiles() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - - for (INT32 i = 0; i < 0x400000/0x40; i++) - { - INT32 j = (i & 0x07ff) | ((i & 0xc000) >> 3) | ((i & 0x3800) << 2); - - memcpy (tmp + i * 0x40, DrvGfxROM2 + j * 0x40, 0x40); - } - - memcpy (DrvGfxROM2, tmp, 0x400000); - - BurnFree(tmp); -} - -static void decode_layer_tiles_finalap2() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - - for (INT32 i = 0; i < 0x200000/0x40; i++) - { - INT32 j = (i & 0x07ff) | ((i & 0x4000) >> 3) | ((i & 0x3800) << 1); - - memcpy (tmp + i * 0x40, DrvGfxROM2 + j * 0x40, 0x40); - } - - memcpy (DrvGfxROM2, tmp, 0x400000); - - BurnFree(tmp); -} - -static void LuckywldGfxDecode() -{ - for (INT32 i = 0 ; i < 0x400000; i++) { - DrvGfxROM1[i] = DrvGfxROM0[(i / 4) | ((i & 3) << 20)]; - } -} - -static void luckywld_roz_decode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - - for (INT32 i = 0; i < 0x4000; i++) - { - INT32 j = i & 0x1ff; - - switch (i >> 9) - { - case 0x00: j |= 0x1c00; break; - case 0x01: j |= 0x0800; break; - case 0x02: j |= 0x0000; break; - case 0x08: j |= 0x1e00; break; - case 0x09: j |= 0x0a00; break; - case 0x0a: j |= 0x0200; break; - case 0x10: j |= 0x2000; break; - case 0x11: j |= 0x0c00; break; - case 0x12: j |= 0x0400; break; - case 0x18: j |= 0x2200; break; - case 0x19: j |= 0x0e00; break; - case 0x1a: j |= 0x0600; break; - } - - memcpy (tmp + i * 0x100, DrvGfxROM3 + j * 0x100, 0x100); - } - - memcpy (DrvGfxROM3, tmp, 0x400000); - - BurnFree(tmp); -} - -static void metal_hawk_sprite_decode() -{ - UINT8 *data = DrvGfxROM0; - for (INT32 i=0; i<0x200000; i+=32*32) - { - for (INT32 j=0; j<32*32; j+=32*4) - { - for (INT32 k=0; k<32; k+=4) - { - INT32 a = i+j+k+32; - UINT8 v = data[a]; - data[a] = data[a+3]; - data[a+3] = data[a+2]; - data[a+2] = data[a+1]; - data[a+1] = v; - - a += 32; - v = data[a]; - data[a] = data[a+2]; - data[a+2] = v; - v = data[a+1]; - data[a+1] = data[a+3]; - data[a+3] = v; - - a += 32; - data[a] = data[a+1]; - data[a+1] = data[a+2]; - data[a+2] = data[a+3]; - data[a+3] = v; - - a = i+j+k; - for (INT32 l=0; l<4; l++) - { - v = data[a+l+32]; - data[a+l+32] = data[a+l+32*3]; - data[a+l+32*3] = v; - } - } - } - } - - for (INT32 i=0; i<0x200000; i+=32*32) - { - for (INT32 j=0; j<32; j++) - { - for (INT32 k=0; k<32; k++) - { - data[0x200000+i+j*32+k] = data[i+j+k*32]; - } - } - } - - for (INT32 i = 0; i < 0x400000; i++) - { - INT32 j = (i & 0xffffe0f) | ((i & 0x10) << 4) | ((i & 0x1e0) >> 1); - - DrvGfxROM1[j] = DrvGfxROM0[i]; - } -} - -static void metal_hawk_roz_decode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - - for (INT32 i = 0; i < 0x200000/0x100; i++) - { - INT32 j = (i & 0x01ff) | ((i & 0xe00) << 1) | ((i & 0x1000) >> 3); - - memcpy (tmp + i * 0x100, DrvGfxROM3 + j * 0x100, 0x100); - } - - memcpy (DrvGfxROM3, tmp, 0x200000); - - BurnFree(tmp); -} - -static INT32 Namcos2Init(void (*key_write)(UINT8,UINT16), UINT16 (*key_read)(UINT8)) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (Namcos2GetRoms(0)) return 1; - - DrvGfxDecode(); // decode sprites - decode_layer_tiles(); - } - - default_68k_map(0); - default_68k_map(1); - namcos2_sound_init(); - namcos2_mcu_init(); - - key_prot_read = key_read; - key_prot_write = key_write; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 SgunnerCommonInit(void (*key_write)(UINT8,UINT16), UINT16 (*key_read)(UINT8)) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (Namcos2GetRoms(0)) return 1; - - LuckywldGfxDecode(); - decode_layer_tiles(); - } - - sgunner_68k_map(0); - sgunner_68k_map(1); - namcos2_sound_init(); - namcos2_mcu_init(); - - key_prot_read = key_read; - key_prot_write = key_write; - - GenericTilesInit(); - - uses_gun = 1; - BurnGunInit(2, false); - - weird_vbl = 1; - - DrvDoReset(); - - return 0; -} - -static INT32 Suzuka8hCommonInit(void (*key_write)(UINT8,UINT16), UINT16 (*key_read)(UINT8)) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (Namcos2GetRoms(0)) return 1; - - LuckywldGfxDecode(); - decode_layer_tiles(); - } - - c45RoadInit(~0, DrvC45PROM); - - luckywld_68k_map(0); - luckywld_68k_map(1); - namcos2_sound_init(); - namcos2_mcu_init(); - - key_prot_read = key_read; - key_prot_write = key_write; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 LuckywldInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (Namcos2GetRoms(0)) return 1; - - LuckywldGfxDecode(); - decode_layer_tiles(); - - for (INT32 i = 0; i < 0x80000; i++) { - DrvGfxROM5[i] = BITSWAP08(DrvGfxROM5[i], 0,1,2,3,4,5,6,7); - } - - memcpy (DrvGfxROM3 + 0x1c0000, DrvGfxROM3 + 0x100000, 0x080000); - - luckywld_roz_decode(); - } - - c45RoadInit(~0, DrvC45PROM); - - luckywld_68k_map(0); - luckywld_68k_map(1); - namcos2_sound_init(); - namcos2_mcu_init(); - - c169_roz_init(DrvRozRAM, DrvRozCtrl, roz_bitmap); - - GenericTilesInit(); - - is_luckywld = 1; - - uses_gun = 1; - BurnGunInit(2, false); - - pDrvDrawBegin = LuckywldDrawBegin; - pDrvDrawLine = LuckywldDrawLine; - - DrvDoReset(); - - return 0; -} - -static INT32 MetlhawkInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (Namcos2GetRoms(0)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 9, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 10, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 11, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100001, 12, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100002, 13, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100003, 14, 4)) return 1; - - - for (INT32 i = 0; i < 8; i++) { - BurnLoadRom(DrvGfxROM3 + i * 0x40000, 19+i, 1); - } - - metal_hawk_sprite_decode(); - decode_layer_tiles(); - metal_hawk_roz_decode(); - } - - metlhawk_68k_map(0); - metlhawk_68k_map(1); - namcos2_sound_init(); - namcos2_mcu_init(); - - c169_roz_init(DrvRozRAM, DrvRozCtrl, roz_bitmap); - - GenericTilesInit(); - - is_metlhawk = 1; - - weird_vbl = 1; // fix incorrect flashing in continue screen - - DrvDoReset(); - - return 0; -} - -static INT32 FinallapInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (Namcos2GetRoms(0x200000)) return 1; - - DrvGfxDecode(); // decode sprites - decode_layer_tiles(); - } - - c45RoadInit(~0, DrvC45PROM); - - finallap_68k_map(0); - finallap_68k_map(1); - namcos2_sound_init(); - namcos2_mcu_init(); - - GenericTilesInit(); - - DrvDoReset(); - - //pDrvDrawBegin = FinallapDrawBegin; - //pDrvDrawLine = FinallapDrawLine; - - return 0; -} - -static INT32 Finalap2Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (Namcos2GetRoms(0)) return 1; - - DrvGfxDecode(); // decode sprites - decode_layer_tiles_finalap2(); - } - - c45RoadInit(~0, DrvC45PROM); - - finallap_68k_map(0); - finallap_68k_map(1); - namcos2_sound_init(); - namcos2_mcu_init(); - - SekOpen(0); - SekMapMemory(Drv68KData, 0x200000, 0x2fffff, MAP_ROM); - SekMapMemory(Drv68KData + 0x140000, 0x340000, 0x3fffff, MAP_ROM); - - SekClose(); - - SekOpen(1); - SekMapMemory(Drv68KData, 0x200000, 0x2fffff, MAP_ROM); - SekMapMemory(Drv68KData + 0x140000, 0x340000, 0x3fffff, MAP_ROM); - - SekClose(); - - GenericTilesInit(); - - DrvDoReset(); - - //pDrvDrawBegin = FinallapDrawBegin; - //pDrvDrawLine = FinallapDrawLine; - - return 0; -} - -static INT32 FourtraxInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (Namcos2GetRoms(0)) return 1; - - DrvGfxDecode(); // decode sprites - decode_layer_tiles(); - } - - c45RoadInit(~0, DrvC45PROM); - - finallap_68k_map(0); - finallap_68k_map(1); - namcos2_sound_init(); - namcos2_mcu_init(); - - SekOpen(0); - SekMapMemory(Drv68KData, 0x200000, 0x3fffff, MAP_ROM); - SekClose(); - - SekOpen(1); - SekMapMemory(Drv68KData, 0x200000, 0x3fffff, MAP_ROM); - SekClose(); - - GenericTilesInit(); - - DrvDoReset(); - - pDrvDrawBegin = FinallapDrawBegin; - pDrvDrawLine = FinallapDrawLine; - - return 0; -} - -static INT32 Namcos2Exit() -{ - GenericTilesExit(); - - SekExit(); - M6809Exit(); - m6805Exit(); - - BurnYM2151Exit(); - c140_exit(); - - c45RoadExit(); - - BurnFree (AllMem); - - if (uses_gun) { - BurnGunExit(); - uses_gun = 0; - } - - key_prot_read = NULL; - key_prot_write = NULL; - - pDrvDrawBegin = NULL; - pDrvDrawLine = NULL; - - nvramcheck = 0; - is_dirtfoxj = 0; - is_luckywld = 0; - is_metlhawk = 0; - - weird_vbl = 0; - - return 0; -} - -static inline UINT16 get_palette_register(INT32 reg) -{ - UINT16 *ctrl = (UINT16*)(DrvPalRAM + 0x3000); - return ((ctrl[reg*2] & 0xff) * 256 + (ctrl[reg*2+1] & 0xff)); -} - -#define restore_XY_clip(); \ - min_x = oldmin_x; \ - max_x = oldmax_x; \ - min_y = oldmin_y; \ - max_y = oldmax_y; - -static inline void adjust_clip() -{ - if (min_x > nScreenWidth) min_x = nScreenWidth-1; if (min_x < 0) min_x = 0; - if (max_x > nScreenWidth) max_x = nScreenWidth-1; if (max_x < 0) max_x = 0; - if (min_y > nScreenHeight) min_y = nScreenHeight-1; if (min_y < 0) min_y = 0; - if (max_y > nScreenHeight) max_y = nScreenHeight-1; if (max_y < 0) max_y = 0; -} - -static void apply_clip() -{ - min_x = get_palette_register(0) - 0x4a; - max_x = get_palette_register(1) - 0x4a - 1; - min_y = get_palette_register(2) - 0x21; - max_y = get_palette_register(3) - 0x21 - 1; - - adjust_clip(); - - GenericTilesSetClip(min_x, max_x, min_y, max_y); -} - -static void DrvRecalcPalette() -{ - UINT16 *ram = (UINT16*)DrvPalRAM; - - for (INT32 bank = 0; bank < 0x20; bank++) - { - INT32 pen = bank * 256; - INT32 offset = ((pen & 0x1800) << 2) | (pen & 0x0700); - - for (INT32 i = 0; i < 256; i++) - { - UINT8 r = ram[offset + i + 0x0000]; - UINT8 g = ram[offset + i + 0x0800]; - UINT8 b = ram[offset + i + 0x1000]; - - DrvPalette[pen + i] = BurnHighCol(r,g,b,0); - - DrvPalette[pen + i + 0x2000] = BurnHighCol(r/2,g/2,b/2,0); // shadow - } - } -} - -static void draw_layer_with_masking_by_line(INT32 layer, INT32 color, INT32 line, INT32 priority) -{ - if (line < min_y || line > max_y) return; - - if (layer >= 6) return; - - if ((nSpriteEnable & (1<= 4) { - scrollx = scrolly = 0; - } - - color = ((color & 7) * 256) + 0x1000; - - INT32 sy = (scrolly + line) % sizey_full; - - UINT16 *dst = pTransDraw + (line * nScreenWidth); - UINT8 *pri = pPrioDraw + (line * nScreenWidth); - - for (INT32 x = 0; x < nScreenWidth + 7; x+=8) - { - INT32 sx = (scrollx + x) % sizex_full; - - INT32 offs = (sx / 8) + ((sy / 8) * sizex); - - INT32 code = ram[offs]; - UINT8 *gfx = DrvGfxROM2 + (code * 8 * 8); - UINT8 *msk = DrvGfxROM4 + (code * 8); - - gfx += (sy & 7) * 8; - msk += (sy & 7); - - INT32 zx = x - (sx & 7); - - for (INT32 xx = 0; xx < 8; xx++, zx++) - { - if (zx < min_x || zx > max_x) continue; - - if (*msk & (0x80 >> xx)) - { - dst[zx] = gfx[xx] + color; - pri[zx] = (priority & 0x1000) ? ((priority * 2) & 0xff) : (priority & 0xff); - } - } - } -} - -static void draw_layer_with_masking(INT32 layer, INT32 color, INT32 priority) -{ - if (layer >= 6) return; - - if ((nSpriteEnable & (1<= 4) { - scrollx = scrolly = 0; - } - - color = ((color & 7) * 256) + 0x1000; - - for (INT32 offs = 0; offs < sizex * sizey; offs++) - { - INT32 sx = (offs % sizex) * 8; - INT32 sy = (offs / sizex) * 8; - - sx -= scrollx; - sy -= scrolly; - if (sx < -7) sx += sizex_full; - if (sy < -7) sy += sizey_full; - - if (flipscreen) { - sx = (nScreenWidth - 8) - sx; - sy = (nScreenHeight - 8) - sy; - } - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = ram[offs]; - UINT8 *gfx = DrvGfxROM2 + (code * 8 * 8); - UINT8 *msk = DrvGfxROM4 + (code * 8); - - if (flipscreen) - { - gfx += 8 * 7; - msk += 7; - - for (INT32 y = 0; y < 8; y++, msk--, gfx-=8) - { - if ((sy+y) < min_y) continue; - if ((sy+y) > max_y) break; - - for (INT32 x = 0; x < 8; x++) - { - if ((sx + x) < min_x || (sx + x) > max_x) continue; - - if (*msk & (0x01 << x)) - { - pTransDraw[(sy + y) * nScreenWidth + (sx + x)] = gfx[7 - x] + color; - pPrioDraw[(sy + y) * nScreenWidth + (sx + x)] = (priority & 0x1000) ? ((priority * 2) & 0xff) : (priority & 0xff); - } - } - } - } else { - for (INT32 y = 0; y < 8; y++, msk++, gfx+=8) - { - if ((sy+y) < min_y) continue; - if ((sy+y) > max_y) break; - - for (INT32 x = 0; x < 8; x++) - { - if ((sx + x) < min_x || (sx + x) > max_x) continue; - - if (*msk & (0x80 >> x)) - { - pTransDraw[(sy + y) * nScreenWidth + (sx + x)] = gfx[x] + color; - pPrioDraw[(sy + y) * nScreenWidth + (sx + x)] = (priority & 0x1000) ? ((priority * 2) & 0xff) : (priority & 0xff); - } - } - } - } - } -} - -static void draw_layer_line(INT32 line, INT32 pri) -{ - UINT16 *ctrl = (UINT16*)DrvC123Ctrl; - - for (INT32 i = 0; i < 6; i++) - { - if((ctrl[0x10+i] & 0xf) == (pri & 0xf)) - { - layer_color = ctrl[0x18 + i]; - draw_layer_with_masking_by_line(i, layer_color, line, pri); - } - } -} - -static void draw_layer(INT32 pri) -{ - UINT16 *ctrl = (UINT16*)DrvC123Ctrl; - - if (!max_x && !max_y) return; - - for (INT32 i = 0; i < 6; i++) - { - if((ctrl[0x10+i] & 0xf) == (pri & 0xf)) - { - layer_color = ctrl[0x18 + i]; - draw_layer_with_masking(i, layer_color, pri); - } - } -} - -static void predraw_roz_layer() -{ - if (roz_update_tiles == 0) return; // tiles not updated - - UINT16 *ram = (UINT16*)DrvRozRAM; - - for (INT32 offs = 0; offs < 256 * 256; offs++) - { - if (roz_dirty_tile[offs] == 0) continue; - roz_dirty_tile[offs] = 0; - - INT32 sx = (offs & 0xff) * 8; - INT32 sy = (offs / 256) * 8; - - UINT8 *gfx = DrvGfxROM3 + (ram[offs] * 0x40); - UINT16 *dst = roz_bitmap + (sy * 256 * 8) + sx; - - for (INT32 y = 0; y < 8; y++, dst += (256 * 8)) { - for (INT32 x = 0; x < 8; x++, gfx++) { - dst[x] = *gfx; - } - } - } - - roz_update_tiles = 0; -} - -static void zdrawgfxzoom(UINT8 *gfx, INT32 tile_size, UINT32 code, UINT32 color, INT32 flipx, INT32 flipy, INT32 sx, INT32 sy, INT32 scalex, INT32 scaley, INT32 priority, INT32 priority2, INT32 is_c355) -{ - if (!scalex || !scaley) return; - - if (!max_x && !max_y) return; //nothing to draw (zdrawgfxzoom draws a 1x1 pixel at 0,0 if max_x and max_y are 0) - - INT32 shadow_offset = (1)?0x2000:0; - const UINT8 *source_base = gfx + (code * tile_size * tile_size); - INT32 sprite_screen_height = (scaley*tile_size+0x8000)>>16; - INT32 sprite_screen_width = (scalex*tile_size+0x8000)>>16; - if (sprite_screen_width && sprite_screen_height) - { - INT32 dx = (tile_size<<16)/sprite_screen_width; - INT32 dy = (tile_size<<16)/sprite_screen_height; - - INT32 ex = sx+sprite_screen_width; - INT32 ey = sy+sprite_screen_height; - - INT32 x_index_base; - INT32 y_index; - - if( flipx ) - { - x_index_base = (sprite_screen_width-1)*dx; - dx = -dx; - } - else - { - x_index_base = 0; - } - - if( flipy ) - { - y_index = (sprite_screen_height-1)*dy; - dy = -dy; - } - else - { - y_index = 0; - } - - if( sx < min_x) - { // clip left - INT32 pixels = min_x-sx; - sx += pixels; - x_index_base += pixels*dx; - } - if( sy < min_y ) - { // clip top - INT32 pixels = min_y-sy; - sy += pixels; - y_index += pixels*dy; - } - if( ex > max_x+1 ) - { // clip right - INT32 pixels = ex-max_x-1; - ex -= pixels; - } - if( ey > max_y+1 ) - { // clip bottom - INT32 pixels = ey-max_y-1; - ey -= pixels; - } - - if (!(ex > sx)) return; - - if (priority2 == -1) - { - INT32 y; - UINT8 *priority_bitmap = pPrioDraw; - - for( y=sy; y>16) * tile_size; - UINT16 *dest = pTransDraw + y * nScreenWidth; - UINT8 *pri = priority_bitmap + y * nScreenWidth; - INT32 x, x_index = x_index_base; - - for (x = sx; x < ex; x++) - { - INT32 c = source[x_index>>16]; - if (c != 0xff) - { - if (pri[x] <= (priority)) - { - if (color == 0xf00 && c==0xfe) - { - dest[x] |= shadow_offset; - } - else - { - dest[x] = c | color; - } - pri[x] = priority; - } - } - x_index += dx; - } - y_index += dy; - } - } else - { // 2-priority mode. "priority" sprite:tile, "priority2" sprite:sprite - // Marvel Land needs this for things like the end-of-level door, which is a lower prio than the player sprite - but the player sprite needs to be ontop of the door. - INT32 y; - UINT8 *priority_bitmap = pPrioDraw; - UINT8 *priority_bitmap2 = SpritePrio; - - for( y=sy; y>16) * tile_size; - UINT16 *dest = pTransDraw + y * nScreenWidth; - UINT8 *pri = priority_bitmap + y * nScreenWidth; - UINT8 *pri2 = priority_bitmap2 + y * nScreenWidth; - INT32 x, x_index = x_index_base; - - for (x = sx; x < ex; x++) - { - INT32 c = source[x_index>>16]; - if (c != 0xff) - { - if (pri[x] <= priority && pri2[x] <= priority2) - { - if (color == 0xf00 && c==0xfe) - { - dest[x] |= shadow_offset; - } - else - { - dest[x] = c | color; - } - - pri2[x] = priority2; // only write sprite:sprite prio bitmap - } else { - if (!is_c355) - pri2[x] = 0xff; // for masking effects in rthun2 (enemy rides down wall-chute) - } - } - x_index += dx; - } - y_index += dy; - } - } - } -} - -static void draw_sprites_metalhawk() -{ - const UINT16 *pSource = (UINT16*)DrvSprRAM; - - for (INT32 loop=0; loop < 128; loop++) - { - INT32 ypos = pSource[0]; - INT32 tile = pSource[1]; - INT32 xpos = pSource[3]; - INT32 flags = pSource[6]; - INT32 attrs = pSource[7]; - INT32 sizey = ((ypos>>10)&0x3f)+1; - INT32 sizex = (xpos>>10)&0x3f; - INT32 sprn = tile&0x1fff; - - if( tile&0x2000 ) - { - sprn&=0xfff; - } - else - { - sprn|=0x1000; - } - - if( (sizey-1) && sizex ) - { - INT32 bBigSprite = (flags&8); - INT32 color = (attrs>>4)&0xf; - INT32 sx = (xpos&0x03ff)-0x50+0x07; - INT32 sy = (0x1ff-(ypos&0x01ff))-0x50+0x02; - INT32 flipx = flags&2; - INT32 flipy = flags&4; - INT32 scalex = (sizex<<16)/(bBigSprite?0x20:0x10); - INT32 scaley = (sizey<<16)/(bBigSprite?0x20:0x10); - - if (flags&0x01) - { - sprn |= 0x2000; - } - - if (bBigSprite) - { - if( sizex < 0x20 ) sx -= (0x20-sizex)/0x8; - if( sizey < 0x20 ) sy += (0x20-sizey)/0xC; - } - - UINT8 *gfx; - - if (!bBigSprite) - { - gfx = DrvGfxROM1; - - sizex = 16; - sizey = 16; - scalex = 1<<16; - scaley = 1<<16; - } - else - { - gfx = DrvGfxROM0; - sprn >>= 2; - } - - zdrawgfxzoom(gfx, bBigSprite ? 32 : 16, sprn, color * 256, flipx, flipy, sx, sy, scalex, scaley, (attrs & 0xf), -1, 0); - } - pSource += 8; - } -} - -static void predraw_c169_roz_bitmap() -{ - UINT16 *ram = (UINT16*)DrvRozRAM; - UINT16 *dirty = (UINT16*)roz_dirty_tile; - - for (INT32 offs = 0; offs < 256 * 256; offs++) - { - INT32 sx = (offs & 0xff); - INT32 sy = (offs / 0x100); - - INT32 ofst; - if (sx >= 128) { - ofst = (sx & 0x7f) + ((sy + 0x100) * 0x80); - } else { - ofst = sx + (sy * 0x80); - } - - INT32 code = ram[ofst] & 0x3fff; - if (code == dirty[ofst] && roz_update_tiles == 0) { - continue; - } - dirty[ofst] = code; - - sx *= 16; - sy *= 16; - - UINT8 *gfx = DrvGfxROM3 + (code * 0x100); - UINT8 *msk = DrvGfxROM5 + (code * 0x020); - - UINT16 *dst = roz_bitmap + (sy * (256 * 16)) + sx; - - for (INT32 y = 0; y < 16; y++, gfx+=16,msk+=2) - { - for (INT32 x = 0; x < 16; x++) - { - if (msk[x/8] & (0x80 >> (x & 7))) - { - dst[x] = gfx[x]; - } else { - dst[x] = 0x8000; - } - } - - dst += (256 * 16); - } - } - - roz_update_tiles = 0; -} - -struct roz_param -{ - UINT32 size; - UINT32 startx,starty; - INT32 incxx,incxy,incyx,incyy; - INT32 color; - INT32 wrap; -}; - -static inline void draw_roz_helper_block(const struct roz_param *rozInfo, INT32 destx, INT32 desty, INT32 srcx, INT32 srcy, INT32 width, INT32 height, UINT32 size_mask, INT32 pri) -{ - INT32 desty_end = desty + height; - - INT32 end_incrx = rozInfo->incyx - (width * rozInfo->incxx); - INT32 end_incry = rozInfo->incyy - (width * rozInfo->incxy); - - UINT16 *dest = pTransDraw + (desty * nScreenWidth) + destx; - UINT8 *prio = pPrioDraw + (desty * nScreenWidth) + destx; - INT32 dest_rowinc = nScreenWidth - width; - - while (desty < desty_end) - { - UINT16 *dest_end = dest + width; - while (dest < dest_end) - { - UINT32 xpos = (srcx >> 16); - UINT32 ypos = (srcy >> 16); - - if (rozInfo->wrap) - { - xpos &= size_mask; - ypos &= size_mask; - } - else if ((xpos > rozInfo->size) || (ypos >= rozInfo->size)) - { - srcx += rozInfo->incxx; - srcy += rozInfo->incxy; - dest++; - prio++; - continue; - } - - INT32 pxl = roz_bitmap[(ypos * 256 * 8) + xpos]; - - if (pxl != 0xff) - { - *dest = pxl + rozInfo->color; - *prio = pri; - } - - srcx += rozInfo->incxx; - srcy += rozInfo->incxy; - dest++; - prio++; - } - srcx += end_incrx; - srcy += end_incry; - dest += dest_rowinc; - prio += dest_rowinc; - desty++; - } -} - -static void draw_roz_helper(const struct roz_param *rozInfo, INT32 pri) -{ - UINT32 size_mask = rozInfo->size - 1; - UINT32 srcx = (rozInfo->startx + (min_x * rozInfo->incxx) + (min_y * rozInfo->incyx)); - UINT32 srcy = (rozInfo->starty + (min_x * rozInfo->incxy) + (min_y * rozInfo->incyy)); - INT32 destx = min_x; - INT32 desty = min_y; - - INT32 row_count = (max_y - desty) + 1; - INT32 row_block_count = row_count / 8; - INT32 row_extra_count = row_count % 8; - - INT32 column_count = (max_x - destx) + 1; - INT32 column_block_count = column_count / 8; - INT32 column_extra_count = column_count % 8; - - INT32 row_block_size_incxx = 8 * rozInfo->incxx; - INT32 row_block_size_incxy = 8 * rozInfo->incxy; - INT32 row_block_size_incyx = 8 * rozInfo->incyx; - INT32 row_block_size_incyy = 8 * rozInfo->incyy; - - for (INT32 i = 0; i < row_block_count; i++) - { - INT32 sx = srcx; - INT32 sy = srcy; - INT32 dx = destx; - - for (INT32 j = 0; j < column_block_count; j++) - { - draw_roz_helper_block(rozInfo, dx, desty, sx, sy, 8, 8, size_mask, pri); - sx += row_block_size_incxx; - sy += row_block_size_incxy; - dx += 8; - } - - if (column_extra_count) - { - draw_roz_helper_block(rozInfo, dx, desty, sx, sy, column_extra_count, 8,size_mask, pri); - } - srcx += row_block_size_incyx; - srcy += row_block_size_incyy; - desty += 8; - } - - if (row_extra_count) - { - for (INT32 i = 0; i < column_block_count; i++) - { - draw_roz_helper_block(rozInfo, destx, desty, srcx, srcy, 8, row_extra_count, size_mask, pri); - srcx += row_block_size_incxx; - srcy += row_block_size_incxy; - destx += 8; - } - - if (column_extra_count) - { - draw_roz_helper_block(rozInfo, destx, desty, srcx, srcy, column_extra_count, row_extra_count, size_mask, pri); - } - } -} - -static void draw_roz(INT32 pri) -{ - const INT32 xoffset = 38,yoffset = 0; - struct roz_param rozParam; - - UINT16 *m_roz_ctrl = (UINT16*)DrvRozCtrl; - - if (!max_x && !max_y) return; - - rozParam.color = (gfx_ctrl & 0x0f00); - rozParam.incxx = (INT16)m_roz_ctrl[0]; - rozParam.incxy = (INT16)m_roz_ctrl[1]; - rozParam.incyx = (INT16)m_roz_ctrl[2]; - rozParam.incyy = (INT16)m_roz_ctrl[3]; - rozParam.startx = (INT16)m_roz_ctrl[4]; - rozParam.starty = (INT16)m_roz_ctrl[5]; - rozParam.size = 2048; - rozParam.wrap = 1; - - switch( m_roz_ctrl[7] ) - { - case 0x4400: // (2048x2048) - break; - - case 0x4488: // attract mode - rozParam.wrap = 0; - break; - - case 0x44cc: // stage1 demo - rozParam.wrap = 0; - break; - - case 0x44ee: // (256x256) used in Dragon Saber - rozParam.wrap = 0; - rozParam.size = 256; - break; - } - - rozParam.startx <<= 4; - rozParam.starty <<= 4; - rozParam.startx += xoffset * rozParam.incxx + yoffset * rozParam.incyx; - rozParam.starty += xoffset * rozParam.incxy + yoffset * rozParam.incyy; - - rozParam.startx<<=8; - rozParam.starty<<=8; - rozParam.incxx<<=8; - rozParam.incxy<<=8; - rozParam.incyx<<=8; - rozParam.incyy<<=8; - - draw_roz_helper(&rozParam, pri); -} - -static void draw_sprites_bank(INT32 spritebank) -{ - UINT16 *m_spriteram = (UINT16*)DrvSprRAM; - INT32 offset = (spritebank & 0xf) * (128*4); - - //for (INT32 loop=0; loop < 128; loop++) - for (INT32 loop=127; loop>=0; loop--) // fix rthun2 masking issue - { - INT32 word3 = m_spriteram[offset+(loop*4)+3]; - INT32 priority = word3 & 0xf; - - INT32 word0 = m_spriteram[offset+(loop*4)+0]; - INT32 word1 = m_spriteram[offset+(loop*4)+1]; - INT32 offset4 = m_spriteram[offset+(loop*4)+2]; - - INT32 sizey=((word0>>10)&0x3f)+1; - INT32 sizex=(word3>>10)&0x3f; - - if((word0&0x0200)==0) sizex>>=1; - - if((sizey-1) && sizex ) - { - INT32 color = (word3>>4)&0x000f; - INT32 code = word1 & 0x3fff; - INT32 ypos = (0x1ff-(word0&0x01ff))-0x50+0x02; - INT32 xpos = (offset4&0x03ff)-0x50+0x07; - INT32 flipy = word1&0x8000; - INT32 flipx = word1&0x4000; - INT32 scalex = (sizex<<16)/((word0&0x0200)?0x20:0x10); - INT32 scaley = (sizey<<16)/((word0&0x0200)?0x20:0x10); - if(scalex && scaley) - { - INT32 size = (word0 >> 9) & 1; // 1 = 32x32, 0 = 16x16 - - if (size == 1) code >>= 2; - - zdrawgfxzoom( size ? DrvGfxROM0 : DrvGfxROM1, size ? 32 : 16, code, color * 256, flipx,flipy, xpos,ypos, scalex,scaley, priority, loop, 0); - } - } - } -} - -static void DrvPrio2Clear() -{ - memset(SpritePrio, 0, 300 * 300); -} - -static void draw_sprites() -{ - DrvPrio2Clear(); - - if (!sprite_bankL) { // game didn't select sprite bank for frame(rare), default to first bank. - sprite_bankL = 1<<0; - sprite_bankSL[0][0] = 0; - sprite_bankSL[0][1] = nScreenHeight; - } - - for (INT32 i = 0; i < 0x10; i++) - { - if (sprite_bankL & 1< oldmax_y) max_y = oldmax_y; - - //bprintf(0, _T("draw spritebank %X, min_y %d max_y %d.\n"), i, min_y, max_y); /*keep!*/ - draw_sprites_bank(i); - - min_y = oldmin_y; - max_y = oldmax_y; - } - } - sprite_bankL = 0; -} - -static void DrvDrawBegin() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - DrvRecalc = 0; - } - - apply_clip(); - - INT32 roz_enable = (gfx_ctrl & 0x7000) ? 1 : 0; - - if (roz_enable) predraw_roz_layer(); - - BurnTransferClear(0x4000); -} - -static void DrvDrawLine(INT32 line) -{ - INT32 roz_enable = (gfx_ctrl & 0x7000) ? 1 : 0; - - for (INT32 pri = 0; pri < 8; pri++) - { - draw_layer_line(line, pri); - - if (((gfx_ctrl & 0x7000) >> 12) == pri ) - { - if (roz_enable) { - INT32 oldmin_y = min_y; - INT32 oldmax_y = max_y; - min_y = (line >= min_y && line <= max_y) ? line : 255; - max_y = (line+1 <= max_y) ? line+1 : 0; - if (nBurnLayer & 1) draw_roz(pri); - min_y = oldmin_y; - max_y = oldmax_y; - } - } - } -} - -static INT32 DrvDraw() -{ - if (!pDrvDrawBegin) { // not line based, fall back to default - if (DrvRecalc) { - DrvRecalcPalette(); - DrvRecalc = 0; - } - - apply_clip(); - - INT32 roz_enable = (gfx_ctrl & 0x7000) ? 1 : 0; - - if (roz_enable) predraw_roz_layer(); - - BurnTransferClear(0x4000); - - for (INT32 pri = 0; pri < 8; pri++) - { - draw_layer(pri); - - if (((gfx_ctrl & 0x7000) >> 12) == pri) - { - if (roz_enable) { - if (nBurnLayer & 1) draw_roz(pri); - } - } - } - } - - if (nBurnLayer & 2) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void c355_obj_draw_sprite(const UINT16 *pSource, INT32 zpos) -{ - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - const UINT16 *spriteformat16 = &spriteram16[0x4000/2]; - const UINT16 *spritetile16 = &spriteram16[0x8000/2]; - - UINT16 palette = pSource[6]; - - INT32 pri = (palette >> 4) & 0xf; - - UINT16 linkno = pSource[0]; - UINT16 offset = pSource[1]; - INT32 hpos = pSource[2]; - INT32 vpos = pSource[3]; - UINT16 hsize = pSource[4]; - UINT16 vsize = pSource[5]; - - if (linkno*4>=0x4000/2) return; - - INT32 xscroll = (INT16)c355_obj_position[1]; - INT32 yscroll = (INT16)c355_obj_position[0]; - xscroll &= 0x1ff; if( xscroll & 0x100 ) xscroll |= ~0x1ff; - yscroll &= 0x1ff; if( yscroll & 0x100 ) yscroll |= ~0x1ff; - xscroll += 0x26; - yscroll += 0x19; - - hpos -= xscroll; - vpos -= yscroll; - const UINT16 *pWinAttr = &spriteram16[0x2400/2+((palette>>8)&0xf)*4]; - - INT32 oldmin_x = min_x; - INT32 oldmax_x = max_x; - INT32 oldmin_y = min_y; - INT32 oldmax_y = max_y; - min_x = pWinAttr[0] - xscroll; - max_x = pWinAttr[1] - xscroll; - min_y = pWinAttr[2] - yscroll; - max_y = pWinAttr[3] - yscroll; - adjust_clip(); // make sane - - if (min_x < oldmin_x) min_x = oldmin_x; - if (max_x > oldmax_x) max_x = oldmax_x; - if (min_y < oldmin_y) min_y = oldmin_y; - if (max_y > oldmax_y) max_y = oldmax_y; - - hpos&=0x7ff; if( hpos&0x400 ) hpos |= ~0x7ff; /* sign extend */ - vpos&=0x7ff; if( vpos&0x400 ) vpos |= ~0x7ff; /* sign extend */ - - INT32 tile_index = spriteformat16[linkno*4+0]; - INT32 format = spriteformat16[linkno*4+1]; - INT32 dx = spriteformat16[linkno*4+2]; - INT32 dy = spriteformat16[linkno*4+3]; - INT32 num_cols = (format>>4)&0xf; - INT32 num_rows = (format)&0xf; - - if( num_cols == 0 ) num_cols = 0x10; - INT32 flipx = (hsize&0x8000)?1:0; - hsize &= 0x3ff; - if( hsize == 0 ) { restore_XY_clip(); return; } - UINT32 zoomx = (hsize<<16)/(num_cols*16); - dx = (dx*zoomx+0x8000)>>16; - if( flipx ) - { - hpos += dx; - } - else - { - hpos -= dx; - } - - if( num_rows == 0 ) num_rows = 0x10; - INT32 flipy = (vsize&0x8000)?1:0; - vsize &= 0x3ff; - if( vsize == 0 ) { restore_XY_clip(); return; } - UINT32 zoomy = (vsize<<16)/(num_rows*16); - dy = (dy*zoomy+0x8000)>>16; - if( flipy ) - { - vpos += dy; - } - else - { - vpos -= dy; - } - - INT32 color = palette&0xf; - - UINT32 source_height_remaining = num_rows*16; - UINT32 screen_height_remaining = vsize; - INT32 sy = vpos; - for(INT32 row=0; row> 8, BurnGunY[i] >> 8); - } - - return 0; -} - -static void FinallapDrawBegin() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - DrvRecalc = 0; - } - - apply_clip(); - - BurnTransferClear(0x4000); -} - -static void FinallapDrawLine(INT32 line) -{ - for (INT32 pri=0; pri < 16; pri++) - { - if ((pri&1) == 0) - { - draw_layer_line(line, pri/2 | 0x1000); - } - } -} - -static INT32 FinallapDraw() -{ - if (!pDrvDrawBegin) { // not line based, fall back to default - if (DrvRecalc) { - DrvRecalcPalette(); - DrvRecalc = 0; - } - - apply_clip(); - - BurnTransferClear(0x4000); - - for (INT32 pri = 0; pri < 16; pri++) - { - if ((pri&1) == 0) - { - draw_layer(pri/2 | 0x1000); - } - } - } - if (nBurnLayer & 1) c45RoadDraw(); - if (nBurnLayer & 2) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void LuckywldDrawBegin() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - DrvRecalc = 0; - } - - apply_clip(); - - predraw_c169_roz_bitmap(); - - BurnTransferClear(0x4000); -} - -static void LuckywldDrawLine(INT32 line) -{ - for (INT32 pri = 0; pri < 16; pri++) - { - if ((pri&1) == 0) - { - draw_layer_line(line, pri/2 | 0x1000); // 0x1000 = write pri*2 to priobuf - } - - if (nBurnLayer & 2) c169_roz_draw(pri, line); // guys in mirror - } -} - -static INT32 LuckywldDraw() -{ - if (!pDrvDrawBegin) { // not line based, fall back to default - if (DrvRecalc) { - DrvRecalcPalette(); - DrvRecalc = 0; - } - - apply_clip(); - - predraw_c169_roz_bitmap(); - - BurnTransferClear(0x4000); - - for (INT32 pri = 0; pri < 16; pri++) - { - if ((pri&1) == 0) - { - draw_layer(pri/2 | 0x1000); - } - - if (nBurnLayer & 2) c169_roz_draw(pri, -1); - } - } - - if (nBurnLayer & 1) c45RoadDraw(); - if (nBurnLayer & 4) c355_draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 Suzuka8hDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - DrvRecalc = 0; - } - - apply_clip(); - - BurnTransferClear(0x4000); - - for (INT32 pri = 0; pri < 16; pri++) - { - if ((pri&1) == 0) - { - draw_layer(pri/2); - } - } - - if (nBurnLayer & 1) c45RoadDraw(); - if (nBurnLayer & 4) c355_draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 MetlhawkDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - DrvRecalc = 0; - } - - apply_clip(); - - predraw_c169_roz_bitmap(); - - BurnTransferClear(0x4000); - - for (INT32 pri = 0; pri < 16; pri++) - { - if ((pri&1) == 0) - { - draw_layer(pri/2 | 0x1000); - } - - if (nBurnLayer & 1) c169_roz_draw(pri, -1); - } - - if (nBurnLayer & 2) draw_sprites_metalhawk(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - if (nvramcheck) { - FreshEEPROMCheck(); - } - - SekNewFrame(); - M6809NewFrame(); - m6805NewFrame(); - - { - memset (DrvInputs, 0xff, 4); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - - if (uses_gun) { - BurnGunMakeInputs(0, (INT16)DrvGun0, (INT16)DrvGun1); - BurnGunMakeInputs(1, (INT16)DrvGun2, (INT16)DrvGun3); - } - - } - - INT32 nInterleave = 264*2; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[4] = { (INT32)((double)12288000 / 60.606061), (INT32)((double)12288000 / 60.606061), (INT32)((double)2048000 / 60.606061), (INT32)((double)2048000 / 1 / 60.606061) }; - INT32 nCyclesDone[4] = { 0, 0, 0, 0 }; - INT32 vbloffs = 8; - - switch (weird_vbl) { - case 1: vbloffs = 16; break; - case 2: vbloffs = -16; break; - } - - M6809Open(0); - m6805Open(0); - - UINT16 *ctrl = (UINT16*)(DrvPalRAM + 0x3000); - - if (pBurnDraw && pDrvDrawBegin) { - pDrvDrawBegin(); - } - - for (INT32 i = 0; i < nInterleave; i++) { - scanline = i / 2; - - position = (((ctrl[0xa] & 0xff) * 256 + (ctrl[0xb] & 0xff)) - 35) & 0xff; - - SekOpen(0); - if (i == (240+vbloffs)*2) SekSetIRQLine(irq_vblank[0], CPU_IRQSTATUS_AUTO); // should ack in c148 - if (i == position*2) SekSetIRQLine(irq_pos[0], CPU_IRQSTATUS_ACK); - - INT32 nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nNext - nCyclesDone[0]); - INT32 segment = (maincpu_run_ended) ? maincpu_run_cycles : SekTotalCycles(); - maincpu_run_ended = maincpu_run_cycles = 0; - SekClose(); - - if (pBurnDraw && pDrvDrawLine && i&1) - pDrvDrawLine(i/2); - - SekOpen(1); - if (sub_cpu_in_reset) { - nCyclesDone[1] += segment - SekTotalCycles(); - SekIdle(segment - SekTotalCycles()); - } else { - if (i == (240+vbloffs)*2) SekSetIRQLine(irq_vblank[1], CPU_IRQSTATUS_AUTO); // should ack in c148 - if (i == position*2) SekSetIRQLine(irq_pos[1], CPU_IRQSTATUS_ACK); - nCyclesDone[1] += SekRun(segment - SekTotalCycles()); - } - SekClose(); - - if (sub_cpu_in_reset) { - nCyclesDone[3] += ((segment / 6) - m6805TotalCycles()); - } else { - nCyclesDone[3] += m6805Run(((segment / 6) - m6805TotalCycles())); - if (i == 240*2) { - hd63705SetIrqLine(0, CPU_IRQSTATUS_ACK); - } - if (i == 16*2) { - hd63705SetIrqLine(0, CPU_IRQSTATUS_NONE); - } - } - - if (audio_cpu_in_reset) { - nCyclesDone[2] += segment / 6; - } else { - nCyclesDone[2] += M6809Run((segment / 6) - M6809TotalCycles()); - - if (i == 1*2 || i == 133*2) { - M6809SetIRQLine(0, CPU_IRQSTATUS_HOLD); - M6809SetIRQLine(1, CPU_IRQSTATUS_HOLD); - } - } - - if (pBurnSoundOut && i%8 == 7) { - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - c140_update(pBurnSoundOut, nBurnSoundLen); - } - - m6805Close(); - M6809Close(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_ROM) { - ba.Data = Drv68KROM[0]; - ba.nLen = 0x40000; - ba.nAddress = 0; - ba.szName = "68K #0 ROM"; - BurnAcb(&ba); - - ba.Data = Drv68KROM[1]; - ba.nLen = 0x040000; - ba.nAddress = 0x80000; - ba.szName = "68k #1 ROM"; - BurnAcb(&ba); - - ba.Data = Drv68KData; - ba.nLen = 0x200000; - ba.nAddress = 0x200000; - ba.szName = "68K Shared ROM"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = DrvC123RAM; - ba.nLen = 0x020000; - ba.nAddress = 0x400000; - ba.szName = "Bg RAM"; - BurnAcb(&ba); - - ba.Data = Drv68KRAM[0]; - ba.nLen = 0x40000; - ba.nAddress = 0x100000; - ba.szName = "68k 0 RAM"; - BurnAcb(&ba); - - ba.Data = Drv68KRAM[1]; - ba.nLen = 0x40000; - ba.nAddress = 0x140000; - ba.szName = "68k 1 RAM"; - BurnAcb(&ba); - - ba.Data = DrvDPRAM; - ba.nLen = 0x0000800; - ba.nAddress = 0x460000; - ba.szName = "Shared (DP) RAM"; - BurnAcb(&ba); - - ba.Data = DrvC139RAM; - ba.nLen = 0x0004000; - ba.nAddress = 0x480000; - ba.szName = "C139 RAM"; - BurnAcb(&ba); - - ba.Data = DrvPalRAM; - ba.nLen = 0x0010000; - ba.nAddress = 0x440000; - ba.szName = "Palette"; - BurnAcb(&ba); - - ba.Data = DrvSprRAM; - ba.nLen = 0x0014400; - ba.nAddress = 0xc00000; - ba.szName = "Sprite RAM"; - BurnAcb(&ba); - - ba.Data = DrvRozRAM; - ba.nLen = 0x0020000; - ba.nAddress = 0xc20000; - ba.szName = "ROZ RAM"; - BurnAcb(&ba); - - ba.Data = DrvMCURAM; - ba.nLen = 0x0000200; - ba.nAddress = 0xe00000; - ba.szName = "MCU RAM"; - BurnAcb(&ba); - - ba.Data = DrvM6809RAM; - ba.nLen = 0x0002000; - ba.nAddress = 0xe10000; - ba.szName = "M6809 RAM"; - BurnAcb(&ba); - - ba.Data = DrvC123Ctrl; - ba.nLen = 0x000040; - ba.nAddress = 0xe20000; - ba.szName = "C123 Control RAM"; - BurnAcb(&ba); - - ba.Data = DrvRozCtrl; - ba.nLen = 0x000020; - ba.nAddress = 0xe30000; - ba.szName = "Roz Control RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvEEPROM; - ba.nLen = 0x02000; - ba.nAddress = 0x180000; - ba.szName = "EEPROM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); - m6805Scan(nAction); - M6809Scan(nAction); - - BurnYM2151Scan(nAction); - c140_scan(); - - if (uses_gun) { - BurnGunScan(); - } - - SCAN_VAR(gfx_ctrl); - - SCAN_VAR(irq_reg); - SCAN_VAR(irq_cpu); - SCAN_VAR(irq_vblank); - SCAN_VAR(irq_ex); - SCAN_VAR(irq_pos); - SCAN_VAR(irq_sci); - SCAN_VAR(bus_reg); - - SCAN_VAR(c355_obj_position); - - SCAN_VAR(audio_cpu_in_reset); - SCAN_VAR(sub_cpu_in_reset); - SCAN_VAR(sound_bank); - - SCAN_VAR(min_x); - SCAN_VAR(max_x); - SCAN_VAR(min_y); - SCAN_VAR(max_y); - - SCAN_VAR(mcu_analog_ctrl); - SCAN_VAR(mcu_analog_complete); - SCAN_VAR(mcu_analog_data); - - SCAN_VAR(finallap_prot_count); - - SCAN_VAR(key_sendval); - - BurnRandomScan(nAction); - - c45RoadState(nAction); // here - - if (nAction & ACB_WRITE) { - memset (roz_dirty_tile, 1, 0x10000); - roz_update_tiles = 1; - - c45RoadState(nAction); // and here! - - M6809Open(0); - sound_bankswitch(sound_bank); - M6809Close(); - } - } - - return 0; -} - - -// Assault (Rev B) - -static struct BurnRomInfo assaultRomDesc[] = { - { "at2mp0b.bin", 0x10000, 0x801f71c5, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "at2mp1b.bin", 0x10000, 0x72312d4f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "at1sp0.bin", 0x10000, 0x0de2a0da, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "at1sp1.bin", 0x10000, 0x02d15fbe, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "at1snd0.bin", 0x20000, 0x1d1ffe12, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65b.bin", 0x08000, 0xe9f2922a, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "atobj0.bin", 0x20000, 0x22240076, 0x05 | BRF_GRA }, // 7 Sprites - { "atobj1.bin", 0x20000, 0x2284a8e8, 0x05 | BRF_GRA }, // 8 - { "atobj2.bin", 0x20000, 0x51425476, 0x05 | BRF_GRA }, // 9 - { "atobj3.bin", 0x20000, 0x791f42ce, 0x05 | BRF_GRA }, // 10 - { "atobj4.bin", 0x20000, 0x4782e1b0, 0x05 | BRF_GRA }, // 11 - { "atobj5.bin", 0x20000, 0xf5d158cf, 0x05 | BRF_GRA }, // 12 - { "atobj6.bin", 0x20000, 0x12f6a569, 0x05 | BRF_GRA }, // 13 - { "atobj7.bin", 0x20000, 0x06a929f2, 0x05 | BRF_GRA }, // 14 - - { "atchr0.bin", 0x20000, 0x6f8e968a, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "atchr1.bin", 0x20000, 0x88cf7cbe, 0x06 | BRF_GRA }, // 16 - - { "atroz0.bin", 0x20000, 0x8c247a97, 0x07 | BRF_GRA }, // 17 Roz Layer Tiles - { "atroz1.bin", 0x20000, 0xe44c475b, 0x07 | BRF_GRA }, // 18 - { "atroz2.bin", 0x20000, 0x770f377f, 0x07 | BRF_GRA }, // 19 - { "atroz3.bin", 0x20000, 0x01d93d0b, 0x07 | BRF_GRA }, // 20 - { "atroz4.bin", 0x20000, 0xf96feab5, 0x07 | BRF_GRA }, // 21 - { "atroz5.bin", 0x20000, 0xda2f0d9e, 0x07 | BRF_GRA }, // 22 - { "atroz6.bin", 0x20000, 0x9089e477, 0x07 | BRF_GRA }, // 23 - { "atroz7.bin", 0x20000, 0x62b2783a, 0x07 | BRF_GRA }, // 24 - - { "atshape.bin", 0x20000, 0xdfcad82b, 0x08 | BRF_GRA }, // 25 Layer Tiles Mask Data - - { "at1dat0.bin", 0x20000, 0x844890f4, 0x09 | BRF_PRG | BRF_ESS }, // 26 Shared 68K Data - { "at1dat1.bin", 0x20000, 0x21715313, 0x09 | BRF_PRG | BRF_ESS }, // 27 - - { "atvoi1.bin", 0x80000, 0xd36a649e, 0x0a | BRF_SND }, // 28 C140 Samples -}; - -STD_ROM_PICK(assault) -STD_ROM_FN(assault) - -static INT32 AssaultInit() -{ - return Namcos2Init(NULL, NULL); -} - -struct BurnDriver BurnDrvAssault = { - "assault", NULL, NULL, NULL, "1988", - "Assault (Rev B)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, assaultRomInfo, assaultRomName, NULL, NULL, AssaultInputInfo, AssaultDIPInfo, - AssaultInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Assault (Japan) - -static struct BurnRomInfo assaultjRomDesc[] = { - { "at1_mp0.bin", 0x10000, 0x2d3e5c8c, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "at1_mp1.bin", 0x10000, 0x851cec3a, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "at1sp0.bin", 0x10000, 0x0de2a0da, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "at1sp1.bin", 0x10000, 0x02d15fbe, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "at1snd0.bin", 0x20000, 0x1d1ffe12, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65b.bin", 0x08000, 0xe9f2922a, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "atobj0.bin", 0x20000, 0x22240076, 0x05 | BRF_GRA }, // 7 Sprites - { "atobj1.bin", 0x20000, 0x2284a8e8, 0x05 | BRF_GRA }, // 8 - { "atobj2.bin", 0x20000, 0x51425476, 0x05 | BRF_GRA }, // 9 - { "atobj3.bin", 0x20000, 0x791f42ce, 0x05 | BRF_GRA }, // 10 - { "atobj4.bin", 0x20000, 0x4782e1b0, 0x05 | BRF_GRA }, // 11 - { "atobj5.bin", 0x20000, 0xf5d158cf, 0x05 | BRF_GRA }, // 12 - { "atobj6.bin", 0x20000, 0x12f6a569, 0x05 | BRF_GRA }, // 13 - { "atobj7.bin", 0x20000, 0x06a929f2, 0x05 | BRF_GRA }, // 14 - - { "atchr0.bin", 0x20000, 0x6f8e968a, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "atchr1.bin", 0x20000, 0x88cf7cbe, 0x06 | BRF_GRA }, // 16 - - { "atroz0.bin", 0x20000, 0x8c247a97, 0x07 | BRF_GRA }, // 17 Roz Layer Tiles - { "atroz1.bin", 0x20000, 0xe44c475b, 0x07 | BRF_GRA }, // 18 - { "atroz2.bin", 0x20000, 0x770f377f, 0x07 | BRF_GRA }, // 19 - { "atroz3.bin", 0x20000, 0x01d93d0b, 0x07 | BRF_GRA }, // 20 - { "atroz4.bin", 0x20000, 0xf96feab5, 0x07 | BRF_GRA }, // 21 - { "atroz5.bin", 0x20000, 0xda2f0d9e, 0x07 | BRF_GRA }, // 22 - { "atroz6.bin", 0x20000, 0x9089e477, 0x07 | BRF_GRA }, // 23 - { "atroz7.bin", 0x20000, 0x62b2783a, 0x07 | BRF_GRA }, // 24 - - { "atshape.bin", 0x20000, 0xdfcad82b, 0x08 | BRF_GRA }, // 25 Layer Tiles Mask Data - - { "at1dat0.bin", 0x20000, 0x844890f4, 0x09 | BRF_PRG | BRF_ESS }, // 26 Shared 68K Data - { "at1dat1.bin", 0x20000, 0x21715313, 0x09 | BRF_PRG | BRF_ESS }, // 27 - - { "atvoi1.bin", 0x80000, 0xd36a649e, 0x0a | BRF_SND }, // 28 C140 Samples -}; - -STD_ROM_PICK(assaultj) -STD_ROM_FN(assaultj) - -struct BurnDriver BurnDrvAssaultj = { - "assaultj", "assault", NULL, NULL, "1988", - "Assault (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, assaultjRomInfo, assaultjRomName, NULL, NULL, AssaultInputInfo, AssaultDIPInfo, - AssaultInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Assault Plus (Japan) - -static struct BurnRomInfo assaultpRomDesc[] = { - { "mpr0.bin", 0x10000, 0x97519f9f, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "mpr1.bin", 0x10000, 0xc7f437c7, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "at1sp0.bin", 0x10000, 0x0de2a0da, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "at1sp1.bin", 0x10000, 0x02d15fbe, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "at1snd0.bin", 0x20000, 0x1d1ffe12, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65b.bin", 0x08000, 0xe9f2922a, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "atobj0.bin", 0x20000, 0x22240076, 0x05 | BRF_GRA }, // 7 Sprites - { "atobj1.bin", 0x20000, 0x2284a8e8, 0x05 | BRF_GRA }, // 8 - { "atobj2.bin", 0x20000, 0x51425476, 0x05 | BRF_GRA }, // 9 - { "atobj3.bin", 0x20000, 0x791f42ce, 0x05 | BRF_GRA }, // 10 - { "atobj4.bin", 0x20000, 0x4782e1b0, 0x05 | BRF_GRA }, // 11 - { "atobj5.bin", 0x20000, 0xf5d158cf, 0x05 | BRF_GRA }, // 12 - { "atobj6.bin", 0x20000, 0x12f6a569, 0x05 | BRF_GRA }, // 13 - { "atobj7.bin", 0x20000, 0x06a929f2, 0x05 | BRF_GRA }, // 14 - - { "atchr0.bin", 0x20000, 0x6f8e968a, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "atchr1.bin", 0x20000, 0x88cf7cbe, 0x06 | BRF_GRA }, // 16 - - { "atroz0.bin", 0x20000, 0x8c247a97, 0x07 | BRF_GRA }, // 17 Roz Layer Tiles - { "atroz1.bin", 0x20000, 0xe44c475b, 0x07 | BRF_GRA }, // 18 - { "atroz2.bin", 0x20000, 0x770f377f, 0x07 | BRF_GRA }, // 19 - { "atroz3.bin", 0x20000, 0x01d93d0b, 0x07 | BRF_GRA }, // 20 - { "atroz4.bin", 0x20000, 0xf96feab5, 0x07 | BRF_GRA }, // 21 - { "atroz5.bin", 0x20000, 0xda2f0d9e, 0x07 | BRF_GRA }, // 22 - { "atroz6.bin", 0x20000, 0x9089e477, 0x07 | BRF_GRA }, // 23 - { "atroz7.bin", 0x20000, 0x62b2783a, 0x07 | BRF_GRA }, // 24 - - { "atshape.bin", 0x20000, 0xdfcad82b, 0x08 | BRF_GRA }, // 25 Layer Tiles Mask Data - - { "at1dat0.bin", 0x20000, 0x844890f4, 0x09 | BRF_PRG | BRF_ESS }, // 26 Shared 68K Data - { "at1dat1.bin", 0x20000, 0x21715313, 0x09 | BRF_PRG | BRF_ESS }, // 27 - - { "atvoi1.bin", 0x80000, 0xd36a649e, 0x0a | BRF_SND }, // 28 C140 Samples Samples -}; - -STD_ROM_PICK(assaultp) -STD_ROM_FN(assaultp) - -static INT32 AssaultpInit() -{ - return Namcos2Init(NULL, NULL); -} - -struct BurnDriver BurnDrvAssaultp = { - "assaultp", "assault", NULL, NULL, "1988", - "Assault Plus (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, assaultpRomInfo, assaultpRomName, NULL, NULL, AssaultInputInfo, AssaultDIPInfo, - AssaultpInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Ordyne (Japan, English Version) - -static struct BurnRomInfo ordyneRomDesc[] = { - { "or1_mp0e.bin", 0x20000, 0x5e2f9052, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "or1_mp1e.bin", 0x20000, 0x367a8fcf, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "or1_sp0.bin", 0x10000, 0x01ef6638, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "or1_sp1.bin", 0x10000, 0xb632adc3, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "or1_sd0.bin", 0x20000, 0xc41e5d22, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "or1_ob0.bin", 0x20000, 0x67b2b9e4, 0x05 | BRF_GRA }, // 7 Sprites - { "or1_ob1.bin", 0x20000, 0x8a54fa5e, 0x05 | BRF_GRA }, // 8 - { "or1_ob2.bin", 0x20000, 0xa2c1cca0, 0x05 | BRF_GRA }, // 9 - { "or1_ob3.bin", 0x20000, 0xe0ad292c, 0x05 | BRF_GRA }, // 10 - { "or1_ob4.bin", 0x20000, 0x7aefba59, 0x05 | BRF_GRA }, // 11 - { "or1_ob5.bin", 0x20000, 0xe4025be9, 0x05 | BRF_GRA }, // 12 - { "or1_ob6.bin", 0x20000, 0xe284c30c, 0x05 | BRF_GRA }, // 13 - { "or1_ob7.bin", 0x20000, 0x262b7112, 0x05 | BRF_GRA }, // 14 - - { "or1_ch0.bin", 0x20000, 0xe7c47934, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "or1_ch1.bin", 0x20000, 0x874b332d, 0x06 | BRF_GRA }, // 16 - { "or1_ch3.bin", 0x20000, 0x5471a834, 0x06 | BRF_GRA }, // 17 - { "or1_ch5.bin", 0x20000, 0xa7d3a296, 0x06 | BRF_GRA }, // 18 - { "or1_ch6.bin", 0x20000, 0x3adc09c8, 0x06 | BRF_GRA }, // 19 - { "or1_ch7e.bin", 0x20000, 0x8c0d2ab7, 0x06 | BRF_GRA }, // 20 - - { "or1_rz0.bin", 0x20000, 0xc88a9e6b, 0x07 | BRF_GRA }, // 21 Roz Layer Tiles - { "or1_rz1.bin", 0x20000, 0xc20cc749, 0x07 | BRF_GRA }, // 22 - { "or1_rz2.bin", 0x20000, 0x148c9866, 0x07 | BRF_GRA }, // 23 - { "or1_rz3.bin", 0x20000, 0x4e727b7e, 0x07 | BRF_GRA }, // 24 - { "or1_rz4.bin", 0x20000, 0x17b04396, 0x07 | BRF_GRA }, // 25 - - { "or1_sha.bin", 0x20000, 0x7aec9dee, 0x08 | BRF_GRA }, // 26 Layer Tiles Mask Data - - { "or1_dt0.bin", 0x20000, 0xde214f7a, 0x09 | BRF_PRG | BRF_ESS }, // 27 Shared 68K Data - { "or1_dt1.bin", 0x20000, 0x25e3e6c8, 0x09 | BRF_PRG | BRF_ESS }, // 28 - - { "or1_vo1.bin", 0x80000, 0x369e0bca, 0x0a | BRF_SND }, // 29 C140 Samples - { "or1_vo2.bin", 0x80000, 0x9f4cd7b5, 0x0a | BRF_SND }, // 30 -}; - -STD_ROM_PICK(ordyne) -STD_ROM_FN(ordyne) - -static UINT16 ordyne_key_read(UINT8 offset) -{ - switch (offset) - { - case 2: return 0x1001; - case 3: return 0x0001; - case 4: return 0x0110; - case 5: return 0x0010; - case 6: return 0x00B0; - case 7: return 0x00B0; - } - - return BurnRandom(); -} - -static INT32 OrdyneInit() -{ - INT32 rc = Namcos2Init(NULL, ordyne_key_read); - - if (!rc) { - nvramcheck = 1; - } - - return rc; -} - -static INT32 OrdynejInit() -{ - INT32 rc = Namcos2Init(NULL, ordyne_key_read); - - if (!rc) { - nvramcheck = 2; - } - - return rc; -} - -struct BurnDriver BurnDrvOrdyne = { - "ordyne", NULL, NULL, NULL, "1988", - "Ordyne (Japan, English Version)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, ordyneRomInfo, ordyneRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - OrdyneInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Ordyne (Japan) - -static struct BurnRomInfo ordynejRomDesc[] = { - { "or1_mp0.bin", 0x20000, 0xf5929ed3, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "or1_mp1.bin", 0x20000, 0xc1c8c1e2, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "or1_sp0.bin", 0x10000, 0x01ef6638, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "or1_sp1.bin", 0x10000, 0xb632adc3, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "or1_sd0.bin", 0x20000, 0xc41e5d22, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "or1_ob0.bin", 0x20000, 0x67b2b9e4, 0x05 | BRF_GRA }, // 7 Sprites - { "or1_ob1.bin", 0x20000, 0x8a54fa5e, 0x05 | BRF_GRA }, // 8 - { "or1_ob2.bin", 0x20000, 0xa2c1cca0, 0x05 | BRF_GRA }, // 9 - { "or1_ob3.bin", 0x20000, 0xe0ad292c, 0x05 | BRF_GRA }, // 10 - { "or1_ob4.bin", 0x20000, 0x7aefba59, 0x05 | BRF_GRA }, // 11 - { "or1_ob5.bin", 0x20000, 0xe4025be9, 0x05 | BRF_GRA }, // 12 - { "or1_ob6.bin", 0x20000, 0xe284c30c, 0x05 | BRF_GRA }, // 13 - { "or1_ob7.bin", 0x20000, 0x262b7112, 0x05 | BRF_GRA }, // 14 - - { "or1_ch0.bin", 0x20000, 0xe7c47934, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "or1_ch1.bin", 0x20000, 0x874b332d, 0x06 | BRF_GRA }, // 16 - { "or1_ch3.bin", 0x20000, 0x5471a834, 0x06 | BRF_GRA }, // 17 - { "or1_ch5.bin", 0x20000, 0xa7d3a296, 0x06 | BRF_GRA }, // 18 - { "or1_ch6.bin", 0x20000, 0x3adc09c8, 0x06 | BRF_GRA }, // 19 - { "or1_ch7.bin", 0x20000, 0xf050a152, 0x06 | BRF_GRA }, // 20 - - { "or1_rz0.bin", 0x20000, 0xc88a9e6b, 0x07 | BRF_GRA }, // 21 Roz Layer Tiles - { "or1_rz1.bin", 0x20000, 0xc20cc749, 0x07 | BRF_GRA }, // 22 - { "or1_rz2.bin", 0x20000, 0x148c9866, 0x07 | BRF_GRA }, // 23 - { "or1_rz3.bin", 0x20000, 0x4e727b7e, 0x07 | BRF_GRA }, // 24 - { "or1_rz4.bin", 0x20000, 0x17b04396, 0x07 | BRF_GRA }, // 25 - - { "or1_sha.bin", 0x20000, 0x7aec9dee, 0x08 | BRF_GRA }, // 26 Layer Tiles Mask Data - - { "or1_dt0.bin", 0x20000, 0xde214f7a, 0x09 | BRF_PRG | BRF_ESS }, // 27 Shared 68K Data - { "or1_dt1.bin", 0x20000, 0x25e3e6c8, 0x09 | BRF_PRG | BRF_ESS }, // 28 - - { "or1_vo1.bin", 0x80000, 0x369e0bca, 0x0a | BRF_SND }, // 29 C140 Samples - { "or1_vo2.bin", 0x80000, 0x9f4cd7b5, 0x0a | BRF_SND }, // 30 -}; - -STD_ROM_PICK(ordynej) -STD_ROM_FN(ordynej) - -struct BurnDriver BurnDrvOrdynej = { - "ordynej", "ordyne", NULL, NULL, "1988", - "Ordyne (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_HORSHOOT, 0, - NULL, ordynejRomInfo, ordynejRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - OrdynejInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Cosmo Gang the Video (US) - -static struct BurnRomInfo cosmogngRomDesc[] = { - { "co2mpr0.bin", 0x20000, 0x2632c209, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "co2mpr1.bin", 0x20000, 0x65840104, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "co1spr0.bin", 0x20000, 0xbba2c28f, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "co1spr1.bin", 0x20000, 0xc029b459, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "co2_s0", 0x20000, 0x4ca59338, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "co1obj0.bin", 0x80000, 0x5df8ce0c, 0x05 | BRF_GRA }, // 7 Sprites - { "co1obj1.bin", 0x80000, 0x3d152497, 0x05 | BRF_GRA }, // 8 - { "co1obj2.bin", 0x80000, 0x4e50b6ee, 0x05 | BRF_GRA }, // 9 - { "co1obj3.bin", 0x80000, 0x7beed669, 0x05 | BRF_GRA }, // 10 - - { "co1chr0.bin", 0x80000, 0xee375b3e, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "co1chr1.bin", 0x80000, 0x0149de65, 0x06 | BRF_GRA }, // 12 - { "co1chr2.bin", 0x80000, 0x93d565a0, 0x06 | BRF_GRA }, // 13 - { "co1chr3.bin", 0x80000, 0x4d971364, 0x06 | BRF_GRA }, // 14 - - { "co1roz0.bin", 0x80000, 0x2bea6951, 0x07 | BRF_GRA }, // 15 Roz Layer Tiles - - { "co1sha0.bin", 0x80000, 0x063a70cc, 0x08 | BRF_GRA }, // 16 Layer Tiles Mask Data - - { "co1dat0.bin", 0x20000, 0xb53da2ae, 0x09 | BRF_PRG | BRF_ESS }, // 17 Shared 68K Data - { "co1dat1.bin", 0x20000, 0xd21ad10b, 0x09 | BRF_PRG | BRF_ESS }, // 18 - - { "co2voi1.bin", 0x80000, 0x5a301349, 0x0a | BRF_SND }, // 19 C140 Samples - { "co2voi2.bin", 0x80000, 0xa27cb45a, 0x0a | BRF_SND }, // 20 -}; - -STD_ROM_PICK(cosmogng) -STD_ROM_FN(cosmogng) - -static UINT16 cosmogng_key_read(UINT8 offset) -{ - if (offset == 3) return 0x014a; - - return BurnRandom(); -} - -static INT32 CosmogngInit() -{ - return Namcos2Init(NULL, cosmogng_key_read); -} - -struct BurnDriver BurnDrvCosmogng = { - "cosmogng", NULL, NULL, NULL, "1991", - "Cosmo Gang the Video (US)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, cosmogngRomInfo, cosmogngRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - CosmogngInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Mirai Ninja (Japan) - -static struct BurnRomInfo mirninjaRomDesc[] = { - { "mn_mpr0e.bin", 0x10000, 0xfa75f977, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "mn_mpr1e.bin", 0x10000, 0x58ddd464, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "mn1_spr0.bin", 0x10000, 0x3f1a17be, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "mn1_spr1.bin", 0x10000, 0x2bc66f60, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "mn_snd0.bin", 0x20000, 0x6aa1ae84, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65b.bin", 0x08000, 0xe9f2922a, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "mn_obj0.bin", 0x20000, 0x6bd1e290, 0x05 | BRF_GRA }, // 7 Sprites - { "mn_obj1.bin", 0x20000, 0x5e8503be, 0x05 | BRF_GRA }, // 8 - { "mn_obj2.bin", 0x20000, 0xa96d9b45, 0x05 | BRF_GRA }, // 9 - { "mn_obj3.bin", 0x20000, 0x0086ef8b, 0x05 | BRF_GRA }, // 10 - { "mn_obj4.bin", 0x20000, 0xb3f48755, 0x05 | BRF_GRA }, // 11 - { "mn_obj5.bin", 0x20000, 0xc21e995b, 0x05 | BRF_GRA }, // 12 - { "mn_obj6.bin", 0x20000, 0xa052c582, 0x05 | BRF_GRA }, // 13 - { "mn_obj7.bin", 0x20000, 0x1854c6f5, 0x05 | BRF_GRA }, // 14 - - { "mn_chr0.bin", 0x20000, 0x4f66df26, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "mn_chr1.bin", 0x20000, 0xf5de5ea7, 0x06 | BRF_GRA }, // 16 - { "mn_chr2.bin", 0x20000, 0x9ff61924, 0x06 | BRF_GRA }, // 17 - { "mn_chr3.bin", 0x20000, 0xba208bf5, 0x06 | BRF_GRA }, // 18 - { "mn_chr4.bin", 0x20000, 0x0ef00aff, 0x06 | BRF_GRA }, // 19 - { "mn_chr5.bin", 0x20000, 0x4cd9d377, 0x06 | BRF_GRA }, // 20 - { "mn_chr6.bin", 0x20000, 0x114aca76, 0x06 | BRF_GRA }, // 21 - { "mn_chr7.bin", 0x20000, 0x2d5705d3, 0x06 | BRF_GRA }, // 22 - - { "mn_roz0.bin", 0x20000, 0x677a4f25, 0x07 | BRF_GRA }, // 23 Roz Layer Tiles - { "mn_roz1.bin", 0x20000, 0xf00ae572, 0x07 | BRF_GRA }, // 24 - - { "mn_sha.bin", 0x20000, 0xc28af90f, 0x08 | BRF_GRA }, // 25 Layer Tiles Mask Data - - { "mn1_dat0.bin", 0x20000, 0x104bcca8, 0x09 | BRF_PRG | BRF_ESS }, // 26 Shared 68K Data - { "mn1_dat1.bin", 0x20000, 0xd2a918fb, 0x09 | BRF_PRG | BRF_ESS }, // 27 - - { "mn_voi1.bin", 0x80000, 0x2ca3573c, 0x0a | BRF_SND }, // 28 C140 Samples - { "mn_voi2.bin", 0x80000, 0x466c3b47, 0x0a | BRF_SND }, // 29 -}; - -STD_ROM_PICK(mirninja) -STD_ROM_FN(mirninja) - -static UINT16 mirninja_key_read(UINT8 offset) -{ - if (offset == 7) return 0x00b1; - - return BurnRandom(); -} - -static INT32 MirninjaInit() -{ - return Namcos2Init(NULL, mirninja_key_read); -} - -struct BurnDriver BurnDrvMirninja = { - "mirninja", NULL, NULL, NULL, "1988", - "Mirai Ninja (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, mirninjaRomInfo, mirninjaRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - MirninjaInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Phelios - -static struct BurnRomInfo pheliosRomDesc[] = { - { "ps2_mpr0.mpr0", 0x20000, 0x28f04e1a, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "ps2_mpr1.mpr1", 0x20000, 0x2546501a, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ps2_spr0.spr0", 0x10000, 0xe9c6987e, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "ps2_spr1.spr1", 0x10000, 0x02b074fb, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "ps2_snd0.snd0", 0x20000, 0xda694838, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2_c65c.3f", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "ps_obj-0.obj0", 0x40000, 0xf323db2b, 0x05 | BRF_GRA }, // 7 Sprites - { "ps_obj-1.obj1", 0x40000, 0xfaf7c2f5, 0x05 | BRF_GRA }, // 8 - { "ps_obj-2.obj2", 0x40000, 0x828178ba, 0x05 | BRF_GRA }, // 9 - { "ps_obj-3.obj3", 0x40000, 0xe84771c8, 0x05 | BRF_GRA }, // 10 - { "ps_obj-4.obj4", 0x40000, 0x81ea86c6, 0x05 | BRF_GRA }, // 11 - { "ps_obj-5.obj5", 0x40000, 0xaaebd51a, 0x05 | BRF_GRA }, // 12 - { "ps_obj-6.obj6", 0x40000, 0x032ea497, 0x05 | BRF_GRA }, // 13 - { "ps_obj-7.obj7", 0x40000, 0xf6183b36, 0x05 | BRF_GRA }, // 14 - - { "ps_chr-0.chr0", 0x20000, 0x668b6670, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "ps_chr-1.chr1", 0x20000, 0x80c30742, 0x06 | BRF_GRA }, // 16 - { "ps_chr-2.chr2", 0x20000, 0xf4e11bf7, 0x06 | BRF_GRA }, // 17 - { "ps_chr-3.chr3", 0x20000, 0x97a93dc5, 0x06 | BRF_GRA }, // 18 - { "ps_chr-4.chr4", 0x20000, 0x81d965bf, 0x06 | BRF_GRA }, // 19 - { "ps_chr-5.chr5", 0x20000, 0x8ca72d35, 0x06 | BRF_GRA }, // 20 - { "ps_chr-6.chr6", 0x20000, 0xda3543a9, 0x06 | BRF_GRA }, // 21 - - { "ps_roz-0.roz0", 0x20000, 0x68043d7e, 0x07 | BRF_GRA }, // 22 Roz Layer Tiles - { "ps_roz-1.roz1", 0x20000, 0x029802b4, 0x07 | BRF_GRA }, // 23 - { "ps_roz-2.roz2", 0x20000, 0xbf0b76dc, 0x07 | BRF_GRA }, // 24 - { "ps_roz-3.roz3", 0x20000, 0x9c821455, 0x07 | BRF_GRA }, // 25 - { "ps_roz-4.roz4", 0x20000, 0x63a39b7a, 0x07 | BRF_GRA }, // 26 - { "ps_roz-5.roz5", 0x20000, 0xfc5a99d0, 0x07 | BRF_GRA }, // 27 - { "ps_roz-6.roz6", 0x20000, 0xa2a17587, 0x07 | BRF_GRA }, // 28 - - { "ps_shape.shape", 0x20000, 0x58e26fcf, 0x08 | BRF_GRA }, // 29 Layer Tiles Mask Data - - { "ps2_dat0.data0", 0x20000, 0xee4194b0, 0x09 | BRF_PRG | BRF_ESS }, // 30 Shared 68K Data - { "ps2_dat1.data1", 0x20000, 0x5b22d714, 0x09 | BRF_PRG | BRF_ESS }, // 31 - - { "ps_voi-1.voice1", 0x80000, 0xf67376ed, 0x0a | BRF_SND }, // 32 C140 Samples -}; - -STD_ROM_PICK(phelios) -STD_ROM_FN(phelios) - -static UINT16 phelios_key_read(UINT8 offset) -{ - switch (offset) - { - case 0: return 0x00f0; - case 1: return 0x0ff0; - case 2: return 0x00b2; - case 3: return 0x00b2; - case 4: return 0x000f; - case 5: return 0xf00f; - case 7: return 0x00b2; - } - - return BurnRandom(); -} - -static INT32 PheliosInit() -{ - return Namcos2Init(NULL, phelios_key_read); -} - -struct BurnDriver BurnDrvPhelios = { - "phelios", NULL, NULL, NULL, "1988", - "Phelios\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, pheliosRomInfo, pheliosRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - PheliosInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Phelios (Japan) - -static struct BurnRomInfo pheliosjRomDesc[] = { - { "ps1_mpr0.mpr0", 0x20000, 0xbfbe96c6, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "ps1_mpr1.mpr1", 0x20000, 0xf5c0f883, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ps1_spr0.spr0", 0x10000, 0xe9c6987e, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "ps1_spr1.spr1", 0x10000, 0x02b074fb, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "ps1_snd0.snd0", 0x20000, 0xda694838, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2_c65c.3f", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "ps_obj-0.obj0", 0x40000, 0xf323db2b, 0x05 | BRF_GRA }, // 7 Sprites - { "ps_obj-1.obj1", 0x40000, 0xfaf7c2f5, 0x05 | BRF_GRA }, // 8 - { "ps_obj-2.obj2", 0x40000, 0x828178ba, 0x05 | BRF_GRA }, // 9 - { "ps_obj-3.obj3", 0x40000, 0xe84771c8, 0x05 | BRF_GRA }, // 10 - { "ps_obj-4.obj4", 0x40000, 0x81ea86c6, 0x05 | BRF_GRA }, // 11 - { "ps_obj-5.obj5", 0x40000, 0xaaebd51a, 0x05 | BRF_GRA }, // 12 - { "ps_obj-6.obj6", 0x40000, 0x032ea497, 0x05 | BRF_GRA }, // 13 - { "ps_obj-7.obj7", 0x40000, 0xf6183b36, 0x05 | BRF_GRA }, // 14 - - { "ps_chr-0.chr0", 0x20000, 0x668b6670, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "ps_chr-1.chr1", 0x20000, 0x80c30742, 0x06 | BRF_GRA }, // 16 - { "ps_chr-2.chr2", 0x20000, 0xf4e11bf7, 0x06 | BRF_GRA }, // 17 - { "ps_chr-3.chr3", 0x20000, 0x97a93dc5, 0x06 | BRF_GRA }, // 18 - { "ps_chr-4.chr4", 0x20000, 0x81d965bf, 0x06 | BRF_GRA }, // 19 - { "ps_chr-5.chr5", 0x20000, 0x8ca72d35, 0x06 | BRF_GRA }, // 20 - { "ps_chr-6.chr6", 0x20000, 0xda3543a9, 0x06 | BRF_GRA }, // 21 - - { "ps_roz-0.roz0", 0x20000, 0x68043d7e, 0x07 | BRF_GRA }, // 22 Roz Layer Tiles - { "ps_roz-1.roz1", 0x20000, 0x029802b4, 0x07 | BRF_GRA }, // 23 - { "ps_roz-2.roz2", 0x20000, 0xbf0b76dc, 0x07 | BRF_GRA }, // 24 - { "ps_roz-3.roz3", 0x20000, 0x9c821455, 0x07 | BRF_GRA }, // 25 - { "ps_roz-4.roz4", 0x20000, 0x63a39b7a, 0x07 | BRF_GRA }, // 26 - { "ps_roz-5.roz5", 0x20000, 0xfc5a99d0, 0x07 | BRF_GRA }, // 27 - { "ps_roz-6.roz6", 0x20000, 0xa2a17587, 0x07 | BRF_GRA }, // 28 - - { "ps_shape.shape", 0x20000, 0x58e26fcf, 0x08 | BRF_GRA }, // 29 Layer Tiles Mask Data - - { "ps1_dat0.data0", 0x20000, 0xee4194b0, 0x09 | BRF_PRG | BRF_ESS }, // 30 Shared 68K Data - { "ps1_dat1.data1", 0x20000, 0x5b22d714, 0x09 | BRF_PRG | BRF_ESS }, // 31 - - { "ps_voi-1.voice1", 0x80000, 0xf67376ed, 0x0a | BRF_SND }, // 32 C140 Samples -}; - -STD_ROM_PICK(pheliosj) -STD_ROM_FN(pheliosj) - -struct BurnDriver BurnDrvPheliosj = { - "pheliosj", "phelios", NULL, NULL, "1988", - "Phelios (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pheliosjRomInfo, pheliosjRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - PheliosInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - - -// Marvel Land (US) - -static struct BurnRomInfo marvlandRomDesc[] = { - { "mv2_mpr0", 0x20000, 0xd8b14fee, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "mv2_mpr1", 0x20000, 0x29ff2738, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "mv2_spr0", 0x10000, 0xaa418f29, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "mv2_spr1", 0x10000, 0xdbd94def, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "mv2_snd0", 0x20000, 0xa5b99162, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "mv1-obj0.bin", 0x40000, 0x73a29361, 0x05 | BRF_GRA }, // 7 Sprites - { "mv1-obj1.bin", 0x40000, 0xabbe4a99, 0x05 | BRF_GRA }, // 8 - { "mv1-obj2.bin", 0x40000, 0x753659e0, 0x05 | BRF_GRA }, // 9 - { "mv1-obj3.bin", 0x40000, 0xd1ce7339, 0x05 | BRF_GRA }, // 10 - - { "mv1-chr0.bin", 0x40000, 0x1c7e8b4f, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "mv1-chr1.bin", 0x40000, 0x01e4cafd, 0x06 | BRF_GRA }, // 12 - { "mv1-chr2.bin", 0x40000, 0x198fcc6f, 0x06 | BRF_GRA }, // 13 - { "mv1-chr3.bin", 0x40000, 0xed6f22a5, 0x06 | BRF_GRA }, // 14 - - { "mv1-roz0.bin", 0x20000, 0x7381a5a9, 0x07 | BRF_GRA }, // 15 Roz Layer Tiles - { "mv1-roz1.bin", 0x20000, 0xe899482e, 0x07 | BRF_GRA }, // 16 - { "mv1-roz2.bin", 0x20000, 0xde141290, 0x07 | BRF_GRA }, // 17 - { "mv1-roz3.bin", 0x20000, 0xe310324d, 0x07 | BRF_GRA }, // 18 - { "mv1-roz4.bin", 0x20000, 0x48ddc5a9, 0x07 | BRF_GRA }, // 19 - - { "mv1-sha.bin", 0x40000, 0xa47db5d3, 0x08 | BRF_GRA }, // 20 Layer Tiles Mask Data - - { "mv2_dat0", 0x20000, 0x62e6318b, 0x09 | BRF_PRG | BRF_ESS }, // 21 Shared 68K Data - { "mv2_dat1", 0x20000, 0x8a6902ca, 0x09 | BRF_PRG | BRF_ESS }, // 22 - { "mv2_dat2", 0x20000, 0xf5c6408c, 0x09 | BRF_PRG | BRF_ESS }, // 23 - { "mv2_dat3", 0x20000, 0x6df76955, 0x09 | BRF_PRG | BRF_ESS }, // 24 - - { "mv1-voi1.bin", 0x80000, 0xde5cac09, 0x0a | BRF_SND }, // 25 C140 Samples Samples -}; - -STD_ROM_PICK(marvland) -STD_ROM_FN(marvland) - -static void marvland_key_write(UINT8 offset, UINT16 data) -{ - if ((offset == 5 && data == 0x615e) || (offset == 6 && data == 0x1001)) { - key_sendval = offset & 1; - } -} - -static UINT16 marvland_key_read(UINT8 offset) -{ - switch (offset) - { - case 0: return 0x0010; - case 1: return 0x0110; - case 4: return 0x00BE; - case 6: return 0x1001; - case 7: return (key_sendval == 1) ? 0xbe : 1; - } - - return BurnRandom(); -} - -static INT32 MarvlandInit() -{ - return Namcos2Init(marvland_key_write, marvland_key_read); -} - -struct BurnDriver BurnDrvMarvland = { - "marvland", NULL, NULL, NULL, "1989", - "Marvel Land (US)\0", "Bad music - use the Japan version", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, marvlandRomInfo, marvlandRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - MarvlandInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Marvel Land (Japan) - -static struct BurnRomInfo marvlandjRomDesc[] = { - { "mv1-mpr0.bin", 0x10000, 0x8369120f, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "mv1-mpr1.bin", 0x10000, 0x6d5442cc, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "mv1-spr0.bin", 0x10000, 0xc3909925, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "mv1-spr1.bin", 0x10000, 0x1c5599f5, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "mv1-snd0.bin", 0x20000, 0x51b8ccd7, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "mv1-obj0.bin", 0x40000, 0x73a29361, 0x05 | BRF_GRA }, // 7 Sprites - { "mv1-obj1.bin", 0x40000, 0xabbe4a99, 0x05 | BRF_GRA }, // 8 - { "mv1-obj2.bin", 0x40000, 0x753659e0, 0x05 | BRF_GRA }, // 9 - { "mv1-obj3.bin", 0x40000, 0xd1ce7339, 0x05 | BRF_GRA }, // 10 - - { "mv1-chr0.bin", 0x40000, 0x1c7e8b4f, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "mv1-chr1.bin", 0x40000, 0x01e4cafd, 0x06 | BRF_GRA }, // 12 - { "mv1-chr2.bin", 0x40000, 0x198fcc6f, 0x06 | BRF_GRA }, // 13 - { "mv1-chr3.bin", 0x40000, 0xed6f22a5, 0x06 | BRF_GRA }, // 14 - - { "mv1-roz0.bin", 0x20000, 0x7381a5a9, 0x07 | BRF_GRA }, // 15 Roz Layer Tiles - { "mv1-roz1.bin", 0x20000, 0xe899482e, 0x07 | BRF_GRA }, // 16 - { "mv1-roz2.bin", 0x20000, 0xde141290, 0x07 | BRF_GRA }, // 17 - { "mv1-roz3.bin", 0x20000, 0xe310324d, 0x07 | BRF_GRA }, // 18 - { "mv1-roz4.bin", 0x20000, 0x48ddc5a9, 0x07 | BRF_GRA }, // 19 - - { "mv1-sha.bin", 0x40000, 0xa47db5d3, 0x08 | BRF_GRA }, // 20 Layer Tiles Mask Data - - { "mv1-dat0.bin", 0x20000, 0xe15f412e, 0x09 | BRF_PRG | BRF_ESS }, // 21 Shared 68K Data - { "mv1-dat1.bin", 0x20000, 0x73e1545a, 0x09 | BRF_PRG | BRF_ESS }, // 22 - - { "mv1-voi1.bin", 0x80000, 0xde5cac09, 0x0a | BRF_SND }, // 23 C140 Samples Samples -}; - -STD_ROM_PICK(marvlandj) -STD_ROM_FN(marvlandj) - -struct BurnDriver BurnDrvMarvlandj = { - "marvlandj", "marvland", NULL, NULL, "1989", - "Marvel Land (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_PLATFORM, 0, - NULL, marvlandjRomInfo, marvlandjRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - MarvlandInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Valkyrie No Densetsu (Japan) - -static struct BurnRomInfo valkyrieRomDesc[] = { - { "wd1mpr0.bin", 0x20000, 0x94111a2e, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "wd1mpr1.bin", 0x20000, 0x57b5051c, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "wd1spr0.bin", 0x10000, 0xb2398321, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "wd1spr1.bin", 0x10000, 0x38dba897, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "wd1snd0.bin", 0x20000, 0xd0fbf58b, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "wdobj0.bin", 0x40000, 0xe8089451, 0x05 | BRF_GRA }, // 7 Sprites - { "wdobj1.bin", 0x40000, 0x7ca65666, 0x05 | BRF_GRA }, // 8 - { "wdobj2.bin", 0x40000, 0x7c159407, 0x05 | BRF_GRA }, // 9 - { "wdobj3.bin", 0x40000, 0x649f8760, 0x05 | BRF_GRA }, // 10 - { "wdobj4.bin", 0x40000, 0x7ca39ae7, 0x05 | BRF_GRA }, // 11 - { "wdobj5.bin", 0x40000, 0x9ead2444, 0x05 | BRF_GRA }, // 12 - { "wdobj6.bin", 0x40000, 0x9fa2ea21, 0x05 | BRF_GRA }, // 13 - { "wdobj7.bin", 0x40000, 0x66e07a36, 0x05 | BRF_GRA }, // 14 - - { "wdchr0.bin", 0x20000, 0xdebb0116, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "wdchr1.bin", 0x20000, 0x8a1431e8, 0x06 | BRF_GRA }, // 16 - { "wdchr2.bin", 0x20000, 0x62f75f69, 0x06 | BRF_GRA }, // 17 - { "wdchr3.bin", 0x20000, 0xcc43bbe7, 0x06 | BRF_GRA }, // 18 - { "wdchr4.bin", 0x20000, 0x2f73d05e, 0x06 | BRF_GRA }, // 19 - { "wdchr5.bin", 0x20000, 0xb632b2ec, 0x06 | BRF_GRA }, // 20 - - { "wdroz0.bin", 0x20000, 0xf776bf66, 0x07 | BRF_GRA }, // 21 Roz Layer Tiles - { "wdroz1.bin", 0x20000, 0xc1a345c3, 0x07 | BRF_GRA }, // 22 - { "wdroz2.bin", 0x20000, 0x28ffb44a, 0x07 | BRF_GRA }, // 23 - { "wdroz3.bin", 0x20000, 0x7e77b46d, 0x07 | BRF_GRA }, // 24 - - { "wdshape.bin", 0x20000, 0x3b5e0249, 0x08 | BRF_GRA }, // 25 Layer Tiles Mask Data - - { "wd1dat0.bin", 0x20000, 0xea209f48, 0x09 | BRF_PRG | BRF_ESS }, // 26 Shared 68K Data - { "wd1dat1.bin", 0x20000, 0x04b48ada, 0x09 | BRF_PRG | BRF_ESS }, // 27 - - { "wd1voi1.bin", 0x40000, 0xf1ace193, 0x0a | BRF_SND }, // 28 C140 Samples Samples - { "wd1voi2.bin", 0x20000, 0xe95c5cf3, 0x0a | BRF_SND }, // 29 -}; - -STD_ROM_PICK(valkyrie) -STD_ROM_FN(valkyrie) - -static INT32 ValkyrieInit() -{ - INT32 rc = Namcos2Init(NULL, NULL); - - if (!rc) { - weird_vbl = 1; - - pDrvDrawBegin = DrvDrawBegin; // needs linedraw for some effects (end of boss fight / fall through floor) - pDrvDrawLine = DrvDrawLine; - } - - return rc; -} - -struct BurnDriver BurnDrvValkyrie = { - "valkyrie", NULL, NULL, NULL, "1989", - "Valkyrie No Densetsu (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, valkyrieRomInfo, valkyrieRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - ValkyrieInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Rolling Thunder 2 - -static struct BurnRomInfo rthun2RomDesc[] = { - { "mpr0.bin", 0x20000, 0xe09a3549, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "mpr1.bin", 0x20000, 0x09573bff, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "spr0.bin", 0x10000, 0x54c22ac5, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "spr1.bin", 0x10000, 0x060eb393, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "snd0.bin", 0x20000, 0x55b7562a, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - { "snd1.bin", 0x20000, 0x00445a4f, 0x03 | BRF_PRG | BRF_ESS }, // 5 - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 6 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 7 - - { "obj0.bin", 0x80000, 0xe5cb82c1, 0x05 | BRF_GRA }, // 8 Sprites - { "obj1.bin", 0x80000, 0x19ebe9fd, 0x05 | BRF_GRA }, // 9 - { "obj2.bin", 0x80000, 0x455c4a2f, 0x05 | BRF_GRA }, // 10 - { "obj3.bin", 0x80000, 0xfdcae8a9, 0x05 | BRF_GRA }, // 11 - - { "chr0.bin", 0x80000, 0x6f0e9a68, 0x06 | BRF_GRA }, // 12 Layer Tiles - { "chr1.bin", 0x80000, 0x15e44adc, 0x06 | BRF_GRA }, // 13 - - { "roz0.bin", 0x80000, 0x482d0554, 0x07 | BRF_GRA }, // 14 Roz Layer Tiles - - { "shape.bin", 0x80000, 0xcf58fbbe, 0x08 | BRF_GRA }, // 15 Layer Tiles Mask Data - - { "data0.bin", 0x20000, 0x0baf44ee, 0x09 | BRF_PRG | BRF_ESS }, // 16 Shared 68K Data - { "data1.bin", 0x20000, 0x58a8daac, 0x09 | BRF_PRG | BRF_ESS }, // 17 - { "data2.bin", 0x20000, 0x8e850a2a, 0x09 | BRF_PRG | BRF_ESS }, // 18 - - { "voi1.bin", 0x80000, 0xe42027cd, 0x0a | BRF_SND }, // 19 C140 Samples Samples - { "voi2.bin", 0x80000, 0x0c4c2b66, 0x0a | BRF_SND }, // 20 -}; -STD_ROM_PICK(rthun2) -STD_ROM_FN(rthun2) - - -static void rthun2_key_write(UINT8 offset, UINT16 data) -{ - if (data == 0x13ec && (offset == 4 || offset == 7)) { - key_sendval = 1; - } -} - -static UINT16 rthun2_key_read(UINT8 offset) -{ - if (key_sendval) { - if (offset == 4 || offset == 7) { - key_sendval = 0; - return 0x013f; - } - } - - if (offset == 2) return 0; - - return BurnRandom(); -} - -static INT32 Rthun2Init() -{ - weird_vbl = 2; - - return Namcos2Init(rthun2_key_write, rthun2_key_read); -} - -struct BurnDriver BurnDrvRthun2 = { - "rthun2", NULL, NULL, NULL, "1990", - "Rolling Thunder 2\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, rthun2RomInfo, rthun2RomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - Rthun2Init, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Rolling Thunder 2 (Japan) - -static struct BurnRomInfo rthun2jRomDesc[] = { - { "mpr0j.bin", 0x20000, 0x2563b9ee, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "mpr1j.bin", 0x20000, 0x14c4c564, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "spr0j.bin", 0x10000, 0xf8ef5150, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "spr1j.bin", 0x10000, 0x52ed3a48, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "snd0.bin", 0x20000, 0x55b7562a, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - { "snd1.bin", 0x20000, 0x00445a4f, 0x03 | BRF_PRG | BRF_ESS }, // 5 - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 6 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 7 - - { "obj0.bin", 0x80000, 0xe5cb82c1, 0x05 | BRF_GRA }, // 8 Sprites - { "obj1.bin", 0x80000, 0x19ebe9fd, 0x05 | BRF_GRA }, // 9 - { "obj2.bin", 0x80000, 0x455c4a2f, 0x05 | BRF_GRA }, // 10 - { "obj3.bin", 0x80000, 0xfdcae8a9, 0x05 | BRF_GRA }, // 11 - - { "chr0.bin", 0x80000, 0x6f0e9a68, 0x06 | BRF_GRA }, // 12 Layer Tiles - { "chr1.bin", 0x80000, 0x15e44adc, 0x06 | BRF_GRA }, // 13 - - { "roz0.bin", 0x80000, 0x482d0554, 0x07 | BRF_GRA }, // 14 Roz Layer Tiles - - { "shape.bin", 0x80000, 0xcf58fbbe, 0x08 | BRF_GRA }, // 15 Layer Tiles Mask Data - - { "data0.bin", 0x20000, 0x0baf44ee, 0x09 | BRF_PRG | BRF_ESS }, // 16 Shared 68K Data - { "data1.bin", 0x20000, 0x58a8daac, 0x09 | BRF_PRG | BRF_ESS }, // 17 - { "data2.bin", 0x20000, 0x8e850a2a, 0x09 | BRF_PRG | BRF_ESS }, // 18 - - { "voi1.bin", 0x80000, 0xe42027cd, 0x0a | BRF_SND }, // 19 C140 Samples Samples - { "voi2.bin", 0x80000, 0x0c4c2b66, 0x0a | BRF_SND }, // 20 -}; - -STD_ROM_PICK(rthun2j) -STD_ROM_FN(rthun2j) - -struct BurnDriver BurnDrvRthun2j = { - "rthun2j", "rthun2", NULL, NULL, "1990", - "Rolling Thunder 2 (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, rthun2jRomInfo, rthun2jRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - Rthun2Init, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Dragon Saber (World, DO2) - -static struct BurnRomInfo dsaberRomDesc[] = { - { "do2 mpr0.mpr0", 0x20000, 0xa4c9ff34, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "do2 mpr1.mpr1", 0x20000, 0x2a89e794, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "do1 spr0.spr0", 0x10000, 0x013faf80, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "do1 spr1.spr1", 0x10000, 0xc36242bb, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "do1 snd0.snd0", 0x20000, 0xaf5b1ff8, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - { "do1 snd1.snd1", 0x20000, 0xc4ca6f3f, 0x03 | BRF_PRG | BRF_ESS }, // 5 - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 6 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 7 - - { "do obj-0a.obj0", 0x80000, 0xf08c6648, 0x05 | BRF_GRA }, // 8 Sprites - { "do obj-1a.obj1", 0x80000, 0x34e0810d, 0x05 | BRF_GRA }, // 9 - { "do obj-2a.obj2", 0x80000, 0xbccdabf3, 0x05 | BRF_GRA }, // 10 - { "do obj-3a.obj3", 0x80000, 0x2a60a4b8, 0x05 | BRF_GRA }, // 11 - - { "do chr-0a.chr0", 0x80000, 0xc6058df6, 0x06 | BRF_GRA }, // 12 Layer Tiles - { "do chr-1a.chr1", 0x80000, 0x67aaab36, 0x06 | BRF_GRA }, // 13 - - { "roz0.bin", 0x80000, 0x32aab758, 0x07 | BRF_GRA }, // 14 Roz Layer Tiles - - { "shape.bin", 0x80000, 0x698e7a3e, 0x08 | BRF_GRA }, // 15 Layer Tiles Mask Data - - { "do1 dat0.data0", 0x20000, 0x3e53331f, 0x09 | BRF_PRG | BRF_ESS }, // 16 Shared 68K Data - { "do1 dat1.data1", 0x20000, 0xd5427f11, 0x09 | BRF_PRG | BRF_ESS }, // 17 - - { "do voi-1a.voice1", 0x80000, 0xdadf6a57, 0x0a | BRF_SND }, // 18 C140 Samples Samples - { "do voi-2a.voice2", 0x80000, 0x81078e01, 0x0a | BRF_SND }, // 19 - - { "pal16l8a.4g", 0x00104, 0x660e1655, 0x00 | BRF_OPT }, // 20 plds - { "pal16l8a.5f", 0x00104, 0x18f43c22, 0x00 | BRF_OPT }, // 21 - { "pal12l10.8d", 0x00040, 0xe2379249, 0x00 | BRF_OPT }, // 22 -}; - -STD_ROM_PICK(dsaber) -STD_ROM_FN(dsaber) - -static UINT16 dsaber_key_read(UINT8 offset) -{ - if (offset == 2) return 0x00c0; - - return BurnRandom(); -} - -static INT32 DsaberInit() -{ - weird_vbl = 1; - - return Namcos2Init(NULL, dsaber_key_read); -} - -struct BurnDriver BurnDrvDsaber = { - "dsaber", NULL, NULL, NULL, "1990", - "Dragon Saber (World, DO2)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, dsaberRomInfo, dsaberRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - DsaberInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Dragon Saber (World, older?) - -static struct BurnRomInfo dsaberaRomDesc[] = { - { "mpr0.bin", 0x20000, 0x45309ddc, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "mpr1.bin", 0x20000, 0xcbfc4cba, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "do1 spr0.spr0", 0x10000, 0x013faf80, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "do1 spr1.spr1", 0x10000, 0xc36242bb, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "do1 snd0.snd0", 0x20000, 0xaf5b1ff8, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - { "do1 snd1.snd1", 0x20000, 0xc4ca6f3f, 0x03 | BRF_PRG | BRF_ESS }, // 5 - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 6 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 7 - - { "do obj-0a.obj0", 0x80000, 0xf08c6648, 0x05 | BRF_GRA }, // 8 Sprites - { "do obj-1a.obj1", 0x80000, 0x34e0810d, 0x05 | BRF_GRA }, // 9 - { "do obj-2a.obj2", 0x80000, 0xbccdabf3, 0x05 | BRF_GRA }, // 10 - { "do obj-3a.obj3", 0x80000, 0x2a60a4b8, 0x05 | BRF_GRA }, // 11 - - { "do chr-0a.chr0", 0x80000, 0xc6058df6, 0x06 | BRF_GRA }, // 12 Layer Tiles - { "do chr-1a.chr1", 0x80000, 0x67aaab36, 0x06 | BRF_GRA }, // 13 - - { "roz0.bin", 0x80000, 0x32aab758, 0x07 | BRF_GRA }, // 14 Roz Layer Tiles - - { "shape.bin", 0x80000, 0x698e7a3e, 0x08 | BRF_GRA }, // 15 Layer Tiles Mask Data - - { "do1 dat0.data0", 0x20000, 0x3e53331f, 0x09 | BRF_PRG | BRF_ESS }, // 16 Shared 68K Data - { "do1 dat1.data1", 0x20000, 0xd5427f11, 0x09 | BRF_PRG | BRF_ESS }, // 17 - - { "do voi-1a.voice1", 0x80000, 0xdadf6a57, 0x0a | BRF_SND }, // 18 C140 Samples Samples - { "do voi-2a.voice2", 0x80000, 0x81078e01, 0x0a | BRF_SND }, // 19 - - { "pal16l8a.4g", 0x00104, 0x660e1655, 0x00 | BRF_OPT }, // 20 plds - { "pal16l8a.5f", 0x00104, 0x18f43c22, 0x00 | BRF_OPT }, // 21 - { "pal12l10.8d", 0x00040, 0xe2379249, 0x00 | BRF_OPT }, // 22 -}; - -STD_ROM_PICK(dsabera) -STD_ROM_FN(dsabera) - -struct BurnDriver BurnDrvDsabera = { - "dsabera", "dsaber", NULL, NULL, "1990", - "Dragon Saber (World, older?)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, dsaberaRomInfo, dsaberaRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - DsaberInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Dragon Saber (Japan, Rev B) - -static struct BurnRomInfo dsaberjRomDesc[] = { - { "do1 mpr0b.mor0", 0x20000, 0x2898e791, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "do1 mpr1b.mpr1", 0x20000, 0x5fa9778e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "do1 spr0.spr0", 0x10000, 0x013faf80, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "do1 spr1.spr1", 0x10000, 0xc36242bb, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "do1 snd0.snd0", 0x20000, 0xaf5b1ff8, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - { "do1 snd1.snd1", 0x20000, 0xc4ca6f3f, 0x03 | BRF_PRG | BRF_ESS }, // 5 - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 6 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 7 - - { "do obj-0a.obj0", 0x80000, 0xf08c6648, 0x05 | BRF_GRA }, // 8 Sprites - { "do obj-1a.obj1", 0x80000, 0x34e0810d, 0x05 | BRF_GRA }, // 9 - { "do obj-2a.obj2", 0x80000, 0xbccdabf3, 0x05 | BRF_GRA }, // 10 - { "do obj-3a.obj3", 0x80000, 0x2a60a4b8, 0x05 | BRF_GRA }, // 11 - - { "do chr-0a.chr0", 0x80000, 0xc6058df6, 0x06 | BRF_GRA }, // 12 Layer Tiles - { "do chr-1a.chr1", 0x80000, 0x67aaab36, 0x06 | BRF_GRA }, // 13 - - { "roz0.bin", 0x80000, 0x32aab758, 0x07 | BRF_GRA }, // 14 Roz Layer Tiles - - { "shape.bin", 0x80000, 0x698e7a3e, 0x08 | BRF_GRA }, // 15 Layer Tiles Mask Data - - { "do1 dat0.data0", 0x20000, 0x3e53331f, 0x09 | BRF_PRG | BRF_ESS }, // 16 Shared 68K Data - { "do1 dat1.data1", 0x20000, 0xd5427f11, 0x09 | BRF_PRG | BRF_ESS }, // 17 - - { "do voi-1a.voice1", 0x80000, 0xdadf6a57, 0x0a | BRF_SND }, // 18 C140 Samples Samples - { "do voi-2a.voice2", 0x80000, 0x81078e01, 0x0a | BRF_SND }, // 19 - - { "pal16l8a.4g", 0x00104, 0x660e1655, 0x00 | BRF_OPT }, // 20 plds - { "pal16l8a.5f", 0x00104, 0x18f43c22, 0x00 | BRF_OPT }, // 21 - { "pal12l10.8d", 0x00040, 0xe2379249, 0x00 | BRF_OPT }, // 22 -}; - -STD_ROM_PICK(dsaberj) -STD_ROM_FN(dsaberj) - -struct BurnDriver BurnDrvDsaberj = { - "dsaberj", "dsaber", NULL, NULL, "1990", - "Dragon Saber (Japan, Rev B)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, dsaberjRomInfo, dsaberjRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - DsaberInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Burning Force (Japan, new version (Rev C)) - -static struct BurnRomInfo burnforcRomDesc[] = { - { "bu1_mpr0c.bin", 0x20000, 0xcc5864c6, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "bu1_mpr1c.bin", 0x20000, 0x3e6b4b1b, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "bu1_spr0.bin", 0x10000, 0x17022a21, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "bu1_spr1.bin", 0x10000, 0x5255f8a5, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "bu1_snd0.bin", 0x20000, 0xfabb1150, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "bu_obj-0.bin", 0x80000, 0x24c919a1, 0x05 | BRF_GRA }, // 7 Sprites - { "bu_obj-1.bin", 0x80000, 0x5bcb519b, 0x05 | BRF_GRA }, // 8 - { "bu_obj-2.bin", 0x80000, 0x509dd5d0, 0x05 | BRF_GRA }, // 9 - { "bu_obj-3.bin", 0x80000, 0x270a161e, 0x05 | BRF_GRA }, // 10 - - { "bu_chr-0.bin", 0x20000, 0xc2109f73, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "bu_chr-1.bin", 0x20000, 0x67d6aa67, 0x06 | BRF_GRA }, // 12 - { "bu_chr-2.bin", 0x20000, 0x52846eff, 0x06 | BRF_GRA }, // 13 - { "bu_chr-3.bin", 0x20000, 0xd1326d7f, 0x06 | BRF_GRA }, // 14 - { "bu_chr-4.bin", 0x20000, 0x81a66286, 0x06 | BRF_GRA }, // 15 - { "bu_chr-5.bin", 0x20000, 0x629aa67f, 0x06 | BRF_GRA }, // 16 - - { "bu_roz-0.bin", 0x20000, 0x65fefc83, 0x07 | BRF_GRA }, // 17 Roz Layer Tiles - { "bu_roz-1.bin", 0x20000, 0x979580c2, 0x07 | BRF_GRA }, // 18 - { "bu_roz-2.bin", 0x20000, 0x548b6ad8, 0x07 | BRF_GRA }, // 19 - { "bu_roz-3.bin", 0x20000, 0xa633cea0, 0x07 | BRF_GRA }, // 20 - { "bu_roz-4.bin", 0x20000, 0x1b1f56a6, 0x07 | BRF_GRA }, // 21 - { "bu_roz-5.bin", 0x20000, 0x4b864b0e, 0x07 | BRF_GRA }, // 22 - { "bu_roz-6.bin", 0x20000, 0x38bd25ba, 0x07 | BRF_GRA }, // 23 - - { "bu_shape.bin", 0x20000, 0x80a6b722, 0x08 | BRF_GRA }, // 24 Layer Tiles Mask Data - - { "bu1_dat0.bin", 0x20000, 0xe0a9d92f, 0x09 | BRF_PRG | BRF_ESS }, // 25 Shared 68K Data - { "bu1_dat1.bin", 0x20000, 0x5fe54b73, 0x09 | BRF_PRG | BRF_ESS }, // 26 - - { "bu_voi-1.bin", 0x80000, 0x99d8a239, 0x0a | BRF_SND }, // 27 C140 Samples Samples -}; - -STD_ROM_PICK(burnforc) -STD_ROM_FN(burnforc) - -static UINT16 burnforc_key_read(UINT8 offset) -{ - if (offset == 1) return 0xbd; - - return BurnRandom(); -} - -static INT32 BurnforcInit() -{ - INT32 rc = Namcos2Init(NULL, burnforc_key_read); - if (!rc) { - pDrvDrawBegin = DrvDrawBegin; - pDrvDrawLine = DrvDrawLine; - } - - return rc; -} - -struct BurnDriver BurnDrvBurnforc = { - "burnforc", NULL, NULL, NULL, "1989", - "Burning Force (Japan, new version (Rev C))\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, burnforcRomInfo, burnforcRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - BurnforcInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Burning Force (Japan, old version) - -static struct BurnRomInfo burnforcoRomDesc[] = { - { "bu1_mpr0.bin", 0x20000, 0x096b73e2, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "bu1_mpr1.bin", 0x20000, 0x7ead4cbf, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "bu1_spr0.bin", 0x10000, 0x17022a21, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "bu1_spr1.bin", 0x10000, 0x5255f8a5, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "bu1_snd0.bin", 0x20000, 0xfabb1150, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "bu_obj-0.bin", 0x80000, 0x24c919a1, 0x05 | BRF_GRA }, // 7 Sprites - { "bu_obj-1.bin", 0x80000, 0x5bcb519b, 0x05 | BRF_GRA }, // 8 - { "bu_obj-2.bin", 0x80000, 0x509dd5d0, 0x05 | BRF_GRA }, // 9 - { "bu_obj-3.bin", 0x80000, 0x270a161e, 0x05 | BRF_GRA }, // 10 - - { "bu_chr-0.bin", 0x20000, 0xc2109f73, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "bu_chr-1.bin", 0x20000, 0x67d6aa67, 0x06 | BRF_GRA }, // 12 - { "bu_chr-2.bin", 0x20000, 0x52846eff, 0x06 | BRF_GRA }, // 13 - { "bu_chr-3.bin", 0x20000, 0xd1326d7f, 0x06 | BRF_GRA }, // 14 - { "bu_chr-4.bin", 0x20000, 0x81a66286, 0x06 | BRF_GRA }, // 15 - { "bu_chr-5.bin", 0x20000, 0x629aa67f, 0x06 | BRF_GRA }, // 16 - - { "bu_roz-0.bin", 0x20000, 0x65fefc83, 0x07 | BRF_GRA }, // 17 Roz Layer Tiles - { "bu_roz-1.bin", 0x20000, 0x979580c2, 0x07 | BRF_GRA }, // 18 - { "bu_roz-2.bin", 0x20000, 0x548b6ad8, 0x07 | BRF_GRA }, // 19 - { "bu_roz-3.bin", 0x20000, 0xa633cea0, 0x07 | BRF_GRA }, // 20 - { "bu_roz-4.bin", 0x20000, 0x1b1f56a6, 0x07 | BRF_GRA }, // 21 - { "bu_roz-5.bin", 0x20000, 0x4b864b0e, 0x07 | BRF_GRA }, // 22 - { "bu_roz-6.bin", 0x20000, 0x38bd25ba, 0x07 | BRF_GRA }, // 23 - - { "bu_shape.bin", 0x20000, 0x80a6b722, 0x08 | BRF_GRA }, // 24 Layer Tiles Mask Data - - { "bu1_dat0.bin", 0x20000, 0xe0a9d92f, 0x09 | BRF_PRG | BRF_ESS }, // 25 Shared 68K Data - { "bu1_dat1.bin", 0x20000, 0x5fe54b73, 0x09 | BRF_PRG | BRF_ESS }, // 26 - - { "bu_voi-1.bin", 0x80000, 0x99d8a239, 0x0a | BRF_SND }, // 27 C140 Samples Samples -}; - -STD_ROM_PICK(burnforco) -STD_ROM_FN(burnforco) - -struct BurnDriver BurnDrvBurnforco = { - "burnforco", "burnforc", NULL, NULL, "1989", - "Burning Force (Japan, old version)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, burnforcoRomInfo, burnforcoRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - BurnforcInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - - -// Finest Hour (Japan) - -static struct BurnRomInfo finehourRomDesc[] = { - { "fh1_mp0.bin", 0x20000, 0x355d9119, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fh1_mp1.bin", 0x20000, 0x647eb621, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fh1_sp0.bin", 0x20000, 0xaa6289e9, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "fh1_sp1.bin", 0x20000, 0x8532d5c7, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "fh1_sd0.bin", 0x20000, 0x059a9cfd, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "fh1_ob0.bin", 0x80000, 0xb1fd86f1, 0x05 | BRF_GRA }, // 7 Sprites - { "fh1_ob1.bin", 0x80000, 0x519c44ce, 0x05 | BRF_GRA }, // 8 - { "fh1_ob2.bin", 0x80000, 0x9c5de4fa, 0x05 | BRF_GRA }, // 9 - { "fh1_ob3.bin", 0x80000, 0x54d4edce, 0x05 | BRF_GRA }, // 10 - - { "fh1_ch0.bin", 0x40000, 0x516900d1, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "fh1_ch1.bin", 0x40000, 0x964d06bd, 0x06 | BRF_GRA }, // 12 - { "fh1_ch2.bin", 0x40000, 0xfbb9449e, 0x06 | BRF_GRA }, // 13 - { "fh1_ch3.bin", 0x40000, 0xc18eda8a, 0x06 | BRF_GRA }, // 14 - { "fh1_ch4.bin", 0x40000, 0x80dd188a, 0x06 | BRF_GRA }, // 15 - { "fh1_ch5.bin", 0x40000, 0x40969876, 0x06 | BRF_GRA }, // 16 - - { "fh1_rz0.bin", 0x20000, 0x6c96c5c1, 0x07 | BRF_GRA }, // 17 Roz Layer Tiles - { "fh1_rz1.bin", 0x20000, 0x44699eb9, 0x07 | BRF_GRA }, // 18 - { "fh1_rz2.bin", 0x20000, 0x5ec14abf, 0x07 | BRF_GRA }, // 19 - { "fh1_rz3.bin", 0x20000, 0x9f5a91b2, 0x07 | BRF_GRA }, // 20 - { "fh1_rz4.bin", 0x20000, 0x0b4379e6, 0x07 | BRF_GRA }, // 21 - { "fh1_rz5.bin", 0x20000, 0xe034e560, 0x07 | BRF_GRA }, // 22 - - { "fh1_sha.bin", 0x40000, 0x15875eb0, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "fh1_dt0.bin", 0x20000, 0x2441c26f, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "fh1_dt1.bin", 0x20000, 0x48154deb, 0x09 | BRF_PRG | BRF_ESS }, // 25 - { "fh1_dt2.bin", 0x20000, 0x12453ba4, 0x09 | BRF_PRG | BRF_ESS }, // 26 - { "fh1_dt3.bin", 0x20000, 0x50bab9da, 0x09 | BRF_PRG | BRF_ESS }, // 27 - - { "fh1_vo1.bin", 0x80000, 0x07560fc7, 0x0a | BRF_SND }, // 28 C140 Samples Samples -}; - -STD_ROM_PICK(finehour) -STD_ROM_FN(finehour) - -static UINT16 finehour_key_read(UINT8 offset) -{ - if (offset == 7) return 0xbc; - - return BurnRandom(); -} - -static INT32 FinehourInit() -{ - INT32 rc = Namcos2Init(NULL, finehour_key_read); - - weird_vbl = 0; - - if (!rc) { - pDrvDrawBegin = DrvDrawBegin; - pDrvDrawLine = DrvDrawLine; - } - - return rc; -} - -struct BurnDriver BurnDrvFinehour = { - "finehour", NULL, NULL, NULL, "1989", - "Finest Hour (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_SCRFIGHT, 0, - NULL, finehourRomInfo, finehourRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - FinehourInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Super World Stadium (Japan) - -static struct BurnRomInfo swsRomDesc[] = { - { "ss1_mpr0.11d", 0x20000, 0xd12bd020, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "ss1_mpr1.13d", 0x20000, 0xe9ae14ce, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "sst1spr0.bin", 0x20000, 0x9777ee2f, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "sst1spr1.bin", 0x20000, 0x27a35c69, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "sst1snd0.bin", 0x20000, 0x8fc45114, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c68.3f", 0x08000, 0xca64550a, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "ss1_obj0.5b", 0x80000, 0x9bd6add1, 0x05 | BRF_GRA }, // 7 Sprites - { "ss1_obj1.4b", 0x80000, 0xa9db3d02, 0x05 | BRF_GRA }, // 8 - { "ss1_obj2.5d", 0x80000, 0xb4a73ced, 0x05 | BRF_GRA }, // 9 - { "ss1_obj3.4d", 0x80000, 0x0a832b36, 0x05 | BRF_GRA }, // 10 - - { "ss1_chr0.11n", 0x80000, 0xab0141de, 0x06 | BRF_GRA }, // 11 Layer Tiles - - { "ss_roz0.bin", 0x80000, 0x40ce9a58, 0x07 | BRF_GRA }, // 12 Roz Layer Tiles - { "ss_roz1.bin", 0x80000, 0xc98902ff, 0x07 | BRF_GRA }, // 13 - { "ss1_roz2.1c", 0x80000, 0xb603e1a1, 0x07 | BRF_GRA }, // 14 - - { "ss1_sha0.7n", 0x80000, 0xfea6952c, 0x08 | BRF_GRA }, // 15 Layer Tiles Mask Data - - { "ss1_dat0.13s", 0x40000, 0x6a360f91, 0x09 | BRF_PRG | BRF_ESS }, // 16 Shared 68K Data - { "ss1_dat1.13p", 0x40000, 0xab1e487d, 0x09 | BRF_PRG | BRF_ESS }, // 17 - - { "ss_voi1.bin", 0x80000, 0x503e51b7, 0x0a | BRF_SND }, // 18 C140 Samples Samples -}; - -STD_ROM_PICK(sws) -STD_ROM_FN(sws) - -static UINT16 sws_key_read(UINT8 offset) -{ - if (offset == 4) return 0x0142; - - return BurnRandom(); -} - -static INT32 SwsInit() -{ - return Namcos2Init(NULL, sws_key_read); -} - -struct BurnDriver BurnDrvSws = { - "sws", NULL, NULL, NULL, "1992", - "Super World Stadium (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, swsRomInfo, swsRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - SwsInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Super World Stadium '92 (Japan) - -static struct BurnRomInfo sws92RomDesc[] = { - { "sss1mpr0.bin", 0x20000, 0xdbea0210, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "sss1mpr1.bin", 0x20000, 0xb5e6469a, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "sst1spr0.bin", 0x20000, 0x9777ee2f, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "sst1spr1.bin", 0x20000, 0x27a35c69, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "sst1snd0.bin", 0x20000, 0x8fc45114, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c68.3f", 0x08000, 0xca64550a, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "sss_obj0.bin", 0x80000, 0x375e8f1f, 0x05 | BRF_GRA }, // 7 Sprites - { "sss_obj1.bin", 0x80000, 0x675c1014, 0x05 | BRF_GRA }, // 8 - { "sss_obj2.bin", 0x80000, 0xbdc55f1c, 0x05 | BRF_GRA }, // 9 - { "sss_obj3.bin", 0x80000, 0xe32ac432, 0x05 | BRF_GRA }, // 10 - - { "sss_chr0.bin", 0x80000, 0x1d2876f2, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "sss_chr6.bin", 0x80000, 0x354f0ed2, 0x06 | BRF_GRA }, // 12 - { "sss_chr7.bin", 0x80000, 0x4032f4c1, 0x06 | BRF_GRA }, // 13 - - { "ss_roz0.bin", 0x80000, 0x40ce9a58, 0x07 | BRF_GRA }, // 14 Roz Layer Tiles - { "ss_roz1.bin", 0x80000, 0xc98902ff, 0x07 | BRF_GRA }, // 15 - { "sss_roz2.bin", 0x80000, 0xc9855c10, 0x07 | BRF_GRA }, // 16 - - { "sss_sha0.bin", 0x80000, 0xb71a731a, 0x08 | BRF_GRA }, // 17 Layer Tiles Mask Data - - { "sss1dat0.bin", 0x40000, 0xdb3e6aec, 0x09 | BRF_PRG | BRF_ESS }, // 18 Shared 68K Data - { "sss1dat1.bin", 0x40000, 0x463b5ba8, 0x09 | BRF_PRG | BRF_ESS }, // 19 - - { "ss_voi1.bin", 0x80000, 0x503e51b7, 0x0a | BRF_SND }, // 20 C140 Samples Samples -}; - -STD_ROM_PICK(sws92) -STD_ROM_FN(sws92) - -static UINT16 sws92_key_read(UINT8 offset) -{ - if (offset == 3) return 0x014b; - - return BurnRandom(); -} - -static INT32 Sws92Init() -{ - return Namcos2Init(NULL, sws92_key_read); -} - -struct BurnDriver BurnDrvSws92 = { - "sws92", NULL, NULL, NULL, "1992", - "Super World Stadium '92 (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, sws92RomInfo, sws92RomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - Sws92Init, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Super World Stadium '92 Gekitouban (Japan) - -static struct BurnRomInfo sws92gRomDesc[] = { - { "ssg1mpr0.bin", 0x20000, 0x5596c535, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "ssg1mpr1.bin", 0x20000, 0x3289ef0c, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "sst1spr0.bin", 0x20000, 0x9777ee2f, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "sst1spr1.bin", 0x20000, 0x27a35c69, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "sst1snd0.bin", 0x20000, 0x8fc45114, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c68.3f", 0x08000, 0xca64550a, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "sss_obj0.bin", 0x80000, 0x375e8f1f, 0x05 | BRF_GRA }, // 7 Sprites - { "sss_obj1.bin", 0x80000, 0x675c1014, 0x05 | BRF_GRA }, // 8 - { "sss_obj2.bin", 0x80000, 0xbdc55f1c, 0x05 | BRF_GRA }, // 9 - { "sss_obj3.bin", 0x80000, 0xe32ac432, 0x05 | BRF_GRA }, // 10 - - { "sss_chr0.bin", 0x80000, 0x1d2876f2, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "sss_chr6.bin", 0x80000, 0x354f0ed2, 0x06 | BRF_GRA }, // 12 - { "sss_chr7.bin", 0x80000, 0x4032f4c1, 0x06 | BRF_GRA }, // 13 - - { "ss_roz0.bin", 0x80000, 0x40ce9a58, 0x07 | BRF_GRA }, // 14 Roz Layer Tiles - { "ss_roz1.bin", 0x80000, 0xc98902ff, 0x07 | BRF_GRA }, // 15 - { "sss_roz2.bin", 0x80000, 0xc9855c10, 0x07 | BRF_GRA }, // 16 - - { "sss_sha0.bin", 0x80000, 0xb71a731a, 0x08 | BRF_GRA }, // 17 Layer Tiles Mask Data - - { "sss1dat0.bin", 0x40000, 0xdb3e6aec, 0x09 | BRF_PRG | BRF_ESS }, // 18 Shared 68K Data - { "sss1dat1.bin", 0x40000, 0x463b5ba8, 0x09 | BRF_PRG | BRF_ESS }, // 19 - { "ssg1dat2.bin", 0x40000, 0x754128aa, 0x09 | BRF_PRG | BRF_ESS }, // 20 - { "ssg1dat3.bin", 0x40000, 0xcb3fed01, 0x09 | BRF_PRG | BRF_ESS }, // 21 - - { "ss_voi1.bin", 0x80000, 0x503e51b7, 0x0a | BRF_SND }, // 22 C140 Samples Samples -}; - -STD_ROM_PICK(sws92g) -STD_ROM_FN(sws92g) - -static UINT16 sws92g_key_read(UINT8 offset) -{ - if (offset == 3) return 0x014c; - - return BurnRandom(); -} - -static INT32 Sws92gInit() -{ - return Namcos2Init(NULL, sws92g_key_read); -} - -struct BurnDriver BurnDrvSws92g = { - "sws92g", "sws92", NULL, NULL, "1992", - "Super World Stadium '92 Gekitouban (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, sws92gRomInfo, sws92gRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - Sws92gInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Super World Stadium '93 (Japan) - -static struct BurnRomInfo sws93RomDesc[] = { - { "sst1mpr0.bin", 0x20000, 0xbd2679bc, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "sst1mpr1.bin", 0x20000, 0x9132e220, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "sst1spr0.bin", 0x20000, 0x9777ee2f, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "sst1spr1.bin", 0x20000, 0x27a35c69, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "sst1snd0.bin", 0x20000, 0x8fc45114, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "sst_obj0.bin", 0x80000, 0x4089dfd7, 0x05 | BRF_GRA }, // 7 Sprites - { "sst_obj1.bin", 0x80000, 0xcfbc25c7, 0x05 | BRF_GRA }, // 8 - { "sst_obj2.bin", 0x80000, 0x61ed3558, 0x05 | BRF_GRA }, // 9 - { "sst_obj3.bin", 0x80000, 0x0e3bc05d, 0x05 | BRF_GRA }, // 10 - - { "sst_chr0.bin", 0x80000, 0x3397850d, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "sss_chr6.bin", 0x80000, 0x354f0ed2, 0x06 | BRF_GRA }, // 12 - { "sst_chr7.bin", 0x80000, 0xe0abb763, 0x06 | BRF_GRA }, // 13 - - { "ss_roz0.bin", 0x80000, 0x40ce9a58, 0x07 | BRF_GRA }, // 14 Roz Layer Tiles - { "ss_roz1.bin", 0x80000, 0xc98902ff, 0x07 | BRF_GRA }, // 15 - { "sss_roz2.bin", 0x80000, 0xc9855c10, 0x07 | BRF_GRA }, // 16 - - { "sst_sha0.bin", 0x80000, 0x4f64d4bd, 0x08 | BRF_GRA }, // 17 Layer Tiles Mask Data - - { "sst1dat0.bin", 0x80000, 0xb99c9656, 0x09 | BRF_PRG | BRF_ESS }, // 18 Shared 68K Data - { "sst1dat1.bin", 0x80000, 0x60cf6281, 0x09 | BRF_PRG | BRF_ESS }, // 19 - - { "ss_voi1.bin", 0x80000, 0x503e51b7, 0x0a | BRF_SND }, // 20 C140 Samples Samples -}; - -STD_ROM_PICK(sws93) -STD_ROM_FN(sws93) - -static UINT16 sws93_key_read(UINT8 offset) -{ - if (offset == 3) return 0x014e; - - return BurnRandom(); -} - -static INT32 Sws93Init() -{ - return Namcos2Init(NULL, sws93_key_read); -} - -struct BurnDriver BurnDrvSws93 = { - "sws93", NULL, NULL, NULL, "1993", - "Super World Stadium '93 (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, sws93RomInfo, sws93RomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - Sws93Init, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Kyuukai Douchuuki (Japan, new version (Rev B)) - -static struct BurnRomInfo kyukaidkRomDesc[] = { - { "ky1_mp0b.bin", 0x10000, 0xd1c992c8, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "ky1_mp1b.bin", 0x10000, 0x723553af, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ky1_sp0.bin", 0x10000, 0x4b4d2385, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "ky1_sp1.bin", 0x10000, 0xbd3368cd, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "ky1_s0.bin", 0x20000, 0x27aea3e9, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "ky1_o0.bin", 0x80000, 0xebec5132, 0x05 | BRF_GRA }, // 7 Sprites - { "ky1_o1.bin", 0x80000, 0xfde7e5ae, 0x05 | BRF_GRA }, // 8 - { "ky1_o2.bin", 0x80000, 0x2a181698, 0x05 | BRF_GRA }, // 9 - { "ky1_o3.bin", 0x80000, 0x71fcd3a6, 0x05 | BRF_GRA }, // 10 - - { "ky1_c0.bin", 0x20000, 0x7bd69a2d, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "ky1_c1.bin", 0x20000, 0x66a623fe, 0x06 | BRF_GRA }, // 12 - { "ky1_c2.bin", 0x20000, 0xe84b3dfd, 0x06 | BRF_GRA }, // 13 - { "ky1_c3.bin", 0x20000, 0x69e67c86, 0x06 | BRF_GRA }, // 14 - - { "ky1_r0.bin", 0x40000, 0x9213e8c4, 0x07 | BRF_GRA }, // 15 Roz Layer Tiles - { "ky1_r1.bin", 0x40000, 0x97d1a641, 0x07 | BRF_GRA }, // 16 - { "ky1_r2.bin", 0x40000, 0x39b58792, 0x07 | BRF_GRA }, // 17 - { "ky1_r3.bin", 0x40000, 0x90c60d92, 0x07 | BRF_GRA }, // 18 - - { "ky1_sha.bin", 0x20000, 0x380a20d7, 0x08 | BRF_GRA }, // 19 Layer Tiles Mask Data - - { "ky1_d0.bin", 0x20000, 0xc9cf399d, 0x09 | BRF_PRG | BRF_ESS }, // 20 Shared 68K Data - { "ky1_d1.bin", 0x20000, 0x6d4f21b9, 0x09 | BRF_PRG | BRF_ESS }, // 21 - { "ky1_d2.bin", 0x20000, 0xeb6d19c8, 0x09 | BRF_PRG | BRF_ESS }, // 22 - { "ky1_d3.bin", 0x20000, 0x95674701, 0x09 | BRF_PRG | BRF_ESS }, // 23 - - { "ky1_v1.bin", 0x80000, 0x5ff81aec, 0x0a | BRF_SND }, // 24 C140 Samples Samples -}; - -STD_ROM_PICK(kyukaidk) -STD_ROM_FN(kyukaidk) - -static INT32 KyukaidkInit() -{ - return Namcos2Init(NULL, NULL); -} - -struct BurnDriver BurnDrvKyukaidk = { - "kyukaidk", NULL, NULL, NULL, "1990", - "Kyuukai Douchuuki (Japan, new version (Rev B))\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, kyukaidkRomInfo, kyukaidkRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - KyukaidkInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Kyuukai Douchuuki (Japan, old version) - -static struct BurnRomInfo kyukaidkoRomDesc[] = { - { "ky1_mp0.bin", 0x10000, 0x01978a19, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "ky1_mp1.bin", 0x10000, 0xb40717a7, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ky1_sp0.bin", 0x10000, 0x4b4d2385, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "ky1_sp1.bin", 0x10000, 0xbd3368cd, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "ky1_s0.bin", 0x20000, 0x27aea3e9, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "ky1_o0.bin", 0x80000, 0xebec5132, 0x05 | BRF_GRA }, // 7 Sprites - { "ky1_o1.bin", 0x80000, 0xfde7e5ae, 0x05 | BRF_GRA }, // 8 - { "ky1_o2.bin", 0x80000, 0x2a181698, 0x05 | BRF_GRA }, // 9 - { "ky1_o3.bin", 0x80000, 0x71fcd3a6, 0x05 | BRF_GRA }, // 10 - - { "ky1_c0.bin", 0x20000, 0x7bd69a2d, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "ky1_c1.bin", 0x20000, 0x66a623fe, 0x06 | BRF_GRA }, // 12 - { "ky1_c2.bin", 0x20000, 0xe84b3dfd, 0x06 | BRF_GRA }, // 13 - { "ky1_c3.bin", 0x20000, 0x69e67c86, 0x06 | BRF_GRA }, // 14 - - { "ky1_r0.bin", 0x40000, 0x9213e8c4, 0x07 | BRF_GRA }, // 15 Roz Layer Tiles - { "ky1_r1.bin", 0x40000, 0x97d1a641, 0x07 | BRF_GRA }, // 16 - { "ky1_r2.bin", 0x40000, 0x39b58792, 0x07 | BRF_GRA }, // 17 - { "ky1_r3.bin", 0x40000, 0x90c60d92, 0x07 | BRF_GRA }, // 18 - - { "ky1_sha.bin", 0x20000, 0x380a20d7, 0x08 | BRF_GRA }, // 19 Layer Tiles Mask Data - - { "ky1_d0.bin", 0x20000, 0xc9cf399d, 0x09 | BRF_PRG | BRF_ESS }, // 20 Shared 68K Data - { "ky1_d1.bin", 0x20000, 0x6d4f21b9, 0x09 | BRF_PRG | BRF_ESS }, // 21 - { "ky1_d2.bin", 0x20000, 0xeb6d19c8, 0x09 | BRF_PRG | BRF_ESS }, // 22 - { "ky1_d3.bin", 0x20000, 0x95674701, 0x09 | BRF_PRG | BRF_ESS }, // 23 - - { "ky1_v1.bin", 0x80000, 0x5ff81aec, 0x0a | BRF_SND }, // 24 C140 Samples Samples -}; - -STD_ROM_PICK(kyukaidko) -STD_ROM_FN(kyukaidko) - -struct BurnDriver BurnDrvKyukaidko = { - "kyukaidko", "kyukaidk", NULL, NULL, "1990", - "Kyuukai Douchuuki (Japan, old version)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, kyukaidkoRomInfo, kyukaidkoRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, - KyukaidkInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Steel Gunner (Rev B) - -static struct BurnRomInfo sgunnerRomDesc[] = { - { "sn2mpr0b.11d", 0x20000, 0x4bb33394, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "sn2mpr1b.13d", 0x20000, 0xd8b47334, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "sn1spr0.11k", 0x10000, 0x4638b512, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "sn1spr1.13k", 0x10000, 0xe8b1ee73, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "sn1_snd0.8j", 0x20000, 0xbdf36d44, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c68.3f", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "sn_obj0.8c", 0x80000, 0xbbae38f7, 0x05 | BRF_GRA }, // 7 Sprites - { "sn_obj4.9c", 0x80000, 0x82fdaa06, 0x05 | BRF_GRA }, // 8 - { "sn_obj1.12c", 0x80000, 0x4dfacb51, 0x05 | BRF_GRA }, // 9 - { "sn_obj5.13c", 0x80000, 0x8700a8a4, 0x05 | BRF_GRA }, // 10 - { "sn_obj2.10c", 0x80000, 0x313a308f, 0x05 | BRF_GRA }, // 11 - { "sn_obj6.11c", 0x80000, 0x9c6504f7, 0x05 | BRF_GRA }, // 12 - { "sn_obj3.14c", 0x80000, 0xd7c340f6, 0x05 | BRF_GRA }, // 13 - { "sn_obj7.15c", 0x80000, 0xcd1356c0, 0x05 | BRF_GRA }, // 14 - - { "sn_chr0.11n", 0x80000, 0xb433c37b, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "sn_chr1.11p", 0x80000, 0xb7dd41f9, 0x06 | BRF_GRA }, // 16 - - { "sn_sha0.8n", 0x80000, 0x01e20999, 0x08 | BRF_GRA }, // 17 Layer Tiles Mask Data - - { "sn1_dat0.13s", 0x20000, 0x72bfeca8, 0x09 | BRF_PRG | BRF_ESS }, // 18 Shared 68K Data - { "sn1_dat1.13p", 0x20000, 0x99b3e653, 0x09 | BRF_PRG | BRF_ESS }, // 19 - - { "sn_voi1.3m", 0x80000, 0x464e616d, 0x0a | BRF_SND }, // 20 C140 Samples Samples - { "sn_voi2.3l", 0x80000, 0x8c3251b5, 0x0a | BRF_SND }, // 21 - - { "sgunner.nv", 0x02000, 0x106026f8, 0x0b | BRF_PRG | BRF_ESS }, // 22 Default NV RAM -}; - -STD_ROM_PICK(sgunner) -STD_ROM_FN(sgunner) - -static INT32 SgunnerInit() -{ - return SgunnerCommonInit(NULL, NULL); -} - -struct BurnDriver BurnDrvSgunner = { - "sgunner", NULL, NULL, NULL, "1990", - "Steel Gunner (Rev B)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, sgunnerRomInfo, sgunnerRomName, NULL, NULL, SgunnerInputInfo, SgunnerDIPInfo, - SgunnerInit, Namcos2Exit, DrvFrame, SgunnerDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Steel Gunner (Japan) - -static struct BurnRomInfo sgunnerjRomDesc[] = { - { "sn1mpr0.11d", 0x20000, 0xf60116d7, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "sn1mpr1.13d", 0x20000, 0x23942fc9, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "sn1spr0.11k", 0x10000, 0x4638b512, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "sn1spr1.13k", 0x10000, 0xe8b1ee73, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "sn1_snd0.8j", 0x20000, 0xbdf36d44, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c68.3f", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "sn_obj0.8c", 0x80000, 0xbbae38f7, 0x05 | BRF_GRA }, // 7 Sprites - { "sn_obj4.9c", 0x80000, 0x82fdaa06, 0x05 | BRF_GRA }, // 8 - { "sn_obj1.12c", 0x80000, 0x4dfacb51, 0x05 | BRF_GRA }, // 9 - { "sn_obj5.13c", 0x80000, 0x8700a8a4, 0x05 | BRF_GRA }, // 10 - { "sn_obj2.10c", 0x80000, 0x313a308f, 0x05 | BRF_GRA }, // 11 - { "sn_obj6.11c", 0x80000, 0x9c6504f7, 0x05 | BRF_GRA }, // 12 - { "sn_obj3.14c", 0x80000, 0xd7c340f6, 0x05 | BRF_GRA }, // 13 - { "sn_obj7.15c", 0x80000, 0xcd1356c0, 0x05 | BRF_GRA }, // 14 - - { "sn_chr0.11n", 0x80000, 0xb433c37b, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "sn_chr1.11p", 0x80000, 0xb7dd41f9, 0x06 | BRF_GRA }, // 16 - - { "sn_sha0.8n", 0x80000, 0x01e20999, 0x08 | BRF_GRA }, // 17 Layer Tiles Mask Data - - { "sn1_dat0.13s", 0x20000, 0x72bfeca8, 0x09 | BRF_PRG | BRF_ESS }, // 18 Shared 68K Data - { "sn1_dat1.13p", 0x20000, 0x99b3e653, 0x09 | BRF_PRG | BRF_ESS }, // 19 - - { "sn_voi1.3m", 0x80000, 0x464e616d, 0x0a | BRF_SND }, // 20 C140 Samples Samples - { "sn_voi2.3l", 0x80000, 0x8c3251b5, 0x0a | BRF_SND }, // 21 - - { "sgunner.nv", 0x02000, 0x106026f8, 0x0b | BRF_PRG | BRF_ESS }, // 22 Default NV RAM -}; - -STD_ROM_PICK(sgunnerj) -STD_ROM_FN(sgunnerj) - -struct BurnDriver BurnDrvSgunnerj = { - "sgunnerj", "sgunner", NULL, NULL, "1990", - "Steel Gunner (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, sgunnerjRomInfo, sgunnerjRomName, NULL, NULL, SgunnerInputInfo, SgunnerDIPInfo, - SgunnerInit, Namcos2Exit, DrvFrame, SgunnerDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Steel Gunner 2 (US) - -static struct BurnRomInfo sgunner2RomDesc[] = { - { "sns2mpr0.bin", 0x20000, 0xf1a44039, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "sns2mpr1.bin", 0x20000, 0x9184c4db, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "sns_spr0.bin", 0x10000, 0xe5e40ed0, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "sns_spr1.bin", 0x10000, 0x3a85a5e9, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "sns_snd0.bin", 0x20000, 0xf079cd32, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - -#if defined ROM_VERIFY -// correct M37450 Code, unemulated/doesn't work. JacKc & Barry - please do not change these next 3 lines (5, 6, 7) or the game will break. - { "sys2_c68.3f", 0x08000, 0xca64550a, 0x00 | BRF_PRG | BRF_ESS }, // 5 c68 Code (unused for now) -#else -// not actually on this hw, but works - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 6 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 7 -#endif - - { "sns_obj0.bin", 0x80000, 0xc762445c, 0x05 | BRF_GRA }, // 8 Sprites - { "sns_obj4.bin", 0x80000, 0x0b1be894, 0x05 | BRF_GRA }, // 9 - { "sns_obj1.bin", 0x80000, 0xe9e379d8, 0x05 | BRF_GRA }, // 10 - { "sns_obj5.bin", 0x80000, 0x416b14e1, 0x05 | BRF_GRA }, // 11 - { "sns_obj2.bin", 0x80000, 0x0d076f6c, 0x05 | BRF_GRA }, // 12 - { "sns_obj6.bin", 0x80000, 0xc2e94ed2, 0x05 | BRF_GRA }, // 13 - { "sns_obj3.bin", 0x80000, 0x0fb01e8b, 0x05 | BRF_GRA }, // 14 - { "sns_obj7.bin", 0x80000, 0xfc1f26af, 0x05 | BRF_GRA }, // 15 - - { "sns_chr0.bin", 0x80000, 0xcdc42b61, 0x06 | BRF_GRA }, // 16 Layer Tiles - { "sns_chr1.bin", 0x80000, 0x42d4cbb7, 0x06 | BRF_GRA }, // 17 - { "sns_chr2.bin", 0x80000, 0x7dbaa14e, 0x06 | BRF_GRA }, // 18 - { "sns_chr3.bin", 0x80000, 0xb562ff72, 0x06 | BRF_GRA }, // 19 - - { "sns_sha0.bin", 0x80000, 0x0374fd67, 0x08 | BRF_GRA }, // 20 Layer Tiles Mask Data - - { "sns_dat0.bin", 0x20000, 0x48295d93, 0x09 | BRF_PRG | BRF_ESS }, // 21 Shared 68K Data - { "sns_dat1.bin", 0x20000, 0xb44cc656, 0x09 | BRF_PRG | BRF_ESS }, // 22 - { "sns_dat2.bin", 0x20000, 0xca2ae645, 0x09 | BRF_PRG | BRF_ESS }, // 23 - { "sns_dat3.bin", 0x20000, 0x203bb018, 0x09 | BRF_PRG | BRF_ESS }, // 24 - - { "sns_voi1.bin", 0x80000, 0x219c97f7, 0x0a | BRF_SND }, // 25 C140 Samples - { "sns_voi2.bin", 0x80000, 0x562ec86b, 0x0a | BRF_SND }, // 26 - - { "sgunner2.nv", 0x02000, 0x57a521c6, 0x0b | BRF_PRG | BRF_ESS }, // 27 Default NV RAM -}; - -STD_ROM_PICK(sgunner2) -STD_ROM_FN(sgunner2) - -static UINT16 sgunner2_key_read(UINT8 offset) -{ - if (offset == 0x04) return 0x15a; - - return BurnRandom(); -} - -static INT32 Sgunner2Init() -{ - return SgunnerCommonInit(NULL, sgunner2_key_read); -} - -struct BurnDriver BurnDrvSgunner2 = { - "sgunner2", NULL, NULL, NULL, "1991", - "Steel Gunner 2 (US)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, sgunner2RomInfo, sgunner2RomName, NULL, NULL, SgunnerInputInfo, SgunnerDIPInfo, - Sgunner2Init, Namcos2Exit, DrvFrame, SgunnerDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Steel Gunner 2 (Japan, Rev A) - -static struct BurnRomInfo sgunner2jRomDesc[] = { - { "sns1mpr0a.bin", 0x20000, 0xe7216ad7, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "sns1mpr1a.bin", 0x20000, 0x6caef2ee, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "sns_spr0.bin", 0x10000, 0xe5e40ed0, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "sns_spr1.bin", 0x10000, 0x3a85a5e9, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "sns_snd0.bin", 0x20000, 0xf079cd32, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - -#ifdef ROM_VERIFY -// correct M37450 Code, unemulated/doesn't work. JacKc & Barry - please do not change these next 3 lines (5, 6, 7) or the game will break. - { "sys2_c68.3f", 0x08000, 0xca64550a, 0x00 | BRF_PRG | BRF_ESS }, // 5 c68 -#else -// not actually on this hw, but works - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 6 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 7 -#endif - - { "sns_obj0.bin", 0x80000, 0xc762445c, 0x05 | BRF_GRA }, // 8 Sprites - { "sns_obj4.bin", 0x80000, 0x0b1be894, 0x05 | BRF_GRA }, // 9 - { "sns_obj1.bin", 0x80000, 0xe9e379d8, 0x05 | BRF_GRA }, // 10 - { "sns_obj5.bin", 0x80000, 0x416b14e1, 0x05 | BRF_GRA }, // 11 - { "sns_obj2.bin", 0x80000, 0x0d076f6c, 0x05 | BRF_GRA }, // 12 - { "sns_obj6.bin", 0x80000, 0xc2e94ed2, 0x05 | BRF_GRA }, // 13 - { "sns_obj3.bin", 0x80000, 0x0fb01e8b, 0x05 | BRF_GRA }, // 14 - { "sns_obj7.bin", 0x80000, 0xfc1f26af, 0x05 | BRF_GRA }, // 15 - - { "sns_chr0.bin", 0x80000, 0xcdc42b61, 0x06 | BRF_GRA }, // 16 Layer Tiles - { "sns_chr1.bin", 0x80000, 0x42d4cbb7, 0x06 | BRF_GRA }, // 17 - { "sns_chr2.bin", 0x80000, 0x7dbaa14e, 0x06 | BRF_GRA }, // 18 - { "sns_chr3.bin", 0x80000, 0xb562ff72, 0x06 | BRF_GRA }, // 19 - - { "sns_sha0.bin", 0x80000, 0x0374fd67, 0x08 | BRF_GRA }, // 20 Layer Tiles Mask Data - - { "sns_dat0.bin", 0x20000, 0x48295d93, 0x09 | BRF_PRG | BRF_ESS }, // 21 Shared 68K Data - { "sns_dat1.bin", 0x20000, 0xb44cc656, 0x09 | BRF_PRG | BRF_ESS }, // 22 - { "sns_dat2.bin", 0x20000, 0xca2ae645, 0x09 | BRF_PRG | BRF_ESS }, // 23 - { "sns_dat3.bin", 0x20000, 0x203bb018, 0x09 | BRF_PRG | BRF_ESS }, // 24 - - { "sns_voi1.bin", 0x80000, 0x219c97f7, 0x0a | BRF_SND }, // 25 C140 Samples - { "sns_voi2.bin", 0x80000, 0x562ec86b, 0x0a | BRF_SND }, // 26 - - { "sgunner2j.nv", 0x02000, 0x014bccf9, 0x0b | BRF_PRG | BRF_ESS }, // 27 Default NV RAM -}; - -STD_ROM_PICK(sgunner2j) -STD_ROM_FN(sgunner2j) - -struct BurnDriver BurnDrvSgunner2j = { - "sgunner2j", "sgunner2", NULL, NULL, "1991", - "Steel Gunner 2 (Japan, Rev A)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, sgunner2jRomInfo, sgunner2jRomName, NULL, NULL, SgunnerInputInfo, SgunnerDIPInfo, - Sgunner2Init, Namcos2Exit, DrvFrame, SgunnerDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Dirt Fox (Japan) - -static struct BurnRomInfo dirtfoxjRomDesc[] = { - { "df1_mpr0.bin", 0x20000, 0x8386c820, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "df1_mpr1.bin", 0x20000, 0x51085728, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "df1_spr0.bin", 0x20000, 0xd4906585, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "df1_spr1.bin", 0x20000, 0x7d76cf57, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "df1_snd0.bin", 0x20000, 0x66b4f3ab, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "df1_obj0.bin", 0x80000, 0xb6bd1a68, 0x05 | BRF_GRA }, // 7 Sprites - { "df1_obj1.bin", 0x80000, 0x05421dc1, 0x05 | BRF_GRA }, // 8 - { "df1_obj2.bin", 0x80000, 0x9390633e, 0x05 | BRF_GRA }, // 9 - { "df1_obj3.bin", 0x80000, 0xc8447b33, 0x05 | BRF_GRA }, // 10 - - { "df1_chr0.bin", 0x20000, 0x4b10e4ed, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "df1_chr1.bin", 0x20000, 0x8f63f3d6, 0x06 | BRF_GRA }, // 12 - { "df1_chr2.bin", 0x20000, 0x5a1b852a, 0x06 | BRF_GRA }, // 13 - { "df1_chr3.bin", 0x20000, 0x28570676, 0x06 | BRF_GRA }, // 14 - - { "df1_roz0.bin", 0x40000, 0xa6129f94, 0x07 | BRF_GRA }, // 15 Roz Layer Tiles - { "df1_roz1.bin", 0x40000, 0xc8e7ce73, 0x07 | BRF_GRA }, // 16 - { "df1_roz2.bin", 0x40000, 0xc598e923, 0x07 | BRF_GRA }, // 17 - { "df1_roz3.bin", 0x40000, 0x5a38b062, 0x07 | BRF_GRA }, // 18 - { "df1_roz4.bin", 0x40000, 0xe196d2e8, 0x07 | BRF_GRA }, // 19 - { "df1_roz5.bin", 0x40000, 0x1f8a1a3c, 0x07 | BRF_GRA }, // 20 - { "df1_roz6.bin", 0x40000, 0x7f3a1ed9, 0x07 | BRF_GRA }, // 21 - { "df1_roz7.bin", 0x40000, 0xdd546ae8, 0x07 | BRF_GRA }, // 22 - - { "df1_sha.bin", 0x20000, 0x9a7c9a9b, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "df1_dat0.bin", 0x40000, 0xf5851c85, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "df1_dat1.bin", 0x40000, 0x1a31e46b, 0x09 | BRF_PRG | BRF_ESS }, // 25 - - { "df1_voi1.bin", 0x80000, 0x15053904, 0x0a | BRF_SND }, // 26 C140 Samples Samples -}; - -STD_ROM_PICK(dirtfoxj) -STD_ROM_FN(dirtfoxj) - -static UINT16 dirtfoxj_key_read(UINT8 offset) -{ - if (offset == 0x01) return 0x00b4; - - return BurnRandom(); -} - -static INT32 DirtfoxjInit() -{ - is_dirtfoxj = 1; - - INT32 rc = Namcos2Init(NULL, dirtfoxj_key_read); - - if (!rc) { - nvramcheck = 3; - } - - return rc; - -} - -struct BurnDriver BurnDrvDirtfoxj = { - "dirtfoxj", NULL, NULL, NULL, "1989", - "Dirt Fox (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, dirtfoxjRomInfo, dirtfoxjRomName, NULL, NULL, DirtfoxInputInfo, DirtfoxDIPInfo, - DirtfoxjInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Golly! Ghost! - -static struct BurnRomInfo gollyghoRomDesc[] = { - { "gl2mpr0.11d", 0x10000, 0xe5d48bb9, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "gl2mpr1.13d", 0x10000, 0x584ef971, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "gl1spr0.11k", 0x10000, 0xa108136f, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "gl1spr1.13k", 0x10000, 0xda8443b7, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "gl1snd0.7j", 0x20000, 0x008bce72, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "gl1edr0c.ic7", 0x08000, 0xdb60886f, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "gl1obj0.5b", 0x40000, 0x6809d267, 0x05 | BRF_GRA }, // 7 Sprites - { "gl1obj1.4b", 0x40000, 0xae4304d4, 0x05 | BRF_GRA }, // 8 - { "gl1obj2.5d", 0x40000, 0x9f2e9eb0, 0x05 | BRF_GRA }, // 9 - { "gl1obj3.4d", 0x40000, 0x3a85f3c2, 0x05 | BRF_GRA }, // 10 - - { "gl1chr0.11n", 0x20000, 0x1a7c8abd, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "gl1chr1.11p", 0x20000, 0x36aa0fbc, 0x06 | BRF_GRA }, // 12 - { "gl1chr2.11r", 0x10000, 0x6c1964ba, 0x06 | BRF_GRA }, // 13 - - { "gl1sha0.7n", 0x20000, 0x8886f6f5, 0x08 | BRF_GRA }, // 14 Layer Tiles Mask Data - - { "04544191.6n", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 15 Sprite Zoom (nused) - - { "gl1voi1.3m", 0x80000, 0x0eca0efb, 0x0a | BRF_SND }, // 16 C140 Samples - - { "gollygho.nv", 0x02000, 0xb7e67b9d, 0x0b | BRF_PRG | BRF_ESS }, // 17 Default NV RAM -}; - -STD_ROM_PICK(gollygho) -STD_ROM_FN(gollygho) - -static UINT16 gollygho_key_read(UINT8 offset) -{ - switch (offset) - { - case 0: - case 1: return 0x0002; - case 2: return 0x0000; - case 4: return 0x0143; - } - - return BurnRandom(); -} - -static INT32 GollyghoInit() -{ - return Namcos2Init(NULL, gollygho_key_read); -} - -struct BurnDriver BurnDrvGollygho = { - "gollygho", NULL, NULL, NULL, "1990", - "Golly! Ghost!\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, gollyghoRomInfo, gollyghoRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //GollyghoInputInfo, GollyghoDIPInfo, - GollyghoInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Bubble Trouble (World, Rev B) - -static struct BurnRomInfo bubbletrRomDesc[] = { - { "bt2-mpr0b.bin", 0x20000, 0x26fbfce3, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "bt2-mpr1b.bin", 0x20000, 0x21f42ab2, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "bt1-spr0.11k", 0x10000, 0xb507b00a, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "bt1-spr1.13k", 0x10000, 0x4f35540f, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "bt1-snd0.7j", 0x20000, 0x46a5c625, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "bt1edr0a.ic7", 0x08000, 0x155b02fc, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "bt1-obj0.5b", 0x80000, 0x16b5dc04, 0x05 | BRF_GRA }, // 7 Sprites - { "bt1-obj1.4b", 0x80000, 0xae37a969, 0x05 | BRF_GRA }, // 8 - { "bt1-obj2.5d", 0x80000, 0x75f74871, 0x05 | BRF_GRA }, // 9 - { "bt1-obj3.4d", 0x80000, 0x7fb23c05, 0x05 | BRF_GRA }, // 10 - - { "bt1-chr0.11n", 0x80000, 0x11574c30, 0x06 | BRF_GRA }, // 11 Layer Tiles - - { "bt1-sha0.7n", 0x80000, 0xdc4664df, 0x07 | BRF_GRA }, // 12 Layer Tiles Mask Data - - { "bt1_dat0.13s", 0x20000, 0x1001a14e, 0x09 | BRF_PRG | BRF_ESS }, // 13 Shared 68K Data - { "bt1_dat1.13p", 0x20000, 0x7de6a839, 0x09 | BRF_PRG | BRF_ESS }, // 14 - - { "04544191.6n", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 15 Sprite Zoom (unused) - - { "bt1-voi1.3m", 0x80000, 0x08b3a089, 0x0a | BRF_SND }, // 16 C140 Samples - - { "bubbletr.nv", 0x02000, 0x75ace624, 0x0b | BRF_PRG | BRF_ESS }, // 17 Default NV RAM -}; - -STD_ROM_PICK(bubbletr) -STD_ROM_FN(bubbletr) - -static UINT16 bubbletr_key_read(UINT8 offset) -{ - switch (offset) - { - case 0: - case 1: return 0x0002; - case 2: return 0x0000; - case 4: return 0x0141; - } - - return BurnRandom(); -} - -static INT32 BubbletrInit() -{ - return Namcos2Init(NULL, bubbletr_key_read); -} - -struct BurnDriver BurnDrvBubbletr = { - "bubbletr", NULL, NULL, NULL, "1992", - "Bubble Trouble (World, Rev B)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, bubbletrRomInfo, bubbletrRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //BubbletrInputInfo, BubbletrDIPInfo, - BubbletrInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Bubble Trouble (Japan, Rev C) - -static struct BurnRomInfo bubbletrjRomDesc[] = { - { "bt1-mpr0c.11d", 0x20000, 0x64eb3496, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "bt1-mpr1c.13d", 0x20000, 0x26785bce, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "bt1-spr0.11k", 0x10000, 0xb507b00a, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "bt1-spr1.13k", 0x10000, 0x4f35540f, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "bt1-snd0.7j", 0x20000, 0x46a5c625, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "bt1edr0a.ic7", 0x08000, 0x155b02fc, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "bt1-obj0.5b", 0x80000, 0x16b5dc04, 0x05 | BRF_GRA }, // 7 Sprites - { "bt1-obj1.4b", 0x80000, 0xae37a969, 0x05 | BRF_GRA }, // 8 - { "bt1-obj2.5d", 0x80000, 0x75f74871, 0x05 | BRF_GRA }, // 9 - { "bt1-obj3.4d", 0x80000, 0x7fb23c05, 0x05 | BRF_GRA }, // 10 - - { "bt1-chr0.11n", 0x80000, 0x11574c30, 0x06 | BRF_GRA }, // 11 Layer Tiles - - { "bt1-sha0.7n", 0x80000, 0xdc4664df, 0x08 | BRF_GRA }, // 12 Layer Tiles Mask Data - - { "bt1_dat0.13s", 0x20000, 0x1001a14e, 0x09 | BRF_PRG | BRF_ESS }, // 13 Shared 68K Data - { "bt1_dat1.13p", 0x20000, 0x7de6a839, 0x09 | BRF_PRG | BRF_ESS }, // 14 - - { "04544191.6n", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 15 Sprite Zoom (unused) - - { "bt1-voi1.3m", 0x80000, 0x08b3a089, 0x0a | BRF_SND }, // 16 C140 Samples - - { "bubbletr.nv", 0x02000, 0x75ace624, 0x0b | BRF_PRG | BRF_ESS }, // 17 Default NV RAM -}; - -STD_ROM_PICK(bubbletrj) -STD_ROM_FN(bubbletrj) - -struct BurnDriver BurnDrvBubbletrj = { - "bubbletrj", "bubbletr", NULL, NULL, "1992", - "Bubble Trouble (Japan, Rev C)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, bubbletrjRomInfo, bubbletrjRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //BubbletrInputInfo, BubbletrDIPInfo, - BubbletrInit, Namcos2Exit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Metal Hawk (Rev C) - -static struct BurnRomInfo metlhawkRomDesc[] = { - { "mh2mp0c.11d", 0x20000, 0xcd7dae6e, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "mh2mp1c.13d", 0x20000, 0xe52199fd, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "mh1sp0f.11k", 0x10000, 0x2c141fea, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "mh1sp1f.13k", 0x10000, 0x8ccf98e0, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "mh1s0.7j", 0x20000, 0x79e054cf, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "mhobj-4.5c", 0x40000, 0xe3590e1a, 0x05 | BRF_GRA }, // 7 Sprites - { "mhobj-5.5a", 0x40000, 0xb85c0d07, 0x05 | BRF_GRA }, // 8 - { "mhobj-6.6c", 0x40000, 0x90c4523d, 0x05 | BRF_GRA }, // 9 - { "mhobj-7.6a", 0x40000, 0xf00edb39, 0x05 | BRF_GRA }, // 10 - { "mhobj-0.5d", 0x40000, 0x52ae6620, 0x05 | BRF_GRA }, // 11 - { "mhobj-1.5b", 0x40000, 0x2c2a1291, 0x05 | BRF_GRA }, // 12 - { "mhobj-2.6d", 0x40000, 0x6221b927, 0x05 | BRF_GRA }, // 13 - { "mhobj-3.6b", 0x40000, 0xfd09f2f1, 0x05 | BRF_GRA }, // 14 - - { "mhchr-0.11n", 0x20000, 0xe2da1b14, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "mhchr-1.11p", 0x20000, 0x023c78f9, 0x06 | BRF_GRA }, // 16 - { "mhchr-2.11r", 0x20000, 0xece47e91, 0x06 | BRF_GRA }, // 17 - { "mh1c3.11s", 0x20000, 0x9303aa7f, 0x06 | BRF_GRA }, // 18 - - { "mhr0z-0.2d", 0x40000, 0x30ade98f, 0x07 | BRF_GRA }, // 19 Roz Layer Tiles - { "mhr0z-1.2c", 0x40000, 0xa7fff42a, 0x07 | BRF_GRA }, // 20 - { "mhr0z-2.2b", 0x40000, 0x6abec820, 0x07 | BRF_GRA }, // 21 - { "mhr0z-3.2a", 0x40000, 0xd53cec6d, 0x07 | BRF_GRA }, // 22 - { "mhr0z-4.3d", 0x40000, 0x922213e2, 0x07 | BRF_GRA }, // 23 - { "mhr0z-5.3c", 0x40000, 0x78418a54, 0x07 | BRF_GRA }, // 24 - { "mhr0z-6.3b", 0x40000, 0x6c74977e, 0x07 | BRF_GRA }, // 25 - { "mhr0z-7.3a", 0x40000, 0x68a19cbd, 0x07 | BRF_GRA }, // 26 - - { "mh1sha.7n", 0x20000, 0x6ac22294, 0x08 | BRF_GRA }, // 27 Layer Tiles Mask Data - - { "mh-rzsh.bin", 0x40000, 0x5090b1cf, 0x0d | BRF_GRA }, // 28 Roz Layer Tiles Mask Data - - { "mh1d0.13s", 0x20000, 0x8b178ac7, 0x09 | BRF_PRG | BRF_ESS }, // 29 Shared 68K Data - { "mh1d1.13p", 0x20000, 0x10684fd6, 0x09 | BRF_PRG | BRF_ESS }, // 30 - - { "mhvoi-1.bin", 0x80000, 0x2723d137, 0x0a | BRF_SND }, // 31 C140 Samples Samples - { "mhvoi-2.bin", 0x80000, 0xdbc92d91, 0x0a | BRF_SND }, // 32 - - { "mh5762.7p", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 33 Sprite zoom (unused) - - { "ampal16l8a-sys87b-1.4g", 0x00104, 0x00000000, 0 | BRF_NODUMP | BRF_OPT }, // 34 plds - { "ampal16l8a-sys87b-2.5e", 0x00104, 0x00000000, 0 | BRF_NODUMP | BRF_OPT }, // 35 - { "pal12l10-sys87b-3.8d", 0x00040, 0xd3ae64a6, 0 | BRF_OPT }, // 36 - - { "metlhawk.nv", 0x02000, 0x547cb0dc, 0x0b | BRF_PRG | BRF_ESS }, // 37 Default NV RAM -}; - -STD_ROM_PICK(metlhawk) -STD_ROM_FN(metlhawk) - -struct BurnDriver BurnDrvMetlhawk = { - "metlhawk", NULL, NULL, NULL, "1988", - "Metal Hawk (Rev C)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, metlhawkRomInfo, metlhawkRomName, NULL, NULL, MetlhawkInputInfo, MetlhawkDIPInfo, - MetlhawkInit, Namcos2Exit, DrvFrame, MetlhawkDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Metal Hawk (Japan, Rev F) - -static struct BurnRomInfo metlhawkjRomDesc[] = { - { "mh1mpr0f.11d", 0x20000, 0xe22dfb6e, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "mh1mpr1f.13d", 0x20000, 0xd139a7b7, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "mh1sp0f.11k", 0x10000, 0x2c141fea, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "mh1sp1f.13k", 0x10000, 0x8ccf98e0, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "mh1s0.7j", 0x20000, 0x79e054cf, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "mhobj-4.5c", 0x40000, 0xe3590e1a, 0x05 | BRF_GRA }, // 7 Sprites - { "mhobj-5.5a", 0x40000, 0xb85c0d07, 0x05 | BRF_GRA }, // 8 - { "mhobj-6.6c", 0x40000, 0x90c4523d, 0x05 | BRF_GRA }, // 9 - { "mhobj-7.6a", 0x40000, 0xf00edb39, 0x05 | BRF_GRA }, // 10 - { "mhobj-0.5d", 0x40000, 0x52ae6620, 0x05 | BRF_GRA }, // 11 - { "mhobj-1.5b", 0x40000, 0x2c2a1291, 0x05 | BRF_GRA }, // 12 - { "mhobj-2.6d", 0x40000, 0x6221b927, 0x05 | BRF_GRA }, // 13 - { "mhobj-3.6b", 0x40000, 0xfd09f2f1, 0x05 | BRF_GRA }, // 14 - - { "mhchr-0.11n", 0x20000, 0xe2da1b14, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "mhchr-1.11p", 0x20000, 0x023c78f9, 0x06 | BRF_GRA }, // 16 - { "mhchr-2.11r", 0x20000, 0xece47e91, 0x06 | BRF_GRA }, // 17 - { "mh1c3.11s", 0x20000, 0x9303aa7f, 0x06 | BRF_GRA }, // 18 - - { "mhr0z-0.2d", 0x40000, 0x30ade98f, 0x06 | BRF_GRA }, // 19 Roz Layer Tiles - { "mhr0z-1.2c", 0x40000, 0xa7fff42a, 0x06 | BRF_GRA }, // 20 - { "mhr0z-2.2b", 0x40000, 0x6abec820, 0x06 | BRF_GRA }, // 21 - { "mhr0z-3.2a", 0x40000, 0xd53cec6d, 0x06 | BRF_GRA }, // 22 - { "mhr0z-4.3d", 0x40000, 0x922213e2, 0x06 | BRF_GRA }, // 23 - { "mhr0z-5.3c", 0x40000, 0x78418a54, 0x06 | BRF_GRA }, // 24 - { "mhr0z-6.3b", 0x40000, 0x6c74977e, 0x06 | BRF_GRA }, // 25 - { "mhr0z-7.3a", 0x40000, 0x68a19cbd, 0x06 | BRF_GRA }, // 26 - - { "mh1sha.7n", 0x20000, 0x6ac22294, 0x08 | BRF_GRA }, // 27 Layer Tiles Mask Data - - { "mh-rzsh.bin", 0x40000, 0x5090b1cf, 0x0d | BRF_GRA }, // 28 Roz Layer Tiles Mask Data - - { "mh1d0.13s", 0x20000, 0x8b178ac7, 0x09 | BRF_PRG | BRF_ESS }, // 29 Shared 68K Data - { "mh1d1.13p", 0x20000, 0x10684fd6, 0x09 | BRF_PRG | BRF_ESS }, // 30 - - { "mhvoi-1.bin", 0x80000, 0x2723d137, 0x0a | BRF_SND }, // 31 C140 Samples - { "mhvoi-2.bin", 0x80000, 0xdbc92d91, 0x0a | BRF_SND }, // 32 - - { "metlhawk.nv", 0x02000, 0x547cb0dc, 0x0b | BRF_PRG | BRF_ESS }, // 33 Default NV RAM - - { "mh5762.7p", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 34 Sprite Zoom (unused) - - { "ampal16l8a-sys87b-1.4g", 0x00104, 0x00000000, 0 | BRF_NODUMP | BRF_OPT }, // 35 plds - { "ampal16l8a-sys87b-2.5e", 0x00104, 0x00000000, 0 | BRF_NODUMP | BRF_OPT }, // 36 - { "pal12l10-sys87b-3.8d", 0x00040, 0xd3ae64a6, 0 | BRF_OPT }, // 37 -}; - -STD_ROM_PICK(metlhawkj) -STD_ROM_FN(metlhawkj) - -struct BurnDriver BurnDrvMetlhawkj = { - "metlhawkj", "metlhawk", NULL, NULL, "1988", - "Metal Hawk (Japan, Rev F)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, metlhawkjRomInfo, metlhawkjRomName, NULL, NULL, MetlhawkInputInfo, MetlhawkDIPInfo, - MetlhawkInit, Namcos2Exit, DrvFrame, MetlhawkDraw, DrvScan, &DrvRecalc, 0x4000, - 224, 288, 3, 4 -}; - - -// Lucky & Wild - -static struct BurnRomInfo luckywldRomDesc[] = { - { "lw2mp0.11d", 0x20000, 0x368306bb, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "lw2mp1.13d", 0x20000, 0x9be3a4b8, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "lw1sp0.11k", 0x20000, 0x1eed12cb, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "lw1sp1.13k", 0x20000, 0x535033bc, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "lw1snd0.7j", 0x20000, 0xcc83c6b6, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - - { "lw1obj0.3p", 0x80000, 0x21485830, 0x05 | BRF_GRA }, // 6 Sprites - { "lw1obj4.3s", 0x80000, 0x0050458a, 0x05 | BRF_GRA }, // 10 - { "lw1obj1.3w", 0x80000, 0xd6437a82, 0x05 | BRF_GRA }, // 7 - { "lw1obj5.3x", 0x80000, 0xcbc08f46, 0x05 | BRF_GRA }, // 11 - { "lw1obj2.3t", 0x80000, 0xceb6f516, 0x05 | BRF_GRA }, // 8 - { "lw1obj6.3u", 0x80000, 0x29740c88, 0x05 | BRF_GRA }, // 12 - { "lw1obj3.3y", 0x80000, 0x5d32c7e9, 0x05 | BRF_GRA }, // 9 - { "lw1obj7.3z", 0x80000, 0x8cbd62b4, 0x05 | BRF_GRA }, // 13 - - { "lw1chr0.11n", 0x80000, 0xa0da15fd, 0x06 | BRF_GRA }, // 14 Layer Tiles - { "lw1chr1.11p", 0x80000, 0x89102445, 0x06 | BRF_GRA }, // 15 - { "lw1chr2.11r", 0x80000, 0xc749b778, 0x06 | BRF_GRA }, // 16 - { "lw1chr3.11s", 0x80000, 0xd76f9578, 0x06 | BRF_GRA }, // 17 - { "lw1chr4.9n", 0x80000, 0x2f8ab45e, 0x06 | BRF_GRA }, // 18 - { "lw1chr5.9p", 0x80000, 0xc9acbe61, 0x06 | BRF_GRA }, // 19 - - { "lw1roz2.23e", 0x80000, 0x1ef46d82, 0x07 | BRF_GRA }, // 20 Roz Layer Tiles - { "lw1roz1.23c", 0x80000, 0x74e98793, 0x07 | BRF_GRA }, // 21 - { "lw1roz0.23b", 0x80000, 0xa14079c9, 0x07 | BRF_GRA }, // 22 - - { "lw1sha0.7n", 0x80000, 0xe3a65196, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "lw1rzs0.20z", 0x80000, 0xa1071537, 0x0d | BRF_GRA }, // 24 Roz Layer Tiles Mask data - - { "lw1dat0.13s", 0x80000, 0x5d387d47, 0x09 | BRF_PRG | BRF_ESS }, // 25 Shared 68K Data - { "lw1dat1.13p", 0x80000, 0x7ba94476, 0x09 | BRF_PRG | BRF_ESS }, // 26 - { "lw1dat2.13r", 0x80000, 0xeeba7c62, 0x09 | BRF_PRG | BRF_ESS }, // 27 - { "lw1dat3.13n", 0x80000, 0xec3b36ea, 0x09 | BRF_PRG | BRF_ESS }, // 28 - - { "lw1voi1.3m", 0x80000, 0xb3e57993, 0x0a | BRF_SND }, // 29 C140 Samples - { "lw1voi2.3l", 0x80000, 0xcd8b86a2, 0x0a | BRF_SND }, // 30 - - { "lw1ld8.10w", 0x00100, 0x29058c73, 0x0c | BRF_GRA }, // 31 C45 Color Look-up - - { "luckywld.nv", 0x02000, 0x0c185d2a, 0x0b | BRF_PRG | BRF_ESS }, // 32 Default NV RAM -}; - -STD_ROM_PICK(luckywld) -STD_ROM_FN(luckywld) - -struct BurnDriver BurnDrvLuckywld = { - "luckywld", NULL, NULL, NULL, "1992", - "Lucky & Wild\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, luckywldRomInfo, luckywldRomName, NULL, NULL, LuckywldInputInfo, LuckywldDIPInfo, - LuckywldInit, Namcos2Exit, DrvFrame, LuckywldDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Lucky & Wild (Japan) - -static struct BurnRomInfo luckywldjRomDesc[] = { - { "lw1mpr0.11d", 0x20000, 0x7dce8ba6, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "lw1mpr1.13d", 0x20000, 0xce3b0f37, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "lw1sp0.11k", 0x20000, 0x1eed12cb, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "lw1sp1.13k", 0x20000, 0x535033bc, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "lw1snd0.7j", 0x20000, 0xcc83c6b6, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - - { "lw1obj0.3p", 0x80000, 0x21485830, 0x05 | BRF_GRA }, // 6 Sprites - { "lw1obj4.3s", 0x80000, 0x0050458a, 0x05 | BRF_GRA }, // 8 - { "lw1obj1.3w", 0x80000, 0xd6437a82, 0x05 | BRF_GRA }, // 10 - { "lw1obj5.3x", 0x80000, 0xcbc08f46, 0x05 | BRF_GRA }, // 12 - { "lw1obj2.3t", 0x80000, 0xceb6f516, 0x05 | BRF_GRA }, // 7 - { "lw1obj6.3u", 0x80000, 0x29740c88, 0x05 | BRF_GRA }, // 9 - { "lw1obj3.3y", 0x80000, 0x5d32c7e9, 0x05 | BRF_GRA }, // 11 - { "lw1obj7.3z", 0x80000, 0x8cbd62b4, 0x05 | BRF_GRA }, // 13 - - { "lw1chr0.11n", 0x80000, 0xa0da15fd, 0x06 | BRF_GRA }, // 14 Layer Tiles - { "lw1chr1.11p", 0x80000, 0x89102445, 0x06 | BRF_GRA }, // 15 - { "lw1chr2.11r", 0x80000, 0xc749b778, 0x06 | BRF_GRA }, // 16 - { "lw1chr3.11s", 0x80000, 0xd76f9578, 0x06 | BRF_GRA }, // 17 - { "lw1chr4.9n", 0x80000, 0x2f8ab45e, 0x06 | BRF_GRA }, // 18 - { "lw1chr5.9p", 0x80000, 0xc9acbe61, 0x06 | BRF_GRA }, // 19 - - { "lw1roz2.23e", 0x80000, 0x1ef46d82, 0x07 | BRF_GRA }, // 20 Roz Layer Tiles - { "lw1roz1.23c", 0x80000, 0x74e98793, 0x07 | BRF_GRA }, // 21 - { "lw1roz0.23b", 0x80000, 0xa14079c9, 0x07 | BRF_GRA }, // 22 - - { "lw1sha0.7n", 0x80000, 0xe3a65196, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "lw1rzs0.20z", 0x80000, 0xa1071537, 0x0d | BRF_GRA }, // 24 Roz Layer Tiles Mask data - - { "lw1dat0.13s", 0x80000, 0x5d387d47, 0x09 | BRF_PRG | BRF_ESS }, // 25 Shared 68K Data - { "lw1dat1.13p", 0x80000, 0x7ba94476, 0x09 | BRF_PRG | BRF_ESS }, // 26 - { "lw1dat2.13r", 0x80000, 0xeeba7c62, 0x09 | BRF_PRG | BRF_ESS }, // 27 - { "lw1dat3.13n", 0x80000, 0xec3b36ea, 0x09 | BRF_PRG | BRF_ESS }, // 28 - - { "lw1voi1.3m", 0x80000, 0xb3e57993, 0x0a | BRF_SND }, // 29 C140 Samples - { "lw1voi2.3l", 0x80000, 0xcd8b86a2, 0x0a | BRF_SND }, // 30 - - { "lw1ld8.10w", 0x00100, 0x29058c73, 0x0c | BRF_GRA }, // 31 C45 Color Look-up - - { "luckywld.nv", 0x02000, 0x0c185d2a, 0x0b | BRF_PRG | BRF_ESS }, // 32 Default NV RAM -}; - -STD_ROM_PICK(luckywldj) -STD_ROM_FN(luckywldj) - -struct BurnDriver BurnDrvLuckywldj = { - "luckywldj", "luckywld", NULL, NULL, "1992", - "Lucky & Wild (Japan)\0", NULL, "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, luckywldjRomInfo, luckywldjRomName, NULL, NULL, LuckywldInputInfo, LuckywldDIPInfo, - LuckywldInit, Namcos2Exit, DrvFrame, LuckywldDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - - -// Suzuka 8 Hours (World, Rev C) - -static struct BurnRomInfo suzuka8hRomDesc[] = { - { "eh2-mp0c.bin", 0x20000, 0x9b9271ac, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "eh2-mp1c.bin", 0x20000, 0x24fdd4bc, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "eh1-sp0.bin", 0x20000, 0x4a8c4709, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "eh1-sp1.bin", 0x20000, 0x2256b14e, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "eh1-snd0.bin", 0x20000, 0x36748d3c, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "eh1-obj0.bin", 0x80000, 0x864b6816, 0x05 | BRF_GRA }, // 7 Sprites - { "eh1-obj4.bin", 0x80000, 0xcde13867, 0x05 | BRF_GRA }, // 8 - { "eh1-obj1.bin", 0x80000, 0xd4921c35, 0x05 | BRF_GRA }, // 9 - { "eh1-obj5.bin", 0x80000, 0x9f210546, 0x05 | BRF_GRA }, // 10 - { "eh1-obj2.bin", 0x80000, 0x966d3f19, 0x05 | BRF_GRA }, // 11 - { "eh1-obj6.bin", 0x80000, 0x6019fc8c, 0x05 | BRF_GRA }, // 12 - { "eh1-obj3.bin", 0x80000, 0x7d253cbe, 0x05 | BRF_GRA }, // 13 - { "eh1-obj7.bin", 0x80000, 0x0bd966b8, 0x05 | BRF_GRA }, // 14 - - { "eh2-chr0.bin", 0x80000, 0xb2450fd2, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "eh2-chr1.bin", 0x80000, 0x57204651, 0x06 | BRF_GRA }, // 16 - { "eh1-chr2.bin", 0x80000, 0x8150f644, 0x06 | BRF_GRA }, // 17 - - { "eh2-sha0.bin", 0x80000, 0x7f24619c, 0x08 | BRF_GRA }, // 18 Layer Tiles Mask Data - - { "eh1-d0.bin", 0x40000, 0xb43e5dfa, 0x09 | BRF_PRG | BRF_ESS }, // 19 Shared 68K Data - { "eh1-d1.bin", 0x40000, 0x9825d5bf, 0x09 | BRF_PRG | BRF_ESS }, // 20 - { "eh1-d3.bin", 0x40000, 0xf46d301f, 0x09 | BRF_PRG | BRF_ESS }, // 21 - - { "ehs1_landdt.10w", 0x00100, 0xcde7e8a6, 0x0c | BRF_GRA }, // 22 c45_road:clut - - { "eh1-voi1.bin", 0x80000, 0x71e534d3, 0x0a | BRF_SND }, // 23 C140 Samples - { "eh1-voi2.bin", 0x80000, 0x3e20df8e, 0x0a | BRF_SND }, // 24 -}; - -STD_ROM_PICK(suzuka8h) -STD_ROM_FN(suzuka8h) - -static INT32 Suzuka8hInit() -{ - INT32 nRet = Suzuka8hCommonInit(NULL, NULL); - - if (nRet == 0) - { - BurnByteswap(Drv68KData + 0x100000, 0x100000); // 3rd data rom loaded odd - } - - return nRet; -} - -struct BurnDriverD BurnDrvSuzuka8h = { - "suzuka8h", NULL, NULL, NULL, "1992", - "Suzuka 8 Hours (World, Rev C)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, suzuka8hRomInfo, suzuka8hRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //SuzukaInputInfo, SuzukaDIPInfo, - Suzuka8hInit, Namcos2Exit, DrvFrame, Suzuka8hDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Suzuka 8 Hours (Japan, Rev B) - -static struct BurnRomInfo suzuka8hjRomDesc[] = { - { "eh1-mp0b.bin", 0x20000, 0x2850f469, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "eh1-mp1b.bin", 0x20000, 0xbe83eb2c, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "eh1-sp0.bin", 0x20000, 0x4a8c4709, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "eh1-sp1.bin", 0x20000, 0x2256b14e, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "eh1-snd0.bin", 0x20000, 0x36748d3c, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "eh1-obj0.bin", 0x80000, 0x864b6816, 0x05 | BRF_GRA }, // 7 Sprites - { "eh1-obj4.bin", 0x80000, 0xcde13867, 0x05 | BRF_GRA }, // 8 - { "eh1-obj1.bin", 0x80000, 0xd4921c35, 0x05 | BRF_GRA }, // 9 - { "eh1-obj5.bin", 0x80000, 0x9f210546, 0x05 | BRF_GRA }, // 10 - { "eh1-obj2.bin", 0x80000, 0x966d3f19, 0x05 | BRF_GRA }, // 11 - { "eh1-obj6.bin", 0x80000, 0x6019fc8c, 0x05 | BRF_GRA }, // 12 - { "eh1-obj3.bin", 0x80000, 0x7d253cbe, 0x05 | BRF_GRA }, // 13 - { "eh1-obj7.bin", 0x80000, 0x0bd966b8, 0x05 | BRF_GRA }, // 14 - - { "eh1-chr0.bin", 0x80000, 0xbc90ebef, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "eh1-chr1.bin", 0x80000, 0x61395018, 0x06 | BRF_GRA }, // 16 - { "eh1-chr2.bin", 0x80000, 0x8150f644, 0x06 | BRF_GRA }, // 17 - - { "eh1-sha0.bin", 0x80000, 0x39585cf9, 0x08 | BRF_GRA }, // 18 Layer Tiles Mask Data - - { "eh1-d0.bin", 0x40000, 0xb43e5dfa, 0x09 | BRF_PRG | BRF_ESS }, // 19 Shared 68K Data - { "eh1-d1.bin", 0x40000, 0x9825d5bf, 0x09 | BRF_PRG | BRF_ESS }, // 20 - { "eh1-d3.bin", 0x40000, 0xf46d301f, 0x09 | BRF_PRG | BRF_ESS }, // 21 - - { "ehs1_landdt.10w", 0x00100, 0xcde7e8a6, 0x0c | BRF_GRA }, // 22 C45 Color Look-up - - { "eh1-voi1.bin", 0x80000, 0x71e534d3, 0x0a | BRF_SND }, // 23 C140 Samples - { "eh1-voi2.bin", 0x80000, 0x3e20df8e, 0x0a | BRF_SND }, // 24 -}; - -STD_ROM_PICK(suzuka8hj) -STD_ROM_FN(suzuka8hj) - -struct BurnDriverD BurnDrvSuzuka8hj = { - "suzuka8hj", "suzuka8h", NULL, NULL, "1992", - "Suzuka 8 Hours (Japan, Rev B)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, suzuka8hjRomInfo, suzuka8hjRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //SuzukaInputInfo, SuzukaDIPInfo, - Suzuka8hInit, Namcos2Exit, DrvFrame, Suzuka8hDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Suzuka 8 Hours 2 (World, Rev B) - -static struct BurnRomInfo suzuk8h2RomDesc[] = { - { "ehs2_mp0b.11d", 0x20000, 0xade97f90, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "ehs2_mp1b.13d", 0x20000, 0x19744a66, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ehs1-sp0.11k", 0x20000, 0x9ca967bc, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "ehs1-sp1.13k", 0x20000, 0xf25bfaaa, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "ehs1-snd0.7j", 0x20000, 0xfc95993b, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c68.3f", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "ehs1-obj0.3p", 0x80000, 0xa0acf307, 0x05 | BRF_GRA }, // 7 Sprites - { "ehs1-obj4.3s", 0x80000, 0x4e503ca5, 0x05 | BRF_GRA }, // 8 - { "ehs1-obj1.3w", 0x80000, 0xca780b44, 0x05 | BRF_GRA }, // 9 - { "ehs1-obj5.3x", 0x80000, 0x5405f2d9, 0x05 | BRF_GRA }, // 10 - { "ehs1-obj2.3t", 0x80000, 0x83b45afe, 0x05 | BRF_GRA }, // 11 - { "ehs1-obj6.3j", 0x80000, 0xf5fc8b23, 0x05 | BRF_GRA }, // 12 - { "ehs1-obj3.3y", 0x80000, 0x360c03a8, 0x05 | BRF_GRA }, // 13 - { "ehs1-obj7.3z", 0x80000, 0xda6bf51b, 0x05 | BRF_GRA }, // 14 - - { "ehs1-chr0.11n", 0x80000, 0x844efe0d, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "ehs1-chr1.11p", 0x80000, 0xe8480a6d, 0x06 | BRF_GRA }, // 16 - { "ehs1-chr2.11r", 0x80000, 0xace2d871, 0x06 | BRF_GRA }, // 17 - { "ehs1-chr3.11s", 0x80000, 0xc1680818, 0x06 | BRF_GRA }, // 18 - { "ehs1-chr4.9n", 0x80000, 0x82e8c1d5, 0x06 | BRF_GRA }, // 19 - { "ehs1-chr5.9p", 0x80000, 0x9448537c, 0x06 | BRF_GRA }, // 20 - { "ehs1-chr6.9r", 0x80000, 0x2d1c01ad, 0x06 | BRF_GRA }, // 21 - { "ehs1-chr7.9s", 0x80000, 0x18dd8676, 0x06 | BRF_GRA }, // 22 - - { "ehs1-sha0.7n", 0x80000, 0x0f0e2dbf, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "ehs1-dat0.13s", 0x80000, 0x12a202fb, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "ehs1-dat1.13r", 0x80000, 0x91790905, 0x09 | BRF_PRG | BRF_ESS }, // 25 - { "ehs1-dat2.13p", 0x80000, 0x087da1f3, 0x09 | BRF_PRG | BRF_ESS }, // 26 - { "ehs1-dat3.13n", 0x80000, 0x85aecb3f, 0x09 | BRF_PRG | BRF_ESS }, // 27 - - { "ehs1-landdt.10w", 0x00100, 0xcde7e8a6, 0x0c | BRF_GRA }, // 28 C45 Color Look-up - - { "ehs1-voi1.3m", 0x80000, 0xbf94eb42, 0x0a | BRF_SND }, // 29 C140 Samples - { "ehs1-voi2.3l", 0x80000, 0x0e427604, 0x0a | BRF_SND }, // 30 -}; - -STD_ROM_PICK(suzuk8h2) -STD_ROM_FN(suzuk8h2) - -static UINT16 suzuka8h2_key_read(UINT8 offset) -{ - switch(offset) - { - case 3: return 0x014d; - case 2: return 0x0000; - } - - return BurnRandom(); -} - -static INT32 Suzuka8h2Init() -{ - return Suzuka8hCommonInit(NULL, suzuka8h2_key_read); -} - -struct BurnDriverD BurnDrvSuzuk8h2 = { - "suzuk8h2", NULL, NULL, NULL, "1993", - "Suzuka 8 Hours 2 (World, Rev B)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, suzuk8h2RomInfo, suzuk8h2RomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //SuzukaInputInfo, SuzukaDIPInfo, - Suzuka8h2Init, Namcos2Exit, DrvFrame, Suzuka8hDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Suzuka 8 Hours 2 (Japan, Rev B) - -static struct BurnRomInfo suzuk8h2jRomDesc[] = { - { "ehs1_mp0b.11d", 0x20000, 0xae40d445, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "ehs1_mp1b.13d", 0x20000, 0x9d5b0d43, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ehs1-sp0.11k", 0x20000, 0x9ca967bc, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "ehs1-sp1.13k", 0x20000, 0xf25bfaaa, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "ehs1-snd0.7j", 0x20000, 0xfc95993b, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c68.3f", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "ehs1-obj0.3p", 0x80000, 0xa0acf307, 0x05 | BRF_GRA }, // 7 Sprites - { "ehs1-obj4.3s", 0x80000, 0x4e503ca5, 0x05 | BRF_GRA }, // 11 - { "ehs1-obj1.3w", 0x80000, 0xca780b44, 0x05 | BRF_GRA }, // 8 - { "ehs1-obj5.3x", 0x80000, 0x5405f2d9, 0x05 | BRF_GRA }, // 12 - { "ehs1-obj2.3t", 0x80000, 0x83b45afe, 0x05 | BRF_GRA }, // 9 - { "ehs1-obj6.3j", 0x80000, 0xf5fc8b23, 0x05 | BRF_GRA }, // 13 - { "ehs1-obj3.3y", 0x80000, 0x360c03a8, 0x05 | BRF_GRA }, // 10 - { "ehs1-obj7.3z", 0x80000, 0xda6bf51b, 0x05 | BRF_GRA }, // 14 - - { "ehs1-chr0.11n", 0x80000, 0x844efe0d, 0x06 | BRF_GRA }, // 15 Layer Tiles - { "ehs1-chr1.11p", 0x80000, 0xe8480a6d, 0x06 | BRF_GRA }, // 16 - { "ehs1-chr2.11r", 0x80000, 0xace2d871, 0x06 | BRF_GRA }, // 17 - { "ehs1-chr3.11s", 0x80000, 0xc1680818, 0x06 | BRF_GRA }, // 18 - { "ehs1-chr4.9n", 0x80000, 0x82e8c1d5, 0x06 | BRF_GRA }, // 19 - { "ehs1-chr5.9p", 0x80000, 0x9448537c, 0x06 | BRF_GRA }, // 20 - { "ehs1-chr6.9r", 0x80000, 0x2d1c01ad, 0x06 | BRF_GRA }, // 21 - { "ehs1-chr7.9s", 0x80000, 0x18dd8676, 0x06 | BRF_GRA }, // 22 - - { "ehs1-sha0.7n", 0x80000, 0x0f0e2dbf, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "ehs1-dat0.13s", 0x80000, 0x12a202fb, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "ehs1-dat1.13r", 0x80000, 0x91790905, 0x09 | BRF_PRG | BRF_ESS }, // 25 - { "ehs1-dat2.13p", 0x80000, 0x087da1f3, 0x09 | BRF_PRG | BRF_ESS }, // 26 - { "ehs1-dat3.13n", 0x80000, 0x85aecb3f, 0x09 | BRF_PRG | BRF_ESS }, // 27 - - { "ehs1-landdt.10w", 0x00100, 0xcde7e8a6, 0x0c | BRF_GRA }, // 28 C45 Color Look-up - - { "ehs1-voi1.3m", 0x80000, 0xbf94eb42, 0x0a | BRF_SND }, // 29 C140 Samples - { "ehs1-voi2.3l", 0x80000, 0x0e427604, 0x0a | BRF_SND }, // 30 -}; - -STD_ROM_PICK(suzuk8h2j) -STD_ROM_FN(suzuk8h2j) - -struct BurnDriverD BurnDrvSuzuk8h2j = { - "suzuk8h2j", "suzuk8h2", NULL, NULL, "1993", - "Suzuka 8 Hours 2 (Japan, Rev B)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, suzuk8h2jRomInfo, suzuk8h2jRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //SuzukaInputInfo, SuzukaDIPInfo, - Suzuka8h2Init, Namcos2Exit, DrvFrame, Suzuka8hDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap (Rev E) - -static struct BurnRomInfo finallapRomDesc[] = { - { "fl2mp0e", 0x10000, 0xed805674, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fl2mp1e", 0x10000, 0x4c1d523b, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fl1-sp0", 0x10000, 0x2c5ff15d, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "fl1-sp1", 0x10000, 0xea9d1a2e, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "fl1-s0b", 0x20000, 0xf5d76989, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "obj-0b", 0x80000, 0xc6986523, 0x05 | BRF_GRA }, // 7 Sprites - { "obj-1b", 0x80000, 0x6af7d284, 0x05 | BRF_GRA }, // 8 - { "obj-2b", 0x80000, 0xde45ca8d, 0x05 | BRF_GRA }, // 9 - { "obj-3b", 0x80000, 0xdba830a2, 0x05 | BRF_GRA }, // 10 - - { "fl1-c0", 0x20000, 0xcd9d2966, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "fl1-c1", 0x20000, 0xb0efec87, 0x06 | BRF_GRA }, // 12 - { "fl1-c2", 0x20000, 0x263b8e31, 0x06 | BRF_GRA }, // 13 - { "fl1-c3", 0x20000, 0xc2c56743, 0x06 | BRF_GRA }, // 14 - { "fl2-c4", 0x20000, 0x83c77a50, 0x06 | BRF_GRA }, // 15 - { "fl1-c5", 0x20000, 0xab89da77, 0x06 | BRF_GRA }, // 16 - { "fl2-c6", 0x20000, 0x239bd9a0, 0x06 | BRF_GRA }, // 17 - - { "fl2-sha", 0x20000, 0x5fda0b6d, 0x08 | BRF_GRA }, // 18 Layer Tiles Mask Data - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 19 C45 Color Look-up - - { "fl1-v1", 0x20000, 0x86b21996, 0x0a | BRF_SND }, // 20 C140 Samples - { "fl1-v2", 0x20000, 0x6a164647, 0x0a | BRF_SND }, // 21 -}; - -STD_ROM_PICK(finallap) -STD_ROM_FN(finallap) - -struct BurnDriverD BurnDrvFinallap = { - "finallap", NULL, NULL, NULL, "1987", - "Final Lap (Rev E)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, finallapRomInfo, finallapRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //FinallapInputInfo, FinallapDIPInfo, - FinallapInit, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap (Rev D) - -static struct BurnRomInfo finallapdRomDesc[] = { - { "fl2-mp0d", 0x10000, 0x3576d3aa, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fl2-mp1d", 0x10000, 0x22d3906d, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fl1-sp0", 0x10000, 0x2c5ff15d, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "fl1-sp1", 0x10000, 0xea9d1a2e, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "fl1-s0b", 0x20000, 0xf5d76989, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "obj-0b", 0x80000, 0xc6986523, 0x05 | BRF_GRA }, // 7 Sprites - { "obj-1b", 0x80000, 0x6af7d284, 0x05 | BRF_GRA }, // 8 - { "obj-2b", 0x80000, 0xde45ca8d, 0x05 | BRF_GRA }, // 9 - { "obj-3b", 0x80000, 0xdba830a2, 0x05 | BRF_GRA }, // 10 - - { "fl1-c0", 0x20000, 0xcd9d2966, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "fl1-c1", 0x20000, 0xb0efec87, 0x06 | BRF_GRA }, // 12 - { "fl1-c2", 0x20000, 0x263b8e31, 0x06 | BRF_GRA }, // 13 - { "fl1-c3", 0x20000, 0xc2c56743, 0x06 | BRF_GRA }, // 14 - { "fl2-c4", 0x20000, 0x83c77a50, 0x06 | BRF_GRA }, // 15 - { "fl1-c5", 0x20000, 0xab89da77, 0x06 | BRF_GRA }, // 16 - { "fl2-c6", 0x20000, 0x239bd9a0, 0x06 | BRF_GRA }, // 17 - - { "fl2-sha", 0x20000, 0x5fda0b6d, 0x08 | BRF_GRA }, // 18 Layer Tiles Mask Data - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 19 C45 Color Look-up - - { "fl1-v1", 0x20000, 0x86b21996, 0x0a | BRF_SND }, // 20 C140 Samples - { "fl1-v2", 0x20000, 0x6a164647, 0x0a | BRF_SND }, // 21 -}; - -STD_ROM_PICK(finallapd) -STD_ROM_FN(finallapd) - -struct BurnDriverD BurnDrvFinallapd = { - "finallapd", "finallap", NULL, NULL, "1987", - "Final Lap (Rev D)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, finallapdRomInfo, finallapdRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //FinallapInputInfo, FinallapDIPInfo, - FinallapInit, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap (Rev C) - -static struct BurnRomInfo finallapcRomDesc[] = { - { "fl2-mp0c", 0x10000, 0xf667f2c9, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fl2-mp1c", 0x10000, 0xb8615d33, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fl1-sp0", 0x10000, 0x2c5ff15d, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "fl1-sp1", 0x10000, 0xea9d1a2e, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "fl1-s0", 0x20000, 0x1f8ff494, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "obj-0b", 0x80000, 0xc6986523, 0x05 | BRF_GRA }, // 7 Sprites - { "obj-1b", 0x80000, 0x6af7d284, 0x05 | BRF_GRA }, // 8 - { "obj-2b", 0x80000, 0xde45ca8d, 0x05 | BRF_GRA }, // 9 - { "obj-3b", 0x80000, 0xdba830a2, 0x05 | BRF_GRA }, // 10 - - { "fl1-c0", 0x20000, 0xcd9d2966, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "fl1-c1", 0x20000, 0xb0efec87, 0x06 | BRF_GRA }, // 12 - { "fl1-c2", 0x20000, 0x263b8e31, 0x06 | BRF_GRA }, // 13 - { "fl1-c3", 0x20000, 0xc2c56743, 0x06 | BRF_GRA }, // 14 - { "fl2-c4", 0x20000, 0x83c77a50, 0x06 | BRF_GRA }, // 15 - { "fl1-c5", 0x20000, 0xab89da77, 0x06 | BRF_GRA }, // 16 - { "fl2-c6", 0x20000, 0x239bd9a0, 0x06 | BRF_GRA }, // 17 - - { "fl2-sha", 0x20000, 0x5fda0b6d, 0x08 | BRF_GRA }, // 18 Layer Tiles Mask Data - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 19 C45 Color Look-up - - { "fl1-v1", 0x20000, 0x86b21996, 0x0a | BRF_SND }, // 20 C140 Samples - { "fl1-v2", 0x20000, 0x6a164647, 0x0a | BRF_SND }, // 21 -}; - -STD_ROM_PICK(finallapc) -STD_ROM_FN(finallapc) - -struct BurnDriverD BurnDrvFinallapc = { - "finallapc", "finallap", NULL, NULL, "1987", - "Final Lap (Rev C)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, finallapcRomInfo, finallapcRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //FinallapInputInfo, FinallapDIPInfo, - FinallapInit, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap (Japan, Rev C) - -static struct BurnRomInfo finallapjcRomDesc[] = { - { "fl1_mp0c.bin", 0x10000, 0x63cd7304, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fl1_mp1c.bin", 0x10000, 0xcc9c5fb6, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fl1-sp0", 0x10000, 0x2c5ff15d, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "fl1-sp1", 0x10000, 0xea9d1a2e, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "fl1_s0b", 0x20000, 0xf5d76989, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "obj-0b", 0x80000, 0xc6986523, 0x05 | BRF_GRA }, // 7 Sprites - { "obj-1b", 0x80000, 0x6af7d284, 0x05 | BRF_GRA }, // 8 - { "obj-2b", 0x80000, 0xde45ca8d, 0x05 | BRF_GRA }, // 9 - { "obj-3b", 0x80000, 0xdba830a2, 0x05 | BRF_GRA }, // 10 - - { "fl1-c0", 0x20000, 0xcd9d2966, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "fl1-c1", 0x20000, 0xb0efec87, 0x06 | BRF_GRA }, // 12 - { "fl1-c2", 0x20000, 0x263b8e31, 0x06 | BRF_GRA }, // 13 - { "fl1-c3", 0x20000, 0xc2c56743, 0x06 | BRF_GRA }, // 14 - { "fl1-c4", 0x20000, 0xcdc1de2e, 0x06 | BRF_GRA }, // 15 - { "fl1-c5", 0x20000, 0xab89da77, 0x06 | BRF_GRA }, // 16 - { "fl1-c6", 0x20000, 0x8e78a3c3, 0x06 | BRF_GRA }, // 17 - - { "fl1_sha.bin", 0x20000, 0xb7e1c7a3, 0x08 | BRF_GRA }, // 18 Layer Tiles Mask Data - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 19 C45 Color Look-up - - { "fl1-v1", 0x20000, 0x86b21996, 0x0a | BRF_SND }, // 20 C140 Samples - { "fl1-v2", 0x20000, 0x6a164647, 0x0a | BRF_SND }, // 21 -}; - -STD_ROM_PICK(finallapjc) -STD_ROM_FN(finallapjc) - -struct BurnDriverD BurnDrvFinallapjc = { - "finallapjc", "finallap", NULL, NULL, "1987", - "Final Lap (Japan, Rev C)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, finallapjcRomInfo, finallapjcRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //FinallapInputInfo, FinallapDIPInfo, - FinallapInit, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap (Japan, Rev B) - -static struct BurnRomInfo finallapjbRomDesc[] = { - { "fl1_mp0b.bin", 0x10000, 0x870a482a, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fl1_mp1b.bin", 0x10000, 0xaf52c991, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fl1-sp0", 0x10000, 0x2c5ff15d, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "fl1-sp1", 0x10000, 0xea9d1a2e, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "fl1_s0.bin", 0x20000, 0x1f8ff494, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "obj-0b", 0x80000, 0xc6986523, 0x05 | BRF_GRA }, // 7 Sprites - { "obj-1b", 0x80000, 0x6af7d284, 0x05 | BRF_GRA }, // 8 - { "obj-2b", 0x80000, 0xde45ca8d, 0x05 | BRF_GRA }, // 9 - { "obj-3b", 0x80000, 0xdba830a2, 0x05 | BRF_GRA }, // 10 - - { "fl1-c0", 0x20000, 0xcd9d2966, 0x06 | BRF_GRA }, // 11 Layer Tiles - { "fl1-c1", 0x20000, 0xb0efec87, 0x06 | BRF_GRA }, // 12 - { "fl1-c2", 0x20000, 0x263b8e31, 0x06 | BRF_GRA }, // 13 - { "fl1-c3", 0x20000, 0xc2c56743, 0x06 | BRF_GRA }, // 14 - { "fl1-c4", 0x20000, 0xcdc1de2e, 0x06 | BRF_GRA }, // 15 - { "fl1-c5", 0x20000, 0xab89da77, 0x06 | BRF_GRA }, // 16 - { "fl1-c6", 0x20000, 0x8e78a3c3, 0x06 | BRF_GRA }, // 17 - - { "fl1_sha.bin", 0x20000, 0xb7e1c7a3, 0x08 | BRF_GRA }, // 18 Layer Tiles Mask Data - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 19 C45 Color Look-up - - { "fl1-v1", 0x20000, 0x86b21996, 0x0a | BRF_SND }, // 20 C140 Samples - { "fl1-v2", 0x20000, 0x6a164647, 0x0a | BRF_SND }, // 21 -}; - -STD_ROM_PICK(finallapjb) -STD_ROM_FN(finallapjb) - -struct BurnDriverD BurnDrvFinallapjb = { - "finallapjb", "finallap", NULL, NULL, "1987", - "Final Lap (Japan, Rev B)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, finallapjbRomInfo, finallapjbRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //FinallapInputInfo, FinallapDIPInfo, - FinallapInit, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap 2 - -static struct BurnRomInfo finalap2RomDesc[] = { - { "fls2mp0b", 0x20000, 0x97b48aae, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fls2mp1b", 0x20000, 0xc9f3e0e7, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fls2sp0b", 0x20000, 0x8bf15d9c, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "fls2sp1b", 0x20000, 0xc1a31086, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "flss0", 0x20000, 0xc07cc10a, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "fl2obj0", 0x80000, 0x3657dd7a, 0x05 | BRF_GRA }, // 7 Sprites - { "fl2obj2", 0x80000, 0x8ac933fd, 0x05 | BRF_GRA }, // 8 - { "fl2obj4", 0x80000, 0xe7b989e6, 0x05 | BRF_GRA }, // 9 - { "fl2obj6", 0x80000, 0x4936583d, 0x05 | BRF_GRA }, // 10 - { "fl2obj1", 0x80000, 0x3cebf419, 0x05 | BRF_GRA }, // 11 - { "fl2obj3", 0x80000, 0x0959ed55, 0x05 | BRF_GRA }, // 12 - { "fl2obj5", 0x80000, 0xd74ae0d3, 0x05 | BRF_GRA }, // 13 - { "fl2obj7", 0x80000, 0x5ca68c93, 0x05 | BRF_GRA }, // 14 - - { "fls2chr0", 0x40000, 0x7bbda499, 0x16 | BRF_GRA }, // 15 Layer Tiles - { "fls2chr1", 0x40000, 0xac8940e5, 0x16 | BRF_GRA }, // 16 - { "fls2chr2", 0x40000, 0x1756173d, 0x16 | BRF_GRA }, // 17 - { "fls2chr3", 0x40000, 0x69032785, 0x16 | BRF_GRA }, // 18 - { "fls2chr4", 0x40000, 0x8216cf42, 0x16 | BRF_GRA }, // 19 - { "fls2chr5", 0x40000, 0xdc3e8e1c, 0x16 | BRF_GRA }, // 20 - { "fls2chr6", 0x40000, 0x1ef4bdde, 0x16 | BRF_GRA }, // 21 - { "fls2chr7", 0x40000, 0x53dafcde, 0x16 | BRF_GRA }, // 22 - - { "fls2sha", 0x40000, 0xf7b40a85, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "fls2dat0", 0x40000, 0xf1af432c, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "fls2dat1", 0x40000, 0x8719533e, 0x09 | BRF_PRG | BRF_ESS }, // 25 - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 26 C45 Color Look-up - - { "flsvoi1", 0x80000, 0x590be52f, 0x0a | BRF_SND }, // 27 C140 Samples - { "flsvoi2", 0x80000, 0x204b3c27, 0x0a | BRF_SND }, // 28 - - { "finalap2.nv", 0x02000, 0xc7ae5d0a, 0x0b | BRF_PRG | BRF_ESS}, // 29 nvram -}; - -STD_ROM_PICK(finalap2) -STD_ROM_FN(finalap2) - -struct BurnDriverD BurnDrvFinalap2 = { - "finalap2", NULL, NULL, NULL, "1990", - "Final Lap 2\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, finalap2RomInfo, finalap2RomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //FinalapInputInfo, FinallapDIPInfo, - Finalap2Init, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap 2 (Japan) - -static struct BurnRomInfo finalap2jRomDesc[] = { - { "fls1_mp0.bin", 0x20000, 0x05ea8090, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fls1_mp1.bin", 0x20000, 0xfb189f50, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fls2sp0b", 0x20000, 0x8bf15d9c, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "fls2sp1b", 0x20000, 0xc1a31086, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "flss0", 0x20000, 0xc07cc10a, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "fl2obj0", 0x80000, 0x3657dd7a, 0x05 | BRF_GRA }, // 7 Sprites - { "fl2obj2", 0x80000, 0x8ac933fd, 0x05 | BRF_GRA }, // 8 - { "fl2obj4", 0x80000, 0xe7b989e6, 0x05 | BRF_GRA }, // 9 - { "fl2obj6", 0x80000, 0x4936583d, 0x05 | BRF_GRA }, // 10 - { "fl2obj1", 0x80000, 0x3cebf419, 0x05 | BRF_GRA }, // 11 - { "fl2obj3", 0x80000, 0x0959ed55, 0x05 | BRF_GRA }, // 12 - { "fl2obj5", 0x80000, 0xd74ae0d3, 0x05 | BRF_GRA }, // 13 - { "fl2obj7", 0x80000, 0x5ca68c93, 0x05 | BRF_GRA }, // 14 - - { "fls2chr0", 0x40000, 0x7bbda499, 0x16 | BRF_GRA }, // 15 Layer Tiles - { "fls2chr1", 0x40000, 0xac8940e5, 0x16 | BRF_GRA }, // 16 - { "fls2chr2", 0x40000, 0x1756173d, 0x16 | BRF_GRA }, // 17 - { "fls2chr3", 0x40000, 0x69032785, 0x16 | BRF_GRA }, // 18 - { "fls2chr4", 0x40000, 0x8216cf42, 0x16 | BRF_GRA }, // 19 - { "fls2chr5", 0x40000, 0xdc3e8e1c, 0x16 | BRF_GRA }, // 20 - { "fls2chr6", 0x40000, 0x1ef4bdde, 0x16 | BRF_GRA }, // 21 - { "fls2chr7", 0x40000, 0x53dafcde, 0x16 | BRF_GRA }, // 22 - - { "fls2sha", 0x40000, 0xf7b40a85, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "fls2dat0", 0x40000, 0xf1af432c, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "fls2dat1", 0x40000, 0x8719533e, 0x09 | BRF_PRG | BRF_ESS }, // 25 - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 26 C45 Color Look-up - - { "flsvoi1", 0x80000, 0x590be52f, 0x0a | BRF_SND }, // 27 C140 Samples - { "flsvoi2", 0x80000, 0x204b3c27, 0x0a | BRF_SND }, // 28 - - { "finalap2.nv", 0x02000, 0xc7ae5d0a, 0x0b | BRF_PRG | BRF_ESS}, // 29 nvram -}; - -STD_ROM_PICK(finalap2j) -STD_ROM_FN(finalap2j) - -struct BurnDriverD BurnDrvFinalap2j = { - "finalap2j", "finalap2", NULL, NULL, "1990", - "Final Lap 2 (Japan)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, finalap2jRomInfo, finalap2jRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //FinalapInputInfo, FinallapDIPInfo, - Finalap2Init, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap 3 (World, set 1) - -static struct BurnRomInfo finalap3RomDesc[] = { - { "fl3mpr0.bin", 0x20000, 0x9ff361ff, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fl3mpr1.bin", 0x20000, 0x17efb7f2, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "flt1sp0", 0x20000, 0xe804ced1, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "flt1sp1", 0x20000, 0x3a2b24ee, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "flt1snd0", 0x20000, 0x60b72aed, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "fltobj0", 0x80000, 0xeab19ec6, 0x05 | BRF_GRA }, // 7 Sprites - { "fltobj2", 0x80000, 0x2a3b7ded, 0x05 | BRF_GRA }, // 8 - { "fltobj4", 0x80000, 0x84aa500c, 0x05 | BRF_GRA }, // 9 - { "fltobj6", 0x80000, 0x33118e63, 0x05 | BRF_GRA }, // 10 - { "fltobj1", 0x80000, 0x4ef37a51, 0x05 | BRF_GRA }, // 11 - { "fltobj3", 0x80000, 0xb86dc7cd, 0x05 | BRF_GRA }, // 12 - { "fltobj5", 0x80000, 0x6a53e603, 0x05 | BRF_GRA }, // 13 - { "fltobj7", 0x80000, 0xb52a85e2, 0x05 | BRF_GRA }, // 14 - - { "flt2_chr-0.bin", 0x40000, 0x5954f270, 0x16 | BRF_GRA }, // 15 Layer Tiles - { "fltchr-1.11p", 0x40000, 0x2e68d13c, 0x16 | BRF_GRA }, // 16 - { "flt2_chr-2.bin", 0x40000, 0x98f3b190, 0x16 | BRF_GRA }, // 17 - { "fltchr-3.11s", 0x40000, 0xe9b05a1f, 0x16 | BRF_GRA }, // 18 - { "fltchr-4.9n", 0x40000, 0x5ae43767, 0x16 | BRF_GRA }, // 19 - { "fltchr-5.9p", 0x40000, 0xb5f4e780, 0x16 | BRF_GRA }, // 20 - { "fltchr-6.9r", 0x40000, 0x4b0baea2, 0x16 | BRF_GRA }, // 21 - { "fltchr-7.9s", 0x40000, 0x85db9e94, 0x16 | BRF_GRA }, // 22 - - { "flt2_sha.bin", 0x40000, 0x6986565b, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "flt1d0", 0x20000, 0x80004966, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "flt1d1", 0x20000, 0xa2e93e8c, 0x09 | BRF_PRG | BRF_ESS }, // 25 - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 26 C45 Color Look-up - - { "fltvoi1", 0x80000, 0x4fc7c0ba, 0x0a | BRF_SND }, // 27 C140 Samples - { "fltvoi2", 0x80000, 0x409c62df, 0x0a | BRF_SND }, // 28 - - { "04544191.6r", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 29 user2 - - { "finalap3.nv", 0x02000, 0xefbc6274, 0x0b | BRF_PRG | BRF_ESS }, // 30 nvram -}; - -STD_ROM_PICK(finalap3) -STD_ROM_FN(finalap3) - -struct BurnDriverD BurnDrvFinalap3 = { - "finalap3", NULL, NULL, NULL, "1992", - "Final Lap 3 (World, set 1)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, finalap3RomInfo, finalap3RomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //FinalapInputInfo, FinallapDIPInfo, - Finalap2Init, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap 3 (World, set 2) - -static struct BurnRomInfo finalap3aRomDesc[] = { - { "flt2-mp0", 0x20000, 0x22082168, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "flt2-mp1", 0x20000, 0x2ec21977, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "flt1sp0", 0x20000, 0xe804ced1, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "flt1sp1", 0x20000, 0x3a2b24ee, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "flt1snd0", 0x20000, 0x60b72aed, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "fltobj0", 0x80000, 0xeab19ec6, 0x05 | BRF_GRA }, // 7 Sprites - { "fltobj2", 0x80000, 0x2a3b7ded, 0x05 | BRF_GRA }, // 8 - { "fltobj4", 0x80000, 0x84aa500c, 0x05 | BRF_GRA }, // 9 - { "fltobj6", 0x80000, 0x33118e63, 0x05 | BRF_GRA }, // 10 - { "fltobj1", 0x80000, 0x4ef37a51, 0x05 | BRF_GRA }, // 11 - { "fltobj3", 0x80000, 0xb86dc7cd, 0x05 | BRF_GRA }, // 12 - { "fltobj5", 0x80000, 0x6a53e603, 0x05 | BRF_GRA }, // 13 - { "fltobj7", 0x80000, 0xb52a85e2, 0x05 | BRF_GRA }, // 14 - - { "flt2_chr-0.bin", 0x40000, 0x5954f270, 0x16 | BRF_GRA }, // 15 Layer Tiles - { "fltchr-1.11p", 0x40000, 0x2e68d13c, 0x16 | BRF_GRA }, // 16 - { "flt2_chr-2.bin", 0x40000, 0x98f3b190, 0x16 | BRF_GRA }, // 17 - { "fltchr-3.11s", 0x40000, 0xe9b05a1f, 0x16 | BRF_GRA }, // 18 - { "fltchr-4.9n", 0x40000, 0x5ae43767, 0x16 | BRF_GRA }, // 19 - { "fltchr-5.9p", 0x40000, 0xb5f4e780, 0x16 | BRF_GRA }, // 20 - { "fltchr-6.9r", 0x40000, 0x4b0baea2, 0x16 | BRF_GRA }, // 21 - { "fltchr-7.9s", 0x40000, 0x85db9e94, 0x16 | BRF_GRA }, // 22 - - { "flt2_sha.bin", 0x40000, 0x6986565b, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "flt1d0", 0x20000, 0x80004966, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "flt1d1", 0x20000, 0xa2e93e8c, 0x09 | BRF_PRG | BRF_ESS }, // 25 - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 26 C45 Color Look-up - - { "fltvoi1", 0x80000, 0x4fc7c0ba, 0x0a | BRF_SND }, // 27 C140 Samples - { "fltvoi2", 0x80000, 0x409c62df, 0x0a | BRF_SND }, // 28 - - { "04544191.6r", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 29 Sprite zoom (Unused) - - { "341.bin", 0x20000, 0x8c90ca97, 0x00 | BRF_PRG | BRF_OPT }, // 30 Unknown - - { "finalap3.nv", 0x02000, 0xefbc6274, 0x0b | BRF_GRA }, // 31 Default NV RAM -}; - -STD_ROM_PICK(finalap3a) -STD_ROM_FN(finalap3a) - -struct BurnDriverD BurnDrvFinalap3a = { - "finalap3a", "finalap3", NULL, NULL, "1992", - "Final Lap 3 (World, set 2)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, finalap3aRomInfo, finalap3aRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //Finalap3InputInfo, Finalap3DIPInfo, - Finalap2Init, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap 3 (Japan) - -static struct BurnRomInfo finalap3jRomDesc[] = { - { "fltmp0", 0x20000, 0x2f2a997a, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fltmp1", 0x20000, 0xb505ca0b, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "flt1sp0", 0x20000, 0xe804ced1, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "flt1sp1", 0x20000, 0x3a2b24ee, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "flt1snd0", 0x20000, 0x60b72aed, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "fltobj0", 0x80000, 0xeab19ec6, 0x05 | BRF_GRA }, // 7 Sprites - { "fltobj2", 0x80000, 0x2a3b7ded, 0x05 | BRF_GRA }, // 8 - { "fltobj4", 0x80000, 0x84aa500c, 0x05 | BRF_GRA }, // 9 - { "fltobj6", 0x80000, 0x33118e63, 0x05 | BRF_GRA }, // 10 - { "fltobj1", 0x80000, 0x4ef37a51, 0x05 | BRF_GRA }, // 11 - { "fltobj3", 0x80000, 0xb86dc7cd, 0x05 | BRF_GRA }, // 12 - { "fltobj5", 0x80000, 0x6a53e603, 0x05 | BRF_GRA }, // 13 - { "fltobj7", 0x80000, 0xb52a85e2, 0x05 | BRF_GRA }, // 14 - - { "fltchr-0.11n", 0x40000, 0x97ed5b62, 0x16 | BRF_GRA }, // 15 Layer Tiles - { "fltchr-1.11p", 0x40000, 0x2e68d13c, 0x16 | BRF_GRA }, // 16 - { "fltchr-2.11r", 0x40000, 0x43c3abf8, 0x16 | BRF_GRA }, // 17 - { "fltchr-3.11s", 0x40000, 0xe9b05a1f, 0x16 | BRF_GRA }, // 18 - { "fltchr-4.9n", 0x40000, 0x5ae43767, 0x16 | BRF_GRA }, // 19 - { "fltchr-5.9p", 0x40000, 0xb5f4e780, 0x16 | BRF_GRA }, // 20 - { "fltchr-6.9r", 0x40000, 0x4b0baea2, 0x16 | BRF_GRA }, // 21 - { "fltchr-7.9s", 0x40000, 0x85db9e94, 0x16 | BRF_GRA }, // 22 - - { "fltsha", 0x40000, 0x211bbd83, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "flt1d0", 0x20000, 0x80004966, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "flt1d1", 0x20000, 0xa2e93e8c, 0x09 | BRF_PRG | BRF_ESS }, // 25 - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 26 C45 Color Look-up - - { "fltvoi1", 0x80000, 0x4fc7c0ba, 0x0a | BRF_SND }, // 27 C140 Samples - { "fltvoi2", 0x80000, 0x409c62df, 0x0a | BRF_SND }, // 28 - - { "04544191.6r", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 29 Sprite Zoom (nused) - - { "finalap3.nv", 0x02000, 0xefbc6274, 0x0b | BRF_PRG | BRF_ESS }, // 30 nDefault NV RAM -}; - -STD_ROM_PICK(finalap3j) -STD_ROM_FN(finalap3j) - -struct BurnDriverD BurnDrvFinalap3j = { - "finalap3j", "finalap3", NULL, NULL, "1992", - "Final Lap 3 (Japan)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, finalap3jRomInfo, finalap3jRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //Finalap3InputInfo, Finalap3DIPInfo, - Finalap2Init, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap 3 (Japan - Rev C) - -static struct BurnRomInfo finalap3jcRomDesc[] = { - { "flt1_mp0c.11d", 0x20000, 0xebe1bff8, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "flt1_mp1c.13d", 0x20000, 0x61099bb8, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "flt1_sp0.11k", 0x20000, 0xe804ced1, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "flt1_sp1.13k", 0x20000, 0x3a2b24ee, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "flt1_snd0.7j", 0x20000, 0x60b72aed, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "c68.3d", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c68.3f", 0x08000, 0xca64550a, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "flt_obj-0.4c", 0x80000, 0xeab19ec6, 0x05 | BRF_GRA }, // 7 Sprites - { "flt_obj-2.4a", 0x80000, 0x2a3b7ded, 0x05 | BRF_GRA }, // 8 - { "flt_obj-4.8c", 0x80000, 0x84aa500c, 0x05 | BRF_GRA }, // 9 - { "flt_obj-6.8a", 0x80000, 0x33118e63, 0x05 | BRF_GRA }, // 10 - { "flt_obj-1.2c", 0x80000, 0x4ef37a51, 0x05 | BRF_GRA }, // 11 - { "flt_obj-3.2a", 0x80000, 0xb86dc7cd, 0x05 | BRF_GRA }, // 12 - { "flt_obj-5.5c", 0x80000, 0x6a53e603, 0x05 | BRF_GRA }, // 13 - { "flt_obj-7.6a", 0x80000, 0xb52a85e2, 0x05 | BRF_GRA }, // 14 - - { "flt_chr-0.11n", 0x40000, 0x97ed5b62, 0x16 | BRF_GRA }, // 15 Layer Tiles - { "flt_chr-1.11p", 0x40000, 0x2e68d13c, 0x16 | BRF_GRA }, // 16 - { "flt_chr-2.11r", 0x40000, 0x43c3abf8, 0x16 | BRF_GRA }, // 17 - { "flt_chr-3.11s", 0x40000, 0xe9b05a1f, 0x16 | BRF_GRA }, // 18 - { "flt_chr-4.9n", 0x40000, 0x5ae43767, 0x16 | BRF_GRA }, // 19 - { "flt_chr-5.9p", 0x40000, 0xb5f4e780, 0x16 | BRF_GRA }, // 20 - { "flt_chr-6.9r", 0x40000, 0x4b0baea2, 0x16 | BRF_GRA }, // 21 - { "flt_chr-7.9s", 0x40000, 0x85db9e94, 0x16 | BRF_GRA }, // 22 - - { "flt sha.7n", 0x40000, 0x211bbd83, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "flt1_d0.13s", 0x20000, 0x80004966, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "flt1_d1.13p", 0x20000, 0xa2e93e8c, 0x09 | BRF_PRG | BRF_ESS }, // 25 - - { "fl1_3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 26 C45 Color Look-up - - { "flt_voi-1.3m", 0x80000, 0x4fc7c0ba, 0x0a | BRF_SND }, // 27 C140 Samples - { "flt_voi-2.3l", 0x80000, 0x409c62df, 0x0a | BRF_SND }, // 28 - - { "04544191.6r", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 29 Zoom Look-up (Unused) - - { "finalap3.nv", 0x02000, 0xefbc6274, 0x0b | BRF_PRG | BRF_ESS }, // 30 Default NV RAM -}; - -STD_ROM_PICK(finalap3jc) -STD_ROM_FN(finalap3jc) - -struct BurnDriverD BurnDrvFinalap3jc = { - "finalap3jc", "finalap3", NULL, NULL, "1992", - "Final Lap 3 (Japan - Rev C)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, finalap3jcRomInfo, finalap3jcRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //Finalap3InputInfo, Finalap3DIPInfo, - Finalap2Init, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Final Lap 3 (bootleg) - -static struct BurnRomInfo finalap3blRomDesc[] = { - { "fl3-mp0.11d", 0x20000, 0xaf11f52e, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fl3-mp1.13d", 0x20000, 0xda9b1b48, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "flt1sp0", 0x20000, 0xe804ced1, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "flt1sp1", 0x20000, 0x3a2b24ee, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "flt1snd0", 0x20000, 0x60b72aed, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "fltobj0", 0x80000, 0xeab19ec6, 0x05 | BRF_GRA }, // 7 Sprites - { "fltobj2", 0x80000, 0x2a3b7ded, 0x05 | BRF_GRA }, // 8 - { "fltobj4", 0x80000, 0x84aa500c, 0x05 | BRF_GRA }, // 9 - { "fltobj6", 0x80000, 0x33118e63, 0x05 | BRF_GRA }, // 10 - { "fltobj1", 0x80000, 0x4ef37a51, 0x05 | BRF_GRA }, // 11 - { "fltobj3", 0x80000, 0xb86dc7cd, 0x05 | BRF_GRA }, // 12 - { "fltobj5", 0x80000, 0x6a53e603, 0x05 | BRF_GRA }, // 13 - { "fltobj7", 0x80000, 0xb52a85e2, 0x05 | BRF_GRA }, // 14 - - { "flt2_chr-0.bin", 0x40000, 0x5954f270, 0x16 | BRF_GRA }, // 15 Layer Tiles - { "fltchr-1.11p", 0x40000, 0x2e68d13c, 0x16 | BRF_GRA }, // 16 - { "flt2_chr-2.bin", 0x40000, 0x98f3b190, 0x16 | BRF_GRA }, // 17 - { "fltchr-3.11s", 0x40000, 0xe9b05a1f, 0x16 | BRF_GRA }, // 18 - { "fltchr-4.9n", 0x40000, 0x5ae43767, 0x16 | BRF_GRA }, // 19 - { "fltchr-5.9p", 0x40000, 0xb5f4e780, 0x16 | BRF_GRA }, // 20 - { "fltchr-6.9r", 0x40000, 0x4b0baea2, 0x16 | BRF_GRA }, // 21 - { "fltchr-7.9s", 0x40000, 0x85db9e94, 0x16 | BRF_GRA }, // 22 - - { "flt2_sha.bin", 0x40000, 0x6986565b, 0x08 | BRF_GRA }, // 23 Layer Tiles Mask Data - - { "flt1d0", 0x20000, 0x80004966, 0x09 | BRF_PRG | BRF_ESS }, // 24 Shared 68K Data - { "flt1d1", 0x20000, 0xa2e93e8c, 0x09 | BRF_PRG | BRF_ESS }, // 25 - - { "fl1-3.5b", 0x00100, 0xd179d99a, 0x0c | BRF_GRA }, // 26 C45 Color Look-up - - { "fltvoi1", 0x80000, 0x4fc7c0ba, 0x0a | BRF_SND }, // 27 C140 Samples - { "fltvoi2", 0x80000, 0x409c62df, 0x0a | BRF_SND }, // 28 - - { "04544191.6r", 0x02000, 0x90db1bf6, 0x00 | BRF_GRA | BRF_OPT }, // 29 Sprite Zoom (Unused) - - { "finalap3.nv", 0x02000, 0xefbc6274, 0x0b | BRF_PRG | BRF_ESS }, // 30 Default NV RAM -}; - -STD_ROM_PICK(finalap3bl) -STD_ROM_FN(finalap3bl) - -struct BurnDriverD BurnDrvFinalap3bl = { - "finalap3bl", "finalap3", NULL, NULL, "1992", - "Final Lap 3 (bootleg)\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, finalap3blRomInfo, finalap3blRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //Finalap3InputInfo, Finalap3DIPInfo, - Finalap2Init, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - - -// Four Trax - -static struct BurnRomInfo fourtraxRomDesc[] = { - { "fx2_mp0.11d", 0x20000, 0xf147cd6b, 0x01 | BRF_PRG | BRF_ESS }, // 0 Main 68K Code - { "fx2_mp1.13d", 0x20000, 0x8af4a309, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fx2_sp0.11k", 0x20000, 0x48548e78, 0x02 | BRF_PRG | BRF_ESS }, // 2 Sub 68K Code - { "fx2_sp1.13k", 0x20000, 0xd2861383, 0x02 | BRF_PRG | BRF_ESS }, // 3 - - { "fx1_sd0.7j", 0x20000, 0xacccc934, 0x03 | BRF_PRG | BRF_ESS }, // 4 M6809 Code - - { "sys2mcpu.bin", 0x02000, 0xa342a97e, 0x04 | BRF_PRG | BRF_ESS }, // 5 HD68705 Code - { "sys2c65c.bin", 0x08000, 0xa5b2a4ff, 0x04 | BRF_PRG | BRF_ESS }, // 6 - - { "fx_obj-0.4c", 0x40000, 0x1aa60ffa, 0x15 | BRF_GRA }, // 7 Sprites - { "fx_obj-1.3c", 0x40000, 0x7509bc09, 0x15 | BRF_GRA }, // 8 - { "fx_obj-4.4a", 0x40000, 0x30add52a, 0x15 | BRF_GRA }, // 9 - { "fx_obj-5.3a", 0x40000, 0xe3cd2776, 0x15 | BRF_GRA }, // 10 - { "fx_obj-8.8c", 0x40000, 0xb165acab, 0x15 | BRF_GRA }, // 11 - { "fx_obj-9.7c", 0x40000, 0x90f0735b, 0x15 | BRF_GRA }, // 12 - { "fx_obj-12.8a", 0x40000, 0xf5e23b78, 0x15 | BRF_GRA }, // 13 - { "fx_obj-13.7a", 0x40000, 0x04a25007, 0x15 | BRF_GRA }, // 14 - { "fx_obj2.2c", 0x40000, 0x243affc7, 0x15 | BRF_GRA }, // 15 - { "fx_obj-3.1c", 0x40000, 0xb7e5d17d, 0x15 | BRF_GRA }, // 16 - { "fx_obj6.2a", 0x40000, 0xa2d5ce4a, 0x15 | BRF_GRA }, // 17 - { "fx_obj7.1a", 0x40000, 0x4d91c929, 0x15 | BRF_GRA }, // 18 - { "fx_obj10.6c", 0x40000, 0x7a01e86f, 0x15 | BRF_GRA }, // 19 - { "fx_obj-11.5c", 0x40000, 0x514b3fe5, 0x15 | BRF_GRA }, // 20 - { "fx_obj-14.6a", 0x40000, 0xc1658c77, 0x15 | BRF_GRA }, // 21 - { "fx_obj15.5a", 0x40000, 0x2bc909b3, 0x15 | BRF_GRA }, // 22 - - { "fx_chr-0.11n", 0x20000, 0x6658c1c3, 0x06 | BRF_GRA }, // 23 Layer Tiles - { "fx_chr-1.11p", 0x20000, 0x3a888943, 0x06 | BRF_GRA }, // 24 - { "fx2_ch2.11r", 0x20000, 0xfdf1e86b, 0x06 | BRF_GRA }, // 25 - { "fx_chr-3.11s", 0x20000, 0x47fa7e61, 0x06 | BRF_GRA }, // 26 - { "fx_chr-4.9n", 0x20000, 0xc720c5f5, 0x06 | BRF_GRA }, // 27 - { "fx_chr-5.9p", 0x20000, 0x9eacdbc8, 0x06 | BRF_GRA }, // 28 - { "fx_chr-6.9r", 0x20000, 0xc3dba42e, 0x06 | BRF_GRA }, // 29 - { "fx_chr-7.9s", 0x20000, 0xc009f3ae, 0x06 | BRF_GRA }, // 30 - - { "fx_sha.7n", 0x20000, 0xf7aa4af7, 0x08 | BRF_GRA }, // 31 Layer Tiles Mask Data - - { "fx_dat0.13s", 0x40000, 0x63abf69b, 0x09 | BRF_PRG | BRF_ESS }, // 32 Shared 68K Data - { "fx_dat1.13r", 0x40000, 0x725bed14, 0x09 | BRF_PRG | BRF_ESS }, // 33 - { "fx_dat2.13p", 0x40000, 0x71e4a5a0, 0x09 | BRF_PRG | BRF_ESS }, // 34 - { "fx_dat3.13n", 0x40000, 0x605725f7, 0x09 | BRF_PRG | BRF_ESS }, // 35 - - { "fx1_1.5b", 0x00100, 0x85ffd753, 0x0c | BRF_GRA }, // 36 C45 Color Look-up - - { "fx_voi-1.3m", 0x80000, 0x6173364f, 0x0a | BRF_SND }, // 37 C140 Samples -}; - -STD_ROM_PICK(fourtrax) -STD_ROM_FN(fourtrax) - -struct BurnDriverD BurnDrvFourtrax = { - "fourtrax", NULL, NULL, NULL, "1989", - "Four Trax\0", "Imperfect graphics, sound and inputs", "Namco", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0, - NULL, fourtraxRomInfo, fourtraxRomName, NULL, NULL, DefaultInputInfo, DefaultDIPInfo, //FourtraxInputInfo, Fourtrax3DIPInfo, - FourtraxInit, Namcos2Exit, DrvFrame, FinallapDraw, DrvScan, &DrvRecalc, 0x4000, - 288, 224, 4, 3 -}; - diff --git a/jan/src/burn/drv/pst90s/d_news.cpp b/jan/src/burn/drv/pst90s/d_news.cpp deleted file mode 100644 index 4ff9b1936..000000000 --- a/jan/src/burn/drv/pst90s/d_news.cpp +++ /dev/null @@ -1,458 +0,0 @@ -#include "tiles_generic.h" -#include "z80_intf.h" -#include "msm6295.h" - -// FB Alpha - "News" Driver -// Based on MAME driver by David Haywood - -// Input Related Variables -static UINT8 NewsInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 NewsDip[1] = {0}; -static UINT8 NewsInput[1] = {0x00}; -static UINT8 NewsReset = 0; - -// Memory Holders -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *NewsRom = NULL; -static UINT8 *NewsRam = NULL; -static UINT8 *NewsFgVideoRam = NULL; -static UINT8 *NewsBgVideoRam = NULL; -static UINT8 *NewsPaletteRam = NULL; -static UINT32 *NewsPalette = NULL; -static UINT8 *NewsTiles = NULL; -static UINT8 *NewsTempGfx = NULL; - -// Misc Variables, system control values, etc. -static INT32 BgPic; - -// Dip Switch and Input Definitions -static struct BurnInputInfo NewsInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , NewsInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , NewsInputPort0 + 1, "p1 start" }, - - {"Up" , BIT_DIGITAL , NewsInputPort0 + 2, "p1 up" }, - {"Down" , BIT_DIGITAL , NewsInputPort0 + 3, "p1 down" }, - {"Left" , BIT_DIGITAL , NewsInputPort0 + 4, "p1 left" }, - {"Right" , BIT_DIGITAL , NewsInputPort0 + 5, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , NewsInputPort0 + 6, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , NewsInputPort0 + 7, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &NewsReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, NewsDip + 0 , "dip" }, -}; - -STDINPUTINFO(News) - -inline void NewsClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } - if ((*nJoystickInputs & 0x30) == 0x30) { - *nJoystickInputs &= ~0x30; - } -} - -inline void NewsMakeInputs() -{ - // Reset Inputs - NewsInput[0] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - NewsInput[0] |= (NewsInputPort0[i] & 1) << i; - } - - // Clear Opposites - NewsClearOpposites(&NewsInput[0]); -} - -static struct BurnDIPInfo NewsDIPList[]= -{ - // Default Values - {0x09, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x09, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x09, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x09, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x09, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x09, 0x01, 0x0c, 0x0c, "Easy" }, - {0x09, 0x01, 0x0c, 0x08, "Medium" }, - {0x09, 0x01, 0x0c, 0x04, "Hard" }, - {0x09, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Helps" }, - {0x09, 0x01, 0x10, 0x10, "1" }, - {0x09, 0x01, 0x10, 0x00, "2" }, - - {0 , 0xfe, 0 , 2 , "Copyright" }, - {0x09, 0x01, 0x20, 0x00, "Poby" }, - {0x09, 0x01, 0x20, 0x20, "Virus" }, -}; - -STDDIPINFO(News) - -static struct BurnDIPInfo NewsaDIPList[]= -{ - // Default Values - {0x09, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x09, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x09, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x09, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x09, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x09, 0x01, 0x0c, 0x0c, "Easy" }, - {0x09, 0x01, 0x0c, 0x08, "Medium" }, - {0x09, 0x01, 0x0c, 0x04, "Hard" }, - {0x09, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Helps" }, - {0x09, 0x01, 0x10, 0x10, "1" }, - {0x09, 0x01, 0x10, 0x00, "2" }, -}; - -STDDIPINFO(Newsa) - -// Rom Definitions -static struct BurnRomInfo NewsRomDesc[] = { - { "virus.4", 0x08000, 0xaa005dfb, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - - { "virus.2", 0x40000, 0xb5af58d8, BRF_GRA }, // 1 Tiles - { "virus.3", 0x40000, 0xa4b1c175, BRF_GRA }, // 2 Tiles - - { "virus.1", 0x40000, 0x41f5935a, BRF_SND }, // 3 Samples -}; - - -STD_ROM_PICK(News) -STD_ROM_FN(News) - -static struct BurnRomInfo NewsaRomDesc[] = { - { "newsa_virus.4", 0x10000, 0x74a257da, BRF_ESS | BRF_PRG }, // 0 Z80 Program Code - - { "virus.2", 0x40000, 0xb5af58d8, BRF_GRA }, // 1 Tiles - { "virus.3", 0x40000, 0xa4b1c175, BRF_GRA }, // 2 Tiles - - { "virus.1", 0x40000, 0x41f5935a, BRF_SND }, // 3 Samples -}; - - -STD_ROM_PICK(Newsa) -STD_ROM_FN(Newsa) - -// Misc Driver Functions and Memory Handlers -INT32 NewsDoReset() -{ - BgPic = 0; - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - - return 0; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 8) & 0x0f; - g = (nColour >> 4) & 0x0f; - b = (nColour >> 0) & 0x0f; - - r = (r << 4) | r; - g = (g << 4) | g; - b = (b << 4) | b; - - return BurnHighCol(r, g, b, 0); -} - -UINT8 __fastcall NewsRead(UINT16 a) -{ - switch (a) { - case 0xc000: { - return NewsDip[0]; - } - - case 0xc001: { - return 0xff - NewsInput[0]; - } - - case 0xc002: { - return MSM6295ReadStatus(0); - } - } - - return 0; -} - -void __fastcall NewsWrite(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xc002: { - MSM6295Command(0, d); - return; - } - - case 0xc003: { - BgPic = d; - return; - } - } - - if (a >= 0x9000 && a <= 0x91ff) { - INT32 Offset = a - 0x9000; - - NewsPaletteRam[Offset] = d; - NewsPalette[Offset / 2] = CalcCol(NewsPaletteRam[Offset | 1] | (NewsPaletteRam[Offset & ~1] << 8)); - return; - } -} - - - -// Function to Allocate and Index required memory -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - NewsRom = Next; Next += 0x10000; - MSM6295ROM = Next; Next += 0x40000; - - RamStart = Next; - - NewsRam = Next; Next += 0x02000; - NewsFgVideoRam = Next; Next += 0x00800; - NewsBgVideoRam = Next; Next += 0x00800; - NewsPaletteRam = Next; Next += 0x00200; - - RamEnd = Next; - - NewsTiles = Next; Next += (16384 * 8 * 8); - NewsPalette = (UINT32*)Next; Next += 0x00100 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 TilePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TileXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 TileYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; - -// Driver Init and Exit Functions -INT32 NewsInit() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - NewsTempGfx = (UINT8*)BurnMalloc(0x80000); - - // Load Z80 Program Rom - nRet = BurnLoadRom(NewsRom, 0, 1); if (nRet != 0) return 1; - - // Load, byte-swap and decode Tile Roms - nRet = BurnLoadRom(NewsTempGfx + 0x00000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(NewsTempGfx + 0x00001, 2, 2); if (nRet != 0) return 1; - GfxDecode(16384, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, NewsTempGfx, NewsTiles); - BurnFree(NewsTempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 3, 1); if (nRet != 0) return 1; - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, NewsRom ); - ZetMapArea(0x0000, 0x7fff, 2, NewsRom ); - ZetMapArea(0x8000, 0x87ff, 0, NewsFgVideoRam ); - ZetMapArea(0x8000, 0x87ff, 1, NewsFgVideoRam ); - ZetMapArea(0x8000, 0x87ff, 2, NewsFgVideoRam ); - ZetMapArea(0x8800, 0x8fff, 0, NewsBgVideoRam ); - ZetMapArea(0x8800, 0x8fff, 1, NewsBgVideoRam ); - ZetMapArea(0x8800, 0x8fff, 2, NewsBgVideoRam ); - ZetMapArea(0xe000, 0xffff, 0, NewsRam ); - ZetMapArea(0xe000, 0xffff, 1, NewsRam ); - ZetMapArea(0xe000, 0xffff, 2, NewsRam ); - ZetSetReadHandler(NewsRead); - ZetSetWriteHandler(NewsWrite); - ZetClose(); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 8000, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - NewsDoReset(); - - return 0; -} - -INT32 NewsExit() -{ - MSM6295Exit(0); - ZetExit(); - - GenericTilesExit(); - - BurnFree(Mem); - - BgPic = 0; - - return 0; -} - -// Graphics Emulation -void NewsRenderBgLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Code = (NewsBgVideoRam[TileIndex * 2] << 8) | NewsBgVideoRam[TileIndex * 2 + 1]; - Colour = (Code & 0xf000) >> 12; - Code &= 0x0fff; - if ((Code & 0x0e00) == 0xe00) Code = (Code & 0x1ff) | (BgPic << 9); - x = 8 * mx; - y = 8 * my; - y -= 16; - - if (x > 7 && x < 248 && y > 7 && y < 216) { - Render8x8Tile(pTransDraw, Code, x, y, Colour, 4, 0, NewsTiles); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0, NewsTiles); - } - - TileIndex++; - } - } -} - -void NewsRenderFgLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Code = (NewsFgVideoRam[TileIndex * 2] << 8) | NewsFgVideoRam[TileIndex * 2 + 1]; - Colour = (Code & 0xf000) >> 12; - Code &= 0x0fff; - x = 8 * mx; - y = 8 * my; - y -= 16; - - if (x > 7 && x < 248 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, NewsTiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, NewsTiles); - } - - TileIndex++; - } - } -} - -void NewsDraw() -{ - NewsRenderBgLayer(); - NewsRenderFgLayer(); - BurnTransferCopy(NewsPalette); -} - -// Frame Function -INT32 NewsFrame() -{ - if (NewsReset) NewsDoReset(); - - NewsMakeInputs(); - - ZetOpen(0); - ZetRun(8000000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnDraw) NewsDraw(); - if (pBurnSoundOut) MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - - return 0; -} - -// Scan RAM -static INT32 NewsScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x02942; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = NewsPalette; - ba.nLen = 0x100 * sizeof(UINT32); - ba.szName = "Palette"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); // Scan Z80 - - MSM6295Scan(0, nAction); // Scan OKIM6295 - - // Scan critical driver variables - SCAN_VAR(NewsInput); - SCAN_VAR(NewsDip); - SCAN_VAR(BgPic); - } - - return 0; -} - -// Driver Declaration -struct BurnDriver BurnDrvNews = { - "news", NULL, NULL, NULL, "1993", - "News (set 1)\0", NULL, "Poby / Virus", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, NewsRomInfo, NewsRomName, NULL, NULL, NewsInputInfo, NewsDIPInfo, - NewsInit, NewsExit, NewsFrame, NULL, NewsScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNewsa = { - "newsa", "news", NULL, NULL, "1993", - "News (set 2)\0", NULL, "Poby / Jeansole", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, NewsaRomInfo, NewsaRomName, NULL, NULL, NewsInputInfo, NewsaDIPInfo, - NewsInit, NewsExit, NewsFrame, NULL, NewsScan, - NULL, 0x100, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_nmg5.cpp b/jan/src/burn/drv/pst90s/d_nmg5.cpp deleted file mode 100644 index 43f15d20b..000000000 --- a/jan/src/burn/drv/pst90s/d_nmg5.cpp +++ /dev/null @@ -1,1939 +0,0 @@ -// FB Alpha NMG5 driver module -// Based on MAME driver by Pierpaolo Prazzoli - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "msm6295.h" - -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvBmpRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT16 *DrvScrRAM; -static UINT32 *DrvPalette; -static UINT32 *Palette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[ 2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static UINT8 DrvOkiBank; -static UINT8 soundlatch; -static UINT8 prot_val; -static UINT8 input_data; -static UINT8 priority_reg; -static UINT8 gfx_bank; - -static struct BurnInputInfo Nmg5InputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 1, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy3 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy3 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy3 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy3 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy3 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy3 + 6, "p1 fire 3"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy3 + 15, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 8, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 9, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 10, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 11, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 12, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 13, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy3 + 14, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Nmg5) - -static struct BurnInputInfo SearcheyInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy3 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy3 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy3 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy3 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy3 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p1 fire 2"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy3 + 15, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 8, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 9, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 10, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 11, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 12, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 13, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Searchey) - -static struct BurnInputInfo PclubysInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy3 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy3 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy3 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy3 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy3 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy3 + 6, "p1 fire 3"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy3 + 15, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy3 + 8, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy3 + 9, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy3 + 10, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy3 + 11, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy3 + 12, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy3 + 13, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy3 + 14, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pclubys) - -static struct BurnInputInfo GarogunInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy3 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy3 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy3 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy3 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy3 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p1 fire 2"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Garogun) - -static struct BurnInputInfo Ordi7InputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy3 + 7, "p1 start" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy3 + 2, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy3 + 3, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy3 + 4, "p1 fire 3"}, - {"P1 Button 4" , BIT_DIGITAL , DrvJoy3 + 1, "p1 fire 4"}, - {"P1 Button 5" , BIT_DIGITAL , DrvJoy3 + 0, "p1 fire 5"}, - {"P1 Button 6" , BIT_DIGITAL , DrvJoy3 + 10, "p1 fire 6"}, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ordi7) - -static struct BurnDIPInfo Nmg5DIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xdf, NULL }, - - {0x13, 0xfe, 0, 2, "Game Title" }, - {0x13, 0x01, 0x01, 0x01, "Multi 5" }, - {0x13, 0x01, 0x01, 0x00, "New Multi Game 5" }, - - {0x13, 0xfe, 0, 4, "Crocodiles (Tong Boy)" }, - {0x13, 0x01, 0x06, 0x06, "Pattern 1" }, - {0x13, 0x01, 0x06, 0x02, "Pattern 2" }, - {0x13, 0x01, 0x06, 0x04, "Pattern 3" }, - {0x13, 0x01, 0x06, 0x00, "Pattern 4" }, - - {0x13, 0xfe, 0, 4, "License" }, - {0x13, 0x01, 0x18, 0x00, "New Impeuropex Corp. S.R.L." }, - {0x13, 0x01, 0x18, 0x08, "BNS Enterprises" }, - {0x13, 0x01, 0x18, 0x10, "Nova Games" }, - {0x13, 0x01, 0x18, 0x18, "None" }, - - {0x13, 0xfe, 0, 2, "1P Vs 2P Rounds (Bubble Gum)" }, - {0x13, 0x01, 0x20, 0x20, "Best of 1" }, - {0x13, 0x01, 0x20, 0x00, "Best of 3" }, - - {0x13, 0xfe, 0, 4, "Difficulty" }, - {0x13, 0x01, 0xc0, 0x40, "Easy" }, - {0x13, 0x01, 0xc0, 0xc0, "Normal" }, - {0x13, 0x01, 0xc0, 0x80, "Hard" }, - {0x13, 0x01, 0xc0, 0x00, "Hardest" }, - - {0x14, 0xfe, 0, 4, "Coin B" }, - {0x14, 0x01, 0x03, 0x02, "2C 1C" }, - {0x14, 0x01, 0x03, 0x03, "1C 1C" }, - {0x14, 0x01, 0x03, 0x00, "2C 3C" }, - {0x14, 0x01, 0x03, 0x01, "1C 2C" }, -// {0x14, 0x01, 0x03, 0x03, "1C 1C" }, -// {0x14, 0x01, 0x03, 0x01, "1C 3C" }, -// {0x14, 0x01, 0x03, 0x02, "1C 4C" }, -// {0x14, 0x01, 0x03, 0x00, "1C 6C" }, - - {0x14, 0xfe, 0, 4, "Coin A" }, - {0x14, 0x01, 0x0c, 0x08, "2C 1C" }, - {0x14, 0x01, 0x0c, 0x0c, "1C 1C" }, - {0x14, 0x01, 0x0c, 0x00, "2C 3C" }, - {0x14, 0x01, 0x0c, 0x04, "1C 2C" }, -// {0x14, 0x01, 0x0c, 0x00, "4C 1C" }, -// {0x14, 0x01, 0x0c, 0x08, "3C 1C" }, -// {0x14, 0x01, 0x0c, 0x04, "2C 1C" }, -// {0x14, 0x01, 0x0c, 0x0c, "1C 1C" }, - - {0x14, 0xfe, 0, 2, "Demo Sounds" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0x14, 0xfe, 0, 2, "Coin Type" }, - {0x14, 0x01, 0x40, 0x40, "1" }, - {0x14, 0x01, 0x40, 0x00, "2" }, - - {0x14, 0xfe, 0, 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Nmg5) - -static struct BurnDIPInfo SearcheyDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xdd, NULL }, - - {0 , 0xfe, 0, 4, "Timer Speed" }, - {0x10, 0x01, 0x03, 0x03, "Slowest" }, - {0x10, 0x01, 0x03, 0x02, "Slow" }, - {0x10, 0x01, 0x03, 0x01, "Fast" }, - {0x10, 0x01, 0x03, 0x00, "Fastest" }, - - {0x10, 0xfe, 0, 4, "Helps" }, - {0x10, 0x01, 0x0c, 0x0c, "1" }, - {0x10, 0x01, 0x0c, 0x08, "2" }, - {0x10, 0x01, 0x0c, 0x04, "3" }, - {0x10, 0x01, 0x0c, 0x00, "4" }, - - {0x10, 0xfe, 0, 4, "Lives" }, - {0x10, 0x01, 0x30, 0x20, "3" }, - {0x10, 0x01, 0x30, 0x10, "4" }, - {0x10, 0x01, 0x30, 0x30, "5" }, - {0x10, 0x01, 0x30, 0x00, "6" }, - - {0x10, 0xfe, 0, 4, "Coinage" }, - {0x10, 0x01, 0xc0, 0x00, "3C 1C" }, - {0x10, 0x01, 0xc0, 0x40, "2C 1C" }, - {0x10, 0x01, 0xc0, 0xc0, "1C 1C" }, - {0x10, 0x01, 0xc0, 0x80, "1C 2C" }, - - {0x11, 0xfe, 0, 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0x11, 0xfe, 0, 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0x11, 0xfe, 0, 8, "Language" }, - {0x11, 0x01, 0x38, 0x00, "Korean Duplicate 1" }, - {0x11, 0x01, 0x38, 0x08, "Korean Duplicate 2" }, - {0x11, 0x01, 0x38, 0x10, "Korean Duplicate 3" }, - {0x11, 0x01, 0x38, 0x18, "Italian" }, - {0x11, 0x01, 0x38, 0x20, "Korean" }, - {0x11, 0x01, 0x38, 0x28, "Japanese" }, - {0x11, 0x01, 0x38, 0x30, "English" }, - {0x11, 0x01, 0x38, 0x38, "Korean Duplicate 4" }, - - {0x11, 0xfe, 0, 2, "Items to find" }, - {0x11, 0x01, 0x80, 0x00, "Less" }, - {0x11, 0x01, 0x80, 0x80, "More" }, -}; - -STDDIPINFO(Searchey) - -static struct BurnDIPInfo SearcheyaDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xdd, NULL }, - - {0 , 0xfe, 0, 4, "Timer Speed" }, - {0x10, 0x01, 0x03, 0x03, "Slowest" }, - {0x10, 0x01, 0x03, 0x02, "Slow" }, - {0x10, 0x01, 0x03, 0x01, "Fast" }, - {0x10, 0x01, 0x03, 0x00, "Fastest" }, - - {0x10, 0xfe, 0, 4, "Helps" }, - {0x10, 0x01, 0x0c, 0x0c, "1" }, - {0x10, 0x01, 0x0c, 0x08, "2" }, - {0x10, 0x01, 0x0c, 0x04, "3" }, - {0x10, 0x01, 0x0c, 0x00, "4" }, - - {0x10, 0xfe, 0, 4, "Lives" }, - {0x10, 0x01, 0x30, 0x20, "3" }, - {0x10, 0x01, 0x30, 0x10, "4" }, - {0x10, 0x01, 0x30, 0x30, "5" }, - {0x10, 0x01, 0x30, 0x00, "6" }, - - {0x10, 0xfe, 0, 4, "Coinage" }, - {0x10, 0x01, 0xc0, 0x00, "3C 1C" }, - {0x10, 0x01, 0xc0, 0x40, "2C 1C" }, - {0x10, 0x01, 0xc0, 0xc0, "1C 1C" }, - {0x10, 0x01, 0xc0, 0x80, "1C 2C" }, - - {0x11, 0xfe, 0, 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0x11, 0xfe, 0, 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0x11, 0xfe, 0, 2, "Language" }, - {0x11, 0x01, 0x20, 0x00, "English" }, - {0x11, 0x01, 0x20, 0x20, "Korean" }, - - {0x11, 0xfe, 0, 2, "Items to find" }, - {0x11, 0x01, 0x80, 0x00, "Less" }, - {0x11, 0x01, 0x80, 0x80, "More" }, -}; - -STDDIPINFO(Searcheya) - -static struct BurnDIPInfo Searchp2DIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xf7, NULL }, - - {0x10, 0xfe, 0, 4, "Timer Speed" }, - {0x10, 0x01, 0x03, 0x03, "Slowest" }, - {0x10, 0x01, 0x03, 0x02, "Slow" }, - {0x10, 0x01, 0x03, 0x01, "Fast" }, - {0x10, 0x01, 0x03, 0x00, "Fastest" }, - - {0x10, 0xfe, 0, 4, "Helps" }, - {0x10, 0x01, 0x0c, 0x0c, "1" }, - {0x10, 0x01, 0x0c, 0x08, "2" }, - {0x10, 0x01, 0x0c, 0x04, "3" }, - {0x10, 0x01, 0x0c, 0x00, "4" }, - - {0x10, 0xfe, 0, 4, "Lives" }, - {0x10, 0x01, 0x30, 0x20, "3" }, - {0x10, 0x01, 0x30, 0x10, "4" }, - {0x10, 0x01, 0x30, 0x30, "5" }, - {0x10, 0x01, 0x30, 0x00, "6" }, - - {0x10, 0xfe, 0, 4, "Coinage" }, - {0x10, 0x01, 0xc0, 0x00, "3C 1C" }, - {0x10, 0x01, 0xc0, 0x40, "2C 1C" }, - {0x10, 0x01, 0xc0, 0xc0, "1C 1C" }, - {0x10, 0x01, 0xc0, 0x80, "1C 2C" }, - - {0x11, 0xfe, 0, 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0x11, 0xfe, 0, 4, "Lucky Chance" }, - {0x11, 0x01, 0x06, 0x06, "Table 1" }, - {0x11, 0x01, 0x06, 0x04, "Table 2" }, - {0x11, 0x01, 0x06, 0x02, "Table 3" }, - {0x11, 0x01, 0x06, 0x00, "Table 4" }, - - {0x11, 0xfe, 0, 8, "Language" }, - {0x11, 0x01, 0x38, 0x00, "Korean Duplicate 1" }, - {0x11, 0x01, 0x38, 0x08, "Korean Duplicate 2" }, - {0x11, 0x01, 0x38, 0x10, "Korean " }, - {0x11, 0x01, 0x38, 0x18, "Italian" }, - {0x11, 0x01, 0x38, 0x20, "Chinese" }, - {0x11, 0x01, 0x38, 0x28, "Japanese" }, - {0x11, 0x01, 0x38, 0x30, "English" }, - {0x11, 0x01, 0x38, 0x38, "Korean Duplicate 3" }, - - {0x11, 0xfe, 0, 2, "Lucky Timer" }, - {0x11, 0x01, 0x40, 0x00, "Less" }, - {0x11, 0x01, 0x40, 0x40, "More" }, - - {0x11, 0xfe, 0, 2, "Items to find" }, - {0x11, 0x01, 0x80, 0x00, "Less" }, - {0x11, 0x01, 0x80, 0x80, "More" }, -}; - -STDDIPINFO(Searchp2) - -static struct BurnDIPInfo PclubysDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0x12, 0xfe, 0, 2, "Lives (Mad Ball)" }, - {0x12, 0x01, 0x01, 0x00, "3" }, - {0x12, 0x01, 0x01, 0x01, "4" }, - - {0x12, 0xfe, 0, 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0x12, 0xfe, 0, 2, "1P Vs 2P Rounds" }, - {0x12, 0x01, 0x04, 0x00, "Best of 1" }, - {0x12, 0x01, 0x04, 0x04, "Best of 3" }, - - {0x12, 0xfe, 0, 2, "Nudity" }, - {0x12, 0x01, 0x08, 0x08, "Soft only" }, - {0x12, 0x01, 0x08, 0x00, "Soft and Hard" }, - - {0x12, 0xfe, 0, 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x30, "Easy" }, - {0x12, 0x01, 0x30, 0x20, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0x12, 0xfe, 0, 4, "Coinage" }, - {0x12, 0x01, 0xc0, 0x00, "3C 1C" }, - {0x12, 0x01, 0xc0, 0x40, "2C 1C" }, - {0x12, 0x01, 0xc0, 0xc0, "1C 1C" }, - {0x12, 0x01, 0xc0, 0x80, "1C 2C" }, - - {0x13, 0xfe, 0, 2, "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0x13, 0xfe, 0, 4, "Timer Speed (Magic Eye)" }, - {0x13, 0x01, 0x30, 0x30, "Slowest" }, - {0x13, 0x01, 0x30, 0x20, "Slow" }, - {0x13, 0x01, 0x30, 0x10, "Fast" }, - {0x13, 0x01, 0x30, 0x00, "Fastest" }, - - {0x13, 0xfe, 0, 2, "Lives (Magic Eye)" }, - {0x13, 0x01, 0x40, 0x00, "3" }, - {0x13, 0x01, 0x40, 0x40, "4" }, - - {0x13, 0xfe, 0, 2, "Timer Speed (Box Logic)" }, - {0x13, 0x01, 0x80, 0x80, "Slow" }, - {0x13, 0x01, 0x80, 0x00, "Fast" }, -}; - -STDDIPINFO(Pclubys) - -static struct BurnDIPInfo GarogunDIPList[]= -{ - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0xfd, NULL }, - - {0x09, 0xfe, 0, 4, "Helps" }, - {0x09, 0x01, 0x03, 0x00, "1" }, - {0x09, 0x01, 0x03, 0x01, "2" }, - {0x09, 0x01, 0x03, 0x02, "3" }, - {0x09, 0x01, 0x03, 0x03, "4" }, - - {0x09, 0xfe, 0, 4, "Timer Speed (Bonus Levels)" }, - {0x09, 0x01, 0x0c, 0x0c, "Slowest" }, - {0x09, 0x01, 0x0c, 0x08, "Slow" }, - {0x09, 0x01, 0x0c, 0x04, "Fast" }, - {0x09, 0x01, 0x0c, 0x00, "Fastest" }, - - {0x09, 0xfe, 0, 4, "Timer Speed (Main Levels)" }, - {0x09, 0x01, 0x30, 0x30, "Slowest" }, - {0x09, 0x01, 0x30, 0x20, "Slow" }, - {0x09, 0x01, 0x30, 0x10, "Fast" }, - {0x09, 0x01, 0x30, 0x00, "Fastest" }, - - {0x09, 0xfe, 0, 4, "Coinage" }, - {0x09, 0x01, 0xc0, 0x00, "3C 1C" }, - {0x09, 0x01, 0xc0, 0x40, "2C 1C" }, - {0x09, 0x01, 0xc0, 0xc0, "1C 1C" }, - {0x09, 0x01, 0xc0, 0x80, "1C 2C" }, - - {0x0a, 0xfe, 0, 2, "Service Mode" }, - {0x0a, 0x01, 0x01, 0x01, "Off" }, - {0x0a, 0x01, 0x01, 0x00, "On" }, - - {0x0a, 0xfe, 0, 2, "Demo Sounds" }, - {0x0a, 0x01, 0x02, 0x02, "Off" }, - {0x0a, 0x01, 0x02, 0x00, "On" }, -}; - -STDDIPINFO(Garogun) - -static struct BurnDIPInfo Ordi7DIPList[]= -{ - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0xff, NULL }, - - {0x09, 0xfe, 0, 2, "High-Low Error" }, - {0x09, 0x01, 0x01, 0x01, "-500" }, - {0x09, 0x01, 0x01, 0x00, "Lose All" }, - - {0x09, 0xfe, 0, 2, "Minimum Credits" }, - {0x09, 0x01, 0x02, 0x02, "300" }, - {0x09, 0x01, 0x02, 0x00, "500" }, - - {0x09, 0xfe, 0, 4, "Credit Limit" }, - {0x09, 0x01, 0x0c, 0x0c, "10000" }, - {0x09, 0x01, 0x0c, 0x08, "30000" }, - {0x09, 0x01, 0x0c, 0x04, "50000" }, - {0x09, 0x01, 0x0c, 0x00, "100000" }, - - {0x09, 0xfe, 0, 4, "Bet" }, - {0x09, 0x01, 0x30, 0x30, "50 Credits" }, - {0x09, 0x01, 0x30, 0x20, "100 Credits" }, - {0x09, 0x01, 0x30, 0x10, "150 Credits" }, - {0x09, 0x01, 0x30, 0x00, "200 Credits" }, - - {0x09, 0xfe, 0, 4, "Coinage" }, - {0x09, 0x01, 0xc0, 0xc0, "1 Coin 50 Credits" }, - {0x09, 0x01, 0xc0, 0x80, "1 Coin 100 Credits" }, - {0x09, 0x01, 0xc0, 0x40, "1 Coin 500 Credits" }, - {0x09, 0x01, 0xc0, 0x00, "1 Coin 1000 Credits" }, - - {0x0a, 0xfe, 0, 2, "Service Mode" }, - {0x0a, 0x01, 0x01, 0x01, "Off" }, - {0x0a, 0x01, 0x01, 0x00, "On" }, - - {0x0a, 0xfe, 0, 2, "Winnings" }, - {0x0a, 0x01, 0x04, 0x04, "Medals and Credits" }, - {0x0a, 0x01, 0x04, 0x00, "Credits only" }, - - {0x0a, 0xfe, 0, 4, "Medals Table" }, - {0x0a, 0x01, 0x18, 0x18, "x1.0" }, - {0x0a, 0x01, 0x18, 0x10, "x1.4" }, - {0x0a, 0x01, 0x18, 0x08, "x2.0" }, - {0x0a, 0x01, 0x18, 0x00, "x3.0" }, - - {0x0a, 0xfe, 0, 8, "Payout %" }, - {0x0a, 0x01, 0xe0, 0xe0, "90%" }, - {0x0a, 0x01, 0xe0, 0xc0, "85%" }, - {0x0a, 0x01, 0xe0, 0xa0, "80%" }, - {0x0a, 0x01, 0xe0, 0x80, "75%" }, - {0x0a, 0x01, 0xe0, 0x60, "70%" }, - {0x0a, 0x01, 0xe0, 0x40, "65%" }, - {0x0a, 0x01, 0xe0, 0x20, "60%" }, - {0x0a, 0x01, 0xe0, 0x00, "55%" }, -}; - -STDDIPINFO(Ordi7) - -static struct BurnDIPInfo WondstckDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xfd, NULL }, - - {0x10, 0xfe, 0, 2, "Helps" }, - {0x10, 0x01, 0x10, 0x10, "3" }, - {0x10, 0x01, 0x10, 0x00, "5" }, - - {0x10, 0xfe, 0, 2, "Lives" }, - {0x10, 0x01, 0x20, 0x20, "3" }, - {0x10, 0x01, 0x20, 0x00, "5" }, - - {0x10, 0xfe, 0, 4, "Coinage" }, - {0x10, 0x01, 0xc0, 0x00, "3C 1C" }, - {0x10, 0x01, 0xc0, 0x40, "2C 1C" }, - {0x10, 0x01, 0xc0, 0xc0, "1C 1C" }, - {0x10, 0x01, 0xc0, 0x80, "1C 2C" }, - - {0x11, 0xfe, 0, 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0x11, 0xfe, 0, 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0x11, 0xfe, 0, 4, "Difficulty" }, - {0x11, 0x01, 0xc0, 0x80, "Easy" }, - {0x11, 0x01, 0xc0, 0xc0, "Normal" }, - {0x11, 0x01, 0xc0, 0x40, "Hard" }, - {0x11, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Wondstck) - -//----------------------------------------------------------------------------------------------- - -static void palette_write(INT32 offset) -{ - INT32 data = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (data >> 0) & 0x1f; - INT32 g = (data >> 5) & 0x1f; - INT32 b = (data >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - Palette[offset>>1] = (r << 16) | (g << 8) | b; - DrvPalette[offset>>1] = BurnHighCol(r, g, b, 0); -} - -void __fastcall nmg5_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffff800) == 0x140000) { - DrvPalRAM[address & 0x7ff] = data; - palette_write(address & 0x7ff); - return; - } - - switch (address) - { - case 0x180000: - case 0x180001: - soundlatch = data; - ZetNmi(); - return; - - case 0x180004: - case 0x180005: - input_data = data & 0xf; - return; - - case 0x180006: - case 0x180007: - gfx_bank = data & 3; - return; - - case 0x18000e: - case 0x18000f: - priority_reg = data & 7; - return; - - case 0x300002: - case 0x300003: - case 0x300004: - case 0x300005: - case 0x300006: - case 0x300007: - case 0x300008: - case 0x300009: - *((UINT8*)(DrvScrRAM + ((address - 2) & 7))) = data; - return; - } - - return; -} - -void __fastcall nmg5_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff800) == 0x140000) { - *((UINT16*)(DrvPalRAM + (address & 0x7ff))) = data; - palette_write(address & 0x7ff); - return; - } - - switch (address) - { - case 0x180000: - soundlatch = data; - ZetNmi(); - return; - - case 0x180004: - input_data = data & 0xf; - return; - - case 0x180006: - gfx_bank = data & 3; - return; - - case 0x18000e: - priority_reg = data & 7; - return; - - case 0x300002: - case 0x300004: - case 0x300006: - case 0x300008: - DrvScrRAM[(address - 0x300002) >> 1] = data & 0x1ff; - return; - } - - return; -} - -UINT8 __fastcall nmg5_read_byte(UINT32 address) -{ - switch (address) - { - case 0x180004: - case 0x180005: - return prot_val | input_data; - - case 0x180008: - return DrvInputs[0] >> 8; - - case 0x180009: - return DrvInputs[0]; - - case 0x18000a: - return DrvInputs[1] >> 8; - - case 0x18000b: - return DrvInputs[1] & ~0x50; - - case 0x18000c: - return DrvInputs[2] >> 8; - - case 0x18000d: - return DrvInputs[2]; - } - - return 0; -} - -UINT16 __fastcall nmg5_read_word(UINT32 address) -{ - switch (address) - { - case 0x180004: - return prot_val | input_data; - - case 0x180008: - return DrvInputs[0]; - - case 0x18000a: - return DrvInputs[1] & ~0x50; - - case 0x18000c: - return DrvInputs[2]; - } - - return 0; -} - -//----------------------------------------------------------------------------------------------- - -void __fastcall pclubys_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffff800) == 0x440000) { - DrvPalRAM[address & 0x7ff] = data; - palette_write(address & 0x7ff); - return; - } - - switch (address) - { - case 0x480000: - case 0x480001: - soundlatch = data; - ZetNmi(); - return; - - case 0x480004: - case 0x480005: - input_data = data & 0xf; - return; - - case 0x480006: - case 0x480007: - gfx_bank = data & 3; - return; - - case 0x48000e: - case 0x48000f: - priority_reg = data & 7; - return; - - case 0x500002: - case 0x500003: - case 0x500004: - case 0x500005: - case 0x500006: - case 0x500007: - case 0x500008: - case 0x500009: - *((UINT8*)(DrvScrRAM + ((address - 0x500002) & 7))) = data; - return; - } - - return; -} - -void __fastcall pclubys_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff800) == 0x440000) { - *((UINT16*)(DrvPalRAM + (address & 0x7ff))) = data; - palette_write(address & 0x7ff); - return; - } - - switch (address) - { - case 0x480000: - soundlatch = data; - ZetNmi(); - return; - - case 0x480004: - input_data = data & 0xf; - return; - - case 0x480006: - gfx_bank = data & 3; - return; - - case 0x48000e: - priority_reg = data & 7; - return; - - case 0x500002: - case 0x500004: - case 0x500006: - case 0x500008: - DrvScrRAM[(address - 0x500002) >> 1] = data; - return; - } - - return; -} - -UINT8 __fastcall pclubys_read_byte(UINT32 address) -{ - switch (address) - { - case 0x480004: - case 0x480005: - return prot_val | input_data; - - case 0x480008: - return DrvInputs[0] >> 8; - - case 0x480009: - return DrvInputs[0]; - - case 0x48000a: - return DrvInputs[1] >> 8; - - case 0x48000b: - return DrvInputs[1]; - - case 0x48000c: - return DrvInputs[2] >> 8; - - case 0x48000d: - return DrvInputs[2]; - } - - return 0; -} - -UINT16 __fastcall pclubys_read_word(UINT32 address) -{ - switch (address) - { - case 0x480004: - return prot_val | input_data; - - case 0x480008: - return DrvInputs[0]; - - case 0x48000a: - return DrvInputs[1]; - - case 0x48000c: - return DrvInputs[2]; - } - - return 0; -} - -//----------------------------------------------------------------------------------------------- - -void __fastcall nmg5_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - DrvOkiBank = data & 1; - MSM6295ROM = DrvSndROM + (DrvOkiBank ? 0x40000 : 0); - return; - - case 0x10: - BurnYM3812Write(0, 0, data); - return; - - case 0x11: - BurnYM3812Write(0, 1, data); - return; - - case 0x1c: - MSM6295Command(0, data); - return; - } - - return; -} - -UINT8 __fastcall nmg5_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x10: - return BurnYM3812Read(0, 0); - - case 0x18: - return soundlatch; - - case 0x1c: - return MSM6295ReadStatus(0); - } - - return 0; -} - -//----------------------------------------------------------------------------------------------- - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x0100000; - DrvZ80ROM = Next; Next += 0x0010000; - - DrvGfxROM0 = Next; Next += 0x1000000; - DrvGfxROM1 = Next; Next += 0x0400000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x0080000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x0010000; - DrvZ80RAM = Next; Next += 0x0000800; - - DrvPalRAM = Next; Next += 0x0000800; - - DrvSprRAM = Next; Next += 0x0000800; - - DrvVidRAM0 = Next; Next += 0x0002000; - DrvVidRAM1 = Next; Next += 0x0002000; - - DrvBmpRAM = Next; Next += 0x0010000; - - DrvScrRAM = (UINT16*)Next; Next += 0x0000004 * sizeof(UINT16); - - Palette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - priority_reg = 7; - - soundlatch = 0; - input_data = 0; - gfx_bank = 0; - DrvOkiBank = 0; - MSM6295ROM = DrvSndROM; - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM3812Reset(); - - return 0; -} - -static INT32 DrvGfxDecode(INT32 type) -{ - static INT32 Planes0[8] = { - 0x1C00000, 0x1800000, 0x1400000, 0x1000000, - 0x0c00000, 0x0800000, 0x0400000, 0x0000000 - }; - - static INT32 XOffs0[8] = { - 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007 - }; - - static INT32 YOffs0[8] = { - 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038 - }; - - static INT32 Planes0a[8] = { - 0x2000008, 0x4000000, 0x0000008, 0x0000000, - 0x6000008, 0x6000000, 0x4000008, 0x2000000 - }; - - static INT32 XOffs0a[8] = { - 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007 - }; - - static INT32 YOffs0a[8] = { - 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070 - }; - - static INT32 Planes1[5] = { - 0x0800000, 0x0c00000, 0x0400000, 0x1000000, 0x0000000 - }; - - static INT32 XOffs1[16] = { - 0x007, 0x006, 0x005, 0x004, 0x003, 0x002, 0x001, 0x000, - 0x087, 0x086, 0x085, 0x084, 0x083, 0x082, 0x081, 0x080 - }; - - static INT32 YOffs1[16] = { - 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038, - 0x040, 0x048, 0x050, 0x058, 0x060, 0x068, 0x070, 0x078 - }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x1000000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x1000000); - - if (type) { - GfxDecode(0x40000, 8, 8, 8, Planes0a, XOffs0a, YOffs0a, 0x080, tmp, DrvGfxROM0); - } else { - GfxDecode(0x10000, 8, 8, 8, Planes0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - } - - memcpy (tmp, DrvGfxROM1, 0x400000); - - GfxDecode(0x04000, 5, 16, 16, Planes1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvInit(INT32 loadtype, INT32 sektype, INT32 zettype) // 0 nmg, 1 pclubys -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (loadtype) { - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM0 + i * 0x400000, i + 3, 1)) return 1; - } - - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x080000, i + 7, 1)) return 1; - } - - if (BurnLoadRom(DrvSndROM, 12, 1)) return 1; - } else { - for (INT32 i = 0; i < 8; i++) { - if (BurnLoadRom(DrvGfxROM0 + i * 0x80000, i + 3, 1)) return 1; - } - - for (INT32 i = 0; i < 5; i++) { - if (BurnLoadRom(DrvGfxROM1 + i * 0x80000, i + 11, 1)) return 1; - } - - if (BurnLoadRom(DrvSndROM, 16, 1)) return 1; - } - - DrvGfxDecode(loadtype); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvBmpRAM, 0x800000, 0x80ffff, MAP_RAM); - if (sektype) { - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x440000, 0x4407ff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x460000, 0x4607ff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x520000, 0x521fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x522000, 0x523fff, MAP_RAM); - SekSetWriteByteHandler(0, pclubys_write_byte); - SekSetWriteWordHandler(0, pclubys_write_word); - SekSetReadByteHandler(0, pclubys_read_byte); - SekSetReadWordHandler(0, pclubys_read_word); - } else { - SekMapMemory(Drv68KRAM, 0x120000, 0x12ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x140000, 0x1407ff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x160000, 0x1607ff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x320000, 0x321fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x322000, 0x323fff, MAP_RAM); - SekSetWriteByteHandler(0, nmg5_write_byte); - SekSetWriteWordHandler(0, nmg5_write_word); - SekSetReadByteHandler(0, nmg5_read_byte); - SekSetReadWordHandler(0, nmg5_read_word); - } - SekClose(); - - ZetInit(0); - ZetOpen(0); - if (zettype) { - ZetMapArea(0x0000, 0xf7ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xf7ff, 2, DrvZ80ROM); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM); - } else { - ZetMapArea(0x0000, 0xdfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xdfff, 2, DrvZ80ROM); - ZetMapArea(0xe000, 0xe7ff, 0, DrvZ80RAM); - ZetMapArea(0xe000, 0xe7ff, 1, DrvZ80RAM); - ZetMapArea(0xe000, 0xe7ff, 2, DrvZ80RAM); - } - ZetSetInHandler(nmg5_read_port); - ZetSetOutHandler(nmg5_write_port); - ZetClose(); - - BurnYM3812Init(1, 4000000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - MSM6295Exit(0); - BurnYM3812Exit(); - - GenericTilesExit(); - ZetExit(); - SekExit(); - - BurnFree (AllMem); - - return 0; -} - -//----------------------------------------------------------------------------------------------- - -static void draw_bitmap() -{ - UINT16 x,y,count; - INT32 pix; - - UINT16 *bitmap = (UINT16*)DrvBmpRAM; - - for (y = 0, count = 0; y < 256; y++) - { - for(x = 0; x < 128; x++, count++) - { - if (!bitmap[count]) continue; - - INT32 ofst = ((y - 9) * nScreenWidth) + ((x << 2) - 12); - - pix = bitmap[count] >> 12; - if (pix) pTransDraw[ofst ] = pix | 0x300; - - pix = (bitmap[count]&0x0f00)>>8; - if (pix) pTransDraw[ofst | 1] = pix | 0x300; - - pix = (bitmap[count]&0x00f0)>>4; - if (pix) pTransDraw[ofst | 2] = pix | 0x300; - - pix = bitmap[count] & 0x000f; - if (pix) pTransDraw[ofst | 3] = pix | 0x300; - } - } -} - -static void DrawTiles(UINT8 *vidram, INT32 color, INT32 transp, INT32 scrollx, INT32 scrolly) -{ - UINT16 *vram = (UINT16*)vidram; - - for (INT32 offs = 0; offs < 0x2000 / 2; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - INT32 code = vram[offs] | (gfx_bank << 16); - - sx -= scrollx; - sy -= scrolly; - if (sx < -7) sx += 0x200; - if (sy < -7) sy += 0x200; - - if (transp) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 8, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 8, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0;offs < 0x800/2;offs += 4) - { - INT32 sx = spriteram16[offs + 2] & 0x1ff; - INT32 sy = spriteram16[offs]; - INT32 code = spriteram16[offs + 1]; - INT32 color = (spriteram16[offs + 2] >> 9) & 0xf; - INT32 height = 1 << ((sy & 0x0600) >> 9); - INT32 flipx = sy & 0x2000; - INT32 flipy = sy & 0x4000; - - for (INT32 y = 0;y < height;y++) - { - INT32 yy = 248 - ((sy + ((height - y) << 4)) & 0x1ff); - - INT32 tile = code + (flipy ? height-1-y : y); - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, tile, sx, yy, color, 5, 0, 0x200, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, tile, sx, yy, color, 5, 0, 0x200, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, tile, sx, yy, color, 5, 0, 0x200, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, tile, sx, yy, color, 5, 0, 0x200, DrvGfxROM1); - } - } - - if (sx < 0x1f1) continue; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, tile, sx - 512, yy, color, 5, 0, 0x200, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, tile, sx - 512, yy, color, 5, 0, 0x200, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, tile, sx - 512, yy, color, 5, 0, 0x200, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, tile, sx - 512, yy, color, 5, 0, 0x200, DrvGfxROM1); - } - } - } - } -} - - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - } - - DrawTiles(DrvVidRAM0, 1, 0, DrvScrRAM[2]+3, DrvScrRAM[3]+9); - - if(priority_reg == 0) - { - draw_sprites(); - DrawTiles(DrvVidRAM1, 0, 1, DrvScrRAM[0]-1, DrvScrRAM[1]+9); - draw_bitmap(); - } - else if(priority_reg == 1) - { - draw_bitmap(); - draw_sprites(); - DrawTiles(DrvVidRAM1, 0, 1, DrvScrRAM[0]-1, DrvScrRAM[1]+9); - } - else if(priority_reg == 2) - { - draw_sprites(); - draw_bitmap(); - DrawTiles(DrvVidRAM1, 0, 1, DrvScrRAM[0]-1, DrvScrRAM[1]+9); - } - else if(priority_reg == 3) - { - DrawTiles(DrvVidRAM1, 0, 1, DrvScrRAM[0]-1, DrvScrRAM[1]+9); - draw_sprites(); - draw_bitmap(); - } - else if(priority_reg == 7) - { - DrawTiles(DrvVidRAM1, 0, 1, DrvScrRAM[0]-1, DrvScrRAM[1]+9); - draw_bitmap(); - draw_sprites(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - - - -static INT32 DrvFrame() -{ - INT32 nTotalCycles[2] = { 16000000 / 60, 4000000 / 60 }; - - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 6); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - - DrvInputs[0] = (DrvDips[1] << 8) | DrvDips[0]; - } - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekRun(nTotalCycles[0]); - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - BurnTimerEndFrameYM3812(nTotalCycles[1]); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -//----------------------------------------------------------------------------------------------- - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029692; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); -// BurnTimerScan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(prot_val); - SCAN_VAR(input_data); - SCAN_VAR(priority_reg); - SCAN_VAR(gfx_bank); - SCAN_VAR(DrvOkiBank); - } - - if (nAction & ACB_WRITE) { - nmg5_write_port(0, DrvOkiBank); - } - - return 0; -} - -//----------------------------------------------------------------------------------------------- - -// Multi 5 / New Multi Game 5 (set 1) - -static struct BurnRomInfo nmg5RomDesc[] = { - { "ub15.bin", 0x80000, 0x36af3e2f, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "ub16.bin", 0x80000, 0x2d9923d4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "xh15.bin", 0x10000, 0x12d047c4, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "srom1.bin", 0x80000, 0x6771b694, 3 | BRF_GRA }, // 3 - Tiles - { "srom2.bin", 0x80000, 0x362d33af, 3 | BRF_GRA }, // 4 - { "srom3.bin", 0x80000, 0x8bad69d1, 3 | BRF_GRA }, // 5 - { "srom4.bin", 0x80000, 0xe73a7fcb, 3 | BRF_GRA }, // 6 - { "srom5.bin", 0x80000, 0x7300494e, 3 | BRF_GRA }, // 7 - { "srom6.bin", 0x80000, 0x74b5fdf9, 3 | BRF_GRA }, // 8 - { "srom7.bin", 0x80000, 0xbd2b9036, 3 | BRF_GRA }, // 9 - { "srom8.bin", 0x80000, 0xdd38360e, 3 | BRF_GRA }, // 10 - - { "uf1.bin", 0x40000, 0x9a9fb6f4, 4 | BRF_GRA }, // 11 - Sprites - { "uf2.bin", 0x40000, 0x66954d63, 4 | BRF_GRA }, // 12 - { "ufa1.bin", 0x40000, 0xba73ed2d, 4 | BRF_GRA }, // 13 - { "uh1.bin", 0x40000, 0xf7726e8e, 4 | BRF_GRA }, // 14 - { "uj1.bin", 0x40000, 0x54f7486e, 4 | BRF_GRA }, // 15 - - { "xra1.bin", 0x20000, 0xc74a4f3e, 5 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(nmg5) -STD_ROM_FN(nmg5) - -static INT32 Nmg5Init() -{ - prot_val = 0x10; - - return DrvInit(0,0,0); -} - -struct BurnDriver BurnDrvNmg5 = { - "nmg5", NULL, NULL, NULL, "1998", - "Multi 5 / New Multi Game 5 (set 1)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, nmg5RomInfo, nmg5RomName, NULL, NULL, Nmg5InputInfo, Nmg5DIPInfo, - Nmg5Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Multi 5 / New Multi Game 5 (set 2) - -static struct BurnRomInfo nmg5aRomDesc[] = { - { "m5_p1.ub15", 0x80000, 0x0d63a21d, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "m5_p2.ub16", 0x80000, 0x230438db, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "m5_sndcpu.xh15", 0x10000, 0x12d047c4, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "m5_12.srom1", 0x80000, 0x3adff261, 3 | BRF_GRA }, // 3 - Tiles - { "m5_8.srom2", 0x80000, 0xb0736b66, 3 | BRF_GRA }, // 4 - { "m5_13.srom3", 0x80000, 0x8e904919, 3 | BRF_GRA }, // 5 - { "m5_9.srom4", 0x80000, 0x779e0e30, 3 | BRF_GRA }, // 6 - { "m5_6.srom5", 0x80000, 0x41061258, 3 | BRF_GRA }, // 7 - { "m5_10.srom6", 0x80000, 0x8147d8ef, 3 | BRF_GRA }, // 8 - { "m5_7.srom7", 0x80000, 0xacb00d15, 3 | BRF_GRA }, // 9 - { "m5_11.srom8", 0x80000, 0x0ba74fce, 3 | BRF_GRA }, // 10 - - { "m5_3.uf1", 0x40000, 0x9a9fb6f4, 4 | BRF_GRA }, // 11 - Sprites - { "m5_5.uf2", 0x40000, 0x66954d63, 4 | BRF_GRA }, // 12 - { "m5_1.ufa1", 0x40000, 0xba73ed2d, 4 | BRF_GRA }, // 13 - { "m5_4.uh1", 0x40000, 0xf7726e8e, 4 | BRF_GRA }, // 14 - { "m5_2.uj1", 0x40000, 0x54f7486e, 4 | BRF_GRA }, // 15 - - { "m5_oki.xra1", 0x20000, 0xc74a4f3e, 5 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(nmg5a) -STD_ROM_FN(nmg5a) - -struct BurnDriver BurnDrvNmg5a = { - "nmg5a", "nmg5", NULL, NULL, "1997", - "Multi 5 / New Multi Game 5 (set 2)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, nmg5aRomInfo, nmg5aRomName, NULL, NULL, Nmg5InputInfo, Nmg5DIPInfo, - Nmg5Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Multi 5 / New Multi Game 5 (set 3, earlier) - -static struct BurnRomInfo nmg5eRomDesc[] = { - { "ub15.rom", 0x80000, 0x578516e2, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "ub16.rom", 0x80000, 0x12fab483, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "xh15.bin", 0x10000, 0x12d047c4, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "srom1.rom", 0x80000, 0x6df3e0c2, 3 | BRF_GRA }, // 3 - Tiles - { "srom2.rom", 0x80000, 0x3caf65f9, 3 | BRF_GRA }, // 4 - { "srom3.rom", 0x80000, 0x812f3f87, 3 | BRF_GRA }, // 5 - { "srom4.rom", 0x80000, 0xedb8299d, 3 | BRF_GRA }, // 6 - { "srom5.rom", 0x80000, 0x79821f18, 3 | BRF_GRA }, // 7 - { "srom6.rom", 0x80000, 0x7e37abaf, 3 | BRF_GRA }, // 8 - { "srom7.rom", 0x80000, 0xb7a9c660, 3 | BRF_GRA }, // 9 - { "srom8.rom", 0x80000, 0xd7ba6058, 3 | BRF_GRA }, // 10 - - { "uf1.rom", 0x40000, 0x502dbd65, 4 | BRF_GRA }, // 11 - Sprites - { "uf2.rom", 0x40000, 0x6744cca0, 4 | BRF_GRA }, // 12 - { "ufa1.rom", 0x40000, 0x7110677f, 4 | BRF_GRA }, // 13 - { "uh1.rom", 0x40000, 0xf6a3ef4d, 4 | BRF_GRA }, // 14 - { "uj1.rom", 0x40000, 0x0595d8ef, 4 | BRF_GRA }, // 15 - - { "xra1.bin", 0x20000, 0xc74a4f3e, 5 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(nmg5e) -STD_ROM_FN(nmg5e) - -struct BurnDriver BurnDrvNmg5e = { - "nmg5e", "nmg5", NULL, NULL, "1997", - "Multi 5 / New Multi Game 5 (set 3, earlier)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, nmg5eRomInfo, nmg5eRomName, NULL, NULL, Nmg5InputInfo, Nmg5DIPInfo, - Nmg5Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Search Eye (English / Korean / Japanese / Italian) - -static struct BurnRomInfo searcheyRomDesc[] = { - { "se.u7", 0x40000, 0x332b0d83, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "se.u2", 0x40000, 0xbd16114e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u128.bin", 0x10000, 0x85bae10c, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "u63.bin", 0x80000, 0x1b0b7b7d, 3 | BRF_GRA }, // 3 - Tiles - { "u68.bin", 0x80000, 0xae18b2aa, 3 | BRF_GRA }, // 4 - { "u73.bin", 0x80000, 0xab7f8716, 3 | BRF_GRA }, // 5 - { "u79.bin", 0x80000, 0x7f2c8b83, 3 | BRF_GRA }, // 6 - { "se.u64", 0x80000, 0x32b7e4f3, 3 | BRF_GRA }, // 7 - { "u69.bin", 0x80000, 0xd546eaf8, 3 | BRF_GRA }, // 8 - { "u74.bin", 0x80000, 0xe6134d84, 3 | BRF_GRA }, // 9 - { "u80.bin", 0x80000, 0x9a160918, 3 | BRF_GRA }, // 10 - - { "u83.bin", 0x20000, 0xc5a1c647, 4 | BRF_GRA }, // 11 - Sprites - { "u82.bin", 0x20000, 0x25b2ae62, 4 | BRF_GRA }, // 12 - { "u105.bin", 0x20000, 0xb4207ef0, 4 | BRF_GRA }, // 13 - { "u96.bin", 0x20000, 0x8c40818a, 4 | BRF_GRA }, // 14 - { "u97.bin", 0x20000, 0x5dc7f231, 4 | BRF_GRA }, // 15 - - { "u137.bin", 0x40000, 0x49105e23, 5 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(searchey) -STD_ROM_FN(searchey) - -struct BurnDriver BurnDrvSearchey = { - "searchey", NULL, NULL, NULL, "1999", - "Search Eye (English / Korean / Japanese / Italian)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, searcheyRomInfo, searcheyRomName, NULL, NULL, SearcheyInputInfo, SearcheyDIPInfo, - Nmg5Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Search Eye (English / Korean) - -static struct BurnRomInfo searcheyaRomDesc[] = { - { "u7.bin", 0x40000, 0x287ce3dd, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "u2.bin", 0x40000, 0xb574f033, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u128.bin", 0x10000, 0x85bae10c, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "u63.bin", 0x80000, 0x1b0b7b7d, 3 | BRF_GRA }, // 3 - Tiles - { "u68.bin", 0x80000, 0xae18b2aa, 3 | BRF_GRA }, // 4 - { "u73.bin", 0x80000, 0xab7f8716, 3 | BRF_GRA }, // 5 - { "u79.bin", 0x80000, 0x7f2c8b83, 3 | BRF_GRA }, // 6 - { "u64.bin", 0x80000, 0x322a903c, 3 | BRF_GRA }, // 7 - { "u69.bin", 0x80000, 0xd546eaf8, 3 | BRF_GRA }, // 8 - { "u74.bin", 0x80000, 0xe6134d84, 3 | BRF_GRA }, // 9 - { "u80.bin", 0x80000, 0x9a160918, 3 | BRF_GRA }, // 10 - - { "u83.bin", 0x20000, 0xc5a1c647, 4 | BRF_GRA }, // 11 - Sprites - { "u82.bin", 0x20000, 0x25b2ae62, 4 | BRF_GRA }, // 12 - { "u105.bin", 0x20000, 0xb4207ef0, 4 | BRF_GRA }, // 13 - { "u96.bin", 0x20000, 0x8c40818a, 4 | BRF_GRA }, // 14 - { "u97.bin", 0x20000, 0x5dc7f231, 4 | BRF_GRA }, // 15 - - { "u137.bin", 0x40000, 0x49105e23, 5 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(searcheya) -STD_ROM_FN(searcheya) - -struct BurnDriver BurnDrvSearcheya = { - "searcheya", "searchey", NULL, NULL, "1999", - "Search Eye (English / Korean)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, searcheyaRomInfo, searcheyaRomName, NULL, NULL, SearcheyInputInfo, SearcheyaDIPInfo, - Nmg5Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Search Eye Plus V2.0 - -static struct BurnRomInfo searchp2RomDesc[] = { - { "u7", 0x080000, 0x37fe9e18, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "u2", 0x080000, 0x8278513b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u128", 0x010000, 0x85bae10c, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "0.u1", 0x400000, 0x28a50dcf, 3 | BRF_GRA }, // 3 - Tiles - { "2.u3", 0x400000, 0x30d46e19, 3 | BRF_GRA }, // 4 - { "1.u2", 0x400000, 0xf9c4e824, 3 | BRF_GRA }, // 5 - { "3.u4", 0x400000, 0x619f142f, 3 | BRF_GRA }, // 6 - - { "u83", 0x040000, 0x2bae34cb, 4 | BRF_GRA }, // 7 - Sprites - { "u82", 0x040000, 0x5cb773f0, 4 | BRF_GRA }, // 8 - { "u105", 0x040000, 0xe8adb15e, 4 | BRF_GRA }, // 9 - { "u96", 0x040000, 0x67efb536, 4 | BRF_GRA }, // 10 - { "u97", 0x040000, 0xf7b63826, 4 | BRF_GRA }, // 11 - - { "u137", 0x040000, 0xcd037524, 5 | BRF_SND }, // 12 - Samples -}; - -STD_ROM_PICK(searchp2) -STD_ROM_FN(searchp2) - -static INT32 Searchp2Init() -{ - prot_val = 0x10; - - BurnSetRefreshRate(55); - - return DrvInit(1,0,0); -} - -struct BurnDriver BurnDrvSearchp2 = { - "searchp2", NULL, NULL, NULL, "1999", - "Search Eye Plus V2.0\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, searchp2RomInfo, searchp2RomName, NULL, NULL, SearcheyInputInfo, Searchp2DIPInfo, - Searchp2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Puzzle Club (Yun Sung, set 1) - -static struct BurnRomInfo pclubysRomDesc[] = { - { "rom3.7", 0x080000, 0x62e28e6d, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "rom4.2", 0x080000, 0xb51dab41, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "rom1.128", 0x010000, 0x25cd27f8, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "rom10.167", 0x400000, 0xd67e8e84, 3 | BRF_GRA }, // 3 - Tiles - { "rom12.165", 0x400000, 0x6be8b733, 3 | BRF_GRA }, // 4 - { "rom11.166", 0x400000, 0x672501a4, 3 | BRF_GRA }, // 5 - { "rom13.164", 0x400000, 0xfc725ce7, 3 | BRF_GRA }, // 6 - - { "rom8.83", 0x080000, 0x651af101, 4 | BRF_GRA }, // 7 - Sprites - { "rom9.82", 0x080000, 0x2535b4d6, 4 | BRF_GRA }, // 8 - { "rom7.105", 0x080000, 0xf7536c52, 4 | BRF_GRA }, // 9 - { "rom6.95", 0x080000, 0x3c078a52, 4 | BRF_GRA }, // 10 - { "rom5.97", 0x080000, 0x20eae2f8, 4 | BRF_GRA }, // 11 - - { "rom2.137", 0x080000, 0x4ff97ad1, 4 | BRF_SND }, // 12 - Samples -}; - -STD_ROM_PICK(pclubys) -STD_ROM_FN(pclubys) - -static INT32 PclubysInit() -{ - prot_val = 0x10; - - return DrvInit(1,1,1); -} - -struct BurnDriver BurnDrvPclubys = { - "pclubys", NULL, NULL, NULL, "2000", - "Puzzle Club (Yun Sung, set 1)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, pclubysRomInfo, pclubysRomName, NULL, NULL, PclubysInputInfo, PclubysDIPInfo, - PclubysInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Puzzle Club (Yun Sung, set 2) - -static struct BurnRomInfo pclubysaRomDesc[] = { - { "rom3a.7", 0x080000, 0x885aa07a, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "rom4a.2", 0x080000, 0x9bfbdeac, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "rom1.128", 0x010000, 0x25cd27f8, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "rom10.167", 0x400000, 0xd67e8e84, 3 | BRF_GRA }, // 3 - Tiles - { "rom12.165", 0x400000, 0x6be8b733, 3 | BRF_GRA }, // 4 - { "rom11.166", 0x400000, 0x672501a4, 3 | BRF_GRA }, // 5 - { "rom13.164", 0x400000, 0xfc725ce7, 3 | BRF_GRA }, // 6 - - { "rom8.83", 0x080000, 0x651af101, 4 | BRF_GRA }, // 7 - Sprites - { "rom9.82", 0x080000, 0x2535b4d6, 4 | BRF_GRA }, // 8 - { "rom7.105", 0x080000, 0xf7536c52, 4 | BRF_GRA }, // 9 - { "rom6.95", 0x080000, 0x3c078a52, 4 | BRF_GRA }, // 10 - { "rom5.97", 0x080000, 0x20eae2f8, 4 | BRF_GRA }, // 11 - - { "rom2.137", 0x080000, 0x4ff97ad1, 4 | BRF_SND }, // 12 - Samples -}; - -STD_ROM_PICK(pclubysa) -STD_ROM_FN(pclubysa) - -struct BurnDriver BurnDrvPclubysa = { - "pclubysa", "pclubys", NULL, NULL, "2000", - "Puzzle Club (Yun Sung, set 2)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, pclubysaRomInfo, pclubysaRomName, NULL, NULL, PclubysInputInfo, PclubysDIPInfo, - PclubysInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Garogun Seroyang (Korea) - -static struct BurnRomInfo garogunRomDesc[] = { - { "p1.u7", 0x80000, 0x9b5627f8, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "p2.u2", 0x80000, 0x1d2ff271, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "rom.u128", 0x10000, 0x117b31ce, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "8.u63", 0x80000, 0x2d152d32, 3 | BRF_GRA }, // 3 - Tiles - { "11.u68", 0x80000, 0x60ec7f67, 3 | BRF_GRA }, // 4 - { "9.u73", 0x80000, 0xa4b16319, 3 | BRF_GRA }, // 5 - { "13.u79", 0x80000, 0x2dc14fb6, 3 | BRF_GRA }, // 6 - { "6.u64", 0x80000, 0xa0fc7547, 3 | BRF_GRA }, // 7 - { "10.u69", 0x80000, 0xe5dc36c3, 3 | BRF_GRA }, // 8 - { "7.u74", 0x80000, 0xa0574f8d, 3 | BRF_GRA }, // 9 - { "12.u80", 0x80000, 0x94d66169, 3 | BRF_GRA }, // 10 - - { "4.u83", 0x40000, 0x3d1d46ff, 4 | BRF_GRA }, // 11 - Sprites - { "5.u82", 0x40000, 0x2a7b2fb5, 4 | BRF_GRA }, // 12 - { "3.u105", 0x40000, 0xcd20e39c, 4 | BRF_GRA }, // 13 - { "2.u96", 0x40000, 0x4df3b502, 4 | BRF_GRA }, // 14 - { "1.u97", 0x40000, 0x591b3efe, 4 | BRF_GRA }, // 15 - - { "s.u137", 0x80000, 0x3eadc21a, 5 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(garogun) -STD_ROM_FN(garogun) - -static INT32 GarogunInit() -{ - prot_val = 0x40; - - return DrvInit(0,1,1); -} - -struct BurnDriver BurnDrvGarogun = { - "garogun", NULL, NULL, NULL, "2000", - "Garogun Seroyang (Korea)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, garogunRomInfo, garogunRomName, NULL, NULL, GarogunInputInfo, GarogunDIPInfo, - GarogunInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// 7 Ordi (Korea) - -static struct BurnRomInfo ordi7RomDesc[] = { - { "p1.u7", 0x20000, 0xebf21862, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "p2.u2", 0x20000, 0xf7943a6a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "4.u128", 0x10000, 0xed73b565, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "8.u63", 0x80000, 0xed8dfe5d, 3 | BRF_GRA }, // 3 - Tiles - { "11.u68", 0x80000, 0x742764a7, 3 | BRF_GRA }, // 4 - { "9.u73", 0x80000, 0x2b76efd0, 3 | BRF_GRA }, // 5 - { "13.u79", 0x80000, 0x3892b356, 3 | BRF_GRA }, // 6 - { "6.u64", 0x80000, 0x5c0b0838, 3 | BRF_GRA }, // 7 - { "10.u69", 0x80000, 0xc15db1a4, 3 | BRF_GRA }, // 8 - { "7.u74", 0x80000, 0x6910f754, 3 | BRF_GRA }, // 9 - { "12.u80", 0x80000, 0x4c5dd9ef, 3 | BRF_GRA }, // 10 - - { "4.u83", 0x80000, 0xa2569cf4, 4 | BRF_GRA }, // 11 - Sprites - { "5.u82", 0x80000, 0x045e548e, 4 | BRF_GRA }, // 12 - { "3.u105", 0x80000, 0x04c1dbf9, 4 | BRF_GRA }, // 13 - { "2.u96", 0x80000, 0x11fa7de8, 4 | BRF_GRA }, // 14 - { "1.u97", 0x80000, 0xcd1ffe88, 4 | BRF_GRA }, // 15 - - { "3.u137", 0x20000, 0x669ed310, 5 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(ordi7) -STD_ROM_FN(ordi7) - -static INT32 Ordi7Init() -{ - INT32 nRet; - - prot_val = 0x20; - - nRet = DrvInit(0,0,1); - - if (nRet == 0) { - memcpy (DrvSndROM + 0x20000, DrvSndROM, 0x20000); - memcpy (DrvSndROM + 0x40000, DrvSndROM, 0x20000); - memcpy (DrvSndROM + 0x50000, DrvSndROM, 0x20000); - } - - return nRet; -} - -struct BurnDriver BurnDrvOrdi7 = { - "7ordi", NULL, NULL, NULL, "2002", - "7 Ordi (Korea)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_MISC_POST90S, GBF_CASINO, 0, - NULL, ordi7RomInfo, ordi7RomName, NULL, NULL, Ordi7InputInfo, Ordi7DIPInfo, - Ordi7Init, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Wonder Stick (set 1) - -static struct BurnRomInfo wondstckRomDesc[] = { - { "u4.bin", 0x20000, 0x46a3e9f6, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "u2.bin", 0x20000, 0x9995b743, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u128.bin", 0x10000, 0x86dba085, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "u63.bin", 0x80000, 0xc6cf09b4, 3 | BRF_GRA }, // 3 - Tiles - { "u68.bin", 0x80000, 0x2e9e9a5e, 3 | BRF_GRA }, // 4 - { "u73.bin", 0x80000, 0x3a828604, 3 | BRF_GRA }, // 5 - { "u79.bin", 0x80000, 0x0cca46af, 3 | BRF_GRA }, // 6 - { "u64.bin", 0x80000, 0xdcec9ac5, 3 | BRF_GRA }, // 7 - { "u69.bin", 0x80000, 0x27b9d708, 3 | BRF_GRA }, // 8 - { "u74.bin", 0x80000, 0x7eff8e2f, 3 | BRF_GRA }, // 9 - { "u80.bin", 0x80000, 0x1160a0c2, 3 | BRF_GRA }, // 10 - - { "u83.bin", 0x80000, 0xf51cf9c6, 4 | BRF_GRA }, // 11 - Sprites - { "u82.bin", 0x80000, 0xddd3c60c, 4 | BRF_GRA }, // 12 - { "u105.bin", 0x80000, 0xa7fc624d, 4 | BRF_GRA }, // 13 - { "u96.bin", 0x80000, 0x2369d8a3, 4 | BRF_GRA }, // 14 - { "u97.bin", 0x80000, 0xaba1bd94, 4 | BRF_GRA }, // 15 - - { "u137.bin", 0x40000, 0x294b6cbd, 5 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(wondstck) -STD_ROM_FN(wondstck) - -static INT32 WondstckInit() -{ - prot_val = 0x00; - - return DrvInit(0,0,0); -} - -struct BurnDriver BurnDrvWondstck = { - "wondstck", NULL, NULL, NULL, "????", - "Wonder Stick (set 1)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, wondstckRomInfo, wondstckRomName, NULL, NULL, SearcheyInputInfo, WondstckDIPInfo, - WondstckInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; - - -// Wonder Stick (set 2, censored) - -static struct BurnRomInfo wondstckaRomDesc[] = { - { "3.u7", 0x20000, 0x5f1337d8, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "4.u2", 0x20000, 0x0b28ab9d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.u128", 0x10000, 0x86dba085, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "7.u63", 0x80000, 0x25ee44ce, 3 | BRF_GRA }, // 3 - Tiles - { "2.u68", 0x80000, 0xb26afb40, 3 | BRF_GRA }, // 4 - { "8.u73", 0x80000, 0x7cf46203, 3 | BRF_GRA }, // 5 - { "4.u79", 0x80000, 0x825213e0, 3 | BRF_GRA }, // 6 - { "5.u64", 0x80000, 0x9ece36d6, 3 | BRF_GRA }, // 7 - { "1.u69", 0x80000, 0xec091e87, 3 | BRF_GRA }, // 8 - { "6.u74", 0x80000, 0x9795ff80, 3 | BRF_GRA }, // 9 - { "3.u80", 0x80000, 0x553c5781, 3 | BRF_GRA }, // 10 - - { "8.u83", 0x80000, 0xf51cf9c6, 4 | BRF_GRA }, // 11 - Sprites -// { "9.u82", 0x80000, 0x8c6cff4d, 4 | BRF_GRA }, // 12 Bad dump - { "9.u82", 0x80000, 0xddd3c60c, 4 | BRF_GRA }, // 12 - { "7.u105", 0x80000, 0xa7fc624d, 4 | BRF_GRA }, // 13 - { "6.u96", 0x80000, 0x2369d8a3, 4 | BRF_GRA }, // 14 - { "5.u97", 0x80000, 0xaba1bd94, 4 | BRF_GRA }, // 15 - - { "2.u137", 0x40000, 0x294b6cbd, 5 | BRF_SND }, // 16 - Samples -}; - -STD_ROM_PICK(wondstcka) -STD_ROM_FN(wondstcka) - -struct BurnDriver BurnDrvWondstcka = { - "wondstcka", "wondstck", NULL, NULL, "????", - "Wonder Stick (set 2, censored)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, wondstckaRomInfo, wondstckaRomName, NULL, NULL, SearcheyInputInfo, WondstckDIPInfo, - WondstckInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - &DrvRecalc, 0x400, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_nmk16.cpp b/jan/src/burn/drv/pst90s/d_nmk16.cpp deleted file mode 100644 index fc5444477..000000000 --- a/jan/src/burn/drv/pst90s/d_nmk16.cpp +++ /dev/null @@ -1,10172 +0,0 @@ -// FB Alpha NMK16 driver module -// Based on MAME driver by Mirko Buffoni, Richard Bush, Nicola Salmoria, Bryan McPhail, David Haywood, and R. Belmont -// Also, a huge "thank you!" to JacKc for helping bug test - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "tlcs90_intf.h" -#include "seibusnd.h" -#include "bitswap.h" -#include "nmk112.h" -#include "nmk004.h" - -#if 0 - hachamf - needs some protection work -#endif - -static UINT8 *AllMem; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvTileROM; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvBgRAM0; -static UINT8 *DrvBgRAM1; -static UINT8 *DrvBgRAM2; -static UINT8 *DrvBgRAM3; -static UINT8 *DrvTxRAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvSprBuf2; -static UINT8 *DrvSprBuf3; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvScrollRAM; - -static UINT32 *DrvPalette; - -static UINT8 *soundlatch; -static UINT8 *soundlatch2; -static UINT8 *flipscreen; -static UINT8 *tilebank; -static UINT8 *okibank; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[3] = { 0, 0, 0 }; -static UINT8 LastFakeDip = 0xf7; -static UINT16 DrvInputs[3]; -static UINT8 DrvReset; - -static INT32 nGraphicsMask[3]; -static INT32 videoshift = 0; -static INT32 input_high[2] = { 0, 0 }; -static INT32 is_8bpp = 0; -static INT32 global_y_offset = 16; -static INT32 screen_flip_y = 0; -static UINT32 nNMK004CpuSpeed; -static INT32 nNMK004EnableIrq2; -static INT32 NMK004_enabled = 0; -static INT32 NMK112_enabled = 0; -static INT32 macross2_sound_enable; -static INT32 MSM6295x1_only = 0; -static INT32 MSM6295x2_only = 0; -static INT32 no_z80 = 0; -static INT32 AFEGA_SYS = 0; -static INT32 Tharriermode = 0; // use macross1/tharrier text draw & joy inputs -static INT32 Macrossmode = 0; // use macross1 text draw -static INT32 Strahlmode = 0; -static INT32 Tdragon2mode = 0; // use draw_sprites_tdragon2() -static INT32 GunnailMode = 0; -static INT32 TharrierShakey = 0; // kludge for shakey-ship on the end of level cutscene - -static INT32 mustang_bg_xscroll = 0; - -static struct BurnInputInfo CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common) - -static struct BurnInputInfo GunnailInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Gunnail) - -static struct BurnInputInfo TharrierInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 6, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 7, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 14, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 13, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 12, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 9, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 10, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tharrier) - -static struct BurnInputInfo ManyblocInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 6, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 15, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 8, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 14, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 13, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 12, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 9, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 10, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Manybloc) - -static struct BurnInputInfo SsmissinInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ssmissin) - -static struct BurnInputInfo Tdragon2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tdragon2) - -static struct BurnInputInfo AcrobatmInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Acrobatm) - -static struct BurnInputInfo DolmenInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Dolmen) - -static struct BurnDIPInfo RedhawkbDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0xc0, "1" }, - {0x12, 0x01, 0xc0, 0x40, "2" }, - {0x12, 0x01, 0xc0, 0x00, "3" }, - {0x12, 0x01, 0xc0, 0x80, "5" }, - -// {0 , 0xfe, 0 , 4, "Flip Screen" }, -// {0x13, 0x01, 0x03, 0x00, "Off" }, -// {0x13, 0x01, 0x03, 0x03, "On" }, -// {0x13, 0x01, 0x03, 0x01, "Horizontally" }, -// {0x13, 0x01, 0x03, 0x02, "Vertically" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x10, "Easy" }, - {0x13, 0x01, 0x18, 0x00, "Normal" }, - {0x13, 0x01, 0x18, 0x08, "Hard" }, - {0x13, 0x01, 0x18, 0x18, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0xe0, 0xe0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xe0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Redhawkb) - -static struct BurnDIPInfo RapheroDIPList[]= -{ - {0x14, 0xff, 0xff, 0xfd, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x14, 0x01, 0x02, 0x02, "Japanese" }, - {0x14, 0x01, 0x02, 0x00, "English" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x10, "Easy" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - {0x14, 0x01, 0x30, 0x20, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0xc0, 0x00, "1" }, - {0x14, 0x01, 0xc0, 0x40, "2" }, - {0x14, 0x01, 0xc0, 0xc0, "3" }, - {0x14, 0x01, 0xc0, 0x80, "4" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x15, 0x01, 0x01, 0x01, "Off" }, -// {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xe0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Raphero) - -static struct BurnDIPInfo BioshipDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x01, 0x01, "Off" }, -// {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x06, 0x00, "Easy" }, - {0x12, 0x01, 0x06, 0x06, "Normal" }, - {0x12, 0x01, 0x06, 0x02, "Hard" }, - {0x12, 0x01, 0x06, 0x04, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, - {0x12, 0x01, 0xc0, 0x40, "5" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x1c, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0xe0, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Bioship) - -static struct BurnDIPInfo StrahlDIPList[]= -{ - {0x12, 0xff, 0xff, 0x7f, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x40, 0x40, "Off" }, -// {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x60, 0x40, "100k and every 200k" }, - {0x13, 0x01, 0x60, 0x60, "200k and every 200k" }, - {0x13, 0x01, 0x60, 0x20, "300k and every 300k" }, - {0x13, 0x01, 0x60, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Strahl) - -static struct BurnDIPInfo HachamfDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x13, 0x01, 0x01, 0x01, "Off" }, -// {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x13, 0x01, 0x02, 0x00, "English" }, - {0x13, 0x01, 0x02, 0x02, "Japanese" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x04, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x08, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0xc0, 0x00, "1" }, - {0x13, 0x01, 0xc0, 0x40, "2" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x80, "4" }, -}; - -STDDIPINFO(Hachamf) - -static struct BurnDIPInfo HachamfbDIPList[]= -{ - {0x12, 0xff, 0xff, 0xfd, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x12, 0x01, 0x02, 0x00, "English" }, - {0x12, 0x01, 0x02, 0x02, "Japanese" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x04, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x08, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x40, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, -}; - -STDDIPINFO(Hachamfb) - -static struct BurnDIPInfo VandykeDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x12, 0x01, 0x01, 0x00, "2" }, - {0x12, 0x01, 0x01, 0x01, "3" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0xc0, 0x00, "Easy" }, - {0x12, 0x01, 0xc0, 0xc0, "Normal" }, - {0x12, 0x01, 0xc0, 0x40, "Hard" }, - {0x12, 0x01, 0xc0, 0x80, "Hardest" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x13, 0x01, 0x01, 0x01, "Off" }, -// {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x1c, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0xe0, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Vandyke) - - -static struct BurnDIPInfo BlkheartDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x01, 0x01, "Off" }, -// {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x0c, "Easy" }, - {0x12, 0x01, 0x0c, 0x08, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x40, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, - {0x12, 0x01, 0xc0, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xe0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Blkheart) - -static struct BurnDIPInfo MacrossDIPList[]= -{ - {0x12, 0xff, 0xff, 0xf7, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x04, 0x04, "Off" }, -// {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x12, 0x01, 0x08, 0x00, "English" }, - {0x12, 0x01, 0x08, 0x08, "Japanese" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x10, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x40, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x13, 0x01, 0x0f, 0x04, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "5 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x02, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "3 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0xf0, 0x40, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "3 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Macross) - -static struct BurnDIPInfo TharrierDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xe0, 0x00, "Free Play" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x14, 0x01, 0x01, 0x01, "Upright" }, -// {0x14, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x04, "Easy" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x08, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "200k" }, - {0x14, 0x01, 0x30, 0x20, "200k and 1 Mil" }, - {0x14, 0x01, 0x30, 0x00, "200k, 500k & 1,2,3,5 Mil" }, - {0x14, 0x01, 0x30, 0x10, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0xc0, 0x40, "2" }, - {0x14, 0x01, 0xc0, 0xc0, "3" }, - {0x14, 0x01, 0xc0, 0x80, "4" }, - {0x14, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Tharrier) - -static struct BurnDIPInfo ManyblocDIPList[]= -{ - {0x11, 0xff, 0xff, 0x18, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Slot System" }, - {0x11, 0x01, 0x01, 0x00, "Off" }, - {0x11, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Explanation" }, - {0x11, 0x01, 0x02, 0x00, "English" }, - {0x11, 0x01, 0x02, 0x02, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x08, 0x08, "Upright" }, - {0x11, 0x01, 0x08, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x60, 0x60, "Easy" }, - {0x11, 0x01, 0x60, 0x00, "Normal" }, - {0x11, 0x01, 0x60, 0x20, "Hard" }, - {0x11, 0x01, 0x60, 0x40, "Hardest" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x11, 0x01, 0x80, 0x00, "Off" }, -// {0x11, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x38, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Plate Probability" }, - {0x12, 0x01, 0xc0, 0xc0, "Bad" }, - {0x12, 0x01, 0xc0, 0x00, "Normal" }, - {0x12, 0x01, 0xc0, 0x40, "Better" }, - {0x12, 0x01, 0xc0, 0x80, "Best" }, -}; - -STDDIPINFO(Manybloc) - -static struct BurnDIPInfo SsmissinDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x11, 0x01, 0x01, 0x01, "Off" }, -// {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x0c, 0x04, "Easy" }, - {0x11, 0x01, 0x0c, 0x0c, "Normal" }, - {0x11, 0x01, 0x0c, 0x08, "Hard" }, - {0x11, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0x00, "1" }, - {0x11, 0x01, 0xc0, 0x40, "2" }, - {0x11, 0x01, 0xc0, 0xc0, "3" }, - {0x11, 0x01, 0xc0, 0x80, "4" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xe0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Ssmissin) - -static struct BurnDIPInfo Macross2DIPList[]= -{ - {0x12, 0xff, 0xff, 0xf7, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x04, 0x04, "Off" }, -// {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x12, 0x01, 0x08, 0x00, "English" }, - {0x12, 0x01, 0x08, 0x08, "Japanese" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x10, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x13, 0x01, 0x0f, 0x04, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "5 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x02, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "3 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0xf0, 0x40, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "3 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Macross2) - -static struct BurnDIPInfo Tdragon2DIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x00, "Off" }, - {0x14, 0x01, 0x02, 0x02, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x04, 0x04, "Off" }, -// {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x10, "Easy" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - {0x14, 0x01, 0x30, 0x20, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0xc0, 0x00, "1" }, - {0x14, 0x01, 0xc0, 0x40, "2" }, - {0x14, 0x01, 0xc0, 0xc0, "3" }, - {0x14, 0x01, 0xc0, 0x80, "4" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x15, 0x01, 0x0f, 0x04, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x01, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x00, "5 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x02, "3 Coins 2 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "4 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "3 Coins 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x07, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x15, 0x01, 0xf0, 0x40, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x20, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "4 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "3 Coins 4 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Tdragon2) - -static struct BurnDIPInfo Stagger1DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x80, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x40, "5" }, - -// {0 , 0xfe, 0 , 4, "Flip Screen" }, -// {0x13, 0x01, 0x03, 0x03, "Off" }, -// {0x13, 0x01, 0x03, 0x00, "On" }, -// {0x13, 0x01, 0x03, 0x02, "Horizontally" }, -// {0x13, 0x01, 0x03, 0x01, "Vertically" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x08, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x10, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Stagger1) - -static struct BurnDIPInfo GrdnstrmDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bombs" }, - {0x12, 0x01, 0x08, 0x08, "2" }, - {0x12, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x80, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x40, "5" }, - -// {0 , 0xfe, 0 , 2, "Mirror Screen" }, -// {0x13, 0x01, 0x01, 0x01, "Off" }, -// {0x13, 0x01, 0x01, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x13, 0x01, 0x02, 0x02, "Off" }, -// {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x08, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x10, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Grdnstrm) - -static struct BurnDIPInfo GrdnstrkDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bombs" }, - {0x12, 0x01, 0x08, 0x08, "2" }, - {0x12, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x80, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x40, "5" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x13, 0x01, 0x01, 0x01, "Off" }, -// {0x13, 0x01, 0x01, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Mirror Screen" }, -// {0x13, 0x01, 0x02, 0x02, "Off" }, -// {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x08, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x10, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Grdnstrk) - -static struct BurnDIPInfo PopspopsDIPList[]= -{ - {0x12, 0xff, 0xff, 0xfa, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x10, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x08, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Popspops) - -static struct BurnDIPInfo Bubl2000DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Free Credit" }, - {0x12, 0x01, 0xc0, 0x80, "500k" }, - {0x12, 0x01, 0xc0, 0xc0, "800k" }, - {0x12, 0x01, 0xc0, 0x40, "1000k" }, - {0x12, 0x01, 0xc0, 0x00, "1500k" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 7, "Coin B" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 7, "Coin A" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Bubl2000) - -static struct BurnDIPInfo MangchiDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "DSWS" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Vs Rounds" }, - {0x12, 0x01, 0x18, 0x18, "2" }, - {0x12, 0x01, 0x18, 0x10, "3" }, - {0x12, 0x01, 0x18, 0x08, "4" }, - {0x12, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x08, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x10, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Mangchi) - -static struct BurnDIPInfo FirehawkDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 6, "Difficulty" }, - {0x12, 0x01, 0x0e, 0x06, "Very Easy" }, - {0x12, 0x01, 0x0e, 0x08, "Easy" }, - {0x12, 0x01, 0x0e, 0x0e, "Normal" }, - {0x12, 0x01, 0x0e, 0x02, "Hard" }, - {0x12, 0x01, 0x0e, 0x04, "Hardest" }, - {0x12, 0x01, 0x0e, 0x0c, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Number of Bombs" }, - {0x12, 0x01, 0x20, 0x20, "2" }, - {0x12, 0x01, 0x20, 0x00, "3" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x80, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x40, "4" }, - - {0 , 0xfe, 0 , 2, "Region" }, - {0x13, 0x01, 0x02, 0x02, "English" }, - {0x13, 0x01, 0x02, 0x00, "China" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Continue Coins" }, - {0x13, 0x01, 0x18, 0x18, "1 Coin" }, - {0x13, 0x01, 0x18, 0x08, "2 Coins" }, - {0x13, 0x01, 0x18, 0x10, "3 Coins" }, - {0x13, 0x01, 0x18, 0x00, "4 Coins" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Firehawk) - -static struct BurnDIPInfo Spec2kDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Number of Bombs" }, - {0x12, 0x01, 0x08, 0x08, "2" }, - {0x12, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Copyright Notice" }, - {0x12, 0x01, 0x10, 0x00, "Off" }, - {0x12, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x80, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x40, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x08, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x10, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Spec2k) - -static struct BurnDIPInfo TwinactnDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xe0, 0x00, "Free Play" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x13, 0x01, 0x01, 0x01, "Off" }, -// {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x0c, "Easy" }, - {0x13, 0x01, 0x0c, 0x04, "Normal" }, - {0x13, 0x01, 0x0c, 0x08, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0xc0, 0x40, "2" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x80, "4" }, - {0x13, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Twinactn) - -static struct BurnDIPInfo BjtwinDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x01, 0x01, "Off" }, -// {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Starting level" }, - {0x12, 0x01, 0x0e, 0x08, "Germany" }, - {0x12, 0x01, 0x0e, 0x04, "Thailand" }, - {0x12, 0x01, 0x0e, 0x0c, "Nevada" }, - {0x12, 0x01, 0x0e, 0x0e, "Japan" }, - {0x12, 0x01, 0x0e, 0x06, "Korea" }, - {0x12, 0x01, 0x0e, 0x0a, "England" }, - {0x12, 0x01, 0x0e, 0x02, "Hong Kong" }, - {0x12, 0x01, 0x0e, 0x00, "China" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x20, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x40, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xe0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Bjtwin) - -static struct BurnDIPInfo SabotenbDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x01, 0x01, "Off" }, -// {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x12, 0x01, 0x02, 0x02, "Japanese" }, - {0x12, 0x01, 0x02, 0x00, "English" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x40, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xe0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Sabotenb) - -static struct BurnDIPInfo NouryokuDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Life Decrease Speed" }, - {0x12, 0x01, 0x03, 0x02, "Slow" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Fast" }, - {0x12, 0x01, 0x03, 0x00, "Very Fast" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x12, 0x01, 0xe0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x13, 0x01, 0x20, 0x20, "Off" }, -// {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Nouryoku) - -static struct BurnDIPInfo MustangDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xe0, 0x00, "Free Play" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x13, 0x01, 0x01, 0x01, "Off" }, -// {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x04, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x08, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0xc0, 0x40, "2" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x80, "4" }, - {0x13, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Mustang) - -static struct BurnDIPInfo TdragonbDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "1" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x20, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x80, 0x80, "Off" }, -// {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x20, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Tdragonb) - -static struct BurnDIPInfo TdragonDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x01, 0x01, "Off" }, -// {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x04, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x08, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "1" }, - {0x12, 0x01, 0xc0, 0x40, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x20, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Tdragon) - -static struct BurnDIPInfo AcrobatmDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x13, 0x01, 0x02, 0x02, "Off" }, -// {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x1c, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0xe0, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x06, 0x02, "50k and 100k" }, - {0x14, 0x01, 0x06, 0x06, "100k and 100k" }, - {0x14, 0x01, 0x06, 0x04, "100k and 200k" }, - {0x14, 0x01, 0x06, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x14, 0x01, 0x08, 0x00, "English" }, - {0x14, 0x01, 0x08, 0x08, "Japanese" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x00, "Hardest" }, - {0x14, 0x01, 0x30, 0x10, "Easy" }, - {0x14, 0x01, 0x30, 0x20, "Hard" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0xc0, 0x40, "2" }, - {0x14, 0x01, 0xc0, 0xc0, "3" }, - {0x14, 0x01, 0xc0, 0x80, "4" }, - {0x14, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Acrobatm) - -static struct BurnDIPInfo GunnailDIPList[]= -{ - {0x12, 0xff, 0xff, 0xfd, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x12, 0x01, 0x01, 0x01, "Off" }, -// {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x12, 0x01, 0x02, 0x02, "Japanese" }, - {0x12, 0x01, 0x02, 0x00, "English" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xe0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "trap15's sheild-warning mod" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, -}; - -STDDIPINFO(Gunnail) - -static struct BurnDIPInfo DolmenDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Free Credit" }, - {0x12, 0x01, 0xc0, 0x80, "500k" }, - {0x12, 0x01, 0xc0, 0xc0, "800k" }, - {0x12, 0x01, 0xc0, 0x40, "1000k" }, - {0x12, 0x01, 0xc0, 0x00, "1500k" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 7, "Coin B" }, - {0x13, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 7, "Coin A" }, - {0x13, 0x01, 0xe0, 0x80, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Dolmen) - -//------------------------------------------------------------------------------------------------------------ - -#define STRANGE_RAM_WRITE_BYTE(value) \ - if ((address & 0xffff0000) == value) { \ - Drv68KRAM[(address & 0xfffe) | 0] = data; \ - Drv68KRAM[(address & 0xfffe) | 1] = data; \ - return; \ - } \ - -// MAKE SHORT ^^ - -#define STRANGE_RAM_WRITE_WORD(value) \ - if ((address & 0xffff0000) == value) { \ - *((UINT16*)(Drv68KRAM + (address & 0xfffe))) = BURN_ENDIAN_SWAP_INT16(data); \ - return; \ - } \ - -#define PROT_JSR(_offs_,_protvalue_,_pc_) \ - if(nmk16_mainram[(_offs_)/2] == BURN_ENDIAN_SWAP_INT16(_protvalue_)) \ - { \ - nmk16_mainram[(_offs_)/2] = 0xffff; /*(MCU job done)*/ \ - nmk16_mainram[(_offs_+2-0x10)/2] = BURN_ENDIAN_SWAP_INT16(0x4ef9);/*JMP*/\ - nmk16_mainram[(_offs_+4-0x10)/2] = 0x0000;/*HI-DWORD*/\ - nmk16_mainram[(_offs_+6-0x10)/2] = BURN_ENDIAN_SWAP_INT16(_pc_); /*LO-DWORD*/\ - } \ - -#define PROT_INPUT(_offs_,_protvalue_,_protinput_,_input_) \ - if(nmk16_mainram[_offs_] == BURN_ENDIAN_SWAP_INT16(_protvalue_)) \ - {\ - nmk16_mainram[_protinput_] = BURN_ENDIAN_SWAP_INT16((_input_ & 0xffff0000)>>16);\ - nmk16_mainram[_protinput_+1] = BURN_ENDIAN_SWAP_INT16(_input_ & 0x0000ffff);\ - } - -//------------------------------------------------------------------------------------------------------------ -// MCU simulation stuff - -static INT32 prot_count = 0; - -static UINT8 tharrier_mcu_r() -{ - UINT16 *nmk16_mainram = (UINT16*)Drv68KRAM; - - static const UINT8 to_main[15] = - { - 0x82,0xc7,0x00,0x2c,0x6c,0x00,0x9f,0xc7,0x00,0x29,0x69,0x00,0x8b,0xc7,0x00 - }; - - INT32 res; - - if (SekGetPC(-1)==0x08aa) res = (BURN_ENDIAN_SWAP_INT16(nmk16_mainram[0x9064/2]))|0x20; - else if (SekGetPC(-1)==0x08ce) res = (BURN_ENDIAN_SWAP_INT16(nmk16_mainram[0x9064/2]))|0x60; - else if (SekGetPC(-1)==0x0332) res = (BURN_ENDIAN_SWAP_INT16(nmk16_mainram[0x90f6/2]))|0x00; - else if (SekGetPC(-1)==0x64f4) res = (BURN_ENDIAN_SWAP_INT16(nmk16_mainram[0x90f6/2]))|0x00; - else - { - res = to_main[prot_count++]; - if (prot_count > 14) - prot_count = 0; - } - return res; -} - -static void HachaRAMProt(INT32 offset) -{ - UINT16 *nmk16_mainram = (UINT16*)Drv68KRAM; - - switch(offset) - { - case 0xe058/2: PROT_INPUT(0xe058/2,0xc71f,0xe000/2,0x00080000); break; - case 0xe182/2: PROT_INPUT(0xe182/2,0x865d,0xe004/2,0x00080002); break; - case 0xe51e/2: PROT_INPUT(0xe51e/2,0x0f82,0xe008/2,0x00080008); break; - case 0xe6b4/2: PROT_INPUT(0xe6b4/2,0x79be,0xe00c/2,0x0008000a); break; - case 0xe10e/2: PROT_JSR(0xe10e,0x8007,0x870a); //870a not 9d66 - PROT_JSR(0xe10e,0x8000,0xd9c6); break; - case 0xe11e/2: PROT_JSR(0xe11e,0x8038,0x972a); // 972a - PROT_JSR(0xe11e,0x8031,0xd1f8); break; - case 0xe12e/2: PROT_JSR(0xe12e,0x8019,0x9642); // OK-9642 - PROT_JSR(0xe12e,0x8022,0xda06); break; - case 0xe13e/2: PROT_JSR(0xe13e,0x802a,0x9d66); // 9d66 not 9400 - OK - PROT_JSR(0xe13e,0x8013,0x81aa); break; - case 0xe14e/2: PROT_JSR(0xe14e,0x800b,0xb3f2); // b3f2 - OK - PROT_JSR(0xe14e,0x8004,0x8994); break; - case 0xe15e/2: PROT_JSR(0xe15e,0x803c,0xb59e); // b59e - OK - PROT_JSR(0xe15e,0x8035,0x8d0c); break; - case 0xe16e/2: PROT_JSR(0xe16e,0x801d,0x9ac2); // 9ac2 - OK - PROT_JSR(0xe16e,0x8026,0x8c36); break; - case 0xe17e/2: PROT_JSR(0xe17e,0x802e,0xc366); // c366 - OK - PROT_JSR(0xe17e,0x8017,0x870a); break; - case 0xe18e/2: PROT_JSR(0xe18e,0x8004,0xd620); // unused - PROT_JSR(0xe18e,0x8008,0x972a); break; // unused - case 0xe19e/2: PROT_JSR(0xe19e,0x8030,0xd9c6); // OK-d9c6 - PROT_JSR(0xe19e,0x8039,0x9642); break; - case 0xe1ae/2: PROT_JSR(0xe1ae,0x8011,0xd1f8); // d1f8 not c67e - PROT_JSR(0xe1ae,0x802a,0x9d66); break; - case 0xe1be/2: PROT_JSR(0xe1be,0x8022,0xda06); // da06 - PROT_JSR(0xe1be,0x801b,0xb3f2); break; - case 0xe1ce/2: PROT_JSR(0xe1ce,0x8003,0x81aa); // 81aa - PROT_JSR(0xe1ce,0x800c,0xb59e); break; - case 0xe1de/2: PROT_JSR(0xe1de,0x8034,0x8994); // 8994 - OK - PROT_JSR(0xe1de,0x803d,0x9ac2); break; - case 0xe1ee/2: PROT_JSR(0xe1ee,0x8015,0x8d0c); // 8d0c not 82f6 - PROT_JSR(0xe1ee,0x802e,0xc366); break; - case 0xe1fe/2: PROT_JSR(0xe1fe,0x8026,0x8c36); // 8c36 - PROT_JSR(0xe1fe,0x8016,0xd620); break; // unused - case 0xef00/2: - if(nmk16_mainram[0xef00/2] == BURN_ENDIAN_SWAP_INT16(0x60fe)) - { - nmk16_mainram[0xef00/2] = 0x0000; // this is the coin counter - nmk16_mainram[0xef02/2] = 0x0000; - nmk16_mainram[0xef04/2] = BURN_ENDIAN_SWAP_INT16(0x4ef9); - nmk16_mainram[0xef06/2] = 0x0000; - nmk16_mainram[0xef08/2] = BURN_ENDIAN_SWAP_INT16(0x7dc2); - } - break; - } -} - -static void tdragon_mainram_w(INT32 offset) -{ - UINT16 *nmk16_mainram = (UINT16*)Drv68KRAM; - - switch(offset) - { - case 0xe066/2: PROT_INPUT(0xe066/2,0xe23e,0xe000/2,0x000c0000); break; - case 0xe144/2: PROT_INPUT(0xe144/2,0xf54d,0xe004/2,0x000c0002); break; - case 0xe60e/2: PROT_INPUT(0xe60e/2,0x067c,0xe008/2,0x000c0008); break; - case 0xe714/2: PROT_INPUT(0xe714/2,0x198b,0xe00c/2,0x000c000a); break; - case 0xe70e/2: PROT_JSR(0xe70e,0x8007,0x9e22); - PROT_JSR(0xe70e,0x8000,0xd518); break; - case 0xe71e/2: PROT_JSR(0xe71e,0x8038,0xaa0a); - PROT_JSR(0xe71e,0x8031,0x8e7c); break; - case 0xe72e/2: PROT_JSR(0xe72e,0x8019,0xac48); - PROT_JSR(0xe72e,0x8022,0xd558); break; - case 0xe73e/2: PROT_JSR(0xe73e,0x802a,0xb110); - PROT_JSR(0xe73e,0x8013,0x96da); break; - case 0xe74e/2: PROT_JSR(0xe74e,0x800b,0xb9b2); - PROT_JSR(0xe74e,0x8004,0xa062); break; - case 0xe75e/2: PROT_JSR(0xe75e,0x803c,0xbb4c); - PROT_JSR(0xe75e,0x8035,0xa154); break; - case 0xe76e/2: PROT_JSR(0xe76e,0x801d,0xafa6); - PROT_JSR(0xe76e,0x8026,0xa57a); break; - case 0xe77e/2: PROT_JSR(0xe77e,0x802e,0xc6a4); - PROT_JSR(0xe77e,0x8017,0x9e22); break; - case 0xe78e/2: PROT_JSR(0xe78e,0x8004,0xaa0a); - PROT_JSR(0xe78e,0x8008,0xaa0a); break; - case 0xe79e/2: PROT_JSR(0xe79e,0x8030,0xd518); - PROT_JSR(0xe79e,0x8039,0xac48); break; - case 0xe7ae/2: PROT_JSR(0xe7ae,0x8011,0x8e7c); - PROT_JSR(0xe7ae,0x802a,0xb110); break; - case 0xe7be/2: PROT_JSR(0xe7be,0x8022,0xd558); - PROT_JSR(0xe7be,0x801b,0xb9b2); break; - case 0xe7ce/2: PROT_JSR(0xe7ce,0x8003,0x96da); - PROT_JSR(0xe7ce,0x800c,0xbb4c); break; - case 0xe7de/2: PROT_JSR(0xe7de,0x8034,0xa062); - PROT_JSR(0xe7de,0x803d,0xafa6); break; - case 0xe7ee/2: PROT_JSR(0xe7ee,0x8015,0xa154); - PROT_JSR(0xe7ee,0x802e,0xc6a4); break; - case 0xe7fe/2: PROT_JSR(0xe7fe,0x8026,0xa57a); - PROT_JSR(0xe7fe,0x8016,0xa57a); break; - case 0xef00/2: - if(nmk16_mainram[0xef00/2] == BURN_ENDIAN_SWAP_INT16(0x60fe)) - { - nmk16_mainram[0xef00/2] = 0x0000; // this is the coin counter - nmk16_mainram[0xef02/2] = 0x0000; - nmk16_mainram[0xef04/2] = BURN_ENDIAN_SWAP_INT16(0x4ef9); - nmk16_mainram[0xef06/2] = 0x0000; - nmk16_mainram[0xef08/2] = BURN_ENDIAN_SWAP_INT16(0x92f4); - } - break; - } -} - -static void mcu_run(UINT8 dsw_setting) -{ - static UINT8 input_pressed; - static UINT16 coin_input; - UINT8 dsw[2]; - static UINT8 start_helper = 0; - static UINT8 coin_count[2],coin_count_frac[2]; - static UINT8 i; - - UINT16 *nmk16_mainram = (UINT16*)Drv68KRAM; - - if(start_helper & 1 && BURN_ENDIAN_SWAP_INT16(nmk16_mainram[0x9000/2]) & 0x0200) // start 1 - { - nmk16_mainram[0xef00/2]--; - start_helper = start_helper & 2; - } - if(start_helper & 2 && BURN_ENDIAN_SWAP_INT16(nmk16_mainram[0x9000/2]) & 0x0100) // start 2 - { - nmk16_mainram[0xef00/2]--; - start_helper = start_helper & 1; - } - - if(dsw_setting) // Thunder Dragon - { - dsw[0] = (DrvDips[1] & 0x7); - dsw[1] = (DrvDips[1] & 0x38) >> 3; - for(i=0;i<2;i++) - { - switch(dsw[i] & 7) - { - case 0: nmk16_mainram[0x9000/2]|=BURN_ENDIAN_SWAP_INT16(0x4000); break; // free play - case 1: coin_count_frac[i] = 1; coin_count[i] = 4; break; - case 2: coin_count_frac[i] = 1; coin_count[i] = 3; break; - case 3: coin_count_frac[i] = 1; coin_count[i] = 2; break; - case 4: coin_count_frac[i] = 4; coin_count[i] = 1; break; - case 5: coin_count_frac[i] = 3; coin_count[i] = 1; break; - case 6: coin_count_frac[i] = 2; coin_count[i] = 1; break; - case 7: coin_count_frac[i] = 1; coin_count[i] = 1; break; - } - } - } - else // Hacha Mecha Fighter - { - dsw[0] = (DrvDips[1] & 0x07) >> 0; - dsw[1] = (DrvDips[1] & 0x38) >> 3; - for(i=0;i<2;i++) - { - switch(dsw[i] & 7) - { - case 0: nmk16_mainram[0x9000/2]|=BURN_ENDIAN_SWAP_INT16(0x4000); break; // free play - case 1: coin_count_frac[i] = 4; coin_count[i] = 1; break; - case 2: coin_count_frac[i] = 3; coin_count[i] = 1; break; - case 3: coin_count_frac[i] = 2; coin_count[i] = 1; break; - case 4: coin_count_frac[i] = 1; coin_count[i] = 4; break; - case 5: coin_count_frac[i] = 1; coin_count[i] = 3; break; - case 6: coin_count_frac[i] = 1; coin_count[i] = 2; break; - case 7: coin_count_frac[i] = 1; coin_count[i] = 1; break; - } - } - } - - // read the coin port - coin_input = (~(DrvInputs[0])); - - if(coin_input & 0x01) // coin 1 - { - if((input_pressed & 0x01) == 0) - { - if(coin_count_frac[0] != 1) - { - nmk16_mainram[0xef02/2]+=coin_count[0]; - if(coin_count_frac[0] == nmk16_mainram[0xef02/2]) - { - nmk16_mainram[0xef00/2]+=coin_count[0]; - nmk16_mainram[0xef02/2] = 0; - } - } - else - nmk16_mainram[0xef00/2]+=coin_count[0]; - } - input_pressed = (input_pressed & 0xfe) | 1; - } - else - input_pressed = (input_pressed & 0xfe); - - if(coin_input & 0x02) // coin 2 - { - if((input_pressed & 0x02) == 0) - { - if(coin_count_frac[1] != 1) - { - nmk16_mainram[0xef02/2]+=coin_count[1]; - if(coin_count_frac[1] == nmk16_mainram[0xef02/2]) - { - nmk16_mainram[0xef00/2]+=coin_count[1]; - nmk16_mainram[0xef02/2] = 0; - } - } - else - nmk16_mainram[0xef00/2]+=coin_count[1]; - } - input_pressed = (input_pressed & 0xfd) | 2; - } - else - input_pressed = (input_pressed & 0xfd); - - if(coin_input & 0x04) // service 1 - { - if((input_pressed & 0x04) == 0) - nmk16_mainram[0xef00/2]++; - input_pressed = (input_pressed & 0xfb) | 4; - } - else - input_pressed = (input_pressed & 0xfb); - - if(nmk16_mainram[0xef00/2] > 0 && nmk16_mainram[0x9000/2] & 0x8000) //enable start button - { - if(coin_input & 0x08) // start 1 - { - if((input_pressed & 0x08) == 0 && (!(nmk16_mainram[0x9000/2] & 0x0200))) // start 1 - start_helper = 1; - - input_pressed = (input_pressed & 0xf7) | 8; - } - else - input_pressed = (input_pressed & 0xf7); - - if(coin_input & 0x10) // start 2 - { - if((input_pressed & 0x10) == 0 && (!(nmk16_mainram[0x9000/2] & 0x0100))) // start 2 - start_helper = (nmk16_mainram[0x9000/2] == 0x8000) ? (3) : (2); - - input_pressed = (input_pressed & 0xef) | 0x10; - } - else - input_pressed = (input_pressed & 0xef); - } -} - -//------------------------------------------------------------------------------------------------- - -void __fastcall tharrier_main_write_byte(UINT32 address, UINT8 data) -{ - STRANGE_RAM_WRITE_BYTE(0xf0000) -} - -void __fastcall tharrier_main_write_word(UINT32 address, UINT16 data) -{ - STRANGE_RAM_WRITE_WORD(0xf0000) - - switch (address) - { - case 0x080010: // mcu write.. unused... - return; - - case 0x08001e: - *soundlatch = data; - return; - } -} - -UINT8 __fastcall tharrier_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0] >> 8; - - case 0x080001: - return DrvInputs[0]; - - case 0x080002: - return tharrier_mcu_r(); - - case 0x080003: - return DrvInputs[1]; - - case 0x080004: - return DrvDips[1]; - - case 0x080005: - return DrvDips[0]; - - case 0x08000e: - case 0x08000f: - return *soundlatch2; - - case 0x080202: - return DrvInputs[2] >> 8; - - case 0x080203: - return DrvInputs[2]; - } - - return 0; -} - -UINT16 __fastcall tharrier_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1]; - - case 0x080004: - return (DrvDips[0] << 8) | DrvDips[1]; - - case 0x08000e: - return *soundlatch2; - - case 0x080202: - return DrvInputs[2]; - } - - return 0; -} - -void __fastcall manybloc_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x080014: - case 0x080015: - // *flipscreen = data & 1; - return; - - case 0x08001e: - case 0x08001f: - *soundlatch = data; - return; - } -} - -void __fastcall manybloc_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x080014: - // *flipscreen = data & 1; - return; - - case 0x08001e: - *soundlatch = data; - return; - } -} - -UINT8 __fastcall manybloc_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0] >> 8; - - case 0x080001: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1] >> 8; - - case 0x080003: - return DrvInputs[1]; - - case 0x080004: - return DrvDips[0]; - - case 0x080005: - return DrvDips[1]; - - case 0x08001e: - case 0x08001f: - return *soundlatch2; - } - - return 0; -} - -UINT16 __fastcall manybloc_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1]; - - case 0x080004: - return (DrvDips[0] << 8) | DrvDips[1]; - - case 0x08001e: - return *soundlatch2; - } - - return 0; -} - -void __fastcall ssmissin_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x0c0014: - case 0x0c0015: - // *flipscreen = data & 1; - return; - - case 0x0c0018: - case 0x0c0019: - if (data != 0xff) { - *tilebank = data; - } - return; - - case 0x0c001e: - case 0x0c001f: - *soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -void __fastcall ssmissin_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x0c0014: - // *flipscreen = data & 1; - return; - - case 0x0c0018: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x0c001e: - *soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -UINT8 __fastcall ssmissin_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0c0000: - return DrvInputs[0] >> 8; - - case 0x0c0001: - return DrvInputs[0]; - - case 0x0c0004: - return DrvInputs[1] >> 8; - - case 0x0c0005: - return DrvInputs[1]; - - case 0x0c0006: - return DrvDips[0]; - - case 0x0c0007: - return DrvDips[1]; - } - - return 0; -} - -UINT16 __fastcall ssmissin_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x0c0000: - return DrvInputs[0]; - - case 0x0c0004: - return DrvInputs[1]; - - case 0x0c0006: - return (DrvDips[0] << 8) | DrvDips[1]; - } - - return 0; -} - -UINT8 __fastcall macross2_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x100000: - return DrvInputs[0] >> 8; - - case 0x100001: - return DrvInputs[0]; - - case 0x100002: - return DrvInputs[1] >> 8; - - case 0x100003: - return DrvInputs[1]; - - case 0x100008: - case 0x100009: - return DrvDips[0]; - - case 0x10000a: - case 0x10000b: - return DrvDips[1]; - - case 0x10000e: - case 0x10000f: - return *soundlatch2; - } - - return 0; -} - -UINT16 __fastcall macross2_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x100000: - return DrvInputs[0]; - - case 0x100002: - return DrvInputs[1]; - - case 0x100008: - return (DrvDips[0] << 8) | DrvDips[0]; - - case 0x10000a: - return (DrvDips[1] << 8) | DrvDips[1]; - - case 0x10000e: - return *soundlatch2; - } - - return 0; -} - -void __fastcall macross2_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("%x, %x wb\n"), address, data); - - switch (address) - { - case 0x100014: - case 0x100015: - // *flipscreen = data & 1; - return; - } -} - -void __fastcall macross2_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x100014: - // *flipscreen = data & 1; - return; - - case 0x100016: - if (data == 0) { - if (macross2_sound_enable != 0) { - ZetReset(); - } - } - macross2_sound_enable = data; - return; - - case 0x100018: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x10001e: - *soundlatch = data; - return; - } -} - -void __fastcall afega_main_write_word(UINT32 address, UINT16 data) -{ - if (address & 0xfff00000) { - SekWriteWord(address & 0xfffff, data); - return; - } - - STRANGE_RAM_WRITE_WORD(0xc0000) - STRANGE_RAM_WRITE_WORD(0xf0000) - - switch (address) - { - case 0x080014: - // *flipscreen = data & 1; - return; - - - case 0x08001e: - *soundlatch = data & 0xff; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - - case 0x08c000: { // for twin action twinactn background scroll - switch (data & 0xff00) { - case 0x0000: - mustang_bg_xscroll = (mustang_bg_xscroll & 0x00ff) | ((data & 0x00ff)<<8); - break; - - case 0x0100: - mustang_bg_xscroll = (mustang_bg_xscroll & 0xff00) | (data & 0x00ff); - break; - } - return; - } - } -} - -void __fastcall afega_main_write_byte(UINT32 address, UINT8 data) -{ - if (address & 0xfff00000) { - SekWriteByte(address & 0xfffff, data); - return; - } - - STRANGE_RAM_WRITE_BYTE(0xc0000) - STRANGE_RAM_WRITE_BYTE(0xf0000) - - switch (address) - { - case 0x080014: - case 0x080015: - // *flipscreen = data & 1; - return; - - case 0x08001e: - case 0x08001f: - *soundlatch = data & 0xff; - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - return; - } -} - -UINT8 __fastcall afega_main_read_byte(UINT32 address) -{ - if (address & 0xfff00000) { - return SekReadByte(address & 0xfffff); - } - - switch (address) - { - case 0x080000: - return DrvInputs[0] >> 8; - - case 0x080001: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1] >> 8; - - case 0x080003: - return DrvInputs[1]; - - case 0x080004: - return DrvDips[0]; - - case 0x080005: - return DrvDips[1]; - - case 0x080012: - case 0x080013: - return 0x01; - } - - return 0; -} - -UINT16 __fastcall afega_main_read_word(UINT32 address) -{ - if (address & 0xfff00000) { - return SekReadWord(address & 0xfffff); - } - - switch (address) - { - case 0x080000: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1]; - - case 0x080004: - return ((DrvDips[0] << 8) | DrvDips[1]); - - case 0x080012: - return 0x0100; - } - - return 0; -} - -void __fastcall bjtwin_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x080014: - case 0x080015: - // *flipscreen = data & 1; - return; - - case 0x094000: - case 0x094001: - if (data != 0xff) { - *tilebank = data; - } - return; - } -} - -void __fastcall bjtwin_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x080014: - // *flipscreen = data & 1; - return; - - case 0x084000: - MSM6295Command(0, data & 0xff); - return; - - case 0x084010: - MSM6295Command(1, data & 0xff); - return; - - case 0x084020: - case 0x084022: - case 0x084024: - case 0x084026: - case 0x084028: - case 0x08402a: - case 0x08402c: - case 0x08402e: - NMK112_okibank_write((address >> 1) & 7, data); - return; - - case 0x094000: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - } -} - -UINT8 __fastcall bjtwin_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0] >> 8; - - case 0x080001: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1] >> 8; - - case 0x080003: - return DrvInputs[1]; - - case 0x080008: - case 0x080009: - return DrvDips[0]; - - case 0x08000a: - case 0x08000b: - return DrvDips[1]; - - case 0x084000: - case 0x084001: - return MSM6295ReadStatus(0); - - case 0x084010: - case 0x084011: - return MSM6295ReadStatus(1); - } - - return 0; -} - -UINT16 __fastcall bjtwin_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1]; - - case 0x080008: - return 0xff00 | DrvDips[0]; - - case 0x08000a: - return 0xff00 | DrvDips[1]; - - case 0x084000: - return MSM6295ReadStatus(0); - - case 0x084010: - return MSM6295ReadStatus(1); - } - - return 0; -} - -void __fastcall mustangb_main_write_word(UINT32 address, UINT16 data) -{ - STRANGE_RAM_WRITE_WORD(0xf0000) - - switch (address) - { - case 0x080014: - case 0x0c0014: - // *flipscreen = data & 1; - return; - - case 0x08001e: - case 0x0c001e: - // bprintf (0, _T("%6.6x, %x,\n"), SekGetPC(-1), data); - seibu_sound_mustb_write_word(0, data); - return; - } -} - -void __fastcall mustangb_main_write_byte(UINT32 address, UINT8 data) -{ - STRANGE_RAM_WRITE_BYTE(0xf0000) - - switch (address) - { - case 0x080014: - case 0x080015: - case 0x0c0014: - case 0x0c0015: - // *flipscreen = data & 1; - return; - - case 0x08001e: - case 0x08001f: - case 0x0c001e: - case 0x0c001f: - // bprintf (0, _T("%6.6x, %x,\n"), SekGetPC(-1), data); - seibu_sound_mustb_write_word(0, data); - return; - } -} - -UINT16 __fastcall mustangb_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x044022: - return 0x0003; - - case 0x080000: - case 0x0c0000: - return DrvInputs[0]; - - case 0x080002: - case 0x0c0002: - return DrvInputs[1]; - - case 0x080004: - case 0x0c0008: - return (DrvDips[0] << 8) | DrvDips[1]; - - case 0x0c000a: - return 0xff00 | DrvDips[1]; - } - - return 0; -} - -UINT8 __fastcall mustangb_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x044023: // tdragonb sprite fix - return 0x03; - - case 0x080000: - case 0x0c0000: - return DrvInputs[0] >> 8; - - case 0x080001: - case 0x0c0001: - return DrvInputs[0]; - - case 0x080002: - case 0x0c0002: - return DrvInputs[1] >> 8; - - case 0x080003: - case 0x0c0003: - return DrvInputs[1]; - - case 0x080004: - case 0x0c0008: - return DrvDips[1]; - - case 0x080005: - case 0x0c0009: - return DrvDips[0]; - - case 0x0c000a: - case 0x0c000b: - return DrvDips[1]; - } - - return 0; -} - -UINT8 __fastcall mustang_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x080000: - case 0x080001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x080002: - case 0x080003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x080004: - case 0x080005: - return DrvDips[address & 1]; - - case 0x08000e: - case 0x08000f: - return NMK004Read(); - } - - return 0; -} - -UINT16 __fastcall mustang_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1]; - - case 0x080004: - return (DrvDips[0] << 8) | DrvDips[1]; - - case 0x08000e: - return NMK004Read(); - } - - return 0; -} - -void __fastcall mustang_main_write_word(UINT32 address, UINT16 data) -{ - STRANGE_RAM_WRITE_WORD(0xf0000) - - switch (address) - { - case 0x080014: - // *flipscreen = data & 1; - return; - - case 0x080016: - NMK004NmiWrite(data); - return; - - case 0x08001e: - NMK004Write(0, data); - return; - - case 0x08c000: { - switch (data & 0xff00) { - case 0x0000: - mustang_bg_xscroll = (mustang_bg_xscroll & 0x00ff) | ((data & 0x00ff)<<8); - break; - - case 0x0100: - mustang_bg_xscroll = (mustang_bg_xscroll & 0xff00) | (data & 0x00ff); - break; - } - return; - } - } -} - -void __fastcall mustang_main_write_byte(UINT32 address, UINT8 data) -{ - STRANGE_RAM_WRITE_BYTE(0xf0000) - switch (address) - { - case 0x080016: - case 0x080017: - NMK004NmiWrite(data); - return; - case 0x08001e: - case 0x08001f: - NMK004Write(0, data); - return; - } -} - -UINT8 __fastcall acrobatm_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0c0000: - case 0x0c0001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x0c0002: - case 0x0c0003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x0c0008: - case 0x0c0009: - return DrvDips[0]; - - case 0x0c000a: - case 0x0c000b: - return DrvDips[1]; - - case 0x0c000e: - return NMK004Read(); - } - - return 0; -} - -UINT16 __fastcall acrobatm_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x0c0000: - return DrvInputs[0]; - - case 0x0c0002: - return DrvInputs[1]; - - case 0x0c0008: - return DrvDips[0]; - - case 0x0c000a: - return DrvDips[1]; - - case 0x0c000e: - return NMK004Read(); - } - - return 0; -} - -void __fastcall acrobatm_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x0c0014: - case 0x0c0015: - // *flipscreen = data & 1; - return; - - case 0x0c0016: - NMK004NmiWrite(data); - return; - - case 0x0c0018: - case 0x0c0019: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x0c001e: - case 0x0c001f: - NMK004Write(0, data); - return; - } -} - -void __fastcall acrobatm_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x0c0014: - case 0x0c0015: - // *flipscreen = data & 1; - return; - - case 0x0c0016: - case 0x0c0017: - NMK004NmiWrite(data); - return; - - case 0x0c0018: - case 0x0c0019: - if (data != 0xff) { - *tilebank = data; - } - return; - - case 0x0c001e: - case 0x0c001f: - NMK004Write(0, data); - return; - } -} - -UINT8 __fastcall tdragon_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x0c0000: - case 0x0c0001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x0c0002: - case 0x0c0003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x0c0008: - case 0x0c0009: - return DrvDips[0]; - - case 0x0c000a: - case 0x0c000b: - return DrvDips[1]; - - case 0x0c000e: - case 0x0c000f: - return NMK004Read(); - } - - return 0; -} - -UINT16 __fastcall tdragon_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x0c0000: - return DrvInputs[0]; - - case 0x0c0002: - return DrvInputs[1]; - - case 0x0c0008: - return DrvDips[0]; - - case 0x0c000a: - return DrvDips[1]; - - case 0x0c000e: - return NMK004Read(); - } - - return 0; -} - -void __fastcall tdragon_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffff0000) == 0x0b0000) { - *((UINT16*)(Drv68KRAM + (address & 0xfffe))) = BURN_ENDIAN_SWAP_INT16(data); - tdragon_mainram_w((address >> 1) & 0x7fff); - return; - } - - switch (address) - { - case 0x0c0014: - // *flipscreen = data & 1; - return; - - case 0x0c0016: - case 0x0c0017: - NMK004NmiWrite(data); - return; - - case 0x0c0018: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x0c001e: - NMK004Write(0, data); - return; - } -} - -void __fastcall tdragon_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffff0000) == 0x0b0000) { - Drv68KRAM [(address & 0xffff) ^ 1] = data; - tdragon_mainram_w((address >> 1) & 0x7fff); - return; - } - - switch (address) - { - case 0x0c0014: - case 0x0c0015: - // *flipscreen = data & 1; - return; - - case 0x0c0016: - case 0x0c0017: - NMK004NmiWrite(data); - return; - - case 0x0c0018: - case 0x0c0019: - if (data != 0xff) { - *tilebank = data; - } - return; - - case 0x0c001e: - case 0x0c001f: - NMK004Write(0, data); - return; - } -} - - -UINT8 __fastcall macross_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x080000: - case 0x080001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x080002: - case 0x080003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x080008: - case 0x080009: - return DrvDips[0]; - - case 0x08000a: - case 0x08000b: - return DrvDips[1]; - - case 0x08000e: - case 0x08000f: - return NMK004Read(); - } - - return 0; -} - -UINT16 __fastcall macross_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1]; - - case 0x080008: - return (DrvDips[0] << 8) | DrvDips[0]; - - case 0x08000a: - return (DrvDips[1] << 8) | DrvDips[1]; - - case 0x08000e: - return NMK004Read(); - } - - return 0; -} - -void __fastcall macross_main_write_word(UINT32 address, UINT16 data) -{ - STRANGE_RAM_WRITE_WORD(0xf0000) - - switch (address) - { - case 0x080014: - // *flipscreen = data & 1; - return; - - case 0x080016: - //case 0x080017: - NMK004NmiWrite(data); - return; - - case 0x080018: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x08001e: - NMK004Write(0, data); - return; - - case 0x084000: - if ((data & 0xff) != 0xff) - *tilebank = data; // bioship - return; - } -} - -void __fastcall macross_main_write_byte(UINT32 address, UINT8 data) -{ - STRANGE_RAM_WRITE_BYTE(0xf0000) - - switch (address) - { - case 0x080014: - case 0x080015: - // *flipscreen = data & 1; - return; - - case 0x080016: - case 0x080017: - NMK004NmiWrite(data); - return; - - case 0x080018: - case 0x080019: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x08001e: - case 0x08001f: - NMK004Write(0, data); - return; - - case 0x084000: - case 0x084001: - if ((data & 0xff) != 0xff) { - *tilebank = data; // bioship - } - return; - } -} - -void __fastcall vandykeb_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x080010: - *((UINT16 *)(DrvScrollRAM + 0x06)) = data; - return; - - case 0x080012: - *((UINT16 *)(DrvScrollRAM + 0x04)) = data; - return; - - case 0x080014: - // *flipscreen = data & 1; - return; - - case 0x080018: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x08001a: - *((UINT16 *)(DrvScrollRAM + 0x02)) = data; - return; - - case 0x08001c: - *((UINT16 *)(DrvScrollRAM + 0x00)) = data; - return; - - case 0x08001e: - // write to PIC - return; - } -} - -void __fastcall vandykeb_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x080010: - DrvScrollRAM[7] = data; - return; - - case 0x080014: - case 0x080015: - // *flipscreen = data & 1; - return; - - case 0x080018: - case 0x080019: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x08001a: - DrvScrollRAM[3] = data; - return; - - case 0x08001e: - case 0x08001f: - // write to PIC - return; - } -} - -UINT8 __fastcall hachamf_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x080000: - case 0x080001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x080002: - case 0x080003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x080008: - case 0x080009: - return DrvDips[0]; - - case 0x08000a: - case 0x08000b: - return DrvDips[1]; - - case 0x08000e: - case 0x08000f: - return NMK004Read(); - } - - return 0; -} - -UINT16 __fastcall hachamf_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1]; - - case 0x080008: - return DrvDips[0]; - - case 0x08000a: - return DrvDips[1]; - - case 0x08000e: - return NMK004Read(); - } - - return 0; -} - -void __fastcall hachamf_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffff0000) == 0xf0000) { - *((UINT16*)(Drv68KRAM + (address & 0xfffe))) = data; - HachaRAMProt((address & 0xffff) >> 1); - return; - } - - switch (address) - { - case 0x080014: - // *flipscreen = data & 1; - return; - - case 0x080016: - case 0x080017: - NMK004NmiWrite(data); - return; - - case 0x080018: - if ((data & 0xff) != 0xff) { - *tilebank = data & 0xff; - } - return; - - case 0x08001e: - NMK004Write(0, data); - return; - } -} - -void __fastcall hachamf_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffff0000) == 0xf0000) { - Drv68KRAM[(address & 0xffff) ^ 1] = data; - HachaRAMProt((address & 0xffff) >> 1); - return; - } - - switch (address) - { - case 0x080014: - case 0x080015: - // *flipscreen = data & 1; - return; - - case 0x080016: - case 0x080017: - NMK004NmiWrite(data); - return; - - case 0x080018: - case 0x080019: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x08001e: - case 0x08001f: - NMK004Write(0, data); - return; - } -} - - -//----------------------------------------------------------------------------------------------------- - - -static void tharrier_sound_bankswitch(UINT8 *rom, INT32 bank) -{ - if (bank < 3) { - memcpy (rom + 0x20000, rom + 0x40000 + (bank * 0x20000), 0x20000); - } -} - -void __fastcall tharrier_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - *soundlatch2 = data; - return; - - case 0xf400: - MSM6295Command(0, data); - return; - - case 0xf500: - MSM6295Command(1, data); - return; - - case 0xf600: - tharrier_sound_bankswitch(DrvSndROM0, data & 3); - return; - - case 0xf700: - tharrier_sound_bankswitch(DrvSndROM1, data & 3); - return; - } -} - -UINT8 __fastcall tharrier_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - return *soundlatch; - - case 0xf400: - return MSM6295ReadStatus(0); - - case 0xf500: - return MSM6295ReadStatus(1); - } - - return 0; -} - -void __fastcall tharrier_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM2203Write(0, 0, data); - return; - - case 0x01: - BurnYM2203Write(0, 1, data); - return; - } -} - -UINT8 __fastcall tharrier_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM2203Read(0, 0); - } - - return 0; -} - -static void ssmissin_okibank(INT32 bank) -{ - *okibank = bank & 3; - if (strstr(BurnDrvGetTextA(DRV_NAME), "ssmiss") || strstr(BurnDrvGetTextA(DRV_NAME), "airatt")) { - memcpy(DrvSndROM0 + 0x20000, DrvSndROM0 + 0x40000 + (bank & 3) * 0x20000, 0x20000); - } else { // twin action & dolmen weird banking (m_oki1->set_bank_base((data & 3) * 0x40000);) - memcpy(DrvSndROM0, DrvSndROM1 + (bank & 3) * 0x40000, 0x40000); - } -} - -void __fastcall ssmissin_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - ssmissin_okibank(data); - return; - - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall ssmissin_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -void __fastcall afega_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf808: - BurnYM2151SelectRegister(data); - return; - - case 0xf809: - BurnYM2151WriteRegister(data); - return; - - case 0xf80a: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall afega_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xf808: - case 0xf809: - return BurnYM2151ReadStatus(); - - case 0xf80a: - return MSM6295ReadStatus(0); - } - - return 0; -} - -void __fastcall firehawk_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xfff2: - if (data == 0xfe) - memcpy (DrvSndROM1, DrvSndROM1 + 0x40000, 0x40000); - else if(data == 0xff) - memcpy (DrvSndROM1, DrvSndROM1 + 0x80000, 0x40000); - return; - - case 0xfff8: - MSM6295Command(1, data); - return; - - case 0xfffa: - MSM6295Command(0, data); - return; - } - - if (address >= 0xfe00) { - DrvZ80RAM[address & 0xfff] = data; - return; - } -} - -UINT8 __fastcall firehawk_sound_read(UINT16 address) -{ - switch (address) - { - case 0xfff0: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - - case 0xfff8: - return MSM6295ReadStatus(1); - - case 0xfffa: - return MSM6295ReadStatus(0); - } - - if (address >= 0xfe00) { - return DrvZ80RAM[address & 0xfff]; - } - - return 0; -} - -static void macross2_sound_bank(INT32 bank) -{ - bank = (bank & 7) * 0x4000; - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + 0x10000 + bank); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + 0x10000 + bank); -} - -void __fastcall macross2_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe001: - macross2_sound_bank(data); - return; - - case 0xf000: - *soundlatch2 = data; - return; - } -} - -UINT8 __fastcall macross2_sound_read(UINT16 address) -{ - if (address == 0xf000) return *soundlatch; - - return 0; -} - -void __fastcall macross2_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM2203Write(0, 0, data); - return; - - case 0x01: - BurnYM2203Write(0, 1, data); - return; - - case 0x80: - MSM6295Command(0, data); - return; - - case 0x88: - MSM6295Command(1, data); - return; - - case 0x90: - case 0x91: - case 0x92: - case 0x93: - case 0x94: - case 0x95: - case 0x96: - case 0x97: - NMK112_okibank_write(port & 7, data); - return; - } -} - -UINT8 __fastcall macross2_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM2203Read(0, 0); - - case 0x80: - return MSM6295ReadStatus(0); - - case 0x88: - return MSM6295ReadStatus(1); - } - - return 0; -} - -//----------------------------------------------------------------------------------------------------- - -static void DrvYM2203IrqHandler(INT32, INT32 nStatus) -{ - if (ZetGetActive() == -1) return; - - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static void DrvYM2151IrqHandler(INT32 nStatus) -{ - if (ZetGetActive() == -1) return; - - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) // tharrier & manybloc -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 6000000); -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 6000000; -} - -inline static INT32 Macross2SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 4000000); -} - -inline static double Macross2GetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static void MSM6295SetInitialBanks(INT32 chips) -{ - if (chips > 0) MSM6295SetBank(0, DrvSndROM0, 0, 0x3ffff); - if (chips > 1) MSM6295SetBank(1, DrvSndROM1, 0, 0x3ffff); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - MSM6295Reset(0); - MSM6295Reset(1); - - MSM6295SetInitialBanks(2); - - macross2_sound_enable = -1; - prot_count = 0; - - return 0; -} - -static INT32 SmissinDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - - return 0; -} - -static INT32 AfegaDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - MSM6295Reset(1); - - MSM6295SetInitialBanks(2); - - return 0; -} - -static INT32 BjtwinDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - MSM6295Reset(1); - - NMK112Reset(); - MSM6295SetInitialBanks(2); - - return 0; -} - -static INT32 SeibuSoundDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - seibu_sound_reset(); - MSM6295SetInitialBanks(2); - - return 0; -} - -static INT32 NMK004DoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - NMK004_reset(); - - MSM6295SetInitialBanks(2); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x030000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x800000; - DrvGfxROM2 = Next; Next += 0x800000; - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "raphero") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "arcadian") == 0) { - Next += 0x800000; - } - - DrvTileROM = Next; Next += 0x020000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x300000; - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "raphero") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "arcadian") == 0) { - Next += 0x140000; - } - - DrvSndROM1 = Next; Next += 0x300000; - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "raphero") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "arcadian") == 0) { - Next += 0x140000; - } - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvPalRAM = Next; Next += 0x000800; - Drv68KRAM = Next; Next += 0x010000; - DrvBgRAM0 = Next; Next += 0x004000; - DrvBgRAM1 = Next; Next += 0x004000; - DrvBgRAM2 = Next; Next += 0x004000; - DrvBgRAM3 = Next; Next += 0x004000; - DrvTxRAM = Next; Next += 0x001000; - DrvScrollRAM = Next; Next += 0x001000; - - DrvSprBuf = Next; Next += 0x001000; - DrvSprBuf2 = Next; Next += 0x001000; - DrvSprBuf3 = Next; Next += 0x001000; - - DrvZ80RAM = Next; Next += 0x002000; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - tilebank = Next; Next += 0x000001; - okibank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(INT32 len0, INT32 len1, INT32 len2) -{ - INT32 Plane[4] = { 0x000, 0x001, 0x002, 0x003 }; - INT32 XOffs[16] = { 0x000, 0x004, 0x008, 0x00c, 0x010, 0x014, 0x018, 0x01c, - 0x200, 0x204, 0x208, 0x20c, 0x210, 0x214, 0x218, 0x21c }; - INT32 YOffs[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc((len2 >= len1) ? len2 : len1); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, len0); - - GfxDecode((len0 * 2) / ( 8 * 8), 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, len1); - - GfxDecode((len1 * 2) / (16 * 16), 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, len2); - - GfxDecode((len2 * 2) / (16 * 16), 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM2); - - nGraphicsMask[0] = ((len0 * 2) / ( 8 * 8)) - 1; - nGraphicsMask[1] = ((len1 * 2) / (16 * 16)) - 1; - nGraphicsMask[2] = ((len2 * 2) / (16 * 16)) - 1; - - BurnFree (tmp); - - return 0; -} - -static INT32 BjtwinGfxDecode(INT32 len0, INT32 len1, INT32 len2) -{ - INT32 Plane[4] = { 0x000, 0x001, 0x002, 0x003 }; - INT32 XOffs[16] = { 0x000, 0x004, 0x008, 0x00c, 0x010, 0x014, 0x018, 0x01c, - 0x200, 0x204, 0x208, 0x20c, 0x210, 0x214, 0x218, 0x21c }; - INT32 YOffs[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc((len2 >= len1) ? len2 : len1); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, len0); - - GfxDecode((len0 * 2) / ( 8 * 8), 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, len1); - - GfxDecode((len1 * 2) / ( 8 * 8), 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, len2); - - GfxDecode((len2 * 2) / (16 * 16), 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM2); - - nGraphicsMask[0] = ((len0 * 2) / ( 8 * 8)) - 1; - nGraphicsMask[1] = ((len1 * 2) / ( 8 * 8)) - 1; - nGraphicsMask[2] = ((len2 * 2) / (16 * 16)) - 1; - - BurnFree (tmp); - - return 0; -} - -static INT32 GrdnstrmGfxDecode(INT32 len0, INT32 len1, INT32 len2) -{ - INT32 Plane[8] = { 0x000, 0x001, 0x002, 0x003, (len1*4), (len1*4)+1, (len1*4)+2, (len1*4)+3 }; - INT32 XOffs[16] = { 0x000, 0x004, 0x008, 0x00c, 0x010, 0x014, 0x018, 0x01c, - 0x200, 0x204, 0x208, 0x20c, 0x210, 0x214, 0x218, 0x21c }; - INT32 YOffs[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc((len2 >= len1) ? len2 : len1); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, len0); - - GfxDecode((len0 * 2) / ( 8 * 8), 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, len1); - - GfxDecode((len1 * 1) / (16 * 16), 8, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, len2); - - GfxDecode((len2 * 2) / (16 * 16), 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM2); - - nGraphicsMask[0] = ((len0 * 2) / ( 8 * 8)) - 1; - nGraphicsMask[1] = ((len1 * 1) / (16 * 16)) - 1; - nGraphicsMask[2] = ((len2 * 2) / (16 * 16)) - 1; - is_8bpp = 1; - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(INT32 (*pLoadCallback)()) // tharrier, manybloc -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pLoadCallback) { - if (pLoadCallback()) return 1; - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(tharrier_sound_write); - ZetSetReadHandler(tharrier_sound_read); - ZetSetOutHandler(tharrier_sound_out); - ZetSetInHandler(tharrier_sound_in); - ZetClose(); - - BurnSetRefreshRate(56.00); - - BurnYM2203Init(1, 1500000, &DrvYM2203IrqHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(6000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.50, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 4000000 / 165, 1); - MSM6295Init(1, 4000000 / 165, 1); - MSM6295SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 BjtwinInit(INT32 (*pLoadCallback)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pLoadCallback) { - if (pLoadCallback()) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x09c000, 0x09cfff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x09d000, 0x09dfff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, bjtwin_main_write_word); - SekSetWriteByteHandler(0, bjtwin_main_write_byte); - SekSetReadWordHandler(0, bjtwin_main_read_word); - SekSetReadByteHandler(0, bjtwin_main_read_byte); - SekClose(); - - BurnSetRefreshRate(56.00); - - MSM6295Init(0, 4000000 / 165, 1); - MSM6295Init(1, 4000000 / 165, 1); - MSM6295SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - MSM6295x2_only = 1; - no_z80 = 1; - - NMK112_init(0, DrvSndROM0, DrvSndROM1, 0x100000, 0x100000); - NMK112_enabled = 1; - - GenericTilesInit(); - - BjtwinDoReset(); - - return 0; -} - -static INT32 Macross2Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - memcpy (DrvZ80ROM + 0x10000, DrvZ80ROM, 0x20000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 5, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x400000); - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 7, 1)) return 1; - - DrvGfxDecode(0x20000, 0x200000, 0x400000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x130000, 0x1307ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x140000, 0x143fff, MAP_RAM); - SekMapMemory(DrvBgRAM1, 0x144000, 0x147fff, MAP_RAM); - SekMapMemory(DrvBgRAM2, 0x148000, 0x14bfff, MAP_RAM); - SekMapMemory(DrvBgRAM3, 0x14c000, 0x14ffff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x170000, 0x170fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x171000, 0x171fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x1f0000, 0x1fffff, MAP_RAM); - SekSetWriteWordHandler(0, macross2_main_write_word); - SekSetWriteByteHandler(0, macross2_main_write_byte); - SekSetReadWordHandler(0, macross2_main_read_word); - SekSetReadByteHandler(0, macross2_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + 0x8000); - ZetMapArea(0xc000, 0xdfff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xdfff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xdfff, 2, DrvZ80RAM); - ZetSetWriteHandler(macross2_sound_write); - ZetSetReadHandler(macross2_sound_read); - ZetSetOutHandler(macross2_sound_out); - ZetSetInHandler(macross2_sound_in); - ZetClose(); - - BurnSetRefreshRate(56.00); - - BurnYM2203Init(1, 1500000, &DrvYM2203IrqHandler, Macross2SynchroniseStream, Macross2GetTime, 0); - BurnTimerAttachZet(4000000); - - if (Tdragon2mode) { - BurnYM2203SetAllRoutes(0, 3.00, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 0.50); - } else { - BurnYM2203SetAllRoutes(0, 0.90, BURN_SND_ROUTE_BOTH); - } - - MSM6295Init(0, 4000000 / 165, 1); - MSM6295Init(1, 4000000 / 165, 1); - MSM6295SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - - if (Tdragon2mode) { - NMK112_init(0, DrvSndROM0, DrvSndROM1, 0x200000, 0x200000); - } else { - NMK112_init(0, DrvSndROM0, DrvSndROM1, 0x200000, 0x100000); - } - - NMK112_enabled = 1; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 MSM6295x1Init(INT32 (*pLoadCallback)()) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pLoadCallback) { - if (pLoadCallback()) return 1; - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(ssmissin_sound_write); - ZetSetReadHandler(ssmissin_sound_read); - ZetClose(); - - BurnSetRefreshRate(56.00); - - MSM6295Init(0, 1000000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - MSM6295x1_only = 1; - - GenericTilesInit(); - - SmissinDoReset(); - - return 0; -} - -static INT32 SeibuSoundInit(INT32 (*pLoadCallback)(), INT32 type) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pLoadCallback) { - if (pLoadCallback()) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - - if (type) { // mustangb - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_WRITE); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_ROM); - } else { // tdragonb - SekMapMemory(Drv68KRAM, 0x0b0000, 0x0bffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x0c4000, 0x0c43ff, MAP_WRITE); - SekMapMemory(DrvPalRAM, 0x0c8000, 0x0c87ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x0cc000, 0x0cffff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x0d0000, 0x0d07ff, MAP_RAM); - } - SekSetWriteWordHandler(0, mustangb_main_write_word); - SekSetWriteByteHandler(0, mustangb_main_write_byte); - SekSetReadWordHandler(0, mustangb_main_read_word); - SekSetReadByteHandler(0, mustangb_main_read_byte); - SekClose(); - - BurnSetRefreshRate(56.00); - - SeibuZ80ROM = DrvZ80ROM; - SeibuZ80RAM = DrvZ80RAM; - seibu_sound_init(0, 0, 3579545, 3579545, 1320000 / 132); - - GenericTilesInit(); - - SeibuSoundDoReset(); - - return 0; -} - -static INT32 AfegaInit(INT32 (*pLoadCallback)(), void (*pZ80Callback)(), INT32 pin7high) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pLoadCallback) { - if (pLoadCallback()) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x084000, 0x0843ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0c0000, 0x0cffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_ROM); - SekSetWriteWordHandler(0, afega_main_write_word); - SekSetWriteByteHandler(0, afega_main_write_byte); - SekSetReadWordHandler(0, afega_main_read_word); - SekSetReadByteHandler(0, afega_main_read_byte); - SekClose(); - - if (pZ80Callback) { - pZ80Callback(); - } - - BurnSetRefreshRate(56.00); - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.30, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.30, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1000000 / (pin7high ? 132 : 165), 1); - MSM6295Init(1, 1000000 / (pin7high ? 132 : 165), 1); - MSM6295SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.60, BURN_SND_ROUTE_BOTH); - AFEGA_SYS = 1; - - GenericTilesInit(); - - AfegaDoReset(); - - return 0; -} - -static INT32 NMK004Init(INT32 (*pLoadCallback)(), INT32 nCpuSpeed) -{ - BurnSetRefreshRate(56.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - NMK004OKIROM0 = DrvSndROM0; - NMK004OKIROM1 = DrvSndROM1; - NMK004PROGROM = DrvZ80ROM; - - nNMK004CpuSpeed = nCpuSpeed; - - if (pLoadCallback) { - pLoadCallback(); - } - - if (BurnLoadRom(NMK004PROGROM + 0x0000, 0x80, 1)) return 1; // load nmk004 rom ^^ - - Strahlmode = (strncmp(BurnDrvGetTextA(DRV_NAME), "strahl", 6) == 0); - NMK004_init(); - - no_z80 = 1; - NMK004_enabled = 1; - - GenericTilesInit(); - - NMK004DoReset(); - - return 0; -} - -static INT32 CommonExit() -{ - GenericTilesExit(); - - SekExit(); - - BurnFree (AllMem); - - input_high[0] = input_high[1] = 0; - is_8bpp = 0; - global_y_offset = 16; - videoshift = 0; - screen_flip_y = 0; - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - BurnYM2203Exit(); - MSM6295Exit(0); - MSM6295Exit(1); - MSM6295ROM = NULL; - NMK112_enabled = 0; - Tharriermode = 0; - Macrossmode = 0; - Strahlmode = 0; - Tdragon2mode = 0; - TharrierShakey = 0; - - return CommonExit(); -} - -static INT32 MSM6295x1Exit() -{ - ZetExit(); - MSM6295Exit(0); - MSM6295ROM = NULL; - MSM6295x1_only = 0; - - return CommonExit(); -} - -static INT32 SeibuSoundExit() -{ - GenericTilesExit(); - - seibu_sound_exit(); - SekExit(); - - BurnFree (AllMem); - - input_high[0] = input_high[1] = 0; - is_8bpp = 0; - global_y_offset = 16; - videoshift = 0; - - return 0; -} - -static INT32 AfegaExit() -{ - ZetExit(); - BurnYM2151Exit(); - MSM6295Exit(0); - MSM6295Exit(1); - MSM6295ROM = NULL; - AFEGA_SYS = 0; - - return CommonExit(); -} - -static INT32 BjtwinExit() -{ - MSM6295Exit(0); - MSM6295Exit(1); - MSM6295ROM = NULL; - MSM6295x2_only = 0; - no_z80 = 0; - NMK112_enabled = 0; - - return CommonExit(); -} - - -static INT32 NMK004Exit() -{ - NMK004_exit(); - MSM6295ROM = NULL; - no_z80 = 0; - NMK004_enabled = 0; - GunnailMode = 0; - mustang_bg_xscroll = 0; - - return CommonExit(); -} - -//------------------------------------------------------------------------------------------------------------------ - -static void DrvPaletteRecalc() -{ - UINT8 r,g,b; - UINT16 *pal = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x400; i++) { - INT32 data = BURN_ENDIAN_SWAP_INT16(pal[i]); - - r = ((data >> 11) & 0x1e) | ((data >> 3) & 0x01); - g = ((data >> 7) & 0x1e) | ((data >> 2) & 0x01); - b = ((data >> 3) & 0x1e) | ((data >> 1) & 0x01); - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_sprites(INT32 flip, INT32 coloff, INT32 coland, INT32 priority) -{ - UINT16 *sprram = (Tharriermode) ? (UINT16*)DrvSprBuf3 : (UINT16*)DrvSprBuf2; - - if (Tharriermode && TharrierShakey && nCurrentFrame & 1) { - sprram = (UINT16*)DrvSprBuf2; - } - - for (INT32 offs = 0; offs < 0x1000/2; offs += 8) - { - if (BURN_ENDIAN_SWAP_INT16(sprram[offs]) & 0x0001) - { - INT32 sx = (BURN_ENDIAN_SWAP_INT16(sprram[offs+4]) & 0x01ff) + videoshift; - INT32 sy = (BURN_ENDIAN_SWAP_INT16(sprram[offs+6]) & 0x01ff); - INT32 code = BURN_ENDIAN_SWAP_INT16(sprram[offs+3]) & nGraphicsMask[2]; - INT32 color = BURN_ENDIAN_SWAP_INT16(sprram[offs+7]) & coland; - INT32 w = (BURN_ENDIAN_SWAP_INT16(sprram[offs+1]) & 0x000f); - INT32 h = ((BURN_ENDIAN_SWAP_INT16(sprram[offs+1]) & 0x00f0) >> 4); - INT32 pri = ((BURN_ENDIAN_SWAP_INT16(sprram[offs+0]) & 0x00c0) >> 6); - INT32 flipy = ((BURN_ENDIAN_SWAP_INT16(sprram[offs+1]) & 0x0200) >> 9); - INT32 flipx = ((BURN_ENDIAN_SWAP_INT16(sprram[offs+1]) & 0x0100) >> 8); - - if (!flip) flipy = flipx = 0; - - color = (color << 4) + coloff; - - INT32 delta = 16; - - if (priority != -1 && pri != priority) - continue; - - if (*flipscreen) - { - sx = 368 - sx; - sy = 240 - sy; - delta = -16; - - flipx ^= *flipscreen; - flipy ^= *flipscreen; - } - - INT32 yy = h; - sy += flipy ? (delta * h) : 0; - - do - { - INT32 x = sx + (flipx ? (delta * w) : 0); - INT32 xx = w; - - do - { - INT32 xxx = ((x + 16) & 0x1ff) - 16; - INT32 yyy = (sy & 0x1ff) - global_y_offset; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, xxx, yyy, color, 0, 15, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, xxx, yyy, color, 0, 15, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, xxx, yyy, color, 0, 15, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, xxx, yyy, color, 0, 15, 0, DrvGfxROM2); - } - } - code = (code + 1) & nGraphicsMask[2]; - x += delta * (flipx ? -1 : 1); - - } while (--xx >= 0); - sy += delta * (flipy ? -1 : 1); - - } while (--yy >= 0); - } - } -} - -static void draw_sprites_tdragon2(INT32 flip, INT32 coloff, INT32 coland) -{ - UINT16 *sprram; - - static INT32 bittbl[8] = { - 4, 6, 5, 7, 3, 2, 1, 0 - }; - - for (INT32 i = 0; i < 0x100; i++) - { - INT32 spr = BITSWAP08(i, bittbl[0], bittbl[1], bittbl[2], bittbl[3], bittbl[4], bittbl[5], bittbl[6], bittbl[7]); - sprram = (UINT16*)DrvSprBuf2 + ((spr << 4) >> 1); - - if (BURN_ENDIAN_SWAP_INT16(sprram[0]) & 0x0001) - { - INT32 sx = (BURN_ENDIAN_SWAP_INT16(sprram[4]) & 0x01ff) + videoshift; - INT32 sy = (BURN_ENDIAN_SWAP_INT16(sprram[6]) & 0x01ff); - INT32 code = BURN_ENDIAN_SWAP_INT16(sprram[3]) & nGraphicsMask[2]; - INT32 color = BURN_ENDIAN_SWAP_INT16(sprram[7]) & coland; - INT32 w = (BURN_ENDIAN_SWAP_INT16(sprram[1]) & 0x000f); - INT32 h = ((BURN_ENDIAN_SWAP_INT16(sprram[1]) & 0x00f0) >> 4); - INT32 flipy = ((BURN_ENDIAN_SWAP_INT16(sprram[1]) & 0x0200) >> 9); - INT32 flipx = ((BURN_ENDIAN_SWAP_INT16(sprram[1]) & 0x0100) >> 8); - - if (!flip) flipy = flipx = 0; - - color = (color << 4) + coloff; - - INT32 delta = 16; - - if (*flipscreen) - { - sx = 368 - sx; - sy = 240 - sy; - delta = -16; - - flipx ^= *flipscreen; - flipy ^= *flipscreen; - } - - INT32 yy = h; - sy += flipy ? (delta * h) : 0; - - do - { - INT32 x = sx + (flipx ? (delta * w) : 0); - INT32 xx = w; - - do - { - INT32 xxx = ((x + 16) & 0x1ff) - 16; - INT32 yyy = (sy & 0x1ff) - global_y_offset; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, xxx, yyy, color, 0, 15, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, xxx, yyy, color, 0, 15, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, xxx, yyy, color, 0, 15, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, xxx, yyy, color, 0, 15, 0, DrvGfxROM2); - } - } - code = (code + 1) & nGraphicsMask[2]; - x += delta * (flipx ? -1 : 1); - - } while (--xx >= 0); - sy += delta * (flipy ? -1 : 1); - - } while (--yy >= 0); - } - } -} - -static void draw_macross_background(UINT8 *ram, INT32 scrollx, INT32 scrolly, INT32 coloff, INT32 t) -{ - scrolly = (scrolly + global_y_offset) & 0x1ff; - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 0x100 * 0x20; offs++) - { - INT32 sx = (offs & 0xff) << 4; - INT32 sy = (offs >> 8) << 4; - - INT32 row = sy >> 4; - INT32 col = sx >> 4; - - sx = (((sx - scrollx) + 16) & 0xfff) - 16; - sy = (((sy - scrolly) + 16) & 0x1ff) - 16; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 ofst = ((row >> 4) << 12) | (row & 0x0f) | (col << 4); - - if (is_8bpp) { - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[ofst]) & nGraphicsMask[1]; - - Render16x16Tile_Clip(pTransDraw, code, sx, sy, 0, 8, coloff, DrvGfxROM1); - } else { - INT32 code = ((BURN_ENDIAN_SWAP_INT16(vram[ofst]) & 0xfff) | (*tilebank << 12)) & nGraphicsMask[1]; - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[ofst]) >> 12; - - if (t) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, coloff, DrvGfxROM1); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, coloff, DrvGfxROM1); - } - } - } -} - -static void draw_gunnail_background(UINT8 *ram) -{ - INT32 bank = (*tilebank << 12) & nGraphicsMask[1]; // good enough?? - UINT16 *vram = (UINT16*)ram; - UINT16 *scroll = (UINT16*)DrvScrollRAM; - - for (INT32 y = 16; y < nScreenHeight + 16; y++) - { - INT32 yscroll = (BURN_ENDIAN_SWAP_INT16(scroll[0x100]) + BURN_ENDIAN_SWAP_INT16(scroll[0x100 | y]) + y) & 0x1ff; - - INT32 row = yscroll >> 4; - INT32 yl = (yscroll & 0x0f) << 4; - - INT32 ofst0 = ((row >> 4) << 12) | (row & 0x0f); - INT32 xscroll0 = BURN_ENDIAN_SWAP_INT16(scroll[0]) + BURN_ENDIAN_SWAP_INT16(scroll[y]) - videoshift; - - UINT16 *dest = pTransDraw + (y - 16) * nScreenWidth; - - for (INT32 x = 0; x < nScreenWidth + 16; x+=16) - { - INT32 xscroll = (x + xscroll0) & 0xfff; - INT32 sx = x - (xscroll & 0x0f); - - INT32 ofst = ofst0 | (xscroll & 0xff0); - - INT32 code = (BURN_ENDIAN_SWAP_INT16(vram[ofst]) & 0xfff) | bank; - INT32 color = (BURN_ENDIAN_SWAP_INT16(vram[ofst]) >> 12) << 4; - - UINT8 *src = DrvGfxROM1 + (code << 8) + yl; - - for (INT32 xx = 0; xx < 16; xx++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - dest[sx] = src[xx] | color; - } - } - } -} - -static void draw_bjtwin_background(INT32 scrollx) -{ - UINT16 *vram = (UINT16*)DrvBgRAM0; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs >> 5) << 3; - INT32 sy = (offs & 0x1f) << 3; - - sy -= global_y_offset; - sx = (((sx - scrollx) + 8) & 0x1ff) - 8; - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - INT32 color = code >> 12; - INT32 bank = code & 0x800; - code &= 0x7ff; - if (bank) code |= (*tilebank << 11); - code &= nGraphicsMask[1]; - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, bank ? DrvGfxROM1 : DrvGfxROM0); - } -} - -static void bioship_draw_background(INT32 scrollx, INT32 scrolly) -{ - scrolly = (scrolly + global_y_offset) & 0x1ff; - INT32 bank = *tilebank * 0x2000; - UINT16 *tilerom = (UINT16*)DrvTileROM; - - for (INT32 offs = 0; offs < 0x1000; offs++) - { - INT32 sx = (offs >> 4) << 4; - INT32 sy = (offs & 0x0f) << 4; - - sx = (((sx + 16) - scrollx) & 0xfff) - 16; - - if (sx >= nScreenWidth) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(tilerom[offs | bank]); - sy = (((sy + 16) - scrolly) & 0x1ff) - 16; - - if (sy < nScreenHeight) { - Render16x16Tile_Clip(pTransDraw, code & 0xfff, sx, sy, code >> 12, 4, 0, DrvGfxROM1 + 0x100000); - } - - code = BURN_ENDIAN_SWAP_INT16(tilerom[offs | bank | 0x1000]); - sy = (((sy + 16) + 256) & 0x1ff) - 16; - - if (sy < nScreenHeight) { - Render16x16Tile_Clip(pTransDraw, code & 0xfff, sx, sy, code >> 12, 4, 0, DrvGfxROM1 + 0x100000); - } - } -} - -static void draw_tharriermacross1_text_layer(INT32 scrollx, INT32 scrolly, INT32 wide, INT32 coloff) -{ - if (nGraphicsMask[0] == 0) return; - - scrolly = (scrolly + global_y_offset) & 0x1ff; - INT32 pf_width = (0x100 << wide); - UINT16 *vram = (UINT16*)DrvTxRAM; - - for (INT32 offs = 0; offs < 32 * (32 << wide); offs++) - { - INT32 sx = (offs >> 5) << 3; - INT32 sy = (offs & 0x1f) << 3; - - sx -= scrollx; - if (sx < -7) sx += pf_width; // wrap - sy -= scrolly; - if (sy < -7) sy += 256; // wrap - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - - Render8x8Tile_Mask_Clip(pTransDraw, code & 0xfff, sx, sy, code >> 12, 4, 15, coloff, DrvGfxROM0); - } -} - -static void draw_macross_text_layer(INT32 scrollx, INT32 scrolly, INT32 wide, INT32 coloff) -{ - if (nGraphicsMask[0] == 0) return; - - scrolly = (scrolly + global_y_offset) & 0x1ff; - INT32 wmask = (0x100 << wide) - 1; - UINT16 *vram = (UINT16*)DrvTxRAM; - - for (INT32 offs = 0; offs < 32 * (32 << wide); offs++) - { - INT32 sx = (offs >> 5) << 3; - INT32 sy = (offs & 0x1f) << 3; - - sx = (((sx - scrollx) + 8) & wmask) - 8; - sy = (((sy - scrolly) + 8) & 0xff) - 8; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]); - - Render8x8Tile_Mask_Clip(pTransDraw, code & 0xfff, sx, sy, code >> 12, 4, 15, coloff, DrvGfxROM0); - } -} - -static void draw_screen_yflip() -{ - if (!screen_flip_y) return; - - UINT16 *tmp = (UINT16*)pBurnDraw; // :D - UINT16 *src1 = pTransDraw; - UINT16 *src2 = pTransDraw + (nScreenHeight-1) * nScreenWidth; - - for (INT32 y = 0; y < nScreenHeight / 2; y++) { - memcpy (tmp, src1, nScreenWidth * 2); - memcpy (src1, src2, nScreenWidth * 2); - memcpy (src2, tmp, nScreenWidth * 2); - src1 += nScreenWidth; - src2 -= nScreenWidth; - } -} - -static inline void common_draw(INT32 spriteflip, INT32 bgscrollx, INT32 bgscrolly, INT32 txscrollx, INT32 txscrolly, INT32 tx_coloff, INT32 wide) -{ - DrvPaletteRecalc(); - - if (nBurnLayer & 1) draw_macross_background(DrvBgRAM0, bgscrollx, bgscrolly, 0, 0); - - if (spriteflip == -1 || Tharriermode) { - if (nSpriteEnable & 1) draw_sprites((spriteflip == -1) ? 0 : 1, 0x100, 0x0f, -1); // order-based - } else { // priority-based - if (nSpriteEnable & 1) draw_sprites(spriteflip, 0x100, 0x0f, 3); - if (nSpriteEnable & 2) draw_sprites(spriteflip, 0x100, 0x0f, 2); - if (nSpriteEnable & 4) draw_sprites(spriteflip, 0x100, 0x0f, 1); - if (nSpriteEnable & 8) draw_sprites(spriteflip, 0x100, 0x0f, 0); - } - - if (Tharriermode || Macrossmode) { // Tharrier and Macross 1 - if (nBurnLayer & 2) draw_tharriermacross1_text_layer(txscrollx, txscrolly, wide, tx_coloff); - } else { // Macross 2 and all the rest... - if (nBurnLayer & 2) draw_macross_text_layer(txscrollx, txscrolly, wide, tx_coloff); - } - - draw_screen_yflip(); - BurnTransferCopy(DrvPalette); -} - -static INT32 TharrierDraw() -{ - INT32 scrollx = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(Drv68KRAM + 0x9f00))) & 0xfff; - - { - // shakey ship hack - // f3310 & f3410 are 0x100 during the shakey transition - UINT16 *f3310 = (UINT16*)&Drv68KRAM[0x3310>>0]; - UINT16 *f3410 = (UINT16*)&Drv68KRAM[0x3410>>0]; - - TharrierShakey = (f3310[0] == 0x100 && f3410[0] == 0x100); - } - - common_draw(1, scrollx, 0, 0, 0, 0, 0); - - return 0; -} - -static INT32 ManyblocDraw() -{ - UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 scrollx = BURN_ENDIAN_SWAP_INT16(scroll[0x82 / 2]) & 0xfff; - INT32 scrolly = BURN_ENDIAN_SWAP_INT16(scroll[0xc2 / 2]) & 0x1ff; - - common_draw(1, scrollx, scrolly, 0, 0, 0, 0); - - return 0; -} - -static INT32 MacrossDraw() -{ - UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 scrollx = ((BURN_ENDIAN_SWAP_INT16(scroll[0]) & 0x0f) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[1]) & 0xff); - INT32 scrolly = ((BURN_ENDIAN_SWAP_INT16(scroll[2]) & 0x01) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[3]) & 0xff); - - common_draw(0, scrollx, scrolly, 0, 0, 0x200, 0); - - return 0; -} - -static INT32 MustangDraw() -{ - //UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 scrollx = mustang_bg_xscroll; //((BURN_ENDIAN_SWAP_INT16(scroll[0]) & 0x0f) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[1]) & 0xff); - INT32 scrolly = 0; //((BURN_ENDIAN_SWAP_INT16(scroll[2]) & 0x01) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[3]) & 0xff); - - common_draw(-1, scrollx, scrolly, 0, 0, 0x200, 1); - - return 0; -} - -static INT32 AcrobatmDraw() -{ - UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 scrollx = ((BURN_ENDIAN_SWAP_INT16(scroll[0]) & 0x0f) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[1]) & 0xff); - INT32 scrolly = ((BURN_ENDIAN_SWAP_INT16(scroll[2]) & 0x01) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[3]) & 0xff); - - common_draw(0, scrollx, scrolly, 0, 0, 0x200, 1); - - return 0; -} - -static INT32 VandykeDraw() -{ - UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 scrollx = ((BURN_ENDIAN_SWAP_INT16(scroll[0]) & 0x0f) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[1]) >> 8); - INT32 scrolly = ((BURN_ENDIAN_SWAP_INT16(scroll[2]) & 0x01) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[3]) >> 8); - - common_draw(0, scrollx, scrolly, 0, 0, 0x200, 1); - - return 0; -} - -static INT32 RedhawkiDraw() -{ - UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 scrollx = BURN_ENDIAN_SWAP_INT16(scroll[2]) & 0xff; - INT32 scrolly = BURN_ENDIAN_SWAP_INT16(scroll[3]) & 0xff; - - common_draw(0, scrollx, scrolly, 0, 0, 0x300, 0); - - return 0; -} - -static INT32 FirehawkDraw() -{ - UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 scrolly = (BURN_ENDIAN_SWAP_INT16(scroll[3]) + 0x100) & 0x1ff; - INT32 scrollx = (BURN_ENDIAN_SWAP_INT16(scroll[1]) - 0x100) & 0xfff; - - common_draw(1, scrollx, scrolly, 0, 0, 0x200, 0); - - return 0; -} - -static INT32 HachamfDraw() -{ - if (nNMK004CpuSpeed == 10000000) { // hachamf - mcu_run(0); - } else { // tdragon - mcu_run(1); - } - - UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 scrollx = ((BURN_ENDIAN_SWAP_INT16(scroll[0]) & 0x0f) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[1]) & 0xff); - INT32 scrolly = ((BURN_ENDIAN_SWAP_INT16(scroll[2]) & 0x01) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[3]) & 0xff); - - common_draw(0, scrollx, scrolly, 0, 0, 0x200, 1); - - return 0; -} - -static INT32 StrahlDraw() -{ - DrvPaletteRecalc(); - - UINT16 *scroll = (UINT16*)DrvScrollRAM; - - INT32 bgscrollx = ((BURN_ENDIAN_SWAP_INT16(scroll[0x000]) & 0x0f) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[0x001]) & 0xff); - INT32 bgscrolly = ((BURN_ENDIAN_SWAP_INT16(scroll[0x002]) & 0x01) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[0x003]) & 0xff); - INT32 fgscrollx = ((BURN_ENDIAN_SWAP_INT16(scroll[0x200]) & 0x0f) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[0x201]) & 0xff); - INT32 fgscrolly = ((BURN_ENDIAN_SWAP_INT16(scroll[0x202]) & 0x01) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[0x203]) & 0xff); - - draw_macross_background(DrvBgRAM0, bgscrollx, bgscrolly, 0x300, 0); - - INT32 bgbank_bak = *tilebank; *tilebank = 0x01; - draw_macross_background(DrvBgRAM1, fgscrollx, fgscrolly, 0x200, 1); - *tilebank = bgbank_bak; - - draw_sprites(0, 0x100, 0x0f, 3); - draw_sprites(0, 0x100, 0x0f, 2); - draw_sprites(0, 0x100, 0x0f, 1); - draw_sprites(0, 0x100, 0x0f, 0); - - draw_macross_text_layer(0, 0, 1, 0); - - draw_screen_yflip(); - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 Macross2Draw() -{ - videoshift = 64; - DrvPaletteRecalc(); - - UINT16 *scroll = (UINT16*)DrvScrollRAM; - - INT32 scrollx = ((BURN_ENDIAN_SWAP_INT16(scroll[0]) & 0x0f) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[1]) & 0xff); - INT32 scrolly = ((BURN_ENDIAN_SWAP_INT16(scroll[2]) & 0x01) << 8) | (BURN_ENDIAN_SWAP_INT16(scroll[3]) & 0xff); - - switch (scroll[0] & 0x30) - { - case 0x00: draw_macross_background(DrvBgRAM0, (scrollx - 64) & 0xfff, scrolly, 0, 0); break; - case 0x10: draw_macross_background(DrvBgRAM1, (scrollx - 64) & 0xfff, scrolly, 0, 0); break; - case 0x20: draw_macross_background(DrvBgRAM2, (scrollx - 64) & 0xfff, scrolly, 0, 0); break; - case 0x30: draw_macross_background(DrvBgRAM3, (scrollx - 64) & 0xfff, scrolly, 0, 0); break; - } - - if (Tdragon2mode) { - draw_sprites_tdragon2(0, 0x100, 0x1f); - } else { - draw_sprites(0, 0x100, 0x1f, 3); - draw_sprites(0, 0x100, 0x1f, 2); - draw_sprites(0, 0x100, 0x1f, 1); - draw_sprites(0, 0x100, 0x1f, 0); - } - - draw_macross_text_layer(-64, 0, 1, 0x300); - - draw_screen_yflip(); - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 GunnailDraw() -{ - DrvPaletteRecalc(); - - videoshift = 64; - UINT16 *scroll = (UINT16*)DrvScrollRAM; - - switch ((BURN_ENDIAN_SWAP_INT16(scroll[0]) >> 8) & 0x30) - { - case 0x00: draw_gunnail_background(DrvBgRAM0); break; - //case 0x10: draw_gunnail_background(DrvBgRAM1); break; - //case 0x20: draw_gunnail_background(DrvBgRAM2); break; - //case 0x30: draw_gunnail_background(DrvBgRAM3); break; - - // GunNail only has a single ram bank. If it tries to - // use another, just clear everything. - - case 0x10: - case 0x20: - case 0x30: - BurnTransferClear(); - break; - } - - draw_sprites(0, 0x100, 0x0f, 3); - draw_sprites(0, 0x100, 0x0f, 2); - draw_sprites(0, 0x100, 0x0f, 1); - draw_sprites(0, 0x100, 0x0f, 0); - - draw_macross_text_layer(-64, 0, 1, 0x200); - - draw_screen_yflip(); - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 RapheroDraw() -{ - DrvPaletteRecalc(); - - videoshift = 64; - UINT16 *scroll = (UINT16*)DrvScrollRAM; - - switch ((BURN_ENDIAN_SWAP_INT16(scroll[0]) >> 8) & 0x30) - { - case 0x00: draw_gunnail_background(DrvBgRAM0); break; - case 0x10: draw_gunnail_background(DrvBgRAM1); break; - case 0x20: draw_gunnail_background(DrvBgRAM2); break; - case 0x30: draw_gunnail_background(DrvBgRAM3); break; - } - - draw_sprites(0, 0x100, 0x1f, 3); - draw_sprites(0, 0x100, 0x1f, 2); - draw_sprites(0, 0x100, 0x1f, 1); - draw_sprites(0, 0x100, 0x1f, 0); - - draw_macross_text_layer(-64, 0, 1, 0x300); - - draw_screen_yflip(); - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 BioshipDraw() -{ - DrvPaletteRecalc(); - - UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 bgscrolly = (BURN_ENDIAN_SWAP_INT16(scroll[0x08 + 0x02]) & 0x100) | (BURN_ENDIAN_SWAP_INT16(scroll[0x08 + 0x03]) >> 8); - INT32 bgscrollx = (BURN_ENDIAN_SWAP_INT16(scroll[0x08 + 0x00]) & 0xf00) | (BURN_ENDIAN_SWAP_INT16(scroll[0x08 + 0x01]) >> 8); - INT32 fgscrolly = (BURN_ENDIAN_SWAP_INT16(scroll[0x02]) & 0x100) | (BURN_ENDIAN_SWAP_INT16(scroll[0x03]) >> 8); - INT32 fgscrollx = (BURN_ENDIAN_SWAP_INT16(scroll[0x00]) & 0xf00) | (BURN_ENDIAN_SWAP_INT16(scroll[0x01]) >> 8); - - bioship_draw_background(bgscrollx, bgscrolly); - - INT32 bgbank_bak = *tilebank; *tilebank = 0; - draw_macross_background(DrvBgRAM0, fgscrollx, fgscrolly, 0x100, 1); - *tilebank = bgbank_bak; - - draw_sprites(0, 0x200, 0x0f, 3); - draw_sprites(0, 0x200, 0x0f, 2); - draw_sprites(0, 0x200, 0x0f, 1); - draw_sprites(0, 0x200, 0x0f, 0); - - draw_macross_text_layer(0, 0, 1, 0x300); - - draw_screen_yflip(); - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 BjtwinDraw() -{ - videoshift = 64; - - DrvPaletteRecalc(); - - draw_bjtwin_background(-64); - - draw_sprites(0, 0x100, 0x0f, 3); - draw_sprites(0, 0x100, 0x0f, 2); - draw_sprites(0, 0x100, 0x0f, 1); - draw_sprites(0, 0x100, 0x0f, 0); - - draw_screen_yflip(); - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void AfegaCommonDraw(INT32 , INT32 xoffset, INT32 yoffset) -{ - UINT16 *scroll = (UINT16*)DrvScrollRAM; - INT32 bgscrollx = (BURN_ENDIAN_SWAP_INT16(scroll[1]) + xoffset) & 0xfff; - INT32 bgscrolly = (BURN_ENDIAN_SWAP_INT16(scroll[0]) + yoffset) & 0x1ff; - INT32 txscrollx = (BURN_ENDIAN_SWAP_INT16(scroll[3]) & 0xff); - INT32 txscrolly = (BURN_ENDIAN_SWAP_INT16(scroll[2]) & 0xff); - - common_draw(1, bgscrollx, bgscrolly, txscrollx, txscrolly, 0x200, 0); -} - -static INT32 AfegaDraw() -{ - AfegaCommonDraw(1, -0x100, 0); - return 0; -} - -static INT32 RedhawkbDraw() -{ - AfegaCommonDraw(1, 0, 0x100); - return 0; -} - -static INT32 Bubl2000Draw() -{ - AfegaCommonDraw(0, -0x100, 0); - return 0; -} - -static INT32 DrvFrame() // tharrier, manybloc -{ - if (DrvReset) { - DrvDoReset(); - } - - if (Tharriermode) - { - DrvInputs[0] = 0x8000; - DrvInputs[1] = 0x0000; - DrvInputs[2] = 0x0000; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - if (DrvInputs[0] & 0x0001) DrvInputs[1] ^= 0x0080; - if (DrvInputs[0] & 0x0002) DrvInputs[1] ^= 0x0020; - if (DrvInputs[0] & 0x0008) DrvInputs[1] ^= 0x0001; - if (DrvInputs[0] & 0x0010) DrvInputs[1] ^= 0x0102; - } - else - { - DrvInputs[0] = ~input_high[0]; - DrvInputs[1] = ~input_high[1]; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - ZetNewFrame(); - - INT32 nSegment; - INT32 nInterleave = 263; - INT32 nTotalCycles[2] = { 12000000 / 56, 6000000 / 56 }; // a little oc to quench that horrible slowdown in tharrier - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nTotalCycles[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - - if (i == 25 || i == ((nInterleave / 2) + 25)) { - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - - if (i == (nInterleave - 1)) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == 240-1) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - if (i == 241-1) { //sprdma - memcpy (DrvSprBuf3, DrvSprBuf2, 0x1000); - memcpy (DrvSprBuf2, Drv68KRAM + 0x8000, 0x1000); - } - - BurnTimerUpdate((i + 1) * (nTotalCycles[1] / nInterleave)); - } - - BurnTimerEndFrame(nTotalCycles[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029732; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = MemEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - if (!no_z80) - ZetScan(nAction); - SekScan(nAction); - if (strcmp(BurnDrvGetTextA(DRV_NAME), "raphero") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "arcadian") == 0) { - tlcs90Scan(nAction); - } - - if (AFEGA_SYS) { - if (strstr(BurnDrvGetTextA(DRV_NAME), "ssmiss") || - strstr(BurnDrvGetTextA(DRV_NAME), "twinact") || - strstr(BurnDrvGetTextA(DRV_NAME), "dolmen")) { - // Afega with no YM - } else { - if (!MSM6295x2_only && !MSM6295x1_only) - BurnYM2151Scan(nAction); // twin action,etc dont use this - // and will crash if called. - } - } else { - // Everything else - if (!MSM6295x1_only && !MSM6295x2_only) - BurnYM2203Scan(nAction, pnMin); - } - - MSM6295Scan(0, nAction); - if (!MSM6295x1_only) - MSM6295Scan(1, nAction); - - SCAN_VAR(macross2_sound_enable); - if (NMK004_enabled) { - NMK004Scan(nAction, pnMin); - } - - if (NMK112_enabled) { - NMK112_Scan(nAction); - } - - } - - if (nAction & ACB_WRITE) { - if (MSM6295x1_only) // S.S. Mission, Dolmen & Twin Action - ssmissin_okibank(*okibank); - } - - return 0; -} - -static INT32 SsmissinFrame() -{ - if (DrvReset) { - SmissinDoReset(); - } - - { - DrvInputs[0] = ~input_high[0]; - DrvInputs[1] = ~input_high[1]; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - ZetNewFrame(); - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nTotalCycles[2] = { 8000000 / 56, 4000000 / 56 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nTotalCycles[0] / nInterleave; - - nCyclesDone[0] += SekRun(nSegment); - -/* if (i == (nInterleave-1) || i == ((nInterleave / 2) - 1)) { - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - SekRun(0); - } - if (i == ((nInterleave/2)-1) && nNMK004EnableIrq2) - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == (nInterleave-1)) - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); -*/ - - if (i == 25 || i == 148) { // 25, 153 in MAME - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - if (i == 0) { - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - if (i == 235) { // 240 in MAME, but causes a missing life-bar in VanDyke. 236 causes a little flicker in the life-bar, 235 = perfect. - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - ZetRun(nTotalCycles[1] / nInterleave); - } - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf2, Drv68KRAM + 0x8000, 0x1000); - - return 0; -} - -static INT32 Macross2Frame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = ~input_high[0]; - DrvInputs[1] = ~input_high[1]; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - ZetNewFrame(); - - INT32 nSegment; - INT32 nInterleave = 200; - INT32 nTotalCycles[2] = { 10000000 / 56, 4000000 / 56 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nTotalCycles[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - if (i == 1 || i == (nInterleave / 2)) { - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - if (i == (nInterleave-1)) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - if (macross2_sound_enable) { - //BurnTimerUpdate((nSegment * 4) / 10); - BurnTimerUpdate(i * (nTotalCycles[1] / nInterleave)); - } - } - - if (macross2_sound_enable) { - BurnTimerEndFrame(nTotalCycles[1]); - } - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf2, Drv68KRAM + 0x8000, 0x1000); - - return 0; -} - -static INT32 AfegaFrame() -{ - if (DrvReset) { - AfegaDoReset(); - } - - ZetNewFrame(); - - { - DrvInputs[0] = ~input_high[0]; - DrvInputs[1] = ~input_high[1]; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 12000000 / 56, 4000000 / 56 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nSegment; - - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - if (i == (nInterleave / 2) - 1) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == (nInterleave) - 1) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - nSegment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(nSegment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf2, Drv68KRAM + 0x8000, 0x1000); - - return 0; -} - -static INT32 BjtwinFrame() -{ - if (DrvReset) { - BjtwinDoReset(); - } - - { - DrvInputs[0] = ~input_high[0]; - DrvInputs[1] = ~input_high[1]; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[1] = { 10000000 / 56 }; - INT32 nCyclesDone[1] = { 0 }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nSegment; - - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - if (i == (nInterleave-1) || i == ((nInterleave / 2) - 1)) { - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - if (i == (nInterleave-1)) { - SekRun(0); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf2, Drv68KRAM + 0x8000, 0x1000); - - return 0; -} - -static INT32 SeibuSoundFrame() -{ - if (DrvReset) { - SeibuSoundDoReset(); - } - - ZetNewFrame(); - - { - DrvInputs[0] = ~input_high[0]; - DrvInputs[1] = ~input_high[1]; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 10000000 / 56, 3579545 / 56 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nSegment; - - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - if (i == (nInterleave-1) || i == ((nInterleave / 2) - 1)) { - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - - if (i == ((nInterleave/2)-1)) { - SekRun(0); - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - if (i == (nInterleave-1)) { - SekRun(0); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - seibu_sound_update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf2, Drv68KRAM + 0x8000, 0x1000); - - return 0; -} - -static INT32 NMK004Frame() -{ - if (DrvReset) { - NMK004DoReset(); - } - - { - DrvInputs[0] = ~input_high[0]; - DrvInputs[1] = ~input_high[1]; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - if (GunnailMode && (LastFakeDip != DrvDips[2])) { - // GunNail - Trap15's Nice Health-warning mod - lowers the volume of the - // "low sheild" warning beeper to a more tollerable level. - LastFakeDip = DrvDips[2]; - DrvZ80ROM[0x52e6] = (DrvDips[2] == 0x08) ? 0xCD : 0x9D; - } - - SekNewFrame(); - tlcs90NewFrame(); - - INT32 nSegment; - INT32 nInterleave = 256; - UINT32 nTotalCycles[2] = { nNMK004CpuSpeed / 56, 8000000 / 56 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - tlcs90Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nTotalCycles[0] / nInterleave; - - nCyclesDone[0] += SekRun(nSegment); - - if (i == 237) { // 241 in MAME (see i == 235 comment) - if (Strahlmode) { - memcpy (DrvSprBuf2, Drv68KRAM + 0xf000, 0x1000); - } else { - memcpy (DrvSprBuf2, Drv68KRAM + 0x8000, 0x1000); - } - } - - if (i == 25 || i == 148) { // 25, 153 in MAME - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - if (i == 0) { - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - if (i == 235) { // 240 in MAME, but causes a missing life-bar in VanDyke. 236 causes a little flicker in the life-bar, 235 = perfect. - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nSegment = i * (nTotalCycles[1] / nInterleave); - BurnTimerUpdate(nSegment); - } - - BurnTimerEndFrame(nTotalCycles[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - tlcs90Close(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - - -//------------------------------------------------------------------------------------------------------------------------------------- - -static void decryptcode(INT32 len, INT32 a17, INT32 a16, INT32 a15, INT32 a14, INT32 a13) -{ - UINT8 *buf = (UINT8*)BurnMalloc(len); - - memcpy (buf, Drv68KROM, len); - - for (INT32 i = 0; i < len; i++) { - Drv68KROM[i] = buf[BITSWAP24(i, 23,22,21,20,19,18,a17,a16,a15,a14,a13,12,11,10,9,8,7,6,5,4,3,2,1,0)]; - } - - BurnFree (buf); -} - -static UINT32 bjtwin_address_map_bg0(UINT32 addr) -{ - return ((addr & 0x00004) >> 2) | ((addr & 0x00800) >> 10) | ((addr & 0x40000) >> 16); -} - -static UINT8 decode_byte(UINT8 src, const UINT8 *bitp) -{ - UINT8 ret = 0; - for (INT32 i=0; i<8; i++) - ret |= (((src >> bitp[i]) & 1) << (7-i)); - - return ret; -} - -static UINT16 decode_word(UINT16 src, const UINT8 *bitp) -{ - UINT16 ret=0; - for (INT32 i = 0; i < 16; i++) - ret |= (((src >> bitp[i]) & 1) << (15-i)); - - return ret; -} - -static UINT32 bjtwin_address_map_sprites(UINT32 addr) -{ - return ((addr & 0x00010) >> 4) | ((addr & 0x20000) >> 16) | ((addr & 0x100000) >> 18); -} - -static void decode_gfx(INT32 gfxlen0, INT32 gfxlen1) -{ - static const UINT8 decode_data_bg[8][8] = - { - {0x3,0x0,0x7,0x2,0x5,0x1,0x4,0x6}, - {0x1,0x2,0x6,0x5,0x4,0x0,0x3,0x7}, - {0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0}, - {0x7,0x6,0x5,0x0,0x1,0x4,0x3,0x2}, - {0x2,0x0,0x1,0x4,0x3,0x5,0x7,0x6}, - {0x5,0x3,0x7,0x0,0x4,0x6,0x2,0x1}, - {0x2,0x7,0x0,0x6,0x5,0x3,0x1,0x4}, - {0x3,0x4,0x7,0x6,0x2,0x0,0x5,0x1}, - }; - - static const UINT8 decode_data_sprite[8][16] = - { - {0x9,0x3,0x4,0x5,0x7,0x1,0xb,0x8,0x0,0xd,0x2,0xc,0xe,0x6,0xf,0xa}, - {0x1,0x3,0xc,0x4,0x0,0xf,0xb,0xa,0x8,0x5,0xe,0x6,0xd,0x2,0x7,0x9}, - {0xf,0xe,0xd,0xc,0xb,0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0}, - {0xf,0xe,0xc,0x6,0xa,0xb,0x7,0x8,0x9,0x2,0x3,0x4,0x5,0xd,0x1,0x0}, - {0x1,0x6,0x2,0x5,0xf,0x7,0xb,0x9,0xa,0x3,0xd,0xe,0xc,0x4,0x0,0x8}, - {0x7,0x5,0xd,0xe,0xb,0xa,0x0,0x1,0x9,0x6,0xc,0x2,0x3,0x4,0x8,0xf}, - {0x0,0x5,0x6,0x3,0x9,0xb,0xa,0x7,0x1,0xd,0x2,0xe,0x4,0xc,0x8,0xf}, - {0x9,0xc,0x4,0x2,0xf,0x0,0xb,0x8,0xa,0xd,0x3,0x6,0x5,0xe,0x1,0x7}, - }; - - for (INT32 A = 0; A < gfxlen0; A++) { - DrvGfxROM1[A] = decode_byte(DrvGfxROM1[A], decode_data_bg[bjtwin_address_map_bg0(A)]); - } - - for (INT32 A = 0; A < gfxlen1; A += 2) - { - UINT16 tmp = decode_word((DrvGfxROM2[A+1] << 8) | DrvGfxROM2[A], decode_data_sprite[bjtwin_address_map_sprites(A)]); - DrvGfxROM2[A+1] = tmp >> 8; - DrvGfxROM2[A] = tmp & 0xff; - } -} - -static void ssmissin_decode() -{ - for (INT32 A = 0; A < 0x100000; A++) - { - DrvGfxROM1[A] = BITSWAP08(DrvGfxROM1[A], 7, 6, 5, 3, 4, 2, 1, 0); - DrvGfxROM2[A] = BITSWAP08(DrvGfxROM2[A], 7, 6, 5, 3, 4, 2, 1, 0); - } -} - -static void decode_tdragonb() -{ - static const UINT8 decode_data_tdragonb[16] = { - 0xe,0xc,0xa,0x8,0x7,0x5,0x3,0x1,0xf,0xd,0xb,0x9,0x6,0x4,0x2,0x0 - }; - - for (INT32 A = 0; A < 0x40000; A += 2) - { - UINT16 tmp = decode_word((Drv68KROM[A+1] << 8) | Drv68KROM[A], decode_data_tdragonb); - Drv68KROM[A+1] = tmp >> 8; - Drv68KROM[A] = tmp & 0xff; - } - - ssmissin_decode(); -} - -//------------------------------------------------------------------------------------------------------------- - -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; - -// NMK004 Internal ROM - -static struct BurnRomInfo nmk004RomDesc[] = { -#if !defined (ROM_VERIFY) - { "nmk004.bin", 0x002000, 0x83b6f611, BRF_PRG | BRF_BIOS }, // 0x80 tlcs90 internal rom -#else - { "", 0x000000, 0x00000000, BRF_PRG | BRF_BIOS }, // 0x80 tlcs90 internal rom -#endif -}; - -STD_ROM_PICK(nmk004) -STD_ROM_FN(nmk004) - -struct BurnDriver BurnDrvnmk004 = { - "nmk004", NULL, NULL, NULL, "1990", - "NMK004 Internal ROM\0", "internal rom", "N M K Corporation", "NMK16", - NULL, NULL, NULL, NULL, - BDF_BOARDROM, 0, HARDWARE_MISC_POST90S, GBF_BIOS, 0, - NULL, nmk004RomInfo, nmk004RomName, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, 0, - 320, 224, 4, 3 -}; - - -// Task Force Harrier - -static struct BurnRomInfo tharrierRomDesc[] = { - { "2.bin", 0x020000, 0xf3887a44, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "3.bin", 0x020000, 0x65c247f6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "12", 0x010000, 0xb959f837, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "1.bin", 0x010000, 0x005c26c3, 3 | BRF_GRA }, // 3 Characters - - { "89050-4", 0x080000, 0x64d7d687, 4 | BRF_GRA }, // 4 Tiles - - { "89050-13", 0x080000, 0x24db3fa4, 5 | BRF_GRA }, // 5 Sprites - { "89050-17", 0x080000, 0x7f715421, 5 | BRF_GRA }, // 6 - - { "89050-8", 0x080000, 0x11ee4c39, 6 | BRF_SND }, // 7 OKI1 Samples - - { "89050-10", 0x080000, 0x893552ab, 7 | BRF_SND }, // 8 OKI2 Samples - - { "21.bpr", 0x000100, 0xfcd5efea, 0 | BRF_OPT }, // 9 Unused proms - { "22.bpr", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 10 - { "23.bpr", 0x000020, 0xfc3569f4, 0 | BRF_OPT }, // 11 - { "24.bpr", 0x000100, 0xe0a009fe, 0 | BRF_OPT }, // 12 - { "25.bpr", 0x000100, 0xe0a009fe, 0 | BRF_OPT }, // 13 - { "26.bpr", 0x000020, 0x0cbfb33e, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(tharrier) -STD_ROM_FN(tharrier) - -static INT32 TharrierLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 6, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 7, 1)) return 1; - memmove (DrvSndROM0 + 0x40000, DrvSndROM0 + 0x20000, 0x60000); - - if (BurnLoadRom(DrvSndROM1 + 0x00000, 8, 1)) return 1; - memmove (DrvSndROM1 + 0x40000, DrvSndROM1 + 0x20000, 0x60000); - - DrvGfxDecode(0x10000, 0x80000, 0x100000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0883ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09d000, 0x09d7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_ROM); - SekSetWriteWordHandler(0, tharrier_main_write_word); - SekSetWriteByteHandler(0, tharrier_main_write_byte); - SekSetReadWordHandler(0, tharrier_main_read_word); - SekSetReadByteHandler(0, tharrier_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 TharrierInit() -{ - input_high[0] = 0x7fff; - input_high[1] = 0xffff; - Tharriermode = 1; - TharrierShakey = 0; - - return DrvInit(TharrierLoadCallback); -} - -struct BurnDriver BurnDrvTharrier = { - "tharrier", NULL, NULL, NULL, "1989", - "Task Force Harrier\0", NULL, "UPL", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, tharrierRomInfo, tharrierRomName, NULL, NULL, TharrierInputInfo, TharrierDIPInfo, - TharrierInit, DrvExit, DrvFrame, TharrierDraw, DrvScan, NULL, 0x200, - 224, 256, 3, 4 -}; - -// Task Force Harrier (US?) - -static struct BurnRomInfo tharrieruRomDesc[] = { - { "2", 0x020000, 0x78923aaa, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "3", 0x020000, 0x99cea259, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "12", 0x010000, 0xb959f837, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "1", 0x010000, 0xc7402e4a, 3 | BRF_GRA }, // 3 Characters - - { "89050-4", 0x080000, 0x64d7d687, 4 | BRF_GRA }, // 4 Tiles - - { "89050-13", 0x080000, 0x24db3fa4, 5 | BRF_GRA }, // 5 Sprites - { "89050-17", 0x080000, 0x7f715421, 5 | BRF_GRA }, // 6 - - { "89050-8", 0x080000, 0x11ee4c39, 6 | BRF_SND }, // 7 OKI1 Samples - - { "89050-10", 0x080000, 0x893552ab, 7 | BRF_SND }, // 8 OKI2 Samples - - { "21.bpr", 0x000100, 0xfcd5efea, 0 | BRF_OPT }, // 9 Unused proms - { "22.bpr", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 10 - { "23.bpr", 0x000020, 0xfc3569f4, 0 | BRF_OPT }, // 11 - { "24.bpr", 0x000100, 0xe0a009fe, 0 | BRF_OPT }, // 12 - { "25.bpr", 0x000100, 0xe0a009fe, 0 | BRF_OPT }, // 13 - { "26.bpr", 0x000020, 0x0cbfb33e, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(tharrieru) -STD_ROM_FN(tharrieru) - -struct BurnDriver BurnDrvTharrieru = { - "tharrieru", "tharrier", NULL, NULL, "1989", - "Task Force Harrier (US?)\0", NULL, "UPL (American Sammy license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_VERSHOOT, 0, - NULL, tharrieruRomInfo, tharrieruRomName, NULL, NULL, TharrierInputInfo, TharrierDIPInfo, - TharrierInit, DrvExit, DrvFrame, TharrierDraw, DrvScan, NULL, 0x200, - 224, 256, 3, 4 -}; - - -// Many Block - -static struct BurnRomInfo manyblocRomDesc[] = { - { "1-u33.bin", 0x020000, 0x07473154, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "2-u35.bin", 0x020000, 0x04acd8c1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "3-u146.bin", 0x010000, 0x7bf5fafa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "12-u39.bin", 0x010000, 0x413b5438, 3 | BRF_GRA }, // 3 Characters - - { "5-u97.bin", 0x040000, 0x536699e6, 4 | BRF_GRA }, // 4 Ciles - { "4-u96.bin", 0x040000, 0x28af2640, 4 | BRF_GRA }, // 5 - - { "8-u54b.bin", 0x020000, 0x03eede77, 5 | BRF_GRA }, // 6 Sprites - { "10-u86b.bin", 0x020000, 0x9eab216f, 5 | BRF_GRA }, // 7 - { "9-u53b.bin", 0x020000, 0xdfcfa040, 5 | BRF_GRA }, // 8 - { "11-u85b.bin", 0x020000, 0xfe747dd5, 5 | BRF_GRA }, // 9 - - { "6-u131.bin", 0x040000, 0x79a4ae75, 6 | BRF_SND }, // 10 OKI1 Samples - { "7-u132.bin", 0x040000, 0x21db875e, 6 | BRF_SND }, // 11 - - { "u200.bpr", 0x000020, 0x1823600b, 0 | BRF_OPT }, // 12 Unused proms - { "u7.bpr", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 13 - { "u10.bpr", 0x000200, 0x8e9b569a, 0 | BRF_OPT }, // 14 - { "u120.bpr", 0x000100, 0x576c5984, 0 | BRF_OPT }, // 15 -}; - -STD_ROM_PICK(manybloc) -STD_ROM_FN(manybloc) - -static INT32 ManyblocLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x00000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00001, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x40001, 9, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x60000, 11, 1)) return 1; - memmove (DrvSndROM0 + 0x40000, DrvSndROM0 + 0x20000, 0x20000); - - DrvGfxDecode(0x10000, 0x80000, 0x80000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0883ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x09c000, 0x09cfff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09d000, 0x09d7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, manybloc_main_write_word); - SekSetWriteByteHandler(0, manybloc_main_write_byte); - SekSetReadWordHandler(0, manybloc_main_read_word); - SekSetReadByteHandler(0, manybloc_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 ManyblocInit() -{ - global_y_offset = 8; - input_high[0] = 0x7fff; - input_high[1] = 0xffff; - - return DrvInit(ManyblocLoadCallback); -} - -struct BurnDriver BurnDrvManybloc = { - "manybloc", NULL, NULL, NULL, "1991", - "Many Block\0", NULL, "Bee-Oh", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, manyblocRomInfo, manyblocRomName, NULL, NULL, ManyblocInputInfo, ManyblocDIPInfo, - ManyblocInit, DrvExit, DrvFrame, ManyblocDraw, DrvScan, NULL, 0x200, - 240, 256, 3, 4 -}; - - -// S.S. Mission - -static struct BurnRomInfo ssmissinRomDesc[] = { - { "ssm14.165", 0x020000, 0xeda61b74, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "ssm15.166", 0x020000, 0xaff15927, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ssm11.188", 0x008000, 0x8be6dce3, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "ssm16.172", 0x020000, 0x5cf6eb1f, 3 | BRF_GRA }, // 3 Characters - - { "ssm17.147", 0x080000, 0xc9c28455, 4 | BRF_GRA }, // 4 Tiles - { "ssm18.148", 0x080000, 0xebfdaad6, 4 | BRF_GRA }, // 5 - - { "ssm20.34", 0x080000, 0xa0c16c4d, 5 | BRF_GRA }, // 6 Sprites - { "ssm19.33", 0x080000, 0xb1943657, 5 | BRF_GRA }, // 7 - - { "ssm13.190", 0x020000, 0x618f66f0, 6 | BRF_SND }, // 8 OKI1 Samples - { "ssm12.189", 0x080000, 0xe8219c83, 6 | BRF_SND }, // 9 - - { "ssm-pr2.113", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 10 Unused proms - { "ssm-pr1.114", 0x000200, 0xed0bd072, 0 | BRF_OPT }, // 11 -}; - -STD_ROM_PICK(ssmissin) -STD_ROM_FN(ssmissin) - -static INT32 SsmissinLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x00000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00001, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x80000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 7, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x40000, 9, 1)) return 1; - - ssmissin_decode(); - DrvGfxDecode(0x20000, 0x100000, 0x100000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x0b0000, 0x0bffff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x0c4000, 0x0c43ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0c8000, 0x0c87ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x0cc000, 0x0cffff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x0d0000, 0x0d07ff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x0d0800, 0x0d0fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x0d1000, 0x0d17ff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x0d1800, 0x0d1fff, MAP_RAM); - SekSetWriteWordHandler(0, ssmissin_main_write_word); - SekSetWriteByteHandler(0, ssmissin_main_write_byte); - SekSetReadWordHandler(0, ssmissin_main_read_word); - SekSetReadByteHandler(0, ssmissin_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 SsmissinInit() -{ - return MSM6295x1Init(SsmissinLoadCallback); -} - -struct BurnDriver BurnDrvSsmissin = { - "ssmissin", NULL, NULL, NULL, "1992", - "S.S. Mission\0", NULL, "Comad", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, ssmissinRomInfo, ssmissinRomName, NULL, NULL, SsmissinInputInfo, SsmissinDIPInfo, - SsmissinInit, MSM6295x1Exit, SsmissinFrame, AcrobatmDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// Air Attack (set 1) - -static struct BurnRomInfo airattckRomDesc[] = { - { "uc10.bin", 0x020000, 0x1837d4ba, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "ue10.bin", 0x020000, 0x71deb9d8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "3.su6", 0x008000, 0x3e352370, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "4.ul10", 0x020000, 0xe9362ab4, 3 | BRF_GRA }, // 3 Characters - - { "9.uw9", 0x080000, 0x86e59966, 4 | BRF_GRA }, // 4 Tiles - { "10.ux9", 0x080000, 0x122c8d04, 4 | BRF_GRA }, // 5 - - { "8.uo82", 0x080000, 0x9a83e3d8, 5 | BRF_GRA }, // 6 Sprites - { "7.uo81", 0x080000, 0x3c38d671, 5 | BRF_GRA }, // 7 - - { "2.su12", 0x020000, 0x93ab615b, 6 | BRF_SND }, // 8 OKI1 Samples - { "1.su13", 0x080000, 0x09a836bb, 6 | BRF_SND }, // 9 - - { "82s129.ug6", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 10 Unused proms - { "82s147.uh6", 0x000200, 0xed0bd072, 0 | BRF_OPT }, // 11 -}; - -STD_ROM_PICK(airattck) -STD_ROM_FN(airattck) - -struct BurnDriver BurnDrvAirattck = { - "airattck", NULL, NULL, NULL, "1996", - "Air Attack (set 1)\0", NULL, "Comad", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, airattckRomInfo, airattckRomName, NULL, NULL, SsmissinInputInfo, SsmissinDIPInfo, - SsmissinInit, MSM6295x1Exit, SsmissinFrame, AcrobatmDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// Air Attack (set 2) - -static struct BurnRomInfo airattckaRomDesc[] = { - { "5.ue10", 0x020000, 0x6589c005, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "6.uc10", 0x020000, 0x3572baf0, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "3.su6", 0x008000, 0x3e352370, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "4.ul10", 0x020000, 0xe9362ab4, 3 | BRF_GRA }, // 3 Characters - - { "9.uw9", 0x080000, 0x86e59966, 4 | BRF_GRA }, // 4 Tiles - { "10.ux9", 0x080000, 0x122c8d04, 4 | BRF_GRA }, // 5 - - { "8.uo82", 0x080000, 0x9a83e3d8, 5 | BRF_GRA }, // 6 Sprites - { "7.uo81", 0x080000, 0x3c38d671, 5 | BRF_GRA }, // 7 - - { "2.su12", 0x020000, 0x93ab615b, 6 | BRF_SND }, // 8 OKI1 Samples - { "1.su13", 0x080000, 0x09a836bb, 6 | BRF_SND }, // 9 - - { "82s129.ug6", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 10 Unused proms - { "82s147.uh6", 0x000200, 0xed0bd072, 0 | BRF_OPT }, // 11 -}; - -STD_ROM_PICK(airattcka) -STD_ROM_FN(airattcka) - -struct BurnDriver BurnDrvAirattcka = { - "airattcka", "airattck", NULL, NULL, "1996", - "Air Attack (set 2)\0", NULL, "Comad", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, airattckaRomInfo, airattckaRomName, NULL, NULL, SsmissinInputInfo, SsmissinDIPInfo, - SsmissinInit, MSM6295x1Exit, SsmissinFrame, MacrossDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II -/* Title screen shows Kanji characters & Macross II */ - -static struct BurnRomInfo macross2RomDesc[] = { - { "mcrs2j.3", 0x080000, 0x36a618fe, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - - { "mcrs2j.2", 0x020000, 0xb4aa8ac7, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 code - - { "mcrs2j.1", 0x020000, 0xc7417410, 3 | BRF_GRA }, // 2 Characters - - { "bp932an.a04", 0x200000, 0xc4d77ff0, 4 | BRF_GRA }, // 3 Tiles - - { "bp932an.a07", 0x200000, 0xaa1b21b9, 5 | BRF_GRA }, // 4 Sprites - { "bp932an.a08", 0x200000, 0x67eb2901, 5 | BRF_GRA }, // 5 - - { "bp932an.a06", 0x200000, 0xef0ffec0, 6 | BRF_SND }, // 6 OKI1 Samples - - { "bp932an.a05", 0x100000, 0xb5335abb, 7 | BRF_SND }, // 7 OKI2 Samples - - { "mcrs2bpr.9", 0x000100, 0x435653a2, 0 | BRF_OPT }, // 8 Unused proms - { "mcrs2bpr.10", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 9 -}; - -STD_ROM_PICK(macross2) -STD_ROM_FN(macross2) - -struct BurnDriver BurnDrvMacross2 = { - "macross2", NULL, NULL, NULL, "1993", - "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II\0", NULL, "Banpresto", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, macross2RomInfo, macross2RomName, NULL, NULL, CommonInputInfo, Macross2DIPInfo, - Macross2Init, DrvExit, Macross2Frame, Macross2Draw, DrvScan, NULL, 0x400, - 384, 224, 4, 3 -}; - -// Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II (GAMEST review build) - -static struct BurnRomInfo macross2gRomDesc[] = { - { "3.u11", 0x080000, 0x151f9d39, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - - { "mcrs2j.2", 0x020000, 0xb4aa8ac7, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 code - - { "mcrs2j.1", 0x020000, 0xc7417410, 3 | BRF_GRA }, // 2 Characters - - { "bp932an.a04", 0x200000, 0xc4d77ff0, 4 | BRF_GRA }, // 3 Tiles - - { "bp932an.a07", 0x200000, 0xaa1b21b9, 5 | BRF_GRA }, // 4 Sprites - { "bp932an.a08", 0x200000, 0x67eb2901, 5 | BRF_GRA }, // 5 - - { "bp932an.a06", 0x200000, 0xef0ffec0, 6 | BRF_SND }, // 6 OKI1 Samples - - { "bp932an.a05", 0x100000, 0xb5335abb, 7 | BRF_SND }, // 7 OKI2 Samples - - { "mcrs2bpr.9", 0x000100, 0x435653a2, 0 | BRF_OPT }, // 8 Unused proms - { "mcrs2bpr.10", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 9 -}; - -STD_ROM_PICK(macross2g) -STD_ROM_FN(macross2g) - -struct BurnDriver BurnDrvMacross2g = { - "macross2g", "macross2", NULL, NULL, "1993", - "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II (GAMEST review build)\0", NULL, "Banpresto", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, macross2gRomInfo, macross2gRomName, NULL, NULL, CommonInputInfo, Macross2DIPInfo, - Macross2Init, DrvExit, Macross2Frame, Macross2Draw, DrvScan, NULL, 0x400, - 384, 224, 4, 3 -}; - -// Macross II (Korea) -/* Title screen only shows Macross II, no Kanji. Suspected Korean version - Language dip still used for Stage info screens */ - -static struct BurnRomInfo macross2kRomDesc[] = { - { "1.3", 0x080000, 0x1506fcfc, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - - { "mcrs2j.2", 0x020000, 0xb4aa8ac7, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 code - - { "2.1", 0x020000, 0xe8ab17f9, 3 | BRF_GRA }, // 2 Characters - - { "bp932an.a04", 0x200000, 0xc4d77ff0, 4 | BRF_GRA }, // 3 Tiles - - { "bp932an.a07", 0x200000, 0xaa1b21b9, 5 | BRF_GRA }, // 4 Sprites - { "bp932an.a08", 0x200000, 0x67eb2901, 5 | BRF_GRA }, // 5 - - { "bp932an.a06", 0x200000, 0xef0ffec0, 6 | BRF_SND }, // 6 OKI1 Samples - - { "bp932an.a05", 0x100000, 0xb5335abb, 7 | BRF_SND }, // 7 OKI2 Samples - - { "mcrs2bpr.9", 0x000100, 0x435653a2, 0 | BRF_OPT }, // 8 Unused proms - { "mcrs2bpr.10", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 9 -}; - -STD_ROM_PICK(macross2k) -STD_ROM_FN(macross2k) - -struct BurnDriver BurnDrvMacross2k = { - "macross2k", "macross2", NULL, NULL, "1993", - "Macross II (Korea)\0", NULL, "Banpresto", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, macross2kRomInfo, macross2kRomName, NULL, NULL, CommonInputInfo, Macross2DIPInfo, - Macross2Init, DrvExit, Macross2Frame, Macross2Draw, DrvScan, NULL, 0x400, - 384, 224, 4, 3 -}; - -// Thunder Dragon 2 (9th Nov. 1993) - -static struct BurnRomInfo tdragon2RomDesc[] = { - { "6.rom", 0x080000, 0xca348caf, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - - { "5.bin", 0x020000, 0xb870be61, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 code - - { "1.bin", 0x020000, 0xd488aafa, 3 | BRF_GRA }, // 2 Characters - - { "ww930914.2", 0x200000, 0xf968c65d, 4 | BRF_GRA }, // 3 Tiles - - { "ww930917.7", 0x200000, 0xb98873cb, 5 | BRF_GRA }, // 4 Sprites - { "ww930918.8", 0x200000, 0xbaee84b2, 5 | BRF_GRA }, // 5 - - { "ww930916.4", 0x200000, 0x07c35fe6, 6 | BRF_SND }, // 6 OKI1 Samples - - { "ww930915.3", 0x200000, 0x82025bab, 7 | BRF_SND }, // 7 OKI2 Samples - - { "9.bpr", 0x000100, 0x435653a2, 0 | BRF_OPT }, // 8 Unused proms - { "10.bpr", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 9 -}; - -STD_ROM_PICK(tdragon2) -STD_ROM_FN(tdragon2) - -static INT32 Tdragon2Init() -{ - Tdragon2mode = 1; - return Macross2Init(); -} - -struct BurnDriver BurnDrvTdragon2 = { - "tdragon2", NULL, NULL, NULL, "1993", - "Thunder Dragon 2 (9th Nov. 1993)\0", NULL, "NMK", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, tdragon2RomInfo, tdragon2RomName, NULL, NULL, Tdragon2InputInfo, Tdragon2DIPInfo, - Tdragon2Init, DrvExit, Macross2Frame, Macross2Draw, DrvScan, NULL, 0x400, - 224, 384, 3, 4 -}; - - -// Thunder Dragon 2 (1st Oct. 1993) - -static struct BurnRomInfo tdragon2aRomDesc[] = { - { "6.bin", 0x080000, 0x310d6bca, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - - { "5.bin", 0x020000, 0xb870be61, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 code - - { "1.bin", 0x020000, 0xd488aafa, 3 | BRF_GRA }, // 2 Characters - - { "ww930914.2", 0x200000, 0xf968c65d, 4 | BRF_GRA }, // 3 Tiles - - { "ww930917.7", 0x200000, 0xb98873cb, 5 | BRF_GRA }, // 4 Sprites - { "ww930918.8", 0x200000, 0xbaee84b2, 5 | BRF_GRA }, // 5 - - { "ww930916.4", 0x200000, 0x07c35fe6, 6 | BRF_SND }, // 6 OKI1 Samples - - { "ww930915.3", 0x200000, 0x82025bab, 7 | BRF_SND }, // 7 OKI2 Samples - - { "9.bpr", 0x000100, 0x435653a2, 0 | BRF_OPT }, // 8 Unused proms - { "10.bpr", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 9 -}; - -STD_ROM_PICK(tdragon2a) -STD_ROM_FN(tdragon2a) - -struct BurnDriver BurnDrvTdragon2a = { - "tdragon2a", "tdragon2", NULL, NULL, "1993", - "Thunder Dragon 2 (1st Oct. 1993)\0", NULL, "NMK", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, tdragon2aRomInfo, tdragon2aRomName, NULL, NULL, Tdragon2InputInfo, Tdragon2DIPInfo, - Tdragon2Init, DrvExit, Macross2Frame, Macross2Draw, DrvScan, NULL, 0x400, - 224, 384, 3, 4 -}; - - -// Big Bang (9th Nov. 1993) - -static struct BurnRomInfo bigbangRomDesc[] = { - { "eprom.3", 0x080000, 0x28e5957a, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - - { "5.bin", 0x020000, 0xb870be61, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 code - - { "1.bin", 0x020000, 0xd488aafa, 3 | BRF_GRA }, // 2 Characters - - { "ww930914.2", 0x200000, 0xf968c65d, 4 | BRF_GRA }, // 3 Tiles - - { "ww930917.7", 0x200000, 0xb98873cb, 5 | BRF_GRA }, // 4 Sprites - { "ww930918.8", 0x200000, 0xbaee84b2, 5 | BRF_GRA }, // 5 - - { "ww930916.4", 0x200000, 0x07c35fe6, 6 | BRF_SND }, // 6 OKI1 Samples - - { "ww930915.3", 0x200000, 0x82025bab, 7 | BRF_SND }, // 7 OKI2 Samples - - { "9.bpr", 0x000100, 0x435653a2, 0 | BRF_OPT }, // 8 Unused proms - { "10.bpr", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 9 -}; - -STD_ROM_PICK(bigbang) -STD_ROM_FN(bigbang) - -struct BurnDriver BurnDrvBigbang = { - "bigbang", "tdragon2", NULL, NULL, "1993", - "Big Bang (9th Nov. 1993)\0", NULL, "NMK", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, bigbangRomInfo, bigbangRomName, NULL, NULL, Tdragon2InputInfo, Tdragon2DIPInfo, - Tdragon2Init, DrvExit, Macross2Frame, Macross2Draw, DrvScan, NULL, 0x400, - 224, 384, 3, 4 -}; - - -// Stagger I (Japan) - -static struct BurnRomInfo stagger1RomDesc[] = { - { "2.bin", 0x020000, 0x8555929b, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "3.bin", 0x020000, 0x5b0b63ac, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.bin", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "4.bin", 0x080000, 0x46463d36, 4 | BRF_GRA }, // 3 Tiles - - { "7.bin", 0x080000, 0x048f7683, 5 | BRF_GRA }, // 4 Characters - { "6.bin", 0x080000, 0x051d4a77, 5 | BRF_GRA }, // 5 - - { "5", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 6 OKI1 Samples -}; - -STD_ROM_PICK(stagger1) -STD_ROM_FN(stagger1) - -static void pAfegaZ80Callback() -{ - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(afega_sound_write); - ZetSetReadHandler(afega_sound_read); - ZetClose(); -} - -static INT32 Stagger1LoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - memset (DrvGfxROM0, 0xff, 0x20); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 5, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 6, 1)) return 1; - - DrvGfxDecode(0x20, 0x80000, 0x100000); - - return 0; -} - -static INT32 Stagger1Init() -{ - return AfegaInit(Stagger1LoadCallback, pAfegaZ80Callback, 1); -} - -struct BurnDriver BurnDrvStagger1 = { - "stagger1", NULL, NULL, NULL, "1998", - "Stagger I (Japan)\0", NULL, "Afega", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, stagger1RomInfo, stagger1RomName, NULL, NULL, CommonInputInfo, Stagger1DIPInfo, - Stagger1Init, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Red Hawk (US) - -static struct BurnRomInfo redhawkRomDesc[] = { - { "2", 0x020000, 0x3ef5f326, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "3", 0x020000, 0x9b3a10ef, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.bin", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "4", 0x080000, 0xd6427b8a, 4 | BRF_GRA }, // 5 Tiles - - { "7", 0x080000, 0x66a8976d, 5 | BRF_GRA }, // 3 Characters - { "6", 0x080000, 0x61560164, 5 | BRF_GRA }, // 4 - - { "5", 0x040000, 0xe911ce33, 6 | BRF_GRA }, // 6 OKI1 Samples -}; - -STD_ROM_PICK(redhawk) -STD_ROM_FN(redhawk) - -static INT32 RedhawkInit() -{ - INT32 nRet = AfegaInit(Stagger1LoadCallback, pAfegaZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x40000, 16,15,14,17,13); - } - - return nRet; -} - -struct BurnDriver BurnDrvRedhawk = { - "redhawk", "stagger1", NULL, NULL, "1997", - "Red Hawk (US)\0", NULL, "Afega (New Vision Ent. license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, redhawkRomInfo, redhawkRomName, NULL, NULL, CommonInputInfo, Stagger1DIPInfo, - RedhawkInit, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Red Hawk (Excellent Co., Ltd) - -static struct BurnRomInfo redhawkeRomDesc[] = { - { "rhawk2.bin", 0x020000, 0x6d2e23b4, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "rhawk3.bin", 0x020000, 0x5e0d6188, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.bin", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "rhawk4.bin", 0x080000, 0xd79aa288, 4 | BRF_GRA }, // 3 Tiles - - { "rhawk7.bin", 0x080000, 0x0264ef54, 5 | BRF_GRA }, // 4 Characters - { "rhawk6.bin", 0x080000, 0x3f980ab6, 5 | BRF_GRA }, // 5 - - { "5", 0x040000, 0xe911ce33, 6 | BRF_GRA }, // 6 OKI1 Samples -}; - -STD_ROM_PICK(redhawke) -STD_ROM_FN(redhawke) - -struct BurnDriver BurnDrvRedhawke = { - "redhawke", "stagger1", NULL, NULL, "1997", - "Red Hawk (Excellent Co., Ltd)\0", NULL, "Afega (Excellent Co. license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, redhawkeRomInfo, redhawkeRomName, NULL, NULL, CommonInputInfo, Stagger1DIPInfo, - Stagger1Init, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Red Hawk (Korea) - -static struct BurnRomInfo redhawkkRomDesc[] = { - { "2", 0x020000, 0x8c02e81d, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "3", 0x020000, 0xab3597ee, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "4", 0x080000, 0x6255d6a1, 4 | BRF_GRA }, // 3 Tiles - - { "7", 0x080000, 0xf4fa8211, 5 | BRF_GRA }, // 4 Characters - { "6", 0x080000, 0x6a0b8224, 5 | BRF_GRA }, // 5 - - { "5", 0x040000, 0xe911ce33, 6 | BRF_GRA }, // 6 OKI1 Samples -}; - -STD_ROM_PICK(redhawkk) -STD_ROM_FN(redhawkk) - -struct BurnDriver BurnDrvRedhawkk = { - "redhawkk", "stagger1", NULL, NULL, "1997", - "Red Hawk (Korea)\0", NULL, "Afega Co.", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, redhawkkRomInfo, redhawkkRomName, NULL, NULL, CommonInputInfo, Stagger1DIPInfo, - Stagger1Init, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Red Hawk (Italy) - -static struct BurnRomInfo redhawkiRomDesc[] = { - { "rhit-2.bin", 0x020000, 0x30cade0e, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "rhit-3.bin", 0x020000, 0x37dbb3c2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.bin", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "rhit-4.bin", 0x080000, 0xaafb3cc4, 4 | BRF_GRA }, // 3 Tiles - - { "rhit-7.bin", 0x080000, 0xbcb367c7, 5 | BRF_GRA }, // 4 Characters - { "rhit-6.bin", 0x080000, 0x7cbd5c60, 5 | BRF_GRA }, // 5 - - { "5", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 6 OKI1 Samples -}; - -STD_ROM_PICK(redhawki) -STD_ROM_FN(redhawki) - -static INT32 RedhawkiInit() -{ - INT32 nRet = AfegaInit(Stagger1LoadCallback, pAfegaZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x40000, 15, 16, 17, 14, 13); - } - - return nRet; -} - -struct BurnDriver BurnDrvRedhawki = { - "redhawki", "stagger1", NULL, NULL, "1997", - "Red Hawk (Italy)\0", NULL, "Afega (Hea Dong Corp license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, redhawkiRomInfo, redhawkiRomName, NULL, NULL, CommonInputInfo, Stagger1DIPInfo, - RedhawkiInit, AfegaExit, AfegaFrame, RedhawkiDraw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Red Hawk (Greece) - -static struct BurnRomInfo redhawkgRomDesc[] = { - { "2.bin", 0x020000, 0xccd459eb, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "3.bin", 0x020000, 0x483802fd, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.bin", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "4.bin", 0x080000, 0xaafb3cc4, 4 | BRF_GRA }, // 3 Tiles - - { "7.bin", 0x080000, 0xa28c8454, 5 | BRF_GRA }, // 4 Characters - { "6.bin", 0x080000, 0x710c9e3c, 5 | BRF_GRA }, // 5 - - { "5", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 6 OKI1 Samples -}; - -STD_ROM_PICK(redhawkg) -STD_ROM_FN(redhawkg) - -static INT32 RedhawkgLoadCallback() -{ - Stagger1LoadCallback(); - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - - memcpy (tmp, Drv68KROM, 0x40000); - - for (INT32 i = 0; i < 0x40000; i+= 0x04000) - { - INT32 j = ((i & 0x30000) >> 2) | ((i & 0x04000) << 3) | ((i & 0x08000) << 1); - - memcpy (Drv68KROM + j, tmp + i, 0x04000); - } - - BurnFree(tmp); - - return 0; -} - -static INT32 RedhawkgInit() -{ - return AfegaInit(RedhawkgLoadCallback, pAfegaZ80Callback, 1); -} - -struct BurnDriver BurnDrvRedhawkg = { - "redhawkg", "stagger1", NULL, NULL, "1997", - "Red Hawk (Greece)\0", NULL, "Afega (Hea Dong Corp license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, redhawkgRomInfo, redhawkgRomName, NULL, NULL, CommonInputInfo, Stagger1DIPInfo, - RedhawkgInit, AfegaExit, AfegaFrame, RedhawkiDraw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Vince (Redhawk bootleg) - -static struct BurnRomInfo redhawkbRomDesc[] = { - { "rhb-1.bin", 0x020000, 0xe733ea07, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "rhb-2.bin", 0x020000, 0xf9fa5684, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.bin", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "rhb-5.bin", 0x080000, 0xd0eaf6f2, 4 | BRF_GRA }, // 3 Tiles - - { "rhb-3.bin", 0x080000, 0x0318d68b, 5 | BRF_GRA }, // 4 Characters - { "rhb-4.bin", 0x080000, 0xba21c1ef, 5 | BRF_GRA }, // 5 - - { "5", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 6 OKI1 Samples -}; - -STD_ROM_PICK(redhawkb) -STD_ROM_FN(redhawkb) - -static INT32 RedhawkbLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - memset (DrvGfxROM0, 0xff, 0x20); - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x80000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 6, 1)) return 1; - - DrvGfxDecode(0x20, 0x80000, 0x100000); - - BurnByteswap(DrvGfxROM1, 0x100000); - BurnByteswap(DrvGfxROM2, 0x200000); - - return 0; -} - -static INT32 RedhawkbInit() -{ - input_high[0] = input_high[1] = 0xffff; - - return AfegaInit(RedhawkbLoadCallback, pAfegaZ80Callback, 1); -} - -struct BurnDriver BurnDrvRedhawkb = { - "redhawkb", "stagger1", NULL, NULL, "1997", - "Vince (Redhawk bootleg)\0", NULL, "bootleg", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, redhawkbRomInfo, redhawkbRomName, NULL, NULL, CommonInputInfo, RedhawkbDIPInfo, - RedhawkbInit, AfegaExit, AfegaFrame, RedhawkbDraw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Guardian Storm (horizontal, not encrypted) - -static struct BurnRomInfo grdnstrmRomDesc[] = { - { "afega4.u112", 0x040000, 0x2244713a, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "afega5.u107", 0x040000, 0x5815c806, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "afega7.u92", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "afega1.u4", 0x010000, 0x9e7ef086, 3 | BRF_GRA }, // 3 Characters - - { "afega_af1-b2.uc8", 0x200000, 0xd68588c2, 4 | BRF_GRA }, // 4 Tiles - { "afega_af1-b1.uc3", 0x200000, 0xf8b200a8, 4 | BRF_GRA }, // 5 - - { "afega3.uc13", 0x200000, 0x0218017c, 5 | BRF_GRA }, // 6 Sprites - - { "afega1.u95", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 7 OKI1 Samples -}; - -STD_ROM_PICK(grdnstrm) -STD_ROM_FN(grdnstrm) - -static INT32 GrdnstrmLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 7, 1)) return 1; - - GrdnstrmGfxDecode(0x10000, 0x400000, 0x200000); - - return 0; -} - -static INT32 GrdnstrmInit() -{ - screen_flip_y = 1; - - return AfegaInit(GrdnstrmLoadCallback, pAfegaZ80Callback, 1); -} - -struct BurnDriver BurnDrvGrdnstrm = { - "grdnstrm", NULL, NULL, NULL, "1998", - "Guardian Storm (horizontal, not encrypted)\0", NULL, "Afega (Apples Industries license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, grdnstrmRomInfo, grdnstrmRomName, NULL, NULL, CommonInputInfo, GrdnstrmDIPInfo, - GrdnstrmInit, AfegaExit, AfegaFrame, FirehawkDraw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Sen Jing - Guardian Storm (Japan) - -static struct BurnRomInfo grdnstrmjRomDesc[] = { - { "afega_3.u112", 0x040000, 0xe51a35fb, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "afega_4.u107", 0x040000, 0xcb10aa54, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "afega7.u92", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "gst-03.u4", 0x010000, 0xa1347297, 3 | BRF_GRA }, // 3 Characters - - { "afega_af1-b2.uc8", 0x200000, 0xd68588c2, 4 | BRF_GRA }, // 4 Tiles - { "afega_af1-b1.uc3", 0x200000, 0xf8b200a8, 4 | BRF_GRA }, // 5 - - { "afega_af1-sp.uc13", 0x200000, 0x7d4d4985, 5 | BRF_GRA }, // 6 Sprites - - { "afega1.u95", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 7 OKI1 Samples -}; - -STD_ROM_PICK(grdnstrmj) -STD_ROM_FN(grdnstrmj) - -static INT32 GrdnstrmjInit() -{ - INT32 nRet = AfegaInit(GrdnstrmLoadCallback, pAfegaZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x80000, 13, 17, 16, 15, 14); - decryptcode(0x80000, 17, 16, 14, 15, 13); - decryptcode(0x80000, 17, 15, 16, 14, 13); - decryptcode(0x80000, 16, 17, 15, 14, 13); - } - - return nRet; -} - -struct BurnDriver BurnDrvGrdnstrmj = { - "grdnstrmj", "grdnstrm", NULL, NULL, "1998", - "Sen Jing - Guardian Storm (Japan)\0", NULL, "Afega", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, grdnstrmjRomInfo, grdnstrmjRomName, NULL, NULL, CommonInputInfo, GrdnstrkDIPInfo, - GrdnstrmjInit, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Jeon Sin - Guardian Storm (Korea) - -static struct BurnRomInfo grdnstrmkRomDesc[] = { - { "gst-04.u112", 0x040000, 0x922c931a, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "gst-05.u107", 0x040000, 0xd22ca2dc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "afega7.u92", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "gst-03.u4", 0x010000, 0xa1347297, 3 | BRF_GRA }, // 3 Characters - - { "afega_af1-b2.uc8", 0x200000, 0xd68588c2, 4 | BRF_GRA }, // 4 Tiles - { "afega_af1-b1.uc3", 0x200000, 0xf8b200a8, 4 | BRF_GRA }, // 5 - - { "afega_af1-sp.uc13", 0x200000, 0x7d4d4985, 5 | BRF_GRA }, // 6 Sprites - - { "afega1.u95", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 7 OKI1 Samples -}; - -STD_ROM_PICK(grdnstrmk) -STD_ROM_FN(grdnstrmk) - -static INT32 GrdnstrmkInit() -{ - INT32 nRet = AfegaInit(GrdnstrmLoadCallback, pAfegaZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x80000, 16,17,14,15,13); - } - - return nRet; -} - -struct BurnDriver BurnDrvGrdnstrmk = { - "grdnstrmk", "grdnstrm", NULL, NULL, "1998", - "Jeon Sin - Guardian Storm (Korea)\0", NULL, "Afega", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, grdnstrmkRomInfo, grdnstrmkRomName, NULL, NULL, CommonInputInfo, GrdnstrkDIPInfo, - GrdnstrmkInit, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Guardian Storm (vertical) - -static struct BurnRomInfo grdnstrmvRomDesc[] = { - { "afega2.u112", 0x040000, 0x16d41050, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "afega3.u107", 0x040000, 0x05920a99, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "afega7.u92", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "afega1.u4", 0x010000, 0x9e7ef086, 3 | BRF_GRA }, // 3 Characters - - { "afega_af1-b2.uc8", 0x200000, 0xd68588c2, 4 | BRF_GRA }, // 4 Tiles - { "afega_af1-b1.uc3", 0x200000, 0xf8b200a8, 4 | BRF_GRA }, // 5 - - { "afega6.uc13", 0x200000, 0x9b54ff84, 5 | BRF_GRA }, // 6 Sprites - - { "afega1.u95", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 7 OKI1 Samples -}; - -STD_ROM_PICK(grdnstrmv) -STD_ROM_FN(grdnstrmv) - -struct BurnDriver BurnDrvGrdnstrmv = { - "grdnstrmv", "grdnstrm", NULL, NULL, "1998", - "Guardian Storm (vertical)\0", NULL, "Afega (Apples Industries license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, grdnstrmvRomInfo, grdnstrmvRomName, NULL, NULL, CommonInputInfo, GrdnstrkDIPInfo, - GrdnstrmkInit, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Guardian Storm (Germany) - -static struct BurnRomInfo grdnstrmgRomDesc[] = { - { "gs6_c2.uc9", 0x040000, 0xea363e4d, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "gs5_c1.uc1", 0x040000, 0xc0263e4a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gs1_s1.uc14", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "gs3_t1.uc2", 0x010000, 0x88c423ef, 3 | BRF_GRA }, // 3 Characters - - { "gs10_cr5.uc15", 0x080000, 0x2c8c23e3, 4 | BRF_GRA }, // 4 Tiles - { "gs4_cr7.uc19", 0x080000, 0xc3f6c908, 4 | BRF_GRA }, // 5 - { "gs8_cr1.uc6", 0x080000, 0xdc0125f0, 4 | BRF_GRA }, // 6 - { "gs9_cr3.uc12", 0x080000, 0xd8a0636b, 4 | BRF_GRA }, // 7 - - { "gs8_br3.uc10", 0x080000, 0x7b42a57a, 5 | BRF_GRA }, // 8 Sprites - { "gs7_br1.uc3", 0x080000, 0xe6794265, 5 | BRF_GRA }, // 9 - { "gs10_br4.uc11", 0x080000, 0x1d3b57e1, 5 | BRF_GRA }, // 10 - { "gs9_br2.uc4", 0x080000, 0x4d2c220b, 5 | BRF_GRA }, // 11 - - { "gs2_s2.uc18", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 12 OKI1 Samples -}; - -STD_ROM_PICK(grdnstrmg) -STD_ROM_FN(grdnstrmg) - -static INT32 GrdnstrmgLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x180000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 11, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 12, 1)) return 1; - - GrdnstrmGfxDecode(0x10000, 0x400000, 0x200000); - - return 0; -} - -static INT32 GrdnstrmgInit() -{ - INT32 nRet = AfegaInit(GrdnstrmgLoadCallback, pAfegaZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x80000, 13, 17, 16, 15, 14); - decryptcode(0x80000, 17, 16, 14, 15, 13); - decryptcode(0x80000, 17, 15, 16, 14, 13); - decryptcode(0x80000, 16, 17, 15, 14, 13); - } - - return nRet; -} - -struct BurnDriver BurnDrvGrdnstrmg = { - "grdnstrmg", "grdnstrm", NULL, NULL, "1998", - "Guardian Storm (Germany)\0", NULL, "Afega", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, grdnstrmgRomInfo, grdnstrmgRomName, NULL, NULL, CommonInputInfo, GrdnstrkDIPInfo, - GrdnstrmgInit, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Red Fox War Planes II (China, set 1) - -static struct BurnRomInfo redfoxwp2RomDesc[] = { - { "u112", 0x040000, 0x3f31600b, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "u107", 0x040000, 0xdaa44ab4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u92", 0x010000, 0x864b55c2, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "u4", 0x010000, 0x19239401, 3 | BRF_GRA }, // 3 Characters - - { "afega_af1-b2.uc8", 0x200000, 0xd68588c2, 4 | BRF_GRA }, // 4 Tiles - { "afega_af1-b1.uc3", 0x200000, 0xf8b200a8, 4 | BRF_GRA }, // 5 - - { "afega_af1-sp.uc13", 0x200000, 0x7d4d4985, 5 | BRF_GRA }, // 6 Sprites - - { "afega1.u95", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 7 OKI1 Samples -}; - -STD_ROM_PICK(redfoxwp2) -STD_ROM_FN(redfoxwp2) - -struct BurnDriver BurnDrvRedfoxwp2 = { - "redfoxwp2", "grdnstrm", NULL, NULL, "1998", - "Red Fox War Planes II (China, set 1)\0", NULL, "Afega", "NMK16", - L"\u7D05\u5B64\u6230\u6A5FII\0Red Fox War Planes II (China, set 1)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, redfoxwp2RomInfo, redfoxwp2RomName, NULL, NULL, CommonInputInfo, GrdnstrkDIPInfo, - GrdnstrmkInit, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Red Fox War Planes II (China, set 2) - -static struct BurnRomInfo redfoxwp2aRomDesc[] = { - { "afega_4.u112", 0x040000, 0xe6e6682a, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "afega_5.u107", 0x040000, 0x2faa2ed6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "afega_1.u92", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "afega_3.u4", 0x010000, 0x64608687, 3 | BRF_GRA }, // 3 Characters - - { "afega_af1-b2.uc8", 0x200000, 0xd68588c2, 4 | BRF_GRA }, // 4 Tiles - { "afega_af1-b1.uc3", 0x200000, 0xf8b200a8, 4 | BRF_GRA }, // 5 - - { "afega_af1-sp.uc13", 0x200000, 0x7d4d4985, 5 | BRF_GRA }, // 6 Sprites - - { "afega_2.u95", 0x040000, 0xe911ce33, 6 | BRF_SND }, // 7 OKI1 Samples -}; - -STD_ROM_PICK(redfoxwp2a) -STD_ROM_FN(redfoxwp2a) - -static INT32 Redfoxwp2Init() -{ - INT32 nRet = AfegaInit(GrdnstrmLoadCallback, pAfegaZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x80000, 17, 16, 13, 15, 14); - decryptcode(0x80000, 17, 16, 14, 15, 13); - decryptcode(0x80000, 16, 17, 15, 14, 13); - } - - return nRet; -} - -struct BurnDriver BurnDrvRedfoxwp2a = { - "redfoxwp2a", "grdnstrm", NULL, NULL, "1998", - "Red Fox War Planes II (China, set 2)\0", NULL, "Afega", "NMK16", - L"\u7D05\u5B64\u6230\u6A5FII\0Red Fox War Planes II (China, set 2)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, redfoxwp2aRomInfo, redfoxwp2aRomName, NULL, NULL, CommonInputInfo, GrdnstrkDIPInfo, - Redfoxwp2Init, AfegaExit, AfegaFrame, AfegaDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Pop's Pop's - -static struct BurnRomInfo popspopsRomDesc[] = { - { "afega4.u112", 0x040000, 0xdb191762, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "afega5.u107", 0x040000, 0x17e0c48b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "afega1.u92", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "afega3.u4", 0x010000, 0xf39dd5d2, 3 | BRF_GRA }, // 3 Characters - - { "afega6.uc8", 0x200000, 0x6d506c97, 4 | BRF_GRA }, // 4 Tiles - { "afega7.uc3", 0x200000, 0x02d7f9de, 4 | BRF_GRA }, // 5 - - { "afega2.u95", 0x040000, 0xecd8eeac, 6 | BRF_SND }, // 6 OKI1 Samples -}; - -STD_ROM_PICK(popspops) -STD_ROM_FN(popspops) - -static INT32 PopspopsLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 5, 1)) return 1; - - memset (DrvGfxROM2, 0xff, 0x80); - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 6, 1)) return 1; - - GrdnstrmGfxDecode(0x10000, 0x400000, 0x80); - - return 0; -} - -static INT32 PopspopsInit() -{ - INT32 nRet = AfegaInit(PopspopsLoadCallback, pAfegaZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x80000, 16,17,14,15,13); - } - - return nRet; -} - -struct BurnDriver BurnDrvPopspops = { - "popspops", NULL, NULL, NULL, "1999", - "Pop's Pop's\0", NULL, "Afega", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, popspopsRomInfo, popspopsRomName, NULL, NULL, CommonInputInfo, PopspopsDIPInfo, - PopspopsInit, AfegaExit, AfegaFrame, Bubl2000Draw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Bubble 2000 - -static struct BurnRomInfo bubl2000RomDesc[] = { - { "rom10.112", 0x020000, 0x87f960d7, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "rom11.107", 0x020000, 0xb386041a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "rom01.92", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "rom03.4", 0x010000, 0xf4c15588, 3 | BRF_GRA }, // 3 Characters - - { "rom06.6", 0x080000, 0xac1aabf5, 4 | BRF_GRA }, // 4 Tiles - { "rom07.9", 0x080000, 0x69aff769, 4 | BRF_GRA }, // 5 - { "rom13.7", 0x080000, 0x3a5b7226, 4 | BRF_GRA }, // 6 - { "rom04.1", 0x080000, 0x46acd054, 4 | BRF_GRA }, // 7 - { "rom05.3", 0x080000, 0x37deb6a1, 4 | BRF_GRA }, // 8 - { "rom12.2", 0x080000, 0x1fdc59dd, 4 | BRF_GRA }, // 9 - - { "rom08.11", 0x040000, 0x519dfd82, 5 | BRF_GRA }, // 10 Sprites - { "rom09.14", 0x040000, 0x04fcb5c6, 5 | BRF_GRA }, // 11 - - { "rom02.95", 0x040000, 0x859a86e5, 6 | BRF_SND }, // 12 OKI1 Samples -}; - -STD_ROM_PICK(bubl2000) -STD_ROM_FN(bubl2000) - -static INT32 Bubl2000LoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x280000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 11, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 12, 1)) return 1; - - GrdnstrmGfxDecode(0x10000, 0x400000, 0x80000); - - return 0; -} - -static INT32 Bubl2000Init() -{ - INT32 nRet = AfegaInit(Bubl2000LoadCallback, pAfegaZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x40000, 13,14,15,16,17); - } - - return nRet; -} - -struct BurnDriver BurnDrvBubl2000 = { - "bubl2000", NULL, NULL, NULL, "1998", - "Bubble 2000\0", NULL, "Afega (Tuning license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, bubl2000RomInfo, bubl2000RomName, NULL, NULL, CommonInputInfo, Bubl2000DIPInfo, - Bubl2000Init, AfegaExit, AfegaFrame, Bubl2000Draw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Hot Bubble (Korea, with adult pictures) -/* Korean release - Nude images of women for backgrounds */ - -static struct BurnRomInfo hotbublRomDesc[] = { - { "c2.uc9", 0x040000, 0x7917b95d, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "c1.uc1", 0x040000, 0x7bb240e9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "s1.uc14", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "t1.uc2", 0x010000, 0xce683a93, 3 | BRF_GRA }, // 3 Characters - - { "cr5.uc15", 0x080000, 0x65bd5159, 4 | BRF_GRA }, // 4 Tiles - { "cr7.uc19", 0x080000, 0xa89d9ce4, 4 | BRF_GRA }, // 5 - { "cr6.uc16", 0x080000, 0x99d6523c, 4 | BRF_GRA }, // 6 - { "cr1.uc6", 0x080000, 0xfc9101d2, 4 | BRF_GRA }, // 7 - { "cr3.uc12", 0x080000, 0xc841a4f6, 4 | BRF_GRA }, // 8 - { "cr2.uc7", 0x080000, 0x27ad6fc8, 4 | BRF_GRA }, // 9 - - { "br1.uc3", 0x080000, 0x6fc18de4, 5 | BRF_GRA }, // 10 Sprites - { "br3.uc10", 0x080000, 0xbb677240, 5 | BRF_GRA }, // 11 - - { "s2.uc18", 0x040000, 0x401c980f, 6 | BRF_SND }, // 12 OKI1 Samples -}; - -STD_ROM_PICK(hotbubl) -STD_ROM_FN(hotbubl) - -struct BurnDriver BurnDrvHotbubl = { - "hotbubl", "bubl2000", NULL, NULL, "1998", - "Hot Bubble (Korea, with adult pictures)\0", NULL, "Afega (Pandora license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, hotbublRomInfo, hotbublRomName, NULL, NULL, CommonInputInfo, Bubl2000DIPInfo, - Bubl2000Init, AfegaExit, AfegaFrame, Bubl2000Draw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Hot Bubble (Korea) -/* Korean release - Nude images replaced with pictures of satellite dishes */ - -static struct BurnRomInfo hotbublaRomDesc[] = { - { "7_c2.uc9", 0x040000, 0x74eb11c3, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "6_c1.uc1", 0x040000, 0x7c65bf47, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1_s1.uc14", 0x010000, 0x5d8cf28e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "2_t1.uc2", 0x010000, 0xce683a93, 3 | BRF_GRA }, // 3 Characters - - { "2_cr5.uc15", 0x080000, 0xdd7e92de, 4 | BRF_GRA }, // 4 Tiles - { "5_cr7.uc19", 0x080000, 0xd293f1d0, 4 | BRF_GRA }, // 5 - { "5_cr6.uc16", 0x080000, 0x324429c5, 4 | BRF_GRA }, // 6 - { "8_cr1.uc6", 0x080000, 0x7e2840b4, 4 | BRF_GRA }, // 7 - { "10_cr3.uc12", 0x080000, 0x312c38d8, 4 | BRF_GRA }, // 8 - { "9_cr2.uc7", 0x080000, 0xc5516087, 4 | BRF_GRA }, // 9 - - { "8_br1.uc3", 0x040000, 0x7e132eff, 5 | BRF_GRA }, // 10 Sprites - { "9_br3.uc10", 0x040000, 0x22707728, 5 | BRF_GRA }, // 11 - - { "1_s2.uc18", 0x040000, 0x401c980f, 6 | BRF_SND }, // 12 OKI1 Samples -}; - -STD_ROM_PICK(hotbubla) -STD_ROM_FN(hotbubla) - -struct BurnDriver BurnDrvHotbubla = { - "hotbubla", "bubl2000", NULL, NULL, "1998", - "Hot Bubble (Korea)\0", NULL, "Afega (Pandora license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, hotbublaRomInfo, hotbublaRomName, NULL, NULL, CommonInputInfo, Bubl2000DIPInfo, - Bubl2000Init, AfegaExit, AfegaFrame, Bubl2000Draw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Mang-Chi - -static struct BurnRomInfo mangchiRomDesc[] = { - { "afega9.u112", 0x040000, 0x0b1517a5, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "afega10.u107", 0x040000, 0xb1d0f33d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sound.u92", 0x010000, 0xbec4f9aa, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "afega5.uc6", 0x080000, 0xc73261e0, 4 | BRF_GRA }, // 3 Tiles - { "afega4.uc1", 0x080000, 0x73940917, 4 | BRF_GRA }, // 4 - - { "afega6.uc11", 0x040000, 0x979efc30, 5 | BRF_GRA }, // 5 Sprites - { "afega7.uc14", 0x040000, 0xc5cbcc38, 5 | BRF_GRA }, // 6 - - { "afega2.u95", 0x040000, 0x78c8c1f9, 6 | BRF_SND }, // 7 OKI1 Samples -}; - -STD_ROM_PICK(mangchi) -STD_ROM_FN(mangchi) - -static INT32 MangchiLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - memset (DrvGfxROM0, 0xff, 0x20); - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 6, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 7, 1)) return 1; - - GrdnstrmGfxDecode(0x20, 0x100000, 0x80000); - - return 0; -} - -static INT32 MangchiInit() -{ - INT32 nRet = AfegaInit(MangchiLoadCallback, pAfegaZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x80000, 13,14,15,16,17); - } - - return nRet; -} - -struct BurnDriver BurnDrvMangchi = { - "mangchi", NULL, NULL, NULL, "2000", - "Mang-Chi\0", NULL, "Afega", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, mangchiRomInfo, mangchiRomName, NULL, NULL, CommonInputInfo, MangchiDIPInfo, - MangchiInit, AfegaExit, AfegaFrame, Bubl2000Draw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Spectrum 2000 (vertical) - -static struct BurnRomInfo spec2kRomDesc[] = { - { "u124", 0x040000, 0xdbd6f65d, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "u120", 0x040000, 0xbe53e243, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u103", 0x010000, 0xf4e4fb10, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - - { "u3", 0x020000, 0x921503b8, 3 | BRF_GRA }, // 3 Characters - - { "uc3", 0x200000, 0x1d087122, 4 | BRF_GRA }, // 4 Tiles - { "uc2", 0x200000, 0x998dc05c, 4 | BRF_GRA }, // 5 - - { "uc1", 0x200000, 0x3139a213, 5 | BRF_GRA }, // 6 Sprites - - - { "u101", 0x040000, 0xd16aaaad, 6 | BRF_SND }, // 7 OKI1 Samples - - { "u106", 0x080000, 0x65d61f3a, 7 | BRF_SND }, // 8 OKI2 Samples -}; - -STD_ROM_PICK(spec2k) -STD_ROM_FN(spec2k) - -static void pFirehawkZ80Callback() -{ - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); - ZetMapArea(0xf000, 0xfeff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xfeff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xfeff, 2, DrvZ80RAM); - ZetSetWriteHandler(firehawk_sound_write); - ZetSetReadHandler(firehawk_sound_read); - ZetClose(); -} - -static INT32 Spec2kLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x040000, 8, 1)) return 1; - - GrdnstrmGfxDecode(0x20000, 0x400000, 0x200000); - - return 0; -} - -static INT32 Spec2kInit() -{ - Macrossmode = 1; // use macross1 text draw - INT32 nRet = AfegaInit(Spec2kLoadCallback, pFirehawkZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x80000, 17,13,14,15,16); - } - - return nRet; -} - -struct BurnDriver BurnDrvSpec2k = { - "spec2k", NULL, NULL, NULL, "2000", - "Spectrum 2000 (vertical)\0", NULL, "Yona Tech", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, spec2kRomInfo, spec2kRomName, NULL, NULL, CommonInputInfo, Spec2kDIPInfo, - Spec2kInit, AfegaExit, AfegaFrame, FirehawkDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Spectrum 2000 (horizontal, buggy) (Europe) - -static struct BurnRomInfo spec2khRomDesc[] = { - { "yonatech5.u124", 0x040000, 0x72ab5c05, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "yonatech6.u120", 0x040000, 0x7e44bd9c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "yonatech1.u103", 0x010000, 0xef5acda7, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "yonatech4.u3", 0x020000, 0x5626b08e, 3 | BRF_GRA }, // 3 Characters - - { "u153.bin", 0x200000, 0xa00bbf8f, 4 | BRF_GRA }, // 4 Tiles - { "u152.bin", 0x200000, 0xf6423fab, 4 | BRF_GRA }, // 5 - - { "u154.bin", 0x200000, 0xf77b764e, 5 | BRF_GRA }, // 6 Sprites - - { "yonatech2.u101", 0x020000, 0x4160f172, 6 | BRF_SND }, // 7 OKI1 Samples - - { "yonatech3.u106", 0x080000, 0x6644c404, 7 | BRF_SND }, // 8 OKI2 Samples -}; - -STD_ROM_PICK(spec2kh) -STD_ROM_FN(spec2kh) - -static INT32 Spec2khInit() -{ - screen_flip_y = 1; - - INT32 nRet = AfegaInit(Spec2kLoadCallback, pFirehawkZ80Callback, 1); - - if (nRet == 0) { - decryptcode(0x80000, 17,13,14,15,16); - } - - return nRet; -} - -struct BurnDriver BurnDrvSpec2kh = { - "spec2kh", "spec2k", NULL, NULL, "2000", - "Spectrum 2000 (horizontal, buggy) (Europe)\0", NULL, "Yona Tech", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, spec2khRomInfo, spec2khRomName, NULL, NULL, CommonInputInfo, Spec2kDIPInfo, - Spec2khInit, AfegaExit, AfegaFrame, FirehawkDraw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Fire Hawk (horizontal) - -static struct BurnRomInfo firehawkRomDesc[] = { - { "fhawk_p1.u59", 0x080000, 0xd6d71a50, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "fhawk_p2.u60", 0x080000, 0x9f35d245, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "fhawk_s1.u40", 0x020000, 0xc6609c39, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "fhawk_g1.uc6", 0x200000, 0x2ab0b06b, 4 | BRF_GRA }, // 3 Tiles - { "fhawk_g2.uc5", 0x200000, 0xd11bfa20, 4 | BRF_GRA }, // 4 - - { "fhawk_g3.uc2", 0x200000, 0xcae72ff4, 5 | BRF_GRA }, // 5 Sprites - - { "fhawk_s2.u36", 0x040000, 0xd16aaaad, 6 | BRF_SND }, // 6 OKI1 Samples - - { "fhawk_s3.u41", 0x040000, 0x3fdcfac2, 7 | BRF_SND }, // 7 OKI2 Samples -}; - -STD_ROM_PICK(firehawk) -STD_ROM_FN(firehawk) - -static INT32 FirehawkLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - memset (DrvGfxROM0, 0xff, 0x20); - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x040000, 7, 1)) return 1; - - GrdnstrmGfxDecode(0x20, 0x400000, 0x200000); - - return 0; -} - -static INT32 FirehawkInit() -{ - screen_flip_y = 1; - - return AfegaInit(FirehawkLoadCallback, pFirehawkZ80Callback, 1); -} - -struct BurnDriver BurnDrvFirehawk = { - "firehawk", "spec2k", NULL, NULL, "2001", - "Fire Hawk (horizontal)\0", NULL, "ESD", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, firehawkRomInfo, firehawkRomName, NULL, NULL, CommonInputInfo, FirehawkDIPInfo, - FirehawkInit, AfegaExit, AfegaFrame, FirehawkDraw, DrvScan, NULL, 0x300, - 256, 224, 4, 3 -}; - - -// Twin Action - -static struct BurnRomInfo twinactnRomDesc[] = { - { "afega.uj13", 0x020000, 0x9187701d, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "afega.uj12", 0x020000, 0xfe8cff9c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "afega.su6", 0x008000, 0x3a52dc88, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "afega.uj11", 0x020000, 0x3f439e92, 3 | BRF_GRA }, // 3 Characters - - { "afega.ui20", 0x080000, 0x237c8f92, 4 | BRF_GRA }, // 4 Tiles - - { "afega.ub11", 0x080000, 0x287f20d8, 5 | BRF_GRA }, // 5 Sprites - { "afega.ub13", 0x080000, 0xf525f819, 5 | BRF_GRA }, // 6 - - { "afega.su12", 0x020000, 0x91d665f3, 6 | BRF_SND }, // 7 OKI1 Samples - { "afega.su13", 0x040000, 0x30e1c306, 6 | BRF_SND }, // 8 -}; - -STD_ROM_PICK(twinactn) -STD_ROM_FN(twinactn) - -static void Twinactn68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - //SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_WRITE); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_ROM); - SekSetWriteWordHandler(0, afega_main_write_word); - SekSetWriteByteHandler(0, afega_main_write_byte); - SekSetReadWordHandler(0, afega_main_read_word); - SekSetReadByteHandler(0, afega_main_read_byte); - SekClose(); -} - -static INT32 TwinactnLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 6, 2)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x0a0000, 8, 1)) return 1; - memcpy (DrvSndROM1 + 0xe0000, DrvSndROM1 + 0xc0000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 7, 1)) return 1; - memcpy (DrvSndROM1 + 0x40000, DrvSndROM1 + 0x00000, 0x20000); - memcpy (DrvSndROM1 + 0x80000, DrvSndROM1 + 0x00000, 0x20000); - memcpy (DrvSndROM1 + 0xc0000, DrvSndROM1 + 0x00000, 0x20000); - memcpy (DrvSndROM1 + 0x20000, DrvSndROM1 + 0x00000, 0x20000); - memcpy (DrvSndROM1 + 0x60000, DrvSndROM1 + 0x00000, 0x20000); - - DrvGfxDecode(0x20000, 0x80000, 0x100000); - } - - Twinactn68kInit(); - - return 0; -} - -static INT32 TwinactnInit() -{ - input_high[0] = 0x0000; - input_high[1] = 0x8080; - nNMK004EnableIrq2 = 1; - - return MSM6295x1Init(TwinactnLoadCallback); -} - -struct BurnDriver BurnDrvTwinactn = { - "twinactn", NULL, NULL, NULL, "1995", - "Twin Action\0", NULL, "Afega", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, twinactnRomInfo, twinactnRomName, NULL, NULL, CommonInputInfo, TwinactnDIPInfo, - TwinactnInit, MSM6295x1Exit, SsmissinFrame, MustangDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Dolmen -/* Original source of the caveman concept for Bubble 2000 / Hot Bubble, much earlier and completely different hardware */ - -static struct BurnRomInfo dolmenRomDesc[] = { - { "afega8.uj3", 0x20000, 0xf1b73e4c, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "afega7.uj2", 0x20000, 0xc91bda0b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "afega1.su6", 0x08000, 0x166b53cb, 2 | BRF_PRG | BRF_ESS }, // 2 z80 code - - { "afega6.uj11", 0x20000, 0x13fa4415, 3 | BRF_GRA }, // 3 Characters - - { "afega9.ui20", 0x80000, 0xb3fa7be6, 4 | BRF_GRA }, // 4 Tiles - - { "afega4.ub11", 0x80000, 0x5a259393, 5 | BRF_GRA }, // 5 Sprites - { "afega5.ub13", 0x80000, 0x7f6a683d, 6 | BRF_GRA }, // 6 - - { "afega2.su12", 0x20000, 0x1a2ce1c2, 6 | BRF_SND }, // 7 OKI1 Samples - { "afega3.su13", 0x40000, 0xd3531018, 6 | BRF_SND }, // 8 -}; - -STD_ROM_PICK(dolmen) -STD_ROM_FN(dolmen) - -static INT32 DolmenLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 6, 2)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x0a0000, 8, 1)) return 1; - memcpy (DrvSndROM1 + 0xe0000, DrvSndROM1 + 0xc0000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 7, 1)) return 1; - memcpy (DrvSndROM1 + 0x40000, DrvSndROM1 + 0x00000, 0x20000); - memcpy (DrvSndROM1 + 0x80000, DrvSndROM1 + 0x00000, 0x20000); - memcpy (DrvSndROM1 + 0xc0000, DrvSndROM1 + 0x00000, 0x20000); - memcpy (DrvSndROM1 + 0x20000, DrvSndROM1 + 0x00000, 0x20000); - memcpy (DrvSndROM1 + 0x60000, DrvSndROM1 + 0x00000, 0x20000); - - DrvGfxDecode(0x20000, 0x80000, 0x100000); - } - - Twinactn68kInit(); - - return 0; -} - -static INT32 DolmenInit() -{ - nNMK004EnableIrq2 = 1; - - return MSM6295x1Init(DolmenLoadCallback); -} - -struct BurnDriver BurnDrvDolmen = { - "dolmen", NULL, NULL, NULL, "1995", - "Dolmen\0", NULL, "Afega", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, dolmenRomInfo, dolmenRomName, NULL, NULL, DolmenInputInfo, DolmenDIPInfo, - DolmenInit, MSM6295x1Exit, SsmissinFrame, MacrossDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Saboten Bombers (set 1) - -static struct BurnRomInfo sabotenbRomDesc[] = { - { "ic76.sb1", 0x040000, 0xb2b0b2cf, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "ic75.sb2", 0x040000, 0x367e87b7, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ic35.sb3", 0x010000, 0xeb7bc99d, 3 | BRF_GRA }, // 2 Characters - - { "ic32.sb4", 0x200000, 0x24c62205, 4 | BRF_GRA }, // 3 Tiles - - { "ic100.sb5", 0x200000, 0xb20f166e, 5 | BRF_GRA }, // 4 Sprites - - { "ic30.sb6", 0x100000, 0x288407af, 6 | BRF_SND }, // 5 OKI1 Samples - - { "ic27.sb7", 0x100000, 0x43e33a7e, 7 | BRF_SND }, // 6 OKI2 Samples -}; - -STD_ROM_PICK(sabotenb) -STD_ROM_FN(sabotenb) - -static INT32 SabotenbLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 4, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x200000); - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 6, 1)) return 1; - - decode_gfx(0x200000, 0x200000); - - BjtwinGfxDecode(0x10000, 0x200000, 0x200000); - - return 0; -} - -static INT32 SabotenbInit() -{ - return BjtwinInit(SabotenbLoadCallback); -} - -struct BurnDriver BurnDrvSabotenb = { - "sabotenb", NULL, NULL, NULL, "1992", - "Saboten Bombers (set 1)\0", NULL, "NMK / Tecmo", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, sabotenbRomInfo, sabotenbRomName, NULL, NULL, CommonInputInfo, SabotenbDIPInfo, - SabotenbInit, BjtwinExit, BjtwinFrame, BjtwinDraw, DrvScan, NULL, 0x400, - 384, 224, 4, 3 -}; - - -// Saboten Bombers (set 2) - -static struct BurnRomInfo sabotenbaRomDesc[] = { - { "sb1.76", 0x040000, 0xdf6f65e2, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "sb2.75", 0x040000, 0x0d2c1ab8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ic35.sb3", 0x010000, 0xeb7bc99d, 3 | BRF_GRA }, // 2 Characters - - { "ic32.sb4", 0x200000, 0x24c62205, 4 | BRF_GRA }, // 3 Tiles - - { "ic100.sb5", 0x200000, 0xb20f166e, 5 | BRF_GRA }, // 4 Sprites - - { "ic30.sb6", 0x100000, 0x288407af, 6 | BRF_SND }, // 5 OKI1 Samples - - { "ic27.sb7", 0x100000, 0x43e33a7e, 7 | BRF_SND }, // 6 OKI2 Samples -}; - -STD_ROM_PICK(sabotenba) -STD_ROM_FN(sabotenba) - -struct BurnDriver BurnDrvSabotenba = { - "sabotenba", "sabotenb", NULL, NULL, "1992", - "Saboten Bombers (set 2)\0", NULL, "NMK / Tecmo", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, sabotenbaRomInfo, sabotenbaRomName, NULL, NULL, CommonInputInfo, SabotenbDIPInfo, - SabotenbInit, BjtwinExit, BjtwinFrame, BjtwinDraw, DrvScan, NULL, 0x400, - 384, 224, 4, 3 -}; - - -// Cactus (bootleg of Saboten Bombers) - -static struct BurnRomInfo cactusRomDesc[] = { - { "02.bin", 0x040000, 0x15b2ff2f, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "01.bin", 0x040000, 0x5b8ba46a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "i03.bin", 0x010000, 0xeb7bc99d, 3 | BRF_GRA }, // 2 Characters - - { "s-05.bin", 0x100000, 0xfce962b9, 4 | BRF_GRA }, // 3 Tiles - { "s-06.bin", 0x100000, 0x16768fbc, 4 | BRF_GRA }, // 4 - - { "s-03.bin", 0x100000, 0xbc1781b8, 5 | BRF_GRA }, // 5 Sprites - { "s-04.bin", 0x100000, 0xf823885e, 5 | BRF_GRA }, // 6 - - { "s-01.bin", 0x100000, 0x288407af, 6 | BRF_SND }, // 7 OKI1 Samples - - { "s-02.bin", 0x100000, 0x43e33a7e, 7 | BRF_SND }, // 8 OKI2 Samples -}; - -STD_ROM_PICK(cactus) -STD_ROM_FN(cactus) - -static INT32 CactusLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 8, 1)) return 1; - - decode_gfx(0x200000, 0x200000); - - BjtwinGfxDecode(0x10000, 0x200000, 0x200000); - - return 0; -} - -static INT32 CactusInit() -{ - return BjtwinInit(CactusLoadCallback); -} - -struct BurnDriver BurnDrvCactus = { - "cactus", "sabotenb", NULL, NULL, "1992", - "Cactus (bootleg of Saboten Bombers)\0", NULL, "bootleg", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, cactusRomInfo, cactusRomName, NULL, NULL, CommonInputInfo, SabotenbDIPInfo, - CactusInit, BjtwinExit, BjtwinFrame, BjtwinDraw, DrvScan, NULL, 0x400, - 384, 224, 4, 3 -}; - - -// Bombjack Twin (set 1) - -static struct BurnRomInfo bjtwinRomDesc[] = { - { "93087-1.bin", 0x020000, 0x93c84e2d, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "93087-2.bin", 0x020000, 0x30ff678a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "93087-3.bin", 0x010000, 0xaa13df7c, 3 | BRF_GRA }, // 2 Characters - - { "93087-4.bin", 0x100000, 0x8a4f26d0, 4 | BRF_GRA }, // 3 Tiles - - { "93087-5.bin", 0x100000, 0xbb06245d, 5 | BRF_GRA }, // 4 Sprites - - { "93087-6.bin", 0x100000, 0x372d46dd, 6 | BRF_SND }, // 5 OKI1 Samples - - { "93087-7.bin", 0x100000, 0x8da67808, 7 | BRF_SND }, // 6 OKI2 Samples - - { "8.bpr", 0x000100, 0x633ab1c9, 0 | BRF_OPT }, // 7 Unused proms - { "9.bpr", 0x000100, 0x435653a2, 0 | BRF_OPT }, // 8 -}; - -STD_ROM_PICK(bjtwin) -STD_ROM_FN(bjtwin) - -static INT32 BjtwinLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 4, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x100000); - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 6, 1)) return 1; - - decode_gfx(0x100000, 0x100000); - - BjtwinGfxDecode(0x10000, 0x100000, 0x100000); - - return 0; -} - -static INT32 BjtwinGameInit() -{ - return BjtwinInit(BjtwinLoadCallback); -} - -struct BurnDriver BurnDrvBjtwin = { - "bjtwin", NULL, NULL, NULL, "1993", - "Bombjack Twin (set 1)\0", NULL, "NMK", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, bjtwinRomInfo, bjtwinRomName, NULL, NULL, CommonInputInfo, BjtwinDIPInfo, - BjtwinGameInit, BjtwinExit, BjtwinFrame, BjtwinDraw, DrvScan, NULL, 0x400, - 224, 384, 3, 4 -}; - - -// Bombjack Twin (set 2) - -static struct BurnRomInfo bjtwinaRomDesc[] = { - { "93087.1", 0x020000, 0xc82b3d8e, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "93087.2", 0x020000, 0x9be1ec47, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "93087-3.bin", 0x010000, 0xaa13df7c, 3 | BRF_GRA }, // 2 Characters - - { "93087-4.bin", 0x100000, 0x8a4f26d0, 4 | BRF_GRA }, // 3 Tiles - - { "93087-5.bin", 0x100000, 0xbb06245d, 5 | BRF_GRA }, // 4 Sprites - - { "93087-6.bin", 0x100000, 0x372d46dd, 6 | BRF_SND }, // 5 OKI1 Samples - - { "93087-7.bin", 0x100000, 0x8da67808, 7 | BRF_SND }, // 6 OKI2 Samples - - { "8.bpr", 0x000100, 0x633ab1c9, 0 | BRF_OPT }, // 7 Unused proms - { "9.bpr", 0x000100, 0x435653a2, 0 | BRF_OPT }, // 8 -}; - -STD_ROM_PICK(bjtwina) -STD_ROM_FN(bjtwina) - -struct BurnDriver BurnDrvBjtwina = { - "bjtwina", "bjtwin", NULL, NULL, "1993", - "Bombjack Twin (set 2)\0", NULL, "NMK", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, bjtwinaRomInfo, bjtwinaRomName, NULL, NULL, CommonInputInfo, BjtwinDIPInfo, - BjtwinGameInit, BjtwinExit, BjtwinFrame, BjtwinDraw, DrvScan, NULL, 0x400, - 224, 384, 3, 4 -}; - - -// Nouryoku Koujou Iinkai - -static struct BurnRomInfo nouryokuRomDesc[] = { - { "ic76.1", 0x040000, 0x26075988, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "ic75.2", 0x040000, 0x75ab82cd, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ic35.3", 0x010000, 0x03d0c3b1, 3 | BRF_GRA }, // 2 Characters - - { "ic32.4", 0x200000, 0x88d454fd, 4 | BRF_GRA }, // 3 Tiles - - { "ic100.5", 0x200000, 0x24d3e24e, 5 | BRF_GRA }, // 4 Sprites - - { "ic30.6", 0x100000, 0xfeea34f4, 6 | BRF_SND }, // 5 OKI1 Samples - - { "ic27.7", 0x100000, 0x8a69fded, 7 | BRF_SND }, // 6 OKI2 Samples -}; - -STD_ROM_PICK(nouryoku) -STD_ROM_FN(nouryoku) - -static INT32 NouryokuLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 4, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x200000); - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 6, 1)) return 1; - - decode_gfx(0x200000, 0x200000); - - BjtwinGfxDecode(0x10000, 0x200000, 0x200000); - - return 0; -} - -static INT32 NouryokuGameInit() -{ - return BjtwinInit(NouryokuLoadCallback); -} - -struct BurnDriver BurnDrvNouryoku = { - "nouryoku", NULL, NULL, NULL, "1995", - "Nouryoku Koujou Iinkai\0", NULL, "Tecmo", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, nouryokuRomInfo, nouryokuRomName, NULL, NULL, CommonInputInfo, NouryokuDIPInfo, - NouryokuGameInit, BjtwinExit, BjtwinFrame, BjtwinDraw, DrvScan, NULL, 0x400, - 384, 224, 4, 3 -}; - - -// US AAF Mustang (25th May. 1990) - -static struct BurnRomInfo mustangRomDesc[] = { - { "2.bin", 0x020000, 0xbd9f7c89, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "3.bin", 0x020000, 0x0eec36a5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "90058-7", 0x010000, 0x920a93c8, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "90058-1", 0x020000, 0x81ccfcad, 3 | BRF_GRA }, // 3 Characters - - { "90058-4", 0x080000, 0xa07a2002, 4 | BRF_GRA }, // 4 Tiles - - { "90058-8", 0x080000, 0x560bff04, 5 | BRF_GRA }, // 5 Sprites - { "90058-9", 0x080000, 0xb9d72a03, 5 | BRF_GRA }, // 6 - - { "90058-5", 0x080000, 0xc60c883e, 6 | BRF_SND }, // 7 OKI1 Samples - - { "90058-6", 0x080000, 0x233c1776, 7 | BRF_SND }, // 8 OKI2 Samples - - { "10.bpr", 0x000100, 0x633ab1c9, 0 | BRF_OPT }, // 9 Unused proms - { "90058-11", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 10 -}; - -STDROMPICKEXT(mustang, mustang, nmk004) -STD_ROM_FN(mustang) - -static INT32 MustangLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x00001, 6, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x00000, 7, 1)) return 1; - memmove (DrvSndROM0 + 0x040000, DrvSndROM0 + 0x20000, 0x60000); - - if (BurnLoadRom(DrvSndROM1 + 0x00000, 8, 1)) return 1; - memmove (DrvSndROM1 + 0x040000, DrvSndROM1 + 0x20000, 0x60000); - - DrvGfxDecode(0x20000, 0x80000, 0x100000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - //SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_WRITE); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_ROM); - SekSetWriteWordHandler(0, mustang_main_write_word); - SekSetWriteByteHandler(0, mustang_main_write_byte); - SekSetReadWordHandler(0, mustang_main_read_word); - SekSetReadByteHandler(0, mustang_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 MustangInit() -{ - return NMK004Init(MustangLoadCallback, 10000000); -} - -struct BurnDriver BurnDrvMustang = { - "mustang", NULL, "nmk004", NULL, "1990", - "US AAF Mustang (25th May. 1990)\0", NULL, "UPL", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, mustangRomInfo, mustangRomName, NULL, NULL, CommonInputInfo, MustangDIPInfo, - MustangInit, NMK004Exit, NMK004Frame, MustangDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// US AAF Mustang (25th May. 1990 / Seoul Trading) - -static struct BurnRomInfo mustangsRomDesc[] = { - { "90058-2", 0x020000, 0x833aa458, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "90058-3", 0x020000, 0xe4b80f06, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "90058-7", 0x010000, 0x920a93c8, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "90058-1", 0x020000, 0x81ccfcad, 3 | BRF_GRA }, // 3 Characters - - { "90058-4", 0x080000, 0xa07a2002, 4 | BRF_GRA }, // 4 Tiles - - { "90058-8", 0x080000, 0x560bff04, 5 | BRF_GRA }, // 5 Sprites - { "90058-9", 0x080000, 0xb9d72a03, 5 | BRF_GRA }, // 6 - - { "90058-5", 0x080000, 0xc60c883e, 6 | BRF_SND }, // 7 OKI1 Samples - - { "90058-6", 0x080000, 0x233c1776, 7 | BRF_SND }, // 8 OKI2 Samples - - { "90058-10", 0x000100, 0xde156d99, 0 | BRF_OPT }, // 9 Unused proms - { "90058-11", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 10 -}; - -STDROMPICKEXT(mustangs, mustangs, nmk004) -STD_ROM_FN(mustangs) - -struct BurnDriver BurnDrvMustangs = { - "mustangs", "mustang", "nmk004", NULL, "1990", - "US AAF Mustang (25th May. 1990 / Seoul Trading)\0", NULL, "UPL (Seoul Trading license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, mustangsRomInfo, mustangsRomName, NULL, NULL, CommonInputInfo, MustangDIPInfo, - MustangInit, NMK004Exit, NMK004Frame, MustangDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// US AAF Mustang (bootleg) - -static struct BurnRomInfo mustangbRomDesc[] = { - { "mustang.14", 0x020000, 0x13c6363b, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "mustang.13", 0x020000, 0xd8ccce31, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "mustang.16", 0x010000, 0x99ee7505, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "90058-1", 0x020000, 0x81ccfcad, 3 | BRF_GRA }, // 3 Characters - - { "90058-4", 0x080000, 0xa07a2002, 4 | BRF_GRA }, // 4 Tiles - - { "90058-8", 0x080000, 0x560bff04, 5 | BRF_GRA }, // 5 Sprites - { "90058-9", 0x080000, 0xb9d72a03, 5 | BRF_GRA }, // 6 - - { "mustang.17", 0x010000, 0xf6f6c4bf, 6 | BRF_SND }, // 7 oki -}; - -STD_ROM_PICK(mustangb) -STD_ROM_FN(mustangb) - -static INT32 MustangbLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - memcpy (DrvZ80ROM + 0x10000, DrvZ80ROM + 0x8000, 0x8000); - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x0000, 0x8000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 6, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 7, 1)) return 1; - - DrvGfxDecode(0x20000, 0x80000, 0x100000); - - return 0; -} - -static INT32 MustangbInit() -{ - return SeibuSoundInit(MustangbLoadCallback, 1); -} - -struct BurnDriver BurnDrvMustangb = { - "mustangb", "mustang", NULL, NULL, "1990", - "US AAF Mustang (bootleg)\0", NULL, "bootleg", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, mustangbRomInfo, mustangbRomName, NULL, NULL, CommonInputInfo, MustangDIPInfo, - MustangbInit, SeibuSoundExit, SeibuSoundFrame, MustangDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// US AAF Mustang (TAB Austria bootleg) - -static struct BurnRomInfo mustangb2RomDesc[] = { - { "05.bin", 0x020000, 0x13c6363b, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "04.bin", 0x020000, 0x0d06f723, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "01.bin", 0x010000, 0x90820499, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "06.bin", 0x020000, 0x81ccfcad, 3 | BRF_GRA }, // 3 Characters - - { "07.bin", 0x020000, 0x5f8fdfb1, 4 | BRF_GRA }, // 4 Tiles - { "10.bin", 0x020000, 0x39757d6a, 4 | BRF_GRA }, // 5 - { "08.bin", 0x020000, 0xb3dd5243, 4 | BRF_GRA }, // 6 - { "09.bin", 0x020000, 0xc6c9752f, 4 | BRF_GRA }, // 7 - - { "18.bin", 0x020000, 0xd13f0722, 5 | BRF_GRA }, // 8 Sprites - { "13.bin", 0x020000, 0x54773f95, 5 | BRF_GRA }, // 9 - { "17.bin", 0x020000, 0x87c1fb43, 5 | BRF_GRA }, // 10 - { "14.bin", 0x020000, 0x932d3e33, 5 | BRF_GRA }, // 11 - { "16.bin", 0x020000, 0x23d03ad5, 5 | BRF_GRA }, // 12 - { "15.bin", 0x020000, 0xa62b2f87, 5 | BRF_GRA }, // 13 - { "12.bin", 0x020000, 0x42a6cfc2, 5 | BRF_GRA }, // 14 - { "11.bin", 0x020000, 0x9d3bee66, 5 | BRF_GRA }, // 15 - - { "02.bin", 0x010000, 0xf6f6c4bf, 6 | BRF_SND }, // 16 oki -}; - -STD_ROM_PICK(mustangb2) -STD_ROM_FN(mustangb2) - -static INT32 Mustangb2LoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - memcpy (DrvZ80ROM + 0x10000, DrvZ80ROM + 0x8000, 0x8000); - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x8000, 0x8000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x060000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x040001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c0000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c0001, 15, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 16, 1)) return 1; - - DrvGfxDecode(0x20000, 0x80000, 0x100000); - - return 0; -} - -static INT32 Mustangb2Init() -{ - return SeibuSoundInit(Mustangb2LoadCallback, 1); -} - -struct BurnDriver BurnDrvMustangb2 = { - "mustangb2", "mustang", NULL, NULL, "1990", - "US AAF Mustang (TAB Austria bootleg)\0", NULL, "bootleg", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, mustangb2RomInfo, mustangb2RomName, NULL, NULL, CommonInputInfo, MustangDIPInfo, - Mustangb2Init, SeibuSoundExit, SeibuSoundFrame, MustangDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Thunder Dragon (9th Jan. 1992) - -static struct BurnRomInfo tdragonRomDesc[] = { - { "91070_68k.8", 0x020000, 0x121c3ae7, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "91070_68k.7", 0x020000, 0x6e154d8e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "91070.1", 0x010000, 0xbf493d74, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "91070.6", 0x020000, 0xfe365920, 3 | BRF_GRA }, // 3 Characters - - { "91070.5", 0x100000, 0xd0bde826, 4 | BRF_GRA }, // 4 Tiles - - { "91070.4", 0x100000, 0x3eedc2fe, 5 | BRF_GRA }, // 5 Sprites - - { "91070.3", 0x080000, 0xae6875a8, 6 | BRF_SND }, // 6 OKI1 Samples - - { "91070.2", 0x080000, 0xecfea43e, 7 | BRF_SND }, // 7 OKI2 Samples - - { "91070.9", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 8 Unused proms - { "91070.10", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 9 -}; - -STDROMPICKEXT(tdragon, tdragon, nmk004) -STD_ROM_FN(tdragon) - -static INT32 TdragonLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 5, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x100000); - - if (BurnLoadRom(DrvSndROM0 + 0x20000, 6, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x20000, 7, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x20000, 0x20000); - - DrvGfxDecode(0x20000, 0x100000, 0x100000); - } - - { - *((UINT16*)(Drv68KROM + 0x048a)) = BURN_ENDIAN_SWAP_INT16(0x4e71); - *((UINT16*)(Drv68KROM + 0x04aa)) = BURN_ENDIAN_SWAP_INT16(0x4e71); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x0b0000, 0x0bffff, MAP_ROM); - SekMapMemory(DrvScrollRAM, 0x0c4000, 0x0c43ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0c8000, 0x0c87ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x0cc000, 0x0cffff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x0d0000, 0x0d07ff, MAP_RAM); - SekSetWriteWordHandler(0, tdragon_main_write_word); - SekSetWriteByteHandler(0, tdragon_main_write_byte); - SekSetReadWordHandler(0, tdragon_main_read_word); - SekSetReadByteHandler(0, tdragon_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 TdragonInit() -{ - return NMK004Init(TdragonLoadCallback, 8000000); -} - -struct BurnDriver BurnDrvTdragon = { - "tdragon", NULL, "nmk004", NULL, "1991", - "Thunder Dragon (9th Jan. 1992)\0", NULL, "NMK (Tecmo license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, tdragonRomInfo, tdragonRomName, NULL, NULL, CommonInputInfo, TdragonDIPInfo, - TdragonInit, NMK004Exit, NMK004Frame, HachamfDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// Thunder Dragon (4th Jun. 1991) - -static struct BurnRomInfo tdragon1RomDesc[] = { - { "thund.8", 0x020000, 0xedd02831, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "thund.7", 0x020000, 0x52192fe5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "91070.1", 0x010000, 0xbf493d74, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "91070.6", 0x020000, 0xfe365920, 3 | BRF_GRA }, // 3 Characters - - { "91070.5", 0x100000, 0xd0bde826, 4 | BRF_GRA }, // 4 Tiles - - { "91070.4", 0x100000, 0x3eedc2fe, 5 | BRF_GRA }, // 5 Sprites - - { "91070.3", 0x080000, 0xae6875a8, 6 | BRF_SND }, // 6 OKI1 Samples - - { "91070.2", 0x080000, 0xecfea43e, 7 | BRF_SND }, // 7 OKI2 Samples - - { "91070.9", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 8 Unused proms - { "91070.10", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 9 -}; - -STDROMPICKEXT(tdragon1, tdragon1, nmk004) -STD_ROM_FN(tdragon1) - -struct BurnDriver BurnDrvTdragon1 = { - "tdragon1", "tdragon", "nmk004", NULL, "1991", - "Thunder Dragon (4th Jun. 1991)\0", NULL, "NMK (Tecmo license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, tdragon1RomInfo, tdragon1RomName, NULL, NULL, CommonInputInfo, TdragonDIPInfo, - TdragonInit, NMK004Exit, NMK004Frame, HachamfDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// Thunder Dragon (bootleg) - -static struct BurnRomInfo tdragonbRomDesc[] = { - { "td_04.bin", 0x020000, 0xe8a62d3e, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "td_03.bin", 0x020000, 0x2fa1aa04, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "td_02.bin", 0x010000, 0x99ee7505, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "td_08.bin", 0x020000, 0x5144dc69, 3 | BRF_GRA }, // 3 Characters - - { "td_06.bin", 0x080000, 0xc1be8a4d, 4 | BRF_GRA }, // 4 Tiles - { "td_07.bin", 0x080000, 0x2c3e371f, 4 | BRF_GRA }, // 5 - - { "td_10.bin", 0x080000, 0xbfd0ec5d, 5 | BRF_GRA }, // 6 Sprites - { "td_09.bin", 0x080000, 0xb6e074eb, 5 | BRF_GRA }, // 7 - - { "td_01.bin", 0x010000, 0xf6f6c4bf, 6 | BRF_SND }, // 8 OKI1 Samples -}; - -STD_ROM_PICK(tdragonb) -STD_ROM_FN(tdragonb) - -static INT32 TdragonbLoadCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - memcpy (DrvZ80ROM + 0x10000, DrvZ80ROM + 0x8000, 0x8000); - memcpy (DrvZ80ROM + 0x18000, DrvZ80ROM + 0x0000, 0x8000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 7, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 8, 1)) return 1; - - decode_tdragonb(); - DrvGfxDecode(0x20000, 0x100000, 0x100000); - - return 0; -} - -static INT32 TdragonbInit() -{ - return SeibuSoundInit(TdragonbLoadCallback, 0); -} - -struct BurnDriver BurnDrvTdragonb = { - "tdragonb", "tdragon", NULL, NULL, "1991", - "Thunder Dragon (bootleg)\0", NULL, "bootleg", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, tdragonbRomInfo, tdragonbRomName, NULL, NULL, CommonInputInfo, TdragonbDIPInfo, - TdragonbInit, SeibuSoundExit, SeibuSoundFrame, MacrossDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - - -// Acrobat Mission - -static struct BurnRomInfo acrobatmRomDesc[] = { - { "02_ic100.bin", 0x020000, 0x3fe487f4, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "01_ic101.bin", 0x020000, 0x17175753, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "04_ic74.bin", 0x010000, 0x176905fb, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "03_ic79.bin", 0x010000, 0xd86c186e, 3 | BRF_GRA }, // 3 Characters - - { "09_ic8.bin", 0x100000, 0x7c12afed, 4 | BRF_GRA }, // 4 Tiles - - { "07_ic42.bin", 0x100000, 0x5672bdaa, 5 | BRF_GRA }, // 5 Sprites - { "08_ic29.bin", 0x080000, 0xb4c0ace3, 5 | BRF_GRA }, // 6 - - { "05_ic54.bin", 0x080000, 0x3b8c2b0e, 6 | BRF_SND }, // 7 OKI1 Samples - - { "06_ic53.bin", 0x080000, 0xc1517cd4, 7 | BRF_SND }, // 8 OKI2 Samples - - { "10_ic81.bin", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 9 Unused proms - { "11_ic80.bin", 0x000100, 0x633ab1c9, 0 | BRF_OPT }, // 10 -}; - -STDROMPICKEXT(acrobatm, acrobatm, nmk004) -STD_ROM_FN(acrobatm) - -static INT32 AcrobatmLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x020000, 7, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x020000, 8, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x20000, 0x20000); - - DrvGfxDecode(0x10000, 0x100000, 0x200000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x08ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0c4000, 0x0c47ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x0c8000, 0x0c83ff, MAP_WRITE); - SekMapMemory(DrvBgRAM0, 0x0cc000, 0x0cffff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x0d4000, 0x0d47ff, MAP_RAM); - SekSetWriteWordHandler(0, acrobatm_main_write_word); - SekSetWriteByteHandler(0, acrobatm_main_write_byte); - SekSetReadWordHandler(0, acrobatm_main_read_word); - SekSetReadByteHandler(0, acrobatm_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 AcrobatmInit() -{ - INT32 rc = NMK004Init(AcrobatmLoadCallback, 10000000); - - if (!rc) { - MSM6295SetRoute(1, 0.18, BURN_SND_ROUTE_BOTH); - } - - return rc; -} - -struct BurnDriver BurnDrvAcrobatm = { - "acrobatm", NULL, "nmk004", NULL, "1991", - "Acrobat Mission\0", NULL, "UPL (Taito license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, acrobatmRomInfo, acrobatmRomName, NULL, NULL, AcrobatmInputInfo, AcrobatmDIPInfo, - AcrobatmInit, NMK004Exit, NMK004Frame, AcrobatmDraw, DrvScan, NULL, 0x300, - 224, 256, 3, 4 -}; - - -// Super Spacefortress Macross / Chou-Jikuu Yousai Macross - -static struct BurnRomInfo macrossRomDesc[] = { - { "921a03", 0x080000, 0x33318d55, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - - { "921a02", 0x010000, 0x77c082c7, 2 | BRF_PRG | BRF_ESS }, // 1 NMK004 data - - { "921a01", 0x020000, 0xbbd8242d, 3 | BRF_GRA }, // 2 Characters - - { "921a04", 0x200000, 0x4002e4bb, 4 | BRF_GRA }, // 3 Tiles - - { "921a07", 0x200000, 0x7d2bf112, 5 | BRF_GRA }, // 4 Sprites - - { "921a05", 0x080000, 0xd5a1eddd, 6 | BRF_SND }, // 5 OKI1 Samples - - { "921a06", 0x080000, 0x89461d0f, 7 | BRF_SND }, // 6 OKI2 Samples - - { "921a08", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 7 Unused proms - { "921a09", 0x000100, 0x633ab1c9, 0 | BRF_OPT }, // 8 - { "921a10", 0x000020, 0x8371e42d, 0 | BRF_OPT }, // 9 -}; - -STDROMPICKEXT(macross, macross, nmk004) -STD_ROM_FN(macross) - -static INT32 MacrossLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 4, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x200000); - - if (BurnLoadRom(DrvSndROM0 + 0x020000, 5, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x020000, 6, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x20000, 0x20000); - - decode_gfx(0x200000, 0x200000); - DrvGfxDecode(0x20000, 0x200000, 0x200000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_WRITE); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_ROM); - SekSetWriteWordHandler(0, macross_main_write_word); - SekSetWriteByteHandler(0, macross_main_write_byte); - SekSetReadWordHandler(0, macross_main_read_word); - SekSetReadByteHandler(0, macross_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 MacrossInit() -{ - Macrossmode = 1; - return NMK004Init(MacrossLoadCallback, 10000000); -} - -struct BurnDriver BurnDrvMacross = { - "macross", NULL, "nmk004", NULL, "1992", - "Super Spacefortress Macross / Chou-Jikuu Yousai Macross\0", NULL, "Banpresto", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, macrossRomInfo, macrossRomName, NULL, NULL, CommonInputInfo, MacrossDIPInfo, - MacrossInit, NMK004Exit, NMK004Frame, MacrossDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// GunNail (28th May. 1992) - -static struct BurnRomInfo gunnailRomDesc[] = { - { "3e.u131", 0x040000, 0x61d985b2, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "3o.u133", 0x040000, 0xf114e89c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "92077_2.u101", 0x010000, 0xcd4e55f8, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "1.u21", 0x020000, 0x3d00a9f4, 3 | BRF_GRA }, // 3 Characters - - { "92077-4.u19", 0x100000, 0xa9ea2804, 4 | BRF_GRA }, // 4 Tiles - - { "92077-7.u134", 0x200000, 0xd49169b3, 5 | BRF_GRA }, // 5 Sprites - - { "92077-5.u56", 0x080000, 0xfeb83c73, 6 | BRF_SND }, // 6 OKI1 Samples - - { "92077-6.u57", 0x080000, 0x6d133f0d, 7 | BRF_SND }, // 7 OKI2 Samples - - { "8_82s129.u35", 0x000100, 0x4299776e, 0 | BRF_OPT }, // 8 Unused proms - { "9_82s135.u72", 0x000100, 0x633ab1c9, 0 | BRF_OPT }, // 9 - { "10_82s123.u96", 0x000020, 0xc60103c8, 0 | BRF_OPT }, // 10 -}; - -STDROMPICKEXT(gunnail, gunnail, nmk004) -STD_ROM_FN(gunnail) - -static INT32 GunnailLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x200000); - - if (BurnLoadRom(DrvSndROM0 + 0x020000, 6, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x020000, 7, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x20000, 0x20000); - - decode_gfx(0x100000, 0x200000); - DrvGfxDecode(0x20000, 0x100000, 0x200000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c7ff, MAP_WRITE); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09cfff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09d000, 0x09dfff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, macross_main_write_word); - SekSetWriteByteHandler(0, macross_main_write_byte); - SekSetReadWordHandler(0, macross_main_read_word); - SekSetReadByteHandler(0, macross_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 GunnailInit() -{ - GunnailMode = 1; - return NMK004Init(GunnailLoadCallback, 12000000); -} - -struct BurnDriver BurnDrvGunnail = { - "gunnail", NULL, "nmk004", NULL, "1993", - "GunNail (28th May. 1992)\0", NULL, "NMK / Tecmo", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, gunnailRomInfo, gunnailRomName, NULL, NULL, GunnailInputInfo, GunnailDIPInfo, - GunnailInit, NMK004Exit, NMK004Frame, GunnailDraw, DrvScan, NULL, 0x400, - 224, 384, 3, 4 -}; - - -// Black Heart - -static struct BurnRomInfo blkheartRomDesc[] = { - { "blkhrt.7", 0x020000, 0x5bd248c0, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "blkhrt.6", 0x020000, 0x6449e50d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "4.bin", 0x010000, 0x7cefa295, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "3.bin", 0x020000, 0xa1ab3a16, 3 | BRF_GRA }, // 3 Characters - - { "90068-5.bin", 0x100000, 0xa1ab4f24, 4 | BRF_GRA }, // 4 Tiles - - { "90068-8.bin", 0x100000, 0x9d3204b2, 5 | BRF_GRA }, // 5 Sprites - - { "90068-2.bin", 0x080000, 0x3a583184, 6 | BRF_SND }, // 6 OKI1 Samples - - { "90068-1.bin", 0x080000, 0xe7af69d2, 7 | BRF_SND }, // 7 OKI2 Samples - - { "9.bpr", 0x000100, 0x98ed1c97, 0 | BRF_OPT }, // 8 Unused proms - { "10.bpr", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 9 -}; - -STDROMPICKEXT(blkheart, blkheart, nmk004) -STD_ROM_FN(blkheart) - -static INT32 BlkheartLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x100000); - - if (BurnLoadRom(DrvSndROM0 + 0x020000, 6, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x020000, 7, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x20000, 0x20000); - - - DrvGfxDecode(0x20000, 0x100000, 0x100000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_WRITE); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_ROM); - SekSetWriteWordHandler(0, macross_main_write_word); - SekSetWriteByteHandler(0, macross_main_write_byte); - SekSetReadWordHandler(0, macross_main_read_word); - SekSetReadByteHandler(0, macross_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 BlkheartInit() -{ - return NMK004Init(BlkheartLoadCallback, 8000000); -} - -struct BurnDriver BurnDrvBlkheart = { - "blkheart", NULL, "nmk004", NULL, "1991", - "Black Heart\0", NULL, "UPL", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, blkheartRomInfo, blkheartRomName, NULL, NULL, CommonInputInfo, BlkheartDIPInfo, - BlkheartInit, NMK004Exit, NMK004Frame, MacrossDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Black Heart (Japan) - -static struct BurnRomInfo blkheartjRomDesc[] = { - { "7.bin", 0x020000, 0xe0a5c667, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "6.bin", 0x020000, 0x7cce45e8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "4.bin", 0x010000, 0x7cefa295, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "3.bin", 0x020000, 0xa1ab3a16, 3 | BRF_GRA }, // 3 Characters - - { "90068-5.bin", 0x100000, 0xa1ab4f24, 4 | BRF_GRA }, // 4 Tiles - - { "90068-8.bin", 0x100000, 0x9d3204b2, 5 | BRF_GRA }, // 5 Sprites - - { "90068-2.bin", 0x080000, 0x3a583184, 6 | BRF_SND }, // 6 OKI1 Samples - - { "90068-1.bin", 0x080000, 0xe7af69d2, 7 | BRF_SND }, // 7 OKI2 Samples - - { "9.bpr", 0x000100, 0x98ed1c97, 0 | BRF_OPT }, // 8 Unused proms - { "10.bpr", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 9 -}; - -STDROMPICKEXT(blkheartj, blkheartj, nmk004) -STD_ROM_FN(blkheartj) - -struct BurnDriver BurnDrvBlkheartj = { - "blkheartj", "blkheart", "nmk004", NULL, "1991", - "Black Heart (Japan)\0", NULL, "UPL", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, blkheartjRomInfo, blkheartjRomName, NULL, NULL, CommonInputInfo, BlkheartDIPInfo, - BlkheartInit, NMK004Exit, NMK004Frame, MacrossDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Vandyke (Japan) - -static struct BurnRomInfo vandykeRomDesc[] = { - { "vdk-1.16", 0x020000, 0xc1d01c59, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "vdk-2.15", 0x020000, 0x9d741cc2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "vdk-4.127", 0x010000, 0xeba544f0, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "vdk-3.222", 0x010000, 0x5a547c1b, 3 | BRF_GRA }, // 3 Characters - - { "vdk-01.13", 0x080000, 0x195a24be, 4 | BRF_GRA }, // 4 Tiles - - { "vdk-07.202", 0x080000, 0x42d41f06, 5 | BRF_GRA }, // 5 Sprites - { "vdk-06.203", 0x080000, 0xd54722a8, 5 | BRF_GRA }, // 6 - { "vdk-04.2-1", 0x080000, 0x0a730547, 5 | BRF_GRA }, // 7 - { "vdk-05.3-1", 0x080000, 0xba456d27, 5 | BRF_GRA }, // 8 - - { "vdk-02.126", 0x080000, 0xb2103274, 6 | BRF_SND }, // 9 OKI1 Samples - - { "vdk-03.165", 0x080000, 0x631776d3, 7 | BRF_SND }, // 10 OKI2 Samples - - { "ic100.bpr", 0x000100, 0x98ed1c97, 0 | BRF_OPT }, // 11 Unused proms - { "ic101.bpr", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 12 -}; - -STDROMPICKEXT(vandyke, vandyke, nmk004) -STD_ROM_FN(vandyke) - -static INT32 VandykeLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100001, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x020000, 9, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x020000, 10, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x20000, 0x20000); - - DrvGfxDecode(0x10000, 0x80000, 0x200000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c007, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvBgRAM1, 0x094000, 0x097fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09d000, 0x09d7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, macross_main_write_word); - SekSetWriteByteHandler(0, macross_main_write_byte); - SekSetReadWordHandler(0, macross_main_read_word); - SekSetReadByteHandler(0, macross_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 VandykeInit() -{ - return NMK004Init(VandykeLoadCallback, 10000000); -} - -struct BurnDriver BurnDrvVandyke = { - "vandyke", NULL, "nmk004", NULL, "1990", - "Vandyke (Japan)\0", NULL, "UPL", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, vandykeRomInfo, vandykeRomName, NULL, NULL, CommonInputInfo, VandykeDIPInfo, - VandykeInit, NMK004Exit, NMK004Frame, VandykeDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// Vandyke (Jaleco, Set 1) - -static struct BurnRomInfo vandykejalRomDesc[] = { - { "vdk-1.16", 0x020000, 0xc1d01c59, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "jaleco2.15", 0x020000, 0x170e4d2e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "vdk-4.127", 0x010000, 0xeba544f0, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "vdk-3.222", 0x010000, 0x5a547c1b, 3 | BRF_GRA }, // 3 Characters - - { "vdk-01.13", 0x080000, 0x195a24be, 4 | BRF_GRA }, // 4 Tiles - - { "vdk-07.202", 0x080000, 0x42d41f06, 5 | BRF_GRA }, // 5 Sprites - { "vdk-06.203", 0x080000, 0xd54722a8, 5 | BRF_GRA }, // 6 - { "vdk-04.2-1", 0x080000, 0x0a730547, 5 | BRF_GRA }, // 7 - { "vdk-05.3-1", 0x080000, 0xba456d27, 5 | BRF_GRA }, // 8 - - { "vdk-02.126", 0x080000, 0xb2103274, 6 | BRF_SND }, // 9 OKI1 Samples - - { "vdk-03.165", 0x080000, 0x631776d3, 7 | BRF_SND }, // 10 OKI2 Samples - - { "ic100.bpr", 0x000100, 0x98ed1c97, 0 | BRF_OPT }, // 11 Unused proms - { "ic101.bpr", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 12 -}; - -STDROMPICKEXT(vandykejal, vandykejal, nmk004) -STD_ROM_FN(vandykejal) - -struct BurnDriver BurnDrvVandykejal = { - "vandykejal", "vandyke", "nmk004", NULL, "1990", - "Vandyke (Jaleco, Set 1)\0", NULL, "UPL (Jaleco license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, vandykejalRomInfo, vandykejalRomName, NULL, NULL, CommonInputInfo, VandykeDIPInfo, - VandykeInit, NMK004Exit, NMK004Frame, VandykeDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// Vandyke (Jaleco, Set 2) - -static struct BurnRomInfo vandykejal2RomDesc[] = { - { "vdk-even.16", 0x020000, 0xcde05a84, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "vdk-odd.15", 0x020000, 0x0f6fea40, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "vdk-4.127", 0x010000, 0xeba544f0, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "vdk-3.222", 0x010000, 0x5a547c1b, 3 | BRF_GRA }, // 3 Characters - - { "vdk-01.13", 0x080000, 0x195a24be, 4 | BRF_GRA }, // 4 Tiles - - { "vdk-07.202", 0x080000, 0x42d41f06, 5 | BRF_GRA }, // 5 Sprites - { "vdk-06.203", 0x080000, 0xd54722a8, 5 | BRF_GRA }, // 6 - { "vdk-04.2-1", 0x080000, 0x0a730547, 5 | BRF_GRA }, // 7 - { "vdk-05.3-1", 0x080000, 0xba456d27, 5 | BRF_GRA }, // 8 - - { "vdk-02.126", 0x080000, 0xb2103274, 6 | BRF_SND }, // 9 OKI1 Samples - - { "vdk-03.165", 0x080000, 0x631776d3, 7 | BRF_SND }, // 10 OKI2 Samples - - { "ic100.bpr", 0x000100, 0x98ed1c97, 0 | BRF_OPT }, // 11 Unused proms - { "ic101.bpr", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 12 -}; - -STDROMPICKEXT(vandykejal2, vandykejal2, nmk004) -STD_ROM_FN(vandykejal2) - -struct BurnDriver BurnDrvVandykejal2 = { - "vandykejal2", "vandyke", "nmk004", NULL, "1990", - "Vandyke (Jaleco, Set 2)\0", NULL, "UPL (Jaleco license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, vandykejal2RomInfo, vandykejal2RomName, NULL, NULL, CommonInputInfo, VandykeDIPInfo, - VandykeInit, NMK004Exit, NMK004Frame, VandykeDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// Vandyke (bootleg with PIC16c57) - -static struct BurnRomInfo vandykebRomDesc[] = { - { "2.bin", 0x020000, 0x9c269702, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "1.bin", 0x020000, 0xdd6303a1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pic16c57", 0x002d4c, 0xbdb3920d, 2 | BRF_PRG | BRF_ESS }, // 2 PIC16c57 code - - { "3.bin", 0x010000, 0x5a547c1b, 3 | BRF_GRA }, // 3 Characters - - { "4.bin", 0x040000, 0x4ba4138d, 4 | BRF_GRA }, // 4 Tiles - { "5.bin", 0x040000, 0x9a1ac697, 4 | BRF_GRA }, // 5 - - { "13.bin", 0x040000, 0xbb561871, 5 | BRF_GRA }, // 6 Sprites - { "17.bin", 0x040000, 0x346e3b66, 5 | BRF_GRA }, // 7 - { "12.bin", 0x040000, 0xcdef9b17, 5 | BRF_GRA }, // 8 - { "16.bin", 0x040000, 0xbeda678c, 5 | BRF_GRA }, // 9 - { "11.bin", 0x020000, 0x823185d9, 5 | BRF_GRA }, // 10 - { "15.bin", 0x020000, 0x149f3247, 5 | BRF_GRA }, // 11 - { "10.bin", 0x020000, 0x388b1abc, 5 | BRF_GRA }, // 12 - { "14.bin", 0x020000, 0x32eeba37, 5 | BRF_GRA }, // 13 - - { "9.bin", 0x020000, 0x56bf774f, 6 | BRF_SND }, // 14 OKI1 Samples - { "8.bin", 0x020000, 0x89851fcf, 6 | BRF_SND }, // 15 - { "7.bin", 0x020000, 0xd7bf0f6a, 6 | BRF_SND }, // 16 - { "6.bin", 0x020000, 0xa7fcf709, 6 | BRF_SND }, // 17 -}; - -STD_ROM_PICK(vandykeb) -STD_ROM_FN(vandykeb) - -static INT32 VandykebLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - // if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x140000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x140001, 13, 2)) return 1; - - // if (BurnLoadRom(DrvSndROM0 + 0x000000, 14, 1)) return 1; - // if (BurnLoadRom(DrvSndROM0 + 0x020000, 15, 1)) return 1; - // if (BurnLoadRom(DrvSndROM0 + 0x040000, 16, 1)) return 1; - // if (BurnLoadRom(DrvSndROM0 + 0x060000, 17, 1)) return 1; - - DrvGfxDecode(0x10000, 0x80000, 0x200000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); -// SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09d000, 0x09d7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, vandykeb_main_write_word); // different scroll regs - SekSetWriteByteHandler(0, vandykeb_main_write_byte); - SekSetReadWordHandler(0, macross_main_read_word); - SekSetReadByteHandler(0, macross_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 VandykebInit() -{ - input_high[0] = 0x0040; // or it locks up - - return NMK004Init(VandykebLoadCallback, 10000000); -} - -struct BurnDriver BurnDrvVandykeb = { - "vandykeb", "vandyke", NULL, NULL, "1990", - "Vandyke (bootleg with PIC16c57)\0", "No sound", "[UPL] (bootleg)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, vandykebRomInfo, vandykebRomName, NULL, NULL, CommonInputInfo, VandykeDIPInfo, - VandykebInit, NMK004Exit, NMK004Frame, VandykeDraw, DrvScan, NULL, 0x400, - 224, 256, 3, 4 -}; - - -// Hacha Mecha Fighter (19th Sep. 1991) - -static struct BurnRomInfo hachamfRomDesc[] = { - { "7.93", 0x020000, 0x9d847c31, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "6.94", 0x020000, 0xde6408a0, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.70", 0x010000, 0x9e6f48fc, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "5.95", 0x020000, 0x29fb04a2, 3 | BRF_GRA }, // 3 Characters - - { "91076-4.101", 0x100000, 0xdf9653a4, 4 | BRF_GRA }, // 4 Tiles - - { "91076-8.57", 0x100000, 0x7fd0f556, 5 | BRF_GRA }, // 5 Sprites - - { "91076-2.46", 0x080000, 0x3f1e67f2, 6 | BRF_SND }, // 6 OKI1 Samples - - { "91076-3.45", 0x080000, 0xb25ed93b, 7 | BRF_SND }, // 7 OKI2 Samples -}; - -STDROMPICKEXT(hachamf, hachamf, nmk004) -STD_ROM_FN(hachamf) - -static INT32 HachamfLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x100000); - - if (BurnLoadRom(DrvSndROM0 + 0x020000, 6, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x020000, 7, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x20000, 0x20000); - - DrvGfxDecode(0x20000, 0x100000, 0x100000); - } - - { - *((UINT16*)(Drv68KROM + 0x048a)) = 0x4e71; - *((UINT16*)(Drv68KROM + 0x04aa)) = 0x4e71; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_WRITE); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, hachamf_main_write_word); - SekSetWriteByteHandler(0, hachamf_main_write_byte); - SekSetReadWordHandler(0, hachamf_main_read_word); - SekSetReadByteHandler(0, hachamf_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 HachamfInit() -{ - return NMK004Init(HachamfLoadCallback, 10000000); -} - -struct BurnDriver BurnDrvHachamf = { - "hachamf", NULL, "nmk004", NULL, "1991", - "Hacha Mecha Fighter (19th Sep. 1991)\0", "Use the unprotected bootleg, instead!", "NMK", "NMK16", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, hachamfRomInfo, hachamfRomName, NULL, NULL, CommonInputInfo, HachamfDIPInfo, - HachamfInit, NMK004Exit, NMK004Frame, HachamfDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Hacha Mecha Fighter (19th Sep. 1991, unprotected, bootleg Thunder Dragon conversion) - -static struct BurnRomInfo hachamfbRomDesc[] = { - { "8.bin", 0x020000, 0x14845B65, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "7.bin", 0x020000, 0x069CA579, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.70", 0x010000, 0x9e6f48fc, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "5.95", 0x020000, 0x29fb04a2, 3 | BRF_GRA }, // 3 Characters - - { "91076-4.101", 0x100000, 0xdf9653a4, 4 | BRF_GRA }, // 4 Tiles - - { "91076-8.57", 0x100000, 0x7fd0f556, 5 | BRF_GRA }, // 5 Sprites - - { "91076-2.46", 0x080000, 0x3f1e67f2, 6 | BRF_SND }, // 6 OKI1 Samples - - { "91076-3.45", 0x080000, 0xb25ed93b, 7 | BRF_SND }, // 7 OKI2 Samples -}; - -STDROMPICKEXT(hachamfb, hachamfb, nmk004) -STD_ROM_FN(hachamfb) - -static INT32 HachamfbLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x100000); - - if (BurnLoadRom(DrvSndROM0 + 0x020000, 6, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x020000, 7, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x20000, 0x20000); - - DrvGfxDecode(0x20000, 0x100000, 0x100000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_WRITE); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, hachamf_main_write_word); - SekSetWriteByteHandler(0, hachamf_main_write_byte); - SekSetReadWordHandler(0, hachamf_main_read_word); - SekSetReadByteHandler(0, hachamf_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 HachamfbInit() -{ - return NMK004Init(HachamfbLoadCallback, 10000000); -} - -struct BurnDriver BurnDrvHachamfb = { - "hachamfb", "hachamf", "nmk004", NULL, "1991", - "Hacha Mecha Fighter (19th Sep. 1991, unprotected, bootleg Thunder Dragon conversion)\0", NULL, "bootleg", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, hachamfbRomInfo, hachamfbRomName, NULL, NULL, CommonInputInfo, HachamfbDIPInfo, - HachamfbInit, NMK004Exit, NMK004Frame, HachamfDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Koutetsu Yousai Strahl (Japan set 1) - -static struct BurnRomInfo strahlRomDesc[] = { - { "strahl-2.82", 0x020000, 0xc9d008ae, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "strahl-1.83", 0x020000, 0xafc3c4d6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "strahl-4.66", 0x010000, 0x60a799c4, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "strahl-3.73", 0x010000, 0x2273b33e, 3 | BRF_GRA }, // 3 Characters - - { "str7b2r0.275", 0x040000, 0x5769e3e1, 4 | BRF_GRA }, // 4 Tiles - - { "strl3-01.32", 0x080000, 0xd8337f15, 5 | BRF_GRA }, // 5 Sprites - { "strl4-02.57", 0x080000, 0x2a38552b, 5 | BRF_GRA }, // 6 - { "strl5-03.58", 0x080000, 0xa0e7d210, 5 | BRF_GRA }, // 7 - - { "str6b1w1.776", 0x080000, 0xbb1bb155, 9 | BRF_GRA }, // 8 Foreground Tiles - - { "str8pmw1.540", 0x080000, 0x01d6bb6a, 6 | BRF_SND }, // 9 OKI1 Samples - - { "str9pew1.639", 0x080000, 0x6bb3eb9f, 7 | BRF_SND }, // 10 OKI2 Samples -}; - -STDROMPICKEXT(strahl, strahl, nmk004) -STD_ROM_FN(strahl) - -static INT32 StrahlLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x080000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 8, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x100000, 9, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x100000, 0x20000); - memcpy (DrvSndROM0 + 0x080000, DrvSndROM0 + 0x120000, 0x20000); - memcpy (DrvSndROM0 + 0x060000, DrvSndROM0 + 0x140000, 0x20000); - memcpy (DrvSndROM0 + 0x040000, DrvSndROM0 + 0x160000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x100000, 10, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x100000, 0x20000); - memcpy (DrvSndROM1 + 0x080000, DrvSndROM1 + 0x120000, 0x20000); - memcpy (DrvSndROM1 + 0x060000, DrvSndROM1 + 0x140000, 0x20000); - memcpy (DrvSndROM1 + 0x040000, DrvSndROM1 + 0x160000, 0x20000); - - DrvGfxDecode(0x10000, 0x100000, 0x200000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvScrollRAM, 0x084000, 0x0843ff, MAP_WRITE); - SekMapMemory(DrvScrollRAM + 0x400, 0x088000, 0x0883ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x08c000, 0x08c7ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvBgRAM1, 0x094000, 0x097fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, macross_main_write_word); - SekSetWriteByteHandler(0, macross_main_write_byte); - SekSetReadWordHandler(0, macross_main_read_word); - SekSetReadByteHandler(0, macross_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 StrahlInit() -{ - return NMK004Init(StrahlLoadCallback, 12000000); -} - -struct BurnDriver BurnDrvStrahl = { - "strahl", NULL, "nmk004", NULL, "1992", - "Koutetsu Yousai Strahl (Japan set 1)\0", NULL, "UPL", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, strahlRomInfo, strahlRomName, NULL, NULL, CommonInputInfo, StrahlDIPInfo, - StrahlInit, NMK004Exit, NMK004Frame, StrahlDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Koutetsu Yousai Strahl (Japan set 2) - -static struct BurnRomInfo strahlaRomDesc[] = { - { "rom2", 0x020000, 0xf80a22ef, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "rom1", 0x020000, 0x802ecbfc, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "strahl-4.66", 0x010000, 0x60a799c4, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "strahl-3.73", 0x010000, 0x2273b33e, 3 | BRF_GRA }, // 3 Characters - - { "str7b2r0.275", 0x040000, 0x5769e3e1, 4 | BRF_GRA }, // 4 Tiles - - { "strl3-01.32", 0x080000, 0xd8337f15, 5 | BRF_GRA }, // 5 Sprites - { "strl4-02.57", 0x080000, 0x2a38552b, 5 | BRF_GRA }, // 6 - { "strl5-03.58", 0x080000, 0xa0e7d210, 5 | BRF_GRA }, // 7 - - { "str6b1w1.776", 0x080000, 0xbb1bb155, 9 | BRF_GRA }, // 8 Foreground tiles - - { "str8pmw1.540", 0x080000, 0x01d6bb6a, 6 | BRF_SND }, // 9 OKI1 Samples - - { "str9pew1.639", 0x080000, 0x6bb3eb9f, 7 | BRF_SND }, // 10 OKI2 Samples -}; - -STDROMPICKEXT(strahla, strahla, nmk004) -STD_ROM_FN(strahla) - -struct BurnDriver BurnDrvStrahla = { - "strahla", "strahl", "nmk004", NULL, "1992", - "Koutetsu Yousai Strahl (Japan set 2)\0", NULL, "UPL", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, strahlaRomInfo, strahlaRomName, NULL, NULL, CommonInputInfo, StrahlDIPInfo, - StrahlInit, NMK004Exit, NMK004Frame, StrahlDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Bio-ship Paladin - -static struct BurnRomInfo bioshipRomDesc[] = { - { "2.ic14", 0x020000, 0xacf56afb, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "1.ic15", 0x020000, 0x820ef303, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "6.ic120", 0x010000, 0x5f39a980, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "7", 0x010000, 0x2f3f5a10, 3 | BRF_GRA }, // 3 Characters - - { "sbs-g_01.ic9", 0x080000, 0x21302e78, 4 | BRF_GRA }, // 4 Tiles - - { "sbs-g_03.ic194", 0x080000, 0x60e00d7b, 5 | BRF_GRA }, // 5 Sprites - - { "sbs-g_02.ic4", 0x080000, 0xf31eb668, 9 | BRF_GRA }, // 6 Foreground tiles - - { "8.ic27", 0x010000, 0x75a46fea, 10 | BRF_GRA }, // 7 Tilemap roms - { "9.ic26", 0x010000, 0xd91448ee, 10 | BRF_GRA }, // 8 - - { "sbs-g_04.ic139", 0x080000, 0x7c74cc4e, 6 | BRF_SND }, // 9 OKI1 Samples - - { "sbs-g_05.ic160", 0x080000, 0xf0a782e3, 7 | BRF_SND }, // 10 OKI2 Samples - - { "82s135.ic94", 0x000100, 0x98ed1c97, 0 | BRF_OPT }, // 11 Unused proms - { "82s129.ic69", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 12 - { "82s123.ic154", 0x000020, 0x0f789fc7, 0 | BRF_OPT }, // 13 -}; - -STDROMPICKEXT(bioship, bioship, nmk004) -STD_ROM_FN(bioship) - -static INT32 BioshipLoadCallback() -{ - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 6, 1)) return 1; - - if (BurnLoadRom(DrvTileROM + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvTileROM + 0x000000, 8, 2)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x020000, 9, 1)) return 1; - memcpy (DrvSndROM0 + 0x000000, DrvSndROM0 + 0x20000, 0x20000); - - if (BurnLoadRom(DrvSndROM1 + 0x020000, 10, 1)) return 1; - memcpy (DrvSndROM1 + 0x000000, DrvSndROM1 + 0x20000, 0x20000); - - DrvGfxDecode(0x10000, 0x100000, 0x80000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0887ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x08c000, 0x08c3ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x090000, 0x093fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x09c000, 0x09c7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0f0000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, macross_main_write_word); - SekSetWriteByteHandler(0, macross_main_write_byte); - SekSetReadWordHandler(0, macross_main_read_word); - SekSetReadByteHandler(0, macross_main_read_byte); - SekClose(); - - return 0; -} - -static INT32 BioshipInit() -{ - return NMK004Init(BioshipLoadCallback, 10000000); -} - -struct BurnDriver BurnDrvBioship = { - "bioship", NULL, "nmk004", NULL, "1990", - "Bio-ship Paladin\0", NULL, "UPL (American Sammy license)", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, bioshipRomInfo, bioshipRomName, NULL, NULL, CommonInputInfo, BioshipDIPInfo, - BioshipInit, NMK004Exit, NMK004Frame, BioshipDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Space Battle Ship Gomorrah - -static struct BurnRomInfo sbsgomoRomDesc[] = { - { "11.ic14", 0x020000, 0x7916150b, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "10.ic15", 0x020000, 0x1d7accb8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "6.ic120", 0x010000, 0x5f39a980, 2 | BRF_PRG | BRF_ESS }, // 2 NMK004 data - - { "7.ic46", 0x010000, 0xf2b77f80, 3 | BRF_GRA }, // 3 Characters - - { "sbs-g_01.ic9", 0x080000, 0x21302e78, 4 | BRF_GRA }, // 4 Tiles - - { "sbs-g_03.ic194", 0x080000, 0x60e00d7b, 5 | BRF_GRA }, // 5 Sprites - - { "sbs-g_02.ic4", 0x080000, 0xf31eb668, 9 | BRF_GRA }, // 6 Foreground tiles - - { "8.ic27", 0x010000, 0x75a46fea, 10 | BRF_GRA }, // 7 Tilemap roms - { "9.ic26", 0x010000, 0xd91448ee, 10 | BRF_GRA }, // 8 - - { "sbs-g_04.ic139", 0x080000, 0x7c74cc4e, 6 | BRF_SND }, // 9 OKI1 Samples - - { "sbs-g_05.ic160", 0x080000, 0xf0a782e3, 7 | BRF_SND }, // 10 OKI2 Samples - - { "82s135.ic94", 0x000100, 0x98ed1c97, 0 | BRF_OPT }, // 11 Unused proms - { "82s129.ic69", 0x000100, 0xcfdbb86c, 0 | BRF_OPT }, // 12 - { "82s123.ic154", 0x000020, 0x0f789fc7, 0 | BRF_OPT }, // 13 -}; - -STDROMPICKEXT(sbsgomo, sbsgomo, nmk004) -STD_ROM_FN(sbsgomo) - -struct BurnDriver BurnDrvSbsgomo = { - "sbsgomo", "bioship", "nmk004", NULL, "1990", - "Space Battle Ship Gomorrah\0", NULL, "UPL", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_HORSHOOT, 0, - NULL, sbsgomoRomInfo, sbsgomoRomName, NULL, NULL, CommonInputInfo, BioshipDIPInfo, - BioshipInit, NMK004Exit, NMK004Frame, BioshipDraw, DrvScan, NULL, 0x400, - 256, 224, 4, 3 -}; - - -// Rapid Hero - -static struct BurnRomInfo rapheroRomDesc[] = { - { "rhp94099.3", 0x080000, 0xec9b4f05, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - - { "rhp94099.2", 0x020000, 0xfe01ece1, 2 | BRF_PRG | BRF_ESS }, // 1 Tmp90c841 Code - - { "rhp94099.1", 0x020000, 0x55a7a011, 3 | BRF_GRA }, // 2 Characters - - { "rhp94099.4", 0x200000, 0x076eee7b, 4 | BRF_GRA }, // 3 Tiles - - { "rhp94099.8", 0x200000, 0x49892f07, 5 | BRF_GRA }, // 4 Sprites - { "rhp94099.9", 0x200000, 0xea2e47f0, 5 | BRF_GRA }, // 5 - { "rhp94099.10", 0x200000, 0x512cb839, 5 | BRF_GRA }, // 6 - - { "rhp94099.6", 0x200000, 0xf1a80e5a, 7 | BRF_SND }, // 7 OKI1 Samples - { "rhp94099.7", 0x200000, 0x0d99547e, 7 | BRF_SND }, // 8 - - { "rhp94099.5", 0x200000, 0x515eba93, 7 | BRF_SND }, // 9 OKI2 Samples - { "rhp94099.6", 0x200000, 0xf1a80e5a, 7 | BRF_SND }, // 10 - - { "prom1.u19", 0x000100, 0x4299776e, 0 | BRF_OPT }, // 11 Unused proms - { "prom2.u53", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 12 - { "prom3.u60", 0x000100, 0x304f98c6, 0 | BRF_OPT }, // 13 -}; - -STD_ROM_PICK(raphero) -STD_ROM_FN(raphero) - -void __fastcall raphero_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x100014: - case 0x100015: - // *flipscreen = data & 1; - return; - - case 0x100018: - case 0x100019: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x10001e: - case 0x10001f: - // bprintf (0, _T("write soundlatch b\n"), address); - *soundlatch = data; - return; - } -} - -void __fastcall raphero_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x100014: - // *flipscreen = data & 1; - return; - - case 0x100018: - if ((data & 0xff) != 0xff) { - *tilebank = data; - } - return; - - case 0x10001e: - // bprintf (0, _T("write soundlatch w\n"), address); - *soundlatch = data & 0xff; - return; - } -} - -UINT8 __fastcall raphero_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x100000: - case 0x100001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x100002: - case 0x100003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x100008: - case 0x100009: - return DrvDips[0]; - - case 0x10000a: - case 0x10000b: - return DrvDips[1]; - - case 0x10000e: - case 0x10000f: - // bprintf (0, _T("Read soundlatch2 b\n"), address); - return *soundlatch2; - } - - return 0; -} - -UINT16 __fastcall raphero_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x100000: - return DrvInputs[0]; - - case 0x100002: - return DrvInputs[1]; - - case 0x100008: - return DrvDips[0]; - - case 0x10000a: - return DrvDips[1]; - - case 0x10000e: - // bprintf (0, _T("Read soundlatch2 W\n"), address); - return *soundlatch2; - } - - return 0; -} - -static void raphero_sound_bankswitch(INT32 data) -{ - INT32 nBank = ((data & 0x07) * 0x4000) + 0x10000; - - tlcs90MapMemory(DrvZ80ROM + nBank, 0x8000, 0xbfff, MAP_ROM); -} - -static void raphero_sound_write(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - case 0xc001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xc800: - MSM6295Command(0, data); - return; - - case 0xc808: - MSM6295Command(1, data); - return; - - case 0xc810: - case 0xc811: - case 0xc812: - case 0xc813: - case 0xc814: - case 0xc815: - case 0xc816: - case 0xc817: - NMK112_okibank_write(address & 7, data); - return; - - case 0xd000: - raphero_sound_bankswitch(data); - return; - - case 0xd800: - *soundlatch2 = data; - return; - } -} - -static UINT8 raphero_sound_read(UINT32 address) -{ - switch (address) - { - case 0xc000: - case 0xc001: - return BurnYM2203Read(0, address & 1); - - case 0xc800: - return MSM6295ReadStatus(0); - - case 0xc808: - return MSM6295ReadStatus(1); - - case 0xd800: - return *soundlatch; - } - - return 0; -} - -static void RapheroYM2203IrqHandler(INT32, INT32 nStatus) -{ - tlcs90SetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static double RapheroGetTime() -{ - return (double)tlcs90TotalCycles() / 8000000; -} - -inline static INT32 RapheroSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(tlcs90TotalCycles() * nSoundRate / 8000000); -} - -static INT32 RapheroDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - tlcs90Open(0); - tlcs90Reset(); - tlcs90Close(); - - BurnYM2203Reset(); - - MSM6295Reset(0); - MSM6295Reset(1); - - MSM6295SetInitialBanks(2); - - NMK112Reset(); - - return 0; -} - -static INT32 RapheroInit() -{ - BurnSetRefreshRate(56.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 1, 1)) return 1; - memmove (DrvZ80ROM + 0x10000, DrvZ80ROM + 0x00000, 0x20000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400000, 6, 1)) return 1; - BurnByteswap(DrvGfxROM2, 0x600000); - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvSndROM0 + 0x200000, 8, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x200000, 10, 1)) return 1; - - DrvGfxDecode(0x20000, 0x200000, 0x600000); - memset (DrvGfxROM2 + 0xc00000, 0x0f, 0x400000); - nGraphicsMask[2] = 0xffff; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(DrvScrollRAM, 0x130000, 0x1307ff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x140000, 0x143fff, MAP_RAM); - SekMapMemory(DrvBgRAM1, 0x144000, 0x147fff, MAP_RAM); - SekMapMemory(DrvBgRAM2, 0x148000, 0x14bfff, MAP_RAM); - SekMapMemory(DrvBgRAM3, 0x14c000, 0x14ffff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x170000, 0x170fff, MAP_RAM); - SekMapMemory(DrvTxRAM, 0x171000, 0x171fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x1f0000, 0x1fffff, MAP_RAM); - SekSetWriteWordHandler(0, raphero_main_write_word); - SekSetWriteByteHandler(0, raphero_main_write_byte); - SekSetReadWordHandler(0, raphero_main_read_word); - SekSetReadByteHandler(0, raphero_main_read_byte); - SekClose(); - - tlcs90Init(0, 8000000); - tlcs90Open(0); - tlcs90MapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - tlcs90MapMemory(DrvZ80RAM, 0xe000, 0xffff, MAP_RAM); - tlcs90SetWriteHandler(raphero_sound_write); - tlcs90SetReadHandler(raphero_sound_read); - tlcs90Close(); - - BurnYM2203Init(1, 1500000, &RapheroYM2203IrqHandler, RapheroSynchroniseStream, RapheroGetTime, 0); - BurnTimerAttachTlcs90(8000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 1.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.50, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 4000000 / 165, 1); - MSM6295Init(1, 4000000 / 165, 1); - MSM6295SetRoute(0, 0.10, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.10, BURN_SND_ROUTE_BOTH); - - NMK112_init(0, DrvSndROM0, DrvSndROM1, 0x400000, 0x400000); - - NMK112_enabled = 1; - - no_z80 = 1; - - GenericTilesInit(); - - RapheroDoReset(); - - return 0; -} - -static INT32 RapheroExit() -{ - BurnYM2203Exit(); - MSM6295Exit(0); - MSM6295Exit(1); - MSM6295ROM = NULL; - - NMK004_enabled = 0; - NMK112_enabled = 0; - - tlcs90Exit(); - - return CommonExit(); -} - -static INT32 RapheroFrame() -{ - if (DrvReset) { - RapheroDoReset(); - } - - { - DrvInputs[0] = ~0; - DrvInputs[1] = ~0; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - SekNewFrame(); - tlcs90NewFrame(); - - INT32 nSegment; - INT32 nInterleave = 3000; - INT32 nTotalCycles[2] = { 14000000 / 56, 8000000 / 56 }; - - SekOpen(0); - tlcs90Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekRun(nTotalCycles[0] / nInterleave); - - if (i == (nInterleave-16) || i == (nInterleave/2)-16) { // ?? - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - - if (i == (nInterleave-1)) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nSegment = (nTotalCycles[1] / nInterleave) * (i + 1); - BurnTimerUpdate(nSegment); - } - - BurnTimerEndFrame(nTotalCycles[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - tlcs90Close(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - memcpy (DrvSprBuf2, Drv68KRAM + 0x8000, 0x1000); - - return 0; -} - -struct BurnDriver BurnDrvRaphero = { - "raphero", "arcadian", NULL, NULL, "1994", - "Rapid Hero\0", NULL, "Media Trading Corp", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, rapheroRomInfo, rapheroRomName, NULL, NULL, Tdragon2InputInfo, RapheroDIPInfo, - RapheroInit, RapheroExit, RapheroFrame, RapheroDraw, DrvScan, NULL, 0x400, - 224, 384, 3, 4 -}; - -// Arcadia - -static struct BurnRomInfo arcadianRomDesc[] = { - { "arcadia.3", 0x080000, 0x8b46d609, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - - { "rhp94099.2", 0x020000, 0xfe01ece1, 2 | BRF_PRG | BRF_ESS }, // 1 Tmp90c841 Code - - { "arcadia.1", 0x020000, 0x1c2c4008, 3 | BRF_GRA }, // 2 Characters - - { "rhp94099.4", 0x200000, 0x076eee7b, 4 | BRF_GRA }, // 3 Tiles - - { "rhp94099.8", 0x200000, 0x49892f07, 5 | BRF_GRA }, // 4 Sprites - { "rhp94099.9", 0x200000, 0xea2e47f0, 5 | BRF_GRA }, // 5 - { "rhp94099.10", 0x200000, 0x512cb839, 5 | BRF_GRA }, // 6 - - { "rhp94099.6", 0x200000, 0xf1a80e5a, 7 | BRF_SND }, // 7 OKI1 Samples - { "rhp94099.7", 0x200000, 0x0d99547e, 7 | BRF_SND }, // 8 - - { "rhp94099.5", 0x200000, 0x515eba93, 7 | BRF_SND }, // 9 OKI2 Samples - { "rhp94099.6", 0x200000, 0xf1a80e5a, 7 | BRF_SND }, // 10 - - { "prom1.u19", 0x000100, 0x4299776e, 0 | BRF_OPT }, // 11 Unused proms - { "prom2.u53", 0x000100, 0xe6ead349, 0 | BRF_OPT }, // 12 - { "prom3.u60", 0x000100, 0x304f98c6, 0 | BRF_OPT }, // 13 -}; - -STD_ROM_PICK(arcadian) -STD_ROM_FN(arcadian) - -struct BurnDriver BurnDrvArcadian = { - "arcadian", NULL, NULL, NULL, "1994", - "Arcadia (NMK)\0", NULL, "NMK", "NMK16", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, arcadianRomInfo, arcadianRomName, NULL, NULL, Tdragon2InputInfo, RapheroDIPInfo, - RapheroInit, RapheroExit, RapheroFrame, RapheroDraw, DrvScan, NULL, 0x400, - 224, 384, 3, 4 -}; diff --git a/jan/src/burn/drv/pst90s/d_ohmygod.cpp b/jan/src/burn/drv/pst90s/d_ohmygod.cpp deleted file mode 100644 index f2e9ddf44..000000000 --- a/jan/src/burn/drv/pst90s/d_ohmygod.cpp +++ /dev/null @@ -1,697 +0,0 @@ -// FB Alpha Oh My God! driver module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" - -// define this to enable basic unmapped memory reads and writes -#define OHMYGODLOG 1 - -static UINT8 OhmygodInputPort0[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 OhmygodInputPort1[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 OhmygodDip[2] = {0, 0}; -static UINT16 OhmygodInput[2] = {0x00, 0x00}; -static UINT8 OhmygodReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *OhmygodRom = NULL; -static UINT8 *OhmygodRam = NULL; -static UINT8 *OhmygodVideoRam = NULL; -static UINT8 *OhmygodPaletteRam = NULL; -static UINT8 *OhmygodSpriteRam = NULL; -static UINT32 *OhmygodPalette = NULL; - -UINT8 *OhmygodChars; -UINT8 *OhmygodSprites; - -static INT32 AdpcmBankShift; -static INT32 SndBank; -static INT32 watch_tick=0; -static INT32 OhmygodSpriteBank; -static UINT32 OhmygodScrollx; -static UINT32 OhmygodScrolly; - -static struct BurnInputInfo OhmygodInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , OhmygodInputPort0 + 8, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , OhmygodInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , OhmygodInputPort1 + 8, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , OhmygodInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , OhmygodInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , OhmygodInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , OhmygodInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , OhmygodInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , OhmygodInputPort0 + 4, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , OhmygodInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , OhmygodInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , OhmygodInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , OhmygodInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , OhmygodInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &OhmygodReset , "reset" }, - {"Service" , BIT_DIGITAL , OhmygodInputPort1 + 9, "service" }, - {"Diagnostic" , BIT_DIGITAL , OhmygodInputPort0 + 9, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, OhmygodDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, OhmygodDip + 1 , "dip" }, -}; - -STDINPUTINFO(Ohmygod) - -inline void OhmygodClearOpposites(UINT16* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -inline void OhmygodMakeInputs() -{ - // Reset Inputs - OhmygodInput[0] = OhmygodInput[1] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 10; i++) { - OhmygodInput[0] |= (OhmygodInputPort0[i] & 1) << i; - OhmygodInput[1] |= (OhmygodInputPort1[i] & 1) << i; - } - - // Clear Opposites - OhmygodClearOpposites(&OhmygodInput[0]); - OhmygodClearOpposites(&OhmygodInput[1]); -} - -static struct BurnDIPInfo OhmygodDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 15 , "Coin A" }, - {0x11, 0x01, 0x0f, 0x05, "6 Coin-3 Play" }, - {0x11, 0x01, 0x0f, 0x03, "5 Coin-6 Play" }, - {0x11, 0x01, 0x0f, 0x07, "4 Coin-1 Play" }, - {0x11, 0x01, 0x0f, 0x04, "4 Coin-3 Play" }, - {0x11, 0x01, 0x0f, 0x02, "4 Coin-5 Play" }, - {0x11, 0x01, 0x0f, 0x08, "3 Coin-1 Play" }, - {0x11, 0x01, 0x0f, 0x09, "2 Coin-1 Play" }, - {0x11, 0x01, 0x0f, 0x01, "2 Coin-3 Play" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin-1 Play" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin-2 Play" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin-3 Play" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin-4 Play" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin-5 Play" }, - {0x11, 0x01, 0x0f, 0x0a, "1 Coin-6 Play" }, - {0x11, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15 , "Coin B" }, - {0x11, 0x01, 0xf0, 0x50, "6 Coin-3 Play" }, - {0x11, 0x01, 0xf0, 0x30, "5 Coin-6 Play" }, - {0x11, 0x01, 0xf0, 0x70, "4 Coin-1 Play" }, - {0x11, 0x01, 0xf0, 0x40, "4 Coin-3 Play" }, - {0x11, 0x01, 0xf0, 0x20, "4 Coin-5 Play" }, - {0x11, 0x01, 0xf0, 0x80, "3 Coin-1 Play" }, - {0x11, 0x01, 0xf0, 0x90, "2 Coin-1 Play" }, - {0x11, 0x01, 0xf0, 0x10, "2 Coin-3 Play" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin-1 Play" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin-2 Play" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin-3 Play" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coin-4 Play" }, - {0x11, 0x01, 0xf0, 0xb0, "1 Coin-5 Play" }, - {0x11, 0x01, 0xf0, 0xa0, "1 Coin-6 Play" }, - {0x11, 0x01, 0xf0, 0x00, "Free Play" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "1P Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4 , "VS Difficulty" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal Jake" }, - {0x12, 0x01, 0x0c, 0x08, "Hard Jake" }, - {0x12, 0x01, 0x0c, 0x04, "Normal" }, - {0x12, 0x01, 0x0c, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "VS Matches/Credit" }, - {0x12, 0x01, 0x10, 0x00, "1 Game Match" }, - {0x12, 0x01, 0x10, 0x10, "3 Game Match" }, - - {0 , 0xfe, 0 , 2 , "Attract Sound" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Balls Have Eyes" }, - {0x12, 0x01, 0x40, 0x00, "No" }, - {0x12, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ohmygod) - -static struct BurnDIPInfo NanameDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 15 , "Coin A" }, - {0x11, 0x01, 0x0f, 0x05, "6 Coin-3 Play" }, - {0x11, 0x01, 0x0f, 0x03, "5 Coin-6 Play" }, - {0x11, 0x01, 0x0f, 0x07, "4 Coin-1 Play" }, - {0x11, 0x01, 0x0f, 0x04, "4 Coin-3 Play" }, - {0x11, 0x01, 0x0f, 0x02, "4 Coin-5 Play" }, - {0x11, 0x01, 0x0f, 0x08, "3 Coin-1 Play" }, - {0x11, 0x01, 0x0f, 0x09, "2 Coin-1 Play" }, - {0x11, 0x01, 0x0f, 0x01, "2 Coin-3 Play" }, - {0x11, 0x01, 0x0f, 0x0f, "1 Coin-1 Play" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin-2 Play" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin-3 Play" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin-4 Play" }, - {0x11, 0x01, 0x0f, 0x0b, "1 Coin-5 Play" }, - {0x11, 0x01, 0x0f, 0x0a, "1 Coin-6 Play" }, - {0x11, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 15 , "Coin B" }, - {0x11, 0x01, 0xf0, 0x50, "6 Coin-3 Play" }, - {0x11, 0x01, 0xf0, 0x30, "5 Coin-6 Play" }, - {0x11, 0x01, 0xf0, 0x70, "4 Coin-1 Play" }, - {0x11, 0x01, 0xf0, 0x40, "4 Coin-3 Play" }, - {0x11, 0x01, 0xf0, 0x20, "4 Coin-5 Play" }, - {0x11, 0x01, 0xf0, 0x80, "3 Coin-1 Play" }, - {0x11, 0x01, 0xf0, 0x90, "2 Coin-1 Play" }, - {0x11, 0x01, 0xf0, 0x10, "2 Coin-3 Play" }, - {0x11, 0x01, 0xf0, 0xf0, "1 Coin-1 Play" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin-2 Play" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin-3 Play" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coin-4 Play" }, - {0x11, 0x01, 0xf0, 0xb0, "1 Coin-5 Play" }, - {0x11, 0x01, 0xf0, 0xa0, "1 Coin-6 Play" }, - {0x11, 0x01, 0xf0, 0x00, "Free Play" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "1P Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4 , "VS Difficulty" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal Jake" }, - {0x12, 0x01, 0x0c, 0x08, "Hard Jake" }, - {0x12, 0x01, 0x0c, 0x04, "Normal" }, - {0x12, 0x01, 0x0c, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "VS Matches/Credit" }, - {0x12, 0x01, 0x10, 0x00, "1 Game Match" }, - {0x12, 0x01, 0x10, 0x10, "3 Game Match" }, - - {0 , 0xfe, 0 , 2 , "Attract Sound" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Balls Have Eyes" }, - {0x12, 0x01, 0x40, 0x00, "No" }, - {0x12, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Naname) - -static struct BurnRomInfo OhmygodRomDesc[] = { - { "omg-p.114", 0x080000, 0x48fa40ca, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - - { "omg-b.117", 0x080000, 0x73621fa6, BRF_GRA }, // 1 Characters - { "omg-s.120", 0x080000, 0x6413bd36, BRF_GRA }, // 2 Sprites - - { "omg-g.107", 0x200000, 0x7405573c, BRF_SND }, // 3 Samples -}; - - -STD_ROM_PICK(Ohmygod) -STD_ROM_FN(Ohmygod) - -static struct BurnRomInfo NanameRomDesc[] = { - { "036-prg.114", 0x080000, 0x3b7362f7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - - { "036-bg.117", 0x080000, 0xf53e8da5, BRF_GRA }, // 1 Characters - { "036-spr.120", 0x080000, 0xe36d8731, BRF_GRA }, // 2 Sprites - - { "036-snd.107", 0x200000, 0xa3e0caf4, BRF_SND }, // 3 Samples -}; - - -STD_ROM_PICK(Naname) -STD_ROM_FN(Naname) - -INT32 OhmygodDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - watch_tick=3*60; - - // Set the initial MSM6295 Bank - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "ohmygod")) { - AdpcmBankShift = 4; - } else { - AdpcmBankShift = 0; - } - - OhmygodSpriteBank = 0; - - SndBank = 0; - memcpy(MSM6295ROM + 0x20000, MSM6295ROM + 0x40000 + 0x20000 * SndBank, 0x20000); - - MSM6295Reset(0); - - return 0; -} - - -void do_watchtick() -{ - if (watch_tick > 0) - if (--watch_tick == 0) { - SekOpen(0); - SekReset(); - SekClose(); - watch_tick=3*60; - } -} - -UINT16 __fastcall OhmygodReadWord(UINT32 a) -{ - switch (a) { - case 0x800000: { - return 0xffff - OhmygodInput[0]; - } - - case 0x800002: { - return 0xffff - OhmygodInput[1]; - } - - case 0xb00000: { - return 0xfff0 | MSM6295ReadStatus(0); - } - - case 0xc00000: { - watch_tick= 3 * 60; - return 0xffff; - } - } - -#ifdef OHMYGODLOG - bprintf(PRINT_NORMAL, _T("68000 Read Word: %06X\n"), a); -#endif - SEK_DEF_READ_WORD(0, a); -} - -UINT8 __fastcall OhmygodReadByte(UINT32 a) -{ - switch (a) { - case 0xa00000: { - return OhmygodDip[0]; - } - - case 0xa00001: { - return 0xff; - } - - case 0xa00002: { - return OhmygodDip[1]; - } - - case 0xa00003: { - return 0xff; - } - } - -#ifdef OHMYGODLOG - bprintf(PRINT_NORMAL, _T("68000 Read Byte: %06X\n"), a); -#endif - - return 0; -} - -void __fastcall OhmygodWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x400000: { - OhmygodScrollx = d - 0x81ec; - return; - } - - case 0x400002: { - OhmygodScrolly = d - 0x81ef; - return; - } - - case 0x900000: { - SEK_DEF_WRITE_WORD(0, a, d); - return; - } - - case 0xb00000: { - SEK_DEF_WRITE_WORD(0, a, d); - return; - } - - case 0xd00000: { - OhmygodSpriteBank = d & 0x8000; - return; - } - } - -#ifdef OHMYGODLOG - bprintf(PRINT_NORMAL, _T("68000 Write Word: %06X, %04X\n"), a, d); -#endif -} - -void __fastcall OhmygodWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x710000 && a <= 0x713fff) { - return; - } - - switch (a) { - case 0x900000: { - return; - } - - case 0x900001: { - if (SndBank != ((d >> AdpcmBankShift) & 0x0f)) { - SndBank = (d >> AdpcmBankShift) & 0x0f; - memcpy(MSM6295ROM + 0x20000,MSM6295ROM + 0x40000 + 0x20000 * SndBank,0x20000); - } - return; - } - - case 0xb00000: { - return; - } - - case 0xb00001: { - MSM6295Command(0, d); - return; - } - } - -#ifdef OHMYGODLOG - bprintf(PRINT_NORMAL, _T("68000 Write Byte: %06X, %02X\n"), a, d); -#endif -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - OhmygodRom = Next; Next += 0x080000; - MSM6295ROM = Next; Next += 0x240000; - - RamStart = Next; - - OhmygodRam = Next; Next += 0x018000; - OhmygodVideoRam = Next; Next += 0x004000; - OhmygodPaletteRam = Next; Next += 0x000800; - OhmygodSpriteRam = Next; Next += 0x004000; - - RamEnd = Next; - - OhmygodChars = Next; Next += (16384 * 8 * 8); - OhmygodSprites = Next; Next += (4096 * 16 * 16); - OhmygodPalette = (UINT32*)Next; Next += 0x000800 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 TilePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TileXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 TileYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 SpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 SpriteXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60 }; -static INT32 SpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; - -INT32 OhmygodInit() -{ - INT32 nRet = 0, nLen; - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - // Load 68000 Program Rom - nRet = BurnLoadRom(OhmygodRom, 0x00, 1); if (nRet != 0) return 1; - - // malloc stuff - UINT8 *TempGfx=(UINT8*)BurnMalloc(0x80000); - - // Load and decode Character Rom - nRet = BurnLoadRom(TempGfx, 1, 1); if (nRet != 0) return 1; - GfxDecode(16384, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, TempGfx, OhmygodChars); - - // Load and decode Sprite Rom - memset(TempGfx, 0, 0x80000); - nRet = BurnLoadRom(TempGfx, 2, 1); if (nRet != 0) return 1; - GfxDecode(4096, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x400, TempGfx, OhmygodSprites); - BurnFree(TempGfx); - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x40000, 3, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(OhmygodRom , 0x000000, 0x07ffff, MAP_ROM ); - SekMapMemory(OhmygodRam + 0x000000, 0x300000, 0x303fff, MAP_RAM ); - SekMapMemory(OhmygodVideoRam , 0x304000, 0x307fff, MAP_RAM ); - SekMapMemory(OhmygodRam + 0x004000, 0x308000, 0x30ffff, MAP_RAM ); - SekMapMemory(OhmygodPaletteRam , 0x600000, 0x607fff, MAP_WRITE); - SekMapMemory(OhmygodSpriteRam , 0x700000, 0x703fff, MAP_RAM ); - SekMapMemory(OhmygodRam + 0x00c000, 0x704000, 0x707fff, MAP_RAM ); - SekMapMemory(OhmygodRam + 0x010000, 0x708000, 0x70ffff, MAP_RAM ); - SekSetReadWordHandler(0, OhmygodReadWord); - SekSetWriteWordHandler(0, OhmygodWriteWord); - SekSetReadByteHandler(0, OhmygodReadByte); - SekSetWriteByteHandler(0, OhmygodWriteByte); - SekClose(); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 14000000/8/132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - OhmygodDoReset(); - - return 0; -} - -INT32 OhmygodExit() -{ - MSM6295Exit(0); - SekExit(); - GenericTilesExit(); - - BurnFree(Mem); - - return 0; -} - -void OhmygodRenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Code = (OhmygodVideoRam[2 * TileIndex + 3] << 8) | OhmygodVideoRam[2 * TileIndex + 2]; - Colour = (OhmygodVideoRam[2 * TileIndex + 1] << 8) | OhmygodVideoRam[2 * TileIndex + 0]; - Colour = (Colour & 0x0f00) >> 8; - x = 8 * mx; - y = 8 * my; - - x -= OhmygodScrollx + 97; - y -= OhmygodScrolly; - - if (x > 7 && x < 312 && y > 7 && y < 232) { - Render8x8Tile(pTransDraw, Code, x, y, Colour, 4, 0, OhmygodChars); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0, OhmygodChars); - } - - TileIndex +=2 ; - } - } -} - -void OhmygodRenderSpriteLayer() -{ - INT32 MemOffset = OhmygodSpriteBank ? 0x2000 : 0x0000; - - for (INT32 Offs = MemOffset; Offs < MemOffset + 0x2000; Offs += 8) { - INT32 sx, sy, Code, Colour, Flipx; - - Code = ((OhmygodSpriteRam[Offs + 7] << 8) + OhmygodSpriteRam[Offs + 6]) & 0x0fff; - Colour = ((OhmygodSpriteRam[Offs + 5] << 8) + OhmygodSpriteRam[Offs + 4]) & 0x000f; - sx = ((OhmygodSpriteRam[Offs + 1] << 8) + OhmygodSpriteRam[Offs + 0]) - 29; - sy = (OhmygodSpriteRam[Offs + 3] << 8) + OhmygodSpriteRam[Offs + 2]; - if (sy >= 32768) sy -= 65536; - - sx -= 96; - - Flipx = ((OhmygodSpriteRam[Offs + 7] << 8) + OhmygodSpriteRam[Offs + 6]) & 0x8000; - - if (sx > 15 && sx < 304 && sy > 15 && sy < 224) { - if (!Flipx) { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour, 4, 0, 512, OhmygodSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, 4, 0, 512, OhmygodSprites); - } - } else { - if (!Flipx) { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 512, OhmygodSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 512, OhmygodSprites); - } - } - } -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 5) & 0x1f; - g = (nColour >> 10) & 0x1f; - b = (nColour >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - return BurnHighCol(r, g, b, 0); -} - -INT32 OhmygodCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)OhmygodPaletteRam, pd = OhmygodPalette; i < 0x800; i++, ps++, pd++) { - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*((UINT16*)ps))); - } - - return 0; -} - -void OhmygodDraw() -{ - OhmygodCalcPalette(); - OhmygodRenderCharLayer(); - OhmygodRenderSpriteLayer(); - BurnTransferCopy(OhmygodPalette); -} - -INT32 OhmygodFrame() -{ - if (OhmygodReset) OhmygodDoReset(); - - OhmygodMakeInputs(); - - SekNewFrame(); - - SekOpen(0); - SekRun(12000000 / 60); - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - SekClose(); - do_watchtick(); - if (pBurnDraw) OhmygodDraw(); - if (pBurnSoundOut) MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - - return 0; -} - -static INT32 OhmygodScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x02944; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); // Scan 68000 - - MSM6295Scan(0, nAction); // Scan OKIM6295 - - // Scan critical driver variables - SCAN_VAR(OhmygodInput); - SCAN_VAR(OhmygodDip); - SCAN_VAR(AdpcmBankShift); - SCAN_VAR(SndBank); - SCAN_VAR(watch_tick); - SCAN_VAR(OhmygodSpriteBank); - SCAN_VAR(OhmygodScrollx); - SCAN_VAR(OhmygodScrolly); - } - - if (nAction & ACB_WRITE) { - memcpy(MSM6295ROM + 0x20000,MSM6295ROM + 0x40000 + 0x20000 * SndBank,0x20000); - } - - return 0; -} - -struct BurnDriver BurnDrvOhmygod = { - "ohmygod", NULL, NULL, NULL, "1993", - "Oh My God!\0", NULL, "Atlus", "Miscellaneous", - L"Oh my God! (Japan)\0Oh my god! \u30AA\u30FC\u30DE\u30A4\u30AC\u30A1\u30FC\uFF01\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, OhmygodRomInfo, OhmygodRomName, NULL, NULL, OhmygodInputInfo, OhmygodDIPInfo, - OhmygodInit, OhmygodExit, OhmygodFrame, NULL, OhmygodScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvNaname = { - "naname", NULL, NULL, NULL, "1994", - "Naname de Magic!\0", NULL, "Atlus", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, NanameRomInfo, NanameRomName, NULL, NULL, OhmygodInputInfo, NanameDIPInfo, - OhmygodInit, OhmygodExit, OhmygodFrame, NULL, OhmygodScan, - NULL, 0x800, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_onetwo.cpp b/jan/src/burn/drv/pst90s/d_onetwo.cpp deleted file mode 100644 index 1049e8d29..000000000 --- a/jan/src/burn/drv/pst90s/d_onetwo.cpp +++ /dev/null @@ -1,585 +0,0 @@ -// FB Alpha One + Two driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 soundlatch; -static UINT8 nDrvBank; -static INT32 watchdog; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo OnetwoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Onetwo) - -static struct BurnDIPInfo OnetwoDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x79, NULL }, - - {0 , 0xfe, 0 , 4, "Timer" }, - {0x14, 0x01, 0x03, 0x03, "Easy" }, - {0x14, 0x01, 0x03, 0x02, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x0c, "Easy" }, - {0x14, 0x01, 0x0c, 0x08, "Normal" }, - {0x14, 0x01, 0x0c, 0x04, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x14, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "8 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x20, "5 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x00, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xc0, 0x40, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Chute" }, - {0x15, 0x01, 0x04, 0x04, "Common" }, - {0x15, 0x01, 0x04, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 2, "Nude Pictures" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Women Select" }, - {0x15, 0x01, 0x10, 0x00, "No" }, - {0x15, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Stop Mode (Cheat)" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Play Mode" }, - {0x15, 0x01, 0x40, 0x00, "1 Player" }, - {0x15, 0x01, 0x40, 0x40, "2 Player" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Onetwo) - -static void bankswitch(INT32 data) -{ - nDrvBank = data & 7; - - ZetMapMemory(DrvZ80ROM0 + nDrvBank * 0x4000, 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall onetwo_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - watchdog = 0; - // coin counters = data & 3 - return; - - case 0x01: - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - - case 0x02: - bankswitch(data); - return; - } -} - -static UINT8 __fastcall onetwo_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return DrvDips[port & 1]; - - case 0x02: - case 0x03: - case 0x04: - return DrvInputs[(port - 2) & 0xff]; - } - - return 0; -} - -static UINT8 __fastcall onetwo_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return soundlatch; - } - - return 0; -} - -static void __fastcall onetwo_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM3812Write(0, 0, data); - return; - - case 0x20: - BurnYM3812Write(0, 1, data); - return; - - case 0x40: - MSM6295Command(0, data); - return; - - case 0xc0: - soundlatch = 0; - return; - } -} - -static UINT8 __fastcall onetwo_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return BurnYM3812Read(0,0); - - case 0x40: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static void DrvFMIRQHandler(int, INT32 nStatus) -{ - ZetSetIRQLine(0, ((nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE)); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - bankswitch(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - BurnYM3812Reset(); - MSM6295Reset(0); - ZetClose(); - - soundlatch = 0; - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0080 * sizeof(UINT32); - - AllRam = Next; - - DrvPalRAM = Next; Next += 0x000200; - DrvFgRAM = Next; Next += 0x001000; - DrvZ80RAM0 = Next; Next += 0x002000; - DrvZ80RAM1 = Next; Next += 0x000400; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x180000); - if (tmp == NULL) { - return 1; - } - - static INT32 Planes[6] = { 0x800000, 0x800000+4, 0, 0+4, 0x400000, 0x400000+4 }; - static INT32 XOffs[8] = { STEP4(0,1), STEP4(64,1) }; - static INT32 YOffs[8] = { STEP8(0,8) }; - - memcpy (tmp, DrvGfxROM, 0x180000); - - GfxDecode(0x8000, 6, 8, 8, Planes, XOffs, YOffs, 0x080, tmp, DrvGfxROM); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 5, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvPalRAM, 0xc800, 0xc8ff, MAP_RAM); // 0-7f - ZetMapMemory(DrvPalRAM + 0x100, 0xc900, 0xc9ff, MAP_RAM); // 0-7f - ZetMapMemory(DrvFgRAM, 0xd000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xe000, 0xffff, MAP_RAM); - ZetSetOutHandler(onetwo_main_write_port); - ZetSetInHandler(onetwo_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xf000, 0xf7ff, MAP_RAM); - ZetSetReadHandler(onetwo_sound_read); - ZetSetOutHandler(onetwo_sound_write_port); - ZetSetInHandler(onetwo_sound_read_port); - ZetClose(); - - BurnYM3812Init(1, 4000000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM3812SetRoute(1, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1056000 * 2 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - BurnYM3812Exit(); - - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 0x80; i++) - { - INT32 r = DrvPalRAM[i + 0x000] & 0x1f; - INT32 g = DrvPalRAM[i + 0x100] & 0x1f; - INT32 b =((DrvPalRAM[i + 0x000] >> 2) & 0x18) | ((DrvPalRAM[i + 0x100] >> 5) & 0x7); - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void draw_layer() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 attr = DrvFgRAM[offs * 2 + 1]; - INT32 code = DrvFgRAM[offs * 2 + 0] + ((attr & 0x7f) << 8); - INT32 color = attr >> 7; - - Render8x8Tile(pTransDraw, code, (offs & 0x3f) * 8, (offs / 0x40) * 8, color, 6, 0, DrvGfxROM); - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; // always -// } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x0100; - } - - draw_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - ZetNewFrame(); - - INT32 nInterleave = 16; - INT32 nTotalCycles[2] = { 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun((nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i)); - if (i == (nInterleave-1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - BurnTimerUpdateYM3812((i + 1) * (nTotalCycles[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(1); - - BurnTimerEndFrameYM3812(nTotalCycles[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - ZetOpen(1); - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - ZetClose(); - - SCAN_VAR(soundlatch); - SCAN_VAR(nDrvBank); - } - - if (nAction & ACB_WRITE) { - ZetOpen(1); - bankswitch(nDrvBank); - ZetClose(); - } - - return 0; -} - - -// One + Two - -static struct BurnRomInfo onetwoRomDesc[] = { - { "maincpu", 0x20000, 0x83431e6e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "sound_prog", 0x10000, 0x90aba4f3, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "3_graphics", 0x80000, 0xc72ff3a0, 3 | BRF_GRA }, // 2 Characters - { "4_graphics", 0x80000, 0x0ca40557, 3 | BRF_GRA }, // 3 - { "5_graphics", 0x80000, 0x664b6679, 3 | BRF_GRA }, // 4 - - { "sample", 0x40000, 0xb10d3132, 4 | BRF_SND }, // 5 Samples -}; - -STD_ROM_PICK(onetwo) -STD_ROM_FN(onetwo) - -struct BurnDriver BurnDrvOnetwo = { - "onetwo", NULL, NULL, NULL, "1997", - "One + Two\0", NULL, "Barko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, onetwoRomInfo, onetwoRomName, NULL, NULL, OnetwoInputInfo, OnetwoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 512, 256, 4, 3 -}; - - -// One + Two (earlier) - -static struct BurnRomInfo onetwoeRomDesc[] = { - { "main_prog", 0x20000, 0x6c1936e9, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "sound_prog", 0x10000, 0x90aba4f3, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "3_grfx", 0x80000, 0x0f9f39ff, 3 | BRF_GRA }, // 2 Characters - { "4_grfx", 0x80000, 0x2b0e0564, 3 | BRF_GRA }, // 3 - { "5_grfx", 0x80000, 0x69807a9b, 3 | BRF_GRA }, // 4 - - { "sample", 0x40000, 0xb10d3132, 4 | BRF_SND }, // 5 Samples -}; - -STD_ROM_PICK(onetwoe) -STD_ROM_FN(onetwoe) - -struct BurnDriver BurnDrvOnetwoe = { - "onetwoe", "onetwo", NULL, NULL, "1997", - "One + Two (earlier)\0", NULL, "Barko", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, onetwoeRomInfo, onetwoeRomName, NULL, NULL, OnetwoInputInfo, OnetwoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x80, - 512, 256, 4, 3 -}; - diff --git a/jan/src/burn/drv/pst90s/d_pass.cpp b/jan/src/burn/drv/pst90s/d_pass.cpp deleted file mode 100644 index 4cb4c466e..000000000 --- a/jan/src/burn/drv/pst90s/d_pass.cpp +++ /dev/null @@ -1,516 +0,0 @@ -// FB Alpha Pass driver module -// Based on MAME driver by David Haywood and Stephh - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvBgVRAM; -static UINT8 *DrvFgVRAM; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static UINT8 *soundlatch; - -static struct BurnInputInfo PassInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 4, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 5, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 6, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 7, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 9, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 12, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 13, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 14, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 15, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 10, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 11, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pass) - -static struct BurnDIPInfo PassDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xe7, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x01, "4" }, - {0x12, 0x01, 0x03, 0x02, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x18, 0x00, "Easy" }, - {0x12, 0x01, 0x18, 0x18, "Normal" }, - {0x12, 0x01, 0x18, 0x08, "Hard" }, - {0x12, 0x01, 0x18, 0x10, "Hardest" }, - - {0 , 0xfe, 0 , 7, "Coinage" }, - {0x12, 0x01, 0xe0, 0x80, "4 Coins 1 Credits " }, - {0x12, 0x01, 0xe0, 0x40, "3 Coins 1 Credits " }, - {0x12, 0x01, 0xe0, 0xc0, "2 Coins 1 Credits " }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Pass) - -void __fastcall pass_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x230000: - *soundlatch = data & 0xff; - return; - } -} - -void __fastcall pass_write_byte(UINT32 /*address*/, UINT8 /*data*/) -{ - -} - -UINT16 __fastcall pass_read_word(UINT32 address) -{ - switch (address) - { - case 0x230100: - return DrvInputs[1]; - - case 0x230200: - return DrvInputs[0]; - } - - return 0; -} - -UINT8 __fastcall pass_read_byte(UINT32 /*address*/) -{ - return 0; -} - -void __fastcall pass_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x70: - BurnYM2203Write(0, 0, data); - return; - - case 0x71: - BurnYM2203Write(0, 1, data); - return; - - case 0x80: - MSM6295Command(0, data); - return; - - case 0xc0: - *soundlatch = 0; - return; - } -} - -UINT8 __fastcall pass_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return *soundlatch; - - case 0x70: - return BurnYM2203Read(0, 0); - - case 0x71: - return BurnYM2203Read(0, 1); - } - - return 0; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3579545; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3579545.0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - MSM6295Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x080000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x000400; - DrvBgVRAM = Next; Next += 0x001000; - DrvFgVRAM = Next; Next += 0x004000; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x0000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvSndROM, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 5, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040001, 9, 2)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x083fff, MAP_RAM); - SekMapMemory(DrvBgVRAM, 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(DrvFgVRAM, 0x210000, 0x213fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x220000, 0x2203ff, MAP_RAM); - SekSetWriteWordHandler(0, pass_write_word); - SekSetWriteByteHandler(0, pass_write_byte); - SekSetReadWordHandler(0, pass_read_word); - SekSetReadByteHandler(0, pass_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM); - ZetSetOutHandler(pass_sound_write_port); - ZetSetInHandler(pass_sound_read_port); - ZetClose(); - - BurnYM2203Init(1, 3579545, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3579545); - BurnYM2203SetAllRoutes(0, 0.60, BURN_SND_ROUTE_BOTH); - BurnYM2203SetPSGVolume(0, 0.10); - - MSM6295Init(0, 792000 / 132, 1); - MSM6295SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2203Exit(); - MSM6295Exit(0); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_foreground_layer() -{ - UINT16 *vram = (UINT16*)DrvFgVRAM; - - for (INT32 offs = 0; offs < 128 * 64; offs++) - { - INT32 sx = ((offs & 0x7f) << 2) - 64; - INT32 sy = ((offs >> 7) << 2) - 16; - - if (sx >= nScreenWidth || sx < -3 || sy >= nScreenHeight || sy < -3) continue; - - INT32 attr = vram[offs]; - INT32 code = attr & 0x3fff; - INT32 flipy = (attr & 0x8000) >> 15; - INT32 flipx = (attr & 0x4000) >> 14; - - if (code < 0x10) continue; - - INT32 flip = (flipy * 0x0c) | (flipx * 3); - UINT8 *src = DrvGfxROM0 + (code << 4); - - for (INT32 y = 0; y < 4; y++, sy++) - { - for (INT32 x = 0; x < 4; x++) - { - INT32 pxl = src[((y << 2) | x) ^ flip]; - if (pxl == 0xff) continue; - - pTransDraw[(sy * nScreenWidth) + (sx + x)] = pxl | 0x100; - } - } - } -} - -static void draw_background_layer() -{ - UINT16 *vram = (UINT16*)DrvBgVRAM; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = ((offs & 0x3f) << 3) - 64; - INT32 sy = ((offs >> 6) << 3) - 16; - - if (sx >= nScreenWidth || sx < -7 || sy >= nScreenHeight || sy < -7) continue; - - INT32 attr = vram[offs]; - INT32 code = attr & 0x1fff; - INT32 flipy = attr & 0x8000; - INT32 flipx = attr & 0x4000; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM1); - } else { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM1); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, 0, 8, 0, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - UINT16 *pal = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x200; i++) { - INT32 d = pal[i]; - - r = ((d >> 10) & 0x1f); - g = ((d >> 5) & 0x1f); - b = ((d >> 0) & 0x1f); - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - } - - draw_background_layer(); - draw_foreground_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - DrvInputs[0] = ~0; - DrvInputs[1] = DrvDips[0] | (DrvDips[1] << 8); - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 10; - INT32 nTotalCycles[2] = { 7159090 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nSegment); - - nSegment = nTotalCycles[1] / nInterleave; - BurnTimerUpdate((i + 1) * nSegment); - } - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - - BurnTimerEndFrame(nTotalCycles[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029703; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - } - - return 0; -} - - -// Pass - -static struct BurnRomInfo passRomDesc[] = { - { "33", 0x20000, 0x0c5f18f6, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "34", 0x20000, 0x7b54573d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "23", 0x10000, 0xb9a0ccde, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "31", 0x20000, 0xc7315bbd, 3 | BRF_SND }, // 3 Samples - - { "35", 0x20000, 0x2ab33f07, 4 | BRF_GRA }, // 4 Foreground Tiles - { "36", 0x20000, 0x6677709d, 4 | BRF_GRA }, // 5 - - { "38", 0x20000, 0x7f11b81a, 5 | BRF_GRA }, // 6 Background Tiles - { "40", 0x20000, 0x80e0a71d, 5 | BRF_GRA }, // 7 - { "37", 0x20000, 0x296499e7, 5 | BRF_GRA }, // 8 - { "39", 0x20000, 0x35c0ad5c, 5 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(pass) -STD_ROM_FN(pass) - -struct BurnDriver BurnDrvPass = { - "pass", NULL, NULL, NULL, "1992", - "Pass\0", NULL, "Oksan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, passRomInfo, passRomName, NULL, NULL, PassInputInfo, PassDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_pirates.cpp b/jan/src/burn/drv/pst90s/d_pirates.cpp deleted file mode 100644 index cc96cda52..000000000 --- a/jan/src/burn/drv/pst90s/d_pirates.cpp +++ /dev/null @@ -1,720 +0,0 @@ -// FB Alpha Pirates driver -// Based on MAME driver by David Haywood and Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "bitswap.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvMiscRAM; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static UINT8 *DrvOkiBank; -static UINT16 *DrvScrollX; - -static INT32 is_genix = 0; - -static struct BurnInputInfo PiratesInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, &DrvDips, "dip" }, -}; - -STDINPUTINFO(Pirates) - -static struct BurnDIPInfo PiratesDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0x0c, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x0c, 0x0c, "Off" }, - {0x13, 0x01, 0x0c, 0x00, "On" }, -}; - -STDDIPINFO(Pirates) - -inline static void genix_hack() -{ - if (is_genix) { - Drv68KRAM[0x9e98] = 0x04; - Drv68KRAM[0x9e99] = 0x00; - Drv68KRAM[0x9e9a] = 0x00; - Drv68KRAM[0x9e9b] = 0x00; - } -} - -static void palette_write(INT32 offset) -{ - UINT16 data = *((UINT16*)(DrvPalRAM + offset)); - - UINT8 r,g,b; - - r = (data >> 10) & 0x1f; - g = (data >> 5) & 0x1f; - b = (data >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset >> 1] = BurnHighCol(r, g, b, 0); -} - -static void set_oki_bank(INT32 data) -{ - *DrvOkiBank = data; - memcpy (MSM6295ROM, DrvSndROM + (data << 12), 0x40000); -} - -void __fastcall pirates_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffc00) == 0x109c00) { - Drv68KRAM[(address & 0xffff) ^ 1] = data; - genix_hack(); - - return; - } - - if ((address & 0xffc000) == 0x800000) { - DrvPalRAM[address & 0x3fff] = data; - palette_write(address & 0x3ffe); - return; - } - - switch (address) - { - case 0x600000: - case 0x600001: - if (*DrvOkiBank != (data & 0x40)) - set_oki_bank(data & 0x40); - return; - - case 0xa00000: - case 0xa00001: - MSM6295Command(0, data); - return; - } -} - -void __fastcall pirates_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffc00) == 0x109c00) { - *((UINT16 *)(Drv68KRAM + (address & 0xfffe))) = data; - genix_hack(); - - return; - } - - if ((address & 0xffc000) == 0x800000) { - *((UINT16 *)(DrvPalRAM + (address & 0x3ffe))) = data; - palette_write(address & 0x3ffe); - return; - } - - switch (address) - { - case 0x600000: - if (*DrvOkiBank != (data & 0x40)) - set_oki_bank(data & 0x40); - return; - - case 0x700000: - *DrvScrollX = data & 0x1ff; - return; - - case 0xa00000: - MSM6295Command(0, data & 0xff); - return; - } -} - -UINT8 __fastcall pirates_read_byte(UINT32 address) -{ - genix_hack(); - - switch (address) - { - case 0x300000: - case 0x300001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x400000: - case 0x400001: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0xa00001: - return MSM6295ReadStatus(0); - } - - return 0; -} - -UINT16 __fastcall pirates_read_word(UINT32 address) -{ - genix_hack(); - - switch (address) - { - case 0x300000: - return DrvInputs[0]; - - case 0x400000: - return DrvInputs[1]; - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0x400000 * 3, 0x400000 * 2, 0x400000 * 1, 0x400000 * 0 }; - INT32 XOffs[16] = { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 }; - INT32 YOffs0[8] = { 8*0, 8*1, 8*2, 8*3, 8*4, 8*5, 8*6, 8*7 }; - INT32 YOffs1[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16,10*16,11*16,12*16,13*16,14*16,15*16 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x200000); - - GfxDecode(0x10000, 4, 8, 8, Plane, XOffs, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x04000, 4, 16, 16, Plane, XOffs, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree(tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x400000; - - MSM6295ROM = Next; Next += 0x040000; - DrvSndROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x000800; - DrvMiscRAM = Next; Next += 0x005000; - - DrvScrollX = (UINT16*)Next; Next += 0x000002; - - DrvOkiBank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - - set_oki_bank(0); - - return 0; -} - -static void pirates_decrypt_68k() -{ - UINT16 *buf = (UINT16 *)BurnMalloc(0x100000); - UINT16 *rom = (UINT16 *)Drv68KROM; - - memcpy (buf, rom, 0x100000); - - for (INT32 i=0; i< 0x100000/2; i++) - { - INT32 adrl, adrr; - UINT8 vl, vr; - - adrl = BITSWAP24(i,23,22,21,20,19,18,4,8,3,14,2,15,17,0,9,13,10,5,16,7,12,6,1,11); - vl = BITSWAP08(buf[adrl], 4,2,7,1,6,5,0,3); - - adrr = BITSWAP24(i,23,22,21,20,19,18,4,10,1,11,12,5,9,17,14,0,13,6,15,8,3,16,7,2); - vr = BITSWAP08(buf[adrr]>>8, 1,4,7,0,3,5,6,2); - - rom[i] = (vr<<8) | vl; - } - - BurnFree (buf); -} - -static void pirates_decrypt_p() -{ - UINT8 *buf = (UINT8*)BurnMalloc(0x200000); - UINT8 *rom = DrvGfxROM0; - memcpy (buf, rom, 0x200000); - - for (INT32 i=0; i<0x200000/4; i++) - { - INT32 adr = BITSWAP24(i,23,22,21,20,19,18,10,2,5,9,7,13,16,14,11,4,1,6,12,17,3,0,15,8); - rom[adr+0*(0x200000/4)] = BITSWAP08(buf[i+0*(0x200000/4)], 2,3,4,0,7,5,1,6); - rom[adr+1*(0x200000/4)] = BITSWAP08(buf[i+1*(0x200000/4)], 4,2,7,1,6,5,0,3); - rom[adr+2*(0x200000/4)] = BITSWAP08(buf[i+2*(0x200000/4)], 1,4,7,0,3,5,6,2); - rom[adr+3*(0x200000/4)] = BITSWAP08(buf[i+3*(0x200000/4)], 2,3,4,0,7,5,1,6); - } - - BurnFree (buf); -} - -static void pirates_decrypt_s() -{ - UINT8 *buf = (UINT8*)BurnMalloc(0x200000); - UINT8 *rom = DrvGfxROM1; - memcpy (buf, rom, 0x200000); - - for (INT32 i=0; i<0x200000/4; i++) - { - INT32 adr = BITSWAP24(i,23,22,21,20,19,18,17,5,12,14,8,3,0,7,9,16,4,2,6,11,13,1,10,15); - rom[adr+0*(0x200000/4)] = BITSWAP08(buf[i+0*(0x200000/4)], 4,2,7,1,6,5,0,3); - rom[adr+1*(0x200000/4)] = BITSWAP08(buf[i+1*(0x200000/4)], 1,4,7,0,3,5,6,2); - rom[adr+2*(0x200000/4)] = BITSWAP08(buf[i+2*(0x200000/4)], 2,3,4,0,7,5,1,6); - rom[adr+3*(0x200000/4)] = BITSWAP08(buf[i+3*(0x200000/4)], 4,2,7,1,6,5,0,3); - } - - BurnFree (buf); -} - -static void pirates_decrypt_oki() -{ - UINT8 *buf = (UINT8*)BurnMalloc(0x80000); - UINT8 *rom = DrvSndROM; - memcpy (buf, rom, 0x80000); - - for (INT32 i=0; i<0x80000; i++) - { - INT32 adr = BITSWAP24(i,23,22,21,20,19,10,16,13,8,4,7,11,14,17,12,6,2,0,5,18,15,3,1,9); - rom[adr] = BITSWAP08(buf[i], 2,3,4,0,7,5,1,6); - } - - BurnFree (buf); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - for (INT32 i = 0; i < 4; i++) { - if (BurnLoadRom(DrvGfxROM0 + i * 0x80000, 2 + i, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + i * 0x80000, 6 + i, 1)) return 1; - } - - if (BurnLoadRom(DrvSndROM, 10, 1)) return 1; - - pirates_decrypt_68k(); - pirates_decrypt_p(); - pirates_decrypt_s(); - pirates_decrypt_oki(); - - DrvGfxDecode(); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "pirates") || !strcmp(BurnDrvGetTextA(DRV_NAME), "piratesb")) { - *((UINT16*)(Drv68KROM + 0x62c0)) = 0x6006; // bypass protection - } else { - is_genix = 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM + 0x0000, 0x100000, 0x109bff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x9c00, 0x109c00, 0x109fff, (is_genix) ? MAP_ROM : MAP_RAM); - SekMapMemory(Drv68KRAM + 0xa000, 0x10a000, 0x10ffff, MAP_RAM); -// SekMapMemory(Drv68KRAM, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x500000, 0x5007ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x800000, 0x803fff, MAP_ROM); - SekMapMemory(DrvMiscRAM, 0x900000, 0x904fff, MAP_RAM); - SekSetWriteByteHandler(0, pirates_write_byte); - SekSetWriteWordHandler(0, pirates_write_word); - SekSetReadByteHandler(0, pirates_read_byte); - SekSetReadWordHandler(0, pirates_read_word); - SekClose(); - - MSM6295Init(0, 1333333 / MSM6295_PIN7_LOW, 0); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - - MSM6295Exit(0); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - is_genix = 0; - - return 0; -} - -static void draw_layer(INT32 offset, INT32 coloffs, INT32 transp) -{ - UINT16 *vram = (UINT16*)(DrvMiscRAM + offset); - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs >> 5) << 3; - INT32 sy = (offs & 0x1f) << 3; - - sx -= *DrvScrollX; - if (sx < -15) sx += 0x200; - - if (sy < 16 || sy > 239 || sx > 287 || sx < -15) continue; - - INT32 code = vram[offs*2]; - INT32 color = vram[offs*2+1]; - - if (transp) { - if (!code && !color) continue; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color + coloffs, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy - 16, color + coloffs, 4, 0, DrvGfxROM0); - } - } -} - -static void draw_text_layer() -{ - UINT16 *vram = (UINT16*)(DrvMiscRAM + 0x0180); - - for (INT32 offs = 0; offs < 36 * 32; offs++) - { - INT32 sx = (offs >> 5) << 3; - INT32 sy = (offs & 0x1f) << 3; - - if (sy < 16 || sy > 239 || sx >= 288) continue; - - INT32 code = vram[offs*2]; - INT32 color = vram[offs*2+1]; - - if (!code && !color) continue; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - UINT16 *source = ((UINT16*)DrvSprRAM) + 4; - UINT16 *finish = source + 0x800/2-4; - - while (source < finish) - { - INT32 sx, sy, flipx, flipy, code, color; - - sx = source[1] - 32; - sy = source[-1]; - - if (sy & 0x8000) break; - - code = source[2] >> 2; - color = source[0] & 0xff; - flipx = source[2] & 2; - flipy = source[2] & 1; - - sy = (0xf2 - sy) - 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x1800, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x1800, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x1800, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x1800, DrvGfxROM1); - } - } - - source+=4; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x4000; i+=2) { - palette_write(i); - } - } - - if (nBurnLayer & 1) - draw_layer(0x2a80, 0x100, 0); - else - BurnTransferClear(); - - if (nBurnLayer & 2) draw_layer(0x1380, 0x080, 1); - - if (nBurnLayer & 8) draw_sprites(); - - if (nBurnLayer & 4) draw_text_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0xffff; - DrvInputs[1] = 0x0003 | DrvDips; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 10; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - SekRun((16000000 / 60) / nInterleave); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - MSM6295Render(0, pSoundBuf, nSegmentLength); - - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - MSM6295Scan(0, nAction); - } - - if (nAction & ACB_WRITE) { - set_oki_bank(*DrvOkiBank); - } - - return 0; -} - - -// Pirates (set 1) - -static struct BurnRomInfo piratesRomDesc[] = { - { "r_449b.bin", 0x80000, 0x224aeeda, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "l_5c1e.bin", 0x80000, 0x46740204, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "p4_4d48.bin", 0x80000, 0x89fda216, 2 | BRF_GRA }, // 2 Tiles - { "p2_5d74.bin", 0x80000, 0x40e069b4, 2 | BRF_GRA }, // 3 - { "p1_7b30.bin", 0x80000, 0x26d78518, 2 | BRF_GRA }, // 4 - { "p8_9f4f.bin", 0x80000, 0xf31696ea, 2 | BRF_GRA }, // 5 - - { "s1_6e89.bin", 0x80000, 0xc78a276f, 3 | BRF_GRA }, // 6 Sprites - { "s2_6df3.bin", 0x80000, 0x9f0bad96, 3 | BRF_GRA }, // 7 - { "s4_fdcc.bin", 0x80000, 0x8916ddb5, 3 | BRF_GRA }, // 8 - { "s8_4b7c.bin", 0x80000, 0x1c41bd2c, 3 | BRF_GRA }, // 9 - - { "s89_49d4.bin", 0x80000, 0x63a739ec, 4 | BRF_SND }, // 10 Oki Samples -}; - -STD_ROM_PICK(pirates) -STD_ROM_FN(pirates) - -struct BurnDriver BurnDrvPirates = { - "pirates", NULL, NULL, NULL, "1994", - "Pirates (set 1)\0", NULL, "NIX", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, piratesRomInfo, piratesRomName, NULL, NULL, PiratesInputInfo, PiratesDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Pirates (set 2) -// shows 'Copyright 1995' instead of (c)1994 Nix, but isn't unprotected, various changes to the names in the credis + a few other minor alterations - -static struct BurnRomInfo piratesbRomDesc[] = { - { "U15", 0x80000, 0x0cfd6415, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "U16", 0x80000, 0x98cece02, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "U34", 0x80000, 0x89fda216, 2 | BRF_GRA }, // 2 Tiles - { "U35", 0x80000, 0x40e069b4, 2 | BRF_GRA }, // 3 - { "U48", 0x80000, 0x26d78518, 2 | BRF_GRA }, // 4 - { "U49", 0x80000, 0xf31696ea, 2 | BRF_GRA }, // 5 - - { "U69", 0x80000, 0xc78a276f, 3 | BRF_GRA }, // 6 Sprites - { "U70", 0x80000, 0x9f0bad96, 3 | BRF_GRA }, // 7 - { "U71", 0x80000, 0x0bb7c816, 3 | BRF_GRA }, // 8 - { "U72", 0x80000, 0x1c41bd2c, 3 | BRF_GRA }, // 9 - - { "U31", 0x80000, 0x63a739ec, 4 | BRF_SND }, // 10 Oki Samples -}; - -STD_ROM_PICK(piratesb) -STD_ROM_FN(piratesb) - -struct BurnDriver BurnDrvPiratesb = { - "piratesb", "pirates", NULL, NULL, "1995", - "Pirates (set 2)\0", NULL, "NIX", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, piratesbRomInfo, piratesbRomName, NULL, NULL, PiratesInputInfo, PiratesDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; - - -// Genix Family - -static struct BurnRomInfo genixRomDesc[] = { - { "1.15", 0x80000, 0xd26abfb0, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2.16", 0x80000, 0xa14a25b4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "7.34", 0x40000, 0x58da8aac, 2 | BRF_GRA }, // 2 Tiles - { "9.35", 0x40000, 0x96bad9a8, 2 | BRF_GRA }, // 3 - { "8.48", 0x40000, 0x0ddc58b6, 2 | BRF_GRA }, // 4 - { "10.49", 0x40000, 0x2be308c5, 2 | BRF_GRA }, // 5 - - { "6.69", 0x40000, 0xb8422af7, 3 | BRF_GRA }, // 6 Sprites - { "5.70", 0x40000, 0xe46125c5, 3 | BRF_GRA }, // 7 - { "4.71", 0x40000, 0x7a8ed21b, 3 | BRF_GRA }, // 8 - { "3.72", 0x40000, 0xf78bd6ca, 3 | BRF_GRA }, // 9 - - { "0.31", 0x80000, 0x80d087bc, 4 | BRF_SND }, // 10 Oki Samples -}; - -STD_ROM_PICK(genix) -STD_ROM_FN(genix) - -struct BurnDriver BurnDrvGenix = { - "genix", NULL, NULL, NULL, "1994", - "Genix Family\0", NULL, "NIX", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, genixRomInfo, genixRomName, NULL, NULL, PiratesInputInfo, PiratesDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 288, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_playmark.cpp b/jan/src/burn/drv/pst90s/d_playmark.cpp deleted file mode 100644 index 0ae120d48..000000000 --- a/jan/src/burn/drv/pst90s/d_playmark.cpp +++ /dev/null @@ -1,1736 +0,0 @@ -// FB Alpha Playmark hardware driver module -// Based on MAME driver by Nicola Salmoria, Pierpaolo Prazzoli, Quench - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "pic16c5x_intf.h" -#include "msm6295.h" -#include "eeprom.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68kRom = NULL; -static UINT8 *Drv68kRam = NULL; -static UINT8 *DrvPicRom = NULL; -static UINT8 *DrvMSM6295Src = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvVideo1Ram = NULL; -static UINT8 *DrvVideo2Ram = NULL; -static UINT8 *DrvBgVideoRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT32 *DrvPalette = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTempGfx = NULL; - -static UINT16 DrvFgScrollX = 0; -static UINT16 DrvFgScrollY = 0; -static UINT16 DrvCharScrollX = 0; -static UINT16 DrvCharScrollY = 0; -static UINT16 DrvBgEnable = 0; -static UINT16 DrvBgFullSize = 0; -static UINT16 DrvBgScrollX = 0; -static UINT16 DrvBgScrollY = 0; -static UINT16 DrvScreenEnable = 0; -static UINT8 DrvVBlank = 0; - -static UINT8 DrvSoundCommand = 0; -static UINT8 DrvSoundFlag = 0; -static UINT8 DrvOkiControl = 0; -static UINT8 DrvOkiCommand = 0; -static UINT8 DrvOldOkiBank = 0; -static UINT8 DrvOkiBank = 0; - -static INT32 Drv68kRomSize = 0; -static INT32 DrvMSM6295RomSize = 0; -static INT32 DrvNumTiles = 0; -static INT32 DrvTileSize = 0; -static INT32 DrvNumChars = 0; -static INT32 DrvCharSize = 0; -static INT32 DrvNumSprites = 0; -static INT32 DrvSpriteSize = 0; -static INT32 DrvEEPROMInUse = 0; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; -static INT32 nIRQLine = 2; - -typedef void (*Render)(); -static Render DrawFunction; -static void DrvRender(); -static void ExcelsrRender(); -static void HotmindRender(); - -static struct BurnInputInfo BigtwinInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Bigtwin) - -static struct BurnInputInfo ExcelsrInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort2 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Excelsr) - -static struct BurnInputInfo HotmindInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Hotmind) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); -} - -static struct BurnDIPInfo BigtwinDIPList[] = -{ - // Default Values - {0x0f, 0xff, 0xff, 0x4a, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0f, 0x01, 0x01, 0x00, "English" }, - {0x0f, 0x01, 0x01, 0x01, "Italian" }, - - {0 , 0xfe, 0 , 2 , "Censor Pictures" }, - {0x0f, 0x01, 0x04, 0x00, "No" }, - {0x0f, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 3 , "Difficulty" }, - {0x0f, 0x01, 0x30, 0x30, "Normal" }, - {0x0f, 0x01, 0x30, 0x10, "Hard" }, - {0x0f, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0f, 0x01, 0x40, 0x00, "No" }, - {0x0f, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x10, 0x01, 0x01, 0x01, "Mode 1" }, - {0x10, 0x01, 0x01, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 16 , "Coinage Mode 1" }, - {0x10, 0x01, 0x1e, 0x14, "6 Coins 1 Credit" }, - {0x10, 0x01, 0x1e, 0x16, "5 Coins 1 Credit" }, - {0x10, 0x01, 0x1e, 0x14, "4 Coins 1 Credit" }, - {0x10, 0x01, 0x1e, 0x18, "3 Coins 1 Credit" }, - {0x10, 0x01, 0x1e, 0x1a, "8 Coins 3 Credits" }, - {0x10, 0x01, 0x1e, 0x02, "2 Coins 1 Credit" }, - {0x10, 0x01, 0x1e, 0x04, "5 Coins 1 Credits" }, - {0x10, 0x01, 0x1e, 0x06, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x1e, 0x1e, "1 Coin 1 Credit" }, - {0x10, 0x01, 0x1e, 0x08, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x1e, 0x12, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x1e, 0x10, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x1e, 0x0e, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x1e, 0x0c, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x1e, 0x0a, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x1e, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2 , "Minimum Credits to Start" }, - {0x10, 0x01, 0x20, 0x20, "1" }, - {0x10, 0x01, 0x20, 0x00, "2" }, -}; - -STDDIPINFO(Bigtwin) - -static struct BurnDIPInfo ExcelsrDIPList[] = -{ - // Default Values - {0x13, 0xff, 0xff, 0x63, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x03, 0x00, "1" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 3 , "Censor Pictures" }, - {0x13, 0x01, 0x0c, 0x00, "No" }, - {0x13, 0x01, 0x0c, 0x08, "50%" }, - {0x13, 0x01, 0x0c, 0x0c, "100%" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x30, 0x30, "Easy" }, - {0x13, 0x01, 0x30, 0x20, "Normal" }, - {0x13, 0x01, 0x30, 0x10, "Medium" }, - {0x13, 0x01, 0x30, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x40, 0x00, "No" }, - {0x13, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x14, 0x01, 0x01, 0x01, "Mode 1" }, - {0x14, 0x01, 0x01, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 16 , "Coinage Mode 1" }, - {0x14, 0x01, 0x1e, 0x14, "6 Coins 1 Credit" }, - {0x14, 0x01, 0x1e, 0x16, "5 Coins 1 Credit" }, - {0x14, 0x01, 0x1e, 0x14, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x1e, 0x18, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x1e, 0x1a, "8 Coins 3 Credits" }, - {0x14, 0x01, 0x1e, 0x02, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x1e, 0x04, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x1e, 0x06, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x1e, 0x1e, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x1e, 0x08, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x1e, 0x12, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x1e, 0x10, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x1e, 0x0e, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x1e, 0x0c, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x1e, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x1e, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2 , "Minimum Credits to Start" }, - {0x14, 0x01, 0x20, 0x20, "1" }, - {0x14, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 2 , "Percentage to Reveal" }, - {0x14, 0x01, 0x40, 0x40, "80%" }, - {0x14, 0x01, 0x40, 0x00, "90%" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Excelsr) - -static struct BurnDIPInfo HotmindDIPList[] = -{ - // Default Values - {0x0b, 0xff, 0xff, 0xef, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x0b, 0x01, 0x07, 0x07, "Easy" }, - {0x0b, 0x01, 0x07, 0x06, "Normal" }, - {0x0b, 0x01, 0x07, 0x05, "Hard" }, - {0x0b, 0x01, 0x07, 0x04, "Very Hard 1" }, - {0x0b, 0x01, 0x07, 0x03, "Very Hard 2" }, - {0x0b, 0x01, 0x07, 0x02, "Very Hard 3" }, - {0x0b, 0x01, 0x07, 0x01, "Very Hard 4" }, - {0x0b, 0x01, 0x07, 0x00, "Very Hard 5" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x08, 0x08, "Off" }, - {0x0b, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sound" }, - {0x0b, 0x01, 0x10, 0x10, "Off" }, - {0x0b, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Erogatore Gettoni" }, - {0x0b, 0x01, 0x20, 0x20, "Off" }, - {0x0b, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Erogatore Ticket" }, - {0x0b, 0x01, 0x40, 0x40, "Off" }, - {0x0b, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Clear Memory" }, - {0x0b, 0x01, 0x80, 0x80, "Off" }, - {0x0b, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Coin Mode" }, - {0x0c, 0x01, 0x01, 0x01, "Mode 1" }, - {0x0c, 0x01, 0x01, 0x00, "Mode 2" }, - - {0 , 0xfe, 0 , 16 , "Coinage Mode 1" }, - {0x0c, 0x01, 0x1e, 0x14, "6 Coins 1 Credit" }, - {0x0c, 0x01, 0x1e, 0x16, "5 Coins 1 Credit" }, - {0x0c, 0x01, 0x1e, 0x14, "4 Coins 1 Credit" }, - {0x0c, 0x01, 0x1e, 0x18, "3 Coins 1 Credit" }, - {0x0c, 0x01, 0x1e, 0x1a, "8 Coins 3 Credits" }, - {0x0c, 0x01, 0x1e, 0x02, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0x1e, 0x04, "5 Coins 1 Credits" }, - {0x0c, 0x01, 0x1e, 0x06, "3 Coins 2 Credits" }, - {0x0c, 0x01, 0x1e, 0x1e, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0x1e, 0x08, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0x1e, 0x12, "1 Coin 2 Credits" }, - {0x0c, 0x01, 0x1e, 0x10, "1 Coin 3 Credits" }, - {0x0c, 0x01, 0x1e, 0x0e, "1 Coin 4 Credits" }, - {0x0c, 0x01, 0x1e, 0x0c, "1 Coin 5 Credits" }, - {0x0c, 0x01, 0x1e, 0x0a, "1 Coin 6 Credits" }, - {0x0c, 0x01, 0x1e, 0x00, "Free Play" }, -}; - -STDDIPINFO(Hotmind) - -static struct BurnRomInfo BigtwinRomDesc[] = { - { "2.302", 0x80000, 0xe6767f60, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "3.301", 0x80000, 0x5aba6990, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "pic16c57-hs_bigtwin_015.hex", 0x02d4c, 0xc07e9375, BRF_ESS | BRF_PRG }, // 2 PIC16C57 HEX - - { "4.311", 0x40000, 0x6f628fbc, BRF_GRA }, // 3 Tiles - { "5.312", 0x40000, 0x6a9b1752, BRF_GRA }, // 4 Tiles - { "6.313", 0x40000, 0x411cf852, BRF_GRA }, // 5 Tiles - { "7.314", 0x40000, 0x635c81fd, BRF_GRA }, // 6 Tiles - - { "8.321", 0x20000, 0x2749644d, BRF_GRA }, // 7 Sprites - { "9.322", 0x20000, 0x1d1897af, BRF_GRA }, // 8 Sprites - { "10.323", 0x20000, 0x2a03432e, BRF_GRA }, // 9 Sprites - { "11.324", 0x20000, 0x2c980c4c, BRF_GRA }, // 10 Sprites - - { "1.013", 0x40000, 0xff6671dc, BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(Bigtwin) -STD_ROM_FN(Bigtwin) - -static struct BurnRomInfo ExcelsrRomDesc[] = { - { "22.u301", 0x80000, 0xf0aa1c1b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "19.u302", 0x80000, 0x9a8acddc, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - { "21.u303", 0x80000, 0xfdf9bd64, BRF_ESS | BRF_PRG }, // 2 68000 Program Code - { "18.u304", 0x80000, 0xfe517e0e, BRF_ESS | BRF_PRG }, // 3 68000 Program Code - { "20.u305", 0x80000, 0x8692afe9, BRF_ESS | BRF_PRG }, // 4 68000 Program Code - { "17.u306", 0x80000, 0x978f9a6b, BRF_ESS | BRF_PRG }, // 5 68000 Program Code - - { "pic16c57-hs_excelsior_i015.hex", 0x02d4c, 0x022c6941, BRF_ESS | BRF_PRG }, // 6 PIC16C57 HEX - - { "26.u311", 0x80000, 0xc171c059, BRF_GRA }, // 7 Tiles - { "30.u312", 0x80000, 0xb4a4c510, BRF_GRA }, // 8 Tiles - { "25.u313", 0x80000, 0x667eec1b, BRF_GRA }, // 9 Tiles - { "29.u314", 0x80000, 0x4acb0745, BRF_GRA }, // 10 Tiles - - { "24.u321", 0x80000, 0x17f46825, BRF_GRA }, // 11 Sprites - { "28.u322", 0x80000, 0xa823f2bd, BRF_GRA }, // 12 Sprites - { "23.u323", 0x80000, 0xd8e1453b, BRF_GRA }, // 13 Sprites - { "27.u324", 0x80000, 0xeca2c079, BRF_GRA }, // 14 Sprites - - { "16.i013", 0x80000, 0x7ed9da5d, BRF_SND }, // 15 Samples -}; - -STD_ROM_PICK(Excelsr) -STD_ROM_FN(Excelsr) - -static struct BurnRomInfo ExcelsraRomDesc[] = { - { "22.u301", 0x80000, 0x55dca2da, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "19.u302", 0x80000, 0xd13990a8, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - { "21.u303", 0x80000, 0xfdf9bd64, BRF_ESS | BRF_PRG }, // 2 68000 Program Code - { "18.u304", 0x80000, 0xfe517e0e, BRF_ESS | BRF_PRG }, // 3 68000 Program Code - { "20.u305", 0x80000, 0x8692afe9, BRF_ESS | BRF_PRG }, // 4 68000 Program Code - { "17.u306", 0x80000, 0x978f9a6b, BRF_ESS | BRF_PRG }, // 5 68000 Program Code - - { "pic16c57-hs_excelsior_i015.hex", 0x02d4c, 0x022c6941, BRF_ESS | BRF_PRG }, // 6 PIC16C57 HEX - - { "26.u311", 0x80000, 0xc171c059, BRF_GRA }, // 7 Tiles - { "30.u312", 0x80000, 0xb4a4c510, BRF_GRA }, // 8 Tiles - { "25.u313", 0x80000, 0x667eec1b, BRF_GRA }, // 9 Tiles - { "29.u314", 0x80000, 0x4acb0745, BRF_GRA }, // 10 Tiles - - { "24.u321", 0x80000, 0x17f46825, BRF_GRA }, // 11 Sprites - { "28.u322", 0x80000, 0xa823f2bd, BRF_GRA }, // 12 Sprites - { "23.u323", 0x80000, 0xd8e1453b, BRF_GRA }, // 13 Sprites - { "27.u324", 0x80000, 0xeca2c079, BRF_GRA }, // 14 Sprites - - { "16.i013", 0x80000, 0x7ed9da5d, BRF_SND }, // 15 Samples -}; - -STD_ROM_PICK(Excelsra) -STD_ROM_FN(Excelsra) - -static struct BurnRomInfo HotmindRomDesc[] = { - { "21.u67", 0x20000, 0xe9000f7f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "22.u66", 0x20000, 0x2c518ec5, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "hotmind_pic16c57.hex", 0x02d4c, 0x11957803, BRF_ESS | BRF_PRG }, // 2 PIC16C57 HEX - - { "23.u36", 0x20000, 0xddcf60b9, BRF_GRA }, // 3 Tiles - { "27.u42", 0x20000, 0x413bbcf4, BRF_GRA }, // 4 Tiles - { "24.u39", 0x20000, 0x4baa5b4c, BRF_GRA }, // 5 Tiles - { "28.u45", 0x20000, 0x8df34d6a, BRF_GRA }, // 6 Tiles - - { "26.u86", 0x20000, 0xff8d3b75, BRF_GRA }, // 7 Sprites - { "30.u85", 0x20000, 0x87a640c7, BRF_GRA }, // 8 Sprites - { "25.u84", 0x20000, 0xc4fd4445, BRF_GRA }, // 9 Sprites - { "29.u83", 0x20000, 0x0bebfb53, BRF_GRA }, // 10 Sprites - - { "20.io13", 0x40000, 0x0bf3a3e5, BRF_SND }, // 11 Samples - - { "hotmind_pic16c57-hs_io15.hex", 0x02d4c, 0xf3300d13, BRF_OPT }, - { "palce16v8h-25-pc4_u58.jed", 0x00b89, 0xba88c1da, BRF_OPT }, - { "palce16v8h-25-pc4_u182.jed", 0x00b89, 0xba88c1da, BRF_OPT }, - { "palce16v8h-25-pc4_jamma.jed", 0x00b89, 0xba88c1da, BRF_OPT }, - { "tibpal22v10acnt_u113.jed", 0x01e84, 0x94106c63, BRF_OPT }, - { "tibpal22v10acnt_u183.jed", 0x01e84, 0x95a446b6, BRF_OPT }, - { "tibpal22v10acnt_u211.jed", 0x01e84, 0x94106c63, BRF_OPT }, -}; - -STD_ROM_PICK(Hotmind) -STD_ROM_FN(Hotmind) - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - pic16c5xReset(); - - MSM6295Reset(0); - - if (DrvEEPROMInUse) EEPROMReset(); - - DrvFgScrollX = 0; - DrvFgScrollY = 0; - DrvCharScrollX = 0; - DrvCharScrollY = 0; - DrvBgEnable = 0; - DrvBgFullSize = 0; - DrvBgScrollX = 0; - DrvBgScrollY = 0; - - DrvSoundCommand = 0; - DrvSoundFlag = 0; - DrvOkiControl = 0; - DrvOkiCommand = 0; - DrvOldOkiBank = 0; - DrvOkiBank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68kRom = Next; Next += Drv68kRomSize; - MSM6295ROM = Next; Next += 0x040000; - DrvMSM6295Src = Next; Next += DrvMSM6295RomSize; - DrvPicRom = Next; Next += 0x001000; - - RamStart = Next; - - Drv68kRam = Next; Next += 0x010000; - DrvSpriteRam = Next; Next += 0x001000; - DrvVideo1Ram = Next; Next += 0x008000; - DrvVideo2Ram = Next; Next += 0x004000; - DrvBgVideoRam = Next; Next += 0x080000; - DrvPaletteRam = Next; Next += 0x000800; - - RamEnd = Next; - - DrvSprites = Next; Next += (DrvNumSprites * DrvSpriteSize); - DrvTiles = Next; Next += (DrvNumTiles * DrvTileSize); - DrvChars = Next; Next += (DrvNumChars * DrvCharSize); - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -static inline void CalcCol(UINT16 Offset, UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 11) & 0x1e; - g = (nColour >> 7) & 0x1e; - b = (nColour >> 3) & 0x1e; - - r |= ((nColour & 0x08) >> 3); - g |= ((nColour & 0x04) >> 2); - b |= ((nColour & 0x02) >> 1); - - DrvPalette[Offset] = BurnHighCol(pal5bit(r), pal5bit(g), pal5bit(b), 0); -} - -UINT8 __fastcall DrvReadByte(UINT32 a) -{ - switch (a) { - case 0x700013: { - return 0xff - DrvInput[1]; - } - - case 0x700015: { - return 0xff - DrvInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); - } - } - - return 0; -} - -void __fastcall DrvWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x70001f: { - DrvSoundCommand = d; - DrvSoundFlag = 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall DrvReadWord(UINT32 a) -{ - switch (a) { - case 0x700010: { - return 0xffff - DrvInput[0]; - } - - case 0x70001a: { - return 0xff00 | DrvDip[0]; - } - - case 0x70001c: { - return 0xff00 | DrvDip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); - } - } - - return 0; -} - -void __fastcall DrvWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x501000 && a <= 0x501fff) { - // unused ram??? - return; - } - - if (a >= 0x504000 && a <= 0x50ffff) { - // unused ram??? - return; - } - - if (a >= 0x780000 && a <= 0x7807ff) { - UINT16 *PalRam = (UINT16*)DrvPaletteRam; - INT32 Offset = (a & 0x7ff) >> 1; - PalRam[Offset] = d; - CalcCol(Offset, d); - return; - } - - switch (a) { - case 0x304000: { - // irq ack??? - return; - } - - case 0x510000: { - DrvCharScrollX = (d + 2) & 0x1ff; - return; - } - - case 0x510002: { - DrvCharScrollY = d & 0xff; - return; - } - - case 0x510004: { - DrvBgScrollX = -(d + 4); - return; - } - - case 0x510006: { - DrvBgScrollY = -d & 0x1ff; - DrvBgEnable = d & 0x200; - DrvBgFullSize = d & 0x400; - return; - } - - case 0x510008: { - DrvFgScrollX = (d + 6) & 0x1ff; - return; - } - - case 0x51000a: { - DrvFgScrollY = d & 0x1ff; - return; - } - - case 0x51000c: { - // nop??? - return; - } - - case 0xe00000: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write word -> %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall ExcelsrReadByte(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); - } - } - - return 0; -} - -void __fastcall ExcelsrWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x70001f: { - DrvSoundCommand = d; - DrvSoundFlag = 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall ExcelsrReadWord(UINT32 a) -{ - switch (a) { - case 0x700010: { - return 0xffff - DrvInput[0]; - } - - case 0x700012: { - return 0xffff - DrvInput[1]; - } - - case 0x700014: { - return 0xffff - DrvInput[2]; - } - - case 0x70001a: { - return 0xff00 | DrvDip[0]; - } - - case 0x70001c: { - return 0xff00 | DrvDip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); - } - } - - return 0; -} - -void __fastcall ExcelsrWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x780000 && a <= 0x7807ff) { - UINT16 *PalRam = (UINT16*)DrvPaletteRam; - INT32 Offset = (a & 0x7ff) >> 1; - PalRam[Offset] = d; - CalcCol(Offset, d); - return; - } - - switch (a) { - case 0x304000: { - // nop - return; - } - - case 0x510000: { - DrvCharScrollX = (d + 2) & 0x1ff; - return; - } - - case 0x510002: { - DrvCharScrollY = d & 0xff; - return; - } - - case 0x510004: { - DrvBgScrollX = -d; - return; - } - - case 0x510006: { - DrvBgScrollY = (-d + 2) & 0x1ff; - DrvBgEnable = d & 0x200; - DrvBgFullSize = d & 0x400; - return; - } - - case 0x510008: { - DrvFgScrollX = (d + 6) & 0x1ff; - return; - } - - case 0x51000a: { - DrvFgScrollY = d & 0x1ff; - return; - } - - case 0x51000c: { - // nop??? - return; - } - - case 0xe00000: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write word -> %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall HotmindReadByte(UINT32 a) -{ - switch (a) { - case 0x300011: { - return 0xff - DrvInput[0]; - } - - case 0x300013: { - return 0xff - DrvInput[1]; - } - - case 0x300015: { - return 0x3f - DrvInput[2] + (DrvVBlank ? 0x00 : 0x40) + (EEPROMRead() ? 0x80 : 0x00); - } - - case 0x30001b: { - return DrvDip[0]; - } - - case 0x30001d: { - return DrvDip[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Read byte -> %06X\n"), a); - } - } - - return 0; -} - -void __fastcall HotmindWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x300015: { - EEPROMSetCSLine((d & 0x01) ? EEPROM_CLEAR_LINE : EEPROM_ASSERT_LINE ); - EEPROMWriteBit(d & 0x04); - EEPROMSetClockLine((d & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE ); - return; - } - - case 0x30001f: { - DrvSoundCommand = d; - DrvSoundFlag = 1; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write byte -> %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall HotmindReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); - } - } - - return 0; -} - -void __fastcall HotmindWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x280000 && a <= 0x2807ff) { - UINT16 *PalRam = (UINT16*)DrvPaletteRam; - INT32 Offset = (a & 0x7ff) >> 1; - PalRam[Offset] = d; - CalcCol(Offset, d); - return; - } - - switch (a) { - case 0x110000: { - DrvCharScrollX = (d + 14) & 0x1ff; - return; - } - - case 0x110002: { - DrvCharScrollY = d & 0x1ff; - return; - } - - case 0x110004: { - DrvFgScrollX = (d + 14) & 0x1ff; - return; - } - - case 0x110006: { - DrvFgScrollY = d & 0x1ff; - return; - } - - case 0x110008: { - DrvBgScrollX = (d + 14) & 0x1ff; - return; - } - - case 0x11000a: { - DrvBgScrollY = d & 0x1ff; - return; - } - - case 0x11000c: { - DrvScreenEnable = d & 0x01; - return; - } - - case 0x304000: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Write word -> %06X, %04X\n"), a, d); - } - } -} - -UINT8 PlaymarkSoundReadPort(UINT16 Port) -{ - switch (Port) { - case 0x01: { - UINT8 Data = 0; - - if ((DrvOkiControl & 0x38) == 0x30) { - Data = DrvSoundCommand; - } else { - if ((DrvOkiControl & 0x38) == 0x28) { - Data = MSM6295ReadStatus(0) & 0x0f; - } - } - - return Data; - } - - case 0x02: { - if (DrvSoundFlag) { - DrvSoundFlag = 0; - return 0x00; - } - return 0x40; - } - - case 0x10: { - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Sound Read Port %x\n"), Port); - } - } - - return 0; -} - -void PlaymarkSoundWritePort(UINT16 Port, UINT8 Data) -{ - switch (Port & 0xff) { - case 0x00: { - if (DrvMSM6295RomSize > 0x40000) { - if (DrvOldOkiBank != (Data & 0x07)) { - DrvOldOkiBank = Data & 0x07; - - if (((DrvOldOkiBank - 1) * 0x40000) < DrvMSM6295RomSize) { - memcpy(MSM6295ROM + 0x00000, DrvMSM6295Src + (0x40000 * (DrvOldOkiBank - 1)), 0x40000); - } - } - } - return; - } - - case 0x01: { - DrvOkiCommand = Data; - return; - } - - case 0x02: { - DrvOkiControl = Data; - - if ((Data & 0x38) == 0x18) { - MSM6295Command(0, DrvOkiCommand); - } - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Sound Write Port %x, %x\n"), Port, Data); - } - } -} - -static INT32 DrvCharPlaneOffsets[4] = { 0x600000, 0x400000, 0x200000, 0 }; -static INT32 DrvCharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 DrvCharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 DrvTilePlaneOffsets[4] = { 0x600000, 0x400000, 0x200000, 0 }; -static INT32 DrvTileXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 DrvTileYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 DrvSpritePlaneOffsets[4] = { 0x300000, 0x200000, 0x100000, 0 }; -static INT32 DrvSpriteXOffsets[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135, 256, 257, 258, 259, 260, 261, 262, 263, 384, 385, 386, 387, 388, 389, 390, 391 }; -static INT32 DrvSpriteYOffsets[32] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 512, 520, 528, 536, 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632 }; - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen; - - Drv68kRomSize = 0x100000; - DrvMSM6295RomSize = 0; - DrvNumTiles = 0x2000; - DrvTileSize = 16 * 16; - DrvNumChars = 0x2000; - DrvCharSize = 8 * 8; - DrvNumSprites = 0x400; - DrvSpriteSize = 32 * 32; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempGfx = (UINT8*)BurnMalloc(0x100000); - - nRet = BurnLoadRom(Drv68kRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68kRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - if (BurnLoadPicROM(DrvPicRom, 2, 0x2d4c)) return 1; - - nRet = BurnLoadRom(DrvTempGfx + 0x00000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x40000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x80000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0xc0000, 6, 1); if (nRet != 0) return 1; - GfxDecode(DrvNumTiles, 4, 16, 16, DrvTilePlaneOffsets, DrvTileXOffsets, DrvTileYOffsets, 0x100, DrvTempGfx, DrvTiles); - GfxDecode(DrvNumChars, 4, 8, 8, DrvCharPlaneOffsets, DrvCharXOffsets, DrvCharYOffsets, 0x100, DrvTempGfx, DrvChars); - - memset(DrvTempGfx, 0, 0x100000); - nRet = BurnLoadRom(DrvTempGfx + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x20000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x40000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x60000, 10, 1); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 32, 32, DrvSpritePlaneOffsets, DrvSpriteXOffsets, DrvSpriteYOffsets, 0x400, DrvTempGfx, DrvSprites); - BurnFree(DrvTempGfx); - - nRet = BurnLoadRom(MSM6295ROM, 11, 1); if (nRet != 0) return 1; - - BurnSetRefreshRate(58.0); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68kRom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0x440000, 0x4403ff, MAP_RAM); - SekMapMemory(DrvVideo2Ram , 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(DrvVideo1Ram , 0x502000, 0x503fff, MAP_RAM); - SekMapMemory(DrvBgVideoRam , 0x600000, 0x67ffff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x780000, 0x7807ff, MAP_READ); - SekMapMemory(Drv68kRam , 0xff0000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, DrvReadByte); - SekSetReadWordHandler(0, DrvReadWord); - SekSetWriteByteHandler(0, DrvWriteByte); - SekSetWriteWordHandler(0, DrvWriteWord); - SekClose(); - - pic16c5xInit(0, 0x16C57, DrvPicRom); - pic16c5xSetReadPortHandler(PlaymarkSoundReadPort); - pic16c5xSetWritePortHandler(PlaymarkSoundWritePort); - - MSM6295Init(0, 1000000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - DrawFunction = DrvRender; - nIRQLine = 2; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 ExcelsrTilePlaneOffsets[4] = { 0xc00000, 0x800000, 0x400000, 0 }; - -static INT32 ExcelsrInit() -{ - INT32 nRet = 0, nLen; - - Drv68kRomSize = 0x300000; - DrvMSM6295RomSize = 0x0c0000; - DrvNumTiles = 0x4000; - DrvTileSize = 16 * 16; - DrvNumChars = 0x4000; - DrvCharSize = 16 * 16; - DrvNumSprites = 0x4000; - DrvSpriteSize = 16 * 16; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempGfx = (UINT8*)BurnMalloc(0x200000); - - nRet = BurnLoadRom(Drv68kRom + 0x000000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68kRom + 0x000001, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68kRom + 0x100000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68kRom + 0x100001, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68kRom + 0x200000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68kRom + 0x200001, 5, 2); if (nRet != 0) return 1; - - if (BurnLoadPicROM(DrvPicRom, 6, 0x2d4c)) return 1; - - nRet = BurnLoadRom(DrvTempGfx + 0x000000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x080000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x100000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x180000, 10, 1); if (nRet != 0) return 1; - GfxDecode(DrvNumTiles, 4, 16, 16, ExcelsrTilePlaneOffsets, DrvTileXOffsets, DrvTileYOffsets, 0x100, DrvTempGfx, DrvTiles); - GfxDecode(DrvNumChars, 4, 16, 16, ExcelsrTilePlaneOffsets, DrvTileXOffsets, DrvTileYOffsets, 0x100, DrvTempGfx, DrvChars); - - memset(DrvTempGfx, 0, 0x200000); - nRet = BurnLoadRom(DrvTempGfx + 0x000000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x080000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x100000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x180000, 14, 1); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, ExcelsrTilePlaneOffsets, DrvTileXOffsets, DrvTileYOffsets, 0x100, DrvTempGfx, DrvSprites); - - nRet = BurnLoadRom(DrvTempGfx, 15, 1); if (nRet != 0) return 1; - memcpy(DrvMSM6295Src + 0x000000, DrvTempGfx + 0x000000, 0x20000); - memcpy(DrvMSM6295Src + 0x020000, DrvTempGfx + 0x020000, 0x20000); - memcpy(DrvMSM6295Src + 0x040000, DrvTempGfx + 0x000000, 0x20000); - memcpy(DrvMSM6295Src + 0x060000, DrvTempGfx + 0x040000, 0x20000); - memcpy(DrvMSM6295Src + 0x080000, DrvTempGfx + 0x000000, 0x20000); - memcpy(DrvMSM6295Src + 0x0a0000, DrvTempGfx + 0x060000, 0x20000); - BurnFree(DrvTempGfx); - memcpy(MSM6295ROM, DrvMSM6295Src, 0x40000); - - BurnSetRefreshRate(58.0); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68kRom , 0x000000, 0x2fffff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0x440000, 0x440fff, MAP_RAM); - SekMapMemory(DrvVideo2Ram , 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(DrvVideo1Ram , 0x501000, 0x501fff, MAP_RAM); - SekMapMemory(DrvBgVideoRam , 0x600000, 0x67ffff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x780000, 0x7807ff, MAP_READ); - SekMapMemory(Drv68kRam , 0xff0000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, ExcelsrReadByte); - SekSetReadWordHandler(0, ExcelsrReadWord); - SekSetWriteByteHandler(0, ExcelsrWriteByte); - SekSetWriteWordHandler(0, ExcelsrWriteWord); - SekClose(); - - pic16c5xInit(0, 0x16C57, DrvPicRom); - pic16c5xSetReadPortHandler(PlaymarkSoundReadPort); - pic16c5xSetWritePortHandler(PlaymarkSoundWritePort); - - MSM6295Init(0, 1000000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - DrawFunction = ExcelsrRender; - nIRQLine = 2; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 HotmindTilePlaneOffsets[4] = { 0x800008, 0x800000, 8, 0 }; -static INT32 HotmindTileXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 256, 257, 258, 259, 260, 261, 262, 263 }; -static INT32 HotmindTileYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; -static INT32 HotmindCharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 HotmindCharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 HotmindSpritePlaneOffsets[4] = { 0x200008, 0x200000, 8, 0 }; - -static const eeprom_interface hotmind_eeprom_intf = -{ - 6, /* address bits */ - 16, /* data bits */ - "*110", /* read command */ - "*101", /* write command */ - 0, /* erase command */ - "*10000xxxx", /* lock command */ - "*10011xxxx", /* unlock command */ - 0, /* enable_multi_read */ - 5 /* reset_delay (otherwise wbeachvl will hang when saving settings) */ -}; - -static INT32 HotmindInit() -{ - INT32 nRet = 0, nLen; - - Drv68kRomSize = 0x100000; - DrvMSM6295RomSize = 0; - DrvNumTiles = 0x4000; - DrvTileSize = 16 * 16; - DrvNumChars = 0x10000; - DrvCharSize = 8 * 8; - DrvNumSprites = 0x1000; - DrvSpriteSize = 16 * 16; - - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempGfx = (UINT8*)BurnMalloc(0x200000); - - nRet = BurnLoadRom(Drv68kRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68kRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - if (BurnLoadPicROM(DrvPicRom, 2, 0x2d4c)) return 1; - - nRet = BurnLoadRom(DrvTempGfx + 0x000000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x000001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x100000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x100001, 6, 2); if (nRet != 0) return 1; - memcpy(DrvTempGfx + 0x080000, DrvTempGfx + 0x020000, 0x20000); - memset(DrvTempGfx + 0x020000, 0x00, 0x20000); - memcpy(DrvTempGfx + 0x180000, DrvTempGfx + 0x120000, 0x20000); - memset(DrvTempGfx + 0x120000, 0x00, 0x20000); - GfxDecode(DrvNumTiles, 4, 16, 16, HotmindTilePlaneOffsets, HotmindTileXOffsets, HotmindTileYOffsets, 0x200, DrvTempGfx, DrvTiles); - GfxDecode(DrvNumChars, 4, 8, 8, HotmindTilePlaneOffsets, HotmindCharXOffsets, HotmindCharYOffsets, 0x80, DrvTempGfx, DrvChars); - - memset(DrvTempGfx, 0, 0x200000); - nRet = BurnLoadRom(DrvTempGfx + 0x00000, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x00001, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x40000, 9, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempGfx + 0x40001, 10, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, HotmindSpritePlaneOffsets, HotmindTileXOffsets, HotmindTileYOffsets, 0x200, DrvTempGfx, DrvSprites); - BurnFree(DrvTempGfx); - - nRet = BurnLoadRom(MSM6295ROM, 11, 1); if (nRet != 0) return 1; - - BurnSetRefreshRate(58.0); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68kRom , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvBgVideoRam , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(DrvVideo2Ram , 0x104000, 0x107fff, MAP_RAM); - SekMapMemory(DrvVideo1Ram , 0x108000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x280000, 0x2807ff, MAP_READ); - SekMapMemory(Drv68kRam , 0xff0000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, HotmindReadByte); - SekSetReadWordHandler(0, HotmindReadWord); - SekSetWriteByteHandler(0, HotmindWriteByte); - SekSetWriteWordHandler(0, HotmindWriteWord); - SekClose(); - - pic16c5xInit(0, 0x16C57, DrvPicRom); - pic16c5xSetReadPortHandler(PlaymarkSoundReadPort); - pic16c5xSetWritePortHandler(PlaymarkSoundWritePort); - - MSM6295Init(0, 1000000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&hotmind_eeprom_intf); - - DrawFunction = HotmindRender; - nIRQLine = 6; - DrvEEPROMInUse = 1; - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - pic16c5xExit(); - MSM6295Exit(0); - - GenericTilesExit(); - - BurnFree(Mem); - - DrvFgScrollX = 0; - DrvFgScrollY = 0; - DrvCharScrollX = 0; - DrvCharScrollY = 0; - DrvBgEnable = 0; - DrvBgFullSize = 0; - DrvBgScrollX = 0; - DrvBgScrollY = 0; - DrvScreenEnable = 0; - DrvVBlank = 0; - DrvEEPROMInUse = 0; - - DrvSoundCommand = 0; - DrvSoundFlag = 0; - DrvOkiControl = 0; - DrvOkiCommand = 0; - DrvOldOkiBank = 0; - DrvOkiBank = 0; - - Drv68kRomSize = 0; - DrvMSM6295RomSize = 0; - DrvNumTiles = 0; - DrvTileSize = 0; - DrvNumChars = 0; - DrvCharSize = 0; - DrvNumSprites = 0; - DrvSpriteSize = 0; - - nIRQLine = 2; - - DrawFunction = NULL; - - return 0; -} - -static void DrvRenderFgLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - INT32 ClipHeight = nScreenHeight - 16; - - UINT16 *VideoRam = (UINT16*)DrvVideo2Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[(TileIndex * 2) + 0]); - Colour = BURN_ENDIAN_SWAP_INT16(VideoRam[(TileIndex * 2) + 1]); - - x = 16 * mx; - y = 16 * my; - - x -= DrvFgScrollX; - y -= DrvFgScrollY; - if (x < -16) x += 512; - if (y < -16) y += 512; - - y -= 16; - - if (x > 16 && x < 304 && y > 16 && y < ClipHeight) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 0, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0, DrvTiles); - } - - TileIndex++; - } - } -} - -static void HotmindRenderTileLayer(INT32 Layer) -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - INT32 ClipHeight = nScreenHeight - 16; - - UINT16 *VideoRam = (UINT16*)DrvBgVideoRam; - if (Layer == 1) VideoRam = (UINT16*)DrvVideo2Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Colour = Code & 0xe000; - Code &= 0x1fff; - Colour >>= 13; - - if (Layer == 1) { - Code += 0x2000; - Colour += 8; - } - - x = 16 * mx; - y = 16 * my; - - x -= DrvFgScrollX; - y -= DrvFgScrollY; - if (x < -16) x += 512; - if (y < -16) y += 512; - y -= 16; - - if (Layer == 0) { - if (x > 16 && x < 304 && y > 16 && y < ClipHeight) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 0, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0, DrvTiles); - } - } - - if (Layer == 1) { - if (x > 16 && x < 304 && y > 16 && y < ClipHeight) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvTiles); - } - } - - TileIndex++; - } - } -} - -static void DrvRenderCharLayer(INT32 Columns, INT32 CharSize) -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - INT32 ClipHeight = nScreenHeight - CharSize; - - UINT16 *VideoRam = (UINT16*)DrvVideo1Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < Columns; mx++) { - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[(TileIndex * 2) + 0]); - Colour = BURN_ENDIAN_SWAP_INT16(VideoRam[(TileIndex * 2) + 1]); - - x = CharSize * mx; - y = CharSize * my; - - x -= DrvCharScrollX; - y -= DrvCharScrollY; - if (x < -8) x += (CharSize * Columns); - if (y < -8) y += 256; - - y -= 16; - - if (CharSize == 8) { - if (x > 8 && x < 312 && y > 8 && y < ClipHeight) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0x80, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0x80, DrvChars); - } - } - - if (CharSize == 16) { - if (x > 16 && x < 304 && y > 16 && y < ClipHeight) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0x80, DrvChars); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0x80, DrvChars); - } - } - - TileIndex++; - } - } -} - -static void HotmindRenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - INT32 ClipHeight = nScreenHeight - 8; - - UINT16 *VideoRam = (UINT16*)DrvVideo1Ram; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Colour = Code & 0xe000; - Code &= 0x3fff; - Colour >>= 13; - Code += 0x9800; - - x = mx * 64; - y = my * 64; - - x -= DrvCharScrollX; - y -= DrvCharScrollY; - if (x < -8) x += 512; - if (y < -8) y += 512; - - y -= 16; - - if (x > 8 && x < 312 && y > 8 && y < ClipHeight) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0x100, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0x100, DrvChars); - } - - TileIndex++; - } - } -} - -static void DrvRenderSprites(INT32 CodeShift, INT32 SpriteRamSize, INT32 SpriteSize, INT32 PriDraw, INT32 xOffset, INT32 yOffset) -{ - INT32 Offs; - INT32 ColourDiv = 0x10 / 16; - UINT16 *SpriteRam = (UINT16*)DrvSpriteRam; - INT32 ClipHeight = nScreenHeight - SpriteSize; - - for (Offs = 0; Offs < SpriteRamSize; Offs += 4) { - INT32 sx, sy, Code, Colour, xFlip, Pri; - - sy = SpriteRam[Offs + 3 - 4]; - if (sy == 0x2000) break; - - Pri = (SpriteRam[Offs + 1] & 0x8000) >> 15; - Colour = ((SpriteRam[Offs + 1] & 0x3e00) >> 9) / ColourDiv; - if(!Pri && (Colour & 0x0c) == 0x0c) Pri = 2; - - if (Pri == PriDraw || PriDraw == -1) { - xFlip = sy & 0x4000; - sx = (SpriteRam[Offs + 1] & 0x01ff) - 16 - 7; - sy = (256 - 8 - SpriteSize - sy) & 0xff; - Code = SpriteRam[Offs + 2] >> CodeShift; - Code &= (DrvNumSprites - 1); - - sy -= 16; - sx += xOffset; - sy += yOffset; - - if (SpriteSize == 16) { - if (sx > 16 && sx < 304 && sy > 16 && sy < ClipHeight) { - if (xFlip) { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, 4, 0, 0x200, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour, 4, 0, 0x200, DrvSprites); - } - } else { - if (xFlip) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0x200, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0x200, DrvSprites); - } - } - } - - if (SpriteSize == 32) { - if (sx > 32 && sx < 288 && sy > 32 && sy < ClipHeight) { - if (xFlip) { - Render32x32Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, 4, 0, 0x200, DrvSprites); - } else { - Render32x32Tile_Mask(pTransDraw, Code, sx, sy, Colour, 4, 0, 0x200, DrvSprites); - } - } else { - if (xFlip) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0x200, DrvSprites); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0x200, DrvSprites); - } - } - } - } - } -} - -static void DrvRenderBitmap() -{ - INT32 Colour; - UINT16 *VideoRam = (UINT16*)DrvBgVideoRam; - INT32 Count = 0; - - for (INT32 y = 0; y < 512; y++) { - for (INT32 x = 0; x < 512; x++) { - Colour = VideoRam[Count] & 0xff; - - if (Colour) { - if (DrvBgFullSize) { - INT32 yPlot = (y - 16 + DrvBgScrollY) & 0x1ff; - INT32 xPlot = (x + DrvBgScrollX) & 0x1ff; - - if (xPlot >= 0 && xPlot < 320 && yPlot >= 0 && yPlot < nScreenHeight) { - pTransDraw[(yPlot * nScreenWidth) + xPlot] = 0x100 + Colour; - } - } else { - // 50% size - if(!(x % 2) && !(y % 2)) { - // untested for now - INT32 yPlot = ((y / 2) - 16 + DrvBgScrollY) & 0x1ff; - INT32 xPlot = ((x / 2) + DrvBgScrollX) & 0x1ff; - - if (xPlot >= 0 && xPlot < 320 && yPlot >= 0 && yPlot < nScreenHeight) { - pTransDraw[(yPlot * nScreenWidth) + xPlot] = 0x100 + Colour; - } - } - } - } - - Count++; - } - } -} - -static void DrvRender() -{ - BurnTransferClear(); - DrvRenderFgLayer(); - if (DrvBgEnable) DrvRenderBitmap(); - DrvRenderSprites(4, 0x400, 32, -1, 0, 0); - DrvRenderCharLayer(64, 8); - BurnTransferCopy(DrvPalette); -} - -static void ExcelsrRender() -{ - BurnTransferClear(); - DrvRenderFgLayer(); - DrvRenderSprites(2, 0xd00, 16, 2, 0, 0); - if (DrvBgEnable) DrvRenderBitmap(); - DrvRenderSprites(2, 0xd00, 16, 1, 0, 0); - DrvRenderCharLayer(32, 16); - DrvRenderSprites(2, 0xd00, 16, 0, 0, 0); - BurnTransferCopy(DrvPalette); -} - -static void HotmindRender() -{ - BurnTransferClear(); - if (DrvScreenEnable) { - HotmindRenderTileLayer(0); - HotmindRenderTileLayer(1); - DrvRenderSprites(2, 0x1000, 16, 2, -9, -8); - DrvRenderSprites(2, 0x1000, 16, 1, -9, -8); - DrvRenderSprites(2, 0x1000, 16, 0, -9, -8); - HotmindRenderCharLayer(); - } - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 100; - INT32 nSoundBufferPos = 0; - DrvVBlank = 0; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = (INT32)((double)12000000 / 58.0); - nCyclesTotal[1] = (INT32)((double)3000000 / 58.0); - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - - SekOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 90) { - DrvVBlank = 1; - SekSetIRQLine(nIRQLine, CPU_IRQSTATUS_AUTO); - } - - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += pic16c5xRun(nCyclesSegment); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - SekClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) DrawFunction(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x02729; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - return 0; -} - -struct BurnDriver BurnDrvBigtwin = { - "bigtwin", NULL, NULL, NULL, "1995", - "Big Twin\0", NULL, "Playmark", "Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, BigtwinRomInfo, BigtwinRomName, NULL, NULL, BigtwinInputInfo, BigtwinDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvExcelsr = { - "excelsr", NULL, NULL, NULL, "1996", - "Excelsior (set 1)\0", NULL, "Playmark", "Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, ExcelsrRomInfo, ExcelsrRomName, NULL, NULL, ExcelsrInputInfo, ExcelsrDIPInfo, - ExcelsrInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvExcelsra = { - "excelsra", "excelsr", NULL, NULL, "1996", - "Excelsior (set 2)\0", NULL, "Playmark", "Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, ExcelsraRomInfo, ExcelsraRomName, NULL, NULL, ExcelsrInputInfo, ExcelsrDIPInfo, - ExcelsrInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvHotmind = { - "hotmind", NULL, NULL, NULL, "1996", - "Hot Mind (Hard Times hardware)\0", NULL, "Playmark", "Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, HotmindRomInfo, HotmindRomName, NULL, NULL, HotmindInputInfo, HotmindDIPInfo, - HotmindInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x400, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_powerins.cpp b/jan/src/burn/drv/pst90s/d_powerins.cpp deleted file mode 100644 index cb8d458df..000000000 --- a/jan/src/burn/drv/pst90s/d_powerins.cpp +++ /dev/null @@ -1,1198 +0,0 @@ -/*************************************************************** - Power Instinct - (C) 1993 Atlus - driver by Luca Elia (l.elia@tin.it) - *************************************************************** - port to Finalburn Alpha by OopsWare. 2007 - ***************************************************************/ - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" -#include "nmk112.h" -#include "burn_ym2203.h" - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; - -static UINT8 *Rom68K; -static UINT8 *RomZ80; -static UINT8 *RomBg; -static UINT8 *RomFg; -static UINT8 *RomSpr; - -static UINT8 *RamZ80; -static UINT16 *RamPal; -static UINT16 *RamBg; -static UINT16 *RamFg; -static UINT16 *RamSpr; -static UINT16 *RamVReg; - -static UINT32 *RamCurPal; - -static UINT8 DrvButton[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvJoy1[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvJoy2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static UINT8 DrvInput[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - -static UINT8 bRecalcPalette = 0; -static UINT8 DrvReset = 0; - -static UINT32 tile_bank; -static INT32 m6295size; -static UINT16 soundlatch = 0; -static INT32 oki_bank = -1; - -#define GAME_POWERINS 1 -#define GAME_POWERINA 2 -#define GAME_POWERINB 3 - -static INT32 game_drv = 0; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -inline static void CalcCol(INT32 idx) -{ - /* RRRR GGGG BBBB RGBx */ - UINT16 wordValue = RamPal[idx]; - INT32 r = ((wordValue >> 8) & 0xF0 ) | ((wordValue << 0) & 0x08) | ((wordValue >> 13) & 0x07 ); - INT32 g = ((wordValue >> 4) & 0xF0 ) | ((wordValue << 1) & 0x08) | ((wordValue >> 9) & 0x07 ); - INT32 b = ((wordValue >> 0) & 0xF0 ) | ((wordValue << 2) & 0x08) | ((wordValue >> 5) & 0x07 ); - RamCurPal[idx] = BurnHighCol(r, g, b, 0); -} - -static struct BurnInputInfo powerinsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 3, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 4, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 5, "diag"}, - {"Service", BIT_DIGITAL, DrvButton + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 6, "dip"}, -}; - -STDINPUTINFO(powerins) - -static struct BurnDIPInfo powerinsDIPList[] = { - - // Defaults - {0x17, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Free play"}, - {0x17, 0x01, 0x01, 0x00, "Off"}, - {0x17, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 8, "Coin 1"}, - {0x17, 0x01, 0x70, 0x30, "4 coins 1 credit"}, - {0x17, 0x01, 0x70, 0x50, "3 coins 1 credit"}, - {0x17, 0x01, 0x70, 0x10, "2 coins 1 credit"}, - {0x17, 0x01, 0x70, 0x00, "1 coin 1 credit"}, - {0x17, 0x01, 0x70, 0x40, "1 coin 2 credits"}, - {0x17, 0x01, 0x70, 0x20, "1 coin 3 credits"}, - {0x17, 0x01, 0x70, 0x60, "1 coin 4 credits"}, - {0x17, 0x01, 0x70, 0x70, "2 coins to start, 1 to continue"}, - {0, 0xFE, 0, 8, "Coin 2"}, - {0x17, 0x01, 0x0E, 0x06, "4 coins 1 credit"}, - {0x17, 0x01, 0x0E, 0x0A, "3 coins 1 credit"}, - {0x17, 0x01, 0x0E, 0x02, "2 coins 1 credit"}, - {0x17, 0x01, 0x0E, 0x00, "1 coin 1 credit"}, - {0x17, 0x01, 0x0E, 0x08, "1 coin 2 credits"}, - {0x17, 0x01, 0x0E, 0x04, "1 coin 3 credits"}, - {0x17, 0x01, 0x0E, 0x0C, "1 coin 4 credits"}, - {0x17, 0x01, 0x0E, 0x0E, "2 coins to start, 1 to continue"}, - {0, 0xFE, 0, 2, "Flip screen"}, - {0x17, 0x01, 0x80, 0x00, "Off"}, - {0x17, 0x01, 0x80, 0x80, "On"}, - -}; - -static struct BurnDIPInfo powerinaDIPList[] = { - - // Defaults - {0x18, 0xFF, 0xFF, 0x04, NULL}, - - // DIP 2 - {0, 0xFE, 0, 2, "Coin chutes"}, - {0x18, 0x01, 0x01, 0x00, "1 chute"}, - {0x18, 0x01, 0x01, 0x01, "2 chutes"}, - {0, 0xFE, 0, 2, "Join In mode"}, - {0x18, 0x01, 0x02, 0x00, "Off"}, - {0x18, 0x01, 0x02, 0x02, "On"}, - {0, 0xFE, 0, 2, "Demo sounds"}, - {0x18, 0x01, 0x04, 0x00, "Off"}, - {0x18, 0x01, 0x04, 0x04, "On"}, - {0, 0xFE, 0, 2, "Allow continue"}, - {0x18, 0x01, 0x08, 0x08, "Off"}, - {0x18, 0x01, 0x08, 0x00, "On"}, - {0, 0xFE, 0, 2, "Blood color"}, - {0x18, 0x01, 0x10, 0x00, "Red"}, - {0x18, 0x01, 0x10, 0x10, "Blue"}, - {0, 0xFE, 0, 2, "Game time"}, - {0x18, 0x01, 0x20, 0x00, "Normal"}, - {0x18, 0x01, 0x20, 0x20, "Short"}, - {0, 0xFE, 0, 4, "Difficulty"}, - {0x18, 0x01, 0xC0, 0x80, "Easy"}, - {0x18, 0x01, 0xC0, 0x00, "Normal"}, - {0x18, 0x01, 0xC0, 0x40, "Hard"}, - {0x18, 0x01, 0xC0, 0xC0, "Hardest"}, - -}; - -static struct BurnDIPInfo powerinjDIPList[] = { - - // Defaults - {0x18, 0xFF, 0xFF, 0x04, NULL}, - - // DIP 2 -// {0, 0xFE, 0, 2, "Unknown"}, -// {0x18, 0x01, 0x01, 0x00, "Off"}, -// {0x18, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Join In mode"}, - {0x18, 0x01, 0x02, 0x00, "Off"}, - {0x18, 0x01, 0x02, 0x02, "On"}, - {0, 0xFE, 0, 2, "Demo sounds"}, - {0x18, 0x01, 0x04, 0x00, "Off"}, - {0x18, 0x01, 0x04, 0x04, "On"}, - {0, 0xFE, 0, 2, "Allow continue"}, - {0x18, 0x01, 0x08, 0x08, "Off"}, - {0x18, 0x01, 0x08, 0x00, "On"}, - {0, 0xFE, 0, 2, "Blood color"}, - {0x18, 0x01, 0x10, 0x00, "Red"}, - {0x18, 0x01, 0x10, 0x10, "Blue"}, - {0, 0xFE, 0, 2, "Game time"}, - {0x18, 0x01, 0x20, 0x00, "Normal"}, - {0x18, 0x01, 0x20, 0x20, "Short"}, - {0, 0xFE, 0, 4, "Difficulty"}, - {0x18, 0x01, 0xC0, 0x80, "Easy"}, - {0x18, 0x01, 0xC0, 0x00, "Normal"}, - {0x18, 0x01, 0xC0, 0x40, "Hard"}, - {0x18, 0x01, 0xC0, 0xC0, "Hardest"}, - -}; - -STDDIPINFOEXT(powerins, powerins, powerina) -STDDIPINFOEXT(powerinj, powerins, powerinj) - -// Rom information - -static struct BurnRomInfo powerinsRomDesc[] = { - { "93095-3a.u108", 0x080000, 0x9825ea3d, BRF_ESS | BRF_PRG }, // 68000 code - { "93095-4.u109", 0x080000, 0xd3d7a782, BRF_ESS | BRF_PRG }, - - { "93095-2.u90", 0x020000, 0x4b123cc6, BRF_ESS | BRF_PRG }, // Z80 code - - { "93095-5.u16", 0x100000, 0xb1371808, BRF_GRA }, // layer 0 - { "93095-6.u17", 0x100000, 0x29c85d80, BRF_GRA }, - { "93095-7.u18", 0x080000, 0x2dd76149, BRF_GRA }, - - { "93095-1.u15", 0x020000, 0x6a579ee0, BRF_GRA }, // layer 1 - - { "93095-12.u116", 0x100000, 0x35f3c2a3, BRF_GRA }, - { "93095-13.u117", 0x100000, 0x1ebd45da, BRF_GRA }, - { "93095-14.u118", 0x100000, 0x760d871b, BRF_GRA }, - { "93095-15.u119", 0x100000, 0xd011be88, BRF_GRA }, - { "93095-16.u120", 0x100000, 0xa9c16c9c, BRF_GRA }, - { "93095-17.u121", 0x100000, 0x51b57288, BRF_GRA }, - { "93095-18.u122", 0x100000, 0xb135e3f2, BRF_GRA }, - { "93095-19.u123", 0x100000, 0x67695537, BRF_GRA }, - - { "93095-10.u48", 0x100000, 0x329ac6c5, BRF_SND }, // sound 1 - { "93095-11.u49", 0x100000, 0x75d6097c, BRF_SND }, - - { "93095-8.u46", 0x100000, 0xf019bedb, BRF_SND }, // sound 2 - { "93095-9.u47", 0x100000, 0xadc83765, BRF_SND }, - - { "22.u81", 0x000020, 0x67d5ec4b, BRF_OPT }, // unknown - { "21.u71", 0x000100, 0x182cd81f, BRF_OPT }, - { "20.u54", 0x000100, 0x38bd0e2f, BRF_OPT }, - -}; - -STD_ROM_PICK(powerins) -STD_ROM_FN(powerins) - -static struct BurnRomInfo powerinjRomDesc[] = { - { "93095-3j.u108", 0x080000, 0x3050a3fb, BRF_ESS | BRF_PRG }, // 68000 code - { "93095-4.u109", 0x080000, 0xd3d7a782, BRF_ESS | BRF_PRG }, - - { "93095-2.u90", 0x020000, 0x4b123cc6, BRF_ESS | BRF_PRG }, // Z80 code - - { "93095-5.u16", 0x100000, 0xb1371808, BRF_GRA }, // layer 0 - { "93095-6.u17", 0x100000, 0x29c85d80, BRF_GRA }, - { "93095-7.u18", 0x080000, 0x2dd76149, BRF_GRA }, - - { "93095-1.u15", 0x020000, 0x6a579ee0, BRF_GRA }, // layer 1 - - { "93095-12.u116", 0x100000, 0x35f3c2a3, BRF_GRA }, - { "93095-13.u117", 0x100000, 0x1ebd45da, BRF_GRA }, - { "93095-14.u118", 0x100000, 0x760d871b, BRF_GRA }, - { "93095-15.u119", 0x100000, 0xd011be88, BRF_GRA }, - { "93095-16.u120", 0x100000, 0xa9c16c9c, BRF_GRA }, - { "93095-17.u121", 0x100000, 0x51b57288, BRF_GRA }, - { "93095-18.u122", 0x100000, 0xb135e3f2, BRF_GRA }, - { "93095-19.u123", 0x100000, 0x67695537, BRF_GRA }, - - { "93095-10.u48", 0x100000, 0x329ac6c5, BRF_SND }, // sound 1 - { "93095-11.u49", 0x100000, 0x75d6097c, BRF_SND }, - - { "93095-8.u46", 0x100000, 0xf019bedb, BRF_SND }, // sound 2 - { "93095-9.u47", 0x100000, 0xadc83765, BRF_SND }, - - { "22.u81", 0x000020, 0x67d5ec4b, BRF_OPT }, // unknown - { "21.u71", 0x000100, 0x182cd81f, BRF_OPT }, - { "20.u54", 0x000100, 0x38bd0e2f, BRF_OPT }, - -}; - -STD_ROM_PICK(powerinj) -STD_ROM_FN(powerinj) - -static struct BurnRomInfo powerinaRomDesc[] = { - { "rom1", 0x080000, 0xb86c84d6, BRF_ESS | BRF_PRG }, // 68000 code - { "rom2", 0x080000, 0xd3d7a782, BRF_ESS | BRF_PRG }, - - { "rom6", 0x200000, 0xb6c10f80, BRF_GRA }, // layer 0 - { "rom4", 0x080000, 0x2dd76149, BRF_GRA }, - - { "rom3", 0x020000, 0x6a579ee0, BRF_GRA }, // layer 1 - - { "rom10", 0x200000, 0xefad50e8, BRF_GRA }, // sprites - { "rom9", 0x200000, 0x08229592, BRF_GRA }, - { "rom8", 0x200000, 0xb02fdd6d, BRF_GRA }, - { "rom7", 0x200000, 0x92ab9996, BRF_GRA }, - - { "rom5", 0x080000, 0x88579c8f, BRF_SND }, // sound 1 -}; - -STD_ROM_PICK(powerina) -STD_ROM_FN(powerina) - -static struct BurnRomInfo powerinbRomDesc[] = { - { "2q.bin", 0x080000, 0x11bf3f2a, BRF_ESS | BRF_PRG }, // 68000 code - { "2r.bin", 0x080000, 0xd8d621be, BRF_ESS | BRF_PRG }, - - { "1f.bin", 0x020000, 0x4b123cc6, BRF_ESS | BRF_PRG }, // Z80 code - - { "13k.bin", 0x080000, 0x1975b4b8, BRF_GRA }, // layer 0 - { "13l.bin", 0x080000, 0x376e4919, BRF_GRA }, - { "13o.bin", 0x080000, 0x0d5ff532, BRF_GRA }, - { "13q.bin", 0x080000, 0x99b25791, BRF_GRA }, - { "13r.bin", 0x080000, 0x2dd76149, BRF_GRA }, - - { "6n.bin", 0x020000, 0x6a579ee0, BRF_GRA }, // layer 1 - - { "14g.bin", 0x080000, 0x8b9b89c9, BRF_GRA }, - { "11g.bin", 0x080000, 0x4d127bdf, BRF_GRA }, - { "13g.bin", 0x080000, 0x298eb50e, BRF_GRA }, - { "11i.bin", 0x080000, 0x57e6d283, BRF_GRA }, - { "12g.bin", 0x080000, 0xfb184167, BRF_GRA }, - { "11j.bin", 0x080000, 0x1b752a4d, BRF_GRA }, - { "14m.bin", 0x080000, 0x2f26ba7b, BRF_GRA }, - { "11k.bin", 0x080000, 0x0263d89b, BRF_GRA }, - { "14n.bin", 0x080000, 0xc4633294, BRF_GRA }, - { "11l.bin", 0x080000, 0x5e4b5655, BRF_GRA }, - { "14p.bin", 0x080000, 0x4d4b0e4e, BRF_GRA }, - { "11o.bin", 0x080000, 0x7e9f2d2b, BRF_GRA }, - { "13p.bin", 0x080000, 0x0e7671f2, BRF_GRA }, - { "11p.bin", 0x080000, 0xee59b1ec, BRF_GRA }, - { "12p.bin", 0x080000, 0x9ab1998c, BRF_GRA }, - { "11q.bin", 0x080000, 0x1ab0c88a, BRF_GRA }, - - { "4a.bin", 0x080000, 0x8cd6824e, BRF_SND }, // sound 1 - { "4b.bin", 0x080000, 0xe31ae04d, BRF_SND }, - { "4c.bin", 0x080000, 0xc4c9f599, BRF_SND }, - { "4d.bin", 0x080000, 0xf0a9f0e1, BRF_SND }, - - { "5a.bin", 0x080000, 0x62557502, BRF_SND }, // sound 2 - { "5b.bin", 0x080000, 0xdbc86bd7, BRF_SND }, - { "5c.bin", 0x080000, 0x5839a2bd, BRF_SND }, - { "5d.bin", 0x080000, 0x446f9dc3, BRF_SND }, - - { "82s123.bin", 0x000020, 0x67d5ec4b, BRF_OPT }, // unknown - { "82s147.bin", 0x000200, 0xd7818542, BRF_OPT }, - -}; - -STD_ROM_PICK(powerinb) -STD_ROM_FN(powerinb) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom68K = Next; Next += 0x0100000; // 68000 ROM - RomZ80 = Next; Next += 0x0020000; // Z80 ROM - RomBg = Next; Next += 0x0500000; - RomFg = Next; Next += 0x0100000; - RomSpr = Next; Next += 0x1000000; - MSM6295ROM = Next; Next += m6295size; - - RamStart = Next; - - RamZ80 = Next; Next += 0x002000; - - RamPal = (UINT16 *) Next; Next += 0x001000; - RamBg = (UINT16 *) Next; Next += 0x004000; - RamFg = (UINT16 *) Next; Next += 0x001000; - RamSpr = (UINT16 *) Next; Next += 0x010000; - RamVReg = (UINT16 *) Next; Next += 0x000008; - - RamEnd = Next; - - RamCurPal = (UINT32 *) Next; Next += 0x000800 * sizeof(UINT32); - - MemEnd = Next; - return 0; -} - -UINT8 __fastcall powerinsReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x10003f: - return MSM6295ReadStatus(0); - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -UINT16 __fastcall powerinsReadWord(UINT32 sekAddress) -{ - switch (sekAddress) - { - case 0x100000: - return ~DrvInput[0]; - - case 0x100002: - return ~(DrvInput[2] + (DrvInput[3]<<8)); - - case 0x100008: - return ~DrvInput[4]; - - case 0x10000A: - return ~DrvInput[6]; - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall powerinsWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) - { - case 0x100031: - // powerins_okibank - if (oki_bank != (byteValue & 7)) { - oki_bank = byteValue & 7; - MSM6295SetBank(0, MSM6295ROM + 0x40000 + 0x10000*oki_bank, 0x30000, 0x3ffff); - } - break; - - case 0x10003e: - // powerina only! - break; - - case 0x10003f: - // powerina only! - MSM6295Command(0, byteValue); - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall powerinsWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) - { - case 0x100014: - // powerins_flipscreen_w - break; - - case 0x100018: - // powerins_tilebank_w - tile_bank = wordValue * 0x800; - break; - - case 0x10001e: - //powerins_soundlatch_w - soundlatch = wordValue & 0xff; - break; - - case 0x10003e: - // powerina only! - MSM6295Command(0, wordValue & 0xff); - break; - - case 0x130000: RamVReg[0] = wordValue; break; - case 0x130002: RamVReg[1] = wordValue; break; - case 0x130004: RamVReg[2] = wordValue; break; - case 0x130006: RamVReg[3] = wordValue; break; - - case 0x100016: // NOP - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -void __fastcall powerinsWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - sekAddress -= 0x120000; - sekAddress >>= 1; - RamPal[sekAddress] = wordValue; - CalcCol( sekAddress ); -} - -UINT8 __fastcall powerinsZ80Read(UINT16 a) -{ - switch (a) - { - case 0xE000: - return soundlatch; - -// default: -// bprintf(PRINT_NORMAL, _T("Z80 Attempt to read value of location %04x\n"), a); - } - - return 0; -} - -#if 1 && defined FBA_DEBUG -void __fastcall powerinsZ80Write(UINT16 a,UINT8 v) -{ - switch (a) { - case 0xE000: - case 0xE001: - break; - - default: - bprintf(PRINT_NORMAL, _T("Z80 Attempt to write value %x to location %x\n"), v, a); - } -} -#endif - -UINT8 __fastcall powerinsZ80In(UINT16 p) -{ - switch (p & 0xFF) - { - case 0x00: - if ( game_drv == GAME_POWERINS ) - return BurnYM2203Read(0, 0); - else - return 0x01; - - case 0x01: - if ( game_drv == GAME_POWERINS ) - return BurnYM2203Read(0, 1); - else - return 0; - - case 0x80: - return MSM6295ReadStatus(0); - - case 0x88: - return MSM6295ReadStatus(1); - -// default: -// bprintf(PRINT_NORMAL, _T("Z80 Attempt to read port %04x\n"), p); - } - - return 0; -} - -void __fastcall powerinsZ80Out(UINT16 p, UINT8 v) -{ - switch (p & 0x0FF) { - case 0x00: - if ( game_drv == GAME_POWERINS ) { - BurnYM2203Write(0, 0, v); - } - break; - - case 0x01: - if ( game_drv == GAME_POWERINS ) { - BurnYM2203Write(0, 1, v); - } - break; - - case 0x80: - MSM6295Command(0, v); - break; - - case 0x88: - MSM6295Command(1, v); - break; - - case 0x90: - case 0x91: - case 0x92: - case 0x93: - case 0x94: - case 0x95: - case 0x96: - case 0x97: - NMK112_okibank_write(p & 7, v); - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Z80 Attempt to write %02x to port %04x\n"), v, p); - } -} - -static void powerinsIRQHandler(INT32, INT32 nStatus) -{ -// bprintf(PRINT_NORMAL, _T("powerinsIRQHandler %i\n"), nStatus); - - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 powerinsSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -static double powerinsGetTime() -{ - return (double)ZetTotalCycles() / 6000000; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - SekReset(); - SekClose(); - - MSM6295Reset(0); - - if (game_drv != GAME_POWERINA) { - ZetOpen(0); - ZetReset(); - ZetClose(); - - if (game_drv == GAME_POWERINS) BurnYM2203Reset(); - - MSM6295Reset(1); - - NMK112Reset(); - } - - return 0; -} - -static void LoadDecodeBgRom(UINT8 *tmp, UINT8 * dest, INT32 id, INT32 size) -{ - BurnLoadRom(tmp, id, 1); - - for (INT32 z=0;z<(size/128);z++) { - for (INT32 y=0;y<16;y++) { - dest[ 0] = tmp[ 0] >> 4; - dest[ 1] = tmp[ 0] & 15; - dest[ 2] = tmp[ 1] >> 4; - dest[ 3] = tmp[ 1] & 15; - - dest[ 4] = tmp[ 2] >> 4; - dest[ 5] = tmp[ 2] & 15; - dest[ 6] = tmp[ 3] >> 4; - dest[ 7] = tmp[ 3] & 15; - - dest[ 8] = tmp[64] >> 4; - dest[ 9] = tmp[64] & 15; - dest[10] = tmp[65] >> 4; - dest[11] = tmp[65] & 15; - - dest[12] = tmp[66] >> 4; - dest[13] = tmp[66] & 15; - dest[14] = tmp[67] >> 4; - dest[15] = tmp[67] & 15; - - dest += 16; - tmp += 4; - } - tmp += 64; - } -} - -static void LoadDecodeSprRom(UINT8 *tmp, UINT8 * dest, INT32 id, INT32 size) -{ - if ( game_drv == GAME_POWERINB ) { - BurnLoadRom(tmp + 0, 9 + id*2, 2); - BurnLoadRom(tmp + 1, 10 + id*2, 2); - } else - BurnLoadRom(tmp, id, 1); - - for (INT32 z=0;z<(size/128);z++) { - for (INT32 y=0;y<16;y++) { - dest[ 0] = tmp[ 1] >> 4; - dest[ 1] = tmp[ 1] & 15; - dest[ 2] = tmp[ 0] >> 4; - dest[ 3] = tmp[ 0] & 15; - - dest[ 4] = tmp[ 3] >> 4; - dest[ 5] = tmp[ 3] & 15; - dest[ 6] = tmp[ 2] >> 4; - dest[ 7] = tmp[ 2] & 15; - - dest[ 8] = tmp[65] >> 4; - dest[ 9] = tmp[65] & 15; - dest[10] = tmp[64] >> 4; - dest[11] = tmp[64] & 15; - - dest[12] = tmp[67] >> 4; - dest[13] = tmp[67] & 15; - dest[14] = tmp[66] >> 4; - dest[15] = tmp[66] & 15; - - dest += 16; - tmp += 4; - } - tmp += 64; - } -} - -static INT32 powerinsInit() -{ - INT32 nRet; - UINT8 * tmp; - - m6295size = 0x80000 * 4 * 2; - - if ( strcmp(BurnDrvGetTextA(DRV_NAME), "powerins") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "powerinsj") == 0) { - game_drv = GAME_POWERINS; - } else - if ( strcmp(BurnDrvGetTextA(DRV_NAME), "powerinsa") == 0 ) { - game_drv = GAME_POWERINA; - m6295size = 0x90000; - } else - if ( strcmp(BurnDrvGetTextA(DRV_NAME), "powerinsb") == 0 ) { - game_drv = GAME_POWERINB; - } else - return 1; - - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); // blank all memory - MemIndex(); - - // load roms - - tmp = (UINT8 *)BurnMalloc(0x200000); - if (tmp==0) return 1; - - if ( game_drv == GAME_POWERINS ) { - nRet = BurnLoadRom(Rom68K + 0x000000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x080000, 1, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomZ80 + 0x000000, 2, 1); if (nRet != 0) return 1; - - // load background tile roms - LoadDecodeBgRom(tmp, RomBg+0x000000, 3, 0x100000); - LoadDecodeBgRom(tmp, RomBg+0x200000, 4, 0x100000); - LoadDecodeBgRom(tmp, RomBg+0x400000, 5, 0x080000); - - BurnLoadRom(RomFg + 0x000000, 6, 1); - - // load sprite roms - for (INT32 i=0;i<8;i++) - LoadDecodeSprRom(tmp, RomSpr+0x200000*i, i+7, 0x100000); - - BurnLoadRom(MSM6295ROM + 0x000000, 15, 1); - BurnLoadRom(MSM6295ROM + 0x100000, 16, 1); - BurnLoadRom(MSM6295ROM + 0x200000, 17, 1); - BurnLoadRom(MSM6295ROM + 0x300000, 18, 1); - - - } else - if ( game_drv == GAME_POWERINA ) { - nRet = BurnLoadRom(Rom68K + 0x000000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x080000, 1, 1); if (nRet != 0) return 1; - - // load background tile roms - LoadDecodeBgRom(tmp, RomBg+0x000000, 2, 0x200000); - LoadDecodeBgRom(tmp, RomBg+0x400000, 3, 0x080000); - - // load foreground tile roms - BurnLoadRom(RomFg + 0x000000, 4, 1); - - // load sprite roms - for (INT32 i=0;i<4;i++) - LoadDecodeSprRom(tmp, RomSpr+0x400000*i, i+5, 0x200000); - - BurnLoadRom(MSM6295ROM + 0x10000, 9, 1); - memcpy(MSM6295ROM, MSM6295ROM + 0x10000, 0x30000); - - } else - if ( game_drv == GAME_POWERINB ) { - - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomZ80 + 0x000000, 2, 1); if (nRet != 0) return 1; - - // load background tile roms - for (INT32 i=0;i<5;i++) - LoadDecodeBgRom(tmp, RomBg+0x100000*i, i+3, 0x80000); - - // load foreground tile roms - BurnLoadRom(RomFg + 0x000000, 8, 1); - - // load sprite roms - for (INT32 i=0;i<8;i++) - LoadDecodeSprRom(tmp, RomSpr+0x200000*i, i, 0x100000); - - BurnLoadRom(MSM6295ROM + 0x000000, 25, 1); - BurnLoadRom(MSM6295ROM + 0x080000, 26, 1); - BurnLoadRom(MSM6295ROM + 0x100000, 27, 1); - BurnLoadRom(MSM6295ROM + 0x180000, 28, 1); - BurnLoadRom(MSM6295ROM + 0x200000, 29, 1); - BurnLoadRom(MSM6295ROM + 0x280000, 30, 1); - BurnLoadRom(MSM6295ROM + 0x300000, 31, 1); - BurnLoadRom(MSM6295ROM + 0x380000, 32, 1); - - } - - BurnFree(tmp); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory((UINT8 *)RamPal, - 0x120000, 0x120FFF, MAP_ROM); // palette - SekMapMemory((UINT8 *)RamBg, - 0x140000, 0x143fff, MAP_RAM); // b ground - SekMapMemory((UINT8 *)RamFg, - 0x170000, 0x170fff, MAP_RAM); // f ground - SekMapMemory((UINT8 *)RamFg, - 0x171000, 0x171fff, MAP_RAM); // f ground Mirror - SekMapMemory((UINT8 *)RamSpr, - 0x180000, 0x18ffff, MAP_RAM); // sprites - - SekMapHandler(1, 0x120000, 0x120FFF, MAP_WRITE); - - - SekSetReadWordHandler(0, powerinsReadWord); - SekSetReadByteHandler(0, powerinsReadByte); - SekSetWriteWordHandler(0, powerinsWriteWord); - SekSetWriteByteHandler(0, powerinsWriteByte); - - //SekSetWriteByteHandler(1, powerinsWriteBytePalette); - SekSetWriteWordHandler(1, powerinsWriteWordPalette); - - SekClose(); - } - - if ( game_drv != GAME_POWERINA ) { - - ZetInit(0); - ZetOpen(0); - - ZetSetReadHandler(powerinsZ80Read); -#if 1 && defined FBA_DEBUG - ZetSetWriteHandler(powerinsZ80Write); -#endif - ZetSetInHandler(powerinsZ80In); - ZetSetOutHandler(powerinsZ80Out); - - // ROM bank 1 - ZetMapArea(0x0000, 0xBFFF, 0, RomZ80); - ZetMapArea(0x0000, 0xBFFF, 2, RomZ80); - // RAM - ZetMapArea(0xC000, 0xDFFF, 0, RamZ80); - ZetMapArea(0xC000, 0xDFFF, 1, RamZ80); - ZetMapArea(0xC000, 0xDFFF, 2, RamZ80); - - ZetClose(); - } - - if ( game_drv == GAME_POWERINA ) { - MSM6295Init(0, 990000 / 165, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - } - - if (game_drv == GAME_POWERINS ) { - BurnYM2203Init(1, 12000000 / 8, &powerinsIRQHandler, powerinsSynchroniseStream, powerinsGetTime, 0); - BurnTimerAttachZet(6000000); - BurnYM2203SetAllRoutes(0, 2.00, BURN_SND_ROUTE_BOTH); - BurnSetRefreshRate(56.0); - - MSM6295Init(0, 4000000 / 165, 1); - MSM6295Init(1, 4000000 / 165, 1); - MSM6295SetRoute(0, 0.15, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.15, BURN_SND_ROUTE_BOTH); - - NMK112_init(0, MSM6295ROM, MSM6295ROM + 0x200000, 0x200000, 0x200000); - } - - if (game_drv == GAME_POWERINB ) { - MSM6295Init(0, 4000000 / 165, 1); - MSM6295Init(1, 4000000 / 165, 1); - MSM6295SetRoute(0, 0.15, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.15, BURN_SND_ROUTE_BOTH); - - NMK112_init(0, MSM6295ROM, MSM6295ROM + 0x200000, 0x200000, 0x200000); - } - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 powerinsExit() -{ - GenericTilesExit(); - - SekExit(); - MSM6295Exit(0); - - if (game_drv != GAME_POWERINA) { - MSM6295Exit(1); - - if (game_drv == GAME_POWERINS) - BurnYM2203Exit(); - - ZetExit(); - } - - BurnFree(Mem); - return 0; -} - -static void TileBackground() -{ - for (INT32 offs = 256*32-1; offs >=0; offs--) { - - INT32 page = offs >> 8; - INT32 x = (offs >> 4) & 0xF; - INT32 y = (offs >> 0) & 0xF; - - x = x * 16 + (page & 7) * 256 + 32 - ((RamVReg[1]&0xff) + (RamVReg[0]&0xff)*256); - y = y * 16 + (page >> 4) * 256 - 16 - ((RamVReg[3]&0xff) + (RamVReg[2]&0xff)*256); - - if ( x<=-16 || x>=320 || y <=-16 || y>=224 ) continue; - else { - INT32 attr = RamBg[offs]; - INT32 code = ((attr & 0x7ff) + tile_bank); - INT32 color = (attr >> 12) | ((attr >> 7) & 0x10); - - if ( x >=0 && x <= (320-16) && y>=0 && y <=(224-16) ) { - Render16x16Tile(pTransDraw, code, x, y, color, 4, 0, RomBg); - } else { - Render16x16Tile_Clip(pTransDraw, code, x, y, color, 4, 0, RomBg); - } - } - } -} - -static void TileForeground() -{ - for (INT32 offs = 0; offs < 64*32; offs++) { - INT32 x = ((offs & 0xFFE0) >> 2 ) + 32; - INT32 y = ((offs & 0x001F) << 3 ) - 16; - if (x > 320) x -= 512; - if ( x<0 || x>(320-8) || y<0 || y>(224-8)) continue; - else { - if ((RamFg[offs] & 0x0FFF) == 0) continue; - UINT8 *d = RomFg + (RamFg[offs] & 0x0FFF) * 32; - UINT16 c = ((RamFg[offs] & 0xF000) >> 8) | 0x200; - UINT16 *p = pTransDraw + y * 320 + x; - for (INT32 k=0;k<8;k++) { - if ((d[0] >> 4) != 15) p[0] = (d[0] >> 4) | c; - if ((d[0] & 0xF) != 15) p[1] = (d[0] & 0xF) | c; - if ((d[1] >> 4) != 15) p[2] = (d[1] >> 4) | c; - if ((d[1] & 0xF) != 15) p[3] = (d[1] & 0xF) | c; - if ((d[2] >> 4) != 15) p[4] = (d[2] >> 4) | c; - if ((d[2] & 0xF) != 15) p[5] = (d[2] & 0xF) | c; - if ((d[3] >> 4) != 15) p[6] = (d[3] >> 4) | c; - if ((d[3] & 0xF) != 15) p[7] = (d[3] & 0xF) | c; - d += 4; - p += 320; - } - } - } -} - -static inline void drawgfx(UINT32 code,UINT32 color,INT32 flipx,/*INT32 flipy,*/INT32 sx,INT32 sy) -{ - if (sx >= 0 && sx <= (320-16) && sy >= 0 && sy <= (224-16) ) { - if ( flipx ) - Render16x16Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 4, 15, 0x400, RomSpr); - else - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 4, 15, 0x400, RomSpr); - } else { - if ( flipx ) - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x400, RomSpr); - else - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x400, RomSpr); - } -} - -static void DrawSprites() -{ - UINT16 *source = RamSpr + 0x8000/2; - UINT16 *finish = RamSpr + 0x9000/2; - - for ( ; source < finish; source += 8 ) { - - if (!(source[0]&1)) continue; - - INT32 size = source[1]; - INT32 code = (source[3] & 0x7fff) + ( (size & 0x0100) << 7 ); - INT32 sx = source[4]; - INT32 sy = source[6]; - INT32 color = source[7] & 0x3F; - INT32 flipx = size & 0x1000; - INT32 dimx = ((size >> 0) & 0xf ) + 1; - INT32 dimy = ((size >> 4) & 0xf ) + 1; - - sx &= 0x3ff; if (sx > 0x1ff) sx -= 0x400; sx += 32; - sy &= 0x3ff; if (sy > 0x1ff) sy -= 0x400; sy -= 16; - - for (INT32 x = 0 ; x < dimx ; x++) - for (INT32 y = 0 ; y < dimy ; y++) { - drawgfx(code, color, flipx, /*flipy, */sx + x*16, sy + y*16); - code ++; - } - } -} - -static void DrvDraw() -{ - if (bRecalcPalette) { - for (INT32 i=0; i<0x800; i++) CalcCol(i); - bRecalcPalette = 0; - } - - BurnTransferClear(); - - TileBackground(); - DrawSprites(); - TileForeground(); - - BurnTransferCopy(RamCurPal); -} - -static INT32 powerinsFrame() -{ - INT32 nInterleave = 200; - - if (DrvReset) DrvDoReset(); - - DrvInput[0] = 0x00; - DrvInput[2] = 0x00; - DrvInput[3] = 0x00; - for (INT32 i = 0; i < 8; i++) { - DrvInput[2] |= (DrvJoy1[i] & 1) << i; - DrvInput[3] |= (DrvJoy2[i] & 1) << i; - DrvInput[0] |= (DrvButton[i] & 1) << i; - } - - nCyclesTotal[0] = (INT32)((INT64)12000000 * nBurnCPUSpeedAdjust / (0x0100 * 56)); - if (game_drv == GAME_POWERINB) nCyclesTotal[0] = (INT32)((INT64)12000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = 6000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - SekOpen(0); - if (game_drv != GAME_POWERINA) { - ZetNewFrame(); - ZetOpen(0); - } - - if ( game_drv == GAME_POWERINA ) { - nCyclesTotal[0] = (INT32)((INT64)12000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - SekRun(nCyclesTotal[0]); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (game_drv == GAME_POWERINS) { - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - } - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - if (game_drv == GAME_POWERINB) { - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if ((i & 180) == 0) { - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - } - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - SekClose(); - - if (game_drv == GAME_POWERINS) { - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - } - - if (game_drv == GAME_POWERINB) { - ZetRun(nCyclesTotal[1] - nCyclesDone[1]); - - if (pBurnSoundOut) { - memset(pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 powerinsScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029671; - } - - if (nAction & ACB_MEMORY_RAM) { // Scan all memory, devices & variables - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); // Scan 68000 state - - if ( game_drv != GAME_POWERINA ) ZetScan(nAction); // Scan Z80 state - - if ( game_drv == GAME_POWERINS ) BurnYM2203Scan(nAction, pnMin); - - MSM6295Scan(0, nAction); - if ( game_drv != GAME_POWERINA ) MSM6295Scan(1, nAction); - - SCAN_VAR(m6295size); - SCAN_VAR(soundlatch); - if ( game_drv == GAME_POWERINA ) SCAN_VAR(oki_bank); - - SCAN_VAR(tile_bank); - SCAN_VAR(RamCurPal); - - if (nAction & ACB_WRITE) { - bRecalcPalette = 1; - if ( game_drv == GAME_POWERINA ) memcpy(&MSM6295ROM[0x30000],&MSM6295ROM[0x40000 + 0x10000*oki_bank],0x10000); - } - } - - return 0; -} - -struct BurnDriver BurnDrvPowerins = { - "powerins", NULL, NULL, NULL, "1993", - "Power Instinct (USA)\0", NULL, "Atlus", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, FBF_PWRINST, - NULL, powerinsRomInfo, powerinsRomName, NULL, NULL, powerinsInputInfo, powerinsDIPInfo, - powerinsInit, powerinsExit, powerinsFrame, NULL, powerinsScan, &bRecalcPalette, 0x800, - 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPowerinj = { - "powerinsj", "powerins", NULL, NULL, "1993", - "Gouketsuji Ichizoku (Japan)\0", NULL, "Atlus", "Miscellaneous", - L"\u8C6A\u8840\u5BFA\u4E00\u65CF (Japan)\0Gouketsuji Ichizoku\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, FBF_PWRINST, - NULL, powerinjRomInfo, powerinjRomName, NULL, NULL, powerinsInputInfo, powerinjDIPInfo, - powerinsInit, powerinsExit, powerinsFrame, NULL, powerinsScan, &bRecalcPalette, 0x800, - 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPowerina = { - "powerinsa", "powerins", NULL, NULL, "1993", - "Power Instinct (USA, bootleg set 1)\0", NULL, "Atlus", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, FBF_PWRINST, - NULL, powerinaRomInfo, powerinaRomName, NULL, NULL, powerinsInputInfo, powerinsDIPInfo, - powerinsInit, powerinsExit, powerinsFrame, NULL, powerinsScan, &bRecalcPalette, 0x800, - 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPowerinb = { - "powerinsb", "powerins", NULL, NULL, "1993", - "Power Instinct (USA, bootleg set 2)\0", NULL, "Atlus", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, FBF_PWRINST, - NULL, powerinbRomInfo, powerinbRomName, NULL, NULL, powerinsInputInfo, powerinsDIPInfo, - powerinsInit, powerinsExit, powerinsFrame, NULL, powerinsScan, &bRecalcPalette, 0x800, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_pushman.cpp b/jan/src/burn/drv/pst90s/d_pushman.cpp deleted file mode 100644 index b68c680d0..000000000 --- a/jan/src/burn/drv/pst90s/d_pushman.cpp +++ /dev/null @@ -1,1020 +0,0 @@ -// FB Alpha Pushman driver module -// Based on MAME driver by Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "m6805_intf.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvMcuROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvMcuRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16*DrvScroll; -static UINT8 *DrvShareRAM; -static UINT8 *soundlatch; -static UINT8 *flipscreen; - -static INT32 latch; -static INT32 new_latch; - -static UINT16 DrvInputs[2]; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 vblank; -static INT32 no_mcu = 0; - -static struct BurnInputInfo PushmanInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 14, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 8, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 15, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 9, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 13, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Pushman) - -static struct BurnInputInfo BballsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 14, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 8, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 15, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 9, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 13, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bballs) - -static struct BurnDIPInfo PushmanDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Debug Mode (Cheat)" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Pull Option" }, - {0x14, 0x01, 0x02, 0x02, "5" }, - {0x14, 0x01, 0x02, 0x00, "9" }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x08, 0x08, "Upright" }, - {0x14, 0x01, 0x08, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x15, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x15, 0x01, 0x08, 0x08, "Easy" }, - {0x15, 0x01, 0x08, 0x00, "Hard" }, -}; - -STDDIPINFO(Pushman) - -static struct BurnDIPInfo BballsDIPList[]= -{ - {0x12, 0xff, 0xff, 0xcf, NULL }, - {0x13, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x12, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x12, 0x01, 0x08, 0x08, "Easy" }, - {0x12, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Music (In-game)" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Music (Attract Mode)" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0xc0, "1" }, - {0x12, 0x01, 0xc0, 0x80, "2" }, - {0x12, 0x01, 0xc0, 0x40, "3" }, - {0x12, 0x01, 0xc0, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Zaps" }, - {0x13, 0x01, 0x01, 0x01, "1" }, - {0x13, 0x01, 0x01, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Display Next Ball" }, - {0x13, 0x01, 0x02, 0x02, "No" }, - {0x13, 0x01, 0x02, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 3, "Service Mode" }, - {0x13, 0x01, 0xc0, 0xc0, "Off" }, - {0x13, 0x01, 0xc0, 0x40, "Inputs/Outputs" }, - {0x13, 0x01, 0xc0, 0x00, "Graphics" }, -}; - -STDDIPINFO(Bballs) - -void __fastcall pushman_main_write_word(UINT32 address, UINT16 data) -{ - if (address & 0xf00000) { - SekWriteWord(address & 0xfffff, data); - return; - } - - switch (address) - { - case 0x060000: - case 0x060002: - case 0x060004: - case 0x060006: - { - INT32 offset = address & 0x06; - - DrvShareRAM[offset + 0] = data >> 8; - DrvShareRAM[offset + 1] = data; - - if (no_mcu) { - if(offset == 0) { - latch = 0; - if (DrvShareRAM[0] <= 0xf) latch = DrvShareRAM[0] << 2; - if (DrvShareRAM[1]) latch |= 2; - new_latch = 1; - } - } else { - if (offset == 2) { - m68705SetIrqLine(0, 1); - m6805Run(0); - m68705SetIrqLine(0, 0); - new_latch = 0; - } - } - } - return; - - case 0x0e8000: - case 0x0e8002: - DrvScroll[(address >> 1) & 1] = data; - return; - } -} - -void __fastcall pushman_main_write_byte(UINT32 address, UINT8 data) -{ - if (address & 0xf00000) { - SekWriteByte(address & 0xfffff, data); - return; - } - - switch (address) - { - case 0x0e4000: - *flipscreen = data & 0x02; - return; - - case 0x0e4002: - *soundlatch = data; - return; - } -} - -UINT16 __fastcall pushman_main_read_word(UINT32 address) -{ - if (address & 0xf00000) { - return SekReadWord(address & 0xfffff); - } - - switch (address) - { - case 0x060000: - return latch; - - case 0x060002: - case 0x060004: - return ((DrvShareRAM[(address & 0x06) + 1] << 8) | DrvShareRAM[(address & 0x06)]); - - case 0x060006: - if ( new_latch) { new_latch = 0; return 0; } - if (!new_latch) return 0xff; - - case 0x0e4000: - return DrvInputs[0]; - - case 0x0e4002: - return DrvInputs[1] ^ vblank; - - case 0x0e4004: - return (DrvDips[1] << 8) | DrvDips[0]; - } - - return 0; -} - -UINT8 __fastcall pushman_main_read_byte(UINT32 address) -{ - if (address & 0xf00000) { - return SekReadByte(address & 0xfffff); - } - - switch (address) - { - case 0x0e4002: - return (DrvInputs[1] ^ vblank) >> 8; - } - - return 0; -} - - -void __fastcall pushman_sound_out_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - BurnYM2203Write(0, port & 1, data); - return; - - case 0x80: - case 0x81: - BurnYM2203Write(1, port & 1, data); - return; - } -} - -UINT8 __fastcall pushman_sound_read(UINT16 address) -{ - if (address == 0xe000) return *soundlatch; - - return 0; -} - -void pushman_mcu_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x0002: - { - if (~DrvShareRAM[2] & 0x02 && data & 0x02) { - latch = (DrvShareRAM[1] << 8) | DrvShareRAM[0]; - new_latch = 1; - } - DrvShareRAM[address] = data; - } - return; - - case 0x0000: - case 0x0001: - case 0x0003: - case 0x0004: - case 0x0005: - case 0x0006: - case 0x0007: - DrvShareRAM[address] = data; - return; - } -} - -UINT8 pushman_mcu_read(UINT16 address) -{ - switch (address) - { - case 0x0000: - case 0x0001: - case 0x0002: - case 0x0003: - case 0x0004: - case 0x0005: - case 0x0006: - case 0x0007: - return DrvShareRAM[address]; - } - - return 0; -} - -static void DrvIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - -// m6805Open(0); - m68705Reset(); -// m6805Close(); - - BurnYM2203Reset(); - - latch = 0x400; // bballs - new_latch = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x020000; - DrvZ80ROM = Next; Next += 0x010000; - DrvMcuROM = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x0240 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x000800; - DrvZ80RAM = Next; Next += 0x000800; - DrvMcuRAM = Next; Next += 0x000080; - - DrvShareRAM = Next; Next += 0x000008; - - DrvScroll = (UINT16*)Next; Next += 0x000002 * sizeof(UINT16); - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x000004, 0x000000, 0x100004, 0x100000 }; - INT32 Plane1[4] = { 0x000000, 0x080000, 0x100000, 0x180000 }; - INT32 XOffs0[32] = { 0x000, 0x001, 0x002, 0x003, 0x008, 0x009, 0x00a, 0x00b, - 0x200, 0x201, 0x202, 0x203, 0x208, 0x209, 0x20a, 0x20b, - 0x400, 0x401, 0x402, 0x403, 0x408, 0x409, 0x40a, 0x40b, - 0x600, 0x601, 0x602, 0x603, 0x608, 0x609, 0x60a, 0x60b }; - INT32 YOffs0[32] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, - 0x080, 0x090, 0x0a0, 0x0b0, 0x0c0, 0x0d0, 0x0e0, 0x0f0, - 0x100, 0x110, 0x120, 0x130, 0x140, 0x150, 0x160, 0x170, - 0x180, 0x190, 0x1a0, 0x1b0, 0x1c0, 0x1d0, 0x1e0, 0x1f0 }; - INT32 XOffs1[16] = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, - 0x080, 0x081, 0x082, 0x083, 0x084, 0x085, 0x086, 0x087 }; - INT32 YOffs1[16] = { 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038, - 0x040, 0x048, 0x050, 0x058, 0x060, 0x068, 0x070, 0x078 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x08000); - - GfxDecode(0x0800, 2, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x0200, 4, 32, 32, Plane0, XOffs0, YOffs0, 0x800, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - BurnLoadRom(DrvMcuROM + 0x00000, 3, 1); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 13, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x0e0800, 0x0e17ff, MAP_RAM); - SekMapMemory(DrvVidRAM, 0x0ec000, 0x0ec7ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x0f8000, 0x0f87ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0fc000, 0x0fffff, MAP_RAM); - SekSetWriteWordHandler(0, pushman_main_write_word); - SekSetWriteByteHandler(0, pushman_main_write_byte); - SekSetReadWordHandler(0, pushman_main_read_word); - SekSetReadByteHandler(0, pushman_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM); - ZetSetReadHandler(pushman_sound_read); - ZetSetOutHandler(pushman_sound_out_port); - ZetClose(); - - m6805Init(1, 0x1000); -// m6805Open(0); - m6805MapMemory(DrvMcuRAM + 0x0000, 0x0010, 0x007f, MAP_RAM); - m6805MapMemory(DrvMcuROM + 0x0080, 0x0080, 0x0fff, MAP_ROM); - m6805SetWriteHandler(pushman_mcu_write); - m6805SetReadHandler(pushman_mcu_read); -// m6805Close(); - - BurnYM2203Init(2, 2000000, &DrvIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - m6805Exit(); - - BurnYM2203Exit(); - - BurnFree (AllMem); - - no_mcu = 0; - - return 0; -} - -static void draw_background() -{ - INT32 scrollx = DrvScroll[0] & 0xfff; - INT32 scrolly = (0xf00 - DrvScroll[1] + 16) & 0x7ff; - - for (INT32 offs = 0; offs < 128 * 64; offs++) - { - INT32 col = offs & 0x7f; - INT32 row = offs >> 7; - - INT32 sy = (row << 5) - scrolly; - if (sy < -31) sy += 0x0800; - - INT32 sx = (col << 5) - scrollx; - if (sx < -31) sx += 0x1000; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 ofst = (col & 7) + ((~row & 7) << 3) + ((col & 0x78) << 3) + ((~row&0x38)<<7); - - INT32 attr = DrvGfxROM3[ofst * 2 + 0] | (DrvGfxROM3[ofst * 2 + 1] << 8); - INT32 code = (attr & 0xff) | ((attr & 0x4000) >> 6); - INT32 color = (attr >> 8) & 0x0f; - INT32 flipx = (attr & 0x2000); - - if (flipx) { - Render32x32Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } else { - Render32x32Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } - } -} - -static void draw_foreground() -{ - UINT16 *vram = (UINT16*)DrvVidRAM; - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= 16; - if (sy < 0 || sy >= nScreenHeight) continue; - - INT32 attr = vram[offs]; - INT32 code = (attr & 0xff) | ((attr & 0xc000) >> 6) | ((attr & 0x2000) >> 3); - INT32 color = (attr >> 8) & 0x0f; - INT32 flipy = (attr & 0x1000); - - if (flipy) { - Render8x8Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 2, 3, 0x200, DrvGfxROM0); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 2, 3, 0x200, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - UINT16 *vram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0x0800-4; offs >= 0; offs -= 4) - { - INT32 x = vram[offs + 3] & 0x1ff; - if (x == 0x180) continue; - - if (x > 0xff) x=0-(0x200-x); - - INT32 y = 240-vram[offs + 2]; - INT32 color = (vram[offs + 1] >> 2) & 0xf; - INT32 code = vram[offs + 0] & 0x7ff; - - INT32 flipx = vram[offs + 1] & 2; - INT32 flipy = vram[offs + 1] & 1; - - if (*flipscreen) - { - x = 240 - x; - y = 240 - y; - flipx = !flipx; - flipy = !flipy; - } - - y -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x, y, color, 4, 15, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x, y, color, 4, 15, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x, y, color, 4, 15, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x, y, color, 4, 15, 0x100, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0x200 / 2; i < 0x680 / 2; i++) { - r = (p[i] >> 8) & 0x0f; - g = (p[i] >> 4) & 0x0f; - b = (p[i] >> 0) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i - 0x100] = BurnHighCol(r, g, b, 0); - } - } - - draw_background(); - draw_sprites(); - draw_foreground(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2 * sizeof(INT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - SekOpen(0); - ZetOpen(0); -// m6805Open(0); - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 8000000 / 60, 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 16) vblank = 0x0400; - if (i == 240) vblank = 0; - - INT32 segment = nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] += SekRun(segment); - if (i == (nInterleave - 1)) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - if (no_mcu == 0) { - nCyclesDone[1] += m6805Run(segment / 2); - } - - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - } - - if (pBurnSoundOut) { - BurnTimerEndFrame(nCyclesTotal[1]); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - -// m6805Close(); - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - m6805Scan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(new_latch); - SCAN_VAR(latch); - } - - return 0; -} - - -// Pushman (Korea, set 1) - -static struct BurnRomInfo pushmanRomDesc[] = { - { "pushman.012", 0x10000, 0x330762bc, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "pushman.011", 0x10000, 0x62636796, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pushman.013", 0x08000, 0xadfe66c1, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "pushman68705r3p.ic23",0x01000, 0xd7916657, 3 | BRF_PRG | BRF_ESS }, // 3 M68705 MCU Code - - { "pushman.001", 0x08000, 0x626e5865, 4 | BRF_GRA }, // 4 Characters - - { "pushman.004", 0x10000, 0x87aafa70, 5 | BRF_GRA }, // 5 Sprites - { "pushman.005", 0x10000, 0x7fd1200c, 5 | BRF_GRA }, // 6 - { "pushman.002", 0x10000, 0x0a094ab0, 5 | BRF_GRA }, // 7 - { "pushman.003", 0x10000, 0x73d1f29d, 5 | BRF_GRA }, // 8 - - { "pushman.006", 0x10000, 0x48ef3da6, 6 | BRF_GRA }, // 9 Tiles - { "pushman.008", 0x10000, 0x4b6a3e88, 6 | BRF_GRA }, // 10 - { "pushman.007", 0x10000, 0xb70020bd, 6 | BRF_GRA }, // 11 - { "pushman.009", 0x10000, 0xcc555667, 6 | BRF_GRA }, // 12 - - { "pushman.010", 0x08000, 0xa500132d, 7 | BRF_GRA }, // 13 Tilemap - - { "n82s129an.ic82", 0x00100, 0xec80ae36, 0 | BRF_GRA }, // 14 Prom -}; - -STD_ROM_PICK(pushman) -STD_ROM_FN(pushman) - -struct BurnDriver BurnDrvPushman = { - "pushman", NULL, NULL, NULL, "1990", - "Pushman (Korea, set 1)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, pushmanRomInfo, pushmanRomName, NULL, NULL, PushmanInputInfo, PushmanDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// Pushman (Korea, set 2) - -static struct BurnRomInfo pushmanaRomDesc[] = { - { "pushmana.212", 0x10000, 0x871d0858, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "pushmana.011", 0x10000, 0xae57761e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pushman.013", 0x08000, 0xadfe66c1, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "pushman68705r3p.ic23",0x01000, 0xd7916657, 3 | BRF_PRG | BRF_ESS }, // 3 M68705 MCU Code - - { "pushmana.130", 0x10000, 0xf83f92e7, 4 | BRF_GRA }, // 4 Characters - - { "pushman.004", 0x10000, 0x87aafa70, 5 | BRF_GRA }, // 5 Sprites - { "pushman.005", 0x10000, 0x7fd1200c, 5 | BRF_GRA }, // 6 - { "pushman.002", 0x10000, 0x0a094ab0, 5 | BRF_GRA }, // 7 - { "pushman.003", 0x10000, 0x73d1f29d, 5 | BRF_GRA }, // 8 - - { "pushman.006", 0x10000, 0x48ef3da6, 6 | BRF_GRA }, // 9 Tiles - { "pushman.008", 0x10000, 0x4b6a3e88, 6 | BRF_GRA }, // 10 - { "pushman.007", 0x10000, 0xb70020bd, 6 | BRF_GRA }, // 11 - { "pushman.009", 0x10000, 0xcc555667, 6 | BRF_GRA }, // 12 - - { "pushmana.189", 0x10000, 0x59f25598, 7 | BRF_GRA }, // 13 Tilemap - - { "n82s129an.ic82", 0x000100, 0xec80ae36, 0 | BRF_GRA }, // 14 Prom -}; - -STD_ROM_PICK(pushmana) -STD_ROM_FN(pushmana) - -struct BurnDriver BurnDrvPushmana = { - "pushmana", "pushman", NULL, NULL, "1990", - "Pushman (Korea, set 2)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, pushmanaRomInfo, pushmanaRomName, NULL, NULL, PushmanInputInfo, PushmanDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// Pushman (American Sammy license) - -static struct BurnRomInfo pushmansRomDesc[] = { - { "pman-12.ic212", 0x10000, 0x4251109d, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "pman-11.ic197", 0x10000, 0x1167ed9f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "pman-13.ic216", 0x08000, 0xbc03827a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "pushman68705r3p.ic23",0x01000, 0xd7916657, 3 | BRF_PRG | BRF_ESS }, // 3 M68705 MCU Code - - { "pman-1.ic130", 0x08000, 0x14497754, 4 | BRF_GRA }, // 4 Characters - - { "pman-4.ic58", 0x10000, 0x16e5ce6b, 5 | BRF_GRA }, // 5 Sprites - { "pman-5.ic59", 0x10000, 0xb82140b8, 5 | BRF_GRA }, // 6 - { "pman-2.56", 0x10000, 0x2cb2ac29, 5 | BRF_GRA }, // 7 - { "pman-3.57", 0x10000, 0x8ab957c8, 5 | BRF_GRA }, // 8 - - { "pman-6.ic131", 0x10000, 0xbd0f9025, 6 | BRF_GRA }, // 9 Tiles - { "pman-8.ic148", 0x10000, 0x591bd5c0, 6 | BRF_GRA }, // 10 - { "pman-7.ic132", 0x10000, 0x208cb197, 6 | BRF_GRA }, // 11 - { "pman-9.ic149", 0x10000, 0x77ee8577, 6 | BRF_GRA }, // 12 - - { "pman-10.ic189", 0x08000, 0x5f9ae9a1, 7 | BRF_GRA }, // 13 Tilemap - - { "n82s129an.ic82", 0x00100, 0xec80ae36, 0 | BRF_GRA }, // 14 Prom -}; - -STD_ROM_PICK(pushmans) -STD_ROM_FN(pushmans) - -struct BurnDriver BurnDrvPushmans = { - "pushmans", "pushman", NULL, NULL, "1990", - "Pushman (American Sammy license)\0", NULL, "Comad (American Sammy license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, pushmansRomInfo, pushmansRomName, NULL, NULL, PushmanInputInfo, PushmanDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// Bouncing Balls - -static struct BurnRomInfo bballsRomDesc[] = { - { "bb12.m17", 0x10000, 0x4501c245, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "bb11.l17", 0x10000, 0x55e45b60, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bb13.n4", 0x08000, 0x1ef78175, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "mc68705r3.bin", 0x01000, 0x4b37b853, 3 | BRF_PRG }, // 3 M68705 MCU Code - - { "bb1.g20", 0x08000, 0xb62dbcb8, 4 | BRF_GRA }, // 4 Characters - - { "bb4.d1", 0x10000, 0xb77de5f8, 5 | BRF_GRA }, // 5 Sprites - { "bb5.d2", 0x10000, 0xffffccbf, 5 | BRF_GRA }, // 6 - { "bb2.b1", 0x10000, 0xa5b13236, 5 | BRF_GRA }, // 7 - { "bb3.b2", 0x10000, 0xe35b383d, 5 | BRF_GRA }, // 8 - - { "bb6.h1", 0x10000, 0x0cada9ce, 6 | BRF_GRA }, // 9 Tiles - { "bb8.j1", 0x10000, 0xd55fe7c1, 6 | BRF_GRA }, // 10 - { "bb7.h2", 0x10000, 0xa352d53b, 6 | BRF_GRA }, // 11 - { "bb9.j2", 0x10000, 0x78d185ac, 6 | BRF_GRA }, // 12 - - { "bb10.l6", 0x08000, 0xd06498f9, 7 | BRF_GRA }, // 13 Tilemap - - { "bb_prom.e9", 0x00100, 0xec80ae36, 8 | BRF_OPT }, // 14 Priority -}; - -STD_ROM_PICK(bballs) -STD_ROM_FN(bballs) - -static INT32 bballsInit() -{ - no_mcu = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvBballs = { - "bballs", NULL, NULL, NULL, "1991", - "Bouncing Balls\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, bballsRomInfo, bballsRomName, NULL, NULL, BballsInputInfo, BballsDIPInfo, - bballsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; - - -// Bouncing Balls (Adult) - -static struct BurnRomInfo bballsaRomDesc[] = { - { "12.ic212", 0x10000, 0x8917aedd, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "11.ic197", 0x10000, 0x430fca1b, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "13.ic216", 0x08000, 0x1ef78175, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "mc68705r3.bin", 0x01000, 0x4b37b853, 3 | BRF_PRG }, // 3 M68705 MCU Code - - { "1.ic130", 0x08000, 0x67672444, 4 | BRF_GRA }, // 4 Characters - - { "4.ic58", 0x10000, 0x144ca816, 5 | BRF_GRA }, // 5 Sprites - { "5.ic59", 0x10000, 0x486c8385, 5 | BRF_GRA }, // 6 - { "2.ic56", 0x10000, 0x1d464915, 5 | BRF_GRA }, // 7 - { "3.ic57", 0x10000, 0x595439ec, 5 | BRF_GRA }, // 8 - - { "6.ic131", 0x10000, 0x15d4975b, 6 | BRF_GRA }, // 9 Tiles - { "8.ic148", 0x10000, 0xc1a21c75, 6 | BRF_GRA }, // 10 - { "7.ic132", 0x10000, 0x2289393a, 6 | BRF_GRA }, // 11 - { "9.ic149", 0x10000, 0x1fe3d172, 6 | BRF_GRA }, // 12 - - { "10.ic189", 0x08000, 0x52e4ab27, 7 | BRF_GRA }, // 13 Tilemap - - { "bb_prom.e9", 0x00100, 0xec80ae36, 8 | BRF_OPT }, // 14 Priority -}; - -STD_ROM_PICK(bballsa) -STD_ROM_FN(bballsa) - -struct BurnDriver BurnDrvBballsa = { - "bballsa", "bballs", NULL, NULL, "1991", - "Bouncing Balls (Adult)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, bballsaRomInfo, bballsaRomName, NULL, NULL, BballsInputInfo, BballsDIPInfo, - bballsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x240, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_raiden.cpp b/jan/src/burn/drv/pst90s/d_raiden.cpp deleted file mode 100644 index 1f77f527d..000000000 --- a/jan/src/burn/drv/pst90s/d_raiden.cpp +++ /dev/null @@ -1,1275 +0,0 @@ -// Raiden(c) 1990 Seibu Kaihatsu -// driver by Oliver Bergmann, Bryan McPhail, Randy Mongenel - -// port to FB Alpha by OopsWare -// Update Aug. 15, 2014, IQ_132 - -#include "tiles_generic.h" -#include "nec_intf.h" -#include "z80_intf.h" -#include "seibusnd.h" - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *RomV30A; -static UINT8 *RomV30B; - -static UINT8 *RomGfx1; -static UINT8 *RomGfx2; -static UINT8 *RomGfx3; -static UINT8 *RomGfx4; - -static UINT8 *RamV30A; -static UINT8 *RamV30B; -static UINT8 *RamV30S; - -static UINT8 *RamSpr; -static UINT16 *RamFg; -static UINT16 *RamBg; -static UINT16 *RamTxt; -static UINT8 *RamPal; -static UINT8 *RamScroll; - -static UINT8 DrvLayerEnable; - -static UINT32 *DrvPalette; -static UINT8 bRecalcPalette = 0; - -static UINT8 DrvReset = 0; - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - -enum { - GAME_RAIDEN=0, - GAME_RAIDENB, - GAME_RAIDENK, - GAME_RAIDENU -}; - -static INT32 game_drv; - -static struct BurnInputInfo raidenInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip" }, -}; - -STDINPUTINFO(raiden) - -static struct BurnDIPInfo raidenDIPList[] = -{ - {0x11, 0xFF, 0xFF, 0x00, NULL }, - {0x12, 0xFF, 0xFF, 0x00, NULL }, - - {0, 0xFE, 0, 2, "Coin Mode" }, - {0x11, 0x01, 0x01, 0x00, "A" }, - {0x11, 0x01, 0x01, 0x01, "B" }, - - {0, 0xFE, 0, 16, "Coinage" }, - {0x11, 0x01, 0x1E, 0x00, "1 coin 1 credit" }, - {0x11, 0x01, 0x1E, 0x02, "2 coins 1 credit" }, - {0x11, 0x01, 0x1E, 0x04, "3 coins 1 credit" }, - {0x11, 0x01, 0x1E, 0x06, "4 coins 1 credits" }, - {0x11, 0x01, 0x1E, 0x08, "5 coins 1 credit" }, - {0x11, 0x01, 0x1E, 0x0A, "6 coins 1 credit" }, - {0x11, 0x01, 0x1E, 0x0C, "1 coin 2 credits" }, - {0x11, 0x01, 0x1E, 0x0E, "1 coin 3 credits" }, - {0x11, 0x01, 0x1E, 0x10, "1 coin 4 credits" }, - {0x11, 0x01, 0x1E, 0x12, "1 coin 5 credits" }, - {0x11, 0x01, 0x1E, 0x14, "1 coin 6 credits" }, - {0x11, 0x01, 0x1E, 0x16, "2 coins 3 credits" }, - {0x11, 0x01, 0x1E, 0x18, "3 coins 2 credits" }, - {0x11, 0x01, 0x1E, 0x1A, "5 coins 3 credits" }, - {0x11, 0x01, 0x1E, 0x1C, "8 coins 3 credits" }, - {0x11, 0x01, 0x1E, 0x1E, "Free Play" }, - - {0, 0xFE, 0, 2, "Credits to Start" }, - {0x11, 0x01, 0x20, 0x00, "1" }, - {0x11, 0x01, 0x20, 0x20, "2" }, - - {0, 0xFE, 0, 2, "Flip Screen" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - {0, 0xFE, 0, 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "3" }, - {0x12, 0x01, 0x03, 0x01, "1" }, - {0x12, 0x01, 0x03, 0x02, "2" }, - {0x12, 0x01, 0x03, 0x03, "5" }, - - {0, 0xFE, 0, 4, "Bonus Life" }, - {0x12, 0x01, 0x0c, 0x00, "150000 400000" }, - {0x12, 0x01, 0x0c, 0x04, "80000 300000" }, - {0x12, 0x01, 0x0c, 0x08, "300000 1000000" }, - {0x12, 0x01, 0x0c, 0x0c, "1000000 5000000" }, - - {0, 0xFE, 0, 4, "Difficulty" }, - {0x12, 0x01, 0x30, 0x00, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Easy" }, - {0x12, 0x01, 0x30, 0x20, "Hard" }, - {0x12, 0x01, 0x30, 0x30, "Very Hard" }, - - {0, 0xFE, 0, 2, "Allow Continue" }, - {0x12, 0x01, 0x40, 0x00, "Yes" }, - {0x12, 0x01, 0x40, 0x40, "No" }, - - {0, 0xFE, 0, 2, "Demo sound" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, -}; - -STDDIPINFO(raiden) - -inline static UINT32 CalcCol(INT32 offs) -{ - INT32 nColour = RamPal[offs + 0] | (RamPal[offs + 1] << 8); - INT32 r, g, b; - - r = (nColour & 0x000F) << 4; - r |= r >> 4; - g = (nColour & 0x00F0) >> 0; - g |= g >> 4; - b = (nColour & 0x0F00) >> 4; - b |= b >> 4; - - return BurnHighCol(r, g, b, 0); -} - -static UINT8 __fastcall raidenReadByte(UINT32 vezAddress) -{ - switch (vezAddress) - { - case 0x0a000: - case 0x0a001: - case 0x0a002: - case 0x0a003: - case 0x0a004: - case 0x0a005: - case 0x0a006: - case 0x0a007: - case 0x0a008: - case 0x0a009: - case 0x0a00a: - case 0x0a00b: - case 0x0a00c: - case 0x0a00d: - return seibu_main_word_read(vezAddress); - - case 0x0e000: return ~DrvInput[1]; - case 0x0e001: return ~DrvInput[2]; - case 0x0e002: return ~DrvInput[3]; - case 0x0e003: return ~DrvInput[4]; - - // default: - // bprintf(PRINT_NORMAL, _T("CPU #0 Attempt to read byte value of location %x\n"), vezAddress); - } - - return 0; -} - -static void __fastcall raidenWriteByte(UINT32 vezAddress, UINT8 byteValue) -{ - switch (vezAddress) - { - case 0x0a000: - case 0x0a001: - case 0x0a002: - case 0x0a003: - case 0x0a004: - case 0x0a005: - case 0x0a006: - case 0x0a007: - case 0x0a008: - case 0x0a009: - case 0x0a00a: - case 0x0a00b: - case 0x0a00c: - case 0x0a00d: - seibu_main_word_write(vezAddress, byteValue); - break; - - case 0x0e006: - case 0x0e007: - DrvLayerEnable = ~byteValue & 0x0f; - // flipscreen not supported - break; - - case 0x0f002: - case 0x0f004: - case 0x0f012: - case 0x0f014: - case 0x0f022: - case 0x0f024: - case 0x0f032: - case 0x0f034: - RamScroll[((vezAddress >> 2) & 1) | ((vezAddress >> 3) & 6)] = byteValue; - break; - - // default: - // bprintf(PRINT_NORMAL, _T("CPU #0 Attempt to write byte value %x to location %x\n"), byteValue, vezAddress); - } -} - -static UINT8 __fastcall raidenAltReadByte(UINT32 vezAddress) -{ - switch (vezAddress) - { - case 0x0b000: return ~DrvInput[1]; - case 0x0b001: return ~DrvInput[2]; - case 0x0b002: return ~DrvInput[3]; - case 0x0b003: return ~DrvInput[4]; - - case 0x0d000: - case 0x0d001: - case 0x0d002: - case 0x0d003: - case 0x0d004: - case 0x0d005: - case 0x0d006: - case 0x0d007: - case 0x0d008: - case 0x0d009: - case 0x0d00a: - case 0x0d00b: - case 0x0d00c: - case 0x0d00d: - return seibu_main_word_read(vezAddress); - - // default: - // bprintf(PRINT_NORMAL, _T("CPU #0 Attempt to read byte value of location %x\n"), vezAddress); - } - - return 0; -} - -static void __fastcall raidenAltWriteByte(UINT32 vezAddress, UINT8 byteValue) -{ - switch (vezAddress) - { - case 0x08002: // Raidenu!! - case 0x08004: - case 0x08012: - case 0x08014: - case 0x08022: - case 0x08024: - case 0x08032: - case 0x08034: - RamScroll[((vezAddress >> 2) & 1) | ((vezAddress >> 3) & 6)] = byteValue; - break; - - case 0x0b006: - case 0x0b007: - if (game_drv == GAME_RAIDENB) { - DrvLayerEnable = (DrvLayerEnable & 0xfb) | ((~byteValue & 0x08) >> 1); - } else { - DrvLayerEnable = ~byteValue & 0x0f; - // flipscreen not supported - } - break; - - case 0x0d000: - case 0x0d001: - case 0x0d002: - case 0x0d003: - case 0x0d004: - case 0x0d005: - case 0x0d006: - case 0x0d007: - case 0x0d008: - case 0x0d009: - case 0x0d00a: - case 0x0d00b: - case 0x0d00c: - case 0x0d00d: - seibu_main_word_write(vezAddress, byteValue); - break; - - // ctc! - case 0x0d05c: // raidenb - case 0x0d05d: - DrvLayerEnable = (DrvLayerEnable & 4) | (~byteValue & 0x03) | ((~byteValue & 0x10) >> 1); - return; - - // ctc!! - case 0x0d060: // raidenb - case 0x0d061: - case 0x0d062: - case 0x0d064: - case 0x0d065: - case 0x0d066: - case 0x0d067: - RamScroll[ vezAddress - 0x0d060 ] = byteValue; - break; - - // default: - // bprintf(PRINT_NORMAL, _T("CPU #0 Attempt to write byte value %x to location %x\n"), byteValue, vezAddress); - } -} - -static void __fastcall raidenSubWriteByte(UINT32 vezAddress, UINT8 byteValue) -{ - if ((vezAddress & 0xFF000) == 0x03000 || (vezAddress & 0xFF000) == 0x07000 ) { - vezAddress &= 0x00FFF; - RamPal[ vezAddress ] = byteValue; - if (vezAddress & 1) - DrvPalette[ vezAddress >> 1 ] = CalcCol( vezAddress - 1 ); - return; - } -} - -static INT32 DrvDoReset() -{ - memset (RamStart, 0, RamEnd - RamStart); - - VezOpen(0); - VezReset(); - VezClose(); - - VezOpen(1); - VezReset(); - VezClose(); - - seibu_sound_reset(); - - DrvLayerEnable = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - RomV30A = Next; Next += 0x060000; - RomV30B = Next; Next += 0x040000; - SeibuZ80ROM = Next; Next += 0x020000; - SeibuZ80DecROM = Next; Next += 0x020000; - - RomGfx1 = Next; Next += 0x020000; - RomGfx2 = Next; Next += 0x100000; - RomGfx3 = Next; Next += 0x100000; - RomGfx4 = Next; Next += 0x100000; - - MSM6295ROM = Next; Next += 0x010000; - - RamStart = Next; - - RamV30A = Next; Next += 0x007000; - RamV30B = Next; Next += 0x006000; - RamV30S = Next; Next += 0x001000; - SeibuZ80RAM = Next; Next += 0x000800; - - RamSpr = Next; Next += 0x001000; - RamFg = (UINT16 *)Next; Next += 0x000400 * sizeof(UINT16); - RamBg = (UINT16 *)Next; Next += 0x000400 * sizeof(UINT16); - RamTxt = (UINT16 *)Next; Next += 0x000400 * sizeof(UINT16); - - RamPal = Next; Next += 0x001000; - - RamScroll = Next; Next += 0x000008; - - RamEnd = Next; - - DrvPalette = (UINT32 *)Next; Next += 0x000800 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -void decode_gfx_1(UINT8 * dst, UINT8 * src) -{ - for(INT32 i=0;i<0x10000/32;i++) { - for (INT32 j=0;j<8;j++) { - dst[0] = (((src[0] >> 7) & 1) << 2) | (((src[0] >> 3) & 1) << 3) | (((src[0x8000] >> 7) & 1) << 0) | (((src[0x8000] >> 3) & 1) << 1); - dst[1] = (((src[0] >> 6) & 1) << 2) | (((src[0] >> 2) & 1) << 3) | (((src[0x8000] >> 6) & 1) << 0) | (((src[0x8000] >> 2) & 1) << 1); - dst[2] = (((src[0] >> 5) & 1) << 2) | (((src[0] >> 1) & 1) << 3) | (((src[0x8000] >> 5) & 1) << 0) | (((src[0x8000] >> 1) & 1) << 1); - dst[3] = (((src[0] >> 4) & 1) << 2) | (((src[0] >> 0) & 1) << 3) | (((src[0x8000] >> 4) & 1) << 0) | (((src[0x8000] >> 0) & 1) << 1); - dst[4] = (((src[1] >> 7) & 1) << 2) | (((src[1] >> 3) & 1) << 3) | (((src[0x8001] >> 7) & 1) << 0) | (((src[0x8001] >> 3) & 1) << 1); - dst[5] = (((src[1] >> 6) & 1) << 2) | (((src[1] >> 2) & 1) << 3) | (((src[0x8001] >> 6) & 1) << 0) | (((src[0x8001] >> 2) & 1) << 1); - dst[6] = (((src[1] >> 5) & 1) << 2) | (((src[1] >> 1) & 1) << 3) | (((src[0x8001] >> 5) & 1) << 0) | (((src[0x8001] >> 1) & 1) << 1); - dst[7] = (((src[1] >> 4) & 1) << 2) | (((src[1] >> 0) & 1) << 3) | (((src[0x8001] >> 4) & 1) << 0) | (((src[0x8001] >> 0) & 1) << 1); - - src += 2; - dst += 8; - } - } -} - -void decode_gfx_2(UINT8 * dst, UINT8 * src) -{ - for(INT32 i=0;i<0x80000/128;i++) { - for (INT32 j=0;j<16;j++) { - dst[ 0] = (((src[ 1] >> 7) & 1) << 2) | (((src[ 1] >> 3) & 1) << 3) | (((src[ 0] >> 7) & 1) << 0) | (((src[ 0] >> 3) & 1) << 1); - dst[ 1] = (((src[ 1] >> 6) & 1) << 2) | (((src[ 1] >> 2) & 1) << 3) | (((src[ 0] >> 6) & 1) << 0) | (((src[ 0] >> 2) & 1) << 1); - dst[ 2] = (((src[ 1] >> 5) & 1) << 2) | (((src[ 1] >> 1) & 1) << 3) | (((src[ 0] >> 5) & 1) << 0) | (((src[ 0] >> 1) & 1) << 1); - dst[ 3] = (((src[ 1] >> 4) & 1) << 2) | (((src[ 1] >> 0) & 1) << 3) | (((src[ 0] >> 4) & 1) << 0) | (((src[ 0] >> 0) & 1) << 1); - dst[ 4] = (((src[ 3] >> 7) & 1) << 2) | (((src[ 3] >> 3) & 1) << 3) | (((src[ 2] >> 7) & 1) << 0) | (((src[ 2] >> 3) & 1) << 1); - dst[ 5] = (((src[ 3] >> 6) & 1) << 2) | (((src[ 3] >> 2) & 1) << 3) | (((src[ 2] >> 6) & 1) << 0) | (((src[ 2] >> 2) & 1) << 1); - dst[ 6] = (((src[ 3] >> 5) & 1) << 2) | (((src[ 3] >> 1) & 1) << 3) | (((src[ 2] >> 5) & 1) << 0) | (((src[ 2] >> 1) & 1) << 1); - dst[ 7] = (((src[ 3] >> 4) & 1) << 2) | (((src[ 3] >> 0) & 1) << 3) | (((src[ 2] >> 4) & 1) << 0) | (((src[ 2] >> 0) & 1) << 1); - - dst[ 8] = (((src[65] >> 7) & 1) << 2) | (((src[65] >> 3) & 1) << 3) | (((src[64] >> 7) & 1) << 0) | (((src[64] >> 3) & 1) << 1); - dst[ 9] = (((src[65] >> 6) & 1) << 2) | (((src[65] >> 2) & 1) << 3) | (((src[64] >> 6) & 1) << 0) | (((src[64] >> 2) & 1) << 1); - dst[10] = (((src[65] >> 5) & 1) << 2) | (((src[65] >> 1) & 1) << 3) | (((src[64] >> 5) & 1) << 0) | (((src[64] >> 1) & 1) << 1); - dst[11] = (((src[65] >> 4) & 1) << 2) | (((src[65] >> 0) & 1) << 3) | (((src[64] >> 4) & 1) << 0) | (((src[64] >> 0) & 1) << 1); - dst[12] = (((src[67] >> 7) & 1) << 2) | (((src[67] >> 3) & 1) << 3) | (((src[66] >> 7) & 1) << 0) | (((src[66] >> 3) & 1) << 1); - dst[13] = (((src[67] >> 6) & 1) << 2) | (((src[67] >> 2) & 1) << 3) | (((src[66] >> 6) & 1) << 0) | (((src[66] >> 2) & 1) << 1); - dst[14] = (((src[67] >> 5) & 1) << 2) | (((src[67] >> 1) & 1) << 3) | (((src[66] >> 5) & 1) << 0) | (((src[66] >> 1) & 1) << 1); - dst[15] = (((src[67] >> 4) & 1) << 2) | (((src[67] >> 0) & 1) << 3) | (((src[66] >> 4) & 1) << 0) | (((src[66] >> 0) & 1) << 1); - - - src += 4; - dst += 16; - } - src += 64; - } -} - -static void common_decrypt() -{ - UINT8 *RAM = RomV30A; - INT32 i; - UINT8 a; - - static const UINT8 xor_table[4][16]={ - {0xF1,0xF9,0xF5,0xFD,0xF1,0xF1,0x3D,0x3D,0x73,0xFB,0x77,0xFF,0x73,0xF3,0x3F,0x3F}, // rom 3 - {0xDF,0xFF,0xFF,0xFF,0xDB,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xFB,0xFF}, // rom 4 - {0x7F,0x7F,0xBB,0x77,0x77,0x77,0xBE,0xF6,0x7F,0x7F,0xBB,0x77,0x77,0x77,0xBE,0xF6}, // rom 5 - {0xFF,0xFF,0xFD,0xFD,0xFD,0xFD,0xEF,0xEF,0xFF,0xFF,0xFD,0xFD,0xFD,0xFD,0xEF,0xEF} // rom 6 - }; - - // Rom 3 - main cpu even bytes - for (i=0x20000; i<0x60000; i+=2) { - a=RAM[i]; - a^=xor_table[0][(i/2) & 0x0f]; - a^=0xff; - a=(a & 0x31) | ((a<<1) & 0x04) | ((a>>5) & 0x02) | ((a<<4) & 0x40) | ((a<<4) & 0x80) | ((a>>4) & 0x08); - RAM[i]=a; - } - - // Rom 4 - main cpu odd bytes - for (i=0x20001; i<0x60000; i+=2) { - a=RAM[i]; - a^=xor_table[1][(i/2) & 0x0f]; - a^=0xff; - a=(a & 0xdb) | ((a>>3) & 0x04) | ((a<<3) & 0x20); - RAM[i]=a; - } - - RAM = RomV30B; - - // Rom 5 - sub cpu even bytes - for (i=0x00000; i<0x40000; i+=2) { - a=RAM[i]; - a^=xor_table[2][(i/2) & 0x0f]; - a^=0xff; - a=(a & 0x32) | ((a>>1) & 0x04) | ((a>>4) & 0x08) | ((a<<5) & 0x80) | ((a>>6) & 0x01) | ((a<<6) & 0x40); - RAM[i]=a; - } - - // Rom 6 - sub cpu odd bytes - for (i=0x00001; i<0x40000; i+=2) { - a=RAM[i]; - a^=xor_table[3][(i/2) & 0x0f]; - a^=0xff; - a=(a & 0xed) | ((a>>3) & 0x02) | ((a<<3) & 0x10); - RAM[i]=a; - } -} - -static INT32 DrvInit(INT32 drv_select) -{ - game_drv = drv_select; - - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - if (BurnLoadRom(RomV30A + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(RomV30A + 0x000001, 1, 2)) return 1; - if (BurnLoadRom(RomV30A + 0x020000, 2, 2)) return 1; - if (BurnLoadRom(RomV30A + 0x020001, 3, 2)) return 1; - - if (BurnLoadRom(RomV30B + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(RomV30B + 0x000001, 5, 2)) return 1; - - if (game_drv != GAME_RAIDENB && game_drv != GAME_RAIDENU) - common_decrypt(); - - if (BurnLoadRom(SeibuZ80ROM + 0x000000, 6, 1)) return 1; - - memcpy (SeibuZ80ROM + 0x10000, SeibuZ80ROM + 0x08000, 0x08000); - memcpy (SeibuZ80ROM + 0x18000, SeibuZ80ROM + 0x00000, 0x08000); - - if (game_drv == GAME_RAIDEN || game_drv == GAME_RAIDENU) { - // decrypt z80 in seibu sound init - } else { - SeibuZ80DecROM = NULL; - } - - { - UINT8 * tmp = (UINT8 *)BurnMalloc (0x80000); - if (tmp == NULL) return 1; - - if (BurnLoadRom(tmp + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(tmp + 0x08000, 8, 1)) return 1; - decode_gfx_1(RomGfx1, tmp); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "raidenkb")) { - if (BurnLoadRom(tmp + 0x00000, 9, 2)) return 1; - if (BurnLoadRom(tmp + 0x00001, 10, 2)) return 1; - if (BurnLoadRom(tmp + 0x40000, 11, 2)) return 1; - if (BurnLoadRom(tmp + 0x40001, 12, 2)) return 1; - decode_gfx_2(RomGfx2, tmp); - if (BurnLoadRom(tmp + 0x00000, 13, 2)) return 1; - if (BurnLoadRom(tmp + 0x00001, 14, 2)) return 1; - if (BurnLoadRom(tmp + 0x40000, 15, 2)) return 1; - if (BurnLoadRom(tmp + 0x40001, 16, 2)) return 1; - decode_gfx_2(RomGfx3, tmp); - if (BurnLoadRom(tmp + 0x00000, 17, 2)) return 1; - if (BurnLoadRom(tmp + 0x00001, 18, 2)) return 1; - if (BurnLoadRom(tmp + 0x40000, 19, 2)) return 1; - if (BurnLoadRom(tmp + 0x40001, 20, 2)) return 1; - decode_gfx_2(RomGfx4, tmp); - } else { - if (BurnLoadRom(tmp + 0x00000, 9, 1)) return 1; - decode_gfx_2(RomGfx2, tmp); - if (BurnLoadRom(tmp + 0x00000, 10, 1)) return 1; - decode_gfx_2(RomGfx3, tmp); - if (BurnLoadRom(tmp + 0x00000, 11, 1)) return 1; - decode_gfx_2(RomGfx4, tmp); - } - - BurnFree(tmp); - } - - if (BurnLoadRom(MSM6295ROM, 12, 1)) return 1; - - { - VezInit(0, V30_TYPE); - VezOpen(0); - VezMapArea(0x00000, 0x06fff, 0, RamV30A); // RAM - VezMapArea(0x00000, 0x06fff, 1, RamV30A); - VezMapArea(0x07000, 0x07fff, 0, RamSpr); // Sprites - VezMapArea(0x07000, 0x07fff, 1, RamSpr); - VezMapArea(0x0c000, 0x0c7ff, 1, (UINT8 *)RamTxt); - VezMapArea(0xA0000, 0xFFFFF, 0, RomV30A); // CPU 0 ROM - VezMapArea(0xA0000, 0xFFFFF, 2, RomV30A); // CPU 0 ROM - - if (game_drv == GAME_RAIDENB || game_drv == GAME_RAIDENU) { - VezMapArea(0x0a000, 0x0afff, 0, RamV30S); // Share RAM - VezMapArea(0x0a000, 0x0afff, 1, RamV30S); - VezSetReadHandler(raidenAltReadByte); - VezSetWriteHandler(raidenAltWriteByte); - } else { - VezMapArea(0x08000, 0x08fff, 0, RamV30S); // Share RAM - VezMapArea(0x08000, 0x08fff, 1, RamV30S); - VezSetReadHandler(raidenReadByte); - VezSetWriteHandler(raidenWriteByte); - } - - VezClose(); - - VezInit(1, V30_TYPE); - VezOpen(1); - - if (game_drv != GAME_RAIDENU) { - VezMapArea(0x00000, 0x01fff, 0, RamV30B); // RAM - VezMapArea(0x00000, 0x01fff, 1, RamV30B); - VezMapArea(0x02000, 0x027ff, 0, (UINT8 *)RamBg); // Background - VezMapArea(0x02000, 0x027ff, 1, (UINT8 *)RamBg); - VezMapArea(0x02800, 0x02fff, 0, (UINT8 *)RamFg); // Foreground - VezMapArea(0x02800, 0x02fff, 1, (UINT8 *)RamFg); - VezMapArea(0x03000, 0x03fff, 0, RamPal); // Palette - // VezMapArea(0x03000, 0x03fff, 1, RamPal); - VezMapArea(0x04000, 0x04fff, 0, RamV30S); // Share RAM - VezMapArea(0x04000, 0x04fff, 1, RamV30S); - - VezSetWriteHandler(raidenSubWriteByte); - } else { - VezMapArea(0x00000, 0x05fff, 0, RamV30B); // RAM - VezMapArea(0x00000, 0x05fff, 1, RamV30B); - VezMapArea(0x06000, 0x067ff, 0, (UINT8 *)RamBg); // Background - VezMapArea(0x06000, 0x067ff, 1, (UINT8 *)RamBg); - VezMapArea(0x06800, 0x06fff, 0, (UINT8 *)RamFg); // Foreground - VezMapArea(0x06800, 0x06fff, 1, (UINT8 *)RamFg); - VezMapArea(0x07000, 0x07fff, 0, RamPal); // Palette - // VezMapArea(0x07000, 0x07fff, 1, RamPal); - VezMapArea(0x08000, 0x08fff, 0, RamV30S); // Share RAM - VezMapArea(0x08000, 0x08fff, 1, RamV30S); - - VezSetWriteHandler(raidenSubWriteByte); - } - - VezMapArea(0xC0000, 0xFFFFF, 0, RomV30B); // CPU 1 ROM - VezMapArea(0xC0000, 0xFFFFF, 2, RomV30B); - - VezClose(); - } - - seibu_sound_init(0, 0x20000, 3579545, 3579545, 8000); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - VezExit(); - - seibu_sound_exit(); - - GenericTilesExit(); - - BurnFree(Mem); - - return 0; -} - -static void drawBackground() -{ - INT32 scrollx, scrolly; - - if (game_drv == GAME_RAIDENB) { - scrollx = (RamScroll[0] | (RamScroll[1] << 8)) & 0x1ff; - scrolly = (RamScroll[2] | (RamScroll[3] << 8)) & 0x1ff; - } else { - scrollx = ((RamScroll[2]&0x10)<<4) | ((RamScroll[3]&0x7f) << 1) | ((RamScroll[3]&0x80) >> 7); - scrolly = ((RamScroll[0]&0x10)<<4) | ((RamScroll[1]&0x7f) << 1) | ((RamScroll[1]&0x80) >> 7); - } - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs & 0x1f) * 16; - INT32 sx = (offs / 0x20) * 16; - - sx -= scrollx; - if (sx < -15) sx += 512; - sy -= (scrolly + 16) & 0x1ff; - if (sy < -15) sy += 512; - - if (sx >= 256 || sy >= 224) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(RamBg[offs]) & 0x0FFF; - INT32 color = (BURN_ENDIAN_SWAP_INT16(RamBg[offs]) & 0xF000) >> 12; - - if (sx < 0 || sx > 240 || sy < 0 || sy > 208) { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, RomGfx2); - } else { - Render16x16Tile(pTransDraw, code, sx, sy, color, 4, 0, RomGfx2); - } - } -} - -static void drawForeground() -{ - INT32 scrollx, scrolly; - - if (game_drv == GAME_RAIDENB) { - scrollx = (RamScroll[4] | (RamScroll[5] << 8)) & 0x1ff; - scrolly = (RamScroll[6] | (RamScroll[7] << 8)) & 0x1ff; - } else { - scrollx = ((RamScroll[6]&0x10)<<4) | ((RamScroll[7]&0x7f) << 1) | ((RamScroll[7]&0x80) >> 7); - scrolly = ((RamScroll[4]&0x10)<<4) | ((RamScroll[5]&0x7f) << 1) | ((RamScroll[5]&0x80) >> 7); - } - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs & 0x1f) * 16; - INT32 sx = (offs / 0x20) * 16; - - sx -= scrollx; - if (sx < -15) sx += 512; - sy -= (scrolly + 16) & 0x1ff; - if (sy < -15) sy += 512; - - if (sx >= 256 || sy >= 224) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(RamFg[offs]) & 0x0FFF; - if (code == 0) continue; - INT32 color = (BURN_ENDIAN_SWAP_INT16(RamFg[offs]) & 0xF000) >> 12; - - if (sx < 0 || sx > 240 || sy < 0 || sy > 208) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x100, RomGfx3); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 4, 15, 0x100, RomGfx3); - } - } -} - -static void drawSprites(INT32 pri) -{ - for (INT32 offs = 0x1000 - 8; offs >= 0; offs -= 8) - { - if (RamSpr[offs+7] != 0xf) continue; - if ((RamSpr[offs+5] & pri) == 0) continue; - - INT32 flipx = RamSpr[offs+1] & 0x20; - INT32 flipy = RamSpr[offs+1] & 0x40; - INT32 sy = RamSpr[offs+0] - 16; - INT32 sx = RamSpr[offs+4]; - - if (RamSpr[offs+5] & 0x01) - sx = 0 - (0x100 - sx); - - INT32 color = RamSpr[offs+1] & 0xf; - INT32 code = (RamSpr[offs+2] | (RamSpr[offs+3] << 8)) & 0x0fff; - - if (sx <= -16 || sx >= 256 || sy <= -16 || sy >= 224) continue; - - if (sx < 0 || sx > 240 || sy < 0 || sy > 208) - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x200, RomGfx4); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x200, RomGfx4); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x200, RomGfx4); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0x200, RomGfx4); - } - } - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 15, 0x200, RomGfx4); - } else { - Render16x16Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 4, 15, 0x200, RomGfx4); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 4, 15, 0x200, RomGfx4); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 4, 15, 0x200, RomGfx4); - } - } - } - } -} - -static void drawTextAlt() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = ((offs & 0x1f) * 8) - 16; - INT32 sx = (offs / 0x20) * 8; - - INT32 code = (BURN_ENDIAN_SWAP_INT16(RamTxt[offs]) & 0x00FF) | ((BURN_ENDIAN_SWAP_INT16(RamTxt[offs]) & 0xC000) >> 6); - INT32 color = (BURN_ENDIAN_SWAP_INT16(RamTxt[offs]) & 0x0F00) >> 8; - - if (sy < 0 || sy >= 224 || code == 0) continue; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 15, 0x300, RomGfx1); - } -} - -static void drawText() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = ((offs / 0x20) * 8) - 16; - - INT32 code = (BURN_ENDIAN_SWAP_INT16(RamTxt[offs]) & 0x00FF) | ((BURN_ENDIAN_SWAP_INT16(RamTxt[offs]) & 0xC000) >> 6); - INT32 color = (BURN_ENDIAN_SWAP_INT16(RamTxt[offs]) & 0x0F00) >> 8; - - if (sy < 0 || sy >= 224 || code == 0) continue; - - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 15, 0x300, RomGfx1); - } -} - -static INT32 DrvDraw() -{ - if (bRecalcPalette) { - for (INT32 i=0;i<(0x1000/2);i++) - DrvPalette[i] = CalcCol(i << 1); - bRecalcPalette = 0; - } - - if (~DrvLayerEnable & 1) BurnTransferClear(); - - if ( DrvLayerEnable & 1) drawBackground(); - if ( DrvLayerEnable & 8) drawSprites(0x40); - if ( DrvLayerEnable & 2) drawForeground(); - if ( DrvLayerEnable & 8) drawSprites(0x80); - if ( DrvLayerEnable & 4) drawText(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvDrawAlt() -{ - if (bRecalcPalette) { - for (INT32 i=0;i<(0x1000/2);i++) - DrvPalette[i] = CalcCol(i << 1); - bRecalcPalette = 0; - } - - if (~DrvLayerEnable & 1) BurnTransferClear(); - - if ( DrvLayerEnable & 1) drawBackground(); - if ( DrvLayerEnable & 8) drawSprites(0x40); - if ( DrvLayerEnable & 2) drawForeground(); - if ( DrvLayerEnable & 8) drawSprites(0x80); - if ( DrvLayerEnable & 4) drawTextAlt(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInput, 0, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvButton[i] & 1) << i; - DrvInput[1] |= (DrvJoy1[i] & 1) << i; - DrvInput[2] |= (DrvJoy2[i] & 1) << i; - } - - seibu_coin_input = DrvInput[0]; - } - - VezNewFrame(); - ZetNewFrame(); - - INT32 nInterleave = 400; - INT32 nCyclesTotal[3] = { 10000000 / 60, 10000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - VezOpen(0); - nCyclesDone[0] += VezRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1)) VezSetIRQLineAndVector(0, 0xc8/4, CPU_IRQSTATUS_ACK); - VezClose(); - - VezOpen(1); - nCyclesDone[1] += VezRun(nCyclesTotal[1] / nInterleave); - if (i == (nInterleave - 1)) VezSetIRQLineAndVector(0, 0xc8/4, CPU_IRQSTATUS_ACK); - VezClose(); - - BurnTimerUpdateYM3812(i * (nCyclesTotal[2] / nInterleave)); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[2]); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - if (pBurnSoundOut) { - seibu_sound_update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - if ( pnMin ) *pnMin = 0x029671; - - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_WRITE) { - bRecalcPalette = 1; - } - - if (nAction & ACB_DRIVER_DATA) { - VezScan(nAction); - - seibu_sound_scan(pnMin, nAction); - - SCAN_VAR(DrvLayerEnable); - } - - return 0; -} - -// Raiden (set 1) - -static struct BurnRomInfo raidenRomDesc[] = { - { "1.u0253", 0x010000, 0xa4b12785, BRF_ESS | BRF_PRG }, // CPU 0, V30 - { "2.u0252", 0x010000, 0x17640bd5, BRF_ESS | BRF_PRG }, - { "3.u022", 0x020000, 0xf6af09d0, BRF_ESS | BRF_PRG }, - { "4j.u023", 0x020000, 0x505c4c5d, BRF_ESS | BRF_PRG }, - - { "5.u042", 0x020000, 0xed03562e, BRF_ESS | BRF_PRG }, // CPU 1, V30 - { "6.u043", 0x020000, 0xa19d5b5d, BRF_ESS | BRF_PRG }, - - { "8.u212", 0x010000, 0xcbe055c7, BRF_ESS | BRF_PRG }, // CPU 2, Z80 - - { "9", 0x008000, 0x1922b25e, BRF_GRA }, // Tiles - { "10", 0x008000, 0x5f90786a, BRF_GRA }, - { "sei420", 0x080000, 0xda151f0b, BRF_GRA }, - { "sei430", 0x080000, 0xac1f57ac, BRF_GRA }, - { "sei440", 0x080000, 0x946d7bde, BRF_GRA }, - - { "7.u203", 0x010000, 0x8f927822, BRF_SND }, // Sound - - { "rd010.u087", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "rd012.u094", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(raiden) -STD_ROM_FN(raiden) - -static INT32 RaidenInit() { - return DrvInit(GAME_RAIDEN); -} - -struct BurnDriver BurnDrvRaiden = { - "raiden", NULL, NULL, NULL, "1990", - "Raiden (set 1)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidenRomInfo, raidenRomName, NULL, NULL, raidenInputInfo, raidenDIPInfo, - RaidenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x800, - 224, 256, 3, 4 -}; - - -// Raiden (set 2) - -static struct BurnRomInfo raidenaRomDesc[] = { - { "1.u0253", 0x010000, 0xa4b12785, BRF_ESS | BRF_PRG }, // CPU 0, V30 - { "2.u0252", 0x010000, 0x17640bd5, BRF_ESS | BRF_PRG }, - { "3.u022", 0x020000, 0xf6af09d0, BRF_ESS | BRF_PRG }, - { "4.u023", 0x020000, 0x6bdfd416, BRF_ESS | BRF_PRG }, - - { "5.u042", 0x020000, 0xed03562e, BRF_ESS | BRF_PRG }, // CPU 1, V30 - { "6.u043", 0x020000, 0xa19d5b5d, BRF_ESS | BRF_PRG }, - - { "8.u212", 0x010000, 0xcbe055c7, BRF_ESS | BRF_PRG }, // CPU 2, Z80 - - { "9", 0x008000, 0x1922b25e, BRF_GRA }, // Tiles - { "10", 0x008000, 0x5f90786a, BRF_GRA }, - { "sei420", 0x080000, 0xda151f0b, BRF_GRA }, - { "sei430", 0x080000, 0xac1f57ac, BRF_GRA }, - { "sei440", 0x080000, 0x946d7bde, BRF_GRA }, - - { "7.u203", 0x010000, 0x8f927822, BRF_SND }, // Sound - - { "rd010.u087", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "rd012.u094", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(raidena) -STD_ROM_FN(raidena) - -struct BurnDriver BurnDrvRaidena = { - "raidena", "raiden", NULL, NULL, "1990", - "Raiden (set 2)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidenaRomInfo, raidenaRomName, NULL, NULL, raidenInputInfo, raidenDIPInfo, - RaidenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x800, - 224, 256, 3, 4 -}; - - -// Raiden (Taiwan) - -static struct BurnRomInfo raidentRomDesc[] = { - { "1.u0253", 0x010000, 0xa4b12785, BRF_ESS | BRF_PRG }, // CPU 0, V30 - { "2.u0252", 0x010000, 0x17640bd5, BRF_ESS | BRF_PRG }, - { "3.u022", 0x020000, 0xf6af09d0, BRF_ESS | BRF_PRG }, - { "4t.u023", 0x020000, 0x61eefab1, BRF_ESS | BRF_PRG }, - - { "5.u042", 0x020000, 0xed03562e, BRF_ESS | BRF_PRG }, // CPU 1, V30 - { "6.u043", 0x020000, 0xa19d5b5d, BRF_ESS | BRF_PRG }, - - { "8.u212", 0x010000, 0xcbe055c7, BRF_ESS | BRF_PRG }, // CPU 2, Z80 - - { "9", 0x008000, 0x1922b25e, BRF_GRA }, // Tiles - { "10", 0x008000, 0x5f90786a, BRF_GRA }, - { "sei420", 0x080000, 0xda151f0b, BRF_GRA }, - { "sei430", 0x080000, 0xac1f57ac, BRF_GRA }, - { "sei440", 0x080000, 0x946d7bde, BRF_GRA }, - - { "7.u203", 0x010000, 0x8f927822, BRF_SND }, // Sound - - { "rd010.u087", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "rd012.u094", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(raident) -STD_ROM_FN(raident) - -struct BurnDriver BurnDrvRaident = { - "raident", "raiden", NULL, NULL, "1990", - "Raiden (Taiwan)\0", NULL, "Seibu Kaihatsu (Liang HWA Electronics license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidentRomInfo, raidentRomName, NULL, NULL, raidenInputInfo, raidenDIPInfo, - RaidenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x800, - 224, 256, 3, 4 -}; - - -// Raiden (US, set 1) - -static struct BurnRomInfo raidenuRomDesc[] = { - { "1.u0253", 0x010000, 0xa4b12785, BRF_ESS | BRF_PRG }, // CPU 0, V30 - { "2.u0252", 0x010000, 0x17640bd5, BRF_ESS | BRF_PRG }, - { "3a.u022", 0x020000, 0xa8fadbdd, BRF_ESS | BRF_PRG }, - { "4a.u023", 0x020000, 0xbafb268d, BRF_ESS | BRF_PRG }, - - { "5.u042", 0x020000, 0xed03562e, BRF_ESS | BRF_PRG }, // CPU 1, V30 - { "6.u043", 0x020000, 0xa19d5b5d, BRF_ESS | BRF_PRG }, - - { "8.u212", 0x010000, 0xcbe055c7, BRF_ESS | BRF_PRG }, // CPU 2, Z80 - - { "9", 0x008000, 0x1922b25e, BRF_GRA }, // Tiles - { "10", 0x008000, 0x5f90786a, BRF_GRA }, - { "sei420", 0x080000, 0xda151f0b, BRF_GRA }, - { "sei430", 0x080000, 0xac1f57ac, BRF_GRA }, - { "sei440", 0x080000, 0x946d7bde, BRF_GRA }, - - { "7.u203", 0x010000, 0x8f927822, BRF_SND }, // Sound - - { "rd010.u087", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "rd012.u094", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(raidenu) -STD_ROM_FN(raidenu) - -struct BurnDriver BurnDrvRaidenu = { - "raidenu", "raiden", NULL, NULL, "1990", - "Raiden (US, set 1)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidenuRomInfo, raidenuRomName, NULL, NULL, raidenInputInfo, raidenDIPInfo, - RaidenInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x800, - 224, 256, 3, 4 -}; - - -// Raiden (Korea) - -static struct BurnRomInfo raidenkRomDesc[] = { - { "1.u0253", 0x010000, 0xa4b12785, BRF_ESS | BRF_PRG }, // CPU 0, V30 - { "2.u0252", 0x010000, 0x17640bd5, BRF_ESS | BRF_PRG }, - { "3.u022", 0x020000, 0xf6af09d0, BRF_ESS | BRF_PRG }, - { "4k.u023", 0x020000, 0xfddf24da, BRF_ESS | BRF_PRG }, - - { "5.u042", 0x020000, 0xed03562e, BRF_ESS | BRF_PRG }, // CPU 1, V30 - { "6.u043", 0x020000, 0xa19d5b5d, BRF_ESS | BRF_PRG }, - - { "8b.u212", 0x010000, 0x99ee7505, BRF_ESS | BRF_PRG }, // CPU 2, Z80 - - { "9", 0x008000, 0x1922b25e, BRF_GRA }, // Tiles - { "10", 0x008000, 0x5f90786a, BRF_GRA }, - { "sei420", 0x080000, 0xda151f0b, BRF_GRA }, - { "sei430", 0x080000, 0xac1f57ac, BRF_GRA }, - { "sei440", 0x080000, 0x946d7bde, BRF_GRA }, - - { "7.u203", 0x010000, 0x8f927822, BRF_SND }, // Sound - - { "rd010.u087", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "rd012.u094", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(raidenk) -STD_ROM_FN(raidenk) - -static INT32 RaidenkInit() { - return DrvInit(GAME_RAIDENK); -} - -struct BurnDriver BurnDrvRaidenk = { - "raidenk", "raiden", NULL, NULL, "1990", - "Raiden (Korea)\0", NULL, "Seibu Kaihatsu (IBL Corporation license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidenkRomInfo, raidenkRomName, NULL, NULL, raidenInputInfo, raidenDIPInfo, - RaidenkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x800, - 224, 256, 3, 4 -}; - - -// Raiden (Korea, bootleg) - -static struct BurnRomInfo raidenkbRomDesc[] = { - { "1.u0253", 0x010000, 0xa4b12785, BRF_ESS | BRF_PRG }, // CPU 0, V30 - { "2.u0252", 0x010000, 0x17640bd5, BRF_ESS | BRF_PRG }, - { "3.u022", 0x020000, 0xf6af09d0, BRF_ESS | BRF_PRG }, - { "4k.u023", 0x020000, 0xfddf24da, BRF_ESS | BRF_PRG }, - - { "5.u042", 0x020000, 0xed03562e, BRF_ESS | BRF_PRG }, // CPU 1, V30 - { "6.u043", 0x020000, 0xa19d5b5d, BRF_ESS | BRF_PRG }, - - { "8b.u212", 0x010000, 0x99ee7505, BRF_ESS | BRF_PRG }, // CPU 2, Z80 - - { "9", 0x008000, 0x1922b25e, BRF_GRA }, // Tiles - { "10", 0x008000, 0x5f90786a, BRF_GRA }, - { "rkb15bg.bin", 0x020000, 0x13a69064, BRF_GRA }, - { "rkb17bg.bin", 0x020000, 0xd7a6c649, BRF_GRA }, - { "rkb16bg.bin", 0x020000, 0x66ea8484, BRF_GRA }, - { "rkb18bg.bin", 0x020000, 0x42362d56, BRF_GRA }, - { "rkb7bg.bin", 0x020000, 0x25239711, BRF_GRA }, - { "rkb9bg.bin", 0x020000, 0x6ca0d7b3, BRF_GRA }, - { "rkb8bg.bin", 0x020000, 0x3cad38fc, BRF_GRA }, - { "rkb10bg.bin", 0x020000, 0x6fce95a3, BRF_GRA }, - { "rkb19obj.bin", 0x020000, 0x34fa4485, BRF_GRA }, - { "rkb21obj.bin", 0x020000, 0xd806395b, BRF_GRA }, - { "rkb20obj.bin", 0x020000, 0x8b7ca3c6, BRF_GRA }, - { "rkb22obj.bin", 0x020000, 0x82ee78a0, BRF_GRA }, - - { "7.u203", 0x010000, 0x8f927822, BRF_SND }, // Sound - - { "82s147.h7", 0x000200, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(raidenkb) -STD_ROM_FN(raidenkb) - -struct BurnDriver BurnDrvRaidenkb = { - "raidenkb", "raiden", NULL, NULL, "1990", - "Raiden (Korea, bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidenkbRomInfo, raidenkbRomName, NULL, NULL, raidenInputInfo, raidenDIPInfo, - RaidenkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x800, - 224, 256, 3, 4 -}; - -// Raiden (set 3, Alternate hardware) - -static struct BurnRomInfo raidenbRomDesc[] = { - { "1.u0253", 0x010000, 0xa4b12785, BRF_ESS | BRF_PRG }, // CPU 0, V30 - { "2.u0252", 0x010000, 0x17640bd5, BRF_ESS | BRF_PRG }, - { "3__(raidenb).u022", 0x020000, 0x9d735bf5, BRF_ESS | BRF_PRG }, - { "4__(raidenb).u023", 0x020000, 0x8d184b99, BRF_ESS | BRF_PRG }, - - { "5__(raidenb).u042", 0x020000, 0x7aca6d61, BRF_ESS | BRF_PRG }, // CPU 1, V30 - { "6__(raidenb).u043", 0x020000, 0xe3d35cc2, BRF_ESS | BRF_PRG }, - - { "rai6.u212", 0x010000, 0x723a483b, BRF_ESS | BRF_PRG }, // CPU 2, Z80 - - { "9", 0x008000, 0x1922b25e, BRF_GRA }, // Tiles - { "10", 0x008000, 0x5f90786a, BRF_GRA }, - { "sei420", 0x080000, 0xda151f0b, BRF_GRA }, - { "sei430", 0x080000, 0xac1f57ac, BRF_GRA }, - { "sei440", 0x080000, 0x946d7bde, BRF_GRA }, - - { "7.u203", 0x010000, 0x8f927822, BRF_SND }, // Sound - - { "ep910pc-1.bin", 0x000884, 0x00000000, BRF_NODUMP }, - { "ep910pc-2.bin", 0x000884, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(raidenb) -STD_ROM_FN(raidenb) - -static INT32 RaidenbInit() { - return DrvInit(GAME_RAIDENB); -} - -struct BurnDriver BurnDrvRaidenb = { - "raidenb", "raiden", NULL, NULL, "1990", - "Raiden (set 3, Alternate hardware)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidenbRomInfo, raidenbRomName, NULL, NULL, raidenInputInfo, raidenDIPInfo, - RaidenbInit, DrvExit, DrvFrame, DrvDrawAlt, DrvScan, &bRecalcPalette, 0x800, - 224, 256, 3, 4 -}; - - -// Raiden (US, set 2, SEI8904 + SEI9008 PCBs) - -static struct BurnRomInfo raidenuaRomDesc[] = { - { "1.c8", 0x010000, 0xa4b12785, BRF_ESS | BRF_PRG }, // CPU 0, V30 - { "2.c7", 0x010000, 0x17640bd5, BRF_ESS | BRF_PRG }, - { "3dd.e8", 0x020000, 0xb6f3bad2, BRF_ESS | BRF_PRG }, - { "4dd.e7", 0x020000, 0xd294dfc1, BRF_ESS | BRF_PRG }, - - { "5.p8", 0x020000, 0x15c1cf45, BRF_ESS | BRF_PRG }, // CPU 1, V30 - { "6.p7", 0x020000, 0x261c381b, BRF_ESS | BRF_PRG }, - - { "8.w8", 0x010000, 0x105b9c11, BRF_ESS | BRF_PRG }, // CPU 2, Z80 - - { "9", 0x008000, 0x1922b25e, BRF_GRA }, // Tiles - { "10", 0x008000, 0x5f90786a, BRF_GRA }, - { "sei420", 0x080000, 0xda151f0b, BRF_GRA }, - { "sei430", 0x080000, 0xac1f57ac, BRF_GRA }, - { "sei440", 0x080000, 0x946d7bde, BRF_GRA }, - - { "7.x10", 0x010000, 0x2051263e, BRF_SND }, // Sound - - { "prom.n2", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "prom.u3", 0x000100, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(raidenua) -STD_ROM_FN(raidenua) - -static INT32 RaidenuInit() -{ - return DrvInit(GAME_RAIDENU); -} - -struct BurnDriver BurnDrvRaidenua = { - "raidenua", "raiden", NULL, NULL, "1990", - "Raiden (US, set 2, SEI8904 + SEI9008 PCBs)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidenuaRomInfo, raidenuaRomName, NULL, NULL, raidenInputInfo, raidenDIPInfo, - RaidenuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &bRecalcPalette, 0x800, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pst90s/d_raiden2.cpp b/jan/src/burn/drv/pst90s/d_raiden2.cpp deleted file mode 100644 index db97fdaac..000000000 --- a/jan/src/burn/drv/pst90s/d_raiden2.cpp +++ /dev/null @@ -1,5032 +0,0 @@ -// FB Alpha Raiden II driver module -// Based on MAME driver Olivier Galibert, Angelo Salese, David Haywood, Tomasz Slanina - -#include "tiles_generic.h" -#include "nec_intf.h" -#include "z80_intf.h" -#include "seibusnd.h" -#include "eeprom.h" -#include "bitswap.h" - -#if defined _MSC_VER - #define _USE_MATH_DEFINES - #include -#endif - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvMainROM; -static UINT8 *DrvCopxROM; -static UINT8 *DrvEeprom; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvMainRAM; -static UINT8 *DrvTxRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvMgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvTransTab; - -static UINT32 *bitmap32; -static UINT8 *DrvAlphaTable; - -static UINT8 *scroll; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT16 layer_enable; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[4]; -static UINT8 DrvDips[4]; -static UINT16 DrvInputs[3]; -static UINT8 DrvReset; -static INT32 hold_coin[4]; - -static UINT16 prg_bank = 0; -static UINT8 mg_bank = 0; -static UINT8 bg_bank = 0; -static UINT8 fg_bank = 0; -static UINT8 tx_bank = 0; - -static INT32 game_select = 0; // 0 raiden2, 1 raidendx, 2 zeroteam, 3 xsedae, 4 = r2dx, 5 nzeroteam, 6 zerotm2k - -static struct BurnInputInfo Raiden2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Raiden2) - -static struct BurnInputInfo RaidendxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Raidendx) - -static struct BurnInputInfo ZeroteamInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, DrvJoy4 + 2, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 4, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy2 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy2 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy2 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy2 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy4 + 3, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy3 + 5, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy2 + 8, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy2 + 9, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy2 + 10, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy2 + 11, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy2 + 12, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy2 + 13, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, DrvJoy2 + 14, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Zeroteam) - -static struct BurnInputInfo Rdx_v33InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 15, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Service 1", BIT_DIGITAL, DrvJoy2 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Rdx_v33) - -static struct BurnInputInfo NzeroteaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Nzerotea) - -static struct BurnDIPInfo Raiden2DIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Starting Coin" }, - {0x12, 0x01, 0x40, 0x40, "Normal" }, - {0x12, 0x01, 0x40, 0x00, "X 2" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x0c, 0x00, "1" }, - {0x13, 0x01, 0x0c, 0x04, "4" }, - {0x13, 0x01, 0x0c, 0x08, "2" }, - {0x13, 0x01, 0x0c, 0x0c, "3" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x30, "200000 500000" }, - {0x13, 0x01, 0x30, 0x20, "400000 1000000" }, - {0x13, 0x01, 0x30, 0x10, "1000000 3000000" }, - {0x13, 0x01, 0x30, 0x00, "No Extend" }, - - {0 , 0xfe, 0 , 2, "Demo Sound" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Raiden2) - -static struct BurnDIPInfo RaidendxDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Starting Coin" }, - {0x14, 0x01, 0x40, 0x40, "Normal" }, - {0x14, 0x01, 0x40, 0x00, "X 2" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x0c, 0x00, "1" }, - {0x15, 0x01, 0x0c, 0x04, "4" }, - {0x15, 0x01, 0x0c, 0x08, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - - {0 , 0xfe, 0 , 2, "Demo Sound" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Raidendx) - -static struct BurnDIPInfo XsedaeDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, -}; - -STDDIPINFO(Xsedae) - -static struct BurnDIPInfo ZeroteamDIPList[]= -{ - {0x26, 0xff, 0xff, 0xff, NULL }, - {0x27, 0xff, 0xff, 0xff, NULL }, - {0x28, 0xff, 0xff, 0xfd, NULL }, - - {0x26, 0xff, 0xff, 0xff, NULL }, - {0x27, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x26, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x26, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x26, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x26, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x26, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x26, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x26, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x26, 0x01, 0x38, 0x08, "3 Coins 1 Credits" }, - {0x26, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x26, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x26, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x26, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x26, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, - {0x26, 0x01, 0x38, 0x20, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Starting Coin" }, - {0x26, 0x01, 0x40, 0x40, "Normal" }, - {0x26, 0x01, 0x40, 0x00, "X 2" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x26, 0x01, 0x80, 0x80, "Off" }, - {0x26, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x27, 0x01, 0x03, 0x03, "Normal" }, - {0x27, 0x01, 0x03, 0x02, "Hard" }, - {0x27, 0x01, 0x03, 0x01, "Easy" }, - {0x27, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x27, 0x01, 0x0c, 0x0c, "2" }, - {0x27, 0x01, 0x0c, 0x08, "4" }, - {0x27, 0x01, 0x0c, 0x04, "3" }, - {0x27, 0x01, 0x0c, 0x00, "1" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x27, 0x01, 0x30, 0x30, "1000000" }, - {0x27, 0x01, 0x30, 0x20, "2000000" }, - {0x27, 0x01, 0x30, 0x10, "Every 1000000" }, - {0x27, 0x01, 0x30, 0x00, "No Extend" }, - - {0 , 0xfe, 0 , 2, "Demo Sound" }, - {0x27, 0x01, 0x40, 0x00, "Off" }, - {0x27, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x27, 0x01, 0x80, 0x80, "Off" }, - {0x27, 0x01, 0x80, 0x00, "On" }, - - - {0 , 0xfe, 0 , 8, "Cabinet Setting" }, - {0x28, 0x01, 0x07, 0x07, "2 Players" }, - {0x28, 0x01, 0x07, 0x06, "3 Players, 3 Slots" }, - {0x28, 0x01, 0x07, 0x05, "4 Players, 4 Slots" }, - {0x28, 0x01, 0x07, 0x04, "3 Players, 2 Slots" }, - {0x28, 0x01, 0x07, 0x03, "2 Players x2" }, - {0x28, 0x01, 0x07, 0x02, "4 Players, 2 Slots" }, - {0x28, 0x01, 0x07, 0x01, "2 Players, Freeplay" }, - {0x28, 0x01, 0x07, 0x00, "4 Players, Freeplay" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x28, 0x01, 0x08, 0x08, "Off" }, - {0x28, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Zeroteam) - -static struct BurnDIPInfo Rdx_v33DIPList[]= -{ - {0x15, 0xff, 0xff, 0xc0, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Rdx_v33) - -static struct BurnDIPInfo NzeroteaDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x08, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Starting Coin" }, - {0x14, 0x01, 0x40, 0x40, "Normal" }, - {0x14, 0x01, 0x40, 0x00, "X 2" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x02, "Hard" }, - {0x15, 0x01, 0x03, 0x01, "Easy" }, - {0x15, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x0c, 0x0c, "2" }, - {0x15, 0x01, 0x0c, 0x08, "4" }, - {0x15, 0x01, 0x0c, 0x04, "3" }, - {0x15, 0x01, 0x0c, 0x00, "1" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x30, 0x30, "1000000" }, - {0x15, 0x01, 0x30, 0x20, "2000000" }, - {0x15, 0x01, 0x30, 0x10, "Every 1000000" }, - {0x15, 0x01, 0x30, 0x00, "No Extend" }, - - {0 , 0xfe, 0 , 2, "Demo Sound" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Nzerotea) - -static UINT32 cop_regs[8], cop_itoa; -static UINT16 cop_status, cop_scale, cop_itoa_digit_count, cop_angle, cop_dist; -static UINT8 cop_itoa_digits[10]; -static UINT16 cop_dma_mode, cop_dma_src[0x200], cop_dma_dst[0x200], cop_dma_size[0x200], cop_dma_v1, cop_dma_v2, cop_dma_adr_rel; -static UINT16 sprites_cur_start; -static UINT16 pal_brightness_val; - -static UINT16 cop_angle_target; -static UINT16 cop_angle_step; - -static UINT16 cop_bank; -static UINT16 sprite_prot_x,sprite_prot_y,dst1,cop_spr_maxx,cop_spr_off; -static UINT16 sprite_prot_src_addr[2]; - -static struct { - INT16 pos[3]; - INT8 dx[3]; - UINT8 size[3]; - bool allow_swap; - UINT16 flags_swap; - UINT32 spradr; - INT16 min[3], max[3]; -} cop_collision_info[2]; - -static UINT16 cop_hit_status, cop_hit_baseadr; -INT16 cop_hit_val[3]; -UINT16 cop_hit_val_stat; -static UINT32 cop_sort_ram_addr, cop_sort_lookup; -static UINT16 cop_sort_param; - -static UINT16 r2dx_i_dx; -static UINT16 r2dx_i_dy; -static UINT16 r2dx_i_angle; -static UINT32 r2dx_i_sdist; -static INT32 r2dx_gameselect; -static INT32 r2dx_okibank; - -static void SeibuCopReset() -{ - memset (cop_regs, 0, 8 * sizeof(UINT32)); - cop_itoa = 0; - cop_status = 0; - cop_scale = 0; - cop_itoa_digit_count = 4; - cop_angle_target = 0; - cop_angle_step = 0; - cop_angle = 0; - cop_dist = 0; - memset (cop_itoa_digits, 0, 10); - - cop_dma_mode = 0; - memset (cop_dma_src, 0, 0x200 * sizeof(INT16)); - memset (cop_dma_dst, 0, 0x200 * sizeof(INT16)); - memset (cop_dma_size, 0, 0x200 * sizeof(INT16)); - cop_dma_v1 = 0; - cop_dma_v2 = 0; - cop_dma_adr_rel = 0; - - sprites_cur_start = 0; - pal_brightness_val = 0; - - cop_bank = 0; - - sprite_prot_x = 0; - sprite_prot_y = 0; - dst1 = 0; - cop_spr_maxx = 0; - cop_spr_off = 0; - memset (sprite_prot_src_addr, 0, 2 * sizeof(INT16)); - - memset (&cop_collision_info, 0, 2 * sizeof(cop_collision_info[0])); - - cop_hit_status = 0; - cop_hit_baseadr = 0; - memset(&cop_hit_val, 0, sizeof(cop_hit_val)); - cop_hit_val_stat = 0; - cop_sort_ram_addr = 0; - cop_sort_lookup = 0; - cop_sort_param = 0; - - r2dx_i_dx = 0; - r2dx_i_dy = 0; - r2dx_i_angle = 0; - r2dx_i_sdist = 0; - r2dx_gameselect = 0; -} - -static void SeibuCopScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(cop_regs); - SCAN_VAR(cop_itoa); - SCAN_VAR(cop_status); - SCAN_VAR(cop_scale); - SCAN_VAR(cop_itoa_digit_count); - SCAN_VAR(cop_angle_target); - SCAN_VAR(cop_angle_step); - SCAN_VAR(cop_angle); - SCAN_VAR(cop_dist); - SCAN_VAR(cop_itoa_digits); - SCAN_VAR(cop_dma_mode); - SCAN_VAR(cop_dma_src); - SCAN_VAR(cop_dma_dst); - SCAN_VAR(cop_dma_size); - SCAN_VAR(cop_dma_v1); - SCAN_VAR(cop_dma_v2); - SCAN_VAR(cop_dma_adr_rel); - SCAN_VAR(sprites_cur_start); - SCAN_VAR(pal_brightness_val); - SCAN_VAR(cop_bank); - SCAN_VAR(sprite_prot_x); - SCAN_VAR(sprite_prot_y); - SCAN_VAR(dst1); - SCAN_VAR(cop_spr_maxx); - SCAN_VAR(cop_spr_off); - SCAN_VAR(sprite_prot_src_addr); - SCAN_VAR(cop_collision_info); - SCAN_VAR(cop_hit_status); - SCAN_VAR(cop_hit_baseadr); - SCAN_VAR(cop_hit_val); - SCAN_VAR(cop_hit_val_stat); - SCAN_VAR(cop_sort_ram_addr); - SCAN_VAR(cop_sort_lookup); - SCAN_VAR(cop_sort_param); - - SCAN_VAR(r2dx_i_dx); - SCAN_VAR(r2dx_i_dy); - SCAN_VAR(r2dx_i_angle); - SCAN_VAR(r2dx_i_sdist); - } -} - -static void itoa_compute() -{ - INT32 digits = 1 << cop_itoa_digit_count*2; - UINT32 val = cop_itoa; - - if(digits > 9) - digits = 9; - for(INT32 i=0; i> 16) - (sprite_prot_x)) & 0xffff; - INT32 y = INT16((VezReadLong(src+0x04) >> 16) - (sprite_prot_y)) & 0xffff; - - UINT16 head1 = VezReadWord(src+cop_spr_off); - UINT16 head2 = VezReadWord(src+cop_spr_off+2); - - INT32 w = (((head1 >> 8 ) & 7) + 1) << 4; - INT32 h = (((head1 >> 12) & 7) + 1) << 4; - - UINT16 flag = x-w/2 > -w && x-w/2 < cop_spr_maxx+w && y-h/2 > -h && y-h/2 < 256+h ? 1 : 0; - - flag = (VezReadWord(src) & 0xfffe) | flag; - VezWriteWord(src, flag); - - if(flag & 1) - { - VezWriteWord(dst1, head1); - VezWriteWord(dst1+2, head2); - VezWriteWord(dst1+4, x-w/2); - VezWriteWord(dst1+6, y-h/2); - - dst1 += 8; - } -} - -static void cop_collision_read_pos(int slot, UINT32 spradr, bool allow_swap) -{ - cop_collision_info[slot].allow_swap = (allow_swap); - cop_collision_info[slot].flags_swap = VezReadWord(spradr+2); - cop_collision_info[slot].spradr = (spradr); - - for(int i=0; i<3; i++) - cop_collision_info[slot].pos[i] = VezReadWord(spradr+6+4*i); -} - -static void cop_collision_update_hitbox(INT16 slot, UINT32 hitadr, UINT16 data) -{ - UINT32 hitadr2 = VezReadWord(hitadr) | (cop_hit_baseadr << 16); - INT32 num_axis = 2; - INT32 extraxor = 0; - if (/*m_cpu_is_68k*/1) extraxor = 1; - - // guess, heatbrl doesn't have this set and clearly only wants 2 axis to be checked (otherwise it reads bad params into the 3rd) - // everything else has it set, and legionna clearly wants 3 axis for jumping attacks to work - if (data & 0x0100) num_axis = 3; - - INT16 i; - - for(i = 0; i<3; i++) { - cop_collision_info[slot].dx[i] = 0; - cop_collision_info[slot].size[i] = 0; - } - - for(i = 0; i cop_collision_info[1].min[i] && cop_collision_info[0].min[i] < cop_collision_info[1].max[i]) - res &= ~(1 << i); - - if(cop_collision_info[1].max[i] > cop_collision_info[0].min[i] && cop_collision_info[1].min[i] < cop_collision_info[0].max[i]) - res &= ~(1 << i); - - cop_hit_val[i] = (cop_collision_info[0].pos[i] - cop_collision_info[1].pos[i]); - } - - cop_hit_val_stat = res; // TODO: there's also bit 2 and 3 triggered in the tests, no known meaning - cop_hit_status = res; - -} - -static void cop_cmd_write(INT32 offset, UINT16 data) -{ - offset/=2; - cop_status &= 0x7fff; - - switch(data) { - case 0x0205: { // 0205 0006 ffeb 0000 - 0188 0282 0082 0b8e 098e 0000 0000 0000 - INT32 ppos = VezReadLong(cop_regs[0] + 4 + offset*4); - INT32 npos = ppos + VezReadLong(cop_regs[0] + 0x10 + offset*4); - INT32 delta = (npos >> 16) - (ppos >> 16); - VezWriteLong(cop_regs[0] + 4 + offset*4, npos); - VezWriteWord(cop_regs[0] + 0x1e + offset*4, VezReadWord(cop_regs[0] + 0x1e + offset*4) + delta); - break; - } - - case 0x0904: { /* X Se Dae and Zero Team uses this variant */ - VezWriteLong(cop_regs[0] + 16 + offset*4, VezReadLong(cop_regs[0] + 16 + offset*4) - VezReadLong(cop_regs[0] + 0x28 + offset*4)); - break; - } - case 0x0905: // 0905 0006 fbfb 0008 - 0194 0288 0088 0000 0000 0000 0000 0000 - VezWriteLong(cop_regs[0] + 16 + offset*4, VezReadLong(cop_regs[0] + 16 + offset*4) + VezReadLong(cop_regs[0] + 0x28 + offset*4)); - break; - - case 0x130e: // 130e 0005 bf7f 0010 - 0984 0aa4 0d82 0aa2 039b 0b9a 0b9a 0a9a - case 0x138e: - case 0x338e: { // 338e 0005 bf7f 0030 - 0984 0aa4 0d82 0aa2 039c 0b9c 0b9c 0a9a - INT32 dx = VezReadLong(cop_regs[1]+4) - VezReadLong(cop_regs[0]+4); - INT32 dy = VezReadLong(cop_regs[1]+8) - VezReadLong(cop_regs[0]+8); - - if(!dy) { - cop_status |= 0x8000; - cop_angle = 0; - } else { - cop_angle = (UINT16)(atan(double(dx)/double(dy)) * 128 / M_PI); - if(dy<0) - cop_angle += 0x80; - } - - if(data & 0x0080) { - VezWriteByte(cop_regs[0]+0x34, cop_angle); - } - break; - } - - case 0x2208: - case 0x2288: { // 2208 0005 f5df 0020 - 0f8a 0b8a 0388 0b9a 0b9a 0a9a 0000 0000 - INT32 dx = VezReadWord(cop_regs[0]+0x12); - INT32 dy = VezReadWord(cop_regs[0]+0x16); - - if(!dy) { - cop_status |= 0x8000; - cop_angle = 0; - } else { - cop_angle = (UINT16)(atan(double(dx)/double(dy)) * 128 / M_PI); - if(dy<0) - cop_angle += 0x80; - } - - if(data & 0x0080) { - VezWriteByte(cop_regs[0]+0x34, cop_angle); - } - break; - } - - case 0x2a05: { // 2a05 0006 ebeb 0028 - 09af 0a82 0082 0a8f 018e 0000 0000 0000 - INT32 delta = VezReadWord(cop_regs[1] + 0x1e + offset*4); - VezWriteLong(cop_regs[0] + 4+2 + offset*4, VezReadWord(cop_regs[0] + 4+2 + offset*4) + delta); - VezWriteLong(cop_regs[0] + 0x1e + offset*4, VezReadWord(cop_regs[0] + 0x1e + offset*4) + delta); - break; - } - - case 0x39b0: - case 0x3b30: - case 0x3bb0: { // 3bb0 0004 007f 0038 - 0f9c 0b9c 0b9c 0b9c 0b9c 0b9c 0b9c 099c - /* TODO: these are actually internally loaded via 0x130e command */ - INT32 dx,dy; - - dx = VezReadLong(cop_regs[1]+4) - VezReadLong(cop_regs[0]+4); - dy = VezReadLong(cop_regs[1]+8) - VezReadLong(cop_regs[0]+8); - - dx = dx >> 16; - dy = dy >> 16; - cop_dist = (UINT16)sqrt((double)(dx*dx+dy*dy)); - - if(data & 0x0080) - VezWriteWord(cop_regs[0]+(data & 0x200 ? 0x3a : 0x38), cop_dist); - break; - } - - case 0x42c2: { // 42c2 0005 fcdd 0040 - 0f9a 0b9a 0b9c 0b9c 0b9c 029c 0000 0000 - INT32 div = VezReadWord(cop_regs[0]+(0x36)); - if(!div) - div = 1; - - /* TODO: bits 5-6-15 */ - cop_status = 7; - - VezWriteWord(cop_regs[0]+(0x38), (cop_dist << (5 - cop_scale)) / div); - break; - } - - case 0x4aa0: { // 4aa0 0005 fcdd 0048 - 0f9a 0b9a 0b9c 0b9c 0b9c 099b 0000 0000 - INT32 div = VezReadWord(cop_regs[0]+(0x38)); - if(!div) - div = 1; - - /* TODO: bits 5-6-15 */ - cop_status = 7; - - VezWriteWord(cop_regs[0]+(0x36), (cop_dist << (5 - cop_scale)) / div); - break; - } - - case 0x6200: { - UINT8 angle = VezReadByte(cop_regs[0]+0x34); - UINT16 flags = VezReadWord(cop_regs[0]); - cop_angle_target &= 0xff; - cop_angle_step &= 0xff; - flags &= ~0x0004; - INT32 delta = angle - cop_angle_target; - if(delta >= 128) - delta -= 256; - else if(delta < -128) - delta += 256; - if(delta < 0) { - if(delta >= -cop_angle_step) { - angle = cop_angle_target; - flags |= 0x0004; - } else - angle += cop_angle_step; - } else { - if(delta <= cop_angle_step) { - angle = cop_angle_target; - flags |= 0x0004; - } else - angle -= cop_angle_step; - } - VezWriteWord(cop_regs[0], flags); - VezWriteByte(cop_regs[0]+0x34, angle); - break; - } - - case 0x8100: { // 8100 0007 fdfb 0080 - 0b9a 0b88 0888 0000 0000 0000 0000 0000 - INT32 raw_angle = (VezReadWord(cop_regs[0]+(0x34)) & 0xff); - double angle = raw_angle * M_PI / 128; - double amp = (65536 >> 5)*(VezReadWord(cop_regs[0]+(0x36)) & 0xff); - INT32 res; - /* TODO: up direction, why? (check machine/seicop.c) */ - if(raw_angle == 0xc0) - amp*=2; - res = INT32(amp*sin(angle)) << cop_scale; - VezWriteLong(cop_regs[0] + 16, res); - break; - } - - case 0x8900: { // 8900 0007 fdfb 0088 - 0b9a 0b8a 088a 0000 0000 0000 0000 0000 - INT32 raw_angle = (VezReadWord(cop_regs[0]+(0x34)) & 0xff); - double angle = raw_angle * M_PI / 128; - double amp = (65536 >> 5)*(VezReadWord(cop_regs[0]+(0x36)) & 0xff); - INT32 res; - /* TODO: left direction, why? (check machine/seicop.c) */ - if(raw_angle == 0x80) - amp*=2; - res = INT32(amp*cos(angle)) << cop_scale; - VezWriteLong(cop_regs[0] + 20, res); - break; - } - - case 0x5205: // 5205 0006 fff7 0050 - 0180 02e0 03a0 00a0 03a0 0000 0000 0000 - // fprintf(stderr, "sprcpt 5205 %04x %04x %04x %08x %08x\n", cop_regs[0], cop_regs[1], cop_regs[3], VezReadLong(cop_regs[0]), VezReadLong(cop_regs[3])); - VezWriteLong(cop_regs[1], VezReadLong(cop_regs[0])); - break; - - case 0x5a05: // 5a05 0006 fff7 0058 - 0180 02e0 03a0 00a0 03a0 0000 0000 0000 - // fprintf(stderr, "sprcpt 5a05 %04x %04x %04x %08x %08x\n", cop_regs[0], cop_regs[1], cop_regs[3], VezReadLong(cop_regs[0]), VezReadLong(cop_regs[3])); - VezWriteLong(cop_regs[1], VezReadLong(cop_regs[0])); - break; - - case 0xf205: // f205 0006 fff7 00f0 - 0182 02e0 03c0 00c0 03c0 0000 0000 0000 - // fprintf(stderr, "sprcpt f205 %04x %04x %04x %08x %08x\n", cop_regs[0]+4, cop_regs[1], cop_regs[3], VezReadLong(cop_regs[0]+4), VezReadLong(cop_regs[3])); - VezWriteLong(cop_regs[2], VezReadLong(cop_regs[0]+4)); - break; - - // raidendx only - case 0x7e05: - VezWriteByte(0x470, VezReadByte(cop_regs[4])); - break; - - case 0xa100: - case 0xa180: - cop_collision_read_pos(0, cop_regs[0], data & 0x0080); - break; - - case 0xa900: - case 0xa980: - cop_collision_read_pos(1, cop_regs[1], data & 0x0080); - break; - - case 0xb100: - cop_collision_update_hitbox(0, cop_regs[2], data); - break; - - case 0xb900: - cop_collision_update_hitbox(1, cop_regs[3], data); - break; - - //default: - // logerror("pcall %04x (%04x:%04x) [%x %x %x %x]\n", data, rps(), rpc(), cop_regs[0], cop_regs[1], cop_regs[2], cop_regs[3]); - } -} - -static UINT8 fade_table(INT32 v) -{ - INT32 low = v & 0x001f; - INT32 high = v & 0x03e0; - - return (low * (high | (high >> 5)) + 0x210) >> 10; -} - -static void cop_dma_trigger_write(UINT16) -{ - switch(cop_dma_mode) { - case 0x14: { - /* TODO: this transfers the whole VRAM, not only spriteram! - For whatever reason, this stopped working as soon as I've implemented DMA slot concept. - Raiden 2 uses this DMA with cop_dma_dst == 0xfffe, effectively changing the order of the uploaded VRAMs. - Also the size is used for doing a sprite limit trickery. - */ - static INT32 rsize = ((0x80 - cop_dma_size[cop_dma_mode]) & 0x7f) +1; - - sprites_cur_start = 0x1000 - (rsize << 5); - #if 0 - INT32 rsize = 32*(0x7f-cop_dma_size); - INT32 radr = 64*cop_dma_adr - rsize; - for(INT32 i=0; i> 5; - bt = fade_table(bt|(pal_brightness_val ^ 0)); - b = ((VezReadWord(src)) & 0x7c00) >> 5; - b = fade_table(b|(pal_brightness_val ^ 0x1f)); - pal_val = ((b + bt) & 0x1f) << 10; - gt = (VezReadWord(src + (cop_dma_adr_rel * 0x400)) & 0x03e0); - gt = fade_table(gt|(pal_brightness_val ^ 0)); - g = ((VezReadWord(src)) & 0x03e0); - g = fade_table(g|(pal_brightness_val ^ 0x1f)); - pal_val |= ((g + gt) & 0x1f) << 5; - rt = (VezReadWord(src + (cop_dma_adr_rel * 0x400)) & 0x001f) << 5; - rt = fade_table(rt|(pal_brightness_val ^ 0)); - r = ((VezReadWord(src)) & 0x001f) << 5; - r = fade_table(r|(pal_brightness_val ^ 0x1f)); - pal_val |= ((r + rt) & 0x1f); - - VezWriteWord(dst, pal_val); - src+=2; - dst+=2; - } - - break; - } - case 0x09: { - UINT32 src,dst,size; - UINT32 i; - - src = (cop_dma_src[cop_dma_mode] << 6); - dst = (cop_dma_dst[cop_dma_mode] << 6); - size = ((cop_dma_size[cop_dma_mode] << 5) - (cop_dma_dst[cop_dma_mode] << 6) + 0x20)/2; - - // printf("%08x %08x %08x\n",src,dst,size); - - for(i = 0;i < size;i++) - { - VezWriteWord(dst, VezReadWord(src)); - src+=2; - dst+=2; - } - - break; - } - case 0x118: - case 0x11f: { - UINT32 length, address; - UINT32 i; - if(cop_dma_dst[cop_dma_mode] != 0x0000) // Invalid? - return; - - address = (cop_dma_src[cop_dma_mode] << 6); - length = (cop_dma_size[cop_dma_mode]+1) << 5; - - // printf("%08x %08x\n",address,length); - - for (i=address;i valj); break; - case 1: xchg_flag = (vali < valj); break; - default: xchg_flag = 0; break; - } - - if(xchg_flag) - { - UINT16 xch_val; - - xch_val = VezReadWord(cop_sort_lookup+i); - VezWriteWord(cop_sort_lookup+i,VezReadWord(cop_sort_lookup+j)); - VezWriteWord(cop_sort_lookup+j,xch_val); - } - } - } - } -} - -static void raiden2_crtc_write(INT32 offset, UINT8 data) -{ - if ((offset & 0x7e) == 0x1c) { - layer_enable = (layer_enable & (0xff << ((~offset & 1) * 8))) | (data << ((offset & 1) * 8)); - return; - } - - if ((offset & 0x7f) >= 0x20 && (offset & 0x7f) <= 0x2b) { - scroll[offset & 0x0f] = data; - return; - } -} - -static void raiden2_bankswitch(INT32 bank) -{ - prg_bank = bank; - bank = (~(bank >> 15) & 1) * 0x20000; - - VezMapArea(0x20000, 0x3ffff, 0, DrvMainROM + bank); - VezMapArea(0x20000, 0x3ffff, 2, DrvMainROM + bank); -} - -static void rd2_cop_write(UINT16 offset, UINT8 data) -{ - if (offset >= 0x600 && offset <= 0x64f) { - raiden2_crtc_write(offset, data); - } - - if ((offset & 0xfffe0) == 0x00700) { - seibu_main_word_write((offset & 0x1f)/2, data); - return; // sound comms - } - - if ((offset & 1) == 0) return; // necessary?? - - UINT16 *copram = (UINT16*)DrvMainRAM; - UINT16 dataword = copram[(offset & 0x7fe)/2]; - - switch (offset & 0x7fe) - { - case 0x41c: - cop_angle_target = dataword; - return; - - case 0x41e: - cop_angle_step = dataword; - return; - - case 0x420: - cop_itoa = (cop_itoa & 0xffff0000) | dataword; - itoa_compute(); - return; - - case 0x422: - cop_itoa = (cop_itoa & 0xffff) | (dataword << 16); - return; - - case 0x424: - cop_itoa_digit_count = dataword; - return; - - case 0x428: - cop_dma_v1 = dataword; - return; - - case 0x42a: - cop_dma_v2 = dataword; - return; - - case 0x436: - cop_hit_baseadr = dataword; - return; - - case 0x444: - cop_scale = dataword & 3; - return; - - case 0x450: - cop_sort_ram_addr = (cop_sort_ram_addr & 0xffff) | (dataword<<16); - return; - - case 0x452: - cop_sort_ram_addr = (cop_sort_ram_addr & ~0xffff) | dataword; - return; - - case 0x454: - cop_sort_lookup = (cop_sort_lookup & 0xffff) | (dataword<<16); - return; - - case 0x456: - cop_sort_lookup = (cop_sort_lookup & ~0xffff) | dataword; - return; - - case 0x458: - cop_sort_param = dataword; - return; - - case 0x45a: - pal_brightness_val = dataword; - return; - - case 0x45c: // palette dma brightness mode - return; - - case 0x470: - cop_bank = dataword; - fg_bank = (cop_bank >> 14)|4; - return; - - case 0x476: - cop_dma_adr_rel = dataword; - return; - - case 0x478: - cop_dma_src[cop_dma_mode] = dataword; - return; - - case 0x47a: - cop_dma_size[cop_dma_mode] = dataword; - return; - - case 0x47c: - cop_dma_dst[cop_dma_mode] = dataword; - return; - - case 0x47e: - cop_dma_mode = dataword & 0x1ff; // ?? - if (dataword & 0xfe00) bprintf (0, _T("dma mode overflow: %4.4x\n"), dataword); - return; - - case 0x4a0: - case 0x4a2: - case 0x4a4: - case 0x4a6: - case 0x4a8: - cop_regs[(offset&0xf)/2] = (cop_regs[(offset&0xf)/2] & 0xffff) | (dataword<<16); - return; - - case 0x4c0: - case 0x4c2: - case 0x4c4: - case 0x4c6: - case 0x4c8: - cop_regs[(offset&0xf)/2] = (cop_regs[(offset&0xf)/2] & 0xffff0000) | dataword; - return; - - case 0x500: - case 0x502: - case 0x504: - cop_cmd_write(offset&0x7,dataword); - return; - - case 0x6c0: - cop_spr_off = dataword; - return; - - case 0x6c2: - sprite_prot_src_addr[0] = dataword; - return; - - case 0x6c6: - dst1 = dataword; - copram[0x762/2] = dst1; - return; - - case 0x6ca: - raiden2_bankswitch(dataword); - return; - - case 0x6cc: - bg_bank = (dataword & 1) << 1; - mg_bank = (dataword & 2) | 1; - return; - - case 0x6d8: - sprite_prot_x = dataword; - return; - - case 0x6da: - sprite_prot_y = dataword; - return; - - case 0x6dc: - cop_spr_maxx = dataword; - return; - - case 0x6de: - sprite_prot_src_write(dataword); - return; - - case 0x6fc: - cop_dma_trigger_write(dataword); - return; - - case 0x6fe: - cop_sort_dma_trig_write(dataword); - return; - } -} - -static UINT8 rd2_cop_read(UINT16 offset) -{ - UINT16 *copram = (UINT16*)DrvMainRAM; - UINT16 ret = copram[offset/2]; - - if ((offset & 0xfffe0) == 0x00700) { - return seibu_main_word_read((offset & 0x1f)/2); - } - - switch (offset & 0x7fe) - { - case 0x580: - ret = cop_hit_status; - break; - -/* case 0x582: - ret = cop_hit_val_y; - break; - - case 0x584: - ret = cop_hit_val_x; - break;*/ - case 0x582: - case 0x584: - case 0x586: //bprintf(0, _T("offset[%X]"), offset); - ret = cop_hit_val[(offset-0x582)/2]; - break; - - case 0x588: - ret = cop_hit_val_stat; - break; - - case 0x590: - case 0x592: - case 0x594: - case 0x596: - case 0x598: - ret = cop_itoa_digits[(offset&0xe)] | (cop_itoa_digits[(offset&0x0e)+1] << 8); - break; - - case 0x5b0: - ret = cop_status; - break; - - case 0x5b2: - ret = cop_dist; - break; - - case 0x5b4: - ret = cop_angle; - break; - - case 0x6c0: - ret = cop_spr_off; - break; - - case 0x6c2: - ret = sprite_prot_src_addr[0]; - break; - - case 0x6dc: - ret = cop_spr_maxx; - break; - - case 0x762: - ret = dst1; - break; - } - - return ret >> ((offset & 1) * 8); -} - -static inline void palette_update_entry(INT32 entry) -{ - UINT16 p = *((UINT16*)(DrvPalRAM + entry)); - - UINT8 r = (p >> 0) & 0x1f; - UINT8 g = (p >> 5) & 0x1f; - UINT8 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[entry/2] = (r*0x10000)+(g*0x100)+b; -} - -static void __fastcall raiden2_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xff000) == 0x1f000) { - DrvPalRAM[address & 0xfff] = data; - palette_update_entry(address & 0xffe); - return; - } - - if ((address & 0xffc00) == 0x00000) { - DrvMainRAM[address] = data; - return; - } - - switch (address) - { - case 0x068e: - case 0x068f: - return; // nop - } - - if ((address & 0xffc00) == 0x00400) { - DrvMainRAM[address] = data; - rd2_cop_write(address, data); - } -} - -static void raidendx_bankswitch(INT32 bank) -{ - prg_bank = bank; - - bank = ((bank >> 12) + 16) * 0x10000; - - VezMapArea(0x20000, 0x2ffff, 0, DrvMainROM + bank); - VezMapArea(0x20000, 0x2ffff, 2, DrvMainROM + bank); -} - -static void __fastcall raidendx_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xff000) == 0x1f000) { - DrvPalRAM[address & 0xfff] = data; - palette_update_entry(address & 0xffe); - return; - } - - if ((address & 0xffc00) == 0x00000) { - DrvMainRAM[address] = data; - return; - } - - if (address >= 0x00600 && address <= 0x0064f) { - raiden2_crtc_write(BITSWAP08(address & 0x7f, 7,6,4,5,3,2,1,0), data); - } - - switch (address) - { - case 0x0470: - case 0x0471: { - DrvMainRAM[address] = data; - cop_bank = *((UINT16*)(DrvMainRAM + 0x470)); - if (address & 1) { - raidendx_bankswitch(cop_bank); - } - fg_bank = ((cop_bank >> 4) & 3) | 4; - } - return; // absolutely must be return! - - case 0x068e: - case 0x068f: - return; // nop - } - - if ((address & 0xffc00) == 0x00400) { - DrvMainRAM[address] = data; - rd2_cop_write(address, data); - } -} - -static void __fastcall zeroteam_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xff000) == 0x0e000) { - DrvPalRAM[address & 0xfff] = data; - palette_update_entry(address & 0xffe); - return; - } - - if ((address & 0xffc00) == 0x00000) { - DrvMainRAM[address] = data; - return; - } - - switch (address) - { - case 0x0470: - case 0x0471: - return; // disable fg banking - - case 0x06cc: - case 0x06cd: // disable bg & mg banking - return; - - case 0x068e: - case 0x068f: - return; // nop - } - - if ((address & 0xffc00) == 0x00400) { - DrvMainRAM[address] = data; - rd2_cop_write(address, data); - } -} - -static UINT8 __fastcall raiden2_main_read(UINT32 address) -{ - if ((address & 0xffc00) == 0x00000) { - return DrvMainRAM[address]; - } - - switch (address) - { - case 0x0740: - return DrvDips[0]; - - case 0x0741: - return DrvDips[1]; - - case 0x0744: - return DrvInputs[0]; - - case 0x0745: - return DrvInputs[0] >> 8; - - case 0x0748: - return DrvInputs[1]; - - case 0x0749: - return DrvInputs[1] >> 8; - - case 0x074c: - return DrvInputs[2]; - - case 0x074d: - return DrvInputs[2] >> 8; - } - - if ((address & 0xffc00) == 0x00400) { - return rd2_cop_read(address); - } - - return 0; -} - -static void tilemap_dma() -{ - memcpy (DrvBgRAM, DrvMainRAM + 0xd000, 0x0800); - memcpy (DrvFgRAM, DrvMainRAM + 0xd800, 0x0800); - memcpy (DrvMgRAM, DrvMainRAM + 0xe000, 0x0800); - memcpy (DrvTxRAM, DrvMainRAM + 0xe800, 0x1000); -} - -static void palettedma() -{ - for (INT32 i = 0; i < 0x1000 / 2; i++) - { - UINT16 palval = *((UINT16*)(DrvMainRAM + 0x1f000 + i * 2)); - - UINT8 r = palval & 0x1f; - UINT8 g = (palval >> 5) & 0x1f; - UINT8 b = (palval >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = (r*0x10000)+(g*0x100)+b; - } -} - -static void __fastcall nzeroteam_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xff800) == 0x00000) { - DrvMainRAM[(address & 0x7ff)] = data; - if (address < 0x400) return; - } - - UINT16 *copram = (UINT16*)DrvMainRAM; - UINT16 dataword = copram[(address & 0x7fe)/2]; - - if (address >= 0x600 && address <= 0x64f) { - raiden2_crtc_write(address & 0xff, data); - return; - } - - if ((address & 0xfffe0) == 0x00780) { - seibu_main_word_write((address & 0x1f)/2, dataword); - return; - } - - switch (address) - { - case 0x400: - tilemap_dma(); - return; - - case 0x402: - palettedma(); - return; - - case 0x420: - r2dx_i_dx = data; - return; - - case 0x422: - r2dx_i_dy = data; - return; - - case 0x424: - case 0x425: - r2dx_i_sdist = (r2dx_i_sdist & 0xffff0000) | dataword; - return; - - case 0x426: - case 0x427: - r2dx_i_sdist = (r2dx_i_sdist & 0x0000ffff) | (dataword << 16); - return; - - case 0x428: - r2dx_i_angle = data * 4; - return; - } -} - -static UINT8 __fastcall nzeroteam_main_read(UINT32 address) -{ - if ((address & 0xffc00) == 0x00000) { - return DrvMainRAM[address]; - } - - if ((address & 0xfffe0) == 0x00780) { - return seibu_main_word_read((address & 0x1f)/2) >> ((address & 1) * 8); - } - - switch (address) - { - case 0x430: - return DrvCopxROM[(r2dx_i_dy << 8) | r2dx_i_dx]; - - case 0x432: - return (UINT32)sqrt((double)r2dx_i_sdist) >> 0; - - case 0x433: - return (UINT32)sqrt((double)r2dx_i_sdist) >> 8; - - case 0x434: - return DrvCopxROM[0x10000 + r2dx_i_angle + 0]; - - case 0x435: - return DrvCopxROM[0x10000 + r2dx_i_angle + 1]; - - case 0x436: - return DrvCopxROM[0x10000 + r2dx_i_angle + 2]; - - case 0x437: - return DrvCopxROM[0x10000 + r2dx_i_angle + 3]; - - case 0x740: - return DrvDips[0]; - - case 0x741: - return DrvDips[1]; - - case 0x744: - return DrvInputs[0]; - - case 0x745: - return DrvInputs[0] >> 8; - - case 0x74c: - return DrvInputs[1]; - - case 0x74d: - return DrvInputs[1] >> 8; - } - - return 0; -} - -static void __fastcall zerotm2k_main_write(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x748: - EEPROMWrite((data & 0x02), (data & 0x01), (data >> 2) & 1); - return; - - case 0x749: - return; - } - - nzeroteam_main_write(address, data); -} - -static UINT8 __fastcall zerotm2k_main_read(UINT32 address) -{ - switch (address) - { - case 0x740: - return DrvInputs[1]; - - case 0x741: - return DrvInputs[1] >> 8; - - case 0x744: - return DrvInputs[0]; - - case 0x745: - return ((DrvInputs[0] >> 8) & 0x7f) | (EEPROMRead() ? 0x80 : 0); - - case 0x74c: - return DrvInputs[2]; - - case 0x74d: - return DrvInputs[2] >> 8; - } - - return nzeroteam_main_read(address); -} - -static void r2dx_bankswitch(INT32 set_bank, INT32 set_main) -{ - INT32 bank0 = ((set_main & 0x1) * 0x200000); - INT32 bank1 = ((set_bank & 0xf) * 0x010000); - - VezMapArea(0x20000, 0x2ffff, 0, DrvMainROM + 0x100000 + bank0 + bank1); - VezMapArea(0x20000, 0x2ffff, 2, DrvMainROM + 0x100000 + bank0 + bank1); - - VezMapArea(0x30000, 0xfffff, 0, DrvMainROM + 0x030000 + bank0); - VezMapArea(0x30000, 0xfffff, 2, DrvMainROM + 0x030000 + bank0); -} - -static void r2dx_okibankswitch() -{ - memcpy (DrvSndROM0, DrvSndROM1 + r2dx_okibank * 0x40000, 0x40000); -} - -static void __fastcall r2dx_main_write(UINT32 address, UINT8 data) -{ - if ((address & 0xff800) == 0x00000) { - DrvMainRAM[(address & 0x7ff)] = data; - if (address < 0x400) return; - } - - if (address >= 0x600 && address <= 0x64f) { - raiden2_crtc_write(address & 0xff, data); - return; - } - - UINT16 *copram = (UINT16*)DrvMainRAM; - UINT16 dataword = copram[(address & 0x7fe)/2]; - - if ((address & 1) == 0 && address < 0x700) return; // necessary - - switch (address & 0x7fe) - { - case 0x400: - tilemap_dma(); - return; - - case 0x402: - palettedma(); - return; - - case 0x404: - prg_bank = dataword & 0x0f; - r2dx_bankswitch(prg_bank, r2dx_gameselect); - return; - - case 0x406: - bg_bank = ((dataword >> 4) & 1) + 0; - mg_bank = ((dataword >> 5) & 1) + 2; - fg_bank = ((dataword >> 0) & 3) + 4; - return; - - case 0x420: - r2dx_i_dx = dataword & 0xff; - return; - - case 0x422: - r2dx_i_dy = dataword & 0xff; - return; - - case 0x424: - r2dx_i_sdist = (r2dx_i_sdist & 0xffff0000) | dataword; - return; - - case 0x426: - r2dx_i_sdist = (r2dx_i_sdist & 0x0000ffff) | (dataword << 16); - return; - - case 0x428: - r2dx_i_angle = (dataword & 0xff) * 4; - return; - - case 0x6c0: - cop_spr_off = dataword; - return; - - case 0x6c2: - sprite_prot_src_addr[0] = dataword; - return; - - case 0x6c6: - dst1 = dataword; - copram[0x762/2] = dst1; - return; - - case 0x6d8: - sprite_prot_x = dataword; - return; - - case 0x6da: - sprite_prot_y = dataword; - return; - - case 0x6dc: - cop_spr_maxx = dataword; - return; - - case 0x6de: - sprite_prot_src_write(dataword); - return; - - case 0x700: - { - EEPROMWrite((dataword & 0x10), (dataword & 0x08), ((dataword & 0x20) >> 5)); - - r2dx_gameselect = tx_bank = (dataword & 4) >> 2; - - r2dx_bankswitch(prg_bank, r2dx_gameselect); - - r2dx_okibank = dataword & 3; - r2dx_okibankswitch(); - } - return; - - case 0x780: // oki write - MSM6295Command(0, dataword & 0xff); - return; - } -} - -static UINT8 __fastcall r2dx_main_read(UINT32 address) -{ - if ((address & 0xffc00) == 0x00000) { - return DrvMainRAM[address]; - } - - switch (address) - { - case 0x430: - return DrvCopxROM[(r2dx_i_dy << 8) | r2dx_i_dx]; - - case 0x432: - return (UINT32)sqrt((double)r2dx_i_sdist) >> 0; - - case 0x433: - return (UINT32)sqrt((double)r2dx_i_sdist) >> 8; - - case 0x434: - return DrvCopxROM[0x10000 + r2dx_i_angle + 0]; - - case 0x435: - return DrvCopxROM[0x10000 + r2dx_i_angle + 1]; - - case 0x436: - return DrvCopxROM[0x10000 + r2dx_i_angle + 2]; - - case 0x437: - return DrvCopxROM[0x10000 + r2dx_i_angle + 3]; - - case 0x6c0: - return cop_spr_off >> 0; - - case 0x6c1: - return cop_spr_off >> 8; - - case 0x6c2: - return sprite_prot_src_addr[0] >> 0; - - case 0x6c3: - return sprite_prot_src_addr[0] >> 8; - - case 0x6dc: - return cop_spr_maxx >> 0; - - case 0x6dd: - return cop_spr_maxx >> 8; - - case 0x740: - case 0x741: - return 0xff; // debug_r - - case 0x744: - return DrvInputs[0]; - - case 0x745: - return DrvInputs[0] >> 8; - - case 0x74c: - return (DrvDips[0] & 0xc0) | (DrvInputs[1] & 0x2f) | (EEPROMRead() ? 0x10 : 0); - - case 0x74d: - return DrvInputs[1] >> 8; - - case 0x762: - return dst1 >> 0; - - case 0x763: - return dst1 >> 8; - - case 0x780: - return MSM6295ReadStatus(0); - } - - return DrvMainRAM[address & 0x7ff]; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - VezOpen(0); - VezReset(); - VezClose(); - - if (game_select != 4) { - seibu_sound_reset(); - } - - if (game_select == 4) - { - MSM6295Reset(0); - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - EEPROMFill(DrvEeprom, 0, 0x80); - } - } - - if (game_select == 6) - { - EEPROMReset(); - } - - prg_bank = 0; - layer_enable = 0; - bg_bank = 0; - fg_bank = (game_select >= 2) ? 2 : 6; - mg_bank = 1; - tx_bank = 0; - r2dx_okibank = 0; - - SeibuCopReset(); - - if (game_select >= 4) sprites_cur_start = 0x1000 - 8; // or no sprites in newzeroteam - - memset (hold_coin, 0, 4 * sizeof(INT32)); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x400000; - - SeibuZ80ROM = Next; Next += 0x020000; - - DrvEeprom = Next; Next += 0x000080; - - DrvCopxROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x080000; - DrvGfxROM1 = Next; Next += 0x800000; - DrvGfxROM2 = Next; Next += 0x1000000; - - DrvTransTab = Next; Next += 0x800000 / 0x100; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - bitmap32 = (UINT32*)Next; Next += 320 * 256 * sizeof(UINT32); - DrvAlphaTable = Next; Next += 0x000800; - - AllRam = Next; - - DrvMainRAM = Next; Next += 0x020000; - - DrvTxRAM = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x000800; - DrvMgRAM = Next; Next += 0x000800; - - DrvSprRAM = Next; Next += 0x001000; - - DrvPalRAM = Next; Next += 0x001000; - - SeibuZ80RAM = Next; Next += 0x000800; - - scroll = Next; Next += 0x00000c; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvCreateAlphaTable(INT32 raiden2_alpha) -{ - memset (DrvAlphaTable, 0, 0x800); - - if (raiden2_alpha) { // raiden2/dx - DrvAlphaTable[0x380] = 1; - DrvAlphaTable[0x5de] = 1; - DrvAlphaTable[0x75c] = 1; - - memset (DrvAlphaTable + 0x3c0, 1, 0x30); - memset (DrvAlphaTable + 0x4f8, 1, 0x08); - memset (DrvAlphaTable + 0x5c8, 1, 0x08); - memset (DrvAlphaTable + 0x5e8, 1, 0x08); - memset (DrvAlphaTable + 0x5f8, 1, 0x08); - - memset (DrvAlphaTable + 0x6c8, 1, 0x08); - memset (DrvAlphaTable + 0x6d8, 1, 0x08); - memset (DrvAlphaTable + 0x6e8, 1, 0x08); - memset (DrvAlphaTable + 0x6f8, 1, 0x08); - - memset (DrvAlphaTable + 0x70d, 1, 0x02); - memset (DrvAlphaTable + 0x71c, 1, 0x03); - memset (DrvAlphaTable + 0x72d, 1, 0x02); - memset (DrvAlphaTable + 0x73d, 1, 0x02); - memset (DrvAlphaTable + 0x74d, 1, 0x02); - memset (DrvAlphaTable + 0x76c, 1, 0x03); - memset (DrvAlphaTable + 0x77d, 1, 0x02); - memset (DrvAlphaTable + 0x7c8, 1, 0x08); - } - else // zero team - { - DrvAlphaTable[0x37e] = 1; - DrvAlphaTable[0x38e] = 1; - DrvAlphaTable[0x52e] = 1; - DrvAlphaTable[0x5de] = 1; - } -} - -static void DrvCreateTransTab() -{ - memset (DrvTransTab, 1, 0x800000/0x100); - - for (INT32 i = 0; i < 0x800000; i+=0x100) { - for (INT32 j = 0; j < 0x100; j++) { - if (DrvGfxROM1[i+j] != 0x0f) { - DrvTransTab[i/0x100] = 0; - break; - } - } - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 8,12,0,4}; - INT32 Plane1[4] = { STEP4(0,1) }; - INT32 XOffs0[16] = { 3,2,1,0,19,18,17,16,3+64*8, 2+64*8, 1+64*8, 0+64*8,19+64*8,18+64*8,17+64*8,16+64*8 }; - INT32 XOffs1[16] = { 4, 0, 12, 8, 20, 16, 28, 24, 36, 32, 44, 40, 52, 48, 60, 56 }; - INT32 YOffs0[16] = { STEP16(0,32) }; - INT32 YOffs1[16] = { STEP16(0,64) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x800000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x040000); - - GfxDecode(0x02000, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x400000); - - GfxDecode(0x08000, 4, 16, 16, Plane0, XOffs0, YOffs0, 0x400, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x800000); - - GfxDecode(0x10000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static const UINT8 rotate_r2[512] = { - 0x11, 0x17, 0x0d, 0x03, 0x17, 0x1f, 0x08, 0x1a, 0x0f, 0x04, 0x1e, 0x13, 0x19, 0x0e, 0x0e, 0x05, - 0x06, 0x07, 0x08, 0x08, 0x0d, 0x18, 0x11, 0x1a, 0x0b, 0x06, 0x12, 0x0c, 0x1f, 0x0b, 0x1c, 0x19, - 0x00, 0x1b, 0x0c, 0x09, 0x1d, 0x18, 0x1a, 0x16, 0x1a, 0x08, 0x03, 0x04, 0x0f, 0x1d, 0x16, 0x07, - 0x1a, 0x12, 0x01, 0x0b, 0x00, 0x0f, 0x1e, 0x10, 0x09, 0x0f, 0x10, 0x09, 0x0a, 0x1c, 0x0d, 0x08, - 0x06, 0x1a, 0x06, 0x02, 0x11, 0x1e, 0x0c, 0x1c, 0x11, 0x0f, 0x19, 0x0a, 0x16, 0x14, 0x18, 0x11, - 0x0b, 0x0d, 0x1c, 0x1f, 0x0d, 0x1f, 0x0d, 0x19, 0x0d, 0x04, 0x19, 0x0f, 0x06, 0x13, 0x0c, 0x1b, - 0x1f, 0x12, 0x15, 0x1a, 0x04, 0x02, 0x06, 0x03, 0x0a, 0x0d, 0x12, 0x09, 0x17, 0x1d, 0x12, 0x10, - 0x05, 0x07, 0x03, 0x00, 0x14, 0x07, 0x14, 0x1a, 0x1c, 0x0a, 0x10, 0x0f, 0x0b, 0x0c, 0x08, 0x0f, - 0x07, 0x00, 0x13, 0x1c, 0x04, 0x15, 0x0e, 0x02, 0x17, 0x17, 0x00, 0x03, 0x18, 0x00, 0x02, 0x13, - 0x14, 0x0c, 0x01, 0x0a, 0x15, 0x0b, 0x0a, 0x1c, 0x1b, 0x06, 0x17, 0x1d, 0x11, 0x1f, 0x10, 0x04, - 0x1a, 0x01, 0x1b, 0x13, 0x03, 0x09, 0x09, 0x0f, 0x0d, 0x03, 0x15, 0x1c, 0x04, 0x06, 0x06, 0x0b, - 0x04, 0x0a, 0x1f, 0x16, 0x11, 0x0a, 0x05, 0x05, 0x0c, 0x1c, 0x10, 0x0c, 0x11, 0x04, 0x10, 0x1a, - 0x06, 0x10, 0x19, 0x06, 0x15, 0x0f, 0x11, 0x01, 0x10, 0x0c, 0x1d, 0x05, 0x1f, 0x05, 0x12, 0x16, - 0x02, 0x12, 0x14, 0x0d, 0x14, 0x0f, 0x04, 0x07, 0x13, 0x01, 0x11, 0x1c, 0x1c, 0x1d, 0x0e, 0x06, - 0x1d, 0x13, 0x10, 0x06, 0x0f, 0x02, 0x12, 0x10, 0x1e, 0x0c, 0x17, 0x15, 0x0b, 0x1f, 0x01, 0x19, - 0x02, 0x01, 0x07, 0x1d, 0x13, 0x19, 0x0f, 0x0f, 0x10, 0x03, 0x1e, 0x03, 0x0d, 0x0a, 0x0c, 0x0d, - - 0x16, 0x1f, 0x16, 0x1a, 0x1c, 0x16, 0x01, 0x03, 0x01, 0x08, 0x14, 0x19, 0x03, 0x1e, 0x08, 0x02, - 0x02, 0x1d, 0x15, 0x00, 0x09, 0x1d, 0x03, 0x11, 0x11, 0x0b, 0x1b, 0x14, 0x01, 0x1e, 0x11, 0x12, - 0x1d, 0x06, 0x0b, 0x13, 0x1e, 0x16, 0x0d, 0x10, 0x11, 0x1f, 0x1c, 0x15, 0x0d, 0x1a, 0x13, 0x1f, - 0x0e, 0x05, 0x10, 0x06, 0x0d, 0x1c, 0x07, 0x19, 0x06, 0x1d, 0x11, 0x00, 0x1c, 0x05, 0x0b, 0x1d, - 0x1c, 0x06, 0x05, 0x1d, 0x00, 0x13, 0x00, 0x12, 0x1b, 0x17, 0x1a, 0x1b, 0x17, 0x1c, 0x16, 0x0a, - 0x11, 0x15, 0x0f, 0x0b, 0x0f, 0x07, 0x0e, 0x04, 0x13, 0x00, 0x1c, 0x05, 0x16, 0x00, 0x1a, 0x04, - 0x17, 0x04, 0x08, 0x1b, 0x05, 0x12, 0x1d, 0x0d, 0x02, 0x16, 0x12, 0x0e, 0x06, 0x08, 0x14, 0x07, - 0x0e, 0x0f, 0x15, 0x13, 0x12, 0x00, 0x1d, 0x16, 0x1b, 0x18, 0x1f, 0x05, 0x12, 0x13, 0x01, 0x0c, - 0x12, 0x04, 0x19, 0x13, 0x12, 0x15, 0x07, 0x06, 0x0a, 0x00, 0x09, 0x14, 0x1e, 0x03, 0x10, 0x1b, - 0x08, 0x1a, 0x07, 0x02, 0x1b, 0x0d, 0x18, 0x13, 0x02, 0x07, 0x1e, 0x05, 0x15, 0x02, 0x06, 0x18, - 0x12, 0x09, 0x1c, 0x07, 0x0b, 0x02, 0x03, 0x00, 0x18, 0x18, 0x03, 0x0f, 0x02, 0x0f, 0x10, 0x09, - 0x05, 0x18, 0x08, 0x1b, 0x0d, 0x10, 0x03, 0x00, 0x0c, 0x14, 0x1d, 0x08, 0x02, 0x10, 0x0b, 0x0c, - 0x00, 0x0d, 0x0d, 0x0a, 0x06, 0x1c, 0x09, 0x19, 0x1b, 0x14, 0x18, 0x0f, 0x02, 0x07, 0x05, 0x04, - 0x1c, 0x15, 0x18, 0x00, 0x0b, 0x10, 0x19, 0x1c, 0x1b, 0x08, 0x1d, 0x12, 0x17, 0x1d, 0x0c, 0x01, - 0x03, 0x0d, 0x03, 0x0d, 0x15, 0x0e, 0x16, 0x08, 0x05, 0x11, 0x1f, 0x03, 0x16, 0x03, 0x0f, 0x10, - 0x08, 0x19, 0x18, 0x15, 0x1f, 0x05, 0x00, 0x09, 0x0e, 0x05, 0x16, 0x1b, 0x01, 0x08, 0x08, 0x1f, -}; - -static const UINT8 x5_r2[256] = { - 0x08, 0x09, 0x1f, 0x0f, 0x09, 0x09, 0x0b, 0x1d, 0x06, 0x13, 0x02, 0x15, 0x02, 0x0c, 0x0d, 0x19, - 0x03, 0x13, 0x0c, 0x1f, 0x1a, 0x18, 0x17, 0x10, 0x0a, 0x19, 0x15, 0x04, 0x1f, 0x11, 0x1c, 0x02, - 0x0e, 0x08, 0x06, 0x0a, 0x07, 0x1c, 0x10, 0x04, 0x11, 0x0c, 0x0a, 0x19, 0x0a, 0x04, 0x17, 0x07, - 0x16, 0x1b, 0x1d, 0x15, 0x1d, 0x13, 0x0e, 0x03, 0x1a, 0x11, 0x14, 0x14, 0x03, 0x18, 0x07, 0x03, - 0x08, 0x1a, 0x02, 0x0f, 0x0b, 0x11, 0x1c, 0x05, 0x19, 0x1d, 0x05, 0x01, 0x1f, 0x1c, 0x1d, 0x07, - 0x07, 0x0c, 0x02, 0x16, 0x0e, 0x06, 0x0b, 0x07, 0x01, 0x1a, 0x09, 0x0e, 0x0e, 0x07, 0x0e, 0x15, - 0x01, 0x16, 0x13, 0x15, 0x14, 0x07, 0x0c, 0x1f, 0x1f, 0x19, 0x17, 0x12, 0x19, 0x17, 0x0a, 0x1f, - 0x0c, 0x16, 0x15, 0x1e, 0x05, 0x14, 0x05, 0x1c, 0x0b, 0x0d, 0x0c, 0x0a, 0x05, 0x09, 0x14, 0x02, - 0x10, 0x02, 0x13, 0x05, 0x12, 0x17, 0x03, 0x0b, 0x1b, 0x06, 0x15, 0x0b, 0x01, 0x0b, 0x1b, 0x09, - 0x10, 0x0a, 0x1e, 0x09, 0x08, 0x0a, 0x04, 0x13, 0x04, 0x12, 0x04, 0x0f, 0x0b, 0x0c, 0x06, 0x07, - 0x03, 0x18, 0x00, 0x1e, 0x17, 0x00, 0x16, 0x08, 0x0d, 0x1c, 0x09, 0x07, 0x17, 0x18, 0x0b, 0x0d, - 0x11, 0x0f, 0x14, 0x1e, 0x1a, 0x1b, 0x09, 0x15, 0x03, 0x07, 0x12, 0x16, 0x15, 0x11, 0x16, 0x1e, - 0x14, 0x15, 0x00, 0x05, 0x15, 0x18, 0x18, 0x12, 0x18, 0x1e, 0x06, 0x06, 0x0c, 0x1a, 0x04, 0x0b, - 0x05, 0x08, 0x04, 0x1f, 0x0c, 0x08, 0x0a, 0x1f, 0x1a, 0x16, 0x0e, 0x1e, 0x16, 0x18, 0x18, 0x05, - 0x00, 0x1a, 0x05, 0x15, 0x19, 0x10, 0x03, 0x0e, 0x10, 0x1c, 0x0a, 0x18, 0x00, 0x16, 0x0b, 0x05, - 0x05, 0x15, 0x11, 0x0a, 0x1c, 0x00, 0x1e, 0x1f, 0x17, 0x12, 0x0a, 0x1c, 0x07, 0x04, 0x1f, 0x1a, -}; - -static const UINT16 x11_r2[256] = { - 0x347, 0x0f2, 0x182, 0x58f, 0x1f4, 0x42c, 0x407, 0x5f0, 0x6df, 0x2db, 0x585, 0x5fe, 0x394, 0x542, 0x3e8, 0x574, - 0x4ea, 0x6d3, 0x6b7, 0x65b, 0x324, 0x143, 0x22a, 0x11d, 0x124, 0x365, 0x7ca, 0x3d6, 0x1d2, 0x7cd, 0x6b1, 0x4f1, - 0x1de, 0x674, 0x685, 0x779, 0x264, 0x6d8, 0x379, 0x7ce, 0x201, 0x73b, 0x5c9, 0x025, 0x338, 0x4b2, 0x697, 0x567, - 0x312, 0x04e, 0x78d, 0x492, 0x044, 0x203, 0x437, 0x04b, 0x729, 0x197, 0x6e2, 0x552, 0x517, 0x3c9, 0x09c, 0x3de, - 0x2f8, 0x259, 0x1f0, 0x6ce, 0x6d6, 0x55d, 0x223, 0x65e, 0x7ca, 0x330, 0x3f7, 0x348, 0x640, 0x26d, 0x340, 0x2df, - 0x752, 0x792, 0x5b0, 0x2fb, 0x398, 0x75c, 0x0a2, 0x524, 0x538, 0x74c, 0x1c5, 0x5a2, 0x522, 0x7c3, 0x6b3, 0x4f0, - 0x5ac, 0x40b, 0x3e0, 0x1c8, 0x6ff, 0x291, 0x7c4, 0x47c, 0x6d9, 0x248, 0x623, 0x78d, 0x2cd, 0x356, 0x12a, 0x0bc, - 0x582, 0x1d8, 0x1c6, 0x6eb, 0x7c2, 0x7f9, 0x650, 0x57d, 0x701, 0x7e5, 0x118, 0x1b4, 0x4ad, 0x2b8, 0x2bb, 0x765, - 0x2d9, 0x46a, 0x020, 0x2da, 0x5e4, 0x115, 0x53c, 0x2b4, 0x16d, 0x0f7, 0x633, 0x1a6, 0x0a0, 0x3e6, 0x29d, 0x77b, - 0x558, 0x185, 0x7b9, 0x0b1, 0x36e, 0x4d3, 0x7e2, 0x5f9, 0x3d2, 0x21e, 0x0e1, 0x2ac, 0x0fc, 0x0fc, 0x66d, 0x7b5, - 0x4af, 0x627, 0x0f4, 0x621, 0x58f, 0x3d7, 0x1bc, 0x10a, 0x458, 0x259, 0x451, 0x770, 0x107, 0x134, 0x162, 0x32f, - 0x5cf, 0x6c9, 0x670, 0x2d4, 0x0da, 0x739, 0x30c, 0x62f, 0x4af, 0x0e2, 0x3e3, 0x65c, 0x214, 0x066, 0x47d, 0x2f2, - 0x729, 0x566, 0x450, 0x3f2, 0x35d, 0x593, 0x593, 0x532, 0x008, 0x270, 0x479, 0x358, 0x6f3, 0x7ed, 0x240, 0x587, - 0x581, 0x00f, 0x750, 0x4d8, 0x1ab, 0x100, 0x47f, 0x34f, 0x497, 0x240, 0x769, 0x76f, 0x705, 0x375, 0x684, 0x273, - 0x01f, 0x268, 0x2cc, 0x2d7, 0x5d4, 0x284, 0x40c, 0x5e8, 0x7c1, 0x281, 0x518, 0x4b0, 0x136, 0x73b, 0x3ea, 0x023, - 0x1c1, 0x7de, 0x106, 0x275, 0x1e1, 0x503, 0x30a, 0x271, 0x4f8, 0x52b, 0x266, 0x375, 0x024, 0x399, 0x672, 0x6f8, -}; - -static const UINT8 rotate_zt[256] = { - 0x0a, 0x0a, 0x0b, 0x0e, 0x02, 0x12, 0x0d, 0x16, 0x01, 0x1b, 0x08, 0x15, 0x03, 0x14, 0x0f, 0x1f, - 0x10, 0x1d, 0x03, 0x0b, 0x16, 0x07, 0x10, 0x19, 0x1f, 0x1c, 0x03, 0x0b, 0x15, 0x0d, 0x00, 0x14, - 0x15, 0x0d, 0x0c, 0x1b, 0x18, 0x18, 0x0b, 0x1b, 0x16, 0x17, 0x01, 0x0e, 0x14, 0x0c, 0x1e, 0x13, - 0x13, 0x12, 0x19, 0x0b, 0x1b, 0x1a, 0x0d, 0x04, 0x00, 0x00, 0x12, 0x06, 0x0f, 0x1c, 0x19, 0x1b, - 0x01, 0x04, 0x15, 0x1c, 0x02, 0x13, 0x0f, 0x09, 0x1c, 0x05, 0x09, 0x05, 0x0d, 0x17, 0x13, 0x1f, - 0x17, 0x19, 0x0f, 0x04, 0x05, 0x03, 0x0c, 0x03, 0x13, 0x02, 0x09, 0x0d, 0x1d, 0x1a, 0x02, 0x0d, - 0x0d, 0x0f, 0x13, 0x1c, 0x05, 0x03, 0x09, 0x08, 0x03, 0x1d, 0x05, 0x1f, 0x0b, 0x15, 0x06, 0x10, - 0x0c, 0x15, 0x18, 0x0c, 0x18, 0x1f, 0x1d, 0x1d, 0x1d, 0x0e, 0x1f, 0x0c, 0x14, 0x0d, 0x0a, 0x08, - 0x0f, 0x12, 0x08, 0x06, 0x0d, 0x1d, 0x19, 0x1e, 0x1c, 0x08, 0x09, 0x1e, 0x1a, 0x14, 0x08, 0x17, - 0x11, 0x0e, 0x1a, 0x18, 0x01, 0x08, 0x05, 0x01, 0x06, 0x1e, 0x15, 0x1d, 0x0c, 0x09, 0x1b, 0x07, - 0x12, 0x00, 0x0c, 0x05, 0x03, 0x08, 0x19, 0x09, 0x09, 0x06, 0x13, 0x12, 0x0b, 0x1a, 0x09, 0x09, - 0x03, 0x09, 0x00, 0x07, 0x1c, 0x10, 0x14, 0x01, 0x17, 0x03, 0x05, 0x11, 0x1e, 0x12, 0x14, 0x19, - 0x10, 0x10, 0x08, 0x08, 0x07, 0x0c, 0x12, 0x1f, 0x02, 0x08, 0x1f, 0x14, 0x1e, 0x14, 0x02, 0x13, - 0x04, 0x10, 0x1e, 0x08, 0x0b, 0x14, 0x19, 0x1a, 0x07, 0x1c, 0x13, 0x07, 0x10, 0x14, 0x15, 0x1e, - 0x18, 0x0a, 0x0c, 0x1f, 0x0e, 0x05, 0x11, 0x08, 0x04, 0x06, 0x12, 0x0c, 0x00, 0x04, 0x0b, 0x07, - 0x14, 0x0a, 0x0c, 0x16, 0x02, 0x0a, 0x0f, 0x0d, 0x0c, 0x1d, 0x1e, 0x13, 0x0a, 0x08, 0x12, 0x0b, -}; - -static const UINT8 x5_zt[256] = { - 0x0d, 0x14, 0x13, 0x1b, 0x1a, 0x05, 0x1a, 0x05, 0x1b, 0x17, 0x0d, 0x0f, 0x00, 0x17, 0x09, 0x04, - 0x13, 0x0f, 0x14, 0x17, 0x14, 0x0f, 0x1b, 0x0a, 0x0a, 0x15, 0x07, 0x0b, 0x0e, 0x05, 0x18, 0x12, - 0x1c, 0x01, 0x17, 0x02, 0x04, 0x00, 0x06, 0x12, 0x00, 0x0a, 0x1c, 0x19, 0x10, 0x1b, 0x16, 0x03, - 0x1c, 0x13, 0x16, 0x13, 0x15, 0x1d, 0x04, 0x14, 0x17, 0x1d, 0x01, 0x03, 0x1f, 0x1f, 0x1a, 0x10, - 0x08, 0x0c, 0x09, 0x16, 0x04, 0x19, 0x03, 0x14, 0x0c, 0x1d, 0x09, 0x08, 0x00, 0x1c, 0x0b, 0x18, - 0x1b, 0x00, 0x16, 0x0f, 0x0b, 0x1c, 0x0d, 0x16, 0x09, 0x15, 0x0c, 0x01, 0x18, 0x04, 0x04, 0x03, - 0x11, 0x0f, 0x03, 0x17, 0x04, 0x0a, 0x05, 0x1b, 0x08, 0x07, 0x0e, 0x08, 0x06, 0x16, 0x0f, 0x0d, - 0x0a, 0x14, 0x0a, 0x11, 0x14, 0x02, 0x08, 0x1f, 0x0e, 0x13, 0x0e, 0x02, 0x08, 0x13, 0x04, 0x19, - 0x0e, 0x00, 0x01, 0x1d, 0x02, 0x19, 0x08, 0x1c, 0x13, 0x09, 0x11, 0x14, 0x1e, 0x04, 0x03, 0x18, - 0x1f, 0x05, 0x0f, 0x03, 0x09, 0x0d, 0x12, 0x0f, 0x0d, 0x0e, 0x15, 0x1a, 0x17, 0x1c, 0x1d, 0x10, - 0x15, 0x00, 0x18, 0x18, 0x00, 0x08, 0x08, 0x01, 0x0d, 0x10, 0x14, 0x12, 0x03, 0x1c, 0x05, 0x0a, - 0x0f, 0x0d, 0x15, 0x00, 0x0b, 0x1f, 0x00, 0x1d, 0x1d, 0x1a, 0x13, 0x16, 0x08, 0x1b, 0x03, 0x12, - 0x02, 0x10, 0x0e, 0x10, 0x04, 0x05, 0x09, 0x07, 0x1d, 0x04, 0x05, 0x06, 0x17, 0x05, 0x1a, 0x04, - 0x1f, 0x0e, 0x09, 0x13, 0x15, 0x12, 0x1c, 0x13, 0x03, 0x09, 0x12, 0x08, 0x19, 0x17, 0x00, 0x19, - 0x1f, 0x06, 0x1c, 0x05, 0x18, 0x0a, 0x1f, 0x1e, 0x0d, 0x05, 0x1e, 0x1a, 0x11, 0x13, 0x15, 0x0c, - 0x05, 0x16, 0x11, 0x06, 0x12, 0x0c, 0x0c, 0x0f, 0x1c, 0x18, 0x08, 0x1e, 0x1c, 0x16, 0x15, 0x03, -}; - -static const UINT16 x11_zt[512] = { - 0x7e9, 0x625, 0x625, 0x006, 0x006, 0x14a, 0x14a, 0x7e9, 0x657, 0x417, 0x417, 0x1a7, 0x1a7, 0x22f, 0x22f, 0x657, - 0x37e, 0x447, 0x447, 0x117, 0x117, 0x735, 0x735, 0x37e, 0x3be, 0x487, 0x487, 0x724, 0x724, 0x6e3, 0x6e3, 0x3be, - 0x646, 0x035, 0x035, 0x57e, 0x57e, 0x134, 0x134, 0x646, 0x09a, 0x4d1, 0x4d1, 0x511, 0x511, 0x5d5, 0x5d5, 0x09a, - 0x3e2, 0x5c6, 0x5c6, 0x3b6, 0x3b6, 0x354, 0x354, 0x3e2, 0x6e3, 0x7d6, 0x7d6, 0x317, 0x317, 0x1f0, 0x1f0, 0x6e3, - 0x115, 0x462, 0x462, 0x620, 0x620, 0x0ce, 0x0ce, 0x115, 0x715, 0x7ec, 0x7ec, 0x1e6, 0x1e6, 0x610, 0x610, 0x715, - 0x34a, 0x718, 0x718, 0x7ba, 0x7ba, 0x288, 0x288, 0x34a, 0x6e7, 0x193, 0x193, 0x3d2, 0x3d2, 0x78f, 0x78f, 0x6e7, - 0x57c, 0x014, 0x014, 0x6b3, 0x6b3, 0x204, 0x204, 0x57c, 0x3f4, 0x782, 0x782, 0x5b4, 0x5b4, 0x375, 0x375, 0x3f4, - 0x17d, 0x660, 0x660, 0x48d, 0x48d, 0x7ff, 0x7ff, 0x17d, 0x5b1, 0x39d, 0x39d, 0x48c, 0x48c, 0x5ab, 0x5ab, 0x5b1, - 0x3d3, 0x4f6, 0x4f6, 0x7b9, 0x7b9, 0x5df, 0x5df, 0x3d3, 0x349, 0x4c5, 0x4c5, 0x403, 0x403, 0x0ab, 0x0ab, 0x349, - 0x46b, 0x790, 0x790, 0x59f, 0x59f, 0x2b1, 0x2b1, 0x46b, 0x6c5, 0x4e7, 0x4e7, 0x023, 0x023, 0x0b0, 0x0b0, 0x6c5, - 0x2d6, 0x3e2, 0x3e2, 0x7f3, 0x7f3, 0x376, 0x376, 0x2d6, 0x2d7, 0x0bf, 0x0bf, 0x14b, 0x14b, 0x65b, 0x65b, 0x2d7, - 0x68d, 0x360, 0x360, 0x434, 0x434, 0x5fa, 0x5fa, 0x68d, 0x654, 0x386, 0x386, 0x28b, 0x28b, 0x2e1, 0x2e1, 0x654, - 0x1ee, 0x4e8, 0x4e8, 0x482, 0x482, 0x471, 0x471, 0x1ee, 0x221, 0x3de, 0x3de, 0x467, 0x467, 0x21b, 0x21b, 0x221, - 0x7a6, 0x6b6, 0x6b6, 0x157, 0x157, 0x658, 0x658, 0x7a6, 0x1e9, 0x6e3, 0x6e3, 0x340, 0x340, 0x2cd, 0x2cd, 0x1e9, - 0x045, 0x566, 0x566, 0x1f0, 0x1f0, 0x5a1, 0x5a1, 0x045, 0x559, 0x0d4, 0x0d4, 0x67c, 0x67c, 0x21a, 0x21a, 0x559, - 0x187, 0x13b, 0x13b, 0x68e, 0x68e, 0x0f6, 0x0f6, 0x187, 0x2b5, 0x4c2, 0x4c2, 0x2b6, 0x2b6, 0x6a4, 0x6a4, 0x2b5, - 0x56b, 0x1b2, 0x1b2, 0x15d, 0x15d, 0x3aa, 0x3aa, 0x56b, 0x506, 0x67a, 0x67a, 0x5db, 0x5db, 0x5ef, 0x5ef, 0x506, - 0x5ab, 0x3ed, 0x3ed, 0x2b3, 0x2b3, 0x504, 0x504, 0x5ab, 0x137, 0x761, 0x761, 0x735, 0x735, 0x6e9, 0x6e9, 0x137, - 0x35a, 0x7bb, 0x7bb, 0x190, 0x190, 0x0a8, 0x0a8, 0x35a, 0x797, 0x164, 0x164, 0x1b8, 0x1b8, 0x761, 0x761, 0x797, - 0x138, 0x076, 0x076, 0x613, 0x613, 0x055, 0x055, 0x138, 0x2e2, 0x493, 0x493, 0x0c2, 0x0c2, 0x785, 0x785, 0x2e2, - 0x60b, 0x41a, 0x41a, 0x22a, 0x22a, 0x2a1, 0x2a1, 0x60b, 0x5cb, 0x092, 0x092, 0x656, 0x656, 0x5db, 0x5db, 0x5cb, - 0x00a, 0x490, 0x490, 0x39d, 0x39d, 0x572, 0x572, 0x00a, 0x600, 0x4cd, 0x4cd, 0x33f, 0x33f, 0x0bc, 0x0bc, 0x600, - 0x047, 0x685, 0x685, 0x4b0, 0x4b0, 0x330, 0x330, 0x047, 0x7b4, 0x590, 0x590, 0x1db, 0x1db, 0x349, 0x349, 0x7b4, - 0x6ae, 0x7a3, 0x7a3, 0x6fa, 0x6fa, 0x2d4, 0x2d4, 0x6ae, 0x117, 0x2fe, 0x2fe, 0x756, 0x756, 0x627, 0x627, 0x117, - 0x337, 0x55e, 0x55e, 0x2ef, 0x2ef, 0x2a9, 0x2a9, 0x337, 0x382, 0x02a, 0x02a, 0x4af, 0x4af, 0x7fa, 0x7fa, 0x382, - 0x73f, 0x6d8, 0x6d8, 0x7d2, 0x7d2, 0x52d, 0x52d, 0x73f, 0x385, 0x303, 0x303, 0x3eb, 0x3eb, 0x689, 0x689, 0x385, - 0x6cd, 0x4c3, 0x4c3, 0x2df, 0x2df, 0x1d5, 0x1d5, 0x6cd, 0x7da, 0x44c, 0x44c, 0x764, 0x764, 0x7f6, 0x7f6, 0x7da, - 0x7c1, 0x276, 0x276, 0x27f, 0x27f, 0x1c9, 0x1c9, 0x7c1, 0x58c, 0x001, 0x001, 0x07f, 0x07f, 0x62b, 0x62b, 0x58c, - 0x374, 0x746, 0x746, 0x5b2, 0x5b2, 0x35e, 0x35e, 0x374, 0x64d, 0x1fd, 0x1fd, 0x2dc, 0x2dc, 0x550, 0x550, 0x64d, - 0x33d, 0x40c, 0x40c, 0x3a4, 0x3a4, 0x293, 0x293, 0x33d, 0x0c0, 0x462, 0x462, 0x6fb, 0x6fb, 0x4b0, 0x4b0, 0x0c0, - 0x2aa, 0x175, 0x175, 0x01e, 0x01e, 0x762, 0x762, 0x2aa, 0x216, 0x76b, 0x76b, 0x728, 0x728, 0x15f, 0x15f, 0x216, - 0x30e, 0x0d8, 0x0d8, 0x55c, 0x55c, 0x31c, 0x31c, 0x30e, 0x351, 0x3dc, 0x3dc, 0x6c1, 0x6c1, 0x651, 0x651, 0x351, -}; - -static UINT32 partial_carry_sum(UINT32 add1,UINT32 add2,UINT32 carry_mask,INT32 bits) -{ - INT32 i,res,carry; - - res = 0; - carry = 0; - for (i = 0;i < bits;i++) - { - INT32 bit = BIT(add1,i) + BIT(add2,i) + carry; - - res += (bit & 1) << i; - - // generate carry only if the corresponding bit in carry_mask is 1 - if (BIT(carry_mask,i)) - carry = bit >> 1; - else - carry = 0; - } - - // wrap around carry from top bit to bit 0 - if (carry) - res ^=1; - - return res; -} - -static UINT32 partial_carry_sum32(UINT32 add1,UINT32 add2,UINT32 carry_mask) -{ - return partial_carry_sum(add1,add2,carry_mask,32); -} - -static UINT32 yrot(UINT32 v, INT32 r) -{ - return (v << r) | (v >> (32-r)); -} - -static UINT16 gm(INT32 i4) -{ - UINT16 x=0; - - for (INT32 i=0; i<4; ++i) - { - if (BIT(i4,i)) - x ^= 0xf << (i<<2); - } - - return x; -} - -static UINT32 core_decrypt(UINT32 ciphertext, INT32 i1, INT32 i2, INT32 i3, INT32 i4, - const UINT8 *rotate, const UINT8 *x5, const UINT16 *x11, UINT32 preXor, UINT32 carryMask, UINT32 postXor) -{ - UINT32 v1 = BITSWAP32(yrot(ciphertext, rotate[i1]), 25,28,15,19, 6,0,3,24, 11,1,2,30, 16,7,22,17, 31,14,23,9, 27,18,4,10, 13,20,5,12, 8,29,26,21); - - UINT16 x1Low = (x5[i2]<<11) ^ x11[i3] ^ gm(i4); - UINT32 x1 = x1Low | (BITSWAP16(x1Low, 0,8,1,9, 2,10,3,11, 4,12,5,13, 6,14,7,15)<<16); - - return partial_carry_sum32(v1, x1^preXor, carryMask) ^ postXor; -} - -static void raiden2_decrypt_sprites() -{ - UINT32 *data = (UINT32 *)DrvGfxROM2; - - for(INT32 i=0; i<0x800000/4; i++) - { - data[i] = core_decrypt(data[i], (i&0xff) ^ BIT(i,15) ^ (BIT(i,20)<<8), (i&0xff) ^ BIT(i,15), - (i>>8) & 0xff, (i>>16) & 0xf, rotate_r2, x5_r2, x11_r2, 0x60860000, 0x176c91a8, 0x0f488000); - } -} - -static void zeroteam_decrypt_sprites() -{ - UINT32 *data = (UINT32 *)DrvGfxROM2; - - for(INT32 i=0; i<0x400000/4; i++) - { - data[i] = core_decrypt(data[i], i & 0xff, i & 0xff, (i>>7) & 0x1ff, (i>>16) & 0xf, - rotate_zt, x5_zt, x11_zt, 0xa5800000, 0x7b67b7b9, 0xf1412ea8 - ); - } -} - -static void raiden2_common_map() -{ - VezInit(0, V30_TYPE); - VezOpen(0); -// VezMapArea(0x00000, 0x007ff, 0, DrvMainRAM); -// VezMapArea(0x00000, 0x007ff, 1, DrvMainRAM); // handler - VezMapArea(0x00000, 0x007ff, 2, DrvMainRAM); // fetch (map shift is 11 bits (800)) - VezMapArea(0x00800, 0x0bfff, 0, DrvMainRAM + 0x00800); - VezMapArea(0x00800, 0x0bfff, 1, DrvMainRAM + 0x00800); - VezMapArea(0x00800, 0x0bfff, 2, DrvMainRAM + 0x00800); - VezMapArea(0x0c000, 0x0cfff, 0, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 1, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 2, DrvSprRAM); - VezMapArea(0x0d000, 0x0d7ff, 0, DrvBgRAM); - VezMapArea(0x0d000, 0x0d7ff, 1, DrvBgRAM); - VezMapArea(0x0d000, 0x0d7ff, 2, DrvBgRAM); - VezMapArea(0x0d800, 0x0dfff, 0, DrvFgRAM); - VezMapArea(0x0d800, 0x0dfff, 1, DrvFgRAM); - VezMapArea(0x0d800, 0x0dfff, 2, DrvFgRAM); - VezMapArea(0x0e000, 0x0e7ff, 0, DrvMgRAM); - VezMapArea(0x0e000, 0x0e7ff, 1, DrvMgRAM); - VezMapArea(0x0e000, 0x0e7ff, 2, DrvMgRAM); - VezMapArea(0x0e800, 0x0f7ff, 0, DrvTxRAM); - VezMapArea(0x0e800, 0x0f7ff, 1, DrvTxRAM); - VezMapArea(0x0e800, 0x0f7ff, 2, DrvTxRAM); - VezMapArea(0x0f800, 0x1efff, 0, DrvMainRAM + 0x0f800); - VezMapArea(0x0f800, 0x1efff, 1, DrvMainRAM + 0x0f800); - VezMapArea(0x0f800, 0x1efff, 2, DrvMainRAM + 0x0f800); - VezMapArea(0x1f000, 0x1ffff, 0, DrvPalRAM); -// VezMapArea(0x1f000, 0x1ffff, 1, DrvPalRAM); // handler - VezMapArea(0x1f000, 0x1ffff, 2, DrvPalRAM); - VezMapArea(0x20000, 0xfffff, 0, DrvMainROM + 0x20000); - VezMapArea(0x20000, 0xfffff, 2, DrvMainROM + 0x20000); - VezSetWriteHandler(raiden2_main_write); - VezSetReadHandler(raiden2_main_read); - VezClose(); -} - -static void zeroteam_common_map() -{ - VezInit(0, V30_TYPE); - VezOpen(0); -// VezMapArea(0x00000, 0x007ff, 0, DrvMainRAM); -// VezMapArea(0x00000, 0x007ff, 1, DrvMainRAM); // handler - VezMapArea(0x00000, 0x007ff, 2, DrvMainRAM); // fetch (map shift is 11 bits (800)) - VezMapArea(0x00800, 0x0b7ff, 0, DrvMainRAM + 0x00800); - VezMapArea(0x00800, 0x0b7ff, 1, DrvMainRAM + 0x00800); - VezMapArea(0x00800, 0x0b7ff, 2, DrvMainRAM + 0x00800); - VezMapArea(0x0b800, 0x0bfff, 0, DrvBgRAM); - VezMapArea(0x0b800, 0x0bfff, 1, DrvBgRAM); - VezMapArea(0x0b800, 0x0bfff, 2, DrvBgRAM); - VezMapArea(0x0c000, 0x0c7ff, 0, DrvFgRAM); - VezMapArea(0x0c000, 0x0c7ff, 1, DrvFgRAM); - VezMapArea(0x0c000, 0x0c7ff, 2, DrvFgRAM); - VezMapArea(0x0c800, 0x0cfff, 0, DrvMgRAM); - VezMapArea(0x0c800, 0x0cfff, 1, DrvMgRAM); - VezMapArea(0x0c800, 0x0cfff, 2, DrvMgRAM); - VezMapArea(0x0d000, 0x0dfff, 0, DrvTxRAM); - VezMapArea(0x0d000, 0x0dfff, 1, DrvTxRAM); - VezMapArea(0x0d000, 0x0dfff, 2, DrvTxRAM); - VezMapArea(0x0e000, 0x0efff, 0, DrvPalRAM); -// VezMapArea(0x0e000, 0x0efff, 1, DrvPalRAM); // handler - VezMapArea(0x0e000, 0x0efff, 2, DrvPalRAM); - VezMapArea(0x0f000, 0x0ffff, 0, DrvSprRAM); - VezMapArea(0x0f000, 0x0ffff, 1, DrvSprRAM); - VezMapArea(0x0f000, 0x0ffff, 2, DrvSprRAM); - VezMapArea(0x10000, 0x1ffff, 0, DrvMainRAM + 0x10000); - VezMapArea(0x10000, 0x1ffff, 1, DrvMainRAM + 0x10000); - VezMapArea(0x10000, 0x1ffff, 2, DrvMainRAM + 0x10000); - VezMapArea(0x20000, 0xfffff, 0, DrvMainROM + 0x020000); - VezMapArea(0x20000, 0xfffff, 2, DrvMainROM + 0x020000); - VezSetWriteHandler(zeroteam_main_write); - VezSetReadHandler(raiden2_main_read); - VezClose(); -} - -static INT32 Raiden2Init() -{ - game_select = 0; - - BurnSetRefreshRate(55.47); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000001, 1, 2)) return 1; - - // if (BurnLoadRom(DrvCopxROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(SeibuZ80ROM + 0x00000, 3, 1)) return 1; - memcpy (SeibuZ80ROM + 0x10000, SeibuZ80ROM + 0x08000, 0x08000); - memcpy (SeibuZ80ROM + 0x18000, SeibuZ80ROM + 0x00000, 0x08000); - memset (SeibuZ80ROM + 0x08000, 0xff, 0x08000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 6, 1)) return 1; - - memset (DrvGfxROM2, 0xff, 0x800000); - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400001, 10, 2)) return 1; - - for (INT32 i = 0; i < 0x800000; i+=4) { - BurnByteswap(DrvGfxROM2 + i + 1, 2); - } - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 11, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 12, 1)) return 1; - - raiden2_decrypt_sprites(); - DrvGfxDecode(); - DrvCreateTransTab(); - DrvCreateAlphaTable(1); - } - - raiden2_common_map(); - - seibu_sound_init(1|4, 0, 3579545, 3579545, 1022727 / 132); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 Raiden2aInit() // alternate rom layout -{ - game_select = 0; - - BurnSetRefreshRate(55.47); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x000000, 0, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000001, 1, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000002, 2, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000003, 3, 4)) return 1; - - // if (BurnLoadRom(DrvCopxROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(SeibuZ80ROM + 0x00000, 5, 1)) return 1; - memcpy (SeibuZ80ROM + 0x10000, SeibuZ80ROM + 0x08000, 0x08000); - memcpy (SeibuZ80ROM + 0x18000, SeibuZ80ROM + 0x00000, 0x08000); - memset (SeibuZ80ROM + 0x08000, 0xff, 0x08000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 8, 1)) return 1; - - memset (DrvGfxROM2, 0xff, 0x800000); - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400001, 12, 2)) return 1; - - for (INT32 i = 0; i < 0x800000; i+=4) { - BurnByteswap(DrvGfxROM2 + i + 1, 2); - } - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 14, 1)) return 1; - - raiden2_decrypt_sprites(); - DrvGfxDecode(); - DrvCreateTransTab(); - DrvCreateAlphaTable(1); - } - - raiden2_common_map(); - - seibu_sound_init(1|4, 0, 3579545, 3579545, 1022727 / 132); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 RaidendxInit() -{ - game_select = 1; - - BurnSetRefreshRate(55.47); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x000000, 0, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000001, 1, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000002, 2, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000003, 3, 4)) return 1; - - // if (BurnLoadRom(DrvCopxROM + 0x000000, 4, 1)) return 1; // skip for now - - if (BurnLoadRom(SeibuZ80ROM + 0x00000, 5, 1)) return 1; - memcpy (SeibuZ80ROM + 0x10000, SeibuZ80ROM + 0x08000, 0x08000); - memcpy (SeibuZ80ROM + 0x18000, SeibuZ80ROM + 0x00000, 0x08000); - memset (SeibuZ80ROM + 0x08000, 0xff, 0x08000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 8, 1)) return 1; - - memset (DrvGfxROM2, 0xff, 0x800000); - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400000, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x400001, 12, 2)) return 1; - - for (INT32 i = 0; i < 0x800000; i+=4) { - BurnByteswap(DrvGfxROM2 + i + 1, 2); - } - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 13, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 14, 1)) return 1; - - raiden2_decrypt_sprites(); - DrvGfxDecode(); - DrvCreateTransTab(); - DrvCreateAlphaTable(1); - } - - VezInit(0, V30_TYPE); - VezOpen(0); -// VezMapArea(0x00000, 0x007ff, 0, DrvMainRAM); -// VezMapArea(0x00000, 0x007ff, 1, DrvMainRAM); // handler - VezMapArea(0x00000, 0x007ff, 2, DrvMainRAM); // fetch (map shift is 11 bits (800)) - VezMapArea(0x00800, 0x0bfff, 0, DrvMainRAM + 0x00800); - VezMapArea(0x00800, 0x0bfff, 1, DrvMainRAM + 0x00800); - VezMapArea(0x00800, 0x0bfff, 2, DrvMainRAM + 0x00800); - VezMapArea(0x0c000, 0x0cfff, 0, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 1, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 2, DrvSprRAM); - VezMapArea(0x0d000, 0x0d7ff, 0, DrvBgRAM); - VezMapArea(0x0d000, 0x0d7ff, 1, DrvBgRAM); - VezMapArea(0x0d000, 0x0d7ff, 2, DrvBgRAM); - VezMapArea(0x0d800, 0x0dfff, 0, DrvFgRAM); - VezMapArea(0x0d800, 0x0dfff, 1, DrvFgRAM); - VezMapArea(0x0d800, 0x0dfff, 2, DrvFgRAM); - VezMapArea(0x0e000, 0x0e7ff, 0, DrvMgRAM); - VezMapArea(0x0e000, 0x0e7ff, 1, DrvMgRAM); - VezMapArea(0x0e000, 0x0e7ff, 2, DrvMgRAM); - VezMapArea(0x0e800, 0x0f7ff, 0, DrvTxRAM); - VezMapArea(0x0e800, 0x0f7ff, 1, DrvTxRAM); - VezMapArea(0x0e800, 0x0f7ff, 2, DrvTxRAM); - VezMapArea(0x0f800, 0x1efff, 0, DrvMainRAM + 0x0f800); - VezMapArea(0x0f800, 0x1efff, 1, DrvMainRAM + 0x0f800); - VezMapArea(0x0f800, 0x1efff, 2, DrvMainRAM + 0x0f800); - VezMapArea(0x1f000, 0x1ffff, 0, DrvPalRAM); -// VezMapArea(0x1f000, 0x1ffff, 1, DrvPalRAM); // handler - VezMapArea(0x1f000, 0x1ffff, 2, DrvPalRAM); - VezMapArea(0x20000, 0x2ffff, 0, DrvMainROM + 0x100000); - VezMapArea(0x20000, 0x2ffff, 2, DrvMainROM + 0x100000); - VezMapArea(0x30000, 0xfffff, 0, DrvMainROM + 0x030000); - VezMapArea(0x30000, 0xfffff, 2, DrvMainROM + 0x030000); - VezSetWriteHandler(raidendx_main_write); - VezSetReadHandler(raiden2_main_read); - VezClose(); - - seibu_sound_init(1|4, 0, 3579545, 3579545, 1022727 / 132); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 ZeroteamInit() -{ - game_select = 2; - - BurnSetRefreshRate(55.47); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x000000, 0, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000002, 1, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000001, 2, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000003, 3, 4)) return 1; - - // if (BurnLoadRom(DrvCopxROM + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(SeibuZ80ROM + 0x00000, 5, 1)) return 1; - memcpy (SeibuZ80ROM + 0x10000, SeibuZ80ROM + 0x08000, 0x08000); - memcpy (SeibuZ80ROM + 0x18000, SeibuZ80ROM + 0x00000, 0x08000); - memset (SeibuZ80ROM + 0x08000, 0xff, 0x08000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 7, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 9, 1)) return 1; - - memset (DrvGfxROM2, 0xff, 0x800000); - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 11, 2)) return 1; - - for (INT32 i = 0; i < 0x400000; i+=4) { - BurnByteswap(DrvGfxROM2 + i + 1, 2); - } - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 12, 1)) return 1; - - zeroteam_decrypt_sprites(); - DrvGfxDecode(); - DrvCreateTransTab(); - DrvCreateAlphaTable(0); - } - - zeroteam_common_map(); - - seibu_sound_init(0, 0, 3579545, 3579545, 1320000 / 132); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 XsedaeInit() -{ - game_select = 3; - - BurnSetRefreshRate(55.47); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x000000, 0, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000001, 1, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000002, 2, 4)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000003, 3, 4)) return 1; - - // no cop mcu - - if (BurnLoadRom(SeibuZ80ROM + 0x00000, 4, 1)) return 1; - memcpy (SeibuZ80ROM + 0x10000, SeibuZ80ROM + 0x08000, 0x08000); - memcpy (SeibuZ80ROM + 0x18000, SeibuZ80ROM + 0x00000, 0x08000); - memset (SeibuZ80ROM + 0x08000, 0xff, 0x08000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 8, 1)) return 1; - - memset (DrvGfxROM2, 0xff, 0x800000); - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 10, 2)) return 1; - - for (INT32 i = 0; i < 0x400000; i+=4) { - BurnByteswap(DrvGfxROM2 + i + 1, 2); - } - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 11, 1)) return 1; - - memset (DrvSndROM1, 0xff, 0x40000); - - DrvGfxDecode(); - DrvCreateTransTab(); - DrvCreateAlphaTable(0); - } - - zeroteam_common_map(); - - seibu_sound_init(1|4, 0, 3579545, 3579545, 1022727 / 132); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 R2dxInit() -{ - game_select = 4; - - BurnSetRefreshRate(55.47); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 2, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM2 + 0x000, 3, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM2 + 0x002, 4, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvCopxROM + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvEeprom + 0x000000, 7, 1)) return 1; - - raiden2_decrypt_sprites(); - DrvGfxDecode(); - DrvCreateTransTab(); - DrvCreateAlphaTable(1); - } - - VezInit(0, V33_TYPE); - VezOpen(0); -// VezMapArea(0x00000, 0x007ff, 0, DrvMainRAM); -// VezMapArea(0x00000, 0x007ff, 1, DrvMainRAM); // handler - VezMapArea(0x00000, 0x1ffff, 2, DrvMainRAM + 0x00000); - VezMapArea(0x00800, 0x1ffff, 0, DrvMainRAM + 0x00800); - VezMapArea(0x00800, 0x1ffff, 1, DrvMainRAM + 0x00800); - VezMapArea(0x0c000, 0x0cfff, 0, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 1, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 2, DrvSprRAM); - VezMapArea(0x20000, 0x2ffff, 0, DrvMainROM + 0x100000); - VezMapArea(0x20000, 0x2ffff, 2, DrvMainROM + 0x100000); - VezMapArea(0x30000, 0xfffff, 0, DrvMainROM + 0x030000); - VezMapArea(0x30000, 0xfffff, 2, DrvMainROM + 0x030000); - VezSetWriteHandler(r2dx_main_write); - VezSetReadHandler(r2dx_main_read); - VezClose(); - - MSM6295Init(0, 1022727 / 132, 0); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&eeprom_interface_93C46); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 NzeroteamInit() -{ - game_select = 5; - - BurnSetRefreshRate(55.47); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(DrvMainROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvCopxROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(SeibuZ80ROM + 0x00000, 3, 1)) return 1; - memcpy (SeibuZ80ROM + 0x10000, SeibuZ80ROM + 0x08000, 0x08000); - memcpy (SeibuZ80ROM + 0x18000, SeibuZ80ROM + 0x00000, 0x08000); - memset (SeibuZ80ROM + 0x08000, 0xff, 0x08000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 5, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 7, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM2 + 0x000, 8, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM2 + 0x002, 9, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 10, 1)) return 1; - - zeroteam_decrypt_sprites(); - DrvGfxDecode(); - DrvCreateTransTab(); - DrvCreateAlphaTable(0); - } - - VezInit(0, V33_TYPE); - VezOpen(0); -// VezMapArea(0x00000, 0x007ff, 0, DrvMainRAM); -// VezMapArea(0x00000, 0x007ff, 1, DrvMainRAM); // handler - VezMapArea(0x00000, 0x1ffff, 2, DrvMainRAM + 0x00000); - VezMapArea(0x00800, 0x1ffff, 0, DrvMainRAM + 0x00800); - VezMapArea(0x00800, 0x1ffff, 1, DrvMainRAM + 0x00800); - VezMapArea(0x0c000, 0x0cfff, 0, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 1, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 2, DrvSprRAM); - VezMapArea(0x20000, 0xfffff, 0, DrvMainROM + 0x020000); - VezMapArea(0x20000, 0xfffff, 2, DrvMainROM + 0x020000); - VezSetWriteHandler(nzeroteam_main_write); - VezSetReadHandler(nzeroteam_main_read); - VezClose(); - - seibu_sound_init(0, 0, 3579545, 3579545, 1320000 / 132); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static void zerotm2kGfxDescramble() -{ - UINT8 tmp[0x80]; - - for (INT32 i = 0x100000; i < 0x180000; i+=0x80) - { - for (INT32 j = 0; j < 0x80; j++) - { - INT32 k = (j & 0x1f) | ((j&0x20)<<1) | ((j&0x40)>>1); - - tmp[j] = DrvGfxROM1[i+k]; - } - - memcpy (DrvGfxROM1 + i, tmp, 0x80); - } -} - -static INT32 Zerotm2kInit() -{ - game_select = 6; - - BurnSetRefreshRate(55.47); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvMainROM + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvCopxROM + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(SeibuZ80ROM + 0x00000, 2, 1)) return 1; - memcpy (SeibuZ80ROM + 0x10000, SeibuZ80ROM + 0x08000, 0x08000); - memcpy (SeibuZ80ROM + 0x18000, SeibuZ80ROM + 0x00000, 0x08000); - memset (SeibuZ80ROM + 0x08000, 0xff, 0x08000); - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 6, 1)) return 1; - - if (BurnLoadRomExt(DrvGfxROM2 + 0x000, 7, 4, LD_GROUP(2))) return 1; - if (BurnLoadRomExt(DrvGfxROM2 + 0x002, 8, 4, LD_GROUP(2))) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 9, 1)) return 1; - - zerotm2kGfxDescramble(); - //zeroteam_decrypt_sprites(); - DrvGfxDecode(); - DrvCreateTransTab(); - DrvCreateAlphaTable(0); - } - - VezInit(0, V33_TYPE); - VezOpen(0); -// VezMapArea(0x00000, 0x007ff, 0, DrvMainRAM); -// VezMapArea(0x00000, 0x007ff, 1, DrvMainRAM); // handler - VezMapArea(0x00000, 0x1ffff, 2, DrvMainRAM + 0x00000); - VezMapArea(0x00800, 0x1ffff, 0, DrvMainRAM + 0x00800); - VezMapArea(0x00800, 0x1ffff, 1, DrvMainRAM + 0x00800); - VezMapArea(0x0c000, 0x0cfff, 0, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 1, DrvSprRAM); - VezMapArea(0x0c000, 0x0cfff, 2, DrvSprRAM); - VezMapArea(0x20000, 0xfffff, 0, DrvMainROM + 0x020000); - VezMapArea(0x20000, 0xfffff, 2, DrvMainROM + 0x020000); - VezSetWriteHandler(zerotm2k_main_write); - VezSetReadHandler(zerotm2k_main_read); - VezClose(); - - seibu_sound_init(0, 0, 3579545, 3579545, 1320000 / 132); - - EEPROMInit(&eeprom_interface_93C46); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - VezExit(); - - if (game_select != 4) { - seibu_sound_exit(); - } else { - MSM6295Exit(0); - } - - if (game_select == 4 || game_select == 6) { - EEPROMExit(); - } - - BurnFree (AllMem); - - game_select = 0; - - return 0; -} - -static inline UINT32 alpha_blend(UINT32 d, UINT32 s) -{ - return (((((s & 0xff00ff) * 0x7f) + ((d & 0xff00ff) * 0x81)) & 0xff00ff00) + - ((((s & 0x00ff00) * 0x7f) + ((d & 0x00ff00) * 0x81)) & 0x00ff0000)) / 0x100; -} - -static void draw_layer(UINT8 *ram, INT32 scr, UINT32 color_base, INT32 bank) -{ - UINT16 *vram = (UINT16*)ram; - - INT32 scrollx = (scroll[scr * 4 + 0] + (scroll[scr * 4 + 1] * 256)) & 0x1ff; - INT32 scrolly = (scroll[scr * 4 + 2] + (scroll[scr * 4 + 3] * 256)) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 16; - INT32 sy = (offs / 0x20) * 16; - - sx -= scrollx; - if (sx < -15) sx += 512; - sy -= scrolly; - if (sy < -15) sy += 512; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 attr = vram[offs]; - INT32 color = attr >> 12; - INT32 code = (attr & 0xfff) + (bank << 12); - - if (DrvTransTab[code]) continue; - - { - color *= 16; - color += color_base; - UINT32 *pal = DrvPalette + color; - UINT8 *gfx = DrvGfxROM1 + (code * 0x100); - UINT8 *alpha = DrvAlphaTable + color; - UINT32 *dst = bitmap32 + sy * nScreenWidth; - - for (INT32 y = 0; y < 16; y++, sy++) { - if (sy >= 0 && sy < nScreenHeight) { - for (INT32 x = 0; x < 16; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[y*16+x]; - - if (pxl != 0x0f) - { - if (alpha[pxl]) { - dst[sx] = alpha_blend(dst[sx], pal[pxl]); - } else { - dst[sx] = pal[pxl]; - } - } - } - sx -= 16; - } - dst += nScreenWidth; - } - } - } -} - -static void draw_txt_layer() -{ - UINT16 *vram = (UINT16*)DrvTxRAM; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 attr = vram[offs]; - INT32 color = attr >> 12; - INT32 code = (attr & 0xfff) + (tx_bank * 0x1000); - - if ((code & 0xfff) <= 0x0020) continue; - - { - color *= 16; - color += 0x700; - UINT32 *pal = DrvPalette + color; - UINT8 *gfx = DrvGfxROM0 + (code * 0x40); - UINT8 *alpha = DrvAlphaTable + color; - UINT32 *dst = bitmap32 + sy * nScreenWidth; - - for (INT32 y = 0; y < 8; y++, sy++) { - if (sy >= 0 && sy < nScreenHeight) { - for (INT32 x = 0; x < 8; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[y*8+x]; - if (pxl != 0x0f) - { - if (alpha[pxl]) { - dst[sx] = alpha_blend(dst[sx], pal[pxl]); - } else { - dst[sx] = pal[pxl]; - } - } - } - sx -= 8; - } - dst += nScreenWidth; - } - } - } -} - -static void draw_single_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipy, INT32 flipx) -{ - if (sx < -15 || sy < -15 || sy >= nScreenHeight || sx >= nScreenWidth) return; - - { - INT32 flip = (flipy ? 0xf0 : 0) + (flipx ? 0x0f : 0); - color *= 16; - UINT32 *pal = DrvPalette + color; - UINT8 *gfx = DrvGfxROM2 + (code * 0x100); - UINT8 *alpha = DrvAlphaTable + color; - UINT32 *dst = bitmap32 + sy * nScreenWidth; - - for (INT32 y = 0; y < 16; y++, sy++) { - if (sy >= 0 && sy < nScreenHeight) { - for (INT32 x = 0; x < 16; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[(y*16+x)^flip]; - if (pxl != 0x0f) - { - if (alpha[pxl]) { - dst[sx] = alpha_blend(dst[sx], pal[pxl]); - } else { - dst[sx] = pal[pxl]; - } - } - } - sx -= 16; - } - dst += nScreenWidth; - } - } -} - -static void draw_sprites(INT32 priority) -{ - if (layer_enable & 0x10) return; - - UINT16 *sprites = (UINT16*)DrvSprRAM; - UINT16 *source = sprites + sprites_cur_start/2; - - while( source >= sprites ){ - INT32 tile_number = source[1]; - INT32 sx = source[2]; - INT32 sy = source[3]; - INT32 colr; - INT32 xtiles, ytiles; - INT32 ytlim, xtlim; - INT32 xflip, yflip; - INT32 xstep, ystep; - INT32 pri; - - ytlim = (source[0] >> 12) & 0x7; - xtlim = (source[0] >> 8 ) & 0x7; - - xflip = (source[0] >> 15) & 0x1; - yflip = (source[0] >> 11) & 0x1; - - colr = source[0] & 0x3f; - - pri = (source[0] >> 6) & 3; - - if (pri != priority) { - source -= 4; - continue; - } - - ytlim += 1; - xtlim += 1; - - xstep = 16; - ystep = 16; - - if (xflip) - { - ystep = -16; - sy += ytlim*16-16; - } - - if (yflip) - { - xstep = -16; - sx += xtlim*16-16; - } - - for (xtiles = 0; xtiles < xtlim; xtiles++) - { - for (ytiles = 0; ytiles < ytlim; ytiles++) - { - draw_single_sprite(tile_number, colr, (sx+xstep*xtiles)&0x1ff,(sy+ystep*ytiles)&0x1ff, xflip, yflip); - draw_single_sprite(tile_number, colr, ((sx+xstep*xtiles)&0x1ff)-0x200,(sy+ystep*ytiles)&0x1ff, xflip, yflip); - draw_single_sprite(tile_number, colr, (sx+xstep*xtiles)&0x1ff,((sy+ystep*ytiles)&0x1ff)-0x200, xflip, yflip); - draw_single_sprite(tile_number, colr, ((sx+xstep*xtiles)&0x1ff)-0x200,((sy+ystep*ytiles)&0x1ff)-0x200, xflip, yflip); - - tile_number++; - } - } - - source -= 4; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_update_entry(i); - } - DrvRecalc = 0; - } - -// BurnTransferClear(); - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x0800; - bitmap32[i] = 0; // black - } - - if (nBurnLayer & 1) draw_sprites(0); - if (nSpriteEnable & 1) if (~layer_enable & 1) draw_layer(DrvBgRAM, 0, 0x400, bg_bank); - if (nBurnLayer & 2) draw_sprites(1); - if (nSpriteEnable & 2) if (~layer_enable & 2) draw_layer(DrvMgRAM, 1, 0x600, mg_bank); - if (nBurnLayer & 4) draw_sprites(2); - if (nSpriteEnable & 4) if (~layer_enable & 4) draw_layer(DrvFgRAM, 2, 0x500, fg_bank); - if (nBurnLayer & 8) draw_sprites(3); - if (nSpriteEnable & 8) if (~layer_enable & 8) draw_txt_layer(); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - PutPix(pBurnDraw + (i * nBurnBpp), BurnHighCol(bitmap32[i]>>16, (bitmap32[i]>>8)&0xff, bitmap32[i]&0xff, 0)); - } - return 0; -} - -static INT32 ZeroteamDraw() // sprite priorities different -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_update_entry(i); - } - DrvRecalc = 0; - } - -// BurnTransferClear(); - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x0800; - bitmap32[i] = 0; // black - } - - if (nSpriteEnable & 1) if (~layer_enable & 1) draw_layer(DrvBgRAM, 0, 0x400, bg_bank); - if (nBurnLayer & 1) draw_sprites(0); - if (nSpriteEnable & 2) if (~layer_enable & 2) draw_layer(DrvMgRAM, 1, 0x600, mg_bank); - if (nBurnLayer & 2) draw_sprites(1); - if (nSpriteEnable & 4) if (~layer_enable & 4) draw_layer(DrvFgRAM, 2, 0x500, fg_bank); - if (nBurnLayer & 4) draw_sprites(2); - if (nSpriteEnable & 8) if (~layer_enable & 8) draw_txt_layer(); - if (nBurnLayer & 8) draw_sprites(3); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - PutPix(pBurnDraw + (i * nBurnBpp), BurnHighCol(bitmap32[i]>>16, (bitmap32[i]>>8)&0xff, bitmap32[i]&0xff, 0)); - } - - return 0; -} -static UINT32 framecntr = 0; -static UINT32 seibu_start = 0; - -static void compile_inputs() -{ - memset (DrvInputs, 0xff, 3*sizeof(short)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[2] = (DrvInputs[2] & 0x00ff) | (DrvDips[2] << 8); - - // hold coin down for a few frames so that it registers - static INT32 previous_coin = seibu_coin_input; - seibu_coin_input = 0xff; - - for (INT32 i = 0; i < 4; i++) { - if ((previous_coin & (1 << i)) == 0 && DrvJoy4[i]) { - hold_coin[i] = 4; - framecntr = 0; - } - - if (hold_coin[i]) { // only hold for 4 frames, with no extra from input holddown. - hold_coin[i]--; - if (framecntr & 1) - seibu_start = 1; - if (seibu_start) - seibu_coin_input ^= (1 << i); - if (!hold_coin[i]) - seibu_start = 0; - } - } - //bprintf(0, _T("%X"), (seibu_coin_input == 0xff) ? 0 : seibu_coin_input); - framecntr++; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - VezNewFrame(); - ZetNewFrame(); - - compile_inputs(); - - INT32 nInterleave = 128; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { (16000000 * 100) / 5547, (3579545 * 100) / 5547 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - VezOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] += VezRun(nSegment); - if (i == (nInterleave-2)) VezSetIRQLineAndVector(0, 0xc0/4, CPU_IRQSTATUS_AUTO); - - nSegment = (nCyclesTotal[1] / nInterleave) * (i+1); - nCyclesDone[1] += ZetRun(nSegment - ZetTotalCycles()); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - seibu_sound_update(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - seibu_sound_update(pSoundBuf, nSegmentLength); - } - } - - VezClose(); - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 ZeroteamFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - VezNewFrame(); - ZetNewFrame(); - - compile_inputs(); - - INT32 nInterleave = 128; - INT32 nCyclesTotal[2] = { (16000000 * 100) / 5547, (3579545 * 100) / 5547 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - VezOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] += VezRun(nSegment); - if (i == (nInterleave-2)) VezSetIRQLineAndVector(0, 0xc0/4, CPU_IRQSTATUS_AUTO); - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - seibu_sound_update(pBurnSoundOut, nBurnSoundLen); - } - - VezClose(); - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 R2dxFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3*sizeof(short)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - -// INT32 nCyclesTotal[1] = { (16000000 * 100) / 5547 }; - - VezOpen(0); - VezRun(288444 - 500); - VezSetIRQLineAndVector(0, 0xc0/4, CPU_IRQSTATUS_AUTO); - VezRun(500); - VezClose(); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - if ( pnMin ) *pnMin = 0x029671; - - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - VezScan(nAction); - - if (game_select != 4) { - seibu_sound_scan(pnMin, nAction); - } else { - MSM6295Scan(0, nAction); - } - - SCAN_VAR(layer_enable); - - SCAN_VAR(prg_bank); - SCAN_VAR(mg_bank); - SCAN_VAR(bg_bank); - SCAN_VAR(fg_bank); - SCAN_VAR(r2dx_gameselect); - SCAN_VAR(r2dx_okibank); - - SeibuCopScan(nAction); - } - - if (nAction & ACB_WRITE) { - VezOpen(0); - if (game_select == 0) raiden2_bankswitch(prg_bank); - if (game_select == 1) raidendx_bankswitch(prg_bank); - if (game_select == 4) { - r2dx_bankswitch(prg_bank, r2dx_gameselect); - r2dx_okibankswitch(); - } - VezClose(); - - DrvRecalc = 1; - } - - if (nAction & ACB_NVRAM) { - if (game_select == 4 || game_select == 6) { - EEPROMScan(nAction, pnMin); - } - } - - return 0; -} - - -// Raiden II (US, set 1) - -static struct BurnRomInfo raiden2RomDesc[] = { - { "prg0.u0211", 0x080000, 0x09475ec4, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "prg1.u0212", 0x080000, 0x4609b5f2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 2 COPX MCU data - - { "snd.u1110", 0x010000, 0xf51a28f9, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "seibu7.u0724", 0x020000, 0xc9ec9469, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "seibu6.u1017", 0x040000, 0xfb0fca23, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 0 | BRF_NODUMP }, // 13 Pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2) -STD_ROM_FN(raiden2) - -struct BurnDriver BurnDrvRaiden2 = { - "raiden2", NULL, NULL, NULL, "1993", - "Raiden II (US, set 1)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2RomInfo, raiden2RomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (US, set 2) - -static struct BurnRomInfo raiden2uRomDesc[] = { - { "1.u0211", 0x080000, 0xb16df955, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "2.u0212", 0x080000, 0x2a14b112, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 2 COPX MCU data - - { "seibu5.u1110", 0x010000, 0x6d362472, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "seibu7.u0724", 0x020000, 0xc7aa4d00, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "seibu6.u1017", 0x040000, 0xfab9f8e4, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 13 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2u) -STD_ROM_FN(raiden2u) - -struct BurnDriver BurnDrvRaiden2u = { - "raiden2u", "raiden2", NULL, NULL, "1993", - "Raiden II (US, set 2)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2uRomInfo, raiden2uRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Hong Kong) - -static struct BurnRomInfo raiden2hkRomDesc[] = { - { "prg0.u0211", 0x080000, 0x09475ec4, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rom2e.u0212", 0x080000, 0x458d619c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 2 COPX MCU data - - { "seibu5.u1110", 0x010000, 0x8f130589, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "seibu7.u0724", 0x020000, 0xc9ec9469, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "seibu6.u1017", 0x040000, 0xfb0fca23, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 0 | BRF_OPT }, // 13 Pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2hk) -STD_ROM_FN(raiden2hk) - -struct BurnDriver BurnDrvRaiden2hk = { - "raiden2hk", "raiden2", NULL, NULL, "1993", - "Raiden II (Hong Kong)\0", NULL, "Seibu Kaihatsu (Metrotainment license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2hkRomInfo, raiden2hkRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Japan) - -static struct BurnRomInfo raiden2jRomDesc[] = { - { "prg0.u0211", 0x080000, 0x09475ec4, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rom2j.u0212", 0x080000, 0xe4e4fb4c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 2 COPX MCU data - - { "seibu5.u1110", 0x010000, 0x8f130589, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "seibu7.u0724", 0x020000, 0xc9ec9469, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "seibu6.u1017", 0x040000, 0xfb0fca23, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 13 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2j) -STD_ROM_FN(raiden2j) - -struct BurnDriver BurnDrvRaiden2j = { - "raiden2j", "raiden2", NULL, NULL, "1993", - "Raiden II (Japan)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2jRomInfo, raiden2jRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Italy) - -static struct BurnRomInfo raiden2iRomDesc[] = { - { "seibu1.u0211", 0x080000, 0xc1fc70f5, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "seibu2.u0212", 0x080000, 0x28d5365f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 2 COPX MCU data - - { "seibu5.c.u1110", 0x010000, 0x5db9f922, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "seibu7.u0724", 0x020000, 0xc9ec9469, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "seibu6.u1017", 0x040000, 0xfb0fca23, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 13 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2i) -STD_ROM_FN(raiden2i) - -struct BurnDriver BurnDrvRaiden2i = { - "raiden2i", "raiden2", NULL, NULL, "1993", - "Raiden II (Italy)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2iRomInfo, raiden2iRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Holland) - -static struct BurnRomInfo raiden2nlRomDesc[] = { - { "1_u0211.bin", 0x080000, 0x53be3dd0, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "2_u0212.bin", 0x080000, 0x88829c08, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 2 COPX MCU data - - { "5_u1110.bin", 0x010000, 0x8f130589, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "7_u0724.bin", 0x020000, 0xc9ec9469, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "6_u1017.bin", 0x040000, 0xfb0fca23, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 13 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2nl) -STD_ROM_FN(raiden2nl) - -struct BurnDriver BurnDrvRaiden2nl = { - "raiden2nl", "raiden2", NULL, NULL, "1993", - "Raiden II (Holland)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2nlRomInfo, raiden2nlRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Switzerland) - -static struct BurnRomInfo raiden2swRomDesc[] = { - { "seibu_1.u0211", 0x080000, 0x09475ec4, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "seibu_2.u0212", 0x080000, 0x59abc2ec, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 2 COPX MCU data - - { "seibu_5.u1110", 0x010000, 0xc2028ba2, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "seibu_7.u0724", 0x020000, 0xc9ec9469, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "seibu_6.u1017", 0x040000, 0xfb0fca23, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 13 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2sw) -STD_ROM_FN(raiden2sw) - -struct BurnDriver BurnDrvRaiden2sw = { - "raiden2sw", "raiden2", NULL, NULL, "1993", - "Raiden II (Switzerland)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2swRomInfo, raiden2swRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (France) - -static struct BurnRomInfo raiden2fRomDesc[] = { - { "1_u0211.bin", 0x080000, 0x53be3dd0, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "seibu2_u0212.bin", 0x080000, 0x8dcd8a8d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 2 COPX MCU data - - { "seibu5_u1110.bin", 0x010000, 0xf51a28f9, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "7_u0724.bin", 0x020000, 0xc9ec9469, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "6_u1017.bin", 0x040000, 0xfb0fca23, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 13 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2f) -STD_ROM_FN(raiden2f) - -struct BurnDriver BurnDrvRaiden2f = { - "raiden2f", "raiden2", NULL, NULL, "1993", - "Raiden II (France)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2fRomInfo, raiden2fRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Germany) - -static struct BurnRomInfo raiden2gRomDesc[] = { - { "prg0.u0211", 0x080000, 0x09475ec4, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "prg1g.u0212", 0x080000, 0x41001d2e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 2 COPX MCU data - - { "snd.u1110", 0x010000, 0xf51a28f9, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "seibu7.u0724", 0x020000, 0xc9ec9469, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "seibu6.u1017", 0x040000, 0xfb0fca23, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 0 | BRF_NODUMP }, // 13 Pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2g) -STD_ROM_FN(raiden2g) - -struct BurnDriver BurnDrvRaiden2g = { - "raiden2g", "raiden2", NULL, NULL, "1993", - "Raiden II (Germany)\0", NULL, "Seibu Kaihatsu (Tuning license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2gRomInfo, raiden2gRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Easy Version, Korea?) - -static struct BurnRomInfo raiden2eRomDesc[] = { - { "r2_prg_0.u0211", 0x080000, 0x2abc848c, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "r2_prg_1.u0212", 0x080000, 0x509ade43, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 2 COPX MCU data - - { "r2_snd.u1110", 0x010000, 0x6bad0a3e, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "r2_fx0.u0724", 0x020000, 0xc709bdf6, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "r2_voi1.u1017", 0x040000, 0x488d050f, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 13 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2e) -STD_ROM_FN(raiden2e) - -struct BurnDriver BurnDrvRaiden2e = { - "raiden2e", "raiden2", NULL, NULL, "1993", - "Raiden II (Easy Version, Korea?)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2eRomInfo, raiden2eRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Easy Version, Japan?) - -static struct BurnRomInfo raiden2eaRomDesc[] = { - { "r2.1.u0211", 0x080000, 0xd7041be4, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "r2.2.u0212", 0x080000, 0xbf7577ec, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 2 COPX MCU data - - { "r2.5.u1110", 0x010000, 0xf5f835af, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "r2.7.u0724", 0x020000, 0xc7aa4d00, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "r2.6.u1017", 0x040000, 0xfab9f8e4, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 13 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2ea) -STD_ROM_FN(raiden2ea) - -struct BurnDriver BurnDrvRaiden2ea = { - "raiden2ea", "raiden2", NULL, NULL, "1993", - "Raiden II (Easy Version, Japan?)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2eaRomInfo, raiden2eaRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Easy Version, US set 2) - -static struct BurnRomInfo raiden2euRomDesc[] = { - { "seibu_1.u0211", 0x080000, 0xd7041be4, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "seibu_2.u0212", 0x080000, 0xbeb71ddb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 2 COPX MCU data - - { "r2.5.u1110", 0x010000, 0xf5f835af, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "r2.7.u0724", 0x020000, 0xc7aa4d00, 4 | BRF_GRA }, // 4 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 5 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 6 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 7 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 8 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 9 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 10 - - { "r2.6.u1017", 0x040000, 0xfab9f8e4, 7 | BRF_SND }, // 11 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 12 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 13 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2eu) -STD_ROM_FN(raiden2eu) - -struct BurnDriver BurnDrvRaiden2eu = { - "raiden2eu", "raiden2", NULL, NULL, "1993", - "Raiden II (Easy Version, US set 2)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2euRomInfo, raiden2euRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Easy Version, US set 1) - -static struct BurnRomInfo raiden2euaRomDesc[] = { - { "seibu__1.27c020j.u1210", 0x040000, 0xed1514e3, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "seibu__2.27c2001.u1211", 0x040000, 0xbb6ecf2a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "seibu__3.27c2001.u129", 0x040000, 0x6a01d52c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "seibu__4.27c2001.u1212", 0x040000, 0xe54bfa37, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 4 COPX MCU data - - { "seibu__5.27c512.u1110", 0x010000, 0x6d362472, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "seibu__7.fx0.27c210.u0724", 0x020000, 0xc7aa4d00, 4 | BRF_GRA }, // 6 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 7 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 8 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 11 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 12 - - { "seibu__6.voice1.23c020.u1017", 0x040000, 0xfab9f8e4, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 15 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 14 -}; - -STD_ROM_PICK(raiden2eua) -STD_ROM_FN(raiden2eua) - -struct BurnDriver BurnDrvRaiden2eua = { - "raiden2eua", "raiden2", NULL, NULL, "1993", - "Raiden II (Easy Version, US set 1)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2euaRomInfo, raiden2euaRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2aInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (Easy Version, Germany) -// this is the same code revision as raiden2eua but a german region - -static struct BurnRomInfo raiden2egRomDesc[] = { - { "raiden_2_1.bin", 0x040000, 0xed1514e3, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "raiden_2_2.bin", 0x040000, 0xbb6ecf2a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "raiden_2_3.bin", 0x040000, 0x6a01d52c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "raiden_2_4.bin", 0x040000, 0x81273f33, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 4 COPX MCU data - - { "raiden_2_5.bin", 0x010000, 0x6d362472, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "raiden_2_7.bin", 0x020000, 0xc7aa4d00, 4 | BRF_GRA }, // 6 Characters - - { "raiden_2_seibu_bg-1.u0714", 0x200000, 0xe61ad38e, 5 | BRF_GRA }, // 7 Tiles - { "raiden_2_seibu_bg-2.u075", 0x200000, 0xa694a4bb, 5 | BRF_GRA }, // 8 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "raiden_2_seibu_obj-3.u0837", 0x200000, 0x897a0322, 6 | BRF_GRA }, // 11 - { "raiden_2_seibu_obj-4.u0836", 0x200000, 0xb676e188, 6 | BRF_GRA }, // 12 - - { "raiden_2_6.bin", 0x040000, 0xfab9f8e4, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "raiden_2_pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples - - { "jj4b02__ami18cv8-15.u0342.jed", 0x000288, 0x00000000, 9 | BRF_NODUMP }, // 15 pals - { "jj4b01__mmipal16l8bcn.u0341.jed", 0x000335, 0xd1a039af, 0 | BRF_OPT }, // 16 -}; - -STD_ROM_PICK(raiden2eg) -STD_ROM_FN(raiden2eg) - -struct BurnDriver BurnDrvRaiden2eg = { - "raiden2eg", "raiden2", NULL, NULL, "1993", - "Raiden II (Easy Version, Germany)\0", NULL, "Seibu Kaihatsu (Tuning license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2egRomInfo, raiden2egRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - Raiden2aInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II (harder, Raiden DX Hardware) - -static struct BurnRomInfo raiden2dxRomDesc[] = { - { "u1210.bin", 0x080000, 0x413241e0, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "prg1_u1211.bin", 0x080000, 0x93491f56, 1 | BRF_PRG | BRF_ESS }, // 1 - { "u129.bin", 0x080000, 0xe0932b6c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "u1212.bin", 0x080000, 0x505423f4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.6s", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_ESS }, // 4 COPX MCU data - - { "u1110.bin", 0x010000, 0xb8ad8fe7, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - -// { "fx0_u0724.bin", 0x020000, 0xded3c718, 4 | BRF_GRA }, // 6 Characters - { "7_u0724.bin", 0x020000, 0xc9ec9469, 4 | BRF_GRA }, // 6 Characters - - { "dx_back1.1s", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back2.2s", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 - - { "obj1", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "obj2", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj3.4k", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj4.6k", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "dx_6.3b", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "dx_pcm.3a", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raiden2dx) -STD_ROM_FN(raiden2dx) - -struct BurnDriver BurnDrvRaiden2dx = { - "raiden2dx", "raiden2", NULL, NULL, "1993", - "Raiden II (harder, Raiden DX Hardware)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raiden2dxRomInfo, raiden2dxRomName, NULL, NULL, Raiden2InputInfo, Raiden2DIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden DX (UK) - -static struct BurnRomInfo raidendxRomDesc[] = { - { "1d.4n", 0x080000, 0x14d725fc, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "2d.4p", 0x080000, 0x5e7e45cb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3d.6n", 0x080000, 0xf0a47e67, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4d.6p", 0x080000, 0x2a2003e8, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.6s", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "dx_5.5b", 0x010000, 0x8c46857a, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "dx_7.4s", 0x020000, 0xc73986d4, 4 | BRF_GRA }, // 6 Characters - - { "dx_back1.1s", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back2.2s", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 Tiles - - { "obj1", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "obj2", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj3.4k", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj4.6k", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "dx_6.3b", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "dx_pcm.3a", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raidendx) -STD_ROM_FN(raidendx) - -struct BurnDriver BurnDrvRaidendx = { - "raidendx", NULL, NULL, NULL, "1994", - "Raiden DX (UK)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidendxRomInfo, raidendxRomName, NULL, NULL, RaidendxInputInfo, RaidendxDIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden DX (Hong Kong, set 1) - -static struct BurnRomInfo raidendxa1RomDesc[] = { - { "dx_1h.4n", 0x080000, 0x7624c36b, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "dx_2h.4p", 0x080000, 0x4940fdf3, 1 | BRF_PRG | BRF_ESS }, // 1 - { "dx_3h.6n", 0x080000, 0x6c495bcf, 1 | BRF_PRG | BRF_ESS }, // 2 - { "dx_4h.6k", 0x080000, 0x9ed6335f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.6s", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "dx_5.5b", 0x010000, 0x8c46857a, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "dx_7.4s", 0x020000, 0xc73986d4, 4 | BRF_GRA }, // 6 Characters - - { "dx_back1.1s", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back2.2s", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 Tiles - - { "obj1", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "obj2", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj3.4k", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj4.6k", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "dx_6.3b", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "dx_pcm.3a", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raidendxa1) -STD_ROM_FN(raidendxa1) - -struct BurnDriver BurnDrvRaidendxa1 = { - "raidendxa1", "raidendx", NULL, NULL, "1994", - "Raiden DX (Hong Kong, set 1)\0", NULL, "Seibu Kaihatsu (Metrotainment license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidendxa1RomInfo, raidendxa1RomName, NULL, NULL, RaidendxInputInfo, RaidendxDIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden DX (Hong Kong, set 2) - -static struct BurnRomInfo raidendxa2RomDesc[] = { - { "1d.bin", 0x080000, 0x22b155ae, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "2d.bin", 0x080000, 0x2be98ca8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3d.bin", 0x080000, 0xb4785576, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4d.bin", 0x080000, 0x5a77f7b4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.6s", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "dx_5.5b", 0x010000, 0x8c46857a, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "dx_7.4s", 0x020000, 0xc73986d4, 4 | BRF_GRA }, // 6 Characters - - { "dx_back1.1s", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back2.2s", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 Tiles - - { "obj1", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "obj2", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj3.4k", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj4.6k", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "dx_6.3b", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "dx_pcm.3a", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raidendxa2) -STD_ROM_FN(raidendxa2) - -struct BurnDriver BurnDrvRaidendxa2 = { - "raidendxa2", "raidendx", NULL, NULL, "1994", - "Raiden DX (Hong Kong, set 2)\0", NULL, "Seibu Kaihatsu (Metrotainment license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidendxa2RomInfo, raidendxa2RomName, NULL, NULL, RaidendxInputInfo, RaidendxDIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden DX (Korea) - -static struct BurnRomInfo raidendxkRomDesc[] = { - { "rdxj_1.bin", 0x080000, 0xb5b32885, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rdxj_2.bin", 0x080000, 0x7efd581d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rdxj_3.bin", 0x080000, 0x55ec0e1d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rdxj_4.bin", 0x080000, 0xf8fb31b4, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.6s", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "dx_5.5b", 0x010000, 0x8c46857a, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "dx_7.4s", 0x020000, 0xc73986d4, 4 | BRF_GRA }, // 6 Characters - - { "dx_back1.1s", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back2.2s", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 Tiles - - { "obj1", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "obj2", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj3.4k", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj4.6k", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "dx_6.3b", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "dx_pcm.3a", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raidendxk) -STD_ROM_FN(raidendxk) - -struct BurnDriver BurnDrvRaidendxk = { - "raidendxk", "raidendx", NULL, NULL, "1994", - "Raiden DX (Korea)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidendxkRomInfo, raidendxkRomName, NULL, NULL, RaidendxInputInfo, RaidendxDIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden DX (US) - -static struct BurnRomInfo raidendxuRomDesc[] = { - { "1a.u1210", 0x080000, 0x53e63194, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "2a.u1211", 0x080000, 0xec8d1647, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3a.u129", 0x080000, 0x7dbfd73d, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4a.u1212", 0x080000, 0xcb41a459, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.6s", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "dx_5.5b", 0x010000, 0x8c46857a, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "dx_7.4s", 0x020000, 0xc73986d4, 4 | BRF_GRA }, // 6 Characters - - { "dx_back1.1s", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back2.2s", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 Tiles - - { "obj1", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "obj2", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj3.4k", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj4.6k", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "dx_6.3b", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "dx_pcm.3a", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raidendxu) -STD_ROM_FN(raidendxu) - -struct BurnDriver BurnDrvRaidendxu = { - "raidendxu", "raidendx", NULL, NULL, "1994", - "Raiden DX (US)\0", NULL, "Seibu Kaihatsu (Fabtek license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidendxuRomInfo, raidendxuRomName, NULL, NULL, RaidendxInputInfo, RaidendxDIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden DX (Germany) - -static struct BurnRomInfo raidendxgRomDesc[] = { - { "1d.u1210", 0x080000, 0x14d725fc, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "2d.u1211", 0x080000, 0x5e7e45cb, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3d.u129", 0x080000, 0xf0a47e67, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4d.u1212", 0x080000, 0x6bde6edc, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "5.u1110", 0x010000, 0x8c46857a, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "7.u0724", 0x020000, 0xc73986d4, 4 | BRF_GRA }, // 6 Characters - - { "dx_back-1.u075", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back-2.u0714", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj-3.u0837", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj-4.u0836", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "6.u1017", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raidendxg) -STD_ROM_FN(raidendxg) - -struct BurnDriver BurnDrvRaidendxg = { - "raidendxg", "raidendx", NULL, NULL, "1994", - "Raiden DX (Germany)\0", NULL, "Seibu Kaihatsu (Tuning license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidendxgRomInfo, raidendxgRomName, NULL, NULL, RaidendxInputInfo, RaidendxDIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden DX (Holland) - -static struct BurnRomInfo raidendxnlRomDesc[] = { - { "u1210_4n.bin", 0x080000, 0xc589019a, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "u1211_4p.bin", 0x080000, 0xb2222254, 1 | BRF_PRG | BRF_ESS }, // 1 - { "u129_6n.bin", 0x080000, 0x60f04634, 1 | BRF_PRG | BRF_ESS }, // 2 - { "u1212_6p.bin", 0x080000, 0x21ec37cc, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "u1110_5b.bin", 0x010000, 0x8c46857a, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "seibu_7b_u724.bin", 0x020000, 0xc73986d4, 4 | BRF_GRA }, // 6 Characters - - { "dx_back-1.u075", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back-2.u0714", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj-3.u0837", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj-4.u0836", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "seibu_6_u1017.bin", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raidendxnl) -STD_ROM_FN(raidendxnl) - -struct BurnDriver BurnDrvRaidendxnl = { - "raidendxnl", "raidendx", NULL, NULL, "1994", - "Raiden DX (Holland)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidendxnlRomInfo, raidendxnlRomName, NULL, NULL, RaidendxInputInfo, RaidendxDIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden DX (Japan) - -static struct BurnRomInfo raidendxjRomDesc[] = { - { "rdxj_1.u1211", 0x080000, 0x5af382e1, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rdxj_2.u0212", 0x080000, 0x899966fc, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rdxj_3.u129", 0x080000, 0xe7f08013, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rdxj_4.u1212", 0x080000, 0x78037e1f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "rdxj_5.u1110", 0x010000, 0x8c46857a, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "rdxj_7.u0724", 0x020000, 0xec31fa10, 4 | BRF_GRA }, // 6 Characters - - { "dx_back-1.u075", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back-2.u0714", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 - - { "raiden_2_seibu_obj-1.u0811", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "raiden_2_seibu_obj-2.u082", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj-3.u0837", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj-4.u0836", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "rdxj_6.u1017", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "pcm.u1018", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raidendxj) -STD_ROM_FN(raidendxj) - -struct BurnDriver BurnDrvRaidendxj = { - "raidendxj", "raidendx", NULL, NULL, "1994", - "Raiden DX (Japan)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidendxjRomInfo, raidendxjRomName, NULL, NULL, RaidendxInputInfo, RaidendxDIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden DX (China) - -static struct BurnRomInfo raidendxchRomDesc[] = { - { "rdxc_1.u1210", 0x080000, 0x2154c6ae, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "rdxc_2.u1211", 0x080000, 0x73bb74b7, 1 | BRF_PRG | BRF_ESS }, // 1 - { "rdxc_3.u129", 0x080000, 0x50f0a6aa, 1 | BRF_PRG | BRF_ESS }, // 2 - { "rdxc_4.u1212", 0x080000, 0x00071e70, 1 | BRF_PRG | BRF_ESS }, // 3 - - // no other roms present with this set, so the ones below could be wrong - { "copx-d2.6s", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "dx_5.5b", 0x010000, 0x8c46857a, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "dx_7.4s", 0x020000, 0xc73986d4, 4 | BRF_GRA }, // 6 Characters - - { "dx_back1.1s", 0x200000, 0x90970355, 5 | BRF_GRA }, // 7 Tiles - { "dx_back2.2s", 0x200000, 0x5799af3e, 5 | BRF_GRA }, // 8 - - { "obj1", 0x200000, 0xff08ef0b, 6 | BRF_GRA }, // 9 Sprites (Encrypted) - { "obj2", 0x200000, 0x638eb771, 6 | BRF_GRA }, // 10 - { "dx_obj3.4k", 0x200000, 0xba381227, 6 | BRF_GRA }, // 11 - { "dx_obj4.6k", 0x200000, 0x65e50d19, 6 | BRF_GRA }, // 12 - - { "dx_6.3b", 0x040000, 0x9a9196da, 7 | BRF_SND }, // 13 OKI #0 Samples - - { "dx_pcm.3a", 0x040000, 0x8cf0d17e, 8 | BRF_SND }, // 14 OKI #1 Samples -}; - -STD_ROM_PICK(raidendxch) -STD_ROM_FN(raidendxch) - -struct BurnDriver BurnDrvRaidendxch = { - "raidendxch", "raidendx", NULL, NULL, "1994", - "Raiden DX (China)\0", NULL, "Seibu Kaihatsu (Ideal International Development Corp license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, raidendxchRomInfo, raidendxchRomName, NULL, NULL, RaidendxInputInfo, RaidendxDIPInfo, - RaidendxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Zero Team USA (set 1, US, Fabtek license) - -static struct BurnRomInfo zeroteamRomDesc[] = { - { "seibu__1.u024.5k", 0x040000, 0x25aa5ba4, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "seibu__3.u023.6k", 0x040000, 0xec79a12b, 1 | BRF_PRG | BRF_ESS }, // 1 - { "seibu__2.u025.6l", 0x040000, 0x54f3d359, 1 | BRF_PRG | BRF_ESS }, // 2 - { "seibu__4.u026.5l", 0x040000, 0xa017b8d0, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313.6n", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "seibu__5.u1110.5b", 0x010000, 0x7ec1fbc3, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "seibu__7.u072.5s", 0x010000, 0x9f6aa0f0, 4 | BRF_GRA }, // 6 Characters - { "seibu__8.u077.5r", 0x010000, 0x68f7dddc, 4 | BRF_GRA }, // 7 - - { "musha_back-1.u075.4s", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 8 Tiles - { "musha_back-2.u0714.2s", 0x080000, 0xce61c952, 5 | BRF_GRA }, // 9 - - { "musha_obj-1.u0811.6f", 0x200000, 0x45be8029, 6 | BRF_GRA }, // 10 Sprites (Encrypted) - { "musha_obj-2.u082.5f", 0x200000, 0xcb61c19d, 6 | BRF_GRA }, // 11 - - { "seibu__6.u105.4a", 0x040000, 0x48be32b1, 7 | BRF_SND }, // 12 OKI Samples - - { "v3c001.pal.u0310.jed", 0x000288, 0x00000000, 0 | BRF_OPT }, // 13 Pals - { "v3c002.tibpal16l8-25.u0322.jed", 0x000288, 0x00000000, 0 | BRF_OPT }, // 14 - { "v3c003.ami18cv8p-15.u0619.jed", 0x000288, 0x00000000, 0 | BRF_OPT }, // 15 - { "v3c004x.ami18cv8pc-25.u0310.jed", 0x000288, 0x00000000, 0 | BRF_OPT }, // 16 -}; - -STD_ROM_PICK(zeroteam) -STD_ROM_FN(zeroteam) - -struct BurnDriver BurnDrvZeroteam = { - "zeroteam", NULL, NULL, NULL, "1993", - "Zero Team USA (set 1, US, Fabtek license)\0", "Unemulated protection", "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, zeroteamRomInfo, zeroteamRomName, NULL, NULL, ZeroteamInputInfo, ZeroteamDIPInfo, - ZeroteamInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// Zero Team (set 2, Japan? (earlier?)) - -static struct BurnRomInfo zeroteamaRomDesc[] = { - { "1.u024.5k", 0x040000, 0xbd7b3f3a, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "3.u023.6k", 0x040000, 0x19e02822, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2.u025.6l", 0x040000, 0x0580b7e8, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.u026.5l", 0x040000, 0xcc666385, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313.6n", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "5.a.u1110.5b", 0x010000, 0xefc484ca, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "7.a.u072.5s", 0x010000, 0xeb10467f, 4 | BRF_GRA }, // 6 Characters - { "8.a.u077.5r", 0x010000, 0xa0b2a09a, 4 | BRF_GRA }, // 7 - - { "musha_back-1.u075.4s", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 8 Tiles - { "musha_back-2.u0714.2s", 0x080000, 0xce61c952, 5 | BRF_GRA }, // 9 - - { "musha_obj-1.u0811.6f", 0x200000, 0x45be8029, 6 | BRF_GRA }, // 10 Sprites (Encrypted) - { "musha_obj-2.u082.5f", 0x200000, 0xcb61c19d, 6 | BRF_GRA }, // 11 - - { "6.u105.4a", 0x040000, 0x48be32b1, 7 | BRF_SND }, // 12 OKI Samples - - { "v3c001.pal.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 13 pals - { "v3c002.tibpal16l8-25.u0322.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 14 - { "v3c003.ami18cv8p-15.u0619.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 15 - { "v3c004x.ami18cv8pc-25.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 16 -}; - -STD_ROM_PICK(zeroteama) -STD_ROM_FN(zeroteama) - -struct BurnDriver BurnDrvZeroteama = { - "zeroteama", "zeroteam", NULL, NULL, "1993", - "Zero Team (set 2, Japan? (earlier?))\0", "Unemulated protection", "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, zeroteamaRomInfo, zeroteamaRomName, NULL, NULL, ZeroteamInputInfo, ZeroteamDIPInfo, - ZeroteamInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// Zero Team (set 3, Japan? (later batteryless)) - -static struct BurnRomInfo zeroteambRomDesc[] = { - { "1b.u024.5k", 0x040000, 0x157743d0, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "3b.u023.6k", 0x040000, 0xfea7e4e8, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2b.u025.6l", 0x040000, 0x21d68f62, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4b.u026.5l", 0x040000, 0xce8fe6c2, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313.6n", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "5.u1110.5b", 0x010000, 0x7ec1fbc3, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "7.u072.5s", 0x010000, 0x9f6aa0f0, 4 | BRF_GRA }, // 6 Characters - { "8.u077.5r", 0x010000, 0x68f7dddc, 4 | BRF_GRA }, // 7 - - { "musha_back-1.u075.4s", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 8 Tiles - { "musha_back-2.u0714.2s", 0x080000, 0xce61c952, 5 | BRF_GRA }, // 9 - - { "musha_obj-1.u0811.6f", 0x200000, 0x45be8029, 6 | BRF_GRA }, // 10 Sprites (Encrypted) - { "musha_obj-2.u082.5f", 0x200000, 0xcb61c19d, 6 | BRF_GRA }, // 11 - - { "6.u105.4a", 0x040000, 0x48be32b1, 7 | BRF_SND }, // 12 OKI Samples - - { "v3c001.pal.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 13 pals - { "v3c002.tibpal16l8-25.u0322.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 14 - { "v3c003.ami18cv8p-15.u0619.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 15 - { "v3c004x.ami18cv8pc-25.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 16 -}; - -STD_ROM_PICK(zeroteamb) -STD_ROM_FN(zeroteamb) - -struct BurnDriver BurnDrvZeroteamb = { - "zeroteamb", "zeroteam", NULL, NULL, "1993", - "Zero Team (set 3, Japan? (later batteryless))\0", "Unemulated protection", "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, zeroteambRomInfo, zeroteambRomName, NULL, NULL, ZeroteamInputInfo, ZeroteamDIPInfo, - ZeroteamInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// Zero Team (set 4, Taiwan, Liang Hwa license) - -static struct BurnRomInfo zeroteamcRomDesc[] = { - { "b1.u024.5k", 0x040000, 0x528de3b9, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "b3.u023.6k", 0x040000, 0x3688739a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "b2.u025.6l", 0x040000, 0x5176015e, 1 | BRF_PRG | BRF_ESS }, // 2 - { "b4.u026.5l", 0x040000, 0xc79925cb, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313.6n", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "5.c.u1110.5b", 0x010000, 0xefc484ca, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "b7.u072.5s", 0x010000, 0x30ec0241, 4 | BRF_GRA }, // 6 Characters - { "b8.u077.5r", 0x010000, 0xe18b3a75, 4 | BRF_GRA }, // 7 - - { "musha_back-1.u075.4s", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 8 Tiles - { "musha_back-2.u0714.2s", 0x080000, 0xce61c952, 5 | BRF_GRA }, // 9 - - { "musha_obj-1.u0811.6f", 0x200000, 0x45be8029, 6 | BRF_GRA }, // 10 Sprites (Encrypted) - { "musha_obj-2.u082.5f", 0x200000, 0xcb61c19d, 6 | BRF_GRA }, // 11 - - { "6.c.u105.4a", 0x040000, 0xb4a6e899, 7 | BRF_SND }, // 12 OKI Samples - - { "v3c001.pal.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 13 pals - { "v3c002.tibpal16l8-25.u0322.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 14 - { "v3c003.ami18cv8p-15.u0619.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 15 - { "v3c004x.ami18cv8pc-25.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 16 -}; - -STD_ROM_PICK(zeroteamc) -STD_ROM_FN(zeroteamc) - -struct BurnDriver BurnDrvZeroteamc = { - "zeroteamc", "zeroteam", NULL, NULL, "1993", - "Zero Team (set 4, Taiwan, Liang Hwa license)\0", "Unemulated protection", "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, zeroteamcRomInfo, zeroteamcRomName, NULL, NULL, ZeroteamInputInfo, ZeroteamDIPInfo, - ZeroteamInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// Zero Team (set 5, Korea, Dream Soft license) - -static struct BurnRomInfo zeroteamdRomDesc[] = { - { "1.d.u024.5k", 0x040000, 0x6cc279be, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "3.d.u023.6k", 0x040000, 0x0212400d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4.d.u025.6l", 0x040000, 0x08813ebb, 1 | BRF_PRG | BRF_ESS }, // 2 - { "2.d.u026.5l", 0x040000, 0x9236129d, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313.6n", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "512kb.u1110.5b", 0x010000, 0xefc484ca, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "512kb.u072.5s", 0x010000, 0x30ec0241, 4 | BRF_GRA }, // 6 Characters - { "512kb.u077.5r", 0x010000, 0xe18b3a75, 4 | BRF_GRA }, // 7 - - { "musha_back-1.u075.4s", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 8 Tiles - { "musha_back-2.u0714.2s", 0x080000, 0xce61c952, 5 | BRF_GRA }, // 9 - - { "musha_obj-1.u0811.6f", 0x200000, 0x45be8029, 6 | BRF_GRA }, // 10 Sprites (Encrypted) - { "musha_obj-2.u082.5f", 0x200000, 0xcb61c19d, 6 | BRF_GRA }, // 11 - - { "8.u105.4a", 0x040000, 0xb4a6e899, 7 | BRF_SND }, // 12 OKI Samples - - { "v3c001.pal.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 13 pals - { "v3c002.tibpal16l8-25.u0322.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 14 - { "v3c003.ami18cv8p-15.u0619.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 15 - { "v3c004x.ami18cv8pc-25.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 16 -}; - -STD_ROM_PICK(zeroteamd) -STD_ROM_FN(zeroteamd) - -struct BurnDriver BurnDrvZeroteamd = { - "zeroteamd", "zeroteam", NULL, NULL, "1993", - "Zero Team (set 5, Korea, Dream Soft license)\0", "Unemulated protection", "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, zeroteamdRomInfo, zeroteamdRomName, NULL, NULL, ZeroteamInputInfo, ZeroteamDIPInfo, - ZeroteamInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// Zero Team Selection - -static struct BurnRomInfo zeroteamsRomDesc[] = { - { "1_sel.bin", 0x040000, 0xd99d6273, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "3_sel.bin", 0x040000, 0x0a9fe0b1, 1 | BRF_PRG | BRF_ESS }, // 1 - { "2_sel.bin", 0x040000, 0x4e114e74, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4_sel.bin", 0x040000, 0x0df8ba94, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313.6n", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "5_sel.bin", 0x010000, 0xed91046c, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "7.u072.5s", 0x010000, 0x9f6aa0f0, 4 | BRF_GRA }, // 6 Characters - { "8.u077.5r", 0x010000, 0x68f7dddc, 4 | BRF_GRA }, // 7 - - { "musha_back-1.u075.4s", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 8 Tiles - { "musha_back-2.u0714.2s", 0x080000, 0xce61c952, 5 | BRF_GRA }, // 9 - - { "musha_obj-1.u0811.6f", 0x200000, 0x45be8029, 6 | BRF_GRA }, // 10 Sprites (Encrypted) - { "musha_obj-2.u082.5f", 0x200000, 0xcb61c19d, 6 | BRF_GRA }, // 11 - - { "6.u105.4a", 0x040000, 0x48be32b1, 7 | BRF_SND }, // 12 oki - - { "v3c001.pal.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 13 pals - { "v3c002.tibpal16l8-25.u0322.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 14 - { "v3c003.ami18cv8p-15.u0619.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 15 - { "v3c004x.ami18cv8pc-25.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 16 -}; - -STD_ROM_PICK(zeroteams) -STD_ROM_FN(zeroteams) - -struct BurnDriver BurnDrvZeroteams = { - "zeroteams", "zeroteam", NULL, NULL, "1993", - "Zero Team Selection\0", "Unemulated protection", "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, zeroteamsRomInfo, zeroteamsRomName, NULL, NULL, ZeroteamInputInfo, ZeroteamDIPInfo, - ZeroteamInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// Zero Team Suicide Revival Kit - -static struct BurnRomInfo zeroteamsrRomDesc[] = { - { "zteam1.u24", 0x040000, 0xc531e009, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "zteam3.u23", 0x040000, 0x1f988808, 1 | BRF_PRG | BRF_ESS }, // 1 - { "zteam2.u25", 0x040000, 0xb7234b93, 1 | BRF_PRG | BRF_ESS }, // 2 - { "zteam4.u26", 0x040000, 0xc2d26708, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "copx-d2.u0313.6n", 0x040000, 0xa6732ff9, 2 | BRF_PRG | BRF_OPT }, // 4 COPX MCU data - - { "5.5c", 0x010000, 0x7ec1fbc3, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 Code - - { "7.u072.5s", 0x010000, 0x9f6aa0f0, 4 | BRF_GRA }, // 6 Characters - { "8.u077.5r", 0x010000, 0x68f7dddc, 4 | BRF_GRA }, // 7 - - { "musha_back-1.u075.4s", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 8 Tiles - { "musha_back-2.u0714.2s", 0x080000, 0xce61c952, 5 | BRF_GRA }, // 9 - - { "musha_obj-1.u0811.6f", 0x200000, 0x45be8029, 6 | BRF_GRA }, // 10 Sprites (Encrypted) - { "musha_obj-2.u082.5f", 0x200000, 0xcb61c19d, 6 | BRF_GRA }, // 11 - - { "6.u105.4a", 0x040000, 0x48be32b1, 7 | BRF_SND }, // 12 OKI Samples - - { "v3c001.pal.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 13 pals - { "v3c002.tibpal16l8-25.u0322.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 14 - { "v3c003.ami18cv8p-15.u0619.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 15 - { "v3c004x.ami18cv8pc-25.u0310.jed", 0x000288, 0x00000000, 8 | BRF_NODUMP }, // 16 -}; - -STD_ROM_PICK(zeroteamsr) -STD_ROM_FN(zeroteamsr) - -struct BurnDriver BurnDrvZeroteamsr = { - "zeroteamsr", "zeroteam", NULL, NULL, "1993", - "Zero Team Suicide Revival Kit\0", "No game code! Black screen normal!", "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, zeroteamsrRomInfo, zeroteamsrRomName, NULL, NULL, ZeroteamInputInfo, ZeroteamDIPInfo, - ZeroteamInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// X Se Dae Quiz (Korea) - -static struct BurnRomInfo xsedaeRomDesc[] = { - { "1.u024", 0x040000, 0x185437f9, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code - { "2.u025", 0x040000, 0xa2b052df, 1 | BRF_PRG | BRF_ESS }, // 1 - { "3.u023", 0x040000, 0x293fd6c1, 1 | BRF_PRG | BRF_ESS }, // 2 - { "4.u026", 0x040000, 0x5adf20bf, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8.u1110", 0x020000, 0x2dc2f81a, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "6.u072.5s", 0x010000, 0xa788402d, 4 | BRF_GRA }, // 5 Characters - { "5.u077.5r", 0x010000, 0x478deced, 4 | BRF_GRA }, // 6 - - { "bg-1.u075", 0x100000, 0xac087560, 5 | BRF_GRA }, // 7 Tiles - { "7.u0714", 0x080000, 0x296105dc, 5 | BRF_GRA }, // 8 - - { "obj-1.u0811", 0x200000, 0x6ae993eb, 6 | BRF_GRA }, // 9 Sprites - { "obj-2.u082", 0x200000, 0x26c806ee, 6 | BRF_GRA }, // 10 - - { "9.u105.4a", 0x040000, 0xa7a0c5f9, 7 | BRF_SND }, // 11 OKI Samples -}; - -STD_ROM_PICK(xsedae) -STD_ROM_FN(xsedae) - -struct BurnDriverD BurnDrvXsedae = { - "xsedae", NULL, NULL, NULL, "1993", - "X Se Dae Quiz (Korea)\0", NULL, "Dream Island", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, xsedaeRomInfo, xsedaeRomName, NULL, NULL, Raiden2InputInfo, XsedaeDIPInfo, - XsedaeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// Raiden II New / Raiden DX (newer V33 PCB) (Raiden DX EEPROM) - -static struct BurnRomInfo r2dx_v33RomDesc[] = { - { "prg.223", 0x400000, 0xb3dbcf98, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - - { "fix.613", 0x040000, 0x3da27e39, 2 | BRF_GRA }, // 1 Characters - - { "bg.612", 0x400000, 0x162c61e9, 3 | BRF_GRA }, // 2 Tiles - - { "obj1.724", 0x400000, 0x7d218985, 4 | BRF_GRA }, // 3 Sprites (Encrypted) - { "obj2.725", 0x400000, 0x891b24d6, 4 | BRF_GRA }, // 4 - - { "pcm.099", 0x100000, 0x97ca2907, 5 | BRF_SND }, // 5 OKI Samples - - { "copx_d3.357", 0x020000, 0xfa2cf3ad, 6 | BRF_GRA }, // 6 Copx data - - { "raidendx_eeprom-r2dx_v33.bin", 0x000080, 0x0b34c0ca, 7 | BRF_PRG | BRF_ESS }, // 7 EEPROM -}; - -STD_ROM_PICK(r2dx_v33) -STD_ROM_FN(r2dx_v33) - -struct BurnDriver BurnDrvR2dx_v33 = { - "r2dx_v33", NULL, NULL, NULL, "1996", - "Raiden II New / Raiden DX (newer V33 PCB) (Raiden DX EEPROM)\0", "Terrible sound quality is normal for this game, use Raiden DX instead!", "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, r2dx_v33RomInfo, r2dx_v33RomName, NULL, NULL, Rdx_v33InputInfo, Rdx_v33DIPInfo, - R2dxInit, DrvExit, R2dxFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// Raiden II New / Raiden DX (newer V33 PCB) (Raiden II EEPROM) - -static struct BurnRomInfo r2dx_v33_r2RomDesc[] = { - { "prg.223", 0x400000, 0xb3dbcf98, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - - { "fix.613", 0x040000, 0x3da27e39, 2 | BRF_GRA }, // 1 Characters - - { "bg.612", 0x400000, 0x162c61e9, 3 | BRF_GRA }, // 2 Tiles - - { "obj1.724", 0x400000, 0x7d218985, 4 | BRF_GRA }, // 3 Sprites (Encrypted) - { "obj2.725", 0x400000, 0x891b24d6, 4 | BRF_GRA }, // 4 - - { "pcm.099", 0x100000, 0x97ca2907, 5 | BRF_SND }, // 5 OKI Samples - - { "copx_d3.357", 0x020000, 0xfa2cf3ad, 6 | BRF_GRA }, // 6 Copx data - - { "raidenii_eeprom-r2dx_v33.bin", 0x000080, 0xba454777, 7 | BRF_PRG | BRF_ESS }, // 7 EEPROM -}; - -STD_ROM_PICK(r2dx_v33_r2) -STD_ROM_FN(r2dx_v33_r2) - -struct BurnDriver BurnDrvR2dx_v33_r2 = { - "r2dx_v33_r2", "r2dx_v33", NULL, NULL, "1996", - "Raiden II New / Raiden DX (newer V33 PCB) (Raiden II EEPROM)\0", "Terrible sound quality is normal for this game, use Raiden II instead!", "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, r2dx_v33_r2RomInfo, r2dx_v33_r2RomName, NULL, NULL, Rdx_v33InputInfo, Rdx_v33DIPInfo, - R2dxInit, DrvExit, R2dxFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 320, 3, 4 -}; - - -// New Zero Team (V33 SYSTEM TYPE_B hardware) - -static struct BurnRomInfo nzeroteamRomDesc[] = { - { "SEIBU_1.U0224", 0x080000, 0xce1bcaf4, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "SEIBU_2.U0226", 0x080000, 0x03f6e32d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d3.bin", 0x020000, 0xfa2cf3ad, 2 | BRF_GRA }, // 2 Copx data - - { "SEIBU_3.U01019", 0x010000, 0x7ec1fbc3, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "SEIBU_5.U0616", 0x010000, 0xce68ba3c, 4 | BRF_GRA }, // 4 Characters - { "SEIBU_6.U0617", 0x010000, 0xcf44aea7, 4 | BRF_GRA }, // 5 - - { "back-1", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 6 Tiles - { "back-2", 0x080000, 0xce61c952, 5 | BRF_GRA }, // 7 - - { "obj-1", 0x200000, 0x45be8029, 6 | BRF_GRA }, // 8 Sprites (Encrypted) - { "obj-2", 0x200000, 0xcb61c19d, 6 | BRF_GRA }, // 9 - - { "SEIBU_4.U099", 0x040000, 0x48be32b1, 7 | BRF_SND }, // 10 OKI Samples - - { "SYSV33B-2.U0227.bin", 0x0117, 0xd9f4612f, 0 | BRF_OPT }, - { "SYSV33B-1.U0222.bin", 0x0117, 0xf514a11f, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(nzeroteam) -STD_ROM_FN(nzeroteam) - -struct BurnDriver BurnDrvNzeroteam = { - "nzeroteam", "zeroteam", NULL, NULL, "1997", - "New Zero Team (V33 SYSTEM TYPE_B hardware)\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, nzeroteamRomInfo, nzeroteamRomName, NULL, NULL, NzeroteaInputInfo, NzeroteaDIPInfo, - NzeroteamInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// New Zero Team (V33 SYSTEM TYPE_B hardware, China?) - -static struct BurnRomInfo nzeroteamaRomDesc[] = { - { "prg1", 0x080000, 0x3c7d9410, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - { "prg2", 0x080000, 0x6cba032d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "copx-d3.bin", 0x020000, 0xfa2cf3ad, 2 | BRF_GRA }, // 2 Copx data - - { "sound", 0x010000, 0x7ec1fbc3, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "fix1", 0x010000, 0x0c4895b0, 4 | BRF_GRA }, // 4 Characters - { "fix2", 0x010000, 0x07d8e387, 4 | BRF_GRA }, // 5 - - { "back-1", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 6 Tiles - { "back-2", 0x080000, 0xce61c952, 5 | BRF_GRA }, // 7 - - { "obj-1", 0x200000, 0x45be8029, 6 | BRF_GRA }, // 8 Sprites (Encrypted) - { "obj-2", 0x200000, 0xcb61c19d, 6 | BRF_GRA }, // 9 - - { "6.pcm", 0x040000, 0x48be32b1, 7 | BRF_SND }, // 10 OKI Samples - - { "SYSV33B-2.U0227.bin", 0x0117, 0xd9f4612f, 0 | BRF_OPT }, - { "SYSV33B-1.U0222.bin", 0x0117, 0xf514a11f, 0 | BRF_OPT }, -}; - -STD_ROM_PICK(nzeroteama) -STD_ROM_FN(nzeroteama) - -struct BurnDriver BurnDrvNzeroteama = { - "nzeroteama", "zeroteam", NULL, NULL, "1997", - "New Zero Team (V33 SYSTEM TYPE_B hardware, China?)\0", NULL, "Seibu Kaihatsu (Haoyunlai Trading Company license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, nzeroteamaRomInfo, nzeroteamaRomName, NULL, NULL, NzeroteaInputInfo, NzeroteaDIPInfo, - NzeroteamInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; - - -// Zero Team 2000 - -static struct BurnRomInfo zerotm2kRomDesc[] = { - { "mt28f800b1.u0230", 0x100000, 0x6ab49d8c, 1 | BRF_PRG | BRF_ESS }, // 0 V33 Code - - { "mx27c1000mc.u0366", 0x020000, 0xfa2cf3ad, 2 | BRF_GRA }, // 1 Copx data - - { "syz-02.u019", 0x010000, 0x55371073, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "syz-04.u0616", 0x010000, 0x3515a45f, 4 | BRF_GRA }, // 3 Characters - { "syz-03.u0617", 0x010000, 0x02fbf9d7, 4 | BRF_GRA }, // 4 - - { "szy-05.u0614", 0x100000, 0x8b7f9219, 5 | BRF_GRA }, // 5 Tiles - { "mt28f400b1.u0619", 0x080000, 0x266acee6, 5 | BRF_GRA }, // 6 - - { "musha_obj-1a.u0729", 0x200000, 0x9b2cf68c, 6 | BRF_GRA }, // 7 Sprites (Scrambled) - { "musha_obj-2a.u0730", 0x200000, 0xfcabee05, 6 | BRF_GRA }, // 8 - - { "szy-01.u099", 0x040000, 0x48be32b1, 7 | BRF_SND }, // 9 OKI Samples -}; - -STD_ROM_PICK(zerotm2k) -STD_ROM_FN(zerotm2k) - -struct BurnDriver BurnDrvZerotm2k = { - "zerotm2k", "zeroteam", NULL, NULL, "2000", - "Zero Team 2000\0", NULL, "Seibu Kaihatsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, zerotm2kRomInfo, zerotm2kRomName, NULL, NULL, ZeroteamInputInfo, NULL, - Zerotm2kInit, DrvExit, ZeroteamFrame, ZeroteamDraw, DrvScan, &DrvRecalc, 0x800, - 320, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_sandscrp.cpp b/jan/src/burn/drv/pst90s/d_sandscrp.cpp deleted file mode 100644 index 643e57158..000000000 --- a/jan/src/burn/drv/pst90s/d_sandscrp.cpp +++ /dev/null @@ -1,900 +0,0 @@ -// FB Alpha Sand Scorpion driver module -// Based on MAME driver by Luca Elia -// Note: oc'd from 12 to 20mhz to make this game playable, for some reason its not so bad in mame... - dink - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m68000_intf.h" -#include "msm6295.h" -#include "burn_ym2203.h" -#include "kaneko_tmap.h" -#include "pandora.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvTransTab; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPandoraRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVideoRAM; -static UINT8 *DrvVidRegs; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 nDrvZ80Bank; -static UINT8 soundlatch; -static UINT8 soundlatch2; -static INT32 watchdog; -static INT32 vblank_irq; -static INT32 sprite_irq; -static INT32 unknown_irq; -static INT32 latch1_full; -static INT32 latch2_full; - -typedef struct -{ - UINT16 x1p, y1p, x1s, y1s; - UINT16 x2p, y2p, x2s, y2s; - INT16 x12, y12, x21, y21; - UINT16 mult_a, mult_b; -} calc1_hit_t; - -static calc1_hit_t m_hit; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[2]; -static UINT16 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo SandscrpInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 4, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Sandscrp) - -static struct BurnDIPInfo SandscrpDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "1" }, - {0x13, 0x01, 0x03, 0x01, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bombs" }, - {0x13, 0x01, 0x0c, 0x08, "1" }, - {0x13, 0x01, 0x0c, 0x04, "2" }, - {0x13, 0x01, 0x0c, 0x0c, "3" }, - {0x13, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x30, "Easy" }, - {0x13, 0x01, 0x30, 0x20, "Normal" }, - {0x13, 0x01, 0x30, 0x10, "Hard" }, - {0x13, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0xc0, 0x80, "100K, 300K" }, - {0x13, 0x01, 0xc0, 0xc0, "200K, 500K" }, - {0x13, 0x01, 0xc0, 0x40, "500K, 1000K" }, - {0x13, 0x01, 0xc0, 0x00, "1000K, 3000K" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x14, 0x01, 0x0f, 0x0a, "6 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "8 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x02, "5 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Sandscrp) - -static inline void palette_update(UINT16 offset) -{ - INT32 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (p >> 5) & 0x1f; - INT32 g = (p >> 10) & 0x1f; - INT32 b = (p >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -static UINT16 galpanib_calc_read(UINT32 offset) // Simulation of the CALC1 MCU -{ - calc1_hit_t &hit = m_hit; - - switch (offset) - { - case 0x00/2: // watchdog - watchdog = 0; - return 0; - - case 0x04/2: // similar to the hit detection from SuperNova, but much simpler - { - UINT16 data = 0; - - // X Absolute Collision - if (hit.x1p > hit.x2p) data |= 0x0200; - else if (hit.x1p == hit.x2p) data |= 0x0400; - else if (hit.x1p < hit.x2p) data |= 0x0800; - - // Y Absolute Collision - if (hit.y1p > hit.y2p) data |= 0x2000; - else if (hit.y1p == hit.y2p) data |= 0x4000; - else if (hit.y1p < hit.y2p) data |= 0x8000; - - // XY Overlap Collision - hit.x12 = (hit.x1p) - (hit.x2p + hit.x2s); - hit.y12 = (hit.y1p) - (hit.y2p + hit.y2s); - hit.x21 = (hit.x1p + hit.x1s) - (hit.x2p); - hit.y21 = (hit.y1p + hit.y1s) - (hit.y2p); - - if ((hit.x12 < 0) && (hit.y12 < 0) && (hit.x21 >= 0) && (hit.y21 >= 0)) - data |= 0x0001; - - return data; - } - - case 0x10/2: - return (((UINT32)hit.mult_a * (UINT32)hit.mult_b) >> 16); - - case 0x12/2: - return (((UINT32)hit.mult_a * (UINT32)hit.mult_b) & 0xffff); - - - case 0x14/2: - return BurnRandom(); // really rand - } - - return 0; -} - -static void galpanib_calc_write(INT32 offset, UINT16 data) -{ - calc1_hit_t &hit = m_hit; - - switch (offset) - { - case 0x00/2: hit.x1p = data; break; - case 0x02/2: hit.x1s = data; break; - case 0x04/2: hit.y1p = data; break; - case 0x06/2: hit.y1s = data; break; - case 0x08/2: hit.x2p = data; break; - case 0x0a/2: hit.x2s = data; break; - case 0x0c/2: hit.y2p = data; break; - case 0x0e/2: hit.y2s = data; break; - case 0x10/2: hit.mult_a = data; break; - case 0x12/2: hit.mult_b = data; break; - } -} - -static void update_irq_state() -{ - INT32 irq = (vblank_irq || sprite_irq || unknown_irq) ? 1 : 0; - - SekSetIRQLine(1, irq ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void __fastcall sandscrp_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffe0) == 0x200000) { - galpanib_calc_write((address & 0x1f) >> 1, data); - return; - } - - switch (address) - { - case 0x100000: - if (data & 0x08) sprite_irq = 0; - if (data & 0x10) unknown_irq = 0; - if (data & 0x20) vblank_irq = 0; - update_irq_state(); - return; - - case 0xa00000: - return; // coin counter - - case 0xe00000: - latch1_full = 1; - soundlatch = data & 0xff; - ZetNmi(); - ZetRun(100); // ? - return; - - case 0xe40000: - latch1_full = data & 0x80; - latch2_full = data & 0x40; - return; - } -} - -static void __fastcall sandscrp_main_write_byte(UINT32 address, UINT8 data) -{ - bprintf (0, _T("MWB %5.5x %2.2x\n"), address, data); -} - -static UINT16 __fastcall sandscrp_main_read_word(UINT32 address) -{ - if ((address & 0xffffe0) == 0x200000) { - return galpanib_calc_read((address & 0x1f) >> 1); - } - - switch (address) - { - case 0x800000: - return ((sprite_irq << 3) | (unknown_irq << 4) | (vblank_irq << 5)); - - case 0xb00000: - return DrvInputs[0]; - - case 0xb00002: - return DrvInputs[1]; - - case 0xb00004: - return DrvInputs[2]; - - case 0xb00006: - return 0xffff; - - case 0xe00000: - latch2_full = 0; - return soundlatch2; - - case 0xe40000: - return (latch1_full ? 0x80 : 0) | (latch2_full ? 0x40 : 0); - - case 0xec0000: - watchdog = 0; - return 0; - } - - return 0; -} - -static UINT8 __fastcall sandscrp_main_read_byte(UINT32 address) -{ - bprintf (0, _T("MRB %5.5x\n"), address); - - return 0; -} - -static void __fastcall sandscrp_pandora_write_word(UINT32 address, UINT16 data) -{ - address &= 0x1ffe; - - data &= 0xff; - - DrvSprRAM[address + 0] = data; - DrvSprRAM[address + 1] = data; - - DrvPandoraRAM[address/2] = data; -} - -static void __fastcall sandscrp_pandora_write_byte(UINT32 address, UINT8 data) -{ - address &= 0x1ffe; - - DrvSprRAM[address + 0] = data; - DrvSprRAM[address + 1] = data; - - DrvPandoraRAM[address/2] = data; -} - -static void __fastcall sandscrp_palette_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + (address & 0xffe))) = data; - palette_update(address & 0xffe); -} - -static void __fastcall sandscrp_palette_write_byte(UINT32 address, UINT8 data) -{ - DrvPalRAM[(address & 0xfff) ^ 1] = data; - palette_update(address & 0xffe); -} - -static void bankswitch(INT32 bank) -{ - nDrvZ80Bank = bank & 7; - - ZetMapMemory(DrvZ80ROM + ((bank & 0x07) * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall sandscrp_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - bankswitch(data); - return; - - case 0x02: - BurnYM2203Write(0, 0, data); - return; - - case 0x03: - BurnYM2203Write(0, 1, data); - return; - - case 0x04: - MSM6295Command(0, data); - return; - - case 0x06: - latch2_full = 1; - soundlatch2 = data; - return; - } -} - -static UINT8 __fastcall sandscrp_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x02: - return BurnYM2203Read(0, 0); - - case 0x03: - return BurnYM2203Read(0, 1); - - case 0x07: - latch1_full = 0; - return soundlatch; - - case 0x08: - return (latch2_full ? 0x80 : 0) | (latch1_full ? 0x40 : 0); - } - - return 0; -} - -static UINT8 DrvYM2203PortA(UINT32) -{ - return DrvDips[0]; -} - -static UINT8 DrvYM2203PortB(UINT32) -{ - return DrvDips[1]; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM2203Reset(); - ZetClose(); - - MSM6295Reset(0); - - nDrvZ80Bank = 0; - vblank_irq = 0; - sprite_irq = 0; - unknown_irq = 0; - soundlatch = 0; - soundlatch2 = 0; - latch1_full = 0; - latch2_full = 0; - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - - DrvTransTab = Next; Next += 0x400000 / 0x100; - - MSM6295ROM = Next; Next += 0x040000; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x002000; - - Drv68KRAM = Next; Next += 0x010000; - DrvPandoraRAM = Next; Next += 0x002000; - DrvSprRAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x001000; - - DrvVideoRAM = Next; Next += 0x004000; - DrvVidRegs = Next; Next += 0x000400; - - RamEnd = Next; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static void DrvFillTransTable() -{ - memset (DrvTransTab, 0, 0x4000); - - for (INT32 i = 0; i < 0x400000; i+= 0x100) { - DrvTransTab[i/0x100] = 1; // transparent - - for (INT32 j = 0; j < 0x100; j++) { - if (DrvGfxROM0[j + i]) { - DrvTransTab[i/0x100] = 0; - break; - } - } - } -} - -static INT32 DrvGfxDecode() -{ - static INT32 Plane[4] = { STEP4(0,1) }; - static INT32 XOffs0[16] = { STEP4(12, -4), STEP4(28, -4), STEP4(268, -4),STEP4(284, -4) }; - static INT32 XOffs1[16] = { STEP8(0,4), STEP8(256,4) }; - static INT32 YOffs[16] = { STEP8(0, 32), STEP8(512, 32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x200000); - - GfxDecode(0x2000, 4, 16, 16, Plane, XOffs0, YOffs, 0x400, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x2000, 4, 16, 16, Plane, XOffs1, YOffs, 0x400, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(INT32 type) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (type == 0) // early revisions - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, 6, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x000000, 7, 1)) return 1; - } - else - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - BurnByteswap(DrvGfxROM0, 0x200000); - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(MSM6295ROM + 0x000000, 5, 1)) return 1; - } - - DrvGfxDecode(); - DrvFillTransTable(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvVidRegs, 0x300000, 0x30000f|0x3ff, MAP_RAM); - SekMapMemory(DrvVideoRAM, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x500000, 0x501fff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x600000, 0x600fff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x700000, 0x70ffff, MAP_RAM); - SekSetWriteWordHandler(0, sandscrp_main_write_word); - SekSetWriteByteHandler(0, sandscrp_main_write_byte); - SekSetReadWordHandler(0, sandscrp_main_read_word); - SekSetReadByteHandler(0, sandscrp_main_read_byte); - - SekMapHandler(1, 0x500000, 0x501fff, MAP_WRITE); - SekSetWriteWordHandler(1, sandscrp_pandora_write_word); - SekSetWriteByteHandler(1, sandscrp_pandora_write_byte); - - SekMapHandler(2, 0x600000, 0x600fff, MAP_WRITE); - SekSetWriteWordHandler(2, sandscrp_palette_write_word); - SekSetWriteByteHandler(2, sandscrp_palette_write_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xc000, 0xdfff, MAP_RAM); - ZetSetOutHandler(sandscrp_sound_write_port); - ZetSetInHandler(sandscrp_sound_read_port); - ZetClose(); - - BurnYM2203Init(1, 4000000, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, &DrvYM2203PortA, &DrvYM2203PortB, NULL, NULL); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.25, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 2000000 / 132, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - kaneko_view2_init(0, DrvVideoRAM, DrvVidRegs, DrvGfxROM0, 0x400, DrvTransTab, 91, 5); - pandora_init(DrvPandoraRAM, DrvGfxROM1, (0x200000/0x100)-1, 0x000, 0, -16); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2203Exit(); - - MSM6295Exit(0); - MSM6295ROM = NULL; - - SekExit(); - ZetExit(); - - pandora_exit(); - kaneko_view2_exit(); - - GenericTilesExit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) - { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_update(i); - } - - DrvRecalc = 0; - } - - BurnTransferClear(); - - for (INT32 i = 0; i < 8; i++) { - kaneko_view2_draw_layer(0, 0, i); - kaneko_view2_draw_layer(0, 1, i); - } - - pandora_update(pTransDraw); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog > 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3 * sizeof(UINT16)); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { 20000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] += SekRun(nSegment); - - if (i == 224) { - vblank_irq = 1; - update_irq_state(); - } - - if (i == 255) { - sprite_irq = 1; - update_irq_state(); - } - - BurnTimerUpdate(SekTotalCycles()/3); - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - pandora_buffer_sprites(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ba.Data = &m_hit; - ba.nLen = sizeof(calc1_hit_t); - ba.szName = "hit calculation"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - SCAN_VAR(vblank_irq); - SCAN_VAR(sprite_irq); - SCAN_VAR(unknown_irq); - SCAN_VAR(soundlatch); - SCAN_VAR(soundlatch2); - SCAN_VAR(latch1_full); - SCAN_VAR(latch2_full); - SCAN_VAR(nDrvZ80Bank); - - BurnRandomScan(nAction); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(nDrvZ80Bank); - ZetClose(); - - DrvRecalc = 1; - } - - return 0; -} - - -// Sand Scorpion - -static struct BurnRomInfo sandscrpRomDesc[] = { - { "11.bin", 0x40000, 0x9b24ab40, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "12.bin", 0x40000, 0xad12caee, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "8.ic51", 0x20000, 0x6f3e9db1, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "4.ic32", 0x80000, 0xb9222ff2, 3 | BRF_GRA }, // 3 Tiles - { "3.ic33", 0x80000, 0xadf20fa0, 3 | BRF_GRA }, // 4 - - { "5.ic16", 0x80000, 0x9bb675f6, 4 | BRF_GRA }, // 5 Sprites - { "6.ic17", 0x80000, 0x7df2f219, 4 | BRF_GRA }, // 6 - - { "7.ic55", 0x40000, 0x9870ab12, 5 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(sandscrp) -STD_ROM_FN(sandscrp) - -static INT32 sandscrpInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvSandscrp = { - "sandscrp", NULL, NULL, NULL, "1992", - "Sand Scorpion\0", NULL, "Face", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, sandscrpRomInfo, sandscrpRomName, NULL, NULL, SandscrpInputInfo, SandscrpDIPInfo, - sandscrpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Sand Scorpion (Earlier) - -static struct BurnRomInfo sandscrpaRomDesc[] = { - { "1.ic4", 0x40000, 0xc0943ae2, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2.ic5", 0x40000, 0x6a8e0012, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "8.ic51", 0x20000, 0x6f3e9db1, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "4.ic32", 0x80000, 0xb9222ff2, 3 | BRF_GRA }, // 3 Tiles - { "3.ic33", 0x80000, 0xadf20fa0, 3 | BRF_GRA }, // 4 - - { "5.ic16", 0x80000, 0x9bb675f6, 4 | BRF_GRA }, // 5 Sprites - { "6.ic17", 0x80000, 0x7df2f219, 4 | BRF_GRA }, // 6 - - { "7.ic55", 0x40000, 0x9870ab12, 5 | BRF_SND }, // 7 Samples -}; - -STD_ROM_PICK(sandscrpa) -STD_ROM_FN(sandscrpa) - -struct BurnDriver BurnDrvSandscrpa = { - "sandscrpa", "sandscrp", NULL, NULL, "1992", - "Sand Scorpion (Earlier)\0", NULL, "Face", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, sandscrpaRomInfo, sandscrpaRomName, NULL, NULL, SandscrpInputInfo, SandscrpDIPInfo, - sandscrpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; - - -// Sand Scorpion (Chinese Title Screen, Revised Hardware) - -static struct BurnRomInfo sandscrpbRomDesc[] = { - { "11.ic4", 0x040000, 0x80020cab, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "12.ic5", 0x040000, 0x8df1d42f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "8.ic51", 0x020000, 0x6f3e9db1, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ss501.ic30", 0x100000, 0x0cf9f99d, 3 | BRF_GRA }, // 3 Tiles - - { "ss502.ic16", 0x100000, 0xd8012ebb, 4 | BRF_GRA }, // 4 Sprites - - { "7.ic55", 0x040000, 0x9870ab12, 5 | BRF_SND }, // 5 Samples -}; - -STD_ROM_PICK(sandscrpb) -STD_ROM_FN(sandscrpb) - -static INT32 sandscrpbInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvSandscrpb = { - "sandscrpb", "sandscrp", NULL, NULL, "1992", - "Sand Scorpion (Chinese Title Screen, Revised Hardware)\0", NULL, "Face", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, sandscrpbRomInfo, sandscrpbRomName, NULL, NULL, SandscrpInputInfo, SandscrpDIPInfo, - sandscrpbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/pst90s/d_seta.cpp b/jan/src/burn/drv/pst90s/d_seta.cpp deleted file mode 100644 index 7333fb468..000000000 --- a/jan/src/burn/drv/pst90s/d_seta.cpp +++ /dev/null @@ -1,11330 +0,0 @@ -// FB Alpha Seta driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "m6502_intf.h" -#include "burn_ym2612.h" -#include "burn_ym3812.h" -#include "burn_ym2203.h" -#include "burn_gun.h" -#include "msm6295.h" -#include "x1010.h" - -/* - To do: - flipscreen support - jockeyc needs work... -*/ - -#define NOIRQ2 0x80 -#define SET_IRQLINES(vblank, irq2) (((vblank) << 8) | (irq2)) -#define SPRITE_BUFFER 1 -#define NO_SPRITE_BUFFER 0 -#define SET_GFX_DECODE(n0, n1, n2) n0, n1, n2 - -static UINT8 *AllMem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *AllRam = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KROM = NULL; -static UINT8 *DrvSubROM = NULL; -static UINT8 *DrvGfxROM0 = NULL; -static UINT8 *DrvGfxROM1 = NULL; -static UINT8 *DrvGfxROM2 = NULL; -static UINT8 *DrvColPROM = NULL; -static UINT8 *DrvSndROM = NULL; -static UINT8 *Drv68KRAM = NULL; -static UINT8 *Drv68KRAM2 = NULL; -static UINT8 *Drv68KRAM3 = NULL; -static UINT8 *DrvSubRAM = NULL; -static UINT8 *DrvShareRAM = NULL; -static UINT8 *DrvNVRAM = NULL; -static UINT8 *DrvPalRAM = NULL; -static UINT8 *DrvSprRAM0 = NULL; -static UINT8 *DrvSprRAM1 = NULL; -static UINT8 *DrvVidRAM0 = NULL; -static UINT8 *DrvVidRAM1 = NULL; -static UINT8 *DrvVIDCTRLRAM0 = NULL; -static UINT8 *DrvVIDCTRLRAM1 = NULL; -static UINT8 *DrvVideoRegs = NULL; - -static UINT32 *Palette = NULL; -static UINT32 *DrvPalette = NULL; -static UINT8 DrvRecalc; - -static UINT8 soundlatch = 0; -static UINT8 soundlatch2 = 0; - -static UINT8 *tilebank = NULL; -static UINT32 *tile_offset = NULL; - -// allow us to override generic rom loading -static INT32 (*pRomLoadCallback)(INT32 bLoad) = NULL; - -static INT32 cpuspeed = 0; -static INT32 irqtype = 0; -static INT32 buffer_sprites = 0; -static INT32 DrvROMLen[5] = { 0, 0, 0, 0, 0 }; -static INT32 DrvGfxMask[3] = { 0, 0, 0 }; -static UINT8 *DrvGfxTransMask[3] = { NULL, NULL, NULL }; -static INT32 VideoOffsets[3][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 } }; -static INT32 ColorOffsets[3] = { 0, 0, 0 }; -static INT32 ColorDepths[3]; -static INT32 twineagle = 0; -static INT32 daiohc = 0; // lazy fix - disable writes to alternate scroll write offsets -static INT32 usclssic = 0; -static INT32 oisipuzl_hack = 0; // 32px sprite offset -static INT32 refresh_rate = 6000; - -static INT32 seta_samples_bank = 0; -static INT32 usclssic_port_select = 0; -static INT32 gun_input_bit = 0; -static INT32 gun_input_src = 0; -static INT32 flipflop = 0; - -static INT32 watchdog_enable = 0; -static INT32 watchdog = 0; -static INT32 flipscreen; -static INT32 m65c02_mode = 0; -static INT32 m65c02_bank = 0; -static INT32 sub_ctrl_data = 0; -static INT32 has_2203 = 0; - -static INT32 DrvAxis[4]; -static UINT16 DrvAnalogInput[4]; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvJoy5[16]; -static UINT8 DrvJoy6[16]; -static UINT8 DrvJoy7[16]; -static UINT8 DrvDips[7]; -static UINT16 DrvInputs[7]; -static UINT8 DrvReset; - -// trackball stuff for Krazy Bowl & usclssic -static INT32 trackball_mode = 0; -static INT32 DrvAnalogPort0 = 0; -static INT32 DrvAnalogPort1 = 0; -static UINT32 track_x = 0; -static UINT32 track_y = 0; -static INT32 track_x_last = 0; -static INT32 track_y_last = 0; - -// Rotation stuff! -dink -static UINT8 DrvFakeInput[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 nRotateHoldInput[2] = {0, 0}; -static INT32 nRotate[2] = {0, 0}; -static INT32 nRotateTarget[2] = {0, 0}; -static INT32 nRotateTry[2] = {0, 0}; -static UINT32 nRotateTime[2] = {0, 0}; -static UINT8 game_rotates = 0; - -#define A(a, b, c, d) { a, b, (UINT8*)(c), d } - -static struct BurnInputInfo QzkklogyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 5" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Qzkklogy) - -static struct BurnInputInfo DrgnunitInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Drgnunit) - -static struct BurnInputInfo StgInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Stg) - -static struct BurnInputInfo Qzkklgy2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Qzkklgy2) - -static struct BurnInputInfo DaiohInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvJoy4 + 2, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy4 + 3, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 5" }, - {"P2 Button 6", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Daioh) - -static struct BurnInputInfo RezonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Rezon) - -static struct BurnInputInfo EightfrcInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Eightfrc) - -static struct BurnInputInfo WrofaeroInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Wrofaero) - -static struct BurnInputInfo ZingzipInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Zingzip) - -static struct BurnInputInfo MsgundamInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Msgundam) - -static struct BurnInputInfo KamenridInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Kamenrid) - -static struct BurnInputInfo MadsharkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Madshark) - -static struct BurnInputInfo WitsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"P3 Start", BIT_DIGITAL, DrvJoy4 + 7, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 2, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 3, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 0, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 1, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2" }, - - {"P4 Start", BIT_DIGITAL, DrvJoy5 + 7, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy5 + 2, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy5 + 3, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy5 + 0, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy5 + 1, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 5, "p4 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Wits) - -static struct BurnInputInfo ThunderlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Thunderl) - -static struct BurnInputInfo AtehateInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 0, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Atehate) - -static struct BurnInputInfo BlockcarInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Blockcar) - -static struct BurnInputInfo GundharaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Gundhara) - -static struct BurnInputInfo BlandiaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Blandia) - -static struct BurnInputInfo OisipuzlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Oisipuzl) - -static struct BurnInputInfo PairloveInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Pairlove) - -static struct BurnInputInfo OrbsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Orbs) - -static struct BurnInputInfo KeroppiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Keroppi) - -static struct BurnInputInfo JjsquawkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Jjsquawk) - -static struct BurnInputInfo ExtdwnhlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Extdwnhl) - -static struct BurnInputInfo KrzybowlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - A("P1 Trackball X", BIT_ANALOG_REL, &DrvAnalogPort0,"p1 x-axis"), - A("P1 Trackball Y", BIT_ANALOG_REL, &DrvAnalogPort1,"p1 y-axis"), - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - // space holders for analog inputs - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 8, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvJoy2 + 9, "p2 fire 5" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Krzybowl) - -static struct BurnInputInfo UtoukondInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Utoukond) - -static struct BurnInputInfo TndrcadeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 5, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tndrcade) - -static struct BurnInputInfo DowntownInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3 (rotate)", BIT_DIGITAL, DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3 (rotate)", BIT_DIGITAL, DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 5, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 4, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Downtown) - -static struct BurnInputInfo MetafoxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 5, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 4, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Metafox) - -static struct BurnInputInfo ZombraidInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "mouse button 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "mouse button 2" }, - A("P1 Right / left", BIT_ANALOG_REL, DrvAxis + 0, "mouse x-axis"), - A("P1 Up / Down", BIT_ANALOG_REL, DrvAxis + 1, "mouse y-axis"), - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - A("P2 Right / left", BIT_ANALOG_REL, DrvAxis + 2, "p2 x-axis"), - A("P2 Up / Down", BIT_ANALOG_REL, DrvAxis + 3, "p2 y-axis"), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Zombraid) - -static struct BurnInputInfo KiwameInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"Start", BIT_DIGITAL, DrvJoy4 + 5, "p1 start" }, - {"A", BIT_DIGITAL, DrvJoy4 + 0, "mah a" }, - {"B", BIT_DIGITAL, DrvJoy3 + 0, "mah b" }, - {"C", BIT_DIGITAL, DrvJoy5 + 0, "mah c" }, - {"D", BIT_DIGITAL, DrvJoy6 + 0, "mah d" }, - {"E", BIT_DIGITAL, DrvJoy4 + 1, "mah e" }, - {"F", BIT_DIGITAL, DrvJoy2 + 3, "mah f" }, - {"G", BIT_DIGITAL, DrvJoy5 + 1, "mah g" }, - {"H", BIT_DIGITAL, DrvJoy6 + 1, "mah h" }, - {"I", BIT_DIGITAL, DrvJoy4 + 2, "mah i" }, - {"J", BIT_DIGITAL, DrvJoy3 + 2, "mah j" }, - {"K", BIT_DIGITAL, DrvJoy4 + 4, "mah k" }, - {"L", BIT_DIGITAL, DrvJoy2 + 0, "mah l" }, - {"M", BIT_DIGITAL, DrvJoy4 + 3, "mah m" }, - {"N", BIT_DIGITAL, DrvJoy3 + 3, "mah n" }, - {"Pon", BIT_DIGITAL, DrvJoy6 + 3, "mah pon" }, - {"Chi", BIT_DIGITAL, DrvJoy5 + 3, "mah chi" }, - {"Kan", BIT_DIGITAL, DrvJoy4 + 4, "mah kan" }, - {"Ron", BIT_DIGITAL, DrvJoy5 + 4, "mah ron" }, - {"Reach", BIT_DIGITAL, DrvJoy3 + 4, "mah reach" }, - {"Flip Flip", BIT_DIGITAL, DrvJoy2 + 3, "mah ff" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Kiwame) - -static struct BurnInputInfo SokonukeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Sokonuke) - -static struct BurnInputInfo NeobattlInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Neobattl) - -static struct BurnInputInfo UmanclubInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Umanclub) - -static struct BurnInputInfo TwineaglInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 5, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Twineagl) - -static struct BurnInputInfo CrazyfgtInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 top-center", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 bottom-center", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - {"P1 top-left", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 3" }, - {"P1 bottom-left", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 4" }, - {"P1 top-right", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 5" }, - {"P1 bottom-right", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 7, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Crazyfgt) - -static struct BurnInputInfo Calibr50InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3 (rotate)", BIT_DIGITAL, DrvFakeInput + 4, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3 (rotate)", BIT_DIGITAL, DrvFakeInput + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 5, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 4, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Calibr50) - -static struct BurnInputInfo UsclssicInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 14, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 13, "p1 fire 1" }, - - A("P1 Trackball X", BIT_ANALOG_REL, &DrvAnalogPort0,"p1 x-axis"), - A("P1 Trackball Y", BIT_ANALOG_REL, &DrvAnalogPort1,"p1 y-axis"), - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy5 + 14, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy5 + 13, "p2 fire 1" }, -// space holder for analog inputs - {"P2 Button 2", BIT_DIGITAL, DrvJoy4 + 0, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy5 + 0, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 7, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Usclssic) - -static struct BurnInputInfo JockeycInputList[] = { - {"P1 A Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin" }, - {"P1 B Coin", BIT_DIGITAL, DrvJoy1 + 4, "p3 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy4 + 3, "p1 start" }, - {"P1 Bet 1", BIT_DIGITAL, DrvJoy3 + 0, "p1 bet 1" }, - {"P1 Bet 2", BIT_DIGITAL, DrvJoy3 + 1, "p1 bet 2" }, - {"P1 Bet 3", BIT_DIGITAL, DrvJoy3 + 2, "p1 bet 3" }, - {"P1 Bet 4", BIT_DIGITAL, DrvJoy3 + 3, "p1 bet 4" }, - {"P1 Bet 5", BIT_DIGITAL, DrvJoy3 + 4, "p1 bet 5" }, - {"P1 Bet 6", BIT_DIGITAL, DrvJoy4 + 0, "p1 bet 6" }, - {"P1 Bet 1-2", BIT_DIGITAL, DrvJoy5 + 0, "p1 bet 1-2" }, - {"P1 Bet 1-3", BIT_DIGITAL, DrvJoy5 + 1, "p1 bet 1-3" }, - {"P1 Bet 1-4", BIT_DIGITAL, DrvJoy5 + 2, "p1 bet 1-4" }, - {"P1 Bet 1-5", BIT_DIGITAL, DrvJoy5 + 3, "p1 bet 1-5" }, - {"P1 Bet 1-6", BIT_DIGITAL, DrvJoy5 + 4, "p1 bet 1-6" }, - {"P1 Bet 2-3", BIT_DIGITAL, DrvJoy6 + 0, "p1 bet 2-3" }, - {"P1 Bet 2-4", BIT_DIGITAL, DrvJoy6 + 1, "p1 bet 2-4" }, - {"P1 Bet 2-5", BIT_DIGITAL, DrvJoy6 + 2, "p1 bet 2-5" }, - {"P1 Bet 2-6", BIT_DIGITAL, DrvJoy6 + 3, "p1 bet 2-6" }, - {"P1 Bet 3-4", BIT_DIGITAL, DrvJoy6 + 4, "p1 bet 3-4" }, - {"P1 Bet 3-5", BIT_DIGITAL, DrvJoy7 + 0, "p1 bet 3-5" }, - {"P1 Bet 3-6", BIT_DIGITAL, DrvJoy7 + 1, "p1 bet 3-6" }, - {"P1 Bet 4-5", BIT_DIGITAL, DrvJoy7 + 2, "p1 bet 4-5" }, - {"P1 Bet 4-6", BIT_DIGITAL, DrvJoy7 + 3, "p1 bet 4-6" }, - {"P1 Bet 5-6", BIT_DIGITAL, DrvJoy7 + 4, "p1 bet 5-6" }, - {"P1 Collect", BIT_DIGITAL, DrvJoy4 + 1, "p1 collect" }, - {"P1 Credit", BIT_DIGITAL, DrvJoy4 + 2, "p1 credit" }, - {"P1 Cancel", BIT_DIGITAL, DrvJoy4 + 4, "p1 cancel" }, - - {"P2 A Coin", BIT_DIGITAL, DrvJoy1 + 13, "p2 coin" }, - {"P2 B Coin", BIT_DIGITAL, DrvJoy1 + 12, "p4 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 11, "p2 start" }, - {"P2 Bet 1", BIT_DIGITAL, DrvJoy3 + 8, "p2 bet 1" }, - {"P2 Bet 2", BIT_DIGITAL, DrvJoy3 + 9, "p2 bet 2" }, - {"P2 Bet 3", BIT_DIGITAL, DrvJoy3 + 10, "p2 bet 3" }, - {"P2 Bet 4", BIT_DIGITAL, DrvJoy3 + 11, "p2 bet 4" }, - {"P2 Bet 5", BIT_DIGITAL, DrvJoy3 + 12, "p2 bet 5" }, - {"P2 Bet 6", BIT_DIGITAL, DrvJoy4 + 8, "p2 bet 6" }, - {"P2 Bet 1-2", BIT_DIGITAL, DrvJoy5 + 8, "p2 bet 1-2" }, - {"P2 Bet 1-3", BIT_DIGITAL, DrvJoy5 + 9, "p2 bet 1-3" }, - {"P2 Bet 1-4", BIT_DIGITAL, DrvJoy5 + 10, "p2 bet 1-4" }, - {"P2 Bet 1-5", BIT_DIGITAL, DrvJoy5 + 11, "p2 bet 1-5" }, - {"P2 Bet 1-6", BIT_DIGITAL, DrvJoy5 + 12, "p2 bet 1-6" }, - {"P2 Bet 2-3", BIT_DIGITAL, DrvJoy6 + 8, "p2 bet 2-3" }, - {"P2 Bet 2-4", BIT_DIGITAL, DrvJoy6 + 9, "p2 bet 2-4" }, - {"P2 Bet 2-5", BIT_DIGITAL, DrvJoy6 + 10, "p2 bet 2-5" }, - {"P2 Bet 2-6", BIT_DIGITAL, DrvJoy6 + 11, "p2 bet 2-6" }, - {"P2 Bet 3-4", BIT_DIGITAL, DrvJoy6 + 12, "p2 bet 3-4" }, - {"P2 Bet 3-5", BIT_DIGITAL, DrvJoy7 + 8, "p2 bet 3-5" }, - {"P2 Bet 3-6", BIT_DIGITAL, DrvJoy7 + 9, "p2 bet 3-6" }, - {"P2 Bet 4-5", BIT_DIGITAL, DrvJoy7 + 10, "p2 bet 4-5" }, - {"P2 Bet 4-6", BIT_DIGITAL, DrvJoy7 + 11, "p2 bet 4-6" }, - {"P2 Bet 5-6", BIT_DIGITAL, DrvJoy7 + 12, "p2 bet 5-6" }, - {"P2 Collect", BIT_DIGITAL, DrvJoy4 + 9, "p2 collect" }, - {"P2 Credit", BIT_DIGITAL, DrvJoy4 + 10, "p2 credit" }, - {"P2 Cancel", BIT_DIGITAL, DrvJoy4 + 12, "p2 cancel" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 14, "service" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 0, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvDips + 3, "dip" }, - {"Dip E", BIT_DIPSWITCH, DrvDips + 4, "dip" }, - {"Dip F", BIT_DIPSWITCH, DrvDips + 5, "dip" }, - {"Dip 10", BIT_DIPSWITCH, DrvDips + 6, "dip" }, -}; - -STDINPUTINFO(Jockeyc) - -#undef A - -static struct BurnDIPInfo CrazyfgtDIPList[]= -{ - {0x09, 0xff, 0xff, 0x3f, NULL }, - {0x0a, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x09, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x09, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x09, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x09, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x09, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x09, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x09, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x09, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x09, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x09, 0x01, 0x38, 0x08, "3 Coins 1 Credits" }, - {0x09, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x09, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x09, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x09, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x09, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - {0x09, 0x01, 0x38, 0x18, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Unknown" }, - {0x09, 0x01, 0xc0, 0xc0, "5" }, - {0x09, 0x01, 0xc0, 0x80, "10" }, - {0x09, 0x01, 0xc0, 0x40, "15" }, - {0x09, 0x01, 0xc0, 0x00, "20" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0a, 0x01, 0x01, 0x01, "Off" }, - {0x0a, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty?" }, - {0x0a, 0x01, 0x0c, 0x0c, "0" }, - {0x0a, 0x01, 0x0c, 0x08, "1" }, - {0x0a, 0x01, 0x0c, 0x04, "2" }, - {0x0a, 0x01, 0x0c, 0x00, "3" }, - - {0 , 0xfe, 0 , 4, "Energy" }, - {0x0a, 0x01, 0x30, 0x10, "24" }, - {0x0a, 0x01, 0x30, 0x20, "32" }, - {0x0a, 0x01, 0x30, 0x30, "48" }, - {0x0a, 0x01, 0x30, 0x00, "100" }, - - {0 , 0xfe, 0 , 4, "Bonus?" }, - {0x0a, 0x01, 0xc0, 0xc0, "0" }, - {0x0a, 0x01, 0xc0, 0x80, "1" }, - {0x0a, 0x01, 0xc0, 0x40, "2" }, - {0x0a, 0x01, 0xc0, 0x00, "3" }, -}; - -STDDIPINFO(Crazyfgt) - - -static struct BurnDIPInfo UsclssicDIPList[]= -{ - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2, "Credits For 9-Hole" }, - {0x0d, 0x01, 0x01, 0x01, "2" }, - {0x0d, 0x01, 0x01, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Game Type" }, - {0x0d, 0x01, 0x02, 0x02, "Domestic" }, - {0x0d, 0x01, 0x02, 0x00, "Foreign" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0d, 0x01, 0x0c, 0x04, "1" }, - {0x0d, 0x01, 0x0c, 0x08, "2" }, - {0x0d, 0x01, 0x0c, 0x0c, "3" }, - {0x0d, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0d, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0e, 0x01, 0x02, 0x02, "Off" }, - {0x0e, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x04, 0x04, "Off" }, - {0x0e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Flight Distance" }, - {0x0e, 0x01, 0x38, 0x38, "Normal" }, - {0x0e, 0x01, 0x38, 0x30, "-30 Yards" }, - {0x0e, 0x01, 0x38, 0x28, "+10 Yards" }, - {0x0e, 0x01, 0x38, 0x20, "+20 Yards" }, - {0x0e, 0x01, 0x38, 0x18, "+30 Yards" }, - {0x0e, 0x01, 0x38, 0x10, "+40 Yards" }, - {0x0e, 0x01, 0x38, 0x08, "+50 Yards" }, - {0x0e, 0x01, 0x38, 0x00, "+60 Yards" }, - - {0 , 0xfe, 0 , 4, "Licensed To" }, - {0x0e, 0x01, 0xc0, 0xc0, "Romstar" }, - {0x0e, 0x01, 0xc0, 0x80, "None (Japan)" }, - {0x0e, 0x01, 0xc0, 0x40, "Taito" }, - {0x0e, 0x01, 0xc0, 0x00, "Taito America" }, -}; - -STDDIPINFO(Usclssic) - - -static struct BurnDIPInfo Calibr50DIPList[]= -{ - {0x15, 0xff, 0xff, 0xfe, NULL }, - {0x16, 0xff, 0xff, 0xfd, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Licensed To" }, - {0x15, 0x01, 0x01, 0x01, "Romstar" }, - {0x15, 0x01, 0x01, 0x00, "None (Japan)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x03, "Easiest" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x01, "Normal" }, - {0x16, 0x01, 0x03, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Score Digits" }, - {0x16, 0x01, 0x04, 0x04, "7" }, - {0x16, 0x01, 0x04, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x16, 0x01, 0x08, 0x08, "3" }, - {0x16, 0x01, 0x08, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Display Score" }, - {0x16, 0x01, 0x10, 0x00, "Off" }, - {0x16, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Erase Backup Ram" }, - {0x16, 0x01, 0x20, 0x00, "Off" }, - {0x16, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Licensed To" }, - {0x16, 0x01, 0x40, 0x40, "Taito America" }, - {0x16, 0x01, 0x40, 0x00, "Taito" }, -}; - -STDDIPINFO(Calibr50) - -static struct BurnDIPInfo TwineaglDIPList[]= -{ - {0x13, 0xff, 0xff, 0xf7, NULL }, - {0x14, 0xff, 0xff, 0xf3, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Copyright" }, - {0x13, 0x01, 0x01, 0x01, "Taito" }, - {0x13, 0x01, 0x01, 0x00, "Taito America (Romstar license)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x08, 0x00, "Upright" }, - {0x13, 0x01, 0x08, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "Never" }, - {0x14, 0x01, 0x0c, 0x08, "500K Only" }, - {0x14, 0x01, 0x0c, 0x04, "1000K Only" }, - {0x14, 0x01, 0x0c, 0x00, "500K, Every 1500K" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Copyright" }, - {0x14, 0x01, 0x40, 0x40, "Seta (Taito license)" }, - {0x14, 0x01, 0x40, 0x40, "Taito America" }, - - {0 , 0xfe, 0 , 2, "Coinage Type" }, - {0x14, 0x01, 0x80, 0x80, "1" }, - {0x14, 0x01, 0x80, 0x00, "2" }, -}; - -STDDIPINFO(Twineagl) - -static struct BurnDIPInfo KiwameDIPList[]= -{ - {0x19, 0xff, 0xff, 0xff, NULL }, - {0x1a, 0xff, 0xff, 0xff, NULL }, - {0x1b, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x19, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x19, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x19, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x19, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x19, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x19, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x19, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x19, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x19, 0x01, 0x38, 0x18, "2 Coins 3 Credits" }, - {0x19, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x19, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x19, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x19, 0x01, 0x40, 0x00, "Off" }, - {0x19, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Player's TSUMO" }, - {0x19, 0x01, 0x80, 0x80, "Manual" }, - {0x19, 0x01, 0x80, 0x00, "Auto" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1a, 0x01, 0x01, 0x01, "Off" }, - {0x1a, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1a, 0x01, 0x02, 0x02, "Off" }, - {0x1a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x1a, 0x01, 0x1c, 0x1c, "None" }, - {0x1a, 0x01, 0x1c, 0x18, "Prelim 1" }, - {0x1a, 0x01, 0x1c, 0x14, "Prelim 2" }, - {0x1a, 0x01, 0x1c, 0x10, "Final 1" }, - {0x1a, 0x01, 0x1c, 0x0c, "Final 2" }, - {0x1a, 0x01, 0x1c, 0x08, "Final 3" }, - {0x1a, 0x01, 0x1c, 0x04, "Qrt Final" }, - {0x1a, 0x01, 0x1c, 0x00, "SemiFinal" }, - - {0 , 0xfe, 0 , 8, "Points Gap" }, - {0x1a, 0x01, 0xe0, 0xe0, "None" }, - {0x1a, 0x01, 0xe0, 0xc0, "+6000" }, - {0x1a, 0x01, 0xe0, 0xa0, "+4000" }, - {0x1a, 0x01, 0xe0, 0x80, "+2000" }, - {0x1a, 0x01, 0xe0, 0x60, "-2000" }, - {0x1a, 0x01, 0xe0, 0x40, "-4000" }, - {0x1a, 0x01, 0xe0, 0x20, "-6000" }, - {0x1a, 0x01, 0xe0, 0x00, "-8000" }, -}; - -STDDIPINFO(Kiwame) - -static struct BurnDIPInfo MetafoxDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xb1, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Licensed To" }, - {0x13, 0x01, 0x01, 0x01, "Jordan" }, - {0x13, 0x01, 0x01, 0x00, "Taito America" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - {0x14, 0x01, 0x0c, 0x08, "60K Only" }, - {0x14, 0x01, 0x0c, 0x00, "60k & 90k" }, - {0x14, 0x01, 0x0c, 0x04, "90K Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Licensed To" }, - {0x14, 0x01, 0x40, 0x40, "Romstar" }, - {0x14, 0x01, 0x40, 0x00, "Taito" }, - - {0 , 0xfe, 0 , 2, "Coinage Type" }, - {0x14, 0x01, 0x80, 0x80, "1" }, - {0x14, 0x01, 0x80, 0x00, "2" }, -}; - -STDDIPINFO(Metafox) - -static struct BurnDIPInfo ArbalestDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xbf, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Licensed To" }, - {0x13, 0x01, 0x01, 0x00, "Taito" }, - {0x13, 0x01, 0x01, 0x01, "Jordan" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Easy" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x01, "Harder" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "Never" }, - {0x14, 0x01, 0x0c, 0x08, "300k Only" }, - {0x14, 0x01, 0x0c, 0x04, "600k Only" }, - {0x14, 0x01, 0x0c, 0x00, "300k & 600k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 1, "Licensed To" }, - {0x14, 0x01, 0x40, 0x40, "Romstar" }, - - {0 , 0xfe, 0 , 2, "Coinage Type" }, - {0x14, 0x01, 0x80, 0x80, "1" }, - {0x14, 0x01, 0x80, 0x00, "2" }, -}; - -STDDIPINFO(Arbalest) - -static struct BurnDIPInfo DowntownDIPList[]= -{ - {0x15, 0xff, 0xff, 0xf6, NULL }, - {0x16, 0xff, 0xff, 0xbd, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Sales" }, - {0x15, 0x01, 0x01, 0x01, "Japan Only" }, - {0x15, 0x01, 0x01, 0x00, "World" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Normal" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x0c, "Never" }, - {0x16, 0x01, 0x0c, 0x08, "50K Only" }, - {0x16, 0x01, 0x0c, 0x04, "100K Only" }, - {0x16, 0x01, 0x0c, 0x00, "50K, Every 150K" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x10, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x00, "4" }, - {0x16, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "World License" }, - {0x16, 0x01, 0x40, 0x40, "Romstar" }, - {0x16, 0x01, 0x40, 0x00, "Taito" }, - - {0 , 0xfe, 0 , 2, "Coinage Type" }, - {0x16, 0x01, 0x80, 0x80, "1" }, - {0x16, 0x01, 0x80, 0x00, "2" }, -}; - -STDDIPINFO(Downtown) - -static struct BurnDIPInfo TndrcadeDIPList[]= -{ - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x0c, "50K Only" }, - {0x13, 0x01, 0x0c, 0x04, "50K, Every 150K" }, - {0x13, 0x01, 0x0c, 0x00, "70K, Every 200K" }, - {0x13, 0x01, 0x0c, 0x08, "100K Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x30, 0x10, "1" }, - {0x13, 0x01, 0x30, 0x00, "2" }, - {0x13, 0x01, 0x30, 0x30, "3" }, - {0x13, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Licensed To" }, - {0x13, 0x01, 0x80, 0x80, "Taito America Corp." }, - {0x13, 0x01, 0x80, 0x00, "Taito Corp. Japan" }, - - {0 , 0xfe, 0 , 2, "Title" }, - {0x14, 0x01, 0x01, 0x01, "Thundercade" }, - {0x14, 0x01, 0x01, 0x00, "Twin Formation" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, -}; - -STDDIPINFO(Tndrcade) - -static struct BurnDIPInfo TndrcadjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xf7, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x0c, "50K Only" }, - {0x13, 0x01, 0x0c, 0x04, "50K, Every 150K" }, - {0x13, 0x01, 0x0c, 0x00, "70K, Every 200K" }, - {0x13, 0x01, 0x0c, 0x08, "100K Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x30, 0x10, "1" }, - {0x13, 0x01, 0x30, 0x00, "2" }, - {0x13, 0x01, 0x30, 0x30, "3" }, - {0x13, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, -}; - -STDDIPINFO(Tndrcadj) - -static struct BurnDIPInfo UtoukondDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "5 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x00, "1" }, - {0x15, 0x01, 0x03, 0x02, "2" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x01, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x0c, 0x08, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x04, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x15, 0x01, 0x40, 0x40, "100k" }, - {0x15, 0x01, 0x40, 0x00, "150k" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Utoukond) - -static struct BurnDIPInfo KrzybowlDIPList[]= -{ - {0x18, 0xff, 0xff, 0xff, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - {0x1a, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x18, 0x01, 0x01, 0x01, "Off" }, - {0x18, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x18, 0x01, 0x02, 0x00, "Off" }, - {0x18, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x18, 0x01, 0x0c, 0x08, "Easy" }, - {0x18, 0x01, 0x0c, 0x0c, "Normal" }, - {0x18, 0x01, 0x0c, 0x04, "Hard" }, - {0x18, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Frames" }, - {0x18, 0x01, 0x10, 0x10, "10" }, - {0x18, 0x01, 0x10, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x18, 0x01, 0x20, 0x20, "Upright" }, - {0x18, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x18, 0x01, 0x40, 0x40, "Trackball" }, - {0x18, 0x01, 0x40, 0x00, "Joystick" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x18, 0x01, 0x80, 0x80, "Off" }, - {0x18, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x19, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x19, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x19, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x19, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x19, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x19, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x19, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x19, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x19, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x19, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x19, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x19, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x19, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x19, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Force Coinage" }, - {0x19, 0x01, 0x40, 0x40, "No" }, - {0x19, 0x01, 0x40, 0x00, "2 Coins 1 Credits" }, -}; - -STDDIPINFO(Krzybowl) - -static struct BurnDIPInfo ExtdwnhlDIPList[]= -{ - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0c, 0x01, 0x01, 0x01, "Off" }, - {0x0c, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0c, 0x01, 0x02, 0x00, "Off" }, - {0x0c, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0c, 0x01, 0x0c, 0x08, "Easy" }, - {0x0c, 0x01, 0x0c, 0x0c, "Normal" }, - {0x0c, 0x01, 0x0c, 0x04, "Hard" }, - {0x0c, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0c, 0x01, 0x10, 0x10, "Off" }, - {0x0c, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0c, 0x01, 0x20, 0x20, "Upright" }, - {0x0c, 0x01, 0x20, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x0c, 0x01, 0x40, 0x40, "2" }, - {0x0c, 0x01, 0x40, 0x00, "1" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0c, 0x01, 0x80, 0x80, "Off" }, - {0x0c, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0d, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x0d, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x0d, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x0d, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x0d, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x0d, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x0d, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x0d, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Continue Coin" }, - {0x0d, 0x01, 0x40, 0x40, "Normal: Start 1C / Continue 1C" }, - {0x0d, 0x01, 0x40, 0x00, "Half Continue: Start 2C / Continue 1C" }, - - {0 , 0xfe, 0 , 2, "Game Mode" }, - {0x0d, 0x01, 0x80, 0x80, "Finals Only" }, - {0x0d, 0x01, 0x80, 0x00, "Semi-Finals & Finals" }, - - {0 , 0xfe, 0 , 2, "Service Mode (No Toggle)" }, - {0x0e, 0x01, 0x08, 0x08, "Off" }, - {0x0e, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Country" }, - {0x0e, 0x01, 0x30, 0x30, "World" }, - {0x0e, 0x01, 0x30, 0x10, "USA" }, - {0x0e, 0x01, 0x30, 0x00, "Japan" }, -}; - -STDDIPINFO(Extdwnhl) - -static struct BurnDIPInfo SokonukeDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x10, 0x01, 0x01, 0x01, "Off" }, - {0x10, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x0c, 0x08, "Easy" }, - {0x10, 0x01, 0x0c, 0x0c, "Normal" }, - {0x10, 0x01, 0x0c, 0x04, "Hard" }, - {0x10, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x10, 0x01, 0x10, 0x10, "Off" }, - {0x10, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Cheap Continue" }, - {0x11, 0x01, 0x40, 0x40, "No" }, - {0x11, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Sokonuke) - -static struct BurnDIPInfo JjsquawkDIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - {0x13, 0xff, 0xff, 0xef, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x38, 0x18, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Energy" }, - {0x13, 0x01, 0x30, 0x20, "2" }, - {0x13, 0x01, 0x30, 0x30, "3" }, - {0x13, 0x01, 0x30, 0x10, "4" }, - {0x13, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0xc0, 0x80, "20K, Every 100K" }, - {0x13, 0x01, 0xc0, 0xc0, "50K, Every 200K" }, - {0x13, 0x01, 0xc0, 0x40, "70K, 200K Only" }, - {0x13, 0x01, 0xc0, 0x00, "100K Only" }, -}; - -STDDIPINFO(Jjsquawk) - -static struct BurnDIPInfo KeroppiDIPList[]= -{ - {0x04, 0xff, 0xff, 0xff, NULL }, - {0x05, 0xff, 0xff, 0xbf, NULL }, - {0x06, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x04, 0x01, 0x07, 0x03, "1" }, - {0x04, 0x01, 0x07, 0x05, "2" }, - {0x04, 0x01, 0x07, 0x01, "3" }, - {0x04, 0x01, 0x07, 0x07, "4" }, - {0x04, 0x01, 0x07, 0x06, "5" }, - {0x04, 0x01, 0x07, 0x02, "6" }, - {0x04, 0x01, 0x07, 0x04, "7" }, - {0x04, 0x01, 0x07, 0x00, "8" }, - - {0 , 0xfe, 0 , 8, "Game Select" }, - {0x04, 0x01, 0x38, 0x38, "No. 1,2,3" }, - {0x04, 0x01, 0x38, 0x30, "No. 1" }, - {0x04, 0x01, 0x38, 0x28, "No. 2,3" }, - {0x04, 0x01, 0x38, 0x20, "No. 3" }, - {0x04, 0x01, 0x38, 0x18, "No. 1,2" }, - {0x04, 0x01, 0x38, 0x10, "No. 2" }, - {0x04, 0x01, 0x38, 0x08, "No. 1,3" }, - {0x04, 0x01, 0x38, 0x00, "No. 1,2,3" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x05, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x05, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x05, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x05, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x05, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x05, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x05, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x05, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x05, 0x01, 0x20, 0x20, "Off" }, - {0x05, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x05, 0x01, 0x40, 0x40, "Off" }, - {0x05, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x05, 0x01, 0x80, 0x80, "Off" }, - {0x05, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Keroppi) - -static struct BurnDIPInfo OrbsDIPList[]= -{ - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x10, 0x01, 0x01, 0x01, "Off" }, - {0x10, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x02, 0x00, "Off" }, - {0x10, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x0c, 0x08, "Easy" }, - {0x10, 0x01, 0x0c, 0x0c, "Normal" }, - {0x10, 0x01, 0x0c, 0x04, "Hard" }, - {0x10, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Stock" }, - {0x10, 0x01, 0x10, 0x10, "1" }, - {0x10, 0x01, 0x10, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x10, 0x01, 0x20, 0x20, "Off" }, - {0x10, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Timer speed" }, - {0x10, 0x01, 0x40, 0x40, "Normal" }, - {0x10, 0x01, 0x40, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x10, 0x01, 0x80, 0x80, "Off" }, - {0x10, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x11, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x11, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Force Coinage (Half)" }, - {0x11, 0x01, 0x40, 0x40, "No" }, - {0x11, 0x01, 0x40, 0x00, "2 Coins 1 Credits" }, -}; - -STDDIPINFO(Orbs) - -static struct BurnDIPInfo PairloveDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x08, "Easy" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x04, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x14, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "8 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x20, "5 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Pairlove) - -static struct BurnDIPInfo OisipuzlDIPList[]= -{ - {0x12, 0xff, 0xff, 0xfb, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Oisipuzl) - -static struct BurnDIPInfo BlandiaDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x01, 0x00, "Off" }, - {0x15, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Coinage Type" }, - {0x15, 0x01, 0x02, 0x02, "1" }, - {0x15, 0x01, 0x02, 0x00, "2" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0x1c, 0x10, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x1c, 0x0c, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x1c, 0x04, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x1c, 0x18, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x1c, 0x08, "2 Coins 5 Credits" }, - {0x15, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x1c, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xe0, 0x60, "2 Coins 4 Credits" }, - {0x15, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xe0, 0x80, "3 Coins/7 Credits" }, - {0x15, 0x01, 0xe0, 0x20, "2 Coins 5 Credits" }, - {0x15, 0x01, 0xe0, 0x40, "2 Coins 6 Credits" }, - {0x15, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xe0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "1" }, - {0x16, 0x01, 0x03, 0x03, "2" }, - {0x16, 0x01, 0x03, 0x01, "3" }, - {0x16, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - {0x16, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "2 Player Game" }, - {0x16, 0x01, 0x10, 0x10, "2 Credits" }, - {0x16, 0x01, 0x10, 0x00, "1 Credit" }, - - {0 , 0xfe, 0 , 2, "Continue" }, - {0x16, 0x01, 0x20, 0x20, "1 Credit" }, - {0x16, 0x01, 0x20, 0x00, "1 Coin" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Blandia) - -static struct BurnDIPInfo GundharaDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0x30, 0x00, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x14, 0x01, 0xc0, 0xc0, "Japanese" }, - {0x14, 0x01, 0xc0, 0x00, "English" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x0c, 0x08, "1" }, - {0x15, 0x01, 0x0c, 0x0c, "2" }, - {0x15, 0x01, 0x0c, 0x04, "3" }, - {0x15, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x30, 0x30, "200K" }, - {0x15, 0x01, 0x30, 0x20, "200K, Every 200K" }, - {0x15, 0x01, 0x30, 0x10, "400K" }, - {0x15, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, -}; - -STDDIPINFO(Gundhara) - -static struct BurnDIPInfo AtehateDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0e, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x0e, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x38, 0x18, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0e, 0x01, 0x40, 0x00, "Off" }, - {0x0e, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x01, 0x01, "Off" }, - {0x0f, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0f, 0x01, 0x0c, 0x08, "Easy" }, - {0x0f, 0x01, 0x0c, 0x0c, "Normal" }, - {0x0f, 0x01, 0x0c, 0x04, "Hard" }, - {0x0f, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x00, "2" }, - {0x0f, 0x01, 0x30, 0x30, "3" }, - {0x0f, 0x01, 0x30, 0x10, "4" }, - {0x0f, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0f, 0x01, 0xc0, 0xc0, "None" }, - {0x0f, 0x01, 0xc0, 0x00, "20K Only" }, - {0x0f, 0x01, 0xc0, 0x80, "20K, Every 30K" }, - {0x0f, 0x01, 0xc0, 0x40, "30K, Every 40K" }, -}; - -STDDIPINFO(Atehate) - -static struct BurnDIPInfo ThunderlDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xe9, NULL }, - {0x15, 0xff, 0xff, 0xef, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0x0f, 0x0c, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "4 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x04, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "4 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "2 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "3 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x02, "2 Coins 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "4 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "4 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "2 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "3 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "2 Coins 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x00, "Off" }, - {0x14, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x04, 0x00, "Upright" }, - {0x14, 0x01, 0x04, 0x04, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x14, 0x01, 0x08, 0x08, "2" }, - {0x14, 0x01, 0x08, 0x00, "1" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x20, 0x20, "3" }, - {0x14, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0xc0, 0x80, "Easy" }, - {0x14, 0x01, 0xc0, 0xc0, "Normal" }, - {0x14, 0x01, 0xc0, 0x40, "Hard" }, - {0x14, 0x01, 0xc0, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Force 1 Life" }, - {0x15, 0x01, 0x10, 0x00, "Off" }, - {0x15, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 5, "Copyright" }, - {0x15, 0x01, 0xe0, 0x80, "Romstar" }, - {0x15, 0x01, 0xe0, 0xc0, "Seta (Romstar License)"}, - {0x15, 0x01, 0xe0, 0xe0, "Seta (Visco License)" }, - {0x15, 0x01, 0xe0, 0xa0, "Visco" }, - {0x15, 0x01, 0xe0, 0x60, "None" }, -}; - -STDDIPINFO(Thunderl) - -static struct BurnDIPInfo WitsDIPList[]= -{ - {0x21, 0xff, 0xff, 0xff, NULL }, - {0x22, 0xff, 0xff, 0xff, NULL }, - {0x23, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x21, 0x01, 0x03, 0x02, "Easy" }, - {0x21, 0x01, 0x03, 0x03, "Normal" }, - {0x21, 0x01, 0x03, 0x01, "Hard" }, - {0x21, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x21, 0x01, 0x0c, 0x08, "150k, 350k" }, - {0x21, 0x01, 0x0c, 0x0c, "200k, 500k" }, - {0x21, 0x01, 0x0c, 0x04, "300k, 600k" }, - {0x21, 0x01, 0x0c, 0x00, "400k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x21, 0x01, 0x30, 0x00, "1" }, - {0x21, 0x01, 0x30, 0x10, "2" }, - {0x21, 0x01, 0x30, 0x30, "3" }, - {0x21, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Play Mode" }, - {0x21, 0x01, 0x40, 0x40, "2 Players" }, - {0x21, 0x01, 0x40, 0x00, "4 Players" }, - - {0 , 0xfe, 0 , 2, "CPU Player During Multi-Player Game" }, - {0x21, 0x01, 0x80, 0x00, "No" }, - {0x21, 0x01, 0x80, 0x80, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x22, 0x01, 0x01, 0x01, "Upright" }, - {0x22, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x22, 0x01, 0x02, 0x02, "Off" }, - {0x22, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x22, 0x01, 0x04, 0x04, "Every 3rd Loop" }, - {0x22, 0x01, 0x04, 0x00, "Every 7th Loop" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x22, 0x01, 0x08, 0x08, "Off" }, - {0x22, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x22, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x22, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x22, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x22, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x22, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x22, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x22, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x22, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "License" }, - {0x23, 0x01, 0xc0, 0xc0, "Romstar" }, - {0x23, 0x01, 0xc0, 0x80, "Seta U.S.A" }, - {0x23, 0x01, 0xc0, 0x40, "Visco (Japan Only)" }, - {0x23, 0x01, 0xc0, 0x00, "Athena (Japan Only)" }, -}; - -STDDIPINFO(Wits) - -static struct BurnDIPInfo MadsharkDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x18, 0x18, "1000k" }, - {0x13, 0x01, 0x18, 0x08, "1000k 2000k" }, - {0x13, 0x01, 0x18, 0x10, "1500k 3000k" }, - {0x13, 0x01, 0x18, 0x00, "No" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x40, "Easy" }, - {0x13, 0x01, 0x60, 0x60, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x01, "4" }, - {0x14, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x1c, 0x04, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x08, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x1c, 0x0c, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x1c, 0x18, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x1c, 0x00, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0xe0, 0x20, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xe0, 0x40, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xe0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xe0, 0x60, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xe0, 0x00, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Country" }, - {0x15, 0x01, 0x80, 0x80, "Japan" }, - {0x15, 0x01, 0x80, 0x00, "World" }, -}; - -STDDIPINFO(Madshark) - -static struct BurnDIPInfo MsgundamDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x06, 0x04, "Easy" }, - {0x14, 0x01, 0x06, 0x06, "Normal" }, - {0x14, 0x01, 0x06, 0x02, "Hard" }, - {0x14, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Memory Check" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x15, 0x01, 0x80, 0x80, "English" }, - {0x15, 0x01, 0x80, 0x00, "Japanese" }, -}; - -STDDIPINFO(Msgundam) - -static struct BurnDIPInfo Msgunda1DIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x08, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x06, 0x04, "Easy" }, - {0x14, 0x01, 0x06, 0x06, "Normal" }, - {0x14, 0x01, 0x06, 0x02, "Hard" }, - {0x14, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Memory Check" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 1, "Language" }, - {0x15, 0x01, 0x80, 0x00, "Japanese" }, -}; - -STDDIPINFO(Msgunda1) - -static struct BurnDIPInfo ZingzipDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x02, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x01, "4" }, - {0x13, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x0c, 0x08, "Easy" }, - {0x13, 0x01, 0x0c, 0x0c, "Normal" }, - {0x13, 0x01, 0x0c, 0x04, "Hard" }, - {0x13, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "8 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "5 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Zingzip) - -static struct BurnDIPInfo WrofaeroDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Stage & Weapon Select"}, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x03, 0x02, "2" }, - {0x16, 0x01, 0x03, 0x03, "3" }, - {0x16, 0x01, 0x03, 0x01, "4" }, - {0x16, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - {0x16, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x16, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x10, "8 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x20, "5 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x16, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x16, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Wrofaero) - -static struct BurnDIPInfo EightfrcDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x7b, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0x38, 0x20, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Shared Credits" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Credits To Start" }, - {0x13, 0x01, 0x80, 0x80, "1" }, - {0x13, 0x01, 0x80, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x18, 0x10, "Easy" }, - {0x14, 0x01, 0x18, 0x18, "Normal" }, - {0x14, 0x01, 0x18, 0x08, "Hard" }, - {0x14, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x60, 0x40, "2" }, - {0x14, 0x01, 0x60, 0x60, "3" }, - {0x14, 0x01, 0x60, 0x20, "4" }, - {0x14, 0x01, 0x60, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x14, 0x01, 0x80, 0x00, "English" }, - {0x14, 0x01, 0x80, 0x80, "Japanese" }, -}; - -STDDIPINFO(Eightfrc) - -static struct BurnDIPInfo RezonDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x00, "Off" }, - {0x14, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x14, 0x01, 0x18, 0x00, "Upright 1 Controller" }, - {0x14, 0x01, 0x18, 0x18, "Upright 2 Controllers"}, - {0x14, 0x01, 0x18, 0x08, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x03, 0x02, "2" }, - {0x15, 0x01, 0x03, 0x03, "3" }, - {0x15, 0x01, 0x03, 0x01, "4" }, - {0x15, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x0c, 0x08, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x04, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x15, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x10, "8 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x20, "5 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Taito Logo" }, - {0x16, 0x01, 0x10, 0x00, "Off" }, - {0x16, 0x01, 0x10, 0x10, "On" }, -}; - -STDDIPINFO(Rezon) - -static struct BurnDIPInfo Qzkklgy2DIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Highlight Right Answer" }, - {0x0e, 0x01, 0x04, 0x04, "Off" }, - {0x0e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Skip Real DAT Rom Check?" }, - {0x0e, 0x01, 0x08, 0x08, "Off" }, - {0x0e, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0e, 0x01, 0x40, 0x00, "Off" }, - {0x0e, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0f, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x07, 0x00, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0f, 0x01, 0x08, 0x08, "Off" }, - {0x0f, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0f, 0x01, 0x30, 0x30, "Easy" }, - {0x0f, 0x01, 0x30, 0x20, "Normal" }, - {0x0f, 0x01, 0x30, 0x10, "Hard" }, - {0x0f, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0xc0, 0x80, "2" }, - {0x0f, 0x01, 0xc0, 0xc0, "3" }, - {0x0f, 0x01, 0xc0, 0x40, "4" }, - {0x0f, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Qzkklgy2) - -static struct BurnDIPInfo QzkklogyDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Highlight Right Answer" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x40, 0x00, "Off" }, - {0x0f, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x10, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x07, 0x01, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x30, 0x20, "Easy" }, - {0x10, 0x01, 0x30, 0x30, "Normal" }, - {0x10, 0x01, 0x30, 0x10, "Hard" }, - {0x10, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0xc0, 0x80, "2" }, - {0x10, 0x01, 0xc0, 0xc0, "3" }, - {0x10, 0x01, 0xc0, 0x40, "4" }, - {0x10, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Qzkklogy) - -static struct BurnDIPInfo StgDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x30, 0x10, "1" }, - {0x13, 0x01, 0x30, 0x00, "2" }, - {0x13, 0x01, 0x30, 0x30, "3" }, - {0x13, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 4, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Stg) - -static struct BurnDIPInfo DrgnunitDIPList[]= -{ - {0x15, 0xff, 0xff, 0xfe, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x03, "Easy" }, - {0x15, 0x01, 0x03, 0x02, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x08, "150K, Every 300K" }, - {0x15, 0x01, 0x0c, 0x0c, "200K, Every 400K" }, - {0x15, 0x01, 0x0c, 0x04, "300K, Every 500K" }, - {0x15, 0x01, 0x0c, 0x00, "400K Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x30, 0x00, "1" }, - {0x15, 0x01, 0x30, 0x10, "2" }, - {0x15, 0x01, 0x30, 0x30, "3" }, - {0x15, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x04, 0x04, "1 of 4 Scenes" }, - {0x16, 0x01, 0x04, 0x00, "1 of 8 Scenes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x16, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x16, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x16, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Coinage Type" }, - {0x17, 0x01, 0x10, 0x10, "1" }, - {0x17, 0x01, 0x10, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Title" }, - {0x17, 0x01, 0x20, 0x20, "Dragon Unit" }, - {0x17, 0x01, 0x20, 0x00, "Castle of Dragon" }, - - {0 , 0xfe, 0 , 4, "(C) / License" }, - {0x17, 0x01, 0xc0, 0xc0, "Athena (Japan)" }, - {0x17, 0x01, 0xc0, 0x80, "Athena / Taito (Japan)" }, - {0x17, 0x01, 0xc0, 0x40, "Seta USA / Taito America" }, - {0x17, 0x01, 0xc0, 0x00, "Seta USA / Romstar" }, -}; - -STDDIPINFO(Drgnunit) - -static struct BurnDIPInfo DaiohDIPList[]= -{ - {0x1a, 0xff, 0xff, 0x7f, NULL }, - {0x1b, 0xff, 0xff, 0xff, NULL }, - {0x1c, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x1a, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x1a, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x1a, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x1a, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x1a, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x1a, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x1a, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x1a, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x1a, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x1a, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x1a, 0x01, 0x38, 0x20, "2 Coins 1 Credits" }, - {0x1a, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x1a, 0x01, 0x38, 0x18, "2 Coins 3 Credits" }, - {0x1a, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x1a, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x1a, 0x01, 0x38, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1a, 0x01, 0x40, 0x00, "Off" }, - {0x1a, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Auto Shot" }, - {0x1a, 0x01, 0x80, 0x80, "Off" }, - {0x1a, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1b, 0x01, 0x01, 0x01, "Off" }, - {0x1b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1b, 0x01, 0x02, 0x02, "Off" }, - {0x1b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1b, 0x01, 0x0c, 0x08, "Easy" }, - {0x1b, 0x01, 0x0c, 0x0c, "Normal" }, - {0x1b, 0x01, 0x0c, 0x04, "Hard" }, - {0x1b, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x1b, 0x01, 0x30, 0x00, "1" }, - {0x1b, 0x01, 0x30, 0x10, "2" }, - {0x1b, 0x01, 0x30, 0x30, "3" }, - {0x1b, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x1b, 0x01, 0xc0, 0x80, "300k and every 800k" }, - {0x1b, 0x01, 0xc0, 0xc0, "500k and every 1000k" }, - {0x1b, 0x01, 0xc0, 0x40, "800k and 2000k only" }, - {0x1b, 0x01, 0xc0, 0x00, "1000k Only" }, - - {0 , 0xfe, 0 , 2, "Country" }, - {0x1c, 0x01, 0x80, 0x80, "USA (6 buttons)" }, - {0x1c, 0x01, 0x80, 0x00, "Japan (2 buttons)" }, -}; - -STDDIPINFO(Daioh) - -static struct BurnDIPInfo NeobattlDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x00, "Off" }, - {0x11, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Stage Select" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "1" }, - {0x12, 0x01, 0x03, 0x03, "2" }, - {0x12, 0x01, 0x03, 0x01, "3" }, - {0x12, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x12, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "8 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x20, "5 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Neobattl) - -static struct BurnDIPInfo UmanclubDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Stage Select" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x03, 0x02, "1" }, - {0x14, 0x01, 0x03, 0x03, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x08, "Easy" }, - {0x14, 0x01, 0x0c, 0x0c, "Normal" }, - {0x14, 0x01, 0x0c, 0x04, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x14, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "8 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x20, "5 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, - {0x14, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "Free Play" }, -}; - -STDDIPINFO(Umanclub) - -static struct BurnDIPInfo KamenridDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Intro Music" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x14, 0x01, 0x0f, 0x05, "6 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "8 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "5 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x02, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x10, "Easy" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - {0x14, 0x01, 0x30, 0x20, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Country" }, - {0x15, 0x01, 0x80, 0x80, "USA" }, - {0x15, 0x01, 0x80, 0x00, "Japan" }, -}; - -STDDIPINFO(Kamenrid) - -static struct BurnDIPInfo BlockcarDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x02, "Easy" }, - {0x13, 0x01, 0x03, 0x03, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x0c, "20K, Every 50K" }, - {0x13, 0x01, 0x0c, 0x04, "20K, Every 70K" }, - {0x13, 0x01, 0x0c, 0x08, "30K, Every 60K" }, - {0x13, 0x01, 0x0c, 0x00, "30K, Every 90K" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x30, 0x00, "1" }, - {0x13, 0x01, 0x30, 0x30, "2" }, - {0x13, 0x01, 0x30, 0x20, "3" }, - {0x13, 0x01, 0x30, 0x10, "4" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x04, 0x00, "Off" }, - {0x14, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Title" }, - {0x15, 0x01, 0x10, 0x10, "Thunder & Lightning 2" }, - {0x15, 0x01, 0x10, 0x00, "Block Carnival" }, -}; - -STDDIPINFO(Blockcar) - -static struct BurnDIPInfo ZombraidDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xfd, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Vertical Screen Flip" }, - {0x0e, 0x01, 0x01, 0x01, "Off" }, - {0x0e, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Horizontal Screen Flip" }, - {0x0e, 0x01, 0x02, 0x00, "Off" }, - {0x0e, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0e, 0x01, 0x04, 0x00, "Off" }, - {0x0e, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0e, 0x01, 0x18, 0x10, "Easy" }, - {0x0e, 0x01, 0x18, 0x18, "Normal" }, - {0x0e, 0x01, 0x18, 0x08, "Hard" }, - {0x0e, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0e, 0x01, 0x20, 0x00, "Off" }, - {0x0e, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0f, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x0f, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x0f, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x0f, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x0f, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x0f, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x0f, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x0f, 0x01, 0x40, 0x40, "No" }, - {0x0f, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Zombraid) - -static struct BurnDIPInfo JockeycDIPList[]= -{ - {0x39, 0xff, 0xff, 0xff, NULL }, - {0x3a, 0xff, 0xff, 0xff, NULL }, - {0x3b, 0xff, 0xff, 0xff, NULL }, - - {0x3c, 0xff, 0xff, 0xff, NULL }, - {0x3d, 0xff, 0xff, 0xff, NULL }, - {0x3e, 0xff, 0xff, 0xff, NULL }, - {0x3f, 0xff, 0xff, 0xff, NULL }, - -// dip1 - {0 , 0xfe, 0 , 3, "Max Bet" }, - {0x39, 0x01, 0x03, 0x03, "10" }, - {0x39, 0x01, 0x03, 0x02, "20" }, - {0x39, 0x01, 0x03, 0x01, "99" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x39, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x39, 0x01, 0x1c, 0x18, "1 Coin 2 Credits" }, - {0x39, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x39, 0x01, 0x1c, 0x10, "1 Coin 4 Credits" }, - {0x39, 0x01, 0x1c, 0x0c, "1 Coin 5 Credits" }, - {0x39, 0x01, 0x1c, 0x08, "1 Coin/10 Credits" }, - {0x39, 0x01, 0x1c, 0x04, "1 Coin/20 Credits" }, - {0x39, 0x01, 0x1c, 0x00, "1 Coin/50 Credits" }, - -// dip2-3 - {0 , 0xfe, 0 , 4, "Betting Clock Speed" }, - {0x3a, 0x01, 0x18, 0x18, "Slowest" }, - {0x3a, 0x01, 0x18, 0x10, "Slower" }, - {0x3a, 0x01, 0x18, 0x08, "Faster" }, - {0x3a, 0x01, 0x18, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 16, "Payout Rate" }, - {0x3b, 0x01, 0x01, 0x01, "80%" }, - {0x3b, 0x01, 0x01, 0x01, "81%" }, - {0x3b, 0x01, 0x01, 0x01, "82%" }, - {0x3b, 0x01, 0x01, 0x01, "83%" }, - {0x3b, 0x01, 0x01, 0x01, "84%" }, - {0x3b, 0x01, 0x01, 0x01, "85%" }, - {0x3b, 0x01, 0x01, 0x01, "86%" }, - {0x3b, 0x01, 0x01, 0x01, "87%" }, - {0x3b, 0x01, 0x01, 0xe0, "88%" }, - {0x3b, 0x01, 0x01, 0xc0, "89%" }, - {0x3b, 0x01, 0x01, 0xa0, "90%" }, - {0x3b, 0x01, 0x01, 0x80, "91%" }, - {0x3b, 0x01, 0x01, 0x60, "92%" }, - {0x3b, 0x01, 0x01, 0x40, "93%" }, - {0x3b, 0x01, 0x01, 0x20, "94%" }, - {0x3b, 0x01, 0x01, 0x00, "95%" }, - - {0 , 0xfe, 0 , 2, "Payout" }, - {0x3b, 0x01, 0x04, 0x00, "Off" }, - {0x3b, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Horses" }, - {0x3b, 0x01, 0x08, 0x08, "Random" }, - {0x3b, 0x01, 0x08, 0x00, "Cyclic" }, - - {0 , 0xfe, 0 , 2, "Higher Odds" }, - {0x3b, 0x01, 0x10, 0x10, "Off" }, - {0x3b, 0x01, 0x10, 0x00, "On" }, - -// overlay on p1/p2 - {0 , 0xfe, 0 , 2, "Coin Drop - 1P" }, - {0x3c, 0x01, 0x01, 0x01, "Off" }, - {0x3c, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Hopper Overflow - 1P" }, - {0x3c, 0x01, 0x02, 0x02, "Off" }, - {0x3c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Out" }, - {0x3c, 0x01, 0x04, 0x00, "Off" }, - {0x3c, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Att Pay - 1P" }, - {0x3c, 0x01, 0x08, 0x08, "Off" }, - {0x3c, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Sense 2 - 1P" }, - {0x3c, 0x01, 0x40, 0x40, "Off" }, - {0x3c, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Sense 1 - 1P" }, - {0x3c, 0x01, 0x80, 0x80, "Off" }, - {0x3c, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Drop - 2P" }, - {0x3d, 0x01, 0x01, 0x01, "Off" }, - {0x3d, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sel Sense" }, - {0x3d, 0x01, 0x02, 0x02, "Off" }, - {0x3d, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Att Pay - 2P" }, - {0x3d, 0x01, 0x08, 0x08, "Off" }, - {0x3d, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Sense 2 - 2P" }, - {0x3d, 0x01, 0x40, 0x40, "Off" }, - {0x3d, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Sense 1 - 2P" }, - {0x3d, 0x01, 0x80, 0x80, "Off" }, - {0x3d, 0x01, 0x80, 0x00, "On" }, - -// p2 - {0 , 0xfe, 0 , 2, "SYSTEM" }, - {0x3e, 0x01, 0x02, 0x02, "Off" }, - {0x3e, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Tilt" }, - {0x3e, 0x01, 0x08, 0x08, "Off" }, - {0x3e, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Special Test Mode Item?" }, - {0x3f, 0x01, 0x04, 0x04, "Off" }, - {0x3f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Call SW" }, - {0x3f, 0x01, 0x08, 0x08, "Off" }, - {0x3f, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x3f, 0x01, 0x10, 0x10, "Off" }, - {0x3f, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Analyzer" }, - {0x3f, 0x01, 0x20, 0x20, "Off" }, - {0x3f, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Jockeyc) - -// d_seta2.cpp -//void __fastcall setaSoundRegWriteByte(UINT32 sekAddress, UINT8 byteValue); -void __fastcall setaSoundRegWriteWord(UINT32 sekAddress, UINT16 wordValue); -//UINT8 __fastcall setaSoundRegReadByte(UINT32 sekAddress); -UINT16 __fastcall setaSoundRegReadWord(UINT32 sekAddress); - -// these should probably be moved to x1010.cpp -static UINT8 __fastcall setaSoundRegReadByte(UINT32 sekAddress) -{ - if (~sekAddress & 1) { - return x1_010_chip->HI_WORD_BUF[(sekAddress & 0x3fff) >> 1]; - } else { - return x1010_sound_read_word((sekAddress & 0x3fff) >> 1); - } -} - -static void __fastcall setaSoundRegWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - UINT32 offset = (sekAddress & 0x00003fff) >> 1; - INT32 channel, reg; - - if (~sekAddress & 1) { - x1_010_chip->HI_WORD_BUF[ offset ] = byteValue; - } else { - offset ^= x1_010_chip->address; - channel = offset / sizeof(X1_010_CHANNEL); - reg = offset % sizeof(X1_010_CHANNEL); - - if (channel < SETA_NUM_CHANNELS && reg == 0 && (x1_010_chip->reg[offset] & 1) == 0 && (byteValue&1) != 0) { - x1_010_chip->smp_offset[channel] = 0; - x1_010_chip->env_offset[channel] = 0; - } - x1_010_chip->reg[offset] = byteValue; - } -} - -static void __fastcall setaSoundRegWriteByte8bit(UINT32 sekAddress, UINT8 byteValue) -{ - UINT32 offset = (sekAddress & 0x00003fff); - INT32 channel, reg; - //bprintf(0, _T("8bit addy %X offset %X byte %X. "), x1_010_chip->address, offset, byteValue); - offset ^= x1_010_chip->address; - channel = offset / sizeof(X1_010_CHANNEL); - reg = offset % sizeof(X1_010_CHANNEL); - - if (channel < SETA_NUM_CHANNELS && reg == 0 && (x1_010_chip->reg[offset] & 1) == 0 && (byteValue&1) != 0) { - x1_010_chip->smp_offset[channel] = 0; - x1_010_chip->env_offset[channel] = 0; - } - x1_010_chip->reg[offset] = byteValue; -} - -void x1010Reset() -{ - x1_010_chip->sound_enable = 1; // enabled by default? - memset (x1_010_chip->reg, 0, 0x2000); - memset (x1_010_chip->HI_WORD_BUF, 0, 0x2000); - memset (x1_010_chip->smp_offset, 0, SETA_NUM_CHANNELS * sizeof(INT32)); - memset (x1_010_chip->env_offset, 0, SETA_NUM_CHANNELS * sizeof(INT32)); - memset (x1_010_chip->sound_banks, 0, SETA_NUM_BANKS * sizeof(INT32)); -} - -void x1010Enable(INT32 data) -{ - x1_010_chip->sound_enable = data; -} - -static void set_pcm_bank(INT32 data) -{ - INT32 new_bank = (data >> 3) & 0x07; - - if (new_bank != seta_samples_bank) - { - INT32 samples_len = DrvROMLen[3]; -// bprintf(0, _T("seta_samples_bank[%X] new_bank[%X]\n"), seta_samples_bank, new_bank); - seta_samples_bank = new_bank; - - if (samples_len == 0x240000 || samples_len == 0x1c0000 || samples_len == 0x80000) // eightfrc, blandia - { - INT32 addr = 0x40000 * new_bank; - if (new_bank >= 3) addr += 0x40000; - - if ((samples_len > 0x100000) && ((addr + 0x40000) <= samples_len)) { - memcpy(DrvSndROM + 0xc0000, DrvSndROM + addr, 0x40000); - } - } - else if (samples_len == 0x400000) // zombraid - { - if (new_bank == 0) new_bank = 1; - INT32 addr = 0x80000 * new_bank; - if (new_bank > 0) addr += 0x80000; - - memcpy (DrvSndROM + 0x80000, DrvSndROM + addr, 0x80000); - } - } -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// macros - -#define SetaVidRAMCtrlWriteWord(num, base) \ - if ((address >= (base + 0)) && address <= (base + 5)) { \ - *((UINT16*)(DrvVIDCTRLRAM##num + (address & 0x06))) = BURN_ENDIAN_SWAP_INT16(data); \ - return; \ - } - -#define SetaVidRAMCtrlWriteByte(num, base) \ - if ((address >= (base + 0)) && (address <= (base + 5))) { \ - DrvVIDCTRLRAM##num[(address & 0x07)^1] = data; \ - return; \ - } - -#define SetVidRAMRegsWriteWord(base) \ - if ((address >= (base + 0)) && (address <= (base + 5))) { \ - *((UINT16*)(DrvVideoRegs + (address & 0x06))) = BURN_ENDIAN_SWAP_INT16(data); \ - if ((address - base) == 0) x1010Enable(data & 0x20); \ - if ((address - base) == 2) set_pcm_bank(data); \ - return; \ - } - -#define SetVidRAMRegsWriteByte(base) \ - if ((address >= (base + 0)) && (address <= (base + 5))) { \ - DrvVideoRegs[(address & 0x07)^1] = data; \ - return; \ - } - -#define SetaReadDips(base) \ - if (address >= (base + 0) && address <= (base + 3)) { \ - return DrvDips[((address - base)/2)^1]; \ - } - -//----------------------------------------------------------------------------------------------------------------------------------- -// drgnunit - -UINT16 __fastcall drgnunit_read_word(UINT32 address) -{ - SetaReadDips(0x600000) - - switch (address) - { - case 0xb00000: - return DrvInputs[0]; - - case 0xb00002: - return DrvInputs[1]; - - case 0xb00004: - return DrvInputs[2]^0xff^DrvDips[2]; - } - - return 0; -} - -UINT8 __fastcall drgnunit_read_byte(UINT32 address) -{ - SetaReadDips(0x600000) - - switch (address) - { - case 0xb00000: - case 0xb00001: - return DrvInputs[0]; - - case 0xb00002: - case 0xb00003: - return DrvInputs[1]; - - case 0xb00004: - case 0xb00005: - return DrvInputs[2]^0xff^DrvDips[2]; - } - - return 0; -} - -void __fastcall drgnunit_write_word(UINT32 address, UINT16 data) -{ - SetaVidRAMCtrlWriteWord(0, 0x800000) - - SetVidRAMRegsWriteWord(0x500000) -} - -void __fastcall drgnunit_write_byte(UINT32 address, UINT8 data) -{ - SetaVidRAMCtrlWriteByte(0, 0x800000) - - SetVidRAMRegsWriteByte(0x500000) -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// thunderl, wits - -UINT16 __fastcall thunderl_read_word(UINT32 address) -{ - SetaReadDips(0x600000) - - switch (address) - { - case 0xb00000: - case 0xb00001: - return DrvInputs[0]; - - case 0xb00002: - case 0xb00003: - return DrvInputs[1]; - - case 0xb00004: - case 0xb00005: - return DrvInputs[2]^0xff^DrvDips[2]; - - case 0xb00008: - case 0xb00009: - return DrvInputs[3]; - - case 0xb0000a: - case 0xb0000b: - return DrvInputs[4]; - - case 0xb0000c: - case 0xb0000d: - return 0x00dd;// thunderl_prot - } - - return 0; -} - -UINT8 __fastcall thunderl_read_byte(UINT32 address) -{ - SetaReadDips(0x600000) - - switch (address) - { - case 0xb00000: - case 0xb00001: - return DrvInputs[0]; - - case 0xb00002: - case 0xb00003: - return DrvInputs[1]; - - case 0xb00004: - case 0xb00005: - return DrvInputs[2]^0xff^DrvDips[2]; - - case 0xb00008: - case 0xb00009: - return DrvInputs[3]; - - case 0xb0000a: - case 0xb0000b: - return DrvInputs[4]; - - case 0xb0000c: - case 0xb0000d: - return 0xdd;// thunderl_prot - } - - return 0; -} - -void __fastcall thunderl_write_word(UINT32 address, UINT16 data) -{ - SetVidRAMRegsWriteWord(0x500000) -} - -void __fastcall thunderl_write_byte(UINT32 address, UINT8 data) -{ - SetVidRAMRegsWriteByte(0x500000) -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// daioh - -UINT16 __fastcall daioh_read_word(UINT32 address) -{ - SetaReadDips(0x300000) - SetaReadDips(0x400008) - SetaReadDips(0x600000) - - switch (address) - { - case 0x400000: - return DrvInputs[0]; - - case 0x400002: - return DrvInputs[1]; - - case 0x400004: - return DrvInputs[2]^0xff^DrvDips[2]; - - case 0x40000c: - watchdog = 0; - return 0xff; - - case 0x500006: - return DrvInputs[3]; - } - - return 0; -} - -UINT8 __fastcall daioh_read_byte(UINT32 address) -{ - SetaReadDips(0x300000) - SetaReadDips(0x400008) - SetaReadDips(0x600000) - - switch (address) - { - case 0x400000: - case 0x400001: - return DrvInputs[0]; - - case 0x400002: - case 0x400003: - return DrvInputs[1]; - - case 0x400004: - case 0x400005: - return DrvInputs[2]^0xff^DrvDips[2]; - - case 0x40000c: - case 0x40000d: - watchdog = 0; - return 0xff; - - case 0x500006: - case 0x500007: - return DrvInputs[3]; - } - - return 0; -} - -void __fastcall daioh_write_word(UINT32 address, UINT16 data) -{ - SetVidRAMRegsWriteWord(0x500000) - - SetaVidRAMCtrlWriteWord(0, 0x900000) // blandiap - if (!daiohc) { - SetaVidRAMCtrlWriteWord(0, 0x908000) // jjsquawkb - SetaVidRAMCtrlWriteWord(0, 0xa00000) // blandia - } - - SetaVidRAMCtrlWriteWord(1, 0x980000) // blandiap - if (!daiohc) { - SetaVidRAMCtrlWriteWord(1, 0x909000) // jjsquawkb - SetaVidRAMCtrlWriteWord(1, 0xa80000) // blandia - } - - switch (address) - { - case 0x400000: - case 0x40000c: - watchdog = 0; - return; - } -} - -void __fastcall daioh_write_byte(UINT32 address, UINT8 data) -{ - SetVidRAMRegsWriteByte(0x500000) - - SetaVidRAMCtrlWriteByte(0, 0x900000) // blandiap - if (!daiohc) { - SetaVidRAMCtrlWriteByte(0, 0x908000) // jjsquawkb - SetaVidRAMCtrlWriteByte(0, 0xa00000) // blandia - } - - SetaVidRAMCtrlWriteByte(1, 0x980000) // blandiap - if (!daiohc) { - SetaVidRAMCtrlWriteByte(1, 0x909000) // jjsquawkb - SetaVidRAMCtrlWriteByte(1, 0xa80000) // blandia - } - - switch (address) - { - case 0x400000: - case 0x400001: - case 0x40000c: - case 0x40000d: - watchdog = 0; - return; - } -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// msgundam - -void __fastcall msgundam_write_word(UINT32 address, UINT16 data) -{ - SetaVidRAMCtrlWriteWord(0, 0xb00000) - SetaVidRAMCtrlWriteWord(1, 0xb80000) - - switch (address) - { - case 0x500000: - case 0x500001: - *((UINT16*)(DrvVideoRegs + 0)) = data; - return; - case 0x500002: - case 0x500003: - *((UINT16*)(DrvVideoRegs + 4)) = data; - return; - - case 0x500004: - case 0x500005: - *((UINT16*)(DrvVideoRegs + 2)) = data; - return; - } -} - -void __fastcall msgundam_write_byte(UINT32 address, UINT8 data) -{ - SetaVidRAMCtrlWriteByte(0, 0xb00000) - SetaVidRAMCtrlWriteByte(1, 0xb80000) - - switch (address) - { - case 0x500000: - case 0x500001: - DrvVideoRegs[(~address & 0x01) | 0] = data; - return; - - case 0x500002: - case 0x500003: - DrvVideoRegs[(~address & 0x01) | 4] = data; - return; - - case 0x500004: - case 0x500005: - DrvVideoRegs[(~address & 0x01) | 2] = data; - // seta_vregs_w - return; - } -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// kamenrid - -UINT16 __fastcall kamenrid_read_word(UINT32 address) -{ - SetaReadDips(0x500004) - - switch (address) - { - case 0x500000: - return DrvInputs[0]; - - case 0x500002: - return DrvInputs[1]; - - case 0x500008: - return DrvInputs[2]^0xff^DrvDips[2]; - - case 0x50000c: - return 0xffff; // watchdog - } - - return 0; -} - -UINT8 __fastcall kamenrid_read_byte(UINT32 address) -{ - SetaReadDips(0x500004) - - switch (address) - { - case 0x500000: - case 0x500001: - return DrvInputs[0]; - - case 0x500002: - case 0x500003: - return DrvInputs[1]; - - case 0x500008: - case 0x500009: - return DrvInputs[2]^0xff^DrvDips[2]; - - case 0x50000c: - case 0x50000d: - return 0xff; // watchdog - } - - return 0; -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// krzybowl, madshark - -static UINT32 scalerange_skns(UINT32 x, UINT32 in_min, UINT32 in_max, UINT32 out_min, UINT32 out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -static UINT16 ananice(INT16 anaval) -{ - if (anaval > 1024) anaval = 1024; - if (anaval < -1024) anaval = -1024; // clamp huge values so don't overflow INT8 conversion - UINT8 Temp = 0x7f - (anaval >> 4); // convert to INT8, but store in UINT8 - if (Temp < 0x01) Temp = 0x01; - if (Temp > 0xfe) Temp = 0xfe; - UINT16 pad = scalerange_skns(Temp, 0x3f, 0xc0, 0x01, 0xff); - if (pad > 0xff) pad = 0xff; - if (pad > 0x75 && pad < 0x85) pad = 0x7f; // dead zone - return pad; -} - -static void trackball_input_tick() // krzybowl, usclssic -{ - INT32 padx = ananice(DrvAnalogPort0) - 0x7f; - - if (usclssic) { - padx /= 16; - track_x -= padx; - if (padx) track_x_last = padx; - if (!padx) { - //if (nCurrentFrame & 4) track_x_last /= 4; // deceleration code, save for later - //track_x += track_x_last; - //if (track_x_last == 0) track_x = 0; - track_x = 0; track_x_last = 0; // PORT_RESET - } - } else { // krzybowl - track_x += padx; - } - - INT32 pady = ananice(DrvAnalogPort1) - 0x7f; - - if (usclssic) { - pady /= 16; - track_y -= pady; - if (pady) track_y_last = pady; - if (!pady) { - //if (nCurrentFrame & 4) track_y_last /= 4; - //track_y += track_y_last; - //if (track_y_last == 0) track_y = 0; - track_y = 0; track_y_last = 0; // PORT_RESET - } - } else { // krzybowl - track_y += pady; - } -} - -static UINT16 krzybowl_input_read(INT32 offset) -{ - INT32 dir1x = track_x & 0xfff; - INT32 dir1y = track_y & 0xfff; - INT32 dir2x = 0x800; - INT32 dir2y = 0x800; - - switch (offset / 2) - { - case 0x0/2: return dir1x & 0xff; - case 0x2/2: return dir1x >> 8; - case 0x4/2: return dir1y & 0xff; - case 0x6/2: return dir1y >> 8; - case 0x8/2: return dir2x & 0xff; - case 0xa/2: return dir2x >> 8; - case 0xc/2: return dir2y & 0xff; - case 0xe/2: return dir2y >> 8; - } - - return 0; -} - -UINT16 __fastcall madshark_read_word(UINT32 address) -{ - SetaReadDips(0x300000) - SetaReadDips(0x500008) - - switch (address) - { - case 0x500000: - return DrvInputs[0]; - - case 0x500002: - return DrvInputs[1]; - - case 0x500004: - return DrvInputs[2]^0xff^DrvDips[2]; - - case 0x50000c: - watchdog = 0; - return 0xffff; - } - - if ((address & ~0x00000f) == 0x600000) { - return krzybowl_input_read(address&0xf); - } - - return 0; -} - -UINT8 __fastcall madshark_read_byte(UINT32 address) -{ - SetaReadDips(0x300000) - SetaReadDips(0x500008) - - switch (address) - { - case 0x500000: - return DrvInputs[0] >> 8; - case 0x500001: - return DrvInputs[0] & 0xff; - - case 0x500002: - return DrvInputs[1] >> 8; - case 0x500003: - return DrvInputs[1] & 0xff; - - case 0x500004: - case 0x500005: - return DrvInputs[2]^0xff^DrvDips[2]; - - case 0x50000c: - case 0x50000d: - watchdog = 0; - return 0xff; - } - - if ((address & ~0x00000f) == 0x600000) { - return krzybowl_input_read(address&0xf); - } - - return 0; -} - -void __fastcall madshark_write_word(UINT32 address, UINT16 data) -{ - SetVidRAMRegsWriteWord(0x600000) - SetaVidRAMCtrlWriteWord(0, 0x900000) - SetaVidRAMCtrlWriteWord(1, 0x980000) - - switch (address) - { - case 0x50000c: - watchdog = 0; - return; - } -} - -void __fastcall madshark_write_byte(UINT32 address, UINT8 data) -{ - SetVidRAMRegsWriteByte(0x600000) - SetaVidRAMCtrlWriteByte(0, 0x900000) - SetaVidRAMCtrlWriteByte(1, 0x980000) - - switch (address) - { - case 0x50000c: - case 0x50000d: - watchdog = 0; - return; - } -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// keroppi, pairlove - -static INT32 keroppi_prize_hop = 0; -static INT32 keroppi_protection_count = 0; -static INT32 keroppi_timer_frame = -1; -static const UINT16 keroppi_protection_word[] = { - 0x0000, - 0x0000, 0x0000, 0x0000, - 0x2000, 0x2000, 0x2000, - 0x2000, 0x2000, 0x2000, - 0x0400, 0x0400, 0x0400, - 0x0000, 0x0000, 0x0000 -}; - -static UINT16 pairslove_protram[0x100]; -static UINT16 pairslove_protram_old[0x100]; - -UINT16 __fastcall pairlove_read_word(UINT32 address) -{ - SetaReadDips(0x300000) - - switch (address) - { - case 0x100000: { // keroppi - INT32 res = keroppi_protection_word[keroppi_protection_count]; - keroppi_protection_count++; - if (keroppi_protection_count > 15) keroppi_protection_count = 15; - return res; - } - - case 0x200000: // keroppi - keroppi_protection_count = 0; - return 0x00; - - case 0x500000: - return DrvInputs[0]; - - case 0x500002: - return DrvInputs[1]; - - case 0x500004: { - INT32 res = DrvInputs[2]^0xff^DrvDips[2]; - - if (keroppi_prize_hop == 1 && keroppi_timer_frame != -1) { - if ((GetCurrentFrame() - keroppi_timer_frame) >= 3) { - keroppi_prize_hop = 2; - keroppi_timer_frame = - 1; - } - } - - if (keroppi_prize_hop == 2) { - res &= ~0x0002; - keroppi_prize_hop = 0; - } - return res; - } - } - - if ((address & 0xfffffe00) == 0x900000) { - INT32 offset = (address & 0x1ff) / 2; - - INT32 retdata = pairslove_protram[offset]; - pairslove_protram[offset]=pairslove_protram_old[offset]; - return retdata; - } - - return 0; -} - -UINT8 __fastcall pairlove_read_byte(UINT32 address) -{ - SetaReadDips(0x300000) - - switch (address) - { - case 0x100000: // keroppi - case 0x100001: { - INT32 res = keroppi_protection_word[keroppi_protection_count]; - keroppi_protection_count++; - if (keroppi_protection_count > 15) keroppi_protection_count = 15; - return res; - } - - case 0x200000: - case 0x200001: // keroppi - keroppi_protection_count = 0; - return 0x00; - - case 0x500000: - case 0x500001: - return DrvInputs[0]; - - case 0x500002: - case 0x500003: - return DrvInputs[1]; - - case 0x500004: - case 0x500005: { - INT32 res = DrvInputs[2]^0xff^DrvDips[2]; - - if (keroppi_prize_hop == 1 && keroppi_timer_frame != -1) { - if ((GetCurrentFrame() - keroppi_timer_frame) >= 3) { - keroppi_prize_hop = 2; - keroppi_timer_frame = -1; - } - } - - if (keroppi_prize_hop == 2) { - res &= ~0x0002; - keroppi_prize_hop = 0; - } - return res; - } - } - - if ((address & 0xfffffe00) == 0x900000) { - INT32 offset = (address & 0x1ff) / 2; - INT32 retdata = pairslove_protram[offset]; - pairslove_protram[offset]=pairslove_protram_old[offset]; - return retdata; - } - - return 0; -} - -void __fastcall pairlove_write_word(UINT32 address, UINT16 data) -{ - SetVidRAMRegsWriteWord(0x400000) - - switch (address) - { - case 0x900002: // keroppi - if ((data & 0x0010) && !keroppi_prize_hop) { - keroppi_prize_hop = 1; - keroppi_timer_frame = GetCurrentFrame(); - } - break; // for pairslove prot - } - - if ((address & 0xfffffe00) == 0x900000) { - INT32 offset = (address & 0x1ff) / 2; - pairslove_protram_old[offset]=pairslove_protram[offset]; - pairslove_protram[offset]=data; - return; - } -} - -void __fastcall pairlove_write_byte(UINT32 address, UINT8 data) -{ - SetVidRAMRegsWriteByte(0x400000) - - switch (address) - { - case 0x900002: - case 0x900003: // keroppi - if ((data & 0x0010) && !keroppi_prize_hop) { - keroppi_prize_hop = 1; - keroppi_timer_frame = GetCurrentFrame(); - } - break; // for pairslove prot - } - - if ((address & 0xfffffe00) == 0x900000) { - INT32 offset = (address & 0x1ff) / 2; - pairslove_protram_old[offset]=pairslove_protram[offset]; - pairslove_protram[offset]=data; - return; - } -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// downtown, metafox, twineagl, arbelester - -void __fastcall downtown_write_word(UINT32 address, UINT16 data) -{ - SetaVidRAMCtrlWriteWord(0, 0x800000) - - switch (address) - { - case 0x400000: - case 0x400002: - case 0x400004: - case 0x400006: - // tilebank[(address & 6) / 2] = data; - return; - - case 0xa00000: - case 0xa00002: - case 0xa00004: - case 0xa00006: bprintf(0, _T("sub ctrlW unimpl. %X\n"), address); - // sub_ctrl_w - return; - } -} - -static void sub_ctrl_w(INT32 offset, UINT8 data) -{ - switch(offset) - { - case 0: // bit 0: reset sub cpu? - { - if ( !(sub_ctrl_data & 1) && (data & 1) ) - { - M6502Open(0); - M6502Reset(); - M6502Close(); - } - sub_ctrl_data = data; - } - break; - - case 2: // ? - break; - - case 4: // not sure - soundlatch = data; - break; - - case 6: // not sure - soundlatch2 = data; - break; - } -} - -void __fastcall downtown_write_byte(UINT32 address, UINT8 data) -{ - SetaVidRAMCtrlWriteByte(0, 0x800000) - - switch (address) - { - case 0x400000: - case 0x400001: - case 0x400002: - case 0x400003: - case 0x400004: - case 0x400005: - case 0x400006: - case 0x400007: - tilebank[(address & 6) / 2] = data; - return; - - case 0xa00000: - case 0xa00001: - case 0xa00002: - case 0xa00003: - case 0xa00004: - case 0xa00005: - case 0xa00006: - case 0xa00007: - sub_ctrl_w((address&6), data); - return; - } -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// kiwame - -static INT32 kiwame_inputs_read(INT32 offset) -{ - INT32 i; - INT32 row_select = DrvNVRAM[0x10b]; - - for (i = 0; i < 5; i++) - if (row_select & (1 << i)) break; - - switch (offset) - { - case 0: return DrvInputs[i+1]; - case 4: return DrvInputs[0]^0xff^DrvDips[2]; - case 2: - case 8: return 0xffff; - } - - return 0; -} - -UINT16 __fastcall kiwame_read_word(UINT32 address) -{ - switch (address) - { - case 0xe00000: - return DrvDips[1]; - - case 0xe00002: - return DrvDips[0]; - } - - if ((address & 0xfffff0) == 0xd00000) { - return kiwame_inputs_read(address & 0x0e); - } - if ((address & 0xfffc00) == 0xfffc00) { - return DrvNVRAM[(address & 0x3fe)]; - } - - return 0; -} - -UINT8 __fastcall kiwame_read_byte(UINT32 address) -{ - switch (address) - { - case 0xe00000: - case 0xe00001: - return DrvDips[1]; - - case 0xe00002: - case 0xe00003: - return DrvDips[0]; - } - - if ((address & 0xfffff0) == 0xd00000) { - return kiwame_inputs_read(address & 0x0e); - } - - if ((address & 0xfffc01) == 0xfffc01) { - return DrvNVRAM[(address & 0x3fe)]; - } - - return 0; -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// zombraid gun handler - -static INT32 zombraid_gun_read() -{ - return (DrvAnalogInput[gun_input_src] >> gun_input_bit) & 1; -} - -static void zombraid_gun_write(INT32 data) -{ - static INT32 bit_count = 0, old_clock = 0; - - if(data&4) { bit_count = 0; return; } // Reset - - if((data&1) == old_clock) return; // No change - - if (old_clock == 0) // Rising edge - { - switch (bit_count) - { - case 0: - case 1: // Starting sequence 2,3,2,3. Other inputs? - break; - - case 2: // First bit of source - gun_input_src = (gun_input_src&2) | (data>>1); - break; - - case 3: // Second bit of source - gun_input_src = (gun_input_src&1) | (data&2); - break; - - default: - // "Player1_Gun_Recoil", (data & 0x10)>>4 - // "Player2_Gun_Recoil", (data & 0x08)>>3 - gun_input_bit = bit_count - 4; - gun_input_bit = 8 - gun_input_bit; // Reverse order - break; - } - bit_count++; - } - - old_clock = data & 1; -} - -void __fastcall zombraid_gun_write_word(UINT32 address, UINT16 data) -{ - if ((address & ~1) == 0xf00000) zombraid_gun_write(data); -} - -void __fastcall zombraid_gun_write_byte(UINT32 address, UINT8 data) -{ - if ((address & ~1) == 0xf00000) zombraid_gun_write(data); -} - -UINT16 __fastcall zombraid_gun_read_word(UINT32 ) -{ - return zombraid_gun_read(); -} - -UINT8 __fastcall zombraid_gun_read_byte(UINT32 ) -{ - return zombraid_gun_read(); -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// utoukond sound handler - -void __fastcall utoukond_sound_write(UINT16 address, UINT8 data) -{ - if (address >= 0xf000) { // x1_010 - setaSoundRegWriteByte8bit(address & 0xfff, data); - return; - } -} - -UINT8 __fastcall utoukond_sound_read(UINT16 address) -{ - if (address >= 0xf000) { - return x1010_sound_read(address & 0xfff); - } - return 0; -} - -void __fastcall utoukond_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - BurnYM3438Write(0, port & 3, data); - return; - } -} - -UINT8 __fastcall utoukond_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - return BurnYM3438Read(0, port & 3);// right? - - case 0xc0: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// wiggie / superbar sound handler - -void __fastcall wiggie_sound_write_word(UINT32 a, UINT16 d) -{ - bprintf(0, _T("sww %X:%X."),a,d); - -} - -void __fastcall wiggie_sound_write_byte(UINT32 address, UINT8 data) -{ - soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); -} - -void __fastcall wiggie_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall wiggie_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// usclssic - -void __fastcall usclssic_write_word(UINT32 address, UINT16 data) -{ - SetaVidRAMCtrlWriteWord(0, 0xa00000) - - switch (address) - { - case 0xb40000: - usclssic_port_select = (data & 0x40) >> 6; - tile_offset[0] = (data & 0x10) << 10; - // coin lockout too... - return; - - case 0xb40010: - soundlatch = data; - - M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - SekRunEnd(); - return; - - case 0xb40018: - watchdog = 0; - return; - } -} - -void __fastcall usclssic_write_byte(UINT32 address, UINT8 data) -{ - SetaVidRAMCtrlWriteByte(0, 0xa00000) - - switch (address) - { - case 0xb40000: - case 0xb40001: - usclssic_port_select = (data & 0x40) >> 6; - tile_offset[0] = (data & 0x10) << 10; - // coin lockout too... - return; - - //case 0xb40010: - case 0xb40011: - soundlatch = data; - M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - SekRunEnd(); - return; - - case 0xb40018: - case 0xb40019: - watchdog = 0; - return; - } -} - -static UINT8 uclssic_trackball_read(INT32 offset) -{ - UINT16 start_vals[2] = { 0xf000, 0x9000 }; - start_vals[0] |= track_x&0xfff; - start_vals[1] |= track_y&0xfff; - - UINT16 ret = DrvInputs[1 + ((offset & 4)/4) + (usclssic_port_select * 2)] ^ start_vals[(offset / 4) & 1]; - - if (offset & 2) ret >>= 8; - - return ret ^ 0xff; -} - -UINT16 __fastcall usclssic_read_word(UINT32 address) -{ - switch (address) - { - case 0xb40000: - case 0xb40002: - case 0xb40004: - case 0xb40006: - return uclssic_trackball_read(address); - - case 0xb40010: - return (DrvInputs[0] ^ 0xf0) | 0x0f; - - case 0xb40018: - return DrvDips[1] & 0x0f; - - case 0xb4001a: - return DrvDips[1] >> 4; - - case 0xb4001c: - return DrvDips[0] & 0x0f; - - case 0xb4001e: - return DrvDips[0] >> 4; - } - - return 0; -} - -UINT8 __fastcall usclssic_read_byte(UINT32 address) -{ - switch (address) - { - case 0xb40000: - case 0xb40001: - case 0xb40002: - case 0xb40003: - case 0xb40004: - case 0xb40005: - case 0xb40006: - case 0xb40007: - return uclssic_trackball_read(address); - - //case 0xb40010: - case 0xb40011: - return (DrvInputs[0] ^ 0xf0) | 0x0f; - - case 0xb40018: - case 0xb40019: - return DrvDips[1] & 0x0f; - - case 0xb4001a: - case 0xb4001b: - return DrvDips[1] >> 4; - - case 0xb4001c: - case 0xb4001d: - return DrvDips[0] & 0x0f; - - case 0xb4001e: - case 0xb4001f: - return DrvDips[0] >> 4; - } - - return 0; -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// calibr50 - -// Rotation-handler code - -static void RotateReset() { - for (INT32 playernum = 0; playernum < 2; playernum++) { - nRotate[playernum] = 0; // start out pointing straight up (0=up) - nRotateTarget[playernum] = -1; - nRotateTime[playernum] = 0; - nRotateHoldInput[0] = nRotateHoldInput[1] = 0; - } -} - -static UINT32 RotationTimer(void) { - return nCurrentFrame; -} - -static void RotateRight(INT32 *v) { - if (game_rotates == 2) { // downtown mode - (*v)-=1; - if (*v < 0) *v = 0xb; - } else { // calibr50 mode - (*v)-=4; - if (*v < 0) *v = 0x3c; - } -} - -static void RotateLeft(INT32 *v) { - if (game_rotates == 2) { // downtown mode - (*v)+=1; - if (*v > 0xb) *v = 0; - } else { // calibr50 mode - (*v)+=4; - if (*v > 0x3c) *v = 0; - } -} - -static UINT8 Joy2Rotate(UINT8 *joy) { // ugly code, but the effect is awesome. -dink - if (joy[0] && joy[2]) return 7; // up left - if (joy[0] && joy[3]) return 1; // up right - - if (joy[1] && joy[2]) return 5; // down left - if (joy[1] && joy[3]) return 3; // down right - - if (joy[0]) return 0; // up - if (joy[1]) return 4; // down - if (joy[2]) return 6; // left - if (joy[3]) return 2; // right - - return 0xff; -} - -static int dialRotation(INT32 playernum) { - // p1 = 0, p2 = 1 - UINT8 player[2] = { 0, 0 }; - static UINT8 lastplayer[2][2] = { { 0, 0 }, { 0, 0 } }; - - if ((playernum != 0) && (playernum != 1)) { - bprintf(PRINT_NORMAL, _T("Strange Rotation address => %06X\n"), playernum); - return 0; - } - if (playernum == 0) { - player[0] = DrvFakeInput[0]; player[1] = DrvFakeInput[1]; - } - if (playernum == 1) { - player[0] = DrvFakeInput[2]; player[1] = DrvFakeInput[3]; - } - - if (player[0] && (player[0] != lastplayer[playernum][0] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateLeft(&nRotate[playernum]); - bprintf(PRINT_NORMAL, _T("Player %d Rotate Left => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - if (player[1] && (player[1] != lastplayer[playernum][1] || (RotationTimer() > nRotateTime[playernum]+0xf))) { - RotateRight(&nRotate[playernum]); - bprintf(PRINT_NORMAL, _T("Player %d Rotate Right => %06X\n"), playernum+1, nRotate[playernum]); - nRotateTime[playernum] = RotationTimer(); - nRotateTarget[playernum] = -1; - } - - lastplayer[playernum][0] = player[0]; - lastplayer[playernum][1] = player[1]; - - return (nRotate[playernum]); -} - -static UINT8 *rotate_gunpos[2] = {NULL, NULL}; -static UINT8 rotate_gunpos_multiplier = 1; - -// Gun-rotation memory locations - do not remove this tag. - dink :) -// game p1 p2 clockwise value in memory multiplier -// downtown 0xffef90+1 0xfefd0+1 0 1 2 3 4 5 6 7 1 -// -// calibr50 0xff2500+3 0xff2520+7 0 1 2 3 4 5 6 7 8 9 a b c d e f 2 -// ff4ede = 0xff = onplane -// a00010 a00014 = plane rotate regs MMIO INPUTS DUMBASS -// p1 ff0e69 p2 ff0e89? rotate reg. - -static void RotateSetGunPosRAM(UINT8 *p1, UINT8 *p2, UINT8 multiplier) { - rotate_gunpos[0] = p1; - rotate_gunpos[1] = p2; - rotate_gunpos_multiplier = multiplier; -} - -static INT32 get_distance(INT32 from, INT32 to) { -// this function finds the shortest way to get from "from" to "to", wrapping at 0 and 7 - INT32 countA = 0; - INT32 countB = 0; - INT32 fromtmp = from;// / rotate_gunpos_multiplier; - INT32 totmp = to;// / rotate_gunpos_multiplier; - - while (1) { - fromtmp++; - countA++; - if(fromtmp>((game_rotates == 2) ? 0x7 : 0xf)) fromtmp = 0; - if(fromtmp == totmp || countA > 32) break; - } - - fromtmp = from;// / rotate_gunpos_multiplier; - totmp = to;// / rotate_gunpos_multiplier; - - while (1) { - fromtmp--; - countB++; - if(fromtmp<0) fromtmp = ((game_rotates == 2) ? 0x7 : 0xf); - if(fromtmp == totmp || countB > 32) break; - } - - if (countA > countB) { - return 1; // go negative - } else { - return 0; // go positive - } -} - -static void RotateDoTick() { - // since the game only allows for 1 rotation every other frame, we have to - // do this. - if (nCurrentFrame&1) return; - - if (game_rotates == 1) { // calibr50 switcheroo - if (Drv68KRAM[0x4ede] == 0xff) { - // P1/P2 in the airplane - RotateSetGunPosRAM(Drv68KRAM + (0x0e69-1), Drv68KRAM + (0x0e89-1), 2); - } else { - // P1/P2 normal. - RotateSetGunPosRAM(Drv68KRAM + (0x2503-1), Drv68KRAM + (0x2527-1), 2); - } - } - - for (INT32 i = 0; i < 2; i++) { - if (rotate_gunpos[i] && (nRotateTarget[i] != -1) && (nRotateTarget[i] != (*rotate_gunpos[i] & 0xff))) { - if (get_distance(nRotateTarget[i], *rotate_gunpos[i] & 0x0f)) { - RotateLeft(&nRotate[i]); // ++ - } else { - RotateRight(&nRotate[i]); // -- - } - bprintf(0, _T("p%X target %X mempos %X nRotate %X try %X.\n"), i, nRotateTarget[0], *rotate_gunpos[0] & 0xff, nRotate[0], nRotateTry[i]); - nRotateTry[i]++; - if (nRotateTry[i] > 0xf) nRotateTarget[i] = -1; // don't get stuck in a loop if something goes horribly wrong here. - } else { - nRotateTarget[i] = -1; - } - } -} - -static void SuperJoy2Rotate() { - for (INT32 i = 0; i < 2; i++) { // p1 = 0, p2 = 1 - if (DrvFakeInput[4 + i]) { // rotate-button had been pressed - UINT8 rot = Joy2Rotate(((!i) ? &DrvJoy1[0] : &DrvJoy2[0])); - if (rot != 0xff) { - //bprintf(0, _T("joy2rotate[%x] = %X\n"), i, rot); - nRotateTarget[i] = rot * rotate_gunpos_multiplier; - } - //DrvInput[i] &= ~0xf; // cancel out directionals since they are used to rotate here. - DrvInputs[i] = (DrvInputs[i] & ~0xf) | (nRotateHoldInput[i] & 0xf); // for midnight resistance! be able to duck + change direction of gun. - nRotateTry[i] = 0; - } else { // cache joystick UDLR if the rotate button isn't pressed. - // This feature is for Midnight Resistance, if you are crawling on the - // ground and need to rotate your gun WITHOUT getting up. - nRotateHoldInput[i] = DrvInputs[i]; - } - } - - RotateDoTick(); -} - -// end Rotation-handler - -static UINT16 calibr50_input_read(INT32 offset) -{ - INT32 dir1 = dialRotation(0); // analog port - INT32 dir2 = dialRotation(1); // analog port - - switch (offset & 0x1e) - { - case 0x00: return DrvInputs[0]; // p1 - case 0x02: return DrvInputs[1]; // p2 - case 0x08: return DrvInputs[2]^0xff^DrvDips[2]; // Coins - case 0x10: return (dir1 & 0xff); // lower 8 bits of p1 rotation - case 0x12: return (dir1 >> 8); // upper 4 bits of p1 rotation - case 0x14: return (dir2 & 0xff); // lower 8 bits of p2 rotation - case 0x16: return (dir2 >> 8); // upper 4 bits of p2 rotation - case 0x18: return 0xffff; // ? (value's read but not used) - } - - return 0; -} - -UINT16 __fastcall calibr50_read_word(UINT32 address) -{ - switch (address) - { - case 0x400000: - case 0x400001: - watchdog = 0; - return 0xffff; - } - - if ((address & 0xfffffe0) == 0xa00000) { - return calibr50_input_read(address); - } - - SetaReadDips(0x600000) - - return 0; -} - -UINT8 __fastcall calibr50_read_byte(UINT32 address) -{ - switch (address) - { - case 0x400000: - case 0x400001: - watchdog = 0; - return 0xff; - - case 0xb00000: - case 0xb00001: - return soundlatch2; - } - - if ((address & 0xfffffe0) == 0xa00000) { - return calibr50_input_read(address) >> ((~address & 1) << 3); - } - - SetaReadDips(0x600000) - - return 0; -} - -void __fastcall calibr50_write_word(UINT32 address, UINT16 data) -{ - SetaVidRAMCtrlWriteWord(0, 0x800000) - - if ((address & ~1) == 0xb00000) { - soundlatch = data; - - M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - SekRunEnd(); - - return; - } - //bprintf(0, _T("ww: %X."), address); -} - -void __fastcall calibr50_write_byte(UINT32 address, UINT8 data) -{ - SetaVidRAMCtrlWriteByte(0, 0x800000) - - if ((address & ~1) == 0xb00000) { - soundlatch = data; - - M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - SekRunEnd(); - - return; - } - //bprintf(0, _T("wb: %X."), address); -} - -//----------------------------------------------------------------------------------------------------------------------------------- -// downtown protection handler, m65c02 simulation (metafox, arbelester) - -static UINT8 *downtown_protram; - -UINT8 __fastcall downtown_prot_read(UINT32 address) -{ - if (downtown_protram[0xf8] == 0xa3) { - if (address >= 0x200100 && address <= 0x20010b) { - char *waltz = "WALTZ0"; - return waltz[(address & 0x0f) / 2]; - } else { - return 0; - } - } - - return downtown_protram[(address & 0x1ff)^1]; -} - -// twineagle, downtown, calibr50, tndrcade, arbalester, metafox etc. uses these below - -UINT8 __fastcall twineagl_sharedram_read_byte(UINT32 address) -{ - return DrvShareRAM[(address&0xfff)>>1]; -} - -UINT16 __fastcall twineagl_sharedram_read_word(UINT32 address) -{ - return DrvShareRAM[(address&0xfff)>>1]&0xff; -} - -void __fastcall twineagl_sharedram_write_word(UINT32 address, UINT16 data) -{ - DrvShareRAM[(address&0xfff)>>1] = data&0xff; -} - -void __fastcall twineagl_sharedram_write_byte(UINT32 address, UINT8 data) -{ - DrvShareRAM[(address&0xfff)>>1] = data; -} - - -//----------------------------------------------------------------------------------------------------------------------------------- -// crazy fight - -UINT16 __fastcall crazyfgt_read_word(UINT32 address) -{ - switch (address) - { - case 0x610000: - case 0x610001: - return DrvInputs[0]; - - case 0x610002: - case 0x610003: - return 0xffff; - - case 0x610004: - case 0x610005: - return DrvInputs[1]; - } - - SetaReadDips(0x630000) - - return 0; -} - -UINT8 __fastcall crazyfgt_read_byte(UINT32 address) -{ - switch (address) - { - case 0x610000: - case 0x610001: - return DrvInputs[0]; - - case 0x610002: - case 0x610003: - return 0xff; - - case 0x610004: - case 0x610005: - return DrvInputs[1]; - } - - SetaReadDips(0x630000) - - return 0; -} - -void __fastcall crazyfgt_write_byte(UINT32 address, UINT8 data) -{ - SetaVidRAMCtrlWriteByte(1, 0x900000) - SetaVidRAMCtrlWriteByte(0, 0x980000) - - switch (address) - { - case 0x650000: - case 0x650001: - BurnYM3812Write(0, 0, data); - return; - - case 0x658000: - case 0x658001: - MSM6295Command(0, data); - return; - } -} - -void __fastcall crazyfgt_write_word(UINT32 address, UINT16 data) -{ - SetaVidRAMCtrlWriteWord(1, 0x900000) - SetaVidRAMCtrlWriteWord(0, 0x980000) - - switch (address) - { - case 0x650000: - case 0x650001: - BurnYM3812Write(0, 0, data); - return; - - case 0x658000: - case 0x658001: - MSM6295Command(0, data); - return; - } -} - - -//----------------------------------------------------------------------------------------------------------------------------------- -// 68k initializers - -static void drgnunit68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x900000, 0x903fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xd00000, 0xd00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xe00000, 0xe03fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xf00000, 0xf0ffff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x0010000, 0xffc000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, drgnunit_write_word); - SekSetWriteByteHandler(0, drgnunit_write_byte); - SekSetReadWordHandler(0, drgnunit_read_word); - SekSetReadByteHandler(0, drgnunit_read_byte); - - SekMapHandler(1, 0x100000, 0x103fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void daioh68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x0010000, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700400, 0x700fff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x701000, 0x70ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x880000, 0x88ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x0020000, 0xa80000, 0xa803ff, MAP_WRITE); // nop out - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb13fff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xc00000, 0xc03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void daiohp68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x0010000, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700400, 0x700fff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x701000, 0x70ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x880000, 0x88ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x0020000, 0xa80000, 0xa803ff, MAP_WRITE); // nop out - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb13fff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xc00000, 0xc03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void wrofaero68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x21ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0010000, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700400, 0x700fff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0011000, 0x701000, 0x70ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x880000, 0x88ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb13fff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xc00000, 0xc03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void msgundam68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - - for (INT32 i = 0; i < 0x80000; i+=0x10000) // mirrored - SekMapMemory(Drv68KRAM, 0x200000+i, 0x20ffff+i, MAP_RAM); - - SekMapMemory(DrvPalRAM, 0x700400, 0x700fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x800000, 0x800607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0x900000, 0x903fff, MAP_RAM); - - SekMapMemory(DrvVidRAM0, 0xa00000, 0xa0ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0xa80000, 0xa8ffff, MAP_RAM); - SekSetWriteWordHandler(0, msgundam_write_word); - SekSetWriteByteHandler(0, msgundam_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xc00000, 0xc03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void umanclub68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x300000, 0x300fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb03fff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xc00000, 0xc03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void kamenrid68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0010000, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700400, 0x700fff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0011000, 0x701000, 0x703fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x807fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x880000, 0x887fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb07fff, MAP_RAM); - SekSetWriteWordHandler(0, madshark_write_word); - SekSetWriteByteHandler(0, madshark_write_byte); - SekSetReadWordHandler(0, kamenrid_read_word); - SekSetReadByteHandler(0, kamenrid_read_byte); - - SekMapHandler(1, 0xd00000, 0xd03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - { - DrvGfxROM2 = DrvGfxROM1 + 0x80000; - DrvROMLen[2] = DrvROMLen[1] = DrvROMLen[1] / 2; - memcpy (DrvGfxROM2, DrvGfxROM1 + 0x40000, 0x40000); - } -} - -static void madshark68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0010000, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700400, 0x700fff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0011000, 0x701000, 0x703fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x807fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x880000, 0x887fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb07fff, MAP_RAM); - SekSetWriteWordHandler(0, madshark_write_word); - SekSetWriteByteHandler(0, madshark_write_byte); - SekSetReadWordHandler(0, madshark_read_word); - SekSetReadByteHandler(0, madshark_read_byte); - - SekMapHandler(1, 0xd00000, 0xd03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - { - DrvGfxROM2 = (UINT8*)BurnMalloc(0x200000); - DrvROMLen[1] = DrvROMLen[2] = 0x200000; - - memcpy (DrvGfxROM0 + 0x200000, DrvGfxROM0 + 0x000000, 0x100000); - memcpy (DrvGfxROM0 + 0x000000, DrvGfxROM0 + 0x100000, 0x200000); - - memcpy (DrvGfxROM2 + 0x000000, DrvGfxROM1 + 0x100000, 0x100000); - memcpy (DrvGfxROM2 + 0x100000, DrvGfxROM1 + 0x300000, 0x100000); - memcpy (DrvGfxROM1 + 0x100000, DrvGfxROM1 + 0x200000, 0x100000); - } -} - -static void thunderl68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x00ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x700000, 0x700fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xd00000, 0xd00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xe00000, 0xe07fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xffc000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, thunderl_write_word); - SekSetWriteByteHandler(0, thunderl_write_byte); - SekSetReadWordHandler(0, thunderl_read_word); - SekSetReadByteHandler(0, thunderl_read_byte); - - SekMapHandler(1, 0x100000, 0x103fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void atehate68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x700000, 0x700fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x900000, 0x9fffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xe00000, 0xe03fff, MAP_RAM); - SekSetWriteWordHandler(0, thunderl_write_word); - SekSetWriteByteHandler(0, thunderl_write_byte); - SekSetReadWordHandler(0, thunderl_read_word); - SekSetReadByteHandler(0, thunderl_read_byte); - - SekMapHandler(1, 0x100000, 0x103fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void blockcar68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0xb00000, 0xb00fff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xc00000, 0xc03fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xe00000, 0xe00607 | 0x7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xf00000, 0xf05fff, MAP_RAM); - SekSetWriteWordHandler(0, thunderl_write_word); - SekSetWriteByteHandler(0, thunderl_write_byte); - SekSetReadWordHandler(0, madshark_read_word); - SekSetReadByteHandler(0, madshark_read_byte); - - SekMapHandler(1, 0xa00000, 0xa03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - memcpy (DrvSndROM + 0x80000, DrvSndROM, 0x80000); -} - -static void zombraid68kInit() -{ - wrofaero68kInit(); - - SekOpen(0); - SekMapHandler(2, 0xf00000, 0xf00003, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (2, zombraid_gun_read_word); - SekSetReadByteHandler (2, zombraid_gun_read_byte); - SekSetWriteWordHandler(2, zombraid_gun_write_word); - SekSetWriteByteHandler(2, zombraid_gun_write_byte); - SekClose(); - - memcpy (DrvSndROM + 0x100000, DrvSndROM + 0x080000, 0x280000); -} - -static void BlandiaGfxRearrange() -{ - INT32 rom_size = DrvROMLen[1]; - UINT8 *buf = (UINT8*)BurnMalloc(rom_size); - - UINT8 *rom = DrvGfxROM1 + 0x40000; - - if (rom_size == 0x100000) memcpy (rom, rom + 0x40000, 0x80000); // blandia - - for (INT32 rpos = 0; rpos < 0x80000/2; rpos++) { - buf[rpos+0x40000] = rom[rpos*2]; - buf[rpos] = rom[rpos*2+1]; - } - - memcpy (rom, buf, 0x80000); - - rom = DrvGfxROM2 + 0x40000; - - if (rom_size == 0x100000) memcpy (rom, rom + 0x40000, 0x80000); // blandia - - for (INT32 rpos = 0; rpos < 0x80000/2; rpos++) { - buf[rpos+0x40000] = rom[rpos*2]; - buf[rpos] = rom[rpos*2+1]; - } - - memcpy (rom, buf, 0x80000); - - DrvROMLen[1] = DrvROMLen[2] = 0xc0000; - - BurnFree (buf); -} - -static void blandia68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x21ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0010000, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700400, 0x700fff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0011000, 0x701000, 0x70ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x800000, 0x800607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0x900000, 0x903fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0xb00000, 0xb0ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0xb80000, 0xb8ffff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xc00000, 0xc03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - memmove (Drv68KROM + 0x100000, Drv68KROM + 0x080000, 0x100000); - memmove (DrvSndROM + 0x100000, DrvSndROM + 0x0c0000, 0x0c0000); - - BlandiaGfxRearrange(); -} - -static void blandiap68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x21ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0010000, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700400, 0x700fff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0011000, 0x701000, 0x70ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x880000, 0x88ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(Drv68KRAM + 0x0020000, 0xa80000, 0xa803ff, MAP_WRITE); //nop - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb03fff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xc00000, 0xc03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - memmove (Drv68KROM + 0x100000, Drv68KROM + 0x080000, 0x100000); - - // set up sound banks... - { - UINT8 *tmp = (UINT8*)BurnMalloc(0x240000); - - INT32 offsets[16] = { - 0x000000, 0x140000, 0x020000, 0x160000, - 0x040000, 0x180000, 0x060000, 0x1a0000, - 0x080000, 0x1c0000, 0x0a0000, 0x1e0000, - 0x100000, 0x200000, 0x120000, 0x220000 - }; - - for (INT32 i = 0; i < 16; i++) { - memcpy (tmp + offsets[i], DrvSndROM + (i * 0x020000), 0x020000); - } - - memcpy (DrvSndROM, tmp, 0x240000); - - BurnFree (tmp); - } -} - -static void oisipuzl68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x803fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x880000, 0x883fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb03fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xc00400, 0xc00fff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0x700000, 0x703fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void pairlove68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvNVRAM, 0x800000, 0x8001ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xb00000, 0xb00fff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xc00000, 0xc03fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xe00000, 0xe00607 | 0x7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xf00000, 0xf0ffff, MAP_RAM); - SekSetWriteWordHandler(0, pairlove_write_word); - SekSetWriteByteHandler(0, pairlove_write_byte); - SekSetReadWordHandler(0, pairlove_read_word); - SekSetReadByteHandler(0, pairlove_read_byte); - - SekMapHandler(1, 0xa00000, 0xa03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -static void jjsquawkb68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x21ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x0010000, 0x700000, 0x70b3ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x70b400, 0x70bfff, MAP_RAM); - SekMapMemory(Drv68KRAM2 + 0x001c000, 0x70c000, 0x70ffff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x803fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x804000, 0x807fff, MAP_RAM); - SekMapMemory(DrvVidRAM1 + 0x4000, 0x884000, 0x88ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa0a000, 0xa0a607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xb0c000, 0xb0ffff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xc00000, 0xc03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - BurnLoadRom(Drv68KROM + 0x0000000, 0, 1); - BurnLoadRom(Drv68KROM + 0x0100000, 1, 1); - - DrvGfxROM2 = DrvGfxROM1 + 0x400000; - DrvROMLen[1] = DrvROMLen[2] = 0x200000; - - memcpy (DrvGfxROM2 + 0x000000, DrvGfxROM1 + 0x100000, 0x100000); - memcpy (DrvGfxROM2 + 0x100000, DrvGfxROM1 + 0x300000, 0x100000); - memcpy (DrvGfxROM1 + 0x100000, DrvGfxROM1 + 0x200000, 0x100000); -} - -static void extdwnhl68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x23ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x600400, 0x600fff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0x601000, 0x610bff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x880000, 0x88ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb13fff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xe00000, 0xe03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - // swap halves of sound rom - memcpy (DrvSndROM + 0x100000, DrvSndROM + 0x000000, 0x080000); - memcpy (DrvSndROM + 0x000000, DrvSndROM + 0x080000, 0x100000); -} - -static void krzybowl68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvNVRAM, 0x800000, 0x8001ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xb00000, 0xb003ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xc00000, 0xc03fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xe00000, 0xe00607 | 0x7ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xf00000, 0xf0ffff, MAP_RAM); - SekSetWriteWordHandler(0, thunderl_write_word); - SekSetWriteByteHandler(0, thunderl_write_byte); - SekSetReadWordHandler(0, madshark_read_word); - SekSetReadByteHandler(0, madshark_read_byte); - - SekMapHandler(1, 0xa00000, 0xa03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); -} - -void __fastcall triplfun_sound_write_byte(UINT32 address, UINT8 data) -{ - if ((address & ~1) == 0x500006) { - MSM6295Command(0, data); - } -} - -UINT8 __fastcall triplfun_sound_read_byte(UINT32) -{ - return MSM6295ReadStatus(0); -} - -static void triplfun68kInit() -{ - oisipuzl68kInit(); - - SekOpen(0); - SekMapHandler(2, 0x500006, 0x500007, MAP_READ | MAP_WRITE); -// SekSetReadWordHandler (2, triplfun_sound_read_word); - SekSetReadByteHandler (2, triplfun_sound_read_byte); -// SekSetWriteWordHandler(2, triplfun_sound_write_word); - SekSetWriteByteHandler(2, triplfun_sound_write_byte); - SekClose(); - - MSM6295Exit(0); - MSM6295Init(0, 792000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - memcpy (Drv68KROM + 0x100000, Drv68KROM + 0x080000, 0x080000); - memset (Drv68KROM + 0x080000, 0, 0x080000); -} - -static void utoukond68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700400, 0x700fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x800000, 0x803fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x880000, 0x883fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb03fff, MAP_RAM); - SekSetWriteWordHandler(0, daioh_write_word); - SekSetWriteByteHandler(0, daioh_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0xc00000, 0xc00001, MAP_WRITE); - SekSetWriteWordHandler(1, wiggie_sound_write_word); - SekSetWriteByteHandler(1, wiggie_sound_write_byte); - SekClose(); - - ZetOpen(0); - ZetMapArea(0x0000, 0xdfff, 0, DrvSubROM); - ZetMapArea(0x0000, 0xdfff, 2, DrvSubROM); - ZetMapArea(0xe000, 0xefff, 0, DrvSubRAM); - ZetMapArea(0xe000, 0xefff, 1, DrvSubRAM); - ZetMapArea(0xe000, 0xefff, 2, DrvSubRAM); - ZetSetWriteHandler(utoukond_sound_write); - ZetSetReadHandler(utoukond_sound_read); - ZetSetOutHandler(utoukond_sound_write_port); - ZetSetInHandler(utoukond_sound_read_port); - ZetClose(); - - for (INT32 i = 0; i < 0x400000; i++) DrvGfxROM0[i] ^= 0xff; -} - -static void Wiggie68kDecode() -{ - UINT8 *tmp = Drv68KRAM; - - for (INT32 i = 0; i < 0x20000; i+=16) { - for (INT32 j = 0; j < 16; j++) { - tmp[j] = Drv68KROM[i+((j & 1) | ((j & 2) << 2) | ((j & 0x0c) >> 1))]; - } - memcpy (Drv68KROM + i, tmp, 0x10); - } -} - -static void wiggie68kInit() -{ - thunderl68kInit(); - - SekOpen(0); - SekMapMemory(Drv68KRAM + 0x80000, 0x100000, 0x103fff, MAP_READ); // nop - - SekMapHandler(2, 0xb00008, 0xb00009, MAP_WRITE); - SekSetWriteWordHandler(2, wiggie_sound_write_word); - SekSetWriteByteHandler(2, wiggie_sound_write_byte); - SekClose(); - - Wiggie68kDecode(); - - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvSubROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvSubROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvSubRAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvSubRAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvSubRAM); - ZetSetWriteHandler(wiggie_sound_write); - ZetSetReadHandler(wiggie_sound_read); - ZetClose(); -} - -static UINT16 downtown_input_read(INT32 offset) -{ - INT32 dir1 = dialRotation(0); // analog port - INT32 dir2 = dialRotation(1); // analog port - - dir1 = (~ (0x800 >> dir1)) & 0xfff; - dir2 = (~ (0x800 >> dir2)) & 0xfff; - - switch (offset) - { - case 0: return (DrvInputs[2] & 0xf0) + (dir1 >> 8); // upper 4 bits of p1 rotation + coins - case 1: return (dir1 & 0xff); // lower 8 bits of p1 rotation - case 2: return DrvInputs[0]; // p1 - case 3: return 0xff; // ? - case 4: return (dir2 >> 8); // upper 4 bits of p2 rotation + ? - case 5: return (dir2 & 0xff); // lower 8 bits of p2 rotation - case 6: return DrvInputs[1]; // p2 - case 7: return 0xff; // ? - } - - return 0; -} - -static void m65c02_sub_bankswitch(UINT8 d) -{ - m65c02_bank = d >> 4; - - M6502MapMemory(DrvSubROM + 0xc000 + (m65c02_bank * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void downtown_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x1000: - m65c02_sub_bankswitch(data); - return; - } -} - -static UINT8 downtown_sub_read(UINT16 address) -{ - switch (address) - { - case 0x0800: return soundlatch; - case 0x0801: return soundlatch2; - case 0x1000: - case 0x1001: - case 0x1002: - case 0x1003: - case 0x1004: - case 0x1005: - case 0x1006: - case 0x1007: return downtown_input_read(address&7); - } - - return 0; -} - -static void downtown68kInit() -{ - downtown_protram = DrvNVRAM; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x09ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x900000, 0x903fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xd00000, 0xd00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xe00000, 0xe03fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xf00000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, downtown_write_word); - SekSetWriteByteHandler(0, downtown_write_byte); - SekSetReadWordHandler(0, daioh_read_word); - SekSetReadByteHandler(0, daioh_read_byte); - - SekMapHandler(1, 0x100000, 0x103fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - - SekMapMemory(downtown_protram, 0x200000, 0x2003ff, MAP_WRITE); - SekMapHandler(2, 0x200000, 0x2003ff, MAP_READ); - SekSetReadByteHandler (2, downtown_prot_read); - - SekMapHandler(3, 0xb00000, 0xb00fff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler (3, twineagl_sharedram_read_byte); - SekSetReadWordHandler (3, twineagl_sharedram_read_word); - SekSetWriteWordHandler(3, twineagl_sharedram_write_word); - SekSetWriteByteHandler(3, twineagl_sharedram_write_byte); - SekClose(); - - if (strstr(BurnDrvGetTextA(DRV_NAME), "downtown")) { - BurnLoadRom(DrvSubROM + 0x0004000, 4, 1); - BurnLoadRom(DrvSubROM + 0x000c000, 4, 1); - - M6502Init(0, TYPE_M65C02); - M6502Open(0); - M6502MapMemory(DrvSubRAM, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(DrvShareRAM, 0x5000, 0x57ff, MAP_RAM); - M6502MapMemory(DrvSubROM + 0x7000, 0x7000, 0x7fff, MAP_ROM); - M6502MapMemory(DrvSubROM + 0xc000, 0x8000, 0xbfff, MAP_ROM); // bank default - M6502MapMemory(DrvSubROM + 0xc000, 0xc000, 0xffff, MAP_ROM); - M6502SetWriteHandler(downtown_sub_write); - M6502SetReadHandler(downtown_sub_read); - M6502Close(); - m65c02_mode = 1; - - game_rotates = 2; // 2 == downtown mode. - RotateSetGunPosRAM(Drv68KRAM + (0xfef90+1), Drv68KRAM + (0xfefd0+1), 1); - } -} - -static UINT8 metafox_sub_read(UINT16 address) -{ - switch (address) - { - case 0x0800: return soundlatch; - case 0x0801: return soundlatch2; - case 0x1000: return DrvInputs[2]; - case 0x1002: return DrvInputs[0]; - case 0x1006: return DrvInputs[1]; - } - - return 0; -} - -static void metafox68kInit() -{ - downtown68kInit(); - - SekOpen(0); - SekMapHandler(3, 0xb00000, 0xb00fff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler (3, twineagl_sharedram_read_byte); - SekSetReadWordHandler (3, twineagl_sharedram_read_word); - SekSetWriteWordHandler(3, twineagl_sharedram_write_word); - SekSetWriteByteHandler(3, twineagl_sharedram_write_byte); - SekClose(); - - if (X1010_Arbalester_Mode) { - BurnLoadRom(DrvSubROM + 0x0006000, 2, 1); - memcpy(DrvSubROM + 0x000a000, DrvSubROM + 0x0006000, 0x4000); - memcpy(DrvSubROM + 0x000e000, DrvSubROM + 0x0006000, 0x2000); - } else { - BurnLoadRom(DrvSubROM + 0x0006000, 4, 1); - memcpy(DrvSubROM + 0x0008000, DrvSubROM + 0x0006000, 0x2000); - memcpy(DrvSubROM + 0x000a000, DrvSubROM + 0x0006000, 0x2000); - memcpy(DrvSubROM + 0x000c000, DrvSubROM + 0x0006000, 0x2000); - memcpy(DrvSubROM + 0x000e000, DrvSubROM + 0x0006000, 0x2000); - } - - M6502Init(0, TYPE_M65C02); - M6502Open(0); - M6502MapMemory(DrvSubRAM, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(DrvShareRAM, 0x5000, 0x57ff, MAP_RAM); - M6502MapMemory(DrvSubROM + 0x7000, 0x7000, 0x7fff, MAP_ROM); - M6502MapMemory(DrvSubROM + 0xc000, 0x8000, 0xbfff, MAP_ROM); // bank default - M6502MapMemory(DrvSubROM + 0xc000, 0xc000, 0xffff, MAP_ROM); - M6502SetWriteHandler(downtown_sub_write); - M6502SetReadHandler(metafox_sub_read); - M6502Close(); - m65c02_mode = 1; - -} - -static void tndrcade_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x2000: BurnYM2203Write(0, 0, data); return; - case 0x2001: BurnYM2203Write(0, 1, data); return; - case 0x3000: BurnYM3812Write(0, 0, data); return; - case 0x3001: BurnYM3812Write(0, 1, data); return; - case 0x1000: m65c02_sub_bankswitch(data); return; - } -} - -static UINT8 tndrcade_sub_read(UINT16 address) -{ - switch (address) - { - case 0x0800: return 0xff; - case 0x1000: return DrvInputs[0]; - case 0x1001: return DrvInputs[1]; - case 0x1002: return DrvInputs[2]; - case 0x2000: return BurnYM2203Read(0, 0); - case 0x2001: return BurnYM2203Read(0, 1); - } - - return 0; -} - -static void tndrcade68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x380000, 0x3803ff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x600000, 0x600607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0xa00000, 0xa00fff, MAP_WRITE); // m65c02 not emulated, simulate instead - SekMapMemory(DrvSprRAM1, 0xc00000, 0xc03fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xe00000, 0xe03fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xffc000, 0xffffff, MAP_RAM); - - SekMapHandler(3, 0xa00000, 0xa00fff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler (3, twineagl_sharedram_read_byte); - SekSetReadWordHandler (3, twineagl_sharedram_read_word); - SekSetWriteWordHandler(3, twineagl_sharedram_write_word); - SekSetWriteByteHandler(3, twineagl_sharedram_write_byte); - SekClose(); - - BurnLoadRom(DrvSubROM + 0x0004000, 4, 1); - BurnLoadRom(DrvSubROM + 0x000c000, 4, 1); - - M6502Init(0, TYPE_M65C02); - M6502Open(0); - M6502MapMemory(DrvSubRAM, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(DrvShareRAM, 0x5000, 0x57ff, MAP_RAM); - M6502MapMemory(DrvSubROM + 0x6000, 0x6000, 0x7fff, MAP_ROM); - //M6502MapMemory(DrvSubROM + 0xc000, 0x8000, 0xbfff, MAP_ROM); // bank default - M6502MapMemory(DrvSubROM + 0xc000, 0xc000, 0xffff, MAP_ROM); - M6502SetWriteHandler(tndrcade_sub_write); - M6502SetReadHandler(tndrcade_sub_read); - M6502Close(); - m65c02_mode = 1; - -} - -static void kiwame68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0x800000, 0x803fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xb00000, 0xb003ff, MAP_RAM); - SekMapMemory(DrvNVRAM, 0xfffc00, 0xffffff, MAP_WRITE); - - SekSetReadWordHandler(0, kiwame_read_word); - SekSetReadByteHandler(0, kiwame_read_byte); - - SekMapHandler(1, 0xc00000, 0xc03fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - { - // give the game proper vectors - *((UINT16 *)(Drv68KROM + 0x00064)) = 0x0000; - *((UINT16 *)(Drv68KROM + 0x00066)) = 0x0dca; - - // get past backup ram error - // the game never actually tests it before failing?? - *((UINT16 *)(Drv68KROM + 0x136d2)) = 0x6052; - } -} - -UINT8 __fastcall twineagle_extram_read_byte(UINT32 address) -{ - return DrvNVRAM[address & 0x3fe]; -} - -static UINT8 twineagl_sub_read(UINT16 address) -{ - switch (address) - { - case 0x0800: return soundlatch; - case 0x0801: return soundlatch2; - case 0x1000: return DrvInputs[0]; - case 0x1001: return DrvInputs[1]; - case 0x1002: return DrvInputs[2]; - } - - return 0; -} - -static void twineagle68kInit() -{ - downtown68kInit(); - - SekOpen(0); - SekMapMemory(DrvNVRAM, 0x200000, 0x2003ff, MAP_WRITE); - SekMapHandler(2, 0x200000, 0x2003ff, MAP_READ); - SekSetReadByteHandler (2, twineagle_extram_read_byte); - - SekMapHandler(3, 0xb00000, 0xb00fff, MAP_READ | MAP_WRITE); - SekSetReadByteHandler (3, twineagl_sharedram_read_byte); - SekSetReadWordHandler (3, twineagl_sharedram_read_word); - SekSetWriteWordHandler(3, twineagl_sharedram_write_word); - SekSetWriteByteHandler(3, twineagl_sharedram_write_byte); - SekClose(); - - BurnByteswap(Drv68KROM, 0x80000); - - BurnLoadRom(DrvSubROM + 0x0006000, 1, 1); - memcpy(DrvSubROM + 0x0008000, DrvSubROM + 0x0006000, 0x2000); - memcpy(DrvSubROM + 0x000a000, DrvSubROM + 0x0006000, 0x2000); - memcpy(DrvSubROM + 0x000c000, DrvSubROM + 0x0006000, 0x2000); - memcpy(DrvSubROM + 0x000e000, DrvSubROM + 0x0006000, 0x2000); - - M6502Init(0, TYPE_M65C02); - M6502Open(0); - M6502MapMemory(DrvSubRAM, 0x0000, 0x01ff, MAP_RAM); - M6502MapMemory(DrvShareRAM, 0x5000, 0x57ff, MAP_RAM); - M6502MapMemory(DrvSubROM + 0x7000, 0x7000, 0x7fff, MAP_ROM); - M6502MapMemory(DrvSubROM + 0xc000, 0x8000, 0xbfff, MAP_ROM); // bank default - M6502MapMemory(DrvSubROM + 0xc000, 0xc000, 0xffff, MAP_ROM); - M6502SetWriteHandler(downtown_sub_write); - M6502SetReadHandler(twineagl_sub_read); - M6502Close(); - m65c02_mode = 1; -} - -static void crazyfgt68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x640400, 0x640fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x800000, 0x803fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x880000, 0x883fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xb00000, 0xb03fff, MAP_RAM); - SekSetWriteWordHandler(0, crazyfgt_write_word); - SekSetWriteByteHandler(0, crazyfgt_write_byte); - SekSetReadWordHandler(0, crazyfgt_read_word); - SekSetReadByteHandler(0, crazyfgt_read_byte); - SekClose(); - - // Patch protection - *((UINT16*)(Drv68KROM + 0x1078)) = 0x4e71; - - BlandiaGfxRearrange(); // fix bg tiles -} - -static void calibr50_sub_write(UINT16 address, UINT8 data) -{ - if (address <= 0x1fff) { // x1_010 - setaSoundRegWriteByte8bit(address, data); - return; - } - - switch (address) - { - case 0x4000: - m65c02_sub_bankswitch(data); - return; - - case 0xc000: - { - soundlatch2 = data; - M6502ReleaseSlice(); - return; - } - } -} - -static UINT8 calibr50_sub_read(UINT16 address) -{ - if (address <= 0x1fff) { // x1_010 - return x1010_sound_read(address); - } - - switch (address) - { - case 0x4000: { - return soundlatch; - } - } - - return 0; -} - -static void calibr5068kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x09ffff, MAP_ROM); - SekMapMemory(Drv68KRAM2, 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(Drv68KRAM3, 0xc00000, 0xc000ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x700000, 0x7003ff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x900000, 0x904fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xd00000, 0xd00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xe00000, 0xe03fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, calibr50_write_word); - SekSetWriteByteHandler(0, calibr50_write_byte); - SekSetReadWordHandler(0, calibr50_read_word); - SekSetReadByteHandler(0, calibr50_read_byte); - SekClose(); - - // m65c02 sound... - M6502Init(0, TYPE_M65C02); - M6502Open(0); - M6502MapMemory(DrvSubROM, 0xC000, 0xffff, MAP_ROM); - M6502MapMemory(DrvSubROM + 0x4000, 0x8000, 0xbfff, MAP_ROM); - BurnLoadRom(DrvSubROM + 0x4000, 4, 1); - BurnLoadRom(DrvSubROM + 0xc000, 4, 1); - M6502SetWriteHandler(calibr50_sub_write); - M6502SetReadHandler(calibr50_sub_read); - M6502Close(); - m65c02_mode = 1; - - RotateSetGunPosRAM(Drv68KRAM + (0x2503-1), Drv68KRAM + (0x2527-1), 2); - game_rotates = 1; -} - -static void usclssic68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvSprRAM0, 0x800000, 0x800607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xb00000, 0xb003ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xc00000, 0xc03fff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0xd00000, 0xd04fff, MAP_RAM); - SekMapMemory(Drv68KRAM2, 0xe00000, 0xe00fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, usclssic_write_word); - SekSetWriteByteHandler(0, usclssic_write_byte); - SekSetReadWordHandler(0, usclssic_read_word); - SekSetReadByteHandler(0, usclssic_read_byte); - SekClose(); - - // m65c02 sound... - M6502Init(0, TYPE_M65C02); - M6502Open(0); - M6502MapMemory(DrvSubROM, 0xC000, 0xffff, MAP_ROM); - M6502MapMemory(DrvSubROM + 0x4000, 0x8000, 0xbfff, MAP_ROM); - BurnLoadRom(DrvSubROM + 0x4000, 4, 1); - BurnLoadRom(DrvSubROM + 0xc000, 4, 1); - M6502SetWriteHandler(calibr50_sub_write); - M6502SetReadHandler(calibr50_sub_read); - M6502Close(); - m65c02_mode = 1; -} - -//----------------------------------------------------------------------------------------------------------------------------------- - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0x20, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0x20, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static INT32 DrvSynchroniseStream2203(INT32 nSoundRate) -{ - return (INT64)M6502TotalCycles() * nSoundRate / 2000000; -} - -static INT32 DrvYM3812SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)SekTotalCycles() * nSoundRate / 16000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -static double DrvGetTime2203() -{ - return (double)M6502TotalCycles() / 2000000.0; -} - -static UINT8 DrvYM2203ReadPortA(UINT32) -{ - return DrvDips[1]; -} - -static UINT8 DrvYM2203ReadPortB(UINT32) -{ - return DrvDips[0]; -} - -static INT32 DrvGfxDecode(INT32 type, UINT8 *gfx, INT32 num) -{ - DrvGfxTransMask[num] = NULL; - - INT32 len = DrvROMLen[num]; - if (DrvROMLen[num] == 0) DrvGfxMask[num] = 1; // no divide by 0 - if (len == 0 || type == -1) return 0; - - INT32 Plane0[4] = { ((len * 8) / 2) + 8, ((len * 8) / 2) + 0, 8, 0 }; - INT32 XOffs0[16] = { 0,1,2,3,4,5,6,7, 128,129,130,131,132,133,134,135 }; - INT32 YOffs0[16] = { 0*16,1*16,2*16,3*16,4*16,5*16,6*16,7*16, 16*16,17*16,18*16,19*16,20*16,21*16,22*16,23*16 }; - - INT32 Plane1[4] = { 0, 4, ((len * 8) / 2) + 0, ((len * 8) / 2) + 4 }; - INT32 Plane1a[6] = { (((len * 8) / 3) * 0) + 0, (((len * 8) / 3) * 0) + 4, (((len * 8) / 3) * 1) + 0, (((len * 8) / 3) * 1) + 4, (((len * 8) / 3) * 2) + 0, (((len * 8) / 3) * 2) + 4 }; - INT32 XOffs1[16] = { 128+64,128+65,128+66,128+67, 128+0,128+1,128+2,128+3, 8*8+0,8*8+1,8*8+2,8*8+3, 0,1,2,3 }; - INT32 YOffs1[16] = { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8, 32*8,33*8,34*8,35*8,36*8,37*8,38*8,39*8 }; - - INT32 Plane2[6] = { ((len * 8) / 2)+0*4, ((len * 8) / 2)+1*4, 2*4,3*4,0*4,1*4 }; - INT32 XOffs2[16] = { 256+128,256+129,256+130,256+131, 256+0,256+1,256+2,256+3, 128,129,130,131, 0,1,2,3 }; - INT32 YOffs2[16] = { 0*16,1*16,2*16,3*16,4*16,5*16,6*16,7*16, 32*16,33*16,34*16,35*16,36*16,37*16,38*16,39*16 }; - - INT32 Plane3[4] = { ((len * 8) / 4) * 0, ((len * 8) / 4) * 1, ((len * 8) / 4) * 2, ((len * 8) / 4) * 3 }; - INT32 XOffs3[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71 }; - INT32 YOffs3[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 128+0, 128+8, 128+16, 128+24, 128+32, 128+40, 128+48, 128+56 }; - INT32 YOffs3a[16]= { 0*8, 16*8, 4*8, 20*8, 2*8, 18*8, 6*8, 22*8, 1*8, 17*8, 5*8, 21*8, 3*8, 19*8, 7*8, 23*8 }; // wiggie - INT32 YOffs3b[16]= { 0*8, 2*8, 16*8, 18*8, 1*8, 3*8, 17*8, 19*8, 4*8, 6*8, 20*8, 22*8, 5*8, 7*8,21*8, 23*8 }; // superbar - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, gfx, len); - - switch (type) - { - case 0: // layout_planes_2roms - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Plane0, XOffs0, YOffs0, 0x200, tmp, gfx); - DrvGfxMask[num] = (len * 2) / (16 * 16); - ColorDepths[num] = 4; - break; - - case 1: // layout_planes_2roms_split - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, gfx); - DrvGfxMask[num] = (len * 2) / (16 * 16); - ColorDepths[num] = 4; - break; - - case 2: // layout_packed - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Plane2 + 2, XOffs2, YOffs2, 0x400, tmp, gfx); - DrvGfxMask[num] = (len * 2) / (16 * 16); - ColorDepths[num] = 4; - break; - - case 3: // layout_packed_6bits_2roms - GfxDecode((len * 1) / (16 * 16), 6, 16, 16, Plane2 + 0, XOffs2, YOffs2, 0x400, tmp, gfx); - DrvGfxMask[num] = (len * 1) / (16 * 16); - ColorDepths[num] = 6; //handled like 4 - break; - - case 4: // layout_packed_6bits_3roms - GfxDecode(((len * 8)/6) / (16 * 16), 6, 16, 16, Plane1a, XOffs1, YOffs1, 0x200, tmp, gfx); - DrvGfxMask[num] = ((len * 8)/6) / (16 * 16); - ColorDepths[num] = 6; //handled like 4 - break; - - case 5: // layout_planes - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Plane3, XOffs3, YOffs3 , 0x100, tmp, gfx); - DrvGfxMask[num] = (len * 2) / (16 * 16); - ColorDepths[num] = 4; - break; - - case 6: // wiggie_layout - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Plane3, XOffs3, YOffs3a, 0x100, tmp, gfx); - DrvGfxMask[num] = (len * 2) / (16 * 16); - ColorDepths[num] = 4; - break; - - case 7: // superbar_layout - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Plane3, XOffs3, YOffs3b, 0x100, tmp, gfx); - DrvGfxMask[num] = (len * 2) / (16 * 16); - ColorDepths[num] = 4; - break; - } - - BurnFree (tmp); - - { - INT32 size = DrvGfxMask[num]; - - DrvGfxTransMask[num] = (UINT8*)BurnMalloc(size); - - for (INT32 i = 0; i < size << 8; i += (1 << 8)) { - DrvGfxTransMask[num][i >> 8] = 1; // transparent - for (INT32 j = 0; j < (1 << 8); j++) { - if (gfx[i + j]) { - DrvGfxTransMask[num][i >> 8] = 0; - break; - } - } - } - } - - return 0; -} - -static INT32 DrvLoadRoms(INT32 bload) -{ - char* pRomName; - struct BurnRomInfo ri, rh; - - UINT8 *LoadPrg[2] = { Drv68KROM, DrvSubROM }; - UINT8 *LoadGfx[5] = { DrvGfxROM0, DrvGfxROM1, DrvGfxROM2, DrvSndROM, DrvColPROM }; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i + 0); - BurnDrvGetRomInfo(&rh, i + 1); - - if ((ri.nType & 7) < 3 && (ri.nType & 7)) { - INT32 type = (ri.nType - 1) & 1; - - if ((rh.nType & 7) == 1 && (rh.nLen == ri.nLen)) { - if (bload) if (BurnLoadRom(LoadPrg[type] + 0, i + 1, 2)) return 1; - if (bload) if (BurnLoadRom(LoadPrg[type] + 1, i + 0, 2)) return 1; - LoadPrg[type] += ri.nLen * 2; - i++; // loading two roms - } else { - if (bload) if (BurnLoadRom(LoadPrg[type], i, 1)) return 1; - LoadPrg[type] += ri.nLen; - } - continue; - } - - if ((ri.nType & 7) == 3 || (ri.nType & 7) == 4 || (ri.nType & 7) == 5 || (ri.nType & 7) == 6 || (ri.nType & 7) == 7) { // gfx, snd, colprom - INT32 type = (ri.nType & 7) - 3; - - if (ri.nType & 8) { // interleaved... - if (bload) if (BurnLoadRom(LoadGfx[type] + 0, i + 0, 2)) return 1; - - if ((ri.nType & 16) == 0) { // zingzap - if (bload) if (BurnLoadRom(LoadGfx[type] + 1, i + 1, 2)) return 1; - i++; - } - - LoadGfx[type] += ri.nLen * 2; - } else { - if (bload) if (BurnLoadRom(LoadGfx[type], i, 1)) return 1; - LoadGfx[type] += ri.nLen; - } - - continue; - } - } - - if (bload == 0) { - DrvROMLen[0] = LoadGfx[0] - DrvGfxROM0; - DrvROMLen[1] = LoadGfx[1] - DrvGfxROM1; - DrvROMLen[2] = LoadGfx[2] - DrvGfxROM2; - DrvROMLen[3] = LoadGfx[3] - DrvSndROM; - DrvROMLen[4] = LoadGfx[4] - DrvColPROM; - } - - return 0; -} - -static INT32 DrvDoReset(INT32 ram) -{ - if (ram) memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); // wiggie, utoukond, superbar - ZetReset(); - ZetClose(); - - if (m65c02_mode) { - M6502Open(0); - M6502Reset(); - m65c02_sub_bankswitch(0); - M6502Close(); - soundlatch = 0; - soundlatch2 = 0; - sub_ctrl_data = 0; - } - - x1010Reset(); - MSM6295Reset(0); - BurnYM3438Reset(); - BurnYM3812Reset(); - if (has_2203) { - BurnYM2203Reset(); - } - - if (game_rotates) - RotateReset(); - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x200000; - DrvSubROM = Next; Next += 0x050000; - - DrvGfxROM2 = Next; Next += DrvROMLen[2] * 2; - DrvGfxROM1 = Next; Next += DrvROMLen[1] * 2; - DrvGfxROM0 = Next; Next += DrvROMLen[0] * 2; - - DrvColPROM = Next; Next += 0x000800; - - MSM6295ROM = Next; - X1010SNDROM = Next; - DrvSndROM = Next; Next += DrvROMLen[3] + 0x200000; // for banking - - Palette = (UINT32*)Next; Next += BurnDrvGetPaletteEntries() * sizeof(UINT32); - DrvPalette = (UINT32*)Next; Next += BurnDrvGetPaletteEntries() * sizeof(UINT32); - - DrvNVRAM = Next; Next += 0x000400; - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x100000; - Drv68KRAM2 = Next; Next += 0x020000; - Drv68KRAM3 = Next; Next += 0x001000; - DrvSubRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x001000; - DrvSprRAM0 = Next; Next += 0x000800; - DrvSprRAM1 = Next; Next += 0x014000; - - DrvVidRAM0 = Next; Next += 0x010000; - DrvVIDCTRLRAM0 = Next; Next += 0x000008; - - DrvVidRAM1 = Next; Next += 0x010000; - DrvVIDCTRLRAM1 = Next; Next += 0x000008; - - DrvVideoRegs = Next; Next += 0x000008; - - tilebank = Next; Next += 0x000004; - tile_offset = (UINT32*)Next; Next += 0x000001 * sizeof(UINT32); - - DrvShareRAM = Next; Next += 0x001000; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvSetVideoOffsets(INT32 spritex, INT32 spritex_flipped, INT32 tilesx, INT32 tilesx_flipped) -{ - VideoOffsets[0][0] = spritex; - VideoOffsets[0][1] = spritex_flipped; - VideoOffsets[1][0] = tilesx; - VideoOffsets[1][1] = tilesx_flipped; -} - -static void DrvSetColorOffsets(INT32 gfx0, INT32 gfx1, INT32 gfx2) -{ - ColorOffsets[0] = gfx0; - ColorOffsets[1] = gfx1; - ColorOffsets[2] = gfx2; -} - -static void DrvSetDefaultColorTable() -{ - for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++) { - Palette[i] = i; - } -} - -static void zingzapSetColorTable() -{ - for (INT32 color = 0; color < 0x20; color++) { - for (INT32 pen = 0; pen < 0x40; pen++) { - Palette[0x400 + ((color << 6) | pen)] = 0x400 + (((color << 4) + pen) & 0x1ff); - } - } -} - -static void jjsquawkSetColorTable() -{ - for (INT32 color = 0; color < 0x20; color++) { - for (INT32 pen = 0; pen < 0x40; pen++) { - Palette[0x200 + ((color << 6) | pen)] = 0x400 + (((color << 4) + pen) & 0x1ff); - Palette[0xa00 + ((color << 6) | pen)] = 0x200 + (((color << 4) + pen) & 0x1ff); - } - } -} - -static void gundharaSetColorTable() -{ - for (INT32 color = 0; color < 0x20; color++) { - for (INT32 pen = 0; pen < 0x40; pen++) { - Palette[0x200 + ((color << 6) | pen)] = 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff); - Palette[0xa00 + ((color << 6) | pen)] = 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff); - } - } -} - -static void blandiaSetColorTable() -{ - for (INT32 color = 0; color < 0x20; color++) { - for (INT32 pen = 0; pen < 0x40; pen++) { - Palette[0x200 + ((color << 6) | pen)] = 0x200 + ((color << 4) | (pen & 0x0f)); - Palette[0xa00 + ((color << 6) | pen)] = 0x400 + pen; - } - } -} - -static void usclssicSetColorTable() -{ - memcpy (DrvColPROM + 0x600, DrvColPROM + 0x000, 0x200); -// memcpy (DrvColPROM + 0x200, DrvColPROM + 0x200, 0x200); - - for (INT32 color = 0; color < BurnDrvGetPaletteEntries(); color++) { - Palette[color] = color; - } - - for (INT32 color = 0; color < 0x20; color++) { - for (INT32 pen = 0; pen < 0x40; pen++) { - Palette[0x200 + ((color << 6) | pen)] = 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff); - Palette[0xA00 + ((color << 6) | pen)] = 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff); - } - } -} - -static INT32 DrvInit(void (*p68kInit)(), INT32 cpu_speed, INT32 irq_type, INT32 spr_buffer, INT32 gfxtype0, INT32 gfxtype1, INT32 gfxtype2) -{ - BurnSetRefreshRate((1.00 * refresh_rate)/100); - - if (pRomLoadCallback) { - pRomLoadCallback(0); - } else { - DrvLoadRoms(0); - } - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pRomLoadCallback) { - if (pRomLoadCallback(1)) return 1; - } else { - if (DrvLoadRoms(1)) return 1; - } - - // make sure these are initialized so that we can use common routines - ZetInit(0); - MSM6295Init(0, 1000000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - if (p68kInit) { - p68kInit(); - } - - DrvGfxDecode(gfxtype0, DrvGfxROM0, 0); - DrvGfxDecode(gfxtype1, DrvGfxROM1, 1); - DrvGfxDecode(gfxtype2, DrvGfxROM2, 2); - - cpuspeed = cpu_speed; - irqtype = irq_type; - buffer_sprites = spr_buffer; - - if ((strstr(BurnDrvGetTextA(DRV_NAME), "calibr50")) || (strstr(BurnDrvGetTextA(DRV_NAME), "usclssic"))) { - x1010_sound_init(16000000, 0x1000); - } else { - x1010_sound_init(16000000, 0x0000); - } - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - - if (strstr(BurnDrvGetTextA(DRV_NAME), "madshark") || strstr(BurnDrvGetTextA(DRV_NAME), "gundhara")) - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - - if (strstr(BurnDrvGetTextA(DRV_NAME), "kamenrid") || strstr(BurnDrvGetTextA(DRV_NAME), "wrofaero") || strstr(BurnDrvGetTextA(DRV_NAME), "sokonuke")) - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - - BurnYM3812Init(1, 4000000, NULL, DrvYM3812SynchroniseStream, 0); - BurnTimerAttachSekYM3812(16000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - BurnYM3438Init(1, 16000000/4, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 1); - BurnTimerAttachZet(4000000); - BurnYM3438SetRoute(0, BURN_SND_YM3438_YM3438_ROUTE_1, 0.30, BURN_SND_ROUTE_LEFT); - BurnYM3438SetRoute(0, BURN_SND_YM3438_YM3438_ROUTE_2, 0.30, BURN_SND_ROUTE_RIGHT); - - if (strstr(BurnDrvGetTextA(DRV_NAME), "tndrcade")) - has_2203 = 1; - - if (has_2203) { - BurnYM2203Init(1, 4000000, NULL, DrvSynchroniseStream2203, DrvGetTime2203, 1); - BurnYM2203SetPorts(0, &DrvYM2203ReadPortA, &DrvYM2203ReadPortB, NULL, NULL); - BurnYM2203SetAllRoutes(0, 0.35, BURN_SND_ROUTE_BOTH); - BurnTimerAttachM6502(2000000); - } - - GenericTilesInit(); - - DrvSetDefaultColorTable(); - - flipflop = 0; - - VideoOffsets[2][0] = ((256 - nScreenHeight) / 2); // adjust for screen height - VideoOffsets[2][1] = VideoOffsets[2][0]; - - BurnGunInit(2, true); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - pRomLoadCallback = NULL; - - GenericTilesExit(); - - DrvGfxROM0 = NULL; - DrvGfxROM1 = NULL; - DrvGfxROM2 = NULL; - - DrvSetColorOffsets(0, 0, 0); - DrvSetVideoOffsets(0, 0, 0, 0); - - SekExit(); - ZetExit(); - - if (m65c02_mode) { - M6502Exit(); - m65c02_mode = 0; - } - - BurnGunExit(); - - x1010_exit(); - BurnYM3438Exit(); - BurnYM3812Exit(); - if (has_2203) { - BurnYM2203Exit(); - } - - MSM6295Exit(0); - MSM6295ROM = NULL; - - BurnFree (AllMem); - - oisipuzl_hack = 0; - twineagle = 0; - daiohc = 0; - watchdog_enable = 0; - refresh_rate = 6000; - game_rotates = 0; - has_2203 = 0; - trackball_mode = 0; - usclssic = 0; - - BurnFree (DrvGfxTransMask[0]); - BurnFree (DrvGfxTransMask[2]); - BurnFree (DrvGfxTransMask[1]); - - return 0; -} - -static inline void DrvColors(INT32 i, INT32 pal) -{ - INT32 r = (pal >> 10) & 0x1f; - INT32 g = (pal >> 5) & 0x1f; - INT32 b = (pal >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); -} - -static void DrvPaletteRecalc() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - if (DrvROMLen[4] && DrvROMLen[4] > 1) { // usclassic color prom - memcpy (DrvColPROM + 0x400, DrvPalRAM, 0x200); - memcpy (DrvColPROM + 0x000, DrvPalRAM + 0x200, 0x200); - p = (UINT16*)DrvColPROM; - } - - for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++) { - DrvColors(i, BURN_ENDIAN_SWAP_INT16(p[Palette[i]])); - } -} - -static void draw_sprites_map() -{ - UINT16 *spriteram16 = (UINT16*)DrvSprRAM0; - - INT32 ctrl = BURN_ENDIAN_SWAP_INT16(spriteram16[0x600/2]); - INT32 ctrl2 = BURN_ENDIAN_SWAP_INT16(spriteram16[0x602/2]); - - INT32 flip = ctrl & 0x40; - INT32 numcol = ctrl2 & 0x0f; - - UINT16 *src = ((UINT16*)DrvSprRAM1) + ( ((ctrl2 ^ (~ctrl2<<1)) & 0x40) ? 0x2000/2 : 0 ); - - INT32 upper = ( BURN_ENDIAN_SWAP_INT16(spriteram16[ 0x604/2 ]) & 0xFF ) +( BURN_ENDIAN_SWAP_INT16(spriteram16[ 0x606/2 ]) & 0xFF ) * 256; - - INT32 col0 = 0; - switch (ctrl & 0x0f) - { - case 0x01: col0 = 0x4; break; // krzybowl - case 0x06: col0 = 0x8; break; // kiwame - } - - INT32 xoffs = 0; - INT32 yoffs = flip ? 1 : -1; - - if (numcol == 1) numcol = 16; - - for (INT32 col = 0 ; col < numcol; col++) - { - INT32 x = BURN_ENDIAN_SWAP_INT16(spriteram16[(col * 0x20 + 0x408)/2]) & 0xff; - INT32 y = BURN_ENDIAN_SWAP_INT16(spriteram16[(col * 0x20 + 0x400)/2]) & 0xff; - - for (INT32 offs = 0; offs < 0x20; offs++) - { - INT32 code = BURN_ENDIAN_SWAP_INT16(src[((col+col0)&0xf) * 0x40/2 + offs + 0x800/2]); - INT32 color = BURN_ENDIAN_SWAP_INT16(src[((col+col0)&0xf) * 0x40/2 + offs + 0xc00/2]); - - INT32 flipx = code & 0x8000; - INT32 flipy = code & 0x4000; - - INT32 bank = (color & 0x0600) >> 9; - - INT32 sx = x + xoffs + (offs & 1) * 16; - INT32 sy = -(y + yoffs) + (offs / 2) * 16; - - if (upper & (1 << col)) sx += 256; - - if (flip) { - sy = 0xf0 - sy; - flipx = !flipx; - flipy = !flipy; - } - - color = (color >> 11) & 0x1f; - code = ((code & 0x3fff) + (bank * 0x4000)) % DrvGfxMask[0]; - - if (DrvGfxTransMask[0][code]) continue; - - sx = ((sx + 0x10) & 0x1ff) - 0x10; - sy = ((sy + 8) & 0x0ff) - 8; - sy = ((sy+16-VideoOffsets[2][0])&0xff)-16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, ColorDepths[0], 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, ColorDepths[0], 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, ColorDepths[0], 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, ColorDepths[0], 0, 0, DrvGfxROM0); - } - } - } - } -} - -static void draw_sprites() -{ - if (~nSpriteEnable & 1) return; - - UINT16 *spriteram16 = (UINT16*)DrvSprRAM0; - - INT32 ctrl = BURN_ENDIAN_SWAP_INT16(spriteram16[ 0x600/2 ]); - INT32 ctrl2 = BURN_ENDIAN_SWAP_INT16(spriteram16[ 0x602/2 ]); - - INT32 flip = ctrl & 0x40; - - UINT16 *src = ((UINT16*)DrvSprRAM1) + ( ((ctrl2 ^ (~ctrl2<<1)) & 0x40) ? 0x2000/2 : 0 ); - - draw_sprites_map(); - - INT32 yoffs = oisipuzl_hack ? 32 : 0; - INT32 xoffs = VideoOffsets[0][flip ? 1 : 0]; - - for (INT32 offs = (0x400-2)/2 ; offs >= 0; offs -= 1) - { - int code = BURN_ENDIAN_SWAP_INT16(src[offs + 0x000/2]); - int sx = BURN_ENDIAN_SWAP_INT16(src[offs + 0x400/2]); - - int sy = BURN_ENDIAN_SWAP_INT16(spriteram16[offs + 0x000/2]) & 0xff; - - int flipx = code & 0x8000; - int flipy = code & 0x4000; - - INT32 bank = (sx & 0x0600) >> 9; - INT32 color = (sx >> 11) & 0x1f; - - if (flip) - { - sy = (0x100 - nScreenHeight) + 0xf0 - sy; - flipx = !flipx; - flipy = !flipy; - } - - code = ((code & 0x3fff) + (bank * 0x4000)) % DrvGfxMask[0]; - - if (DrvGfxTransMask[0][code]) continue; - - sx = ((sx + xoffs + 0x10) & 0x1ff) - 0x10; - sy = ((((0xf0 - sy) - (-2) + 8)) & 0x0ff) - 8; - sy = ((yoffs+sy+16-VideoOffsets[2][0])&0xff)-16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, ColorDepths[0], 0, ColorOffsets[0], DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, ColorDepths[0], 0, ColorOffsets[0], DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, ColorDepths[0], 0, ColorOffsets[0], DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, ColorDepths[0], 0, ColorOffsets[0], DrvGfxROM0); - } - } - } -} - -// this is needed because some color depths (specifically 6 bits per pixel) need colors added rather than xored. -static void RenderTile(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 trans_col, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height) -{ - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip]; - - if (pxl == trans_col) continue; - - dest[sy * nScreenWidth + sx] = pxl + color; - } - - sx -= width; - } -} - -static void draw_layer(UINT8 *ram, UINT8 *gfx, INT32 num, INT32 opaque, INT32 scrollx, INT32 scrolly) -{ - INT32 mask = DrvGfxMask[num]; - INT32 depth = ColorDepths[num]; - INT32 color_offset = ColorOffsets[num]; - - scrollx = scrollx & 0x3ff; // offsets added in seta_update() - scrolly = (scrolly + VideoOffsets[2][0]) & 0x1ff; - - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 4; - INT32 sy = (offs >> 6) << 4; - - sx -= scrollx; - if (sx < -15) sx += 0x400; - sy -= scrolly; - if (sy < -15) sy += 0x200; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs + 0x000]); - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[offs + 0x800]) & 0x001f; - - INT32 code = (attr & 0x3fff) + tile_offset[0]; - - if (twineagle) { - if ((code & 0x3e00) == 0x3e00) { - code = (code & 0x007f) | ((tilebank[(code & 0x0180) >> 7] >> 1) << 7); - } - } - - code %= mask; - - if (!opaque) { - if (DrvGfxTransMask[num][code]) continue; - } - - INT32 flipx = attr & 0x8000; - INT32 flipy = attr & 0x4000; - - if (flipscreen) { - sx = (nScreenWidth - 16) - sx; - sy = (nScreenHeight - 16) - sy; - flipx ^= 0x8000; - flipy ^= 0x4000; - } - - if (depth == 6) { - RenderTile(pTransDraw, gfx, code, (color * (1<> 6; // disabled for now... - flipscreen ^= tmap_flip; - - INT32 visible = (nScreenHeight - 1); - - UINT16 *vctrl0 = (UINT16*)DrvVIDCTRLRAM0; - UINT16 *vctrl1 = (UINT16*)DrvVIDCTRLRAM1; - - INT32 x_0 = BURN_ENDIAN_SWAP_INT16(vctrl0[0]); - INT32 y_0 = BURN_ENDIAN_SWAP_INT16(vctrl0[1]); - INT32 en0 = BURN_ENDIAN_SWAP_INT16(vctrl0[2]); - - INT32 x_1 = BURN_ENDIAN_SWAP_INT16(vctrl1[0]); - INT32 y_1 = BURN_ENDIAN_SWAP_INT16(vctrl1[1]); - INT32 en1 = BURN_ENDIAN_SWAP_INT16(vctrl1[2]); - - x_0 += 0x10 - VideoOffsets[1][flipscreen ? 1 : 0]; - y_0 -= (256 - visible)/2; - if (flipscreen) - { - x_0 = -x_0 - 512; - y_0 = y_0 - visible; - } - - if (enable_tilemap2) - { - x_1 += 0x10 - VideoOffsets[1][flipscreen ? 1 : 0]; - y_1 -= (256 - visible)/2; - if (flipscreen) - { - x_1 = -x_1 - 512; - y_1 = y_1 - visible; - } - - order = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvVideoRegs + 2))); - } - - if ( en0 & 0x08) layer_enable &= ~0x01; - if (~en0 & 0x08) layer_enable &= ~0x02; - if ( en1 & 0x08) layer_enable &= ~0x04; - if (~en1 & 0x08) layer_enable &= ~0x08; - if (enable_tilemap2 == 0) layer_enable &= ~0x0c; - - layer_enable &= nBurnLayer; - - BurnTransferClear(); - - if (order & 1) - { - if (layer_enable & 0x04) draw_layer(DrvVidRAM1 + 0x0000, DrvGfxROM2, 2, 1, x_1, y_1); - if (layer_enable & 0x08) draw_layer(DrvVidRAM1 + 0x2000, DrvGfxROM2, 2, 1, x_1, y_1); - - if ((order & 2) == 2) draw_sprites(); - - if (layer_enable & 0x01) draw_layer(DrvVidRAM0 + 0x0000, DrvGfxROM1, 1, 0, x_0, y_0); - if (layer_enable & 0x02) draw_layer(DrvVidRAM0 + 0x2000, DrvGfxROM1, 1, 0, x_0, y_0); - - if ((order & 2) == 0) draw_sprites(); - } - else - { - if (layer_enable & 0x01) draw_layer(DrvVidRAM0 + 0x0000, DrvGfxROM1, 1, 1, x_0, y_0); - if (layer_enable & 0x02) draw_layer(DrvVidRAM0 + 0x2000, DrvGfxROM1, 1, 1, x_0, y_0); - - if ((order & 2) == 2) draw_sprites(); - - if (layer_enable & 0x04) draw_layer(DrvVidRAM1 + 0x0000, DrvGfxROM2, 2, 0, x_1, y_1); - if (layer_enable & 0x08) draw_layer(DrvVidRAM1 + 0x2000, DrvGfxROM2, 2, 0, x_1, y_1); - - if ((order & 2) == 0) draw_sprites(); - } -} - -static INT32 setaNoLayersDraw() -{ - DrvPaletteRecalc(); - - BurnTransferClear(); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 seta1layerDraw() -{ - DrvPaletteRecalc(); - - seta_update(0, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 seta2layerDraw() -{ - DrvPaletteRecalc(); - - seta_update(1, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 zombraidDraw() -{ - seta2layerDraw(); - - for (INT32 i = 0; i < BurnDrvGetMaxPlayers(); i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } - - return 0; -} - -static INT32 seta2layerFlippedDraw() -{ - DrvPaletteRecalc(); - - seta_update(1, 0); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void irq_generator(INT32 loop) -{ - if (loop != 4 && loop != 9) return; - - loop = (loop / 5) & 1; - - INT32 line = (irqtype >> (loop * 8)) & 0xff; - if (line & 0x80) return; - - SekSetIRQLine(line, CPU_IRQSTATUS_AUTO); -} - -static void sprite_buffer() -{ - if ((DrvSprRAM0[0x602] & 0x20) == 0) - { - if (DrvSprRAM0[0x602] & 0x40) { - memcpy (DrvSprRAM1 + 0x0000, DrvSprRAM1 + 0x2000, 0x2000); - } else { - memcpy (DrvSprRAM1 + 0x2000, DrvSprRAM1 + 0x0000, 0x2000); - } - } -} - -static INT32 DrvCommonFrame(void (*pFrameCallback)()) -{ - if (DrvReset) { - DrvDoReset(1); - } - - if (watchdog_enable) { - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - } - - { - memset (DrvInputs, 0xff, 7 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy6[i] & 1) << i; - DrvInputs[6] ^= (DrvJoy7[i] & 1) << i; - } - - if (game_rotates) { - SuperJoy2Rotate(); - } - - if (trackball_mode) trackball_input_tick(); - - BurnGunMakeInputs(0, (INT16)DrvAxis[0], (INT16)DrvAxis[1]); // zombraid - BurnGunMakeInputs(1, (INT16)DrvAxis[2], (INT16)DrvAxis[3]); - - float xRatio = (float)128 / 384; - float yRatio = (float)96 / 224; - - for (INT32 i = 0; i < 2; i++) { - INT32 x = BurnGunX[i] >> 8; - INT32 y = BurnGunY[i] >> 8; - - x = (INT32)(x * xRatio); - y = (INT32)(y * yRatio); - - x -= 0xbe; - y += 0x48; - - DrvAnalogInput[0 + (i * 2)] = (UINT8)~x; - DrvAnalogInput[1 + (i * 2)] = (UINT8)y; - } - } - - pFrameCallback(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - if (buffer_sprites) { - sprite_buffer(); - } - - return 0; -} - -static void Drv68kmsgundam() -{ - INT32 nInterleave = 10; - INT32 nCyclesTotal[1] = { (cpuspeed * 100) / refresh_rate }; - INT32 nCyclesDone[1] = { 0 }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - if (i == 4 && nCurrentFrame & 2) - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - if (i == (nInterleave - 1)) - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - SekClose(); - - if (pBurnSoundOut) { - x1010_sound_update(); - } -} - -static void Drv68kNoSubFrameCallback() -{ - INT32 nInterleave = 10; - INT32 nCyclesTotal[1] = { (cpuspeed * 100) / refresh_rate }; - INT32 nCyclesDone[1] = { 0 }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - irq_generator(i); - } - - SekClose(); - - if (pBurnSoundOut) { - x1010_sound_update(); - } -} - -static INT32 DrvFrame() -{ - return DrvCommonFrame(Drv68kNoSubFrameCallback); -} - -static INT32 DrvFrameMsgundam() -{ - return DrvCommonFrame(Drv68kmsgundam); -} - -static void Drv68k_Calibr50_FrameCallback() -{ - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { (8000000 * 100) / refresh_rate, (2000000 * 100) / refresh_rate}; //(cpuspeed * 100) / refresh_rate, ((cpuspeed/4) * 100) / refresh_rate}; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - M6502Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - if (i == 240) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if ((i%64) == 63) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - nCyclesDone[1] += M6502Run(nCyclesTotal[1] / nInterleave); - if (usclssic) { - if (i == 240) M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } else {// calibr50 - if ((i%64) == 63) M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - } - - SekClose(); - M6502Close(); - - if (pBurnSoundOut) { - x1010_sound_update(); - } -} - -static void Drv68k_KM_FrameCallback() // kamenrid & madshark -{ - INT32 nInterleave = 10; - INT32 nCyclesTotal[1] = { (cpuspeed * 100) / refresh_rate }; - INT32 nCyclesDone[1] = { 0 }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - if (i & 1 && i == 1) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - if (flipflop==0) { // IRQ4 is fired every other frame - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - flipflop=1; - } else { - flipflop=0; - } - - SekClose(); - - if (pBurnSoundOut) { - x1010_sound_update(); - } -} - -static void Drv68k_Twineagl_FrameCallback() -{ - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { (cpuspeed * 100) / refresh_rate, (2000000 * 100) / refresh_rate }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - SekOpen(0); - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - irq_generator(i); - SekClose(); - - M6502Open(0); - M6502Run(nCyclesTotal[1] / nInterleave); - if (i == 4) M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - if (i == 9) M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6502Close(); - } - - if (pBurnSoundOut) { - x1010_sound_update(); - } -} - -static void Drv68k_Downtown_FrameCallback() -{ - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { (cpuspeed * 100) / refresh_rate, (2000000 * 100) / refresh_rate }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - SekOpen(0); - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - irq_generator(i); - SekClose(); - - M6502Open(0); - M6502Run(nCyclesTotal[1] / nInterleave); - if (i == 4) M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - if (i == 9) M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - M6502Close(); - } - - if (pBurnSoundOut) { - x1010_sound_update(); - } -} - -static void Drv68k_Tndrcade_FrameCallback() -{ - INT32 nInterleave = 16; - INT32 nCyclesTotal[2] = { (cpuspeed * 100) / refresh_rate, (2000000 * 100) / refresh_rate }; - - SekNewFrame(); - M6502NewFrame(); - - SekOpen(0); - M6502Open(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - BurnTimerUpdateYM3812((i+1) * (nCyclesTotal[0] / nInterleave)); - if (i == (nInterleave-1)) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - BurnTimerUpdate((i+1) * (nCyclesTotal[1] / nInterleave)); - if (i == 4) M6502SetIRQLine(0x20, CPU_IRQSTATUS_AUTO); - M6502SetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[0]); - BurnTimerEndFrame(nCyclesTotal[1]); - SekClose(); - M6502Close(); - - if (pBurnSoundOut) { - SekOpen(0); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - SekClose(); - M6502Open(0); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - M6502Close(); - } -} - -static INT32 DrvKMFrame() -{ - return DrvCommonFrame(Drv68k_KM_FrameCallback); -} - -static INT32 DrvCalibr50Frame() -{ - return DrvCommonFrame(Drv68k_Calibr50_FrameCallback); -} - -static INT32 DrvTwineaglFrame() -{ - return DrvCommonFrame(Drv68k_Twineagl_FrameCallback); -} - -static INT32 DrvDowntownFrame() -{ - return DrvCommonFrame(Drv68k_Downtown_FrameCallback); -} - -static INT32 DrvTndrcadeFrame() -{ - return DrvCommonFrame(Drv68k_Tndrcade_FrameCallback); -} - -static void Drv68kNoSubM6295FrameCallback() -{ - INT32 nInterleave = 10; - INT32 nCyclesTotal[1] = { (cpuspeed * 100) / refresh_rate }; - INT32 nCyclesDone[1] = { 0 }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - irq_generator(i); - } - - SekClose(); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } -} - -static INT32 DrvM6295Frame() -{ - return DrvCommonFrame(Drv68kNoSubM6295FrameCallback); -} - -static void Drv68kZ80M6295FrameCallback() -{ - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { (cpuspeed * 100) / refresh_rate, (4000000 * 100) / refresh_rate }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - irq_generator(i); - } - - ZetClose(); - SekClose(); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } -} - -static INT32 DrvZ80M6295Frame() -{ - return DrvCommonFrame(Drv68kZ80M6295FrameCallback); -} - - -static void Drv68kZ80YM3438FrameCallback() -{ - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { (cpuspeed * 100) / refresh_rate, (4000000 * 100) / refresh_rate }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - // nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - irq_generator(i); - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - x1010_sound_update(); - BurnYM3438Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - -} - -static INT32 Drv68kZ80YM3438Frame() -{ - return DrvCommonFrame(Drv68kZ80YM3438FrameCallback); -} - -static void CrzyfghtFrameCallback() -{ - INT32 nInterleave = 6; - INT32 nCyclesTotal[1] = { (cpuspeed * 100) / refresh_rate }; - - SekOpen(0); - - INT32 irq[6] = { 2, 2, 2, 2, 2, 1 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - //BurnTimerUpdateYM3812(nCyclesTotal[0] / nInterleave); - - SekRun(nCyclesTotal[0] / nInterleave); - - SekSetIRQLine(irq[i], CPU_IRQSTATUS_AUTO); - } - - BurnTimerUpdateEndYM3812(); - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - // BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); -} - -static INT32 CrazyfgtFrame() -{ - return DrvCommonFrame(CrzyfghtFrameCallback); -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029708; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_NVRAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = DrvNVRAM; - ba.nLen = 0x400; - ba.szName = "NV Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - if (m65c02_mode) { - M6502Scan(nAction); - } - - x1010_scan(nAction, pnMin); - BurnYM3812Scan(nAction, pnMin); - BurnYM3438Scan(nAction, pnMin); - if (has_2203) - BurnYM2203Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - SCAN_VAR(seta_samples_bank); - SCAN_VAR(usclssic_port_select); - SCAN_VAR(gun_input_bit); - SCAN_VAR(gun_input_src); - SCAN_VAR(m65c02_bank); - SCAN_VAR(sub_ctrl_data); - SCAN_VAR(flipflop); - } - - if (nAction & ACB_WRITE) { - INT32 tmpbank = seta_samples_bank; - seta_samples_bank = -1; - set_pcm_bank(tmpbank); - - if (m65c02_mode) { - M6502Open(0); - m65c02_sub_bankswitch(m65c02_bank); - M6502Close(); - } - } - - return 0; -} - - -//----------------------------------------------------------------------------------------------------------------- -// Nonworking games... - -// Visco Roulette - -static struct BurnRomInfo setaroulRomDesc[] = { - { "uf1002.u14", 0x10000, 0xb3a622b0, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "uf1003.u16", 0x10000, 0xa6afd769, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "uf0005.u3", 0x08000, 0x383c2d57, 0x03 | BRF_GRA }, // 2 Sprites - { "uf0006.u4", 0x08000, 0x90c9dae6, 0x03 | BRF_GRA }, // 3 - { "uf0007.u5", 0x08000, 0xe72c3dba, 0x03 | BRF_GRA }, // 4 - { "uf0008.u6", 0x08000, 0xe198e602, 0x03 | BRF_GRA }, // 5 - - { "uf0010.u15", 0x80000, 0x0af13a56, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - { "uf0009.u13", 0x80000, 0x20f2d7f5, 0x04 | BRF_GRA }, // 7 - { "uf0012.u29", 0x80000, 0xcba2a6b7, 0x04 | BRF_GRA }, // 8 - { "uf0011.u22", 0x80000, 0xaf60adf9, 0x04 | BRF_GRA }, // 9 - { "uf0014.u38", 0x80000, 0xda2bd4e4, 0x04 | BRF_GRA }, // 10 - { "uf0013.u37", 0x80000, 0x645ec3c3, 0x04 | BRF_GRA }, // 11 - { "uf0015.u40", 0x80000, 0x11dc19fa, 0x04 | BRF_GRA }, // 12 - { "uf0016.u48", 0x80000, 0x10f99fa8, 0x04 | BRF_GRA }, // 13 - - { "uf1004.u52", 0x20000, 0xd63ea334, 0x06 | BRF_SND }, // 14 x1-010 Samples - - { "ufo017.bin", 0x00200, 0xbf50c303, 0x00 | BRF_GRA }, // 15 Color Proms - { "ufo018.bin", 0x00200, 0x1c584d5f, 0x00 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(setaroul) -STD_ROM_FN(setaroul) - -static INT32 NotWorkingInit() -{ - return 1; -} - -struct BurnDriverD BurnDrvSetaroul = { - "setaroul", NULL, NULL, NULL, "198?", - "Visco Roulette\0", NULL, "Seta / Visco", "Seta", - NULL, NULL, NULL, NULL, - BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_CASINO, 0, - NULL, setaroulRomInfo, setaroulRomName, NULL, NULL, DrgnunitInputInfo, NULL, - NotWorkingInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0, - 240, 384, 3, 4 -}; - - -// International Toote (Germany) - -static struct BurnRomInfo inttooteRomDesc[] = { - { "p523.v01_horse_prog_2.002", 0x10000, 0x6ce6f1ad, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "p523.v01_horse_prog_1.003", 0x10000, 0x921fcff5, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ya_002_001.u18", 0x80000, 0xdd108016, 0x01 | BRF_PRG | BRF_ESS }, // 2 - - { "ya_011_004.u10", 0x80000, 0xeb74d2e0, 0x03 | BRF_GRA }, // 3 Sprites - { "ya_011_005.u17", 0x80000, 0x4a6c804b, 0x03 | BRF_GRA }, // 4 - { "ya_011_006.u22", 0x80000, 0xbfae01a5, 0x03 | BRF_GRA }, // 5 - { "ya_011_007.u27", 0x80000, 0x2dc7a294, 0x03 | BRF_GRA }, // 6 - { "p523.v01_horse_fore_1.u135", 0x10000, 0x3a75df30, 0x00 | BRF_GRA }, // 7 - { "p523.v01_horse_fore_2.u134", 0x10000, 0x26fb0339, 0x00 | BRF_GRA }, // 8 - { "p523.v01_horse_fore_3.u133", 0x10000, 0xc38596af, 0x00 | BRF_GRA }, // 9 - { "p523.v01_horse_fore_4.u132", 0x10000, 0x64ef345e, 0x00 | BRF_GRA }, // 10 - - { "ya_011_008.u35", 0x40000, 0x4b890f83, 0x04 | BRF_GRA }, // 11 Layer 1 tiles - { "p523.v01_horse_back_1.u137", 0x20000, 0x39b221ea, 0x04 | BRF_GRA }, // 12 - { "ya_011_009.u41", 0x40000, 0xcaa5e3c1, 0x04 | BRF_GRA }, // 13 - { "p523.v01_horse_back_2.u136", 0x20000, 0x9c5e32a0, 0x04 | BRF_GRA }, // 14 - - { "ya_011_013.u71", 0x80000, 0x2bccaf47, 0x06 | BRF_SND }, // 17 x1-010 Samples - { "ya_011_012.u64", 0x80000, 0xa8015ce6, 0x06 | BRF_SND }, // 18 - - { "ya-010.prom", 0x00200, 0x778094b3, 0x00 | BRF_GRA }, // 15 Color Proms - { "ya-011.prom", 0x00200, 0xbd4fe2f6, 0x00 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(inttoote) -STD_ROM_FN(inttoote) - -#if 0 -static void inttoote68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(DrvVidRAM0, 0xb00000, 0xb07fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xd00000, 0xd00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xe00000, 0xe03fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xffc000, 0xffffff, MAP_RAM); - - - SekMapHandler(1, 0x900000, 0x903fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - - BurnLoadRom(DrvGfxROM0 + 0x070000, 7, 1); - BurnLoadRom(DrvGfxROM0 + 0x0f0000, 8, 1); - BurnLoadRom(DrvGfxROM0 + 0x170000, 9, 1); - BurnLoadRom(DrvGfxROM0 + 0x1f0000, 10, 1); -} - -static INT32 inttooteInit() -{ - DrvSetColorOffsets(0, 0, 0); - DrvSetVideoOffsets(1, 1, -1, -1); - - return DrvInit(inttoote68kInit, 16000000, SET_IRQLINES(0x80, 0x80) /* Custom */, NO_SPRITE_BUFFER, SET_GFX_DECODE(5, 1, -1)); -} -#endif - -struct BurnDriverD BurnDrvInttoote = { - "inttoote", "jockeyc", NULL, NULL, "1998", - "International Toote (Germany)\0", NULL, "Coinmaster", "Seta", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_SETA1, GBF_CASINO, 0, - NULL, inttooteRomInfo, inttooteRomName, NULL, NULL, DrgnunitInputInfo, NULL, - NotWorkingInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0, - 384, 240, 4, 3 -}; - - -// International Toote II (World?) - -static struct BurnRomInfo inttooteaRomDesc[] = { - { "p387.v01_horse_prog_2.002", 0x10000, 0x1ced885e, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "p387.v01_horse_prog_1.003", 0x10000, 0xe24592af, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ya_002_001.u18", 0x80000, 0xdd108016, 0x01 | BRF_PRG | BRF_ESS }, // 2 - - { "ya_011_004.u10", 0x80000, 0xeb74d2e0, 0x03 | BRF_GRA }, // 3 Sprites - { "ya_011_005.u17", 0x80000, 0x4a6c804b, 0x03 | BRF_GRA }, // 4 - { "ya_011_006.u22", 0x80000, 0xbfae01a5, 0x03 | BRF_GRA }, // 5 - { "ya_011_007.u27", 0x80000, 0x2dc7a294, 0x03 | BRF_GRA }, // 6 - { "p523.v01_horse_fore_1.u135", 0x10000, 0x3a75df30, 0x00 | BRF_GRA }, // 7 - { "p523.v01_horse_fore_2.u134", 0x10000, 0x26fb0339, 0x00 | BRF_GRA }, // 8 - { "p523.v01_horse_fore_3.u133", 0x10000, 0xc38596af, 0x00 | BRF_GRA }, // 9 - { "p523.v01_horse_fore_4.u132", 0x10000, 0x64ef345e, 0x00 | BRF_GRA }, // 10 - - { "ya_011_008.u35", 0x40000, 0x4b890f83, 0x04 | BRF_GRA }, // 11 Layer 1 tiles - { "p523.v01_horse_back_1.u137", 0x20000, 0x39b221ea, 0x04 | BRF_GRA }, // 12 - { "ya_011_009.u41", 0x40000, 0xcaa5e3c1, 0x04 | BRF_GRA }, // 13 - { "p523.v01_horse_back_2.u136", 0x20000, 0x9c5e32a0, 0x04 | BRF_GRA }, // 14 - - { "ya_011_013.u71", 0x80000, 0x2bccaf47, 0x06 | BRF_SND }, // 17 x1-010 Samples - { "ya_011_012.u64", 0x80000, 0xa8015ce6, 0x06 | BRF_SND }, // 18 - - { "ya-010.prom", 0x00200, 0x778094b3, 0x00 | BRF_GRA }, // 15 Color Proms - { "ya-011.prom", 0x00200, 0xbd4fe2f6, 0x00 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(inttootea) -STD_ROM_FN(inttootea) - -struct BurnDriverD BurnDrvInttootea = { - "inttootea", "jockeyc", NULL, NULL, "1993", - "International Toote II (World?)\0", NULL, "Coinmaster", "Seta", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_SETA1, GBF_CASINO, 0, - NULL, inttooteaRomInfo, inttooteaRomName, NULL, NULL, DrgnunitInputInfo, NULL, - NotWorkingInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0, - 384, 240, 4, 3 -}; - - -//----------------------------------------------------------------------------------------------------------------- -// Working games - - -// Dragon Unit / Castle of Dragon - -static struct BurnRomInfo drgnunitRomDesc[] = { - { "prg-e.bin", 0x20000, 0x728447df, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "prg-o.bin", 0x20000, 0xb2f58ecf, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "obj-2.bin", 0x20000, 0xd7f6ab5a, 0x0b | BRF_GRA }, // 2 Sprites - { "obj-1.bin", 0x20000, 0x53a95b13, 0x0b | BRF_GRA }, // 3 - { "obj-6.bin", 0x20000, 0x80b801f7, 0x0b | BRF_GRA }, // 4 - { "obj-5.bin", 0x20000, 0x6b87bc20, 0x0b | BRF_GRA }, // 5 - { "obj-4.bin", 0x20000, 0x60d17771, 0x0b | BRF_GRA }, // 6 - { "obj-3.bin", 0x20000, 0x0bccd4d5, 0x0b | BRF_GRA }, // 7 - { "obj-8.bin", 0x20000, 0x826c1543, 0x0b | BRF_GRA }, // 8 - { "obj-7.bin", 0x20000, 0xcbaa7f6a, 0x0b | BRF_GRA }, // 9 - - { "scr-1o.bin", 0x20000, 0x671525db, 0x04 | BRF_GRA }, // 10 Layer 1 tiles - { "scr-2o.bin", 0x20000, 0x2a3f2ed8, 0x04 | BRF_GRA }, // 11 - { "scr-3o.bin", 0x20000, 0x4d33a92d, 0x04 | BRF_GRA }, // 12 - { "scr-4o.bin", 0x20000, 0x79a0aa61, 0x04 | BRF_GRA }, // 13 - { "scr-1e.bin", 0x20000, 0xdc9cd8c9, 0x04 | BRF_GRA }, // 14 - { "scr-2e.bin", 0x20000, 0xb6126b41, 0x04 | BRF_GRA }, // 15 - { "scr-3e.bin", 0x20000, 0x1592b8c2, 0x04 | BRF_GRA }, // 16 - { "scr-4e.bin", 0x20000, 0x8201681c, 0x04 | BRF_GRA }, // 17 - - { "snd-1.bin", 0x20000, 0x8f47bd0d, 0x06 | BRF_SND }, // 18 x1-010 Samples - { "snd-2.bin", 0x20000, 0x65c40ef5, 0x06 | BRF_SND }, // 19 - { "snd-3.bin", 0x20000, 0x71fbd54e, 0x06 | BRF_SND }, // 20 - { "snd-4.bin", 0x20000, 0xac50133f, 0x06 | BRF_SND }, // 21 - { "snd-5.bin", 0x20000, 0x70652f2c, 0x06 | BRF_SND }, // 22 - { "snd-6.bin", 0x20000, 0x10a1039d, 0x06 | BRF_SND }, // 23 - { "snd-7.bin", 0x20000, 0xdecbc8b0, 0x06 | BRF_SND }, // 24 - { "snd-8.bin", 0x20000, 0x3ac51bee, 0x06 | BRF_SND }, // 25 -}; - -STD_ROM_PICK(drgnunit) -STD_ROM_FN(drgnunit) - -static INT32 drgnunitInit() -{ - DrvSetColorOffsets(0, 0, 0); - DrvSetVideoOffsets(2, 2, -2, -2); - - return DrvInit(drgnunit68kInit, 8000000, SET_IRQLINES(1, 2), SPRITE_BUFFER, SET_GFX_DECODE(0, 1, -1)); -} - -struct BurnDriver BurnDrvDrgnunit = { - "drgnunit", NULL, NULL, NULL, "1989", - "Dragon Unit / Castle of Dragon\0", NULL, "Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_SCRFIGHT, 0, - NULL, drgnunitRomInfo, drgnunitRomName, NULL, NULL, DrgnunitInputInfo, DrgnunitDIPInfo, - drgnunitInit, DrvExit, DrvFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; - - -// Quiz Kokology - -static struct BurnRomInfo qzkklogyRomDesc[] = { - { "3.u27", 0x20000, 0xb8c27cde, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "1.u9", 0x20000, 0xce01cd54, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "4.u33", 0x20000, 0x4f5c554c, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "2.u17", 0x20000, 0x65fa1b8d, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "t2709u32.u32", 0x80000, 0x900f196c, 0x03 | BRF_GRA }, // 4 Sprites - { "t2709u26.u26", 0x80000, 0x416ac849, 0x03 | BRF_GRA }, // 5 - - { "t2709u42.u39", 0x80000, 0x194d5704, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - { "t2709u39.u42", 0x80000, 0x6f95a76d, 0x04 | BRF_GRA }, // 7 - - { "t2709u47.u47", 0x80000, 0x0ebdad40, 0x06 | BRF_SND }, // 8 x1-010 Samples - { "t2709u55.u55", 0x80000, 0x43960c68, 0x06 | BRF_SND }, // 9 -}; - -STD_ROM_PICK(qzkklogy) -STD_ROM_FN(qzkklogy) - -static INT32 qzkklogyInit() -{ - DrvSetColorOffsets(0, 0, 0); - DrvSetVideoOffsets(1, 1, -1, -1); - - return DrvInit(drgnunit68kInit, 8000000, SET_IRQLINES(1, 2), SPRITE_BUFFER, SET_GFX_DECODE(0, 1, -1)); -} - -struct BurnDriver BurnDrvQzkklogy = { - "qzkklogy", NULL, NULL, NULL, "1992", - "Quiz Kokology\0", NULL, "Tecmo", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_QUIZ, 0, - NULL, qzkklogyRomInfo, qzkklogyRomName, NULL, NULL, QzkklogyInputInfo, QzkklogyDIPInfo, - qzkklogyInit, DrvExit, DrvFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; - - -// Strike Gunner S.T.G - -static struct BurnRomInfo stgRomDesc[] = { - { "att01003.u27", 0x20000, 0x7a640a93, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "att01001.u9", 0x20000, 0x4fa88ad3, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "att01004.u33", 0x20000, 0xbbd45ca1, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "att01002.u17", 0x20000, 0x2f8fd80c, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "att01006.u32", 0x80000, 0x6ad78ea2, 0x03 | BRF_GRA }, // 4 Sprites - { "att01005.u26", 0x80000, 0xa347ff00, 0x03 | BRF_GRA }, // 5 - - { "att01008.u39", 0x80000, 0x20c47457, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - { "att01007.u42", 0x80000, 0xac975544, 0x04 | BRF_GRA }, // 7 - - { "att01009.u47", 0x80000, 0x4276b58d, 0x06 | BRF_SND }, // 8 x1-010 Samples - { "att01010.u55", 0x80000, 0xfffb2f53, 0x06 | BRF_SND }, // 9 -}; - -STD_ROM_PICK(stg) -STD_ROM_FN(stg) - -static INT32 stgInit() -{ - DrvSetColorOffsets(0, 0, 0); - DrvSetVideoOffsets(0, 0, -2, -2); - - return DrvInit(drgnunit68kInit, 8000000, SET_IRQLINES(2, 1), SPRITE_BUFFER, SET_GFX_DECODE(0, 1, -1)); -} - -struct BurnDriver BurnDrvStg = { - "stg", NULL, NULL, NULL, "1991", - "Strike Gunner S.T.G\0", NULL, "Athena / Tecmo", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, stgRomInfo, stgRomName, NULL, NULL, StgInputInfo, StgDIPInfo, - stgInit, DrvExit, DrvFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 240, 384, 3, 4 -}; - - -// Quiz Kokology 2 - -static struct BurnRomInfo qzkklgy2RomDesc[] = { - { "fn001001.106", 0x080000, 0x7bf8eb17, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fn001003.107", 0x040000, 0xee6ef111, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fn001004.100", 0x100000, 0x5ba139a2, 0x03 | BRF_GRA }, // 2 Sprites - - { "fn001005.104", 0x200000, 0x95726a63, 0x04 | BRF_GRA }, // 3 Layer 1 tiles - - { "fn001006.105", 0x100000, 0x83f201e6, 0x06 | BRF_SND }, // 4 x1-010 Samples -}; - -STD_ROM_PICK(qzkklgy2) -STD_ROM_FN(qzkklgy2) - -static INT32 qzkklgy2Init() -{ - DrvSetColorOffsets(0, 0, 0); - DrvSetVideoOffsets(0, 0, -1, -3); - - return DrvInit(drgnunit68kInit, 16000000, SET_IRQLINES(1, 2), SPRITE_BUFFER, SET_GFX_DECODE(0, 2, -1)); -} - -struct BurnDriver BurnDrvQzkklgy2 = { - "qzkklgy2", NULL, NULL, NULL, "1993", - "Quiz Kokology 2\0", NULL, "Tecmo", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_QUIZ, 0, - NULL, qzkklgy2RomInfo, qzkklgy2RomName, NULL, NULL, Qzkklgy2InputInfo, Qzkklgy2DIPInfo, - qzkklgy2Init, DrvExit, DrvFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; - - -/* -The changes between the set daioh and daioha are very minimal, the main game effects are: - - - Fixes the crashing bug in the US version caused by pressing Shot1 and Shot2 in weird orders and timings. - - 1UP, and 2UPs no longer spawn "randomly". (Only the fixed extend items exist, and the 1UPs from score) - - After picking up a max powerup, a 1UP or a 2UP, daoiha sets the "item timer" to a random value. - daioh always sets it to 0x7F. - - The powerups spawned from picking up an additional max powerup are no longer random, but feeds from the - original "spawn item" function (thus, it advances the "item timer") - -So it's a bug fix version which also makes the game a little harder by limiting the spawning of 1ups -*/ - -// Daioh - -static struct BurnRomInfo daiohRomDesc[] = { - { "fg001001.u3", 0x080000, 0xe1ef3007, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fg001002.u4", 0x080000, 0x5e3481f9, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fg-001-004", 0x100000, 0x9ab0533e, 0x03 | BRF_GRA }, // 2 Sprites - { "fg-001-003", 0x100000, 0x1c9d51e2, 0x03 | BRF_GRA }, // 3 - - { "fg-001-005", 0x200000, 0xc25159b9, 0x04 | BRF_GRA }, // 4 Layer 1 tiles - - { "fg-001-006", 0x200000, 0x2052c39a, 0x05 | BRF_GRA }, // 5 Layer 2 tiles - - { "fg-001-007", 0x100000, 0x4a2fe9e0, 0x06 | BRF_SND }, // 6 x1-010 Samples -}; - -STD_ROM_PICK(daioh) -STD_ROM_FN(daioh) - -static INT32 daiohInit() -{ - DrvSetVideoOffsets(1, 1, -1, -1); - DrvSetColorOffsets(0, 0x400, 0x200); - - return DrvInit(daioh68kInit, 16000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); -} - -struct BurnDriver BurnDrvDaioh = { - "daioh", NULL, NULL, NULL, "1993", - "Daioh\0", NULL, "Athena", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, daiohRomInfo, daiohRomName, NULL, NULL, DaiohInputInfo, DaiohDIPInfo, - daiohInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 240, 384, 3, 4 -}; - - -// Daioh (earlier) - -static struct BurnRomInfo daiohaRomDesc[] = { - { "fg-001-001.u3", 0x080000, 0x104ae74a, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fg-001-002.u4", 0x080000, 0xe39a4e67, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fg-001-004", 0x100000, 0x9ab0533e, 0x03 | BRF_GRA }, // 2 Sprites - { "fg-001-003", 0x100000, 0x1c9d51e2, 0x03 | BRF_GRA }, // 3 - - { "fg-001-005", 0x200000, 0xc25159b9, 0x04 | BRF_GRA }, // 4 Layer 1 tiles - - { "fg-001-006", 0x200000, 0x2052c39a, 0x05 | BRF_GRA }, // 5 Layer 2 tiles - - { "fg-001-007", 0x100000, 0x4a2fe9e0, 0x06 | BRF_SND }, // 6 x1-010 Samples -}; - -STD_ROM_PICK(daioha) -STD_ROM_FN(daioha) - -struct BurnDriver BurnDrvDaioha = { - "daioha", "daioh", NULL, NULL, "1993", - "Daioh (earlier)\0", NULL, "Athena", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, daiohaRomInfo, daiohaRomName, NULL, NULL, DaiohInputInfo, DaiohDIPInfo, - daiohInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 240, 384, 3, 4 -}; - - -// Daioh (prototype) - -static struct BurnRomInfo daiohpRomDesc[] = { - { "prg_even.u3", 0x040000, 0x3c97b976, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "prg_odd.u4", 0x040000, 0xaed2b87e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "data_even.u103", 0x040000, 0xe07776ef, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "data_odd.u102", 0x040000, 0xb75b9a5c, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "obj_2.u146", 0x040000, 0x77560a03, 0x03 | BRF_GRA }, // 4 Sprites - { "obj_6.u147", 0x040000, 0x081f5fb1, 0x03 | BRF_GRA }, // 5 - { "obj_3.u144", 0x040000, 0xd33ca640, 0x03 | BRF_GRA }, // 6 - { "obj_7.u145", 0x040000, 0xe878ac92, 0x03 | BRF_GRA }, // 7 - { "obj_0.u142", 0x040000, 0x78f45582, 0x03 | BRF_GRA }, // 8 - { "obj_4.u143", 0x040000, 0xd387de72, 0x03 | BRF_GRA }, // 9 - { "obj_1.u140", 0x040000, 0x8ff6c5a9, 0x03 | BRF_GRA }, // 10 - { "obj_5.u141", 0x040000, 0x6a671757, 0x03 | BRF_GRA }, // 11 - - { "bg1_1.u150", 0x080000, 0xd5793a2f, 0x04 | BRF_GRA }, // 12 Layer 1 tiles - { "bg1_3.u151", 0x080000, 0x6456fae1, 0x04 | BRF_GRA }, // 13 - { "bg1_0.u148", 0x080000, 0xbec48d7a, 0x04 | BRF_GRA }, // 14 - { "bg1_2.u149", 0x080000, 0x5e674c30, 0x04 | BRF_GRA }, // 15 - - { "bg2_1.u166", 0x080000, 0x9274123b, 0x05 | BRF_GRA }, // 16 Layer 2 tiles - { "bg2_3.u167", 0x080000, 0xd3d68aa1, 0x05 | BRF_GRA }, // 17 - { "bg2_0.u164", 0x080000, 0x7e46a10e, 0x05 | BRF_GRA }, // 18 - { "bg2_2.u165", 0x080000, 0x3119189b, 0x05 | BRF_GRA }, // 19 - - { "snd0.u156", 0x020000, 0x4d253547, 0x06 | BRF_SND }, // 20 x1-010 Samples - { "snd1.u157", 0x020000, 0x79b56e22, 0x06 | BRF_SND }, // 21 - { "snd2.u158", 0x020000, 0xbc8de02a, 0x06 | BRF_SND }, // 22 - { "snd3.u159", 0x020000, 0x939777fd, 0x06 | BRF_SND }, // 23 - { "snd4.u160", 0x020000, 0x7b97716d, 0x06 | BRF_SND }, // 24 - { "snd5.u161", 0x020000, 0x294e1cc9, 0x06 | BRF_SND }, // 25 - { "snd6.u162", 0x020000, 0xecab073b, 0x06 | BRF_SND }, // 26 - { "snd7.u163", 0x020000, 0x1b7ea768, 0x06 | BRF_SND }, // 27 - - { "con1x.u35", 0x000104, 0xce8b57d9, 0x00 | BRF_OPT }, // 28 Pals - { "con2x.u36", 0x000104, 0x0b18db9e, 0x00 | BRF_OPT }, // 29 - { "dec1x.u14", 0x000104, 0xd197abfe, 0x00 | BRF_OPT }, // 30 - { "dec2x.u206", 0x000104, 0x35afbba8, 0x00 | BRF_OPT }, // 31 - { "pcon2.u110", 0x000104, 0x082882c2, 0x00 | BRF_OPT }, // 32 - { "sc.u116", 0x000104, 0xe57bfde9, 0x00 | BRF_OPT }, // 33 -}; - -STD_ROM_PICK(daiohp) -STD_ROM_FN(daiohp) - -static INT32 daiohpInit() -{ - DrvSetVideoOffsets(1, 1, -1, -1); - DrvSetColorOffsets(0, 0x400, 0x200); - - INT32 nRet = DrvInit(daiohp68kInit, 16000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(5, 1, 1)); - - if (nRet == 0) { - memcpy (Drv68KROM + 0x100000, Drv68KROM + 0x080000, 0x080000); - memcpy (Drv68KROM + 0x180000, Drv68KROM + 0x080000, 0x080000); - memcpy (Drv68KROM + 0x080000, Drv68KROM + 0x000000, 0x080000); - } - - return nRet; -} - -struct BurnDriver BurnDrvDaiohp = { - "daiohp", "daioh", NULL, NULL, "1993", - "Daioh (prototype)\0", NULL, "Athena", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, daiohpRomInfo, daiohpRomName, NULL, NULL, DaiohInputInfo, DaiohDIPInfo, - daiohpInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 240, 384, 3, 4 -}; - - -// Daioh (93111A PCB conversion) -/* Found on a 93111A PCB - same PCB as War of Areo & J. J. Squawkers */ - -static struct BurnRomInfo daiohcRomDesc[] = { - { "15.u3", 0x080000, 0x14616abb, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "14.u4", 0x080000, 0xa029f991, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "9.u9", 0x080000, 0x4444cbd4, 0x03 | BRF_GRA }, // 2 Sprites - { "10.u10", 0x080000, 0x1d88d20b, 0x03 | BRF_GRA }, // 3 - { "11.u11", 0x080000, 0x3e41de61, 0x03 | BRF_GRA }, // 4 - { "12.u12", 0x080000, 0xf35e3341, 0x03 | BRF_GRA }, // 5 - - { "5.u5", 0x080000, 0xaaa5e41e, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - { "6.u6", 0x080000, 0x9ad8b4b4, 0x04 | BRF_GRA }, // 7 - { "7.u7", 0x080000, 0xbabf194a, 0x04 | BRF_GRA }, // 8 - { "8.u8", 0x080000, 0x2db65290, 0x04 | BRF_GRA }, // 9 - - { "1.u1", 0x080000, 0x30f81f99, 0x05 | BRF_GRA }, // 10 Layer 2 tiles - { "2.u2", 0x080000, 0x3b3e0f4e, 0x05 | BRF_GRA }, // 11 - { "3.u3", 0x080000, 0xc5eef1c1, 0x05 | BRF_GRA }, // 12 - { "4.u4", 0x080000, 0x851115b6, 0x05 | BRF_GRA }, // 13 - - { "data.u69", 0x080000, 0x21e4f093, 0x06 | BRF_SND }, // 14 x1-010 Samples - { "data.u70", 0x080000, 0x593c3c58, 0x06 | BRF_SND }, // 15 - - { "gal.u14", 0x000117, 0xb972b479, 0x00 | BRF_OPT }, // 16 Gals -}; - -STD_ROM_PICK(daiohc) -STD_ROM_FN(daiohc) - -static INT32 daiohcInit() -{ - daiohc = 1; - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0x400, 0x200); - - INT32 nRet = DrvInit(wrofaero68kInit, 16000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); - - if (nRet == 0) { - memcpy (Drv68KROM + 0x100000, Drv68KROM + 0x080000, 0x080000); - memset (Drv68KROM + 0x080000, 0, 0x080000); - } - - return nRet; -} - -struct BurnDriver BurnDrvDaiohc = { - "daiohc", "daioh", NULL, NULL, "1993", - "Daioh (93111A PCB conversion)\0", NULL, "Athena", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, daiohcRomInfo, daiohcRomName, NULL, NULL, DaiohInputInfo, DaiohDIPInfo, - daiohcInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 240, 384, 3, 4 -}; - - -// Rezon - -static struct BurnRomInfo rezonRomDesc[] = { - { "us001001.u3", 0x020000, 0xab923052, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "us001002.u4", 0x020000, 0x3dafa0d5, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "us001004.103", 0x020000, 0x54871c7c, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "us001003.102", 0x020000, 0x1ac3d272, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "us001006.u64", 0x080000, 0xa4916e96, 0x03 | BRF_GRA }, // 4 Sprites - { "us001005.u63", 0x080000, 0xe6251ebc, 0x03 | BRF_GRA }, // 5 - - { "us001007.u66", 0x080000, 0x3760b935, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - - { "us001008.u68", 0x080000, 0x0ab73910, 0x05 | BRF_GRA }, // 7 Layer 2 tiles - - { "us001009.u70", 0x100000, 0x0d7d2e2b, 0x06 | BRF_SND }, // 8 x1-010 Samples -}; - -STD_ROM_PICK(rezon) -STD_ROM_FN(rezon) - -static INT32 rezonInit() -{ - DrvSetVideoOffsets(0, 0, -2, -2); - DrvSetColorOffsets(0, 0x400, 0x200); - - INT32 nRet = DrvInit(wrofaero68kInit, 16000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); - - if (nRet == 0) { - memcpy (Drv68KROM + 0x100000, Drv68KROM + 0x040000, 0x040000); - memset (Drv68KROM + 0x040000, 0, 0x40000); - BurnByteswap(DrvSndROM, 0x100000); - } - - return nRet; -} - -struct BurnDriver BurnDrvRezon = { - "rezon", NULL, NULL, NULL, "1991", - "Rezon\0", NULL, "Allumer", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_HORSHOOT, 0, - NULL, rezonRomInfo, rezonRomName, NULL, NULL, RezonInputInfo, RezonDIPInfo, - rezonInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 384, 240, 4, 3 -}; - -/* note the ONLY byte that changes is the year, 1992 instead of 1991. The actual license is controlled by a jumper but - since Taito released the game in 1992 this is the Taito version and we hardcode the jumper in the input ports */ - -// Rezon (Taito) - -static struct BurnRomInfo rezontRomDesc[] = { - { "us001001.u3", 0x020000, 0xab923052, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "rezon_1_p.u4", 0x020000, 0x9ed32f8c, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "us001004.103", 0x020000, 0x54871c7c, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "us001003.102", 0x020000, 0x1ac3d272, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "us001006.u64", 0x080000, 0xa4916e96, 0x03 | BRF_GRA }, // 4 Sprites - { "us001005.u63", 0x080000, 0xe6251ebc, 0x03 | BRF_GRA }, // 5 - - { "us001007.u66", 0x080000, 0x3760b935, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - - { "us001008.u68", 0x080000, 0x0ab73910, 0x05 | BRF_GRA }, // 7 Layer 2 tiles - - { "us001009.u70", 0x100000, 0x0d7d2e2b, 0x06 | BRF_SND }, // 8 x1-010 Samples -}; - -STD_ROM_PICK(rezont) -STD_ROM_FN(rezont) - -struct BurnDriver BurnDrvRezont = { - "rezont", "rezon", NULL, NULL, "1992", - "Rezon (Taito)\0", NULL, "Allumer (Taito license)", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA1, GBF_HORSHOOT, 0, - NULL, rezontRomInfo, rezontRomName, NULL, NULL, RezonInputInfo, RezonDIPInfo, - rezonInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 384, 240, 4, 3 -}; - - -// Eight Forces - -static struct BurnRomInfo eightfrcRomDesc[] = { - { "uy2-u4.u3", 0x040000, 0xf1f249c5, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "uy2-u3.u4", 0x040000, 0x6f2d8618, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "u64.bin", 0x080000, 0xf561ff2e, 0x03 | BRF_GRA }, // 2 Sprites - { "u63.bin", 0x080000, 0x4c3f8366, 0x03 | BRF_GRA }, // 3 - - { "u66.bin", 0x100000, 0x6fad2b7f, 0x04 | BRF_GRA }, // 4 Layer 1 tiles - - { "u68.bin", 0x100000, 0xc17aad22, 0x05 | BRF_GRA }, // 5 Layer 2 tiles - - { "u70.bin", 0x100000, 0xdfdb67a3, 0x06 | BRF_SND }, // 6 x1-010 Samples - { "u69.bin", 0x100000, 0x82ec08f1, 0x06 | BRF_SND }, // 7 -}; - -STD_ROM_PICK(eightfrc) -STD_ROM_FN(eightfrc) - -static INT32 eightfrcInit() -{ - DrvSetVideoOffsets(3, 4, 0, 0); - DrvSetColorOffsets(0, 0x400, 0x200); - - INT32 nRet = DrvInit(wrofaero68kInit, 16000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); - - if (nRet == 0) { - // Update sample length to include the banked section that was skipped (0xc0000 - 0xfffff) - DrvROMLen[3] = 0x240000; - memmove(DrvSndROM + 0x100000, DrvSndROM + 0x0c0000, 0x140000); // sound banks (memcpy fails because of overlap!) - x1010_set_route(BURN_SND_X1010_ROUTE_2, 2.00, BURN_SND_ROUTE_RIGHT); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 2.00, BURN_SND_ROUTE_LEFT); - } - - return nRet; -} - -struct BurnDriver BurnDrvEightfrc = { - "eightfrc", NULL, NULL, NULL, "1994", - "Eight Forces\0", NULL, "Tecmo", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, eightfrcRomInfo, eightfrcRomName, NULL, NULL, EightfrcInputInfo, EightfrcDIPInfo, - eightfrcInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 224, 384, 3, 4 -}; - - -// War of Aero - Project MEIOU - -static struct BurnRomInfo wrofaeroRomDesc[] = { - { "u3.bin", 0x40000, 0x9b896a97, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u4.bin", 0x40000, 0xdda84846, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "u64.bin", 0x80000, 0xf06ccd78, 0x03 | BRF_GRA }, // 2 Sprites - { "u63.bin", 0x80000, 0x2a602a1b, 0x03 | BRF_GRA }, // 3 - - { "u66.bin", 0x80000, 0xc9fc6a0c, 0x04 | BRF_GRA }, // 4 Layer 1 tiles - - { "u68.bin", 0x80000, 0x25c0c483, 0x05 | BRF_GRA }, // 5 Layer 2 tiles - - { "u69.bin", 0x80000, 0x957ecd41, 0x06 | BRF_SND }, // 6 x1-010 Samples - { "u70.bin", 0x80000, 0x8d756fdf, 0x06 | BRF_SND }, // 7 -}; - -STD_ROM_PICK(wrofaero) -STD_ROM_FN(wrofaero) - -static INT32 wrofaeroInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0x400, 0x200); - - return DrvInit(wrofaero68kInit, 16000000, SET_IRQLINES(2, 4), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); -} - -struct BurnDriver BurnDrvWrofaero = { - "wrofaero", NULL, NULL, NULL, "1993", - "War of Aero - Project MEIOU\0", NULL, "Yang Cheng", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, wrofaeroRomInfo, wrofaeroRomName, NULL, NULL, WrofaeroInputInfo, WrofaeroDIPInfo, - wrofaeroInit, DrvExit, DrvKMFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 240, 384, 3, 4 -}; - - -// Zing Zing Zip - -static struct BurnRomInfo zingzipRomDesc[] = { - { "uy001001.3", 0x040000, 0x1a1687ec, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "uy001002.4", 0x040000, 0x62e3b0c4, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "uy001006.64", 0x080000, 0x46e4a7d8, 0x03 | BRF_GRA }, // 2 Sprites - { "uy001005.63", 0x080000, 0x4aac128e, 0x03 | BRF_GRA }, // 3 - - { "uy001008.66", 0x100000, 0x1dff7c4b, 0x04 | BRF_GRA }, // 4 Layer 1 tiles - { "uy001007.65", 0x080000, 0xec5b3ab9, 0x1c | BRF_GRA }, // 5 - - { "uy001010.68", 0x100000, 0xbdbcdf03, 0x05 | BRF_GRA }, // 6 Layer 2 tiles - - { "uy001011.70", 0x100000, 0xbd845f55, 0x06 | BRF_SND }, // 7 x1-010 Samples -}; - -STD_ROM_PICK(zingzip) -STD_ROM_FN(zingzip) - -static INT32 zingzipInit() -{ - DrvSetVideoOffsets(0, 0, -1, -2); - DrvSetColorOffsets(0, 0x400, 0x200); - - INT32 nRet = DrvInit(wrofaero68kInit, 16000000, SET_IRQLINES(3, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 3, 2)); - - if (nRet == 0) { - zingzapSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvZingzip = { - "zingzip", NULL, NULL, NULL, "1992", - "Zing Zing Zip\0", NULL, "Allumer + Tecmo", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, zingzipRomInfo, zingzipRomName, NULL, NULL, ZingzipInputInfo, ZingzipDIPInfo, - zingzipInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0xc00, - 240, 384, 3, 4 -}; - - -// Mobile Suit Gundam - -static struct BurnRomInfo msgundamRomDesc[] = { - { "fa003002.u25", 0x080000, 0x1cc72d4c, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fa001001.u20", 0x100000, 0xfca139d0, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fa001008.u21", 0x200000, 0xe7accf48, 0x03 | BRF_GRA }, // 2 Sprites - { "fa001007.u22", 0x200000, 0x793198a6, 0x03 | BRF_GRA }, // 3 - - { "fa001006.u23", 0x100000, 0x3b60365c, 0x04 | BRF_GRA }, // 4 Layer 1 tiles - - { "fa001005.u24", 0x080000, 0x8cd7ff86, 0x05 | BRF_GRA }, // 5 Layer 2 tiles - - { "fa001004.u26", 0x100000, 0xb965f07c, 0x06 | BRF_SND }, // 6 x1-010 Samples -}; - -STD_ROM_PICK(msgundam) -STD_ROM_FN(msgundam) - -static INT32 msgundamInit() -{ - refresh_rate = 5666; // 56.66 hz - DrvSetVideoOffsets(0, 0, -2, -2); - DrvSetColorOffsets(0, 0x400, 0x200); - - INT32 nRet = DrvInit(msgundam68kInit, 16000000, SET_IRQLINES(4, 2), SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); - - if (nRet == 0) { - memmove (Drv68KROM + 0x100000, Drv68KROM + 0x080000, 0x100000); - memset(Drv68KROM + 0x080000, 0, 0x080000); - } - - return nRet; -} - -struct BurnDriver BurnDrvMsgundam = { - "msgundam", NULL, NULL, NULL, "1993", - "Mobile Suit Gundam\0", NULL, "Banpresto", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_VSFIGHT, 0, - NULL, msgundamRomInfo, msgundamRomName, NULL, NULL, MsgundamInputInfo, MsgundamDIPInfo, - msgundamInit, DrvExit, DrvFrameMsgundam, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 384, 240, 4, 3 -}; - - -// Mobile Suit Gundam (Japan) - -static struct BurnRomInfo msgundam1RomDesc[] = { - { "fa002002.u25", 0x080000, 0xdee3b083, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fa001001.u20", 0x100000, 0xfca139d0, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fa001008.u21", 0x200000, 0xe7accf48, 0x03 | BRF_GRA }, // 2 Sprites - { "fa001007.u22", 0x200000, 0x793198a6, 0x03 | BRF_GRA }, // 3 - - { "fa001006.u23", 0x100000, 0x3b60365c, 0x04 | BRF_GRA }, // 4 Layer 1 tiles - - { "fa001005.u24", 0x080000, 0x8cd7ff86, 0x05 | BRF_GRA }, // 5 Layer 2 tiles - - { "fa001004.u26", 0x100000, 0xb965f07c, 0x06 | BRF_SND }, // 6 x1-010 Samples -}; - -STD_ROM_PICK(msgundam1) -STD_ROM_FN(msgundam1) - -struct BurnDriver BurnDrvMsgundam1 = { - "msgundam1", "msgundam", NULL, NULL, "1993", - "Mobile Suit Gundam (Japan)\0", NULL, "Banpresto", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA1, GBF_VSFIGHT, 0, - NULL, msgundam1RomInfo, msgundam1RomName, NULL, NULL, MsgundamInputInfo, Msgunda1DIPInfo, - msgundamInit, DrvExit, DrvFrameMsgundam, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 384, 240, 4, 3 -}; - - -// SD Gundam Neo Battling (Japan) - -static struct BurnRomInfo neobattlRomDesc[] = { - { "bp923001.u45", 0x020000, 0x0d0aeb73, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bp923002.u46", 0x020000, 0x9731fbbc, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "bp923-003.u15", 0x080000, 0x91ca98a1, 0x03 | BRF_GRA }, // 2 Sprites - { "bp923-004.u9", 0x080000, 0x15c678e3, 0x03 | BRF_GRA }, // 3 - - { "bp923-005.u4", 0x100000, 0x7c0e37be, 0x06 | BRF_SND }, // 4 x1-010 Samples -}; - -STD_ROM_PICK(neobattl) -STD_ROM_FN(neobattl) - -static INT32 umanclubInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(umanclub68kInit, 16000000, SET_IRQLINES(3, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, -1, -1)); -} - -struct BurnDriver BurnDrvNeobattl = { - "neobattl", NULL, NULL, NULL, "1992", - "SD Gundam Neo Battling (Japan)\0", NULL, "Banpresto / Sotsu Agency. Sunrise", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, neobattlRomInfo, neobattlRomName, NULL, NULL, NeobattlInputInfo, NeobattlDIPInfo, - umanclubInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 240, 384, 3, 4 -}; - - -// Ultraman Club - Tatakae! Ultraman Kyoudai!! - -static struct BurnRomInfo umanclubRomDesc[] = { - { "uw001006.u48", 0x020000, 0x3dae1e9d, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "uw001007.u49", 0x020000, 0x5c21e702, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "bp-u-002.u2", 0x080000, 0x936cbaaa, 0x03 | BRF_GRA }, // 2 Sprites - { "bp-u-001.u1", 0x080000, 0x87813c48, 0x03 | BRF_GRA }, // 3 - - { "uw003.u13", 0x100000, 0xe2f718eb, 0x06 | BRF_SND }, // 4 x1-010 Samples -}; - -STD_ROM_PICK(umanclub) -STD_ROM_FN(umanclub) - -struct BurnDriver BurnDrvUmanclub = { - "umanclub", NULL, NULL, NULL, "1992", - "Ultraman Club - Tatakae! Ultraman Kyoudai!!\0", NULL, "Banpresto / Tsuburaya Productions", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_SHOOT, 0, - NULL, umanclubRomInfo, umanclubRomName, NULL, NULL, UmanclubInputInfo, UmanclubDIPInfo, - umanclubInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; - - -// Masked Riders Club Battle Race - -static struct BurnRomInfo kamenridRomDesc[] = { - { "fj001003.25", 0x080000, 0x9b65d1b9, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - - { "fj001005.21", 0x100000, 0x5d031333, 0x03 | BRF_GRA }, // 1 Sprites - { "fj001006.22", 0x100000, 0xcf28eb78, 0x03 | BRF_GRA }, // 2 - - { "fj001007.152", 0x080000, 0xd9ffe80b, 0x04 | BRF_GRA }, // 3 user1 - - { "fj001008.26", 0x100000, 0x45e2b329, 0x06 | BRF_SND }, // 4 x1-010 Samples -}; - -STD_ROM_PICK(kamenrid) -STD_ROM_FN(kamenrid) - -static INT32 kamenridInit() -{ - DrvSetVideoOffsets(0, 0, -2, -2); - DrvSetColorOffsets(0, 0x400, 0x200); - - return DrvInit(kamenrid68kInit, 16000000, SET_IRQLINES(2, 4/*2, NOIRQ2*/), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); -} - -struct BurnDriver BurnDrvKamenrid = { - "kamenrid", NULL, NULL, NULL, "1993", - "Masked Riders Club Battle Race\0", NULL, "Banpresto / Toei", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_RACING, 0, - NULL, kamenridRomInfo, kamenridRomName, NULL, NULL, KamenridInputInfo, KamenridDIPInfo, - kamenridInit, DrvExit, DrvKMFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 384, 240, 4, 3 -}; - - -// Mad Shark - -static struct BurnRomInfo madsharkRomDesc[] = { - { "fq001002.201", 0x080000, 0x4286a811, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fq001001.200", 0x080000, 0x38bfa0ad, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fq001004.202", 0x200000, 0xe56a1b5e, 0x03 | BRF_GRA }, // 2 Sprites - - { "fq001006.152", 0x200000, 0x3bc5e8e4, 0x04 | BRF_GRA }, // 3 user1 - { "fq001005.205", 0x100000, 0x5f6c6d4a, 0x1c | BRF_GRA }, // 4 - - { "fq001007.26", 0x100000, 0xe4b33c13, 0x06 | BRF_SND }, // 5 x1-010 Samples -}; - -STD_ROM_PICK(madshark) -STD_ROM_FN(madshark) - -static INT32 madsharkInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0x200, 0xa00); - - INT32 nRet = DrvInit(madshark68kInit, 16000000, SET_IRQLINES(4, 2/*2, NOIRQ2*/), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 3, 3)); - - if (nRet == 0) { - jjsquawkSetColorTable(); - } - - return nRet; -} - -static INT32 madsharkExit() -{ - BurnFree (DrvGfxROM2); - - return DrvExit(); -} - -struct BurnDriver BurnDrvMadshark = { - "madshark", NULL, NULL, NULL, "1993", - "Mad Shark\0", NULL, "Allumer", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, madsharkRomInfo, madsharkRomName, NULL, NULL, MadsharkInputInfo, MadsharkDIPInfo, - madsharkInit, madsharkExit, DrvKMFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 224, 384, 3, 4 -}; - - -// Wit's (Japan) - -static struct BurnRomInfo witsRomDesc[] = { - { "un001001.u1", 0x08000, 0x416c567e, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "un001002.u4", 0x08000, 0x497a3fa6, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "un001008.7l", 0x20000, 0x1d5d0b2b, 0x0b | BRF_GRA }, // 2 Sprites - { "un001007.5l", 0x20000, 0x9e1e6d51, 0x0b | BRF_GRA }, // 3 - { "un001006.4l", 0x20000, 0x98a980d4, 0x0b | BRF_GRA }, // 4 - { "un001005.2l", 0x20000, 0x6f2ce3c0, 0x0b | BRF_GRA }, // 5 - - { "un001004.12a", 0x20000, 0xa15ff938, 0x06 | BRF_SND }, // 6 x1-010 Samples - { "un001003.10a", 0x20000, 0x3f4b9e55, 0x06 | BRF_SND }, // 7 -}; - -STD_ROM_PICK(wits) -STD_ROM_FN(wits) - -static INT32 witsInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(thunderl68kInit, 8000000, SET_IRQLINES(2, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, -1, -1)); -} - -struct BurnDriver BurnDrvWits = { - "wits", NULL, NULL, NULL, "1989", - "Wit's (Japan)\0", NULL, "Athena (Visco license)", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_SETA1, GBF_MAZE, 0, - NULL, witsRomInfo, witsRomName, NULL, NULL, WitsInputInfo, WitsDIPInfo, - witsInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; - - -// Thunder & Lightning - -static struct BurnRomInfo thunderlRomDesc[] = { - { "m4", 0x08000, 0x1e6b9462, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "m5", 0x08000, 0x7e82793e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "t17", 0x20000, 0x599a632a, 0x0b | BRF_GRA }, // 2 Sprites - { "t16", 0x20000, 0x3aeef91c, 0x0b | BRF_GRA }, // 3 - { "t15", 0x20000, 0xb97a7b56, 0x0b | BRF_GRA }, // 4 - { "t14", 0x20000, 0x79c707be, 0x0b | BRF_GRA }, // 5 - - { "r28", 0x80000, 0xa043615d, 0x06 | BRF_SND }, // 6 x1-010 Samples - { "r27", 0x80000, 0xcb8425a3, 0x06 | BRF_SND }, // 7 -}; - -STD_ROM_PICK(thunderl) -STD_ROM_FN(thunderl) - -struct BurnDriver BurnDrvThunderl = { - "thunderl", NULL, NULL, NULL, "1990", - "Thunder & Lightning\0", NULL, "Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_BREAKOUT, 0, - NULL, thunderlRomInfo, thunderlRomName, NULL, NULL, ThunderlInputInfo, ThunderlDIPInfo, - witsInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 240, 384, 3, 4 -}; - - -// Athena no Hatena ? - -static struct BurnRomInfo atehateRomDesc[] = { - { "fs001001.evn", 0x080000, 0x4af1f273, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fs001002.odd", 0x080000, 0xc7ca7a85, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fs001003.gfx", 0x200000, 0x8b17e431, 0x03 | BRF_GRA }, // 2 Sprites - - { "fs001004.pcm", 0x100000, 0xf9344ce5, 0x06 | BRF_SND }, // 3 x1-010 Samples -}; - -STD_ROM_PICK(atehate) -STD_ROM_FN(atehate) - -static INT32 atehateInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(atehate68kInit, 16000000, SET_IRQLINES(2, 1), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, -1, -1)); -} - -struct BurnDriver BurnDrvAtehate = { - "atehate", NULL, NULL, NULL, "1993", - "Athena no Hatena ?\0", NULL, "Athena", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_QUIZ, 0, - NULL, atehateRomInfo, atehateRomName, NULL, NULL, AtehateInputInfo, AtehateDIPInfo, - atehateInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; - - -// Block Carnival / Thunder & Lightning 2 - -static struct BurnRomInfo blockcarRomDesc[] = { - { "u1.a1", 0x20000, 0x4313fb00, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u4.a3", 0x20000, 0x2237196d, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "bl-chr-0.j3", 0x80000, 0xa33300ca, 0x03 | BRF_GRA }, // 2 Sprites - { "bl-chr-1.l3", 0x80000, 0x563de808, 0x03 | BRF_GRA }, // 3 - - { "bl-snd-0.a13", 0x80000, 0xa92dabaf, 0x06 | BRF_SND }, // 4 x1-010 Samples -}; - -STD_ROM_PICK(blockcar) -STD_ROM_FN(blockcar) - -static INT32 blockcarInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(blockcar68kInit, 8000000, SET_IRQLINES(3, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, -1, -1)); -} - -struct BurnDriver BurnDrvBlockcar = { - "blockcar", NULL, NULL, NULL, "1992", - "Block Carnival / Thunder & Lightning 2\0", NULL, "Visco", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_SETA1, GBF_BREAKOUT, 0, - NULL, blockcarRomInfo, blockcarRomName, NULL, NULL, BlockcarInputInfo, BlockcarDIPInfo, - blockcarInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 240, 384, 3, 4 -}; - - -// Zombie Raid (9/28/95, US) - -static struct BurnRomInfo zombraidRomDesc[] = { - { "fy001003.3", 0x080000, 0x0b34b8f7, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fy001004.4", 0x080000, 0x71bfeb1a, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "fy001002.103", 0x080000, 0x313fd68f, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "fy001001.102", 0x080000, 0xa0f61f13, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "fy001006.200", 0x200000, 0xe9ae99f7, 0x03 | BRF_GRA }, // 4 Sprites - - { "fy001008.66", 0x200000, 0x73d7b0e1, 0x04 | BRF_GRA }, // 5 Layer 1 tiles - { "fy001007.65", 0x100000, 0xb2fc2c81, 0x1c | BRF_GRA }, // 6 - - { "fy001010.68", 0x200000, 0x8b40ed7a, 0x05 | BRF_GRA }, // 7 Layer 2 tiles - { "fy001009.67", 0x100000, 0x6bcca641, 0x1d | BRF_GRA }, // 8 - - { "fy001012.b", 0x200000, 0xfd30e102, 0x06 | BRF_SND }, // 9 x1-010 Samples - { "fy001011.a", 0x200000, 0xe3c431de, 0x06 | BRF_SND }, // 10 - - { "nvram.bin", 0x010000, 0x1a4b2ee8, 0x00 | BRF_OPT }, -}; - -STD_ROM_PICK(zombraid) -STD_ROM_FN(zombraid) - -static INT32 zombraidInit() -{ - DrvSetVideoOffsets(0, 0, -2, -2); - DrvSetColorOffsets(0, 0x200, 0xa00); - - INT32 nRet = DrvInit(zombraid68kInit, 16000000, SET_IRQLINES(2, 4), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 3, 3)); - - if (nRet == 0) { - gundharaSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvZombraid = { - "zombraid", NULL, NULL, NULL, "1995", - "Zombie Raid (9/28/95, US)\0", NULL, "American Sammy", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_SHOOT, 0, - NULL, zombraidRomInfo, zombraidRomName, NULL, NULL, ZombraidInputInfo, ZombraidDIPInfo, - zombraidInit, DrvExit, DrvFrame, zombraidDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 240, 4, 3 -}; - - -// Zombie Raid (9/28/95, US, prototype PCB) -/* Prototype or test board version. Data matches released MASK rom version */ - -static struct BurnRomInfo zombraidpRomDesc[] = { - { "u3_master_usa_prg_e_l_dd28.u3", 0x080000, 0x0b34b8f7, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u4_master_usa_prg_o_l_5e2b.u4", 0x080000, 0x71bfeb1a, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "u103_master_usa_prg_e_h_789e.u103", 0x080000, 0x313fd68f, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "u102_master_usa_prg_o_h_1f25.u102", 0x080000, 0xa0f61f13, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "u142_master_obj_00_1bb3.u142", 0x040000, 0xed6c8541, 0x0b | BRF_GRA }, // 4 Sprites - { "obj_01", 0x040000, 0xa423620e, 0x0b | BRF_GRA }, // 5 - { "u143_master_obj_04_b5aa.u143", 0x040000, 0x1242670d, 0x0b | BRF_GRA }, // 6 - { "obj_05", 0x040000, 0x57fe3e97, 0x0b | BRF_GRA }, // 7 - { "u146_master_obj_02_6cc6.u146", 0x040000, 0x7562ee1b, 0x0b | BRF_GRA }, // 8 - { "u144_master_obj_03_1cb5.u144", 0x040000, 0xa83040f1, 0x0b | BRF_GRA }, // 9 - { "u147_master_obj_06_c3d8.u147", 0x040000, 0xa32c3da8, 0x0b | BRF_GRA }, // 10 - { "u145_master_obj_07_8ad4.u145", 0x040000, 0x8071f0b6, 0x0b | BRF_GRA }, // 11 - - { "u148_master_scn_1-0_3ef8.u148", 0x080000, 0x7d722f2a, 0x1c | BRF_GRA }, // 12 Layer 1 tiles - { "u150_master_scn_1-1_89a6.u150", 0x080000, 0x3c62a8af, 0x1c | BRF_GRA }, // 13 - { "u149_master_scn_1-3_71bb.u149", 0x080000, 0x70d6af7f, 0x1c | BRF_GRA }, // 14 - { "u151_master_scn_1-4_872e.u151", 0x080000, 0x83ef4d5f, 0x1c | BRF_GRA }, // 15 - { "u154_master_scn_1-2_0f4b.u154", 0x080000, 0x0a1d647c, 0x1c | BRF_GRA }, // 16 - { "u155_master_scn_1-5_daef.u155", 0x080000, 0x2508f67f, 0x1c | BRF_GRA }, // 17 - - { "u164_master_scn_2-0_e79c.u164", 0x080000, 0xf8c89062, 0x1d | BRF_GRA }, // 18 Layer 2 tiles - { "u166_master_scn_2-1_0b75.u166", 0x080000, 0x4d7a72d5, 0x1d | BRF_GRA }, // 19 - { "u165_master_scn_2-3_be68.u165", 0x080000, 0x8aaaef08, 0x1d | BRF_GRA }, // 20 - { "u167_master_scn_2-4_c515.u167", 0x080000, 0xd22ff5c1, 0x1d | BRF_GRA }, // 21 - { "u152_master_scn_2-2_c00e.u152", 0x080000, 0x0870ad58, 0x1d | BRF_GRA }, // 22 - { "u153_master_scn_2-5_e1da.u153", 0x080000, 0x814ac66a, 0x1d | BRF_GRA }, // 23 - - { "u156_master_snd_0_f630.u156", 0x080000, 0xbfc467bd, 0x06 | BRF_SND }, // 24 x1-010 Samples - { "u157_master_snd_1_c20a.u157", 0x080000, 0xb449a8ba, 0x06 | BRF_SND }, // 25 - { "u158_master_snd_2_5c69.u158", 0x080000, 0xed6de791, 0x06 | BRF_SND }, // 26 - { "u159_master_snd_3_0727.u159", 0x080000, 0x794cec21, 0x06 | BRF_SND }, // 27 - { "u160_master_snd_4_5a70.u160", 0x080000, 0xe81ace66, 0x06 | BRF_SND }, // 28 - { "u161_master_snd_5_599c.u161", 0x080000, 0x1793dd13, 0x06 | BRF_SND }, // 29 - { "u162_master_snd_6_6d2e.u162", 0x080000, 0x2ece241f, 0x06 | BRF_SND }, // 30 - { "u163_master_snd_7_c733.u163", 0x080000, 0xd90f78b2, 0x06 | BRF_SND }, // 31 - - { "nvram.bin", 0x010000, 0x1a4b2ee8, 0x00 | BRF_OPT }, -}; - -STD_ROM_PICK(zombraidp) -STD_ROM_FN(zombraidp) - -static INT32 zombraidpRomCallback(INT32 bLoad) -{ - if (!bLoad) - { - DrvROMLen[0] = 0x200000; // gfx0 - DrvROMLen[1] = 0x400000; // gfx1 - DrvROMLen[2] = 0x400000; // gfx2 - DrvROMLen[3] = 0x480000; // sound rom - } - else - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 3, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x180001, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x180000, 11, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 17, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 19, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100001, 21, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 22, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x300000, 23, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 24, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x080000, 25, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x100000, 26, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x180000, 27, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x200000, 28, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x280000, 29, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x300000, 30, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x380000, 31, 1)) return 1; - } - - return 0; -} - -static INT32 zombraidpInit() -{ - DrvSetVideoOffsets(0, 0, -2, -2); - DrvSetColorOffsets(0, 0x200, 0xa00); - - pRomLoadCallback = zombraidpRomCallback; - - INT32 nRet = DrvInit(zombraid68kInit, 16000000, SET_IRQLINES(2, 4), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 3, 3)); - - if (nRet == 0) { - gundharaSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvZombraidp = { - "zombraidp", "zombraid", NULL, NULL, "1995", - "Zombie Raid (9/28/95, US, prototype PCB)\0", NULL, "American Sammy", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA1, GBF_SHOOT, 0, - NULL, zombraidpRomInfo, zombraidpRomName, NULL, NULL, ZombraidInputInfo, ZombraidDIPInfo, - zombraidpInit, DrvExit, DrvFrame, zombraidDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 240, 4, 3 -}; - - -// Zombie Raid (9/28/95, Japan, prototype PCB) -/* Prototype or test board version. Data matches released MASK rom version */ - -static struct BurnRomInfo zombraidpjRomDesc[] = { - { "u3_master_usa_prg_e_l_dd28.u3", 0x080000, 0x0b34b8f7, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u4_master_jpn_prg_o_l_5e2c.u4", 0x080000, 0x3cb6bdf0, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "u103_master_usa_prg_e_h_789e.u103", 0x080000, 0x313fd68f, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "u102_master_usa_prg_o_h_1f25.u102", 0x080000, 0xa0f61f13, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "u142_master_obj_00_1bb3.u142", 0x040000, 0xed6c8541, 0x0b | BRF_GRA }, // 4 Sprites - { "obj_01", 0x040000, 0xa423620e, 0x0b | BRF_GRA }, // 5 - { "u143_master_obj_04_b5aa.u143", 0x040000, 0x1242670d, 0x0b | BRF_GRA }, // 6 - { "obj_05", 0x040000, 0x57fe3e97, 0x0b | BRF_GRA }, // 7 - { "u146_master_obj_02_6cc6.u146", 0x040000, 0x7562ee1b, 0x0b | BRF_GRA }, // 8 - { "u144_master_obj_03_1cb5.u144", 0x040000, 0xa83040f1, 0x0b | BRF_GRA }, // 9 - { "u147_master_obj_06_c3d8.u147", 0x040000, 0xa32c3da8, 0x0b | BRF_GRA }, // 10 - { "u145_master_obj_07_8ad4.u145", 0x040000, 0x8071f0b6, 0x0b | BRF_GRA }, // 11 - - { "u148_master_scn_1-0_3ef8.u148", 0x080000, 0x7d722f2a, 0x1c | BRF_GRA }, // 12 Layer 1 tiles - { "u150_master_scn_1-1_89a6.u150", 0x080000, 0x3c62a8af, 0x1c | BRF_GRA }, // 13 - { "u149_master_scn_1-3_71bb.u149", 0x080000, 0x70d6af7f, 0x1c | BRF_GRA }, // 14 - { "u151_master_scn_1-4_872e.u151", 0x080000, 0x83ef4d5f, 0x1c | BRF_GRA }, // 15 - { "u154_master_scn_1-2_0f4b.u154", 0x080000, 0x0a1d647c, 0x1c | BRF_GRA }, // 16 - { "u155_master_scn_1-5_daef.u155", 0x080000, 0x2508f67f, 0x1c | BRF_GRA }, // 17 - - { "u164_master_scn_2-0_e79c.u164", 0x080000, 0xf8c89062, 0x1d | BRF_GRA }, // 18 Layer 2 tiles - { "u166_master_scn_2-1_0b75.u166", 0x080000, 0x4d7a72d5, 0x1d | BRF_GRA }, // 19 - { "u165_master_scn_2-3_be68.u165", 0x080000, 0x8aaaef08, 0x1d | BRF_GRA }, // 20 - { "u167_master_scn_2-4_c515.u167", 0x080000, 0xd22ff5c1, 0x1d | BRF_GRA }, // 21 - { "u152_master_scn_2-2_c00e.u152", 0x080000, 0x0870ad58, 0x1d | BRF_GRA }, // 22 - { "u153_master_scn_2-5_e1da.u153", 0x080000, 0x814ac66a, 0x1d | BRF_GRA }, // 23 - - { "u156_master_snd_0_f630.u156", 0x080000, 0xbfc467bd, 0x06 | BRF_SND }, // 24 x1-010 Samples - { "u157_master_snd_1_c20a.u157", 0x080000, 0xb449a8ba, 0x06 | BRF_SND }, // 25 - { "u158_master_snd_2_5c69.u158", 0x080000, 0xed6de791, 0x06 | BRF_SND }, // 26 - { "u159_master_snd_3_0727.u159", 0x080000, 0x794cec21, 0x06 | BRF_SND }, // 27 - { "u160_master_snd_4_5a70.u160", 0x080000, 0xe81ace66, 0x06 | BRF_SND }, // 28 - { "u161_master_snd_5_599c.u161", 0x080000, 0x1793dd13, 0x06 | BRF_SND }, // 29 - { "u162_master_snd_6_6d2e.u162", 0x080000, 0x2ece241f, 0x06 | BRF_SND }, // 30 - { "u163_master_snd_7_c733.u163", 0x080000, 0xd90f78b2, 0x06 | BRF_SND }, // 31 - - { "nvram.bin", 0x010000, 0x1a4b2ee8, 0x00 | BRF_OPT }, -}; - -STD_ROM_PICK(zombraidpj) -STD_ROM_FN(zombraidpj) - -struct BurnDriver BurnDrvZombraidpj = { - "zombraidpj", "zombraid", NULL, NULL, "1995", - "Zombie Raid (9/28/95, Japan, prototype PCB)\0", NULL, "Sammy Industries Co.,Ltd.", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA1, GBF_SHOOT, 0, - NULL, zombraidpjRomInfo, zombraidpjRomName, NULL, NULL, ZombraidInputInfo, ZombraidDIPInfo, - zombraidpInit, DrvExit, DrvFrame, zombraidDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 240, 4, 3 -}; - - -// Gundhara - -static struct BurnRomInfo gundharaRomDesc[] = { - { "bpgh-003.u3", 0x080000, 0x14e9970a, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "bpgh-004.u4", 0x080000, 0x96dfc658, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "bpgh-002.103", 0x080000, 0x312f58e2, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "bpgh-001.102", 0x080000, 0x8d23a23c, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "bpgh-008.u64", 0x200000, 0x7ed9d272, 0x03 | BRF_GRA }, // 4 Sprites - { "bpgh-006.201", 0x200000, 0x5a81411d, 0x03 | BRF_GRA }, // 5 - { "bpgh-007.u63", 0x200000, 0xaa49ce7b, 0x03 | BRF_GRA }, // 6 - { "bpgh-005.200", 0x200000, 0x74138266, 0x03 | BRF_GRA }, // 7 - - { "bpgh-010.u66", 0x100000, 0xb742f0b8, 0x04 | BRF_GRA }, // 8 Layer 1 tiles - { "bpgh-009.u65", 0x080000, 0xb768e666, 0x1c | BRF_GRA }, // 9 - - { "bpgh-012.u68", 0x200000, 0xedfda595, 0x05 | BRF_GRA }, // 10 Layer 2 tiles - { "bpgh-011.u67", 0x100000, 0x49aff270, 0x1d | BRF_GRA }, // 11 - - { "bpgh-013.u70", 0x100000, 0x0fa5d503, 0x06 | BRF_SND }, // 12 x1-010 Samples -}; - -STD_ROM_PICK(gundhara) -STD_ROM_FN(gundhara) - -static void gundhara68kInit() -{ - wrofaero68kInit(); - - //memmove (DrvSndROM + 0x100000, DrvSndROM + 0x080000, 0x080000); - //memmove (DrvSndROM + 0x000000, DrvSndROM + 0x080000, 0x100000); - // swap halves of sound rom - memcpy (DrvSndROM + 0x100000, DrvSndROM + 0x000000, 0x080000); - memcpy (DrvSndROM + 0x000000, DrvSndROM + 0x080000, 0x100000); -} - -static INT32 gundharaInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0x200, 0xa00); - - INT32 nRet = DrvInit(gundhara68kInit, 16000000, SET_IRQLINES(2, 4), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 3, 3)); - - if (nRet == 0) { - gundharaSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvGundhara = { - "gundhara", NULL, NULL, NULL, "1995", - "Gundhara\0", NULL, "Banpresto", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_SHOOT, 0, - NULL, gundharaRomInfo, gundharaRomName, NULL, NULL, GundharaInputInfo, GundharaDIPInfo, - gundharaInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 240, 384, 3, 4 -}; - - -// Gundhara (Chinese, bootleg?) - -static struct BurnRomInfo gundharacRomDesc[] = { - { "4.U3", 0x080000, 0x14e9970a, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2.U4", 0x080000, 0x96dfc658, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "3.U103", 0x080000, 0x312f58e2, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "1.U102", 0x080000, 0x8d23a23c, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "19.U140", 0x080000, 0x32d92c28, 0x0b | BRF_GRA }, // 4 Sprites - { "23.U142", 0x080000, 0xff44db9b, 0x0b | BRF_GRA }, // 5 - { "21.U141", 0x080000, 0x1901dc08, 0x0b | BRF_GRA }, // 6 - { "25.U143", 0x080000, 0x877289a2, 0x0b | BRF_GRA }, // 7 - { "18.U140-B", 0x080000, 0x4f023fb0, 0x0b | BRF_GRA }, // 8 - { "22.U142-B", 0x080000, 0x6f3fe7e7, 0x0b | BRF_GRA }, // 9 - { "20.U141-B", 0x080000, 0x7f1932e0, 0x0b | BRF_GRA }, // 10 - { "24.U143-B", 0x080000, 0x066a2e2b, 0x0b | BRF_GRA }, // 11 - { "9.U144", 0x080000, 0x6b4a531f, 0x0b | BRF_GRA }, // 12 - { "13.U146", 0x080000, 0x45be3df4, 0x0b | BRF_GRA }, // 13 - { "11.U145", 0x080000, 0xf5210aa5, 0x0b | BRF_GRA }, // 14 - { "15.U147", 0x080000, 0x17003119, 0x0b | BRF_GRA }, // 15 - { "8.U144-B", 0x080000, 0xad9d9338, 0x0b | BRF_GRA }, // 16 - { "12.U146-B", 0x080000, 0x0fd4c062, 0x0b | BRF_GRA }, // 17 - { "10.U145-B", 0x080000, 0x7c5d12b9, 0x0b | BRF_GRA }, // 18 - { "14.U147-B", 0x080000, 0x5a8af50f, 0x0b | BRF_GRA }, // 19 - - { "5.U148", 0x080000, 0x0c740f9b, 0x1c | BRF_GRA }, // 20 Layer 1 tiles - { "6.U150", 0x080000, 0xba60eb98, 0x1c | BRF_GRA }, // 21 - { "7.U154", 0x080000, 0xb768e666, 0x1c | BRF_GRA }, // 22 - - { "26.U164", 0x080000, 0xbe3ccaba, 0x1d | BRF_GRA }, // 23 Layer 2 tiles - { "28.U166", 0x080000, 0x8a650a4e, 0x1d | BRF_GRA }, // 24 - { "27.U165", 0x080000, 0x47994ff0, 0x1d | BRF_GRA }, // 25 - { "29.U167", 0x080000, 0x453c3d3f, 0x1d | BRF_GRA }, // 26 - { "16.U152", 0x080000, 0x5ccc500b, 0x1d | BRF_GRA }, // 27 - { "17.U153", 0x080000, 0x5586d086, 0x1d | BRF_GRA }, // 28 - - { "30.U69", 0x080000, 0x3111a98a, 0x06 | BRF_SND }, // 29 x1-010 Samples - { "31.U70", 0x080000, 0x30cb2524, 0x06 | BRF_SND }, // 30 -}; - -STD_ROM_PICK(gundharac) -STD_ROM_FN(gundharac) - -static INT32 gundharacRomCallback(INT32 bLoad) -{ - if (!bLoad) - { - DrvROMLen[0] = 0x800000; // gfx0 - DrvROMLen[1] = 0x200000; // gfx1 - DrvROMLen[2] = 0x400000; // gfx2 - DrvROMLen[3] = 0x100000; // sound rom - } - else - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 3, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x300000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x300001, 11, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x500000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x500001, 15, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x600000, 16, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x600001, 17, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x700000, 18, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x700001, 19, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 20, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 21, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 22, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 23, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x000001, 24, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100000, 25, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x100001, 26, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x200000, 27, 2)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x300000, 28, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 29, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x080000, 30, 1)) return 1; - } - - return 0; -} - -static INT32 gundharacInit() -{ - DrvSetVideoOffsets(0, 0, -2, -2); - DrvSetColorOffsets(0, 0x200, 0xa00); - - pRomLoadCallback = gundharacRomCallback; - - INT32 nRet = DrvInit(gundhara68kInit, 16000000, SET_IRQLINES(2, 4), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 3, 3)); - - if (nRet == 0) { - gundharaSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvGundharac = { - "gundharac", "gundhara", NULL, NULL, "1995", - "Gundhara (Chinese, bootleg?)\0", NULL, "Banpresto", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_SHOOT, 0, - NULL, gundharacRomInfo, gundharacRomName, NULL, NULL, GundharaInputInfo, GundharaDIPInfo, - gundharacInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 240, 384, 3, 4 -}; - - -// Blandia - -static struct BurnRomInfo blandiaRomDesc[] = { - { "ux001001.u3", 0x040000, 0x2376a1f3, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ux001002.u4", 0x040000, 0xb915e172, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ux001003.u202", 0x100000, 0x98052c63, 0x01 | BRF_PRG | BRF_ESS }, // 2 - - { "ux001008.u64", 0x100000, 0x413647b6, 0x03 | BRF_GRA }, // 6 - { "ux001007.u201", 0x100000, 0x4440fdd1, 0x03 | BRF_GRA }, // 4 - { "ux001006.u63", 0x100000, 0xabc01cf7, 0x03 | BRF_GRA }, // 5 - { "ux001005.u200", 0x100000, 0xbea0c4a5, 0x03 | BRF_GRA }, // 3 Sprites - - { "ux001009.u65", 0x080000, 0xbc6f6aea, 0x04 | BRF_GRA }, // 7 Layer 1 tiles - { "ux001010.u66", 0x080000, 0xbd7f7614, 0x04 | BRF_GRA }, // 8 - - { "ux001011.u67", 0x080000, 0x5efe0397, 0x05 | BRF_GRA }, // 9 Layer 2 tiles - { "ux001012.u068", 0x080000, 0xf29959f6, 0x05 | BRF_GRA }, // 10 - - { "ux001013.u69", 0x100000, 0x5cd273cd, 0x06 | BRF_SND }, // 11 x1-010 Samples - { "ux001014.u70", 0x080000, 0x86b49b4e, 0x06 | BRF_SND }, // 12 -}; - -STD_ROM_PICK(blandia) -STD_ROM_FN(blandia) - -static INT32 blandiaInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0xa00, 0x200); - - INT32 nRet = DrvInit(blandia68kInit, 16000000, SET_IRQLINES(2, 4), SPRITE_BUFFER, SET_GFX_DECODE(0, 4, 4)); - - if (nRet == 0) { - // Update sample length to include the banked section that was skipped (0xc0000 - 0xfffff) - DrvROMLen[3] = 0x1c0000; - blandiaSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvBlandia = { - "blandia", NULL, NULL, NULL, "1992", - "Blandia\0", NULL, "Allumer", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_VSFIGHT, 0, - NULL, blandiaRomInfo, blandiaRomName, NULL, NULL, BlandiaInputInfo, BlandiaDIPInfo, - blandiaInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 240, 4, 3 -}; - - -// Blandia (prototype) - -static struct BurnRomInfo blandiapRomDesc[] = { - { "prg-even.bin", 0x40000, 0x7ecd30e8, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "prg-odd.bin", 0x40000, 0x42b86c15, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "tbl0.bin", 0x80000, 0x69b79eb8, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "tbl1.bin", 0x80000, 0xcf2fd350, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "o-1.bin", 0x80000, 0x4c67b7f0, 0x0b | BRF_GRA }, // 4 Sprites - { "o-0.bin", 0x80000, 0x5e7b8555, 0x0b | BRF_GRA }, // 5 - { "o-5.bin", 0x80000, 0x40bee78b, 0x0b | BRF_GRA }, // 6 - { "o-4.bin", 0x80000, 0x7c634784, 0x0b | BRF_GRA }, // 7 - { "o-3.bin", 0x80000, 0x387fc7c4, 0x0b | BRF_GRA }, // 8 - { "o-2.bin", 0x80000, 0xc669bb49, 0x0b | BRF_GRA }, // 9 - { "o-7.bin", 0x80000, 0xfc77b04a, 0x0b | BRF_GRA }, // 10 - { "o-6.bin", 0x80000, 0x92882943, 0x0b | BRF_GRA }, // 11 - - { "v1-2.bin", 0x20000, 0xd524735e, 0x04 | BRF_GRA }, // 12 Layer 1 tiles - { "v1-5.bin", 0x20000, 0xeb440cdb, 0x04 | BRF_GRA }, // 13 - { "v1-1.bin", 0x20000, 0x09bdf75f, 0x04 | BRF_GRA }, // 14 - { "v1-4.bin", 0x20000, 0x803911e5, 0x04 | BRF_GRA }, // 15 - { "v1-0.bin", 0x20000, 0x73617548, 0x04 | BRF_GRA }, // 16 - { "v1-3.bin", 0x20000, 0x7f18e4fb, 0x04 | BRF_GRA }, // 17 - - { "v2-2.bin", 0x20000, 0xc4f15638, 0x05 | BRF_GRA }, // 18 Layer 2 tiles - { "v2-5.bin", 0x20000, 0xc2e57622, 0x05 | BRF_GRA }, // 19 - { "v2-1.bin", 0x20000, 0xc4f15638, 0x05 | BRF_GRA }, // 20 - { "v2-4.bin", 0x20000, 0x16ec2130, 0x05 | BRF_GRA }, // 21 - { "v2-0.bin", 0x20000, 0x5b05eba9, 0x05 | BRF_GRA }, // 22 - { "v2-3.bin", 0x20000, 0x80ad0c3b, 0x05 | BRF_GRA }, // 23 - - { "s-0.bin", 0x40000, 0xa5fde408, 0x06 | BRF_SND }, // 24 x1-010 Samples - { "s-1.bin", 0x40000, 0x3083f9c4, 0x06 | BRF_SND }, // 25 - { "s-2.bin", 0x40000, 0xa591c9ef, 0x06 | BRF_SND }, // 26 - { "s-3.bin", 0x40000, 0x68826c9d, 0x06 | BRF_SND }, // 27 - { "s-4.bin", 0x40000, 0x1c7dc8c2, 0x06 | BRF_SND }, // 28 - { "s-5.bin", 0x40000, 0x4bb0146a, 0x06 | BRF_SND }, // 29 - { "s-6.bin", 0x40000, 0x9f8f34ee, 0x06 | BRF_SND }, // 30 - { "s-7.bin", 0x40000, 0xe077dd39, 0x06 | BRF_SND }, // 31 -}; - -STD_ROM_PICK(blandiap) -STD_ROM_FN(blandiap) - -static INT32 blandiapInit() -{ - DrvSetVideoOffsets(0, 8, -2, 6); - DrvSetColorOffsets(0, 0xa00, 0x200); - - INT32 nRet = DrvInit(blandiap68kInit, 16000000, SET_IRQLINES(2, 4), SPRITE_BUFFER, SET_GFX_DECODE(0, 4, 4)); - - if (nRet == 0) { - blandiaSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvBlandiap = { - "blandiap", "blandia", NULL, NULL, "1992", - "Blandia (prototype)\0", NULL, "Allumer", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA1, GBF_VSFIGHT, 0, - NULL, blandiapRomInfo, blandiapRomName, NULL, NULL, BlandiaInputInfo, BlandiaDIPInfo, - blandiapInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 240, 4, 3 -}; - - -// Oishii Puzzle Ha Irimasenka - -static struct BurnRomInfo oisipuzlRomDesc[] = { - { "ss1u200.v10", 0x80000, 0xf5e53baf, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ss1u201.v10", 0x80000, 0x7a7ff5ae, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ss1u306.v10", 0x80000, 0xce43a754, 0x03 | BRF_GRA }, // 2 Sprites - { "ss1u307.v10", 0x80000, 0x2170b7ec, 0x03 | BRF_GRA }, // 3 - { "ss1u304.v10", 0x80000, 0x546ab541, 0x03 | BRF_GRA }, // 4 - { "ss1u305.v10", 0x80000, 0x2a33e08b, 0x03 | BRF_GRA }, // 5 - - { "ss1u23.v10", 0x80000, 0x9fa60901, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - { "ss1u24.v10", 0x80000, 0xc10eb4b3, 0x04 | BRF_GRA }, // 7 - - { "ss1u25.v10", 0x80000, 0x56840728, 0x05 | BRF_GRA }, // 8 Layer 2 tiles - - { "ss1u26.v10", 0x80000, 0xd452336b, 0x06 | BRF_SND }, // 9 x1-010 Samples - { "ss1u27.v10", 0x80000, 0x17fe921d, 0x06 | BRF_SND }, // 10 -}; - -STD_ROM_PICK(oisipuzl) -STD_ROM_FN(oisipuzl) - -static INT32 oisipuzlInit() -{ - oisipuzl_hack = 1; // 32 pixel offset for sprites??? - watchdog_enable = 1; // needs a reset before it will boot - - DrvSetVideoOffsets(1, 1, -1, -1); - DrvSetColorOffsets(0, 0x400, 0x200); - - INT32 nRet = DrvInit(oisipuzl68kInit, 16000000, (2 << 8) | (1 << 0), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); - - if (nRet == 0) - { - memset (Drv68KROM, 0, 0x200000); - - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 1)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 1, 1)) return 1; - - for (INT32 i = 0; i < 0x400000; i++) DrvGfxROM0[i] ^= 0x0f; // invert - } - - return nRet; -} - -struct BurnDriver BurnDrvOisipuzl = { - "oisipuzl", NULL, NULL, NULL, "1993", - "Oishii Puzzle Ha Irimasenka\0", NULL, "Sunsoft / Atlus", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_MINIGAMES, 0, - NULL, oisipuzlRomInfo, oisipuzlRomName, NULL, NULL, OisipuzlInputInfo, OisipuzlDIPInfo, - oisipuzlInit, DrvExit, DrvFrame, seta2layerFlippedDraw, DrvScan, &DrvRecalc, 0x600, - 320, 224, 4, 3 -}; - - -// Triple Fun - -static struct BurnRomInfo triplfunRomDesc[] = { - { "05.bin", 0x80000, 0x06eb3821, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "04.bin", 0x80000, 0x37a5c46e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "09.bin", 0x80000, 0x98cc8ca5, 0x0b | BRF_GRA }, // 2 Sprites - { "08.bin", 0x80000, 0x63a8f10f, 0x0b | BRF_GRA }, // 3 - { "11.bin", 0x80000, 0x276ef724, 0x0b | BRF_GRA }, // 4 - { "10.bin", 0x80000, 0x20b0f282, 0x0b | BRF_GRA }, // 5 - - { "02.bin", 0x80000, 0x4c0d1068, 0x0c | BRF_GRA }, // 6 Layer 1 tiles - { "03.bin", 0x80000, 0xdba94e18, 0x0c | BRF_GRA }, // 7 - - { "06.bin", 0x40000, 0x8944bb72, 0x0d | BRF_GRA }, // 8 Layer 2 tiles - { "07.bin", 0x40000, 0x934a5d91, 0x0d | BRF_GRA }, // 9 - - { "01.bin", 0x40000, 0xc186a930, 0x06 | BRF_SND }, // 10 OKI M6295 Samples -}; - -STD_ROM_PICK(triplfun) -STD_ROM_FN(triplfun) - -static INT32 triplfunInit() -{ - oisipuzl_hack = 1; - DrvSetVideoOffsets(0, 0, -1, -1); - DrvSetColorOffsets(0, 0x400, 0x200); - - return DrvInit(triplfun68kInit, 16000000, SET_IRQLINES(3, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); -} - -struct BurnDriver BurnDrvTriplfun = { - "triplfun", "oisipuzl", NULL, NULL, "1993", - "Triple Fun\0", NULL, "bootleg", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA1, GBF_MINIGAMES, 0, - NULL, triplfunRomInfo, triplfunRomName, NULL, NULL, OisipuzlInputInfo, OisipuzlDIPInfo, - triplfunInit, DrvExit, DrvM6295Frame, seta2layerFlippedDraw, DrvScan, &DrvRecalc, 0x600, - 320, 224, 4, 3 -}; - - -// Pairs Love - -static struct BurnRomInfo pairloveRomDesc[] = { - { "ut2-001-001.1a", 0x10000, 0x083338b7, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ut2-001-002.3a", 0x10000, 0x39d88aae, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ut2-001-004.5j", 0x80000, 0xfdc47b26, 0x03 | BRF_GRA }, // 2 Sprites - { "ut2-001-005.5l", 0x80000, 0x076f94a2, 0x03 | BRF_GRA }, // 3 - - { "ut2-001-003.12a", 0x80000, 0x900219a9, 0x06 | BRF_SND }, // 4 x1-010 Samples -}; - -STD_ROM_PICK(pairlove) -STD_ROM_FN(pairlove) - -static INT32 pairloveInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - INT32 nRet = DrvInit(pairlove68kInit, 8000000, SET_IRQLINES(2, 1), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, -1, -1)); - - if (nRet == 0) { - memcpy (DrvSndROM + 0x80000, DrvSndROM, 0x80000); - } - - return nRet; -} - -struct BurnDriver BurnDrvPairlove = { - "pairlove", NULL, NULL, NULL, "1991", - "Pairs Love\0", NULL, "Athena", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_PUZZLE, 0, - NULL, pairloveRomInfo, pairloveRomName, NULL, NULL, PairloveInputInfo, PairloveDIPInfo, - pairloveInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 240, 384, 3, 4 -}; - - -// Orbs (10/7/94 prototype?) - -static struct BurnRomInfo orbsRomDesc[] = { - { "orbs.u10", 0x80000, 0x10f079c8, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "orbs.u9", 0x80000, 0xf269d16f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "orbs.u14", 0x80000, 0x1cc76541, 0x03 | BRF_GRA }, // 2 Sprites - { "orbs.u13", 0x80000, 0x784bdc1a, 0x03 | BRF_GRA }, // 3 - { "orbs.u12", 0x80000, 0xb8c352c2, 0x03 | BRF_GRA }, // 4 - { "orbs.u11", 0x80000, 0x58cb38ba, 0x03 | BRF_GRA }, // 5 - - { "orbs.u15", 0x80000, 0xbc0e9fe3, 0x06 | BRF_SND }, // 6 x1-010 Samples - { "orbs.u16", 0x80000, 0xaecd8373, 0x06 | BRF_SND }, // 7 -}; - -STD_ROM_PICK(orbs) -STD_ROM_FN(orbs) - -static INT32 orbsInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(pairlove68kInit, 7159090, SET_IRQLINES(2, 1), NO_SPRITE_BUFFER, SET_GFX_DECODE(5, -1, -1)); -} - -struct BurnDriver BurnDrvOrbs = { - "orbs", NULL, NULL, NULL, "1994", - "Orbs (10/7/94 prototype?)\0", NULL, "American Sammy", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_PUZZLE, 0, - NULL, orbsRomInfo, orbsRomName, NULL, NULL, OrbsInputInfo, OrbsDIPInfo, - orbsInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// Kero Kero Keroppi's Let's Play Together (USA, Version 2.0) - -static struct BurnRomInfo keroppiRomDesc[] = { - { "keroppi jr. code (u10) v1.0.u10", 0x40000, 0x1fc2e895, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "keroppi jr. code (u9) v1.0.u9", 0x40000, 0xe0599e7b, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "keroppi jr. chr(u11) v1.0.u11", 0x80000, 0x74148c23, 0x03 | BRF_GRA }, // 2 - { "keroppi jr. chr(u12) v1.0.u12", 0x80000, 0x6f4dae98, 0x03 | BRF_GRA }, // 3 - - { "keroppi jr. snd (u15) v1.0.u15", 0x80000, 0xc98dacf0, 0x06 | BRF_SND }, // 4 x1-010 Samples - { "keroppi jr. snd (u16) v1.0.u16", 0x80000, 0xd61e5a32, 0x06 | BRF_SND }, // 5 -}; - -STD_ROM_PICK(keroppi) -STD_ROM_FN(keroppi) - -static INT32 keroppiInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(pairlove68kInit, 7159090, SET_IRQLINES(2, 1), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, -1, -1)); -} - -struct BurnDriver BurnDrvKeroppi = { - "keroppi", NULL, NULL, NULL, "1995", - "Kero Kero Keroppi's Let's Play Together (USA, Version 2.0)\0", NULL, "American Sammy", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_SETA1, GBF_MINIGAMES, 0, - NULL, keroppiRomInfo, keroppiRomName, NULL, NULL, KeroppiInputInfo, KeroppiDIPInfo, - keroppiInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - -// Kero Kero Keroppi no Issyoni Asobou (Japan) - -static struct BurnRomInfo keroppijRomDesc[] = { - { "ft-001-001.u10", 0x80000, 0x37861e7d, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ft-001-002.u9", 0x80000, 0xf531d4ef, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "ft-001-003.u14", 0x80000, 0x62fb22fb, 0x03 | BRF_GRA }, // 2 Sprites - { "ft-001-004.u13", 0x80000, 0x69908c98, 0x03 | BRF_GRA }, // 3 - { "ft-001-005.u12", 0x80000, 0xde6432a8, 0x03 | BRF_GRA }, // 4 - { "ft-001-006.u11", 0x80000, 0x9c500eae, 0x03 | BRF_GRA }, // 5 - - { "ft-001-007.u15", 0x80000, 0xc98dacf0, 0x06 | BRF_SND }, // 6 x1-010 Samples - { "ft-001-008.u16", 0x80000, 0xb9c4b637, 0x06 | BRF_SND }, // 7 -}; - -STD_ROM_PICK(keroppij) -STD_ROM_FN(keroppij) - -struct BurnDriver BurnDrvKeroppij = { - "keroppij", "keroppi", NULL, NULL, "1993", - "Kero Kero Keroppi no Issyoni Asobou (Japan)\0", NULL, "Sammy Industries", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_SETA1, GBF_MINIGAMES, 0, - NULL, keroppijRomInfo, keroppijRomName, NULL, NULL, KeroppiInputInfo, KeroppiDIPInfo, - orbsInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 320, 240, 4, 3 -}; - - -// J. J. Squawkers - -static struct BurnRomInfo jjsquawkRomDesc[] = { - { "fe2002001.u3", 0x80000, 0x7b9af960, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fe2002002.u4", 0x80000, 0x47dd71a3, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fe2001009", 0x80000, 0x27441cd3, 0x03 | BRF_GRA }, // 2 Sprites - { "fe2001010", 0x80000, 0xca2b42c4, 0x03 | BRF_GRA }, // 3 - { "fe2001007", 0x80000, 0x62c45658, 0x03 | BRF_GRA }, // 4 - { "fe2001008", 0x80000, 0x2690c57b, 0x03 | BRF_GRA }, // 5 - - { "fe2001011", 0x80000, 0x98b9f4b4, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - { "fe2001012", 0x80000, 0xd4aa916c, 0x04 | BRF_GRA }, // 7 - { "fe2001003", 0x80000, 0xa5a35caf, 0x1c | BRF_GRA }, // 8 - - { "fe2001014", 0x80000, 0x274bbb48, 0x05 | BRF_GRA }, // 9 Layer 2 tiles - { "fe2001013", 0x80000, 0x51e29871, 0x05 | BRF_GRA }, // 10 - { "fe2001004", 0x80000, 0xa235488e, 0x1d | BRF_GRA }, // 11 - - { "fe2001005.u69", 0x80000, 0xd99f2879, 0x06 | BRF_SND }, // 12 x1-010 Samples - { "fe2001006.u70", 0x80000, 0x9df1e478, 0x06 | BRF_SND }, // 13 -}; - -STD_ROM_PICK(jjsquawk) -STD_ROM_FN(jjsquawk) - -static INT32 jjsquawkInit() -{ - DrvSetVideoOffsets(1, 1, -1, -1); - DrvSetColorOffsets(0, 0x200, 0xa00); - - INT32 nRet = DrvInit(wrofaero68kInit, 16000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 3, 3)); - - if (nRet == 0) { - jjsquawkSetColorTable(); - - memcpy (Drv68KROM + 0x100000, Drv68KROM + 0x080000, 0x080000); - memset (Drv68KROM + 0x080000, 0, 0x080000); - } - - return nRet; -} - -struct BurnDriver BurnDrvJjsquawk = { - "jjsquawk", NULL, NULL, NULL, "1993", - "J. J. Squawkers\0", NULL, "Athena / Able", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_PLATFORM, 0, - NULL, jjsquawkRomInfo, jjsquawkRomName, NULL, NULL, JjsquawkInputInfo, JjsquawkDIPInfo, - jjsquawkInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 240, 4, 3 -}; - - -// J. J. Squawkers (older) -/* Official 93111A PCB missing version sticker */ - -static struct BurnRomInfo jjsquawkoRomDesc[] = { - { "fe2001001.u3", 0x80000, 0x921c9762, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fe2001002.u4", 0x80000, 0x0227a2be, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fe2001009", 0x80000, 0x27441cd3, 0x03 | BRF_GRA }, // 2 Sprites - { "fe2001010", 0x80000, 0xca2b42c4, 0x03 | BRF_GRA }, // 3 - { "fe2001007", 0x80000, 0x62c45658, 0x03 | BRF_GRA }, // 4 - { "fe2001008", 0x80000, 0x2690c57b, 0x03 | BRF_GRA }, // 5 - - { "fe2001011", 0x80000, 0x98b9f4b4, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - { "fe2001012", 0x80000, 0xd4aa916c, 0x04 | BRF_GRA }, // 7 - { "fe2001003", 0x80000, 0xa5a35caf, 0x1c | BRF_GRA }, // 8 - - { "fe2001014", 0x80000, 0x274bbb48, 0x05 | BRF_GRA }, // 9 Layer 2 tiles - { "fe2001013", 0x80000, 0x51e29871, 0x05 | BRF_GRA }, // 10 - { "fe2001004", 0x80000, 0xa235488e, 0x1d | BRF_GRA }, // 11 - - { "fe2001005.u69", 0x80000, 0xd99f2879, 0x06 | BRF_SND }, // 12 x1-010 Samples - { "fe2001006.u70", 0x80000, 0x9df1e478, 0x06 | BRF_SND }, // 13 -}; - -STD_ROM_PICK(jjsquawko) -STD_ROM_FN(jjsquawko) - -struct BurnDriver BurnDrvJjsquawko = { - "jjsquawko", "jjsquawk", NULL, NULL, "1993", - "J. J. Squawkers (older)\0", NULL, "Athena / Able", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA1, GBF_PLATFORM, 0, - NULL, jjsquawkoRomInfo, jjsquawkoRomName, NULL, NULL, JjsquawkInputInfo, JjsquawkDIPInfo, - jjsquawkInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 240, 4, 3 -}; - - -// J. J. Squawkers (bootleg, Blandia conversion) -/* PCB was P0-078A, which was a Blandia board converted to JJ Squawkers. -No labels on any of the ROMs. Apparently based on jjsquawko set. */ - -static struct BurnRomInfo jjsquawkb2RomDesc[] = { - { "u3.3a", 0x080000, 0xf94c913b, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "u4.4a", 0x080000, 0x0227a2be, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "u64.3l", 0x100000, 0x11d8713a, 0x03 | BRF_GRA }, // 2 Sprites // jj-rom9 + jj-rom10 - { "u63.2l", 0x100000, 0x7a385ef0, 0x03 | BRF_GRA }, // 3 // jj-rom7 + jj-rom8 - - { "u66.5l", 0x100000, 0xbbaf40c5, 0x04 | BRF_GRA }, // 4 Layer 1 tiles // jj-rom11 + jj-rom12 - { "u65.4l", 0x080000, 0xa5a35caf, 0x1c | BRF_GRA }, // 5 // jj-rom3.040 - - { "u68.7l", 0x100000, 0xae9ae01f, 0x05 | BRF_GRA }, // 9 Layer 2 tiles // jj-rom14 + jj-rom13 - { "u67.6l", 0x080000, 0xa235488e, 0x1d | BRF_GRA }, // 10 // jj-rom4.040 - - { "u70.10l", 0x100000, 0x181a55b8, 0x06 | BRF_SND }, // 11 x1-010 Samples // jj-rom5.040 + jj-rom6.040 -}; - -STD_ROM_PICK(jjsquawkb2) -STD_ROM_FN(jjsquawkb2) - -struct BurnDriver BurnDrvJjsquawkb2 = { - "jjsquawkb2", "jjsquawk", NULL, NULL, "1993", - "J. J. Squawkers (bootleg, Blandia conversion)\0", NULL, "bootleg", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA1, GBF_PLATFORM, 0, - NULL, jjsquawkb2RomInfo, jjsquawkb2RomName, NULL, NULL, JjsquawkInputInfo, JjsquawkDIPInfo, - jjsquawkInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 240, 4, 3 -}; - - -// J. J. Squawkers (bootleg) - -static struct BurnRomInfo jjsquawkbRomDesc[] = { - { "3", 0x080000, 0xafd5bd07, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2", 0x080000, 0x740a7366, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "4.bin", 0x200000, 0x969502f7, 0x03 | BRF_GRA }, // 2 Sprites - { "2.bin", 0x200000, 0x765253d1, 0x03 | BRF_GRA }, // 3 - - { "3.bin", 0x200000, 0xb1e3a4bb, 0x04 | BRF_GRA }, // 4 Layer 1 tiles - { "1.bin", 0x200000, 0xa5d37cf7, 0x04 | BRF_GRA }, // 5 - - { "1", 0x100000, 0x181a55b8, 0x06 | BRF_SND }, // 6 x1-010 Samples -}; - -STD_ROM_PICK(jjsquawkb) -STD_ROM_FN(jjsquawkb) - -static INT32 jjsquawkbInit() -{ - DrvSetVideoOffsets(1, 1, -1, -1); - DrvSetColorOffsets(0, 0x200, 0xa00); - - INT32 nRet = DrvInit(jjsquawkb68kInit, 16000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 3, 3)); - - if (nRet == 0) { - jjsquawkSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvJjsquawkb = { - "jjsquawkb", "jjsquawk", NULL, NULL, "1993", - "J. J. Squawkers (bootleg)\0", NULL, "bootleg", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SETA1, GBF_PLATFORM, 0, - NULL, jjsquawkbRomInfo, jjsquawkbRomName, NULL, NULL, JjsquawkInputInfo, JjsquawkDIPInfo, - jjsquawkbInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 240, 4, 3 -}; - - -// Extreme Downhill (v1.5) - -static struct BurnRomInfo extdwnhlRomDesc[] = { - { "fw001002.201", 0x080000, 0x24d21924, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fw001001.200", 0x080000, 0xfb12a28b, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fw001003.202", 0x200000, 0xac9b31d5, 0x03 | BRF_GRA }, // 2 Sprites - - { "fw001004.206", 0x200000, 0x0dcb1d72, 0x04 | BRF_GRA }, // 3 Layer 1 tiles - { "fw001005.205", 0x100000, 0x5c33b2f1, 0x1c | BRF_GRA }, // 4 - - { "fw001006.152", 0x200000, 0xd00e8ddd, 0x05 | BRF_GRA }, // 5 Layer 2 tiles - - { "fw001007.026", 0x100000, 0x16d84d7a, 0x06 | BRF_SND }, // 6 x1-010 Samples -}; - -STD_ROM_PICK(extdwnhl) -STD_ROM_FN(extdwnhl) - -static INT32 extdwnhlInit() -{ - watchdog_enable = 1; - - DrvSetVideoOffsets(0, 0, -2, -2); - DrvSetColorOffsets(0, 0x400, 0x200); - - INT32 nRet = DrvInit(extdwnhl68kInit, 16000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 3, 2)); - - if (nRet == 0) { - zingzapSetColorTable(); - if (DrvGfxTransMask[2] == NULL) { - DrvGfxTransMask[2] = DrvGfxTransMask[1]; // sokonuke fix - } - } - - return nRet; -} - -struct BurnDriver BurnDrvExtdwnhl = { - "extdwnhl", NULL, NULL, NULL, "1995", - "Extreme Downhill (v1.5)\0", NULL, "Sammy Industries Japan", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_RACING, 0, - NULL, extdwnhlRomInfo, extdwnhlRomName, NULL, NULL, ExtdwnhlInputInfo, ExtdwnhlDIPInfo, - extdwnhlInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 320, 240, 4, 3 -}; - - -// Sokonuke Taisen Game (Japan) - -static struct BurnRomInfo sokonukeRomDesc[] = { - { "001-001.bin", 0x080000, 0x9d0aa3ca, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "001-002.bin", 0x080000, 0x96f2ef5f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "001-003.bin", 0x200000, 0xab9ba897, 0x03 | BRF_GRA }, // 2 Sprites - - { "001-004.bin", 0x100000, 0x34ca3540, 0x04 | BRF_GRA }, // 3 Layer 1 tiles - { "001-005.bin", 0x080000, 0x2b95d68d, 0x1c | BRF_GRA }, // 4 - - { "001-006.bin", 0x100000, 0xecfac767, 0x06 | BRF_SND }, // 5 x1-010 Samples -}; - -STD_ROM_PICK(sokonuke) -STD_ROM_FN(sokonuke) - -struct BurnDriver BurnDrvSokonuke = { - "sokonuke", NULL, NULL, NULL, "1995", - "Sokonuke Taisen Game (Japan)\0", NULL, "Sammy Industries", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_PLATFORM, 0, - NULL, sokonukeRomInfo, sokonukeRomName, NULL, NULL, SokonukeInputInfo, SokonukeDIPInfo, - extdwnhlInit, DrvExit, DrvFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 320, 240, 4, 3 -}; - - -// Krazy Bowl - -static struct BurnRomInfo krzybowlRomDesc[] = { - { "fv001.002", 0x40000, 0x8c03c75f, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fv001.001", 0x40000, 0xf0630beb, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fv001.003", 0x80000, 0x7de22749, 0x03 | BRF_GRA }, // 2 Sprites - { "fv001.004", 0x80000, 0xc7d2fe32, 0x03 | BRF_GRA }, // 3 - - { "fv001.005", 0x80000, 0x5e206062, 0x06 | BRF_SND }, // 4 x1-010 Samples - { "fv001.006", 0x80000, 0x572a15e7, 0x06 | BRF_SND }, // 5 -}; - -STD_ROM_PICK(krzybowl) -STD_ROM_FN(krzybowl) - -static INT32 krzybowlInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - trackball_mode = 1; - - INT32 rc = DrvInit(krzybowl68kInit, 16000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, -1, -1)); - - VideoOffsets[2][0] = 8; - - return rc; -} - -struct BurnDriver BurnDrvKrzybowl = { - "krzybowl", NULL, NULL, NULL, "1994", - "Krazy Bowl\0", NULL, "American Sammy", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_SPORTSMISC, 0, - NULL, krzybowlRomInfo, krzybowlRomName, NULL, NULL, KrzybowlInputInfo, KrzybowlDIPInfo, - krzybowlInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 232, 320, 3, 4 -}; - - -// Wiggie Waggie -// hack of Thunder & Lightning - -static struct BurnRomInfo wiggieRomDesc[] = { - { "wiggie.e19", 0x10000, 0x24b58f16, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "wiggie.e21", 0x10000, 0x83ba6edb, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "wiggie.a5", 0x10000, 0x8078d77b, 0x02 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "wiggie.j16", 0x20000, 0x4fb40b8a, 0x03 | BRF_GRA }, // 3 Sprites - { "wiggie.j18", 0x20000, 0xebc418e9, 0x03 | BRF_GRA }, // 4 - { "wiggie.j20", 0x20000, 0xc073501b, 0x03 | BRF_GRA }, // 5 - { "wiggie.j21", 0x20000, 0x22f6fa39, 0x03 | BRF_GRA }, // 6 - - { "wiggie.d1", 0x40000, 0x27fbe12a, 0x06 | BRF_SND }, // 7 OKI M6295 Samples -}; - -STD_ROM_PICK(wiggie) -STD_ROM_FN(wiggie) - -static INT32 wiggieInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(wiggie68kInit, 16000000 / 2, SET_IRQLINES(2, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(6, -1, -1)); -} - -struct BurnDriver BurnDrvWiggie = { - "wiggie", NULL, NULL, NULL, "1994", - "Wiggie Waggie\0", NULL, "Promat", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_BREAKOUT, 0, - NULL, wiggieRomInfo, wiggieRomName, NULL, NULL, ThunderlInputInfo, ThunderlDIPInfo, - wiggieInit, DrvExit, DrvZ80M6295Frame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 240, 384, 3, 4 -}; - - -// Super Bar -// hack of Thunder & Lightning - -static struct BurnRomInfo superbarRomDesc[] = { - { "promat_512-1.e19", 0x10000, 0xcc7f9e87, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "promat_512-2.e21", 0x10000, 0x5e8c7231, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "promat.a5", 0x10000, 0x8078d77b, 0x02 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "promat_1m-4.j16", 0x20000, 0x43dbc99f, 0x03 | BRF_GRA }, // 3 Sprites - { "promat_1m-5.j18", 0x20000, 0xc09344b0, 0x03 | BRF_GRA }, // 4 - { "promat_1m-6.j20", 0x20000, 0x7d83f8ba, 0x03 | BRF_GRA }, // 5 - { "promat_1m-7.j21", 0x20000, 0x734df92a, 0x03 | BRF_GRA }, // 6 - - { "promat_2m-1.d1", 0x40000, 0x27fbe12a, 0x06 | BRF_SND }, // 7 OKI M6295 Samples -}; - -STD_ROM_PICK(superbar) -STD_ROM_FN(superbar) - -static INT32 superbarInit() -{ - DrvSetVideoOffsets(0, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(wiggie68kInit, 8000000, SET_IRQLINES(2, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(7, -1, -1)); -} - -struct BurnDriver BurnDrvSuperbar = { - "superbar", "wiggie", NULL, NULL, "1994", - "Super Bar\0", NULL, "Promat", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_BREAKOUT, 0, - NULL, superbarRomInfo, superbarRomName, NULL, NULL, ThunderlInputInfo, ThunderlDIPInfo, - superbarInit, DrvExit, DrvZ80M6295Frame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 240, 384, 3, 4 -}; - - -// Ultra Toukon Densetsu (Japan) - -static struct BurnRomInfo utoukondRomDesc[] = { - { "93uta010.3", 0x080000, 0xc486ef5e, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "93uta011.4", 0x080000, 0x978978f7, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "93uta009.112", 0x010000, 0x67f18483, 0x02 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "93uta04.64", 0x100000, 0x9cba0538, 0x03 | BRF_GRA }, // 3 Sprites - { "93uta02.201", 0x100000, 0x884fedfa, 0x03 | BRF_GRA }, // 4 - { "93uta03.63", 0x100000, 0x818484a5, 0x03 | BRF_GRA }, // 5 - { "93uta01.200", 0x100000, 0x364de841, 0x03 | BRF_GRA }, // 6 - - { "93uta05.66", 0x100000, 0x5e640bfb, 0x04 | BRF_GRA }, // 7 Layer 1 tiles - - { "93uta07.68", 0x100000, 0x67bdd036, 0x05 | BRF_GRA }, // 8 Layer 2 tiles - { "93uta06.67", 0x100000, 0x294c26e4, 0x05 | BRF_GRA }, // 9 - - { "93uta08.69", 0x100000, 0x3d50bbcd, 0x06 | BRF_SND }, // 10 x1-010 Samples -}; - -STD_ROM_PICK(utoukond) -STD_ROM_FN(utoukond) - -static INT32 utoukondInit() -{ - DrvSetVideoOffsets(0, 0, -2, 0); - DrvSetColorOffsets(0, 0x400, 0x200); - - return DrvInit(utoukond68kInit, 16000000, SET_IRQLINES(2, 1), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 2, 2)); -} - -struct BurnDriver BurnDrvUtoukond = { - "utoukond", NULL, NULL, NULL, "1993", - "Ultra Toukon Densetsu (Japan)\0", NULL, "Banpresto / Tsuburaya Productions", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_VSFIGHT, 0, - NULL, utoukondRomInfo, utoukondRomName, NULL, NULL, UtoukondInputInfo, UtoukondDIPInfo, - utoukondInit, DrvExit, Drv68kZ80YM3438Frame, seta2layerDraw, DrvScan, &DrvRecalc, 0x600, - 384, 224, 4, 3 -}; - - -// DownTown / Mokugeki (Set 1) - -static struct BurnRomInfo downtownRomDesc[] = { - { "ud2-001-000.3c", 0x40000, 0xf1965260, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ud2-001-003.11c", 0x40000, 0xe7d5fa5f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ud2001002.9b", 0x10000, 0xa300e3ac, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ud2001001.8b", 0x10000, 0xd2918094, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ud2-002-004.17c", 0x40000, 0xbbd538b1, 0x02 | BRF_PRG | BRF_ESS }, // 4 M65c02 Code - - { "ud2-001-005-t01.2n", 0x80000, 0x77e6d249, 0x0b | BRF_GRA }, // 5 Sprites - { "ud2-001-006-t02.3n", 0x80000, 0x6e381bf2, 0x0b | BRF_GRA }, // 6 - { "ud2-001-007-t03.5n", 0x80000, 0x737b4971, 0x0b | BRF_GRA }, // 7 - { "ud2-001-008-t04.6n", 0x80000, 0x99b9d757, 0x0b | BRF_GRA }, // 8 - - { "ud2-001-009-t05.8n", 0x80000, 0xaee6c581, 0x04 | BRF_GRA }, // 9 Layer 1 tiles - { "ud2-001-010-t06.9n", 0x80000, 0x3d399d54, 0x04 | BRF_GRA }, // 10 - - { "ud2-001-011-t07.14n", 0x80000, 0x9c9ff69f, 0x06 | BRF_SND }, // 11 x1-010 Samples -}; - -STD_ROM_PICK(downtown) -STD_ROM_FN(downtown) - -static INT32 downtownInit() -{ - refresh_rate = 5742; // 57.42 hz - DrvSetVideoOffsets(0, 0, -1, 0); - DrvSetColorOffsets(0, 0, 0); - - INT32 nRet = DrvInit(downtown68kInit, 8000000, SET_IRQLINES(1, 2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 1, -1)); - - return nRet; -} - -struct BurnDriver BurnDrvDowntown = { - "downtown", NULL, NULL, NULL, "1989", - "DownTown / Mokugeki (Set 1)\0", NULL, "Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_SCRFIGHT, 0, - NULL, downtownRomInfo, downtownRomName, NULL, NULL, DowntownInputInfo, DowntownDIPInfo, - downtownInit, DrvExit, DrvDowntownFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 224, 384, 3, 4 -}; - - -// DownTown / Mokugeki (Set 2) - -static struct BurnRomInfo downtown2RomDesc[] = { - { "ud2-001-000.3c", 0x40000, 0xf1965260, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ud2-001-003.11c", 0x40000, 0xe7d5fa5f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ud2000002.9b", 0x10000, 0xca976b24, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ud2000001.8b", 0x10000, 0x1708aebd, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ud2-002-004.17c", 0x40000, 0xbbd538b1, 0x02 | BRF_PRG | BRF_ESS }, // 4 M65c02 Code - - { "ud2-001-005-t01.2n", 0x80000, 0x77e6d249, 0x0b | BRF_GRA }, // 5 Sprites - { "ud2-001-006-t02.3n", 0x80000, 0x6e381bf2, 0x0b | BRF_GRA }, // 6 - { "ud2-001-007-t03.5n", 0x80000, 0x737b4971, 0x0b | BRF_GRA }, // 7 - { "ud2-001-008-t04.6n", 0x80000, 0x99b9d757, 0x0b | BRF_GRA }, // 8 - - { "ud2-001-009-t05.8n", 0x80000, 0xaee6c581, 0x04 | BRF_GRA }, // 9 Layer 1 tiles - { "ud2-001-010-t06.9n", 0x80000, 0x3d399d54, 0x04 | BRF_GRA }, // 10 - - { "ud2-001-011-t07.14n", 0x80000, 0x9c9ff69f, 0x06 | BRF_SND }, // 11 x1-010 Samples -}; - -STD_ROM_PICK(downtown2) -STD_ROM_FN(downtown2) - -struct BurnDriver BurnDrvDowntown2 = { - "downtown2", "downtown", NULL, NULL, "1989", - "DownTown / Mokugeki (Set 2)\0", NULL, "Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_SCRFIGHT, 0, - NULL, downtown2RomInfo, downtown2RomName, NULL, NULL, DowntownInputInfo, DowntownDIPInfo, - downtownInit, DrvExit, DrvDowntownFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 224, 384, 3, 4 -}; - - -// DownTown / Mokugeki (Joystick Hack) - -static struct BurnRomInfo downtownjRomDesc[] = { - { "ud2-001-000.3c", 0x40000, 0xf1965260, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ud2-001-003.11c", 0x40000, 0xe7d5fa5f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "u37.9b", 0x10000, 0x73047657, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "u31.8b", 0x10000, 0x6a050240, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ud2-002-004.17c", 0x40000, 0xbbd538b1, 0x02 | BRF_PRG | BRF_ESS }, // 4 M65c02 Code - - { "ud2-001-005-t01.2n", 0x80000, 0x77e6d249, 0x0b | BRF_GRA }, // 5 Sprites - { "ud2-001-006-t02.3n", 0x80000, 0x6e381bf2, 0x0b | BRF_GRA }, // 6 - { "ud2-001-007-t03.5n", 0x80000, 0x737b4971, 0x0b | BRF_GRA }, // 7 - { "ud2-001-008-t04.6n", 0x80000, 0x99b9d757, 0x0b | BRF_GRA }, // 8 - - { "ud2-001-009-t05.8n", 0x80000, 0xaee6c581, 0x04 | BRF_GRA }, // 9 Layer 1 tiles - { "ud2-001-010-t06.9n", 0x80000, 0x3d399d54, 0x04 | BRF_GRA }, // 10 - - { "ud2-001-011-t07.14n", 0x80000, 0x9c9ff69f, 0x06 | BRF_SND }, // 11 x1-010 Samples -}; - -STD_ROM_PICK(downtownj) -STD_ROM_FN(downtownj) - -struct BurnDriver BurnDrvDowntownj = { - "downtownj", "downtown", NULL, NULL, "1989", - "DownTown / Mokugeki (Joystick Hack)\0", NULL, "Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_SCRFIGHT, 0, - NULL, downtownjRomInfo, downtownjRomName, NULL, NULL, DowntownInputInfo, DowntownDIPInfo, - downtownInit, DrvExit, DrvDowntownFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 224, 384, 3, 4 -}; - - -// DownTown / Mokugeki (prototype) - -static struct BurnRomInfo downtownpRomDesc[] = { - { "ud2-001-000.3c", 0x40000, 0xf1965260, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ud2-001-003.11c", 0x40000, 0xe7d5fa5f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ud2_even_v061.9b", 0x10000, 0x251d6552, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ud2_odd_v061.8b", 0x10000, 0x6394a7c0, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ud2-002-004.17c", 0x40000, 0xbbd538b1, 0x02 | BRF_PRG | BRF_ESS }, // 4 M65c02 Code - - { "ud2-001-005-t01.2n", 0x80000, 0x77e6d249, 0x0b | BRF_GRA }, // 5 Sprites - { "ud2-001-006-t02.3n", 0x80000, 0x6e381bf2, 0x0b | BRF_GRA }, // 6 - { "ud2-001-007-t03.5n", 0x80000, 0x737b4971, 0x0b | BRF_GRA }, // 7 - { "ud2-001-008-t04.6n", 0x80000, 0x99b9d757, 0x0b | BRF_GRA }, // 8 - - { "ud2-001-009-t05.8n", 0x80000, 0xaee6c581, 0x04 | BRF_GRA }, // 9 Layer 1 tiles - { "ud2-001-010-t06.9n", 0x80000, 0x3d399d54, 0x04 | BRF_GRA }, // 10 - - { "ud2-001-011-t07.14n", 0x80000, 0x9c9ff69f, 0x06 | BRF_SND }, // 11 x1-010 Samples -}; - -STD_ROM_PICK(downtownp) -STD_ROM_FN(downtownp) - -struct BurnDriver BurnDrvDowntownp = { - "downtownp", "downtown", NULL, NULL, "1989", - "DownTown / Mokugeki (prototype)\0", NULL, "Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_SCRFIGHT, 0, - NULL, downtownpRomInfo, downtownpRomName, NULL, NULL, DowntownInputInfo, DowntownDIPInfo, - downtownInit, DrvExit, DrvDowntownFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 224, 384, 3, 4 -}; - - -// Thundercade / Twin Formation - -static struct BurnRomInfo tndrcadeRomDesc[] = { - { "ua0-4.u19", 0x20000, 0x73bd63eb, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ua0-2.u17", 0x20000, 0xe96194b1, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ua0-3.u18", 0x20000, 0x0a7b1c41, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ua0-1.u16", 0x20000, 0xfa906626, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ua10-5.u24", 0x20000, 0x8eff6122, 0x02 | BRF_PRG | BRF_ESS }, // 4 M65c02 Code - - { "ua0-10.u12", 0x40000, 0xaa7b6757, 0x03 | BRF_GRA }, // 5 Sprites - { "ua0-11.u13", 0x40000, 0x11eaf931, 0x03 | BRF_GRA }, // 6 - { "ua0-12.u14", 0x40000, 0x00b5381c, 0x03 | BRF_GRA }, // 7 - { "ua0-13.u15", 0x40000, 0x8f9a0ed3, 0x03 | BRF_GRA }, // 8 - { "ua0-6.u8", 0x40000, 0x14ecc7bb, 0x03 | BRF_GRA }, // 9 - { "ua0-7.u9", 0x40000, 0xff1a4e68, 0x03 | BRF_GRA }, // 10 - { "ua0-8.u10", 0x40000, 0x936e1884, 0x03 | BRF_GRA }, // 11 - { "ua0-9.u11", 0x40000, 0xe812371c, 0x03 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(tndrcade) -STD_ROM_FN(tndrcade) - -static INT32 tndrcadeInit() -{ - DrvSetVideoOffsets(-1, 0, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - oisipuzl_hack = 1; - - return DrvInit(tndrcade68kInit, 8000000, SET_IRQLINES(2, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, -1, -1)); -} - -struct BurnDriver BurnDrvTndrcade = { - "tndrcade", NULL, NULL, NULL, "1987", - "Thundercade / Twin Formation\0", NULL, "Seta (Taito license)", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, tndrcadeRomInfo, tndrcadeRomName, NULL, NULL, TndrcadeInputInfo, TndrcadeDIPInfo, - tndrcadeInit, DrvExit, DrvTndrcadeFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 224, 384, 3, 4 -}; - - -// Tokusyu Butai U.A.G. (Japan) - -static struct BurnRomInfo tndrcadejRomDesc[] = { - { "ua0-4.u19", 0x20000, 0x73bd63eb, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ua0-2.u17", 0x20000, 0xe96194b1, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ua0-3.u18", 0x20000, 0x0a7b1c41, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ua0-1.u16", 0x20000, 0xfa906626, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "thcade5.u24", 0x20000, 0x8cb9df7b, 0x02 | BRF_PRG | BRF_ESS }, // 4 M65c02 Code - - { "ua0-10.u12", 0x40000, 0xaa7b6757, 0x03 | BRF_GRA }, // 5 Sprites - { "ua0-11.u13", 0x40000, 0x11eaf931, 0x03 | BRF_GRA }, // 6 - { "ua0-12.u14", 0x40000, 0x00b5381c, 0x03 | BRF_GRA }, // 7 - { "ua0-13.u15", 0x40000, 0x8f9a0ed3, 0x03 | BRF_GRA }, // 8 - { "ua0-6.u8", 0x40000, 0x14ecc7bb, 0x03 | BRF_GRA }, // 9 - { "ua0-7.u9", 0x40000, 0xff1a4e68, 0x03 | BRF_GRA }, // 10 - { "ua0-8.u10", 0x40000, 0x936e1884, 0x03 | BRF_GRA }, // 11 - { "ua0-9.u11", 0x40000, 0xe812371c, 0x03 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(tndrcadej) -STD_ROM_FN(tndrcadej) - -struct BurnDriver BurnDrvTndrcadej = { - "tndrcadej", "tndrcade", NULL, NULL, "1987", - "Tokusyu Butai U.A.G. (Japan)\0", NULL, "Seta (Taito license)", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, tndrcadejRomInfo, tndrcadejRomName, NULL, NULL, TndrcadeInputInfo, TndrcadjDIPInfo, - tndrcadeInit, DrvExit, DrvTndrcadeFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 224, 384, 3, 4 -}; - - -// Arbalester - -static struct BurnRomInfo arbalestRomDesc[] = { - { "uk-001-003", 0x40000, 0xee878a2c, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "uk-001-004", 0x40000, 0x902bb4e3, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - /* Label is correct, 1st & 2nd halves identical is correct. Chip is a 27128 - Verified on 2 different PCBs */ - { "uk6005", 0x04000, 0x48c73a4a, 0x02 | BRF_PRG | BRF_ESS }, // 2 M65c02 Code - - { "uk001.06", 0x40000, 0x11c75746, 0x0b | BRF_GRA }, // 3 Sprites - { "uk001.07", 0x40000, 0x01b166c7, 0x0b | BRF_GRA }, // 4 - { "uk001.08", 0x40000, 0x78d60ba3, 0x0b | BRF_GRA }, // 5 - { "uk001.09", 0x40000, 0xb4748ae0, 0x0b | BRF_GRA }, // 6 - - { "uk-001-010-t26", 0x80000, 0xc1e2f823, 0x04 | BRF_GRA }, // 7 Layer 1 tiles - { "uk-001-011-t27", 0x80000, 0x09dfe56a, 0x04 | BRF_GRA }, // 8 - { "uk-001-012-t28", 0x80000, 0x818a4085, 0x04 | BRF_GRA }, // 9 - { "uk-001-013-t29", 0x80000, 0x771fa164, 0x04 | BRF_GRA }, // 10 - - { "uk-001-015-t31", 0x80000, 0xce9df5dd, 0x06 | BRF_SND }, // 11 x1-010 Samples - { "uk-001-014-t30", 0x80000, 0x016b844a, 0x06 | BRF_SND }, // 12 -}; - -STD_ROM_PICK(arbalest) -STD_ROM_FN(arbalest) - -static INT32 arbalestInit() -{ - INT32 rc = 0; - DrvSetVideoOffsets(0, 1, -2, -1); - DrvSetColorOffsets(0, 0, 0); - X1010_Arbalester_Mode = 1; - rc = DrvInit(metafox68kInit, 8000000, SET_IRQLINES(3, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 1, -1)); - - return rc; -} - -struct BurnDriver BurnDrvArbalest = { - "arbalest", NULL, NULL, NULL, "1989", - "Arbalester\0", NULL, "Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, arbalestRomInfo, arbalestRomName, NULL, NULL, MetafoxInputInfo, ArbalestDIPInfo, - arbalestInit, DrvExit, DrvTwineaglFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 224, 384, 3, 4 -}; - - -// Meta Fox - -static struct BurnRomInfo metafoxRomDesc[] = { - { "p1003161", 0x40000, 0x4fd6e6a1, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "p1004162", 0x40000, 0xb6356c9a, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "up001002", 0x10000, 0xce91c987, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "up001001", 0x10000, 0x0db7a505, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "up001005", 0x02000, 0x2ac5e3e3, 0x02 | BRF_PRG | BRF_ESS }, // 4 m65c02 Code - - { "p1006163", 0x40000, 0x80f69c7c, 0x0b | BRF_GRA }, // 5 Sprites - { "p1007164", 0x40000, 0xd137e1a3, 0x0b | BRF_GRA }, // 6 - { "p1008165", 0x40000, 0x57494f2b, 0x0b | BRF_GRA }, // 7 - { "p1009166", 0x40000, 0x8344afd2, 0x0b | BRF_GRA }, // 8 - - { "up001010", 0x80000, 0xbfbab472, 0x04 | BRF_GRA }, // 9 Layer 1 tiles - { "up001011", 0x80000, 0x26cea381, 0x04 | BRF_GRA }, // 10 - { "up001012", 0x80000, 0xfed2c5f9, 0x04 | BRF_GRA }, // 11 - { "up001013", 0x80000, 0xadabf9ea, 0x04 | BRF_GRA }, // 12 - - { "up001015", 0x80000, 0x2e20e39f, 0x06 | BRF_SND }, // 13 x1-010 Samples - { "up001014", 0x80000, 0xfca6315e, 0x06 | BRF_SND }, // 14 -}; - -STD_ROM_PICK(metafox) -STD_ROM_FN(metafox) - -static INT32 metafoxInit() -{ - DrvSetVideoOffsets(0, 0, 16, -19); - DrvSetColorOffsets(0, 0, 0); - - INT32 nRet = DrvInit(metafox68kInit, 8000000, SET_IRQLINES(3, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 1, -1)); - - if (nRet == 0) { - *((UINT16*)(Drv68KROM + 0x8ab1c)) = 0x4e71; - *((UINT16*)(Drv68KROM + 0x8ab1e)) = 0x4e71; - *((UINT16*)(Drv68KROM + 0x8ab20)) = 0x4e71; - } - - return nRet; -} - -struct BurnDriver BurnDrvMetafox = { - "metafox", NULL, NULL, NULL, "1989", - "Meta Fox\0", NULL, "Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, metafoxRomInfo, metafoxRomName, NULL, NULL, MetafoxInputInfo, MetafoxDIPInfo, - metafoxInit, DrvExit, DrvTwineaglFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 224, 384, 3, 4 -}; - - -// Pro Mahjong Kiwame - -static struct BurnRomInfo kiwameRomDesc[] = { - { "fp001001.bin", 0x40000, 0x31b17e39, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "fp001002.bin", 0x40000, 0x5a6e2efb, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "fp001003.bin", 0x80000, 0x0f904421, 0x03 | BRF_GRA }, // 2 Sprites - - { "fp001006.bin", 0x80000, 0x96cf395d, 0x06 | BRF_SND }, // 3 x1-010 Samples - { "fp001005.bin", 0x80000, 0x65b5fe9a, 0x06 | BRF_SND }, // 4 - - { "nvram.bin", 0x10000, 0x1f719400, 0x00 | BRF_OPT }, -}; - -STD_ROM_PICK(kiwame) -STD_ROM_FN(kiwame) - -static INT32 kiwameInit() -{ - DrvSetVideoOffsets(0, -16, 0, 0); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(kiwame68kInit, 16000000, SET_IRQLINES(1, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 1, -1)); -} - -struct BurnDriverD BurnDrvKiwame = { - "kiwame", NULL, NULL, NULL, "1994", - "Pro Mahjong Kiwame\0", NULL, "Athena", "Seta", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_SETA1, GBF_MAHJONG, 0, - NULL, kiwameRomInfo, kiwameRomName, NULL, NULL, KiwameInputInfo, KiwameDIPInfo, - kiwameInit, DrvExit, DrvFrame, setaNoLayersDraw, DrvScan, &DrvRecalc, 0x200, - 448, 240, 4, 3 -}; - - -// Twin Eagle - Revenge Joe's Brother - -static struct BurnRomInfo twineaglRomDesc[] = { - { "ua2-1", 0x80000, 0x5c3fe531, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - - { "ua2-2", 0x02000, 0x783ca84e, 0x02 | BRF_PRG | BRF_ESS }, // 1 M65c02 Code - - { "ua2-4", 0x40000, 0x8b7532d6, 0x0b | BRF_GRA }, // 2 Sprites - { "ua2-3", 0x40000, 0x1124417a, 0x0b | BRF_GRA }, // 3 - { "ua2-6", 0x40000, 0x99d8dbba, 0x0b | BRF_GRA }, // 4 - { "ua2-5", 0x40000, 0x6e450d28, 0x0b | BRF_GRA }, // 5 - - { "ua2-8", 0x80000, 0x7d3a8d73, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - { "ua2-10", 0x80000, 0x5bbe1f56, 0x04 | BRF_GRA }, // 7 - { "ua2-7", 0x80000, 0xfce56907, 0x04 | BRF_GRA }, // 8 - { "ua2-9", 0x80000, 0xa451eae9, 0x04 | BRF_GRA }, // 9 - - { "ua2-11", 0x80000, 0x624e6057, 0x06 | BRF_SND }, // 10 x1-010 Samples - { "ua2-12", 0x80000, 0x3068ff64, 0x06 | BRF_SND }, // 11 -}; - -STD_ROM_PICK(twineagl) -STD_ROM_FN(twineagl) - -static INT32 twineaglInit() -{ - twineagle = 1; - - DrvSetVideoOffsets(0, 0, 0, -3); - DrvSetColorOffsets(0, 0, 0); - - return DrvInit(twineagle68kInit, 8000000, SET_IRQLINES(3, NOIRQ2), NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 1, -1)); -} - -struct BurnDriver BurnDrvTwineagl = { - "twineagl", NULL, NULL, NULL, "1988", - "Twin Eagle - Revenge Joe's Brother\0", NULL, "Seta (Taito license)", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_VERSHOOT, 0, - NULL, twineaglRomInfo, twineaglRomName, NULL, NULL, TwineaglInputInfo, TwineaglDIPInfo, - twineaglInit, DrvExit, DrvTwineaglFrame /*DrvM65c02Frame*/, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 224, 384, 3, 4 -}; - - -// U.S. Classic - -static struct BurnRomInfo usclssicRomDesc[] = { - { "ue2001.u20", 0x20000, 0x18b41421, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ue2000.u14", 0x20000, 0x69454bc2, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ue2002.u22", 0x20000, 0xa7bbe248, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "ue2003.u30", 0x20000, 0x29601906, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "ue002u61.004", 0x40000, 0x476e9f60, 0x02 | BRF_PRG | BRF_ESS }, // 4 M65c02 Code - - { "ue001009.119", 0x80000, 0xdc065204, 0x0b | BRF_GRA }, // 5 Sprites - { "ue001008.118", 0x80000, 0x5947d9b5, 0x0b | BRF_GRA }, // 6 - { "ue001007.117", 0x80000, 0xb48a885c, 0x0b | BRF_GRA }, // 7 - { "ue001006.116", 0x80000, 0xa6ab6ef4, 0x0b | BRF_GRA }, // 8 - - { "ue001010.120", 0x80000, 0xdd683031, 0x04 | BRF_GRA }, // 9 Layer 1 tiles - { "ue001011.121", 0x80000, 0x0e27bc49, 0x04 | BRF_GRA }, // 10 - { "ue001012.122", 0x80000, 0x961dfcdc, 0x04 | BRF_GRA }, // 11 - { "ue001013.123", 0x80000, 0x03e9eb79, 0x04 | BRF_GRA }, // 12 - { "ue001014.124", 0x80000, 0x9576ace7, 0x04 | BRF_GRA }, // 13 - { "ue001015.125", 0x80000, 0x631d6eb1, 0x04 | BRF_GRA }, // 14 - { "ue001016.126", 0x80000, 0xf44a8686, 0x04 | BRF_GRA }, // 15 - { "ue001017.127", 0x80000, 0x7f568258, 0x04 | BRF_GRA }, // 16 - { "ue001018.128", 0x80000, 0x4bd98f23, 0x04 | BRF_GRA }, // 17 - { "ue001019.129", 0x80000, 0x6d9f5a33, 0x04 | BRF_GRA }, // 18 - { "ue001020.130", 0x80000, 0xbc07403f, 0x04 | BRF_GRA }, // 19 - { "ue001021.131", 0x80000, 0x98c03efd, 0x04 | BRF_GRA }, // 20 - - { "ue001005.132", 0x80000, 0xc5fea37c, 0x06 | BRF_SND }, // 21 x1-010 Samples - - { "ue1-023.prm", 0x00200, 0xa13192a4, 0x0f | BRF_GRA }, // 22 Color PROMs - { "ue1-022.prm", 0x00200, 0x1a23129e, 0x0f | BRF_GRA }, // 23 -}; - -STD_ROM_PICK(usclssic) -STD_ROM_FN(usclssic) - -static INT32 usclssicInit() -{ - watchdog_enable = 1; - DrvSetColorOffsets(0, 0x200, 0); - DrvSetVideoOffsets(1, 2, 0, -1); - trackball_mode = 1; // for trackball - usclssic = 1; - - INT32 nRet = DrvInit(usclssic68kInit, 8000000, SET_IRQLINES(0x80, 0x80) /*custom*/, NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 4, -1)); - - if (nRet == 0) { - usclssicSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvUsclssic = { - "usclssic", NULL, NULL, NULL, "1989", - "U.S. Classic\0", NULL, "Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_SPORTSMISC, 0, - NULL, usclssicRomInfo, usclssicRomName, NULL, NULL, UsclssicInputInfo, UsclssicDIPInfo, - usclssicInit, DrvExit, DrvCalibr50Frame, seta1layerDraw, DrvScan, &DrvRecalc, 0x1200, - 240, 384, 3, 4 -}; - - -// Caliber 50 - -static struct BurnRomInfo calibr50RomDesc[] = { - { "uh002001.u45", 0x40000, 0xeb92e7ed, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "uh002004.u41", 0x40000, 0x5a0ed31e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "uh001003.9a", 0x10000, 0x0d30d09f, 0x01 | BRF_PRG | BRF_ESS }, // 2 - { "uh001002.7a", 0x10000, 0x7aecc3f9, 0x01 | BRF_PRG | BRF_ESS }, // 3 - - { "uh001005.u61", 0x40000, 0x4a54c085, 0x02 | BRF_PRG | BRF_ESS }, // 4 m65c02 Code - - { "uh001006.ux2", 0x80000, 0xfff52f91, 0x0b | BRF_GRA }, // 5 Sprites - { "uh001007.ux1", 0x80000, 0xb6c19f71, 0x0b | BRF_GRA }, // 6 - { "uh001008.ux6", 0x80000, 0x7aae07ef, 0x0b | BRF_GRA }, // 7 - { "uh001009.ux0", 0x80000, 0xf85da2c5, 0x0b | BRF_GRA }, // 8 - - { "uh001010.u3x", 0x80000, 0xf986577a, 0x04 | BRF_GRA }, // 9 Layer 1 tiles - { "uh001011.u50", 0x80000, 0x08620052, 0x04 | BRF_GRA }, // 10 - - { "uh001013.u60", 0x80000, 0x09ec0df6, 0x06 | BRF_SND }, // 11 x1-010 Samples - { "uh001012.u46", 0x80000, 0xbb996547, 0x06 | BRF_SND }, // 12 -}; - -STD_ROM_PICK(calibr50) -STD_ROM_FN(calibr50) - -static INT32 calibr50Init() -{ - refresh_rate = 5742; // 57.42 hz - watchdog_enable = 1; - DrvSetColorOffsets(0, 0, 0); - DrvSetVideoOffsets(-1, 2, -3, -2); - - INT32 nRet = DrvInit(calibr5068kInit, 8000000, SET_IRQLINES(0x80, 0x80) /*custom*/, NO_SPRITE_BUFFER, SET_GFX_DECODE(0, 1, -1)); - - return nRet; -} - -struct BurnDriver BurnDrvCalibr50 = { - "calibr50", NULL, NULL, NULL, "1989", - "Caliber 50\0", NULL, "Athena / Seta", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA1, GBF_SHOOT, 0, - NULL, calibr50RomInfo, calibr50RomName, NULL, NULL, Calibr50InputInfo, Calibr50DIPInfo, - calibr50Init, DrvExit, DrvCalibr50Frame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 240, 384, 3, 4 -}; - - -// Crazy Fight - -static struct BurnRomInfo crazyfgtRomDesc[] = { - { "rom.u3", 0x40000, 0xbf333e75, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "rom.u4", 0x40000, 0x505e9d47, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "rom.u228", 0x80000, 0x7181618e, 0x03 | BRF_GRA }, // 2 Sprites - { "rom.u227", 0x80000, 0x7905b5f2, 0x03 | BRF_GRA }, // 3 - { "rom.u226", 0x80000, 0xef210e34, 0x03 | BRF_GRA }, // 4 - { "rom.u225", 0x80000, 0x451b4419, 0x03 | BRF_GRA }, // 5 - - { "rom.u67", 0x40000, 0xec8c6831, 0x04 | BRF_GRA }, // 6 Layer 1 tiles - { "rom.u68", 0x80000, 0x2124312e, 0x04 | BRF_GRA }, // 7 - - { "rom.u65", 0x40000, 0x58448231, 0x05 | BRF_GRA }, // 8 Layer 2 tiles - { "rom.u66", 0x80000, 0xc6f7735b, 0x05 | BRF_GRA }, // 9 - - { "rom.u85", 0x40000, 0x7b95d0bb, 0x06 | BRF_SND }, // 10 OKI M6295 Samples -}; - -STD_ROM_PICK(crazyfgt) -STD_ROM_FN(crazyfgt) - -static INT32 crazyfgtInit() -{ - DrvSetColorOffsets(0, 0xa00, 0x200); - DrvSetVideoOffsets(8, 0, 6, 0); - - INT32 nRet = DrvInit(crazyfgt68kInit, 16000000, SET_IRQLINES(0x80, 0x80) /*custom*/, NO_SPRITE_BUFFER, SET_GFX_DECODE(5, 4, 4)); - - if (nRet == 0) { - gundharaSetColorTable(); - } - - return nRet; -} - -struct BurnDriver BurnDrvCrazyfgt = { - "crazyfgt", NULL, NULL, NULL, "1996", - "Crazy Fight\0", NULL, "Subsino", "Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA1, GBF_SHOOT, 0, - NULL, crazyfgtRomInfo, crazyfgtRomName, NULL, NULL, CrazyfgtInputInfo, CrazyfgtDIPInfo, - crazyfgtInit, DrvExit, CrazyfgtFrame, seta2layerDraw, DrvScan, &DrvRecalc, 0x1200, - 384, 224, 4, 3 -}; - - -//---------------------------------------------------------------------------------------------------------- -// should be moved into its own file - -static UINT8 msm6242_reg[3]; -static time_t msm6242_hold_time; - -UINT8 msm6242_read(UINT32 offset) -{ - tm *systime; - - if (msm6242_reg[0] & 1) { - systime = localtime(&msm6242_hold_time); - } else { - time_t curtime = time(NULL); - systime = localtime(&curtime); - } - - switch (offset) - { - case 0x00: return systime->tm_sec % 10; - case 0x01: return systime->tm_sec / 10; - case 0x02: return systime->tm_min % 10; - case 0x03: return systime->tm_min / 10; - case 0x04: - case 0x05: - { - INT32 hour = systime->tm_hour, pm = 0; - - if ((msm6242_reg[2] & 0x04) == 0) // 12 hour mode? - { - if (hour >= 12) pm = 1; - hour %= 12; - if (hour == 0) hour = 12; - } - - if (offset == 0x04) return hour % 10; - - return (hour / 10) | (pm <<2); - } - - case 0x06: return systime->tm_mday % 10; - case 0x07: return systime->tm_mday / 10; - case 0x08: return (systime->tm_mon+1) % 10; - case 0x09: return (systime->tm_mon+1) / 10; - case 0x0a: return systime->tm_year % 10; - case 0x0b: return (systime->tm_year % 100) / 10; - case 0x0c: return systime->tm_wday; - case 0x0d: return msm6242_reg[0]; - case 0x0e: return msm6242_reg[1]; - case 0x0f: return msm6242_reg[2]; - } - - return 0; -} - -void msm6242_write(UINT32 offset, UINT8 data) -{ - if (offset == 0x0d) { - msm6242_reg[0] = data & 0x0f; - if (data & 1) msm6242_hold_time = time(NULL); - } else if (offset == 0x0e) { - msm6242_reg[1] = data & 0x0f; - } else if (offset == 0x0f) { - if ((data ^ msm6242_reg[2]) & 0x04) { - msm6242_reg[2] = (msm6242_reg[2] & 0x04) | (data & ~0x04); - - if (msm6242_reg[2] & 1) msm6242_reg[2] = (msm6242_reg[2] & ~0x04) | (data & 0x04); - } else { - msm6242_reg[2] = data & 0x0f; - } - } -} - -void msm6242_reset() -{ - memset (msm6242_reg, 0, 3); - msm6242_hold_time = time(NULL); -} - -//-------------------------------------------------------------------------------------------------------------------- - -static UINT16 jockeyc_dsw_read(INT32 offset) -{ - INT32 dip2 = DrvDips[1] | (DrvDips[2] << 8); - INT32 shift = offset << 2; - - return ((((DrvDips[0] >> shift) & 0xf)) << 0) | ((((dip2 >> shift) & 0xf)) << 4) | ((((dip2 >> (shift+8)) & 0xf)) << 8); -} - -UINT16 __fastcall jockeyc_read_word(UINT32 address) -{ - switch (address) - { - case 0x200000: - case 0x200001: { - INT32 i; - for (i = 3; i < 8; i++) { - if (usclssic_port_select & (1 << i)) return DrvInputs[(i - 3) + 2]; - } - return 0xffff; - } - - case 0x200002: - case 0x200003: - return DrvInputs[0]; - - case 0x200010: - case 0x200011: - return DrvInputs[1] & 0x7fff; - - case 0x500000: - case 0x500001: - case 0x500002: - case 0x500003: - return jockeyc_dsw_read(address & 2); - - case 0x600000: - case 0x600001: - case 0x600002: - case 0x600003: - return ~0; - } - - if ((address & 0xfffffe0) == 0x800000) { - return msm6242_read((address & 0x1e) / 2); - } - - return 0; -} - -UINT8 __fastcall jockeyc_read_byte(UINT32 address) -{ - switch (address) - { - case 0x200000: - case 0x200001: { - INT32 i; - for (i = 3; i < 8; i++) { - if (usclssic_port_select & (1 << i)) return DrvInputs[(i - 3) + 2]; - } - return 0xff; - } - - case 0x200002: - return DrvInputs[0] >> 8; - - case 0x200003: - return DrvInputs[0]; - - case 0x200010: - return (DrvInputs[1] >> 8) & 0x7f; - - case 0x200011: - return DrvInputs[1]; - - case 0x500000: - case 0x500001: - case 0x500002: - case 0x500003: - return jockeyc_dsw_read(address & 2); - - case 0x600000: - case 0x600001: - case 0x600002: - case 0x600003: - return ~0; - } - - if ((address & 0xfffffe0) == 0x800000) { - return msm6242_read((address & 0x1e) / 2); - } - - return 0; -} - -void __fastcall jockeyc_write_word(UINT32 address, UINT16 data) -{ - SetaVidRAMCtrlWriteWord(0, 0xa00000) - - switch (address) - { - case 0x200000: - case 0x200001: - usclssic_port_select = data & 0xf8; - return; - - case 0x300000: - case 0x300001: - watchdog = 0; - return; - } - - if ((address & 0xfffffe0) == 0x800000) { - msm6242_write((address & 0x1e) / 2, data); - return; - } -} - -void __fastcall jockeyc_write_byte(UINT32 address, UINT8 data) -{ - SetaVidRAMCtrlWriteByte(0, 0xa00000) - - switch (address) - { - case 0x200000: - case 0x200001: - usclssic_port_select = data & 0xf8; - return; - - case 0x300000: - case 0x300001: - watchdog = 0; - return; - } - - if ((address & 0xfffffe0) == 0x800000) { - msm6242_write((address & 0x1e) / 2, data); - return; - - } -} - -static void jockeyc68kInit() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(DrvVidRAM0, 0xb00000, 0xb07fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xd00000, 0xd00607 | 0x7ff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xe00000, 0xe03fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xffc000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, jockeyc_write_word); - SekSetWriteByteHandler(0, jockeyc_write_byte); - SekSetReadWordHandler(0, jockeyc_read_word); - SekSetReadByteHandler(0, jockeyc_read_byte); - - SekMapHandler(1, 0x900000, 0x903fff, MAP_READ | MAP_WRITE); - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - SekClose(); - - memcpy (Drv68KROM + 0x100000, Drv68KROM + 0x020000, 0x080000); - memset (Drv68KROM + 0x020000, 0xff, 0x60000); - memset (Drv68KROM + 0x180000, 0xff, 0x80000); - - memmove (DrvGfxROM1 + 0x60000, DrvGfxROM1 + 0x40000, 0x40000); - memset (DrvGfxROM1 + 0x40000, 0, 0x20000); - memset (DrvGfxROM1 + 0xa0000, 0, 0x20000); - - DrvROMLen[4] = 1; // force use of pal ram - - msm6242_reset(); -} - -static INT32 jockeycInit() -{ - watchdog_enable = 1; - DrvSetColorOffsets(0, 0, 0); - DrvSetVideoOffsets(0, 0, 0, 0); - - return DrvInit(jockeyc68kInit, 16000000, SET_IRQLINES(0x80, 0x80) /*custom*/, NO_SPRITE_BUFFER, SET_GFX_DECODE(5, 1, -1)); -} - -static void jockeycFrameCallback() -{ - DrvInputs[0] ^= 0xffff; - DrvInputs[0] ^= DrvDips[3] | (DrvDips[4] << 8); - DrvInputs[1] ^= 0xffff; - DrvInputs[1] ^= DrvDips[5] | (DrvDips[6] << 8); - - INT32 nInterleave = 10; - INT32 nCyclesTotal[1] = { cpuspeed / 60 }; - INT32 nCyclesDone[1] = { 0 }; - - INT32 irqs[10] = { 4, 1, 2, 6, 6, 6, 6, 6, 6, 6 }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - SekSetIRQLine(irqs[9-i], CPU_IRQSTATUS_AUTO); // ? - } - - SekClose(); - - if (pBurnSoundOut) { - x1010_sound_update(); - } -} - -static INT32 jockeycFrame() -{ - return DrvCommonFrame(jockeycFrameCallback); -} - - -// Jockey Club - -static struct BurnRomInfo jockeycRomDesc[] = { - { "ya-007-002-u23.bin", 0x10000, 0xc499bf4d, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "ya-007-003-u33.bin", 0x10000, 0xe7b0677e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - { "ya_002_001.u18", 0x80000, 0xdd108016, 0x01 | BRF_PRG | BRF_ESS }, // 2 - - { "ya_011_004.u10", 0x80000, 0xeb74d2e0, 0x03 | BRF_GRA }, // 3 Sprites - { "ya_011_005.u17", 0x80000, 0x4a6c804b, 0x03 | BRF_GRA }, // 4 - { "ya_011_006.u22", 0x80000, 0xbfae01a5, 0x03 | BRF_GRA }, // 5 - { "ya_011_007.u27", 0x80000, 0x2dc7a294, 0x03 | BRF_GRA }, // 6 - - { "ya_011_008.u35", 0x40000, 0x4b890f83, 0x04 | BRF_GRA }, // 7 Layer 1 tiles - { "ya_011_009.u41", 0x40000, 0xcaa5e3c1, 0x04 | BRF_GRA }, // 8 -// double this so that we can use the graphics decoding routines... - { "ya_011_009.u41", 0x40000, 0xcaa5e3c1, 0x04 | BRF_GRA }, // 9 - - { "ya_011_013.u71", 0x80000, 0x2bccaf47, 0x06 | BRF_SND }, // 10 x1snd - { "ya_011_012.u64", 0x80000, 0xa8015ce6, 0x06 | BRF_SND }, // 11 - - { "ya-011.prom", 0x00200, 0xbd4fe2f6, 0x0f | BRF_GRA }, // 13 - { "ya-010.prom", 0x00200, 0x778094b3, 0x0f | BRF_GRA }, // 12 Color PROMs -}; - -STD_ROM_PICK(jockeyc) -STD_ROM_FN(jockeyc) - -struct BurnDriverD BurnDrvJockeyc = { - "jockeyc", NULL, NULL, NULL, "1990", - "Jockey Club\0", NULL, "[Seta] (Visco license)", "Seta", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_SETA1, GBF_SPORTSMISC, 0, - NULL, jockeycRomInfo, jockeycRomName, NULL, NULL, JockeycInputInfo, JockeycDIPInfo, - jockeycInit, DrvExit, jockeycFrame, seta1layerDraw, DrvScan, &DrvRecalc, 0x200, - 384, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_seta2.cpp b/jan/src/burn/drv/pst90s/d_seta2.cpp deleted file mode 100644 index b6f4dcc4e..000000000 --- a/jan/src/burn/drv/pst90s/d_seta2.cpp +++ /dev/null @@ -1,3503 +0,0 @@ -/******************************************************************************** - Newer Seta Hardware - MAME driver by Luca Elia (l.elia@tin.it) - ******************************************************************************** - port to Finalburn Alpha by OopsWare. 2007 - ********************************************************************************/ - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "burn_gun.h" -#include "eeprom.h" -#include "x1010.h" - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; - -static UINT8 *Rom68K; -static UINT8 *RomGfx; - -static UINT8 *Ram68K; -static UINT8 *RamUnknown; -static UINT8 *RamNV; - -static UINT16 *RamSpr; -static UINT16 *RamSprBak; -static UINT16 *RamPal; -static UINT32 *CurPal; -static UINT16 *RamTMP68301; -static UINT16 *RamVReg; - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy4[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy5[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static INT32 DrvAxis[4]; -static UINT8 DrvAnalogInput[4]; - -static UINT8 DrvReset = 0; -static UINT8 bRecalcPalette = 0; - -static UINT32 gfx_code_mask; -//static UINT8 bMahjong = 0; -static UINT8 Mahjong_keyboard = 0; -static UINT8 HasNVRam = 0; - -static INT32 yoffset; -static INT32 sva_x; -static INT32 sva_y; - -#define M68K_CYCS 50000000 / 3 - -#define A(a, b, c, d) { a, b, (UINT8*)(c), d } - -static struct BurnInputInfo grdiansInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 3, "diag"}, - {"Service", BIT_DIGITAL, DrvButton + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, -}; - -STDINPUTINFO(grdians) - -static struct BurnDIPInfo grdiansDIPList[] = { - - // Defaults - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 4, "Difficulty"}, - {0x15, 0x01, 0x03, 0x01, "Easy"}, - {0x15, 0x01, 0x03, 0x00, "Normal"}, - {0x15, 0x01, 0x03, 0x02, "Hard"}, - {0x15, 0x01, 0x03, 0x03, "Hardest"}, -// {0, 0xFE, 0, 2, "Unknown"}, -// {0x15, 0x01, 0x04, 0x00, "Off"}, -// {0x15, 0x01, 0x04, 0x04, "On"}, - {0, 0xFE, 0, 2, "Title"}, - {0x15, 0x01, 0x08, 0x00, "Guardians"}, - {0x15, 0x01, 0x08, 0x08, "Denjin Makai II"}, - {0, 0xFE, 0, 4, "Lives"}, - {0x15, 0x01, 0x30, 0x10, "1"}, - {0x15, 0x01, 0x30, 0x00, "2"}, - {0x15, 0x01, 0x30, 0x20, "3"}, - {0x15, 0x01, 0x30, 0x30, "4"}, - {0, 0xFE, 0, 2, "Test mode"}, - {0x15, 0x01, 0x40, 0x00, "Off"}, - {0x15, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Demo sounds"}, - {0x15, 0x01, 0x80, 0x80, "Off"}, - {0x15, 0x01, 0x80, 0x00, "On"}, - - // DIP 2 - {0, 0xFE, 0, 16, "Coin 1"}, - {0x16, 0x01, 0x0f, 0x00, "1 coin 1 credit"}, - {0x16, 0x01, 0x0f, 0x01, "1 coin 2 credits"}, - {0x16, 0x01, 0x0f, 0x02, "1 coin 3 credits"}, - {0x16, 0x01, 0x0f, 0x03, "1 coin 4 credits"}, - {0x16, 0x01, 0x0f, 0x04, "1 coin 5 credits"}, - {0x16, 0x01, 0x0f, 0x05, "1 coin 6 credits"}, - {0x16, 0x01, 0x0f, 0x06, "1 coin 7 credits"}, - {0x16, 0x01, 0x0f, 0x07, "2 coins 1 credit"}, - {0x16, 0x01, 0x0f, 0x08, "2 coins 3 credits"}, - {0x16, 0x01, 0x0f, 0x09, "2 coins 5 credits"}, - {0x16, 0x01, 0x0f, 0x0a, "3 coins 1 credit"}, - {0x16, 0x01, 0x0f, 0x0b, "3 coins 2 credits"}, - {0x16, 0x01, 0x0f, 0x0c, "3 coins 4 credits"}, - {0x16, 0x01, 0x0f, 0x0d, "4 coins 1 credit"}, - {0x16, 0x01, 0x0f, 0x0e, "4 coins 3 credits"}, - {0x16, 0x01, 0x0f, 0x0f, "Free play"}, - {0, 0xFE, 0, 16, "Coin 2"}, - {0x16, 0x01, 0xf0, 0x00, "1 coin 1 credit"}, - {0x16, 0x01, 0xf0, 0x10, "1 coin 2 credits"}, - {0x16, 0x01, 0xf0, 0x20, "1 coin 3 credits"}, - {0x16, 0x01, 0xf0, 0x30, "1 coin 4 credits"}, - {0x16, 0x01, 0xf0, 0x40, "1 coin 5 credits"}, - {0x16, 0x01, 0xf0, 0x50, "1 coin 6 credits"}, - {0x16, 0x01, 0xf0, 0x60, "1 coin 7 credits"}, - {0x16, 0x01, 0xf0, 0x70, "2 coins 1 credit"}, - {0x16, 0x01, 0xf0, 0x80, "2 coins 3 credits"}, - {0x16, 0x01, 0xf0, 0x90, "2 coins 5 credits"}, - {0x16, 0x01, 0xf0, 0xa0, "3 coins 1 credit"}, - {0x16, 0x01, 0xf0, 0xb0, "3 coins 2 credits"}, - {0x16, 0x01, 0xf0, 0xc0, "3 coins 4 credits"}, - {0x16, 0x01, 0xf0, 0xd0, "4 coins 1 credit"}, - {0x16, 0x01, 0xf0, 0xe0, "4 coins 3 credits"}, - {0x16, 0x01, 0xf0, 0xf0, "Free play"}, -}; - -STDDIPINFO(grdians) - -static struct BurnInputInfo mj4simaiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - - {"A", BIT_DIGITAL, DrvJoy1 + 0, "mah a"}, - {"E", BIT_DIGITAL, DrvJoy1 + 1, "mah e"}, - {"I", BIT_DIGITAL, DrvJoy1 + 2, "mah i"}, - {"M", BIT_DIGITAL, DrvJoy1 + 3, "mah m"}, - {"Kan", BIT_DIGITAL, DrvJoy1 + 4, "mah kan"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start"}, - - {"B", BIT_DIGITAL, DrvJoy2 + 0, "mah b"}, - {"F", BIT_DIGITAL, DrvJoy2 + 1, "mah f"}, - {"J", BIT_DIGITAL, DrvJoy2 + 2, "mah j"}, - {"N", BIT_DIGITAL, DrvJoy2 + 3, "mah n"}, - {"Reach", BIT_DIGITAL, DrvJoy2 + 4, "mah reach"}, - {"Bet", BIT_DIGITAL, DrvJoy2 + 5, "mah bet"}, - - {"C", BIT_DIGITAL, DrvJoy3 + 0, "mah c"}, - {"G", BIT_DIGITAL, DrvJoy3 + 1, "mah g"}, - {"K", BIT_DIGITAL, DrvJoy3 + 2, "mah k"}, - {"Chi", BIT_DIGITAL, DrvJoy3 + 3, "mah chi"}, - {"Ron", BIT_DIGITAL, DrvJoy3 + 4, "mah ron"}, - - {"D", BIT_DIGITAL, DrvJoy4 + 0, "mah d"}, - {"H", BIT_DIGITAL, DrvJoy4 + 1, "mah h"}, - {"L", BIT_DIGITAL, DrvJoy4 + 2, "mah l"}, - {"Pon", BIT_DIGITAL, DrvJoy4 + 3, "mah pon"}, - - {"LastChange", BIT_DIGITAL, DrvJoy5 + 0, "mah lc"}, - {"Score", BIT_DIGITAL, DrvJoy5 + 1, "mah score"}, - {"DoubleUp", BIT_DIGITAL, DrvJoy5 + 2, "mah du"}, // ???? - {"FlipFlop", BIT_DIGITAL, DrvJoy5 + 3, "mah ff"}, - {"Big", BIT_DIGITAL, DrvJoy5 + 4, "mah big"}, // ???? - {"Smaill", BIT_DIGITAL, DrvJoy5 + 5, "mah small"}, // ???? - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvButton + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, -}; - -STDINPUTINFO(mj4simai) - -static struct BurnDIPInfo mj4simaiDIPList[] = { - - // Defaults - {0x1F, 0xFF, 0xFF, 0x00, NULL}, - {0x20, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 8, "Coinage"}, - {0x1F, 0x01, 0x07, 0x00, "1 coin 1 credit"}, - {0x1F, 0x01, 0x07, 0x01, "1 coin 2 credits"}, - {0x1F, 0x01, 0x07, 0x02, "1 coin 3 credits"}, - {0x1F, 0x01, 0x07, 0x03, "1 coin 4 credits"}, - {0x1F, 0x01, 0x07, 0x04, "2 coins 1 credit"}, - {0x1F, 0x01, 0x07, 0x05, "3 coins 1 credit"}, - {0x1F, 0x01, 0x07, 0x06, "4 coins 1 credit"}, - {0x1F, 0x01, 0x07, 0x07, "5 coins 1 credit"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x1F, 0x01, 0x08, 0x08, "Off"}, - {0x1F, 0x01, 0x08, 0x00, "On"}, - {0, 0xFE, 0, 2, "Tumo pin"}, - {0x1F, 0x01, 0x10, 0x10, "Off"}, - {0x1F, 0x01, 0x10, 0x00, "On"}, - {0, 0xFE, 0, 2, "Flip screen"}, - {0x1F, 0x01, 0x20, 0x00, "Off"}, - {0x1F, 0x01, 0x20, 0x20, "On"}, - {0, 0xFE, 0, 2, "Free play"}, - {0x1F, 0x01, 0x40, 0x00, "Off"}, - {0x1F, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Test mode"}, - {0x1F, 0x01, 0x80, 0x00, "Off"}, - {0x1F, 0x01, 0x80, 0x80, "On"}, - - // DIP 2 - {0, 0xFE, 0, 8, "Difficulty"}, - {0x20, 0x01, 0x07, 0x03, "0"}, - {0x20, 0x01, 0x07, 0x04, "1"}, - {0x20, 0x01, 0x07, 0x05, "2"}, - {0x20, 0x01, 0x07, 0x06, "3"}, - {0x20, 0x01, 0x07, 0x07, "4"}, - {0x20, 0x01, 0x07, 0x00, "5"}, - {0x20, 0x01, 0x07, 0x01, "6"}, - {0x20, 0x01, 0x07, 0x02, "7"}, - {0, 0xFE, 0, 2, "Continue"}, - {0x20, 0x01, 0x08, 0x08, "Off"}, - {0x20, 0x01, 0x08, 0x00, "On"}, - {0, 0xFE, 0, 2, "Select girl"}, - {0x20, 0x01, 0x10, 0x00, "Off"}, - {0x20, 0x01, 0x10, 0x10, "On"}, - {0, 0xFE, 0, 2, "Com put"}, - {0x20, 0x01, 0x20, 0x00, "Off"}, - {0x20, 0x01, 0x20, 0x20, "On"}, -}; - -STDDIPINFO(mj4simai) - - -static struct BurnInputInfo myangelInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 3, "diag"}, - {"Service", BIT_DIGITAL, DrvButton + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, -}; - -STDINPUTINFO(myangel) - -static struct BurnDIPInfo myangel2DIPList[] = { - - // Defaults - {0x0F, 0xFF, 0xFF, 0x00, NULL}, - {0x10, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Test mode"}, - {0x0F, 0x01, 0x01, 0x00, "Off"}, - {0x0F, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Increase lives while playing"}, - {0x0F, 0x01, 0x08, 0x08, "No"}, - {0x0F, 0x01, 0x08, 0x00, "Yes"}, - {0, 0xFE, 0, 4, "Lives"}, - {0x0F, 0x01, 0x30, 0x10, "2"}, - {0x0F, 0x01, 0x30, 0x00, "3"}, - {0x0F, 0x01, 0x30, 0x20, "4"}, - {0x0F, 0x01, 0x30, 0x30, "5"}, - {0, 0xFE, 0, 2, "Demo sounds"}, - {0x0F, 0x01, 0x40, 0x40, "Off"}, - {0x0F, 0x01, 0x40, 0x00, "On"}, - {0, 0xFE, 0, 2, "Flip screen"}, - {0x0F, 0x01, 0x80, 0x00, "Off"}, - {0x0F, 0x01, 0x80, 0x80, "On"}, - - // DIP 2 - {0, 0xFE, 0, 16, "Coinage"}, - {0x10, 0x01, 0x0f, 0x00, "1 coin 1 credit"}, - {0x10, 0x01, 0x0f, 0x01, "1 coin 2 credits"}, - {0x10, 0x01, 0x0f, 0x02, "1 coin 3 credits"}, - {0x10, 0x01, 0x0f, 0x03, "1 coin 4 credits"}, - {0x10, 0x01, 0x0f, 0x04, "1 coin 5 credits"}, - {0x10, 0x01, 0x0f, 0x05, "1 coin 6 credits"}, - {0x10, 0x01, 0x0f, 0x06, "1 coin 7 credits"}, - {0x10, 0x01, 0x0f, 0x07, "2 coins 1 credit"}, - {0x10, 0x01, 0x0f, 0x08, "2 coins 3 credits"}, - {0x10, 0x01, 0x0f, 0x09, "2 coins 5 credits"}, - {0x10, 0x01, 0x0f, 0x0a, "3 coins 1 credit"}, - {0x10, 0x01, 0x0f, 0x0b, "3 coins 2 credits"}, - {0x10, 0x01, 0x0f, 0x0c, "3 coins 4 credits"}, - {0x10, 0x01, 0x0f, 0x0d, "4 coins 1 credit"}, - {0x10, 0x01, 0x0f, 0x0e, "4 coins 3 credits"}, - {0x10, 0x01, 0x0f, 0x0f, "Free play"}, - -}; - -static struct BurnDIPInfo myangelDIPList[] = { - - {0, 0xFE, 0, 2, "Push start to freeze (cheat)"}, - {0x10, 0x01, 0x80, 0x00, "No"}, - {0x10, 0x01, 0x80, 0x80, "Yes"}, - -}; - -STDDIPINFO(myangel2) -STDDIPINFOEXT(myangel, myangel2, myangel) - -static struct BurnDIPInfo pzlbowlDIPList[] = { - - // Defaults - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x80, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Test mode"}, - {0x15, 0x01, 0x01, 0x00, "Off"}, - {0x15, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x15, 0x01, 0x02, 0x02, "Off"}, - {0x15, 0x01, 0x02, 0x00, "On"}, - {0, 0xFE, 0, 2, "Flip screen"}, - {0x15, 0x01, 0x04, 0x00, "Off"}, - {0x15, 0x01, 0x04, 0x04, "On"}, - {0, 0xFE, 0, 8, "Difficulty"}, - {0x15, 0x01, 0x38, 0x08, "Easiest"}, - {0x15, 0x01, 0x38, 0x10, "Easier"}, - {0x15, 0x01, 0x38, 0x18, "Easy"}, - {0x15, 0x01, 0x38, 0x00, "Normal"}, - {0x15, 0x01, 0x38, 0x20, "Hard"}, - {0x15, 0x01, 0x38, 0x28, "Harder"}, - {0x15, 0x01, 0x38, 0x30, "Very hard"}, - {0x15, 0x01, 0x38, 0x38, "Hardest"}, - {0, 0xFE, 0, 4, "Winning rounds (player vs player)"}, - {0x15, 0x01, 0xc0, 0x80, "1"}, - {0x15, 0x01, 0xc0, 0x00, "2"}, - {0x15, 0x01, 0xc0, 0x40, "3"}, - {0x15, 0x01, 0xc0, 0xc0, "5"}, - - // DIP 2 - {0, 0xFE, 0, 16, "Coinage"}, - {0x16, 0x01, 0x0f, 0x00, "1 coin 1 credit"}, - {0x16, 0x01, 0x0f, 0x01, "1 coin 2 credits"}, - {0x16, 0x01, 0x0f, 0x02, "1 coin 3 credits"}, - {0x16, 0x01, 0x0f, 0x03, "1 coin 4 credits"}, - {0x16, 0x01, 0x0f, 0x04, "1 coin 5 credits"}, - {0x16, 0x01, 0x0f, 0x05, "1 coin 6 credits"}, - {0x16, 0x01, 0x0f, 0x06, "1 coin 7 credits"}, - {0x16, 0x01, 0x0f, 0x07, "2 coins 1 credit"}, - {0x16, 0x01, 0x0f, 0x08, "2 coins 3 credits"}, - {0x16, 0x01, 0x0f, 0x09, "2 coins 5 credits"}, - {0x16, 0x01, 0x0f, 0x0a, "3 coins 1 credit"}, - {0x16, 0x01, 0x0f, 0x0b, "3 coins 2 credits"}, - {0x16, 0x01, 0x0f, 0x0c, "3 coins 4 credits"}, - {0x16, 0x01, 0x0f, 0x0d, "4 coins 1 credit"}, - {0x16, 0x01, 0x0f, 0x0e, "4 coins 3 credits"}, - {0x16, 0x01, 0x0f, 0x0f, "Free play"}, - {0, 0xFE, 0, 2, "Allow continue"}, - {0x16, 0x01, 0x10, 0x10, "No"}, - {0x16, 0x01, 0x10, 0x00, "Yes"}, - {0, 0xFE, 0, 2, "Join In"}, - {0x16, 0x01, 0x20, 0x20, "No"}, - {0x16, 0x01, 0x20, 0x00, "Yes"}, -// {0, 0xFE, 0, 2, "Unused"}, -// {0x16, 0x01, 0x40, 0x00, "Off"}, -// {0x16, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Language"}, - {0x16, 0x01, 0x80, 0x00, "Japanese"}, - {0x16, 0x01, 0x80, 0x80, "English"}, - -}; - -STDDIPINFO(pzlbowl) - -static struct BurnInputInfo penbrosInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 3, "diag"}, - {"Service", BIT_DIGITAL, DrvButton + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, -}; - -STDINPUTINFO(penbros) - -static struct BurnDIPInfo penbrosDIPList[] = { - - // Defaults - {0x13, 0xFF, 0xFF, 0x00, NULL}, - {0x14, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Test mode"}, - {0x13, 0x01, 0x01, 0x00, "Off"}, - {0x13, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Screen"}, - {0x13, 0x01, 0x02, 0x00, "Normal"}, - {0x13, 0x01, 0x02, 0x02, "Reverse"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x13, 0x01, 0x08, 0x08, "Off"}, - {0x13, 0x01, 0x08, 0x00, "On"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x13, 0x01, 0x30, 0x10, "3 coins 1 play"}, - {0x13, 0x01, 0x30, 0x20, "2 coins 1 play"}, - {0x13, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x13, 0x01, 0x30, 0x30, "1 coin 2 plays"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x13, 0x01, 0xc0, 0x40, "3 coins 1 play"}, - {0x13, 0x01, 0xc0, 0x80, "2 coins 1 play"}, - {0x13, 0x01, 0xc0, 0x00, "1 coin 1 play"}, - {0x13, 0x01, 0xc0, 0xc0, "1 coin 2 plays"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Difficulty"}, - {0x14, 0x01, 0x03, 0x01, "Easy"}, - {0x14, 0x01, 0x03, 0x00, "Normal"}, - {0x14, 0x01, 0x03, 0x02, "Hard"}, - {0x14, 0x01, 0x03, 0x03, "Very hard"}, - {0, 0xFE, 0, 4, "Player stock"}, - {0x14, 0x01, 0x0c, 0x0c, "2"}, - {0x14, 0x01, 0x0c, 0x00, "3"}, - {0x14, 0x01, 0x0c, 0x08, "4"}, - {0x14, 0x01, 0x0c, 0x04, "5"}, - {0, 0xFE, 0, 4, "Extend"}, - {0x14, 0x01, 0x30, 0x20, "150000, 500000pts"}, - {0x14, 0x01, 0x30, 0x00, "200000, 700000pts"}, - {0x14, 0x01, 0x30, 0x30, "250000 every"}, - {0x14, 0x01, 0x30, 0x10, "None"}, - {0, 0xFE, 0, 4, "Match count"}, - {0x14, 0x01, 0xc0, 0x00, "2"}, - {0x14, 0x01, 0xc0, 0x80, "3"}, - {0x14, 0x01, 0xc0, 0x40, "4"}, - {0x14, 0x01, 0xc0, 0xc0, "5"}, -}; - -STDDIPINFO(penbros) - -static struct BurnInputInfo GundamexInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy4 + 0, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvButton + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 7, "dip"}, -}; - -STDINPUTINFO(Gundamex) - -static struct BurnDIPInfo GundamexDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - {0x18, 0xff, 0xff, 0x20, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x01, 0x00, "Off" }, - {0x16, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x06, 0x04, "Easy" }, - {0x16, 0x01, 0x06, 0x06, "Normal" }, - {0x16, 0x01, 0x06, 0x02, "Hard" }, - {0x16, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x10, 0x10, "Off" }, - {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Show Targets" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x17, 0x01, 0x07, 0x00, "4 Coins 1 Credits " }, - {0x17, 0x01, 0x07, 0x01, "3 Coins 1 Credits " }, - {0x17, 0x01, 0x07, 0x02, "2 Coins 1 Credits " }, - {0x17, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x17, 0x01, 0x07, 0x06, "1 Coin 2 Credits " }, - {0x17, 0x01, 0x07, 0x05, "1 Coin 3 Credits " }, - {0x17, 0x01, 0x07, 0x03, "1 Coin 4 Credits " }, - {0x17, 0x01, 0x07, 0x04, "1 Coin 5 Credits " }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x17, 0x01, 0x38, 0x38, "1 Coin 1 Credits " }, - {0x17, 0x01, 0x38, 0x10, "2 Coins 3 Credits " }, - {0x17, 0x01, 0x38, 0x00, "3 Coins/5 Credits" }, - {0x17, 0x01, 0x38, 0x30, "1 Coin 2 Credits " }, - {0x17, 0x01, 0x38, 0x08, "2 Coins 5 Credits " }, - {0x17, 0x01, 0x38, 0x28, "1 Coin 3 Credits " }, - {0x17, 0x01, 0x38, 0x18, "1 Coin 4 Credits " }, - {0x17, 0x01, 0x38, 0x20, "1 Coin 5 Credits " }, - - {0 , 0xfe, 0 , 2, "Debug Mode" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x17, 0x01, 0x80, 0x80, "Off" }, - {0x17, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x18, 0x01, 0x20, 0x20, "English" }, - {0x18, 0x01, 0x20, 0x00, "Japanese" }, -}; - -STDDIPINFO(Gundamex) - -static struct BurnInputInfo DeerhuntInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start"}, - - A("P1 Right / left", BIT_ANALOG_REL, DrvAxis + 0, "mouse x-axis"), - A("P1 Up / Down", BIT_ANALOG_REL, DrvAxis + 1, "mouse y-axis"), - - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "mouse button 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "mouse button 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy4 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 6, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 7, "dip"}, -}; - -STDINPUTINFO(Deerhunt) - -static struct BurnDIPInfo DeerhuntDIPList[]= -{ - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0a, 0x01, 0x07, 0x05, "4 Coins 1 Credits " }, - {0x0a, 0x01, 0x07, 0x06, "2 Coins 1 Credits " }, - {0x0a, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x0a, 0x01, 0x07, 0x04, "1 Coin 2 Credits " }, - {0x0a, 0x01, 0x07, 0x03, "1 Coin 3 Credits " }, - {0x0a, 0x01, 0x07, 0x02, "1 Coin 4 Credits " }, - {0x0a, 0x01, 0x07, 0x01, "1 Coin 5 Credits " }, - {0x0a, 0x01, 0x07, 0x00, "1 Coin 6 Credits " }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0a, 0x01, 0x38, 0x28, "4 Coins 1 Credits " }, - {0x0a, 0x01, 0x38, 0x30, "2 Coins 1 Credits " }, - {0x0a, 0x01, 0x38, 0x38, "1 Coin 1 Credits " }, - {0x0a, 0x01, 0x38, 0x20, "1 Coin 2 Credits " }, - {0x0a, 0x01, 0x38, 0x18, "1 Coin 3 Credits " }, - {0x0a, 0x01, 0x38, 0x10, "1 Coin 4 Credits " }, - {0x0a, 0x01, 0x38, 0x08, "1 Coin 5 Credits " }, - {0x0a, 0x01, 0x38, 0x00, "1 Coin 6 Credits " }, - - {0 , 0xfe, 0 , 2, "Discount To Continue" }, - {0x0a, 0x01, 0x40, 0x40, "Off" }, - {0x0a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0a, 0x01, 0x80, 0x80, "Off" }, - {0x0a, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Vert. Flip Screen" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Horiz. Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0b, 0x01, 0x04, 0x00, "Off" }, - {0x0b, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0b, 0x01, 0x18, 0x10, "Easy" }, - {0x0b, 0x01, 0x18, 0x18, "Normal" }, - {0x0b, 0x01, 0x18, 0x08, "Hard" }, - {0x0b, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Blood Color" }, - {0x0b, 0x01, 0x20, 0x20, "Red" }, - {0x0b, 0x01, 0x20, 0x00, "Yellow" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0b, 0x01, 0x40, 0x40, "3" }, - {0x0b, 0x01, 0x40, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Gun Type" }, - {0x0b, 0x01, 0x80, 0x80, "Pump Action" }, - {0x0b, 0x01, 0x80, 0x00, "Hand Gun" }, -}; - -STDDIPINFO(Deerhunt) - - -static struct BurnDIPInfo TurkhuntDIPList[]= -{ - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0a, 0x01, 0x07, 0x05, "4 Coins 1 Credits " }, - {0x0a, 0x01, 0x07, 0x06, "2 Coins 1 Credits " }, - {0x0a, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x0a, 0x01, 0x07, 0x04, "1 Coin 2 Credits " }, - {0x0a, 0x01, 0x07, 0x03, "1 Coin 3 Credits " }, - {0x0a, 0x01, 0x07, 0x02, "1 Coin 4 Credits " }, - {0x0a, 0x01, 0x07, 0x01, "1 Coin 5 Credits " }, - {0x0a, 0x01, 0x07, 0x00, "1 Coin 6 Credits " }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x0a, 0x01, 0x38, 0x28, "4 Coins 1 Credits " }, - {0x0a, 0x01, 0x38, 0x30, "2 Coins 1 Credits " }, - {0x0a, 0x01, 0x38, 0x38, "1 Coin 1 Credits " }, - {0x0a, 0x01, 0x38, 0x20, "1 Coin 2 Credits " }, - {0x0a, 0x01, 0x38, 0x18, "1 Coin 3 Credits " }, - {0x0a, 0x01, 0x38, 0x10, "1 Coin 4 Credits " }, - {0x0a, 0x01, 0x38, 0x08, "1 Coin 5 Credits " }, - {0x0a, 0x01, 0x38, 0x00, "1 Coin 6 Credits " }, - - {0 , 0xfe, 0 , 2, "Discount To Continue" }, - {0x0a, 0x01, 0x40, 0x40, "Off" }, - {0x0a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0a, 0x01, 0x80, 0x80, "Off" }, - {0x0a, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Vert. Flip Screen" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Horiz. Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0b, 0x01, 0x04, 0x00, "Off" }, - {0x0b, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0b, 0x01, 0x18, 0x10, "Easy" }, - {0x0b, 0x01, 0x18, 0x18, "Normal" }, - {0x0b, 0x01, 0x18, 0x08, "Hard" }, - {0x0b, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Blood Color" }, - {0x0b, 0x01, 0x20, 0x20, "Red" }, - {0x0b, 0x01, 0x20, 0x00, "Yellow" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x0b, 0x01, 0x40, 0x40, "2" }, - {0x0b, 0x01, 0x40, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Gun Type" }, - {0x0b, 0x01, 0x80, 0x80, "Pump Action" }, - {0x0b, 0x01, 0x80, 0x00, "Hand Gun" }, -}; - -STDDIPINFO(Turkhunt) - -static struct BurnInputInfo WschampInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start"}, - - A("P1 Right / left", BIT_ANALOG_REL, DrvAxis + 0, "mouse x-axis"), - A("P1 Up / Down", BIT_ANALOG_REL, DrvAxis + 1, "mouse y-axis"), - - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "mouse button 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "mouse button 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start"}, - - A("P2 Right / left", BIT_ANALOG_REL, DrvAxis + 2, "p2 x-axis"), - A("P2 Up / Down", BIT_ANALOG_REL, DrvAxis + 3, "p2 y-axis"), - - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy4 + 2, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 6, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 7, "dip"}, -}; - -STDINPUTINFO(Wschamp) - -static struct BurnDIPInfo WschampDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x09, "4 Coins Start, 4 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x08, "4 Coins Start, 3 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x07, "4 Coins Start, 2 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x06, "4 Coins Start, 1 Coin Continue" }, - {0x12, 0x01, 0x0f, 0x0c, "3 Coins Start, 3 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x0b, "3 Coins Start, 2 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x0a, "3 Coins Start, 1 Coin Continue" }, - {0x12, 0x01, 0x0f, 0x0e, "2 Coins Start, 2 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x0d, "2 Coins Start, 1 Coin Continue" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin Start, 1 Coin Continue" }, - {0x12, 0x01, 0x0f, 0x05, "1 Coin 2 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x04, "1 Coin 3 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x03, "1 Coin 4 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x02, "1 Coin 5 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x01, "1 Coin 6 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Vert. Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Horiz. Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x10, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x08, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x40, 0x40, "2" }, - {0x13, 0x01, 0x40, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Gun Type" }, - {0x13, 0x01, 0x80, 0x80, "Pump Action" }, - {0x13, 0x01, 0x80, 0x00, "Hand Gun" }, -}; - -STDDIPINFO(Wschamp) - -static struct BurnDIPInfo TrophyhDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x09, "4 Coins Start, 4 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x08, "4 Coins Start, 3 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x07, "4 Coins Start, 2 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x06, "4 Coins Start, 1 Coin Continue" }, - {0x12, 0x01, 0x0f, 0x0c, "3 Coins Start, 3 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x0b, "3 Coins Start, 2 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x0a, "3 Coins Start, 1 Coin Continue" }, - {0x12, 0x01, 0x0f, 0x0e, "2 Coins Start, 2 Coins Continue" }, - {0x12, 0x01, 0x0f, 0x0d, "2 Coins Start, 1 Coin Continue" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin Start, 1 Coin Continue" }, - {0x12, 0x01, 0x0f, 0x05, "1 Coin 2 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x04, "1 Coin 3 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x03, "1 Coin 4 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x02, "1 Coin 5 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x01, "1 Coin 6 Credits, 1 Credit Start & Continue" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Vert. Flip Screen" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Horiz. Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x18, 0x10, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x08, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Blood Color" }, - {0x13, 0x01, 0x20, 0x20, "Red" }, - {0x13, 0x01, 0x20, 0x00, "Yellow" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x13, 0x01, 0x40, 0x40, "2" }, - {0x13, 0x01, 0x40, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Gun Type" }, - {0x13, 0x01, 0x80, 0x80, "Pump Action" }, - {0x13, 0x01, 0x80, 0x00, "Hand Gun" }, -}; - -STDDIPINFO(Trophyh) - -// Rom information - -static struct BurnRomInfo grdiansRomDesc[] = { - { "u2.bin", 0x080000, 0x36adc6f2, BRF_ESS | BRF_PRG }, // 68000 code - { "u3.bin", 0x080000, 0x2704f416, BRF_ESS | BRF_PRG }, - { "u4.bin", 0x080000, 0xbb52447b, BRF_ESS | BRF_PRG }, - { "u5.bin", 0x080000, 0x9c164a3b, BRF_ESS | BRF_PRG }, - - { "u16.bin", 0x400000, 0x6a65f265, BRF_GRA }, // GFX - { "u20.bin", 0x400000, 0xa7226ab7, BRF_GRA }, - { "u15.bin", 0x400000, 0x01672dcd, BRF_GRA }, - { "u19.bin", 0x400000, 0xc0c998a0, BRF_GRA }, - { "u18.bin", 0x400000, 0x967babf4, BRF_GRA }, - { "u22.bin", 0x400000, 0x6239997a, BRF_GRA }, - { "u17.bin", 0x400000, 0x0fad0629, BRF_GRA }, - { "u21.bin", 0x400000, 0x6f95e466, BRF_GRA }, - - { "u32.bin", 0x100000, 0xcf0f3017, BRF_SND }, // PCM - -}; - -STD_ROM_PICK(grdians) -STD_ROM_FN(grdians) - -static struct BurnRomInfo mj4simaiRomDesc[] = { - { "ll.u2", 0x080000, 0x7be9c781, BRF_ESS | BRF_PRG }, // 68000 code - { "lh1.u3", 0x080000, 0x82aa3f72, BRF_ESS | BRF_PRG }, - { "hl.u4", 0x080000, 0x226063b7, BRF_ESS | BRF_PRG }, - { "hh.u5", 0x080000, 0x23aaf8df, BRF_ESS | BRF_PRG }, - - { "cha-03.u16", 0x400000, 0xd367429a, BRF_GRA }, // GFX - { "cha-04.u18", 0x400000, 0x7f2008c3, BRF_GRA }, - { "cha-05.u15", 0x400000, 0xe94ec40a, BRF_GRA }, - { "cha-06.u17", 0x400000, 0x5cb0b3a9, BRF_GRA }, - { "cha-01.u21", 0x400000, 0x35f47b37, BRF_GRA }, - { "cha-02.u22", 0x400000, 0xf6346860, BRF_GRA }, - - { "cha-07.u32", 0x400000, 0x817519ee, BRF_SND }, // PCM - -}; - -STD_ROM_PICK(mj4simai) -STD_ROM_FN(mj4simai) - -static struct BurnRomInfo myangelRomDesc[] = { - { "kq1-prge.u2", 0x080000, 0x6137d4c0, BRF_ESS | BRF_PRG }, // 68000 code - { "kq1-prgo.u3", 0x080000, 0x4aad10d8, BRF_ESS | BRF_PRG }, - { "kq1-tble.u4", 0x080000, 0xe332a514, BRF_ESS | BRF_PRG }, - { "kq1-tblo.u5", 0x080000, 0x760cab15, BRF_ESS | BRF_PRG }, - - { "kq1-cg2.u20", 0x200000, 0x80b4e8de, BRF_GRA }, // GFX - { "kq1-cg0.u16", 0x200000, 0xf8ae9a05, BRF_GRA }, - { "kq1-cg3.u19", 0x200000, 0x9bdc35c9, BRF_GRA }, - { "kq1-cg1.u15", 0x200000, 0x23bd7ea4, BRF_GRA }, - { "kq1-cg6.u22", 0x200000, 0xb25acf12, BRF_GRA }, - { "kq1-cg4.u18", 0x200000, 0xdca7f8f2, BRF_GRA }, - { "kq1-cg7.u21", 0x200000, 0x9f48382c, BRF_GRA }, - { "kq1-cg5.u17", 0x200000, 0xa4bc4516, BRF_GRA }, - - { "kq1-snd.u32", 0x200000, 0x8ca1b449, BRF_SND }, // PCM - -}; - -STD_ROM_PICK(myangel) -STD_ROM_FN(myangel) - -static struct BurnRomInfo myangel2RomDesc[] = { - { "kqs1ezpr.u2", 0x080000, 0x2469aac2, BRF_ESS | BRF_PRG }, // 68000 code - { "kqs1ozpr.u3", 0x080000, 0x6336375c, BRF_ESS | BRF_PRG }, - { "kqs1e-tb.u4", 0x080000, 0xe759b4cc, BRF_ESS | BRF_PRG }, - { "kqs1o-tb.u5", 0x080000, 0xb6168737, BRF_ESS | BRF_PRG }, - - { "kqs1-cg4.u20", 0x200000, 0xd1802241, BRF_GRA }, // GFX - { "kqs1-cg0.u16", 0x400000, 0xc21a33a7, BRF_GRA }, - { "kqs1-cg5.u19", 0x200000, 0xd86cf19c, BRF_GRA }, - { "kqs1-cg1.u15", 0x400000, 0xdca799ba, BRF_GRA }, - { "kqs1-cg6.u22", 0x200000, 0x3f08886b, BRF_GRA }, - { "kqs1-cg2.u18", 0x400000, 0xf7f92c7e, BRF_GRA }, - { "kqs1-cg7.u21", 0x200000, 0x2c977904, BRF_GRA }, - { "kqs1-cg3.u17", 0x400000, 0xde3b2191, BRF_GRA }, - - { "kqs1-snd.u32", 0x400000, 0x792a6b49, BRF_SND }, // PCM -}; - -STD_ROM_PICK(myangel2) -STD_ROM_FN(myangel2) - -static struct BurnRomInfo pzlbowlRomDesc[] = { - { "kup-u06.i03", 0x080000, 0x314e03ac, BRF_ESS | BRF_PRG }, // 68000 code - { "kup-u07.i03", 0x080000, 0xa0423a04, BRF_ESS | BRF_PRG }, - - { "kuc-u38.i00", 0x400000, 0x3db24172, BRF_GRA }, // GFX - { "kuc-u39.i00", 0x400000, 0x9b26619b, BRF_GRA }, - { "kuc-u40.i00", 0x400000, 0x7e49a2cf, BRF_GRA }, - { "kuc-u41.i00", 0x400000, 0x2febf19b, BRF_GRA }, - - { "kus-u18.i00", 0x400000, 0xe2b1dfcf, BRF_SND }, // PCM - -}; - -STD_ROM_PICK(pzlbowl) -STD_ROM_FN(pzlbowl) - -static struct BurnRomInfo penbrosRomDesc[] = { - { "u06.bin", 0x080000, 0x7bbdffac, BRF_ESS | BRF_PRG }, // 68000 code - { "u07.bin", 0x080000, 0xd50cda5f, BRF_ESS | BRF_PRG }, - - { "u38.bin", 0x400000, 0x4247b39e, BRF_GRA }, // GFX - { "u39.bin", 0x400000, 0xf9f07faf, BRF_GRA }, - { "u40.bin", 0x400000, 0xdc9e0a96, BRF_GRA }, - - { "u18.bin", 0x200000, 0xde4e65e2, BRF_SND }, // PCM -}; - -STD_ROM_PICK(penbros) -STD_ROM_FN(penbros) - -static struct BurnRomInfo gundamexRomDesc[] = { - { "ka002002.u2", 0x080000, 0xe850f6d8, BRF_ESS | BRF_PRG }, // 0 68000 code - { "ka002004.u3", 0x080000, 0xc0fb1208, BRF_ESS | BRF_PRG }, // 1 - { "ka002001.u4", 0x080000, 0x553ebe6b, BRF_ESS | BRF_PRG }, // 2 - { "ka002003.u5", 0x080000, 0x946185aa, BRF_ESS | BRF_PRG }, // 3 - { "ka001005.u77", 0x080000, 0xf01d3d00, BRF_ESS | BRF_PRG }, // 4 - - { "ka001009.u16", 0x200000, 0x997d8d93, BRF_GRA }, // 5 GFX - { "ka001010.u18", 0x200000, 0x811b67ca, BRF_GRA }, // 6 - { "ka001011.u20", 0x200000, 0x08a72700, BRF_GRA }, // 7 - { "ka001012.u15", 0x200000, 0xb789e4a8, BRF_GRA }, // 8 - { "ka001013.u17", 0x200000, 0xd8a0201f, BRF_GRA }, // 9 - { "ka001014.u19", 0x200000, 0x7635e026, BRF_GRA }, // 10 - { "ka001006.u21", 0x200000, 0x6aac2f2f, BRF_GRA }, // 11 - { "ka001007.u22", 0x200000, 0x588f9d63, BRF_GRA }, // 12 - { "ka001008.u23", 0x200000, 0xdb55a60a, BRF_GRA }, // 13 - - { "ka001015.u28", 0x200000, 0xada2843b, BRF_SND }, // 14 PCM - - { "eeprom.bin", 0x000080, 0x80f8e248, BRF_OPT }, -}; - -STD_ROM_PICK(gundamex) -STD_ROM_FN(gundamex) - -static struct BurnRomInfo deerhuntRomDesc[] = { - { "as0906e05.u06", 0x100000, 0x20c81f17, 1 }, // 0 68000 code - { "as0907e05.u07", 0x100000, 0x1731aa2a, 1 }, // 1 - - { "as0901m01.u38", 0x800000, 0x1d6acf8f, 2 }, // 2 GFX - { "as0902m01.u39", 0x800000, 0xc7ca2128, 2 }, // 3 - { "as0903m01.u40", 0x800000, 0xe8ef81b3, 2 }, // 4 - { "as0904m01.u41", 0x800000, 0xd0f97fdc, 2 }, // 5 - - { "as0905m01.u18", 0x400000, 0x8d8165bb, 3 }, // 6 PCM -}; - -STD_ROM_PICK(deerhunt) -STD_ROM_FN(deerhunt) - -static struct BurnRomInfo deerhunaRomDesc[] = { - { "as0906e04-v4_2.u06", 0x100000, 0xbb3af36f, 1 }, // 0 68000 code - { "as0907e04-v4_2.u07", 0x100000, 0x83f02117, 1 }, // 1 - - { "as0901m01.u38", 0x800000, 0x1d6acf8f, 2 }, // 2 GFX - { "as0902m01.u39", 0x800000, 0xc7ca2128, 2 }, // 3 - { "as0903m01.u40", 0x800000, 0xe8ef81b3, 2 }, // 4 - { "as0904m01.u41", 0x800000, 0xd0f97fdc, 2 }, // 5 - - { "as0905m01.u18", 0x400000, 0x8d8165bb, 3 }, // 6 PCM -}; - -STD_ROM_PICK(deerhuna) -STD_ROM_FN(deerhuna) - -static struct BurnRomInfo deerhunbRomDesc[] = { - { "as0906e04.u06", 0x100000, 0x07d9b64a, 1 }, // 0 68000 code - { "as0907e04.u07", 0x100000, 0x19973d08, 1 }, // 1 - - { "as0901m01.u38", 0x800000, 0x1d6acf8f, 2 }, // 2 GFX - { "as0902m01.u39", 0x800000, 0xc7ca2128, 2 }, // 3 - { "as0903m01.u40", 0x800000, 0xe8ef81b3, 2 }, // 4 - { "as0904m01.u41", 0x800000, 0xd0f97fdc, 2 }, // 5 - - { "as0905m01.u18", 0x400000, 0x8d8165bb, 3 }, // 6 PCM -}; - -STD_ROM_PICK(deerhunb) -STD_ROM_FN(deerhunb) - -static struct BurnRomInfo deerhuncRomDesc[] = { - { "as0937e01.u06", 0x100000, 0x8d74088e, 1 }, // 0 68000 code - { "as0938e01.u07", 0x100000, 0xc7657889, 1 }, // 1 - - { "as0901m01.u38", 0x800000, 0x1d6acf8f, 2 }, // 2 GFX - { "as0902m01.u39", 0x800000, 0xc7ca2128, 2 }, // 3 - { "as0903m01.u40", 0x800000, 0xe8ef81b3, 2 }, // 4 - { "as0904m01.u41", 0x800000, 0xd0f97fdc, 2 }, // 5 - - { "as0905m01.u18", 0x400000, 0x8d8165bb, 3 }, // 6 PCM -}; - -STD_ROM_PICK(deerhunc) -STD_ROM_FN(deerhunc) - -static struct BurnRomInfo deerhundRomDesc[] = { - { "as0906e02.u06", 0x100000, 0x190cca42, 1 }, // 0 68000 code - { "as0907e02.u07", 0x100000, 0x9de2b901, 1 }, // 1 - - { "as0901m01.u38", 0x800000, 0x1d6acf8f, 2 }, // 2 GFX - { "as0902m01.u39", 0x800000, 0xc7ca2128, 2 }, // 3 - { "as0903m01.u40", 0x800000, 0xe8ef81b3, 2 }, // 4 - { "as0904m01.u41", 0x800000, 0xd0f97fdc, 2 }, // 5 - - { "as0905m01.u18", 0x400000, 0x8d8165bb, 3 }, // 6 PCM -}; - -STD_ROM_PICK(deerhund) -STD_ROM_FN(deerhund) - -static struct BurnRomInfo deerhuneRomDesc[] = { - { "as0906e01.u06", 0x100000, 0x103e3ba3, 1 }, // 0 68000 code - { "as0907e01.u07", 0x100000, 0xddeb0f97, 1 }, // 1 - - { "as0901m01.u38", 0x800000, 0x1d6acf8f, 2 }, // 2 GFX - { "as0902m01.u39", 0x800000, 0xc7ca2128, 2 }, // 3 - { "as0903m01.u40", 0x800000, 0xe8ef81b3, 2 }, // 4 - { "as0904m01.u41", 0x800000, 0xd0f97fdc, 2 }, // 5 - - { "as0905m01.u18", 0x400000, 0x8d8165bb, 3 }, // 6 PCM -}; - -STD_ROM_PICK(deerhune) -STD_ROM_FN(deerhune) - -static struct BurnRomInfo turkhuntRomDesc[] = { - { "asx906e01.u06", 0x100000, 0xc96266e1, 1 }, // 0 68000 code - { "asx907e01.u07", 0x100000, 0x7c67b502, 1 }, // 1 - - { "asx901m01.u38", 0x800000, 0xeabd3f44, 2 }, // 2 GFX - { "asx902m01.u39", 0x800000, 0xc32130c8, 2 }, // 3 - { "asx903m01.u40", 0x800000, 0x5f86c322, 2 }, // 4 - { "asx904m01.u41", 0x800000, 0xc77e0b66, 2 }, // 5 - - { "asx905m01.u18", 0x400000, 0x8d9dd9a9, 3 }, // 6 PCM -}; - -STD_ROM_PICK(turkhunt) -STD_ROM_FN(turkhunt) - -static struct BurnRomInfo wschampRomDesc[] = { - { "as1006e03.u06", 0x100000, 0x0ad01677, 1 }, // 0 68000 code - { "as1007e03.u07", 0x100000, 0x572624f0, 1 }, // 1 - - { "as1001m01.u38", 0x800000, 0x92595579, 2 }, // 2 GFX - { "as1002m01.u39", 0x800000, 0x16c2bb08, 2 }, // 3 - { "as1003m01.u40", 0x800000, 0x89618858, 2 }, // 4 - { "as1004m01.u41", 0x800000, 0x500c0909, 2 }, // 5 - - { "as1005m01.u18", 0x400000, 0xe4b137b8, 3 }, // 6 PCM -}; - -STD_ROM_PICK(wschamp) -STD_ROM_FN(wschamp) - -static struct BurnRomInfo wschampaRomDesc[] = { - { "as1006e02.u06", 0x100000, 0xd3d3b2b5, 1 }, // 0 68000 code - { "as1007e02.u07", 0x100000, 0x78ede6d9, 1 }, // 1 - - { "as1001m01.u38", 0x800000, 0x92595579, 2 }, // 2 GFX - { "as1002m01.u39", 0x800000, 0x16c2bb08, 2 }, // 3 - { "as1003m01.u40", 0x800000, 0x89618858, 2 }, // 4 - { "as1004m01.u41", 0x800000, 0x500c0909, 2 }, // 5 - - { "as1005m01.u18", 0x400000, 0xe4b137b8, 3 }, // 6 PCM -}; - -STD_ROM_PICK(wschampa) -STD_ROM_FN(wschampa) - -static struct BurnRomInfo wschampbRomDesc[] = { - { "as10u6.u06", 0x100000, 0x70a18bef, 1 }, // 0 68000 code - { "as10u7.u07", 0x100000, 0xcf23be7d, 1 }, // 1 - - { "as1001m01.u38", 0x800000, 0x92595579, 2 }, // 2 GFX - { "as1002m01.u39", 0x800000, 0x16c2bb08, 2 }, // 3 - { "as1003m01.u40", 0x800000, 0x89618858, 2 }, // 4 - { "as1004m01.u41", 0x800000, 0x500c0909, 2 }, // 5 - - { "as1005m01.u18", 0x400000, 0xe4b137b8, 3 }, // 6 PCM -}; - -STD_ROM_PICK(wschampb) -STD_ROM_FN(wschampb) - -static struct BurnRomInfo trophyhRomDesc[] = { - { "as1106e01.u06", 0x100000, 0xb4950882, 1 }, // 0 68000 code - { "as1107e01.u07", 0x100000, 0x19ee67cb, 1 }, // 1 - - { "as1101m01.u38", 0x800000, 0x855ed675, 2 }, // 2 GFX - { "as1102m01.u39", 0x800000, 0xd186d271, 2 }, // 3 - { "as1103m01.u40", 0x800000, 0xadf8a54e, 2 }, // 4 - { "as1104m01.u41", 0x800000, 0x387882e9, 2 }, // 5 - - { "as1105m01.u18", 0x400000, 0x633d0df8, 3 }, // 6 PCM -}; - -STD_ROM_PICK(trophyh) -STD_ROM_FN(trophyh) - -static struct BurnRomInfo funcube2RomDesc[] = { - { "fc21_prg-0b.u3", 0x080000, 0xadd1c8a6, 1 }, // 0 68000 code - - { "fc21_iopr-0.u49", 0x020000, 0x314555ef, 2 }, // 1 H8/3007 code - - { "fc21a.u57", 0x000300, 0x00000000, 3 | BRF_NODUMP }, // 2 PIC12C508 Code - - { "fc21_obj-0.u43", 0x400000, 0x08cfe6d9, 4 }, // 3 GFX - { "fc21_obj-1.u42", 0x400000, 0x4c1fbc20, 4 }, // 4 - - { "fc21_voi0.u47", 0x200000, 0x4a49370a, 5 }, // 5 PCM -}; - -STD_ROM_PICK(funcube2) -STD_ROM_FN(funcube2) - -static struct BurnRomInfo funcube4RomDesc[] = { - { "fc41_prg-0.u3", 0x080000, 0xef870874, 1 }, // 0 68000 code - - { "fc21_iopr-0.u49", 0x020000, 0x314555ef, 2 }, // 1 H8/3007 code - - { "fc41a", 0x000300, 0x00000000, 3 | BRF_NODUMP }, // 2 PIC12C508 Code - - { "fc41_obj-0.u43", 0x400000, 0x9ff029d5, 4 }, // 3 GFX - { "fc41_obj-1.u42", 0x400000, 0x5ab7b087, 4 }, // 4 - - { "fc41_snd0.u47", 0x200000, 0xe6f7d2bc, 5 }, // 5 PCM -}; - -STD_ROM_PICK(funcube4) -STD_ROM_FN(funcube4) - - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour & 0x7c00) >> 7; // Red - r |= r >> 5; - g = (nColour & 0x03E0) >> 2; // Green - g |= g >> 5; - b = (nColour & 0x001f) << 3; // Blue - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -// ---- Toshiba TMP68301 --------------------------------------------- - -static INT32 tmp68301_timer[3] = {0, 0, 0}; -static INT32 tmp68301_timer_counter[3] = {0, 0, 0}; -static INT32 tmp68301_irq_vector[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - -static void tmp68301_update_timer( INT32 i ) -{ - UINT16 TCR = BURN_ENDIAN_SWAP_INT16(RamTMP68301[(0x200 + i * 0x20)/2]); - UINT16 MAX1 = BURN_ENDIAN_SWAP_INT16(RamTMP68301[(0x204 + i * 0x20)/2]); - UINT16 MAX2 = BURN_ENDIAN_SWAP_INT16(RamTMP68301[(0x206 + i * 0x20)/2]); - - INT32 max = 0; - double duration = 0; - -// timer_adjust(tmp68301_timer[i],TIME_NEVER,i,0); - tmp68301_timer[i] = 0; - tmp68301_timer_counter[i] = 0; - //bprintf(PRINT_NORMAL, _T("Tmp68301: update timer %d. TCR: %04x MAX: %04x %04x\n"), i, TCR, MAX1, MAX2); - - // timers 1&2 only - switch( (TCR & 0x0030)>>4 ) { // MR2..1 - case 1: max = MAX1; break; - case 2: max = MAX2; break; - } - - switch ( (TCR & 0xc000)>>14 ) { // CK2..1 - case 0: // System clock (CLK) - if (max) { - INT32 scale = (TCR & 0x3c00)>>10; // P4..1 - if (scale > 8) scale = 8; - duration = M68K_CYCS; //Machine->drv->cpu[0].cpu_clock; - duration /= 1 << scale; - duration /= max; - } - break; - } - -// logerror("CPU #0 PC %06X: TMP68301 Timer %d, duration %lf, max %04X\n",activecpu_get_pc(),i,duration,max); -// bprintf(PRINT_NORMAL, _T("TMP68301 Timer %d, duration %lf, max %04X TCR %04X\n"),i,duration,max,TCR); - - if (!(TCR & 0x0002)) // CS - { - if (duration) { - // timer_adjust(tmp68301_timer[i],TIME_IN_HZ(duration),i,0); - // active tmp68301 timer i, and set duration - tmp68301_timer[i] = (INT32) (M68K_CYCS / duration); - //tmp68301_timer_counter[i] = 0; - //bprintf(PRINT_NORMAL, _T("Tmp68301: update timer #%d duration to %d (%8.3f)\n"), i, tmp68301_timer[i], duration); - } else - //logerror("CPU #0 PC %06X: TMP68301 error, timer %d duration is 0\n",activecpu_get_pc(),i); - bprintf(PRINT_ERROR, _T("Tmp68301: error timer %d duration is 0\n"), i, TCR, MAX1, MAX2); - } -} - -static void tmp68301_timer_callback(INT32 i) -{ - UINT16 TCR = BURN_ENDIAN_SWAP_INT16(RamTMP68301[(0x200 + i * 0x20)/2]); - UINT16 IMR = BURN_ENDIAN_SWAP_INT16(RamTMP68301[0x94/2]); // Interrupt Mask Register (IMR) - UINT16 ICR = BURN_ENDIAN_SWAP_INT16(RamTMP68301[0x8e/2+i]); // Interrupt Controller Register (ICR7..9) - UINT16 IVNR = BURN_ENDIAN_SWAP_INT16(RamTMP68301[0x9a/2]); // Interrupt Vector Number Register (IVNR) - -// logerror("CPU #0 PC %06X: callback timer %04X, j = %d\n",activecpu_get_pc(),i,tcount); -// bprintf(PRINT_NORMAL, _T("Tmp68301: timer[%d] TCR: %04x IMR: %04x\n"), i, TCR, IMR); - - if ( (TCR & 0x0004) && !(IMR & (0x100<> 5) & 3 ); - switch ( addr ) { - case 0x200: tmp68301_update_timer(0); break; - case 0x220: tmp68301_update_timer(1); break; - case 0x240: tmp68301_update_timer(2); break; - } -} - -void __fastcall Tmp68301WriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - sekAddress &= 0x0003ff; - UINT8 *p = (UINT8 *)RamTMP68301; - p[sekAddress ^ 1] = byteValue; -// bprintf(PRINT_NORMAL, _T("TMP68301 Reg %04X <- %04X & %04X %04x\n"),sekAddress&0xfffe, (sekAddress&1)?byteValue:byteValue<<8,(sekAddress&1)?0x00ff:0xff00, RamTMP68301[sekAddress>>1]); -} - -void __fastcall Tmp68301WriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - sekAddress &= 0x0003ff; - RamTMP68301[ sekAddress >> 1 ] = BURN_ENDIAN_SWAP_INT16(wordValue); - tmp68301_regs_w( sekAddress, wordValue ); -// bprintf(PRINT_NORMAL, _T("TMP68301 Reg %04X <- %04X & %04X %04x\n"),sekAddress,wordValue,0xffff, RamTMP68301[sekAddress>>1]); -} - - -UINT8 __fastcall grdiansReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -UINT16 __fastcall grdiansReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x600000: return ~DrvInput[3]; // DIP 1 - case 0x600002: return ~DrvInput[4]; // DIP 2 - case 0x700000: return ~DrvInput[0]; // Joy 1 - case 0x700002: return ~DrvInput[1]; // Joy 2 - case 0x700004: return ~DrvInput[2]; // Coin - - case 0x70000C: - //bprintf(PRINT_NORMAL, _T("watchdog_reset16_r\n")); - return 0xFFFF; -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall grdiansWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall grdiansWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x800000: - //bprintf(PRINT_NORMAL, _T("lockout 0x%04x\n"), wordValue); - break; - - case 0xE00010: - case 0xE00012: - case 0xE00014: - case 0xE00016: - case 0xE00018: - case 0xE0001A: - case 0xE0001C: - case 0xE0001E: - x1010_sound_bank_w( (sekAddress - 0xE00010) >> 1, wordValue ); - break; - - case 0xE00000: // nop - break; -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -UINT8 __fastcall setaSoundRegReadByte(UINT32 /*sekAddress*/) -{ - //bprintf(PRINT_NORMAL, _T("x1-010 to read byte value of location %x\n"), sekAddress); - return 0; -} - -UINT16 __fastcall setaSoundRegReadWord(UINT32 sekAddress) -{ - return x1010_sound_read_word((sekAddress & 0x3ffff) >> 1); -} - -void __fastcall setaSoundRegWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - // bprintf(PRINT_NORMAL, _T("x1-010 to write byte value %x to location %x\n"), byteValue, sekAddress); - UINT32 offset = (sekAddress & 0x00003fff) >> 1; - INT32 channel, reg; - - if (sekAddress & 1) { - - x1_010_chip->HI_WORD_BUF[ offset ] = byteValue; - - } else { - - offset ^= x1_010_chip->address; - - channel = offset / sizeof(X1_010_CHANNEL); - reg = offset % sizeof(X1_010_CHANNEL); - - if( channel < SETA_NUM_CHANNELS && reg == 0 && (x1_010_chip->reg[offset]&1) == 0 && (byteValue&1) != 0 ) { - x1_010_chip->smp_offset[channel] = 0; - x1_010_chip->env_offset[channel] = 0; - } - x1_010_chip->reg[offset] = byteValue; - - } - -} - -void __fastcall setaSoundRegWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - //bprintf(PRINT_NORMAL, _T("x1-010 to write word value %x to location %x\n"), wordValue, sekAddress); - UINT32 offset = (sekAddress & 0x00003fff) >> 1; - INT32 channel, reg; - - x1_010_chip->HI_WORD_BUF[ offset ] = wordValue >> 8; - - offset ^= x1_010_chip->address; - - channel = offset / sizeof(X1_010_CHANNEL); - reg = offset % sizeof(X1_010_CHANNEL); - - if( channel < SETA_NUM_CHANNELS && reg == 0 && (x1_010_chip->reg[offset]&1) == 0 && (wordValue&1) != 0 ) { - x1_010_chip->smp_offset[channel] = 0; - x1_010_chip->env_offset[channel] = 0; - } - x1_010_chip->reg[offset] = wordValue & 0xff; -} - -void __fastcall grdiansPaletteWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - bprintf(PRINT_NORMAL, _T("Pal to write byte value %x to location %x\n"), byteValue, sekAddress); -} - -void __fastcall grdiansPaletteWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - //bprintf(PRINT_NORMAL, _T("Pal to write word value %x to location %x\n"), wordValue, sekAddress); - sekAddress &= 0x00FFFF; - sekAddress >>= 1; - RamPal[sekAddress] = wordValue; - CurPal[sekAddress] = CalcCol( wordValue ); -} - -void __fastcall grdiansClearWriteByte(UINT32, UINT8) {} -void __fastcall grdiansClearWriteWord(UINT32, UINT16) {} - -INT32 __fastcall grdiansSekIrqCallback(INT32 irq) -{ - //bprintf(PRINT_NORMAL, _T("Sek Irq Call back %d vector %04x\n"), irq, tmp68301_irq_vector[irq]); - return tmp68301_irq_vector[irq]; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); -// SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - SekReset(); - SekClose(); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gundamex")) { - EEPROMReset(); // gundam - if (EEPROMAvailable() == 0) { - UINT8 EEPROMDATA[2] = { 0x08, 0x70 }; - EEPROMFill(EEPROMDATA, 0, 2); - } - } - - return 0; -} - -static INT32 MemIndex(INT32 CodeSize, INT32 GfxSize, INT32 PcmSize, INT32 ExtRamSize) -{ - UINT8 *Next; Next = Mem; - Rom68K = Next; Next += CodeSize; // 68000 ROM - RomGfx = Next; Next += GfxSize; // GFX Rom - X1010SNDROM = Next; Next += PcmSize; // PCM - - RamStart = Next; - - Ram68K = Next; Next += 0x010000; - RamUnknown = Next; Next += ExtRamSize; - if (HasNVRam) { RamNV = Next; Next += 0x10000; } - RamSpr = (UINT16 *) Next; Next += 0x020000 * sizeof(UINT16); - RamSprBak = (UINT16 *) Next; Next += 0x020000 * sizeof(UINT16); - RamPal = (UINT16 *) Next; Next += 0x008000 * sizeof(UINT16); - RamTMP68301 = (UINT16 *) Next; Next += 0x000200 * sizeof(UINT16); - - RamVReg = (UINT16 *) Next; Next += 0x000020 * sizeof(UINT16); - - RamEnd = Next; - - CurPal = (UINT32 *) Next; Next += 0x008000 * sizeof(UINT32); - - MemEnd = Next; - return 0; -} - -static void loadDecodeGfx(UINT8 *p, INT32 cnt, INT32 offset2x) -{ - UINT8 * d = RomGfx; - UINT8 * q = p + 1; - - for (INT32 i=0; i> 7) & 1 ) << offset2x) | (( (*q >> 7) & 1 ) << (offset2x + 1)); - *(d+1) |= (( (*p >> 6) & 1 ) << offset2x) | (( (*q >> 6) & 1 ) << (offset2x + 1)); - *(d+2) |= (( (*p >> 5) & 1 ) << offset2x) | (( (*q >> 5) & 1 ) << (offset2x + 1)); - *(d+3) |= (( (*p >> 4) & 1 ) << offset2x) | (( (*q >> 4) & 1 ) << (offset2x + 1)); - *(d+4) |= (( (*p >> 3) & 1 ) << offset2x) | (( (*q >> 3) & 1 ) << (offset2x + 1)); - *(d+5) |= (( (*p >> 2) & 1 ) << offset2x) | (( (*q >> 2) & 1 ) << (offset2x + 1)); - *(d+6) |= (( (*p >> 1) & 1 ) << offset2x) | (( (*q >> 1) & 1 ) << (offset2x + 1)); - *(d+7) |= (( (*p >> 0) & 1 ) << offset2x) | (( (*q >> 0) & 1 ) << (offset2x + 1)); - } - -} - -static INT32 grdiansInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex(0x0200000, 0x2000000, 0x0200000, 0x00C000); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); // blank all memory - MemIndex(0x0200000, 0x2000000, 0x0200000, 0x00C000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 3, 2); if (nRet != 0) return 1; - - // Load Gfx - UINT8 * tmpGfx = (UINT8 *)BurnMalloc(0x0800000); - for (INT32 i=0; i<8; i+=2) { - BurnLoadRom(tmpGfx + 0x0200000, i+5, 1); - memcpy(tmpGfx + 0x0600000, tmpGfx + 0x0200000, 0x0200000); - BurnLoadRom(tmpGfx + 0x0000000, i+4, 1); - loadDecodeGfx( tmpGfx, 0x0800000 / 2, i ); - } - - BurnFree(tmpGfx); - - // Leave 1MB empty (addressable by the chip) - BurnLoadRom(X1010SNDROM + 0x100000, 12, 1); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram68K, 0x200000, 0x20FFFF, MAP_RAM); // CPU 0 RAM - SekMapMemory(RamUnknown, 0x304000, 0x30FFFF, MAP_RAM); // ? seems tile data - - SekMapMemory((UINT8 *)RamSpr, - 0xC00000, 0xC3FFFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)RamPal, - 0xC40000, 0xC4FFFF, MAP_ROM); // Palette - SekMapMemory((UINT8 *)RamVReg, - 0xC60000, 0xC6003F, MAP_RAM); // Video Registers - SekMapMemory((UINT8 *)RamTMP68301, - 0xFFFC00, 0xFFFFFF, MAP_ROM); // TMP68301 Registers - - SekMapHandler(1, 0xB00000, 0xB03FFF, MAP_READ | MAP_WRITE); - SekMapHandler(2, 0xC40000, 0xC4FFFF, MAP_WRITE); // Palette - SekMapHandler(3, 0xC50000, 0xC5FFFF, MAP_WRITE); - SekMapHandler(4, 0xFFFC00, 0xFFFFFF, MAP_WRITE); - - SekSetReadWordHandler(0, grdiansReadWord); - SekSetReadByteHandler(0, grdiansReadByte); - SekSetWriteWordHandler(0, grdiansWriteWord); - SekSetWriteByteHandler(0, grdiansWriteByte); - - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - - SekSetWriteWordHandler(2, grdiansPaletteWriteWord); - SekSetWriteByteHandler(2, grdiansPaletteWriteByte); - - SekSetWriteWordHandler(3, grdiansClearWriteWord); - SekSetWriteByteHandler(3, grdiansClearWriteByte); - - SekSetWriteWordHandler(4, Tmp68301WriteWord); - SekSetWriteByteHandler(4, Tmp68301WriteByte); - - SekSetIrqCallback( grdiansSekIrqCallback ); - - SekClose(); - } - - GenericTilesInit(); - - yoffset = 0; - sva_x = 128; - sva_y = 128; - - gfx_code_mask = 0x0800000 * 4 / 64; - - x1010_sound_init(50000000 / 3, 0x0000); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -// -- mj4simai ----------------------------------------------------------- - -UINT8 __fastcall mj4simaiReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -UINT16 __fastcall mj4simaiReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x600006: - //bprintf(PRINT_NORMAL, _T("watchdog_reset16_r\n")); - return 0xffff; - - case 0x600000: - case 0x600002: - switch (Mahjong_keyboard) - { - case 0x01: return ~DrvInput[0]; - case 0x02: return ~DrvInput[1]; - case 0x04: return ~DrvInput[5]; - case 0x08: return ~DrvInput[6]; - case 0x10: return ~DrvInput[7]; - default: return 0xffff; - } - - case 0x600100: return ~DrvInput[2]; // Coin - - case 0x600300: return ~DrvInput[3]; // DIP 1 - case 0x600302: return ~DrvInput[4]; // DIP 2 - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall mj4simaiWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall mj4simaiWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x600200: break; // NOP - - case 0x600300: - case 0x600302: - case 0x600304: - case 0x600306: - case 0x600308: - case 0x60030A: - case 0x60030C: - case 0x60030E: - x1010_sound_bank_w( (sekAddress & 0xf) >> 1, wordValue ); - break; - case 0x600004: - Mahjong_keyboard = wordValue & 0xff; - break; -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -static INT32 mj4simaiInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex(0x0200000, 0x2000000, 0x0500000, 0x000000); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); // blank all memory - MemIndex(0x0200000, 0x2000000, 0x0500000, 0x000000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 3, 2); if (nRet != 0) return 1; - - // Load Gfx - UINT8 * tmpGfx = (UINT8 *)BurnMalloc(0x0800000); - for (INT32 i=0; i<6; i+=2) { - BurnLoadRom(tmpGfx + 0x0000000, i+4, 1); - BurnLoadRom(tmpGfx + 0x0400000, i+5, 1); - loadDecodeGfx( tmpGfx, 0x0800000 / 2, i ); - } - BurnFree(tmpGfx); - - // Leave 1MB empty (addressable by the chip) - BurnLoadRom(X1010SNDROM + 0x100000, 10, 1); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram68K, 0x200000, 0x20FFFF, MAP_RAM); // CPU 0 RAM - - SekMapMemory((UINT8 *)RamSpr, - 0xC00000, 0xC3FFFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)RamPal, - 0xC40000, 0xC4FFFF, MAP_ROM); // Palette - SekMapMemory((UINT8 *)RamVReg, - 0xC60000, 0xC6003F, MAP_RAM); // Video Registers - SekMapMemory((UINT8 *)RamTMP68301, - 0xFFFC00, 0xFFFFFF, MAP_ROM); // TMP68301 Registers - - SekMapHandler(1, 0xB00000, 0xB03FFF, MAP_READ | MAP_WRITE); - SekMapHandler(2, 0xC40000, 0xC4FFFF, MAP_WRITE); // Palette - SekMapHandler(3, 0xFFFC00, 0xFFFFFF, MAP_WRITE); - - SekSetReadWordHandler(0, mj4simaiReadWord); - SekSetReadByteHandler(0, mj4simaiReadByte); - SekSetWriteWordHandler(0, mj4simaiWriteWord); - SekSetWriteByteHandler(0, mj4simaiWriteByte); - - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - - SekSetWriteWordHandler(2, grdiansPaletteWriteWord); - SekSetWriteByteHandler(2, grdiansPaletteWriteByte); - - SekSetWriteWordHandler(3, Tmp68301WriteWord); - SekSetWriteByteHandler(3, Tmp68301WriteByte); - - SekSetIrqCallback( grdiansSekIrqCallback ); - - SekClose(); - } - - GenericTilesInit(); - - yoffset = 0; - sva_x = 64; - sva_y = 128; - - gfx_code_mask = 0x0800000 * 4 / 64; - - x1010_sound_init(50000000 / 3, 0x0000); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - -// bMahjong = 1; - - DrvDoReset(); - - return 0; -} - -// -- myangel ----------------------------------------------------------- - -UINT8 __fastcall myangelReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -UINT16 __fastcall myangelReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x700000: return ~DrvInput[0]; - case 0x700002: return ~DrvInput[1]; - case 0x700004: return ~DrvInput[2]; - - case 0x700006: - //bprintf(PRINT_NORMAL, _T("watchdog_reset16_r\n")); - return 0xffff; - - case 0x700300: return ~DrvInput[3]; // DIP 1 - case 0x700302: return ~DrvInput[4]; // DIP 2 - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall myangelWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall myangelWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x700200: break; // NOP - - case 0x700310: - case 0x700312: - case 0x700314: - case 0x700316: - case 0x700318: - case 0x70031A: - case 0x70031C: - case 0x70031E: - x1010_sound_bank_w( (sekAddress & 0xf) >> 1, wordValue ); - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -static INT32 myangelInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex(0x0200000, 0x1000000, 0x0300000, 0x000000); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); // blank all memory - MemIndex(0x0200000, 0x1000000, 0x0300000, 0x000000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 3, 2); if (nRet != 0) return 1; - - // Load Gfx - UINT8 * tmpGfx = (UINT8 *)BurnMalloc(0x0400000); - for (INT32 i=0; i<8; i+=2) { - BurnLoadRom(tmpGfx + 0x0000000, i+4, 1); - BurnLoadRom(tmpGfx + 0x0200000, i+5, 1); - loadDecodeGfx( tmpGfx, 0x0400000 / 2, i ); - } - BurnFree(tmpGfx); - - // Leave 1MB empty (addressable by the chip) - BurnLoadRom(X1010SNDROM + 0x100000, 12, 1); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram68K, 0x200000, 0x20FFFF, MAP_RAM); // CPU 0 RAM - - SekMapMemory((UINT8 *)RamSpr, - 0xC00000, 0xC3FFFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)RamPal, - 0xC40000, 0xC4FFFF, MAP_ROM); // Palette - SekMapMemory((UINT8 *)RamVReg, - 0xC60000, 0xC6003F, MAP_RAM); // Video Registers - SekMapMemory((UINT8 *)RamTMP68301, - 0xFFFC00, 0xFFFFFF, MAP_ROM); // TMP68301 Registers - - SekMapHandler(1, 0xB00000, 0xB03FFF, MAP_READ | MAP_WRITE); - SekMapHandler(2, 0xC40000, 0xC4FFFF, MAP_WRITE); // Palette - SekMapHandler(3, 0xFFFC00, 0xFFFFFF, MAP_WRITE); - - SekSetReadWordHandler(0, myangelReadWord); - SekSetReadByteHandler(0, myangelReadByte); - SekSetWriteWordHandler(0, myangelWriteWord); - SekSetWriteByteHandler(0, myangelWriteByte); - - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - - SekSetWriteWordHandler(2, grdiansPaletteWriteWord); - SekSetWriteByteHandler(2, grdiansPaletteWriteByte); - - SekSetWriteWordHandler(3, Tmp68301WriteWord); - SekSetWriteByteHandler(3, Tmp68301WriteByte); - - SekSetIrqCallback( grdiansSekIrqCallback ); - - SekClose(); - } - - GenericTilesInit(); - - yoffset = 0x10; - sva_x = 0; - sva_y = 0; - - gfx_code_mask = 0x0400000 * 4 / 64; - - x1010_sound_init(50000000 / 3, 0x0000); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -// -- myangel2 ----------------------------------------------------------- - -UINT8 __fastcall myangel2ReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -UINT16 __fastcall myangel2ReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x600000: return ~DrvInput[0]; - case 0x600002: return ~DrvInput[1]; - case 0x600004: return ~DrvInput[2]; - - case 0x600006: - //bprintf(PRINT_NORMAL, _T("watchdog_reset16_r\n")); - return 0xffff; - - case 0x600300: return ~DrvInput[3]; // DIP 1 - case 0x600302: return ~DrvInput[4]; // DIP 2 - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall myangel2WriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall myangel2WriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x600200: break; // NOP - - case 0x600300: - case 0x600302: - case 0x600304: - case 0x600306: - case 0x600308: - case 0x60030A: - case 0x60030C: - case 0x60030E: - x1010_sound_bank_w( (sekAddress & 0xf) >> 1, wordValue ); - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -static INT32 myangel2Init() -{ - INT32 nRet; - - Mem = NULL; - MemIndex(0x0200000, 0x1800000, 0x0500000, 0x000000); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); // blank all memory - MemIndex(0x0200000, 0x1800000, 0x0500000, 0x000000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 3, 2); if (nRet != 0) return 1; - - // Load Gfx - UINT8 * tmpGfx = (UINT8 *)BurnMalloc(0x0600000); - for (INT32 i = 0; i < 8; i+=2) { - BurnLoadRom(tmpGfx + 0x0000000, i + 4, 1); - BurnLoadRom(tmpGfx + 0x0200000, i + 5, 1); - loadDecodeGfx(tmpGfx, 0x0600000 / 2, i); - } - BurnFree(tmpGfx); - - // Leave 1MB empty (addressable by the chip) - BurnLoadRom(X1010SNDROM + 0x100000, 12, 1); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram68K, 0x200000, 0x20FFFF, MAP_RAM); // CPU 0 RAM - - SekMapMemory((UINT8 *)RamSpr, - 0xD00000, 0xD3FFFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)RamPal, - 0xD40000, 0xD4FFFF, MAP_ROM); // Palette - SekMapMemory((UINT8 *)RamVReg, - 0xD60000, 0xD6003F, MAP_RAM); // Video Registers - SekMapMemory((UINT8 *)RamTMP68301, - 0xFFFC00, 0xFFFFFF, MAP_ROM); // TMP68301 Registers - - SekMapHandler(1, 0xB00000, 0xB03FFF, MAP_READ | MAP_WRITE); - SekMapHandler(2, 0xD40000, 0xD4FFFF, MAP_WRITE); // Palette - SekMapHandler(3, 0xFFFC00, 0xFFFFFF, MAP_WRITE); - - SekSetReadWordHandler(0, myangel2ReadWord); - SekSetReadByteHandler(0, myangel2ReadByte); - SekSetWriteWordHandler(0, myangel2WriteWord); - SekSetWriteByteHandler(0, myangel2WriteByte); - - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - - SekSetWriteWordHandler(2, grdiansPaletteWriteWord); - SekSetWriteByteHandler(2, grdiansPaletteWriteByte); - - SekSetWriteWordHandler(3, Tmp68301WriteWord); - SekSetWriteByteHandler(3, Tmp68301WriteByte); - - SekSetIrqCallback( grdiansSekIrqCallback ); - - SekClose(); - } - - GenericTilesInit(); - - yoffset = 0x10; - sva_x = 0; - sva_y = 0; - - gfx_code_mask = 0x0600000 * 4 / 64; - - x1010_sound_init(50000000 / 3, 0x0000); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -// -- pzlbowl ----------------------------------------------------------- - -UINT8 __fastcall pzlbowlReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -UINT16 __fastcall pzlbowlReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x400300: return ~DrvInput[3]; // DIP 1 - case 0x400302: return ~DrvInput[4]; // DIP 2 - case 0x500000: return ~DrvInput[0]; // Player 1 - case 0x500002: return ~DrvInput[1]; // Player 2 - - case 0x500004: { - //readinputport(4) | (rand() & 0x80 ) - static UINT16 prot = 0; - prot ^= 0x80; - return ~(prot | DrvInput[2]); - } - case 0x500006: - //bprintf(PRINT_NORMAL, _T("watchdog_reset16_r\n")); - return 0xffff; - case 0x700000: { - /* The game checks for a specific value read from the ROM region. - The offset to use is stored in RAM at address 0x20BA16 */ - UINT32 address = (*(UINT16 *)(Ram68K + 0x00ba16) << 16) | *(UINT16 *)(Ram68K + 0x00ba18); - bprintf(PRINT_NORMAL, _T("pzlbowl Protection read address %08x [%02x %02x %02x %02x]\n"), address, - Rom68K[ address - 2 ], Rom68K[ address - 1 ], Rom68K[ address - 0 ], Rom68K[ address + 1 ]); - return Rom68K[ address - 2 ]; } -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall pzlbowlWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall pzlbowlWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x400300: - case 0x400302: - case 0x400304: - case 0x400306: - case 0x400308: - case 0x40030A: - case 0x40030C: - case 0x40030E: - x1010_sound_bank_w( (sekAddress & 0xf) >> 1, wordValue ); - break; - case 0x500004: - //bprintf(PRINT_NORMAL, _T("Coin Counter %x\n"), wordValue); - break; -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -static INT32 pzlbowlInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex(0x0100000, 0x1000000, 0x0500000, 0x000000); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); // blank all memory - MemIndex(0x0100000, 0x1000000, 0x0500000, 0x000000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - - // Load Gfx - UINT8 * tmpGfx = (UINT8 *)BurnMalloc(0x0400000); - for (INT32 i=0; i<4; i++) { - BurnLoadRom(tmpGfx, i+2, 1); - loadDecodeGfx( tmpGfx, 0x0400000 / 2, i*2 ); - } - BurnFree(tmpGfx); - - // Leave 1MB empty (addressable by the chip) - BurnLoadRom(X1010SNDROM + 0x100000, 6, 1); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram68K, 0x200000, 0x20FFFF, MAP_RAM); // CPU 0 RAM - - SekMapMemory((UINT8 *)RamSpr, - 0x800000, 0x83FFFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)RamPal, - 0x840000, 0x84FFFF, MAP_ROM); // Palette - SekMapMemory((UINT8 *)RamVReg, - 0x860000, 0x86003F, MAP_RAM); // Video Registers - SekMapMemory((UINT8 *)RamTMP68301, - 0xFFFC00, 0xFFFFFF, MAP_ROM); // TMP68301 Registers - - SekMapHandler(1, 0x900000, 0x903FFF, MAP_READ | MAP_WRITE); - SekMapHandler(2, 0x840000, 0x84FFFF, MAP_WRITE); // Palette - SekMapHandler(3, 0xFFFC00, 0xFFFFFF, MAP_WRITE); - - SekSetReadWordHandler(0, pzlbowlReadWord); - SekSetReadByteHandler(0, pzlbowlReadByte); - SekSetWriteWordHandler(0, pzlbowlWriteWord); - SekSetWriteByteHandler(0, pzlbowlWriteByte); - - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - - SekSetWriteWordHandler(2, grdiansPaletteWriteWord); - SekSetWriteByteHandler(2, grdiansPaletteWriteByte); - - SekSetWriteWordHandler(3, Tmp68301WriteWord); - SekSetWriteByteHandler(3, Tmp68301WriteByte); - - SekSetIrqCallback( grdiansSekIrqCallback ); - - SekClose(); - } - - GenericTilesInit(); - - yoffset = 0; - sva_x = 16; - sva_y = 256; - - gfx_code_mask = 0x0400000 * 4 / 64; - - x1010_sound_init(50000000 / 3, 0x0000); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -// -- penbros ----------------------------------------------------------- - -UINT8 __fastcall penbrosReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -UINT16 __fastcall penbrosReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x500300: return ~DrvInput[3]; // DIP 1 - case 0x500302: return ~DrvInput[4]; // DIP 2 - case 0x600000: return ~DrvInput[0]; // Player 1 - case 0x600002: return ~DrvInput[1]; // Player 2 - case 0x600004: return ~DrvInput[2]; // Coin - - case 0x600006: - //bprintf(PRINT_NORMAL, _T("watchdog_reset16_r\n")); - return 0xffff; -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall penbrosWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - default: - bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall penbrosWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x500300: - case 0x500302: - case 0x500304: - case 0x500306: - case 0x500308: - case 0x50030A: - case 0x50030C: - case 0x50030E: - x1010_sound_bank_w( (sekAddress & 0xf) >> 1, wordValue ); - break; - case 0x600004: - //bprintf(PRINT_NORMAL, _T("Coin Counter %x\n"), wordValue); - break; -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -static INT32 penbrosInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex(0x0100000, 0x1000000, 0x0300000, 0x040000); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); // blank all memory - MemIndex(0x0100000, 0x1000000, 0x0300000, 0x040000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - - // Load Gfx - UINT8 * tmpGfx = (UINT8 *)BurnMalloc(0x0400000); - for (INT32 i=0; i<3; i++) { - BurnLoadRom(tmpGfx, i+2, 1); - loadDecodeGfx( tmpGfx, 0x0400000 / 2, i*2 ); - } - BurnFree(tmpGfx); - - // Leave 1MB empty (addressable by the chip) - BurnLoadRom(X1010SNDROM + 0x100000, 5, 1); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram68K, 0x200000, 0x20FFFF, MAP_RAM); // CPU 0 RAM - - SekMapMemory(RamUnknown + 0x00000, - 0x210000, 0x23FFFF, MAP_RAM); - SekMapMemory(RamUnknown + 0x30000, - 0x300000, 0x30FFFF, MAP_RAM); - - SekMapMemory((UINT8 *)RamSpr, - 0xB00000, 0xB3FFFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)RamPal, - 0xB40000, 0xB4FFFF, MAP_ROM); // Palette - SekMapMemory((UINT8 *)RamVReg, - 0xB60000, 0xB6003F, MAP_RAM); // Video Registers - SekMapMemory((UINT8 *)RamTMP68301, - 0xFFFC00, 0xFFFFFF, MAP_ROM); // TMP68301 Registers - - SekMapHandler(1, 0xA00000, 0xA03FFF, MAP_READ | MAP_WRITE); - SekMapHandler(2, 0xB40000, 0xB4FFFF, MAP_WRITE); // Palette - SekMapHandler(3, 0xFFFC00, 0xFFFFFF, MAP_WRITE); - - SekSetReadWordHandler(0, penbrosReadWord); - SekSetReadByteHandler(0, penbrosReadByte); - SekSetWriteWordHandler(0, penbrosWriteWord); - SekSetWriteByteHandler(0, penbrosWriteByte); - - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - - SekSetWriteWordHandler(2, grdiansPaletteWriteWord); - SekSetWriteByteHandler(2, grdiansPaletteWriteByte); - - SekSetWriteWordHandler(3, Tmp68301WriteWord); - SekSetWriteByteHandler(3, Tmp68301WriteByte); - - SekSetIrqCallback( grdiansSekIrqCallback ); - - SekClose(); - } - - GenericTilesInit(); - - yoffset = 0; - sva_x = 0; - sva_y = 128; - - gfx_code_mask = 0x0400000 * 4 / 64; - - x1010_sound_init(50000000 / 3, 0x0000); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - return 0; -} - -// -- gundamex ----------------------------------------------------------- - -void __fastcall gundamexWriteWord(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x70000c: // watchdog - case 0x800000: // coin lockout - return; - - case 0xe00010: - case 0xe00012: - case 0xe00014: - case 0xe00016: - case 0xe00018: - case 0xe0001a: - case 0xe0001c: - case 0xe0001e: - x1010_sound_bank_w( (address & 0x0f) >> 1, data ); - return; - - case 0xfffd0a: - EEPROMWrite(data & 0x02, data & 0x04, data & 0x01); - return; - } - - if ((address & 0xfffc00) == 0xfffc00) { - Tmp68301WriteWord(address, data); - return; - } -} - -void __fastcall gundamexWriteByte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffc00) == 0xfffc00) { - Tmp68301WriteByte(address, data); - return; - } -} - -UINT16 __fastcall gundamexReadWord(UINT32 address) -{ - switch (address) - { - case 0x600000: - return 0xff00 | DrvInput[3]; - - case 0x600002: - return 0xff00 | DrvInput[4]; - - case 0x700000: - return 0xffff ^ DrvInput[0]; - - case 0x700002: - return 0xffff ^ DrvInput[1]; - - case 0x700004: - return ((0xffff ^ DrvInput[2]) & ~0x20) | (DrvInput[7] & 0x20); - - case 0x700008: - return 0xffff ^ DrvInput[5]; - - case 0x70000a: - return 0xffff ^ DrvInput[6]; - - case 0xfffd0a: - return ((EEPROMRead() & 1)) << 3; - } - - if ((address & 0xfffc00) == 0xfffc00) { - return BURN_ENDIAN_SWAP_INT16(RamTMP68301[(address & 0x3ff) / 2]); - } - - return 0; -} - -static INT32 gundamexInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex(0x0300000, 0x2000000, 0x0300000, 0x010000); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); // blank all memory - MemIndex(0x0300000, 0x2000000, 0x0300000, 0x010000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100001, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x100000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x200000, 4, 0); if (nRet != 0) return 1; - - UINT8 * tmpGfx = (UINT8 *)BurnMalloc(0x0600000); - nRet = BurnLoadRom(tmpGfx + 0x0000000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(tmpGfx + 0x0200000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(tmpGfx + 0x0400000, 7, 1); if (nRet != 0) return 1; - loadDecodeGfx(tmpGfx, 0x600000 / 2, 0); - nRet = BurnLoadRom(tmpGfx + 0x0000000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(tmpGfx + 0x0200000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(tmpGfx + 0x0400000, 10, 1); if (nRet != 0) return 1; - loadDecodeGfx(tmpGfx, 0x600000 / 2, 2); - nRet = BurnLoadRom(tmpGfx + 0x0000000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(tmpGfx + 0x0200000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(tmpGfx + 0x0400000, 13, 1); if (nRet != 0) return 1; - loadDecodeGfx(tmpGfx, 0x600000 / 2, 4); - - BurnFree(tmpGfx); - - BurnLoadRom(X1010SNDROM + 0x100000, 14, 1); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram68K, 0x200000, 0x20FFFF, MAP_RAM); // CPU 0 RAM - SekMapMemory(Rom68K + 0x200000, 0x500000, 0x57FFFF, MAP_ROM); // CPU 0 ROM - - SekMapMemory((UINT8 *)RamSpr, 0xc00000, 0xc3FFFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)RamPal, 0xc40000, 0xc4FFFF, MAP_ROM); // Palette - SekMapMemory(RamUnknown + 0x00000, 0xc50000, 0xc5FFFF, MAP_RAM); - SekMapMemory((UINT8 *)RamVReg, 0xc60000, 0xc6003F, MAP_RAM); // Video Registers - - SekMapHandler(1, 0xb00000, 0xb03FFF, MAP_READ | MAP_WRITE); - SekMapHandler(2, 0xc40000, 0xc4FFFF, MAP_WRITE); - - SekSetReadWordHandler(0, gundamexReadWord); - //SekSetReadByteHandler(0, gundamexReadByte); - SekSetWriteWordHandler(0, gundamexWriteWord); - SekSetWriteByteHandler(0, gundamexWriteByte); - - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - - SekSetWriteWordHandler(2, grdiansPaletteWriteWord); - SekSetWriteByteHandler(2, grdiansPaletteWriteByte); - - SekSetIrqCallback( grdiansSekIrqCallback ); - - SekClose(); - } - - GenericTilesInit(); - - // Hack to skip black screen on EEPROM failure - //*((UINT16*)(Rom68K + 0x00f98)) = 0x4e71; - - yoffset = 0; - sva_x = 0; - sva_y = 256; - - gfx_code_mask = 0x0800000 * 4 / 64; - - x1010_sound_init(50000000 / 3, 0x0000); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - EEPROMInit(&eeprom_interface_93C46); - - DrvDoReset(); - - return 0; -} - -// -- samshoot ----------------------------------------------------------- - -void __fastcall samshootWriteWord(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff0) == 0x400300) { - x1010_sound_bank_w( (address & 0x0f) >> 1, data ); - return; - } -} - -UINT16 __fastcall samshootReadWord(UINT32 address) -{ - switch (address) - { - case 0x400000: - return 0xff00 | DrvInput[6]; - - case 0x400002: - return 0xff00 | DrvInput[0]; - - case 0x500000: - return DrvAnalogInput[0] | (DrvAnalogInput[1] << 8); - - case 0x580000: - return DrvAnalogInput[2] | (DrvAnalogInput[3] << 8); - - case 0x700000: - return 0xff00 | DrvInput[1]; - - case 0x700002: - return 0xff00 | DrvInput[2]; - - case 0x700004: - return 0xff00 | DrvInput[3]; - - case 0x700006: - return 0; // watchdog - - case 0xfffd0a: - return 0xff00 | DrvInput[7]; - } - - return 0; -} - -static INT32 samshootInit() -{ - INT32 nRet; - - HasNVRam = 1; - - Mem = NULL; - MemIndex(0x0200000, 0x2000000, 0x0500000, 0x010000); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(0x0200000, 0x2000000, 0x0500000, 0x010000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(Rom68K + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000000, 1, 2); if (nRet != 0) return 1; - - UINT8 * tmpGfx = (UINT8 *)BurnMalloc(0x0800000); - - nRet = BurnLoadRom(tmpGfx, 2, 1); if (nRet != 0) return 1; - loadDecodeGfx(tmpGfx, 0x800000 / 2, 0); - nRet = BurnLoadRom(tmpGfx, 3, 1); if (nRet != 0) return 1; - loadDecodeGfx(tmpGfx, 0x800000 / 2, 2); - nRet = BurnLoadRom(tmpGfx, 4, 1); if (nRet != 0) return 1; - loadDecodeGfx(tmpGfx, 0x800000 / 2, 4); - nRet = BurnLoadRom(tmpGfx, 5, 1); if (nRet != 0) return 1; - loadDecodeGfx(tmpGfx, 0x800000 / 2, 6); - - BurnFree(tmpGfx); - - BurnLoadRom(X1010SNDROM + 0x100000, 6, 1); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom68K, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram68K, 0x200000, 0x20FFFF, MAP_RAM); // CPU 0 RAM - - SekMapMemory(RamNV + 0x00000, 0x300000, 0x30FFFF, MAP_RAM); - - SekMapMemory((UINT8 *)RamSpr, 0x800000, 0x83FFFF, MAP_RAM); // sprites - SekMapMemory((UINT8 *)RamPal, 0x840000, 0x84FFFF, MAP_ROM); // Palette - SekMapMemory((UINT8 *)RamVReg, 0x860000, 0x86003F, MAP_RAM); // Video Registers - SekMapMemory((UINT8 *)RamTMP68301, 0xFFFC00, 0xFFFFFF, MAP_ROM); // TMP68301 Registers - - SekMapHandler(2, 0x840000, 0x84FFFF, MAP_WRITE); // Palette - SekMapHandler(1, 0x900000, 0x903FFF, MAP_READ | MAP_WRITE); - SekMapHandler(3, 0xFFFC00, 0xFFFFFF, MAP_WRITE); - - SekSetReadWordHandler(0, samshootReadWord); - SekSetWriteWordHandler(0, samshootWriteWord); - - SekSetReadWordHandler (1, setaSoundRegReadWord); - SekSetReadByteHandler (1, setaSoundRegReadByte); - SekSetWriteWordHandler(1, setaSoundRegWriteWord); - SekSetWriteByteHandler(1, setaSoundRegWriteByte); - - SekSetWriteWordHandler(2, grdiansPaletteWriteWord); - SekSetWriteByteHandler(2, grdiansPaletteWriteByte); - - SekSetWriteWordHandler(3, Tmp68301WriteWord); - SekSetWriteByteHandler(3, Tmp68301WriteByte); - - SekSetIrqCallback( grdiansSekIrqCallback ); - - SekClose(); - } - - GenericTilesInit(); - - yoffset = 0; - sva_x = 64; - sva_y = 64; - - gfx_code_mask = 0x0800000 * 4 / 64; - - x1010_sound_init(50000000 / 3, 0x0000); - x1010_set_route(BURN_SND_X1010_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - x1010_set_route(BURN_SND_X1010_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - BurnGunInit(2, true); - - DrvDoReset(); - - return 0; -} - - -static INT32 grdiansExit() -{ - SekExit(); - x1010_exit(); - - GenericTilesExit(); - - BurnFree(Mem); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "gundamex")) { - EEPROMExit(); - } - - if (nBurnGunNumPlayers) BurnGunExit(); - - HasNVRam = 0; - -// bMahjong = 0; - - return 0; -} - - -#define DRAWGFX( op ) \ - code %= gfx_code_mask; /* I hate to use a modulo, but myangel2 needs it */ \ - if (!code) return; \ - sx -= sva_x; \ - sy -= sva_y; \ - \ - if (sx <= -8) return; \ - if (sx >= nScreenWidth) return; \ - if (sy <= -8) return; \ - if (sy >= nScreenHeight) return; \ - \ - UINT16 * pd = pTransDraw; \ - UINT8 * ps = RomGfx + (code << 6); \ - \ - if (sx < 0 || sx > nScreenWidth - 8 || sy < 0 || sy > nScreenHeight - 8) { \ - if ( flipy ) { \ - pd += (sy + 7) * nScreenWidth + sx; \ - if ( flipx ) { \ - for (INT32 i=7;i>=0;i--,pd-=nScreenWidth) \ - if ( sy+i < 0 || sy+i >= nScreenHeight ) \ - ps += 8; \ - else \ - for (INT32 j=7;j>=0;j--,ps++) { \ - UINT8 c = op; \ - if ( c && sx+j >= 0 && sx+j < nScreenWidth ) \ - *(pd + j) = c | color; \ - } \ - } else \ - for (INT32 i=7;i>=0;i--,pd-=nScreenWidth) \ - if ( sy+i < 0 || sy+i >= nScreenHeight ) \ - ps += 8; \ - else \ - for (INT32 j=0;j<8;j++,ps++) { \ - UINT8 c = op; \ - if ( c && sx+j >= 0 && sx+j < nScreenWidth ) \ - *(pd + j) = c | color; \ - } \ - } else { \ - pd += sy * nScreenWidth + sx; \ - if ( flipx ) { \ - for (INT32 i=0;i<8;i++,pd+=nScreenWidth) \ - if ( sy+i < 0 || sy+i >= nScreenHeight ) \ - ps += 8; \ - else \ - for (INT32 j=7;j>=0;j--,ps++) { \ - UINT8 c = op; \ - if ( c && sx+j >= 0 && sx+j < nScreenWidth ) \ - *(pd + j) = c | color; \ - } \ - } else \ - for (INT32 i=0;i<8;i++,pd+=nScreenWidth) \ - if ( sy+i < 0 || sy+i >= nScreenHeight ) \ - ps += 8; \ - else \ - for (INT32 j=0;j<8;j++,ps++) { \ - UINT8 c = op; \ - if ( c && sx+j >= 0 && sx+j < nScreenWidth ) \ - *(pd + j) = c | color; \ - } \ - } \ - return; \ - } \ - \ - \ - if ( flipy ) { \ - pd += (sy + 7) * nScreenWidth + sx; \ - if ( flipx ) \ - for (INT32 i=0;i<8;i++,pd-=nScreenWidth) \ - for (INT32 j=7;j>=0;j--,ps++) { \ - UINT8 c = op; \ - if ( c ) *(pd + j) = c | color; \ - } \ - else \ - for (INT32 i=0;i<8;i++,pd-=nScreenWidth) \ - for (INT32 j=0;j<8;j++,ps++) { \ - UINT8 c = op; \ - if ( c ) *(pd + j) = c | color; \ - } \ - } else { \ - pd += sy * nScreenWidth + sx; \ - if ( flipx ) \ - for (INT32 i=0;i<8;i++,pd+=nScreenWidth) \ - for (INT32 j=7;j>=0;j--,ps++) { \ - UINT8 c = op; \ - if ( c ) *(pd + j) = c | color; \ - } \ - else \ - for (INT32 i=0;i<8;i++,pd+=nScreenWidth) \ - for (INT32 j=0;j<8;j++,ps++) { \ - UINT8 c = op; \ - if ( c ) *(pd + j) = c | color; \ - } \ - } \ - - -static void drawgfx0(UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 sx,INT32 sy) -{ - // 4bpp tiles (----3210) - DRAWGFX( *ps & 0x0f ); -} - -static void drawgfx1(UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 sx,INT32 sy) -{ - // 4bpp tiles (3210----) - DRAWGFX( *ps >> 4 ); -} - -static void drawgfx2(UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 sx,INT32 sy) -{ - // 6bpp tiles (--543210) - DRAWGFX( *ps & 0x3f ); -} - -static void drawgfx3(UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 sx,INT32 sy) -{ - // 8bpp tiles (76543210) - DRAWGFX( *ps ); -} - -static void drawgfx4(UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 sx,INT32 sy) -{ - // 3bpp tiles? (-----210) - DRAWGFX( *ps & 0x07 ); -} - -static void drawgfx5(UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 sx,INT32 sy) -{ - // 2bpp tiles??? (--10----) - DRAWGFX( (*ps >> 4) & 0x03 ); -} - -static void drawgfxN(UINT32,UINT32,INT32,INT32,INT32,INT32) -{ - // unknown -} - -typedef void (*pDrawgfx)(UINT32,UINT32,INT32,INT32,INT32,INT32); - -static void DrvDraw() -{ - if (bRecalcPalette) { - for (INT32 i=0;i<0x08000; i++) - CurPal[i] = CalcCol( RamPal[i] ); - bRecalcPalette = 0; - } - -// memset(pBurnDraw, 0, nScreenWidth * nScreenHeight * 2); - BurnTransferClear(); - - if (BURN_ENDIAN_SWAP_INT16(RamVReg[0x30/2]) & 1) { // Blank Screen - memcpy(RamSprBak, RamSpr, 0x040000); - return; - } - - UINT16 *s1 = RamSprBak + 0x3000 / 2; - UINT16 *end = RamSprBak + 0x040000 / 2; - - for ( ; s1 < end; s1+=4 ) { - INT32 num = BURN_ENDIAN_SWAP_INT16(s1[0]); - INT32 xoffs = BURN_ENDIAN_SWAP_INT16(s1[1]); - INT32 yoffs = BURN_ENDIAN_SWAP_INT16(s1[2]); - INT32 sprite = BURN_ENDIAN_SWAP_INT16(s1[3]); - pDrawgfx drawgfx = drawgfxN; - - // Single-sprite address - UINT16 *s2 = RamSprBak + (sprite & 0x7fff) * 4; - - // Single-sprite tile size - INT32 global_sizex = xoffs & 0x0c00; - INT32 global_sizey = yoffs & 0x0c00; - - INT32 use_global_size = num & 0x1000; - - xoffs &= 0x3ff; - yoffs &= 0x3ff; - - // Color depth - switch (num & 0x0700) - { - case 0x0700: // 8bpp tiles (76543210) - drawgfx = drawgfx3; break; - case 0x0600: // 6bpp tiles (--543210) (myangel sliding blocks test) - drawgfx = drawgfx2; break; - case 0x0500: // 4bpp tiles (3210----) - drawgfx = drawgfx1; break; - case 0x0400: // 4bpp tiles (----3210) - drawgfx = drawgfx0; break; - case 0x0200: // 3bpp tiles? (-----210) (myangel "Graduate Tests") - drawgfx = drawgfx4; break; - case 0x0100: // 2bpp tiles??? (--10----) (myangel2 question bubble, myangel endgame) - drawgfx = drawgfx5; break; - case 0x0000: // no idea! - drawgfx = drawgfx0; break; - //default: - //bprintf(PRINT_NORMAL, _T("unknown gfxset %x\n"), (num & 0x0700)>>8 ); - // drawgfx = drawgfxN; - } - - // Number of single-sprites - num = (num & 0x00ff) + 1; - - for( ; num > 0; num--,s2+=4 ) { - if (s2 >= end) break; - - if (sprite & 0x8000) { - // "tilemap" sprite - INT32 clip_min_y; - INT32 clip_max_y; - INT32 clip_min_x; - INT32 clip_max_x; - - INT32 dx,x,y; - INT32 flipx; - INT32 flipy; - INT32 sx = BURN_ENDIAN_SWAP_INT16(s2[0]); - INT32 sy = BURN_ENDIAN_SWAP_INT16(s2[1]); - INT32 scrollx = BURN_ENDIAN_SWAP_INT16(s2[2]); - INT32 scrolly = BURN_ENDIAN_SWAP_INT16(s2[3]); - INT32 tilesize = (scrollx & 0x8000) >> 15; - INT32 page = (scrollx & 0x7c00) >> 10; - INT32 height = ((sy & 0xfc00) >> 10) + 1; - - sx &= 0x3ff; - sy &= 0x1ff; - scrollx &= 0x3ff; - scrolly &= 0x1ff; - - clip_min_y = (sy + yoffs) & 0x1ff; - clip_max_y = clip_min_y + height * 0x10 - 1; - if (clip_min_y > (sva_y + nScreenHeight - 1)) continue; - if (clip_max_y < sva_y) continue; - - clip_min_x = sva_x; - clip_max_x = sva_x + nScreenWidth - 1; - - if (clip_min_y < sva_y) clip_min_y = sva_y; - if (clip_max_y > (sva_y + nScreenHeight - 1)) clip_max_y = sva_y + nScreenHeight - 1; - - dx = sx + (scrollx & 0x3ff) + xoffs + 0x10; - - /* Draw the rows */ - /* I don't think the following is entirely correct (when using 16x16 - tiles x should probably loop from 0 to 0x20) but it seems to work - fine in all the games we have for now. */ - for (y = 0; y < (0x40 >> tilesize); y++) - { - INT32 py = ((scrolly - (y+1) * (8 << tilesize) + 0x10) & 0x1ff) - 0x10 - yoffset; - - if (py < clip_min_y - 0x10) continue; - if (py > clip_max_y) continue; - - for (x = 0; x < 0x40;x++) - { - INT32 px = ((dx + x * (8 << tilesize) + 0x10) & 0x3ff) - 0x10; - INT32 tx, ty; - INT32 attr, code, color; - UINT16 *s3; - - if (px < clip_min_x - 0x10) continue; - if (px > clip_max_x) continue; - - s3 = RamSprBak + 2 * ((page * 0x2000/4) + ((y & 0x1f) << 6) + (x & 0x03f)); - - attr = BURN_ENDIAN_SWAP_INT16(s3[0]); - code = BURN_ENDIAN_SWAP_INT16(s3[1]) + ((attr & 0x0007) << 16); - flipx = (attr & 0x0010); - flipy = (attr & 0x0008); - color = (attr & 0xffe0) >> 5; - - if (tilesize) code &= ~3; - - for (ty = 0; ty <= tilesize; ty++) - for (tx = 0; tx <= tilesize; tx++) - drawgfx(code ^ tx ^ (ty<<1), color << 4, flipx, flipy, px + (flipx ? tilesize-tx : tx) * 8, py + (flipy ? tilesize-ty : ty) * 8 ); - } - } - - } else { - // "normal" sprite - INT32 sx = BURN_ENDIAN_SWAP_INT16(s2[0]); - INT32 sy = BURN_ENDIAN_SWAP_INT16(s2[1]); - INT32 attr = BURN_ENDIAN_SWAP_INT16(s2[2]); - INT32 code = BURN_ENDIAN_SWAP_INT16(s2[3]) + ((attr & 0x0007) << 16); - INT32 flipx = (attr & 0x0010); - INT32 flipy = (attr & 0x0008); - INT32 color = (attr & 0xffe0) >> 5; - - INT32 sizex = use_global_size ? global_sizex : sx; - INT32 sizey = use_global_size ? global_sizey : sy; - INT32 x,y; - sizex = (1 << ((sizex & 0x0c00)>> 10))-1; - sizey = (1 << ((sizey & 0x0c00)>> 10))-1; - - - sx += xoffs; - sy += yoffs; - - sx = (sx & 0x1ff) - (sx & 0x200); - sy &= 0x1ff; - sy -= yoffset; - - code &= ~((sizex+1) * (sizey+1) - 1); // see myangel, myangel2 and grdians - - for (y = 0; y <= sizey; y++) - for (x = 0; x <= sizex; x++) - drawgfx( code++, color << 4, flipx, flipy, sx + (flipx ? sizex-x : x) * 8, sy + (flipy ? sizey-y : y) * 8 ); - - } - - } - if (BURN_ENDIAN_SWAP_INT16(s1[0]) & 0x8000) break; // end of list marker - } - - BurnTransferCopy(CurPal); - - memcpy(RamSprBak, RamSpr, 0x040000); -} - - -#define M68K_CYCS_PER_FRAME (M68K_CYCS / 60) -#define SETA2_INTER_LEAVE 32 -#define M68K_CYCS_PER_INTER (M68K_CYCS_PER_FRAME / SETA2_INTER_LEAVE) - -static INT32 grdiansFrame() -{ - if (DrvReset) // Reset machine - DrvDoReset(); - - DrvInput[0] = 0x00; // Joy1 - DrvInput[1] = 0x00; // Joy2 - DrvInput[2] = 0x00; // Buttons - DrvInput[5] = 0x00; // Joy3 - DrvInput[6] = 0x00; // Joy4 -// DrvInput[7] = 0x00; // Joy5 - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - DrvInput[5] |= (DrvJoy3[i] & 1) << i; - DrvInput[6] |= (DrvJoy4[i] & 1) << i; - DrvInput[6] |= (DrvJoy5[i] & 1) << i; - } - - INT32 nCyclesDone = 0; - INT32 nCyclesNext = 0; - INT32 nCyclesExec = 0; - - SekNewFrame(); - - SekOpen(0); - - for(INT32 i=0; i= tmp68301_timer[j]) { - // timer[j] timeout ! - tmp68301_timer[j] = 0; - tmp68301_timer_counter[j] = 0; - tmp68301_timer_callback(j); - } - } - } - - tmp68301_update_irq_state(0); - - SekClose(); - - if (pBurnDraw) - DrvDraw(); - - if (pBurnSoundOut) - x1010_sound_update(); - - return 0; -} - -static INT32 samshootDraw() -{ - DrvDraw(); - - for (INT32 i = 0; i < BurnDrvGetMaxPlayers(); i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } - - return 0; -} - -static INT32 samshootFrame() -{ - if (DrvReset) // Reset machine - DrvDoReset(); - - { - memset (DrvInput, 0xff, 5); - - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] ^= (DrvJoy1[i] & 1) << i; - DrvInput[1] ^= (DrvJoy2[i] & 1) << i; - DrvInput[2] ^= (DrvJoy3[i] & 1) << i; - DrvInput[3] ^= (DrvJoy4[i] & 1) << i; - DrvInput[4] ^= (DrvJoy5[i] & 1) << i; - } - - BurnGunMakeInputs(0, (INT16)DrvAxis[0], (INT16)DrvAxis[1]); - BurnGunMakeInputs(1, (INT16)DrvAxis[2], (INT16)DrvAxis[3]); - - float x0 = (320 - ((float)((BurnGunX[0] >> 8) + 8))) / 320 * 160; - float y0 = (240 - ((float)((BurnGunY[0] >> 8) + 8))) / 240 * 240; - float x1 = (320 - ((float)((BurnGunX[1] >> 8) + 8))) / 320 * 160; - float y1 = (240 - ((float)((BurnGunY[1] >> 8) + 8))) / 240 * 240; - DrvAnalogInput[0] = (UINT8)x0 + 36; - DrvAnalogInput[1] = (UINT8)y0 + 22; - DrvAnalogInput[2] = (UINT8)x1 + 36; - DrvAnalogInput[3] = (UINT8)y1 + 22; - } - - INT32 nCyclesDone = 0; - INT32 nCyclesNext = 0; - INT32 nCyclesExec = 0; - - SekNewFrame(); - - SekOpen(0); - - for(INT32 i=0; i= tmp68301_timer[j]) { - // timer[j] timeout ! - tmp68301_timer[j] = 0; - tmp68301_timer_counter[j] = 0; - tmp68301_timer_callback(j); - } - } - - if (i == 15) tmp68301_update_irq_state(2); - } - - tmp68301_update_irq_state(0); - - SekClose(); - - if (pBurnDraw) - samshootDraw(); - - if (pBurnSoundOut) - x1010_sound_update(); - - return 0; -} - -static INT32 grdiansScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) // Return minimum compatible version - *pnMin = 0x029671; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_NVRAM && HasNVRam && RamNV) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamNV; - ba.nLen = 0x10000; - ba.szName = "SetaNVRam"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - // Scan 68000 state - SekScan(nAction); - - x1010_scan(nAction, pnMin); - - BurnGunScan(); - - // Scan Input state - SCAN_VAR(DrvInput); - - // Scan TMP 68301 Chip state - SCAN_VAR(tmp68301_timer); - SCAN_VAR(tmp68301_timer_counter); - SCAN_VAR(tmp68301_irq_vector); - - if (nAction & ACB_WRITE) { - - // palette changed - bRecalcPalette = 1; - - // x1-010 bank changed - for (INT32 i=0; isound_banks[i] * 0x20000, 0x20000); - } - } - - return 0; -} - -struct BurnDriver BurnDrvGrdians = { - "grdians", NULL, NULL, NULL, "1995", - "Guardians\0Denjin Makai II\0", "Imperfect graphics @ game start cutscene", "Banpresto", "Newer Seta", - L"Guardians\0\u96FB\u795E\u9B54\u584A \uFF29\uFF29\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA2, GBF_SCRFIGHT, 0, - NULL, grdiansRomInfo, grdiansRomName, NULL, NULL, grdiansInputInfo, grdiansDIPInfo, - grdiansInit, grdiansExit, grdiansFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 304, 232, 4, 3 -}; - -struct BurnDriver BurnDrvMj4simai = { - "mj4simai", NULL, NULL, NULL, "1996", - "Wakakusamonogatari Mahjong Yonshimai (Japan)\0", NULL, "Maboroshi Ware", "Newer Seta", - L"\u82E5\u8349\u7269\u8A9E \u9EBB\u96C0\u56DB\u59C9\u59B9 (Japan)\0Wakakusamonogatari Mahjong Yonshimai\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_SETA2, GBF_MAHJONG, 0, - NULL, mj4simaiRomInfo, mj4simaiRomName, NULL, NULL, mj4simaiInputInfo, mj4simaiDIPInfo, - mj4simaiInit, grdiansExit, grdiansFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMyangel = { - "myangel", NULL, NULL, NULL, "1996", - "Kosodate Quiz My Angel (Japan)\0", NULL, "Namco", "Newer Seta", - L"\u5B50\u80B2\u3066\u30AF\u30A4\u30BA \u30DE\u30A4 \u30A8\u30F3\u30B8\u30A7\u30EB (Japan)\0Kosodate Quiz My Angel\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA2, GBF_QUIZ, 0, - NULL, myangelRomInfo, myangelRomName, NULL, NULL, myangelInputInfo, myangelDIPInfo, - myangelInit, grdiansExit, grdiansFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 376, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMyangel2 = { - "myangel2", NULL, NULL, NULL, "1996", - "Kosodate Quiz My Angel 2 (Japan)\0", NULL, "Namco", "Newer Seta", - L"\u5B50\u80B2\u3066\u30AF\u30A4\u30BA \u30DE\u30A4 \u30A8\u30F3\u30B8\u30A7\u30EB \uFF12 (Japan)\0Kosodate Quiz My Angel 2\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA2, GBF_QUIZ, 0, - NULL, myangel2RomInfo, myangel2RomName, NULL, NULL, myangelInputInfo, myangel2DIPInfo, - myangel2Init, grdiansExit, grdiansFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 376, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPzlbowl = { - "pzlbowl", NULL, NULL, NULL, "1999", - "Puzzle De Bowling (Japan)\0", NULL, "Nihon System / Moss", "Newer Seta", - L"Puzzle De Bowling\0\u30D1\u30BA\u30EB \uFF24\uFF25 \u30DC\u30FC\u30EA\u30F3\u30B0\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA2, GBF_PUZZLE, 0, - NULL, pzlbowlRomInfo, pzlbowlRomName, NULL, NULL, grdiansInputInfo, pzlbowlDIPInfo, - pzlbowlInit, grdiansExit, grdiansFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPenbros = { - "penbros", NULL, NULL, NULL, "2000", - "Penguin Brothers (Japan)\0", NULL, "Subsino", "Newer Seta", - L"\u30DA\u30F3\u30AE\u30F3 \u30D6\u30E9\u30B6\u30FC\u30BA (Japan)\0Penguin Brothers\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA2, GBF_PLATFORM, 0, - NULL, penbrosRomInfo, penbrosRomName, NULL, NULL, penbrosInputInfo, penbrosDIPInfo, - penbrosInit, grdiansExit, grdiansFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGundamex = { - "gundamex", NULL, NULL, NULL, "1994", - "Mobile Suit Gundam EX Revue\0", NULL, "Banpresto", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA2, GBF_VSFIGHT, 0, - NULL, gundamexRomInfo, gundamexRomName, NULL, NULL, GundamexInputInfo, GundamexDIPInfo, - gundamexInit, grdiansExit, grdiansFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDeerhunt = { - "deerhunt", NULL, NULL, NULL, "2000", - "Deer Hunting USA V4.3\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, deerhuntRomInfo, deerhuntRomName, NULL, NULL, DeerhuntInputInfo, DeerhuntDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDeerhuna = { - "deerhunta", "deerhunt", NULL, NULL, "2000", - "Deer Hunting USA V4.2\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, deerhunaRomInfo, deerhunaRomName, NULL, NULL, DeerhuntInputInfo, DeerhuntDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDeerhunb = { - "deerhuntb", "deerhunt", NULL, NULL, "2000", - "Deer Hunting USA V4.0\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, deerhunbRomInfo, deerhunbRomName, NULL, NULL, DeerhuntInputInfo, DeerhuntDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDeerhunc = { - "deerhuntc", "deerhunt", NULL, NULL, "2000", - "Deer Hunting USA V3.0\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, deerhuncRomInfo, deerhuncRomName, NULL, NULL, DeerhuntInputInfo, DeerhuntDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDeerhund = { - "deerhuntd", "deerhunt", NULL, NULL, "2000", - "Deer Hunting USA V2\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, deerhundRomInfo, deerhundRomName, NULL, NULL, DeerhuntInputInfo, DeerhuntDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDeerhune = { - "deerhunte", "deerhunt", NULL, NULL, "2000", - "Deer Hunting USA V1\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, deerhuneRomInfo, deerhuneRomName, NULL, NULL, DeerhuntInputInfo, DeerhuntDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvTurkhunt = { - "turkhunt", NULL, NULL, NULL, "2001", - "Turkey Hunting USA V1.0\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, turkhuntRomInfo, turkhuntRomName, NULL, NULL, DeerhuntInputInfo, TurkhuntDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWschamp = { - "wschamp", NULL, NULL, NULL, "2001", - "Wing Shooting Championship V2.00\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, wschampRomInfo, wschampRomName, NULL, NULL, WschampInputInfo, WschampDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWschampa = { - "wschampa", "wschamp", NULL, NULL, "2001", - "Wing Shooting Championship V1.01\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, wschampaRomInfo, wschampaRomName, NULL, NULL, WschampInputInfo, WschampDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWschampb = { - "wschampb", "wschamp", NULL, NULL, "2001", - "Wing Shooting Championship V1.00\0", NULL, "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, wschampbRomInfo, wschampbRomName, NULL, NULL, WschampInputInfo, WschampDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvTrophyh = { - "trophyh", NULL, NULL, NULL, "2002", - "Trophy Hunting - Bear & Moose V1.0\0", "Hangs are normal, just wait it out.", "Sammy USA Corporation", "Newer Seta", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA2, GBF_SHOOT, 0, - NULL, trophyhRomInfo, trophyhRomName, NULL, NULL, WschampInputInfo, TrophyhDIPInfo, - samshootInit, grdiansExit, samshootFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -static INT32 funcubeInit() -{ - return 1; -} - -struct BurnDriverD BurnDrvFuncube2 = { - "funcube2", NULL, NULL, NULL, "2001", - "Funcube 2 (v1.1)\0", "Unemulated Sub CPU", "Namco", "Newer Seta", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_SETA2, GBF_PUZZLE, 0, - NULL, funcube2RomInfo, funcube2RomName, NULL, NULL, grdiansInputInfo, grdiansDIPInfo, - funcubeInit, grdiansExit, grdiansFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; - -struct BurnDriverD BurnDrvFuncube4 = { - "funcube4", NULL, NULL, NULL, "2001", - "Funcube 4 (v1.0)\0", "Unemulated Sub CPU", "Namco", "Newer Seta", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_SETA2, GBF_PUZZLE, 0, - NULL, funcube4RomInfo, funcube4RomName, NULL, NULL, grdiansInputInfo, grdiansDIPInfo, - funcubeInit, grdiansExit, grdiansFrame, NULL, grdiansScan, &bRecalcPalette, 0x8000, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_shadfrce.cpp b/jan/src/burn/drv/pst90s/d_shadfrce.cpp deleted file mode 100644 index 41a21d185..000000000 --- a/jan/src/burn/drv/pst90s/d_shadfrce.cpp +++ /dev/null @@ -1,967 +0,0 @@ -// FB Alpha Shadow Force driver module -// Based on MAME driver by David Haywood -// port to Finalburn Alpha by OopsWare. 2007 - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; - -static UINT8 *Rom68K; -static UINT8 *RomZ80; -static UINT8 *RomGfx01; -static UINT8 *RomGfx02; -static UINT8 *RomGfx03; -static UINT8 *DrvOkiROM; -static UINT8 *Ram68K; -static UINT16 *RamBg00; -static UINT16 *RamBg01; -static UINT16 *RamFg; -static UINT16 *RamSpr; -static UINT16 *SprBuf; -static UINT16 *RamPal; -static UINT8 *RamZ80; - -static UINT32 *RamCurPal; - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDipBtn[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - -static UINT8 DrvInput[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvReset = 0; -static UINT8 nBrightness = 0xFF; - -static UINT8 okibank; -static UINT8 video_enable; -static UINT8 irqs_enable; -static UINT16 raster_scanline; -static UINT8 raster_irq_enable; -static UINT8 previous_irq_value; -static UINT8 bVBlank = 0; -static UINT16 bg0scrollx, bg0scrolly, bg1scrollx, bg1scrolly; -static UINT8 nSoundlatch = 0; -static UINT8 bRecalcPalette = 0; - -static INT32 nZ80Cycles; - -static struct BurnInputInfo shadfrceInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvDipBtn + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvButton + 0, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvButton + 1, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvButton + 2, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, DrvDipBtn + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvButton + 3, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvButton + 4, "p2 fire 5" }, - {"P2 Button 6", BIT_DIGITAL, DrvButton + 5, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 1, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvInput + 3, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip" }, - {"Dip D", BIT_DIPSWITCH, DrvInput + 7, "dip" }, -}; - -STDINPUTINFO(shadfrce) - -static struct BurnDIPInfo shadfrceDIPList[] = -{ - {0x19, 0xFF, 0xFF, 0x00, NULL }, - {0x1A, 0xFF, 0xFF, 0x00, NULL }, - {0x1B, 0xFF, 0xFF, 0x00, NULL }, - {0x1C, 0xFF, 0xFF, 0x00, NULL }, - - {0, 0xFE, 0, 2, "Service1" }, // only available when you are in "test mode" - {0x19, 0x01, 0x04, 0x00, "Off" }, - {0x19, 0x01, 0x04, 0x04, "On" }, - - {0, 0xFE, 0, 4, "Difficulty" }, - {0x1A, 0x01, 0x03, 0x00, "Normal" }, - {0x1A, 0x01, 0x03, 0x01, "Hard" }, - {0x1A, 0x01, 0x03, 0x02, "Easy" }, - {0x1A, 0x01, 0x03, 0x03, "Hardest" }, - - {0, 0xFE, 0, 4, "Stage Clear Energy Regain" }, - {0x1A, 0x01, 0x0C, 0x00, "25%" }, - {0x1A, 0x01, 0x0C, 0x04, "10%" }, - {0x1A, 0x01, 0x0C, 0x08, "50%" }, - {0x1A, 0x01, 0x0C, 0x0C, "0%" }, - - {0, 0xFE, 0, 4, "Coinage" }, - {0x1B, 0x01, 0x06, 0x00, "1 Coin 1 Credit" }, - {0x1B, 0x01, 0x06, 0x02, "1 Coin 2 Credits" }, - {0x1B, 0x01, 0x06, 0x04, "2 Coins 1 Credit" }, - {0x1B, 0x01, 0x06, 0x06, "3 Coins 1 Credit" }, - - {0, 0xFE, 0, 2, "Continue Price" }, - {0x1B, 0x01, 0x08, 0x00, "Off" }, - {0x1B, 0x01, 0x08, 0x80, "On" }, - - {0, 0xFE, 0, 2, "Free Play" }, - {0x1B, 0x01, 0x10, 0x00, "Off" }, - {0x1B, 0x01, 0x10, 0x10, "On" }, - - {0, 0xFE, 0, 2, "Flip Screen" }, - {0x1B, 0x01, 0x20, 0x00, "Off" }, - {0x1B, 0x01, 0x20, 0x20, "On" }, - - {0, 0xFE, 0, 2,"Demo Sounds" }, - {0x1C, 0x01, 0x01, 0x00, "Off" }, - {0x1C, 0x01, 0x01, 0x01, "On" }, - - {0, 0xFE, 0, 2, "Test Mode" }, - {0x1C, 0x01, 0x02, 0x00, "Off" }, - {0x1C, 0x01, 0x02, 0x02, "On" }, -}; - -STDDIPINFO(shadfrce) - -inline static void CalcCol(INT32 idx) -{ - UINT16 nColour = RamPal[idx]; - INT32 r = (nColour & 0x001F) << 3; r |= r >> 5; // Red - INT32 g = (nColour & 0x03E0) >> 2; g |= g >> 5; // Green - INT32 b = (nColour & 0x7C00) >> 7; b |= b >> 5; // Blue - r = (r * nBrightness) >> 8; - g = (g * nBrightness) >> 8; - b = (b * nBrightness) >> 8; - RamCurPal[idx] = BurnHighCol(r, g, b, 0); -} - -static UINT8 __fastcall shadfrceReadByte(UINT32 sekAddress) -{ - switch (sekAddress) - { - case 0x1D0020: - return (~DrvInput[1] & 0x3F); - - case 0x1D0021: - return ~DrvInput[0]; - - case 0x1D0022: - return (~DrvInput[3] & 0x3F); - - case 0x1D0023: - return ~DrvInput[2]; - - case 0x1D0024: - return (~DrvInput[5] & 0x3F); - - case 0x1D0025: - return ~DrvInput[4]; - - case 0x1D0026: - return ~(DrvInput[7] | (bVBlank << 2)); - - case 0x1D0027: - return ~DrvInput[6]; - - case 0x1C000B: - return 0; - - case 0x1D000D: - return nBrightness; - - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - - return 0; -} - -static UINT16 __fastcall shadfrceReadWord(UINT32 sekAddress) -{ - switch (sekAddress) - { - case 0x1D0020: - return ~(DrvInput[0] | (DrvInput[1] << 8)) & 0x3FFF; - - case 0x1D0022: - return ~(DrvInput[2] | (DrvInput[3] << 8)) & 0x3FFF; - - case 0x1D0024: - return ~(DrvInput[4] | (DrvInput[5] << 8)) & 0x3FFF; - - case 0x1D0026: - return ~(DrvInput[6] | ( (DrvInput[7] | (bVBlank << 2))<< 8)); - - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - - return 0; -} - -static void __fastcall shadfrceWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) - { - case 0x1C000B: - // shadfrce_flip_screen - break; - - case 0x1D0000: - case 0x1D0001: - case 0x1D0002: - case 0x1D0003: - case 0x1D0004: - case 0x1D0005: - SekSetIRQLine(((sekAddress/2) & 3) ^ 3, CPU_IRQSTATUS_NONE); - break; - - case 0x1D0007: - { - irqs_enable = byteValue & 1; - video_enable = byteValue & 0x08; - - if ((previous_irq_value & 4) == 0 && (byteValue & 4) == 4) { - raster_irq_enable = 1; - GenericTilemapSetScrollRows(1, 16*32); - } - if ((previous_irq_value & 4) == 4 && (byteValue & 4) == 0) { - raster_irq_enable = 0; - GenericTilemapSetScrollRows(1, 1); - } - - previous_irq_value = byteValue; - } - break; - - case 0x1D0009: - case 0x1D0008: - raster_scanline = 0; - break; - - case 0x1D000C: - nSoundlatch = byteValue; - ZetNmi(); - break; - - case 0x1D000D: - nBrightness = byteValue; - for(INT32 i=0;i<0x4000;i++) CalcCol(i); - break; - - case 0x1C000D: - case 0x1D0011: - case 0x1D0013: - case 0x1D0015: - case 0x1D0017: // NOP - break; - - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -static void __fastcall shadfrceWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) - { - case 0x1C0000: bg0scrollx = wordValue & 0x1FF; break; - case 0x1C0002: bg0scrolly = wordValue & 0x1FF; break; - case 0x1C0004: bg1scrollx = wordValue & 0x1FF; break; - case 0x1C0006: bg1scrolly = wordValue & 0x1FF; break; - - case 0x1D000D: - //nBrightness = byteValue; - break; - - case 0x1D0016: - // wait v-blink dip change call back ??? - break; - - case 0x1D0006: - { - irqs_enable = wordValue & 1; - video_enable = wordValue & 0x08; - - if ((previous_irq_value & 4) == 0 && (wordValue & 4) == 4) { - raster_irq_enable = 1; - GenericTilemapSetScrollRows(1, 16*32); - } - if ((previous_irq_value & 4) == 4 && (wordValue & 4) == 0) { - raster_irq_enable = 0; - GenericTilemapSetScrollRows(1, 1); - } - - previous_irq_value = wordValue; - } - break; - - case 0x1D0000: - case 0x1D0002: - case 0x1D0004: - SekSetIRQLine(((sekAddress/2) & 3) ^ 3, CPU_IRQSTATUS_NONE); - break; - - case 0x1D0008: - raster_scanline = 0; - break; - - // default: - // bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -static void __fastcall shadfrceWriteWordPalette(UINT32 sekAddress, UINT16 wordValue) -{ - sekAddress &= 0x7FFF; - sekAddress >>= 1; - RamPal[sekAddress] = wordValue; - CalcCol(sekAddress); -} - -static UINT8 __fastcall shadfrceZRead(UINT16 a) -{ - switch (a) - { - case 0xC801: - return BurnYM2151ReadStatus(); - - case 0xD800: - return MSM6295ReadStatus(0); - - case 0xE000: - return nSoundlatch; - - // default: - // bprintf(PRINT_NORMAL, _T("Z80 address %04X read.\n"), a); - } - - return 0; -} - -void __fastcall shadfrceZWrite(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0xC800: - BurnYM2151SelectRegister(d); - break; - - case 0xC801: - BurnYM2151WriteRegister(d); - break; - - case 0xD800: - MSM6295Command(0, d); - break; - - case 0xE800: - okibank = (d & 1); - MSM6295SetBank(0, DrvOkiROM + okibank * 0x40000, 0, 0x3ffff); - break; - - // default: - // bprintf(PRINT_NORMAL, _T("Z80 address %04X -> %02X.\n"), a, d); - } -} - -static void shadfrceYM2151IRQHandler(INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - ZetRun(1024); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - shadfrceZWrite(0xe800, 0); // set initial oki bank - BurnYM2151Reset(); - - video_enable = 0; - irqs_enable = 0; - raster_scanline = 0; - raster_irq_enable = 0; - previous_irq_value = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Rom68K = Next; Next += 0x100000; // 68000 ROM - RomZ80 = Next; Next += 0x010000; // Z80 ROM - RomGfx01 = Next; Next += 0x020000 / 4 * 8; // fg 8x8x4 - RomGfx02 = Next; Next += 0xA00000 / 5 * 8; // spr 16x16x5 sprite - RomGfx03 = Next; Next += 0x300000 / 6 * 8; // bg 16x16x6 tile - - MSM6295ROM = Next; - DrvOkiROM = Next; Next += 0x080000; - - RamStart = Next; - - RamBg00 = (UINT16 *) Next; Next += 0x001000 * sizeof(UINT16); - RamBg01 = (UINT16 *) Next; Next += 0x001000 * sizeof(UINT16); - RamFg = (UINT16 *) Next; Next += 0x001000 * sizeof(UINT16); - RamSpr = (UINT16 *) Next; Next += 0x001000 * sizeof(UINT16); - SprBuf = (UINT16 *) Next; Next += 0x001000 * sizeof(UINT16); - RamPal = (UINT16 *) Next; Next += 0x004000 * sizeof(UINT16); - Ram68K = Next; Next += 0x010000; - RamZ80 = Next; Next += 0x001800; - RamEnd = Next; - - RamCurPal = (UINT32 *) Next; Next += 0x004000 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { STEP4(0,2) }; - INT32 XOffs0[8] = { 1, 0, 8*8+1, 8*8+0, 16*8+1, 16*8+0, 24*8+1, 24*8+0 }; - INT32 YOffs0[8] = { STEP8(0,8) }; - - INT32 Plane1[5] = { (0x200000*8*4), (0x200000*8*3), (0x200000*8*2), (0x200000*8*1), (0x200000*8*0) }; - INT32 XOffs1[16] = { STEP8(0,1), STEP8(16*8,1) }; - INT32 YOffs1[16] = { STEP16(0,8) }; - - INT32 Plane2[6] = { (0x100000*8*0)+8, (0x100000*8*0), (0x100000*8*1)+8, (0x100000*8*1), (0x100000*8*2)+8, (0x100000*8*2) }; - INT32 XOffs2[16] = { STEP8(0,1), STEP8(16*16,1) }; - INT32 YOffs2[16] = { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xa00000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, RomGfx01, 0x20000); - - GfxDecode(0x01000, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x100, tmp, RomGfx01); - - memcpy (tmp, RomGfx02, 0xa00000); - - GfxDecode(0x10000, 5, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, RomGfx02); - - memcpy (tmp, RomGfx03, 0x300000); - - GfxDecode(0x04000, 6, 16, 16, Plane2, XOffs2, YOffs2, 0x200, tmp, RomGfx03); - - BurnFree(tmp); - - return 0; -} - -static tilemap_callback( background0 ) -{ - INT32 attr = RamBg00[offs * 2 + 0]; - INT32 color = (attr & 0x1f); - if (color & 0x10) color ^= 0x30; - - TILE_SET_INFO(1, RamBg00[offs * 2 + 1] & 0x3fff, color, TILE_FLIPYX((attr >> 6) & 3)); -} - -static tilemap_callback( background1 ) -{ - INT32 attr = RamBg01[offs]; - - TILE_SET_INFO(1, attr & 0xfff, (attr >> 12) + 0x40, 0); -} - -static tilemap_callback( foreground ) -{ - INT32 attr = RamFg[offs * 2 + 1] & 0xff; - - TILE_SET_INFO(0, (RamFg[offs * 2] & 0xff) + (attr << 8), attr >> 4, 0); -} - -static INT32 shadfrceInit() -{ - INT32 nRet; - - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - { - nRet = BurnLoadRom(Rom68K + 0x000000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x000001, 1, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x080000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Rom68K + 0x080001, 3, 2); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomZ80 + 0x000000, 4, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomGfx01 + 0x000000, 5, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomGfx02 + 0x000000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(RomGfx02 + 0x200000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(RomGfx02 + 0x400000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(RomGfx02 + 0x600000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(RomGfx02 + 0x800000, 10, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(RomGfx03 + 0x000000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(RomGfx03 + 0x100000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(RomGfx03 + 0x200000, 13, 1); if (nRet != 0) return 1; - - nRet = BurnLoadRom(DrvOkiROM, 14, 1); if (nRet != 0) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Rom68K, 0x000000, 0x0FFFFF, MAP_ROM); - SekMapMemory((UINT8 *)RamBg00, 0x100000, 0x101FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamBg01, 0x102000, 0x103FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamFg, 0x140000, 0x141FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamSpr, 0x142000, 0x143FFF, MAP_RAM); - SekMapMemory((UINT8 *)RamPal, 0x180000, 0x187FFF, MAP_ROM); - SekMapMemory(Ram68K, 0x1F0000, 0x1FFFFF, MAP_RAM); - SekMapHandler(1, 0x180000, 0x187FFF, MAP_WRITE); - SekSetReadWordHandler(0, shadfrceReadWord); - SekSetReadByteHandler(0, shadfrceReadByte); - SekSetWriteWordHandler(0, shadfrceWriteWord); - SekSetWriteByteHandler(0, shadfrceWriteByte); - //SekSetWriteByteHandler(1, shadfrceWriteBytePalette); - SekSetWriteWordHandler(1, shadfrceWriteWordPalette); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(RomZ80, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(RamZ80, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(RamZ80 + 0x0800, 0xf000, 0xffff, MAP_RAM); - ZetSetReadHandler(shadfrceZRead); - ZetSetWriteHandler(shadfrceZWrite); - ZetClose(); - - BurnYM2151Init(3579545); // 3.5795 MHz - YM2151SetIrqHandler(0, &shadfrceYM2151IRQHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - MSM6295Init(0, 12000, 1); // 12.000 KHz - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - nZ80Cycles = 3579545 * 100 / nBurnFPS; - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, foreground_map_callback, 8, 8, 64, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, background0_map_callback, 16, 16, 32, 32); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, background1_map_callback, 16, 16, 32, 32); - GenericTilemapSetGfx(0, RomGfx01, 6 /*actually 4*/, 8, 8, 0x040000, 0x0000, 0xff); - GenericTilemapSetGfx(1, RomGfx03, 6, 16, 16, 0x400000, 0x2000, 0x7f); -// GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -8); - GenericTilemapSetTransparent(0, 0); - GenericTilemapSetTransparent(1, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 shadfrceExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - BurnYM2151Exit(); - - SekExit(); - ZetExit(); - - BurnFree(Mem); - - return 0; -} - -static void drawSprites() -{ - UINT16 * finish = SprBuf; - UINT16 * source = finish + 0x2000/2 - 8; - - while (source>=finish) - { - INT32 ypos = 0x100 - (((source[0] & 0x0003) << 8) | (source[1] & 0x00ff)); - INT32 xpos = (((source[4] & 0x0001) << 8) | (source[5] & 0x00ff)) + 1; - INT32 tile = ((source[2] & 0x00ff) << 8) | (source[3] & 0x00ff); - INT32 height = ((source[0] & 0x00e0) >> 5) + 1; - INT32 enable = ((source[0] & 0x0004)); - INT32 flipx = ((source[0] & 0x0010) >> 4); - INT32 flipy = ((source[0] & 0x0008) >> 3); - INT32 color = ((source[4] & 0x003e)); - INT32 pri_mask = (source[4] & 0x0040) ? 0x02 : 0x00; - - if (color & 0x20) color ^= 0x60; // skip hole - color <<= 5; - - if (enable) - { - for (INT32 hcount = 0; hcount < height; hcount++) - { - RenderPrioSprite(pTransDraw, RomGfx02, tile+hcount, 0x1000 + color, 0, xpos, ypos-hcount*16-16, flipx, flipy, 16, 16, pri_mask); - RenderPrioSprite(pTransDraw, RomGfx02, tile+hcount, 0x1000 + color, 0, xpos-0x200, ypos-hcount*16-16, flipx, flipy, 16, 16, pri_mask); - RenderPrioSprite(pTransDraw, RomGfx02, tile+hcount, 0x1000 + color, 0, xpos, ypos-hcount*16-16+0x200, flipx, flipy, 16, 16, pri_mask); - RenderPrioSprite(pTransDraw, RomGfx02, tile+hcount, 0x1000 + color, 0, xpos-0x200, ypos-hcount*16-16+0x200, flipx, flipy, 16, 16, pri_mask); - } - } - - source-=8; - } -} - -static void draw_line(INT32 line) -{ - GenericTilesSetScanline(line); - - if (video_enable) - { - // GenericTilemapSetScrollX(1, bg0scrollx); - GenericTilemapSetScrollRow(1, line, bg0scrollx); - GenericTilemapSetScrollY(1, bg0scrolly); - - if (nBurnLayer & 2) GenericTilemapDraw(1, pTransDraw, 1); - } -} - -static void draw_bg_layer_raster() -{ - GenericTilesClearClip(); - - if (video_enable) - { - GenericTilemapSetScrollX(2, bg1scrollx); - GenericTilemapSetScrollY(2, bg1scrolly); - - if (nBurnLayer & 1) GenericTilemapDraw(2, pTransDraw, 0); - } - else - { - BurnTransferClear(); - } -} - -static INT32 shadfrceDraw() -{ - if (bRecalcPalette) { - for(INT32 i=0;i<0x4000;i++) CalcCol(i); - bRecalcPalette = 0; - } - - GenericTilesClearClip(); - - if (video_enable) - { - if (raster_irq_enable == 0) { - GenericTilemapSetScrollX(1, bg0scrollx); - GenericTilemapSetScrollY(1, bg0scrolly); - GenericTilemapSetScrollX(2, bg1scrollx); - GenericTilemapSetScrollY(2, bg1scrolly); - - if (nBurnLayer & 1) GenericTilemapDraw(2, pTransDraw, 0); - if (nBurnLayer & 2) GenericTilemapDraw(1, pTransDraw, 1); - } - - if (nBurnLayer & 4) drawSprites(); - - if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, 0); - } - else - { - if (raster_irq_enable == 0) { - BurnTransferClear(); - } - } - - BurnTransferCopy(RamCurPal); - - return 0; -} - -static INT32 shadfrceFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInput[0] = 0x00; - DrvInput[2] = 0x00; - DrvInput[4] = 0x00; - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[2] |= (DrvJoy2[i] & 1) << i; - DrvInput[4] |= (DrvButton[i] & 1) << i; - } - DrvInput[1] = (DrvInput[1] & 0xFC) | (DrvDipBtn[0] & 1) | ((DrvDipBtn[1] & 1) << 1); - } - - SekNewFrame(); - ZetNewFrame(); - - INT32 nInterleave = 272; - INT32 nCyclesTotal[2] = { 14000000 / 60, 3579545 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - SekOpen(0); - ZetOpen(0); - - bVBlank = 1; - - for (INT32 scanline = 0; scanline < nInterleave; scanline++) - { - nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave); - - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - - if (raster_irq_enable && (scanline == raster_scanline)) { - raster_scanline = (raster_scanline + 1) % 240; - if (raster_scanline > 0) { - SekSetIRQLine(1, CPU_IRQSTATUS_ACK); - } - } - - if (irqs_enable) { - if ((scanline & 0xf) == 0 && (scanline > 0)) { - SekSetIRQLine(2, CPU_IRQSTATUS_ACK); - } - - if (scanline == 248) { - SekSetIRQLine(3, CPU_IRQSTATUS_ACK); - } - } - - if (scanline == 247) { - bVBlank = 0; - } - - if (scanline == 0 && raster_irq_enable) { - draw_bg_layer_raster(); - } - - if (scanline < 256 && raster_irq_enable) { - draw_line(scanline); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = (nBurnSoundLen / nInterleave) - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos * 2); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - shadfrceDraw(); - } - - memcpy (SprBuf, RamSpr, 0x2000); // buffer one frame - - return 0; -} - -static INT32 shadfrceScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) - *pnMin = 0x029671; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - MSM6295Scan(0, nAction); - BurnYM2151Scan(nAction); - - SCAN_VAR(DrvInput); - SCAN_VAR(nBrightness); - SCAN_VAR(bg0scrollx); - SCAN_VAR(bg0scrolly); - SCAN_VAR(bg1scrollx); - SCAN_VAR(bg1scrolly); - SCAN_VAR(nSoundlatch); - SCAN_VAR(video_enable); - SCAN_VAR(okibank); - } - - if (nAction & ACB_WRITE) { - // recalc palette and brightness - for(INT32 i=0;i<0x4000;i++) CalcCol(i); - - shadfrceZWrite(0xe800, okibank); // set oki bank - } - - return 0; -} - - -// Shadow Force (World, Version 3) - -static struct BurnRomInfo shadfrceRomDesc[] = { - { "32a12-011.34", 0x040000, 0x0c041e08, BRF_ESS | BRF_PRG }, // 68000 code - { "32a13-010.26", 0x040000, 0x00985361, BRF_ESS | BRF_PRG }, - { "32a14-010.33", 0x040000, 0xea03ca25, BRF_ESS | BRF_PRG }, - { "32j15-01.14", 0x040000, 0x3dc3a84a, BRF_ESS | BRF_PRG }, - - { "32j10-0.42", 0x010000, 0x65daf475, BRF_ESS | BRF_PRG }, // Z80 code - - { "32j11-0.55", 0x020000, 0x7252d993, BRF_GRA }, // gfx 1 chars - - { "32j4-0.12", 0x200000, 0x1ebea5b6, BRF_GRA }, // gfx 2 sprite - { "32j5-0.13", 0x200000, 0x600026b5, BRF_GRA }, - { "32j6-0.24", 0x200000, 0x6cde8ebe, BRF_GRA }, - { "32j7-0.25", 0x200000, 0xbcb37922, BRF_GRA }, - { "32j8-0.32", 0x200000, 0x201bebf6, BRF_GRA }, - - { "32j1-0.4", 0x100000, 0xf1cca740, BRF_GRA }, // gfx 3 bg - { "32j2-0.5", 0x100000, 0x5fac3e01, BRF_GRA }, - { "32j3-0.6", 0x100000, 0xd297925e, BRF_GRA }, - - { "32j9-0.76", 0x080000, 0x16001e81, BRF_SND }, // PCM -}; - -STD_ROM_PICK(shadfrce) -STD_ROM_FN(shadfrce) - -struct BurnDriver BurnDrvShadfrce = { - "shadfrce", NULL, NULL, NULL, "1993", - "Shadow Force (World, Version 3)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, shadfrceRomInfo, shadfrceRomName, NULL, NULL, shadfrceInputInfo, shadfrceDIPInfo, - shadfrceInit, shadfrceExit, shadfrceFrame, shadfrceDraw, shadfrceScan, &bRecalcPalette, 0x4000, - 320, 256, 4, 3 -}; - - -// Shadow Force (US, Version 2) - -static struct BurnRomInfo shadfrceuRomDesc[] = { - { "32a12-01.34", 0x040000, 0x04501198, BRF_ESS | BRF_PRG }, // 68000 code - { "32a13-01.26", 0x040000, 0xb8f8a05c, BRF_ESS | BRF_PRG }, - { "32a14-0.33", 0x040000, 0x08279be9, BRF_ESS | BRF_PRG }, - { "32a15-0.14", 0x040000, 0xbfcadfea, BRF_ESS | BRF_PRG }, - - { "32j10-0.42", 0x010000, 0x65daf475, BRF_ESS | BRF_PRG }, // Z80 code - - { "32a11-0.55", 0x020000, 0xcfaf5e77, BRF_GRA }, // gfx 1 chars - - { "32j4-0.12", 0x200000, 0x1ebea5b6, BRF_GRA }, // gfx 2 sprite - { "32j5-0.13", 0x200000, 0x600026b5, BRF_GRA }, - { "32j6-0.24", 0x200000, 0x6cde8ebe, BRF_GRA }, - { "32j7-0.25", 0x200000, 0xbcb37922, BRF_GRA }, - { "32j8-0.32", 0x200000, 0x201bebf6, BRF_GRA }, - - { "32j1-0.4", 0x100000, 0xf1cca740, BRF_GRA }, // gfx 3 bg - { "32j2-0.5", 0x100000, 0x5fac3e01, BRF_GRA }, - { "32j3-0.6", 0x100000, 0xd297925e, BRF_GRA }, - - { "32j9-0.76", 0x080000, 0x16001e81, BRF_SND }, // PCM -}; - -STD_ROM_PICK(shadfrceu) -STD_ROM_FN(shadfrceu) - -struct BurnDriver BurnDrvShadfrceu = { - "shadfrceu", "shadfrce", NULL, NULL, "1993", - "Shadow Force (US, Version 2)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, shadfrceuRomInfo, shadfrceuRomName, NULL, NULL, shadfrceInputInfo, shadfrceDIPInfo, - shadfrceInit, shadfrceExit, shadfrceFrame, shadfrceDraw, shadfrceScan, &bRecalcPalette, 0x4000, - 320, 256, 4, 3 -}; - - -// Shadow Force (Japan, Version 2) - -static struct BurnRomInfo shadfrcejRomDesc[] = { - { "32j12-01.34", 0x040000, 0x38fdbe1d, BRF_ESS | BRF_PRG }, // 68000 code - { "32j13-01.26", 0x040000, 0x6e1df6f1, BRF_ESS | BRF_PRG }, - { "32j14-01.33", 0x040000, 0x89e3fb60, BRF_ESS | BRF_PRG }, - { "32j15-01.14", 0x040000, 0x3dc3a84a, BRF_ESS | BRF_PRG }, - - { "32j10-0.42", 0x010000, 0x65daf475, BRF_ESS | BRF_PRG }, // Z80 code - - { "32j11-0.55", 0x020000, 0x7252d993, BRF_GRA }, // gfx 1 chars - - { "32j4-0.12", 0x200000, 0x1ebea5b6, BRF_GRA }, // gfx 2 sprite - { "32j5-0.13", 0x200000, 0x600026b5, BRF_GRA }, - { "32j6-0.24", 0x200000, 0x6cde8ebe, BRF_GRA }, - { "32j7-0.25", 0x200000, 0xbcb37922, BRF_GRA }, - { "32j8-0.32", 0x200000, 0x201bebf6, BRF_GRA }, - - { "32j1-0.4", 0x100000, 0xf1cca740, BRF_GRA }, // gfx 3 bg - { "32j2-0.5", 0x100000, 0x5fac3e01, BRF_GRA }, - { "32j3-0.6", 0x100000, 0xd297925e, BRF_GRA }, - - { "32j9-0.76", 0x080000, 0x16001e81, BRF_SND }, // PCM -}; - -STD_ROM_PICK(shadfrcej) -STD_ROM_FN(shadfrcej) - -struct BurnDriver BurnDrvShadfrcej = { - "shadfrcej", "shadfrce", NULL, NULL, "1993", - "Shadow Force (Japan, Version 2)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TECHNOS, GBF_SCRFIGHT, 0, - NULL, shadfrcejRomInfo, shadfrcejRomName, NULL, NULL, shadfrceInputInfo, shadfrceDIPInfo, - shadfrceInit, shadfrceExit, shadfrceFrame, shadfrceDraw, shadfrceScan, &bRecalcPalette, 0x4000, - 320, 256, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_silkroad.cpp b/jan/src/burn/drv/pst90s/d_silkroad.cpp deleted file mode 100644 index bebc2d5b3..000000000 --- a/jan/src/burn/drv/pst90s/d_silkroad.cpp +++ /dev/null @@ -1,734 +0,0 @@ -// FB Alpha Legend of Silkroad driver -// Based on MAME driver by David Haywood, R.Belmont, and Stephh - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvTransTab; -static UINT16 *DrvSysRegs; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc = 0; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static UINT8 DrvLargerRoms = 0; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"Coin 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 15, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 14, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 12, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 13, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 11, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 10, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 9, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p2 fire 3" }, - - {"Test", BIT_DIGITAL, DrvJoy2 + 5, "diag" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x15, 0xff, 0xff, 0x1c, NULL}, - {0x16, 0xff, 0xff, 0xf7, NULL}, - - {0, 0xfe, 0, 2, "Lives" }, - {0x15, 0x01, 0x01, 0x01, "1" }, - {0x15, 0x01, 0x01, 0x00, "2" }, - - {0, 0xfe, 0, 2, "Blood Effect" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0, 0xfe, 0, 8, "Difficulty" }, - {0x15, 0x01, 0xe0, 0x60, "Easiest" }, - {0x15, 0x01, 0xe0, 0x40, "Easier" }, - {0x15, 0x01, 0xe0, 0x20, "Easy" }, - {0x15, 0x01, 0xe0, 0x00, "Normal" }, - {0x15, 0x01, 0xe0, 0xe0, "Medium" }, - {0x15, 0x01, 0xe0, 0xc0, "Hard" }, - {0x15, 0x01, 0xe0, 0xa0, "Harder" }, - {0x15, 0x01, 0xe0, 0x80, "Hardest" }, - - {0, 0xfe, 0, 2, "Free Play" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0, 0xfe, 0, 2, "Demo Sounds" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0, 0xfe, 0, 2, "Chute Type" }, - {0x16, 0x01, 0x10, 0x10, "Single" }, - {0x16, 0x01, 0x10, 0x00, "Multi" }, - - {0, 0xfe, 0, 8, "Coinage" }, - {0x16, 0x01, 0xe0, 0x00, "5 Coins 1 Credit" }, - {0x16, 0x01, 0xe0, 0x20, "4 Coins 1 Credit" }, - {0x16, 0x01, 0xe0, 0x40, "3 Coins 1 Credit" }, - {0x16, 0x01, 0xe0, 0x60, "2 Coins 1 Credit" }, - {0x16, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x16, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Drv) - -static void palette_write(INT32 offset, UINT16 pal) -{ - UINT8 r = (pal >> 10) & 0x1f; - UINT8 g = (pal >> 5) & 0x1f; - UINT8 b = (pal >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset] = BurnHighCol(r, g, b, 0); -} - -UINT8 __fastcall silkroad_read_byte(UINT32 address) -{ - switch (address) - { - case 0xc00000: - return DrvInputs[0] >> 8; - - case 0xc00001: - return DrvInputs[0] & 0xff; - - case 0xc00002: - return 0xff; - - case 0xc00003: - return DrvInputs[1] & 0xff; - - case 0xc00004: - return DrvDips[1]; - - case 0xc00005: - return DrvDips[0]; - - case 0xc00025: - return MSM6295ReadStatus(0); - - case 0xc0002d: - return BurnYM2151ReadStatus(); - - case 0xc00031: - return MSM6295ReadStatus(1); - } - - return 0; -} - -void __fastcall silkroad_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0xc00025: - MSM6295Command(0, data); - return; - - case 0xc00029: - BurnYM2151SelectRegister(data); - return; - - case 0xc0002d: - BurnYM2151WriteRegister(data); - return; - - case 0xc00031: - MSM6295Command(1, data); - return; - - case 0xc00034: - case 0xc00035: - case 0xc00036: - case 0xc00037: - if ((data & 0x03) < 2) - MSM6295SetBank(0, DrvSndROM0 + ((data & 0x01) * 0x40000), 0, 0x3ffff); - return; - } -} - -void __fastcall silkroad_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffffc000) == 0x600000) { - *((UINT16 *)(DrvPalRAM + (address & 0x3ffe))) = BURN_ENDIAN_SWAP_INT16(data); - - palette_write((address >> 2) & 0x0fff, data); - - return; - } - - if (address >= 0xc0010c && address <= 0xc00123) { - DrvSysRegs[(address - 0xc0010c) >> 1] = data; - - return; - } -} - -void __fastcall silkroad_write_long(UINT32 address, UINT32 data) -{ - if ((address & 0xffffc000) == 0x600000) { - *((UINT32 *)(DrvPalRAM + (address & 0x3ffc))) = BURN_ENDIAN_SWAP_INT32(data); - - palette_write((address >> 2) & 0x0fff, data >> 16); - - return; - } -} - -static INT32 DrvGfxROMDecode() -{ - static INT32 Planes[6] = { 0x0000008, 0x0000000, 0x1000008, 0x1000000, 0x2000008, 0x2000000 }; - static INT32 XOffs[16] = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, - 0x010, 0x011, 0x012, 0x013, 0x014, 0x015, 0x016, 0x017 }; - static INT32 YOffs[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, - 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 }; - - INT32 TempRomSize = 0x600000; - if (DrvLargerRoms) TempRomSize = 0xa00000; - - UINT8 *tmp = (UINT8*)BurnMalloc(TempRomSize); - if (tmp == NULL) { - return 1; - } - - if (DrvLargerRoms) { - // first half of sprite roms - if (BurnLoadRom(tmp + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(tmp + 0x200000, 3, 1)) return 1; - if (BurnLoadRom(tmp + 0x400000, 4, 1)) return 1; - - for (INT32 j = 0; j < 0x600000; j++) { - tmp[j] ^= 0xff; - } - - GfxDecode(0x08000, 6, 16, 16, Planes, XOffs, YOffs, 0x200, tmp + 0x000000, DrvGfxROM + 0x0800000 * 0); - - // second half of sprite roms - if (BurnLoadRom(tmp + 0x600000, 2, 1)) return 1; - memcpy(tmp + 0x000000, tmp + 0x800000, 0x200000); - if (BurnLoadRom(tmp + 0x600000, 3, 1)) return 1; - memcpy(tmp + 0x200000, tmp + 0x800000, 0x200000); - if (BurnLoadRom(tmp + 0x600000, 4, 1)) return 1; - memcpy(tmp + 0x400000, tmp + 0x800000, 0x200000); - - for (INT32 j = 0; j < 0x600000; j++) { - tmp[j] ^= 0xff; - } - - GfxDecode(0x08000, 6, 16, 16, Planes, XOffs, YOffs, 0x200, tmp + 0x000000, DrvGfxROM + 0x0800000 * 1); - - // background - for (INT32 i = 1; i < 3; i++ ){ - if (BurnLoadRom(tmp + 0x000000, 2 + i * 3, 1)) return 1; - if (BurnLoadRom(tmp + 0x200000, 3 + i * 3, 1)) return 1; - if (BurnLoadRom(tmp + 0x400000, 4 + i * 3, 1)) return 1; - - for (INT32 j = 0; j < 0x600000; j++) { - tmp[j] ^= 0xff; - } - - GfxDecode(0x08000, 6, 16, 16, Planes, XOffs, YOffs, 0x200, tmp, DrvGfxROM + 0x0800000 * (i + 1)); - } - } else { - for (INT32 i = 0; i < 4; i++ ){ - if (BurnLoadRom(tmp + 0x000000, 2 + i * 3, 1)) return 1; - if (BurnLoadRom(tmp + 0x200000, 3 + i * 3, 1)) return 1; - if (BurnLoadRom(tmp + 0x400000, 4 + i * 3, 1)) return 1; - - for (INT32 j = 0; j < 0x600000; j++) { - tmp[j] ^= 0xff; - } - - GfxDecode(0x08000, 6, 16, 16, Planes, XOffs, YOffs, 0x200, tmp, DrvGfxROM + 0x0800000 * i); - } - } - - BurnFree (tmp); - - DrvTransTab = (UINT8*)BurnMalloc(0x20000); - if (DrvTransTab == NULL) { - return 1; - } - - { - memset (DrvTransTab, 0, 0x20000); - for (INT32 i = 0, c = 0; i < 0x2000000; i++) { - if (DrvGfxROM[i]) { - DrvTransTab[i>>8] |= 1; - c++; - } - - if ((i & 0xff) == 0xff) { - if (c == 0x100) DrvTransTab[i>>8] |= 2; - c = 0; - } - } - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - BurnYM2151Reset(); - - MSM6295Reset(0); - MSM6295Reset(1); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x0200000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x0080000; - DrvSndROM1 = Next; Next += 0x0040000; - - DrvPalette = (UINT32 *)Next; Next += 0x0001001 * sizeof (UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x0001000; - DrvPalRAM = Next; Next += 0x0004000; - DrvVidRAM = Next; Next += 0x000c000; - Drv68KRAM = Next; Next += 0x0020000; - - DrvSysRegs = (UINT16*)Next; Next += 0x0000020 * sizeof (UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - DrvGfxROM = (UINT8*)BurnMalloc(0x2000000); - if (DrvGfxROM == NULL) { - return 1; - } - - if (DrvGfxROMDecode()) return 1; - - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 1, 1, 2)) return 1; - - for (INT32 i = 0; i < 0x200000; i+= 4) { - INT32 t = Drv68KROM[i + 1]; - Drv68KROM[i + 1] = Drv68KROM[i + 2]; - Drv68KROM[i + 2] = t; - } - - if (BurnLoadRom(DrvSndROM0, 14, 1)) return 1; - if (BurnLoadRom(DrvSndROM1, 15, 1)) return 1; - } - - SekInit(0, 0x68EC020); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x40c000, 0x40cfff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x600000, 0x603fff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0x800000, 0x80bfff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xfe0000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, silkroad_write_byte); - SekSetWriteWordHandler(0, silkroad_write_word); - SekSetWriteLongHandler(0, silkroad_write_long); - SekSetReadByteHandler(0, silkroad_read_byte); - SekClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - MSM6295Init(0, 1056000 / 132, 1); - MSM6295Init(1, 2112000 / 132, 1); - MSM6295SetBank(0, DrvSndROM0, 0, 0x3ffff); - MSM6295SetBank(1, DrvSndROM1, 0, 0x3ffff); - MSM6295SetRoute(0, 0.45, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.45, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvaInit() -{ - DrvLargerRoms = 1; - - return DrvInit(); -} - -static INT32 DrvExit() -{ - SekExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - MSM6295Exit(1); - - GenericTilesExit(); - - BurnFree (AllMem); - BurnFree (DrvGfxROM); - BurnFree (DrvTransTab); - - DrvRecalc = 0; - - DrvLargerRoms = 0; - - return 0; -} - -static void silkroad_draw_tile(INT32 code, INT32 sx, INT32 sy, INT32 color, INT32 flipx) -{ - if (!DrvTransTab[code]) return; - - if (flipx) { - if (sx >= 0 && sx <= 352 && sy >= 0 && sy <= 208) { - if (DrvTransTab[code] & 2) { - Render16x16Tile_FlipX(pTransDraw, code, sx, sy, color, 6, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 6, 0, 0, DrvGfxROM); - } - } else { - if (DrvTransTab[code] & 2) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 6, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 6, 0, 0, DrvGfxROM); - } - } - } else { - if (sx >= 0 && sx <= 352 && sy >= 0 && sy <= 208) { - if (DrvTransTab[code] & 2) { - Render16x16Tile(pTransDraw, code, sx, sy, color, 6, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 6, 0, 0, DrvGfxROM); - } - } else { - if (DrvTransTab[code] & 2) { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 6, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 6, 0, 0, DrvGfxROM); - } - } - } -} - -static void draw_sprites(INT32 pri) -{ - UINT32 *source = (UINT32*)DrvSprRAM; - UINT32 *finish = source + 0x1000/4; - UINT32 *maxspr = source; - - while (maxspr < finish) - { - if ((BURN_ENDIAN_SWAP_INT32(maxspr[1]) & 0xff000000) == 0xff000000) break; - maxspr += 2; - } - - finish = maxspr - 2; - - while (finish >= source) - { - INT32 xpos = (BURN_ENDIAN_SWAP_INT32(finish[0]) & 0x01ff) - 50; - INT32 ypos = (BURN_ENDIAN_SWAP_INT32(finish[0]) >> 16) - 16; - INT32 attr = BURN_ENDIAN_SWAP_INT32(finish[1]) >> 16; - INT32 tileno = (BURN_ENDIAN_SWAP_INT32(finish[1]) & 0xffff) | ((attr & 0x8000) << 1); - finish -= 2; - - INT32 priority = attr & 0x1000; - if (pri != priority || ypos == -16 || ypos > 223) continue; - - INT32 color = attr & 0x003f; - INT32 flipx = attr & 0x0080; - INT32 width = ((attr >> 8) & 0x0f) + 1; - - if (flipx) { - for (INT32 wcount = width; wcount > 0; wcount--) { - INT32 sx = xpos + (((wcount << 4) - 0x10) | 8); - - if (sx < -15 || sx > 379) continue; - - silkroad_draw_tile(tileno+(width-wcount), sx, ypos, color, 1); - } - } else { - for (INT32 wcount = 0; wcount < width; wcount++) { - INT32 sx = xpos + ((wcount << 4) | 8); - - if (sx < -15 || sx > 379) continue; - - silkroad_draw_tile(tileno + wcount, sx, ypos, color, 0); - } - } - } -} - -static void draw_layer(INT32 offset, INT32 scrollx, INT32 scrolly) -{ - UINT32 *vidram = (UINT32*)(DrvVidRAM + offset); - - for (INT32 offs = 0; offs < 0x4000 / 4; offs++) - { - INT32 sx = (offs << 4) & 0x3f0; - INT32 sy = (offs >> 2) & 0x3f0; - sx -= scrollx + 50; - sy -= scrolly + 16; - if (sy < -15) sy += 0x400; - if (sx < -15) sx += 0x400; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT32(vidram[offs]) & 0xffff; - INT32 color = (BURN_ENDIAN_SWAP_INT32(vidram[offs]) >> 16) & 0x1f; - INT32 flipx = (BURN_ENDIAN_SWAP_INT32(vidram[offs]) >> 16) & 0x80; - - silkroad_draw_tile(code + 0x18000, sx, sy, color, flipx); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc != nBurnBpp) { - UINT16 *pal = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x2000; i+=2) { - palette_write(i/2, pal[i]); - } - - DrvPalette[0x1000] = BurnHighCol(0xff, 0x00, 0xff, 0); - DrvRecalc = nBurnBpp; - } - - if (nBurnLayer & 1) { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x7c0; - } - } else { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x1000; - } - } - - if (nBurnLayer & 2) draw_layer(0x0000, DrvSysRegs[ 0] & 0x3ff, DrvSysRegs[ 1] & 0x3ff); - if (nSpriteEnable & 1) draw_sprites(0x0000); - if (nBurnLayer & 4) draw_layer(0x4000, DrvSysRegs[ 5] & 0x3ff, DrvSysRegs[10] & 0x3ff); - if (nSpriteEnable & 2) draw_sprites(0x1000); - if (nBurnLayer & 8) draw_layer(0x8000, DrvSysRegs[ 4] & 0x3ff, DrvSysRegs[ 2] & 0x3ff); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = DrvInputs[1] = 0xffff; - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - } - - DrvInputs[1] ^= DrvJoy2[4] << 6; - - if (!(DrvInputs[0] & 0x00c0)) DrvInputs[0] |= 0x00c0; - if (!(DrvInputs[0] & 0x0030)) DrvInputs[0] |= 0x0030; - if (!(DrvInputs[0] & 0xc000)) DrvInputs[0] |= 0xc000; - if (!(DrvInputs[0] & 0x3000)) DrvInputs[0] |= 0x3000; - } - - INT32 nTotalCycles = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - - SekOpen(0); - SekRun(nTotalCycles); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - BurnYM2151Render(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029682; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - SCAN_VAR(DrvInputs[0]); - SCAN_VAR(DrvInputs[1]); - } - - return 0; -} - - -// The Legend of Silkroad - -static struct BurnRomInfo silkroadRomDesc[] = { - { "rom02.bin", 0x100000, 0x4e5200fc, 1 | BRF_PRG }, // 0 Motorola '020 Code - { "rom03.bin", 0x100000, 0x73ccc78c, 1 | BRF_PRG }, // 1 - - { "rom12.rom12", 0x200000, 0x96393d04, 2 | BRF_GRA }, // 2 Tiles - { "rom08.rom08", 0x200000, 0x23f1d462, 2 | BRF_GRA }, // 3 - { "rom04.rom04", 0x200000, 0xd9f0bbd7, 2 | BRF_GRA }, // 4 - - { "rom13.rom13", 0x200000, 0x4ca1698e, 2 | BRF_GRA }, // 5 - { "rom09.rom09", 0x200000, 0xef0b5bf4, 2 | BRF_GRA }, // 6 - { "rom05.rom05", 0x200000, 0x512d6e25, 2 | BRF_GRA }, // 7 - - { "rom14.rom14", 0x200000, 0xd00b19c4, 2 | BRF_GRA }, // 8 - { "rom10.rom10", 0x200000, 0x7d324280, 2 | BRF_GRA }, // 9 - { "rom06.rom06", 0x200000, 0x3ac26060, 2 | BRF_GRA }, // 10 - - { "rom07.rom07", 0x200000, 0x9fc6ff9d, 2 | BRF_GRA }, // 11 - { "rom11.rom11", 0x200000, 0x11abaf1c, 2 | BRF_GRA }, // 12 - { "rom15.rom15", 0x200000, 0x26a3b168, 2 | BRF_GRA }, // 13 - - { "rom00.bin", 0x080000, 0xb10ba7ab, 3 | BRF_SND }, // 14 OKI Samples - { "rom01.bin", 0x040000, 0xdb8cb455, 4 | BRF_SND }, // 15 -}; - -STD_ROM_PICK(silkroad) -STD_ROM_FN(silkroad) - -struct BurnDriver BurnDrvSilkroad = { - "silkroad", NULL, NULL, NULL, "1999", - "The Legend of Silkroad\0", NULL, "Unico", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, silkroadRomInfo, silkroadRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1001, - 380, 224, 4, 3 -}; - - -// The Legend of Silkroad (larger roms) - -static struct BurnRomInfo silkroadaRomDesc[] = { - { "rom02.bin", 0x100000, 0x4e5200fc, 1 | BRF_PRG }, // 0 Motorola '020 Code - { "rom03.bin", 0x100000, 0x73ccc78c, 1 | BRF_PRG }, // 1 - - { "unico_sr13.rom13", 0x400000, 0xd001c3df, 2 | BRF_GRA }, // 2 Tiles - { "unico_sr09.rom09", 0x400000, 0x696d908d, 2 | BRF_GRA }, // 3 - { "unico_sr05.rom05", 0x400000, 0x00f638c1, 2 | BRF_GRA }, // 4 - - { "rom14.rom14", 0x200000, 0xd00b19c4, 2 | BRF_GRA }, // 5 - { "rom10.rom10", 0x200000, 0x7d324280, 2 | BRF_GRA }, // 6 - { "rom06.rom06", 0x200000, 0x3ac26060, 2 | BRF_GRA }, // 7 - - { "rom07.rom07", 0x200000, 0x9fc6ff9d, 2 | BRF_GRA }, // 8 - { "rom11.rom11", 0x200000, 0x11abaf1c, 2 | BRF_GRA }, // 9 - { "rom15.rom15", 0x200000, 0x26a3b168, 2 | BRF_GRA }, // 10 - - { "rom00.bin", 0x080000, 0xb10ba7ab, 3 | BRF_SND }, // 11 OKI Samples - { "rom01.bin", 0x040000, 0xdb8cb455, 4 | BRF_SND }, // 12 -}; - -STD_ROM_PICK(silkroada) -STD_ROM_FN(silkroada) - -struct BurnDriver BurnDrvSilkroada = { - "silkroada", "silkroad", NULL, NULL, "1999", - "The Legend of Silkroad (larger roms)\0", NULL, "Unico", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0, - NULL, silkroadaRomInfo, silkroadaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1001, - 380, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_silvmil.cpp b/jan/src/burn/drv/pst90s/d_silvmil.cpp deleted file mode 100644 index b01a47454..000000000 --- a/jan/src/burn/drv/pst90s/d_silvmil.cpp +++ /dev/null @@ -1,870 +0,0 @@ -// FB Alpha Silver Millennium driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" -#include "burn_ym2151.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *tilebanks; -static UINT8 *soundlatch; -static UINT8 *tile_bank; -static UINT16 *fg_scroll_x; -static UINT16 *fg_scroll_y; -static UINT16 *bg_scroll_x; -static UINT16 *bg_scroll_y; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static INT32 puzzlove = 0; - -static struct BurnInputInfo SilvmilInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 9, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Silvmil) - -static struct BurnDIPInfo SilvmilDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x03, "Easy" }, - {0x13, 0x01, 0x03, 0x02, "Normal" }, - {0x13, 0x01, 0x03, 0x01, "Hard" }, - {0x13, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x14, 0x01, 0x04, 0x04, "Korean" }, - {0x14, 0x01, 0x04, 0x00, "English" }, - - {0 , 0xfe, 0 , 7, "Coinage" }, - {0x14, 0x01, 0x38, 0x08, "4 Coins 4 Credits" }, - {0x14, 0x01, 0x38, 0x18, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x38, 0x00, "4 Coins 2 Credits" }, - {0x14, 0x01, 0x38, 0x28, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x38, 0x10, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x38, 0x20, "2 Coins 2 Credits" }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2, "Coin Box" }, - {0x14, 0x01, 0x40, 0x40, "1" }, - {0x14, 0x01, 0x40, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Silvmil) - - -static struct BurnDIPInfo PuzzloveDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Very_Easy" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Very_Hard" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x14, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x00, "4 Coins 2 Credits" }, - {0x14, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x1c, 0x08, "2 Coins 2 Credits" }, - {0x14, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Coin Box" }, - {0x14, 0x01, 0x20, 0x20, "1" }, - {0x14, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x40, 0x00, "2" }, - {0x14, 0x01, 0x40, 0x40, "3" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Puzzlove) - -static struct BurnDIPInfo PuzzlovekDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Demo_Sounds" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Easy" }, - {0x14, 0x01, 0x03, 0x02, "Very_Easy" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Very_Hard" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x14, 0x01, 0x1c, 0x10, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x14, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x00, "4 Coins 2 Credits" }, - {0x14, 0x01, 0x1c, 0x18, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x1c, 0x04, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x1c, 0x08, "2 Coins 2 Credits" }, - {0x14, 0x01, 0x1c, 0x1c, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Coin Box" }, - {0x14, 0x01, 0x20, 0x20, "1" }, - {0x14, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x14, 0x01, 0x40, 0x00, "2" }, - {0x14, 0x01, 0x40, 0x40, "3" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Puzzlovek) - -static inline void DrvPaletteUpdate(INT32 offset) -{ - UINT8 r,g,b; - UINT16 pal = *((UINT16*)(DrvPalRAM + offset)); - - r = (BURN_ENDIAN_SWAP_INT16(pal) >> 10) & 0x1f; - g = (BURN_ENDIAN_SWAP_INT16(pal) >> 5) & 0x1f; - b = (BURN_ENDIAN_SWAP_INT16(pal) >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -void __fastcall silvmil_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x100000: - *tile_bank = data & 0x03; - return; - - case 0x10000e: - tilebanks[*tile_bank] = data & 0x1f; - return; - } -} - -void __fastcall silvmil_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x100002: - *fg_scroll_x = data & 0x3ff; - return; - - case 0x100004: - *fg_scroll_y = (data + 8) & 0x1ff; - return; - - case 0x100006: - *bg_scroll_x = (data + 4) & 0x3ff; - return; - - case 0x100008: - *bg_scroll_y = (data + 8) & 0x1ff; - return; - - case 0x270000: - *soundlatch = data; - return; - } -} - -UINT8 __fastcall silvmil_read_byte(UINT32 address) -{ - switch (address) - { - case 0x280002: - return DrvInputs[1] >> 8; - } - - return 0; -} - -UINT16 __fastcall silvmil_read_word(UINT32 address) -{ - switch (address) - { - case 0x280000: - case 0x280002: - case 0x280004: - return DrvInputs[(address >> 1) & 3]; - } - - return 0; -} - -void __fastcall silvmil_palette_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffff800) == 0x200000) { - DrvPalRAM[(address & 0x7ff) ^ 1] = data; - DrvPaletteUpdate(address & 0x7fe); - return; - } -} - -void __fastcall silvmil_palette_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffff800) == 0x200000) { - *((UINT16*)(DrvPalRAM + (address & 0x7fe))) = BURN_ENDIAN_SWAP_INT16(data); - DrvPaletteUpdate(address & 0x7fe); - return; - } -} - -void __fastcall silvmil_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - BurnYM2151SelectRegister(data); - return; - - case 0xc001: - BurnYM2151WriteRegister(data); - return; - - case 0xc002: - case 0xc003: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall silvmil_sound_read(UINT16 address) -{ - switch (address) - { - case 0xc001: - return BurnYM2151ReadStatus(); - - case 0xc002: - case 0xc003: - return MSM6295ReadStatus(0); - - case 0xc006: - return *soundlatch; - } - - return 0; -} - -void silvmilYM2151IrqHandler(INT32 nStatus) -{ - if (ZetGetActive() != -1) - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x800000; - DrvGfxROM1 = Next; Next += 0x400000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x000800; - DrvFgRAM = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000800; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - - tile_bank = Next; Next += 0x000001; - tilebanks = Next; Next += 0x000004; - - fg_scroll_x = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - bg_scroll_x = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - fg_scroll_y = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - bg_scroll_y = (UINT16*)Next; Next += 0x0001 * sizeof (UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(UINT8 *gfx, INT32 gfxlen) -{ - INT32 Planes[4] = { ((gfxlen / 2) * 8) + 8, ((gfxlen / 2) * 8) + 0, 8, 0 }; - INT32 XOffs[16] = { STEP8(256, 1), STEP8(0, 1) }; - INT32 YOffs[16] = { STEP16(0, 16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(gfxlen); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, gfx, gfxlen); - - GfxDecode((gfxlen * 2) / (16 * 16), 4, 16, 16, Planes, XOffs, YOffs, 0x200, tmp, gfx); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(INT32 game_select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - puzzlove = game_select; // 1 puzzlove, 0 silmil - - if (puzzlove) - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 5, 2)) return 1; - - for (INT32 i = 0; i < 0x400000; i++) { - DrvGfxROM0[((i & 0x03ffff) ^ 0x20) | ((~i & 0x040000) << 3) | ((i & 0x380000) >> 1)] = DrvGfxROM1[i&0xfffff]; - } - - memset (DrvGfxROM1, 0, 0x200000); - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 9, 2)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x400000); - DrvGfxDecode(DrvGfxROM1, 0x200000); - } - else - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300000, 10, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x300001, 11, 2)) return 1; - - for (INT32 i = 0; i < 0x400000; i++) { - DrvGfxROM0[((i & 0x03ffff) ^ 0x20) | ((~i & 0x040000) << 3) | ((i & 0x380000) >> 1)] = DrvGfxROM1[i]; - } - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 12, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 13, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100000, 14, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x100001, 15, 2)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x400000); - DrvGfxDecode(DrvGfxROM1, 0x200000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvFgRAM, 0x120000, 0x120fff, MAP_RAM); - SekMapMemory(DrvBgRAM, 0x122000, 0x122fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x200000, 0x2007ff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x210000, 0x2107ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x300000, 0x30ffff, MAP_RAM); - SekSetWriteByteHandler(0, silvmil_write_byte); - SekSetWriteWordHandler(0, silvmil_write_word); - SekSetReadByteHandler(0, silvmil_read_byte); - SekSetReadWordHandler(0, silvmil_read_word); - - SekMapHandler(1, 0x200000, 0x2007ff, MAP_WRITE); - SekSetWriteByteHandler(1, silvmil_palette_write_byte); - SekSetWriteWordHandler(1, silvmil_palette_write_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xd000, 0xd7ff, 0, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvZ80RAM); - ZetSetWriteHandler(silvmil_sound_write); - ZetSetReadHandler(silvmil_sound_read); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&silvmilYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1024000 / 132, 1); - MSM6295SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - - MSM6295ROM = NULL; - - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(UINT8 *src, INT32 colbank, INT32 scrollx, INT32 scrolly, INT32 transp) -{ - UINT16 *vram = (UINT16*)src; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 4; - INT32 sy = (offs >> 6) << 4; - - sx -= scrollx; - if (sx < -15) sx += 0x400; - sy -= scrolly; - if (sy < -15) sy += 0x200; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 data = BURN_ENDIAN_SWAP_INT16(vram[(offs & 0x1f) + ((offs >> 6) << 5) + ((offs & 0x20) << 5)]); - INT32 code = (data & 0x3ff) + (tilebanks[(data & 0x0c00) >> 10] << 10); - INT32 color = (data >> 12) + colbank; - - if (transp) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0;offs < 0x400;offs += 4) - { - INT32 sprite = BURN_ENDIAN_SWAP_INT16(ram[offs + 1]) & 0x3fff; - if (!sprite) continue; - - INT32 y = BURN_ENDIAN_SWAP_INT16(ram[offs]); - INT32 flash = (y & ((puzzlove) ? 0x0400 : 0x1000)); - if (flash && (GetCurrentFrame() & 1)) continue; - - INT32 x = BURN_ENDIAN_SWAP_INT16(ram[offs + 2]); - INT32 color = ((x >> 9) & 0x7f) | ((y & 0x8000) >> 8); - - INT32 fx = y & 0x2000; - INT32 fy = y & 0x4000; - INT32 multi; - - if (puzzlove) { - multi = ((y & 0x1000) >> 12) | ((y & 0x0200) >> 8); - } else { - multi = ((y & 0x0600) >> 9); - } - - multi = (1 << multi) - 1; - - x &= 0x01ff; - y &= 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - y = (240 - y) - 7; - x = (304 - x) - 5; - - INT32 inc = -1; - - if (!fy) - { - sprite += multi; - inc = 1; - } - - while (multi >= 0) - { - if (fy) { - if (fx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sprite - multi * inc, x, y - 16 * multi, color & 0x3f, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sprite - multi * inc, x, y - 16 * multi, color & 0x3f, 4, 0, 0, DrvGfxROM1); - } - } else { - if (fx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sprite - multi * inc, x, y - 16 * multi, color & 0x3f, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sprite - multi * inc, x, y - 16 * multi, color & 0x3f, 4, 0, 0, DrvGfxROM1); - } - } - - multi--; - } - } -} - -static void DrvPaletteRecalc() -{ - UINT8 r,g,b; - UINT16 *pal = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x300; i++) { - r = (BURN_ENDIAN_SWAP_INT16(pal[i]) >> 10) & 0x1f; - g = (BURN_ENDIAN_SWAP_INT16(pal[i]) >> 5) & 0x1f; - b = (BURN_ENDIAN_SWAP_INT16(pal[i]) >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteRecalc(); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - if ( nBurnLayer & 1) draw_layer(DrvBgRAM, 0x20, *bg_scroll_x, *bg_scroll_y, 0); - if ( nBurnLayer & 2) draw_layer(DrvFgRAM, 0x10, *fg_scroll_x, *fg_scroll_y, 1); - if ( nBurnLayer & 4) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - DrvInputs[0] = DrvInputs[1] = 0xffff; - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - DrvInputs[2] = (DrvDips[1] << 8) | DrvDips[0]; - } - - INT32 nSegment; - INT32 nSoundBufferPos = 0; - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 12000000 / 60, 4096000 /*3579545?*/ / 60 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nCyclesTotal[0] / nInterleave; - - SekRun(nSegment); - - nSegment = nCyclesTotal[1] / nInterleave; - - ZetRun(nSegment); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - } - - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - MSM6295Render(0, pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - } - - return 0; -} - - -// PuzzLove - -static struct BurnRomInfo puzzloveRomDesc[] = { - { "3.u3", 0x40000, 0x826c8472, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "4.u2", 0x40000, 0x64ddc708, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.uz02", 0x20000, 0x3077e7f3, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "2.uz11", 0x40000, 0x4c06ec68, 3 | BRF_SND }, // 3 MSM6295 Samples - - { "10.u41", 0x80000, 0x7200f878, 4 | BRF_GRA }, // 4 Background Tiles - { "9.u42", 0x80000, 0x21b1b297, 4 | BRF_GRA }, // 5 - - { "5.u53", 0x80000, 0x8707d5a0, 5 | BRF_GRA }, // 6 Sprites - { "6.u54", 0x80000, 0x60a6d614, 5 | BRF_GRA }, // 7 - { "7.u55", 0x80000, 0x0f2ea5c4, 5 | BRF_GRA }, // 8 - { "8.u56", 0x80000, 0x037dcd3d, 5 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(puzzlove) -STD_ROM_FN(puzzlove) - -static INT32 puzzloveInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvPuzzlove = { - "puzzlove", NULL, NULL, NULL, "1994", - "PuzzLove\0", NULL, "Para", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, puzzloveRomInfo, puzzloveRomName, NULL, NULL, SilvmilInputInfo, PuzzloveDIPInfo, - puzzloveInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; - - -// PuzzLove (Korea) - -static struct BurnRomInfo puzzlovekRomDesc[] = { - { "3.u3", 0x40000, 0x28f403f0, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "4.u2", 0x40000, 0x809371b9, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.uz02", 0x20000, 0x3077e7f3, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "2.uz11", 0x40000, 0x4c06ec68, 3 | BRF_SND }, // 3 MSM6295 Samples - - { "10.u41", 0x80000, 0x3f952c54, 4 | BRF_GRA }, // 4 Background Tiles - { "9.u42", 0x80000, 0x4f71ee93, 4 | BRF_GRA }, // 5 - - { "5.u53", 0x80000, 0xc5732995, 5 | BRF_GRA }, // 6 Sprites - { "6.u54", 0x80000, 0xa3b98fd1, 5 | BRF_GRA }, // 7 - { "7.u55", 0x80000, 0xa4c73b48, 5 | BRF_GRA }, // 8 - { "8.u56", 0x80000, 0x95b5f049, 5 | BRF_GRA }, // 9 -}; - -STD_ROM_PICK(puzzlovek) -STD_ROM_FN(puzzlovek) - -struct BurnDriver BurnDrvPuzzlovek = { - "puzzlovek", "puzzlove", NULL, NULL, "1994", - "PuzzLove (Korea)\0", NULL, "Para", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, puzzlovekRomInfo, puzzlovekRomName, NULL, NULL, SilvmilInputInfo, PuzzlovekDIPInfo, - puzzloveInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 320, 240, 4, 3 -}; - - -// Silver Millennium - -static struct BurnRomInfo silvmilRomDesc[] = { - { "d-13_u3.bin", 0x40000, 0x46106c59, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "d-14_u2.bin", 0x40000, 0x65421eca, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "d-11_uz02.bin", 0x10000, 0xb41289e6, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "d-12_uz1.bin", 0x40000, 0xa170d8a9, 3 | BRF_SND }, // 3 MSM6295 Samples - - { "d-16_u41.bin", 0x80000, 0xff5ea605, 4 | BRF_GRA }, // 4 Background Tiles - { "d-15_u42.bin", 0x80000, 0x5f72d6cc, 4 | BRF_GRA }, // 5 - { "d-17_pat11.bin", 0x80000, 0x2facb3f1, 4 | BRF_GRA }, // 6 - { "d-20_pat01.bin", 0x80000, 0xcc4d3b49, 4 | BRF_GRA }, // 7 - { "d-18_pat12.bin", 0x80000, 0xa429b237, 4 | BRF_GRA }, // 8 - { "d-17_pat02.bin", 0x80000, 0xaddc5261, 4 | BRF_GRA }, // 9 - { "d-19_pat13.bin", 0x80000, 0xaf2507ce, 4 | BRF_GRA }, // 10 - { "d-18_pat03.bin", 0x80000, 0x36b9c407, 4 | BRF_GRA }, // 11 - - { "d-17_u53.bin", 0x80000, 0x4d177bda, 5 | BRF_GRA }, // 12 Sprites - { "d-18_u54.bin", 0x80000, 0x218c4471, 5 | BRF_GRA }, // 13 - { "d-19_u55.bin", 0x80000, 0x59507521, 5 | BRF_GRA }, // 14 - { "d-20_u56.bin", 0x80000, 0xe67c2c7d, 5 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(silvmil) -STD_ROM_FN(silvmil) - -static INT32 silmilInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvSilvmil = { - "silvmil", NULL, NULL, NULL, "1995", - "Silver Millennium\0", NULL, "Para", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, silvmilRomInfo, silvmilRomName, NULL, NULL, SilvmilInputInfo, SilvmilDIPInfo, - silmilInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 240, 320, 3, 4 -}; - - diff --git a/jan/src/burn/drv/pst90s/d_speedspn.cpp b/jan/src/burn/drv/pst90s/d_speedspn.cpp deleted file mode 100644 index 0ef549ca8..000000000 --- a/jan/src/burn/drv/pst90s/d_speedspn.cpp +++ /dev/null @@ -1,620 +0,0 @@ -// FB Alpha Speed Spin driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvAttrRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *display_enable; -static UINT8 *banks; - -static UINT8 DrvInputs[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 black_color; - -static struct BurnInputInfo SpeedspnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Speedspn) - -static struct BurnDIPInfo SpeedspnDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0x0f, 0x01, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x04, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "5 Coins/2 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "3 Coins 2 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "4 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x02, "4 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "3 Coins/5 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "2 Coins 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x13, 0x01, 0xf0, 0x10, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "5 Coins/2 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "3 Coins 2 Credits" }, - {0x13, 0x01, 0xf0, 0x30, "4 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "4 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "3 Coins/5 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "2 Coins 5 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "World Cup" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Backhand" }, - {0x14, 0x01, 0x02, 0x02, "Automatic" }, - {0x14, 0x01, 0x02, 0x00, "Manual" }, - - {0 , 0xfe, 0 , 4, "Points to Win" }, - {0x14, 0x01, 0x0c, 0x0c, "11 Points and 1 Adv." }, - {0x14, 0x01, 0x0c, 0x08, "11 Points and 2 Adv." }, - {0x14, 0x01, 0x0c, 0x04, "21 Points and 1 Adv." }, - {0x14, 0x01, 0x0c, 0x00, "21 Points and 2 Adv." }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x30, 0x20, "Easy" }, - {0x14, 0x01, 0x30, 0x30, "Normal" }, - {0x14, 0x01, 0x30, 0x10, "Hard" }, - {0x14, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - -}; - -STDDIPINFO(Speedspn) - -static void bankswitch(INT32 data) -{ - const INT32 offsets[10] = { - 0x30000, 0x1c000, 0x24000, 0x5c000, 0x50000, 0x44000, 0x20000, 0x54000, 0x58000, 0x08000 - }; - - banks[0] = (data > 8) ? 9 : data; - - ZetMapArea(0xc000, 0xffff, 0, DrvZ80ROM0 + offsets[banks[0]]); - ZetMapArea(0xc000, 0xffff, 2, DrvZ80ROM0 + offsets[banks[0]]); -} - -static void vidram_bankswitch(INT32 data) -{ - banks[1] = data & 1; - - ZetMapArea(0x9000, 0x9fff, 0, DrvVidRAM + banks[1] * 0x1000); - ZetMapArea(0x9000, 0x9fff, 1, DrvVidRAM + banks[1] * 0x1000); - ZetMapArea(0x9000, 0x9fff, 2, DrvVidRAM + banks[1] * 0x1000); -} - -static inline void speedspn_palette_write(INT32 offset) -{ - INT32 r = DrvPalRAM[offset + 1] & 0x0f; - INT32 g = DrvPalRAM[offset + 0] >> 4; - INT32 b = DrvPalRAM[offset + 0] & 0x0f; - - offset /= 2; - - DrvPalette[offset] = BurnHighCol((r << 4) | r, (g << 4) | g, (b << 4) | b, 0); - if (DrvPalette[offset] == 0) black_color = offset; -} - -void __fastcall speedspn_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0x8000) { - address &= 0x7ff; - - if (data != DrvPalRAM[address]) { - DrvPalRAM[address] = data; - - speedspn_palette_write(address & ~1); - } - } -} - -void __fastcall speedspn_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x01: - case 0x10: // ? - return; - - case 0x07: - *display_enable = ~data & 1; - return; - - case 0x12: - bankswitch(data); - return; - - case 0x13: - *soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0x17: - vidram_bankswitch(data); - return; - } -} - -UINT8 __fastcall speedspn_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x10: - return DrvInputs[0]; - - case 0x11: - return DrvInputs[1]; - - case 0x12: - return DrvInputs[2]; - - case 0x13: - return DrvDips[0]; - - case 0x14: - return DrvDips[1]; - - case 0x16: - return 0; // irq ack? - } - - return 0; -} - -static void oki_bankswitch(INT32 data) -{ - banks[2] = data & 3; - - MSM6295SetBank(0, DrvSndROM + ((data & 3) * 0x20000), 0x20000, 0x3ffff); -} - -void __fastcall speedspn_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - oki_bankswitch(data); - return; - - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall speedspn_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - bankswitch(0); - vidram_bankswitch(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x090000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x080000; - - DrvSndROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x002000; - DrvZ80RAM1 = Next; Next += 0x000800; - - DrvVidRAM = Next; Next += 0x002000; - DrvPalRAM = Next; Next += 0x000800; - DrvAttrRAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - display_enable = Next; Next += 0x000001; - banks = Next; Next += 0x000003; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x200000, 0x300000, 0x000000, 0x100000 }; - INT32 XOffs0[8] = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007 }; - INT32 YOffs0[8] = { 0x038, 0x030, 0x028, 0x020, 0x018, 0x010, 0x008, 0x000 }; - - INT32 Plane1[4] = { 0x000004, 0x000000, 0x100004, 0x100000 }; - INT32 XOffs1[16] = { 0x10b, 0x10a, 0x109, 0x108, 0x103, 0x102, 0x101, 0x100, - 0x00b, 0x00a, 0x009, 0x008, 0x003, 0x002, 0x001, 0x000 }; - INT32 YOffs1[16] = { 0x0f0, 0x0e0, 0x0d0, 0x0c0, 0x0b0, 0x0a0, 0x090, 0x080, - 0x070, 0x060, 0x050, 0x040, 0x030, 0x020, 0x010, 0x000 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x80000; i++) tmp[i] = DrvGfxROM0[i] ^ 0xff; - - GfxDecode(0x4000, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - for (INT32 i = 0; i < 0x40000; i++) tmp[i] = DrvGfxROM1[i] ^ 0xff; - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x000000, 0, 1)) return 1; - memmove (DrvZ80ROM0 + 0x10000, DrvZ80ROM0 + 0x08000, 0x78000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x020000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x040000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x060000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x020000, 8, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0x8000, 0x87ff, 0, DrvPalRAM); -// ZetMapArea(0x8000, 0x87ff, 1, DrvPalRAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvPalRAM); - ZetMapArea(0x8800, 0x8fff, 0, DrvAttrRAM); - ZetMapArea(0x8800, 0x8fff, 1, DrvAttrRAM); - ZetMapArea(0x8800, 0x8fff, 2, DrvAttrRAM); - ZetMapArea(0xa000, 0xbfff, 0, DrvZ80RAM0); - ZetMapArea(0xa000, 0xbfff, 1, DrvZ80RAM0); - ZetMapArea(0xa000, 0xbfff, 2, DrvZ80RAM0); - ZetSetWriteHandler(speedspn_main_write); - ZetSetOutHandler(speedspn_main_write_port); - ZetSetInHandler(speedspn_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); - ZetSetWriteHandler(speedspn_sound_write); - ZetSetReadHandler(speedspn_sound_read); - ZetClose(); - - MSM6295Init(0, 1122000 / 132, 0); - MSM6295SetBank(0, DrvSndROM, 0, 0x3ffff); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - MSM6295Exit(0); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_layer() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (((offs / 32) << 3) + 192) & 0x1ff; - INT32 sy = (((offs & 0x1f) << 3) - 8) & 0x0ff; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = DrvVidRAM[offs * 2 + 1] | ((DrvVidRAM[offs * 2 + 0] & 0x3f) << 8); - INT32 color = DrvAttrRAM[offs ^ 0x400]; - - if (color & 0x80) { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy, color & 0x3f, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile(pTransDraw, code, sx, sy, color & 0x3f, 4, 0, DrvGfxROM0); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x1000; offs < 0x2000; offs += 4) - { - INT32 sy = DrvVidRAM[offs + 3]; - INT32 attr = DrvVidRAM[offs + 2]; - INT32 code = DrvVidRAM[offs + 1] + ((attr & 0xe0) << 3); - INT32 sx = DrvVidRAM[offs + 0] + ((attr & 0x10) << 4); - - if (attr == 0 && sx != 0) // fix junk on char. select screen - break; - - if (attr == 0 && code == 0) // speedup - continue; - - Render16x16Tile_Mask_Clip(pTransDraw, code, (0x1f8 - sx) - 64, sy - 8, attr & 0x0f, 4, 0x0f, 0, DrvGfxROM1); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x800; i+=2) { - speedspn_palette_write(i); - } - DrvRecalc = 0; - } - - if (*display_enable) - { - draw_layer(); - draw_sprites(); - } - else - { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = black_color; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 6000000 / 60, 6000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nSegment; - - ZetOpen(0); - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment); - ZetClose(); - } - - if (pBurnSoundOut) { - MSM6295Render(0,pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - MSM6295Scan(0, nAction); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(banks[0]); - vidram_bankswitch(banks[1]); - ZetClose(); - - oki_bankswitch(banks[2]); - - DrvRecalc = 1; - } - - return 0; -} - - -// Speed Spin - -static struct BurnRomInfo speedspnRomDesc[] = { - { "tch-ss1.u78", 0x80000, 0x41b6b45b, 1 | BRF_PRG | BRF_ESS }, // 0 Main Z80 Code - - { "tch-ss2.u96", 0x10000, 0x4611fd0c, 2 | BRF_PRG | BRF_ESS }, // 1 Sound Z80 Code - - { "tch-ss3.u95", 0x80000, 0x1c9deb5e, 3 | BRF_SND }, // 2 Samples - - { "tch-ss4.u70", 0x20000, 0x41517859, 4 | BRF_GRA }, // 3 Background Tiles - { "tch-ss5.u69", 0x20000, 0x832b2f34, 4 | BRF_GRA }, // 4 - { "tch-ss6.u60", 0x20000, 0xf1fd7289, 4 | BRF_GRA }, // 5 - { "tch-ss7.u59", 0x20000, 0xc4958543, 4 | BRF_GRA }, // 6 - - { "tch-ss8.u39", 0x20000, 0x2f27b16d, 5 | BRF_GRA }, // 7 Sprites - { "tch-ss9.u34", 0x20000, 0xc372f8ec, 5 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(speedspn) -STD_ROM_FN(speedspn) - -struct BurnDriver BurnDrvSpeedspn = { - "speedspn", NULL, NULL, NULL, "1994", - "Speed Spin\0", NULL, "TCH", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, speedspnRomInfo, speedspnRomName, NULL, NULL, SpeedspnInputInfo, SpeedspnDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 384, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_ssv.cpp b/jan/src/burn/drv/pst90s/d_ssv.cpp deleted file mode 100644 index 1b701ebb6..000000000 --- a/jan/src/burn/drv/pst90s/d_ssv.cpp +++ /dev/null @@ -1,5324 +0,0 @@ -// FB Alpha (SSV) Seta, Sammy, and Visco driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "v60_intf.h" -#include "upd7725.h" -#include "es5506.h" -#include "st0020.h" -#include "eeprom.h" -#include "math.h" - -/* - srmp7 - no music/sfx - gundam - verify layer should be OVER sprites and not behind - analog inputs not hooked up at all - clipping is not hooked up (broken) - marked with "iq_132" test with twin eagle -*/ - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvV60ROM; -static UINT8 *DrvDSPROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvSndROM2; -static UINT8 *DrvSndROM3; -static UINT8 *DrvV60RAM0; -static UINT8 *DrvV60RAM1; -static UINT8 *DrvV60RAM2; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvDspRAM; -static UINT8 *DrvNVRAM; -static UINT8 *DrvScrollRAM; -static UINT8 *DrvVectors; - -// GDFS -static UINT8 *DrvTMAPRAM; -static UINT8 *DrvTMAPScroll; -static UINT8 *DrvGfxROM2; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -// required for save states -static UINT16 requested_int; -static UINT16 enable_video; -static UINT16 irq_enable; -static UINT8 input_select; -static UINT16 sexyreact_previous_dial; -static UINT32 sexyreact_serial_read; - -static UINT8 *eaglshot_bank; - -// not required for save states -static INT32 watchdog; -static INT32 vblank; -static INT32 shadow_pen_shift; -static INT32 shadow_pen_mask; -static INT32 tile_code[16]; -static INT32 Gclip_min_x; -static INT32 Gclip_max_x; -static INT32 Gclip_min_y; -static INT32 Gclip_max_y; -static INT32 interrupt_ultrax = 0; -static INT32 watchdog_disable = 0; -static INT32 is_gdfs = 0; -static INT32 vbl_kludge = 0; // late vbl, for flicker issues in vertical games -static INT32 vbl_invert = 0; // invert vblank register, for drifto94 - -static INT32 dsp_enable = 0; - -static INT32 nDrvSndROMLen[4]; -static INT32 nDrvGfxROMLen; -static INT32 nDrvGfxROM2Len; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvJoy6[8]; -static UINT8 DrvJoy7[8]; -static UINT8 DrvJoy8[8]; -static UINT8 DrvInputs[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo VasaraInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Vasara) - -static struct BurnInputInfo SurvartsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvJoy4 + 2, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvJoy4 + 5, "p2 fire 5" }, - {"P2 Button 6", BIT_DIGITAL, DrvJoy4 + 6, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Survarts) - -static struct BurnInputInfo KeithlcyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Keithlcy) - -static struct BurnInputInfo Twineag2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Twineag2) - -static struct BurnInputInfo MeosismInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 5" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 3, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 5, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Meosism) - -static struct BurnInputInfo RyoriohInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ryorioh) - -static struct BurnInputInfo GdfsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - - // placeholders for analog inputs - {"P1 Button 4", BIT_DIGITAL, DrvJoy3 + 8, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy3 + 9, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvJoy3 + 10, "p1 fire 6" }, - {"P1 Button 7", BIT_DIGITAL, DrvJoy3 + 11, "p1 fire 7" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - {"P2 Button 7", BIT_DIGITAL, DrvJoy3 + 11, "p2 fire 7" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Gdfs) - -static struct BurnInputInfo MahjongInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - {"A", BIT_DIGITAL, DrvJoy8 + 5, "mah a" }, - {"B", BIT_DIGITAL, DrvJoy7 + 0, "mah b" }, - {"C", BIT_DIGITAL, DrvJoy6 + 2, "mah c" }, - {"D", BIT_DIGITAL, DrvJoy5 + 5, "mah d" }, - {"E", BIT_DIGITAL, DrvJoy8 + 4, "mah e" }, - {"F", BIT_DIGITAL, DrvJoy7 + 4, "mah f" }, - {"G", BIT_DIGITAL, DrvJoy6 + 4, "mah g" }, - {"H", BIT_DIGITAL, DrvJoy5 + 4, "mah h" }, - {"I", BIT_DIGITAL, DrvJoy8 + 3, "mah i" }, - {"J", BIT_DIGITAL, DrvJoy7 + 3, "mah j" }, - {"K", BIT_DIGITAL, DrvJoy6 + 3, "mah k" }, - {"L", BIT_DIGITAL, DrvJoy5 + 3, "mah l" }, - {"M", BIT_DIGITAL, DrvJoy8 + 2, "mah m" }, - {"N", BIT_DIGITAL, DrvJoy7 + 2, "mah n" }, - {"Pon", BIT_DIGITAL, DrvJoy5 + 2, "mah pon" }, - {"Chi", BIT_DIGITAL, DrvJoy6 + 2, "mah chi" }, - {"Kan", BIT_DIGITAL, DrvJoy8 + 1, "mah kan" }, - {"Ron", BIT_DIGITAL, DrvJoy6 + 1, "mah ron" }, - {"Reach", BIT_DIGITAL, DrvJoy7 + 1, "mah reach" }, - {"Bet", BIT_DIGITAL, DrvJoy7 + 0, "mah bet" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Mahjong) - -static struct BurnInputInfo Srmp4InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy8 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - {"A", BIT_DIGITAL, DrvJoy8 + 5, "mah a" }, - {"B", BIT_DIGITAL, DrvJoy7 + 0, "mah b" }, - {"C", BIT_DIGITAL, DrvJoy6 + 2, "mah c" }, - {"D", BIT_DIGITAL, DrvJoy5 + 5, "mah d" }, - {"E", BIT_DIGITAL, DrvJoy8 + 4, "mah e" }, - {"F", BIT_DIGITAL, DrvJoy7 + 4, "mah f" }, - {"G", BIT_DIGITAL, DrvJoy6 + 4, "mah g" }, - {"H", BIT_DIGITAL, DrvJoy5 + 4, "mah h" }, - {"I", BIT_DIGITAL, DrvJoy8 + 3, "mah i" }, - {"J", BIT_DIGITAL, DrvJoy7 + 3, "mah j" }, - {"K", BIT_DIGITAL, DrvJoy6 + 3, "mah k" }, - {"L", BIT_DIGITAL, DrvJoy5 + 3, "mah l" }, - {"M", BIT_DIGITAL, DrvJoy8 + 2, "mah m" }, - {"N", BIT_DIGITAL, DrvJoy7 + 2, "mah n" }, - {"Pon", BIT_DIGITAL, DrvJoy5 + 2, "mah pon" }, - {"Chi", BIT_DIGITAL, DrvJoy6 + 2, "mah chi" }, - {"Kan", BIT_DIGITAL, DrvJoy8 + 1, "mah kan" }, - {"Ron", BIT_DIGITAL, DrvJoy6 + 1, "mah ron" }, - {"Reach", BIT_DIGITAL, DrvJoy7 + 1, "mah reach" }, - {"Bet", BIT_DIGITAL, DrvJoy7 + 0, "mah bet" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Srmp4) - -static struct BurnInputInfo HypreactInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 4, "p1 right" }, - {"A", BIT_DIGITAL, DrvJoy4 + 0, "mah a" }, - {"B", BIT_DIGITAL, DrvJoy5 + 0, "mah b" }, - {"C", BIT_DIGITAL, DrvJoy1 + 1, "mah c" }, - {"D", BIT_DIGITAL, DrvJoy7 + 0, "mah d" }, - {"E", BIT_DIGITAL, DrvJoy4 + 1, "mah e" }, - {"F", BIT_DIGITAL, DrvJoy5 + 1, "mah f" }, - {"G", BIT_DIGITAL, DrvJoy6 + 1, "mah g" }, - {"H", BIT_DIGITAL, DrvJoy7 + 1, "mah h" }, - {"I", BIT_DIGITAL, DrvJoy4 + 2, "mah i" }, - {"J", BIT_DIGITAL, DrvJoy5 + 2, "mah j" }, - {"K", BIT_DIGITAL, DrvJoy1 + 3, "mah k" }, - {"L", BIT_DIGITAL, DrvJoy7 + 2, "mah l" }, - {"M", BIT_DIGITAL, DrvJoy4 + 3, "mah m" }, - {"N", BIT_DIGITAL, DrvJoy5 + 3, "mah n" }, - {"Pon", BIT_DIGITAL, DrvJoy1 + 2, "mah pon" }, - {"Chi", BIT_DIGITAL, DrvJoy1 + 1, "mah chi" }, - {"Kan", BIT_DIGITAL, DrvJoy1 + 3, "mah kan" }, - {"Ron", BIT_DIGITAL, DrvJoy2 + 2, "mah ron" }, - {"Reach", BIT_DIGITAL, DrvJoy2 + 1, "mah reach" }, - {"Bet", BIT_DIGITAL, DrvJoy5 + 5, "mah bet" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Hypreact) - -static struct BurnInputInfo Hypreac2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - {"A", BIT_DIGITAL, DrvJoy4 + 0, "mah a" }, - {"B", BIT_DIGITAL, DrvJoy5 + 0, "mah b" }, - {"C", BIT_DIGITAL, DrvJoy6 + 0, "mah c" }, - {"D", BIT_DIGITAL, DrvJoy7 + 0, "mah d" }, - {"E", BIT_DIGITAL, DrvJoy4 + 1, "mah e" }, - {"F", BIT_DIGITAL, DrvJoy5 + 1, "mah f" }, - {"G", BIT_DIGITAL, DrvJoy6 + 1, "mah g" }, - {"H", BIT_DIGITAL, DrvJoy7 + 1, "mah h" }, - {"I", BIT_DIGITAL, DrvJoy4 + 2, "mah i" }, - {"J", BIT_DIGITAL, DrvJoy5 + 2, "mah j" }, - {"K", BIT_DIGITAL, DrvJoy4 + 4, "mah k" }, - {"L", BIT_DIGITAL, DrvJoy7 + 2, "mah l" }, - {"M", BIT_DIGITAL, DrvJoy4 + 3, "mah m" }, - {"N", BIT_DIGITAL, DrvJoy5 + 3, "mah n" }, - {"Pon", BIT_DIGITAL, DrvJoy7 + 3, "mah pon" }, - {"Chi", BIT_DIGITAL, DrvJoy6 + 3, "mah chi" }, - {"Kan", BIT_DIGITAL, DrvJoy4 + 4, "mah kan" }, - {"Ron", BIT_DIGITAL, DrvJoy6 + 4, "mah ron" }, - {"Reach", BIT_DIGITAL, DrvJoy5 + 4, "mah reach" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Hypreac2) - -static struct BurnInputInfo Srmp7InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy7 + 0, "p1 start" }, - {"A", BIT_DIGITAL, DrvJoy7 + 5, "mah a" }, - {"B", BIT_DIGITAL, DrvJoy6 + 5, "mah b" }, - {"C", BIT_DIGITAL, DrvJoy5 + 2, "mah c" }, - {"D", BIT_DIGITAL, DrvJoy8 + 5, "mah d" }, - {"E", BIT_DIGITAL, DrvJoy7 + 4, "mah e" }, - {"F", BIT_DIGITAL, DrvJoy6 + 4, "mah f" }, - {"G", BIT_DIGITAL, DrvJoy5 + 4, "mah g" }, - {"H", BIT_DIGITAL, DrvJoy8 + 4, "mah h" }, - {"I", BIT_DIGITAL, DrvJoy7 + 3, "mah i" }, - {"J", BIT_DIGITAL, DrvJoy6 + 3, "mah j" }, - {"K", BIT_DIGITAL, DrvJoy5 + 3, "mah k" }, - {"L", BIT_DIGITAL, DrvJoy8 + 3, "mah l" }, - {"M", BIT_DIGITAL, DrvJoy7 + 2, "mah m" }, - {"N", BIT_DIGITAL, DrvJoy6 + 2, "mah n" }, - {"Pon", BIT_DIGITAL, DrvJoy8 + 2, "mah pon" }, - {"Chi", BIT_DIGITAL, DrvJoy5 + 2, "mah chi" }, - {"Kan", BIT_DIGITAL, DrvJoy7 + 1, "mah kan" }, - {"Ron", BIT_DIGITAL, DrvJoy5 + 1, "mah ron" }, - {"Reach", BIT_DIGITAL, DrvJoy6 + 1, "mah reach" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Srmp7) - -static struct BurnInputInfo SxyreactInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - - // placeholder for analog inputs - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Sxyreact) - -static struct BurnInputInfo EaglshotInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 3" }, - - // placeholder for analog inputs - {"P1 Button 4", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy3 + 6, "p1 fire 5" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 0, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Eaglshot) - -static struct BurnDIPInfo VasaraDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bomber Stock" }, - {0x15, 0x01, 0x0c, 0x00, "0" }, - {0x15, 0x01, 0x0c, 0x04, "1" }, - {0x15, 0x01, 0x0c, 0x0c, "2" }, - {0x15, 0x01, 0x0c, 0x08, "3" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x30, 0x00, "1" }, - {0x15, 0x01, 0x30, 0x10, "2" }, - {0x15, 0x01, 0x30, 0x30, "3" }, - {0x15, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Game Voice" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "English Subtitles" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Vasara) - -static struct BurnDIPInfo Vasara2DIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x0c, 0x00, "1" }, - {0x15, 0x01, 0x0c, 0x04, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x08, "5" }, - - {0 , 0xfe, 0 , 2, "Game Voice" }, - {0x15, 0x01, 0x10, 0x00, "Off" }, - {0x15, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Vasara Stock" }, - {0x15, 0x01, 0x20, 0x20, "2" }, - {0x15, 0x01, 0x20, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "English Subtitles" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Secret Character" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Vasara2) - -static struct BurnDIPInfo SurvartsDIPList[]= -{ - {0x1b, 0xff, 0xff, 0xff, NULL }, - {0x1c, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x1b, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x1b, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x1b, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x1b, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x1b, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x1b, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x1b, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x1b, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x1b, 0x01, 0x0f, 0x05, "Multiple Coin Feature A" }, - {0x1b, 0x01, 0x0f, 0x04, "Multiple Coin Feature B" }, - {0x1b, 0x01, 0x0f, 0x03, "Multiple Coin Feature C" }, - {0x1b, 0x01, 0x0f, 0x02, "Multiple Coin Feature D" }, - {0x1b, 0x01, 0x0f, 0x01, "Multiple Coin Feature E" }, - {0x1b, 0x01, 0x0f, 0x00, "2 Credits Start, 1 to continue" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x1b, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x1b, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x1b, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x1b, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x1b, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x1b, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x1b, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x1b, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x1b, 0x01, 0xf0, 0x50, "Multiple Coin Feature A" }, - {0x1b, 0x01, 0xf0, 0x40, "Multiple Coin Feature B" }, - {0x1b, 0x01, 0xf0, 0x30, "Multiple Coin Feature C" }, - {0x1b, 0x01, 0xf0, 0x20, "Multiple Coin Feature D" }, - {0x1b, 0x01, 0xf0, 0x10, "Multiple Coin Feature E" }, - {0x1b, 0x01, 0xf0, 0x00, "2 Credits Start, 1 to continue" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1c, 0x01, 0x01, 0x01, "Off" }, - {0x1c, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1c, 0x01, 0x02, 0x02, "Off" }, - {0x1c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Timer Speed" }, - {0x1c, 0x01, 0x04, 0x04, "Normal" }, - {0x1c, 0x01, 0x04, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2, "Damage Level" }, - {0x1c, 0x01, 0x08, 0x08, "Normal" }, - {0x1c, 0x01, 0x08, 0x00, "High" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1c, 0x01, 0x30, 0x10, "Easy" }, - {0x1c, 0x01, 0x30, 0x30, "Normal" }, - {0x1c, 0x01, 0x30, 0x20, "Hard" }, - {0x1c, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Fatal Damage" }, - {0x1c, 0x01, 0xc0, 0x40, "Light" }, - {0x1c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x1c, 0x01, 0xc0, 0x80, "Heavy" }, - {0x1c, 0x01, 0xc0, 0x00, "Heaviest" }, -}; - -STDDIPINFO(Survarts) - -static struct BurnDIPInfo DynagearDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 15, "Coin A" }, - {0x15, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x05, "Multiple Coin Feature A" }, - {0x15, 0x01, 0x0f, 0x04, "Multiple Coin Feature B" }, - {0x15, 0x01, 0x0f, 0x03, "Multiple Coin Feature C" }, - {0x15, 0x01, 0x0f, 0x02, "Multiple Coin Feature D" }, - {0x15, 0x01, 0x0f, 0x01, "Multiple Coin Feature E" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x15, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x50, "Multiple Coin Feature A" }, - {0x15, 0x01, 0xf0, 0x40, "Multiple Coin Feature B" }, - {0x15, 0x01, 0xf0, 0x30, "Multiple Coin Feature C" }, - {0x15, 0x01, 0xf0, 0x20, "Multiple Coin Feature D" }, - {0x15, 0x01, 0xf0, 0x10, "Multiple Coin Feature E" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - {0x16, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x10, "1" }, - {0x16, 0x01, 0x30, 0x30, "2" }, - {0x16, 0x01, 0x30, 0x20, "3" }, - {0x16, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Health" }, - {0x16, 0x01, 0x80, 0x00, "3 Hearts" }, - {0x16, 0x01, 0x80, 0x80, "4 Hearts" }, -}; - -STDDIPINFO(Dynagear) - -static struct BurnDIPInfo KeithlcyDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x0f, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x03, 0x02, "Easy" }, - {0x10, 0x01, 0x03, 0x03, "Normal" }, - {0x10, 0x01, 0x03, 0x01, "Hard" }, - {0x10, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x0c, 0x08, "2" }, - {0x10, 0x01, 0x0c, 0x0c, "3" }, - {0x10, 0x01, 0x0c, 0x04, "4" }, - {0x10, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x30, 0x30, "Every 100k" }, - {0x10, 0x01, 0x30, 0x20, "Every 150k" }, - {0x10, 0x01, 0x30, 0x10, "100k & Every 200K" }, - {0x10, 0x01, 0x30, 0x00, "Every 200k" }, -}; - -STDDIPINFO(Keithlcy) - -static struct BurnDIPInfo Twineag2DIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 15, "Coin A" }, - {0x15, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x15, 0x01, 0x0f, 0x05, "Multiple Coin Feature A" }, - {0x15, 0x01, 0x0f, 0x04, "Multiple Coin Feature B" }, - {0x15, 0x01, 0x0f, 0x03, "Multiple Coin Feature C" }, - {0x15, 0x01, 0x0f, 0x02, "Multiple Coin Feature D" }, - {0x15, 0x01, 0x0f, 0x01, "Multiple Coin Feature E" }, - - {0 , 0xfe, 0 , 15, "Coin B" }, - {0x15, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x15, 0x01, 0xf0, 0x50, "Multiple Coin Feature A" }, - {0x15, 0x01, 0xf0, 0x40, "Multiple Coin Feature B" }, - {0x15, 0x01, 0xf0, 0x30, "Multiple Coin Feature C" }, - {0x15, 0x01, 0xf0, 0x20, "Multiple Coin Feature D" }, - {0x15, 0x01, 0xf0, 0x10, "Multiple Coin Feature E" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x16, 0x01, 0x07, 0x06, "Easiest" }, - {0x16, 0x01, 0x07, 0x05, "Easier" }, - {0x16, 0x01, 0x07, 0x04, "Easy" }, - {0x16, 0x01, 0x07, 0x07, "Normal" }, - {0x16, 0x01, 0x07, 0x03, "Medium" }, - {0x16, 0x01, 0x07, 0x02, "Hard" }, - {0x16, 0x01, 0x07, 0x01, "Harder" }, - {0x16, 0x01, 0x07, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Lives" }, - {0x16, 0x01, 0x10, 0x00, "2" }, - {0x16, 0x01, 0x10, 0x10, "3" }, - - {0 , 0xfe, 0 , 2, "Pause" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Twineag2) - -static struct BurnDIPInfo Drifto94DIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Sound Test" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x03, "Normal" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Music Volume" }, - {0x16, 0x01, 0x10, 0x00, "Quiet" }, - {0x16, 0x01, 0x10, 0x10, "Loud" }, - - {0 , 0xfe, 0 , 2, "Sound Volume" }, - {0x16, 0x01, 0x20, 0x00, "Quiet" }, - {0x16, 0x01, 0x20, 0x20, "Loud" }, - - {0 , 0xfe, 0 , 2, "Save Best Time" }, - {0x16, 0x01, 0x40, 0x00, "No" }, - {0x16, 0x01, 0x40, 0x40, "Yes" }, -}; - -STDDIPINFO(Drifto94) - -static struct BurnDIPInfo MeosismDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x02, 0x02, "Off" }, - {0x0e, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0e, 0x01, 0x03, 0x03, "1 Medal/1 Credit" }, - {0x0e, 0x01, 0x03, 0x01, "1 Medal/5 Credits" }, - {0x0e, 0x01, 0x03, 0x02, "1 Medal/10 Credits" }, - {0x0e, 0x01, 0x03, 0x00, "1 Medal/20 Credits" }, - - {0 , 0xfe, 0 , 4, "Demo Sounds" }, - {0x0e, 0x01, 0x04, 0x00, "Off" }, - {0x0e, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Attendant Pay" }, - {0x0e, 0x01, 0x08, 0x00, "No" }, - {0x0e, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 2, "Medals Payout" }, - {0x0e, 0x01, 0x10, 0x10, "400" }, - {0x0e, 0x01, 0x10, 0x00, "800" }, - - {0 , 0xfe, 0 , 2, "Max Credits" }, - {0x0e, 0x01, 0x20, 0x20, "5000" }, - {0x0e, 0x01, 0x20, 0x00, "9999" }, - - {0 , 0xfe, 0 , 2, "Hopper" }, - {0x0e, 0x01, 0x40, 0x00, "No" }, - {0x0e, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Reel Speed" }, - {0x0e, 0x01, 0x80, 0x80, "Low" }, - {0x0e, 0x01, 0x80, 0x00, "High" }, - - {0 , 0xfe, 0 , 4, "Game Rate" }, - {0x0f, 0x01, 0x03, 0x00, "80%" }, - {0x0f, 0x01, 0x03, 0x02, "85%" }, - {0x0f, 0x01, 0x03, 0x03, "90%" }, - {0x0f, 0x01, 0x03, 0x01, "95%" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x0f, 0x01, 0x20, 0x20, "Simple" }, - {0x0f, 0x01, 0x20, 0x00, "Complex" }, - - {0 , 0xfe, 0 , 2, "Coin Sensor" }, - {0x0f, 0x01, 0x40, 0x40, "Active High" }, - {0x0f, 0x01, 0x40, 0x00, "Active Low" }, - - {0 , 0xfe, 0 , 2, "Hopper Sensor" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Meosism) - -static struct BurnDIPInfo CairbladDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x02, 0x00, "Off" }, - {0x16, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - {0x16, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x16, 0x01, 0x10, 0x10, "Off" }, - {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x60, 0x40, "Every 2 Mil" }, - {0x16, 0x01, 0x60, 0x60, "2 Mil/6 Mil" }, - {0x16, 0x01, 0x60, 0x20, "4 Million" }, - {0x16, 0x01, 0x60, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Cairblad) - -static struct BurnDIPInfo UltraxDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xef, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x15, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Normal" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x16, 0x01, 0x08, 0x08, "Off" }, - {0x16, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Region" }, - {0x16, 0x01, 0x14, 0x00, "China" }, - {0x16, 0x01, 0x14, 0x14, "Japan" }, - {0x16, 0x01, 0x14, 0x04, "World" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x20, 0x00, "Off" }, - {0x16, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ultrax) - -static struct BurnDIPInfo StmbladeDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Rapid Fire" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x02, 0x00, "Off" }, - {0x16, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - {0x16, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x20, "1" }, - {0x16, 0x01, 0x30, 0x10, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x16, 0x01, 0x40, 0x40, "600000" }, - {0x16, 0x01, 0x40, 0x00, "800000" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Stmblade) - -static struct BurnDIPInfo RyoriohDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x03, 0x02, "Easy" }, - {0x10, 0x01, 0x03, 0x03, "Normal" }, - {0x10, 0x01, 0x03, 0x01, "Hard" }, - {0x10, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Ryorioh) - -static struct BurnDIPInfo MsliderDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x15, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x15, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x15, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x01, 0x01, "On" }, - {0x16, 0x01, 0x01, 0x00, "Off" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x02, 0x00, "Off" }, - {0x16, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x0c, 0x08, "Easy" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Hard" }, - {0x16, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Rounds (Vs Mode)" }, - {0x16, 0x01, 0x30, 0x00, "1" }, - {0x16, 0x01, 0x30, 0x30, "2" }, - {0x16, 0x01, 0x30, 0x20, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, -}; - -STDDIPINFO(Mslider) - -static struct BurnDIPInfo GdfsDIPList[]= -{ - {0x1a, 0xff, 0xff, 0xff, NULL }, - {0x1b, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x1a, 0x01, 0x01, 0x01, "Joystick" }, - {0x1a, 0x01, 0x01, 0x00, "Light Gun" }, - - {0 , 0xfe, 0 , 2, "Light Gun Calibration" }, - {0x1a, 0x01, 0x02, 0x02, "Off" }, - {0x1a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Level Select" }, - {0x1a, 0x01, 0x04, 0x04, "Off" }, - {0x1a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Coinage" }, - {0x1a, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x1a, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x1a, 0x01, 0x18, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Save Scores" }, - {0x1a, 0x01, 0x20, 0x00, "No" }, - {0x1a, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1a, 0x01, 0x40, 0x40, "Off" }, - {0x1a, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invert X Axis" }, - {0x1b, 0x01, 0x01, 0x01, "Off" }, - {0x1b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x1b, 0x01, 0x08, 0x00, "English" }, - {0x1b, 0x01, 0x08, 0x08, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1b, 0x01, 0x10, 0x00, "Off" }, - {0x1b, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Damage From Machine Gun" }, - {0x1b, 0x01, 0x20, 0x20, "Light" }, - {0x1b, 0x01, 0x20, 0x00, "Heavy" }, - - {0 , 0xfe, 0 , 2, "Damage From Beam Cannon" }, - {0x1b, 0x01, 0x40, 0x40, "Light" }, - {0x1b, 0x01, 0x40, 0x00, "Heavy" }, - - {0 , 0xfe, 0 , 2, "Damage From Missle" }, - {0x1b, 0x01, 0x80, 0x80, "Light" }, - {0x1b, 0x01, 0x80, 0x00, "Heavy" }, -}; - -STDDIPINFO(Gdfs) - -static struct BurnDIPInfo Janjans1DIPList[]= -{ - {0x29, 0xff, 0xff, 0xff, NULL }, - {0x2a, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x29, 0x01, 0x02, 0x02, "Off" }, - {0x29, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x29, 0x01, 0x04, 0x04, "Off" }, - {0x29, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x29, 0x01, 0x08, 0x00, "Off" }, - {0x29, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x29, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x29, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x29, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x29, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Voice" }, - {0x29, 0x01, 0x40, 0x00, "Off" }, - {0x29, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x2a, 0x01, 0x03, 0x02, "Easy" }, - {0x2a, 0x01, 0x03, 0x03, "Normal" }, - {0x2a, 0x01, 0x03, 0x01, "Hard" }, - {0x2a, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Nudity" }, - {0x2a, 0x01, 0x04, 0x00, "Off" }, - {0x2a, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Mini Game" }, - {0x2a, 0x01, 0x08, 0x00, "Off" }, - {0x2a, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Initial Score" }, - {0x2a, 0x01, 0x30, 0x20, "1000" }, - {0x2a, 0x01, 0x30, 0x30, "1500" }, - {0x2a, 0x01, 0x30, 0x10, "2000" }, - {0x2a, 0x01, 0x30, 0x00, "3000" }, - - {0 , 0xfe, 0 , 3, "Communication" }, - {0x2a, 0x01, 0xc0, 0xc0, "None" }, - {0x2a, 0x01, 0xc0, 0x40, "Board 1 (Main)" }, - {0x2a, 0x01, 0xc0, 0x00, "Board 2 (Sub)" }, -}; - -STDDIPINFO(Janjans1) - -static struct BurnDIPInfo Janjans2DIPList[]= -{ - {0x29, 0xff, 0xff, 0xff, NULL }, - {0x2a, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x29, 0x01, 0x02, 0x02, "Off" }, - {0x29, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x29, 0x01, 0x04, 0x04, "Off" }, - {0x29, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x29, 0x01, 0x08, 0x00, "Off" }, - {0x29, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x29, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x29, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x29, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x29, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Nudity" }, - {0x29, 0x01, 0x40, 0x00, "Off" }, - {0x29, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x2a, 0x01, 0x03, 0x02, "Easy" }, - {0x2a, 0x01, 0x03, 0x03, "Normal" }, - {0x2a, 0x01, 0x03, 0x01, "Hard" }, - {0x2a, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Initial Score (vs)" }, - {0x2a, 0x01, 0x0c, 0x08, "10000" }, - {0x2a, 0x01, 0x0c, 0x04, "15000" }, - {0x2a, 0x01, 0x0c, 0x0c, "20000" }, - {0x2a, 0x01, 0x0c, 0x00, "25000" }, - - {0 , 0xfe, 0 , 4, "Initial Score (solo)" }, - {0x2a, 0x01, 0x30, 0x20, "1000" }, - {0x2a, 0x01, 0x30, 0x30, "1500" }, - {0x2a, 0x01, 0x30, 0x10, "2000" }, - {0x2a, 0x01, 0x30, 0x00, "3000" }, - - {0 , 0xfe, 0 , 3, "Communication" }, - {0x2a, 0x01, 0xc0, 0xc0, "None" }, - {0x2a, 0x01, 0xc0, 0x40, "Transmitter" }, - {0x2a, 0x01, 0xc0, 0x00, "Receiver" }, -}; - -STDDIPINFO(Janjans2) - -static struct BurnDIPInfo Koikois2DIPList[]= -{ - {0x29, 0xff, 0xff, 0xff, NULL }, - {0x2a, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x29, 0x01, 0x02, 0x02, "Off" }, - {0x29, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x29, 0x01, 0x04, 0x04, "Off" }, - {0x29, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x29, 0x01, 0x08, 0x00, "Off" }, - {0x29, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x29, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x29, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x29, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x29, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Voice" }, - {0x29, 0x01, 0x40, 0x00, "Off" }, - {0x29, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x29, 0x01, 0x80, 0x80, "Joystick" }, - {0x29, 0x01, 0x80, 0x00, "Keyboard" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x2a, 0x01, 0x03, 0x02, "Easy" }, - {0x2a, 0x01, 0x03, 0x03, "Normal" }, - {0x2a, 0x01, 0x03, 0x01, "Hard" }, - {0x2a, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Nudity" }, - {0x2a, 0x01, 0x04, 0x00, "No" }, - {0x2a, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 3, "Communication" }, - {0x2a, 0x01, 0xc0, 0xc0, "None" }, - {0x2a, 0x01, 0xc0, 0x40, "Board 1 (Main)" }, - {0x2a, 0x01, 0xc0, 0x00, "Board 2 (Sub)" }, -}; - -STDDIPINFO(Koikois2) - -static struct BurnDIPInfo Srmp4DIPList[]= -{ - {0x29, 0xff, 0xff, 0xff, NULL }, - {0x2a, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x29, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x29, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x29, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x29, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x29, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x29, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x29, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x29, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x29, 0x01, 0x38, 0x00, "5 Coins 1 Credits" }, - {0x29, 0x01, 0x38, 0x08, "4 Coins 1 Credits" }, - {0x29, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x29, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x29, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x29, 0x01, 0x38, 0x30, "1 Coin 2 Credits" }, - {0x29, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x29, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x29, 0x01, 0x40, 0x40, "Off" }, - {0x29, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x2a, 0x01, 0x07, 0x06, "Easiest" }, - {0x2a, 0x01, 0x07, 0x05, "Easier" }, - {0x2a, 0x01, 0x07, 0x04, "Easy" }, - {0x2a, 0x01, 0x07, 0x07, "Normal" }, - {0x2a, 0x01, 0x07, 0x03, "Medium" }, - {0x2a, 0x01, 0x07, 0x02, "Hard" }, - {0x2a, 0x01, 0x07, 0x01, "Harder" }, - {0x2a, 0x01, 0x07, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x2a, 0x01, 0x08, 0x08, "Off" }, - {0x2a, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x2a, 0x01, 0x10, 0x00, "Off" }, - {0x2a, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x2a, 0x01, 0x20, 0x20, "Off" }, - {0x2a, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x2a, 0x01, 0x40, 0x00, "No" }, - {0x2a, 0x01, 0x40, 0x40, "Yes" }, -}; - -STDDIPINFO(Srmp4) - -static struct BurnDIPInfo HypreactDIPList[]= -{ - {0x1d, 0xff, 0xff, 0xff, NULL }, - {0x1e, 0xff, 0xff, 0xef, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x1d, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x1d, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x1d, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x1d, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x1d, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x1d, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x1d, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x1d, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x1d, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x1d, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x1d, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x1d, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x1d, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x1d, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x1d, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x1d, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Half Coins To Continue" }, - {0x1d, 0x01, 0x40, 0x40, "No" }, - {0x1d, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x1d, 0x01, 0x80, 0x80, "Off" }, - {0x1d, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1e, 0x01, 0x01, 0x01, "Off" }, - {0x1e, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1e, 0x01, 0x02, 0x00, "Off" }, - {0x1e, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1e, 0x01, 0x0c, 0x08, "Easy" }, - {0x1e, 0x01, 0x0c, 0x0c, "Normal" }, - {0x1e, 0x01, 0x0c, 0x04, "Hard" }, - {0x1e, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x1e, 0x01, 0x10, 0x10, "Keyboard" }, - {0x1e, 0x01, 0x10, 0x00, "Joystick" }, - - {0 , 0xfe, 0 , 2, "Multiple coins" }, - {0x1e, 0x01, 0x20, 0x00, "Off" }, - {0x1e, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Keep Status On Continue" }, - {0x1e, 0x01, 0x40, 0x00, "No" }, - {0x1e, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1e, 0x01, 0x80, 0x80, "Off" }, - {0x1e, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Hypreact) - -static struct BurnDIPInfo Hypreac2DIPList[]= -{ - {0x28, 0xff, 0xff, 0xff, NULL }, - {0x29, 0xff, 0xff, 0xef, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x28, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x28, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x28, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x28, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x28, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x28, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x28, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x28, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x28, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x28, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x28, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x28, 0x01, 0x38, 0x20, "1 Coin 2 Credits" }, - {0x28, 0x01, 0x38, 0x18, "1 Coin 3 Credits" }, - {0x28, 0x01, 0x38, 0x10, "1 Coin 4 Credits" }, - {0x28, 0x01, 0x38, 0x08, "1 Coin 5 Credits" }, - {0x28, 0x01, 0x38, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "1/2 Coins To Continue"}, - {0x28, 0x01, 0x40, 0x40, "No" }, - {0x28, 0x01, 0x40, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x28, 0x01, 0x80, 0x80, "Off" }, - {0x28, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x29, 0x01, 0x01, 0x01, "Off" }, - {0x29, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x29, 0x01, 0x02, 0x00, "Off" }, - {0x29, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x29, 0x01, 0x0c, 0x08, "Easy" }, - {0x29, 0x01, 0x0c, 0x0c, "Normal" }, - {0x29, 0x01, 0x0c, 0x04, "Hard" }, - {0x29, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x29, 0x01, 0x10, 0x10, "Keyboard" }, - {0x29, 0x01, 0x10, 0x00, "Joystick" }, - - {0 , 0xfe, 0 , 2, "Communication" }, - {0x29, 0x01, 0x20, 0x20, "Off" }, - {0x29, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Communication Mode" }, - {0x29, 0x01, 0x40, 0x40, "SLAVE" }, - {0x29, 0x01, 0x40, 0x00, "MASTER" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x29, 0x01, 0x80, 0x80, "Off" }, - {0x29, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Hypreac2) - -static struct BurnDIPInfo Srmp7DIPList[]= -{ - {0x18, 0xff, 0xff, 0xc7, NULL }, - {0x19, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x18, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x18, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x18, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x18, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x18, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x18, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x18, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x18, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Re-cloth" }, - {0x18, 0x01, 0x40, 0x00, "Off" }, - {0x18, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Nudity" }, - {0x18, 0x01, 0x80, 0x00, "Off" }, - {0x18, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x19, 0x01, 0x07, 0x06, "Easiest" }, - {0x19, 0x01, 0x07, 0x05, "Easier" }, - {0x19, 0x01, 0x07, 0x04, "Easy" }, - {0x19, 0x01, 0x07, 0x07, "Normal" }, - {0x19, 0x01, 0x07, 0x03, "Medium" }, - {0x19, 0x01, 0x07, 0x02, "Hard" }, - {0x19, 0x01, 0x07, 0x01, "Harder" }, - {0x19, 0x01, 0x07, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Kuitan" }, - {0x19, 0x01, 0x08, 0x00, "Off" }, - {0x19, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x19, 0x01, 0x10, 0x00, "Off" }, - {0x19, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x19, 0x01, 0x20, 0x00, "Off" }, - {0x19, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x19, 0x01, 0x40, 0x40, "Off" }, - {0x19, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x19, 0x01, 0x80, 0x80, "Off" }, - {0x19, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Srmp7) - -static struct BurnDIPInfo SxyreactDIPList[]= -{ - {0x17, 0xff, 0xff, 0xff, NULL }, - {0x18, 0xff, 0xff, 0xef, NULL }, - - {0 , 0xfe, 0 , 7, "Coin A" }, - {0x17, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x17, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x17, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x17, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x17, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x17, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x17, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2, "Credits To Play" }, - {0x17, 0x01, 0x40, 0x40, "1" }, - {0x17, 0x01, 0x40, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Buy Balls With Credits"}, - {0x17, 0x01, 0x80, 0x00, "Off" }, - {0x17, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x18, 0x01, 0x01, 0x01, "Off" }, - {0x18, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x18, 0x01, 0x02, 0x00, "Off" }, - {0x18, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x18, 0x01, 0x0c, 0x08, "Easy" }, - {0x18, 0x01, 0x0c, 0x0c, "Normal" }, - {0x18, 0x01, 0x0c, 0x04, "Hard" }, - {0x18, 0x01, 0x0c, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x18, 0x01, 0x10, 0x10, "Dial" }, - {0x18, 0x01, 0x10, 0x00, "Joystick" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x18, 0x01, 0x20, 0x20, "Off" }, - {0x18, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x18, 0x01, 0x40, 0x40, "Off" }, - {0x18, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Sxyreact) - -static struct BurnDIPInfo JskDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x15, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x01, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x15, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Minutes" }, - {0x15, 0x01, 0xc0, 0x80, "3" }, - {0x15, 0x01, 0xc0, 0xc0, "4" }, - {0x15, 0x01, 0xc0, 0x40, "5" }, - {0x15, 0x01, 0xc0, 0x00, "6" }, - - {0 , 0xfe, 0 , 8, "Difficulty A" }, - {0x16, 0x01, 0x07, 0x00, "1 (Novice)" }, - {0x16, 0x01, 0x07, 0x01, "2" }, - {0x16, 0x01, 0x07, 0x02, "3" }, - {0x16, 0x01, 0x07, 0x03, "4" }, - {0x16, 0x01, 0x07, 0x07, "5 (Medium)" }, - {0x16, 0x01, 0x07, 0x06, "6" }, - {0x16, 0x01, 0x07, 0x05, "7" }, - {0x16, 0x01, 0x07, 0x04, "8 (expert)" }, - - {0 , 0xfe, 0 , 2, "Difficulty Switch" }, - {0x16, 0x01, 0x08, 0x08, "A (8 Levels)" }, - {0x16, 0x01, 0x08, 0x00, "B (4 Levels)" }, - - {0 , 0xfe, 0 , 4, "Difficulty B" }, - {0x16, 0x01, 0x30, 0x20, "Easy" }, - {0x16, 0x01, 0x30, 0x30, "Normal" }, - {0x16, 0x01, 0x30, 0x10, "Hard" }, - {0x16, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Campaign" }, - {0x16, 0x01, 0x40, 0x40, "Available" }, - {0x16, 0x01, 0x40, 0x00, "Finished" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Jsk) - -static struct BurnDIPInfo EaglshotDIPList[]= -{ - {0x17, 0xff, 0xff, 0xdf, NULL }, - {0x18, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x17, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x17, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x17, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x17, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x17, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, - {0x17, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x17, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x17, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x17, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x17, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x17, 0x01, 0x0f, 0x05, "Multiple Coin Feature A" }, - {0x17, 0x01, 0x0f, 0x04, "Multiple Coin Feature B" }, - {0x17, 0x01, 0x0f, 0x03, "Multiple Coin Feature C" }, - {0x17, 0x01, 0x0f, 0x02, "Multiple Coin Feature D" }, - {0x17, 0x01, 0x0f, 0x01, "Multiple Coin Feature E" }, - {0x17, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Credits To Start" }, - {0x17, 0x01, 0x10, 0x10, "1" }, - {0x17, 0x01, 0x10, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Controls" }, - {0x17, 0x01, 0x20, 0x20, "Trackball" }, - {0x17, 0x01, 0x20, 0x00, "Joystick" }, - - {0 , 0xfe, 0 , 2, "Trackball Type" }, - {0x17, 0x01, 0x40, 0x40, "24 Counts (USA)" }, - {0x17, 0x01, 0x40, 0x00, "12 Counts (Japan)" }, - - {0 , 0xfe, 0 , 4, "Number Of Holes" }, - {0x18, 0x01, 0x03, 0x02, "2" }, - {0x18, 0x01, 0x03, 0x03, "3" }, - {0x18, 0x01, 0x03, 0x01, "4" }, - {0x18, 0x01, 0x03, 0x00, "5" }, - - {0 , 0xfe, 0 , 3, "Difficulty" }, - {0x18, 0x01, 0x0c, 0x08, "Easy" }, - {0x18, 0x01, 0x0c, 0x0c, "Normal" }, - {0x18, 0x01, 0x0c, 0x04, "Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x18, 0x01, 0x10, 0x00, "Off" }, - {0x18, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x18, 0x01, 0x20, 0x00, "Off" }, - {0x18, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x18, 0x01, 0x40, 0x40, "Off" }, - {0x18, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x18, 0x01, 0x80, 0x80, "Off" }, - {0x18, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Eaglshot) - -static inline void palette_update(INT32 offset) -{ - offset &= 0x1fffc; - - UINT16 *pal = (UINT16*)(DrvPalRAM + offset); - - INT32 r = pal[1] & 0xff; - INT32 g = pal[0] >> 8; - INT32 b = pal[0] & 0xff; - - DrvPalette[offset/4] = BurnHighCol(r,g,b,0); -} - -static INT32 ssv_irq_callback(INT32 /*state*/) -{ - for (INT32 i = 0; i < 8; i++) - { - if (requested_int & (1 << i)) - { - return DrvVectors[i * 0x10] & 7; - } - } - - return 0; -} - -static void update_irq_state() -{ - v60SetIRQLine(0, (requested_int & irq_enable) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void irq_ack_write(UINT8 offset) -{ - INT32 level = (offset & 0x70) >> 4; - - requested_int &= ~(1 << level); - - update_irq_state(); -} - -static void dsp_write(INT32 offset, UINT8 data) -{ - UINT16 *ram = (UINT16*)DrvDspRAM; - - offset = (offset & 0xffe)/2; - - UINT16 temp = ram[offset/2]; - - if (offset & 1) { - temp &= 0xff; - temp |= data << 8; - } else { - temp &= 0xff00; - temp |= data; - } - - ram[offset/2] = temp; -} - -static UINT16 dsp_read(INT32 offset) -{ - UINT16 *ram = (UINT16*)DrvDspRAM; - - offset = (offset & 0xffe)/2; - - UINT16 temp = ram[offset/2]; - - if (offset & 1) { - temp >>= 8; - } else { - temp &= 0xff; - } - - return temp; -} - -static void common_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffff80) == 0x300000) { - ES5506Write((address & 0x7e)/2, data); - return; - } - - if ((address & 0xffe0000) == 0x140000) { - DrvPalRAM[(address & 0x1ffff)] = data; - palette_update(address); - return; - } - - if ((address & 0xffff80) == 0x1c0000) { - DrvScrollRAM[(address & 0x7f)] = data; - return; - } - - if (address >= 0x230000 && address <= 0x230071) { - DrvVectors[(address & 0x7f)] = data; - return; - } - - if (address >= 0x240000 && address <= 0x240071) { - irq_ack_write(address); - return; - } - - if ((address & 0xfff000) == 0x482000) { - dsp_write(address,data); - return; - } - - switch (address) - { - case 0x210000: - case 0x210001: - watchdog = 0; - return; - - case 0x21000e: - case 0x21000f: // lockout 1 & 2, counters 4 & 8 - enable_video = data & 0x80; - return; - - case 0x210010: - case 0x210011: - // nop - return; - - case 0x260000: - case 0x260001: - irq_enable = data; - return; - - case 0x480000: - case 0x480001: - if (dsp_enable) snesdsp_write(true, data); - return; - } -} - -static void common_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffe0000) == 0x140000) { - UINT16 *p = (UINT16*)(DrvPalRAM + (address & 0x1ffff)); - *p = data; - palette_update(address); - return; - } - - if ((address & 0xffff80) == 0x1c0000) { - UINT16 *p = (UINT16*)(DrvScrollRAM + (address & 0x7f)); - *p = data; - return; - } - - if ((address & 0xffff80) == 0x300000) { - ES5506Write((address & 0x7e)/2, data); - return; - } - - if (address >= 0x230000 && address <= 0x230071) { - UINT16 *p = (UINT16*)(DrvVectors + (address & 0x7f)); - *p = data; - return; - } - - if (address >= 0x240000 && address <= 0x240071) { - irq_ack_write(address); - return; - } - - if ((address & 0xfff000) == 0x482000) { - dsp_write(address,data); - return; - } - - switch (address) - { - case 0x210000: - watchdog = 0; - return; - - case 0x21000e: - // lockout 1 & 2, counters 4 & 8 - enable_video = data & 0x80; - return; - - case 0x210010: - // nop - return; - - case 0x260000: - irq_enable = data; - return; - - case 0x480000: - case 0x480001: - if (dsp_enable) snesdsp_write(true, data); - return; - } -} - -static UINT16 common_main_read_word(UINT32 address) -{ - if ((address & 0xfff000) == 0x482000) { - return dsp_read(address); - } - - if ((address & 0xffff80) == 0x300000) { - return ES5506Read((address & 0x7e)/2); - } - - if ((address & 0xffff00) == 0x8c0000) { - return st0020_blitram_read_word(address); - } - - if ((address & 0xffff00) == 0x4f000) { - return 0; // NOP - } - - switch (address & ~1) - { - case 0x1c0000: - if (vbl_invert) { - return (vblank) ? 0 : 0x3000; - } else { - return (vblank) ? 0x3000 : 0; - } - - case 0x1c0002: - return 0; - - case 0x210000: - watchdog = 0; - return 0; - - case 0x210002: - return DrvDips[0]; - - case 0x210004: - return DrvDips[1]; - - case 0x210008: - return DrvInputs[0]; - - case 0x21000a: - return DrvInputs[1]; - - case 0x21000c: - return DrvInputs[2]; - - case 0x21000e: - return 0; - - case 0x210010: // NOP - return 0; - - case 0x480000: - case 0x480001: - if (dsp_enable) return snesdsp_read(true); - return 0; - - case 0x500008: // survarts - return DrvInputs[3]; - - case 0x510000: // drifto94 - case 0x510001: - case 0x520000: - case 0x520001: - return BurnRandom(); - } - - bprintf (0, _T("RW Unmapped: %5.5x\n"), address); - - return 0; -} - -static UINT8 common_main_read_byte(UINT32 address) -{ - if ((address & 0xfff000) == 0x482000) { - return dsp_read(address); - } - - if ((address & 0xffff80) == 0x300000) { - return ES5506Read((address & 0x7e)/2); - } - - switch (address & ~1) - { - case 0x1c0000: - return (vblank) ? 0x3000 : 0; - - case 0x210000: - watchdog = 0; - return 0; - - case 0x210002: - return DrvDips[0]; - - case 0x210004: - return DrvDips[1]; - - case 0x210008: - return DrvInputs[0]; - - case 0x21000a: - return DrvInputs[1]; - - case 0x21000c: - return DrvInputs[2]; - - case 0x21000e: - return 0; - - case 0x480000: - case 0x480001: - if (dsp_enable) return snesdsp_read(true); - return 0; - - case 0x500002: // nop? - case 0x500004: // nop? - return 0; - - case 0x500008: // survarts - return DrvInputs[3]; - - case 0x510000: // drifto94 - case 0x510001: - case 0x520000: - case 0x520001: - return BurnRandom(); - } - - bprintf (0, _T("RB Unmapped: %5.5x\n"), address); - - return 0; -} - -#if 0 -static UINT16 gdfs_eeprom_read() -{ - return (((m_gdfs_lightgun_select & 1) ? 0 : 0xff) ^ m_io_gun[m_gdfs_lightgun_select]->read()) | (EEPROMRead() << 8); -} -#endif - -static void gdfs_eeprom_write(UINT16 data) -{ - EEPROMWriteBit((data & 0x4000) >> 14); - EEPROMSetCSLine((data & 0x1000) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE); - EEPROMSetClockLine((data & 0x2000) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE); - -// if (!(gdfs_eeprom_old & 0x0800) && (data & 0x0800)) // rising clock -// gdfs_lightgun_select = (data & 0x0300) >> 8; -} - -static UINT16 gdfs_read_word(UINT32 address) -{ - if ((address & 0xf00000) == 0x900000) { - return st0020GfxramReadWord(address); - } - - switch (address) - { - case 0x540000: - case 0x540001: // eeprom - return (EEPROMRead() << 8); - } - - return common_main_read_word(address); -} - -static UINT8 gdfs_read_byte(UINT32 address) -{ - if ((address & 0xf00000) == 0x900000) { - return st0020GfxramReadByte(address); - } - - switch (address) - { - case 0x540000: - case 0x540001: // eeprom - return (EEPROMRead() << 0); - } - - return common_main_read_byte(address); -} - -static void gdfs_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffff00) == 0x8c0000) { - st0020_blitram_write_word(address, data); - return; - } - - if ((address & 0xf00000) == 0x900000) { - st0020GfxramWriteWord(address, data); - return; - } - - if ((address & 0xffffc0) == 0x440000) { - *((UINT16*)(DrvTMAPScroll + (address & 0x3f))) = data; - return; - } - - switch (address) - { - case 0x500000: - case 0x500001: - gdfs_eeprom_write(data); - return; - } - - common_main_write_word(address,data); -} - -static void gdfs_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xffff00) == 0x8c0000) { - st0020_blitram_write_byte(address, data); - return; - } - - if ((address & 0xf00000) == 0x900000) { - st0020GfxramWriteByte(address, data); - return; - } - - if ((address & 0xffffc0) == 0x440000) { - bprintf (0, _T("Scroll b: %5.5x, %2.2x\n"), address,data); - DrvTMAPScroll[address & 0x3f] = data; - return; - } - - switch (address) - { - case 0x500000: - case 0x500001: - bprintf (0, _T("EEPROM write %x %x\n"),address,data); - return; - } - - common_main_write_word(address,data); -} - -static UINT16 srmp4_inputs() -{ - for (INT32 i = 0; i < 5; i++) { - if (input_select & (1 << i)) return DrvInputs[i+3]; - } - - return 0xffff; -} - -static void janjan1_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x800000: // janjan1 / janjan2 / koikois2 - case 0x800001: - case 0xc00006: // hypreact - case 0xc00007: - case 0xc0000e: // srmp4 - case 0xc0000f: - input_select = data; - return; - } - - common_main_write_byte(address,data); -} - -static void janjan1_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x800000: // janjan1 / janjan2 / koikois2 - case 0xc00006: // hypreact - case 0xc0000e: // srmp4 - input_select = data & 0xff; - return; - } - - common_main_write_word(address,data); -} - -static UINT8 janjan1_read_byte(UINT32 address) -{ - switch (address) - { - case 0x800002: // janjan1 / janjan2 / koikois2 - case 0x800003: - case 0xc00000: // hypreact - case 0xc00001: - case 0xc0000a: // srmp4 - case 0xc0000b: - return srmp4_inputs(); - } - - return common_main_read_byte(address); -} - -static UINT16 janjan1_read_word(UINT32 address) -{ - switch (address) - { - case 0x800002: // janjan1 / janjan2 / koikois2 - case 0xc00000: // hypreact - case 0xc0000a: // srmp4 - return srmp4_inputs(); - } - - return common_main_read_word(address); -} - - -static void hypreac2_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x520000: - case 0x520001: - input_select = data; - return; - } - - common_main_write_word(address,data); -} - -static void hypreac2_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x520000: - case 0x520001: - input_select = data; - return; - } - - common_main_write_byte(address,data); -} - -static UINT16 hypreac2_read_word(UINT32 address) -{ - switch (address) - { - case 0x500000: - case 0x500001: - case 0x500002: - case 0x500003: - return srmp4_inputs(); - } - - return common_main_read_word(address); -} - -static UINT8 hypreac2_read_byte(UINT32 address) -{ - switch (address) - { - case 0x500000: - case 0x500001: - case 0x500002: - case 0x500003: - return srmp4_inputs(); - } - - return common_main_read_byte(address); -} - -static void sound_bank(INT32 data) -{ - INT32 bank = (data & 1) * (0x400000 / 2); - - for (INT32 v = 0; v < 32; v++) { - es5505_voice_bank_w(v, bank); - } -} - -static void srmp7_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x21000e: - case 0x21000f: - // lockout - return; - - case 0x580000: - case 0x580001: - sound_bank(data); - return; - - case 0x680000: - case 0x680001: - input_select = data; - return; - } - - common_main_write_word(address,data); -} - -static void srmp7_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x21000e: - case 0x21000f: - // lockout - return; - - case 0x580000: - case 0x580001: - sound_bank(data); - return; - - case 0x680000: - case 0x680001: - input_select = data; - return; - } - - common_main_write_byte(address,data); -} - -static UINT16 srmp7_read_word(UINT32 address) -{ - switch (address) - { - case 0x300076: - case 0x300077: - return 0x0080; - - case 0x600000: - case 0x600001: - return srmp4_inputs(); - } - - return common_main_read_word(address); -} - -static UINT8 srmp7_read_byte(UINT32 address) -{ - switch (address) - { - case 0x300076: - case 0x300077: - return 0x0080; - - case 0x600000: - case 0x600001: - return srmp4_inputs(); - } - - return common_main_read_byte(address); -} - -static void sxyreact_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x21000e: - case 0x21000f: - // lockout - return; - - case 0x500004: - case 0x500005: - // motor - return; - - case 0x520000: - case 0x520001: - { - if ((data & 0x20) == 0x20) - sexyreact_serial_read = 0; // analog port for paddle - - if ((data & 0x40) == 0x00 && (sexyreact_previous_dial & 0x40) == 0x40) - sexyreact_serial_read<<=1; - - sexyreact_previous_dial = data; - } - return; - } - - common_main_write_word(address,data); -} - -static void sxyreact_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x21000e: - case 0x21000f: - // lockout - return; - - case 0x500004: - case 0x500005: - // motor - return; - - case 0x520000: - case 0x520001: - { - if ((data & 0x20) == 0x20) - sexyreact_serial_read = 0; // analog port for paddle - - if ((data & 0x40) == 0x00 && (sexyreact_previous_dial & 0x40) == 0x40) - sexyreact_serial_read<<=1; - - sexyreact_previous_dial = data; - } - return; - } - - common_main_write_byte(address,data); -} - -static UINT16 sxyreact_read_word(UINT32 address) -{ - switch (address) - { - case 0x500002: // ballswitch - case 0x500003: - return DrvInputs[3]; - - case 0x500004: - case 0x500005: - return ((sexyreact_serial_read >> 1) & 0x80); - } - - return common_main_read_word(address); -} - -static UINT8 sxyreact_read_byte(UINT32 address) -{ - switch (address) - { - case 0x500002: // ballswitch - case 0x500003: - return DrvInputs[3]; - - case 0x500004: - case 0x500005: - return ((sexyreact_serial_read >> 1) & 0x80); - } - - return common_main_read_byte(address); -} - -static void eaglshot_gfxram_bank(INT32 data) -{ - INT32 bank = ((data & 0x0f) * 0x40000); - - eaglshot_bank[0] = data; - - v60MapMemory(DrvGfxROM + bank, 0x180000, 0x1bffff, MAP_RAM); -} - -static void eaglshot_gfxrom_bank(INT32 data) -{ - INT32 bank = ((data < 6) ? data : 6) * 0x200000; - - eaglshot_bank[1] = data; - - v60MapMemory(DrvGfxROM2 + bank, 0xa00000, 0xbfffff, MAP_ROM); -} - -static UINT16 eaglshot_trackball_read() -{ - switch (input_select) - { - case 0x60: return (0/*m_io_trackx->read()*/ >> 8) & 0xff; - case 0x40: return (0/*m_io_trackx->read()*/ >> 0) & 0xff; - - case 0x70: return (0/*m_io_tracky->read()*/ >> 8) & 0xff; - case 0x50: return (0/*m_io_tracky->read()*/ >> 0) & 0xff; - } - - return 0; -} - -static void eaglshot_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x1c0076: - case 0x1c0077: - eaglshot_gfxram_bank(data); - *((UINT16*)(DrvScrollRAM + 0x76)) = data; - return; - - case 0x21000e: - case 0x21000f: - // lockout - return; - - case 0x800000: - case 0x800001: - eaglshot_gfxrom_bank(data); - return; - - case 0x900000: - case 0x900001: - input_select = data; - return; - } - - common_main_write_word(address,data); -} - -static void eaglshot_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x1c0076: - case 0x1c0077: - eaglshot_gfxram_bank(data); - DrvScrollRAM[(address & 0x7f)] = data; - return; - - case 0x21000e: - case 0x21000f: - // lockout - return; - - case 0x800000: - case 0x800001: - eaglshot_gfxrom_bank(data); - return; - - case 0x900000: - case 0x900001: - input_select = data; - return; - } - - common_main_write_byte(address,data); -} - -static UINT16 eaglshot_read_word(UINT32 address) -{ - switch (address) - { - case 0xd00000: - case 0xd00001: - return eaglshot_trackball_read(); - } - - return common_main_read_word(address); -} - -static UINT8 eaglshot_read_byte(UINT32 address) -{ - switch (address) - { - case 0xd00000: - case 0xd00001: - return eaglshot_trackball_read(); - } - - return common_main_read_byte(address); -} - - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - v60Open(0); - v60Reset(); - v60Close(); - - ES5506Reset(); - - if (is_gdfs) EEPROMReset(); - - requested_int = 0; - enable_video = 1; - irq_enable = 0; - input_select = 0; - sexyreact_previous_dial = 0; - sexyreact_serial_read = 0; - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvV60ROM = Next; Next += 0x0400000; - DrvDSPROM = Next; Next += 0x0011000; - - if (is_gdfs) - { - st0020GfxROM = Next; Next += st0020GfxROMLen; - } - - DrvGfxROM2 = Next; Next += nDrvGfxROM2Len; // gdfs / eaglshot - DrvGfxROM = Next; Next += nDrvGfxROMLen; - - DrvSndROM0 = Next; Next += nDrvSndROMLen[0]; - DrvSndROM1 = Next; Next += nDrvSndROMLen[1]; - DrvSndROM2 = Next; Next += nDrvSndROMLen[2]; - DrvSndROM3 = Next; Next += nDrvSndROMLen[3]; - - DrvPalette = (UINT32*)Next; Next += 0x8000 * sizeof(UINT32); - - DrvNVRAM = Next; Next += 0x010000; - - AllRam = Next; - - // gdfs - if (is_gdfs) - { - st0020BlitRAM = Next; Next += 0x000100; - st0020SprRAM = Next; Next += 0x080000; - st0020GfxRAM = Next; Next += 0x400000; - DrvTMAPRAM = Next; Next += 0x040000; - DrvTMAPScroll = Next; Next += 0x000040; - } - - DrvV60RAM0 = Next; Next += 0x010000; - DrvV60RAM1 = Next; Next += 0x020000; - DrvV60RAM2 = Next; Next += 0x050000; - DrvSprRAM = Next; Next += 0x040000; - DrvPalRAM = Next; Next += 0x020000; - DrvDspRAM = Next; Next += 0x001000; - - DrvVectors = Next; Next += 0x000080; - DrvScrollRAM = Next; Next += 0x000080; - - eaglshot_bank = Next; Next += 0x000002; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void st010Expand(INT32 rom_offset) -{ - dsp_enable = 1; - - UINT8 *dspsrc = (UINT8*)BurnMalloc(0x11000); - UINT32 *dspprg = (UINT32 *)DrvDSPROM; - UINT16 *dspdata = (UINT16*)(DrvDSPROM + 0x10000); - - BurnLoadRom(dspsrc, rom_offset, 1); - - memset (DrvDSPROM, 0xff, 0x11000); - - // copy DSP program - for (int i = 0; i < 0x10000; i+= 4) - { - *dspprg = dspsrc[0+i]<<24 | dspsrc[1+i]<<16 | dspsrc[2+i]<<8; - dspprg++; - } - - // copy DSP data - for (int i = 0; i < 0x1000; i+= 2) - { - *dspdata++ = dspsrc[0x10000+i]<<8 | dspsrc[0x10001+i]; - } - - BurnFree(dspsrc); -} - -static void DrvMemSwap(UINT8 *src0, UINT8 *src1, INT32 len) -{ - for (INT32 i = 0; i < len; i++ ) { - INT32 t = src0[i]; - src0[i] = src1[i]; - src1[i] = t; - } -} - -static void DrvComputeTileCode(INT32 version) -{ - if (version) - { - for (INT32 i = 0; i < 16; i++) { - tile_code[i] = (i << 16); - } - } - else - { - for (INT32 i = 0; i < 16; i++) { - tile_code[i] = ((i & 8) << 13) | ((i & 4) << 15) | ((i & 2) << 17) | ((i & 1) << 19); - } - } -} - -static void gfxdecode(UINT8 *src, UINT8 *dst, INT32 ofst, INT32 len) -{ - INT32 plane = ofst / (nDrvGfxROMLen / 4); - INT32 offset = ofst % (nDrvGfxROMLen / 4); - - for (INT32 i = offset * 8; i < (offset + len) * 8; i++) - { - INT32 d = (src[(i / 8) - offset] >> (i & 7)) & 1; - - dst[(7 - (i & 7)) | ((i & ~0xf) >> 1)] |= d << (((i & 8) >> 3) | (plane << 1)); - } -} - -static INT32 DrvGetRoms(bool bLoad) -{ - char* pRomName; - struct BurnRomInfo ri; - - UINT8 *V60Load = DrvV60ROM; - UINT8 *GfxLoad = DrvGfxROM; - UINT8 *GfxLoad2 = DrvGfxROM2; - UINT8 *SNDLoad[4] = { DrvSndROM0, DrvSndROM1, DrvSndROM2, DrvSndROM3 }; - - INT32 gfxrom_count = 0; - INT32 prev_type = 0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) - { - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 1) { - if (bLoad) BurnLoadRom(V60Load, i, 1); - V60Load += ri.nLen; - prev_type = 1; - continue; - } - - if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 2) { - if (bLoad) { - BurnLoadRom(V60Load + 0, i+0, 2); - BurnLoadRom(V60Load + 1, i+1, 2); - - if (prev_type == 1 && ri.nLen == 0x80000) { - memcpy (V60Load + 0x100000, V60Load, 0x100000); - } - } - - if (prev_type == 1 && ri.nLen == 0x80000) V60Load += 0x100000; - V60Load += ri.nLen * 2; - prev_type = 2; - i++; - continue; - } - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 3) { - if (bLoad) { - UINT8 *tmp = (UINT8*)BurnMalloc(ri.nLen); - if (BurnLoadRom(tmp, i, 1)) return 1; - gfxdecode(tmp, DrvGfxROM, GfxLoad - DrvGfxROM, ri.nLen); - BurnFree(tmp); - } - - GfxLoad += ri.nLen; - gfxrom_count++; - continue; - } - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 8) { - if (bLoad) BurnLoadRom(GfxLoad2, i, 1); - GfxLoad2 += ri.nLen; - continue; - } - - if ((ri.nType & BRF_SND) && (ri.nType & 0x1c) == 0) { - if (bLoad) BurnLoadRom(SNDLoad[ri.nType & 3] + 1, i, 2); - SNDLoad[ri.nType & 3] += ri.nLen * 2; - continue; - } - - if ((ri.nType & BRF_SND) && (ri.nType & 0x1c) == 4) { - if (bLoad) BurnLoadRom(SNDLoad[ri.nType & 3], i, 1); - SNDLoad[ri.nType & 3] += ri.nLen; - continue; - } - } - - if (bLoad == false) - { - // get gfx rom length and then make sure it can be - // decoded as 8 bpp. - nDrvGfxROMLen = GfxLoad - DrvGfxROM; - if (nDrvGfxROMLen == 0) nDrvGfxROMLen = 0x400000; - - INT32 div = (gfxrom_count & 3) ? 3 : 4; - nDrvGfxROMLen = (nDrvGfxROMLen / div) * 4; - - // get gfx 2 rom length and make sure it can be - // masked properly - nDrvGfxROM2Len = GfxLoad2 - DrvGfxROM2; - for (INT32 i = 1; i < 0x8000000; i<<=1) { - if (nDrvGfxROM2Len <= (1 << i)) { - nDrvGfxROM2Len = 1 << i; - break; - } - } - - nDrvSndROMLen[0] = SNDLoad[0] - DrvSndROM0; - nDrvSndROMLen[1] = SNDLoad[1] - DrvSndROM1; - nDrvSndROMLen[2] = SNDLoad[2] - DrvSndROM2; - nDrvSndROMLen[3] = SNDLoad[3] - DrvSndROM3; - if (nDrvSndROMLen[0] && nDrvSndROMLen[0] < 0x400000) nDrvSndROMLen[0] = 0x400000; - if (nDrvSndROMLen[1] && nDrvSndROMLen[1] < 0x400000) nDrvSndROMLen[1] = 0x400000; - if (nDrvSndROMLen[2] && nDrvSndROMLen[2] < 0x400000) nDrvSndROMLen[2] = 0x400000; - if (nDrvSndROMLen[3] && nDrvSndROMLen[3] < 0x400000) nDrvSndROMLen[3] = 0x400000; - } - - return 0; -} - -static INT32 DrvCommonInit(void (*pV60Callback)(), void (*pRomLoadCallback)(), INT32 compute, INT32 s0, INT32 s1, INT32 s2, INT32 s3, double volume, INT32 funky_vbl) -{ - DrvGetRoms(false); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - DrvGetRoms(true); - - if (pRomLoadCallback) { - pRomLoadCallback(); - } - - v60Init(); - v60Open(0); - pV60Callback(); - v60SetIRQCallback(ssv_irq_callback); - v60Close(); - - upd96050Init(96050, DrvDSPROM, DrvDSPROM + 0x10000, DrvDspRAM, NULL, NULL); - - UINT8 *snd[5] = { NULL, DrvSndROM0, DrvSndROM1, DrvSndROM2, DrvSndROM3 }; - - ES5506Init(16000000, snd[s0+1], snd[s1+1], snd[s2+1], snd[s3+1], /*IRQCallback*/NULL); - ES5506SetRoute(0, volume, BURN_SND_ES5506_ROUTE_BOTH); - - DrvComputeTileCode(compute); - - GenericTilesInit(); - - vbl_kludge = funky_vbl; - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - v60Exit(); - - ES5506Exit(); - - BurnFree(AllMem); - - if (is_gdfs) EEPROMExit(); - - interrupt_ultrax = 0; - watchdog_disable = 0; - is_gdfs = 0; - dsp_enable = 0; - vbl_kludge = 0; - vbl_invert = 0; - - return 0; -} - -static void DrvPaletteInit() -{ - UINT16 *pal = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x20000/2; i+=2) - { - INT32 r = pal[i+1] & 0xff; - INT32 g = pal[i+0] >> 8; - INT32 b = pal[i+0] & 0xff; - - DrvPalette[i/2] = BurnHighCol(r,g,b,0); - } -} - -static void drawgfx(INT32 gfx, UINT32 code, UINT32 color, int flipx, int flipy, int x0, int y0, int shadow) -{ - const UINT8 *addr, *source; - UINT8 pen; - UINT16 *dest; - int sx, x1, dx; - int sy, y1, dy; - int penmask = gfx-1; - - addr = DrvGfxROM + ((code * 16 * 8) % nDrvGfxROMLen); - color = (color * 0x40) & 0x7fc0; - - if ( flipx ) { x1 = x0-1; x0 += 16-1; dx = -1; } - else { x1 = x0 + 16; dx = 1; } - - if ( flipy ) { y1 = y0-1; y0 += 8-1; dy = -1; } - else { y1 = y0 + 8; dy = 1; } - -#define SSV_DRAWGFX(SETPIXELCOLOR) \ - for ( sy = y0; sy != y1; sy += dy ) \ - { \ - if ( sy >= Gclip_min_y && sy <= Gclip_max_y ) \ - { \ - source = addr; \ - dest = pTransDraw + (sy * nScreenWidth); \ - \ - for ( sx = x0; sx != x1; sx += dx ) \ - { \ - pen = (*source++) & penmask; \ - \ - if ( pen && sx >= Gclip_min_y && sx <= Gclip_max_x ) \ - SETPIXELCOLOR \ - } \ - } \ - \ - addr += 16; \ - } - - if (shadow) - { - SSV_DRAWGFX( { dest[sx] = ((dest[sx] & shadow_pen_mask) | (pen << shadow_pen_shift)) & 0x7fff; } ) - } - else - { - SSV_DRAWGFX( { dest[sx] = (color + pen) & 0x7fff; } ) - } -} - -static void draw_row(int sx, int sy, int scroll) -{ - UINT16 *ssv_scroll = (UINT16*)DrvScrollRAM; - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - - int attr, code, color, mode, size, page, shadow; - int x, x1, sx1, flipx, xnum, xstart, xend, xinc; - int y, y1, sy1, flipy, ynum, ystart, yend, yinc; - UINT16 *s3; - - INT32 clip_min_x = Gclip_min_x; - INT32 clip_max_x = Gclip_max_x; - INT32 clip_min_y = Gclip_min_y; - INT32 clip_max_y = Gclip_max_y; - - xnum = 0x20; // width in tiles (screen-wide) - ynum = 0x8; // height in tiles (always 64 pixels?) - - scroll &= 0x7; // scroll register index - - /* Sign extend the position */ - sx = 0; - sy = (sy & 0x1ff) - (sy & 0x200); - - /* Set up a clipping region for the tilemap slice .. */ - int clip[4] = { Gclip_min_x, Gclip_max_x, Gclip_min_y, Gclip_max_y }; -// clip.set(sx, sx + xnum * 0x10 - 1, sy, sy + ynum * 0x8 - 1); - - clip_min_x = sx; - clip_max_x = sx + xnum * 0x10 - 1; - clip_min_y = sy; - clip_max_y = sy + ynum * 0x8 - 1; - - /* .. and clip it against the visible screen */ - if (clip_min_x >= nScreenWidth) return; - if (clip_min_y >= nScreenHeight) return; - if (clip_max_x < 0) return; - if (clip_max_y < 0) return; - - if (clip_min_x < 0) clip_min_x = 0; - if (clip_max_x >= nScreenWidth) clip_max_x = nScreenWidth - 1; - if (clip_min_y < 0) clip_min_y = 0; - if (clip_max_y >= nScreenHeight) clip_max_y = nScreenHeight - 1; - - /* Get the scroll data */ - x = ssv_scroll[ scroll * 4 + 0 ]; // x scroll - y = ssv_scroll[ scroll * 4 + 1 ]; // y scroll - // ssv_scroll[ scroll * 4 + 2 ]; // ??? - mode = ssv_scroll[ scroll * 4 + 3 ]; // layer disabled, shadow, depth etc. - - /* Background layer disabled */ - if ((mode & 0xe000) == 0) - return; - -#if 0 // iq_132 - Gclip_min_x = clip_min_x; - Gclip_min_y = clip_min_y; - Gclip_max_x = clip_max_x; - Gclip_max_y = clip_max_y; -#endif - - shadow = (mode & 0x0800); - - /* Decide the actual size of the tilemap */ - size = 1 << (8 + ((mode & 0xe000) >> 13)); - page = (x & 0x7fff) / size; - - /* Given a fixed scroll value, the portion of tilemap displayed changes with the sprite position */ - x += sx; - y += sy; - - /* Tweak the scroll values */ - y += ((ssv_scroll[0x70/2] & 0x1ff) - (ssv_scroll[0x70/2] & 0x200) + ssv_scroll[0x6a/2] + 2); - - // Kludge for eaglshot - if ((ssv_scroll[ scroll * 4 + 2 ] & 0x05ff) == 0x0440) x += -0x10; - if ((ssv_scroll[ scroll * 4 + 2 ] & 0x05ff) == 0x0401) x += -0x20; - - /* Draw the rows */ - x1 = x; - y1 = y; - sx1 = sx - (x & 0xf); - sy1 = sy - (y & 0xf); - - for (sx=sx1,x=x1; sx <= clip_max_x; sx+=0x10,x+=0x10) - { - for (sy=sy1,y=y1; sy <= clip_max_y; sy+=0x10,y+=0x10) - { - int tx, ty, gfx; - - s3 = &spriteram16[page * (size * 4) + ((x & ((size -1) & ~0xf)) << 2) + ((y & (0x1ff & ~0xf)) >> 3)]; - - code = s3[0]; // code high bits - attr = s3[1]; // code low bits + color - - /* Code's high bits are scrambled */ - code += tile_code[(attr & 0x3c00)>>10]; - flipy = (attr & 0x4000); - flipx = (attr & 0x8000); - - if ((ssv_scroll[0x74/2] & 0x1000) && ((ssv_scroll[0x74/2] & 0x2000) == 0)) - { - if (flipx == 0) flipx = 1; else flipx = 0; - } - - if ((ssv_scroll[0x74/2] & 0x4000) && ((ssv_scroll[0x74/2] & 0x2000) == 0)) - { - if (flipy == 0) flipy = 1; else flipy = 0; - } - - color = attr; - - /* Select 256 or 64 color tiles */ - gfx = ((mode & 0x0100) ? 0x100 : 0x40); - - /* Force 16x16 tiles ? */ - if (flipx) { xstart = 1-1; xend = -1; xinc = -1; } - else { xstart = 0; xend = 1; xinc = +1; } - - if (flipy) { ystart = 2-1; yend = -1; yinc = -1; } - else { ystart = 0; yend = 2; yinc = +1; } - - /* Draw a tile (16x16) */ - for (tx = xstart; tx != xend; tx += xinc) - { - for (ty = ystart; ty != yend; ty += yinc) - { - drawgfx(gfx, code++, color, flipx, flipy, (sx + tx * 16), (sy + ty * 8), shadow); - } /* ty */ - } /* tx */ - - } /* sy */ - } /* sx */ - - Gclip_min_x = clip[0]; - Gclip_min_y = clip[2]; - Gclip_max_x = clip[1]; - Gclip_max_y = clip[3]; -} - -static void draw_layer(int nr) -{ - for (INT32 sy = 0; sy < nScreenHeight; sy += 0x40) - if (nBurnLayer & 4) draw_row(0, sy, nr); -} - -static void draw_sprites() -{ - /* Sprites list */ - UINT16 *ssv_scroll = (UINT16*)DrvScrollRAM; - UINT16 *spriteram16 = (UINT16*)DrvSprRAM; - - UINT16 *s1 = spriteram16; - UINT16 *end1 = spriteram16 + 0x02000/2; - UINT16 *end2 = spriteram16 + 0x40000/2; - UINT16 *s2; - - for ( ; s1 < end1; s1+=4 ) - { - INT32 attr, code, color, num, sprite; - INT32 sx, x, xoffs, flipx, xnum, xstart, xend, xinc, sprites_offsx; - INT32 sy, y, yoffs, flipy, ynum, ystart, yend, yinc, sprites_offsy, tilemaps_offsy; - INT32 mode,global_depth,global_xnum,global_ynum; - - mode = s1[ 0 ]; - sprite = s1[ 1 ]; - xoffs = s1[ 2 ]; - yoffs = s1[ 3 ]; - - /* Last sprite */ - if (sprite & 0x8000) break; - - /* Single-sprite address */ - s2 = &spriteram16[ (sprite & 0x7fff) * 4 ]; - tilemaps_offsy = ((s2[3] & 0x1ff) - (s2[3] & 0x200)); - - /* Every single sprite is offset by x & yoffs, and additionally - by one of the 8 x & y offsets in the 1c0040-1c005f area */ - - xoffs += ssv_scroll[((mode & 0x00e0) >> 4) + 0x40/2]; - yoffs += ssv_scroll[((mode & 0x00e0) >> 4) + 0x42/2]; - - /* Number of single-sprites (1-32) */ - num = (mode & 0x001f) + 1; - global_ynum = (mode & 0x0300) << 2; - global_xnum = (mode & 0x0c00); - global_depth = (mode & 0xf000); - - for( ; num > 0; num--,s2+=4 ) - { - INT32 depth, local_depth, local_xnum, local_ynum; - - if (s2 >= end2) break; - - sx = s2[ 2 ]; - sy = s2[ 3 ]; - - local_depth = sx & 0xf000; - local_xnum = sx & 0x0c00; - local_ynum = sy & 0x0c00; - - if (ssv_scroll[0x76/2] & 0x4000) - { - xnum = local_xnum; - ynum = local_ynum; - depth = local_depth; - } - else - { - xnum = global_xnum; - ynum = global_ynum; - depth = global_depth; - } - - if ( s2[0] <= 7 && s2[1] == 0 && xnum == 0 && ynum == 0x0c00) - { - INT32 scroll = s2[ 0 ]; // scroll index - - if (ssv_scroll[0x76/2] & 0x1000) - sy -= 0x20; // eaglshot - else - { - if (ssv_scroll[0x7a/2] & 0x0800) - { - if (ssv_scroll[0x7a/2] & 0x1000) // drifto94, dynagear, keithlcy, mslider, stmblade, gdfs, ultrax, twineag2 - sy -= tilemaps_offsy; - else // srmp4 - sy += tilemaps_offsy; - } - } - - if ((mode & 0x001f) != 0) - if (nBurnLayer & 2) draw_row(sx, sy, scroll); - } - else - { - INT32 shadow, gfx; - if (s2 >= end2) break; - - code = s2[0]; // code high bits - attr = s2[1]; // code low bits + color - - /* Code's high bits are scrambled */ - code += tile_code[(attr & 0x3c00)>>10]; - flipy = (attr & 0x4000); - flipx = (attr & 0x8000); - - if ((ssv_scroll[0x74/2] & 0x1000) && ((ssv_scroll[0x74/2] & 0x2000) == 0)) - { - if (flipx == 0) flipx = 1; else flipx = 0; - } - if ((ssv_scroll[0x74/2] & 0x4000) && ((ssv_scroll[0x74/2] & 0x2000) == 0)) - { - if (flipy == 0) flipy = 1; else flipy = 0; - } - - color = attr; - - /* Select 256 or 64 color tiles */ - gfx = ((depth & 0x1000) ? 0x100 : 0x40); - shadow = (depth & 0x8000); - - /* Single-sprite tile size */ - xnum = 1 << (xnum >> 10); // 1, 2, 4 or 8 tiles - ynum = 1 << (ynum >> 10); // 1, 2, 4 tiles (8 means tilemap sprite?) - - if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; } - else { xstart = 0; xend = xnum; xinc = +1; } - - if (flipy) { ystart = ynum-1; yend = -1; yinc = -1; } - else { ystart = 0; yend = ynum; yinc = +1; } - - /* Apply global offsets */ - sx += xoffs; - sy += yoffs; - - /* Sign extend the position */ - sx = (sx & 0x1ff) - (sx & 0x200); - sy = (sy & 0x1ff) - (sy & 0x200); - - sprites_offsx = ((ssv_scroll[0x74/2] & 0x7f) - (ssv_scroll[0x74/2] & 0x80)); - - sprites_offsy = -((ssv_scroll[0x70/2] & 0x1ff) - (ssv_scroll[0x70/2] & 0x200) + ssv_scroll[0x6a/2] + 1); - - if (ssv_scroll[0x74/2] & 0x4000) // flipscreen y - { - sy = -sy; - if (ssv_scroll[0x74/2] & 0x8000) - sy += 0x00; // - else - sy -= 0x10; // vasara (hack) - } - - if (ssv_scroll[0x74/2] & 0x1000) // flipscreen x - { - sx = -sx + 0x100; - } - - if (ssv_scroll[0x7a/2] == 0x7140) - { - // srmp7 - sx = sprites_offsx + sx; - sy = sprites_offsy - sy; - } - else if (ssv_scroll[0x7a/2] & 0x0800) - { - // dynagear, drifto94, eaglshot, keithlcy, mslider, srmp4, stmblade, twineag2, ultrax - sx = sprites_offsx + sx - (xnum * 8) ; - sy = sprites_offsy - sy - (ynum * 8) / 2; - } - else - { - // hypreact, hypreac2, janjans1, meosism, ryorioh, survarts, sxyreact, sxyreac2, vasara, vasara2 - sx = sprites_offsx + sx; - sy = sprites_offsy - sy - (ynum * 8); - } - - if (xnum == 2 && ynum == 4) // needed by hypreact - { - code &= ~7; - } - - for (x = xstart; x != xend; x += xinc) - { - for (y = ystart; y != yend; y += yinc) - { - if (nBurnLayer & 1) drawgfx(gfx, code++, color, flipx, flipy, sx + x * 16, sy + y * 8, shadow ); - } - } - } - } - } -} - -static void gdfs_draw_layer() -{ - UINT16 *ram = (UINT16*)DrvTMAPRAM; - UINT16 *sram = (UINT16*)DrvTMAPScroll; - - INT32 scrollx = sram[0x0c/2] & 0xfff; - INT32 scrolly = sram[0x10/2] & 0xfff; - - INT32 yy = scrolly & 0xf; - INT32 xx = scrollx & 0xf; - - for (INT32 y = 0; y < (240 + 16); y+= 16) - { - INT32 sy = ((scrolly + y) & 0xff0) * 0x10; - - for (INT32 x = 0; x < (336 + 16); x+=16) - { - INT32 offs = (((scrollx + x) & 0xff0) / 0x10) + sy; - - INT32 attr = ram[offs]; - INT32 code = attr & 0x3fff; - INT32 color = 0; - INT32 flipx = attr & 0x8000; - INT32 flipy = attr & 0x4000; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x - xx, y - yy, color, 8, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x - xx, y - yy, color, 8, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x - xx, y - yy, color, 8, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, x - xx, y - yy, color, 8, 0, 0, DrvGfxROM2); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (enable_video) - { - UINT16 *scroll = (UINT16*)DrvScrollRAM; - - // Shadow - if (scroll[0x76/2] & 0x0080) // 4 bit shadows (mslider, stmblade) - { - shadow_pen_shift = 11; - } - else // 2 bit shadows - { - shadow_pen_shift = 13; - } - - shadow_pen_mask = (1 << shadow_pen_shift) - 1; - - // used by twineag2 and ultrax - Gclip_min_x = ((nScreenWidth / 2) + scroll[0x62/2]) * 2 - scroll[0x64/2] * 2 + 2; - Gclip_max_x = ((nScreenWidth / 2) + scroll[0x62/2]) * 2 - scroll[0x62/2] * 2 + 1; - Gclip_min_y = (nScreenHeight + scroll[0x6a/2]) - scroll[0x6c/2] + 1; - Gclip_max_y = (nScreenHeight + scroll[0x6a/2]) - scroll[0x6a/2] ; - - if (Gclip_min_x < 0) Gclip_min_x = 0; - if (Gclip_min_y < 0) Gclip_min_y = 0; - if (Gclip_max_x >= nScreenWidth) Gclip_max_x = nScreenWidth - 1; - if (Gclip_max_y >= nScreenHeight) Gclip_max_y = nScreenHeight - 1; - - if (Gclip_min_x > Gclip_max_x) Gclip_min_x = Gclip_max_x; - if (Gclip_min_y > Gclip_max_y) Gclip_min_y = Gclip_max_y; - -#if 1 - // iq_132 - Gclip_min_x = 0; - Gclip_max_x = nScreenWidth - 1; - Gclip_min_y = 0; - Gclip_max_y = nScreenHeight - 1; -#endif - draw_layer(0); - draw_sprites(); - } - - if (is_gdfs) - { - if (nSpriteEnable & 1) st0020Draw(); - if (nSpriteEnable & 2) gdfs_draw_layer(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180 && watchdog_disable == 0) { - bprintf(0, _T("Watchdog tripped.\n")); - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 8); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - DrvInputs[5] ^= (DrvJoy6[i] & 1) << i; - DrvInputs[6] ^= (DrvJoy7[i] & 1) << i; - DrvInputs[7] ^= (DrvJoy8[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[2] = { (16000000 * 100) / 6018, (10000000 * 100) / 6018 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSegment = 0; - - v60Open(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += v60Run(nSegment); - - if (dsp_enable) - nCyclesDone[1] += upd96050Run(nCyclesTotal[1] / nInterleave); - - if (i == 0 && interrupt_ultrax) { - requested_int |= 1 << 1; - update_irq_state(); - } - - if ((i & 0x3f) == 0 && is_gdfs) { - requested_int |= 1 << 6; - update_irq_state(); - } - - if (i == ((vbl_kludge) ? (nInterleave-1) : 240)) { - vblank = 1; - requested_int |= 1 << 3; - update_irq_state(); - } - } - - v60Close(); - - if (pBurnSoundOut) { - ES5506Update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - v60Scan(nAction); - - ES5506Scan(nAction,pnMin); - if (dsp_enable) upd96050Scan(nAction); - - SCAN_VAR(requested_int); - SCAN_VAR(enable_video); - SCAN_VAR(irq_enable); - SCAN_VAR(input_select); - SCAN_VAR(sexyreact_previous_dial); - SCAN_VAR(sexyreact_serial_read); - - if (is_gdfs) EEPROMScan(nAction, pnMin); - - BurnRandomScan(nAction); - } - - return 0; -} - -static INT32 eaglshtScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - ba.Data = DrvGfxROM; - ba.nLen = 0x400000; - ba.szName = "Gfx Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_WRITE) - { - v60Open(0); - eaglshot_gfxram_bank(eaglshot_bank[0]); - eaglshot_gfxram_bank(eaglshot_bank[1]); - v60Close(); - } - - return DrvScan(nAction,pnMin); -} - - -// Vasara - -static struct BurnRomInfo vasaraRomDesc[] = { - { "data.u34", 0x200000, 0x7704cc7e, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "prg-l.u30", 0x080000, 0xf0547886, 2 | BRF_PRG | BRF_ESS }, // 1 - { "prg-h.u31", 0x080000, 0x6a39bba9, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "a0.u1", 0x800000, 0x673230a6, 3 | BRF_GRA }, // 3 Graphics - { "b0.u2", 0x800000, 0x31a2da7f, 3 | BRF_GRA }, // 4 - { "c0.u3", 0x800000, 0xd110dacf, 3 | BRF_GRA }, // 5 - { "d0.u4", 0x800000, 0x82d0ca55, 3 | BRF_GRA }, // 6 - - { "s0.u36", 0x200000, 0x754fca02, 0 | BRF_SND }, // 7 Ensoniq samples 0 - - { "s1.u37", 0x200000, 0x5f303698, 1 | BRF_SND }, // 8 Ensoniq samples 1 -}; - -STD_ROM_PICK(vasara) -STD_ROM_FN(vasara) - -static void VasaraV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xc00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); -} - -static INT32 VasaraInit() -{ - return DrvCommonInit(VasaraV60Map, NULL, 0, 0, 1, -1, -1, 0.80, 1); -} - -struct BurnDriver BurnDrvVasara = { - "vasara", NULL, NULL, NULL, "2000", - "Vasara\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA_SSV, GBF_VERSHOOT, 0, - NULL, vasaraRomInfo, vasaraRomName, NULL, NULL, VasaraInputInfo, VasaraDIPInfo, - VasaraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 240, 336, 3, 4 -}; - - -// Vasara 2 (set 1) - -static struct BurnRomInfo vasara2RomDesc[] = { - { "data.u34", 0x200000, 0x493d0103, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "prg-l.u30", 0x080000, 0x40e6f5f6, 2 | BRF_PRG | BRF_ESS }, // 1 - { "prg-h.u31", 0x080000, 0xc958e146, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "a0.u1", 0x800000, 0xa6306c75, 3 | BRF_GRA }, // 3 Graphics - { "b0.u2", 0x800000, 0x227cbd9f, 3 | BRF_GRA }, // 4 - { "c0.u3", 0x800000, 0x54ede017, 3 | BRF_GRA }, // 5 - { "d0.u4", 0x800000, 0x4be8479d, 3 | BRF_GRA }, // 6 - - { "s0.u36", 0x200000, 0x2b381b33, 0 | BRF_SND }, // 7 Ensoniq samples 0 - - { "s1.u37", 0x200000, 0x11cd7098, 1 | BRF_SND }, // 8 Ensoniq samples 1 -}; - -STD_ROM_PICK(vasara2) -STD_ROM_FN(vasara2) - -struct BurnDriver BurnDrvVasara2 = { - "vasara2", NULL, NULL, NULL, "2001", - "Vasara 2 (set 1)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA_SSV, GBF_VERSHOOT, 0, - NULL, vasara2RomInfo, vasara2RomName, NULL, NULL, VasaraInputInfo, Vasara2DIPInfo, - VasaraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 240, 336, 3, 4 -}; - - -// Vasara 2 (set 2) - -static struct BurnRomInfo vasara2aRomDesc[] = { - { "data.u34", 0x200000, 0x493d0103, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "basara-l.u30", 0x080000, 0xfd88b068, 2 | BRF_PRG | BRF_ESS }, // 1 - { "basara-h.u31", 0x080000, 0x91d641e6, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "a0.u1", 0x800000, 0xa6306c75, 3 | BRF_GRA }, // 3 Graphics - { "b0.u2", 0x800000, 0x227cbd9f, 3 | BRF_GRA }, // 4 - { "c0.u3", 0x800000, 0x54ede017, 3 | BRF_GRA }, // 5 - { "d0.u4", 0x800000, 0x4be8479d, 3 | BRF_GRA }, // 6 - - { "s0.u36", 0x200000, 0x2b381b33, 0 | BRF_SND }, // 7 Ensoniq samples 0 - - { "s1.u37", 0x200000, 0x11cd7098, 1 | BRF_SND }, // 8 Ensoniq samples 1 -}; - -STD_ROM_PICK(vasara2a) -STD_ROM_FN(vasara2a) - -struct BurnDriver BurnDrvVasara2a = { - "vasara2a", "vasara2", NULL, NULL, "2001", - "Vasara 2 (set 2)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA_SSV, GBF_VERSHOOT, 0, - NULL, vasara2aRomInfo, vasara2aRomName, NULL, NULL, VasaraInputInfo, Vasara2DIPInfo, - VasaraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 240, 336, 3, 4 -}; - - -// Survival Arts (World) - -static struct BurnRomInfo survartsRomDesc[] = { - { "prl-r6.u4", 0x080000, 0xef5f6e17, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "prh-r5.u3", 0x080000, 0xd446f010, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "si001-01.u27", 0x200000, 0x8b38fbab, 3 | BRF_GRA }, // 2 Graphics - { "si001-04.u26", 0x200000, 0x34248b54, 3 | BRF_GRA }, // 3 - { "si001-07.u25", 0x200000, 0x497d6151, 3 | BRF_GRA }, // 4 - { "si001-02.u23", 0x200000, 0xcb4a2dbd, 3 | BRF_GRA }, // 5 - { "si001-05.u22", 0x200000, 0x8f092381, 3 | BRF_GRA }, // 6 - { "si001-08.u21", 0x200000, 0x182b88c4, 3 | BRF_GRA }, // 7 - { "si001-03.u17", 0x200000, 0x92fdf652, 3 | BRF_GRA }, // 8 - { "si001-06.u16", 0x200000, 0x9a62f532, 3 | BRF_GRA }, // 9 - { "si001-09.u15", 0x200000, 0x0955e393, 3 | BRF_GRA }, // 10 - - { "si001-10.u9", 0x100000, 0x5642b333, 6 | BRF_SND }, // 11 Ensoniq samples 2 - { "si001-11.u8", 0x100000, 0xa81e6ea6, 6 | BRF_SND }, // 12 - { "si001-12.u7", 0x100000, 0xe9b2b45b, 6 | BRF_SND }, // 13 - { "si001-13.u6", 0x100000, 0xd66a7e26, 6 | BRF_SND }, // 14 - - { "gal16v8b.u5", 0x000117, 0x378ce368, 0 | BRF_OPT }, // 15 PLDs -}; - -STD_ROM_PICK(survarts) -STD_ROM_FN(survarts) - -static void SurvartsV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60RAM2, 0x400000, 0x43ffff, MAP_RAM); // more ram - v60MapMemory(DrvV60ROM, 0xf00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); -} - -static INT32 SurvartsInit() -{ - return DrvCommonInit(SurvartsV60Map, NULL, 0, -1, -1, 2, -1, 0.30, 0); -} - -static INT32 DynagearInit() -{ - return DrvCommonInit(SurvartsV60Map, NULL, 0, -1, -1, 2, -1, 0.20, 1); -} - -struct BurnDriver BurnDrvSurvarts = { - "survarts", NULL, NULL, NULL, "1993", - "Survival Arts (World)\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_VSFIGHT, 0, - NULL, survartsRomInfo, survartsRomName, NULL, NULL, SurvartsInputInfo, SurvartsDIPInfo, - SurvartsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Survival Arts (USA) - -static struct BurnRomInfo survartsuRomDesc[] = { - { "usa-pr-l.u4", 0x080000, 0xfa328673, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "usa-pr-h.u3", 0x080000, 0x6bee2635, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "si001-01.u27", 0x200000, 0x8b38fbab, 3 | BRF_GRA }, // 2 Graphics - { "si001-04.u26", 0x200000, 0x34248b54, 3 | BRF_GRA }, // 3 - { "si001-07.u25", 0x200000, 0x497d6151, 3 | BRF_GRA }, // 4 - { "si001-02.u23", 0x200000, 0xcb4a2dbd, 3 | BRF_GRA }, // 5 - { "si001-05.u22", 0x200000, 0x8f092381, 3 | BRF_GRA }, // 6 - { "si001-08.u21", 0x200000, 0x182b88c4, 3 | BRF_GRA }, // 7 - { "si001-03.u17", 0x200000, 0x92fdf652, 3 | BRF_GRA }, // 8 - { "si001-06.u16", 0x200000, 0x9a62f532, 3 | BRF_GRA }, // 9 - { "si001-09.u15", 0x200000, 0x0955e393, 3 | BRF_GRA }, // 10 - - { "si001-10.u9", 0x100000, 0x5642b333, 6 | BRF_SND }, // 11 Ensoniq samples 2 - { "si001-11.u8", 0x100000, 0xa81e6ea6, 6 | BRF_SND }, // 12 - { "si001-12.u7", 0x100000, 0xe9b2b45b, 6 | BRF_SND }, // 13 - { "si001-13.u6", 0x100000, 0xd66a7e26, 6 | BRF_SND }, // 14 -}; - -STD_ROM_PICK(survartsu) -STD_ROM_FN(survartsu) - -struct BurnDriver BurnDrvSurvartsu = { - "survartsu", "survarts", NULL, NULL, "1993", - "Survival Arts (USA)\0", NULL, "American Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA_SSV, GBF_VSFIGHT, 0, - NULL, survartsuRomInfo, survartsuRomName, NULL, NULL, SurvartsInputInfo, SurvartsDIPInfo, - SurvartsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Survival Arts (Japan) - -static struct BurnRomInfo survartsjRomDesc[] = { - { "jpn-pr-l.u4", 0x080000, 0xe5a52e8c, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "jan-pr-h.u3", 0x080000, 0x051c9bca, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "si001-01.u27", 0x200000, 0x8b38fbab, 3 | BRF_GRA }, // 2 Graphics - { "si001-04.u26", 0x200000, 0x34248b54, 3 | BRF_GRA }, // 3 - { "si001-07.u25", 0x200000, 0x497d6151, 3 | BRF_GRA }, // 4 - { "si001-02.u23", 0x200000, 0xcb4a2dbd, 3 | BRF_GRA }, // 5 - { "si001-05.u22", 0x200000, 0x8f092381, 3 | BRF_GRA }, // 6 - { "si001-08.u21", 0x200000, 0x182b88c4, 3 | BRF_GRA }, // 7 - { "si001-03.u17", 0x200000, 0x92fdf652, 3 | BRF_GRA }, // 8 - { "si001-06.u16", 0x200000, 0x9a62f532, 3 | BRF_GRA }, // 9 - { "si001-09.u15", 0x200000, 0x0955e393, 3 | BRF_GRA }, // 10 - - { "si001-10.u9", 0x100000, 0x5642b333, 6 | BRF_SND }, // 11 Ensoniq samples 2 - { "si001-11.u8", 0x100000, 0xa81e6ea6, 6 | BRF_SND }, // 12 - { "si001-12.u7", 0x100000, 0xe9b2b45b, 6 | BRF_SND }, // 13 - { "si001-13.u6", 0x100000, 0xd66a7e26, 6 | BRF_SND }, // 14 -}; - -STD_ROM_PICK(survartsj) -STD_ROM_FN(survartsj) - -struct BurnDriver BurnDrvSurvartsj = { - "survartsj", "survarts", NULL, NULL, "1993", - "Survival Arts (Japan)\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA_SSV, GBF_VSFIGHT, 0, - NULL, survartsjRomInfo, survartsjRomName, NULL, NULL, SurvartsInputInfo, SurvartsDIPInfo, - SurvartsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Dyna Gear - -static struct BurnRomInfo dynagearRomDesc[] = { - { "si002-prl.u4", 0x080000, 0x71ba29c6, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "si002-prh.u3", 0x080000, 0xd0947a12, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "si002-01.u27", 0x200000, 0x0060a521, 3 | BRF_GRA }, // 2 Graphics - { "si002-04.u26", 0x200000, 0x6140f47d, 3 | BRF_GRA }, // 3 - { "si002-02.u23", 0x200000, 0xc22f2a41, 3 | BRF_GRA }, // 4 - { "si002-05.u22", 0x200000, 0x482412fd, 3 | BRF_GRA }, // 5 - { "si002-03.u17", 0x200000, 0x4261a6b8, 3 | BRF_GRA }, // 6 - { "si002-06.u16", 0x200000, 0x0e1f23f6, 3 | BRF_GRA }, // 7 - - { "si002-07.u9", 0x100000, 0x30d2bf11, 6 | BRF_SND }, // 8 Ensoniq samples 2 - { "si002-08.u8", 0x100000, 0x253704ee, 6 | BRF_SND }, // 9 - { "si002-09.u7", 0x100000, 0x1ea86db7, 6 | BRF_SND }, // 10 - { "si002-10.u6", 0x100000, 0xe369c177, 6 | BRF_SND }, // 11 -}; - -STD_ROM_PICK(dynagear) -STD_ROM_FN(dynagear) - -struct BurnDriver BurnDrvDynagear = { - "dynagear", NULL, NULL, NULL, "1993", - "Dyna Gear\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_PLATFORM, 0, - NULL, dynagearRomInfo, dynagearRomName, NULL, NULL, DrvInputInfo, DynagearDIPInfo, - DynagearInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Dramatic Adventure Quiz Keith & Lucy (Japan) - -static struct BurnRomInfo keithlcyRomDesc[] = { - { "vg002-07.u28", 0x100000, 0x57f80ff5, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "kl-p0l.u26", 0x080000, 0xd7b177fb, 2 | BRF_PRG | BRF_ESS }, // 1 - { "kl-p0h.u27", 0x080000, 0x9de7add4, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "vg002-01.u13", 0x200000, 0xb44d85b2, 3 | BRF_GRA }, // 3 Graphics - { "vg002-02.u16", 0x200000, 0xaa05fd14, 3 | BRF_GRA }, // 4 - { "vg002-03.u21", 0x200000, 0x299a8a7d, 3 | BRF_GRA }, // 5 - { "vg002-04.u34", 0x200000, 0xd3633f9b, 3 | BRF_GRA }, // 6 - - { "vg002-05.u29", 0x200000, 0x66aecd79, 4 | BRF_SND }, // 7 Ensoniq samples 0 - { "vg002-06.u33", 0x200000, 0x75d8c8ea, 4 | BRF_SND }, // 8 -}; - -STD_ROM_PICK(keithlcy) -STD_ROM_FN(keithlcy) - -static void KeithlcyV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xe00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); -} - -static INT32 KeithlcyInit() -{ - watchdog_disable = 1; - - return DrvCommonInit(KeithlcyV60Map, NULL, 0, 0, -1, -1, -1, 0.80, 0); -} - -struct BurnDriver BurnDrvKeithlcy = { - "keithlcy", NULL, NULL, NULL, "1993", - "Dramatic Adventure Quiz Keith & Lucy (Japan)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MISC, 0, - NULL, keithlcyRomInfo, keithlcyRomName, NULL, NULL, KeithlcyInputInfo, KeithlcyDIPInfo, - KeithlcyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 238, 4, 3 -}; - - -// Twin Eagle II - The Rescue Mission - -static struct BurnRomInfo twineag2RomDesc[] = { - { "sx002-12.u22", 0x200000, 0x846044dc, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - - { "sx002-01.u32", 0x200000, 0x6d6896b5, 3 | BRF_GRA }, // 1 Graphics - { "sx002-02.u28", 0x200000, 0x3f47e97a, 3 | BRF_GRA }, // 2 - { "sx002-03.u25", 0x200000, 0x544f18bf, 3 | BRF_GRA }, // 3 - { "sx002-04.u19", 0x200000, 0x58c270e2, 3 | BRF_GRA }, // 4 - { "sx002-05.u16", 0x200000, 0x3c310229, 3 | BRF_GRA }, // 5 - { "sx002-06.u13", 0x200000, 0x46d5b1f3, 3 | BRF_GRA }, // 6 - { "sx002-07.u6", 0x200000, 0xc30fa397, 3 | BRF_GRA }, // 7 - { "sx002-08.u3", 0x200000, 0x64edcefa, 3 | BRF_GRA }, // 8 - { "sx002-09.u2", 0x200000, 0x51527c56, 3 | BRF_GRA }, // 9 - - { "sx002-10.u14", 0x200000, 0xb0669dfa, 0 | BRF_SND }, // 10 Ensoniq samples 0 - - { "sx002-11.u7", 0x200000, 0xb8dd621a, 1 | BRF_SND }, // 11 Ensoniq samples 1 - - { "st010.bin", 0x011000, 0xaa11ee2d, 0 | BRF_PRG | BRF_ESS }, // 12 ST010 Code -}; - -STD_ROM_PICK(twineag2) -STD_ROM_FN(twineag2) - -static void Twineag2V60Map() -{ - v60MapMemory(DrvV60RAM2, 0x000000, 0x03ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xe00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); - - st010Expand(12); -} - -static INT32 Twineag2Init() -{ - interrupt_ultrax = 1; - watchdog_disable = 1; - - return DrvCommonInit(Twineag2V60Map, NULL, 0, 0, 1, 0, 1, 0.80, 1); -} - -struct BurnDriver BurnDrvTwineag2 = { - "twineag2", NULL, NULL, NULL, "1994", - "Twin Eagle II - The Rescue Mission\0", NULL, "Seta", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA_SSV, GBF_VERSHOOT, 0, - NULL, twineag2RomInfo, twineag2RomName, NULL, NULL, Twineag2InputInfo, Twineag2DIPInfo, - Twineag2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 240, 336, 3, 4 -}; - - -// Drift Out '94 - The Hard Order (Japan) - -static struct BurnRomInfo drifto94RomDesc[] = { - { "vg003-19.u26", 0x200000, 0x238e5e2b, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "visco-37.u37", 0x080000, 0x78fa3ccb, 2 | BRF_PRG | BRF_ESS }, // 1 - { "visco-33.u33", 0x080000, 0x88351146, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "vg003-01.a0", 0x200000, 0x2812aa1a, 3 | BRF_GRA }, // 3 Graphics - { "vg003-05.a1", 0x200000, 0x1a1dd910, 3 | BRF_GRA }, // 4 - { "vg003-09.a2", 0x200000, 0x198f1c06, 3 | BRF_GRA }, // 5 - { "vg003-13.a3", 0x200000, 0xb45b2267, 3 | BRF_GRA }, // 6 - { "vg003-02.b0", 0x200000, 0xd7402027, 3 | BRF_GRA }, // 7 - { "vg003-06.b1", 0x200000, 0x518c509f, 3 | BRF_GRA }, // 8 - { "vg003-10.b2", 0x200000, 0xc1ee9d8b, 3 | BRF_GRA }, // 9 - { "vg003-14.b3", 0x200000, 0x645b672b, 3 | BRF_GRA }, // 10 - { "vg003-03.c0", 0x200000, 0x1ca7163d, 3 | BRF_GRA }, // 11 - { "vg003-07.c1", 0x200000, 0x2ff113bb, 3 | BRF_GRA }, // 12 - { "vg003-11.c2", 0x200000, 0xf924b105, 3 | BRF_GRA }, // 13 - { "vg003-15.c3", 0x200000, 0x83623b01, 3 | BRF_GRA }, // 14 - { "vg003-04.d0", 0x200000, 0x6be9bc62, 3 | BRF_GRA }, // 15 - { "vg003-08.d1", 0x200000, 0xa7113cdb, 3 | BRF_GRA }, // 16 - { "vg003-12.d2", 0x200000, 0xac0fd855, 3 | BRF_GRA }, // 17 - { "vg003-16.d3", 0x200000, 0x1a5fd312, 3 | BRF_GRA }, // 18 - - { "vg003-17.u22", 0x200000, 0x6f9294ce, 0 | BRF_SND }, // 19 Ensoniq samples 0 - - { "vg003-18.u15", 0x200000, 0x511b3e93, 1 | BRF_SND }, // 20 Ensoniq samples 1 - - { "st010.bin", 0x011000, 0xaa11ee2d, 0 | BRF_PRG | BRF_ESS }, // 21 ST010 Code -}; - -STD_ROM_PICK(drifto94) -STD_ROM_FN(drifto94) - -static void Drifto94V60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvNVRAM, 0x580000, 0x5807ff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xc00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); - - st010Expand(21); -} - -static INT32 Drifto94Init() -{ - watchdog_disable = 1; - vbl_invert = 1; - - return DrvCommonInit(Drifto94V60Map, NULL, 0, 0, 1, -1, -1, 0.80, 0); -} - -struct BurnDriver BurnDrvDrifto94 = { - "drifto94", NULL, NULL, NULL, "1994", - "Drift Out '94 - The Hard Order (Japan)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_RACING, 0, - NULL, drifto94RomInfo, drifto94RomName, NULL, NULL, DrvInputInfo, Drifto94DIPInfo, - Drifto94Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 238, 4, 3 -}; - - -// Meosis Magic (Japan) - -static struct BurnRomInfo meosismRomDesc[] = { - { "s15-2-2.u47", 0x080000, 0x2ab0373f, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "s15-2-1.u46", 0x080000, 0xa4bce148, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "s15-1-7.u7", 0x200000, 0xec5023cb, 3 | BRF_GRA }, // 2 Graphics - { "s15-1-8.u6", 0x200000, 0xf04b0836, 3 | BRF_GRA }, // 3 - { "s15-1-5.u9", 0x200000, 0xc0414b97, 3 | BRF_GRA }, // 4 - { "s15-1-6.u8", 0x200000, 0xd721aeb6, 3 | BRF_GRA }, // 5 - - { "s15-1-4.u45", 0x200000, 0x0c6738a7, 6 | BRF_SND }, // 6 Ensoniq samples 2 - { "s15-1-3.u43", 0x200000, 0xd7e83178, 6 | BRF_SND }, // 7 -}; - -STD_ROM_PICK(meosism) -STD_ROM_FN(meosism) - -static void MeosismV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvNVRAM, 0x580000, 0x58ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xf00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); -} - -static INT32 MeosismInit() -{ - return DrvCommonInit(MeosismV60Map, NULL, 0, -1, -1, 2, -1, 0.80, 0); -} - -struct BurnDriver BurnDrvMeosism = { - "meosism", NULL, NULL, NULL, "1996?", - "Meosis Magic (Japan)\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_CASINO, 0, - NULL, meosismRomInfo, meosismRomName, NULL, NULL, MeosismInputInfo, MeosismDIPInfo, - MeosismInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 338, 236, 4, 3 -}; - - -// Change Air Blade (Japan) - -static struct BurnRomInfo cairbladRomDesc[] = { - { "ac1810e0.u32", 0x200000, 0x13a0b4c2, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - - { "ac1801m0.u6", 0x400000, 0x1b2b6943, 3 | BRF_GRA }, // 1 Graphics - { "ac1802m0.u9", 0x400000, 0xe053b087, 3 | BRF_GRA }, // 2 - { "ac1803m0.u7", 0x400000, 0x45484866, 3 | BRF_GRA }, // 3 - { "ac1804m0.u10", 0x400000, 0x5e0b2285, 3 | BRF_GRA }, // 4 - { "ac1805m0.u8", 0x400000, 0x19771f43, 3 | BRF_GRA }, // 5 - { "ac1806m0.u11", 0x400000, 0x816b97dc, 3 | BRF_GRA }, // 6 - - { "ac1410m0.u41", 0x400000, 0xecf1f255, 4 | BRF_SND }, // 7 Ensoniq samples 0 -}; - -STD_ROM_PICK(cairblad) -STD_ROM_FN(cairblad) - -static void CairbladV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvNVRAM, 0x580000, 0x58ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xe00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); -} - -static INT32 CairbladInit() -{ - return DrvCommonInit(CairbladV60Map, NULL, 1, 0, -1, -1, -1, 0.80, 1); -} - -struct BurnDriver BurnDrvCairblad = { - "cairblad", NULL, NULL, NULL, "1999", - "Change Air Blade (Japan)\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA_SSV, GBF_VERSHOOT, 0, - NULL, cairbladRomInfo, cairbladRomName, NULL, NULL, DrvInputInfo, CairbladDIPInfo, - CairbladInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 240, 338, 3, 4 -}; - - -// Ultra X Weapons / Ultra Keibitai - -static struct BurnRomInfo ultraxRomDesc[] = { - { "71047-11.u64", 0x080000, 0x593b2678, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "71047-09.u65", 0x080000, 0x08ea8d91, 2 | BRF_PRG | BRF_ESS }, // 1 - { "71047-12.u62", 0x080000, 0x76a77ab2, 2 | BRF_PRG | BRF_ESS }, // 2 - { "71047-10.u63", 0x080000, 0x7c79faf9, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "71047-01.u73", 0x200000, 0x66662b08, 3 | BRF_GRA }, // 4 Graphics - { "71047-02.u74", 0x100000, 0x6b00dc0c, 3 | BRF_GRA }, // 5 - { "71047-03.u76", 0x200000, 0x00fcd6c2, 3 | BRF_GRA }, // 6 - { "71047-04.u77", 0x100000, 0xd9e710d1, 3 | BRF_GRA }, // 7 - { "71047-05.u75", 0x200000, 0x10848193, 3 | BRF_GRA }, // 8 - { "71047-06.u88", 0x100000, 0xb8ac2942, 3 | BRF_GRA }, // 9 - - { "71047-07.u59", 0x200000, 0xd9828b62, 0 | BRF_SND }, // 10 Ensoniq samples 0 - - { "71047-08.u60", 0x200000, 0x30ebff6d, 1 | BRF_SND }, // 11 Ensoniq samples 1 -}; - -STD_ROM_PICK(ultrax) -STD_ROM_FN(ultrax) - -static void UltraxV60Map() -{ - v60MapMemory(DrvV60RAM2, 0x000000, 0x03ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xe00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); -} - -static INT32 UltraxInit() -{ - interrupt_ultrax = 1; - - return DrvCommonInit(UltraxV60Map, NULL, 0, 0, 1, 0, 1, 0.80, 1); -} - -struct BurnDriver BurnDrvUltrax = { - "ultrax", NULL, NULL, NULL, "1995", - "Ultra X Weapons / Ultra Keibitai\0", NULL, "Banpresto / Tsuburaya Productions", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA_SSV, GBF_VERSHOOT, 0, - NULL, ultraxRomInfo, ultraxRomName, NULL, NULL, DrvInputInfo, UltraxDIPInfo, - UltraxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 240, 336, 3, 4 -}; - - -// Ultra X Weapons / Ultra Keibitai (GAMEST review build) - -static struct BurnRomInfo ultraxgRomDesc[] = { - { "sx010-11.5h", 0x080000, 0x58554bdd, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "sx010-09.5c", 0x080000, 0x153e79b2, 2 | BRF_PRG | BRF_ESS }, // 1 - { "sx010-12.5k", 0x080000, 0x14ad58c9, 2 | BRF_PRG | BRF_ESS }, // 2 - { "sx010-10.5d", 0x080000, 0x7e64473e, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "71047-01.u73", 0x200000, 0x66662b08, 3 | BRF_GRA }, // 4 Graphics - { "71047-02.u74", 0x100000, 0x6b00dc0c, 3 | BRF_GRA }, // 5 - { "71047-03.u76", 0x200000, 0x00fcd6c2, 3 | BRF_GRA }, // 6 - { "71047-04.u77", 0x100000, 0xd9e710d1, 3 | BRF_GRA }, // 7 - { "71047-05.u75", 0x200000, 0x10848193, 3 | BRF_GRA }, // 8 - { "71047-06.u88", 0x100000, 0xb8ac2942, 3 | BRF_GRA }, // 9 - - { "71047-07.u59", 0x200000, 0xd9828b62, 0 | BRF_SND }, // 10 Ensoniq samples 0 - - { "71047-08.u60", 0x200000, 0x30ebff6d, 1 | BRF_SND }, // 11 Ensoniq samples 1 -}; - -STD_ROM_PICK(ultraxg) -STD_ROM_FN(ultraxg) - -struct BurnDriver BurnDrvUltraxg = { - "ultraxg", "ultrax", NULL, NULL, "1995", - "Ultra X Weapons / Ultra Keibitai (GAMEST review build)\0", NULL, "Banpresto / Tsuburaya Productions", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA_SSV, GBF_VERSHOOT, 0, - NULL, ultraxgRomInfo, ultraxgRomName, NULL, NULL, DrvInputInfo, UltraxDIPInfo, - UltraxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 240, 336, 3, 4 -}; - - -// Storm Blade (US) - -static struct BurnRomInfo stmbladeRomDesc[] = { - { "sb-pd0.u26", 0x100000, 0x91c4fbf7, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "s-blade.u37", 0x080000, 0xa6a42cc7, 2 | BRF_PRG | BRF_ESS }, // 1 - { "s-blade.u33", 0x080000, 0x16104ca6, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "sb-a0.u41", 0x200000, 0x2a327b51, 3 | BRF_GRA }, // 3 Graphics - { "sb-a1.u35", 0x200000, 0x246f6f28, 3 | BRF_GRA }, // 4 - { "sb-a2.u32", 0x080000, 0x2049acf3, 3 | BRF_GRA }, // 5 - { "sb-b0.u25", 0x200000, 0xb3aa3e68, 3 | BRF_GRA }, // 6 - { "sb-b1.u21", 0x200000, 0xe95b38e7, 3 | BRF_GRA }, // 7 - { "sb-b2.u18", 0x080000, 0xd080e620, 3 | BRF_GRA }, // 8 - { "sb-c0.u11", 0x200000, 0x825dd8f1, 3 | BRF_GRA }, // 9 - { "sb-c1.u7", 0x200000, 0x744afcd7, 3 | BRF_GRA }, // 10 - { "sb-c2.u4", 0x080000, 0xfd1d2a92, 3 | BRF_GRA }, // 11 - - { "sb-snd0.u22", 0x200000, 0x4efd605b, 0 | BRF_SND }, // 12 Ensoniq samples 0 - - { "st010.bin", 0x011000, 0xaa11ee2d, 0 | BRF_PRG | BRF_ESS }, // 13 ST010 Code -}; - -STD_ROM_PICK(stmblade) -STD_ROM_FN(stmblade) - -static void StmbladeV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvNVRAM, 0x580000, 0x5807ff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xc00000, 0xcfffff, MAP_ROM); - v60MapMemory(DrvV60ROM + 0x100000, 0xe00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); - - st010Expand(13); -} - -static INT32 StmbladeInit() -{ - watchdog_disable = 1; - vbl_invert = 1; - - return DrvCommonInit(StmbladeV60Map, NULL, 0, 0, -1, -1, -1, 0.80, 0); -} - -struct BurnDriver BurnDrvStmblade = { - "stmblade", NULL, NULL, NULL, "1996", - "Storm Blade (US)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA_SSV, GBF_VERSHOOT, 0, - NULL, stmbladeRomInfo, stmbladeRomName, NULL, NULL, DrvInputInfo, StmbladeDIPInfo, - StmbladeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 240, 352, 3, 4 -}; - - -// Storm Blade (Japan) - -static struct BurnRomInfo stmbladejRomDesc[] = { - { "sb-pd0.u26", 0x100000, 0x91c4fbf7, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "u37j.u37", 0x080000, 0xdce20df8, 2 | BRF_PRG | BRF_ESS }, // 1 - { "u33j.u33", 0x080000, 0x12f68940, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "sb-a0.u41", 0x200000, 0x2a327b51, 3 | BRF_GRA }, // 3 Graphics - { "sb-a1.u35", 0x200000, 0x246f6f28, 3 | BRF_GRA }, // 4 - { "sb-a2.u32", 0x080000, 0x2049acf3, 3 | BRF_GRA }, // 5 - { "sb-b0.u25", 0x200000, 0xb3aa3e68, 3 | BRF_GRA }, // 6 - { "sb-b1.u21", 0x200000, 0xe95b38e7, 3 | BRF_GRA }, // 7 - { "sb-b2.u18", 0x080000, 0xd080e620, 3 | BRF_GRA }, // 8 - { "sb-c0.u11", 0x200000, 0x825dd8f1, 3 | BRF_GRA }, // 9 - { "sb-c1.u7", 0x200000, 0x744afcd7, 3 | BRF_GRA }, // 10 - { "sb-c2.u4", 0x080000, 0xfd1d2a92, 3 | BRF_GRA }, // 11 - - { "sb-snd0.u22", 0x200000, 0x4efd605b, 0 | BRF_SND }, // 12 Ensoniq samples 0 - - { "st010.bin", 0x011000, 0xaa11ee2d, 0 | BRF_PRG | BRF_ESS }, // 13 ST010 Code -}; - -STD_ROM_PICK(stmbladej) -STD_ROM_FN(stmbladej) - -struct BurnDriver BurnDrvStmbladej = { - "stmbladej", "stmblade", NULL, NULL, "1996", - "Storm Blade (Japan)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SETA_SSV, GBF_VERSHOOT, 0, - NULL, stmbladejRomInfo, stmbladejRomName, NULL, NULL, DrvInputInfo, StmbladeDIPInfo, - StmbladeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 240, 352, 3, 4 -}; - - -// Gourmet Battle Quiz Ryohrioh CooKing (Japan) - -static struct BurnRomInfo ryoriohRomDesc[] = { - { "ryorioh.dat", 0x200000, 0xd1335a6a, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "ryorioh.l", 0x080000, 0x9ad60e7d, 2 | BRF_PRG | BRF_ESS }, // 1 - { "ryorioh.h", 0x080000, 0x0655fcff, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "ryorioh.a0", 0x400000, 0xf76ee003, 3 | BRF_GRA }, // 3 Graphics - { "ryorioh.a1", 0x400000, 0xca44d66d, 3 | BRF_GRA }, // 4 - { "ryorioh.b0", 0x400000, 0xdaa134f4, 3 | BRF_GRA }, // 5 - { "ryorioh.b1", 0x400000, 0x7611697c, 3 | BRF_GRA }, // 6 - { "ryorioh.c0", 0x400000, 0x20eb49cf, 3 | BRF_GRA }, // 7 - { "ryorioh.c1", 0x400000, 0x1370c75e, 3 | BRF_GRA }, // 8 - { "ryorioh.d0", 0x400000, 0xffa14ef1, 3 | BRF_GRA }, // 9 - { "ryorioh.d1", 0x400000, 0xae6055e8, 3 | BRF_GRA }, // 10 - - { "ryorioh.snd", 0x200000, 0x7bd38b76, 0 | BRF_SND }, // 11 Ensoniq samples 0 -}; - -STD_ROM_PICK(ryorioh) -STD_ROM_FN(ryorioh) - -static INT32 RyoriohInit() -{ - return DrvCommonInit(VasaraV60Map, NULL, 0, 0, -1, -1, -1, 0.80, 0); -} - -struct BurnDriver BurnDrvRyorioh = { - "ryorioh", NULL, NULL, NULL, "1998", - "Gourmet Battle Quiz Ryohrioh CooKing (Japan)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_QUIZ, 0, - NULL, ryoriohRomInfo, ryoriohRomName, NULL, NULL, RyoriohInputInfo, RyoriohDIPInfo, - RyoriohInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Monster Slider (Japan) - -static struct BurnRomInfo msliderRomDesc[] = { - { "ms-pl.bin", 0x080000, 0x70b2a05d, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "ms-ph.bin", 0x080000, 0x34a64e9f, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "ms-a0.bin", 0x200000, 0x7ed38ccc, 3 | BRF_GRA }, // 2 Graphics - { "ms-a1.bin", 0x080000, 0x83f5995f, 3 | BRF_GRA }, // 3 - { "ms-b0.bin", 0x200000, 0xfaa076e1, 3 | BRF_GRA }, // 4 - { "ms-b1.bin", 0x080000, 0xef9748db, 3 | BRF_GRA }, // 5 - { "ms-c0.bin", 0x200000, 0xf9d3e052, 3 | BRF_GRA }, // 6 - { "ms-c1.bin", 0x080000, 0x7f910c5a, 3 | BRF_GRA }, // 7 - - { "ms-snd0.bin", 0x200000, 0xcda6e3a5, 4 | BRF_SND }, // 8 Ensoniq samples 0 - { "ms-snd1.bin", 0x200000, 0x8f484b35, 4 | BRF_SND }, // 9 -}; - -STD_ROM_PICK(mslider) -STD_ROM_FN(mslider) - -static void MsliderV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvV60RAM0, 0x010000, 0x01ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xf00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(common_main_write_word); - v60SetWriteByteHandler(common_main_write_byte); - v60SetReadWordHandler(common_main_read_word); - v60SetReadByteHandler(common_main_read_byte); -} - -static INT32 MsliderInit() -{ - watchdog_disable = 1; - - return DrvCommonInit(MsliderV60Map, NULL, 0, 0, -1, -1, -1, 0.80, 1); -} - -struct BurnDriver BurnDrvMslider = { - "mslider", NULL, NULL, NULL, "1997", - "Monster Slider (Japan)\0", NULL, "Visco / Datt Japan", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_PUZZLE, 0, - NULL, msliderRomInfo, msliderRomName, NULL, NULL, DrvInputInfo, MsliderDIPInfo, - MsliderInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 352, 240, 4, 3 -}; - - -// Mobil Suit Gundam Final Shooting (Japan) - -static struct BurnRomInfo gdfsRomDesc[] = { - { "vg004-14.u3", 0x100000, 0xd88254df, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "ssv2set0.u1", 0x080000, 0xc23b9e2c, 2 | BRF_PRG | BRF_ESS }, // 1 - { "ssv2set1.u2", 0x080000, 0xd7d52570, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "vg004-09.u43", 0x200000, 0xb7382cfa, 3 | BRF_GRA }, // 3 Graphics - { "vg004-10.u45", 0x200000, 0xb3c6b1cb, 3 | BRF_GRA }, // 4 - { "vg004-11.u48", 0x200000, 0x1491def1, 3 | BRF_GRA }, // 5 - - { "vg004-01.u33", 0x200000, 0xaa9a81c2, 0 | BRF_GRA }, // 6 ST0020 sprites - { "vg004-02.u34", 0x200000, 0xfa40ecb4, 0 | BRF_GRA }, // 7 - { "vg004-03.u35", 0x200000, 0x90004023, 0 | BRF_GRA }, // 8 - { "vg004-04.u36", 0x200000, 0xfdafd289, 0 | BRF_GRA }, // 9 - { "vg004-05.u37", 0x200000, 0x9ae488b0, 0 | BRF_GRA }, // 10 - { "vg004-06.u38", 0x200000, 0x3402325f, 0 | BRF_GRA }, // 11 - { "vg004-07.u39", 0x200000, 0x5e89fcf9, 0 | BRF_GRA }, // 12 - { "vg004-08.u40", 0x200000, 0x6b1746dc, 0 | BRF_GRA }, // 13 - - { "ssvv7.u16", 0x080000, 0xf1c3ab6f, 8 | BRF_GRA }, // 14 Tilemap tiles - - { "vg004-12.u4", 0x200000, 0xeb41a4ef, 5 | BRF_SND }, // 15 Ensoniq samples 0 - { "vg004-13.u5", 0x200000, 0xa4ed3977, 5 | BRF_SND }, // 16 -}; - -STD_ROM_PICK(gdfs) -STD_ROM_FN(gdfs) - -static void GdfsV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvTMAPRAM, 0x400000, 0x43ffff, MAP_RAM); - v60MapMemory(DrvDspRAM, 0x482000, 0x482fff, MAP_RAM); - v60MapMemory(DrvV60RAM2, 0x600000, 0x600fff, MAP_RAM); - v60MapMemory(st0020SprRAM, 0x800000, 0x87ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xc00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(gdfs_write_word); - v60SetWriteByteHandler(gdfs_write_byte); - v60SetReadWordHandler(gdfs_read_word); - v60SetReadByteHandler(gdfs_read_byte); - - EEPROMInit(&eeprom_interface_93C46); -} - -static void GdfsRomLoadCallback() -{ - memcpy (DrvV60ROM + 0x200000, DrvV60ROM + 0x100000, 0x100000); - memcpy (DrvV60ROM + 0x300000, DrvV60ROM + 0x100000, 0x100000); - memcpy (DrvV60ROM + 0x100000, DrvV60ROM + 0x000000, 0x100000); - - if (BurnLoadRom(st0020GfxROM + 0x0000000, 6, 1)) return; - if (BurnLoadRom(st0020GfxROM + 0x0200000, 7, 1)) return; - if (BurnLoadRom(st0020GfxROM + 0x0400000, 8, 1)) return; - if (BurnLoadRom(st0020GfxROM + 0x0600000, 9, 1)) return; - if (BurnLoadRom(st0020GfxROM + 0x0800000, 10, 1)) return; - if (BurnLoadRom(st0020GfxROM + 0x0a00000, 11, 1)) return; - if (BurnLoadRom(st0020GfxROM + 0x0c00000, 12, 1)) return; - if (BurnLoadRom(st0020GfxROM + 0x0e00000, 13, 1)) return; - - if (BurnLoadRom(DrvSndROM0 + 0x000001, 15, 2)) return; - if (BurnLoadRom(DrvSndROM0 + 0x000000, 16, 2)) return; -} - -static INT32 GdfsInit() -{ - is_gdfs = 1; - st0020GfxROMLen = 0x1000000; - watchdog_disable = 1; - - return DrvCommonInit(GdfsV60Map, GdfsRomLoadCallback, 0, 0, 0, 0, 0, 0.80, 1); -} - -struct BurnDriver BurnDrvGdfs = { - "gdfs", NULL, NULL, NULL, "1995", - "Mobil Suit Gundam Final Shooting (Japan)\0", NULL, "Banpresto", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_SHOOT, 0, - NULL, gdfsRomInfo, gdfsRomName, NULL, NULL, GdfsInputInfo, GdfsDIPInfo, - GdfsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Lovely Pop Mahjong JangJang Shimasho (Japan) - -static struct BurnRomInfo janjans1RomDesc[] = { - { "jj1-data.bin", 0x200000, 0x6734537e, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "jj1-prol.bin", 0x080000, 0x4231d928, 2 | BRF_PRG | BRF_ESS }, // 1 - { "jj1-proh.bin", 0x080000, 0x651383c6, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "jj1-a0.bin", 0x400000, 0x39bbbc46, 3 | BRF_GRA }, // 3 Graphics - { "jj1-a1.bin", 0x400000, 0x26020133, 3 | BRF_GRA }, // 4 - { "jj1-a2.bin", 0x200000, 0xe993251e, 3 | BRF_GRA }, // 5 - { "jj1-b0.bin", 0x400000, 0x8ee66b0a, 3 | BRF_GRA }, // 6 - { "jj1-b1.bin", 0x400000, 0x048719b3, 3 | BRF_GRA }, // 7 - { "jj1-b2.bin", 0x200000, 0x6e95af3f, 3 | BRF_GRA }, // 8 - { "jj1-c0.bin", 0x400000, 0x9df28afc, 3 | BRF_GRA }, // 9 - { "jj1-c1.bin", 0x400000, 0xeb470ed3, 3 | BRF_GRA }, // 10 - { "jj1-c2.bin", 0x200000, 0xaaf72c2d, 3 | BRF_GRA }, // 11 - { "jj1-d0.bin", 0x400000, 0x2b3bd591, 3 | BRF_GRA }, // 12 - { "jj1-d1.bin", 0x400000, 0xf24c0d36, 3 | BRF_GRA }, // 13 - { "jj1-d2.bin", 0x200000, 0x481b3be8, 3 | BRF_GRA }, // 14 - - { "jj1-snd0.bin", 0x200000, 0x4f7d620a, 0 | BRF_SND }, // 15 Ensoniq samples 0 - - { "jj1-snd1.bin", 0x200000, 0x9b3a7ae5, 1 | BRF_SND }, // 16 Ensoniq samples 1 -}; - -STD_ROM_PICK(janjans1) -STD_ROM_FN(janjans1) - -static void Janjans1V60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvV60RAM0, 0x010000, 0x01ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xc00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(janjan1_write_word); - v60SetWriteByteHandler(janjan1_write_byte); - v60SetReadWordHandler(janjan1_read_word); - v60SetReadByteHandler(janjan1_read_byte); -} - -static INT32 Janjans1Init() -{ - watchdog_disable = 1; - - return DrvCommonInit(Janjans1V60Map, NULL, 0, 0, 1, 0, 1, 0.80, 0); -} - -struct BurnDriver BurnDrvJanjans1 = { - "janjans1", NULL, NULL, NULL, "1996", - "Lovely Pop Mahjong JangJang Shimasho (Japan)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MAHJONG, 0, - NULL, janjans1RomInfo, janjans1RomName, NULL, NULL, MahjongInputInfo, Janjans1DIPInfo, - Janjans1Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 238, 4, 3 -}; - - -// Lovely Pop Mahjong JangJang Shimasho 2 (Japan) - -static struct BurnRomInfo janjans2RomDesc[] = { - { "jan2-dat.u28", 0x200000, 0x0c9c62bf, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "jan2-prol.u26", 0x080000, 0x758a7249, 2 | BRF_PRG | BRF_ESS }, // 1 - { "jan2-proh.u27", 0x080000, 0xfcd5da62, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "jan2-a0.u13", 0x400000, 0x37869bea, 3 | BRF_GRA }, // 3 Graphics - { "jan2-a1.u14", 0x400000, 0x8189e74f, 3 | BRF_GRA }, // 4 - { "jan2-b0.u16", 0x400000, 0x19877c5c, 3 | BRF_GRA }, // 5 - { "jan2-b1.u17", 0x400000, 0x8d0f7190, 3 | BRF_GRA }, // 6 - { "jan2-c0.u21", 0x400000, 0x8bdff3d5, 3 | BRF_GRA }, // 7 - { "jan2-c1.u22", 0x400000, 0xf7ea5934, 3 | BRF_GRA }, // 8 - { "jan2-d0.u34", 0x400000, 0x479fdb54, 3 | BRF_GRA }, // 9 - { "jan2-d1.u35", 0x400000, 0xc0148895, 3 | BRF_GRA }, // 10 - - { "jan2-snd0.u29", 0x200000, 0x22cc054e, 0 | BRF_SND }, // 11 Ensoniq samples 0 - - { "jan2-snd1.u33", 0x200000, 0xcbcac4a6, 1 | BRF_SND }, // 12 Ensoniq samples 1 -}; - -STD_ROM_PICK(janjans2) -STD_ROM_FN(janjans2) - -static INT32 Janjans2Init() -{ - return DrvCommonInit(Janjans1V60Map, NULL, 0, 0, 1, 0, 1, 0.80, 0); -} - -struct BurnDriver BurnDrvJanjans2 = { - "janjans2", NULL, NULL, NULL, "2000", - "Lovely Pop Mahjong JangJang Shimasho 2 (Japan)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MAHJONG, 0, - NULL, janjans2RomInfo, janjans2RomName, NULL, NULL, Srmp4InputInfo, Janjans2DIPInfo, - Janjans2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 238, 4, 3 -}; - - -// Koi Koi Shimasho 2 - Super Real Hanafuda (Japan) - -static struct BurnRomInfo koikois2RomDesc[] = { - { "u26.bin", 0x080000, 0x4be937a1, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "u27.bin", 0x080000, 0x25f39d93, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "kk2-a0.bin", 0x400000, 0xb94b76c2, 3 | BRF_GRA }, // 2 Graphics - { "kk2-a1.bin", 0x200000, 0xa7c99f56, 3 | BRF_GRA }, // 3 - { "kk2-b0.bin", 0x400000, 0x4d028972, 3 | BRF_GRA }, // 4 - { "kk2-b1.bin", 0x200000, 0x778ec9fb, 3 | BRF_GRA }, // 5 - { "kk2-c0.bin", 0x400000, 0x34b699d9, 3 | BRF_GRA }, // 6 - { "kk2-c1.bin", 0x200000, 0xab451e88, 3 | BRF_GRA }, // 7 - { "kk2-d0.bin", 0x400000, 0x0e3005a4, 3 | BRF_GRA }, // 8 - { "kk2-d1.bin", 0x200000, 0x17a02252, 3 | BRF_GRA }, // 9 - - { "kk2_snd0.bin", 0x200000, 0xb27eaa94, 0 | BRF_SND }, // 10 Ensoniq samples 0 - - { "kk2_snd1.bin", 0x200000, 0xe5a963e1, 1 | BRF_SND }, // 11 Ensoniq samples 1 -}; - -STD_ROM_PICK(koikois2) -STD_ROM_FN(koikois2) - -static void Koikois2V60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvV60RAM0, 0x010000, 0x01ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xf00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(janjan1_write_word); - v60SetWriteByteHandler(janjan1_write_byte); - v60SetReadWordHandler(janjan1_read_word); - v60SetReadByteHandler(janjan1_read_byte); -} - -static INT32 Koikois2Init() -{ - return DrvCommonInit(Koikois2V60Map, NULL, 0, 0, 1, 0, 1, 1.40, 0); -} - -struct BurnDriver BurnDrvKoikois2 = { - "koikois2", NULL, NULL, NULL, "1997", - "Koi Koi Shimasho 2 - Super Real Hanafuda (Japan)\0", NULL, "Visco", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MAHJONG, 0, - NULL, koikois2RomInfo, koikois2RomName, NULL, NULL, MahjongInputInfo, Koikois2DIPInfo, - Koikois2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Super Real Mahjong PIV (Japan) - -static struct BurnRomInfo srmp4RomDesc[] = { - { "sx001-14.prl", 0x080000, 0x19aaf46e, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "sx001-15.prh", 0x080000, 0xdbd31399, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "sx001-01.a0", 0x200000, 0x94ee9203, 3 | BRF_GRA }, // 2 Graphics - { "sx001-04.a1", 0x200000, 0x38c9c49a, 3 | BRF_GRA }, // 3 - { "sx001-07.a2", 0x200000, 0xee66021e, 3 | BRF_GRA }, // 4 - { "sx001-02.b0", 0x200000, 0xadffb598, 3 | BRF_GRA }, // 5 - { "sx001-05.b1", 0x200000, 0x4c400a38, 3 | BRF_GRA }, // 6 - { "sx001-08.b2", 0x200000, 0x36efd52c, 3 | BRF_GRA }, // 7 - { "sx001-03.c0", 0x200000, 0x4336b037, 3 | BRF_GRA }, // 8 - { "sx001-06.c1", 0x200000, 0x6fe7229e, 3 | BRF_GRA }, // 9 - { "sx001-09.c2", 0x200000, 0x91dd8218, 3 | BRF_GRA }, // 10 - - { "sx001-10.sd0", 0x200000, 0x45409ef1, 4 | BRF_SND }, // 11 Ensoniq samples 0 -}; - -STD_ROM_PICK(srmp4) -STD_ROM_FN(srmp4) - -static void Srmp4V60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvV60RAM0, 0x010000, 0x01ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xf00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(janjan1_write_word); - v60SetWriteByteHandler(janjan1_write_byte); - v60SetReadWordHandler(janjan1_read_word); - v60SetReadByteHandler(janjan1_read_byte); -} - -static void Srpm4RomLoadCallback() -{ - memcpy (DrvSndROM0 + 0x200000, DrvSndROM0, 0x200000); -} - -static INT32 Srmp4Init() -{ - return DrvCommonInit(Srmp4V60Map, Srpm4RomLoadCallback, 0, 0, 1, 0, 1, 0.80, 0); -} - -struct BurnDriver BurnDrvSrmp4 = { - "srmp4", NULL, NULL, NULL, "1993", - "Super Real Mahjong PIV (Japan)\0", NULL, "Seta", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MAHJONG, 0, - NULL, srmp4RomInfo, srmp4RomName, NULL, NULL, Srmp4InputInfo, Srmp4DIPInfo, - Srmp4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Super Real Mahjong PIV (Japan, older set) - -static struct BurnRomInfo srmp4oRomDesc[] = { - { "sx001-11.prl", 0x080000, 0xdede3e64, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "sx001-12.prh", 0x080000, 0x739c53c3, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "sx001-01.a0", 0x200000, 0x94ee9203, 3 | BRF_GRA }, // 2 Graphics - { "sx001-04.a1", 0x200000, 0x38c9c49a, 3 | BRF_GRA }, // 3 - { "sx001-07.a2", 0x200000, 0xee66021e, 3 | BRF_GRA }, // 4 - { "sx001-02.b0", 0x200000, 0xadffb598, 3 | BRF_GRA }, // 5 - { "sx001-05.b1", 0x200000, 0x4c400a38, 3 | BRF_GRA }, // 6 - { "sx001-08.b2", 0x200000, 0x36efd52c, 3 | BRF_GRA }, // 7 - { "sx001-03.c0", 0x200000, 0x4336b037, 3 | BRF_GRA }, // 8 - { "sx001-06.c1", 0x200000, 0x6fe7229e, 3 | BRF_GRA }, // 9 - { "sx001-09.c2", 0x200000, 0x91dd8218, 3 | BRF_GRA }, // 10 - - { "sx001-10.sd0", 0x200000, 0x45409ef1, 4 | BRF_SND }, // 11 Ensoniq samples 0 -}; - -STD_ROM_PICK(srmp4o) -STD_ROM_FN(srmp4o) - -struct BurnDriver BurnDrvSrmp4o = { - "srmp4o", "srmp4", NULL, NULL, "1993", - "Super Real Mahjong PIV (Japan, older set)\0", NULL, "Seta", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SETA_SSV, GBF_MAHJONG, 0, - NULL, srmp4oRomInfo, srmp4oRomName, NULL, NULL, Srmp4InputInfo, Srmp4DIPInfo, - Srmp4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Mahjong Hyper Reaction (Japan) - -static struct BurnRomInfo hypreactRomDesc[] = { - { "s14-1-02.u2", 0x080000, 0xd90a383c, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "s14-1-01.u1", 0x080000, 0x80481401, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "s14-1-07.u7", 0x200000, 0x6c429fd0, 3 | BRF_GRA }, // 2 Graphics - { "s14-1-05.u13", 0x200000, 0x2ff72f98, 3 | BRF_GRA }, // 3 - { "s14-1-06.u10", 0x200000, 0xf470ec42, 3 | BRF_GRA }, // 4 - { "s14-1-10.u6", 0x200000, 0xfdd706ba, 3 | BRF_GRA }, // 5 - { "s14-1-08.u12", 0x200000, 0x5bb9bb0d, 3 | BRF_GRA }, // 6 - { "s14-1-09.u9", 0x200000, 0xd1dda65f, 3 | BRF_GRA }, // 7 - { "s14-1-13.u8", 0x200000, 0x971caf11, 3 | BRF_GRA }, // 8 - { "s14-1-11.u14", 0x200000, 0x6d8e7bae, 3 | BRF_GRA }, // 9 - { "s14-1-12.u11", 0x200000, 0x233a8e23, 3 | BRF_GRA }, // 10 - - { "s14-1-04.u4", 0x200000, 0xa5955336, 6 | BRF_SND }, // 11 Ensoniq samples 2 - { "s14-1-03.u5", 0x200000, 0x283a6ec2, 6 | BRF_SND }, // 12 -}; - -STD_ROM_PICK(hypreact) -STD_ROM_FN(hypreact) - -static INT32 HypreactInit() -{ - watchdog_disable = 1; - - return DrvCommonInit(Srmp4V60Map, NULL, 0, 0, 1, 0, 1, 0.10, 0); -} - -struct BurnDriver BurnDrvHypreact = { - "hypreact", NULL, NULL, NULL, "1995", - "Mahjong Hyper Reaction (Japan)\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MAHJONG, 0, - NULL, hypreactRomInfo, hypreactRomName, NULL, NULL, HypreactInputInfo, HypreactDIPInfo, - HypreactInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 338, 240, 4, 3 -}; - - -// Mahjong Hyper Reaction 2 (Japan) - -static struct BurnRomInfo hypreac2RomDesc[] = { - { "u2.bin", 0x080000, 0x05c93266, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "u1.bin", 0x080000, 0x80cf9e59, 2 | BRF_PRG | BRF_ESS }, // 1 - { "u47.bin", 0x080000, 0xa3e9bfee, 2 | BRF_PRG | BRF_ESS }, // 2 - { "u46.bin", 0x080000, 0x68c41235, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "s16-1-16.u6", 0x400000, 0xb308ac34, 3 | BRF_GRA }, // 4 Graphics - { "s16-1-15.u9", 0x400000, 0x2c8e381e, 3 | BRF_GRA }, // 5 - { "s16-1-14.u12", 0x200000, 0xafe9d187, 3 | BRF_GRA }, // 6 - { "s16-1-10.u7", 0x400000, 0x86a10cbd, 3 | BRF_GRA }, // 7 - { "s16-1-09.u10", 0x400000, 0x6b8e4d92, 3 | BRF_GRA }, // 8 - { "s16-1-08.u13", 0x200000, 0xb355f45d, 3 | BRF_GRA }, // 9 - { "s16-1-13.u8", 0x400000, 0x89869af2, 3 | BRF_GRA }, // 10 - { "s16-1-12.u11", 0x400000, 0x87d9c748, 3 | BRF_GRA }, // 11 - { "s16-1-11.u14", 0x200000, 0x70b3c0a0, 3 | BRF_GRA }, // 12 - - { "s16-1-06.u41", 0x400000, 0x626e8a81, 4 | BRF_SND }, // 13 Ensoniq samples 0 - - { "s16-1-07.u42", 0x400000, 0x42bcb41b, 5 | BRF_SND }, // 14 Ensoniq samples 1 - - { "s16-1-07.u42", 0x400000, 0x42bcb41b, 6 | BRF_SND }, // 15 Ensoniq samples 2 -}; - -STD_ROM_PICK(hypreac2) -STD_ROM_FN(hypreac2) - -static void Hypreac2V60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvDspRAM, 0x482000, 0x482fff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xe00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(hypreac2_write_word); - v60SetWriteByteHandler(hypreac2_write_byte); - v60SetReadWordHandler(hypreac2_read_word); - v60SetReadByteHandler(hypreac2_read_byte); -} - -static INT32 Hypreac2Init() -{ - watchdog_disable = 1; - - return DrvCommonInit(Hypreac2V60Map, NULL, 1, 0, 1, 2, -1, 0.10, 0); -} - -struct BurnDriver BurnDrvHypreac2 = { - "hypreac2", NULL, NULL, NULL, "1997", - "Mahjong Hyper Reaction 2 (Japan)\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MAHJONG, 0, - NULL, hypreac2RomInfo, hypreac2RomName, NULL, NULL, Hypreac2InputInfo, Hypreac2DIPInfo, - Hypreac2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 338, 240, 4, 3 -}; - - -// Super Real Mahjong P7 (Japan) - -static struct BurnRomInfo srmp7RomDesc[] = { - { "sx015-10.dat", 0x200000, 0xfad3ac6a, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "sx015-07.pr0", 0x080000, 0x08d7f841, 2 | BRF_PRG | BRF_ESS }, // 1 - { "sx015-08.pr1", 0x080000, 0x90307825, 2 | BRF_PRG | BRF_ESS }, // 2 - - { "sx015-26.a0", 0x400000, 0xa997be9d, 3 | BRF_GRA }, // 3 Graphics - { "sx015-25.a1", 0x400000, 0x29ac4211, 3 | BRF_GRA }, // 4 - { "sx015-24.a2", 0x400000, 0xb8fea3da, 3 | BRF_GRA }, // 5 - { "sx015-23.a3", 0x400000, 0x9ec0b81e, 3 | BRF_GRA }, // 6 - { "sx015-22.b0", 0x400000, 0x62c3df07, 3 | BRF_GRA }, // 7 - { "sx015-21.b1", 0x400000, 0x55b8a431, 3 | BRF_GRA }, // 8 - { "sx015-20.b2", 0x400000, 0xe84a64d7, 3 | BRF_GRA }, // 9 - { "sx015-19.b3", 0x400000, 0x994b5063, 3 | BRF_GRA }, // 10 - { "sx015-18.c0", 0x400000, 0x72d43fd4, 3 | BRF_GRA }, // 11 - { "sx015-17.c1", 0x400000, 0xfdfd82f1, 3 | BRF_GRA }, // 12 - { "sx015-16.c2", 0x400000, 0x86aa314b, 3 | BRF_GRA }, // 13 - { "sx015-15.c3", 0x400000, 0x11f50e16, 3 | BRF_GRA }, // 14 - { "sx015-14.d0", 0x400000, 0x186f83fa, 3 | BRF_GRA }, // 15 - { "sx015-13.d1", 0x400000, 0xea6e5329, 3 | BRF_GRA }, // 16 - { "sx015-12.d2", 0x400000, 0x80336523, 3 | BRF_GRA }, // 17 - { "sx015-11.d3", 0x400000, 0x134c8e28, 3 | BRF_GRA }, // 18 - - { "sx015-06.s0", 0x200000, 0x0d5a206c, 0 | BRF_SND }, // 19 Ensoniq samples 0 - - { "sx015-05.s1", 0x200000, 0xbb8cebe2, 1 | BRF_SND }, // 20 Ensoniq samples 1 - - { "sx015-04.s2", 0x200000, 0xf6e933df, 2 | BRF_SND }, // 21 Ensoniq samples 2 - { "sx015-02.s4", 0x200000, 0x6567bc3e, 2 | BRF_SND }, // 22 - - { "sx015-03.s3", 0x200000, 0x5b51ab21, 3 | BRF_SND }, // 23 Ensoniq samples 3 - { "sx015-01.s5", 0x200000, 0x481b00ed, 3 | BRF_SND }, // 24 -}; - -STD_ROM_PICK(srmp7) -STD_ROM_FN(srmp7) - -static void Srmp7V60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvV60RAM2, 0x010000, 0x050fff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xc00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(srmp7_write_word); - v60SetWriteByteHandler(srmp7_write_byte); - v60SetReadWordHandler(srmp7_read_word); - v60SetReadByteHandler(srmp7_read_byte); -} - -static void Srmp7ROMCallback() -{ - return; // iq_132 - - memcpy (DrvSndROM0 + 0x400000, DrvSndROM0, 0x400000); - memcpy (DrvSndROM1 + 0x400000, DrvSndROM1, 0x400000); -} - -static INT32 Srmp7Init() -{ - return DrvCommonInit(Srmp7V60Map, Srmp7ROMCallback, 0, 0, 1, 2, 3, 0.80, 0); -} - -struct BurnDriver BurnDrvSrmp7 = { - "srmp7", NULL, NULL, NULL, "1997", - "Super Real Mahjong P7 (Japan)\0", "No sound.", "Seta", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MAHJONG, 0, - NULL, srmp7RomInfo, srmp7RomName, NULL, NULL, Srmp7InputInfo, Srmp7DIPInfo, - Srmp7Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 239, 4, 3 -}; - - -// Pachinko Sexy Reaction (Japan) - -static struct BurnRomInfo sxyreactRomDesc[] = { - { "ac414e00.u2", 0x080000, 0xd5dd7593, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "ac413e00.u1", 0x080000, 0xf46aee4a, 2 | BRF_PRG | BRF_ESS }, // 1 - { "ac416e00.u47", 0x080000, 0xe0f7bba9, 2 | BRF_PRG | BRF_ESS }, // 2 - { "ac415e00.u46", 0x080000, 0x92de1b5f, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "ac1401m0.u6", 0x400000, 0x0b7b693c, 3 | BRF_GRA }, // 4 Graphics - { "ac1402m0.u9", 0x400000, 0x9d593303, 3 | BRF_GRA }, // 5 - { "ac1403m0.u12", 0x200000, 0xaf433eca, 3 | BRF_GRA }, // 6 - { "ac1404m0.u7", 0x400000, 0xcdda2ccb, 3 | BRF_GRA }, // 7 - { "ac1405m0.u10", 0x400000, 0xe5e7a5df, 3 | BRF_GRA }, // 8 - { "ac1406m0.u13", 0x200000, 0xc7053409, 3 | BRF_GRA }, // 9 - { "ac1407m0.u8", 0x400000, 0x28c83d5e, 3 | BRF_GRA }, // 10 - { "ac1408m0.u11", 0x400000, 0xc45bab47, 3 | BRF_GRA }, // 11 - { "ac1409m0.u14", 0x200000, 0xbe1c66c2, 3 | BRF_GRA }, // 12 - - { "ac1410m0.u41", 0x400000, 0x2a880afc, 4 | BRF_SND }, // 13 Ensoniq samples 0 - - { "ac1411m0.u42", 0x400000, 0x2ba4ca43, 5 | BRF_SND }, // 14 Ensoniq samples 1 -}; - -STD_ROM_PICK(sxyreact) -STD_ROM_FN(sxyreact) - -static void SexyreactRomLoadCallback() -{ - DrvMemSwap(DrvSndROM1, DrvSndROM1 + 0x200000, 0x200000); -} - -static void SxyreactV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvNVRAM, 0x580800, 0x58ffff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xe00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(sxyreact_write_word); - v60SetWriteByteHandler(sxyreact_write_byte); - v60SetReadWordHandler(sxyreact_read_word); - v60SetReadByteHandler(sxyreact_read_byte); -} - -static INT32 SxyreactInit() -{ - return DrvCommonInit(SxyreactV60Map, SexyreactRomLoadCallback, 1, 0, 1, 2, -1, 0.10, 0); -} - -struct BurnDriver BurnDrvSxyreact = { - "sxyreact", NULL, NULL, NULL, "1998", - "Pachinko Sexy Reaction (Japan)\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MISC, 0, - NULL, sxyreactRomInfo, sxyreactRomName, NULL, NULL, SxyreactInputInfo, SxyreactDIPInfo, - SxyreactInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 338, 240, 4, 3 -}; - - -// Pachinko Sexy Reaction 2 (Japan) - -static struct BurnRomInfo sxyreac2RomDesc[] = { - { "ac1714e00.u32", 0x200000, 0x78075d70, 1 | BRF_PRG | BRF_ESS }, // 0 V60 Code - - { "ac1701t00.u6", 0x400000, 0xe14611c2, 3 | BRF_GRA }, // 1 Graphics - { "ac1702t00.u9", 0x400000, 0x2c8b07f8, 3 | BRF_GRA }, // 2 - { "ac1703t00.u7", 0x400000, 0xd6c7e861, 3 | BRF_GRA }, // 3 - { "ac1704t00.u10", 0x400000, 0x5fa7ccf0, 3 | BRF_GRA }, // 4 - { "ac1705t00.u8", 0x400000, 0x2dff0652, 3 | BRF_GRA }, // 5 - { "ac1706t00.u11", 0x400000, 0xe7a168e0, 3 | BRF_GRA }, // 6 - - { "ac1707t00.u41", 0x400000, 0x28999bc4, 4 | BRF_SND }, // 7 Ensoniq samples 0 - - { "ac1708t00.u42", 0x400000, 0x7001eec0, 5 | BRF_SND }, // 8 Ensoniq samples 1 -}; - -STD_ROM_PICK(sxyreac2) -STD_ROM_FN(sxyreac2) - -static INT32 Sxyreac2Init() -{ - return DrvCommonInit(SxyreactV60Map, SexyreactRomLoadCallback, 1, 0, 1, 2, -1, 0.10, 0); -} - -struct BurnDriver BurnDrvSxyreac2 = { - "sxyreac2", NULL, NULL, NULL, "1999", - "Pachinko Sexy Reaction 2 (Japan)\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_MISC, 0, - NULL, sxyreac2RomInfo, sxyreac2RomName, NULL, NULL, SxyreactInputInfo, SxyreactDIPInfo, - Sxyreac2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Joryuu Syougi Kyoushitsu (Japan) - -static struct BurnRomInfo jskRomDesc[] = { - { "jsk-u72.bin", 0x080000, 0xdb6b2554, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "jsk-u71.bin", 0x080000, 0xf6774fba, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "jsk-a0.bin", 0x400000, 0x18981a19, 3 | BRF_GRA }, // 2 Graphics - { "jsk-b0.bin", 0x400000, 0xf6df0ff9, 3 | BRF_GRA }, // 3 - { "jsk-c0.bin", 0x400000, 0xb8282939, 3 | BRF_GRA }, // 4 - { "jsk-d0.bin", 0x400000, 0xfc733e0c, 3 | BRF_GRA }, // 5 - - { "jsk-s0.u65", 0x200000, 0x8d1a9aeb, 0 | BRF_SND }, // 6 Ensoniq samples 0 - - { "jsk-u52.bin", 0x020000, 0xb11aef0c, 0 | BRF_PRG | BRF_ESS }, // 7 V810 Code - { "jsk-u38.bin", 0x020000, 0x8e5c0de3, 0 | BRF_PRG | BRF_ESS }, // 8 - { "jsk-u24.bin", 0x020000, 0x1fa6e156, 0 | BRF_PRG | BRF_ESS }, // 9 - { "jsk-u4.bin", 0x020000, 0xec22fb41, 0 | BRF_PRG | BRF_ESS }, // 10 -}; - -STD_ROM_PICK(jsk) -STD_ROM_FN(jsk) - -static INT32 JskInit() -{ - return 1; -} - -struct BurnDriverD BurnDrvJsk = { - "jsk", NULL, NULL, NULL, "1997", - "Joryuu Syougi Kyoushitsu (Japan)\0", "Unemulated CPU", "Visco", "MSSV", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_SETA_SSV, GBF_MAHJONG, 0, - NULL, jskRomInfo, jskRomName, NULL, NULL, DrvInputInfo, JskDIPInfo, - JskInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000, - 336, 240, 4, 3 -}; - - -// Eagle Shot Golf - -static struct BurnRomInfo eaglshotRomDesc[] = { - { "si003-09.u18", 0x080000, 0x219c71ce, 2 | BRF_PRG | BRF_ESS }, // 0 V60 Code - { "si003-10.u20", 0x080000, 0xc8872e48, 2 | BRF_PRG | BRF_ESS }, // 1 - - { "si003-01.u13", 0x200000, 0xd7df0d52, 8 | BRF_GRA }, // 2 Graphics - { "si003-02.u12", 0x200000, 0x92b4d50d, 8 | BRF_GRA }, // 3 - { "si003-03.u11", 0x200000, 0x6ede4012, 8 | BRF_GRA }, // 4 - { "si003-04.u10", 0x200000, 0x4c65d1a1, 8 | BRF_GRA }, // 5 - { "si003-05.u30", 0x200000, 0xdaf52d56, 8 | BRF_GRA }, // 6 - { "si003-06.u31", 0x200000, 0x449f9ae5, 8 | BRF_GRA }, // 7 - - { "si003-07.u23", 0x200000, 0x81679fd6, 4 | BRF_SND }, // 8 Ensoniq samples 0 - { "si003-08.u24", 0x200000, 0xd0122ba2, 4 | BRF_SND }, // 9 -}; - -STD_ROM_PICK(eaglshot) -STD_ROM_FN(eaglshot) - -static void EaglshotV60Map() -{ - v60MapMemory(DrvV60RAM0, 0x000000, 0x00ffff, MAP_RAM); - v60MapMemory(DrvSprRAM, 0x100000, 0x13ffff, MAP_RAM); - v60MapMemory(DrvPalRAM, 0x140000, 0x15ffff, MAP_ROM); // handler - v60MapMemory(DrvV60RAM1, 0x160000, 0x17ffff, MAP_RAM); - v60MapMemory(DrvNVRAM, 0xc00000, 0xc007ff, MAP_RAM); - v60MapMemory(DrvV60ROM, 0xf00000, 0xffffff, MAP_ROM); - v60SetWriteWordHandler(eaglshot_write_word); - v60SetWriteByteHandler(eaglshot_write_byte); - v60SetReadWordHandler(eaglshot_read_word); - v60SetReadByteHandler(eaglshot_read_byte); -} - -static INT32 EaglshotInit() -{ - return DrvCommonInit(EaglshotV60Map, NULL, 0, 0, 0, 0, 0, 0.80, 0); -} - -struct BurnDriver BurnDrvEaglshot = { - "eaglshot", NULL, NULL, NULL, "1994", - "Eagle Shot Golf\0", NULL, "Sammy", "SSV", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SETA_SSV, GBF_SPORTSMISC, 0, - NULL, eaglshotRomInfo, eaglshotRomName, NULL, NULL, EaglshotInputInfo, EaglshotDIPInfo, - EaglshotInit, DrvExit, DrvFrame, DrvDraw, eaglshtScan, &DrvRecalc, 0x8000, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_suna16.cpp b/jan/src/burn/drv/pst90s/d_suna16.cpp deleted file mode 100644 index 0fbd59a5b..000000000 --- a/jan/src/burn/drv/pst90s/d_suna16.cpp +++ /dev/null @@ -1,2401 +0,0 @@ -// FB Alpha SunA 16-bit hardware driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "burn_ym3526.h" -#include "driver.h" -#include "dac.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvGfxROM0; -static UINT32 nGfxROM0Len; -static UINT8 *DrvGfxROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvPalRAM2; -static UINT32 *Palette; -static UINT32 *DrvPalette; - -static INT16 *pFMBuffer; -static INT16 *pAY8910Buffer[3]; -static INT16 *pSoundBuffer; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvJoy5[16]; -static UINT8 DrvJoy6[16]; - -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static UINT16 DrvInputs[6]; - -static INT32 game_select = 0; - -static UINT8 soundlatch; -static UINT8 soundlatch2; -static UINT8 soundlatch3; -static UINT8 flipscreen; -static UINT8 color_bank; - -static UINT8 bestofbest_prot = 0; - -static UINT8 z80bankdata[2]; - -static struct BurnInputInfo BestbestInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 15, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 15, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 14, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy1 + 6, "p1 fire 3"}, - {"P1 Button 4" , BIT_DIGITAL , DrvJoy1 + 9, "p1 fire 4"}, - {"P1 Button 5" , BIT_DIGITAL , DrvJoy1 + 10, "p1 fire 5"}, - {"P1 Button 6" , BIT_DIGITAL , DrvJoy1 + 11, "p1 fire 6"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 14, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy2 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy2 + 6, "p2 fire 3"}, - {"P2 Button 4" , BIT_DIGITAL , DrvJoy2 + 9, "p2 fire 4"}, - {"P2 Button 5" , BIT_DIGITAL , DrvJoy2 + 10, "p2 fire 5"}, - {"P2 Button 6" , BIT_DIGITAL , DrvJoy2 + 11, "p2 fire 6"}, - - {"Service" , BIT_DIGITAL , DrvJoy3 + 6, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bestbest) - -static struct BurnInputInfo UballoonInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 15, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 15, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 14, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 14, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy2 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p2 fire 2"}, - - {"Service" , BIT_DIGITAL , DrvJoy1 + 12, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Uballoon) - -static struct BurnInputInfo BssoccerInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy6 + 4, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy6 + 5, "p2 coin" }, - {"Coin 3" , BIT_DIGITAL , DrvJoy6 + 6, "p3 coin" }, - {"Coin 4" , BIT_DIGITAL , DrvJoy6 + 7, "p4 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 7, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy2 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy2 + 6, "p2 fire 3"}, - - {"P3 Start" , BIT_DIGITAL , DrvJoy3 + 7, "p3 start" }, - {"P3 Up" , BIT_DIGITAL , DrvJoy3 + 0, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , DrvJoy3 + 1, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , DrvJoy3 + 2, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , DrvJoy3 + 3, "p3 right" }, - {"P3 Button 1" , BIT_DIGITAL , DrvJoy3 + 4, "p3 fire 1"}, - {"P3 Button 2" , BIT_DIGITAL , DrvJoy3 + 5, "p3 fire 2"}, - {"P3 Button 3" , BIT_DIGITAL , DrvJoy3 + 6, "p3 fire 3"}, - - {"P4 Start" , BIT_DIGITAL , DrvJoy4 + 7, "p4 start" }, - {"P4 Up" , BIT_DIGITAL , DrvJoy4 + 0, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , DrvJoy4 + 1, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , DrvJoy4 + 2, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , DrvJoy4 + 3, "p4 right" }, - {"P4 Button 1" , BIT_DIGITAL , DrvJoy4 + 4, "p4 fire 1"}, - {"P4 Button 2" , BIT_DIGITAL , DrvJoy4 + 5, "p4 fire 2"}, - {"P4 Button 3" , BIT_DIGITAL , DrvJoy4 + 6, "p4 fire 3"}, - - {"Service" , BIT_DIGITAL , DrvJoy3 + 6, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip 3", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Bssoccer) - -static struct BurnInputInfo SunaqInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 7, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy2 + 7, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 6, "p1 start" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 0, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 1, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy1 + 2, "p1 fire 3"}, - {"P1 Button 4" , BIT_DIGITAL , DrvJoy1 + 3, "p1 fire 4"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 6, "p2 start" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 0, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 1, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy2 + 2, "p2 fire 3"}, - {"P2 Button 4" , BIT_DIGITAL , DrvJoy2 + 3, "p2 fire 4"}, - - {"Service" , BIT_DIGITAL , DrvJoy3 + 6, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Sunaq) - -static struct BurnDIPInfo bestbestDIPList[]= -{ - {0x1a, 0xff, 0xff, 0xff, NULL }, - {0x1b, 0xff, 0xff, 0xff, NULL }, - - {0x1a, 0xfe, 0, 8, "Coinage" }, - {0x1a, 0x01, 0x07, 0x00, "5C 1C" }, - {0x1a, 0x01, 0x07, 0x01, "4C 1C" }, - {0x1a, 0x01, 0x07, 0x02, "3C 1C" }, - {0x1a, 0x01, 0x07, 0x03, "2C 1C" }, - {0x1a, 0x01, 0x07, 0x07, "1C 1C" }, - {0x1a, 0x01, 0x07, 0x06, "1C 2C" }, - {0x1a, 0x01, 0x07, 0x05, "1C 3C" }, - {0x1a, 0x01, 0x07, 0x04, "1C 4C" }, - - {0x1a, 0xfe, 0, 4, "Difficulty" }, - {0x1a, 0x01, 0x18, 0x18, "Easy" }, - {0x1a, 0x01, 0x18, 0x10, "Normal" }, - {0x1a, 0x01, 0x18, 0x08, "Hard" }, - {0x1a, 0x01, 0x18, 0x00, "Hardest" }, - - {0x1a, 0xfe, 0, 2, "Display Combos" }, - {0x1a, 0x01, 0x20, 0x00, "Off" }, - {0x1a, 0x01, 0x20, 0x20, "On" }, - - {0x1a, 0xfe, 0, 2, "Demo Sounds" }, - {0x1a, 0x01, 0x80, 0x80, "Off" }, - {0x1a, 0x01, 0x80, 0x00, "On" }, - - {0x1b, 0xfe, 0, 2, "Flip Screen" }, - {0x1b, 0x01, 0x01, 0x01, "Off" }, - {0x1b, 0x01, 0x01, 0x00, "On" }, - - {0x1b, 0xfe, 0, 4, "Play Time" }, - {0x1b, 0x01, 0x06, 0x06, "1:10" }, - {0x1b, 0x01, 0x06, 0x04, "1:20" }, - {0x1b, 0x01, 0x06, 0x02, "1:30" }, - {0x1b, 0x01, 0x06, 0x00, "1:40" }, -}; - -STDDIPINFO(bestbest) - -static struct BurnDIPInfo bssoccerDIPList[]= -{ - {0x26, 0xff, 0xff, 0xff, NULL }, - {0x27, 0xff, 0xff, 0xff, NULL }, - {0x28, 0xff, 0xff, 0xff, NULL }, - - {0x26, 0xfe, 0, 8, "Coinage" }, - {0x26, 0x01, 0x07, 0x00, "4C 1C" }, - {0x26, 0x01, 0x07, 0x01, "3C 1C" }, - {0x26, 0x01, 0x07, 0x02, "2C 1C" }, - {0x26, 0x01, 0x07, 0x07, "1C 1C" }, - {0x26, 0x01, 0x07, 0x06, "1C 2C" }, - {0x26, 0x01, 0x07, 0x05, "1C 3C" }, - {0x26, 0x01, 0x07, 0x04, "1C 4C" }, - {0x26, 0x01, 0x07, 0x03, "1C 5C" }, - - {0x26, 0xfe, 0, 4, "Difficulty" }, - {0x26, 0x01, 0x18, 0x10, "Easy" }, - {0x26, 0x01, 0x18, 0x18, "Normal" }, - {0x26, 0x01, 0x18, 0x08, "Hard" }, - {0x26, 0x01, 0x18, 0x00, "Hardest?" }, - - {0x26, 0xfe, 0, 2, "Demo Sounds" }, - {0x26, 0x01, 0x20, 0x00, "Off" }, - {0x26, 0x01, 0x20, 0x20, "On" }, - - {0x26, 0xfe, 0, 2, "Flip Screen" }, - {0x26, 0x01, 0x40, 0x40, "Off" }, - {0x26, 0x01, 0x40, 0x00, "On" }, - - {0x27, 0xfe, 0, 4, "Play Time P1" }, - {0x27, 0x01, 0x03, 0x03, "1:30" }, - {0x27, 0x01, 0x03, 0x02, "1:45" }, - {0x27, 0x01, 0x03, 0x01, "2:00" }, - {0x27, 0x01, 0x03, 0x00, "2:15" }, - - {0x27, 0xfe, 0, 4, "Play Time P2" }, - {0x27, 0x01, 0x0c, 0x0c, "1:30" }, - {0x27, 0x01, 0x0c, 0x08, "1:45" }, - {0x27, 0x01, 0x0c, 0x04, "2:00" }, - {0x27, 0x01, 0x0c, 0x00, "2:15" }, - - {0x27, 0xfe, 0, 4, "Play Time P3" }, - {0x27, 0x01, 0x30, 0x30, "1:30" }, - {0x27, 0x01, 0x30, 0x20, "1:45" }, - {0x27, 0x01, 0x30, 0x10, "2:00" }, - {0x27, 0x01, 0x30, 0x00, "2:15" }, - - {0x27, 0xfe, 0, 4, "Play Time P4" }, - {0x27, 0x01, 0xc0, 0xc0, "1:30" }, - {0x27, 0x01, 0xc0, 0x80, "1:45" }, - {0x27, 0x01, 0xc0, 0x40, "2:00" }, - {0x27, 0x01, 0xc0, 0x00, "2:15" }, - - {0x28, 0xfe, 0, 2, "Copyright" }, - {0x28, 0x01, 0x01, 0x01, "Distributer Unico" }, - {0x28, 0x01, 0x01, 0x00, "All Rights Reserved" }, -}; - -STDDIPINFO(bssoccer) - - -static struct BurnDIPInfo sunaqDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xcf, NULL }, - - {0x0e, 0xfe, 0, 8, "Coinage" }, - {0x0e, 0x01, 0x07, 0x00, "5C 1C" }, - {0x0e, 0x01, 0x07, 0x01, "4C 1C" }, - {0x0e, 0x01, 0x07, 0x02, "3C 1C" }, - {0x0e, 0x01, 0x07, 0x03, "2C 1C" }, - {0x0e, 0x01, 0x07, 0x07, "1C 1C" }, - {0x0e, 0x01, 0x07, 0x06, "1C 2C" }, - {0x0e, 0x01, 0x07, 0x05, "1C 3C" }, - {0x0e, 0x01, 0x07, 0x04, "1C 4C" }, - - {0x0e, 0xfe, 0, 4, "Difficulty" }, - {0x0e, 0x01, 0x18, 0x00, "Easy" }, - {0x0e, 0x01, 0x18, 0x08, "Normal" }, - {0x0e, 0x01, 0x18, 0x10, "Hard" }, - {0x0e, 0x01, 0x18, 0x18, "Hardest" }, - - {0x0e, 0xfe, 0, 2, "Demo Sounds" }, - {0x0e, 0x01, 0x20, 0x20, "Off" }, - {0x0e, 0x01, 0x20, 0x00, "On" }, - - {0x0e, 0xfe, 0, 2, "Flip Screen" }, - {0x0e, 0x01, 0x40, 0x40, "Off" }, - {0x0e, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(sunaq) - - -static struct BurnDIPInfo uballoonDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0x12, 0xfe, 0, 2, "Copyright" }, - {0x12, 0x01, 0x30, 0x30, "Distributer Unico" }, - {0x12, 0x01, 0x30, 0x20, "All Rights Reserved" }, -// {0x12, 0x01, 0x30, 0x10, "Distributer Unico" }, -// {0x12, 0x01, 0x30, 0x00, "All Rights Reserved" }, - - {0x13, 0xfe, 0, 8, "Coinage" }, - {0x13, 0x01, 0x07, 0x00, "5C 1C" }, - {0x13, 0x01, 0x07, 0x01, "4C 1C" }, - {0x13, 0x01, 0x07, 0x02, "3C 1C" }, - {0x13, 0x01, 0x07, 0x03, "2C 1C" }, - {0x13, 0x01, 0x07, 0x07, "1C 1C" }, - {0x13, 0x01, 0x07, 0x06, "1C 2C" }, - {0x13, 0x01, 0x07, 0x05, "1C 3C" }, - {0x13, 0x01, 0x07, 0x04, "1C 4C" }, - - {0x13, 0xfe, 0, 4, "Lives" }, - {0x13, 0x01, 0x18, 0x10, "2" }, - {0x13, 0x01, 0x18, 0x18, "3" }, - {0x13, 0x01, 0x18, 0x08, "4" }, - {0x13, 0x01, 0x18, 0x00, "5" }, - - {0x13, 0xfe, 0, 4, "Difficulty" }, - {0x13, 0x01, 0x60, 0x40, "Easy" }, - {0x13, 0x01, 0x60, 0x60, "Normal" }, - {0x13, 0x01, 0x60, 0x20, "Hard" }, - {0x13, 0x01, 0x60, 0x00, "Hardest" }, - - {0x14, 0xfe, 0, 2, "Flip Screen" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0x14, 0xfe, 0, 2, "Cabinet" }, - {0x14, 0x01, 0x02, 0x02, "Upright" }, - {0x14, 0x01, 0x02, 0x00, "Cocktail" }, - - {0x14, 0xfe, 0, 8, "Bonus Life" }, - {0x14, 0x01, 0x1c, 0x1c, "200K" }, - {0x14, 0x01, 0x1c, 0x10, "300K, 1000K" }, - {0x14, 0x01, 0x1c, 0x18, "400K" }, - {0x14, 0x01, 0x1c, 0x0c, "500K, 1500K" }, - {0x14, 0x01, 0x1c, 0x08, "500K, 2000K" }, - {0x14, 0x01, 0x1c, 0x04, "500K, 3000K" }, - {0x14, 0x01, 0x1c, 0x14, "600K" }, - {0x14, 0x01, 0x1c, 0x00, "None" }, - - {0x14, 0xfe, 0, 2, "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(uballoon) - - -//------------------------------------------------------------------------------------------------- -// Generic functions - -static void suna_palette_write(INT32 offset) -{ - UINT8 r, b, g; - UINT16 data = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + offset))); - - r = (data >> 0) & 0x1f; - r = (r << 3) | (r >> 2); - - g = (data >> 5) & 0x1f; - g = (g << 3) | (g >> 2); - - b = (data >> 10) & 0x1f; - b = (b << 3) | (b >> 2); - - Palette[offset>>1] = (r << 16) | (g << 8) | b; - DrvPalette[offset>>1] = BurnHighCol(r, g, b, 0); - - return; -} - -//------------------------------------------------------------------------------------------------- -// Memory handlers - - -//---------------------------------------------------------------- -// Best of Best - - -//------------------ -// 68k - -UINT16 __fastcall bestbest_read_word(UINT32 address) -{ - switch (address & ~1) - { - case 0x500000: - return DrvInputs[0]; - - case 0x500002: - return DrvInputs[1]; - - case 0x500004: - return DrvInputs[2]; - } - - return 0; -} - -UINT8 __fastcall bestbest_read_byte(UINT32 address) -{ - switch (address) - { - case 0x500000: - case 0x500001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x500002: - case 0x500003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x500004: - case 0x500005: - return DrvInputs[2] >> ((~address & 1) << 3); - - case 0x500019: - return bestofbest_prot; - } - - return 0; -} - -void __fastcall bestbest_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x540000) { - *((UINT16*)(DrvPalRAM + (address & 0x0fff))) = BURN_ENDIAN_SWAP_INT16(data); - suna_palette_write(address & 0xffe); - return; - } - - switch (address & ~1) - { - case 0x500000: - soundlatch = data; - return; - - case 0x500002: - flipscreen = data & 0x10; - return; - } - - return; -} - -void __fastcall bestbest_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0x540000) { - DrvPalRAM[address & 0xfff] = data; - suna_palette_write(address & 0xffe); - return; - } - - switch (address) - { - case 0x500000: - case 0x500001: - soundlatch = data; - return; - - case 0x500002: - case 0x500003: - flipscreen = data & 0x10; - return; - - case 0x500008: - case 0x500009: - switch (data & 0xff) { - case 0x00: bestofbest_prot ^= 0x09; break; - case 0x08: bestofbest_prot ^= 0x02; break; - case 0x0c: bestofbest_prot ^= 0x03; break; - } - return; - } - - return; -} - -//------------------ -// Z80 #0 - -void __fastcall bestbest_sound0_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - case 0xc001: - BurnYM3526Write(address & 1, data); - return; - - case 0xc002: - case 0xc003: - AY8910Write(0, address & 1, data); - return; - - case 0xf000: - soundlatch2 = data; - return; - } - - return; -} - -UINT8 __fastcall bestbest_sound0_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - return soundlatch; - } - - return 0; -} - -//------------------ -// Z80 #1 - -void __fastcall bestbest_sound1_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: { DACWrite(0, (data & 0xf) * 0x11); return; } - case 0x01: { DACWrite(1, (data & 0xf) * 0x11); return; } - - case 0x02: { DACWrite(2, (data & 0xf) * 0x11); return; } - case 0x03: { DACWrite(3, (data & 0xf) * 0x11); return; } - } - - return; -} - -UINT8 __fastcall bestbest_sound1_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return soundlatch2; - } - - return 0; -} - - -//---------------------------------------------------------------- -// SunA Quiz - - -//------------------ -// 68k - -UINT16 __fastcall sunaq_read_word(UINT32 address) -{ - if ((address & 0xfff000) == 0x540000) { - if (address & 0x200) { - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM2 + (address & 0xffe)))); - } else { - address += color_bank << 9; - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + (address & 0xffe)))); - } - } - - switch (address & ~1) - { - case 0x500000: - return DrvInputs[0]; - - case 0x500002: - return DrvInputs[1]; - - case 0x500004: - return DrvInputs[2]; - - case 0x500006: - return DrvInputs[3]; - } - - return 0; -} - -UINT8 __fastcall sunaq_read_byte(UINT32 address) -{ - if ((address & 0xfff000) == 0x540000) { - if (address & 0x200) { - return DrvPalRAM2[address & 0xffe]; - } else { - address += color_bank << 9; - return DrvPalRAM[address & 0xffe]; - } - } - - switch (address) - { - case 0x500000: - case 0x500001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x500002: - case 0x500003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x500004: - case 0x500005: - return DrvInputs[2] >> ((~address & 1) << 3); - - case 0x500006: - case 0x500007: - return DrvInputs[3] >> ((~address & 1) << 3); - } - - return 0; -} - -void __fastcall sunaq_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x540000) { - if (address & 0x200) { - *((UINT16*)(DrvPalRAM2 + (address & 0xffff))) = BURN_ENDIAN_SWAP_INT16(data); - } else { - address += color_bank << 9; - *((UINT16*)(DrvPalRAM + (address & 0xffff))) = BURN_ENDIAN_SWAP_INT16(data); - suna_palette_write(address & 0xffff); - } - return; - } - - switch (address & ~1) - { - case 0x500000: - soundlatch = data; - return; - - case 0x500002: - flipscreen = data & 0x01; - color_bank = (data >> 2) & 1; - return; - - case 0x500004: - // coin counter - return; - } - return; -} - -void __fastcall sunaq_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0x540000) { - if (address & 0x200) { - DrvPalRAM2[address & 0xfff] = data; - } else { - address += color_bank << 9; - DrvPalRAM[address & 0xfff] = data; - suna_palette_write(address & 0xffe); - } - - return; - } - - switch (address) - { - case 0x500000: - case 0x500001: - soundlatch = data; - return; - - case 0x500002: - case 0x500003: - flipscreen = data & 0x01; - color_bank = (data >> 2) & 1; - return; - - case 0x500004: - case 0x500005: - // coin counter - return; - } - return; -} - -//------------------ -// Z80 #0 - -void __fastcall sunaq_sound0_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf800: - BurnYM2151SelectRegister(data); - return; - - case 0xf801: - BurnYM2151WriteRegister(data); - return; - - case 0xfc00: - soundlatch2 = data; - return; - } - - return; -} - - -//---------------------------------------------------------------- -// Ultra Balloon - - -//------------------ -// 68k - -static UINT8 uballoon_prot_read(UINT16 offset) -{ - UINT8 ret = 0; - - switch (offset) - { - case 0x0011: - ret = ((bestofbest_prot & 0x03) == 0x03) ? 2 : 0; - ret |= ((bestofbest_prot & 0x30) == 0x30) ? 1 : 0; - break; - - case 0x0311: - ret = 0x03; - break; - - default: - // bprintf (0, _T("uballoon_prot_read %04X\n"), offset); - break; - } - - return ret; -} - -static void uballoon_prot_write(UINT16 offset, UINT8 data) -{ - switch (offset) - { - case 0x0001: - bestofbest_prot = data; - break; - - default: - // bprintf (0, _T("uballoon_prot_write %04X=%02X\n"), offset, data); - break; - } -} - -UINT16 __fastcall uballoon_read_word(UINT32 address) -{ - if ((address & 0xfff000) == 0x200000) { - if (address & 0x200) { - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM2 + (address & 0xffe)))); - } else { - address += color_bank << 9; - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + (address & 0xffe)))); - } - } - - switch (address & ~1) - { - case 0x600000: - return DrvInputs[0]; - - case 0x600002: - return DrvInputs[1]; - - case 0x600004: - return DrvInputs[2]; - - case 0x600006: - return DrvInputs[3]; - } - - return 0; -} - -UINT8 __fastcall uballoon_read_byte(UINT32 address) -{ - if ((address & 0xff0000) == 0xa00000) { - return uballoon_prot_read(address); - } - - if ((address & 0xfff000) == 0x200000) { - if (address & 0x200) { - return DrvPalRAM2[address & 0xffe]; - } else { - address += color_bank << 9; - return DrvPalRAM[address & 0xffe]; - } - } - - switch (address) - { - case 0x600000: - case 0x600001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x600002: - case 0x600003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x600004: - case 0x600005: - return DrvInputs[2] >> ((~address & 1) << 3); - - case 0x600006: - case 0x600007: - return DrvInputs[3] >> ((~address & 1) << 3); - } - - return 0; -} - -void __fastcall uballoon_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x200000) { - if (address & 0x200) { - *((UINT16*)(DrvPalRAM2 + (address & 0xffff))) = BURN_ENDIAN_SWAP_INT16(data); - } else { - address += color_bank << 9; - *((UINT16*)(DrvPalRAM + (address & 0xffff))) = BURN_ENDIAN_SWAP_INT16(data); - suna_palette_write(address & 0xffff); - } - return; - } - - switch (address & ~1) - { - case 0x600000: - soundlatch = data; - return; - - case 0x600004: - flipscreen = data & 0x01; - color_bank = (data >> 2) & 1; - return; - } - return; -} - -void __fastcall uballoon_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0x200000) { - if (address & 0x200) { - DrvPalRAM2[address & 0xfff] = data; - } else { - address += color_bank << 9; - DrvPalRAM[address & 0xfff] = data; - suna_palette_write(address & 0xffe); - } - return; - } - - if ((address & 0xff0000) == 0xa00000) { - uballoon_prot_write(address, data); - return; - } - - switch (address) - { - case 0x600000: - case 0x600001: - soundlatch = data; - return; - - case 0x600004: - case 0x600005: - flipscreen = data & 0x01; - color_bank = (data >> 2) & 1; - return; - } - return; -} - -//------------------ -// Z80 #1 - -static void uballoon_bankswitch(INT32 data) -{ - z80bankdata[0] = data; - - INT32 bank = ((data & 1) << 16) | 0x400; - - ZetMapArea(0x0400, 0xffff, 0, DrvZ80ROM1 + bank); - ZetMapArea(0x0400, 0xffff, 2, DrvZ80ROM1 + bank); -} - -void __fastcall uballoon_sound1_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: { DACWrite(0, (data & 0xf) * 0x11); return; } - case 0x01: { DACWrite(1, (data & 0xf) * 0x11); return; } - - case 0x03: - uballoon_bankswitch(data); - return; - } - - return; -} - -UINT8 __fastcall uballoon_sound1_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return soundlatch2; - } - - return 0; -} - - -//---------------------------------------------------------------- -// Back Street Soccer - - -//------------------ -// 68k - -UINT16 __fastcall bssoccer_read_word(UINT32 address) -{ - if ((address & 0xfff000) == 0x400000) { - if (address & 0x200) { - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM2 + (address & 0xffe)))); - } else { - address += color_bank << 9; - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + (address & 0xffe)))); - } - } - - switch (address & ~1) - { - case 0xa00000: - return DrvInputs[0]; - - case 0xa00002: - return DrvInputs[1]; - - case 0xa00004: - return DrvInputs[2]; - - case 0xa00006: - return DrvInputs[3]; - - case 0xa00008: - return DrvInputs[4]; - - case 0xa0000a: - return DrvInputs[5]; - - } - - return 0; -} - -UINT8 __fastcall bssoccer_read_byte(UINT32 address) -{ - if ((address & 0xfff000) == 0x400000) { - if (address & 0x200) { - return DrvPalRAM2[address & 0xffe]; - } else { - address += color_bank << 9; - return DrvPalRAM[address & 0xffe]; - } - } - - switch (address) - { - case 0xa00000: - case 0xa00001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0xa00002: - case 0xa00003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0xa00004: - case 0xa00005: - return DrvInputs[2] >> ((~address & 1) << 3); - - case 0xa00006: - case 0xa00007: - return DrvInputs[3] >> ((~address & 1) << 3); - - case 0xa00008: - case 0xa00009: - return DrvInputs[4] >> ((~address & 1) << 3); - - case 0xa0000a: - case 0xa0000b: - return DrvInputs[5] >> ((~address & 1) << 3); - } - - return 0; -} - -void __fastcall bssoccer_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x400000) { - if (address & 0x200) { - *((UINT16*)(DrvPalRAM2 + (address & 0xffff))) = BURN_ENDIAN_SWAP_INT16(data); - } else { - address += color_bank << 9; - *((UINT16*)(DrvPalRAM + (address & 0xffff))) = BURN_ENDIAN_SWAP_INT16(data); - suna_palette_write(address & 0xffff); - } - return; - } - - switch (address & ~1) - { - case 0xa00000: - soundlatch = data; - return; - - case 0xa00002: - flipscreen = data & 0x01; - color_bank = (data >> 2) & 1; - return; - } - return; -} - -void __fastcall bssoccer_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0x400000) { - if (address & 0x200) { - DrvPalRAM[address & 0xfff] = data; - } else { - address += color_bank << 9; - DrvPalRAM[address & 0xfff] = data; - suna_palette_write(address & 0xffe); - } - return; - } - - switch (address) - { - case 0xa00000: - case 0xa00001: - soundlatch = data; - return; - - case 0xa00002: - case 0xa00003: - flipscreen = data & 0x01; - color_bank = (data >> 2) & 1; - return; - } - return; -} - -//------------------ -// Z80 #0 - -static void bssoccer_bankswitch_w(UINT8 *z80data, INT32 p, INT32 data) -{ - z80bankdata[p] = data; - - INT32 bank = ((data & 7) << 16) | 0x1000; - - ZetMapArea(0x1000, 0xffff, 0, z80data + bank); - ZetMapArea(0x1000, 0xffff, 2, z80data + bank); -} - -void __fastcall bssoccer_sound0_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf800: - BurnYM2151SelectRegister(data); - return; - - case 0xf801: - BurnYM2151WriteRegister(data); - return; - - case 0xfd00: - soundlatch2 = data; - return; - - case 0xfe00: - soundlatch3 = data; - return; - } - - return; -} - -UINT8 __fastcall bssoccer_sound0_read(UINT16 address) -{ - switch (address) - { - case 0xf801: - return BurnYM2151ReadStatus(); - - case 0xfc00: - return soundlatch; - } - - return 0; -} - -//------------------ -// Z80 #1 - -void __fastcall bssoccer_sound1_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: { DACWrite(0, (data & 0xf) * 0x11); return; } - case 0x01: { DACWrite(1, (data & 0xf) * 0x11); return; } - - case 0x03: - bssoccer_bankswitch_w(DrvZ80ROM1, 0, data); - return; - } - - return; -} - -UINT8 __fastcall bssoccer_sound1_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return soundlatch2; - } - - return 0; -} - -//------------------ -// Z80 #2 - -void __fastcall bssoccer_sound2_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: { DACWrite(2, (data & 0xf) * 0x11); return; } - case 0x01: { DACWrite(3, (data & 0xf) * 0x11); return; } - return; - - case 0x03: - bssoccer_bankswitch_w(DrvZ80ROM2, 1, data); - return; - } - - return; -} - -UINT8 __fastcall bssoccer_sound2_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return soundlatch3; - } - - return 0; -} - - -//------------------------------------------------------------------------------------------------- -// Initialization routines - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - for (INT32 j = 0; j < 2; j++) { - ZetOpen(j); - ZetReset(); - ZetClose(); - } - - if (game_select == 3) { - ZetOpen(2); - ZetReset(); - ZetClose(); - } - - soundlatch = 0; - soundlatch2 = 0; - soundlatch3 = 0; - color_bank = 0; - bestofbest_prot = 0; - flipscreen = 0; - - z80bankdata[0] = z80bankdata[1] = 0; - - if (game_select == 3) { - ZetOpen(1); - bssoccer_bankswitch_w(DrvZ80ROM1, 0, z80bankdata[0]); - ZetClose(); - ZetOpen(2); - bssoccer_bankswitch_w(DrvZ80ROM2, 1, z80bankdata[1]); - ZetClose(); - } - - if (game_select == 2) { - ZetOpen(1); - uballoon_bankswitch(z80bankdata[0]); - ZetClose(); - } - - if (game_select == 1) { - ZetOpen(1); - bssoccer_bankswitch_w(DrvZ80ROM1, 0, z80bankdata[0]); - ZetClose(); - } - - if (game_select) { - BurnYM2151Reset(); - } else { - BurnYM3526Reset(); - AY8910Reset(0); - } - - DACReset(); - - return 0; -} - - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x0200000; - DrvZ80ROM0 = Next; Next += 0x0010000; - DrvZ80ROM1 = Next; Next += 0x0080000; - DrvZ80ROM2 = Next; Next += 0x0080000; - - DrvGfxROM0 = Next; Next += 0x0600000; - if (game_select == 0) { - DrvGfxROM1 = Next; Next += 0x0800000; - } - - DrvPalette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 4 /*3*/ * sizeof(INT16); - pSoundBuffer = (INT16*)Next; Next += nBurnSoundLen * 2 * sizeof(INT16); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x0010000; - -// DrvZ80RAM0 = Next; Next += 0x0000800; - DrvZ80RAM0 = Next; Next += 0x0001000; - - DrvSprRAM0 = Next; Next += 0x0020000; - DrvSprRAM1 = Next; Next += 0x0020000; - - DrvPalRAM = Next; Next += 0x0001000; - DrvPalRAM2 = Next; Next += 0x0010000; - - Palette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(UINT8 *gfx_base, INT32 len) -{ - INT32 Plane[4] = {(len << 2) + 0, (len << 2) + 4, 0, 4 }; - INT32 XOffs[8] = { 3, 2, 1, 0, 11, 10, 9, 8 }; - INT32 YOffs[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < len; i++) tmp[i] = gfx_base[i] ^ 0xff; // copy & invert - - GfxDecode(((len * 8) / 4) / 64, 4, 8, 8, Plane, XOffs, YOffs, 0x80, tmp, gfx_base); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvLoadRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - - UINT8 *Load68K = Drv68KROM; - UINT8 *Loadz0 = DrvZ80ROM0; - UINT8 *Loadz1 = DrvZ80ROM1; - UINT8 *Loadz2 = DrvZ80ROM2; - UINT8 *Loadg0 = DrvGfxROM0; - UINT8 *Loadg1 = DrvGfxROM1; - - INT32 gfx0_len = 0; - INT32 gfx1_len = 0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - - if (BurnLoadRom(Load68K + 1, i + 0, 2)) return 1; - if (BurnLoadRom(Load68K + 0, i + 1, 2)) return 1; - - Load68K += 0x100000; - - i++; - - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(Loadz0, i, 1)) return 1; - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(Loadz1, i, 1)) return 1; - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(Loadz2, i, 1)) return 1; - continue; - } - - if ((ri.nType & 7) == 5) { - if (BurnLoadRom(Loadg0, i, 1)) return 1; - - Loadg0 += ri.nLen; - gfx0_len += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 6) { - if (BurnLoadRom(Loadg1, i, 1)) return 1; - - Loadg1 += ri.nLen; - gfx1_len += ri.nLen; - - continue; - } - } - - nGfxROM0Len = gfx0_len >> 5; - - if (gfx0_len) DrvGfxDecode(DrvGfxROM0, gfx0_len); - if (gfx1_len) DrvGfxDecode(DrvGfxROM1, gfx1_len); - - return 0; -} - -void bestbest_ay8910_write_a(UINT32,UINT32) -{ -} - -static void bestbestFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 bestbestSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -static INT32 bestbestSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (6000000.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 bssoccerSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (5000000.0000 / (nBurnFPS / 100.0000)))); -} - -static INT32 BestbestInit() -{ - INT32 nLen; - - game_select = 0; - - AllMem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - for (INT32 i = 0; i < 3; i++) { - pAY8910Buffer[i] = pFMBuffer + nBurnSoundLen * i; - } - - if (DrvLoadRoms()) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KROM, 0x040000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KROM, 0x080000, 0x0bffff, MAP_ROM); - SekMapMemory(Drv68KROM, 0x0c0000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KROM + 0x100000, 0x200000, 0x2fffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x540000, 0x540fff, MAP_ROM); - SekMapMemory(DrvPalRAM2, 0x541000, 0x54ffff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x580000, 0x58ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x5c0000, 0x5dffff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0x5e0000, 0x5fffff, MAP_RAM); - SekSetWriteByteHandler(0, bestbest_write_byte); - SekSetWriteWordHandler(0, bestbest_write_word); - SekSetReadByteHandler(0, bestbest_read_byte); - SekSetReadWordHandler(0, bestbest_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM0); - ZetMapArea(0xe000, 0xe7ff, 0, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe7ff, 1, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe7ff, 2, DrvZ80RAM0); - ZetSetReadHandler(bestbest_sound0_read); - ZetSetWriteHandler(bestbest_sound0_write); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0xffff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0xffff, 2, DrvZ80ROM1); - ZetSetInHandler(bestbest_sound1_in); - ZetSetOutHandler(bestbest_sound1_out); - ZetClose(); - - BurnYM3526Init(3000000, &bestbestFMIRQHandler, &bestbestSynchroniseStream, 0); - BurnTimerAttachZetYM3526(6000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, bestbest_ay8910_write_a, NULL); - AY8910SetRoute(0, BURN_SND_AY8910_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - AY8910SetRoute(0, BURN_SND_AY8910_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - AY8910SetRoute(0, BURN_SND_AY8910_ROUTE_3, 0.00, BURN_SND_ROUTE_BOTH); // suppressed? - - DACInit(0, 0, 1, bestbestSyncDAC); - DACInit(1, 0, 1, bestbestSyncDAC); - DACInit(2, 0, 1, bestbestSyncDAC); - DACInit(3, 0, 1, bestbestSyncDAC); - DACSetRoute(0, 0.40, BURN_SND_ROUTE_LEFT); - DACSetRoute(1, 0.40, BURN_SND_ROUTE_RIGHT); - DACSetRoute(2, 0.40, BURN_SND_ROUTE_LEFT); - DACSetRoute(3, 0.40, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 SunaqInit() -{ - INT32 nLen; - - game_select = 1; - - AllMem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvLoadRoms()) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvPalRAM2, 0x540400, 0x540fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x580000, 0x583fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x5c0000, 0x5dffff, MAP_RAM); - SekSetWriteByteHandler(0, sunaq_write_byte); - SekSetWriteWordHandler(0, sunaq_write_word); - SekSetReadByteHandler(0, sunaq_read_byte); - SekSetReadWordHandler(0, sunaq_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM0); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM0); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM0); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM0); - ZetSetWriteHandler(sunaq_sound0_write); - ZetSetReadHandler(bssoccer_sound0_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x0fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x0fff, 2, DrvZ80ROM1); - ZetMapArea(0x1000, 0xffff, 0, DrvZ80ROM1 + 0x1000); - ZetMapArea(0x1000, 0xffff, 2, DrvZ80ROM1 + 0x1000); - ZetSetInHandler(bssoccer_sound1_in); - ZetSetOutHandler(bssoccer_sound1_out); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - DACInit(0, 0, 2, bestbestSyncDAC); - DACInit(1, 0, 2, bestbestSyncDAC); - DACSetRoute(0, 0.50, BURN_SND_ROUTE_LEFT); - DACSetRoute(1, 0.50, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - - -static INT32 UballoonInit() -{ - INT32 nLen; - - game_select = 2; - - AllMem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvLoadRoms()) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvPalRAM2, 0x200400, 0x200fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x400000, 0x41ffff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x5c0000, 0x5dffff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x800000, 0x803fff, MAP_RAM); - SekSetWriteByteHandler(0, uballoon_write_byte); - SekSetWriteWordHandler(0, uballoon_write_word); - SekSetReadByteHandler(0, uballoon_read_byte); - SekSetReadWordHandler(0, uballoon_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM0); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM0); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM0); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM0); - ZetSetWriteHandler(sunaq_sound0_write); - ZetSetReadHandler(bssoccer_sound0_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x03ff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x03ff, 2, DrvZ80ROM1); - ZetMapArea(0x0400, 0xffff, 0, DrvZ80ROM1 + 0x400); - ZetMapArea(0x0400, 0xffff, 2, DrvZ80ROM1 + 0x400); - ZetSetInHandler(uballoon_sound1_in); - ZetSetOutHandler(uballoon_sound1_out); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - DACInit(0, 0, 1, bssoccerSyncDAC); - DACInit(1, 0, 1, bssoccerSyncDAC); - DACSetRoute(0, 0.50, BURN_SND_ROUTE_LEFT); - DACSetRoute(1, 0.50, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 BssoccerInit() -{ - INT32 nLen; - - game_select = 3; - - AllMem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvLoadRoms()) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x203fff, MAP_RAM); - SekMapMemory(DrvPalRAM2, 0x400400, 0x400fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0x600000, 0x61ffff, MAP_RAM); - SekSetWriteByteHandler(0, bssoccer_write_byte); - SekSetWriteWordHandler(0, bssoccer_write_word); - SekSetReadByteHandler(0, bssoccer_read_byte); - SekSetReadWordHandler(0, bssoccer_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0xf000, 0xf7ff, 0, DrvZ80RAM0); - ZetMapArea(0xf000, 0xf7ff, 1, DrvZ80RAM0); - ZetMapArea(0xf000, 0xf7ff, 2, DrvZ80RAM0); - ZetSetWriteHandler(bssoccer_sound0_write); - ZetSetReadHandler(bssoccer_sound0_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x0fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x0fff, 2, DrvZ80ROM1); - ZetMapArea(0x1000, 0xffff, 0, DrvZ80ROM1 + 0x1000); - ZetMapArea(0x1000, 0xffff, 2, DrvZ80ROM1 + 0x1000); - ZetSetInHandler(bssoccer_sound1_in); - ZetSetOutHandler(bssoccer_sound1_out); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapArea(0x0000, 0x0fff, 0, DrvZ80ROM2); - ZetMapArea(0x0000, 0x0fff, 2, DrvZ80ROM2); - ZetMapArea(0x1000, 0xffff, 0, DrvZ80ROM2 + 0x1000); - ZetMapArea(0x1000, 0xffff, 2, DrvZ80ROM2 + 0x1000); - ZetSetInHandler(bssoccer_sound2_in); - ZetSetOutHandler(bssoccer_sound2_out); - ZetClose(); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.20, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.20, BURN_SND_ROUTE_RIGHT); - - DACInit(0, 0, 1, bssoccerSyncDAC); - DACInit(1, 0, 1, bssoccerSyncDAC); - DACInit(2, 0, 1, bssoccerSyncDAC); - DACInit(3, 0, 1, bssoccerSyncDAC); - DACSetRoute(0, 0.40, BURN_SND_ROUTE_LEFT); - DACSetRoute(1, 0.40, BURN_SND_ROUTE_RIGHT); - DACSetRoute(2, 0.40, BURN_SND_ROUTE_LEFT); - DACSetRoute(3, 0.40, BURN_SND_ROUTE_RIGHT); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnFree (AllMem); - - if (game_select) { - BurnYM2151Exit(); - } else { - AY8910Exit(0); - BurnYM3526Exit(); - } - - DACExit(); - - SekExit(); - ZetExit(); - - GenericTilesExit(); - - return 0; -} - - -//------------------------------------------------------------------------------------------------- -// Drawing & CPU/sound emulation routines - - -static void draw_sprites(UINT16 *sprites, UINT8 *gfx_base, INT32 max_tile) -{ - INT32 offs; - - INT32 max_x = (256 - 0) - 8; - INT32 max_y = (256 - 0) - 8; - - for (offs = 0xfc00/2; offs < 0x10000/2 ; offs += 4/2) - { - INT32 srcpg, srcx,srcy, dimx,dimy; - INT32 tile_x, tile_xinc, tile_xstart; - INT32 tile_y, tile_yinc; - INT32 dx, dy; - INT32 flipx, y0; - - INT32 y = BURN_ENDIAN_SWAP_INT16(sprites[ offs + 0 + 0x00000 / 2 ]); - INT32 x = BURN_ENDIAN_SWAP_INT16(sprites[ offs + 1 + 0x00000 / 2 ]); - INT32 dim = BURN_ENDIAN_SWAP_INT16(sprites[ offs + 0 + 0x10000 / 2 ]); - - INT32 bank = (x >> 12) & 0xf; - - srcpg = ((y & 0xf000) >> 12) + ((x & 0x0200) >> 5); - srcx = ((y >> 8) & 0xf) * 2; - srcy = ((dim >> 0) & 0xf) * 2; - - switch ( (dim >> 4) & 0xc ) - { - case 0x0: dimx = 2; dimy = 2; y0 = 0x100; break; - case 0x4: dimx = 4; dimy = 4; y0 = 0x100; break; - case 0x8: dimx = 2; dimy = 32; y0 = 0x130; break; - default: - case 0xc: dimx = 4; dimy = 32; y0 = 0x120; break; - } - - if (dimx==4) { flipx = srcx & 2; srcx &= ~2; } - else { flipx = 0; } - - x = (x & 0xff) - (x & 0x100); - y = (y0 - (y & 0xff) - dimy*8 ) & 0xff; - - if (flipx) { tile_xstart = dimx-1; tile_xinc = -1; } - else { tile_xstart = 0; tile_xinc = +1; } - - tile_y = 0; tile_yinc = +1; - - for (dy = 0; dy < dimy * 8; dy += 8) - { - tile_x = tile_xstart; - - for (dx = 0; dx < dimx * 8; dx += 8) - { - INT32 addr = (srcpg * 0x20 * 0x20) + - ((srcx + tile_x) & 0x1f) * 0x20 + - ((srcy + tile_y) & 0x1f); - - INT32 tile = BURN_ENDIAN_SWAP_INT16(sprites[ addr + 0x00000 / 2 ]); - INT32 color = BURN_ENDIAN_SWAP_INT16(sprites[ addr + 0x10000 / 2 ]); - - INT32 sx = x + dx; - INT32 sy = (y + dy) & 0xff; - - INT32 tile_flipx = tile & 0x4000; - INT32 tile_flipy = tile & 0x8000; - - if (flipx) tile_flipx ^= 0x4000; - - if (flipscreen) - { - sx = max_x - sx; - sy = max_y - sy; - tile_flipx ^= 0x4000; - tile_flipy ^= 0x8000; - } - - tile = (tile & 0x3fff) | (bank << 14); - color += (color_bank << 4); - color &= 0x7f; - tile %= max_tile; - - sy -= 16; - - tile_x += tile_xinc; - - if (sy < -15 || sy > (nScreenHeight - 1) || sx < -15 || sx > (nScreenWidth - 1)) { - continue; - } - - if (tile_flipy) { - if (tile_flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, tile, sx, sy, color, 4, 0x0f, 0, gfx_base); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, tile, sx, sy, color, 4, 0x0f, 0, gfx_base); - } - } else { - if (tile_flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, tile, sx, sy, color, 4, 0x0f, 0, gfx_base); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, tile, sx, sy, color, 4, 0x0f, 0, gfx_base); - } - } - } - - tile_y += tile_yinc; - } - - } - -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0xff; - } - - draw_sprites((UINT16*)DrvSprRAM0, DrvGfxROM0, nGfxROM0Len); - if (!game_select) { - draw_sprites((UINT16*)DrvSprRAM1, DrvGfxROM1, 0x20000); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static inline void AssembleInputs() -{ - memset (DrvInputs, 0xff, 6 * sizeof(UINT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - DrvInputs[3] ^= DrvJoy4[i] << i; - DrvInputs[4] ^= DrvJoy5[i] << i; - DrvInputs[5] ^= DrvJoy6[i] << i; - } - - switch (game_select) - { - case 0: // bestbest - { - DrvInputs[2] = (DrvDips[1] << 8) | DrvDips[0]; - } - return; - - case 1: // sunaq - { - DrvInputs[2] = DrvDips[0]; - } - return; - - case 2: // uballoon - { - DrvInputs[1] = (DrvInputs[1] & 0xff) | (DrvDips[0] << 8); - DrvInputs[2] = DrvDips[1]; - DrvInputs[3] = DrvDips[2]; - } - return; - - case 3: // bssoccer - { - DrvInputs[4] = (DrvDips[1] << 8) | DrvDips[0]; - DrvInputs[5] = ((DrvInputs[5] & 0xfe) | (DrvDips[2] & 0x01)) | 0xff00; - } - return; - } - - return; -} - -static INT32 BestbestFrame() -{ - INT32 nCyclesTotal[3]; - - INT32 nInterleave = 50; - INT32 nSoundBufferPos = 0; - - if (DrvReset) { - DrvDoReset(); - } - - AssembleInputs(); - - nCyclesTotal[0] = 6000000 / 60; - nCyclesTotal[1] = 6000000 / 60; - nCyclesTotal[2] = 6000000 / 60; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - - SekRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave / 2)-1) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - if (i == (nInterleave )-1) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - ZetOpen(0); - BurnTimerUpdateYM3526(i * (nCyclesTotal[1] / nInterleave)); - ZetClose(); - - ZetOpen(1); - ZetRun(nCyclesTotal[2] / nInterleave); - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pSoundBuffer + (nSoundBufferPos << 1); - - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - - nSoundBufferPos += nSegmentLength; - } - } - SekClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pSoundBuffer + (nSoundBufferPos << 1); - - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - - ZetOpen(0); - BurnTimerEndFrameYM3526(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[(i << 1) + 0] += pSoundBuffer[(i << 1) + 0]; - pBurnSoundOut[(i << 1) + 1] += pSoundBuffer[(i << 1) + 1]; - } - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 SunaqFrame() -{ - INT32 nInterleave = 50; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[3]; - - if (DrvReset) { - DrvDoReset(); - } - - AssembleInputs(); - - nCyclesTotal[0] = 6000000 / 60; - nCyclesTotal[1] = 3579500 / 60; - nCyclesTotal[2] = 6000000 / 60; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave )-1) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - for (INT32 j = 0; j < 2; j++) { - ZetOpen(j); - ZetRun(nCyclesTotal[j+1] / nInterleave); - ZetClose(); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 UballoonFrame() -{ - INT32 nInterleave = 50; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[3]; - - if (DrvReset) { - DrvDoReset(); - } - - AssembleInputs(); - - nCyclesTotal[0] = 8000000 / 60; - nCyclesTotal[1] = 3579500 / 60; - nCyclesTotal[2] = 5000000 / 60; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave )-1) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - for (INT32 j = 0; j < 2; j++) { - ZetOpen(j); - ZetRun(nCyclesTotal[j+1] / nInterleave); - ZetClose(); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 BssoccerFrame() -{ - INT32 nInterleave = 50; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[4]; - - if (DrvReset) { - DrvDoReset(); - } - - AssembleInputs(); - - nCyclesTotal[0] = 8000000 / 60; - nCyclesTotal[1] = 3579500 / 60; - nCyclesTotal[2] = 5000000 / 60; - nCyclesTotal[3] = 5000000 / 60; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave / 2)-1) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == (nInterleave )-1) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - for (INT32 j = 0; j < 3; j++) { - ZetOpen(j); - ZetRun(nCyclesTotal[j+1] / nInterleave); - ZetClose(); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029692; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - DACScan(nAction, pnMin); - - if (game_select) { - BurnYM2151Scan(nAction); - } else { - AY8910Scan(nAction, pnMin); - } - - SCAN_VAR(soundlatch); - SCAN_VAR(soundlatch2); - SCAN_VAR(soundlatch3); - SCAN_VAR(flipscreen); - SCAN_VAR(color_bank); - SCAN_VAR(bestofbest_prot); - - SCAN_VAR(z80bankdata[0]); - SCAN_VAR(z80bankdata[1]); - } - - if (game_select == 3) { - ZetOpen(1); - bssoccer_bankswitch_w(DrvZ80ROM1, 0, z80bankdata[0]); - ZetClose(); - ZetOpen(2); - bssoccer_bankswitch_w(DrvZ80ROM2, 1, z80bankdata[1]); - ZetClose(); - } - - if (game_select == 2) { - ZetOpen(1); - uballoon_bankswitch(z80bankdata[0]); - ZetClose(); - } - - return 0; -} - - - -//------------------------------------------------------------------------------------------------- -// Drivers - - -// Best Of Best - -static struct BurnRomInfo bestbestRomDesc[] = { - { "4.bin", 0x20000, 0x06741994, 1 | BRF_ESS | BRF_PRG }, // 0 - 68K Code - { "2.bin", 0x20000, 0x42843dec, 1 | BRF_ESS | BRF_PRG }, // 1 - { "3.bin", 0x80000, 0xe2bb8f26, 1 | BRF_ESS | BRF_PRG }, // 2 - { "1.bin", 0x80000, 0xd365e20a, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "5.bin", 0x10000, 0xbb9265e6, 2 | BRF_ESS | BRF_PRG }, // 4 - Z80 #0 Code - - { "6.bin", 0x10000, 0xdd445f6b, 3 | BRF_ESS | BRF_PRG }, // 5 - Z80 #1 Code - - { "9.bin", 0x80000, 0xb11994ea, 5 | BRF_GRA }, // 6 - Sprites (Chip 0) - { "10.bin", 0x80000, 0x37b41ef5, 5 | BRF_GRA }, // 7 - { "7.bin", 0x80000, 0x16188b73, 5 | BRF_GRA }, // 8 - { "8.bin", 0x80000, 0x765ce06b, 5 | BRF_GRA }, // 9 - - { "16.bin", 0x80000, 0xdc46cdea, 6 | BRF_GRA }, // 10 - Sprites (Chip 1) - { "17.bin", 0x80000, 0xc6fadd57, 6 | BRF_GRA }, // 11 - { "13.bin", 0x80000, 0x23283ac4, 6 | BRF_GRA }, // 12 - { "18.bin", 0x80000, 0x674c4609, 6 | BRF_GRA }, // 13 - { "14.bin", 0x80000, 0xc210fb53, 6 | BRF_GRA }, // 14 - { "15.bin", 0x80000, 0x3b1166c7, 6 | BRF_GRA }, // 15 - { "11.bin", 0x80000, 0x323eebc3, 6 | BRF_GRA }, // 16 - { "12.bin", 0x80000, 0xca7c8176, 6 | BRF_GRA }, // 17 - - { "82s129.5", 0x00100, 0x10bfcebb, 0 | BRF_OPT }, // 18 - PROMs (not used) - { "82s129.6", 0x00100, 0x10bfcebb, 0 | BRF_OPT }, // 19 -}; - -STD_ROM_PICK(bestbest) -STD_ROM_FN(bestbest) - -struct BurnDriver BurnDrvBestbest = { - "bestbest", NULL, NULL, NULL, "1994", - "Best Of Best\0", NULL, "SunA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, bestbestRomInfo, bestbestRomName, NULL, NULL, BestbestInputInfo, bestbestDIPInfo, - BestbestInit, DrvExit, BestbestFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// SunA Quiz 6000 Academy (940620-6) - -static struct BurnRomInfo sunaqRomDesc[] = { - { "prog2.bin", 0x80000, 0xa92bce45, 1 | BRF_ESS | BRF_PRG }, // 0 - 68K Code - { "prog1.bin", 0x80000, 0xff690e7e, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "audio1.bin", 0x10000, 0x3df42f82, 2 | BRF_ESS | BRF_PRG }, // 2 - Z80 #0 Code - - { "audio2.bin", 0x80000, 0xcac85ba9, 3 | BRF_ESS | BRF_PRG }, // 3 - Z80 #1 Code - - { "gfx1.bin", 0x80000, 0x0bde5acf, 5 | BRF_GRA }, // 4 - Sprites - { "gfx2.bin", 0x80000, 0x24b74826, 5 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(sunaq) -STD_ROM_FN(sunaq) - -struct BurnDriver BurnDrvSunaq = { - "sunaq", NULL, NULL, NULL, "1994", - "SunA Quiz 6000 Academy (940620-6)\0", NULL, "SunA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, sunaqRomInfo, sunaqRomName, NULL, NULL, SunaqInputInfo, sunaqDIPInfo, - SunaqInit, DrvExit, SunaqFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Ultra Balloon - -static struct BurnRomInfo uballoonRomDesc[] = { - { "prg2.rom2", 0x80000, 0x72ab80ea, 1 | BRF_ESS | BRF_PRG }, // 0 - 68K Code - { "prg1.rom1", 0x80000, 0x27a04f55, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "audio1.rom7", 0x10000, 0xc771f2b4, 2 | BRF_ESS | BRF_PRG }, // 2 - Z80 #0 Code - - { "audio2.rom8", 0x20000, 0xc7f75347, 3 | BRF_ESS | BRF_PRG }, // 3 - Z80 #1 Code - - { "gfx3.rom3", 0x80000, 0xfd2ec297, 5 | BRF_GRA }, // 4 - Sprites - { "gfx5.rom5", 0x80000, 0x6307aa60, 5 | BRF_GRA }, // 5 - { "gfx4.rom4", 0x80000, 0x718f3150, 5 | BRF_GRA }, // 6 - { "gfx6.rom6", 0x80000, 0xaf7e057e, 5 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(uballoon) -STD_ROM_FN(uballoon) - -struct BurnDriver BurnDrvUballoon = { - "uballoon", NULL, NULL, NULL, "1996", - "Ultra Balloon\0", NULL, "SunA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, uballoonRomInfo, uballoonRomName, NULL, NULL, UballoonInputInfo, uballoonDIPInfo, - UballoonInit, DrvExit, UballoonFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// Back Street Soccer - -static struct BurnRomInfo bssoccerRomDesc[] = { - { "02", 0x080000, 0x32871005, 1 | BRF_ESS | BRF_PRG }, // 0 - 68K Code - { "01", 0x080000, 0xace00db6, 1 | BRF_ESS | BRF_PRG }, // 1 - { "04", 0x080000, 0x25ee404d, 1 | BRF_ESS | BRF_PRG }, // 2 - { "03", 0x080000, 0x1a131014, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "11", 0x010000, 0xdf7ae9bc, 2 | BRF_ESS | BRF_PRG }, // 4 - Z80 #0 Code - - { "13", 0x080000, 0x2b273dca, 3 | BRF_ESS | BRF_PRG }, // 5 - Z80 #1 Code - - { "12", 0x080000, 0x6b73b87b, 4 | BRF_ESS | BRF_PRG }, // 6 - Z80 #0 Code - - { "05", 0x080000, 0xa5245bd4, 5 | BRF_GRA }, // 7 - Sprites - { "07", 0x080000, 0xfdb765c2, 5 | BRF_GRA }, // 8 - { "09", 0x080000, 0x0e82277f, 5 | BRF_GRA }, // 9 - { "06", 0x080000, 0xd42ce84b, 5 | BRF_GRA }, // 10 - { "08", 0x080000, 0x96cd2136, 5 | BRF_GRA }, // 11 - { "10", 0x080000, 0x1ca94d21, 5 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(bssoccer) -STD_ROM_FN(bssoccer) - -struct BurnDriver BurnDrvBssoccer = { - "bssoccer", NULL, NULL, NULL, "1996", - "Back Street Soccer\0", "graphics issues?", "SunA", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_MISC_POST90S, GBF_SPORTSFOOTBALL, 0, - NULL, bssoccerRomInfo, bssoccerRomName, NULL, NULL, BssoccerInputInfo, bssoccerDIPInfo, - BssoccerInit, DrvExit, BssoccerFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_suprnova.cpp b/jan/src/burn/drv/pst90s/d_suprnova.cpp deleted file mode 100644 index 8936fc1ae..000000000 --- a/jan/src/burn/drv/pst90s/d_suprnova.cpp +++ /dev/null @@ -1,3029 +0,0 @@ -// FB Alpha Super Kaneko Nova System driver module by iq_132, fixups by dink -// Based on MAME driver by Sylvain Glaize and David Haywood -// -// notes: vblokbr/sarukani prefers 60hz w/the speedhack, or it gets stuck in testmode. -// - -#include "tiles_generic.h" -#include "ymz280b.h" -#include "sknsspr.h" -#include "sh2_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvSh2BIOS; -static UINT8 *DrvSh2ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvNvRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvLineRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvGfxRAM; -static UINT8 *DrvSh2RAM; -static UINT8 *DrvCacheRAM; -static UINT8 *DrvV3Regs; -static UINT8 *DrvSprRegs; -static UINT8 *DrvPalRegs; - -static UINT32 *DrvPalette; - -static UINT8 *DrvTmpScreenBuf; -static UINT16 *DrvTmpScreenA; -static UINT16 *DrvTmpScreenB; -static UINT16 *DrvTmpScreenA2; -static UINT16 *DrvTmpScreenB2; -static UINT16 *DrvTmpScreenC; -static UINT8 *DrvTmpFlagA; -static UINT8 *DrvTmpFlagB; -static UINT8 *DrvTmpFlagA2; -static UINT8 *DrvTmpFlagB2; -static UINT32 *DrvTmpDraw; // main drawing surface -static UINT32 *pDrvTmpDraw; -static UINT8 *olddepths; - -static struct { - UINT16 x1p, y1p, z1p, x1s, y1s, z1s; - UINT16 x2p, y2p, z2p, x2s, y2s, z2s; - UINT16 org; - - UINT16 x1_p1, x1_p2, y1_p1, y1_p2, z1_p1, z1_p2; - UINT16 x2_p1, x2_p2, y2_p1, y2_p2, z2_p1, z2_p2; - UINT16 x1tox2, y1toy2, z1toz2; - INT16 x_in, y_in, z_in; - UINT16 flag; - - UINT8 disconnect; -} hit; - -static INT32 sprite_kludge_x; -static INT32 sprite_kludge_y; - -static UINT8 DrvJoy1[32]; -static UINT8 DrvDips[2]; -static UINT32 DrvInputs[3]; -static INT32 DrvAnalogPort0 = 0; -static INT32 DrvAnalogPort1 = 0; -static UINT8 DrvReset; - -static INT32 sixtyhz = 0; - -static INT32 nGfxLen0 = 0; -static INT32 nRedrawTiles = 0; -static UINT32 speedhack_address = ~0; -static UINT32 speedhack_pc[2] = { 0, 0 }; -static UINT8 m_region = 0; /* 0 Japan, 1 Europe, 2 Asia, 3 USA, 4 Korea */ -static UINT32 Vblokbrk = 0; -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo VblokbrkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 10, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 8, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 24, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 25, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 26, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 27, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 28, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 29, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 30, "p1 fire 3"}, - A("P1 Paddle", BIT_ANALOG_REL, &DrvAnalogPort0,"p1 z-axis"), - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 9, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 16, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 17, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 18, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 19, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 20, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 21, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 22, "p2 fire 3"}, - A("P2 Paddle", BIT_ANALOG_REL, &DrvAnalogPort1,"p2 z-axis"), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 14, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 13, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -#undef A - -STDINPUTINFO(Vblokbrk) - -static struct BurnInputInfo SknsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 10, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 8, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 24, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 25, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 26, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 27, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 28, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 29, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 30, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 9, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 16, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 17, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 18, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 19, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 20, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 21, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 22, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 14, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 13, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Skns) - -static struct BurnDIPInfo SknsDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Use Backup Ram"}, - {0x15, 0x01, 0x40, 0x00, "No" }, - {0x15, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x15, 0x01, 0x80, 0x00, "Freezes the game"}, - {0x15, 0x01, 0x80, 0x80, "No" }, - - {0 , 0xfe, 0 , 2, "Speed Hacks"}, - {0x16, 0x01, 0x01, 0x00, "No" }, - {0x16, 0x01, 0x01, 0x01, "Yes" }, -}; - -STDDIPINFO(Skns) - -static struct BurnDIPInfo SknsNoSpeedhackDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Use Backup Ram"}, - {0x15, 0x01, 0x40, 0x00, "No" }, - {0x15, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x15, 0x01, 0x80, 0x00, "Freezes the game"}, - {0x15, 0x01, 0x80, 0x80, "No" }, -}; - -STDDIPINFO(SknsNoSpeedhack) - -static struct BurnDIPInfo VblokbrkDIPList[]= -{ - {0x17, 0xff, 0xff, 0xff, NULL }, - {0x18, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x02, 0x02, "Off" }, - {0x17, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Use Backup Ram"}, - {0x17, 0x01, 0x40, 0x00, "No" }, - {0x17, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x17, 0x01, 0x80, 0x00, "Freezes the game"}, - {0x17, 0x01, 0x80, 0x80, "No" }, - - {0 , 0xfe, 0 , 2, "Speed Hacks"}, - {0x18, 0x01, 0x01, 0x00, "No" }, - {0x18, 0x01, 0x01, 0x01, "Yes" }, -}; - -STDDIPINFO(Vblokbrk) - -static struct BurnInputInfo CyvernInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 10, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 8, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 24, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 25, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 26, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 27, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 28, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 29, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 9, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 16, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 17, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 18, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 19, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 20, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 21, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy1 + 14, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 13, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Cyvern) - - -static struct BurnDIPInfo CyvernDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Use Backup Ram"}, - {0x13, 0x01, 0x40, 0x00, "No" }, - {0x13, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x80, 0x00, "Freezes the game"}, - {0x13, 0x01, 0x80, 0x80, "No" }, - - {0 , 0xfe, 0 , 2, "Speed Hacks"}, - {0x14, 0x01, 0x01, 0x00, "No" }, - {0x14, 0x01, 0x01, 0x01, "Yes" }, -}; - -STDDIPINFO(Cyvern) - -static struct BurnDIPInfo CyvernNoSpeedhackDIPList[]= // gals panic 4 (galpani4) -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Use Backup Ram"}, - {0x13, 0x01, 0x40, 0x00, "No" }, - {0x13, 0x01, 0x40, 0x40, "Yes" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x13, 0x01, 0x80, 0x00, "Freezes the game"}, - {0x13, 0x01, 0x80, 0x80, "No" }, -}; - -STDDIPINFO(CyvernNoSpeedhack) - -static void hit_calc_orig(UINT16 p, UINT16 s, UINT16 org, UINT16 *l, UINT16 *r) -{ - switch(org & 3) { - case 0: - *l = p; - *r = p+s; - break; - case 1: - *l = p-s/2; - *r = *l+s; - break; - case 2: - *l = p-s; - *r = p; - break; - case 3: - *l = p-s; - *r = p+s; - break; - } -} - -static void hit_calc_axis(UINT16 x1p, UINT16 x1s, UINT16 x2p, UINT16 x2s, UINT16 org, - UINT16 *x1_p1, UINT16 *x1_p2, UINT16 *x2_p1, UINT16 *x2_p2, - INT16 *x_in, UINT16 *x1tox2) -{ - UINT16 x1l=0, x1r=0, x2l=0, x2r=0; - hit_calc_orig(x1p, x1s, org, &x1l, &x1r); - hit_calc_orig(x2p, x2s, org >> 8, &x2l, &x2r); - - *x1tox2 = x2p-x1p; - *x1_p1 = x1p; - *x2_p1 = x2p; - *x1_p2 = x1r; - *x2_p2 = x2l; - *x_in = x1r-x2l; -} - -static void hit_recalc() -{ - hit_calc_axis(hit.x1p, hit.x1s, hit.x2p, hit.x2s, hit.org, - &hit.x1_p1, &hit.x1_p2, &hit.x2_p1, &hit.x2_p2, - &hit.x_in, &hit.x1tox2); - hit_calc_axis(hit.y1p, hit.y1s, hit.y2p, hit.y2s, hit.org, - &hit.y1_p1, &hit.y1_p2, &hit.y2_p1, &hit.y2_p2, - &hit.y_in, &hit.y1toy2); - hit_calc_axis(hit.z1p, hit.z1s, hit.z2p, hit.z2s, hit.org, - &hit.z1_p1, &hit.z1_p2, &hit.z2_p1, &hit.z2_p2, - &hit.z_in, &hit.z1toz2); - - hit.flag = 0; - hit.flag |= hit.y2p > hit.y1p ? 0x8000 : hit.y2p == hit.y1p ? 0x4000 : 0x2000; - hit.flag |= hit.y_in >= 0 ? 0 : 0x1000; - hit.flag |= hit.x2p > hit.x1p ? 0x0800 : hit.x2p == hit.x1p ? 0x0400 : 0x0200; - hit.flag |= hit.x_in >= 0 ? 0 : 0x0100; - hit.flag |= hit.z2p > hit.z1p ? 0x0080 : hit.z2p == hit.z1p ? 0x0040 : 0x0020; - hit.flag |= hit.z_in >= 0 ? 0 : 0x0010; - hit.flag |= hit.x_in >= 0 && hit.y_in >= 0 && hit.z_in >= 0 ? 8 : 0; - hit.flag |= hit.z_in >= 0 && hit.x_in >= 0 ? 4 : 0; - hit.flag |= hit.y_in >= 0 && hit.z_in >= 0 ? 2 : 0; - hit.flag |= hit.x_in >= 0 && hit.y_in >= 0 ? 1 : 0; -} - -static void skns_hit_w(UINT32 adr, UINT32 data) -{ - switch(adr & ~3) { - case 0x00: - case 0x28: - hit.x1p = data; - break; - case 0x08: - case 0x30: - hit.y1p = data; - break; - case 0x38: - case 0x50: - hit.z1p = data; - break; - case 0x04: - case 0x2c: - hit.x1s = data; - break; - case 0x0c: - case 0x34: - hit.y1s = data; - break; - case 0x3c: - case 0x54: - hit.z1s = data; - break; - case 0x10: - case 0x58: - hit.x2p = data; - break; - case 0x18: - case 0x60: - hit.y2p = data; - break; - case 0x20: - case 0x68: - hit.z2p = data; - break; - case 0x14: - case 0x5c: - hit.x2s = data; - break; - case 0x1c: - case 0x64: - hit.y2s = data; - break; - case 0x24: - case 0x6c: - hit.z2s = data; - break; - case 0x70: - hit.org = data; - break; - default: - break; - } - hit_recalc(); -} - -static UINT32 skns_hit_r(UINT32 adr) -{ - if(hit.disconnect) - return 0x0000; - - switch(adr & 0xfc) { - case 0x28: - case 0x2a: - return (Sh2TotalCycles() ^ (Sh2TotalCycles() >> 16)) & 0xffff; - case 0x00: - case 0x10: - return (UINT16)hit.x_in; - case 0x04: - case 0x14: - return (UINT16)hit.y_in; - case 0x18: - return (UINT16)hit.z_in; - case 0x08: - case 0x1c: - return hit.flag; - case 0x40: - return hit.x1p; - case 0x48: - return hit.y1p; - case 0x50: - return hit.z1p; - case 0x44: - return hit.x1s; - case 0x4c: - return hit.y1s; - case 0x54: - return hit.z1s; - case 0x58: - return hit.x2p; - case 0x60: - return hit.y2p; - case 0x68: - return hit.z2p; - case 0x5c: - return hit.x2s; - case 0x64: - return hit.y2s; - case 0x6c: - return hit.z2s; - case 0x70: - return hit.org; - case 0x80: - return hit.x1tox2; - case 0x84: - return hit.y1toy2; - case 0x88: - return hit.z1toz2; - case 0x90: - return hit.x1_p1; - case 0xa0: - return hit.y1_p1; - case 0xb0: - return hit.z1_p1; - case 0x98: - return hit.x1_p2; - case 0xa8: - return hit.y1_p2; - case 0xb8: - return hit.z1_p2; - case 0x94: - return hit.x2_p1; - case 0xa4: - return hit.y2_p1; - case 0xb4: - return hit.z2_p1; - case 0x9c: - return hit.x2_p2; - case 0xac: - return hit.y2_p2; - case 0xbc: - return hit.z2_p2; - default: - return 0; - } -} - - -static UINT32 skns_msm6242_r(UINT32 offset) -{ - time_t nLocalTime = time(NULL); // ripped from pgm_run.cpp - tm* tmLocalTime = localtime(&nLocalTime); - - UINT32 value = 0; - - switch ((offset >> 2) & 3) - { - case 0: - value = (tmLocalTime->tm_sec % 10)<<24; - value |= (tmLocalTime->tm_sec / 10)<<16; - value |= (tmLocalTime->tm_min % 10)<<8; - value |= (tmLocalTime->tm_min / 10); - break; - case 1: - value = (tmLocalTime->tm_hour % 10)<<24; - value |= (tmLocalTime->tm_hour / 10)<<16; - value |= (tmLocalTime->tm_mday % 10)<<8; - value |= (tmLocalTime->tm_mday / 10); - break; - case 2: - value = ((tmLocalTime->tm_mon + 1) % 10) << 24; - value |= ((tmLocalTime->tm_mon + 1) / 10) << 16; - value |= (tmLocalTime->tm_year % 10) << 8; - value |= ((tmLocalTime->tm_year / 10) % 10); - break; - case 3: - value = (tmLocalTime->tm_wday)<<24; - value |= (1)<<16; - value |= (6)<<8; - value |= (4); - break; - } - return value; -} - -static UINT8 __fastcall suprnova_read_byte(UINT32 address) -{ - address &= 0xc7ffffff; - - if ((address & 0xfffffff0) == 0x01000000) { - return skns_msm6242_r(address) >> ((~address & 3) << 3); - } - - if ((address & 0xffffff00) == 0x02f00000) { - return skns_hit_r(address) >> ((~address & 3) << 3); - } - - switch (address) - { - case 0x00400000: - case 0x00400001: - case 0x00400002: - case 0x00400003: - return DrvInputs[0] >> ((~address & 3) << 3); // 400000 - - case 0x00400004: - case 0x00400005: - case 0x00400006: - case 0x00400007: - return DrvInputs[1] >> ((~address & 3) << 3); // 400004 - - case 0x0040000c: - case 0x0040000d: - case 0x0040000e: - case 0x0040000f: - return DrvInputs[2] >> ((~address & 3) << 3); // 40000c - - case 0x00c00000: - case 0x00c00001: - case 0x00c00002:return 0; - case 0x00c00003: - return YMZ280BReadStatus(); - } - bprintf(0, _T("rb %X. "), address); - - return 0; -} - -static UINT16 __fastcall suprnova_read_word(UINT32 address) -{ - address &= 0xc7fffffe; - - if ((address & 0xfffffff0) == 0x01000000) { - return skns_msm6242_r(address) >> ((~address & 2) << 3); - } - - if ((address & 0xffffff00) == 0x02f00000) { - return skns_hit_r(address) >> ((~address & 2) << 3); - } - - switch (address) - { - case 0x00400000: - case 0x00400001: - return DrvInputs[0] >> 16; - - case 0x00400002: - case 0x00400003: - return DrvInputs[0]; // 400000 - - case 0x00400004: - case 0x00400005: - return DrvInputs[1] >> 16; - - case 0x00400006: - case 0x00400007: - return DrvInputs[1]; // 400004 - - case 0x0040000c: - case 0x0040000d: - return DrvInputs[2] >> 16; - - case 0x0040000e: - case 0x0040000f: - return DrvInputs[2]; // 40000c - } - bprintf(0, _T("rw %X. "), address); - - return 0; -} - -static UINT32 __fastcall suprnova_read_long(UINT32 address) -{ - address &= 0xc7fffffc; - - if ((address & 0xfffffff0) == 0x01000000) { - return skns_msm6242_r(address); - } - - if ((address & 0xffffff00) == 0x02f00000) { - return skns_hit_r(address); - } - - switch (address) - { - case 0x00400000: - return DrvInputs[0]; - - case 0x00400004: - return DrvInputs[1]; - - case 0x0040000c: - return DrvInputs[2]; - } - - return 0; -} - -static INT32 suprnova_alt_enable_sprites = 0; -static INT32 bright_spc_g_trans = 0; -static INT32 bright_spc_r_trans = 0; -static INT32 bright_spc_b_trans = 0; -static INT32 bright_spc_g = 0; -static INT32 bright_spc_r = 0; -static INT32 bright_spc_b = 0; -static INT32 suprnova_alt_enable_background = 0; -static INT32 bright_v3_g = 0; -static INT32 bright_v3_r = 0; -static INT32 bright_v3_b = 0; -static INT32 use_spc_bright = 1; -static INT32 use_v3_bright = 1; - -static void skns_pal_regs_w(UINT32 offset) -{ - UINT32 data = *((UINT32*)(DrvPalRegs + (offset & 0x1c))); - offset = (offset >> 2) & 7; - - switch ( offset ) - { - case (0x00/4): // RWRA0 - use_spc_bright = data&1; - suprnova_alt_enable_sprites = (data>>8)&1; - break; - - case (0x04/4): // RWRA1 - bright_spc_g = data&0xff; - bright_spc_g_trans = (data>>8) &0xff; - break; - - case (0x08/4): // RWRA2 - bright_spc_r = data&0xff; - bright_spc_r_trans = (data>>8) &0xff; - break; - - case (0x0C/4): // RWRA3 - bright_spc_b = data&0xff; - bright_spc_b_trans = (data>>8)&0xff; - break; - - case (0x10/4): // RWRB0 - use_v3_bright = data&1; - suprnova_alt_enable_background = (data>>8)&1; - break; - - case (0x14/4): // RWRB1 - bright_v3_g = data&0xff; - // bright_v3_g_trans = (data>>8)&0xff; - break; - - case (0x18/4): // RWRB2 - bright_v3_r = data&0xff; - // bright_v3_r_trans = (data>>8)&0xff; - break; - - case (0x1C/4): // RWRB3 - bright_v3_b = data&0xff; - // bright_v3_b_trans = (data>>8)&0xff; - break; - } -} - -static inline void decode_graphics_ram(UINT32 offset) -{ - offset &= 0x3fffc; - UINT32 p = *((UINT32*)(DrvGfxRAM + offset)); - - if ( (DrvGfxROM2[offset + 0] == p >> 24) && - (DrvGfxROM2[offset + 1] == p >> 16) && - (DrvGfxROM2[offset + 2] == p >> 8) && - (DrvGfxROM2[offset + 3] == p >> 0) ) return; - - nRedrawTiles = 1; - - DrvGfxROM2[offset + 0] = p >> 24; - DrvGfxROM2[offset + 1] = p >> 16; - DrvGfxROM2[offset + 2] = p >> 8; - DrvGfxROM2[offset + 3] = p >> 0; -} - -static void __fastcall suprnova_write_byte(UINT32 address, UINT8 data) -{ - address &= 0xc7ffffff; - - if ((address & 0xfffc0000) == 0x4800000) { - DrvGfxRAM[(address & 0x3ffff) ^ 3] = data; - decode_graphics_ram(address); - return; - - } //04800000, 0x0483ffff - - switch (address) - { - case 0x00c00000: - YMZ280BSelectRegister(data); - return; - - case 0x00c00001: - YMZ280BWriteRegister(data); - return; - - case 0x01800000: - // case 0x01800001: - // case 0x01800002: - // case 0x01800003:// sengeki writes here... puzzloop complains (security...) - { - hit.disconnect=1; /* hit2 stuff */ - switch (m_region) /* 0 Japan, 1 Europe, 2 Asia, 3 USA, 4 Korea */ - { - case 0: - if (data == 0) hit.disconnect= 0; - break; - case 3: - if (data == 1) hit.disconnect= 0; - break; - case 4: // korea - if (data == 2) hit.disconnect= 0; - break; - case 1: - if (data == 3) hit.disconnect= 0; - break; - case 2: - if (data < 2) hit.disconnect= 0; - break; - // unknown country id, unlock per default - default: - hit.disconnect= 0; - break; - } - } - return; - } - - if ((address & 0xffffffe0) == 0x02a00000) { - DrvPalRegs[(address & 0x1f) ^ 3] = data; - skns_pal_regs_w(address); - return; - } - - // skns_msm6242_w -- not used - if ((address & ~0x0f) == 0x1000000) return; - - // skns io -- not used - if ((address & ~0x0f) == 0x00400000) { - if ((Sh2GetPC(0) == 0x04013B42 + 2) && Vblokbrk) { // speedhack for Vblokbrk / Saru Kani - //Sh2BurnUntilInt(0); // this breaks sound in vblokbrk... - } - return; - } -} - -static void __fastcall suprnova_write_word(UINT32 address, UINT16 data) -{ - address &= 0xc7fffffe; - - if ((address & 0xfffc0000) == 0x4800000) { - *((UINT16*)(DrvGfxRAM + ((address & 0x3fffe) ^ 2))) = data; - decode_graphics_ram(address); - return; - - } //04800000, 0x0483ffff -} - -static void __fastcall suprnova_write_long(UINT32 address, UINT32 data) -{ - address &= 0xc7fffffc; - - if ((address & 0xfffc0000) == 0x4800000) { - *((UINT32*)(DrvGfxRAM + (address & 0x3fffc))) = data; - decode_graphics_ram(address); - return; - - } //04800000, 0x0483ffff - - if ((address & 0xffffffe0) == 0x02a00000) { - *((UINT32*)(DrvPalRegs + (address & 0x1c))) = data; - skns_pal_regs_w(address); - return; - } - - if ((address & 0xffffff00) == 0x02f00000) { - skns_hit_w(address & 0xff, data); - return; - } - - if (address == 0x05000000) return; // vsblock -} - -static inline void suprnova_speedhack(UINT32 a) -{ - UINT32 b = a & ~3; - UINT32 pc = Sh2GetPC(0); - - if (b == speedhack_address) { - if (pc == speedhack_pc[0]) { - Sh2BurnUntilInt(0); - } - } -} - -static UINT32 __fastcall suprnova_hack_read_long(UINT32 a) -{ - suprnova_speedhack(a); - - a &= 0xffffc; - - return *((UINT32*)(DrvSh2RAM + a)); -} - -static UINT16 __fastcall suprnova_hack_read_word(UINT32 a) -{ - suprnova_speedhack(a); - - return *((UINT16 *)(DrvSh2RAM + ((a & 0xffffe) ^ 2))); -} - -static UINT8 __fastcall suprnova_hack_read_byte(UINT32 a) -{ - suprnova_speedhack(a); - - return DrvSh2RAM[(a & 0xfffff) ^ 3]; -} - -static void BurnSwapEndian(UINT8 *src, INT32 len) -{ - for (INT32 i = 0; i < len; i+=4) { - INT32 t = src[i + 0]; - src[i + 0] = src[i+3]; - src[i + 3] = t; - t = src[i + 1]; - src[i + 1] = src[i + 2]; - src[i + 2] = t; - } -} - -static INT32 MemIndex(INT32 gfxlen0) -{ - UINT8 *Next; Next = AllMem; - - DrvSh2BIOS = Next; Next += 0x0080000; - DrvSh2ROM = Next; Next += 0x0400000; - - YMZ280BROM = Next; Next += 0x0500000; - - DrvGfxROM0 = Next; Next += gfxlen0; - DrvGfxROM1 = Next; Next += 0x0800000; - DrvGfxROM2 = Next; Next += 0x0800000; - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x010000; - DrvNvRAM = Next; Next += 0x010000; - DrvSprRAM = Next; Next += 0x010000; - DrvLineRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x020000; - DrvGfxRAM = Next; Next += 0x040000; - DrvSh2RAM = Next; Next += 0x100000; - DrvCacheRAM = Next; Next += 0x010000; - DrvV3Regs = Next; Next += 0x010100; - DrvSprRegs = Next; Next += 0x010100; - DrvPalRegs = Next; Next += 0x010020; - - RamEnd = Next; - - DrvTmpScreenBuf = Next; Next += 0x10000; - - DrvTmpScreenA = (UINT16*)Next; Next += 1024 * 1024 * sizeof(INT16); - DrvTmpScreenB = (UINT16*)Next; Next += 1024 * 1024 * sizeof(INT16); - DrvTmpScreenC = (UINT16*)Next; Next += 320 * 240 * sizeof(INT16); - DrvTmpScreenA2 = (UINT16*)Next; Next += 320 * 240 * sizeof(INT16); - DrvTmpScreenB2 = (UINT16*)Next; Next += 320 * 240 * sizeof(INT16); - pDrvTmpDraw = (UINT32*)Next; - DrvTmpDraw = (UINT32*)Next; Next += 320 * 240 * sizeof(INT32); - - DrvTmpFlagA = Next; Next += 1024 * 1024; - DrvTmpFlagB = Next; Next += 1024 * 1024; - - DrvTmpFlagA2 = Next; Next += 320 * 240; - DrvTmpFlagB2 = Next; Next += 320 * 240; - - DrvPalette = (UINT32*)Next; Next += 0x10000 * sizeof(INT32); - - olddepths = Next; Next += 2 * sizeof(UINT8); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - memset (DrvTmpScreenBuf, 0xff, 0x8000); - memset (&hit, 0, sizeof(hit)); - - Sh2Open(0); - if (Vblokbrk) { - Sh2Reset(); // VS Block Breaker / Saru Kani must run through the Super Kaneko BIOS for nvram to work! - } else { // Run everything else directly, bypassing the bios. - Sh2Reset( *(UINT32 *)(DrvSh2ROM + 0), *(UINT32 *)(DrvSh2ROM + 4) ); - if (sprite_kludge_y == -272) // sengekistriker - Sh2SetVBR(0x6000000); - else Sh2SetVBR(0x4000000); - } - Sh2Close(); - - YMZ280BReset(); - - hit.disconnect = (m_region != 2) ? 1 : 0; - - suprnova_alt_enable_sprites = 0; - bright_spc_g_trans = bright_spc_r_trans = bright_spc_b_trans = 0; - bright_spc_g = bright_spc_r = bright_spc_b = 0; - //suprnova_alt_enable_background = 0; set in init, and by game - bright_v3_g = bright_v3_r = bright_v3_b = 0; - use_spc_bright = 1; - use_v3_bright = 1; - - nRedrawTiles = 1; - olddepths[0] = olddepths[1] = 0xff; - - HiscoreReset(); - - sh2_suprnova_speedhack = (DrvDips[1] & 1); - - return 0; -} - -static INT32 DrvLoad(INT32 nLoadRoms) -{ - char* pRomName; - struct BurnRomInfo ri; - - UINT8 *LoadPr = DrvSh2ROM; - UINT8 *LoadSp = DrvGfxROM0; - UINT8 *LoadBg = DrvGfxROM1; - UINT8 *LoadFg = DrvGfxROM2 + 0x400000; - UINT8 *LoadYM = YMZ280BROM; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) - { - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (nLoadRoms) { - if (BurnLoadRom(LoadPr + 0, i+0, 2)) return 1; - if (BurnLoadRom(LoadPr + 1, i+1, 2)) return 1; - } - LoadPr += ri.nLen * 2; - i++; - - continue; - } - - if ((ri.nType & 7) == 2) { - if (nLoadRoms) { - if (BurnLoadRom(LoadSp, i, 1)) return 1; - } - LoadSp += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 3) { - if (nLoadRoms) { - if (BurnLoadRom(LoadBg, i, 1)) return 1; - } - LoadBg += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 4) { - if (nLoadRoms) { - if (BurnLoadRom(LoadFg, i, 1)) return 1; - } - LoadFg += ri.nLen; - - continue; - } - - if ((ri.nType & 7) == 5) { - if (nLoadRoms) { - if (BurnLoadRom(LoadYM, i, 1)) return 1; - } - LoadYM += ri.nLen; - continue; - } - } - - if (!nLoadRoms) { - for (nGfxLen0 = 1; nGfxLen0 < (LoadSp - DrvGfxROM0); nGfxLen0 <<= 1) {} - } - - return 0; -} - -static INT32 DrvInit(INT32 bios) -{ - AllMem = NULL; - DrvLoad(0); - MemIndex(nGfxLen0); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(nGfxLen0); - - { - if (DrvLoad(1)) return 1; - - if (BurnLoadRom(DrvSh2BIOS, 0x00080 + bios, 1)) return 1; // bios - m_region = bios; - BurnSwapEndian(DrvSh2BIOS, 0x80000); - BurnSwapEndian(DrvSh2ROM, 0x200000); - } - - Sh2Init(1); - Sh2Open(0); - - Sh2MapMemory(DrvSh2BIOS, 0x00000000, 0x0007ffff, MAP_ROM); - Sh2MapMemory(DrvNvRAM, 0x00800000, 0x00801fff, MAP_RAM); - Sh2MapMemory(DrvSprRAM, 0x02000000, 0x02003fff, MAP_RAM); - Sh2MapMemory(DrvSprRegs, 0x02100000, 0x0210003f, MAP_RAM); // sprite regs - Sh2MapMemory(DrvV3Regs, 0x02400000, 0x0240007f, MAP_RAM); - Sh2MapMemory(DrvVidRAM, 0x02500000, 0x02507fff, MAP_RAM); //0-4000, 4000-7fff A, B - Sh2MapMemory(DrvLineRAM, 0x02600000, 0x02607fff, MAP_RAM); - Sh2MapMemory(DrvPalRegs, 0x02a00000, 0x02a0001f, MAP_ROM); - Sh2MapMemory(DrvPalRAM, 0x02a40000, 0x02a5ffff, MAP_RAM); - Sh2MapMemory(DrvSh2ROM, 0x04000000, 0x041fffff, MAP_ROM); - Sh2MapMemory(DrvGfxRAM, 0x04800000, 0x0483ffff, MAP_ROM); // tilemap B, graphics tiles - Sh2MapMemory(DrvSh2RAM, 0x06000000, 0x060fffff, MAP_RAM); - Sh2MapMemory(DrvCacheRAM, 0xc0000000, 0xc0000fff, MAP_RAM); - - Sh2SetReadByteHandler (0, suprnova_read_byte); - Sh2SetReadWordHandler (0, suprnova_read_word); - Sh2SetReadLongHandler (0, suprnova_read_long); - Sh2SetWriteByteHandler(0, suprnova_write_byte); - Sh2SetWriteWordHandler(0, suprnova_write_word); - Sh2SetWriteLongHandler(0, suprnova_write_long); - - Sh2MapHandler(1, 0x06000000, 0x060fffff, MAP_ROM); - Sh2SetReadByteHandler (1, suprnova_hack_read_byte); - Sh2SetReadWordHandler (1, suprnova_hack_read_word); - Sh2SetReadLongHandler (1, suprnova_hack_read_long); - - if (!strncmp(BurnDrvGetTextA(DRV_NAME), "galpanis", 8)) { - bprintf(0, _T("Note (soundfix): switching Busy Loop Speedhack to mode #2 for galpanis*.\n")); - sh2_busyloop_speedhack_mode2 = 1; - } - - if (!sixtyhz) BurnSetRefreshRate(59.5971); - - YMZ280BInit(16666666, NULL); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - skns_init(); - skns_sprite_kludge(sprite_kludge_x, sprite_kludge_y); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - skns_exit(); - - Sh2Exit(); - YMZ280BExit(); - YMZ280BROM = NULL; - - BurnFree(AllMem); - - suprnova_alt_enable_background = 0; - Vblokbrk = 0; - nGfxLen0 = 0; - - sixtyhz = 0; - - speedhack_address = ~0; - memset (speedhack_pc, 0, 2 * sizeof(INT32)); - - return 0; -} - -static void draw_layer(UINT8 *source, UINT8 *previous, UINT16 *dest, UINT8 *prid, UINT8 *gfxbase, INT32 layer) -{ - UINT32 *prev = (UINT32*)previous; - UINT32 *vram = (UINT32*)source; - - UINT8 depthchanged[2] = { 0, 0 }; - UINT32 depth = *((UINT32*)(DrvV3Regs + 0x0c)); - if (layer) depth >>= 8; - depth &= 1; - - if (depth != olddepths[layer]) { - depthchanged[layer] = 1; - olddepths[layer] = depth; - } - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - // dirty tile speed hack. nRedrawTiles true if ram-based graphics changed. - if (layer == 1) { - if (!depthchanged[layer] && !nRedrawTiles && vram[offs] == prev[offs]) { - continue; - } - } else { - if (!depthchanged[layer] && vram[offs] == prev[offs]) { - continue; - } - } - prev[offs] = vram[offs]; - - INT32 sx = (offs & 0x3f) << 4; - INT32 sy = (offs >> 6) << 4; - - INT32 attr = vram[offs]; - INT32 code = attr & 0x001fffff; - INT32 color =((attr & 0x3f000000) >> 24) | 0x40; - INT32 prio =(attr & 0x00e00000) >> 21; - - INT32 flipx = (attr >> 31) & 1; - INT32 flipy = (attr >> 30) & 1; - - color <<= 8; - UINT8 *pri = prid + sy * 1024 + sx; - UINT16 *dst = dest + sy * 1024 + sx; - - if (depth) { // 4bpp - - code &= 0x0FFFF; - - if (flipy) flipy = 0x78; - if (flipx) flipy |=0x07; - - UINT8 *gfx = gfxbase + (code << 7); - - for (INT32 y = 0; y < 16; y++) { - for (INT32 x = 0; x < 16; x+=2) { - INT32 c = gfx[((y << 3) | (x >> 1)) ^ flipy]; - - dst[x+0] = (c & 0x0f) + color; - dst[x+1] = (c >> 4) + color; - pri[x+0] = pri[x+1] = prio; - } - - dst += 1024; - pri += 1024; - } - } else { // 8bpp - code &= 0x7FFF; - - UINT8 *gfx = gfxbase + (code << 8); - if (flipy) gfx += 0xf0; - INT32 inc = flipy ? -16 : 16; - - for (INT32 y = 0; y < 16 * 16; y+=16, gfx += inc) { - if (flipx) { - dst[ 0] = gfx[15] + color; - dst[ 1] = gfx[14] + color; - dst[ 2] = gfx[13] + color; - dst[ 3] = gfx[12] + color; - dst[ 4] = gfx[11] + color; - dst[ 5] = gfx[10] + color; - dst[ 6] = gfx[ 9] + color; - dst[ 7] = gfx[ 8] + color; - dst[ 8] = gfx[ 7] + color; - dst[ 9] = gfx[ 6] + color; - dst[10] = gfx[ 5] + color; - dst[11] = gfx[ 4] + color; - dst[12] = gfx[ 3] + color; - dst[13] = gfx[ 2] + color; - dst[14] = gfx[ 1] + color; - dst[15] = gfx[ 0] + color; - } else { - dst[ 0] = gfx[ 0] + color; - dst[ 1] = gfx[ 1] + color; - dst[ 2] = gfx[ 2] + color; - dst[ 3] = gfx[ 3] + color; - dst[ 4] = gfx[ 4] + color; - dst[ 5] = gfx[ 5] + color; - dst[ 6] = gfx[ 6] + color; - dst[ 7] = gfx[ 7] + color; - dst[ 8] = gfx[ 8] + color; - dst[ 9] = gfx[ 9] + color; - dst[10] = gfx[10] + color; - dst[11] = gfx[11] + color; - dst[12] = gfx[12] + color; - dst[13] = gfx[13] + color; - dst[14] = gfx[14] + color; - dst[15] = gfx[15] + color; - } - - pri[ 0] = prio; - pri[ 1] = prio; - pri[ 2] = prio; - pri[ 3] = prio; - pri[ 4] = prio; - pri[ 5] = prio; - pri[ 6] = prio; - pri[ 7] = prio; - pri[ 8] = prio; - pri[ 9] = prio; - pri[10] = prio; - pri[11] = prio; - pri[12] = prio; - pri[13] = prio; - pri[14] = prio; - pri[15] = prio; - - dst += 1024; - pri += 1024; - } - } - } -} - - -static void suprnova_draw_roz(UINT16 *source, UINT8 *flags, UINT16 *ddest, UINT8 *dflags, UINT32 startx, UINT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, INT32 wraparound, INT32 columnscroll, UINT32* scrollram) -{ - const INT32 xmask = 0x3ff; - const INT32 ymask = 0x3ff; - const UINT32 widthshifted = 1024 << 16; - const UINT32 heightshifted = 1024 << 16; - UINT32 cx; - UINT32 cy; - INT32 x; - INT32 sx; - INT32 sy; - INT32 ex; - INT32 ey; - UINT16 *dest; - UINT8* destflags; - - /* pre-advance based on the cliprect */ - startx += 0 * incxx + 0 * incyx; - starty += 0 * incxy + 0 * incyy; - - /* extract start/end points */ - sx = 0; - sy = 0; - ex = nScreenWidth-1; - ey = nScreenHeight-1; - - { - /* loop over rows */ - while (sy <= ey) - { - - /* initialize X counters */ - x = sx; - cx = startx; - cy = starty; - - /* get dest and priority pointers */ - dest = ddest + (sy * nScreenWidth) + sx; - destflags = dflags + (sy * nScreenWidth) + sx; - - /* loop over columns */ - while (x <= ex) - { - if ((wraparound) || (cx < widthshifted && cy < heightshifted)) // not sure how this will cope with no wraparound, but row/col scroll.. - { - if (columnscroll) - { - INT32 offset = (((cy >> 16) - scrollram[(cx>>16)&0x3ff]) & ymask) * 1024 + ((cx >> 16) & xmask); - offset &= 0xfffff; - dest[0] = source[offset]; - destflags[0] = flags[offset]; - } - else - { - INT32 offset = ((cy >> 16) & ymask) * 1024 + (((cx >> 16) - scrollram[(cy>>16)&0x3ff]) & xmask); - offset &= 0xfffff; -; dest[0] = source[offset]; - destflags[0] = flags[offset]; - } - } - - /* advance in X */ - cx += incxx; - cy += incxy; - x++; - dest++; - destflags++; - } - - /* advance in Y */ - startx += incyx; - starty += incyy; - sy++; - } - } -} - -static void supernova_draw(INT32 *offs, UINT16 *bitmap, UINT8 *flags, UINT16 *dbitmap, UINT8 *dflags, INT32 layer) -{ - UINT32 *vreg = (UINT32*)DrvV3Regs; - UINT32 *line = (UINT32*)DrvLineRAM; - - INT32 enable = (vreg[offs[0]] >> 0) & 0x0001; - INT32 nowrap = (vreg[offs[0]] >> 0) & 0x0004; - - UINT32 startx,starty; - INT32 incxx,incxy,incyx,incyy; - INT32 columnscroll; - - if (enable && suprnova_alt_enable_background) - { - if (layer == 0) draw_layer(DrvVidRAM + 0x0000, DrvTmpScreenBuf + 0x0000, DrvTmpScreenA, DrvTmpFlagA, DrvGfxROM1, 0); - if (layer == 1) draw_layer(DrvVidRAM + 0x4000, DrvTmpScreenBuf + 0x4000, DrvTmpScreenB, DrvTmpFlagB, DrvGfxROM2, 1); - - startx = vreg[offs[1]]; - incyy = vreg[offs[2]]&0x7ffff; - if (incyy&0x40000) incyy = incyy-0x80000; // level 3 boss in sengekis - incyx = vreg[offs[3]]; - starty = vreg[offs[4]]; - incxy = vreg[offs[5]]; - incxx = vreg[offs[6]]&0x7ffff; - if (incxx&0x40000) incxx = incxx-0x80000; - - columnscroll = (vreg[0x0c/4] >> offs[7]) & 0x0001; - - // iq_132 complete hack for now.... - if ((incyy|incyx|incxy|incxx)==0) { - incyy=1<<8; - incxx=1<<8; - } - - if (nBurnLayer & (layer+1)) suprnova_draw_roz(bitmap,flags,dbitmap,dflags,startx << 8,starty << 8, incxx << 8,incxy << 8,incyx << 8,incyy << 8, !nowrap, columnscroll, &line[offs[8]]); - } -} - -static void DrvRecalcPalette() -{ - INT32 use_bright, brightness_r, brightness_g, brightness_b; - INT32 r,g,b; - UINT32 *p = (UINT32*)DrvPalRAM; - for (INT32 i = 0; i < 0x20000 / 4; i++) { - r = (p[i] >> 10) & 0x1f; - g = (p[i] >> 5) & 0x1f; - b = (p[i] >> 0) & 0x1f; - - if (i < 0x4000) { // 1st half is for Sprites - use_bright = use_spc_bright; - brightness_b = bright_spc_b; - brightness_g = bright_spc_g; - brightness_r = bright_spc_r; - } else { // V3 bg's - use_bright = use_v3_bright; - brightness_b = bright_v3_b; - brightness_g = bright_v3_g; - brightness_r = bright_v3_r; - } - - if(use_bright) { - if(brightness_b) b = ((b<<3) * (brightness_b+1))>>8; - else b = 0; - if(brightness_g) g = ((g<<3) * (brightness_g+1))>>8; - else g = 0; - if(brightness_r) r = ((r<<3) * (brightness_r+1))>>8; - else r = 0; - } else { - r <<= 3; - g <<= 3; - b <<= 3; - } - - DrvPalette[i] = (r << 16) | (g << 8) | b; - } -} - - -static void render_and_copy_layers() -{ - UINT32 *vreg = (UINT32*)DrvV3Regs; - - INT32 offs[2][9] = { - { 0x10 / 4, 0x1c / 4, 0x30 / 4, 0x2c / 4, 0x20 / 4, 0x28 / 4, 0x24 / 4, 1, 0x0000 }, - { 0x34 / 4, 0x40 / 4, 0x54 / 4, 0x50 / 4, 0x44 / 4, 0x4c / 4, 0x48 / 4, 9, 0x1000 / 4 } - }; - - { - INT32 supernova_pri_a = (vreg[0x10/4] & 0x0002)>>1; - INT32 supernova_pri_b = (vreg[0x34/4] & 0x0002)>>1; - - supernova_draw(offs[1], DrvTmpScreenB, DrvTmpFlagB, DrvTmpScreenB2, DrvTmpFlagB2, 1); - supernova_draw(offs[0], DrvTmpScreenA, DrvTmpFlagA, DrvTmpScreenA2, DrvTmpFlagA2, 0); - - { - INT32 x,y; - UINT8* srcflags, *src2flags; - UINT16* src, *src2, *src3; - UINT32* dst; - UINT16 pri, pri2, pri3; - UINT16 bgpri; - - UINT32 *clut = DrvPalette; - - for (y=0;y<240;y++) - { - src = DrvTmpScreenB2 + y * nScreenWidth; //BITMAP_ADDR16(tilemap_bitmap_lower, y, 0); - srcflags = DrvTmpFlagB2 + y * nScreenWidth; //BITMAP_ADDR8(tilemap_bitmapflags_lower, y, 0); - - src2 = DrvTmpScreenA2 + y * nScreenWidth; //BITMAP_ADDR16(tilemap_bitmap_higher, y, 0); - src2flags = DrvTmpFlagA2 + y * nScreenWidth; //BITMAP_ADDR8(tilemap_bitmapflags_higher, y, 0); - - src3 = DrvTmpScreenC + y * nScreenWidth; //BITMAP_ADDR16(sprite_bitmap, y, 0); - - dst = DrvTmpDraw + y * nScreenWidth; //BITMAP_ADDR32(bitmap, y, 0); - - for (x=0;x<320;x++) - { - UINT16 pendata = src[x]&0x7fff; - UINT16 pendata2 = src2[x]&0x7fff; - UINT16 bgpendata; - UINT16 pendata3 = src3[x]&0x3fff; - - UINT32 coldat; - - pri = ((srcflags[x] & 0x07)<<1) | (supernova_pri_b); - pri2= ((src2flags[x] & 0x07)<<1) | (supernova_pri_a); - pri3 = ((src3[x]&0xc000)>>12)+3; - - if (pri<=pri2) // <= is good for last level of cyvern.. < seem better for galpanis kaneko logo - { - if (pendata2&0xff) - { - bgpendata = pendata2&0x7fff; - bgpri = pri2; - } - else if (pendata&0xff) - { - bgpendata = pendata&0x7fff; - bgpri = pri; - } - else - { - bgpendata = pendata2&0x7fff; - bgpri = 0; - } - } - else - { - if (pendata&0xff) - { - bgpendata = pendata&0x7fff; - bgpri = pri; - } - else if (pendata2&0xff) - { - bgpendata = pendata2&0x7fff; - bgpri = pri2; - } - else - { - bgpendata = 0; - bgpri = 0; - } - } - - // if the sprites are higher than the bg pixel - if (pri3 > bgpri) - { - if (pendata3&0xff) - { - UINT16 palvalue = *((UINT32*)(DrvPalRAM + (pendata3 * 4))); - - coldat = clut[pendata3]; - - if (palvalue&0x8000) // iq_132 - { - UINT32 srccolour = clut[bgpendata&0x7fff]; - UINT32 dstcolour = clut[pendata3&0x3fff]; - - INT32 r,g,b; - INT32 r2,g2,b2; - - r = (srccolour & 0x000000ff)>> 0; - g = (srccolour & 0x0000ff00)>> 8; - b = (srccolour & 0x00ff0000)>> 16; - - r2 = (dstcolour & 0x000000ff)>> 0; - g2 = (dstcolour & 0x0000ff00)>> 8; - b2 = (dstcolour & 0x00ff0000)>> 16; - - r2 = (r2 * bright_spc_r_trans) >> 8; - g2 = (g2 * bright_spc_g_trans) >> 8; - b2 = (b2 * bright_spc_b_trans) >> 8; - - r = (r+r2); - if (r>255) r = 255; - - g = (g+g2); - if (g>255) g = 255; - - b = (b+b2); - if (b>255) b = 255; - - dst[x] = (r << 16) | (g << 8) | (b << 0); - } - - else - { - coldat = clut[pendata3]; - dst[x] = coldat; - } - } - else - { - coldat = clut[bgpendata]; - dst[x] = coldat; - } - } - else - { - coldat = clut[bgpendata]; - dst[x] = coldat; - } - - } - } - } - } -} - - -static INT32 DrvDraw() -{ - DrvRecalcPalette(); - - if (nBurnBpp == 4) { // 32bpp rendered directly - DrvTmpDraw = (UINT32*)pBurnDraw; - } else { - DrvTmpDraw = pDrvTmpDraw; - } - - memset (DrvTmpScreenA2, 0, nScreenWidth * nScreenHeight * 2); - memset (DrvTmpScreenB2, 0, nScreenWidth * nScreenHeight * 2); - - render_and_copy_layers(); - - // mix sprites next frame (necessary 1frame sprite lag) - memset (DrvTmpScreenC, 0, nScreenWidth * nScreenHeight * 2); - if (nSpriteEnable & 1) skns_draw_sprites(DrvTmpScreenC, (UINT32*)DrvSprRAM, 0x4000, DrvGfxROM0, nGfxLen0, (UINT32*)DrvSprRegs, 0); - - if (nBurnBpp != 4) { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - INT32 d = DrvTmpDraw[i]; - PutPix(pBurnDraw + i * nBurnBpp, BurnHighCol(d>>16, d>>8, d, 0)); - } - } - - nRedrawTiles = 0; - - return 0; -} - -static UINT32 scalerange_skns(UINT32 x, UINT32 in_min, UINT32 in_max, UINT32 out_min, UINT32 out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -static UINT8 Paddle_X = 0; - -static UINT8 Paddle_incdec(UINT32 PaddlePortnum) { - UINT8 Temp; - - Temp = 0x7f + (PaddlePortnum >> 4); - if (Temp < 0x01) Temp = 0x01; - if (Temp > 0xfe) Temp = 0xfe; - Temp = scalerange_skns(Temp, 0x3f, 0xbe, 0x01, 0xfe); - if (Temp > 0x90) Paddle_X-=15; - if (Temp < 0x70) Paddle_X+=15; - return Paddle_X; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = ~0; - for (INT32 i = 0; i < 32; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - - DrvInputs[1] = 0x0000ff00 | DrvDips[0]; - DrvInputs[1] |= Paddle_incdec(DrvAnalogPort0) << 24; - DrvInputs[2] = 0xffffffff; - } - - UINT32 nTotalCycles = (sixtyhz) ? (28638000 / 60) : (INT32)(28638000 / 59.5971); - INT32 nCyclesDone = 0; - INT32 nInterleave = 262; - - for (INT32 i = 0; i < nInterleave; i++) { - //Sh2Run(nTotalCycles / nInterleave); - nCyclesDone += Sh2Run(((i + 1) * nTotalCycles / nInterleave) - nCyclesDone); - - if (i == 1) { - Sh2SetIRQLine(1, CPU_IRQSTATUS_AUTO); - } else if (i == 240) { - Sh2SetIRQLine(5, CPU_IRQSTATUS_AUTO); - } - { // fire irq9 every interleave iteration. - Sh2SetIRQLine(9, CPU_IRQSTATUS_AUTO); - if (i%125==0 && i!=0) { //125 = every 8 ms (per 261 interleave) - Sh2SetIRQLine(11, CPU_IRQSTATUS_AUTO); - } - if (i%31==0 && i!=0) { //31=every 2 ms - Sh2SetIRQLine(15, CPU_IRQSTATUS_AUTO); - } - } - } - - if (pBurnSoundOut) { - YMZ280BRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.nAddress = 0; - ba.szName = "All RAM"; - BurnAcb(&ba); - - ba.Data = DrvGfxROM2; - ba.nLen = 0x40000; - ba.nAddress = 0; - ba.szName = "RAM Tiles"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - Sh2Scan(nAction); - YMZ280BScan(); - - SCAN_VAR(hit); - SCAN_VAR(suprnova_alt_enable_sprites); - SCAN_VAR(bright_spc_g_trans); - SCAN_VAR(bright_spc_r_trans); - SCAN_VAR(bright_spc_b_trans); - SCAN_VAR(bright_spc_g); - SCAN_VAR(bright_spc_r); - SCAN_VAR(bright_spc_b); - SCAN_VAR(suprnova_alt_enable_background); - SCAN_VAR(bright_v3_g); - SCAN_VAR(bright_v3_r); - SCAN_VAR(bright_v3_b); - SCAN_VAR(use_spc_bright); - SCAN_VAR(use_v3_bright); - } - - if (nAction & ACB_NVRAM) { - ba.Data = DrvNvRAM; - ba.nLen = 0x02000; - ba.nAddress = 0; - ba.szName = "NV RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_WRITE) { - nRedrawTiles = 1; - olddepths[0] = olddepths[1] = 0xff; - } - - return 0; -} - - -// Super Kaneko Nova System BIOS - -static struct BurnRomInfo sknsRomDesc[] = { - { "sknsj1.u10", 0x80000, 0x7e2b836c, BRF_BIOS}, // 0 Japan - { "sknse2.u10", 0x80000, 0xe2b9d7d1, BRF_BIOS}, // 1 Europe - { "sknsa1.u10", 0x80000, 0x745e5212, BRF_BIOS}, // 2 Asia - { "sknsu1.u10", 0x80000, 0x384d21ec, BRF_BIOS}, // 3 USA - { "sknsk1.u10", 0x80000, 0xff1c9f79, BRF_BIOS}, // 4 Korea - -#if defined (ROM_VERIFY) - { "supernova_modbios-japan.u10", 0x080000, 0xb8d3190c, BRF_OPT }, - { "supernova-modbios-korea.u10", 0x080000, 0x1d90517c, BRF_OPT }, -#endif -}; - -STD_ROM_PICK(skns) -STD_ROM_FN(skns) - -static INT32 SknsInit() { - return 1; -} - -struct BurnDriver BurnDrvSkns = { - "skns", NULL, NULL, NULL, "1996", - "Super Kaneko Nova System BIOS\0", "BIOS only", "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_BOARDROM, 0, HARDWARE_KANEKO_SKNS, GBF_BIOS, 0, - NULL, sknsRomInfo, sknsRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, - SknsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Cyvern (US) - -static struct BurnRomInfo cyvernRomDesc[] = { - { "cv-usa.u10", 0x100000, 0x1023ddca, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "cv-usa.u8", 0x100000, 0xf696f6be, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "cv100-00.u24", 0x400000, 0xcd4ae88a, 2 | BRF_GRA}, // 2 Sprites - { "cv101-00.u20", 0x400000, 0xa6cb3f0b, 2 | BRF_GRA}, // 3 - - { "cv200-00.u16", 0x400000, 0xddc8c67e, 3 | BRF_GRA}, // 4 Background Tiles - { "cv201-00.u13", 0x400000, 0x65863321, 3 | BRF_GRA}, // 5 - - { "cv210-00.u18", 0x400000, 0x7486bf3a, 4 | BRF_GRA}, // 6 Foreground Tiles - - { "cv300-00.u4", 0x400000, 0xfbeda465, 5 | BRF_SND}, // 7 YMZ280b Samples -}; - -STDROMPICKEXT(cyvern, cyvern, skns) -STD_ROM_FN(cyvern) - -static INT32 CyvernInit() -{ - sprite_kludge_x = 0; - sprite_kludge_y = 2; - speedhack_address = 0x604d3c8; - speedhack_pc[0] = 0x402ebd4; - - return DrvInit(3 /* USA */); -} - -struct BurnDriver BurnDrvCyvern = { - "cyvern", NULL, "skns", NULL, "1998", - "Cyvern (US)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_VERSHOOT, 0, - NULL, cyvernRomInfo, cyvernRomName, NULL, NULL, CyvernInputInfo, CyvernDIPInfo, - CyvernInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 240, 320, 3, 4 -}; - - -// Cyvern (Japan) - -static struct BurnRomInfo cyvernjRomDesc[] = { - { "cvj-even.u10", 0x100000, 0x802fadb4, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "cvj-odd.u8", 0x100000, 0xf8a0fbdd, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "cv100-00.u24", 0x400000, 0xcd4ae88a, 2 | BRF_GRA}, // 2 Sprites - { "cv101-00.u20", 0x400000, 0xa6cb3f0b, 2 | BRF_GRA}, // 3 - - { "cv200-00.u16", 0x400000, 0xddc8c67e, 3 | BRF_GRA}, // 4 Background Tiles - { "cv201-00.u13", 0x400000, 0x65863321, 3 | BRF_GRA}, // 5 - - { "cv210-00.u18", 0x400000, 0x7486bf3a, 4 | BRF_GRA}, // 6 Foreground Tiles - - { "cv300-00.u4", 0x400000, 0xfbeda465, 5 | BRF_SND}, // 7 YMZ280b Samples -}; - -STDROMPICKEXT(cyvernj, cyvernj, skns) -STD_ROM_FN(cyvernj) - -static INT32 CyvernJInit() -{ - sprite_kludge_x = 0; - sprite_kludge_y = 2; - speedhack_address = 0x604d3c8; - speedhack_pc[0] = 0x402ebd4; - - return DrvInit(0 /* Japan */); -} - -struct BurnDriver BurnDrvCyvernJ = { - "cyvernj", "cyvern", "skns", NULL, "1998", - "Cyvern (Japan)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_VERSHOOT, 0, - NULL, cyvernjRomInfo, cyvernjRomName, NULL, NULL, CyvernInputInfo, CyvernDIPInfo, - CyvernJInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 240, 320, 3, 4 -}; - -// Guts'n (Japan) - -static struct BurnRomInfo gutsnRomDesc[] = { - { "gts000j0.u6", 0x080000, 0x8ee91310, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "gts001j0.u4", 0x080000, 0x80b8ee66, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gts10000.u24", 0x400000, 0x1959979e, 2 | BRF_GRA }, // 2 Sprites - - { "gts20000.u16", 0x400000, 0xc443aac3, 3 | BRF_GRA }, // 3 Background Tiles - - { "gts30000.u4", 0x400000, 0x8c169141, 5 | BRF_SND }, // 4 YMZ280b Samples -}; - -STDROMPICKEXT(gutsn, gutsn, skns) -STD_ROM_FN(gutsn) - -static INT32 GutsnInit() -{ - sprite_kludge_x = 0; - sprite_kludge_y = 0; - speedhack_address = 0x600c780; - speedhack_pc[0] = 0x4022070; //number from mame + 0x02 - - return DrvInit(0 /*japan*/); -} - -struct BurnDriver BurnDrvGutsn = { - "gutsn", NULL, "skns", NULL, "2000", - "Guts'n (Japan)\0", NULL, "Kaneko / Kouyousha", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, gutsnRomInfo, gutsnRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, - GutsnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Sengeki Striker (Asia) - -static struct BurnRomInfo sengekisRomDesc[] = { - { "ss01a.u6", 0x080000, 0x962fe857, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "ss01a.u4", 0x080000, 0xee853c23, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ss100-00.u21", 0x400000, 0xbc7b3dfa, 2 | BRF_GRA}, // 2 Sprites - { "ss101-00.u20", 0x400000, 0xab2df280, 2 | BRF_GRA}, // 3 - { "ss102-00.u8", 0x400000, 0x0845eafe, 2 | BRF_GRA}, // 4 - { "ss103-00.u32", 0x400000, 0xee451ac9, 2 | BRF_GRA}, // 5 - - { "ss200-00.u17", 0x400000, 0xcd773976, 3 | BRF_GRA}, // 6 Background Tiles - { "ss201-00.u9", 0x400000, 0x301fad4c, 3 | BRF_GRA}, // 7 - - { "ss210-00.u3", 0x200000, 0xc3697805, 4 | BRF_GRA}, // 8 Foreground Tiles - - { "ss300-00.u1", 0x400000, 0x35b04b18, 5 | BRF_SND}, // 9 YMZ280b Samples -}; - -STDROMPICKEXT(sengekis, sengekis, skns) -STD_ROM_FN(sengekis) - -static INT32 SengekisInit() -{ - sprite_kludge_x = -192; - sprite_kludge_y = -272; - - speedhack_address = 0x60b74bc; - speedhack_pc[0] = 0x60006ec + 2; - sixtyhz = 1; - - return DrvInit(2 /*asia*/); -} - -struct BurnDriver BurnDrvSengekis = { - "sengekis", NULL, "skns", NULL, "1997", - "Sengeki Striker (Asia)\0", NULL, "Kaneko / Warashi", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_VERSHOOT, 0, - NULL, sengekisRomInfo, sengekisRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, - SengekisInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 240, 320, 3, 4 -}; - -// Sengeki Striker (Japan) - -static struct BurnRomInfo sengekisjRomDesc[] = { - { "ss01j.u6", 0x080000, 0x9efdcd5a, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "ss01j.u4", 0x080000, 0x92c3f45e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "ss100-00.u21", 0x400000, 0xbc7b3dfa, 2 | BRF_GRA }, // 2 Sprites - { "ss101-00.u20", 0x400000, 0xab2df280, 2 | BRF_GRA }, // 3 - { "ss102-00.u8", 0x400000, 0x0845eafe, 2 | BRF_GRA }, // 4 - { "ss103-00.u32", 0x400000, 0xee451ac9, 2 | BRF_GRA }, // 5 - - { "ss200-00.u17", 0x400000, 0xcd773976, 3 | BRF_GRA }, // 6 Background Tiles - { "ss201-00.u9", 0x400000, 0x301fad4c, 3 | BRF_GRA }, // 7 - - { "ss210-00.u3", 0x200000, 0xc3697805, 4 | BRF_GRA }, // 8 Foreground Tiles - - { "ss300-00.u1", 0x400000, 0x35b04b18, 5 | BRF_SND }, // 9 YMZ280b Samples -}; - -STDROMPICKEXT(sengekisj, sengekisj, skns) -STD_ROM_FN(sengekisj) - -static INT32 SengekisjInit() -{ - sprite_kludge_x = -192; - sprite_kludge_y = -272; - - speedhack_address = 0x60b7380; - speedhack_pc[0] = 0x60006ec + 2; - sixtyhz = 1; - - return DrvInit(0 /*japan*/); -} - -struct BurnDriver BurnDrvSengekisj = { - "sengekisj", "sengekis", "skns", NULL, "1997", - "Sengeki Striker (Japan)\0", NULL, "Kaneko / Warashi", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_VERSHOOT, 0, - NULL, sengekisjRomInfo, sengekisjRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, - SengekisjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 240, 320, 3, 4 -}; - - -// Puzz Loop (Europe, v0.94) - -static struct BurnRomInfo puzzloopRomDesc[] = { - { "pl00e4.u6", 0x080000, 0x7d3131a5, 1 | BRF_PRG | BRF_ESS }, // 1 SH2 Code - { "pl00e4.u4", 0x080000, 0x40dc3291, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pzl10000.u24", 0x400000, 0x35bf6897, 2 | BRF_GRA }, // 3 Sprites - - { "pzl20000.u16", 0x400000, 0xff558e68, 3 | BRF_GRA }, // 4 Background Tiles - - { "pzl21000.u18", 0x400000, 0xc8b3be64, 4 | BRF_GRA }, // 5 Foreground Tiles - - { "pzl30000.u4", 0x400000, 0x38604b8d, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(puzzloop, puzzloop, skns) -STD_ROM_FN(puzzloop) - -static INT32 PuzzloopInit() -{ - sprite_kludge_x = -9; - sprite_kludge_y = -1; - - speedhack_address = 0x6081d38; - speedhack_pc[0] = 0x401dab0 + 2; - - return DrvInit(1 /*europe*/); -} - -struct BurnDriver BurnDrvPuzzloop = { - "puzzloop", NULL, "skns", NULL, "1998", - "Puzz Loop (Europe, v0.94)\0", NULL, "Mitchell", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, puzzloopRomInfo, puzzloopRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //PuzzloopInputInfo, PuzzloopDIPInfo, - PuzzloopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Puzz Loop (Europe, v0.93) - -static struct BurnRomInfo puzzloopeRomDesc[] = { - { "pl00e1.u6", 0x080000, 0x273adc38, 1 | BRF_PRG | BRF_ESS }, // 1 SH2 Code - { "pl00e1.u4", 0x080000, 0x14ac2870, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pzl10000.u24", 0x400000, 0x35bf6897, 2 | BRF_GRA }, // 3 Sprites - - { "pzl20000.u16", 0x400000, 0xff558e68, 3 | BRF_GRA }, // 4 Background Tiles - - { "pzl21000.u18", 0x400000, 0xc8b3be64, 4 | BRF_GRA }, // 5 Foreground Tiles - - { "pzl30000.u4", 0x400000, 0x38604b8d, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(puzzloope, puzzloope, skns) -STD_ROM_FN(puzzloope) - -struct BurnDriver BurnDrvPuzzloope = { - "puzzloope", "puzzloop", "skns", NULL, "1998", - "Puzz Loop (Europe, v0.93)\0", NULL, "Mitchell", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, puzzloopeRomInfo, puzzloopeRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //PuzzloopInputInfo, PuzzloopDIPInfo, - PuzzloopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Puzz Loop (Japan) - -static struct BurnRomInfo puzzloopjRomDesc[] = { - { "pl0j2.u6", 0x080000, 0x23c3bf97, 1 | BRF_PRG | BRF_ESS }, // 1 SH2 Code - { "pl0j2.u4", 0x080000, 0x55b2a3cb, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pzl10000.u24", 0x400000, 0x35bf6897, 2 | BRF_GRA }, // 3 Sprites - - { "pzl20000.u16", 0x400000, 0xff558e68, 3 | BRF_GRA }, // 4 Background Tiles - - { "pzl21000.u18", 0x400000, 0xc8b3be64, 4 | BRF_GRA }, // 5 Foreground Tiles - - { "pzl30000.u4", 0x400000, 0x38604b8d, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(puzzloopj, puzzloopj, skns) -STD_ROM_FN(puzzloopj) - -static INT32 PuzzloopjInit() -{ - sprite_kludge_x = -9; - sprite_kludge_y = -1; - - speedhack_address = 0x6086714; - speedhack_pc[0] = 0x401dca0 + 2; - - return DrvInit(0 /*japan*/); -} - -struct BurnDriver BurnDrvPuzzloopj = { - "puzzloopj", "puzzloop", "skns", NULL, "1998", - "Puzz Loop (Japan)\0", NULL, "Mitchell", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, puzzloopjRomInfo, puzzloopjRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //PuzzloopInputInfo, PuzzloopDIPInfo, - PuzzloopjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Puzz Loop (Asia) - -static struct BurnRomInfo puzzloopaRomDesc[] = { - { "pl0a3.u6", 0x080000, 0x4e8673b8, 1 | BRF_PRG | BRF_ESS }, // 1 SH2 Code - { "pl0a3.u4", 0x080000, 0xe08a1a07, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pzl10000.u24", 0x400000, 0x35bf6897, 2 | BRF_GRA }, // 3 Sprites - - { "pzl20000.u16", 0x400000, 0xff558e68, 3 | BRF_GRA }, // 4 Background Tiles - - { "pzl21000.u18", 0x400000, 0xc8b3be64, 4 | BRF_GRA }, // 5 Foreground Tiles - - { "pzl30000.u4", 0x400000, 0x38604b8d, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(puzzloopa, puzzloopa, skns) -STD_ROM_FN(puzzloopa) - -static INT32 PuzzloopaInit() -{ - sprite_kludge_x = -9; - sprite_kludge_y = -1; - - speedhack_address = 0x6085bcc; - speedhack_pc[0] = 0x401d9d4 + 2; - - return DrvInit(2 /*asia*/); -} - -struct BurnDriver BurnDrvPuzzloopa = { - "puzzloopa", "puzzloop", "skns", NULL, "1998", - "Puzz Loop (Asia)\0", NULL, "Mitchell", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, puzzloopaRomInfo, puzzloopaRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //PuzzloopInputInfo, PuzzloopDIPInfo, - PuzzloopaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Puzz Loop (Korea) - -static struct BurnRomInfo puzzloopkRomDesc[] = { - { "pl0k4.u6", 0x080000, 0x8d81f20c, 1 | BRF_PRG | BRF_ESS }, // 1 SH2 Code - { "pl0k4.u4", 0x080000, 0x17c78e41, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pzl10000.u24", 0x400000, 0x35bf6897, 2 | BRF_GRA }, // 3 Sprites - - { "pzl20000.u16", 0x400000, 0xff558e68, 3 | BRF_GRA }, // 4 Background Tiles - - { "pzl21000.u18", 0x400000, 0xc8b3be64, 4 | BRF_GRA }, // 5 Foreground Tiles - - { "pzl30000.u4", 0x400000, 0x38604b8d, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(puzzloopk, puzzloopk, skns) -STD_ROM_FN(puzzloopk) - -static INT32 PuzzloopkInit() -{ - sprite_kludge_x = -9; - sprite_kludge_y = -1; - -// speedhack_address = 0x6081d38; -// speedhack_pc[0] = 0x401dab0 + 2; - - return DrvInit(4 /*korea*/); -} - -struct BurnDriver BurnDrvPuzzloopk = { - "puzzloopk", "puzzloop", "skns", NULL, "1998", - "Puzz Loop (Korea)\0", NULL, "Mitchell", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, puzzloopkRomInfo, puzzloopkRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //PuzzloopInputInfo, PuzzloopDIPInfo, - PuzzloopkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Puzz Loop (USA) - -static struct BurnRomInfo puzzloopuRomDesc[] = { - { "plue5.u6", 0x080000, 0xe6f3f82f, 1 | BRF_PRG | BRF_ESS }, // 1 SH2 Code - { "plue5.u4", 0x080000, 0x0d081d30, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "pzl10000.u24", 0x400000, 0x35bf6897, 2 | BRF_GRA }, // 3 Sprites - - { "pzl20000.u16", 0x400000, 0xff558e68, 3 | BRF_GRA }, // 4 Background Tiles - - { "pzl21000.u18", 0x400000, 0xc8b3be64, 4 | BRF_GRA }, // 5 Foreground Tiles - - { "pzl30000.u4", 0x400000, 0x38604b8d, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(puzzloopu, puzzloopu, skns) -STD_ROM_FN(puzzloopu) - -static INT32 PuzzloopuInit() -{ - sprite_kludge_x = -9; - sprite_kludge_y = -1; - - speedhack_address = 0x6085cec; - speedhack_pc[0] = 0x401dab0 + 2; - - return DrvInit(3 /*usa*/); -} - -struct BurnDriver BurnDrvPuzzloopu = { - "puzzloopu", "puzzloop", "skns", NULL, "1998", - "Puzz Loop (USA)\0", NULL, "Mitchell", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, puzzloopuRomInfo, puzzloopuRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //PuzzloopInputInfo, PuzzloopDIPInfo, - PuzzloopuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Tel Jan - -static struct BurnRomInfo teljanRomDesc[] = { - { "tel1j.u10", 0x080000, 0x09b552fe, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "tel1j.u8", 0x080000, 0x070b4345, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "tj100-00.u24", 0x400000, 0x810144f1, 2 | BRF_GRA }, // 2 Sprites - { "tj101-00.u20", 0x400000, 0x82f570e1, 2 | BRF_GRA }, // 3 - { "tj102-00.u17", 0x400000, 0xace875dc, 2 | BRF_GRA }, // 4 - - { "tj200-00.u16", 0x400000, 0xbe0f90b2, 3 | BRF_GRA }, // 5 Background Tiles - - { "tj300-00.u4", 0x400000, 0x685495c4, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(teljan, teljan, skns) -STD_ROM_FN(teljan) - -static INT32 TeljanInit() -{ - sprite_kludge_x = 5; - sprite_kludge_y = 1; - - speedhack_address = 0x6002fb4; - speedhack_pc[0] = 0x401ba32 + 2; - - return DrvInit(0 /*japan*/); -} - -struct BurnDriver BurnDrvTeljan = { - "teljan", NULL, "skns",NULL, "1999", - "Tel Jan\0", NULL, "Electro Design", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO_SKNS, GBF_MAHJONG, 0, - NULL, teljanRomInfo, teljanRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //Skns_1pInputInfo, Skns_1pDIPInfo, - TeljanInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Panic Street (Japan) - -static struct BurnRomInfo panicstrRomDesc[] = { - { "ps1000j0.u10", 0x100000, 0x59645f89, 1 | BRF_PRG | BRF_ESS }, // 1 SH2 Code - { "ps1001j0.u8", 0x100000, 0xc4722be9, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "ps-10000.u24", 0x400000, 0x294b2f14, 2 | BRF_GRA }, // 3 Sprites - { "ps110100.u20", 0x400000, 0xe292f393, 2 | BRF_GRA }, // 4 - - { "ps120000.u16", 0x400000, 0xd772ac15, 3 | BRF_GRA }, // 5 Background Tiles - - { "ps-30000.u4", 0x400000, 0x2262e263, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(panicstr, panicstr, skns) -STD_ROM_FN(panicstr) - -static INT32 PanicstrInit() -{ - sprite_kludge_x = -1; - sprite_kludge_y = -1; - - speedhack_address = 0x60f19e4; - speedhack_pc[0] = 0x404e68a + 2; - - return DrvInit(0 /*japan*/); -} - -struct BurnDriver BurnDrvPanicstr = { - "panicstr", NULL, "skns", NULL, "1999", - "Panic Street (Japan)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, panicstrRomInfo, panicstrRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //GalpanisInputInfo, GalpanisDIPInfo, - PanicstrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic 4 (Japan) - -static struct BurnRomInfo galpani4RomDesc[] = { - { "gp4j1.u10", 0x080000, 0x919a3893, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "gp4j1.u8", 0x080000, 0x94cb1fb7, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gp4-100-00.u24", 0x200000, 0x1df61f01, 2 | BRF_GRA }, // 2 Sprites - { "gp4-101-00.u20", 0x100000, 0x8e2c9349, 2 | BRF_GRA }, // 3 - - { "gp4-200-00.u16", 0x200000, 0xf0781376, 3 | BRF_GRA }, // 4 Background Tiles - { "gp4-201-00.u18", 0x200000, 0x10c4b183, 3 | BRF_GRA }, // 5 - - { "gp4-300-00.u4", 0x200000, 0x8374663a, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(galpani4, galpani4, skns) -STD_ROM_FN(galpani4) - -static INT32 Galpani4Init() -{ - sprite_kludge_x = -5; - sprite_kludge_y = -1; - - return DrvInit(0 /*Japan*/); -} - -struct BurnDriver BurnDrvGalpani4 = { - "galpani4", NULL, "skns", NULL, "1996", - "Gals Panic 4 (Japan)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpani4RomInfo, galpani4RomName, NULL, NULL, CyvernInputInfo, CyvernNoSpeedhackDIPInfo, - Galpani4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic 4 (Korea) - -static struct BurnRomInfo galpani4kRomDesc[] = { - { "gp4k1.u10", 0x080000, 0xcbd5c3a0, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "gp4k1.u8", 0x080000, 0x7a95bfe2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gp4-100-00.u24", 0x200000, 0x1df61f01, 2 | BRF_GRA }, // 2 Sprites - { "gp4-101-00.u20", 0x100000, 0x8e2c9349, 2 | BRF_GRA }, // 3 - - { "gp4-200-00.u16", 0x200000, 0xf0781376, 3 | BRF_GRA }, // 4 Background Tiles - { "gp4-201-00.u18", 0x200000, 0x10c4b183, 3 | BRF_GRA }, // 5 - - { "gp4-300-00.u4", 0x200000, 0x8374663a, 5 | BRF_SND }, // 6 YMZ280b Samples - { "gp4-301-01.u7", 0x200000, 0x886ef77f, 5 | BRF_SND }, // 7 -}; - -STDROMPICKEXT(galpani4k, galpani4k, skns) -STD_ROM_FN(galpani4k) - -static INT32 Galpani4kInit() -{ - sprite_kludge_x = -5; - sprite_kludge_y = -1; - - return DrvInit(4 /*Korea*/); -} - -struct BurnDriver BurnDrvGalpani4k = { - "galpani4k", "galpani4", "skns", NULL, "1996", - "Gals Panic 4 (Korea)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpani4kRomInfo, galpani4kRomName, NULL, NULL, CyvernInputInfo, CyvernNoSpeedhackDIPInfo, - Galpani4kInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - -// Gals Panic DX (Asia) - -static struct BurnRomInfo galpanidxRomDesc[] = { - { "gpdx.u10", 0x100000, 0x8eca883d, 1 | BRF_PRG | BRF_ESS }, // 0 user1 - { "gpdx.u8", 0x100000, 0xb0088d8f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gp4-100-00.u24", 0x200000, 0x1df61f01, 2 | BRF_GRA }, // 2 gfx1 - { "gp4-101-00.u20", 0x100000, 0x8e2c9349, 2 | BRF_GRA }, // 3 - - { "gp4-200-00.u16", 0x200000, 0xf0781376, 3 | BRF_GRA }, // 4 gfx2 - { "gp4-201-00.u18", 0x200000, 0x10c4b183, 3 | BRF_GRA }, // 5 - - { "gp4-300-00.u4", 0x200000, 0x8374663a, 5 | BRF_SND }, // 6 ymz - { "gp4-301-01.u7", 0x200000, 0x886ef77f, 5 | BRF_SND }, // 7 -}; - -STDROMPICKEXT(galpanidx, galpanidx, skns) -STD_ROM_FN(galpanidx) - -static INT32 GalpanidxInit() -{ - sprite_kludge_x = -5; - sprite_kludge_y = -1; - - return DrvInit(2 /*Asia*/); -} - -struct BurnDriver BurnDrvGalpanidx = { - "galpanidx", "galpani4", "skns", NULL, "2001", - "Gals Panic DX (Asia)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpanidxRomInfo, galpanidxRomName, NULL, NULL, CyvernInputInfo, CyvernNoSpeedhackDIPInfo, - GalpanidxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic S - Extra Edition (Europe) - -static struct BurnRomInfo galpanisRomDesc[] = { - { "gps-000-e1.u10", 0x100000, 0xb9ea3c44, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "gps-001-e1.u8", 0x100000, 0xded57bd0, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gps10000.u24", 0x400000, 0xa1a7acf2, 2 | BRF_GRA }, // 2 Sprites - { "gps10100.u20", 0x400000, 0x49f764b6, 2 | BRF_GRA }, // 3 - { "gps10200.u17", 0x400000, 0x51980272, 2 | BRF_GRA }, // 4 - - { "gps20000.u16", 0x400000, 0xc146a09e, 3 | BRF_GRA }, // 5 Background Tiles - { "gps20100.u13", 0x400000, 0x9dfa2dc6, 3 | BRF_GRA }, // 6 - - { "gps30000.u4", 0x400000, 0x9e4da8e3, 5 | BRF_SND }, // 7 YMZ280b Samples -}; - -STDROMPICKEXT(galpanis, galpanis, skns) -STD_ROM_FN(galpanis) - -static INT32 GalpanisInit() -{ - sprite_kludge_x = -5; - sprite_kludge_y = -1; - - return DrvInit(1 /*Europe*/); -} - -struct BurnDriver BurnDrvGalpanis = { - "galpanis", NULL, "skns", NULL, "1997", - "Gals Panic S - Extra Edition (Europe)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpanisRomInfo, galpanisRomName, NULL, NULL, SknsInputInfo, SknsNoSpeedhackDIPInfo, - GalpanisInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic S - Extra Edition (Japan) - -static struct BurnRomInfo galpanisjRomDesc[] = { - { "gps-000-j1.u10", 0x100000, 0xc6938c3f, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "gps-001-j1.u8", 0x100000, 0xe764177a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gps10000.u24", 0x400000, 0xa1a7acf2, 2 | BRF_GRA }, // 2 Sprites - { "gps10100.u20", 0x400000, 0x49f764b6, 2 | BRF_GRA }, // 3 - { "gps10200.u17", 0x400000, 0x51980272, 2 | BRF_GRA }, // 4 - - { "gps20000.u16", 0x400000, 0xc146a09e, 3 | BRF_GRA }, // 5 Background Tiles - { "gps20100.u13", 0x400000, 0x9dfa2dc6, 3 | BRF_GRA }, // 6 - - { "gps30000.u4", 0x400000, 0x9e4da8e3, 5 | BRF_SND }, // 7 YMZ280b Samples -}; - -STDROMPICKEXT(galpanisj, galpanisj, skns) -STD_ROM_FN(galpanisj) - -static INT32 GalpanisjInit() -{ - sprite_kludge_x = -5; - sprite_kludge_y = -1; - - return DrvInit(0 /*Japan*/); -} - -struct BurnDriver BurnDrvGalpanisj = { - "galpanisj", "galpanis", "skns", NULL, "1997", - "Gals Panic S - Extra Edition (Japan)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpanisjRomInfo, galpanisjRomName, NULL, NULL, SknsInputInfo, SknsNoSpeedhackDIPInfo, - GalpanisjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic S - Extra Edition (Korea) - -static struct BurnRomInfo galpaniskRomDesc[] = { - { "gps-000-k1.u10", 0x100000, 0xc9ff3d8a, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "gps-001-k1.u8", 0x100000, 0x354e601d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gps10000.u24", 0x400000, 0xa1a7acf2, 2 | BRF_GRA }, // 2 Sprites - { "gps10100.u20", 0x400000, 0x49f764b6, 2 | BRF_GRA }, // 3 - { "gps10200.u17", 0x400000, 0x51980272, 2 | BRF_GRA }, // 4 - - { "gps20000.u16", 0x400000, 0xc146a09e, 3 | BRF_GRA }, // 5 Background Tiles - { "gps20100.u13", 0x400000, 0x9dfa2dc6, 3 | BRF_GRA }, // 6 - - { "gps30000.u4", 0x400000, 0x9e4da8e3, 5 | BRF_SND }, // 7 YMZ280b Samples -}; - -STDROMPICKEXT(galpanisk, galpanisk, skns) -STD_ROM_FN(galpanisk) - -static INT32 GalpaniskInit() -{ - sprite_kludge_x = -5; - sprite_kludge_y = -1; - - return DrvInit(4 /*Korea*/); -} - -struct BurnDriver BurnDrvGalpanisk = { - "galpanisk", "galpanis", "skns", NULL, "1997", - "Gals Panic S - Extra Edition (Korea)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpaniskRomInfo, galpaniskRomName, NULL, NULL, SknsInputInfo, SknsNoSpeedhackDIPInfo, - GalpaniskInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic S2 (Europe) -// only the 2 program ROMs were dumped, but mask ROMs are supposed to match. - -static struct BurnRomInfo galpans2RomDesc[] = { - { "GPS2E_U6__Ver.3.u6", 0x100000, 0x72fff5d1, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "GPS2E_U4__Ver.3.u4", 0x100000, 0x95061601, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gs210000.u21", 0x400000, 0x294b2f14, 2 | BRF_GRA }, // 2 Sprites - { "gs210100.u20", 0x400000, 0xf75c5a9a, 2 | BRF_GRA }, // 3 - { "gs210200.u8", 0x400000, 0x25b4f56b, 2 | BRF_GRA }, // 4 - { "gs210300.u32", 0x400000, 0xdb6d4424, 2 | BRF_GRA }, // 5 - - { "gs220000.u17", 0x400000, 0x5caae1c0, 3 | BRF_GRA }, // 6 Background Tiles - { "gs220100.u9", 0x400000, 0x8d51f197, 3 | BRF_GRA }, // 7 - - { "gs221000.u3", 0x400000, 0x58800a18, 4 | BRF_GRA }, // 8 Foreground Tiles - - { "gs230000.u1", 0x400000, 0x0348e8e1, 5 | BRF_SND }, // 9 YMZ280b Samples -}; - -STDROMPICKEXT(galpans2, galpans2, skns) -STD_ROM_FN(galpans2) - -static INT32 Galpans2Init() -{ - sprite_kludge_x = -1; - sprite_kludge_y = -1; - - speedhack_address = 0x60fb6bc; - speedhack_pc[0] = 0x4049ae2 + 2; - - return DrvInit(1 /*Europe*/); -} - -struct BurnDriver BurnDrvGalpans2 = { - "galpans2", NULL, "skns", NULL, "1999", - "Gals Panic S2 (Europe)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpans2RomInfo, galpans2RomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //GalpanisInputInfo, GalpanisDIPInfo, - Galpans2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic S2 (Japan) - -static struct BurnRomInfo galpans2jRomDesc[] = { - { "gps2j.u6", 0x100000, 0x6e74005b, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "gps2j.u4", 0x100000, 0x9b4b2304, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gs210000.u21", 0x400000, 0x294b2f14, 2 | BRF_GRA }, // 2 Sprites - { "gs210100.u20", 0x400000, 0xf75c5a9a, 2 | BRF_GRA }, // 3 - { "gs210200.u8", 0x400000, 0x25b4f56b, 2 | BRF_GRA }, // 4 - { "gs210300.u32", 0x400000, 0xdb6d4424, 2 | BRF_GRA }, // 5 - - { "gs220000.u17", 0x400000, 0x5caae1c0, 3 | BRF_GRA }, // 6 Background Tiles - { "gs220100.u9", 0x400000, 0x8d51f197, 3 | BRF_GRA }, // 7 - - { "gs221000.u3", 0x400000, 0x58800a18, 4 | BRF_GRA }, // 8 Foreground Tiles - - { "gs230000.u1", 0x400000, 0x0348e8e1, 5 | BRF_SND }, // 9 YMZ280b Samples -}; - -STDROMPICKEXT(galpans2j, galpans2j, skns) -STD_ROM_FN(galpans2j) - -static INT32 Galpans2jInit() -{ - sprite_kludge_x = -1; - sprite_kludge_y = -1; - - speedhack_address = 0x60fb6bc; - speedhack_pc[0] = 0x4049ae2 + 2; - - return DrvInit(0 /*Japan*/); -} - -struct BurnDriver BurnDrvGalpans2j = { - "galpans2j", "galpans2", "skns", NULL, "1999", - "Gals Panic S2 (Japan)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpans2jRomInfo, galpans2jRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //GalpanisInputInfo, GalpanisDIPInfo, - Galpans2jInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic S2 (Asia) - -static struct BurnRomInfo galpans2aRomDesc[] = { - { "gps2av11.u6", 0x100000, 0x61c05d5f, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "gps2av11.u4", 0x100000, 0x2e8c0ac2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "gs210000.u21", 0x400000, 0x294b2f14, 2 | BRF_GRA }, // 2 Sprites - { "gs210100.u20", 0x400000, 0xf75c5a9a, 2 | BRF_GRA }, // 3 - { "gs210200.u8", 0x400000, 0x25b4f56b, 2 | BRF_GRA }, // 4 - { "gs210300.u32", 0x400000, 0xdb6d4424, 2 | BRF_GRA }, // 5 - - { "gs220000.u17", 0x400000, 0x5caae1c0, 3 | BRF_GRA }, // 6 Background Tiles - { "gs220100.u9", 0x400000, 0x8d51f197, 3 | BRF_GRA }, // 7 - - { "gs221000.u3", 0x400000, 0x58800a18, 4 | BRF_GRA }, // 8 Foreground Tiles - - { "gs230000.u1", 0x400000, 0x0348e8e1, 5 | BRF_SND }, // 9 YMZ280b Samples -}; - -STDROMPICKEXT(galpans2a, galpans2a, skns) -STD_ROM_FN(galpans2a) - -static INT32 Galpans2aInit() -{ - sprite_kludge_x = -1; - sprite_kludge_y = -1; - - speedhack_address = 0x60fb6bc; - speedhack_pc[0] = 0x4049ae2 + 2; - - return DrvInit(2 /*Asia*/); -} - -struct BurnDriver BurnDrvGalpans2a = { - "galpans2a", "galpans2", "skns", NULL, "1999", - "Gals Panic S2 (Asia)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpans2aRomInfo, galpans2aRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //GalpanisInputInfo, GalpanisDIPInfo, - Galpans2aInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic SU (Korea) - -static struct BurnRomInfo galpansuRomDesc[] = { - { "su.u10", 0x100000, 0x5ae66218, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "su.u8", 0x100000, 0x10977a03, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "24", 0x400000, 0x294b2f14, 2 | BRF_GRA }, // 2 Sprites - { "20", 0x400000, 0xf75c5a9a, 2 | BRF_GRA }, // 3 - { "17", 0x400000, 0x25b4f56b, 2 | BRF_GRA }, // 4 - { "32", 0x400000, 0xdb6d4424, 2 | BRF_GRA }, // 5 - - { "16", 0x400000, 0x5caae1c0, 3 | BRF_GRA }, // 6 Background Tiles - { "13", 0x400000, 0x8d51f197, 3 | BRF_GRA }, // 7 - - { "7", 0x400000, 0x58800a18, 4 | BRF_GRA }, // 8 Foreground Tiles - - { "4", 0x400000, 0x0348e8e1, 5 | BRF_SND }, // 9 YMZ280b Samples - -#if !defined (ROM_VERIFY) - { "bios.u10", 0x80000, 0x161fb79e, BRF_BIOS | BRF_OPT}, // 10 Korea Bios -#endif -}; - -STDROMPICKEXT(galpansu, galpansu, skns) -STD_ROM_FN(galpansu) - -static INT32 GalpansuInit() -{ - sprite_kludge_x = -1; - sprite_kludge_y = -1; - - speedhack_address = 0x60fb6bc; - speedhack_pc[0] = 0x4049ae2 + 2; - - return DrvInit(4 /*Korea*/); -} - -struct BurnDriver BurnDrvGalpansu = { - "galpansu", "galpans2", "skns", NULL, "1999", - "Gals Panic SU (Korea)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpansuRomInfo, galpansuRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //GalpanisInputInfo, GalpanisDIPInfo, - GalpansuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Gals Panic S3 (Japan) - -static struct BurnRomInfo galpans3RomDesc[] = { - { "gpss3.u10", 0x100000, 0xc1449a72, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "gpss3.u8", 0x100000, 0x11eb44cf, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u24.bin", 0x800000, 0x70613168, 2 | BRF_GRA }, // 2 Sprites - - { "u16.bin", 0x800000, 0xa96daf2a, 3 | BRF_GRA }, // 3 Background Tiles - - { "u4.bin", 0x400000, 0xbf5736c6, 5 | BRF_SND }, // 4 YMZ280b Samples -}; - -STDROMPICKEXT(galpans3, galpans3, skns) -STD_ROM_FN(galpans3) - -static INT32 Galpans3Init() -{ - sprite_kludge_x = -1; - sprite_kludge_y = -1; - - return DrvInit(0 /*Japan*/); -} - -struct BurnDriver BurnDrvGalpans3 = { - "galpans3", NULL, "skns", NULL, "2002", - "Gals Panic S3 (Japan)\0", NULL, "Kaneko", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, galpans3RomInfo, galpans3RomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //GalpanisInputInfo, GalpanisDIPInfo, - Galpans3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Jan Jan Paradise - -static struct BurnRomInfo jjparadsRomDesc[] = { - { "jp1j1.u10", 0x080000, 0xde2fb669, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "jp1j1.u8", 0x080000, 0x7276efb1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jp100-00.u24", 0x400000, 0xf31b2e95, 2 | BRF_GRA }, // 2 Sprites - { "jp101-00.u20", 0x400000, 0x70cc8c24, 2 | BRF_GRA }, // 3 - { "jp102-00.u17", 0x400000, 0x35401c1e, 2 | BRF_GRA }, // 4 - - { "jp200-00.u16", 0x200000, 0x493d63db, 3 | BRF_GRA }, // 5 Background Tiles - - { "jp300-00.u4", 0x200000, 0x7023fe46, 5 | BRF_SND }, // 6 YMZ280b Samples -}; - -STDROMPICKEXT(jjparads, jjparads, skns) -STD_ROM_FN(jjparads) - -static INT32 JjparadsInit() -{ - sprite_kludge_x = 5; - sprite_kludge_y = 1; - -// speedhack_address = 0x6000994; -// speedhack_pc[0] = 0x4015e84 + 2; - - return DrvInit(0 /*Japan*/); -} - -struct BurnDriver BurnDrvJjparads = { - "jjparads", NULL, "skns", NULL, "1996", - "Jan Jan Paradise\0", NULL, "Electro Design", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO_SKNS, GBF_MAHJONG, 0, - NULL, jjparadsRomInfo, jjparadsRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //Skns_1pInputInfo, Skns_1pDIPInfo, - JjparadsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Jan Jan Paradise 2 - -static struct BurnRomInfo jjparad2RomDesc[] = { - { "jp2000j1.u6", 0x080000, 0x5d75e765, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "jp2001j1.u4", 0x080000, 0x1771910a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "jp210000.u21", 0x400000, 0x79a7e3d7, 2 | BRF_GRA }, // 2 Sprites - { "jp210100.u20", 0x400000, 0x42415e0c, 2 | BRF_GRA }, // 3 - { "jp210200.u8", 0x400000, 0x26731745, 2 | BRF_GRA }, // 4 - - { "jp220000.u17", 0x400000, 0xd0e71873, 3 | BRF_GRA }, // 5 Background Tiles - { "jp220100.u9", 0x400000, 0x4c7d964d, 3 | BRF_GRA }, // 6 - - { "jp230000.u1", 0x400000, 0x73e30d7f, 5 | BRF_SND }, // 7 YMZ280b Samples -}; - -STDROMPICKEXT(jjparad2, jjparad2, skns) -STD_ROM_FN(jjparad2) - -static INT32 Jjparad2Init() -{ - sprite_kludge_x = 5; - sprite_kludge_y = 1; - -// speedhack_address = 0x6000994; -// speedhack_pc[0] = 0x401620a + 2; - - return DrvInit(0 /*Japan*/); -} - -struct BurnDriver BurnDrvJjparad2 = { - "jjparad2", NULL, "skns", NULL, "1997", - "Jan Jan Paradise 2\0", NULL, "Electro Design", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO_SKNS, GBF_MAHJONG, 0, - NULL, jjparad2RomInfo, jjparad2RomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //Skns_1pInputInfo, Skns_1pDIPInfo, - Jjparad2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Sen-Know (Japan) - -static struct BurnRomInfo senknowRomDesc[] = { - { "snw000j1.u6", 0x080000, 0x0d6136f6, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "snw001j1.u4", 0x080000, 0x4a10ec3d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "snw10000.u21", 0x400000, 0x5133c69c, 2 | BRF_GRA }, // 2 Sprites - { "snw10100.u20", 0x400000, 0x9dafe03f, 2 | BRF_GRA }, // 3 - - { "snw20000.u17", 0x400000, 0xd5fe5f8c, 3 | BRF_GRA }, // 4 Background Tiles - { "snw20100.u9", 0x400000, 0xc0037846, 3 | BRF_GRA }, // 5 - - { "snw21000.u3", 0x400000, 0xf5c23e79, 4 | BRF_GRA }, // 6 Foreground Tiles - - { "snw30000.u1", 0x400000, 0xec9eef40, 5 | BRF_SND }, // 7 YMZ280b Samples -}; - -STDROMPICKEXT(senknow, senknow, skns) -STD_ROM_FN(senknow) - -static INT32 SenknowInit() -{ - sprite_kludge_x = 1; - sprite_kludge_y = 1; - - speedhack_address = 0x60000dc; - speedhack_pc[0] = 0x4017dce + 2; - - return DrvInit(0 /*Japan*/); -} - -struct BurnDriver BurnDrvSenknow = { - "senknow", NULL, "skns", NULL, "1999", - "Sen-Know (Japan)\0", NULL, "Kaneko / Kouyousha", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_PUZZLE, 0, - NULL, senknowRomInfo, senknowRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //SknsInputInfo, SknsDIPInfo, - SenknowInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// VS Mahjong Otome Ryouran - -static struct BurnRomInfo ryouranRomDesc[] = { - { "or-000-j2.u10", 0x080000, 0xcba8ca4e, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "or-001-j2.u8", 0x080000, 0x8e79c6b7, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "or100-00.u24", 0x400000, 0xe9c7695b, 2 | BRF_GRA }, // 2 Sprites - { "or101-00.u20", 0x400000, 0xfe06bf12, 2 | BRF_GRA }, // 3 - { "or102-00.u17", 0x400000, 0xf2a5237b, 2 | BRF_GRA }, // 4 - - { "or200-00.u16", 0x400000, 0x4c4701a8, 3 | BRF_GRA }, // 5 Background Tiles - { "or201-00.u13", 0x400000, 0xa94064aa, 3 | BRF_GRA }, // 6 - - { "or300-00.u4", 0x400000, 0xa3f64b79, 5 | BRF_SND }, // 7 YMZ280b Samples -}; - -STDROMPICKEXT(ryouran, ryouran, skns) -STD_ROM_FN(ryouran) - -static INT32 RyouranInit() -{ - sprite_kludge_x = 5; - sprite_kludge_y = 1; - - speedhack_address = 0x6000a14; - speedhack_pc[0] = 0x40182ce + 2; - - return DrvInit(0 /*Japan*/); -} - -struct BurnDriver BurnDrvRyouran = { - "ryouran", NULL, "skns", NULL, "1998", - "VS Mahjong Otome Ryouran\0", NULL, "Electro Design", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_KANEKO_SKNS, GBF_MAHJONG, 0, - NULL, ryouranRomInfo, ryouranRomName, NULL, NULL, SknsInputInfo, SknsDIPInfo, //Skns_1pInputInfo, Skns_1pDIPInfo, - RyouranInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// VS Block Breaker (Europe) - -static struct BurnRomInfo vblokbrkRomDesc[] = { - { "sk000e2-e.u10", 0x080000, 0x5a278f10, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "sk000e-o.u8", 0x080000, 0xaecf0647, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sk-100-00.u24", 0x200000, 0x151dd88a, 2 | BRF_GRA }, // 2 Sprites - { "sk-101.u20", 0x100000, 0x779cce23, 2 | BRF_GRA }, // 3 - - { "sk-200-00.u16", 0x200000, 0x2e297c61, 3 | BRF_GRA }, // 4 Background Tiles - - { "sk-300-00.u4", 0x200000, 0xe6535c05, 5 | BRF_SND }, // 5 YMZ280b Samples -}; - -STDROMPICKEXT(vblokbrk, vblokbrk, skns) -STD_ROM_FN(vblokbrk) - -static INT32 VblokbrkInit() -{ - sprite_kludge_x = -1; - sprite_kludge_y = -1; - suprnova_alt_enable_background = 1; - Vblokbrk = 1; - sixtyhz = 1; - - return DrvInit(1 /*Europe*/); -} - -struct BurnDriver BurnDrvVblokbrk = { - "vblokbrk", NULL, "skns", NULL, "1997", - "VS Block Breaker (Europe)\0", NULL, "Kaneko / Mediaworks", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_BALLPADDLE, 0, - NULL, vblokbrkRomInfo, vblokbrkRomName, NULL, NULL, VblokbrkInputInfo, VblokbrkDIPInfo, - VblokbrkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// VS Block Breaker (Asia) - -static struct BurnRomInfo vblokbrkaRomDesc[] = { - { "sk01a.u10", 0x080000, 0x4d1be53e, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "sk01a.u8", 0x080000, 0x461e0197, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sk-100-00.u24", 0x200000, 0x151dd88a, 2 | BRF_GRA }, // 2 Sprites - { "sk-101.u20", 0x100000, 0x779cce23, 2 | BRF_GRA }, // 3 - - { "sk-200-00.u16", 0x200000, 0x2e297c61, 3 | BRF_GRA }, // 4 Background Tiles - - { "sk-300-00.u4", 0x200000, 0xe6535c05, 5 | BRF_SND }, // 5 YMZ280b Samples -}; - -STDROMPICKEXT(vblokbrka, vblokbrka, skns) -STD_ROM_FN(vblokbrka) - -static INT32 VblokbrkaInit() -{ - sprite_kludge_x = -1; - sprite_kludge_y = -1; - suprnova_alt_enable_background = 1; - Vblokbrk = 1; - sixtyhz = 1; - - return DrvInit(2 /*Asia*/); -} - -struct BurnDriver BurnDrvVblokbrka = { - "vblokbrka", "vblokbrk", "skns", NULL, "1997", - "VS Block Breaker (Asia)\0", NULL, "Kaneko / Mediaworks", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_BALLPADDLE, 0, - NULL, vblokbrkaRomInfo, vblokbrkaRomName, NULL, NULL, VblokbrkInputInfo, VblokbrkDIPInfo, - VblokbrkaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; - - -// Saru-Kani-Hamu-Zou (Japan) - -static struct BurnRomInfo sarukaniRomDesc[] = { - { "sk1j1.u10", 0x080000, 0xfcc131b6, 1 | BRF_PRG | BRF_ESS }, // 0 SH2 Code - { "sk1j1.u8", 0x080000, 0x3b6aa343, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "sk-100-00.u24", 0x200000, 0x151dd88a, 2 | BRF_GRA }, // 2 Sprites - { "sk-101.u20", 0x100000, 0x779cce23, 2 | BRF_GRA }, // 3 - - { "sk-200-00.u16", 0x200000, 0x2e297c61, 3 | BRF_GRA }, // 4 Background Tiles - - { "sk-300-00.u4", 0x200000, 0xe6535c05, 5 | BRF_SND }, // 5 YMZ280b Samples -}; - -STDROMPICKEXT(sarukani, sarukani, skns) -STD_ROM_FN(sarukani) - -static INT32 SarukaniInit() -{ - sprite_kludge_x = -1; - sprite_kludge_y = -1; - suprnova_alt_enable_background = 1; - Vblokbrk = 1; - sixtyhz = 1; - - return DrvInit(0 /*Japan*/); -} - -struct BurnDriver BurnDrvSarukani = { - "sarukani", "vblokbrk", "skns", NULL, "1997", - "Saru-Kani-Hamu-Zou (Japan)\0", NULL, "Kaneko / Mediaworks", "Super Kaneko Nova System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_KANEKO_SKNS, GBF_BALLPADDLE, 0, - NULL, sarukaniRomInfo, sarukaniRomName, NULL, NULL, VblokbrkInputInfo, VblokbrkDIPInfo, - SarukaniInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x8000, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_taotaido.cpp b/jan/src/burn/drv/pst90s/d_taotaido.cpp deleted file mode 100644 index 7159931e6..000000000 --- a/jan/src/burn/drv/pst90s/d_taotaido.cpp +++ /dev/null @@ -1,1030 +0,0 @@ -// FB Alpha "Tao Taido" driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2610.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvSpr0Buf0; -static UINT8 *DrvSpr1Buf0; -static UINT8 *DrvSpr0Buf1; -static UINT8 *DrvSpr1Buf1; -static UINT8 *DrvScrollRAM; -static UINT8 *taotaido_tileregs; -static UINT8 *taotaido_spritebank; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDip[4]; -static UINT16 DrvInps[5]; -static UINT8 DrvReset; - -static UINT8 *nDrvZ80Bank; -static UINT8 *pending_command; -static UINT8 *soundlatch; - -static INT32 nCyclesTotal[2]; - -static struct BurnInputInfo TaotaidoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 5, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip" }, - {"Region", BIT_DIPSWITCH, DrvDip + 3, "dip" }, -}; - -STDINPUTINFO(Taotaido) - -static struct BurnInputInfo TaotaidoaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Weak Punch", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Medium Punch", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Strong Punch", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - {"P1 Weak Kick", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 4" }, - {"P1 Medium Kick", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 5" }, - {"P1 Strong Kick", BIT_DIGITAL, DrvJoy4 + 2, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Weak Punch", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Medium Punch", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Strong Punch", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - {"P2 Weak Kick", BIT_DIGITAL, DrvJoy5 + 0, "p2 fire 4" }, - {"P2 Medium Kick", BIT_DIGITAL, DrvJoy5 + 1, "p2 fire 5" }, - {"P2 Strong Kick", BIT_DIGITAL, DrvJoy5 + 2, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 6, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 5, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDip + 2, "dip" }, - {"Region", BIT_DIPSWITCH, DrvDip + 3, "dip" }, -}; - -STDINPUTINFO(Taotaidoa) - -static struct BurnDIPInfo TaotaidoDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - {0x18, 0xff, 0xff, 0x08, NULL }, - - {0 , 0xfe, 0 , 2, "Coin Slot" }, - {0x15, 0x01, 0x01, 0x01, "Same" }, - {0x15, 0x01, 0x01, 0x00, "Individual" }, - - // Coinage condition: Coin Slot Individual - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x15, 0x02, 0x0e, 0x0a, "3 Coins 1 Credit" }, - {0x15, 0x00, 0x01, 0x00, NULL}, - {0x15, 0x02, 0x0e, 0x0c, "2 Coins 1 Credit" }, - {0x15, 0x00, 0x01, 0x00, NULL}, - {0x15, 0x02, 0x0e, 0x0e, "1 Coin 1 Credit" }, - {0x15, 0x00, 0x01, 0x00, NULL}, - {0x15, 0x02, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x15, 0x00, 0x01, 0x00, NULL}, - {0x15, 0x02, 0x0e, 0x06, "1 Coin 3 Credits" }, - {0x15, 0x00, 0x01, 0x00, NULL}, - {0x15, 0x02, 0x0e, 0x04, "1 Coin 4 Credits" }, - {0x15, 0x00, 0x01, 0x00, NULL}, - {0x15, 0x02, 0x0e, 0x02, "1 Coin 5 Credits" }, - {0x15, 0x00, 0x01, 0x00, NULL}, - {0x15, 0x02, 0x0e, 0x00, "1 Coin 6 Credits" }, - {0x15, 0x00, 0x01, 0x00, NULL}, - - // Coin 1 condition: Coin Slot Same - {0 , 0xfe, 0 , 8, "Coin 1" }, - {0x15, 0x02, 0x0e, 0x0a, "3 Coins 1 Credit" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x0e, 0x0c, "2 Coins 1 Credit" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x0e, 0x0e, "1 Coin 1 Credit" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x0e, 0x06, "1 Coin 3 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x0e, 0x04, "1 Coin 4 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x0e, 0x02, "1 Coin 5 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x0e, 0x00, "1 Coin 6 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - - // Coin 2 condition: Coin Slot Same - {0 , 0xfe, 0 , 8, "Coin 2" }, - {0x15, 0x02, 0x70, 0x50, "3 Coins 1 Credit" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x70, 0x40, "1 Coin 2 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x70, 0x30, "1 Coin 3 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x70, 0x20, "1 Coin 4 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x70, 0x10, "1 Coin 5 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x70, 0x00, "1 Coin 6 Credits" }, - {0x15, 0x00, 0x01, 0x01, NULL}, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x16, 0x01, 0x01, 0x01, "Off" }, -// {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x02, 0x00, "Off" }, - {0x16, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x18, 0x10, "Easy" }, - {0x16, 0x01, 0x18, 0x18, "Normal" }, - {0x16, 0x01, 0x18, 0x08, "Hard" }, - {0x16, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Join In (1 Credit)" }, - {0x17, 0x01, 0x01, 0x00, "Off" }, - {0x17, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Buy In" }, - {0x17, 0x01, 0x02, 0x00, "No" }, - {0x17, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 5, "Country" }, - {0x18, 0x01, 0x0f, 0x00, "US" }, - {0x18, 0x01, 0x0f, 0x01, "Japan" }, - {0x18, 0x01, 0x0f, 0x02, "Hong-Kong/Taiwan" }, - {0x18, 0x01, 0x0f, 0x04, "Korea" }, - {0x18, 0x01, 0x0f, 0x08, "World" }, -}; - -STDDIPINFO(Taotaido) - -static struct BurnDIPInfo TaotaidoaDIPList[]= -{ - // Default Values - {0x1b, 0xff, 0xff, 0xff, NULL }, - {0x1c, 0xff, 0xff, 0xff, NULL }, - {0x1d, 0xff, 0xff, 0xff, NULL }, - {0x1e, 0xff, 0xff, 0x08, NULL }, - - {0 , 0xfe, 0 , 2, "Coin Slot" }, - {0x1b, 0x01, 0x01, 0x01, "Same" }, - {0x1b, 0x01, 0x01, 0x00, "Individual" }, - - // Coinage condition: Coin Slot Individual - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x1b, 0x02, 0x0e, 0x0a, "3 Coins 1 Credit" }, - {0x1b, 0x00, 0x01, 0x00, NULL}, - {0x1b, 0x02, 0x0e, 0x0c, "2 Coins 1 Credit" }, - {0x1b, 0x00, 0x01, 0x00, NULL}, - {0x1b, 0x02, 0x0e, 0x0e, "1 Coin 1 Credit" }, - {0x1b, 0x00, 0x01, 0x00, NULL}, - {0x1b, 0x02, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x1b, 0x00, 0x01, 0x00, NULL}, - {0x1b, 0x02, 0x0e, 0x06, "1 Coin 3 Credits" }, - {0x1b, 0x00, 0x01, 0x00, NULL}, - {0x1b, 0x02, 0x0e, 0x04, "1 Coin 4 Credits" }, - {0x1b, 0x00, 0x01, 0x00, NULL}, - {0x1b, 0x02, 0x0e, 0x02, "1 Coin 5 Credits" }, - {0x1b, 0x00, 0x01, 0x00, NULL}, - {0x1b, 0x02, 0x0e, 0x00, "1 Coin 6 Credits" }, - {0x1b, 0x00, 0x01, 0x00, NULL}, - - // Coin 1 condition: Coin Slot Same - {0 , 0xfe, 0 , 8, "Coin 1" }, - {0x1b, 0x02, 0x0e, 0x0a, "3 Coins 1 Credit" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x0e, 0x0c, "2 Coins 1 Credit" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x0e, 0x0e, "1 Coin 1 Credit" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x0e, 0x08, "1 Coin 2 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x0e, 0x06, "1 Coin 3 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x0e, 0x04, "1 Coin 4 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x0e, 0x02, "1 Coin 5 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x0e, 0x00, "1 Coin 6 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - - // Coin 2 condition: Coin Slot Same - {0 , 0xfe, 0 , 8, "Coin 2" }, - {0x1b, 0x02, 0x70, 0x50, "3 Coins 1 Credit" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x70, 0x40, "1 Coin 2 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x70, 0x30, "1 Coin 3 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x70, 0x20, "1 Coin 4 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x70, 0x10, "1 Coin 5 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - {0x1b, 0x02, 0x70, 0x00, "1 Coin 6 Credits" }, - {0x1b, 0x00, 0x01, 0x01, NULL}, - - {0 , 0xfe, 0 , 2, "2 Coins to Start, 1 to Continue" }, - {0x1b, 0x01, 0x80, 0x80, "Off" }, - {0x1b, 0x01, 0x80, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x1c, 0x01, 0x01, 0x01, "Off" }, -// {0x1c, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x1c, 0x01, 0x02, 0x00, "Off" }, - {0x1c, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x1c, 0x01, 0x04, 0x04, "Off" }, - {0x1c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x1c, 0x01, 0x18, 0x10, "Easy" }, - {0x1c, 0x01, 0x18, 0x18, "Normal" }, - {0x1c, 0x01, 0x18, 0x08, "Hard" }, - {0x1c, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1c, 0x01, 0x20, 0x20, "Off" }, - {0x1c, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Join In (1 Credit)" }, - {0x1d, 0x01, 0x01, 0x01, "Off" }, - {0x1d, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Buy In" }, - {0x1d, 0x01, 0x02, 0x00, "No" }, - {0x1d, 0x01, 0x02, 0x02, "Yes" }, - - {0 , 0xfe, 0 , 5, "Country" }, - {0x1e, 0x01, 0x0f, 0x00, "US" }, - {0x1e, 0x01, 0x0f, 0x01, "Japan" }, - {0x1e, 0x01, 0x0f, 0x02, "Hong-Kong/Taiwan" }, - {0x1e, 0x01, 0x0f, 0x04, "Korea" }, - {0x1e, 0x01, 0x0f, 0x08, "World" }, -}; - -STDDIPINFO(Taotaidoa) - -static void palette_write(INT32 offset) -{ - UINT8 r, g, b; - UINT16 data = *((UINT16*)(DrvPalRAM + offset)); - - r = (data >> 10) & 0x1f; - r = (r << 3) | (r >> 2); - g = (data >> 5) & 0x1f; - g = (g << 3) | (g >> 2); - b = (data >> 0) & 0x1f; - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r, g, b, 0); -} - -UINT8 __fastcall taotaido_read_byte(UINT32 address) -{ - if (address < 0xffff00) return 0; - - switch (address) - { - case 0xffff80: - case 0xffff81: - return DrvInps[0] >> ((~address & 1) << 3); - - case 0xffff82: - case 0xffff83: - return DrvInps[1] >> ((~address & 1) << 3); - - case 0xffff84: - case 0xffff85: - return DrvInps[2] >> ((~address & 1) << 3); - - case 0xffff87: - return DrvDip[0]; - - case 0xffff89: - return DrvDip[1]; - - case 0xffff8b: - return DrvDip[2]; - - case 0xffff8f: - return DrvDip[3]; - - case 0xffffa0: // p3 - case 0xffffa1: - return DrvInps[3] >> ((~address & 1) << 3); - - case 0xffffa2: // p4 - case 0xffffa3: - return DrvInps[4] >> ((~address & 1) << 3); - - case 0xffffe1: - return *pending_command; - } - - return 0; -} - -UINT16 __fastcall taotaido_read_word(UINT32 address) -{ - if (address < 0xffff00) return 0; - - switch (address) - { - case 0xffff80: - return DrvInps[0]; - - case 0xffff82: - return DrvInps[1]; - - case 0xffff84: - return DrvInps[2]; - - case 0xffffa0: // p3 - return DrvInps[3]; - - case 0xffffa2: // p4 - return DrvInps[4]; - } - - return 0; -} - -void __fastcall taotaido_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0xffc000) { - DrvPalRAM[(address & 0xfff) ^ 1] = data; - palette_write(address & 0xffe); - return; - } - - if (address < 0xffff00) return; - - switch (address) - { - case 0xffff08: - case 0xffff09: - case 0xffff0a: - case 0xffff0b: - case 0xffff0c: - case 0xffff0d: - case 0xffff0e: - case 0xffff0f: - taotaido_tileregs[address & 0x07] = data; - return; - - case 0xffff40: - case 0xffff41: - case 0xffff42: - case 0xffff43: - case 0xffff44: - case 0xffff45: - case 0xffff46: - case 0xffff47: - taotaido_spritebank[address & 7] = data; - return; - - case 0xffffc1: - { - INT32 nCycles = ((INT64)SekTotalCycles() * nCyclesTotal[1] / nCyclesTotal[0]); - if (nCycles <= ZetTotalCycles()) return; - - BurnTimerUpdate(nCycles); - - *pending_command = 1; - *soundlatch = data; - ZetNmi(); - } - return; - } -} - -void __fastcall taotaido_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0xffc000) { - *((UINT16*)(DrvPalRAM + (address & 0xffe))) = data; - palette_write(address & 0xffe); - return; - } - - if (address < 0xffff00) return; - - switch (address) - { - case 0xffff08: - case 0xffff0a: - case 0xffff0c: - case 0xffff0e: - *((UINT16*)(taotaido_tileregs + (address & 0x06))) = data; - return; - - case 0xffff40: - case 0xffff42: - case 0xffff44: - case 0xffff46: - *((UINT16*)(taotaido_spritebank + (address & 6))) = data; - return; - } -} - -static void taotaido_sound_bankswitch(INT32 data) -{ - *nDrvZ80Bank = data & 3; - - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + 0x8000 * *nDrvZ80Bank); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + 0x8000 * *nDrvZ80Bank); -} - -void __fastcall taotaido_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - BurnYM2610Write(port & 3, data); - return; - - case 0x04: - if (*nDrvZ80Bank != (data & 3)) { - taotaido_sound_bankswitch(data); - } - return; - - case 0x08: - *pending_command = 0; - return; - } -} - -UINT8 __fastcall taotaido_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return BurnYM2610Read(0); - - - case 0x02: - return BurnYM2610Read(2); - - case 0x0c: - return *soundlatch; - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[ 4] = { - 0x000, 0x001, 0x002, 0x003 - }; - - INT32 XOffs[16] = { - 0x004, 0x000, 0x00c, 0x008, 0x014, 0x010, 0x01c, 0x018, - 0x024, 0x020, 0x02c, 0x028, 0x034, 0x030, 0x03c, 0x038 - }; - - INT32 YOffs[16] = { - 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, - 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0 - }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x600000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x600000); - - GfxDecode(0xc000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane, XOffs, YOffs, 0x400, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - taotaido_sound_bankswitch(1); - ZetClose(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0xc00000; - DrvGfxROM1 = Next; Next += 0x400000; - - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x200000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x001000; - DrvBgRAM = Next; Next += 0x004000; - DrvSprRAM0 = Next; Next += 0x002000; - DrvSprRAM1 = Next; Next += 0x010000; - DrvScrollRAM = Next; Next += 0x000400; - DrvSpr0Buf0 = Next; Next += 0x002000; - DrvSpr1Buf0 = Next; Next += 0x010000; - DrvSpr0Buf1 = Next; Next += 0x002000; - DrvSpr1Buf1 = Next; Next += 0x010000; - - taotaido_tileregs = Next; Next += 0x000010; - taotaido_spritebank = Next; Next += 0x000010; - - pending_command = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - nDrvZ80Bank = Next; Next += 0x000001; - - DrvZ80RAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void taotaidoFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 taotaidoSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 5000000; -} - -static double taotaidoGetTime() -{ - return (double)ZetTotalCycles() / 5000000.0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 1)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x400000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x000000, 8, 1)) return 1; - - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvBgRAM, 0x800000, 0x803fff, MAP_RAM); - SekMapMemory(DrvSprRAM0, 0xa00000, 0xa01fff, MAP_RAM); - SekMapMemory(DrvSprRAM1, 0xc00000, 0xc0ffff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xfe0000, 0xfeffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xffc000, 0xffcfff, MAP_ROM); - SekMapMemory(DrvScrollRAM, 0xffe000, 0xffe3ff, MAP_RAM); - SekSetWriteByteHandler(0, taotaido_write_byte); - SekSetWriteWordHandler(0, taotaido_write_word); - SekSetReadByteHandler(0, taotaido_read_byte); - SekSetReadWordHandler(0, taotaido_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x77ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x77ff, 2, DrvZ80ROM); - ZetMapArea(0x7800, 0x7fff, 0, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 1, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 2, DrvZ80RAM); - ZetSetInHandler(taotaido_sound_in); - ZetSetOutHandler(taotaido_sound_out); - ZetClose(); - - INT32 nDrvSndROM0Size = 0x100000; - INT32 nDrvSndROM1Size = 0x200000; - BurnYM2610Init(8000000, DrvSndROM1, &nDrvSndROM1Size, DrvSndROM0, &nDrvSndROM0Size, &taotaidoFMIRQHandler, taotaidoSynchroniseStream, taotaidoGetTime, 0); - BurnTimerAttachZet(5000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2610Exit(); - - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - UINT16 *vram = (UINT16*)DrvBgRAM; - UINT16 *scroll = (UINT16*)DrvScrollRAM; - - for (INT32 line = 0; line < 224; line++) - { - INT32 scrolly = ((scroll[(line << 1) | 1] >> 4) + 0) & 0x3ff; - INT32 scrollx = ((scroll[(line << 1) | 0] >> 4) + 30) & 0x7ff; - - INT32 sy = scrolly >> 4; - - for (INT32 col = 0; col < (320 / 16) + 1; col++) - { - INT32 sx = (scrollx >> 4) + col; - INT32 ofst = (sy << 6) + (sx & 0x3f) + ((sx & 0x40) << 6); - - INT32 code = vram[ofst]; - INT32 bank = (code >> 9) & 7; - INT32 color = ((code >> 12) << 4) | 0x300; - - code = (code & 0x1ff) | (taotaido_tileregs[bank] << 9); - - UINT8 *src = DrvGfxROM1 + (code << 8) + ((scrolly & 0x0f) << 4); - - for (INT32 x = 0; x < 16; x++) { - INT32 xx = (x + (col << 4)) - (scrollx & 0x0f); - if (xx < 0 || xx >= nScreenWidth) continue; - pTransDraw[(line * nScreenWidth) + xx] = src[x] | color; - } - } - } -} - -static void draw_sprite(INT32 spriteno) -{ - UINT16 *source = (UINT16*)DrvSpr0Buf1; - UINT16 *source1 = (UINT16*)DrvSpr1Buf1; - source += spriteno*4; - - INT32 yzoom = (source[0] & 0xf000) >> 12; - INT32 xzoom = (source[1] & 0xf000) >> 12; - - INT32 ysize = (source[0] & 0x0e00) >> 9; - INT32 xsize = (source[1] & 0x0e00) >> 9; - - INT32 ypos = source[0] & 0x01ff; - INT32 xpos = source[1] & 0x01ff; - - INT32 yflip = source[2] & 0x8000; - INT32 xflip = source[2] & 0x4000; - INT32 color = (source[2] & 0x1f00) >> 8; - - INT32 tile = source[3] & 0xffff; - - xpos += (xsize*xzoom+2)/4; - ypos += (ysize*yzoom+2)/4; - - xzoom = 32 - xzoom; - yzoom = 32 - yzoom; - - for (INT32 y = 0;y <= ysize;y++) - { - INT32 sx,sy; - - if (yflip) sy = ((ypos + yzoom * (ysize - y)/2 + 16) & 0x1ff) - 16; - else sy = ((ypos + yzoom * y / 2 + 16) & 0x1ff) - 16; - - for (INT32 x = 0;x <= xsize;x++) - { - INT32 realtile = source1[tile & 0x7fff]; - - if (realtile > 0x3fff) - { - INT32 block; - - block = (realtile & 0x3800)>>11; - - realtile &= 0x07ff; - realtile |= taotaido_spritebank[block] * 0x800; - } - - if (xflip) sx = ((xpos + xzoom * (xsize - x) / 2 + 16) & 0x1ff) - 16; - else sx = ((xpos + xzoom * x / 2 + 16) & 0x1ff) - 16; - - if (yflip) { - if (xflip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, realtile, sx, sy, color, 4, 15, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, realtile, sx, sy, color, 4, 15, 0, DrvGfxROM0); - } - } else { - if (xflip) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, realtile, sx, sy, color, 4, 15, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, realtile, sx, sy, color, 4, 15, 0, DrvGfxROM0); - } - } - - tile++; - } - } -} - -static void draw_sprites() -{ - UINT16 *source = (UINT16*)DrvSpr0Buf1; - UINT16 *finish = source + 0x2000/2; - - while (source < finish) - { - if (source[0] == 0x4000) break; - - draw_sprite(source[0] & 0x3ff); - - source++; - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_write(i); - } - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (DrvInps, 0xff, 5 * sizeof(UINT16)); - for (INT32 i = 0; i < 8; i++) { - DrvInps[0] ^= (DrvJoy1[i] & 1) << i; - DrvInps[1] ^= (DrvJoy2[i] & 1) << i; - DrvInps[2] ^= (DrvJoy3[i] & 1) << i; - DrvInps[3] ^= (DrvJoy4[i] & 1) << i; - DrvInps[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)(5000000.0 / 60.0); - - SekOpen(0); - ZetOpen(0); - - SekRun(nCyclesTotal[0]); - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrame(nCyclesTotal[1]); - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSpr0Buf1, DrvSpr0Buf0, 0x02000); - memcpy (DrvSpr1Buf1, DrvSpr1Buf0, 0x10000); - memcpy (DrvSpr0Buf0, DrvSprRAM0, 0x02000); - memcpy (DrvSpr1Buf0, DrvSprRAM1, 0x10000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - } - - ZetOpen(0); - taotaido_sound_bankswitch(*nDrvZ80Bank); - ZetClose(); - - return 0; -} - - -// Tao Taido (set 1) - -static struct BurnRomInfo taotaidoRomDesc[] = { - { "1-u90.bin", 0x080000, 0xa3ee30da, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2-u91.bin", 0x080000, 0x30b7e4fb, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "3-u113.bin", 0x020000, 0xa167c4e4, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "u86.bin", 0x200000, 0x908e251e, 3 | BRF_GRA }, // 3 Sprites - { "u87.bin", 0x200000, 0xc4290ba6, 3 | BRF_GRA }, // 4 - { "u88.bin", 0x200000, 0x407d9aeb, 3 | BRF_GRA }, // 5 - - { "u15.bin", 0x200000, 0xe95823e9, 4 | BRF_GRA }, // 6 Background Tiles - - { "u104.bin", 0x100000, 0xe89387a9, 5 | BRF_SND }, // 7 Samples - { "u127.bin", 0x200000, 0x0cf0cb23, 6 | BRF_SND }, // 8 -}; - -STD_ROM_PICK(taotaido) -STD_ROM_FN(taotaido) - -struct BurnDriver BurnDrvTaotaido = { - "taotaido", NULL, NULL, NULL, "1993", - "Tao Taido (set 1)\0", NULL, "Video System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, taotaidoRomInfo, taotaidoRomName, NULL, NULL, TaotaidoInputInfo, TaotaidoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; - - -// Tao Taido (set 2) - -static struct BurnRomInfo taotaidoaRomDesc[] = { - { "tt0-u90.bin", 0x080000, 0x69d4cca7, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tt1-u91.bin", 0x080000, 0x41025469, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "3-u113.bin", 0x020000, 0xa167c4e4, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "u86.bin", 0x200000, 0x908e251e, 3 | BRF_GRA }, // 3 Sprites - { "u87.bin", 0x200000, 0xc4290ba6, 3 | BRF_GRA }, // 4 - { "u88.bin", 0x200000, 0x407d9aeb, 3 | BRF_GRA }, // 5 - - { "u15.bin", 0x200000, 0xe95823e9, 4 | BRF_GRA }, // 6 Background Tiles - - { "u104.bin", 0x100000, 0xe89387a9, 5 | BRF_SND }, // 7 Samples - { "u127.bin", 0x200000, 0x0cf0cb23, 6 | BRF_SND }, // 8 -}; - -STD_ROM_PICK(taotaidoa) -STD_ROM_FN(taotaidoa) - -struct BurnDriver BurnDrvTaotaidoa = { - "taotaidoa", "taotaido", NULL, NULL, "1993", - "Tao Taido (set 2)\0", NULL, "Video System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, taotaidoaRomInfo, taotaidoaRomName, NULL, NULL, TaotaidoaInputInfo, TaotaidoaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_tecmo16.cpp b/jan/src/burn/drv/pst90s/d_tecmo16.cpp deleted file mode 100644 index b9edf41ab..000000000 --- a/jan/src/burn/drv/pst90s/d_tecmo16.cpp +++ /dev/null @@ -1,1354 +0,0 @@ -// FB Alpha Tecmo 16-bit driver module -// Based on MAME driver by Hau, Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" -#include "burn_ym2151.h" - -static UINT8 FstarfrcInputPort0[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 FstarfrcInputPort1[6] = {0, 0, 0, 0, 0, 0}; -static UINT8 FstarfrcDip[2] = {0, 0}; -static UINT16 FstarfrcInput[2] = {0x00, 0x00}; -static UINT8 FstarfrcReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *FstarfrcRom = NULL; -static UINT8 *FstarfrcZ80Rom = NULL; -static UINT8 *FstarfrcRam = NULL; -static UINT8 *FstarfrcCharRam = NULL; -static UINT8 *FstarfrcVideoRam = NULL; -static UINT8 *FstarfrcColourRam = NULL; -static UINT8 *FstarfrcVideo2Ram = NULL; -static UINT8 *FstarfrcColour2Ram = NULL; -static UINT8 *FstarfrcSpriteRam = NULL; -static UINT8 *FstarfrcPaletteRam = NULL; -static UINT8 *FstarfrcZ80Ram = NULL; -static UINT32 *FstarfrcPalette = NULL; -static UINT8 *FstarfrcCharTiles = NULL; -static UINT8 *FstarfrcLayerTiles = NULL; -static UINT8 *FstarfrcSpriteTiles = NULL; -static UINT8 *FstarfrcTempGfx = NULL; - -static UINT16 *pBitmap[4]; - -static INT32 CharScrollX; -static INT32 CharScrollY; -static INT32 Scroll1X; -static INT32 Scroll1Y; -static INT32 Scroll2X; -static INT32 Scroll2Y; - -static INT32 Ginkun = 0; -static INT32 Riot = 0; - -static INT32 FstarfrcSoundLatch; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo FstarfrcInputList[] = { - {"Coin 1" , BIT_DIGITAL , FstarfrcInputPort0 + 14, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , FstarfrcInputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , FstarfrcInputPort0 + 15, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , FstarfrcInputPort0 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , FstarfrcInputPort0 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , FstarfrcInputPort0 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , FstarfrcInputPort0 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , FstarfrcInputPort0 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , FstarfrcInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , FstarfrcInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , FstarfrcInputPort0 + 11, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , FstarfrcInputPort0 + 10, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , FstarfrcInputPort0 + 9, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , FstarfrcInputPort0 + 8, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , FstarfrcInputPort0 + 12, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , FstarfrcInputPort0 + 13, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &FstarfrcReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, FstarfrcDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, FstarfrcDip + 1 , "dip" }, -}; - -STDINPUTINFO(Fstarfrc) - -static struct BurnInputInfo RiotInputList[] = { - {"Coin 1" , BIT_DIGITAL , FstarfrcInputPort0 + 14, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , FstarfrcInputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , FstarfrcInputPort0 + 15, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , FstarfrcInputPort0 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , FstarfrcInputPort0 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , FstarfrcInputPort0 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , FstarfrcInputPort0 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , FstarfrcInputPort0 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , FstarfrcInputPort1 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , FstarfrcInputPort0 + 4, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , FstarfrcInputPort0 + 5, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , FstarfrcInputPort0 + 11, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , FstarfrcInputPort0 + 10, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , FstarfrcInputPort0 + 9, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , FstarfrcInputPort0 + 8, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , FstarfrcInputPort1 + 5, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , FstarfrcInputPort0 + 12, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , FstarfrcInputPort0 + 13, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &FstarfrcReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, FstarfrcDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, FstarfrcDip + 1 , "dip" }, -}; - -STDINPUTINFO(Riot) - -static inline void FstarfrcMakeInputs() -{ - // Reset Inputs - FstarfrcInput[0] = FstarfrcInput[1] = 0x3fff; - - // Compile Digital Inputs - for (INT32 i = 0; i < 14; i++) { - FstarfrcInput[0] -= (FstarfrcInputPort0[i] & 1) << i; - } - - for (INT32 i = 14; i < 16; i++) { - FstarfrcInput[0] |= (FstarfrcInputPort0[i] & 1) << i; - } - - for (INT32 i = 0; i < 6; i++) { - FstarfrcInput[1] -= (FstarfrcInputPort1[i] & 1) << i; - } -} - -static struct BurnDIPInfo FstarfrcDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin SW 1" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x03, 0x00, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin SW 2" }, - {0x11, 0x01, 0x0c, 0x00, "4 Coins 1 Credit" }, - {0x11, 0x01, 0x0c, 0x04, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Screen Reverse" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demonstration Sound" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Continue Play" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "The Number of Player" }, - {0x12, 0x01, 0x03, 0x00, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Medium" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Level Up Speed" }, - {0x12, 0x01, 0x30, 0x00, "Slowest" }, - {0x12, 0x01, 0x30, 0x10, "Slow" }, - {0x12, 0x01, 0x30, 0x30, "Fast" }, - {0x12, 0x01, 0x30, 0x20, "Fastest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x12, 0x01, 0xc0, 0xc0, "200,000, 1,000,000" }, - {0x12, 0x01, 0xc0, 0x80, "220,000, 1,200,000" }, - {0x12, 0x01, 0xc0, 0x40, "240,000, 1,400,000" }, - {0x12, 0x01, 0xc0, 0x00, "Every 500,000, Once at Highest Score"}, -}; - -STDDIPINFO(Fstarfrc) - -static struct BurnDIPInfo GinkunDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin SW 1" }, - {0x11, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x03, 0x00, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin SW 2" }, - {0x11, 0x01, 0x0c, 0x00, "4 Coins 1 Credit" }, - {0x11, 0x01, 0x0c, 0x04, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Continue Plus 1up" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x03, 0x00, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Normal" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, -}; - -STDDIPINFO(Ginkun) - -static struct BurnDIPInfo RiotDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x07, 0x01, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x07, 0x04, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x38, 0x08, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x38, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x38, 0x30, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x38, 0x28, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x38, 0x18, "4 Coins 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Starting Coins" }, - {0x13, 0x01, 0x40, 0x40, "1" }, - {0x13, 0x01, 0x40, 0x00, "2" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x03, 0x03, "1" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x01, "3" }, - {0x14, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, -}; - -STDDIPINFO(Riot) - -static struct BurnRomInfo FstarfrcRomDesc[] = { - { "fstarf01.rom", 0x40000, 0x94c71de6, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "fstarf02.rom", 0x40000, 0xb1a07761, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "fstarf03.rom", 0x20000, 0x54375335, BRF_GRA }, // 2 - { "fstarf05.rom", 0x80000, 0x77a281e7, BRF_GRA }, // 3 - { "fstarf04.rom", 0x80000, 0x398a920d, BRF_GRA }, // 4 - { "fstarf09.rom", 0x80000, 0xd51341d2, BRF_GRA }, // 5 - { "fstarf06.rom", 0x80000, 0x07e40e87, BRF_GRA }, // 6 - - { "fstarf07.rom", 0x10000, 0xe0ad5de1, BRF_PRG | BRF_SND }, // 7 Z80 Program Code - - { "fstarf08.rom", 0x20000, 0xf0ad5693, BRF_SND }, // 8 Samples -}; - - -STD_ROM_PICK(Fstarfrc) -STD_ROM_FN(Fstarfrc) - - -static struct BurnRomInfo FstarfrcjRomDesc[] = { - { "1.bin", 0x40000, 0x1905d85d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "2.bin", 0x40000, 0xde9cfc39, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "fstarf03.rom", 0x20000, 0x54375335, BRF_GRA }, // 2 - { "fstarf05.rom", 0x80000, 0x77a281e7, BRF_GRA }, // 3 - { "fstarf04.rom", 0x80000, 0x398a920d, BRF_GRA }, // 4 - { "fstarf09.rom", 0x80000, 0xd51341d2, BRF_GRA }, // 5 - { "fstarf06.rom", 0x80000, 0x07e40e87, BRF_GRA }, // 6 - - { "fstarf07.rom", 0x10000, 0xe0ad5de1, BRF_PRG | BRF_SND }, // 7 Z80 Program Code - - { "fstarf08.rom", 0x20000, 0xf0ad5693, BRF_SND }, // 8 Samples -}; - - -STD_ROM_PICK(Fstarfrcj) -STD_ROM_FN(Fstarfrcj) - -static struct BurnRomInfo GinkunRomDesc[] = { - { "ginkun01.i01", 0x40000, 0x98946fd5, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ginkun02.i02", 0x40000, 0xe98757f6, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "ginkun03.i03", 0x20000, 0x4456e0df, BRF_GRA }, // 2 - { "ginkun05.i09", 0x80000, 0x1263bd42, BRF_GRA }, // 3 - { "ginkun04.i05", 0x80000, 0x9e4cf611, BRF_GRA }, // 4 - { "ginkun09.i22", 0x80000, 0x233384b9, BRF_GRA }, // 5 - { "ginkun06.i16", 0x80000, 0xf8589184, BRF_GRA }, // 6 - - { "ginkun07.i17", 0x10000, 0x8836b1aa, BRF_PRG | BRF_SND }, // 7 Z80 Program Code - - { "ginkun08.i18", 0x20000, 0x8b7583c7, BRF_SND }, // 8 Samples -}; - - -STD_ROM_PICK(Ginkun) -STD_ROM_FN(Ginkun) - -static struct BurnRomInfo RiotRomDesc[] = { - { "1.ic1", 0x40000, 0x9ef4232e, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "2.ic2", 0x40000, 0xf2c6fbbf, BRF_ESS | BRF_PRG }, // 1 68000 Program Code - - { "3.ic3", 0x20000, 0xf60f5c96, BRF_GRA }, // 2 - { "5.ic9", 0x80000, 0x056fce78, BRF_GRA }, // 3 - { "4.ic5", 0x80000, 0x0894e7b4, BRF_GRA }, // 4 - { "9.ic22", 0x80000, 0x0ead54f3, BRF_GRA }, // 5 - { "6.ic16", 0x80000, 0x96ef61da, BRF_GRA }, // 6 - - { "7.ic17", 0x10000, 0x0a95b8f3, BRF_PRG | BRF_SND }, // 7 Z80 Program Code - - { "8.ic18", 0x20000, 0x4b70e266, BRF_SND }, // 8 Samples -}; - - -STD_ROM_PICK(Riot) -STD_ROM_FN(Riot) - -static INT32 DrvDoReset() -{ - CharScrollX = CharScrollY = Scroll1X = Scroll1Y = Scroll2X = Scroll2Y = 0; - - FstarfrcSoundLatch = 0; - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - return 0; -} - -static void FstarfrcYM2151IrqHandler(INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static UINT16 __fastcall FstarfrcReadWord(UINT32 a) -{ - switch (a) { - case 0x150030: { - SEK_DEF_READ_WORD(0, a); - } - - case 0x150040: { - SEK_DEF_READ_WORD(0, a); - } - - case 0x150050: { - return FstarfrcInput[0]; - } - } - - return 0; -} - -static UINT8 __fastcall FstarfrcReadByte(UINT32 a) -{ - switch (a) { - case 0x150030: - case 0x150031: { - return FstarfrcDip[1]; - } - case 0x150040: - case 0x150041: { - return FstarfrcDip[0]; - } - } - - return 0; -} - -static void __fastcall FstarfrcWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x150010: { - SEK_DEF_WRITE_WORD(0, a, d); - return; - } - - case 0x160000: { - CharScrollX = d; - return; - } - - case 0x16000c: { - Scroll1X = d; - return; - } - - case 0x160012: { - Scroll1Y = d; - return; - } - - case 0x160018: { - Scroll2X = d; - return; - } - - case 0x16001e: { - Scroll2Y = d; - return; - } - } -} - -static void __fastcall FstarfrcWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x150011: { - FstarfrcSoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - ZetClose(); - return; - } - } -} - -static UINT16 __fastcall GinkunReadWord(UINT32 a) -{ - switch (a) { - case 0x150020: { - return FstarfrcInput[1]; - } - - case 0x150030: { - SEK_DEF_READ_WORD(0, a); - } - - case 0x150040: { - SEK_DEF_READ_WORD(0, a); - } - - case 0x150050: { - return FstarfrcInput[0]; - } - } - -// bprintf(PRINT_NORMAL, _T("Read Word -> %06X\n"), a); - - return 0; -} - -static UINT8 __fastcall GinkunReadByte(UINT32 a) -{ - switch (a) { - case 0x150030: - case 0x150031: { - return FstarfrcDip[1]; - } - case 0x150040: - case 0x150041: { - return FstarfrcDip[0]; - } - } - - -// bprintf(PRINT_NORMAL, _T("Read Byte -> %06X\n"), a); - - return 0; -} - -static void __fastcall GinkunWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { -// case 0x150010: { -// SEK_DEF_WRITE_WORD(0, a, d); -// return; -// } - - case 0x150066: { - return; - } - - case 0x16002e: { - return; - } - - case 0x160000: { - CharScrollX = d; - return; - } - - case 0x160006: { - CharScrollY = d; - return; - } - - case 0x16000c: { - Scroll1X = d; - return; - } - - case 0x160012: { - Scroll1Y = d; - return; - } - - case 0x160018: { - Scroll2X = d; - return; - } - - case 0x16001e: { - Scroll2Y = d; - return; - } - } - -// bprintf(PRINT_NORMAL, _T("Write Word -> %06X, %04X\n"), a, d); -} - -static void __fastcall GinkunWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x150001: { - return; // Flipscreen - } - - case 0x150021: { - return; // NOP - } - - case 0x150031: { - return; // NOP - } - - case 0x150011: { - FstarfrcSoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - ZetClose(); - return; - } - } - -// bprintf(PRINT_NORMAL, _T("Write Byte -> %06X, %02X\n"), a, d); -} - -static UINT8 __fastcall FstarfrcZ80Read(UINT16 a) -{ - switch (a) { - case 0xfc00: { - return MSM6295ReadStatus(0); - } - - case 0xfc05: { - return BurnYM2151ReadStatus(); - } - - case 0xfc08: { - return FstarfrcSoundLatch; - } - } - - return 0; -} - -static void __fastcall FstarfrcZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xfc00: { - MSM6295Command(0, d); - return; - } - - case 0xfc04: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xfc05: { - BurnYM2151WriteRegister(d); - return; - } - } -} - -static INT32 FstarfrcMemIndex() -{ - UINT8 *Next; Next = Mem; - - FstarfrcRom = Next; Next += 0x80000; - FstarfrcZ80Rom = Next; Next += 0x10000; - MSM6295ROM = Next; Next += 0x20000; - - RamStart = Next; - - pBitmap[0] = (UINT16*)Next; Next += 256 * 256 * sizeof(UINT16); - pBitmap[1] = (UINT16*)Next; Next += 256 * 256 * sizeof(UINT16); - pBitmap[2] = (UINT16*)Next; Next += 256 * 256 * sizeof(UINT16); - pBitmap[3] = (UINT16*)Next; Next += 256 * 256 * sizeof(UINT16); - - FstarfrcRam = Next; Next += 0x0a000; - FstarfrcCharRam = Next; Next += 0x01000; - FstarfrcVideoRam = Next; Next += 0x01000; - FstarfrcColourRam = Next; Next += 0x01000; - FstarfrcVideo2Ram = Next; Next += 0x01000; - FstarfrcColour2Ram = Next; Next += 0x01000; - FstarfrcSpriteRam = Next; Next += 0x01000; - FstarfrcPaletteRam = Next; Next += 0x02000; - FstarfrcZ80Ram = Next; Next += 0x0c010; // c002 - - RamEnd = Next; - - FstarfrcCharTiles = Next; Next += (4096 * 8 * 8); - FstarfrcLayerTiles = Next; Next += (8192 * 16 * 16); - FstarfrcSpriteTiles = Next; Next += (32768 * 8 * 8); - FstarfrcPalette = (UINT32*)Next; Next += 0x02000 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 TilePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TileXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 256, 260, 264, 268, 272, 276, 280, 284 }; -static INT32 TileYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 CharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; - -static INT32 DrvInit(INT32 game_select) -{ - INT32 nRet = 0, nLen; - - if (game_select == 1) Ginkun = 1; - if (game_select == 2) Riot = 1; - - // Allocate and Blank all required memory - Mem = NULL; - FstarfrcMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - FstarfrcMemIndex(); - - FstarfrcTempGfx = (UINT8*)BurnMalloc(0x100000); - - // Load and byte-swap 68000 Program roms - nRet = BurnLoadRom(FstarfrcRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(FstarfrcRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and decode Char Tiles rom - memset(FstarfrcTempGfx, 0, 0x100000); - nRet = BurnLoadRom(FstarfrcTempGfx, 2, 1); if (nRet != 0) return 1; - GfxDecode(4096, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, FstarfrcTempGfx, FstarfrcCharTiles); - - // Load, byteswap and decode Bg and Fg Layer roms - memset(FstarfrcTempGfx, 0, 0x100000); - nRet = BurnLoadRom(FstarfrcTempGfx + 0x000000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(FstarfrcTempGfx + 0x000001, 4, 2); if (nRet != 0) return 1; - GfxDecode(8192, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x400, FstarfrcTempGfx, FstarfrcLayerTiles); - - // Load, byteswap and decode Sprite Tile roms - memset(FstarfrcTempGfx, 0, 0x100000); - nRet = BurnLoadRom(FstarfrcTempGfx + 0x000000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(FstarfrcTempGfx + 0x000001, 6, 2); if (nRet != 0) return 1; - GfxDecode(32768, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, FstarfrcTempGfx, FstarfrcSpriteTiles); - - BurnFree(FstarfrcTempGfx); - - // Load Z80 Program rom - nRet = BurnLoadRom(FstarfrcZ80Rom, 7, 1); if (nRet != 0) return 1; - - // Load Sample Rom - nRet = BurnLoadRom(MSM6295ROM, 8, 1); if (nRet != 0) return 1; - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - if (game_select == 0) { - SekMapMemory(FstarfrcRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(FstarfrcRam , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(FstarfrcCharRam , 0x110000, 0x110fff, MAP_RAM); - SekMapMemory(FstarfrcVideoRam , 0x120000, 0x1207ff, MAP_RAM); - SekMapMemory(FstarfrcColourRam , 0x120800, 0x120fff, MAP_RAM); - SekMapMemory(FstarfrcVideo2Ram , 0x121000, 0x1217ff, MAP_RAM); - SekMapMemory(FstarfrcColour2Ram , 0x121800, 0x121fff, MAP_RAM); - SekMapMemory(FstarfrcRam + 0x4000, 0x122000, 0x127fff, MAP_RAM); - SekMapMemory(FstarfrcSpriteRam , 0x130000, 0x130fff, MAP_RAM); - SekMapMemory(FstarfrcPaletteRam , 0x140000, 0x141fff, MAP_RAM); - SekSetReadWordHandler(0, FstarfrcReadWord); - SekSetWriteWordHandler(0, FstarfrcWriteWord); - SekSetReadByteHandler(0, FstarfrcReadByte); - SekSetWriteByteHandler(0, FstarfrcWriteByte); - } else { - SekMapMemory(FstarfrcRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(FstarfrcRam , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(FstarfrcCharRam , 0x110000, 0x110fff, MAP_RAM); - SekMapMemory(FstarfrcVideoRam , 0x120000, 0x120fff, MAP_RAM); - SekMapMemory(FstarfrcColourRam , 0x121000, 0x121fff, MAP_RAM); - SekMapMemory(FstarfrcVideo2Ram , 0x122000, 0x122fff, MAP_RAM); - SekMapMemory(FstarfrcColour2Ram , 0x123000, 0x123fff, MAP_RAM); - SekMapMemory(FstarfrcRam + 0x4000, 0x124000, 0x124fff, MAP_RAM); - SekMapMemory(FstarfrcSpriteRam , 0x130000, 0x130fff, MAP_RAM); - SekMapMemory(FstarfrcPaletteRam , 0x140000, 0x141fff, MAP_RAM); - SekSetReadWordHandler(0, GinkunReadWord); - SekSetWriteWordHandler(0, GinkunWriteWord); - SekSetReadByteHandler(0, GinkunReadByte); - SekSetWriteByteHandler(0, GinkunWriteByte); - } - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xefff, 0, FstarfrcZ80Rom ); - ZetMapArea(0x0000, 0xefff, 2, FstarfrcZ80Rom ); - ZetMapArea(0xf000, 0xfbff, 0, FstarfrcZ80Ram ); - ZetMapArea(0xf000, 0xfbff, 1, FstarfrcZ80Ram ); - ZetMapArea(0xf000, 0xfbff, 2, FstarfrcZ80Ram ); - ZetMapArea(0xfffe, 0xffff, 0, FstarfrcZ80Ram + 0xc000); - ZetMapArea(0xfffe, 0xffff, 1, FstarfrcZ80Ram + 0xc000); - ZetMapArea(0xfffe, 0xffff, 2, FstarfrcZ80Ram + 0xc000); - ZetSetReadHandler(FstarfrcZ80Read); - ZetSetWriteHandler(FstarfrcZ80Write); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(8000000 / 2); - BurnYM2151SetIrqHandler(&FstarfrcYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, (Riot) ? 1.60 : 0.60, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, (Riot) ? 1.60 : 0.60, BURN_SND_ROUTE_RIGHT); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 7575, 1); - MSM6295SetRoute(0, (Riot) ? 1.40 : 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 FstarfrcInit() { return DrvInit(0); } -static INT32 GinkunInit() { return DrvInit(1); } -static INT32 RiotInit() { return DrvInit(2); } - -static INT32 DrvExit() -{ - BurnYM2151Exit(); - MSM6295Exit(0); - - SekExit(); - ZetExit(); - - GenericTilesExit(); - - BurnFree(Mem); - - Ginkun = 0; - Riot = 0; - - return 0; -} - -static void FstarfrcRenderBgLayer() -{ - INT32 Wide = ((Riot || Ginkun) ? 0x400 : 0x200); - - INT32 XScroll = Scroll2X & (Wide - 1); - INT32 YScroll = (Scroll2Y + 16) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * (Wide / 16); offs++) - { - INT32 Code = ((FstarfrcVideo2Ram[offs * 2 + 1] << 8) | FstarfrcVideo2Ram[offs * 2 + 0]) & 0x1fff; - INT32 Colour = FstarfrcColour2Ram[offs * 2 + 0] & 0x0f; - - INT32 sx = ((offs & ((Wide / 16) - 1)) * 16) - XScroll; - INT32 sy = ((offs / (Wide / 16)) * 16) - YScroll; - - if (sx < -15) sx += Wide; - if (sy < -15) sy += 512; - - if (sx > 15 && sx < 240 && sy > 15 && sy < 208) { - Render16x16Tile(pBitmap[0], Code, sx, sy, Colour, 4, 0x300, FstarfrcLayerTiles); - } else { - Render16x16Tile_Clip(pBitmap[0], Code, sx, sy, Colour, 4, 0x300, FstarfrcLayerTiles); - } - } -} - -static void FstarfrcRenderFgLayer() -{ - INT32 Wide = ((Riot || Ginkun) ? 0x400 : 0x200); - INT32 XScroll = Scroll1X & (Wide - 1); - INT32 YScroll = (Scroll1Y + 16) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * (Wide / 16); offs++) - { - INT32 Code = ((FstarfrcVideoRam[offs * 2 + 1] << 8) | FstarfrcVideoRam[offs * 2 + 0]) & 0x1fff; - INT32 Colour = FstarfrcColourRam[offs * 2 + 0] & 0x1f; - - INT32 sx = ((offs & ((Wide / 16) - 1)) * 16) - XScroll; - INT32 sy = ((offs / (Wide / 16)) * 16) - YScroll; - - if (sx < -15) sx += Wide; - if (sy < -15) sy += 512; - - if (sx > 15 && sx < 240 && sy > 15 && sy < 208) { - Render16x16Tile(pBitmap[1], Code, sx, sy, Colour, 4, 0x200, FstarfrcLayerTiles); - } else { - Render16x16Tile_Clip(pBitmap[1], Code, sx, sy, Colour, 4, 0x200, FstarfrcLayerTiles); - } - } -} - -static void FstarfrcRenderTextLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - INT32 XScroll = CharScrollX & 0x1ff; - INT32 YScroll = CharScrollY; - - if (Riot) YScroll += 16; - //if (!Riot && !Ginkun) YScroll -= 16; - - YScroll &= 0xff; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = (FstarfrcCharRam[TileIndex + 1] << 8) | FstarfrcCharRam[TileIndex + 0]; - Colour = Code >> 12; - Code &= 0x0fff; - - x = 8 * mx; - y = 8 * my; - - x -= XScroll; - y -= YScroll; - if (x < -7) x += 512; - if (y < -7) y += 256; - - if (x > 7 && x < 248 && y > 7 && y < 216) { - Render8x8Tile(pBitmap[3], Code, x, y, Colour, 4, 256, FstarfrcCharTiles); - } else { - Render8x8Tile_Clip(pBitmap[3], Code, x, y, Colour, 4, 256, FstarfrcCharTiles); - } - - TileIndex += 2; - } - } -} - -static void FstarfrcRenderSprites() -{ - UINT16* pFstarfrcSpriteRam = ((UINT16*)FstarfrcSpriteRam); - - INT32 offs; - const UINT8 layout[8][8] = - { - {0,1,4,5,16,17,20,21}, - {2,3,6,7,18,19,22,23}, - {8,9,12,13,24,25,28,29}, - {10,11,14,15,26,27,30,31}, - {32,33,36,37,48,49,52,53}, - {34,35,38,39,50,51,54,55}, - {40,41,44,45,56,57,60,61}, - {42,43,46,47,58,59,62,63} - }; - - for (offs = 0; offs < 0x1000 / 2; offs += 8) - { - if (BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs]) & 0x04) /* enable */ - { - INT32 code,color,sizex,sizey,flipx,flipy,xpos,ypos; - INT32 x,y,priority; - - code = BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs+1]); - color = (BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs+2]) & 0xf0) >> 4; - sizex = 1 << ((BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs+2]) & 0x03) >> 0); - if(Riot) - sizey = sizex; - else - sizey = 1 << ((BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs+2]) & 0x0c) >> 2); - if (sizex >= 2) code &= ~0x01; - if (sizey >= 2) code &= ~0x02; - if (sizex >= 4) code &= ~0x04; - if (sizey >= 4) code &= ~0x08; - if (sizex >= 8) code &= ~0x10; - if (sizey >= 8) code &= ~0x20; - flipx = BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs]) & 0x01; - flipy = BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs]) & 0x02; - xpos = BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs+4]); - if (xpos >= 0x8000) xpos -= 0x10000; - ypos = BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs+3]); - if (ypos >= 0x8000) ypos -= 0x10000; - priority = (BURN_ENDIAN_SWAP_INT16(pFstarfrcSpriteRam[offs]) & 0xe0); - - color |= priority; - - if ((nSpriteEnable & (1<<((priority>>6)^3)))==0) continue; - - for (y = 0;y < sizey;y++) - { - for (x = 0;x < sizex;x++) - { - INT32 sx = xpos + 8*(flipx?(sizex-1-x):x); - INT32 sy = ypos + 8*(flipy?(sizey-1-y):y); - - if ((code + layout[y][x]) > 32767) break; - - sy -= 16; - - if (sx > 7 && sx < 248 && sy > 7 && sy < 216) { - if (!flipx) { - if (!flipy) { - Render8x8Tile_Mask(pBitmap[2], code + layout[y][x], sx, sy, color, 4, 0, 0, FstarfrcSpriteTiles); - } else { - Render8x8Tile_Mask_FlipY(pBitmap[2], code + layout[y][x], sx, sy, color, 4, 0, 0, FstarfrcSpriteTiles); - } - } else { - if (!flipy) { - Render8x8Tile_Mask_FlipX(pBitmap[2], code + layout[y][x], sx, sy, color, 4, 0, 0, FstarfrcSpriteTiles); - } else { - Render8x8Tile_Mask_FlipXY(pBitmap[2], code + layout[y][x], sx, sy, color, 4, 0, 0, FstarfrcSpriteTiles); - } - } - } else { - if (!flipx) { - if (!flipy) { - Render8x8Tile_Mask_Clip(pBitmap[2], code + layout[y][x], sx, sy, color, 4, 0, 0, FstarfrcSpriteTiles); - } else { - Render8x8Tile_Mask_FlipY_Clip(pBitmap[2], code + layout[y][x], sx, sy, color, 4, 0, 0, FstarfrcSpriteTiles); - } - } else { - if (!flipy) { - Render8x8Tile_Mask_FlipX_Clip(pBitmap[2], code + layout[y][x], sx, sy, color, 4, 0, 0, FstarfrcSpriteTiles); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pBitmap[2], code + layout[y][x], sx, sy, color, 4, 0, 0, FstarfrcSpriteTiles); - } - } - } - } - } - } - } -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (nColour >> 0) & 0x0f; - g = (nColour >> 4) & 0x0f; - b = (nColour >> 8) & 0x0f; - - r = (r << 4) | r; - g = (g << 4) | g; - b = (b << 4) | b; - - return BurnHighCol(r,g,b,0); -} - -static INT32 FstarfrcCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)FstarfrcPaletteRam, pd = FstarfrcPalette; i < 0x2000; i++, ps++, pd++) { - *pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*ps)); - } - - return 0; -} - -static void FstarfrcRenderMixBitmaps() -{ - const UINT32 *paldata = FstarfrcPalette; - const UINT32 *palblnd = FstarfrcPalette + 0x400; - - for (INT32 y = 0; y < nScreenHeight; y++) - { - UINT16 *tx = pBitmap[3] + y * nScreenWidth; - UINT16 *sp = pBitmap[2] + y * nScreenWidth; - UINT16 *fg = pBitmap[1] + y * nScreenWidth; - UINT16 *bg = pBitmap[0] + y * nScreenWidth; - - UINT8 *dst = pBurnDraw + (y * nScreenWidth) * nBurnBpp; - - for (INT32 x = 0; x < nScreenWidth; x++, dst += nBurnBpp) - { - UINT16 sprpixel = sp[x]; - UINT16 m_sprpri = (sprpixel >> 10) & 3; - UINT16 m_sprbln = (sprpixel >> 9) & 1; - - sprpixel = sprpixel & 0xff; - sp[x] = 0; // clear sprites - - UINT16 fgpixel = fg[x]; - UINT16 fgbln = fgpixel & 0x0100; - fgpixel &= 0xeff; - - UINT16 bgpixel = bg[x]; - - if (tx[x] & 0xf) { - PutPix(dst, paldata[tx[x]]); - continue; - } - - if (sprpixel & 0xf) - { - if (m_sprpri == 3) - { - if (fgpixel & 0xf) - { - if (fgbln) - { - PutPix(dst, rand()); - } - else - { - PutPix(dst, paldata[fgpixel]); - } - } - else if (bgpixel & 0x0f) - { - PutPix(dst, paldata[bgpixel]); - } - else - { - if (m_sprbln) - { - PutPix(dst, rand()); - } - else - { - PutPix(dst, paldata[sprpixel]); - } - } - } - else if (m_sprpri == 2) - { - if (fgpixel & 0xf) - { - if (fgbln) - { - if (m_sprbln) - { - PutPix(dst, (palblnd[bgpixel] + paldata[sprpixel + 0x800])); - } - else - { - PutPix(dst, (paldata[fgpixel + 0x700] + palblnd[sprpixel])); - } - } - else - { - PutPix(dst, paldata[fgpixel]); - } - } - else - { - if (m_sprbln) - { - UINT32 pxl = palblnd[bgpixel] + paldata[sprpixel + 0x800]; - PutPix(dst, pxl); - } - else - { - PutPix(dst, paldata[sprpixel]); - } - } - } - else if (m_sprpri == 1) - { - if (m_sprbln) - { - if (fgpixel & 0xf) - { - if (fgbln) - { - PutPix(dst, rand()); - } - else - { - PutPix(dst, (palblnd[fgpixel] + paldata[sprpixel + 0x800])); - } - } - else - { - PutPix(dst, (palblnd[bgpixel] + paldata[sprpixel + 0x800])); - } - } - else - { - PutPix(dst, paldata[sprpixel]); - } - } - else if (m_sprpri == 0) - { - if (m_sprbln) - { - PutPix(dst, rand()); - } - else - { - PutPix(dst, paldata[sprpixel]); - } - } - } - else - { - if (fgpixel & 0x0f) - { - if (fgbln) - { - PutPix(dst, (paldata[fgpixel + 0x700] + palblnd[bgpixel])); - - } - else - { - PutPix(dst, paldata[fgpixel]); - } - - } - else if (bgpixel & 0x0f) - { - PutPix(dst, paldata[bgpixel]); - } - else - { - PutPix(dst, paldata[0x300]); - } - } - } - } -} - -static INT32 DrvDraw() -{ - FstarfrcCalcPalette(); - - if (~nBurnLayer & 1) memset (pBitmap[0], 0, 256 * 256 * 2); - if (~nBurnLayer & 2) memset (pBitmap[1], 0, 256 * 256 * 2); - if (~nBurnLayer & 4) memset (pBitmap[2], 0, 256 * 256 * 2); - if (~nBurnLayer & 8) memset (pBitmap[3], 0, 256 * 256 * 2); - - if (nBurnLayer & 1) FstarfrcRenderBgLayer(); - if (nBurnLayer & 2) FstarfrcRenderFgLayer(); - if (nBurnLayer & 4) FstarfrcRenderTextLayer(); - if (nBurnLayer & 8) FstarfrcRenderSprites(); - - FstarfrcRenderMixBitmaps(); - - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 10; - - if (FstarfrcReset) DrvDoReset(); - - FstarfrcMakeInputs(); - - nCyclesTotal[0] = (24000000 / 2) / 60; - nCyclesTotal[1] = (8000000 / 2) / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - - SekOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x02944; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); // Scan 68000 - ZetScan(nAction); // Scan Z80 - - MSM6295Scan(0, nAction); // Scan OKIM6295 - BurnYM2151Scan(nAction); - - // Scan critical driver variables - SCAN_VAR(FstarfrcSoundLatch); - SCAN_VAR(FstarfrcInput); - SCAN_VAR(FstarfrcDip); - SCAN_VAR(CharScrollX); - SCAN_VAR(CharScrollY); - SCAN_VAR(Scroll1X); - SCAN_VAR(Scroll1Y); - SCAN_VAR(Scroll2X); - SCAN_VAR(Scroll2Y); - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - } - - return 0; -} - -struct BurnDriver BurnDrvFstarfrc = { - "fstarfrc", NULL, NULL, NULL, "1992", - "Final Star Force (US)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, FstarfrcRomInfo, FstarfrcRomName, NULL, NULL, FstarfrcInputInfo, FstarfrcDIPInfo, - FstarfrcInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - NULL, 0x2000, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvFstarfrcj = { - "fstarfrcj", "fstarfrc", NULL, NULL, "1992", - "Final Star Force (Japan)\0", NULL, "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, FstarfrcjRomInfo, FstarfrcjRomName, NULL, NULL, FstarfrcInputInfo, FstarfrcDIPInfo, - FstarfrcInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - NULL, 0x2000, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvGinkun = { - "ginkun", NULL, NULL, NULL, "1995", - "Ganbare Ginkun\0", NULL, "Tecmo", "Miscellaneous", - L"\u304C\u3093\u3070\u308C \u30AE\u30F3\u304F\u3093\0Ganbare Ginkun\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0, - NULL, GinkunRomInfo, GinkunRomName, NULL, NULL, FstarfrcInputInfo, GinkunDIPInfo, - GinkunInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - NULL, 0x2000, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRiot = { - "riot", NULL, NULL, NULL, "1992", - "Riot\0", NULL, "NMK", "Miscellaneous", - L"\u96F7\u8ECB\u6597 Riot\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, RiotRomInfo, RiotRomName, NULL, NULL, RiotInputInfo, RiotDIPInfo, - RiotInit, DrvExit, DrvFrame, DrvDraw, DrvScan, - NULL, 0x2000, 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_tecmosys.cpp b/jan/src/burn/drv/pst90s/d_tecmosys.cpp deleted file mode 100644 index bb8dde02b..000000000 --- a/jan/src/burn/drv/pst90s/d_tecmosys.cpp +++ /dev/null @@ -1,1532 +0,0 @@ -// FB Alpha Tecmo System driver module -// Based on MAME driver by Farfetch, David Haywood, Tomasz Slanina, and nuapete - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" -#include "eeprom.h" -#include "ymz280b.h" -// ymf262 - -//#define ENABLE_SOUND_HARDWARE // no sound without ymf262 core anyway... - -#ifdef ENABLE_SOUND_HARDWARE -#include "z80_intf.h" -#endif - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvSprROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; - -static UINT8 *Drv68KRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvBgRAM0; -static UINT8 *DrvBgRAM1; -static UINT8 *DrvBgRAM2; -static UINT8 *DrvBgScrRAM0; -static UINT8 *DrvBgScrRAM1; -static UINT8 *DrvBgScrRAM2; -static UINT8 *spritelist_select; -static UINT8 *Drv88Regs; -static UINT8 *DrvA8Regs; -static UINT8 *DrvB0Regs; -static UINT8 *DrvC0Regs; -static UINT8 *DrvC8Regs; - -#ifdef ENABLE_SOUND_HARDWARE -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *DrvOkiBank; -static UINT8 *DrvZ80Bank; -static UINT8 *soundlatch; -static UINT8 *soundlatch2; -#endif - -static UINT8 protection_read_pointer; -static UINT8 protection_status; -static UINT8 protection_value; - -static UINT16 *DrvTmpSprites; - -static UINT32 *DrvPalette; -static UINT32 *DrvPalette24; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static INT32 vblank; -static INT32 watchdog; -static INT32 deroon; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 8, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 10, "p1 fire 4" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 10, "p2 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 9, "service" }, - {"Service 2", BIT_DIGITAL, DrvJoy2 + 9, "service" }, -}; - -STDINPUTINFO(Drv) - -struct prot_data -{ - UINT8 passwd_len; - const UINT8* passwd; - const UINT8* code; - UINT8 checksums[4]; -}; - -static const struct prot_data *protection_data; - -static const UINT8 deroon_passwd[] = { 'L', 'U', 'N', 'A', 0 }; -static const UINT8 deroon_upload[] = { 0x02, 0x4e, 0x75, 0x00 }; -static const struct prot_data deroon_data = { 0x05, deroon_passwd, deroon_upload, { 0xa6, 0x29, 0x4b, 0x3f } }; - -static const UINT8 tkdensho_passwd[] = { 'A','G','E','P','R','O','T','E','C','T',' ','S','T','A','R','T', 0 }; -static const UINT8 tkdensho_upload[] = { 0x06, 0x4e, 0xf9, 0x00, 0x00, 0x22, 0xc4, 0x00 }; -static const struct prot_data tkdensho_data = { 0x11, tkdensho_passwd, tkdensho_upload, { 0xbf, 0xfa, 0xda, 0xda } }; -static const struct prot_data tkdenshoa_data = { 0x11, tkdensho_passwd, tkdensho_upload, { 0xbf, 0xfa, 0x21, 0x5d } }; - -static void protection_reset() -{ - protection_read_pointer = 0; - protection_status = 0; // idle - protection_value = 0xff; -} - -static void tecmosys_prot_data_write(INT32 data) -{ - static const UINT8 ranges[] = { - 0x10,0x11,0x12,0x13,0x24,0x25,0x26,0x27,0x38,0x39,0x3a,0x3b,0x4c,0x4d,0x4e,0x4f, 0x00 - }; - - switch (protection_status) - { - case 0: // idle - if (data == 0x13) - { - protection_status = 1; // login - protection_value = protection_data->passwd_len; - protection_read_pointer = 0; - break; - } - break; - - case 1: // login - if (protection_read_pointer >= protection_data->passwd_len) - { - protection_status = 2; // send code - protection_value = protection_data->code[0]; - protection_read_pointer = 1; - } - else - protection_value = protection_data->passwd[protection_read_pointer++] == data ? 0 : 0xff; - break; - - case 2: // send code - if (protection_read_pointer >= protection_data->code[0]+2) - { - protection_status = 3; // send address - protection_value = ranges[0]; - protection_read_pointer = 1; - } - else - protection_value = data == protection_data->code[protection_read_pointer-1] ? protection_data->code[protection_read_pointer++] : 0xff; - break; - - case 3: // send address - if (protection_read_pointer >= 17) - { - protection_status = 4; // send checksum - protection_value = 0; - protection_read_pointer = 0; - } - else - { - protection_value = data == ranges[protection_read_pointer-1] ? ranges[protection_read_pointer++] : 0xff; - } - break; - - case 4: // send checksum - if (protection_read_pointer >= 5) - { - protection_status = 5; // done - protection_value = 0; - } - else - protection_value = data == protection_data->checksums[protection_read_pointer] ? protection_data->checksums[protection_read_pointer++] : 0xff; - break; - - case 5: // done - break; - } -} - -void __fastcall tecmosys_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x880000: - case 0x880002: - *((UINT16*)(Drv88Regs + (address & 0x02))) = data; - return; - - case 0x880008: - *spritelist_select = data & 0x03; - return; - - case 0x880022: - watchdog = 0; - return; - - case 0xa00000: - EEPROMWrite((data & 0x0400), (data & 0x0200), (data & 0x0800)); - return; - - case 0xa80000: - case 0xa80002: - case 0xa80004: - *((UINT16*)(DrvA8Regs + (address & 0x06))) = data; - return; - - case 0xb00000: - case 0xb00002: - case 0xb00004: - *((UINT16*)(DrvB0Regs + (address & 0x06))) = data; - return; - - case 0xb80000: // protection status - does nothing - return; - - case 0xc00000: - case 0xc00002: - case 0xc00004: - *((UINT16*)(DrvC0Regs + (address & 0x06))) = data; - return; - - case 0xc80000: - case 0xc80002: - case 0xc80004: - *((UINT16*)(DrvC8Regs + (address & 0x06))) = data; - return; - - case 0xe00000: -#ifdef ENABLE_SOUND_HARDWARE - ZetRun((SekTotalCycles() / 2) - ZetTotalCycles()); - *soundlatch = data & 0xff; - ZetNmi(); -#endif - return; - - case 0xe80000: - tecmosys_prot_data_write(data >> 8); - return; - } -} - -void __fastcall tecmosys_main_write_byte(UINT32 /*address*/, UINT8 /*data*/) -{ - -} - -UINT16 __fastcall tecmosys_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x880000: - return vblank; - - case 0xd00000: - return DrvInputs[0]; - - case 0xd00002: - return DrvInputs[1]; - - case 0xd80000: - return (EEPROMRead() & 1) << 11; - - case 0xf00000: -#ifdef ENABLE_SOUND_HARDWARE - ZetRun((SekTotalCycles() / 2) - ZetTotalCycles()); - return *soundlatch2; -#else - return 0; -#endif - - case 0xf80000: - INT32 ret = protection_value; - protection_value = 0xff; - return ret << 8; - } - - return 0; -} - -UINT8 __fastcall tecmosys_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xb80000: - return 0x00; // protection status - } - - return 0; -} - -static inline void palette_update(INT32 pal) -{ - UINT16 p = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + pal * 2))); - - INT32 r = (p >> 5) & 0x1f; - INT32 g = (p >> 10) & 0x1f; - INT32 b = (p >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[pal] = BurnHighCol(r, g, b, 0); - DrvPalette24[pal] = (r << 16) + (g << 8) + b; -} - -void __fastcall tecmosys_palette_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xff8000) == 0x900000) { - *((UINT16 *)(DrvPalRAM + 0x0000 + (address & 0x7ffe))) = BURN_ENDIAN_SWAP_INT16(data); - palette_update((0x0000 + (address & 0x7ffe)) / 2); - return; - } - - if ((address & 0xfff000) == 0x980000) { - *((UINT16 *)(DrvPalRAM + 0x8000 + (address & 0x0ffe))) = BURN_ENDIAN_SWAP_INT16(data); - palette_update((0x8000 + (address & 0x0ffe)) / 2); - return; - } -} - -void __fastcall tecmosys_palette_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xff8000) == 0x900000) { - DrvPalRAM[(0x0000 + (address & 0x7fff)) ^ 1] = data; - palette_update((0x0000 + (address & 0x7ffe)) / 2); - return; - } - - if ((address & 0xfff000) == 0x980000) { - DrvPalRAM[(0x8000 + (address & 0x0fff)) ^ 1] = data; - palette_update((0x8000 + (address & 0x0ffe)) / 2); - return; - } -} - -#ifdef ENABLE_SOUND_HARDWARE - -static void bankswitch(INT32 data) -{ - if ((data & 0x0f) != *DrvZ80Bank) { - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + (data & 0x0f) * 0x4000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + (data & 0x0f) * 0x4000); - } - - *DrvZ80Bank = data & 0x0f; -} - -static void oki_bankswitch(INT32 data) -{ - if ((data & 0x33) != *DrvOkiBank) { - - INT32 upperbank = (data & 0x30) >> 4; - INT32 lowerbank = (data & 0x03) >> 0; - - if (lowerbank != ((*DrvOkiBank & 0x0f) >> 0)) { - memcpy (DrvSndROM0 + 0x00000, DrvSndROM0 + 0x80000 + lowerbank * 0x20000, 0x20000); - } - - if (upperbank != ((*DrvOkiBank & 0xf0) >> 4)) { - memcpy (DrvSndROM0 +0x20000, DrvSndROM0 + 0x80000 + upperbank * 0x20000, 0x20000); - } - } - - *DrvOkiBank = data & 0x33; -} - -void __fastcall tecmosys_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - // ymf262_w - return; - - case 0x10: - MSM6295Command(0, data); - return; - - case 0x20: - oki_bankswitch(data); - return; - - case 0x30: - bankswitch(data); - return; - - case 0x50: - *soundlatch2 = data; - return; - - case 0x60: - YMZ280BSelectRegister(data); - return; - - case 0x61: - YMZ280BWriteRegister(data); - return; - } -} - -UINT8 __fastcall tecmosys_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: - return 0; // ymf262_r - - case 0x10: - return MSM6295ReadStatus(0); - - case 0x40: - return *soundlatch; - - case 0x60: - case 0x61: - return YMZ280BReadStatus(); - } - - return 0; -} - -/* -static void DrvIrqHandler(INT32 irq) // for ymf262 -{ - if (irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} -*/ - -#endif - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (AllRam, 0, RamEnd - AllRam); - } - - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - protection_reset(); - - watchdog = 0; - -#ifdef ENABLE_SOUND_HARDWARE - ZetOpen(0); - ZetReset(); - ZetClose(); - - // ymf262 - YMZ280BReset(); - MSM6295Reset(0); - - *DrvOkiBank = *DrvZ80Bank = ~0; -#endif - - return 0; -} - -#ifdef ENABLE_SOUND_HARDWARE -static INT32 MemIndex(INT32 sndlen) -#else -static INT32 MemIndex(INT32 /*sndlen*/) -#endif -{ - - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x200000; - DrvGfxROM2 = Next; Next += 0x200000; - DrvGfxROM3 = Next; Next += 0x200000; - -#ifdef ENABLE_SOUND_HARDWARE - DrvZ80ROM = Next; Next += 0x040000; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - - YMZ280BROM = Next; - DrvSndROM1 = Next; Next += sndlen; -#endif - - DrvPalette = (UINT32*)Next; Next += 0x4800 * sizeof(UINT32); - DrvPalette24 = (UINT32*)Next; Next += 0x4800 * sizeof(UINT32); - - DrvTmpSprites = (UINT16*)Next; Next += 320 * 240 * sizeof(UINT16); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvSprRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x009000; - - DrvTxtRAM = Next; Next += 0x004000; - - DrvBgRAM0 = Next; Next += 0x001000; - DrvBgScrRAM0 = Next; Next += 0x000400; - DrvBgRAM1 = Next; Next += 0x001000; - DrvBgScrRAM1 = Next; Next += 0x000400; - DrvBgRAM2 = Next; Next += 0x001000; - DrvBgScrRAM2 = Next; Next += 0x000400; - - -#ifdef ENABLE_SOUND_HARDWARE - DrvOkiBank = Next; Next += 0x000001; - DrvZ80Bank = Next; Next += 0x000001; - - DrvZ80RAM = Next; Next += 0x001800; - - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; -#endif - spritelist_select = Next; Next += 0x000001; - - Drv88Regs = Next; Next += 0x000004; - DrvA8Regs = Next; Next += 0x000006; - DrvB0Regs = Next; Next += 0x000006; - DrvC0Regs = Next; Next += 0x000006; - DrvC8Regs = Next; Next += 0x000006; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void descramble_sprites(INT32 len) -{ - UINT8 *src = DrvSprROM; - UINT8 tmp[4]; - - for (INT32 i=0; i < len; i+=4) - { - tmp[0] = ((src[i+2]&0xf0)>>0) | ((src[i+3]&0xf0)>>4); - tmp[1] = ((src[i+2]&0x0f)<<4) | ((src[i+3]&0x0f)>>0); - tmp[2] = ((src[i+0]&0xf0)>>0) | ((src[i+1]&0xf0)>>4); - tmp[3] = ((src[i+0]&0x0f)<<4) | ((src[i+1]&0x0f)<<0); - - memcpy (src + i, tmp, 4); - } -} - -static void expand_characters() -{ - for (INT32 i = 0x100000 - 1; i >= 0; i--) { - DrvGfxROM0[i * 2 + 0] = DrvGfxROM0[i] >> 4; - DrvGfxROM0[i * 2 + 1] = DrvGfxROM0[i] & 0x0f; - } -} - -static void expand_tiles(UINT8 *rom, INT32 len) -{ - INT32 Planes[4] = { 0, 1, 2, 3 }; - INT32 XOffs[16] = { 0x000, 0x004, 0x008, 0x00c, 0x010, 0x014, 0x018, 0x01c, 0x100, 0x104, 0x108, 0x10c, 0x110, 0x114, 0x118, 0x11c }; - INT32 YOffs[16] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - - memcpy (tmp, rom, len); - - GfxDecode((len * 2) / (16 * 16), 4, 16, 16, Planes, XOffs, YOffs, 128*8, tmp, rom); - - BurnFree (tmp); -} - -static INT32 CommonInit(INT32 (*pRomLoadCallback)(), INT32 spritelen, INT32 sndlen, const struct prot_data *dev_data_pointer, INT32 game) -{ - AllMem = NULL; - MemIndex(sndlen); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(sndlen); - - DrvSprROM = (UINT8*)BurnMalloc(spritelen); - if (DrvSprROM == NULL) return 1; - - if (pRomLoadCallback) { - if (pRomLoadCallback()) return 1; - } - - descramble_sprites(spritelen); - expand_characters(); - expand_tiles(DrvGfxROM1, 0x100000); - expand_tiles(DrvGfxROM2, 0x100000); - expand_tiles(DrvGfxROM3, 0x100000); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(DrvBgRAM0, 0x300000, 0x300fff, MAP_RAM); - SekMapMemory(DrvBgScrRAM0, 0x301000, 0x3013ff, MAP_RAM); - SekMapMemory(DrvBgRAM1, 0x400000, 0x400fff, MAP_RAM); - SekMapMemory(DrvBgScrRAM1, 0x401000, 0x4013ff, MAP_RAM); - SekMapMemory(DrvBgRAM2, 0x500000, 0x500fff, MAP_RAM); - SekMapMemory(DrvBgScrRAM2, 0x501000, 0x5013ff, MAP_RAM); - SekMapMemory(DrvTxtRAM, 0x700000, 0x703fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x900000, 0x907fff, MAP_ROM); - SekMapMemory(DrvPalRAM + 0x8000,0x980000, 0x980fff, MAP_ROM); - SekSetWriteWordHandler(0, tecmosys_main_write_word); - SekSetWriteByteHandler(0, tecmosys_main_write_byte); - SekSetReadWordHandler(0, tecmosys_main_read_word); - SekSetReadByteHandler(0, tecmosys_main_read_byte); - - SekMapHandler(1, 0x900000, 0x980fff, MAP_WRITE); - SekSetWriteWordHandler(1, tecmosys_palette_write_word); - SekSetWriteByteHandler(1, tecmosys_palette_write_byte); - SekClose(); - - deroon = game; - protection_data = dev_data_pointer; - - EEPROMInit(&eeprom_interface_93C46); - - BurnSetRefreshRate(57.4458); - -#ifdef ENABLE_SOUND_HARDWARE - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xe000, 0xf7ff, 0, DrvZ80RAM); - ZetMapArea(0xe000, 0xf7ff, 1, DrvZ80RAM); - ZetMapArea(0xe000, 0xf7ff, 2, DrvZ80RAM); - ZetSetOutHandler(tecmosys_sound_out); - ZetSetInHandler(tecmosys_sound_in); - ZetClose(); - - // ymf262 - - YMZ280BInit(16900000, NULL); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 0.30, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 0.30, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 2000000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); -#endif - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - EEPROMExit(); - - SekExit(); - -#ifdef ENABLE_SOUND_HARDWARE - ZetExit(); - - // ymf262 - - MSM6295Exit(0); - MSM6295ROM = NULL; - - YMZ280BExit(); - YMZ280BROM = NULL; -#endif - - BurnFree (DrvSprROM); - BurnFree (AllMem); - - return 0; -} - -static void draw_character_layer() -{ - UINT16 *vram = (UINT16*)DrvTxtRAM; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 1]) & 0x7fff; - INT32 color = attr & 0x003f; - INT32 flipy = attr & 0x0080; - INT32 flipx = attr & 0x0040; - - if (code == 0) continue; // Should save some cycles - - if (sx >= 0 && sx <= (nScreenWidth - 8) && sy >= 0 && sy <= (nScreenHeight - 8)) { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, 0xc400, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 4, 0, 0xc400, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 4, 0, 0xc400, DrvGfxROM0); - } else { - Render8x8Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, 0xc400, DrvGfxROM0); - } - } - } else { - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0xc400, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0xc400, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0xc400, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0xc400, DrvGfxROM0); - } - } - } - } -} - -static void draw_background_layer(UINT8 *ram, UINT8 *gfx, UINT8 *regs, INT32 yoff, INT32 xoff, INT32 priority) -{ - UINT16 *vram = (UINT16*)ram; - - INT32 scrollx = (*((UINT16*)(regs + 0)) + xoff) & 0x1ff; - INT32 scrolly = (*((UINT16*)(regs + 2)) + yoff) & 0x1ff; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= scrollx; - if (sx < -15) sx += 512; - sy -= scrolly; - if (sy < -15) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 0]); - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 1]) & 0x1fff; - INT32 color = attr & 0x003f; - INT32 flipy = attr & 0x0080; - INT32 flipx = attr & 0x0040; - - if (!code) continue; // Should save some cycles - - if (sx >= 0 && sx <= (nScreenWidth - 16) && sy >= 0 && sy <= (nScreenHeight - 16)) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, priority, gfx); - } else { - Render16x16Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 4, 0, priority, gfx); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 4, 0, priority, gfx); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, priority, gfx); - } - } - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, priority, gfx); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, priority, gfx); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, priority, gfx); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, priority, gfx); - } - } - } - } -} - -static void draw_sprite_zoomed(INT32 addr, INT32 color, INT32 x, INT32 y, INT32 flipx, INT32 flipy, INT32 xsize, INT32 ysize, INT32 zoomx, INT32 zoomy) -{ - if (y >= nScreenHeight || x >= nScreenWidth) return; - - INT32 drawx, drawy; - UINT8 *rom = DrvSprROM + addr; - - for (INT32 ycnt = 0; ycnt < ysize; ycnt++, rom += xsize) - { - if (flipy) - drawy = y + (((ysize * zoomy) / 256) - 1) - ((ycnt * zoomy) / 256); - else - drawy = y + ((ycnt * zoomy) / 256); - - if (drawy < 0 || drawy >= 240) continue; - - UINT16 *dstptr = DrvTmpSprites + drawy * nScreenWidth; - - for (INT32 xcnt = 0; xcnt < xsize; xcnt++) - { - if (flipx) - drawx = x + (((xsize * zoomx) / 256) - 1) - ((xcnt * zoomx) / 256); - else - drawx = x + ((xcnt * zoomx) / 256); - - if (drawx >= 0 && drawx < 320) - { - INT32 data = rom[xcnt]; - - if (data) dstptr[drawx] = data + color; - } - } - } -} - -static void draw_sprite_nozoom(INT32 addr, INT32 color, INT32 x, INT32 y, INT32 flipx, INT32 flipy, INT32 xsize, INT32 ysize) -{ - if (y >= nScreenHeight || x >= nScreenWidth) return; - - INT32 drawx, drawy; - UINT8 *rom = DrvSprROM + addr; - - for (INT32 ycnt = 0; ycnt < ysize; ycnt++, rom += xsize) - { - if (flipy) - drawy = y + (ysize - 1) - ycnt; - else - drawy = y + ycnt; - - if (drawy < 0 || drawy >= 240) continue; - - UINT16 *dstptr = DrvTmpSprites + drawy * nScreenWidth; - - if (x >= 0 && (x + xsize) < nScreenWidth) { - if (flipx) { - drawx = x + (xsize - 1); - - for (INT32 xcnt = 0; xcnt < xsize; xcnt++) - { - INT32 data = rom[xcnt]; - - if (data) dstptr[drawx - xcnt] = data + color; - } - } else { - dstptr += x; - - for (INT32 xcnt = 0; xcnt < xsize; xcnt++) - { - INT32 data = rom[xcnt]; - - if (data) dstptr[xcnt] = data + color; - } - } - } else { - for (INT32 xcnt = 0; xcnt < xsize; xcnt++) - { - if (flipx) - drawx = x + (xsize - 1) - xcnt; - else - drawx = x + xcnt; - - if (drawx >= 0 && drawx < 320) - { - INT32 data = rom[xcnt]; - - if (data) dstptr[drawx] = data + color; - } - } - } - } -} - -static void draw_sprites() -{ - INT32 extrax = (*((UINT16*)(Drv88Regs + 0))); - INT32 extray = (*((UINT16*)(Drv88Regs + 2))); - - memset (DrvTmpSprites, 0, 320 * 240 * sizeof(INT16)); - - UINT16 *spriteram = (UINT16*)(DrvSprRAM + (*spritelist_select * 0x4000)); - - for (INT32 i = 0; i < 0x4000/2; i+=8) - { - INT32 x = ((BURN_ENDIAN_SWAP_INT16(spriteram[i+0]) + 386) - extrax) & 0x3ff; - INT32 y = ((BURN_ENDIAN_SWAP_INT16(spriteram[i+1]) + 1) - extray) & 0x1ff; - INT32 zoomx = BURN_ENDIAN_SWAP_INT16(spriteram[i+2]) & 0x0fff; - INT32 zoomy = BURN_ENDIAN_SWAP_INT16(spriteram[i+3]) & 0x0fff; - INT32 prio =(BURN_ENDIAN_SWAP_INT16(spriteram[i+4]) & 0x0030) << 10; - INT32 flipx = BURN_ENDIAN_SWAP_INT16(spriteram[i+4]) & 0x0040; - INT32 flipy = BURN_ENDIAN_SWAP_INT16(spriteram[i+4]) & 0x0080; - INT32 color = BURN_ENDIAN_SWAP_INT16(spriteram[i+4]) & 0x3f00; - INT32 addr =(BURN_ENDIAN_SWAP_INT16(spriteram[i+5]) | ((BURN_ENDIAN_SWAP_INT16(spriteram[i+4]) & 0x000f) << 16)) << 8; - INT32 ysize =(BURN_ENDIAN_SWAP_INT16(spriteram[i+6]) & 0x00ff) << 4; - INT32 xsize =(BURN_ENDIAN_SWAP_INT16(spriteram[i+6]) & 0xff00) >> 4; - - if ((BURN_ENDIAN_SWAP_INT16(spriteram[i+4]) & 0x8000) || !zoomx || !zoomy) continue; - - if (x & 0x200) x -= 0x400; // positions are signed - if (y & 0x100) y -= 0x200; - - if (zoomx == 0x100 && zoomy == 0x100) { - draw_sprite_nozoom(addr, color + prio, x, y, flipx, flipy, xsize, ysize); - } else { - draw_sprite_zoomed(addr, color + prio, x, y, flipx, flipy, xsize, ysize, zoomx, zoomy); - } - } -} - -static void blend_sprites_and_transfer() -{ - UINT16 *srcptr = pTransDraw; - UINT16 *srcptr2 = DrvTmpSprites; - UINT8 *dstptr = pBurnDraw; - UINT16 *palram = (UINT16*)DrvPalRAM; - - for (INT32 z = 0; z < 320 * 240; z++) - { - if (!(srcptr2[z] & 0x3fff)) // tiles only, copy - { - PutPix(dstptr + z * nBurnBpp, DrvPalette[(srcptr[z] & 0x7ff) + 0x4000]); - continue; - } - - // check for blend/priority - - INT32 pxl =(srcptr [z] & 0x07ff) + 0x4000; - INT32 pxl2 =(srcptr2[z] & 0x3fff); - - if ((BURN_ENDIAN_SWAP_INT16(palram[pxl]) & 0x8000) && (BURN_ENDIAN_SWAP_INT16(palram[pxl2]) & 0x8000)) // blend - { - INT32 colour = DrvPalette24[pxl]; - INT32 colour2 = DrvPalette24[pxl2]; - - INT32 b = ((colour & 0x000000ff) + (colour2 & 0x000000ff)) >> 1; - INT32 g = ((colour & 0x0000ff00) + (colour2 & 0x0000ff00)) >> 9; - INT32 r = ((colour & 0x00ff0000) + (colour2 & 0x00ff0000)) >> 17; - - PutPix(dstptr + z * nBurnBpp, BurnHighCol(r, g, b, 0)); - } - else if ((srcptr2[z] & 0xc000) >= (srcptr[z] & 0xc000)) - { - PutPix(dstptr + z * nBurnBpp, DrvPalette[pxl2]); - } - else - { - PutPix(dstptr + z * nBurnBpp, DrvPalette[pxl]); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x9000/2; i++) { - palette_update(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (!deroon) { // deroon does not have tiles for this layer, so don't bother drawing it... - draw_background_layer(DrvBgRAM0, DrvGfxROM1, DrvC8Regs, 16, 104, 0x0000); - } - draw_background_layer(DrvBgRAM1, DrvGfxROM2, DrvA8Regs, 17, 106, 0x4000); - draw_background_layer(DrvBgRAM2, DrvGfxROM3, DrvB0Regs, 17, 106, 0x8000); - draw_character_layer(); - - blend_sprites_and_transfer(); - - draw_sprites(); // draw next frame's sprites - - return 0; -} - -static INT32 DrvFrame() -{ - SekNewFrame(); -#ifdef ENABLE_SOUND_HARDWARE - ZetNewFrame(); -#endif - - watchdog++; - if (watchdog >= 400) { //? - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - // clear opposites - if ((DrvInputs[0] & 0x03) == 0x00) DrvInputs[0] |= 0x03; - if ((DrvInputs[0] & 0x0c) == 0x00) DrvInputs[0] |= 0x0c; - if ((DrvInputs[1] & 0x03) == 0x00) DrvInputs[1] |= 0x03; - if ((DrvInputs[1] & 0x0c) == 0x00) DrvInputs[1] |= 0x0c; - } - - INT32 nSegment; - INT32 nInterleave = 256; -#ifdef ENABLE_SOUND_HARDWARE - INT32 nSoundBufferPos = 0; -#endif - INT32 nCyclesTotal[2] = { 1600000000 / 5745, 800000000 / 5745 }; // 57.4458hz - INT32 nCyclesDone[2] = { 0, 0 }; - - nCyclesTotal[0] = (INT32)((INT64)nCyclesTotal[0] * nBurnCPUSpeedAdjust / 0x0100); - nCyclesTotal[1] = (INT32)((INT64)nCyclesTotal[1] * nBurnCPUSpeedAdjust / 0x0100); - - SekOpen(0); -#ifdef ENABLE_SOUND_HARDWARE - ZetOpen(0); -#endif - - vblank = 1; - - for (INT32 i = 0; i < nInterleave; i++) - { - if (i == 240) { - vblank = 0; - SekSetIRQLine(1, CPU_IRQSTATUS_ACK); - } - - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - -#ifdef ENABLE_SOUND_HARDWARE - nCyclesDone[1] += ZetRun((SekTotalCycles() / 2) - ZetTotalCycles()); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - YMZ280BRender(pBurnSoundOut + nSoundBufferPos, nSegment); - MSM6295Render(0, pBurnSoundOut + nSoundBufferPos, nSegment); - - nSoundBufferPos += nSegment << 1; - } -#endif - } - - SekSetIRQLine(1, CPU_IRQSTATUS_NONE); - -#ifdef ENABLE_SOUND_HARDWARE - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - YMZ280BRender(pBurnSoundOut + nSoundBufferPos, nSegment); - MSM6295Render(0, pBurnSoundOut + nSoundBufferPos, nSegment); - } - } - - ZetClose(); -#endif - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - DrvRecalc = 1; - - if (nAction & ACB_MEMORY_ROM) { - ba.Data = Drv68KROM; - ba.nLen = 0x100000; - ba.nAddress = 0; - ba.szName = "68K ROM"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = Drv68KRAM; - ba.nLen = 0x010000; - ba.nAddress = 0x200000; - ba.szName = "68K RAM"; - BurnAcb(&ba); - - ba.Data = DrvBgRAM0; - ba.nLen = 0x0001000; - ba.nAddress = 0x300000; - ba.szName = "Background RAM"; - BurnAcb(&ba); - - ba.Data = DrvBgScrRAM0; - ba.nLen = 0x000400; - ba.nAddress = 0x301000; - ba.szName = "Background Scroll RAM"; - BurnAcb(&ba); - - ba.Data = DrvBgRAM1; - ba.nLen = 0x0001000; - ba.nAddress = 0x400000; - ba.szName = "Midground RAM"; - BurnAcb(&ba); - - ba.Data = DrvBgScrRAM1; - ba.nLen = 0x000400; - ba.nAddress = 0x401000; - ba.szName = "Midground Scroll RAM"; - BurnAcb(&ba); - - ba.Data = DrvBgRAM2; - ba.nLen = 0x0001000; - ba.nAddress = 0x500000; - ba.szName = "Foreground RAM"; - BurnAcb(&ba); - - ba.Data = DrvBgScrRAM2; - ba.nLen = 0x000400; - ba.nAddress = 0x501000; - ba.szName = "Foreground Scroll RAM"; - BurnAcb(&ba); - - ba.Data = DrvTxtRAM; - ba.nLen = 0x004000; - ba.nAddress = 0x700000; - ba.szName = "Text RAM"; - BurnAcb(&ba); - - ba.Data = DrvSprRAM; - ba.nLen = 0x001000; - ba.nAddress = 0x800000; - ba.szName = "Sprite RAM"; - BurnAcb(&ba); - - ba.Data = Drv88Regs; - ba.nLen = 0x000004; - ba.nAddress = 0x880000; - ba.szName = "880000 Registers"; - BurnAcb(&ba); - - ba.Data = DrvPalRAM; - ba.nLen = 0x008000; - ba.nAddress = 0x900000; - ba.szName = "Sprite Palette RAM"; - BurnAcb(&ba); - - ba.Data = DrvPalRAM; - ba.nLen = 0x001000; - ba.nAddress = 0x980000; - ba.szName = "Layer Palette RAM"; - BurnAcb(&ba); - - ba.Data = DrvA8Regs; - ba.nLen = 0x000006; - ba.nAddress = 0xa80000; - ba.szName = "A80000 Registers"; - BurnAcb(&ba); - - ba.Data = DrvB0Regs; - ba.nLen = 0x000006; - ba.nAddress = 0xb00000; - ba.szName = "B00000 Registers"; - BurnAcb(&ba); - - ba.Data = DrvC0Regs; - ba.nLen = 0x000006; - ba.nAddress = 0xc00000; - ba.szName = "C00000 Registers"; - BurnAcb(&ba); - - ba.Data = DrvC8Regs; - ba.nLen = 0x000006; - ba.nAddress = 0xc80000; - ba.szName = "C80000 Registers"; - BurnAcb(&ba); - -#ifdef ENABLE_SOUND_HARDWARE - ba.Data = DrvZ80RAM; - ba.nLen = 0x001800; - ba.nAddress = 0xff0000; - ba.szName = "Z80 RAM (Not accessible)"; - BurnAcb(&ba); -#endif - } - - if (nAction & ACB_DRIVER_DATA) { - - SekScan(nAction); -#ifdef ENABLE_SOUND_HARDWARE - ZetScan(nAction); - - // ymf262 - YMZ280BScan(); - MSM6295Scan(0, nAction); -#endif - - EEPROMScan(nAction, pnMin); - - SCAN_VAR(protection_read_pointer); - SCAN_VAR(protection_status); - SCAN_VAR(protection_value); - - } - - if (nAction & ACB_WRITE) { -#ifdef ENABLE_SOUND_HARDWARE - INT32 bank; - - ZetOpen(0); - bank = *DrvZ80Bank; - *DrvZ80Bank = ~0; - bankswitch(bank); - ZetClose(); - - bank = *DrvOkiBank; - *DrvOkiBank = ~0; - oki_bankswitch(*DrvOkiBank); -#endif - } - - return 0; -} - - -// Deroon DeroDero - -static struct BurnRomInfo deroonRomDesc[] = { - { "t001.upau1", 0x080000, 0x14b92c18, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "t002.upal1", 0x080000, 0x0fb05c68, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "t003.uz1", 0x040000, 0x8bdfafa0, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "t101.uah1", 0x200000, 0x74baf845, 3 | BRF_GRA }, // 3 Sprites - { "t102.ual1", 0x200000, 0x1a02c4a3, 3 | BRF_GRA }, // 4 - { "t103.ubl1", 0x400000, 0x84e7da88, 3 | BRF_GRA }, // 5 - { "t104.ucl1", 0x200000, 0x66eb611a, 3 | BRF_GRA }, // 6 - - { "t301.ubd1", 0x100000, 0x8b026177, 4 | BRF_GRA }, // 7 Character Tiles - - { "t201.ubb1", 0x100000, 0xd5a087ac, 6 | BRF_GRA }, // 8 Midground Layer - - { "t202.ubc1", 0x100000, 0xf051dae1, 7 | BRF_GRA }, // 9 Foreground Layer - - { "t401.uya1", 0x200000, 0x92111992, 8 | BRF_SND }, // 10 YMZ280B Samples - - { "t501.uad1", 0x080000, 0x2fbcfe27, 9 | BRF_SND }, // 11 OKI6295 Samples - - { "deroon_68hc11a8.rom", 0x002000, 0x00000000, 0 | BRF_NODUMP }, // 12 68HC11A8 Code - { "deroon_68hc11a8.eeprom", 0x000200, 0x00000000, 0 | BRF_NODUMP }, // 13 68HC11A8 EEPROM -}; - -STD_ROM_PICK(deroon) -STD_ROM_FN(deroon) - -static INT32 DeroonRomCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - -#ifdef ENABLE_SOUND_HARDWARE - if (BurnLoadRom(DrvZ80ROM + 0x0000000, 2, 1)) return 1; -#endif - - if (BurnLoadRom(DrvSprROM + 0x0000000, 3, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x0000001, 4, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x0800001, 5, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x1000001, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x0000000, 9, 1)) return 1; - -#ifdef ENABLE_SOUND_HARDWARE - if (BurnLoadRom(DrvSndROM1 + 0x0000000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x0080000, 11, 1)) return 1; -#endif - - return 0; -} - -static INT32 DeroonInit() -{ - return CommonInit(DeroonRomCallback, 0x2000000, 0x200000, &deroon_data, 1); -} - -struct BurnDriver BurnDrvDeroon = { - "deroon", NULL, NULL, NULL, "1995", - "Deroon DeroDero\0", "No sound", "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, deroonRomInfo, deroonRomName, NULL, NULL, DrvInputInfo, NULL, - DeroonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4800, - 320, 240, 4, 3 -}; - - -// Deroon DeroDero (alt set) -// maybe a bad dump - this set needs to be confirmed - -static struct BurnRomInfo deroonaRomDesc[] = { - { "t.01", 0x080000, 0x7ad6c740, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "t.02", 0x080000, 0xe44f4430, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "t003.bin", 0x040000, 0x8bdfafa0, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "t101.uah1", 0x200000, 0x74baf845, 3 | BRF_GRA }, // 3 Sprites - { "t102.ual1", 0x200000, 0x1a02c4a3, 3 | BRF_GRA }, // 4 - { "t103.ubl1", 0x400000, 0x84e7da88, 3 | BRF_GRA }, // 5 - { "t104.ucl1", 0x200000, 0x66eb611a, 3 | BRF_GRA }, // 6 - - { "t301.ubd1", 0x100000, 0x8b026177, 4 | BRF_GRA }, // 7 Character Tiles - - { "t201.ubb1", 0x100000, 0xd5a087ac, 6 | BRF_GRA }, // 8 Midground Layer - - { "t202.ubc1", 0x100000, 0xf051dae1, 7 | BRF_GRA }, // 9 Foreground Layer - - { "t401.uya1", 0x200000, 0x92111992, 8 | BRF_SND }, // 10 YMZ280B Samples - - { "t501.uad1", 0x080000, 0x2fbcfe27, 9 | BRF_SND }, // 11 OKI6295 Samples - - { "deroon_68hc11a8.rom", 0x002000, 0x00000000, 0 | BRF_NODUMP }, // 12 68HC11A8 Code - { "deroon_68hc11a8.eeprom", 0x000200, 0x00000000, 0 | BRF_NODUMP }, // 13 68HC11A8 EEPROM -}; - -STD_ROM_PICK(deroona) -STD_ROM_FN(deroona) - -struct BurnDriver BurnDrvDeroona = { - "deroona", "deroon", NULL, NULL, "1995", - "Deroon DeroDero (alt set)\0", "No sound", "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, deroonaRomInfo, deroonaRomName, NULL, NULL, DrvInputInfo, NULL, - DeroonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4800, - 320, 240, 4, 3 -}; - - -// Toukidenshou - Angel Eyes (VER. 960614) - -static struct BurnRomInfo tkdenshoRomDesc[] = { - { "aeprge-2.pal", 0x080000, 0x25e453d6, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "aeprgo-2.pau", 0x080000, 0x22d59510, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "aesprg-2.z1", 0x020000, 0x43550ab6, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ae100h.ah1", 0x400000, 0x06be252b, 3 | BRF_GRA }, // 3 Sprites - { "ae100.al1", 0x400000, 0x009cdff4, 3 | BRF_GRA }, // 4 - { "ae101h.bh1", 0x400000, 0xf2469eff, 3 | BRF_GRA }, // 5 - { "ae101.bl1", 0x400000, 0xdb7791bb, 3 | BRF_GRA }, // 6 - { "ae102h.ch1", 0x200000, 0xf9d2a343, 3 | BRF_GRA }, // 7 - { "ae102.cl1", 0x200000, 0x681be889, 3 | BRF_GRA }, // 8 - { "ae104.el1", 0x400000, 0xe431b798, 3 | BRF_GRA }, // 9 - { "ae105.fl1", 0x400000, 0xb7f9ebc1, 3 | BRF_GRA }, // 10 - { "ae106.gl1", 0x200000, 0x7c50374b, 3 | BRF_GRA }, // 11 - - { "ae300w36.bd1", 0x080000, 0xe829f29e, 4 | BRF_GRA }, // 12 Character Tiles - - { "ae200w74.ba1", 0x100000, 0xc1645041, 5 | BRF_GRA }, // 13 Background Tiles - - { "ae201w75.bb1", 0x100000, 0x3f63bdff, 6 | BRF_GRA }, // 14 Midground Tiles - - { "ae202w76.bc1", 0x100000, 0x5cc857ca, 7 | BRF_GRA }, // 15 Foreground Tiles - - { "ae400t23.ya1", 0x200000, 0xc6ffb043, 8 | BRF_SND }, // 16 YMZ280B Samples - { "ae401t24.yb1", 0x200000, 0xd83f1a73, 8 | BRF_SND }, // 17 - - { "ae500w07.ad1", 0x080000, 0x3734f92c, 9 | BRF_SND }, // 18 OKI6295 Samples - - { "tkdensho_68hc11a8.rom", 0x002000, 0x00000000, 0 | BRF_NODUMP }, // 19 68HC11A8 Code - { "tkdensho_68hc11a8.eeprom", 0x000200, 0x00000000, 0 | BRF_NODUMP }, // 20 68HC11A8 EEPROM -}; - -STD_ROM_PICK(tkdensho) -STD_ROM_FN(tkdensho) - -static INT32 TkdenshoRomCallback() -{ - if (BurnLoadRom(Drv68KROM + 0x0000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x0000000, 1, 2)) return 1; - -#ifdef ENABLE_SOUND_HARDWARE - if (BurnLoadRom(DrvZ80ROM + 0x0000000, 2, 1)) return 1; - memcpy (DrvZ80ROM + 0x20000, DrvZ80ROM, 0x20000); -#endif - - if (BurnLoadRom(DrvSprROM + 0x0000000, 3, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x0000001, 4, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x0800000, 5, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x0800001, 6, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x1000000, 7, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x1000001, 8, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x2000001, 9, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x2800001, 10, 2)) return 1; - if (BurnLoadRom(DrvSprROM + 0x3000001, 11, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000000, 12, 1)) return 1; - memcpy (DrvGfxROM0 + 0x80000, DrvGfxROM0, 0x80000); // double here rather than mask later - - if (BurnLoadRom(DrvGfxROM1 + 0x0000000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000000, 14, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x0000000, 15, 1)) return 1; - -#ifdef ENABLE_SOUND_HARDWARE - if (BurnLoadRom(DrvSndROM1 + 0x0000000, 16, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x0200000, 17, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x0080000, 18, 1)) return 1; -#endif - - return 0; -} - -static INT32 TkdenshoInit() -{ - return CommonInit(TkdenshoRomCallback, 0x4000000, 0x400000, &tkdensho_data, 0); -} - -struct BurnDriver BurnDrvTkdensho = { - "tkdensho", NULL, NULL, NULL, "1996", - "Toukidenshou - Angel Eyes (VER. 960614)\0", "No sound", "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, tkdenshoRomInfo, tkdenshoRomName, NULL, NULL, DrvInputInfo, NULL, - TkdenshoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4800, - 320, 240, 4, 3 -}; - - -// Toukidenshou - Angel Eyes (VER. 960427) - -static struct BurnRomInfo tkdenshoaRomDesc[] = { - { "aeprge.pal", 0x080000, 0x17a209ff, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "aeprgo.pau", 0x080000, 0xd265e6a1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "aesprg-2.z1", 0x020000, 0x43550ab6, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "ae100h.ah1", 0x400000, 0x06be252b, 3 | BRF_GRA }, // 3 Sprites - { "ae100.al1", 0x400000, 0x009cdff4, 3 | BRF_GRA }, // 4 - { "ae101h.bh1", 0x400000, 0xf2469eff, 3 | BRF_GRA }, // 5 - { "ae101.bl1", 0x400000, 0xdb7791bb, 3 | BRF_GRA }, // 6 - { "ae102h.ch1", 0x200000, 0xf9d2a343, 3 | BRF_GRA }, // 7 - { "ae102.cl1", 0x200000, 0x681be889, 3 | BRF_GRA }, // 8 - { "ae104.el1", 0x400000, 0xe431b798, 3 | BRF_GRA }, // 9 - { "ae105.fl1", 0x400000, 0xb7f9ebc1, 3 | BRF_GRA }, // 10 - { "ae106.gl1", 0x200000, 0x7c50374b, 3 | BRF_GRA }, // 11 - - { "ae300w36.bd1", 0x080000, 0xe829f29e, 4 | BRF_GRA }, // 12 Character Tiles - - { "ae200w74.ba1", 0x100000, 0xc1645041, 5 | BRF_GRA }, // 13 Background Tiles - - { "ae201w75.bb1", 0x100000, 0x3f63bdff, 6 | BRF_GRA }, // 14 Midground Tiles - - { "ae202w76.bc1", 0x100000, 0x5cc857ca, 7 | BRF_GRA }, // 15 Foreground Tiles - - { "ae400t23.ya1", 0x200000, 0xc6ffb043, 8 | BRF_SND }, // 16 YMZ280B Samples - { "ae401t24.yb1", 0x200000, 0xd83f1a73, 8 | BRF_SND }, // 17 - - { "ae500w07.ad1", 0x080000, 0x3734f92c, 9 | BRF_SND }, // 18 OKI6295 Samples - - { "tkdensho_68hc11a8.rom", 0x002000, 0x00000000, 0 | BRF_NODUMP }, // 19 68HC11A8 Code - { "tkdensho_68hc11a8.eeprom", 0x000200, 0x00000000, 0 | BRF_NODUMP }, // 20 68HC11A8 EEPROM -}; - -STD_ROM_PICK(tkdenshoa) -STD_ROM_FN(tkdenshoa) - -static INT32 TkdenshoaInit() -{ - return CommonInit(TkdenshoRomCallback, 0x4000000, 0x400000, &tkdenshoa_data, 0); -} - -struct BurnDriver BurnDrvTkdenshoa = { - "tkdenshoa", "tkdensho", NULL, NULL, "1996", - "Toukidenshou - Angel Eyes (VER. 960427)\0", "No sound", "Tecmo", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, tkdenshoaRomInfo, tkdenshoaRomName, NULL, NULL, DrvInputInfo, NULL, - TkdenshoaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x4800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_tetrisp2.cpp b/jan/src/burn/drv/pst90s/d_tetrisp2.cpp deleted file mode 100644 index c7176b703..000000000 --- a/jan/src/burn/drv/pst90s/d_tetrisp2.cpp +++ /dev/null @@ -1,1729 +0,0 @@ -// FB Alpha Tetris Plus driver module -// Based on MAME driver by Luca Elia - -/* - To do: - clean ups - nndmseal screen upside-down (game doesn't work, so who cares?) - Stepping Stage (also doesn't work) - Rock'n MegaSession (Japan) -*/ - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "ymz280b.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM0; -static UINT8 *Drv68KRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVFgRAM; -static UINT8 *DrvVBgRAM; -static UINT8 *DrvPriRAM; -static UINT8 *DrvRotRAM; -static UINT8 *DrvNvRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvFgScr; -static UINT8 *DrvBgScr; -static UINT8 *DrvRotReg; -static UINT8 *DrvSysReg; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static INT32 watchdog; -static INT32 game; - -static UINT8 nndmseal_bank_lo; -static UINT8 nndmseal_bank_hi; -static UINT8 rockn_adpcmbank; -static INT32 rockn_adpcmbank_max; -static UINT8 rockn_soundvolume; -static UINT8 rockn_protectdata; -static INT32 rockn_14_timer = -1; -static INT32 rockn_14_timer_countdown = 0; - -static struct BurnInputInfo Tetrisp2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 10, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 11, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tetrisp2) - -static struct BurnInputInfo RocknInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 6, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Rockn) - -static struct BurnInputInfo NndmsealInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p1 coin" }, - {"Print 1 (Start)", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"Print 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P1 -", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"P1 +", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2" }, - {"P1 OK", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 3" }, - {"P1 Cancel", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 5, "service" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Nndmseal) - -static struct BurnDIPInfo Tetrisp2DIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xf7, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "5 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x01, "4 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x02, "3 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x03, "2 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits " }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits " }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits " }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "5 Coins 1 Credits " }, - {0x14, 0x01, 0x38, 0x08, "4 Coins 1 Credits " }, - {0x14, 0x01, 0x38, 0x10, "3 Coins 1 Credits " }, - {0x14, 0x01, 0x38, 0x18, "2 Coins 1 Credits " }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits " }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits " }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits " }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits " }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x00, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x02, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Vs Mode Rounds" }, - {0x15, 0x01, 0x04, 0x00, "1" }, - {0x15, 0x01, 0x04, 0x04, "3" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x15, 0x01, 0x08, 0x08, "Japanese" }, - {0x15, 0x01, 0x08, 0x00, "English" }, - - {0 , 0xfe, 0 , 2, "F.B.I Logo" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Voice" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Tetrisp2) - -static struct BurnDIPInfo Tetrisp2jDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x14, 0x01, 0x07, 0x00, "5 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x01, "4 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x02, "3 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x03, "2 Coins 1 Credits " }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credits " }, - {0x14, 0x01, 0x07, 0x06, "1 Coin 2 Credits " }, - {0x14, 0x01, 0x07, 0x05, "1 Coin 3 Credits " }, - {0x14, 0x01, 0x07, 0x04, "1 Coin 4 Credits " }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x14, 0x01, 0x38, 0x00, "5 Coins 1 Credits " }, - {0x14, 0x01, 0x38, 0x08, "4 Coins 1 Credits " }, - {0x14, 0x01, 0x38, 0x10, "3 Coins 1 Credits " }, - {0x14, 0x01, 0x38, 0x18, "2 Coins 1 Credits " }, - {0x14, 0x01, 0x38, 0x38, "1 Coin 1 Credits " }, - {0x14, 0x01, 0x38, 0x30, "1 Coin 2 Credits " }, - {0x14, 0x01, 0x38, 0x28, "1 Coin 3 Credits " }, - {0x14, 0x01, 0x38, 0x20, "1 Coin 4 Credits " }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x00, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x02, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Vs Mode Rounds" }, - {0x15, 0x01, 0x04, 0x00, "1" }, - {0x15, 0x01, 0x04, 0x04, "3" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x15, 0x01, 0x08, 0x08, "Japanese" }, - {0x15, 0x01, 0x08, 0x00, "English (buggy!)" }, - - {0 , 0xfe, 0 , 2, "Voice" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x00, "Off" }, - {0x15, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Tetrisp2j) - -static struct BurnDIPInfo RocknDIPList[]= -{ - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 1, "Service Mode" }, - {0x0c, 0x01, 0x10, 0x10, "Off" }, - {0x0c, 0x01, 0x10, 0x00, "On" }, -}; - -STDDIPINFO(Rockn) - -static struct BurnDIPInfo NndmsealDIPList[]= -{ - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Time?" }, - {0x0a, 0x01, 0x40, 0x00, "35" }, - {0x0a, 0x01, 0x40, 0x40, "45" }, - - {0 , 0xfe, 0 , 16, "Coinage" }, - {0x0b, 0x01, 0x0f, 0x0f, "0" }, - {0x0b, 0x01, 0x0f, 0x0e, "1" }, - {0x0b, 0x01, 0x0f, 0x0d, "2" }, - {0x0b, 0x01, 0x0f, 0x0c, "3" }, - {0x0b, 0x01, 0x0f, 0x0b, "4" }, - {0x0b, 0x01, 0x0f, 0x0a, "5" }, - {0x0a, 0x01, 0x0f, 0x09, "6" }, - {0x0b, 0x01, 0x0f, 0x08, "7" }, - {0x0b, 0x01, 0x0f, 0x07, "8" }, - {0x0b, 0x01, 0x0f, 0x06, "9" }, - {0x0b, 0x01, 0x0f, 0x05, "a" }, - {0x0b, 0x01, 0x0f, 0x04, "b" }, - {0x0b, 0x01, 0x0f, 0x03, "c" }, - {0x0b, 0x01, 0x0f, 0x02, "d" }, - {0x0b, 0x01, 0x0f, 0x01, "e" }, - {0x0b, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0b, 0x01, 0x10, 0x00, "Off" }, - {0x0b, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0b, 0x01, 0x80, 0x80, "Off" }, - {0x0b, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Nndmseal) - -static inline void palette_update(INT32 offset) -{ - if (offset & 2) return; // every other word - - offset &= 0x1fffc; - - INT32 p = *((UINT16*)(DrvPalRAM + offset)) >> 1; - - UINT8 r,g,b; - - r = p & 0x1f; - g = (p >> 5) & 0x1f; - b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/4] = BurnHighCol(r, g, b, 0); -} - -static void rockn_adpcmbankswitch(INT32 data) -{ - rockn_adpcmbank = data; - - INT32 bank = ((data & 0x001c) >> 2); - - if (bank > 7) - { - bank = 0; - } - - memcpy (DrvSndROM + 0x0400000, DrvSndROM + 0x1000000 + (0x0c00000 * bank), 0x0c00000); -} - -static void rockn2_adpcmbankswitch(INT32 data) -{ - INT32 bank; - - char banktable[9][3]= - { - { 0, 1, 2 }, // bank $00 - { 3, 4, 5 }, // bank $04 - { 6, 7, 8 }, // bank $08 - { 9, 10, 11 }, // bank $0c - { 12, 13, 14 }, // bank $10 - { 15, 16, 17 }, // bank $14 - { 18, 19, 20 }, // bank $18 - { 0, 0, 0 }, // bank $1c - { 0, 5, 14 }, // bank $20 - }; - - rockn_adpcmbank = data; - - bank = ((data & 0x003f) >> 2); - - if (bank > 8) - { - bank = 0; - } - - memcpy (DrvSndROM + 0x0400000, DrvSndROM + 0x1000000 + (0x0400000 * banktable[bank][0]), 0x0400000); - memcpy (DrvSndROM + 0x0800000, DrvSndROM + 0x1000000 + (0x0400000 * banktable[bank][1]), 0x0400000); - memcpy (DrvSndROM + 0x0c00000, DrvSndROM + 0x1000000 + (0x0400000 * banktable[bank][2]), 0x0400000); -} - -static void nndmseal_sound_bankswitch(INT32 data) -{ - if (data & 0x04) - { - nndmseal_bank_lo = data & 0x03; - - memcpy(DrvSndROM, DrvSndROM + 0x40000 + (nndmseal_bank_lo * 0x80000), 0x20000); - } - else - { - nndmseal_bank_hi = data & 0x03; - - memcpy(DrvSndROM + 0x20000, DrvSndROM + 0x40000 + (nndmseal_bank_lo * 0x80000) + (nndmseal_bank_hi * 0x20000), 0x20000); - } -} - -static void __fastcall tetrisp2_write_word(UINT32 address, UINT16 data) -{ -// bprintf (0, _T("WW: %5.5x, %4.4x\n"), address, data); - - if ((address & 0xfc0000) == 0x200000) { - DrvPriRAM[(address & 0x3fffe)/2] = data; - return; - } - - if ((address & 0xfe0000) == 0x300000) { - *((UINT16*)(DrvPalRAM + (address & 0x1fffe))) = data; - palette_update(address & 0x1fffe); - return; - } - - if ((address & 0xfffff0) == 0xb40000) { - *((UINT16*)(DrvFgScr + (address & 0x0e))) = data; - return; - } - - if ((address & 0xfffff0) == 0xb40010) { - *((UINT16*)(DrvBgScr + (address & 0x0e))) = data; - return; - } - - if (address >= 0xb60000 && address <= 0xb6002f) { - *((UINT16*)(DrvRotReg + (address & 0x3e))) = data; - return; - } - - if ((address & 0xffffe0) == 0xba0000) - { - if (address == 0xba0018) - { - rockn_14_timer = (0x1000 - data) * 6000; - rockn_14_timer_countdown = rockn_14_timer / 6000; - } - - *((UINT16*)(DrvSysReg + (address & 0x1e))) = data; - return; - } - - switch (address) - { - case 0x800000: - if (game == 3) { - MSM6295Command(0, data); - } else { - YMZ280BSelectRegister(data); - } - return; - - case 0x800002: - if (game != 3) { - YMZ280BWriteRegister(data); - } - return; - - case 0xa30000: - rockn_soundvolume = data; - return; - - case 0xa40000: // rockn1 - YMZ280BSelectRegister(data); - return; - - case 0xa40002: // rockn1 - YMZ280BWriteRegister(data); - return; - - case 0xa44000: - if (game == 2) rockn2_adpcmbankswitch(data); - if (game == 1) rockn_adpcmbankswitch(data); - return; - - case 0xb00000: // coincounter - return; - - case 0xb80000: - if (game == 3) nndmseal_sound_bankswitch(data); - return; - } -} - -static void __fastcall tetrisp2_write_byte(UINT32 address, UINT8 data) -{ -// bprintf (0, _T("WB: %5.5x, %2.2x\n"), address, data); - - if ((address & 0xfc0000) == 0x200000) { - DrvPriRAM[(address & 0x3fffe)/2] = data; - return; - } - - if ((address & 0xfe0000) == 0x300000) { - DrvPalRAM[(address & 0x1ffff)^1] = data; - palette_update(address & 0x1fffe); - return; - } - - if ((address & 0xff8000) == 0x900000) { - DrvNvRAM[(address & 0x003ffe)+0] = data; - DrvNvRAM[(address & 0x003ffe)+1] = data; - return; - } - - bprintf (0, _T("WB: %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall tetrisp2_read_word(UINT32 address) -{ -// bprintf (0, _T("RW: %5.5x\n"), address); - - if ((address & 0xfc0000) == 0x200000) { - return DrvPriRAM[(address & 0x3fffe)/2] | 0xff00; - } - - if ((address & 0xfffff0) == 0xb40000) { - return *((UINT16*)(DrvFgScr + (address & 0x0e))); - } - - if ((address & 0xfffff0) == 0xb40010) { - return *((UINT16*)(DrvBgScr + (address & 0x0e))); - } - - if (address >= 0xb60000 && address <= 0xb6002f) { - return *((UINT16*)(DrvRotReg + (address & 0x3e))); - } - - if ((address & 0xffffe0) == 0xba0000) { - return *((UINT16*)(DrvSysReg + (address & 0x1e))); - } - - switch (address) - { - case 0x800000: - case 0x800002: - if (game == 3) return MSM6295ReadStatus(0); - return YMZ280BReadStatus(); - - case 0xa30000: // rockn1 sound volume - return 0xffff; - - case 0xa40000: // rockn1 - case 0xa40002: - return YMZ280BReadStatus(); - - case 0xa44000: - return ((rockn_adpcmbank & 0xf0ff) | (rockn_protectdata << 8)); - - case 0xbe0000: - return 0; // nop - - case 0xbe0002: - if (game == 1) return DrvInputs[0] ^ 0x0030; - return DrvInputs[0]; - - case 0xbe0004: - if (game == 3) return DrvInputs[1]; // nndmseal - if (game == 1) return (DrvInputs[1] & ~0x0010) | (DrvDips[2] & 0x10); - return (DrvInputs[1] & 0xfcff) | (BurnRandom() & 0x0300) | (1 << ((BurnRandom() & 1) + 8)); - - case 0xbe0006: - return (DrvInputs[2] & 0xfffb); // nndmseal, bit 2 must be high! - - case 0xbe0008: - return (DrvDips[1] << 8) | DrvDips[0]; - - case 0xbe000a: - watchdog = 0; - return 0; - } - - return 0; -} - -static UINT8 __fastcall tetrisp2_read_byte(UINT32 address) -{ - bprintf (0, _T("RB: %5.5x\n"), address); - - return 0; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (AllRam, 0, RamEnd - AllRam); - } - - SekOpen(0); - SekReset(); - SekClose(); - - if (game == 3) { - MSM6295Reset(0); - } else { - YMZ280BReset(); - } - - watchdog = 0; - - rockn_adpcmbank = 0; - rockn_soundvolume = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - - DrvGfxROM0 = Next; Next += 0x800000; - DrvGfxROM1 = Next; Next += 0x800000; - DrvGfxROM2 = DrvGfxROM1 + 0x400000; - DrvGfxROM3 = Next; Next += 0x080000; - - MSM6295ROM = Next; - YMZ280BROM = Next; - DrvSndROM = Next; Next += 0x7000000; - - DrvPalette = (UINT32*)Next; Next += 0x8000 * sizeof(int); - - AllRam = Next; - - Drv68KRAM0 = Next; Next += 0x00c000; - Drv68KRAM1 = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x020000; - - DrvVFgRAM = Next; Next += 0x004000; - DrvVBgRAM = Next; Next += 0x006000; - - DrvPriRAM = Next; Next += 0x040000; - DrvRotRAM = Next; Next += 0x010000; - DrvNvRAM = Next; Next += 0x004000; - - DrvSprRAM = Next; Next += 0x004000; - - DrvFgScr = Next; Next += 0x000010; - DrvBgScr = Next; Next += 0x000010; - DrvRotReg = Next; Next += 0x000040; - DrvSysReg = Next; Next += 0x000020; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static tilemap_callback( rtlayer ) -{ - UINT16 *ram = (UINT16*)DrvRotRAM; - - TILE_SET_INFO(2, ram[offs * 2 + 0], ram[offs * 2 + 1] & 0x000f, 0); -} - -static tilemap_callback( bglayer ) -{ - UINT16 *ram = (UINT16*)DrvVBgRAM; - - TILE_SET_INFO(1, ram[offs * 2 + 0], ram[offs * 2 + 1] & 0x000f, 0); -} - -static tilemap_callback( fglayer ) -{ - UINT16 *ram = (UINT16*)DrvVFgRAM; - - TILE_SET_INFO(3, ram[offs * 2 + 0], ram[offs * 2 + 1] & 0x000f, 0); -} - -static INT32 Tetrisp2Init() -{ - game = 0; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 3, 2)) return 1; - - for (INT32 i = 0; i < 0x800000; i+=4) { - BurnByteswap(DrvGfxROM0 + i + 1, 2); - } - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x400000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 7, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x104000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x300000, 0x31ffff, MAP_ROM); // palette - SekMapMemory(DrvVFgRAM, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(DrvVBgRAM, 0x404000, 0x409fff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x650000, 0x651fff, MAP_RAM); // mirror - SekMapMemory(DrvNvRAM, 0x900000, 0x903fff, MAP_ROM); // handler - SekMapMemory(DrvNvRAM, 0x904000, 0x907fff, MAP_ROM); // handler - SekSetWriteWordHandler(0, tetrisp2_write_word); - SekSetWriteByteHandler(0, tetrisp2_write_byte); - SekSetReadWordHandler(0, tetrisp2_read_word); - SekSetReadByteHandler(0, tetrisp2_read_byte); - SekClose(); - - YMZ280BInit(16934400, NULL); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, rtlayer_map_callback, 16, 16, 128, 128); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, bglayer_map_callback, 16, 16, 64, 64); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, fglayer_map_callback, 8, 8, 64, 64); - GenericTilemapSetGfx(1, DrvGfxROM1, 8, 16, 16, 0x800000, 0x1000, 0xf); - GenericTilemapSetGfx(2, DrvGfxROM2, 8, 16, 16, 0x400000, 0x2000, 0xf); - GenericTilemapSetGfx(3, DrvGfxROM3, 8, 8, 8, 0x080000, 0x6000, 0xf); - GenericTilemapSetTransparent(0, 0); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetTransparent(2, 0); - - DrvDoReset(1); - - return 0; -} - -static INT32 RocknInit() -{ - game = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 2)) return 1; - - for (INT32 i = 0; i < 0x400000; i+=4) { - BurnByteswap(DrvGfxROM0 + i + 1, 2); - } - - memcpy (DrvGfxROM0 + 0x400000, DrvGfxROM0, 0x400000); - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x400000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 7, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x1000000, 8, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x1400000, 9, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x1800000, 10, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x1c00000, 11, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x2000000, 12, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x2400000, 13, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x2800000, 14, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x2c00000, 15, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x3000000, 16, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x3400000, 17, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x3800000, 18, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x3c00000, 19, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x4000000, 20, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x4400000, 21, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x104000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x300000, 0x31ffff, MAP_ROM); // palette - SekMapMemory(DrvVFgRAM, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(DrvVBgRAM, 0x404000, 0x409fff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x650000, 0x651fff, MAP_RAM); // mirror - SekMapMemory(DrvNvRAM, 0x900000, 0x903fff, MAP_RAM); - SekSetWriteWordHandler(0, tetrisp2_write_word); - SekSetWriteByteHandler(0, tetrisp2_write_byte); - SekSetReadWordHandler(0, tetrisp2_read_word); - SekSetReadByteHandler(0, tetrisp2_read_byte); - SekClose(); - - rockn_protectdata = 1; - rockn_adpcmbank_max = (0x4800000 - 0x1000000) / 0xc00000; - - YMZ280BInit(16934400, NULL); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, rtlayer_map_callback, 16, 16, 128, 128); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, bglayer_map_callback, 16, 16, 256, 16); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, fglayer_map_callback, 8, 8, 64, 64); - GenericTilemapSetGfx(1, DrvGfxROM1, 8, 16, 16, 0x800000, 0x1000, 0xf); - GenericTilemapSetGfx(2, DrvGfxROM2, 8, 16, 16, 0x400000, 0x2000, 0xf); - GenericTilemapSetGfx(3, DrvGfxROM3, 8, 8, 8, 0x080000, 0x6000, 0xf); - GenericTilemapSetTransparent(0, 0); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetTransparent(2, 0); - - DrvDoReset(1); - - return 0; -} - -static INT32 NndmsealInit() -{ - game = 3; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - memset (DrvGfxROM0, 0, 0x400000); - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x200000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x400000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x040000, 6, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x104000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x300000, 0x31ffff, MAP_ROM); // palette - SekMapMemory(DrvVFgRAM, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(DrvVBgRAM, 0x404000, 0x409fff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x650000, 0x651fff, MAP_RAM); // mirror - SekMapMemory(DrvNvRAM, 0x900000, 0x903fff, MAP_ROM); // handler - SekMapMemory(DrvNvRAM, 0x904000, 0x907fff, MAP_ROM); // handler - SekSetWriteWordHandler(0, tetrisp2_write_word); - SekSetWriteByteHandler(0, tetrisp2_write_byte); - SekSetReadWordHandler(0, tetrisp2_read_word); - SekSetReadByteHandler(0, tetrisp2_read_byte); - SekClose(); - - MSM6295Init(0, 2000000 / 132, 0); - MSM6295SetRoute(0, 1.0, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, rtlayer_map_callback, 16, 16, 128, 128); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, bglayer_map_callback, 16, 16, 64, 64); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, fglayer_map_callback, 8, 8, 64, 64); - GenericTilemapSetGfx(1, DrvGfxROM1, 8, 16, 16, 0x800000, 0x1000, 0xf); - GenericTilemapSetGfx(2, DrvGfxROM2, 8, 16, 16, 0x400000, 0x2000, 0xf); - GenericTilemapSetGfx(3, DrvGfxROM3, 8, 8, 8, 0x080000, 0x6000, 0xf); - GenericTilemapSetTransparent(0, 0); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetTransparent(2, 0); - - DrvDoReset(1); - - return 0; -} - -static INT32 NndmsealaInit() -{ - game = 3; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - memset (DrvGfxROM0, 0, 0x400000); - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x400000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x040000, 5, 1)) return 1; - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x104000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x300000, 0x31ffff, MAP_ROM); // palette - SekMapMemory(DrvVFgRAM, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(DrvVBgRAM, 0x404000, 0x409fff, MAP_RAM); - SekMapMemory(Drv68KRAM1, 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x650000, 0x651fff, MAP_RAM); // mirror - SekMapMemory(DrvNvRAM, 0x900000, 0x903fff, MAP_ROM); // handler - SekMapMemory(DrvNvRAM, 0x904000, 0x907fff, MAP_ROM); // handler - SekSetWriteWordHandler(0, tetrisp2_write_word); - SekSetWriteByteHandler(0, tetrisp2_write_byte); - SekSetReadWordHandler(0, tetrisp2_read_word); - SekSetReadByteHandler(0, tetrisp2_read_byte); - SekClose(); - - MSM6295Init(0, 2000000 / 132, 0); - MSM6295SetRoute(0, 1.0, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, rtlayer_map_callback, 16, 16, 128, 128); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, bglayer_map_callback, 16, 16, 64, 64); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, fglayer_map_callback, 8, 8, 64, 64); - GenericTilemapSetGfx(1, DrvGfxROM1, 8, 16, 16, 0x800000, 0x1000, 0xf); - GenericTilemapSetGfx(2, DrvGfxROM2, 8, 16, 16, 0x400000, 0x2000, 0xf); - GenericTilemapSetGfx(3, DrvGfxROM3, 8, 8, 8, 0x080000, 0x6000, 0xf); - GenericTilemapSetTransparent(0, 0); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetTransparent(2, 0); - - DrvDoReset(1); - - return 0; -} - -static INT32 Rockn2CommonInit(INT32 nSoundRoms) -{ - game = 2; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 2)) return 1; - - for (INT32 i = 0; i < 0x400000; i+=4) { - BurnByteswap(DrvGfxROM0 + i + 1, 2); - } - - memcpy (DrvGfxROM0 + 0x400000, DrvGfxROM0, 0x400000); - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x400000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x0000000, 7, 1)) return 1; - - for (INT32 i = 0; i < nSoundRoms - 1; i++) - { - if (BurnLoadRom(DrvSndROM + 0x1000000 + (i * 0x400000), 8 + i, 1)) return 1; - } - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvSprRAM, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(Drv68KRAM0, 0x104000, 0x10ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x300000, 0x31ffff, MAP_ROM); // palette - SekMapMemory(Drv68KRAM1, 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(DrvRotRAM, 0x650000, 0x651fff, MAP_RAM); // mirror - SekMapMemory(DrvVFgRAM, 0x800000, 0x803fff, MAP_RAM); - SekMapMemory(DrvVBgRAM, 0x804000, 0x809fff, MAP_RAM); - SekMapMemory(DrvNvRAM, 0x900000, 0x903fff, MAP_RAM); - SekSetWriteWordHandler(0, tetrisp2_write_word); - SekSetWriteByteHandler(0, tetrisp2_write_byte); - SekSetReadWordHandler(0, tetrisp2_read_word); - SekSetReadByteHandler(0, tetrisp2_read_byte); - SekClose(); - - YMZ280BInit(16934400, NULL); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, rtlayer_map_callback, 16, 16, 128, 128); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, bglayer_map_callback, 16, 16, 256, 16); - GenericTilemapInit(2, TILEMAP_SCAN_ROWS, fglayer_map_callback, 8, 8, 64, 64); - GenericTilemapSetGfx(1, DrvGfxROM1, 8, 16, 16, 0x800000, 0x1000, 0xf); - GenericTilemapSetGfx(2, DrvGfxROM2, 8, 16, 16, 0x400000, 0x2000, 0xf); - GenericTilemapSetGfx(3, DrvGfxROM3, 8, 8, 8, 0x080000, 0x6000, 0xf); - GenericTilemapSetTransparent(0, 0); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetTransparent(2, 0); - - DrvDoReset(1); - - return 0; -} - -static INT32 Rockn2Init() -{ - rockn_protectdata = 2; - - return Rockn2CommonInit(22); -} - -static INT32 Rockn3Init() -{ - rockn_protectdata = 4; - - return Rockn2CommonInit(21); -} - -static INT32 Rockn4Init() -{ - rockn_protectdata = 4; - - return Rockn2CommonInit(10); -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - if (game == 3) { - MSM6295Exit(0); - } else { - YMZ280BExit(); - } - - SekExit(); - - BurnFree (AllMem); - - YMZ280BROM = NULL; - - return 0; -} - -static void draw_sprites(UINT8 *SpriteRAM, INT32 sprram_size) -{ - INT32 x, y, tx, ty, sx, sy, flipx, flipy; - INT32 xsize, ysize, xnum, ynum; - INT32 xstart, ystart, xend, yend, xinc, yinc; - INT32 code, attr, color, size; - UINT32 primask; - - UINT16 *sprram_top = (UINT16*)SpriteRAM; - UINT16 *source = sprram_top; - UINT16 *finish = sprram_top + (sprram_size - 0x10) / 2; - - UINT8 *priority_ram = DrvPriRAM; - -// INT32 flipscreen = *((UINT16*)(DrvSysReg + 0)) & 0x02; - - for (; source <= finish; source += 0x10/2 ) - { - attr = source[ 0 ]; - - if ((attr & 0x0004) == 0) continue; - - flipx = attr & 1; - flipy = attr & 2; - - code = source[ 1 ]; - color = source[ 2 ]; - - tx = (code >> 0) & 0xff; - ty = (code >> 8) & 0xff; - - code = (tx / 8) + (ty / 8) * (0x100/8) + (color & 0x7f) * (0x100/8) * (0x100/8); - - color = (color >> 12) & 0xf; - - size = source[ 3 ]; - - xsize = ((size >> 0) & 0xff) + 1; - ysize = ((size >> 8) & 0xff) + 1; - - xnum = ( ((tx + xsize) & ~7) + (((tx + xsize) & 7) ? 8 : 0) - (tx & ~7) ) / 8; - ynum = ( ((ty + ysize) & ~7) + (((ty + ysize) & 7) ? 8 : 0) - (ty & ~7) ) / 8; - - sy = source[ 4 ]; - sx = source[ 5 ]; - - sx = (sx & 0x3ff) - (sx & 0x400); - sy = (sy & 0x1ff) - (sy & 0x200); - - if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; sx -= xnum*8 - xsize - (tx & 7); } - else { xstart = 0; xend = xnum; xinc = +1; sx -= tx & 7; } - - if (flipy) { ystart = ynum-1; yend = -1; yinc = -1; sy -= ynum*8 - ysize - (ty & 7); } - else { ystart = 0; yend = ynum; yinc = +1; sy -= ty & 7; } - - primask = 0; - if (priority_ram[((attr & 0x00f0) | 0x0a00 | 0x1500) / 2] & 0x38) primask |= 1 << 0; - if (priority_ram[((attr & 0x00f0) | 0x0a00 | 0x1400) / 2] & 0x38) primask |= 1 << 1; - if (priority_ram[((attr & 0x00f0) | 0x0a00 | 0x1100) / 2] & 0x38) primask |= 1 << 2; - if (priority_ram[((attr & 0x00f0) | 0x0a00 | 0x1000) / 2] & 0x38) primask |= 1 << 3; - if (priority_ram[((attr & 0x00f0) | 0x0a00 | 0x0500) / 2] & 0x38) primask |= 1 << 4; - if (priority_ram[((attr & 0x00f0) | 0x0a00 | 0x0400) / 2] & 0x38) primask |= 1 << 5; - if (priority_ram[((attr & 0x00f0) | 0x0a00 | 0x0100) / 2] & 0x38) primask |= 1 << 6; - if (priority_ram[((attr & 0x00f0) | 0x0a00 | 0x0000) / 2] & 0x38) primask |= 1 << 7; - - for (y = ystart; y != yend; y += yinc) - { - for (x = xstart; x != xend; x += xinc) - { - RenderPrioSprite(pTransDraw, DrvGfxROM0, code++, (color << 8), 0, sx + x * 8, sy + y * 8, flipx, flipy, 8, 8, primask); - } - - code += (0x100/8) - xnum; - } - } -} - -static INT32 Tetrisp2Draw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x20000; i++) { - palette_update(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); // black? - - INT32 flipscreen = *((UINT16*)(DrvSysReg + 0)) & 0x02; - - UINT16 *bgregs = (UINT16 *)DrvBgScr; - UINT16 *rtregs = (UINT16 *)DrvRotReg; - UINT16 *fgregs = (UINT16 *)DrvFgScr; - - INT32 asc_pri = 0; - INT32 scr_pri = 0; - INT32 rot_pri = 0; - - GenericTilemapSetFlip(TMAP_GLOBAL, (flipscreen) ? TMAP_FLIPXY : 0); - - GenericTilemapSetScrollX(0, (rtregs[0] - (flipscreen ? 0x53f : 0x400))); - GenericTilemapSetScrollY(0, (rtregs[2] - (flipscreen ? 0x4df : 0x400))); - GenericTilemapSetScrollX(1, (bgregs[0] + bgregs[2] + 0x14)); - GenericTilemapSetScrollY(1, (bgregs[3] + bgregs[5])); - GenericTilemapSetScrollX(2, (fgregs[2])); - GenericTilemapSetScrollY(2, (fgregs[5])); - - if(DrvPriRAM[0x2b00 / 2] == 0x34) - asc_pri++; - else - rot_pri++; - - if(DrvPriRAM[0x2e00 / 2] == 0x34) - asc_pri++; - else - scr_pri++; - - if(DrvPriRAM[0x3a00 / 2] == 0x0c) - scr_pri++; - else - rot_pri++; - - if (rot_pri == 0) - GenericTilemapDraw(0, pTransDraw, 2); // rot - else if (scr_pri == 0) - GenericTilemapDraw(1, pTransDraw, 1); // bg - else if (asc_pri == 0) - GenericTilemapDraw(2, pTransDraw, 4); // fg - - if (rot_pri == 1) - GenericTilemapDraw(0, pTransDraw, 2); // rot - else if (scr_pri == 1) - GenericTilemapDraw(1, pTransDraw, 1); // bg - else if (asc_pri == 1) - GenericTilemapDraw(2, pTransDraw, 4); // fg - - if (rot_pri == 2) - GenericTilemapDraw(0, pTransDraw, 2); // rot - else if (scr_pri == 2) - GenericTilemapDraw(1, pTransDraw, 1); // bg - else if (asc_pri == 2) - GenericTilemapDraw(2, pTransDraw, 4); // fg - - if (nBurnLayer & 8) draw_sprites(DrvSprRAM, 0x4000); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 Tetrisp2Frame() -{ - watchdog++; - if (watchdog >= 180) { - bprintf (0, _T("Watchdog!!!\n")); - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 4); - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - SekOpen(0); - SekRun(12000000 / 60); - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - YMZ280BRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static INT32 RocknFrame() -{ - watchdog++; - if (watchdog >= 180) { - bprintf (0, _T("Watchdog!!!\n")); - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 3 * sizeof(short)); - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - SekOpen(0); - for (INT32 i = 0; i < 33; i++) - { - SekRun(12000000 / 60 / 33); - - if (rockn_14_timer != -1) { - if (rockn_14_timer_countdown == 0) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - rockn_14_timer_countdown = rockn_14_timer / 6000; - } - rockn_14_timer_countdown--; - } - - if (i == 30 && GetCurrentFrame() & 1) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - SekClose(); - - if (pBurnSoundOut) { - if (game == 3) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } else { - YMZ280BRender(pBurnSoundOut, nBurnSoundLen); - } - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - - -// save states - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029732; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = MemEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - if (game == 3) { - MSM6295Scan(0, nAction); - } else { - YMZ280BScan(); - } - - SCAN_VAR(nndmseal_bank_lo); - SCAN_VAR(nndmseal_bank_hi); - SCAN_VAR(rockn_adpcmbank); - SCAN_VAR(rockn_soundvolume); - SCAN_VAR(rockn_14_timer); - SCAN_VAR(rockn_14_timer_countdown); - - BurnRandomScan(nAction); - } - - if (nAction & ACB_WRITE) { - if (game == 2) rockn2_adpcmbankswitch(rockn_adpcmbank); - if (game == 1) rockn_adpcmbankswitch(rockn_adpcmbank); - if (game == 3) { - nndmseal_sound_bankswitch(nndmseal_bank_lo | 0x04); - nndmseal_sound_bankswitch(nndmseal_bank_hi); - } - } - - return 0; -} - - -// Tetris Plus 2 (World) - -static struct BurnRomInfo tetrisp2RomDesc[] = { - { "tet2_4_ver2.8.ic59", 0x080000, 0xe67f9c51, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tet2_1_ver2.8.ic65", 0x080000, 0x5020a4ed, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "96019-01.9", 0x400000, 0x06f7dc64, 0x02 | BRF_GRA }, // 2 Sprites - { "96019-02.8", 0x400000, 0x3e613bed, 0x02 | BRF_GRA }, // 3 - - { "96019-06.13", 0x400000, 0x16f7093c, 0x03 | BRF_GRA }, // 4 Background and Rotation tiles - { "96019-04.6", 0x100000, 0xb849dec9, 0x03 | BRF_GRA }, // 5 - - { "tetp2-10.ic27", 0x080000, 0x34dd1bad, 0x04 | BRF_GRA }, // 6 Foreground Tiles - - { "96019-07.7", 0x400000, 0xa8a61954, 0x05 | BRF_SND }, // 7 YMZ280b Samples -}; - -STD_ROM_PICK(tetrisp2) -STD_ROM_FN(tetrisp2) - -struct BurnDriver BurnDrvTetrisp2 = { - "tetrisp2", NULL, NULL, NULL, "1997", - "Tetris Plus 2 (World)\0", NULL, "Jaleco / The Tetris Company", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, tetrisp2RomInfo, tetrisp2RomName, NULL, NULL, Tetrisp2InputInfo, Tetrisp2DIPInfo, - Tetrisp2Init, DrvExit, Tetrisp2Frame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 320, 224, 4, 3 -}; - - -// Tetris Plus 2 (Japan, V2.2) - -static struct BurnRomInfo tetrisp2jRomDesc[] = { - { "tet2_4_ver2.2.ic59", 0x080000, 0x5bfa32c8, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tet2_1_ver2.2.ic65", 0x080000, 0x919116d0, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "96019-01.9", 0x400000, 0x06f7dc64, 0x02 | BRF_GRA }, // 2 Sprites - { "96019-02.8", 0x400000, 0x3e613bed, 0x02 | BRF_GRA }, // 3 - - { "96019-06.13", 0x400000, 0x16f7093c, 0x03 | BRF_GRA }, // 4 Background and Rotation tiles - { "96019-04.6", 0x100000, 0xb849dec9, 0x03 | BRF_GRA }, // 5 - - { "tetp2-10.ic27", 0x080000, 0x34dd1bad, 0x04 | BRF_GRA }, // 6 Foreground Tiles - - { "96019-07.7", 0x400000, 0xa8a61954, 0x05 | BRF_SND }, // 7 YMZ280b Samples -}; - -STD_ROM_PICK(tetrisp2j) -STD_ROM_FN(tetrisp2j) - -struct BurnDriver BurnDrvTetrisp2j = { - "tetrisp2j", "tetrisp2", NULL, NULL, "1997", - "Tetris Plus 2 (Japan, V2.2)\0", NULL, "Jaleco / The Tetris Company", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, tetrisp2jRomInfo, tetrisp2jRomName, NULL, NULL, Tetrisp2InputInfo, Tetrisp2jDIPInfo, - Tetrisp2Init, DrvExit, Tetrisp2Frame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 320, 224, 4, 3 -}; - - -// Tetris Plus 2 (Japan, V2.1) - -static struct BurnRomInfo tetrisp2jaRomDesc[] = { - { "tet2_ic4_ver2.1.ic59", 0x080000, 0x5bfa32c8, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "tet2_ic1_ver2.1.ic65", 0x080000, 0x5b5f8377, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "96019-01.9", 0x400000, 0x06f7dc64, 0x02 | BRF_GRA }, // 2 Sprites - { "96019-02.8", 0x400000, 0x3e613bed, 0x02 | BRF_GRA }, // 3 - - { "96019-06.13", 0x400000, 0x16f7093c, 0x03 | BRF_GRA }, // 4 Background and Rotation tiles - { "96019-04.6", 0x100000, 0xb849dec9, 0x03 | BRF_GRA }, // 5 - - { "tetp2-10.ic27", 0x080000, 0x34dd1bad, 0x04 | BRF_GRA }, // 6 Foreground Tiles - - { "96019-07.7", 0x400000, 0xa8a61954, 0x05 | BRF_SND }, // 7 YMZ280b Samples -}; - -STD_ROM_PICK(tetrisp2ja) -STD_ROM_FN(tetrisp2ja) - -struct BurnDriver BurnDrvTetrisp2ja = { - "tetrisp2ja", "tetrisp2", NULL, NULL, "1997", - "Tetris Plus 2 (Japan, V2.1)\0", NULL, "Jaleco / The Tetris Company", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, tetrisp2jaRomInfo, tetrisp2jaRomName, NULL, NULL, Tetrisp2InputInfo, Tetrisp2jDIPInfo, - Tetrisp2Init, DrvExit, Tetrisp2Frame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 320, 224, 4, 3 -}; - - -// Rock'n Tread (Japan) - -static struct BurnRomInfo rocknRomDesc[] = { - { "rock_n_1_vj-98344_1.bin", 0x080000, 0x4cf79e58, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "rock_n_1_vj-98344_4.bin", 0x080000, 0xcaa33f79, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "rock_n_1_vj-98344_8.bin", 0x200000, 0xfa3f6f9c, 0x02 | BRF_GRA }, // 2 Sprites - { "rock_n_1_vj-98344_9.bin", 0x200000, 0x3d12a688, 0x02 | BRF_GRA }, // 3 - - { "rock_n_1_vj-98344_13.bin", 0x200000, 0x261b99a0, 0x03 | BRF_GRA }, // 4 Background and Rotation tiles - { "rock_n_1_vj-98344_6.bin", 0x100000, 0x5551717f, 0x03 | BRF_GRA }, // 5 - - { "rock_n_1_vj-98344_10.bin", 0x080000, 0x918663a8, 0x04 | BRF_GRA }, // 6 Foreground Tiles - - { "sound00", 0x400000, 0xc354f753, 0x05 | BRF_SND }, // 7 YMZ280b Samples - { "sound01", 0x400000, 0x5b42999e, 0x05 | BRF_SND }, // 8 - { "sound02", 0x400000, 0x8306f302, 0x05 | BRF_SND }, // 9 - { "sound03", 0x400000, 0x3fda842c, 0x05 | BRF_SND }, // 10 - { "sound04", 0x400000, 0x86d4f289, 0x05 | BRF_SND }, // 11 - { "sound05", 0x400000, 0xf8dbf47d, 0x05 | BRF_SND }, // 12 - { "sound06", 0x400000, 0x525aff97, 0x05 | BRF_SND }, // 13 - { "sound07", 0x400000, 0x5bd8bb95, 0x05 | BRF_SND }, // 14 - { "sound08", 0x400000, 0x304c1643, 0x05 | BRF_SND }, // 15 - { "sound09", 0x400000, 0x78c22c56, 0x05 | BRF_SND }, // 16 - { "sound10", 0x400000, 0xd5e8d8a5, 0x05 | BRF_SND }, // 17 - { "sound11", 0x400000, 0x569ef4dd, 0x05 | BRF_SND }, // 18 - { "sound12", 0x400000, 0xaae8d59c, 0x05 | BRF_SND }, // 19 - { "sound13", 0x400000, 0x9ec1459b, 0x05 | BRF_SND }, // 20 - { "sound14", 0x400000, 0xb26f9a81, 0x05 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(rockn) -STD_ROM_FN(rockn) - -struct BurnDriver BurnDrvRockn = { - "rockn", NULL, NULL, NULL, "1999", - "Rock'n Tread (Japan)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, rocknRomInfo, rocknRomName, NULL, NULL, RocknInputInfo, RocknDIPInfo, - RocknInit, DrvExit, RocknFrame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 224, 320, 3, 4 -}; - - -// Rock'n Tread (Japan, alternate) - -static struct BurnRomInfo rocknaRomDesc[] = { - { "rock_n_1_vj-98344_1", 0x080000, 0x6078fa48, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "rock_n_1_vj-98344_4", 0x080000, 0xc8310bd0, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "rock_n_1_vj-98344_8.bin", 0x200000, 0xfa3f6f9c, 0x02 | BRF_GRA }, // 2 Sprites - { "rock_n_1_vj-98344_9.bin", 0x200000, 0x3d12a688, 0x02 | BRF_GRA }, // 3 - - { "rock_n_1_vj-98344_13.bin", 0x200000, 0x261b99a0, 0x03 | BRF_GRA }, // 4 Background and Rotation tiles - { "rock_n_1_vj-98344_6.bin", 0x100000, 0x5551717f, 0x03 | BRF_GRA }, // 5 - - { "rock_n_1_vj-98344_10.bin", 0x080000, 0x918663a8, 0x04 | BRF_GRA }, // 6 Foreground Tiles - - { "sound00", 0x400000, 0xc354f753, 0x05 | BRF_SND }, // 7 YMZ280b Samples - { "sound01", 0x400000, 0x5b42999e, 0x05 | BRF_SND }, // 8 - { "sound02", 0x400000, 0x8306f302, 0x05 | BRF_SND }, // 9 - { "sound03", 0x400000, 0x3fda842c, 0x05 | BRF_SND }, // 10 - { "sound04", 0x400000, 0x86d4f289, 0x05 | BRF_SND }, // 11 - { "sound05", 0x400000, 0xf8dbf47d, 0x05 | BRF_SND }, // 12 - { "sound06", 0x400000, 0x525aff97, 0x05 | BRF_SND }, // 13 - { "sound07", 0x400000, 0x5bd8bb95, 0x05 | BRF_SND }, // 14 - { "sound08", 0x400000, 0x304c1643, 0x05 | BRF_SND }, // 15 - { "sound09", 0x400000, 0x78c22c56, 0x05 | BRF_SND }, // 16 - { "sound10", 0x400000, 0xd5e8d8a5, 0x05 | BRF_SND }, // 17 - { "sound11", 0x400000, 0x569ef4dd, 0x05 | BRF_SND }, // 18 - { "sound12", 0x400000, 0xaae8d59c, 0x05 | BRF_SND }, // 19 - { "sound13", 0x400000, 0x9ec1459b, 0x05 | BRF_SND }, // 20 - { "sound14", 0x400000, 0xb26f9a81, 0x05 | BRF_SND }, // 21 -}; - -STD_ROM_PICK(rockna) -STD_ROM_FN(rockna) - -struct BurnDriver BurnDrvRockna = { - "rockna", "rockn", NULL, NULL, "1999", - "Rock'n Tread (Japan, alternate)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, rocknaRomInfo, rocknaRomName, NULL, NULL, RocknInputInfo, RocknDIPInfo, - RocknInit, DrvExit, RocknFrame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 224, 320, 3, 4 -}; - - -// Rock'n Tread 2 (Japan) - -static struct BurnRomInfo rockn2RomDesc[] = { - { "rock_n_2_vj-98344_1_v1.0", 0x080000, 0x854b5a45, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "rock_n_2_vj-98344_4_v1.0", 0x080000, 0x4665bbd2, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "rock_n_2_vj-98344_8_v1.0", 0x200000, 0x673ce2c2, 0x02 | BRF_GRA }, // 2 Sprites - { "rock_n_2_vj-98344_9_v1.0", 0x200000, 0x9d3968cf, 0x02 | BRF_GRA }, // 3 - - { "rock_n_2_vj-98344_13_v1.0", 0x200000, 0xe35c55b3, 0x03 | BRF_GRA }, // 4 Background and Rotation tiles - { "rock_n_2_vj-98344_6_v1.0", 0x200000, 0x241d7449, 0x03 | BRF_GRA }, // 5 - - { "rock_n_2_vj-98344_10_v1.0", 0x080000, 0xae74d5b3, 0x04 | BRF_GRA }, // 6 Foreground Tiles - - { "sound00", 0x400000, 0x4e9611a3, 0x05 | BRF_SND }, // 7 YMZ280b Samples - { "sound01", 0x400000, 0xec600f13, 0x05 | BRF_SND }, // 8 - { "sound02", 0x400000, 0x8306f302, 0x05 | BRF_SND }, // 9 - { "sound03", 0x400000, 0x3fda842c, 0x05 | BRF_SND }, // 10 - { "sound04", 0x400000, 0x86d4f289, 0x05 | BRF_SND }, // 11 - { "sound05", 0x400000, 0xf8dbf47d, 0x05 | BRF_SND }, // 12 - { "sound06", 0x400000, 0x06f7bd63, 0x05 | BRF_SND }, // 13 - { "sound07", 0x400000, 0x22f042f6, 0x05 | BRF_SND }, // 14 - { "sound08", 0x400000, 0xdd294d8e, 0x05 | BRF_SND }, // 15 - { "sound09", 0x400000, 0x8fedee6e, 0x05 | BRF_SND }, // 16 - { "sound10", 0x400000, 0x01292f11, 0x05 | BRF_SND }, // 17 - { "sound11", 0x400000, 0x20dc76ba, 0x05 | BRF_SND }, // 18 - { "sound12", 0x400000, 0x11fff0bc, 0x05 | BRF_SND }, // 19 - { "sound13", 0x400000, 0x2367dd18, 0x05 | BRF_SND }, // 20 - { "sound14", 0x400000, 0x75ced8c0, 0x05 | BRF_SND }, // 21 - { "sound15", 0x400000, 0xaeaca380, 0x05 | BRF_SND }, // 22 - { "sound16", 0x400000, 0x21d50e32, 0x05 | BRF_SND }, // 23 - { "sound17", 0x400000, 0xde785a2a, 0x05 | BRF_SND }, // 24 - { "sound18", 0x400000, 0x18cabb1e, 0x05 | BRF_SND }, // 25 - { "sound19", 0x400000, 0x33c89e53, 0x05 | BRF_SND }, // 26 - { "sound20", 0x400000, 0x89c1b088, 0x05 | BRF_SND }, // 27 - { "sound21", 0x400000, 0x13db74bd, 0x05 | BRF_SND }, // 28 -}; - -STD_ROM_PICK(rockn2) -STD_ROM_FN(rockn2) - -struct BurnDriver BurnDrvRockn2 = { - "rockn2", NULL, NULL, NULL, "1999", - "Rock'n Tread 2 (Japan)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, rockn2RomInfo, rockn2RomName, NULL, NULL, RocknInputInfo, RocknDIPInfo, - Rockn2Init, DrvExit, RocknFrame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 224, 320, 3, 4 -}; - - -// Rock'n 3 (Japan) - -static struct BurnRomInfo rockn3RomDesc[] = { - { "rock_n_3_vj-98344_1_v1.0", 0x080000, 0xabc6ab4a, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "rock_n_3_vj-98344_4_v1.0", 0x080000, 0x3ecba46e, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "rock_n_3_vj-98344_8_v1.0", 0x200000, 0x468bf696, 0x02 | BRF_GRA }, // 2 Sprites - { "rock_n_3_vj-98344_9_v1.0", 0x200000, 0x8a61fc18, 0x02 | BRF_GRA }, // 3 - - { "rock_n_3_vj-98344_13_v1.0", 0x200000, 0xe01bf471, 0x03 | BRF_GRA }, // 4 Background and Rotation tiles - { "rock_n_3_vj-98344_6_v1.0", 0x200000, 0x4e146de5, 0x03 | BRF_GRA }, // 5 - - { "rock_n_3_vj-98344_10_v1.0", 0x080000, 0x8100039e, 0x04 | BRF_GRA }, // 6 Foreground Tiles - - { "mr99029-01.ic28", 0x400000, 0xe2f69042, 0x05 | BRF_SND }, // 7 YMZ280b Samples - { "mr99029-02.ic1", 0x400000, 0xb328b18f, 0x05 | BRF_SND }, // 8 - { "mr99029-03.ic2", 0x400000, 0xf46438e3, 0x05 | BRF_SND }, // 9 - { "mr99029-04.ic3", 0x400000, 0xb979e887, 0x05 | BRF_SND }, // 10 - { "mr99029-05.ic4", 0x400000, 0x0bb2c212, 0x05 | BRF_SND }, // 11 - { "mr99029-06.ic5", 0x400000, 0x3116e437, 0x05 | BRF_SND }, // 12 - { "mr99029-07.ic6", 0x400000, 0x26b37ef6, 0x05 | BRF_SND }, // 13 - { "mr99029-08.ic7", 0x400000, 0x1dd3f4e3, 0x05 | BRF_SND }, // 14 - { "mr99029-09.ic8", 0x400000, 0xa1b03d67, 0x05 | BRF_SND }, // 15 - { "mr99029-10.ic10", 0x400000, 0x35107aac, 0x05 | BRF_SND }, // 16 - { "mr99029-11.ic11", 0x400000, 0x059ec592, 0x05 | BRF_SND }, // 17 - { "mr99029-12.ic12", 0x400000, 0x84d4badb, 0x05 | BRF_SND }, // 18 - { "mr99029-13.ic13", 0x400000, 0x4527a9b7, 0x05 | BRF_SND }, // 19 - { "mr99029-14.ic14", 0x400000, 0xbfa4b7ce, 0x05 | BRF_SND }, // 20 - { "mr99029-15.ic15", 0x400000, 0xa2ccd2ce, 0x05 | BRF_SND }, // 21 - { "mr99029-16.ic16", 0x400000, 0x95baf678, 0x05 | BRF_SND }, // 22 - { "mr99029-17.ic17", 0x400000, 0x5883c84b, 0x05 | BRF_SND }, // 23 - { "mr99029-18.ic19", 0x400000, 0xf92098ce, 0x05 | BRF_SND }, // 24 - { "mr99029-19.ic20", 0x400000, 0xdbb2c228, 0x05 | BRF_SND }, // 25 - { "mr99029-20.ic21", 0x400000, 0x9efdae1c, 0x05 | BRF_SND }, // 26 - { "mr99029-21.ic22", 0x400000, 0x5f301b83, 0x05 | BRF_SND }, // 27 -}; - -STD_ROM_PICK(rockn3) -STD_ROM_FN(rockn3) - -struct BurnDriver BurnDrvRockn3 = { - "rockn3", NULL, NULL, NULL, "1999", - "Rock'n 3 (Japan)\0", NULL, "Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, rockn3RomInfo, rockn3RomName, NULL, NULL, RocknInputInfo, RocknDIPInfo, - Rockn3Init, DrvExit, RocknFrame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 224, 320, 3, 4 -}; - - -// Rock'n 4 (Japan, prototype) - -static struct BurnRomInfo rockn4RomDesc[] = { - { "rock_n_4_vj-98344_1.bin", 0x080000, 0xc666caea, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "rock_n_4_vj-98344_4.bin", 0x080000, 0xcc94e557, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "rock_n_4_vj-98344_8.bin", 0x200000, 0x5eeae537, 0x02 | BRF_GRA }, // 2 Sprites - { "rock_n_4_vj-98344_9.bin", 0x200000, 0x3fedddc9, 0x02 | BRF_GRA }, // 3 - - { "rock_n_4_vj-98344_13.bin", 0x200000, 0xead41e79, 0x03 | BRF_GRA }, // 4 Background and Rotation tiles - { "rock_n_4_vj-98344_6.bin", 0x200000, 0xeb16fc67, 0x03 | BRF_GRA }, // 5 - - { "rock_n_4_vj-98344_10.bin", 0x100000, 0x37d50259, 0x04 | BRF_GRA }, // 6 Foreground Tiles - - { "sound00", 0x400000, 0x918ea8eb, 0x05 | BRF_SND }, // 7 YMZ280b Samples - { "sound01", 0x400000, 0xc548e51e, 0x05 | BRF_SND }, // 8 - { "sound02", 0x400000, 0xffda0253, 0x05 | BRF_SND }, // 9 - { "sound03", 0x400000, 0x1f813af5, 0x05 | BRF_SND }, // 10 - { "sound04", 0x400000, 0x035c4ff3, 0x05 | BRF_SND }, // 11 - { "sound05", 0x400000, 0x0f01f7b0, 0x05 | BRF_SND }, // 12 - { "sound06", 0x400000, 0x31574b1c, 0x05 | BRF_SND }, // 13 - { "sound07", 0x400000, 0x388e2c91, 0x05 | BRF_SND }, // 14 - { "sound08", 0x400000, 0x6e7e3f23, 0x05 | BRF_SND }, // 15 - { "sound09", 0x400000, 0x39fa512f, 0x05 | BRF_SND }, // 16 -}; - -STD_ROM_PICK(rockn4) -STD_ROM_FN(rockn4) - -struct BurnDriver BurnDrvRockn4 = { - "rockn4", NULL, NULL, NULL, "2000", - "Rock'n 4 (Japan, prototype)\0", NULL, "Jaleco / PCCWJ", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, rockn4RomInfo, rockn4RomName, NULL, NULL, RocknInputInfo, RocknDIPInfo, - Rockn4Init, DrvExit, RocknFrame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 224, 320, 3, 4 -}; - - -// Nandemo Seal Iinkai - -static struct BurnRomInfo nndmsealRomDesc[] = { - { "1.1", 0x040000, 0x45acea25, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "3.3", 0x040000, 0x0754d96a, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "mr97006-02.5", 0x200000, 0x4793f84e, 0x03 | BRF_GRA }, // 2 Background and Rotation tiles - { "mr97001-01.6", 0x200000, 0xdd648e8a, 0x03 | BRF_GRA }, // 3 - { "mr97006-01.2", 0x200000, 0x32283485, 0x03 | BRF_GRA }, // 4 - - { "mr97006-04.8", 0x100000, 0x6726a25b, 0x04 | BRF_GRA }, // 5 Foreground Tiles - - { "mr96017-04.9", 0x200000, 0xc2e7b444, 0x05 | BRF_SND }, // 6 OKI M6295 Samples -}; - -STD_ROM_PICK(nndmseal) -STD_ROM_FN(nndmseal) - -struct BurnDriverD BurnDrvNndmseal = { - "nndmseal", NULL, NULL, NULL, "1997", - "Nandemo Seal Iinkai\0", NULL, "I'Max / Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, nndmsealRomInfo, nndmsealRomName, NULL, NULL, NndmsealInputInfo, NndmsealDIPInfo, - NndmsealInit, DrvExit, RocknFrame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 320, 240, 4, 3 -}; - - -// Nandemo Seal Iinkai (Astro Boy ver.) - -static struct BurnRomInfo nndmsealaRomDesc[] = { - { "1.ic1", 0x040000, 0x4eab8565, 0x01 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "3.ic3", 0x040000, 0x054ba50f, 0x01 | BRF_PRG | BRF_ESS }, // 1 - - { "mr97032-02.ic5", 0x200000, 0x460f16bd, 0x03 | BRF_GRA }, // 2 Background and Rotation tiles - { "mr97032-01.ic2", 0x400000, 0x18c1a394, 0x03 | BRF_GRA }, // 3 - - { "mr97032-03.ic8", 0x100000, 0x5678a378, 0x04 | BRF_GRA }, // 4 Foreground Tiles - - { "mr97016-04.ic9", 0x200000, 0xf421232b, 0x05 | BRF_SND }, // 5 OKI M6295 Samples -}; - -STD_ROM_PICK(nndmseala) -STD_ROM_FN(nndmseala) - -struct BurnDriverD BurnDrvNndmseala = { - "nndmseala", "nndmseal", NULL, NULL, "1997", - "Nandemo Seal Iinkai (Astro Boy ver.)\0", NULL, "I'Max / Jaleco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, nndmsealaRomInfo, nndmsealaRomName, NULL, NULL, NndmsealInputInfo, NndmsealDIPInfo, - NndmsealaInit, DrvExit, RocknFrame, Tetrisp2Draw, DrvScan, &DrvRecalc, 0x8000, - 320, 240, 4, 3 -}; - diff --git a/jan/src/burn/drv/pst90s/d_tumbleb.cpp b/jan/src/burn/drv/pst90s/d_tumbleb.cpp deleted file mode 100644 index 0e87a56d7..000000000 --- a/jan/src/burn/drv/pst90s/d_tumbleb.cpp +++ /dev/null @@ -1,4772 +0,0 @@ -// FB Alpha Tumble Pop driver module -// Based on MAME driver by David Haywood,Bryan McPhail - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "burn_ym3812.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0, 0, 0}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvZ80Rom = NULL; -static UINT8 *DrvZ80Ram = NULL; -static UINT8 *DrvProtData = NULL; -static UINT8 *DrvMSM6295ROMSrc = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPf1Ram = NULL; -static UINT8 *DrvPf2Ram = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; -static UINT16 *DrvControl = NULL; - -static UINT8 DrvVBlank; -static UINT8 DrvOkiBank; -static UINT8 DrvZ80Bank; -static UINT16 DrvTileBank; -static INT32 DrvSoundLatch; -static INT32 Tumbleb2MusicCommand; -static INT32 Tumbleb2MusicBank; -static INT32 Tumbleb2MusicIsPlaying; - -static INT32 DrvSpriteXOffset; -static INT32 DrvSpriteYOffset; -static INT32 DrvSpriteRamSize; -static INT32 DrvSpriteMask; -static INT32 DrvSpriteColourMask; -static INT32 DrvYM2151Freq; -static INT32 DrvNumSprites; -static INT32 DrvNumChars; -static INT32 DrvNumTiles; -static INT32 DrvHasZ80; -static INT32 DrvHasYM2151; -static INT32 DrvHasYM3812; -static INT32 DrvHasProt; -static INT32 Tumbleb2; -static INT32 Jumpkids; -static INT32 Chokchok; -static INT32 Wlstar; -static INT32 Wondl96; -static INT32 Bcstry; -static INT32 Semibase; -static INT32 SemicomSoundCommand; -static INT32 Pf1XOffset; -static INT32 Pf1YOffset; -static INT32 Pf2XOffset; -static INT32 Pf2YOffset; - -typedef INT32 (*LoadRoms)(); -static LoadRoms DrvLoadRoms; -typedef void (*Map68k)(); -static Map68k DrvMap68k; -typedef void (*MapZ80)(); -static MapZ80 DrvMapZ80; -typedef void (*Render)(); -static Render DrvRender; - -static void DrvDraw(); -static void PangpangDraw(); -static void SuprtrioDraw(); -static void HtchctchDraw(); -static void FncywldDraw(); -static void SdfightDraw(); -static void JumppopDraw(); - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo TumblebInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Tumbleb) - -static struct BurnInputInfo MetlsavrInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Metlsavr) - -static struct BurnInputInfo SuprtrioInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, -}; - -STDINPUTINFO(Suprtrio) - -static struct BurnInputInfo HtchctchInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Htchctch) - -static struct BurnInputInfo FncywldInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 2, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Fncywld) - -static struct BurnInputInfo SemibaseInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , DrvInputPort2 + 2, "p3 coin" }, - {"Coin 4" , BIT_DIGITAL , DrvInputPort2 + 3, "p4 coin" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Semibase) - -static struct BurnInputInfo JumppopInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Jumppop) - -static struct BurnDIPInfo TumblebDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x12, 0x01, 0xe0, 0x00, "3 Coins 1 Credit" }, - {0x12, 0x01, 0xe0, 0x80, "2 Coins 1 Credit" }, - {0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x12, 0x01, 0x1c, 0x00, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x1c, 0x10, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "2 Coins to Start, 1 to Continue" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0xc0, 0x80, "1" }, - {0x13, 0x01, 0xc0, 0x00, "2" }, - {0x13, 0x01, 0xc0, 0xc0, "3" }, - {0x13, 0x01, 0xc0, 0x40, "4" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x30, 0x10, "Easy" }, - {0x13, 0x01, 0x30, 0x30, "Normal" }, - {0x13, 0x01, 0x30, 0x20, "Hard" }, - {0x13, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, -}; - -STDDIPINFO(Tumbleb) - -static struct BurnDIPInfo MetlsavrDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x0c, 0x00, "2" }, - {0x13, 0x01, 0x0c, 0x0c, "3" }, - {0x13, 0x01, 0x0c, 0x08, "4" }, - {0x13, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x13, 0x01, 0x70, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x10, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x20, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x30, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x70, 0x60, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x70, 0x50, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x70, 0x40, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Language" }, - {0x14, 0x01, 0x08, 0x08, "English" }, - {0x14, 0x01, 0x08, 0x00, "Korean" }, - - {0 , 0xfe, 0 , 4 , "Life Meter" }, - {0x14, 0x01, 0x30, 0x00, "66%" }, - {0x14, 0x01, 0x30, 0x30, "100%" }, - {0x14, 0x01, 0x30, 0x20, "133%" }, - {0x14, 0x01, 0x30, 0x10, "166%" }, - - {0 , 0xfe, 0 , 4 , "Time" }, - {0x14, 0x01, 0xc0, 0x40, "30 Seconds" }, - {0x14, 0x01, 0xc0, 0x80, "40 Seconds" }, - {0x14, 0x01, 0xc0, 0xc0, "60 Seconds" }, - {0x14, 0x01, 0xc0, 0x00, "80 Seconds" }, -}; - -STDDIPINFO(Metlsavr) - -static struct BurnDIPInfo SuprtrioDIPList[]= -{ - // Default Values - {0x12, 0xff, 0xff, 0x10, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x12, 0x01, 0x07, 0x06, "5 Coins 1 Credit" }, - {0x12, 0x01, 0x07, 0x05, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x07, 0x04, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x07, "Free Play" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x18, 0x00, "1" }, - {0x12, 0x01, 0x18, 0x08, "2" }, - {0x12, 0x01, 0x18, 0x10, "3" }, - {0x12, 0x01, 0x18, 0x18, "5" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x12, 0x01, 0x20, 0x00, "Normal" }, - {0x12, 0x01, 0x20, 0x20, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x12, 0x01, 0x40, 0x00, "50000" }, - {0x12, 0x01, 0x40, 0x40, "60000" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x80, 0x00, "Off" }, - {0x12, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Suprtrio) - -static struct BurnDIPInfo HtchctchDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x06, 0x00, "Easy" }, - {0x12, 0x01, 0x06, 0x06, "Normal" }, - {0x12, 0x01, 0x06, 0x02, "Hard" }, - {0x12, 0x01, 0x06, 0x04, "Very Hard" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x30, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2 , "Stage Skip" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Htchctch) - -static struct BurnDIPInfo CookbibDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x06, 0x00, "Easy" }, - {0x12, 0x01, 0x06, 0x06, "Normal" }, - {0x12, 0x01, 0x06, 0x02, "Hard" }, - {0x12, 0x01, 0x06, 0x04, "Very Hard" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x30, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2 , "Winning Rounds (vs mode)"}, - {0x12, 0x01, 0x40, 0x00, "1" }, - {0x12, 0x01, 0x40, 0x40, "2" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Cookbib) - -static struct BurnDIPInfo ChokchokDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Winning Rounds (vs mode)"}, - {0x11, 0x01, 0x01, 0x00, "2" }, - {0x11, 0x01, 0x01, 0x01, "3" }, - - {0 , 0xfe, 0 , 2 , "Time" }, - {0x11, 0x01, 0x20, 0x20, "60 Seconds" }, - {0x11, 0x01, 0x20, 0x00, "90 Seconds" }, - - {0 , 0xfe, 0 , 4 , "Starting Balls" }, - {0x11, 0x01, 0xc0, 0x00, "3" }, - {0x11, 0x01, 0xc0, 0xc0, "4" }, - {0x11, 0x01, 0xc0, 0x40, "5" }, - {0x11, 0x01, 0xc0, 0x80, "6" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x06, 0x00, "Easy" }, - {0x12, 0x01, 0x06, 0x06, "Normal" }, - {0x12, 0x01, 0x06, 0x02, "Hard" }, - {0x12, 0x01, 0x06, 0x04, "Very Hard" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x20, "4 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x30, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Chokchok) - -static struct BurnDIPInfo WlstarDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "2 Players Game" }, - {0x13, 0x01, 0x10, 0x00, "1 Credit" }, - {0x13, 0x01, 0x10, 0x10, "2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0xc0, 0x00, "Easy" }, - {0x13, 0x01, 0xc0, 0xc0, "Normal" }, - {0x13, 0x01, 0xc0, 0x40, "Hard" }, - {0x13, 0x01, 0xc0, 0x80, "Hardest" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Last Inning" }, - {0x14, 0x01, 0x01, 0x00, "9" }, - {0x14, 0x01, 0x01, 0x01, "12" }, - - {0 , 0xfe, 0 , 2 , "Versus CPU Game Ends" }, - {0x14, 0x01, 0x02, 0x02, "+10" }, - {0x14, 0x01, 0x02, 0x00, "+7" }, - - {0 , 0xfe, 0 , 2 , "Versus Game" }, - {0x14, 0x01, 0x04, 0x00, "1 Credit / 2 Innings" }, - {0x14, 0x01, 0x04, 0x04, "1 Credit / 3 Innings" }, - - {0 , 0xfe, 0 , 2 , "Full 2 Players Game" }, - {0x14, 0x01, 0x08, 0x00, "4 Credits" }, - {0x14, 0x01, 0x08, 0x08, "6 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x14, 0x01, 0x70, 0x00, "5 Coins 1 Credit" }, - {0x14, 0x01, 0x70, 0x40, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x70, 0x20, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x70, 0x50, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x70, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x70, 0x10, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Wlstar) - -static struct BurnDIPInfo Wondl96DIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Field Colour" }, - {0x13, 0x01, 0x10, 0x10, "Blue" }, - {0x13, 0x01, 0x10, 0x00, "Green" }, - - {0 , 0xfe, 0 , 2 , "Versus CPU Game Ends" }, - {0x13, 0x01, 0x20, 0x20, "+10" }, - {0x13, 0x01, 0x20, 0x00, "+7" }, - - {0 , 0xfe, 0 , 2 , "Versus Game" }, - {0x13, 0x01, 0x40, 0x00, "1 Credit / 2 Innings" }, - {0x13, 0x01, 0x40, 0x40, "1 Credit / 3 Innings" }, - - {0 , 0xfe, 0 , 2 , "Full 2 Players Game" }, - {0x13, 0x01, 0x80, 0x80, "4 Credits" }, - {0x13, 0x01, 0x80, 0x00, "6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x14, 0x01, 0x0e, 0x04, "Level 1" }, - {0x14, 0x01, 0x0e, 0x08, "Level 2" }, - {0x14, 0x01, 0x0e, 0x00, "Level 3" }, - {0x14, 0x01, 0x0e, 0x0e, "Level 4" }, - {0x14, 0x01, 0x0e, 0x06, "Level 5" }, - {0x14, 0x01, 0x0e, 0x0a, "Level 6" }, - {0x14, 0x01, 0x0e, 0x02, "Level 7" }, - {0x14, 0x01, 0x0e, 0x0c, "Level 8" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x14, 0x01, 0x70, 0x00, "5 Coins 1 Credit" }, - {0x14, 0x01, 0x70, 0x40, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x70, 0x20, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x70, 0x50, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x70, 0x30, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x70, 0x10, "1 Coin 3 Credits" }, -}; - -STDDIPINFO(Wondl96) - -static struct BurnDIPInfo FncywldDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xf7, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x14, 0x01, 0xe0, 0x20, "4 Coins 1 Credit" }, - {0x14, 0x01, 0xe0, 0x40, "3 Coins 1 Credit" }, - {0x14, 0x01, 0xe0, 0x60, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xe0, 0x00, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x14, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x14, 0x01, 0x04, 0x04, "English" }, - {0x14, 0x01, 0x04, 0x00, "Korean" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "2 Coins to Start, 1 to Continue" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0xc0, 0x80, "1" }, - {0x15, 0x01, 0xc0, 0x00, "2" }, - {0x15, 0x01, 0xc0, 0xc0, "3" }, - {0x15, 0x01, 0xc0, 0x40, "4" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x30, 0x30, "Easy" }, - {0x15, 0x01, 0x30, 0x20, "Normal" }, - {0x15, 0x01, 0x30, 0x10, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Freeze" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, -}; - -STDDIPINFO(Fncywld) - -static struct BurnDIPInfo SdfightDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x13, 0x01, 0x0e, 0x04, "1" }, - {0x13, 0x01, 0x0e, 0x08, "2" }, - {0x13, 0x01, 0x0e, 0x00, "3" }, - {0x13, 0x01, 0x0e, 0x0e, "4" }, - {0x13, 0x01, 0x0e, 0x06, "5" }, - {0x13, 0x01, 0x0e, 0x0a, "6" }, - {0x13, 0x01, 0x0e, 0x02, "7" }, - {0x13, 0x01, 0x0e, 0x0c, "8" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x13, 0x01, 0x70, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x40, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x20, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x70, 0x50, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x70, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x70, 0x10, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Winning Rounds" }, - {0x14, 0x01, 0x08, 0x08, "2" }, - {0x14, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 4 , "Time" }, - {0x14, 0x01, 0xc0, 0x40, "30" }, - {0x14, 0x01, 0xc0, 0x80, "50" }, - {0x14, 0x01, 0xc0, 0xc0, "70" }, - {0x14, 0x01, 0xc0, 0x00, "90" }, -}; - -STDDIPINFO(Sdfight) - -static struct BurnDIPInfo BcstryDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x13, 0x01, 0x0e, 0x04, "1" }, - {0x13, 0x01, 0x0e, 0x08, "2" }, - {0x13, 0x01, 0x0e, 0x00, "3" }, - {0x13, 0x01, 0x0e, 0x0e, "4" }, - {0x13, 0x01, 0x0e, 0x06, "5" }, - {0x13, 0x01, 0x0e, 0x0a, "6" }, - {0x13, 0x01, 0x0e, 0x02, "7" }, - {0x13, 0x01, 0x0e, 0x0c, "8" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x13, 0x01, 0x70, 0x00, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x40, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x20, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x70, 0x50, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x70, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x70, 0x10, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Event Selection" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Control Type" }, - {0x14, 0x01, 0x40, 0x40, "Joysticks & Buttons" }, - {0x14, 0x01, 0x40, 0x00, "Buttons" }, - - {0 , 0xfe, 0 , 2 , "Debug Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Bcstry) - -static struct BurnDIPInfo SemibaseDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0x7f, NULL }, - {0x16, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x15, 0x01, 0x0e, 0x04, "1" }, - {0x15, 0x01, 0x0e, 0x08, "2" }, - {0x15, 0x01, 0x0e, 0x00, "3" }, - {0x15, 0x01, 0x0e, 0x0e, "4" }, - {0x15, 0x01, 0x0e, 0x06, "5" }, - {0x15, 0x01, 0x0e, 0x0a, "6" }, - {0x15, 0x01, 0x0e, 0x02, "7" }, - {0x15, 0x01, 0x0e, 0x0c, "8" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x15, 0x01, 0x70, 0x00, "5 Coins 1 Credit" }, - {0x15, 0x01, 0x70, 0x40, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x70, 0x20, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x70, 0x50, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x70, 0x30, "1 Coin 2 Credits" }, - {0x15, 0x01, 0x70, 0x10, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "vs CPU Game Ends" }, - {0x16, 0x01, 0x20, 0x20, "+10" }, - {0x16, 0x01, 0x20, 0x00, "+7" }, - - {0 , 0xfe, 0 , 2 , "Vs Game" }, - {0x16, 0x01, 0x40, 0x40, "1 Credit / 2 Innings" }, - {0x16, 0x01, 0x40, 0x00, "1 Credit / 3 Innings" }, - - {0 , 0xfe, 0 , 2 , "Full 2 Players Game" }, - {0x16, 0x01, 0x80, 0x00, "4 Credits" }, - {0x16, 0x01, 0x80, 0x80, "6 Credits" }, -}; - -STDDIPINFO(Semibase) - -static struct BurnDIPInfo DquizgoDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x13, 0x01, 0x0e, 0x04, "1" }, - {0x13, 0x01, 0x0e, 0x08, "2" }, - {0x13, 0x01, 0x0e, 0x00, "3" }, - {0x13, 0x01, 0x0e, 0x0e, "4" }, - {0x13, 0x01, 0x0e, 0x06, "5" }, - {0x13, 0x01, 0x0e, 0x0a, "6" }, - {0x13, 0x01, 0x0e, 0x02, "7" }, - {0x13, 0x01, 0x0e, 0x0c, "8" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x13, 0x01, 0x70, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x40, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x20, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x60, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x70, 0x70, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x70, 0x50, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x70, 0x30, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x70, 0x10, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0xc0, 0x00, "2" }, - {0x14, 0x01, 0xc0, 0xc0, "3" }, - {0x14, 0x01, 0xc0, 0x40, "4" }, - {0x14, 0x01, 0xc0, 0x80, "5" }, -}; - -STDDIPINFO(Dquizgo) - -static struct BurnDIPInfo JumppopDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x11, 0x01, 0xe0, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xe0, 0x80, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" }, - {0x11, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x11, 0x01, 0x1c, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x1c, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Picture Viewer" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Background Type" }, - {0x12, 0x01, 0x08, 0x08, "1" }, - {0x12, 0x01, 0x08, 0x00, "2" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x30, 0x20, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0xc0, 0x80, "1" }, - {0x12, 0x01, 0xc0, 0x00, "2" }, - {0x12, 0x01, 0xc0, 0xc0, "3" }, - {0x12, 0x01, 0xc0, 0x40, "4" }, -}; - -STDDIPINFO(Jumppop) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[1]); -} - -static struct BurnRomInfo TumblebRomDesc[] = { - { "thumbpop.12", 0x40000, 0x0c984703, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "thumbpop.13", 0x40000, 0x864c4053, BRF_ESS | BRF_PRG }, // 1 - - { "thumbpop.19", 0x40000, 0x0795aab4, BRF_GRA }, // 2 Tiles - { "thumbpop.18", 0x40000, 0xad58df43, BRF_GRA }, // 3 - - { "map-01.rom", 0x80000, 0xe81ffa09, BRF_GRA }, // 4 Sprites - { "map-00.rom", 0x80000, 0x8c879cfe, BRF_GRA }, // 5 - - { "thumbpop.snd", 0x80000, 0xfabbf15d, BRF_SND }, // 6 Samples -}; - -STD_ROM_PICK(Tumbleb) -STD_ROM_FN(Tumbleb) - -static struct BurnRomInfo Tumbleb2RomDesc[] = { - { "thumbpop.2", 0x40000, 0x34b016e1, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "thumbpop.3", 0x40000, 0x89501c71, BRF_ESS | BRF_PRG }, // 1 - - { "thumbpop.19", 0x40000, 0x0795aab4, BRF_GRA }, // 2 Tiles - { "thumbpop.18", 0x40000, 0xad58df43, BRF_GRA }, // 3 - - { "map-01.rom", 0x80000, 0xe81ffa09, BRF_GRA }, // 4 Sprites - { "map-00.rom", 0x80000, 0x8c879cfe, BRF_GRA }, // 5 - - { "thumbpop.snd", 0x80000, 0xfabbf15d, BRF_SND }, // 6 Samples - - { "pic_16c57", 0x02d4c, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(Tumbleb2) -STD_ROM_FN(Tumbleb2) - -static struct BurnRomInfo JumpkidsRomDesc[] = { - { "23-ic29.15c", 0x40000, 0x6ba11e91, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "24-ic30.17c", 0x40000, 0x5795d98b, BRF_ESS | BRF_PRG }, // 1 - - { "22-ic19.3c", 0x08000, 0xbd619530, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "30-ic125.15j", 0x40000, 0x44b9a089, BRF_GRA }, // 3 Tiles - { "29-ic124.13j", 0x40000, 0x3f98ec69, BRF_GRA }, // 4 - - { "25-ic69.1g", 0x40000, 0x176ae857, BRF_GRA }, // 5 Sprites - { "28-ic131.1l", 0x40000, 0xed837757, BRF_GRA }, // 6 - { "26-ic70.2g", 0x40000, 0xe8b34980, BRF_GRA }, // 7 - { "27-ic100.1j", 0x40000, 0x3918dda3, BRF_GRA }, // 8 - - { "21-ic17.1c", 0x80000, 0xe5094f75, BRF_SND }, // 9 Samples - { "ic18.2c", 0x20000, 0xa63736c3, BRF_SND }, // 10 -}; - -STD_ROM_PICK(Jumpkids) -STD_ROM_FN(Jumpkids) - -static struct BurnRomInfo MetlsavrRomDesc[] = { - { "first-4.ub17", 0x40000, 0x667a494d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "first-3.ub18", 0x40000, 0x87bf4ed2, BRF_ESS | BRF_PRG }, // 1 - - { "first-2.ua7", 0x10000, 0x49505edf, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "protdata.bin", 0x00200, 0x17aa17a9, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "first-5.rom5", 0x40000, 0xdd4af746, BRF_GRA }, // 4 Tiles - { "first-6.rom6", 0x40000, 0x808b0e0b, BRF_GRA }, // 5 - - { "first-7.uor1", 0x80000, 0xa6816747, BRF_GRA }, // 6 Sprites - { "first-8.uor2", 0x80000, 0x377020e5, BRF_GRA }, // 7 - { "first-9.uor3", 0x80000, 0xfccf1bb7, BRF_GRA }, // 8 - { "first-10.uor4", 0x80000, 0xa22b587b, BRF_GRA }, // 9 - - { "first-1.uc1", 0x40000, 0xe943dacb, BRF_SND }, // 10 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11 -}; - -STD_ROM_PICK(Metlsavr) -STD_ROM_FN(Metlsavr) - -static struct BurnRomInfo PangpangRomDesc[] = { - { "2.bin", 0x40000, 0x45436666, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "3.bin", 0x40000, 0x2725cbe7, BRF_ESS | BRF_PRG }, // 1 - - { "11.bin", 0x40000, 0xa2b9fec8, BRF_GRA }, // 2 Tiles - { "10.bin", 0x40000, 0x4f59d7b9, BRF_GRA }, // 3 - { "6.bin", 0x40000, 0x1ebbc4f1, BRF_GRA }, // 4 - { "7.bin", 0x40000, 0xcd544173, BRF_GRA }, // 5 - - { "8.bin", 0x40000, 0xea0fa1e0, BRF_GRA }, // 6 Sprites - { "9.bin", 0x40000, 0x1da5fe49, BRF_GRA }, // 7 - { "4.bin", 0x40000, 0x4f282eb1, BRF_GRA }, // 8 - { "5.bin", 0x40000, 0x00694df9, BRF_GRA }, // 9 - - { "1.bin", 0x80000, 0xe722bb02, BRF_SND }, // 10 Samples - - { "pic_16c57", 0x02d4c, 0x1ca515b4, BRF_OPT }, -}; - -STD_ROM_PICK(Pangpang) -STD_ROM_FN(Pangpang) - -static struct BurnRomInfo SuprtrioRomDesc[] = { - { "rom2", 0x40000, 0x4102e59d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "rom1", 0x40000, 0xcc3a83c3, BRF_ESS | BRF_PRG }, // 1 - - { "rom4l", 0x10000, 0x466aa96d, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "rom4", 0x80000, 0xcd2dfae4, BRF_GRA }, // 3 Tiles - { "rom5", 0x80000, 0x4e64da64, BRF_GRA }, // 4 - - { "rom9l", 0x40000, 0xcc45f437, BRF_GRA }, // 5 Sprites - { "rom8l", 0x40000, 0x9bc90169, BRF_GRA }, // 6 - { "rom7l", 0x40000, 0xbfc7c756, BRF_GRA }, // 7 - { "rom6l", 0x40000, 0xbb3499af, BRF_GRA }, // 8 - - { "rom3h", 0x80000, 0x34ea7ec9, BRF_SND }, // 9 Samples - { "rom3l", 0x20000, 0x1b73233b, BRF_SND }, // 10 -}; - -STD_ROM_PICK(Suprtrio) -STD_ROM_FN(Suprtrio) - -static struct BurnRomInfo HtchctchRomDesc[] = { - { "p04.b17", 0x20000, 0x6991483a, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "p03.b16", 0x20000, 0xeff14c40, BRF_ESS | BRF_PRG }, // 1 - - { "p02.b5", 0x10000, 0xc5a03186, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "protdata.bin", 0x00200, 0x5b27adb6, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "p06srom5.bin", 0x40000, 0x3d2cbb0d, BRF_GRA }, // 4 Tiles - { "p07srom6.bin", 0x40000, 0x0207949c, BRF_GRA }, // 5 - - { "p08uor1.bin", 0x20000, 0x6811e7b6, BRF_GRA }, // 6 Sprites - { "p09uor2.bin", 0x20000, 0x1c6549cf, BRF_GRA }, // 7 - { "p10uor3.bin", 0x20000, 0x6462e6e0, BRF_GRA }, // 8 - { "p11uor4.bin", 0x20000, 0x9c511d98, BRF_GRA }, // 9 - - { "p01.c1", 0x20000, 0x18c06829, BRF_SND }, // 10 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11 -}; - -STD_ROM_PICK(Htchctch) -STD_ROM_FN(Htchctch) - -static struct BurnRomInfo CookbibRomDesc[] = { - { "prg2.ub17", 0x20000, 0x2664a335, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "prg1.ub16", 0x20000, 0xcda6335f, BRF_ESS | BRF_PRG }, // 1 - - { "prg-s.ub5", 0x10000, 0x547d6ea3, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "protdata.bin", 0x00200, 0xa77d13f4, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "srom5.bin", 0x40000, 0x73a46e43, BRF_GRA }, // 4 Tiles - { "srom6.bin", 0x40000, 0xade2dbec, BRF_GRA }, // 5 - - { "uor1.bin", 0x20000, 0xa7d91f23, BRF_GRA }, // 6 Sprites - { "uor2.bin", 0x20000, 0x9aacbec2, BRF_GRA }, // 7 - { "uor3.bin", 0x20000, 0x3fee0c3c, BRF_GRA }, // 8 - { "uor4.bin", 0x20000, 0xbed9ed2d, BRF_GRA }, // 9 - - { "sound.uc1", 0x20000, 0x545e19b6, BRF_SND }, // 10 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11 -}; - -STD_ROM_PICK(Cookbib) -STD_ROM_FN(Cookbib) - -static struct BurnRomInfo CookbibaRomDesc[] = { - { "d14.u817", 0x20000, 0x0021349f, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "d13.u818", 0x20000, 0x19c75b1f, BRF_ESS | BRF_PRG }, // 1 - - { "d12.ub5", 0x10000, 0x0a16e0b4, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "cookbiba_protdata.bin", 0x00200, 0x7f05b832, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "srom5.bin", 0x40000, 0x73a46e43, BRF_GRA }, // 4 Tiles - { "srom6.bin", 0x40000, 0xade2dbec, BRF_GRA }, // 5 - - { "d17.uor1", 0x20000, 0x2fab7c2d, BRF_GRA }, // 6 Sprites - { "d18.uor2", 0x20000, 0x341750a0, BRF_GRA }, // 7 - { "d19.uor3", 0x20000, 0x343d2e41, BRF_GRA }, // 8 - { "d20.uor4", 0x20000, 0xc35cc03d, BRF_GRA }, // 9 - - { "sound.uc1", 0x20000, 0x545e19b6, BRF_SND }, // 10 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11 -}; - -STD_ROM_PICK(Cookbiba) -STD_ROM_FN(Cookbiba) - -static struct BurnRomInfo ChokchokRomDesc[] = { - { "ub17.bin", 0x40000, 0xecdb45ca, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ub18.bin", 0x40000, 0xb183852a, BRF_ESS | BRF_PRG }, // 1 - - { "ub5.bin", 0x10000, 0x30c2171d, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "protdata.bin", 0x00200, 0x0bd39834, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "srom5.bin", 0x80000, 0x836608b8, BRF_GRA }, // 4 Tiles - { "srom6.bin", 0x80000, 0x31d5715d, BRF_GRA }, // 5 - - { "uor1.bin", 0x80000, 0xded6642a, BRF_GRA }, // 6 Sprites - { "uor2.bin", 0x80000, 0x493f9516, BRF_GRA }, // 7 - { "uor3.bin", 0x80000, 0xe2dc3e12, BRF_GRA }, // 8 - { "uor4.bin", 0x80000, 0x6f377530, BRF_GRA }, // 9 - - { "uc1.bin", 0x40000, 0xf3f57abd, BRF_SND }, // 10 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11 -}; - -STD_ROM_PICK(Chokchok) -STD_ROM_FN(Chokchok) - -static struct BurnRomInfo WlstarRomDesc[] = { - { "n-4.u817", 0x40000, 0xfc3e829b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "n-3.u818", 0x40000, 0xf01bc623, BRF_ESS | BRF_PRG }, // 1 - - { "ua7", 0x10000, 0x90cafa5f, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - -#if !defined (ROM_VERIFY) - { "protdata.bin", 0x00200, 0xb7ffde5b, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data -#else - { "87c52.mcu", 0x02000, 0xab5e2a7e, BRF_ESS | BRF_PRG }, // 3 MCU Program Code -#endif - - { "5.srom5", 0x80000, 0xf7f8c859, BRF_GRA }, // 4 Tiles - { "6.srom6", 0x80000, 0x34ace2a8, BRF_GRA }, // 5 - - { "7.udr1", 0x80000, 0x6e47c31d, BRF_GRA }, // 6 Sprites - { "8.udr2", 0x80000, 0x09c5d57c, BRF_GRA }, // 7 - { "9.udr3", 0x80000, 0x3ec064f0, BRF_GRA }, // 8 - { "10.udr4", 0x80000, 0xb4693cdd, BRF_GRA }, // 9 - - { "ua1", 0x40000, 0xde217d30, BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(Wlstar) -STD_ROM_FN(Wlstar) - -static struct BurnRomInfo Wondl96RomDesc[] = { - { "ub17.bin", 0x40000, 0x41d8e03c, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ub18.bin", 0x40000, 0x0e4963af, BRF_ESS | BRF_PRG }, // 1 - - { "ub5.bin", 0x10000, 0xd99d19c4, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - -#if !defined (ROM_VERIFY) - { "protdata.bin", 0x00200, 0xd7578b1e, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data -#else - { "87c52.mcu", 0x02000, 0x6f4c659a, BRF_ESS | BRF_PRG }, // 3 MCU Program Code -#endif - - { "srom5.bin", 0x80000, 0xdb8010c3, BRF_GRA }, // 4 Tiles - { "srom6.bin", 0x80000, 0x2f364e54, BRF_GRA }, // 5 - - { "uor1.bin", 0x80000, 0xe1e9eebb, BRF_GRA }, // 6 Sprites - { "uor2.bin", 0x80000, 0xddebfe83, BRF_GRA }, // 7 - { "uor3.bin", 0x80000, 0x7efe4d67, BRF_GRA }, // 8 - { "uor4.bin", 0x80000, 0x7b1596d1, BRF_GRA }, // 9 - - { "uc1.bin", 0x40000, 0x0e7913e6, BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(Wondl96) -STD_ROM_FN(Wondl96) - -static struct BurnRomInfo FncywldRomDesc[] = { - { "01_fw02.bin", 0x80000, 0xecb978c1, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "02_fw03.bin", 0x80000, 0x2d233b42, BRF_ESS | BRF_PRG }, // 1 - - { "08_fw09.bin", 0x40000, 0xa4a00de9, BRF_GRA }, // 2 Tiles - { "07_fw08.bin", 0x40000, 0xb48cd1d4, BRF_GRA }, // 3 - { "10_fw11.bin", 0x40000, 0xf21bab48, BRF_GRA }, // 4 - { "09_fw10.bin", 0x40000, 0x6aea8e0f, BRF_GRA }, // 5 - - { "05_fw06.bin", 0x40000, 0xe141ecdc, BRF_GRA }, // 6 Sprites - { "06_fw07.bin", 0x40000, 0x0058a812, BRF_GRA }, // 7 - { "03_fw04.bin", 0x40000, 0x6ad38c14, BRF_GRA }, // 8 - { "04_fw05.bin", 0x40000, 0xb8d079a6, BRF_GRA }, // 9 - - { "00_fw01.bin", 0x40000, 0xb395fe01, BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(Fncywld) -STD_ROM_FN(Fncywld) - -static struct BurnRomInfo SdfightRomDesc[] = { - { "u817", 0x80000, 0x9f284f4d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "u818", 0x80000, 0xa60e5b22, BRF_ESS | BRF_PRG }, // 1 - - { "ua7", 0x10000, 0xc3d36da4, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "protdata.bin", 0x00200, 0xefb8b822, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "9.ug11", 0x80000, 0xbf809ccd, BRF_GRA }, // 4 Tiles - { "10.ug12", 0x80000, 0xa5a3bfa2, BRF_GRA }, // 5 - { "15.ui11", 0x80000, 0x3bc8aa6d, BRF_GRA }, // 6 - { "16.ui12", 0x80000, 0x71e6b78d, BRF_GRA }, // 7 - - { "11.uk2", 0x80000, 0xd006fadc, BRF_GRA }, // 8 Sprites - { "12.uk3", 0x80000, 0x2a2f4153, BRF_GRA }, // 9 - { "5.uj2", 0x80000, 0xf1246cbf, BRF_GRA }, // 10 - { "6.uj3", 0x80000, 0xd346878c, BRF_GRA }, // 11 - { "13.uk4", 0x80000, 0x9bc40774, BRF_GRA }, // 12 - { "14.uk5", 0x80000, 0xa1e61674, BRF_GRA }, // 13 - { "7.uj4", 0x80000, 0xdbdece8a, BRF_GRA }, // 14 - { "8.uj5", 0x80000, 0x60be7dd1, BRF_GRA }, // 15 - - { "uc1", 0x40000, 0x535cae2c, BRF_SND }, // 16 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 17 -}; - -STD_ROM_PICK(Sdfight) -STD_ROM_FN(Sdfight) - -static struct BurnRomInfo BcstryRomDesc[] = { - { "bcstry_u.62", 0x40000, 0x7f7aa244, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "bcstry_u.35", 0x40000, 0xd25b80a4, BRF_ESS | BRF_PRG }, // 1 - - { "bcstry_u.21", 0x10000, 0x3ba072d4, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "protdata.bin", 0x00200, 0xe84e328c, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "bcstry_u.109", 0x80000, 0xeb04d37a, BRF_GRA }, // 4 Tiles - { "bcstry_u.113", 0x80000, 0x746ecdd7, BRF_GRA }, // 5 - { "bcstry_u.110", 0x80000, 0x1bfe65c3, BRF_GRA }, // 6 - { "bcstry_u.111", 0x80000, 0xc8bf3a3c, BRF_GRA }, // 7 - - { "bcstry_u.100", 0x80000, 0x8c11cbed, BRF_GRA }, // 8 Sprites - { "bcstry_u.106", 0x80000, 0x5219bcbf, BRF_GRA }, // 9 - { "bcstry_u.99", 0x80000, 0xcdb1af87, BRF_GRA }, // 10 - { "bcstry_u.105", 0x80000, 0x8166b596, BRF_GRA }, // 11 - { "bcstry_u.104", 0x80000, 0x377c0c71, BRF_GRA }, // 12 - { "bcstry_u.108", 0x80000, 0x442307ed, BRF_GRA }, // 13 - { "bcstry_u.102", 0x80000, 0x71b40ece, BRF_GRA }, // 14 - { "bcstry_u.107", 0x80000, 0xab3c923a, BRF_GRA }, // 15 - - { "bcstry_u.64", 0x40000, 0x23f0e0fe, BRF_SND }, // 16 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 17 -}; - -STD_ROM_PICK(Bcstry) -STD_ROM_FN(Bcstry) - -static struct BurnRomInfo BcstryaRomDesc[] = { - { "prg2.ic62", 0x40000, 0xf54c0a96, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "prg1.ic35", 0x40000, 0x2c55100a, BRF_ESS | BRF_PRG }, // 1 - - { "bcstry_u.21", 0x10000, 0x3ba072d4, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "protdata.bin", 0x00200, 0xe84e328c, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "bcstry_u.109", 0x80000, 0xeb04d37a, BRF_GRA }, // 4 Tiles - { "bcstry_u.113", 0x80000, 0x746ecdd7, BRF_GRA }, // 5 - { "bcstry_u.110", 0x80000, 0x1bfe65c3, BRF_GRA }, // 6 - { "bcstry_u.111", 0x80000, 0xc8bf3a3c, BRF_GRA }, // 7 - - { "bcstry_u.100", 0x80000, 0x8c11cbed, BRF_GRA }, // 8 Sprites - { "bcstry_u.106", 0x80000, 0x5219bcbf, BRF_GRA }, // 9 - { "bcstry_u.99", 0x80000, 0xcdb1af87, BRF_GRA }, // 10 - { "bcstry_u.105", 0x80000, 0x8166b596, BRF_GRA }, // 11 - { "bcstry_u.104", 0x80000, 0x377c0c71, BRF_GRA }, // 12 - { "bcstry_u.108", 0x80000, 0x442307ed, BRF_GRA }, // 13 - { "bcstry_u.102", 0x80000, 0x71b40ece, BRF_GRA }, // 14 - { "bcstry_u.107", 0x80000, 0xab3c923a, BRF_GRA }, // 15 - - { "bcstry_u.64", 0x40000, 0x23f0e0fe, BRF_SND }, // 16 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 17 -}; - -STD_ROM_PICK(Bcstrya) -STD_ROM_FN(Bcstrya) - -static struct BurnRomInfo SemibaseRomDesc[] = { - { "ic62.68k", 0x40000, 0x85ea81c3, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ic35.68k", 0x40000, 0xd2249605, BRF_ESS | BRF_PRG }, // 1 - - { "ic21.z80", 0x10000, 0xd95c64d0, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "protdata.bin", 0x00200, 0xecbf2163, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "ic109.gfx", 0x80000, 0x2b86e983, BRF_GRA }, // 4 Tiles - { "ic113.gfx", 0x80000, 0xe39b6610, BRF_GRA }, // 5 - { "ic110.gfx", 0x80000, 0xbba4a015, BRF_GRA }, // 6 - { "ic111.gfx", 0x80000, 0x61133b63, BRF_GRA }, // 7 - - { "ic100.gfx", 0x80000, 0x01c3d12a, BRF_GRA }, // 8 Sprites - { "ic106.gfx", 0x80000, 0xdb282ac2, BRF_GRA }, // 9 - { "ic99.gfx", 0x80000, 0x349df821, BRF_GRA }, // 10 - { "ic105.gfx", 0x80000, 0xf7caa81c, BRF_GRA }, // 11 - { "ic104.gfx", 0x80000, 0x51a5d38a, BRF_GRA }, // 12 - { "ic108.gfx", 0x80000, 0xb253d60e, BRF_GRA }, // 13 - { "ic102.gfx", 0x80000, 0x3caefe97, BRF_GRA }, // 14 - { "ic107.gfx", 0x80000, 0x68109898, BRF_GRA }, // 15 - - { "ic64.snd", 0x40000, 0x8a60649c, BRF_SND }, // 16 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 17 -}; - -STD_ROM_PICK(Semibase) -STD_ROM_FN(Semibase) - -static struct BurnRomInfo DquizgoRomDesc[] = { - { "ub17", 0x80000, 0x0b96ab14, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "ub18", 0x80000, 0x07f869f2, BRF_ESS | BRF_PRG }, // 1 - - { "ub5", 0x10000, 0xe40481da, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "protdata.bin", 0x00200, 0x6064b9e0, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data - - { "srom5", 0x80000, 0xf1cdd21d, BRF_GRA }, // 4 Tiles - { "srom6", 0x80000, 0xf848939e, BRF_GRA }, // 5 - - { "uor1", 0x80000, 0xb4912bf6, BRF_GRA }, // 6 Sprites - { "uor2", 0x80000, 0xb011cf93, BRF_GRA }, // 7 - { "uor3", 0x80000, 0xd96c3582, BRF_GRA }, // 8 - { "uor4", 0x80000, 0x77ff23eb, BRF_GRA }, // 9 - - { "uc1", 0x40000, 0xd0f4c4ba, BRF_SND }, // 10 Samples - - { "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11 -}; - -STD_ROM_PICK(Dquizgo) -STD_ROM_FN(Dquizgo) - -static struct BurnRomInfo JumppopRomDesc[] = { - { "68k_prg.bin", 0x080000, 0x123536b9, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - - { "z80_prg.bin", 0x040000, 0xa88d4424, BRF_ESS | BRF_PRG }, // 1 Z80 Program Code - - { "bg0.bin", 0x100000, 0x35a1363d, BRF_GRA }, // 2 Tiles - { "bg1.bin", 0x100000, 0x5b37f943, BRF_GRA }, // 3 - - { "sp0.bin", 0x100000, 0x7c5d0633, BRF_GRA }, // 4 Sprites - { "sp1.bin", 0x100000, 0x7eae782e, BRF_GRA }, // 5 - - { "samples.bin", 0x040000, 0x066f30a7, BRF_SND }, // 6 Samples -}; - -STD_ROM_PICK(Jumppop) -STD_ROM_FN(Jumppop) - -static struct BurnRomInfo JumppopeRomDesc[] = { - { "esd2.cu02", 0x040000, 0x302dd093, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "esd1.cu03", 0x040000, 0x883392ba, BRF_ESS | BRF_PRG }, // 1 - - { "at27c020.su06", 0x040000, 0xa88d4424, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code - - { "esd7.ju03", 0x040000, 0x9c2970e0, BRF_GRA }, // 3 Tiles - { "esd8.ju04", 0x040000, 0x33bf99b0, BRF_GRA }, // 4 - { "esd9.ju05", 0x040000, 0x671d21fd, BRF_GRA }, // 5 - { "esd10.ju06", 0x040000, 0x85a3cc73, BRF_GRA }, // 6 - - { "esd5.fu28", 0x080000, 0x0d47f821, BRF_GRA }, // 7 Sprites - { "esd6.fu29", 0x080000, 0xc01af40d, BRF_GRA }, // 8 - { "esd4.fu26", 0x080000, 0x97b409be, BRF_GRA }, // 9 - { "esd3.fu27", 0x080000, 0x3358a693, BRF_GRA }, // 10 - - { "at27c020.su10", 0x040000, 0x066f30a7, BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(Jumppope) -STD_ROM_FN(Jumppope) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x100000; - if (DrvHasZ80) { DrvZ80Rom = Next; Next += 0x010000; } - if (DrvHasProt) { DrvProtData = Next; Next += 0x000200; } - MSM6295ROM = Next; Next += 0x040000; - DrvMSM6295ROMSrc = Next; Next += 0x100000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x010800; - if (DrvHasZ80) { DrvZ80Ram = Next; Next += 0x000800; } - DrvSpriteRam = Next; Next += DrvSpriteRamSize; - DrvPf1Ram = Next; Next += 0x002000; - DrvPf2Ram = Next; Next += 0x002000; - DrvPaletteRam = Next; Next += 0x001000; - DrvControl = (UINT16*)Next; Next += 8 * sizeof(UINT16); - - RamEnd = Next; - - DrvChars = Next; Next += DrvNumChars * 8 * 8; - DrvTiles = Next; Next += DrvNumTiles * 16 * 16; - DrvSprites = Next; Next += DrvNumSprites * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 JumppopMemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x080000; - DrvZ80Rom = Next; Next += 0x040000; - MSM6295ROM = Next; Next += 0x040000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x0c0000; - DrvZ80Ram = Next; Next += 0x000800; - DrvSpriteRam = Next; Next += DrvSpriteRamSize; - DrvPf1Ram = Next; Next += 0x004000; - DrvPf2Ram = Next; Next += 0x004000; - DrvPaletteRam = Next; Next += 0x000800; - DrvControl = (UINT16*)Next; Next += 8 * sizeof(UINT16); - - RamEnd = Next; - - DrvChars = Next; Next += DrvNumChars * 8 * 8; - DrvTiles = Next; Next += DrvNumTiles * 16 * 16; - DrvSprites = Next; Next += DrvNumSprites * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - if (DrvHasProt == 1) memcpy(Drv68KRam + 0x000, DrvProtData, 0x200); - if (DrvHasProt == 2) memcpy(Drv68KRam + 0x200, DrvProtData, 0x200); - - SekOpen(0); - SekReset(); - SekClose(); - - if (DrvHasZ80) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } - - if (DrvHasYM2151) BurnYM2151Reset(); - if (DrvHasYM3812) BurnYM3812Reset(); - - MSM6295Reset(0); - - DrvVBlank = 0; - DrvOkiBank = 0; - DrvTileBank = 0; - DrvSoundLatch = 0; - Tumbleb2MusicCommand = 0; - Tumbleb2MusicBank = 0; - Tumbleb2MusicIsPlaying = 0; - memset(DrvControl, 0, 8); - - return 0; -} - -static const INT32 Tumbleb2SoundLookup[256] = { - /*0 1 2 3 4 5 6 7 8 9 a b c d e f*/ - 0x00, -2, 0x00, 0x00, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 0x00, -2, /* 0 */ - -2, 0x00, -2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, /* 2 */ - 0x19, 0x00, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 3 */ - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 6 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* f */ -}; - -static void Tumbleb2PlayMusic() -{ - INT32 Status = MSM6295ReadStatus(0); - - if (Tumbleb2MusicIsPlaying) - { - if ((Status & 0x08) == 0) { - MSM6295Command(0, 0x80 | Tumbleb2MusicCommand); - MSM6295Command(0, 0x00 | 0x82); - } - } -} - -static void Tumbleb2SetMusicBank(INT32 Bank) -{ - memcpy(MSM6295ROM + 0x38000, DrvMSM6295ROMSrc + 0x38000 + (Bank * 0x8000), 0x8000); -} - -static void Tumbleb2PlaySound(UINT16 data) -{ - INT32 Status = MSM6295ReadStatus(0); - - if ((Status & 0x01) == 0) { - MSM6295Command(0, 0x80 | data); - MSM6295Command(0, 0x00 | 0x12); - } else { - if ((Status & 0x02) == 0) { - MSM6295Command(0, 0x80 | data); - MSM6295Command(0, 0x00 | 0x22); - } else { - if ((Status & 0x04) == 0) { - MSM6295Command(0, 0x80 | data); - MSM6295Command(0, 0x00 | 0x42); - } - } - } -} - -static void Tumbleb2ProcessMusicCommand(UINT16 data) -{ - INT32 Status = MSM6295ReadStatus(0); - - if (data == 1) { - if ((Status & 0x08) == 0x08) { - MSM6295Command(0, 0x40); - Tumbleb2MusicIsPlaying = 0; - } - } else { - if (Tumbleb2MusicIsPlaying != data) { - Tumbleb2MusicIsPlaying = data; - - MSM6295Command(0, 0x40); - - switch (data) { - case 0x04: // map screen - Tumbleb2MusicBank = 1; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x05: // america - Tumbleb2MusicBank = 6; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x06: // asia - Tumbleb2MusicBank = 2; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x07: // africa/egypt -- don't seem to have a tune for this one - Tumbleb2MusicBank = 4; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x08: // antartica - Tumbleb2MusicBank = 3; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x09: // brazil / south america - Tumbleb2MusicBank = 4; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x0a: // japan -- don't seem to have a tune - Tumbleb2MusicBank = 2; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x0b: // australia - Tumbleb2MusicBank = 5; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x0c: // france/europe - Tumbleb2MusicBank = 6; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x0d: // how to play - Tumbleb2MusicBank = 7; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x0f: // stage clear - Tumbleb2MusicBank = 0; - Tumbleb2MusicCommand = 0x33; - break; - - case 0x10: // boss stage - Tumbleb2MusicBank = 8; - Tumbleb2MusicCommand = 0x38; - break; - - case 0x12: // world clear - Tumbleb2MusicBank = 0; - Tumbleb2MusicCommand = 0x34; - break; - - default: // anything else.. - Tumbleb2MusicBank = 8; - Tumbleb2MusicCommand = 0x38; - break; - } - - Tumbleb2SetMusicBank(Tumbleb2MusicBank); - Tumbleb2PlayMusic(); - } - } -} - -static void Tumbleb2SoundMCUCommand(UINT16 data) -{ - INT32 Sound = Tumbleb2SoundLookup[data & 0xff]; - - if (Sound == 0) { - - } else { - if (Sound == -2) { - Tumbleb2ProcessMusicCommand(data); - } else { - Tumbleb2PlaySound(Sound); - } - } -} - -UINT8 __fastcall Tumbleb68KReadByte(UINT32 a) -{ - switch (a) { - case 0x100001: { - return ~0; - } - - case 0x180002: { - return DrvDip[1]; - } - - case 0x180003: { - return DrvDip[0]; - } - - case 0x180009: { - if (Semibase) return 0xff - DrvInput[2]; - if (DrvVBlank) { - if (Wondl96) { - return 0xf3 - DrvInput[2]; - } else { - return 0xf7 - DrvInput[2]; - } - } - if (Wondl96) return 0xfb - DrvInput[2]; - return 0xff - DrvInput[2]; - } - - case 0x18000a: { - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Tumbleb68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x100000: { - if (Tumbleb2) { - Tumbleb2SoundMCUCommand(d); - return; - } else { - MSM6295Command(0, d); - return; - } - } - - case 0x100001: { - if (SemicomSoundCommand) DrvSoundLatch = d; - return; - } - - case 0x100002: { - if (Chokchok) DrvTileBank = (d << 8) << 1; - if (Bcstry) DrvTileBank = d << 8; - return; - } - - case 0x100003: { - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Tumbleb68KReadWord(UINT32 a) -{ - switch (a) { - case 0x100004: { - return BurnRandom() % 0x10000; - } - - case 0x180000: { - return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]); - } - - case 0x180002: { - return (DrvDip[1] << 8) | DrvDip[0]; - } - - case 0x180004: { - return -0; - } - - case 0x180006: { - return -0; - } - - case 0x180008: { - if (Bcstry && (SekGetPC(0) == 0x560)) { - return 0x1a0; - } else { - if (Semibase) return 0xffff - DrvInput[2]; - if (DrvVBlank) { - if (Wondl96) { - return 0xfff3 - DrvInput[2]; - } else { - return 0xfff7 - DrvInput[2]; - } - } - } - if (Wondl96) return 0xfff3 - DrvInput[2]; - return 0xffff - DrvInput[2]; - } - - case 0x18000a: { - return 0; - } - - case 0x18000c: { - return 0; - } - - case 0x18000e: { - return -0; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Tumbleb68KWriteWord(UINT32 a, UINT16 d) -{ -#if 1 && defined FBA_DEBUG - if (a >= 0x160800 && a <= 0x160807) return; - if (a >= 0x198000 && a <= 0x1a8015) return; - if (a >= 0x321000 && a <= 0x321fff) return; - if (a >= 0x323000 && a <= 0x331fff) return; - if (a >= 0x340000 && a <= 0x3401ff) return; - if (a >= 0x340400 && a <= 0x34047f) return; - if (a >= 0x342000 && a <= 0x3421ff) return; - if (a >= 0x342400 && a <= 0x34247f) return; -#endif - - if (a >= 0x300000 && a <= 0x30000f) { - DrvControl[(a - 0x300000) >> 1] = d; - return; - } - - switch (a) { - case 0x100000: { - if (Tumbleb2) { - Tumbleb2SoundMCUCommand(d); - return; - } else { - if (Jumpkids) { - DrvSoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - return; - } else { - if (SemicomSoundCommand) { - if (d & 0xff) DrvSoundLatch = d & 0xff; - return; - } else { - MSM6295Command(0, d & 0xff); - return; - } - } - } - } - - case 0x100002: { - if (Wlstar) DrvTileBank = d & 0x4000; - return; - } - - case 0x18000c: { - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT16 __fastcall Suprtrio68KReadWord(UINT32 a) -{ - switch (a) { - case 0xe00000: { - return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]); - } - - case 0xe40000: { - return 0xffff - DrvInput[2]; - } - - case 0xe80002: { - return 0xff00 | DrvDip[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Suprtrio68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0xa00000 && a <= 0xa0000f) { - DrvControl[(a - 0xa00000) >> 1] = d; - return; - } - - switch (a) { - case 0xe00000: { - DrvTileBank = d << 14; - return; - } - - case 0xec0000: { - if (SemicomSoundCommand) { - if (d & 0xff) DrvSoundLatch = d & 0xff; - } - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Fncywld68KReadByte(UINT32 a) -{ - switch (a) { - case 0x100003: { - return 0; - } - - case 0x100005: { - return MSM6295ReadStatus(0); - } - - case 0x180002: { - return DrvDip[1]; - } - - case 0x180005: { - return -0; - } - - case 0x180009: { - if (DrvVBlank) return 0xf7 - DrvInput[2]; - return 0xff - DrvInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Fncywld68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x100001: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x100003: { - BurnYM2151WriteRegister(d); - return; - } - - case 0x100005: { - MSM6295Command(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Fncywld68KReadWord(UINT32 a) -{ - switch (a) { - case 0x180000: { - return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]); - } - - case 0x180002: { - return (DrvDip[1] << 8) | DrvDip[0]; - } - - case 0x180004: { - return -0; - } - - case 0x180006: { - return -0; - } - - case 0x180008: { - if (DrvVBlank) return 0xfff7 - DrvInput[2]; - return 0xffff - DrvInput[2]; - } - - case 0x18000a: { - return 0; - } - - case 0x18000c: { - return 0; - } - - case 0x18000e: { - return -0; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Fncywld68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x160800 && a <= 0x160807) return; - - if (a >= 0x300000 && a <= 0x30000f) { - DrvControl[(a - 0x300000) >> 1] = d; - return; - } - - switch (a) { - case 0x100000: { - BurnYM2151SelectRegister(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT16 __fastcall Jumppop68KReadWord(UINT32 a) -{ - switch (a) { - case 0x180002: { - return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]); - } - - case 0x180004: { - return 0xffff - DrvInput[2]; - } - - case 0x180006: { - return (DrvDip[1] << 8) | DrvDip[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Jumppop68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x380000 && a <= 0x38000f) { - DrvControl[(a - 0x380000) >> 1] = d; - return; - } - - switch (a) { - case 0x180000: { - // NOP - return; - } - - case 0x18000c: { - DrvSoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - - case 0x180008: - case 0x18000a: { - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall JumpkidsZ80Read(UINT16 a) -{ - switch (a) { - case 0x9800: { - return MSM6295ReadStatus(0); - } - - case 0xa000: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall JumpkidsZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - DrvOkiBank = d & 3; - memcpy(MSM6295ROM + 0x20000, DrvMSM6295ROMSrc + (DrvOkiBank * 0x20000), 0x20000); - return; - } - - case 0x9800: { - MSM6295Command(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall SemicomZ80Read(UINT16 a) -{ - switch (a) { - case 0xf001: { - return BurnYM2151ReadStatus(); - } - - case 0xf002: { - return MSM6295ReadStatus(0); - } - - case 0xf008: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall SemicomZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xf000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xf001: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xf002: { - MSM6295Command(0, d); - return; - } - - case 0xf006: { - return; - } - - case 0xf00e: { - DrvOkiBank = d; - memcpy(MSM6295ROM + 0x30000, DrvMSM6295ROMSrc + 0x30000 + (DrvOkiBank * 0x10000), 0x10000); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall JumppopZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x02: { - return MSM6295ReadStatus(0); - } - - case 0x03: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return DrvSoundLatch; - } - - case 0x06: { - // NOP - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Read -> %02X\n"), a); - } - } - - return 0; -} - -void __fastcall JumppopZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - BurnYM3812Write(0, 0, d); - return; - } - - case 0x01: { - BurnYM3812Write(0, 1, d); - return; - } - - case 0x02: { - MSM6295Command(0, d); - return; - } - - case 0x04: { - // NOP - return; - } - - case 0x05: { - DrvZ80Bank = d; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + (DrvZ80Bank * 0x4000)); - return; - } - - case 0x06: { - // NOP - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Port Write -> %02X, %02x\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[4] = { 0x200008, 0x200000, 8, 0 }; -static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 SpritePlaneOffsets[4] = { 0x400008, 0x400000, 8, 0 }; -static INT32 Sprite2PlaneOffsets[4] = { 0x800008, 0x800000, 8, 0 }; -static INT32 Sprite3PlaneOffsets[4] = { 0x1000008, 0x1000000, 8, 0 }; -static INT32 SpriteXOffsets[16] = { 256, 257, 258, 259, 260, 261, 262, 263, 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 SpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; -static INT32 SuprtrioPlaneOffsets[4] = { 0x400000, 0, 0x600000, 0x200000 }; -static INT32 SuprtrioXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 SuprtrioYOffsets[16] = { 8, 0, 16, 24, 40, 32, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 JpCharPlaneOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 JpCharXOffsets[8] = { 0x800000, 0x800008, 0, 8, 0x800010, 0x800018, 16, 24 }; -static INT32 JpCharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 JpeCharPlaneOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 JpeCharXOffsets[8] = { 0, 16, 8, 24, 32, 48, 40, 56 }; -static INT32 JpeCharYOffsets[8] = { 0, 64, 128, 192, 256, 320, 384, 448 }; -static INT32 JpTilePlaneOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 JpTileXOffsets[16] = { 0x800000, 0x800008, 0, 8, 0x800010, 0x800018, 16, 24, 0x800100, 0x800108, 256, 264, 0x800110, 0x800118, 272, 280 }; -static INT32 JpTileYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; -static INT32 JpeTilePlaneOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 JpeTileXOffsets[16] = { 0, 16, 8, 24, 32, 48, 40, 56, 512, 528, 520, 536, 544, 560, 552, 568 }; -static INT32 JpeTileYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 1024, 1088, 1152, 1216, 1280, 1344, 1408, 1472 }; - -static void TumblebTilesRearrange() -{ - UINT8 *rom = DrvTempRom; - INT32 len = DrvNumTiles * 128; - INT32 i; - - /* gfx data is in the wrong order */ - for (i = 0;i < len;i++) - { - if ((i & 0x20) == 0) - { - INT32 t = rom[i]; rom[i] = rom[i + 0x20]; rom[i + 0x20] = t; - } - } - /* low/high half are also swapped */ - for (i = 0;i < len/2;i++) - { - INT32 t = rom[i]; rom[i] = rom[i + len/2]; rom[i + len/2] = t; - } -} - -static INT32 TumblebLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 3, 2); if (nRet != 0) return 1; - TumblebTilesRearrange(); - GfxDecode(DrvNumChars, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 5, 1); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 6, 1); if (nRet != 0) return 1; - if (Tumbleb2) { nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x80000, 6, 1); if (nRet != 0) return 1; } - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 JumpkidsLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 4, 2); if (nRet != 0) return 1; - TumblebTilesRearrange(); - GfxDecode(DrvNumChars, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080001, 8, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 10, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 MetlsavrLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x200000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(DrvProtData, 3, 1); if (nRet) return 1; - BurnByteswap(DrvProtData, 0x200); - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1; - TumblebTilesRearrange(); - GfxDecode(DrvNumChars, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100001, 9, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM, 10, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 PangpangLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080001, 5, 2); if (nRet != 0) return 1; - UINT8 *pTemp = (UINT8*)BurnMalloc(0x100000); - memcpy(pTemp, DrvTempRom, 0x100000); - memset(DrvTempRom, 0, 0x100000); - memcpy(DrvTempRom + 0x000000, pTemp + 0x000000, 0x40000); - memcpy(DrvTempRom + 0x080000, pTemp + 0x040000, 0x40000); - memcpy(DrvTempRom + 0x040000, pTemp + 0x080000, 0x40000); - memcpy(DrvTempRom + 0x0c0000, pTemp + 0x0c0000, 0x40000); - BurnFree(pTemp); - TumblebTilesRearrange(); - GfxDecode(DrvNumChars, 4, 8, 8, SpritePlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080001, 9, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 10, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - return 0; -} - -static void SuprtrioDecrypt68KRom() -{ - UINT16 *Rom = (UINT16*)Drv68KRom; - UINT16 *pTemp = (UINT16*)BurnMalloc(0x80000); - INT32 i; - - memcpy(pTemp, Rom, 0x80000); - for (i = 0; i < 0x40000; i++) { - INT32 j = i ^ 0x06; - if ((i & 1) == 0) j ^= 0x02; - if ((i & 3) == 0) j ^= 0x08; - Rom[i] = pTemp[j]; - } - BurnFree(pTemp); -} - -static void SuprtrioDecryptTiles() -{ - UINT16 *Rom = (UINT16*)DrvTempRom; - UINT16 *pTemp = (UINT16*)BurnMalloc(0x100000); - INT32 i; - - memcpy(pTemp, Rom, 0x100000); - for (i = 0; i < 0x80000; i++) { - INT32 j = i ^ 0x02; - if (i & 1) j ^= 0x04; - Rom[i] = pTemp[j]; - } - BurnFree(pTemp); -} - -static INT32 SuprtrioLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - SuprtrioDecrypt68KRom(); - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 4, 1); if (nRet != 0) return 1; - UINT8 *pTemp = (UINT8*)BurnMalloc(0x100000); - memcpy(pTemp, DrvTempRom, 0x100000); - memset(DrvTempRom, 0, 0x100000); - memcpy(DrvTempRom + 0x000000, pTemp + 0x000000, 0x20000); - memcpy(DrvTempRom + 0x040000, pTemp + 0x020000, 0x20000); - memcpy(DrvTempRom + 0x020000, pTemp + 0x040000, 0x20000); - memcpy(DrvTempRom + 0x060000, pTemp + 0x060000, 0x20000); - memcpy(DrvTempRom + 0x080000, pTemp + 0x080000, 0x20000); - memcpy(DrvTempRom + 0x0c0000, pTemp + 0x0a0000, 0x20000); - memcpy(DrvTempRom + 0x0a0000, pTemp + 0x0c0000, 0x20000); - memcpy(DrvTempRom + 0x0e0000, pTemp + 0x0e0000, 0x20000); - BurnFree(pTemp); - SuprtrioDecryptTiles(); - GfxDecode(DrvNumTiles, 4, 16, 16, SuprtrioPlaneOffsets, SuprtrioXOffsets, SuprtrioYOffsets, 0x100, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080001, 8, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x80000, 10, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 HtchctchLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(DrvProtData, 3, 1); if (nRet) return 1; - BurnByteswap(DrvProtData, 0x200); - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1; - TumblebTilesRearrange(); - GfxDecode(DrvNumChars, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040001, 9, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM, 10, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 ChokchokLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x200000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(DrvProtData, 3, 1); if (nRet) return 1; - BurnByteswap(DrvProtData, 0x200); - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1; - UINT8 *pTemp = (UINT8*)BurnMalloc(0x100000); - memcpy(pTemp, DrvTempRom, 0x100000); - memset(DrvTempRom, 0, 0x200000); - memcpy(DrvTempRom + 0x000000, pTemp + 0x000000, 0x40000); - memcpy(DrvTempRom + 0x100000, pTemp + 0x040000, 0x40000); - memcpy(DrvTempRom + 0x040000, pTemp + 0x080000, 0x40000); - memcpy(DrvTempRom + 0x140000, pTemp + 0x0c0000, 0x40000); - BurnFree(pTemp); - TumblebTilesRearrange(); - GfxDecode(DrvNumChars, 4, 8, 8, Sprite2PlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100001, 9, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM, 10, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 FncywldLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x100000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080001, 5, 2); if (nRet != 0) return 1; - TumblebTilesRearrange(); - GfxDecode(DrvNumChars, 4, 8, 8, SpritePlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x100000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x080001, 9, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM + 0x00000, 10, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 SdfightLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x400000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(DrvTempRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00000, 1, 2); if (nRet != 0) return 1; - memcpy(Drv68KRom + 0xc0000, DrvTempRom + 0x00000, 0x40000); - memcpy(Drv68KRom + 0x80000, DrvTempRom + 0x40000, 0x40000); - memcpy(Drv68KRom + 0x40000, DrvTempRom + 0x80000, 0x40000); - memcpy(Drv68KRom + 0x00000, DrvTempRom + 0xc0000, 0x40000); - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load Shared RAM data - nRet = BurnLoadRom(DrvProtData, 3, 1); if (nRet) return 1; - BurnByteswap(DrvProtData, 0x200); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x400000); - nRet = BurnLoadRom(DrvTempRom + 0x200001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300001, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 7, 2); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x000000, DrvTempRom + 0x200000, 0x40000); - memcpy(DrvTempRom + 0x100000, DrvTempRom + 0x240000, 0x40000); - memcpy(DrvTempRom + 0x040000, DrvTempRom + 0x280000, 0x40000); - memcpy(DrvTempRom + 0x140000, DrvTempRom + 0x2c0000, 0x40000); - memcpy(DrvTempRom + 0x080000, DrvTempRom + 0x300000, 0x40000); - memcpy(DrvTempRom + 0x180000, DrvTempRom + 0x340000, 0x40000); - memcpy(DrvTempRom + 0x0c0000, DrvTempRom + 0x380000, 0x40000); - memcpy(DrvTempRom + 0x1c0000, DrvTempRom + 0x3c0000, 0x40000); - TumblebTilesRearrange(); - GfxDecode(DrvNumChars, 4, 8, 8, Sprite2PlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 9, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 10, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100001, 11, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 12, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200001, 13, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 14, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300001, 15, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, Sprite3PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM, 16, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 BcstryLoadRoms() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x400000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(DrvTempRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x00000, 1, 2); if (nRet != 0) return 1; - memcpy(Drv68KRom + 0x40000, DrvTempRom + 0x00000, 0x40000); - memcpy(Drv68KRom + 0x00000, DrvTempRom + 0x40000, 0x40000); - - // Load Z80 Program Roms - memset(DrvTempRom, 0, 0x400000); - nRet = BurnLoadRom(DrvTempRom, 2, 1); if (nRet != 0) return 1; - memcpy(DrvZ80Rom + 0x04000, DrvTempRom + 0x00000, 0x04000); - memcpy(DrvZ80Rom + 0x00000, DrvTempRom + 0x04000, 0x04000); - memcpy(DrvZ80Rom + 0x0c000, DrvTempRom + 0x08000, 0x04000); - memcpy(DrvZ80Rom + 0x08000, DrvTempRom + 0x0c000, 0x04000); - - // Load Shared RAM data - memset(DrvTempRom, 0, 0x400000); - nRet = BurnLoadRom(DrvProtData, 3, 1); if (nRet) return 1; - BurnByteswap(DrvProtData, 0x200); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x400000); - nRet = BurnLoadRom(DrvTempRom + 0x200000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200001, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300001, 7, 2); if (nRet != 0) return 1; - memcpy(DrvTempRom + 0x000000, DrvTempRom + 0x200000, 0x40000); - memcpy(DrvTempRom + 0x100000, DrvTempRom + 0x240000, 0x40000); - memcpy(DrvTempRom + 0x040000, DrvTempRom + 0x280000, 0x40000); - memcpy(DrvTempRom + 0x140000, DrvTempRom + 0x2c0000, 0x40000); - memcpy(DrvTempRom + 0x080000, DrvTempRom + 0x300000, 0x40000); - memcpy(DrvTempRom + 0x180000, DrvTempRom + 0x340000, 0x40000); - memcpy(DrvTempRom + 0x0c0000, DrvTempRom + 0x380000, 0x40000); - memcpy(DrvTempRom + 0x1c0000, DrvTempRom + 0x3c0000, 0x40000); - TumblebTilesRearrange(); - GfxDecode(DrvNumChars, 4, 8, 8, Sprite2PlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 9, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 10, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100001, 11, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 12, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200001, 13, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 14, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300001, 15, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, Sprite3PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM, 16, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static void TumblebMap68k() -{ - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x120000, 0x123fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x160000, 0x1607ff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x4000 , 0x1a0000, 0x1a07ff, MAP_RAM); - SekMapMemory(DrvPf1Ram , 0x320000, 0x320fff, MAP_RAM); - SekMapMemory(DrvPf2Ram , 0x322000, 0x322fff, MAP_RAM); - SekSetReadWordHandler(0, Tumbleb68KReadWord); - SekSetWriteWordHandler(0, Tumbleb68KWriteWord); - SekSetReadByteHandler(0, Tumbleb68KReadByte); - SekSetWriteByteHandler(0, Tumbleb68KWriteByte); - SekClose(); -} - -static void PangpangMap68k() -{ - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x120000, 0x123fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x160000, 0x1607ff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x4000 , 0x1a0000, 0x1a07ff, MAP_RAM); - SekMapMemory(DrvPf1Ram , 0x320000, 0x321fff, MAP_RAM); - SekMapMemory(DrvPf2Ram , 0x340000, 0x341fff, MAP_RAM); - SekSetReadWordHandler(0, Tumbleb68KReadWord); - SekSetWriteWordHandler(0, Tumbleb68KWriteWord); - SekSetReadByteHandler(0, Tumbleb68KReadByte); - SekSetWriteByteHandler(0, Tumbleb68KWriteByte); - SekClose(); -} - -static void SuprtrioMap68k() -{ - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0x700000, 0x7007ff, MAP_RAM); - SekMapMemory(DrvPf1Ram , 0xa20000, 0xa20fff, MAP_RAM); - SekMapMemory(DrvPf2Ram , 0xa22000, 0xa22fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0xcf0000, 0xcf05ff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xf00000, 0xf07fff, MAP_RAM); - SekSetReadWordHandler(0, Suprtrio68KReadWord); - SekSetWriteWordHandler(0, Suprtrio68KWriteWord); - SekClose(); -} - -static void HtchctchMap68k() -{ - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x120000, 0x123fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x160000, 0x160fff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x4000 , 0x1a0000, 0x1a0fff, MAP_RAM); - SekMapMemory(DrvPf1Ram , 0x320000, 0x321fff, MAP_RAM); - SekMapMemory(DrvPf2Ram , 0x322000, 0x322fff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x5000 , 0x341000, 0x342fff, MAP_RAM); - SekSetReadWordHandler(0, Tumbleb68KReadWord); - SekSetWriteWordHandler(0, Tumbleb68KWriteWord); - SekSetReadByteHandler(0, Tumbleb68KReadByte); - SekSetWriteByteHandler(0, Tumbleb68KWriteByte); - SekClose(); -} - -static void FncywldMap68k() -{ - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x140fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x160000, 0x1607ff, MAP_RAM); - SekMapMemory(DrvPf1Ram , 0x320000, 0x321fff, MAP_RAM); - SekMapMemory(DrvPf2Ram , 0x322000, 0x323fff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xff0000, 0xffffff, MAP_RAM); - SekSetReadWordHandler(0, Fncywld68KReadWord); - SekSetWriteWordHandler(0, Fncywld68KWriteWord); - SekSetReadByteHandler(0, Fncywld68KReadByte); - SekSetWriteByteHandler(0, Fncywld68KWriteByte); - SekClose(); -} - -static void JumpkidsMapZ80() -{ - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(JumpkidsZ80Read); - ZetSetWriteHandler(JumpkidsZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom ); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80Ram ); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80Ram ); - ZetClose(); -} - -static void SemicomMapZ80() -{ - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(SemicomZ80Read); - ZetSetWriteHandler(SemicomZ80Write); - ZetMapArea(0x0000, 0xcfff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xcfff, 2, DrvZ80Rom ); - ZetMapArea(0xd000, 0xd7ff, 0, DrvZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 1, DrvZ80Ram ); - ZetMapArea(0xd000, 0xd7ff, 2, DrvZ80Ram ); - ZetClose(); -} - -static void SemicomYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvInit(bool bReset, INT32 SpriteRamSize, INT32 SpriteMask, INT32 SpriteXOffset, INT32 SpriteYOffset, INT32 NumSprites, INT32 NumChars, INT32 NumTiles, double Refresh, INT32 OkiFreq) -{ - INT32 nRet = 0, nLen; - - DrvSpriteRamSize = SpriteRamSize; - DrvNumSprites = NumSprites, - DrvNumChars = NumChars, - DrvNumTiles = NumTiles, - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - nRet = DrvLoadRoms(); - - if (nRet) return 1; - - DrvMap68k(); - - if (DrvHasZ80) DrvMapZ80(); - - if (DrvHasYM2151) { - if (!DrvYM2151Freq) DrvYM2151Freq = 3427190; - BurnYM2151Init(DrvYM2151Freq); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.10, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.10, BURN_SND_ROUTE_RIGHT); - if (DrvHasZ80) { - BurnYM2151SetIrqHandler(&SemicomYM2151IrqHandler); - } - } - - // Setup the OKIM6295 emulation - if (DrvHasYM2151) { - MSM6295Init(0, OkiFreq / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - } else { - MSM6295Init(0, OkiFreq / 132, 0); - MSM6295SetRoute(0, 0.70, BURN_SND_ROUTE_BOTH); - } - - BurnSetRefreshRate(Refresh); - - nCyclesTotal[0] = 14000000 / 60; - - DrvSpriteXOffset = SpriteXOffset; - DrvSpriteYOffset = SpriteYOffset; - DrvSpriteMask = SpriteMask; - DrvSpriteColourMask = 0x0f; - Pf1XOffset = -5; - Pf1YOffset = 0; - Pf2XOffset = -1; - Pf2YOffset = 0; - - GenericTilesInit(); - - // Reset the driver - if (bReset) DrvDoReset(); - - return 0; -} - -static INT32 TumblebInit() -{ - DrvLoadRoms = TumblebLoadRoms; - DrvMap68k = TumblebMap68k; - DrvRender = DrvDraw; - - return DrvInit(1, 0x800, 0x3fff, -1, 0, 0x2000, 0x4000, 0x1000, 58.0, 8000000 / 10); -} - -static INT32 Tumbleb2Init() -{ - Tumbleb2 = 1; - return TumblebInit(); -} - -static INT32 JumpkidsInit() -{ - INT32 nRet; - - Jumpkids = 1; - DrvHasZ80 = 1; - DrvLoadRoms = JumpkidsLoadRoms; - DrvMap68k = TumblebMap68k; - DrvMapZ80 = JumpkidsMapZ80; - DrvRender = DrvDraw; - - nRet = DrvInit(1, 0x800, 0x7fff, -1, 0, 0x2000, 0x4000, 0x1000, 60.0, 8000000 / 8); - - nCyclesTotal[0] = 12000000 / 60; - nCyclesTotal[1] = (8000000 / 2) / 60; - - return nRet; -} - -static INT32 MetlsavrInit() -{ - INT32 nRet; - - DrvHasZ80 = 1; - DrvHasYM2151 = 1; - DrvHasProt = 1; - SemicomSoundCommand = 1; - DrvLoadRoms = MetlsavrLoadRoms; - DrvMap68k = HtchctchMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = DrvDraw; - - nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x4000, 0x1000, 60.0, 1024000); - - nCyclesTotal[0] = 15000000 / 60; - nCyclesTotal[1] = (15000000 / 4) / 60; - - return nRet; -} - -static INT32 PangpangInit() -{ - Tumbleb2 = 1; - DrvLoadRoms = PangpangLoadRoms; - DrvMap68k = PangpangMap68k; - DrvRender = PangpangDraw; - - INT32 nRet = DrvInit(1, 0x800, 0x7fff, -1, 0, 0x2000, 0x8000, 0x2000, 58.0, 8000000 / 10); - - MSM6295SetRoute(0, 0.70, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static INT32 SuprtrioInit() -{ - INT32 nRet; - - DrvHasZ80 = 1; - SemicomSoundCommand = 1; - DrvLoadRoms = SuprtrioLoadRoms; - DrvMap68k = SuprtrioMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = SuprtrioDraw; - - nRet = DrvInit(1, 0x800, 0x7fff, 0, 0, 0x2000, 0x8000, 0x2000, 60.0, 875000); - - Pf1XOffset = -6; - Pf2XOffset = -2; - nCyclesTotal[1] = 8000000 / 60; - - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static INT32 HtchctchInit() -{ - INT32 nRet; - - DrvHasZ80 = 1; - DrvHasYM2151 = 1; - DrvHasProt = 1; - SemicomSoundCommand = 1; - DrvLoadRoms = HtchctchLoadRoms; - DrvMap68k = HtchctchMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = HtchctchDraw; - - nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x1000, 0x4000, 0x1000, 60.0, 1024000); - - nCyclesTotal[0] = 15000000 / 60; - nCyclesTotal[1] = (15000000 / 4) / 60; - - return nRet; -} - -static INT32 CookbibInit() -{ - INT32 nRet = HtchctchInit(); - - Pf1XOffset = -5; - Pf1YOffset = 0; - Pf2XOffset = -1; - Pf2YOffset = 2; - - return nRet; -} - -static INT32 ChokchokInit() -{ - INT32 nRet; - - Chokchok = 1; - DrvHasZ80 = 1; - DrvHasYM2151 = 1; - DrvHasProt = 1; - SemicomSoundCommand = 1; - DrvLoadRoms = ChokchokLoadRoms; - DrvMap68k = HtchctchMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = DrvDraw; - - nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x10000, 0x4000, 60.0, 1024000); - - nCyclesTotal[0] = 15000000 / 60; - nCyclesTotal[1] = (15000000 / 4) / 60; - - Pf1XOffset = -5; - Pf1YOffset = 0; - Pf2XOffset = -1; - Pf2YOffset = 1; - - return nRet; -} - -static INT32 WlstarInit() -{ - INT32 nRet; - - Wlstar = 1; - DrvHasZ80 = 1; - DrvHasYM2151 = 1; - DrvHasProt = 1; - SemicomSoundCommand = 1; - DrvLoadRoms = ChokchokLoadRoms; - DrvMap68k = HtchctchMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = HtchctchDraw; - - nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x10000, 0x4000, 60.0, 1024000); - - nCyclesTotal[0] = 15000000 / 60; - nCyclesTotal[1] = (15000000 / 4) / 60; - - Pf1XOffset = -5; - Pf1YOffset = 0; - Pf2XOffset = -1; - Pf2YOffset = 2; - - return nRet; -} - -static INT32 Wondl96Init() -{ - INT32 nRet; - - Wlstar = 1; - Wondl96 = 1; - DrvHasZ80 = 1; - DrvHasYM2151 = 1; - DrvHasProt = 2; - SemicomSoundCommand = 1; - DrvLoadRoms = ChokchokLoadRoms; - DrvMap68k = HtchctchMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = HtchctchDraw; - - nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x10000, 0x4000, 60.0, 1024000); - - nCyclesTotal[0] = 15000000 / 60; - nCyclesTotal[1] = (15000000 / 4) / 60; - - Pf1XOffset = -5; - Pf1YOffset = 0; - Pf2XOffset = -1; - Pf2YOffset = 2; - - return nRet; -} - -static INT32 FncywldInit() -{ - INT32 nRet; - - DrvHasYM2151 = 1; - DrvHasZ80 = 0; - DrvYM2151Freq = 32220000 / 9; - DrvLoadRoms = FncywldLoadRoms; - DrvMap68k = FncywldMap68k; - DrvRender = FncywldDraw; - - nRet = DrvInit(1, 0x800, 0x3fff, -1, 0, 0x2000, 0x8000, 0x2000, 60.0, 1023924); - - nCyclesTotal[0] = 12000000 / 60; - DrvSpriteColourMask = 0x3f; - - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.20, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.20, BURN_SND_ROUTE_RIGHT); - - return nRet; -} - -static INT32 SdfightInit() -{ - INT32 nRet; - - Bcstry = 1; - DrvHasZ80 = 1; - DrvHasYM2151 = 1; - DrvYM2151Freq = 3427190; - DrvHasProt = 1; - SemicomSoundCommand = 1; - DrvLoadRoms = SdfightLoadRoms; - DrvMap68k = HtchctchMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = SdfightDraw; - - nRet = DrvInit(1, 0x1000, 0x7fff, 0, 1, 0x8000, 0x10000, 0x4000, 60.0, 1024000); - - nCyclesTotal[0] = 15000000 / 60; - nCyclesTotal[1] = (15000000 / 4) / 60; - - Pf1XOffset = -5; - Pf1YOffset = -16; - Pf2XOffset = -1; - Pf2YOffset = 0; - - return nRet; -} - -static INT32 BcstryInit() -{ - INT32 nRet; - - Bcstry = 1; - DrvHasZ80 = 1; - DrvHasYM2151 = 1; - DrvYM2151Freq = 3427190; - DrvHasProt = 1; - SemicomSoundCommand = 1; - DrvLoadRoms = BcstryLoadRoms; - DrvMap68k = HtchctchMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = HtchctchDraw; - - nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x8000, 0x10000, 0x4000, 60.0, 1024000); - - nCyclesTotal[0] = 15000000 / 60; - nCyclesTotal[1] = (15000000 / 4) / 60; - - //Pf1XOffset = 8; - Pf1XOffset = -5; - Pf1YOffset = 0; - //Pf2XOffset = 8; - Pf2XOffset = -1; - Pf2YOffset = 0; - - return nRet; -} - -static INT32 SemibaseInit() -{ - INT32 nRet; - - Semibase = 1; - Bcstry = 1; - DrvHasZ80 = 1; - DrvHasYM2151 = 1; - DrvYM2151Freq = 3427190; - DrvHasProt = 1; - SemicomSoundCommand = 1; - DrvLoadRoms = BcstryLoadRoms; - DrvMap68k = HtchctchMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = HtchctchDraw; - - nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x8000, 0x10000, 0x4000, 60.0, 1024000); - - nCyclesTotal[0] = 15000000 / 60; - nCyclesTotal[1] = (15000000 / 4) / 60; - - Pf1XOffset = -2; - Pf1YOffset = 0; - Pf2XOffset = -1; - Pf2YOffset = 0; - - return nRet; -} - -static INT32 DquizgoInit() -{ - INT32 nRet; - - DrvHasZ80 = 1; - DrvHasYM2151 = 1; - DrvHasProt = 2; - SemicomSoundCommand = 1; - DrvLoadRoms = MetlsavrLoadRoms; - DrvMap68k = HtchctchMap68k; - DrvMapZ80 = SemicomMapZ80; - DrvRender = HtchctchDraw; - - nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x4000, 0x1000, 60.0, 1024000); - - nCyclesTotal[0] = 15000000 / 60; - nCyclesTotal[1] = (15000000 / 4) / 60; - - Pf1XOffset = -5; - Pf1YOffset = 0; - Pf2XOffset = -1; - Pf2YOffset = 2; - - return nRet; -} - -inline static INT32 JumppopSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(ZetTotalCycles() * nSoundRate / 3500000); -} - -static INT32 JumppopInit() -{ - INT32 nRet = 0, nLen; - - DrvSpriteRamSize = 0x1000; - DrvNumSprites = 0x4000, - DrvNumChars = 0x8000, - DrvNumTiles = 0x2000, - - DrvHasZ80 = 1; - DrvHasYM3812 = 1; - - // Allocate and Blank all required memory - Mem = NULL; - JumppopMemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - JumppopMemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x200000); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "jumppope")) { - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 7, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 8, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000002, 9, 4); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000003, 10, 4); if (nRet != 0) return 1; - GfxDecode(DrvNumChars, 8, 8, 8, JpeCharPlaneOffsets, JpeCharXOffsets, JpeCharYOffsets, 0x200, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 8, 16, 16, JpeTilePlaneOffsets, JpeTileXOffsets, JpeTileYOffsets, 0x800, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100001, 6, 2); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM, 11, 1); if (nRet != 0) return 1; - } else { - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00000, 0, 1); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 1, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 3, 1); if (nRet != 0) return 1; - GfxDecode(DrvNumChars, 8, 8, 8, JpCharPlaneOffsets, JpCharXOffsets, JpCharYOffsets, 0x100, DrvTempRom, DrvChars); - GfxDecode(DrvNumTiles, 8, 16, 16, JpTilePlaneOffsets, JpTileXOffsets, JpTileYOffsets, 0x400, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x200000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 5, 1); if (nRet != 0) return 1; - GfxDecode(DrvNumSprites, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(MSM6295ROM, 6, 1); if (nRet != 0) return 1; - } - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Drv68KRam , 0x120000, 0x123fff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x140000, 0x1407ff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x160000, 0x160fff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x4000 , 0x1a0000, 0x1a7fff, MAP_RAM); - SekMapMemory(DrvPf1Ram , 0x320000, 0x323fff, MAP_RAM); - SekMapMemory(DrvPf2Ram , 0x300000, 0x303fff, MAP_RAM); - SekSetReadWordHandler(0, Jumppop68KReadWord); - SekSetWriteWordHandler(0, Jumppop68KWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(JumppopZ80PortRead); - ZetSetOutHandler(JumppopZ80PortWrite); - ZetMapArea(0x0000, 0x2fff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0x2fff, 2, DrvZ80Rom ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x8000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x8000 ); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80Ram ); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80Ram ); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80Ram ); - ZetClose(); - - BurnYM3812Init(1, 3500000, NULL, JumppopSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3500000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.70, BURN_SND_ROUTE_BOTH); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 875000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - BurnSetRefreshRate(60.0); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesTotal[1] = 3500000 / 60; - - DrvSpriteXOffset = 1; - DrvSpriteYOffset = 0; - DrvSpriteMask = 0x7fff; - DrvSpriteColourMask = 0x0f; - Pf1XOffset = -0x3a0; - Pf1YOffset = 0; - Pf2XOffset = -0x3a2; - Pf2YOffset = 0; - - GenericTilesInit(); - DrvRender = JumppopDraw; - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - if (DrvHasZ80) ZetExit(); - if (DrvHasYM2151) BurnYM2151Exit(); - MSM6295Exit(0); - - GenericTilesExit(); - - DrvVBlank = 0; - DrvOkiBank = 0; - DrvZ80Bank = 0; - DrvTileBank = 0; - DrvSoundLatch = 0; - Tumbleb2MusicCommand = 0; - Tumbleb2MusicBank = 0; - Tumbleb2MusicIsPlaying = 0; - - DrvSpriteXOffset = 0; - DrvSpriteYOffset = 0; - DrvSpriteRamSize = 0; - DrvSpriteMask = 0; - DrvSpriteColourMask = 0; - DrvYM2151Freq = 0; - DrvNumSprites = 0; - DrvNumChars = 0; - DrvNumTiles = 0; - DrvHasZ80 = 0; - DrvHasYM2151 = 0; - DrvHasYM3812 = 0; - DrvHasProt = 0; - Tumbleb2 = 0; - Jumpkids = 0; - Chokchok = 0; - Wlstar = 0; - Wondl96 = 0; - Bcstry = 0; - Semibase = 0; - SemicomSoundCommand = 0; - Pf1XOffset = 0; - Pf1YOffset = 0; - Pf2XOffset = 0; - Pf2YOffset = 0; - - DrvLoadRoms = NULL; - DrvMap68k = NULL; - DrvMapZ80 = NULL; - DrvRender = NULL; - - BurnFree(Mem); - - return 0; -} - -static INT32 JumppopExit() -{ - BurnYM3812Exit(); - return DrvExit(); -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 0); - g = pal4bit(nColour >> 4); - b = pal4bit(nColour >> 8); - - return BurnHighCol(r, g, b, 0); -} - -inline static UINT32 HtchctchCalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal5bit(nColour >> 0); - g = pal5bit(nColour >> 5); - b = pal5bit(nColour >> 10); - - return BurnHighCol(r, g, b, 0); -} - -inline static UINT32 FncywldCalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 8); - g = pal4bit(nColour >> 4); - b = pal4bit(nColour >> 0); - - return BurnHighCol(r, g, b, 0); -} - -inline static UINT32 JumppopCalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal5bit(nColour >> 10); - g = pal5bit(nColour >> 5); - b = pal5bit(nColour >> 0); - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x400; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void HtchctchCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x400; i++, ps++, pd++) { - *pd = HtchctchCalcCol(*ps); - } -} - -static void FncywldCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x800; i++, ps++, pd++) { - *pd = FncywldCalcCol(*ps); - } -} - -static void JumppopCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x400; i++, ps++, pd++) { - *pd = JumppopCalcCol(*ps); - } -} - -static void DrvRenderPf2Layer(INT32 ScrollX, INT32 ScrollY) -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex; - - UINT16 *VideoRam = (UINT16*)DrvPf2Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5); - Attr = VideoRam[TileIndex]; - Code = (Attr & 0xfff) | (DrvTileBank >> 2); - Colour = Attr >> 12; - - Code &= (DrvNumTiles - 1); - - x = 16 * mx; - y = 16 * my; - - x -= ((ScrollX + Pf2XOffset) & 0x3ff); - y -= ((ScrollY + Pf2YOffset) & 0x1ff); - if (x < -16) x += 1024; - if (y < -16) y += 512; - - y -= 8; - - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles); - } - } - } -} - -static void PangpangRenderPf2Layer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex; - - UINT16 *VideoRam = (UINT16*)DrvPf2Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5); - Attr = VideoRam[TileIndex * 2 + 0]; - Code = VideoRam[TileIndex * 2 + 1] & 0xfff; - Code |= 0x1000; - Colour = (Attr >> 12) & 0x0f; - - Code &= (DrvNumTiles - 1); - - x = 16 * mx; - y = 16 * my; - - x -= ((DrvControl[3] + Pf2XOffset) & 0x3ff); - y -= ((DrvControl[4] + Pf2YOffset) & 0x1ff); - if (x < -16) x += 1024; - if (y < -16) y += 512; - - y -= 8; - - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles); - } - } - } -} - -static void FncywldRenderPf2Layer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex; - - UINT16 *VideoRam = (UINT16*)DrvPf2Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5); - Attr = VideoRam[TileIndex * 2 + 1]; - Code = VideoRam[TileIndex * 2 + 0]; - Colour = Attr & 0x1f; - - Code &= (DrvNumTiles - 1); - - x = 16 * mx; - y = 16 * my; - - x -= ((DrvControl[3] + Pf2XOffset) & 0x3ff); - y -= ((DrvControl[4] + Pf2YOffset) & 0x1ff); - if (x < -16) x += 1024; - if (y < -16) y += 512; - - y -= 8; - - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 0x400, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0x400, DrvTiles); - } - } - } -} - -static void JumppopRenderPf2Layer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvPf2Ram; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Code = VideoRam[TileIndex]; - Code &= (DrvNumTiles - 1); - Colour = 0; - - x = 16 * mx; - y = 16 * my; - - x -= ((DrvControl[0] + Pf2XOffset) & 0x3ff); - y -= ((DrvControl[1] + Pf2YOffset) & 0x3ff); - if (x < -16) x += 1024; - if (y < -16) y += 1024; - - y -= 8; - - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 8, 512, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 8, 512, DrvTiles); - } - - TileIndex++; - } - } -} - -static void JumppopRenderPf2AltLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvPf2Ram; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 128; mx++) { - Code = VideoRam[TileIndex]; - Colour = 0; - - x = 8 * mx; - y = 8 * my; - - x -= ((DrvControl[0] + Pf2XOffset) & 0x3ff); - y -= ((DrvControl[1] + Pf2YOffset) & 0x1ff); - if (x < -8) x += 1024; - if (y < -8) y += 512; - - y -= 8; - - if (x > 0 && x < 312 && y > 0 && y < 232) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 8, 0, 512, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 512, DrvChars); - } - - TileIndex++; - } - } -} - -static void DrvRenderPf1Layer(INT32 ScrollX, INT32 ScrollY) -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex; - - UINT16 *VideoRam = (UINT16*)DrvPf1Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5); - Attr = VideoRam[TileIndex]; - Code = (Attr & 0xfff) | (DrvTileBank >> 2); - Colour = Attr >> 12; - - Code &= (DrvNumTiles - 1); - - x = 16 * mx; - y = 16 * my; - - x -= ((ScrollX + Pf1XOffset) & 0x3ff); - y -= ((ScrollY + Pf1YOffset) & 0x1ff); - if (x < -16) x += 1024; - if (y < -16) y += 512; - - y -= 8; - - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles); - } - } - } -} - -static void PangpangRenderPf1Layer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex; - - UINT16 *VideoRam = (UINT16*)DrvPf1Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5); - Attr = VideoRam[TileIndex * 2 + 0]; - Code = VideoRam[TileIndex * 2 + 1]; - Colour = (Attr >> 12) & 0x0f; - - Code &= (DrvNumTiles - 1); - - x = 16 * mx; - y = 16 * my; - - x -= ((DrvControl[1] + Pf1XOffset) & 0x3ff); - y -= ((DrvControl[2] + Pf1YOffset) & 0x1ff); - if (x < -16) x += 1024; - if (y < -16) y += 512; - - y -= 8; - - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles); - } - } - } -} - -static void FncywldRenderPf1Layer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex; - - UINT16 *VideoRam = (UINT16*)DrvPf1Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5); - Attr = VideoRam[TileIndex * 2 + 1]; - Code = VideoRam[TileIndex * 2 + 0]; - Colour = Attr & 0x1f; - - Code &= (DrvNumTiles - 1); - - x = 16 * mx; - y = 16 * my; - - x -= ((DrvControl[1] + Pf1XOffset) & 0x3ff); - y -= ((DrvControl[2] + Pf1YOffset) & 0x1ff); - if (x < -16) x += 1024; - if (y < -16) y += 512; - - y -= 8; - - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvTiles); - } - } - } -} - -static void JumppopRenderPf1Layer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvPf1Ram; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Code = VideoRam[TileIndex] & 0x1fff; - Code &= (DrvNumTiles - 1); - Colour = 0; - - x = 16 * mx; - y = 16 * my; - - x -= ((DrvControl[2] + Pf1XOffset) & 0x3ff); - y -= ((DrvControl[3] + Pf1YOffset) & 0x3ff); - if (x < -16) x += 1024; - if (y < -16) y += 1024; - - y -= 8; - - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 8, 0, 256, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 256, DrvTiles); - } - - TileIndex++; - } - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvPf1Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = VideoRam[TileIndex]; - Code = (Attr & 0xfff) | DrvTileBank; - Colour = Attr >> 12; - Code &= (DrvNumChars - 1); - - x = 8 * mx; - y = 8 * my; - - x -= ((DrvControl[1] + Pf1XOffset) & 0x1ff); - y -= ((DrvControl[2] + Pf1YOffset) & 0xff); - if (x < -8) x += 512; - if (y < -8) y += 256; - - y -= 8; - - if (x > 0 && x < 312 && y > 0 && y < 232) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars); - } - - TileIndex++; - } - } -} - -static void PangpangRenderCharLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvPf1Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = VideoRam[TileIndex * 2 + 0]; - Code = VideoRam[TileIndex * 2 + 1] & 0x1fff; - Colour = (Attr >> 12) & 0x1f; - Code &= (DrvNumChars - 1); - - x = 8 * mx; - y = 8 * my; - - x -= ((DrvControl[1] + Pf1XOffset) & 0x1ff); - y -= ((DrvControl[2] + Pf1YOffset) & 0xff); - if (x < -8) x += 512; - if (y < -8) y += 256; - - y -= 8; - - if (x > 0 && x < 312 && y > 0 && y < 232) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars); - } - - TileIndex++; - } - } -} - -static void FncywldRenderCharLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvPf1Ram; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = VideoRam[TileIndex * 2 + 1]; - Code = VideoRam[TileIndex * 2 + 0] & 0x1fff; - if (Code) { - Colour = Attr & 0x1f; - Code &= (DrvNumChars - 1); - - x = 8 * mx; - y = 8 * my; - - x -= ((DrvControl[1] + Pf1XOffset) & 0x1ff); - y -= ((DrvControl[2] + Pf1YOffset) & 0xff); - if (x < -8) x += 512; - if (y < -8) y += 256; - - y -= 8; - - if (x > 0 && x < 312 && y > 0 && y < 232) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x400, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x400, DrvChars); - } - } - - TileIndex++; - } - } -} - -static void SdfightRenderCharLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvPf1Ram; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = VideoRam[TileIndex]; - Code = (Attr & 0xfff) | DrvTileBank; - Colour = Attr >> 12; - Code &= (DrvNumChars - 1); - - x = 8 * mx; - y = 8 * my; - - x -= ((DrvControl[1] + Pf1XOffset) & 0x1ff); - y -= ((DrvControl[2] + Pf1YOffset) & 0x1ff); - if (x < -8) x += 512; - if (y < -8) y += 512; - - y -= 8; - - if (x > 0 && x < 312 && y > 0 && y < 232) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars); - } - - TileIndex++; - } - } -} - -static void JumppopRenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvPf1Ram; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 128; mx++) { - Code = VideoRam[TileIndex]; - Colour = 0; - - x = 8 * mx; - y = 8 * my; - - x -= ((DrvControl[2] + Pf1XOffset) & 0x3ff); - y -= ((DrvControl[3] + Pf1YOffset) & 0x1ff); - if (x < -8) x += 1024; - if (y < -8) y += 512; - - y -= 8; - - if (x > 0 && x < 312 && y > 0 && y < 232) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 8, 0, 256, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 256, DrvChars); - } - - TileIndex++; - } - } -} - -static void DrvRenderSprites(INT32 MaskColour, INT32 xFlipped) -{ - INT32 Offset; - UINT16 *SpriteRam = (UINT16*)DrvSpriteRam; - - for (Offset = 0; Offset < DrvSpriteRamSize / 2; Offset += 4) { - INT32 x, y, Code, Colour, Flash, Multi, xFlip, yFlip, Inc, Mult; - - Code = SpriteRam[Offset + 1] & DrvSpriteMask; - if (!Code) continue; - - y = SpriteRam[Offset]; - Flash = y & 0x1000; - if (Flash && (GetCurrentFrame() & 1)) continue; - - x = SpriteRam[Offset + 2]; - Colour = (x >> 9) & DrvSpriteColourMask; - xFlip = y & 0x2000; - yFlip = y & 0x4000; - - Multi = (1 << ((y & 0x600) >> 9)) - 1; - - x &= 0x1ff; - y &= 0x1ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - y = 240 - y; - x = 304 - x; - - y -= 8; - - if (yFlip) { - Inc = -1; - } else { - Code += Multi; - Inc = 1; - } - - if (xFlipped) { - xFlip = !xFlip; - x = 304 - x; - } - - Mult = -16; - - while (Multi >= 0) { - INT32 RenderCode = Code - (Multi * Inc); - INT32 RenderX = DrvSpriteXOffset + x; - INT32 RenderY = DrvSpriteYOffset + y + (Mult * Multi); - RenderCode &= (DrvNumSprites - 1); - - if (RenderX > 16 && RenderX < 304 && RenderY > 16 && RenderY < 224) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites); - } - } - } - - Multi--; - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - if (nBurnLayer & 1) DrvRenderPf2Layer(DrvControl[3], DrvControl[4]); - - if (DrvControl[6] & 0x80) { - if (nBurnLayer & 2) DrvRenderCharLayer(); - } else { - if (nBurnLayer & 4) DrvRenderPf1Layer(DrvControl[1], DrvControl[2]); - } - - if (nSpriteEnable & 1) DrvRenderSprites(0, 0); - BurnTransferCopy(DrvPalette); -} - -static void PangpangDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - PangpangRenderPf2Layer(); - - if (DrvControl[6] & 0x80) { - PangpangRenderCharLayer(); - } else { - PangpangRenderPf1Layer(); - } - - DrvRenderSprites(0, 0); - BurnTransferCopy(DrvPalette); -} - -static void SuprtrioDraw() -{ - BurnTransferClear(); - HtchctchCalcPalette(); - DrvRenderPf2Layer(-DrvControl[3], -DrvControl[4]); - DrvRenderPf1Layer(-DrvControl[1], -DrvControl[2]); - DrvRenderSprites(0, 0); - BurnTransferCopy(DrvPalette); -} - -static void HtchctchDraw() -{ - BurnTransferClear(); - HtchctchCalcPalette(); - DrvRenderPf2Layer(DrvControl[3], DrvControl[4]); - - if (DrvControl[6] & 0x80) { - DrvRenderCharLayer(); - } else { - DrvRenderPf1Layer(DrvControl[1], DrvControl[2]); - } - - DrvRenderSprites(0, 0); - BurnTransferCopy(DrvPalette); -} - -static void FncywldDraw() -{ - BurnTransferClear(); - FncywldCalcPalette(); - FncywldRenderPf2Layer(); - - if (DrvControl[6] & 0x80) { - FncywldRenderCharLayer(); - } else { - FncywldRenderPf1Layer(); - } - - DrvRenderSprites(0x0f, 0); - BurnTransferCopy(DrvPalette); -} - -static void SdfightDraw() -{ - BurnTransferClear(); - HtchctchCalcPalette(); - DrvRenderPf2Layer(DrvControl[3], DrvControl[4]); - - if (DrvControl[6] & 0x80) { - SdfightRenderCharLayer(); - } else { - DrvRenderPf1Layer(DrvControl[1], DrvControl[2]); - } - - DrvRenderSprites(0, 0); - BurnTransferCopy(DrvPalette); -} - -static void JumppopDraw() -{ - BurnTransferClear(); - JumppopCalcPalette(); - - if (DrvControl[7] & 0x01) { - JumppopRenderPf2Layer(); - } else { - JumppopRenderPf2AltLayer(); - } - - if (DrvControl[7] & 0x02) { - JumppopRenderPf1Layer(); - } else { - JumppopRenderCharLayer(); - } - - DrvRenderSprites(0, 1); - BurnTransferCopy(DrvPalette); -} - -#define NUM_SCANLINES 315 -#define SCANLINE_VBLANK_START 37 -#define SCANLINE_VBLANK_END SCANLINE_VBLANK_START + 240 - -static INT32 DrvFrame() -{ - INT32 nInterleave = NUM_SCANLINES; - INT32 nSoundBufferPos = 0; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - if (DrvHasZ80) ZetNewFrame(); - - DrvVBlank = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == SCANLINE_VBLANK_START) DrvVBlank = 1; - if (i == SCANLINE_VBLANK_END) DrvVBlank = 0; - if (i == NUM_SCANLINES - 1) { - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - if (Tumbleb2) Tumbleb2PlayMusic(); - } - SekClose(); - - if (DrvHasZ80) { - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (DrvHasYM2151) { - if (DrvHasZ80) ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - if (DrvHasZ80) ZetClose(); - } - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - if (DrvHasYM2151) { - if (DrvHasZ80) ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - if (DrvHasZ80) ZetClose(); - } - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) DrvRender(); - - return 0; -} - -static INT32 JumppopFrame() -{ - INT32 nInterleave = 1953 / 60; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == (nInterleave - 1)) { - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - BurnTimerUpdateYM3812(i * (nCyclesTotal[nCurrentCPU] / nInterleave)); - ZetNmi(); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - - if (pBurnDraw) JumppopDraw(); - - return 0; -} - -#undef NUM_SCANLINES -#undef SCANLINE_VBLANK_START -#undef SCANLINE_VBLANK_END - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029676; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - if (DrvHasZ80) ZetScan(nAction); - if (DrvHasYM2151) BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(DrvDip); - SCAN_VAR(DrvInput); - SCAN_VAR(DrvVBlank); - SCAN_VAR(DrvOkiBank); - SCAN_VAR(DrvZ80Bank); - SCAN_VAR(DrvTileBank); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(Tumbleb2MusicCommand); - SCAN_VAR(Tumbleb2MusicBank); - SCAN_VAR(Tumbleb2MusicIsPlaying); - - BurnRandomScan(nAction); - } - - if (nAction & ACB_WRITE) { - if (DrvOkiBank) { - if (Jumpkids) { - memcpy(MSM6295ROM + 0x20000, DrvMSM6295ROMSrc + (DrvOkiBank * 0x20000), 0x20000); - } else { - memcpy(MSM6295ROM + 0x30000, DrvMSM6295ROMSrc + 0x30000 + (DrvOkiBank * 0x10000), 0x10000); - } - } - - if (DrvZ80Bank) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + (DrvZ80Bank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + (DrvZ80Bank * 0x4000)); - ZetClose(); - } - } - - return 0; -} - -struct BurnDriver BurnDrvTumbleb = { - "tumbleb", "tumblep", NULL, NULL, "1991", - "Tumble Pop (bootleg set 1)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, TumblebRomInfo, TumblebRomName, NULL, NULL, TumblebInputInfo, TumblebDIPInfo, - TumblebInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvTumbleb2 = { - "tumbleb2", "tumblep", NULL, NULL, "1991", - "Tumble Pop (bootleg set 2)\0", NULL, "Data East Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, Tumbleb2RomInfo, Tumbleb2RomName, NULL, NULL, TumblebInputInfo, TumblebDIPInfo, - Tumbleb2Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvJumpkids = { - "jumpkids", NULL, NULL, NULL, "1993", - "Jump Kids\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, JumpkidsRomInfo, JumpkidsRomName, NULL, NULL, TumblebInputInfo, TumblebDIPInfo, - JumpkidsInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvMetlsavr = { - "metlsavr", NULL, NULL, NULL, "1994", - "Metal Saver\0", NULL, "First Amusement", "Miscellaneous", - L"Metal Saver\0\uBA54\uD0C8\uC138\uC774\uBC84\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, MetlsavrRomInfo, MetlsavrRomName, NULL, NULL, MetlsavrInputInfo, MetlsavrDIPInfo, - MetlsavrInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPangpang = { - "pangpang", NULL, NULL, NULL, "1994", - "Pang Pang\0", NULL, "Dong Gue La Mi Ltd.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, PangpangRomInfo, PangpangRomName, NULL, NULL, TumblebInputInfo, TumblebDIPInfo, - PangpangInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSuprtrio = { - "suprtrio", NULL, NULL, NULL, "1994", - "Super Trio\0", NULL, "Gameace", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, SuprtrioRomInfo, SuprtrioRomName, NULL, NULL, SuprtrioInputInfo, SuprtrioDIPInfo, - SuprtrioInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvHtchctch = { - "htchctch", NULL, NULL, NULL, "1995", - "Hatch Catch\0", NULL, "SemiCom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, HtchctchRomInfo, HtchctchRomName, NULL, NULL, HtchctchInputInfo, HtchctchDIPInfo, - HtchctchInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvCookbib = { - "cookbib", NULL, NULL, NULL, "1995", - "Cookie & Bibi (set 1)\0", NULL, "SemiCom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, CookbibRomInfo, CookbibRomName, NULL, NULL, HtchctchInputInfo, CookbibDIPInfo, - CookbibInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvCookbiba = { - "cookbiba", "cookbib", NULL, NULL, "1995", - "Cookie & Bibi (set 2)\0", NULL, "SemiCom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, CookbibaRomInfo, CookbibaRomName, NULL, NULL, HtchctchInputInfo, CookbibDIPInfo, - CookbibInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvChokChok = { - "chokchok", NULL, NULL, NULL, "1995", - "Choky! Choky!\0", NULL, "SemiCom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, ChokchokRomInfo, ChokchokRomName, NULL, NULL, HtchctchInputInfo, ChokchokDIPInfo, - ChokchokInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWlstar = { - "wlstar", NULL, NULL, NULL, "1995", - "Wonder League Star - Sok-Magicball Fighting (Korea)\0", NULL, "Mijin", "Miscellaneous", - L"\uC6D0\uB354\uB9AC\uADF8\uC2A4\uD0C0 - \uC18D \uB9E4\uC9C1\uBCFC \uD30C\uC774\uD305 (Korea)\0Wonder League Star - Sok-Magicball Fighting\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, WlstarRomInfo, WlstarRomName, NULL, NULL, MetlsavrInputInfo, WlstarDIPInfo, - WlstarInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWondl96 = { - "wondl96", NULL, NULL, NULL, "1995", - "Wonder League '96 (Korea)\0", NULL, "SemiCom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, Wondl96RomInfo, Wondl96RomName, NULL, NULL, MetlsavrInputInfo, Wondl96DIPInfo, - Wondl96Init, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvFancywld = { - "fncywld", NULL, NULL, NULL, "1996", - "Fancy World - Earth of Crisis\0", NULL, "Unico", "Miscellaneous", - L"Fancy World - Earth of Crisis\0\uD39C\uC2DC\uC6D4\uB4DC \uD658\uC0C1\uC758 \uC138\uACC4 - Earth of Crisis\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, FncywldRomInfo, FncywldRomName, NULL, NULL, FncywldInputInfo, FncywldDIPInfo, - FncywldInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSdfight = { - "sdfight", NULL, NULL, NULL, "1996", - "SD Fighters (Korea)\0", NULL, "SemiCom", "Miscellaneous", - L"\uFF33\uFF24 \uD30C\uC774\uD130\uC988 (Korea)\0SD Fighters\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, SdfightRomInfo, SdfightRomName, NULL, NULL, MetlsavrInputInfo, SdfightDIPInfo, - SdfightInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBcstry = { - "bcstry", NULL, NULL, NULL, "1997", - "B.C. Story (set 1)\0", NULL, "SemiCom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, BcstryRomInfo, BcstryRomName, NULL, NULL, MetlsavrInputInfo, BcstryDIPInfo, - BcstryInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBcstrya = { - "bcstrya", "bcstry", NULL, NULL, "1997", - "B.C. Story (set 2)\0", NULL, "SemiCom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, BcstryaRomInfo, BcstryaRomName, NULL, NULL, MetlsavrInputInfo, BcstryDIPInfo, - BcstryInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSemibase = { - "semibase", NULL, NULL, NULL, "1997", - "MuHanSeungBu (SemiCom Baseball) (Korea)\0", NULL, "SemiCom", "Miscellaneous", - L"\u7121\u9650\u52DD\u8CA0\0\uC804\uC6D0 \uAD6D\uC81C\uB9AC\uADF8 \uC804 (SemiCom Baseball) (Korea)\0MuHanSeungBu\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0, - NULL, SemibaseRomInfo, SemibaseRomName, NULL, NULL, SemibaseInputInfo, SemibaseDIPInfo, - SemibaseInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDquizgo = { - "dquizgo", NULL, NULL, NULL, "1998", - "Date Quiz Go Go (Korea)\0", NULL, "SemiCom", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, DquizgoRomInfo, DquizgoRomName, NULL, NULL, MetlsavrInputInfo, DquizgoDIPInfo, - DquizgoInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x800, 320, 240, 4, 3 -}; - -// these should actually be in d_esd16.cpp (similar hardware) -struct BurnDriver BurnDrvJumppop = { - "jumppop", NULL, NULL, NULL, "2001", - "Jumping Pop (set 1)\0", NULL, "ESD", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, JumppopRomInfo, JumppopRomName, NULL, NULL, JumppopInputInfo, JumppopDIPInfo, - JumppopInit, JumppopExit, JumppopFrame, NULL, DrvScan, - NULL, 0x400, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvJumppope = { - "jumppope", "jumppop", NULL, NULL, "2001", - "Jumping Pop (set 2)\0", NULL, "Emag Soft", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, JumppopeRomInfo, JumppopeRomName, NULL, NULL, JumppopInputInfo, JumppopDIPInfo, - JumppopInit, JumppopExit, JumppopFrame, NULL, DrvScan, - NULL, 0x400, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_unico.cpp b/jan/src/burn/drv/pst90s/d_unico.cpp deleted file mode 100644 index a210581f1..000000000 --- a/jan/src/burn/drv/pst90s/d_unico.cpp +++ /dev/null @@ -1,1932 +0,0 @@ -// FB Alpha Unico driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "burn_ym3812.h" -#include "burn_ym2151.h" -#include "msm6295.h" -#include "eeprom.h" -#include "burn_gun.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; -static INT32 DrvAnalogPort0 = 0; -static INT32 DrvAnalogPort1 = 0; -static INT32 DrvAnalogPort2 = 0; -static INT32 DrvAnalogPort3 = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvMSM6295ROMSrc = NULL; -static UINT8 *DrvVideo0Ram = NULL; -static UINT8 *DrvVideo1Ram = NULL; -static UINT8 *DrvVideo2Ram = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvScrollRam = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static INT32 nCyclesDone[1], nCyclesTotal[1]; -static INT32 nCyclesSegment; - -static UINT16 DrvScrollX0; -static UINT16 DrvScrollY0; -static UINT16 DrvScrollX1; -static UINT16 DrvScrollY1; -static UINT16 DrvScrollX2; -static UINT16 DrvScrollY2; -static UINT8 DrvOkiBank; - -static UINT32 DrvNumTiles; -static UINT32 DrvNumSprites; - -typedef void (*UnicoMakeInputs)(); -static UnicoMakeInputs UnicoMakeInputsFunction; - -static struct BurnInputInfo BurglarxInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort2 + 2, "service" }, - {"Service 2" , BIT_DIGITAL , DrvInputPort2 + 3, "service 2" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Burglarx) - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo ZeropntInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p2 start" }, - - A("P1 Gun X" , BIT_ANALOG_REL, &DrvAnalogPort0 , "mouse x-axis"), - A("P1 Gun Y" , BIT_ANALOG_REL, &DrvAnalogPort1 , "mouse y-axis"), - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 0, "mouse button 1" }, - - A("P2 Gun X" , BIT_ANALOG_REL, &DrvAnalogPort2 , "p2 x-axis"), - A("P2 Gun Y" , BIT_ANALOG_REL, &DrvAnalogPort3 , "p2 y-axis"), - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Diagnostic" , BIT_DIGITAL , DrvInputPort0 + 2, "diag" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 7, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Zeropnt) - -#undef A - -static inline void BurglarxClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void BurglarxMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - } - - // Clear Opposites - BurglarxClearOpposites(&DrvInput[0]); - BurglarxClearOpposites(&DrvInput[1]); -} - -static inline void ZeropntMakeInputs() -{ - // Reset Inputs - DrvInput[0] = 0x00; - DrvInput[1] = 0xff; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] -= (DrvInputPort1[i] & 1) << i; - } - - BurnGunMakeInputs(0, (INT16)DrvAnalogPort0, (INT16)DrvAnalogPort1); - BurnGunMakeInputs(1, (INT16)DrvAnalogPort2, (INT16)DrvAnalogPort3); -} - -static inline void Zeropnt2MakeInputs() -{ - // Reset Inputs - DrvInput[0] = 0x00; - DrvInput[1] = 0x7f; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] -= (DrvInputPort1[i] & 1) << i; - } - - BurnGunMakeInputs(0, (INT16)DrvAnalogPort0, (INT16)DrvAnalogPort1); - BurnGunMakeInputs(1, (INT16)DrvAnalogPort2, (INT16)DrvAnalogPort3); -} - -static struct BurnDIPInfo BurglarxDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xf7, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Test Mode" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x15, 0x01, 0xe0, 0x00, "5 Coins 1 Credit" }, - {0x15, 0x01, 0xe0, 0x20, "4 Coins 1 Credit" }, - {0x15, 0x01, 0xe0, 0x40, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xe0, 0x60, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0x03, 0x02, "None" }, - {0x16, 0x01, 0x03, 0x03, "A" }, - {0x16, 0x01, 0x03, 0x01, "B" }, - {0x16, 0x01, 0x03, 0x00, "C" }, - - {0 , 0xfe, 0 , 2 , "Starting Energy" }, - {0x16, 0x01, 0x80, 0x00, "2" }, - {0x16, 0x01, 0x80, 0x80, "3" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x30, 0x20, "Easy" }, - {0x16, 0x01, 0x30, 0x30, "Normal" }, - {0x16, 0x01, 0x30, 0x10, "Hard" }, - {0x16, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0xc0, 0x80, "2" }, - {0x16, 0x01, 0xc0, 0xc0, "3" }, - {0x16, 0x01, 0xc0, 0x40, "4" }, - {0x16, 0x01, 0xc0, 0x00, "5" }, -}; - -STDDIPINFO(Burglarx) - -static struct BurnDIPInfo ZeropntDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x08, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x0d, 0x01, 0x02, 0x00, "Off" }, - {0x0d, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x0d, 0x01, 0xe0, 0xe0, "5 Coins 1 Credit" }, - {0x0d, 0x01, 0xe0, 0xc0, "4 Coins 1 Credit" }, - {0x0d, 0x01, 0xe0, 0xa0, "3 Coins 1 Credit" }, - {0x0d, 0x01, 0xe0, 0x80, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0xe0, 0x00, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0xe0, 0x20, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0xe0, 0x40, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0xe0, 0x60, "1 Coin 4 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 3 , "Difficulty" }, - {0x0e, 0x01, 0x30, 0x10, "Easy" }, - {0x0e, 0x01, 0x30, 0x00, "Normal" }, - {0x0e, 0x01, 0x30, 0x20, "Hard" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0xc0, 0x40, "2" }, - {0x0e, 0x01, 0xc0, 0x00, "3" }, - {0x0e, 0x01, 0xc0, 0x80, "4" }, - {0x0e, 0x01, 0xc0, 0xc0, "5" }, -}; - -STDDIPINFO(Zeropnt) - -static struct BurnDIPInfo Zeropnt2DIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x0d, 0x01, 0x01, 0x01, "Off" }, - {0x0d, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Coins to Continue" }, - {0x0d, 0x01, 0x02, 0x00, "1" }, - {0x0d, 0x01, 0x02, 0x02, "2" }, - - {0 , 0xfe, 0 , 3 , "Gun Reloading" }, - {0x0d, 0x01, 0x0c, 0x08, "No" }, - {0x0d, 0x01, 0x0c, 0x04, "Yes" }, - {0x0d, 0x01, 0x0c, 0x0c, "Factory Setting" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0d, 0x01, 0x10, 0x10, "English" }, - {0x0d, 0x01, 0x10, 0x00, "Japanese" }, - - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x0d, 0x01, 0xe0, 0x00, "5 Coins 1 Credit" }, - {0x0d, 0x01, 0xe0, 0x20, "4 Coins 1 Credit" }, - {0x0d, 0x01, 0xe0, 0x40, "3 Coins 1 Credit" }, - {0x0d, 0x01, 0xe0, 0x60, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Korean Language" }, - {0x0e, 0x01, 0x01, 0x01, "Off" }, - {0x0e, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x02, 0x02, "Off" }, - {0x0e, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 5 , "Lives" }, - {0x0e, 0x01, 0x1c, 0x10, "2" }, - {0x0e, 0x01, 0x1c, 0x0c, "3" }, - {0x0e, 0x01, 0x1c, 0x1c, "4" }, - {0x0e, 0x01, 0x1c, 0x18, "5" }, - {0x0e, 0x01, 0x1c, 0x14, "6" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0e, 0x01, 0xc0, 0x80, "Easy" }, - {0x0e, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0e, 0x01, 0xc0, 0x40, "Hard" }, - {0x0e, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Zeropnt2) - -static struct BurnRomInfo BurglarxRomDesc[] = { - { "bx-rom2.pgm", 0x80000, 0xf81120c8, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "bx-rom3.pgm", 0x80000, 0x080b4e82, BRF_ESS | BRF_PRG }, // 1 - - { "bx-rom4", 0x80000, 0xf74ce31f, BRF_GRA }, // 2 Sprites - { "bx-rom10", 0x80000, 0x6f56ca23, BRF_GRA }, // 3 - { "bx-rom9", 0x80000, 0x33f29d79, BRF_GRA }, // 4 - { "bx-rom8", 0x80000, 0x24367092, BRF_GRA }, // 5 - { "bx-rom7", 0x80000, 0xaff6bdea, BRF_GRA }, // 6 - { "bx-rom6", 0x80000, 0x246afed2, BRF_GRA }, // 7 - { "bx-rom11", 0x80000, 0x898d176a, BRF_GRA }, // 8 - { "bx-rom5", 0x80000, 0xfdee1423, BRF_GRA }, // 9 - - { "bx-rom14", 0x80000, 0x30413373, BRF_GRA }, // 10 Layers - { "bx-rom18", 0x80000, 0x8e7fc99f, BRF_GRA }, // 11 - { "bx-rom19", 0x80000, 0xd40eabcd, BRF_GRA }, // 12 - { "bx-rom15", 0x80000, 0x78833c75, BRF_GRA }, // 13 - { "bx-rom17", 0x80000, 0xf169633f, BRF_GRA }, // 14 - { "bx-rom12", 0x80000, 0x71eb160f, BRF_GRA }, // 15 - { "bx-rom13", 0x80000, 0xda34bbb5, BRF_GRA }, // 16 - { "bx-rom16", 0x80000, 0x55b28ef9, BRF_GRA }, // 17 - - { "bx-rom1.snd", 0x80000, 0x8ae67138, BRF_SND }, // 18 Samples -}; - -STD_ROM_PICK(Burglarx) -STD_ROM_FN(Burglarx) - -static struct BurnRomInfo ZeropntRomDesc[] = { - { "unico_2.rom2", 0x080000, 0x1e599509, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "unico_3.rom3", 0x080000, 0x588aeef7, BRF_ESS | BRF_PRG }, // 1 - - { "unico_zpobj_z01.bin", 0x200000, 0x1f2768a3, BRF_GRA }, // 2 Sprites - { "unico_zpobj_z02.bin", 0x200000, 0xde34f33a, BRF_GRA }, // 3 - { "unico_zpobj_z03.bin", 0x200000, 0xd7a657f7, BRF_GRA }, // 4 - { "unico_zpobj_z04.bin", 0x200000, 0x3aec2f8d, BRF_GRA }, // 5 - - { "unico_zpscr_z06.bin", 0x200000, 0xe1e53cf0, BRF_GRA }, // 6 Layers - { "unico_zpscr_z05.bin", 0x200000, 0x0d7d4850, BRF_GRA }, // 7 - { "unico_zpscr_z07.bin", 0x200000, 0xbb178f32, BRF_GRA }, // 8 - { "unico_zpscr_z08.bin", 0x200000, 0x672f02e5, BRF_GRA }, // 9 - - { "unico_1.rom1", 0x080000, 0xfd2384fa, BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(Zeropnt) -STD_ROM_FN(Zeropnt) - -static struct BurnRomInfo ZeropntaRomDesc[] = { - { "unico2.rom2", 0x080000, 0x285fbca3, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "unico3.rom3", 0x080000, 0xad7b3129, BRF_ESS | BRF_PRG }, // 1 - - { "unico_zpobj_z01.bin", 0x200000, 0x1f2768a3, BRF_GRA }, // 2 Sprites - { "unico_zpobj_z02.bin", 0x200000, 0xde34f33a, BRF_GRA }, // 3 - { "unico_zpobj_z03.bin", 0x200000, 0xd7a657f7, BRF_GRA }, // 4 - { "unico_zpobj_z04.bin", 0x200000, 0x3aec2f8d, BRF_GRA }, // 5 - - { "unico_zpscr_z06.bin", 0x200000, 0xe1e53cf0, BRF_GRA }, // 6 Layers - { "unico_zpscr_z05.bin", 0x200000, 0x0d7d4850, BRF_GRA }, // 7 - { "unico_zpscr_z07.bin", 0x200000, 0xbb178f32, BRF_GRA }, // 8 - { "unico_zpscr_z08.bin", 0x200000, 0x672f02e5, BRF_GRA }, // 9 - - { "unico_1.rom1", 0x080000, 0xfd2384fa, BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(Zeropnta) -STD_ROM_FN(Zeropnta) - -static struct BurnRomInfo ZeropntjRomDesc[] = { - { "unico_2.bin", 0x080000, 0x098d9756, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "unico_3.bin", 0x080000, 0x58e105f3, BRF_ESS | BRF_PRG }, // 1 - - { "unico_zpobj_z01.bin", 0x200000, 0x1f2768a3, BRF_GRA }, // 2 Sprites - { "unico_4.bin", 0x200000, 0x529c36ee, BRF_GRA }, // 3 - { "unico_zpobj_z03.bin", 0x200000, 0xd7a657f7, BRF_GRA }, // 4 - { "unico_zpobj_z04.bin", 0x200000, 0x3aec2f8d, BRF_GRA }, // 5 - - { "unico_zpscr_z06.bin", 0x200000, 0xe1e53cf0, BRF_GRA }, // 6 Layers - { "unico_zpscr_z05.bin", 0x200000, 0x0d7d4850, BRF_GRA }, // 7 - { "unico_zpscr_z07.bin", 0x200000, 0xbb178f32, BRF_GRA }, // 8 - { "unico_zpscr_z08.bin", 0x200000, 0x672f02e5, BRF_GRA }, // 9 - - { "unico_1.rom1", 0x080000, 0xfd2384fa, BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(Zeropntj) -STD_ROM_FN(Zeropntj) - -static struct BurnRomInfo Zeropnt2RomDesc[] = { - { "d16-d31.4", 0x100000, 0x48314fdb, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "d0-d15.3", 0x100000, 0x5ec4151e, BRF_ESS | BRF_PRG }, // 1 - - { "db0db1zp.209", 0x400000, 0x474b460c, BRF_GRA }, // 2 Sprites - { "db2db3zp.210", 0x400000, 0x0a1d0a88, BRF_GRA }, // 3 - { "db4db5zp.211", 0x400000, 0x227169dc, BRF_GRA }, // 4 - { "db6db7zp.212", 0x400000, 0xa6306cdb, BRF_GRA }, // 5 - - { "a0-a1zp.205", 0x400000, 0xf7ca9c0e, BRF_GRA }, // 6 Layers - { "a2-a3zp.206", 0x400000, 0x0581c8fe, BRF_GRA }, // 7 - { "a4-a5zp.208", 0x400000, 0xddd091ef, BRF_GRA }, // 8 - { "a6-a7zp.207", 0x400000, 0x3fd46113, BRF_GRA }, // 9 - - { "uzp2-1.bin", 0x080000, 0xed0966ed, BRF_SND }, // 10 Samples (Oki 1) - - { "uzp2-2.bin", 0x040000, 0xdb8cb455, BRF_SND }, // 11 Samples (Oki 2) -}; - -STD_ROM_PICK(Zeropnt2) -STD_ROM_FN(Zeropnt2) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x100000; - MSM6295ROM = Next; Next += 0x040000; - DrvMSM6295ROMSrc = Next; Next += 0x080000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x014000; - DrvVideo0Ram = Next; Next += 0x004000; - DrvVideo1Ram = Next; Next += 0x004000; - DrvVideo2Ram = Next; Next += 0x004000; - DrvSpriteRam = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x008000; - - RamEnd = Next; - - DrvTiles = Next; Next += DrvNumTiles * 16 * 16; - DrvSprites = Next; Next += DrvNumSprites * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x02000 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 Zeropnt2MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x200000; - MSM6295ROM = Next; Next += 0x140000; - DrvMSM6295ROMSrc = Next; Next += 0x080000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x024000; - DrvVideo0Ram = Next; Next += 0x004000; - DrvVideo1Ram = Next; Next += 0x004000; - DrvVideo2Ram = Next; Next += 0x004000; - DrvSpriteRam = Next; Next += 0x000800; - DrvPaletteRam = Next; Next += 0x008000; - DrvScrollRam = Next; Next += 0x000018; - - RamEnd = Next; - - DrvTiles = Next; Next += DrvNumTiles * 16 * 16; - DrvSprites = Next; Next += DrvNumSprites * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x02000 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - BurnYM3812Reset(); - MSM6295Reset(0); - - DrvScrollX0 = 0; - DrvScrollY0 = 0; - DrvScrollX1 = 0; - DrvScrollY1 = 0; - DrvScrollX2 = 0; - DrvScrollY2 = 0; - DrvOkiBank = 0; - - return 0; -} - -static INT32 Zeropnt2DoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - BurnYM2151Reset(); - MSM6295Reset(0); - MSM6295Reset(1); - - DrvOkiBank = 0; - - return 0; -} - -static UINT8 __fastcall Burglarx68KReadByte(UINT32 a) -{ - switch (a) { - case 0x800000: { - return 0xff - DrvInput[1]; - } - - case 0x800001: { - return 0xff - DrvInput[0]; - } - - case 0x800019: { - return 0xff - DrvInput[2]; - } - - case 0x80001a: { - return DrvDip[0]; - } - - case 0x80001c: { - return DrvDip[1]; - } - - case 0x800189: { - return MSM6295ReadStatus(0); - } - - case 0x80018c: { - return BurnYM3812Read(0, 0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Burglarx68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x800189: { - MSM6295Command(0, d); - return; - } - - case 0x80018a: { - BurnYM3812Write(0, 1, d); - return; - } - - case 0x80018c: { - BurnYM3812Write(0, 0, d); - return; - } - - case 0x80018e: { - DrvOkiBank = d & 1; - memcpy(MSM6295ROM + 0x00000, DrvMSM6295ROMSrc + (0x40000 * DrvOkiBank), 0x40000); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -static UINT16 __fastcall Burglarx68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Burglarx68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x800030: { - // NOP??? - return; - } - - case 0x80010c: { - DrvScrollX0 = d & 0x3ff; - return; - } - - case 0x80010e: { - DrvScrollY0 = d & 0x3ff; - return; - } - - case 0x800110: { - DrvScrollY2 = d & 0x3ff; - return; - } - - case 0x800114: { - DrvScrollX2 = d & 0x3ff; - return; - } - - case 0x800116: { - DrvScrollX1 = d & 0x3ff; - return; - } - - case 0x800120: { - DrvScrollY1 = d & 0x3ff; - return; - } - - case 0x8001e0: { - // IRQ Ack??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -static UINT8 GetGunX(INT32 gun) -{ - INT32 x = BurnGunReturnX(gun); - - x = x * 384 / 256; - if (x < 0x160) { - x = 0x30 + (x * 0xd0 / 0x15f); - } else { - x = ((x - 0x160) * 0x20) / 0x1f; - } - - return ((x & 0xff) ^ (GetCurrentFrame() & 3)); -} - -static UINT8 GetGunY(INT32 gun) -{ - INT32 y = BurnGunReturnY(gun); - - y = 0x18 + ((y * 0xe0) / 0xff); - - return ((y & 0xff) ^ (GetCurrentFrame() & 3)); - -} - -static UINT8 __fastcall Zeropnt68KReadByte(UINT32 a) -{ - switch (a) { - case 0x800018: { - return DrvInput[1]; - } - - case 0x800019: { - return DrvInput[0]; - } - - case 0x80001a: { - return DrvDip[0]; - } - - case 0x80001c: { - return DrvDip[1]; - } - - case 0x800170: { - return GetGunY(1); - } - - case 0x800174: { - return GetGunX(1); - } - - case 0x800178: { - return GetGunY(0); - } - - case 0x80017c: { - return GetGunX(0); - } - - case 0x800189: { - return MSM6295ReadStatus(0); - } - - case 0x80018c: { - return BurnYM3812Read(0, 0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Zeropnt68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x800189: { - MSM6295Command(0, d); - return; - } - - case 0x80018a: { - BurnYM3812Write(0, 1, d); - return; - } - - case 0x80018c: { - BurnYM3812Write(0, 0, d); - return; - } - - case 0x80018e: { - DrvOkiBank = d & 1; - memcpy(MSM6295ROM + 0x20000, DrvMSM6295ROMSrc + 0x20000 + (0x20000 * DrvOkiBank), 0x20000); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -static UINT16 __fastcall Zeropnt68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Zeropnt68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x000000: - case 0x800030: { - // NOP??? - return; - } - - case 0x80010c: { - DrvScrollX0 = d & 0x3ff; - return; - } - - case 0x80010e: { - DrvScrollY0 = d & 0x3ff; - return; - } - - case 0x800110: { - DrvScrollY2 = d & 0x3ff; - return; - } - - case 0x800114: { - DrvScrollX2 = d & 0x3ff; - return; - } - - case 0x800116: { - DrvScrollX1 = d & 0x3ff; - return; - } - - case 0x800120: { - DrvScrollY1 = d & 0x3ff; - return; - } - - case 0x8001e0: { - // IRQ Ack??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -static UINT8 __fastcall Zeropnt268KReadByte(UINT32 a) -{ - switch (a) { - case 0x800019: { - return DrvInput[0]; - } - - case 0x800025: { - return MSM6295ReadStatus(0); - } - - case 0x80002d: { - return BurnYM2151ReadStatus(); - } - - case 0x800031: { - return MSM6295ReadStatus(1); - } - - case 0x800140: { - return GetGunY(1) + 0x08; - } - - case 0x800144: { - return GetGunX(1) - 0x08; - } - - case 0x800148: { - return GetGunY(0) + 0x08; - } - - case 0x80014c: { - return GetGunX(0) - 0x08; - } - - case 0x800150: { - return DrvDip[0]; - } - - case 0x800154: { - return DrvDip[1]; - } - - case 0x80015c: { - return DrvInput[1] | ((EEPROMRead() & 0x01) << 8); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Zeropnt268KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x800025: { - MSM6295Command(0, d); - return; - } - - case 0x800029: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x80002d: { - BurnYM2151WriteRegister(d); - return; - } - - case 0x800031: { - MSM6295Command(1, d); - return; - } - - case 0x800034: { - DrvOkiBank = (d & 3) % 4; - memcpy(MSM6295ROM + 0x20000, DrvMSM6295ROMSrc + 0x20000 + (0x20000 * DrvOkiBank), 0x20000); - return; - } - - case 0x800039: { - // LEDs - return; - } - - case 0x8001f0: { - EEPROMWrite(d & 0x02, d & 0x01, d & 0x04); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -static UINT16 __fastcall Zeropnt268KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Zeropnt268KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x80010c: { - UINT16* ScrollRam = (UINT16*)DrvScrollRam; - ScrollRam[0] = d; - return; - } - - case 0x80010e: { - UINT16* ScrollRam = (UINT16*)DrvScrollRam; - ScrollRam[1] = d; - return; - } - - case 0x800110: { - UINT16* ScrollRam = (UINT16*)DrvScrollRam; - ScrollRam[2] = d; - return; - } - - case 0x800114: { - UINT16* ScrollRam = (UINT16*)DrvScrollRam; - ScrollRam[4] = d; - return; - } - - case 0x800116: { - UINT16* ScrollRam = (UINT16*)DrvScrollRam; - ScrollRam[5] = d; - return; - } - - case 0x800120: { - UINT16* ScrollRam = (UINT16*)DrvScrollRam; - ScrollRam[10] = d; - return; - } - - case 0x8001e0: { - // IRQ Ack??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -static UINT32 __fastcall Zeropnt268KReadLong(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Read long => %06X\n"), a); - } - } - - return 0; -} - -static void __fastcall Zeropnt268KWriteLong(UINT32 a, UINT32 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K Write long => %06X, %08X\n"), a, d); - } - } -} - -static INT32 BurglarxSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)SekTotalCycles() * nSoundRate / 16000000; -} - -static INT32 BurglarxTilePlaneOffsets[8] = { 0x1800008, 0x1800000, 0x1000008, 0x1000000, 0x0800008, 0x0800000, 0x0000008, 0x0000000 }; -static INT32 ZeropntTilePlaneOffsets[8] = { 0x3000008, 0x3000000, 0x2000008, 0x2000000, 0x1000008, 0x1000000, 0x0000008, 0x0000000 }; -static INT32 Zeropnt2TilePlaneOffsets[8] = { 0x6000008, 0x6000000, 0x4000008, 0x4000000, 0x2000008, 0x2000000, 0x0000008, 0x0000000 }; -static INT32 TileXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23 }; -static INT32 TileYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480 }; - -static INT32 BurglarxInit() -{ - INT32 nRet = 0, nLen; - - DrvNumTiles = 0x4000; - DrvNumSprites = 0x4000; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x400000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 10, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 11, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 12, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100001, 13, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 14, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200001, 15, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 16, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300001, 17, 2); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x400000; i++) { - DrvTempRom[i] ^= 0xff; - } - GfxDecode(0x4000, 8, 16, 16, BurglarxTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x400000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 3, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100001, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200001, 7, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 8, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300001, 9, 2); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x400000; i++) { - DrvTempRom[i] ^= 0xff; - } - GfxDecode(0x4000, 8, 16, 16, BurglarxTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 18, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvVideo1Ram , 0x904000, 0x907fff, MAP_RAM); - SekMapMemory(DrvVideo2Ram , 0x908000, 0x90bfff, MAP_RAM); - SekMapMemory(DrvVideo0Ram , 0x90c000, 0x90ffff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x10000 , 0x920000, 0x923fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x930000, 0x9307ff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x940000, 0x947fff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xff0000, 0xffffff, MAP_RAM); - SekSetReadWordHandler(0, Burglarx68KReadWord); - SekSetWriteWordHandler(0, Burglarx68KWriteWord); - SekSetReadByteHandler(0, Burglarx68KReadByte); - SekSetWriteByteHandler(0, Burglarx68KWriteByte); - SekClose(); - - BurnYM3812Init(1, 3579545, NULL, &BurglarxSynchroniseStream, 0); - BurnTimerAttachSekYM3812(16000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - UnicoMakeInputsFunction = BurglarxMakeInputs; - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 ZeropntInit() -{ - INT32 nRet = 0, nLen; - - DrvNumTiles = 0x8000; - DrvNumSprites = 0x8000; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x800000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000001, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000000, 1, 2); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x400000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x600000, 9, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x800000; i++) { - DrvTempRom[i] ^= 0xff; - } - GfxDecode(0x8000, 8, 16, 16, ZeropntTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x800000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x400000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x600000, 5, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x800000; i++) { - DrvTempRom[i] ^= 0xff; - } - GfxDecode(0x8000, 8, 16, 16, ZeropntTilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 10, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvVideo1Ram , 0x904000, 0x907fff, MAP_RAM); - SekMapMemory(DrvVideo2Ram , 0x908000, 0x90bfff, MAP_RAM); - SekMapMemory(DrvVideo0Ram , 0x90c000, 0x90ffff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x10000 , 0x920000, 0x923fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x930000, 0x9307ff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x940000, 0x947fff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xef0000, 0xefffff, MAP_RAM); - SekSetReadWordHandler(0, Zeropnt68KReadWord); - SekSetWriteWordHandler(0, Zeropnt68KWriteWord); - SekSetReadByteHandler(0, Zeropnt68KReadByte); - SekSetWriteByteHandler(0, Zeropnt68KWriteByte); - SekClose(); - - BurnYM3812Init(1, 3579545, NULL, &BurglarxSynchroniseStream, 0); - BurnTimerAttachSekYM3812(16000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - BurnGunInit(2, true); - - UnicoMakeInputsFunction = ZeropntMakeInputs; - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static const eeprom_interface zeropnt2_eeprom_interface = -{ - 7, // address bits 7 - 8, // data bits 8 - "*110", // read 1 10 aaaaaaa - "*101", // write 1 01 aaaaaaa dddddddd - "*111", // erase 1 11 aaaaaaa - "*10000xxxx", // lock 1 00 00xxxx - "*10011xxxx", // unlock 1 00 11xxxx - 0, - 0 -}; - -static INT32 Zeropnt2Init() -{ - INT32 nRet = 0, nLen; - - DrvNumTiles = 0x10000; - DrvNumSprites = 0x10000; - - // Allocate and Blank all required memory - Mem = NULL; - Zeropnt2MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - Zeropnt2MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x1000000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x000000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x000001, 1, 2); if (nRet != 0) return 1; - - for (INT32 i = 0; i < 0x200000; i+= 4) { - INT32 t = Drv68KRom[i + 1]; - Drv68KRom[i + 1] = Drv68KRom[i + 2]; - Drv68KRom[i + 2] = t; - } - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x400000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x800000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xc00000, 9, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x1000000; i++) { - DrvTempRom[i] ^= 0xff; - } - GfxDecode(0x10000, 8, 16, 16, Zeropnt2TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x1000000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x400000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x800000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0xc00000, 5, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x1000000; i++) { - DrvTempRom[i] ^= 0xff; - } - GfxDecode(0x10000, 8, 16, 16, Zeropnt2TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(MSM6295ROM + 0x100000, 11, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM + 0x000000, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68EC020); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(DrvVideo1Ram , 0x904000, 0x907fff, MAP_RAM); - SekMapMemory(DrvVideo2Ram , 0x908000, 0x90bfff, MAP_RAM); - SekMapMemory(DrvVideo0Ram , 0x90c000, 0x90ffff, MAP_RAM); - SekMapMemory(Drv68KRam + 0x10000 , 0x920000, 0x923fff, MAP_RAM); - SekMapMemory(DrvSpriteRam , 0x930000, 0x9307ff, MAP_RAM); - SekMapMemory(DrvPaletteRam , 0x940000, 0x947fff, MAP_RAM); - SekMapMemory(Drv68KRam , 0xfe0000, 0xffffff, MAP_RAM); - SekSetReadWordHandler(0, Zeropnt268KReadWord); - SekSetWriteWordHandler(0, Zeropnt268KWriteWord); - SekSetReadByteHandler(0, Zeropnt268KReadByte); - SekSetWriteByteHandler(0, Zeropnt268KWriteByte); - SekSetReadLongHandler(0, Zeropnt268KReadLong); - SekSetWriteLongHandler(0, Zeropnt268KWriteLong); - SekClose(); - - EEPROMInit(&zeropnt2_eeprom_interface); - - BurnYM2151Init(3579545); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.70, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.70, BURN_SND_ROUTE_RIGHT); - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295Init(1, 3960000 / 132, 1); - MSM6295SetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - BurnGunInit(2, true); - - // Reset the driver - Zeropnt2DoReset(); - - return 0; -} - -static INT32 CommonExit() -{ - SekExit(); - - MSM6295Exit(0); - - GenericTilesExit(); - if (nBurnGunNumPlayers) BurnGunExit(); - - DrvScrollX0 = 0; - DrvScrollY0 = 0; - DrvScrollX1 = 0; - DrvScrollY1 = 0; - DrvScrollX2 = 0; - DrvScrollY2 = 0; - DrvOkiBank = 0; - - DrvNumTiles = 0; - DrvNumSprites = 0; - - UnicoMakeInputsFunction = NULL; - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - - return CommonExit(); -} - -static INT32 Zeropnt2Exit() -{ - INT32 nRet = CommonExit(); - - BurnYM2151Exit(); - MSM6295Exit(1); - - EEPROMExit(); - - return nRet; -} - -static void DrvRenderSprites(INT32 PriorityDraw) -{ - for (INT32 Offset = 0; Offset < 0x400; Offset += 4) { - INT32 x, xStart, xEnd, xInc; - UINT16 *SpriteRam = (UINT16*)DrvSpriteRam; - - INT32 sx = SpriteRam[Offset + 0]; - INT32 sy = SpriteRam[Offset + 1]; - INT32 Code = SpriteRam[Offset + 2]; - INT32 Attr = SpriteRam[Offset + 3]; - - INT32 xFlip = Attr & 0x20; - INT32 yFlip = Attr & 0x40; - - INT32 xDim = ((Attr >> 8) & 0x0f) + 1; - INT32 Priority = ((Attr >> 12) & 0x03); - - if (Priority != PriorityDraw) continue; - - sx -= 0x3f; - sy -= 0x0e; - - sx = (sx & 0x1ff) - (sx & 0x200); - sy = (sy & 0x1ff) - (sy & 0x200); - - if (xFlip) { - xStart = sx + (xDim - 1) * 16; - xEnd = sx - 16; - xInc = -16; - } else { - xStart = sx; - xEnd = sx + (xDim * 16); - xInc = 16; - } - - for (x = xStart; x != xEnd; x += xInc) { - if (x > 16 && x < 368 && sy > 16 && sy < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } - } - } - } - } -} - -static void Zeropnt2RenderSprites(INT32 PriorityDraw) -{ - for (INT32 Offset = 0; Offset < 0x200; Offset += 2) { - INT32 x, xStart, xEnd, xInc; - UINT32 *SpriteRam = (UINT32*)DrvSpriteRam; - - INT32 sx = SpriteRam[Offset + 0] & 0xffff; - INT32 sy = SpriteRam[Offset + 0] >> 16; - INT32 Code = SpriteRam[Offset + 1] & 0xffff; - INT32 Attr = SpriteRam[Offset + 1] >> 16; - - INT32 xFlip = Attr & 0x20; - INT32 yFlip = Attr & 0x40; - - INT32 xDim = ((Attr >> 8) & 0x0f) + 1; - INT32 Priority = ((Attr >> 12) & 0x03); - - if (Priority != PriorityDraw) continue; - - sx -= 0x3f; - sy -= 0x0e; - - sx = (sx & 0x1ff) - (sx & 0x200); - sy = (sy & 0x1ff) - (sy & 0x200); - - if (xFlip) { - xStart = sx + (xDim - 1) * 16; - xEnd = sx - 16; - xInc = -16; - } else { - xStart = sx; - xEnd = sx + (xDim * 16); - xInc = 16; - } - - for (x = xStart; x != xEnd; x += xInc) { - if (x > 16 && x < 368 && sy > 16 && sy < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code++, x, sy, Attr & 0x1f, 8, 0, 0, DrvSprites); - } - } - } - } - } -} - -static void DrvRenderLayer(INT32 Layer) -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 ScrollX = DrvScrollX0; - UINT16 ScrollY = DrvScrollY0; - UINT16 *VideoRam = (UINT16*)DrvVideo0Ram; - - if (Layer == 1) { - ScrollX = DrvScrollX1; - ScrollY = DrvScrollY1; - VideoRam = (UINT16*)DrvVideo1Ram; - } - - if (Layer == 2) { - ScrollX = DrvScrollX2; - ScrollY = DrvScrollY2; - VideoRam = (UINT16*)DrvVideo2Ram; - } - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = VideoRam[2 * TileIndex + 1]; - Code = VideoRam[2 * TileIndex + 0]; - Colour = Attr & 0x1f; - Flip = Attr >> 5; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 16 * mx; - y = 16 * my; - - x -= ScrollX; - y -= ScrollY; - if (x < -16) x += 1024; - if (y < -16) y += 1024; - - y -= 15; - if (Layer == 0) x -= 0x31; - if (Layer == 1) x -= 0x30; - if (Layer == 2) x -= 0x2e; - - if (x > 16 && x < 368 && y > 16 && y < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } - } - } - - TileIndex++; - } - } -} - -static void Zeropnt2RenderLayer(INT32 Layer) -{ - INT32 mx, my, Attr, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - UINT32 Code; - - UINT32 *VideoRam = (UINT32*)DrvVideo0Ram; - UINT32 *ScrollRam = (UINT32*)DrvScrollRam; - - UINT16 ScrollX = ScrollRam[0] & 0xffff; - UINT16 ScrollY = ScrollRam[0] >> 16; - - if (Layer == 1) { - ScrollX = ScrollRam[2] >> 16; - ScrollY = ScrollRam[5] & 0xffff; - VideoRam = (UINT32*)DrvVideo1Ram; - } - - if (Layer == 2) { - ScrollX = ScrollRam[2] & 0xffff; - ScrollY = ScrollRam[1] & 0xffff; - VideoRam = (UINT32*)DrvVideo2Ram; - } - - ScrollX &= 0x3ff; - ScrollY &= 0x3ff; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Code = VideoRam[TileIndex]; - Attr = Code >> 16; - Code &= 0xffff; - Colour = Attr & 0x1f; - Flip = Attr >> 5; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 16 * mx; - y = 16 * my; - - x -= ScrollX; - y -= ScrollY; - if (x < -16) x += 1024; - if (y < -16) y += 1024; - - y -= 15; - if (Layer == 0) x -= 0x32; - if (Layer == 1) x -= 0x30; - if (Layer == 2) x -= 0x2e; - - if (Code) { - if (x > 16 && x < 368 && y > 16 && y < 208) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 0, DrvTiles); - } - } - } - } - - TileIndex++; - } - } -} - -static void DrvCalcPalette() -{ - UINT16 Data1, Data2; - UINT16 *PaletteRam = (UINT16*)DrvPaletteRam; - - for (INT32 i = 0; i < 0x4000; i += 2) { - Data1 = PaletteRam[i & ~1]; - Data2 = PaletteRam[i | 1]; - - DrvPalette[i >> 1] = BurnHighCol((Data1 >> 8) & 0xfc, (Data1 >> 0) & 0xfc, (Data2 >> 8) & 0xfc, 0); - } -} - -static void Zeropnt2CalcPalette() -{ - UINT32 *PaletteRam = (UINT32*)DrvPaletteRam; - UINT32 rgb0; - - for (INT32 i = 0; i < 0x2000; i++) { - rgb0 = PaletteRam[i]; - - DrvPalette[i] = BurnHighCol((rgb0 >> 8) & 0xfc, (rgb0 >> 0) & 0xfc, (rgb0 >> 24) & 0xfc, 0); - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0x1f00; - } - - if (nSpriteEnable & 1) DrvRenderSprites(0); // why does spri 0 and 3 need to be swapped? - if (nBurnLayer & 1) DrvRenderLayer(0); - if (nSpriteEnable & 4) DrvRenderSprites(2); - if (nBurnLayer & 2) DrvRenderLayer(1); - if (nSpriteEnable & 2) DrvRenderSprites(1); - if (nBurnLayer & 4) DrvRenderLayer(2); - if (nSpriteEnable & 8) DrvRenderSprites(3); - - BurnTransferCopy(DrvPalette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } -} - -static void Zeropnt2Draw() -{ - BurnTransferClear(); - Zeropnt2CalcPalette(); - - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0x1f00; - } - - if (nSpriteEnable & 1) Zeropnt2RenderSprites(0); // why does spri 0 and 3 need to be swapped? - if (nBurnLayer & 1) Zeropnt2RenderLayer(0); - if (nSpriteEnable & 2) Zeropnt2RenderSprites(2); - if (nBurnLayer & 2) Zeropnt2RenderLayer(1); - if (nSpriteEnable & 4) Zeropnt2RenderSprites(1); - if (nBurnLayer & 4) Zeropnt2RenderLayer(2); - if (nSpriteEnable & 8) Zeropnt2RenderSprites(3); - - BurnTransferCopy(DrvPalette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } -} - -static INT32 DrvFrame() -{ - if (DrvReset) DrvDoReset(); - - UnicoMakeInputsFunction(); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesDone[0] = 0; - - SekNewFrame(); - - SekOpen(0); - BurnTimerEndFrameYM3812(nCyclesTotal[0]); - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - SekClose(); - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 Zeropnt2Frame() -{ - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - if (DrvReset) Zeropnt2DoReset(); - - Zeropnt2MakeInputs(); - - nCyclesTotal[0] = 16000000 / 60; - nCyclesDone[0] = 0; - - SekNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 9) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) Zeropnt2Draw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029691; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - MSM6295Scan(0, nAction); - - if (nBurnGunNumPlayers) BurnGunScan(); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(DrvDip); - SCAN_VAR(DrvInput); - SCAN_VAR(DrvOkiBank); - } - - return 0; -} - -static INT32 BurglarxScan(INT32 nAction, INT32 *pnMin) -{ - DrvScan(nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - BurnYM3812Scan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - memcpy(MSM6295ROM + 0x00000, DrvMSM6295ROMSrc + (0x40000 * DrvOkiBank), 0x40000); - } - - return 0; -} - -static INT32 ZeropntScan(INT32 nAction, INT32 *pnMin) -{ - DrvScan(nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - BurnYM3812Scan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - memcpy(MSM6295ROM + 0x20000, DrvMSM6295ROMSrc + 0x20000 + (0x20000 * DrvOkiBank), 0x20000); - } - - return 0; -} - -static INT32 Zeropnt2Scan(INT32 nAction, INT32 *pnMin) -{ - DrvScan(nAction, pnMin); - - EEPROMScan(nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - BurnYM2151Scan(nAction); - MSM6295Scan(1, nAction); - } - - if (nAction & ACB_WRITE) { - memcpy(MSM6295ROM + 0x20000, DrvMSM6295ROMSrc + 0x20000 + (0x20000 * DrvOkiBank), 0x20000); - } - - return 0; -} - -struct BurnDriver BurnDrvBurglarx = { - "burglarx", NULL, NULL, NULL, "1997", - "Burglar X\0", NULL, "Unico", "Unico", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, BurglarxRomInfo, BurglarxRomName, NULL, NULL, BurglarxInputInfo, BurglarxDIPInfo, - BurglarxInit, DrvExit, DrvFrame, NULL, BurglarxScan, - NULL, 0x2000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvZeropnt = { - "zeropnt", NULL, NULL, NULL, "1998", - "Zero Point (set 1)\0", NULL, "Unico", "Unico", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, ZeropntRomInfo, ZeropntRomName, NULL, NULL, ZeropntInputInfo, ZeropntDIPInfo, - ZeropntInit, DrvExit, DrvFrame, NULL, ZeropntScan, - NULL, 0x2000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvZeropntj = { - "zeropntj", "zeropnt", NULL, NULL, "1998", - "Zero Point (Japan)\0", NULL, "Unico", "Unico", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, ZeropntjRomInfo, ZeropntjRomName, NULL, NULL, ZeropntInputInfo, ZeropntDIPInfo, - ZeropntInit, DrvExit, DrvFrame, NULL, ZeropntScan, - NULL, 0x2000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvZeropnta = { - "zeropnta", "zeropnt", NULL, NULL, "1998", - "Zero Point (set 2)\0", NULL, "Unico", "Unico", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, ZeropntaRomInfo, ZeropntaRomName, NULL, NULL, ZeropntInputInfo, ZeropntDIPInfo, - ZeropntInit, DrvExit, DrvFrame, NULL, ZeropntScan, - NULL, 0x2000, 384, 224, 4, 3 -}; - -struct BurnDriver BurnDrvZeropnt2 = { - "zeropnt2", NULL, NULL, NULL, "1999", - "Zero Point 2\0", NULL, "Unico", "Unico", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0, - NULL, Zeropnt2RomInfo, Zeropnt2RomName, NULL, NULL, ZeropntInputInfo, Zeropnt2DIPInfo, - Zeropnt2Init, Zeropnt2Exit, Zeropnt2Frame, NULL, Zeropnt2Scan, - NULL, 0x2000, 384, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_vmetal.cpp b/jan/src/burn/drv/pst90s/d_vmetal.cpp deleted file mode 100644 index 5fa25e918..000000000 --- a/jan/src/burn/drv/pst90s/d_vmetal.cpp +++ /dev/null @@ -1,725 +0,0 @@ -// FB Alpha Varia Metal driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "msm6295.h" -#include "es8712.h" - -static UINT8 *AllMem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *AllRam = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KROM = NULL; -static UINT8 *DrvGfxROM = NULL; -static UINT8 *DrvSndROM0 = NULL; -static UINT8 *DrvSndROM1 = NULL; -static UINT8 *Drv68KRAM = NULL; -static UINT8 *DrvPalRAM = NULL; -static UINT8 *DrvSprRAM = NULL; -static UINT8 *DrvTXTRAM = NULL; -static UINT8 *DrvMD1RAM = NULL; -static UINT8 *DrvMD2RAM = NULL; -static UINT8 *DrvTLUTRAM = NULL; -static UINT8 *DrvVidRegs = NULL; - -static UINT16 *DrvPriBmp = NULL; - -static UINT32 *DrvPalette = NULL; -static UINT8 DrvRecalc; - -static INT32 blackpen = 0; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo vmetalInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 15, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 8, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 9, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 10, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 11, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 13, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 3, "service" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 4, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 2, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(vmetal) - -static struct BurnDIPInfo vmetalDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x16, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x07, 0x02, "1 Coin 4 Credits" }, - {0x16, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - {0x16, 0x01, 0x07, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x16, 0x01, 0x10, 0x10, "Off" }, - {0x16, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x16, 0x01, 0x20, 0x00, "Off" }, - {0x16, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0x03, 0x02, "Easy" }, - {0x17, 0x01, 0x03, 0x03, "Normal" }, - {0x17, 0x01, 0x03, 0x01, "Hard" }, - {0x17, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x17, 0x01, 0x0c, 0x08, "1" }, - {0x17, 0x01, 0x0c, 0x04, "2" }, - {0x17, 0x01, 0x0c, 0x0c, "3" }, - {0x17, 0x01, 0x0c, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x17, 0x01, 0x10, 0x10, "Every 30000" }, - {0x17, 0x01, 0x10, 0x00, "Every 60000" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x80, 0x80, "Off" }, - {0x17, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(vmetal) - -void __fastcall vmetal_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x400001: - case 0x400003: - MSM6295Command(0, data); - return; - } - - if ((address & 0xfffffff0) == 0x500000) { - es8712Write(0, (address/2) & 0x07, data); - return; - } -} - -void __fastcall vmetal_write_word(UINT32 address, UINT16 data) -{ - if (address == 0x200000) { - if ((data & 0x40) == 0) - es8712Reset(0); - else - es8712Play(0); - - if (data & 0x10) - es8712SetBankBase(0, 0x100000); - else - es8712SetBankBase(0, 0x000000); - } -} - -#define read_dip(dip) (((DrvDips[0] & (1 << (dip-1))) ? 0x40 : 0) | ((DrvDips[1] & (1 << (dip-1))) ? 0x80 : 0)) - -UINT8 __fastcall vmetal_read_byte(UINT32 address) -{ - switch (address) - { - case 0x400001: - return MSM6295ReadStatus(0); - } - - return 0; -} - -UINT16 __fastcall vmetal_read_word(UINT32 address) -{ - switch (address) - { - case 0x200000: - return DrvInputs[0]; - - case 0x200002: - return DrvInputs[1]; - - case 0x31fefe: - return read_dip(8); - - case 0x31ff7e: - return read_dip(7); - - case 0x31ffbe: - return read_dip(6); - - case 0x31ffde: - return read_dip(5); - - case 0x31ffee: - return read_dip(4); - - case 0x31fff6: - return read_dip(3); - - case 0x31fffa: - return read_dip(2); - - case 0x31fffc: - return read_dip(1); - } - - if ((address & 0xffff0000) == 0x160000) { - UINT16 *vreg = (UINT16*)DrvVidRegs; - - INT32 offset = ((address & 0xfffe) | ((BURN_ENDIAN_SWAP_INT16(vreg[0x0ab/2]) & 0x7f) << 16)) * 2; - - return (DrvGfxROM[offset + 0] << 12) | (DrvGfxROM[offset + 1] << 8) | (DrvGfxROM[offset + 2] << 4) | (DrvGfxROM[offset + 3] << 0); - } - - return 0; -} - -static inline void palette_write(INT32 offset) -{ - if (offset & 0x2000) { - INT32 rgb = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvPalRAM + offset))); - - if (rgb == 0) blackpen = offset/2; - - UINT8 g = (rgb >> 11); - UINT8 r = (rgb >> 6) & 0x1f; - UINT8 b = (rgb >> 1) & 0x1f; - - DrvPalette[(offset/2)&0xfff] = BurnHighCol((r << 3) | (r >> 5), (g << 3) | (g >> 5), (b << 3) | (b >> 5), 0); - } -} - -void __fastcall vmetal_palette_write_byte(UINT32 address, UINT8 data) -{ - DrvPalRAM[(address & 0x3fff)^1] = data; - - palette_write(address & 0x3ffe); -} - -void __fastcall vmetal_palette_write_word(UINT32 address, UINT16 data) -{ - *((UINT16*)(DrvPalRAM + (address & 0x3ffe))) = BURN_ENDIAN_SWAP_INT16(data); - - palette_write(address & 0x3ffe); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - es8712Reset(0); - MSM6295Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - - DrvGfxROM = Next; Next += 0x800000 * 2; - - MSM6295ROM = Next; - DrvSndROM0 = Next; Next += 0x100000; - DrvSndROM1 = Next; Next += 0x200000; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - DrvPriBmp = (UINT16*)Next; Next += 320 * 224 * sizeof(UINT16); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - - DrvPalRAM = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x004000; - - DrvTXTRAM = Next; Next += 0x020000; - DrvMD1RAM = Next; Next += 0x020000; - DrvMD2RAM = Next; Next += 0x020000; - - DrvTLUTRAM = Next; Next += 0x000800; - DrvVidRegs = Next; Next += 0x001000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void expand_gfx() -{ - for (INT32 i = 0; i < 0x800000; i+=8) { // properly interleave graphics - for (INT32 j = 0; j < 8; j++) { - DrvGfxROM[0x800000+j] = DrvGfxROM[i + ((j & 1) << 2) + ((j & 6) >> 1)]; - } - - memcpy (DrvGfxROM + i, DrvGfxROM + 0x800000, 8); - } - - for (INT32 i = 0x1000000-1; i >= 0; i--) { // unpack 4bpp pixel data - DrvGfxROM[i] = (DrvGfxROM[i/2] >> ((i & 1) << 2)) & 0x0f; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000000, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000001, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000002, 2, 4)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x000003, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x000001, 5, 4)) return 1; - - if (BurnLoadRom(DrvSndROM0 + 0x000000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x000000, 7, 1)) return 1; - - expand_gfx(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvTXTRAM, 0x100000, 0x11ffff, MAP_RAM); - SekMapMemory(DrvMD1RAM, 0x120000, 0x13ffff, MAP_RAM); - SekMapMemory(DrvMD2RAM, 0x140000, 0x15ffff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x170000, 0x173fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x174000, 0x177fff, MAP_RAM); - SekMapMemory(DrvTLUTRAM, 0x178000, 0x1787ff, MAP_RAM); - SekMapMemory(DrvVidRegs, 0x178800, 0x1797ff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, vmetal_write_byte); - SekSetWriteWordHandler(0, vmetal_write_word); - SekSetReadByteHandler(0, vmetal_read_byte); - SekSetReadWordHandler(0, vmetal_read_word); - - SekMapHandler(1, 0x170000, 0x173fff, MAP_WRITE); - SekSetWriteByteHandler(1, vmetal_palette_write_byte); - SekSetWriteWordHandler(1, vmetal_palette_write_word); - SekClose(); - - es8712Init(0, DrvSndROM1, 12000 / 60 /* Rate / FPS */, 0); - es8712SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 1320000 / 132, 1); - MSM6295SetRoute(0, 0.40, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - es8712Exit(0); - SekExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void draw_layer_8x8() -{ - UINT16 *vram = (UINT16*)DrvTXTRAM; - UINT16 *vlut = (UINT16*)DrvTLUTRAM; - - for (INT32 y = 0; y < 224 / 8; y++) { - for (INT32 x = 0; x < 320 / 8; x++) { - INT32 offs = (y << 8) | x; - - INT32 sx = x << 3; - INT32 sy = y << 3; - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 data = BURN_ENDIAN_SWAP_INT16(vram[offs]); - if (data & 0x8000) continue; - - INT32 index = (data & 0x7ff0) >> 3; - UINT32 lut = (BURN_ENDIAN_SWAP_INT16(vlut[index]) << 16) | (BURN_ENDIAN_SWAP_INT16(vlut[index + 1])); - - INT32 code = (data & 0x0f) | (lut & 0x3fff0); - INT32 color = (lut >> 20) & 0x1f; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0xe00, DrvGfxROM); - } - } -} - -static void draw_layer_16x16(UINT8 *ram, INT32 layer) -{ - UINT16 *vram = (UINT16*)ram; - UINT16 *vlut = (UINT16*)DrvTLUTRAM; - UINT16 *scrl = (UINT16*)(DrvVidRegs + 0x70); - UINT16 xscroll = BURN_ENDIAN_SWAP_INT16(scrl[layer * 2 + 1]) & 0xfff; - - for (INT32 offs = 0; offs < 256 * 256; offs++) - { - INT32 sx = (offs & 0xff) << 4; - INT32 sy = (offs >> 8) << 4; - - sx -= xscroll; - if (sx < -15) sx += 0x1000; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 data = BURN_ENDIAN_SWAP_INT16(vram[offs]); - if (data & 0x8000) continue; - - INT32 index = (data & 0x7ff0) >> 3; - - UINT32 lu = (BURN_ENDIAN_SWAP_INT16(vlut[index]) << 16) | (BURN_ENDIAN_SWAP_INT16(vlut[index + 1]) << 0); - - INT32 code = (data & 0x0f) | ((lu >> 2) & 0xfff0); - INT32 color = (lu >> 20) & 0xff; - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0x0f, 0, DrvGfxROM); - } -} - -static void RenderZoomedPriorityTile(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, INT32 prio) -{ - INT32 h = ((zoomy * 16) + 0x8000) / 0x10000; - INT32 w = ((zoomx * 16) + 0x8000) / 0x10000; - - if (!h || !w || sx + w < 0 || sy + h < 0 || sx >= nScreenWidth || sy >= nScreenHeight) return; - - if (fy) fy = (height - 1); - if (fx) fx = (width - 1); - - INT32 hz = (height * 0x1000) / h; - INT32 wz = (width * 0x1000) / w; - - INT32 starty = 0, startx = 0, endy = h, endx = w; - if (sy < 0) starty = 0 - sy; - if (sx < 0) startx = 0 - sx; - if (sy + h >= nScreenHeight) endy -= (h + sy) - nScreenHeight; - if (sx + w >= nScreenWidth ) endx -= (w + sx) - nScreenWidth; - - UINT8 *src = gfx + (code * width * height); - UINT16 *dst = dest + (sy + starty) * nScreenWidth + sx; - UINT16 *pri = DrvPriBmp + (sy + starty) * nScreenWidth + sx; - - for (INT32 y = starty; y < endy; y++) - { - INT32 zy = (y * hz) / 0x1000; - if (fy) zy = fy - zy; - zy *= width; - - for (INT32 x = startx; x < endx; x++) - { - INT32 zx = (x * wz) / 0x1000; - if (fx) zx = fx - zx; - - INT32 pxl = src[zy + zx]; - - if (pxl != t) { - if ((pri[x] & prio) == 0) { - dst[x] = pxl | color; - pri[x] = prio; - } - } - } - - dst += nScreenWidth; - pri += nScreenWidth; - } -} - -static void draw_sprites() // (metro) -{ - UINT16 *videoregs = (UINT16*)(DrvVidRegs + 0xf00); - UINT16 *spriteram = (UINT16*)DrvSprRAM; - UINT8 *gfx_max = DrvGfxROM + 0x1000000; - - INT32 sprites = BURN_ENDIAN_SWAP_INT16(videoregs[0x00]) & 0x1ff; - if (sprites == 0) return; - - INT32 color_start = (BURN_ENDIAN_SWAP_INT16(videoregs[0x04]) & 0x0f) << 4; - - static const INT32 primask[4] = { 0x0000, 0xff00, 0xfff0, 0xfffc }; - - static const INT32 zoomtable[0x40] = { - 0xAAC,0x800,0x668,0x554,0x494,0x400,0x390,0x334, - 0x2E8,0x2AC,0x278,0x248,0x224,0x200,0x1E0,0x1C8, - 0x1B0,0x198,0x188,0x174,0x164,0x154,0x148,0x13C, - 0x130,0x124,0x11C,0x110,0x108,0x100,0x0F8,0x0F0, - 0x0EC,0x0E4,0x0DC,0x0D8,0x0D4,0x0CC,0x0C8,0x0C4, - 0x0C0,0x0BC,0x0B8,0x0B4,0x0B0,0x0AC,0x0A8,0x0A4, - 0x0A0,0x09C,0x098,0x094,0x090,0x08C,0x088,0x080, - 0x078,0x070,0x068,0x060,0x058,0x050,0x048,0x040 - }; - - UINT16 *src; - INT32 inc; - - for (INT32 i = 0; i < 0x20; i++) - { - if (BURN_ENDIAN_SWAP_INT16(videoregs[0x02/2]) & 0x8000) - { - src = spriteram; - inc = (8 / 2); - } else { - src = spriteram + (sprites - 1) * (8 / 2); - inc = -(8 / 2); - } - - for (INT32 j = 0; j < sprites; j++) - { - INT32 x = BURN_ENDIAN_SWAP_INT16(src[0]); - INT32 curr_pri = (x & 0xf800) >> 11; - - if ((curr_pri == 0x1f) || (curr_pri != i)) - { - src += inc; - continue; - } - - INT32 pri = (BURN_ENDIAN_SWAP_INT16(videoregs[0x01]) & 0x0300) >> 8; - - if (!(BURN_ENDIAN_SWAP_INT16(videoregs[0x01]) & 0x8000)) - { - if (curr_pri > (BURN_ENDIAN_SWAP_INT16(videoregs[0x01]) & 0x001f)) - pri = (BURN_ENDIAN_SWAP_INT16(videoregs[0x01]) & 0x0c00) >> 10; - } - - INT32 y = BURN_ENDIAN_SWAP_INT16(src[1]); - INT32 attr = BURN_ENDIAN_SWAP_INT16(src[2]); - INT32 code = BURN_ENDIAN_SWAP_INT16(src[3]); - - INT32 flipx = attr & 0x8000; - INT32 flipy = attr & 0x4000; - INT32 color = (attr & 0x00f0) >> 4; - - INT32 width = (((attr >> 11) & 0x7) + 1) * 8; - INT32 height = (((attr >> 8) & 0x7) + 1) * 8; - INT32 zoom = zoomtable[(y & 0xfc00) >> 10] << 8; - - x = (x & 0x07ff)-64; - y = (y & 0x03ff)-64; - - UINT8 *gfxdata = DrvGfxROM + (32 * (((attr & 0x000f) << 16) + code))*2; - - if ((gfxdata + (width / 2 * height - 1)*2) >= gfx_max) - continue; - - RenderZoomedPriorityTile(pTransDraw, gfxdata, 0, (color + color_start)<<4, 15, x, y, flipx, flipy, width, height, (zoom*width) >> 4, (zoom*height)>>4, primask[pri]); - - src += inc; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0x2000; i < 0x4000; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - UINT16 *vregs = (UINT16*)(DrvVidRegs + 0xf00); - blackpen = BURN_ENDIAN_SWAP_INT16(vregs[0x12 / 2]); - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = blackpen; - DrvPriBmp[i] = 0; - } - - UINT16 order = BURN_ENDIAN_SWAP_INT16(vregs[0x10 / 2]); - - if (order == 0x24) { - if (nBurnLayer & 2) draw_layer_16x16(DrvMD2RAM, 2); - if (nBurnLayer & 1) draw_layer_16x16(DrvMD1RAM, 1); - } else { - if (nBurnLayer & 1) draw_layer_16x16(DrvMD1RAM, 1); - if (nBurnLayer & 2) draw_layer_16x16(DrvMD2RAM, 2); - } - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) draw_layer_8x8(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - INT32 nInterleave = 256; - INT32 nTotalCycles = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - - SekOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - SekRun(nTotalCycles / nInterleave); - - if (i == (nInterleave - 1)) - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - } - SekClose(); - - if (pBurnSoundOut) { - es8712Update(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029708; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - es8712Scan(0, nAction); - MSM6295Scan(0, nAction); - - SCAN_VAR(blackpen); - - DrvRecalc = 1; - } - - return 0; -} - - -// Varia Metal - -static struct BurnRomInfo vmetalRomDesc[] = { - { "5b.u19", 0x080000, 0x4933ac6c, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "6b.u18", 0x080000, 0x4eb939d5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.u29", 0x200000, 0xb470c168, 2 | BRF_GRA }, // 2 8x8, 16x16, and Sprite tiles - { "2.u31", 0x200000, 0xb36f8d60, 2 | BRF_GRA }, // 3 - { "3.u28", 0x200000, 0x00fca765, 2 | BRF_GRA }, // 4 - { "4.u30", 0x200000, 0x5a25a49c, 2 | BRF_GRA }, // 5 - - { "8.u9", 0x080000, 0xc14c001c, 3 | BRF_SND }, // 6 OKI MSM6295 Samples - - { "7.u12", 0x200000, 0xa88c52f1, 4 | BRF_SND }, // 7 ES8712 Samples -}; - -STD_ROM_PICK(vmetal) -STD_ROM_FN(vmetal) - -struct BurnDriver BurnDrvVmetal = { - "vmetal", NULL, NULL, NULL, "1995", - "Varia Metal\0", NULL, "Excellent System", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, vmetalRomInfo, vmetalRomName, NULL, NULL, vmetalInputInfo, vmetalDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 320, 3, 4 -}; - - -// Varia Metal (New Ways Trading Co.) - -static struct BurnRomInfo vmetalnRomDesc[] = { - { "vm5.bin", 0x080000, 0x43ef844e, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "vm6.bin", 0x080000, 0xcb292ab1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "1.u29", 0x200000, 0xb470c168, 2 | BRF_GRA }, // 2 8x8, 16x16, and Sprite tiles - { "2.u31", 0x200000, 0xb36f8d60, 2 | BRF_GRA }, // 3 - { "3.u28", 0x200000, 0x00fca765, 2 | BRF_GRA }, // 4 - { "4.u30", 0x200000, 0x5a25a49c, 2 | BRF_GRA }, // 5 - - { "8.u9", 0x080000, 0xc14c001c, 3 | BRF_SND }, // 6 OKI MSM6295 Samples - - { "7.u12", 0x200000, 0xa88c52f1, 4 | BRF_SND }, // 7 ES8712 Samples -}; - -STD_ROM_PICK(vmetaln) -STD_ROM_FN(vmetaln) - -struct BurnDriver BurnDrvVmetaln = { - "vmetaln", "vmetal", NULL, NULL, "1995", - "Varia Metal (New Ways Trading Co.)\0", NULL, "Excellent System (New Ways Trading Co. license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0, - NULL, vmetalnRomInfo, vmetalnRomName, NULL, NULL, vmetalInputInfo, vmetalDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x1000, - 224, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/pst90s/d_welltris.cpp b/jan/src/burn/drv/pst90s/d_welltris.cpp deleted file mode 100644 index 0c71ab32f..000000000 --- a/jan/src/burn/drv/pst90s/d_welltris.cpp +++ /dev/null @@ -1,957 +0,0 @@ -// FB Alpha Welltris driver module -// Based on MAME driver David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2610.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM0; -static UINT8 *DrvSndROM1; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvPxlRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *pending_command; - -static UINT8 *flipscreen; -static UINT8 *sound_bank; -static UINT8 *gfx_bank; -static UINT8 *spritepalbank; -static UINT8 *pixelpalbank; -static UINT8 *charpalbank; - -static UINT16 *scroll; - -static UINT8 DrvInputs[6]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvJoy6[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 screen_y_offset; - -static struct BurnInputInfo WelltrisInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - -/* {"P3 Coin", BIT_DIGITAL, DrvJoy6 + 0, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy6 + 2, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2" }, - - {"P4 Coin", BIT_DIGITAL, DrvJoy6 + 1, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, DrvJoy6 + 3, "p4 start" }, - {"P4 Up", BIT_DIGITAL, DrvJoy5 + 0, "p4 up" }, - {"P4 Down", BIT_DIGITAL, DrvJoy5 + 1, "p4 down" }, - {"P4 Left", BIT_DIGITAL, DrvJoy5 + 2, "p4 left" }, - {"P4 Right", BIT_DIGITAL, DrvJoy5 + 3, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 5, "p4 fire 2" },*/ - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Test", BIT_DIGITAL, DrvJoy1 + 4, "diag" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service" }, -// {"Tilt", BIT_DIGITAL, DrvJoy1 + 5, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Welltris) - -static struct BurnInputInfo Quiz18kInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Quiz18k) - -static struct BurnDIPInfo WelltrisDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0x0f, 0x06, "5 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x0f, 0x04, "2-1, 4-2, 5-3, 6-4" }, - {0x13, 0x01, 0x0f, 0x03, "2-1, 4-3" }, - {0x13, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x0f, 0x01, "1-1, 2-2, 3-3, 4-5" }, - {0x13, 0x01, 0x0f, 0x02, "1-1, 2-2, 3-3, 4-4, 5-6" }, - {0x13, 0x01, 0x0f, 0x00, "1-1, 2-3" }, - {0x13, 0x01, 0x0f, 0x05, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x13, 0x01, 0xf0, 0x60, "5 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xf0, 0x40, "2-1, 4-2, 5-3, 6-4" }, - {0x13, 0x01, 0xf0, 0x30, "2-1, 4-3" }, - {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xf0, 0x10, "1-1, 2-2, 3-3, 4-5" }, - {0x13, 0x01, 0xf0, 0x20, "1-1, 2-2, 3-3, 4-4, 5-6" }, - {0x13, 0x01, 0xf0, 0x00, "1-1, 2-3" }, - {0x13, 0x01, 0xf0, 0x50, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x14, 0x01, 0x04, 0x04, "Mono Player" }, - {0x14, 0x01, 0x04, 0x00, "Many Player" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - -// {0 , 0xfe, 0 , 2, "DIPSW 2-5 (see notes)" }, -// {0x14, 0x01, 0x10, 0x10, "Off" }, -// {0x14, 0x01, 0x10, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "4 Players Mode" }, -// {0x14, 0x01, 0x30, 0x30, "Off" }, -// {0x14, 0x01, 0x30, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Welltris) - -static struct BurnDIPInfo Quiz18kDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xfd, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Title Logo Type" }, - {0x15, 0x01, 0x20, 0x20, "1" }, - {0x15, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Quiz18k) - -inline void WelltrisClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void sprite_hack(INT32 offset) -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - if (offset == 0x3fc) { - if (ram[0x1fc] == 0 && ram[0x1fd] == 0 && ram[0x1ff] == 0) { - memset (DrvSprRAM, 0, 0x3fc); - } - } -} - -static inline void palette_write(INT32 offset) -{ - UINT16 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (p >> 10) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset / 2] = BurnHighCol(r, g, b, 0); -} - -void __fastcall welltris_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffffc00) == 0xffc000) { - DrvSprRAM[(address & 0x3ff) ^ 1] = data; - sprite_hack(address & 0x3fe); - return; - } - - if ((address & 0xfffff000) == 0xffe000) { - DrvPalRAM[(address & 0xfff) ^ 1] = data; - palette_write(address & 0xffe); - return; - } - - switch (address) - { - case 0xfff001: - *charpalbank = data & 0x03; - *pixelpalbank =(data & 0x08) >> 3; - *spritepalbank =(data & 0x20) >> 5; - *flipscreen = data & 0x80; - return; - - case 0xfff003: - gfx_bank[0] = data >> 4; - gfx_bank[1] = data & 0x0f; - return; - - case 0xfff009: - *pending_command = 0x80; - *soundlatch = data; - ZetNmi(); - return; - } -} - -void __fastcall welltris_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffffc00) == 0xffc000) { - *((UINT16*)(DrvSprRAM + (address & 0x3fe))) = data; - sprite_hack(address & 0x3fe); - return; - } - - if ((address & 0xfffff000) == 0xffe000) { - *((UINT16*)(DrvPalRAM + (address & 0xffe))) = data; - palette_write(address & 0xffe); - return; - } - - switch (address) - { - case 0xfff004: - scroll[0] = data - 14; - return; - - case 0xfff006: - scroll[1] = data; - return; - } -} - -UINT8 __fastcall welltris_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0xfff001: - return ~DrvInputs[1]; - - case 0xfff003: - return ~DrvInputs[2]; - - case 0xfff005: - return ~DrvInputs[3]; - - case 0xfff007: - return ~DrvInputs[4]; - - case 0xfff009: - return (DrvInputs[0] & 0x7f) | *pending_command; - - case 0xfff00b: - return ~DrvInputs[5]; - - case 0xfff00d: - return DrvDips[0]; - - case 0xfff00f: - return DrvDips[1]; - } - - return 0; -} - -UINT16 __fastcall welltris_main_read_word(UINT32 ) -{ - return 0; -} - -static void bankswitch(INT32 data) -{ - sound_bank[0] = data; - - ZetMapArea(0x8000, 0xffff, 0, DrvZ80ROM + (data & 0x03) * 0x8000); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80ROM + (data & 0x03) * 0x8000); -} - -void __fastcall welltris_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - bankswitch(data); - return; - - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: - BurnYM2610Write(port & 3, data); - return; - - case 0x18: - *pending_command = 0; - return; - } -} - -UINT8 __fastcall welltris_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x08: - return BurnYM2610Read(0); - - case 0x0a: - return BurnYM2610Read(2); - - case 0x10: - return *soundlatch; - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2610Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x180000; - DrvZ80ROM = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x300000*2; - DrvGfxROM1 = Next; Next += 0x200000*2; - - DrvSndROM0 = Next; Next += 0x080000; - DrvSndROM1 = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000400; - DrvVidRAM = Next; Next += 0x001000; - DrvPxlRAM = Next; Next += 0x020000; - - DrvZ80RAM = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - pending_command = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - sound_bank = Next; Next += 0x000001; - - gfx_bank = Next; Next += 0x000002; - - charpalbank = Next; Next += 0x000001; - spritepalbank = Next; Next += 0x000001; - pixelpalbank = Next; Next += 0x000001; - - scroll = (UINT16*)Next; Next += 0x000002 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *gfx, INT32 len) // gfx0 - 0, gfx1 - 600 -{ - for (INT32 i = len - 1; i >= 0; i--) { - gfx[i * 2 + 1] = gfx[i] >> 4; - gfx[i * 2 + 0] = gfx[i] & 0x0f; - } -} - -static void DrvFixSprites() -{ - for (INT32 i = 0; i < 0x100000; i+=4) { - INT32 t = DrvGfxROM1[i + 1]; - DrvGfxROM1[i + 1] = DrvGfxROM1[i + 2]; - DrvGfxROM1[i + 2] = t; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - screen_y_offset = (strncmp(BurnDrvGetTextA(DRV_NAME), "welltris", 8) == 0) ? 8 : 0; - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x100000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM0, 5, 1)) return 1; - - if (BurnLoadRom(DrvSndROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvSndROM1 + 0x80000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00001, 9, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 10, 1)) return 1; - - if (screen_y_offset == 0) { - if (BurnLoadRom(DrvGfxROM0 + 0x080000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 12, 1)) return 1; - } else { - // welltris 4 player hack (change ori 0030 to 0000 - //*((UINT16 *)(Drv68KROM + 0xB91E)) = 0x0000; - } - - DrvFixSprites(); - DrvGfxExpand(DrvGfxROM0, 0x180000); - DrvGfxExpand(DrvGfxROM1, 0x100000); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM + 0x000000, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Drv68KROM + 0x100000, 0x100000, 0x17ffff, MAP_ROM); - SekMapMemory(DrvPxlRAM, 0x800000, 0x81ffff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff8000, 0xffbfff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0xffc000, 0xffc3ff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0xffd000, 0xffdfff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0xffe000, 0xffefff, MAP_ROM); - SekSetWriteByteHandler(0, welltris_main_write_byte); - SekSetWriteWordHandler(0, welltris_main_write_word); - SekSetReadByteHandler(0, welltris_main_read_byte); - SekSetReadWordHandler(0, welltris_main_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x77ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x77ff, 2, DrvZ80ROM); - ZetMapArea(0x7800, 0x7fff, 0, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 1, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 2, DrvZ80RAM); - ZetSetOutHandler(welltris_sound_write_port); - ZetSetInHandler(welltris_sound_read_port); - ZetClose(); - - INT32 DrvSndROMLen1 = 0x100000; - INT32 DrvSndROMLen0 = 0x080000; - - BurnYM2610Init(8000000, DrvSndROM1, &DrvSndROMLen1, DrvSndROM0, &DrvSndROMLen0, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 0.75, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 0.75, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM2610Exit(); - - ZetExit(); - SekExit(); - - BurnFree(AllMem); - - return 0; -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 }; - - for (INT32 offs = 0; offs < 0x200 - 4; offs += 4) { - INT32 data0 = ram[offs + 0]; - INT32 data1 = ram[offs + 1]; - INT32 data2 = ram[offs + 2]; - INT32 data3 = ram[offs + 3]; - - INT32 code = data3 & 0x1fff; - INT32 color = (data2 & 0x0f) + (0x10 * *spritepalbank) + 0x60; - INT32 y = (data0 & 0x1ff) + 1 - screen_y_offset; - INT32 x = (data1 & 0x1ff) + 6 - 15; - INT32 yzoom = (data0 >> 12) & 15; - INT32 xzoom = (data1 >> 12) & 15; - INT32 zoomed = (xzoom | yzoom); - INT32 ytiles = ((data2 >> 12) & 7) + 1; - INT32 xtiles = ((data2 >> 8) & 7) + 1; - INT32 yflip = (data2 >> 15) & 1; - INT32 xflip = (data2 >> 11) & 1; - INT32 xt, yt; - - if (!(ram[offs + 2] & 0x0080)) continue; - - xzoom = 16 - zoomtable[xzoom] / 8; - yzoom = 16 - zoomtable[yzoom] / 8; - - if (x >= 0x200) x -= 0x200; - if (y >= 0x200) y -= 0x200; - - if (!xflip && !yflip) { - for (yt = 0; yt < ytiles; yt++) { - for (xt = 0; xt < xtiles; xt++, code++) { - if (!zoomed) - Render16x16Tile_Mask_Clip(pTransDraw, code, x + xt * 16, y + yt * 16, color, 4, 15, 0, DrvGfxROM1); - else - RenderZoomedTile(pTransDraw, DrvGfxROM1, code, color << 4, 15, x + xt * xzoom, y + yt * yzoom, 0, 0, 16, 16, 0x1000 * xzoom, 0x1000 * yzoom); - } - if (xtiles == 3) code += 1; - if (xtiles == 5) code += 3; - if (xtiles == 6) code += 2; - if (xtiles == 7) code += 1; - } - } - else if (xflip && !yflip) { - for (yt = 0; yt < ytiles; yt++) { - for (xt = 0; xt < xtiles; xt++, code++) { - if (!zoomed) - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, x + (xtiles - 1 - xt) * 16, y + yt * 16, color, 4, 15, 0, DrvGfxROM1); - else - RenderZoomedTile(pTransDraw, DrvGfxROM1, code, color << 4, 15, x + (xtiles - 1 - xt) * xzoom, y + yt * yzoom, 1, 0, 16, 16, 0x1000 * xzoom, 0x1000 * yzoom); - } - if (xtiles == 3) code += 1; - if (xtiles == 5) code += 3; - if (xtiles == 6) code += 2; - if (xtiles == 7) code += 1; - } - } - else if (!xflip && yflip) { - for (yt = 0; yt < ytiles; yt++) { - for (xt = 0; xt < xtiles; xt++, code++) { - if (!zoomed) - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, x + xt * 16, y + (ytiles - 1 - yt) * 16, color, 4, 15, 0, DrvGfxROM1); - else - RenderZoomedTile(pTransDraw, DrvGfxROM1, code, color << 4, 15, x + xt * xzoom, y + (ytiles - 1 - yt) * yzoom, 0, 1, 16, 16, 0x1000 * xzoom, 0x1000 * yzoom); - } - if (xtiles == 3) code += 1; - if (xtiles == 5) code += 3; - if (xtiles == 6) code += 2; - if (xtiles == 7) code += 1; - } - } - else { - for (yt = 0; yt < ytiles; yt++) { - for (xt = 0; xt < xtiles; xt++, code++) { - if (!zoomed) - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, x + (xtiles - 1 - xt) * 16, y + (ytiles - 1 - yt) * 16, color, 4, 15, 0, DrvGfxROM1); - else - RenderZoomedTile(pTransDraw, DrvGfxROM1, code, color << 4, 15, x + (xtiles - 1 - xt) * xzoom, y + (ytiles - 1 - yt) * yzoom, 1, 1, 16, 16, 0x1000 * xzoom, 0x1000 * yzoom); - } - if (xtiles == 3) code += 1; - if (xtiles == 5) code += 3; - if (xtiles == 6) code += 2; - if (xtiles == 7) code += 1; - } - } - } -} - -static void draw_foreground() -{ - INT32 color_bank = *charpalbank << 3; - INT32 scrollx = scroll[0] & 0x1ff; - INT32 scrolly = scroll[1] & 0x0ff; - - UINT16 *vram = (UINT16*)DrvVidRAM; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - - INT32 attr = vram[offs]; - INT32 code = (attr & 0xfff) | (gfx_bank[(attr >> 12) & 1] << 12); - INT32 color = (attr >> 13) | color_bank; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx - 15, sy - screen_y_offset, color & 0x7f, 4, 15, 0, DrvGfxROM0); - } -} - -static void draw_background() -{ - INT32 color_bank = 0x400 + (*pixelpalbank << 8); - - UINT16 *vram = (UINT16*)DrvPxlRAM; - - for (INT32 offs = (screen_y_offset * 256); offs < 256 * 256; offs++) - { - INT32 sx = ((offs & 0xff) << 1) - 15; - INT32 sy = (offs >> 8) - screen_y_offset; - - INT32 pxl = vram[offs]; - - if (sy < nScreenHeight && sy >= 0) { - if (sx >= 0 && sx < nScreenWidth) pTransDraw[sy * nScreenWidth + sx] = color_bank | (pxl >> 8); - sx++; - if (sx >= 0 && sx < nScreenWidth) pTransDraw[sy * nScreenWidth + sx] = color_bank | (pxl & 0xff); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) draw_background(); - if (nBurnLayer & 2) draw_foreground(); - if (nBurnLayer & 4) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - DrvInputs[0] = 0xff; - DrvInputs[1] = 0x00; - DrvInputs[2] = 0x00; - DrvInputs[3] = 0x00; - DrvInputs[4] = 0x00; - DrvInputs[5] = 0x00; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] |= (DrvJoy2[i] & 1) << i; - DrvInputs[2] |= (DrvJoy3[i] & 1) << i; - DrvInputs[3] |= (DrvJoy4[i] & 1) << i; - DrvInputs[4] |= (DrvJoy5[i] & 1) << i; - DrvInputs[5] |= (DrvJoy6[i] & 1) << i; - } - } - - // Clear Opposites - WelltrisClearOpposites(&DrvInputs[1]); - WelltrisClearOpposites(&DrvInputs[2]); -// WelltrisClearOpposites(&DrvInputs[3]); -// WelltrisClearOpposites(&DrvInputs[4]); - - INT32 nInterleave = 256; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - SekRun(10000000 / 60 / nInterleave); - BurnTimerUpdate((4000000 / 60 * (i + 1)) / nInterleave); - - } - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrame(4000000 / 60); - - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(sound_bank[0]); - ZetClose(); - } - - return 0; -} - - -// Welltris - Alexey Pajitnov's (World?, 2 players) - -static struct BurnRomInfo welltrisRomDesc[] = { - { "j2u.8", 0x20000, 0x7488fe94, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "j1u.7", 0x20000, 0x571413ac, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lh532j10.10", 0x40000, 0x1187c665, 1 | BRF_PRG | BRF_ESS }, // 2 - { "lh532j11.9", 0x40000, 0x18eda9e5, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "3.144", 0x20000, 0xae8f763e, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "lh534j11.126", 0x80000, 0xbf85fb0d, 3 | BRF_SND }, // 5 ADPCM-B Samples - - { "lh534j09.123", 0x80000, 0x6c2ce9a5, 4 | BRF_SND }, // 6 ADPCM-A Samples - { "lh534j10.124", 0x80000, 0xe3682221, 4 | BRF_SND }, // 7 - - { "046.93", 0x40000, 0x31d96d77, 5 | BRF_GRA }, // 8 Sprites - { "048.94", 0x40000, 0xbb4643da, 5 | BRF_GRA }, // 9 - - { "lh534j12.77", 0x80000, 0xb61a8b74, 6 | BRF_GRA }, // 10 Tiles -}; - -STD_ROM_PICK(welltris) -STD_ROM_FN(welltris) - -struct BurnDriver BurnDrvWelltris = { - "welltris", NULL, NULL, NULL, "1991", - "Welltris - Alexey Pajitnov's (World?, 2 players)\0", NULL, "Video System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, welltrisRomInfo, welltrisRomName, NULL, NULL, WelltrisInputInfo, WelltrisDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 352, 240, 4, 3 -}; - - -// Welltris - Alexey Pajitnov's (Japan, 2 players) - -static struct BurnRomInfo welltrisjRomDesc[] = { - { "j2.8", 0x20000, 0x68ec5691, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "j1.7", 0x20000, 0x1598ea2c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "lh532j10.10", 0x40000, 0x1187c665, 1 | BRF_PRG | BRF_ESS }, // 2 - { "lh532j11.9", 0x40000, 0x18eda9e5, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "3.144", 0x20000, 0xae8f763e, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "lh534j11.126", 0x80000, 0xbf85fb0d, 3 | BRF_SND }, // 5 ADPCM-B Samples - - { "lh534j09.123", 0x80000, 0x6c2ce9a5, 4 | BRF_SND }, // 6 ADPCM-A Samples - { "lh534j10.124", 0x80000, 0xe3682221, 4 | BRF_SND }, // 7 - - { "046.93", 0x40000, 0x31d96d77, 5 | BRF_GRA }, // 8 Sprites - { "048.94", 0x40000, 0xbb4643da, 5 | BRF_GRA }, // 9 - - { "lh534j12.77", 0x80000, 0xb61a8b74, 6 | BRF_GRA }, // 10 Tiles -}; - -STD_ROM_PICK(welltrisj) -STD_ROM_FN(welltrisj) - -struct BurnDriver BurnDrvWelltrisj = { - "welltrisj", "welltris", NULL, NULL, "1991", - "Welltris - Alexey Pajitnov's (Japan, 2 players)\0", NULL, "Video System Co.", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, welltrisjRomInfo, welltrisjRomName, NULL, NULL, WelltrisInputInfo, WelltrisDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 352, 240, 4, 3 -}; - - -// Miyasu Nonki no Quiz 18-Kin - -static struct BurnRomInfo quiz18kRomDesc[] = { - { "1-ic8.bin", 0x20000, 0x10a64336, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "2-ic7.bin", 0x20000, 0x8b21b431, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ic10.bin", 0x40000, 0x501453a3, 1 | BRF_PRG | BRF_ESS }, // 2 - { "ic9.bin", 0x40000, 0x99b6840f, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "3-ic144.bin", 0x20000, 0x72d372e3, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 Code - - { "ic126.bin", 0x40000, 0x7a92fbc9, 3 | BRF_SND }, // 5 ADPCM-B Samples - - { "ic123.bin", 0x80000, 0xee4995cf, 4 | BRF_SND }, // 6 ADPCM-A Samples - { "ic124.bin", 0x40000, 0x076f58c3, 4 | BRF_SND }, // 7 - - { "ic93.bin", 0x80000, 0x4d387c5e, 5 | BRF_GRA }, // 8 Sprites - { "ic94.bin", 0x80000, 0x6be2f164, 5 | BRF_GRA }, // 9 - - { "ic77.bin", 0x80000, 0xaf3b6fd1, 6 | BRF_GRA }, // 10 Tiles - { "ic78.bin", 0x80000, 0x44bbdef3, 6 | BRF_GRA }, // 11 - { "ic79.bin", 0x80000, 0xd721e169, 6 | BRF_GRA }, // 12 -}; - -STD_ROM_PICK(quiz18k) -STD_ROM_FN(quiz18k) - -struct BurnDriver BurnDrvQuiz18k = { - "quiz18k", NULL, NULL, NULL, "1992", - "Miyasu Nonki no Quiz 18-Kin\0", NULL, "EIM", "Miscellaneous", - L"\u307F\u3084\u3059\u306E\u3093\u304D\u306E \u30AF\u30A4\u30BA\uFF11\uFF18\u7981 \uFF24\uFF52\uFF0E \u30A8\u30C3\u3061\u3083\u3093\u306E\u8A3A\u5BDF\u5BA4\0Miyasu Nonki no Quiz 18-Kin\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0, - NULL, quiz18kRomInfo, quiz18kRomName, NULL, NULL, Quiz18kInputInfo, Quiz18kDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_wrally.cpp b/jan/src/burn/drv/pst90s/d_wrally.cpp deleted file mode 100644 index da08636e1..000000000 --- a/jan/src/burn/drv/pst90s/d_wrally.cpp +++ /dev/null @@ -1,841 +0,0 @@ -// FB Alpha World Rally driver module -// Based on MAME driver by Manuel Abadia, Mike Coates, Nicola Salmoria, and Miguel Angel Horna - -// to do -// hook up analog inputs (or not, since it has joystick settings) -// note these are disabled in the dips completely! - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "mcs51.h" -#include "msm6295.h" -#include "gaelco_crypt.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvMCUROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvTransTab[2]; -static UINT8 *DrvSndROM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVRegs; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 okibank; -static UINT8 flipscreen; -static UINT8 coin_lockout[2]; - -static INT32 transparent_select; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo WrallyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 14, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Gear Shift", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - // analog input placeholder... - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 15, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 8, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 9, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 11, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 10, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 0, "service" }, - {"Service Mode", BIT_DIGITAL, DrvJoy2 + 1, "diagnostics" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Wrally) - -static struct BurnDIPInfo WrallyDIPList[]= -{ - {0x15, 0xff, 0xff, 0xdf, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x03, "Normal" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Number of Joysticks" }, - {0x15, 0x01, 0x04, 0x04, "2" }, - {0x15, 0x01, 0x04, 0x00, "1" }, - - {0 , 0xfe, 0 , 1, "Control Configuration"}, -// digital only for now! - {0x15, 0x01, 0x18, 0x18, "Joystick" }, -// {0x15, 0x01, 0x18, 0x10, "Pot Wheel" }, -// {0x15, 0x01, 0x18, 0x00, "Optical Wheel" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x20, 0x20, "Off" }, - {0x15, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x40, 0x40, "Upright" }, - {0x15, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x16, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x07, 0x00, "3 Coins 4 Credits" }, - {0x16, 0x01, 0x07, 0x01, "2 Coins 3 Credits" }, - {0x16, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x16, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x16, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x16, 0x01, 0x38, 0x10, "6 Coins 1 Credits" }, - {0x16, 0x01, 0x38, 0x18, "5 Coins 1 Credits" }, - {0x16, 0x01, 0x38, 0x20, "4 Coins 1 Credits" }, - {0x16, 0x01, 0x38, 0x28, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x38, 0x30, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x38, 0x08, "3 Coins 2 Credits" }, - {0x16, 0x01, 0x38, 0x00, "4 Coins 3 Credits" }, - {0x16, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 2, "Credit configuration" }, - {0x16, 0x01, 0x40, 0x40, "Start 1C/Continue 1C" }, - {0x16, 0x01, 0x40, 0x00, "Start 2C/Continue 1C" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Wrally) - -static void oki_bankswitch(INT32 data) -{ - okibank = data; - - MSM6295SetBank(0, DrvSndROM + (data & 0x0f) * 0x10000, 0x30000, 0x3ffff); -} - -static void __fastcall wrally_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffc000) == 0x100000) { - *((UINT16*)(DrvVidRAM + (address & 0x3ffe))) = gaelco_decrypt((address & 0x3ffe)/2, data, 0x1f, 0x522a); - return; - } - - switch (address) - { - case 0x108000: - case 0x108002: - case 0x108004: - case 0x108006: - *((UINT16*)(DrvVRegs + (address & 0x6))) = data; - return; - - case 0x70000a: - case 0x70001a: - coin_lockout[(address >> 3) & 1] = ~data & 1; - return; - - case 0x70002a: - case 0x70003a: - // coin counter - return; - - case 0x70005a: - flipscreen = data & 0x01; - return; - } -} - -static void __fastcall wrally_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x70000d: - oki_bankswitch(data); - return; - - case 0x70000f: - MSM6295Command(0, data); - return; - } - - bprintf (0, _T("Write byte: %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall wrally_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x700000: - return (DrvDips[1] << 8) | (DrvDips[0]); - - case 0x700002: - return DrvInputs[0]; - - case 0x700004: - return 0; // analog - - case 0x700008: - return DrvInputs[1]; - - case 0x70000e: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static UINT8 __fastcall wrally_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x700000: - case 0x700001: - return (DrvDips[(address & 1) ^ 1]); - - case 0x700002: - return DrvInputs[0] >> 8; - - case 0x700003: - return DrvInputs[0]; - - case 0x700004: - case 0x700005: - return 0; // analog - - case 0x700008: - return DrvInputs[1] >> 8; - - case 0x700009: - return DrvInputs[1]; - - case 0x70000e: - case 0x70000f: - return MSM6295ReadStatus(0); - } - - return 0; -} - -static void dallas_sharedram_write(INT32 address, UINT8 data) -{ - if (address >= MCS51_PORT_P0) return; - - DrvShareRAM[(address & 0x3fff) ^ 1] = data; -} - -static UINT8 dallas_sharedram_read(INT32 address) -{ - if (address >= MCS51_PORT_P0) return 0; - - return DrvShareRAM[(address & 0x3fff) ^ 1]; -} - -static tilemap_callback( screen0 ) -{ - UINT16 *ram = (UINT16*)(DrvVidRAM + 0x0000 + offs * 4); - - INT32 flags = TILE_FLIPYX(ram[1] >> 6) | TILE_GROUP((ram[1] >> 5) & 1); - - flags |= DrvTransTab[transparent_select][ram[0]&0x3fff] ? TILE_SKIP : 0; - - TILE_SET_INFO(0, ram[0], ram[1] & 0x1f, flags); -} - -static tilemap_callback( screen1 ) -{ - UINT16 *ram = (UINT16*)(DrvVidRAM + 0x2000 + offs * 4); - - TILE_SET_INFO(0, ram[0], ram[1] & 0x1f, TILE_FLIPYX(ram[1] >> 6) | TILE_GROUP((ram[1] >> 5) & 1)); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - mcs51_reset(); - - MSM6295Reset(0); - - oki_bankswitch(0); - - flipscreen = 0; - coin_lockout[0] = 0; - coin_lockout[1] = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvMCUROM = Next; Next += 0x008000; - - DrvGfxROM = Next; Next += 0x400000; - DrvTransTab[0] = Next; Next += 0x004000; - DrvTransTab[1] = Next; Next += 0x004000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x100000; - - DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - AllRam = Next; - - DrvShareRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x004000; - DrvVidRAM = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x001000; - - DrvVRegs = Next; Next += 0x000008; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { (0x100000*8)+8, (0x100000*8)+0, 8, 0 }; - INT32 XOffs[16] = { STEP8(0,1), STEP8(256,1) }; - INT32 YOffs[16] = { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM, 0x200000); - - GfxDecode(0x4000, 4, 16, 16, Plane, XOffs, YOffs, 0x200, tmp, DrvGfxROM); - - BurnFree (tmp); - - return 0; -} - -static void DrvTransTableInit() -{ - UINT16 mask0 = 0xff01; - UINT16 mask1 = 0x00ff; - - for (INT32 i = 0; i < 0x400000; i+= 16 * 16) - { - DrvTransTab[0][i/(16*16)] = 1; - DrvTransTab[1][i/(16*16)] = 1; - - for (INT32 j = 0; j < 16 * 16; j++) - { - if ((mask0 & (1 << DrvGfxROM[i+j])) == 0) { - DrvTransTab[0][i/(16*16)] = 0; - } - - if ((mask1 & (1 << DrvGfxROM[i+j])) == 0) { - DrvTransTab[1][i/(16*16)] = 0; - } - } - } -} - -static INT32 DrvInit(INT32 load) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvMCUROM + 0x000000, 2, 1)) return 1; - - if (load == 0) // 512kb roms - { - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x000001, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100001, 6, 2)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 7, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x080000, 8, 1)) return 1; - } - else // 1mb roms - { - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 4, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 5, 1)) return 1; - } - - DrvGfxDecode(); - DrvTransTableInit(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0x100000, 0x103fff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x200000, 0x203fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x440000, 0x440fff, MAP_RAM); - SekMapMemory(DrvShareRAM, 0xfec000, 0xfeffff, MAP_RAM); - SekSetWriteWordHandler(0, wrally_main_write_word); - SekSetWriteByteHandler(0, wrally_main_write_byte); - SekSetReadWordHandler(0, wrally_main_read_word); - SekSetReadByteHandler(0, wrally_main_read_byte); - SekClose(); - - mcs51_program_data = DrvMCUROM; - ds5002fp_init(0x88, 0x00, 0x80); - mcs51_set_write_handler(dallas_sharedram_write); - mcs51_set_read_handler(dallas_sharedram_read); - - MSM6295Init(0, 1000000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, screen0_map_callback, 16, 16, 64, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, screen1_map_callback, 16, 16, 64, 32); - GenericTilemapSetGfx(0, DrvGfxROM, 4, 16, 16, 0x400000, 0, 0x1f); - GenericTilemapSetTransparent(1, 0); - GenericTilemapSetOffsets(0, -8, -16); - GenericTilemapSetOffsets(1, -8, -16); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - - SekExit(); - mcs51_exit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x4000/2; i++) - { - UINT16 x = BURN_ENDIAN_SWAP_INT16(p[i]); - - INT32 b = (x >> 8) & 0xf; - INT32 r = (x >> 4) & 0xf; - INT32 g = (x >> 0) & 0xf; - - DrvPalette[i] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); - } -} - -static void draw_sprites(INT32 priority) -{ - UINT16 *m_spriteram = (UINT16*)DrvSprRAM; - - for (INT32 i = 6/2; i < (0x1000 - 6)/2; i += 4) - { - INT32 sx = (m_spriteram[i+2] & 0x03ff) - 8; - INT32 sy = (240 - (m_spriteram[i] & 0x00ff)) & 0x00ff; - INT32 number = m_spriteram[i+3] & 0x3fff; - INT32 color = (m_spriteram[i+2] & 0x7c00) >> 10; - INT32 attr = (m_spriteram[i] & 0xfe00) >> 9; - - INT32 xflip = attr & 0x20; - INT32 yflip = attr & 0x40; - INT32 color_effect = (color & 0x10); - INT32 high_priority = number >= 0x3700; - color &= 0x0f; - - if (high_priority != priority) continue; - - if (flipscreen) { - sy += 248; - } - - sy -= 16; - - if (!color_effect) { - if (yflip) { - if (xflip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, number, sx - 0x0f, sy, color, 4, 0, 0x200, DrvGfxROM); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, number, sx - 0x0f, sy, color, 4, 0, 0x200, DrvGfxROM); - } - } else { - if (xflip) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, number, sx - 0x0f, sy, color, 4, 0, 0x200, DrvGfxROM); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, number, sx - 0x0f, sy, color, 4, 0, 0x200, DrvGfxROM); - } - } - } else { - UINT8 *gfx_src = DrvGfxROM + ((number & 0x3fff) * 16 * 16); - - for (INT32 py = 0; py < 16; py++) - { - INT32 ypos = ((sy + py) & 0x1ff); - UINT16 *srcy = pTransDraw + (ypos * nScreenWidth); - - INT32 gfx_py = yflip ? (16 - 1 - py) : py; - - if ((ypos < 0) || (ypos >= nScreenHeight)) continue; - - for (INT32 px = 0; px < 16; px++) - { - INT32 xpos = (((sx + px) & 0x3ff) - 0x0f) & 0x3ff; - UINT16 *pixel = srcy + xpos; - INT32 src_color = *pixel; - - INT32 gfx_px = xflip ? (16 - 1 - px) : px; - INT32 gfx_pen = gfx_src[16*gfx_py + gfx_px]; - - if ((gfx_pen < 8) || (gfx_pen >= 16)) continue; - if ((xpos < 0) || (xpos >= nScreenWidth)) continue; - - *pixel = src_color + (gfx_pen - 8) * 0x400; - } - } - } - } -} - -static INT32 DrvDraw() -{ -// if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 1; // always update -// } - - UINT16 *vregs = (UINT16*)DrvVRegs; - - if (flipscreen) - { - GenericTilemapSetFlip(TMAP_GLOBAL, TMAP_FLIPXY); - - GenericTilemapSetScrollY(0, 248 - vregs[0]); - GenericTilemapSetScrollX(0, 1024 - vregs[1] - 4); - GenericTilemapSetScrollY(1, 248 - vregs[2]); - GenericTilemapSetScrollX(1, 1024 - vregs[3]); - } - else - { - GenericTilemapSetScrollY(0, vregs[0]); - GenericTilemapSetScrollX(0, vregs[1] + 4); - GenericTilemapSetScrollY(1, vregs[2]); - GenericTilemapSetScrollX(1, vregs[3]); - } - - GenericTilemapDraw(1, pTransDraw, 0 | TMAP_FORCEOPAQUE); - - transparent_select = 0; - GenericTilemapSetTransMask(0, 0xff01); - if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, 0 | TMAP_SET_GROUP(0)); - - transparent_select = 1; - GenericTilemapSetTransMask(0, 0x00ff); - if (nBurnLayer & 2) GenericTilemapDraw(0, pTransDraw, 0 | TMAP_SET_GROUP(0)); - - if (nBurnLayer & 4) GenericTilemapDraw(1, pTransDraw, 0 | TMAP_SET_GROUP(1)); - - transparent_select = 0; - GenericTilemapSetTransMask(0, 0xff01); - if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, 0 | TMAP_SET_GROUP(1)); - - if (nSpriteEnable & 1) draw_sprites(0); - - transparent_select = 1; - GenericTilemapSetTransMask(0, 0x00ff); - if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, 0 | TMAP_SET_GROUP(1)); - - if (nSpriteEnable & 2) draw_sprites(1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - - { - DrvInputs[0] = 0xffef; - DrvInputs[1] = 0xffff; - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - if (coin_lockout[0]) DrvInputs[0] |= (1 << 6); - if (coin_lockout[1]) DrvInputs[0] |= (1 << 7); - } - - INT32 nSegment; - INT32 nInterleave = 640; // mame - INT32 nCyclesTotal[2] = { 12000000 / 60, 12000000 / 12 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nCyclesTotal[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += SekRun(nSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - - nCyclesDone[1] += mcs51Run((SekTotalCycles()/12) - nCyclesDone[1]); - } - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - mcs51_scan(nAction); - - MSM6295Scan(0, nAction); - - SCAN_VAR(flipscreen); - SCAN_VAR(okibank); - } - - if (nAction & ACB_WRITE) { - oki_bankswitch(okibank); - } - - return 0; -} - - -// World Rally (Version 1.0, Checksum 0E56) - -static struct BurnRomInfo wrallyRomDesc[] = { - { "worldr17.c23", 0x80000, 0x050f5629, 1 | BRF_PRG | BRF_ESS }, // 0 m68K code - { "worldr16.c22", 0x80000, 0x9e0d126c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "wrdallas.bin", 0x08000, 0x547d1768, 2 | BRF_PRG | BRF_ESS }, // 2 DS5002FP code - - { "worldr21.i13", 0x80000, 0xb7fddb12, 3 | BRF_GRA }, // 3 Graphics - { "worldr20.i11", 0x80000, 0x58b2809a, 3 | BRF_GRA }, // 4 - { "worldr19.i09", 0x80000, 0x018b35bb, 3 | BRF_GRA }, // 5 - { "worldr18.i07", 0x80000, 0xb37c807e, 3 | BRF_GRA }, // 6 - - { "worldr14.c01", 0x80000, 0xe931c2ee, 4 | BRF_SND }, // 7 OKI Samples - { "worldr15.c03", 0x80000, 0x11f0fe2c, 4 | BRF_SND }, // 8 - - { "tibpal20l8-25cnt.b23", 0x104, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 9 plds - { "gal16v8-25lnc.h21", 0x004, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 10 - { "tibpal20l8-25cnt.h15", 0x104, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 11 - { "pal16r4-e2.bin", 0x104, 0x15fee75c, 5 | BRF_OPT }, // 12 - { "pal16r8-b15.bin", 0x104, 0xb50337a6, 5 | BRF_OPT }, // 13 -}; - -STD_ROM_PICK(wrally) -STD_ROM_FN(wrally) - -static INT32 WrallyInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvWrally = { - "wrally", NULL, NULL, NULL, "1993", - "World Rally (Version 1.0, Checksum 0E56)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, wrallyRomInfo, wrallyRomName, NULL, NULL, WrallyInputInfo, WrallyDIPInfo, - WrallyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 368, 232, 4, 3 -}; - - -// World Rally (Version 1.0, Checksum 3873) - -static struct BurnRomInfo wrallyaRomDesc[] = { - { "c23.bin", 0x80000, 0x8b7d93c3, 1 | BRF_PRG | BRF_ESS }, // 0 m68K code - { "c22.bin", 0x80000, 0x56da43b6, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "wrdallas.bin", 0x08000, 0x547d1768, 2 | BRF_PRG | BRF_ESS }, // 2 DS5002FP code - - { "worldr21.i13", 0x80000, 0xb7fddb12, 3 | BRF_GRA }, // 3 Graphics - { "worldr20.i11", 0x80000, 0x58b2809a, 3 | BRF_GRA }, // 4 - { "worldr19.i09", 0x80000, 0x018b35bb, 3 | BRF_GRA }, // 5 - { "worldr18.i07", 0x80000, 0xb37c807e, 3 | BRF_GRA }, // 6 - - { "worldr14.c01", 0x80000, 0xe931c2ee, 4 | BRF_SND }, // 7 OKI Samples - { "worldr15.c03", 0x80000, 0x11f0fe2c, 4 | BRF_SND }, // 8 - - { "tibpal20l8-25cnt.b23", 0x104, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 9 plds - { "gal16v8-25lnc.h21", 0x004, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 10 - { "tibpal20l8-25cnt.h15", 0x104, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 11 - { "pal16r4-e2.bin", 0x104, 0x15fee75c, 5 | BRF_OPT }, // 12 - { "pal16r8-b15.bin", 0x104, 0xb50337a6, 5 | BRF_OPT }, // 13 -}; - -STD_ROM_PICK(wrallya) -STD_ROM_FN(wrallya) - -struct BurnDriver BurnDrvWrallya = { - "wrallya", "wrally", NULL, NULL, "1993", - "World Rally (Version 1.0, Checksum 3873)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, wrallyaRomInfo, wrallyaRomName, NULL, NULL, WrallyInputInfo, WrallyDIPInfo, - WrallyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 368, 232, 4, 3 -}; - - -// World Rally (Version 1.0, Checksum 8AA2) - -static struct BurnRomInfo wrallybRomDesc[] = { - { "rally_c23.c23", 0x080000, 0xddd6f833, 1 | BRF_PRG | BRF_ESS }, // 0 m68K code - { "rally_c22.c22", 0x080000, 0x59a0d35c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "wrdallas.bin", 0x008000, 0x547d1768, 2 | BRF_PRG | BRF_ESS }, // 2 DS5002FP code - - { "rally h-12.h12", 0x100000, 0x3353dc00, 3 | BRF_GRA }, // 3 Graphics - { "rally h-8.h8", 0x100000, 0x58dcd024, 3 | BRF_GRA }, // 4 - - { "sound c-1.c1", 0x100000, 0x2d69c9b8, 4 | BRF_SND }, // 5 OKI Samples - - { "tibpal20l8-25cnt.b23", 0x104, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 6 plds - { "gal16v8-25lnc.h21", 0x004, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 7 - { "tibpal20l8-25cnt.h15", 0x104, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 8 - { "pal16r4-e2.bin", 0x104, 0x15fee75c, 5 | BRF_OPT }, // 9 - { "pal16r8-b15.bin", 0x104, 0xb50337a6, 5 | BRF_OPT }, // 10 -}; - -STD_ROM_PICK(wrallyb) -STD_ROM_FN(wrallyb) - -static INT32 WrallybInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvWrallyb = { - "wrallyb", "wrally", NULL, NULL, "1993", - "World Rally (Version 1.0, Checksum 8AA2)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, wrallybRomInfo, wrallybRomName, NULL, NULL, WrallyInputInfo, WrallyDIPInfo, - WrallybInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 368, 232, 4, 3 -}; - - -// World Rally (US, 930217) - -static struct BurnRomInfo wrallyatRomDesc[] = { - { "rally.c23", 0x080000, 0x366595ad, 1 | BRF_PRG | BRF_ESS }, // 0 m68K code - { "rally.c22", 0x080000, 0x0ad4ec6f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "wrdallas.bin", 0x008000, 0x547d1768, 2 | BRF_PRG | BRF_ESS }, // 2 DS5002FP code - - { "rally h-12.h12", 0x100000, 0x3353dc00, 3 | BRF_GRA }, // 3 Graphics - { "rally h-8.h8", 0x100000, 0x58dcd024, 3 | BRF_GRA }, // 4 - - { "sound c-1.c1", 0x100000, 0x2d69c9b8, 4 | BRF_SND }, // 5 OKI Samples - - { "tibpal20l8-25cnt.b23", 0x104, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 6 plds - { "gal16v8-25lnc.h21", 0x004, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 7 - { "tibpal20l8-25cnt.h15", 0x104, 0x00000000, 5 | BRF_NODUMP | BRF_OPT }, // 8 - { "pal16r4-e2.bin", 0x104, 0x15fee75c, 5 | BRF_OPT }, // 9 - { "pal16r8-b15.bin", 0x104, 0xb50337a6, 5 | BRF_OPT }, // 10 -}; - -STD_ROM_PICK(wrallyat) -STD_ROM_FN(wrallyat) - -struct BurnDriver BurnDrvWrallyat = { - "wrallyat", "wrally", NULL, NULL, "1993", - "World Rally (US, 930217)\0", NULL, "Gaelco (Atari license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RACING, 0, - NULL, wrallyatRomInfo, wrallyatRomName, NULL, NULL, WrallyInputInfo, WrallyDIPInfo, - WrallybInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 368, 232, 4, 3 -}; - diff --git a/jan/src/burn/drv/pst90s/d_wwfwfest.cpp b/jan/src/burn/drv/pst90s/d_wwfwfest.cpp deleted file mode 100644 index 72d1de5da..000000000 --- a/jan/src/burn/drv/pst90s/d_wwfwfest.cpp +++ /dev/null @@ -1,1247 +0,0 @@ -// FB Alpha WWF WrestleFest (Double Dragon 3 driver) driver module -// based on MAME driver by Bryan McPhail, David Haywood - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "msm6295.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort4[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[5] = {0, 0, 0, 0, 0}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *Drv68KRom = NULL; -static UINT8 *Drv68KRam = NULL; -static UINT8 *DrvZ80Rom = NULL; -static UINT8 *DrvZ80Ram = NULL; -static UINT8 *DrvMSM6295ROMSrc = NULL; -static UINT8 *DrvCharVideoRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvSpriteRamBuff = NULL; -static UINT8 *DrvBg0VideoRam = NULL; -static UINT8 *DrvBg1VideoRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvChars = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvSprites = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvVBlank; -static UINT8 DrvOkiBank; -static UINT8 DrvSoundLatch; -static UINT16 DrvBg0ScrollX; -static UINT16 DrvBg0ScrollY; -static UINT16 DrvBg1ScrollX; -static UINT16 DrvBg1ScrollY; -static UINT16 DrvVReg; - -static INT32 DrvSpriteXOffset; -static INT32 DrvBg0XOffset; -static INT32 DrvBg1XOffset[2]; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; - -static struct BurnInputInfo DrvInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort4 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" }, - {"Start 3" , BIT_DIGITAL , DrvInputPort2 + 7, "p3 start" }, - {"Start 4" , BIT_DIGITAL , DrvInputPort3 + 7, "p4 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" }, - - {"P3 Up" , BIT_DIGITAL , DrvInputPort2 + 2, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , DrvInputPort2 + 3, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , DrvInputPort2 + 1, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , DrvInputPort2 + 0, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 5, "p3 fire 2" }, - - {"P4 Up" , BIT_DIGITAL , DrvInputPort3 + 2, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , DrvInputPort3 + 3, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , DrvInputPort3 + 1, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , DrvInputPort3 + 0, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , DrvInputPort3 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , DrvInputPort3 + 5, "p4 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort4 + 1, "service" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Drv) - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = DrvInput[3] = DrvInput[4] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvInputPort0[i] & 1) << i; - DrvInput[1] |= (DrvInputPort1[i] & 1) << i; - DrvInput[2] |= (DrvInputPort2[i] & 1) << i; - DrvInput[3] |= (DrvInputPort3[i] & 1) << i; - DrvInput[4] |= (DrvInputPort4[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[1]); - DrvClearOpposites(&DrvInput[2]); - DrvClearOpposites(&DrvInput[3]); -} - -static struct BurnDIPInfo DrvDIPList[]= -{ - // Default Values - {0x1f, 0xff, 0xff, 0xef, NULL }, - {0x20, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x1f, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x1f, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x1f, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x1f, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Buy In Price" }, - {0x1f, 0x01, 0x04, 0x04, "1 Coin" }, - {0x1f, 0x01, 0x04, 0x00, "As Start Price" }, - - {0 , 0xfe, 0 , 2 , "Regain Power Price" }, - {0x1f, 0x01, 0x08, 0x08, "1 Coin" }, - {0x1f, 0x01, 0x08, 0x00, "As Start Price" }, - - {0 , 0xfe, 0 , 2 , "Continue Price" }, - {0x1f, 0x01, 0x10, 0x10, "1 Coin" }, - {0x1f, 0x01, 0x10, 0x00, "As Start Price" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1f, 0x01, 0x20, 0x00, "Off" }, - {0x1f, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x1f, 0x01, 0x40, 0x40, "Off" }, - {0x1f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "FBI Logo" }, - {0x1f, 0x01, 0x80, 0x00, "Off" }, - {0x1f, 0x01, 0x80, 0x80, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x20, 0x01, 0x03, 0x02, "Easy" }, - {0x20, 0x01, 0x03, 0x03, "Normal" }, - {0x20, 0x01, 0x03, 0x01, "Hard" }, - {0x20, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 3 , "Number of Players" }, - {0x20, 0x01, 0x0c, 0x04, "2" }, - {0x20, 0x01, 0x0c, 0x08, "3" }, - {0x20, 0x01, 0x0c, 0x0c, "4" }, - - {0 , 0xfe, 0 , 4 , "Clear Stage Power Up" }, - {0x20, 0x01, 0x60, 0x00, "0" }, - {0x20, 0x01, 0x60, 0x20, "12" }, - {0x20, 0x01, 0x60, 0x60, "24" }, - {0x20, 0x01, 0x60, 0x40, "32" }, - - {0 , 0xfe, 0 , 2 , "Championship Game" }, - {0x20, 0x01, 0x80, 0x00, "4th" }, - {0x20, 0x01, 0x80, 0x80, "5th" }, -}; - -STDDIPINFO(Drv) - -static struct BurnRomInfo DrvRomDesc[] = { - /* Euro label but shows FBI "Winners Don't Do drugs" logo */ - { "31e13-0.ic19", 0x040000, 0xbd02e3c4, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "31e14-0.ic18", 0x040000, 0x933ea1a0, BRF_ESS | BRF_PRG }, // 1 - - { "31a11-2.ic42", 0x010000, 0x5ddebfea, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "31e12-0.ic33", 0x020000, 0x06f22615, BRF_GRA }, // 3 Chars - - { "31j0.ic1", 0x040000, 0x8a12b450, BRF_GRA }, // 4 Tiles - { "31j1.ic2", 0x040000, 0x82ed7155, BRF_GRA }, // 5 - - { "31j3.ic9", 0x100000, 0xe395cf1d, BRF_GRA }, // 6 Sprites - { "31j2.ic8", 0x100000, 0xb5a97465, BRF_GRA }, // 7 - { "31j5.ic11", 0x100000, 0x2ce545e8, BRF_GRA }, // 8 - { "31j4.ic10", 0x100000, 0x00edb66a, BRF_GRA }, // 9 - { "31j6.ic12", 0x100000, 0x79956cf8, BRF_GRA }, // 10 - { "31j7.ic13", 0x100000, 0x74d774c3, BRF_GRA }, // 11 - { "31j9.ic15", 0x100000, 0xdd387289, BRF_GRA }, // 12 - { "31j8.ic14", 0x100000, 0x44abe127, BRF_GRA }, // 13 - - { "31j10.ic73", 0x080000, 0x6c522edb, BRF_SND }, // 14 Samples -}; - -STD_ROM_PICK(Drv) -STD_ROM_FN(Drv) - -static struct BurnRomInfo DrvuRomDesc[] = { - { "31a13-2.ic19", 0x040000, 0x7175bca7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "31a14-2.ic18", 0x040000, 0x5d06bfd1, BRF_ESS | BRF_PRG }, // 1 - - { "31a11-2.ic42", 0x010000, 0x5ddebfea, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "31a12-0.ic33", 0x020000, 0xd0803e20, BRF_GRA }, // 3 Chars - - { "31j0.ic1", 0x040000, 0x8a12b450, BRF_GRA }, // 4 Tiles - { "31j1.ic2", 0x040000, 0x82ed7155, BRF_GRA }, // 5 - - { "31j3.ic9", 0x100000, 0xe395cf1d, BRF_GRA }, // 6 Sprites - { "31j2.ic8", 0x100000, 0xb5a97465, BRF_GRA }, // 7 - { "31j5.ic11", 0x100000, 0x2ce545e8, BRF_GRA }, // 8 - { "31j4.ic10", 0x100000, 0x00edb66a, BRF_GRA }, // 9 - { "31j6.ic12", 0x100000, 0x79956cf8, BRF_GRA }, // 10 - { "31j7.ic13", 0x100000, 0x74d774c3, BRF_GRA }, // 11 - { "31j9.ic15", 0x100000, 0xdd387289, BRF_GRA }, // 12 - { "31j8.ic14", 0x100000, 0x44abe127, BRF_GRA }, // 13 - - { "31j10.ic73", 0x080000, 0x6c522edb, BRF_SND }, // 14 Samples -}; - -STD_ROM_PICK(Drvu) -STD_ROM_FN(Drvu) - -static struct BurnRomInfo DrvbRomDesc[] = { - { "2", 0x040000, 0x632bb3a4, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "3", 0x040000, 0xea73369c, BRF_ESS | BRF_PRG }, // 1 - - { "1", 0x010000, 0xd9e8cda2, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "4", 0x020000, 0x520ef575, BRF_GRA }, // 3 Chars - - { "5", 0x020000, 0x35e4d6eb, BRF_GRA }, // 4 Tiles - { "6", 0x020000, 0xa054a5b2, BRF_GRA }, // 5 - { "7", 0x020000, 0x101f0136, BRF_GRA }, // 6 - { "8", 0x020000, 0x7b2ecba7, BRF_GRA }, // 7 - - { "wf_09.rom", 0x100000, 0xe395cf1d, BRF_GRA }, // 8 Sprites - { "wf_08.rom", 0x100000, 0xb5a97465, BRF_GRA }, // 9 - { "wf_11.rom", 0x100000, 0x2ce545e8, BRF_GRA }, // 10 - { "wf_10.rom", 0x100000, 0x00edb66a, BRF_GRA }, // 11 - { "wf_12.rom", 0x100000, 0x79956cf8, BRF_GRA }, // 12 - { "wf_13.rom", 0x100000, 0x74d774c3, BRF_GRA }, // 13 - { "wf_15.rom", 0x100000, 0xdd387289, BRF_GRA }, // 14 - { "wf_14.rom", 0x100000, 0x44abe127, BRF_GRA }, // 15 - - { "wf_73a.rom", 0x080000, 0x6c522edb, BRF_SND }, // 16 Samples -}; - -STD_ROM_PICK(Drvb) -STD_ROM_FN(Drvb) - -static struct BurnRomInfo DrvjRomDesc[] = { - { "31j13-0.ic19", 0x040000, 0x2147780d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "31j14-0.ic18", 0x040000, 0xd76fc747, BRF_ESS | BRF_PRG }, // 1 - - { "31a11-2.ic42", 0x010000, 0x5ddebfea, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "31j12-0.ic33", 0x020000, 0xf4821fe0, BRF_GRA }, // 3 Chars - - { "31j0.ic1", 0x040000, 0x8a12b450, BRF_GRA }, // 4 Tiles - { "31j1.ic2", 0x040000, 0x82ed7155, BRF_GRA }, // 5 - - { "31j3.ic9", 0x100000, 0xe395cf1d, BRF_GRA }, // 6 Sprites - { "31j2.ic8", 0x100000, 0xb5a97465, BRF_GRA }, // 7 - { "31j5.ic11", 0x100000, 0x2ce545e8, BRF_GRA }, // 8 - { "31j4.ic10", 0x100000, 0x00edb66a, BRF_GRA }, // 9 - { "31j6.ic12", 0x100000, 0x79956cf8, BRF_GRA }, // 10 - { "31j7.ic13", 0x100000, 0x74d774c3, BRF_GRA }, // 11 - { "31j9.ic15", 0x100000, 0xdd387289, BRF_GRA }, // 12 - { "31j8.ic14", 0x100000, 0x44abe127, BRF_GRA }, // 13 - - { "31j10.ic73", 0x080000, 0x6c522edb, BRF_SND }, // 14 Samples -}; - -STD_ROM_PICK(Drvj) -STD_ROM_FN(Drvj) - -static struct BurnRomInfo DrvkRomDesc[] = { - /* same program roms labels as the World set */ - { "31e13-0.ic19", 0x040000, 0x774a26a7, BRF_ESS | BRF_PRG }, // 0 68000 Program Code - { "31e14-0.ic18", 0x040000, 0x05bbb807, BRF_ESS | BRF_PRG }, // 1 - - { "31a11-2.ic42", 0x010000, 0x5ddebfea, BRF_ESS | BRF_PRG }, // 2 Z80 Program - - { "31e12-0.ic33", 0x020000, 0x06f22615, BRF_GRA }, // 3 Chars - - { "31j0.ic1", 0x040000, 0x8a12b450, BRF_GRA }, // 4 Tiles - { "31j1.ic2", 0x040000, 0x82ed7155, BRF_GRA }, // 5 - - { "31j3.ic9", 0x100000, 0xe395cf1d, BRF_GRA }, // 6 Sprites - { "31j2.ic8", 0x100000, 0xb5a97465, BRF_GRA }, // 7 - { "31j5.ic11", 0x100000, 0x2ce545e8, BRF_GRA }, // 8 - { "31j4.ic10", 0x100000, 0x00edb66a, BRF_GRA }, // 9 - { "31j6.ic12", 0x100000, 0x79956cf8, BRF_GRA }, // 10 - { "31j7.ic13", 0x100000, 0x74d774c3, BRF_GRA }, // 11 - { "31j9.ic15", 0x100000, 0xdd387289, BRF_GRA }, // 12 - { "31j8.ic14", 0x100000, 0x44abe127, BRF_GRA }, // 13 - - { "31j10.ic73", 0x080000, 0x6c522edb, BRF_SND }, // 14 Samples -}; - -STD_ROM_PICK(Drvk) -STD_ROM_FN(Drvk) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - Drv68KRom = Next; Next += 0x80000; - DrvZ80Rom = Next; Next += 0x10000; - MSM6295ROM = Next; Next += 0x40000; - DrvMSM6295ROMSrc = Next; Next += 0x80000; - - RamStart = Next; - - Drv68KRam = Next; Next += 0x04000; - DrvZ80Ram = Next; Next += 0x00800; - DrvCharVideoRam = Next; Next += 0x02000; - DrvSpriteRam = Next; Next += 0x02000; - DrvSpriteRamBuff = Next; Next += 0x02000; - DrvBg0VideoRam = Next; Next += 0x01000; - DrvBg1VideoRam = Next; Next += 0x01000; - DrvPaletteRam = Next; Next += 0x04000; - - RamEnd = Next; - - DrvChars = Next; Next += 0x01000 * 8 * 8; - DrvTiles = Next; Next += 0x01000 * 16 * 16; - DrvSprites = Next; Next += 0x10000 * 16 * 16; - DrvPalette = (UINT32*)Next; Next += 0x02000 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - - DrvVBlank = 0; - DrvBg0ScrollX = 0; - DrvBg0ScrollY = 0; - DrvBg1ScrollX = 0; - DrvBg1ScrollY = 0; - DrvVReg = 0; - DrvOkiBank = 0; - DrvSoundLatch = 0; - - return 0; -} - -UINT8 __fastcall Wwfwfest68KReadByte(UINT32 a) -{ - switch (a) { - case 0x140020: { - return (0xcf - DrvInput[4]) | ((DrvDip[1] & 0xc0) >> 2); - } - - case 0x140021: { - return 0xff - DrvInput[0]; - } - - case 0x140023: { - return 0xff - DrvInput[1]; - } - - case 0x140025: { - return 0xff - DrvInput[2]; - } - - case 0x140026: { - UINT8 Temp = 0xfc; - if (DrvVBlank) Temp = 0xfb; - Temp |= (DrvDip[0] & 0xc0) >> 6; - return Temp; - } - - case 0x140027: { - return 0xff - DrvInput[3]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Wwfwfest68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x0c0000 && a <= 0x0c1fff) { - UINT16 *CharRam = (UINT16*)DrvCharVideoRam; - CharRam[(a - 0x0c0000) >> 1] = d; - return; - } - - switch (a) { - case 0x140011: { - DrvVReg = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Wwfwfest68KReadWord(UINT32 a) -{ - if (a >= 0x180000 && a <= 0x18ffff) { - UINT16 *PaletteRam = (UINT16*)DrvPaletteRam; - INT32 Offset = (a - 0x180000) >> 1; - Offset = (Offset & 0x0f) | (Offset & 0x7fc0) >> 2; - return PaletteRam[Offset]; - } - - switch (a) { - case 0x140020: { - UINT16 Temp = (0xff - DrvInput[0]) | ((0xff - DrvInput[4]) << 8); - Temp &= 0xcfff; - Temp |= ((DrvDip[1] & 0xc0) << 6); - return Temp; - } - - case 0x140022: { - UINT16 Temp = 0xff - DrvInput[1]; - Temp |= ((DrvDip[1] & 0x3f) << 8); - return Temp; - } - - case 0x140024: { - UINT16 Temp = 0xff - DrvInput[2]; - Temp |= ((DrvDip[0] & 0x3f) << 8); - return Temp; - } - - case 0x140026: { - UINT16 Temp = 0xff - DrvInput[3]; - if (DrvVBlank) { - Temp |= (0xfb << 8); - } else { - Temp |= (0xff << 8); - } - Temp &= 0xfcff; - Temp |= ((DrvDip[0] & 0xc0) << 2); - return Temp; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Wwfwfest68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x0c0000 && a <= 0x0c1fff) { - UINT16 *CharRam = (UINT16*)DrvCharVideoRam; - CharRam[(a - 0x0c0000) >> 1] = d; - return; - } - - if (a >= 0x180000 && a <= 0x18ffff) { - UINT16 *PaletteRam = (UINT16*)DrvPaletteRam; - INT32 Offset = (a - 0x180000) >> 1; - Offset = (Offset & 0x0f) | (Offset & 0x7fc0) >> 2; - PaletteRam[Offset] = d; - return; - } - - if (a >= 0x120000 && a <= 0x121fff) { - return; - } - - switch (a) { - case 0x100000: { - DrvBg0ScrollX = d & 0x1ff; - return; - } - - case 0x100002: { - DrvBg0ScrollY = d & 0x1ff; - return; - } - - case 0x100004: { - DrvBg1ScrollX = d & 0x1ff; - return; - } - - case 0x100006: { - DrvBg1ScrollY = d & 0x1ff; - return; - } - - case 0x140010: { - DrvVReg = d; - return; - } - - case 0x14000c: { - DrvSoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - nCyclesDone[1] += ZetRun(100); - ZetClose(); - return; - } - - case 0x100008: { - // ??? - return; - } - - case 0x10000c: { - // ??? - return; - } - - case 0x140000: - case 0x140002: { - // NOP - return; - } - - case 0x140006: - case 0x140008: - case 0x140012: - case 0x140014: - case 0x140016: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall WwfwfestZ80Read(UINT16 a) -{ - switch (a) { - case 0xc801: { - return BurnYM2151ReadStatus(); - } - - case 0xd800: { - return MSM6295ReadStatus(0); - } - - case 0xe000: { - return DrvSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall WwfwfestZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xc800: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xc801: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xd800: { - MSM6295Command(0, d); - return; - } - - case 0xe800: { - DrvOkiBank = d & 1; - memcpy(MSM6295ROM + 0x00000, DrvMSM6295ROMSrc + (0x40000 * DrvOkiBank), 0x40000); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[4] = { 0, 2, 4, 6 }; -static INT32 CharXOffsets[8] = { 1, 0, 65, 64, 129, 128, 193, 192 }; -static INT32 CharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 TilePlaneOffsets[4] = { 8, 0, 0x200008, 0x200000 }; -static INT32 TileXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 256, 257, 258, 259, 260, 261, 262, 263 }; -static INT32 TileYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 }; -static INT32 SpritePlaneOffsets[4] = { 0, 0x1000000, 0x2000000, 0x3000000 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 SpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; - -static void DrvYM2151IrqHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvInit() -{ - INT32 nRet = 0, nLen, RomOffset; - - RomOffset = 0; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "wwfwfestb")) RomOffset = 2; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - DrvTempRom = (UINT8 *)BurnMalloc(0x800000); - - // Load 68000 Program Roms - nRet = BurnLoadRom(Drv68KRom + 0x00000, 0, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(Drv68KRom + 0x00001, 1, 2); if (nRet != 0) return 1; - - // Load Z80 Program Roms - nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1; - - // Load and decode the chars - nRet = BurnLoadRom(DrvTempRom + 0x000000, 3, 1); if (nRet != 0) return 1; - GfxDecode(0x1000, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x100, DrvTempRom, DrvChars); - - // Load and decode the tiles - memset(DrvTempRom, 0, 0x800000); - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "wwfwfestb")) { - nRet = BurnLoadRom(DrvTempRom + 0x040000, 4, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x040001, 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1; - } else { - nRet = BurnLoadRom(DrvTempRom + 0x040000, 4, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 1); if (nRet != 0) return 1; - } - GfxDecode(0x1000, 4, 16, 16, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x200, DrvTempRom, DrvTiles); - - // Load and decode the sprites - memset(DrvTempRom, 0, 0x800000); - nRet = BurnLoadRom(DrvTempRom + 0x000000, 6 + RomOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x100000, 7 + RomOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x200000, 8 + RomOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x300000, 9 + RomOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x400000, 10 + RomOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x500000, 11 + RomOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x600000, 12 + RomOffset, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x700000, 13 + RomOffset, 1); if (nRet != 0) return 1; - GfxDecode(0x10000, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x100, DrvTempRom, DrvSprites); - - // Load Sample Roms - nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 14 + RomOffset, 1); if (nRet != 0) return 1; - memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000); - - BurnFree(DrvTempRom); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvBg0VideoRam , 0x080000, 0x080fff, MAP_RAM); - SekMapMemory(DrvBg1VideoRam , 0x082000, 0x082fff, MAP_RAM); - SekMapMemory(DrvCharVideoRam , 0x0c0000, 0x0c1fff, MAP_ROM); - SekMapMemory(DrvSpriteRam , 0x0c2000, 0x0c3fff, MAP_RAM); - SekMapMemory(Drv68KRam , 0x1c0000, 0x1c3fff, MAP_RAM); - SekSetReadWordHandler(0, Wwfwfest68KReadWord); - SekSetWriteWordHandler(0, Wwfwfest68KWriteWord); - SekSetReadByteHandler(0, Wwfwfest68KReadByte); - SekSetWriteByteHandler(0, Wwfwfest68KWriteByte); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(WwfwfestZ80Read); - ZetSetWriteHandler(WwfwfestZ80Write); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80Rom ); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Rom ); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80Ram ); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80Ram ); - ZetClose(); - - // Setup the YM2151 emulation - BurnYM2151Init(3579545); - BurnYM2151SetIrqHandler(&DrvYM2151IrqHandler); - BurnYM2151SetAllRoutes(0.45, BURN_SND_ROUTE_BOTH); - - // Setup the OKIM6295 emulation - MSM6295Init(0, 1024188 / 132, 1); - MSM6295SetRoute(0, 0.90, BURN_SND_ROUTE_BOTH); - - DrvSpriteXOffset = 0; - DrvBg0XOffset = 0; - DrvBg1XOffset[0] = 0; - DrvBg1XOffset[1] = 0; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "wwfwfestb")) { - DrvSpriteXOffset = 2; - DrvBg0XOffset = -4; - DrvBg1XOffset[0] = -4; - DrvBg1XOffset[1] = -2; - } - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - ZetExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - - GenericTilesExit(); - - DrvVBlank = 0; - DrvBg0ScrollX = 0; - DrvBg0ScrollY = 0; - DrvBg1ScrollX = 0; - DrvBg1ScrollY = 0; - DrvVReg = 0; - DrvOkiBank = 0; - DrvSoundLatch = 0; - - DrvSpriteXOffset = 0; - DrvBg0XOffset = 0; - DrvBg1XOffset[0] = 0; - DrvBg1XOffset[1] = 0; - - BurnFree(Mem); - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 0); - g = pal4bit(nColour >> 4); - b = pal4bit(nColour >> 8); - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)DrvPaletteRam, pd = DrvPalette; i < 0x2000; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void DrvRenderBg0Layer(INT32 Opaque) -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0, xScroll, yScroll, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)DrvBg0VideoRam; - UINT16 *TileBase; - - if (DrvVReg == 0x78) { - xScroll = DrvBg0ScrollX + DrvBg0XOffset; - yScroll = DrvBg0ScrollY; - } else { - xScroll = DrvBg1ScrollX + DrvBg0XOffset; - yScroll = DrvBg1ScrollY; - } - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - TileBase = &VideoRam[TileIndex * 2]; - Code = TileBase[1] & 0xfff; - Colour = TileBase[0] & 0x0f; - Flip = (TileBase[0] & 0xc0) >> 6; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 16 * mx; - y = 16 * my; - - x -= xScroll; - y -= yScroll; - if (x < -16) x += 512; - if (y < -16) y += 512; - - y -= 8; - - if (Opaque) { - if (x > 16 && x < 304 && y > 16 && y < 224) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0x1000, DrvTiles); - } else { - Render16x16Tile_FlipX(pTransDraw, Code, x, y, Colour, 4, 0x1000, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY(pTransDraw, Code, x, y, Colour, 4, 0x1000, DrvTiles); - } else { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 0x1000, DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0x1000, DrvTiles); - } else { - Render16x16Tile_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0x1000, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0x1000, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0x1000, DrvTiles); - } - } - } - } else { - if (x > 16 && x < 304 && y > 16 && y < 224) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0x1000, DrvTiles); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0x1000, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0x1000, DrvTiles); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0x1000, DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0x1000, DrvTiles); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0x1000, DrvTiles); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0x1000, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0x1000, DrvTiles); - } - } - } - } - - TileIndex++; - } - } -} - -static void DrvRenderBg1Layer(INT32 Opaque) -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0, xScroll, yScroll; - - UINT16 *VideoRam = (UINT16*)DrvBg1VideoRam; - UINT16 *TileBase; - - if (DrvVReg == 0x78) { - xScroll = DrvBg1ScrollX + DrvBg1XOffset[0]; - yScroll = DrvBg1ScrollY; - } else { - xScroll = DrvBg0ScrollX + DrvBg1XOffset[1]; - yScroll = DrvBg0ScrollY; - } - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 32; mx++) { - TileBase = &VideoRam[TileIndex]; - Code = TileBase[0] & 0xfff; - Colour = (TileBase[0] & 0xf000) >> 12; - - x = 16 * mx; - y = 16 * my; - - x -= xScroll; - y -= yScroll; - if (x < -16) x += 512; - if (y < -16) y += 512; - - y -= 8; - - if (Opaque) { - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 0x0c00, DrvTiles); - } else { - Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0c00, DrvTiles); - } - } else { - if (x > 0 && x < 304 && y > 0 && y < 224) { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0x0c00, DrvTiles); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0x0c00, DrvTiles); - } - } - - TileIndex++; - } - } -} - -static void DrvRenderSprites() -{ - UINT16 *Source = (UINT16*)DrvSpriteRamBuff; - UINT16 *Finish = (UINT16*)DrvSpriteRamBuff + 0x1000; - - while (Source < Finish) { - INT32 x, y, Colour, xFlip, yFlip, Chain, Enable, Code, Count; - - Enable = Source[1] & 1; - - if (Enable) { - x = +(Source[5] & 0x00ff) | (Source[1] & 0x0004) << 6; - if (x > 512 - 16) x -= 512; - x += DrvSpriteXOffset; - y = (Source[0] & 0x00ff) | (Source[1] & 0x0002) << 7; - y = (256 - y) & 0x1ff; - y -= 16; - y -= 8; - xFlip = (Source[1] & 0x0010) >> 4; - yFlip = (Source[1] & 0x0008) >> 3; - Chain = (Source[1] & 0x00e0) >> 5; - Chain += 1; - Code = (Source[2] & 0x00ff) | (Source[3] & 0x00ff) << 8; - Colour = (Source[4] & 0x000f); - - for (Count = 0; Count < Chain; Count++) { - INT32 yPos; - yPos = y - 16 * Count; - if (yFlip) yPos = y - (16 * (Chain - 1)) + (16 * Count); - - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code + Count, x, yPos, Colour, 4, 0, 0x400, DrvSprites); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code + Count, x, yPos, Colour, 4, 0, 0x400, DrvSprites); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code + Count, x, yPos, Colour, 4, 0, 0x400, DrvSprites); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code + Count, x, yPos, Colour, 4, 0, 0x400, DrvSprites); - } - } - } - } - - Source += 8; - } -} - -static void DrvRenderCharLayer() -{ - INT32 mx, my, Code, Colour, x, y, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)DrvCharVideoRam; - UINT16 *TileBase; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - TileBase = &VideoRam[TileIndex * 2]; - Code = (TileBase[0] & 0xff) | ((TileBase[1] & 0x0f) << 8); - Colour = (TileBase[1] & 0xf0) >> 4; - - x = 8 * mx; - y = 8 * my; - - y -= 8; - - if (x > 0 && x < 312 && y > 0 && y < 232) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, DrvChars); - } - - TileIndex++; - } - } -} - -static void DrvDraw() -{ - BurnTransferClear(); - DrvCalcPalette(); - - if (DrvVReg == 0x7b) { - DrvRenderBg0Layer(1); - DrvRenderBg1Layer(0); - DrvRenderSprites(); - DrvRenderCharLayer(); - } - - if (DrvVReg == 0x7c) { - DrvRenderBg0Layer(1); - DrvRenderSprites(); - DrvRenderBg1Layer(0); - DrvRenderCharLayer(); - } - - if (DrvVReg == 0x78) { - DrvRenderBg1Layer(1); - DrvRenderBg0Layer(0); - DrvRenderSprites(); - DrvRenderCharLayer(); - } - - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal[0] = (24000000 / 2) / 60; - nCyclesTotal[1] = 3579545 / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - DrvVBlank = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 5) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == 5) DrvVBlank = 1; - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekOpen(0); - SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) DrvDraw(); - - memcpy(DrvSpriteRamBuff, DrvSpriteRam, 0x2000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029674; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); // Scan Z80 - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - // Scan critical driver variables - SCAN_VAR(nCyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(DrvDip); - SCAN_VAR(DrvInput); - SCAN_VAR(DrvVBlank); - SCAN_VAR(DrvOkiBank); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(DrvBg0ScrollX); - SCAN_VAR(DrvBg0ScrollY); - SCAN_VAR(DrvBg1ScrollX); - SCAN_VAR(DrvBg1ScrollY); - SCAN_VAR(DrvVReg); - } - - if (nAction & ACB_WRITE) { - memcpy(MSM6295ROM + 0x00000, DrvMSM6295ROMSrc + (0x40000 * DrvOkiBank), 0x40000); - } - - return 0; -} - -struct BurnDriver BurnDrvWwfwfest = { - "wwfwfest", NULL, NULL, NULL, "1991", - "WWF WrestleFest (World)\0", NULL, "Technos Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, DrvRomInfo, DrvRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWwfwfestu = { - "wwfwfestu", "wwfwfest", NULL, NULL, "1991", - "WWF WrestleFest (US)\0", NULL, "Technos Japan (Tecmo License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, DrvuRomInfo, DrvuRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWwfwfestb = { - "wwfwfestb", "wwfwfest", NULL, NULL, "1991", - "WWF WrestleFest (US bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, DrvbRomInfo, DrvbRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWwfwfestj = { - "wwfwfestj", "wwfwfest", NULL, NULL, "1991", - "WWF WrestleFest (Japan)\0", NULL, "Technos Japan (Tecmo License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, DrvjRomInfo, DrvjRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWwfwfestk = { - "wwfwfestk", "wwfwfest", NULL, NULL, "1991", - "WWF WrestleFest (Korea)\0", NULL, "Technos Japan (Tecmo License)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_TECHNOS, GBF_VSFIGHT, 0, - NULL, DrvkRomInfo, DrvkRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, NULL, DrvScan, - NULL, 0x2000, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_xorworld.cpp b/jan/src/burn/drv/pst90s/d_xorworld.cpp deleted file mode 100644 index 7ce0c8623..000000000 --- a/jan/src/burn/drv/pst90s/d_xorworld.cpp +++ /dev/null @@ -1,437 +0,0 @@ -// FB Alpha Xor World driver module -// Based on MAME driver by Manuel Abadia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "saa1099.h" -#include "eeprom.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; -static UINT8 DrvInputs[2]; - -static struct BurnInputInfo XorworldInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Xorworld) - -static struct BurnDIPInfo XorworldDIPList[]= -{ - {0x11, 0xff, 0xff, 0xc7, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0x07, 0x00, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x01, "2 Coins 2 Credits" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x60, 0x40, "Easy" }, - {0x11, 0x01, 0x60, 0x60, "Normal" }, - {0x11, 0x01, 0x60, 0x20, "Hard" }, - {0x11, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Xorworld) - -void __fastcall xorworld_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x800001: - saa1099DataWrite(0, data); - return; - - case 0x800003: - saa1099ControlWrite(0, data); - return; - - case 0xa00009: - EEPROMSetCSLine((data & 0x01) ? EEPROM_CLEAR_LINE : EEPROM_ASSERT_LINE); - return; - - case 0xa0000b: - EEPROMSetClockLine((data & 0x01) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE); - return; - - case 0xa0000d: - EEPROMWriteBit((data & 0x01)); - return; - } -} - -UINT8 __fastcall xorworld_read_byte(UINT32 address) -{ - switch (address) - { - case 0x200001: - return DrvInputs[0]; - - case 0x400000: - return DrvInputs[1]; - - case 0x600001: - return (DrvDips[0] & ~0x10) | (EEPROMRead() ? 0x10 : 0); - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - EEPROMReset(); - - saa1099Reset(0); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x020000; - - DrvGfxROM = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvSprRAM = Next; Next += 0x003800; - DrvVidRAM = Next; Next += 0x000800; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) { - INT32 r,g,b; - - r = ((DrvColPROM[i + 0x000] >> 0) & 0x01) * 0x0e; - r += ((DrvColPROM[i + 0x000] >> 1) & 0x01) * 0x1e; - r += ((DrvColPROM[i + 0x000] >> 2) & 0x01) * 0x44; - r += ((DrvColPROM[i + 0x000] >> 3) & 0x01) * 0x8f; - - g = ((DrvColPROM[i + 0x100] >> 0) & 0x01) * 0x0e; - g += ((DrvColPROM[i + 0x100] >> 1) & 0x01) * 0x1e; - g += ((DrvColPROM[i + 0x100] >> 2) & 0x01) * 0x44; - g += ((DrvColPROM[i + 0x100] >> 3) & 0x01) * 0x8f; - - b = ((DrvColPROM[i + 0x200] >> 0) & 0x01) * 0x0e; - b += ((DrvColPROM[i + 0x200] >> 1) & 0x01) * 0x1e; - b += ((DrvColPROM[i + 0x200] >> 2) & 0x01) * 0x44; - b += ((DrvColPROM[i + 0x200] >> 3) & 0x01) * 0x8f; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0x80000, 0x80004, 0x00000, 0x00004 }; - INT32 XOffs[8] = { 0x000, 0x001, 0x002, 0x003, 0x008, 0x009, 0x00a, 0x00b }; - INT32 YOffs[8] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM, 0x20000); - - GfxDecode((0x20000 * 2) / 0x40, 4, 8, 8, Plane, XOffs, YOffs, 0x080, tmp, DrvGfxROM); - - BurnFree (tmp); - - return 0; -} - -static void xorworldPatch() // protection hack -{ - UINT16 *rom = (UINT16*)Drv68KROM; - - rom[0x1390 / 2] = 0x4239; - rom[0x1392 / 2] = 0x00ff; - rom[0x1394 / 2] = 0xe196; - rom[0x1396 / 2] = 0x4239; - rom[0x1398 / 2] = 0x00ff; - rom[0x139a / 2] = 0xe197; - rom[0x139c / 2] = 0x4239; - rom[0x139e / 2] = 0x00ff; - rom[0x13a0 / 2] = 0xe0bc; - rom[0x13a2 / 2] = 0x41f9; - rom[0x13a4 / 2] = 0x00ff; - rom[0x13a6 / 2] = 0xcfce; - rom[0x13a8 / 2] = 0x3e3c; - rom[0x13aa / 2] = 0x000f; - rom[0x13ac / 2] = 0x4218; - rom[0x13ae / 2] = 0x51cf; - rom[0x13b0 / 2] = 0xfffc; - rom[0x13b2 / 2] = 0x4e75; - rom[0x13b4 / 2] = 0x31ff; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x10000, 3, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 5, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 6, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - - xorworldPatch(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0xffc000, 0xffc7ff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0xffc800, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, xorworld_write_byte); - SekSetReadByteHandler(0, xorworld_read_byte); - SekClose(); - - saa1099Init(0, 8000000, 0); - saa1099SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&eeprom_interface_93C46); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - EEPROMExit(); - - SekExit(); - - saa1099Exit(0); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer() -{ - UINT16 *ram = (UINT16*)DrvVidRAM; - - for (INT32 offs = 32 * 2; offs < (32 * 32) - (32 * 2); offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 code = ram[offs] & 0x0fff; - INT32 color = ram[offs] >> 12; - - Render8x8Tile(pTransDraw, code, sx, sy - 16, color, 4, 0, DrvGfxROM); - } -} - -static void draw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprRAM; - - for (INT32 i = 0; i < 0x40; i += 2) - { - INT32 sx = ram[i] & 0xff; - INT32 sy = (240 - (ram[i] >> 8)) - 16; - INT32 code = ram[i+1] & 0x0ffc; - INT32 color = ram[i+1] >> 12; - - Render8x8Tile_Mask_Clip(pTransDraw, code + 0, sx + 0, sy + 0, color, 4, 0, 0, DrvGfxROM); - Render8x8Tile_Mask_Clip(pTransDraw, code + 1, sx + 0, sy + 8, color, 4, 0, 0, DrvGfxROM); - Render8x8Tile_Mask_Clip(pTransDraw, code + 2, sx + 8, sy + 0, color, 4, 0, 0, DrvGfxROM); - Render8x8Tile_Mask_Clip(pTransDraw, code + 3, sx + 8, sy + 8, color, 4, 0, 0, DrvGfxROM); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - SekOpen(0); - - for (INT32 i = 0; i < 4; i++) - { - SekRun((10000000 / 60) / 4); - if (i == 0 || i == 2) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - if (/*i==1||*/i == 3) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - if (pBurnSoundOut) { - saa1099Update(0, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - - saa1099Scan(0, nAction); - - EEPROMScan(nAction, pnMin); - } - - return 0; -} - - -// Xor World (prototype) - -static struct BurnRomInfo xorworldRomDesc[] = { - { "c13.bin", 0x10000, 0x615a864d, 1 | BRF_PRG | BRF_ESS }, // 0 68k Code - { "b13.bin", 0x10000, 0x632e8ee5, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "d9.bin", 0x10000, 0xda8d4d65, 2 | BRF_GRA }, // 2 Tiles and Sprites - { "d10.bin", 0x10000, 0x3b1d6f24, 2 | BRF_GRA }, // 3 - - { "b4.bin", 0x00100, 0x75e468af, 3 | BRF_GRA }, // 4 Color PROMs - { "b7.bin", 0x00100, 0x7e1cd146, 3 | BRF_GRA }, // 5 - { "b5.bin", 0x00100, 0xc1b9d9f9, 3 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(xorworld) -STD_ROM_FN(xorworld) - -struct BurnDriver BurnDrvXorworld = { - "xorworld", NULL, NULL, NULL, "1990", - "Xor World (prototype)\0", NULL, "Gaelco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, xorworldRomInfo, xorworldRomName, NULL, NULL, XorworldInputInfo, XorworldDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_yunsun16.cpp b/jan/src/burn/drv/pst90s/d_yunsun16.cpp deleted file mode 100644 index 8f7503bf9..000000000 --- a/jan/src/burn/drv/pst90s/d_yunsun16.cpp +++ /dev/null @@ -1,1206 +0,0 @@ -// FB Alpha Yun Sung 16 Bit Games driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvSndROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 soundbank; -static UINT16 *scroll; -static UINT8 *soundlatch; -static UINT8 *video_priority; - -static UINT16 DrvInputs[2]; -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; - -static INT32 is_magicbub = 0; - -static struct BurnInputInfo MagicbubInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Magicbub) - -static struct BurnInputInfo BombkickInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 11, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 10, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 9, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 8, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 13, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 12, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 14, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Bombkick) - -static struct BurnDIPInfo MagicbubDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xbf, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0e, 0x01, 0x18, 0x10, "Easy" }, - {0x0e, 0x01, 0x18, 0x18, "Normal" }, - {0x0e, 0x01, 0x18, 0x08, "Hard" }, - {0x0e, 0x01, 0x18, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0e, 0x01, 0x40, 0x40, "Off" }, - {0x0e, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "1P Vs 2P Rounds (Start)" }, - {0x0f, 0x01, 0x0c, 0x08, "Best of 1" }, - {0x0f, 0x01, 0x0c, 0x0c, "Best of 3" }, - {0x0f, 0x01, 0x0c, 0x04, "Best of 5" }, - {0x0f, 0x01, 0x0c, 0x00, "Best of 7" }, - - {0 , 0xfe, 0 , 2, "1P Vs 2P Rounds (Join-in)" }, - {0x0f, 0x01, 0x10, 0x00, "Best of 1" }, - {0x0f, 0x01, 0x10, 0x10, "Best of 3" }, -}; - -STDDIPINFO(Magicbub) - -static struct BurnDIPInfo MagicbubaDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xbf, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0e, 0x01, 0x18, 0x10, "Easy" }, - {0x0e, 0x01, 0x18, 0x18, "Normal" }, - {0x0e, 0x01, 0x18, 0x08, "Hard" }, - {0x0e, 0x01, 0x18, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0e, 0x01, 0x40, 0x40, "Off" }, - {0x0e, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0e, 0x01, 0x80, 0x80, "Off" }, - {0x0e, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Nudity" }, - {0x0f, 0x01, 0x03, 0x03, "Soft only" }, - {0x0f, 0x01, 0x03, 0x00, "Hard only" }, - {0x0f, 0x01, 0x03, 0x01, "Soft and Hard" }, - {0x0f, 0x01, 0x03, 0x02, "Soft then Hard" }, - - {0 , 0xfe, 0 , 4, "1P Vs 2P Rounds (Start)" }, - {0x0f, 0x01, 0x0c, 0x08, "Best of 1" }, - {0x0f, 0x01, 0x0c, 0x0c, "Best of 3" }, - {0x0f, 0x01, 0x0c, 0x04, "Best of 5" }, - {0x0f, 0x01, 0x0c, 0x00, "Best of 7" }, - - {0 , 0xfe, 0 , 2, "1P Vs 2P Rounds (Join-in)" }, - {0x0f, 0x01, 0x10, 0x00, "Best of 1" }, - {0x0f, 0x01, 0x10, 0x10, "Best of 3" }, -}; - -STDDIPINFO(Magicbuba) - -static struct BurnDIPInfo ShockingDIPList[]= -{ - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x0e, 0x01, 0x07, 0x01, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x07, 0x03, "3 Coins 2 Credits" }, - {0x0e, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x07, 0x04, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x0f, 0x01, 0x07, 0x04, "Easiest" }, - {0x0f, 0x01, 0x07, 0x05, "Easier" }, - {0x0f, 0x01, 0x07, 0x06, "Easy" }, - {0x0f, 0x01, 0x07, 0x07, "Normal" }, - {0x0f, 0x01, 0x07, 0x03, "Medium" }, - {0x0f, 0x01, 0x07, 0x02, "Hard" }, - {0x0f, 0x01, 0x07, 0x01, "Harder" }, - {0x0f, 0x01, 0x07, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x20, "2" }, - {0x0f, 0x01, 0x30, 0x30, "3" }, - {0x0f, 0x01, 0x30, 0x10, "4" }, - {0x0f, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Shocking) - -static struct BurnDIPInfo BombkickDIPList[]= -{ - {0x12, 0xff, 0xff, 0x9f, NULL }, - {0x13, 0xff, 0xff, 0xaf, NULL }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x18, 0x10, "Easy" }, - {0x12, 0x01, 0x18, 0x18, "Normal" }, - {0x12, 0x01, 0x18, 0x08, "Hard" }, - {0x12, 0x01, 0x18, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Special Powers" }, - {0x12, 0x01, 0x20, 0x20, "2" }, - {0x12, 0x01, 0x20, 0x00, "3" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "2" }, - {0x13, 0x01, 0x03, 0x03, "3" }, - {0x13, 0x01, 0x03, 0x02, "4" }, - {0x13, 0x01, 0x03, 0x01, "5" }, - -}; - -STDDIPINFO(Bombkick) - -static struct BurnDIPInfo PaprazziDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x9b, NULL }, - {0x0f, 0xff, 0xff, 0xa7, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x0e, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x0e, 0x01, 0x08, 0x00, "Korean" }, - {0x0e, 0x01, 0x08, 0x08, "English" }, - - {0 , 0xfe, 0 , 2, "Enemies" }, - {0x0e, 0x01, 0x10, 0x00, "Type 1" }, - {0x0e, 0x01, 0x10, 0x10, "Type 2" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x0e, 0x01, 0xc0, 0x00, "80" }, - {0x0e, 0x01, 0xc0, 0x40, "100" }, - {0x0e, 0x01, 0xc0, 0x80, "120" }, - {0x0e, 0x01, 0xc0, 0xc0, "150" }, - - {0 , 0xfe, 0 , 8, "Difficulty" }, - {0x0f, 0x01, 0x07, 0x04, "Easiest" }, - {0x0f, 0x01, 0x07, 0x05, "Easier" }, - {0x0f, 0x01, 0x07, 0x06, "Easy" }, - {0x0f, 0x01, 0x07, 0x07, "Normal" }, - {0x0f, 0x01, 0x07, 0x03, "Medium" }, - {0x0f, 0x01, 0x07, 0x02, "Hard" }, - {0x0f, 0x01, 0x07, 0x01, "Harder" }, - {0x0f, 0x01, 0x07, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x20, "3" }, - {0x0f, 0x01, 0x30, 0x30, "2" }, - {0x0f, 0x01, 0x30, 0x10, "4" }, - {0x0f, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Gfx Viewer" }, - {0x0f, 0x01, 0x80, 0x80, "Off" }, - {0x0f, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Paprazzi) - -static void set_sample_bank(INT32 bank) -{ - if (bank != soundbank) { - soundbank = bank; - memcpy(DrvSndROM + 0x20000, DrvSndROM + 0x40000 + (soundbank * 0x20000), 0x20000); - } -} - -void __fastcall magicbub_main_write_word(UINT32 address, UINT16 data) -{ - switch (address) - { - case 0x80010c: - case 0x80010e: - scroll[2 + ((address >> 1) & 1)] = data & 0x3ff; - return; - - case 0x800114: - case 0x800116: - scroll[0 + ((address >> 1) & 1)] = data & 0x3ff; - return; - - case 0x800154: - *video_priority = data & 0xff; - return; - - } -} - -void __fastcall magicbub_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x800180: - case 0x800181: - set_sample_bank(data & 3); - return; - - case 0x800188: - case 0x800189: - if (is_magicbub==1) { - if (data != 0x3a) { - *soundlatch = data; -// ZetNmi(); - Z80SetIrqLine(Z80_INPUT_LINE_NMI, 1); - } - } else { - MSM6295Command(0, data); - } - return; - } -} - -UINT16 __fastcall magicbub_main_read_word(UINT32 address) -{ - switch (address) - { - case 0x800000: - return DrvInputs[0]; - - case 0x800018: - return DrvInputs[1]; - } - - return 0; -} - -UINT8 __fastcall magicbub_main_read_byte(UINT32 address) -{ - switch (address) - { - case 0x800000: - case 0x800001: - return (DrvInputs[0] >> ((~address & 1) << 3)); - - case 0x800018: - case 0x800019: - return (DrvInputs[1] >> ((~address & 1) << 3)); - - case 0x80001a: - case 0x80001b: - return DrvDips[0]; - - case 0x80001c: - case 0x80001d: - return DrvDips[1]; - - case 0x800188: - case 0x800189: - return MSM6295ReadStatus(0); - } - - return 0; -} - -void __fastcall magicbub_sound_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x10: - BurnYM3812Write(0, 0, data); - return; - - case 0x11: - BurnYM3812Write(0, 1, data); - return; - - case 0x1c: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall magicbub_sound_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x10: - return BurnYM3812Read(0, 0); - - case 0x11: - return BurnYM3812Read(0, 1); - - case 0x18: - Z80SetIrqLine(Z80_INPUT_LINE_NMI, 0); - return *soundlatch; - - case 0x1c: - return MSM6295ReadStatus(0); - } - - return 0; -} - - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3000000; -} - -static void DrvYM3812IrqHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM3812Reset(); - - memcpy (DrvSndROM, DrvSndROM + 0x40000, 0x40000); - soundbank = 1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x400000; - DrvGfxROM1 = Next; Next += 0x200000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x080000 + 0x40000; - - DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvVidRAM0 = Next; Next += 0x004000; - DrvVidRAM1 = Next; Next += 0x004000; - DrvSprRAM = Next; Next += 0x001000; - DrvPalRAM = Next; Next += 0x004000; - - DrvZ80RAM = Next; Next += 0x000800; - - scroll = (UINT16*)Next; Next += 0x000004 * sizeof(UINT16); - soundlatch = Next; Next += 0x000001; - video_priority = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[8] = { 0x030, 0x020, 0x010, 0x000, 0x038, 0x028, 0x018, 0x008 }; - INT32 Plane1[4] = { 0x600000, 0x200000, 0x400000, 0x000000 }; - INT32 XOffs0[16] = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, - 0x040, 0x041, 0x042, 0x043, 0x044, 0x045, 0x046, 0x047 }; - INT32 XOffs1[16] = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, - 0x008, 0x009, 0x00a, 0x00b, 0x00c, 0x00d, 0x00e, 0x00f }; - INT32 YOffs0[16] = { 0x000, 0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, - 0x400, 0x480, 0x500, 0x580, 0x600, 0x680, 0x700, 0x780 }; - INT32 YOffs1[16] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, - 0x080, 0x090, 0x0a0, 0x0b0, 0x0c0, 0x0d0, 0x0e0, 0x0f0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x400000; i++) { - tmp[i] = DrvGfxROM0[(i & ~7) | ((i & 6) >> 1) | ((i & 1) << 2)]; - } - - GfxDecode(0x4000, 8, 16, 16, Plane0, XOffs0, YOffs0, 0x800, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x100000); - - GfxDecode(0x2000, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit(INT32 game_select) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - INT32 offset = 0; - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - memset (DrvGfxROM0, 0xff, 0x400000); - - switch (game_select) - { - case 0: // magicbub - { - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 5, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 6, 4)) return 1; - offset = 7; - - is_magicbub = 1; - } - break; - - case 1: // magicbuba - { - if (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 5, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 6, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200001, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200002, 9, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200003, 10, 4)) return 1; - offset = 11; - - is_magicbub = 1; - } - break; - - case 2: // magicbubb - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 5, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 6, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200001, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200002, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200003, 9, 4)) return 1; - offset = 10; - - is_magicbub = 2; // this set has no z80 like sets below! - } - break; - - case 3: // paprazzi - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 5, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200000, 6, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200001, 7, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200002, 8, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x200003, 9, 4)) return 1; - offset = 10; - } - break; - - case 4: // shocking, bombkick - { - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 5, 4)) return 1; - offset = 6; - } - break; - } - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, offset + 0, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x040000, offset + 1, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x080000, offset + 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x0c0000, offset + 3, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x040000, offset + 4, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x900000, 0x903fff, MAP_RAM); - SekMapMemory(DrvVidRAM1, 0x908000, 0x90bfff, MAP_RAM); - SekMapMemory(DrvVidRAM0, 0x90c000, 0x90ffff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x910000, 0x910fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xff0000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, magicbub_main_write_word); - SekSetWriteByteHandler(0, magicbub_main_write_byte); - SekSetReadWordHandler(0, magicbub_main_read_word); - SekSetReadByteHandler(0, magicbub_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xdfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xdfff, 2, DrvZ80ROM); - ZetMapArea(0xe000, 0xe7ff, 0, DrvZ80RAM); - ZetMapArea(0xe000, 0xe7ff, 1, DrvZ80RAM); - ZetMapArea(0xe000, 0xe7ff, 2, DrvZ80RAM); - ZetSetOutHandler(magicbub_sound_out); - ZetSetInHandler(magicbub_sound_in); - ZetClose(); - - BurnYM3812Init(1, 4000000, &DrvYM3812IrqHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, ((is_magicbub==1) ? 1056000 : 1000000) / 132, (is_magicbub==1)?1:0); - MSM6295SetRoute(0, (is_magicbub ? 0.80 : 1.00), BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - MSM6295Exit(0); - BurnYM3812Exit(); - - SekExit(); - ZetExit(); - GenericTilesExit(); - - BurnFree (AllMem); - - is_magicbub = 0; - - return 0; -} - -static inline void DrvRecalcPal() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - for (INT32 i = 0; i < 0x2000; i++) { - if (i == 0x200) i = 0x1000; - INT32 d = p[i]; - - r = (d >> 10) & 0x1f; - g = (d >> 5) & 0x1f; - b = (d >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_layer(INT32 scr, INT32 pri) -{ - INT32 scrollx = scroll[scr * 2 + 0] + ((scr) ? 0x38 : 0x34) + ((is_magicbub) ? 32 : 0); - INT32 scrolly = scroll[scr * 2 + 1] + 0x10; - - UINT16 *vram = (UINT16*)(scr ? DrvVidRAM1 : DrvVidRAM0); - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) << 4; - INT32 sy = (offs >> 6) << 4; - - sx -= scrollx; - if (sx < -15) sx += 1024; - sy -= scrolly; - if (sy < -15) sy += 1024; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 ofst = (offs & 0xc00) + ((offs << 4) & 0x300) + ((offs >> 6) & 0x0f) + ((offs & 0x0f) << 4); - - INT32 code = vram[ofst * 2 + 0] & 0x3fff; - INT32 attr = vram[ofst * 2 + 1]; - - if (pri) { - if (attr & 0x20) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, attr & 0x0f, 8, 0x1000, DrvGfxROM0); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, attr & 0x0f, 8, 0x1000, DrvGfxROM0); - } - } else { - if (attr & 0x20) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, attr & 0x0f, 8, 0xff, 0x1000, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, attr & 0x0f, 8, 0xff, 0x1000, DrvGfxROM0); - } - } - } -} - -static void draw_sprites(INT32 pri) -{ - if ((*video_priority & 3) != pri) return; - - INT32 x_offset = is_magicbub ? 96 : 64; - UINT16 *vram = (UINT16*)DrvSprRAM; - - for (INT32 offs = 0; offs < 0x1000 / 2; offs += 8 / 2) - { - INT32 sx = vram[offs + 0] - x_offset; - INT32 sy = vram[offs + 1] - 0x0f; - INT32 code = vram[offs + 2] & 0x1fff; - INT32 attr = vram[offs + 3]; - INT32 flipx = attr & 0x20; - INT32 flipy = attr & 0x40; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, attr & 0x1f, 4, 15, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, attr & 0x1f, 4, 15, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, attr & 0x1f, 4, 15, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, attr & 0x1f, 4, 15, 0, DrvGfxROM1); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPal(); - } - - if ((*video_priority & 0x0c) == 0x04) { - draw_layer(0, 1); - - if (nSpriteEnable & 1) draw_sprites(1); - - if (nBurnLayer & 2) draw_layer(0, 0); - if (nSpriteEnable & 2 )draw_sprites(2); - - if (nBurnLayer & 4) draw_layer(1, 0); - - if (nSpriteEnable & 4) { - draw_sprites(3); - draw_sprites(0); - } - } else if ((*video_priority & 0x0c) == 0x08) { - draw_layer(1, 1); - - if (nSpriteEnable & 1) draw_sprites(1); - - if (nBurnLayer & 2) draw_layer(1, 0); - - if (nSpriteEnable & 2)draw_sprites(2); - - if (nBurnLayer & 4) draw_layer(0, 0); - - if (nSpriteEnable & 4) { - draw_sprites(3); - draw_sprites(0); - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 2 * sizeof(UINT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - } - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 16000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - if (is_magicbub != 1) continue; - - nSegment = nCyclesTotal[1] / nInterleave; - BurnTimerUpdateYM3812((1 + i) * nSegment); - } - - if (is_magicbub == 1) { - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - } - - if (pBurnSoundOut) { - if (is_magicbub) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - MSM6295Scan(0, nAction); - - SCAN_VAR(soundbank); - - INT32 bank = soundbank; - soundbank = -1; - set_sample_bank(bank); - } - - return 0; -} - - -// Magic Bubble - -static struct BurnRomInfo magicbubRomDesc[] = { - { "magbuble.u33", 0x40000, 0x18fdd582, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "magbuble.u32", 0x40000, 0xf6ea7004, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u143.bin", 0x10000, 0x04192753, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "magbuble.u67", 0x80000, 0x6355e57d, 3 | BRF_GRA }, // 3 Background Tiles - { "magbuble.u68", 0x80000, 0x53ae6c2b, 3 | BRF_GRA }, // 4 - { "magbuble.u69", 0x80000, 0xb892e64c, 3 | BRF_GRA }, // 5 - { "magbuble.u70", 0x80000, 0x37794837, 3 | BRF_GRA }, // 6 - - { "u20.bin", 0x20000, 0xf70e3b8c, 4 | BRF_GRA }, // 7 Sprites - { "u21.bin", 0x20000, 0xad082cf3, 4 | BRF_GRA }, // 8 - { "u22.bin", 0x20000, 0x7c68df7a, 4 | BRF_GRA }, // 9 - { "u23.bin", 0x20000, 0xc7763fc1, 4 | BRF_GRA }, // 10 - - { "u131.bin", 0x20000, 0x03e04e89, 5 | BRF_SND }, // 11 Samples -}; - -STD_ROM_PICK(magicbub) -STD_ROM_FN(magicbub) - -static INT32 MagicbubInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvMagicbub = { - "magicbub", NULL, NULL, NULL, "199?", - "Magic Bubble\0", NULL, "Yun Sung", "Yun Sung 16 Bit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, magicbubRomInfo, magicbubRomName, NULL, NULL, MagicbubInputInfo, MagicbubDIPInfo, - MagicbubInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Magic Bubble (Adult version, YS-1302 PCB) - -static struct BurnRomInfo magicbubaRomDesc[] = { - { "u33.bin", 0x40000, 0xa8164a02, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "u32.bin", 0x40000, 0x58f885ad, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u143.bin", 0x10000, 0x04192753, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code - - { "u67.bin", 0x80000, 0x89523dcd, 3 | BRF_GRA }, // 3 Background Tiles - { "u68.bin", 0x80000, 0x30e01a70, 3 | BRF_GRA }, // 4 - { "u69.bin", 0x80000, 0xfe357f52, 3 | BRF_GRA }, // 5 - { "u70.bin", 0x80000, 0x1398a473, 3 | BRF_GRA }, // 6 - { "u71.bin", 0x80000, 0x0844e017, 3 | BRF_GRA }, // 7 - { "u72.bin", 0x80000, 0x591db1cb, 3 | BRF_GRA }, // 8 - { "u73.bin", 0x80000, 0xcb4f3c3c, 3 | BRF_GRA }, // 9 - { "u74.bin", 0x80000, 0x81ff4910, 3 | BRF_GRA }, // 10 - - { "u20.bin", 0x20000, 0xf70e3b8c, 4 | BRF_GRA }, // 11 Sprites - { "u21.bin", 0x20000, 0xad082cf3, 4 | BRF_GRA }, // 12 - { "u22.bin", 0x20000, 0x7c68df7a, 4 | BRF_GRA }, // 13 - { "u23.bin", 0x20000, 0xc7763fc1, 4 | BRF_GRA }, // 14 - - { "u131.bin", 0x20000, 0x03e04e89, 5 | BRF_SND }, // 15 Samples -}; - -STD_ROM_PICK(magicbuba) -STD_ROM_FN(magicbuba) - -static INT32 MagicbubaInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvMagicbuba = { - "magicbuba", "magicbub", NULL, NULL, "199?", - "Magic Bubble (Adult version, YS-1302 PCB)\0", NULL, "Yun Sung", "Yun Sung 16 Bit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, magicbubaRomInfo, magicbubaRomName, NULL, NULL, MagicbubInputInfo, MagicbubaDIPInfo, - MagicbubaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Magic Bubble (Adult version, YS-0211 PCB) - -static struct BurnRomInfo magicbubbRomDesc[] = { - { "u33", 0x40000, 0xdb651555, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "u32", 0x40000, 0xc9cb4d88, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u67.bin", 0x80000, 0x89523dcd, 2 | BRF_GRA }, // 2 Background Tiles - { "u68.bin", 0x80000, 0x30e01a70, 2 | BRF_GRA }, // 3 - { "u69.bin", 0x80000, 0xfe357f52, 2 | BRF_GRA }, // 4 - { "u70.bin", 0x80000, 0x1398a473, 2 | BRF_GRA }, // 5 - { "u71.bin", 0x80000, 0x0844e017, 2 | BRF_GRA }, // 6 - { "u72.bin", 0x80000, 0x591db1cb, 2 | BRF_GRA }, // 7 - { "u73.bin", 0x80000, 0xcb4f3c3c, 2 | BRF_GRA }, // 8 - { "u74.bin", 0x80000, 0x81ff4910, 2 | BRF_GRA }, // 9 - - { "u20.bin", 0x20000, 0xf70e3b8c, 3 | BRF_GRA }, // 10 Sprites - { "u21.bin", 0x20000, 0xad082cf3, 3 | BRF_GRA }, // 11 - { "u22.bin", 0x20000, 0x7c68df7a, 3 | BRF_GRA }, // 12 - { "u23.bin", 0x20000, 0xc7763fc1, 3 | BRF_GRA }, // 13 - - { "u131", 0x40000, 0x9bdb08e4, 4 | BRF_SND }, // 14 Samples -}; - -STD_ROM_PICK(magicbubb) -STD_ROM_FN(magicbubb) - -static INT32 MagicbubbInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvMagicbubb = { - "magicbubb", "magicbub", NULL, NULL, "199?", - "Magic Bubble (Adult version, YS-0211 PCB)\0", NULL, "Yun Sung", "Yun Sung 16 Bit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, magicbubbRomInfo, magicbubbRomName, NULL, NULL, MagicbubInputInfo, MagicbubaDIPInfo, - MagicbubbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Paparazzi - -static struct BurnRomInfo paprazziRomDesc[] = { - { "u33.bin", 0x20000, 0x91f33abd, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "u32.bin", 0x20000, 0xad5a3fec, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "u67.bin", 0x80000, 0xea0b9e27, 3 | BRF_GRA }, // 2 Background Tiles - { "u68.bin", 0x80000, 0x6b7ff4dd, 3 | BRF_GRA }, // 3 - { "u69.bin", 0x80000, 0x06749294, 3 | BRF_GRA }, // 4 - { "u70.bin", 0x80000, 0x0adacdf8, 3 | BRF_GRA }, // 5 - { "u71.bin", 0x80000, 0x69178fc4, 3 | BRF_GRA }, // 6 - { "u72.bin", 0x80000, 0x7c3384b9, 3 | BRF_GRA }, // 7 - { "u73.bin", 0x80000, 0x73fbc13e, 3 | BRF_GRA }, // 8 - { "u74.bin", 0x80000, 0xf1afda11, 3 | BRF_GRA }, // 9 - - { "u20.bin", 0x40000, 0xccb0ad6b, 4 | BRF_GRA }, // 10 Sprites - { "u21.bin", 0x40000, 0x125badf0, 4 | BRF_GRA }, // 11 - { "u22.bin", 0x40000, 0x436499c7, 4 | BRF_GRA }, // 12 - { "u23.bin", 0x40000, 0x358280fe, 4 | BRF_GRA }, // 13 - - { "u131.bin", 0x80000, 0xbcf7aa12, 5 | BRF_SND }, // 14 Samples -}; - -STD_ROM_PICK(paprazzi) -STD_ROM_FN(paprazzi) - -static INT32 PaprazziInit() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvPaprazzi = { - "paprazzi", NULL, NULL, NULL, "1996", - "Paparazzi\0", NULL, "Yun Sung", "Yun Sung 16 Bit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0, - NULL, paprazziRomInfo, paprazziRomName, NULL, NULL, MagicbubInputInfo, PaprazziDIPInfo, - PaprazziInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 224, 384, 3, 4 -}; - - -// Shocking - -static struct BurnRomInfo shockingRomDesc[] = { - { "yunsun16.u33", 0x40000, 0x8a155521, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "yunsun16.u32", 0x40000, 0xc4998c10, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "yunsun16.u67", 0x80000, 0xe30fb2c4, 3 | BRF_GRA }, // 2 Background Tiles - { "yunsun16.u68", 0x80000, 0x7d702538, 3 | BRF_GRA }, // 3 - { "yunsun16.u69", 0x80000, 0x97447fec, 3 | BRF_GRA }, // 4 - { "yunsun16.u70", 0x80000, 0x1b1f7895, 3 | BRF_GRA }, // 5 - - { "yunsun16.u20", 0x40000, 0x124699d0, 4 | BRF_GRA }, // 6 Sprites - { "yunsun16.u21", 0x40000, 0x4eea29a2, 4 | BRF_GRA }, // 7 - { "yunsun16.u22", 0x40000, 0xd6db0388, 4 | BRF_GRA }, // 8 - { "yunsun16.u23", 0x40000, 0x1fa33b2e, 4 | BRF_GRA }, // 9 - - { "yunsun16.131", 0x80000, 0xd0a1bb8c, 5 | BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(shocking) -STD_ROM_FN(shocking) - -static INT32 ShockingInit() -{ - return DrvInit(4); -} - -struct BurnDriver BurnDrvShocking = { - "shocking", NULL, NULL, NULL, "1997", - "Shocking\0", NULL, "Yun Sung", "Yun Sung 16 Bit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0, - NULL, shockingRomInfo, shockingRomName, NULL, NULL, MagicbubInputInfo, ShockingDIPInfo, - ShockingInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 384, 224, 4, 3 -}; - - -// Bomb Kick (set 1) - -static struct BurnRomInfo bombkickRomDesc[] = { - { "bk_u33", 0x40000, 0xd6eb50bf, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "bk_u32", 0x40000, 0xd55388a2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bk_u67", 0x80000, 0x1962f536, 3 | BRF_GRA }, // 2 Background Tiles - { "bk_u68", 0x80000, 0xd80c75a4, 3 | BRF_GRA }, // 3 - { "bk_u69", 0x80000, 0x615e1e6f, 3 | BRF_GRA }, // 4 - { "bk_u70", 0x80000, 0x59817ef1, 3 | BRF_GRA }, // 5 - - { "bk_u20", 0x40000, 0xc2b83e3f, 4 | BRF_GRA }, // 6 Sprites - { "bk_u21", 0x40000, 0xd6890192, 4 | BRF_GRA }, // 7 - { "bk_u22", 0x40000, 0x9538c46c, 4 | BRF_GRA }, // 8 - { "bk_u23", 0x40000, 0xe3831f3d, 4 | BRF_GRA }, // 9 - - { "bk_u131", 0x80000, 0x22cc5732, 5 | BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(bombkick) -STD_ROM_FN(bombkick) - -struct BurnDriver BurnDrvBombkick = { - "bombkick", NULL, NULL, NULL, "1998", - "Bomb Kick (set 1)\0", NULL, "Yun Sung", "Yun Sung 16 Bit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, bombkickRomInfo, bombkickRomName, NULL, NULL, BombkickInputInfo, BombkickDIPInfo, - ShockingInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 384, 224, 4, 3 -}; - - -// Bomb Kick (set 2) - -static struct BurnRomInfo bombkickaRomDesc[] = { - { "u33.bin", 0x40000, 0x4624d618, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "u32.bin", 0x40000, 0xc5a105f3, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "bk_u67", 0x80000, 0x1962f536, 3 | BRF_GRA }, // 2 Background Tiles - { "bk_u68", 0x80000, 0xd80c75a4, 3 | BRF_GRA }, // 3 - { "bk_u69", 0x80000, 0x615e1e6f, 3 | BRF_GRA }, // 4 - { "bk_u70", 0x80000, 0x59817ef1, 3 | BRF_GRA }, // 5 - - { "bk_u20", 0x40000, 0xc2b83e3f, 4 | BRF_GRA }, // 6 Sprites - { "bk_u21", 0x40000, 0xd6890192, 4 | BRF_GRA }, // 7 - { "bk_u22", 0x40000, 0x9538c46c, 4 | BRF_GRA }, // 8 - { "bk_u23", 0x40000, 0xe3831f3d, 4 | BRF_GRA }, // 9 - - { "bk_u131", 0x80000, 0x22cc5732, 5 | BRF_SND }, // 10 Samples -}; - -STD_ROM_PICK(bombkicka) -STD_ROM_FN(bombkicka) - -struct BurnDriver BurnDrvBombkicka = { - "bombkicka", "bombkick", NULL, NULL, "1998", - "Bomb Kick (set 2)\0", NULL, "Yun Sung", "Yun Sung 16 Bit", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0, - NULL, bombkickaRomInfo, bombkickaRomName, NULL, NULL, BombkickInputInfo, BombkickDIPInfo, - ShockingInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000, - 384, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_yunsung8.cpp b/jan/src/burn/drv/pst90s/d_yunsung8.cpp deleted file mode 100644 index 6ce02ce8b..000000000 --- a/jan/src/burn/drv/pst90s/d_yunsung8.cpp +++ /dev/null @@ -1,780 +0,0 @@ -// FB Alpha Yun Sung 8 Bit Games driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym3812.h" -#include "msm5205.h" -#include "burn_pal.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; - -static UINT8 DrvRecalc; - -static UINT8 bankdata[3]; -static UINT8 soundlatch; -static UINT8 flipscreen; -static INT32 adpcm_toggle; -static UINT8 adpcm_data; - -static UINT16 palrambank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo RocktrisInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Rocktris) - -static struct BurnInputInfo CannballInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 3" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 2, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 5, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Cannball) - -static struct BurnDIPInfo RocktrisDIPList[]= -{ - {0x11, 0xff, 0xff, 0xef, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x06, 0x00, "Easy" }, - {0x11, 0x01, 0x06, 0x06, "Normal" }, - {0x11, 0x01, 0x06, 0x04, "Hard" }, - {0x11, 0x01, 0x06, 0x02, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0x20, "3 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xe0, 0x40, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, -}; - -STDDIPINFO(Rocktris) - -static struct BurnDIPInfo MagixDIPList[]= -{ - {0x11, 0xff, 0xff, 0xef, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x11, 0x01, 0x06, 0x00, "Easy" }, - {0x11, 0x01, 0x06, 0x06, "Normal" }, - {0x11, 0x01, 0x06, 0x04, "Hard" }, - {0x11, 0x01, 0x06, 0x02, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x11, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0x20, "3 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xe0, 0x40, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Title" }, - {0x12, 0x01, 0x01, 0x01, "Magix" }, - {0x12, 0x01, 0x01, 0x00, "Rock" }, -}; - -STDDIPINFO(Magix) - -static struct BurnDIPInfo CannballDIPList[]= -{ - {0x13, 0xff, 0xff, 0xef, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x06, 0x00, "Easy" }, - {0x13, 0x01, 0x06, 0x06, "Normal" }, - {0x13, 0x01, 0x06, 0x04, "Hard" }, - {0x13, 0x01, 0x06, 0x02, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x10, 0x10, "Off" }, - {0x13, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coinage" }, - {0x13, 0x01, 0xe0, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0x60, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xe0, 0xe0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xe0, 0x40, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Bombs" }, - {0x14, 0x01, 0x0c, 0x04, "1" }, - {0x14, 0x01, 0x0c, 0x08, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x00, "4" }, -}; - -STDDIPINFO(Cannball) - -static inline void palette_write(INT32 offset) -{ - UINT16 c = BurnPalRAM[offset + 0] + (BurnPalRAM[offset + 1] * 256); - - BurnPalette[offset/2] = BurnHighCol(pal5bit(c), pal5bit(c >> 5), pal5bit(c >> 10), 0); -} - -static void bankswitch(INT32 data) -{ - bankdata[0] = data; - - ZetMapMemory(DrvZ80ROM0 + ((data & 7) * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void rambank(INT32 data) -{ - bankdata[1] = data; - - palrambank = (data & 2) * 0x400; - - ZetMapMemory(BurnPalRAM + palrambank , 0xc000, 0xc7ff, MAP_ROM); - ZetMapMemory(DrvVidRAM + ((data & 1) * 0x1800), 0xc800, 0xdfff, MAP_RAM); -} - -static void __fastcall yunsung8_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xc000) { - INT32 offset = palrambank + (address & 0x7ff); - BurnPalRAM[offset] = data; - palette_write(offset & ~1); - return; - } - - switch (address) - { - case 0x0001: - bankswitch(data); - return; - } -} - -static void __fastcall yunsung8_main_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - rambank(data); - return; - - case 0x01: - bankswitch(data); - return; - - case 0x02: - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0x06: - flipscreen = data & 0x01; - return; - - case 0x07: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - } -} - -static UINT8 __fastcall yunsung8_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - case 0x02: - return DrvInputs[port & 3]; - - case 0x03: - case 0x04: - return DrvDips[(port - 1) & 1]; - } - - return 0; -} - -static void sound_bankswitch(INT32 data) -{ - bankdata[2] = data; - - MSM5205ResetWrite(0, (data >> 5) & 1); - - ZetMapMemory(DrvZ80ROM1 + ((data & 7) * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall yunsung8_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - sound_bankswitch(data); - return; - - case 0xe400: - adpcm_data = ((data&0xf)<<4) | ((data >>4)&0xf); - return; - - case 0xec00: - case 0xec01: - BurnYM3812Write(0, address & 1, data); - return; - } -} - -static UINT8 __fastcall yunsung8_sound_read(UINT16 address) -{ - switch (address) - { - case 0xf800: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return soundlatch; - } - - return 0; -} - -static tilemap_callback( background ) -{ - UINT16 code = DrvVidRAM[0x2000 + (offs * 2)] + (DrvVidRAM[0x2001 + (offs * 2)] * 256); - UINT8 color = DrvVidRAM[0x1800 + offs]; - - TILE_SET_INFO(0, code, color, 0); -} - -static tilemap_callback( foreground ) -{ - UINT16 code = DrvVidRAM[0x0800 + (offs * 2)] + (DrvVidRAM[0x0801 + (offs * 2)] * 256); - UINT8 color = DrvVidRAM[0x0000 + offs]; - - TILE_SET_INFO(1, code, color, 0); -} - -static void DrvMSM5205Int() -{ - MSM5205DataWrite(0, adpcm_data >> 4); - adpcm_data <<= 4; - adpcm_toggle = !adpcm_toggle; - - if (adpcm_toggle) ZetNmi(); -} - -inline static INT32 DrvMSM5205SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate) / 4000000; -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - bankswitch(2); - rambank(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - sound_bankswitch(0); - ZetReset(); - BurnYM3812Reset(); - MSM5205Reset(); - ZetClose(); - - soundlatch = 0; - flipscreen = 0; - adpcm_toggle = 0; - adpcm_data = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x020000; - - DrvGfxROM0 = Next; Next += 0x200000; - DrvGfxROM1 = Next; Next += 0x080000; - - BurnPalette = (UINT32*)Next; Next += 0x800 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x003000; - BurnPalRAM = Next; Next += 0x001000; - BurnPalRAM = Next; Next += 0x001000; - DrvZ80RAM0 = Next; Next += 0x002000; - DrvZ80RAM1 = Next; Next += 0x000800; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x000000, 0, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x000000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000001, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000002, 4, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x000003, 5, 4)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000001, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 2)) return 1; - - for (INT32 i = 0x40000-1; i >= 0; i--) { - DrvGfxROM1[i*2+1] = DrvGfxROM1[i] >> 4; - DrvGfxROM1[i*2+0] = DrvGfxROM1[i] & 0xf; - } - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xe000, 0xffff, MAP_RAM); - ZetSetWriteHandler(yunsung8_main_write); - ZetSetOutHandler(yunsung8_main_write_port); - ZetSetInHandler(yunsung8_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvVidRAM, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0xf000, 0xf7ff, MAP_RAM); - ZetSetWriteHandler(yunsung8_sound_write); - ZetSetReadHandler(yunsung8_sound_read); - ZetClose(); - - BurnYM3812Init(1, 4000000, NULL, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(4000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, DrvMSM5205SynchroniseStream, 400000, DrvMSM5205Int, MSM5205_S96_4B, 1); - MSM5205SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 8, 8, 64, 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, foreground_map_callback, 8, 8, 64, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 8, 8, 8, 0x200000, 0, 0x07); - GenericTilemapSetGfx(1, DrvGfxROM1, 4, 8, 8, 0x080000, 0, 0x3f); - GenericTilemapSetOffsets(TMAP_GLOBAL, -64, -8); - GenericTilemapSetTransparent(1, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - MSM5205Exit(); - BurnYM3812Exit(); - - ZetExit(); - GenericTilesExit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x1000; i+=2) { - palette_write(i); - } - DrvRecalc = 0; - } - - GenericTilemapSetFlip(TMAP_GLOBAL, flipscreen ? TMAP_FLIPXY : 0); - - INT32 layerctrl = (~(bankdata[0] & 0x30) >> 4); - - if (layerctrl & 1) { - GenericTilemapDraw(0, pTransDraw, 0); - } else { - BurnTransferClear(); - } - - if (layerctrl & 2) { - GenericTilemapDraw(1, pTransDraw, 0); - } - BurnTransferCopy(BurnPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - - // Cannon Ball (vertical) needs this - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - DrvInputs[0] &= ~0x40; - } - } - - INT32 nCyclesTotal[2] = { 8000000 / 60, 4000000 / 60 }; - INT32 nInterleave = MSM5205CalcInterleave(0, 4000000); - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - - ZetOpen(1); - BurnTimerUpdateYM3812((1 + i) * (nCyclesTotal[1] / nInterleave)); - MSM5205Update(); - ZetClose(); - } - - ZetOpen(1); - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - SCAN_VAR(bankdata); - SCAN_VAR(flipscreen); - SCAN_VAR(soundlatch); - SCAN_VAR(adpcm_toggle); - SCAN_VAR(adpcm_data); - } - - if (nAction & ACB_WRITE) - { - ZetOpen(0); - bankswitch(bankdata[0]); - rambank(bankdata[1]); - ZetClose(); - - ZetOpen(1); - sound_bankswitch(bankdata[2]); - ZetClose(); - } - - return 0; -} - - -// Magix / Rock - -static struct BurnRomInfo magixRomDesc[] = { - { "yunsung8.07", 0x20000, 0xd4d0b68b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "yunsung8.08", 0x20000, 0x6fd60be9, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "yunsung8.04", 0x80000, 0x0a100d2b, 3 | BRF_GRA }, // 2 Background Tiles - { "yunsung8.03", 0x80000, 0xc8cb0373, 3 | BRF_GRA }, // 3 - { "yunsung8.02", 0x80000, 0x09efb8e5, 3 | BRF_GRA }, // 4 - { "yunsung8.01", 0x80000, 0x4590d782, 3 | BRF_GRA }, // 5 - - { "yunsung8.05", 0x20000, 0x862d378c, 4 | BRF_GRA }, // 6 Foreground Tiles - { "yunsung8.06", 0x20000, 0x8b2ab901, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(magix) -STD_ROM_FN(magix) - -struct BurnDriver BurnDrvMagix = { - "magix", NULL, NULL, NULL, "1995", - "Magix / Rock\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, magixRomInfo, magixRomName, NULL, NULL, RocktrisInputInfo, MagixDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 240, 4, 3 -}; - - -// Magix / Rock (no copyright message) - -static struct BurnRomInfo magixbRomDesc[] = { - { "8.bin", 0x20000, 0x3b92020f, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "9.bin", 0x20000, 0x6fd60be9, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "1.bin", 0x80000, 0x0a100d2b, 3 | BRF_GRA }, // 2 Background Tiles - { "2.bin", 0x80000, 0xc8cb0373, 3 | BRF_GRA }, // 3 - { "3.bin", 0x80000, 0x09efb8e5, 3 | BRF_GRA }, // 4 - { "4.bin", 0x80000, 0x4590d782, 3 | BRF_GRA }, // 5 - - { "5.bin", 0x20000, 0x11b99819, 4 | BRF_GRA }, // 6 Foreground Tiles - { "6.bin", 0x20000, 0x361a864c, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(magixb) -STD_ROM_FN(magixb) - -struct BurnDriver BurnDrvMagixb = { - "magixb", "magix", NULL, NULL, "1995", - "Magix / Rock (no copyright message)\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, magixbRomInfo, magixbRomName, NULL, NULL, RocktrisInputInfo, MagixDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 240, 4, 3 -}; - - -// Cannon Ball (Yun Sung, horizontal) - -static struct BurnRomInfo cannballRomDesc[] = { - { "cannball.07", 0x20000, 0x17db56b4, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "cannball.08", 0x20000, 0x11403875, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "cannball.01", 0x40000, 0x2d7785e4, 3 | BRF_GRA }, // 2 Background Tiles - { "cannball.02", 0x40000, 0x24df387e, 3 | BRF_GRA }, // 3 - { "cannball.03", 0x40000, 0x4d62f192, 3 | BRF_GRA }, // 4 - { "cannball.04", 0x40000, 0x37cf8b12, 3 | BRF_GRA }, // 5 - - { "cannball.05", 0x20000, 0x87c1f1fa, 4 | BRF_GRA }, // 6 Foreground Tiles - { "cannball.06", 0x20000, 0xe722bee8, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(cannball) -STD_ROM_FN(cannball) - -struct BurnDriver BurnDrvCannball = { - "cannball", NULL, NULL, NULL, "1995", - "Cannon Ball (Yun Sung, horizontal)\0", NULL, "Yun Sung / Soft Vision", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, cannballRomInfo, cannballRomName, NULL, NULL, CannballInputInfo, CannballDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 240, 4, 3 -}; - - -// Cannon Ball (Yun Sung, vertical) - -static struct BurnRomInfo cannballvRomDesc[] = { - { "yunsung1", 0x20000, 0xf7398b0d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "yunsung8", 0x20000, 0x11403875, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "yunsung7", 0x80000, 0xa5f1a648, 3 | BRF_GRA }, // 2 Background Tiles - { "yunsung6", 0x80000, 0x8baa686e, 3 | BRF_GRA }, // 3 - { "yunsung5", 0x80000, 0xa7f2ce51, 3 | BRF_GRA }, // 4 - { "yunsung4", 0x80000, 0x74bef793, 3 | BRF_GRA }, // 5 - - { "yunsung3", 0x20000, 0x8217abbe, 4 | BRF_GRA }, // 6 Foreground Tiles - { "yunsung2", 0x20000, 0x76de1045, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(cannballv) -STD_ROM_FN(cannballv) - -struct BurnDriver BurnDrvCannballv = { - "cannballv", "cannball", NULL, NULL, "1995", - "Cannon Ball (Yun Sung, vertical)\0", NULL, "Yun Sung / J&K Production", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, cannballvRomInfo, cannballvRomName, NULL, NULL, CannballInputInfo, CannballDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 240, 384, 3, 4 -}; - - -// Rock Tris - -static struct BurnRomInfo rocktrisRomDesc[] = { - { "cpu.bin", 0x20000, 0x46e3b79c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "cpu2.bin", 0x20000, 0x3a78a4cf, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "gfx4.bin", 0x80000, 0xabb49cac, 3 | BRF_GRA }, // 2 Background Tiles - { "gfx3.bin", 0x80000, 0x70a6ad52, 3 | BRF_GRA }, // 3 - { "gfx2.bin", 0x80000, 0xfcc9ec97, 3 | BRF_GRA }, // 4 - { "gfx1.bin", 0x80000, 0x4295034d, 3 | BRF_GRA }, // 5 - - { "gfx5.bin", 0x20000, 0x058ee379, 4 | BRF_GRA }, // 6 Foreground Tiles - { "gfx6.bin", 0x20000, 0x593cbd39, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(rocktris) -STD_ROM_FN(rocktris) - -struct BurnDriver BurnDrvRocktris = { - "rocktris", NULL, NULL, NULL, "1994", - "Rock Tris\0", NULL, "Yun Sung", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0, - NULL, rocktrisRomInfo, rocktrisRomName, NULL, NULL, RocktrisInputInfo, RocktrisDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, - 384, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/d_zerozone.cpp b/jan/src/burn/drv/pst90s/d_zerozone.cpp deleted file mode 100644 index 6e0b8f444..000000000 --- a/jan/src/burn/drv/pst90s/d_zerozone.cpp +++ /dev/null @@ -1,554 +0,0 @@ -// FB Alpha Zero Zone driver module -// Based on MAME driver by Brad Oliver - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvSndROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvVidRAM; -static UINT32 *DrvPalette; -static UINT32 *Palette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[4]; - -static UINT8 soundlatch; -static UINT8 tilebank; - -static struct BurnInputInfo DrvInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 1, "p2 coin" }, - - {"P1 Start" , BIT_DIGITAL , DrvJoy1 + 3, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , DrvJoy2 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy2 + 2, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy2 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy2 + 5, "p1 fire 2"}, - {"P1 Score Line (cheat)" , BIT_DIGITAL , DrvJoy2 + 6, "p1 fire 3"}, - - {"P2 Start" , BIT_DIGITAL , DrvJoy1 + 4, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 11, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy2 + 10, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 9, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 8, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 12, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 13, "p2 fire 2"}, - {"P2 Score Line (cheat)" , BIT_DIGITAL , DrvJoy2 + 14, "p2 fire 3"}, - - {"Service" , BIT_DIGITAL , DrvJoy4 + 7, "service" }, - - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x14, 0xff, 0xff, 0xdf, NULL }, - {0x15, 0xff, 0xff, 0xf7, NULL }, - - {0x14, 0xfe, 0, 8, "Coinage" }, - {0x14, 0x01, 0x07, 0x00, "5C 1C" }, - {0x14, 0x01, 0x07, 0x01, "4C 1C" }, - {0x14, 0x01, 0x07, 0x02, "3C 1C" }, - {0x14, 0x01, 0x07, 0x03, "2C 1C" }, - {0x14, 0x01, 0x07, 0x07, "1C 1C" }, - {0x14, 0x01, 0x07, 0x06, "1C 2C" }, - {0x14, 0x01, 0x07, 0x05, "1C 3C" }, - {0x14, 0x01, 0x07, 0x04, "1C 4C" }, - - {0x14, 0xfe, 0, 2, "Difficulty" }, - {0x14, 0x01, 0x08, 0x08, "In Game Default" }, - {0x14, 0x01, 0x08, 0x00, "Always Hard" }, - - {0x14, 0xfe, 0, 2, "Speed" }, - {0x14, 0x01, 0x10, 0x10, "Normal" }, - {0x14, 0x01, 0x10, 0x00, "Fast" }, - - {0x14, 0xfe, 0, 2, "Demo Sounds" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0x15, 0xfe, 0, 2, "Helps" }, - {0x15, 0x01, 0x04, 0x04, "1" }, - {0x15, 0x01, 0x04, 0x00, "2" }, - - {0x15, 0xfe, 0, 2, "Bonus Help" }, - {0x15, 0x01, 0x08, 0x00, "30000" }, - {0x15, 0x01, 0x08, 0x08, "None" }, - - {0x15, 0xfe, 0, 2, "Activate 'Score Line'? (Cheat)" }, - {0x15, 0x01, 0x10, 0x10, "No" }, - {0x15, 0x01, 0x10, 0x00, "Yes" }, -}; - -STDDIPINFO(Drv) - -UINT8 __fastcall zerozone_read_byte(UINT32 address) -{ - switch (address) - { - case 0x080000: - case 0x080001: - return DrvInputs[0] >> ((~address & 1) << 3); - - case 0x080002: - case 0x080003: - return DrvInputs[1] >> ((~address & 1) << 3); - - case 0x080008: - case 0x080009: - return DrvInputs[2] >> ((~address & 1) << 3); - - case 0x08000a: - case 0x08000b: - return DrvInputs[3] >> ((~address & 1) << 3); - } - - return 0; -} - -UINT16 __fastcall zerozone_read_word(UINT32 address) -{ - switch (address) - { - case 0x080000: - return DrvInputs[0]; - - case 0x080002: - return DrvInputs[1]; - - case 0x080008: - return DrvInputs[2]; - - case 0x08000a: - return DrvInputs[3]; - } - - return 0; -} - -static void palette_write(INT32 offset) -{ - UINT8 r, b, g; - UINT16 data = *((UINT16*)(DrvPalRAM + offset)); - - r = (data >> 11) & 0x1e; - r |= (data >> 3) & 0x01; - r = (r << 3) | (r >> 2); - - g = (data >> 7) & 0x1e; - g |= (data >> 2) & 0x01; - g = (g << 3) | (g >> 2); - - b = (data >> 3) & 0x1e; - b |= (data >> 1) & 0x01; - b = (b << 3) | (b >> 2); - - Palette[offset>>1] = (r << 16) | (g << 8) | b; - DrvPalette[offset>>1] = BurnHighCol(r, g, b, 0); - - return; -} - -void __fastcall zerozone_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xffe00) == 0x88000) { - *((UINT16*)(DrvPalRAM + (address & 0x1fe))) = data; - palette_write(address & 0x1fe); - return; - } - - switch (address) - { - case 0x84000: - soundlatch = data >> 8; - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - return; - - case 0xb4000: - tilebank = data & 7; - return; - } - - return; -} - -void __fastcall zerozone_write_byte(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x84000: - soundlatch = data; - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - return; - - case 0xb4001: - tilebank = data & 7; - return; - } - - return; -} - -void __fastcall zerozone_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9800: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall zerozone_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9800: - return MSM6295ReadStatus(0); - - case 0xa000: - return soundlatch; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - soundlatch = 0; - tilebank = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x020000; - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM = Next; Next += 0x100000; - - MSM6295ROM = Next; - DrvSndROM = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x000200; - DrvVidRAM = Next; Next += 0x004000; - - DrvZ80RAM = Next; Next += 0x000800; - - Palette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0, 1, 2, 3 }; - INT32 XOffs[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; - INT32 YOffs[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM, 0x80000); - - GfxDecode(0x4000, 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 1, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM, 3, 1)) return 1; - - if (BurnLoadRom(DrvSndROM, 4, 1)) return 1; - if (BurnLoadRom(DrvSndROM + 0x20000, 5, 1)) return 1; - - DrvGfxDecode(); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x088000, 0x0881ff, MAP_ROM); - SekMapMemory(DrvVidRAM, 0x09ce00, 0x09ffff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x0c0000, 0x0cffff, MAP_RAM); - SekSetWriteByteHandler(0, zerozone_write_byte); - SekSetWriteWordHandler(0, zerozone_write_word); - SekSetReadByteHandler(0, zerozone_read_byte); - SekSetReadWordHandler(0, zerozone_read_word); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetWriteHandler(zerozone_sound_write); - ZetSetReadHandler(zerozone_sound_read); - ZetClose(); - - MSM6295Init(0, 1056000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - MSM6295Exit(0); - SekExit(); - ZetExit(); - - BurnFree (AllMem); - - MSM6295ROM = NULL; - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x100; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - } - - UINT16 *vram = (UINT16*)DrvVidRAM; - - for (INT32 offs = 0; offs < 0x800; offs++) - { - INT32 sy = (offs & 0x1f) << 3; - INT32 sx = (offs >> 5) << 3; - - sy -= 16; - sx -= 8; - if (sy < 0 || sx < 0 || sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs]) & 0x7ff; - INT32 color = BURN_ENDIAN_SWAP_INT16(vram[offs]) >> 12; - - code += tilebank * (BURN_ENDIAN_SWAP_INT16(vram[offs]) & 0x800); - - Render8x8Tile(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = ~0; - DrvInputs[1] = ~0; - DrvInputs[2] = 0x00ff | (DrvDips[1] << 8); - DrvInputs[3] = 0xff00 | DrvDips[0]; - - for (INT32 i = 0; i < 16; i++) - { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 10; - INT32 nTotalCycles[2] = { 10000000 / 60, 1000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = (nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i); - - nCyclesDone[0] += SekRun(nSegment); - - nSegment = (nTotalCycles[1] - nCyclesDone[1]) / (nInterleave - i); - - nCyclesDone[1] += ZetRun(nSegment); - } - - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029692; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - MSM6295Scan(0, nAction); - - SCAN_VAR(soundlatch); - SCAN_VAR(tilebank); - } - - return 0; -} - - -// Zero Zone - -static struct BurnRomInfo zerozoneRomDesc[] = { - { "zz-4.rom", 0x10000, 0x83718b9b, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "zz-5.rom", 0x10000, 0x18557f41, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "zz-1.rom", 0x08000, 0x223ccce5, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "zz-6.rom", 0x80000, 0xc8b906b9, 3 | BRF_GRA }, // 3 - Tiles - - { "zz-2.rom", 0x20000, 0xc7551e81, 4 | BRF_SND }, // 4 - MSM6295 Samples - { "zz-3.rom", 0x20000, 0xe348ff5e, 4 | BRF_SND }, // 5 -}; - -STD_ROM_PICK(zerozone) -STD_ROM_FN(zerozone) - -struct BurnDriver BurnDrvZerozone = { - "zerozone", NULL, NULL, NULL, "1993", - "Zero Zone\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, zerozoneRomInfo, zerozoneRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 368, 224, 4, 3 -}; - - -// Las Vegas Girl (Girl '94) - -static struct BurnRomInfo lvgirl94RomDesc[] = { - { "rom4", 0x10000, 0xc4fb449e, 1 | BRF_PRG | BRF_ESS }, // 0 - 68k Code - { "rom5", 0x10000, 0x5d446a1a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "rom1", 0x08000, 0x223ccce5, 2 | BRF_PRG | BRF_ESS }, // 2 - Z80 Code - - { "rom6", 0x40000, 0xeeeb94ba, 3 | BRF_GRA }, // 3 - Tiles - - { "rom2", 0x20000, 0xc7551e81, 4 | BRF_SND }, // 4 - MSM6295 Samples - { "rom3", 0x20000, 0xe348ff5e, 4 | BRF_SND }, // 5 -}; - -STD_ROM_PICK(lvgirl94) -STD_ROM_FN(lvgirl94) - -struct BurnDriver BurnDrvLvgirl94 = { - "lvgirl94", NULL, NULL, NULL, "1994", - "Las Vegas Girl (Girl '94)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0, - NULL, lvgirl94RomInfo, lvgirl94RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 368, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/pst90s/kanekotb.h b/jan/src/burn/drv/pst90s/kanekotb.h deleted file mode 100644 index 80739b2ca..000000000 --- a/jan/src/burn/drv/pst90s/kanekotb.h +++ /dev/null @@ -1,4714 +0,0 @@ -/* - TODO: - - bonkadv_mcu_43: extract data from MCU (dumped eeprom data for now) - - bloodwar: verify all extracted data against real board (WIP) -*/ - -/*************************************************************************** - - TOYBOX MCU data for Bonk's Adventure - -***************************************************************************/ - -// notes based on test programs results, verified on PCB: -// - bonkadv_mcu_4_30 is the only cmd that ouputs an odd (655) number of bytes -// - bonkadv_mcu_4_33: the 32 'zeroed' bytes every 64 bytes are effectively written by the MCU - -// MCU executed command: 4300 0100 - factory settings -// this command is issued whenever the nvram settings are corrupted -// the MCU writes directly to NVRAM -static UINT16 bonkadv_mcu_43[] = { - 0x8BE0,0x8E71,0x0102,0x0102,0x0300,0x010C,0x0202,0x0202, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0030,0x0020,0x4F6B,0x0305,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0082,0x6F82,0x628C,0xB490,0x6CAB -}; - -// MCU executed command: 0400 0E00 0034 - code -/* -200E00: 7071 moveq #$71, D0 -200E02: 7273 moveq #$73, D1 -200E04: 7475 moveq #$75, D2 -200E06: 7677 moveq #$77, D3 -200E08: 7879 moveq #$79, D4 -200E0A: 7A7B moveq #$7b, D5 -200E0C: 7C7D moveq #$7d, D6 -200E0E: 7E7F moveq #$7f, D7 -200E10: 4E75 rts -*/ -static UINT16 bonkadv_mcu_4_34[] = { - 0x7071,0x7273,0x7475,0x7677,0x7879,0x7a7b,0x7c7d,0x7e7f, - 0x4e75 -}; -// MCU executed command: 0400 0180 0032 - 128 bytes at $200180 -static UINT16 bonkadv_mcu_4_32[] = { - 0x00cc,0xcc0c,0xc0c0,0xc080,0x0484,0xb6a6,0x0404,0x80c0, - 0x80b1,0xb1a1,0xa1b2,0xa2b3,0xb3a3,0xa3b1,0xb1b1,0xb1c0, - 0xc0a1,0xa1a1,0xa1b2,0xb2a2,0xa290,0x9090,0xb9b9,0xa9a9, - 0xbaaa,0xbbbb,0xabab,0xb9b9,0xb9b9,0xc8c8,0xa9a9,0xa9a9, - 0xbaba,0xaaaa,0x9898,0x98b9,0xb9a9,0xa9ba,0xaabb,0xbbab, - 0xabb9,0xb9b9,0xb9c8,0xc8a9,0xa9a9,0xa9ba,0xbaaa,0xaa98, - 0x9898,0xb1b1,0xa1a1,0xb2a2,0xb3b3,0xa3a3,0xb1b1,0xb1b1, - 0xc0c0,0xa1a1,0xa1a1,0xb2b2,0xa2a2,0x9090,0x9000,0x0000 -}; -// MCU executed command: 0400 0280 0031 - 112 bytes at $200280 -static UINT16 bonkadv_mcu_4_31[] = { - 0x1013,0x1411,0x1216,0x1519,0x1a17,0x1824,0x2322,0x211f, - 0x201e,0x1d1c,0x1b27,0x2825,0x2629,0x2a2b,0x2e2f,0x2c2d, - 0x3130,0x3435,0x3233,0x3f3e,0x3d3c,0x3a3b,0x3938,0x3736, - 0x4243,0x4041,0x4445,0x4649,0x4a47,0x484c,0x4b4f,0x504d, - 0x4e5a,0x5958,0x5755,0x5654,0x5352,0x515d,0x5e5b,0x5c5f, - 0x6061,0x6465,0x6263,0x6766,0x6a6b,0x6869,0x7574,0x7372, - 0x7071,0x6f6e,0x6d6c,0x7879,0x7677,0x7a7b,0x7c7d,0x7e7f -}; -// MCU executed command: 0400 0E50 0030 - 655 bytes at $200E50 (656 here) -static UINT16 bonkadv_mcu_4_30[] = { - 0x8c00,0x9700,0xa000,0xa700,0xb200,0xb700,0xc000,0xcc00, - 0xd600,0xdf00,0xef00,0xf500,0xfd00,0x0501,0x0b01,0x1801, - 0x1e01,0x2901,0x3101,0x3701,0x4101,0x4901,0x0b01,0x5d01, - 0xa700,0xb200,0x6c01,0x8101,0xb200,0x8101,0x8101,0x8101, - 0x8101,0x8101,0x8101,0x8101,0x8101,0x8101,0x8101,0x8101, - 0x8101,0x8101,0x8101,0x8101,0x8101,0x8101,0x8101,0x8101, - 0x8101,0x8101,0x8101,0x8101,0x8101,0x8101,0x8101,0x2e02, - 0x3602,0x3d02,0x4102,0x4f02,0x5502,0x5502,0x5f02,0x6402, - 0x6d02,0x7302,0x7802,0x7d02,0x8302,0x8a02,0x0165,0x712b, - 0x57fe,0x57a2,0xff00,0x0003,0x7c3a,0x436c,0x66ff,0x0000, - 0x026c,0x6d43,0xff00,0x0000,0x74a5,0x8373,0x3599,0x9fff, - - 0x0000,0x074a,0xff00,0x0002,0x8788,0x3331,0x32ff,0x0000, - 0x0276,0x8c71,0x2d8c,0xfe12,0x8cff,0x0000,0x0171,0x0d29, - 0xfe0d,0x29ff,0x0000,0x0559,0x5a5b,0x8a8b,0xff00,0x0003, - 0x0d0e,0x576a,0x641e,0xfe0d,0x0efe,0x64a3,0xff00,0x0006, - 0x0262,0xff00,0x0007,0x3e3f,0x7a7b,0xff00,0x0007,0x7584, - 0x4c53,0xff00,0x0001,0x6645,0xff00,0x0007,0x0d18,0x2984, - 0x5384,0xfe0d,0x29ff,0x0000,0x0457,0x5cff,0x0000,0x0751, - 0x5202,0x45fe,0x4575,0xff00,0x0000,0x191a,0x1b6e,0xff00, - 0x0006,0x3472,0xff00,0x0000,0x6569,0x090f,0x8b23,0xff00, - 0x0004,0x3b3c,0x3d79,0xff00,0x0080,0x770a,0x8176,0x2a65, - 0x64fe,0x7776,0xfe2a,0x76fe,0x650a,0xff00,0x0000,0x1011, - 0x1226,0x2728,0xa655,0x940f,0x68ff,0x0000,0x8045,0x6477, - 0x0a81,0x762a,0x65fe,0x7776,0xfe2a,0x76fe,0x650a,0xff00, - 0x0000,0x166b,0xff00,0x0007,0x1e30,0x39ff,0x0000,0x0345, - 0x3a77,0x7843,0x4647,0xff00,0x0000,0x7335,0x8399,0x9fff, - 0x0000,0x0237,0x38ff,0x0000,0x0044,0x303b,0xff00,0x0000, - - 0x7d7e,0x7fa1,0x0aff,0x0000,0x0070,0xff00,0x0000,0x3e3f, - 0x7a7b,0x6180,0x89a4,0xff00,0x0006,0x86a5,0x4f42,0xff00, - 0x0000,0x1011,0x1255,0x0f68,0xff00,0x0002,0x8788,0x4033, - 0xff00,0x0005,0x650f,0xff00,0x0008,0x9596,0x9ba7,0xff00, - 0x0000,0x4849,0x82ff,0x0000,0x022e,0x2f30,0xff00,0x0001, - 0x7778,0x5826,0x2728,0xa6ff,0x0000,0x0813,0x1402,0x51ff, - 0x0000,0x072e,0x5c5d,0xff00,0x0006,0x57ff,0x0000,0x0230, - 0x391e,0x65fe,0x6530,0xff00,0x0000,0x4bff,0x0000,0x008e, - 0x8f90,0x91ff,0x0000,0x0092,0x9d17,0xff00,0x0000,0xff00, - 0x0000,0x8d9b,0xa77d,0x7e7f,0xa10a,0x9596,0xff00,0x0001, - 0x1993,0xff00,0x0000,0x67ff,0x0000,0x0067,0xff00,0x0000, - 0x27ff,0x0000,0x0390,0x8e23,0x978b,0xff00,0x0000,0x1d9e, - 0xff00,0x0007,0x3bff,0x0000,0x001d,0xff00,0x0000,0x8e90, - 0xff00,0x0005,0x2495,0x96ff,0x0000,0x009a,0xff00,0x0000 -}; -// MCU executed command: 0400 0400 0033 - 2560 bytes at $200400 -static UINT16 bonkadv_mcu_4_33[] = { - 0x00a4,0x0001,0x00a5,0x005a,0x00a6,0x0074,0x00a7,0x009b, - 0x00a8,0x00d0,0x00a9,0x00fe,0x00aa,0x015d,0x00ab,0x01b0, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0001,0x0002,0x0019,0x005b,0x0022,0x0075,0x002d,0x009c, - 0x0041,0x00d1,0x004e,0x00ff,0x0060,0x015f,0x0072,0x01b1, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0002,0x0008,0x001a,0x0061,0x0023,0x007b,0x002e,0x00a2, - 0x0042,0x00d7,0x004f,0x0107,0x0061,0x0165,0x0073,0x01b7, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x000a,0x0000,0x0063,0x0000,0x007d,0x0000,0x00a4, - 0x0000,0x00d9,0x0000,0x0109,0x0000,0x0167,0x0000,0x01b9, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - 0x0003,0x000b,0x001b,0x0064,0x0024,0x007e,0x002f,0x00a5, - 0x0043,0x00da,0x0050,0x010a,0x0062,0x0168,0x0074,0x01ba, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x000c,0x0000,0x0065,0x0000,0x007f,0x0000,0x00a6, - 0x0000,0x00db,0x0000,0x010b,0x0000,0x0169,0x0000,0x01bb, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0004,0x0008,0x001c,0x0061,0x0025,0x007b,0x0030,0x00a2, - 0x0044,0x00d7,0x0051,0x0107,0x0063,0x0165,0x0075,0x01b7, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0005,0x000d,0x001d,0x0066,0x0025,0x007b,0x0031,0x00a7, - 0x0045,0x00dc,0x0051,0x0107,0x0063,0x0165,0x0075,0x01b7, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - 0x0000,0x0017,0x0000,0x0069,0x0000,0x0089,0x0000,0x00af, - 0x0000,0x00df,0x0000,0x0115,0x0000,0x0173,0x0000,0x01c5, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0009,0x0015,0x001e,0x0067,0x0029,0x0087,0x0034,0x00ad, - 0x0046,0x00dd,0x0055,0x0113,0x0067,0x0171,0x0079,0x01c3, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0006,0x000e,0x0006,0x000e,0x0026,0x0080,0x0006,0x000e, - 0x0000,0x0000,0x0052,0x010c,0x0064,0x016a,0x0076,0x01bc, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0007,0x0010,0x0007,0x0010,0x0027,0x0082,0x0032,0x00a8, - 0x0000,0x0000,0x0053,0x010e,0x0065,0x016c,0x0077,0x01be, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - 0x0000,0x0013,0x0000,0x0013,0x0000,0x0085,0x0000,0x00ab, - 0x0000,0x0000,0x0000,0x0111,0x0000,0x016f,0x0000,0x01c1, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0008,0x0014,0x0008,0x0014,0x0028,0x0086,0x0033,0x00ac, - 0x0000,0x0000,0x0054,0x0112,0x0066,0x0170,0x0078,0x01c2, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0018,0x0000,0x006a,0x0000,0x008a,0x0000,0x00b0, - 0x0000,0x00e0,0x0000,0x0116,0x0000,0x0174,0x0000,0x01c6, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x000c,0x0000,0x0065,0x0000,0x007f,0x0000,0x00a6, - 0x0000,0x00db,0x0000,0x010b,0x0000,0x0169,0x0000,0x01bb, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - 0x000a,0x0019,0x001f,0x006b,0x002a,0x008b,0x0035,0x00b1, - 0x0047,0x00e1,0x0056,0x0117,0x0068,0x0175,0x007a,0x01c7, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x000b,0x0019,0x0020,0x006b,0x002b,0x008b,0x0036,0x00b1, - 0x0048,0x00e1,0x0057,0x0117,0x0069,0x0175,0x007a,0x01c7, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0015,0x003e,0x0015,0x003e,0x0099,0x0095,0x0015,0x003e, - 0x0000,0x0000,0x009e,0x013a,0x006d,0x018f,0x007e,0x01dc, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x000c,0x001d,0x000c,0x001d,0x000c,0x001d,0x000c,0x001d, - 0x0049,0x00e5,0x0058,0x011b,0x006a,0x0179,0x007b,0x01c9, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - 0x0000,0x001f,0x0000,0x001f,0x0000,0x001f,0x0000,0x001f, - 0x0000,0x00e7,0x0000,0x011d,0x0000,0x017b,0x0000,0x01cb, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x000d,0x0020,0x0021,0x006f,0x002c,0x008f,0x0037,0x00b5, - 0x004a,0x00e8,0x0059,0x011e,0x006b,0x017c,0x007c,0x01cc, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0022,0x0000,0x0071,0x0000,0x0091,0x0000,0x00b7, - 0x0000,0x00ea,0x0000,0x0120,0x0000,0x017e,0x0000,0x01ce, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0014,0x003b,0x0014,0x003b,0x005d,0x0092,0x0014,0x003b, - 0x0014,0x003b,0x009d,0x0137,0x00a0,0x018c,0x00a1,0x01d9, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - 0x0012,0x0036,0x0012,0x0036,0x0012,0x0036,0x0012,0x0036, - 0x008a,0x00e5,0x00be,0x013c,0x006c,0x0184,0x007d,0x01d1, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0013,0x0038,0x0013,0x0038,0x0013,0x0038,0x0013,0x0038, - 0x008a,0x00e5,0x00bf,0x013d,0x006c,0x0184,0x007d,0x01d1, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0038,0x00ba,0x0038,0x00ba,0x0038,0x00ba,0x0038,0x00ba, - 0x0038,0x00ba,0x00a2,0x0128,0x006e,0x019c,0x007f,0x01e7, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x005c,0x014d,0x005c,0x014d,0x005c,0x014d,0x005c,0x014d, - 0x0000,0x0000,0x009c,0x0124,0x0071,0x01a5,0x0082,0x01f0, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - 0x005b,0x014d,0x005b,0x014d,0x005b,0x014d,0x005b,0x014d, - 0x0000,0x0000,0x009b,0x0124,0x0070,0x01a1,0x0081,0x01ec, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0044,0x0000,0x0044,0x0000,0x0044,0x0000,0x0044, - 0x0000,0x00db,0x0000,0x010b,0x0000,0x0169,0x0000,0x01bb, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0018,0x0045,0x0018,0x0045,0x0018,0x0045,0x0018,0x0045, - 0x0044,0x00d7,0x0051,0x0107,0x0063,0x0165,0x0075,0x01b7, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x008b,0x000e,0x008b,0x000e,0x008c,0x0080,0x008b,0x000e, - 0x0000,0x0000,0x008d,0x010c,0x008e,0x016a,0x008f,0x01bc, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - 0x0090,0x0010,0x0090,0x0010,0x0091,0x0082,0x0092,0x00a8, - 0x0000,0x0000,0x0093,0x010e,0x0094,0x016c,0x0095,0x01be, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0096,0x003e,0x0096,0x003e,0x009a,0x0095,0x0096,0x003e, - 0x0000,0x0000,0x009f,0x013a,0x0097,0x018f,0x0098,0x01dc, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0049,0x0000,0x0069,0x0000,0x0098,0x0000,0x00af, - 0x0000,0x00df,0x0000,0x0145,0x0000,0x0173,0x0000,0x01c5, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x005e,0x0048,0x005f,0x0068,0x006f,0x0097,0x0080,0x00ae, - 0x00ac,0x00de,0x00ad,0x0144,0x00ae,0x0172,0x00af,0x01c4, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - - 0x004b,0x00ed,0x004b,0x00ed,0x004b,0x00ed,0x004b,0x00ed, - 0x004b,0x00ed,0x00b0,0x012b,0x00b6,0x0186,0x00ba,0x01d3, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0087,0x00f2,0x0087,0x00f2,0x0087,0x00f2,0x0087,0x00f2, - 0x0087,0x00f2,0x00b3,0x0130,0x00b8,0x018b,0x00bc,0x01d8, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x00c1,0x0050,0x00c1,0x0050,0x00c1,0x0050,0x00c1,0x0050, - 0x00c1,0x0050,0x00c3,0x0148,0x00c5,0x019a,0x00c7,0x01e5, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x00c2,0x0050,0x00c2,0x0050,0x00c2,0x0050,0x00c2,0x0050, - 0x00c2,0x0050,0x00c4,0x0148,0x00c6,0x019a,0x00c8,0x01e5, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, - 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 -}; -// dynamic, per-level (29), in level order -// PC=078896 : MCU executed command: 0400 0300 00xx - xx = subcmd -static UINT16 bonkadv_mcu_4_00[] = { 0x0000,0x04C0,0x0000,0x0100,0x0600,0x0100 }; -static UINT16 bonkadv_mcu_4_02[] = { 0x0000,0x0760,0x0000,0x0100,0x0270,0x0100,0x0320,0x01B0, - 0x0460,0x01B0,0x0510,0x0100,0x05E0,0x0100,0x0620,0x0120, - 0x08A0,0x0120 }; -static UINT16 bonkadv_mcu_4_01[] = { 0x0000,0x0670,0x0000,0x0100,0x0200,0x0100,0x02E0,0x0090, - 0x0400,0x0090,0x04E0,0x0100,0x07B0,0x0100 }; -static UINT16 bonkadv_mcu_4_05[] = { 0x0000,0x0610,0x0000,0x0100,0x0750,0x0100 }; -static UINT16 bonkadv_mcu_4_07[] = { 0x0000,0x03C0,0x0000,0x0100,0x0500,0x0100 }; -static UINT16 bonkadv_mcu_4_06[] = { 0x0000,0x05F0,0x0000,0x0100,0x0730,0x0100 }; -static UINT16 bonkadv_mcu_4_09[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 }; -static UINT16 bonkadv_mcu_4_0D[] = { 0x0000,0x07A0,0x0000,0x0100,0x08E0,0x0100 }; -static UINT16 bonkadv_mcu_4_03[] = { 0x0000,0x0920,0x0000,0x0100,0x0A60,0x0100 }; -static UINT16 bonkadv_mcu_4_08[] = { 0x0000,0x0730,0x0000,0x0100,0x0870,0x0100 }; -static UINT16 bonkadv_mcu_4_04[] = { 0x0000,0x05C0,0x0000,0x0100,0x0200,0x0100,0x0280,0x00C0, - 0x02E0,0x0060,0x03A0,0x0000,0x0700,0x0000 }; -static UINT16 bonkadv_mcu_4_0C[] = { 0x0000,0x06E0,0x0000,0x0100,0x0820,0x0100 }; -static UINT16 bonkadv_mcu_4_0A[] = { 0x0000,0x05A0,0x0000,0x0100,0x06E0,0x0100 }; -static UINT16 bonkadv_mcu_4_0B[] = { 0x0000,0x0470,0x0000,0x0100,0x05B0,0x0100 }; -static UINT16 bonkadv_mcu_4_10[] = { 0x0000,0x06C0,0x0000,0x0100,0x03B0,0x0100,0x0460,0x0050, - 0x05E0,0x0050,0x0650,0xFFE0,0x0800,0xFFE0 }; -static UINT16 bonkadv_mcu_4_0E[] = { 0x0000,0x0630,0x0000,0x0100,0x0770,0x0100 }; -static UINT16 bonkadv_mcu_4_13[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 }; -static UINT16 bonkadv_mcu_4_0F[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 }; -static UINT16 bonkadv_mcu_4_11[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 }; -static UINT16 bonkadv_mcu_4_14[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 }; -static UINT16 bonkadv_mcu_4_12[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 }; -static UINT16 bonkadv_mcu_4_17[] = { 0x0000,0x0520,0x0000,0x0100,0x0660,0x0100 }; -static UINT16 bonkadv_mcu_4_1A[] = { 0x0000,0x03C0,0x0000,0x0100,0x0500,0x0100 }; -static UINT16 bonkadv_mcu_4_15[] = { 0x0000,0x02C0,0x0000,0x0100,0x0400,0x0100 }; -static UINT16 bonkadv_mcu_4_18[] = { 0x0000,0x03C0,0x0000,0x0100,0x0500,0x0100 }; -static UINT16 bonkadv_mcu_4_16[] = { 0x0000,0x02F0,0x0000,0x0100,0x0430,0x0100 }; -static UINT16 bonkadv_mcu_4_19[] = { 0x0000,0x03A0,0x0000,0x0100,0x04E0,0x0100 }; -static UINT16 bonkadv_mcu_4_1B[] = { 0x0000,0x0460,0x0000,0x0100,0x05A0,0x0100 }; -static UINT16 bonkadv_mcu_4_1C[] = { 0x0000,0x02C0,0x0000,0x0100,0x0400,0x0100 }; - - -/*************************************************************************** - - TOYBOX MCU data for Blood Warrior - -***************************************************************************/ - -// bloodwar MCU writes by 16-bytes block, and data seems to be contiguous? -// unknown data: the last 4 words of a cmd are the 4 firsts of the next one -// palette data: when the negative word is not on a 16-bytes boundary, -// it is followed by the first bytes of the next palette -// unknown data are followed by tilemap (last tilemap ends with 0xff) -// palette (last ends with: 0x0004,0xce4a,0x0004 ???) -// fighter: order is unclear - cmd 26 is probably the last (ends with 0xff) - -// --- unknown data --- -static UINT16 bloodwar_mcu_4_01[] = { 0x00E6,0x00C6,0x00E8,0x00D0,0xFC9A,0x05C0,0x0F00,0x08C0, // Warrior 1 - 0x0001,0x0120,0x0090,0x021B,0x00B4,0x0094,0x00AC,0x0094 }; -static UINT16 bloodwar_mcu_4_02[] = { 0x00B4,0x0094,0x00AC,0x0094,0xFCD2,0x03C0,0x1000,0x0900, // Warrior 2 - 0x0001,0x0100,0x0080,0x0118,0x00F0,0x00D0,0x00F4,0x00DC }; -static UINT16 bloodwar_mcu_4_03[] = { 0x00F0,0x00D0,0x00F4,0x00DC,0xFC90,0x03C0,0x0C00,0x0CC0, // Warrior 3 - 0x0001,0x0200,0x0100,0x0930,0x00D2,0x00B2,0x00CA,0x00B0 }; -static UINT16 bloodwar_mcu_4_04[] = { 0x00D2,0x00B2,0x00CA,0x00B0,0xFCB5,0x05C0,0x1000,0x0C00, // Warrior 4 - 0x0001,0x0140,0x00A0,0x031E,0x00A0,0x0080,0x00DC,0x00C4 }; -static UINT16 bloodwar_mcu_4_05[] = { 0x00A0,0x0080,0x00DC,0x00C4,0xFCA2,0x05C0,0x0AC0,0x0880, // Warrior 5 - 0x0001,0x01A0,0x00D0,0x0627,0x00BE,0x009E,0x00C2,0x00A8 }; -static UINT16 bloodwar_mcu_4_06[] = { 0x00BE,0x009E,0x00C2,0x00A8,0xFCBF,0x04C0,0x1100,0x0C00, // Warrior 6 - 0x0001,0x0180,0x00C0,0x0524,0x00C8,0x00A8,0x00D6,0x009C }; -static UINT16 bloodwar_mcu_4_07[] = { 0x00C8,0x00A8,0x00D6,0x009C,0xFCC8,0x05C0,0x0F40,0x0CC0, // Warrior 7 - 0x0001,0x0160,0x00B0,0x0421,0x00AA,0x008A,0x00A0,0x0086 }; -static UINT16 bloodwar_mcu_4_08[] = { 0x00AA,0x008A,0x00A0,0x0086,0xFCDB,0x05C0,0x1380,0x0F80, // Warrior 8 - 0x0000,0x01E0,0x00F0,0x082D,0x00DC,0x00BC,0x00D6,0x00BC }; -static UINT16 bloodwar_mcu_4_09[] = { 0x00DC,0x00BC,0x00D6,0x00BC,0xFCAC,0x04C0,0x10C0,0x1000, // Warrior 9 - 0x0001,0x01C0,0x00E0,0x072A,0xFF08,0xFF02,0x0000,0xFF03 }; - -// --- palette data --- -// number of palettes (>=1) -// palette data follows (each palette is 0x200 bytes long) -// a negative word will end the palette -static UINT16 bloodwar_mcu_4_0a[] = { // Warrior 1 Player 1 - 0x000B,0x0000,0x4232,0x56F8,0x2D8D,0x27FF,0x3BFF,0x53FF, - 0x63FF,0x381F,0x4C1F,0x581F,0x6C1F,0x7C1F,0x7E1F,0x7EBF, - 0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0, - 0x2DCF,0x258D,0x256D,0x190A,0x214D,0x214C,0x256E,0x1D4C, - 0x216C,0x216D,0x1D2B,0x192B,0x10E9,0x1D4B,0x1D2C,0x1509, - 0x10E8,0x14E9,0x1508,0x08A6,0x0CA6,0x1529,0x0CC7,0x10C8, - 0x0CA5,0x0CC3,0x0862,0x0882,0x0CA2,0x10C4,0x14E5,0x1927, - 0x1926,0x0CC5,0x2148,0x0CA4,0x1948,0x0CE3,0x0CE9,0x1509, - 0x14E7,0x1525,0x1D47,0x1103,0x1D64,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x2569,0x1906,0x1D67,0x10E7, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29A9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x67C8,0x67E8,0x67E9,0x6B8F,0x638A,0x5FCB,0x5B6B, - 0x6FCA,0x5BE8,0x4B48,0x67EE,0x5F8C,0x42A9,0x63CA,0x42C8, - 0x3666,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x5B67,0x5B87,0x4ACC,0x532D, - 0x4B0D,0x294A,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, - 0x0002,0x381F,0x4C1F,0x581F,0x6C1E,0x781E,0x7E1F,0x7EBF, - - 0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0, - 0x2DCF,0x258D,0x256D,0x190A,0x214D,0x214C,0x256E,0x1D4C, - 0x216C,0x216D,0x1D2B,0x192B,0x10E9,0x1D4B,0x1D2C,0x1509, - 0x10E8,0x14E9,0x1508,0x08A6,0x0CA6,0x1529,0x0CC7,0x10C8, - 0x0CA5,0x0CC3,0x0862,0x0882,0x0CA2,0x10C4,0x14E5,0x1927, - 0x1926,0x0CC5,0x2148,0x0CA4,0x1948,0x0CE3,0x0CE9,0x1509, - 0x14E7,0x1525,0x1D47,0x1103,0x1D64,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x2569,0x1906,0x1D67,0x10E7, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29A9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x67C8,0x67E8,0x67E9,0x6B8F,0x638A,0x5FCB,0x5B6B, - 0x6FCA,0x5BE8,0x4B48,0x67EE,0x5F8C,0x42A9,0x63CA,0x42C8, - 0x3666,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x5B67,0x5B87,0x4ACC,0x532D, - 0x4B0D,0x2D0C,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, - 0x0002,0x0360,0x13E0,0x2BE0,0x3BE9,0x4FEE,0x5FF3,0x6FF8, - 0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0, - 0x2DCF,0x258D,0x256D,0x190A,0x214D,0x214C,0x256E,0x1D4C, - - 0x216C,0x216D,0x1D2B,0x192B,0x10E9,0x1D4B,0x1D2C,0x1509, - 0x10E8,0x14E9,0x1508,0x08A6,0x0CA6,0x1529,0x0CC7,0x10C8, - 0x0CA5,0x0CC3,0x0862,0x0882,0x0CA2,0x10C4,0x14E5,0x1927, - 0x1926,0x0CC5,0x2148,0x0CA4,0x1948,0x0CE3,0x0CE9,0x1509, - 0x14E7,0x1525,0x1D47,0x1103,0x1D64,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x2569,0x1906,0x1D67,0x10E7, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29A9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x67C8,0x67E8,0x67E9,0x6B8F,0x638A,0x5FCB,0x5B6B, - 0x6FCA,0x5BE8,0x4B48,0x67EE,0x5F8C,0x42A9,0x63CA,0x42C8, - 0x3666,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x5B67,0x5B87,0x4ACC,0x532D, - 0x4B0D,0x4191,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, - 0x0002,0x2AC0,0x3700,0x47A0,0x5BC0,0x6FE4,0x7BEF,0x7FFB, - 0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0, - 0x2DCF,0x258D,0x256D,0x190A,0x214D,0x214C,0x256E,0x1D4C, - 0x216C,0x216D,0x1D2B,0x192B,0x10E9,0x1D4B,0x1D2C,0x1509, - 0x10E8,0x14E9,0x1508,0x08A6,0x0CA6,0x1529,0x0CC7,0x10C8, - - 0x0CA5,0x0CC3,0x0862,0x0882,0x0CA2,0x10C4,0x14E5,0x1927, - 0x1926,0x0CC5,0x2148,0x0CA4,0x1948,0x0CE3,0x0CE9,0x1509, - 0x14E7,0x1525,0x1D47,0x1103,0x1D64,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x2569,0x1906,0x1D67,0x10E7, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29A9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x67C8,0x67E8,0x67E9,0x6B8F,0x638A,0x5FCB,0x5B6B, - 0x6FCA,0x5BE8,0x4B48,0x67EE,0x5F8C,0x42A9,0x63CA,0x42C8, - 0x3666,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x5B67,0x5B87,0x4ACC,0x532D, - 0x4B0D,0x2D0C,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, - 0x0002,0x021C,0x0ABE,0x171E,0x275F,0x379F,0x4FBF,0x67BF, - 0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0, - 0x2DCF,0x258D,0x256D,0x190A,0x214D,0x214C,0x256E,0x1D4C, - 0x216C,0x216D,0x1D2B,0x192B,0x10E9,0x1D4B,0x1D2C,0x1509, - 0x10E8,0x14E9,0x1508,0x08A6,0x0CA6,0x1529,0x0CC7,0x10C8, - 0x0CA5,0x0CC3,0x0862,0x0882,0x0CA2,0x10C4,0x14E5,0x1927, - 0x1926,0x0CC5,0x2148,0x0CA4,0x1948,0x0CE3,0x0CE9,0x1509, - - 0x14E7,0x1525,0x1D47,0x1103,0x1D64,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x2569,0x1906,0x1D67,0x10E7, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29A9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x67C8,0x67E8,0x67E9,0x6B8F,0x638A,0x5FCB,0x5B6B, - 0x6FCA,0x5BE8,0x4B48,0x67EE,0x5F8C,0x42A9,0x63CA,0x42C8, - 0x3666,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x5B67,0x5B87,0x4ACC,0x532D, - 0x4B0D,0x35B3,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF,0x301F, - 0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF,0x7E9F, - 0x7BDE,0x1B01,0x23A0,0x2FC0,0x3BE0,0x43E0,0x4FC0,0x57C0, - 0x5FE0,0x63E0,0x67E0,0x6FE0,0x77EE,0x7FF3,0x7FFA,0x7FFC, - 0x7FFF,0x0220,0x0260,0x0280,0x02C0,0x02E0,0x0320,0x0340, - 0x2780,0x2BA0,0x37E0,0x3FE0,0x0340,0x0BE0,0x13E0,0x1DA3, - 0x2243,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409,0x4C07,0x5407, - 0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15,0x7EBA,0x7F5D, - 0x7BDE,0xFFFF,0x35B3,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF, - 0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF, - - 0x7E9F,0x7BDE,0x2AA1,0x3724,0x3FA6,0x43E0,0x4FE8,0x5BC4, - 0x63C5,0x67EB,0x67EB,0x67ED,0x6FF0,0x77F3,0x7FF7,0x7FFA, - 0x7FFC,0x7FFF,0x0220,0x0260,0x0280,0x02C0,0x02E0,0x0320, - 0x0340,0x2780,0x2BA0,0x37E0,0x3FE0,0x0340,0x0BE0,0x13E0, - 0x1DA3,0x2243,0xFFFF,0x41D3,0x01D1,0x0215,0x0A77,0x12B9, - 0x16FB,0x273C,0x375D,0x435E,0x4B7F,0x537F,0x5B9F,0x639F, - 0x6FBF,0x77DF,0x7FFF,0xFFFF,0x4191,0x0011,0x0016,0x001A, - 0x1C1D,0x281E,0x341D,0x401E,0x501E,0x581E,0x641E,0x6C1F, - 0x785F,0x7E5F,0x7F3F,0x7BDE,0xFFFF,0x4191,0x2000,0x2800, - 0x3000,0x3400,0x3800,0x4000,0x4800,0x5400,0x5C00,0x6821, - 0x7084,0x7D29,0x7E52,0x7F39,0x7BDE,0xFFFF,0x4191,0x1320, - 0x2340,0x2B60,0x3380,0x3FA0,0x47A0,0x4FC1,0x5BC0,0x67E2, - 0x6FE4,0x77E6,0x7BEF,0x7FF4,0x7FFB,0x7BDE,0xFFFF,0x000B -}; -static UINT16 bloodwar_mcu_4_0b[] = { // Warrior 1 Player 2 - 0x000B,0x292A,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x2E2A,0x29E9,0x2609,0x29E9,0x2629,0x2A4A,0x2A4B, - 0x260A,0x25E8,0x25C8,0x1965,0x21A8,0x21A7,0x25E8,0x1DA7, - 0x21A8,0x21A8,0x2186,0x1D86,0x1524,0x2187,0x2146,0x1925, - 0x1504,0x1924,0x18E5,0x0CE2,0x10E2,0x1926,0x10C3,0x14E3, - 0x1082,0x10A0,0x0C40,0x0C60,0x1080,0x14A1,0x18C2,0x1925, - 0x1924,0x0CC3,0x2146,0x0CA2,0x1D25,0x10C0,0x1104,0x1905, - 0x18C4,0x1523,0x1D45,0x1101,0x1D62,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x25A9,0x1906,0x1D67,0x1125, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29C9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x7F88,0x7F88,0x7EA9,0x7B73,0x7E68,0x72CB,0x66CB, - 0x772A,0x6348,0x52A8,0x6F4E,0x66EC,0x5669,0x6B2A,0x5288, - 0x4585,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x62C7,0x62E7,0x4ACC,0x532D, - 0x4B0D,0x294A,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, - 0x0002,0x381F,0x4C1F,0x581F,0x6C1E,0x781E,0x7E1F,0x7EBF, - - 0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0, - 0x2DCF,0x258D,0x256D,0x190A,0x214D,0x214C,0x256E,0x1D4C, - 0x216C,0x216D,0x1D2B,0x192B,0x10E9,0x1D4B,0x1D2C,0x1509, - 0x10E8,0x14E9,0x1508,0x08A6,0x0CA6,0x1529,0x0CC7,0x10C8, - 0x0CA5,0x0CC3,0x0862,0x0882,0x0CA2,0x10C4,0x14E5,0x1927, - 0x1926,0x0CC5,0x2148,0x0CA4,0x1948,0x0CE3,0x0CE9,0x1509, - 0x14E7,0x1525,0x1D47,0x1103,0x1D64,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x2569,0x1906,0x1D67,0x10E7, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29A9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x67C8,0x67E8,0x67E9,0x6B8F,0x638A,0x5FCB,0x5B6B, - 0x6FCA,0x5BE8,0x4B48,0x67EE,0x5F8C,0x42A9,0x63CA,0x42C8, - 0x3666,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x5B67,0x5B87,0x4ACC,0x532D, - 0x4B0D,0x2D0C,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, - 0x0002,0x0360,0x13E0,0x2BE0,0x3BE9,0x4FEE,0x5FF3,0x6FF8, - 0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0, - 0x2DCF,0x258D,0x256D,0x190A,0x214D,0x214C,0x256E,0x1D4C, - - 0x216C,0x216D,0x1D2B,0x192B,0x10E9,0x1D4B,0x1D2C,0x1509, - 0x10E8,0x14E9,0x1508,0x08A6,0x0CA6,0x1529,0x0CC7,0x10C8, - 0x0CA5,0x0CC3,0x0862,0x0882,0x0CA2,0x10C4,0x14E5,0x1927, - 0x1926,0x0CC5,0x2148,0x0CA4,0x1948,0x0CE3,0x0CE9,0x1509, - 0x14E7,0x1525,0x1D47,0x1103,0x1D64,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x2569,0x1906,0x1D67,0x10E7, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29A9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x67C8,0x67E8,0x67E9,0x6B8F,0x638A,0x5FCB,0x5B6B, - 0x6FCA,0x5BE8,0x4B48,0x67EE,0x5F8C,0x42A9,0x63CA,0x42C8, - 0x3666,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x5B67,0x5B87,0x4ACC,0x532D, - 0x4B0D,0x4191,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, - 0x0002,0x2AC0,0x3700,0x47A0,0x5BC0,0x6FE4,0x7BEF,0x7FFB, - 0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0, - 0x2DCF,0x258D,0x256D,0x190A,0x214D,0x214C,0x256E,0x1D4C, - 0x216C,0x216D,0x1D2B,0x192B,0x10E9,0x1D4B,0x1D2C,0x1509, - 0x10E8,0x14E9,0x1508,0x08A6,0x0CA6,0x1529,0x0CC7,0x10C8, - - 0x0CA5,0x0CC3,0x0862,0x0882,0x0CA2,0x10C4,0x14E5,0x1927, - 0x1926,0x0CC5,0x2148,0x0CA4,0x1948,0x0CE3,0x0CE9,0x1509, - 0x14E7,0x1525,0x1D47,0x1103,0x1D64,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x2569,0x1906,0x1D67,0x10E7, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29A9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x67C8,0x67E8,0x67E9,0x6B8F,0x638A,0x5FCB,0x5B6B, - 0x6FCA,0x5BE8,0x4B48,0x67EE,0x5F8C,0x42A9,0x63CA,0x42C8, - 0x3666,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x5B67,0x5B87,0x4ACC,0x532D, - 0x4B0D,0x2D0C,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002, - 0x0002,0x021C,0x0ABE,0x171E,0x275F,0x379F,0x4FBF,0x67BF, - 0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0, - 0x2DCF,0x258D,0x256D,0x190A,0x214D,0x214C,0x256E,0x1D4C, - 0x216C,0x216D,0x1D2B,0x192B,0x10E9,0x1D4B,0x1D2C,0x1509, - 0x10E8,0x14E9,0x1508,0x08A6,0x0CA6,0x1529,0x0CC7,0x10C8, - 0x0CA5,0x0CC3,0x0862,0x0882,0x0CA2,0x10C4,0x14E5,0x1927, - 0x1926,0x0CC5,0x2148,0x0CA4,0x1948,0x0CE3,0x0CE9,0x1509, - - 0x14E7,0x1525,0x1D47,0x1103,0x1D64,0x1D66,0x1D65,0x1945, - 0x1104,0x0CC2,0x0CE2,0x0D03,0x2569,0x1906,0x1D67,0x10E7, - 0x422F,0x6F79,0x6F59,0x6B57,0x6737,0x6B37,0x6F7A,0x737A, - 0x6B78,0x6B58,0x6F99,0x6F78,0x4EB0,0x4A90,0x3E4E,0x4A8F, - 0x2DC9,0x466E,0x4A8F,0x6736,0x6756,0x5733,0x4AAF,0x468E, - 0x424D,0x31EA,0x2DE9,0x29C9,0x2DCA,0x29A9,0x320A,0x362B, - 0x2DCB,0x360C,0x360D,0x320B,0x1D45,0x1D46,0x10E3,0x0CC3, - 0x35EA,0x35EB,0x2186,0x2587,0x29A8,0x1945,0x1D65,0x1D66, - 0x2166,0x0CC2,0x0CE3,0x1524,0x1103,0x1503,0x0D02,0x1123, - 0x1543,0x08A2,0x08C2,0x0D42,0x0862,0x1924,0x0CE2,0x1523, - 0x2168,0x19A5,0x3A8C,0x21E6,0x2A28,0x36AA,0x2646,0x2EA9, - 0x36EB,0x2AA7,0x2286,0x22A6,0x1EE6,0x1F06,0x42CE,0x5753, - 0x1A05,0x0E02,0x1A44,0x32C9,0x3AEC,0x2EA9,0x470F,0x2226, - 0x1183,0x2E8A,0x36CB,0x2246,0x0D42,0x1A05,0x2687,0x2AE9, - 0x2227,0x472D,0x430D,0x42EC,0x3288,0x4F4F,0x46CD,0x36AA, - 0x2E87,0x2A07,0x3249,0x3689,0x1142,0x25C7,0x1DA4,0x42CC, - - 0x366A,0x21A5,0x1984,0x470B,0x3EEA,0x430A,0x21C4,0x42CD, - 0x2E08,0x536E,0x2647,0x4F2F,0x5B72,0x3A8B,0x324A,0x21E5, - 0x2E29,0x67C8,0x67E8,0x67E9,0x6B8F,0x638A,0x5FCB,0x5B6B, - 0x6FCA,0x5BE8,0x4B48,0x67EE,0x5F8C,0x42A9,0x63CA,0x42C8, - 0x3666,0x2E05,0x2E06,0x1D63,0x4F4C,0x46B0,0x46CE,0x46EB, - 0x534D,0x29C4,0x25C3,0x3A88,0x5B67,0x5B87,0x4ACC,0x532D, - 0x4B0D,0x35B3,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF,0x301F, - 0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF,0x7E9F, - 0x7BDE,0x1B01,0x23A0,0x2FC0,0x3BE0,0x43E0,0x4FC0,0x57C0, - 0x5FE0,0x63E0,0x67E0,0x6FE0,0x77EE,0x7FF3,0x7FFA,0x7FFC, - 0x7FFF,0x0220,0x0260,0x0280,0x02C0,0x02E0,0x0320,0x0340, - 0x2780,0x2BA0,0x37E0,0x3FE0,0x0340,0x0BE0,0x13E0,0x1DA3, - 0x2243,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409,0x4C07,0x5407, - 0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15,0x7EBA,0x7F5D, - 0x7BDE,0xFFFF,0x35B3,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF, - 0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF, - - 0x7E9F,0x7BDE,0x2AA1,0x3724,0x3FA6,0x43E0,0x4FE8,0x5BC4, - 0x63C5,0x67EB,0x67EB,0x67ED,0x6FF0,0x77F3,0x7FF7,0x7FFA, - 0x7FFC,0x7FFF,0x0220,0x0260,0x0280,0x02C0,0x02E0,0x0320, - 0x0340,0x2780,0x2BA0,0x37E0,0x3FE0,0x0340,0x0BE0,0x13E0, - 0x1DA3,0x2243,0xFFFF,0x41D3,0x01D1,0x0215,0x0A77,0x12B9, - 0x16FB,0x273C,0x375D,0x435E,0x4B7F,0x537F,0x5B9F,0x639F, - 0x6FBF,0x77DF,0x7FFF,0xFFFF,0x4191,0x0011,0x0016,0x001A, - 0x1C1D,0x281E,0x341D,0x401E,0x501E,0x581E,0x641E,0x6C1F, - 0x785F,0x7E5F,0x7F3F,0x7BDE,0xFFFF,0x4191,0x2000,0x2800, - 0x3000,0x3400,0x3800,0x4000,0x4800,0x5400,0x5C00,0x6821, - 0x7084,0x7D29,0x7E52,0x7F39,0x7BDE,0xFFFF,0x4191,0x1320, - 0x2340,0x2B60,0x3380,0x3FA0,0x47A0,0x4FC1,0x5BC0,0x67E2, - 0x6FE4,0x77E6,0x7BEF,0x7FF4,0x7FFB,0x7BDE,0xFFFF,0x0004 -}; -static UINT16 bloodwar_mcu_4_0c[] = { // Warrior 5 Player 1 - 0x0004,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x1422,0x1423,0x2044,0x1803,0x1C23,0x2CA6,0x2445, - 0x2446,0x38CA,0x2C87,0x38EA,0x30A8,0x34A9,0x2C88,0x2887, - 0x2866,0x1824,0x3089,0x28A7,0x2466,0x2867,0x30C9,0x34E9, - 0x59F0,0x59D0,0x6212,0x6654,0x6211,0x5DF0,0x59CE,0x558D, - 0x518F,0x4D2F,0x492E,0x34AB,0x4D4E,0x55B1,0x40EB,0x5591, - 0x40CB,0x59B1,0x5590,0x450D,0x2865,0x5170,0x3D0D,0x2045, - 0x2046,0x51D0,0x4D8D,0x2885,0x30C8,0x3CEA,0x3CEB,0x38C9, - 0x3087,0x3088,0x2465,0x2064,0x1C43,0x1822,0x494E,0x412C, - 0x452D,0x51AC,0x5E0F,0x6653,0x6A53,0x496B,0x55CF,0x34AA, - 0x38A9,0x3CEB,0x3489,0x2006,0x1C05,0x308A,0x450F,0x40EE, - 0x40CD,0x38AC,0x2C48,0x2C89,0x496E,0x55D0,0x59B2,0x55D2, - 0x492E,0x5970,0x5991,0x61D3,0x5DB2,0x44EB,0x55B0,0x494B, - 0x5171,0x5570,0x5571,0x5191,0x38EB,0x34AA,0x2846,0x4D8E, - 0x2CA7,0x2464,0x410C,0x3CCB,0x38CC,0x410B,0x3CEC,0x30CA, - - 0x408B,0x20A7,0x452C,0x51AF,0x454C,0x24A3,0x494C,0x518E, - 0x61F1,0x55AE,0x5DF2,0x5A0E,0x55ED,0x6271,0x38AA,0x30A6, - 0x2887,0x2A40,0x53A0,0x63E1,0x6FE5,0x6FE5,0x5BC2,0x5FC4, - 0x5FC3,0x67C4,0x6FC8,0x73C6,0x6BE6,0x29E0,0x2E00,0x2E00, - 0x3E82,0x5B47,0x1DA0,0x3EC0,0x3681,0x3680,0x4B03,0x5364, - 0x2A00,0x5384,0x5787,0x5B26,0x5FC4,0x5FE2,0x5BE2,0x3F00, - 0x4320,0x3AC0,0x2E40,0x2A20,0x4760,0x4300,0x4B41,0x3240, - 0x3220,0x3A61,0x3260,0x3280,0x2A60,0x32A0,0x2E00,0x3AA0, - 0x4722,0x3AA0,0x31C0,0x3200,0x3220,0x3620,0x3200,0x5385, - 0x67E7,0x5784,0x6388,0x6368,0x73AA,0x73CB,0x3A82,0x73C5, - 0x6BE7,0x1943,0x1542,0x08A1,0x0CE3,0x0CE1,0x1962,0x2164, - 0x29E5,0x25A3,0x25C4,0x2E25,0x3226,0x3227,0x1963,0x21A4, - 0x2DE8,0x1D84,0x25A5,0x1122,0x0460,0x0CE2,0x1543,0x1DA3, - 0x1DA4,0x25E5,0x25C5,0x2DE7,0x29C6,0x2E07,0x3A49,0x42CB, - 0x4F0C,0x35B3,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF,0x301F, - 0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF,0x7E9F, - - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x001F,0x0FE0,0x1BE0, - 0x27E0,0x37E0,0x43E0,0x4FE0,0x63E0,0x67ED,0x77EE,0x7FF5, - 0x7BDE,0xFFFF,0x35B3,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF, - 0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF, - 0x7E9F,0x7BDE,0x7F9F,0x186B,0x1CAB,0x1C6C,0x208E,0x204F, - 0x28B2,0x28B2,0x28B2,0x28B2,0x28B2,0x2873,0x2893,0x2C92, - 0x2CB2,0x3074,0x3094,0x30D4,0x30F4,0x3076,0x34D4,0x34F4, - 0x3476,0x34B7,0x34F7,0x3517,0x3478,0x34B8,0x3479,0x3CD6, - 0x3CB7,0x3CB8,0x3D58,0x3CD9,0x3D39,0x3C7B,0x3CBB,0x3CDB, - 0x3CFB,0x3CFC,0x407F,0x44F8,0x4578,0x44D9,0x44F9,0x4539, - 0x44BB,0x44DB,0x455C,0x44BD,0x44DD,0x451D,0x44BE,0x447F, - 0x4D9A,0x4CDA,0x4D3C,0x4CDD,0x4D3E,0x4CBF,0x4CDF,0x4D1F, - 0x4D3F,0x54DE,0x553E,0x54DF,0x551F,0x553F,0x557F,0x5CDF, - 0x5D1F,0x5D3F,0x5D5F,0x5D7F,0x5D9F,0x651F,0x655F,0x65BF, - 0x65DF,0x661F,0x691F,0x695F,0x69BE,0x69DF,0x6A1F,0x715F, - 0x717F,0x71BF,0x71DF,0x721F,0x723F,0x725F,0x727F,0x79BF, - - 0x79FF,0x7A1F,0x7A5F,0x7A7F,0x7ABF,0x7B5F,0x7B7F,0x7DDF, - 0x7E1F,0x7E5F,0x7F1F,0x7F7F,0x7D7F,0x7E1F,0x7E5F,0x7EBF, - 0x7EFF,0x7F5F,0x7FBF,0x7FDF,0x7E3F,0x7E5F,0x7E7F,0x7E9F, - 0x7EBF,0x7EDF,0x7EFF,0x7F1F,0x7F3F,0x7F5F,0x7F7F,0x7FBF, - 0x7FFF,0x0000,0xFFFF,0x3C48,0x7FE0,0x7C1F,0x7C00,0x001F, - 0x03FF,0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F, - 0x7DFF,0x7E9F,0x7BDE,0x7FE0,0x0445,0x08C5,0x04E5,0x0505, - 0x0525,0x0545,0x0565,0x0945,0x0965,0x0966,0x0986,0x09A6, - 0x198C,0x19AA,0x1D66,0x7FE0,0x1D82,0x1DA2,0x1DC2,0x218C, - 0x21AC,0x21C2,0x258D,0x25AC,0x29AD,0x29AE,0x29AF,0x29CF, - 0x29E2,0x2D91,0x2DB0,0x7FE0,0x2DF0,0x31D0,0x31D1,0x31D2, - 0x31F1,0x31F2,0x3592,0x35D1,0x35D2,0x35F2,0x35F3,0x3A33, - 0x3DF3,0x3DF4,0x3DF5,0x7FE0,0x3E14,0x3E15,0x3E33,0x3E34, - 0x3F62,0x41D3,0x41F5,0x4215,0x4216,0x4234,0x4235,0x4236, - 0x4382,0x4616,0x4617,0x7FE0,0x4636,0x4637,0x4639,0x4656, - 0x4657,0x4676,0x4A17,0x4A19,0x4A37,0x4A39,0x4E77,0x4E78, - - 0x4FAD,0x5259,0x525A,0x7FE0,0x5279,0x527A,0x5299,0x5299, - 0x529A,0x53EC,0x53EE,0x5699,0x569A,0x56B9,0x56BA,0x56BC, - 0x5A9C,0x5ABA,0x5ABC,0x7FE0,0x5BF1,0x5EFB,0x5EFC,0x62BD, - 0x62FD,0x62FE,0x631D,0x66FD,0x671D,0x671E,0x673D,0x67B2, - 0x67D4,0x6B3E,0x6B3F,0x7FE0,0x6F7F,0x737F,0x739E,0x739F, - 0x73FD,0x77BF,0x77F9,0x7BBE,0x7BDD,0x7BFC,0x7FFA,0x7FFB, - 0x7FFC,0x7FFD,0x7FFF,0x7FE0,0x1D6C,0x2DD0,0x3E13,0x4635, - 0x5278,0x5ABD,0x6F7F,0x3C48,0x3C48,0x3C48,0x3C48,0x3C48, - 0x3C48,0x3C48,0x3C48,0x3971,0x0842,0x15C6,0x2666,0x1E8C, - 0x270A,0x32F1,0x2EAB,0x3BCF,0x3BD2,0x4BEE,0x53F6,0x5B94, - 0x6BB5,0x6FFB,0x7BDE,0xFFFF,0x0004,0x0000,0x4232,0x56F8 -}; -static UINT16 bloodwar_mcu_4_0d[] = { // Warrior 5 Player 2 - 0x0004,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x0C29,0x0C2A,0x184B,0x100A,0x142A,0x24AD,0x1C4C, - 0x1C4D,0x30D1,0x248E,0x30F1,0x28AF,0x2CB0,0x248F,0x208E, - 0x206D,0x102B,0x2890,0x20AE,0x1C6D,0x206E,0x28D0,0x2CF0, - 0x51F7,0x51D7,0x5A19,0x5E5B,0x5A18,0x55F7,0x51D5,0x4D94, - 0x4996,0x4536,0x4135,0x2CB2,0x4555,0x4DB8,0x38F2,0x4D98, - 0x38D2,0x51B8,0x4D97,0x3D14,0x206C,0x4977,0x3514,0x184C, - 0x184D,0x49D7,0x4594,0x208C,0x28CF,0x34F1,0x34F2,0x30D0, - 0x288E,0x288F,0x1C6C,0x186B,0x144A,0x1029,0x4155,0x3933, - 0x3D34,0x49B3,0x5616,0x5E5A,0x625A,0x4172,0x4DD6,0x2CB1, - 0x30B0,0x34F2,0x2C90,0x180D,0x140C,0x2891,0x3D16,0x38F5, - 0x38D4,0x30B3,0x244F,0x2490,0x4174,0x4DD7,0x51B9,0x4DD9, - 0x4135,0x5177,0x5198,0x59DA,0x55B9,0x3CF2,0x4DB7,0x4152, - 0x4978,0x4D77,0x4D78,0x4998,0x30F2,0x2CB1,0x204D,0x4595, - 0x24AE,0x1C6B,0x3913,0x34D2,0x30D3,0x3912,0x34F3,0x28D1, - - 0x3892,0x18AE,0x3D33,0x49B6,0x3D53,0x1CAA,0x4153,0x4995, - 0x59F8,0x4DB5,0x55F9,0x5215,0x4DF4,0x5A78,0x30B1,0x28AD, - 0x208E,0x2A40,0x53A0,0x63E1,0x6FE5,0x6FE5,0x5BC2,0x5FC4, - 0x5FC3,0x67C4,0x6FC8,0x73C6,0x6BE6,0x29E0,0x2E00,0x2E00, - 0x3E82,0x5B47,0x1DA0,0x3EC0,0x3681,0x3680,0x4B03,0x5364, - 0x2A00,0x5384,0x5787,0x5B26,0x5FC4,0x5FE2,0x5BE2,0x3F00, - 0x4320,0x3AC0,0x2E40,0x2A20,0x4760,0x4300,0x4B41,0x3240, - 0x3220,0x3A61,0x3260,0x3280,0x2A60,0x32A0,0x2E00,0x3AA0, - 0x4722,0x3AA0,0x31C0,0x3200,0x3220,0x3620,0x3200,0x5385, - 0x67E7,0x5784,0x6388,0x6368,0x73AA,0x73CB,0x3A82,0x73C5, - 0x6BE7,0x1943,0x1542,0x08A1,0x0CE3,0x0CE1,0x1962,0x2164, - 0x29E5,0x25A3,0x25C4,0x2E25,0x3226,0x3227,0x1963,0x21A4, - 0x2DE8,0x1D84,0x25A5,0x1122,0x0460,0x0CE2,0x1543,0x1DA3, - 0x1DA4,0x25E5,0x25C5,0x2DE7,0x29C6,0x2E07,0x3A49,0x42CB, - 0x4F0C,0x35B3,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF,0x301F, - 0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF,0x7E9F, - - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x001F,0x0FE0,0x1BE0, - 0x27E0,0x37E0,0x43E0,0x4FE0,0x63E0,0x67ED,0x77EE,0x7FF5, - 0x7BDE,0xFFFF,0x35B3,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF, - 0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF, - 0x7E9F,0x7BDE,0x7F9F,0x186B,0x1CAB,0x1C6C,0x208E,0x204F, - 0x28B2,0x28B2,0x28B2,0x28B2,0x28B2,0x2873,0x2893,0x2C92, - 0x2CB2,0x3074,0x3094,0x30D4,0x30F4,0x3076,0x34D4,0x34F4, - 0x3476,0x34B7,0x34F7,0x3517,0x3478,0x34B8,0x3479,0x3CD6, - 0x3CB7,0x3CB8,0x3D58,0x3CD9,0x3D39,0x3C7B,0x3CBB,0x3CDB, - 0x3CFB,0x3CFC,0x407F,0x44F8,0x4578,0x44D9,0x44F9,0x4539, - 0x44BB,0x44DB,0x455C,0x44BD,0x44DD,0x451D,0x44BE,0x447F, - 0x4D9A,0x4CDA,0x4D3C,0x4CDD,0x4D3E,0x4CBF,0x4CDF,0x4D1F, - 0x4D3F,0x54DE,0x553E,0x54DF,0x551F,0x553F,0x557F,0x5CDF, - 0x5D1F,0x5D3F,0x5D5F,0x5D7F,0x5D9F,0x651F,0x655F,0x65BF, - 0x65DF,0x661F,0x691F,0x695F,0x69BE,0x69DF,0x6A1F,0x715F, - 0x717F,0x71BF,0x71DF,0x721F,0x723F,0x725F,0x727F,0x79BF, - - 0x79FF,0x7A1F,0x7A5F,0x7A7F,0x7ABF,0x7B5F,0x7B7F,0x7DDF, - 0x7E1F,0x7E5F,0x7F1F,0x7F7F,0x7D7F,0x7E1F,0x7E5F,0x7EBF, - 0x7EFF,0x7F5F,0x7FBF,0x7FDF,0x7E3F,0x7E5F,0x7E7F,0x7E9F, - 0x7EBF,0x7EDF,0x7EFF,0x7F1F,0x7F3F,0x7F5F,0x7F7F,0x7FBF, - 0x7FFF,0x0000,0xFFFF,0x3C48,0x7FE0,0x7C1F,0x7C00,0x001F, - 0x03FF,0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F, - 0x7DFF,0x7E9F,0x7BDE,0x7FE0,0x0445,0x08C5,0x04E5,0x0505, - 0x0525,0x0545,0x0565,0x0945,0x0965,0x0966,0x0986,0x09A6, - 0x198C,0x19AA,0x1D66,0x7FE0,0x1D82,0x1DA2,0x1DC2,0x218C, - 0x21AC,0x21C2,0x258D,0x25AC,0x29AD,0x29AE,0x29AF,0x29CF, - 0x29E2,0x2D91,0x2DB0,0x7FE0,0x2DF0,0x31D0,0x31D1,0x31D2, - 0x31F1,0x31F2,0x3592,0x35D1,0x35D2,0x35F2,0x35F3,0x3A33, - 0x3DF3,0x3DF4,0x3DF5,0x7FE0,0x3E14,0x3E15,0x3E33,0x3E34, - 0x3F62,0x41D3,0x41F5,0x4215,0x4216,0x4234,0x4235,0x4236, - 0x4382,0x4616,0x4617,0x7FE0,0x4636,0x4637,0x4639,0x4656, - 0x4657,0x4676,0x4A17,0x4A19,0x4A37,0x4A39,0x4E77,0x4E78, - - 0x4FAD,0x5259,0x525A,0x7FE0,0x5279,0x527A,0x5299,0x5299, - 0x529A,0x53EC,0x53EE,0x5699,0x569A,0x56B9,0x56BA,0x56BC, - 0x5A9C,0x5ABA,0x5ABC,0x7FE0,0x5BF1,0x5EFB,0x5EFC,0x62BD, - 0x62FD,0x62FE,0x631D,0x66FD,0x671D,0x671E,0x673D,0x67B2, - 0x67D4,0x6B3E,0x6B3F,0x7FE0,0x6F7F,0x737F,0x739E,0x739F, - 0x73FD,0x77BF,0x77F9,0x7BBE,0x7BDD,0x7BFC,0x7FFA,0x7FFB, - 0x7FFC,0x7FFD,0x7FFF,0x7FE0,0x1D6C,0x2DD0,0x3E13,0x4635, - 0x5278,0x5ABD,0x6F7F,0x3C48,0x3C48,0x3C48,0x3C48,0x3C48, - 0x3C48,0x3C48,0x3C48,0x3971,0x0842,0x15C6,0x2666,0x1E8C, - 0x270A,0x32F1,0x2EAB,0x3BCF,0x3BD2,0x4BEE,0x53F6,0x5B94, - 0x6BB5,0x6FFB,0x7BDE,0xFFFF,0x0005,0x40CE,0x4232,0x56F8 -}; -static UINT16 bloodwar_mcu_4_0e[] = { // Warrior 4 Player 2 - 0x0005,0x40CE,0x4232,0x56F8,0x2D8D,0x1D08,0x254A,0x2D8C, - 0x35CE,0x3E10,0x4652,0x4E94,0x56D6,0x5F18,0x675A,0x6F9C, - 0x7BDE,0x7BF9,0x6FF5,0x6BD4,0x63F1,0x538D,0x63F2,0x57EE, - 0x57EF,0x53EE,0x57CE,0x36E7,0x4FCD,0x4FEC,0x4FCA,0x2F06, - 0x1A63,0x3B29,0x1201,0x1622,0x0DC1,0x3F4A,0x3707,0x1A42, - 0x1221,0x3307,0x2EC6,0x0DE1,0x1E63,0x434B,0x53AC,0x67F0, - 0x1E24,0x3EE9,0x472B,0x4B4C,0x6BF3,0x6FF5,0x73F6,0x73F6, - 0x73F6,0x73F5,0x6FF5,0x5FF0,0x5FF1,0x476A,0x19A1,0x1161, - 0x19E1,0x2AC5,0x32C7,0x32E6,0x3F6A,0x3B28,0x2665,0x0941, - 0x3289,0x47CB,0x4BEB,0x4389,0x1A44,0x2285,0x2AA6,0x2284, - 0x1A23,0x7FFF,0x7FFE,0x7FFD,0x7FFD,0x77F9,0x5370,0x5392, - 0x4B2F,0x5792,0x5BB3,0x4F31,0x7FFD,0x7FFC,0x73D8,0x4F11, - 0x46F0,0x3E8E,0x322B,0x4EF1,0x4ED3,0x5332,0x5773,0x46AF, - 0x428F,0x266F,0x3AB0,0x364C,0x29E9,0x2A6D,0x2DEA,0x29C9, - 0x25C9,0x25C8,0x2E4B,0x1144,0x0D64,0x21A7,0x3B0B,0x2207, - 0x478E,0x4FB0,0x4B8F,0x53D2,0x6FF6,0x7FFA,0x6FF8,0x5FF4, - - 0x36CC,0x536F,0x474D,0x3AEC,0x2A49,0x1DE5,0x2627,0x2E88, - 0x2E89,0x1E05,0x1184,0x0D24,0x15A6,0x1104,0x0D23,0x08E2, - 0x08E1,0x6BFF,0x577D,0x42D8,0x3697,0x3677,0x3256,0x3A98, - 0x3EBA,0x3EB9,0x3AB8,0x3654,0x2E55,0x2A13,0x3274,0x2610, - 0x21F1,0x2A91,0x0545,0x0946,0x2631,0x2A4F,0x2231,0x21AE, - 0x0566,0x15C8,0x29ED,0x25EC,0x222A,0x2EB0,0x36B4,0x3A94, - 0x1E11,0x7FFF,0x77F9,0x3ACA,0x3288,0x2A66,0x4B4E,0x3EEB, - 0x0900,0x2606,0x1563,0x0940,0x1142,0x1E43,0x430C,0x430B, - 0x3F0A,0x5FF3,0x53B0,0x3689,0x1DE3,0x2E67,0x15A2,0x5791, - 0x15A2,0x2E68,0x15A2,0x4F6E,0x2A47,0x4B2E,0x2607,0x2E47, - 0x3A8A,0x5390,0x3688,0x7BF8,0x77FB,0x5FD5,0x5BD4,0x73F7, - 0x77F9,0x3F0A,0x4F4F,0x2608,0x6FF7,0x5FF4,0x5FF1,0x5BB1, - 0x3EEA,0x4F6E,0x3EEC,0x1583,0x4B2D,0x57B1,0x2605,0x25C5, - 0x536F,0x73FA,0x6FF9,0x328A,0x3ECD,0x470D,0x5792,0x474E, - 0x5371,0x4191,0x3C00,0x4000,0x4400,0x4800,0x4C21,0x5063, - 0x5484,0x5CA5,0x64C6,0x7063,0x78A5,0x7DCE,0x7E94,0x7F39, - - 0x7BDE,0xFFFF,0x41D3,0x0300,0x0340,0x0362,0x03A2,0x03C9, - 0x1FCC,0x27EE,0x37F0,0x3FF3,0x47F6,0x53FB,0x5FFF,0x6BFF, - 0x6FFF,0x7FFF,0xFFFF,0x4191,0x0019,0x001B,0x001C,0x18DD, - 0x295D,0x319F,0x39DF,0x421F,0x4A5F,0x529F,0x5ADF,0x631F, - 0x6B5F,0x739F,0x7BDE,0xFFFF,0x4191,0x2EE0,0x3300,0x3B20, - 0x4340,0x4760,0x4F80,0x57A1,0x5BC0,0x67E2,0x6FE4,0x77E6, - 0x7BEF,0x7FF4,0x7FFB,0x7BDE,0xFFFF,0x0005,0x40CE,0x4232 -}; -static UINT16 bloodwar_mcu_4_0f[] = { // Warrior 4 Player 1 - 0x0005,0x40CE,0x4232,0x56F8,0x2D8D,0x20E9,0x292B,0x316D, - 0x39AF,0x41F1,0x4A33,0x5275,0x5AB7,0x62F9,0x6B3B,0x737D, - 0x7BDF,0x7FFA,0x73F6,0x6FF5,0x67F2,0x57CE,0x67F3,0x5BEF, - 0x5BF0,0x57EF,0x5BEF,0x3B08,0x53EE,0x53ED,0x53EB,0x3327, - 0x1E84,0x3B29,0x1201,0x1622,0x0DC1,0x3F4A,0x3707,0x1A42, - 0x1221,0x3307,0x2EC6,0x0DE1,0x1E63,0x434B,0x53AC,0x67F0, - 0x1E24,0x3EE9,0x472B,0x4B4C,0x6BF3,0x6FF5,0x6FF6,0x73F7, - 0x73F6,0x73F7,0x6FF5,0x5FF0,0x5FF1,0x476A,0x19A1,0x1161, - 0x19E1,0x2AC5,0x32C7,0x32E6,0x3F6A,0x3B28,0x2665,0x0941, - 0x3289,0x47CB,0x4BEB,0x4389,0x1A44,0x2285,0x2AA6,0x2284, - 0x1A23,0x7FFF,0x7FFE,0x7FFD,0x7FFC,0x77F9,0x5370,0x5392, - 0x4B2F,0x5792,0x5BB3,0x4F31,0x7FFC,0x7FFB,0x73F8,0x4F11, - 0x46F0,0x3ECE,0x3289,0x4EF1,0x4F32,0x5332,0x5773,0x46AF, - 0x428F,0x1EC8,0x3309,0x368A,0x2A27,0x22C8,0x2E28,0x2A07, - 0x2607,0x25E6,0x2E69,0x1162,0x0D82,0x21C5,0x3B0B,0x2225, - 0x478E,0x4FB0,0x4B8F,0x53D2,0x6FF6,0x7FFA,0x6FF8,0x5FF4, - - 0x36CC,0x538F,0x476D,0x3B0C,0x2A69,0x1E05,0x2647,0x2EA8, - 0x2EA9,0x1E25,0x11C3,0x0D63,0x15E5,0x1143,0x0D62,0x0921, - 0x0920,0x63F8,0x4FF2,0x3B8D,0x2F4C,0x2F2C,0x2B0B,0x334D, - 0x376F,0x376E,0x336D,0x2F09,0x270A,0x22C8,0x2B28,0x1EC5, - 0x1AA6,0x2327,0x05E1,0x05E1,0x1EC5,0x22E5,0x1AC5,0x1A44, - 0x0601,0x0E61,0x2283,0x1E82,0x1A81,0x2B46,0x2F49,0x332A, - 0x16A6,0x7FFF,0x77F9,0x3ACA,0x3288,0x2A66,0x4B4E,0x3EEB, - 0x0900,0x2606,0x1563,0x0940,0x1142,0x1E43,0x430C,0x430B, - 0x3F0A,0x5FF3,0x53B0,0x3689,0x1DE3,0x2E67,0x15A2,0x5791, - 0x15A2,0x2E68,0x15A2,0x4F6E,0x2A47,0x4B2E,0x2607,0x2E47, - 0x3A8A,0x5390,0x3688,0x7BF8,0x77FB,0x5FD5,0x5BD4,0x73F7, - 0x77F9,0x3F0A,0x4F4F,0x2608,0x6FF7,0x5FF4,0x5FF1,0x5BB1, - 0x3EEA,0x4B4D,0x3ACB,0x1162,0x470C,0x5390,0x21E4,0x21A4, - 0x4F4E,0x6FF9,0x6BF8,0x2E69,0x3AAC,0x42EC,0x5371,0x432D, - 0x4F50,0x4191,0x3C00,0x4000,0x4400,0x4800,0x4C21,0x5063, - 0x5484,0x5CA5,0x64C6,0x7063,0x78A5,0x7DCE,0x7E94,0x7F39, - - 0x7BDE,0xFFFF,0x41D3,0x0300,0x0340,0x0362,0x03A2,0x03C9, - 0x1FCC,0x27EE,0x37F0,0x3FF3,0x47F6,0x53FB,0x5FFF,0x6BFF, - 0x6FFF,0x7FFF,0xFFFF,0x4191,0x0019,0x001B,0x001C,0x18DD, - 0x295D,0x319F,0x39DF,0x421F,0x4A5F,0x529F,0x5ADF,0x631F, - 0x6B5F,0x739F,0x7BDE,0xFFFF,0x4191,0x2EE0,0x3300,0x3B20, - 0x4340,0x4760,0x4F80,0x57A1,0x5BC0,0x67E2,0x6FE4,0x77E6, - 0x7BEF,0x7FF4,0x7FFB,0x7BDE,0xFFFF,0x0009,0x0000,0x4232 -}; -static UINT16 bloodwar_mcu_4_10[] = { // Warrior 6 Player 1 - 0x0009,0x0000,0x4232,0x56F8,0x2D8D,0x27FF,0x3BFF,0x53FF, - 0x63FF,0x401E,0x4C1F,0x581F,0x6C1F,0x7C1F,0x7E1F,0x7EBF, - 0x7BDE,0x4BCD,0x47EC,0x43CA,0x3BC8,0x2F45,0x2703,0x22E2, - 0x1EC1,0x1EE1,0x1AE1,0x16C0,0x12C0,0x0E80,0x0E40,0x1221, - 0x0580,0x2765,0x2324,0x1F03,0x1F23,0x1B22,0x12E0,0x12C1, - 0x1281,0x1241,0x0A00,0x05C0,0x0180,0x0140,0x0540,0x0520, - 0x0100,0x1A42,0x1622,0x1201,0x0E01,0x0580,0x0100,0x1A62, - 0x1E83,0x1641,0x0DE0,0x05A0,0x0560,0x53AF,0x3F4A,0x3308, - 0x2A86,0x3B29,0x2E87,0x1E43,0x26A5,0x1A22,0x1201,0x0DA1, - 0x1602,0x00C0,0x0540,0x0521,0x1663,0x1643,0x0DE1,0x1642, - 0x05C0,0x4EEF,0x5312,0x4AD0,0x3E4B,0x3A4B,0x31E9,0x3A2A, - 0x2DC8,0x2DA8,0x2987,0x2566,0x1D25,0x1504,0x25A7,0x2DC7, - 0x3608,0x2986,0x2DE7,0x3A2A,0x3207,0x25A5,0x21A4,0x29C5, - 0x3A4B,0x466A,0x3A08,0x3A28,0x3A08,0x2564,0x31A5,0x29A6, - 0x3184,0x2965,0x1903,0x2143,0x2163,0x2963,0x2164,0x2DA4, - 0x2583,0x31C5,0x1D63,0x2164,0x31A6,0x35E6,0x31C6,0x3E8A, - - 0x3A69,0x2DE7,0x46CD,0x532F,0x3E8B,0x2DE6,0x10E2,0x1502, - 0x4ACD,0x530F,0x2E07,0x08C1,0x25A6,0x10E2,0x1522,0x1523, - 0x25A5,0x4ED1,0x3A2D,0x3A0C,0x31CA,0x360C,0x31EA,0x2DCA, - 0x360B,0x2568,0x2DA9,0x426E,0x468F,0x29A9,0x29A8,0x2588, - 0x1504,0x2988,0x2167,0x360A,0x426D,0x35EC,0x3E2D,0x52D1, - 0x4A90,0x3A2C,0x424E,0x3E4D,0x5310,0x5732,0x426C,0x6795, - 0x5B51,0x5B51,0x6FD5,0x6373,0x52EF,0x1D27,0x2549,0x10C4, - 0x08C2,0x18E6,0x35AE,0x31AC,0x2D8C,0x2DAD,0x31AD,0x256A, - 0x1D28,0x1506,0x0CC4,0x6FF8,0x63B3,0x4AED,0x3E8A,0x4F0F, - 0x42CC,0x6796,0x4A8F,0x3249,0x4AEE,0x5FB2,0x46ED,0x3A6A, - 0x322A,0x7BEE,0x63EA,0x57E9,0x4FA8,0x3B44,0x3AC4,0x2622, - 0x1141,0x4F0B,0x7BF9,0x67F2,0x5FB0,0x25E3,0x4F2D,0x5B70, - 0x4ACD,0x576E,0x574E,0x572F,0x1263,0x0E83,0x0EA3,0x1725, - 0x23C8,0x1304,0x17C4,0x22E6,0x1323,0x0A62,0x0621,0x01C1, - 0x05A1,0x41D3,0x0241,0x02A0,0x02E4,0x0322,0x0369,0x1F8C, - 0x27CE,0x37D0,0x3FF3,0x47F6,0x53FB,0x5FFF,0x6BFF,0x6FFF, - - 0x7FFF,0xFFFF,0x4191,0x11E0,0x1A20,0x2680,0x32C0,0x3B00, - 0x4740,0x4F61,0x57A0,0x63E2,0x6FE4,0x77E6,0x7BEF,0x7FF4, - 0x7FFB,0x7BDE,0xFFFF,0x4191,0x2000,0x2800,0x3000,0x3400, - 0x3800,0x4000,0x4800,0x5400,0x5C00,0x6821,0x7084,0x7D29, - 0x7E52,0x7F39,0x7BDE,0xFFFF,0x41D3,0x01D1,0x0215,0x0A77, - 0x12B9,0x16FB,0x273C,0x375D,0x435E,0x4B7F,0x537F,0x5B9F, - 0x639F,0x6FBF,0x77DF,0x7FFF,0xFFFF,0x4191,0x7F40,0x7B60, - 0x7780,0x73A0,0x6FC0,0x6BE0,0x6BE0,0x6FE3,0x73E6,0x77E9, - 0x7BEC,0x7FEF,0x7FF4,0x7FF9,0x7BDE,0x4191,0x6000,0x6400, - 0x6800,0x6C00,0x7021,0x7484,0x78C6,0x7D29,0x7D68,0x7DA6, - 0x7DE4,0x7E23,0x7E82,0x7EE1,0x7BDE,0x21A6,0x2000,0x2400, - 0x2C00,0x3400,0x3800,0x3C00,0x4000,0x4400,0x4800,0x4C00, - 0x5000,0x5400,0x5800,0x5C00,0x31EA,0xFFFF,0x4191,0x47FF, - 0x4BFF,0x4FFF,0x53FF,0x57FF,0x5BFF,0x5FFF,0x63FF,0x67FF, - 0x6BFF,0x6FFF,0x73FF,0x77FF,0x7BFF,0x7BDE,0x0421,0x179F, - 0x1BBF,0x1FDF,0x23FF,0x27FF,0x2BFF,0x2FFF,0x33FF,0x37FF, - - 0x3BFF,0x3FFF,0x43FF,0x47FF,0x4BFF,0x7BDE,0x21A6,0x143F, - 0x10BF,0x0D1F,0x099F,0x05FF,0x063F,0x0A7F,0x0ABF,0x0EDF, - 0x0EFF,0x131F,0x133F,0x175F,0x177F,0x31EA,0xFFFF,0x4191, - 0x53E0,0x57E0,0x5BE0,0x5FE0,0x63E0,0x67E0,0x6BE0,0x6FE3, - 0x73E6,0x77E9,0x7BEC,0x7FEF,0x7FF4,0x7FF9,0x7BDE,0x0421, - 0x1BE0,0x1FE0,0x23E0,0x27E0,0x2BE0,0x2FE0,0x33E0,0x37E0, - 0x3BE0,0x3FE0,0x43E0,0x47E0,0x4BE0,0x4FE0,0x7BDE,0x21A6, - 0x1600,0x1620,0x1640,0x1660,0x1680,0x16A0,0x16C0,0x16E0, - 0x1700,0x1720,0x1740,0x1760,0x1780,0x1BA0,0x31EA,0xFFFF, - 0x4191,0x03EF,0x03EA,0x03E5,0x03E0,0x03E0,0x17E0,0x2BE0, - 0x3FE0,0x53E0,0x67E0,0x7FE0,0x7FEF,0x7FF4,0x7FF9,0x7BDE, - 0x0000,0x641F,0x501F,0x3C1F,0x281F,0x141F,0x001F,0x00BF, - 0x015F,0x01FF,0x029F,0x033F,0x03FF,0x03F9,0x03F4,0x7BDE, - 0x0000,0x7FEA,0x7FE0,0x7F20,0x7E80,0x7DE0,0x7D40,0x7CA0, - 0x7C00,0x7C05,0x780A,0x7C0F,0x7C14,0x7C19,0x7C1F,0x7BDE, - 0xFFFF,0x0009,0x0000,0x4232,0x56F8,0x2D8D,0x6C1F,0x7C1F -}; -static UINT16 bloodwar_mcu_4_11[] = { // Warrior 6 Player 2 - 0x0009,0x0000,0x4232,0x56F8,0x2D8D,0x6C1F,0x7C1F,0x7E1F, - 0x7EBF,0x5C13,0x5C52,0x6432,0x7075,0x7992,0x7DF6,0x7EF9, - 0x7BDE,0x52F2,0x4F11,0x4AEF,0x42CD,0x368A,0x2E48,0x2A27, - 0x2606,0x2626,0x2226,0x1E05,0x1A05,0x15C4,0x1584,0x1966, - 0x0CC4,0x2E69,0x2A48,0x2627,0x2647,0x2246,0x1A04,0x19E5, - 0x19C5,0x1985,0x1144,0x0D04,0x08C4,0x08A4,0x0CA4,0x0C84, - 0x0864,0x21A6,0x1D86,0x1965,0x1565,0x1104,0x10A4,0x21C6, - 0x25E7,0x1DA5,0x1544,0x1124,0x10E4,0x5B13,0x46AE,0x3A6C, - 0x31EA,0x428D,0x35EB,0x2587,0x2DE9,0x2166,0x1945,0x1505, - 0x1D66,0x0C64,0x10C4,0x10A5,0x1DC7,0x1DA7,0x1545,0x1DA6, - 0x0D24,0x4EEF,0x5312,0x4AD0,0x3E4B,0x3A4B,0x31E9,0x3A2A, - 0x2DC8,0x2DA8,0x2987,0x2566,0x1D25,0x1504,0x25A7,0x2DC7, - 0x3608,0x2986,0x2DE7,0x3A2A,0x3207,0x25A5,0x21A4,0x29C5, - 0x3A4B,0x466A,0x3A08,0x3A28,0x3A08,0x2564,0x31A5,0x29A6, - 0x3184,0x2965,0x1903,0x2143,0x2163,0x2963,0x2164,0x2DA4, - 0x2583,0x31C5,0x1D63,0x2164,0x31A6,0x35E6,0x31C6,0x3E8A, - - 0x3A69,0x2DE7,0x46CD,0x532F,0x3E8B,0x2DE6,0x10E2,0x1502, - 0x4ACD,0x530F,0x2E07,0x08C1,0x25A6,0x10E2,0x1522,0x1523, - 0x25A5,0x4ED1,0x3A2D,0x3A0C,0x31CA,0x360C,0x31EA,0x2DCA, - 0x360B,0x2568,0x2DA9,0x426E,0x468F,0x29A9,0x29A8,0x2588, - 0x1504,0x2988,0x2167,0x360A,0x426D,0x35EC,0x3E2D,0x52D1, - 0x4A90,0x3A2C,0x424E,0x3E4D,0x5310,0x5732,0x426C,0x6795, - 0x5B51,0x5B51,0x6FD5,0x6373,0x52EF,0x1D27,0x2549,0x10C4, - 0x08C2,0x18E6,0x35AE,0x31AC,0x2D8C,0x2DAD,0x31AD,0x256A, - 0x1D28,0x1506,0x0CC4,0x6FF8,0x63B3,0x4AED,0x3E8A,0x4F0F, - 0x42CC,0x6796,0x4A8F,0x3249,0x4AEE,0x5FB2,0x46ED,0x3A6A, - 0x322A,0x7BEE,0x63EA,0x57E9,0x4FA8,0x3B44,0x3AC4,0x2622, - 0x1141,0x4F0B,0x7BF9,0x67F2,0x5FB0,0x25E3,0x4F2D,0x5B70, - 0x4ACD,0x576E,0x574E,0x572F,0x1263,0x0E83,0x0EA3,0x1725, - 0x23C8,0x1304,0x17C4,0x22E6,0x1323,0x0A62,0x0621,0x01C1, - 0x05A1,0x41D3,0x0241,0x02A0,0x02E4,0x0322,0x0369,0x1F8C, - 0x27CE,0x37D0,0x3FF3,0x47F6,0x53FB,0x5FFF,0x6BFF,0x6FFF, - - 0x7FFF,0xFFFF,0x4191,0x11E0,0x1A20,0x2680,0x32C0,0x3B00, - 0x4740,0x4F61,0x57A0,0x63E2,0x6FE4,0x77E6,0x7BEF,0x7FF4, - 0x7FFB,0x7BDE,0xFFFF,0x4191,0x2000,0x2800,0x3000,0x3400, - 0x3800,0x4000,0x4800,0x5400,0x5C00,0x6821,0x7084,0x7D29, - 0x7E52,0x7F39,0x7BDE,0xFFFF,0x41D3,0x01D1,0x0215,0x0A77, - 0x12B9,0x16FB,0x273C,0x375D,0x435E,0x4B7F,0x537F,0x5B9F, - 0x639F,0x6FBF,0x77DF,0x7FFF,0xFFFF,0x4191,0x7F40,0x7B60, - 0x7780,0x73A0,0x6FC0,0x6BE0,0x6BE0,0x6FE3,0x73E6,0x77E9, - 0x7BEC,0x7FEF,0x7FF4,0x7FF9,0x7BDE,0x4191,0x6000,0x6400, - 0x6800,0x6C00,0x7021,0x7484,0x78C6,0x7D29,0x7D68,0x7DA6, - 0x7DE4,0x7E23,0x7E82,0x7EE1,0x7BDE,0x21A6,0x2000,0x2400, - 0x2C00,0x3400,0x3800,0x3C00,0x4000,0x4400,0x4800,0x4C00, - 0x5000,0x5400,0x5800,0x5C00,0x31EA,0xFFFF,0x4191,0x47FF, - 0x4BFF,0x4FFF,0x53FF,0x57FF,0x5BFF,0x5FFF,0x63FF,0x67FF, - 0x6BFF,0x6FFF,0x73FF,0x77FF,0x7BFF,0x7BDE,0x0421,0x179F, - 0x1BBF,0x1FDF,0x23FF,0x27FF,0x2BFF,0x2FFF,0x33FF,0x37FF, - - 0x3BFF,0x3FFF,0x43FF,0x47FF,0x4BFF,0x7BDE,0x21A6,0x143F, - 0x10BF,0x0D1F,0x099F,0x05FF,0x063F,0x0A7F,0x0ABF,0x0EDF, - 0x0EFF,0x131F,0x133F,0x175F,0x177F,0x31EA,0xFFFF,0x4191, - 0x53E0,0x57E0,0x5BE0,0x5FE0,0x63E0,0x67E0,0x6BE0,0x6FE3, - 0x73E6,0x77E9,0x7BEC,0x7FEF,0x7FF4,0x7FF9,0x7BDE,0x0421, - 0x1BE0,0x1FE0,0x23E0,0x27E0,0x2BE0,0x2FE0,0x33E0,0x37E0, - 0x3BE0,0x3FE0,0x43E0,0x47E0,0x4BE0,0x4FE0,0x7BDE,0x21A6, - 0x1600,0x1620,0x1640,0x1660,0x1680,0x16A0,0x16C0,0x16E0, - 0x1700,0x1720,0x1740,0x1760,0x1780,0x1BA0,0x31EA,0xFFFF, - 0x4191,0x03EF,0x03EA,0x03E5,0x03E0,0x03E0,0x17E0,0x2BE0, - 0x3FE0,0x53E0,0x67E0,0x7FE0,0x7FEF,0x7FF4,0x7FF9,0x7BDE, - 0x0000,0x641F,0x501F,0x3C1F,0x281F,0x141F,0x001F,0x00BF, - 0x015F,0x01FF,0x029F,0x033F,0x03FF,0x03F9,0x03F4,0x7BDE, - 0x0000,0x7FEA,0x7FE0,0x7F20,0x7E80,0x7DE0,0x7D40,0x7CA0, - 0x7C00,0x7C05,0x780A,0x7C0F,0x7C14,0x7C19,0x7C1F,0x7BDE, - 0xFFFF,0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A -}; -static UINT16 bloodwar_mcu_4_12[] = { // Warrior 9 Player 1 - 0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x1AC2,0x1AE2,0x1B02,0x1703,0x1723,0x1743,0x1763, - 0x1784,0x1BA3,0x17A3,0x1BC4,0x1BC6,0x1FE5,0x12C2,0x1BE5, - 0x1FC5,0x1FA5,0x1B65,0x1F64,0x2386,0x2786,0x1B83,0x1BA4, - 0x23A6,0x23E7,0x1FC5,0x23E7,0x1FE6,0x1FE8,0x1FC8,0x1AA4, - 0x1A84,0x1703,0x1704,0x1B04,0x1F84,0x1723,0x1F46,0x23A7, - 0x1B05,0x1BC4,0x13A3,0x16C3,0x1AE4,0x2FE8,0x43EB,0x37EB, - 0x2FEA,0x37EC,0x3BED,0x3FEE,0x3FED,0x43EE,0x43EE,0x43EE, - 0x33EB,0x37EB,0x37EB,0x33EA,0x3BEC,0x3BEC,0x37EB,0x3FEC, - 0x3FED,0x25C7,0x2E08,0x428E,0x5751,0x5F93,0x5B71,0x67F3, - 0x67B5,0x6FD8,0x6793,0x6FF7,0x73F8,0x6BB6,0x73D8,0x77F9, - 0x77FA,0x428F,0x46CD,0x4B0F,0x46D0,0x5732,0x67D5,0x63B5, - 0x63B5,0x6BB6,0x6BD6,0x6FD7,0x67B7,0x73F9,0x6376,0x6776, - 0x5F54,0x1104,0x10E4,0x10E4,0x1524,0x1525,0x1164,0x15A4, - 0x1965,0x1103,0x1544,0x1103,0x1564,0x1584,0x1604,0x1986, - - 0x0CA3,0x1525,0x10E4,0x1925,0x10C4,0x14E5,0x10A4,0x2167, - 0x29A8,0x2587,0x29C9,0x29C8,0x320A,0x320B,0x25A8,0x1DA6, - 0x1D47,0x1128,0x1528,0x1223,0x1664,0x158A,0x19AB,0x1DAC, - 0x21EE,0x21ED,0x220D,0x220C,0x222D,0x194A,0x21CD,0x21AD, - 0x260E,0x220E,0x25EF,0x29E9,0x2DEA,0x3A0C,0x3E2D,0x2A0F, - 0x29EE,0x46D2,0x428F,0x4AD1,0x46B1,0x4690,0x428D,0x2608, - 0x4250,0x2903,0x2D44,0x3565,0x41C8,0x3DA7,0x3986,0x41E8, - 0x4A08,0x41E7,0x45E8,0x524B,0x3526,0x564E,0x49ED,0x3DA8, - 0x416B,0x2E84,0x4746,0x5787,0x4F46,0x57A8,0x4B45,0x5FE9, - 0x5BAB,0x578A,0x57AA,0x5369,0x5FE8,0x53A8,0x4FA7,0x4344, - 0x4345,0x0D63,0x1162,0x1983,0x19A4,0x15A4,0x19C4,0x19E4, - 0x1DE4,0x1A04,0x1E05,0x2246,0x2647,0x2A26,0x2A46,0x2646, - 0x2625,0x2E88,0x3669,0x36AA,0x2626,0x2646,0x2226,0x36EA, - 0x36EB,0x3AEB,0x36CB,0x36CA,0x3ACC,0x3A8B,0x536F,0x63B3, - 0x4B0F,0x290D,0x6004,0x7FFF,0x6409,0x681F,0x281F,0x401F, - 0x2BFF,0x4FFF,0x77FF,0x7C5F,0x681F,0x541F,0x7E15,0x7FE0, - - 0x03E0,0x41D3,0x6004,0x3FA6,0x2AA1,0x3724,0x3FA6,0x43E0, - 0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0,0x77F3,0x7FFA,0x7FFC, - 0x7FFF,0x2E88,0x3669,0x1E04,0x0DE2,0x2646,0x2226,0x36EA, - 0x2E6A,0x3AEB,0x36CB,0x32A9,0x430C,0x3A8B,0x536F,0x63B3, - 0x4B0F,0x0000,0x201B,0x241D,0x2C1F,0x341F,0x3C1E,0x401F, - 0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F,0x7E5F,0x7B1F, - 0x7BDE,0x7FFA,0x1CC2,0x2065,0x2083,0x24C4,0x24E2,0x2502, - 0x2503,0x28A5,0x2D43,0x2D45,0x2D63,0x2D64,0x3144,0x3145, - 0x3583,0x3584,0x3586,0x3587,0x35C3,0x3986,0x3987,0x39C3, - 0x39E5,0x39E7,0x39E8,0x39E3,0x3A05,0x3A23,0x41C6,0x41E5, - 0x4205,0x420A,0x4226,0x4229,0x4263,0x4265,0x4266,0x4267, - 0x4287,0x46E3,0x4A07,0x4A0B,0x4A26,0x4A27,0x4A29,0x4A65, - 0x4A66,0x4A8A,0x4AA5,0x4AA6,0x4AA8,0x4AC5,0x4AE3,0x524C, - 0x5286,0x5289,0x52A6,0x52C9,0x52E5,0x52E6,0x52E8,0x52E9, - 0x5AC6,0x5AC9,0x5AE6,0x5AE8,0x5AE9,0x5AEB,0x62E6,0x62E8, - 0x62E9,0x62EA,0x62EB,0x62EC,0x6AE8,0x6AEA,0x6AED,0x6AEE, - - 0x6AF0,0x6EE8,0x6EEA,0x6EED,0x6EEE,0x6EF0,0x76EA,0x76EB, - 0x76ED,0x770E,0x7710,0x7711,0x7712,0x7713,0x7F0D,0x7F0F, - 0x7F10,0x7F12,0x7F13,0x7F35,0x7F1A,0x7F1B,0x7F0E,0x7F30, - 0x7F32,0x7F38,0x7F5B,0x7F6B,0x7F70,0x7F92,0x7F95,0x7F97, - 0x7F9A,0x7FBE,0x7FDF,0x7F91,0x7FB2,0x7FB3,0x7FB4,0x7FB5, - 0x7FB6,0x7FB7,0x7FB8,0x7FB9,0x7FBF,0x7FBB,0x7FFF,0x7FFF, - 0x0000,0xFFFF,0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108 -}; -static UINT16 bloodwar_mcu_4_13[] = { // Warrior 9 Player 2 - 0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x146D,0x1CAF,0x24EF,0x24EF,0x2910,0x3553,0x3DB7, - 0x45B8,0x3993,0x2610,0x4196,0x2632,0x2A52,0x1D2F,0x2652, - 0x569A,0x2A15,0x4A19,0x41D6,0x41F8,0x39D6,0x25F2,0x2613, - 0x2E15,0x2E56,0x2A34,0x2E56,0x2A55,0x2A56,0x2A36,0x1C6D, - 0x2931,0x20B0,0x2D33,0x3133,0x4196,0x3596,0x3575,0x39D6, - 0x3134,0x31D5,0x2994,0x2CF2,0x3113,0x3D98,0x41D8,0x3E3A, - 0x4E1B,0x4DF9,0x521A,0x563B,0x561A,0x5A3C,0x629F,0x5A3C, - 0x49B8,0x5618,0x4DD8,0x4997,0x49F9,0x51F9,0x4DF8,0x561A, - 0x561B,0x25E6,0x2E27,0x42CD,0x5F92,0x5FD2,0x5BB0,0x67F4, - 0x6FF7,0x6FF7,0x67D2,0x6FF6,0x73F7,0x6BF5,0x73F7,0x77F8, - 0x77F9,0x42EC,0x3EE9,0x4B4E,0x470F,0x5771,0x6FF7,0x67F3, - 0x63F3,0x67F4,0x73F7,0x5FB5,0x67F6,0x73F8,0x63B5,0x5FB5, - 0x5F93,0x1063,0x1484,0x18A5,0x0C42,0x1CC6,0x0C42,0x1063, - 0x0C42,0x0C42,0x1484,0x1484,0x1063,0x10C9,0x1449,0x1986, - - 0x0C42,0x1484,0x1063,0x1063,0x1484,0x18A5,0x10A4,0x18A5, - 0x29A8,0x18A5,0x29C9,0x29C8,0x320A,0x320B,0x18A5,0x1484, - 0x1D47,0x1128,0x1528,0x1068,0x146B,0x158A,0x19AB,0x1DAC, - 0x21EE,0x21ED,0x220D,0x220C,0x222D,0x194A,0x21CD,0x21AD, - 0x260E,0x220E,0x25EF,0x29E9,0x2DEA,0x3A0C,0x3E2D,0x2A0F, - 0x29EE,0x46D2,0x428F,0x4AD1,0x46B1,0x4690,0x428D,0x2608, - 0x4250,0x11C2,0x1683,0x2302,0x2305,0x1B22,0x1EC3,0x2385, - 0x3FE6,0x3344,0x2FC4,0x4FE7,0x2AE3,0x376B,0x2B0A,0x22C5, - 0x2688,0x2E84,0x4746,0x5787,0x4F46,0x57A8,0x4B45,0x5FE9, - 0x5BAB,0x578A,0x57AA,0x5369,0x5FE8,0x53A8,0x4FA7,0x4344, - 0x4345,0x0D63,0x1162,0x1983,0x19A4,0x15A4,0x19C4,0x19E4, - 0x1DE4,0x1A04,0x1E05,0x2246,0x2647,0x2A26,0x2A46,0x2646, - 0x2625,0x2E88,0x3669,0x36AA,0x2626,0x2646,0x2226,0x36EA, - 0x36EB,0x3AEB,0x36CB,0x36CA,0x4B0D,0x3A8B,0x4F8E,0x63B3, - 0x4B0F,0x290D,0x6004,0x7FFF,0x6409,0x681F,0x281F,0x401F, - 0x2BFF,0x4FFF,0x77FF,0x7C5F,0x681F,0x541F,0x7E15,0x7FE0, - - 0x03E0,0x41D3,0x6004,0x3FA6,0x2AA1,0x3724,0x3FA6,0x43E0, - 0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0,0x77F3,0x7FFA,0x7FFC, - 0x7FFF,0x2E88,0x3669,0x1E04,0x0DE2,0x2646,0x2226,0x36EA, - 0x2E6A,0x3AEB,0x36CB,0x32A9,0x430C,0x3A8B,0x536F,0x63B3, - 0x4B0F,0x0000,0x201B,0x241D,0x2C1F,0x341F,0x3C1E,0x401F, - 0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F,0x7E5F,0x7B1F, - 0x7BDE,0x7FFA,0x1CC2,0x2065,0x2083,0x24C4,0x24E2,0x2502, - 0x2503,0x28A5,0x2D43,0x2D45,0x2D63,0x2D64,0x3144,0x3145, - 0x3583,0x3584,0x3586,0x3587,0x35C3,0x3986,0x3987,0x39C3, - 0x39E5,0x39E7,0x39E8,0x39E3,0x3A05,0x3A23,0x41C6,0x41E5, - 0x4205,0x420A,0x4226,0x4229,0x4263,0x4265,0x4266,0x4267, - 0x4287,0x46E3,0x4A07,0x4A0B,0x4A26,0x4A27,0x4A29,0x4A65, - 0x4A66,0x4A8A,0x4AA5,0x4AA6,0x4AA8,0x4AC5,0x4AE3,0x524C, - 0x5286,0x5289,0x52A6,0x52C9,0x52E5,0x52E6,0x52E8,0x52E9, - 0x5AC6,0x5AC9,0x5AE6,0x5AE8,0x5AE9,0x5AEB,0x62E6,0x62E8, - 0x62E9,0x62EA,0x62EB,0x62EC,0x6AE8,0x6AEA,0x6AED,0x6AEE, - - 0x6AF0,0x6EE8,0x6EEA,0x6EED,0x6EEE,0x6EF0,0x76EA,0x76EB, - 0x76ED,0x770E,0x7710,0x7711,0x7712,0x7713,0x7F0D,0x7F0F, - 0x7F10,0x7F12,0x7F13,0x7F35,0x7F1A,0x7F1B,0x7F0E,0x7F30, - 0x7F32,0x7F38,0x7F5B,0x7F6B,0x7F70,0x7F92,0x7F95,0x7F97, - 0x7F9A,0x7FBE,0x7FDF,0x7F91,0x7FB2,0x7FB3,0x7FB4,0x7FB5, - 0x7FB6,0x7FB7,0x7FB8,0x7FB9,0x7FBF,0x7FBB,0x7FFF,0x7FFF, - 0x0000,0xFFFF,0x0006,0x0000,0x4232,0x56F8,0x2D8D,0x2108 -}; -static UINT16 bloodwar_mcu_4_14[] = { // Warrior 7 Player 1 - 0x0006,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x0D00,0x0D00,0x0D40,0x0D40,0x0D60,0x0D80,0x1140, - 0x1561,0x1581,0x15A1,0x15E1,0x1601,0x19A1,0x19C1,0x19C2, - 0x19E1,0x1E23,0x1E42,0x1E43,0x1E82,0x2204,0x2223,0x2242, - 0x2243,0x2244,0x2262,0x2263,0x22A2,0x22A3,0x2664,0x2683, - 0x2684,0x2AA3,0x2AA4,0x2EC3,0x2EC4,0x32A4,0x32C3,0x32C4, - 0x3304,0x3305,0x3325,0x3344,0x36C5,0x3704,0x3705,0x3706, - 0x3707,0x3B45,0x3B46,0x3B65,0x3B84,0x3B85,0x3F05,0x3F27, - 0x3F28,0x3F44,0x3F46,0x3F47,0x3F65,0x3F66,0x3F67,0x3F85, - 0x3FA5,0x4328,0x4347,0x43A6,0x47A7,0x47A8,0x47C6,0x47C7, - 0x47E5,0x47E6,0x4B69,0x4BA7,0x4BA8,0x4BC6,0x4BC7,0x4BC8, - 0x4BE7,0x57E9,0x57E8,0x57E7,0x5BCA,0x5BE9,0x5BEA,0x5BEC, - 0x5BE8,0x5BE9,0x5BE8,0x5BEB,0x5F6E,0x5FCD,0x5FEB,0x5FE9, - 0x5BEC,0x67E9,0x67EA,0x67EC,0x67ED,0x6FED,0x6FED,0x6FEE, - 0x6FEF,0x6FEC,0x6FEC,0x6FED,0x6FEB,0x6FED,0x6FEC,0x73EE, - - 0x73EC,0x77F1,0x77F0,0x77F1,0x7BF1,0x7BF2,0x7BF3,0x7BF1, - 0x7BF2,0x7FF2,0x7FF4,0x7FF2,0x7FF4,0x7FF2,0x7FF4,0x7FF4, - 0x7FF5,0x33E9,0x0D82,0x0DC1,0x0DC2,0x0DE1,0x0DE2,0x0E02, - 0x1223,0x1243,0x1263,0x12A3,0x12C3,0x12E3,0x1303,0x1323, - 0x1343,0x16E3,0x1703,0x1723,0x1743,0x1783,0x1784,0x17A3, - 0x17A4,0x17C4,0x17E4,0x1AC3,0x1AE3,0x1AE4,0x1B03,0x1B04, - 0x1B43,0x1F45,0x1F65,0x1F85,0x1FA4,0x1FA5,0x1FA6,0x1FC5, - 0x1FE5,0x1FE6,0x1FE8,0x23E6,0x23E7,0x23E8,0x23E8,0x27E7, - 0x27E7,0x2BE8,0x2BE9,0x2BEA,0x2BE8,0x2FE9,0x2FEA,0x2FE9, - 0x2FEA,0x2FE9,0x2FE9,0x2FEB,0x33EB,0x3BEB,0x3FEE,0x3FEE, - 0x47F0,0x7FF8,0x25E6,0x29A6,0x29A7,0x2DE7,0x3A0A,0x46AC, - 0x4ACC,0x4EEF,0x4F2F,0x532F,0x574E,0x67F1,0x63D2,0x63EF, - 0x63F1,0x6BF5,0x6BF6,0x6FB7,0x6FF5,0x6FF6,0x6FF7,0x6FF6, - 0x77F6,0x77F7,0x77F8,0x77F9,0x7BF8,0x7FFA,0x7FFB,0x7BDC, - 0x7FFA,0x41D3,0x0000,0x0000,0x131A,0x2BBF,0x4FBF,0x23E0, - 0x43E0,0x67ED,0x4C07,0x6409,0x7CCF,0x3C1F,0x541F,0x6C1F, - - 0x7FFF,0x7C00,0x3786,0x37A6,0x3B86,0x3BC6,0x3F47,0x3F86, - 0x3FC6,0x3FE6,0x3FE7,0x47A7,0x47C6,0x47C7,0x47E6,0x47E7, - 0x4BA7,0x4BA8,0x4BC7,0x4BC8,0x4BE7,0x4BE8,0x4FA8,0x4FC8, - 0x4FE8,0x53C8,0x53CA,0x53CB,0x53EA,0x53EB,0x53EC,0x5BCC, - 0x5BCD,0x5BD0,0x5BEB,0x5BEC,0x5BED,0x5BEE,0x5FD0,0x5FED, - 0x5FEF,0x5FF0,0x5FF2,0x63EF,0x63F1,0x63F2,0x63F3,0x63F5, - 0x63F6,0x6BF3,0x6BF5,0x6BF6,0x6BF7,0x6BF8,0x6FF6,0x6FF7, - 0x6FF8,0x6FFA,0x6FFB,0x6FFC,0x73FB,0x73FC,0x73FD,0x73FF, - 0x7FFF,0x53E7,0x5FE8,0x4FE7,0x4BE7,0x3FE6,0x37C6,0x33A6, - 0x2BA6,0x2366,0x2325,0x2346,0x2304,0x2786,0x2306,0x2746, - 0x1F24,0x1F04,0x2345,0x1F06,0x33C6,0x33E6,0x27A6,0x2785, - 0x2B86,0x1EC4,0x37E6,0x37A6,0x3BE6,0x2745,0x47E6,0x4BE6, - 0x4FE6,0x47E7,0x5BE8,0x5BEA,0x3B86,0x3766,0x4BE8,0x53E8, - 0x5FEA,0x63EB,0x6FEF,0x73F0,0x73F1,0x6FF0,0x6FED,0x6BEC, - 0x63EA,0x5FE9,0x63E9,0x1AE4,0x2365,0x2BA5,0x27A5,0x1AA4, - 0x22C6,0x2B85,0x1A24,0x3386,0x3FC6,0x3FE7,0x2726,0x2B46, - - 0x3366,0x15C4,0x15E5,0x1644,0x1605,0x1604,0x1E84,0x1EC6, - 0x2306,0x15E4,0x1625,0x22C6,0x1664,0x1624,0x1EA6,0x1E86, - 0x1645,0x6ABB,0x6A9B,0x6A5B,0x663A,0x661A,0x5DD9,0x5D99, - 0x5519,0x48B7,0x4896,0x140C,0x140D,0x140B,0x100B,0x100A, - 0x1009,0x0C08,0x0C09,0x200F,0x200D,0x1C0D,0x1C0A,0x200C, - 0x200A,0x2009,0x202A,0x204A,0x208B,0x24C9,0x24C7,0x356D, - 0x1C0C,0x1410,0x1412,0x1C13,0x2015,0x2417,0x2C17,0x3419, - 0x3819,0x4419,0x4877,0x4C39,0x4C59,0x4C79,0x543A,0x5479, - 0x55D6,0x5859,0x5879,0x5CB9,0x5CBA,0x5CDA,0x5D39,0x5D59, - 0x5D9B,0x60F9,0x651B,0x655B,0x6A1B,0x6A3B,0x6ABB,0x6ADB, - 0x6F1B,0xFFFF,0x396C,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF, - 0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF, - 0x7E9F,0x7BDE,0x7F9F,0x186B,0x1CAB,0x1C6C,0x208E,0x204F, - 0x28B2,0x28B2,0x28B2,0x28B2,0x28B2,0x2873,0x2893,0x2C92, - 0x2CB2,0x3074,0x3094,0x30D4,0x30F4,0x3076,0x34D4,0x34F4, - 0x3476,0x34B7,0x34F7,0x3517,0x3478,0x34B8,0x3479,0x3CD6, - - 0x3CB7,0x3CB8,0x3D58,0x3CD9,0x3D39,0x3C7B,0x3CBB,0x3CDB, - 0x3CFB,0x3CFC,0x407F,0x44F8,0x4578,0x44D9,0x44F9,0x4539, - 0x44BB,0x44DB,0x455C,0x44BD,0x44DD,0x451D,0x44BE,0x447F, - 0x4D9A,0x4CDA,0x4D3C,0x4CDD,0x4D3E,0x4CBF,0x4CDF,0x4D1F, - 0x4D3F,0x54DE,0x553E,0x54DF,0x551F,0x553F,0x557F,0x5CDF, - 0x5D1F,0x5D3F,0x5D5F,0x5D7F,0x5D9F,0x651F,0x655F,0x65BF, - 0x65DF,0x661F,0x691F,0x695F,0x69BE,0x69DF,0x6A1F,0x715F, - 0x717F,0x71BF,0x71DF,0x721F,0x723F,0x725F,0x727F,0x75BF, - 0x75FF,0x761F,0x723F,0x725F,0x769F,0x773F,0x7B7F,0x75BF, - 0x75FF,0x7A3F,0x7AFF,0x7F7F,0x755F,0x75FF,0x763F,0x7A9F, - 0x7ADF,0x7F5F,0x7FBF,0x7FDF,0x75FF,0x761F,0x763F,0x765F, - 0x7A7F,0x7A9F,0x7ABF,0x7EDF,0x7EFF,0x7F3F,0x7F7F,0x7FBF, - 0x7FFF,0x0000,0xFFFF,0x31EC,0x7FE0,0x7C1F,0x7C00,0x001F, - 0x03FF,0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F, - 0x7DFF,0x7E9F,0x7BDE,0x7FFC,0x1C40,0x1C81,0x2060,0x2880, - 0x2C80,0x38C1,0x38C1,0x38C1,0x38C1,0x38C1,0x3CC0,0x3CC0, - - 0x38E0,0x38E1,0x4100,0x4500,0x4503,0x4503,0x4D00,0x4522, - 0x4522,0x4D20,0x5121,0x5123,0x5124,0x5520,0x5521,0x5920, - 0x4D62,0x5161,0x5561,0x5565,0x5961,0x5964,0x6160,0x6160, - 0x6161,0x6162,0x6562,0x6982,0x55A2,0x59A6,0x59A1,0x59A2, - 0x59A4,0x61A0,0x61A1,0x65A4,0x69A0,0x69A0,0x69A2,0x6DA0, - 0x71A0,0x5DE6,0x5DE0,0x65E3,0x69E0,0x6DE3,0x71E0,0x71E1, - 0x71E3,0x71C3,0x6E20,0x6E24,0x7221,0x7223,0x7224,0x7226, - 0x7261,0x7263,0x7264,0x7265,0x7266,0x7267,0x72A3,0x72A5, - 0x72A8,0x72A9,0x72AB,0x72C3,0x72C5,0x72C7,0x72C9,0x72C1, - 0x7306,0x7306,0x7308,0x7309,0x730B,0x730C,0x730D,0x730E, - 0x7328,0x732A,0x732B,0x7308,0x774C,0x7B90,0x7BB4,0x7FD9, - 0x7728,0x774B,0x7B8C,0x7FB5,0x7FD9,0x7725,0x772A,0x7B4D, - 0x7B70,0x7FB4,0x7FF9,0x7FFC,0x7FFD,0x7B4A,0x7B4B,0x7B4C, - 0x7B2D,0x7B6E,0x7B6F,0x7B90,0x7BB2,0x7BB3,0x7FD6,0x7FD8, - 0x7BDA,0x7FFE,0x0000,0xFFFF,0x396C,0x7FE0,0x7C1F,0x7C00, - 0x001F,0x03FF,0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F, - - 0x7C5F,0x7DFF,0x7E9F,0x7BDE,0x7F9F,0x1DD0,0x25F0,0x1DF1, - 0x2213,0x1A14,0x1E17,0x2237,0x2637,0x2657,0x2657,0x1E58, - 0x2278,0x2278,0x2678,0x1E99,0x22B9,0x2AB9,0x2EB9,0x1EBB, - 0x2AD9,0x2ED9,0x1EDB,0x2EDC,0x36DC,0x32DC,0x1EDD,0x26DE, - 0x1EDE,0x2B1B,0x271C,0x271D,0x3B3C,0x2B3D,0x331C,0x1B1E, - 0x26FE,0x2B1E,0x2F1F,0x2F1F,0x1F3F,0x335B,0x373B,0x2F3C, - 0x333C,0x333C,0x2B3E,0x2F3E,0x375E,0x235F,0x2F1F,0x2F5F, - 0x235F,0x1B5F,0x2B7A,0x2F9A,0x339C,0x2B9D,0x339E,0x379F, - 0x379F,0x3F9F,0x3F9F,0x3BDE,0x3B9E,0x2F9F,0x379F,0x3B9F, - 0x439F,0x2B9F,0x379F,0x3B9F,0x3F9F,0x439F,0x479F,0x37BF, - 0x3FDF,0x4BDF,0x4FDF,0x57DF,0x37BF,0x3FDF,0x479E,0x4B9F, - 0x539F,0x47DF,0x4BDF,0x4FDF,0x53DF,0x57DF,0x5BDF,0x5FDF, - 0x63FF,0x57FF,0x5BFF,0x5FFF,0x5BDF,0x63DF,0x6BFF,0x73FF, - 0x7BFF,0x5FFF,0x63FF,0x67FF,0x73FF,0x7BFF,0x5FFF,0x63FF, - 0x67FF,0x6FFF,0x73FF,0x77FF,0x7FBF,0x7FDF,0x57FF,0x5BFF, - 0x5FFF,0x63FF,0x67FF,0x6BFF,0x6FFF,0x73FF,0x77FF,0x7BFF, - - 0x7BFF,0x7FFF,0x7FFF,0x0000,0xFFFF,0x28ED,0x7FE0,0x7C1F, - 0x7C00,0x001F,0x03FF,0x301F,0x401F,0x501F,0x5C1F,0x681F, - 0x701F,0x7C5F,0x7DFF,0x7E9F,0x7BDE,0x7FFA,0x1180,0x1580, - 0x15C0,0x19C0,0x1600,0x1A00,0x1A40,0x1E40,0x1E80,0x2280, - 0x1EA0,0x22A0,0x1EC0,0x22C0,0x26C0,0x2300,0x2302,0x2303, - 0x2300,0x2702,0x2B03,0x2720,0x2723,0x2743,0x2744,0x2760, - 0x2761,0x2762,0x2B60,0x2B62,0x2F61,0x3366,0x3380,0x3383, - 0x33A6,0x33A1,0x33A2,0x33C3,0x37C3,0x37C0,0x3762,0x3766, - 0x3781,0x3782,0x3784,0x37A0,0x37A1,0x3BA6,0x3BC1,0x3BC2, - 0x3BC4,0x3BE0,0x3BE3,0x3F87,0x3FA1,0x3FA4,0x3FC1,0x3FE4, - 0x3FE0,0x3FE1,0x3FE3,0x3FE4,0x43E0,0x4BE2,0x4BE4,0x4BE6, - 0x4BE8,0x4BEA,0x53E2,0x53E4,0x53E6,0x53E8,0x53EA,0x53EC, - 0x5BE4,0x5BE6,0x5BE8,0x5BEA,0x5BEC,0x5FE4,0x5FE6,0x5FE8, - 0x5FEA,0x5FEC,0x67E2,0x67E4,0x67E6,0x67E8,0x67EA,0x67EC, - 0x6FE8,0x6FEA,0x6FEC,0x6FEE,0x6FF0,0x73E0,0x73E8,0x73F0, - 0x73F4,0x73F9,0x77E0,0x77E8,0x77F0,0x77F4,0x77F9,0x7BE2, - - 0x7BE6,0x7BEC,0x7BF2,0x7BF5,0x7BF9,0x7FFB,0x7BFC,0x77E0, - 0x77E2,0x77E4,0x77E6,0x77E8,0x7BEA,0x7BED,0x7BF0,0x7BF3, - 0x7BF6,0x7BF9,0x7BFB,0x7FFF,0x0000,0xFFFF,0x0006,0x3CB1 -}; -static UINT16 bloodwar_mcu_4_15[] = { // Warrior 7 Player 2 - 0x0006,0x3CB1,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x1CCB,0x1049,0x184A,0x18E9,0x1CAA,0x1C4C,0x20AE, - 0x210D,0x214C,0x20EB,0x210D,0x20CB,0x292D,0x252D,0x292E, - 0x252D,0x254C,0x292E,0x254C,0x252C,0x294D,0x290C,0x2D2D, - 0x294C,0x2D4D,0x314F,0x296F,0x318E,0x3570,0x3571,0x3551, - 0x3531,0x35D0,0x39F1,0x3190,0x3DD1,0x41D1,0x3E12,0x41D3, - 0x3DB3,0x39B2,0x3DF2,0x4253,0x45F3,0x49F2,0x3DD2,0x3E32, - 0x41B3,0x4A55,0x4654,0x41F3,0x4613,0x45D3,0x4A56,0x4A75, - 0x45D4,0x45F4,0x4E35,0x45F2,0x4612,0x4674,0x45F4,0x4A35, - 0x4A35,0x4E35,0x4A55,0x4633,0x4A14,0x4E76,0x5696,0x4E75, - 0x5257,0x5A78,0x5296,0x4E76,0x4A35,0x5278,0x56D7,0x5B19, - 0x4E97,0x673C,0x631B,0x5ADA,0x6B1C,0x673C,0x66FE,0x66FB, - 0x5EFA,0x5ADA,0x5ED9,0x62FC,0x671A,0x6B1B,0x673C,0x677D, - 0x66FA,0x777F,0x777F,0x735F,0x6B7E,0x777F,0x7B9F,0x6F5F, - 0x6B9E,0x733D,0x6B1E,0x737F,0x6F5E,0x6F5E,0x6B3D,0x737F, - - 0x6F3E,0x7FFF,0x7FFF,0x7FDF,0x7BBF,0x7FDF,0x7B9F,0x777F, - 0x7B9F,0x779F,0x7BBF,0x7FFF,0x7FFF,0x7BBF,0x7FDF,0x779F, - 0x7FDF,0x3FE7,0x0940,0x0960,0x0960,0x0980,0x09A0,0x09C0, - 0x1200,0x1220,0x1240,0x16A0,0x1AC0,0x1AE0,0x2760,0x1F40, - 0x1F60,0x26E0,0x2700,0x2720,0x2740,0x2780,0x2781,0x27A0, - 0x27A1,0x27C1,0x27E1,0x22C0,0x22E0,0x22E1,0x2300,0x2300, - 0x2340,0x3762,0x3782,0x37A2,0x37C1,0x37C2,0x37C3,0x37E2, - 0x37E2,0x37E3,0x37E5,0x3BE3,0x3BE4,0x3BE5,0x3BE5,0x3FE4, - 0x3FE4,0x4BE5,0x4BE6,0x4BE7,0x4BE5,0x4FE6,0x4FE7,0x4FE6, - 0x4FE7,0x4FE6,0x4FE6,0x4FE8,0x53E8,0x5BE8,0x5FEB,0x5FEB, - 0x67ED,0x6FF5,0x2245,0x1E03,0x21E5,0x2A46,0x3688,0x3F08, - 0x3707,0x3F48,0x47AB,0x4FAB,0x53AD,0x5FEF,0x57ED,0x57EC, - 0x57EE,0x4FCD,0x57F0,0x5BD1,0x5BEF,0x5FF0,0x5FF1,0x5FF2, - 0x63F0,0x63F1,0x63F2,0x63F3,0x6FF4,0x6BF4,0x6BF5,0x73F6, - 0x77F6,0x41D3,0x0000,0x0000,0x131A,0x2BBF,0x4FBF,0x23E0, - 0x43E0,0x67ED,0x4C07,0x6409,0x7CCF,0x3C1F,0x541F,0x6C1F, - - 0x7FFF,0x7C00,0x3786,0x37A6,0x3B86,0x3BC6,0x3F47,0x3F86, - 0x3FC6,0x3FE6,0x3FE7,0x47A7,0x47C6,0x47C7,0x47E6,0x47E7, - 0x4BA7,0x4BA8,0x4BC7,0x4BC8,0x4BE7,0x4BE8,0x4FA8,0x4FC8, - 0x4FE8,0x53C8,0x53CA,0x53CB,0x53EA,0x53EB,0x53EC,0x5BCC, - 0x5BCD,0x5BD0,0x5BEB,0x5BEC,0x5BED,0x5BEE,0x5FD0,0x5FED, - 0x5FEF,0x5FF0,0x5FF2,0x63EF,0x63F1,0x63F2,0x63F3,0x63F5, - 0x63F6,0x6BF3,0x6BF5,0x6BF6,0x6BF7,0x6BF8,0x6FF6,0x6FF7, - 0x6FF8,0x6FFA,0x6FFB,0x6FFC,0x73FB,0x73FC,0x73FD,0x73FF, - 0x7FFF,0x53E7,0x5FE8,0x4FE7,0x4BE7,0x3FE6,0x37C6,0x33A6, - 0x2BA6,0x2366,0x2325,0x2346,0x2304,0x2786,0x2306,0x2746, - 0x1F24,0x1F04,0x2345,0x1F06,0x33C6,0x33E6,0x27A6,0x2785, - 0x2B86,0x1EC4,0x37E6,0x37A6,0x3BE6,0x2745,0x47E6,0x4BE6, - 0x4FE6,0x47E7,0x5BE8,0x5BEA,0x3B86,0x3766,0x4BE8,0x53E8, - 0x5FEA,0x63EB,0x6FEF,0x73F0,0x73F1,0x6FF0,0x6FED,0x6BEC, - 0x63EA,0x5FE9,0x63E9,0x1AE4,0x2365,0x2BA5,0x27A5,0x1AA4, - 0x22C6,0x2B85,0x1A24,0x3386,0x3FC6,0x3FE7,0x2726,0x2B46, - - 0x3366,0x15C4,0x15E5,0x1644,0x1605,0x1604,0x1E84,0x1EC6, - 0x2306,0x15E4,0x1625,0x22C6,0x1664,0x1624,0x1EA6,0x1E86, - 0x1645,0x6ABB,0x6A9B,0x6A5B,0x663A,0x661A,0x5DD9,0x5D99, - 0x5519,0x48B7,0x4896,0x140C,0x140D,0x140B,0x100B,0x100A, - 0x1009,0x0C08,0x0C09,0x200F,0x200D,0x1C0D,0x1C0A,0x200C, - 0x200A,0x2009,0x202A,0x204A,0x208B,0x24C9,0x24C7,0x356D, - 0x1C0C,0x1410,0x1412,0x1C13,0x2015,0x2417,0x2C17,0x3419, - 0x3819,0x4419,0x4877,0x4C39,0x4C59,0x4C79,0x543A,0x5479, - 0x55D6,0x5859,0x5879,0x5CB9,0x5CBA,0x5CDA,0x5D39,0x5D59, - 0x5D9B,0x60F9,0x651B,0x655B,0x6A1B,0x6A3B,0x6ABB,0x6ADB, - 0x6F1B,0xFFFF,0x396C,0x7FE0,0x7C1F,0x7C00,0x001F,0x03FF, - 0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F,0x7DFF, - 0x7E9F,0x7BDE,0x7F9F,0x186B,0x1CAB,0x1C6C,0x208E,0x204F, - 0x28B2,0x28B2,0x28B2,0x28B2,0x28B2,0x2873,0x2893,0x2C92, - 0x2CB2,0x3074,0x3094,0x30D4,0x30F4,0x3076,0x34D4,0x34F4, - 0x3476,0x34B7,0x34F7,0x3517,0x3478,0x34B8,0x3479,0x3CD6, - - 0x3CB7,0x3CB8,0x3D58,0x3CD9,0x3D39,0x3C7B,0x3CBB,0x3CDB, - 0x3CFB,0x3CFC,0x407F,0x44F8,0x4578,0x44D9,0x44F9,0x4539, - 0x44BB,0x44DB,0x455C,0x44BD,0x44DD,0x451D,0x44BE,0x447F, - 0x4D9A,0x4CDA,0x4D3C,0x4CDD,0x4D3E,0x4CBF,0x4CDF,0x4D1F, - 0x4D3F,0x54DE,0x553E,0x54DF,0x551F,0x553F,0x557F,0x5CDF, - 0x5D1F,0x5D3F,0x5D5F,0x5D7F,0x5D9F,0x651F,0x655F,0x65BF, - 0x65DF,0x661F,0x691F,0x695F,0x69BE,0x69DF,0x6A1F,0x715F, - 0x717F,0x71BF,0x71DF,0x721F,0x723F,0x725F,0x727F,0x75BF, - 0x75FF,0x761F,0x723F,0x725F,0x769F,0x773F,0x7B7F,0x75BF, - 0x75FF,0x7A3F,0x7AFF,0x7F7F,0x755F,0x75FF,0x763F,0x7A9F, - 0x7ADF,0x7F5F,0x7FBF,0x7FDF,0x75FF,0x761F,0x763F,0x765F, - 0x7A7F,0x7A9F,0x7ABF,0x7EDF,0x7EFF,0x7F3F,0x7F7F,0x7FBF, - 0x7FFF,0x0000,0xFFFF,0x31EC,0x7FE0,0x7C1F,0x7C00,0x001F, - 0x03FF,0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F,0x7C5F, - 0x7DFF,0x7E9F,0x7BDE,0x7FFC,0x1C40,0x1C81,0x2060,0x2880, - 0x2C80,0x38C1,0x38C1,0x38C1,0x38C1,0x38C1,0x3CC0,0x3CC0, - - 0x38E0,0x38E1,0x4100,0x4500,0x4503,0x4503,0x4D00,0x4522, - 0x4522,0x4D20,0x5121,0x5123,0x5124,0x5520,0x5521,0x5920, - 0x4D62,0x5161,0x5561,0x5565,0x5961,0x5964,0x6160,0x6160, - 0x6161,0x6162,0x6562,0x6982,0x55A2,0x59A6,0x59A1,0x59A2, - 0x59A4,0x61A0,0x61A1,0x65A4,0x69A0,0x69A0,0x69A2,0x6DA0, - 0x71A0,0x5DE6,0x5DE0,0x65E3,0x69E0,0x6DE3,0x71E0,0x71E1, - 0x71E3,0x71C3,0x6E20,0x6E24,0x7221,0x7223,0x7224,0x7226, - 0x7261,0x7263,0x7264,0x7265,0x7266,0x7267,0x72A3,0x72A5, - 0x72A8,0x72A9,0x72AB,0x72C3,0x72C5,0x72C7,0x72C9,0x72C1, - 0x7306,0x7306,0x7308,0x7309,0x730B,0x730C,0x730D,0x730E, - 0x7328,0x732A,0x732B,0x7308,0x774C,0x7B90,0x7BB4,0x7FD9, - 0x7728,0x774B,0x7B8C,0x7FB5,0x7FD9,0x7725,0x772A,0x7B4D, - 0x7B70,0x7FB4,0x7FF9,0x7FFC,0x7FFD,0x7B4A,0x7B4B,0x7B4C, - 0x7B2D,0x7B6E,0x7B6F,0x7B90,0x7BB2,0x7BB3,0x7FD6,0x7FD8, - 0x7BDA,0x7FFE,0x0000,0xFFFF,0x396C,0x7FE0,0x7C1F,0x7C00, - 0x001F,0x03FF,0x301F,0x401F,0x501F,0x5C1F,0x681F,0x701F, - - 0x7C5F,0x7DFF,0x7E9F,0x7BDE,0x7F9F,0x1DD0,0x25F0,0x1DF1, - 0x2213,0x1A14,0x1E17,0x2237,0x2637,0x2657,0x2657,0x1E58, - 0x2278,0x2278,0x2678,0x1E99,0x22B9,0x2AB9,0x2EB9,0x1EBB, - 0x2AD9,0x2ED9,0x1EDB,0x2EDC,0x36DC,0x32DC,0x1EDD,0x26DE, - 0x1EDE,0x2B1B,0x271C,0x271D,0x3B3C,0x2B3D,0x331C,0x1B1E, - 0x26FE,0x2B1E,0x2F1F,0x2F1F,0x1F3F,0x335B,0x373B,0x2F3C, - 0x333C,0x333C,0x2B3E,0x2F3E,0x375E,0x235F,0x2F1F,0x2F5F, - 0x235F,0x1B5F,0x2B7A,0x2F9A,0x339C,0x2B9D,0x339E,0x379F, - 0x379F,0x3F9F,0x3F9F,0x3BDE,0x3B9E,0x2F9F,0x379F,0x3B9F, - 0x439F,0x2B9F,0x379F,0x3B9F,0x3F9F,0x439F,0x479F,0x37BF, - 0x3FDF,0x4BDF,0x4FDF,0x57DF,0x37BF,0x3FDF,0x479E,0x4B9F, - 0x539F,0x47DF,0x4BDF,0x4FDF,0x53DF,0x57DF,0x5BDF,0x5FDF, - 0x63FF,0x57FF,0x5BFF,0x5FFF,0x5BDF,0x63DF,0x6BFF,0x73FF, - 0x7BFF,0x5FFF,0x63FF,0x67FF,0x73FF,0x7BFF,0x5FFF,0x63FF, - 0x67FF,0x6FFF,0x73FF,0x77FF,0x7FBF,0x7FDF,0x57FF,0x5BFF, - 0x5FFF,0x63FF,0x67FF,0x6BFF,0x6FFF,0x73FF,0x77FF,0x7BFF, - - 0x7BFF,0x7FFF,0x7FFF,0x0000,0xFFFF,0x28ED,0x7FE0,0x7C1F, - 0x7C00,0x001F,0x03FF,0x301F,0x401F,0x501F,0x5C1F,0x681F, - 0x701F,0x7C5F,0x7DFF,0x7E9F,0x7BDE,0x7FFA,0x1180,0x1580, - 0x15C0,0x19C0,0x1600,0x1A00,0x1A40,0x1E40,0x1E80,0x2280, - 0x1EA0,0x22A0,0x1EC0,0x22C0,0x26C0,0x2300,0x2302,0x2303, - 0x2300,0x2702,0x2B03,0x2720,0x2723,0x2743,0x2744,0x2760, - 0x2761,0x2762,0x2B60,0x2B62,0x2F61,0x3366,0x3380,0x3383, - 0x33A6,0x33A1,0x33A2,0x33C3,0x37C3,0x37C0,0x3762,0x3766, - 0x3781,0x3782,0x3784,0x37A0,0x37A1,0x3BA6,0x3BC1,0x3BC2, - 0x3BC4,0x3BE0,0x3BE3,0x3F87,0x3FA1,0x3FA4,0x3FC1,0x3FE4, - 0x3FE0,0x3FE1,0x3FE3,0x3FE4,0x43E0,0x4BE2,0x4BE4,0x4BE6, - 0x4BE8,0x4BEA,0x53E2,0x53E4,0x53E6,0x53E8,0x53EA,0x53EC, - 0x5BE4,0x5BE6,0x5BE8,0x5BEA,0x5BEC,0x5FE4,0x5FE6,0x5FE8, - 0x5FEA,0x5FEC,0x67E2,0x67E4,0x67E6,0x67E8,0x67EA,0x67EC, - 0x6FE8,0x6FEA,0x6FEC,0x6FEE,0x6FF0,0x73E0,0x73E8,0x73F0, - 0x73F4,0x73F9,0x77E0,0x77E8,0x77F0,0x77F4,0x77F9,0x7BE2, - - 0x7BE6,0x7BEC,0x7BF2,0x7BF5,0x7BF9,0x7FFB,0x7BFC,0x77E0, - 0x77E2,0x77E4,0x77E6,0x77E8,0x7BEA,0x7BED,0x7BF0,0x7BF3, - 0x7BF6,0x7BF9,0x7BFB,0x7FFF,0x0000,0xFFFF,0x0002,0x0000 -}; -static UINT16 bloodwar_mcu_4_16[] = { // Warrior 8 Player 1 - 0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x29A9,0x2DCA,0x31EB,0x360C,0x3A0D,0x3A2D,0x3A4D, - 0x3E4E,0x3E6E,0x3E6F,0x426E,0x428E,0x468E,0x468F,0x4AAF, - 0x4AB0,0x46D0,0x4AD0,0x4AF0,0x4AF1,0x4EF1,0x4F11,0x4F12, - 0x5311,0x5312,0x5330,0x5751,0x5752,0x5B73,0x5B74,0x5B93, - 0x5B94,0x6396,0x67D5,0x67D6,0x67D7,0x67D5,0x67D6,0x6BD6, - 0x6BD7,0x6BD9,0x6BD5,0x6BD6,0x6BD7,0x6BD6,0x6FD6,0x6FD7, - 0x6FD9,0x73D7,0x73D8,0x73DA,0x7BD8,0x7BF9,0x7BFA,0x7BFB, - 0x7BFC,0x7FFB,0x7FFB,0x7FFC,0x7FFD,0x7FFB,0x7FFD,0x7FFD, - 0x7FFE,0x1946,0x1965,0x2187,0x21A5,0x25A7,0x29C7,0x29E8, - 0x360A,0x362B,0x3A8C,0x426D,0x428C,0x46EF,0x4ACF,0x5350, - 0x5352,0x5752,0x5753,0x5791,0x5B53,0x5B73,0x5FB3,0x6374, - 0x63B3,0x63B4,0x63D4,0x67B4,0x67D4,0x67D6,0x6FF6,0x6FF7, - 0x73F7,0x0882,0x0CA3,0x10E3,0x10E4,0x1103,0x1104,0x1524, - 0x1945,0x1965,0x1D65,0x1985,0x1986,0x21A6,0x21A7,0x21C6, - - 0x25A6,0x29E9,0x2E09,0x2E28,0x2E29,0x364B,0x3A4D,0x3E8C, - 0x42CC,0x4B0F,0x4EF2,0x5BD3,0x67F7,0x6BF5,0x73F8,0x77FB, - 0x7FFC,0x1982,0x1DA4,0x21C5,0x25E6,0x2A07,0x2E27,0x2E47, - 0x3267,0x36A8,0x3AC9,0x3EEA,0x3F0A,0x3F2B,0x434C,0x476C, - 0x478C,0x4F8E,0x4FAD,0x4FCE,0x53EF,0x53F0,0x57F0,0x5BF0, - 0x5BF1,0x5FF3,0x5FF4,0x5FF2,0x63F2,0x63F4,0x67F5,0x6BF6, - 0x73F8,0x1E24,0x1E44,0x2265,0x2287,0x22A7,0x26C8,0x26E8, - 0x2B09,0x2F2A,0x3349,0x3F6C,0x438D,0x47AE,0x53D2,0x57F2, - 0x5FF3,0x0C09,0x100A,0x180C,0x1C0D,0x200E,0x240F,0x2810, - 0x3052,0x3473,0x3CB5,0x44F7,0x4D39,0x557B,0x5DBD,0x65FE, - 0x7BBE,0x10C3,0x1905,0x2146,0x2546,0x2988,0x31C8,0x35C9, - 0x39EB,0x3E0C,0x422C,0x464E,0x56F2,0x5733,0x5753,0x5B33, - 0x5B52,0x10E3,0x0CA3,0x10E4,0x1103,0x1104,0x1524,0x1946, - 0x21A5,0x2A08,0x322A,0x366A,0x42EE,0x4F0F,0x5FB2,0x5FB3, - 0x63D3,0x3D71,0x7FE0,0x7C1F,0x7C00,0x0E60,0x1EC0,0x2300, - 0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED,0x77EE,0x77F5, - - 0x7BDE,0xFFFF,0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108 -}; -static UINT16 bloodwar_mcu_4_17[] = { // Warrior 8 Player 2 - 0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x296A,0x2D8B,0x31AC,0x35CD,0x35EF,0x39F0,0x3A10, - 0x3DD1,0x3E11,0x3E12,0x4230,0x4231,0x4630,0x4631,0x4671, - 0x4673,0x4674,0x4A73,0x4A93,0x4AB3,0x4AB4,0x4E74,0x4E75, - 0x52B3,0x52B4,0x52D3,0x56F4,0x56F5,0x5B16,0x5B17,0x5B36, - 0x5B37,0x6339,0x6778,0x6779,0x677A,0x6778,0x6779,0x6B79, - 0x6B7A,0x6B7C,0x6B78,0x6B79,0x6B7A,0x6B79,0x6F79,0x6F7A, - 0x6F7C,0x737A,0x737B,0x737D,0x7B7B,0x7B9C,0x7B9D,0x7B9E, - 0x7B9F,0x7F9E,0x7F9E,0x7F9F,0x7FBF,0x7F9E,0x7FBF,0x7FBF, - 0x7FBF,0x18E9,0x1908,0x212A,0x2148,0x254A,0x296A,0x298B, - 0x35AD,0x35CE,0x3A2F,0x4210,0x422F,0x4692,0x4A72,0x52D3, - 0x52F5,0x56F5,0x56F6,0x5715,0x5AF6,0x5B16,0x5F36,0x6317, - 0x6356,0x6357,0x6377,0x6757,0x6777,0x6779,0x6F99,0x6F9A, - 0x739A,0x0825,0x0C46,0x1086,0x1087,0x10A6,0x10A7,0x14C7, - 0x18E8,0x1908,0x1D08,0x1928,0x1929,0x2149,0x214A,0x2169, - - 0x2549,0x298C,0x2DAC,0x2DCB,0x2DCC,0x35EE,0x39F0,0x3E2F, - 0x426F,0x4AB2,0x4E95,0x5B76,0x679A,0x6B98,0x739B,0x779E, - 0x7F9F,0x1982,0x1DA4,0x21C5,0x25E6,0x2A07,0x2E27,0x2E47, - 0x3267,0x36A8,0x3AC9,0x3EEA,0x3F0A,0x3F2B,0x434C,0x476C, - 0x478C,0x4F8E,0x4FAD,0x4FCE,0x53EF,0x53F0,0x57F0,0x5BF0, - 0x5BF1,0x5FF3,0x5FF4,0x5FF2,0x63F2,0x63F4,0x67F5,0x6BF6, - 0x739B,0x2810,0x2C31,0x3473,0x3894,0x3CB5,0x40D6,0x44F7, - 0x4918,0x4D39,0x515A,0x557B,0x599C,0x5DBD,0x65FE,0x6A1F, - 0x767F,0x0C09,0x100A,0x180C,0x1C0D,0x200E,0x240F,0x2810, - 0x3052,0x3473,0x3CB5,0x44F7,0x4D39,0x557B,0x5DBD,0x65FE, - 0x7BBE,0x10C3,0x1905,0x2146,0x2546,0x2988,0x31C8,0x35C9, - 0x39EB,0x3E0C,0x422C,0x464E,0x56F2,0x5733,0x5753,0x5B33, - 0x5B52,0x10E3,0x0CA3,0x10E4,0x1103,0x1104,0x1524,0x1946, - 0x21A5,0x2A08,0x322A,0x366A,0x42EE,0x4F0F,0x5FB2,0x5FB3, - 0x63D3,0x3D71,0x7FE0,0x7C1F,0x7C00,0x0E60,0x1EC0,0x2300, - 0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED,0x77EE,0x77F5, - - 0x7BDE,0xFFFF,0x0003,0x0000,0x4232,0x56F8,0x2D8D,0x2108 -}; -static UINT16 bloodwar_mcu_4_18[] = { // Warrior 2 Player 2 - 0x0003,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x1524,0x0CC2,0x0CE2,0x0CE3,0x10E3,0x1103,0x14E3, - 0x1544,0x1946,0x1966,0x2166,0x2167,0x2187,0x2567,0x25A7, - 0x29E8,0x31EA,0x320A,0x3A4B,0x3A4D,0x3A6B,0x3E4D,0x3E6B, - 0x3E6D,0x3E6E,0x3E8D,0x426E,0x428E,0x468F,0x46AE,0x46CF, - 0x46EE,0x46EF,0x4710,0x4AEF,0x4EF0,0x4F10,0x4F11,0x52F1, - 0x5310,0x5312,0x5313,0x5332,0x5732,0x5753,0x5B33,0x5B34, - 0x5B53,0x5F95,0x5FB5,0x5FD4,0x63B4,0x63B5,0x63B6,0x63D5, - 0x67F7,0x6FD7,0x6FF7,0x6FF8,0x6FF7,0x6FF8,0x73FA,0x7BFC, - 0x7FFC,0x0440,0x0080,0x0940,0x0D80,0x11C0,0x1200,0x1240, - 0x1280,0x12E0,0x1300,0x1301,0x1761,0x1B81,0x1BC2,0x1BE1, - 0x1E01,0x1E80,0x1EA0,0x22C0,0x22E1,0x2361,0x2381,0x2382, - 0x2782,0x27C2,0x27E4,0x2BC3,0x2FC4,0x2FE5,0x33E5,0x33E6, - 0x37E8,0x1520,0x1500,0x1940,0x1960,0x1D80,0x25E1,0x2DE3, - 0x3242,0x3262,0x3683,0x3EC3,0x3EC4,0x3F23,0x42A5,0x42C7, - - 0x4765,0x4B08,0x4B46,0x4B66,0x53C7,0x5769,0x57C7,0x5BC8, - 0x5BCA,0x5FC9,0x5FE8,0x5FE9,0x6FEB,0x73ED,0x77EF,0x7FF4, - 0x7FF8,0x2E0A,0x320A,0x3A4E,0x3A6D,0x3E4D,0x3E6D,0x3E6E, - 0x426E,0x46CF,0x5310,0x5312,0x5332,0x5B94,0x5FB6,0x6797, - 0x67D6,0x6BD8,0x6BDA,0x6BF9,0x6BFA,0x6FDC,0x6FFA,0x6FFB, - 0x73FB,0x73FC,0x7BFB,0x7BFC,0x7BFD,0x7BFE,0x7FFD,0x7FFE, - 0x7FFF,0x1504,0x10E4,0x1524,0x1945,0x1965,0x1D67,0x1D87, - 0x2587,0x25A8,0x29E8,0x2A07,0x2E08,0x324A,0x3268,0x3269, - 0x3A68,0x3A8B,0x3EAB,0x42CB,0x4F2E,0x5330,0x534F,0x5352, - 0x57B1,0x5FB3,0x5FB4,0x67F3,0x6BF4,0x6BF5,0x6BF8,0x6FF7, - 0x73F9,0x0461,0x0441,0x0862,0x0882,0x0CC2,0x0CC3,0x0CE2, - 0x0CE3,0x10C3,0x10E3,0x10E4,0x1103,0x1104,0x1123,0x14E4, - 0x1524,0xFFFF,0x390F,0x7FE0,0x7C1F,0x7C00,0x0013,0x101A, - 0x181C,0x1C1F,0x241F,0x0BE0,0x3BE0,0x53E0,0x381F,0x4C1F, - 0x65FF,0x7BDE,0xFFFF,0x41D3,0x0013,0x281F,0x581F,0x6DFF, - 0x2243,0x0000,0x0340,0x4210,0x4A52,0x5294,0x5AD6,0x6318, - - 0x4409,0x7BC0,0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00,0x36A0, - 0x3EA0,0x46E0,0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2,0x7FF0, - 0x7FF6,0x7FFC,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x3809, - 0x3C09,0x4009,0x4406,0x480E,0x500F,0x5812,0x6016,0x70FB, - 0x7DBD,0x7EBD,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0013, - 0x101A,0x181C,0x201F,0x281F,0x341F,0x401F,0x481F,0x581F, - 0x681F,0x6DFF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x301F, - 0x381F,0x401F,0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F, - 0x7E5F,0x7B5F,0x7FFF,0x0000,0x7FE0,0x7C1F,0x0B58,0x13BB, - 0x1FFF,0x33FF,0x43FF,0x47FF,0x4FFF,0x57FF,0x5FFF,0x67FF, - 0x6FFF,0x77FF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0200, - 0x0200,0x0260,0x02C0,0x0320,0x03E0,0x23E0,0x33E7,0x47EC, - 0x5FF3,0x6FF8,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0E60, - 0x1EC0,0x2300,0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED, - 0x77EE,0x77F5,0x7FFF,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409, - 0x4C07,0x5407,0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15, - - 0x7EBA,0x7F5D,0x7FFF,0x2AA1,0x3724,0x3FA6,0x43E0,0x4FE8, - 0x5BC4,0x63C5,0x67EB,0x67EB,0x67ED,0x6FF0,0x77F3,0x7FF7, - 0x7FFA,0x7FFC,0x7FFF,0x0220,0x0260,0x0280,0x02C0,0x02E0, - 0x0320,0x0340,0x2780,0x2BA0,0x37E0,0x3FE0,0x0340,0x0BE0, - 0x13E0,0x1DA3,0x2243,0x41D3,0x0842,0x1084,0x18C6,0x2108, - 0x294A,0x318C,0x39CE,0x03A0,0x23E0,0x37E0,0x3FE0,0x4FE0, - 0x67ED,0x77EE,0x7FFF,0xFFFF,0x0003,0x0000,0x4232,0x56F8 -}; -static UINT16 bloodwar_mcu_4_19[] = { // Warrior 2 Player 1 - 0x0003,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x1524,0x0CC2,0x0CE2,0x0CE3,0x10E3,0x1103,0x14E3, - 0x1544,0x1946,0x1966,0x2166,0x2167,0x2187,0x2567,0x25A7, - 0x29E8,0x2A05,0x2E05,0x2E45,0x3266,0x3285,0x3285,0x3284, - 0x32A5,0x36C5,0x3AE1,0x3EC1,0x3EE2,0x4704,0x4724,0x4745, - 0x4764,0x4765,0x4786,0x4B65,0x4F66,0x4F86,0x4F87,0x5367, - 0x5386,0x57A8,0x57A9,0x57C8,0x5BC8,0x5BE9,0x5FC9,0x5FCA, - 0x5FE9,0x63EC,0x63EC,0x63EB,0x67EB,0x6BEB,0x6BEE,0x6BED, - 0x6FEF,0x73EE,0x73EE,0x73EF,0x73EE,0x77EF,0x7BF3,0x7FF5, - 0x7FF6,0x0440,0x0080,0x0940,0x0D80,0x11C0,0x1200,0x1240, - 0x1280,0x12E0,0x1300,0x1301,0x1761,0x1B81,0x1BC2,0x1BE1, - 0x1E01,0x1E80,0x1EA0,0x22C0,0x22E1,0x2361,0x2381,0x2382, - 0x2782,0x27C2,0x27E4,0x2BC3,0x2FC4,0x2FE5,0x33E5,0x33E6, - 0x37E8,0x1520,0x1500,0x1940,0x1960,0x1D80,0x25E1,0x2DE3, - 0x3242,0x3262,0x3683,0x3EC3,0x3EC4,0x3F23,0x42A5,0x42C7, - - 0x4765,0x4B08,0x4B46,0x4B66,0x53C7,0x5769,0x57C7,0x5BC8, - 0x5BCA,0x5FC9,0x5FE8,0x5FE9,0x6FEB,0x73ED,0x77EF,0x7FF4, - 0x7FF8,0x2A61,0x2E81,0x32A3,0x36C2,0x3AC2,0x3EE3,0x42E3, - 0x4303,0x4324,0x4B45,0x4F67,0x4F88,0x57A9,0x5BCD,0x63ED, - 0x63EE,0x6BEE,0x6BF0,0x6BEF,0x6BF0,0x6FF2,0x6FF0,0x6FF1, - 0x73F1,0x73F2,0x7BF2,0x7BF3,0x7BF4,0x7BF7,0x7FFC,0x7FFC, - 0x7FFC,0x1504,0x10E4,0x1524,0x1945,0x1965,0x1D67,0x1D87, - 0x2587,0x25A8,0x29E8,0x2A07,0x2E08,0x324A,0x3268,0x3269, - 0x3A68,0x32C0,0x36E0,0x3B00,0x3F20,0x4343,0x4B63,0x4F87, - 0x53A6,0x57C7,0x5BE9,0x5FE7,0x63E8,0x63E9,0x63EC,0x67EC, - 0x6BED,0x0461,0x0441,0x0862,0x0882,0x0CC2,0x0CC3,0x0CE2, - 0x0CE3,0x10C3,0x10E3,0x10E4,0x1103,0x1104,0x1123,0x14E4, - 0x1524,0xFFFF,0x390F,0x7FE0,0x7C1F,0x7C00,0x0013,0x101A, - 0x181C,0x1C1F,0x241F,0x0BE0,0x3BE0,0x53E0,0x381F,0x4C1F, - 0x65FF,0x7BDE,0xFFFF,0x41D3,0x0013,0x281F,0x581F,0x6DFF, - 0x2243,0x0000,0x0340,0x4210,0x4A52,0x5294,0x5AD6,0x6318, - - 0x4409,0x7BC0,0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00,0x36A0, - 0x3EA0,0x46E0,0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2,0x7FF0, - 0x7FF6,0x7FFC,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x3809, - 0x3C09,0x4009,0x4406,0x480E,0x500F,0x5812,0x6016,0x70FB, - 0x7DBD,0x7EBD,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0013, - 0x101A,0x181C,0x201F,0x281F,0x341F,0x401F,0x481F,0x581F, - 0x681F,0x6DFF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x301F, - 0x381F,0x401F,0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F, - 0x7E5F,0x7B5F,0x7FFF,0x0000,0x7FE0,0x7C1F,0x0B58,0x13BB, - 0x1FFF,0x33FF,0x43FF,0x47FF,0x4FFF,0x57FF,0x5FFF,0x67FF, - 0x6FFF,0x77FF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0200, - 0x0200,0x0260,0x02C0,0x0320,0x03E0,0x23E0,0x33E7,0x47EC, - 0x5FF3,0x6FF8,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0E60, - 0x1EC0,0x2300,0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED, - 0x77EE,0x77F5,0x7FFF,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409, - 0x4C07,0x5407,0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15, - - 0x7EBA,0x7F5D,0x7FFF,0x2AA1,0x3724,0x3FA6,0x43E0,0x4FE8, - 0x5BC4,0x63C5,0x67EB,0x67EB,0x67ED,0x6FF0,0x77F3,0x7FF7, - 0x7FFA,0x7FFC,0x7FFF,0x0220,0x0260,0x0280,0x02C0,0x02E0, - 0x0320,0x0340,0x2780,0x2BA0,0x37E0,0x3FE0,0x0340,0x0BE0, - 0x13E0,0x1DA3,0x2243,0x41D3,0x0842,0x1084,0x18C6,0x2108, - 0x294A,0x318C,0x39CE,0x03A0,0x23E0,0x37E0,0x3FE0,0x4FE0, - 0x67ED,0x77EE,0x7FFF,0xFFFF,0x0005,0x0000,0x4232,0x56F8 -}; -static UINT16 bloodwar_mcu_4_1a[] = { // Warrior 3 Player 1 - 0x0005,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x08A0,0x0D02,0x1142,0x19C2,0x3EEB,0x430D,0x4B6C, - 0x4F4F,0x4F50,0x432A,0x368A,0x328A,0x3AE9,0x3689,0x3268, - 0x2A26,0x2A27,0x3AE9,0x4B4E,0x3269,0x3EEB,0x3AA8,0x19A3, - 0x08E2,0x21E5,0x2E47,0x3F2A,0x4B4F,0x3F0B,0x3AEB,0x36A8, - 0x25E3,0x1DC6,0x2606,0x2E46,0x36AA,0x2E66,0x36A8,0x36CA, - 0x32A9,0x2604,0x15C2,0x1182,0x0D42,0x1583,0x1162,0x0D22, - 0x15A2,0x19E3,0x11C2,0x1E45,0x1A04,0x2204,0x2E68,0x25E4, - 0x1DA4,0x3268,0x3AC9,0x4B2D,0x36A9,0x430C,0x2A46,0x534F, - 0x532F,0x42EA,0x2A26,0x1964,0x4F8E,0x4F8D,0x4B6C,0x474D, - 0x434A,0x3F29,0x3AE8,0x3B08,0x474B,0x3F09,0x4349,0x4B6B, - 0x1944,0x1D44,0x25C7,0x2E08,0x3AEA,0x3688,0x3247,0x3A2A, - 0x3AC8,0x3689,0x3EAA,0x426E,0x10C3,0x2603,0x1503,0x1925, - 0x42CA,0x42EB,0x3F2A,0x25E3,0x42A8,0x534E,0x1924,0x46CC, - 0x4B0D,0x2EA4,0x1DE4,0x2605,0x2E67,0x3ACA,0x3AAA,0x2A45, - - 0x1185,0x2E46,0x1122,0x0862,0x08C2,0x1562,0x2A25,0x2A26, - 0x2624,0x472E,0x3688,0x4B4D,0x15A3,0x21E4,0x4F4E,0x4F6E, - 0x4F6D,0x5F34,0x5F36,0x5F36,0x5F56,0x4ED1,0x46AF,0x426E, - 0x2E26,0x21C6,0x324A,0x5B14,0x6777,0x6356,0x5F15,0x1380, - 0x1380,0x0F60,0x0F80,0x0F80,0x0F20,0x1300,0x0EE0,0x0F00, - 0x1320,0x0E82,0x1300,0x0A02,0x0DE2,0x0E02,0x09A2,0x0DC2, - 0x0D82,0x0D85,0x0E22,0x0E42,0x1262,0x1720,0x0EE0,0x0F00, - 0x1320,0x0F20,0x0F60,0x1623,0x1AA4,0x1683,0x1283,0x12A3, - 0x0E62,0x15E3,0x13A0,0x0B60,0x1282,0x12A2,0x16E0,0x1760, - 0x1760,0x1B80,0x1780,0x1F80,0x1B80,0x1B60,0x1AE0,0x1B60, - 0x1720,0x5FE5,0x5BE5,0x5BE5,0x5BE4,0x57E4,0x5BE4,0x4FA4, - 0x4B84,0x4B84,0x4F85,0x53A4,0x4B85,0x53A6,0x57C5,0x4366, - 0x4B87,0x4BA7,0x4766,0x2EC4,0x2EA6,0x2643,0x3B07,0x32A3, - 0x36C3,0x57E8,0x57CA,0x4FC4,0x32E3,0x32E4,0x32C3,0x2263, - 0x2AA3,0x2E91,0x6004,0x3FA6,0x2AA1,0x3724,0x3FA6,0x43E0, - 0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0,0x77F3,0x7FFA,0x7FFC, - - 0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00,0x36A0,0x3EA0,0x46E0, - 0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2,0x7FF0,0x7FF6,0x7FFC, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x3809,0x3C09,0x4009, - 0x4406,0x480E,0x500F,0x5812,0x6016,0x70FB,0x7DBD,0x7EBD, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0013,0x101A,0x181C, - 0x201F,0x281F,0x341F,0x401F,0x481F,0x581F,0x681F,0x6DFF, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x301F,0x381F,0x401F, - 0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F,0x7E5F,0x7B5F, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x024F,0x02B3,0x0AF5,0x1358, - 0x1B9C,0x23FD,0x2BFF,0x3FFF,0x4FFF,0x5FFF,0x6BFF,0x77FF, - 0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0200,0x0200,0x0260, - 0x02C0,0x0320,0x03E0,0x23E0,0x33E7,0x47EC,0x5FF3,0x6FF8, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0E60,0x1EC0,0x2300, - 0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED,0x77EE,0x77F5, - 0x7BDE,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409,0x4C07,0x5407, - 0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15,0x7EBA,0x7F5D, - - 0x7BDE,0x3408,0x3C0F,0x4813,0x4C12,0x5413,0x5C0F,0x680D, - 0x700A,0x7484,0x7900,0x7DA0,0x7ECD,0x7F6D,0x7FF5,0x7F7E, - 0x7BDE,0x240C,0x280C,0x2C0C,0x340C,0x380C,0x3C0C,0x400C, - 0x440E,0x4810,0x5012,0x5413,0x400E,0x440E,0x4C0E,0x284F, - 0x2C4E,0xFFFF,0x410E,0x6004,0x3FA6,0x2AA1,0x3724,0x3FA6, - 0x43E0,0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0,0x77F3,0x7FFA, - 0x7FFC,0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00,0x36A0,0x3EA0, - 0x46E0,0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2,0x7FF0,0x7FF6, - 0x7FFC,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x3809,0x3C09, - 0x4009,0x4406,0x480E,0x500F,0x5812,0x6016,0x70FB,0x7DBD, - 0x7EBD,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0013,0x101A, - 0x181C,0x201F,0x281F,0x341F,0x401F,0x481F,0x581F,0x681F, - 0x6DFF,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x301F,0x381F, - 0x401F,0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F,0x7E5F, - 0x7B5F,0x7BDE,0x0000,0x7FE0,0x7C1F,0x024F,0x02B3,0x0AF5, - 0x1358,0x1B9C,0x23FD,0x2BFF,0x3FFF,0x4FFF,0x5FFF,0x6BFF, - - 0x77FF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0200,0x0200, - 0x0260,0x02C0,0x0320,0x03E0,0x23E0,0x33E7,0x47EC,0x5FF3, - 0x6FF8,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0E60,0x1EC0, - 0x2300,0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED,0x77EE, - 0x77F5,0x7BDE,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409,0x4C07, - 0x5407,0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15,0x7EBA, - 0x7F5D,0x7BDE,0x0216,0x0257,0x12D8,0x2718,0x2FB8,0x3FB9, - 0x47FA,0x4FFC,0x53FF,0x5BFF,0x5BFF,0x67FE,0x6FFF,0x73DF, - 0x7BDF,0x7FFF,0x01B2,0x01F4,0x0215,0x0237,0x0258,0x027A, - 0x029B,0x02DB,0x02FA,0x033A,0x035B,0x029B,0x02DD,0x031F, - 0x0210,0x0215,0xFFFF,0x41D3,0x6004,0x3FA6,0x2AA1,0x3724, - 0x3FA6,0x43E0,0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0,0x77F3, - 0x7FFA,0x7FFC,0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00,0x36A0, - 0x3EA0,0x46E0,0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2,0x7FF0, - 0x7FF6,0x7FFC,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x3809, - 0x3C09,0x4009,0x4406,0x480E,0x500F,0x5812,0x6016,0x70FB, - - 0x7DBD,0x7EBD,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0013, - 0x101A,0x181C,0x201F,0x281F,0x341F,0x401F,0x481F,0x581F, - 0x681F,0x6DFF,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x301F, - 0x381F,0x401F,0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F, - 0x7E5F,0x7B5F,0x7BDE,0x0000,0x7FE0,0x7C1F,0x024F,0x02B3, - 0x0AF5,0x1358,0x1B9C,0x23FD,0x2BFF,0x3FFF,0x4FFF,0x5FFF, - 0x6BFF,0x77FF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0200, - 0x0200,0x0260,0x02C0,0x0320,0x03E0,0x23E0,0x33E7,0x47EC, - 0x5FF3,0x6FF8,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0E60, - 0x1EC0,0x2300,0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED, - 0x77EE,0x77F5,0x7BDE,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409, - 0x4C07,0x5407,0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15, - 0x7EBA,0x7F5D,0x7BDE,0x1B01,0x23A0,0x2FC0,0x3BE0,0x43E0, - 0x4FC0,0x57C0,0x5FE0,0x63E0,0x67E0,0x6FE0,0x77EE,0x7FF3, - 0x7FFA,0x7FFC,0x7FFF,0x0220,0x0260,0x0280,0x02C0,0x02E0, - 0x0320,0x0340,0x2780,0x2BA0,0x37E0,0x3FE0,0x0340,0x0BE0, - - 0x13E0,0x1DA3,0x2243,0xFFFF,0x410E,0x6004,0x3FA6,0x2AA1, - 0x3724,0x3FA6,0x43E0,0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0, - 0x77F3,0x7FFA,0x7FFC,0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00, - 0x36A0,0x3EA0,0x46E0,0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2, - 0x7FF0,0x7FF6,0x7FFC,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x3809,0x3C09,0x4009,0x4406,0x480E,0x500F,0x5812,0x6016, - 0x70FB,0x7DBD,0x7EBD,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x0013,0x101A,0x181C,0x201F,0x281F,0x341F,0x401F,0x481F, - 0x581F,0x681F,0x6DFF,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x301F,0x381F,0x401F,0x481F,0x541F,0x5C1F,0x681F,0x701F, - 0x7C5F,0x7E5F,0x7B5F,0x7BDE,0x0000,0x7FE0,0x7C1F,0x024F, - 0x02B3,0x0AF5,0x1358,0x1B9C,0x23FD,0x2BFF,0x3FFF,0x4FFF, - 0x5FFF,0x6BFF,0x77FF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x0200,0x0200,0x0260,0x02C0,0x0320,0x03E0,0x23E0,0x33E7, - 0x47EC,0x5FF3,0x6FF8,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x0E60,0x1EC0,0x2300,0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0, - - 0x67ED,0x77EE,0x77F5,0x7BDE,0x2D2F,0x7FE0,0x3405,0x3C05, - 0x4409,0x4C07,0x5407,0x5C0A,0x6409,0x6C09,0x7409,0x7CCF, - 0x7E15,0x7EBA,0x7F5D,0x7BDE,0x19B7,0x21DA,0x31BC,0x3D9E, - 0x499E,0x511D,0x5CFE,0x60DF,0x68BF,0x707F,0x741F,0x7C1F, - 0x7E7F,0x7F5F,0x7F9F,0x7FFF,0x018C,0x018E,0x018F,0x0191, - 0x0192,0x0194,0x0195,0x2597,0x2998,0x3599,0x3D99,0x0195, - 0x0999,0x1199,0x21CF,0x25D4,0xFFFF,0x0005,0x0000,0x4232 -}; -static UINT16 bloodwar_mcu_4_1b[] = { // Warrior 3 Player 2 - 0x0005,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C, - 0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C, - 0x7BDE,0x08A0,0x0D02,0x1142,0x19C2,0x3EEB,0x430D,0x4B6C, - 0x4F4F,0x4F50,0x432A,0x368A,0x328A,0x3AE9,0x3689,0x3268, - 0x2A26,0x2A27,0x3AE9,0x4B4E,0x3269,0x3EEB,0x3AA8,0x19A3, - 0x08E2,0x21E5,0x2E47,0x3F2A,0x4B4F,0x3F0B,0x3AEB,0x36A8, - 0x25E3,0x1DC6,0x2606,0x2E46,0x36AA,0x2E66,0x36A8,0x36CA, - 0x32A9,0x2604,0x15C2,0x1182,0x0D42,0x1583,0x1162,0x0D22, - 0x15A2,0x19E3,0x11C2,0x1E45,0x1A04,0x2204,0x2E68,0x25E4, - 0x1DA4,0x3268,0x3AC9,0x4B2D,0x36A9,0x430C,0x2A46,0x534F, - 0x532F,0x42EA,0x2A26,0x1964,0x4F8E,0x4F8D,0x4B6C,0x474D, - 0x434A,0x3F29,0x3AE8,0x3B08,0x474B,0x3F09,0x4349,0x4B6B, - 0x1944,0x1D44,0x25C7,0x2E08,0x3AEA,0x3688,0x3247,0x3A2A, - 0x3AC8,0x3689,0x3EAA,0x426E,0x10C3,0x2603,0x1503,0x1925, - 0x42CA,0x42EB,0x3F2A,0x25E3,0x42A8,0x534E,0x1924,0x46CC, - 0x4B0D,0x2EA4,0x1DE4,0x2605,0x2E67,0x3ACA,0x3AAA,0x2A45, - - 0x1185,0x2E46,0x1122,0x0862,0x08C2,0x1562,0x2A25,0x2A26, - 0x2624,0x472E,0x3688,0x4B4D,0x15A3,0x21E4,0x4F4E,0x4F6E, - 0x4F6D,0x5F34,0x5F36,0x5F36,0x5F56,0x4ED1,0x46AF,0x426E, - 0x2E26,0x21C6,0x324A,0x5B14,0x6777,0x6356,0x5F15,0x036E, - 0x036F,0x032D,0x034D,0x034E,0x030C,0x02ED,0x02CC,0x02EC, - 0x030D,0x0289,0x02EE,0x0207,0x01E7,0x0207,0x09A2,0x0DC2, - 0x0D82,0x0D85,0x0227,0x0249,0x0269,0x030F,0x02CD,0x02ED, - 0x030E,0x030D,0x032E,0x0228,0x02AB,0x028A,0x028A,0x02AA, - 0x0269,0x01E8,0x036E,0x032D,0x0289,0x02A9,0x02CE,0x0332, - 0x0331,0x0351,0x0351,0x0350,0x0350,0x0330,0x02D1,0x0332, - 0x0310,0x5FE5,0x5BE5,0x5BE5,0x5BE4,0x57E4,0x5BE4,0x4FA4, - 0x4B84,0x4B84,0x4F85,0x53A4,0x4B85,0x53A6,0x57C5,0x4366, - 0x4B87,0x4BA7,0x4766,0x2EC4,0x2EA6,0x2643,0x3B07,0x32A3, - 0x36C3,0x57E8,0x57CA,0x4FC4,0x32E3,0x32E4,0x32C3,0x2263, - 0x2AA3,0x2E91,0x6004,0x3FA6,0x2AA1,0x3724,0x3FA6,0x43E0, - 0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0,0x77F3,0x7FFA,0x7FFC, - - 0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00,0x36A0,0x3EA0,0x46E0, - 0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2,0x7FF0,0x7FF6,0x7FFC, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x3809,0x3C09,0x4009, - 0x4406,0x480E,0x500F,0x5812,0x6016,0x70FB,0x7DBD,0x7EBD, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0013,0x101A,0x181C, - 0x201F,0x281F,0x341F,0x401F,0x481F,0x581F,0x681F,0x6DFF, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x301F,0x381F,0x401F, - 0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F,0x7E5F,0x7B5F, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x024F,0x02B3,0x0AF5,0x1358, - 0x1B9C,0x23FD,0x2BFF,0x3FFF,0x4FFF,0x5FFF,0x6BFF,0x77FF, - 0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0200,0x0200,0x0260, - 0x02C0,0x0320,0x03E0,0x23E0,0x33E7,0x47EC,0x5FF3,0x6FF8, - 0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0E60,0x1EC0,0x2300, - 0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED,0x77EE,0x77F5, - 0x7BDE,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409,0x4C07,0x5407, - 0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15,0x7EBA,0x7F5D, - - 0x7BDE,0x3408,0x3C0F,0x4813,0x4C12,0x5413,0x5C0F,0x680D, - 0x700A,0x7484,0x7900,0x7DA0,0x7ECD,0x7F6D,0x7FF5,0x7F7E, - 0x7BDE,0x240C,0x280C,0x2C0C,0x340C,0x380C,0x3C0C,0x400C, - 0x440E,0x4810,0x5012,0x5413,0x400E,0x440E,0x4C0E,0x284F, - 0x2C4E,0xFFFF,0x410E,0x6004,0x3FA6,0x2AA1,0x3724,0x3FA6, - 0x43E0,0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0,0x77F3,0x7FFA, - 0x7FFC,0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00,0x36A0,0x3EA0, - 0x46E0,0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2,0x7FF0,0x7FF6, - 0x7FFC,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x3809,0x3C09, - 0x4009,0x4406,0x480E,0x500F,0x5812,0x6016,0x70FB,0x7DBD, - 0x7EBD,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0013,0x101A, - 0x181C,0x201F,0x281F,0x341F,0x401F,0x481F,0x581F,0x681F, - 0x6DFF,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x301F,0x381F, - 0x401F,0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F,0x7E5F, - 0x7B5F,0x7BDE,0x0000,0x7FE0,0x7C1F,0x024F,0x02B3,0x0AF5, - 0x1358,0x1B9C,0x23FD,0x2BFF,0x3FFF,0x4FFF,0x5FFF,0x6BFF, - - 0x77FF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0200,0x0200, - 0x0260,0x02C0,0x0320,0x03E0,0x23E0,0x33E7,0x47EC,0x5FF3, - 0x6FF8,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0E60,0x1EC0, - 0x2300,0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED,0x77EE, - 0x77F5,0x7BDE,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409,0x4C07, - 0x5407,0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15,0x7EBA, - 0x7F5D,0x7BDE,0x0216,0x0257,0x12D8,0x2718,0x2FB8,0x3FB9, - 0x47FA,0x4FFC,0x53FF,0x5BFF,0x5BFF,0x67FE,0x6FFF,0x73DF, - 0x7BDF,0x7FFF,0x01B2,0x01F4,0x0215,0x0237,0x0258,0x027A, - 0x029B,0x02DB,0x02FA,0x033A,0x035B,0x029B,0x02DD,0x031F, - 0x0210,0x0215,0xFFFF,0x41D3,0x6004,0x3FA6,0x2AA1,0x3724, - 0x3FA6,0x43E0,0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0,0x77F3, - 0x7FFA,0x7FFC,0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00,0x36A0, - 0x3EA0,0x46E0,0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2,0x7FF0, - 0x7FF6,0x7FFC,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x3809, - 0x3C09,0x4009,0x4406,0x480E,0x500F,0x5812,0x6016,0x70FB, - - 0x7DBD,0x7EBD,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0013, - 0x101A,0x181C,0x201F,0x281F,0x341F,0x401F,0x481F,0x581F, - 0x681F,0x6DFF,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x301F, - 0x381F,0x401F,0x481F,0x541F,0x5C1F,0x681F,0x701F,0x7C5F, - 0x7E5F,0x7B5F,0x7BDE,0x0000,0x7FE0,0x7C1F,0x024F,0x02B3, - 0x0AF5,0x1358,0x1B9C,0x23FD,0x2BFF,0x3FFF,0x4FFF,0x5FFF, - 0x6BFF,0x77FF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00,0x0200, - 0x0200,0x0260,0x02C0,0x0320,0x03E0,0x23E0,0x33E7,0x47EC, - 0x5FF3,0x6FF8,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00,0x0E60, - 0x1EC0,0x2300,0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0,0x67ED, - 0x77EE,0x77F5,0x7BDE,0x2D2F,0x7FE0,0x3405,0x3C05,0x4409, - 0x4C07,0x5407,0x5C0A,0x6409,0x6C09,0x7409,0x7CCF,0x7E15, - 0x7EBA,0x7F5D,0x7BDE,0x1B01,0x23A0,0x2FC0,0x3BE0,0x43E0, - 0x4FC0,0x57C0,0x5FE0,0x63E0,0x67E0,0x6FE0,0x77EE,0x7FF3, - 0x7FFA,0x7FFC,0x7FFF,0x0220,0x0260,0x0280,0x02C0,0x02E0, - 0x0320,0x0340,0x2780,0x2BA0,0x37E0,0x3FE0,0x0340,0x0BE0, - - 0x13E0,0x1DA3,0x2243,0xFFFF,0x410E,0x6004,0x3FA6,0x2AA1, - 0x3724,0x3FA6,0x43E0,0x4FE8,0x5BC4,0x63C5,0x67ED,0x6FF0, - 0x77F3,0x7FFA,0x7FFC,0x7FFF,0x352E,0x7FE0,0x7C1F,0x7C00, - 0x36A0,0x3EA0,0x46E0,0x5320,0x5F80,0x6BE0,0x73E0,0x7FE2, - 0x7FF0,0x7FF6,0x7FFC,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x3809,0x3C09,0x4009,0x4406,0x480E,0x500F,0x5812,0x6016, - 0x70FB,0x7DBD,0x7EBD,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x0013,0x101A,0x181C,0x201F,0x281F,0x341F,0x401F,0x481F, - 0x581F,0x681F,0x6DFF,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x301F,0x381F,0x401F,0x481F,0x541F,0x5C1F,0x681F,0x701F, - 0x7C5F,0x7E5F,0x7B5F,0x7BDE,0x0000,0x7FE0,0x7C1F,0x024F, - 0x02B3,0x0AF5,0x1358,0x1B9C,0x23FD,0x2BFF,0x3FFF,0x4FFF, - 0x5FFF,0x6BFF,0x77FF,0x7FFF,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x0200,0x0200,0x0260,0x02C0,0x0320,0x03E0,0x23E0,0x33E7, - 0x47EC,0x5FF3,0x6FF8,0x7BDE,0x0000,0x7FE0,0x7C1F,0x7C00, - 0x0E60,0x1EC0,0x2300,0x2F60,0x33E0,0x43E0,0x4FE0,0x63E0, - - 0x67ED,0x77EE,0x77F5,0x7BDE,0x2D2F,0x7FE0,0x3405,0x3C05, - 0x4409,0x4C07,0x5407,0x5C0A,0x6409,0x6C09,0x7409,0x7CCF, - 0x7E15,0x7EBA,0x7F5D,0x7BDE,0x19B7,0x21DA,0x31BC,0x3D9E, - 0x499E,0x511D,0x5CFE,0x60DF,0x68BF,0x707F,0x741F,0x7C1F, - 0x7E7F,0x7F5F,0x7F9F,0x7FFF,0x018C,0x018E,0x018F,0x0191, - 0x0192,0x0194,0x0195,0x2597,0x2998,0x3599,0x3D99,0x0195, - 0x0999,0x1199,0x21CF,0x25D4,0xFFFF,0x0004,0xCE4A,0x0004 -}; - -// --- tilemap data --- -// tile data (ff means no tiles) followed by routine index (end marker: 0xff00) -static UINT16 bloodwar_mcu_4_1c[] = { // Warrior 8 - 0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0D00,0xFF06, - 0x01BF,0xFF06,0x00FF,0xFF06,0x0008,0x2C01,0xFF06,0x0001, - 0xFF05,0x0002,0x2C02,0xFF06,0x0001,0xFF05,0x0002,0x2C55, - 0xFF06,0x0001,0x2C58,0xFF06,0x0008,0xFF06,0x0007,0xFF05, - 0x0007,0x2C05,0xFF05,0x0007,0x2C59,0xFF06,0x0007,0xFF06, - 0x0007,0xFF05,0x0007,0x2C0D,0xFF05,0x0007,0x2C61,0xFF06, - 0x0007,0xFF05,0x000F,0x2C15,0xFF05,0x000F,0x2C69,0xFF05, - 0x000F,0x2C25,0xFF05,0x000F,0x2C79,0xFF05,0x000F,0x2C35, - 0xFF05,0x000F,0x2C89,0xFF05,0x000F,0x2C45,0xFF05,0x000F, - 0x2C99,0xFF04,0x0002,0xFF09,0x0007,0x28D0,0xFF04,0x0000, - 0xFF05,0x0007,0x28A9,0xFF05,0x000F,0x28C1,0xFF04,0x0002, - 0xFF09,0x0007,0x28E0,0xFF04,0x0000,0xFF05,0x0007,0x28B1, - 0xFF05,0x000F,0x28D1,0xFF04,0x0002,0xFF09,0x0007,0x28F0, - 0xFF04,0x0000,0xFF05,0x0007,0x28B9,0xFF05,0x000F,0x28E1, - 0xFF08,0xFF02,0x0001,0xFF03,0x0400,0xFF01,0x0E00,0xFF06, - 0x01BF,0xFF06,0x001F,0xFF06,0x0001,0xFF05,0x0002,0x2401, - - 0xFF06,0x001A,0xFF06,0x0001,0xFF05,0x0003,0x2404,0xFF06, - 0x0019,0xFF06,0x0001,0xFF05,0x0004,0x2409,0xFF06,0x0018, - 0xFF06,0x0001,0xFF05,0x0005,0x240E,0xFF06,0x0011,0xFF05, - 0x0003,0x2474,0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0008, - 0x2414,0xFF06,0x000A,0xFF05,0x0007,0x2478,0xFF06,0x0001, - 0xFF06,0x0001,0xFF05,0x0008,0x241D,0xFF06,0x000A,0xFF05, - 0x0007,0x2480,0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0009, - 0x2426,0xFF06,0x0009,0xFF05,0x0007,0x2488,0xFF06,0x0001, - 0xFF06,0x0001,0xFF05,0x0009,0x2430,0xFF06,0x0008,0xFF05, - 0x0008,0x2490,0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x000A, - 0x243A,0xFF06,0x0007,0xFF05,0x0008,0x2499,0xFF06,0x0001, - 0xFF06,0x0001,0xFF05,0x000A,0x2445,0xFF06,0x0007,0xFF05, - 0x0008,0x24A2,0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0008, - 0x2450,0xFF06,0x0009,0xFF05,0x0008,0x24AB,0xFF06,0x0001, - 0xFF06,0x0001,0xFF05,0x0008,0x2459,0xFF06,0x0009,0xFF05, - 0x0008,0x24B4,0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0008, - - 0x2462,0xFF06,0x0009,0xFF05,0x0008,0x24BD,0xFF06,0x0001, - 0xFF06,0x0001,0xFF05,0x0008,0x246B,0xFF06,0x0008,0xFF05, - 0x0009,0x48C6,0xFF06,0x0001,0xFF05,0x001F,0x48C6,0xFF06, - 0x003F,0xFF08,0xFF02,0x0002,0xFF03,0x0400,0xFF01,0x0B00, - 0xFF06,0x01BF,0xFF06,0x005F,0xFF06,0x000A,0xFF05,0x0001, - 0x3001,0xFF06,0x0012,0xFF06,0x0008,0xFF05,0x0004,0x3003, - 0xFF06,0x0011,0xFF06,0x0006,0xFF05,0x0008,0x3008,0xFF06, - 0x000F,0xFF06,0x0004,0xFF05,0x000A,0x3011,0xFF06,0x000F, - 0xFF06,0x0004,0xFF05,0x000B,0x301C,0xFF05,0x0009,0x3461, - 0xFF06,0x0004,0xFF06,0x0004,0xFF05,0x000B,0x3028,0xFF05, - 0x0009,0x346B,0xFF06,0x0004,0xFF06,0x0004,0xFF05,0x0015, - 0x3034,0xFF06,0x0004,0xFF06,0x0004,0xFF05,0x0015,0x304A, - 0xFF06,0x0004,0xFF06,0x0004,0xFF0A,0x0015,0x3060,0xFF06, - 0x0004,0xFF06,0x00BF,0xFF08,0xFF02,0x0003,0xFF03,0x0400, - 0xFF01,0x0B00,0xFF06,0x01BF,0xFF06,0x003F,0xFF06,0x000E, - 0xFF05,0x0002,0x34D5,0xFF06,0x0001,0xFF05,0x0002,0x3880, - - 0xFF06,0x0008,0xFF06,0x000E,0xFF05,0x0002,0x34D8,0xFF06, - 0x0000,0xFF05,0x0004,0x3883,0xFF06,0x0007,0xFF06,0x000E, - 0xFF05,0x0002,0x34DB,0xFF06,0x0000,0xFF05,0x0004,0x3888, - 0xFF06,0x0007,0xFF06,0x0011,0xFF05,0x0006,0x388D,0xFF06, - 0x0006,0xFF06,0x0010,0xFF05,0x0007,0x3894,0xFF06,0x0006, - 0xFF06,0x000E,0xFF05,0x000A,0x389C,0xFF06,0x0005,0xFF06, - 0x000F,0xFF05,0x0009,0x38A7,0xFF06,0x0005,0xFF06,0x000E, - 0xFF05,0x000A,0x38B1,0xFF06,0x0004,0xFF06,0x000E,0xFF05, - 0x000A,0x38BD,0xFF06,0x0004,0xFF06,0x000E,0xFF05,0x000A, - 0x38C9,0xFF06,0x0004,0xFF06,0x00BF,0xFF00,0xFF08,0xFF02 -}; -static UINT16 bloodwar_mcu_4_1d[] = { // Warrior 2 - 0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0000,0xFF06, - 0x01BF,0xFF06,0x0003,0x4401,0xFF06,0x0002,0x4401,0xFF05, - 0x0001,0x340B,0xFF06,0x0000,0x4401,0xFF06,0x0005,0xFF04, - 0x0002,0x4401,0xFF06,0x0000,0xFF04,0x0000,0xFF05,0x0002, - 0x341F,0xFF04,0x0002,0x4401,0xFF06,0x0002,0x4401,0xFF04, - 0x0000,0xFF06,0x0002,0xFF06,0x0003,0x4402,0xFF06,0x0002, - 0x4402,0xFF05,0x0001,0x340B,0xFF06,0x0000,0x4402,0xFF06, - 0x0005,0xFF04,0x0002,0x4402,0xFF06,0x0000,0xFF04,0x0000, - 0xFF05,0x0002,0x341F,0xFF04,0x0002,0x4402,0xFF06,0x0002, - 0x4402,0xFF04,0x0000,0xFF06,0x0002,0xFF06,0x0002,0xFF05, - 0x0001,0x4403,0xFF06,0x0001,0xFF05,0x0001,0x4403,0xFF05, - 0x0001,0x340B,0xFF05,0x0001,0x4403,0xFF06,0x0005,0xFF04, - 0x0002,0xFF09,0x0001,0x4404,0xFF04,0x0000,0xFF05,0x0002, - 0x341F,0xFF04,0x0002,0xFF09,0x0001,0x4404,0xFF06,0x0001, - 0xFF09,0x0001,0x4404,0xFF04,0x0000,0xFF06,0x0001,0xFF06, - 0x0002,0xFF05,0x0001,0x4005,0xFF06,0x0001,0xFF05,0x0001, - - 0x4005,0xFF05,0x0001,0x340B,0xFF05,0x0001,0x4005,0xFF06, - 0x0005,0xFF04,0x0002,0xFF09,0x0001,0x4006,0xFF04,0x0000, - 0xFF05,0x0002,0x341F,0xFF04,0x0002,0xFF09,0x0001,0x4006, - 0xFF06,0x0001,0xFF09,0x0001,0x4006,0xFF04,0x0000,0xFF06, - 0x0001,0xFF06,0x0002,0xFF05,0x0001,0x4007,0xFF06,0x0001, - 0xFF05,0x0001,0x4007,0xFF05,0x0001,0x340D,0xFF05,0x0001, - 0x4007,0xFF06,0x0005,0xFF04,0x0002,0xFF09,0x0001,0x4008, - 0xFF04,0x0000,0xFF05,0x0002,0x3422,0xFF04,0x0002,0xFF09, - 0x0001,0x4008,0xFF06,0x0001,0xFF09,0x0001,0x4008,0xFF04, - 0x0000,0xFF06,0x0001,0xFF06,0x0002,0xFF05,0x0001,0x4409, - 0xFF06,0x0001,0xFF05,0x0001,0x4409,0xFF05,0x0001,0x340F, - 0xFF05,0x0001,0x4409,0xFF06,0x0005,0xFF04,0x0002,0xFF09, - 0x0001,0x440A,0xFF04,0x0000,0xFF05,0x0002,0x3425,0xFF04, - 0x0002,0xFF09,0x0001,0x440A,0xFF06,0x0001,0xFF09,0x0001, - 0x440A,0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0008,0xFF05, - 0x0001,0x3411,0xFF06,0x0009,0xFF05,0x0002,0x3428,0xFF06, - - 0x0007,0xFF06,0x0008,0xFF05,0x0001,0x3413,0xFF06,0x0009, - 0xFF05,0x0002,0x342B,0xFF06,0x0007,0xFF06,0x0008,0xFF05, - 0x0001,0x3415,0xFF06,0x0009,0xFF05,0x0002,0x342E,0xFF06, - 0x0007,0xFF06,0x0006,0x383E,0xFF06,0x0000,0xFF05,0x0001, - 0x3417,0x383D,0xFF06,0x0007,0x383E,0xFF05,0x0002,0x3431, - 0x383D,0xFF06,0x0006,0xFF05,0x0007,0x3841,0xFF06,0x0000, - 0xFF05,0x0001,0x3419,0xFF05,0x0009,0x383F,0xFF05,0x0002, - 0x3434,0xFF05,0x0007,0x383F,0xFF05,0x0007,0x384B,0xFF06, - 0x0000,0xFF05,0x0001,0x341B,0xFF05,0x0009,0x3849,0xFF05, - 0x0002,0x3437,0xFF05,0x0007,0x3849,0xFF05,0x0007,0x3855, - 0xFF06,0x0000,0xFF05,0x0001,0x341D,0xFF05,0x0009,0x3853, - 0xFF05,0x0002,0x343A,0xFF05,0x0007,0x3853,0xFF06,0x0006, - 0xFF05,0x0001,0x385E,0xFF06,0x0001,0x385D,0xFF06,0x0007, - 0xFF05,0x0001,0x385E,0xFF06,0x0001,0x385D,0xFF06,0x0006, - 0xFF04,0x0002,0xFF09,0x000D,0x3C71,0xFF04,0x0000,0xFF05, - 0x0011,0x3C60,0xFF04,0x0002,0xFF09,0x000D,0x3C83,0xFF04, - - 0x0000,0xFF05,0x0011,0x3C72,0xFF04,0x0002,0xFF09,0x000D, - 0x3C95,0xFF04,0x0000,0xFF05,0x0011,0x3C84,0xFF04,0x0002, - 0xFF09,0x000D,0x3CA7,0xFF04,0x0000,0xFF05,0x0011,0x3C96, - 0xFF08,0xFF02,0x0001,0xFF03,0x0300,0xFF01,0x0000,0xFF06, - 0x01BF,0xFF06,0x0003,0xFF05,0x0002,0x2CB0,0xFF05,0x0002, - 0x2CB0,0xFF05,0x0002,0x2CB0,0xFF05,0x0002,0x2CB0,0xFF05, - 0x0002,0x2CB0,0xFF05,0x0002,0x2CB0,0xFF05,0x0002,0x2CB0, - 0xFF05,0x0002,0x2CB0,0xFF06,0x0003,0xFF06,0x0003,0xFF05, - 0x0002,0x2CB0,0xFF05,0x0002,0x2CB0,0xFF05,0x0002,0x2CB0, - 0xFF05,0x0002,0x2CB0,0xFF05,0x0002,0x2CB0,0xFF05,0x0002, - 0x2CB0,0xFF05,0x0002,0x2CB0,0xFF05,0x0002,0x2CB0,0xFF06, - 0x0003,0xFF06,0x0003,0xFF05,0x0003,0x2CB3,0xFF05,0x0003, - 0x2CB3,0xFF05,0x0003,0x2CB3,0xFF05,0x0003,0x2CB3,0xFF05, - 0x0003,0x2CB3,0xFF05,0x0003,0x2CB3,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x0001,0x2CB7,0xFF06,0x0004,0xFF05,0x0002, - 0x2CB9,0xFF06,0x0004,0xFF05,0x0002,0x2D13,0xFF06,0x0004, - - 0x2D16,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0001,0x2CBC, - 0xFF06,0x0004,0xFF05,0x0002,0x2CBE,0xFF06,0x0004,0xFF05, - 0x0002,0x2D17,0xFF06,0x0004,0x2D1A,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x0001,0x2CC1,0xFF06,0x0004,0xFF05,0x0002, - 0x2CC3,0xFF06,0x0004,0xFF05,0x0002,0x2D1B,0xFF06,0x0004, - 0x2D1E,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0001,0x2CC6, - 0xFF06,0x0004,0xFF05,0x0002,0x2CC8,0xFF06,0x0004,0xFF05, - 0x0002,0x2D1F,0xFF06,0x0004,0x2D22,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x0001,0x2CCB,0xFF06,0x0004,0xFF05,0x0002, - 0x2CCD,0xFF06,0x0004,0xFF05,0x0002,0x2D23,0xFF06,0x0004, - 0x2D26,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0001,0x2CD0, - 0xFF06,0x0004,0xFF05,0x0002,0x2CD2,0xFF06,0x0004,0xFF05, - 0x0002,0x2D27,0xFF06,0x0004,0x2D2A,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x0001,0x2CD5,0xFF06,0x0004,0xFF05,0x0002, - 0x2CD7,0xFF06,0x0004,0xFF05,0x0002,0x2D2B,0xFF06,0x0004, - 0x2D2E,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0001,0x2CDA, - - 0xFF06,0x0004,0xFF05,0x0002,0x2CDC,0xFF06,0x0004,0xFF05, - 0x0002,0x2D2F,0xFF06,0x0004,0x2D32,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x000B,0x2CDF,0xFF05,0x000B,0x2D33,0xFF06, - 0x0003,0xFF06,0x0003,0xFF05,0x000B,0x2CEB,0xFF05,0x000B, - 0x2D3F,0xFF06,0x0003,0xFF06,0x0001,0x2CF7,0xFF05,0x0008, - 0x2CF7,0xFF05,0x0003,0x2D01,0xFF05,0x000C,0x2D4B,0x2CF7, - 0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x000D,0x2D05,0xFF05, - 0x000D,0x2D58,0xFF06,0x0001,0xFF06,0x005F,0xFF08,0xFF02, - 0x0002,0xFF03,0x0400,0xFF01,0x0000,0xFF06,0x01BF,0xFF06, - 0x003F,0xFF05,0x0007,0x3001,0xFF05,0x0007,0x3001,0xFF05, - 0x0007,0x3001,0xFF05,0x0007,0x3001,0xFF05,0x0007,0x3009, - 0xFF05,0x0007,0x3009,0xFF05,0x0007,0x3009,0xFF05,0x0007, - 0x3009,0xFF06,0x001F,0xFF03,0x0300,0xFF06,0x0003,0xFF05, - 0x0001,0x2811,0xFF06,0x0003,0xFF05,0x0001,0x2811,0xFF06, - 0x0007,0xFF05,0x0001,0x2811,0xFF06,0x0003,0xFF05,0x0001, - 0x2811,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0001,0x2813, - - 0xFF06,0x0003,0xFF05,0x0001,0x2813,0xFF06,0x0007,0xFF05, - 0x0001,0x2813,0xFF06,0x0003,0xFF05,0x0001,0x2813,0xFF06, - 0x0003,0xFF06,0x0002,0xFF05,0x0003,0x2815,0xFF06,0x0001, - 0xFF05,0x0003,0x2815,0xFF06,0x0005,0xFF05,0x0003,0x2815, - 0xFF06,0x0001,0xFF05,0x0003,0x2815,0xFF06,0x0002,0xFF06, - 0x0002,0xFF05,0x0003,0x2819,0xFF06,0x0001,0xFF05,0x0003, - 0x2819,0xFF06,0x0005,0xFF05,0x0003,0x2819,0xFF06,0x0001, - 0xFF05,0x0003,0x2819,0xFF06,0x0002,0xFF06,0x0001,0xFF05, - 0x0004,0x281D,0xFF06,0x0000,0xFF05,0x0004,0x281D,0xFF06, - 0x0004,0xFF05,0x0004,0x281D,0xFF06,0x0000,0xFF05,0x0004, - 0x281D,0xFF06,0x0002,0xFF06,0x0001,0xFF05,0x0005,0x2822, - 0xFF05,0x0005,0x2822,0xFF06,0x0003,0xFF05,0x0005,0x2822, - 0xFF05,0x0005,0x2822,0xFF06,0x0001,0xFF06,0x0001,0xFF05, - 0x0005,0x2828,0xFF05,0x0005,0x2828,0xFF06,0x0003,0xFF05, - 0x0005,0x2828,0xFF05,0x0005,0x2828,0xFF06,0x0001,0xFF06, - 0x00BF,0xFF08,0xFF02,0x0003,0xFF03,0x0300,0xFF01,0x0000, - - 0xFF06,0x01BF,0xFF06,0x007F,0xFF06,0x0003,0xFF05,0x0002, - 0x2432,0xFF05,0x0002,0x2046,0xFF05,0x0004,0x2430,0xFF05, - 0x0002,0x2046,0xFF05,0x0004,0x2430,0xFF05,0x0002,0x2046, - 0xFF05,0x0001,0x2430,0xFF06,0x0003,0xFF06,0x0003,0xFF05, - 0x0002,0x2437,0xFF05,0x0002,0x2049,0xFF05,0x0004,0x2435, - 0xFF05,0x0002,0x2049,0xFF05,0x0004,0x2435,0xFF05,0x0002, - 0x2049,0xFF05,0x0001,0x2435,0xFF06,0x0003,0xFF06,0x0003, - 0xFF05,0x0001,0x243C,0xFF05,0x0003,0x204C,0xFF05,0x0003, - 0x243A,0xFF05,0x0003,0x204C,0xFF05,0x0003,0x243A,0xFF05, - 0x0003,0x204C,0xFF05,0x0001,0x243A,0xFF06,0x0003,0xFF06, - 0x0003,0x243F,0xFF05,0x0005,0x2050,0xFF05,0x0001,0x243E, - 0xFF05,0x0005,0x2050,0xFF05,0x0001,0x243E,0xFF05,0x0005, - 0x2050,0x283E,0xFF06,0x0003,0xFF06,0x0003,0x2441,0xFF05, - 0x0005,0x2056,0xFF05,0x0001,0x2440,0xFF05,0x0005,0x2056, - 0xFF05,0x0001,0x2440,0xFF05,0x0005,0x2056,0x2840,0xFF06, - 0x0003,0xFF06,0x0003,0x2443,0xFF05,0x0005,0x205C,0xFF05, - - 0x0001,0x2442,0xFF05,0x0005,0x205C,0xFF05,0x0001,0x2442, - 0xFF05,0x0005,0x205C,0x2842,0xFF06,0x0003,0xFF06,0x0003, - 0x2445,0xFF05,0x0005,0x2062,0xFF05,0x0001,0x2444,0xFF05, - 0x0005,0x2062,0xFF05,0x0001,0x2444,0xFF05,0x0005,0x2062, - 0x2844,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0007,0x2068, - 0xFF05,0x0007,0x2068,0xFF05,0x0007,0x2068,0xFF06,0x0003, - 0xFF06,0x0003,0xFF05,0x0007,0x2070,0xFF05,0x0007,0x2070, - 0xFF05,0x0007,0x2070,0xFF06,0x0003,0xFF06,0x009F,0xFF00, - 0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0200,0xFF06 -}; -static UINT16 bloodwar_mcu_4_1e[] = { // Warrior 3 - 0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0200,0xFF06, - 0x01BF,0xFF05,0x000F,0x2C01,0xFF05,0x000F,0x2C01,0xFF05, - 0x000F,0x2C11,0xFF05,0x000F,0x2C11,0xFF05,0x0001,0x3C27, - 0xFF06,0x0003,0xFF05,0x0003,0x3C25,0xFF06,0x0003,0xFF05, - 0x0003,0x3C25,0xFF06,0x0003,0xFF05,0x0003,0x3C25,0xFF06, - 0x0003,0xFF05,0x0001,0x3C25,0xFF05,0x0001,0x3C2B,0xFF06, - 0x0003,0xFF05,0x0003,0x3C29,0xFF06,0x0003,0xFF05,0x0003, - 0x3C29,0xFF06,0x0003,0xFF05,0x0003,0x3C29,0xFF06,0x0003, - 0xFF05,0x0001,0x3C29,0xFF05,0x0001,0x3C2F,0xFF06,0x0003, - 0xFF05,0x0003,0x3C2D,0xFF06,0x0003,0xFF05,0x0003,0x3C2D, - 0xFF06,0x0003,0xFF05,0x0003,0x3C2D,0xFF06,0x0003,0xFF05, - 0x0001,0x3C2D,0xFF05,0x0001,0x3C33,0xFF06,0x0003,0xFF05, - 0x0003,0x3C31,0xFF06,0x0003,0xFF05,0x0003,0x3C31,0xFF06, - 0x0003,0xFF05,0x0003,0x3C31,0xFF06,0x0003,0xFF05,0x0001, - 0x3C31,0x3C36,0xFF06,0x0005,0xFF05,0x0001,0x3C35,0xFF06, - 0x0005,0xFF05,0x0001,0x3C35,0xFF06,0x0005,0xFF05,0x0001, - - 0x3C35,0xFF06,0x0005,0x3C35,0xFF06,0x00DF,0xFF03,0x0300, - 0xFF06,0x0001,0xFF05,0x0001,0x2439,0xFF05,0x0001,0x203B, - 0xFF05,0x0002,0x243D,0xFF05,0x000C,0x2040,0xFF04,0x0002, - 0x2040,0xFF09,0x0002,0x243F,0xFF09,0x0001,0x203C,0xFF09, - 0x0001,0x243A,0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0000, - 0xFF05,0x0002,0x244E,0xFF05,0x0001,0x2051,0xFF05,0x0002, - 0x2453,0xFF05,0x000C,0x2056,0xFF04,0x0002,0x2056,0xFF09, - 0x0002,0x2455,0xFF09,0x0001,0x2052,0xFF09,0x0002,0x2450, - 0xFF04,0x0000,0xFF06,0x0000,0xFF05,0x0003,0x2463,0xFF05, - 0x0001,0x2067,0xFF05,0x0002,0x2469,0xFF05,0x000C,0x206C, - 0xFF04,0x0002,0x206C,0xFF09,0x0002,0x246B,0xFF09,0x0001, - 0x2068,0xFF09,0x0003,0x2466,0xFF04,0x0000,0xFF05,0x0003, - 0x2479,0xFF05,0x0001,0x207D,0xFF05,0x0002,0x247F,0xFF05, - 0x000C,0x2082,0xFF04,0x0002,0x2082,0xFF09,0x0002,0x2481, - 0xFF09,0x0001,0x207E,0xFF09,0x0003,0x247C,0xFF04,0x0000, - 0xFF08,0xFF02,0x0001,0xFF03,0x0400,0xFF01,0x0200,0xFF06, - - 0x01BF,0xFF06,0x003F,0xFF06,0x0003,0xFF05,0x0001,0x38AB, - 0xFF06,0x0002,0xFF05,0x0001,0x38AB,0xFF06,0x0009,0xFF04, - 0x0002,0xFF09,0x0001,0x38AC,0xFF06,0x0002,0xFF09,0x0001, - 0x38AC,0xFF04,0x0000,0xFF06,0x0003,0xFF06,0x0003,0xFF05, - 0x0001,0x38AD,0xFF06,0x0002,0xFF05,0x0001,0x38AD,0xFF06, - 0x0009,0xFF04,0x0002,0xFF09,0x0001,0x38AE,0xFF06,0x0002, - 0xFF09,0x0001,0x38AE,0xFF04,0x0000,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x0001,0x38AF,0xFF06,0x0002,0xFF05,0x0001, - 0x38AF,0xFF06,0x0009,0xFF04,0x0002,0xFF09,0x0001,0x38B0, - 0xFF06,0x0002,0xFF09,0x0001,0x38B0,0xFF04,0x0000,0xFF06, - 0x0003,0xFF06,0x0003,0xFF05,0x0001,0x38B1,0xFF06,0x0002, - 0xFF05,0x0001,0x38B1,0xFF06,0x0009,0xFF04,0x0002,0xFF09, - 0x0001,0x38B2,0xFF06,0x0002,0xFF09,0x0001,0x38B2,0xFF04, - 0x0000,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0001,0x38B3, - 0xFF06,0x0002,0xFF05,0x0001,0x38B3,0xFF06,0x0000,0xFF05, - 0x0001,0x3490,0xFF06,0x0003,0xFF04,0x0002,0xFF09,0x0001, - - 0x3091,0xFF06,0x0000,0xFF09,0x0001,0x38B4,0xFF06,0x0002, - 0xFF09,0x0001,0x38B4,0xFF04,0x0000,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x0001,0x38B5,0xFF06,0x0002,0xFF05,0x0001, - 0x38B5,0xFF06,0x0000,0xFF05,0x0002,0x3492,0xFF06,0x0001, - 0xFF04,0x0002,0xFF09,0x0002,0x3094,0xFF06,0x0000,0xFF09, - 0x0001,0x38B6,0xFF06,0x0002,0xFF09,0x0001,0x38B6,0xFF04, - 0x0000,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0001,0x38B7, - 0xFF06,0x0002,0xFF05,0x0001,0x38B7,0xFF06,0x0000,0xFF05, - 0x0002,0x3495,0xFF06,0x0001,0xFF04,0x0002,0xFF09,0x0002, - 0x3097,0xFF06,0x0000,0xFF09,0x0001,0x38B8,0xFF06,0x0002, - 0xFF09,0x0001,0x38B8,0xFF04,0x0000,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x0001,0x38B9,0xFF06,0x0002,0xFF05,0x0001, - 0x38B9,0xFF05,0x0003,0x3498,0xFF06,0x0001,0xFF04,0x0002, - 0xFF09,0x0003,0x309B,0xFF09,0x0001,0x38BA,0xFF06,0x0002, - 0xFF09,0x0001,0x38BA,0xFF04,0x0000,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x0001,0x38BB,0xFF06,0x0002,0xFF05,0x0001, - - 0x38BB,0xFF05,0x0004,0x349C,0xFF04,0x0002,0xFF09,0x0004, - 0x30A0,0xFF09,0x0001,0x38BC,0xFF06,0x0002,0xFF09,0x0001, - 0x38BC,0xFF04,0x0000,0xFF06,0x0003,0xFF06,0x0003,0xFF05, - 0x0001,0x38BD,0xFF06,0x0002,0xFF05,0x0001,0x38BD,0xFF05, - 0x0004,0x34A1,0xFF04,0x0002,0xFF09,0x0004,0x30A5,0xFF09, - 0x0001,0x38BE,0xFF06,0x0002,0xFF09,0x0001,0x38BE,0xFF04, - 0x0000,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0001,0x38BF, - 0xFF06,0x0002,0xFF05,0x0001,0x38BF,0xFF05,0x0004,0x34A6, - 0xFF04,0x0002,0xFF09,0x0004,0x30AA,0xFF09,0x0001,0x38C0, - 0xFF06,0x0002,0xFF09,0x0001,0x38C0,0xFF04,0x0000,0xFF06, - 0x0003,0xFF06,0x0003,0xFF05,0x0001,0x38C1,0xFF06,0x0002, - 0xFF05,0x0007,0x38C1,0xFF04,0x0002,0xFF09,0x0005,0x38C6, - 0xFF06,0x0002,0xFF09,0x0001,0x38C2,0xFF04,0x0000,0xFF06, - 0x0003,0xFF06,0x0003,0xFF05,0x0001,0x38C9,0xFF06,0x0002, - 0xFF05,0x0007,0x38C9,0xFF04,0x0002,0xFF09,0x0005,0x38CE, - 0xFF06,0x0002,0xFF09,0x0001,0x38CA,0xFF04,0x0000,0xFF06, - - 0x0003,0xFF06,0x005F,0xFF08,0xFF02,0x0002,0xFF03,0x0400, - 0xFF01,0x0100,0xFF06,0x01BF,0xFF06,0x003F,0xFF05,0x0002, - 0x2C01,0xFF05,0x0002,0x2C01,0xFF05,0x0002,0x2C01,0xFF05, - 0x0002,0x2C01,0xFF05,0x0002,0x2C01,0xFF05,0x0002,0x2C01, - 0xFF05,0x0002,0x2C01,0xFF05,0x0002,0x2C01,0xFF05,0x0002, - 0x2C01,0xFF05,0x0002,0x2C01,0xFF05,0x0001,0x2C01,0xFF05, - 0x0002,0x2C04,0xFF05,0x0002,0x2C04,0xFF05,0x0002,0x2C04, - 0xFF05,0x0002,0x2C04,0xFF05,0x0002,0x2C04,0xFF05,0x0002, - 0x2C04,0xFF05,0x0002,0x2C04,0xFF05,0x0002,0x2C04,0xFF05, - 0x0002,0x2C04,0xFF05,0x0002,0x2C04,0xFF05,0x0001,0x2C04, - 0xFF05,0x0007,0x2C07,0xFF05,0x0007,0x2C07,0xFF05,0x0007, - 0x2C07,0xFF05,0x0007,0x2C07,0xFF05,0x0007,0x2C0F,0xFF05, - 0x0007,0x2C0F,0xFF05,0x0007,0x2C0F,0xFF05,0x0007,0x2C0F, - 0xFF06,0x0002,0x3819,0xFF06,0x0003,0x3819,0xFF06,0x0003, - 0x3819,0xFF06,0x0003,0x3819,0xFF06,0x0003,0x3819,0xFF06, - 0x0003,0x3819,0xFF06,0x0002,0xFF06,0x0002,0x381A,0xFF06, - - 0x0003,0x381A,0xFF06,0x0003,0x381A,0xFF06,0x0003,0x381A, - 0xFF06,0x0003,0x381A,0xFF06,0x0003,0x381A,0xFF06,0x0002, - 0xFF06,0x0002,0x381B,0xFF06,0x0003,0x381B,0xFF06,0x0003, - 0x381B,0xFF06,0x0003,0x381B,0xFF06,0x0003,0x381B,0xFF06, - 0x0003,0x381B,0xFF06,0x0002,0xFF06,0x0002,0x381C,0xFF06, - 0x0003,0x381C,0xFF06,0x0003,0x381C,0xFF06,0x0003,0x381C, - 0xFF06,0x0003,0x381C,0xFF06,0x0003,0x381C,0xFF06,0x0002, - 0xFF06,0x0002,0x381D,0xFF06,0x0003,0x381D,0xFF06,0x0003, - 0x381D,0xFF06,0x0003,0x381D,0xFF06,0x0003,0x381D,0xFF06, - 0x0003,0x381D,0xFF06,0x0002,0xFF06,0x0002,0x381E,0xFF06, - 0x0003,0x381E,0xFF06,0x0003,0x381E,0xFF06,0x0003,0x381E, - 0xFF06,0x0003,0x381E,0xFF06,0x0003,0x381E,0xFF06,0x0002, - 0xFF06,0x0002,0x381F,0xFF06,0x0003,0x381F,0xFF06,0x0003, - 0x381F,0xFF06,0x0003,0x381F,0xFF06,0x0003,0x381F,0xFF06, - 0x0003,0x381F,0xFF06,0x0002,0xFF06,0x0002,0x3820,0xFF06, - 0x0003,0x3820,0xFF06,0x0003,0x3820,0xFF06,0x0003,0x3820, - - 0xFF06,0x0003,0x3820,0xFF06,0x0003,0x3820,0xFF06,0x0002, - 0xFF06,0x0002,0x3821,0xFF06,0x0003,0x3821,0xFF06,0x0003, - 0x3821,0xFF06,0x0003,0x3821,0xFF06,0x0003,0x3821,0xFF06, - 0x0003,0x3821,0xFF06,0x0002,0xFF06,0x005F,0xFF08,0xFF02, - 0x0003,0xFF03,0x0400,0xFF01,0x0100,0xFF06,0x01BF,0xFF06, - 0x00BF,0xFF05,0x0007,0x2C30,0xFF05,0x0007,0x2C30,0xFF05, - 0x0007,0x2C30,0xFF05,0x0007,0x2C30,0xFF05,0x000F,0x2C38, - 0xFF05,0x000F,0x2CA0,0xFF05,0x000F,0x2C48,0xFF05,0x000F, - 0x2CB0,0xFF05,0x000F,0x2C58,0xFF05,0x000F,0x2CC0,0xFF06, - 0x0002,0xFF04,0x0002,0xFF09,0x000B,0x2875,0xFF04,0x0000, - 0xFF05,0x000D,0x2868,0xFF06,0x0002,0xFF06,0x0002,0xFF04, - 0x0002,0xFF09,0x000B,0x2883,0xFF04,0x0000,0xFF05,0x000D, - 0x2876,0xFF06,0x0002,0xFF06,0x0002,0xFF04,0x0002,0xFF09, - 0x000B,0x2891,0xFF04,0x0000,0xFF05,0x000D,0x2884,0xFF06, - 0x0002,0xFF06,0x0002,0xFF04,0x0002,0xFF09,0x000B,0x289F, - 0xFF04,0x0000,0xFF05,0x000D,0x2892,0xFF06,0x0002,0xFF06, - - 0x007F,0xFF00,0xFF08,0xFF02,0x0000,0xFF03,0x0200,0xFF01 -}; -static UINT16 bloodwar_mcu_4_1f[] = { // Warrior 5 - 0xFF08,0xFF02,0x0000,0xFF03,0x0200,0xFF01,0x0800,0xFF06, - 0x01BF,0xFF06,0x007F,0xFF06,0x0009,0xFF05,0x0002,0x2801, - 0xFF05,0x0004,0x3429,0xFF06,0x0000,0xFF05,0x0002,0x342E, - 0xFF05,0x0002,0x2815,0xFF06,0x0006,0xFF06,0x0009,0xFF05, - 0x0002,0x2804,0xFF05,0x0008,0x3431,0xFF05,0x0002,0x2818, - 0xFF06,0x0006,0xFF06,0x0009,0xFF05,0x0001,0x2807,0xFF06, - 0x0000,0xFF05,0x0008,0x343A,0xFF06,0x0000,0xFF05,0x0001, - 0x281B,0xFF06,0x0006,0xFF06,0x0009,0xFF05,0x0001,0x2809, - 0xFF06,0x0000,0xFF05,0x0004,0x3443,0xFF06,0x0000,0xFF05, - 0x0002,0x3448,0xFF06,0x0000,0xFF05,0x0001,0x281D,0xFF06, - 0x0006,0xFF06,0x0009,0xFF05,0x0001,0x280B,0xFF06,0x000A, - 0xFF05,0x0001,0x281F,0xFF06,0x0006,0xFF06,0x0009,0xFF05, - 0x0001,0x280D,0xFF06,0x000A,0xFF05,0x0001,0x2821,0xFF06, - 0x0006,0xFF06,0x0009,0xFF05,0x0001,0x280F,0xFF06,0x000A, - 0xFF05,0x0001,0x2823,0xFF06,0x0006,0xFF06,0x0009,0xFF05, - 0x0001,0x2811,0xFF06,0x000A,0xFF05,0x0001,0x2825,0xFF06, - - 0x0006,0xFF06,0x0009,0xFF05,0x0001,0x2813,0xFF06,0x000A, - 0xFF05,0x0001,0x2827,0xFF06,0x0006,0xFF05,0x0007,0x2053, - 0xFF05,0x000F,0x204B,0xFF05,0x0007,0x204B,0xFF05,0x0007, - 0x2063,0xFF05,0x000F,0x205B,0xFF05,0x0007,0x205B,0xFF05, - 0x0007,0x2073,0xFF05,0x000F,0x206B,0xFF05,0x0007,0x206B, - 0xFF06,0x003F,0xFF08,0xFF02,0x0001,0xFF03,0x0200,0xFF01, - 0x0900,0xFF06,0x01BF,0xFF06,0x0001,0xFF05,0x000D,0x2801, - 0xFF05,0x000F,0x284A,0xFF06,0x0003,0xFF05,0x000B,0x280F, - 0xFF05,0x000D,0x285A,0xFF06,0x0001,0xFF06,0x0005,0xFF05, - 0x0009,0x281B,0xFF05,0x000C,0x2868,0xFF06,0x0002,0xFF06, - 0x0006,0xFF05,0x0008,0x2825,0xFF05,0x000A,0x2875,0xFF06, - 0x0004,0xFF06,0x0008,0xFF05,0x0006,0x282E,0xFF05,0x0009, - 0x2880,0xFF06,0x0005,0xFF06,0x0009,0xFF05,0x0005,0x2835, - 0xFF05,0x0006,0x288A,0xFF06,0x0008,0xFF06,0x000A,0xFF05, - 0x0004,0x283B,0xFF05,0x0005,0x2891,0xFF06,0x0009,0xFF06, - 0x000B,0xFF05,0x0003,0x2840,0xFF05,0x0005,0x2897,0xFF06, - - 0x0009,0xFF06,0x000C,0xFF05,0x0002,0x2844,0xFF05,0x0004, - 0x289D,0xFF06,0x000A,0xFF06,0x000C,0x2847,0xFF06,0x0005, - 0x28A2,0xFF06,0x000A,0xFF06,0x000C,0x2848,0xFF06,0x0005, - 0x28A3,0xFF06,0x000A,0xFF06,0x000C,0x2849,0xFF06,0x0005, - 0x28A4,0xFF06,0x000A,0xFF06,0x005F,0xFF03,0x0300,0xFF06, - 0x0000,0xFF04,0x0002,0xFF09,0x000E,0x30B3,0xFF04,0x0000, - 0xFF05,0x000E,0x30A5,0xFF06,0x0000,0xFF04,0x0002,0xFF09, - 0x000F,0x30C3,0xFF04,0x0000,0xFF05,0x000F,0x30B4,0xFF04, - 0x0002,0xFF09,0x000F,0x30D3,0xFF04,0x0000,0xFF05,0x000F, - 0x30C4,0xFF08,0xFF02,0x0002,0xFF03,0x0200,0xFF01,0x0400, - 0xFF06,0x01BF,0xFF06,0x005F,0xFF06,0x0005,0xFF05,0x0001, - 0x25C6,0xFF06,0x0005,0xFF05,0x0003,0x2401,0xFF06,0x000D, - 0xFF06,0x0003,0xFF05,0x0003,0x25C8,0xFF05,0x000C,0x2405, - 0xFF06,0x0003,0xFF05,0x0002,0x25E4,0xFF06,0x0003,0xFF06, - 0x0003,0xFF05,0x0003,0x25CC,0xFF05,0x000F,0x2412,0xFF05, - 0x0003,0x25E7,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0003, - - 0x25D0,0xFF05,0x000F,0x2422,0xFF05,0x0003,0x25EB,0xFF06, - 0x0003,0xFF06,0x0003,0xFF05,0x0003,0x25D4,0xFF05,0x000F, - 0x2432,0xFF05,0x0003,0x25EF,0xFF06,0x0003,0xFF06,0x0003, - 0xFF05,0x0003,0x25D8,0xFF05,0x000F,0x2442,0xFF05,0x0003, - 0x25F3,0xFF06,0x0003,0xFF06,0x0003,0xFF05,0x0003,0x25DC, - 0xFF05,0x000F,0x2452,0xFF05,0x0003,0x25F7,0xFF06,0x0003, - 0xFF06,0x0003,0xFF05,0x0003,0x25E0,0xFF05,0x000F,0x2462, - 0xFF05,0x0003,0x25FB,0xFF06,0x0003,0xFF06,0x005F,0xFF03, - 0x0400,0xFF06,0x0004,0xFF05,0x0002,0x3A01,0xFF06,0x0000, - 0xFF05,0x0001,0x3A07,0xFF06,0x0009,0xFF05,0x0001,0x3A0B, - 0xFF06,0x0000,0xFF05,0x0002,0x3A0F,0xFF06,0x0004,0xFF06, - 0x0004,0xFF05,0x0002,0x3A04,0xFF06,0x0000,0xFF05,0x0001, - 0x3A09,0xFF06,0x0009,0xFF05,0x0001,0x3A0D,0xFF06,0x0000, - 0xFF05,0x0002,0x3A12,0xFF06,0x0004,0xFF06,0x003F,0xFF08, - 0xFF02,0x0003,0xFF03,0x0200,0xFF01,0x0600,0xFF06,0x01BF, - 0xFF05,0x000F,0x3C6D,0xFF05,0x000F,0x3C6D,0xFF05,0x000F, - - 0x3C7D,0xFF05,0x000F,0x3C7D,0xFF05,0x000F,0x3C8D,0xFF05, - 0x000F,0x3C8D,0xFF05,0x000F,0x3C6D,0xFF05,0x000F,0x3C6D, - 0xFF05,0x000F,0x3C7D,0xFF05,0x000F,0x3C7D,0xFF05,0x000F, - 0x3C8D,0xFF05,0x000F,0x3C8D,0xFF06,0x007F,0xFF03,0x0300, - 0xFF05,0x0007,0x2C28,0xFF05,0x000F,0x2C20,0xFF05,0x0007, - 0x2C20,0xFF05,0x0007,0x2C38,0xFF05,0x000F,0x2C30,0xFF05, - 0x0007,0x2C30,0xFF05,0x0007,0x2C48,0xFF05,0x000F,0x2C40, - 0xFF05,0x0007,0x2C40,0xFF05,0x0007,0x2C58,0xFF05,0x000F, - 0x2C50,0xFF05,0x0007,0x2C50,0xFF06,0x0003,0xFF05,0x0003, - 0x2C66,0xFF05,0x0004,0x2C60,0xFF06,0x0006,0xFF05,0x0003, - 0x2C66,0xFF05,0x0004,0x2C60,0xFF06,0x0002,0xFF06,0x0005, - 0xFF05,0x0001,0x2C6B,0x2C6A,0xFF06,0x000C,0xFF05,0x0001, - 0x2C6B,0x2C6A,0xFF06,0x0006,0xFF06,0x003F,0xFF00,0xFF08 -}; -static UINT16 bloodwar_mcu_4_20[] = { // Warrior 4 - 0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x1100,0xFF06, - 0x01BF,0xFF06,0x00DF,0xFF06,0x0001,0xFF04,0x0002,0xFF09, - 0x0001,0x2402,0xFF04,0x0000,0xFF06,0x0017,0xFF05,0x0001, - 0x2401,0xFF06,0x0001,0xFF04,0x0002,0xFF09,0x0004,0x2407, - 0xFF04,0x0000,0xFF06,0x0003,0xFF05,0x0001,0x3837,0xFF06, - 0x0009,0xFF04,0x0002,0xFF09,0x0001,0x3838,0xFF04,0x0000, - 0xFF06,0x0003,0xFF05,0x0004,0x2403,0xFF04,0x0002,0xFF09, - 0x0005,0x240D,0xFF04,0x0000,0xFF06,0x0002,0xFF05,0x0002, - 0x3839,0xFF06,0x0007,0xFF04,0x0002,0xFF09,0x0002,0x383B, - 0xFF04,0x0000,0xFF06,0x0002,0xFF05,0x0005,0x2408,0xFF04, - 0x0002,0xFF09,0x0005,0x2415,0xFF04,0x0000,0xFF06,0x0002, - 0xFF05,0x0001,0x383C,0xFF06,0x0009,0xFF04,0x0002,0xFF09, - 0x0001,0x383D,0xFF04,0x0000,0xFF06,0x0002,0xFF05,0x0005, - 0x2410,0xFF04,0x0002,0xFF09,0x0006,0x241E,0xFF04,0x0000, - 0xFF06,0x0001,0xFF05,0x0001,0x383E,0xFF06,0x0009,0xFF04, - 0x0002,0xFF09,0x0001,0x383F,0xFF04,0x0000,0xFF06,0x0001, - - 0xFF05,0x0006,0x2418,0xFF04,0x0002,0xFF09,0x0006,0x2427, - 0xFF04,0x0000,0xFF06,0x0002,0x3840,0xFF06,0x0009,0xFF04, - 0x0002,0x3840,0xFF04,0x0000,0xFF06,0x0002,0xFF05,0x0006, - 0x2421,0xFF04,0x0002,0xFF09,0x0006,0x2430,0xFF04,0x0000, - 0xFF06,0x0001,0xFF05,0x0002,0x3841,0xFF06,0x0007,0xFF04, - 0x0002,0xFF09,0x0002,0x3843,0xFF04,0x0000,0xFF06,0x0001, - 0xFF05,0x0006,0x242A,0xFF06,0x0000,0xFF04,0x0002,0xFF09, - 0x0001,0x2434,0xFF04,0x0000,0xFF06,0x0005,0xFF05,0x0002, - 0x3844,0xFF06,0x0007,0xFF04,0x0002,0xFF09,0x0002,0x3846, - 0xFF04,0x0000,0xFF06,0x0005,0xFF05,0x0001,0x2433,0xFF06, - 0x0000,0xFF08,0xFF02,0x0001,0xFF03,0x0400,0xFF01,0x1100, - 0xFF06,0x01BF,0xFF06,0x003F,0xFF06,0x0001,0xFF04,0x0002, - 0xFF09,0x000D,0x347C,0xFF04,0x0000,0xFF05,0x000D,0x346F, - 0xFF06,0x0001,0xFF06,0x0001,0xFF04,0x0002,0xFF09,0x000D, - 0x348A,0xFF04,0x0000,0xFF05,0x000D,0x347D,0xFF06,0x0001, - 0xFF06,0x0000,0xFF04,0x0002,0xFF09,0x000E,0x3499,0xFF04, - - 0x0000,0xFF05,0x000E,0x348B,0xFF06,0x0000,0xFF04,0x0002, - 0xFF09,0x000F,0x34A9,0xFF04,0x0000,0xFF05,0x000F,0x349A, - 0xFF04,0x0002,0xFF09,0x000F,0x34B9,0xFF04,0x0000,0xFF05, - 0x000F,0x34AA,0xFF06,0x0000,0xFF04,0x0002,0xFF09,0x000E, - 0x30C8,0xFF04,0x0000,0xFF05,0x000E,0x30BA,0xFF06,0x0000, - 0xFF04,0x0002,0xFF09,0x000F,0x30D8,0xFF04,0x0000,0xFF05, - 0x000F,0x30C9,0xFF04,0x0002,0xFF09,0x000C,0x30E5,0xFF04, - 0x0000,0xFF06,0x0005,0xFF05,0x000C,0x30D9,0xFF04,0x0002, - 0xFF09,0x000C,0x30F2,0xFF04,0x0000,0xFF06,0x0005,0xFF05, - 0x000C,0x30E6,0xFF04,0x0002,0xFF09,0x000C,0x30FF,0xFF04, - 0x0000,0xFF06,0x0005,0xFF05,0x000C,0x30F3,0xFF04,0x0002, - 0xFF09,0x000C,0x310D,0xFF04,0x0000,0xFF06,0x0005,0xFF05, - 0x000C,0x3101,0xFF04,0x0002,0xFF09,0x000C,0x311A,0xFF04, - 0x0000,0xFF06,0x0005,0xFF05,0x000C,0x310E,0xFF06,0x007F, - 0xFF08,0xFF02,0x0002,0xFF03,0x0400,0xFF01,0x0E00,0xFF06, - 0x01BF,0xFF06,0x00BF,0xFF06,0x000A,0xFF05,0x000B,0x2C01, - - 0xFF06,0x0008,0xFF06,0x000A,0xFF05,0x000B,0x2C0D,0xFF06, - 0x0008,0xFF06,0x000A,0xFF05,0x000B,0x2C19,0xFF06,0x0008, - 0xFF06,0x000A,0xFF05,0x000B,0x2C25,0xFF06,0x0008,0xFF06, - 0x000A,0xFF05,0x000B,0x2C31,0xFF06,0x0008,0xFF06,0x000A, - 0xFF05,0x000B,0x2C3D,0xFF06,0x0008,0xFF06,0x000A,0xFF05, - 0x000B,0x2C49,0xFF06,0x0008,0xFF0A,0x000B,0x3C61,0xFF05, - 0x000B,0x2C55,0xFF0A,0x0007,0x3C61,0xFF04,0x0002,0xFF09, - 0x000D,0x3C79,0xFF04,0x0000,0xFF05,0x0001,0x3C62,0xFF05, - 0x000F,0x3C6A,0xFF04,0x0002,0xFF09,0x000D,0x3C89,0xFF04, - 0x0000,0xFF05,0x0001,0x3C64,0xFF05,0x000F,0x3C7A,0xFF04, - 0x0002,0xFF09,0x000D,0x3C99,0xFF04,0x0000,0xFF05,0x0001, - 0x3C66,0xFF05,0x000F,0x3C8A,0xFF04,0x0002,0xFF09,0x000D, - 0x3CA9,0xFF04,0x0000,0xFF05,0x0001,0x3C68,0xFF05,0x000F, - 0x3C9A,0xFF08,0xFF02,0x0003,0xFF03,0x0200,0xFF01,0x0E00, - 0xFF06,0x01BF,0xFF05,0x000F,0x20B0,0xFF05,0x000F,0x20B0, - 0xFF05,0x000F,0x20C0,0xFF05,0x000F,0x20C0,0xFF05,0x000F, - - 0x20D0,0xFF05,0x000F,0x20D0,0xFF05,0x000F,0x20E0,0xFF05, - 0x000F,0x20E0,0xFF05,0x000F,0x20F0,0xFF05,0x000F,0x20F0, - 0xFF05,0x000F,0x2101,0xFF05,0x000F,0x2101,0xFF05,0x000F, - 0x2111,0xFF05,0x000F,0x2111,0xFF05,0x000F,0x2121,0xFF05, - 0x000F,0x2121,0xFF06,0x013F,0xFF00,0xFF08,0xFF02,0x0000 -}; -static UINT16 bloodwar_mcu_4_21[] = { // Warrior 6 - 0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0F00,0xFF06, - 0x01BF,0xFF06,0x005F,0xFF06,0x000F,0x4401,0xFF06,0x000E, - 0xFF06,0x000C,0xFF05,0x0005,0x4402,0xFF06,0x000C,0xFF06, - 0x000C,0xFF05,0x0005,0x4408,0xFF06,0x000C,0xFF06,0x000C, - 0xFF05,0x0005,0x440E,0xFF06,0x000C,0xFF06,0x000C,0xFF05, - 0x0005,0x4414,0xFF06,0x000C,0xFF06,0x000C,0xFF05,0x0005, - 0x401A,0xFF06,0x000C,0xFF06,0x0008,0xFF05,0x0001,0x4901, - 0xFF06,0x0000,0xFF05,0x0007,0x4020,0xFF06,0x0000,0xFF04, - 0x0002,0xFF09,0x0001,0x4902,0xFF04,0x0000,0xFF06,0x0008, - 0xFF06,0x0007,0xFF05,0x0002,0x4903,0xFF06,0x0000,0xFF05, - 0x0007,0x4028,0xFF06,0x0000,0xFF04,0x0002,0xFF09,0x0002, - 0x4905,0xFF04,0x0000,0xFF06,0x0007,0xFF06,0x0007,0xFF05, - 0x0002,0x4906,0xFF06,0x0000,0xFF05,0x0007,0x3C30,0xFF06, - 0x0000,0xFF04,0x0002,0xFF09,0x0002,0x4908,0xFF04,0x0000, - 0xFF06,0x0007,0xFF06,0x0007,0xFF05,0x0002,0x4909,0xFF06, - 0x0000,0xFF05,0x0007,0x3C38,0xFF06,0x0000,0xFF04,0x0002, - - 0xFF09,0x0002,0x490B,0xFF04,0x0000,0xFF06,0x0007,0xFF06, - 0x0007,0x490C,0xFF06,0x0000,0x490D,0xFF05,0x0009,0x3C40, - 0xFF04,0x0002,0x490D,0xFF06,0x0000,0x490C,0xFF04,0x0000, - 0xFF06,0x0007,0xFF06,0x0007,0x490E,0xFF06,0x0001,0xFF05, - 0x0009,0x3C4A,0xFF06,0x0001,0xFF04,0x0002,0x490E,0xFF04, - 0x0000,0xFF06,0x0007,0xFF06,0x0007,0x490F,0xFF06,0x0003, - 0xFF05,0x0005,0x3C54,0xFF06,0x0003,0xFF04,0x0002,0x490F, - 0xFF04,0x0000,0xFF06,0x0007,0xFF06,0x003F,0xFF08,0xFF02, - 0x0001,0xFF03,0x0300,0xFF01,0x0F00,0xFF06,0x01BF,0xFF06, - 0x007F,0xFF06,0x0001,0xFF05,0x0001,0x3870,0xFF06,0x0005, - 0xFF05,0x0001,0x3872,0xFF06,0x0007,0xFF05,0x0001,0x38CA, - 0xFF06,0x0005,0xFF04,0x0002,0xFF09,0x0001,0x3871,0xFF04, - 0x0000,0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0002,0x3874, - 0xFF06,0x0000,0x3877,0xFF06,0x0001,0xFF05,0x0002,0x3878, - 0xFF06,0x0007,0xFF05,0x0002,0x38CC,0xFF06,0x0003,0xFF04, - 0x0002,0xFF09,0x0002,0x3876,0xFF04,0x0000,0xFF06,0x0001, - - 0xFF06,0x0001,0xFF05,0x0005,0x387B,0xFF06,0x0000,0xFF05, - 0x0003,0x3881,0xFF06,0x0005,0xFF05,0x0003,0x38CF,0xFF06, - 0x0003,0xFF04,0x0002,0xFF09,0x0002,0x387D,0xFF04,0x0000, - 0xFF06,0x0001,0xFF06,0x0000,0xFF05,0x0006,0x3885,0xFF06, - 0x0000,0xFF05,0x0003,0x388C,0xFF06,0x0005,0xFF05,0x0007, - 0x38D3,0xFF04,0x0002,0xFF09,0x0003,0x3888,0xFF04,0x0000, - 0xFF06,0x0000,0xFF06,0x0000,0xFF05,0x0007,0x3890,0xFF06, - 0x0000,0xFF05,0x0002,0x3898,0xFF06,0x0005,0xFF05,0x0007, - 0x38DB,0xFF04,0x0002,0xFF09,0x0003,0x3893,0xFF04,0x0000, - 0xFF06,0x0000,0xFF06,0x0000,0xFF05,0x000B,0x389B,0xFF06, - 0x0005,0xFF05,0x0007,0x38E3,0xFF04,0x0002,0xFF09,0x0003, - 0x389E,0xFF04,0x0000,0xFF06,0x0000,0xFF06,0x0000,0xFF05, - 0x000B,0x38A7,0xFF06,0x0005,0xFF05,0x0007,0x38EB,0xFF04, - 0x0002,0xFF09,0x0003,0x38AA,0xFF04,0x0000,0xFF06,0x0000, - 0xFF06,0x0000,0xFF05,0x000B,0x38B3,0xFF06,0x0005,0xFF05, - 0x0007,0x38F3,0xFF04,0x0002,0xFF09,0x0003,0x38B6,0xFF04, - - 0x0000,0xFF06,0x0000,0xFF06,0x0001,0xFF05,0x000A,0x38BF, - 0xFF06,0x0005,0xFF05,0x0004,0x38FB,0xFF05,0x0002,0x386D, - 0xFF04,0x0002,0xFF09,0x0002,0x38C1,0xFF04,0x0000,0xFF06, - 0x0001,0xFF06,0x009F,0xFF08,0xFF02,0x0002,0xFF03,0x0200, - 0xFF01,0x0C00,0xFF06,0x01BF,0xFF06,0x0001,0x2000,0xFF05, - 0x0001,0x2001,0x2400,0xFF05,0x0001,0x2590,0x2800,0xFF05, - 0x0001,0x29AC,0x2C00,0xFF05,0x0001,0x2DCB,0xFF06,0x0003, - 0xFF04,0x0002,0xFF09,0x0001,0x2002,0x2000,0xFF09,0x0001, - 0x2591,0x2400,0xFF09,0x0001,0x29AD,0x2800,0xFF09,0x0001, - 0x2DCC,0x2C00,0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0001, - 0x2000,0xFF05,0x0001,0x2003,0xFF05,0x0002,0x2592,0xFF05, - 0x0002,0x29AE,0xFF05,0x0002,0x2DCD,0xFF06,0x0003,0xFF04, - 0x0002,0xFF09,0x0001,0x2004,0x2000,0xFF09,0x0002,0x2594, - 0xFF09,0x0002,0x29B0,0xFF09,0x0002,0x2DCF,0xFF04,0x0000, - 0xFF06,0x0001,0xFF06,0x0001,0x2000,0xFF05,0x0001,0x2005, - 0xFF05,0x0002,0x2595,0xFF05,0x0002,0x29B1,0xFF05,0x0002, - - 0x2DD0,0xFF06,0x0003,0xFF04,0x0002,0xFF09,0x0001,0x2006, - 0x2000,0xFF09,0x0002,0x2597,0xFF09,0x0002,0x29B3,0xFF09, - 0x0002,0x2DD2,0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0001, - 0x2000,0xFF05,0x0001,0x2007,0x2400,0xFF05,0x0001,0x2598, - 0xFF05,0x0002,0x29B4,0x2C00,0xFF05,0x0001,0x2DD3,0xFF06, - 0x0003,0xFF04,0x0002,0xFF09,0x0001,0x2008,0x2000,0xFF09, - 0x0001,0x2599,0x2400,0xFF09,0x0002,0x29B6,0xFF09,0x0001, - 0x2DD4,0x2C00,0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0001, - 0x2000,0xFF05,0x0001,0x2009,0xFF05,0x0002,0x259A,0xFF05, - 0x0002,0x29B7,0x2C00,0xFF05,0x0001,0x2DD5,0xFF06,0x0003, - 0xFF04,0x0002,0xFF09,0x0001,0x200A,0x2000,0xFF09,0x0002, - 0x259C,0xFF09,0x0002,0x29B9,0xFF09,0x0001,0x2DD6,0x2C00, - 0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0001,0x2000,0xFF05, - 0x0001,0x200B,0xFF05,0x0002,0x259D,0xFF05,0x0002,0x29BA, - 0x2C00,0xFF05,0x0001,0x2DD7,0xFF06,0x0003,0xFF04,0x0002, - 0xFF09,0x0001,0x200C,0x2000,0xFF09,0x0002,0x259F,0xFF09, - - 0x0002,0x29BC,0xFF09,0x0001,0x2DD8,0x2C00,0xFF04,0x0000, - 0xFF06,0x0001,0xFF06,0x0001,0x2000,0xFF05,0x0001,0x200D, - 0xFF05,0x0002,0x25A0,0xFF05,0x0002,0x29BD,0x2C00,0xFF05, - 0x0001,0x2DD9,0xFF06,0x0003,0xFF04,0x0002,0xFF09,0x0001, - 0x200E,0x2000,0xFF09,0x0002,0x25A2,0xFF09,0x0002,0x29BF, - 0xFF09,0x0001,0x2DDA,0x2C00,0xFF04,0x0000,0xFF06,0x0001, - 0xFF06,0x0001,0xFF05,0x0002,0x200F,0xFF05,0x0002,0x25A3, - 0xFF05,0x0002,0x29C0,0xFF05,0x0002,0x2DDB,0xFF06,0x0003, - 0xFF04,0x0002,0xFF09,0x0002,0x2011,0xFF09,0x0002,0x25A5, - 0xFF09,0x0002,0x29C2,0xFF09,0x0002,0x2DDD,0xFF04,0x0000, - 0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0002,0x2012,0xFF05, - 0x0002,0x25A6,0xFF05,0x0002,0x29C3,0xFF05,0x0002,0x2DDE, - 0xFF06,0x0003,0xFF04,0x0002,0xFF09,0x0002,0x2014,0xFF09, - 0x0002,0x25A8,0xFF09,0x0002,0x29C5,0xFF09,0x0002,0x2DE0, - 0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0002, - 0x2015,0x25A9,0xFF0A,0x0001,0x2400,0xFF05,0x0002,0x29C6, - - 0x2DE1,0xFF0A,0x0001,0x2C00,0xFF06,0x0003,0xFF04,0x0002, - 0xFF09,0x0002,0x2017,0xFF0A,0x0001,0x2400,0x25A9,0xFF09, - 0x0002,0x29C8,0xFF0A,0x0001,0x2C00,0x2DE1,0xFF04,0x0000, - 0xFF06,0x0001,0xFF06,0x0001,0x2018,0xFF0A,0x0001,0x2000, - 0x25AA,0xFF0A,0x0001,0x2400,0x29C9,0xFF0A,0x0001,0x2800, - 0x2DE2,0xFF0A,0x0001,0x2C00,0xFF06,0x0003,0xFF04,0x0002, - 0xFF0A,0x0001,0x2000,0x2018,0xFF0A,0x0001,0x2400,0x25AA, - 0xFF0A,0x0001,0x2800,0x29C9,0xFF0A,0x0001,0x2C00,0x2DE2, - 0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0001,0x2019,0xFF0A, - 0x0001,0x2000,0x25AB,0xFF0A,0x0001,0x2400,0x29CA,0xFF0A, - 0x0001,0x2800,0x2DE3,0xFF0A,0x0001,0x2C00,0xFF06,0x0003, - 0xFF04,0x0002,0xFF0A,0x0001,0x2000,0x2019,0xFF0A,0x0001, - 0x2400,0x25AB,0xFF0A,0x0001,0x2800,0x29CA,0xFF0A,0x0001, - 0x2C00,0x2DE3,0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x001F, - 0xFF03,0x0400,0xFF06,0x000B,0xFF05,0x0001,0x3170,0xFF0A, - 0x0004,0x3172,0x3173,0xFF06,0x000B,0xFF06,0x000A,0xFF05, - - 0x0009,0x3174,0xFF06,0x000A,0xFF06,0x000A,0xFF05,0x0009, - 0x317E,0xFF06,0x000A,0xFF06,0x003F,0xFF08,0xFF02,0x0003, - 0xFF03,0x0200,0xFF01,0x0C00,0xFF06,0x01BF,0xFF04,0x0002, - 0xFF09,0x000F,0x343F,0xFF04,0x0000,0xFF05,0x000F,0x3430, - 0xFF04,0x0002,0xFF09,0x000F,0x344F,0xFF04,0x0000,0xFF05, - 0x000F,0x3440,0xFF04,0x0002,0xFF09,0x000F,0x345F,0xFF04, - 0x0000,0xFF05,0x000F,0x3450,0xFF04,0x0002,0xFF0A,0x0001, - 0x3463,0x3471,0x3463,0xFF09,0x0002,0x346E,0xFF0A,0x0001, - 0x3463,0xFF09,0x0001,0x3469,0xFF0A,0x0001,0x3463,0xFF09, - 0x0002,0x3462,0xFF04,0x0000,0xFF05,0x0002,0x3460,0xFF0A, - 0x0001,0x3463,0xFF05,0x0001,0x3468,0xFF0A,0x0001,0x3463, - 0xFF05,0x0002,0x346C,0x3463,0x3471,0xFF0A,0x0001,0x3463, - 0xFF04,0x0002,0xFF0A,0x0001,0x3463,0x3472,0xFF0A,0x0002, - 0x3463,0x346F,0xFF0A,0x0002,0x3463,0x346A,0xFF0A,0x0001, - 0x3463,0xFF09,0x0001,0x3465,0xFF0A,0x0001,0x3463,0xFF04, - 0x0000,0xFF05,0x0001,0x3464,0xFF0A,0x0001,0x3463,0x346A, - - 0xFF0A,0x0002,0x3463,0x346F,0xFF0A,0x0002,0x3463,0x3472, - 0xFF0A,0x0001,0x3463,0xFF04,0x0002,0xFF0A,0x0001,0x341D, - 0x3473,0xFF0A,0x0002,0x341D,0x3470,0xFF0A,0x0002,0x341D, - 0x346B,0xFF0A,0x0001,0x341D,0xFF09,0x0001,0x3467,0xFF0A, - 0x0001,0x341D,0xFF04,0x0000,0xFF05,0x0001,0x3466,0xFF0A, - 0x0001,0x341D,0x346B,0xFF0A,0x0002,0x341D,0x3470,0xFF0A, - 0x0002,0x341D,0x3473,0xFF0A,0x0001,0x341D,0xFF03,0x0300, - 0xFF05,0x000A,0x3474,0xFF06,0x0008,0xFF05,0x0004,0x34BB, - 0xFF04,0x0002,0xFF09,0x0006,0x347A,0xFF04,0x0000,0xFF05, - 0x000B,0x347F,0xFF06,0x0007,0xFF05,0x0004,0x34C0,0xFF04, - 0x0002,0xFF09,0x0006,0x3485,0xFF04,0x0000,0xFF05,0x000B, - 0x348B,0xFF06,0x0007,0xFF05,0x0004,0x34C5,0xFF04,0x0002, - 0xFF09,0x0006,0x3491,0xFF04,0x0000,0xFF05,0x000B,0x3497, - 0xFF06,0x0007,0xFF05,0x0004,0x34CA,0xFF04,0x0002,0xFF09, - 0x0006,0x349D,0xFF04,0x0000,0xFF05,0x000B,0x34A3,0xFF06, - 0x0006,0xFF05,0x0005,0x34CF,0xFF04,0x0002,0xFF09,0x0006, - - 0x34A9,0xFF04,0x0000,0xFF05,0x000B,0x34AF,0xFF06,0x0006, - 0xFF05,0x0005,0x34D5,0xFF04,0x0002,0xFF09,0x0006,0x34B5, - 0xFF04,0x0000,0xFF0A,0x001F,0x301D,0xFF05,0x0003,0x30DB, - 0xFF05,0x0003,0x30DB,0xFF05,0x0003,0x30DB,0xFF05,0x0003, - 0x30DB,0xFF05,0x0003,0x30DB,0xFF05,0x0003,0x30DB,0xFF05, - 0x0003,0x30DB,0xFF05,0x0003,0x30DB,0xFF05,0x000F,0x3121, - 0xFF05,0x000F,0x30DF,0xFF05,0x000F,0x3131,0xFF05,0x000F, - 0x30EF,0xFF05,0x000F,0x3141,0xFF05,0x000F,0x3101,0xFF05, - 0x000F,0x3151,0xFF05,0x000F,0x3111,0xFF00,0xFF08,0xFF02 -}; -static UINT16 bloodwar_mcu_4_22[] = { // Warrior 1 - 0xFF08,0xFF02,0x0000,0xFF03,0x0300,0xFF01,0x0B00,0xFF06, - 0x01BF,0xFF06,0x0001,0x3401,0xFF06,0x0000,0xFF05,0x0002, - 0x3402,0xFF06,0x0010,0xFF05,0x0001,0x3440,0xFF06,0x0001, - 0xFF05,0x0001,0x345C,0xFF06,0x0001,0xFF06,0x0001,0x3405, - 0xFF06,0x0000,0xFF05,0x0002,0x3406,0xFF06,0x0000,0xFF05, - 0x0001,0x4880,0xFF06,0x000C,0x4882,0xFF05,0x0001,0x3442, - 0xFF06,0x0001,0xFF05,0x0001,0x345E,0xFF06,0x0001,0xFF06, - 0x0001,0x3409,0xFF06,0x0000,0xFF05,0x0002,0x340A,0xFF06, - 0x0000,0xFF05,0x000F,0x4883,0xFF05,0x0001,0x3444,0xFF06, - 0x0001,0xFF05,0x0001,0x3460,0xFF06,0x0001,0xFF06,0x0001, - 0x340D,0xFF06,0x0000,0xFF05,0x0002,0x340E,0xFF06,0x0000, - 0xFF05,0x000F,0x4893,0xFF05,0x0001,0x3446,0xFF06,0x0001, - 0xFF05,0x0001,0x3462,0xFF06,0x0001,0xFF06,0x0001,0x3411, - 0xFF06,0x0000,0xFF05,0x0002,0x3412,0xFF06,0x0002,0xFF05, - 0x0001,0x40A3,0x44A5,0xFF06,0x0001,0xFF05,0x0001,0x44A6, - 0xFF06,0x0001,0xFF05,0x0002,0x44A8,0xFF06,0x0001,0xFF05, - - 0x0001,0x3448,0xFF06,0x0001,0xFF05,0x0001,0x3464,0xFF06, - 0x0001,0xFF06,0x0001,0x3415,0xFF06,0x0000,0xFF05,0x0002, - 0x3416,0xFF06,0x0000,0xFF05,0x0003,0x40AB,0xFF05,0x0009, - 0x44AF,0xFF05,0x0001,0x40B9,0xFF05,0x0001,0x344A,0xFF06, - 0x0001,0xFF05,0x0001,0x3466,0xFF06,0x0001,0xFF06,0x0001, - 0x3419,0xFF06,0x0000,0xFF05,0x0002,0x341A,0xFF06,0x0003, - 0xFF05,0x0001,0x44BB,0xFF06,0x0005,0xFF05,0x0001,0x44D0, - 0xFF06,0x0002,0xFF05,0x0001,0x344C,0xFF06,0x0001,0xFF05, - 0x0001,0x3468,0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0004, - 0x341D,0xFF06,0x0003,0xFF05,0x0001,0x44BD,0xFF06,0x0005, - 0xFF05,0x0001,0x44D2,0xFF06,0x0002,0xFF05,0x0001,0x344E, - 0xFF06,0x0001,0xFF05,0x0001,0x346A,0xFF06,0x0001,0xFF06, - 0x0001,0xFF05,0x0004,0x3422,0xFF06,0x0003,0xFF05,0x0001, - 0x44BF,0xFF06,0x0005,0xFF05,0x0001,0x44D4,0xFF06,0x0002, - 0xFF05,0x0001,0x3450,0xFF06,0x0001,0xFF05,0x0001,0x346C, - 0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0004,0x3427,0xFF06, - - 0x0002,0xFF05,0x0002,0x44C1,0xFF06,0x0005,0xFF05,0x0002, - 0x44D6,0xFF06,0x0001,0xFF05,0x0001,0x3452,0xFF05,0x0001, - 0x3875,0xFF05,0x0001,0x346E,0xFF06,0x0001,0xFF06,0x0001, - 0xFF05,0x0004,0x342C,0xFF06,0x0002,0xFF05,0x0002,0x44C4, - 0xFF06,0x0005,0xFF05,0x0002,0x44D9,0xFF06,0x0001,0xFF05, - 0x0001,0x3454,0xFF05,0x0001,0x3877,0xFF05,0x0001,0x3470, - 0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0004,0x3431,0xFF06, - 0x0002,0xFF05,0x0002,0x44C7,0xFF06,0x0005,0xFF05,0x0002, - 0x44DC,0xFF06,0x0001,0xFF05,0x0001,0x3456,0xFF05,0x0002, - 0x3879,0x3472,0xFF06,0x0001,0xFF06,0x0001,0xFF05,0x0004, - 0x3436,0xFF06,0x0002,0xFF05,0x0002,0x44CA,0xFF06,0x0005, - 0xFF05,0x0002,0x44DF,0xFF06,0x0001,0xFF05,0x0001,0x3458, - 0xFF05,0x0001,0x387C,0xFF06,0x0000,0x3473,0xFF06,0x0001, - 0xFF06,0x0001,0xFF05,0x0004,0x343B,0xFF06,0x0002,0xFF05, - 0x0002,0x44CD,0xFF06,0x0005,0xFF05,0x0002,0x44E2,0xFF06, - 0x0001,0xFF05,0x0001,0x345A,0xFF05,0x0001,0x387E,0xFF06, - - 0x0000,0x3474,0xFF06,0x0001,0xFF05,0x0007,0x3CE5,0xFF04, - 0x0002,0xFF09,0x0007,0x3D08,0xFF04,0x0000,0xFF05,0x000F, - 0x3D01,0xFF05,0x0006,0x3CED,0xFF04,0x0002,0xFF09,0x0008, - 0x3D19,0xFF04,0x0000,0xFF05,0x000F,0x3D11,0xFF05,0x0005, - 0x3CF4,0xFF04,0x0002,0xFF09,0x0009,0x3D2A,0xFF04,0x0000, - 0xFF05,0x000F,0x3D21,0xFF05,0x0004,0x3CFA,0xFF04,0x0002, - 0xFF09,0x000A,0x3D3B,0xFF04,0x0000,0xFF05,0x000F,0x3D31, - 0xFF08,0xFF02,0x0001,0xFF03,0x0400,0xFF01,0x0C00,0xFF06, - 0x01BF,0xFF06,0x003F,0xFF06,0x000D,0xFF05,0x0003,0x2850, - 0xFF06,0x000D,0xFF06,0x000D,0xFF05,0x0003,0x2854,0xFF06, - 0x000D,0xFF06,0x000D,0xFF05,0x0002,0x2858,0xFF06,0x000E, - 0xFF06,0x000D,0xFF05,0x0002,0x285B,0xFF06,0x000E,0xFF03, - 0x0300,0xFF06,0x0011,0xFF05,0x0003,0x307A,0xFF06,0x0009, - 0xFF06,0x000D,0xFF05,0x0007,0x307E,0xFF06,0x0009,0xFF06, - 0x0004,0xFF05,0x0001,0x305E,0xFF06,0x0006,0xFF05,0x000B, - 0x3086,0xFF06,0x0005,0xFF06,0x0004,0xFF05,0x0002,0x3060, - - 0xFF06,0x0005,0xFF05,0x000B,0x3092,0xFF06,0x0005,0xFF06, - 0x0004,0xFF05,0x0004,0x3063,0xFF06,0x0002,0xFF05,0x000D, - 0x309E,0xFF06,0x0004,0xFF06,0x0004,0xFF05,0x0003,0x3068, - 0xFF06,0x0003,0xFF05,0x000C,0x30AB,0xFF06,0x0005,0xFF06, - 0x0004,0xFF05,0x0006,0x306C,0xFF05,0x000E,0x30B8,0xFF06, - 0x0004,0xFF06,0x0004,0xFF05,0x0006,0x3073,0xFF05,0x000E, - 0x30C7,0xFF06,0x0004,0xFF06,0x007F,0xFF08,0xFF02,0x0002, - 0xFF03,0x0200,0xFF01,0x0900,0xFF06,0x01BF,0xFF05,0x0006, - 0x2001,0xFF06,0x0000,0xFF05,0x0007,0x2008,0xFF05,0x0006, - 0x2001,0xFF06,0x0000,0xFF05,0x0007,0x2008,0xFF05,0x000F, - 0x2010,0xFF05,0x000F,0x2010,0xFF05,0x000F,0x2020,0xFF05, - 0x000F,0x2020,0xFF05,0x000F,0x2030,0xFF05,0x000F,0x2030, - 0xFF05,0x000F,0x2040,0xFF05,0x000F,0x2040,0xFF05,0x000F, - 0x2050,0xFF05,0x000F,0x2050,0xFF05,0x000F,0x2060,0xFF05, - 0x000F,0x2060,0xFF05,0x000F,0x2070,0xFF05,0x000F,0x2070, - 0xFF05,0x000F,0x2080,0xFF05,0x000F,0x2080,0xFF05,0x000D, - - 0x2090,0xFF06,0x0000,0x209E,0xFF05,0x000D,0x2090,0xFF06, - 0x0000,0x209E,0x209F,0xFF06,0x0001,0xFF05,0x000A,0x20A0, - 0xFF06,0x0000,0x20AB,0x209F,0xFF06,0x0001,0xFF05,0x000A, - 0x20A0,0xFF06,0x0000,0x20AB,0x20AC,0xFF06,0x0001,0xFF05, - 0x000A,0x20AD,0xFF06,0x0000,0x20B8,0x20AC,0xFF06,0x0001, - 0xFF05,0x000A,0x20AD,0xFF06,0x0000,0x20B8,0x20B9,0xFF06, - 0x0001,0xFF05,0x000C,0x20BA,0x20B9,0xFF06,0x0001,0xFF05, - 0x000C,0x20BA,0xFF05,0x000F,0x20C7,0xFF05,0x000F,0x20C7, - 0xFF06,0x007F,0xFF08,0xFF02,0x0003,0xFF03,0x0200,0xFF01, - 0x0900,0xFF06,0x01BF,0xFF0A,0x0005,0x2501,0xFF05,0x0009, - 0x2501,0xFF05,0x0004,0x255B,0xFF0A,0x0004,0x2501,0xFF0A, - 0x0005,0x2501,0xFF05,0x0005,0x25A6,0xFF05,0x0009,0x250B, - 0xFF05,0x0005,0x2560,0xFF0A,0x0003,0x2501,0xFF05,0x0005, - 0x25A0,0xFF05,0x0005,0x25B2,0xFF05,0x0009,0x2515,0xFF05, - 0x0006,0x2566,0x2501,0xFF05,0x0001,0x256D,0xFF05,0x0005, - 0x25AC,0xFF05,0x0005,0x25BE,0xFF05,0x0009,0x251F,0xFF05, - - 0x0009,0x256F,0xFF05,0x0005,0x25B8,0xFF05,0x0005,0x25CA, - 0xFF05,0x0009,0x2529,0xFF05,0x0009,0x2579,0xFF05,0x0005, - 0x25C4,0xFF05,0x0005,0x25D6,0xFF05,0x0009,0x2533,0xFF05, - 0x0009,0x2583,0xFF05,0x0005,0x25D0,0xFF05,0x0005,0x25E2, - 0xFF05,0x0009,0x253D,0xFF05,0x0009,0x258D,0xFF05,0x0005, - 0x25DC,0xFF05,0x0005,0x25EE,0xFF05,0x0009,0x2547,0xFF05, - 0x0002,0x2597,0xFF0A,0x0001,0x2501,0x259A,0xFF0A,0x0001, - 0x2501,0xFF05,0x0001,0x259B,0xFF05,0x0005,0x25E8,0xFF05, - 0x0005,0x25FA,0xFF05,0x0009,0x2551,0xFF0A,0x0009,0x2501, - 0xFF05,0x0005,0x25F4,0xFF03,0x0300,0xFF06,0x0006,0x2CE0, - 0xFF06,0x0002,0x2CE1,0xFF06,0x000A,0x2CE0,0xFF06,0x0002, - 0x2CE1,0xFF06,0x0003,0xFF06,0x0005,0xFF05,0x0006,0x2CE2, - 0xFF06,0x0008,0xFF05,0x0006,0x2CE2,0xFF06,0x0002,0xFF06, - 0x0005,0xFF05,0x0006,0x2CE9,0xFF06,0x0008,0xFF05,0x0006, - 0x2CE9,0xFF06,0x0002,0xFF06,0x0005,0xFF05,0x0006,0x2CF0, - 0xFF06,0x0008,0xFF05,0x0006,0x2CF0,0xFF06,0x0002,0xFF06, - - 0x0005,0xFF05,0x0006,0x2CF7,0xFF06,0x0008,0xFF05,0x0006, - 0x2CF7,0xFF06,0x0002,0xFF06,0x007F,0xFF00,0xFF08,0xFF02 -}; -static UINT16 bloodwar_mcu_4_23[] = { // Warrior 9 - 0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0A00,0xFF06, - 0x01BF,0xFF06,0x0006,0xFF05,0x0001,0x3C88,0xFF06,0x0005, - 0xFF05,0x0001,0x4001,0xFF06,0x0005,0xFF04,0x0002,0xFF09, - 0x0001,0x3C89,0xFF04,0x0000,0xFF06,0x0006,0xFF06,0x0006, - 0xFF05,0x0001,0x3C8A,0xFF06,0x0004,0xFF05,0x0002,0x4003, - 0xFF06,0x0005,0xFF04,0x0002,0xFF09,0x0001,0x3C8B,0xFF04, - 0x0000,0xFF06,0x0006,0xFF06,0x0001,0xFF05,0x0004,0x3032, - 0xFF05,0x0001,0x3C16,0xFF06,0x0004,0xFF05,0x0003,0x4006, - 0xFF06,0x0004,0xFF04,0x0002,0xFF09,0x0001,0x3C17,0xFF09, - 0x0004,0x3036,0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0000, - 0xFF05,0x0005,0x3037,0xFF05,0x0001,0x3C18,0xFF06,0x0004, - 0xFF05,0x0003,0x400A,0xFF06,0x0004,0xFF04,0x0002,0xFF09, - 0x0001,0x3C19,0xFF09,0x0005,0x303C,0xFF04,0x0000,0xFF06, - 0x0000,0xFF06,0x0000,0xFF05,0x0005,0x303D,0xFF05,0x0001, - 0x3C1A,0xFF06,0x0004,0xFF05,0x0003,0x400E,0xFF06,0x0004, - 0xFF04,0x0002,0xFF09,0x0001,0x3C1B,0xFF09,0x0005,0x3042, - - 0xFF04,0x0000,0xFF06,0x0000,0xFF06,0x0000,0xFF05,0x0005, - 0x3043,0xFF05,0x0001,0x3C1C,0xFF06,0x0004,0xFF05,0x0003, - 0x4012,0xFF06,0x0004,0xFF04,0x0002,0xFF09,0x0001,0x3C1D, - 0xFF09,0x0005,0x3048,0xFF06,0x0000,0xFF04,0x0000,0xFF05, - 0x0006,0x3049,0xFF05,0x0001,0x3C1E,0xFF06,0x000D,0xFF04, - 0x0002,0xFF09,0x0001,0x3C1F,0xFF09,0x0006,0x304F,0xFF04, - 0x0000,0xFF05,0x0006,0x3050,0xFF05,0x0001,0x3C20,0xFF06, - 0x000D,0xFF04,0x0002,0xFF09,0x0001,0x3C21,0xFF09,0x0006, - 0x3056,0xFF04,0x0000,0xFF05,0x0006,0x3057,0xFF05,0x0001, - 0x3C22,0xFF06,0x000D,0xFF04,0x0002,0xFF09,0x0001,0x3C23, - 0xFF09,0x0006,0x305D,0xFF04,0x0000,0xFF05,0x0005,0x305E, - 0xFF06,0x0000,0xFF05,0x0001,0x3C24,0xFF06,0x000D,0xFF04, - 0x0002,0xFF09,0x0001,0x3C25,0xFF06,0x0000,0xFF09,0x0005, - 0x3063,0xFF04,0x0000,0xFF06,0x0000,0xFF05,0x0004,0x3064, - 0xFF06,0x0000,0xFF05,0x0001,0x3C26,0xFF06,0x000D,0xFF04, - 0x0002,0xFF09,0x0001,0x3C27,0xFF06,0x0000,0xFF09,0x0004, - - 0x3068,0xFF04,0x0000,0xFF06,0x0000,0xFF06,0x0000,0xFF05, - 0x0004,0x3069,0xFF06,0x0000,0xFF05,0x0001,0x3C28,0xFF06, - 0x000D,0xFF04,0x0002,0xFF09,0x0001,0x3C29,0xFF06,0x0000, - 0xFF09,0x0004,0x306D,0xFF04,0x0000,0xFF06,0x0000,0xFF06, - 0x0000,0xFF05,0x0004,0x306E,0xFF06,0x0000,0xFF05,0x0001, - 0x3C2A,0xFF06,0x000D,0xFF04,0x0002,0xFF09,0x0001,0x3C2B, - 0xFF06,0x0000,0xFF09,0x0004,0x3072,0xFF04,0x0000,0xFF06, - 0x0000,0xFF06,0x0000,0xFF05,0x0004,0x3073,0xFF06,0x0000, - 0xFF05,0x0001,0x3C2C,0xFF06,0x000D,0xFF04,0x0002,0xFF09, - 0x0001,0x3C2D,0xFF06,0x0000,0xFF09,0x0004,0x3077,0xFF04, - 0x0000,0xFF06,0x0000,0xFF05,0x0005,0x3078,0xFF06,0x0000, - 0xFF05,0x0001,0x3C2E,0xFF06,0x000D,0xFF04,0x0002,0xFF09, - 0x0001,0x3C2F,0xFF06,0x0000,0xFF09,0x0005,0x307D,0xFF04, - 0x0000,0xFF05,0x0005,0x307E,0xFF06,0x0000,0xFF05,0x0001, - 0x3C30,0xFF06,0x000D,0xFF04,0x0002,0xFF09,0x0001,0x3C31, - 0xFF06,0x0000,0xFF09,0x0005,0x3083,0xFF04,0x0000,0xFF06, - - 0x003F,0xFF08,0xFF02,0x0001,0xFF03,0x0200,0xFF01,0x0A00, - 0xFF06,0x01BF,0xFF06,0x0009,0xFF05,0x0001,0x3C8C,0xFF06, - 0x0007,0xFF04,0x0002,0xFF09,0x0001,0x3C8D,0xFF04,0x0000, - 0xFF06,0x0009,0xFF06,0x0001,0xFF05,0x0002,0x40A0,0xFF06, - 0x0004,0xFF05,0x0001,0x3C8E,0xFF06,0x0002,0xFF05,0x0001, - 0x4090,0xFF06,0x0002,0xFF04,0x0002,0xFF09,0x0001,0x3C8F, - 0xFF06,0x0004,0xFF09,0x0002,0x40A2,0xFF04,0x0000,0xFF06, - 0x0001,0xFF06,0x0001,0xFF05,0x0002,0x40A3,0xFF06,0x0000, - 0xFF05,0x0003,0x34C7,0xFF05,0x0001,0x3CAF,0xFF06,0x0001, - 0xFF05,0x0003,0x4092,0xFF06,0x0001,0xFF04,0x0002,0xFF09, - 0x0001,0x3CB0,0xFF09,0x0003,0x34CA,0xFF06,0x0000,0xFF09, - 0x0002,0x40A5,0xFF04,0x0000,0xFF06,0x0001,0xFF06,0x0001, - 0xFF05,0x0002,0x40A6,0xFF05,0x0004,0x34CB,0xFF05,0x0001, - 0x3CB1,0xFF06,0x0002,0xFF05,0x0001,0x4096,0xFF06,0x0002, - 0xFF04,0x0002,0xFF09,0x0001,0x3CB2,0xFF09,0x0004,0x34CF, - 0xFF09,0x0002,0x40A8,0xFF04,0x0000,0xFF06,0x0001,0xFF06, - - 0x0001,0xFF05,0x0002,0x40A9,0xFF05,0x0004,0x34D0,0xFF05, - 0x0001,0x3CB3,0xFF06,0x0001,0xFF05,0x0003,0x4098,0xFF06, - 0x0001,0xFF04,0x0002,0xFF09,0x0001,0x3CB4,0xFF09,0x0004, - 0x34D4,0xFF09,0x0002,0x40AB,0xFF04,0x0000,0xFF06,0x0001, - 0xFF06,0x0001,0xFF05,0x0002,0x40AC,0xFF05,0x0004,0x34D5, - 0xFF05,0x0001,0x3CB5,0xFF06,0x0001,0xFF05,0x0003,0x409C, - 0xFF06,0x0001,0xFF04,0x0002,0xFF09,0x0001,0x3CB6,0xFF09, - 0x0004,0x34D9,0xFF09,0x0002,0x40AE,0xFF04,0x0000,0xFF06, - 0x0001,0xFF06,0x0004,0xFF05,0x0004,0x34DA,0xFF05,0x0001, - 0x3CB7,0xFF06,0x0007,0xFF04,0x0002,0xFF09,0x0001,0x3CB8, - 0xFF09,0x0004,0x34DE,0xFF04,0x0000,0xFF06,0x0004,0xFF06, - 0x0004,0xFF05,0x0004,0x34DF,0xFF05,0x0001,0x3CB9,0xFF06, - 0x0007,0xFF04,0x0002,0xFF09,0x0001,0x3CBA,0xFF09,0x0004, - 0x34E3,0xFF04,0x0000,0xFF06,0x0004,0xFF06,0x0004,0xFF05, - 0x0004,0x34E4,0xFF05,0x0001,0x3CBB,0xFF06,0x0007,0xFF04, - 0x0002,0xFF09,0x0001,0x3CBC,0xFF09,0x0004,0x34E8,0xFF04, - - 0x0000,0xFF06,0x0004,0xFF06,0x0004,0xFF05,0x0004,0x34E9, - 0xFF05,0x0001,0x3CBD,0xFF06,0x0007,0xFF04,0x0002,0xFF09, - 0x0001,0x3CBE,0xFF09,0x0004,0x34ED,0xFF04,0x0000,0xFF06, - 0x0004,0xFF06,0x0004,0xFF05,0x0004,0x34EE,0xFF05,0x0001, - 0x3CBF,0xFF06,0x0007,0xFF04,0x0002,0xFF09,0x0001,0x3CC0, - 0xFF09,0x0004,0x34F2,0xFF04,0x0000,0xFF06,0x0004,0xFF06, - 0x0005,0xFF05,0x0002,0x34F3,0xFF06,0x0000,0xFF05,0x0001, - 0x3CC1,0xFF06,0x0007,0xFF04,0x0002,0xFF09,0x0001,0x3CC2, - 0xFF06,0x0000,0xFF09,0x0002,0x34F5,0xFF04,0x0000,0xFF06, - 0x0005,0xFF06,0x0004,0xFF05,0x0004,0x34F6,0xFF05,0x0001, - 0x3CC3,0xFF06,0x0007,0xFF04,0x0002,0xFF09,0x0001,0x3CC4, - 0xFF09,0x0004,0x34FA,0xFF04,0x0000,0xFF06,0x0004,0xFF06, - 0x0004,0xFF05,0x0004,0x34FB,0xFF05,0x0001,0x3CC5,0xFF06, - 0x0007,0xFF04,0x0002,0xFF09,0x0001,0x3CC6,0xFF09,0x0004, - 0x34FF,0xFF04,0x0000,0xFF06,0x0004,0xFF06,0x007F,0xFF08, - 0xFF02,0x0002,0xFF03,0x0200,0xFF01,0x0700,0xFF06,0x01BF, - - 0xFF05,0x000F,0x3C01,0xFF04,0x0002,0xFF09,0x000F,0x3C10, - 0xFF04,0x0000,0xFF06,0x0003,0xFF05,0x000B,0x3C11,0xFF04, - 0x0002,0xFF09,0x000B,0x3C1C,0xFF04,0x0000,0xFF06,0x0003, - 0xFF06,0x0006,0xFF05,0x0001,0x401D,0xFF06,0x0000,0xFF05, - 0x0002,0x3835,0x3C23,0xFF06,0x0000,0xFF05,0x0001,0x401D, - 0xFF06,0x0000,0xFF04,0x0002,0x3C23,0xFF09,0x0002,0x3837, - 0xFF06,0x0000,0xFF09,0x0001,0x401E,0xFF04,0x0000,0xFF06, - 0x0006,0xFF06,0x0006,0xFF05,0x0001,0x401F,0xFF05,0x0003, - 0x3838,0x3C24,0xFF06,0x0000,0xFF05,0x0001,0x401F,0xFF06, - 0x0000,0xFF04,0x0002,0x3C24,0xFF09,0x0003,0x383B,0xFF09, - 0x0001,0x4020,0xFF04,0x0000,0xFF06,0x0006,0xFF06,0x0006, - 0xFF05,0x0001,0x4021,0xFF05,0x0003,0x383C,0x3C25,0xFF06, - 0x0000,0xFF05,0x0001,0x4021,0xFF06,0x0000,0xFF04,0x0002, - 0x3C25,0xFF09,0x0003,0x383F,0xFF09,0x0001,0x4022,0xFF04, - 0x0000,0xFF06,0x0006,0xFF06,0x0008,0xFF05,0x0003,0x3840, - 0x3C26,0xFF06,0x0003,0xFF04,0x0002,0x3C26,0xFF09,0x0003, - - 0x3843,0xFF04,0x0000,0xFF06,0x0008,0xFF06,0x0008,0xFF05, - 0x0003,0x3844,0x3C27,0xFF06,0x0003,0xFF04,0x0002,0x3C27, - 0xFF09,0x0003,0x3847,0xFF04,0x0000,0xFF06,0x0008,0xFF06, - 0x0008,0xFF05,0x0003,0x3848,0x3C28,0xFF06,0x0003,0xFF04, - 0x0002,0x3C28,0xFF09,0x0003,0x384B,0xFF04,0x0000,0xFF06, - 0x0008,0xFF06,0x0008,0xFF05,0x0003,0x384C,0x3C29,0xFF06, - 0x0003,0xFF04,0x0002,0x3C29,0xFF09,0x0003,0x384F,0xFF04, - 0x0000,0xFF06,0x0008,0xFF06,0x0008,0xFF05,0x0003,0x3850, - 0x3C2A,0xFF06,0x0003,0xFF04,0x0002,0x3C2A,0xFF09,0x0003, - 0x3853,0xFF04,0x0000,0xFF06,0x0008,0xFF06,0x0008,0xFF05, - 0x0003,0x3854,0x3C2B,0xFF05,0x0003,0x442D,0xFF04,0x0002, - 0x3C2B,0xFF09,0x0003,0x3857,0xFF04,0x0000,0xFF06,0x0008, - 0xFF06,0x0008,0xFF05,0x0003,0x3858,0x3C2C,0xFF05,0x0003, - 0x4431,0xFF04,0x0002,0x3C2C,0xFF09,0x0003,0x385B,0xFF04, - 0x0000,0xFF06,0x0008,0xFF06,0x0003,0xFF05,0x0017,0x485C, - 0xFF06,0x0003,0xFF05,0x001F,0x4874,0xFF05,0x001F,0x4894, - - 0xFF05,0x001F,0x48B4,0xFF05,0x001F,0x48D4,0xFF05,0x000B, - 0x48F4,0xFF05,0x0013,0x4901,0xFF08,0xFF02,0x0003,0xFF03, - 0x0200,0xFF01,0x0800,0xFF06,0x01BF,0xFF05,0x0007,0x2820, - 0xFF05,0x0007,0x2820,0xFF05,0x0007,0x2820,0xFF05,0x0007, - 0x2820,0xFF05,0x0007,0x2828,0xFF05,0x0007,0x2828,0xFF05, - 0x0007,0x2828,0xFF05,0x0007,0x2828,0xFF05,0x0007,0x2830, - 0xFF05,0x0007,0x2830,0xFF05,0x0007,0x2830,0xFF05,0x0007, - 0x2830,0xFF05,0x0007,0x2438,0xFF05,0x0007,0x2438,0xFF05, - 0x0007,0x2438,0xFF05,0x0007,0x2438,0xFF05,0x0007,0x2040, - 0xFF05,0x0007,0x2040,0xFF05,0x0007,0x2040,0xFF05,0x0007, - 0x2040,0xFF05,0x0007,0x2048,0xFF05,0x0007,0x2048,0xFF05, - 0x0007,0x2048,0xFF05,0x0007,0x2048,0xFF0A,0x001F,0x2C50, - 0xFF05,0x0007,0x2051,0xFF05,0x0007,0x2051,0xFF05,0x0007, - 0x2051,0xFF05,0x0007,0x2051,0xFF05,0x0007,0x2059,0xFF05, - 0x0007,0x2059,0xFF05,0x0007,0x2059,0xFF05,0x0007,0x2059, - 0xFF05,0x0007,0x2461,0xFF05,0x0007,0x2461,0xFF05,0x0007, - - 0x2461,0xFF05,0x0007,0x2461,0xFF05,0x0007,0x2869,0xFF05, - 0x0007,0x2869,0xFF05,0x0007,0x2869,0xFF05,0x0007,0x2869, - 0xFF05,0x0007,0x2871,0xFF05,0x0007,0x2871,0xFF05,0x0007, - 0x2871,0xFF05,0x0007,0x2871,0xFF05,0x0007,0x2879,0xFF05, - 0x0007,0x2879,0xFF05,0x0007,0x2879,0xFF05,0x0007,0x2879, - 0xFF05,0x0007,0x2881,0xFF05,0x0007,0x2881,0xFF05,0x0007, - 0x2881,0xFF05,0x0007,0x2881,0xFF06,0x007F,0xFF00,0xFF08 -}; -static UINT16 bloodwar_mcu_4_24[] = { // Warrior 7 - 0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0300,0xFF06, - 0x01BF,0xFF06,0x0000,0x3402,0xFF05,0x0005,0x4C14,0x3402, - 0xFF05,0x0006,0x4C14,0xFF05,0x0006,0x4C14,0xFF04,0x0002, - 0x3402,0xFF04,0x0000,0xFF05,0x0005,0x4C14,0xFF04,0x0002, - 0x3402,0xFF04,0x0000,0xFF06,0x0000,0xFF06,0x0000,0x3403, - 0xFF05,0x0005,0x4C1B,0x3403,0xFF05,0x0002,0x4C1B,0xFF05, - 0x0007,0x4B32,0xFF05,0x0002,0x4C1F,0xFF04,0x0002,0x3403, - 0xFF04,0x0000,0xFF05,0x0005,0x4C1B,0xFF04,0x0002,0x3403, - 0xFF04,0x0000,0xFF06,0x0000,0xFF06,0x0000,0x3404,0xFF05, - 0x0005,0x4C22,0x3404,0xFF05,0x0002,0x4C22,0xFF05,0x0007, - 0x4B3A,0xFF05,0x0002,0x4C26,0xFF04,0x0002,0x3404,0xFF04, - 0x0000,0xFF05,0x0005,0x4C22,0xFF04,0x0002,0x3404,0xFF04, - 0x0000,0xFF06,0x0000,0xFF05,0x0007,0x340C,0xFF05,0x0007, - 0x340C,0xFF05,0x0007,0x340C,0xFF05,0x0007,0x340C,0xFF06, - 0x0000,0x3401,0xFF05,0x0006,0x2029,0xFF05,0x000D,0x207E, - 0xFF05,0x0006,0x2029,0xFF04,0x0002,0x3401,0xFF04,0x0000, - - 0xFF06,0x0000,0xFF06,0x0000,0x3402,0xFF05,0x0006,0x2030, - 0xFF05,0x000D,0x208C,0xFF05,0x0006,0x2030,0xFF04,0x0002, - 0x3402,0xFF04,0x0000,0xFF06,0x0000,0xFF06,0x0000,0x3403, - 0xFF05,0x0006,0x2037,0xFF05,0x000D,0x209A,0xFF05,0x0006, - 0x2037,0xFF04,0x0002,0x3403,0xFF04,0x0000,0xFF06,0x0000, - 0xFF06,0x0000,0x3404,0xFF05,0x0006,0x203E,0xFF05,0x000D, - 0x20A8,0xFF05,0x0006,0x203E,0xFF04,0x0002,0x3404,0xFF04, - 0x0000,0xFF06,0x0000,0xFF06,0x0000,0x3405,0xFF05,0x0006, - 0x2045,0xFF05,0x000D,0x20B6,0xFF05,0x0006,0x2045,0xFF04, - 0x0002,0x3405,0xFF04,0x0000,0xFF06,0x0000,0xFF06,0x0000, - 0x3406,0xFF05,0x0001,0x2076,0xFF05,0x0004,0x204E,0xFF05, - 0x000D,0x20C4,0xFF05,0x0004,0x204C,0xFF05,0x0001,0x207A, - 0xFF04,0x0002,0x3406,0xFF04,0x0000,0xFF06,0x0000,0xFF06, - 0x0000,0x3407,0xFF05,0x0001,0x2078,0xFF05,0x0004,0x2055, - 0xFF05,0x000D,0x20D2,0xFF05,0x0004,0x2053,0xFF05,0x0001, - 0x207C,0xFF04,0x0002,0x3407,0xFF04,0x0000,0xFF06,0x0000, - - 0xFF06,0x0000,0x3408,0xFF05,0x0006,0x205A,0xFF05,0x000D, - 0x20E0,0xFF05,0x0006,0x205A,0xFF04,0x0002,0x3408,0xFF04, - 0x0000,0xFF06,0x0000,0xFF06,0x0000,0x3409,0xFF05,0x0006, - 0x2061,0xFF05,0x000D,0x20EE,0xFF05,0x0006,0x2061,0xFF04, - 0x0002,0x3409,0xFF04,0x0000,0xFF06,0x0000,0xFF06,0x0000, - 0x340A,0xFF05,0x0006,0x2068,0xFF05,0x000D,0x2101,0xFF05, - 0x0006,0x2068,0xFF04,0x0002,0x340A,0xFF04,0x0000,0xFF06, - 0x0000,0xFF06,0x0000,0x340B,0xFF05,0x0006,0x206F,0xFF05, - 0x000D,0x210F,0xFF05,0x0006,0x206F,0xFF04,0x0002,0x340B, - 0xFF04,0x0000,0xFF06,0x0000,0xFF06,0x005F,0xFF08,0xFF02, - 0x0001,0xFF03,0x0200,0xFF01,0x0600,0xFF06,0x01BF,0xFF06, - 0x007F,0xFF05,0x001F,0x34D0,0xFF06,0x0003,0x34F0,0xFF05, - 0x0004,0x2507,0xFF05,0x000B,0x2501,0xFF05,0x0004,0x2502, - 0xFF04,0x0002,0x34F0,0xFF04,0x0000,0xFF06,0x0003,0xFF06, - 0x0003,0x34F1,0xFF05,0x0004,0x2513,0xFF05,0x000B,0x250D, - 0xFF05,0x0004,0x250E,0xFF04,0x0002,0x34F1,0xFF04,0x0000, - - 0xFF06,0x0003,0xFF06,0x0003,0x34F2,0xFF05,0x0004,0x251F, - 0xFF05,0x000B,0x2519,0xFF05,0x0004,0x251A,0xFF04,0x0002, - 0x34F2,0xFF04,0x0000,0xFF06,0x0003,0xFF06,0x0003,0x34F3, - 0xFF05,0x0004,0x252B,0xFF05,0x000B,0x2525,0xFF05,0x0004, - 0x2526,0xFF04,0x0002,0x34F3,0xFF04,0x0000,0xFF06,0x0003, - 0xFF06,0x0003,0x34F4,0xFF05,0x0004,0x2537,0xFF05,0x000B, - 0x2531,0xFF05,0x0004,0x2532,0xFF04,0x0002,0x34F4,0xFF04, - 0x0000,0xFF06,0x0003,0xFF06,0x0003,0x34F5,0xFF05,0x0004, - 0x2543,0xFF05,0x000B,0x253D,0xFF05,0x0004,0x253E,0xFF04, - 0x0002,0x34F5,0xFF04,0x0000,0xFF06,0x0003,0xFF06,0x0003, - 0x34F6,0xFF05,0x0004,0x254F,0xFF05,0x000B,0x2549,0xFF05, - 0x0004,0x254A,0xFF04,0x0002,0x34F6,0xFF04,0x0000,0xFF06, - 0x0003,0xFF06,0x0003,0x34F7,0xFF05,0x0004,0x255B,0xFF05, - 0x000B,0x2555,0xFF05,0x0004,0x2556,0xFF04,0x0002,0x34F7, - 0xFF04,0x0000,0xFF06,0x0003,0xFF06,0x0003,0x34F8,0xFF05, - 0x0004,0x2567,0xFF05,0x000B,0x2561,0xFF05,0x0004,0x2562, - - 0xFF04,0x0002,0x34F8,0xFF04,0x0000,0xFF06,0x0003,0xFF06, - 0x007F,0xFF08,0xFF02,0x0002,0xFF03,0x0200,0xFF01,0x0200, - 0xFF06,0x01BF,0xFF06,0x009F,0xFF05,0x001F,0x3408,0xFF06, - 0x0002,0xFF05,0x0003,0x2830,0x3401,0xFF05,0x0003,0x2830, - 0xFF05,0x0007,0x2C28,0xFF05,0x0003,0x2830,0xFF04,0x0002, - 0x3401,0xFF04,0x0000,0xFF05,0x0003,0x2830,0xFF06,0x0002, - 0xFF06,0x0002,0xFF05,0x0003,0x283C,0x3402,0xFF05,0x0003, - 0x283C,0xFF05,0x0007,0x2C34,0xFF05,0x0003,0x283C,0xFF04, - 0x0002,0x3402,0xFF04,0x0000,0xFF05,0x0003,0x283C,0xFF06, - 0x0002,0xFF06,0x0002,0xFF05,0x0003,0x2848,0x3403,0xFF05, - 0x0003,0x2848,0xFF05,0x0007,0x2C40,0xFF05,0x0003,0x2848, - 0xFF04,0x0002,0x3403,0xFF04,0x0000,0xFF05,0x0003,0x2848, - 0xFF06,0x0002,0xFF06,0x0002,0xFF05,0x0003,0x2854,0x3404, - 0xFF05,0x0003,0x2854,0xFF05,0x0007,0x2C4C,0xFF05,0x0003, - 0x2854,0xFF04,0x0002,0x3404,0xFF04,0x0000,0xFF05,0x0003, - 0x2854,0xFF06,0x0002,0xFF06,0x0002,0xFF05,0x0003,0x2860, - - 0x3405,0xFF05,0x0003,0x2860,0xFF05,0x0007,0x2C58,0xFF05, - 0x0003,0x2860,0xFF04,0x0002,0x3405,0xFF04,0x0000,0xFF05, - 0x0003,0x2860,0xFF06,0x0002,0xFF06,0x0002,0xFF05,0x0003, - 0x286C,0x3406,0xFF05,0x0003,0x286C,0xFF05,0x0007,0x2C64, - 0xFF05,0x0003,0x286C,0xFF04,0x0002,0x3406,0xFF04,0x0000, - 0xFF05,0x0003,0x286C,0xFF06,0x0002,0xFF06,0x0002,0xFF05, - 0x0003,0x2878,0x3407,0xFF05,0x0003,0x2878,0xFF05,0x0007, - 0x2C70,0xFF05,0x0003,0x2878,0xFF04,0x0002,0x3407,0xFF04, - 0x0000,0xFF05,0x0003,0x2878,0xFF06,0x0002,0xFF06,0x009F, - 0xFF08,0xFF02,0x0003,0xFF03,0x0200,0xFF01,0x0200,0xFF06, - 0x01BF,0xFF06,0x00BF,0xFF06,0x0005,0xFF05,0x0004,0x3480, - 0xFF05,0x0004,0x3480,0xFF05,0x0004,0x3480,0xFF05,0x0004, - 0x3480,0xFF06,0x0005,0xFF06,0x0005,0xFF05,0x0013,0x3085, - 0xFF06,0x0005,0xFF06,0x0005,0xFF05,0x0013,0x3099,0xFF06, - 0x0005,0xFF06,0x0005,0xFF05,0x0013,0x30AD,0xFF06,0x0005, - 0xFF06,0x0005,0xFF05,0x0013,0x30C1,0xFF06,0x0005,0xFF06, - - 0x0005,0xFF05,0x0013,0x30D5,0xFF06,0x0005,0xFF05,0x000F, - 0x44E9,0xFF04,0x0002,0xFF09,0x000F,0x44F8,0xFF04,0x0000, - 0xFF05,0x000F,0x4101,0xFF04,0x0002,0xFF09,0x000F,0x4110, - 0xFF04,0x0000,0xFF05,0x000F,0x3D11,0xFF04,0x0002,0xFF09, - 0x000F,0x3D20,0xFF04,0x0000,0xFF05,0x000F,0x3921,0xFF04, - 0x0002,0xFF09,0x000F,0x3930,0xFF04,0x0000,0xFF05,0x000F, - 0x3931,0xFF04,0x0002,0xFF09,0x000F,0x3940,0xFF04,0x0000, - 0xFF05,0x000F,0x3941,0xFF04,0x0002,0xFF09,0x000F,0x3950, - 0xFF04,0x0000,0xFF00,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF -}; - -// --- fighter data: pointers to ROM --- -static UINT16 bloodwar_mcu_4_25[] = { // Warrior 1 - 0x0007,0x2B72,0x0007,0x2B9E,0x0007,0x2C52,0x0007,0x2D36, - 0x0007,0x3584,0x0007,0x2E3A,0x0007,0x2E54,0x0007,0x2E74, - 0x0007,0x2F28,0x0007,0x3022,0x0007,0x35A0,0x0007,0x377C, - 0x0007,0x378E,0x0007,0x37C0,0x0007,0x37F2,0x0007,0x385C, - 0x0007,0x386E,0x0007,0x38A0,0x0007,0x38D2,0x0007,0x3824, - 0x0007,0x3832,0x0007,0x3840,0x0007,0x384E,0x0007,0x3904, - 0x0007,0x3912,0x0007,0x3920,0x0007,0x392E,0x0007,0x30F6, - 0x0007,0x3110,0x0007,0x3142,0x0007,0x31BA,0x0007,0x3232, - 0x0007,0x32AC,0x0007,0x32DE,0x0007,0x3356,0x0007,0x33CE, - 0x0007,0x35BC,0x0007,0x35CE,0x0007,0x3600,0x0007,0x3632, - 0x0007,0x369C,0x0007,0x36AE,0x0007,0x36E0,0x0007,0x3712, - 0x0007,0x3664,0x0007,0x3672,0x0007,0x3680,0x0007,0x368E, - 0x0007,0x3744,0x0007,0x3752,0x0007,0x3760,0x0007,0x376E, - 0x0007,0x3446,0x0007,0x34A4,0x0007,0x3514,0x0007,0x345A, - 0x0007,0x34B8,0x0007,0x3528,0x0007,0x3490,0x0007,0x3500, - 0x0007,0x3570,0x0007,0x3A18,0x0007,0x3A48,0x0007,0x3A9C, - - 0x0007,0x3AF0,0x0007,0x3B44,0x0007,0x3BB0,0x0007,0x3C64, - 0x0007,0x3D18,0x0007,0x3DCC,0x0007,0x3E20,0x0007,0x3E98, - 0x0007,0x3F10,0x0007,0x3F88,0x0007,0x3FD6,0x0007,0x4072, - 0x0007,0x410E,0x0007,0x5180,0x0007,0x51BC,0x0007,0x521C, - 0x0007,0x527C,0x0007,0x52DC,0x0007,0x5330,0x0007,0x53D2, - 0x0007,0x5474,0x0007,0x5516,0x0007,0x5570,0x0007,0x55EE, - 0x0007,0x566C,0x0007,0x56EA,0x0007,0x5768,0x0007,0x580A, - 0x0007,0x58AC,0x0007,0x41AA,0x0007,0x41DA,0x0007,0x422E, - 0x0007,0x4282,0x0007,0x42D6,0x0007,0x4336,0x0007,0x43EE, - 0x0007,0x44A6,0x0007,0x455E,0x0007,0x45BE,0x0007,0x4642, - 0x0007,0x46C6,0x0007,0x474A,0x0007,0x47A4,0x0007,0x4866, - 0x0007,0x4928,0x0007,0x594E,0x0007,0x597E,0x0007,0x59D2, - 0x0007,0x5A26,0x0007,0x5A7A,0x0007,0x5ADA,0x0007,0x5B6E, - 0x0007,0x5C02,0x0007,0x5C96,0x0007,0x5CF0,0x0007,0x5D78, - 0x0007,0x5E00,0x0007,0x5E88,0x0007,0x5EE0,0x0007,0x5F50, - 0x0007,0x5FC0,0x0007,0x49EA,0x0007,0x4A1E,0x0007,0x4AB6, - - 0x0007,0x4B4E,0x0007,0x4BE6,0x0007,0x4C32,0x0007,0x4CA2, - 0x0007,0x4D12,0x0007,0x6030,0x0007,0x6070,0x0007,0x611E, - 0x0007,0x61CC,0x0007,0x627A,0x0007,0x62BA,0x0007,0x631E, - 0x0007,0x6382,0x0007,0x4D82,0x0007,0x4DDA,0x0007,0x4E96, - 0x0007,0x4F52,0x0007,0x500E,0x0007,0x5048,0x0007,0x50B0, - 0x0007,0x5118,0x0007,0x63E6,0x0007,0x6426,0x0007,0x64CA, - 0x0007,0x656E,0x0007,0x6612,0x0007,0x6652,0x0007,0x66B6, - 0x0007,0x671A,0x0007,0x393C,0x0007,0x3992,0x0007,0x39EE, - 0x0007,0x6FA2,0x0007,0x6FAE,0x0007,0x6FCC,0x0007,0x6FF6, - 0x0007,0x7002,0x0007,0x7020,0x0007,0x704A,0x0007,0x7056, - 0x0007,0x7074,0x0007,0x7118,0x0007,0x712E,0x0007,0x709E, - 0x0007,0x70A6,0x0007,0x713A,0x0007,0x73C6,0x0007,0x7262, - 0x0007,0x72D6,0x0007,0x733C,0x0007,0x7384,0x0007,0x7476, - 0x0007,0x7548,0x0007,0x7906,0x0007,0x7712,0x0007,0x7AD0, - 0x0007,0x7852,0x0007,0x7C32,0x0007,0x7D0A,0x0007,0x7DFC, - 0x0007,0x7EEE,0x0007,0x7FE0,0x0007,0x8158,0x0007,0x824A, - - 0x0007,0x833C,0x0007,0x842E,0x0007,0x8F92,0x0007,0x8FB2, - 0x0007,0x8FEE,0x0007,0x902A,0x0007,0x9038,0x0007,0x9066, - 0x0007,0x90C6,0x0007,0x9102,0x0007,0x9108,0x0007,0x9136, - 0x0007,0x9172,0x0007,0x9180,0x0007,0x919E,0x0007,0x91AC, - 0x0007,0x91CA,0x0007,0x9206,0x0007,0x9262,0x0007,0x929C, - 0x0007,0x92AA,0x0007,0x92D0,0x0007,0x930C,0x0007,0x9322, - 0x0007,0x9340,0x0007,0x937C,0x0007,0x93CE,0x0007,0x93E4, - 0x0007,0x9402,0x0007,0x945C,0x0007,0x9462,0x0007,0x9480, - 0x0007,0x94CC,0x0007,0x94EA,0x0007,0x9510,0x0007,0x954C, - 0x0007,0x9552,0x0007,0x677E,0x0007,0x677E,0x0007,0x677E, - 0x0007,0x677E,0x0007,0x67CC,0x0007,0x67CC,0x0007,0x67CC, - 0x0007,0x67CC,0x0007,0x6820,0x0007,0x68A6,0x0007,0x697E, - 0x0007,0x6AA6,0x0007,0x6C1E,0x0007,0x6CBE,0x0007,0x6DAE, - 0x0007,0x6E9E,0x0007,0x6C66,0x0007,0x6D24,0x0007,0x6E14, - 0x0007,0x6F04,0x0007,0x6F8E,0x0007,0x85A6,0x0007,0x85BA, - 0x0007,0x85CE,0x0007,0x862A,0x0007,0x8644,0x0007,0x8658, - - 0x0007,0x862A,0x0007,0x8644,0x0007,0x869C,0x0007,0x86A6, - 0x0007,0xCC3C,0x0007,0xCC68,0x0007,0xCD1C,0x0007,0xCD9A -}; -static UINT16 bloodwar_mcu_4_26[] = { // Warrior 2 - 0x000B,0xB188,0x000B,0xB1C0,0x000B,0xB308,0x000B,0xB590, - 0x000B,0xCF38,0x000B,0xBA00,0x000B,0xBA1A,0x000B,0xBA3A, - 0x000B,0xBE62,0x000B,0xC4AA,0x000B,0xCF54,0x000B,0xD130, - 0x000B,0xD142,0x000B,0xD174,0x000B,0xD1A6,0x000B,0xD210, - 0x000B,0xD222,0x000B,0xD254,0x000B,0xD286,0x000B,0xD1D8, - 0x000B,0xD1E6,0x000B,0xD1F4,0x000B,0xD202,0x000B,0xD2B8, - 0x000B,0xD2C6,0x000B,0xD2D4,0x000B,0xD2E2,0x000B,0xC662, - 0x000B,0xC67C,0x000B,0xC6B4,0x000B,0xC7BC,0x000B,0xC8C4, - 0x000B,0xC9B8,0x000B,0xC9E4,0x000B,0xCB58,0x000B,0xCCCC, - 0x000B,0xCF70,0x000B,0xCF82,0x000B,0xCFB4,0x000B,0xCFE6, - 0x000B,0xD050,0x000B,0xD062,0x000B,0xD094,0x000B,0xD0C6, - 0x000B,0xD018,0x000B,0xD026,0x000B,0xD034,0x000B,0xD042, - 0x000B,0xD0F8,0x000B,0xD106,0x000B,0xD114,0x000B,0xD122, - 0x000B,0xCE18,0x000B,0xCE58,0x000B,0xCECE,0x000B,0xCE2C, - 0x000B,0xCE6C,0x000B,0xCEE2,0x000B,0xCE44,0x000B,0xCEC0, - 0x000B,0xCF2A,0x000B,0xD52A,0x000B,0xD566,0x000B,0xD5C6, - - 0x000B,0xD626,0x000B,0xD686,0x000B,0xD6D4,0x000B,0xD780, - 0x000B,0xD82C,0x000B,0xD8D8,0x000B,0xD920,0x000B,0xD99C, - 0x000B,0xDA18,0x000B,0xDA94,0x000B,0xDAEE,0x000B,0xDB86, - 0x000B,0xDC1E,0x000B,0xED72,0x000B,0xED9C,0x000B,0xEDFA, - 0x000B,0xEE58,0x000B,0xEEB6,0x000B,0xEEF8,0x000B,0xEFB8, - 0x000B,0xF078,0x000B,0xF138,0x000B,0xF186,0x000B,0xF208, - 0x000B,0xF28A,0x000B,0xF30C,0x000B,0xF366,0x000B,0xF3FE, - 0x000B,0xF496,0x000B,0xDCB6,0x000B,0xDCEC,0x000B,0xDD56, - 0x000B,0xDDC0,0x000B,0xDE2A,0x000B,0xDE6C,0x000B,0xDF2C, - 0x000B,0xDFEC,0x000B,0xE0AC,0x000B,0xE10C,0x000B,0xE1A0, - 0x000B,0xE234,0x000B,0xE2C8,0x000B,0xE332,0x000B,0xE3B4, - 0x000B,0xE436,0x000B,0xF52E,0x000B,0xF55E,0x000B,0xF5C2, - 0x000B,0xF626,0x000B,0xF68A,0x000B,0xF6CC,0x000B,0xF77C, - 0x000B,0xF82C,0x000B,0xF8DC,0x000B,0xF93A,0x000B,0xF9B0, - 0x000B,0xFA26,0x000B,0xFA9C,0x000B,0xFAF6,0x000B,0xFB8E, - 0x000B,0xFC26,0x000B,0xE4B8,0x000B,0xE4F8,0x000B,0xE59C, - - 0x000B,0xE640,0x000B,0xE6E4,0x000B,0xE72A,0x000B,0xE794, - 0x000B,0xE7FE,0x000B,0xFCBE,0x000B,0xFCF2,0x000B,0xFD8A, - 0x000B,0xFE22,0x000B,0xFEBA,0x000B,0xFEEE,0x000B,0xFF46, - 0x000B,0xFF9E,0x000B,0xE868,0x000B,0xE8EE,0x000B,0xE9CE, - 0x000B,0xEAAE,0x000B,0xEB8E,0x000B,0xEBEC,0x000B,0xEC6E, - 0x000B,0xECF0,0x000B,0xFFF6,0x000C,0x008E,0x000C,0x0178, - 0x000C,0x0262,0x000C,0x034C,0x000C,0x038C,0x000C,0x03F0, - 0x000C,0x0454,0x000B,0xD2F0,0x000B,0xD450,0x000B,0xD4E2, - 0x000C,0x0946,0x000C,0x0952,0x000C,0x0970,0x000C,0x099A, - 0x000C,0x09A6,0x000C,0x09C4,0x000C,0x09EE,0x000C,0x09FA, - 0x000C,0x0A18,0x000C,0x0ABC,0x000C,0x0AD2,0x000C,0x0A42, - 0x000C,0x0A4A,0x000C,0x0ADE,0x000C,0x0D6A,0x000C,0x0C06, - 0x000C,0x0C7A,0x000C,0x0CE0,0x000C,0x0D28,0x000C,0x0E1A, - 0x000C,0x0EEC,0x000C,0x12AA,0x000C,0x10B6,0x000C,0x1474, - 0x000C,0x11F6,0x000C,0x15D6,0x000C,0x16AE,0x000C,0x17A0, - 0x000C,0x1892,0x000C,0x1984,0x000C,0x1AFC,0x000C,0x1BEE, - - 0x000C,0x1CE0,0x000C,0x1DD2,0x000C,0x246A,0x000C,0x248A, - 0x000C,0x24C6,0x000C,0x2502,0x000C,0x2510,0x000C,0x253E, - 0x000C,0x259E,0x000C,0x25DA,0x000C,0x25E0,0x000C,0x260E, - 0x000C,0x264A,0x000C,0x2658,0x000C,0x2676,0x000C,0x2684, - 0x000C,0x26A2,0x000C,0x26DE,0x000C,0x273A,0x000C,0x2774, - 0x000C,0x2782,0x000C,0x27A8,0x000C,0x27E4,0x000C,0x27FA, - 0x000C,0x2818,0x000C,0x2854,0x000C,0x28A6,0x000C,0x28BC, - 0x000C,0x28DA,0x000C,0x2934,0x000C,0x293A,0x000C,0x2958, - 0x000C,0x29A4,0x000C,0x29C2,0x000C,0x29E8,0x000C,0x2A24, - 0x000C,0x2A2A,0x000C,0x04B8,0x000C,0x0506,0x000C,0x050E, - 0x000C,0x0516,0x000C,0x051E,0x000C,0x0620,0x000C,0x0634, - 0x000C,0x0736,0x000C,0x074A,0x000C,0x0834,0x000C,0x0848, - 0x000C,0x0932,0x000C,0x1F4A,0x000C,0x1F5E,0x000C,0x1F78, - 0x000C,0x1F4A,0x000C,0x1F5E,0x000C,0x1FC2,0x000C,0x1FCC, - 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF -}; -static UINT16 bloodwar_mcu_4_27[] = { // Warrior 3 - 0x0008,0x631C,0x0008,0x6348,0x0008,0x63EC,0x0008,0x6494, - 0x0008,0x6C5C,0x0008,0x6598,0x0008,0x65B2,0x0008,0x65D2, - 0x0008,0x6676,0x0008,0x674A,0x0008,0x6C78,0x0008,0x6E54, - 0x0008,0x6E66,0x0008,0x6E98,0x0008,0x6ECA,0x0008,0x6F34, - 0x0008,0x6F46,0x0008,0x6F78,0x0008,0x6FAA,0x0008,0x6EFC, - 0x0008,0x6F0A,0x0008,0x6F18,0x0008,0x6F26,0x0008,0x6FDC, - 0x0008,0x6FEA,0x0008,0x6FF8,0x0008,0x7006,0x0008,0x681E, - 0x0008,0x6838,0x0008,0x6864,0x0008,0x68CC,0x0008,0x6934, - 0x0008,0x699C,0x0008,0x69C8,0x0008,0x6A30,0x0008,0x6A98, - 0x0008,0x6C94,0x0008,0x6CA6,0x0008,0x6CD8,0x0008,0x6D0A, - 0x0008,0x6D74,0x0008,0x6D86,0x0008,0x6DB8,0x0008,0x6DEA, - 0x0008,0x6D3C,0x0008,0x6D4A,0x0008,0x6D58,0x0008,0x6D66, - 0x0008,0x6E1C,0x0008,0x6E2A,0x0008,0x6E38,0x0008,0x6E46, - 0x0008,0x6B00,0x0008,0x6B64,0x0008,0x6BE0,0x0008,0x6B1A, - 0x0008,0x6B7E,0x0008,0x6C00,0x0008,0x6B4A,0x0008,0x6BC0, - 0x0008,0x6C42,0x0008,0x7100,0x0008,0x7130,0x0008,0x7184, - - 0x0008,0x71D8,0x0008,0x722C,0x0008,0x7280,0x0008,0x7322, - 0x0008,0x73C4,0x0008,0x7466,0x0008,0x74AE,0x0008,0x751A, - 0x0008,0x7586,0x0008,0x75F2,0x0008,0x7658,0x0008,0x76E2, - 0x0008,0x776C,0x0008,0x857A,0x0008,0x85AA,0x0008,0x85FE, - 0x0008,0x8652,0x0008,0x86A6,0x0008,0x870C,0x0008,0x8790, - 0x0008,0x8814,0x0008,0x8898,0x0008,0x88EC,0x0008,0x8964, - 0x0008,0x89DC,0x0008,0x8A54,0x0008,0x8ABA,0x0008,0x8B68, - 0x0008,0x8C16,0x0008,0x77F6,0x0008,0x782C,0x0008,0x7886, - 0x0008,0x78E0,0x0008,0x793A,0x0008,0x7982,0x0008,0x7A28, - 0x0008,0x7ACE,0x0008,0x7B74,0x0008,0x7BA4,0x0008,0x7BF8, - 0x0008,0x7C4C,0x0008,0x7CA0,0x0008,0x7CFA,0x0008,0x7D92, - 0x0008,0x7E2A,0x0008,0x8CC4,0x0008,0x8CF4,0x0008,0x8D48, - 0x0008,0x8D9C,0x0008,0x8DF0,0x0008,0x8E3E,0x0008,0x8EEA, - 0x0008,0x8F96,0x0008,0x9042,0x0008,0x907E,0x0008,0x90DE, - 0x0008,0x913E,0x0008,0x919E,0x0008,0x91FE,0x0008,0x929C, - 0x0008,0x933A,0x0008,0x7EC2,0x0008,0x7EF6,0x0008,0x7F8E, - - 0x0008,0x8026,0x0008,0x80BE,0x0008,0x80FE,0x0008,0x8152, - 0x0008,0x81A6,0x0008,0x93D8,0x0008,0x9412,0x0008,0x94B0, - 0x0008,0x954E,0x0008,0x95EC,0x0008,0x9644,0x0008,0x96C0, - 0x0008,0x973C,0x0008,0x81FA,0x0008,0x823A,0x0008,0x82DE, - 0x0008,0x8382,0x0008,0x8426,0x0008,0x8460,0x0008,0x84BE, - 0x0008,0x851C,0x0008,0x97B8,0x0008,0x97F2,0x0008,0x9890, - 0x0008,0x992E,0x0008,0x99CC,0x0008,0x9A12,0x0008,0x9A7C, - 0x0008,0x9AE6,0x0008,0x7014,0x0008,0x706A,0x0008,0x70C4, - 0x0008,0xA16E,0x0008,0xA17A,0x0008,0xA198,0x0008,0xA1C2, - 0x0008,0xA1CE,0x0008,0xA1EC,0x0008,0xA216,0x0008,0xA222, - 0x0008,0xA240,0x0008,0xA2E4,0x0008,0xA2FA,0x0008,0xA26A, - 0x0008,0xA272,0x0008,0xA306,0x0008,0xA592,0x0008,0xA42E, - 0x0008,0xA4A2,0x0008,0xA508,0x0008,0xA550,0x0008,0xA642, - 0x0008,0xA714,0x0008,0xAAD2,0x0008,0xA8DE,0x0008,0xAC9C, - 0x0008,0xAA1E,0x0008,0xADFE,0x0008,0xAED6,0x0008,0xAFC8, - 0x0008,0xB0BA,0x0008,0xB1AC,0x0008,0xB324,0x0008,0xB416, - - 0x0008,0xB508,0x0008,0xB5FA,0x0008,0xBC1C,0x0008,0xBC3C, - 0x0008,0xBC78,0x0008,0xBCB4,0x0008,0xBCC2,0x0008,0xBCF0, - 0x0008,0xBD50,0x0008,0xBD8C,0x0008,0xBD92,0x0008,0xBDC0, - 0x0008,0xBDFC,0x0008,0xBE0A,0x0008,0xBE28,0x0008,0xBE36, - 0x0008,0xBE54,0x0008,0xBE90,0x0008,0xBEEC,0x0008,0xBF26, - 0x0008,0xBF34,0x0008,0xBF5A,0x0008,0xBF96,0x0008,0xBFAC, - 0x0008,0xBFCA,0x0008,0xC006,0x0008,0xC058,0x0008,0xC06E, - 0x0008,0xC08C,0x0008,0xC0E6,0x0008,0xC0EC,0x0008,0xC10A, - 0x0008,0xC156,0x0008,0xC174,0x0008,0xC19A,0x0008,0xC1D6, - 0x0008,0xC1DC,0x0008,0x9B50,0x0008,0x9BF8,0x0008,0x9CDC, - 0x0008,0x9DC0,0x0008,0x9B52,0x0008,0x9BFA,0x0008,0x9CDE, - 0x0008,0x9DC2,0x0008,0x9EA4,0x0008,0x9EB2,0x0008,0x9F38, - 0x0008,0x9F4C,0x0008,0x9FD2,0x0008,0x9FE6,0x0008,0xA06C, - 0x0008,0xA080,0x0008,0xA106,0x0008,0xA11A,0x0008,0xA11A, - 0x0008,0xA11A,0x0008,0xA11A,0x0008,0xB772,0x0008,0xB786, - 0x0008,0xB7AC,0x0008,0xB7EA,0x0008,0xB7FE,0x0008,0xB818, - - 0x0008,0xB772,0x0008,0xB786,0x0008,0xB87E,0x0008,0xB772, - 0x0008,0xB786,0x0008,0xB8F0,0x0008,0xB912,0x0008,0xB93A, - 0x0008,0xF128,0x0008,0xF148,0x0008,0xF1EC,0x0008,0xF2AA -}; -static UINT16 bloodwar_mcu_4_28[] = { // Warrior 4 - 0x0008,0xF128,0x0008,0xF148,0x0008,0xF1EC,0x0008,0xF2AA, - 0x0008,0xFA80,0x0008,0xF3AA,0x0008,0xF3C4,0x0008,0xF3E4, - 0x0008,0xF4A8,0x0008,0xF56C,0x0008,0xFA9C,0x0008,0xFC78, - 0x0008,0xFC8A,0x0008,0xFCBC,0x0008,0xFCEE,0x0008,0xFD58, - 0x0008,0xFD6A,0x0008,0xFD9C,0x0008,0xFDCE,0x0008,0xFD20, - 0x0008,0xFD2E,0x0008,0xFD3C,0x0008,0xFD4A,0x0008,0xFE00, - 0x0008,0xFE0E,0x0008,0xFE1C,0x0008,0xFE2A,0x0008,0xF630, - 0x0008,0xF64A,0x0008,0xF67C,0x0008,0xF6F4,0x0008,0xF76C, - 0x0008,0xF7E4,0x0008,0xF816,0x0008,0xF88E,0x0008,0xF906, - 0x0008,0xFAB8,0x0008,0xFACA,0x0008,0xFAFC,0x0008,0xFB2E, - 0x0008,0xFB98,0x0008,0xFBAA,0x0008,0xFBDC,0x0008,0xFC0E, - 0x0008,0xFB60,0x0008,0xFB6E,0x0008,0xFB7C,0x0008,0xFB8A, - 0x0008,0xFC40,0x0008,0xFC4E,0x0008,0xFC5C,0x0008,0xFC6A, - 0x0008,0xF97E,0x0008,0xF9D0,0x0008,0xFA28,0x0008,0xF992, - 0x0008,0xF9E4,0x0008,0xFA3C,0x0008,0xF9BC,0x0008,0xFA14, - 0x0008,0xFA6C,0x0008,0xFF1A,0x0008,0xFF4A,0x0008,0xFF9E, - - 0x0008,0xFFF2,0x0009,0x0046,0x0009,0x00A0,0x0009,0x012E, - 0x0009,0x01BC,0x0009,0x024A,0x0009,0x02A4,0x0009,0x0322, - 0x0009,0x03A0,0x0009,0x041E,0x0009,0x046C,0x0009,0x04F8, - 0x0009,0x0584,0x0009,0x16C4,0x0009,0x1700,0x0009,0x1760, - 0x0009,0x17C0,0x0009,0x1820,0x0009,0x1868,0x0009,0x190E, - 0x0009,0x19B4,0x0009,0x1A5A,0x0009,0x1AAE,0x0009,0x1B36, - 0x0009,0x1BBE,0x0009,0x1C46,0x0009,0x1C9A,0x0009,0x1D46, - 0x0009,0x1DF2,0x0009,0x0610,0x0009,0x064C,0x0009,0x06BC, - 0x0009,0x072C,0x0009,0x079C,0x0009,0x07F0,0x0009,0x08BC, - 0x0009,0x0988,0x0009,0x0A54,0x0009,0x0A9C,0x0009,0x0B18, - 0x0009,0x0B94,0x0009,0x0C10,0x0009,0x0C76,0x0009,0x0D10, - 0x0009,0x0DAA,0x0009,0x1E9E,0x0009,0x1ECE,0x0009,0x1F22, - 0x0009,0x1F76,0x0009,0x1FCA,0x0009,0x2024,0x0009,0x20BC, - 0x0009,0x2154,0x0009,0x21EC,0x0009,0x2240,0x0009,0x22C8, - 0x0009,0x2350,0x0009,0x23D8,0x0009,0x243E,0x0009,0x24D8, - 0x0009,0x2572,0x0009,0x0E44,0x0009,0x0E90,0x0009,0x0F40, - - 0x0009,0x0FF0,0x0009,0x10A0,0x0009,0x1104,0x0009,0x117C, - 0x0009,0x11F4,0x0009,0x260C,0x0009,0x2664,0x0009,0x2700, - 0x0009,0x279C,0x0009,0x2838,0x0009,0x2878,0x0009,0x28DC, - 0x0009,0x2940,0x0009,0x126C,0x0009,0x12D0,0x0009,0x1398, - 0x0009,0x1460,0x0009,0x1528,0x0009,0x1574,0x0009,0x15E4, - 0x0009,0x1654,0x0009,0x29A4,0x0009,0x29EA,0x0009,0x2A84, - 0x0009,0x2B1E,0x0009,0x2BB8,0x0009,0x2BFE,0x0009,0x2C58, - 0x0009,0x2CB2,0x0008,0xFE38,0x0008,0xFEA6,0x0008,0xFEF6, - 0x0009,0x3406,0x0009,0x3412,0x0009,0x3430,0x0009,0x345A, - 0x0009,0x3466,0x0009,0x3484,0x0009,0x34AE,0x0009,0x34BA, - 0x0009,0x34D8,0x0009,0x357C,0x0009,0x3592,0x0009,0x3502, - 0x0009,0x350A,0x0009,0x359E,0x0009,0x379A,0x0009,0x3636, - 0x0009,0x36AA,0x0009,0x3710,0x0009,0x3758,0x0009,0x384A, - 0x0009,0x391C,0x0009,0x3CDA,0x0009,0x3AE6,0x0009,0x3EA4, - 0x0009,0x3C26,0x0009,0x4006,0x0009,0x40DE,0x0009,0x41D0, - 0x0009,0x42C2,0x0009,0x43B4,0x0009,0x452C,0x0009,0x461E, - - 0x0009,0x4710,0x0009,0x4802,0x0009,0x4ED8,0x0009,0x4EF8, - 0x0009,0x4F34,0x0009,0x4F70,0x0009,0x4F7E,0x0009,0x4FAC, - 0x0009,0x500C,0x0009,0x5048,0x0009,0x504E,0x0009,0x507C, - 0x0009,0x50B8,0x0009,0x50C6,0x0009,0x50E4,0x0009,0x50F2, - 0x0009,0x5110,0x0009,0x514C,0x0009,0x51A8,0x0009,0x51E2, - 0x0009,0x51F0,0x0009,0x5216,0x0009,0x5252,0x0009,0x5268, - 0x0009,0x5286,0x0009,0x52C2,0x0009,0x5314,0x0009,0x532A, - 0x0009,0x5348,0x0009,0x53A2,0x0009,0x53A8,0x0009,0x53C6, - 0x0009,0x5412,0x0009,0x5430,0x0009,0x5456,0x0009,0x5492, - 0x0009,0x5498,0x0009,0x2D0C,0x0009,0x2DC8,0x0009,0x2E84, - 0x0009,0x2F40,0x0009,0x2D0E,0x0009,0x2DCA,0x0009,0x2E86, - 0x0009,0x2F42,0x0009,0x2FFC,0x0009,0x300A,0x0009,0x300A, - 0x0009,0x300A,0x0009,0x300A,0x0009,0x305E,0x0009,0x3148, - 0x0009,0x3232,0x0009,0x331C,0x0009,0x497A,0x0009,0x498E, - 0x0009,0x49A2,0x0009,0x497A,0x0009,0x498E,0x0009,0x49E6, - 0x0009,0x49F6,0x0009,0x497A,0x0009,0x498E,0x0009,0x4A18, - - 0x0009,0x4A2A,0x0009,0x81A8,0x0009,0x81C8,0x0009,0x8270 -}; -static UINT16 bloodwar_mcu_4_29[] = { // Warrior 5 - 0x0007,0xCC3C,0x0007,0xCC68,0x0007,0xCD1C,0x0007,0xCD9A, - 0x0007,0xD616,0x0007,0xCE38,0x0007,0xCE52,0x0007,0xCE72, - 0x0007,0xCF16,0x0007,0xCFAA,0x0007,0xD632,0x0007,0xD80E, - 0x0007,0xD820,0x0007,0xD852,0x0007,0xD884,0x0007,0xD8EE, - 0x0007,0xD900,0x0007,0xD932,0x0007,0xD964,0x0007,0xD8B6, - 0x0007,0xD8C4,0x0007,0xD8D2,0x0007,0xD8E0,0x0007,0xD996, - 0x0007,0xD9A4,0x0007,0xD9B2,0x0007,0xD9C0,0x0007,0xD064, - 0x0007,0xD07E,0x0007,0xD0C2,0x0007,0xD16A,0x0007,0xD212, - 0x0007,0xD2BA,0x0007,0xD2FE,0x0007,0xD3A6,0x0007,0xD44E, - 0x0007,0xD64E,0x0007,0xD660,0x0007,0xD692,0x0007,0xD6C4, - 0x0007,0xD72E,0x0007,0xD740,0x0007,0xD772,0x0007,0xD7A4, - 0x0007,0xD6F6,0x0007,0xD704,0x0007,0xD712,0x0007,0xD720, - 0x0007,0xD7D6,0x0007,0xD7E4,0x0007,0xD7F2,0x0007,0xD800, - 0x0007,0xD4F6,0x0007,0xD54E,0x0007,0xD5BE,0x0007,0xD50A, - 0x0007,0xD562,0x0007,0xD5D2,0x0007,0xD53A,0x0007,0xD5B0, - 0x0007,0xD602,0x0007,0xDA8C,0x0007,0xDAC8,0x0007,0xDB2C, - - 0x0007,0xDB90,0x0007,0xDBF4,0x0007,0xDC36,0x0007,0xDCE0, - 0x0007,0xDD8A,0x0007,0xDE34,0x0007,0xDE94,0x0007,0xDF3C, - 0x0007,0xDFE4,0x0007,0xE08C,0x0007,0xE0F2,0x0007,0xE1B4, - 0x0007,0xE276,0x0007,0xF2D6,0x0007,0xF30C,0x0007,0xF366, - 0x0007,0xF3C0,0x0007,0xF41A,0x0007,0xF462,0x0007,0xF538, - 0x0007,0xF60E,0x0007,0xF6E4,0x0007,0xF77A,0x0007,0xF862, - 0x0007,0xF94A,0x0007,0xFA32,0x0007,0xFACE,0x0007,0xFBC6, - 0x0007,0xFCBE,0x0007,0xE338,0x0007,0xE36E,0x0007,0xE3C8, - 0x0007,0xE422,0x0007,0xE47C,0x0007,0xE4B8,0x0007,0xE552, - 0x0007,0xE5EC,0x0007,0xE686,0x0007,0xE6E0,0x0007,0xE772, - 0x0007,0xE804,0x0007,0xE896,0x0007,0xE8E2,0x0007,0xE946, - 0x0007,0xE9AA,0x0007,0xFDB6,0x0007,0xFDE6,0x0007,0xFE3A, - 0x0007,0xFE8E,0x0007,0xFEE2,0x0007,0xFF3C,0x0007,0xFFE4, - 0x0008,0x008C,0x0008,0x0134,0x0008,0x01B2,0x0008,0x0282, - 0x0008,0x0352,0x0008,0x0422,0x0008,0x04A6,0x0008,0x0586, - 0x0008,0x0666,0x0007,0xEA0E,0x0007,0xEA6C,0x0007,0xEB22, - - 0x0007,0xEBD8,0x0007,0xEC8E,0x0007,0xECEC,0x0007,0xED72, - 0x0007,0xEDF8,0x0008,0x0746,0x0008,0x079E,0x0008,0x083E, - 0x0008,0x08DE,0x0008,0x097E,0x0008,0x09D6,0x0008,0x0A56, - 0x0008,0x0AD6,0x0007,0xEE7E,0x0007,0xEED0,0x0007,0xEF7A, - 0x0007,0xF024,0x0007,0xF0CE,0x0007,0xF132,0x0007,0xF1BE, - 0x0007,0xF24A,0x0008,0x0B56,0x0008,0x0BB4,0x0008,0x0C5A, - 0x0008,0x0D00,0x0008,0x0DA6,0x0008,0x0E04,0x0008,0x0E8A, - 0x0008,0x0F10,0x0007,0xD9CE,0x0007,0xDA1C,0x0007,0xDA58, - 0x0008,0x1EDC,0x0008,0x1EE8,0x0008,0x1F06,0x0008,0x1F30, - 0x0008,0x1F3C,0x0008,0x1F5A,0x0008,0x1F84,0x0008,0x1F90, - 0x0008,0x1FAE,0x0008,0x204C,0x0008,0x2062,0x0008,0x1FD8, - 0x0008,0x1FE0,0x0008,0x206E,0x0008,0x226A,0x0008,0x2106, - 0x0008,0x217A,0x0008,0x21E0,0x0008,0x2228,0x0008,0x231A, - 0x0008,0x23E6,0x0008,0x27A4,0x0008,0x25B0,0x0008,0x296E, - 0x0008,0x26F0,0x0008,0x2AD0,0x0008,0x2BA8,0x0008,0x2C94, - 0x0008,0x2D80,0x0008,0x2E6C,0x0008,0x2FDE,0x0008,0x30CA, - - 0x0008,0x31B6,0x0008,0x32A2,0x0008,0x3414,0x0008,0x3434, - 0x0008,0x3470,0x0008,0x34AC,0x0008,0x34BA,0x0008,0x34E8, - 0x0008,0x3548,0x0008,0x3584,0x0008,0x358A,0x0008,0x35B8, - 0x0008,0x35F4,0x0008,0x3602,0x0008,0x3620,0x0008,0x362E, - 0x0008,0x364C,0x0008,0x3688,0x0008,0x36E4,0x0008,0x371E, - 0x0008,0x372C,0x0008,0x3752,0x0008,0x378E,0x0008,0x37A4, - 0x0008,0x37C2,0x0008,0x37FE,0x0008,0x3850,0x0008,0x3866, - 0x0008,0x3884,0x0008,0x38DE,0x0008,0x38E4,0x0008,0x3902, - 0x0008,0x394E,0x0008,0x396C,0x0008,0x3992,0x0008,0x39CE, - 0x0008,0x39D4,0x0008,0x0F96,0x0008,0x10A2,0x0008,0x10B6, - 0x0008,0x11C2,0x0008,0x11D6,0x0008,0x12E2,0x0008,0x12F6, - 0x0008,0x1402,0x0008,0x1416,0x0008,0x14E8,0x0008,0x15DE, - 0x0008,0x16DE,0x0008,0x17DE,0x0008,0x1934,0x0008,0x1A8A, - 0x0008,0x1BE0,0x0008,0x1D36,0x0008,0x1D50,0x0008,0x1D70, - 0x0008,0x1DAE,0x0008,0x1DC8,0x0008,0x1DE8,0x0008,0x1E2C, - 0x0008,0x1E46,0x0008,0x1E5A,0x0008,0x1DAE,0x0008,0x1DC8, - - 0x0008,0x1E9A,0x0008,0x1EAC,0x0008,0x631C,0x0008,0x6348 -}; -static UINT16 bloodwar_mcu_4_2a[] = { // Warrior 6 - 0x000A,0x0E3C,0x000A,0x0E5C,0x000A,0x0F00,0x000A,0x0FA8, - 0x000A,0x16E2,0x000A,0x105C,0x000A,0x1076,0x000A,0x1096, - 0x000A,0x113A,0x000A,0x11DE,0x000A,0x16FE,0x000A,0x18DA, - 0x000A,0x18EC,0x000A,0x191E,0x000A,0x1950,0x000A,0x19BA, - 0x000A,0x19CC,0x000A,0x19FE,0x000A,0x1A30,0x000A,0x1982, - 0x000A,0x1990,0x000A,0x199E,0x000A,0x19AC,0x000A,0x1A62, - 0x000A,0x1A70,0x000A,0x1A7E,0x000A,0x1A8C,0x000A,0x1286, - 0x000A,0x12A0,0x000A,0x12D2,0x000A,0x134A,0x000A,0x13C2, - 0x000A,0x143A,0x000A,0x146C,0x000A,0x14E4,0x000A,0x155C, - 0x000A,0x171A,0x000A,0x172C,0x000A,0x175E,0x000A,0x1790, - 0x000A,0x17FA,0x000A,0x180C,0x000A,0x183E,0x000A,0x1870, - 0x000A,0x17C2,0x000A,0x17D0,0x000A,0x17DE,0x000A,0x17EC, - 0x000A,0x18A2,0x000A,0x18B0,0x000A,0x18BE,0x000A,0x18CC, - 0x000A,0x15D4,0x000A,0x1632,0x000A,0x168A,0x000A,0x15E8, - 0x000A,0x1646,0x000A,0x169E,0x000A,0x161E,0x000A,0x1676, - 0x000A,0x16CE,0x000A,0x1B52,0x000A,0x1B82,0x000A,0x1BD6, - - 0x000A,0x1C2A,0x000A,0x1C7E,0x000A,0x1CCC,0x000A,0x1D68, - 0x000A,0x1E04,0x000A,0x1EA0,0x000A,0x1EE8,0x000A,0x1F54, - 0x000A,0x1FC0,0x000A,0x202C,0x000A,0x207A,0x000A,0x2106, - 0x000A,0x2192,0x000A,0x3092,0x000A,0x30C2,0x000A,0x3116, - 0x000A,0x316A,0x000A,0x31BE,0x000A,0x320C,0x000A,0x32B8, - 0x000A,0x3364,0x000A,0x3410,0x000A,0x345E,0x000A,0x34D0, - 0x000A,0x3542,0x000A,0x35B4,0x000A,0x3602,0x000A,0x36AE, - 0x000A,0x375A,0x000A,0x221E,0x000A,0x224E,0x000A,0x22A2, - 0x000A,0x22F6,0x000A,0x234A,0x000A,0x2392,0x000A,0x2438, - 0x000A,0x24DE,0x000A,0x2584,0x000A,0x25C6,0x000A,0x262C, - 0x000A,0x2692,0x000A,0x26F8,0x000A,0x273A,0x000A,0x27DA, - 0x000A,0x287A,0x000A,0x3806,0x000A,0x3836,0x000A,0x388A, - 0x000A,0x38DE,0x000A,0x3932,0x000A,0x3980,0x000A,0x3A2C, - 0x000A,0x3AD8,0x000A,0x3B84,0x000A,0x3BCC,0x000A,0x3C48, - 0x000A,0x3CC4,0x000A,0x3D40,0x000A,0x3D8E,0x000A,0x3E3A, - 0x000A,0x3EE6,0x000A,0x291A,0x000A,0x294E,0x000A,0x29E6, - - 0x000A,0x2A7E,0x000A,0x2B16,0x000A,0x2B56,0x000A,0x2BBA, - 0x000A,0x2C1E,0x000A,0x3F92,0x000A,0x3FC6,0x000A,0x405E, - 0x000A,0x40F6,0x000A,0x418E,0x000A,0x41C2,0x000A,0x421A, - 0x000A,0x4272,0x000A,0x2C82,0x000A,0x2CCE,0x000A,0x2D86, - 0x000A,0x2E3E,0x000A,0x2EF6,0x000A,0x2F42,0x000A,0x2FB2, - 0x000A,0x3022,0x000A,0x42CA,0x000A,0x42FE,0x000A,0x4396, - 0x000A,0x442E,0x000A,0x44C6,0x000A,0x44FA,0x000A,0x4552, - 0x000A,0x45AA,0x000A,0x1A9A,0x000A,0x1AF0,0x000A,0x1B2E, - 0x000A,0x4D2C,0x000A,0x4D38,0x000A,0x4D56,0x000A,0x4D80, - 0x000A,0x4D8C,0x000A,0x4DAA,0x000A,0x4DD4,0x000A,0x4DE0, - 0x000A,0x4DFE,0x000A,0x4EA2,0x000A,0x4EB8,0x000A,0x4E28, - 0x000A,0x4E30,0x000A,0x4EC4,0x000A,0x50C0,0x000A,0x4F5C, - 0x000A,0x4FD0,0x000A,0x5036,0x000A,0x507E,0x000A,0x5170, - 0x000A,0x5242,0x000A,0x5600,0x000A,0x540C,0x000A,0x57CA, - 0x000A,0x554C,0x000A,0x592C,0x000A,0x5A04,0x000A,0x5AF6, - 0x000A,0x5BE8,0x000A,0x5CDA,0x000A,0x5E52,0x000A,0x5F44, - - 0x000A,0x6036,0x000A,0x6128,0x000A,0x6738,0x000A,0x6758, - 0x000A,0x6794,0x000A,0x67D0,0x000A,0x67DE,0x000A,0x680C, - 0x000A,0x686C,0x000A,0x68A8,0x000A,0x68AE,0x000A,0x68DC, - 0x000A,0x6918,0x000A,0x6926,0x000A,0x6944,0x000A,0x6952, - 0x000A,0x6970,0x000A,0x69AC,0x000A,0x6A08,0x000A,0x6A42, - 0x000A,0x6A50,0x000A,0x6A76,0x000A,0x6AB2,0x000A,0x6AC8, - 0x000A,0x6AE6,0x000A,0x6B22,0x000A,0x6B74,0x000A,0x6B8A, - 0x000A,0x6BA8,0x000A,0x6C02,0x000A,0x6C08,0x000A,0x6C26, - 0x000A,0x6C72,0x000A,0x6C90,0x000A,0x6CB6,0x000A,0x6CF2, - 0x000A,0x6CF8,0x000A,0x4602,0x000A,0x4602,0x000A,0x4602, - 0x000A,0x4602,0x000A,0x4644,0x000A,0x46F8,0x000A,0x47AC, - 0x000A,0x4860,0x000A,0x4646,0x000A,0x46FA,0x000A,0x47AE, - 0x000A,0x4862,0x000A,0x4916,0x000A,0x4924,0x000A,0x4A26, - 0x000A,0x4B28,0x000A,0x4C2A,0x000A,0x62A0,0x000A,0x62B4, - 0x000A,0x62DA,0x000A,0x62A0,0x000A,0x62B4,0x000A,0x631E, - 0x000A,0x6338,0x000A,0x94A4,0x000A,0x94C4,0x000A,0x9568 -}; -static UINT16 bloodwar_mcu_4_2b[] = { // Warrior 7 - 0x000A,0x94A4,0x000A,0x94C4,0x000A,0x9568,0x000A,0x9646, - 0x000A,0x9DFC,0x000A,0x9746,0x000A,0x9760,0x000A,0x9780, - 0x000A,0x9824,0x000A,0x98C8,0x000A,0x9E18,0x000A,0x9FF4, - 0x000A,0xA006,0x000A,0xA038,0x000A,0xA06A,0x000A,0xA0D4, - 0x000A,0xA0E6,0x000A,0xA118,0x000A,0xA14A,0x000A,0xA09C, - 0x000A,0xA0AA,0x000A,0xA0B8,0x000A,0xA0C6,0x000A,0xA17C, - 0x000A,0xA18A,0x000A,0xA198,0x000A,0xA1A6,0x000A,0x9970, - 0x000A,0x998A,0x000A,0x99B0,0x000A,0x9A44,0x000A,0x9AD8, - 0x000A,0x9B6C,0x000A,0x9B8C,0x000A,0x9BEA,0x000A,0x9C48, - 0x000A,0x9E34,0x000A,0x9E46,0x000A,0x9E78,0x000A,0x9EAA, - 0x000A,0x9F14,0x000A,0x9F26,0x000A,0x9F58,0x000A,0x9F8A, - 0x000A,0x9EDC,0x000A,0x9EEA,0x000A,0x9EF8,0x000A,0x9F06, - 0x000A,0x9FBC,0x000A,0x9FCA,0x000A,0x9FD8,0x000A,0x9FE6, - 0x000A,0x9CA6,0x000A,0x9D04,0x000A,0x9D86,0x000A,0x9CBA, - 0x000A,0x9D18,0x000A,0x9D9A,0x000A,0x9CF0,0x000A,0x9D72, - 0x000A,0x9DE8,0x000A,0xA260,0x000A,0xA296,0x000A,0xA2F0, - - 0x000A,0xA34A,0x000A,0xA3A4,0x000A,0xA3FE,0x000A,0xA4B0, - 0x000A,0xA562,0x000A,0xA614,0x000A,0xA67A,0x000A,0xA6F8, - 0x000A,0xA776,0x000A,0xA7F4,0x000A,0xA860,0x000A,0xA900, - 0x000A,0xA9A0,0x000A,0xB9F2,0x000A,0xBA22,0x000A,0xBA76, - 0x000A,0xBACA,0x000A,0xBB1E,0x000A,0xBB60,0x000A,0xBC00, - 0x000A,0xBCA0,0x000A,0xBD40,0x000A,0xBD88,0x000A,0xBDF4, - 0x000A,0xBE60,0x000A,0xBECC,0x000A,0xBF20,0x000A,0xBFA8, - 0x000A,0xC030,0x000A,0xAA40,0x000A,0xAA76,0x000A,0xAAD0, - 0x000A,0xAB2A,0x000A,0xAB84,0x000A,0xABEA,0x000A,0xAC88, - 0x000A,0xAD26,0x000A,0xADC4,0x000A,0xAE24,0x000A,0xAEB8, - 0x000A,0xAF4C,0x000A,0xAFE0,0x000A,0xB03A,0x000A,0xB0E2, - 0x000A,0xB18A,0x000A,0xC0B8,0x000A,0xC0E8,0x000A,0xC13C, - 0x000A,0xC190,0x000A,0xC1E4,0x000A,0xC226,0x000A,0xC2C6, - 0x000A,0xC366,0x000A,0xC406,0x000A,0xC44E,0x000A,0xC4BA, - 0x000A,0xC526,0x000A,0xC592,0x000A,0xC5D4,0x000A,0xC694, - 0x000A,0xC754,0x000A,0xB232,0x000A,0xB272,0x000A,0xB316, - - 0x000A,0xB3BA,0x000A,0xB45E,0x000A,0xB49E,0x000A,0xB502, - 0x000A,0xB566,0x000A,0xC814,0x000A,0xC848,0x000A,0xC8E0, - 0x000A,0xC978,0x000A,0xCA10,0x000A,0xCA44,0x000A,0xCA9C, - 0x000A,0xCAF4,0x000A,0xB5CA,0x000A,0xB622,0x000A,0xB6DE, - 0x000A,0xB79A,0x000A,0xB856,0x000A,0xB8A2,0x000A,0xB912, - 0x000A,0xB982,0x000A,0xCB4C,0x000A,0xCB80,0x000A,0xCC0E, - 0x000A,0xCC9C,0x000A,0xCD2A,0x000A,0xCD6A,0x000A,0xCDCE, - 0x000A,0xCE32,0x000A,0xA1B4,0x000A,0xA1F2,0x000A,0xA236, - 0x000A,0xDD1A,0x000A,0xDD26,0x000A,0xDD44,0x000A,0xDD6E, - 0x000A,0xDD7A,0x000A,0xDD98,0x000A,0xDDC2,0x000A,0xDDCE, - 0x000A,0xDDEC,0x000A,0xDE90,0x000A,0xDEA6,0x000A,0xDE16, - 0x000A,0xDE1E,0x000A,0xDEB2,0x000A,0xE13E,0x000A,0xDFDA, - 0x000A,0xE04E,0x000A,0xE0B4,0x000A,0xE0FC,0x000A,0xE1EE, - 0x000A,0xE2C0,0x000A,0xE67E,0x000A,0xE48A,0x000A,0xE848, - 0x000A,0xE5CA,0x000A,0xE9AA,0x000A,0xEA82,0x000A,0xEB74, - 0x000A,0xEC66,0x000A,0xED58,0x000A,0xEED0,0x000A,0xEFC2, - - 0x000A,0xF0B4,0x000A,0xF1A6,0x000A,0xF752,0x000A,0xF772, - 0x000A,0xF7AE,0x000A,0xF7EA,0x000A,0xF7F8,0x000A,0xF826, - 0x000A,0xF886,0x000A,0xF8C2,0x000A,0xF8C8,0x000A,0xF8F6, - 0x000A,0xF932,0x000A,0xF940,0x000A,0xF95E,0x000A,0xF96C, - 0x000A,0xF98A,0x000A,0xF9C6,0x000A,0xFA22,0x000A,0xFA5C, - 0x000A,0xFA6A,0x000A,0xFA90,0x000A,0xFACC,0x000A,0xFAE2, - 0x000A,0xFB00,0x000A,0xFB3C,0x000A,0xFB8E,0x000A,0xFBA4, - 0x000A,0xFBC2,0x000A,0xFC1C,0x000A,0xFC22,0x000A,0xFC40, - 0x000A,0xFC8C,0x000A,0xFCAA,0x000A,0xFCD0,0x000A,0xFD0C, - 0x000A,0xFD12,0x000A,0xCE96,0x000A,0xCFA0,0x000A,0xD0AA, - 0x000A,0xD1B4,0x000A,0xD2BE,0x000A,0xD4FA,0x000A,0xD75A, - 0x000A,0xD9DA,0x000A,0xDC7A,0x000A,0xDC7A,0x000A,0xDC7A, - 0x000A,0xDC7A,0x000A,0xF31E,0x000A,0xF344,0x000A,0xF364, - 0x000A,0xF31E,0x000A,0xF344,0x000A,0xF39C,0x000A,0xF3A6, - 0x000B,0x272C,0x000B,0x274C,0x000B,0x284C,0x000B,0x2924 -}; -static UINT16 bloodwar_mcu_4_2c[] = { // Warrior 8 - 0x000B,0x272C,0x000B,0x274C,0x000B,0x284C,0x000B,0x2924, - 0x000B,0x3242,0x000B,0x2A0E,0x000B,0x2A28,0x000B,0x2A48, - 0x000B,0x2B4C,0x000B,0x2C1A,0x000B,0x325E,0x000B,0x343A, - 0x000B,0x344C,0x000B,0x347E,0x000B,0x34B0,0x000B,0x351A, - 0x000B,0x352C,0x000B,0x355E,0x000B,0x3590,0x000B,0x34E2, - 0x000B,0x34F0,0x000B,0x34FE,0x000B,0x350C,0x000B,0x35C2, - 0x000B,0x35D0,0x000B,0x35DE,0x000B,0x35EC,0x000B,0x2D1A, - 0x000B,0x2D34,0x000B,0x2D66,0x000B,0x2DFE,0x000B,0x2E96, - 0x000B,0x2F2E,0x000B,0x2F66,0x000B,0x2FFE,0x000B,0x3096, - 0x000B,0x327A,0x000B,0x328C,0x000B,0x32BE,0x000B,0x32F0, - 0x000B,0x335A,0x000B,0x336C,0x000B,0x339E,0x000B,0x33D0, - 0x000B,0x3322,0x000B,0x3330,0x000B,0x333E,0x000B,0x334C, - 0x000B,0x3402,0x000B,0x3410,0x000B,0x341E,0x000B,0x342C, - 0x000B,0x312E,0x000B,0x3186,0x000B,0x31E4,0x000B,0x3142, - 0x000B,0x31A0,0x000B,0x31FE,0x000B,0x3172,0x000B,0x31D0, - 0x000B,0x322E,0x000B,0x3702,0x000B,0x373E,0x000B,0x37AE, - - 0x000B,0x381E,0x000B,0x388E,0x000B,0x38D6,0x000B,0x397C, - 0x000B,0x3A22,0x000B,0x3AC8,0x000B,0x3B10,0x000B,0x3B86, - 0x000B,0x3BFC,0x000B,0x3C72,0x000B,0x3CC0,0x000B,0x3D6C, - 0x000B,0x3E18,0x000B,0x4D98,0x000B,0x4DD4,0x000B,0x4E44, - 0x000B,0x4EB4,0x000B,0x4F24,0x000B,0x4F78,0x000B,0x501A, - 0x000B,0x50BC,0x000B,0x515E,0x000B,0x51AC,0x000B,0x5212, - 0x000B,0x5278,0x000B,0x52DE,0x000B,0x5320,0x000B,0x53D0, - 0x000B,0x5480,0x000B,0x3EC4,0x000B,0x3EF4,0x000B,0x3F58, - 0x000B,0x3FBC,0x000B,0x4020,0x000B,0x405C,0x000B,0x4120, - 0x000B,0x41E4,0x000B,0x42A8,0x000B,0x42DE,0x000B,0x4348, - 0x000B,0x43B2,0x000B,0x441C,0x000B,0x4458,0x000B,0x44D8, - 0x000B,0x4558,0x000B,0x5530,0x000B,0x5560,0x000B,0x55C4, - 0x000B,0x5628,0x000B,0x568C,0x000B,0x56C8,0x000B,0x5782, - 0x000B,0x583C,0x000B,0x58F6,0x000B,0x594A,0x000B,0x59BC, - 0x000B,0x5A2E,0x000B,0x5AA0,0x000B,0x5AE8,0x000B,0x5B8E, - 0x000B,0x5C34,0x000B,0x45D8,0x000B,0x4624,0x000B,0x46D4, - - 0x000B,0x4784,0x000B,0x4834,0x000B,0x4880,0x000B,0x48F0, - 0x000B,0x4960,0x000B,0x5CDA,0x000B,0x5D26,0x000B,0x5DD6, - 0x000B,0x5E86,0x000B,0x5F36,0x000B,0x5F82,0x000B,0x5FF2, - 0x000B,0x6062,0x000B,0x49D0,0x000B,0x4A10,0x000B,0x4AB4, - 0x000B,0x4B58,0x000B,0x4BFC,0x000B,0x4C48,0x000B,0x4CB8, - 0x000B,0x4D28,0x000B,0x60D2,0x000B,0x6112,0x000B,0x61B6, - 0x000B,0x625A,0x000B,0x62FE,0x000B,0x634A,0x000B,0x63BA, - 0x000B,0x642A,0x000B,0x35FA,0x000B,0x3666,0x000B,0x36D8, - 0x000B,0x6B1A,0x000B,0x6B26,0x000B,0x6B44,0x000B,0x6B6E, - 0x000B,0x6B7A,0x000B,0x6B98,0x000B,0x6BC2,0x000B,0x6BCE, - 0x000B,0x6BEC,0x000B,0x6C90,0x000B,0x6CA6,0x000B,0x6C16, - 0x000B,0x6C1E,0x000B,0x6CB2,0x000B,0x6EAE,0x000B,0x6D4A, - 0x000B,0x6DBE,0x000B,0x6E24,0x000B,0x6E6C,0x000B,0x6F5E, - 0x000B,0x7030,0x000B,0x73EE,0x000B,0x71FA,0x000B,0x75B8, - 0x000B,0x733A,0x000B,0x771A,0x000B,0x77F2,0x000B,0x78E4, - 0x000B,0x79D6,0x000B,0x7AC8,0x000B,0x7C40,0x000B,0x7D32, - - 0x000B,0x7E24,0x000B,0x7F16,0x000B,0x84AE,0x000B,0x84CE, - 0x000B,0x850A,0x000B,0x8546,0x000B,0x8554,0x000B,0x8582, - 0x000B,0x85E2,0x000B,0x861E,0x000B,0x8624,0x000B,0x8652, - 0x000B,0x868E,0x000B,0x869C,0x000B,0x86BA,0x000B,0x86C8, - 0x000B,0x86E6,0x000B,0x8722,0x000B,0x877E,0x000B,0x87B8, - 0x000B,0x87C6,0x000B,0x87EC,0x000B,0x8828,0x000B,0x883E, - 0x000B,0x885C,0x000B,0x8898,0x000B,0x88EA,0x000B,0x8900, - 0x000B,0x891E,0x000B,0x8978,0x000B,0x897E,0x000B,0x899C, - 0x000B,0x89E8,0x000B,0x8A06,0x000B,0x8A2C,0x000B,0x8A68, - 0x000B,0x8A6E,0x000B,0x649A,0x000B,0x649A,0x000B,0x649A, - 0x000B,0x649A,0x000B,0x64D0,0x000B,0x65B6,0x000B,0x66DC, - 0x000B,0x6802,0x000B,0x6928,0x000B,0x698C,0x000B,0x6A08, - 0x000B,0x6A84,0x000B,0x693C,0x000B,0x69A0,0x000B,0x6A1C, - 0x000B,0x6A98,0x000B,0x6B00,0x000B,0x808E,0x000B,0x80A2, - 0x000B,0x80C8,0x000B,0x808E,0x000B,0x80A2,0x000B,0x811C, - 0x000B,0x813E,0x000B,0xB188,0x000B,0xB1C0,0x000B,0xB308 -}; -static UINT16 bloodwar_mcu_4_2d[] = { // Warrior 9 - 0x0009,0x81A8,0x0009,0x81C8,0x0009,0x8270,0x0009,0x8328, - 0x0009,0x8A98,0x0009,0x8416,0x0009,0x8430,0x0009,0x8450, - 0x0009,0x84E8,0x0009,0x8580,0x0009,0x8AB4,0x0009,0x8C90, - 0x0009,0x8CA2,0x0009,0x8CD4,0x0009,0x8D06,0x0009,0x8D70, - 0x0009,0x8D82,0x0009,0x8DB4,0x0009,0x8DE6,0x0009,0x8D38, - 0x0009,0x8D46,0x0009,0x8D54,0x0009,0x8D62,0x0009,0x8E18, - 0x0009,0x8E26,0x0009,0x8E34,0x0009,0x8E42,0x0009,0x864E, - 0x0009,0x8668,0x0009,0x8694,0x0009,0x870C,0x0009,0x8784, - 0x0009,0x87FC,0x0009,0x8828,0x0009,0x88A0,0x0009,0x8918, - 0x0009,0x8AD0,0x0009,0x8AE2,0x0009,0x8B14,0x0009,0x8B46, - 0x0009,0x8BB0,0x0009,0x8BC2,0x0009,0x8BF4,0x0009,0x8C26, - 0x0009,0x8B78,0x0009,0x8B86,0x0009,0x8B94,0x0009,0x8BA2, - 0x0009,0x8C58,0x0009,0x8C66,0x0009,0x8C74,0x0009,0x8C82, - 0x0009,0x8990,0x0009,0x89EE,0x0009,0x8A46,0x0009,0x89A4, - 0x0009,0x8A02,0x0009,0x8A5A,0x0009,0x89DA,0x0009,0x8A32, - 0x0009,0x8A8A,0x0009,0x8F0E,0x0009,0x8F50,0x0009,0x8FB6, - - 0x0009,0x901C,0x0009,0x9082,0x0009,0x90DC,0x0009,0x9184, - 0x0009,0x922C,0x0009,0x92D4,0x0009,0x9310,0x0009,0x9370, - 0x0009,0x93D0,0x0009,0x9430,0x0009,0x94A2,0x0009,0x9548, - 0x0009,0x95EE,0x0009,0xA4F0,0x0009,0xA520,0x0009,0xA574, - 0x0009,0xA5C8,0x0009,0xA61C,0x0009,0xA66A,0x0009,0xA716, - 0x0009,0xA7C2,0x0009,0xA86E,0x0009,0xA8B0,0x0009,0xA926, - 0x0009,0xA99C,0x0009,0xAA12,0x0009,0xAA78,0x0009,0xAB12, - 0x0009,0xABAC,0x0009,0x9694,0x0009,0x96D0,0x0009,0x9730, - 0x0009,0x9790,0x0009,0x97F0,0x0009,0x9838,0x0009,0x98DE, - 0x0009,0x9984,0x0009,0x9A2A,0x0009,0x9A66,0x0009,0x9AD6, - 0x0009,0x9B46,0x0009,0x9BB6,0x0009,0x9C16,0x0009,0x9CC4, - 0x0009,0x9D72,0x0009,0xAC46,0x0009,0xAC6A,0x0009,0xACB2, - 0x0009,0xACFA,0x0009,0xAD42,0x0009,0xAD84,0x0009,0xAE34, - 0x0009,0xAEE4,0x0009,0xAF94,0x0009,0xAFEC,0x0009,0xB05C, - 0x0009,0xB0CC,0x0009,0xB13C,0x0009,0xB196,0x0009,0xB248, - 0x0009,0xB2FA,0x0009,0x9E20,0x0009,0x9E54,0x0009,0x9EEC, - - 0x0009,0x9F84,0x0009,0xA01C,0x0009,0xA050,0x0009,0xA0A8, - 0x0009,0xA100,0x0009,0xB3AC,0x0009,0xB3E0,0x0009,0xB478, - 0x0009,0xB510,0x0009,0xB5A8,0x0009,0xB5E8,0x0009,0xB64C, - 0x0009,0xB6B0,0x0009,0xA158,0x0009,0xA198,0x0009,0xA23C, - 0x0009,0xA2E0,0x0009,0xA384,0x0009,0xA3C4,0x0009,0xA428, - 0x0009,0xA48C,0x0009,0xB714,0x0009,0xB748,0x0009,0xB7E0, - 0x0009,0xB878,0x0009,0xB910,0x0009,0xB95C,0x0009,0xB9CC, - 0x0009,0xBA3C,0x0009,0x8E50,0x0009,0x8E82,0x0009,0x8ED2, - 0x0009,0xC388,0x0009,0xC394,0x0009,0xC3B2,0x0009,0xC3DC, - 0x0009,0xC3E8,0x0009,0xC406,0x0009,0xC430,0x0009,0xC43C, - 0x0009,0xC45A,0x0009,0xC4FE,0x0009,0xC514,0x0009,0xC484, - 0x0009,0xC48C,0x0009,0xC520,0x0009,0xC71C,0x0009,0xC5B8, - 0x0009,0xC62C,0x0009,0xC692,0x0009,0xC6DA,0x0009,0xC7CC, - 0x0009,0xC89E,0x0009,0xCC5C,0x0009,0xCA68,0x0009,0xCE26, - 0x0009,0xCBA8,0x0009,0xCF88,0x0009,0xD060,0x0009,0xD152, - 0x0009,0xD244,0x0009,0xD336,0x0009,0xD4AE,0x0009,0xD5A0, - - 0x0009,0xD692,0x0009,0xD784,0x0009,0xDDC4,0x0009,0xDDE4, - 0x0009,0xDE20,0x0009,0xDE5C,0x0009,0xDE6A,0x0009,0xDE98, - 0x0009,0xDEF8,0x0009,0xDF34,0x0009,0xDF3A,0x0009,0xDF68, - 0x0009,0xDFA4,0x0009,0xDFB2,0x0009,0xDFD0,0x0009,0xDFDE, - 0x0009,0xDFFC,0x0009,0xE038,0x0009,0xE094,0x0009,0xE0CE, - 0x0009,0xE0DC,0x0009,0xE102,0x0009,0xE13E,0x0009,0xE154, - 0x0009,0xE172,0x0009,0xE1AE,0x0009,0xE200,0x0009,0xE216, - 0x0009,0xE234,0x0009,0xE28E,0x0009,0xE294,0x0009,0xE2B2, - 0x0009,0xE2FE,0x0009,0xE31C,0x0009,0xE342,0x0009,0xE37E, - 0x0009,0xE384,0x0009,0xBAAC,0x0009,0xBAAC,0x0009,0xBAAC, - 0x0009,0xBAAC,0x0009,0xBB44,0x0009,0xBC0C,0x0009,0xBCF4, - 0x0009,0xBDFC,0x0009,0xBF24,0x0009,0xC00E,0x0009,0xC040, - 0x0009,0xC124,0x0009,0xC156,0x0009,0xC240,0x0009,0xC272, - 0x0009,0xC356,0x0009,0xD8FC,0x0009,0xD910,0x0009,0xD936, - 0x0009,0xD8FC,0x0009,0xD910,0x0009,0xD96E,0x0009,0xD8FC, - 0x0009,0xD910,0x0009,0xD9B8,0x0009,0xD9D2,0x000A,0x0E3C -}; - - - - -/* decryption tables */ - -/* this should probably be derived from the final block at the end of the MCU rom somehow ... - (see 'finalblock' debug output when verbose = 1) - for now just putting it in a bit table, only used keys are filled in as nothing else was - extracted when getting the tables, unknown values are filled in as -1 - - key 0 means no decryption, this could be done in logic rather than expecting the first - part of the table to be 0 -*/ - -static const INT16 calc3_keydata[0x40*0x100] = { -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xce,0x55,0xa1,0x56,0x20,0xe0,0xcb,0xa9,0x5b,0x9b,0xd6,0x9b,0x5e,0x6e,0x6c,0xf6, -0xf8,0x16,0xb6,0x03,0x76,0xcb,0x47,0x51,0xed,0x20,0xcc,0xb3,0x4c,0x2a,0x74,0x88, -0x20,0xe4,0x1f,0x3f,0x25,0xd2,0x49,0x19,0x90,0xe5,0xb4,0x31,0x1e,0x9f,0xd7,0xba, -0xda,0x77,0x08,0x89,0xb1,0x7f,0x6b,0xd3,0xb6,0x44,0x99,0x37,0x35,0xf6,0x0f,0xff, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x01,0x4a,0x9e,0xa3,0x0c,0xb4,0x74,0x2d,0x7c,0xbd,0x79,0x3a,0x62,0xe9,0x29,0x12, -0x01,0x50,0xc0,0x39,0x5a,0x47,0x27,0x38,0x77,0x3c,0x9e,0xa0,0x7a,0xe2,0x29,0x4d, -0x64,0x8e,0xbb,0xe8,0xa5,0xe1,0x23,0xaf,0x67,0xa8,0xb9,0x79,0x99,0x00,0xc8,0xf4, -0xbd,0xbe,0xb9,0x32,0x71,0x0e,0x03,0x64,0xbe,0x59,0xd5,0xe5,0x22,0x6d,0x80,0x7a, -0x5e,0xd8,0xa6,0xd7,0x00,0x94,0x23,0x66,0xaf,0xea,0xbe,0x45,0x38,0x90,0x8e,0x8d, -0x5b,0x14,0x2c,0xda,0x55,0x7e,0x9d,0x08,0x2d,0x31,0xfd,0x3a,0xbe,0x13,0xeb,0x21, -0x87,0xee,0xb7,0x7b,0x34,0x15,0x4d,0xd9,0xeb,0x4a,0xde,0xa6,0x57,0xdf,0x53,0x65, -0x75,0x1c,0x72,0x3a,0x20,0xe1,0xcd,0xac,0x5d,0x8c,0x6d,0xa9,0x66,0x1d,0x41,0xca, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xca,0x23,0x9e,0x00,0x37,0x72,0x61,0x0d,0x71,0x99,0x02,0xb1,0x5b,0x8f,0x50,0x22, -0x06,0xdb,0xd6,0xd5,0x44,0x42,0xcd,0x44,0xf0,0xa2,0xc4,0xef,0xfa,0x1e,0x11,0xa1, -0x34,0x7b,0xf6,0xf4,0xdf,0xca,0x92,0x17,0xf3,0x48,0x8d,0xcf,0x30,0x82,0x81,0xbc, -0xe8,0xbd,0x29,0xde,0x89,0x94,0x4b,0x57,0xed,0xe3,0x66,0x73,0x60,0xe4,0x1b,0xe5, -0x75,0x98,0x5b,0x53,0x88,0x69,0x54,0x16,0x11,0x0d,0x1c,0x3b,0xae,0xad,0x1a,0xcd, -0xed,0x47,0x37,0x56,0xdd,0x51,0xc8,0xa3,0x52,0x9f,0x38,0xc8,0xfb,0x86,0x78,0x64, -0x25,0x42,0x27,0x26,0x4b,0x95,0x80,0x90,0x64,0xb1,0x07,0xfb,0xeb,0x58,0xf2,0xdc, -0xad,0x42,0x57,0x45,0x56,0xbf,0x19,0xaf,0xb9,0x9d,0x93,0xf6,0xe1,0x4c,0x01,0xa5, -0xdb,0x40,0xb2,0x74,0x40,0x97,0xee,0x0f,0x84,0xfc,0xa7,0x19,0x01,0xcb,0xe1,0x71, -0xc1,0x75,0xe2,0xb4,0x0d,0x26,0x19,0x03,0xb9,0xa6,0xce,0x06,0x2c,0x7d,0x8d,0x30, -0x31,0x5b,0x52,0x45,0x7f,0xb7,0x75,0x1a,0x09,0xb5,0x53,0x9c,0x06,0x4d,0xc0,0x14, -0xbf,0xaa,0x2f,0xa9,0x1a,0xd0,0x9d,0x27,0xe9,0x82,0x41,0xff,0xf2,0x63,0xf5,0x8e, -0xbd,0x5b,0x62,0xa2,0x20,0x3c,0xed,0x3a,0x8b,0xa6,0x64,0x8d,0x13,0x27,0x67,0x4e, -0x40,0xa7,0x96,0x2f,0x95,0x04,0x7f,0xa4,0xe3,0xf9,0x45,0xe9,0x4c,0x44,0x10,0x46, -0x19,0x08,0x38,0x91,0x3b,0x70,0x2f,0xf5,0xa2,0x95,0x31,0xf3,0x40,0xa2,0xad,0xa6, -0xdb,0x35,0x70,0x4b,0x96,0x09,0x97,0x00,0x3d,0xd2,0x32,0xcc,0x52,0x69,0xb7,0xe0, -0xdb,0x29,0x2c,0x1d,0xe8,0x99,0x12,0xd6,0xe6,0x4b,0x12,0xd6,0xa6,0x04,0x6a,0xa5, -0x2a,0x1c,0x15,0x07,0x35,0x28,0xbc,0xc6,0x90,0xd7,0x5e,0xb1,0x1d,0x1a,0xc1,0xe5, -0x9c,0x88,0x96,0x4b,0x3f,0x00,0x6f,0x62,0xef,0x90,0x60,0x3f,0x5b,0x95,0x77,0xd1, -0xc4,0x24,0xdc,0x6a,0x8a,0xa9,0xc6,0x7b,0x74,0xce,0x24,0x9f,0xc3,0x9f,0x06,0xdc, -0xf4,0xeb,0xd0,0x25,0x58,0xed,0x1d,0x23,0x54,0x2b,0x73,0x34,0x78,0x9f,0xab,0xb5, -0x41,0x15,0x1d,0x7c,0xac,0xd4,0x8e,0xa9,0x82,0x80,0xd9,0x9f,0x5d,0x3f,0x5f,0x4d, -0x7c,0x1b,0x2f,0xb2,0x4b,0xa7,0xf4,0xa0,0xaf,0xe6,0xa2,0xc0,0x15,0x68,0xde,0xd6, -0x38,0xb6,0x31,0x46,0xb5,0xf0,0xeb,0xd7,0x50,0xb5,0xd7,0xb8,0x03,0x43,0xa4,0xc0, -0xca,0xe0,0x0d,0xfa,0x2f,0x78,0xcd,0x61,0x97,0x87,0x45,0xe8,0x4a,0x39,0xe9,0xbe, -0x43,0xd0,0x6f,0xcf,0xbc,0x47,0xb6,0x8e,0x77,0x35,0x76,0xf2,0xcc,0xf3,0xab,0xbe, -0x77,0x01,0xc1,0x06,0x1e,0xa6,0x80,0xef,0xa3,0xd7,0xb5,0xb6,0x2e,0x5a,0xa4,0xf4, -0xf8,0x2b,0x30,0x20,0xd8,0x1f,0xc6,0x55,0x8f,0xc7,0x0d,0x55,0xd2,0x97,0x4f,0xce, -0x1b,0x48,0xa4,0xdd,0x2e,0x7a,0xe3,0xd1,0x6d,0x9e,0x49,0x31,0xdb,0x13,0xe6,0x00, -0xf1,0x8f,0xcb,0x3f,0x23,0xc1,0xf3,0xb4,0x30,0x35,0xf4,0xea,0x2c,0x77,0x65,0x79, -0x4e,0x7b,0x0e,0x87,0x79,0x3c,0xd1,0x8f,0x8b,0xa4,0x5a,0x61,0x68,0xac,0x87,0x6b, -0xc4,0xc4,0x98,0x36,0xb3,0x75,0x16,0x33,0xf2,0x45,0x84,0xb8,0xf2,0xdb,0xc7,0x46, -0xa8,0x63,0x55,0x0d,0x15,0x34,0x1f,0xb2,0x96,0xb0,0x3f,0x4f,0xec,0x6c,0x60,0xbb, -0x0b,0x91,0xf0,0x0d,0xa2,0x83,0x07,0x5b,0x6c,0xc0,0x14,0xc7,0x3b,0x0a,0x4d,0xbd, -0xc0,0xc8,0xd3,0x76,0x1c,0xaa,0xa8,0xc1,0x27,0x8c,0x50,0x02,0x81,0x9d,0x48,0x7b, -0x5c,0xc0,0x2a,0xca,0x06,0x32,0x9d,0xb3,0x38,0x6d,0xfd,0x20,0x21,0x4d,0xce,0x66, -0x30,0x72,0xe0,0xca,0xa4,0xe5,0x41,0x44,0xd4,0xfe,0xe6,0x82,0x3e,0x85,0x18,0x30, -0x50,0x17,0x9f,0x77,0xf8,0xcb,0xb0,0xc4,0xed,0x16,0x96,0xca,0xba,0xec,0x22,0xca, -0x8f,0x28,0xd3,0x12,0xc6,0x2e,0xc4,0xc3,0x36,0xcf,0x59,0xd8,0x3a,0x6c,0xa7,0x64, -0x7f,0x5f,0xa6,0x1b,0x90,0x96,0x19,0x14,0x22,0x81,0x38,0xcd,0x20,0x2f,0x22,0x70, -0x74,0xb4,0x04,0x55,0x9a,0xcd,0x09,0xc7,0xe5,0xc7,0xff,0x0b,0x8e,0x9c,0xce,0x9e, -0x81,0x5f,0x98,0xbf,0xe7,0xdb,0xaf,0x2d,0x71,0x77,0x3a,0x32,0x69,0x5d,0xa5,0xe0, -0x79,0xdc,0xcc,0x9b,0x38,0x0a,0xe6,0xd7,0x79,0xad,0x33,0x23,0x53,0x5c,0x64,0x67, -0xee,0xe1,0xcc,0x6a,0x13,0xe2,0x4a,0x97,0x71,0xc0,0xf4,0x00,0xae,0xc0,0x84,0xa3, -0x34,0x69,0x83,0xec,0xb8,0x2c,0x36,0x7c,0x8a,0x4b,0x4a,0x29,0x9f,0xf3,0x41,0x46, -0x5e,0xab,0x9b,0x24,0x2d,0xf2,0xc4,0xd8,0xb9,0x24,0xbf,0x3f,0x08,0x9e,0x96,0x40, -0x3f,0x22,0x7f,0x51,0x32,0x7d,0xcf,0x3d,0xb0,0x67,0x9f,0x24,0x8b,0xaa,0x3e,0xc3, -0x69,0x87,0x5c,0xf5,0x4d,0x55,0xf2,0x7a,0xe2,0x6b,0xf3,0xf8,0x8d,0x40,0xb4,0x3f, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xfe,0xf7,0xc7,0x85,0xe4,0xd3,0x93,0xd0,0x36,0x61,0xc8,0x4d,0x0c,0x3e,0x2a,0x1c, -0x32,0x1a,0xbf,0x1a,0xb0,0x60,0xb5,0xa8,0x1a,0x19,0x16,0xaf,0x96,0x0d,0x2d,0xe0, -0xb1,0x2c,0xb6,0x41,0xe1,0x2d,0xc8,0xe5,0xd9,0x75,0x82,0xfa,0x90,0x3a,0x77,0x09, -0x0e,0xe8,0xda,0x7a,0xfb,0xc4,0x68,0x57,0xe8,0xcf,0x18,0x51,0x5b,0xed,0x83,0x08, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x75,0x49,0x7a,0xd6,0x84,0xbd,0x70,0xbe,0x10,0x19,0x6c,0xb2,0xa9,0x5f,0x6b,0x78, -0x14,0x29,0x2a,0x15,0xd0,0x4a,0x10,0x93,0x69,0xb2,0xdf,0x02,0x7f,0x92,0x19,0xbd, -0x95,0xc1,0x32,0xee,0x99,0x5e,0x7a,0x55,0x37,0xb7,0xc8,0x45,0xdc,0x6a,0xe6,0xef, -0x8b,0xca,0xbe,0xe2,0x63,0x85,0x49,0xd3,0xeb,0x83,0x32,0x9a,0x23,0x11,0x4c,0x7e, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x02,0xdf,0x0f,0x0e,0x98,0x3a,0xa7,0xaf,0xbd,0xb0,0xe6,0x3a,0x8d,0xeb,0xb4,0x3b, -0x18,0x67,0x78,0xbb,0xeb,0x1c,0x09,0x06,0x5c,0x5c,0x51,0xb1,0x98,0xfe,0xc0,0xdc, -0x6d,0xbc,0x77,0xb5,0xd7,0xda,0x2f,0x3d,0x4c,0x08,0xee,0x4f,0xc7,0x8a,0x68,0xde, -0x94,0x96,0x35,0x7e,0xe0,0xfe,0xb7,0x26,0xff,0x0e,0xc7,0x34,0x7b,0xb8,0x25,0xb1, -0xe0,0xee,0x9d,0xd7,0x49,0x50,0xf9,0xd0,0xa8,0x07,0xa9,0xc1,0xd8,0xf1,0x33,0x07, -0x63,0xfe,0x5b,0xc0,0x13,0xda,0x12,0x8e,0x3a,0xcc,0x1e,0x97,0xc1,0xdd,0x8d,0xd1, -0xf2,0x3e,0xda,0x7c,0x04,0xe4,0xdc,0xef,0x69,0x75,0x72,0x98,0xd9,0x67,0xee,0x3f, -0x1d,0x66,0x44,0x8a,0x9c,0xf7,0xf2,0xc6,0xa7,0x5c,0xae,0xe4,0x83,0xb7,0xd1,0xc2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xd0,0xa8,0x87,0xcf,0xe1,0x22,0x8d,0xe7,0xfa,0x26,0x85,0xce,0x6d,0xfa,0x2c,0x8b, -0xbd,0x75,0xfe,0x64,0x2b,0xab,0x25,0xa1,0x02,0xcc,0x1f,0x93,0xa2,0x4a,0x31,0xd5, -0x4d,0x3a,0x8e,0xd2,0xb3,0xfd,0x46,0x87,0x3f,0x1f,0xef,0x8a,0x1e,0x7f,0x15,0x4c, -0x13,0xb1,0x61,0x9b,0xfc,0xa0,0x8b,0x6b,0x22,0x78,0x00,0xd5,0x44,0xc3,0x52,0x60, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xaf,0x2e,0xd9,0xfd,0x18,0xd1,0xb8,0xc2,0x9b,0x33,0x28,0x30,0x01,0xff,0x1c,0xf4, -0xc6,0xf9,0xc9,0x7c,0xa2,0x9a,0x8f,0xb9,0xd9,0xfa,0xa7,0x24,0x42,0xf3,0x8b,0xff, -0x18,0x84,0x29,0xdd,0x82,0x73,0xc7,0x64,0xe3,0x37,0xb3,0x52,0xe2,0x14,0xb2,0xbe, -0x37,0x88,0x25,0xa0,0x3b,0xe6,0xfb,0x94,0x2d,0x41,0x59,0xdb,0x44,0x8b,0x0b,0xa3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x7c,0x82,0x91,0x60,0xee,0x5d,0x7a,0x63,0x8a,0x2c,0x91,0xe7,0x94,0x02,0x02,0x42, -0x7d,0x8a,0xba,0x09,0x78,0xa6,0x50,0xd6,0xbe,0x55,0xb5,0x49,0xa1,0xda,0x9d,0x4d, -0x51,0x1b,0xab,0x9d,0x70,0x47,0x5f,0x86,0x57,0xbb,0xbf,0xee,0x24,0x27,0xc6,0x95, -0x8b,0xec,0x90,0x9b,0x58,0xc9,0x42,0x43,0xc6,0xb7,0xba,0xf6,0x82,0x11,0xfa,0x8b, -0x7d,0xf8,0x54,0xc5,0x74,0xf6,0x54,0x1d,0x40,0xe1,0x71,0xc2,0xdd,0x03,0x72,0xdf, -0x3b,0x77,0xa1,0x1c,0xc7,0xd6,0xb1,0x67,0xb7,0x13,0x6f,0xf4,0x18,0xa4,0x2a,0x82, -0x98,0xe3,0xe3,0xe1,0x12,0xb3,0x33,0xb1,0xde,0x66,0xff,0x6c,0xd5,0xde,0xdd,0xa6, -0x26,0xf3,0x44,0x94,0xdb,0x15,0x76,0xcc,0x28,0x33,0x2d,0x4b,0x79,0xdb,0x06,0xbc, -0x39,0xa2,0xb0,0xf7,0x63,0xc6,0xd4,0xc9,0xc9,0x12,0xc2,0xf3,0x26,0x02,0xe0,0x75, -0xe4,0x28,0xd2,0x0c,0xad,0xce,0x68,0xf9,0xb3,0xdd,0x4b,0x04,0xbe,0xfd,0x65,0xc1, -0xfa,0xfe,0x14,0x12,0x7d,0x77,0x0e,0xed,0x99,0xad,0x11,0x5f,0xe6,0xb6,0x52,0xd1, -0x0d,0xde,0xa2,0x8a,0x55,0x49,0x60,0x76,0xee,0xda,0x21,0x26,0x00,0x54,0x20,0x17, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x27,0xb4,0xc1,0xba,0x5f,0xd4,0x47,0x04,0x1f,0xfe,0x42,0xa5,0xce,0xb5,0x23,0xbe, -0x42,0xcc,0x59,0x71,0x51,0x13,0x41,0xa4,0x18,0x35,0xcf,0x02,0x0d,0xe1,0xfb,0x43, -0xc5,0x28,0xed,0xae,0x84,0x27,0xe8,0xdc,0x89,0xe5,0xf6,0xbe,0x16,0x7e,0x57,0xe1, -0x41,0x82,0xa9,0xf1,0x7c,0x98,0xd7,0x7c,0xe5,0x67,0xc2,0xf9,0x4d,0xb6,0xb0,0x09, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x33,0x8e,0x6f,0x22,0xac,0x01,0x9f,0x7a,0xc7,0xca,0x23,0xc4,0xa4,0x9c,0x07,0xf8, -0x98,0xc1,0x17,0x4a,0xb2,0xbc,0xcc,0xf4,0x0e,0x2e,0xf6,0x35,0xdd,0xf6,0x29,0x9a, -0x2f,0x9c,0xe8,0x7c,0x86,0xf0,0x93,0xca,0x1a,0xee,0x10,0x08,0xec,0xe5,0x3a,0x98, -0x8c,0xd8,0x0d,0x39,0xaa,0x25,0x8d,0xcd,0x5d,0x64,0x7a,0x5f,0x35,0x92,0xb5,0x64, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xdd,0xa9,0x15,0x18,0x9d,0x01,0x24,0x9c,0xed,0x7a,0xeb,0x42,0x8b,0x9e,0xf3,0x72, -0x26,0xc9,0x45,0x18,0xea,0xd2,0x54,0x5f,0xcf,0xed,0xac,0xbc,0xa1,0xd0,0x5f,0x2f, -0xce,0x15,0x2a,0xc6,0xf1,0xe0,0x69,0x62,0x22,0xc1,0xc0,0xbd,0xfa,0xdc,0x85,0xac, -0x67,0x47,0xee,0xa2,0x35,0xb3,0xff,0x76,0x57,0x4f,0x30,0x66,0xf8,0xe9,0xe0,0x5b, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x0f,0x35,0xa3,0x7c,0xf1,0x75,0xea,0x27,0x36,0x4d,0x4b,0x1a,0x3b,0x24,0xef,0x9d, -0x4e,0x39,0x7e,0x7b,0x3d,0x42,0x0d,0xc2,0x9f,0x53,0xc7,0xc4,0xdf,0x02,0x5d,0x61, -0x0c,0xc9,0x2d,0x89,0x63,0xab,0x34,0xfc,0x97,0x1b,0xb5,0x54,0xe6,0x19,0xa5,0x46, -0xdc,0x9e,0xdc,0x25,0xe4,0x3a,0xfc,0xa7,0x93,0xfc,0x1f,0xec,0xb3,0x92,0x43,0xbc, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x5d,0xdd,0xd4,0xbe,0xc0,0xff,0xe1,0x1b,0x3a,0xd6,0x61,0xc8,0x90,0x02,0x23,0x08, -0xfa,0x7a,0xfa,0x1d,0xab,0x2b,0xa0,0x0b,0x24,0xe1,0x6b,0x9e,0x38,0x6b,0xb2,0xae, -0xdd,0xfa,0xfc,0xa2,0xb8,0xcb,0xed,0x33,0x66,0x06,0xef,0x72,0x8b,0xe5,0xa3,0x0d, -0x9b,0x18,0x05,0xce,0x6a,0x69,0x61,0x64,0x74,0x9c,0xf9,0x66,0xec,0x99,0x72,0x95, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x2c,0xf3,0x0d,0x50,0x30,0x77,0xc2,0x25,0x91,0x83,0x5f,0xac,0xf4,0x56,0x96,0xc8, -0x70,0x86,0x16,0x5a,0x1b,0xa1,0x7d,0x08,0x53,0x15,0xfd,0x3c,0xcb,0x4d,0xd0,0x70, -0x5c,0x1d,0x5c,0xaa,0x87,0x60,0x24,0x42,0xcc,0xe0,0x75,0xeb,0xae,0x75,0xcc,0xf1, -0x81,0x71,0x09,0xc0,0xf8,0x3c,0x55,0xa6,0x71,0x3c,0xd2,0xda,0xfe,0xf8,0x07,0xbc, -0x33,0x7c,0x08,0x5e,0xb1,0xff,0x68,0x44,0x75,0xc3,0xdf,0x68,0xdf,0x3d,0xba,0x81, -0x84,0x76,0x06,0x85,0xb4,0xb1,0x7a,0x6d,0xc9,0x4e,0x27,0x38,0x35,0xee,0xe1,0x32, -0x48,0xd8,0x6b,0x76,0xc4,0x9b,0x65,0xb2,0x22,0xf5,0xf6,0x2a,0xa1,0xf4,0x37,0x00, -0x12,0x5b,0x65,0xb2,0x65,0x47,0xc5,0xe4,0xf2,0x13,0x55,0x60,0x87,0x78,0x37,0x5b, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xeb,0xd8,0xb6,0x33,0x90,0xbf,0x13,0x7f,0xd8,0x00,0xce,0xe0,0x48,0x79,0x78,0xd7, -0xd7,0x62,0xa3,0xe7,0x7b,0xe8,0xc9,0x54,0x71,0x18,0xff,0x2b,0x4f,0xff,0x5e,0x82, -0xca,0x10,0x2c,0x01,0x47,0xc5,0xcc,0xa2,0x22,0x89,0x6b,0xb4,0xc1,0xd6,0x66,0x26, -0x56,0x9b,0x7c,0x02,0x77,0xe0,0xb8,0x38,0x5f,0xac,0x1b,0x9d,0x00,0x27,0x0c,0x33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x65,0x19,0xf5,0x62,0x7a,0x92,0xc5,0x4a,0x55,0xcc,0x2f,0xf8,0x6c,0x79,0x34,0x3d, -0xa4,0x9e,0xd3,0xec,0xe4,0x3a,0xf9,0x99,0x5a,0x28,0x2a,0xa0,0x8a,0x46,0xef,0x69, -0x1b,0xd7,0xfd,0xeb,0x60,0x26,0x2a,0x6f,0xa7,0x6c,0x0f,0x97,0x44,0xf4,0x7d,0x9e, -0x5b,0x7d,0xa0,0xe1,0x70,0xe0,0xf3,0x9f,0xb0,0xf3,0xea,0xfd,0xfc,0xac,0x58,0x4d, -0xb8,0x8a,0xa5,0x8f,0x58,0x30,0xb0,0x38,0xa6,0x53,0x84,0x33,0xd4,0xd7,0xbd,0x26, -0x45,0x35,0xb7,0xf6,0x1a,0x20,0x7b,0x8d,0x7e,0x68,0x69,0xdb,0xb1,0x1e,0xa5,0x1a, -0xd5,0xf9,0x42,0x57,0x7a,0xf8,0x30,0x2e,0xea,0x49,0xe5,0xd5,0x34,0x6a,0xcd,0x5b, -0xfa,0x8e,0x71,0x32,0xfa,0x42,0x69,0xec,0x5d,0x50,0x02,0x42,0xc2,0xe4,0xae,0x5a, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x9a,0x8e,0xcf,0x66,0xe0,0xd8,0xd4,0x2a,0x0f,0x4d,0xad,0x64,0x8c,0x6d,0xcb,0x37, -0x2e,0x0e,0x9f,0xc4,0xca,0xff,0x85,0xf1,0x7f,0xec,0x71,0x69,0xc2,0x81,0x5c,0xe4, -0x28,0xd2,0x6b,0xa9,0xf6,0xfb,0xe4,0x51,0x68,0x03,0xd0,0xcd,0xc3,0x07,0x6f,0xab, -0x1c,0x94,0x5f,0x94,0xe6,0x54,0x8b,0x1a,0x3c,0xed,0xd4,0xb0,0xf3,0x26,0x81,0xfa, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -}; diff --git a/jan/src/burn/drv/sega/d_angelkds.cpp b/jan/src/burn/drv/sega/d_angelkds.cpp deleted file mode 100644 index 8d5dfdd29..000000000 --- a/jan/src/burn/drv/sega/d_angelkds.cpp +++ /dev/null @@ -1,1037 +0,0 @@ -// FB Alpha Angel Kids driver module -// Based on MAME driver by David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROMDec; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvPalRAM; -static UINT8 *DrvBgtRAM; -static UINT8 *DrvBgbRAM; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvSprRAM; -static UINT32 *DrvPalette; - -static UINT16 *pTempDraw; - -static UINT8 *main_to_sound; -static UINT8 *sound_to_main; - -static UINT8 bgtopbank; -static UINT8 bgbotbank; -static UINT8 bgtopscroll; -static UINT8 bgbotscroll; -static UINT8 txbank; -static UINT8 layer_ctrl; - -static INT32 DrvZ80Bank0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT16 DrvInputs[3]; - -static struct BurnInputInfo AngelkdsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Left Stick Up", BIT_DIGITAL, DrvJoy2 + 4, "p3 up" }, - {"P1 Left Stick Down", BIT_DIGITAL, DrvJoy2 + 5, "p3 down" }, - {"P1 Left Stick Left", BIT_DIGITAL, DrvJoy2 + 6, "p3 left" }, - {"P1 Left Stick Right", BIT_DIGITAL, DrvJoy2 + 7, "p3 right" }, - {"P1 Right Stick Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Right Stick Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Right Stick Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right Stick Right",BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Left Stick Up", BIT_DIGITAL, DrvJoy3 + 4, "p4 up" }, - {"P2 Left Stick Down", BIT_DIGITAL, DrvJoy3 + 5, "p4 down" }, - {"P2 Left Stick Left", BIT_DIGITAL, DrvJoy3 + 6, "p4 left" }, - {"P2 Left Stick Right", BIT_DIGITAL, DrvJoy3 + 7, "p4 right" }, - {"P2 Right Stick Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Right Stick Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Right Stick Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right Stick Right",BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Angelkds) - -static struct BurnInputInfo SpcpostnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Spcpostn) - -static struct BurnDIPInfo AngelkdsDIPList[]= -{ - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xf8, NULL }, - {0x18, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 10, "Coin B" }, - {0x16, 0x01, 0x0f, 0x07, "4 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x08, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x09, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x16, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x16, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x16, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 10, "Coin A" }, - {0x16, 0x01, 0xf0, 0x70, "4 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x80, "3 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x90, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x16, 0x01, 0xf0, 0x00, "Free Play" }, - -// not supported -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x17, 0x01, 0x01, 0x00, "Upright" }, -// {0x17, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "High Score Characters" }, - {0x17, 0x01, 0x02, 0x00, "3" }, - {0x17, 0x01, 0x02, 0x02, "10" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x17, 0x01, 0x0c, 0x0c, "20k, 50k, 100k, 200k and 500k" }, - {0x17, 0x01, 0x0c, 0x08, "50k, 100k, 200k and 500k" }, - {0x17, 0x01, 0x0c, 0x04, "100k, 200k and 500k" }, - {0x17, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x17, 0x01, 0x30, 0x30, "3" }, - {0x17, 0x01, 0x30, 0x20, "4" }, - {0x17, 0x01, 0x30, 0x10, "5" }, - {0x17, 0x01, 0x30, 0x00, "99 (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x17, 0x01, 0xc0, 0xc0, "Very Easy" }, - {0x17, 0x01, 0xc0, 0x40, "Easy" }, - {0x17, 0x01, 0xc0, 0x80, "Hard" }, - {0x17, 0x01, 0xc0, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x18, 0x01, 0x80, 0x00, "On" }, - {0x18, 0x01, 0x80, 0x80, "Off" }, -}; - -STDDIPINFO(Angelkds) - -static struct BurnDIPInfo SpcpostnDIPList[]= -{ - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0xab, NULL }, - {0x14, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x12, 0x01, 0x0f, 0x02, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x05, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x0f, 0x04, "3 Coins 2 Credits" }, - {0x12, 0x01, 0x0f, 0x01, "4 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x0f, 0x03, "3 Coins 4 Credits" }, - {0x12, 0x01, 0x0f, 0x07, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x0f, 0x06, "2 Coins 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x12, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x12, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x12, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x12, 0x01, 0x0f, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x12, 0x01, 0xf0, 0x00, "Off" }, - {0x12, 0x01, 0xf0, 0x20, "4 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x50, "3 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x12, 0x01, 0xf0, 0x40, "3 Coins 2 Credits" }, - {0x12, 0x01, 0xf0, 0x10, "4 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, - {0x12, 0x01, 0xf0, 0x30, "3 Coins 4 Credits" }, - {0x12, 0x01, 0xf0, 0x70, "2 Coins 3 Credits" }, - {0x12, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x12, 0x01, 0xf0, 0x60, "2 Coins 5 Credits" }, - {0x12, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x12, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x12, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x12, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x12, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x13, 0x01, 0x01, 0x01, "No" }, - {0x13, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Obstruction Car" }, - {0x13, 0x01, 0x02, 0x02, "Normal" }, - {0x13, 0x01, 0x02, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 4, "Time Limit" }, - {0x13, 0x01, 0x0c, 0x00, "1:10" }, - {0x13, 0x01, 0x0c, 0x04, "1:20" }, - {0x13, 0x01, 0x0c, 0x08, "1:30" }, - {0x13, 0x01, 0x0c, 0x0c, "1:40" }, - - {0 , 0xfe, 0 , 4, "Power Down" }, - {0x13, 0x01, 0x30, 0x30, "Slow" }, - {0x13, 0x01, 0x30, 0x20, "Normal" }, - {0x13, 0x01, 0x30, 0x10, "Fast" }, - {0x13, 0x01, 0x30, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Spcpostn) - -static void bankswitch(INT32 data) -{ - DrvZ80Bank0 = (data & 0x0f); - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + 0x10000 + DrvZ80Bank0 * 0x4000); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + 0x10000 + DrvZ80Bank0 * 0x4000); -} - -void __fastcall angelkds_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - bgtopbank = data; - return; - - case 0xf001: - bgtopscroll = data; - return; - - case 0xf002: - bgbotbank = data; - return; - - case 0xf003: - bgbotscroll = data; - return; - - case 0xf004: - txbank = data; - return; - - case 0xf005: - layer_ctrl = data; - return; - } -} - -void __fastcall angelkds_out_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: // nop - case 0x43: - case 0x83: - return; - - case 0x42: - bankswitch(data); - return; - - case 0xc0: - case 0xc1: - case 0xc2: - case 0xc3: - main_to_sound[port & 3] = data; - return; - } -} - -UINT8 __fastcall angelkds_in_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x40: - return DrvDips[0]; - - case 0x41: - return DrvDips[1]; - - case 0x42: - return 0xff; - - case 0x80: - case 0x81: - case 0x82: - return DrvInputs[port & 3]; - - case 0xc0: - case 0xc1: - case 0xc2: - case 0xc3: - return sound_to_main[port & 3]; - } - - return 0; -} - -void __fastcall main_to_sound_out_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - BurnYM2203Write(0, port & 1, data); - return; - - case 0x40: - case 0x41: - BurnYM2203Write(1, port & 1, data); - return; - - case 0x80: - case 0x81: - case 0x82: - case 0x83: - sound_to_main[port & 3] = data; - return; - } -} - -UINT8 __fastcall main_to_sound_in_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM2203Read(0, port & 1); - - case 0x40: - case 0x41: - return BurnYM2203Read(1, port & 1); - - case 0x80: - case 0x81: - case 0x82: - case 0x83: - return main_to_sound[port & 3]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - bankswitch(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - BurnYM2203Reset(); - - bgtopbank = 0; - bgbotbank = 0; - bgtopscroll = 0; - bgbotscroll = 0; - txbank = 0; - layer_ctrl = 0; - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x040000; - DrvZ80ROMDec = Next; Next += 0x00c000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x020000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - pTempDraw = (UINT16*)Next; Next += 240 * 256 * sizeof(UINT16); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x002000; - DrvBgtRAM = Next; Next += 0x000400; - DrvBgbRAM = Next; Next += 0x000400; - DrvTxtRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000100; - DrvPalRAM = Next; Next += 0x000400; - - DrvZ80RAM1 = Next; Next += 0x000800; - - sound_to_main = Next; Next += 0x000004; - main_to_sound = Next; Next += 0x000004; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *gfx, INT32 len) -{ - for (INT32 i = (len - 1); i >= 0; i--) { - gfx[i * 2 + 1] = gfx[i] & 0x0f; - gfx[i * 2 + 0] = gfx[i] >> 4; - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0x00000, 0x00004, 0x40000, 0x40004 }; - INT32 XOffs[16] = { 0x00000, 0x00001, 0x00002, 0x00003, 0x00008, 0x00009, 0x0000a, 0x0000b, - 0x00010, 0x00011, 0x00012, 0x00013, 0x00018, 0x00019, 0x0001a, 0x0001b }; - INT32 YOffs[16] = { 0x00000, 0x00020, 0x00040, 0x00060, 0x00080, 0x000a0, 0x000c0, 0x000e0, - 0x00100, 0x00120, 0x00140, 0x00160, 0x00180, 0x001a0, 0x001c0, 0x001e0 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x010000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM1, 0x10000); - - GfxDecode(0x0200, 4, 16, 16, Plane, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree (tmp); - - DrvGfxExpand(DrvGfxROM0, 0x08000); - DrvGfxExpand(DrvGfxROM2, 0x40000); - DrvGfxExpand(DrvGfxROM3, 0x40000); - - return 0; -} - -//----------------------------------------------------------------------------------------------------- -// space position -/* -static void sega_decode_2(UINT8 *rom, UINT8 *decrypted, - const UINT8 opcode_xor[64],const INT32 opcode_swap_select[64], - const UINT8 data_xor[64],const INT32 data_swap_select[64]) -{ - static const UINT8 swaptable[24][4] = - { - { 6,4,2,0 }, { 4,6,2,0 }, { 2,4,6,0 }, { 0,4,2,6 }, - { 6,2,4,0 }, { 6,0,2,4 }, { 6,4,0,2 }, { 2,6,4,0 }, - { 4,2,6,0 }, { 4,6,0,2 }, { 6,0,4,2 }, { 0,6,4,2 }, - { 4,0,6,2 }, { 0,4,6,2 }, { 6,2,0,4 }, { 2,6,0,4 }, - { 0,6,2,4 }, { 2,0,6,4 }, { 0,2,6,4 }, { 4,2,0,6 }, - { 2,4,0,6 }, { 4,0,2,6 }, { 2,0,4,6 }, { 0,2,4,6 }, - }; - - for (INT32 A = 0x0000;A < 0x8000;A++) - { - const UINT8 *tbl; - - INT32 src = rom[A]; - - // pick the translation table from bits 0, 3, 6, 9, 12 and 14 of the address - INT32 row = (A & 1) + (((A >> 3) & 1) << 1) + (((A >> 6) & 1) << 2) - + (((A >> 9) & 1) << 3) + (((A >> 12) & 1) << 4) + (((A >> 14) & 1) << 5); - - // decode opcodes - tbl = swaptable[opcode_swap_select[row]]; - decrypted[A] = BITSWAP08(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ opcode_xor[row]; - - // decode data - tbl = swaptable[data_swap_select[row]]; - rom[A] = BITSWAP08(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ data_xor[row]; - } -} - -static void sega_decode_317(UINT8 *src, UINT8 *dst, INT32 order, INT32 opcode_shift, INT32 data_shift) -{ - static const UINT8 xor1_317[1+64] = - { - 0x54, - 0x14,0x15,0x41,0x14,0x50,0x55,0x05,0x41,0x01,0x10,0x51,0x05,0x11,0x05,0x14,0x55, - 0x41,0x05,0x04,0x41,0x14,0x10,0x45,0x50,0x00,0x45,0x00,0x00,0x00,0x45,0x00,0x00, - 0x54,0x04,0x15,0x10,0x04,0x05,0x11,0x44,0x04,0x01,0x05,0x00,0x44,0x15,0x40,0x45, - 0x10,0x15,0x51,0x50,0x00,0x15,0x51,0x44,0x15,0x04,0x44,0x44,0x50,0x10,0x04,0x04, - }; - - static const UINT8 xor2_317[2+64] = - { - 0x04, - 0x44, - 0x15,0x51,0x41,0x10,0x15,0x54,0x04,0x51,0x05,0x55,0x05,0x54,0x45,0x04,0x10,0x01, - 0x51,0x55,0x45,0x55,0x45,0x04,0x55,0x40,0x11,0x15,0x01,0x40,0x01,0x11,0x45,0x44, - 0x40,0x05,0x15,0x15,0x01,0x50,0x00,0x44,0x04,0x50,0x51,0x45,0x50,0x54,0x41,0x40, - 0x14,0x40,0x50,0x45,0x10,0x05,0x50,0x01,0x40,0x01,0x50,0x50,0x50,0x44,0x40,0x10, - }; - - static const INT32 swap1_317[1+64] = - { - 7, - 1,11,23,17,23, 0,15,19, - 20,12,10, 0,18,18, 5,20, - 13, 0,18,14, 5, 6,10,21, - 1,11, 9, 3,21, 4, 1,17, - 5, 7,16,13,19,23,20, 2, - 10,23,23,15,10,12, 0,22, - 14, 6,15,11,17,15,21, 0, - 6, 1, 1,18, 5,15,15,20, - }; - - static const INT32 swap2_317[2+64] = - { - 7, - 12, - 18, 8,21, 0,22,21,13,21, - 20,13,20,14, 6, 3, 5,20, - 8,20, 4, 8,17,22, 0, 0, - 6,17,17, 9, 0,16,13,21, - 3, 2,18, 6,11, 3, 3,18, - 18,19, 3, 0, 5, 0,11, 8, - 8, 1, 7, 2,10, 8,10, 2, - 1, 3,12,16, 0,17,10, 1, - }; - - if (order) sega_decode_2(src, dst, xor2_317+opcode_shift, swap2_317+opcode_shift, xor1_317+data_shift, swap1_317+data_shift); - else sega_decode_2(src, dst, xor1_317+opcode_shift, swap1_317+opcode_shift, xor2_317+data_shift, swap2_317+data_shift); -}*/ - -// This is used in Sega System 1 (d_sys1.cpp) -void sega_decode_317(UINT8 *pDest, UINT8 *pDestDec, INT32 order, INT32 opcode_shift, INT32 data_shift); - -static void spcpostn_decode() -{ - sega_decode_317(DrvZ80ROM0, DrvZ80ROMDec, 0, 0, 1); -} - -//----------------------------------------------------------------------------------------------------- - -static INT32 DrvInit(INT32 game) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (game == 1) // angelkds - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - memcpy (DrvZ80ROMDec, DrvZ80ROM0, 0x08000); - - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x18000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x28000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 8, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x28000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x38000, 16, 1)) return 1; - - memcpy (DrvGfxROM3, DrvGfxROM2, 0x40000); // the data is the same in both gfx regions... - } - else // spcpostn - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - spcpostn_decode(); - - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x18000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x28000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x30000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x08000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x10000, 15, 1)) return 1; - } - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROMDec, DrvZ80ROM0); - ZetMapArea(0xc000, 0xdfff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xdfff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xdfff, 2, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe3ff, 0, DrvBgtRAM); - ZetMapArea(0xe000, 0xe3ff, 1, DrvBgtRAM); - ZetMapArea(0xe000, 0xe3ff, 2, DrvBgtRAM); - ZetMapArea(0xe400, 0xe7ff, 0, DrvBgbRAM); - ZetMapArea(0xe400, 0xe7ff, 1, DrvBgbRAM); - ZetMapArea(0xe400, 0xe7ff, 2, DrvBgbRAM); - ZetMapArea(0xe800, 0xebff, 0, DrvTxtRAM); - ZetMapArea(0xe800, 0xebff, 1, DrvTxtRAM); - ZetMapArea(0xe800, 0xebff, 2, DrvTxtRAM); - ZetMapArea(0xec00, 0xecff, 0, DrvSprRAM); - ZetMapArea(0xec00, 0xecff, 1, DrvSprRAM); - ZetMapArea(0xec00, 0xecff, 2, DrvSprRAM); - ZetMapArea(0xed00, 0xefff, 0, DrvPalRAM); - ZetMapArea(0xed00, 0xefff, 1, DrvPalRAM); - ZetMapArea(0xed00, 0xefff, 2, DrvPalRAM); - ZetSetWriteHandler(angelkds_write); - ZetSetOutHandler(angelkds_out_port); - ZetSetInHandler(angelkds_in_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); - ZetSetOutHandler(main_to_sound_out_port); - ZetSetInHandler(main_to_sound_in_port); - ZetClose(); - - BurnYM2203Init(2, 4000000, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.45, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.65, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.65, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.65, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.45, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.65, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.65, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.65, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM2203Exit(); - GenericTilesExit(); - - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteRecalc() -{ - UINT8 r,g,b; - for (INT32 i = 0; i < 0x100; i++) { - r = DrvPalRAM[i + 0x000] & 0x0f; - g = DrvPalRAM[i + 0x000] >> 4; - b = DrvPalRAM[i + 0x100] & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_sprites(UINT16 *dest, INT32 enable) -{ - for (INT32 offs = 0x100 - 4; offs >= 0; offs-=4) - { - INT32 attr = DrvSprRAM[offs + 1]; - INT32 sy = DrvSprRAM[offs + 2] ^ 0xff; - INT32 sx = DrvSprRAM[offs + 3]; - INT32 code = DrvSprRAM[offs + 0] + ((attr & 0x08) << 5); - - INT32 color = ((attr & 0x03) << 2) + 0x02; - INT32 flipx = attr & 0x10; - INT32 flipy = attr & 0x20; - - if (attr & enable) - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(dest, code, sx, sy - 8, color, 4, 15, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(dest, code, sx, sy - 8, color, 4, 15, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(dest, code, sx, sy - 8, color, 4, 15, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(dest, code, sx, sy - 8, color, 4, 15, 0, DrvGfxROM1); - } - } - } - } -} - -static void draw_layer(UINT16 *dest, UINT8 *ram, UINT8 *gfx, INT32 bank, INT32 coloffs, INT32 scrollx, INT32 trans) -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = ((offs >> 5) << 3) - 8; - - sx -= scrollx; - if (sx < -7) sx += 0x100; - - INT32 code = ram[offs] | (bank << 8); - INT32 color = coloffs; - - Render8x8Tile_Mask_Clip(dest, code, sx, sy, color, 4, trans, 0, gfx); - if (sx < 0) Render8x8Tile_Mask_Clip(dest, code, sx + 256, sy, color, 4, trans, 0, gfx); - } -} - -static INT32 DrvDraw() -{ - DrvPaletteRecalc(); - - // top half - x = 0 -> 127 - { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) pTransDraw[i] = 0x003f; - - if (~layer_ctrl & 0x80) draw_layer(pTransDraw, DrvBgtRAM, DrvGfxROM2, bgtopbank, 0, bgtopscroll, 15); - - draw_sprites(pTransDraw, 0x80); - - if (~layer_ctrl & 0x20) draw_layer(pTransDraw, DrvTxtRAM, DrvGfxROM0, txbank, 3, 0, 0); - } - - // bottom half - x = 128 -> 256 - { - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) pTempDraw[i] = 0x003f; - - if (~layer_ctrl & 0x40) draw_layer(pTempDraw, DrvBgbRAM, DrvGfxROM3, bgbotbank, 0, bgbotscroll, 15); - - draw_sprites(pTempDraw, 0x40); - - if (~layer_ctrl & 0x20) draw_layer(pTempDraw, DrvTxtRAM, DrvGfxROM0, txbank, 3, 0, 0); - } - - // copy bottom half into place - { - UINT16 *source = pTempDraw + 128; - UINT16 *dest = pTransDraw + 128; - for (INT32 y = 0; y < nScreenHeight; y++) { - memcpy (dest, source, 128 * sizeof(UINT16)); - dest += 256, source += 256; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[0] = (DrvInputs[0] & 0x7f) | (DrvDips[2] & 0x80); - } - - INT32 nSegment; - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 8000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(1); - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(bgtopbank); - SCAN_VAR(bgbotbank); - SCAN_VAR(bgtopscroll); - SCAN_VAR(bgbotscroll); - SCAN_VAR(txbank); - SCAN_VAR(layer_ctrl); - - SCAN_VAR(DrvZ80Bank0); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(DrvZ80Bank0); - ZetClose(); - } - } - - return 0; -} - - -// Angel Kids (Japan) - -static struct BurnRomInfo angelkdsRomDesc[] = { - { "11428.c10", 0x8000, 0x90daacd2, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "11424.c1", 0x8000, 0xb55997f6, 1 | BRF_PRG | BRF_ESS }, // 1 - { "11425.c2", 0x8000, 0x299359de, 1 | BRF_PRG | BRF_ESS }, // 2 - { "11426.c3", 0x8000, 0x5fad8bd3, 1 | BRF_PRG | BRF_ESS }, // 3 - { "11427.c4", 0x8000, 0xef920c74, 1 | BRF_PRG | BRF_ESS }, // 4 - - { "11429.d4", 0x8000, 0x0ca50a66, 2 | BRF_PRG | BRF_ESS }, // 5 Z80 #1 Code - - { "11446", 0x8000, 0x45052470, 3 | BRF_GRA }, // 6 Text Tiles - - { "11448.h7", 0x8000, 0x05dab626, 4 | BRF_GRA }, // 7 Sprites - { "11447.f7", 0x8000, 0xb3afc5b3, 4 | BRF_GRA }, // 8 - - { "11437", 0x8000, 0xa520b628, 5 | BRF_GRA }, // 9 Background (Top) Tiles - { "11436", 0x8000, 0x469ab216, 5 | BRF_GRA }, // 10 - { "11435", 0x8000, 0xb0f8c245, 5 | BRF_GRA }, // 11 - { "11434", 0x8000, 0xcbde81f5, 5 | BRF_GRA }, // 12 - { "11433", 0x8000, 0xb63fa414, 5 | BRF_GRA }, // 13 - { "11432", 0x8000, 0x00dc747b, 5 | BRF_GRA }, // 14 - { "11431", 0x8000, 0xac2025af, 5 | BRF_GRA }, // 15 - { "11430", 0x8000, 0xd640f89e, 5 | BRF_GRA }, // 16 - - { "11445", 0x8000, 0xa520b628, 6 | BRF_GRA }, // 17 Background (Bottom) Tiles - { "11444", 0x8000, 0x469ab216, 6 | BRF_GRA }, // 18 - { "11443", 0x8000, 0xb0f8c245, 6 | BRF_GRA }, // 19 - { "11442", 0x8000, 0xcbde81f5, 6 | BRF_GRA }, // 20 - { "11441", 0x8000, 0xb63fa414, 6 | BRF_GRA }, // 21 - { "11440", 0x8000, 0x00dc747b, 6 | BRF_GRA }, // 22 - { "11439", 0x8000, 0xac2025af, 6 | BRF_GRA }, // 23 - { "11438", 0x8000, 0xd640f89e, 6 | BRF_GRA }, // 24 - - { "63s081n.u5", 0x0020, 0x36b98627, 7 | BRF_OPT }, // 25 PROM -}; - -STD_ROM_PICK(angelkds) -STD_ROM_FN(angelkds) - -static INT32 angelkdsInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvAngelkds = { - "angelkds", NULL, NULL, NULL, "1988", - "Angel Kids (Japan)\0", NULL, "Sega / Nasco?", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, angelkdsRomInfo, angelkdsRomName, NULL, NULL, AngelkdsInputInfo, AngelkdsDIPInfo, - angelkdsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x100, - 240, 256, 3, 4 -}; - - -// Space Position (Japan) - -static struct BurnRomInfo spcpostnRomDesc[] = { - { "epr10125.c10", 0x8000, 0xbffd38c6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "epr10120.c1", 0x8000, 0xd6399f99, 1 | BRF_PRG | BRF_ESS }, // 1 - { "epr10121.c2", 0x8000, 0xd4861560, 1 | BRF_PRG | BRF_ESS }, // 2 - { "epr10122.c3", 0x8000, 0x7a1bff1b, 1 | BRF_PRG | BRF_ESS }, // 3 - { "epr10123.c4", 0x8000, 0x6aed2925, 1 | BRF_PRG | BRF_ESS }, // 4 - { "epr10124.c5", 0x8000, 0xa1d7ae6b, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "epr10126.d4", 0x8000, 0xab17f852, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 #1 Code - - { "epr10133.17", 0x8000, 0x642e6609, 3 | BRF_GRA }, // 7 Text Tiles - - { "epr10135.19", 0x8000, 0x0685c4fa, 4 | BRF_GRA }, // 8 Sprites - { "epr10134.18", 0x8000, 0xc674ff88, 4 | BRF_GRA }, // 9 - - { "epr10132.16", 0x8000, 0x2df8b1bd, 5 | BRF_GRA }, // 10 Background (Top) Tiles - { "epr10131.15", 0x8000, 0xde223817, 5 | BRF_GRA }, // 11 - { "epr10130.14", 0x8000, 0xb68fcb36, 5 | BRF_GRA }, // 12 - - { "epr10129.08", 0x8000, 0xa6f21023, 6 | BRF_GRA }, // 13 Background (Bottom) Tiles - { "epr10128.07", 0x8000, 0xde223817, 6 | BRF_GRA }, // 14 - { "epr10127.06", 0x8000, 0xb68fcb36, 6 | BRF_GRA }, // 15 - - { "63s081n.u5", 0x0020, 0x36b98627, 0 | BRF_OPT }, // 16 PROM -}; - -STD_ROM_PICK(spcpostn) -STD_ROM_FN(spcpostn) - -static INT32 spcpostnInit() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvSpcpostn = { - "spcpostn", NULL, NULL, NULL, "1986", - "Space Position (Japan)\0", NULL, "Sega / Nasco", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_SEGA_MISC, GBF_RACING, 0, - NULL, spcpostnRomInfo, spcpostnRomName, NULL, NULL, SpcpostnInputInfo, SpcpostnDIPInfo, - spcpostnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x100, - 240, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/sega/d_appoooh.cpp b/jan/src/burn/drv/sega/d_appoooh.cpp deleted file mode 100644 index 8d7463da5..000000000 --- a/jan/src/burn/drv/sega/d_appoooh.cpp +++ /dev/null @@ -1,1013 +0,0 @@ -// FB Alpha Appoooh driver module by vbt -// Based on MAME driver by Tatsuyuki Satoh - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "msm5205.h" -#include "bitswap.h" - -static INT32 DrvZ80Bank0; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDip[2]; -static UINT8 DrvReset; -static UINT8 DrvRecalc; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvRAM0; -static UINT8 *DrvRAM1; -static UINT8 *DrvRAM2; -static UINT8 *DrvFgVidRAM; -static UINT8 *DrvBgVidRAM; -static UINT8 *DrvSprRAM0; -static UINT8 *DrvSprRAM1; -static UINT8 *DrvFgColRAM; -static UINT8 *DrvBgColRAM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxTMP0; -static UINT8 *DrvGfxTMP1; -static UINT8 *DrvColPROM; -static UINT8 *DrvMainROM; -static UINT8 *DrvSoundROM; -static UINT8 *DrvFetch; -static UINT32 *DrvPalette; - -static UINT8 scroll_x; -static UINT8 flipscreen; -static UINT8 priority; -static UINT8 interrupt_enable; -static UINT32 adpcm_data; -static UINT32 adpcm_address; - -static INT32 nCyclesTotal; - -static INT32 game_select; // 1 = robowres - -static struct BurnInputInfo AppooohInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy2 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 0, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, -}; - -STDINPUTINFO(Appoooh) - - -static struct BurnDIPInfo AppooohDIPList[]= -{ - {0x13, 0xff, 0xff, 0x60, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x03, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x18, 0x18, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x18, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x18, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x40, 0x40, "Upright" }, - {0x13, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x80, 0x00, "Easy" }, - {0x13, 0x01, 0x80, 0x80, "Hard" }, -}; - -STDDIPINFO(Appoooh) - -static struct BurnDIPInfo RobowresDIPList[]= -{ - {0x13, 0xff, 0xff, 0xe0, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x07, 0x03, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x01, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x07, 0x07, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x07, 0x04, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0x18, 0x18, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x18, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x18, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, // unused - {0x13, 0x01, 0x40, 0x40, "Upright" }, // unused - {0x13, 0x01, 0x40, 0x00, "Cocktail" }, // unused - - {0 , 0xfe, 0 , 0, "Language" }, - {0x13, 0x01, 0x80, 0x00, "Japanese" }, - {0x13, 0x01, 0x80, 0x80, "English" }, -}; - -STDDIPINFO(Robowres) - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x220; i++) - { - INT32 bit0,bit1,bit2,r,g,b; - UINT8 pen; - - if (i < 0x100) - pen = (DrvColPROM[0x020 + (i - 0x000)] & 0x0f) | 0x00; - else - pen = (DrvColPROM[0x120 + (i - 0x100)] & 0x0f) | 0x10; - - bit0 = (DrvColPROM[pen] >> 0) & 0x01; - bit1 = (DrvColPROM[pen] >> 1) & 0x01; - bit2 = (DrvColPROM[pen] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[pen] >> 3) & 0x01; - bit1 = (DrvColPROM[pen] >> 4) & 0x01; - bit2 = (DrvColPROM[pen] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[pen] >> 6) & 0x01; - bit2 = (DrvColPROM[pen] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void DrvRobowresPaletteInit() -{ - for (INT32 i = 0; i < 0x220; i++) - { - INT32 bit0, bit1, bit2, r, g, b; - - UINT8 pen = DrvColPROM[0x020 + i] & 0x0f; - - bit0 = (DrvColPROM[pen] >> 0) & 0x01; - bit1 = (DrvColPROM[pen] >> 1) & 0x01; - bit2 = (DrvColPROM[pen] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[pen] >> 3) & 0x01; - bit1 = (DrvColPROM[pen] >> 4) & 0x01; - bit2 = (DrvColPROM[pen] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[pen] >> 6) & 0x01; - bit2 = (DrvColPROM[pen] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x24000; - DrvFetch = Next; Next += 0x24000; - - AllRam = Next; - DrvRAM0 = Next; Next += 0x800; - DrvRAM1 = Next; Next += 0x800; - DrvRAM2 = Next; Next += 0x1000; - DrvSprRAM0 = Next; Next += 0x800; - DrvFgVidRAM = Next; Next += 0x800; - DrvFgColRAM = Next; Next += 0x800; - DrvSprRAM1 = Next; Next += 0x800; - DrvBgVidRAM = Next; Next += 0x800; - DrvBgColRAM = Next; Next += 0x800; - RamEnd = Next; - - DrvColPROM = Next; Next += 0x00220; - DrvSoundROM = Next; Next += 0x0a000; - DrvPalette = (UINT32*)Next; Next += 0x00220 * sizeof(UINT32); - - DrvGfxTMP0 = Next; Next += 0x18000; - DrvGfxTMP1 = Next; Next += 0x18000; - DrvGfxROM0 = Next; Next += 0x40000; - DrvGfxROM1 = Next; Next += 0x40000; - DrvGfxROM2 = Next; Next += 0x40000; - DrvGfxROM3 = Next; Next += 0x40000; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode() -{ - INT32 Planes0[3] = { 2*2048*8*8, 1*2048*8*8, 0*2048*8*8 }; - INT32 XOffs0[8] = { 7, 6, 5, 4, 3, 2, 1, 0 }; - INT32 YOffs0[8] = { STEP8(0, 8) }; - - GfxDecode(0x0800, 3, 8, 8, Planes0, XOffs0, YOffs0, 0x040, DrvGfxTMP0, DrvGfxROM0); - GfxDecode(0x0800, 3, 8, 8, Planes0, XOffs0, YOffs0, 0x040, DrvGfxTMP1, DrvGfxROM1); - - INT32 Planes1[3] = { 2*2048*8*8, 1*2048*8*8, 0*2048*8*8 }; - INT32 XOffs1[16] = { 7, 6, 5, 4, 3, 2, 1, 0 , 8*8+7, 8*8+6, 8*8+5, 8*8+4, 8*8+3, 8*8+2, 8*8+1, 8*8+0 }; - INT32 YOffs1[16] = { STEP8(0, 8), 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }; - - GfxDecode(0x0200, 3, 16, 16, Planes1, XOffs1, YOffs1, 0x100, DrvGfxTMP0, DrvGfxROM2); - GfxDecode(0x0200, 3, 16, 16, Planes1, XOffs1, YOffs1, 0x100, DrvGfxTMP1, DrvGfxROM3); -} - -static void DrvRobowresGfxDecode() -{ - INT32 Planes0[3] = { RGN_FRAC(0x18000, 2,3), RGN_FRAC(0x18000, 1,3), RGN_FRAC(0x18000, 0,3) }; - INT32 XOffs0[8] = { 7, 6, 5, 4, 3, 2, 1, 0 }; - INT32 YOffs0[8] = { STEP8(0, 8) }; - - GfxDecode(0x1000, 3, 8, 8, Planes0, XOffs0, YOffs0, 0x040, DrvGfxTMP0, DrvGfxROM0); - GfxDecode(0x1000, 3, 8, 8, Planes0, XOffs0, YOffs0, 0x040, DrvGfxTMP1, DrvGfxROM1); - - INT32 Planes1[3] = { RGN_FRAC(0x18000, 2,3),RGN_FRAC(0x18000, 1,3),RGN_FRAC(0x18000, 0,3) }; - INT32 XOffs1[16] = { 7, 6, 5, 4, 3, 2, 1, 0, 8*8+7, 8*8+6, 8*8+5, 8*8+4, 8*8+3, 8*8+2, 8*8+1, 8*8+0 }; - INT32 YOffs1[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }; - - GfxDecode(0x0400, 3, 16, 16, Planes1, XOffs1, YOffs1, 0x100, DrvGfxTMP0, DrvGfxROM2); - GfxDecode(0x0400, 3, 16, 16, Planes1, XOffs1, YOffs1, 0x100, DrvGfxTMP1, DrvGfxROM3); -} - -static void bankswitch(INT32 data) -{ - DrvZ80Bank0 = (data & 0x40); - - ZetMapMemory(DrvMainROM + (DrvZ80Bank0 ? 0x10000 : 0xa000), 0xa000, 0xdfff, MAP_ROM); -} - -static void __fastcall appoooh_write(unsigned short address, unsigned char data) -{ - if(address >= 0xf000 && address <= 0xf01f) - { - DrvSprRAM0[address-0xf000] = data; - return; - } - - if(address >= 0xf020 && address <= 0xf41f/*0xf3ff*/) - { - DrvFgVidRAM[address-0xf020] = data; - return; - } - - if(address >= 0xf420 && address <= 0xf7ff) - { - DrvFgColRAM[address-0xf420] = data; - return; - } - - if(address >= 0xf800 && address <= 0xf81f) - { - DrvSprRAM1[address-0xf800] = data; - return; - } - - if(address >= 0xf820 && address <= 0xfc1f/*0xfbff*/) - { - DrvBgVidRAM[address-0xf820] = data; - return; - } - - if(address >= 0xfc20/* && address <= 0xffff*/) - { - DrvBgColRAM[address-0xfc20] = data; - return; - } - - bprintf(0, _T("wb adr %X data %X.\n"), address, data); -} - -static unsigned char __fastcall appoooh_read(unsigned short address) -{ - if(address >= 0xf000 && address <= 0xf01f) - { - return DrvSprRAM0[address-0xf000]; - } - - if(address >= 0xf020 && address <= 0xf41f/*0xf3ff*/) - { - return DrvFgVidRAM[address-0xf020]; - } - - if(address >= 0xf420 && address <= 0xf7ff) - { - return DrvFgColRAM[address-0xf420]; - } - - if(address >= 0xf800 && address <= 0xf81f) - { - return DrvSprRAM1[address-0xf800]; - } - - if(address >= 0xf820 && address <= 0xfc1f/*0xfbff*/) - { - return DrvBgVidRAM[address-0xf820]; - } - - if(address >= 0xfc20/* && address <= 0xffff*/) - { - return DrvBgColRAM[address-0xfc20]; - } - - bprintf(0, _T("rb adr %X.\n"), address); - - return 0; -} - -inline static INT32 DrvMSM5205SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate / nCyclesTotal); -} - -static void appoooh_adpcm_w( UINT8 data ) -{ - adpcm_address = data << 8; - - MSM5205ResetWrite(0, 0); - adpcm_data = 0xffffffff; -} - -static void appoooh_out_w( UINT8 data ) -{ - interrupt_enable = (data & 0x01); - - if ((data & 0x02) != flipscreen) { - flipscreen = data & 0x02; - } - - priority = (data & 0x30) >> 4; - - bankswitch(data); -} - -static void DrvMSM5205Int() -{ - if (adpcm_address != 0xffffffff) { - if (adpcm_data == 0xffffffff) { - adpcm_data = DrvSoundROM[adpcm_address++]; - - MSM5205DataWrite(0, adpcm_data >> 4); - MSM5205VCLKWrite(0, 1); - MSM5205VCLKWrite(0, 0); - - if (adpcm_data == 0x70) { - adpcm_address = 0xffffffff; - MSM5205ResetWrite(0, 1); - } - } else { - MSM5205DataWrite(0, adpcm_data & 0x0f); - MSM5205VCLKWrite(0, 1); - MSM5205VCLKWrite(0, 0); - adpcm_data = (UINT32)-1; - } - } -} - - -UINT8 __fastcall appoooh_in(UINT16 address) -{ - UINT8 ret = 0; - - switch (address & 0xff) - { - case 0x00: - { - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy1[i] << i; - return ret; - } - - case 0x01: - { - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy2[i] << i; - return ret; - } - - case 0x03: - { - return DrvDip[0]; - } - - case 0x04: - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy3[i] << i; - return ret; - } - - return 0; -} - -void __fastcall appoooh_out(UINT16 address, UINT8 data) -{ - switch (address & 0xff) - { - case 0x00: - SN76496Write(0, data); - break; - - case 0x01: - SN76496Write(1, data); - break; - - case 0x02: - SN76496Write(2, data); - break; - - case 0x03: - appoooh_adpcm_w(data); - break; - - case 0x04: - appoooh_out_w(data); - break; - - case 0x05: - scroll_x = data; // not used. - break; - } -} - -static void DrawSprites(UINT8 *sprite, UINT8 *gfx, UINT32 offset) -{ - INT32 flipy = 0; - - for (INT32 offs = 0x20 - 4; offs >= 0; offs -= 4) { - INT32 sy = 240 - sprite[offs + 0]; - INT32 code = (sprite[offs + 1] >> 2) + ((sprite[offs + 2] >> 5) & 0x07) * 0x40; - if (game_select == 1) - code = 0x200 + (sprite[offs + 1] >> 2) + ((sprite[offs + 2] >> 5) & 0x07) * 0x40; - INT32 color = sprite[offs + 2] & 0x0f; - INT32 sx = sprite[offs + 3]; - INT32 flipx = sprite[offs + 1] & 0x01; - - if(sx >= 248) - sx -= 256; - - if (flipy) - { - sx = 239 - sx; - sy = 239 - sy; - flipx = !flipx; - } - - sy -= 8; - - if(flipx) - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3/* 3 bits*/, 0, offset, gfx); - else - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3/* 3 bits*/, 0, offset, gfx); - } -} - -static INT32 DrawBgTiles() -{ - for (INT32 offs = 0x3e0 - 1; offs >= 0; offs--) { - INT32 sx = offs % 32; - INT32 sy = offs / 32; - INT32 code = DrvBgVidRAM[offs] + 256 * ((DrvBgColRAM[offs]>>5) & 0x07); - INT32 color = DrvBgColRAM[offs] & 0x0f; - INT32 flipx = DrvBgColRAM[offs] & 0x10; - - if (flipscreen) { - sx = 31 - sx; - sy = 31 - sy; - flipx = !flipx; - } - - sx *= 8; - sy = (sy * 8) - 8; - - if(flipx) - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0x100, DrvGfxROM1); - else - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0x100, DrvGfxROM1); - } - - return 0; -} - -static INT32 DrawFgTiles() -{ - for (INT32 offs = 0x3e0 - 1; offs >= 0; offs--) { - INT32 sx = offs % 32; - INT32 sy = offs / 32; - INT32 code = DrvFgVidRAM[offs] + 256 * ((DrvFgColRAM[offs]>>5) & 7); - code &= 0x7ff; - INT32 color = DrvFgColRAM[offs] & 0x0f; - INT32 flipx = DrvFgColRAM[offs] & 0x10; - - if (flipscreen) { - sx = 31 - sx; - sy = 31 - sy; - flipx = !flipx; - } - - sx *= 8; - sy = (sy * 8) - 8; - - if(flipx) - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - else - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM0); - } - - return 0; -} - - - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - if (!game_select) { - DrvPaletteInit(); // appoooh - } else { - DrvRobowresPaletteInit(); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (nBurnLayer & 1) DrawBgTiles(); - - if (priority == 0) - if (nBurnLayer & 2) DrawFgTiles(); - - if (priority) { - if (nSpriteEnable & 1) DrawSprites(DrvSprRAM0, DrvGfxROM2, 0); - if (nSpriteEnable & 2) DrawSprites(DrvSprRAM1, DrvGfxROM3, 0x100); - } else { - if (nSpriteEnable & 2) DrawSprites(DrvSprRAM1, DrvGfxROM3, 0x100); - if (nSpriteEnable & 1) DrawSprites(DrvSprRAM0, DrvGfxROM2, 0); - } - - if (priority != 0) - if (nBurnLayer & 2) DrawFgTiles(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - DrvZ80Bank0 = 0; - scroll_x = 0; - flipscreen = 0; - adpcm_address = 0xffffffff; - adpcm_data = 0; - MSM5205Reset(); - - ZetOpen(0); - ZetReset(); - bankswitch(0); - ZetClose(); - - return 0; -} - -static INT32 DrvLoadRoms() -{ - for (INT32 i = 0; i < 5; i++) - if (BurnLoadRom(DrvMainROM + i * 0x2000, i + 0, 1)) return 1; - - if (BurnLoadRom(DrvMainROM + 0x0a000, 5, 1)) return 1; // epr-5911.bin - if (BurnLoadRom(DrvMainROM + 0x0c000, 6, 1)) return 1; // epr-5913.bin - - if (BurnLoadRom(DrvMainROM + 0x10000, 7, 1)) return 1; // epr-5912.bin - if (BurnLoadRom(DrvMainROM + 0x12000, 8, 1)) return 1; // epr-5914.bin - - if (BurnLoadRom(DrvGfxTMP0 + 0x00000, 9, 1)) return 1; // epr-5895.bin - if (BurnLoadRom(DrvGfxTMP0 + 0x04000, 10, 1)) return 1; // epr-5896.bin - if (BurnLoadRom(DrvGfxTMP0 + 0x08000, 11, 1)) return 1; // epr-5897.bin - - if (BurnLoadRom(DrvGfxTMP1 + 0x00000, 12, 1)) return 1; // epr-5898.bin - if (BurnLoadRom(DrvGfxTMP1 + 0x04000, 13, 1)) return 1; // epr-5899.bin - if (BurnLoadRom(DrvGfxTMP1 + 0x08000, 14, 1)) return 1; // epr-5900.bin - - if (BurnLoadRom(DrvColPROM + 0x0000, 15, 1)) return 1; // pr5921.prm - if (BurnLoadRom(DrvColPROM + 0x0020, 16, 1)) return 1; // pr5922.prm - if (BurnLoadRom(DrvColPROM + 0x0120, 17, 1)) return 1; // pr5923.prm - - if (BurnLoadRom(DrvSoundROM + 0x0000, 18, 1)) return 1; // epr-5901.bin - if (BurnLoadRom(DrvSoundROM + 0x2000, 19, 1)) return 1; // epr-5902.bin - if (BurnLoadRom(DrvSoundROM + 0x4000, 20, 1)) return 1; // epr-5903.bin - if (BurnLoadRom(DrvSoundROM + 0x6000, 21, 1)) return 1; // epr-5904.bin - if (BurnLoadRom(DrvSoundROM + 0x8000, 22, 1)) return 1; // epr-5905.bin - - return 0; -} - -static INT32 DrvRobowresLoadRoms() -{ - if (BurnLoadRom(DrvMainROM + 0x00000, 0, 1)) return 1; //epr-7540.13d - if (BurnLoadRom(DrvMainROM + 0x08000, 1, 1)) return 1; //epr-7541.14d - if (BurnLoadRom(DrvMainROM + 0x14000, 2, 1)) return 1; //epr-7542.15d - memset(DrvMainROM + 0x0e000, 0, 0x2000); // right?? -dink - - memcpy (DrvMainROM + 0x10000, DrvMainROM + 0x16000, 0x4000); - - if (BurnLoadRom(DrvGfxTMP0 + 0x00000, 3, 1)) return 1; // epr-7544.7h - if (BurnLoadRom(DrvGfxTMP0 + 0x08000, 4, 1)) return 1; // epr-7545.6h - if (BurnLoadRom(DrvGfxTMP0 + 0x10000, 5, 1)) return 1; // epr-7546.5h - - if (BurnLoadRom(DrvGfxTMP1 + 0x00000, 6, 1)) return 1; // epr-7547.7d - if (BurnLoadRom(DrvGfxTMP1 + 0x08000, 7, 1)) return 1; // epr-7548.6d - if (BurnLoadRom(DrvGfxTMP1 + 0x10000, 8, 1)) return 1; // epr-7549.5d - - if (BurnLoadRom(DrvColPROM + 0x0000, 9, 1)) return 1; // pr7571.10a - if (BurnLoadRom(DrvColPROM + 0x0020, 10, 1)) return 1; // pr7572.7f - if (BurnLoadRom(DrvColPROM + 0x0120, 11, 1)) return 1; // pr7573.7g - - if (BurnLoadRom(DrvSoundROM + 0x0000, 12, 1)) return 1; // epr-7543.12b - - - return 0; -} - -static INT32 DrvCommonInit() -{ - nCyclesTotal = 3072000; - - ZetInit(0); - ZetOpen(0); - - ZetMapMemory(DrvMainROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvMainROM + 0x8000, 0x8000, 0x9fff, MAP_ROM); - - bankswitch(0); - - if (game_select == 1) { // map decoded fetch for robowres - ZetMapArea(0x0000, 0x7fff, 2, DrvFetch, DrvMainROM); - } - - ZetMapMemory(DrvRAM0 , 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvRAM1 , 0xe800, 0xefff, MAP_RAM); - - ZetSetWriteHandler(appoooh_write); - ZetSetReadHandler(appoooh_read); - ZetSetInHandler(appoooh_in); - ZetSetOutHandler(appoooh_out); - - ZetClose(); - SN76489Init(0, 18432000 / 6, 0); - SN76489Init(1, 18432000 / 6, 1); - SN76489Init(2, 18432000 / 6, 1); - SN76496SetRoute(0, 0.30, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.30, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(2, 0.30, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, DrvMSM5205SynchroniseStream, 384000, DrvMSM5205Int, MSM5205_S64_4B, 1); - MSM5205SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - return 0; -} - -static void sega_decode_2(UINT8 */*pDest*/, UINT8 */*pDestDec*/, const UINT8 xor_table[128],const int swap_table[128]) -{ - int A; - UINT8 swaptable[24][4] = - { - { 6,4,2,0 }, { 4,6,2,0 }, { 2,4,6,0 }, { 0,4,2,6 }, - { 6,2,4,0 }, { 6,0,2,4 }, { 6,4,0,2 }, { 2,6,4,0 }, - { 4,2,6,0 }, { 4,6,0,2 }, { 6,0,4,2 }, { 0,6,4,2 }, - { 4,0,6,2 }, { 0,4,6,2 }, { 6,2,0,4 }, { 2,6,0,4 }, - { 0,6,2,4 }, { 2,0,6,4 }, { 0,2,6,4 }, { 4,2,0,6 }, - { 2,4,0,6 }, { 4,0,2,6 }, { 2,0,4,6 }, { 0,2,4,6 }, - }; - - UINT8 *rom = DrvMainROM; - UINT8 *decrypted = DrvFetch; - - for (A = 0x0000;A < 0x8000;A++) - { - int row; - UINT8 src; - const UINT8 *tbl; - - - src = rom[A]; - - /* pick the translation table from bits 0, 3, 6, 9, 12 and 14 of the address */ - row = (A & 1) + (((A >> 3) & 1) << 1) + (((A >> 6) & 1) << 2) - + (((A >> 9) & 1) << 3) + (((A >> 12) & 1) << 4) + (((A >> 14) & 1) << 5); - - /* decode the opcodes */ - tbl = swaptable[swap_table[2*row]]; - decrypted[A] = BITSWAP08(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ xor_table[2*row]; - - /* decode the data */ - tbl = swaptable[swap_table[2*row+1]]; - rom[A] = BITSWAP08(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ xor_table[2*row+1]; - } -} - -void sega_decode_315(UINT8 *pDest, UINT8 *pDestDec) -{ - static const UINT8 xor_table[128] = - { - 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04,0x40,0x45,0x11,0x14,0x50, - 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04, - 0x00,0x45,0x41,0x14,0x10,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50, - 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x01,0x04, - 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x04, - 0x00,0x45,0x41,0x14,0x50, - 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04, - 0x00,0x45,0x41,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50, - 0x00,0x05,0x41,0x44,0x10,0x55,0x51,0x01,0x04, - 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x51,0x54,0x04, - 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04, - 0x40,0x45,0x11,0x54,0x50,0x00,0x05,0x41, - }; - - static const int swap_table[128] = - { - 8, 9,11,13,15, 0, 2, 4, 6, - 8, 9,11,13,15, 1, 2, 4, 6, - 8, 9,11,13,15, 1, 2, 4, 6, - 8, 9,11,13,15, 1, 2, 4, 6, - 8,10,11,13,15, 1, 2, 4, 6, - 8,10,11,13,15, 1, 2, 4, 6, - 8,10,11,13,15, 1, 3, 4, 6, - 8, - 7, 1, 2, 4, 6, 0, 1, 3, 5, - 7, 1, 2, 4, 6, 0, 1, 3, 5, - 7, 1, 2, 4, 6, 0, 2, 3, 5, - 7, 1, 2, 4, 6, 0, 2, 3, 5, - 7, 1, 2, 4, 6, 0, 2, 3, 5, - 7, 1, 3, 4, 6, 0, 2, 3, 5, - 7, 1, 3, 4, 6, 0, 2, 4, 5, - 7, - }; - sega_decode_2(pDest, pDestDec, xor_table, swap_table); -} - -static INT32 DrvRobowresInit() -{ - game_select = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvRobowresLoadRoms()) return 1; - sega_decode_315( DrvMainROM, DrvFetch ); - - DrvRobowresPaletteInit(); - DrvRobowresGfxDecode(); - DrvCommonInit(); - - return 0; -} - -static INT32 DrvInit() -{ - game_select = 0; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvLoadRoms()) return 1; - - DrvPaletteInit(); - DrvGfxDecode(); - DrvCommonInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - - SN76496Exit(); - MSM5205Exit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInputs, 0x00, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - - } -// INT32 nInterleave = 256; - INT32 nInterleave = MSM5205CalcInterleave(0, nCyclesTotal); - ZetNewFrame(); - - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - ZetRun(nCyclesTotal / 60 / nInterleave); - if (interrupt_enable && i == (nInterleave - 1)) - ZetNmi(); - - MSM5205Update(); - } - - if (pBurnSoundOut) - { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - SN76496Update(2, pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - - ZetScan(nAction); - - SN76496Scan(nAction, pnMin); - - MSM5205Scan(nAction, pnMin); - - SCAN_VAR(priority); - SCAN_VAR(interrupt_enable); - SCAN_VAR(flipscreen); - SCAN_VAR(DrvZ80Bank0); - SCAN_VAR(scroll_x); - SCAN_VAR(adpcm_address); - SCAN_VAR(adpcm_data); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(DrvZ80Bank0); - ZetClose(); - } - } - return 0; -} - - -// Appoooh - -static struct BurnRomInfo appooohRomDesc[] = { - { "epr-5906.bin", 0x2000, 0xfffae7fe, 1 }, // 0 maincpu - { "epr-5907.bin", 0x2000, 0x57696cd6, 1 }, // 1 - { "epr-5908.bin", 0x2000, 0x4537cddc, 1 }, // 2 - { "epr-5909.bin", 0x2000, 0xcf82718d, 1 }, // 3 - { "epr-5910.bin", 0x2000, 0x312636da, 1 }, // 4 - { "epr-5911.bin", 0x2000, 0x0bc2acaa, 1 }, // 5 - { "epr-5913.bin", 0x2000, 0xf5a0e6a7, 1 }, // 6 - { "epr-5912.bin", 0x2000, 0x3c3915ab, 1 }, // 7 - { "epr-5914.bin", 0x2000, 0x58792d4a, 1 }, // 8 - - { "epr-5895.bin", 0x4000, 0x4b0d4294, 2 }, // 9 gfx1 - { "epr-5896.bin", 0x4000, 0x7bc84d75, 2 }, // 10 - { "epr-5897.bin", 0x4000, 0x745f3ffa, 2 }, // 11 - - { "epr-5898.bin", 0x4000, 0xcf01644d, 3 }, // 12 gfx2 - { "epr-5899.bin", 0x4000, 0x885ad636, 3 }, // 13 - { "epr-5900.bin", 0x4000, 0xa8ed13f3, 3 }, // 14 - - { "pr5921.prm", 0x0020, 0xf2437229, 4 }, // 15 proms - { "pr5922.prm", 0x0100, 0x85c542bf, 4 }, // 16 - { "pr5923.prm", 0x0100, 0x16acbd53, 4 }, // 17 - - { "epr-5901.bin", 0x2000, 0x170a10a4, 5 }, // 18 adpcm - { "epr-5902.bin", 0x2000, 0xf6981640, 5 }, // 19 - { "epr-5903.bin", 0x2000, 0x0439df50, 5 }, // 20 - { "epr-5904.bin", 0x2000, 0x9988f2ae, 5 }, // 21 - { "epr-5905.bin", 0x2000, 0xfb5cd70e, 5 }, // 22 -}; - -STD_ROM_PICK(appoooh) -STD_ROM_FN(appoooh) - - -static struct BurnRomInfo robowresRomDesc[] = { - { "epr-7540.13d", 0x8000, 0xa2a54237, 1 }, // 0 maincpu - { "epr-7541.14d", 0x8000, 0xcbf7d1a8, 1 }, // 1 - { "epr-7542.15d", 0x8000, 0x3475fbd4, 1 }, // 2 - - { "epr-7544.7h", 0x8000, 0x07b846ce, 2 }, // 3 gfx1 - { "epr-7545.6h", 0x8000, 0xe99897be, 2 }, // 4 - { "epr-7546.5h", 0x8000, 0x1559235a, 2 }, // 5 - - { "epr-7547.7d", 0x8000, 0xb87ad4a4, 3 }, // 6 gfx2 - { "epr-7548.6d", 0x8000, 0x8b9c75b3, 3 }, // 7 - { "epr-7549.5d", 0x8000, 0xf640afbb, 3 }, // 8 - - { "pr7571.10a", 0x0020, 0xe82c6d5c, 4 }, // 9 proms - { "pr7572.7f", 0x0100, 0x2b083d0c, 4 }, // 10 - { "pr7573.7g", 0x0100, 0x2b083d0c, 4 }, // 11 - - { "epr-7543.12b", 0x8000, 0x4d108c49, 5 }, // 12 adpcm -}; - -STD_ROM_PICK(robowres) -STD_ROM_FN(robowres) - -struct BurnDriver BurnDrvAppoooh = { - "appoooh", NULL, NULL, NULL, "1984", - "Appoooh\0", NULL, "Sanritsu / Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, appooohRomInfo, appooohRomName, NULL, NULL, AppooohInputInfo, AppooohDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x220, - 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRobowres = { - "robowres", NULL, NULL, NULL, "1986", - "Robo Wres 2001\0", NULL, "Sanritsu / Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, robowresRomInfo, robowresRomName, NULL, NULL, AppooohInputInfo, RobowresDIPInfo, - DrvRobowresInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x220, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_bankp.cpp b/jan/src/burn/drv/sega/d_bankp.cpp deleted file mode 100644 index 7cb18969d..000000000 --- a/jan/src/burn/drv/sega/d_bankp.cpp +++ /dev/null @@ -1,615 +0,0 @@ -// FB Alpha Bank Panic Driver Module -// Based on MAME driver by Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" - -static UINT8 *Mem, *Rom, *Gfx0, *Gfx1, *Prom; -static UINT8 DrvJoy1[8], DrvJoy2[8], DrvJoy3[8], DrvReset, DrvDips; -static INT32 *Palette; - -static UINT8 scroll_x, priority, flipscreen, interrupt_enable; - -static struct BurnInputInfo bankpInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 5, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 6, "p2 coin" }, - {"Coin 3" , BIT_DIGITAL , DrvJoy3 + 2, "p3 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy2 + 5, "p1 start" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 6, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 7, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy3 + 0, "p1 fire 3"}, - - {"P2 Left" , BIT_DIGITAL , DrvJoy2 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 7, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy3 + 1, "p2 fire 3"}, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, &DrvDips, "dip" }, -}; - -STDINPUTINFO(bankp) - -static struct BurnInputInfo combhInputList[] = { - {"Coin 1" , BIT_DIGITAL , DrvJoy1 + 5, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , DrvJoy1 + 6, "p2 coin" }, - {"Coin 3" , BIT_DIGITAL , DrvJoy3 + 2, "p3 coin" }, - {"P1 Start" , BIT_DIGITAL , DrvJoy2 + 5, "p1 start" }, - {"P2 Start" , BIT_DIGITAL , DrvJoy2 + 6, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , DrvJoy1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , DrvJoy1 + 2, "p1 down" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2" , BIT_DIGITAL , DrvJoy1 + 7, "p1 fire 2"}, - {"P1 Button 3" , BIT_DIGITAL , DrvJoy3 + 0, "p1 fire 3"}, - - {"P2 Up" , BIT_DIGITAL , DrvJoy2 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , DrvJoy2 + 2, "p2 down" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2" , BIT_DIGITAL , DrvJoy2 + 7, "p2 fire 2"}, - {"P2 Button 3" , BIT_DIGITAL , DrvJoy3 + 1, "p2 fire 3"}, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, &DrvDips, "dip" }, - -}; - -STDINPUTINFO(combh) - -static struct BurnDIPInfo bankpDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0xc0, NULL }, - - {0 , 0xfe, 0 , 4 , "Coin A/B" }, - {0x10, 0x01, 0x03, 0x03, "3C 1C" }, - {0x10, 0x01, 0x03, 0x02, "2C 1C" }, - {0x10, 0x01, 0x03, 0x00, "1C 1C" }, - {0x10, 0x01, 0x03, 0x01, "1C 2C" }, - - {0 , 0xfe, 0 , 2 , "Coin C" }, - {0x10, 0x01, 0x04, 0x04, "2C 1C" }, - {0x10, 0x01, 0x04, 0x00, "1C 1C" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x08, 0x00, "3" }, - {0x10, 0x01, 0x08, 0x08, "4" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x10, 0x00, "70K 200K 500K..." }, - {0x10, 0x01, 0x10, 0x10, "100K 400K 800K..." }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x10, 0x01, 0x20, 0x00, "Easy" }, - {0x10, 0x01, 0x20, 0x20, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x40, 0x00, "Off" }, - {0x10, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x80, 0x80, "Upright" }, - {0x10, 0x01, 0x80, 0x00, "Cocktail" }, -}; - -STDDIPINFO(bankp) - -static struct BurnDIPInfo combhDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x10, 0x01, 0x01, 0x00, "Off" }, - {0x10, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x06, 0x06, "2C 1C" }, - {0x10, 0x01, 0x06, 0x00, "1C 1C" }, - {0x10, 0x01, 0x06, 0x02, "1C 2C" }, - {0x10, 0x01, 0x06, 0x04, "1C 3C" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x10, 0x01, 0x08, 0x00, "3" }, - {0x10, 0x01, 0x08, 0x08, "4" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x10, 0x10, "Upright" }, - {0x10, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x10, 0x01, 0x40, 0x00, "Easy" }, - {0x10, 0x01, 0x40, 0x40, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Fuel" }, - {0x10, 0x01, 0x80, 0x00, "120 Units" }, - {0x10, 0x01, 0x80, 0x80, "90 Units" }, -}; - -STDDIPINFO(combh) - -UINT8 __fastcall bankp_in(UINT16 address) -{ - UINT8 ret = 0; - - switch (address & 0xff) - { - case 0x00: - { - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy1[i] << i; - - // limit controls to 2-way - if ((ret & 0x05) == 0x05) ret &= 0xfa; - if ((ret & 0x0a) == 0x0a) ret &= 0xf5; - - return ret; - } - - case 0x01: - { - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy2[i] << i; - - // limit controls to 2-way - if ((ret & 0x05) == 0x05) ret &= 0xfa; - if ((ret & 0x0a) == 0x0a) ret &= 0xf5; - - return ret; - } - - case 0x02: - { - for (INT32 i = 0; i < 8; i++) ret |= DrvJoy3[i] << i; - - return ret; - } - - case 0x04: - return DrvDips; - } - - return 0; -} - -void __fastcall bankp_out(UINT16 address, UINT8 data) -{ - switch (address & 0xff) - { - case 0x00: - SN76496Write(0, data); - break; - - case 0x01: - SN76496Write(1, data); - break; - - case 0x02: - SN76496Write(2, data); - break; - - case 0x05: - scroll_x = data; - break; - - case 0x07: - { - priority = data & 0x03; - - interrupt_enable = (data >> 4) & 1; - - flipscreen = data & 0x20; - } - break; - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (Mem + 0xe000, 0, 0x2000); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - scroll_x = 0, priority = 0, flipscreen = 0; - interrupt_enable = 0; - - return 0; -} - -static INT32 bankp_palette_init() -{ - INT32 i; - - UINT32 t_pal[32]; - UINT8 *color_prom = Prom; - - for (i = 0;i < 32;i++) - { - INT32 bit0,bit1,bit2,r,g,b; - - bit0 = (*color_prom >> 0) & 0x01; - bit1 = (*color_prom >> 1) & 0x01; - bit2 = (*color_prom >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (*color_prom >> 3) & 0x01; - bit1 = (*color_prom >> 4) & 0x01; - bit2 = (*color_prom >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (*color_prom >> 6) & 0x01; - bit2 = (*color_prom >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - t_pal[i] = (r << 16) | (g << 8) | b; - - color_prom++; - } - - for (i = 0;i < 32 * 4;i++) { - Palette[i] = t_pal[*color_prom & 0x0f]; - color_prom++; - } - - color_prom += 128; - - for (i = 0;i < 16 * 8;i++) { - Palette[i + 0x80] = t_pal[*color_prom & 0x0f]; - color_prom++; - } - - return 0; -} - -static INT32 bankp_gfx_decode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, Gfx0, 0x10000); - - static INT32 Char1PlaneOffsets[2] = { 0x00, 0x04 }; - static INT32 Char2PlaneOffsets[3] = { 0x00, 0x20000, 0x40000 }; - static INT32 Char1XOffsets[8] = { 0x43, 0x42, 0x41, 0x40, 0x03, 0x02, 0x01, 0x00 }; - static INT32 Char2XOffsets[8] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; - static INT32 CharYOffsets[8] = { 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38 }; - - GfxDecode(0x400, 2, 8, 8, Char1PlaneOffsets, Char1XOffsets, CharYOffsets, 0x080, tmp, Gfx0); - - memcpy (tmp, Gfx1, 0x10000); - - GfxDecode(0x800, 3, 8, 8, Char2PlaneOffsets, Char2XOffsets, CharYOffsets, 0x040, tmp, Gfx1); - - for (INT32 i = 0; i < 0x20000; i++) { - Gfx1[i] |= 0x80; - } - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - Mem = (UINT8*)BurnMalloc(0x10000 + 0x10000 + 0x20000 + 0x200 + (0x100 * sizeof(INT32))); - if (Mem == NULL) { - return 1; - } - - Rom = Mem + 0x00000; - Gfx0 = Mem + 0x10000; - Gfx1 = Mem + 0x20000; - Prom = Mem + 0x40000; - Palette = (INT32*)(Mem + 0x40200); - - { - for (INT32 i = 0; i < 4; i++) - if (BurnLoadRom(Rom + i * 0x4000, i + 0, 1)) return 1; - - if (BurnLoadRom(Gfx0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(Gfx0 + 0x2000, 5, 1)) return 1; - - for (INT32 i = 0; i < 6; i++) - if (BurnLoadRom(Gfx1 + i * 0x2000, i + 6, 1)) return 1; - - if (BurnLoadRom(Prom + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(Prom + 0x0020, 13, 1)) return 1; - if (BurnLoadRom(Prom + 0x0120, 14, 1)) return 1; - - if (bankp_gfx_decode()) return 1; - bankp_palette_init(); - } - - ZetInit(0); - ZetOpen(0); - ZetSetInHandler(bankp_in); - ZetSetOutHandler(bankp_out); - ZetMapArea(0x0000, 0xdfff, 0, Rom + 0x0000); - ZetMapArea(0x0000, 0xdfff, 2, Rom + 0x0000); - ZetMapArea(0xe000, 0xefff, 0, Rom + 0xe000); - ZetMapArea(0xe000, 0xefff, 1, Rom + 0xe000); - ZetMapArea(0xe000, 0xefff, 2, Rom + 0xe000); - ZetMapArea(0xf000, 0xffff, 0, Rom + 0xf000); - ZetMapArea(0xf000, 0xffff, 1, Rom + 0xf000); - ZetClose(); - - SN76489Init(0, 15468000 / 6, 0); - SN76489Init(1, 15468000 / 6, 1); - SN76489Init(2, 15468000 / 6, 1); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(2, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - - SN76496Exit(); - - BurnFree (Mem); - - scroll_x = priority = flipscreen = interrupt_enable = 0; - - Rom = Gfx0 = Gfx1 = Prom = NULL; - Palette = NULL; - - return 0; -} - - -static void bankp_plot_pixel(INT32 x, INT32 y, INT32 color, UINT8 src, INT32 transp) -{ - if (x > 223 || x < 0 || y > 223 || y < 0) return; - - INT32 pxl = Palette[color | src]; - if (transp && !pxl) return; - - PutPix(pBurnDraw + (y * 224 + x) * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0)); -} - - -static void draw_8x8_tiles(UINT8 *gfx_base, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 transp) -{ - UINT8 *src = gfx_base + (code << 6); - - if (flipy) - { - for (INT32 y = sy + 7; y >= sy; y--) - { - if (flipx) - { - for (INT32 x = sx + 7; x >= sx; x--, src++) { - bankp_plot_pixel(x, y, color, *src, transp); - } - } else { - for (INT32 x = sx; x < sx + 8; x++, src++) { - bankp_plot_pixel(x, y, color, *src, transp); - } - } - } - } else { - for (INT32 y = sy; y < sy + 8; y++) - { - if (flipx) - { - for (INT32 x = sx + 7; x >= sx; x--, src++) { - bankp_plot_pixel(x, y, color, *src, transp); - - } - } else { - for (INT32 x = sx; x < sx + 8; x++, src++) { - bankp_plot_pixel(x, y, color, *src, transp); - - } - } - } - } -} - -static void draw_bg_tiles(INT32 prio) -{ - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 code, color, flipx, sx, sy; - - code = Rom[0xf800 + offs] | ((Rom[0xfc00 + offs] & 7) << 8); - color = (Rom[0xfc00 + offs] >> 1) & 0x78; - flipx = Rom[0xfc00 + offs] & 0x08; - - if (flipscreen) { - sx = (~offs << 3) & 0xf8; - sy = (~offs >> 2) & 0xf8; - flipx ^= 0x08; - } else { - sx = ( offs << 3) & 0xf8; - sy = ( offs >> 2) & 0xf8; - } - - draw_8x8_tiles(Gfx1, code, color, sx - 24, sy - 16, flipx, flipscreen, prio); - } -} - -static void draw_fg_tiles(INT32 prio) -{ - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 code, color, flipx, sx, sy; - - code = Rom[0xf000 + offs] | ((Rom[0xf400 + offs] & 3) << 8); - color = (Rom[0xf400 + offs] >> 1) & 0x7c; - flipx = Rom[0xf400 + offs] & 0x04; - - if (flipscreen) { - sx = ((~offs << 3) - scroll_x) & 0xff; - sy = (~offs >> 2) & 0xf8; - flipx ^= 4; - } else { - sx = (( offs << 3) - scroll_x) & 0xff; - sy = ( offs >> 2) & 0xf8; - } - - draw_8x8_tiles(Gfx0, code, color, sx - 24, sy - 16, flipx, flipscreen, prio); - } -} - -static INT32 DrvDraw() -{ - if (priority & 0x02) - { - draw_fg_tiles(0); - draw_bg_tiles(1); - } else { - draw_bg_tiles(0); - draw_fg_tiles(1); - } - - return 0; -} - - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetOpen(0); - ZetRun(2578000 / 60); - if (interrupt_enable) ZetNmi(); - ZetClose(); - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - SN76496Update(2, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = Rom + 0xe000; - ba.nLen = 0x2000; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(scroll_x); - SCAN_VAR(priority); - SCAN_VAR(flipscreen); - SCAN_VAR(interrupt_enable); - } - - return 0; -} - -// Bank Panic - -static struct BurnRomInfo bankpRomDesc[] = { - { "epr-6175.7e", 0x4000, 0x044552b8, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "epr-6174.7f", 0x4000, 0xd29b1598, 1 | BRF_ESS | BRF_PRG }, // 1 - { "epr-6173.7h", 0x4000, 0xb8405d38, 1 | BRF_ESS | BRF_PRG }, // 2 - { "epr-6176.7d", 0x2000, 0xc98ac200, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "epr-6165.5l", 0x2000, 0xaef34a93, 2 | BRF_GRA }, // 4 Playfield #1 chars - { "epr-6166.5k", 0x2000, 0xca13cb11, 2 | BRF_GRA }, // 5 - - { "epr-6172.5b", 0x2000, 0xc4c4878b, 3 | BRF_GRA }, // 6 Playfield #2 chars - { "epr-6171.5d", 0x2000, 0xa18165a1, 3 | BRF_GRA }, // 7 - { "epr-6170.5e", 0x2000, 0xb58aa8fa, 3 | BRF_GRA }, // 8 - { "epr-6169.5f", 0x2000, 0x1aa37fce, 3 | BRF_GRA }, // 9 - { "epr-6168.5h", 0x2000, 0x05f3a867, 3 | BRF_GRA }, // 10 - { "epr-6167.5i", 0x2000, 0x3fa337e1, 3 | BRF_GRA }, // 11 - - { "pr-6177.8a", 0x0020, 0xeb70c5ae, 4 | BRF_GRA }, // 12 (UINT32*)Palette - { "pr-6178.6f", 0x0100, 0x0acca001, 4 | BRF_GRA }, // 13 Charset #1 lut - { "pr-6179.5a", 0x0100, 0xe53bafdb, 4 | BRF_GRA }, // 14 Charset #2 lut - - { "315-5074.2c.bin", 0x025b, 0x2e57bbba, 0 | BRF_OPT }, // 15 - { "315-5073.pal16l4", 0x0001, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, // 16 read protected -}; - -STD_ROM_PICK(bankp) -STD_ROM_FN(bankp) - -struct BurnDriver BurnDrvbankp = { - "bankp", NULL, NULL, NULL, "1984", - "Bank Panic\0", NULL, "[Sanritsu] Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, bankpRomInfo, bankpRomName, NULL, NULL, bankpInputInfo, bankpDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x100, - 224, 224, 4, 3 -}; - -// Combat Hawk - -static struct BurnRomInfo combhRomDesc[] = { - { "epr-10904.7e", 0x4000, 0x4b106335, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "epr-10905.7f", 0x4000, 0xa76fc390, 1 | BRF_ESS | BRF_PRG }, // 1 - { "epr-10906.7h", 0x4000, 0x16d54885, 1 | BRF_ESS | BRF_PRG }, // 2 - { "epr-10903.7d", 0x2000, 0xb7a59cab, 1 | BRF_ESS | BRF_PRG }, // 3 - - { "epr-10914.5l", 0x2000, 0x7d7a2340, 2 | BRF_GRA }, // 4 Playfield #1 chars - { "epr-10913.5k", 0x2000, 0xd5c1a8ae, 2 | BRF_GRA }, // 5 - - { "epr-10907.5b", 0x2000, 0x08e5eea3, 3 | BRF_GRA }, // 6 Playfield #2 chars - { "epr-10908.5d", 0x2000, 0xd9e413f5, 3 | BRF_GRA }, // 7 - { "epr-10909.5e", 0x2000, 0xfec7962c, 3 | BRF_GRA }, // 8 - { "epr-10910.5f", 0x2000, 0x33db0fa7, 3 | BRF_GRA }, // 9 - { "epr-10911.5h", 0x2000, 0x565d9e6d, 3 | BRF_GRA }, // 10 - { "epr-10912.5i", 0x2000, 0xcbe22738, 3 | BRF_GRA }, // 11 - - { "pr-10900.8a", 0x0020, 0xf95fcd66, 4 | BRF_GRA }, // 12 (UINT32*)Palette - { "pr-10901.6f", 0x0100, 0x6fd981c8, 4 | BRF_GRA }, // 13 Charset #1 lut - { "pr-10902.5a", 0x0100, 0x84d6bded, 4 | BRF_GRA }, // 14 Charset #2 lut - - { "315-5074.2c.bin", 0x025b, 0x2e57bbba, 0 | BRF_OPT }, // 15 - { "315-5073.pal16l4", 0x0001, 0x00000000, 0 | BRF_OPT | BRF_NODUMP }, // 16 read protected -}; - -STD_ROM_PICK(combh) -STD_ROM_FN(combh) - -struct BurnDriver BurnDrvcombh = { - "combh", NULL, NULL, NULL, "1987", - "Combat Hawk\0", NULL, "Sega / Sanritsu", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, combhRomInfo, combhRomName, NULL, NULL, combhInputInfo, combhDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x100, - 224, 224, 3, 4 -}; - diff --git a/jan/src/burn/drv/sega/d_dotrikun.cpp b/jan/src/burn/drv/sega/d_dotrikun.cpp deleted file mode 100644 index ec44e7dd3..000000000 --- a/jan/src/burn/drv/sega/d_dotrikun.cpp +++ /dev/null @@ -1,269 +0,0 @@ -// FB Alpha Dottori Kun driver module -// Based on MAME driver by Takahiro Nogi - -#include "tiles_generic.h" -#include "z80_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvReset; -static UINT8 DrvInputs[1]; - -static UINT8 *nColor; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down", }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 start", BIT_DIGITAL, DrvJoy1 + 6, "p1 start" }, - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p1 coin" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, -}; - -STDINPUTINFO(Drv) - -UINT8 __fastcall dotrikun_in_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return DrvInputs[0]; - } - - return 0; -} - -void __fastcall dotrikun_out_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - *nColor = data; - return; - } -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x000002 * sizeof (UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - - nColor = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM, 0, 1)) return 1; - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea (0x0000, 0x3fff, 0, DrvZ80ROM); - ZetMapArea (0x0000, 0x3fff, 2, DrvZ80ROM); - ZetMapArea (0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea (0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea (0x8000, 0x87ff, 2, DrvZ80RAM); - ZetSetOutHandler(dotrikun_out_port); - ZetSetInHandler(dotrikun_in_port); - ZetClose(); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPalette[0] = BurnHighCol((*nColor & 0x08) ? 0xff : 0, (*nColor & 0x10) ? 0xff : 0, (*nColor & 0x20) ? 0xff : 0, 0); - DrvPalette[1] = BurnHighCol((*nColor & 0x01) ? 0xff : 0, (*nColor & 0x02) ? 0xff : 0, (*nColor & 0x04) ? 0xff : 0, 0); - } - - for (INT32 offs = 0; offs < 0x0600; offs++) - { - INT32 sx = (offs & 0x0f) << 4; - INT32 sy = (offs >> 4) << 1; - INT32 px = DrvZ80RAM[offs]; - - for (INT32 i = 0; i < 8; i++, sx+=2) - { - INT32 pen = (px >> (7 - i)) & 1; - - if (sx > nScreenWidth || sy >= nScreenHeight) continue; - - pTransDraw[((sy + 0) << 8) | (sx + 0)] = pen; - pTransDraw[((sy + 0) << 8) | (sx + 1)] = pen; - pTransDraw[((sy + 1) << 8) | (sx + 0)] = pen; - pTransDraw[((sy + 1) << 8) | (sx + 1)] = pen; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0xff; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - } - - ZetOpen(0); - ZetRun(4000000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - } - - return 0; -} - - -// Dottori Kun (new version) - -static struct BurnRomInfo dotrikunRomDesc[] = { - { "14479a.mpr", 0x4000, 0xb77a50db, BRF_ESS | BRF_PRG }, // Z80 code -}; - -STD_ROM_PICK(dotrikun) -STD_ROM_FN(dotrikun) - -struct BurnDriver BurnDrvdotrikun = { - "dotrikun", NULL, NULL, NULL, "1990", - "Dottori Kun (new version)\0", NULL, "Sega", "Test Hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_SEGA_MISC, GBF_MAZE, 0, - NULL, dotrikunRomInfo, dotrikunRomName, NULL, NULL, DrvInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x02, - 256, 192, 4, 3 -}; - - -// Dottori Kun (old version) - -static struct BurnRomInfo dotriku2RomDesc[] = { - { "14479.mpr", 0x4000, 0xa6aa7fa5, BRF_ESS | BRF_PRG }, // Z80 code -}; - -STD_ROM_PICK(dotriku2) -STD_ROM_FN(dotriku2) - -struct BurnDriver BurnDrvdotriku2 = { - "dotrikun2", "dotrikun", NULL, NULL, "1990", - "Dottori Kun (old version)\0", NULL, "Sega", "Test Hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_SEGA_MISC, GBF_MAZE, 0, - NULL, dotriku2RomInfo, dotriku2RomName, NULL, NULL, DrvInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x02, - 256, 192, 4, 3 -}; - - -// Dottori-Man Jr. - -static struct BurnRomInfo dotrimanRomDesc[] = { - { "14479a.mpr", 0x4000, 0x4ba6d2f5, BRF_ESS | BRF_PRG }, // Z80 code -}; - -STD_ROM_PICK(dotriman) -STD_ROM_FN(dotriman) - -struct BurnDriver BurnDrvdotriman = { - "dotriman", "dotrikun", NULL, NULL, "2016", - "Dottori-Man Jr.\0", NULL, "hack (Chris Covell)", "Test Hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 1, HARDWARE_SEGA_MISC, GBF_MAZE, 0, - NULL, dotrimanRomInfo, dotrimanRomName, NULL, NULL, DrvInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x02, - 256, 192, 4, 3 -}; \ No newline at end of file diff --git a/jan/src/burn/drv/sega/d_hangon.cpp b/jan/src/burn/drv/sega/d_hangon.cpp deleted file mode 100644 index 8011b2369..000000000 --- a/jan/src/burn/drv/sega/d_hangon.cpp +++ /dev/null @@ -1,1538 +0,0 @@ -#include "sys16.h" - -/*==================================================== -Input Defs -====================================================*/ - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo EndurorInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Bank Up/Down" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 y-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort3, "p1 fire 2" ), - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Enduror) - -static struct BurnInputInfo HangonInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Hangon) - -static struct BurnInputInfo ShangonrbInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - {"Super Charger" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Shangonrb) - -static struct BurnInputInfo SharrierInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Up/Down" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 y-axis" ), - {"Fire 1" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , System16InputPort0 + 6, "p1 fire 2" }, - {"Fire 3" , BIT_DIGITAL , System16InputPort0 + 7, "p1 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Sharrier) - -#undef A - -/*==================================================== -Dip defs -====================================================*/ - -#define HANGON_COINAGE(dipval) \ - {0 , 0xfe, 0 , 16 , "Coin A" }, \ - {dipval, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x05, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0x0f, 0x04, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x01, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0x0f, 0x02, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0x0f, 0x03, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0x0f, 0x00, "Free Play (if coin B too) or 1C/1C" }, \ - \ - {0 , 0xfe, 0 , 16 , "Coin B" }, \ - {dipval, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x50, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0xf0, 0x40, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x10, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0xf0, 0x20, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0xf0, 0x30, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0xf0, 0x00, "Free Play (if coin A too) or 1C/1C" }, - -static struct BurnDIPInfo EndurorDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0x7e, NULL }, - - // Dip 1 - HANGON_COINAGE(0x0a) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x01, 0x00, "Upright" }, - {0x0b, 0x01, 0x01, 0x01, "Wheelie" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0x06, 0x04, "Easy" }, - {0x0b, 0x01, 0x06, 0x06, "Medium" }, - {0x0b, 0x01, 0x06, 0x02, "Hard" }, - {0x0b, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0b, 0x01, 0x18, 0x10, "Easy" }, - {0x0b, 0x01, 0x18, 0x18, "Medium" }, - {0x0b, 0x01, 0x18, 0x08, "Hard" }, - {0x0b, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time Control" }, - {0x0b, 0x01, 0x60, 0x40, "Easy" }, - {0x0b, 0x01, 0x60, 0x60, "Medium" }, - {0x0b, 0x01, 0x60, 0x20, "Hard" }, - {0x0b, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x80, 0x80, "Off" }, - {0x0b, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Enduror) - -static struct BurnDIPInfo HangonDIPList[]= -{ - // Default Values - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - HANGON_COINAGE(0x09) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x01, 0x01, "Off" }, - {0x0a, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0a, 0x01, 0x06, 0x04, "Easy" }, - {0x0a, 0x01, 0x06, 0x06, "Medium" }, - {0x0a, 0x01, 0x06, 0x02, "Hard" }, - {0x0a, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0a, 0x01, 0x18, 0x18, "Normal" }, - {0x0a, 0x01, 0x18, 0x10, "Medium" }, - {0x0a, 0x01, 0x18, 0x08, "Hard" }, - {0x0a, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Play Music" }, - {0x0a, 0x01, 0x20, 0x00, "Off" }, - {0x0a, 0x01, 0x20, 0x20, "On" }, -}; - -STDDIPINFO(Hangon) - -static struct BurnDIPInfo ShangonrbDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0x1e, NULL }, - - // Dip 1 - HANGON_COINAGE(0x0a) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0x06, 0x04, "Easy" }, - {0x0b, 0x01, 0x06, 0x06, "Normal" }, - {0x0b, 0x01, 0x06, 0x02, "Hard" }, - {0x0b, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0b, 0x01, 0x18, 0x10, "Easy" }, - {0x0b, 0x01, 0x18, 0x18, "Normal" }, - {0x0b, 0x01, 0x18, 0x08, "Hard" }, - {0x0b, 0x01, 0x18, 0x00, "Hardest" }, -}; - -STDDIPINFO(Shangonrb) - -static struct BurnDIPInfo SharrierDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - HANGON_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x01, 0x00, "Upright" }, - {0x0c, 0x01, 0x01, 0x01, "Moving" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x02, 0x02, "Off" }, - {0x0c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0c, 0x01, 0x0c, 0x08, "2" }, - {0x0c, 0x01, 0x0c, 0x0c, "3" }, - {0x0c, 0x01, 0x0c, 0x04, "4" }, - {0x0c, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0c, 0x01, 0x10, 0x10, "5000000" }, - {0x0c, 0x01, 0x10, 0x00, "7000000" }, - - {0 , 0xfe, 0 , 2 , "Trial Time" }, - {0x0c, 0x01, 0x20, 0x20, "Off" }, - {0x0c, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x80, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Medium" }, - {0x0c, 0x01, 0xc0, 0x40, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Sharrier) - -#undef HANGON_COINAGE - -/*==================================================== -Rom Defs -====================================================*/ - -static struct BurnRomInfo EndurorRomDesc[] = { - { "epr-7640a.ic97", 0x08000, 0x1d1dc5d4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7636a.ic84", 0x08000, 0x84131639, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7641.ic98", 0x08000, 0x2503ae7c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7637.ic85", 0x08000, 0x82a27a8c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7642.ic99", 0x08000, 0x1c453bea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7638.ic86", 0x08000, 0x70544779, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7634a.ic54", 0x08000, 0xaec83731, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-7635a.ic67", 0x08000, 0xb2fce96f, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-7644.ic31", 0x08000, 0xe7a4ff90, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7645.ic46", 0x08000, 0x4caa0095, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7646.ic60", 0x08000, 0x7e432683, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7678.ic36", 0x08000, 0x9fb5e656, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7670.ic28", 0x08000, 0xdbbe2f6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7662.ic18", 0x08000, 0xcb0c13c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7654.1c8", 0x08000, 0x2db6520d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7677.ic35", 0x08000, 0x7764765b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7669.ic27", 0x08000, 0xf9525faa, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7661.ic17", 0x08000, 0xfe93a79b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7653.ic7", 0x08000, 0x46a52114, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7676.ic34", 0x08000, 0x2e42e0d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7668.ic26", 0x08000, 0xe115ce33, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7660.ic16", 0x08000, 0x86dfbb68, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7652.ic6", 0x08000, 0x2880cfdb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7675.ic33", 0x08000, 0x05cd2d61, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7667.ic25", 0x08000, 0x923bde9d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7659.ic15", 0x08000, 0x629dc8ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7651.ic5", 0x08000, 0xd7902bad, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7674.ic32", 0x08000, 0x1a129acf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7666.ic24", 0x08000, 0x23697257, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7658.ic14", 0x08000, 0x1677f24f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7650.ic4", 0x08000, 0x642635ec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7673.ic31", 0x08000, 0x82602394, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7665.ic23", 0x08000, 0x12d77607, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7657.ic13", 0x08000, 0x8158839c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7649.ic3", 0x08000, 0x4edba14c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7672.ic30", 0x08000, 0xd11452f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7664.ic22", 0x08000, 0x0df2cfad, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7656.ic12", 0x08000, 0x6c741272, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7648.ic2", 0x08000, 0x983ea830, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7671.ic29", 0x08000, 0xb0c7fdc6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7663.ic21", 0x08000, 0x2b0b8f08, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7655.ic11", 0x08000, 0x3433fe7b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7647.ic1", 0x08000, 0x2e7fbec0, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7633.ic1", 0x08000, 0x6f146210, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-7682.rom", 0x08000, 0xc4efbf48, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-7681.rom", 0x08000, 0xbc0c4d12, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-7680.rom", 0x08000, 0x627b3c8c, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.ic123", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, - - { "317-0013a.key", 0x02000, 0x295e6737, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Enduror) -STD_ROM_FN(Enduror) - -static struct BurnRomInfo Enduror1RomDesc[] = { - { "epr-7630.ic97", 0x08000, 0xa1bdadab, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7629.ic84", 0x08000, 0xf50f4169, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7641.ic98", 0x08000, 0x2503ae7c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7637.ic85", 0x08000, 0x82a27a8c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7642.ic99", 0x08000, 0x1c453bea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7638.ic86", 0x08000, 0x70544779, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7634.ic54", 0x08000, 0x3e07fd32, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-7635.ic67", 0x08000, 0x22f762ab, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-7644.ic31", 0x08000, 0xe7a4ff90, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7645.ic46", 0x08000, 0x4caa0095, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7646.ic60", 0x08000, 0x7e432683, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7678.ic36", 0x08000, 0x9fb5e656, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7670.ic28", 0x08000, 0xdbbe2f6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7662.ic18", 0x08000, 0xcb0c13c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7654.1c8", 0x08000, 0x2db6520d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7677.ic35", 0x08000, 0x7764765b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7669.ic27", 0x08000, 0xf9525faa, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7661.ic17", 0x08000, 0xfe93a79b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7653.ic7", 0x08000, 0x46a52114, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7676.ic34", 0x08000, 0x2e42e0d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7668.ic26", 0x08000, 0xe115ce33, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7660.ic16", 0x08000, 0x86dfbb68, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7652.ic6", 0x08000, 0x2880cfdb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7675.ic33", 0x08000, 0x05cd2d61, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7667.ic25", 0x08000, 0x923bde9d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7659.ic15", 0x08000, 0x629dc8ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7651.ic5", 0x08000, 0xd7902bad, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7674.ic32", 0x08000, 0x1a129acf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7666.ic24", 0x08000, 0x23697257, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7658.ic14", 0x08000, 0x1677f24f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7650.ic4", 0x08000, 0x642635ec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7673.ic31", 0x08000, 0x82602394, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7665.ic23", 0x08000, 0x12d77607, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7657.ic13", 0x08000, 0x8158839c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7649.ic3", 0x08000, 0x4edba14c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7672.ic30", 0x08000, 0xd11452f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7664.ic22", 0x08000, 0x0df2cfad, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7656.ic12", 0x08000, 0x6c741272, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7648.ic2", 0x08000, 0x983ea830, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7671.ic29", 0x08000, 0xb0c7fdc6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7663.ic21", 0x08000, 0x2b0b8f08, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7655.ic11", 0x08000, 0x3433fe7b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7647.ic1", 0x08000, 0x2e7fbec0, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7633.ic1", 0x08000, 0x6f146210, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-7765.ic73", 0x04000, 0x81c82fc9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - { "epr-7764.ic72", 0x04000, 0x755bfdad, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-7762.ic5", 0x08000, 0xbc0c4d12, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-7763.ic6", 0x08000, 0x627b3c8c, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.ic123", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, - - { "317-0013a.key", 0x02000, 0x295e6737, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Enduror1) -STD_ROM_FN(Enduror1) - -static struct BurnRomInfo EnduroblRomDesc[] = { - { "7.13j", 0x10000, 0xf1d6b4b7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "4.13h", 0x10000, 0x43bff873, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "8.14j", 0x08000, 0x2153154a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "5.14h", 0x08000, 0x0a97992c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "9.15j", 0x08000, 0xdb3bff1c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "6.15h", 0x08000, 0x54b1885a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7634.ic54", 0x08000, 0x3e07fd32, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-7635.ic67", 0x08000, 0x22f762ab, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-7644.ic31", 0x08000, 0xe7a4ff90, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7645.ic46", 0x08000, 0x4caa0095, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7646.ic60", 0x08000, 0x7e432683, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7678.ic36", 0x08000, 0x9fb5e656, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7670.ic28", 0x08000, 0xdbbe2f6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7662.ic18", 0x08000, 0xcb0c13c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7654.1c8", 0x08000, 0x2db6520d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7677.ic35", 0x08000, 0x7764765b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7669.ic27", 0x08000, 0xf9525faa, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7661.ic17", 0x08000, 0xfe93a79b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7653.ic7", 0x08000, 0x46a52114, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7676.ic34", 0x08000, 0x2e42e0d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7668.ic26", 0x08000, 0xe115ce33, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7660.ic16", 0x08000, 0x86dfbb68, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7652.ic6", 0x08000, 0x2880cfdb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7675.ic33", 0x08000, 0x05cd2d61, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7667.ic25", 0x08000, 0x923bde9d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7659.ic15", 0x08000, 0x629dc8ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7651.ic5", 0x08000, 0xd7902bad, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7674.ic32", 0x08000, 0x1a129acf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7666.ic24", 0x08000, 0x23697257, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7658.ic14", 0x08000, 0x1677f24f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7650.ic4", 0x08000, 0x642635ec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7673.ic31", 0x08000, 0x82602394, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7665.ic23", 0x08000, 0x12d77607, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7657.ic13", 0x08000, 0x8158839c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7649.ic3", 0x08000, 0x4edba14c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7672.ic30", 0x08000, 0xd11452f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7664.ic22", 0x08000, 0x0df2cfad, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7656.ic12", 0x08000, 0x6c741272, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7648.ic2", 0x08000, 0x983ea830, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7671.ic29", 0x08000, 0xb0c7fdc6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7663.ic21", 0x08000, 0x2b0b8f08, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7655.ic11", 0x08000, 0x3433fe7b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7647.ic1", 0x08000, 0x2e7fbec0, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7633.ic1", 0x08000, 0x6f146210, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-7765.ic73", 0x04000, 0x81c82fc9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - { "epr-7764.ic72", 0x04000, 0x755bfdad, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-7762.ic5", 0x08000, 0xbc0c4d12, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-7763.ic6", 0x08000, 0x627b3c8c, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.ic123", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, -}; - - -STD_ROM_PICK(Endurobl) -STD_ROM_FN(Endurobl) - -static struct BurnRomInfo HangonRomDesc[] = { - { "epr-6918a.ic22", 0x08000, 0x20b1c2b0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-6916a.ic8", 0x08000, 0x7d9db1bf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-6917a.ic20", 0x08000, 0xfea12367, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-6915a.ic6", 0x08000, 0xac883240, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-6920.ic63", 0x08000, 0x1c95013e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-6919.ic51", 0x08000, 0x6ca30d69, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-6841.ic38", 0x08000, 0x54d295dc, SYS16_ROM_TILES | BRF_GRA }, - { "epr-6842.ic23", 0x08000, 0xf677b568, SYS16_ROM_TILES | BRF_GRA }, - { "epr-6843.ic7", 0x08000, 0xa257f0da, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-6819.ic27", 0x08000, 0x469dad07, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6820.ic34", 0x08000, 0x87cbc6de, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6821.ic28", 0x08000, 0x15792969, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6822.ic35", 0x08000, 0xe9718de5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6823.ic29", 0x08000, 0x49422691, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6824.ic36", 0x08000, 0x701deaa4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6825.ic30", 0x08000, 0x6e23c8b4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6826.ic37", 0x08000, 0x77d0de2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6827.ic31", 0x08000, 0x7fa1bfb6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6828.ic38", 0x08000, 0x8e880c93, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6829.ic32", 0x08000, 0x7ca0952d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6830.ic39", 0x08000, 0xb1a63aef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6845.ic18", 0x08000, 0xba08c9b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6846.ic25", 0x08000, 0xf21e57a3, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-6840.ic108", 0x08000, 0x581230e3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-6833.ic73", 0x04000, 0x3b942f5f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-6831.ic5", 0x08000, 0xcfef5481, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-6832.ic6", 0x08000, 0x4165aea5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.ic123", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, -}; - - -STD_ROM_PICK(Hangon) -STD_ROM_FN(Hangon) - -static struct BurnRomInfo Hangon1RomDesc[] = { - { "epr-6918.ic22", 0x08000, 0x0bf4f2ac, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-6916.ic8", 0x08000, 0x06c21c8a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-6917.ic20", 0x08000, 0xf48a6cbc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-6915.ic6", 0x08000, 0x75d3b5ee, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-6920.ic63", 0x08000, 0x1c95013e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-6919.ic51", 0x08000, 0x6ca30d69, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-6841.ic38", 0x08000, 0x54d295dc, SYS16_ROM_TILES | BRF_GRA }, - { "epr-6842.ic23", 0x08000, 0xf677b568, SYS16_ROM_TILES | BRF_GRA }, - { "epr-6843.ic7", 0x08000, 0xa257f0da, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-6819.ic27", 0x08000, 0x469dad07, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6820.ic34", 0x08000, 0x87cbc6de, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6821.ic28", 0x08000, 0x15792969, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6822.ic35", 0x08000, 0xe9718de5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6823.ic29", 0x08000, 0x49422691, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6824.ic36", 0x08000, 0x701deaa4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6825.ic30", 0x08000, 0x6e23c8b4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6826.ic37", 0x08000, 0x77d0de2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6827.ic31", 0x08000, 0x7fa1bfb6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6828.ic38", 0x08000, 0x8e880c93, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6829.ic32", 0x08000, 0x7ca0952d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6830.ic39", 0x08000, 0xb1a63aef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6845.ic18", 0x08000, 0xba08c9b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6846.ic25", 0x08000, 0xf21e57a3, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-6840.ic108", 0x08000, 0x581230e3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-6833.ic73", 0x04000, 0x3b942f5f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-6831.ic5", 0x08000, 0xcfef5481, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-6832.ic6", 0x08000, 0x4165aea5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.ic123", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, -}; - - -STD_ROM_PICK(Hangon1) -STD_ROM_FN(Hangon1) - -static struct BurnRomInfo Hangon2RomDesc[] = { - { "epr-6851a__(needs_verification).ic22", 0x08000, 0x1e4d2217, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // as per the manual - { "epr-6849a__(needs_verification).ic8", 0x08000, 0x3793e50e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // as per the manual - { "epr-6850a__(needs_verification).ic20", 0x08000, 0x5d715e3b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // as per the manual - { "epr-6848a__(needs_verification).ic6", 0x08000, 0xf1439a30, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // as per the manual - - { "epr-6838.ic63", 0x08000, 0x2747b794, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-6839.ic51", 0x08000, 0x73e9fa6e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-6841.ic38", 0x08000, 0x54d295dc, SYS16_ROM_TILES | BRF_GRA }, - { "epr-6842.ic23", 0x08000, 0xf677b568, SYS16_ROM_TILES | BRF_GRA }, - { "epr-6843.ic7", 0x08000, 0xa257f0da, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-6819.ic27", 0x08000, 0x469dad07, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6820.ic34", 0x08000, 0x87cbc6de, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6821.ic28", 0x08000, 0x15792969, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6822.ic35", 0x08000, 0xe9718de5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6823.ic29", 0x08000, 0x49422691, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6824.ic36", 0x08000, 0x701deaa4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6825.ic30", 0x08000, 0x6e23c8b4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6826.ic37", 0x08000, 0x77d0de2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6827.ic31", 0x08000, 0x7fa1bfb6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6828.ic38", 0x08000, 0x8e880c93, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6829.ic32", 0x08000, 0x7ca0952d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6830.ic39", 0x08000, 0xb1a63aef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6845.ic18", 0x08000, 0xba08c9b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-6846.ic25", 0x08000, 0xf21e57a3, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-6840.ic108", 0x08000, 0x581230e3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-6833.ic73", 0x04000, 0x3b942f5f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-6831.ic5", 0x08000, 0xcfef5481, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-6832.ic6", 0x08000, 0x4165aea5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.ic119", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, -}; - - -STD_ROM_PICK(Hangon2) -STD_ROM_FN(Hangon2) - -static struct BurnRomInfo ShangonroRomDesc[] = { - { "epr-10842.22", 0x08000, 0x24289138, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10839.8", 0x08000, 0x70f92d5e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10841.20", 0x08000, 0x3bb2186c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10838.6", 0x08000, 0x6aded05a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10840.18", 0x08000, 0x12ee8716, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10837.4", 0x08000, 0x155e0cfd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10831.25", 0x10000, 0x3a2de9eb, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10833.31", 0x10000, 0x13ba98bc, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10830.24", 0x10000, 0x2ae4e53a, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10832.30", 0x10000, 0x543cd7bb, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10652.38", 0x08000, 0x260286f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10651.23", 0x08000, 0xc609ee7b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10650.7", 0x08000, 0xb236a403, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10675.22", 0x10000, 0xd6ac012b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10682.13", 0x10000, 0xd9d83250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10676.21", 0x10000, 0x25ebf2c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10683.12", 0x10000, 0x6365d2e9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10677.20", 0x10000, 0x8a57b8d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10684.11", 0x10000, 0x3aff8910, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10678.19", 0x10000, 0xaf473098, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10685.10", 0x10000, 0x80bafeef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10679.18", 0x10000, 0x03bc4878, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10686.9", 0x10000, 0x274b734e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10680.17", 0x10000, 0x9f0677ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10687.8", 0x10000, 0x508a4701, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10681.16", 0x10000, 0xb176ea72, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10688.7", 0x10000, 0x42fcd51d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10866.108", 0x08000, 0x1bbe4fc8, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10834a.52", 0x08000, 0x83347dc0, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10835.55", 0x10000, 0xda08ca2b, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10836.56", 0x10000, 0x8b10e601, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.119", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, - - { "317-0038.key", 0x02000, 0x85943925, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Shangonro) -STD_ROM_FN(Shangonro) - -static struct BurnRomInfo ShangonhoRomDesc[] = { - { "epr-10865.ic22", 0x08000, 0x98e861dd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10862.ic8", 0x08000, 0xd6f058c7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10864.ic20", 0x08000, 0xb3048f44, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10861.ic6", 0x08000, 0x0a131e14, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10863.ic18", 0x08000, 0x12ee8716, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10860.ic4", 0x08000, 0x155e0cfd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10857.ic25", 0x10000, 0x064827a3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10859.ic31", 0x10000, 0xa22bc1a2, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10856.ic24", 0x10000, 0x000ad595, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10858.ic30", 0x10000, 0x8f8f4af0, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10652.38", 0x08000, 0x260286f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10651.23", 0x08000, 0xc609ee7b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10650.7", 0x08000, 0xb236a403, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10675.22", 0x10000, 0xd6ac012b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10682.13", 0x10000, 0xd9d83250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10676.21", 0x10000, 0x25ebf2c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10683.12", 0x10000, 0x6365d2e9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10677.20", 0x10000, 0x8a57b8d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10684.11", 0x10000, 0x3aff8910, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10678.19", 0x10000, 0xaf473098, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10685.10", 0x10000, 0x80bafeef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10679.18", 0x10000, 0x03bc4878, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10686.9", 0x10000, 0x274b734e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10680.17", 0x10000, 0x9f0677ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10687.8", 0x10000, 0x508a4701, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10681.16", 0x10000, 0xb176ea72, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10688.7", 0x10000, 0x42fcd51d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10866.108", 0x08000, 0x1bbe4fc8, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10834a.52", 0x08000, 0x83347dc0, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10835.55", 0x10000, 0xda08ca2b, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10836.56", 0x10000, 0x8b10e601, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.119", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, - - { "317-0039.key", 0x02000, 0x97b05dd6, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Shangonho) -STD_ROM_FN(Shangonho) - -static struct BurnRomInfo ShangonrbRomDesc[] = { - { "s-hangon.30", 0x10000, 0xd95e82fc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "s-hangon.32", 0x10000, 0x2ee4b4fb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "s-hangon.29", 0x08000, 0x12ee8716, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "s-hangon.31", 0x08000, 0x155e0cfd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "s-hangon.09", 0x10000, 0x070c8059, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "s-hangon.05", 0x10000, 0x9916c54b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "s-hangon.08", 0x10000, 0x000ad595, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "s-hangon.04", 0x10000, 0x8f8f4af0, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10652.38", 0x08000, 0x260286f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10651.23", 0x08000, 0xc609ee7b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10650.7", 0x08000, 0xb236a403, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10675.22", 0x10000, 0xd6ac012b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10682.11", 0x10000, 0xd9d83250, SYS16_ROM_SPRITES | BRF_GRA }, - { "s-hangon.20", 0x10000, 0xeef23b3d, SYS16_ROM_SPRITES | BRF_GRA }, - { "s-hangon.14", 0x10000, 0x0f26d131, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10677.20", 0x10000, 0x8a57b8d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10684.11", 0x10000, 0x3aff8910, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10678.19", 0x10000, 0xaf473098, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10685.10", 0x10000, 0x80bafeef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10679.18", 0x10000, 0x03bc4878, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10686.9", 0x10000, 0x274b734e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10680.17", 0x10000, 0x9f0677ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10687.8", 0x10000, 0x508a4701, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10681.16", 0x10000, 0xb176ea72, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10688.7", 0x10000, 0x42fcd51d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10866.108", 0x08000, 0x1bbe4fc8, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10834a.52", 0x08000, 0x83347dc0, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10835.55", 0x10000, 0xda08ca2b, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10836.56", 0x10000, 0x8b10e601, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.119", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, -}; - - -STD_ROM_PICK(Shangonrb) -STD_ROM_FN(Shangonrb) - -static struct BurnRomInfo SharrierRomDesc[] = { - { "epr-7188a.ic97", 0x08000, 0x45e173c3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7184a.ic84", 0x08000, 0xe1934a51, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7189.ic98", 0x08000, 0x40b1309f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7185.ic85", 0x08000, 0xce78045c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7190.ic99", 0x08000, 0xf6391091, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7186.ic86", 0x08000, 0x79b367d7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7191.ic100", 0x08000, 0x6171e9d3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7187.ic87", 0x08000, 0x70cb72ef, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7182.ic54", 0x08000, 0xd7c535b6, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-7183.ic67", 0x08000, 0xa6153af8, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-7196.ic31", 0x08000, 0x347fa325, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7197.ic46", 0x08000, 0x39d98bd1, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7198.ic60", 0x08000, 0x3da3ea6b, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7230.ic36", 0x08000, 0x93e2d264, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7222.ic28", 0x08000, 0xedbf5fc3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7214.ic18", 0x08000, 0xe8c537d8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7206.ic8", 0x08000, 0x22844fa4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7229.ic35", 0x08000, 0xcd6e7500, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7221.ic27", 0x08000, 0x41f25a9c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7213.ic17", 0x08000, 0x5bb09a67, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7205.ic7", 0x08000, 0xdcaa2ebf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7228.ic34", 0x08000, 0xd5e15e66, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7220.ic26", 0x08000, 0xac62ae2e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7212.ic16", 0x08000, 0x9c782295, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7204.ic6", 0x08000, 0x3711105c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7227.ic33", 0x08000, 0x60d7c1bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7219.ic25", 0x08000, 0xf6330038, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7211.ic15", 0x08000, 0x60737b98, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7203.ic5", 0x08000, 0x70fb5ebb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7226.ic32", 0x08000, 0x6d7b5c97, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7218.ic24", 0x08000, 0xcebf797c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7210.ic14", 0x08000, 0x24596a8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7202.ic4", 0x08000, 0xb537d082, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7225.ic31", 0x08000, 0x5e784271, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7217.ic23", 0x08000, 0x510e5e10, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7209.ic13", 0x08000, 0x7a2dad15, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7201.ic3", 0x08000, 0xf5ba4e08, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7224.ic30", 0x08000, 0xec42c9ef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7216.ic22", 0x08000, 0x6d4a7d7a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7208.ic12", 0x08000, 0x0f732717, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7200.ic2", 0x08000, 0xfc3bf8f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7223.ic29", 0x08000, 0xed51fdc4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7215.ic21", 0x08000, 0xdfe75f3d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7207.ic11", 0x08000, 0xa2c07741, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7199.ic1", 0x08000, 0xb191e22f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7181.ic2", 0x08000, 0xb4740419, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-7234.ic73", 0x04000, 0xd6397933, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - { "epr-7233.ic72", 0x04000, 0x504e76d9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-7231.ic5", 0x08000, 0x871c6b14, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-7232.ic6", 0x08000, 0x4b59340c, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.ic123", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, - - { "315-5163a.ic32", 0x01000, 0x00000000, BRF_NODUMP }, -}; - - -STD_ROM_PICK(Sharrier) -STD_ROM_FN(Sharrier) - -static struct BurnRomInfo Sharrier1RomDesc[] = { - { "epr-7188.ic97", 0x08000, 0x7c30a036, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7184.ic84", 0x08000, 0x16deaeb1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7189.ic98", 0x08000, 0x40b1309f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7185.ic85", 0x08000, 0xce78045c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7190.ic99", 0x08000, 0xf6391091, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7186.ic86", 0x08000, 0x79b367d7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7191.ic100", 0x08000, 0x6171e9d3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7187.ic87", 0x08000, 0x70cb72ef, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7182.ic54", 0x08000, 0xd7c535b6, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-7183.ic67", 0x08000, 0xa6153af8, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-7196.ic31", 0x08000, 0x347fa325, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7197.ic46", 0x08000, 0x39d98bd1, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7198.ic60", 0x08000, 0x3da3ea6b, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7230.ic36", 0x08000, 0x93e2d264, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7222.ic28", 0x08000, 0xedbf5fc3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7214.ic18", 0x08000, 0xe8c537d8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7206.ic8", 0x08000, 0x22844fa4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7229.ic35", 0x08000, 0xcd6e7500, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7221.ic27", 0x08000, 0x41f25a9c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7213.ic17", 0x08000, 0x5bb09a67, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7205.ic7", 0x08000, 0xdcaa2ebf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7228.ic34", 0x08000, 0xd5e15e66, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7220.ic26", 0x08000, 0xac62ae2e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7212.ic16", 0x08000, 0x9c782295, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7204.ic6", 0x08000, 0x3711105c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7227.ic33", 0x08000, 0x60d7c1bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7219.ic25", 0x08000, 0xf6330038, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7211.ic15", 0x08000, 0x60737b98, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7203.ic5", 0x08000, 0x70fb5ebb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7226.ic32", 0x08000, 0x6d7b5c97, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7218.ic24", 0x08000, 0xcebf797c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7210.ic14", 0x08000, 0x24596a8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7202.ic4", 0x08000, 0xb537d082, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7225.ic31", 0x08000, 0x5e784271, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7217.ic23", 0x08000, 0x510e5e10, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7209.ic13", 0x08000, 0x7a2dad15, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7201.ic3", 0x08000, 0xf5ba4e08, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7224.ic30", 0x08000, 0xec42c9ef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7216.ic22", 0x08000, 0x6d4a7d7a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7208.ic12", 0x08000, 0x0f732717, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7200.ic2", 0x08000, 0xfc3bf8f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7223.ic29", 0x08000, 0xed51fdc4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7215.ic21", 0x08000, 0xdfe75f3d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7207.ic11", 0x08000, 0xa2c07741, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7199.ic1", 0x08000, 0xb191e22f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7181.ic2", 0x08000, 0xb4740419, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-7234.ic73", 0x04000, 0xd6397933, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - { "epr-7233.ic72", 0x04000, 0x504e76d9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-7231.ic5", 0x08000, 0x871c6b14, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-7232.ic6", 0x08000, 0x4b59340c, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-6844.ic123", 0x02000, 0xe3ec7bd6, SYS16_ROM_PROM | BRF_GRA }, - - { "315-5163.ic32", 0x01000, 0x00000000, BRF_NODUMP }, -}; - - -STD_ROM_PICK(Sharrier1) -STD_ROM_FN(Sharrier1) - -/*==================================================== -Memory Handlers -====================================================*/ - -void HangonPPI0WritePortA(UINT8 data) -{ - System16SoundLatch = data & 0xff; -} - -void HangonPPI0WritePortB(UINT8 data) -{ - System16VideoEnable = data & 0x10; - System16SpriteShadow = ~data & 0x40; - System16ScreenFlip = data & 0x80; -} - -void HangonPPI0WritePortC(UINT8 data) -{ - System16ColScroll = ~data & 0x04; - System16RowScroll = ~data & 0x02; - - if (!(data & 0x80)) { - ZetOpen(0); - ZetNmi(); - nSystem16CyclesDone[2] += ZetRun(100); - ZetClose(); - } -} - -UINT8 HangonPPI1ReadPortC() -{ - return 0x00; -} - -void HangonPPI1WritePortA(UINT8 data) -{ - System16AnalogSelect = (data >> 2) & 3; - - if (!(data & 0x40)) { - INT32 nLastCPU = nSekActive; - SekClose(); - SekOpen(1); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - SekOpen(nLastCPU); - } - if (data & 0x20) { - INT32 nLastCPU = nSekActive; - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(nLastCPU); - } -} - -UINT16 __fastcall HangonReadWord(UINT32 a) -{ - switch (a) { - case 0xe00000: - case 0xe00002: - case 0xe00004: - case 0xe00006: { - return ppi8255_r(0, (a - 0xe00000) >> 1); - } - - case 0xe01000: { - return 0xff - System16Input[0]; - } - - case 0xe0100a: { - return System16Dip[0]; - } - - case 0xe0100c: { - return System16Dip[1]; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Word -> 0x%06X\n"), a); -#endif - - return 0; -} - -UINT8 __fastcall HangonReadByte(UINT32 a) -{ - switch (a) { - case 0xe00001: - case 0xe00003: - case 0xe00005: - case 0xe00007: { - return ppi8255_r(0, (a - 0xe00000) >> 1); - } - - case 0xe01001: { - return 0xff - System16Input[0]; - } - - case 0xe0100b: { - return System16Dip[0]; - } - - case 0xe0100d: { - return System16Dip[1]; - } - - case 0xe03001: - case 0xe03003: - case 0xe03005: - case 0xe03007: { - return ppi8255_r(1, (a - 0xe03000) >> 1); - } - - case 0xe03021: { - if (System16ProcessAnalogControlsDo) return System16ProcessAnalogControlsDo(System16AnalogSelect); - return 0xff; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0; -} - -void __fastcall HangonWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x400000 && a <= 0x403fff) { - System16ATileByteWrite((a - 0x400000) ^ 1, d); - return; - } - - switch (a) { - case 0xe00001: - case 0xe00003: - case 0xe00005: - case 0xe00007: { - ppi8255_w(0, (a - 0xe00000) >> 1, d & 0xff); - return; - } - - case 0xe03001: - case 0xe03003: - case 0xe03005: - case 0xe03007: { - ppi8255_w(1, (a - 0xe03000) >> 1, d & 0xff); - return; - } - - case 0xe03021: { - return; - } - - - case 0xe00000: - case 0xe00002: { - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -void __fastcall HangonWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x400000 && a <= 0x403fff) { - System16ATileWordWrite(a - 0x400000, d); - return; - } - - switch (a) { - case 0xe00000: - case 0xe00002: - case 0xe00004: - case 0xe00006: { - ppi8255_w(0, (a - 0xe00000) >> 1, d & 0xff); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -static UINT16 __fastcall SharrierReadWord(UINT32 a) -{ - switch (a) { - case 0x140010: { - return (UINT16)(0xff - System16Input[0]); - } - - case 0x140012: { - return 0xffff; - } - - case 0x140014: { - return (UINT16)System16Dip[0]; - } - - case 0x140016: { - return (UINT16)System16Dip[1]; - } - } - - return 0; -} - -static UINT8 __fastcall SharrierReadByte(UINT32 a) -{ - switch (a) { - case 0x140001: - case 0x140003: - case 0x140005: - case 0x140007: { - return ppi8255_r(0, (a - 0x140000) >> 1); - } - - case 0x140011: { - return 0xff - System16Input[0]; - } - - case 0x140015: { - return System16Dip[0]; - } - - case 0x140021: - case 0x140023: - case 0x140025: - case 0x140027: { - return ppi8255_r(1, (a - 0x140020) >> 1); - } - - case 0x140031: { - if (System16ProcessAnalogControlsDo) return System16ProcessAnalogControlsDo(System16AnalogSelect); - return 0xff; - } - } - - return 0; -} - -static void __fastcall SharrierWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x100000 && a <= 0x107fff) { - System16ATileByteWrite((a - 0x100000) ^ 1, d); - return; - } - - switch (a) { - case 0x140001: - case 0x140003: - case 0x140005: - case 0x140007: { - ppi8255_w(0, (a - 0x140000) >> 1, d & 0xff); - return; - } - - case 0x140021: - case 0x140023: - case 0x140025: - case 0x140027: { - ppi8255_w(1, (a - 0x140020) >> 1, d & 0xff); - return; - } - - case 0x140031: { - return; - } - } -} - -static void __fastcall SharrierWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x100000 && a <= 0x107fff) { - System16ATileWordWrite(a - 0x100000, d); - return; - } -} - -/*==================================================== -Driver Inits -====================================================*/ - -static UINT8 EndurorProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - - // Accelerate - case 0: { - if (System16AnalogPort2 > 1) return 0xff; - return 0; - } - - // Brake - case 1: { - if (System16AnalogPort3 > 1) return 0xff; - return 0; - } - - // Bank Up / Down - case 2: { - - // Prevent CHAR data overflow - if((System16AnalogPort1 >> 4) > 0x7f && (System16AnalogPort1 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort1 >> 4); - } - - if (temp == 0x80) return 0x20; - if (temp > 0x80) return 0xff; - return 0; - } - - // Steering - case 3: { - - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) < 0xf82 && (System16AnalogPort0 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort0 >> 4); - } - - return temp; - } - } - - return 0; -} - -static UINT8 HangonProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - - // Steering - case 0: { - - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) < 0xf82 && (System16AnalogPort0 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort0 >> 4); - } - - if (temp < 0x20) temp = 0x20; - if (temp > 0xe0) temp = 0xe0; - return temp; - } - - // Accelerate - case 1: { - if (System16AnalogPort1 > 1) return 0xff; - return 0; - } - - // Brake - case 2: { - if (System16AnalogPort2 > 1) return 0xff; - return 0; - } - } - - return 0; -} - -static UINT8 SharrierProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - - // Left / Right - case 0: { - - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) < 0xf82 && (System16AnalogPort0 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort0 >> 4); - } - - if (temp < 0x20) temp = 0x20; - if (temp > 0xe0) temp = 0xe0; - return temp; - } - - // Up / Down - case 1: { - - // Prevent CHAR data overflow - if((System16AnalogPort1 >> 4) < 0xf82 && (System16AnalogPort1 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort1 >> 4); - } - - if (temp < 0x60) temp = 0x60; - if (temp > 0xa0) temp = 0xa0; - return temp; - } - } - - return 0; -} - -static void SharrierMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x03ffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x03ffff, MAP_FETCH); - SekMapMemory(System16Ram , 0x040000, 0x043fff, MAP_RAM); - SekMapMemory(System16TileRam , 0x100000, 0x107fff, MAP_READ); - SekMapMemory(System16TextRam , 0x108000, 0x108fff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x110000, 0x110fff, MAP_RAM); - SekMapMemory(System16ExtraRam , 0x124000, 0x127fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x130000, 0x130fff, MAP_RAM); - SekMapMemory(System16RoadRam , 0xc68000, 0xc68fff, MAP_RAM); - - SekSetReadWordHandler(0, SharrierReadWord); - SekSetReadByteHandler(0, SharrierReadByte); - SekSetWriteByteHandler(0, SharrierWriteByte); - SekSetWriteWordHandler(0, SharrierWriteWord); - SekClose(); -} - -static INT32 EndurorInit() -{ - System16Map68KDo = SharrierMap68K; - - System16ProcessAnalogControlsDo = EndurorProcessAnalogControls; - - System16ClockSpeed = 10000000; - - System16PCMDataSizePreAllocate = 0x18000; - - INT32 nRet = System16Init(); - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x10000); - memcpy(pTemp, System16PCMData, 0x10000); - memset(System16PCMData, 0, 0x18000); - memcpy(System16PCMData + 0x00000, pTemp + 0x00000, 0x8000); - memcpy(System16PCMData + 0x10000, pTemp + 0x08000, 0x8000); - BurnFree(pTemp); - - return nRet; -} - -static INT32 Enduror1Init() -{ - System16Map68KDo = SharrierMap68K; - - System16ProcessAnalogControlsDo = EndurorProcessAnalogControls; - - System16ClockSpeed = 10000000; - - return System16Init(); -} - -static INT32 EnduroblLoadRom() -{ - INT32 nRet = 1; - UINT8 *pTemp = (UINT8*)BurnMalloc(0x40000); - - if (pTemp) { - memcpy(pTemp, System16Rom, 0x40000); - memset(System16Rom, 0, 0x40000); - memcpy(System16Rom + 0x00000, pTemp + 0x10000, 0x10000); - memcpy(System16Rom + 0x10000, pTemp + 0x20000, 0x20000); - memcpy(System16Rom + 0x30000, pTemp + 0x00000, 0x10000); - BurnFree(pTemp); - nRet = 0; - } - - return nRet; -} - -static INT32 EnduroblDecryptOpCode() -{ - UINT16 *rom = (UINT16*)System16Rom; - UINT16 *decrypt = (UINT16*)System16Code; - memcpy(decrypt + 0x00000/2, rom + 0x30000/2, 0x10000); - memcpy(decrypt + 0x10000/2, rom + 0x10000/2, 0x20000); - - return 0; -} - -static INT32 EnduroblInit() -{ - System16CustomLoadRomDo = EnduroblLoadRom; - - System16CustomDecryptOpCodeDo = EnduroblDecryptOpCode; - - System16Map68KDo = SharrierMap68K; - - System16ProcessAnalogControlsDo = EndurorProcessAnalogControls; - - System16ClockSpeed = 10000000; - - return System16Init(); -} - -static INT32 HangonInit() -{ - System16ProcessAnalogControlsDo = HangonProcessAnalogControls; - - System16ClockSpeed = 25174800 / 4; - - INT32 nRet = System16Init(); - - if (!nRet) Hangon = true; - - return nRet; -} - -static INT32 ShangonrbInit() -{ - System16ProcessAnalogControlsDo = HangonProcessAnalogControls; - - System16ClockSpeed = 10000000; - - INT32 nRet = System16Init(); - - if (!nRet) Hangon = true; - - return nRet; -} - -static void Sharrier_Sim8751() -{ - *((UINT16*)(System16Ram + 0x00f0)) = 0; - - // Inputs - *((UINT16*)(System16Ram + 0x0492)) = BURN_ENDIAN_SWAP_INT16((UINT16)((SharrierProcessAnalogControls(0) << 8) | SharrierProcessAnalogControls(1))); -} - -static INT32 SharrierInit() -{ - Simulate8751 = Sharrier_Sim8751; - - System16Map68KDo = SharrierMap68K; - - System16ClockSpeed = 10000000; - - return System16Init(); -} - -/*==================================================== -Driver defs -====================================================*/ - -struct BurnDriver BurnDrvEnduror = { - "enduror", NULL, NULL, NULL, "1986", - "Enduro Racer (YM2151, FD1089B 317-0013A)\0", NULL, "Sega", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_FD1089B_ENC | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, EndurorRomInfo, EndurorRomName, NULL, NULL, EndurorInputInfo, EndurorDIPInfo, - EndurorInit, System16Exit, HangonFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEnduror1 = { - "enduror1", "enduror", NULL, NULL, "1986", - "Enduro Racer (YM2203, FD1089B 317-0013A)\0", NULL, "Sega", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_FD1089B_ENC | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_YM2203, GBF_RACING, 0, - NULL, Enduror1RomInfo, Enduror1RomName, NULL, NULL, EndurorInputInfo, EndurorDIPInfo, - Enduror1Init, System16Exit, HangonYM2203Frame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEndurobl = { - "endurobl", "enduror", NULL, NULL, "1986", - "Enduro Racer (bootleg set 1)\0", NULL, "bootleg", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_YM2203, GBF_RACING, 0, - NULL, EnduroblRomInfo, EnduroblRomName, NULL, NULL, EndurorInputInfo, EndurorDIPInfo, - EnduroblInit, System16Exit, HangonYM2203Frame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHangon = { - "hangon", NULL, NULL, NULL, "1985", - "Hang-On (rev A)\0", NULL, "Sega", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_YM2203, GBF_RACING, 0, - NULL, HangonRomInfo, HangonRomName, NULL, NULL, HangonInputInfo, HangonDIPInfo, - HangonInit, System16Exit, HangonYM2203Frame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHangon1 = { - "hangon1", "hangon", NULL, NULL, "1985", - "Hang-On\0", NULL, "Sega", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_YM2203, GBF_RACING, 0, - NULL, Hangon1RomInfo, Hangon1RomName, NULL, NULL, HangonInputInfo, HangonDIPInfo, - HangonInit, System16Exit, HangonYM2203Frame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHangon2 = { - "hangon2", "hangon", NULL, NULL, "1985", - "Hang-On (ride-on)\0", NULL, "Sega", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_YM2203, GBF_RACING, 0, - NULL, Hangon2RomInfo, Hangon2RomName, NULL, NULL, HangonInputInfo, HangonDIPInfo, - HangonInit, System16Exit, HangonYM2203Frame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvShangonro = { - "shangonro", "shangon", NULL, NULL, "1992", - "Super Hang-On (Hang-On conversion, ride-on, Japan, FD1094 317-0038)\0", NULL, "Sega", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_FD1094_ENC_CPU2, GBF_RACING, 0, - NULL, ShangonroRomInfo, ShangonroRomName, NULL, NULL, ShangonrbInputInfo, ShangonrbDIPInfo, - ShangonrbInit, System16Exit, HangonFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvShangonho = { - "shangonho", "shangon", NULL, NULL, "1992", - "Super Hang-On (Hang-On conversion, Japan, FD1094 317-0039)\0", NULL, "Sega", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_FD1094_ENC_CPU2, GBF_RACING, 0, - NULL, ShangonhoRomInfo, ShangonhoRomName, NULL, NULL, ShangonrbInputInfo, ShangonrbDIPInfo, - ShangonrbInit, System16Exit, HangonFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvShangonrb = { - "shangonrb", "shangon", NULL, NULL, "1992", - "Super Hang-On (Hang-On conversion, bootleg)\0", NULL, "bootleg", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_HANGON, GBF_RACING, 0, - NULL, ShangonrbRomInfo, ShangonrbRomName, NULL, NULL, ShangonrbInputInfo, ShangonrbDIPInfo, - ShangonrbInit, System16Exit, HangonFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSharrier = { - "sharrier", NULL, NULL, NULL, "1985", - "Space Harrier (Rev A, 8751 315-5163A)\0", NULL, "Sega", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_YM2203, GBF_SHOOT, 0, - NULL, SharrierRomInfo, SharrierRomName, NULL, NULL, SharrierInputInfo, SharrierDIPInfo, - SharrierInit, System16Exit, HangonYM2203Frame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSharrier1 = { - "sharrier1", "sharrier", NULL, NULL, "1985", - "Space Harrier (8751 315-5163)\0", NULL, "Sega", "Hang-On", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_HANGON | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_YM2203, GBF_SHOOT, 0, - NULL, Sharrier1RomInfo, Sharrier1RomName, NULL, NULL, SharrierInputInfo, SharrierDIPInfo, - SharrierInit, System16Exit, HangonYM2203Frame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_outrun.cpp b/jan/src/burn/drv/sega/d_outrun.cpp deleted file mode 100644 index 5c9bdf5ab..000000000 --- a/jan/src/burn/drv/sega/d_outrun.cpp +++ /dev/null @@ -1,2383 +0,0 @@ -#include "sys16.h" -#include "bitswap.h" - -/*==================================================== -Input Defs -====================================================*/ - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo OutrunInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - {"Gear" , BIT_DIGITAL , &System16Gear , "p1 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Outrun) - -static struct BurnInputInfo ShangonInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - {"Super Charger" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Shangon) - -static struct BurnInputInfo ToutrunInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - {"Gear" , BIT_DIGITAL , &System16Gear , "p1 fire 3" }, - {"Nitro" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 4" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Toutrun) - -#undef A - -/*==================================================== -Dip Defs -====================================================*/ - -#define OUTRUN_COINAGE(dipval) \ - {0 , 0xfe, 0 , 16 , "Coin A" }, \ - {dipval, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x05, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0x0f, 0x04, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x01, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0x0f, 0x02, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0x0f, 0x03, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0x0f, 0x00, "Free Play (if coin B too) or 1C/1C" }, \ - \ - {0 , 0xfe, 0 , 16 , "Coin B" }, \ - {dipval, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x50, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0xf0, 0x40, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x10, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0xf0, 0x20, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0xf0, 0x30, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0xf0, 0x00, "Free Play (if coin A too) or 1C/1C" }, - -static struct BurnDIPInfo OutrunDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xf9, NULL }, - - // Dip 1 - OUTRUN_COINAGE(0x0a) - - // Dip 2 - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x0b, 0x01, 0x03, 0x03, "Moving" }, - {0x0b, 0x01, 0x03, 0x02, "Up Cockpit" }, - {0x0b, 0x01, 0x03, 0x01, "Mini Up" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0b, 0x01, 0x30, 0x20, "Easy" }, - {0x0b, 0x01, 0x30, 0x30, "Normal" }, - {0x0b, 0x01, 0x30, 0x10, "Hard" }, - {0x0b, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0xc0, 0x80, "Easy" }, - {0x0b, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0b, 0x01, 0xc0, 0x40, "Hard" }, - {0x0b, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Outrun) - -static struct BurnDIPInfo OutrunehDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xf9, NULL }, - - // Dip 1 - OUTRUN_COINAGE(0x0a) - - // Dip 2 - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x0b, 0x01, 0x03, 0x03, "Moving" }, - {0x0b, 0x01, 0x03, 0x02, "Up Cockpit" }, - {0x0b, 0x01, 0x03, 0x01, "Mini Up" }, - - {0 , 0xfe, 0 , 2 , "Speed Indicator" }, - {0x0b, 0x01, 0x08, 0x08, "km/h" }, - {0x0b, 0x01, 0x08, 0x00, "MPH" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0b, 0x01, 0x30, 0x20, "Easy" }, - {0x0b, 0x01, 0x30, 0x30, "Normal" }, - {0x0b, 0x01, 0x30, 0x10, "Hard" }, - {0x0b, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0xc0, 0x80, "Easy" }, - {0x0b, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0b, 0x01, 0xc0, 0x40, "Hard" }, - {0x0b, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Outruneh) - -static struct BurnDIPInfo OutrundxDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - OUTRUN_COINAGE(0x0a) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x01, 0x00, "Not Moving" }, - {0x0b, 0x01, 0x01, 0x01, "Moving" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0b, 0x01, 0x30, 0x20, "Easy" }, - {0x0b, 0x01, 0x30, 0x30, "Normal" }, - {0x0b, 0x01, 0x30, 0x10, "Hard" }, - {0x0b, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0xc0, 0x80, "Easy" }, - {0x0b, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0b, 0x01, 0xc0, 0x40, "Hard" }, - {0x0b, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Outrundx) - -static struct BurnDIPInfo OutrundxehDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - OUTRUN_COINAGE(0x0a) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x01, 0x00, "Not Moving" }, - {0x0b, 0x01, 0x01, 0x01, "Moving" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Speed Indicator" }, - {0x0b, 0x01, 0x08, 0x08, "km/h" }, - {0x0b, 0x01, 0x08, 0x00, "MPH" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0b, 0x01, 0x30, 0x20, "Easy" }, - {0x0b, 0x01, 0x30, 0x30, "Normal" }, - {0x0b, 0x01, 0x30, 0x10, "Hard" }, - {0x0b, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0xc0, 0x80, "Easy" }, - {0x0b, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0b, 0x01, 0xc0, 0x40, "Hard" }, - {0x0b, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Outrundxeh) - -static struct BurnDIPInfo ShangonDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0x1e, NULL }, - - // Dip 1 - OUTRUN_COINAGE(0x0a) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0x06, 0x04, "Easy" }, - {0x0b, 0x01, 0x06, 0x06, "Normal" }, - {0x0b, 0x01, 0x06, 0x02, "Hard" }, - {0x0b, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0b, 0x01, 0x18, 0x10, "Easy" }, - {0x0b, 0x01, 0x18, 0x18, "Normal" }, - {0x0b, 0x01, 0x18, 0x08, "Hard" }, - {0x0b, 0x01, 0x18, 0x00, "Hardest" }, -}; - -STDDIPINFO(Shangon) - -static struct BurnDIPInfo ToutrunDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xd9, NULL }, - - // Dip 1 - OUTRUN_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Cabinet" }, - {0x0c, 0x01, 0x03, 0x03, "Moving" }, - {0x0c, 0x01, 0x03, 0x02, "Cockpit Conversion" }, - {0x0c, 0x01, 0x03, 0x01, "Mini Up" }, - {0x0c, 0x01, 0x03, 0x00, "Cockpit" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Turbo" }, - {0x0c, 0x01, 0x08, 0x00, "Use start button" }, - {0x0c, 0x01, 0x08, 0x08, "Use turbo shifter" }, - - {0 , 0xfe, 0 , 4 , "Credits" }, - {0x0c, 0x01, 0x30, 0x20, "3 to start/2 to continue" }, - {0x0c, 0x01, 0x30, 0x30, "2 to start/1 to continue" }, - {0x0c, 0x01, 0x30, 0x10, "1 to start/1 to continue" }, - {0x0c, 0x01, 0x30, 0x00, "2 to start/2 to continue" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x80, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x40, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Toutrun) - -static struct BurnDIPInfo ToutruncDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xd8, NULL }, - - // Dip 1 - OUTRUN_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 1 , "Cabinet" }, - {0x0c, 0x01, 0x03, 0x00, "Cockpit" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 1 , "Turbo" }, - {0x0c, 0x01, 0x08, 0x08, "Use turbo shifter" }, - - {0 , 0xfe, 0 , 4 , "Credits" }, - {0x0c, 0x01, 0x30, 0x20, "3 to start/2 to continue" }, - {0x0c, 0x01, 0x30, 0x30, "2 to start/1 to continue" }, - {0x0c, 0x01, 0x30, 0x10, "1 to start/1 to continue" }, - {0x0c, 0x01, 0x30, 0x00, "2 to start/2 to continue" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x80, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x40, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Toutrunc) - -static struct BurnDIPInfo ToutrunmDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xdb, NULL }, - - // Dip 1 - OUTRUN_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 1 , "Cabinet" }, - {0x0c, 0x01, 0x03, 0x03, "Moving" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Turbo" }, - {0x0c, 0x01, 0x08, 0x00, "Use start button" }, - {0x0c, 0x01, 0x08, 0x08, "Use turbo shifter" }, - - {0 , 0xfe, 0 , 4 , "Credits" }, - {0x0c, 0x01, 0x30, 0x20, "3 to start/2 to continue" }, - {0x0c, 0x01, 0x30, 0x30, "2 to start/1 to continue" }, - {0x0c, 0x01, 0x30, 0x10, "1 to start/1 to continue" }, - {0x0c, 0x01, 0x30, 0x00, "2 to start/2 to continue" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x80, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x40, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Toutrunm) - -static struct BurnDIPInfo ToutrunctDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xd8, NULL }, - - // Dip 1 - OUTRUN_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 1 , "Cabinet" }, - {0x0c, 0x01, 0x03, 0x00, "Cockpit" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 1 , "Turbo" }, - {0x0c, 0x01, 0x08, 0x08, "Use turbo shifter" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0c, 0x01, 0x30, 0x20, "Easy" }, - {0x0c, 0x01, 0x30, 0x30, "Normal" }, - {0x0c, 0x01, 0x30, 0x10, "Hard" }, - {0x0c, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x80, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x40, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Toutrunct) - -#undef OUTRUN_COINAGE - -/*==================================================== -Rom Defs -====================================================*/ - -static struct BurnRomInfo OutrunRomDesc[] = { - { "epr-10380b.133", 0x10000, 0x1f6cadad, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10382b.118", 0x10000, 0xc4c3fa1a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10381b.132", 0x10000, 0xbe8c412b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10383b.117", 0x10000, 0x10a2014a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10327a.76", 0x10000, 0xe28a5baf, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10329a.58", 0x10000, 0xda131c81, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10328a.75", 0x10000, 0xd5ec5e5d, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10330a.57", 0x10000, 0xba9ec82a, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-10268.99", 0x08000, 0x95344b04, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10232.102", 0x08000, 0x776ba1eb, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10267.100", 0x08000, 0xa85bb823, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10231.103", 0x08000, 0x8908bcbf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10266.101", 0x08000, 0x9f6f1a74, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10230.104", 0x08000, 0x686f5e50, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-10371.9", 0x20000, 0x7cc86208, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10373.10", 0x20000, 0xb0d26ac9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10375.11", 0x20000, 0x59b60bd7, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10377.12", 0x20000, 0x17a1b04a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10372.13", 0x20000, 0xb557078c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10374.14", 0x20000, 0x8051e517, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10376.15", 0x20000, 0xf3b8f318, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10378.16", 0x20000, 0xa1062984, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-10186.47", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - { "opr-10185.11", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10187.88", 0x08000, 0xa10abaa9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-10193.66", 0x08000, 0xbcd10dde, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10192.67", 0x08000, 0x770f1270, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10191.68", 0x08000, 0x20a284ab, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10190.69", 0x08000, 0x7cab70e2, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10189.70", 0x08000, 0x01366b54, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10188.71", 0x08000, 0xbad30ad9, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Outrun) -STD_ROM_FN(Outrun) - -static struct BurnRomInfo OutrunraRomDesc[] = { - { "epr-10380a.133", 0x10000, 0x434fadbc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10382a.118", 0x10000, 0x1ddcc04e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10381a.132", 0x10000, 0xbe8c412b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10383a.117", 0x10000, 0xdcc586e7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10327a.76", 0x10000, 0xe28a5baf, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10329a.58", 0x10000, 0xda131c81, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10328a.75", 0x10000, 0xd5ec5e5d, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10330a.57", 0x10000, 0xba9ec82a, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-10268.99", 0x08000, 0x95344b04, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10232.102", 0x08000, 0x776ba1eb, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10267.100", 0x08000, 0xa85bb823, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10231.103", 0x08000, 0x8908bcbf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10266.101", 0x08000, 0x9f6f1a74, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10230.104", 0x08000, 0x686f5e50, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-10371.9", 0x20000, 0x7cc86208, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10373.10", 0x20000, 0xb0d26ac9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10375.11", 0x20000, 0x59b60bd7, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10377.12", 0x20000, 0x17a1b04a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10372.13", 0x20000, 0xb557078c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10374.14", 0x20000, 0x8051e517, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10376.15", 0x20000, 0xf3b8f318, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10378.16", 0x20000, 0xa1062984, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-10186.47", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - { "opr-10185.11", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10187.88", 0x08000, 0xa10abaa9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-10193.66", 0x08000, 0xbcd10dde, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10192.67", 0x08000, 0x770f1270, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10191.68", 0x08000, 0x20a284ab, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10190.69", 0x08000, 0x7cab70e2, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10189.70", 0x08000, 0x01366b54, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10188.71", 0x08000, 0xbad30ad9, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Outrunra) -STD_ROM_FN(Outrunra) - -static struct BurnRomInfo OutrunehRomDesc[] = { - { "enhanced_110_epr-10380b.133", 0x10000, 0x30d6ab84, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "enhanced_110_epr-10382b.118", 0x10000, 0x62041a21, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "enhanced_110_epr-10381b.132", 0x10000, 0xa3cc8db5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "enhanced_110_epr-10383b.117", 0x10000, 0x21ab78a0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10327a.76", 0x10000, 0xe28a5baf, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10329a.58", 0x10000, 0xda131c81, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10328a.75", 0x10000, 0xd5ec5e5d, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10330a.57", 0x10000, 0xba9ec82a, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-10268.99", 0x08000, 0x95344b04, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10232.102", 0x08000, 0x776ba1eb, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10267.100", 0x08000, 0xa85bb823, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10231.103", 0x08000, 0x8908bcbf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10266.101", 0x08000, 0x9f6f1a74, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10230.104", 0x08000, 0x686f5e50, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-10371.9", 0x20000, 0x7cc86208, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10373.10", 0x20000, 0xb0d26ac9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10375.11", 0x20000, 0x59b60bd7, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10377.12", 0x20000, 0x17a1b04a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10372.13", 0x20000, 0xb557078c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10374.14", 0x20000, 0x8051e517, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10376.15", 0x20000, 0xf3b8f318, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10378.16", 0x20000, 0xa1062984, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-10186.47", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - { "opr-10185.11", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10187.88", 0x08000, 0xa10abaa9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-10193.66", 0x08000, 0xbcd10dde, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10192.67", 0x08000, 0x770f1270, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10191.68", 0x08000, 0x20a284ab, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10190.69", 0x08000, 0x7cab70e2, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10189.70", 0x08000, 0x01366b54, SYS16_ROM_PCMDATA | BRF_SND }, - { "enhanced_103_opr-10188.71", 0x08000, 0x37598616, SYS16_ROM_PCMDATA | BRF_SND }, // unofficial replacement for factory defective opr-10188 -}; - - -STD_ROM_PICK(Outruneh) -STD_ROM_FN(Outruneh) - -static struct BurnRomInfo OutrundxRomDesc[] = { - { "epr-10380.133", 0x10000, 0xe339e87a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10382.118", 0x10000, 0x65248dd5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10381.132", 0x10000, 0xbe8c412b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10383.117", 0x10000, 0xdcc586e7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10327.76", 0x10000, 0xda99d855, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10329.58", 0x10000, 0xfe0fa5e2, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10328.75", 0x10000, 0x3c0e9a7f, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10330.57", 0x10000, 0x59786e99, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-10268.99", 0x08000, 0x95344b04, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10232.102", 0x08000, 0x776ba1eb, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10267.100", 0x08000, 0xa85bb823, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10231.103", 0x08000, 0x8908bcbf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10266.101", 0x08000, 0x9f6f1a74, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10230.104", 0x08000, 0x686f5e50, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10194.26", 0x08000, 0xf0eda3bd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10203.38", 0x08000, 0x8445a622, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10212.52", 0x08000, 0xdee7e731, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10221.66", 0x08000, 0x43431387, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10195.27", 0x08000, 0x0de75cdd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10204.39", 0x08000, 0x5f4b5abb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10213.53", 0x08000, 0x1d1b22f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10222.67", 0x08000, 0xa254c706, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10196.28", 0x08000, 0x8688bb59, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10205.40", 0x08000, 0x74bd93ca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10214.54", 0x08000, 0x57527e18, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10223.68", 0x08000, 0x3850690e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10197.29", 0x08000, 0x009165a6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10206.41", 0x08000, 0x954542c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10215.55", 0x08000, 0x69be5a6c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10224.69", 0x08000, 0x5cffc346, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10198.30", 0x08000, 0xd894992e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10207.42", 0x08000, 0xca61cea4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10216.56", 0x08000, 0xd394134d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10225.70", 0x08000, 0x0a5d1f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10199.31", 0x08000, 0x86376af6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10208.43", 0x08000, 0x6830b7fa, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10217.57", 0x08000, 0xbf2c9b76, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10226.71", 0x08000, 0x5a452474, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10200.32", 0x08000, 0x1e5d4f73, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10209.44", 0x08000, 0x5c15419e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10218.58", 0x08000, 0xdb4bdb39, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10227.72", 0x08000, 0xc7def392, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10201.33", 0x08000, 0x1d9d4b9c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10210.45", 0x08000, 0x39422931, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10219.59", 0x08000, 0xe73b9224, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10228.73", 0x08000, 0x25803978, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-10186.47", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - { "opr-10185.11", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10187.88", 0x08000, 0xa10abaa9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-10193.66", 0x08000, 0xbcd10dde, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10192.67", 0x08000, 0x770f1270, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10191.68", 0x08000, 0x20a284ab, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10190.69", 0x08000, 0x7cab70e2, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10189.70", 0x08000, 0x01366b54, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10188.71", 0x08000, 0xbad30ad9, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Outrundx) -STD_ROM_FN(Outrundx) - -static struct BurnRomInfo OutrundxjRomDesc[] = { - { "epr-10331.ic133", 0x10000, 0x64a7f657, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10333.ic118", 0x10000, 0xfce8394e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10332.ic132", 0x10000, 0x53d298d7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10334.ic117", 0x10000, 0xff22ad0b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10327.76", 0x10000, 0xda99d855, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10329.58", 0x10000, 0xfe0fa5e2, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10328.75", 0x10000, 0x3c0e9a7f, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10330.57", 0x10000, 0x59786e99, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-10268.99", 0x08000, 0x95344b04, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10232.102", 0x08000, 0x776ba1eb, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10267.100", 0x08000, 0xa85bb823, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10231.103", 0x08000, 0x8908bcbf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10266.101", 0x08000, 0x9f6f1a74, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10230.104", 0x08000, 0x686f5e50, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-10371.9", 0x20000, 0x7cc86208, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10373.10", 0x20000, 0xb0d26ac9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10375.11", 0x20000, 0x59b60bd7, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10377.12", 0x20000, 0x17a1b04a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10372.13", 0x20000, 0xb557078c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10374.14", 0x20000, 0x8051e517, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10376.15", 0x20000, 0xf3b8f318, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10378.16", 0x20000, 0xa1062984, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-10186.47", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - { "opr-10185.11", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10187.88", 0x08000, 0xa10abaa9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-10193.66", 0x08000, 0xbcd10dde, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10192.67", 0x08000, 0x770f1270, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10191.68", 0x08000, 0x20a284ab, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10190.69", 0x08000, 0x7cab70e2, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10189.70", 0x08000, 0x01366b54, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10188.71", 0x08000, 0xbad30ad9, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0019.key", 0x02000, 0x6ff847c6, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Outrundxj) -STD_ROM_FN(Outrundxj) - -static struct BurnRomInfo OutrundxaRomDesc[] = { - { "epr-10183.115", 0x08000, 0x3d992396, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10261.130", 0x08000, 0x1d034847, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10184.116", 0x08000, 0x1a73dc46, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10262.131", 0x08000, 0x5386b6b3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10258.117", 0x08000, 0x39408e4f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10263.132", 0x08000, 0xeda65fd6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10259.118", 0x08000, 0x95100b1a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10264.133", 0x08000, 0xcc94b102, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10173.66", 0x08000, 0x6c2775c0, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10178.86", 0x08000, 0x6d36be05, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10174.67", 0x08000, 0xaae7efad, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10179.87", 0x08000, 0x180fd041, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10175.68", 0x08000, 0x31c76063, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10180.88", 0x08000, 0x4713b264, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10176.69", 0x08000, 0xa7811f90, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10181.89", 0x08000, 0xe009a04d, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-10268.99", 0x08000, 0x95344b04, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10232.102", 0x08000, 0x776ba1eb, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10267.100", 0x08000, 0xa85bb823, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10231.103", 0x08000, 0x8908bcbf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10266.101", 0x08000, 0x9f6f1a74, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10230.104", 0x08000, 0x686f5e50, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10194.26", 0x08000, 0xf0eda3bd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10203.38", 0x08000, 0x8445a622, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10212.52", 0x08000, 0xdee7e731, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10221.66", 0x08000, 0x43431387, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10195.27", 0x08000, 0x0de75cdd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10204.39", 0x08000, 0x5f4b5abb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10213.53", 0x08000, 0x1d1b22f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10222.67", 0x08000, 0xa254c706, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10196.28", 0x08000, 0x8688bb59, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10205.40", 0x08000, 0x74bd93ca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10214.54", 0x08000, 0x57527e18, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10223.68", 0x08000, 0x3850690e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10197.29", 0x08000, 0x009165a6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10206.41", 0x08000, 0x954542c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10215.55", 0x08000, 0x69be5a6c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10224.69", 0x08000, 0x5cffc346, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10198.30", 0x08000, 0xd894992e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10207.42", 0x08000, 0xca61cea4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10216.56", 0x08000, 0xd394134d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10225.70", 0x08000, 0x0a5d1f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10199.31", 0x08000, 0x86376af6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10208.43", 0x08000, 0x6830b7fa, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10217.57", 0x08000, 0xbf2c9b76, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10226.71", 0x08000, 0x5a452474, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10200.32", 0x08000, 0x1e5d4f73, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10209.44", 0x08000, 0x5c15419e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10218.58", 0x08000, 0xdb4bdb39, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10227.72", 0x08000, 0xc7def392, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10201.33", 0x08000, 0x1d9d4b9c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10210.45", 0x08000, 0x39422931, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10219.59", 0x08000, 0xe73b9224, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10228.73", 0x08000, 0x25803978, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-10186.47", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - { "opr-10185.11", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10187.88", 0x08000, 0xa10abaa9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-10193.66", 0x08000, 0xbcd10dde, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10192.67", 0x08000, 0x770f1270, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10191.68", 0x08000, 0x20a284ab, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10190.69", 0x08000, 0x7cab70e2, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10189.70", 0x08000, 0x01366b54, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10188.71", 0x08000, 0xbad30ad9, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Outrundxa) -STD_ROM_FN(Outrundxa) - -static struct BurnRomInfo OutrundxehRomDesc[] = { - { "enhanced_103_epr-10380.133", 0x10000, 0x0e7db21f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "enhanced_103_epr-10382.118", 0x10000, 0x4e1ded90, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "enhanced_103_epr-10381.132", 0x10000, 0x5f8ef718, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "enhanced_103_epr-10383.117", 0x10000, 0x9794985b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10327.76", 0x10000, 0xda99d855, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10329.58", 0x10000, 0xfe0fa5e2, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10328.75", 0x10000, 0x3c0e9a7f, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10330.57", 0x10000, 0x59786e99, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-10268.99", 0x08000, 0x95344b04, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10232.102", 0x08000, 0x776ba1eb, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10267.100", 0x08000, 0xa85bb823, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10231.103", 0x08000, 0x8908bcbf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10266.101", 0x08000, 0x9f6f1a74, SYS16_ROM_TILES | BRF_GRA }, - { "opr-10230.104", 0x08000, 0x686f5e50, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10194.26", 0x08000, 0xf0eda3bd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10203.38", 0x08000, 0x8445a622, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10212.52", 0x08000, 0xdee7e731, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10221.66", 0x08000, 0x43431387, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10195.27", 0x08000, 0x0de75cdd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10204.39", 0x08000, 0x5f4b5abb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10213.53", 0x08000, 0x1d1b22f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10222.67", 0x08000, 0xa254c706, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10196.28", 0x08000, 0x8688bb59, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10205.40", 0x08000, 0x74bd93ca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10214.54", 0x08000, 0x57527e18, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10223.68", 0x08000, 0x3850690e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10197.29", 0x08000, 0x009165a6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10206.41", 0x08000, 0x954542c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10215.55", 0x08000, 0x69be5a6c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10224.69", 0x08000, 0x5cffc346, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10198.30", 0x08000, 0xd894992e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10207.42", 0x08000, 0xca61cea4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10216.56", 0x08000, 0xd394134d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10225.70", 0x08000, 0x0a5d1f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10199.31", 0x08000, 0x86376af6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10208.43", 0x08000, 0x6830b7fa, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10217.57", 0x08000, 0xbf2c9b76, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10226.71", 0x08000, 0x5a452474, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10200.32", 0x08000, 0x1e5d4f73, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10209.44", 0x08000, 0x5c15419e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10218.58", 0x08000, 0xdb4bdb39, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10227.72", 0x08000, 0xc7def392, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10201.33", 0x08000, 0x1d9d4b9c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10210.45", 0x08000, 0x39422931, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10219.59", 0x08000, 0xe73b9224, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10228.73", 0x08000, 0x25803978, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-10186.47", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - { "opr-10185.11", 0x08000, 0x22794426, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10187.88", 0x08000, 0xa10abaa9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-10193.66", 0x08000, 0xbcd10dde, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10192.67", 0x08000, 0x770f1270, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10191.68", 0x08000, 0x20a284ab, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10190.69", 0x08000, 0x7cab70e2, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-10189.70", 0x08000, 0x01366b54, SYS16_ROM_PCMDATA | BRF_SND }, - { "enhanced_103_opr-10188.71", 0x08000, 0x37598616, SYS16_ROM_PCMDATA | BRF_SND }, // unofficial replacement for factory defective opr-10188 -}; - - -STD_ROM_PICK(Outrundxeh) -STD_ROM_FN(Outrundxeh) - -static struct BurnRomInfo OutrunbRomDesc[] = { - { "a-10.bin", 0x10000, 0xcddceea2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "a-9.bin", 0x10000, 0x14e97a67, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "a-14.bin", 0x10000, 0x3092d857, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "a-13.bin", 0x10000, 0x30a1c496, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "a-8.bin", 0x10000, 0xd7f5aae0, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "a-7.bin", 0x10000, 0x88c2e78f, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "a-12.bin", 0x10000, 0xd5ec5e5d, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "a-11.bin", 0x10000, 0x74c5fbec, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "a-15.bin", 0x10000, 0x4c489133, SYS16_ROM_TILES | BRF_GRA }, - { "a-17.bin", 0x10000, 0x899c781d, SYS16_ROM_TILES | BRF_GRA }, - { "a-16.bin", 0x10000, 0x98dd4d15, SYS16_ROM_TILES | BRF_GRA }, - - { "a-18.bin", 0x10000, 0x77377e00, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-20.bin", 0x10000, 0x69ecc975, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-22.bin", 0x10000, 0xb6a8d0e2, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-24.bin", 0x10000, 0xd632d8a2, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-26.bin", 0x10000, 0x4f784236, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-28.bin", 0x10000, 0xee4f7154, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-30.bin", 0x10000, 0xe9880aa3, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-32.bin", 0x10000, 0xdc286dc2, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-19.bin", 0x10000, 0x2c0e7277, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-21.bin", 0x10000, 0x54761e57, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-23.bin", 0x10000, 0xa00d0676, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-25.bin", 0x10000, 0xda398368, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-27.bin", 0x10000, 0x8d459356, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-29.bin", 0x10000, 0xa8245727, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-31.bin", 0x10000, 0xef7d06fe, SYS16_ROM_SPRITES | BRF_GRA }, - { "a-33.bin", 0x10000, 0x1222af9f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "a-2.bin", 0x08000, 0xed5bda9c, SYS16_ROM_ROAD | BRF_GRA }, - { "a-3.bin", 0x08000, 0x666fe754, SYS16_ROM_ROAD | BRF_GRA }, - - { "a-1.bin", 0x08000, 0x209bb53a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "a-6.bin", 0x10000, 0x191f98f4, SYS16_ROM_PCMDATA | BRF_SND }, - { "a-5.bin", 0x10000, 0x374466d0, SYS16_ROM_PCMDATA | BRF_SND }, - { "a-4.bin", 0x10000, 0x2a27d0b0, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Outrunb) -STD_ROM_FN(Outrunb) - -static struct BurnRomInfo ShangonRomDesc[] = { - { "epr-10886.133", 0x10000, 0x8be3cd36, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10884.118", 0x10000, 0xcb06150d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10887.132", 0x10000, 0x8d248bb0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10885.117", 0x10000, 0x70795f26, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10792.76", 0x10000, 0x16299d25, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10790.58", 0x10000, 0x2246cbc1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10793.75", 0x10000, 0xd9525427, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10791.57", 0x10000, 0x5faf4cbe, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10652.54", 0x08000, 0x260286f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10651.55", 0x08000, 0xc609ee7b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10650.56", 0x08000, 0xb236a403, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-10794.8", 0x20000, 0x7c958e63, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10798.16", 0x20000, 0x7d58f807, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10795.6", 0x20000, 0xd9d31f8c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10799.14", 0x20000, 0x96d90d3d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10796.4", 0x20000, 0xfb48957c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10800.12", 0x20000, 0xfeaff98e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10797.2", 0x20000, 0x27f2870d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10801.10", 0x20000, 0x12781795, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10642.47", 0x08000, 0x7836bcc3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10649c.88", 0x08000, 0xf6c1ce71, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10643.66", 0x08000, 0x06f55364, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10644.67", 0x08000, 0xb41d541d, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10645.68", 0x08000, 0xa60dabff, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10646.69", 0x08000, 0x473cc411, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shangon) -STD_ROM_FN(Shangon) - -static struct BurnRomInfo Shangon1RomDesc[] = { - { "epr-10636.133", 0x10000, 0xe52721fe, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10634.118", 0x10000, 0x08feca97, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10637.132", 0x10000, 0x5d55d65f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10635.117", 0x10000, 0xb967e8c3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10640.76", 0x10000, 0x02be68db, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10638.58", 0x10000, 0xf13e8bee, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10641.75", 0x10000, 0x38c3f808, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10639.57", 0x10000, 0x8cdbcde8, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10652.54", 0x08000, 0x260286f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10651.55", 0x08000, 0xc609ee7b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10650.56", 0x08000, 0xb236a403, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10675.8", 0x10000, 0xd6ac012b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10682.16", 0x10000, 0xd9d83250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10676.7", 0x10000, 0x25ebf2c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10683.15", 0x10000, 0x6365d2e9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10677.6", 0x10000, 0x8a57b8d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10684.14", 0x10000, 0x3aff8910, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10678.5", 0x10000, 0xaf473098, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10685.13", 0x10000, 0x80bafeef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10679.4", 0x10000, 0x03bc4878, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10686.12", 0x10000, 0x274b734e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10680.3", 0x10000, 0x9f0677ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10687.11", 0x10000, 0x508a4701, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10681.2", 0x10000, 0xb176ea72, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10688.10", 0x10000, 0x42fcd51d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10642.47", 0x08000, 0x7836bcc3, SYS16_ROM_ROAD | BRF_GRA }, - - { "ic88", 0x08000, 0x1254efa6, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10643.66", 0x08000, 0x06f55364, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10644.67", 0x08000, 0xb41d541d, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10645.68", 0x08000, 0xa60dabff, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10646.69", 0x08000, 0x473cc411, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0034.key", 0x02000, 0x263ca773, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Shangon1) -STD_ROM_FN(Shangon1) - -static struct BurnRomInfo Shangon2RomDesc[] = { - { "epr-10636a.133", 0x10000, 0x74a64f4f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10634a.118", 0x10000, 0x1608cb4a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10637a.132", 0x10000, 0xad6c1308, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10635a.117", 0x10000, 0xa2415595, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10640.76", 0x10000, 0x02be68db, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10638.58", 0x10000, 0xf13e8bee, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10641.75", 0x10000, 0x38c3f808, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10639.57", 0x10000, 0x8cdbcde8, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10652.54", 0x08000, 0x260286f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10651.55", 0x08000, 0xc609ee7b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10650.56", 0x08000, 0xb236a403, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10675.8", 0x10000, 0xd6ac012b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10682.16", 0x10000, 0xd9d83250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10676.7", 0x10000, 0x25ebf2c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10683.15", 0x10000, 0x6365d2e9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10677.6", 0x10000, 0x8a57b8d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10684.14", 0x10000, 0x3aff8910, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10678.5", 0x10000, 0xaf473098, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10685.13", 0x10000, 0x80bafeef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10679.4", 0x10000, 0x03bc4878, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10686.12", 0x10000, 0x274b734e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10680.3", 0x10000, 0x9f0677ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10687.11", 0x10000, 0x508a4701, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10681.2", 0x10000, 0xb176ea72, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10688.10", 0x10000, 0x42fcd51d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10642.47", 0x08000, 0x7836bcc3, SYS16_ROM_ROAD | BRF_GRA }, - - { "ic88", 0x08000, 0x1254efa6, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10643.66", 0x08000, 0x06f55364, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10644.67", 0x08000, 0xb41d541d, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10645.68", 0x08000, 0xa60dabff, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10646.69", 0x08000, 0x473cc411, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0034.key", 0x02000, 0x263ca773, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Shangon2) -STD_ROM_FN(Shangon2) - -static struct BurnRomInfo Shangon3RomDesc[] = { - { "epr-10789.133", 0x10000, 0x6092c5ce, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10788.118", 0x10000, 0xc3d8a1ea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10637a.132", 0x10000, 0xad6c1308, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10635a.117", 0x10000, 0xa2415595, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10792.76", 0x10000, 0x16299d25, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10790.58", 0x10000, 0x2246cbc1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10793.75", 0x10000, 0xd9525427, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10791.57", 0x10000, 0x5faf4cbe, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10652.54", 0x08000, 0x260286f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10651.55", 0x08000, 0xc609ee7b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10650.56", 0x08000, 0xb236a403, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10675.8", 0x10000, 0xd6ac012b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10682.16", 0x10000, 0xd9d83250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10676.7", 0x10000, 0x25ebf2c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10683.15", 0x10000, 0x6365d2e9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10677.6", 0x10000, 0x8a57b8d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10684.14", 0x10000, 0x3aff8910, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10678.5", 0x10000, 0xaf473098, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10685.13", 0x10000, 0x80bafeef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10679.4", 0x10000, 0x03bc4878, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10686.12", 0x10000, 0x274b734e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10680.3", 0x10000, 0x9f0677ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10687.11", 0x10000, 0x508a4701, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10681.2", 0x10000, 0xb176ea72, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10688.10", 0x10000, 0x42fcd51d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10642.47", 0x08000, 0x7836bcc3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10649a.88", 0x08000, 0xbf38330f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10643.66", 0x08000, 0x06f55364, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10644.67", 0x08000, 0xb41d541d, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10645.68", 0x08000, 0xa60dabff, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10646.69", 0x08000, 0x473cc411, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0034.key", 0x02000, 0x263ca773, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Shangon3) -STD_ROM_FN(Shangon3) - -static struct BurnRomInfo Shangon3dRomDesc[] = { - { "bootleg_epr-10789.133", 0x10000, 0x9ec9b552, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-10788.118", 0x10000, 0x693821c4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-10637a.132", 0x10000, 0xa67a65b5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-10635a.117", 0x10000, 0x689961b9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10792.76", 0x10000, 0x16299d25, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10790.58", 0x10000, 0x2246cbc1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10793.75", 0x10000, 0xd9525427, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10791.57", 0x10000, 0x5faf4cbe, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10652.54", 0x08000, 0x260286f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10651.55", 0x08000, 0xc609ee7b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10650.56", 0x08000, 0xb236a403, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10675.8", 0x10000, 0xd6ac012b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10682.16", 0x10000, 0xd9d83250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10676.7", 0x10000, 0x25ebf2c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10683.15", 0x10000, 0x6365d2e9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10677.6", 0x10000, 0x8a57b8d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10684.14", 0x10000, 0x3aff8910, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10678.5", 0x10000, 0xaf473098, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10685.13", 0x10000, 0x80bafeef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10679.4", 0x10000, 0x03bc4878, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10686.12", 0x10000, 0x274b734e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10680.3", 0x10000, 0x9f0677ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10687.11", 0x10000, 0x508a4701, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10681.2", 0x10000, 0xb176ea72, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10688.10", 0x10000, 0x42fcd51d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10642.47", 0x08000, 0x7836bcc3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10649a.88", 0x08000, 0xbf38330f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10643.66", 0x08000, 0x06f55364, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10644.67", 0x08000, 0xb41d541d, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10645.68", 0x08000, 0xa60dabff, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10646.69", 0x08000, 0x473cc411, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shangon3d) -STD_ROM_FN(Shangon3d) - -static struct BurnRomInfo ShangonleRomDesc[] = { - { "epr-13944.133", 0x10000, 0x989a80db, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13943.118", 0x10000, 0x426e3050, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10899.132", 0x10000, 0xbb3faa37, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10897.117", 0x10000, 0x5f087eb1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10640.76", 0x10000, 0x02be68db, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10638.58", 0x10000, 0xf13e8bee, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10641.75", 0x10000, 0x38c3f808, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10639.57", 0x10000, 0x8cdbcde8, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10652.54", 0x08000, 0x260286f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10651.55", 0x08000, 0xc609ee7b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10650.56", 0x08000, 0xb236a403, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10675.8", 0x10000, 0xd6ac012b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10682.16", 0x10000, 0xd9d83250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13945.7", 0x10000, 0xfbb1eef9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13946.15", 0x10000, 0x03144930, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10677.6", 0x10000, 0x8a57b8d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10684.14", 0x10000, 0x3aff8910, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10678.5", 0x10000, 0xaf473098, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10685.13", 0x10000, 0x80bafeef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10679.4", 0x10000, 0x03bc4878, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10686.12", 0x10000, 0x274b734e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10680.3", 0x10000, 0x9f0677ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10687.11", 0x10000, 0x508a4701, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10681.2", 0x10000, 0xb176ea72, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10688.10", 0x10000, 0x42fcd51d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10642.47", 0x08000, 0x7836bcc3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10649c.88", 0x08000, 0xf6c1ce71, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10643.66", 0x08000, 0x06f55364, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10644.67", 0x08000, 0xb41d541d, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10645.68", 0x08000, 0xa60dabff, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10646.69", 0x08000, 0x473cc411, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shangonle) -STD_ROM_FN(Shangonle) - -static struct BurnRomInfo ToutrunRomDesc[] = { - { "epr-12513.133", 0x10000, 0xae8835a5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12512.118", 0x10000, 0xf90372ad, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12515.132", 0x10000, 0x1f047df4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12514.117", 0x10000, 0x5539e9c3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12293.131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12295.76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12294.58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12297.75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12296.57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12323.102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12324.103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12325.104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12336.9", 0x20000, 0xdda465c7, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12337.10", 0x20000, 0x828233d1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12338.11", 0x20000, 0x46b4b5f4, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12339.12", 0x20000, 0x0d7e3bab, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12364.13", 0x20000, 0xa4b83e65, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12365.14", 0x20000, 0x4a80b2a9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12366.15", 0x20000, 0x385cb3ab, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12367.16", 0x20000, 0x4930254a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12299.47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.11", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12301.66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12302.67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12303.68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12304.69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12305.70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12306.71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0118.key", 0x02000, 0x083d7d56, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Toutrun) -STD_ROM_FN(Toutrun) - -static struct BurnRomInfo ToutrundRomDesc[] = { - { "bootleg_epr-12513.133", 0x10000, 0xa1881cea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12512.118", 0x10000, 0x5e9d788b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12515.132", 0x10000, 0xfd432e2d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12514.117", 0x10000, 0xfaf00bd6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12293.131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12295.76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12294.58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12297.75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12296.57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12323.102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12324.103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12325.104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12336.9", 0x20000, 0xdda465c7, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12337.10", 0x20000, 0x828233d1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12338.11", 0x20000, 0x46b4b5f4, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12339.12", 0x20000, 0x0d7e3bab, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12364.13", 0x20000, 0xa4b83e65, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12365.14", 0x20000, 0x4a80b2a9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12366.15", 0x20000, 0x385cb3ab, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12367.16", 0x20000, 0x4930254a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12299.47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.11", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12301.66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12302.67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12303.68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12304.69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12305.70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12306.71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Toutrund) -STD_ROM_FN(Toutrund) - -static struct BurnRomInfo ToutrunjRomDesc[] = { - { "epr-12509.133", 0x10000, 0xde226e8a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12508.118", 0x10000, 0x9fa2fc20, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12511.132", 0x10000, 0xad7ff20f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12510.117", 0x10000, 0xa0ed6196, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12293.131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12295.76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12294.58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12297.75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12296.57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12323.102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12324.103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12325.104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12336.9", 0x20000, 0xdda465c7, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12337.10", 0x20000, 0x828233d1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12338.11", 0x20000, 0x46b4b5f4, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12339.12", 0x20000, 0x0d7e3bab, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12364.13", 0x20000, 0xa4b83e65, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12365.14", 0x20000, 0x4a80b2a9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12366.15", 0x20000, 0x385cb3ab, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12367.16", 0x20000, 0x4930254a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12299.47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.11", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12301.66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12302.67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12303.68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12304.69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12305.70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12306.71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0117.key", 0x02000, 0xdcac383e, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Toutrunj) -STD_ROM_FN(Toutrunj) - -static struct BurnRomInfo ToutrunjdRomDesc[] = { - { "bootleg_epr-12509.133", 0x10000, 0x6bd28e3e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12508.118", 0x10000, 0xe059ec88, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12511.132", 0x10000, 0xfd432e2d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12510.117", 0x10000, 0xfaf00bd6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12293.131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12295.76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12294.58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12297.75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12296.57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12323.102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12324.103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12325.104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12336.9", 0x20000, 0xdda465c7, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12337.10", 0x20000, 0x828233d1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12338.11", 0x20000, 0x46b4b5f4, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12339.12", 0x20000, 0x0d7e3bab, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12364.13", 0x20000, 0xa4b83e65, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12365.14", 0x20000, 0x4a80b2a9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12366.15", 0x20000, 0x385cb3ab, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12367.16", 0x20000, 0x4930254a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12299.47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.11", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12301.66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12302.67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12303.68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12304.69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12305.70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12306.71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Toutrunjd) -STD_ROM_FN(Toutrunjd) - -static struct BurnRomInfo Toutrun1RomDesc[] = { - { "epr-12289.133", 0x10000, 0x812fd035, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // Rom label conflicts with the 317-0101 set below - { "epr-12288.118", 0x10000, 0x2f1151bb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // Rom label conflicts with the 317-0101 set below - { "epr-12291.132", 0x10000, 0x8ca284d2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // Rom label conflicts with the 317-0101 set below - { "epr-12290.117", 0x10000, 0x44dbf3cb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // Rom label conflicts with the 317-0101 set below - { "epr-12293.131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12295.76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12294.58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12297.75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12296.57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12323.102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12324.103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12325.104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12307.9", 0x10000, 0x437dcf09, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12308.10", 0x10000, 0x0de70cc2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12309.11", 0x10000, 0xdeb8c242, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12310.12", 0x10000, 0x45cf157e, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12311.13", 0x10000, 0xae2bd639, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12312.14", 0x10000, 0x626000e7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12313.15", 0x10000, 0x52870c37, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12314.16", 0x10000, 0x40c461ea, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12315.17", 0x10000, 0x3ff9a3a3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12316.18", 0x10000, 0x8a1e6dc8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12317.19", 0x10000, 0x77e382d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12318.20", 0x10000, 0xd1afdea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12319.25", 0x10000, 0xdf23baf9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12320.22", 0x10000, 0x7931e446, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12321.23", 0x10000, 0x830bacd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12322.24", 0x10000, 0x8b812492, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12299.47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.11", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12301.66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12302.67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12303.68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12304.69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12305.70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12306.71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0109.key", 0x02000, 0xe12a6e78, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Toutrun1) -STD_ROM_FN(Toutrun1) - -static struct BurnRomInfo Toutrun2RomDesc[] = { - { "epr-12397.133", 0x10000, 0xe4b57d7d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12396.118", 0x10000, 0x5e7115cb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12399.132", 0x10000, 0x62c77b1b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12398.117", 0x10000, 0x18e34520, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12293.131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12295.76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12294.58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12297.75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12296.57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12323.102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12324.103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12325.104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12307.9", 0x10000, 0x437dcf09, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12308.10", 0x10000, 0x0de70cc2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12309.11", 0x10000, 0xdeb8c242, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12310.12", 0x10000, 0x45cf157e, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12311.13", 0x10000, 0xae2bd639, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12312.14", 0x10000, 0x626000e7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12313.15", 0x10000, 0x52870c37, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12314.16", 0x10000, 0x40c461ea, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12315.17", 0x10000, 0x3ff9a3a3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12316.18", 0x10000, 0x8a1e6dc8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12317.19", 0x10000, 0x77e382d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12318.20", 0x10000, 0xd1afdea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12319.25", 0x10000, 0xdf23baf9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12320.22", 0x10000, 0x7931e446, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12321.23", 0x10000, 0x830bacd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12322.24", 0x10000, 0x8b812492, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12299.47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.11", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12301.66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12302.67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12303.68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12304.69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12305.70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12306.71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0106.key", 0x02000, 0xa4e33916, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Toutrun2) -STD_ROM_FN(Toutrun2) - -static struct BurnRomInfo Toutrun2dRomDesc[] = { - { "bootleg_epr-12397.133", 0x10000, 0x815ec9af, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12396.118", 0x10000, 0x84484188, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12399.132", 0x10000, 0x27ef9e5d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12398.117", 0x10000, 0x6da9f13b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12293.131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12295.76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12294.58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12297.75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12296.57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12323.102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12324.103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12325.104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12307.9", 0x10000, 0x437dcf09, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12308.10", 0x10000, 0x0de70cc2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12309.11", 0x10000, 0xdeb8c242, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12310.12", 0x10000, 0x45cf157e, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12311.13", 0x10000, 0xae2bd639, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12312.14", 0x10000, 0x626000e7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12313.15", 0x10000, 0x52870c37, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12314.16", 0x10000, 0x40c461ea, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12315.17", 0x10000, 0x3ff9a3a3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12316.18", 0x10000, 0x8a1e6dc8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12317.19", 0x10000, 0x77e382d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12318.20", 0x10000, 0xd1afdea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12319.25", 0x10000, 0xdf23baf9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12320.22", 0x10000, 0x7931e446, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12321.23", 0x10000, 0x830bacd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12322.24", 0x10000, 0x8b812492, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12299.47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.11", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12301.66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12302.67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12303.68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12304.69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12305.70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12306.71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Toutrun2d) -STD_ROM_FN(Toutrun2d) - -static struct BurnRomInfo Toutrun3RomDesc[] = { - { "epr-12410.133", 0x10000, 0xaa74f3e9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12409.118", 0x10000, 0xc11c8ef7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12412.132", 0x10000, 0xb0534647, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12411.117", 0x10000, 0x12bb0d83, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12293.131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12295.76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12294.58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12297.75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12296.57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12323.102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12324.103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12325.104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12307.9", 0x10000, 0x437dcf09, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12308.10", 0x10000, 0x0de70cc2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12309.11", 0x10000, 0xdeb8c242, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12310.12", 0x10000, 0x45cf157e, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12311.13", 0x10000, 0xae2bd639, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12312.14", 0x10000, 0x626000e7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12313.15", 0x10000, 0x52870c37, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12314.16", 0x10000, 0x40c461ea, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12315.17", 0x10000, 0x3ff9a3a3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12316.18", 0x10000, 0x8a1e6dc8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12317.19", 0x10000, 0x77e382d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12318.20", 0x10000, 0xd1afdea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12319.25", 0x10000, 0xdf23baf9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12320.22", 0x10000, 0x7931e446, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12321.23", 0x10000, 0x830bacd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12322.24", 0x10000, 0x8b812492, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12299.47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.11", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12301.66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12302.67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12303.68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12304.69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12305.70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12306.71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0107.key", 0x02000, 0x33e632ae, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Toutrun3) -STD_ROM_FN(Toutrun3) - -static struct BurnRomInfo Toutrun3dRomDesc[] = { - { "bootleg_epr-12410.133", 0x10000, 0x8e716903, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12409.118", 0x10000, 0x675d4dd8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12412.132", 0x10000, 0x89da477c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12411.117", 0x10000, 0x285837ee, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12293.131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12295.76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12294.58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12297.75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "opr-12296.57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12323.102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12324.103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12325.104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12307.9", 0x10000, 0x437dcf09, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12308.10", 0x10000, 0x0de70cc2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12309.11", 0x10000, 0xdeb8c242, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12310.12", 0x10000, 0x45cf157e, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12311.13", 0x10000, 0xae2bd639, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12312.14", 0x10000, 0x626000e7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12313.15", 0x10000, 0x52870c37, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12314.16", 0x10000, 0x40c461ea, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12315.17", 0x10000, 0x3ff9a3a3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12316.18", 0x10000, 0x8a1e6dc8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12317.19", 0x10000, 0x77e382d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12318.20", 0x10000, 0xd1afdea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12319.25", 0x10000, 0xdf23baf9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12320.22", 0x10000, 0x7931e446, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12321.23", 0x10000, 0x830bacd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12322.24", 0x10000, 0x8b812492, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12299.47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.11", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12301.66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12302.67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12303.68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12304.69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12305.70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-12306.71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Toutrun3d) -STD_ROM_FN(Toutrun3d) - -static struct BurnRomInfo Toutrunj1RomDesc[] = { - { "epr-12289.ic133", 0x10000, 0x89380754, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // Verified correct labels but conflicts with the 317-0109 set - { "epr-12288.ic118", 0x10000, 0x47b47ef1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // Verified correct labels but conflicts with the 317-0109 set - { "epr-12291.ic132", 0x10000, 0x1f4ab0c6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // Verified correct labels but conflicts with the 317-0109 set - { "epr-12290.ic117", 0x10000, 0x67e81543, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // Verified correct labels but conflicts with the 317-0109 set - { "epr-12293.ic131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.ic116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12295.ic76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12294.ic58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12297.ic75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12296.ic57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12323.ic102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12324.ic103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12325.ic104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12307.ic9", 0x10000, 0x437dcf09, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12308.ic10", 0x10000, 0x0de70cc2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12309.ic11", 0x10000, 0xdeb8c242, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12310.ic12", 0x10000, 0x45cf157e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12311.ic13", 0x10000, 0xae2bd639, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12312.ic14", 0x10000, 0x626000e7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12313.ic15", 0x10000, 0x52870c37, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12314.ic16", 0x10000, 0x40c461ea, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12315.ic17", 0x10000, 0x3ff9a3a3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12316.ic18", 0x10000, 0x8a1e6dc8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12317.ic19", 0x10000, 0x77e382d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12318.ic20", 0x10000, 0xd1afdea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12319.ic21", 0x10000, 0xdf23baf9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12320.ic22", 0x10000, 0x7931e446, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12321.ic23", 0x10000, 0x830bacd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12322.ic24", 0x10000, 0x8b812492, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12298.ic47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.ic28", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.ic88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12301.ic66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12302.ic67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12303.ic68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12304.ic69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12305.ic70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12306.ic71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0101.key", 0x02000, 0xeb636314, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Toutrunj1) -STD_ROM_FN(Toutrunj1) - -static struct BurnRomInfo Toutrunj1dRomDesc[] = { - { "bootleg_epr-12289.133", 0x10000, 0xbcdb64ae, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12288.118", 0x10000, 0x58051f8d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12291.132", 0x10000, 0x0f00d22c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12290.117", 0x10000, 0xda4a77ac, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12293.ic131", 0x10000, 0xf4321eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12292.ic116", 0x10000, 0x51d98af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12295.ic76", 0x10000, 0xd43a3a84, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12294.ic58", 0x10000, 0x27cdcfd3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12297.ic75", 0x10000, 0x1d9b5677, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12296.ic57", 0x10000, 0x0a513671, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12323.ic102", 0x10000, 0x4de43a6f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12324.ic103", 0x10000, 0x24607a55, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12325.ic104", 0x10000, 0x1405137a, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12307.ic9", 0x10000, 0x437dcf09, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12308.ic10", 0x10000, 0x0de70cc2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12309.ic11", 0x10000, 0xdeb8c242, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12310.ic12", 0x10000, 0x45cf157e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12311.ic13", 0x10000, 0xae2bd639, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12312.ic14", 0x10000, 0x626000e7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12313.ic15", 0x10000, 0x52870c37, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12314.ic16", 0x10000, 0x40c461ea, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12315.ic17", 0x10000, 0x3ff9a3a3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12316.ic18", 0x10000, 0x8a1e6dc8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12317.ic19", 0x10000, 0x77e382d4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12318.ic20", 0x10000, 0xd1afdea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12319.ic21", 0x10000, 0xdf23baf9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12320.ic22", 0x10000, 0x7931e446, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12321.ic23", 0x10000, 0x830bacd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12322.ic24", 0x10000, 0x8b812492, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12298.ic47", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - { "epr-12298.ic28", 0x08000, 0xfc9bc41b, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-12300.ic88", 0x10000, 0xe8ff7011, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12301.ic66", 0x10000, 0x6e78ad15, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12302.ic67", 0x10000, 0xe72928af, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12303.ic68", 0x10000, 0x8384205c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12304.ic69", 0x10000, 0xe1762ac3, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12305.ic70", 0x10000, 0xba9ce677, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12306.ic71", 0x10000, 0xe49249fd, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Toutrunj1d) -STD_ROM_FN(Toutrunj1d) - -/*==================================================== -Memory Handlers -====================================================*/ - -void OutrunPPI0WritePortC(UINT8 data) -{ - System16VideoEnable = data & 0x20; - - if (!(data & 0x01)) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } -} - -static UINT8 OutrunReadIO(UINT32 offset) -{ - switch (offset) { - case 0x00: - case 0x01: - case 0x02: - case 0x03: { - return ppi8255_r(0, offset); - } - - case 0x08: { - return 0xff - System16Input[0]; - } - - case 0x09: { - return 0xff - System16Input[1]; - } - - case 0x0a: { - return System16Dip[0]; - } - - case 0x0b: { - return System16Dip[1]; - } - - case 0x18: { - if (System16ProcessAnalogControlsDo) return System16ProcessAnalogControlsDo(System16AnalogSelect); - return 0xff; - } - - case 0x30: { - // watchdog read - return 0; - } - - case 0x38: { - // ??? - return 0; - } - } - - return sega_315_5195_io_read(offset); -} - -static void OutrunWriteIO(UINT32 offset, UINT8 d) -{ - switch (offset) { - case 0x00: - case 0x01: - case 0x02: - case 0x03: { - ppi8255_w(0, offset, d); - return; - } - - case 0x10: { - // motors - return; - } - - case 0x18: { - System16AnalogSelect = d; - return; - } - - case 0x38: { - UINT32 *src = (UINT32 *)System16SpriteRam; - UINT32 *dst = (UINT32 *)System16SpriteRamBuff; - - /* swap the halves of the sprite RAM */ - for (UINT32 i = 0; i < System16SpriteRamSize/4; i++) { - UINT32 temp = *src; - *src++ = *dst; - *dst++ = temp; - } - - /* hack for thunderblade */ - memset(System16SpriteRam, 0xff, System16SpriteRamSize); - return; - } - } - - sega_315_5195_io_write(offset, d); -} - -static UINT8 ShangonReadIO(UINT32 offset) -{ - switch (offset) { - case 0x0801: { - return 0xff - System16Input[0]; - } - - case 0x0802: { - return System16Dip[0]; - } - - case 0x0803: { - return System16Dip[1]; - } - - case 0x1810: { - if (System16ProcessAnalogControlsDo) return System16ProcessAnalogControlsDo(System16AnalogSelect); - return 0xff; - } - } - - return sega_315_5195_io_read(offset); -} - -static void ShangonWriteIO(UINT32 offset, UINT8 d) -{ - switch (offset) { - case 0x0000: { - System16AnalogSelect = (d >> 6) & 3; - System16VideoEnable = (d >> 5) & 1; - return; - } - - case 0x0010: { - if (!(d & 1)) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } - return; - - } - - case 0x1800: { - // watchdog write - return; - } - - case 0x1810: { - // adc trigger - return; - } - } - - sega_315_5195_io_write(offset, d); -} - -UINT16 System16RoadControlRead(UINT32 offset) -{ - switch (offset) { - case 0x00: { - // swap the halves of the road RAM - memcpy(System16RoadRamBuff, System16RoadRam, 0x1000); - UINT32 *src = (UINT32 *)System16RoadRamBuff; - UINT32 *dst = (UINT32 *)System16RoadRam; - for (INT32 i = 0; i < 0x1000/4; i++) { - UINT32 temp = *src; - *src++ = *dst; - *dst++ = temp; - } - - return System16RoadControl; - } - } - - return 0; -} - -void System16RoadControlWrite(UINT32 offset, UINT16 d) -{ - switch (offset) { - case 0x00: { - System16RoadControl = d & 3; - } - } -} - -UINT8 __fastcall Outrun2ReadByte(UINT32 a) -{ - switch (a) { - case 0x090000: - case 0x090001: { - return System16RoadControlRead((a - 0x090000) >> 1); - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 # 2 Read Byte -> 0x%06X\n"), a); -#endif - - return 0; -} - -void __fastcall Outrun2WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x090000: { - System16RoadControlWrite((a - 0x090000) >> 1, d); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 # 2 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -void __fastcall Outrun2WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x090001: { - System16RoadControlWrite((a - 0x090000) >> 1, d); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 # 2 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -/*==================================================== -Driver Inits -====================================================*/ - -UINT8 OutrunProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - - // Steering - case 0: { - - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) > 0x7f && (System16AnalogPort0 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort0 >> 4); - } - - if (temp < 0x20) temp = 0x20; - if (temp > 0xe0) temp = 0xe0; - return temp; - } - - // Accelerate - case 4: { - if (System16AnalogPort1 > 1) return 0xff; - return 0; - } - - // Brake - case 8: { - if (System16AnalogPort2 > 1) return 0xff; - return 0; - } - } - - return 0; -} - -UINT8 ShangonProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - - // Steering - case 0: { - - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) < 0xf82 && (System16AnalogPort0 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort0 >> 4); - } - - if (temp < 0x20) temp = 0x20; - if (temp > 0xe0) temp = 0xe0; - return temp; - } - - // Accelerate - case 1: { - if (System16AnalogPort1 > 1) return 0xff; - return 0; - } - - // Brake - case 2: { - if (System16AnalogPort2 > 1) return 0xff; - return 0; - } - } - - return 0; -} - -static INT32 OutrunInit() -{ - System16ProcessAnalogControlsDo = OutrunProcessAnalogControls; - sega_315_5195_custom_io_do = OutrunReadIO; - sega_315_5195_custom_io_write_do = OutrunWriteIO; - - System16HasGears = true; - - System16PCMDataSizePreAllocate = 0x60000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x30000); - memcpy(pTemp, System16PCMData, 0x30000); - memset(System16PCMData, 0, 0x60000); - memcpy(System16PCMData + 0x00000, pTemp + 0x00000, 0x8000); - memcpy(System16PCMData + 0x08000, pTemp + 0x00000, 0x8000); - memcpy(System16PCMData + 0x10000, pTemp + 0x08000, 0x8000); - memcpy(System16PCMData + 0x18000, pTemp + 0x08000, 0x8000); - memcpy(System16PCMData + 0x20000, pTemp + 0x10000, 0x8000); - memcpy(System16PCMData + 0x28000, pTemp + 0x10000, 0x8000); - memcpy(System16PCMData + 0x30000, pTemp + 0x18000, 0x8000); - memcpy(System16PCMData + 0x38000, pTemp + 0x18000, 0x8000); - memcpy(System16PCMData + 0x40000, pTemp + 0x20000, 0x8000); - memcpy(System16PCMData + 0x48000, pTemp + 0x20000, 0x8000); - memcpy(System16PCMData + 0x50000, pTemp + 0x28000, 0x8000); - memcpy(System16PCMData + 0x58000, pTemp + 0x28000, 0x8000); - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 OutrunbInit() -{ - System16ProcessAnalogControlsDo = OutrunProcessAnalogControls; - sega_315_5195_custom_io_do = OutrunReadIO; - sega_315_5195_custom_io_write_do = OutrunWriteIO; - - UINT8 memory_control[0x10] = { 0x02, 0x00, 0x0d, 0x10, 0x00, 0x12, 0x0c, 0x13, 0x08, 0x14, 0x0f ,0x20, 0x00, 0x00, 0x00, 0x00 }; - System16I8751InitialConfig = memory_control; - - System16HasGears = true; - - System16PCMDataSizePreAllocate = 0x60000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT16 *word; - UINT8 *byte; - INT32 i, length; - - /* main CPU: swap bits 11,12 and 6,7 */ - word = (UINT16 *)System16Rom; - length = System16RomSize / 2; - for (i = 0; i < length; i++) - word[i] = BITSWAP16(word[i], 15,14,11,12,13,10,9,8,6,7,5,4,3,2,1,0); - - memcpy(System16Code, System16Rom, System16RomSize); - - /* sub CPU: swap bits 14,15 and 2,3 */ - word = (UINT16 *)System16Rom2; - length = System16Rom2Size / 2; - for (i = 0; i < length; i++) - word[i] = BITSWAP16(word[i], 14,15,13,12,11,10,9,8,7,6,5,4,2,3,1,0); - - /* road gfx */ - /* rom a-2.bin: swap bits 6,7 */ - /* rom a-3.bin: swap bits 5,6 */ - byte = System16Roads; - length = 0x40000 / 2; - for (i = 0; i < length; i++) - { - byte[i] = BITSWAP08(byte[i], 6,7,5,4,3,2,1,0); - byte[i+length] = BITSWAP08(byte[i+length], 7,5,6,4,3,2,1,0); - } - - /* Z80 code: swap bits 5,6 */ - byte = System16Z80Rom; - length = System16Z80RomSize; - for (i = 0; i < length; i++) { - byte[i] = BITSWAP08(byte[i], 7,5,6,4,3,2,1,0); - } - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x30000); - memcpy(pTemp, System16PCMData, 0x30000); - memset(System16PCMData, 0, 0x60000); - memcpy(System16PCMData + 0x00000, pTemp + 0x00000, 0x8000); - memcpy(System16PCMData + 0x10000, pTemp + 0x08000, 0x8000); - memcpy(System16PCMData + 0x20000, pTemp + 0x10000, 0x8000); - memcpy(System16PCMData + 0x30000, pTemp + 0x18000, 0x8000); - memcpy(System16PCMData + 0x40000, pTemp + 0x20000, 0x8000); - memcpy(System16PCMData + 0x50000, pTemp + 0x28000, 0x8000); - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 ShangonInit() -{ - System16ProcessAnalogControlsDo = ShangonProcessAnalogControls; - sega_315_5195_custom_io_do = ShangonReadIO; - sega_315_5195_custom_io_write_do = ShangonWriteIO; - - Shangon = true; - - System16PCMDataSizePreAllocate = 0x40000; - - INT32 nRet = System16Init(); - - if (!nRet) { - System16RoadColorOffset1 = 0x7f6; - System16RoadColorOffset2 = 0x7c0; - System16RoadColorOffset3 = 0x7c0; - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x20000); - memcpy(pTemp, System16PCMData, 0x20000); - memset(System16PCMData, 0, 0x40000); - memcpy(System16PCMData + 0x00000, pTemp + 0x00000, 0x8000); - memcpy(System16PCMData + 0x08000, pTemp + 0x00000, 0x8000); - memcpy(System16PCMData + 0x10000, pTemp + 0x08000, 0x8000); - memcpy(System16PCMData + 0x18000, pTemp + 0x08000, 0x8000); - memcpy(System16PCMData + 0x20000, pTemp + 0x10000, 0x8000); - memcpy(System16PCMData + 0x28000, pTemp + 0x10000, 0x8000); - memcpy(System16PCMData + 0x30000, pTemp + 0x18000, 0x8000); - memcpy(System16PCMData + 0x38000, pTemp + 0x18000, 0x8000); - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 ToutrunInit() -{ - System16ProcessAnalogControlsDo = OutrunProcessAnalogControls; - sega_315_5195_custom_io_do = OutrunReadIO; - sega_315_5195_custom_io_write_do = OutrunWriteIO; - - System16HasGears = true; - - System16PCMDataSizePreAllocate = 0x60000; - - return System16Init(); -} - -/*==================================================== -Driver Defs -====================================================*/ - -struct BurnDriver BurnDrvOutrun = { - "outrun", NULL, NULL, NULL, "1986", - "Out Run (sitdown/upright, Rev B)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, OutrunRomInfo, OutrunRomName, NULL, NULL, OutrunInputInfo, OutrunDIPInfo, - OutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvOutrunra = { - "outrunra", "outrun", NULL, NULL, "1986", - "Out Run (sitdown/upright, Rev A)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, OutrunraRomInfo, OutrunraRomName, NULL, NULL, OutrunInputInfo, OutrunDIPInfo, - OutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvOutruneh = { - "outruneh", "outrun", NULL, NULL, "2014", - "Out Run (sitdown/upright, Rev B) (Enhanced Edition v1.1.0)\0", NULL, "hack (Chris White)", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, OutrunehRomInfo, OutrunehRomName, NULL, NULL, OutrunInputInfo, OutrunehDIPInfo, - OutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvOutrundx = { - "outrundx", "outrun", NULL, NULL, "1986", - "Out Run (deluxe sitdown)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, OutrundxRomInfo, OutrundxRomName, NULL, NULL, OutrunInputInfo, OutrundxDIPInfo, - OutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvOutrundxj = { - "outrundxj", "outrun", NULL, NULL, "1986", - "Out Run (Japan, deluxe sitdown, FD1089A 317-0019)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1089A_ENC | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, OutrundxjRomInfo, OutrundxjRomName, NULL, NULL, OutrunInputInfo, OutrunDIPInfo, - OutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; -struct BurnDriver BurnDrvOutrundxa = { - "outrundxa", "outrun", NULL, NULL, "1986", - "Out Run (deluxe sitdown earlier version)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, OutrundxaRomInfo, OutrundxaRomName, NULL, NULL, OutrunInputInfo, OutrundxDIPInfo, - OutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvOutrundxeh = { - "outrundxeh", "outrun", NULL, NULL, "2013", - "Out Run (deluxe sitdown) (Enhanced Edition v1.0.3)\0", NULL, "hack (Chris White)", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, OutrundxehRomInfo, OutrundxehRomName, NULL, NULL, OutrunInputInfo, OutrundxehDIPInfo, - OutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvOutrunb = { - "outrunb", "outrun", NULL, NULL, "1986", - "Out Run (bootleg)\0", NULL, "bootleg", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, OutrunbRomInfo, OutrunbRomName, NULL, NULL, OutrunInputInfo, OutrunDIPInfo, - OutrunbInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShangon = { - "shangon", NULL, NULL, NULL, "1987", - "Super Hang-On (sitdown/upright, unprotected)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_OUTRUN, GBF_RACING, 0, - NULL, ShangonRomInfo, ShangonRomName, NULL, NULL, ShangonInputInfo, ShangonDIPInfo, - ShangonInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShangon1 = { - "shangon1", "shangon", NULL, NULL, "1987", - "Super Hang-On (mini ride-on, FD1089B 317-0034)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1089B_ENC, GBF_RACING, 0, - NULL, Shangon1RomInfo, Shangon1RomName, NULL, NULL, ShangonInputInfo, ShangonDIPInfo, - ShangonInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShangon2 = { - "shangon2", "shangon", NULL, NULL, "1987", - "Super Hang-On (mini ride-on, Rev A, FD1089B 317-0034)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1089B_ENC, GBF_RACING, 0, - NULL, Shangon2RomInfo, Shangon2RomName, NULL, NULL, ShangonInputInfo, ShangonDIPInfo, - ShangonInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShangon3 = { - "shangon3", "shangon", NULL, NULL, "1987", - "Super Hang-On (sitdown/upright, FD1089B 317-0034)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1089B_ENC, GBF_RACING, 0, - NULL, Shangon3RomInfo, Shangon3RomName, NULL, NULL, ShangonInputInfo, ShangonDIPInfo, - ShangonInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShangon3d = { - "shangon3d", "shangon", NULL, NULL, "1987", - "Super Hang-On (sitdown/upright, FD1089B 317-0034 decrypted)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_OUTRUN, GBF_RACING, 0, - NULL, Shangon3dRomInfo, Shangon3dRomName, NULL, NULL, ShangonInputInfo, ShangonDIPInfo, - ShangonInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShangonle = { - "shangonle", "shangon", NULL, NULL, "1991", - "Limited Edition Hang-On\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN, GBF_RACING, 0, - NULL, ShangonleRomInfo, ShangonleRomName, NULL, NULL, ShangonInputInfo, ShangonDIPInfo, - ShangonInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToutrun = { - "toutrun", NULL, NULL, NULL, "1989", - "Turbo Out Run (Out Run upgrade, FD1094 317-0118)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, ToutrunRomInfo, ToutrunRomName, NULL, NULL, ToutrunInputInfo, ToutrunDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToutrund = { - "toutrund", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (Out Run upgrade, FD1094 317-0118 decrypted)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, ToutrundRomInfo, ToutrundRomName, NULL, NULL, ToutrunInputInfo, ToutrunDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToutrunj = { - "toutrunj", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (Japan, Out Run upgrade, FD1094 317-0117)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, ToutrunjRomInfo, ToutrunjRomName, NULL, NULL, ToutrunInputInfo, ToutrunDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToutrunjd = { - "toutrunjd", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (Japan, Out Run upgrade, FD1094 317-0117 decrypted)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, ToutrunjdRomInfo, ToutrunjdRomName, NULL, NULL, ToutrunInputInfo, ToutrunDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToutrun1 = { - "toutrun1", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (deluxe cockpit, FD1094 317-0109)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Toutrun1RomInfo, Toutrun1RomName, NULL, NULL, ToutrunInputInfo, ToutrunmDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvToutrun2 = { - "toutrun2", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (cockpit, FD1094 317-0106)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Toutrun2RomInfo, Toutrun2RomName, NULL, NULL, ToutrunInputInfo, ToutrunctDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvToutrun2d = { - "toutrun2d", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (cockpit, FD1094 317-0106 decrypted)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Toutrun2dRomInfo, Toutrun2dRomName, NULL, NULL, ToutrunInputInfo, ToutrunctDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToutrun3 = { - "toutrun3", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (cockpit, FD1094 317-0107)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Toutrun3RomInfo, Toutrun3RomName, NULL, NULL, ToutrunInputInfo, ToutruncDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToutrun3d = { - "toutrun3d", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (cockpit, FD1094 317-0107 decrypted)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Toutrun3dRomInfo, Toutrun3dRomName, NULL, NULL, ToutrunInputInfo, ToutruncDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToutrunj1 = { - "toutrunj1", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (Japan, deluxe cockpit, FD1094 317-0101)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Toutrunj1RomInfo, Toutrunj1RomName, NULL, NULL, ToutrunInputInfo, ToutrunctDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvToutrunj1d = { - "toutrunj1d", "toutrun", NULL, NULL, "1989", - "Turbo Out Run (Japan, deluxe cockpit, FD1094 317-0101 decrypted)\0", NULL, "Sega", "Out Run", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_OUTRUN | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Toutrunj1dRomInfo, Toutrunj1dRomName, NULL, NULL, ToutrunInputInfo, ToutrunctDIPInfo, - ToutrunInit, System16Exit, OutrunFrame, NULL, System16Scan, - NULL, 0x3000, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_segae.cpp b/jan/src/burn/drv/sega/d_segae.cpp deleted file mode 100644 index 000c57a12..000000000 --- a/jan/src/burn/drv/sega/d_segae.cpp +++ /dev/null @@ -1,1103 +0,0 @@ -// based on MESS/MAME driver by David Haywood - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "bitswap.h" - -static UINT8 DrvJoy0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy4[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - -static UINT8 DrvInput[5]; -static UINT8 DrvDip[2]; -static UINT8 DrvReset; -static UINT8 DrvRecalc; - -static INT32 DrvWheel = 0; -static INT32 DrvAccel = 0; - -static INT32 nCyclesDone, nCyclesTotal; -static INT32 nCyclesSegment; - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvRAM; -static UINT8 *DrvMainROM; -static UINT32 *DrvPalette; -static UINT32 *Palette; -static UINT8 *cache_bitmap; - -static UINT8 segae_8000bank; -static UINT8 port_fa_last; -static UINT8 rombank; - -static UINT8 hintcount; /* line interrupt counter, decreased each scanline */ -UINT8 vintpending; -UINT8 hintpending; - -//UINT8 m_port_select; -UINT8 currentLine = 0; - -UINT8 leftcolumnblank = 0; // most games need this, except tetris - -#define CHIPS 2 /* There are 2 VDP Chips */ - -UINT8 segae_vdp_cmdpart[CHIPS]; /* VDP Command Part Counter */ -UINT16 segae_vdp_command[CHIPS]; /* VDP Command Word */ - -UINT8 segae_vdp_accessmode[CHIPS]; /* VDP Access Mode (VRAM, CRAM) */ -UINT16 segae_vdp_accessaddr[CHIPS]; /* VDP Access Address */ -UINT8 segae_vdp_readbuffer[CHIPS]; /* VDP Read Buffer */ - -UINT8 *segae_vdp_vram[CHIPS]; /* Pointer to VRAM */ -UINT8 *segae_vdp_cram[CHIPS]; /* Pointer to the VDP's CRAM */ -UINT8 *segae_vdp_regs[CHIPS]; /* Pointer to the VDP's Registers */ - -UINT8 segae_vdp_vrambank[CHIPS]; /* Current VRAM Bank number (from writes to Port 0xf7) */ - -static struct BurnInputInfo TransfrmInputList[] = { - - {"P1 Coin", BIT_DIGITAL, DrvJoy0 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy0 + 6, "p1 start"}, - {"P2 Coin", BIT_DIGITAL, DrvJoy0 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy0 + 7, "p2 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy0 + 3, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; -STDINPUTINFO(Transfrm) - - -static struct BurnDIPInfo TransfrmDIPList[]= -{ - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 2, "1 Player Only" }, - {0x0d, 0x01, 0x01, 0x00, "Off" }, - {0x0d, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0d, 0x01, 0x02, 0x02, "Off" }, - {0x0d, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0d, 0x01, 0x0c, 0x0c, "3" }, - {0x0d, 0x01, 0x0c, 0x08, "4" }, - {0x0d, 0x01, 0x0c, 0x04, "5" }, - {0x0d, 0x01, 0x0c, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0d, 0x01, 0x30, 0x20, "10k, 30k, 50k and 70k" }, - {0x0d, 0x01, 0x30, 0x30, "20k, 60k, 100k and 140k" }, - {0x0d, 0x01, 0x30, 0x10, "30k, 80k, 130k and 180k" }, - {0x0d, 0x01, 0x30, 0x00, "50k, 150k and 250k" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0d, 0x01, 0xc0, 0x40, "Easy" }, - {0x0d, 0x01, 0xc0, 0xc0, "Medium" }, - {0x0d, 0x01, 0xc0, 0x80, "Hard" }, - {0x0d, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Transfrm) - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo HangonjrInputList[] = { - - {"P1 Coin", BIT_DIGITAL, DrvJoy0 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy0 + 4, "p1 start"}, - A("P1 Steering", BIT_ANALOG_REL, &DrvWheel, "p1 x-axis"), - A("P1 Accelerate", BIT_ANALOG_REL, &DrvAccel, "p1 z-axis"), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy0 + 3, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Hangonjr) -#undef A - - -static struct BurnDIPInfo HangonjrDIPList[]= -{ - {0x06, 0xff, 0xff, 0xff, NULL }, - {0x07, 0xff, 0xff, 0x04, NULL }, - - {0 , 0xfe, 0 , 4, "Enemies" }, - {0x06, 0x01, 0x06, 0x06, "Easy" }, - {0x06, 0x01, 0x06, 0x04, "Medium" }, - {0x06, 0x01, 0x06, 0x02, "Hard" }, - {0x06, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Time Adj." }, - {0x06, 0x01, 0x18, 0x18, "Easy" }, - {0x06, 0x01, 0x18, 0x10, "Medium" }, - {0x06, 0x01, 0x18, 0x08, "Hard" }, - {0x06, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode (No Toggle)" }, - {0x07, 0x01, 0x04, 0x04, "Off" }, - {0x07, 0x01, 0x04, 0x00, "On" }, -}; - -STDDIPINFO(Hangonjr) - -static struct BurnInputInfo TetrisseInputList[] = { - - {"P1 Coin", BIT_DIGITAL, DrvJoy0 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy0 + 6, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvJoy0 + 3, "service"}, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip"}, -}; - -STDINPUTINFO(Tetrisse) - - -static struct BurnDIPInfo TetrisseDIPList[]= -{ - {0x0a, 0xff, 0xff, 0x30, NULL }, - {0x0b, 0xff, 0xff, 0x04, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0a, 0x01, 0x02, 0x02, "Off" }, - {0x0a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0a, 0x01, 0x30, 0x20, "Easy" }, - {0x0a, 0x01, 0x30, 0x30, "Normal" }, - {0x0a, 0x01, 0x30, 0x10, "Hard" }, - {0x0a, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Service Mode (No Toggle)" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, -}; -STDDIPINFO(Tetrisse) - -static UINT8 __fastcall systeme_main_read(UINT16 address) -{ -// bprintf(0, _T("systeme_main_read adr %X.\n"), address); - - return 0; -} - -static void __fastcall systeme_main_write(UINT16 address, UINT8 data) -{ - if(address >= 0x8000 && address <= 0xbfff) - { - segae_vdp_vram [1-segae_8000bank][(address - 0x8000) + (0x4000-(segae_vdp_vrambank[1-segae_8000bank] * 0x4000))] = data; - - return; - } -} - -static UINT32 scalerange(UINT32 x, UINT32 in_min, UINT32 in_max, UINT32 out_min, UINT32 out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - - -static UINT8 scale_wheel(UINT32 PaddlePortnum) { - UINT8 Temp; - - Temp = 0x7f + (PaddlePortnum >> 4); - if (Temp < 0x01) Temp = 0x01; - if (Temp > 0xfe) Temp = 0xfe; - Temp = scalerange(Temp, 0x3f, 0xbe, 0x20, 0xe0); - return Temp; -} - -static UINT8 scale_accel(UINT32 PaddlePortnum) { - UINT8 Temp; - - Temp = PaddlePortnum >> 4; - if (Temp < 0x08) Temp = 0x00; // sometimes default for digital button -> analog is "1" - if (Temp > 0x30) Temp = 0xff; - - return Temp; -} - - -static UINT8 __fastcall hangonjr_port_f8_read (UINT8 port) -{ - UINT8 temp = 0; - //bprintf(0, _T("Wheel %.04X Accel %.04X\n"), scale_wheel(DrvWheel), scale_accel(DrvAccel)); - - if (port_fa_last == 0x08) /* 0000 1000 */ /* Angle */ - temp = scale_wheel(DrvWheel); - - if (port_fa_last == 0x09) /* 0000 1001 */ /* Accel */ - temp = scale_accel(DrvAccel); - - return temp; -} - -static inline void __fastcall hangonjr_port_fa_write (UINT8 data) -{ - /* Seems to write the same pattern again and again bits ---- xx-x used */ - port_fa_last = data; -} - -static void segae_bankswitch (void) -{ - ZetMapMemory(DrvMainROM + 0x10000 + ( rombank * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall bank_write(UINT8 data) -{ - segae_vdp_vrambank[0] = (data & 0x80) >> 7; /* Back Layer VDP (0) VRAM Bank */ - segae_vdp_vrambank[1] = (data & 0x40) >> 6; /* Front Layer VDP (1) VRAM Bank */ - segae_8000bank = (data & 0x20) >> 5; /* 0x8000 Write Select */ - rombank = data & 0x0f; /* Rom Banking */ - segae_bankswitch(); -} - -static void segae_vdp_setregister ( UINT8 chip, UINT16 cmd ) -{ - UINT8 regnumber; - UINT8 regdata; - - regnumber = (cmd & 0x0f00) >> 8; - regdata = (cmd & 0x00ff); - if (regnumber < 11) { - segae_vdp_regs[chip][regnumber] = regdata; - } else { - /* Illegal, there aren't this many registers! */ - } -} - -static void segae_vdp_processcmd ( UINT8 chip, UINT16 cmd ) -{ - if ( (cmd & 0xf000) == 0x8000 ) { /* 1 0 0 0 - - - - - - - - - - - - VDP Register Set */ - segae_vdp_setregister (chip, cmd); - } else { /* Anything Else */ - segae_vdp_accessmode[chip] = (cmd & 0xc000) >> 14; - segae_vdp_accessaddr[chip] = (cmd & 0x3fff); - - if ((segae_vdp_accessmode[chip]==0x03) && (segae_vdp_accessaddr[chip] > 0x1f) ) { /* Check Address is valid for CRAM */ - /* Illegal, CRAM isn't this large! */ - segae_vdp_accessaddr[chip] &= 0x1f; - } - - if (segae_vdp_accessmode[chip] == 0x00) { /* 0 0 - - - - - - - - - - - - - - VRAM Acess Mode (Special Read) */ - segae_vdp_readbuffer[chip] = segae_vdp_vram[chip][ segae_vdp_vrambank[chip]*0x4000 + segae_vdp_accessaddr[chip] ]; - segae_vdp_accessaddr[chip] += 1; - segae_vdp_accessaddr[chip] &= 0x3fff; - } - } -} - -static UINT8 segae_vdp_counter_r (UINT8 chip, UINT8 offset) -{ - UINT8 temp = 0; - UINT16 sline; - - switch (offset) - { - case 0: /* port 0x7e, Vert Position (in scanlines) */ - sline = currentLine; -// if (sline > 0xDA) sline -= 6; -// temp = sline-1 ; - if (sline > 0xDA) sline -= 5; - temp = sline ; - break; - case 1: /* port 0x7f, Horz Position (in pixel clock cycles) */ - /* unhandled for now */ - break; - } - return temp; -} - -static UINT8 segae_vdp_data_r(UINT8 chip) -{ - UINT8 temp; - - segae_vdp_cmdpart[chip] = 0; - - temp = segae_vdp_readbuffer[chip]; - - if (segae_vdp_accessmode[chip]==0x03) { /* CRAM Access */ - /* error CRAM can't be read!! */ - } else { /* VRAM */ - segae_vdp_readbuffer[chip] = segae_vdp_vram[chip][ segae_vdp_vrambank[chip]*0x4000 + segae_vdp_accessaddr[chip] ]; - segae_vdp_accessaddr[chip] += 1; - segae_vdp_accessaddr[chip] &= 0x3fff; - } - return temp; -} - -static UINT8 segae_vdp_reg_r ( UINT8 chip ) -{ - UINT8 temp; - - temp = 0; - - temp |= (vintpending << 7); - temp |= (hintpending << 6); - - hintpending = vintpending = 0; - - return temp; -} - -static inline UINT8 pal2bit(UINT8 bits) -{ - bits &= 3; - return (bits << 6) | (bits << 4) | (bits << 2) | bits; -} - -static void segae_vdp_data_w ( UINT8 chip, UINT8 data ) -{ - segae_vdp_cmdpart[chip] = 0; - - if (segae_vdp_accessmode[chip]==0x03) { /* CRAM Access */ - UINT8 r,g,b, temp; - - temp = segae_vdp_cram[chip][segae_vdp_accessaddr[chip]]; - - segae_vdp_cram[chip][segae_vdp_accessaddr[chip]] = data; - - if (temp != data) - { - - r = (segae_vdp_cram[chip][segae_vdp_accessaddr[chip]] & 0x03) >> 0; - g = (segae_vdp_cram[chip][segae_vdp_accessaddr[chip]] & 0x0c) >> 2; - b = (segae_vdp_cram[chip][segae_vdp_accessaddr[chip]] & 0x30) >> 4; - - Palette[segae_vdp_accessaddr[chip] + 32*chip] = pal2bit(r) << 16 | pal2bit(g) << 8 | pal2bit(b); //BurnHighCol(pal2bit(r), pal2bit(g), pal2bit(b), 0); - DrvPalette[segae_vdp_accessaddr[chip] + 32*chip] = BurnHighCol(pal2bit(r), pal2bit(g), pal2bit(b), 0); - } - - segae_vdp_accessaddr[chip] += 1; - segae_vdp_accessaddr[chip] &= 0x1f; - } else { /* VRAM Accesses */ - segae_vdp_vram[chip][ segae_vdp_vrambank[chip]*0x4000 + segae_vdp_accessaddr[chip] ] = data; - segae_vdp_accessaddr[chip] += 1; - segae_vdp_accessaddr[chip] &= 0x3fff; - } -} - -static void segae_vdp_reg_w ( UINT8 chip, UINT8 data ) -{ - if (!segae_vdp_cmdpart[chip]) { - segae_vdp_cmdpart[chip] = 1; - segae_vdp_command[chip] = data; - } else { - segae_vdp_cmdpart[chip] = 0; - segae_vdp_command[chip] |= (data << 8); - segae_vdp_processcmd (chip, segae_vdp_command[chip]); - } -} - -/*static UINT8 input_r(INT32 offset) -{ - //bprintf(0, _T("input_r chip %X.\n"), offset); - return 0xff; -}*/ - -static UINT8 __fastcall systeme_main_in(UINT16 port) -{ - port &= 0xff; - - switch (port) { - case 0x7e: return segae_vdp_counter_r(0, 0); - case 0x7f: return segae_vdp_counter_r(0, 1); - case 0xba: return segae_vdp_data_r(0); - case 0xbb: return segae_vdp_reg_r(0); - - case 0xbe: return segae_vdp_data_r(1); - case 0xbf: return segae_vdp_reg_r(1); - - case 0xe0: return 0xff - DrvInput[0]; - case 0xe1: return 0xff - DrvInput[1]; -// case 0xe2: return input_r(port); // AM_RANGE(0xe2, 0xe2) AM_READ_PORT( "e2" ) - case 0xf2: return DrvDip[0];//input_r(port); // AM_RANGE(0xf2, 0xf2) AM_READ_PORT( "f2" ) /* DSW0 */ - case 0xf3: return DrvDip[1];//input_r(port); // AM_RANGE(0xf3, 0xf3) AM_READ_PORT( "f3" ) /* DSW1 */ - case 0xf8: return hangonjr_port_f8_read(port); // m_maincpu->space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::hangonjr_port_f8_read), this)); - } - ////bprintf(PRINT_NORMAL, _T("IO Read %x\n"), a); - return 0; -} - -static void __fastcall systeme_main_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x7b: SN76496Write(0, data); - break; - - case 0x7f: SN76496Write(1, data); - break; - - case 0xba: segae_vdp_data_w(0, data); - break; - - case 0xbb: segae_vdp_reg_w(0, data); - break; - - case 0xbe: segae_vdp_data_w(1, data); - break; - - case 0xbf: segae_vdp_reg_w(1, data); - break; - - case 0xf7: bank_write(data); - break; - - case 0xfa: hangonjr_port_fa_write(data); - break; - } -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvMainROM = Next; Next += 0x40000; - - AllRam = Next; - DrvRAM = Next; Next += 0x10000; - - segae_vdp_vram[0] = Next; Next += 0x8000; /* 32kb (2 banks) */ - segae_vdp_vram[1] = Next; Next += 0x8000; /* 32kb (2 banks) */ - - segae_vdp_cram[0] = Next; Next += 0x20; - segae_vdp_regs[0] = Next; Next += 0x20; - - segae_vdp_cram[1] = Next; Next += 0x20; - segae_vdp_regs[1] = Next; Next += 0x20; - - cache_bitmap = Next; Next += ( (16+256+16) * 192+17 ) + 0x0f; /* 16 pixels either side to simplify drawing + 0xf for alignment */ - - DrvPalette = (UINT32*)Next; Next += 0x040 * sizeof(UINT32); - Palette = (UINT32*)Next; Next += 0x040 * sizeof(UINT32); - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -//----------------------- -static INT32 DrvExit() -{ - ZetExit(); - GenericTilesExit(); - SN76496Exit(); - BurnFree(AllMem); - - leftcolumnblank = 0; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (DrvRAM, 0, RamEnd - DrvRAM); - - hintcount = 0; - vintpending = 0; - hintpending = 0; - SN76496Reset(); - ZetOpen(0); - segae_bankswitch(); - ZetReset(); - ZetClose(); - - return 0; -} - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -static inline void DrvMakeInputs() -{ - // Reset Inputs - DrvInput[0] = DrvInput[1] = DrvInput[2] = DrvInput[3] = DrvInput[4] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy0[i] & 1) << i; - DrvInput[1] |= (DrvJoy1[i] & 1) << i; - DrvInput[2] |= (DrvJoy2[i] & 1) << i; - DrvInput[3] |= (DrvJoy3[i] & 1) << i; - DrvInput[4] |= (DrvJoy4[i] & 1) << i; - } - - // Clear Opposites - DrvClearOpposites(&DrvInput[0]); - DrvClearOpposites(&DrvInput[1]); -} - -static void segae_draw8pix_solid16(UINT8 *dest, UINT8 chip, UINT16 tile, UINT8 line, UINT8 flipx, UINT8 col) -{ - - UINT32 pix8 = *(UINT32 *)&segae_vdp_vram[chip][(32)*tile + (4)*line + (0x4000) * segae_vdp_vrambank[chip]]; - UINT8 pix, coladd; - - if (!pix8 && !col) return; /*note only the colour 0 of each vdp is transparent NOT colour 16???, fixes sky in HangonJr */ - - coladd = 16*col; - - if (flipx) { - pix = ((pix8 >> 0) & 0x01) | ((pix8 >> 7) & 0x02) | ((pix8 >> 14) & 0x04) | ((pix8 >> 21) & 0x08) ; pix+= coladd ; if (pix) dest[0] = pix+ 32*chip; - pix = ((pix8 >> 1) & 0x01) | ((pix8 >> 8) & 0x02) | ((pix8 >> 15) & 0x04) | ((pix8 >> 22) & 0x08) ; pix+= coladd ; if (pix) dest[1] = pix+ 32*chip; - pix = ((pix8 >> 2) & 0x01) | ((pix8 >> 9) & 0x02) | ((pix8 >> 16) & 0x04) | ((pix8 >> 23) & 0x08) ; pix+= coladd ; if (pix) dest[2] = pix+ 32*chip; - pix = ((pix8 >> 3) & 0x01) | ((pix8 >>10) & 0x02) | ((pix8 >> 17) & 0x04) | ((pix8 >> 24) & 0x08) ; pix+= coladd ; if (pix) dest[3] = pix+ 32*chip; - pix = ((pix8 >> 4) & 0x01) | ((pix8 >>11) & 0x02) | ((pix8 >> 18) & 0x04) | ((pix8 >> 25) & 0x08) ; pix+= coladd ; if (pix) dest[4] = pix+ 32*chip; - pix = ((pix8 >> 5) & 0x01) | ((pix8 >>12) & 0x02) | ((pix8 >> 19) & 0x04) | ((pix8 >> 26) & 0x08) ; pix+= coladd ; if (pix) dest[5] = pix+ 32*chip; - pix = ((pix8 >> 6) & 0x01) | ((pix8 >>13) & 0x02) | ((pix8 >> 20) & 0x04) | ((pix8 >> 27) & 0x08) ; pix+= coladd ; if (pix) dest[6] = pix+ 32*chip; - pix = ((pix8 >> 7) & 0x01) | ((pix8 >>14) & 0x02) | ((pix8 >> 21) & 0x04) | ((pix8 >> 28) & 0x08) ; pix+= coladd ; if (pix) dest[7] = pix+ 32*chip; - } else { - pix = ((pix8 >> 7) & 0x01) | ((pix8 >>14) & 0x02) | ((pix8 >> 21) & 0x04) | ((pix8 >> 28) & 0x08) ; pix+= coladd ; if (pix) dest[0] = pix+ 32*chip; - pix = ((pix8 >> 6) & 0x01) | ((pix8 >>13) & 0x02) | ((pix8 >> 20) & 0x04) | ((pix8 >> 27) & 0x08) ; pix+= coladd ; if (pix) dest[1] = pix+ 32*chip; - pix = ((pix8 >> 5) & 0x01) | ((pix8 >>12) & 0x02) | ((pix8 >> 19) & 0x04) | ((pix8 >> 26) & 0x08) ; pix+= coladd ; if (pix) dest[2] = pix+ 32*chip; - pix = ((pix8 >> 4) & 0x01) | ((pix8 >>11) & 0x02) | ((pix8 >> 18) & 0x04) | ((pix8 >> 25) & 0x08) ; pix+= coladd ; if (pix) dest[3] = pix+ 32*chip; - pix = ((pix8 >> 3) & 0x01) | ((pix8 >>10) & 0x02) | ((pix8 >> 17) & 0x04) | ((pix8 >> 24) & 0x08) ; pix+= coladd ; if (pix) dest[4] = pix+ 32*chip; - pix = ((pix8 >> 2) & 0x01) | ((pix8 >> 9) & 0x02) | ((pix8 >> 16) & 0x04) | ((pix8 >> 23) & 0x08) ; pix+= coladd ; if (pix) dest[5] = pix+ 32*chip; - pix = ((pix8 >> 1) & 0x01) | ((pix8 >> 8) & 0x02) | ((pix8 >> 15) & 0x04) | ((pix8 >> 22) & 0x08) ; pix+= coladd ; if (pix) dest[6] = pix+ 32*chip; - pix = ((pix8 >> 0) & 0x01) | ((pix8 >> 7) & 0x02) | ((pix8 >> 14) & 0x04) | ((pix8 >> 21) & 0x08) ; pix+= coladd ; if (pix) dest[7] = pix+ 32*chip; - } -} - -static void segae_draw8pix(UINT8 *dest, UINT8 chip, UINT16 tile, UINT8 line, UINT8 flipx, UINT8 col) -{ - - UINT32 pix8 = *(UINT32 *)&segae_vdp_vram[chip][(32)*tile + (4)*line + (0x4000) * segae_vdp_vrambank[chip]]; - UINT8 pix, coladd; - - if (!pix8) return; - - coladd = 16*col+32*chip; - - if (flipx) { - pix = ((pix8 >> 0) & 0x01) | ((pix8 >> 7) & 0x02) | ((pix8 >> 14) & 0x04) | ((pix8 >> 21) & 0x08) ; if (pix) dest[0] = pix+ coladd; - pix = ((pix8 >> 1) & 0x01) | ((pix8 >> 8) & 0x02) | ((pix8 >> 15) & 0x04) | ((pix8 >> 22) & 0x08) ; if (pix) dest[1] = pix+ coladd; - pix = ((pix8 >> 2) & 0x01) | ((pix8 >> 9) & 0x02) | ((pix8 >> 16) & 0x04) | ((pix8 >> 23) & 0x08) ; if (pix) dest[2] = pix+ coladd; - pix = ((pix8 >> 3) & 0x01) | ((pix8 >>10) & 0x02) | ((pix8 >> 17) & 0x04) | ((pix8 >> 24) & 0x08) ; if (pix) dest[3] = pix+ coladd; - pix = ((pix8 >> 4) & 0x01) | ((pix8 >>11) & 0x02) | ((pix8 >> 18) & 0x04) | ((pix8 >> 25) & 0x08) ; if (pix) dest[4] = pix+ coladd; - pix = ((pix8 >> 5) & 0x01) | ((pix8 >>12) & 0x02) | ((pix8 >> 19) & 0x04) | ((pix8 >> 26) & 0x08) ; if (pix) dest[5] = pix+ coladd; - pix = ((pix8 >> 6) & 0x01) | ((pix8 >>13) & 0x02) | ((pix8 >> 20) & 0x04) | ((pix8 >> 27) & 0x08) ; if (pix) dest[6] = pix+ coladd; - pix = ((pix8 >> 7) & 0x01) | ((pix8 >>14) & 0x02) | ((pix8 >> 21) & 0x04) | ((pix8 >> 28) & 0x08) ; if (pix) dest[7] = pix+ coladd; - } else { - pix = ((pix8 >> 7) & 0x01) | ((pix8 >>14) & 0x02) | ((pix8 >> 21) & 0x04) | ((pix8 >> 28) & 0x08) ; if (pix) dest[0] = pix+ coladd; - pix = ((pix8 >> 6) & 0x01) | ((pix8 >>13) & 0x02) | ((pix8 >> 20) & 0x04) | ((pix8 >> 27) & 0x08) ; if (pix) dest[1] = pix+ coladd; - pix = ((pix8 >> 5) & 0x01) | ((pix8 >>12) & 0x02) | ((pix8 >> 19) & 0x04) | ((pix8 >> 26) & 0x08) ; if (pix) dest[2] = pix+ coladd; - pix = ((pix8 >> 4) & 0x01) | ((pix8 >>11) & 0x02) | ((pix8 >> 18) & 0x04) | ((pix8 >> 25) & 0x08) ; if (pix) dest[3] = pix+ coladd; - pix = ((pix8 >> 3) & 0x01) | ((pix8 >>10) & 0x02) | ((pix8 >> 17) & 0x04) | ((pix8 >> 24) & 0x08) ; if (pix) dest[4] = pix+ coladd; - pix = ((pix8 >> 2) & 0x01) | ((pix8 >> 9) & 0x02) | ((pix8 >> 16) & 0x04) | ((pix8 >> 23) & 0x08) ; if (pix) dest[5] = pix+ coladd; - pix = ((pix8 >> 1) & 0x01) | ((pix8 >> 8) & 0x02) | ((pix8 >> 15) & 0x04) | ((pix8 >> 22) & 0x08) ; if (pix) dest[6] = pix+ coladd; - pix = ((pix8 >> 0) & 0x01) | ((pix8 >> 7) & 0x02) | ((pix8 >> 14) & 0x04) | ((pix8 >> 21) & 0x08) ; if (pix) dest[7] = pix+ coladd; - } -} - -static void segae_draw8pixsprite(UINT8 *dest, UINT8 chip, UINT16 tile, UINT8 line) -{ - - UINT32 pix8 = *(UINT32 *)&segae_vdp_vram[chip][(32)*tile + (4)*line + (0x4000) * segae_vdp_vrambank[chip]]; - UINT8 pix; - - if (!pix8) return; /*note only the colour 0 of each vdp is transparent NOT colour 16, fixes sky in HangonJr */ - - pix = ((pix8 >> 7) & 0x01) | ((pix8 >>14) & 0x02) | ((pix8 >> 21) & 0x04) | ((pix8 >> 28) & 0x08) ; if (pix) dest[0] = pix+16+32*chip; - pix = ((pix8 >> 6) & 0x01) | ((pix8 >>13) & 0x02) | ((pix8 >> 20) & 0x04) | ((pix8 >> 27) & 0x08) ; if (pix) dest[1] = pix+16+32*chip; - pix = ((pix8 >> 5) & 0x01) | ((pix8 >>12) & 0x02) | ((pix8 >> 19) & 0x04) | ((pix8 >> 26) & 0x08) ; if (pix) dest[2] = pix+16+32*chip; - pix = ((pix8 >> 4) & 0x01) | ((pix8 >>11) & 0x02) | ((pix8 >> 18) & 0x04) | ((pix8 >> 25) & 0x08) ; if (pix) dest[3] = pix+16+32*chip; - pix = ((pix8 >> 3) & 0x01) | ((pix8 >>10) & 0x02) | ((pix8 >> 17) & 0x04) | ((pix8 >> 24) & 0x08) ; if (pix) dest[4] = pix+16+32*chip; - pix = ((pix8 >> 2) & 0x01) | ((pix8 >> 9) & 0x02) | ((pix8 >> 16) & 0x04) | ((pix8 >> 23) & 0x08) ; if (pix) dest[5] = pix+16+32*chip; - pix = ((pix8 >> 1) & 0x01) | ((pix8 >> 8) & 0x02) | ((pix8 >> 15) & 0x04) | ((pix8 >> 22) & 0x08) ; if (pix) dest[6] = pix+16+32*chip; - pix = ((pix8 >> 0) & 0x01) | ((pix8 >> 7) & 0x02) | ((pix8 >> 14) & 0x04) | ((pix8 >> 21) & 0x08) ; if (pix) dest[7] = pix+16+32*chip; - -} - -static void segae_drawspriteline(UINT8 *dest, UINT8 chip, UINT8 line) -{ - /* todo: figure out what riddle of pythagoras hates about this */ - - int nosprites; - int loopcount; - - UINT16 spritebase; - - nosprites = 0; - - spritebase = (segae_vdp_regs[chip][5] & 0x7e) << 7; - spritebase += (segae_vdp_vrambank[chip] * 0x4000); - - /*- find out how many sprites there are -*/ - - for (loopcount=0;loopcount<64;loopcount++) { - UINT8 ypos; - - ypos = segae_vdp_vram[chip][spritebase+loopcount]; - - if (ypos==208) { - nosprites=loopcount; - break; - } - } - -// if (!strcmp(Machine->gamedrv->name,"ridleofp")) nosprites = 63; /* why, there must be a bug elsewhere i guess ?! */ - - /*- draw sprites IN REVERSE ORDER -*/ - - for (loopcount = nosprites; loopcount >= 0;loopcount--) { - int ypos; - UINT8 sheight; - - ypos = segae_vdp_vram[chip][spritebase+loopcount] +1; - - if (segae_vdp_regs[chip][1] & 0x02) sheight=16; else sheight=8; - - if ( (line >= ypos) && (line < ypos+sheight) ) { - int xpos; - UINT8 sprnum; - UINT8 spline; - - spline = line - ypos; - - xpos = segae_vdp_vram[chip][spritebase+0x80+ (2*loopcount)]; - sprnum = segae_vdp_vram[chip][spritebase+0x81+ (2*loopcount)]; - - if (segae_vdp_regs[chip][6] & 0x04) - sprnum += 0x100; - - segae_draw8pixsprite(dest+xpos, chip, sprnum, spline); - - } - } -} - -static void segae_drawtilesline(UINT8 *dest, int line, UINT8 chip, UINT8 pri) -{ - /* todo: fix vscrolling (or is it something else causing the glitch on the "game over" screen of hangonjr, seems to be .. */ - - UINT8 hscroll; - UINT8 vscroll; - UINT16 tmbase; - UINT8 tilesline, tilesline2; - UINT8 coloffset, coloffset2; - UINT8 loopcount; - - hscroll = (256-segae_vdp_regs[chip][8]); - vscroll = segae_vdp_regs[chip][9]; - if (vscroll > 224) vscroll %= 224; - - tmbase = (segae_vdp_regs[chip][2] & 0x0e) << 10; - tmbase += (segae_vdp_vrambank[chip] * 0x4000); - - tilesline = (line + vscroll) >> 3; - tilesline2= (line + vscroll) % 8; - - - coloffset = (hscroll >> 3); - coloffset2= (hscroll % 8); - - dest -= coloffset2; - - for (loopcount=0;loopcount<33;loopcount++) { - - UINT16 vram_offset, vram_word; - UINT16 tile_no; - UINT8 palette, priority, flipx, flipy; - - vram_offset = tmbase - + (2 * (32*tilesline + ((coloffset+loopcount)&0x1f) ) ); - vram_word = segae_vdp_vram[chip][vram_offset] | (segae_vdp_vram[chip][vram_offset+1] << 8); - - tile_no = (vram_word & 0x01ff); - flipx = (vram_word & 0x0200) >> 9; - flipy = (vram_word & 0x0400) >> 10; - palette = (vram_word & 0x0800) >> 11; - priority= (vram_word & 0x1000) >> 12; - - tilesline2= (line + vscroll) % 8; - if (flipy) tilesline2 = 7-tilesline2; - - if (priority == pri) { - if (chip == 0) segae_draw8pix_solid16(dest, chip, tile_no,tilesline2,flipx,palette); - else segae_draw8pix(dest, chip, tile_no,tilesline2,flipx,palette); - } - dest+=8; - } -} - -static void segae_drawscanline(int line) -{ - UINT8* dest; - - dest = cache_bitmap + (16+256+16) * line; - - /* This should be cleared to bg colour, but which vdp determines that !, neither seems to be right, maybe its always the same col? */ - memset(dest, 0, 16+256+16); - - if (segae_vdp_regs[0][1] & 0x40) { - segae_drawtilesline (dest+16, line, 0,0); - segae_drawspriteline(dest+16, 0, line); - segae_drawtilesline (dest+16, line, 0,1); - } - - { - if (segae_vdp_regs[1][1] & 0x40) { - segae_drawtilesline (dest+16, line, 1,0); - segae_drawspriteline(dest+16, 1, line); - segae_drawtilesline (dest+16, line, 1,1); - } - } - - if (leftcolumnblank) memset(dest+16, 32+16, 8); /* Clear Leftmost column, there should be a register for this like on the SMS i imagine */ - /* on the SMS this is bit 5 of register 0 (according to CMD's SMS docs) for system E this */ - /* appears to be incorrect, most games need it blanked 99% of the time so we blank it */ - -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x40; i++) { - DrvPalette[i] = BurnHighCol((Palette[i] >> 16) & 0xff, (Palette[i] >> 8) & 0xff, Palette[i] & 0xff, 0); - } - DrvRecalc = 0; - } - - BurnTransferCopy(DrvPalette); - - UINT16 *pDst = pTransDraw; - UINT8 *pSrc = &cache_bitmap[16]; - - for (INT32 y = 0; y < nScreenHeight; y++) - { - for (INT32 x = 0; x < nScreenWidth; x++) - { - pDst[x] = pSrc[x]; - } - pDst += nScreenWidth; - pSrc += 288; - } - - return 0; -} - -static void segae_interrupt () -{ - if (currentLine == 0) { - hintcount = segae_vdp_regs[1][10]; - } - - if (currentLine <= 192) { - - if (currentLine != 192) segae_drawscanline(currentLine); - - if (currentLine == 192) - vintpending = 1; - - if (hintcount == 0) { - hintcount = segae_vdp_regs[1][10]; - hintpending = 1; - - if ((segae_vdp_regs[1][0] & 0x10)) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - return; - } - - } else { - hintcount--; - } - } - - if (currentLine > 192) { - hintcount = segae_vdp_regs[1][10]; - - if ( (currentLine<0xe0) && (vintpending) ) { - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - } -} - - -static INT32 DrvFrame() -{ - INT32 nInterleave = 262; - - if (DrvReset) DrvDoReset(); - - DrvMakeInputs(); - - nCyclesTotal = 10738635 / 2 / 60; - nCyclesDone = 0; - currentLine = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run Z80 #1 - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal / nInterleave; - nCyclesSegment = nNext - nCyclesDone; - nCyclesDone += ZetRun(nCyclesSegment); - currentLine = (i - 4) & 0xff; - - segae_interrupt(); - ZetClose(); - } - - if (pBurnSoundOut) - { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvInit(UINT8 game) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (BurnLoadRom(DrvMainROM + 0x00000, 0, 1)) return 1; // ( "rom5.ic7", 0x00000, 0x08000, CRC(d63925a7) SHA1(699f222d9712fa42651c753fe75d7b60e016d3ad) ) /* Fixed Code */ - if (BurnLoadRom(DrvMainROM + 0x10000, 1, 1)) return 1; // ( "rom4.ic5", 0x10000, 0x08000, CRC(ee3caab3) SHA1(f583cf92c579d1ca235e8b300e256ba58a04dc90) ) - if (BurnLoadRom(DrvMainROM + 0x18000, 2, 1)) return 1; // ( "rom3.ic4", 0x18000, 0x08000, CRC(d2ba9bc9) SHA1(85cf2a801883bf69f78134fc4d5075134f47dc03) ) - - if(game) - { - if (BurnLoadRom(DrvMainROM + 0x20000, 3, 1)) return 1; // ( "rom2.ic3", 0x20000, 0x08000, CRC(e14da070) SHA1(f8781f65be5246a23c1f492905409775bbf82ea8) ) - if (BurnLoadRom(DrvMainROM + 0x28000, 4, 1)) return 1; // ( "rom1.ic2", 0x28000, 0x08000, CRC(3810cbf5) SHA1(c8d5032522c0c903ab3d138f62406a66e14a5c69) ) - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvMainROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvRAM, 0xc000, 0xffff, MAP_RAM); - - ZetSetWriteHandler(systeme_main_write); - ZetSetReadHandler(systeme_main_read); - ZetSetInHandler(systeme_main_in); - ZetSetOutHandler(systeme_main_out); - - ZetClose(); - - SN76489Init(0, 10738635 / 3, 0); - SN76489Init(1, 10738635 / 3, 1); - - SN76496SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = segae_vdp_vram[0]; - ba.nLen = 0x8000; - ba.szName = "vram0"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = segae_vdp_vram[1]; - ba.nLen = 0x8000; - ba.szName = "vram1"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = segae_vdp_cram[0]; - ba.nLen = 0x20; - ba.szName = "cram0"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = segae_vdp_cram[1]; - ba.nLen = 0x20; - ba.szName = "cram1"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = segae_vdp_regs[0]; - ba.nLen = 0x20; - ba.szName = "regs0"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = segae_vdp_regs[1]; - ba.nLen = 0x20; - ba.szName = "regs1"; - BurnAcb(&ba); - - } - - if (nAction & ACB_DRIVER_DATA) { - - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(segae_8000bank); - SCAN_VAR(port_fa_last); - SCAN_VAR(rombank); - - SCAN_VAR(hintcount); - SCAN_VAR(vintpending); - SCAN_VAR(hintpending); - SCAN_VAR(segae_vdp_cmdpart); - SCAN_VAR(segae_vdp_command); - - SCAN_VAR(segae_vdp_accessmode); - SCAN_VAR(segae_vdp_accessaddr); - SCAN_VAR(segae_vdp_readbuffer); - - SCAN_VAR(segae_vdp_vrambank); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - segae_bankswitch(); - ZetClose(); - } - } - - return 0; -} - - -static INT32 DrvTransfrmInit() -{ - leftcolumnblank = 1; - - return DrvInit(2); -} - -static INT32 DrvHangonJrInit() -{ - leftcolumnblank = 1; - - return DrvInit(1); -} - -static INT32 DrvTetrisInit() -{ - return DrvInit(0); -} -//----------------------- - -// Hang-On Jr. - -static struct BurnRomInfo hangonjrRomDesc[] = { - { "rom5.ic7", 0x8000, 0xd63925a7, 1 }, // 0 maincpu - { "rom4.ic5", 0x8000, 0xee3caab3, 1 }, // 1 - { "rom3.ic4", 0x8000, 0xd2ba9bc9, 1 }, // 2 - { "rom2.ic3", 0x8000, 0xe14da070, 1 }, // 3 - { "rom1.ic2", 0x8000, 0x3810cbf5, 1 }, // 4 -}; - -STD_ROM_PICK(hangonjr) -STD_ROM_FN(hangonjr) - -// Tetris (Japan, System E) - -static struct BurnRomInfo TetrisseRomDesc[] = { - - { "epr12213.7", 0x8000, 0xef3c7a38, BRF_ESS | BRF_PRG }, // 0 maincpu - { "epr12212.5", 0x8000, 0x28b550bf, BRF_ESS | BRF_PRG }, // 1 - { "epr12211.4", 0x8000, 0x5aa114e9, BRF_ESS | BRF_PRG }, // 2 -}; - -STD_ROM_PICK(Tetrisse) -STD_ROM_FN(Tetrisse) - -// Transformer - -static struct BurnRomInfo TransfrmRomDesc[] = { - - { "ic7.top", 0x8000, 0xccf1d123, BRF_ESS | BRF_PRG }, // 0 maincpu - { "epr-7347.ic5", 0x8000, 0xdf0f639f, BRF_ESS | BRF_PRG }, // 1 - { "epr-7348.ic4", 0x8000, 0x0f38ea96, BRF_ESS | BRF_PRG }, // 2 - { "ic3.top", 0x8000, 0x9d485df6, BRF_ESS | BRF_PRG }, // 3 - { "epr-7350.ic2", 0x8000, 0x0052165d, BRF_ESS | BRF_PRG }, // 4 -}; - -STD_ROM_PICK(Transfrm) -STD_ROM_FN(Transfrm) - -struct BurnDriver BurnDrvHangonjr = { - "hangonjr", NULL, NULL, NULL, "1985", - "Hang-On Jr.\0", "Graphics issues on the Game Over screen", "Sega", "System E", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, hangonjrRomInfo, hangonjrRomName, NULL, NULL, HangonjrInputInfo, HangonjrDIPInfo, - DrvHangonJrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 64, - 256, 192, 4, 3 -}; - -struct BurnDriver BurnDrvTetrisse = { - "tetrisse", NULL, NULL, NULL, "1988", - "Tetris (Japan, System E)\0", NULL, "Sega", "System E", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, TetrisseRomInfo, TetrisseRomName, NULL, NULL, TetrisseInputInfo, TetrisseDIPInfo, - DrvTetrisInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 64, - 256, 192, 4, 3 -}; - -struct BurnDriver BurnDrvTransfrm = { - "transfrm", NULL, NULL, NULL, "1986", - "Transformer\0", NULL, "Sega", "System E", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, TransfrmRomInfo, TransfrmRomName, NULL, NULL, TransfrmInputInfo, TransfrmDIPInfo, - DrvTransfrmInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 64, - 256, 192, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_suprloco.cpp b/jan/src/burn/drv/sega/d_suprloco.cpp deleted file mode 100644 index e54a8bc37..000000000 --- a/jan/src/burn/drv/sega/d_suprloco.cpp +++ /dev/null @@ -1,717 +0,0 @@ -// FB Alpha Super Locomotive driver module -// Based on MAME driver by Zsolt Vasvari - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80Dec0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvScrRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *control; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[8]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo SuprlocoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 3, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Suprloco) - -static struct BurnDIPInfo SuprlocoDIPList[]= -{ - {0x12, 0xff, 0xff, 0x40, NULL }, - {0x13, 0xff, 0xff, 0x7c, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "5 Coins 1 Credits " }, - {0x12, 0x01, 0x07, 0x06, "4 Coins 1 Credits " }, - {0x12, 0x01, 0x07, 0x05, "3 Coins 1 Credits " }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credits " }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credits " }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits " }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits " }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits " }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x38, "5 Coins 1 Credits " }, - {0x12, 0x01, 0x38, 0x30, "4 Coins 1 Credits " }, - {0x12, 0x01, 0x38, 0x28, "3 Coins 1 Credits " }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credits " }, - {0x12, 0x01, 0x38, 0x00, "1 Coin 1 Credits " }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 2 Credits " }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 3 Credits " }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 6 Credits " }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0xc0, 0x00, "2" }, - {0x12, 0x01, 0xc0, 0x40, "3" }, - {0x12, 0x01, 0xc0, 0x80, "4" }, - {0x12, 0x01, 0xc0, 0xc0, "5" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x03, 0x00, "20000" }, - {0x13, 0x01, 0x03, 0x01, "30000" }, - {0x13, 0x01, 0x03, 0x02, "40000" }, - {0x13, 0x01, 0x03, 0x03, "50000" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x10, 0x10, "Easy" }, - {0x13, 0x01, 0x10, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Infinite Lives (Cheat)" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Initial Entry" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(Suprloco) - -void __fastcall suprloco_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe800: - *soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetRun(50); - ZetClose(); - ZetOpen(0); - return; - - case 0xe801: - *flipscreen = data & 0x80; - *control = data; - return; - } -} - -UINT8 __fastcall suprloco_main_read(UINT16 address) -{ - switch (address) - { - case 0xc800: - return DrvInputs[0]; - - case 0xd000: - return DrvInputs[1]; - - case 0xd800: - return DrvInputs[2]; - - case 0xe000: - return DrvDips[0]; - - case 0xe001: - return DrvDips[1]; - - case 0xe801: - return *control; - } - - return 0; -} - -void __fastcall suprloco_sound_write(UINT16 address, UINT8 data) -{ - switch (address & ~0x0003) - { - case 0xa000: - SN76496Write(0, data); - return; - - case 0xc000: - SN76496Write(1, data); - return; - } -} - -UINT8 __fastcall suprloco_sound_read(UINT16 address) -{ - if (address == 0xe000) return *soundlatch; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80Dec0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000600; - - DrvPalette = (UINT32*)Next; Next += 0x0300 * sizeof(INT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x000800; - DrvZ80RAM1 = Next; Next += 0x000800; - - DrvVidRAM = Next; Next += 0x000700; - DrvScrRAM = Next; Next += 0x000100; - DrvSprRAM = Next; Next += 0x000200; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - control = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0;i < 512; i++) - { - INT32 bit0,bit1,bit2,r,g,b; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (DrvColPROM[i] >> 6) & 0x01; - bit2 = (DrvColPROM[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - - if (i >= 256) - { - if ((i & 0x0f) == 0x09) b = 0xff; - - DrvPalette[i + 0x100] = BurnHighCol(r, g, b, 0); - } - } -} - -static void DrvGfxDecode() -{ - UINT8 *src = DrvGfxROM0; - UINT8 *dst = DrvGfxROM0 + 0x6000; - UINT8 *lookup = DrvColPROM + 0x0200; - - for (INT32 i = 0; i < 0x80; i++, lookup += 8) - { - for (INT32 j = 0; j < 0x40; j++, src++, dst++) - { - dst[0] = dst[0x2000] = dst[0x4000] = dst[0x6000] = 0; - - for (INT32 k = 0; k < 8; k++) - { - INT32 source = (((src[0] >> k) & 0x01) << 2) | (((src[0x2000] >> k) & 0x01) << 1) | ((src[0x4000] >> k) & 0x01); - - INT32 dest = lookup[source]; - - dst[0x0000] |= (((dest >> 3) & 0x01) << k); - dst[0x2000] |= (((dest >> 2) & 0x01) << k); - dst[0x4000] |= (((dest >> 1) & 0x01) << k); - dst[0x6000] |= (((dest >> 0) & 0x01) << k); - } - } - } - - INT32 Plane[4] = { 0, 1024*8*8, 2*1024*8*8, 3*1024*8*8 }; - INT32 XOffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0 + 0x6000, 0x8000); - - GfxDecode(0x0400, 4, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - BurnFree (tmp); -} - -static void suprloco_decode(UINT8 *rom, UINT8 *decrypted, INT32 length) -{ - static const UINT8 convtable[32][4] = - { - { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, - { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, - { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, - { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, - { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, - { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, - { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, - { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, - { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, - { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, - { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, - { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, - { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, - { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, - { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, - { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 } - }; - - memcpy (decrypted + 0x8000, rom + 0x8000, length - 0x8000); - - for (INT32 A = 0; A < 0x8000; A++) - { - INT32 xorval = 0; - - UINT8 src = rom[A]; - - INT32 row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2) + (((A >> 12) & 1) << 3); - INT32 col = ((src >> 3) & 1) + (((src >> 5) & 1) << 1); - - if (src & 0x80) - { - col = 3 - col; - xorval = 0xa8; - } - - decrypted[A] = (src & ~0xa8) | (convtable[2*row+0][col] ^ xorval); - rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval); - - if (convtable[2*row+0][col] == 0xff) decrypted[A] = 0xee; - if (convtable[2*row+1][col] == 0xff) rom[A] = 0xee; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 8, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00200, 9, 1)) return 1; - memcpy (DrvColPROM + 0x0100, DrvColPROM + 0x0200, 0x0080); - memcpy (DrvColPROM + 0x0000, DrvColPROM + 0x0280, 0x0080); - memcpy (DrvColPROM + 0x0180, DrvColPROM + 0x0300, 0x0080); - memcpy (DrvColPROM + 0x0080, DrvColPROM + 0x0380, 0x0080); - - if (BurnLoadRom(DrvColPROM + 0x00200, 10, 1)) return 1; - - suprloco_decode(DrvZ80ROM0, DrvZ80Dec0, 0xc000); - - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80Dec0, DrvZ80ROM0); - ZetMapArea(0xc000, 0xc1ff, 0, DrvSprRAM); - ZetMapArea(0xc000, 0xc1ff, 1, DrvSprRAM); - ZetMapArea(0xc000, 0xc1ff, 2, DrvSprRAM); - ZetMapArea(0xf000, 0xf6ff, 0, DrvVidRAM); - ZetMapArea(0xf000, 0xf6ff, 1, DrvVidRAM); - ZetMapArea(0xf000, 0xf6ff, 2, DrvVidRAM); - ZetMapArea(0xf700, 0xf7ff, 0, DrvScrRAM); - ZetMapArea(0xf700, 0xf7ff, 1, DrvScrRAM); - ZetMapArea(0xf700, 0xf7ff, 2, DrvScrRAM); - ZetMapArea(0xf800, 0xffff, 0, DrvZ80RAM0); - ZetMapArea(0xf800, 0xffff, 1, DrvZ80RAM0); - ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM0); - ZetSetWriteHandler(suprloco_main_write); - ZetSetReadHandler(suprloco_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); - ZetSetWriteHandler(suprloco_sound_write); - ZetSetReadHandler(suprloco_sound_read); - ZetClose(); - - SN76496Init(0, 4000000, 0); - SN76496Init(1, 2000000, 1); - SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_layer(INT32 priority) -{ - UINT8 *scrollx = DrvScrRAM + 0x00e0; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sx -= scrollx[offs >> 5]; - if (sx < -7) sx += 256; - - INT32 attr = DrvVidRAM[offs * 2 + 1]; - INT32 code = DrvVidRAM[offs * 2 + 0] | ((attr & 3) << 8); - INT32 color= (attr & 0x1c) >> 2; - INT32 pri = attr & 0x20; - - if (pri != priority) continue; - - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, 238 - sx, 216 - sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } -} - -static inline void draw_pixel(INT32 x,INT32 y,INT32 color) -{ - if (*flipscreen) { - x = nScreenWidth - x - 1; - y = nScreenHeight - y - 1; - } - - if (x < 0 || x >= nScreenWidth || y < 0 || y >= nScreenHeight) return; - - pTransDraw[(y * nScreenWidth) + x] = color; -} - -static void draw_sprites() -{ - INT32 color_offset = (*control & 0x20) ? 0x200 : 0x100; - - for (INT32 offs = 0; offs < 512; offs += 0x10) - { - INT32 adjy,dy; - - INT32 sy = DrvSprRAM[offs + 0] + 1; - INT32 height = DrvSprRAM[offs + 1] - (sy - 1); - INT32 sx = DrvSprRAM[offs + 2] - 8; - INT32 pen_base =(DrvSprRAM[offs + 3] & 0x03) * 0x10 + color_offset; - INT16 skip = DrvSprRAM[offs + 4] + (DrvSprRAM[offs + 5] << 8); - INT32 src = DrvSprRAM[offs + 6] + (DrvSprRAM[offs + 7] << 8); - - if (src == 0xff) continue; - - if (!*flipscreen) - { - adjy = sy; - dy = 1; - } - else - { - adjy = sy + height - 1; - dy = -1; - } - - for (INT32 row = 0; row < height; row++, adjy+=dy) - { - INT32 color1,color2,data; - - src += skip; - - INT32 col = 0; - - UINT8 *gfx = DrvGfxROM1 + (src & 0x7fff); - - INT32 flipx = src & 0x8000; - - while (1) - { - if (flipx) - { - data = *gfx--; - color1 = data & 0x0f; - color2 = data >> 4; - } - else - { - data = *gfx++; - color1 = data >> 4; - color2 = data & 0x0f; - } - - if (color1 == 15) break; - if (color1) draw_pixel(sx+col+0, adjy, pen_base + color1); - - if (color2 == 15) break; - if (color2) draw_pixel(sx+col+1, adjy, pen_base + color2); - - col += 2; - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_layer(0x00); - draw_sprites(); - draw_layer(0x20); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 4000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nCyclesSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesSegment); - if (i == 99) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesSegment); - if (i == 24 || i == 49 || i == 74 || i == 99) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029714; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - SN76496Scan(nAction, pnMin); - } - - return 0; -} - - -// Super Locomotive (Rev.A) - -static struct BurnRomInfo suprlocoRomDesc[] = { - { "epr-5226a.37", 0x4000, 0x33b02368, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "epr-5227a.15", 0x4000, 0xa5e67f50, 1 | BRF_PRG | BRF_ESS }, // 1 - { "epr-5228.28", 0x4000, 0xa597828a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "epr-5222.64", 0x2000, 0x0aa57207, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "epr-5225.63", 0x2000, 0xe571fe81, 3 | BRF_GRA }, // 4 Background data - { "epr-5224.62", 0x2000, 0x6130f93c, 3 | BRF_GRA }, // 5 - { "epr-5223.61", 0x2000, 0x3b03004e, 3 | BRF_GRA }, // 6 - - { "epr-5229.55", 0x4000, 0xee2d3ed3, 4 | BRF_GRA }, // 7 Sprite data - { "epr-5230.56", 0x2000, 0xf04a4b50, 4 | BRF_GRA }, // 8 - - { "pr-5220.100", 0x0200, 0x7b0c8ce5, 5 | BRF_GRA }, // 9 Color Proms - { "pr-5219.89", 0x0400, 0x1d4b02cb, 5 | BRF_GRA }, // 10 - - { "pr-5221.7", 0x0020, 0x89ba674f, 0 | BRF_OPT }, // 11 Unknown -}; - -STD_ROM_PICK(suprloco) -STD_ROM_FN(suprloco) - -struct BurnDriver BurnDrvSuprloco = { - "suprloco", NULL, NULL, NULL, "1982", - "Super Locomotive (Rev.A)\0", NULL, "Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, suprlocoRomInfo, suprlocoRomName, NULL, NULL, SuprlocoInputInfo, SuprlocoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 240, 224, 4, 3 -}; - - -// Super Locomotive - -static struct BurnRomInfo suprlocooRomDesc[] = { - { "epr-5226.37", 0x4000, 0x57f514dd, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "epr-5227.15", 0x4000, 0x5a1d2fb0, 1 | BRF_PRG | BRF_ESS }, // 1 - { "epr-5228.28", 0x4000, 0xa597828a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "epr-5222.64", 0x2000, 0x0aa57207, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "epr-5225.63", 0x2000, 0xe571fe81, 3 | BRF_GRA }, // 4 Background data - { "epr-5224.62", 0x2000, 0x6130f93c, 3 | BRF_GRA }, // 5 - { "epr-5223.61", 0x2000, 0x3b03004e, 3 | BRF_GRA }, // 6 - - { "epr-5229.55", 0x4000, 0xee2d3ed3, 4 | BRF_GRA }, // 7 Sprite data - { "epr-5230.56", 0x2000, 0xf04a4b50, 4 | BRF_GRA }, // 8 - - { "pr-5220.100", 0x0200, 0x7b0c8ce5, 5 | BRF_GRA }, // 9 Color Proms - { "pr-5219.89", 0x0400, 0x1d4b02cb, 5 | BRF_GRA }, // 10 - - { "pr-5221.7", 0x0020, 0x89ba674f, 0 | BRF_OPT }, // 11 Unknown -}; - -STD_ROM_PICK(suprlocoo) -STD_ROM_FN(suprlocoo) - -struct BurnDriver BurnDrvSuprlocoo = { - "suprlocoo", "suprloco", NULL, NULL, "1982", - "Super Locomotive\0", NULL, "Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, suprlocooRomInfo, suprlocooRomName, NULL, NULL, SuprlocoInputInfo, SuprlocoDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x300, - 240, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_sys1.cpp b/jan/src/burn/drv/sega/d_sys1.cpp deleted file mode 100644 index a14629b63..000000000 --- a/jan/src/burn/drv/sega/d_sys1.cpp +++ /dev/null @@ -1,7003 +0,0 @@ -#include "tiles_generic.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "bitswap.h" -#include "mc8123.h" -#include "8255ppi.h" - -static UINT8 System1InputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 System1InputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 System1InputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 System1Dip[2] = {0, 0}; -static UINT8 System1Input[3] = {0x00, 0x00, 0x00 }; -static UINT8 System1Reset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; - -static UINT8 *System1Rom1 = NULL; -static UINT8 *System1Rom2 = NULL; -static UINT8 *System1PromRed = NULL; -static UINT8 *System1PromGreen = NULL; -static UINT8 *System1PromBlue = NULL; -static UINT8 *System1Ram1 = NULL; -static UINT8 *System1Ram2 = NULL; -static UINT8 *System1SpriteRam = NULL; -static UINT8 *System1PaletteRam = NULL; -static UINT8 *System1BgRam = NULL; -static UINT8 *System1VideoRam = NULL; -static UINT8 *System1ScrollXRam = NULL; -static UINT8 *System1BgCollisionRam = NULL; -static UINT8 *System1SprCollisionRam = NULL; -static UINT8 *System1deRam = NULL; -static UINT8 *System1efRam = NULL; -static UINT8 *System1f4Ram = NULL; -static UINT8 *System1fcRam = NULL; -static UINT32 *System1Palette = NULL; -static UINT8 *System1Tiles = NULL; -static UINT8 *System1Sprites = NULL; -static UINT8 *System1TempRom = NULL; -static UINT8 *SpriteOnScreenMap = NULL; -static UINT8 *System1Fetch1 = NULL; -static UINT8 *System1MC8123Key = NULL; -static UINT32 *System1TilesPenUsage = NULL; -// for vbt's choplifter driver -static UINT8 System1RowScroll = 0; -static INT32 System1BankSwitch; -static UINT8 System1BgBankLatch; -static UINT8 System1BgBank = 0; -// end choplifter -static UINT8 System1ScrollX[2]; -static UINT8 System1ScrollY; -static INT32 System1BgScrollX; -static INT32 System1BgScrollY; -static INT32 System1VideoMode; -static INT32 System1FlipScreen; -static INT32 System1SoundLatch; -static INT32 System1RomBank; -static INT32 NoboranbInp16Step; -static INT32 NoboranbInp17Step; -static INT32 NoboranbInp23Step; -static UINT8 BlockgalDial1; -static UINT8 BlockgalDial2; - -static INT32 System1SpriteRomSize; -static INT32 System1NumTiles; -static INT32 System1SpriteXOffset; -static INT32 System1ColourProms = 0; -static INT32 System1BankedRom = 0; -static INT32 IsSystem2 = 0; - -static INT32 Sys1UsePPI = 0; // For regulus/regulusu - -typedef void (*Decode)(); -static Decode DecodeFunction; -static Decode TileDecodeFunction; - -typedef void (*Render)(); -static Render System1Draw; -static void System1Render(); -static void System2Render(); - -typedef void (*MakeInputs)(); -static MakeInputs MakeInputsFunction; - -static INT32 nCyclesDone[2], nCyclesTotal[2]; -static INT32 nCyclesSegment; -/*============================================================================================== -Input Definitions -===============================================================================================*/ - -static struct BurnInputInfo BlockgalInputList[] = { - {"Coin 1" , BIT_DIGITAL , System1InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System1InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System1InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System1InputPort2 + 5, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , System1InputPort0 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System1InputPort0 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System1InputPort2 + 6, "p1 fire 1" }, - - {"P2 Left" , BIT_DIGITAL , System1InputPort0 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System1InputPort0 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System1InputPort2 + 7, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &System1Reset , "reset" }, - {"Service" , BIT_DIGITAL , System1InputPort2 + 3, "service" }, - {"Dip 1" , BIT_DIPSWITCH, System1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System1Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Blockgal) - -static struct BurnInputInfo FlickyInputList[] = { - {"Coin 1" , BIT_DIGITAL , System1InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System1InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System1InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System1InputPort2 + 5, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , System1InputPort0 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System1InputPort0 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System1InputPort0 + 2, "p1 fire 1" }, - - {"P2 Left" , BIT_DIGITAL , System1InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System1InputPort1 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System1InputPort1 + 2, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &System1Reset , "reset" }, - {"Service" , BIT_DIGITAL , System1InputPort2 + 3, "service" }, - {"Test" , BIT_DIGITAL , System1InputPort2 + 2, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, System1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System1Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Flicky) - -static struct BurnInputInfo MyheroInputList[] = { - {"Coin 1" , BIT_DIGITAL , System1InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System1InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System1InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System1InputPort2 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System1InputPort0 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System1InputPort0 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System1InputPort0 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System1InputPort0 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System1InputPort0 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System1InputPort0 + 2, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System1InputPort1 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System1InputPort1 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System1InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System1InputPort1 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System1InputPort1 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System1InputPort1 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &System1Reset , "reset" }, - {"Service" , BIT_DIGITAL , System1InputPort2 + 3, "service" }, - {"Test" , BIT_DIGITAL , System1InputPort2 + 2, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, System1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System1Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Myhero) - -static struct BurnInputInfo SeganinjInputList[] = { - {"Coin 1" , BIT_DIGITAL , System1InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System1InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System1InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System1InputPort2 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System1InputPort0 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System1InputPort0 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System1InputPort0 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System1InputPort0 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System1InputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System1InputPort0 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System1InputPort0 + 2, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , System1InputPort1 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System1InputPort1 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System1InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System1InputPort1 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System1InputPort1 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System1InputPort1 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System1InputPort1 + 2, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &System1Reset , "reset" }, - {"Service" , BIT_DIGITAL , System1InputPort2 + 3, "service" }, - {"Test" , BIT_DIGITAL , System1InputPort2 + 2, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, System1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System1Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Seganinj) - -static struct BurnInputInfo UpndownInputList[] = { - {"Coin 1" , BIT_DIGITAL , System1InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System1InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System1InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System1InputPort2 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System1InputPort0 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System1InputPort0 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System1InputPort0 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System1InputPort0 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System1InputPort0 + 2, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , System1InputPort1 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System1InputPort1 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System1InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System1InputPort1 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System1InputPort1 + 2, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &System1Reset , "reset" }, - {"Service" , BIT_DIGITAL , System1InputPort2 + 3, "service" }, - {"Test" , BIT_DIGITAL , System1InputPort2 + 2, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, System1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System1Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Upndown) - -static struct BurnInputInfo WboyInputList[] = { - {"Coin 1" , BIT_DIGITAL , System1InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System1InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System1InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System1InputPort2 + 5, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , System1InputPort0 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System1InputPort0 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System1InputPort0 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System1InputPort0 + 2, "p1 fire 2" }, - - {"P2 Left" , BIT_DIGITAL , System1InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System1InputPort1 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System1InputPort1 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System1InputPort1 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &System1Reset , "reset" }, - {"Service" , BIT_DIGITAL , System1InputPort2 + 3, "service" }, - {"Test" , BIT_DIGITAL , System1InputPort2 + 2, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, System1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System1Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Wboy) - -static struct BurnInputInfo WmatchInputList[] = { - {"Coin 1" , BIT_DIGITAL , System1InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System1InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System1InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System1InputPort2 + 5, "p2 start" }, - - {"P1 Left Up" , BIT_DIGITAL , System1InputPort0 + 5, "p1 up" }, - {"P1 Left Down" , BIT_DIGITAL , System1InputPort0 + 4, "p1 down" }, - {"P1 Left Left" , BIT_DIGITAL , System1InputPort0 + 7, "p1 left" }, - {"P1 Left Right" , BIT_DIGITAL , System1InputPort0 + 6, "p1 right" }, - {"P1 Right Up" , BIT_DIGITAL , System1InputPort0 + 1, "p1 fire 1" }, - {"P1 Right Down" , BIT_DIGITAL , System1InputPort0 + 0, "p1 fire 2" }, - {"P1 Right Left" , BIT_DIGITAL , System1InputPort0 + 3, "p1 fire 3" }, - {"P1 Right Right" , BIT_DIGITAL , System1InputPort0 + 2, "p1 fire 4" }, - {"P1 Fire 1" , BIT_DIGITAL , System1InputPort2 + 6, "p1 fire 5" }, - - {"P2 Left Up" , BIT_DIGITAL , System1InputPort1 + 5, "p2 up" }, - {"P2 Left Down" , BIT_DIGITAL , System1InputPort1 + 4, "p2 down" }, - {"P2 Left Left" , BIT_DIGITAL , System1InputPort1 + 7, "p2 left" }, - {"P2 Left Right" , BIT_DIGITAL , System1InputPort1 + 6, "p2 right" }, - {"P2 Right Up" , BIT_DIGITAL , System1InputPort1 + 1, "p2 fire 1" }, - {"P2 Right Down" , BIT_DIGITAL , System1InputPort1 + 0, "p2 fire 2" }, - {"P2 Right Left" , BIT_DIGITAL , System1InputPort1 + 3, "p2 fire 3" }, - {"P2 Right Right" , BIT_DIGITAL , System1InputPort1 + 2, "p2 fire 4" }, - {"P2 Fire 1" , BIT_DIGITAL , System1InputPort2 + 7, "p2 fire 5" }, - - {"Reset" , BIT_DIGITAL , &System1Reset , "reset" }, - {"Service" , BIT_DIGITAL , System1InputPort2 + 3, "service" }, - {"Test" , BIT_DIGITAL , System1InputPort2 + 2, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, System1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System1Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Wmatch) - -static struct BurnInputInfo ChplftbInputList[] = { - {"Coin 1" , BIT_DIGITAL , System1InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System1InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System1InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System1InputPort2 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System1InputPort0 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System1InputPort0 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System1InputPort0 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System1InputPort0 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System1InputPort0 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System1InputPort0 + 2, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System1InputPort1 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System1InputPort1 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System1InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System1InputPort1 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System1InputPort1 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System1InputPort1 + 2, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &System1Reset , "reset" }, - {"Service" , BIT_DIGITAL , System1InputPort2 + 3, "service" }, - {"Test" , BIT_DIGITAL , System1InputPort2 + 2, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, System1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System1Dip + 1 , "dip" }, - -}; - -STDINPUTINFO(Chplftb) - -static struct BurnInputInfo UfosensiInputList[] = { - {"Coin 1" , BIT_DIGITAL , System1InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System1InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System1InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System1InputPort2 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System1InputPort0 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System1InputPort0 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System1InputPort0 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System1InputPort0 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System1InputPort0 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System1InputPort0 + 2, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System1InputPort0 + 0, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , System1InputPort1 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System1InputPort1 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System1InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System1InputPort1 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System1InputPort1 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System1InputPort1 + 2, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System1InputPort1 + 0, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &System1Reset , "reset" }, - {"Service" , BIT_DIGITAL , System1InputPort2 + 3, "service" }, - {"Test" , BIT_DIGITAL , System1InputPort2 + 2, "diag" }, - {"Dip 1" , BIT_DIPSWITCH, System1Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System1Dip + 1 , "dip" }, - -}; - -STDINPUTINFO(Ufosensi) - -static inline void System1ClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x30) == 0x30) { - *nJoystickInputs &= ~0x30; - } - if ((*nJoystickInputs & 0xc0) == 0xc0) { - *nJoystickInputs &= ~0xc0; - } -} - -static inline void System1MakeInputs() -{ - // Reset Inputs - System1Input[0] = System1Input[1] = System1Input[2] = 0x00; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - System1Input[0] |= (System1InputPort0[i] & 1) << i; - System1Input[1] |= (System1InputPort1[i] & 1) << i; - System1Input[2] |= (System1InputPort2[i] & 1) << i; - } - - // Clear Opposites - System1ClearOpposites(&System1Input[0]); - System1ClearOpposites(&System1Input[1]); -} - -static inline void BlockgalMakeInputs() -{ - System1Input[2] = 0x00; - - for (INT32 i = 0; i < 8; i++) { - System1Input[2] |= (System1InputPort2[i] & 1) << i; - } - - if (System1InputPort0[0]) BlockgalDial1 += 0x04; - if (System1InputPort0[1]) BlockgalDial1 -= 0x04; - - if (System1InputPort0[2]) BlockgalDial2 += 0x04; - if (System1InputPort0[3]) BlockgalDial2 -= 0x04;; -} - -#define SYSTEM1_COINAGE(dipval) \ - {0 , 0xfe, 0 , 16 , "Coin A" }, \ - {dipval, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x05, "2 Coins 1 Credit 4/2 5/3 6/4"}, \ - {dipval, 0x01, 0x0f, 0x04, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x00, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x03, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0x0f, 0x02, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0x0f, 0x01, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, \ - \ - {0 , 0xfe, 0 , 16 , "Coin B" }, \ - {dipval, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x50, "2 Coins 1 Credit 4/2 5/3 6/4"}, \ - {dipval, 0x01, 0xf0, 0x40, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x00, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x30, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0xf0, 0x20, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0xf0, 0x10, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - -static struct BurnDIPInfo FourdwarrioDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x06, 0x06, "3" }, - {0x14, 0x01, 0x06, 0x04, "4" }, - {0x14, 0x01, 0x06, 0x02, "5" }, - {0x14, 0x01, 0x06, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x14, 0x01, 0x38, 0x38, "30k" }, - {0x14, 0x01, 0x38, 0x30, "40k" }, - {0x14, 0x01, 0x38, 0x28, "50k" }, - {0x14, 0x01, 0x38, 0x20, "60k" }, - {0x14, 0x01, 0x38, 0x18, "70k" }, - {0x14, 0x01, 0x38, 0x10, "80k" }, - {0x14, 0x01, 0x38, 0x08, "90k" }, - {0x14, 0x01, 0x38, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Easy" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Fourdwarrio) - -static struct BurnDIPInfo BlockgalDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0xd7, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0c, 0x01, 0x01, 0x00, "Upright" }, - {0x0c, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x02, 0x00, "Off" }, - {0x0c, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0c, 0x01, 0x08, 0x08, "2" }, - {0x0c, 0x01, 0x08, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0c, 0x01, 0x10, 0x10, "10k 30k 60k 100k 150k" }, - {0x0c, 0x01, 0x10, 0x00, "30k 50k 100k 200k 300k" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x20, 0x20, "Off" }, - {0x0c, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x80, 0x80, "Off" }, - {0x0c, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - SYSTEM1_COINAGE(0x0d) -}; - -STDDIPINFO(Blockgal) - -static struct BurnDIPInfo BrainDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, -}; - -STDDIPINFO(Brain) - -static struct BurnDIPInfo BullfgtDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "30k" }, - {0x14, 0x01, 0x30, 0x20, "50k" }, - {0x14, 0x01, 0x30, 0x10, "70k" }, - {0x14, 0x01, 0x30, 0x00, "None" }, -}; - -STDDIPINFO(Bullfgt) - -static struct BurnDIPInfo FlickyDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x0d) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x01, 0x00, "Upright" }, - {0x0e, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0e, 0x01, 0x0c, 0x0c, "2" }, - {0x0e, 0x01, 0x0c, 0x08, "3" }, - {0x0e, 0x01, 0x0c, 0x04, "4" }, - {0x0e, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0e, 0x01, 0x30, 0x30, "30k 80k 160k" }, - {0x0e, 0x01, 0x30, 0x20, "30k 100k 200k" }, - {0x0e, 0x01, 0x30, 0x10, "40k 120k 240k" }, - {0x0e, 0x01, 0x30, 0x00, "40k 140k 280k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0e, 0x01, 0x40, 0x40, "Easy" }, - {0x0e, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Flicky) - -static struct BurnDIPInfo GardiaDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x7c, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, " 5k 20k 30k" }, - {0x14, 0x01, 0x30, 0x20, "10k 25k 50k" }, - {0x14, 0x01, 0x30, 0x10, "15k 30k 60k" }, - {0x14, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Easy" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Gardia) - -static struct BurnDIPInfo HvymetalDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "50k, 100k" }, - {0x14, 0x01, 0x30, 0x20, "60k, 120k" }, - {0x14, 0x01, 0x30, 0x10, "70k, 150k" }, - {0x14, 0x01, 0x30, 0x00, "100k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Easy" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Hvymetal) - -static struct BurnDIPInfo ImsorryDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "30k" }, - {0x14, 0x01, 0x30, 0x20, "40k" }, - {0x14, 0x01, 0x30, 0x10, "50k" }, - {0x14, 0x01, 0x30, 0x00, "None" }, -}; - -STDDIPINFO(Imsorry) - -static struct BurnDIPInfo MrvikingDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x7c, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Maximum Credit" }, - {0x14, 0x01, 0x02, 0x02, "9" }, - {0x14, 0x01, 0x02, 0x00, "99" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "10k, 30k then every 30k"}, - {0x14, 0x01, 0x30, 0x20, "20k, 40k then every 30k"}, - {0x14, 0x01, 0x30, 0x10, "30k, then every 30k" }, - {0x14, 0x01, 0x30, 0x00, "40k, then every 30k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Easy" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Mrviking) - -static struct BurnDIPInfo MrvikngjDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x7c, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "10k, 30k then every 30k"}, - {0x14, 0x01, 0x30, 0x20, "20k, 40k then every 30k"}, - {0x14, 0x01, 0x30, 0x10, "30k, then every 30k" }, - {0x14, 0x01, 0x30, 0x00, "40k, then every 30k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Easy" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Mrvikngj) - -static struct BurnDIPInfo MyheroDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "30k" }, - {0x14, 0x01, 0x30, 0x20, "50k" }, - {0x14, 0x01, 0x30, 0x10, "70k" }, - {0x14, 0x01, 0x30, 0x00, "90k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Easy" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Myhero) - -static struct BurnDIPInfo NobbDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0x2f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x03, 0x00, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0x0c, 0x00, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0c, 0x04, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x30, 0x20, "Easy" }, - {0x13, 0x01, 0x30, 0x30, "Medium" }, - {0x13, 0x01, 0x30, 0x10, "Hard" }, - {0x13, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x40, 0x00, "Upright" }, - {0x13, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x80, 0x00, "Off" }, - {0x13, 0x01, 0x80, 0x80, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x03, 0x02, "2" }, - {0x14, 0x01, 0x03, 0x03, "3" }, - {0x14, 0x01, 0x03, 0x01, "5" }, - {0x14, 0x01, 0x03, 0x00, "99" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "40k, 80k, 120k, 160k" }, - {0x14, 0x01, 0x0c, 0x0c, "50k, 100k, 150k" }, - {0x14, 0x01, 0x0c, 0x04, "60k, 120k, 180k" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, -}; - -STDDIPINFO(Nobb) - -static struct BurnDIPInfo Pitfall2DIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xdc, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x14, 0x01, 0x10, 0x10, "20k 50k" }, - {0x14, 0x01, 0x10, 0x00, "30k 70k" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Time" }, - {0x14, 0x01, 0x40, 0x00, "2 minutes" }, - {0x14, 0x01, 0x40, 0x40, "3 minutes" }, -}; - -STDDIPINFO(Pitfall2) - -static struct BurnDIPInfo PitfalluDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xde, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x06, 0x06, "3" }, - {0x14, 0x01, 0x06, 0x04, "4" }, - {0x14, 0x01, 0x06, 0x02, "5" }, - {0x14, 0x01, 0x06, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Starting Stage" }, - {0x14, 0x01, 0x18, 0x18, "1" }, - {0x14, 0x01, 0x18, 0x10, "2" }, - {0x14, 0x01, 0x18, 0x08, "3" }, - {0x14, 0x01, 0x18, 0x00, "4" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Time" }, - {0x14, 0x01, 0x40, 0x00, "2 minutes" }, - {0x14, 0x01, 0x40, 0x40, "3 minutes" }, -}; - -STDDIPINFO(Pitfallu) - -static struct BurnDIPInfo RaflesiaDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "20k, 70k and 120k" }, - {0x14, 0x01, 0x30, 0x20, "30k, 80k and 150k" }, - {0x14, 0x01, 0x30, 0x10, "50k, 100k and 200k" }, - {0x14, 0x01, 0x30, 0x00, "None" }, -}; - -STDDIPINFO(Raflesia) - -static struct BurnDIPInfo RegulusDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x7e, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Easy" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Regulus) - -static struct BurnDIPInfo RegulusoDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Easy" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Reguluso) - -static struct BurnDIPInfo SeganinjDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xdc, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x15) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x16, 0x01, 0x01, 0x00, "Upright" }, - {0x16, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x0c, 0x08, "2" }, - {0x16, 0x01, 0x0c, 0x0c, "3" }, - {0x16, 0x01, 0x0c, 0x04, "4" }, - {0x16, 0x01, 0x0c, 0x00, "240" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x16, 0x01, 0x10, 0x10, "20k 70k 120k 170k" }, - {0x16, 0x01, 0x10, 0x00, "50k 100k 150k 200k" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x20, 0x20, "Off" }, - {0x16, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x16, 0x01, 0x40, 0x40, "Easy" }, - {0x16, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Seganinj) - -static struct BurnDIPInfo SpatterDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x08, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x04, "4" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "40k, 120k and 480k" }, - {0x14, 0x01, 0x30, 0x20, "50k and 200k" }, - {0x14, 0x01, 0x30, 0x10, "100k only" }, - {0x14, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Reset Timer/Objects on Life Loss" }, - {0x14, 0x01, 0x40, 0x40, "No" }, - {0x14, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Spatter) - -static struct BurnDIPInfo StarjackDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xf6, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x06, 0x06, "3" }, - {0x14, 0x01, 0x06, 0x04, "4" }, - {0x14, 0x01, 0x06, 0x02, "5" }, - {0x14, 0x01, 0x06, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x14, 0x01, 0x38, 0x38, "Every 20k" }, - {0x14, 0x01, 0x38, 0x28, "Every 30k" }, - {0x14, 0x01, 0x38, 0x18, "Every 40k" }, - {0x14, 0x01, 0x38, 0x08, "Every 50k" }, - {0x14, 0x01, 0x38, 0x30, "20k, then every 30k" }, - {0x14, 0x01, 0x38, 0x20, "30k, then every 40k" }, - {0x14, 0x01, 0x38, 0x10, "40k, then every 50k" }, - {0x14, 0x01, 0x38, 0x00, "50k, then every 60k" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0xc0, 0xc0, "Easy" }, - {0x14, 0x01, 0xc0, 0x80, "Medium" }, - {0x14, 0x01, 0xc0, 0x40, "Hard" }, - {0x14, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Starjack) - -static struct BurnDIPInfo StarjacsDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x06, 0x06, "3" }, - {0x14, 0x01, 0x06, 0x04, "4" }, - {0x14, 0x01, 0x06, 0x02, "5" }, - {0x14, 0x01, 0x06, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 2 , "Ship" }, - {0x14, 0x01, 0x08, 0x08, "Single" }, - {0x14, 0x01, 0x08, 0x00, "Multi" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "30k, then every 40k" }, - {0x14, 0x01, 0x30, 0x20, "40k, then every 50k" }, - {0x14, 0x01, 0x30, 0x10, "50k, then every 60k" }, - {0x14, 0x01, 0x30, 0x00, "60k, then every 70k" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0xc0, 0xc0, "Easy" }, - {0x14, 0x01, 0xc0, 0x80, "Medium" }, - {0x14, 0x01, 0xc0, 0x40, "Hard" }, - {0x14, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Starjacs) - -static struct BurnDIPInfo SwatDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x06, 0x06, "3" }, - {0x14, 0x01, 0x06, 0x04, "4" }, - {0x14, 0x01, 0x06, 0x02, "5" }, - {0x14, 0x01, 0x06, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x14, 0x01, 0x38, 0x38, "30k" }, - {0x14, 0x01, 0x38, 0x30, "40k" }, - {0x14, 0x01, 0x38, 0x28, "50k" }, - {0x14, 0x01, 0x38, 0x20, "60k" }, - {0x14, 0x01, 0x38, 0x18, "70k" }, - {0x14, 0x01, 0x38, 0x10, "80k" }, - {0x14, 0x01, 0x38, 0x08, "90k" }, - {0x14, 0x01, 0x38, 0x00, "None" }, -}; - -STDDIPINFO(Swat) - -static struct BurnDIPInfo TeddybbDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x00, "Off" }, - {0x14, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x08, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x04, "4" }, - {0x14, 0x01, 0x0c, 0x00, "252" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "100k 400k" }, - {0x14, 0x01, 0x30, 0x20, "200k 600k" }, - {0x14, 0x01, 0x30, 0x10, "400k 800k" }, - {0x14, 0x01, 0x30, 0x00, "600k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Easy" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Teddybb) - -static struct BurnDIPInfo TokisensDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x00, "Off" }, - {0x14, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x0c, 0x00, "1" }, - {0x14, 0x01, 0x0c, 0x08, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x04, "4" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x04, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x20, 0x20, "Off" }, - {0x14, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Tokisens) - -static struct BurnDIPInfo UpndownDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x11) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x12, 0x01, 0x01, 0x00, "Upright" }, - {0x12, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x06, 0x06, "3" }, - {0x12, 0x01, 0x06, 0x04, "4" }, - {0x12, 0x01, 0x06, 0x02, "5" }, - {0x12, 0x01, 0x06, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 8 , "Bonus Life" }, - {0x12, 0x01, 0x38, 0x38, "10k" }, - {0x12, 0x01, 0x38, 0x30, "20k" }, - {0x12, 0x01, 0x38, 0x28, "30k" }, - {0x12, 0x01, 0x38, 0x20, "40k" }, - {0x12, 0x01, 0x38, 0x18, "50k" }, - {0x12, 0x01, 0x38, 0x10, "60k" }, - {0x12, 0x01, 0x38, 0x08, "70k" }, - {0x12, 0x01, 0x38, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0xc0, 0xc0, "Easy" }, - {0x12, 0x01, 0xc0, 0x80, "Medium" }, - {0x12, 0x01, 0xc0, 0x40, "Hard" }, - {0x12, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Upndown) - -static struct BurnDIPInfo WboyDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xec, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x0f) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x01, 0x00, "Upright" }, - {0x10, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x02, 0x02, "Off" }, - {0x10, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x0c, 0x0c, "3" }, - {0x10, 0x01, 0x0c, 0x08, "4" }, - {0x10, 0x01, 0x0c, 0x04, "5" }, - {0x10, 0x01, 0x0c, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x10, 0x10, "30k 100k 170k 240k" }, - {0x10, 0x01, 0x10, 0x00, "30k 120k 210k 300k" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x10, 0x01, 0x20, 0x00, "Off" }, - {0x10, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x10, 0x01, 0x40, 0x40, "Easy" }, - {0x10, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Wboy) - -static struct BurnDIPInfo Wboy3DIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xec, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x0f) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x01, 0x00, "Upright" }, - {0x10, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x02, 0x02, "Off" }, - {0x10, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x0c, 0x0c, "1" }, - {0x10, 0x01, 0x0c, 0x08, "2" }, - {0x10, 0x01, 0x0c, 0x04, "3" }, - {0x10, 0x01, 0x0c, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x10, 0x10, "30k 100k 170k 240k" }, - {0x10, 0x01, 0x10, 0x00, "30k 120k 210k 300k" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x10, 0x01, 0x20, 0x00, "Off" }, - {0x10, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x10, 0x01, 0x40, 0x40, "Easy" }, - {0x10, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Wboy3) - -static struct BurnDIPInfo WboyuDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xbe, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x01, 0x00, "Upright" }, - {0x0f, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x06, 0x00, "2" }, - {0x0f, 0x01, 0x06, 0x06, "3" }, - {0x0f, 0x01, 0x06, 0x04, "4" }, - {0x0f, 0x01, 0x06, 0x02, "5" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x10, 0x01, 0x07, 0x04, "4 Coins 1 Credit" }, - {0x10, 0x01, 0x07, 0x05, "3 Coins 1 Credit" }, - {0x10, 0x01, 0x07, 0x00, "4 Coins 2 Credits" }, - {0x10, 0x01, 0x07, 0x06, "2 Coins 1 Credit" }, - {0x10, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x10, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x10, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x10, 0x01, 0x10, 0x00, "Off" }, - {0x10, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4 , "Mode" }, - {0x10, 0x01, 0xc0, 0xc0, "Normal Game" }, - {0x10, 0x01, 0xc0, 0x80, "Free Play" }, - {0x10, 0x01, 0xc0, 0x40, "Test Mode" }, - {0x10, 0x01, 0xc0, 0x00, "Endless Game" }, -}; - -STDDIPINFO(Wboyu) - -static struct BurnDIPInfo WbdeluxeDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0x7c, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x0f) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x10, 0x01, 0x01, 0x00, "Upright" }, - {0x10, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x02, 0x02, "Off" }, - {0x10, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x0c, 0x0c, "3" }, - {0x10, 0x01, 0x0c, 0x08, "4" }, - {0x10, 0x01, 0x0c, 0x04, "5" }, - {0x10, 0x01, 0x0c, 0x00, "Freeplay" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x10, 0x10, "30k 100k 170k 240k" }, - {0x10, 0x01, 0x10, 0x00, "30k 120k 210k 300k" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x10, 0x01, 0x20, 0x00, "Off" }, - {0x10, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x10, 0x01, 0x40, 0x40, "Easy" }, - {0x10, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Energy Consumption" }, - {0x10, 0x01, 0x80, 0x00, "Slow" }, - {0x10, 0x01, 0x80, 0x80, "Fast" }, -}; - -STDDIPINFO(Wbdeluxe) - -static struct BurnDIPInfo WmatchDIPList[]= -{ - // Default Values - {0x19, 0xff, 0xff, 0xff, NULL }, - {0x1a, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x19) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x1a, 0x01, 0x01, 0x00, "Upright" }, - {0x1a, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1a, 0x01, 0x02, 0x02, "Off" }, - {0x1a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Time" }, - {0x1a, 0x01, 0x0c, 0x0c, "Normal" }, - {0x1a, 0x01, 0x0c, 0x08, "Fast" }, - {0x1a, 0x01, 0x0c, 0x04, "Faster" }, - {0x1a, 0x01, 0x0c, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x1a, 0x01, 0x10, 0x10, "20k 50k" }, - {0x1a, 0x01, 0x10, 0x00, "30k 70k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x1a, 0x01, 0x40, 0x40, "Easy" }, - {0x1a, 0x01, 0x40, 0x00, "Hard" }, -}; - -STDDIPINFO(Wmatch) - -static struct BurnDIPInfo ChplftbDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xbe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 3 , "Lives" }, - {0x13, 0x01, 0x0c, 0x04, "3" }, - {0x13, 0x01, 0x0c, 0x0c, "4" }, - {0x13, 0x01, 0x06, 0x08, "5" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x14, 0x01, 0x07, 0x04, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x07, 0x05, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x07, 0x00, "4 Coins 2 Credits" }, - {0x14, 0x01, 0x07, 0x06, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x14, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4 , "Mode" }, - {0x14, 0x01, 0xc0, 0xc0, "Normal Game" }, - {0x14, 0x01, 0xc0, 0x80, "Free Play" }, - {0x14, 0x01, 0xc0, 0x40, "Test Mode" }, - {0x14, 0x01, 0xc0, 0x00, "Endless Game" }, -}; - -STDDIPINFO(Chplftb) - -static struct BurnDIPInfo UfosensiDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0x8d, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x00, "Easy" }, - {0x15, 0x01, 0x03, 0x01, "Normal" }, - {0x15, 0x01, 0x03, 0x02, "Hard" }, - {0x15, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 3, "Lives" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x04, "4" }, - {0x15, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x10, 0x00, "Upright" }, - {0x15, 0x01, 0x10, 0x10, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x15, 0x01, 0x20, 0x20, "No" }, - {0x15, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Coinage" }, - {0x16, 0x01, 0x07, 0x04, "4 Coins 1 Credit" }, - {0x16, 0x01, 0x07, 0x05, "3 Coins 1 Credit" }, - {0x16, 0x01, 0x07, 0x00, "4 Coins 2 Credits" }, - {0x16, 0x01, 0x07, 0x06, "2 Coins 1 Credit" }, - {0x16, 0x01, 0x07, 0x01, "3 Coins 2 Credits" }, - {0x16, 0x01, 0x07, 0x02, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x16, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x10, 0x00, "Off" }, - {0x16, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4 , "Mode" }, - {0x16, 0x01, 0xc0, 0xc0, "Normal Game" }, - {0x16, 0x01, 0xc0, 0x80, "Free Play" }, - {0x16, 0x01, 0xc0, 0x40, "Test Mode" }, - {0x16, 0x01, 0xc0, 0x00, "Endless Game" }, -}; - -STDDIPINFO(Ufosensi) - -static struct BurnDIPInfo WbmlDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM1_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x00, "Off" }, - {0x14, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 3, "Lives" }, - {0x14, 0x01, 0x0c, 0x04, "3" }, - {0x14, 0x01, 0x0c, 0x0c, "4" }, - {0x14, 0x01, 0x0c, 0x08, "5" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x14, 0x01, 0x10, 0x10, "30000 100000 200000" }, - {0x14, 0x01, 0x10, 0x00, "50000 150000 250000" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x14, 0x01, 0x20, 0x20, "Easy" }, - {0x14, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Test Mode" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Wbml) - -#undef SYSTEM1_COINAGE - -/*============================================================================================== -ROM Descriptions -===============================================================================================*/ - -static struct BurnRomInfo FourdwarrioRomDesc[] = { - { "4d.116", 0x004000, 0x546d1bc7, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "4d.109", 0x004000, 0xf1074ec3, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "4d.96", 0x004000, 0x387c1e8f, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "4d.120", 0x002000, 0x5241c009, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "4d.62", 0x002000, 0xf31b2e09, BRF_GRA }, // 4 Tiles - { "4d.61", 0x002000, 0x5430e925, BRF_GRA }, // 5 Tiles - { "4d.64", 0x002000, 0x9f442351, BRF_GRA }, // 6 Tiles - { "4d.63", 0x002000, 0x633232bd, BRF_GRA }, // 7 Tiles - { "4d.66", 0x002000, 0x52bfa2ed, BRF_GRA }, // 8 Tiles - { "4d.65", 0x002000, 0xe9ba4658, BRF_GRA }, // 9 Tiles - - { "4d.117", 0x004000, 0x436e4141, BRF_GRA }, // 10 Sprites - { "4d.04", 0x004000, 0x8b7cecef, BRF_GRA }, // 11 Sprites - { "4d.110", 0x004000, 0x6ec5990a, BRF_GRA }, // 12 Sprites - { "4d.05", 0x004000, 0xf31a1e6a, BRF_GRA }, // 13 Sprites - - { "pr5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Fourdwarrio) -STD_ROM_FN(Fourdwarrio) - -static struct BurnRomInfo BlockgalRomDesc[] = { - { "bg.116", 0x004000, 0xa99b231a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bg.109", 0x004000, 0xa6b573d5, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "bg.120", 0x002000, 0xd848faff, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - - { "bg.62", 0x002000, 0x7e3ea4eb, BRF_GRA }, // 3 Tiles - { "bg.61", 0x002000, 0x4dd3d39d, BRF_GRA }, // 4 Tiles - { "bg.64", 0x002000, 0x17368663, BRF_GRA }, // 5 Tiles - { "bg.63", 0x002000, 0x0c8bc404, BRF_GRA }, // 6 Tiles - { "bg.66", 0x002000, 0x2b7dc4fa, BRF_GRA }, // 7 Tiles - { "bg.65", 0x002000, 0xed121306, BRF_GRA }, // 8 Tiles - - { "bg.117", 0x004000, 0xe99cc920, BRF_GRA }, // 9 Sprites - { "bg.04", 0x004000, 0x213057f8, BRF_GRA }, // 10 Sprites - { "bg.110", 0x004000, 0x064c812c, BRF_GRA }, // 11 Sprites - { "bg.05", 0x004000, 0x02e0b040, BRF_GRA }, // 12 Sprites - - { "pr5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 13 Timing PROM - - { "317-0029.key", 0x002000, 0x350d7f93, BRF_ESS | BRF_PRG }, // 14 MC8123 Key -}; - -STD_ROM_PICK(Blockgal) -STD_ROM_FN(Blockgal) - -static struct BurnRomInfo BrainRomDesc[] = { - { "brain.1", 0x008000, 0x2d2aec31, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "brain.2", 0x008000, 0x810a8ab5, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "brain.3", 0x008000, 0x9a225634, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "brain.120", 0x008000, 0xc7e50278, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "brain.62", 0x004000, 0x7dce2302, BRF_GRA }, // 4 Tiles - { "brain.64", 0x004000, 0x7ce03fd3, BRF_GRA }, // 5 Tiles - { "brain.66", 0x004000, 0xea54323f, BRF_GRA }, // 6 Tiles - - { "brain.117", 0x008000, 0x92ff71a4, BRF_GRA }, // 7 Sprites - { "brain.110", 0x008000, 0xa1b847ec, BRF_GRA }, // 8 Sprites - { "brain.4", 0x008000, 0xfd2ea53b, BRF_GRA }, // 9 Sprites - - { "bprom.3", 0x000100, 0x8eee0f72, BRF_GRA }, // 10 Red PROM - { "bprom.2", 0x000100, 0x3e7babd7, BRF_GRA }, // 11 Green PROM - { "bprom.1", 0x000100, 0x371c44a6, BRF_GRA }, // 12 Blue PROM - { "pr5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 13 Timing PROM -}; - -STD_ROM_PICK(Brain) -STD_ROM_FN(Brain) - -static struct BurnRomInfo BullfgtRomDesc[] = { - { "epr-.129", 0x002000, 0x29f19156, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-.130", 0x002000, 0xe37d2b95, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-.131", 0x002000, 0xeaf5773d, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-.132", 0x002000, 0x72c3c712, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-.133", 0x002000, 0x7d9fa4cd, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-.134", 0x002000, 0x061f2797, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-6077.120", 0x002000, 0x02a37602, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-.82", 0x002000, 0xb71c349f, BRF_GRA }, // 7 Tiles - { "epr-.65", 0x002000, 0x86deafa8, BRF_GRA }, // 8 Tiles - { "epr-6087.81", 0x002000, 0x2677742c, BRF_GRA }, // 9 Tiles - { "epr-.64", 0x002000, 0x6f0a62be, BRF_GRA }, // 10 Tiles - { "epr-6085.80", 0x002000, 0x9c3ddc62, BRF_GRA }, // 11 Tiles - { "epr-.63", 0x002000, 0xc0fce57c, BRF_GRA }, // 12 Tiles - - { "epr-6069.86", 0x004000, 0xfe691e41, BRF_GRA }, // 13 Sprites - { "epr-6070.93", 0x004000, 0x34f080df, BRF_GRA }, // 14 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Bullfgt) -STD_ROM_FN(Bullfgt) - -static struct BurnRomInfo ThetogyuRomDesc[] = { - { "epr-6071.116", 0x004000, 0x96b57df9, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6072.109", 0x004000, 0xf7baadd0, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6073.96", 0x004000, 0x721af166, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6077.120", 0x002000, 0x02a37602, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-6089.62", 0x002000, 0xa183e5ff, BRF_GRA }, // 7 Tiles - { "epr-6088.61", 0x002000, 0xb919b4a6, BRF_GRA }, // 8 Tiles - { "epr-6087.64", 0x002000, 0x2677742c, BRF_GRA }, // 9 Tiles - { "epr-6086.63", 0x002000, 0x76b5a084, BRF_GRA }, // 10 Tiles - { "epr-6085.66", 0x002000, 0x9c3ddc62, BRF_GRA }, // 11 Tiles - { "epr-6084.65", 0x002000, 0x90e1fa5f, BRF_GRA }, // 12 Tiles - - { "epr-6069.117", 0x004000, 0xfe691e41, BRF_GRA }, // 13 Sprites - { "epr-6070.110", 0x004000, 0x34f080df, BRF_GRA }, // 14 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Thetogyu) -STD_ROM_FN(Thetogyu) - -static struct BurnRomInfo FlickyRomDesc[] = { - { "epr5978a.116", 0x004000, 0x296f1492, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr5979a.109", 0x004000, 0x64b03ef9, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "epr-5869.120", 0x002000, 0x6d220d4e, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - - { "epr-5868.62", 0x002000, 0x7402256b, BRF_GRA }, // 3 Tiles - { "epr-5867.61", 0x002000, 0x2f5ce930, BRF_GRA }, // 4 Tiles - { "epr-5866.64", 0x002000, 0x967f1d9a, BRF_GRA }, // 5 Tiles - { "epr-5865.63", 0x002000, 0x03d9a34c, BRF_GRA }, // 6 Tiles - { "epr-5864.66", 0x002000, 0xe659f358, BRF_GRA }, // 7 Tiles - { "epr-5863.65", 0x002000, 0xa496ca15, BRF_GRA }, // 8 Tiles - - { "epr-5855.117", 0x004000, 0xb5f894a1, BRF_GRA }, // 9 Sprites - { "epr-5856.110", 0x004000, 0x266af78f, BRF_GRA }, // 10 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 11 Timing PROM -}; - -STD_ROM_PICK(Flicky) -STD_ROM_FN(Flicky) - -static struct BurnRomInfo FlickyaRomDesc[] = { - { "epr5978a.116", 0x004000, 0x296f1492, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr5979a.109", 0x004000, 0x64b03ef9, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "epr-5869.120", 0x002000, 0x6d220d4e, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - - { "epr-6001.62", 0x004000, 0xf1a75200, BRF_GRA }, // 3 Tiles - { "epr-6000.64", 0x004000, 0x299aefb7, BRF_GRA }, // 4 Tiles - { "epr-5999.66", 0x004000, 0x1ca53157, BRF_GRA }, // 5 Tiles - - { "epr-5855.117", 0x004000, 0xb5f894a1, BRF_GRA }, // 6 Sprites - { "epr-5856.110", 0x004000, 0x266af78f, BRF_GRA }, // 7 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 8 Timing PROM -}; - -STD_ROM_PICK(Flickya) -STD_ROM_FN(Flickya) - -static struct BurnRomInfo FlickygRomDesc[] = { - { "epr5978a.116", 0x004000, 0x296f1492, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr5979a.109", 0x004000, 0x64b03ef9, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "epr-5869.120", 0x002000, 0x6d220d4e, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - - { "66xx.ic62", 0x004000, 0xf1a75200, BRF_GRA }, // 3 Tiles - { "66x0.ic64", 0x004000, 0x299aefb7, BRF_GRA }, // 4 Tiles - { "5999.ic66", 0x004000, 0x1ca53157, BRF_GRA }, // 5 Tiles - - { "epr-5855.117", 0x004000, 0xb5f894a1, BRF_GRA }, // 6 Sprites - { "epr-5856.110", 0x004000, 0x266af78f, BRF_GRA }, // 7 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 8 Timing PROM -}; - -STD_ROM_PICK(Flickyg) -STD_ROM_FN(Flickyg) - -static struct BurnRomInfo Flickys1RomDesc[] = { - { "ic129", 0x002000, 0x7011275c, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ic130", 0x002000, 0xe7ed012d, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "ic131", 0x002000, 0xc5e98cd1, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "ic132", 0x002000, 0x0e5122c2, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - - { "epr-5869.120", 0x002000, 0x6d220d4e, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - - { "epr-5868.62", 0x002000, 0x7402256b, BRF_GRA }, // 5 Tiles - { "epr-5867.61", 0x002000, 0x2f5ce930, BRF_GRA }, // 6 Tiles - { "epr-5866.64", 0x002000, 0x967f1d9a, BRF_GRA }, // 7 Tiles - { "epr-5865.63", 0x002000, 0x03d9a34c, BRF_GRA }, // 8 Tiles - { "epr-5864.66", 0x002000, 0xe659f358, BRF_GRA }, // 9 Tiles - { "epr-5863.65", 0x002000, 0xa496ca15, BRF_GRA }, // 10 Tiles - - { "epr-5855.117", 0x004000, 0xb5f894a1, BRF_GRA }, // 11 Sprites - { "epr-5856.110", 0x004000, 0x266af78f, BRF_GRA }, // 12 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 13 Timing PROM -}; - -STD_ROM_PICK(Flickys1) -STD_ROM_FN(Flickys1) - -static struct BurnRomInfo Flickys2RomDesc[] = { - { "epr-6621.bin", 0x004000, 0xb21ff546, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6622.bin", 0x004000, 0x133a8bf1, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "epr-5869.120", 0x002000, 0x6d220d4e, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - - { "epr-5868.62", 0x002000, 0x7402256b, BRF_GRA }, // 3 Tiles - { "epr-5867.61", 0x002000, 0x2f5ce930, BRF_GRA }, // 4 Tiles - { "epr-5866.64", 0x002000, 0x967f1d9a, BRF_GRA }, // 5 Tiles - { "epr-5865.63", 0x002000, 0x03d9a34c, BRF_GRA }, // 6 Tiles - { "epr-5864.66", 0x002000, 0xe659f358, BRF_GRA }, // 7 Tiles - { "epr-5863.65", 0x002000, 0xa496ca15, BRF_GRA }, // 8 Tiles - - { "epr-5855.117", 0x004000, 0xb5f894a1, BRF_GRA }, // 9 Sprites - { "epr-5856.110", 0x004000, 0x266af78f, BRF_GRA }, // 10 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 11 Timing PROM -}; - -STD_ROM_PICK(Flickys2) -STD_ROM_FN(Flickys2) - -static struct BurnRomInfo Flickys2gRomDesc[] = { - { "epr-6621.bin", 0x004000, 0xb21ff546, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6622.bin", 0x004000, 0x133a8bf1, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "epr-5869.120", 0x002000, 0x6d220d4e, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - - { "66xx.ic62", 0x004000, 0xf1a75200, BRF_GRA }, // 3 Tiles - { "66x0.ic64", 0x004000, 0x299aefb7, BRF_GRA }, // 4 Tiles - { "5999.ic66", 0x004000, 0x1ca53157, BRF_GRA }, // 5 Tiles - - { "epr-5855.117", 0x004000, 0xb5f894a1, BRF_GRA }, // 6 Sprites - { "epr-5856.110", 0x004000, 0x266af78f, BRF_GRA }, // 7 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 8 Timing PROM -}; - -STD_ROM_PICK(Flickys2g) -STD_ROM_FN(Flickys2g) - -static struct BurnRomInfo FlickyoRomDesc[] = { - { "epr-5857.bin", 0x002000, 0xa65ac88e, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr5858a.bin", 0x002000, 0x18b412f4, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-5859.bin", 0x002000, 0xa5558d7e, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5860.bin", 0x002000, 0x1b35fef1, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - - { "epr-5869.120", 0x002000, 0x6d220d4e, BRF_ESS | BRF_PRG }, // 4 Z80 #2 Program Code - - { "epr-5868.62", 0x002000, 0x7402256b, BRF_GRA }, // 5 Tiles - { "epr-5867.61", 0x002000, 0x2f5ce930, BRF_GRA }, // 6 Tiles - { "epr-5866.64", 0x002000, 0x967f1d9a, BRF_GRA }, // 7 Tiles - { "epr-5865.63", 0x002000, 0x03d9a34c, BRF_GRA }, // 8 Tiles - { "epr-5864.66", 0x002000, 0xe659f358, BRF_GRA }, // 9 Tiles - { "epr-5863.65", 0x002000, 0xa496ca15, BRF_GRA }, // 10 Tiles - - { "epr-5855.117", 0x004000, 0xb5f894a1, BRF_GRA }, // 11 Sprites - { "epr-5856.110", 0x004000, 0x266af78f, BRF_GRA }, // 12 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 13 Timing PROM -}; - -STD_ROM_PICK(Flickyo) -STD_ROM_FN(Flickyo) - -static struct BurnRomInfo GardiaRomDesc[] = { - { "epr10255.1", 0x008000, 0x89282a6b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr10254.2", 0x008000, 0x2826b6d8, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr10253.3", 0x008000, 0x7911260f, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr10243.120", 0x004000, 0x87220660, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr10249.61", 0x004000, 0x4e0ad0f2, BRF_GRA }, // 4 Tiles - { "epr10248.64", 0x004000, 0x3515d124, BRF_GRA }, // 5 Tiles - { "epr10247.66", 0x004000, 0x541e1555, BRF_GRA }, // 6 Tiles - - { "epr10234.117", 0x008000, 0x8a6aed33, BRF_GRA }, // 7 Sprites - { "epr10233.110", 0x008000, 0xc52784d3, BRF_GRA }, // 8 Sprites - { "epr10236.04", 0x008000, 0xb35ab227, BRF_GRA }, // 9 Sprites - { "epr10235.5", 0x008000, 0x006a3151, BRF_GRA }, // 10 Sprites - - { "bprom.3", 0x000100, 0x8eee0f72, BRF_GRA }, // 11 Red PROM - { "bprom.2", 0x000100, 0x3e7babd7, BRF_GRA }, // 12 Green PROM - { "bprom.1", 0x000100, 0x371c44a6, BRF_GRA }, // 13 Blue PROM - { "pr5317.4", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Gardia) -STD_ROM_FN(Gardia) - -static struct BurnRomInfo GardiabRomDesc[] = { - { "gardiabl.5", 0x008000, 0x207f9cbb, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "gardiabl.6", 0x008000, 0xb2ed05dc, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "gardiabl.7", 0x008000, 0x0a490588, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr10243.120", 0x004000, 0x87220660, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "gardiabl.8", 0x004000, 0x367c9a17, BRF_GRA }, // 4 Tiles - { "gardiabl.9", 0x004000, 0x1540fd30, BRF_GRA }, // 5 Tiles - { "gardiabl.10", 0x004000, 0xe5c9af10, BRF_GRA }, // 6 Tiles - - { "epr10234.117", 0x008000, 0x8a6aed33, BRF_GRA }, // 7 Sprites - { "epr10233.110", 0x008000, 0xc52784d3, BRF_GRA }, // 8 Sprites - { "epr10236.04", 0x008000, 0xb35ab227, BRF_GRA }, // 9 Sprites - { "epr10235.5", 0x008000, 0x006a3151, BRF_GRA }, // 10 Sprites - - { "bprom.3", 0x000100, 0x8eee0f72, BRF_GRA }, // 11 Red PROM - { "bprom.2", 0x000100, 0x3e7babd7, BRF_GRA }, // 12 Green PROM - { "bprom.1", 0x000100, 0x371c44a6, BRF_GRA }, // 13 Blue PROM - { "pr5317.4", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Gardiab) -STD_ROM_FN(Gardiab) - -static struct BurnRomInfo GardiajRomDesc[] = { - { "epr-10250.ic90", 0x8000, 0xc97943a7, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-10251.ic91", 0x8000, 0xb2ed05dc, BRF_ESS | BRF_PRG }, // 1 - { "epr-10252.ic92", 0x8000, 0x0a490588, BRF_ESS | BRF_PRG }, // 2 - - { "epr-10243.ic126", 0x4000, 0x87220660, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-10240.ic4", 0x8000, 0x998ce090, BRF_GRA }, // 4 Tiles - { "epr-10241.ic5", 0x8000, 0x81ab0b07, BRF_GRA }, // 5 - { "epr-10242.ic6", 0x8000, 0x2dc4c4c7, BRF_GRA }, // 6 - - { "epr-10234.ic87", 0x8000, 0x8a6aed33, BRF_GRA }, // 7 Sprites - { "epr-10233.ic86", 0x8000, 0xc52784d3, BRF_GRA }, // 8 - { "epr-10236.ic89", 0x8000, 0xb35ab227, BRF_GRA }, // 9 - { "epr-10235.ic88", 0x8000, 0x006a3151, BRF_GRA }, // 10 - - { "pr-7345.ic20", 0x0100, 0x8eee0f72, BRF_GRA }, // 11 Palette - { "pr-7344.ic14", 0x0100, 0x3e7babd7, BRF_GRA }, // 12 - { "pr-7343.ic8", 0x0100, 0x371c44a6, BRF_GRA }, // 13 - { "pr5317.ic28", 0x0100, 0x648350b8, BRF_OPT }, // 14 Timing proms -}; - -STD_ROM_PICK(Gardiaj) -STD_ROM_FN(Gardiaj) - -static struct BurnRomInfo HvymetalRomDesc[] = { - { "epra6790.1", 0x008000, 0x59195bb9, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epra6789.2", 0x008000, 0x83e1d18a, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epra6788.3", 0x008000, 0x6ecefd57, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr6787.120", 0x008000, 0xb64ac7f0, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr6795.62", 0x004000, 0x58a3d038, BRF_GRA }, // 4 Tiles - { "epr6796.61", 0x004000, 0xd8b08a55, BRF_GRA }, // 5 Tiles - { "epr6793.64", 0x004000, 0x487407c2, BRF_GRA }, // 6 Tiles - { "epr6794.63", 0x004000, 0x89eb3793, BRF_GRA }, // 7 Tiles - { "epr6791.66", 0x004000, 0xa7dcd042, BRF_GRA }, // 8 Tiles - { "epr6792.65", 0x004000, 0xd0be5e33, BRF_GRA }, // 9 Tiles - - { "epr6778.117", 0x008000, 0x0af61aee, BRF_GRA }, // 10 Sprites - { "epr6777.110", 0x008000, 0x91d7a197, BRF_GRA }, // 11 Sprites - { "epr6780.4", 0x008000, 0x55b31df5, BRF_GRA }, // 12 Sprites - { "epr6779.5", 0x008000, 0xe03a2b28, BRF_GRA }, // 13 Sprites - - { "pr7036.3", 0x000100, 0x146f16fb, BRF_GRA }, // 14 Red PROM - { "pr7035.2", 0x000100, 0x50b201ed, BRF_GRA }, // 15 Green PROM - { "pr7034.1", 0x000100, 0xdfb5f139, BRF_GRA }, // 16 Blue PROM - - { "pr5317p.4", 0x000100, 0x648350b8, BRF_OPT }, // 17 Timing PROM -}; - -STD_ROM_PICK(Hvymetal) -STD_ROM_FN(Hvymetal) - -static struct BurnRomInfo ImsorryRomDesc[] = { - { "epr-6676.116", 0x004000, 0xeb087d7f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6677.109", 0x004000, 0xbd244bee, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6678.96", 0x004000, 0x2e16b9fd, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6656.120", 0x002000, 0x25e3d685, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6684.62", 0x002000, 0x2c8df377, BRF_GRA }, // 4 Tiles - { "epr-6683.61", 0x002000, 0x89431c48, BRF_GRA }, // 5 Tiles - { "epr-6682.64", 0x002000, 0x256a9246, BRF_GRA }, // 6 Tiles - { "epr-6681.63", 0x002000, 0x6974d189, BRF_GRA }, // 7 Tiles - { "epr-6680.66", 0x002000, 0x10a629d6, BRF_GRA }, // 8 Tiles - { "epr-6674.65", 0x002000, 0x143d883c, BRF_GRA }, // 9 Tiles - - { "epr-6645.117", 0x004000, 0x1ba167ee, BRF_GRA }, // 10 Sprites - { "epr-6646.04", 0x004000, 0xedda7ad6, BRF_GRA }, // 11 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 12 Timing PROM -}; - -STD_ROM_PICK(Imsorry) -STD_ROM_FN(Imsorry) - -static struct BurnRomInfo ImsorryjRomDesc[] = { - { "epr-6647.116", 0x004000, 0xcc5d915d, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6648.109", 0x004000, 0x37574d60, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6649.96", 0x004000, 0x5f59bdee, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6656.120", 0x002000, 0x25e3d685, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6655.62", 0x002000, 0xbe1f762f, BRF_GRA }, // 4 Tiles - { "epr-6654.61", 0x002000, 0xed5f7fc8, BRF_GRA }, // 5 Tiles - { "epr-6653.64", 0x002000, 0x8b4845a7, BRF_GRA }, // 6 Tiles - { "epr-6652.63", 0x002000, 0x001d68cb, BRF_GRA }, // 7 Tiles - { "epr-6651.66", 0x002000, 0x4ee9b5e6, BRF_GRA }, // 8 Tiles - { "epr-6650.65", 0x002000, 0x3fca4414, BRF_GRA }, // 9 Tiles - - { "epr-6645.117", 0x004000, 0x1ba167ee, BRF_GRA }, // 10 Sprites - { "epr-6646.04", 0x004000, 0xedda7ad6, BRF_GRA }, // 11 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 12 Timing PROM -}; - -STD_ROM_PICK(Imsorryj) -STD_ROM_FN(Imsorryj) - -static struct BurnRomInfo MrvikingRomDesc[] = { - { "epr-5873.129", 0x002000, 0x14d21624, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-5874.130", 0x002000, 0x6df7de87, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-5875.131", 0x002000, 0xac226100, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5876.132", 0x002000, 0xe77db1dc, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-5755.133", 0x002000, 0xedd62ae1, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-5756.134", 0x002000, 0x11974040, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5763.3", 0x002000, 0xd712280d, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5762.82", 0x002000, 0x4a91d08a, BRF_GRA }, // 7 Tiles - { "epr-5761.65", 0x002000, 0xf7d61b65, BRF_GRA }, // 8 Tiles - { "epr-5760.81", 0x002000, 0x95045820, BRF_GRA }, // 9 Tiles - { "epr-5759.64", 0x002000, 0x5f9bae4e, BRF_GRA }, // 10 Tiles - { "epr-5758.80", 0x002000, 0x808ee706, BRF_GRA }, // 11 Tiles - { "epr-5757.63", 0x002000, 0x480f7074, BRF_GRA }, // 12 Tiles - - { "epr-5749.86", 0x004000, 0xe24682cd, BRF_GRA }, // 13 Sprites - { "epr-5750.93", 0x004000, 0x6564d1ad, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Mrviking) -STD_ROM_FN(Mrviking) - -static struct BurnRomInfo MrvikingjRomDesc[] = { - { "epr-5751.129", 0x002000, 0xae97a4c5, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-5752.130", 0x002000, 0xd48e6726, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-5753.131", 0x002000, 0x28c60887, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5754.132", 0x002000, 0x1f47ed02, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-5755.133", 0x002000, 0xedd62ae1, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-5756.134", 0x002000, 0x11974040, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5763.3", 0x002000, 0xd712280d, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5762.82", 0x002000, 0x4a91d08a, BRF_GRA }, // 7 Tiles - { "epr-5761.65", 0x002000, 0xf7d61b65, BRF_GRA }, // 8 Tiles - { "epr-5760.81", 0x002000, 0x95045820, BRF_GRA }, // 9 Tiles - { "epr-5759.64", 0x002000, 0x5f9bae4e, BRF_GRA }, // 10 Tiles - { "epr-5758.80", 0x002000, 0x808ee706, BRF_GRA }, // 11 Tiles - { "epr-5757.63", 0x002000, 0x480f7074, BRF_GRA }, // 12 Tiles - - { "epr-5749.86", 0x004000, 0xe24682cd, BRF_GRA }, // 13 Sprites - { "epr-5750.93", 0x004000, 0x6564d1ad, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Mrvikingj) -STD_ROM_FN(Mrvikingj) - -static struct BurnRomInfo MyheroRomDesc[] = { - { "epr6963b.116", 0x004000, 0x4daf89d4, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr6964a.109", 0x004000, 0xc26188e5, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6927.96", 0x004000, 0x3cbbaf64, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-69xx.120", 0x002000, 0x0039e1e9, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6966.62", 0x002000, 0x157f0401, BRF_GRA }, // 4 Tiles - { "epr-6961.61", 0x002000, 0xbe53ce47, BRF_GRA }, // 5 Tiles - { "epr-6960.64", 0x002000, 0xbd381baa, BRF_GRA }, // 6 Tiles - { "epr-6959.63", 0x002000, 0xbc04e79a, BRF_GRA }, // 7 Tiles - { "epr-6958.66", 0x002000, 0x714f2c26, BRF_GRA }, // 8 Tiles - { "epr-6957.65", 0x002000, 0x80920112, BRF_GRA }, // 9 Tiles - - { "epr-6921.117", 0x004000, 0xf19e05a1, BRF_GRA }, // 10 Sprites - { "epr-6923.04", 0x004000, 0x7988adc3, BRF_GRA }, // 11 Sprites - { "epr-6922.110", 0x004000, 0x37f77a78, BRF_GRA }, // 12 Sprites - { "epr-6924.05", 0x004000, 0x42bdc8f6, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Myhero) -STD_ROM_FN(Myhero) - -static struct BurnRomInfo SscandalRomDesc[] = { - { "epr6925b.116", 0x004000, 0xff54dcec, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr6926a.109", 0x004000, 0x5c41eea8, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6927.96", 0x004000, 0x3cbbaf64, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6934.120", 0x002000, 0xaf467223, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6933.62", 0x002000, 0xe7304036, BRF_GRA }, // 4 Tiles - { "epr-6932.61", 0x002000, 0xf5cfbfda, BRF_GRA }, // 5 Tiles - { "epr-6931.64", 0x002000, 0x599d7f87, BRF_GRA }, // 6 Tiles - { "epr-6930.63", 0x002000, 0xcb6616c2, BRF_GRA }, // 7 Tiles - { "epr-6929.66", 0x002000, 0x27a16856, BRF_GRA }, // 8 Tiles - { "epr-6928.65", 0x002000, 0xc0c9cfa4, BRF_GRA }, // 9 Tiles - - { "epr-6921.117", 0x004000, 0xf19e05a1, BRF_GRA }, // 10 Sprites - { "epr-6923.04", 0x004000, 0x7988adc3, BRF_GRA }, // 11 Sprites - { "epr-6922.110", 0x004000, 0x37f77a78, BRF_GRA }, // 12 Sprites - { "epr-6924.05", 0x004000, 0x42bdc8f6, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Sscandal) -STD_ROM_FN(Sscandal) - -static struct BurnRomInfo MyherokRomDesc[] = { - { "ry-11.rom", 0x004000, 0x6f4c8ee5, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ry-09.rom", 0x004000, 0x369302a1, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "ry-07.rom", 0x004000, 0xb8e9922e, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6934.120", 0x002000, 0xaf467223, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "ry-04.rom", 0x004000, 0xdfb75143, BRF_GRA }, // 4 Tiles - { "ry-03.rom", 0x004000, 0xcf68b4a2, BRF_GRA }, // 5 Tiles - { "ry-02.rom", 0x004000, 0xd100eaef, BRF_GRA }, // 6 Tiles - - { "epr-6921.117", 0x004000, 0xf19e05a1, BRF_GRA }, // 7 Sprites - { "epr-6923.04", 0x004000, 0x7988adc3, BRF_GRA }, // 8 Sprites - { "epr-6922.110", 0x004000, 0x37f77a78, BRF_GRA }, // 9 Sprites - { "epr-6924.05", 0x004000, 0x42bdc8f6, BRF_GRA }, // 10 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 11 Timing PROM -}; - -STD_ROM_PICK(Myherok) -STD_ROM_FN(Myherok) - -static struct BurnRomInfo MyheroblRomDesc[] = { - { "1.f2", 0x004000, 0xc1d354dc, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "2.g2", 0x004000, 0x688c9ede, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "3.h2", 0x004000, 0x3cbbaf64, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "6.E10", 0x002000, 0xaf467223, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "B13.R10", 0x004000, 0x9a4861b1, BRF_GRA }, // 4 Tiles - { "B11.R7", 0x004000, 0x0d6f248a, BRF_GRA }, // 5 Tiles - { "x.R8", 0x004000, 0x24537709, BRF_GRA }, // 6 Tiles - - { "4.f4", 0x004000, 0xf19e05a1, BRF_GRA }, // 7 Sprites - { "x.H4", 0x004000, 0x7988adc3, BRF_GRA }, // 8 Sprites - { "x.G4", 0x004000, 0x37f77a78, BRF_GRA }, // 9 Sprites - { "B7.K4", 0x004000, 0x42bdc8f6, BRF_GRA }, // 10 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 11 Timing PROM - - { "PROM.A2", 0x000200, 0x4fcaf000, BRF_OPT }, // 12 Timing PROMBL -}; - -STD_ROM_PICK(Myherobl) -STD_ROM_FN(Myherobl) - -static struct BurnRomInfo NobRomDesc[] = { - { "dm08.1f", 0x008000, 0x98d602d6, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "dm10.1k", 0x008000, 0xe7c06663, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "dm09.1h", 0x008000, 0xdc4c872f, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "dm03.9h", 0x004000, 0x415adf76, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "dm01.12b", 0x008000, 0x446fbcdd, BRF_GRA }, // 4 Tiles - { "dm02.13b", 0x008000, 0xf12df039, BRF_GRA }, // 5 Tiles - { "dm00.10b", 0x008000, 0x35f396df, BRF_GRA }, // 6 Tiles - - { "dm04.5f", 0x008000, 0x2442b86d, BRF_GRA }, // 7 Sprites - { "dm06.5k", 0x008000, 0xe33743a6, BRF_GRA }, // 8 Sprites - { "dm05.5h", 0x008000, 0x7fbba01d, BRF_GRA }, // 9 Sprites - { "dm07.5l", 0x008000, 0x85e7a29f, BRF_GRA }, // 10 Sprites - - { "nobo_pr.16d", 0x000100, 0x95010ac2, BRF_GRA }, // 11 Red PROM - { "nobo_pr.15d", 0x000100, 0xc55aac0c, BRF_GRA }, // 12 Green PROM - { "dm-12.ic3", 0x000100, 0xde394cee, BRF_GRA }, // 13 Blue PROM - { "dc-11.6a", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM - - { "dm.bin", 0x001000, 0x6fde9dcb, BRF_PRG | BRF_OPT }, // 15 MCU -}; - -STD_ROM_PICK(Nob) -STD_ROM_FN(Nob) - -static struct BurnRomInfo NobbRomDesc[] = { - { "nobo-t.bin", 0x008000, 0x176fd168, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "nobo-r.bin", 0x008000, 0xd61cf3c9, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "nobo-s.bin", 0x008000, 0xb0e7697f, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "nobo-m.bin", 0x004000, 0x415adf76, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "nobo-k.bin", 0x008000, 0x446fbcdd, BRF_GRA }, // 4 Tiles - { "nobo-j.bin", 0x008000, 0xf12df039, BRF_GRA }, // 5 Tiles - { "nobo-l.bin", 0x008000, 0x35f396df, BRF_GRA }, // 6 Tiles - - { "nobo-q.bin", 0x008000, 0x2442b86d, BRF_GRA }, // 7 Sprites - { "nobo-o.bin", 0x008000, 0xe33743a6, BRF_GRA }, // 8 Sprites - { "nobo-p.bin", 0x008000, 0x7fbba01d, BRF_GRA }, // 9 Sprites - { "nobo-n.bin", 0x008000, 0x85e7a29f, BRF_GRA }, // 10 Sprites - - { "nobo_pr.16d", 0x000100, 0x95010ac2, BRF_GRA }, // 11 Red PROM - { "nobo_pr.15d", 0x000100, 0xc55aac0c, BRF_GRA }, // 12 Green PROM - { "nobo_pr.14d", 0x000100, 0xde394cee, BRF_GRA }, // 13 Blue PROM - { "nobo_pr.13a", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Nobb) -STD_ROM_FN(Nobb) - -static struct BurnRomInfo Pitfall2RomDesc[] = { - { "epr6456a.116", 0x004000, 0xbcc8406b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr6457a.109", 0x004000, 0xa016fd2a, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr6458a.96", 0x004000, 0x5c30b3e8, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6462.120", 0x002000, 0x86bb9185, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr6474a.62", 0x002000, 0x9f1711b9, BRF_GRA }, // 4 Tiles - { "epr6473a.61", 0x002000, 0x8e53b8dd, BRF_GRA }, // 5 Tiles - { "epr6472a.64", 0x002000, 0xe0f34a11, BRF_GRA }, // 6 Tiles - { "epr6471a.63", 0x002000, 0xd5bc805c, BRF_GRA }, // 7 Tiles - { "epr6470a.66", 0x002000, 0x1439729f, BRF_GRA }, // 8 Tiles - { "epr6469a.65", 0x002000, 0xe4ac6921, BRF_GRA }, // 9 Tiles - - { "epr6454a.117", 0x004000, 0xa5d96780, BRF_GRA }, // 10 Sprites - { "epr-6455.05", 0x004000, 0x32ee64a1, BRF_GRA }, // 11 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 12 Timing PROM -}; - -STD_ROM_PICK(Pitfall2) -STD_ROM_FN(Pitfall2) - -static struct BurnRomInfo Pitfall2aRomDesc[] = { - { "epr-6505", 0x004000, 0xb6769739, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6506", 0x004000, 0x1ce6aec4, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr6458a.96", 0x004000, 0x5c30b3e8, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6462.120", 0x002000, 0x86bb9185, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr6474a.62", 0x002000, 0x9f1711b9, BRF_GRA }, // 4 Tiles - { "epr6473a.61", 0x002000, 0x8e53b8dd, BRF_GRA }, // 5 Tiles - { "epr6472a.64", 0x002000, 0xe0f34a11, BRF_GRA }, // 6 Tiles - { "epr6471a.63", 0x002000, 0xd5bc805c, BRF_GRA }, // 7 Tiles - { "epr6470a.66", 0x002000, 0x1439729f, BRF_GRA }, // 8 Tiles - { "epr6469a.65", 0x002000, 0xe4ac6921, BRF_GRA }, // 9 Tiles - - { "epr6454a.117", 0x004000, 0xa5d96780, BRF_GRA }, // 10 Sprites - { "epr-6455.05", 0x004000, 0x32ee64a1, BRF_GRA }, // 11 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 12 Timing PROM -}; - -STD_ROM_PICK(Pitfall2a) -STD_ROM_FN(Pitfall2a) - -static struct BurnRomInfo Pitfall2uRomDesc[] = { - { "epr-6623.116", 0x004000, 0xbcb47ed6, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr6624a.109", 0x004000, 0x6e8b09c1, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6625.96", 0x004000, 0xdc5484ba, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6462.120", 0x002000, 0x86bb9185, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr6474a.62", 0x002000, 0x9f1711b9, BRF_GRA }, // 4 Tiles - { "epr6473a.61", 0x002000, 0x8e53b8dd, BRF_GRA }, // 5 Tiles - { "epr6472a.64", 0x002000, 0xe0f34a11, BRF_GRA }, // 6 Tiles - { "epr6471a.63", 0x002000, 0xd5bc805c, BRF_GRA }, // 7 Tiles - { "epr6470a.66", 0x002000, 0x1439729f, BRF_GRA }, // 8 Tiles - { "epr6469a.65", 0x002000, 0xe4ac6921, BRF_GRA }, // 9 Tiles - - { "epr6454a.117", 0x004000, 0xa5d96780, BRF_GRA }, // 10 Sprites - { "epr-6455.05", 0x004000, 0x32ee64a1, BRF_GRA }, // 11 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 12 Timing PROM -}; - -STD_ROM_PICK(Pitfall2u) -STD_ROM_FN(Pitfall2u) - -static struct BurnRomInfo RaflesiaRomDesc[] = { - { "epr-7411.116", 0x004000, 0x88a0c6c6, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7412.109", 0x004000, 0xd3b8cddf, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-7413.96", 0x004000, 0xb7e688b3, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-7420.120", 0x002000, 0x14387666, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-7419.62", 0x002000, 0xbfd5f34c, BRF_GRA }, // 4 Tiles - { "epr-7418.61", 0x002000, 0xf8cbc9b6, BRF_GRA }, // 5 Tiles - { "epr-7417.64", 0x002000, 0xe63501bc, BRF_GRA }, // 6 Tiles - { "epr-7416.63", 0x002000, 0x093e5693, BRF_GRA }, // 7 Tiles - { "epr-7415.66", 0x002000, 0x1a8d6bd6, BRF_GRA }, // 8 Tiles - { "epr-7414.65", 0x002000, 0x5d20f218, BRF_GRA }, // 9 Tiles - - { "epr-7407.117", 0x004000, 0xf09fc057, BRF_GRA }, // 10 Sprites - { "epr-7409.04", 0x004000, 0x819fedb8, BRF_GRA }, // 11 Sprites - { "epr-7408.110", 0x004000, 0x3189f33c, BRF_GRA }, // 12 Sprites - { "epr-7410.05", 0x004000, 0xced74789, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Raflesia) -STD_ROM_FN(Raflesia) - -static struct BurnRomInfo RegulusRomDesc[] = { - { "epr-5640a.129", 0x002000, 0xdafb1528, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-5641a.130", 0x002000, 0x0fcc850e, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-5642a.131", 0x002000, 0x4feffa17, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5643a.132", 0x002000, 0xb8ac7eb4, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-5644.133", 0x002000, 0xffd05b7d, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-5645a.134", 0x002000, 0x6b4bf77c, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5652.3", 0x002000, 0x74edcb98, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5651.82", 0x002000, 0xf07f3e82, BRF_GRA }, // 7 Tiles - { "epr-5650.65", 0x002000, 0x84c1baa2, BRF_GRA }, // 8 Tiles - { "epr-5649.81", 0x002000, 0x6774c895, BRF_GRA }, // 9 Tiles - { "epr-5648.64", 0x002000, 0x0c69e92a, BRF_GRA }, // 10 Tiles - { "epr-5647.80", 0x002000, 0x9330f7b5, BRF_GRA }, // 11 Tiles - { "epr-5646.63", 0x002000, 0x4dfacbbc, BRF_GRA }, // 12 Tiles - - { "epr-5638.86", 0x004000, 0x617363dd, BRF_GRA }, // 13 Sprites - { "epr-5639.93", 0x004000, 0xa4ec5131, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Regulus) -STD_ROM_FN(Regulus) - -static struct BurnRomInfo RegulusoRomDesc[] = { - { "epr-5640.129", 0x002000, 0x8324d0d4, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-5641.130", 0x002000, 0x0a09f5c7, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-5642.131", 0x002000, 0xff27b2f6, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5643.132", 0x002000, 0x0d867df0, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-5644.133", 0x002000, 0xffd05b7d, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-5645.134", 0x002000, 0x57a2b4b4, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5652.3", 0x002000, 0x74edcb98, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5651.82", 0x002000, 0xf07f3e82, BRF_GRA }, // 7 Tiles - { "epr-5650.65", 0x002000, 0x84c1baa2, BRF_GRA }, // 8 Tiles - { "epr-5649.81", 0x002000, 0x6774c895, BRF_GRA }, // 9 Tiles - { "epr-5648.64", 0x002000, 0x0c69e92a, BRF_GRA }, // 10 Tiles - { "epr-5647.80", 0x002000, 0x9330f7b5, BRF_GRA }, // 11 Tiles - { "epr-5646.63", 0x002000, 0x4dfacbbc, BRF_GRA }, // 12 Tiles - - { "epr-5638.86", 0x004000, 0x617363dd, BRF_GRA }, // 13 Sprites - { "epr-5639.93", 0x004000, 0xa4ec5131, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Reguluso) -STD_ROM_FN(Reguluso) - -static struct BurnRomInfo RegulusuRomDesc[] = { - { "epr-5950.129", 0x002000, 0x3b047b67, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-5951.130", 0x002000, 0xd66453ab, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-5952.131", 0x002000, 0xf3d0158a, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5953.132", 0x002000, 0xa9ad4f44, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-5644.133", 0x002000, 0xffd05b7d, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-5955.134", 0x002000, 0x65ddb2a3, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5652.3", 0x002000, 0x74edcb98, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5651.82", 0x002000, 0xf07f3e82, BRF_GRA }, // 7 Tiles - { "epr-5650.65", 0x002000, 0x84c1baa2, BRF_GRA }, // 8 Tiles - { "epr-5649.81", 0x002000, 0x6774c895, BRF_GRA }, // 9 Tiles - { "epr-5648.64", 0x002000, 0x0c69e92a, BRF_GRA }, // 10 Tiles - { "epr-5647.80", 0x002000, 0x9330f7b5, BRF_GRA }, // 11 Tiles - { "epr-5646.63", 0x002000, 0x4dfacbbc, BRF_GRA }, // 12 Tiles - - { "epr-5638.86", 0x004000, 0x617363dd, BRF_GRA }, // 13 Sprites - { "epr-5639.93", 0x004000, 0xa4ec5131, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Regulusu) -STD_ROM_FN(Regulusu) - -static struct BurnRomInfo SeganinjRomDesc[] = { - { "epr-6594a.116", 0x004000, 0xa5d0c9d0, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6595a.109", 0x004000, 0xb9e6775c, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6596a.96", 0x004000, 0xf2eeb0d8, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6559.120", 0x002000, 0x5a1570ee, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6558.62", 0x002000, 0x2af9eaeb, BRF_GRA }, // 4 Tiles - { "epr-6592.61", 0x002000, 0x7804db86, BRF_GRA }, // 5 Tiles - { "epr-6556.64", 0x002000, 0x79fd26f7, BRF_GRA }, // 6 Tiles - { "epr-6590.63", 0x002000, 0xbf858cad, BRF_GRA }, // 7 Tiles - { "epr-6554.66", 0x002000, 0x5ac9d205, BRF_GRA }, // 8 Tiles - { "epr-6588.65", 0x002000, 0xdc931dbb, BRF_GRA }, // 9 Tiles - - { "epr-6546.117", 0x004000, 0xa4785692, BRF_GRA }, // 10 Sprites - { "epr-6548.04", 0x004000, 0xbdf278c1, BRF_GRA }, // 11 Sprites - { "epr-6547.110", 0x004000, 0x34451b08, BRF_GRA }, // 12 Sprites - { "epr-6549a.05", 0x004000, 0x7c51488c, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Seganinj) -STD_ROM_FN(Seganinj) - -static struct BurnRomInfo SeganinjuRomDesc[] = { - { "epr-7149.116", 0x004000, 0xcd9fade7, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7150.109", 0x004000, 0xc36351e2, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-7151.96", 0x004000, 0xf2eeb0d8, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6559.120", 0x002000, 0x5a1570ee, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6558.62", 0x002000, 0x2af9eaeb, BRF_GRA }, // 4 Tiles - { "epr-6592.61", 0x002000, 0x7804db86, BRF_GRA }, // 5 Tiles - { "epr-6556.64", 0x002000, 0x79fd26f7, BRF_GRA }, // 6 Tiles - { "epr-6590.63", 0x002000, 0xbf858cad, BRF_GRA }, // 7 Tiles - { "epr-6554.66", 0x002000, 0x5ac9d205, BRF_GRA }, // 8 Tiles - { "epr-6588.65", 0x002000, 0xdc931dbb, BRF_GRA }, // 9 Tiles - - { "epr-6546.117", 0x004000, 0xa4785692, BRF_GRA }, // 10 Sprites - { "epr-6548.04", 0x004000, 0xbdf278c1, BRF_GRA }, // 11 Sprites - { "epr-6547.110", 0x004000, 0x34451b08, BRF_GRA }, // 12 Sprites - { "epr-6549.05", 0x004000, 0xd2057668, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Seganinju) -STD_ROM_FN(Seganinju) - -static struct BurnRomInfo SeganinjaRomDesc[] = { - { "epr-6879.116", 0x004000, 0xcae7e51f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6880.109", 0x004000, 0x7af85e01, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6881.96", 0x004000, 0xf2eeb0d8, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6559.120", 0x002000, 0x5a1570ee, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6558.62", 0x002000, 0x2af9eaeb, BRF_GRA }, // 4 Tiles - { "epr-6592.61", 0x002000, 0x7804db86, BRF_GRA }, // 5 Tiles - { "epr-6556.64", 0x002000, 0x79fd26f7, BRF_GRA }, // 6 Tiles - { "epr-6590.63", 0x002000, 0xbf858cad, BRF_GRA }, // 7 Tiles - { "epr-6554.66", 0x002000, 0x5ac9d205, BRF_GRA }, // 8 Tiles - { "epr-6588.65", 0x002000, 0xdc931dbb, BRF_GRA }, // 9 Tiles - - { "epr-6546.117", 0x004000, 0xa4785692, BRF_GRA }, // 10 Sprites - { "epr-6548.04", 0x004000, 0xbdf278c1, BRF_GRA }, // 11 Sprites - { "epr-6547.110", 0x004000, 0x34451b08, BRF_GRA }, // 12 Sprites - { "epr-6549.05", 0x004000, 0xd2057668, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Seganinja) -STD_ROM_FN(Seganinja) - -static struct BurnRomInfo NinjaRomDesc[] = { - { "epr6594.bin", 0x004000, 0x3ef0e5fc, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr6595.bin", 0x004000, 0xb16f13cd, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6552.96", 0x004000, 0xf2eeb0d8, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6559.120", 0x002000, 0x5a1570ee, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6558.62", 0x002000, 0x2af9eaeb, BRF_GRA }, // 4 Tiles - { "epr6592.bin", 0x002000, 0x88d0c7a1, BRF_GRA }, // 5 Tiles - { "epr-6556.64", 0x002000, 0x79fd26f7, BRF_GRA }, // 6 Tiles - { "epr6590.bin", 0x002000, 0x956e3b61, BRF_GRA }, // 7 Tiles - { "epr-6554.66", 0x002000, 0x5ac9d205, BRF_GRA }, // 8 Tiles - { "epr6588.bin", 0x002000, 0x023a14a3, BRF_GRA }, // 9 Tiles - - { "epr-6546.117", 0x004000, 0xa4785692, BRF_GRA }, // 10 Sprites - { "epr-6548.04", 0x004000, 0xbdf278c1, BRF_GRA }, // 11 Sprites - { "epr-6547.110", 0x004000, 0x34451b08, BRF_GRA }, // 12 Sprites - { "epr-6549.05", 0x004000, 0xd2057668, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Ninja) -STD_ROM_FN(Ninja) - -static struct BurnRomInfo NprincesRomDesc[] = { - { "epr-6612.129", 0x002000, 0x1b30976f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6613.130", 0x002000, 0x18281f27, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6614.131", 0x002000, 0x69fc3d73, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-6615.132", 0x002000, 0x1d0374c8, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-6616.133", 0x002000, 0x73616e03, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-6617.134", 0x002000, 0x20b6f895, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-6559.120", 0x002000, 0x5a1570ee, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-6558.62", 0x002000, 0x2af9eaeb, BRF_GRA }, // 7 Tiles - { "epr-6557.61", 0x002000, 0x6eb131d0, BRF_GRA }, // 8 Tiles - { "epr-6556.64", 0x002000, 0x79fd26f7, BRF_GRA }, // 9 Tiles - { "epr-6555.63", 0x002000, 0x7f669aac, BRF_GRA }, // 10 Tiles - { "epr-6554.66", 0x002000, 0x5ac9d205, BRF_GRA }, // 11 Tiles - { "epr-6553.65", 0x002000, 0xeb82a8fe, BRF_GRA }, // 12 Tiles - - { "epr-6546.117", 0x004000, 0xa4785692, BRF_GRA }, // 13 Sprites - { "epr-6548.04", 0x004000, 0xbdf278c1, BRF_GRA }, // 14 Sprites - { "epr-6547.110", 0x004000, 0x34451b08, BRF_GRA }, // 15 Sprites - { "epr-6549.05", 0x004000, 0xd2057668, BRF_GRA }, // 16 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 17 Timing PROM -}; - -STD_ROM_PICK(Nprinces) -STD_ROM_FN(Nprinces) - -static struct BurnRomInfo NprincesoRomDesc[] = { - { "epr-6550.116", 0x004000, 0x5f6d59f1, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6551.109", 0x004000, 0x1af133b2, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6552.96", 0x004000, 0xf2eeb0d8, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6559.120", 0x002000, 0x5a1570ee, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6558.62", 0x002000, 0x2af9eaeb, BRF_GRA }, // 4 Tiles - { "epr-6557.61", 0x002000, 0x6eb131d0, BRF_GRA }, // 5 Tiles - { "epr-6556.64", 0x002000, 0x79fd26f7, BRF_GRA }, // 6 Tiles - { "epr-6555.63", 0x002000, 0x7f669aac, BRF_GRA }, // 7 Tiles - { "epr-6554.66", 0x002000, 0x5ac9d205, BRF_GRA }, // 8 Tiles - { "epr-6553.65", 0x002000, 0xeb82a8fe, BRF_GRA }, // 9 Tiles - - { "epr-6546.117", 0x004000, 0xa4785692, BRF_GRA }, // 10 Sprites - { "epr-6548.04", 0x004000, 0xbdf278c1, BRF_GRA }, // 11 Sprites - { "epr-6547.110", 0x004000, 0x34451b08, BRF_GRA }, // 12 Sprites - { "epr-6549.05", 0x004000, 0xd2057668, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Nprinceso) -STD_ROM_FN(Nprinceso) - -static struct BurnRomInfo NprincesuRomDesc[] = { - { "epr-6573.129", 0x002000, 0xd2919c7d, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6574.130", 0x002000, 0x5a132833, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6575.131", 0x002000, 0xa94b0bd4, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-6576.132", 0x002000, 0x27d3bbdb, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-6577.133", 0x002000, 0x73616e03, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-6578.134", 0x002000, 0xab68499f, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-6559.120", 0x002000, 0x5a1570ee, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-6558.62", 0x002000, 0x2af9eaeb, BRF_GRA }, // 7 Tiles - { "epr-6557.61", 0x002000, 0x6eb131d0, BRF_GRA }, // 8 Tiles - { "epr-6556.64", 0x002000, 0x79fd26f7, BRF_GRA }, // 9 Tiles - { "epr-6555.63", 0x002000, 0x7f669aac, BRF_GRA }, // 10 Tiles - { "epr-6554.66", 0x002000, 0x5ac9d205, BRF_GRA }, // 11 Tiles - { "epr-6553.65", 0x002000, 0xeb82a8fe, BRF_GRA }, // 12 Tiles - - { "epr-6546.117", 0x004000, 0xa4785692, BRF_GRA }, // 13 Sprites - { "epr-6548.04", 0x004000, 0xbdf278c1, BRF_GRA }, // 14 Sprites - { "epr-6547.110", 0x004000, 0x34451b08, BRF_GRA }, // 15 Sprites - { "epr-6549.05", 0x004000, 0xd2057668, BRF_GRA }, // 16 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 17 Timing PROM -}; - -STD_ROM_PICK(Nprincesu) -STD_ROM_FN(Nprincesu) - -static struct BurnRomInfo NprincesbRomDesc[] = { - { "nprinces.001", 0x004000, 0xe0de073c, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "nprinces.002", 0x004000, 0x27219c7f, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6552.96", 0x004000, 0xf2eeb0d8, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6559.120", 0x002000, 0x5a1570ee, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6558.62", 0x002000, 0x2af9eaeb, BRF_GRA }, // 4 Tiles - { "epr-6557.61", 0x002000, 0x6eb131d0, BRF_GRA }, // 5 Tiles - { "epr-6556.64", 0x002000, 0x79fd26f7, BRF_GRA }, // 6 Tiles - { "epr-6555.63", 0x002000, 0x7f669aac, BRF_GRA }, // 7 Tiles - { "epr-6554.66", 0x002000, 0x5ac9d205, BRF_GRA }, // 8 Tiles - { "epr-6553.65", 0x002000, 0xeb82a8fe, BRF_GRA }, // 9 Tiles - - { "epr-6546.117", 0x004000, 0xa4785692, BRF_GRA }, // 10 Sprites - { "epr-6548.04", 0x004000, 0xbdf278c1, BRF_GRA }, // 11 Sprites - { "epr-6547.110", 0x004000, 0x34451b08, BRF_GRA }, // 12 Sprites - { "epr-6549.05", 0x004000, 0xd2057668, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM - { "nprinces.129", 0x000100, 0xae765f62, BRF_PRG }, // 15 Decryption Table - { "nprinces.123", 0x000020, 0xed5146e9, BRF_PRG }, // 15 Decryption Table -}; - -STD_ROM_PICK(Nprincesb) -STD_ROM_FN(Nprincesb) - -static struct BurnRomInfo SpatterRomDesc[] = { - { "epr-6392.116", 0x004000, 0x329b4506, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6393.109", 0x004000, 0x3b56e25f, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6394.96", 0x004000, 0x647c1301, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6316.120", 0x002000, 0x1df95511, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6328.62", 0x002000, 0xa2bf2832, BRF_GRA }, // 4 Tiles - { "epr-6397.61", 0x002000, 0xc60d4471, BRF_GRA }, // 5 Tiles - { "epr-6326.64", 0x002000, 0x269fbb4c, BRF_GRA }, // 6 Tiles - { "epr-6396.63", 0x002000, 0xc15ccf3b, BRF_GRA }, // 7 Tiles - { "epr-6324.66", 0x002000, 0x8ab3b563, BRF_GRA }, // 8 Tiles - { "epr-6395.65", 0x002000, 0x3f083065, BRF_GRA }, // 9 Tiles - - { "epr-6306.04", 0x004000, 0xe871e132, BRF_GRA }, // 10 Sprites - { "epr-6308.117", 0x004000, 0x99c2d90e, BRF_GRA }, // 11 Sprites - { "epr-6307.05", 0x004000, 0x0a5ad543, BRF_GRA }, // 12 Sprites - { "epr-6309.110", 0x004000, 0x7423ad98, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Spatter) -STD_ROM_FN(Spatter) - -static struct BurnRomInfo SsanchanRomDesc[] = { - { "epr-6310.116", 0x004000, 0x26b43701, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6311.109", 0x004000, 0xcb2bc620, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6312.96", 0x004000, 0x71b15b47, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6316.120", 0x002000, 0x1df95511, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6328.62", 0x002000, 0xa2bf2832, BRF_GRA }, // 4 Tiles - { "epr-6327.61", 0x002000, 0x53298109, BRF_GRA }, // 5 Tiles - { "epr-6326.64", 0x002000, 0x269fbb4c, BRF_GRA }, // 6 Tiles - { "epr-6325.63", 0x002000, 0xbf038745, BRF_GRA }, // 7 Tiles - { "epr-6324.66", 0x002000, 0x8ab3b563, BRF_GRA }, // 8 Tiles - { "epr-6323.65", 0x002000, 0x0394673c, BRF_GRA }, // 9 Tiles - - { "epr-6306.04", 0x004000, 0xe871e132, BRF_GRA }, // 10 Sprites - { "epr-6308.117", 0x004000, 0x99c2d90e, BRF_GRA }, // 11 Sprites - { "epr-6307.05", 0x004000, 0x0a5ad543, BRF_GRA }, // 12 Sprites - { "epr-6309.110", 0x004000, 0x7423ad98, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Ssanchan) -STD_ROM_FN(Ssanchan) - -static struct BurnRomInfo StarjackRomDesc[] = { - { "epr5320b.129", 0x002000, 0x7ab72ecd, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr5321a.130", 0x002000, 0x38b99050, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr5322a.131", 0x002000, 0x103a595b, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5323.132", 0x002000, 0x46af0d58, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-5324.133", 0x002000, 0x1e89efe2, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-5325.134", 0x002000, 0xd6e379a1, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5332.3", 0x002000, 0x7a72ab3d, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5331.82", 0x002000, 0x251d898f, BRF_GRA }, // 7 Tiles - { "epr-5330.65", 0x002000, 0xeb048745, BRF_GRA }, // 8 Tiles - { "epr-5329.81", 0x002000, 0x3e8bcaed, BRF_GRA }, // 9 Tiles - { "epr-5328.64", 0x002000, 0x9ed7849f, BRF_GRA }, // 10 Tiles - { "epr-5327.80", 0x002000, 0x79e92cb1, BRF_GRA }, // 11 Tiles - { "epr-5326.63", 0x002000, 0xba7e2b47, BRF_GRA }, // 12 Tiles - - { "epr-5318.86", 0x004000, 0x6f2e1fd3, BRF_GRA }, // 13 Sprites - { "epr-5319.93", 0x004000, 0xebee4999, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Starjack) -STD_ROM_FN(Starjack) - -static struct BurnRomInfo StarjacksRomDesc[] = { - { "a1_ic29.129", 0x002000, 0x59a22a1f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a1_ic30.130", 0x002000, 0x7f4597dc, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "a1_ic31.131", 0x002000, 0x6074c046, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "a1_ic32.132", 0x002000, 0x1c48a3fa, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "a1_ic33.133", 0x002000, 0x7598bd51, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "a1_ic34.134", 0x002000, 0xf66fa604, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5332.3", 0x002000, 0x7a72ab3d, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5331.82", 0x002000, 0x251d898f, BRF_GRA }, // 7 Tiles - { "a1_ic65.65", 0x002000, 0x0ab1893c, BRF_GRA }, // 8 Tiles - { "epr-5329.81", 0x002000, 0x3e8bcaed, BRF_GRA }, // 9 Tiles - { "a1_ic64.64", 0x002000, 0x7f628ae6, BRF_GRA }, // 10 Tiles - { "epr-5327.80", 0x002000, 0x79e92cb1, BRF_GRA }, // 11 Tiles - { "a1_ic63.63", 0x002000, 0x5bcb253e, BRF_GRA }, // 12 Tiles - - { "a1_ic86.86", 0x004000, 0x6f2e1fd3, BRF_GRA }, // 13 Sprites - { "a1_ic93.93", 0x004000, 0x07987244, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Starjacks) -STD_ROM_FN(Starjacks) - -static struct BurnRomInfo SwatRomDesc[] = { - { "epr5807b.129", 0x002000, 0x93db9c9f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-5808.130", 0x002000, 0x67116665, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-5809.131", 0x002000, 0xfd792fc9, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5810.132", 0x002000, 0xdc2b279d, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-5811.133", 0x002000, 0x093e3ab1, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-5812.134", 0x002000, 0x5bfd692f, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5819.3", 0x002000, 0xf6afd0fd, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5818.82", 0x002000, 0xb22033d9, BRF_GRA }, // 7 Tiles - { "epr-5817.65", 0x002000, 0xfd942797, BRF_GRA }, // 8 Tiles - { "epr-5816.81", 0x002000, 0x4384376d, BRF_GRA }, // 9 Tiles - { "epr-5815.64", 0x002000, 0x16ad046c, BRF_GRA }, // 10 Tiles - { "epr-5814.80", 0x002000, 0xbe721c99, BRF_GRA }, // 11 Tiles - { "epr-5813.63", 0x002000, 0x0d42c27e, BRF_GRA }, // 12 Tiles - - { "epr-5805.86", 0x004000, 0x5a732865, BRF_GRA }, // 13 Sprites - { "epr-5806.93", 0x004000, 0x26ac258c, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Swat) -STD_ROM_FN(Swat) - -static struct BurnRomInfo TeddybbRomDesc[] = { - { "epr-6768.116", 0x004000, 0x5939817e, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6769.109", 0x004000, 0x14a98ddd, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6770.96", 0x004000, 0x67b0c7c2, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr6748x.120", 0x002000, 0xc2a1b89d, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6747.62", 0x002000, 0xa0e5aca7, BRF_GRA }, // 4 Tiles - { "epr-6746.61", 0x002000, 0xcdb77e51, BRF_GRA }, // 5 Tiles - { "epr-6745.64", 0x002000, 0x0cab75c3, BRF_GRA }, // 6 Tiles - { "epr-6744.63", 0x002000, 0x0ef8d2cd, BRF_GRA }, // 7 Tiles - { "epr-6743.66", 0x002000, 0xc33062b5, BRF_GRA }, // 8 Tiles - { "epr-6742.65", 0x002000, 0xc457e8c5, BRF_GRA }, // 9 Tiles - - { "epr-6735.117", 0x004000, 0x1be35a97, BRF_GRA }, // 10 Sprites - { "epr-6737.04", 0x004000, 0x6b53aa7a, BRF_GRA }, // 11 Sprites - { "epr-6736.110", 0x004000, 0x565c25d0, BRF_GRA }, // 12 Sprites - { "epr-6738.05", 0x004000, 0xe116285f, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Teddybb) -STD_ROM_FN(Teddybb) - -static struct BurnRomInfo TeddybboRomDesc[] = { - { "epr-6739.116", 0x004000, 0x81a37e69, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-6740.109", 0x004000, 0x715388a9, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-6741.96", 0x004000, 0xe5a74f5f, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-6748.120", 0x002000, 0x9325a1cf, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-6747.62", 0x002000, 0xa0e5aca7, BRF_GRA }, // 4 Tiles - { "epr-6746.61", 0x002000, 0xcdb77e51, BRF_GRA }, // 5 Tiles - { "epr-6745.64", 0x002000, 0x0cab75c3, BRF_GRA }, // 6 Tiles - { "epr-6744.63", 0x002000, 0x0ef8d2cd, BRF_GRA }, // 7 Tiles - { "epr-6743.66", 0x002000, 0xc33062b5, BRF_GRA }, // 8 Tiles - { "epr-6742.65", 0x002000, 0xc457e8c5, BRF_GRA }, // 9 Tiles - - { "epr-6735.117", 0x004000, 0x1be35a97, BRF_GRA }, // 10 Sprites - { "epr-6737.04", 0x004000, 0x6b53aa7a, BRF_GRA }, // 11 Sprites - { "epr-6736.110", 0x004000, 0x565c25d0, BRF_GRA }, // 12 Sprites - { "epr-6738.05", 0x004000, 0xe116285f, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Teddybbo) -STD_ROM_FN(Teddybbo) - -static struct BurnRomInfo TeddybboblRomDesc[] = { - { "1.f2", 0x004000, 0x81a37e69, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "2.j2", 0x004000, 0x715388a9, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "3.k2", 0x004000, 0xe5a74f5f, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - -// No sound rom present on the PCB - Instead use epr-6748.120 from Teddybbo set // - { "6.e10", 0x002000, 0x9325a1cf, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "11.r7", 0x004000, 0x55d7aaf7, BRF_GRA }, // 4 Tiles - { "10.r8", 0x004000, 0x52a5083d, BRF_GRA }, // 5 Tiles - { "9.r10", 0x004000, 0x8076d3a3, BRF_GRA }, // 6 Tiles - - { "4.f3", 0x004000, 0x1be35a97, BRF_GRA }, // 7 Sprites - { "6.k3", 0x004000, 0x6b53aa7a, BRF_GRA }, // 8 Sprites - { "5.h3", 0x004000, 0x565c25d0, BRF_GRA }, // 9 Sprites - { "7.m3", 0x004000, 0xe116285f, BRF_GRA }, // 10 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM - - { "74s287.bin", 0x000100, 0xde9af32c, BRF_OPT }, // 15 -}; - -STD_ROM_PICK(Teddybbobl) -STD_ROM_FN(Teddybbobl) - -static struct BurnRomInfo tokisensRomDesc[] = { - { "epr10961.90", 0x8000, 0x1466b61d, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr10962.91", 0x8000, 0xa8479f91, BRF_ESS | BRF_PRG }, // 1 - { "epr10963.92", 0x8000, 0xb7193b39, BRF_ESS | BRF_PRG }, // 2 - - { "epr10967.126", 0x8000, 0x97966bf2, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr10964.4", 0x8000, 0x9013b85c, BRF_GRA }, // 4 Tiles - { "epr10965.5", 0x8000, 0xe4755cc6, BRF_GRA }, // 5 - { "epr10966.6", 0x8000, 0x5bbfbdcc, BRF_GRA }, // 6 - - { "epr10958.87", 0x8000, 0xfc2bcbd7, BRF_GRA }, // 7 Sprites - { "epr10957.86", 0x8000, 0x4ec56860, BRF_GRA }, // 8 - { "epr10960.89", 0x8000, 0x880e0d44, BRF_GRA }, // 9 - { "epr10959.88", 0x8000, 0x4deda48f, BRF_GRA }, // 10 - - { "bprom.20", 0x0100, 0x8eee0f72, BRF_GRA }, // 11 Palette - { "bprom.14", 0x0100, 0x3e7babd7, BRF_GRA }, // 12 - { "bprom.8", 0x0100, 0x371c44a6, BRF_GRA }, // 13 - - { "bprom.28", 0x0100, 0x648350b8, BRF_GRA }, // 14 Timing PROM -}; - -STD_ROM_PICK(tokisens) -STD_ROM_FN(tokisens) - -static struct BurnRomInfo ufosensiRomDesc[] = { - { "epr11661.90", 0x8000, 0xf3e394e2, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr11662.91", 0x8000, 0x0c2e4120, BRF_ESS | BRF_PRG }, // 1 - { "epr11663.92", 0x8000, 0x4515ebae, BRF_ESS | BRF_PRG }, // 2 - - { "epr11667.126", 0x8000, 0x110baba9, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr11664.4", 0x8000, 0x1b1bc3d5, BRF_GRA }, // 4 Tiles - { "epr11665.5", 0x8000, 0x3659174a, BRF_GRA }, // 5 - { "epr11666.6", 0x8000, 0x99dcc793, BRF_GRA }, // 6 - - { "epr11658.87", 0x8000, 0x3b5a20f7, BRF_GRA }, // 7 Sprites - { "epr11657.86", 0x8000, 0x010f81a9, BRF_GRA }, // 8 - { "epr11660.89", 0x8000, 0xe1e2e7c5, BRF_GRA }, // 9 - { "epr11659.88", 0x8000, 0x286c7286, BRF_GRA }, // 10 - - { "pr11656.20", 0x0100, 0x640740eb, BRF_GRA }, // 11 Palette - { "pr11655.14", 0x0100, 0xa0c3fa77, BRF_GRA }, // 12 - { "pr11654.8", 0x0100, 0xba624305, BRF_GRA }, // 13 - - { "pr5317.28", 0x0100, 0x648350b8, BRF_GRA }, // 14 Timing PROM - - { "317-0064.key", 0x2000, 0xda326f36, BRF_ESS }, // 15 Encryption Key -}; - -STD_ROM_PICK(ufosensi) -STD_ROM_FN(ufosensi) - -static struct BurnRomInfo UpndownRomDesc[] = { - { "epr5516a.129", 0x002000, 0x038c82da, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr5517a.130", 0x002000, 0x6930e1de, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-5518.131", 0x002000, 0x2a370c99, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5519.132", 0x002000, 0x9d664a58, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-5520.133", 0x002000, 0x208dfbdf, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-5521.134", 0x002000, 0xe7b8d87a, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5535.3", 0x002000, 0xcf4e4c45, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5527.82", 0x002000, 0xb2d616f1, BRF_GRA }, // 7 Tiles - { "epr-5526.65", 0x002000, 0x8a8b33c2, BRF_GRA }, // 8 Tiles - { "epr-5525.81", 0x002000, 0xe749c5ef, BRF_GRA }, // 9 Tiles - { "epr-5524.64", 0x002000, 0x8b886952, BRF_GRA }, // 10 Tiles - { "epr-5523.80", 0x002000, 0xdede35d9, BRF_GRA }, // 11 Tiles - { "epr-5522.63", 0x002000, 0x5e6d9dff, BRF_GRA }, // 12 Tiles - - { "epr-5514.86", 0x004000, 0xfcc0a88b, BRF_GRA }, // 13 Sprites - { "epr-5515.93", 0x004000, 0x60908838, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Upndown) -STD_ROM_FN(Upndown) - -static struct BurnRomInfo UpndownuRomDesc[] = { - { "epr-5679.129", 0x002000, 0xc4f2f9c2, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-5680.130", 0x002000, 0x837f021c, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-5681.131", 0x002000, 0xe1c7ff7e, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-5682.132", 0x002000, 0x4a5edc1e, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-5520.133", 0x002000, 0x208dfbdf, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-5684.133", 0x002000, 0x32fa95da, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-5528.3", 0x002000, 0x00cd44ab, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-5527.82", 0x002000, 0xb2d616f1, BRF_GRA }, // 7 Tiles - { "epr-5526.65", 0x002000, 0x8a8b33c2, BRF_GRA }, // 8 Tiles - { "epr-5525.81", 0x002000, 0xe749c5ef, BRF_GRA }, // 9 Tiles - { "epr-5524.64", 0x002000, 0x8b886952, BRF_GRA }, // 10 Tiles - { "epr-5523.80", 0x002000, 0xdede35d9, BRF_GRA }, // 11 Tiles - { "epr-5522.63", 0x002000, 0x5e6d9dff, BRF_GRA }, // 12 Tiles - - { "epr-5514.86", 0x004000, 0xfcc0a88b, BRF_GRA }, // 13 Sprites - { "epr-5515.93", 0x004000, 0x60908838, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Upndownu) -STD_ROM_FN(Upndownu) - -static struct BurnRomInfo WboyRomDesc[] = { - { "epr-7489.116", 0x004000, 0x130f4b70, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7490.109", 0x004000, 0x9e656733, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-7491.96", 0x004000, 0x1f7d0efe, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-7498.120", 0x002000, 0x78ae1e7b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-7497.62", 0x002000, 0x08d609ca, BRF_GRA }, // 4 Tiles - { "epr-7496.61", 0x002000, 0x6f61fdf1, BRF_GRA }, // 5 Tiles - { "epr-7495.64", 0x002000, 0x6a0d2c2d, BRF_GRA }, // 6 Tiles - { "epr-7494.63", 0x002000, 0xa8e281c7, BRF_GRA }, // 7 Tiles - { "epr-7493.66", 0x002000, 0x89305df4, BRF_GRA }, // 8 Tiles - { "epr-7492.65", 0x002000, 0x60f806b1, BRF_GRA }, // 9 Tiles - - { "epr-7485.117", 0x004000, 0xc2891722, BRF_GRA }, // 10 Sprites - { "epr-7487.04", 0x004000, 0x2d3a421b, BRF_GRA }, // 11 Sprites - { "epr-7486.110", 0x004000, 0x8d622c50, BRF_GRA }, // 12 Sprites - { "epr-7488.05", 0x004000, 0x007c2f1b, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Wboy) -STD_ROM_FN(Wboy) - -static struct BurnRomInfo WboyoRomDesc[] = { - { "epr-7532.116", 0x004000, 0x51d27534, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7533.109", 0x004000, 0xe29d1cd1, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-7534.96", 0x004000, 0x1f7d0efe, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-7498.120", 0x002000, 0x78ae1e7b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-7497.62", 0x002000, 0x08d609ca, BRF_GRA }, // 4 Tiles - { "epr-7496.61", 0x002000, 0x6f61fdf1, BRF_GRA }, // 5 Tiles - { "epr-7495.64", 0x002000, 0x6a0d2c2d, BRF_GRA }, // 6 Tiles - { "epr-7494.63", 0x002000, 0xa8e281c7, BRF_GRA }, // 7 Tiles - { "epr-7493.66", 0x002000, 0x89305df4, BRF_GRA }, // 8 Tiles - { "epr-7492.65", 0x002000, 0x60f806b1, BRF_GRA }, // 9 Tiles - - { "epr-7485.117", 0x004000, 0xc2891722, BRF_GRA }, // 10 Sprites - { "epr-7487.04", 0x004000, 0x2d3a421b, BRF_GRA }, // 11 Sprites - { "epr-7486.110", 0x004000, 0x8d622c50, BRF_GRA }, // 12 Sprites - { "epr-7488.05", 0x004000, 0x007c2f1b, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Wboyo) -STD_ROM_FN(Wboyo) - -static struct BurnRomInfo Wboy2RomDesc[] = { - { "epr-7587.129", 0x002000, 0x1bbb7354, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7588.130", 0x002000, 0x21007413, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-7589.131", 0x002000, 0x44b30433, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "epr-7590.132", 0x002000, 0xbb525a0b, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-7591.133", 0x002000, 0x8379aa23, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-7592.134", 0x002000, 0xc767a5d7, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr-7498.120", 0x002000, 0x78ae1e7b, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-7497.62", 0x002000, 0x08d609ca, BRF_GRA }, // 7 Tiles - { "epr-7496.61", 0x002000, 0x6f61fdf1, BRF_GRA }, // 8 Tiles - { "epr-7495.64", 0x002000, 0x6a0d2c2d, BRF_GRA }, // 9 Tiles - { "epr-7494.63", 0x002000, 0xa8e281c7, BRF_GRA }, // 10 Tiles - { "epr-7493.66", 0x002000, 0x89305df4, BRF_GRA }, // 11 Tiles - { "epr-7492.65", 0x002000, 0x60f806b1, BRF_GRA }, // 12 Tiles - - { "epr-7485.117", 0x004000, 0xc2891722, BRF_GRA }, // 13 Sprites - { "epr-7487.04", 0x004000, 0x2d3a421b, BRF_GRA }, // 14 Sprites - { "epr-7486.110", 0x004000, 0x8d622c50, BRF_GRA }, // 15 Sprites - { "epr-7488.05", 0x004000, 0x007c2f1b, BRF_GRA }, // 16 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 17 Timing PROM -}; - -STD_ROM_PICK(Wboy2) -STD_ROM_FN(Wboy2) - -static struct BurnRomInfo Wboy2uRomDesc[] = { - { "ic129_02.bin", 0x002000, 0x32c4b709, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ic130_03.bin", 0x002000, 0x56463ede, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "ic131_04.bin", 0x002000, 0x775ed392, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "ic132_05.bin", 0x002000, 0x7b922708, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "epr-7591.133", 0x002000, 0x8379aa23, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "epr-7592.134", 0x002000, 0xc767a5d7, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr7498a.3", 0x002000, 0xc198205c, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-7497.62", 0x002000, 0x08d609ca, BRF_GRA }, // 7 Tiles - { "epr-7496.61", 0x002000, 0x6f61fdf1, BRF_GRA }, // 8 Tiles - { "epr-7495.64", 0x002000, 0x6a0d2c2d, BRF_GRA }, // 9 Tiles - { "epr-7494.63", 0x002000, 0xa8e281c7, BRF_GRA }, // 10 Tiles - { "epr-7493.66", 0x002000, 0x89305df4, BRF_GRA }, // 11 Tiles - { "epr-7492.65", 0x002000, 0x60f806b1, BRF_GRA }, // 12 Tiles - - { "epr-7485.117", 0x004000, 0xc2891722, BRF_GRA }, // 13 Sprites - { "epr-7487.04", 0x004000, 0x2d3a421b, BRF_GRA }, // 14 Sprites - { "epr-7486.110", 0x004000, 0x8d622c50, BRF_GRA }, // 15 Sprites - { "epr-7488.05", 0x004000, 0x007c2f1b, BRF_GRA }, // 16 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 17 Timing PROM -}; - -STD_ROM_PICK(Wboy2u) -STD_ROM_FN(Wboy2u) - -static struct BurnRomInfo Wboy3RomDesc[] = { - { "wb_1", 0x004000, 0xbd6fef49, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "wb_2", 0x004000, 0x4081b624, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "wb_3", 0x004000, 0xc48a0e36, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-7498.120", 0x002000, 0x78ae1e7b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-7497.62", 0x002000, 0x08d609ca, BRF_GRA }, // 4 Tiles - { "epr-7496.61", 0x002000, 0x6f61fdf1, BRF_GRA }, // 5 Tiles - { "epr-7495.64", 0x002000, 0x6a0d2c2d, BRF_GRA }, // 6 Tiles - { "epr-7494.63", 0x002000, 0xa8e281c7, BRF_GRA }, // 7 Tiles - { "epr-7493.66", 0x002000, 0x89305df4, BRF_GRA }, // 8 Tiles - { "epr-7492.65", 0x002000, 0x60f806b1, BRF_GRA }, // 9 Tiles - - { "epr-7485.117", 0x004000, 0xc2891722, BRF_GRA }, // 10 Sprites - { "epr-7487.04", 0x004000, 0x2d3a421b, BRF_GRA }, // 11 Sprites - { "epr-7486.110", 0x004000, 0x8d622c50, BRF_GRA }, // 12 Sprites - { "epr-7488.05", 0x004000, 0x007c2f1b, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Wboy3) -STD_ROM_FN(Wboy3) - -static struct BurnRomInfo Wboy4RomDesc[] = { - { "epr7622.ic1", 0x008000, 0x48b2c006, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr7621.ic2", 0x008000, 0x466cae31, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - - { "7583.126", 0x008000, 0x99334b3c, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program Code - - { "epr7610.ic62", 0x004000, 0x1685d26a, BRF_GRA }, // 3 Tiles - { "epr7609.ic64", 0x004000, 0x87ecba53, BRF_GRA }, // 4 Tiles - { "epr7608.ic66", 0x004000, 0xe812b3ec, BRF_GRA }, // 5 Tiles - - { "7578.87", 0x008000, 0x6ff1637f, BRF_GRA }, // 6 Sprites - { "7577.86", 0x008000, 0x58b3705e, BRF_GRA }, // 7 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 8 Timing PROM -}; - -STD_ROM_PICK(Wboy4) -STD_ROM_FN(Wboy4) - -static struct BurnRomInfo Wboy5RomDesc[] = { - { "wb1.ic116", 0x004000, 0x6c67407c, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "wb_2", 0x004000, 0x4081b624, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "wb_3", 0x004000, 0xc48a0e36, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-7498.120", 0x002000, 0x78ae1e7b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-7497.62", 0x002000, 0x08d609ca, BRF_GRA }, // 4 Tiles - { "epr-7496.61", 0x002000, 0x6f61fdf1, BRF_GRA }, // 5 Tiles - { "epr-7495.64", 0x002000, 0x6a0d2c2d, BRF_GRA }, // 6 Tiles - { "epr-7494.63", 0x002000, 0xa8e281c7, BRF_GRA }, // 7 Tiles - { "epr-7493.66", 0x002000, 0x89305df4, BRF_GRA }, // 8 Tiles - { "epr-7492.65", 0x002000, 0x60f806b1, BRF_GRA }, // 9 Tiles - - { "epr-7485.117", 0x004000, 0xc2891722, BRF_GRA }, // 10 Sprites - { "epr-7487.04", 0x004000, 0x2d3a421b, BRF_GRA }, // 11 Sprites - { "epr-7486.110", 0x004000, 0x8d622c50, BRF_GRA }, // 12 Sprites - { "epr-7488.05", 0x004000, 0x007c2f1b, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Wboy5) -STD_ROM_FN(Wboy5) - -static struct BurnRomInfo WboyuRomDesc[] = { - { "ic116_89.bin", 0x004000, 0x73d8cef0, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ic109_90.bin", 0x004000, 0x29546828, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "ic096_91.bin", 0x004000, 0xc7145c2a, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-7498.120", 0x002000, 0x78ae1e7b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-7497.62", 0x002000, 0x08d609ca, BRF_GRA }, // 4 Tiles - { "epr-7496.61", 0x002000, 0x6f61fdf1, BRF_GRA }, // 5 Tiles - { "epr-7495.64", 0x002000, 0x6a0d2c2d, BRF_GRA }, // 6 Tiles - { "epr-7494.63", 0x002000, 0xa8e281c7, BRF_GRA }, // 7 Tiles - { "epr-7493.66", 0x002000, 0x89305df4, BRF_GRA }, // 8 Tiles - { "epr-7492.65", 0x002000, 0x60f806b1, BRF_GRA }, // 9 Tiles - - { "ic117_85.bin", 0x004000, 0x1ee96ae8, BRF_GRA }, // 10 Sprites - { "ic004_87.bin", 0x004000, 0x119735bb, BRF_GRA }, // 11 Sprites - { "ic110_86.bin", 0x004000, 0x26d0fac4, BRF_GRA }, // 12 Sprites - { "ic005_88.bin", 0x004000, 0x2602e519, BRF_GRA }, // 13 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 14 Timing PROM -}; - -STD_ROM_PICK(Wboyu) -STD_ROM_FN(Wboyu) - -static struct BurnRomInfo WbdeluxeRomDesc[] = { - { "wbd1.bin", 0x002000, 0xa1bedbd7, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "ic130_03.bin", 0x002000, 0x56463ede, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "wbd3.bin", 0x002000, 0x6fcdbd4c, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "ic132_05.bin", 0x002000, 0x7b922708, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "wbd5.bin", 0x002000, 0xf6b02902, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "wbd6.bin", 0x002000, 0x43df21fe, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "epr7498a.3", 0x002000, 0xc198205c, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "epr-7497.62", 0x002000, 0x08d609ca, BRF_GRA }, // 7 Tiles - { "epr-7496.61", 0x002000, 0x6f61fdf1, BRF_GRA }, // 8 Tiles - { "epr-7495.64", 0x002000, 0x6a0d2c2d, BRF_GRA }, // 9 Tiles - { "epr-7494.63", 0x002000, 0xa8e281c7, BRF_GRA }, // 10 Tiles - { "epr-7493.66", 0x002000, 0x89305df4, BRF_GRA }, // 11 Tiles - { "epr-7492.65", 0x002000, 0x60f806b1, BRF_GRA }, // 12 Tiles - - { "epr-7485.117", 0x004000, 0xc2891722, BRF_GRA }, // 13 Sprites - { "epr-7487.04", 0x004000, 0x2d3a421b, BRF_GRA }, // 14 Sprites - { "epr-7486.110", 0x004000, 0x8d622c50, BRF_GRA }, // 15 Sprites - { "epr-7488.05", 0x004000, 0x007c2f1b, BRF_GRA }, // 16 Sprites - - { "pr-5317.76", 0x000100, 0x648350b8, BRF_OPT }, // 17 Timing PROM -}; - -STD_ROM_PICK(Wbdeluxe) -STD_ROM_FN(Wbdeluxe) - -static struct BurnRomInfo WmatchRomDesc[] = { - { "wm.129", 0x002000, 0xb6db4442, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "wm.130", 0x002000, 0x59a0a7a0, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "wm.131", 0x002000, 0x4cb3856a, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - { "wm.132", 0x002000, 0xe2e44b29, BRF_ESS | BRF_PRG }, // 3 Z80 #1 Program Code - { "wm.133", 0x002000, 0x43a36445, BRF_ESS | BRF_PRG }, // 4 Z80 #1 Program Code - { "wm.134", 0x002000, 0x5624794c, BRF_ESS | BRF_PRG }, // 5 Z80 #1 Program Code - - { "wm.3", 0x002000, 0x50d2afb7, BRF_ESS | BRF_PRG }, // 6 Z80 #2 Program Code - - { "wm.82", 0x002000, 0x540f0bf3, BRF_GRA }, // 7 Tiles - { "wm.65", 0x002000, 0x92c1e39e, BRF_GRA }, // 8 Tiles - { "wm.81", 0x002000, 0x6a01ff2a, BRF_GRA }, // 9 Tiles - { "wm.64", 0x002000, 0xaae6449b, BRF_GRA }, // 10 Tiles - { "wm.80", 0x002000, 0xfc3f0bd4, BRF_GRA }, // 11 Tiles - { "wm.63", 0x002000, 0xc2ce9b93, BRF_GRA }, // 12 Tiles - - { "wm.86", 0x004000, 0x238ae0e5, BRF_GRA }, // 13 Sprites - { "wm.93", 0x004000, 0xa2f19170, BRF_GRA }, // 14 Sprites - - { "pr-5317.106", 0x000100, 0x648350b8, BRF_OPT }, // 15 Timing PROM -}; - -STD_ROM_PICK(Wmatch) -STD_ROM_FN(Wmatch) - -static struct BurnRomInfo ChopliftRomDesc[] = { - { "epr-7124.ic90", 0x008000, 0x678d5c41, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7125.ic91", 0x008000, 0xf5283498, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-7126.ic92", 0x008000, 0xdbd192ab, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-7130.ic126", 0x008000, 0x346af118, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-7127.ic4", 0x008000, 0x1e708f6d, BRF_GRA }, // 4 Tiles - { "epr-7128.ic5", 0x008000, 0xb922e787, BRF_GRA }, // 5 Tiles - { "epr-7129.ic6", 0x008000, 0xbd3b6e6e, BRF_GRA }, // 6 Tiles - - { "epr-7121.ic87", 0x008000, 0xf2b88f73, BRF_GRA }, // 4 Sprites - { "epr-7120.ic86", 0x008000, 0x517d7fd3, BRF_GRA }, // 5 Sprites - { "epr-7123.ic89", 0x008000, 0x8f16a303, BRF_GRA }, // 6 Sprites - { "epr-7122.ic88", 0x008000, 0x7c93f160, BRF_GRA }, // 7 Sprites - - { "pr7119.ic20", 0x000100, 0xb2a8260f, BRF_GRA }, // 8 Red PROM - { "pr7118.ic14", 0x000100, 0x693e20c7, BRF_GRA }, // 9 Green PROM - { "pr7117.ic8", 0x000100, 0x4124307e, BRF_GRA }, // 10 Blue PROM - - { "315-5151.ic74", 0x001000, 0x7bd11a6c, BRF_OPT }, - { "pr5317.ic28", 0x000100, 0x648350b8, BRF_OPT }, - { "315-5152.bin", 0x000104, 0x2c9229b4, BRF_OPT }, - { "315-5138.bin", 0x000104, 0xdd223015, BRF_OPT }, - { "315-5139.bin", 0x000104, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "315-5025.bin", 0x000104, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "315-5025.bin", 0x000104, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "315-5025.bin", 0x000104, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(Choplift) -STD_ROM_FN(Choplift) - -static struct BurnRomInfo ChopliftuRomDesc[] = { - { "epr-7152.ic90", 0x008000, 0xfe49d83e, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7153.ic91", 0x008000, 0x48697666, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-7154.ic92", 0x008000, 0x56d6222a, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-7130.ic126", 0x008000, 0x346af118, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-7127.ic4", 0x008000, 0x1e708f6d, BRF_GRA }, // 4 Tiles - { "epr-7128.ic5", 0x008000, 0xb922e787, BRF_GRA }, // 5 Tiles - { "epr-7129.ic6", 0x008000, 0xbd3b6e6e, BRF_GRA }, // 6 Tiles - - { "epr-7121.ic87", 0x008000, 0xf2b88f73, BRF_GRA }, // 4 Sprites - { "epr-7120.ic86", 0x008000, 0x517d7fd3, BRF_GRA }, // 5 Sprites - { "epr-7123.ic89", 0x008000, 0x8f16a303, BRF_GRA }, // 6 Sprites - { "epr-7122.ic88", 0x008000, 0x7c93f160, BRF_GRA }, // 7 Sprites - - { "pr7119.ic20", 0x000100, 0xb2a8260f, BRF_OPT }, // 8 Red PROM - { "pr7118.ic14", 0x000100, 0x693e20c7, BRF_OPT }, // 9 Green PROM - { "pr7117.ic8", 0x000100, 0x4124307e, BRF_OPT }, // 10 Blue PROM - - { "pr5317.ic28", 0x000100, 0x648350b8, BRF_OPT }, - { "315-5152.bin", 0x000104, 0x2c9229b4, BRF_OPT }, - { "315-5138.bin", 0x000104, 0xdd223015, BRF_OPT }, - { "315-5139.bin", 0x000104, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "315-5025.bin", 0x000104, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "315-5025.bin", 0x000104, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "315-5025.bin", 0x000104, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(Chopliftu) -STD_ROM_FN(Chopliftu) - -static struct BurnRomInfo ChopliftblRomDesc[] = { - { "ep7124bl.90", 0x008000, 0x71a37932, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr-7125.91", 0x008000, 0xf5283498, BRF_ESS | BRF_PRG }, // 1 Z80 #1 Program Code - { "epr-7126.92", 0x008000, 0xdbd192ab, BRF_ESS | BRF_PRG }, // 2 Z80 #1 Program Code - - { "epr-7130.126", 0x008000, 0x346af118, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr-7127.4", 0x008000, 0x1e708f6d, BRF_GRA }, // 4 Tiles - { "epr-7128.5", 0x008000, 0xb922e787, BRF_GRA }, // 5 Tiles - { "epr-7129.6", 0x008000, 0xbd3b6e6e, BRF_GRA }, // 6 Tiles - - { "epr-7121.87", 0x008000, 0xf2b88f73, BRF_GRA }, // 4 Sprites - { "epr-7120.86", 0x008000, 0x517d7fd3, BRF_GRA }, // 5 Sprites - { "epr-7123.89", 0x008000, 0x8f16a303, BRF_GRA }, // 6 Sprites - { "epr-7122.88", 0x008000, 0x7c93f160, BRF_GRA }, // 7 Sprites - - { "pr7119.20", 0x000100, 0xb2a8260f, BRF_OPT }, // 8 Red PROM - { "pr7118.14", 0x000100, 0x693e20c7, BRF_OPT }, // 9 Green PROM - { "pr7117.8", 0x000100, 0x4124307e, BRF_OPT }, // 10 Blue PROM - - { "pr5317.28", 0x000100, 0x648350b8, BRF_OPT }, - { "pal16r4.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal16r4.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal16l8.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal16r4.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal16l8.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal20r4.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal16l8.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal16l8.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal16l8.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal16l8.bin", 0x000001, 0x00000000, BRF_OPT | BRF_NODUMP }, - { "pal16r4a.ic9", 0x000104, 0xdd223015, BRF_OPT }, - { "pal16r4a.ic10", 0x000104, 0x2c9229b4, BRF_OPT }, - { "pal16r4a-chopbl1.bin",0x000104, 0xe1628a8e, BRF_OPT }, - { "pal16l8a-chopbl2.bin",0x000104, 0xafa7425d, BRF_OPT }, -}; - -STD_ROM_PICK(Chopliftbl) -STD_ROM_FN(Chopliftbl) - -// Wonder Boy in Monster Land (Japan New Ver., MC-8123, 317-0043) - -static struct BurnRomInfo wbmlRomDesc[] = { - { "ep11031a.90", 0x8000, 0xbd3349e5, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr11032.91", 0x8000, 0x9d03bdb2, BRF_ESS | BRF_PRG }, // 1 - { "epr11033.92", 0x8000, 0x7076905c, BRF_ESS | BRF_PRG }, // 2 - - { "epr11037.126", 0x8000, 0x7a4ee585, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr11034.4", 0x8000, 0x37a2077d, BRF_GRA }, // 4 Tiles - { "epr11035.5", 0x8000, 0xcdf2a21b, BRF_GRA }, // 5 - { "epr11036.6", 0x8000, 0x644687fa, BRF_GRA }, // 6 - - { "epr11028.87", 0x8000, 0xaf0b3972, BRF_GRA }, // 7 Sprites - { "epr11027.86", 0x8000, 0x277d8f1d, BRF_GRA }, // 8 - { "epr11030.89", 0x8000, 0xf05ffc76, BRF_GRA }, // 9 - { "epr11029.88", 0x8000, 0xcedc9c61, BRF_GRA }, // 10 - - { "pr11026.20", 0x0100, 0x27057298, BRF_GRA }, // 11 Red PROM - { "pr11025.14", 0x0100, 0x41e4d86b, BRF_GRA }, // 12 Blue - { "pr11024.8", 0x0100, 0x08d71954, BRF_GRA }, // 13 Green - { "pr5317.37", 0x0100, 0x648350b8, BRF_GRA }, // 14 Timing PROM - - { "317-0043.key", 0x2000, 0xe354abfc, BRF_ESS }, // 15 Encryption Key -}; - -STD_ROM_PICK(wbml) -STD_ROM_FN(wbml) - -// Wonder Boy in Monster Land (Japan not encrypted) - -static struct BurnRomInfo wbmljbRomDesc[] = { - { "wbml.01", 0x10000, 0x66482638, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "m-6.bin", 0x10000, 0x8c08cd11, BRF_ESS | BRF_PRG }, // 1 - { "m-7.bin", 0x10000, 0x11881703, BRF_ESS | BRF_PRG }, // 2 - - { "epr11037.126", 0x08000, 0x7a4ee585, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr11034.4", 0x08000, 0x37a2077d, BRF_GRA }, // 4 Tiles - { "epr11035.5", 0x08000, 0xcdf2a21b, BRF_GRA }, // 5 - { "epr11036.6", 0x08000, 0x644687fa, BRF_GRA }, // 6 - - { "epr11028.87", 0x08000, 0xaf0b3972, BRF_GRA }, // 7 Sprites - { "epr11027.86", 0x08000, 0x277d8f1d, BRF_GRA }, // 8 - { "epr11030.89", 0x08000, 0xf05ffc76, BRF_GRA }, // 9 - { "epr11029.88", 0x08000, 0xcedc9c61, BRF_GRA }, // 10 - - { "pr11026.20", 0x00100, 0x27057298, BRF_GRA }, // 11 Red PROM - { "pr11025.14", 0x00100, 0x41e4d86b, BRF_GRA }, // 12 Blue - { "pr11024.8", 0x00100, 0x08d71954, BRF_GRA }, // 13 Green - { "pr5317.37", 0x00100, 0x648350b8, BRF_GRA }, // 14 Timing PROM -}; - -STD_ROM_PICK(wbmljb) -STD_ROM_FN(wbmljb) - -// Wonder Boy in Monster Land (Japan Old Ver., MC-8123, 317-0043) - -static struct BurnRomInfo wbmljoRomDesc[] = { - { "epr11031.90", 0x8000, 0x497ebfb4, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "epr11032.91", 0x8000, 0x9d03bdb2, BRF_ESS | BRF_PRG }, // 1 - { "epr11033.92", 0x8000, 0x7076905c, BRF_ESS | BRF_PRG }, // 2 - - { "epr11037.126", 0x8000, 0x7a4ee585, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "epr11034.4", 0x8000, 0x37a2077d, BRF_GRA }, // 4 Tiles - { "epr11035.5", 0x8000, 0xcdf2a21b, BRF_GRA }, // 5 - { "epr11036.6", 0x8000, 0x644687fa, BRF_GRA }, // 6 - - { "epr11028.87", 0x8000, 0xaf0b3972, BRF_GRA }, // 7 Sprites - { "epr11027.86", 0x8000, 0x277d8f1d, BRF_GRA }, // 8 - { "epr11030.89", 0x8000, 0xf05ffc76, BRF_GRA }, // 9 - { "epr11029.88", 0x8000, 0xcedc9c61, BRF_GRA }, // 10 - - { "pr11026.20", 0x0100, 0x27057298, BRF_GRA }, // 11 Red PROM - { "pr11025.14", 0x0100, 0x41e4d86b, BRF_GRA }, // 12 Blue - { "pr11024.8", 0x0100, 0x08d71954, BRF_GRA }, // 13 Green - { "pr5317.37", 0x0100, 0x648350b8, BRF_GRA }, // 14 Timing PROM - - { "317-0043.key", 0x2000, 0xe354abfc, BRF_ESS }, // 15 Encryption Key -}; - -STD_ROM_PICK(wbmljo) -STD_ROM_FN(wbmljo) - -// Wonder Boy in Monster Land (English bootleg set 1) - -static struct BurnRomInfo wbmlbRomDesc[] = { - { "wbml.01", 0x10000, 0x66482638, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "wbml.02", 0x10000, 0x48746bb6, BRF_ESS | BRF_PRG }, // 1 - { "wbml.03", 0x10000, 0xd57ba8aa, BRF_ESS | BRF_PRG }, // 2 - - { "epr11037.126", 0x08000, 0x7a4ee585, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "wbml.08", 0x08000, 0xbbea6afe, BRF_GRA }, // 4 Tiles - { "wbml.09", 0x08000, 0x77567d41, BRF_GRA }, // 5 - { "wbml.10", 0x08000, 0xa52ffbdd, BRF_GRA }, // 6 - - { "epr11028.87", 0x08000, 0xaf0b3972, BRF_GRA }, // 7 Sprites - { "epr11027.86", 0x08000, 0x277d8f1d, BRF_GRA }, // 8 - { "epr11030.89", 0x08000, 0xf05ffc76, BRF_GRA }, // 9 - { "epr11029.88", 0x08000, 0xcedc9c61, BRF_GRA }, // 10 - - { "pr11026.20", 0x00100, 0x27057298, BRF_GRA }, // 11 Red PROM - { "pr11025.14", 0x00100, 0x41e4d86b, BRF_GRA }, // 12 Blue - { "pr11024.8", 0x00100, 0x08d71954, BRF_GRA }, // 13 Green - { "pr5317.37", 0x00100, 0x648350b8, BRF_GRA }, // 14 Timing PROM -}; - -STD_ROM_PICK(wbmlb) -STD_ROM_FN(wbmlb) - -// Wonder Boy in Monster Land (English, Virtual Console) - -static struct BurnRomInfo wbmlvcRomDesc[] = { - { "vc.ic90", 0x10000, 0x093c4852, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "vc.ic91", 0x10000, 0x7e973ece, BRF_ESS | BRF_PRG }, // 1 - { "vc.ic92", 0x08000, 0x32661e7e, BRF_ESS | BRF_PRG }, // 2 - - { "epr11037.126", 0x08000, 0x7a4ee585, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program Code - - { "vc.ic4", 0x08000, 0x820bee59, BRF_GRA }, // 4 Tiles - { "vc.ic5", 0x08000, 0xa9a1447e, BRF_GRA }, // 5 - { "vc.ic6", 0x08000, 0x359026a0, BRF_GRA }, // 6 - - { "epr11028.87", 0x08000, 0xaf0b3972, BRF_GRA }, // 7 Sprites - { "epr11027.86", 0x08000, 0x277d8f1d, BRF_GRA }, // 8 - { "epr11030.89", 0x08000, 0xf05ffc76, BRF_GRA }, // 9 - { "epr11029.88", 0x08000, 0xcedc9c61, BRF_GRA }, // 10 - - { "pr11026.20", 0x00100, 0x27057298, BRF_GRA }, // 11 Red PROM - { "pr11025.14", 0x00100, 0x41e4d86b, BRF_GRA }, // 12 Blue - { "pr11024.8", 0x00100, 0x08d71954, BRF_GRA }, // 13 Green - { "pr5317.37", 0x00100, 0x648350b8, BRF_GRA }, // 14 Timing PROM -}; - -STD_ROM_PICK(wbmlvc) -STD_ROM_FN(wbmlvc) - -/*============================================================================================== -Decode Functions -===============================================================================================*/ - -static void sega_decode(const UINT8 convtable[32][4]) -{ - INT32 A; - - INT32 length = 0x10000; - INT32 cryptlen = 0x8000; - UINT8 *rom = System1Rom1; - UINT8 *decrypted = System1Fetch1; - - for (A = 0x0000;A < cryptlen;A++) - { - INT32 xorval = 0; - - UINT8 src = rom[A]; - - /* pick the translation table from bits 0, 4, 8 and 12 of the address */ - INT32 row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2) + (((A >> 12) & 1) << 3); - - /* pick the offset in the table from bits 3 and 5 of the source data */ - INT32 col = ((src >> 3) & 1) + (((src >> 5) & 1) << 1); - /* the bottom half of the translation table is the mirror image of the top */ - if (src & 0x80) - { - col = 3 - col; - xorval = 0xa8; - } - - /* decode the opcodes */ - decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval); - - /* decode the data */ - rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval); - - if (convtable[2*row][col] == 0xff) /* table incomplete! (for development) */ - decrypted[A] = 0xee; - if (convtable[2*row+1][col] == 0xff) /* table incomplete! (for development) */ - rom[A] = 0xee; - } - - /* this is a kludge to catch anyone who has code that crosses the encrypted/ */ - /* decrypted boundary. ssanchan does it */ - if (length > 0x8000) - { - INT32 bytes = 0x4000; - memcpy(&decrypted[0x8000], &rom[0x8000], bytes); - } -} - -static void bullfgtj_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0xa0,0xa8,0x20,0x28 }, { 0x80,0xa0,0x00,0x20 }, /* ...0...0...0...0 */ - { 0x20,0x28,0x00,0x08 }, { 0x20,0x28,0x00,0x08 }, /* ...0...0...0...1 */ - { 0xa0,0xa8,0x20,0x28 }, { 0x08,0x28,0x00,0x20 }, /* ...0...0...1...0 */ - { 0x88,0x08,0xa8,0x28 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...0...1...1 */ - { 0xa0,0xa8,0x20,0x28 }, { 0x20,0x28,0x00,0x08 }, /* ...0...1...0...0 */ - { 0x28,0xa8,0x20,0xa0 }, { 0x20,0x28,0x00,0x08 }, /* ...0...1...0...1 */ - { 0xa0,0xa8,0x20,0x28 }, { 0x08,0x28,0x00,0x20 }, /* ...0...1...1...0 */ - { 0x88,0x08,0xa8,0x28 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...1...1...1 */ - { 0x28,0xa8,0x20,0xa0 }, { 0xa0,0xa8,0x20,0x28 }, /* ...1...0...0...0 */ - { 0x88,0x08,0xa8,0x28 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...0...1 */ - { 0x28,0xa8,0x20,0xa0 }, { 0x08,0x28,0x00,0x20 }, /* ...1...0...1...0 */ - { 0x28,0xa8,0x20,0xa0 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...1 */ - { 0x20,0x28,0x00,0x08 }, { 0x20,0x28,0x00,0x08 }, /* ...1...1...0...0 */ - { 0x88,0x08,0xa8,0x28 }, { 0x20,0x28,0x00,0x08 }, /* ...1...1...0...1 */ - { 0x08,0x28,0x00,0x20 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...1...1...0 */ - { 0x08,0x28,0x00,0x20 }, { 0x88,0x08,0xa8,0x28 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void flicky_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x08,0x88,0x00,0x80 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */ - { 0x80,0x00,0xa0,0x20 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0x20,0x00 }, /* ...0...0...1...0 */ - { 0x28,0x08,0x20,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */ - { 0x08,0x88,0x00,0x80 }, { 0x80,0x00,0xa0,0x20 }, /* ...0...1...0...0 */ - { 0x80,0x00,0xa0,0x20 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */ - { 0x28,0x08,0x20,0x00 }, { 0x28,0x08,0x20,0x00 }, /* ...0...1...1...0 */ - { 0x28,0x08,0x20,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...1 */ - { 0x08,0x88,0x00,0x80 }, { 0xa8,0x88,0x28,0x08 }, /* ...1...0...0...0 */ - { 0xa8,0x88,0x28,0x08 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...0...0...1 */ - { 0x28,0x08,0x20,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...0 */ - { 0xa8,0x88,0x28,0x08 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...1 */ - { 0x08,0x88,0x00,0x80 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...1...0...0 */ - { 0xa8,0x88,0x28,0x08 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...1...0...1 */ - { 0x28,0x08,0x20,0x00 }, { 0x28,0x08,0x20,0x00 }, /* ...1...1...1...0 */ - { 0x08,0x88,0x00,0x80 }, { 0x88,0x80,0x08,0x00 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void hvymetal_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...1...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...0 */ - { 0x88,0x80,0x08,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...1 */ - { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */ - { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...1 */ - { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */ - { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...0...0 */ - { 0xa0,0x20,0xa8,0x28 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...1...0...1 */ - { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...1...0 */ - { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void imsorry_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x88,0x08,0x80,0x00 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...0...0 */ - { 0x00,0x20,0x80,0xa0 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...0...1 */ - { 0x88,0x08,0xa8,0x28 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...1...0 */ - { 0x00,0x20,0x80,0xa0 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...0...1...1 */ - { 0x00,0x20,0x80,0xa0 }, { 0x08,0x00,0x88,0x80 }, /* ...0...1...0...0 */ - { 0x00,0x20,0x80,0xa0 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...1...0...1 */ - { 0x20,0x28,0xa0,0xa8 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...1...1...0 */ - { 0x20,0x28,0xa0,0xa8 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...1...1...1 */ - { 0x88,0x08,0x80,0x00 }, { 0x08,0x00,0x88,0x80 }, /* ...1...0...0...0 */ - { 0x08,0x00,0x88,0x80 }, { 0x88,0x08,0x80,0x00 }, /* ...1...0...0...1 */ - { 0x08,0x28,0x00,0x20 }, { 0x08,0x28,0x00,0x20 }, /* ...1...0...1...0 */ - { 0x88,0x08,0x80,0x00 }, { 0x08,0x28,0x00,0x20 }, /* ...1...0...1...1 */ - { 0x08,0x28,0x00,0x20 }, { 0x08,0x00,0x88,0x80 }, /* ...1...1...0...0 */ - { 0x08,0x28,0x00,0x20 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...1...0...1 */ - { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x28,0x00,0x20 }, /* ...1...1...1...0 */ - { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x28,0x00,0x20 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void mrviking_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...0 */ - { 0x88,0x08,0x80,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */ - { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...1...0 */ - { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */ - { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */ - { 0x88,0x80,0x08,0x00 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...0 */ - { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...0 */ - { 0x88,0x08,0x80,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...1 */ - { 0xa0,0x80,0x20,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...0 */ - { 0xa0,0x80,0x20,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...1...0...1...1 */ - { 0x28,0x08,0xa8,0x88 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */ - { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...1...0 */ - { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void myheroj_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...0 */ - { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...1 */ - { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */ - { 0x08,0x88,0x00,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...1...1 */ - { 0x20,0x00,0xa0,0x80 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...0 */ - { 0x20,0x00,0xa0,0x80 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */ - { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...0 */ - { 0x08,0x88,0x00,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...1 */ - { 0x28,0xa8,0x08,0x88 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...0 */ - { 0x80,0xa0,0x88,0xa8 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...1 */ - { 0x80,0xa0,0x88,0xa8 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...0 */ - { 0xa8,0xa0,0x88,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...0 */ - { 0x88,0x80,0x08,0x00 }, { 0x08,0x88,0x00,0x80 }, /* ...1...1...0...1 */ - { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */ - { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void myherok_decode(void) -{ - UINT8 *rom = System1Rom1; - - for (INT32 A = 0; A < 0xc000; A++) - rom[A] = (rom[A] & 0xfc) | ((rom[A] & 1) << 1) | ((rom[A] & 2) >> 1); - - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...0 */ - { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...1 */ - { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */ - { 0x08,0x88,0x00,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...1...1 */ - { 0x20,0x00,0xa0,0x80 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...0 */ - { 0x20,0x00,0xa0,0x80 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */ - { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...0 */ - { 0x08,0x88,0x00,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...1 */ - { 0x28,0xa8,0x08,0x88 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...0 */ - { 0x80,0xa0,0x88,0xa8 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...1 */ - { 0x80,0xa0,0x88,0xa8 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...0 */ - { 0xa8,0xa0,0x88,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...0 */ - { 0x88,0x80,0x08,0x00 }, { 0x08,0x88,0x00,0x80 }, /* ...1...1...0...1 */ - { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */ - { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void nprinces_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x08,0x88,0x00,0x80 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...0...0...0 */ - { 0xa8,0xa0,0x28,0x20 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...1 */ - { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...1...0...0 */ - { 0xa8,0xa0,0x28,0x20 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...1...0...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */ - { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...0...0 */ - { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...1 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */ - { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void pitfall2_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */ - { 0x08,0x88,0x28,0xa8 }, { 0x28,0xa8,0x20,0xa0 }, /* ...0...0...0...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...0 */ - { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...1...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x20,0x00,0xa0,0x80 }, /* ...0...1...0...0 */ - { 0x28,0xa8,0x20,0xa0 }, { 0x20,0x00,0xa0,0x80 }, /* ...0...1...0...1 */ - { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...1...1...0 */ - { 0x28,0xa8,0x20,0xa0 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...1...1...1 */ - { 0x20,0x00,0xa0,0x80 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...0...0 */ - { 0x80,0x88,0xa0,0xa8 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...0...1 */ - { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */ - { 0x80,0x88,0xa0,0xa8 }, { 0x28,0xa8,0x20,0xa0 }, /* ...1...0...1...1 */ - { 0x20,0x00,0xa0,0x80 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...1...0...0 */ - { 0x80,0x88,0xa0,0xa8 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...1...0...1 */ - { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...1...0 */ - { 0x80,0x88,0xa0,0xa8 }, { 0x28,0xa8,0x20,0xa0 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void regulus_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...0 */ - { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...0 */ - { 0x88,0x08,0x80,0x00 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...1...1 */ - { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */ - { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...1...0 */ - { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...1 */ - { 0x80,0xa0,0x00,0x20 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...0 */ - { 0x28,0xa8,0x08,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...1 */ - { 0x80,0xa0,0x00,0x20 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...0 */ - { 0x28,0xa8,0x08,0x88 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...0...0 */ - { 0x80,0xa0,0x00,0x20 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...0...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...1...1...0 */ - { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void seganinj_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...0...0 */ - { 0x28,0xa8,0x08,0x88 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...0...0...1 */ - { 0xa8,0xa0,0x28,0x20 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...0...1...0 */ - { 0x28,0xa8,0x08,0x88 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...0...1...1 */ - { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...0...0 */ - { 0x28,0xa8,0x08,0x88 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...0...1 */ - { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...0 */ - { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...1...1...1 */ - { 0x88,0x08,0x80,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */ - { 0xa0,0xa8,0x80,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...0...1 */ - { 0xa8,0xa0,0x28,0x20 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...1...0 */ - { 0xa8,0xa0,0x28,0x20 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...1...1 */ - { 0x28,0x08,0xa8,0x88 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...0 */ - { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...0...1 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...1...0 */ - { 0xa8,0xa0,0x28,0x20 }, { 0x28,0x08,0xa8,0x88 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void spatter_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x88,0x08,0x80,0x00 }, { 0x00,0x08,0x20,0x28 }, /* ...0...0...0...0 */ - { 0x28,0xa8,0x08,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...1 */ - { 0x28,0x20,0xa8,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...0 */ - { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */ - { 0x00,0x08,0x20,0x28 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...0...0 */ - { 0xa0,0x80,0x20,0x00 }, { 0x80,0x88,0x00,0x08 }, /* ...0...1...0...1 */ - { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...1...0 */ - { 0x88,0x08,0x80,0x00 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...1...1 */ - { 0x28,0xa8,0x08,0x88 }, { 0x80,0x88,0x00,0x08 }, /* ...1...0...0...0 */ - { 0x80,0x88,0x00,0x08 }, { 0x00,0x08,0x20,0x28 }, /* ...1...0...0...1 */ - { 0x28,0x20,0xa8,0xa0 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...1...0 */ - { 0x00,0x08,0x20,0x28 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...1 */ - { 0x80,0x88,0x00,0x08 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */ - { 0x80,0xa0,0x88,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */ - { 0xa0,0x80,0x20,0x00 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...1...1...0 */ - { 0x28,0x20,0xa8,0xa0 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void swat_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x88,0x08,0x80,0x00 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...0...0...0 */ - { 0x88,0x08,0x80,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */ - { 0xa0,0x80,0x20,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...0 */ - { 0xa0,0xa8,0x80,0x88 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */ - { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...1...0...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */ - { 0xa0,0x80,0x20,0x00 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...1...1...0 */ - { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...1...1...1 */ - { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...0...0 */ - { 0xa0,0x20,0x80,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...1 */ - { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...1...0 */ - { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...1...1 */ - { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...1...0...1 */ - { 0xa0,0xa8,0x80,0x88 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...1...0 */ - { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0xa8,0x80,0x88 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void teddybb_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x20,0x28,0x00,0x08 }, { 0x80,0x00,0xa0,0x20 }, /* ...0...0...0...0 */ - { 0x20,0x28,0x00,0x08 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...0...1 */ - { 0x28,0x08,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...0 */ - { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */ - { 0x20,0x28,0x00,0x08 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...0...0 */ - { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...1...0...1 */ - { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...0 */ - { 0xa0,0xa8,0x20,0x28 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...1 */ - { 0x80,0x00,0xa0,0x20 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...0...0...0 */ - { 0xa0,0x20,0xa8,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...1...0...0...1 */ - { 0xa0,0x20,0xa8,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */ - { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...1 */ - { 0x80,0x00,0xa0,0x20 }, { 0x20,0x28,0x00,0x08 }, /* ...1...1...0...0 */ - { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...0...1 */ - { 0x80,0x00,0xa0,0x20 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...1...0 */ - { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x20,0xa8,0x28 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void wmatch_decode(void) -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...0...0 */ - { 0x08,0x88,0x00,0x80 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */ - { 0x20,0x00,0xa0,0x80 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...0...1...0 */ - { 0x20,0x28,0xa0,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...1...1 */ - { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...0...0 */ - { 0x08,0x88,0x00,0x80 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...0...1 */ - { 0xa8,0x28,0x88,0x08 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...1...1...0 */ - { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...1...1 */ - { 0x20,0x28,0xa0,0xa8 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...0...0...1 */ - { 0x20,0x28,0xa0,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...1...0 */ - { 0x20,0x28,0xa0,0xa8 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...0...1...1 */ - { 0x20,0x00,0xa0,0x80 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...1...0...0 */ - { 0xa8,0x28,0x88,0x08 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */ - { 0x20,0x28,0xa0,0xa8 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...1...1...0 */ - { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static void sega_decode_2(UINT8 *pDest, UINT8 *pDestDec, const UINT8 opcode_xor[64],const INT32 opcode_swap_select[64], - const UINT8 data_xor[64],const INT32 data_swap_select[64]) -{ - INT32 A; - static const UINT8 swaptable[24][4] = - { - { 6,4,2,0 }, { 4,6,2,0 }, { 2,4,6,0 }, { 0,4,2,6 }, - { 6,2,4,0 }, { 6,0,2,4 }, { 6,4,0,2 }, { 2,6,4,0 }, - { 4,2,6,0 }, { 4,6,0,2 }, { 6,0,4,2 }, { 0,6,4,2 }, - { 4,0,6,2 }, { 0,4,6,2 }, { 6,2,0,4 }, { 2,6,0,4 }, - { 0,6,2,4 }, { 2,0,6,4 }, { 0,2,6,4 }, { 4,2,0,6 }, - { 2,4,0,6 }, { 4,0,2,6 }, { 2,0,4,6 }, { 0,2,4,6 }, - }; - - - UINT8 *rom = pDest; - UINT8 *decrypted = pDestDec; - - for (A = 0x0000;A < 0x8000;A++) - { - INT32 row; - UINT8 src; - const UINT8 *tbl; - - - src = rom[A]; - - /* pick the translation table from bits 0, 3, 6, 9, 12 and 14 of the address */ - row = (A & 1) + (((A >> 3) & 1) << 1) + (((A >> 6) & 1) << 2) - + (((A >> 9) & 1) << 3) + (((A >> 12) & 1) << 4) + (((A >> 14) & 1) << 5); - - /* decode the opcodes */ - tbl = swaptable[opcode_swap_select[row]]; - decrypted[A] = BITSWAP08(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ opcode_xor[row]; - - /* decode the data */ - tbl = swaptable[data_swap_select[row]]; - rom[A] = BITSWAP08(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ data_xor[row]; - } - - memcpy(pDestDec + 0x8000, pDest + 0x8000, 0x4000); -} - -static void astrofl_decode(void) -{ - static const UINT8 opcode_xor[64] = - { - 0x04,0x51,0x40,0x01,0x55,0x44,0x05,0x50,0x41,0x00,0x54,0x45, - 0x04,0x51,0x40,0x01,0x55,0x44,0x05,0x50,0x41,0x00,0x54,0x45, - 0x04,0x51,0x40,0x01,0x55,0x44,0x05,0x50, - 0x04,0x51,0x40,0x01,0x55,0x44,0x05,0x50,0x41,0x00,0x54,0x45, - 0x04,0x51,0x40,0x01,0x55,0x44,0x05,0x50,0x41,0x00,0x54,0x45, - 0x04,0x51,0x40,0x01,0x55,0x44,0x05,0x50, - }; - - static const UINT8 data_xor[64] = - { - 0x54,0x15,0x44,0x51,0x10,0x41,0x55,0x14,0x45,0x50,0x11,0x40, - 0x54,0x15,0x44,0x51,0x10,0x41,0x55,0x14,0x45,0x50,0x11,0x40, - 0x54,0x15,0x44,0x51,0x10,0x41,0x55,0x14, - 0x54,0x15,0x44,0x51,0x10,0x41,0x55,0x14,0x45,0x50,0x11,0x40, - 0x54,0x15,0x44,0x51,0x10,0x41,0x55,0x14,0x45,0x50,0x11,0x40, - 0x54,0x15,0x44,0x51,0x10,0x41,0x55,0x14, - }; - - static const INT32 opcode_swap_select[64] = - { - 0,0,1,1,1,2,2,3,3,4,4,4,5,5,6,6, - 6,7,7,8,8,9,9,9,10,10,11,11,11,12,12,13, - - 8,8,9,9,9,10,10,11,11,12,12,12,13,13,14,14, - 14,15,15,16,16,17,17,17,18,18,19,19,19,20,20,21, - }; - - static const INT32 data_swap_select[64] = - { - 0,0,1,1,2,2,2,3,3,4,4,5,5,5,6,6, - 7,7,7,8,8,9,9,10,10,10,11,11,12,12,12,13, - - 8,8,9,9,10,10,10,11,11,12,12,13,13,13,14,14, - 15,15,15,16,16,17,17,18,18,18,19,19,20,20,20,21, - }; - - sega_decode_2(System1Rom1, System1Fetch1, opcode_xor,opcode_swap_select,data_xor,data_swap_select); -} - -static void fdwarrio_decode(void) -{ - static const UINT8 opcode_xor[64] = - { - 0x40,0x50,0x44,0x54,0x41,0x51,0x45,0x55, - 0x40,0x50,0x44,0x54,0x41,0x51,0x45,0x55, - 0x40,0x50,0x44,0x54,0x41,0x51,0x45,0x55, - 0x40,0x50,0x44,0x54,0x41,0x51,0x45,0x55, - 0x40,0x50,0x44,0x54,0x41,0x51,0x45,0x55, - 0x40,0x50,0x44,0x54,0x41,0x51,0x45,0x55, - 0x40,0x50,0x44,0x54,0x41,0x51,0x45,0x55, - 0x40,0x50,0x44,0x54,0x41,0x51,0x45,0x55, - }; - - static const UINT8 data_xor[64] = - { - 0x10,0x04,0x14,0x01,0x11,0x05,0x15,0x00, - 0x10,0x04,0x14,0x01,0x11,0x05,0x15,0x00, - 0x10,0x04,0x14,0x01,0x11,0x05,0x15,0x00, - 0x10,0x04,0x14,0x01,0x11,0x05,0x15,0x00, - 0x10,0x04,0x14,0x01,0x11,0x05,0x15,0x00, - 0x10,0x04,0x14,0x01,0x11,0x05,0x15,0x00, - 0x10,0x04,0x14,0x01,0x11,0x05,0x15,0x00, - 0x10,0x04,0x14,0x01,0x11,0x05,0x15,0x00, - }; - - static const INT32 opcode_swap_select[64] = - { - 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5, - 6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7, - 8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9, - 10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11, - }; - - static const INT32 data_swap_select[64] = - { - 4,4,4,4,4,4,4,5,5,5,5,5,5,5,5, - 6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7, - 8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9, - 10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11, - 12, - }; - - sega_decode_2(System1Rom1, System1Fetch1, opcode_xor,opcode_swap_select,data_xor,data_swap_select); -} - -static void wboy2_decode(void) -{ - static const UINT8 opcode_xor[64] = - { - 0x00,0x45,0x11,0x01,0x44,0x10,0x55,0x05,0x41,0x14,0x04,0x40,0x15,0x51, - 0x01,0x44,0x10,0x00,0x45,0x11,0x54,0x04,0x40,0x15,0x05,0x41,0x14,0x50, - 0x00,0x45,0x11,0x01, - 0x00,0x45,0x11,0x01,0x44,0x10,0x55,0x05,0x41,0x14,0x04,0x40,0x15,0x51, - 0x01,0x44,0x10,0x00,0x45,0x11,0x54,0x04,0x40,0x15,0x05,0x41,0x14,0x50, - 0x00,0x45,0x11,0x01, - }; - - static const UINT8 data_xor[64] = - { - 0x55,0x05,0x41,0x14,0x50,0x00,0x15,0x51,0x01,0x44,0x10,0x55,0x05,0x11, - 0x54,0x04,0x40,0x15,0x51,0x01,0x14,0x50,0x00,0x45,0x11,0x54,0x04,0x10, - 0x55,0x05,0x41,0x14, - 0x55,0x05,0x41,0x14,0x50,0x00,0x15,0x51,0x01,0x44,0x10,0x55,0x05,0x11, - 0x54,0x04,0x40,0x15,0x51,0x01,0x14,0x50,0x00,0x45,0x11,0x54,0x04,0x10, - 0x55,0x05,0x41,0x14, - }; - - static const INT32 opcode_swap_select[64] = - { - 2, - 5,1,5,1,5, - 0,4,0,4,0,4, - 7,3,7,3,7,3, - 6,2,6,2,6, - 1,5,1,5,1,5, - 0,4,0, - - 10, - 13,9,13,9,13, - 8,12,8,12,8,12, - 15,11,15,11,15,11, - 14,10,14,10,14, - 9,13,9,13,9,13, - 8,12,8, - }; - - static const INT32 data_swap_select[64] = - { - 3,7,3,7,3,7, - 2,6,2,6,2, - 5,1,5,1,5,1, - 4,0,4,0,4, - 8, - 3,7,3,7,3, - 6,2,6,2, - - 11,15,11,15,11,15, - 10,14,10,14,10, - 13,9,13,9,13,9, - 12,8,12,8,12, - 16, - 11,15,11,15,11, - 14,10,14,10, - }; - - sega_decode_2(System1Rom1, System1Fetch1, opcode_xor,opcode_swap_select,data_xor,data_swap_select); -} - -void sega_decode_317(UINT8 *pDest, UINT8 *pDestDec, INT32 order, INT32 opcode_shift, INT32 data_shift) -{ - static const UINT8 xor1_317[1+64] = - { - 0x54, - 0x14,0x15,0x41,0x14,0x50,0x55,0x05,0x41,0x01,0x10,0x51,0x05,0x11,0x05,0x14,0x55, - 0x41,0x05,0x04,0x41,0x14,0x10,0x45,0x50,0x00,0x45,0x00,0x00,0x00,0x45,0x00,0x00, - 0x54,0x04,0x15,0x10,0x04,0x05,0x11,0x44,0x04,0x01,0x05,0x00,0x44,0x15,0x40,0x45, - 0x10,0x15,0x51,0x50,0x00,0x15,0x51,0x44,0x15,0x04,0x44,0x44,0x50,0x10,0x04,0x04, - }; - - static const UINT8 xor2_317[2+64] = - { - 0x04, - 0x44, - 0x15,0x51,0x41,0x10,0x15,0x54,0x04,0x51,0x05,0x55,0x05,0x54,0x45,0x04,0x10,0x01, - 0x51,0x55,0x45,0x55,0x45,0x04,0x55,0x40,0x11,0x15,0x01,0x40,0x01,0x11,0x45,0x44, - 0x40,0x05,0x15,0x15,0x01,0x50,0x00,0x44,0x04,0x50,0x51,0x45,0x50,0x54,0x41,0x40, - 0x14,0x40,0x50,0x45,0x10,0x05,0x50,0x01,0x40,0x01,0x50,0x50,0x50,0x44,0x40,0x10, - }; - - static const INT32 swap1_317[1+64] = - { - 7, - 1,11,23,17,23, 0,15,19, - 20,12,10, 0,18,18, 5,20, - 13, 0,18,14, 5, 6,10,21, - 1,11, 9, 3,21, 4, 1,17, - 5, 7,16,13,19,23,20, 2, - 10,23,23,15,10,12, 0,22, - 14, 6,15,11,17,15,21, 0, - 6, 1, 1,18, 5,15,15,20, - }; - - static const INT32 swap2_317[2+64] = - { - 7, - 12, - 18, 8,21, 0,22,21,13,21, - 20,13,20,14, 6, 3, 5,20, - 8,20, 4, 8,17,22, 0, 0, - 6,17,17, 9, 0,16,13,21, - 3, 2,18, 6,11, 3, 3,18, - 18,19, 3, 0, 5, 0,11, 8, - 8, 1, 7, 2,10, 8,10, 2, - 1, 3,12,16, 0,17,10, 1, - }; - - if (order) - sega_decode_2( pDest, pDestDec, xor2_317+opcode_shift, swap2_317+opcode_shift, xor1_317+data_shift, swap1_317+data_shift ); - else - sega_decode_2( pDest, pDestDec, xor1_317+opcode_shift, swap1_317+opcode_shift, xor2_317+data_shift, swap2_317+data_shift ); -} - -static void gardia_decode() -{ - sega_decode_317( System1Rom1, System1Fetch1, 1, 1, 1 ); -} - -static void gardiab_decode() -{ - sega_decode_317( System1Rom1, System1Fetch1, 0, 1, 2 ); -} - -static void blockgal_decode() -{ - mc8123_decrypt_rom(0, 0, System1Rom1, System1Fetch1, System1MC8123Key); -} - -static void wbml_decode() // & Ufosensi -{ - mc8123_decrypt_rom(1, 4, System1Rom1, System1Rom1 + 0x20000, System1MC8123Key); -} - -static void wbmljb_decode() -{ - return; // fake decode function -} - -static void myherok_tile_decode() -{ - INT32 A; - UINT8 *rom = System1TempRom; - - /* the first ROM has data lines D0 and D6 swapped. */ - for (A = 0x0000;A < 0x4000;A++) - rom[A] = (rom[A] & 0xbe) | ((rom[A] & 0x01) << 6) | ((rom[A] & 0x40) >> 6); - - /* the second ROM has data lines D1 and D5 swapped. */ - for (A = 0x4000;A < 0x8000;A++) - rom[A] = (rom[A] & 0xdd) | ((rom[A] & 0x02) << 4) | ((rom[A] & 0x20) >> 4); - - /* the third ROM has data lines D0 and D6 swapped. */ - for (A = 0x8000;A < 0xc000;A++) - rom[A] = (rom[A] & 0xbe) | ((rom[A] & 0x01) << 6) | ((rom[A] & 0x40) >> 6); - - /* also, all three ROMs have address lines A4 and A5 swapped. */ - for (A = 0;A < 0xc000;A++) - { - INT32 A1; - UINT8 temp; - - A1 = (A & 0xffcf) | ((A & 0x0010) << 1) | ((A & 0x0020) >> 1); - if (A < A1) - { - temp = rom[A]; - rom[A] = rom[A1]; - rom[A1] = temp; - } - } -} - -/*============================================================================================== -Allocate Memory -===============================================================================================*/ - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - System1Rom1 = Next; Next += 0x040000; - System1Fetch1 = Next; Next += 0x040000; - System1Rom2 = Next; Next += 0x010000; - System1PromRed = Next; Next += 0x000100; - System1PromGreen = Next; Next += 0x000100; - System1PromBlue = Next; Next += 0x000100; - - RamStart = Next; - - System1Ram1 = Next; Next += 0x004100; - System1Ram2 = Next; Next += 0x000800; - System1SpriteRam = Next; Next += 0x000800; - System1PaletteRam = Next; Next += 0x000800; - System1BgRam = Next; Next += 0x000800; - System1VideoRam = Next; Next += 0x004000; - System1ScrollXRam = System1VideoRam + 0x7C0; - System1BgCollisionRam = Next; Next += 0x000400; - System1SprCollisionRam = Next; Next += 0x000400; - System1deRam = Next; Next += 0x000200; - System1efRam = Next; Next += 0x000100; - System1f4Ram = Next; Next += 0x000400; - System1fcRam = Next; Next += 0x000400; - SpriteOnScreenMap = Next; Next += (256 * 256); - - RamEnd = Next; - - System1Sprites = Next; Next += System1SpriteRomSize; - System1Tiles = Next; Next += (System1NumTiles * 8 * 8); - System1TilesPenUsage = (UINT32*)Next; Next += System1NumTiles * sizeof(UINT32); - System1Palette = (UINT32*)Next; Next += 0x000800 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -/*============================================================================================== -Reset Functions -===============================================================================================*/ - -static INT32 System1DoReset() -{ - if (IsSystem2 || Sys1UsePPI) { - ppi8255_init(1); // this resets the 8255ppi, needed or wbml reset fails (bad sound, or rom errors) - } - - memset (RamStart, 0, RamEnd - RamStart); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - SN76496Reset(); - - System1ScrollX[0] = System1ScrollX[1] = System1ScrollY = 0; - System1BgScrollX = 0; - System1BgScrollY = 0; - System1VideoMode = 0; - System1FlipScreen = 0; - System1SoundLatch = 0; - System1RomBank = 0; - System1BankSwitch = 0; - System1BgBankLatch = 0; - System1BgBank = 0; - NoboranbInp16Step = 0; - NoboranbInp17Step = 0; - NoboranbInp23Step = 0; - BlockgalDial1 = 0; - BlockgalDial2 = 0; - - return 0; -} - -/*============================================================================================== -Memory Handlers -===============================================================================================*/ - -static void System1BankRom() -{ - INT32 BankAddress = (System1RomBank * 0x4000) + 0x10000; - - ZetMapArea(0x8000, 0xbfff, 0, System1Rom1 + BankAddress); - - if (DecodeFunction && IsSystem2) - { - ZetMapArea(0x8000, 0xbfff, 2, System1Rom1 + BankAddress + 0x20000, System1Rom1 + BankAddress); - } - else - { - ZetMapArea(0x8000, 0xbfff, 2, System1Rom1 + BankAddress); - } -} - -static inline void System2_bankswitch_w(UINT8 d) -{ - System1RomBank = (d & 0x0c) >> 2; - System1BankRom(); - System1BankSwitch = d; -} - -static inline void System2_videoram_bank_latch_w(UINT8 d) -{ - System1BgBankLatch = d; - System1BgBank = (d >> 1) & 0x03; /* Select 4 banks of 4k, bit 2,1 */ - - // iq_132 - ZetMapMemory(System1VideoRam + System1BgBank * 0x1000, 0xe000, 0xefff, MAP_RAM); -} - -static inline void __fastcall System1SoundLatchWrite(UINT8 d) -{ - System1SoundLatch = d; - - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; -} - -static UINT8 __fastcall System1Z801PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return 0xff - System1Input[0]; - } - - case 0x04: { - return 0xff - System1Input[1]; - } - - case 0x08: { - return 0xff - System1Input[2]; - } - - case 0x0c: { - return System1Dip[0]; - } - - case 0x0d: { - return System1Dip[1]; - } - - case 0x10: { - return System1Dip[1]; - } - - case 0x11: { - return System1Dip[0]; - } - - case 0x15: { - return System1VideoMode; - } - - case 0x19: { - return System1VideoMode; - } - } - - //bprintf(PRINT_NORMAL, _T("IO Read %x\n"), a); - return 0; -} - -static UINT8 __fastcall BlockgalZ801PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return BlockgalDial1; - } - - case 0x04: { - return BlockgalDial2; - } - - case 0x08: { - return 0xff - System1Input[2]; - } - - case 0x0c: { - return System1Dip[0]; - } - - case 0x0d: { - return System1Dip[1]; - } - - case 0x10: { - return System1Dip[1]; - } - - case 0x11: { - return System1Dip[0]; - } - - case 0x15: { - return System1VideoMode; - } - - case 0x19: { - return System1VideoMode; - } - } - - //bprintf(PRINT_NORMAL, _T("IO Read %x\n"), a); - return 0; -} - -static UINT8 __fastcall NoboranbZ801PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return 0xff - System1Input[0]; - } - - case 0x04: { - return 0xff - System1Input[1]; - } - - case 0x08: { - return 0xff - System1Input[2]; - } - - case 0x0c: { - return System1Dip[0]; - } - - case 0x0d: { - return System1Dip[1]; - } - - case 0x15: { - return System1VideoMode; - } - - case 0x16: { - return NoboranbInp16Step; - } - - case 0x1c: { - return 0x80; - } - - case 0x22: { - return NoboranbInp17Step; - } - - case 0x23: { - return NoboranbInp23Step; - } - } - - //bprintf(PRINT_NORMAL, _T("IO Read %x\n"), a); - return 0; -} - -static void __fastcall System1Z801PortWrite(UINT16 a, UINT8 d) -{ - if (Sys1UsePPI) { - a &= 0x1f; - switch (a) - { - case 0x14: - case 0x15: - case 0x16: - case 0x17: - ppi8255_w(0, a & 3, d); - return; - } - return; - } - - a &= 0xff; - - switch (a) { - case 0x14: - case 0x18: - System1SoundLatchWrite(d); - return; - - case 0x15: - case 0x19: { - System1VideoMode = d; - System1FlipScreen = d & 0x80; - return; - } - case 0x1c: return; // NOP - } - - //bprintf(PRINT_NORMAL, _T("IO Write %x, %x\n"), a, d); -} - -static void __fastcall ChplftZ801PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - switch (a) - { - case 0x14: { System1SoundLatchWrite(d); return; } - case 0x15: { System2_bankswitch_w(d); return; } - } -} - -static UINT8 __fastcall ChplftZ801PortRead(UINT16 a) -{ - a &= 0xff; - switch (a) - { - case 0x00: return 0xff - System1Input[0]; - case 0x04: return 0xff - System1Input[1]; - case 0x08: return 0xff - System1Input[2]; - case 0x0c: return System1Dip[0]; - case 0x0d: return System1Dip[1]; - case 0x10: return System1Dip[1]; - case 0x15: return System1BankSwitch; - case 0x16: return System1BgBankLatch; - case 0x19: return System1BankSwitch; - } - return 0; -} - -static void __fastcall BrainZ801PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x14: - case 0x18: - System1SoundLatchWrite(d); - return; - - case 0x15: - case 0x19: { - System1VideoMode = d; - System1FlipScreen = d & 0x80; - - System1RomBank = ((d & 0x04) >> 2) + ((d & 0x40) >> 5); - System1BankRom(); - return; - } - } - - //bprintf(PRINT_NORMAL, _T("IO Write %x, %x\n"), a, d); -} - -static void __fastcall NoboranbZ801PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x14: - case 0x18: - System1SoundLatchWrite(d); - return; - - case 0x15: { - System1VideoMode = d; - System1FlipScreen = d & 0x80; - - System1RomBank = ((d & 0x04) >> 2) + ((d & 0x40) >> 5); - System1BankRom(); - return; - } - - case 0x16: { - NoboranbInp16Step = d; - return; - } - - case 0x17: { - NoboranbInp17Step = d; - return; - } - - case 0x24: { - NoboranbInp23Step = d; - return; - } - } - - //bprintf(PRINT_NORMAL, _T("IO Write %x, %x\n"), a, d); -} - -static void __fastcall System1Z801ProgWrite(UINT16 a, UINT8 d) -{ - if (a >= 0xf000 && a <= 0xf3ff) { System1BgCollisionRam[a - 0xf000] = 0x7e; return; } - if (a >= 0xf800 && a <= 0xfbff) { System1SprCollisionRam[a - 0xf800] = 0x7e; return; } - - switch (a) { - case 0xefbd: { - System1ScrollY = d; - break; - } - - case 0xeffc: { - System1ScrollX[0] = d; - break; - } - - case 0xeffd: { - System1ScrollX[1] = d; - break; - } - } - - if (a >= 0xef00 && a <= 0xefff) { - System1efRam[a - 0xef00] = d; - return; - } - -// //bprintf(PRINT_NORMAL, _T("Prog Write %x, %x\n"), a, d); -} - -static void __fastcall NoboranbZ801ProgWrite(UINT16 a, UINT8 d) -{ - if (a >= 0xc000 && a <= 0xc3ff) { System1BgCollisionRam[a - 0xc000] = 0x7e; return; } - if (a >= 0xc800 && a <= 0xcbff) { System1SprCollisionRam[a - 0xc800] = 0x7e; return; } - - switch (a) { - case 0xefbd: { - System1ScrollY = d; - break; - } - - case 0xeffc: { - System1ScrollX[0] = d; - break; - } - - case 0xeffd: { - System1ScrollX[1] = d; - break; - } - } - - if (a >= 0xef00 && a <= 0xefff) { - System1efRam[a - 0xef00] = d; - return; - } - -// //bprintf(PRINT_NORMAL, _T("Prog Write %x, %x\n"), a, d); -} - - -static UINT8 __fastcall System1Z802ProgRead(UINT16 a) -{ - switch (a) { - case 0xe000: { - return System1SoundLatch; - } - - case 0xffff: { - return System1SoundLatch; - } - } - - bprintf(PRINT_NORMAL, _T("Z80 2 Prog Read %x\n"), a); - return 0; -} - -static void __fastcall System1Z802ProgWrite(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: { - SN76496Write(0, d); - return; - } - - case 0xc000: - case 0xc001: - case 0xc002: - case 0xc003: { - SN76496Write(1, d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Z80 2 Prog Write %x, %x\n"), a, d); -} - -static void System2PPI0WriteA(UINT8 data) -{ - System1SoundLatchWrite(data); -} - -static void System2PPI0WriteB(UINT8 data) -{ - System2_bankswitch_w(data); -} - -static void System2PPI0WriteC(UINT8 data) -{ - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0x20, (data & 0x80) ? CPU_IRQSTATUS_NONE : CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - - if (!Sys1UsePPI) - System2_videoram_bank_latch_w(data); -} - -static UINT8 __fastcall System2Z801PortRead(UINT16 a) -{ - a &= 0x1f; - switch (a) - { - case 0x00: return 0xff - System1Input[0]; - case 0x04: return 0xff - System1Input[1]; - case 0x08: return 0xff - System1Input[2]; - case 0x0c: return System1Dip[0]; - case 0x0d: return System1Dip[1]; - case 0x10: return System1Dip[1]; - //case 0x15: return System1VideoMode; - //case 0x16: return System1BgBankLatch; - case 0x14: - case 0x15: - case 0x16: - case 0x17: return ppi8255_r(0, a & 3); - //case 0x19: return System1VideoMode; - } - return 0; -} - -static void __fastcall System2Z801PortWrite(UINT16 a, UINT8 d) -{ - a &= 0x1f; - switch (a) - { - case 0x14: - case 0x15: - case 0x16: - case 0x17: - ppi8255_w(0, a & 3, d); - return; - - //case 0x14: {System1SoundLatchWrite(d); return;} - //case 0x15: {System2_bankswitch_w(d); return;} - //case 0x16: {System2_videoram_bank_latch_w(d); return;} - } -} - -static void __fastcall System2Z801ProgWrite(UINT16 a, UINT8 d) -{ - if (a >= 0xf000 && a <= 0xf3ff) { System1BgCollisionRam[a - 0xf000] = 0x7e; return; } - if (a >= 0xf800 && a <= 0xfbff) { System1SprCollisionRam[a - 0xf800] = 0x7e; return; } - if (a >= 0xe000 && a <= 0xefff) - { - System1VideoRam[(0x1000*System1BgBank) + (a & 0xfff)] = d; - return; - } -} - -static UINT8 __fastcall System2Z801ProgRead(UINT16 a) -{ - if (a >= 0xe000 && a <= 0xefff) - { - return System1VideoRam[(0x1000*System1BgBank) + (a & 0xfff)]; - } - return 0; -} - -/*============================================================================================== -Driver Inits -===============================================================================================*/ - -static void CalcPenUsage() -{ - INT32 i, x, y; - UINT32 Usage; - UINT8 *dp = NULL; - - for (i = 0; i < System1NumTiles; i++) { - dp = System1Tiles + (i * 64); - Usage = 0; - for (y = 0; y < 8; y++) { - for (x = 0; x < 8; x++) { - Usage |= 1 << dp[x]; - } - - dp += 8; - } - - System1TilesPenUsage[i] = Usage; - } -} - -static INT32 TileXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 TileYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - -static INT32 System1Init(INT32 nZ80Rom1Num, INT32 nZ80Rom1Size, INT32 nZ80Rom2Num, INT32 nZ80Rom2Size, INT32 nTileRomNum, INT32 nTileRomSize, INT32 nSpriteRomNum, INT32 nSpriteRomSize, bool bReset) -{ - INT32 TilePlaneOffsets[3] = { RGN_FRAC((nTileRomSize * nTileRomNum), 0, 3), RGN_FRAC((nTileRomSize * nTileRomNum), 1, 3), RGN_FRAC((nTileRomSize * nTileRomNum), 2, 3) }; - INT32 nRet = 0, nLen, i, RomOffset; - - System1NumTiles = (((nTileRomNum * nTileRomSize) / 3) * 8) / (8 * 8); - System1SpriteRomSize = nSpriteRomNum * nSpriteRomSize; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - System1TempRom = (UINT8*)BurnMalloc(0x18000); - - // Load Z80 #1 Program roms - RomOffset = 0; - for (i = 0; i < nZ80Rom1Num; i++) { - nRet = BurnLoadRom(System1Rom1 + (i * nZ80Rom1Size), i + RomOffset, 1); if (nRet != 0) return 1; - } - - if (System1BankedRom) { - memcpy(System1TempRom, System1Rom1, 0x18000); - memset(System1Rom1, 0, 0x18000); - memcpy(System1Rom1 + 0x00000, System1TempRom + 0x00000, 0x8000); - memcpy(System1Rom1 + 0x10000, System1TempRom + 0x08000, 0x8000); - memcpy(System1Rom1 + 0x08000, System1TempRom + 0x08000, 0x8000); - memcpy(System1Rom1 + 0x18000, System1TempRom + 0x10000, 0x8000); - } - - if (DecodeFunction) DecodeFunction(); - - // Load Z80 #2 Program roms - RomOffset += nZ80Rom1Num; - for (i = 0; i < nZ80Rom2Num; i++) { - nRet = BurnLoadRom(System1Rom2 + (i * nZ80Rom2Size), i + RomOffset, 1); if (nRet != 0) return 1; - } - - // Load and decode tiles - memset(System1TempRom, 0, 0x18000); - RomOffset += nZ80Rom2Num; - for (i = 0; i < nTileRomNum; i++) { - nRet = BurnLoadRom(System1TempRom + (i * nTileRomSize), i + RomOffset, 1); - } - if (TileDecodeFunction) TileDecodeFunction(); - - GfxDecode(System1NumTiles, 3, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, System1TempRom, System1Tiles); - - CalcPenUsage(); - BurnFree(System1TempRom); - - // Load Sprite roms - RomOffset += nTileRomNum; - for (i = 0; i < nSpriteRomNum; i++) { - nRet = BurnLoadRom(System1Sprites + (i * nSpriteRomSize), i + RomOffset, 1); - } - - // Load Colour proms - if (System1ColourProms) { - RomOffset += nSpriteRomNum; - nRet = BurnLoadRom(System1PromRed, 0 + RomOffset, 1); - nRet = BurnLoadRom(System1PromGreen, 1 + RomOffset, 1); - nRet = BurnLoadRom(System1PromBlue, 2 + RomOffset, 1); - } - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetWriteHandler(System1Z801ProgWrite); - ZetSetInHandler(System1Z801PortRead); - ZetSetOutHandler(System1Z801PortWrite); - ZetMapArea(0x0000, 0x7fff, 0, System1Rom1); - ZetMapArea(0x8000, 0xbfff, 0, System1Rom1 + 0x8000); - if (DecodeFunction) { - ZetMapArea(0x0000, 0x7fff, 2, System1Fetch1, System1Rom1); - ZetMapArea(0x8000, 0xbfff, 2, System1Fetch1 + 0x8000, System1Rom1 + 0x8000); - } else { - ZetMapArea(0x0000, 0x7fff, 2, System1Rom1); - ZetMapArea(0x8000, 0xbfff, 2, System1Rom1 + 0x8000); - } - ZetMapArea(0xc000, 0xcfff, 0, System1Ram1); - ZetMapArea(0xc000, 0xcfff, 1, System1Ram1); - ZetMapArea(0xc000, 0xcfff, 2, System1Ram1); - ZetMapArea(0xd000, 0xd1ff, 0, System1SpriteRam); - ZetMapArea(0xd000, 0xd1ff, 1, System1SpriteRam); - ZetMapArea(0xd000, 0xd1ff, 2, System1SpriteRam); - ZetMapArea(0xd200, 0xd7ff, 0, System1Ram1 + 0x1000); - ZetMapArea(0xd200, 0xd7ff, 1, System1Ram1 + 0x1000); - ZetMapArea(0xd200, 0xd7ff, 2, System1Ram1 + 0x1000); - ZetMapArea(0xd800, 0xddff, 0, System1PaletteRam); - ZetMapArea(0xd800, 0xddff, 1, System1PaletteRam); - ZetMapArea(0xd800, 0xddff, 2, System1PaletteRam); - ZetMapArea(0xde00, 0xdfff, 0, System1deRam); - ZetMapArea(0xde00, 0xdfff, 1, System1deRam); - ZetMapArea(0xde00, 0xdfff, 2, System1deRam); - ZetMapArea(0xe000, 0xe7ff, 0, System1BgRam); - ZetMapArea(0xe000, 0xe7ff, 1, System1BgRam); - ZetMapArea(0xe000, 0xe7ff, 2, System1BgRam); - ZetMapArea(0xe800, 0xeeff, 0, System1VideoRam); - ZetMapArea(0xe800, 0xeeff, 1, System1VideoRam); - ZetMapArea(0xe800, 0xeeff, 2, System1VideoRam); - ZetMapArea(0xef00, 0xefff, 0, System1efRam); - ZetMapArea(0xef00, 0xefff, 2, System1efRam); - ZetMapArea(0xf000, 0xf3ff, 0, System1BgCollisionRam); - ZetMapArea(0xf000, 0xf3ff, 2, System1BgCollisionRam); - ZetMapArea(0xf400, 0xf7ff, 0, System1f4Ram); - ZetMapArea(0xf400, 0xf7ff, 1, System1f4Ram); - ZetMapArea(0xf400, 0xf7ff, 2, System1f4Ram); - ZetMapArea(0xf800, 0xfbff, 0, System1SprCollisionRam); - ZetMapArea(0xf800, 0xfbff, 2, System1SprCollisionRam); - ZetMapArea(0xfc00, 0xffff, 0, System1fcRam); - ZetMapArea(0xfc00, 0xffff, 1, System1fcRam); - ZetMapArea(0xfc00, 0xffff, 2, System1fcRam); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(System1Z802ProgRead); - ZetSetWriteHandler(System1Z802ProgWrite); - ZetMapArea(0x0000, 0x7fff, 0, System1Rom2); - ZetMapArea(0x0000, 0x7fff, 2, System1Rom2); - ZetMapArea(0x8000, 0x87ff, 0, System1Ram2); - ZetMapArea(0x8000, 0x87ff, 1, System1Ram2); - ZetMapArea(0x8000, 0x87ff, 2, System1Ram2); - ZetClose(); - - if (Sys1UsePPI) { // Regulus uses the PPI for sound - ppi8255_init(1); - PPI0PortWriteA = System2PPI0WriteA; - PPI0PortWriteC = System2PPI0WriteC; - } - - memset(SpriteOnScreenMap, 255, 256 * 256); - - System1SpriteXOffset = 1; - - nCyclesTotal[0] = 4000000 / 60; - nCyclesTotal[1] = 4000000 / 60; - - SN76489AInit(0, 2000000, 0); - SN76489AInit(1, 4000000, 1); - SN76496SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - MakeInputsFunction = System1MakeInputs; - System1Draw = System1Render; - - // Reset the driver - if (bReset) System1DoReset(); - - return 0; -} - -static INT32 System2Init(INT32 nZ80Rom1Num, INT32 nZ80Rom1Size, INT32 nZ80Rom2Num, INT32 nZ80Rom2Size, INT32 nTileRomNum, INT32 nTileRomSize, INT32 nSpriteRomNum, INT32 nSpriteRomSize, bool bReset) -{ - INT32 TilePlaneOffsets[3] = { RGN_FRAC((nTileRomSize * nTileRomNum), 0, 3), RGN_FRAC((nTileRomSize * nTileRomNum), 1, 3), RGN_FRAC((nTileRomSize * nTileRomNum), 2, 3) }; - INT32 nRet = 0, nLen, i, RomOffset; - struct BurnRomInfo ri; - - System1NumTiles = (((nTileRomNum * nTileRomSize) / 3) * 8) / (8 * 8); - System1SpriteRomSize = nSpriteRomNum * nSpriteRomSize; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - System1TempRom = (UINT8*)BurnMalloc(0x40000); - - // Load Z80 #1 Program roms - RomOffset = 0; - for (i = 0; i < nZ80Rom1Num; i++) { - nRet = BurnLoadRom(System1Rom1 + (i * nZ80Rom1Size), i + RomOffset, 1); if (nRet != 0) return 1; - BurnDrvGetRomInfo(&ri, i); - } - - if (System1BankedRom) - { - memcpy(System1TempRom, System1Rom1, 0x40000); - memset(System1Rom1, 0, 0x40000); - - if (System1BankedRom == 1) - { // Encrypted, banked - memcpy(System1Rom1 + 0x00000, System1TempRom + 0x00000, 0x8000); - memcpy(System1Rom1 + 0x10000, System1TempRom + 0x08000, 0x8000); - memcpy(System1Rom1 + 0x18000, System1TempRom + 0x10000, 0x8000); - } - - if (System1BankedRom == 2) - { // Unencrypted, banked - memcpy(System1Rom1 + 0x20000, System1TempRom + 0x00000, 0x8000); - memcpy(System1Rom1 + 0x00000, System1TempRom + 0x08000, 0x8000); - memcpy(System1Rom1 + 0x30000, System1TempRom + 0x10000, 0x8000);//fetch - memcpy(System1Rom1 + 0x10000, System1TempRom + 0x18000, 0x8000); - memcpy(System1Rom1 + 0x38000, System1TempRom + 0x20000, 0x8000);//fetch - memcpy(System1Rom1 + 0x18000, System1TempRom + 0x28000, 0x8000); - - if ((UINT32)nZ80Rom1Size == (ri.nLen * 2)) - { // last rom half the size, reload it into the last slot - memcpy (System1Rom1 + 0x18000, System1TempRom + 0x20000, 0x8000); - } - } - } - - memset(System1Rom2, 0, 0x10000); - - if (DecodeFunction) DecodeFunction(); - - // Load Z80 #2 Program roms - RomOffset += nZ80Rom1Num; - for (i = 0; i < nZ80Rom2Num; i++) { - nRet = BurnLoadRom(System1Rom2 + (i * nZ80Rom2Size), i + RomOffset, 1); if (nRet != 0) return 1; - } - - // Load and decode tiles - memset(System1TempRom, 0, 0x20000); - RomOffset += nZ80Rom2Num; - for (i = 0; i < nTileRomNum; i++) { - nRet = BurnLoadRom(System1TempRom + (i * nTileRomSize), i + RomOffset, 1); if (nRet != 0) return 1; - } - - if (TileDecodeFunction) TileDecodeFunction(); - - GfxDecode(System1NumTiles, 3, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x40, System1TempRom, System1Tiles); - - CalcPenUsage(); - BurnFree(System1TempRom); - - // Load Sprite roms - RomOffset += nTileRomNum; - for (i = 0; i < nSpriteRomNum; i++) { - nRet = BurnLoadRom(System1Sprites + (i * nSpriteRomSize), i + RomOffset, 1); - } - - // Load Colour proms - if (System1ColourProms) { - RomOffset += nSpriteRomNum; - nRet = BurnLoadRom(System1PromRed, 0 + RomOffset, 1); - nRet = BurnLoadRom(System1PromGreen, 1 + RomOffset, 1); - nRet = BurnLoadRom(System1PromBlue, 2 + RomOffset, 1); - } - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(System2Z801ProgRead); - ZetSetWriteHandler(System2Z801ProgWrite); - ZetSetInHandler(System2Z801PortRead); - ZetSetOutHandler(System2Z801PortWrite); - - ZetMapArea(0x0000, 0x7fff, 0, System1Rom1); - ZetMapArea(0x8000, 0xbfff, 0, System1Rom1 + 0x8000); - if (DecodeFunction) { - ZetMapArea(0x0000, 0x7fff, 2, System1Rom1 + 0x20000, System1Rom1); - ZetMapArea(0x8000, 0xbfff, 2, System1Rom1 + 0x30000, System1Rom1 + 0x10000); // 30 fetch, 10 for code(?) - } else { - ZetMapArea(0x0000, 0x7fff, 2, System1Rom1); - ZetMapArea(0x8000, 0xbfff, 2, System1Rom1 + 0x8000); - } - ZetMapArea(0xc000, 0xcfff, 0, System1Ram1); - ZetMapArea(0xc000, 0xcfff, 1, System1Ram1); - ZetMapArea(0xc000, 0xcfff, 2, System1Ram1); - ZetMapArea(0xd000, 0xd7ff, 0, System1SpriteRam); - ZetMapArea(0xd000, 0xd7ff, 1, System1SpriteRam); - ZetMapArea(0xd000, 0xd7ff, 2, System1SpriteRam); - ZetMapArea(0xd800, 0xdfff, 0, System1PaletteRam); - ZetMapArea(0xd800, 0xdfff, 1, System1PaletteRam); - ZetMapArea(0xd800, 0xdfff, 2, System1PaletteRam); - ZetMapArea(0xf000, 0xf3ff, 0, System1BgCollisionRam); - ZetMapArea(0xf000, 0xf3ff, 2, System1BgCollisionRam); - ZetMapArea(0xf400, 0xf7ff, 0, System1f4Ram); - ZetMapArea(0xf400, 0xf7ff, 1, System1f4Ram); - ZetMapArea(0xf400, 0xf7ff, 2, System1f4Ram); - ZetMapArea(0xf800, 0xfbff, 0, System1SprCollisionRam); - ZetMapArea(0xf800, 0xfbff, 2, System1SprCollisionRam); - ZetMapArea(0xfc00, 0xffff, 0, System1fcRam); - ZetMapArea(0xfc00, 0xffff, 1, System1fcRam); - ZetMapArea(0xfc00, 0xffff, 2, System1fcRam); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(System1Z802ProgRead); - ZetSetWriteHandler(System1Z802ProgWrite); - ZetMapArea(0x0000, 0x7fff, 0, System1Rom2); - ZetMapArea(0x0000, 0x7fff, 2, System1Rom2); - ZetMapArea(0x8000, 0x87ff, 0, System1Ram2); - ZetMapArea(0x8000, 0x87ff, 1, System1Ram2); - ZetMapArea(0x8000, 0x87ff, 2, System1Ram2); - ZetMapArea(0x8800, 0x8fff, 0, System1Ram2); - ZetMapArea(0x8800, 0x8fff, 1, System1Ram2); - ZetMapArea(0x8800, 0x8fff, 2, System1Ram2); - ZetClose(); - - memset(SpriteOnScreenMap, 255, 256 * 256); - - System1SpriteXOffset = 1; - - nCyclesTotal[0] = 4000000 / 60; - nCyclesTotal[1] = 4000000 / 60; - - SN76489AInit(0, 2000000, 0); - SN76489AInit(1, 4000000, 1); - SN76496SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - MakeInputsFunction = System1MakeInputs; - - System1BgRam = NULL; - System1SpriteXOffset = 15; - - ZetOpen(0); - ZetMemCallback(0xf000, 0xf3ff, 1); // collision ram written through write handler - ZetMemCallback(0xf800, 0xfbff, 1); // "" - ZetClose(); - - ppi8255_init(1); - PPI0PortWriteA = System2PPI0WriteA; - PPI0PortWriteB = System2PPI0WriteB; - PPI0PortWriteC = System2PPI0WriteC; - - System1Draw = System2Render; - memset(System1VideoRam, 0x00, 0x4000); // mapped through bank_latch - - // Reset the driver - if (bReset) System1DoReset(); - - IsSystem2 = 1; // for banking etc. - - return 0; -} - -static INT32 FourdwarrioInit() -{ - DecodeFunction = fdwarrio_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 BlockgalInit() -{ - INT32 nRet; - - System1MC8123Key = (UINT8*)BurnMalloc(0x2000); - BurnLoadRom(System1MC8123Key, 14, 1); - - DecodeFunction = blockgal_decode; - - nRet = System1Init(2, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); - BurnFree(System1MC8123Key); - - ZetOpen(0); - ZetSetInHandler(BlockgalZ801PortRead); - ZetClose(); - MakeInputsFunction = BlockgalMakeInputs; - - return nRet; -} - -static INT32 BrainInit() -{ - INT32 nRet; - - System1ColourProms = 1; - System1BankedRom = 1; - - nRet = System1Init(3, 0x8000, 1, 0x8000, 3, 0x4000, 3, 0x8000, 0); - - ZetOpen(0); - ZetSetOutHandler(BrainZ801PortWrite); - ZetClose(); - - System1DoReset(); - - return nRet; -} - -static INT32 BullfgtInit() -{ - DecodeFunction = bullfgtj_decode; - - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 ThetogyuInit() -{ - DecodeFunction = bullfgtj_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 FlickyInit() -{ - DecodeFunction = flicky_decode; - - return System1Init(2, 0x4000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 FlickygInit() -{ - DecodeFunction = flicky_decode; - - return System1Init(2, 0x4000, 1, 0x2000, 3, 0x4000, 2, 0x4000, 1); -} - -static INT32 Flicks1Init() -{ - DecodeFunction = flicky_decode; - - return System1Init(4, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 Flicks2Init() -{ - return System1Init(2, 0x4000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 Flicks2gInit() -{ - return System1Init(2, 0x4000, 1, 0x2000, 3, 0x4000, 2, 0x4000, 1); -} - -static INT32 GardiaInit() -{ - INT32 nRet; - - System1ColourProms = 1; - System1BankedRom = 1; - - DecodeFunction = gardia_decode; - - nRet = System1Init(3, 0x8000, 1, 0x4000, 3, 0x4000, 4, 0x8000, 0); - - ZetOpen(0); - ZetSetOutHandler(BrainZ801PortWrite); - ZetClose(); - - System1DoReset(); - - return nRet; -} - -static INT32 GardiabInit() -{ - INT32 nRet; - - System1ColourProms = 1; - System1BankedRom = 1; - - DecodeFunction = gardiab_decode; - - nRet = System1Init(3, 0x8000, 1, 0x4000, 3, 0x4000, 4, 0x8000, 0); - - ZetOpen(0); - ZetSetOutHandler(BrainZ801PortWrite); - ZetClose(); - - System1DoReset(); - - return nRet; -} - -static INT32 GardiajInit() -{ - INT32 nRet; - - System1ColourProms = 1; - System1BankedRom = 1; - - DecodeFunction = gardia_decode; - - nRet = System1Init(3, 0x8000, 1, 0x4000, 3, 0x8000, 4, 0x8000, 0); - - ZetOpen(0); - ZetSetOutHandler(BrainZ801PortWrite); - ZetClose(); - - System1DoReset(); - - return nRet; -} - -static INT32 HvymetalInit() -{ - INT32 nRet; - - System1ColourProms = 1; - System1BankedRom = 1; - - DecodeFunction = hvymetal_decode; - - nRet = System1Init(3, 0x8000, 1, 0x8000, 6, 0x4000, 4, 0x8000, 0); - - ZetOpen(0); - ZetSetOutHandler(BrainZ801PortWrite); - ZetClose(); - - System1DoReset(); - - return nRet; -} - -static INT32 ImsorryInit() -{ - DecodeFunction = imsorry_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 MrvikingInit() -{ - DecodeFunction = mrviking_decode; - - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 MyheroInit() -{ - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 SscandalInit() -{ - DecodeFunction = myheroj_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 MyheroblInit() -{ - DecodeFunction = myheroj_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 3, 0x4000, 4, 0x4000, 1); -} - -static INT32 MyherokInit() -{ - DecodeFunction = myherok_decode; - TileDecodeFunction = myherok_tile_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 3, 0x4000, 4, 0x4000, 1); -} - -static INT32 NobbInit() -{ - INT32 nRet; - - System1ColourProms = 1; - System1BankedRom = 1; - - nRet = System1Init(3, 0x8000, 1, 0x4000, 3, 0x8000, 4, 0x8000, 0); - nCyclesTotal[0] = 8000000 / 60; - System1Rom2[0x02f9] = 0x28; - - ZetOpen(0); - ZetSetWriteHandler(NoboranbZ801ProgWrite); - ZetSetInHandler(NoboranbZ801PortRead); - ZetSetOutHandler(NoboranbZ801PortWrite); - ZetMemCallback(0xc000, 0xffff, 0); - ZetMemCallback(0xc000, 0xffff, 1); - ZetMemCallback(0xc000, 0xffff, 2); - ZetMapArea(0xc000, 0xc3ff, 0, System1BgCollisionRam); - ZetMapArea(0xc000, 0xc3ff, 2, System1BgCollisionRam); - ZetMapArea(0xc400, 0xc7ff, 0, System1f4Ram); - ZetMapArea(0xc400, 0xc7ff, 1, System1f4Ram); - ZetMapArea(0xc400, 0xc7ff, 2, System1f4Ram); - ZetMapArea(0xc800, 0xcbff, 0, System1SprCollisionRam); - ZetMapArea(0xc800, 0xcbff, 2, System1SprCollisionRam); - ZetMapArea(0xcc00, 0xcfff, 0, System1fcRam); - ZetMapArea(0xcc00, 0xcfff, 1, System1fcRam); - ZetMapArea(0xcc00, 0xcfff, 2, System1fcRam); - ZetMapArea(0xd000, 0xd1ff, 0, System1SpriteRam); - ZetMapArea(0xd000, 0xd1ff, 1, System1SpriteRam); - ZetMapArea(0xd000, 0xd1ff, 2, System1SpriteRam); - ZetMapArea(0xd200, 0xd7ff, 0, System1Ram1 + 0x1000); - ZetMapArea(0xd200, 0xd7ff, 1, System1Ram1 + 0x1000); - ZetMapArea(0xd200, 0xd7ff, 2, System1Ram1 + 0x1000); - ZetMapArea(0xd800, 0xddff, 0, System1PaletteRam); - ZetMapArea(0xd800, 0xddff, 1, System1PaletteRam); - ZetMapArea(0xd800, 0xddff, 2, System1PaletteRam); - ZetMapArea(0xde00, 0xdfff, 0, System1deRam); - ZetMapArea(0xde00, 0xdfff, 1, System1deRam); - ZetMapArea(0xde00, 0xdfff, 2, System1deRam); - ZetMapArea(0xe000, 0xe7ff, 0, System1BgRam); - ZetMapArea(0xe000, 0xe7ff, 1, System1BgRam); - ZetMapArea(0xe000, 0xe7ff, 2, System1BgRam); - ZetMapArea(0xe800, 0xeeff, 0, System1VideoRam); - ZetMapArea(0xe800, 0xeeff, 1, System1VideoRam); - ZetMapArea(0xe800, 0xeeff, 2, System1VideoRam); - ZetMapArea(0xef00, 0xefff, 0, System1efRam); - ZetMapArea(0xef00, 0xefff, 2, System1efRam); - ZetMapArea(0xf000, 0xffff, 0, System1Ram1); - ZetMapArea(0xf000, 0xffff, 1, System1Ram1); - ZetMapArea(0xf000, 0xffff, 2, System1Ram1); - ZetClose(); - - System1DoReset(); - - return nRet; -} - -static INT32 Pitfall2Init() -{ - INT32 nRet; - - DecodeFunction = pitfall2_decode; - - nRet = System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); - - return nRet; -} - -static INT32 PitfalluInit() -{ - INT32 nRet; - - nRet = System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); - - return nRet; -} - -static INT32 RaflesiaInit() -{ - DecodeFunction = fdwarrio_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 RegulusInit() -{ - DecodeFunction = regulus_decode; - Sys1UsePPI = 1; - - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 RegulusuInit() -{ - Sys1UsePPI = 1; - - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 SeganinjInit() -{ - DecodeFunction = seganinj_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 SeganinuInit() -{ - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 NprincesInit() -{ - DecodeFunction = flicky_decode; - - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 NprincsoInit() -{ - DecodeFunction = nprinces_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 NprincsuInit() -{ - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 NprincsbInit() -{ - DecodeFunction = flicky_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 SpatterInit() -{ - DecodeFunction = spatter_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 StarjackInit() -{ - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 SwatInit() -{ - DecodeFunction = swat_decode; - - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 TeddybbInit() -{ - DecodeFunction = teddybb_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 TeddybboblInit() -{ - DecodeFunction = teddybb_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 3, 0x4000, 4, 0x4000, 1); -} - -static INT32 UpndownInit() -{ - DecodeFunction = nprinces_decode; - - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 UpndownuInit() -{ - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 WboyInit() -{ - DecodeFunction = astrofl_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 WboyoInit() -{ - DecodeFunction = hvymetal_decode; - - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 Wboy2Init() -{ - DecodeFunction = wboy2_decode; - - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 Wboy2uInit() -{ - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 Wboy4Init() -{ - DecodeFunction = fdwarrio_decode; - - return System1Init(2, 0x8000, 1, 0x8000, 3, 0x4000, 2, 0x8000, 1); -} - -static INT32 WboyuInit() -{ - return System1Init(3, 0x4000, 1, 0x2000, 6, 0x2000, 4, 0x4000, 1); -} - -static INT32 WmatchInit() -{ - DecodeFunction = wmatch_decode; - - return System1Init(6, 0x2000, 1, 0x2000, 6, 0x2000, 2, 0x4000, 1); -} - -static INT32 ChplftbInit() -{ - INT32 nRet; - System1ColourProms = 1; - System1BankedRom = 1; - nRet = System1Init(3, 0x8000, 1, 0x8000, 3, 0x8000, 4, 0x8000, 1); - System1RowScroll = 1; - ZetOpen(0); - - ZetMapArea(0xe7c0, 0xe7ff, 0, System1ScrollXRam); - ZetMapArea(0xe7c0, 0xe7ff, 1, System1ScrollXRam); - ZetMapArea(0xe7c0, 0xe7ff, 2, System1ScrollXRam); - - ZetMapArea(0xe000, 0xe7ff, 0, System1VideoRam); //read - ZetMapArea(0xe000, 0xe7ff, 1, System1VideoRam); //write - ZetMapArea(0xe000, 0xe7ff, 2, System1VideoRam); //fetch - - ZetMapArea(0xe800, 0xeeff, 0, System1BgRam); - ZetMapArea(0xe800, 0xeeff, 1, System1BgRam); - ZetMapArea(0xe800, 0xeeff, 2, System1BgRam); - - ZetSetInHandler(ChplftZ801PortRead); - ZetSetOutHandler(ChplftZ801PortWrite); - ZetClose(); - - return nRet; -} - - -static INT32 WbmlInit() -{ - INT32 nRet; - System1ColourProms = 1; - System1BankedRom = 1; - - DecodeFunction = wbml_decode; - - System1MC8123Key = (UINT8*)BurnMalloc(0x2000); - BurnLoadRom(System1MC8123Key, 15, 1); - - nRet = System2Init(3, 0x8000, 1, 0x8000, 3, 0x8000, 4, 0x8000, 1); - BurnFree(System1MC8123Key); - System1MC8123Key = NULL; - - return nRet; -} - -static INT32 WbmljbInit() -{ - INT32 nRet; - - System1ColourProms = 1; - System1BankedRom = 2; - - DecodeFunction = wbmljb_decode; - - nRet = System2Init(3, 0x10000, 1, 0x8000, 3, 0x8000, 4, 0x8000, 1); - - System1ScrollXRam = NULL; - - return nRet; -} - -static INT32 TokisensInit() -{ - INT32 nRet; - - System1ColourProms = 1; - System1BankedRom = 1; - - DecodeFunction = NULL; - - nRet = System2Init(3, 0x8000, 1, 0x8000, 3, 0x8000, 4, 0x8000, 1); - - System1ScrollXRam = NULL; - - return nRet; -} - -static INT32 UfosensiInit() -{ - System1RowScroll = 1; - - return WbmlInit(); -} - -static INT32 System1Exit() -{ - ZetExit(); - - SN76496Exit(); - - if (IsSystem2 || Sys1UsePPI) - ppi8255_exit(); - - GenericTilesExit(); - - BurnFree(Mem); - - System1SoundLatch = 0; - System1ScrollX[0] = System1ScrollX[1] = System1ScrollY = 0; - System1BgScrollX = 0; - System1BgScrollY = 0; - System1VideoMode = 0; - System1FlipScreen = 0; - System1RomBank = 0; - NoboranbInp16Step = 0; - NoboranbInp17Step = 0; - NoboranbInp23Step = 0; - BlockgalDial1 = 0; - BlockgalDial2 = 0; - - System1SpriteRomSize = 0; - System1NumTiles = 0; - System1SpriteXOffset = 0; - System1ColourProms = 0; - System1BankedRom = 0; - System1BankSwitch = 0; - System1BgBankLatch = 0; - System1BgBank = 0; - - DecodeFunction = NULL; - TileDecodeFunction = NULL; - MakeInputsFunction = NULL; - System1Draw = NULL; - System1RowScroll = 0; - IsSystem2 = 0; - Sys1UsePPI = 0; - - return 0; -} - -/*============================================================================================== -Graphics Rendering -===============================================================================================*/ - -static void DrawPixel(INT32 x, INT32 y, INT32 SpriteNum, INT32 Colour) -{ - INT32 xr, yr, SpriteOnScreen, dx, dy; - - dx = x; - dy = y; - if (nScreenWidth == 240) dx -= 8; - - if (x < 0 || x > 255 || y < 0 || y > 255) return; - - if (SpriteOnScreenMap[(y * 256) + x] != 255) { - SpriteOnScreen = SpriteOnScreenMap[(y * 256) + x]; - System1SprCollisionRam[SpriteOnScreen + (32 * SpriteNum)] = 0xff; - } - - SpriteOnScreenMap[(y * 256) + x] = SpriteNum; - - if (dx >= 0 && dx < nScreenWidth && dy >= 0 && dy < nScreenHeight) { - UINT16 *pPixel = pTransDraw + (dy * nScreenWidth); - pPixel[dx] = Colour; - } - - xr = ((x - System1BgScrollX) & 0xff) / 8; - yr = ((y - System1BgScrollY) & 0xff) / 8; - - if(System1Draw != System2Render) - if (System1BgRam[2 * (32 * yr + xr) + 1] & 0x10) - { - System1BgCollisionRam[0x20 + SpriteNum] = 0xff; - } -} - -static void DrawSprite(INT32 Num) -{ - INT32 Src, Bank, Height, sy, Row; - INT16 Skip; - UINT8 *SpriteBase; - UINT32 *SpritePalette; - - SpriteBase = System1SpriteRam + (0x10 * Num); - Src = (SpriteBase[7] << 8) | SpriteBase[6]; - Bank = 0x8000 * (((SpriteBase[3] & 0x80) >> 7) + ((SpriteBase[3] & 0x40) >> 5)); - Bank &= (System1SpriteRomSize - 1); - Skip = (SpriteBase[5] << 8) | SpriteBase[4]; - - Height = SpriteBase[1] - SpriteBase[0]; - SpritePalette = System1Palette + (0x10 * Num); - - sy = SpriteBase[0] + 1; - - for (Row = 0; Row < Height; Row++) { - INT32 x, y, Src2; - - Src = Src2 = Src + Skip; - x = ((SpriteBase[3] & 0x01) << 8) + SpriteBase[2] + System1SpriteXOffset; - y = sy + Row; - - x /= 2; - - while(1) { - INT32 Colour1, Colour2, Data; - - Data = System1Sprites[Bank + (Src2 & 0x7fff)]; - - if (Src & 0x8000) { - Src2--; - Colour1 = Data & 0x0f; - Colour2 = Data >> 4; - } else { - Src2++; - Colour1 = Data >> 4; - Colour2 = Data & 0x0f; - } - - if (Colour1 == 0x0f) break; - if (Colour1) DrawPixel(x, y, Num, Colour1 + (0x10 * Num)); - x++; - - if (Colour2 == 0x0f) break; - if (Colour2) DrawPixel(x, y, Num, Colour2 + (0x10 * Num)); - x++; - } - } -} - -static void System1DrawSprites() -{ - INT32 i, SpriteBottomY, SpriteTopY; - UINT8 *SpriteBase; - - if (System1SpriteRam[0] == 0xff) return; // 0xff in first byte of spriteram is all-sprite-disable mode - - memset(SpriteOnScreenMap, 255, 256 * 256); - - for (i = 0; i < 32; i++) { - SpriteBase = System1SpriteRam + (0x10 * i); - SpriteTopY = SpriteBase[0]; - SpriteBottomY = SpriteBase[1]; - if (SpriteBottomY && (SpriteBottomY - SpriteTopY > 0)) { - DrawSprite(i); - } - } -} - -static void System1DrawBgLayer(INT32 PriorityDraw) -{ - INT32 Offs, sx, sy; - - System1BgScrollX = ((System1ScrollX[0] >> 1) + ((System1ScrollX[1] & 1) << 7) + 14) & 0xff; - System1BgScrollY = (-System1ScrollY & 0xff); - - if (PriorityDraw == -1) { - for (Offs = 0; Offs < 0x800; Offs += 2) { - INT32 Code, Colour; - - Code = (System1BgRam[Offs + 1] << 8) | System1BgRam[Offs + 0]; - Code = ((Code >> 4) & 0x800) | (Code & 0x7ff); - Colour = ((Code >> 5) & 0x3f); - - sx = (Offs >> 1) % 32; - sy = (Offs >> 1) / 32; - - if (System1RowScroll) - System1BgScrollX = (System1ScrollXRam[(Offs/32) & ~1] >> 1) + ((System1ScrollXRam[(Offs/32) | 1] & 1) << 7) ; - sx = 8 * sx + System1BgScrollX; - sy = 8 * sy + System1BgScrollY; - - if (nScreenWidth == 240) sx -= 8; - - Code &= (System1NumTiles - 1); - - Render8x8Tile_Clip(pTransDraw, Code, sx , sy , Colour, 3, 512 * 2, System1Tiles); - Render8x8Tile_Clip(pTransDraw, Code, sx - 256, sy , Colour, 3, 512 * 2, System1Tiles); - Render8x8Tile_Clip(pTransDraw, Code, sx , sy - 256, Colour, 3, 512 * 2, System1Tiles); - Render8x8Tile_Clip(pTransDraw, Code, sx - 256, sy - 256, Colour, 3, 512 * 2, System1Tiles); - } - } else { - PriorityDraw <<= 3; - - for (Offs = 0; Offs < 0x800; Offs += 2) { - if ((System1BgRam[Offs + 1] & 0x08) == PriorityDraw) { - INT32 Code, Colour; - - Code = (System1BgRam[Offs + 1] << 8) | System1BgRam[Offs + 0]; - Code = ((Code >> 4) & 0x800) | (Code & 0x7ff); - Colour = ((Code >> 5) & 0x3f); - - INT32 ColourOffs = 0x40; - if (Colour >= 0x10 && Colour <= 0x1f) ColourOffs += 0x10; - if (Colour >= 0x20 && Colour <= 0x2f) ColourOffs += 0x20; - if (Colour >= 0x30 && Colour <= 0x3f) ColourOffs += 0x30; - - sx = (Offs >> 1) % 32; - sy = (Offs >> 1) / 32; - - if(System1RowScroll) - System1BgScrollX = (System1ScrollXRam[(Offs/32) & ~1] >> 1) + ((System1ScrollXRam[(Offs/32) | 1] & 1) << 7) ; - - sx = 8 * sx + System1BgScrollX; - sy = 8 * sy + System1BgScrollY; - - if (nScreenWidth == 240) sx -= 8; - - Code &= (System1NumTiles - 1); - - Render8x8Tile_Mask_Clip(pTransDraw, Code, sx , sy , Colour, 3, 0, 512 * 2, System1Tiles); - Render8x8Tile_Mask_Clip(pTransDraw, Code, sx - 256, sy , Colour, 3, 0, 512 * 2, System1Tiles); - Render8x8Tile_Mask_Clip(pTransDraw, Code, sx , sy - 256, Colour, 3, 0, 512 * 2, System1Tiles); - Render8x8Tile_Mask_Clip(pTransDraw, Code, sx - 256, sy - 256, Colour, 3, 0, 512 * 2, System1Tiles); - } - } - } -} - -static void System1DrawFgLayer(INT32 PriorityDraw) -{ - INT32 Offs, sx, sy; - - PriorityDraw <<= 3; - - for (Offs = 0; Offs < 0x700; Offs += 2) { - INT32 Code, Colour; - - if ((System1VideoRam[Offs + 1] & 0x08) == PriorityDraw) { - Code = (System1VideoRam[Offs + 1] << 8) | System1VideoRam[Offs + 0]; - Code = ((Code >> 4) & 0x800) | (Code & 0x7ff); - Colour = (Code >> 5) & 0x3f; - - sx = (Offs >> 1) % 32; - sy = (Offs >> 1) / 32; - - sx *= 8; - sy *= 8; - - if (nScreenWidth == 240) sx -= 8; - - Code %= System1NumTiles; - Code &= (System1NumTiles - 1); - - if (System1TilesPenUsage[Code] & ~1) { - Render8x8Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 3, 0, 512, System1Tiles); - } - } - } -} - -static inline UINT8 pal2bit(UINT8 bits) -{ - bits &= 3; - return (bits << 6) | (bits << 4) | (bits << 2) | bits; -} - -static inline UINT8 pal3bit(UINT8 bits) -{ - bits &= 7; - return (bits << 5) | (bits << 2) | (bits >> 1); -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal3bit(nColour >> 0); - g = pal3bit(nColour >> 3); - b = pal2bit(nColour >> 6); - - return BurnHighCol(r, g, b, 0); -} - -static INT32 System1CalcPalette() -{ - if (System1ColourProms) { - - INT32 i; - for (i = 0; i < 0x800; i++) { - INT32 bit0, bit1, bit2, bit3, r, g, b, val; - - val = System1PromRed[System1PaletteRam[i]]; - bit0 = (val >> 0) & 0x01; - bit1 = (val >> 1) & 0x01; - bit2 = (val >> 2) & 0x01; - bit3 = (val >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - val = System1PromGreen[System1PaletteRam[i]]; - bit0 = (val >> 0) & 0x01; - bit1 = (val >> 1) & 0x01; - bit2 = (val >> 2) & 0x01; - bit3 = (val >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - val = System1PromBlue[System1PaletteRam[i]]; - bit0 = (val >> 0) & 0x01; - bit1 = (val >> 1) & 0x01; - bit2 = (val >> 2) & 0x01; - bit3 = (val >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - System1Palette[i] = BurnHighCol(r, g, b, 0); - } - } else { - - for (INT32 i = 0; i < 0x800; i++) { - System1Palette[i] = CalcCol(System1PaletteRam[i]); - } - } - return 0; -} - -static void System1Render() -{ - BurnTransferClear(); - System1CalcPalette(); - System1DrawBgLayer(-1); - System1DrawFgLayer(0); - System1DrawBgLayer(0); - System1DrawSprites(); - System1DrawBgLayer(1); - System1DrawFgLayer(1); - if (System1VideoMode & 0x010) BurnTransferClear(); - BurnTransferCopy(System1Palette); -} - -static void System2DrawFgLayer() -{ - for (INT32 offs = 0; offs < 0x700; offs += 2) - { - INT32 sx, sy, code; - - sx = (offs / 2) % 32; - sy = (offs / 2) / 32; - code = System1VideoRam[offs] | (System1VideoRam[offs + 1] << 8); - code = ((code >> 4) & 0x800) | (code & 0x7ff); - sx *= 8; - sy *= 8; - Render8x8Tile_Mask_Clip(pTransDraw, code, sx , sy , ((code >> 5) & 0x3f), 3, 0, 512, System1Tiles); - Render8x8Tile_Mask_Clip(pTransDraw, code, sx - 256, sy , ((code >> 5) & 0x3f), 3, 0, 512, System1Tiles); - Render8x8Tile_Mask_Clip(pTransDraw, code, sx , sy - 256, ((code >> 5) & 0x3f), 3, 0, 512, System1Tiles); - Render8x8Tile_Mask_Clip(pTransDraw, code, sx - 256, sy - 256, ((code >> 5) & 0x3f), 3, 0, 512, System1Tiles); - } -} - -static void System2DrawBgLayer(INT32 trasp) -{ - INT32 scrollx = (System1VideoRam[0x7c0] >> 1) + ((System1VideoRam[0x7c1] & 1) << 7) - 256 + 5; - INT32 scrolly = -System1VideoRam[0x7ba]; - - for (INT32 page = 0; page < 4; page++) - { - if ((nSpriteEnable & (1 << page)) == 0) continue; - - UINT8 *source = System1VideoRam + (System1VideoRam[0x0740 + page * 2] & 0x07) * 0x800; - - INT32 startx = (page & 1) * 256 + scrollx; - INT32 starty = (page >> 1) * 256 + scrolly; - - INT32 offs = 0; - for (INT32 row = 0; row < 32 * 8; row += 8) - { - for (INT32 col = 0; col < 32 * 8; col += 8) - { - INT32 x = (startx + col) & 0x1ff; - INT32 y = (starty + row) & 0x1ff; - - if (System1RowScroll) { - System1BgScrollX = (System1ScrollXRam[((row/8) * 2) & ~1] >> 1) + ((System1ScrollXRam[((row/8) * 2) | 1] & 1) << 7); - x += System1BgScrollX; - } - - if (x > 256) x -= 512; - if (y > 224) y -= 512; - - INT32 code = source[offs * 2 + 0] + (source[offs * 2 + 1] << 8); - INT32 color = (code >> 5) & 0x3f; - INT32 priority = code & 0x800; - code = ((code >> 4) & 0x800) | (code & 0x7ff); - - if (!trasp) - { - Render8x8Tile_Clip(pTransDraw, code, x , y , color , 3, 512 * 2, System1Tiles); - Render8x8Tile_Clip(pTransDraw, code, x - 256, y , color , 3, 512 * 2, System1Tiles); - Render8x8Tile_Clip(pTransDraw, code, x , y -256 , color , 3, 512 * 2, System1Tiles); - Render8x8Tile_Clip(pTransDraw, code, x - 256, y -256 , color , 3, 512 * 2, System1Tiles); - } - else if (priority) - { - Render8x8Tile_Mask_Clip(pTransDraw, code, x , y , color, 3, 0, 512 * 2, System1Tiles); - Render8x8Tile_Mask_Clip(pTransDraw, code, x - 256, y , color, 3, 0, 512 * 2, System1Tiles); - Render8x8Tile_Mask_Clip(pTransDraw, code, x , y - 256, color, 3, 0, 512 * 2, System1Tiles); - Render8x8Tile_Mask_Clip(pTransDraw, code, x - 256, y - 256, color, 3, 0, 512 * 2, System1Tiles); - } - - offs++; - } - } - } -} - - -static void System2Render() -{ - BurnTransferClear(); - System1CalcPalette(); - if (nBurnLayer & 1) System2DrawBgLayer(0); - if (nBurnLayer & 2) System1DrawSprites(); - if (nBurnLayer & 4) System2DrawBgLayer(1); - if (nBurnLayer & 8) System2DrawFgLayer(); - if (System1VideoMode & 0x010) BurnTransferClear(); - BurnTransferCopy(System1Palette); -} - -/*============================================================================================== -Frame functions -===============================================================================================*/ - -INT32 System1Frame() -{ - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - if (System1Reset) - { - System1DoReset(); - } - - MakeInputsFunction(); - - nCyclesDone[0] = nCyclesDone[1] = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 9) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 2 || i == 4 || i == 6 || i == 8) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) System1Draw(); - - return 0; -} - -/*============================================================================================== -Scan Driver -===============================================================================================*/ - -static INT32 System1Scan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029736; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(System1ScrollX); - SCAN_VAR(System1ScrollY); - SCAN_VAR(System1BgScrollX); - SCAN_VAR(System1BgScrollY); - SCAN_VAR(System1VideoMode); - SCAN_VAR(System1FlipScreen); - SCAN_VAR(System1SoundLatch); - SCAN_VAR(System1RomBank); - SCAN_VAR(NoboranbInp16Step); - SCAN_VAR(NoboranbInp17Step); - SCAN_VAR(NoboranbInp23Step); - SCAN_VAR(BlockgalDial1); - SCAN_VAR(BlockgalDial2); - - SCAN_VAR(System1BankSwitch); - SCAN_VAR(System1BgBankLatch); - SCAN_VAR(System1BgBank); - - if (nAction & ACB_WRITE) { - if (System1BankedRom) { - ZetOpen(0); - System1BankRom(); - ZetClose(); - } - } - } - - return 0; -} - -/*============================================================================================== -Driver defs -===============================================================================================*/ - -struct BurnDriver BurnDrvFourdwarrio = { - "4dwarrio", NULL, NULL, NULL, "1985", - "4-D Warriors (315-5162)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_HORSHOOT, 0, - NULL, FourdwarrioRomInfo, FourdwarrioRomName, NULL, NULL, MyheroInputInfo, FourdwarrioDIPInfo, - FourdwarrioInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBlockgal = { - "blockgal", NULL, NULL, NULL, "1987", - "Block Gal (MC-8123B, 317-0029)\0", NULL, "Sega / Vic Tokai", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_SEGA_SYSTEM1, GBF_PUZZLE, 0, - NULL, BlockgalRomInfo, BlockgalRomName, NULL, NULL, BlockgalInputInfo, BlockgalDIPInfo, - BlockgalInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvBrain = { - "brain", NULL, NULL, NULL, "1986", - "Brain\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_HORSHOOT, 0, - NULL, BrainRomInfo, BrainRomName, NULL, NULL, MyheroInputInfo, BrainDIPInfo, - BrainInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBullfgt = { - "bullfgt", NULL, NULL, NULL, "1984", - "Bullfight (315-5065)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_MISC, 0, - NULL, BullfgtRomInfo, BullfgtRomName, NULL, NULL, MyheroInputInfo, BullfgtDIPInfo, - BullfgtInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThetogyu = { - "thetogyu", "bullfgt", NULL, NULL, "1984", - "The Togyu (315-5065, Japan)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_MISC, 0, - NULL, ThetogyuRomInfo, ThetogyuRomName, NULL, NULL, MyheroInputInfo, BullfgtDIPInfo, - ThetogyuInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlicky = { - "flicky", NULL, NULL, NULL, "1984", - "Flicky (128k Version, 315-5051)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, FlickyRomInfo, FlickyRomName, NULL, NULL, FlickyInputInfo, FlickyDIPInfo, - FlickyInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlickya = { - "flickya", "flicky", NULL, NULL, "1984", - "Flicky (128k Version, 315-5051, larger roms))\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, FlickyaRomInfo, FlickyaRomName, NULL, NULL, FlickyInputInfo, FlickyDIPInfo, - FlickygInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlickyg = { - "flickyg", "flicky", NULL, NULL, "1984", - "Flicky (128k Version, System 2, 315-5051, alt graphics)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, FlickygRomInfo, FlickygRomName, NULL, NULL, FlickyInputInfo, FlickyDIPInfo, - FlickygInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlickys1 = { - "flickys1", "flicky", NULL, NULL, "1984", - "Flicky (64k Version, 315-5051, set 2)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Flickys1RomInfo, Flickys1RomName, NULL, NULL, FlickyInputInfo, FlickyDIPInfo, - Flicks1Init, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlickys2 = { - "flickys2", "flicky", NULL, NULL, "1984", - "Flicky (128k Version, not encrypted)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Flickys2RomInfo, Flickys2RomName, NULL, NULL, FlickyInputInfo, FlickyDIPInfo, - Flicks2Init, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlickys2g = { - "flickys2g", "flicky", NULL, NULL, "1984", - "Flicky (128k Version, System 2, not encrypted, alt graphics)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Flickys2gRomInfo, Flickys2gRomName, NULL, NULL, FlickyInputInfo, FlickyDIPInfo, - Flicks2gInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFlickyo = { - "flickyo", "flicky", NULL, NULL, "1984", - "Flicky (64k Version, 315-5051, set 1)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, FlickyoRomInfo, FlickyoRomName, NULL, NULL, FlickyInputInfo, FlickyDIPInfo, - Flicks1Init, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGardia = { - "gardia", NULL, NULL, NULL, "1986", - "Gardia (317-0006)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, GardiaRomInfo, GardiaRomName, NULL, NULL, MyheroInputInfo, GardiaDIPInfo, - GardiaInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 256, 3, 4 -}; - -struct BurnDriverD BurnDrvGardiab = { - "gardiab", "gardia", NULL, NULL, "1986", - "Gardia (317-0007?, bootleg)\0", NULL, "Sega / Coreland", "System 1", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, GardiabRomInfo, GardiabRomName, NULL, NULL, MyheroInputInfo, GardiaDIPInfo, - GardiabInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 256, 3, 4 -}; - -struct BurnDriverD BurnDrvGardiaj = { - "gardiaj", "gardia", NULL, NULL, "1986", - "Gardia (Japan, 317-0006)\0", NULL, "Sega / Coreland", "System 2", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, GardiajRomInfo, GardiajRomName, NULL, NULL, MyheroInputInfo, GardiaDIPInfo, - GardiajInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvHvymetal = { - "hvymetal", NULL, NULL, NULL, "1985", - "Heavy Metal (315-5135)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, HvymetalRomInfo, HvymetalRomName, NULL, NULL, MyheroInputInfo, HvymetalDIPInfo, - HvymetalInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvImsorry = { - "imsorry", NULL, NULL, NULL, "1985", - "I'm Sorry (315-5110, US)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_MAZE, 0, - NULL, ImsorryRomInfo, ImsorryRomName, NULL, NULL, MyheroInputInfo, ImsorryDIPInfo, - ImsorryInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvImsorryj = { - "imsorryj", "imsorry", NULL, NULL, "1985", - "Gonbee no I'm Sorry (315-5110, Japan)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_MAZE, 0, - NULL, ImsorryjRomInfo, ImsorryjRomName, NULL, NULL, MyheroInputInfo, ImsorryDIPInfo, - ImsorryInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMrviking = { - "mrviking", NULL, NULL, NULL, "1984", - "Mister Viking (315-5041)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, MrvikingRomInfo, MrvikingRomName, NULL, NULL, MyheroInputInfo, MrvikingDIPInfo, - MrvikingInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvMrvikingj = { - "mrvikingj", "mrviking", NULL, NULL, "1984", - "Mister Viking (315-5041, Japan)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, MrvikingjRomInfo, MrvikingjRomName, NULL, NULL, MyheroInputInfo, MrvikngjDIPInfo, - MrvikingInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvMyhero = { - "myhero", NULL, NULL, NULL, "1985", - "My Hero (US, not encrypted)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, MyheroRomInfo, MyheroRomName, NULL, NULL, MyheroInputInfo, MyheroDIPInfo, - MyheroInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSscandal = { - "sscandal", "myhero", NULL, NULL, "1985", - "Seishun Scandal (315-5132, Japan)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, SscandalRomInfo, SscandalRomName, NULL, NULL, MyheroInputInfo, MyheroDIPInfo, - SscandalInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMyherobl = { - "myherobl", "myhero", NULL, NULL, "1985", - "My Hero (bootleg, 315-5132 encryption)\0", NULL, "bootleg", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, MyheroblRomInfo, MyheroblRomName, NULL, NULL, MyheroInputInfo, MyheroDIPInfo, - MyheroblInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMyherok = { - "myherok", "myhero", NULL, NULL, "1985", - "My Hero (Korea)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, MyherokRomInfo, MyherokRomName, NULL, NULL, MyheroInputInfo, MyheroDIPInfo, - MyherokInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNob = { - "nob", NULL, NULL, NULL, "1986", - "Noboranka (Japan)\0", NULL, "Data East Corporation", "System 1", - NULL, NULL, NULL, NULL, - BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, NobRomInfo, NobRomName, NULL, NULL, MyheroInputInfo, NobbDIPInfo, - NobbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvNobb = { - "nobb", "nob", NULL, NULL, "1986", - "Noboranka (Japan, bootleg)\0", NULL, "bootleg", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, NobbRomInfo, NobbRomName, NULL, NULL, MyheroInputInfo, NobbDIPInfo, - NobbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvPitfall2 = { - "pitfall2", NULL, NULL, NULL, "1985", - "Pitfall II (315-5093)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Pitfall2RomInfo, Pitfall2RomName, NULL, NULL, MyheroInputInfo, Pitfall2DIPInfo, - Pitfall2Init, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPitfall2a = { - "pitfall2a", "pitfall2", NULL, NULL, "1985", - "Pitfall II (315-5093, Flicky Conversion)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Pitfall2aRomInfo, Pitfall2aRomName, NULL, NULL, MyheroInputInfo, Pitfall2DIPInfo, - Pitfall2Init, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPitfall2u = { - "pitfall2u", "pitfall2", NULL, NULL, "1985", - "Pitfall II (not encrypted)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Pitfall2uRomInfo, Pitfall2uRomName, NULL, NULL, MyheroInputInfo, PitfalluDIPInfo, - PitfalluInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRaflesia = { - "raflesia", NULL, NULL, NULL, "1986", - "Rafflesia (315-5162)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, RaflesiaRomInfo, RaflesiaRomName, NULL, NULL, MyheroInputInfo, RaflesiaDIPInfo, - RaflesiaInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvRegulus = { - "regulus", NULL, NULL, NULL, "1983", - "Regulus (315-5033, rev. A)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, RegulusRomInfo, RegulusRomName, NULL, NULL, MyheroInputInfo, RegulusDIPInfo, - RegulusInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvReguluso = { - "reguluso", "regulus", NULL, NULL, "1983", - "Regulus (315-5033)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, RegulusoRomInfo, RegulusoRomName, NULL, NULL, MyheroInputInfo, RegulusoDIPInfo, - RegulusInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvRegulusu = { - "regulusu", "regulus", NULL, NULL, "1983", - "Regulus (not encrypted)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, RegulusuRomInfo, RegulusuRomName, NULL, NULL, MyheroInputInfo, RegulusDIPInfo, - RegulusuInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvSeganinj = { - "seganinj", NULL, NULL, NULL, "1985", - "Sega Ninja (315-5102)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, SeganinjRomInfo, SeganinjRomName, NULL, NULL, SeganinjInputInfo, SeganinjDIPInfo, - SeganinjInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSeganinju = { - "seganinju", "seganinj", NULL, NULL, "1985", - "Sega Ninja (not encrypted)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, SeganinjuRomInfo, SeganinjuRomName, NULL, NULL, SeganinjInputInfo, SeganinjDIPInfo, - SeganinuInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSeganinja = { - "seganinja", "seganinj", NULL, NULL, "1985", - "Sega Ninja (315-5113)\0", "needs decrypting", "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, SeganinjaRomInfo, SeganinjaRomName, NULL, NULL, SeganinjInputInfo, SeganinjDIPInfo, - SeganinjInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNinja = { - "ninja", "seganinj", NULL, NULL, "1985", - "Ninja (315-5102)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, NinjaRomInfo, NinjaRomName, NULL, NULL, SeganinjInputInfo, SeganinjDIPInfo, - SeganinjInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNprinces = { - "nprinces", "seganinj", NULL, NULL, "1985", - "Ninja Princess (315-5051, 64k Ver. bootleg?)\0", NULL, "bootleg?", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, NprincesRomInfo, NprincesRomName, NULL, NULL, SeganinjInputInfo, SeganinjDIPInfo, - NprincesInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNprinceso = { - "nprinceso", "seganinj", NULL, NULL, "1985", - "Ninja Princess (315-5098, 128k Ver.)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, NprincesoRomInfo, NprincesoRomName, NULL, NULL, SeganinjInputInfo, SeganinjDIPInfo, - NprincsoInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNprincesu = { - "nprincesu", "seganinj", NULL, NULL, "1985", - "Ninja Princess (64k Ver. not encrypted)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, NprincesuRomInfo, NprincesuRomName, NULL, NULL, SeganinjInputInfo, SeganinjDIPInfo, - NprincsuInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNprincesb = { - "nprincesb", "seganinj", NULL, NULL, "1985", - "Ninja Princess (315-5051?, 128k Ver. bootleg?)\0", NULL, "bootleg?", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, NprincesbRomInfo, NprincesbRomName, NULL, NULL, SeganinjInputInfo, SeganinjDIPInfo, - NprincsbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSpatter = { - "spatter", NULL, NULL, NULL, "1984", - "Spatter\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_MAZE, 0, - NULL, SpatterRomInfo, SpatterRomName, NULL, NULL, MyheroInputInfo, SpatterDIPInfo, - SpatterInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 240, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsanchan = { - "ssanchan", "spatter", NULL, NULL, "1984", - "Sanrin San Chan (Japan)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_MAZE, 0, - NULL, SsanchanRomInfo, SsanchanRomName, NULL, NULL, MyheroInputInfo, SpatterDIPInfo, - SpatterInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 240, 224, 4, 3 -}; - -struct BurnDriver BurnDrvStarjack = { - "starjack", NULL, NULL, NULL, "1983", - "Star Jacker (Sega)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, StarjackRomInfo, StarjackRomName, NULL, NULL, MyheroInputInfo, StarjackDIPInfo, - StarjackInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvStarjacks = { - "starjacks", "starjack", NULL, NULL, "1983", - "Star Jacker (Stern)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_VERSHOOT, 0, - NULL, StarjacksRomInfo, StarjacksRomName, NULL, NULL, MyheroInputInfo, StarjacsDIPInfo, - StarjackInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvSwat = { - "swat", NULL, NULL, NULL, "1984", - "SWAT (315-5048)\0", NULL, "Coreland / Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_SHOOT, 0, - NULL, SwatRomInfo, SwatRomName, NULL, NULL, MyheroInputInfo, SwatDIPInfo, - SwatInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTeddybb = { - "teddybb", NULL, NULL, NULL, "1985", - "TeddyBoy Blues (315-5115, New Ver.)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, TeddybbRomInfo, TeddybbRomName, NULL, NULL, MyheroInputInfo, TeddybbDIPInfo, - TeddybbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTeddybbo = { - "teddybbo", "teddybb", NULL, NULL, "1985", - "TeddyBoy Blues (315-5115, Old Ver.)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, TeddybboRomInfo, TeddybboRomName, NULL, NULL, MyheroInputInfo, TeddybbDIPInfo, - TeddybbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTeddybbobl = { - "teddybbobl", "teddybb", NULL, NULL, "1985", - "TeddyBoy Blues (bootleg)\0", NULL, "bootleg", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, TeddybboblRomInfo, TeddybboblRomName, NULL, NULL, MyheroInputInfo, TeddybbDIPInfo, - TeddybboblInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTokisens = { - "tokisens", NULL, NULL, NULL, "1987", - "Toki no Senshi - Chrono Soldier\0", NULL, "Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, tokisensRomInfo, tokisensRomName, NULL, NULL, MyheroInputInfo, TokisensDIPInfo, - TokisensInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvUpndown = { - "upndown", NULL, NULL, NULL, "1983", - "Up'n Down (315-5030)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_RACING, 0, - NULL, UpndownRomInfo, UpndownRomName, NULL, NULL, UpndownInputInfo, UpndownDIPInfo, - UpndownInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvUpndownu = { - "upndownu", "upndown", NULL, NULL, "1983", - "Up'n Down (not encrypted)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_RACING, 0, - NULL, UpndownuRomInfo, UpndownuRomName, NULL, NULL, UpndownInputInfo, UpndownDIPInfo, - UpndownuInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvWboy = { - "wboy", NULL, NULL, NULL, "1986", - "Wonder Boy (set 1, 315-5177)\0", NULL, "Sega (Escape License)", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, WboyRomInfo, WboyRomName, NULL, NULL, WboyInputInfo, WboyDIPInfo, - WboyInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWboyo = { - "wboyo", "wboy", NULL, NULL, "1986", - "Wonder Boy (set 1, 315-5135)\0", NULL, "Sega (Escape License)", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, WboyoRomInfo, WboyoRomName, NULL, NULL, WboyInputInfo, WboyDIPInfo, - WboyoInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWboy2 = { - "wboy2", "wboy", NULL, NULL, "1986", - "Wonder Boy (set 2, 315-5178)\0", NULL, "Sega (Escape License)", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Wboy2RomInfo, Wboy2RomName, NULL, NULL, WboyInputInfo, WboyDIPInfo, - Wboy2Init, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWboy2u = { - "wboy2u", "wboy", NULL, NULL, "1986", - "Wonder Boy (set 2, not encrypted)\0", NULL, "Sega (Escape License)", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Wboy2uRomInfo, Wboy2uRomName, NULL, NULL, WboyInputInfo, WboyDIPInfo, - Wboy2uInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWboy3 = { - "wboy3", "wboy", NULL, NULL, "1986", - "Wonder Boy (set 3, 315-5135)\0", NULL, "Sega (Escape License)", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Wboy3RomInfo, Wboy3RomName, NULL, NULL, WboyInputInfo, Wboy3DIPInfo, - WboyoInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWboy4 = { - "wboy4", "wboy", NULL, NULL, "1986", - "Wonder Boy (set 4, 315-5162)\0", NULL, "Sega (Escape License)", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Wboy4RomInfo, Wboy4RomName, NULL, NULL, WboyInputInfo, WboyDIPInfo, - Wboy4Init, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWboy5 = { - "wboy5", "wboy", NULL, NULL, "1986", - "Wonder Boy (set 5, bootleg)\0", NULL, "bootleg", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, Wboy5RomInfo, Wboy5RomName, NULL, NULL, WboyInputInfo, Wboy3DIPInfo, - WboyoInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWboyu = { - "wboyu", "wboy", NULL, NULL, "1986", - "Wonder Boy (not encrypted)\0", NULL, "Sega (Escape License)", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, WboyuRomInfo, WboyuRomName, NULL, NULL, WboyInputInfo, WboyuDIPInfo, - WboyuInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWbdeluxe = { - "wbdeluxe", "wboy", NULL, NULL, "1986", - "Wonder Boy Deluxe\0", NULL, "Sega (Escape License)", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, WbdeluxeRomInfo, WbdeluxeRomName, NULL, NULL, WboyInputInfo, WbdeluxeDIPInfo, - Wboy2uInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWmatch = { - "wmatch", NULL, NULL, NULL, "1984", - "Water Match (315-5064)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM1, GBF_SPORTSMISC, 0, - NULL, WmatchRomInfo, WmatchRomName, NULL, NULL, WmatchInputInfo, WmatchDIPInfo, - WmatchInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 224, 240, 3, 4 -}; - -struct BurnDriver BurnDrvChoplift = { - "choplift", NULL, NULL, NULL, "1985", - "Choplifter (8751 315-5151)\0", "The (unprotected) or (bootleg) versions work fine.", "Sega", "System 1", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, ChopliftRomInfo, ChopliftRomName, NULL, NULL, ChplftbInputInfo, ChplftbDIPInfo, - ChplftbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvChopliftu = { - "chopliftu", "choplift", NULL, NULL, "1985", - "Choplifter (unprotected)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, ChopliftuRomInfo, ChopliftuRomName, NULL, NULL, ChplftbInputInfo, ChplftbDIPInfo, - ChplftbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvChopliftbl = { - "chopliftbl", "choplift", NULL, NULL, "1985", - "Choplifter (bootleg)\0", NULL, "Sega", "System 1", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, ChopliftblRomInfo, ChopliftblRomName, NULL, NULL, ChplftbInputInfo, ChplftbDIPInfo, - ChplftbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvUfosensi = { - "ufosensi", NULL, NULL, NULL, "1988", - "Ufo Senshi Yohko Chan (MC-8123, 317-0064)\0", NULL, "Sega", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, ufosensiRomInfo, ufosensiRomName, NULL, NULL, UfosensiInputInfo, UfosensiDIPInfo, - UfosensiInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWbml = { - "wbml", NULL, NULL, NULL, "1987", - "Wonder Boy in Monster Land (Japan New Ver., MC-8123, 317-0043)\0", NULL, "Sega / Westone", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, wbmlRomInfo, wbmlRomName, NULL, NULL, MyheroInputInfo, WbmlDIPInfo, - WbmlInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWbmljb = { - "wbmljb", "wbml", NULL, NULL, "1987", - "Wonder Boy in Monster Land (Japan not encrypted)\0", NULL, "bootleg", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, wbmljbRomInfo, wbmljbRomName, NULL, NULL, MyheroInputInfo, WbmlDIPInfo, - WbmljbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWbmljo = { - "wbmljo", "wbml", NULL, NULL, "1987", - "Wonder Boy in Monster Land (Japan Old Ver., MC-8123, 317-0043)\0", NULL, "Sega / Westone", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, wbmljoRomInfo, wbmljoRomName, NULL, NULL, MyheroInputInfo, WbmlDIPInfo, - WbmlInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWbmlb = { - "wbmlb", "wbml", NULL, NULL, "1987", - "Wonder Boy in Monster Land (English bootleg set 1)\0", NULL, "bootleg", "System 2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_PLATFORM, 0, - NULL, wbmlbRomInfo, wbmlbRomName, NULL, NULL, MyheroInputInfo, WbmlDIPInfo, - WbmljbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x800, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWbmlvc = { - "wbmlvc", "wbml", NULL, NULL, "2009", - "Wonder Boy in Monster Land (English, Virtual Console)\0", NULL, "Sega", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM1, GBF_MISC, 0, - NULL, wbmlvcRomInfo, wbmlvcRomName, NULL, NULL, MyheroInputInfo, WbmlDIPInfo, - WbmljbInit, System1Exit, System1Frame, NULL, System1Scan, - NULL, 0x600, 256, 224, 4, 3 -}; - -// shtngmst and clones -// chplft parent [needs decoding] -// gardiaj/b for JacKc -// wboysys2 -// blckgalb -// dakkochn diff --git a/jan/src/burn/drv/sega/d_sys16a.cpp b/jan/src/burn/drv/sega/d_sys16a.cpp deleted file mode 100644 index 7ea6901db..000000000 --- a/jan/src/burn/drv/sega/d_sys16a.cpp +++ /dev/null @@ -1,3679 +0,0 @@ -#include "sys16.h" - -/*==================================================== -Input defs -====================================================*/ - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo System16aInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(System16a) - -static struct BurnInputInfo System16afire1InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 1" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(System16afire1) - -static struct BurnInputInfo System16afire3InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(System16afire3) - -static struct BurnInputInfo System16aDip3InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, System16Dip + 2 , "dip" }, -}; - -STDINPUTINFO(System16aDip3) - -static struct BurnInputInfo AceattacaInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort3 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort3 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort3 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort3 + 1, "p1 right" }, - {"P1 Dial Left" , BIT_DIGITAL , System16InputPort4 + 0, "p1 fire 14"}, - {"P1 Dial Right" , BIT_DIGITAL , System16InputPort4 + 1, "p1 fire 15"}, - {"P1 Block" , BIT_DIGITAL , System16InputPort0 + 6, "p1 fire 1" }, - {"P1 Select" , BIT_DIGITAL , System16InputPort1 + 4, "p1 fire 2" }, - {"P1 Attack Dir0" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 3" }, - {"P1 Attack Dir1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 4" }, - {"P1 Attack Dir2" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 5" }, - {"P1 Attack Dir3" , BIT_DIGITAL , System16InputPort1 + 3, "p1 fire 6" }, - {"P1 Attack Dir4" , BIT_DIGITAL , System16InputPort1 + 4, "p1 fire 7" }, - {"P1 Attack Dir5" , BIT_DIGITAL , System16InputPort1 + 5, "p1 fire 8" }, - {"P1 Attack Dir6" , BIT_DIGITAL , System16InputPort1 + 6, "p1 fire 9" }, - {"P1 Attack Dir7" , BIT_DIGITAL , System16InputPort1 + 7, "p1 fire 10"}, - {"P1 Attack Pow0" , BIT_DIGITAL , System16InputPort2 + 4, "p1 fire 11"}, - {"P1 Attack Pow1" , BIT_DIGITAL , System16InputPort2 + 5, "p1 fire 12"}, - {"P1 Attack Pow2" , BIT_DIGITAL , System16InputPort2 + 6, "p1 fire 13"}, - - {"P2 Up" , BIT_DIGITAL , System16InputPort3 + 6, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort3 + 7, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort3 + 4, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort3 + 5, "p2 right" }, - {"P2 Dial Left" , BIT_DIGITAL , System16InputPort4 + 2, "p2 fire 14"}, - {"P2 Dial Right" , BIT_DIGITAL , System16InputPort4 + 3, "p2 fire 15"}, - {"P2 Block" , BIT_DIGITAL , System16InputPort0 + 7, "p2 fire 1" }, - {"P2 Select" , BIT_DIGITAL , System16InputPort5 + 4, "p2 fire 2" }, - {"P2 Attack Dir0" , BIT_DIGITAL , System16InputPort5 + 0, "p2 fire 3" }, - {"P2 Attack Dir1" , BIT_DIGITAL , System16InputPort5 + 1, "p2 fire 4" }, - {"P2 Attack Dir2" , BIT_DIGITAL , System16InputPort5 + 2, "p2 fire 5" }, - {"P2 Attack Dir3" , BIT_DIGITAL , System16InputPort5 + 3, "p2 fire 6" }, - {"P2 Attack Dir4" , BIT_DIGITAL , System16InputPort5 + 4, "p2 fire 7" }, - {"P2 Attack Dir5" , BIT_DIGITAL , System16InputPort5 + 5, "p2 fire 8" }, - {"P2 Attack Dir6" , BIT_DIGITAL , System16InputPort5 + 6, "p2 fire 9" }, - {"P2 Attack Dir7" , BIT_DIGITAL , System16InputPort5 + 7, "p2 fire 10"}, - {"P2 Attack Pow0" , BIT_DIGITAL , System16InputPort6 + 4, "p2 fire 11"}, - {"P2 Attack Pow1" , BIT_DIGITAL , System16InputPort6 + 5, "p2 fire 12"}, - {"P2 Attack Pow2" , BIT_DIGITAL , System16InputPort6 + 6, "p2 fire 13"}, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Aceattaca) - -static struct BurnInputInfo MjleagueInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort3 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort3 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort3 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort3 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 7, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , System16InputPort1 + 3, "p1 fire 5" }, - A("P1 Bat Swing" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 z-axis" ), - - {"P2 Up" , BIT_DIGITAL , System16InputPort3 + 6, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort3 + 7, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort3 + 4, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort3 + 5, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 7, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 4" }, - {"P2 Fire 5" , BIT_DIGITAL , System16InputPort2 + 3, "p2 fire 5" }, - A("P2 Bat Swing" , BIT_ANALOG_REL, &System16AnalogPort1, "p2 z-axis" ), - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Mjleague) - -static struct BurnInputInfo Passsht16aInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - {"Start 3" , BIT_DIGITAL , System16InputPort0 + 6, "p3 start" }, - {"Start 4" , BIT_DIGITAL , System16InputPort0 + 7, "p4 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 1, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 0, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 2, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort1 + 6, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , System16InputPort1 + 7, "p1 fire 4" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 1, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 0, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 2, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System16InputPort2 + 6, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , System16InputPort2 + 7, "p2 fire 4" }, - - {"P3 Up" , BIT_DIGITAL , System16InputPort3 + 1, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , System16InputPort3 + 0, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , System16InputPort3 + 3, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , System16InputPort3 + 2, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort3 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort3 + 5, "p3 fire 2" }, - {"P3 Fire 3" , BIT_DIGITAL , System16InputPort3 + 6, "p3 fire 3" }, - {"P3 Fire 4" , BIT_DIGITAL , System16InputPort3 + 7, "p3 fire 4" }, - - {"P4 Up" , BIT_DIGITAL , System16InputPort4 + 1, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , System16InputPort4 + 0, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , System16InputPort4 + 3, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , System16InputPort4 + 2, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , System16InputPort4 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , System16InputPort4 + 5, "p4 fire 2" }, - {"P4 Fire 3" , BIT_DIGITAL , System16InputPort4 + 6, "p4 fire 3" }, - {"P4 Fire 4" , BIT_DIGITAL , System16InputPort4 + 7, "p4 fire 4" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Passsht16a) - -static struct BurnInputInfo QuartetInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort1 + 6, "p2 coin" }, - {"Coin 3" , BIT_DIGITAL , System16InputPort2 + 6, "p3 coin" }, - {"Coin 4" , BIT_DIGITAL , System16InputPort3 + 6, "p4 coin" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort0 + 1, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort0 + 0, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort0 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort0 + 2, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort1 + 1, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort1 + 0, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort1 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort1 + 2, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort1 + 5, "p2 fire 2" }, - - {"P3 Up" , BIT_DIGITAL , System16InputPort2 + 1, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , System16InputPort2 + 0, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , System16InputPort2 + 3, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , System16InputPort2 + 2, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort2 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort2 + 5, "p3 fire 2" }, - - {"P4 Up" , BIT_DIGITAL , System16InputPort3 + 1, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , System16InputPort3 + 0, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , System16InputPort3 + 3, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , System16InputPort3 + 2, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , System16InputPort3 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , System16InputPort3 + 5, "p4 fire 2" }, - - {"Service 1" , BIT_DIGITAL , System16InputPort0 + 7 , "service" }, - {"Service 2" , BIT_DIGITAL , System16InputPort1 + 7 , "service2" }, - {"Service 3" , BIT_DIGITAL , System16InputPort2 + 7 , "service3" }, - {"Service 4" , BIT_DIGITAL , System16InputPort3 + 7 , "service4" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Quartet) - -static struct BurnInputInfo SdiInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 1, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 0, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 2, "p1 right" }, - A("P1 Target L/R" , BIT_ANALOG_REL, &System16AnalogPort0, "mouse x-axis" ), - A("P1 Target U/D" , BIT_ANALOG_REL, &System16AnalogPort1, "mouse y-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort0 + 6, "mouse button 1"}, - - {"P2 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p2 right" }, - A("P2 Target L/R" , BIT_ANALOG_REL, &System16AnalogPort2, "p2 x-axis" ), - A("P2 Target U/D" , BIT_ANALOG_REL, &System16AnalogPort3, "p2 y-axis" ), - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort0 + 7, "p2 fire 1" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Sdi) - -static struct BurnInputInfo Sjryuko1InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - - {"Mahjong A" , BIT_DIGITAL , System16InputPort1 + 0, "mah a" }, - {"Mahjong B" , BIT_DIGITAL , System16InputPort1 + 1, "mah b" }, - {"Mahjong C" , BIT_DIGITAL , System16InputPort1 + 2, "mah c" }, - {"Mahjong D" , BIT_DIGITAL , System16InputPort1 + 3, "mah d" }, - {"Mahjong E" , BIT_DIGITAL , System16InputPort2 + 0, "mah e" }, - {"Mahjong F" , BIT_DIGITAL , System16InputPort2 + 1, "mah f" }, - {"Mahjong G" , BIT_DIGITAL , System16InputPort2 + 2, "mah g" }, - {"Mahjong H" , BIT_DIGITAL , System16InputPort2 + 3, "mah h" }, - {"Mahjong I" , BIT_DIGITAL , System16InputPort3 + 0, "mah i" }, - {"Mahjong J" , BIT_DIGITAL , System16InputPort3 + 1, "mah j" }, - {"Mahjong K" , BIT_DIGITAL , System16InputPort3 + 2, "mah k" }, - {"Mahjong L" , BIT_DIGITAL , System16InputPort3 + 3, "mah l" }, - {"Mahjong M" , BIT_DIGITAL , System16InputPort4 + 0, "mah m" }, - {"Mahjong N" , BIT_DIGITAL , System16InputPort4 + 1, "mah n" }, - {"Mahjong Kan" , BIT_DIGITAL , System16InputPort6 + 0, "mah kan" }, - {"Mahjong Pon" , BIT_DIGITAL , System16InputPort4 + 3, "mah pon" }, - {"Mahjong Chi" , BIT_DIGITAL , System16InputPort4 + 2, "mah chi" }, - {"Mahjong Reach" , BIT_DIGITAL , System16InputPort6 + 1, "mah reach" }, - {"Mahjong Ron" , BIT_DIGITAL , System16InputPort6 + 2, "mah ron" }, - {"Mahjong Bet" , BIT_DIGITAL , System16InputPort5 + 1, "mah bet" }, - {"Mahjong Last Chance", BIT_DIGITAL , System16InputPort1 + 4, "mah lc" }, - {"Mahjong Score" , BIT_DIGITAL , System16InputPort5 + 0, "mah score" }, - {"Mahjong Flip Flop" , BIT_DIGITAL , System16InputPort4 + 4, "mah ff" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Sjryuko1) - -#undef A - -/*==================================================== -Dip defs -====================================================*/ - -#define SYSTEM16A_COINAGE(dipval) \ - {0 , 0xfe, 0 , 16 , "Coin A" }, \ - {dipval, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x05, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0x0f, 0x04, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x01, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0x0f, 0x02, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0x0f, 0x03, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0x0f, 0x00, "Free Play (if coin B too) or 1C/1C" }, \ - \ - {0 , 0xfe, 0 , 16 , "Coin B" }, \ - {dipval, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x50, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0xf0, 0x40, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x10, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0xf0, 0x20, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0xf0, 0x30, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0xf0, 0x00, "Free Play (if coin A too) or 1C/1C" }, - -static struct BurnDIPInfo AceattacaDIPList[]= -{ - // Default Values - {0x2d, 0xff, 0xff, 0xff, NULL }, - {0x2e, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x2d) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x2e, 0x01, 0x01, 0x01, "Off" }, - {0x2e, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Starting Points" }, - {0x2e, 0x01, 0x0e, 0x06, "2000" }, - {0x2e, 0x01, 0x0e, 0x0a, "3000" }, - {0x2e, 0x01, 0x0e, 0x0c, "4000" }, - {0x2e, 0x01, 0x0e, 0x0e, "5000" }, - {0x2e, 0x01, 0x0e, 0x08, "6000" }, - {0x2e, 0x01, 0x0e, 0x04, "7000" }, - {0x2e, 0x01, 0x0e, 0x02, "8000" }, - {0x2e, 0x01, 0x0e, 0x00, "9000" }, -}; - -STDDIPINFO(Aceattaca) - -static struct BurnDIPInfo AfighterDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x08, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x04, "4" }, - {0x14, 0x01, 0x0c, 0x00, "Infinite" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x30, "10000 - 20000" }, - {0x14, 0x01, 0x30, 0x20, "20000 - 40000" }, - {0x14, 0x01, 0x30, 0x10, "30000 - 60000" }, - {0x14, 0x01, 0x30, 0x00, "40000 - 80000" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x40, 0x40, "Normal" }, - {0x14, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Afighter) - -static struct BurnDIPInfo AlexkiddDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Continues" }, - {0x14, 0x01, 0x01, 0x01, "Only before level 5" }, - {0x14, 0x01, 0x01, 0x00, "Unlimited" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - {0x14, 0x01, 0x0c, 0x00, "240" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x30, 0x20, "10000" }, - {0x14, 0x01, 0x30, 0x30, "20000" }, - {0x14, 0x01, 0x30, 0x10, "40000" }, - {0x14, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Timer Adjust" }, - {0x14, 0x01, 0xc0, 0x80, "70" }, - {0x14, 0x01, 0xc0, 0xc0, "60" }, - {0x14, 0x01, 0xc0, 0x40, "50" }, - {0x14, 0x01, 0xc0, 0x00, "40" }, -}; - -STDDIPINFO(Alexkidd) - -static struct BurnDIPInfo AliensynDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x11) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x0c, 0x08, "2" }, - {0x12, 0x01, 0x0c, 0x0c, "3" }, - {0x12, 0x01, 0x0c, 0x04, "4" }, - {0x12, 0x01, 0x0c, 0x00, "127" }, - - {0 , 0xfe, 0 , 4 , "Timer" }, - {0x12, 0x01, 0x30, 0x00, "150" }, - {0x12, 0x01, 0x30, 0x10, "160" }, - {0x12, 0x01, 0x30, 0x20, "170" }, - {0x12, 0x01, 0x30, 0x30, "180" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0xc0, 0x80, "Easy" }, - {0x12, 0x01, 0xc0, 0xc0, "Normal" }, - {0x12, 0x01, 0xc0, 0x40, "Hard" }, - {0x12, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Aliensyn) - -static struct BurnDIPInfo BodyslamDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, -}; - -STDDIPINFO(Bodyslam) - -static struct BurnDIPInfo FantzoneDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x08, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x04, "4" }, - {0x14, 0x01, 0x0c, 0x00, "240" }, - - {0 , 0xfe, 0 , 4 , "Extra Ship Cost" }, - {0x14, 0x01, 0x30, 0x30, "5000" }, - {0x14, 0x01, 0x30, 0x20, "10000" }, - {0x14, 0x01, 0x30, 0x10, "15000" }, - {0x14, 0x01, 0x30, 0x00, "20000" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0xc0, 0x80, "Easy" }, - {0x14, 0x01, 0xc0, 0xc0, "Normal" }, - {0x14, 0x01, 0xc0, 0x40, "Hard" }, - {0x14, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Fantzone) - -static struct BurnDIPInfo MjleagueDIPList[]= -{ - // Default Values - {0x1b, 0xff, 0xff, 0xff, NULL }, - {0x1c, 0xff, 0xff, 0xf0, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x1b) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x1c, 0x01, 0x01, 0x00, "Upright" }, - {0x1c, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1c, 0x01, 0x02, 0x02, "Off" }, - {0x1c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Starting Points" }, - {0x1c, 0x01, 0x0c, 0x0c, "2000" }, - {0x1c, 0x01, 0x0c, 0x08, "3000" }, - {0x1c, 0x01, 0x0c, 0x04, "5000" }, - {0x1c, 0x01, 0x0c, 0x00, "10000" }, - - {0 , 0xfe, 0 , 2 , "Team Select" }, - {0x1c, 0x01, 0x10, 0x02, "Off" }, - {0x1c, 0x01, 0x10, 0x10, "On" }, -}; - -STDDIPINFO(Mjleague) - -static struct BurnDIPInfo Passsht16aDIPList[]= -{ - // Default Values - {0x29, 0xff, 0xff, 0xff, NULL }, - {0x2a, 0xff, 0xff, 0xf0, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x29) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x2a, 0x01, 0x01, 0x01, "Off" }, - {0x2a, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Initial Point" }, - {0x2a, 0x01, 0x0e, 0x06, "2000" }, - {0x2a, 0x01, 0x0e, 0x0a, "3000" }, - {0x2a, 0x01, 0x0e, 0x0c, "4000" }, - {0x2a, 0x01, 0x0e, 0x0e, "5000" }, - {0x2a, 0x01, 0x0e, 0x08, "6000" }, - {0x2a, 0x01, 0x0e, 0x04, "7000" }, - {0x2a, 0x01, 0x0e, 0x02, "8000" }, - {0x2a, 0x01, 0x0e, 0x00, "9000" }, - - {0 , 0xfe, 0 , 4 , "Point Table" }, - {0x2a, 0x01, 0x30, 0x20, "Easy" }, - {0x2a, 0x01, 0x30, 0x30, "Normal" }, - {0x2a, 0x01, 0x30, 0x10, "Hard" }, - {0x2a, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x2a, 0x01, 0xc0, 0x80, "Easy" }, - {0x2a, 0x01, 0xc0, 0xc0, "Normal" }, - {0x2a, 0x01, 0xc0, 0x40, "Hard" }, - {0x2a, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Passsht16a) - -static struct BurnDIPInfo QuartetDIPList[]= -{ - // Default Values - {0x21, 0xff, 0xff, 0xff, NULL }, - {0x22, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x21) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x22, 0x01, 0x01, 0x01, "Off" }, - {0x22, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Credit Power" }, - {0x22, 0x01, 0x06, 0x04, "500" }, - {0x22, 0x01, 0x06, 0x06, "1000" }, - {0x22, 0x01, 0x06, 0x02, "2000" }, - {0x22, 0x01, 0x06, 0x00, "9000" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x22, 0x01, 0x18, 0x10, "Easy" }, - {0x22, 0x01, 0x18, 0x18, "Normal" }, - {0x22, 0x01, 0x18, 0x08, "Hard" }, - {0x22, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Coin During Game" }, - {0x22, 0x01, 0x20, 0x20, "Power" }, - {0x22, 0x01, 0x20, 0x00, "Credit" }, - - {0 , 0xfe, 0 , 2 , "Free Play" }, - {0x22, 0x01, 0x40, 0x40, "Off" }, - {0x22, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x22, 0x01, 0x80, 0x80, "Off" }, - {0x22, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Quartet) - -static struct BurnDIPInfo Quart2DIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Credit Power" }, - {0x14, 0x01, 0x06, 0x04, "500" }, - {0x14, 0x01, 0x06, 0x06, "1000" }, - {0x14, 0x01, 0x06, 0x02, "2000" }, - {0x14, 0x01, 0x06, 0x00, "9000" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x18, 0x10, "Easy" }, - {0x14, 0x01, 0x18, 0x18, "Normal" }, - {0x14, 0x01, 0x18, 0x08, "Hard" }, - {0x14, 0x01, 0x18, 0x00, "Hardest" }, -}; - -STDDIPINFO(Quart2) - -static struct BurnDIPInfo SdiDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x15) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x01, 0x01, "No" }, - {0x16, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x0c, 0x08, "2" }, - {0x16, 0x01, 0x0c, 0x0c, "3" }, - {0x16, 0x01, 0x0c, 0x04, "4" }, - {0x16, 0x01, 0x0c, 0x00, "Free" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x30, 0x20, "Easy" }, - {0x16, 0x01, 0x30, 0x30, "Normal" }, - {0x16, 0x01, 0x30, 0x10, "Hard" }, - {0x16, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0xc0, 0x80, "Every 50000" }, - {0x16, 0x01, 0xc0, 0xc0, "50000" }, - {0x16, 0x01, 0xc0, 0x40, "100000" }, - {0x16, 0x01, 0xc0, 0x00, "None" }, -}; - -STDDIPINFO(Sdi) - -static struct BurnDIPInfo ShinobiDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x15) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x16, 0x01, 0x01, 0x00, "Upright" }, - {0x16, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x0c, 0x08, "2" }, - {0x16, 0x01, 0x0c, 0x0c, "3" }, - {0x16, 0x01, 0x0c, 0x04, "5" }, - {0x16, 0x01, 0x0c, 0x00, "240" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x30, 0x20, "Easy" }, - {0x16, 0x01, 0x30, 0x30, "Normal" }, - {0x16, 0x01, 0x30, 0x10, "Hard" }, - {0x16, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Enemy Bullet Speed" }, - {0x16, 0x01, 0x40, 0x40, "Slow" }, - {0x16, 0x01, 0x40, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x16, 0x01, 0x80, 0x80, "Japanese" }, - {0x16, 0x01, 0x80, 0x00, "English" }, -}; - -STDDIPINFO(Shinobi) - -static struct BurnDIPInfo Sjryuko1DIPList[]= -{ - // Default Values - {0x1c, 0xff, 0xff, 0xff, NULL }, - {0x1d, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x1c) - - // Dip 2 -}; - -STDDIPINFO(Sjryuko1) - -static struct BurnDIPInfo TetrisDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x11) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x30, 0x20, "Easy" }, - {0x12, 0x01, 0x30, 0x30, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x00, "Hardest" }, -}; - -STDDIPINFO(Tetris) - -static struct BurnDIPInfo TimescanDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xf5, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Cocktail" }, - {0x14, 0x01, 0x01, 0x01, "Upright" }, - - {0 , 0xfe, 0 , 16 , "Bonus" }, - {0x14, 0x01, 0x1e, 0x16, "Replay 1000000/2000000" }, - {0x14, 0x01, 0x1e, 0x14, "Replay 1200000/2500000" }, - {0x14, 0x01, 0x1e, 0x12, "Replay 1500000/3000000" }, - {0x14, 0x01, 0x1e, 0x10, "Replay 2000000/4000000" }, - {0x14, 0x01, 0x1e, 0x1c, "Replay 1000000" }, - {0x14, 0x01, 0x1e, 0x1e, "Replay 1200000" }, - {0x14, 0x01, 0x1e, 0x1a, "Replay 1500000" }, - {0x14, 0x01, 0x1e, 0x18, "Replay 1800000" }, - {0x14, 0x01, 0x1e, 0x0e, "Extra Ball 100000" }, - {0x14, 0x01, 0x1e, 0x0c, "Extra Ball 200000" }, - {0x14, 0x01, 0x1e, 0x0a, "Extra Ball 300000" }, - {0x14, 0x01, 0x1e, 0x08, "Extra Ball 400000" }, - {0x14, 0x01, 0x1e, 0x06, "Extra Ball 500000" }, - {0x14, 0x01, 0x1e, 0x04, "Extra Ball 600000" }, - {0x14, 0x01, 0x1e, 0x02, "Extra Ball 700000" }, - {0x14, 0x01, 0x1e, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Match" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Pin Rebound" }, - {0x14, 0x01, 0x40, 0x40, "Well" }, - {0x14, 0x01, 0x40, 0x00, "A Little" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x14, 0x01, 0x80, 0x80, "3" }, - {0x14, 0x01, 0x80, 0x00, "5" }, - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Out Lane Pin" }, - {0x15, 0x01, 0x02, 0x02, "Near" }, - {0x15, 0x01, 0x02, 0x00, "Far" }, - - {0 , 0xfe, 0 , 4 , "Special" }, - {0x15, 0x01, 0x0c, 0x08, "7 Credits" }, - {0x15, 0x01, 0x0c, 0x0c, "3 Credits" }, - {0x15, 0x01, 0x0c, 0x04, "1 Credit" }, - {0x15, 0x01, 0x0c, 0x00, "2000000 Points" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x10, 0x00, "No" }, - {0x15, 0x01, 0x10, 0x10, "Yes" }, -}; - -STDDIPINFO(Timescan) - -static struct BurnDIPInfo Wb31DIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - SYSTEM16A_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x00, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x08, "4" }, - {0x14, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x14, 0x01, 0x10, 0x10, "5k, 10k, 18k, 30k" }, - {0x14, 0x01, 0x10, 0x00, "5k, 15k, 30k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x14, 0x01, 0x20, 0x20, "Normal" }, - {0x14, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Invincible Mode" }, - {0x14, 0x01, 0x40, 0x40, "No" }, - {0x14, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Wb31) - -#undef SYSTEM16A_COINAGE - -/*==================================================== -Rom defs -====================================================*/ - -static struct BurnRomInfo AceattacaRomDesc[] = { - { "epr-11573.43", 0x10000, 0xca116367, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11571.26", 0x10000, 0x5631d1d6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11574.42", 0x10000, 0x8d3ed7bd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11572.25", 0x10000, 0x35c27c25, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11575.95", 0x10000, 0xbab9fbf3, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11576.94", 0x10000, 0x067ed682, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11577.93", 0x10000, 0xf67cf331, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11501.10", 0x10000, 0x09179ead, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11505.11", 0x10000, 0xb67f1ecf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11502.17", 0x10000, 0x7464bae4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11506.18", 0x10000, 0xb0104def, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11503.23", 0x10000, 0x344c0692, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11507.24", 0x10000, 0xa2af710a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11504.29", 0x10000, 0x42b4a5f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11508.30", 0x10000, 0x5cbb833c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11578.12", 0x08000, 0x3d58e39a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-11579.1", 0x08000, 0x1a994135, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-11580.2", 0x08000, 0x961646ed, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-11581.4", 0x08000, 0xd271a6e5, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-11582.5", 0x08000, 0xbcbe3d8a, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0060.key", 0x02000, 0xf4ee940f, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aceattaca) -STD_ROM_FN(Aceattaca) - -static struct BurnRomInfo AfighterRomDesc[] = { - { "epr-10353", 0x08000, 0x5a757dc9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10350", 0x08000, 0xf2cd6b3f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10352", 0x08000, 0xf8abb143, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10349", 0x08000, 0x4b434c37, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10351", 0x08000, 0xede21d8d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10348", 0x08000, 0xe51e3012, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10281.95", 0x10000, 0x30e92cda, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10282.94", 0x10000, 0xb67b8910, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10283.93", 0x10000, 0xe7dbfd2d, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10285", 0x08000, 0x98aa3d04, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10289", 0x08000, 0xc59d1b98, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10286", 0x08000, 0x8da050cf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10290", 0x08000, 0x39354223, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10287", 0x08000, 0x7989b74a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10291", 0x08000, 0x6e4b245c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10288", 0x08000, 0xd3ce551a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10292", 0x08000, 0xcef289a3, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10284.12", 0x08000, 0x8ff09116, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0018.key", 0x02000, 0xfee04be8, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Afighter) -STD_ROM_FN(Afighter) - -static struct BurnRomInfo AlexkiddRomDesc[] = { - { "epr-10447.43", 0x10000, 0x29e87f71, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10445.26", 0x10000, 0x25ce5b6f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10448.42", 0x10000, 0x05baedb5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10446.25", 0x10000, 0xcd61d23c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10431.95", 0x08000, 0xa7962c39, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10432.94", 0x08000, 0xdb8cd24e, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10433.93", 0x08000, 0xe163c8c2, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10437.10", 0x08000, 0x522f7618, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10441.11", 0x08000, 0x74e3a35c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10438.17", 0x08000, 0x738a6362, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10442.18", 0x08000, 0x86cb9c14, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10439.23", 0x08000, 0xb391aca7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10443.24", 0x08000, 0x95d32635, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10440.29", 0x08000, 0x23939508, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10444.30", 0x08000, 0x82115823, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10434.12", 0x08000, 0x77141cce, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-10435.1", 0x08000, 0xad89f6e3, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-10436.2", 0x08000, 0x96c76613, SYS16_ROM_7751DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Alexkidd) -STD_ROM_FN(Alexkidd) - -static struct BurnRomInfo Alexkidd1RomDesc[] = { - { "epr-10429.43", 0x10000, 0xbdf49eca, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10427.26", 0x10000, 0xf6e3dd29, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10430.42", 0x10000, 0x89e3439f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10428.25", 0x10000, 0xdbed3210, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10431.95", 0x08000, 0xa7962c39, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10432.94", 0x08000, 0xdb8cd24e, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10433.93", 0x08000, 0xe163c8c2, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10437.10", 0x08000, 0x522f7618, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10441.11", 0x08000, 0x74e3a35c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10438.17", 0x08000, 0x738a6362, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10442.18", 0x08000, 0x86cb9c14, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10439.23", 0x08000, 0xb391aca7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10443.24", 0x08000, 0x95d32635, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10440.29", 0x08000, 0x23939508, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10444.30", 0x08000, 0x82115823, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10434.12", 0x08000, 0x77141cce, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-10435.1", 0x08000, 0xad89f6e3, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-10436.2", 0x08000, 0x96c76613, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0021.key", 0x02000, 0x85be8eac, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Alexkidd1) -STD_ROM_FN(Alexkidd1) - -static struct BurnRomInfo AliensynjoRomDesc[] = { - { "epr-10699.43", 0x08000, 0x3fd38d17, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10696.26", 0x08000, 0xd734f19f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10700.42", 0x08000, 0x3b04b252, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10697.25", 0x08000, 0xf2bc123d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10701.41", 0x08000, 0x92171751, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10698.24", 0x08000, 0xc1e4fdc0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10739.95", 0x10000, 0xa29ec207, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10740.94", 0x10000, 0x47f93015, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10741.93", 0x10000, 0x4970739c, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10709.10", 0x10000, 0xaddf0a90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10713.11", 0x10000, 0xececde3a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10710.17", 0x10000, 0x992369eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10714.18", 0x10000, 0x91bf42fb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10711.23", 0x10000, 0x29166ef6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10715.24", 0x10000, 0xa7c57384, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10712.29", 0x10000, 0x876ad019, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10716.30", 0x10000, 0x40ba1d48, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10705.12", 0x08000, 0x777b749e, SYS16_ROM_Z80PROG | BRF_ESS |BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-10706.1", 0x08000, 0xaa114acc, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-10707.2", 0x08000, 0x800c1d82, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-10708.4", 0x08000, 0x5921ef52, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0033.key", 0x02000, 0x49e882e5, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aliensynjo) -STD_ROM_FN(Aliensynjo) - -static struct BurnRomInfo Aliensyn2RomDesc[] = { - { "epr-10808", 0x08000, 0xe669929f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10806", 0x08000, 0x9f7f8fdd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10809", 0x08000, 0x9a424919, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10807", 0x08000, 0x3d2c3530, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10701", 0x08000, 0x92171751, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10698", 0x08000, 0xc1e4fdc0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "10739", 0x10000, 0xa29ec207, SYS16_ROM_TILES | BRF_GRA }, - { "10740", 0x10000, 0x47f93015, SYS16_ROM_TILES | BRF_GRA }, - { "10741", 0x10000, 0x4970739c, SYS16_ROM_TILES | BRF_GRA }, - - { "10709.b1", 0x10000, 0xaddf0a90, SYS16_ROM_SPRITES | BRF_GRA }, - { "10713.b5", 0x10000, 0xececde3a, SYS16_ROM_SPRITES | BRF_GRA }, - { "10710.b2", 0x10000, 0x992369eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "10714.b6", 0x10000, 0x91bf42fb, SYS16_ROM_SPRITES | BRF_GRA }, - { "10711.b3", 0x10000, 0x29166ef6, SYS16_ROM_SPRITES | BRF_GRA }, - { "10715.b7", 0x10000, 0xa7c57384, SYS16_ROM_SPRITES | BRF_GRA }, - { "10712.b4", 0x10000, 0x876ad019, SYS16_ROM_SPRITES | BRF_GRA }, - { "10716.b8", 0x10000, 0x40ba1d48, SYS16_ROM_SPRITES | BRF_GRA }, - - { "10705", 0x08000, 0x777b749e, SYS16_ROM_Z80PROG | BRF_ESS |BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "10706", 0x08000, 0xaa114acc, SYS16_ROM_7751DATA | BRF_SND }, - { "10707", 0x08000, 0x800c1d82, SYS16_ROM_7751DATA | BRF_SND }, - { "10708", 0x08000, 0x5921ef52, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0033.key", 0x02000, 0x49e882e5, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aliensyn2) -STD_ROM_FN(Aliensyn2) - -static struct BurnRomInfo Aliensyn5RomDesc[] = { - { "epr-10804.43", 0x08000, 0x23f78b83, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10802.26", 0x08000, 0x996768bd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10805.42", 0x08000, 0x53d7fe50, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10803.25", 0x08000, 0x0536dd33, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10732.41", 0x08000, 0xc5712bfc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10729.24", 0x08000, 0x3e520e30, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10739.95", 0x10000, 0xa29ec207, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10740.94", 0x10000, 0x47f93015, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10741.93", 0x10000, 0x4970739c, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10709.10", 0x10000, 0xaddf0a90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10713.11", 0x10000, 0xececde3a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10710.17", 0x10000, 0x992369eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10714.18", 0x10000, 0x91bf42fb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10711.23", 0x10000, 0x29166ef6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10715.24", 0x10000, 0xa7c57384, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10712.29", 0x10000, 0x876ad019, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10716.30", 0x10000, 0x40ba1d48, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10705.12", 0x08000, 0x777b749e, SYS16_ROM_Z80PROG | BRF_ESS |BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-10706.1", 0x08000, 0xaa114acc, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-10707.2", 0x08000, 0x800c1d82, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-10708.4", 0x08000, 0x5921ef52, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0037.key", 0x02000, 0x49e882e5, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aliensyn5) -STD_ROM_FN(Aliensyn5) - -static struct BurnRomInfo BodyslamRomDesc[] = { - { "epr-10066.b9", 0x08000, 0x6cd53290, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10063.b6", 0x08000, 0xdd849a16, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10067.b10", 0x08000, 0xdb22a5ce, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10064.b7", 0x08000, 0x53d6b7e0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10068.b11", 0x08000, 0x15ccc665, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10065.b8", 0x08000, 0x0e5fa314, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10321.c9", 0x08000, 0xcd3e7cba, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10322.c10", 0x08000, 0xb53d3217, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10323.c11", 0x08000, 0x915a3e61, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10012.c5", 0x08000, 0x990824e8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10016.b2", 0x08000, 0xaf5dc72f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10013.c6", 0x08000, 0x9a0919c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10017.b3", 0x08000, 0x62aafd95, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10027.c7", 0x08000, 0x3f1c57c7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10028.b4", 0x08000, 0x80d4946d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10015.c8", 0x08000, 0x582d3b6a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10019.b5", 0x08000, 0xe020c38b, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10026.b1", 0x08000, 0x123b69b8, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-10029.c1", 0x08000, 0x7e4aca83, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-10030.c2", 0x08000, 0xdcc1df0b, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-10031.c3", 0x08000, 0xea3c4472, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-10032.c4", 0x08000, 0x0aabebce, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0015.bin", 0x01000, 0x833869e2, SYS16_ROM_I8751 | BRF_PRG | BRF_OPT }, -}; - - -STD_ROM_PICK(Bodyslam) -STD_ROM_FN(Bodyslam) - -static struct BurnRomInfo DumpmtmtRomDesc[] = { - { "epr-7704a.b9", 0x08000, 0x96de6c7b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7701a.b6", 0x08000, 0x786d1009, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7705a.b10", 0x08000, 0xfc584391, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7702a.b7", 0x08000, 0x2241a8fd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7706a.b11", 0x08000, 0x6bbcc9d0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7703a.b8", 0x08000, 0xfcb0cd40, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7707a.c9", 0x08000, 0x45318738, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7708a.c10", 0x08000, 0x411be9a4, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7709a.c11", 0x08000, 0x74ceb5a8, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7715.c5", 0x08000, 0xbf47e040, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7719.b2", 0x08000, 0xfa5c5d6c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10013.c6", 0x08000, 0x9a0919c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10017.b3", 0x08000, 0x62aafd95, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7717.c7", 0x08000, 0xfa64c86d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7721.b4", 0x08000, 0x62a9143e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10015.c8", 0x08000, 0x582d3b6a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10019.b5", 0x08000, 0xe020c38b, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7710a.b1", 0x08000, 0xa19b8ba8, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-7711.c1", 0x08000, 0xefa9aabd, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7712.c2", 0x08000, 0x7bcd85cf, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7713.c3", 0x08000, 0x33f292e7, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7714.c4", 0x08000, 0x8fd48c47, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0011a.mcu", 0x01000, 0x00000000, BRF_NODUMP }, -}; - - -STD_ROM_PICK(Dumpmtmt) -STD_ROM_FN(Dumpmtmt) - -static struct BurnRomInfo FantzoneRomDesc[] = { - { "epr-7385a.43", 0x08000, 0x4091af42, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7382a.26", 0x08000, 0x77d67bfd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7386a.42", 0x08000, 0xb0a67cd0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7383a.25", 0x08000, 0x5f79b2a9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7387.41", 0x08000, 0x0acd335d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7384.24", 0x08000, 0xfd909341, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7388.95", 0x08000, 0x8eb02f6b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7389.94", 0x08000, 0x2f4f71b8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7390.93", 0x08000, 0xd90609c6, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7392.10", 0x08000, 0x5bb7c8b6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7396.11", 0x08000, 0x74ae4b57, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7393.17", 0x08000, 0x14fc7e82, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7397.18", 0x08000, 0xe05a1e25, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7394.23", 0x08000, 0x531ca13f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7398.24", 0x08000, 0x68807b49, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7535a.12", 0x08000, 0xbc1374fa, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fantzone) -STD_ROM_FN(Fantzone) - -static struct BurnRomInfo Fantzone1RomDesc[] = { - { "epr-7385.43", 0x08000, 0x5cb64450, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7382.26", 0x08000, 0x3fda7416, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7386.42", 0x08000, 0x15810ace, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7383.25", 0x08000, 0xa001e10a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7387.41", 0x08000, 0x0acd335d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7384.24", 0x08000, 0xfd909341, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7388.95", 0x08000, 0x8eb02f6b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7389.94", 0x08000, 0x2f4f71b8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7390.93", 0x08000, 0xd90609c6, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7392.10", 0x08000, 0x5bb7c8b6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7396.11", 0x08000, 0x74ae4b57, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7393.17", 0x08000, 0x14fc7e82, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7397.18", 0x08000, 0xe05a1e25, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7394.23", 0x08000, 0x531ca13f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7398.24", 0x08000, 0x68807b49, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7535.12", 0x08000, 0x0cb2126a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fantzone1) -STD_ROM_FN(Fantzone1) - -static struct BurnRomInfo FantzonepRomDesc[] = { - { "epr-7385.43", 0x08000, 0x5cb64450, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7382.26", 0x08000, 0x3fda7416, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7386.42", 0x08000, 0x15810ace, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7383.25", 0x08000, 0xa001e10a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7387.41", 0x08000, 0x0acd335d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7384.24", 0x08000, 0xfd909341, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7388.95", 0x08000, 0x8eb02f6b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7389.94", 0x08000, 0x2f4f71b8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7390.93", 0x08000, 0xd90609c6, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7392.10", 0x08000, 0x5bb7c8b6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7396.11", 0x08000, 0x74ae4b57, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7393.17", 0x08000, 0x14fc7e82, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7397.18", 0x08000, 0xe05a1e25, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7394.23", 0x08000, 0x531ca13f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7398.24", 0x08000, 0x68807b49, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7391.12", 0x08000, 0xc03e155e, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fantzonep) -STD_ROM_FN(Fantzonep) - -static struct BurnRomInfo MjleagueRomDesc[] = { - { "epr-7404.9b", 0x08000, 0xec1655b5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7401.6b", 0x08000, 0x2befa5e0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7405.10b", 0x08000, 0x7a4f4e38, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7402.7b", 0x08000, 0xb7bef762, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7406a.11b", 0x08000, 0xbb743639, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7403a.8b", 0x08000, 0x0a39a4d0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7051.9a", 0x08000, 0x10ca255a, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7052.10a", 0x08000, 0x2550db0e, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7053.11a", 0x08000, 0x5bfea038, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7055.5a", 0x08000, 0x1fb860bd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7059.2b", 0x08000, 0x3d14091d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7056.6a", 0x08000, 0xb35dd968, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7060.3b", 0x08000, 0x61bb3757, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7057.7a", 0x08000, 0x3e5a2b6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7061.4b", 0x08000, 0xc808dad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7058.8a", 0x08000, 0xb543675f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7062.5b", 0x08000, 0x9168eb47, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7054c.1b", 0x08000, 0x4443b744, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-7063.1a", 0x08000, 0x45d8908a, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7065.2a", 0x08000, 0x8c8f8cff, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7064.3a", 0x08000, 0x159f6636, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7066.4a", 0x08000, 0xf5cfa91f, SYS16_ROM_7751DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Mjleague) -STD_ROM_FN(Mjleague) - -static struct BurnRomInfo Passsht16aRomDesc[] = { - { "epr-11833.43", 0x10000, 0x5eb1405c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11832.26", 0x10000, 0x718a3fe4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11834.95", 0x10000, 0xdf4e18ab, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11835.94", 0x10000, 0x6a07acc0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11836.93", 0x10000, 0x93c74928, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11842.10", 0x10000, 0xb6e94727, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11845.11", 0x10000, 0x17e8d5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11843.17", 0x10000, 0x3e670098, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11846.18", 0x10000, 0x50eb71cc, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11844.23", 0x10000, 0x05733ca8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11847.24", 0x10000, 0x81e49697, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11837.12", 0x08000, 0x74d11552, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-11838.1", 0x08000, 0xa465cd69, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-11839.2", 0x08000, 0x99de6197, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-11840.4", 0x08000, 0x9854e8b3, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-11841.5", 0x08000, 0x1e89877e, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0071.key", 0x02000, 0xc69949ec, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Passsht16a) -STD_ROM_FN(Passsht16a) - -static struct BurnRomInfo QuartetRomDesc[] = { - { "epr-7458a.9b", 0x08000, 0x42e7b23e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7455a.6b", 0x08000, 0x01631ab2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7459a.10b", 0x08000, 0x6b540637, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7456a.7b", 0x08000, 0x31ca583e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7460.11b", 0x08000, 0xa444ea13, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7457.8b", 0x08000, 0x3b282c23, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7461.9c", 0x08000, 0xf6af07f2, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7462.10c", 0x08000, 0x7914af28, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7463.11c", 0x08000, 0x827c5603, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7465.5c", 0x08000, 0x8a1ab7d7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7469.2b", 0x08000, 0xcb65ae4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7466.6c", 0x08000, 0xb2d3f4f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7470.3b", 0x08000, 0x16fc67b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7467.7c", 0x08000, 0x0af68de2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7471.4b", 0x08000, 0x13fad5ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7468.8c", 0x08000, 0xddfd40c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7472.5b", 0x08000, 0x8e2762ec, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7464.1b", 0x08000, 0x9f291306, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-7473.1c", 0x08000, 0x06ec75fa, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7475.2c", 0x08000, 0x7abd1206, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7474.3c", 0x08000, 0xdbf853b8, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7476.4c", 0x08000, 0x5eba655a, SYS16_ROM_7751DATA | BRF_SND }, - - { "315-5194.mcu", 0x01000, 0x00000000, BRF_NODUMP }, - - { "pal16r6a.22g", 0x00104, 0x00000000, BRF_NODUMP }, // PLD - { "pal16r6a.23g", 0x00104, 0x00000000, BRF_NODUMP }, // PLD - { "pls153.8j", 0x000eb, 0x0fe1eefd, BRF_OPT }, // PLD -}; - - -STD_ROM_PICK(Quartet) -STD_ROM_FN(Quartet) - -static struct BurnRomInfo QuartetaRomDesc[] = { - { "epr-7458.9b", 0x08000, 0x0096499f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7455.6b", 0x08000, 0xda934390, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7459.10b", 0x08000, 0xd130cf61, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7456.7b", 0x08000, 0x7847149f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7460.11b", 0x08000, 0xa444ea13, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7457.8b", 0x08000, 0x3b282c23, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7461.9c", 0x08000, 0xf6af07f2, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7462.10c", 0x08000, 0x7914af28, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7463.11c", 0x08000, 0x827c5603, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7465.5c", 0x08000, 0x8a1ab7d7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7469.2b", 0x08000, 0xcb65ae4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7466.6c", 0x08000, 0xb2d3f4f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7470.3b", 0x08000, 0x16fc67b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7467.7c", 0x08000, 0x0af68de2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7471.4b", 0x08000, 0x13fad5ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7468.8c", 0x08000, 0xddfd40c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7472.5b", 0x08000, 0x8e2762ec, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7464.1b", 0x08000, 0x9f291306, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-7473.1c", 0x08000, 0x06ec75fa, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7475.2c", 0x08000, 0x7abd1206, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7474.3c", 0x08000, 0xdbf853b8, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7476.4c", 0x08000, 0x5eba655a, SYS16_ROM_7751DATA | BRF_SND }, - - { "315-5194.mcu", 0x01000, 0x00000000, BRF_NODUMP }, - - { "pal16r6a.22g", 0x00104, 0x00000000, BRF_NODUMP }, // PLD - { "pal16r6a.23g", 0x00104, 0x00000000, BRF_NODUMP }, // PLD - { "pls153.8j", 0x000eb, 0x0fe1eefd, BRF_OPT }, // PLD -}; - - -STD_ROM_PICK(Quarteta) -STD_ROM_FN(Quarteta) - -static struct BurnRomInfo Quartet2RomDesc[] = { - { "epr-7695.b9", 0x08000, 0x67177cd8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7692.b6", 0x08000, 0x50f50b08, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7696.b10", 0x08000, 0x4273c3b7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7693.b7", 0x08000, 0x0aa337bb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7697.b11", 0x08000, 0x3a6a375d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7694.b8", 0x08000, 0xd87b2ca2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7698.c9", 0x08000, 0x547a6058, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7699.c10", 0x08000, 0x77ec901d, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7700.c11", 0x08000, 0x7e348cce, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7465.5c", 0x08000, 0x8a1ab7d7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7469.2b", 0x08000, 0xcb65ae4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7466.6c", 0x08000, 0xb2d3f4f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7470.3b", 0x08000, 0x16fc67b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7467.7c", 0x08000, 0x0af68de2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7471.4b", 0x08000, 0x13fad5ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7468.8c", 0x08000, 0xddfd40c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7472.5b", 0x08000, 0x8e2762ec, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7464.1b", 0x08000, 0x9f291306, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-7473.1c", 0x08000, 0x06ec75fa, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7475.2c", 0x08000, 0x7abd1206, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7474.3c", 0x08000, 0xdbf853b8, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7476.4c", 0x08000, 0x5eba655a, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0010.bin", 0x01000, 0x8c2033ea, SYS16_ROM_I8751 | BRF_PRG | BRF_OPT }, -}; - - -STD_ROM_PICK(Quartet2) -STD_ROM_FN(Quartet2) - -static struct BurnRomInfo Quartet2aRomDesc[] = { - { "epr-7728.b9", 0x08000, 0x56a8c88e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7725.b6", 0x08000, 0xee15fcc9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7729.b10", 0x08000, 0xbc242123, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7726.b7", 0x08000, 0x9d1c48e7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7697.b11", 0x08000, 0x3a6a375d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-7694.b8", 0x08000, 0xd87b2ca2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-7698.c9", 0x08000, 0x547a6058, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7699.c10", 0x08000, 0x77ec901d, SYS16_ROM_TILES | BRF_GRA }, - { "epr-7700.c11", 0x08000, 0x7e348cce, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-7465.5c", 0x08000, 0x8a1ab7d7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7469.2b", 0x08000, 0xcb65ae4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7466.6c", 0x08000, 0xb2d3f4f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7470.3b", 0x08000, 0x16fc67b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7467.7c", 0x08000, 0x0af68de2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7471.4b", 0x08000, 0x13fad5ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7468.8c", 0x08000, 0xddfd40c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-7472.5b", 0x08000, 0x8e2762ec, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-7464.1b", 0x08000, 0x9f291306, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-7473.1c", 0x08000, 0x06ec75fa, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7475.2c", 0x08000, 0x7abd1206, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7474.3c", 0x08000, 0xdbf853b8, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-7476.4c", 0x08000, 0x5eba655a, SYS16_ROM_7751DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Quartet2a) -STD_ROM_FN(Quartet2a) - -static struct BurnRomInfo SdiRomDesc[] = { - { "epr-10970.43", 0x08000, 0xb8fa4a2c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10968.26", 0x08000, 0xa3f97793, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10971.42", 0x08000, 0xc44a0328, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10969.25", 0x08000, 0x455d15bd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10755.41", 0x08000, 0x405e3969, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10752.24", 0x08000, 0x77453740, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10756.95", 0x10000, 0x44d8a506, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10757.94", 0x10000, 0x497e1740, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10758.93", 0x10000, 0x61d61486, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10760.10", 0x10000, 0x30e2c50a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10763.11", 0x10000, 0x794e3e8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10761.17", 0x10000, 0x6a8b3fd0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10764.18", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10762.23", 0x10000, 0xb9de3aeb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10765.24", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10759.12", 0x08000, 0xd7f9649f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0027.key", 0x02000, 0x6f022730, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sdi) -STD_ROM_FN(Sdi) - -static struct BurnRomInfo SdiaRomDesc[] = { - { "epr-10881.43", 0x08000, 0x3455a6a0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10879.26", 0x08000, 0x3ec416de, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10882.42", 0x08000, 0xf2ac1cec, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10880.25", 0x08000, 0x67e088a2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10755.41", 0x08000, 0x405e3969, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10752.24", 0x08000, 0x77453740, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10756.95", 0x10000, 0x44d8a506, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10757.94", 0x10000, 0x497e1740, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10758.93", 0x10000, 0x61d61486, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10760.10", 0x10000, 0x30e2c50a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10763.11", 0x10000, 0x794e3e8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10761.17", 0x10000, 0x6a8b3fd0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10764.18", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10762.23", 0x10000, 0xb9de3aeb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10765.24", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10759.12", 0x08000, 0xd7f9649f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0027.key", 0x02000, 0x6f022730, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sdia) -STD_ROM_FN(Sdia) - -static struct BurnRomInfo ShinobiRomDesc[] = { - { "epr-12010.43", 0x10000, 0x7df7f4a2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12008.26", 0x10000, 0xf5ae64cd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12011.42", 0x10000, 0x9d46e707, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12009.25", 0x10000, 0x7961d07e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11264.95", 0x10000, 0x46627e7d, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11265.94", 0x10000, 0x87d0f321, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11266.93", 0x10000, 0xefb4af87, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11290.10", 0x10000, 0x611f413a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11294.11", 0x10000, 0x5eb00fc1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11291.17", 0x10000, 0x3c0797c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11295.18", 0x10000, 0x25307ef8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11292.23", 0x10000, 0xc29ac34e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11296.24", 0x10000, 0x04a437f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11293.29", 0x10000, 0x41f41063, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11297.30", 0x10000, 0xb6e1fd72, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11267.12", 0x08000, 0xdd50b745, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-11268.1", 0x08000, 0x6d7966da, SYS16_ROM_7751DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shinobi) -STD_ROM_FN(Shinobi) - -static struct BurnRomInfo Shinobi1RomDesc[] = { - { "epr-11262.42", 0x10000, 0xd4b8df12, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11260.27", 0x10000, 0x2835c95d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11263.43", 0x10000, 0xa2a620bd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11261.25", 0x10000, 0xa3ceda52, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11264.95", 0x10000, 0x46627e7d, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11265.94", 0x10000, 0x87d0f321, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11266.93", 0x10000, 0xefb4af87, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11290.10", 0x10000, 0x611f413a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11294.11", 0x10000, 0x5eb00fc1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11291.17", 0x10000, 0x3c0797c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11295.18", 0x10000, 0x25307ef8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11292.23", 0x10000, 0xc29ac34e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11296.24", 0x10000, 0x04a437f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11293.29", 0x10000, 0x41f41063, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11297.30", 0x10000, 0xb6e1fd72, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11267.12", 0x08000, 0xdd50b745, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-11268.1", 0x08000, 0x6d7966da, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0050.key", 0x02000, 0x82c39ced, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Shinobi1) -STD_ROM_FN(Shinobi1) - -static struct BurnRomInfo Shinobi1dRomDesc[] = { - { "bootleg_epr-11262.42", 0x10000, 0x9a54a498, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11260.27", 0x10000, 0x8f571c5f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11263.43", 0x10000, 0xa2a620bd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11261.25", 0x10000, 0xa3ceda52, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11264.95", 0x10000, 0x46627e7d, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11265.94", 0x10000, 0x87d0f321, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11266.93", 0x10000, 0xefb4af87, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11290.10", 0x10000, 0x611f413a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11294.11", 0x10000, 0x5eb00fc1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11291.17", 0x10000, 0x3c0797c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11295.18", 0x10000, 0x25307ef8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11292.23", 0x10000, 0xc29ac34e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11296.24", 0x10000, 0x04a437f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11293.29", 0x10000, 0x41f41063, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11297.30", 0x10000, 0xb6e1fd72, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11267.12", 0x08000, 0xdd50b745, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-11268.1", 0x08000, 0x6d7966da, SYS16_ROM_7751DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shinobi1d) -STD_ROM_FN(Shinobi1d) - -static struct BurnRomInfo ShinoblsRomDesc[] = { - { "b3", 0x10000, 0x38e59646, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "b1", 0x10000, 0x8529d192, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "b4", 0x10000, 0xa2a620bd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "b2", 0x10000, 0xa3ceda52, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "b5", 0x10000, 0x46627e7d, SYS16_ROM_TILES | BRF_GRA }, - { "b6", 0x10000, 0x87d0f321, SYS16_ROM_TILES | BRF_GRA }, - { "b7", 0x10000, 0xefb4af87, SYS16_ROM_TILES | BRF_GRA }, - - { "b10", 0x10000, 0x611f413a, SYS16_ROM_SPRITES | BRF_GRA }, - { "b14", 0x10000, 0x5eb00fc1, SYS16_ROM_SPRITES | BRF_GRA }, - { "b11", 0x10000, 0x3c0797c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "b15", 0x10000, 0x25307ef8, SYS16_ROM_SPRITES | BRF_GRA }, - { "b12", 0x10000, 0xc29ac34e, SYS16_ROM_SPRITES | BRF_GRA }, - { "b16", 0x10000, 0x04a437f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "b13", 0x10000, 0x7e98bd36, SYS16_ROM_SPRITES | BRF_GRA }, - { "b17", 0x10000, 0x0315cf42, SYS16_ROM_SPRITES | BRF_GRA }, - - { "b8", 0x08000, 0xdd50b745, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "b9", 0x08000, 0x6d7966da, SYS16_ROM_7751DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shinobls) -STD_ROM_FN(Shinobls) - -static struct BurnRomInfo ShinoblbRomDesc[] = { - { "4.3k", 0x10000, 0xc178a39c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "2.3n", 0x10000, 0x5ad8ebf2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "5.2k", 0x10000, 0xa2a620bd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "3.2n", 0x10000, 0xa3ceda52, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "8.3b", 0x10000, 0x46627e7d, SYS16_ROM_TILES | BRF_GRA }, - { "7.4b", 0x10000, 0x87d0f321, SYS16_ROM_TILES | BRF_GRA }, - { "6.5b", 0x10000, 0xefb4af87, SYS16_ROM_TILES | BRF_GRA }, - - { "9.6r", 0x10000, 0x611f413a, SYS16_ROM_SPRITES | BRF_GRA }, - { "13.8r", 0x10000, 0x5eb00fc1, SYS16_ROM_SPRITES | BRF_GRA }, - { "10.6q", 0x10000, 0x3c0797c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "14.8q", 0x10000, 0x25307ef8, SYS16_ROM_SPRITES | BRF_GRA }, - { "11.6p", 0x10000, 0xc29ac34e, SYS16_ROM_SPRITES | BRF_GRA }, - { "15.8p", 0x10000, 0x04a437f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "12.6n", 0x10000, 0x41f41063, SYS16_ROM_SPRITES | BRF_GRA }, - { "16.8n", 0x10000, 0xb6e1fd72, SYS16_ROM_SPRITES | BRF_GRA }, - - { "1.5s", 0x08000, 0xdd50b745, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "b9", 0x08000, 0x6d7966da, SYS16_ROM_7751DATA | BRF_SND }, - - { "17.6u", 0x08000, 0xb7a6890c, BRF_SND | BRF_OPT }, -}; - - -STD_ROM_PICK(Shinoblb) -STD_ROM_FN(Shinoblb) - -static struct BurnRomInfo Sjryuko1RomDesc[] = { - { "epr-12251.43", 0x08000, 0x1af3cd0b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12249.26", 0x08000, 0x743d467d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12252.42", 0x08000, 0x7ae309d6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12250.25", 0x08000, 0x52c40f19, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "12224-95.b9", 0x08000, 0xeac17ba1, SYS16_ROM_TILES | BRF_GRA }, - { "12225-94.b10", 0x08000, 0x2310fc98, SYS16_ROM_TILES | BRF_GRA }, - { "12226-93.b11", 0x08000, 0x210e6999, SYS16_ROM_TILES | BRF_GRA }, - - { "12232-10.b1", 0x10000, 0x0adec62b, SYS16_ROM_SPRITES | BRF_GRA }, - { "12236-11.b5", 0x10000, 0x286b9af8, SYS16_ROM_SPRITES | BRF_GRA }, - { "12233-17.b2", 0x10000, 0x3e45969c, SYS16_ROM_SPRITES | BRF_GRA }, - { "12237-18.b6", 0x10000, 0xe5058e96, SYS16_ROM_SPRITES | BRF_GRA }, - { "12234-23.b3", 0x10000, 0x8c8d54ef, SYS16_ROM_SPRITES | BRF_GRA }, - { "12238-24.b7", 0x10000, 0x7ada3304, SYS16_ROM_SPRITES | BRF_GRA }, - { "12235-29.b4", 0x10000, 0xfa45d511, SYS16_ROM_SPRITES | BRF_GRA }, - { "12239-30.b8", 0x10000, 0x91f70c8b, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12227.12", 0x08000, 0x5b12409d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-12228.1", 0x08000, 0x6b2e6aef, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-12229.2", 0x08000, 0xb7aa015c, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-12230.4", 0x08000, 0xd0f61fd4, SYS16_ROM_7751DATA | BRF_SND }, - { "epr-12231.5", 0x08000, 0x780bdc57, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-5021.key", 0x02000, 0xc3e32937, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sjryuko1) -STD_ROM_FN(Sjryuko1) - -static struct BurnRomInfo TetrisRomDesc[] = { - { "epr-12201.rom", 0x08000, 0x338e9b51, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12200.rom", 0x08000, 0xfb058779, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12202.rom", 0x10000, 0x2f7da741, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12203.rom", 0x10000, 0xa6e58ec5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12204.rom", 0x10000, 0x0ae98e23, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12169.b1", 0x08000, 0xdacc6165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12170.b5", 0x08000, 0x87354e42, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12205.rom", 0x08000, 0x6695dc99, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0093.key", 0x02000, 0xe0064442, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Tetris) -STD_ROM_FN(Tetris) - -static struct BurnRomInfo TetrisdRomDesc[] = { - { "bootleg_epr-12201.rom", 0x08000, 0x0b694740, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12200.rom", 0x08000, 0x343c0670, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12202.rom", 0x10000, 0x2f7da741, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12203.rom", 0x10000, 0xa6e58ec5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12204.rom", 0x10000, 0x0ae98e23, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12169.b1", 0x08000, 0xdacc6165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12170.b5", 0x08000, 0x87354e42, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12205.rom", 0x08000, 0x6695dc99, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Tetrisd) -STD_ROM_FN(Tetrisd) - -static struct BurnRomInfo Tetris3RomDesc[] = { - { "epr-12201a.43", 0x08000, 0x9250e5cf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12200a.26", 0x08000, 0x85d4b0ff, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12202.rom", 0x10000, 0x2f7da741, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12203.rom", 0x10000, 0xa6e58ec5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12204.rom", 0x10000, 0x0ae98e23, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12169.b1", 0x08000, 0xdacc6165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12170.b5", 0x08000, 0x87354e42, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12205.rom", 0x08000, 0x6695dc99, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0093a.key", 0x02000, 0x7ca4a8ee, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Tetris3) -STD_ROM_FN(Tetris3) - -static struct BurnRomInfo Tetris3dRomDesc[] = { - { "bootleg_epr-12201a.43", 0x08000, 0x1d88bd84, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12200a.26", 0x08000, 0x1ba35f78, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12202.rom", 0x10000, 0x2f7da741, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12203.rom", 0x10000, 0xa6e58ec5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12204.rom", 0x10000, 0x0ae98e23, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12169.b1", 0x08000, 0xdacc6165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12170.b5", 0x08000, 0x87354e42, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12205.rom", 0x08000, 0x6695dc99, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Tetris3d) -STD_ROM_FN(Tetris3d) - -static struct BurnRomInfo Timescan1RomDesc[] = { - { "epr-10540a.43", 0x08000, 0x76848b0b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10537a.26", 0x08000, 0x4ddc434a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10541.42", 0x08000, 0xcc6d945e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10538.25", 0x08000, 0x68379473, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10542.41", 0x08000, 0x10217dfa, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10539.24", 0x08000, 0x10943b2e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10543.95", 0x08000, 0x07dccc37, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10544.94", 0x08000, 0x84fb9a3a, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10545.93", 0x08000, 0xc8694bc0, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10548.10", 0x08000, 0xaa150735, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10552.11", 0x08000, 0x6fcbb9f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10549.17", 0x08000, 0x2f59f067, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10553.18", 0x08000, 0x8a220a9f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10550.23", 0x08000, 0xf05069ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10554.24", 0x08000, 0xdc64f809, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10551.29", 0x08000, 0x435d811f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10555.30", 0x08000, 0x2143c471, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10546.12", 0x08000, 0x1ebee5cc, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "7751.bin", 0x00400, 0x6a9534fc, SYS16_ROM_7751PROG | BRF_ESS | BRF_PRG }, - - { "epr-10547.1", 0x08000, 0xd24ffc4b, SYS16_ROM_7751DATA | BRF_SND }, - - { "317-0024.key", 0x02000, 0x0e64a504, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Timescan1) -STD_ROM_FN(Timescan1) - -static struct BurnRomInfo Wb31RomDesc[] = { - { "epr-12084.bin", 0x10000, 0xb6deb654, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12082.bin", 0x10000, 0x38dc5b15, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12085.bin", 0x10000, 0x0962098b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12083.bin", 0x10000, 0x3d631a8e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12086.bin", 0x10000, 0x45b949df, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12087.bin", 0x10000, 0x6f0396b7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12088.bin", 0x10000, 0xba8c0749, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12089.bin", 0x08000, 0x8321eb0b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0084.key", 0x02000, 0x2c58dafa, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb31) -STD_ROM_FN(Wb31) - -static struct BurnRomInfo Wb31dRomDesc[] = { - { "bootleg_epr12084.bin", 0x10000, 0x0cfe1b00, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr12082.bin", 0x10000, 0x9e324162, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12085.bin", 0x10000, 0x0962098b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12083.bin", 0x10000, 0x3d631a8e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12086.bin", 0x10000, 0x45b949df, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12087.bin", 0x10000, 0x6f0396b7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12088.bin", 0x10000, 0xba8c0749, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12089.bin", 0x08000, 0x8321eb0b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb31d) -STD_ROM_FN(Wb31d) - -static struct BurnRomInfo Wb35RomDesc[] = { - { "epr-12120.43", 0x10000, 0xcbd8c99b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12118.26", 0x10000, 0xe9a3280c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12121.42", 0x10000, 0x5e44c0a9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12119.25", 0x10000, 0x01ed3ef9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12086.95", 0x10000, 0x45b949df, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12087.94", 0x10000, 0x6f0396b7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12088.83", 0x10000, 0xba8c0749, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.10", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.11", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.17", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.18", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.23", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.24", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.29", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.30", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12089.12", 0x08000, 0x8321eb0b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0086.key", 0x02000, 0xec480b80, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb35) -STD_ROM_FN(Wb35) - -static struct BurnRomInfo Wb35dRomDesc[] = { - { "bootleg_epr-12120.43", 0x10000, 0x47e62031, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12118.26", 0x10000, 0xd2f74be8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12121.42", 0x10000, 0x0962098b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12119.25", 0x10000, 0x3d631a8e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12086.95", 0x10000, 0x45b949df, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12087.94", 0x10000, 0x6f0396b7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12088.83", 0x10000, 0xba8c0749, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.10", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.11", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.17", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.18", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.23", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.24", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.29", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.30", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12089.12", 0x08000, 0x8321eb0b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb35d) -STD_ROM_FN(Wb35d) - -/*==================================================== -Memory Handlers -====================================================*/ - -void System16APPI0WritePortA(UINT8 data) -{ - System16SoundLatch = data & 0xff; -} - -void System16APPI0WritePortB(UINT8 data) -{ - System16VideoControl = data; - System16VideoEnable = data & 0x10; - System16ScreenFlip = data & 0x80; - - if (System16I8751RomNum) { - if (data & 0x40) { - mcs51_set_irq_line(MCS51_INT1_LINE, CPU_IRQSTATUS_ACK); - mcs51_set_irq_line(MCS51_INT1_LINE, CPU_IRQSTATUS_NONE); - } - } -} - -void System16APPI0WritePortC(UINT8 data) -{ - if (!(data & 0x80)) { - ZetOpen(0); - ZetNmi(); - ZetClose(); - } - System16ColScroll = ~data & 0x04; - System16RowScroll = ~data & 0x02; -} - -UINT16 __fastcall System16AReadWord(UINT32 a) -{ - switch (a) { - case 0xc40000: - case 0xc40002: - case 0xc40004: - case 0xc40006: - case 0xc41000: - case 0xc41002: - case 0xc41004: - case 0xc41006: - case 0xc42000: - case 0xc42002: - case 0xc42004: - case 0xc42006: { - SEK_DEF_READ_WORD(0, a); - } - - case 0xc60000: { - return 0; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Word -> 0x%06X\n"), a); -#endif - - return 0xffff; -} - -UINT8 __fastcall System16AReadByte(UINT32 a) -{ - switch (a) { - case 0xc40001: - case 0xc40003: - case 0xc40005: - case 0xc40007: { - return ppi8255_r(0, (a - 0xc40000) >> 1); - } - - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - return 0xff - System16Input[1]; - } - - case 0xc41005: { - return System16Dip[2]; - } - - case 0xc41007: { - return 0xff - System16Input[2]; - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - - case 0xc60000: { - return 0; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -void __fastcall System16AWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16ATileWordWrite(a - 0x400000, d); - return; - } - - switch (a) { - case 0xc40000: - case 0xc40002: - case 0xc40004: - case 0xc40006: { - SEK_DEF_WRITE_WORD(0, a, d); - return; - } - - case 0xc60000: { - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -void __fastcall System16AWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16ATileByteWrite((a - 0x400000) ^ 1, d); - return; - } - - switch (a) { - case 0xc40001: - case 0xc40003: - case 0xc40005: - case 0xc40007: { - ppi8255_w(0, (a - 0xc40000) >> 1, d & 0xff); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -UINT8 System16A_I8751ReadPort(INT32 port) -{ - if (port >= 0x0000 && port <= 0xffff) { - switch ((System16MCUData >> 3) & 7) { - case 0: { - if (port <= 0x3fff) { - // watchdog reset - return 0; - } - - if (port >= 0x4000 && port < 0x8000) { - return SekReadByte(0xffc001 ^ (port & 0x3fff)); - } - - if (port >= 0x8000 && port < 0xc000) { - return SekReadByte(0xc40001 ^ (port & 0x3fff)); - } - - return 0xff; - } - - case 1: { - if (port >= 0x8000 && port < 0x9000) { - return SekReadByte(0x410001 ^ (port & 0xfff)); - } - - return 0xff; - } - - case 3: { - return SekReadByte(0x840001 ^ port); - } - - case 5: { - return System16Rom[0x00000 + port]; - } - - case 6: { - return System16Rom[0x10000 + port]; - } - - case 7: { - return System16Rom[0x20000 + port]; - } - } - } - - switch (port) { - case MCS51_PORT_P3: { - // nop - return 0xff; - } - } - - return 0xff; -} - -void System16A_I8751WritePort(INT32 port, UINT8 data) -{ - if (port >= 0x0000 && port <= 0xffff) { - switch ((System16MCUData >> 3) & 7) { - case 0: { - if (port >= 0x4000 && port < 0x8000) { - SekWriteByte(0xffc001 ^ (port & 0x3fff), data); - return; - } - - if (port >= 0x8000 && port < 0xc000) { - SekWriteByte(0xc40001 ^ (port & 0x3fff), data); - return; - } - - return; - } - - case 1: { - if (port >= 0x8000 && port < 0x9000) { - SekWriteByte(0x410001 ^ (port & 0xfff), data); - return; - } - - return; - } - - case 3: { - SekWriteByte(0x840001 ^ port, data); - return; - } - } - - return; - } - - switch (port) { - case MCS51_PORT_P1: { - if (SekGetActive() > -1) { - if (data & 0x40) { - System1668KEnable = false; - - SekReset(); - - System16VideoEnable = 1; - } else { - System1668KEnable = true; - } - - for (INT32 irqline = 1; irqline <= 7; irqline++) { - if ((~data & 7) == irqline) { - if (irqline == 4) { - SekSetIRQLine(irqline, CPU_IRQSTATUS_ACK); - nSystem16CyclesDone[0] += SekRun(200); - SekSetIRQLine(irqline, CPU_IRQSTATUS_NONE); - } else { - SekSetIRQLine(irqline, CPU_IRQSTATUS_ACK); - } - } else { - SekSetIRQLine(irqline, CPU_IRQSTATUS_NONE); - } - } - - if ((System16MCUData ^ data) & 0x40) { - nSystem16CyclesDone[0] += SekRun(10000); - } - } - - System16MCUData = data; - - return; - } - } -} - -static INT16 AceattacaTrack1X = 0; -static INT16 AceattacaTrack1Y = 0; -static INT16 AceattacaTrack2X = 0; -static INT16 AceattacaTrack2Y = 0; -static INT8 AceattacaDial1 = 0; -static INT8 AceattacaDial2 = 0; - -static void AceattacaMakeAnalogInputs() -{ - if (System16InputPort3[0]) AceattacaTrack1X += 0x40; - if (System16InputPort3[1]) AceattacaTrack1X -= 0x40; - if (AceattacaTrack1X >= 0x100) AceattacaTrack1X = 0; - if (AceattacaTrack1X < 0) AceattacaTrack1X = 0xfd; - - if (System16InputPort3[2]) AceattacaTrack1Y -= 0x40; - if (System16InputPort3[3]) AceattacaTrack1Y += 0x40; - if (AceattacaTrack1Y >= 0x100) AceattacaTrack1Y = 0; - if (AceattacaTrack1Y < 0) AceattacaTrack1Y = 0xfd; - - if (System16InputPort4[0]) AceattacaDial1 += 0x01; - if (System16InputPort4[1]) AceattacaDial1 -= 0x01; - if (AceattacaDial1 >= 0x10) AceattacaDial1 = 0; - if (AceattacaDial1 < 0) AceattacaDial1 = 0x0f; - - if (System16InputPort3[4]) AceattacaTrack2X += 0x40; - if (System16InputPort3[5]) AceattacaTrack2X -= 0x40; - if (AceattacaTrack2X >= 0x100) AceattacaTrack2X = 0; - if (AceattacaTrack2X < 0) AceattacaTrack2X = 0xfd; - - if (System16InputPort3[6]) AceattacaTrack2Y -= 0x40; - if (System16InputPort3[7]) AceattacaTrack2Y += 0x40; - if (AceattacaTrack2Y >= 0x100) AceattacaTrack2Y = 0; - if (AceattacaTrack2Y < 0) AceattacaTrack2Y = 0xfd; - - if (System16InputPort4[2]) AceattacaDial2 += 0x01; - if (System16InputPort4[3]) AceattacaDial2 -= 0x01; - if (AceattacaDial2 >= 0x10) AceattacaDial2 = 0; - if (AceattacaDial2 < 0) AceattacaDial2 = 0x0f; -} - -static UINT8 __fastcall AceattacaReadByte(UINT32 a) -{ - switch (a) { - case 0xc40001: - case 0xc40003: - case 0xc40005: - case 0xc40007: { - return ppi8255_r(0, (a - 0xc40000) >> 1); - } - - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - if (System16VideoControl == 0x10) return 0xff - System16Input[1]; - if (System16VideoControl == 0x14) return AceattacaTrack1X; - if (System16VideoControl == 0x18) return AceattacaTrack1Y; - if (System16VideoControl == 0x1c) return System16Input[2]; - return 0xff; - } - - case 0xc41005: { - return AceattacaDial1 | (AceattacaDial2 << 4); - } - - case 0xc41007: { - if (System16VideoControl == 0x10) return 0xff - System16Input[5]; - if (System16VideoControl == 0x14) return AceattacaTrack2X; - if (System16VideoControl == 0x18) return AceattacaTrack2Y; - if (System16VideoControl == 0x1c) return System16Input[6]; - return 0xff; - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - - case 0xc60000: { - return 0; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -static INT16 MjleagueTrack1X = 0; -static INT16 MjleagueTrack1Y = 0; -static INT16 MjleagueTrack2X = 0; -static INT16 MjleagueTrack2Y = 0; -static INT16 MjleagueBat1 = 0; -static INT16 MjleagueBat2 = 0; - -static void MjleagueMakeAnalogInputs() -{ - if (System16InputPort3[0]) MjleagueTrack1X -= 0x04; - if (System16InputPort3[1]) MjleagueTrack1X += 0x04; - if (MjleagueTrack1X >= 0x100) MjleagueTrack1X = 0; - if (MjleagueTrack1X < 0) MjleagueTrack1X = 0xfc; - - if (System16InputPort3[2]) MjleagueTrack1Y -= 0x04; - if (System16InputPort3[3]) MjleagueTrack1Y += 0x04; - if (MjleagueTrack1Y >= 0x100) MjleagueTrack1Y = 0; - if (MjleagueTrack1Y < 0) MjleagueTrack1Y = 0xfc; - - if (System16InputPort3[4]) MjleagueTrack2X -= 0x04; - if (System16InputPort3[5]) MjleagueTrack2X += 0x04; - if (MjleagueTrack2X >= 0x100) MjleagueTrack2X = 0; - if (MjleagueTrack2X < 0) MjleagueTrack2X = 0xfc; - - if (System16InputPort3[6]) MjleagueTrack2Y -= 0x04; - if (System16InputPort3[7]) MjleagueTrack2Y += 0x04; - if (MjleagueTrack2Y >= 0x100) MjleagueTrack2Y = 0; - if (MjleagueTrack2Y < 0) MjleagueTrack2Y = 0xfc; - - MjleagueBat1 = 0x80 + (System16AnalogPort0 >> 4); - MjleagueBat2 = 0x80 + (System16AnalogPort1 >> 4); -} - -static UINT8 __fastcall MjleagueReadByte(UINT32 a) -{ - switch (a) { - case 0xc40001: - case 0xc40003: - case 0xc40005: - case 0xc40007: { - return ppi8255_r(0, (a - 0xc40000) >> 1); - } - - case 0xc41001: { - UINT8 buttons = 0x3f - System16Input[0]; - UINT8 analog1 = (System16VideoControl & 4) ? MjleagueTrack1Y : MjleagueTrack1X; - UINT8 analog2 = (System16VideoControl & 4) ? MjleagueTrack2Y : MjleagueTrack2X; - - buttons |= (analog1 & 0x80) >> 1; - buttons |= (analog2 & 0x80); - - return buttons; - } - - case 0xc41003: { - UINT8 analog = (System16VideoControl & 4) ? MjleagueTrack1Y : MjleagueTrack1X; - return ((0xff - System16Input[1]) & 0x80) | (analog & 0x7f); - } - - case 0xc41005: { - if (System16VideoControl & 4) { - return (MjleagueBat1 >> 4) | (MjleagueBat2 & 0xf0); - } else { - static UINT8 last_buttons1 = 0; - static UINT8 last_buttons2 = 0; - UINT8 buttons1 = 0xff - System16Input[1]; - UINT8 buttons2 = 0xff - System16Input[2]; - - if (!(buttons1 & 0x01)) - last_buttons1 = 0; - else if (!(buttons1 & 0x02)) - last_buttons1 = 1; - else if (!(buttons1 & 0x04)) - last_buttons1 = 2; - else if (!(buttons1 & 0x08)) - last_buttons1 = 3; - - if (!(buttons2 & 0x01)) - last_buttons2 = 0; - else if (!(buttons2 & 0x02)) - last_buttons2 = 1; - else if (!(buttons2 & 0x04)) - last_buttons2 = 2; - else if (!(buttons2 & 0x08)) - last_buttons2 = 3; - - return last_buttons1 | (last_buttons2 << 4); - } - } - - case 0xc41007: { - UINT8 analog = (System16VideoControl & 4) ? MjleagueTrack2Y : MjleagueTrack2X; - return ((0xff - System16Input[2]) & 0x80) | (analog & 0x7f); - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - } - - return 0xff; -} - -static UINT8 __fastcall Passsht16aReadByte(UINT32 a) -{ - static INT32 PortNum = 0; - - switch (a) { - case 0xc40001: - case 0xc40003: - case 0xc40005: - case 0xc40007: { - return ppi8255_r(0, (a - 0xc40000) >> 1); - } - - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - switch ((PortNum++) & 3) { - case 0: return 0xff - System16Input[1]; - case 1: return 0xff - System16Input[2]; - case 2: return 0xff - System16Input[3]; - case 3: return 0xff - System16Input[4]; - } - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - - case 0xc60000: { - return 0; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -static UINT8 __fastcall QuartetReadByte(UINT32 a) -{ - switch (a) { - case 0xc40001: - case 0xc40003: - case 0xc40005: - case 0xc40007: { - return ppi8255_r(0, (a - 0xc40000) >> 1); - } - - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - return 0xff - System16Input[1]; - } - - case 0xc41005: { - return 0xff - System16Input[2]; - } - - case 0xc41007: { - return 0xff - System16Input[3]; - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - - case 0xc60000: { - return 0; - } - } - - return 0xff; -} - -static INT16 SdiTrack1X = 0; -static INT16 SdiTrack1Y = 0; -static INT16 SdiTrack2X = 0; -static INT16 SdiTrack2Y = 0; - -static void SdiMakeAnalogInputs() -{ - SdiTrack1X += (System16AnalogPort0 >> 8) & 0xff; - SdiTrack1Y -= (System16AnalogPort1 >> 8) & 0xff; - - SdiTrack2X += (System16AnalogPort2 >> 8) & 0xff; - SdiTrack2Y -= (System16AnalogPort3 >> 8) & 0xff; -} - -static UINT8 __fastcall SdiReadByte(UINT32 a) -{ - switch (a) { - case 0xc40001: - case 0xc40003: - case 0xc40005: - case 0xc40007: { - return ppi8255_r(0, (a - 0xc40000) >> 1); - } - - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - return (System16VideoControl & 4) ? SdiTrack1Y : SdiTrack1X; - } - - case 0xc41005: { - return 0xff - System16Input[1]; - } - - case 0xc41007: { - return (System16VideoControl & 4) ? SdiTrack2Y : SdiTrack2X; - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - - case 0xc60000: { - return 0xff; - } - } - - return 0xff; -} - -static UINT8 MahjongInputNum; - -UINT16 __fastcall Sjryuko1ReadWord(UINT32 a) -{ - SEK_DEF_READ_WORD(0, a); - - return 0xffff; -} - -static UINT8 __fastcall Sjryuko1ReadByte(UINT32 a) -{ - switch (a) { - case 0xc40001: - case 0xc40003: - case 0xc40005: - case 0xc40007: { - return ppi8255_r(0, (a - 0xc40000) >> 1); - } - - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - if (System16Input[MahjongInputNum + 1] != 0xff) return 0xff & ~(1 << MahjongInputNum); - return 0xff; - } - - case 0xc41005: { - return 0xff - System16Input[MahjongInputNum + 1]; - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - } - - return 0xff; -} - -static void __fastcall Sjryuko1WriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16ATileByteWrite((a - 0x400000) ^ 1, d); - return; - } - - switch (a) { - case 0xc40001: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - ZetClose(); - return; - } - - case 0xc40003: { - if ((System16VideoControl ^ d) & 0xc) { - if (((System16VideoControl ^ d) & 4) && (d & 4)) MahjongInputNum = (MahjongInputNum + 1) % 6; - } - System16VideoControl = d; - System16VideoEnable = d & 0x10; - return; - } - } -} - -/*==================================================== -Driver Inits -====================================================*/ - -static INT32 AceattacaInit() -{ - System16MakeAnalogInputsDo = AceattacaMakeAnalogInputs; - - INT32 nRet = System16Init(); - - if (!nRet) { - SekOpen(0); - SekSetReadByteHandler(0, AceattacaReadByte); - SekClose(); - - // Handle different sprite rom layout - UINT8 *pTemp = (UINT8*)BurnMalloc(System16SpriteRomSize); - if (pTemp) { - memcpy(pTemp, System16Sprites, System16SpriteRomSize); - memcpy(System16Sprites + 0x00000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x10000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x20000, pTemp + 0x40000, 0x10000); - memcpy(System16Sprites + 0x30000, pTemp + 0x60000, 0x10000); - memcpy(System16Sprites + 0x40000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x50000, pTemp + 0x30000, 0x10000); - memcpy(System16Sprites + 0x60000, pTemp + 0x50000, 0x10000); - memcpy(System16Sprites + 0x70000, pTemp + 0x70000, 0x10000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 AceattacaExit() -{ - AceattacaTrack1X = 0; - AceattacaTrack1Y = 0; - AceattacaTrack2X = 0; - AceattacaTrack2Y = 0; - AceattacaDial1 = 0; - AceattacaDial2 = 0; - - return System16Exit(); -} - -static INT32 AceattacaScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(AceattacaTrack1X); - SCAN_VAR(AceattacaTrack1Y); - SCAN_VAR(AceattacaTrack2X); - SCAN_VAR(AceattacaTrack2Y); - SCAN_VAR(AceattacaDial1); - SCAN_VAR(AceattacaDial2); - } - - return System16Scan(nAction, pnMin);; -} - -static INT32 AliensynjoInit() -{ - INT32 nRet = System16Init(); - - if (!nRet) { - // Handle different sprite rom layout - UINT8 *pTemp = (UINT8*)BurnMalloc(System16SpriteRomSize); - if (pTemp) { - memcpy(pTemp, System16Sprites, System16SpriteRomSize); - memcpy(System16Sprites + 0x00000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x10000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x20000, pTemp + 0x40000, 0x10000); - memcpy(System16Sprites + 0x30000, pTemp + 0x60000, 0x10000); - memcpy(System16Sprites + 0x40000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x50000, pTemp + 0x30000, 0x10000); - memcpy(System16Sprites + 0x60000, pTemp + 0x50000, 0x10000); - memcpy(System16Sprites + 0x70000, pTemp + 0x70000, 0x10000); - AlienSyndrome = true; - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 Aliensyn5Init() -{ - INT32 nRet = System16Init(); - - if (!nRet) { - // Handle different sprite rom layout - UINT8 *pTemp = (UINT8*)BurnMalloc(System16SpriteRomSize); - if (pTemp) { - memcpy(pTemp, System16Sprites, System16SpriteRomSize); - memcpy(System16Sprites + 0x00000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x10000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x20000, pTemp + 0x40000, 0x10000); - memcpy(System16Sprites + 0x30000, pTemp + 0x60000, 0x10000); - memcpy(System16Sprites + 0x40000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x50000, pTemp + 0x30000, 0x10000); - memcpy(System16Sprites + 0x60000, pTemp + 0x50000, 0x10000); - memcpy(System16Sprites + 0x70000, pTemp + 0x70000, 0x10000); - AlienSyndrome = true; - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static void Bodyslam_Sim8751() -{ - UINT8 flag = ((System16Ram[0x200 + 1] << 8) | System16Ram[0x200 + 0]) >> 8; - UINT8 tick = ((System16Ram[0x200 + 1] << 8) | System16Ram[0x200 + 0]) & 0xff; - UINT8 sec = ((System16Ram[0x202 + 1] << 8) | System16Ram[0x202 + 0]) >> 8; - UINT8 min = ((System16Ram[0x202 + 1] << 8) | System16Ram[0x202 + 0]) & 0xff; - - /* out of time? set the flag */ - if (tick == 0 && sec == 0 && min == 0) - flag = 1; - else - { - if (tick != 0) - tick--; - else - { - /* the game counts 64 ticks per second */ - tick = 0x40; - - /* seconds are counted in BCD */ - if (sec != 0) - sec = (sec & 0xf) ? sec - 1 : (sec - 0x10) + 9; - else - { - sec = 0x59; - - /* minutes are counted normally */ - if (min != 0) - min--; - else - { - flag = 1; - tick = sec = min = 0; - } - } - } - } - - *((UINT16*)(System16Ram + 0x200)) = BURN_ENDIAN_SWAP_INT16((flag << 8) + tick); - *((UINT16*)(System16Ram + 0x202)) = BURN_ENDIAN_SWAP_INT16((sec << 8) + min); -} - -static INT32 BodyslamInit() -{ - Simulate8751 = Bodyslam_Sim8751; - - return System16Init(); -} - -static void SegaDecode2(const UINT8 xor_table[128],const int swap_table[128]) -{ - INT32 A; - static const UINT8 swaptable[24][4] = - { - { 6,4,2,0 }, { 4,6,2,0 }, { 2,4,6,0 }, { 0,4,2,6 }, - { 6,2,4,0 }, { 6,0,2,4 }, { 6,4,0,2 }, { 2,6,4,0 }, - { 4,2,6,0 }, { 4,6,0,2 }, { 6,0,4,2 }, { 0,6,4,2 }, - { 4,0,6,2 }, { 0,4,6,2 }, { 6,2,0,4 }, { 2,6,0,4 }, - { 0,6,2,4 }, { 2,0,6,4 }, { 0,2,6,4 }, { 4,2,0,6 }, - { 2,4,0,6 }, { 4,0,2,6 }, { 2,0,4,6 }, { 0,2,4,6 }, - }; - - UINT8 *rom = System16Z80Rom; - UINT8 *decrypted = System16Z80Code; - - for (A = 0x0000;A < 0x8000;A++) - { - INT32 row; - UINT8 src; - const UINT8 *tbl; - - - src = rom[A]; - - /* pick the translation table from bits 0, 3, 6, 9, 12 and 14 of the address */ - row = (A & 1) + (((A >> 3) & 1) << 1) + (((A >> 6) & 1) << 2) - + (((A >> 9) & 1) << 3) + (((A >> 12) & 1) << 4) + (((A >> 14) & 1) << 5); - - /* decode the opcodes */ - tbl = swaptable[swap_table[2*row]]; - decrypted[A] = BITSWAP08(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ xor_table[2*row]; - - /* decode the data */ - tbl = swaptable[swap_table[2*row+1]]; - rom[A] = BITSWAP08(src,7,tbl[0],5,tbl[1],3,tbl[2],1,tbl[3]) ^ xor_table[2*row+1]; - } -} - -static INT32 FantzonepDecryptZ80() -{ - System16Z80Code = (UINT8*)BurnMalloc(0x8000); - - static const UINT8 xor_table[128] = - { - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14, - - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40, - 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41, - 0x05,0x55,0x50,0x14, - }; - - static const INT32 swap_table[128] = - { - 0,0,0,0, - 1,1,1,1,1, - 2,2,2,2,2, - 3,3,3,3, - 4,4,4,4,4, - 5,5,5,5,5, - 6,6,6,6,6, - 7,7,7,7,7, - 8,8,8,8, - 9,9,9,9,9, - 10,10,10,10,10, - 11,11,11,11,11, - 12,12,12,12,12, - 13,13, - - 8,8,8,8, - 9,9,9,9,9, - 10,10,10,10,10, - 11,11,11,11, - 12,12,12,12,12, - 13,13,13,13,13, - 14,14,14,14,14, - 15,15,15,15,15, - 16,16,16,16, - 17,17,17,17,17, - 18,18,18,18,18, - 19,19,19,19,19, - 20,20,20,20,20, - 21,21, - }; - - SegaDecode2(xor_table, swap_table); - - return 0; -} - -static void FantzonepMapZ80() -{ - ZetMapArea(0x0000, 0x7fff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0x7fff, 2, System16Z80Code, System16Z80Rom); - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram); - - ZetSetInHandler(System16PPIZ80PortRead); - ZetSetOutHandler(System16Z80PortWrite); -} - -static INT32 FantzonepInit() -{ - System16CustomLoadRomDo = FantzonepDecryptZ80; - System16MapZ80Do = FantzonepMapZ80; - - return System16Init(); -} - -static INT32 FantzonepExit() -{ - BurnFree(System16Z80Code); - - return System16Exit(); -} - -static INT32 MjleagueInit() -{ - System16MakeAnalogInputsDo = MjleagueMakeAnalogInputs; - - INT32 nRet = System16Init(); - - if (!nRet) { - SekOpen(0); - SekSetReadByteHandler(0, MjleagueReadByte); - SekClose(); - } - - return nRet; -} - -static INT32 MjleagueExit() -{ - MjleagueTrack1X = 0; - MjleagueTrack1Y = 0; - MjleagueTrack2X = 0; - MjleagueTrack2Y = 0; - MjleagueBat1 = 0; - MjleagueBat2 = 0; - - return System16Exit(); -} - -static INT32 MjleagueScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(MjleagueTrack1X); - SCAN_VAR(MjleagueTrack1Y); - SCAN_VAR(MjleagueTrack2X); - SCAN_VAR(MjleagueTrack2Y); - SCAN_VAR(MjleagueBat1); - SCAN_VAR(MjleagueBat2); - } - - return System16Scan(nAction, pnMin);; -} - -static void Quartet_Sim8751() -{ - // X-Scroll Values - *((UINT16*)(System16TextRam + 0xff8)) = BURN_ENDIAN_SWAP_INT16(((System16Ram[0x0d14 + 1] << 8) | System16Ram[0x0d14 + 0])); - *((UINT16*)(System16TextRam + 0xffa)) = BURN_ENDIAN_SWAP_INT16(((System16Ram[0x0d18 + 1] << 8) | System16Ram[0x0d18 + 0])); - - // Page Values - *((UINT16*)(System16TextRam + 0xe9e)) = BURN_ENDIAN_SWAP_INT16(((System16Ram[0x0d1c + 1] << 8) | System16Ram[0x0d1c + 0])); - *((UINT16*)(System16TextRam + 0xe9c)) = BURN_ENDIAN_SWAP_INT16(((System16Ram[0x0d1e + 1] << 8) | System16Ram[0x0d1e + 0])); -} - -static INT32 Passsht16aInit() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x70000 - 0x60000; - - INT32 nRet = System16Init(); - - if (!nRet) { - SekOpen(0); - SekSetReadByteHandler(0, Passsht16aReadByte); - SekClose(); - - // Handle different sprite rom layout - UINT8 *pTemp = (UINT8*)BurnMalloc(System16SpriteRomSize); - if (pTemp) { - memcpy(pTemp, System16Sprites, System16SpriteRomSize); - memcpy(System16Sprites + 0x00000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x10000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x20000, pTemp + 0x40000, 0x10000); - memcpy(System16Sprites + 0x40000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x50000, pTemp + 0x30000, 0x10000); - memcpy(System16Sprites + 0x60000, pTemp + 0x50000, 0x10000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 QuartetInit() -{ - Simulate8751 = Quartet_Sim8751; - - INT32 nRet = System16Init(); - - if (!nRet) { - SekOpen(0); - SekSetReadByteHandler(0, QuartetReadByte); - SekClose(); - } - - return nRet; -} - -static INT32 SdiInit() -{ - System16MakeAnalogInputsDo = SdiMakeAnalogInputs; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x70000 - 0x60000; - - INT32 nRet = System16Init(); - - if (!nRet) { - SekOpen(0); - SekSetReadByteHandler(0, SdiReadByte); - SekClose(); - - // Handle different sprite rom layout - UINT8 *pTemp = (UINT8*)BurnMalloc(System16SpriteRomSize); - if (pTemp) { - memcpy(pTemp, System16Sprites, System16SpriteRomSize); - memcpy(System16Sprites + 0x00000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x10000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x20000, pTemp + 0x40000, 0x10000); - memcpy(System16Sprites + 0x40000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x50000, pTemp + 0x30000, 0x10000); - memcpy(System16Sprites + 0x60000, pTemp + 0x50000, 0x10000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 SdiExit() -{ - SdiTrack1X = 0; - SdiTrack1Y = 0; - SdiTrack2X = 0; - SdiTrack2Y = 0; - - return System16Exit(); -} - -static INT32 SdiScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(SdiTrack1X); - SCAN_VAR(SdiTrack1Y); - SCAN_VAR(SdiTrack2X); - SCAN_VAR(SdiTrack2Y); - } - - return System16Scan(nAction, pnMin);; -} - -static INT32 ShinobiInit() -{ - INT32 nRet = System16Init(); - - if (!nRet) { - // Handle different sprite rom layout - UINT8 *pTemp = (UINT8*)BurnMalloc(System16SpriteRomSize); - if (pTemp) { - memcpy(pTemp, System16Sprites, System16SpriteRomSize); - memcpy(System16Sprites + 0x00000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x10000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x20000, pTemp + 0x40000, 0x10000); - memcpy(System16Sprites + 0x30000, pTemp + 0x60000, 0x10000); - memcpy(System16Sprites + 0x40000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x50000, pTemp + 0x30000, 0x10000); - memcpy(System16Sprites + 0x60000, pTemp + 0x50000, 0x10000); - memcpy(System16Sprites + 0x70000, pTemp + 0x70000, 0x10000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 Sjryuko1Init() -{ - INT32 nRet = System16Init(); - - if (!nRet) { - SekOpen(0); - SekSetWriteByteHandler(0, Sjryuko1WriteByte); - SekSetReadByteHandler(0, Sjryuko1ReadByte); - SekSetReadWordHandler(0, Sjryuko1ReadWord); - SekClose(); - - // Handle different sprite rom layout - UINT8 *pTemp = (UINT8*)BurnMalloc(System16SpriteRomSize); - if (pTemp) { - memcpy(pTemp, System16Sprites, System16SpriteRomSize); - memcpy(System16Sprites + 0x00000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x10000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x20000, pTemp + 0x40000, 0x10000); - memcpy(System16Sprites + 0x30000, pTemp + 0x60000, 0x10000); - memcpy(System16Sprites + 0x40000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x50000, pTemp + 0x30000, 0x10000); - memcpy(System16Sprites + 0x60000, pTemp + 0x50000, 0x10000); - memcpy(System16Sprites + 0x70000, pTemp + 0x70000, 0x10000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 Sjryuko1Exit() -{ - MahjongInputNum = 0; - - return System16Exit(); -} - -static INT32 Sjryuko1Scan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(MahjongInputNum); - } - - return System16Scan(nAction, pnMin);; -} - -static INT32 Wb31Init() -{ - INT32 nRet = System16Init(); - - if (!nRet) { - // Handle different sprite rom layout - UINT8 *pTemp = (UINT8*)BurnMalloc(System16SpriteRomSize); - if (pTemp) { - memcpy(pTemp, System16Sprites, System16SpriteRomSize); - memcpy(System16Sprites + 0x00000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x10000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x20000, pTemp + 0x40000, 0x10000); - memcpy(System16Sprites + 0x30000, pTemp + 0x60000, 0x10000); - memcpy(System16Sprites + 0x40000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x50000, pTemp + 0x30000, 0x10000); - memcpy(System16Sprites + 0x60000, pTemp + 0x50000, 0x10000); - memcpy(System16Sprites + 0x70000, pTemp + 0x70000, 0x10000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -/*==================================================== -Driver defs -====================================================*/ - -struct BurnDriver BurnDrvAceattaca = { - "aceattaca", "aceattac", NULL, NULL, "1986", - "Ace Attacker (Japan, System 16A, FD1094 317-0060)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1094_ENC, GBF_SPORTSMISC, 0, - NULL, AceattacaRomInfo, AceattacaRomName, NULL, NULL, AceattacaInputInfo, AceattacaDIPInfo, - AceattacaInit, AceattacaExit, System16AFrame, NULL, AceattacaScan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAFighter = { - "afighter", NULL, NULL, NULL, "1986", - "Action Fighter, FD1089A 317-0018\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089A_ENC, GBF_RACING, 0, - NULL, AfighterRomInfo, AfighterRomName, NULL, NULL, System16aInputInfo, AfighterDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAlexkidd = { - "alexkidd", NULL, NULL, NULL, "1986", - "Alex Kidd: The Lost Stars (set 2, unprotected)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, AlexkiddRomInfo, AlexkiddRomName, NULL, NULL, System16aInputInfo, AlexkiddDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAlexkidd1 = { - "alexkidd1", "alexkidd", NULL, NULL, "1986", - "Alex Kidd: The Lost Stars (set 1, FD1089A 317-unknown)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089A_ENC, GBF_PLATFORM, 0, - NULL, Alexkidd1RomInfo, Alexkidd1RomName, NULL, NULL, System16aInputInfo, AlexkiddDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAliensynjo = { - "aliensynjo", "aliensyn", NULL, NULL, "1987", - "Alien Syndrome (set 1, Japan, old, System 16A, FD1089A 317-0033)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089A_ENC, GBF_MAZE, 0, - NULL, AliensynjoRomInfo, AliensynjoRomName, NULL, NULL, System16afire1InputInfo, AliensynDIPInfo, - AliensynjoInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAliensyn2 = { - "aliensyn2", "aliensyn", NULL, NULL, "1987", - "Alien Syndrome (set 2, System 16A, FD1089A 317-0033)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089A_ENC, GBF_MAZE, 0, - NULL, Aliensyn2RomInfo, Aliensyn2RomName, NULL, NULL, System16afire1InputInfo, AliensynDIPInfo, - AliensynjoInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAliensyn5 = { - "aliensyn5", "aliensyn", NULL, NULL, "1987", - "Alien Syndrome (set 5, System 16A, FD1089B 317-0037)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089B_ENC, GBF_MAZE, 0, - NULL, Aliensyn5RomInfo, Aliensyn5RomName, NULL, NULL, System16afire1InputInfo, AliensynDIPInfo, - Aliensyn5Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBodyslam = { - "bodyslam", NULL, NULL, NULL, "1986", - "Body Slam (8751 317-0015)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16A, GBF_VSFIGHT, 0, - NULL, BodyslamRomInfo, BodyslamRomName, NULL, NULL, System16aInputInfo, BodyslamDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDumpmtmt = { - "dumpmtmt", "bodyslam", NULL, NULL, "1986", - "Dump Matsumoto (Japan, 8751 317-unknown)\0", NULL, "Sega", "System 16A", - L"Dump Matsumoto (Japan, 8751 317-unknown)\0\u30C0\u30F3\u30D7\u677E\u672C\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A, GBF_VSFIGHT, 0, - NULL, DumpmtmtRomInfo, DumpmtmtRomName, NULL, NULL, System16aInputInfo, BodyslamDIPInfo, - BodyslamInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantzone = { - "fantzone", NULL, NULL, NULL, "1986", - "Fantasy Zone (Rev A, unprotected)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16A, GBF_HORSHOOT, 0, - NULL, FantzoneRomInfo, FantzoneRomName, NULL, NULL, System16aInputInfo, FantzoneDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantzone1 = { - "fantzone1", "fantzone", NULL, NULL, "1986", - "Fantasy Zone (unprotected)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A, GBF_HORSHOOT, 0, - NULL, Fantzone1RomInfo, Fantzone1RomName, NULL, NULL, System16aInputInfo, FantzoneDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantzonep = { - "fantzonep", "fantzone", NULL, NULL, "1986", - "Fantasy Zone (317-5000)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A, GBF_HORSHOOT, 0, - NULL, FantzonepRomInfo, FantzonepRomName, NULL, NULL, System16aInputInfo, FantzoneDIPInfo, - FantzonepInit, FantzonepExit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMjleague = { - "mjleague", NULL, NULL, NULL, "1985", - "Major League\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16A, GBF_SPORTSMISC, 0, - NULL, MjleagueRomInfo, MjleagueRomName, NULL, NULL, MjleagueInputInfo, MjleagueDIPInfo, - MjleagueInit, MjleagueExit, System16AFrame, NULL, MjleagueScan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvPasssht16a = { - "passsht16a", "passsht", NULL, NULL, "1988", - "Passing Shot (Japan, 4 Players, System 16A, FD1094 317-0071)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 4, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1094_ENC, GBF_SPORTSMISC, 0, - NULL, Passsht16aRomInfo, Passsht16aRomName, NULL, NULL, Passsht16aInputInfo, Passsht16aDIPInfo, - Passsht16aInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvQuartet = { - "quartet", NULL, NULL, NULL, "1986", - "Quartet (Rev A, 8751 317-unknown)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, QuartetRomInfo, QuartetRomName, NULL, NULL, QuartetInputInfo, QuartetDIPInfo, - QuartetInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQuarteta = { - "quarteta", "quartet", NULL, NULL, "1986", - "Quartet (8751 315-5194)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, QuartetaRomInfo, QuartetaRomName, NULL, NULL, QuartetInputInfo, QuartetDIPInfo, - QuartetInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQuartet2 = { - "quartet2", "quartet", NULL, NULL, "1986", - "Quartet 2 (8751 317-0010)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, Quartet2RomInfo, Quartet2RomName, NULL, NULL, System16aInputInfo, Quart2DIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQuartet2a = { - "quartet2a", "quartet", NULL, NULL, "1986", - "Quartet 2 (unprotected)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, Quartet2aRomInfo, Quartet2aRomName, NULL, NULL, System16aInputInfo, Quart2DIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSdi = { - "sdi", NULL, NULL, NULL, "1987", - "SDI - Strategic Defense Initiative (Japan, newer, System 16A, FD1089B 317-0027)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089B_ENC, GBF_SHOOT, 0, - NULL, SdiRomInfo, SdiRomName, NULL, NULL, SdiInputInfo, SdiDIPInfo, - SdiInit, SdiExit, System16AFrame, NULL, SdiScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSdia = { - "sdia", "sdi", NULL, NULL, "1987", - "SDI - Strategic Defense Initiative (Japan, old, System 16A, FD1089B 317-0027)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089B_ENC, GBF_SHOOT, 0, - NULL, SdiaRomInfo, SdiaRomName, NULL, NULL, SdiInputInfo, SdiDIPInfo, - SdiInit, SdiExit, System16AFrame, NULL, SdiScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinobi = { - "shinobi", NULL, NULL, NULL, "1987", - "Shinobi (set 6, System 16A, unprotected)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, ShinobiRomInfo, ShinobiRomName, NULL, NULL, System16afire3InputInfo, ShinobiDIPInfo, - ShinobiInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinobi1 = { - "shinobi1", "shinobi", NULL, NULL, "1987", - "Shinobi (set 1, System 16A, FD1094 317-0050)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, Shinobi1RomInfo, Shinobi1RomName, NULL, NULL, System16afire3InputInfo, ShinobiDIPInfo, - ShinobiInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinobi1d = { - "shinobi1d", "shinobi", NULL, NULL, "1987", - "Shinobi (set 1, System 16A, FD1094 317-0050 decrypted)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, Shinobi1dRomInfo, Shinobi1dRomName, NULL, NULL, System16afire3InputInfo, ShinobiDIPInfo, - ShinobiInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinobls = { - "shinobls", "shinobi", NULL, NULL, "1987", - "Shinobi (Star bootleg, System 16A)\0", NULL, "bootleg", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, ShinoblsRomInfo, ShinoblsRomName, NULL, NULL, System16afire3InputInfo, ShinobiDIPInfo, - ShinobiInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinoblb = { - "shinoblb", "shinobi", NULL, NULL, "1987", - "Shinobi (beta bootleg, System 16A)\0", NULL, "bootleg", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, ShinoblbRomInfo, ShinoblbRomName, NULL, NULL, System16afire3InputInfo, ShinobiDIPInfo, - ShinobiInit, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSjryuko1 = { - "sjryuko1", "sjryuko", NULL, NULL, "1987", - "Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)\0", NULL, "White Board", "System 16A", - L"Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)\0\u30B9\u30B1\u30D0\u30F3\u96C0\u58EB \u7ADC\u5B50\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089B_ENC, GBF_MAHJONG, 0, - NULL, Sjryuko1RomInfo, Sjryuko1RomName, NULL, NULL, Sjryuko1InputInfo, Sjryuko1DIPInfo, - Sjryuko1Init, Sjryuko1Exit, System16AFrame, NULL, Sjryuko1Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetris = { - "tetris", NULL, NULL, NULL, "1988", - "Tetris (set 4, Japan, System 16A, FD1094 317-0093)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1094_ENC, GBF_PUZZLE, 0, - NULL, TetrisRomInfo, TetrisRomName, NULL, NULL, System16afire1InputInfo, TetrisDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetrisd = { - "tetrisd", "tetris", NULL, NULL, "1988", - "Tetris (set 4, Japan, System 16A, FD1094 317-0093 decrypted)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PUZZLE, 0, - NULL, TetrisdRomInfo, TetrisdRomName, NULL, NULL, System16afire1InputInfo, TetrisDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetris3 = { - "tetris3", "tetris", NULL, NULL, "1988", - "Tetris (set 3, Japan, System 16A, FD1094 317-0093a)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1094_ENC, GBF_PUZZLE, 0, - NULL, Tetris3RomInfo, Tetris3RomName, NULL, NULL, System16afire1InputInfo, TetrisDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetris3d = { - "tetris3d", "tetris", NULL, NULL, "1988", - "Tetris (set 3, Japan, System 16A, FD1094 317-0093a decrypted)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PUZZLE, 0, - NULL, Tetris3dRomInfo, Tetris3dRomName, NULL, NULL, System16afire1InputInfo, TetrisDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTimescan1 = { - "timescan1", "timescan", NULL, NULL, "1987", - "Time Scanner (set 1, System 16A, FD1089B 317-0024)\0", NULL, "Sega", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089B_ENC, GBF_PINBALL, 0, - NULL, Timescan1RomInfo, Timescan1RomName, NULL, NULL, System16aDip3InputInfo, TimescanDIPInfo, - System16Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvWb31 = { - "wb31", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 1, Japan, System 16A, FD1094 317-0084)\0", NULL, "Sega / Westone", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, Wb31RomInfo, Wb31RomName, NULL, NULL, System16aInputInfo, Wb31DIPInfo, - Wb31Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb31d = { - "wb31d", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 1, Japan, System 16A, FD1094 317-0084 decrypted)\0", NULL, "Sega / Westone", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, Wb31dRomInfo, Wb31dRomName, NULL, NULL, System16aInputInfo, Wb31DIPInfo, - Wb31Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb35 = { - "wb35", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 5, Japan, System 16A, FD1089A 317-0086)\0", NULL, "Sega / Westone", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16A | HARDWARE_SEGA_FD1089A_ENC, GBF_PLATFORM, 0, - NULL, Wb35RomInfo, Wb35RomName, NULL, NULL, System16aInputInfo, Wb31DIPInfo, - Wb31Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb35d = { - "wb35d", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 5, Japan, System 16A, FD1089A 317-0086 decrypted)\0", NULL, "Sega / Westone", "System 16A", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16A, GBF_PLATFORM, 0, - NULL, Wb35dRomInfo, Wb35dRomName, NULL, NULL, System16aInputInfo, Wb31DIPInfo, - Wb31Init, System16Exit, System16AFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_sys16b.cpp b/jan/src/burn/drv/sega/d_sys16b.cpp deleted file mode 100644 index 6a6c0b4e2..000000000 --- a/jan/src/burn/drv/sega/d_sys16b.cpp +++ /dev/null @@ -1,10773 +0,0 @@ -#include "sys16.h" - -/*==================================================== -Input defs -====================================================*/ - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo System16bInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(System16b) - -static struct BurnInputInfo System16bfire1InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 1" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(System16bfire1) - -static struct BurnInputInfo System16bfire3InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(System16bfire3) - -static struct BurnInputInfo System16bfire4InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , System16InputPort1 + 3, "p1 fire 4" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , System16InputPort2 + 3, "p2 fire 4" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(System16bfire4) - -static struct BurnInputInfo System16bDip3InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH, System16Dip + 2 , "dip" }, -}; - -STDINPUTINFO(System16bDip3) - -static struct BurnInputInfo AceattacInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort3 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort3 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort3 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort3 + 1, "p1 right" }, - {"P1 Dial Left" , BIT_DIGITAL , System16InputPort4 + 0, "p1 fire 14"}, - {"P1 Dial Right" , BIT_DIGITAL , System16InputPort4 + 1, "p1 fire 15"}, - {"P1 Block" , BIT_DIGITAL , System16InputPort0 + 6, "p1 fire 1" }, - {"P1 Select" , BIT_DIGITAL , System16InputPort1 + 4, "p1 fire 2" }, - {"P1 Attack Dir0" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 3" }, - {"P1 Attack Dir1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 4" }, - {"P1 Attack Dir2" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 5" }, - {"P1 Attack Dir3" , BIT_DIGITAL , System16InputPort1 + 3, "p1 fire 6" }, - {"P1 Attack Dir4" , BIT_DIGITAL , System16InputPort1 + 4, "p1 fire 7" }, - {"P1 Attack Dir5" , BIT_DIGITAL , System16InputPort1 + 5, "p1 fire 8" }, - {"P1 Attack Dir6" , BIT_DIGITAL , System16InputPort1 + 6, "p1 fire 9" }, - {"P1 Attack Dir7" , BIT_DIGITAL , System16InputPort1 + 7, "p1 fire 10"}, - {"P1 Attack Pow0" , BIT_DIGITAL , System16InputPort2 + 4, "p1 fire 11"}, - {"P1 Attack Pow1" , BIT_DIGITAL , System16InputPort2 + 5, "p1 fire 12"}, - {"P1 Attack Pow2" , BIT_DIGITAL , System16InputPort2 + 6, "p1 fire 13"}, - - {"P2 Up" , BIT_DIGITAL , System16InputPort3 + 6, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort3 + 7, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort3 + 4, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort3 + 5, "p2 right" }, - {"P2 Dial Left" , BIT_DIGITAL , System16InputPort4 + 2, "p2 fire 14"}, - {"P2 Dial Right" , BIT_DIGITAL , System16InputPort4 + 3, "p2 fire 15"}, - {"P2 Block" , BIT_DIGITAL , System16InputPort0 + 7, "p2 fire 1" }, - {"P2 Select" , BIT_DIGITAL , System16InputPort5 + 4, "p2 fire 2" }, - {"P2 Attack Dir0" , BIT_DIGITAL , System16InputPort5 + 0, "p2 fire 3" }, - {"P2 Attack Dir1" , BIT_DIGITAL , System16InputPort5 + 1, "p2 fire 4" }, - {"P2 Attack Dir2" , BIT_DIGITAL , System16InputPort5 + 2, "p2 fire 5" }, - {"P2 Attack Dir3" , BIT_DIGITAL , System16InputPort5 + 3, "p2 fire 6" }, - {"P2 Attack Dir4" , BIT_DIGITAL , System16InputPort5 + 4, "p2 fire 7" }, - {"P2 Attack Dir5" , BIT_DIGITAL , System16InputPort5 + 5, "p2 fire 8" }, - {"P2 Attack Dir6" , BIT_DIGITAL , System16InputPort5 + 6, "p2 fire 9" }, - {"P2 Attack Dir7" , BIT_DIGITAL , System16InputPort5 + 7, "p2 fire 10"}, - {"P2 Attack Pow0" , BIT_DIGITAL , System16InputPort6 + 4, "p2 fire 11"}, - {"P2 Attack Pow1" , BIT_DIGITAL , System16InputPort6 + 5, "p2 fire 12"}, - {"P2 Attack Pow2" , BIT_DIGITAL , System16InputPort6 + 6, "p2 fire 13"}, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Aceattac) - -static struct BurnInputInfo AtomicpInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort1 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort1 + 6, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Atomicp) - -static struct BurnInputInfo BulletInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , System16InputPort0 + 7, "p3 coin" }, - {"Start 3" , BIT_DIGITAL , System16InputPort0 + 6, "p3 start" }, - - {"P1 Up 1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 up" }, - {"P1 Down 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 down" }, - {"P1 Left 1" , BIT_DIGITAL , System16InputPort1 + 3, "p1 left" }, - {"P1 Right 1" , BIT_DIGITAL , System16InputPort1 + 2, "p1 right" }, - {"P1 Up 2" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up 2" }, - {"P1 Down 2" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down 2" }, - {"P1 Left 2" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left 2" }, - {"P1 Right 2" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right 2"}, - - {"P2 Up 1" , BIT_DIGITAL , System16InputPort2 + 1, "p2 up" }, - {"P2 Down 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 down" }, - {"P2 Left 1" , BIT_DIGITAL , System16InputPort2 + 3, "p2 left" }, - {"P2 Right 1" , BIT_DIGITAL , System16InputPort2 + 2, "p2 right" }, - {"P2 Up 2" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up 2" }, - {"P2 Down 2" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down 2" }, - {"P2 Left 2" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left 2" }, - {"P2 Right 2" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right 2"}, - - {"P3 Up 1" , BIT_DIGITAL , System16InputPort3 + 1, "p3 up" }, - {"P3 Down 1" , BIT_DIGITAL , System16InputPort3 + 0, "p3 down" }, - {"P3 Left 1" , BIT_DIGITAL , System16InputPort3 + 3, "p3 left" }, - {"P3 Right 1" , BIT_DIGITAL , System16InputPort3 + 2, "p3 right" }, - {"P3 Up 2" , BIT_DIGITAL , System16InputPort3 + 5, "p3 up 2" }, - {"P3 Down 2" , BIT_DIGITAL , System16InputPort3 + 4, "p3 down 2" }, - {"P3 Left 2" , BIT_DIGITAL , System16InputPort3 + 7, "p3 left 2" }, - {"P3 Right 2" , BIT_DIGITAL , System16InputPort3 + 6, "p3 right 2"}, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Bullet) - -static struct BurnInputInfo DunkshotInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - {"Start 3" , BIT_DIGITAL , System16InputPort0 + 6, "p3 start" }, - {"Start 4" , BIT_DIGITAL , System16InputPort0 + 7, "p4 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort2 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort2 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort2 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort2 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 6, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 7, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 4, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 5, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort1 + 2, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort1 + 3, "p2 fire 2" }, - - {"P3 Up" , BIT_DIGITAL , System16InputPort3 + 2, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , System16InputPort3 + 3, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , System16InputPort3 + 0, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , System16InputPort3 + 1, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort1 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort1 + 5, "p3 fire 2" }, - - {"P4 Up" , BIT_DIGITAL , System16InputPort3 + 6, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , System16InputPort3 + 7, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , System16InputPort3 + 4, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , System16InputPort3 + 5, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , System16InputPort1 + 6, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , System16InputPort1 + 7, "p4 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Dunkshot) - -static struct BurnInputInfo ExctleagInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort4 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort4 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort4 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort4 + 1, "p1 right" }, - {"P1 Bant0" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Bant1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - {"P1 Bant2" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 3" }, - {"P1 Swing0" , BIT_DIGITAL , System16InputPort1 + 3, "p1 fire 4" }, - {"P1 Swing1" , BIT_DIGITAL , System16InputPort1 + 4, "p1 fire 5" }, - {"P1 Low" , BIT_DIGITAL , System16InputPort1 + 5, "p1 fire 6" }, - {"P1 Mid" , BIT_DIGITAL , System16InputPort1 + 6, "p1 fire 7" }, - {"P1 Hi" , BIT_DIGITAL , System16InputPort1 + 7, "p1 fire 8" }, - {"P1 Change" , BIT_DIGITAL , System16InputPort3 + 1, "p1 fire 9" }, - {"P1 Select" , BIT_DIGITAL , System16InputPort3 + 2, "p1 fire 10" }, - {"P1 Chase" , BIT_DIGITAL , System16InputPort3 + 0, "p1 fire 11" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort4 + 6, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort4 + 7, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort4 + 4, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort4 + 5, "p2 right" }, - {"P2 Bant0" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Bant1" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - {"P2 Bant2" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 3" }, - {"P2 Swing0" , BIT_DIGITAL , System16InputPort2 + 3, "p2 fire 4" }, - {"P2 Swing1" , BIT_DIGITAL , System16InputPort2 + 4, "p2 fire 5" }, - {"P2 Low" , BIT_DIGITAL , System16InputPort2 + 5, "p2 fire 6" }, - {"P2 Mid" , BIT_DIGITAL , System16InputPort2 + 6, "p2 fire 7" }, - {"P2 Hi" , BIT_DIGITAL , System16InputPort2 + 7, "p2 fire 8" }, - {"P2 Change" , BIT_DIGITAL , System16InputPort3 + 5, "p2 fire 9" }, - {"P2 Select" , BIT_DIGITAL , System16InputPort3 + 6, "p2 fire 10" }, - {"P2 Chase" , BIT_DIGITAL , System16InputPort3 + 4, "p2 fire 11" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Exctleag) - -static struct BurnInputInfo FpointblInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 1" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Fpointbl) - -static struct BurnInputInfo HwchampInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Left" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Right" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Hwchamp) - -static struct BurnInputInfo LockonphInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort2 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort0 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort0 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort0 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort0 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort0 + 1, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p2 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort2 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort2 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Lockonph) - -static struct BurnInputInfo PassshtInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - {"Start 3" , BIT_DIGITAL , System16InputPort0 + 6, "p3 start" }, - {"Start 4" , BIT_DIGITAL , System16InputPort0 + 7, "p4 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 1, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 0, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 2, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort1 + 6, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , System16InputPort1 + 7, "p1 fire 4" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 1, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 0, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 2, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System16InputPort2 + 6, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , System16InputPort2 + 7, "p2 fire 4" }, - - {"P3 Up" , BIT_DIGITAL , System16InputPort3 + 1, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , System16InputPort3 + 0, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , System16InputPort3 + 3, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , System16InputPort3 + 2, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort3 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort3 + 5, "p3 fire 2" }, - {"P3 Fire 3" , BIT_DIGITAL , System16InputPort3 + 6, "p3 fire 3" }, - {"P3 Fire 4" , BIT_DIGITAL , System16InputPort3 + 7, "p3 fire 4" }, - - {"P4 Up" , BIT_DIGITAL , System16InputPort4 + 1, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , System16InputPort4 + 0, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , System16InputPort4 + 3, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , System16InputPort4 + 2, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , System16InputPort4 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , System16InputPort4 + 5, "p4 fire 2" }, - {"P4 Fire 3" , BIT_DIGITAL , System16InputPort4 + 6, "p4 fire 3" }, - {"P4 Fire 4" , BIT_DIGITAL , System16InputPort4 + 7, "p4 fire 4" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Passsht) - -static struct BurnInputInfo RyukyuInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Ryukyu) - -static struct BurnInputInfo SdiInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 1, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 0, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 2, "p1 right" }, - A("P1 Target L/R" , BIT_ANALOG_REL, &System16AnalogPort0, "mouse x-axis" ), - A("P1 Target U/D" , BIT_ANALOG_REL, &System16AnalogPort1, "mouse y-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort0 + 6, "mouse button 1"}, - - {"P2 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p2 right" }, - A("P2 Target L/R" , BIT_ANALOG_REL, &System16AnalogPort2, "p2 x-axis" ), - A("P2 Target U/D" , BIT_ANALOG_REL, &System16AnalogPort3, "p2 y-axis" ), - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort0 + 7, "p2 fire 1" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Sdi) - -static struct BurnInputInfo SjryukoInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - - {"Mahjong A" , BIT_DIGITAL , System16InputPort1 + 0, "mah a" }, - {"Mahjong B" , BIT_DIGITAL , System16InputPort1 + 1, "mah b" }, - {"Mahjong C" , BIT_DIGITAL , System16InputPort1 + 2, "mah c" }, - {"Mahjong D" , BIT_DIGITAL , System16InputPort1 + 3, "mah d" }, - {"Mahjong E" , BIT_DIGITAL , System16InputPort2 + 0, "mah e" }, - {"Mahjong F" , BIT_DIGITAL , System16InputPort2 + 1, "mah f" }, - {"Mahjong G" , BIT_DIGITAL , System16InputPort2 + 2, "mah g" }, - {"Mahjong H" , BIT_DIGITAL , System16InputPort2 + 3, "mah h" }, - {"Mahjong I" , BIT_DIGITAL , System16InputPort3 + 0, "mah i" }, - {"Mahjong J" , BIT_DIGITAL , System16InputPort3 + 1, "mah j" }, - {"Mahjong K" , BIT_DIGITAL , System16InputPort3 + 2, "mah k" }, - {"Mahjong L" , BIT_DIGITAL , System16InputPort3 + 3, "mah l" }, - {"Mahjong M" , BIT_DIGITAL , System16InputPort4 + 0, "mah m" }, - {"Mahjong N" , BIT_DIGITAL , System16InputPort4 + 1, "mah n" }, - {"Mahjong Kan" , BIT_DIGITAL , System16InputPort6 + 0, "mah kan" }, - {"Mahjong Pon" , BIT_DIGITAL , System16InputPort4 + 3, "mah pon" }, - {"Mahjong Chi" , BIT_DIGITAL , System16InputPort4 + 2, "mah chi" }, - {"Mahjong Reach" , BIT_DIGITAL , System16InputPort6 + 1, "mah reach" }, - {"Mahjong Ron" , BIT_DIGITAL , System16InputPort6 + 2, "mah ron" }, - {"Mahjong Bet" , BIT_DIGITAL , System16InputPort5 + 1, "mah bet" }, - {"Mahjong Last Chance", BIT_DIGITAL , System16InputPort1 + 4, "mah lc" }, - {"Mahjong Score" , BIT_DIGITAL , System16InputPort5 + 0, "mah score" }, - {"Mahjong Flip Flop" , BIT_DIGITAL , System16InputPort4 + 4, "mah ff" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Sjryuko) - -static struct BurnInputInfo SnapperInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort1 + 1, "p1 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort0 + 6, "p1 fire 3" }, - - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Snapper) - -#undef A - -/*==================================================== -Dip defs -====================================================*/ - -#define SYSTEM16B_COINAGE(dipval) \ - {0 , 0xfe, 0 , 16 , "Coin A" }, \ - {dipval, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x05, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0x0f, 0x04, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x01, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0x0f, 0x02, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0x0f, 0x03, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0x0f, 0x00, "Free Play (if coin B too) or 1C/1C" }, \ - \ - {0 , 0xfe, 0 , 16 , "Coin B" }, \ - {dipval, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x50, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0xf0, 0x40, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x10, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0xf0, 0x20, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0xf0, 0x30, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0xf0, 0x00, "Free Play (if coin A too) or 1C/1C" }, - -static struct BurnDIPInfo AceattacDIPList[]= -{ - // Default Values - {0x2d, 0xff, 0xff, 0xfe, NULL }, - {0x2e, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x2d, 0x01, 0x01, 0x01, "Off" }, - {0x2d, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Starting Points" }, - {0x2d, 0x01, 0x0e, 0x06, "2000" }, - {0x2d, 0x01, 0x0e, 0x0a, "3000" }, - {0x2d, 0x01, 0x0e, 0x0c, "4000" }, - {0x2d, 0x01, 0x0e, 0x0e, "5000" }, - {0x2d, 0x01, 0x0e, 0x08, "6000" }, - {0x2d, 0x01, 0x0e, 0x04, "7000" }, - {0x2d, 0x01, 0x0e, 0x02, "8000" }, - {0x2d, 0x01, 0x0e, 0x00, "9000" }, - - {0 , 0xfe, 0 , 4 , "Point Table" }, - {0x2d, 0x01, 0x30, 0x20, "Easy" }, - {0x2d, 0x01, 0x30, 0x30, "Normal" }, - {0x2d, 0x01, 0x30, 0x10, "Hard" }, - {0x2d, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x2d, 0x01, 0xc0, 0x20, "Easy" }, - {0x2d, 0x01, 0xc0, 0xc0, "Normal" }, - {0x2d, 0x01, 0xc0, 0x10, "Hard" }, - {0x2d, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x2e) -}; - -STDDIPINFO(Aceattac) - -static struct BurnDIPInfo AliensynDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfd, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x0c, 0x08, "2" }, - {0x11, 0x01, 0x0c, 0x0c, "3" }, - {0x11, 0x01, 0x0c, 0x04, "4" }, - {0x11, 0x01, 0x0c, 0x00, "127" }, - - {0 , 0xfe, 0 , 4 , "Timer" }, - {0x11, 0x01, 0x30, 0x00, "120" }, - {0x11, 0x01, 0x30, 0x10, "130" }, - {0x11, 0x01, 0x30, 0x20, "140" }, - {0x11, 0x01, 0x30, 0x30, "150" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0xc0, 0x80, "Easy" }, - {0x11, 0x01, 0xc0, 0xc0, "Normal" }, - {0x11, 0x01, 0xc0, 0x40, "Hard" }, - {0x11, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x12) -}; - -STDDIPINFO(Aliensyn) - -static struct BurnDIPInfo AliensynjDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfd, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0x0c, 0x08, "2" }, - {0x11, 0x01, 0x0c, 0x0c, "3" }, - {0x11, 0x01, 0x0c, 0x04, "4" }, - {0x11, 0x01, 0x0c, 0x00, "127" }, - - {0 , 0xfe, 0 , 4 , "Timer" }, - {0x11, 0x01, 0x30, 0x00, "150" }, - {0x11, 0x01, 0x30, 0x10, "160" }, - {0x11, 0x01, 0x30, 0x20, "170" }, - {0x11, 0x01, 0x30, 0x30, "180" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0xc0, 0x80, "Easy" }, - {0x11, 0x01, 0xc0, 0xc0, "Normal" }, - {0x11, 0x01, 0xc0, 0x40, "Hard" }, - {0x11, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x12) -}; - -STDDIPINFO(Aliensynj) - -static struct BurnDIPInfo AltbeastDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Credits needed" }, - {0x15, 0x01, 0x01, 0x01, "1 to start, 1 to continue" }, - {0x15, 0x01, 0x01, 0x00, "2 to start, 1 to continue" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x0c, 0x08, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x04, "4" }, - {0x15, 0x01, 0x0c, 0x00, "240" }, - - {0 , 0xfe, 0 , 4 , "Energy Meter" }, - {0x15, 0x01, 0x30, 0x20, "2" }, - {0x15, 0x01, 0x30, 0x30, "3" }, - {0x15, 0x01, 0x30, 0x10, "4" }, - {0x15, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0xc0, 0x80, "Easy" }, - {0x15, 0x01, 0xc0, 0xc0, "Normal" }, - {0x15, 0x01, 0xc0, 0x40, "Hard" }, - {0x15, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x16) -}; - -STDDIPINFO(Altbeast) - -static struct BurnDIPInfo AtomicpDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0x2f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x11, 0x01, 0x38, 0x00, "4 Coins 1 Credit" }, - {0x11, 0x01, 0x38, 0x20, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x38, 0x18, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x38, 0x10, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x38, 0x30, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x11, 0x01, 0x07, 0x00, "4 Coins 1 Credit" }, - {0x11, 0x01, 0x07, 0x04, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x11, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x11, 0x01, 0xc0, 0xc0, "1" }, - {0x11, 0x01, 0xc0, 0x80, "2" }, - {0x11, 0x01, 0xc0, 0x40, "3" }, - {0x11, 0x01, 0xc0, 0x00, "5" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x01, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Normal" }, - {0x12, 0x01, 0x03, 0x02, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Level Select" }, - {0x12, 0x01, 0x04, 0x04, "Off" }, - {0x12, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x10, 0x10, "Off" }, - {0x12, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x12, 0x01, 0x20, 0x00, "Off" }, - {0x12, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Mode" }, - {0x12, 0x01, 0x40, 0x40, "Normal Tetris" }, - {0x12, 0x01, 0x40, 0x00, "Atomic Point" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x12, 0x01, 0x80, 0x00, "Off" }, - {0x12, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Atomicp) - -static struct BurnDIPInfo AurailDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x15, 0x01, 0x01, 0x01, "Upright" }, - {0x15, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x0c, 0x00, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x08, "4" }, - {0x15, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x15, 0x01, 0x10, 0x10, "80k, 200k, 500k, 1000k" }, - {0x15, 0x01, 0x10, 0x00, "100k, 300k, 700k, 1000k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x15, 0x01, 0x20, 0x20, "Normal" }, - {0x15, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Controller Select" }, - {0x15, 0x01, 0x40, 0x40, "1 Player Side" }, - {0x15, 0x01, 0x40, 0x00, "2 Players Side" }, - - {0 , 0xfe, 0 , 2 , "Special Function Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x16) -}; - -STDDIPINFO(Aurail) - -static struct BurnDIPInfo BayrouteDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x01, 0x00, "Off" }, - {0x15, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x0c, 0x04, "1" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x08, "5" }, - {0x15, 0x01, 0x0c, 0x00, "Unlimited" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x30, 0x30, "100000" }, - {0x15, 0x01, 0x30, 0x20, "150000" }, - {0x15, 0x01, 0x30, 0x10, "200000" }, - {0x15, 0x01, 0x30, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0xc0, 0xc0, "Easy" }, - {0x15, 0x01, 0xc0, 0x80, "Normal" }, - {0x15, 0x01, 0xc0, 0x40, "Hard" }, - {0x15, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x16) -}; - -STDDIPINFO(Bayroute) - -static struct BurnDIPInfo Blox16bDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfe, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, -}; - -STDDIPINFO(Blox16b) - -static struct BurnDIPInfo BulletDIPList[]= -{ - // Default Values - {0x21, 0xff, 0xff, 0xff, NULL }, - {0x22, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - - // Dip 2 - SYSTEM16B_COINAGE(0x22) -}; - -STDDIPINFO(Bullet) - -static struct BurnDIPInfo CottonDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x06, 0x04, "2" }, - {0x13, 0x01, 0x06, 0x06, "3" }, - {0x13, 0x01, 0x06, 0x02, "4" }, - {0x13, 0x01, 0x06, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x18, 0x10, "Easy" }, - {0x13, 0x01, 0x18, 0x18, "Normal" }, - {0x13, 0x01, 0x18, 0x08, "Hard" }, - {0x13, 0x01, 0x18, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x14) -}; - -STDDIPINFO(Cotton) - -static struct BurnDIPInfo DduxDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0x06, 0x04, "Easy" }, - {0x13, 0x01, 0x06, 0x06, "Normal" }, - {0x13, 0x01, 0x06, 0x02, "Hard" }, - {0x13, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x18, 0x10, "2" }, - {0x13, 0x01, 0x18, 0x18, "3" }, - {0x13, 0x01, 0x18, 0x08, "4" }, - {0x13, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x60, 0x40, "150000" }, - {0x13, 0x01, 0x60, 0x60, "200000" }, - {0x13, 0x01, 0x60, 0x20, "300000" }, - {0x13, 0x01, 0x60, 0x00, "400000" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x14) -}; - -STDDIPINFO(Ddux) - -static struct BurnDIPInfo DunkshotDIPList[]= -{ - // Default Values - {0x21, 0xff, 0xff, 0xfd, NULL }, - {0x22, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x21, 0x01, 0x02, 0x02, "Off" }, - {0x21, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "VS Time" }, - {0x21, 0x01, 0x0c, 0x08, "2P 1:30 | 3P 2:00 | 4P 2:30" }, - {0x21, 0x01, 0x0c, 0x0c, "2P 2:00 | 3P 2:30 | 4P 3:00" }, - {0x21, 0x01, 0x0c, 0x04, "2P 2:30 | 3P 3:00 | 4P 3:30" }, - {0x21, 0x01, 0x0c, 0x00, "2P 3:00 | 3P 3:30 | 4P 4:00" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x21, 0x01, 0x30, 0x20, "Easy" }, - {0x21, 0x01, 0x30, 0x30, "Normal" }, - {0x21, 0x01, 0x30, 0x10, "Hard" }, - {0x21, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "CPU starts with +6 pts" }, - {0x21, 0x01, 0x40, 0x40, "Off" }, - {0x21, 0x01, 0x40, 0x00, "On" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x22) -}; - -STDDIPINFO(Dunkshot) - -static struct BurnDIPInfo EswatDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Time" }, - {0x15, 0x01, 0x08, 0x08, "Normal" }, - {0x15, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x30, 0x20, "Easy" }, - {0x15, 0x01, 0x30, 0x30, "Normal" }, - {0x15, 0x01, 0x30, 0x10, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0xc0, 0x00, "1" }, - {0x15, 0x01, 0xc0, 0x40, "2" }, - {0x15, 0x01, 0xc0, 0xc0, "3" }, - {0x15, 0x01, 0xc0, 0x80, "4" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x16) -}; - -STDDIPINFO(Eswat) - -static struct BurnDIPInfo ExctleagDIPList[]= -{ - // Default Values - {0x25, 0xff, 0xff, 0xfe, NULL }, - {0x26, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x25, 0x01, 0x01, 0x01, "Off" }, - {0x25, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Starting Points" }, - {0x25, 0x01, 0x0e, 0x06, "2000" }, - {0x25, 0x01, 0x0e, 0x0a, "3000" }, - {0x25, 0x01, 0x0e, 0x0c, "4000" }, - {0x25, 0x01, 0x0e, 0x0e, "5000" }, - {0x25, 0x01, 0x0e, 0x08, "6000" }, - {0x25, 0x01, 0x0e, 0x04, "7000" }, - {0x25, 0x01, 0x0e, 0x02, "8000" }, - {0x25, 0x01, 0x0e, 0x00, "9000" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x25, 0x01, 0x30, 0x20, "Easy" }, - {0x25, 0x01, 0x30, 0x30, "Normal" }, - {0x25, 0x01, 0x30, 0x10, "Hard" }, - {0x25, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Point Table" }, - {0x25, 0x01, 0xc0, 0x80, "Easy" }, - {0x25, 0x01, 0xc0, 0xc0, "Normal" }, - {0x25, 0x01, 0xc0, 0x40, "Hard" }, - {0x25, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 1 - SYSTEM16B_COINAGE(0x26) -}; - -STDDIPINFO(Exctleag) - -static struct BurnDIPInfo FantzonetaDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x14, 0x01, 0x01, 0x00, "Upright" }, - {0x14, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x0c, 0x08, "2" }, - {0x14, 0x01, 0x0c, 0x0c, "3" }, - {0x14, 0x01, 0x0c, 0x04, "4" }, - {0x14, 0x01, 0x0c, 0x00, "240" }, - - {0 , 0xfe, 0 , 4 , "Extra Ship Cost" }, - {0x14, 0x01, 0x30, 0x30, "5000" }, - {0x14, 0x01, 0x30, 0x20, "10000" }, - {0x14, 0x01, 0x30, 0x10, "15000" }, - {0x14, 0x01, 0x30, 0x00, "20000" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0xc0, 0x80, "Easy" }, - {0x14, 0x01, 0xc0, 0xc0, "Normal" }, - {0x14, 0x01, 0xc0, 0x40, "Hard" }, - {0x14, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x14) -}; - -STDDIPINFO(Fantzoneta) - -static struct BurnDIPInfo Fantzn2xDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x0c, 0x08, "2" }, - {0x13, 0x01, 0x0c, 0x0c, "3" }, - {0x13, 0x01, 0x0c, 0x04, "4" }, - {0x13, 0x01, 0x0c, 0x00, "240" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0xc0, 0x80, "Easy" }, - {0x13, 0x01, 0xc0, 0xc0, "Normal" }, - {0x13, 0x01, 0xc0, 0x40, "Hard" }, - {0x13, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Fantzn2x) - -static struct BurnDIPInfo FpointDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfd, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x30, 0x20, "Easy" }, - {0x11, 0x01, 0x30, 0x30, "Normal" }, - {0x11, 0x01, 0x30, 0x10, "Hard" }, - {0x11, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Clear Round Allowed" }, - {0x11, 0x01, 0x40, 0x00, "1" }, - {0x11, 0x01, 0x40, 0x40, "2" }, - - {0 , 0xfe, 0 , 2 , "Cell Move" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x12) -}; - -STDDIPINFO(Fpoint) - -static struct BurnDIPInfo GoldnaxeDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Credits needed" }, - {0x15, 0x01, 0x01, 0x01, "1 to start, 1 to continue" }, - {0x15, 0x01, 0x01, 0x00, "2 to start, 1 to continue" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x0c, 0x08, "1" }, - {0x15, 0x01, 0x0c, 0x0c, "2" }, - {0x15, 0x01, 0x0c, 0x04, "3" }, - {0x15, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Energy Meter" }, - {0x15, 0x01, 0x30, 0x20, "2" }, - {0x15, 0x01, 0x30, 0x30, "3" }, - {0x15, 0x01, 0x30, 0x10, "4" }, - {0x15, 0x01, 0x30, 0x00, "5" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x16) -}; - -STDDIPINFO(Goldnaxe) - -static struct BurnDIPInfo HwchampDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xf9, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x02, 0x02, "Off" }, - {0x0a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Start Level Select" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0a, 0x01, 0x08, 0x08, "Off" }, - {0x0a, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0a, 0x01, 0x30, 0x20, "Easy" }, - {0x0a, 0x01, 0x30, 0x30, "Normal" }, - {0x0a, 0x01, 0x30, 0x10, "Hard" }, - {0x0a, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x0a, 0x01, 0xc0, 0x80, "Easy" }, - {0x0a, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0a, 0x01, 0xc0, 0x40, "Hard" }, - {0x0a, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x0b) -}; - -STDDIPINFO(Hwchamp) - -static struct BurnDIPInfo LockonphDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xc4, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x13, 0x01, 0x07, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x07, 0x04, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x07, 0x02, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x07, 0x01, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x07, 0x06, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 8 , "Coin B" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x38, 0x20, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x38, 0x10, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x38, 0x18, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x38, 0x08, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x38, 0x30, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x14, 0x01, 0x07, 0x00, "0" }, - {0x14, 0x01, 0x07, 0x01, "1" }, - {0x14, 0x01, 0x07, 0x02, "2" }, - {0x14, 0x01, 0x07, 0x03, "3" }, - {0x14, 0x01, 0x07, 0x04, "4" }, - {0x14, 0x01, 0x07, 0x05, "5" }, - {0x14, 0x01, 0x07, 0x06, "6" }, - {0x14, 0x01, 0x07, 0x07, "7" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Region" }, - {0x14, 0x01, 0x10, 0x10, "Korea" }, - {0x14, 0x01, 0x10, 0x00, "Europe" }, -}; - -STDDIPINFO(Lockonph) - -static struct BurnDIPInfo MvpDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Credits Needed" }, - {0x15, 0x01, 0x01, 0x01, "1 to start, 1 to continue" }, - {0x15, 0x01, 0x01, 0x00, "2 to start, 1 to continue" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Innings" }, - {0x15, 0x01, 0x04, 0x04, "1 Credit 1 Inning Only" }, - {0x15, 0x01, 0x04, 0x0c, "+2 Credits 3 Innings" }, - - {0 , 0xfe, 0 , 8 , "Time Limits" }, - {0x15, 0x01, 0x38, 0x18, "Easy" }, - {0x15, 0x01, 0x38, 0x28, "Easy 2" }, - {0x15, 0x01, 0x38, 0x08, "Easy 3" }, - {0x15, 0x01, 0x38, 0x38, "Normal" }, - {0x15, 0x01, 0x38, 0x30, "Hard" }, - {0x15, 0x01, 0x38, 0x10, "Hard 2" }, - {0x15, 0x01, 0x38, 0x20, "Hard 3" }, - {0x15, 0x01, 0x38, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0xc0, 0x80, "Easy" }, - {0x15, 0x01, 0xc0, 0x40, "Easy 2" }, - {0x15, 0x01, 0xc0, 0xc0, "Normal" }, - {0x15, 0x01, 0xc0, 0x30, "Hard" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x16) -}; - -STDDIPINFO(Mvp) - -static struct BurnDIPInfo PassshtDIPList[]= -{ - // Default Values - {0x17, 0xff, 0xff, 0xf0, NULL }, - {0x18, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Initial Point" }, - {0x17, 0x01, 0x0e, 0x06, "2000" }, - {0x17, 0x01, 0x0e, 0x0a, "3000" }, - {0x17, 0x01, 0x0e, 0x0c, "4000" }, - {0x17, 0x01, 0x0e, 0x0e, "5000" }, - {0x17, 0x01, 0x0e, 0x08, "6000" }, - {0x17, 0x01, 0x0e, 0x04, "7000" }, - {0x17, 0x01, 0x0e, 0x02, "8000" }, - {0x17, 0x01, 0x0e, 0x00, "9000" }, - - {0 , 0xfe, 0 , 4 , "Point Table" }, - {0x17, 0x01, 0x30, 0x20, "Easy" }, - {0x17, 0x01, 0x30, 0x30, "Normal" }, - {0x17, 0x01, 0x30, 0x10, "Hard" }, - {0x17, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x17, 0x01, 0xc0, 0x80, "Easy" }, - {0x17, 0x01, 0xc0, 0xc0, "Normal" }, - {0x17, 0x01, 0xc0, 0x40, "Hard" }, - {0x17, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x18) -}; - -STDDIPINFO(Passsht) - - -static struct BurnDIPInfo PassshtaDIPList[]= -{ - // Default Values - {0x29, 0xff, 0xff, 0xf0, NULL }, - {0x2a, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x29, 0x01, 0x01, 0x01, "Off" }, - {0x29, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Initial Point" }, - {0x29, 0x01, 0x0e, 0x06, "2000" }, - {0x29, 0x01, 0x0e, 0x0a, "3000" }, - {0x29, 0x01, 0x0e, 0x0c, "4000" }, - {0x29, 0x01, 0x0e, 0x0e, "5000" }, - {0x29, 0x01, 0x0e, 0x08, "6000" }, - {0x29, 0x01, 0x0e, 0x04, "7000" }, - {0x29, 0x01, 0x0e, 0x02, "8000" }, - {0x29, 0x01, 0x0e, 0x00, "9000" }, - - {0 , 0xfe, 0 , 4 , "Point Table" }, - {0x29, 0x01, 0x30, 0x20, "Easy" }, - {0x29, 0x01, 0x30, 0x30, "Normal" }, - {0x29, 0x01, 0x30, 0x10, "Hard" }, - {0x29, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x29, 0x01, 0xc0, 0x80, "Easy" }, - {0x29, 0x01, 0xc0, 0xc0, "Normal" }, - {0x29, 0x01, 0xc0, 0x40, "Hard" }, - {0x29, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x2a) -}; - -STDDIPINFO(Passshta) - -static struct BurnDIPInfo CencourtDIPList[]= -{ - // Default Values - {0x29, 0xff, 0xff, 0xf1, NULL }, - {0x2a, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Debug Display" }, - {0x29, 0x01, 0x01, 0x01, "Off" }, - {0x29, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Initial Point" }, - {0x29, 0x01, 0x0e, 0x06, "2000" }, - {0x29, 0x01, 0x0e, 0x0a, "3000" }, - {0x29, 0x01, 0x0e, 0x0c, "4000" }, - {0x29, 0x01, 0x0e, 0x0e, "5000" }, - {0x29, 0x01, 0x0e, 0x08, "6000" }, - {0x29, 0x01, 0x0e, 0x04, "7000" }, - {0x29, 0x01, 0x0e, 0x02, "8000" }, - {0x29, 0x01, 0x0e, 0x00, "9000" }, - - {0 , 0xfe, 0 , 4 , "Point Table" }, - {0x29, 0x01, 0x30, 0x20, "Easy" }, - {0x29, 0x01, 0x30, 0x30, "Normal" }, - {0x29, 0x01, 0x30, 0x10, "Hard" }, - {0x29, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x29, 0x01, 0xc0, 0x80, "Easy" }, - {0x29, 0x01, 0xc0, 0xc0, "Normal" }, - {0x29, 0x01, 0xc0, 0x40, "Hard" }, - {0x29, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x2a) -}; - -STDDIPINFO(Cencourt) - -static struct BurnDIPInfo RiotcityDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x0c, 0x00, "1" }, - {0x13, 0x01, 0x0c, 0x0c, "2" }, - {0x13, 0x01, 0x0c, 0x08, "3" }, - {0x13, 0x01, 0x0c, 0x04, "4" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x30, 0x20, "Easy" }, - {0x13, 0x01, 0x30, 0x30, "Normal" }, - {0x13, 0x01, 0x30, 0x10, "Hard" }, - {0x13, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x13, 0x01, 0x40, 0x40, "Normal" }, - {0x13, 0x01, 0x40, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Attack button to start" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x14) -}; - -STDDIPINFO(Riotcity) - -static struct BurnDIPInfo RyukyuDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0xf8, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x01, 0x01, "Off" }, - {0x0d, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Cancel per credit" }, - {0x0d, 0x01, 0x02, 0x00, "2" }, - {0x0d, 0x01, 0x02, 0x02, "3" }, - - {0 , 0xfe, 0 , 2 , "Timer Speed" }, - {0x0d, 0x01, 0x04, 0x04, "20 seconds" }, - {0x0d, 0x01, 0x04, 0x00, "30 seconds" }, - - {0 , 0xfe, 0 , 2 , "PCM Voice" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Omikuji Difficulty" }, - {0x0d, 0x01, 0x30, 0x20, "Easy" }, - {0x0d, 0x01, 0x30, 0x30, "Normal" }, - {0x0d, 0x01, 0x30, 0x10, "Hard" }, - {0x0d, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0d, 0x01, 0xc0, 0x80, "Easy" }, - {0x0d, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0d, 0x01, 0xc0, 0x40, "Hard" }, - {0x0d, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x0e) -}; - -STDDIPINFO(Ryukyu) - -static struct BurnDIPInfo SdibDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfd, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x01, 0x01, "No" }, - {0x15, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x0c, 0x08, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x04, "4" }, - {0x15, 0x01, 0x0c, 0x00, "Free" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x30, 0x20, "Easy" }, - {0x15, 0x01, 0x30, 0x30, "Normal" }, - {0x15, 0x01, 0x30, 0x10, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0xc0, 0x80, "Every 50000" }, - {0x15, 0x01, 0xc0, 0xc0, "50000" }, - {0x15, 0x01, 0xc0, 0x40, "100000" }, - {0x15, 0x01, 0xc0, 0x00, "None" }, - - // Dip 1 - SYSTEM16B_COINAGE(0x16) -}; - -STDDIPINFO(Sdib) - -static struct BurnDIPInfo ShinobiDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfc, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x15, 0x01, 0x01, 0x00, "Upright" }, - {0x15, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x0c, 0x08, "2" }, - {0x15, 0x01, 0x0c, 0x0c, "3" }, - {0x15, 0x01, 0x0c, 0x04, "5" }, - {0x15, 0x01, 0x0c, 0x00, "240" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x30, 0x20, "Easy" }, - {0x15, 0x01, 0x30, 0x30, "Normal" }, - {0x15, 0x01, 0x30, 0x10, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Enemy Bullet Speed" }, - {0x15, 0x01, 0x40, 0x40, "Slow" }, - {0x15, 0x01, 0x40, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x15, 0x01, 0x80, 0x80, "Japanese" }, - {0x15, 0x01, 0x80, 0x00, "English" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x16) -}; - -STDDIPINFO(Shinobi) - -static struct BurnDIPInfo SonicbomDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x13, 0x01, 0x07, 0x06, "Easy" }, - {0x13, 0x01, 0x07, 0x07, "Normal" }, - {0x13, 0x01, 0x07, 0x05, "Hard 1" }, - {0x13, 0x01, 0x07, 0x04, "Hard 2" }, - {0x13, 0x01, 0x07, 0x03, "Hard 3" }, - {0x13, 0x01, 0x07, 0x02, "Hard 4" }, - {0x13, 0x01, 0x07, 0x01, "Hard 5" }, - {0x13, 0x01, 0x07, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x18, 0x10, "2" }, - {0x13, 0x01, 0x18, 0x18, "3" }, - {0x13, 0x01, 0x18, 0x08, "4" }, - {0x13, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x13, 0x01, 0x60, 0x40, "30000" }, - {0x13, 0x01, 0x60, 0x60, "40000" }, - {0x13, 0x01, 0x60, 0x20, "50000" }, - {0x13, 0x01, 0x60, 0x00, "60000" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x14) -}; - -STDDIPINFO(Sonicbom) - -static struct BurnDIPInfo SjryukoDIPList[]= -{ - // Default Values - {0x1c, 0xff, 0xff, 0xff, NULL }, - {0x1d, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - - - // Dip 2 - SYSTEM16B_COINAGE(0x1d) -}; - -STDDIPINFO(Sjryuko) - -static struct BurnDIPInfo SnapperDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xff, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 8 , "Coin A" }, - {0x0a, 0x01, 0x07, 0x07, "1 Coin 1 Credit" }, - {0x0a, 0x01, 0x07, 0x06, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x0a, 0x01, 0x07, 0x03, "1 Coin 5 Credits" }, - {0x0a, 0x01, 0x07, 0x02, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x07, 0x01, "3 Coins 1 Credit" }, - {0x0a, 0x01, 0x07, 0x00, "4 Coins 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0a, 0x01, 0x18, 0x10, "3" }, - {0x0a, 0x01, 0x18, 0x18, "4" }, - {0x0a, 0x01, 0x18, 0x08, "5" }, - {0x0a, 0x01, 0x18, 0x00, "6" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x10, 0x00, "Off" }, - {0x0b, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x80, 0x80, "Off" }, - {0x0b, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Snapper) - -static struct BurnDIPInfo TetrisDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfd, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x30, 0x20, "Easy" }, - {0x11, 0x01, 0x30, 0x30, "Normal" }, - {0x11, 0x01, 0x30, 0x10, "Hard" }, - {0x11, 0x01, 0x30, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x12) -}; - -STDDIPINFO(Tetris) - -static struct BurnDIPInfo TimescanDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xf5, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - - {0 , 0xfe, 0 , 16 , "Bonus" }, - {0x13, 0x01, 0x1e, 0x16, "Replay 1000000/2000000" }, - {0x13, 0x01, 0x1e, 0x14, "Replay 1200000/2500000" }, - {0x13, 0x01, 0x1e, 0x12, "Replay 1500000/3000000" }, - {0x13, 0x01, 0x1e, 0x10, "Replay 2000000/4000000" }, - {0x13, 0x01, 0x1e, 0x1c, "Replay 1000000" }, - {0x13, 0x01, 0x1e, 0x1e, "Replay 1200000" }, - {0x13, 0x01, 0x1e, 0x1a, "Replay 1500000" }, - {0x13, 0x01, 0x1e, 0x18, "Replay 1800000" }, - {0x13, 0x01, 0x1e, 0x0e, "Extra Ball 100000" }, - {0x13, 0x01, 0x1e, 0x0c, "Extra Ball 200000" }, - {0x13, 0x01, 0x1e, 0x0a, "Extra Ball 300000" }, - {0x13, 0x01, 0x1e, 0x08, "Extra Ball 400000" }, - {0x13, 0x01, 0x1e, 0x06, "Extra Ball 500000" }, - {0x13, 0x01, 0x1e, 0x04, "Extra Ball 600000" }, - {0x13, 0x01, 0x1e, 0x02, "Extra Ball 700000" }, - {0x13, 0x01, 0x1e, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Match" }, - {0x13, 0x01, 0x20, 0x00, "Off" }, - {0x13, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Pin Rebound" }, - {0x13, 0x01, 0x40, 0x40, "Well" }, - {0x13, 0x01, 0x40, 0x00, "A Little" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x13, 0x01, 0x80, 0x80, "3" }, - {0x13, 0x01, 0x80, 0x00, "5" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x14) - - // Dip 3 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Out Lane Pin" }, - {0x15, 0x01, 0x02, 0x02, "Near" }, - {0x15, 0x01, 0x02, 0x00, "Far" }, - - {0 , 0xfe, 0 , 4 , "Special" }, - {0x15, 0x01, 0x0c, 0x08, "7 Credits" }, - {0x15, 0x01, 0x0c, 0x0c, "3 Credits" }, - {0x15, 0x01, 0x0c, 0x04, "1 Credit" }, - {0x15, 0x01, 0x0c, 0x00, "2000000 Points" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x10, 0x00, "No" }, - {0x15, 0x01, 0x10, 0x10, "Yes" }, -}; - -STDDIPINFO(Timescan) - -static struct BurnDIPInfo ToryumonDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x01, 0x01, "Off" }, - {0x11, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "VS-Mode Battle" }, - {0x11, 0x01, 0x10, 0x10, "1" }, - {0x11, 0x01, 0x10, 0x00, "3" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x11, 0x01, 0xe0, 0xc0, "Easy" }, - {0x11, 0x01, 0xe0, 0xe0, "Normal" }, - {0x11, 0x01, 0xe0, 0xa0, "Hard" }, - {0x11, 0x01, 0xe0, 0x80, "Hard+1" }, - {0x11, 0x01, 0xe0, 0x60, "Hard+2" }, - {0x11, 0x01, 0xe0, 0x40, "Hard+3" }, - {0x11, 0x01, 0xe0, 0x20, "Hard+4" }, - {0x11, 0x01, 0xe0, 0x00, "Hard+5" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x12) -}; - -STDDIPINFO(Toryumon) - -static struct BurnDIPInfo TturfDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0x2c, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Continues" }, - {0x15, 0x01, 0x03, 0x00, "None" }, - {0x15, 0x01, 0x03, 0x01, "3" }, - {0x15, 0x01, 0x03, 0x02, "Unlimited" }, - {0x15, 0x01, 0x03, 0x03, "Unlimited" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x0c, 0x08, "Easy" }, - {0x15, 0x01, 0x0c, 0x0c, "Normal" }, - {0x15, 0x01, 0x0c, 0x04, "Hard" }, - {0x15, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Starting Energy" }, - {0x15, 0x01, 0x30, 0x00, "3" }, - {0x15, 0x01, 0x30, 0x10, "4" }, - {0x15, 0x01, 0x30, 0x20, "6" }, - {0x15, 0x01, 0x30, 0x30, "8" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Bonus Energy" }, - {0x15, 0x01, 0x80, 0x80, "1" }, - {0x15, 0x01, 0x80, 0x00, "2" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x16) -}; - -STDDIPINFO(Tturf) - -static struct BurnDIPInfo Wb3DIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x0c, 0x00, "2" }, - {0x13, 0x01, 0x0c, 0x0c, "3" }, - {0x13, 0x01, 0x0c, 0x08, "4" }, - {0x13, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x13, 0x01, 0x10, 0x10, "5k, 10k, 18k, 30k" }, - {0x13, 0x01, 0x10, 0x00, "5k, 15k, 30k" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x13, 0x01, 0x20, 0x20, "Normal" }, - {0x13, 0x01, 0x20, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Invincible Mode" }, - {0x13, 0x01, 0x40, 0x40, "No" }, - {0x13, 0x01, 0x40, 0x00, "Yes" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x14) -}; - -STDDIPINFO(Wb3) - -static struct BurnDIPInfo WrestwarDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Round Time" }, - {0x13, 0x01, 0x0c, 0x00, "100" }, - {0x13, 0x01, 0x0c, 0x0c, "110" }, - {0x13, 0x01, 0x0c, 0x08, "120" }, - {0x13, 0x01, 0x0c, 0x04, "130" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x13, 0x01, 0x20, 0x00, "No" }, - {0x13, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x13, 0x01, 0xc0, 0x80, "Easy" }, - {0x13, 0x01, 0xc0, 0xc0, "Normal" }, - {0x13, 0x01, 0xc0, 0x40, "Hard" }, - {0x13, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - SYSTEM16B_COINAGE(0x14) -}; - -STDDIPINFO(Wrestwar) - -#undef SYSTEM16B_COINAGE - -/*==================================================== -Rom defs -====================================================*/ - -static struct BurnRomInfo AceattacRomDesc[] = { - { "epr-11491.a4", 0x10000, 0xf3c19c36, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11489.a1", 0x10000, 0xbbe623c5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11492.a5", 0x10000, 0xd8bd3139, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11490.a2", 0x10000, 0x38cb3a41, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11493.b9", 0x10000, 0x654485d9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11494.b10", 0x10000, 0xb67971ab, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11495.b11", 0x10000, 0xb687ab61, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11501.b1", 0x10000, 0x09179ead, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11505.b5", 0x10000, 0xb67f1ecf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11502.b2", 0x10000, 0x7464bae4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11506.b6", 0x10000, 0xb0104def, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11503.b3", 0x10000, 0x344c0692, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11507.b7", 0x10000, 0xa2af710a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11504.b4", 0x10000, 0x42b4a5f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11508.b8", 0x10000, 0x5cbb833c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11496.a7", 0x08000, 0x82cb40a9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11497.a8", 0x08000, 0xb04f62cc, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11498.a9", 0x08000, 0x97baf52b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11499.a10", 0x08000, 0xea332866, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11500.a11", 0x08000, 0x2ddf1c31, SYS16_ROM_UPD7759DATA | BRF_SND }, - - // reconstructed key; some of the RNG-independent bits could be incorrect - { "317-0059.key", 0x02000, 0x4512e2fa, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aceattac) -STD_ROM_FN(Aceattac) - -static struct BurnRomInfo AliensynRomDesc[] = { - { "epr-11083.a4", 0x08000, 0xcb2ad9b3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11080.a1", 0x08000, 0xfe7378d9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11084.a5", 0x08000, 0x2e1ec7b1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11081.a2", 0x08000, 0x1308ee63, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11085.a6", 0x08000, 0xcff78f39, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11082.a3", 0x08000, 0x9cdc2a14, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10702.b9", 0x10000, 0x393bc813, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10703.b10", 0x10000, 0x6b6dd9f5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10704.b11", 0x10000, 0x911e7ebc, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10709.b1", 0x10000, 0xaddf0a90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10713.b5", 0x10000, 0xececde3a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10710.b2", 0x10000, 0x992369eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10714.b6", 0x10000, 0x91bf42fb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10711.b3", 0x10000, 0x29166ef6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10715.b7", 0x10000, 0xa7c57384, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10712.b4", 0x10000, 0x876ad019, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10716.b8", 0x10000, 0x40ba1d48, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10723.a7", 0x08000, 0x99953526, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10724.a8", 0x08000, 0xf971a817, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10725.a9", 0x08000, 0x6a50e08f, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10726.a10", 0x08000, 0xd50b7736, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Aliensyn) -STD_ROM_FN(Aliensyn) - -static struct BurnRomInfo Aliensyn3RomDesc[] = { - { "epr-10816.a4", 0x08000, 0x17bf5304, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10814.a1", 0x08000, 0x4cd134df, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10817.a5", 0x08000, 0xc8b791b0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10815.a2", 0x08000, 0xbdcf4a30, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10822a.a6", 0x08000, 0x1d0790aa, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10819a.a3", 0x08000, 0x1e7586b7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10702.b9", 0x10000, 0x393bc813, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10703.b10", 0x10000, 0x6b6dd9f5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10704.b11", 0x10000, 0x911e7ebc, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10709.b1", 0x10000, 0xaddf0a90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10713.b5", 0x10000, 0xececde3a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10710.b2", 0x10000, 0x992369eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10714.b6", 0x10000, 0x91bf42fb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10711.b3", 0x10000, 0x29166ef6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10715.b7", 0x10000, 0xa7c57384, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10712.b4", 0x10000, 0x876ad019, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10716.b8", 0x10000, 0x40ba1d48, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10723.a7", 0x08000, 0x99953526, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10724.a8", 0x08000, 0xf971a817, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10725.a9", 0x08000, 0x6a50e08f, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10726.a10", 0x08000, 0xd50b7736, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0033.key", 0x02000, 0x49e882e5, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aliensyn3) -STD_ROM_FN(Aliensyn3) - -static struct BurnRomInfo Aliensyn7RomDesc[] = { - { "epr-11083.a4", 0x08000, 0xcb2ad9b3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11080.a1", 0x08000, 0xfe7378d9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11084.a5", 0x08000, 0x2e1ec7b1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11081.a2", 0x08000, 0x1308ee63, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11085.a6", 0x08000, 0xcff78f39, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11082.a3", 0x08000, 0x9cdc2a14, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10702.b9", 0x10000, 0x393bc813, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10703.b10", 0x10000, 0x6b6dd9f5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10704.b11", 0x10000, 0x911e7ebc, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10709.b1", 0x10000, 0xaddf0a90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10713.b5", 0x10000, 0xececde3a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10710.b2", 0x10000, 0x992369eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10714.b6", 0x10000, 0x91bf42fb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10711.b3", 0x10000, 0x29166ef6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10715.b7", 0x10000, 0xa7c57384, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10712.b4", 0x10000, 0x876ad019, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10716.b8", 0x10000, 0x40ba1d48, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11086.a7", 0x08000, 0xc7fddc28, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10724.a8", 0x08000, 0xf971a817, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10725.a9", 0x08000, 0x6a50e08f, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10726.a10", 0x08000, 0xd50b7736, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-00xx.key", 0x02000, 0x76b370cd, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aliensyn7) -STD_ROM_FN(Aliensyn7) - -static struct BurnRomInfo AliensynjRomDesc[] = { - { "epr-10720a.a4", 0x08000, 0x1b920893, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10717a.a1", 0x08000, 0x972ae358, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10721a.a5", 0x08000, 0xf4d2d1c3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10718a.a2", 0x08000, 0xc79bf61b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10722a.a6", 0x08000, 0x1d0790aa, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10719a.a3", 0x08000, 0x1e7586b7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10702.b9", 0x10000, 0x393bc813, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10703.b10", 0x10000, 0x6b6dd9f5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10704.b11", 0x10000, 0x911e7ebc, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10709.b1", 0x10000, 0xaddf0a90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10713.b5", 0x10000, 0xececde3a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10710.b2", 0x10000, 0x992369eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10714.b6", 0x10000, 0x91bf42fb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10711.b3", 0x10000, 0x29166ef6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10715.b7", 0x10000, 0xa7c57384, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10712.b4", 0x10000, 0x876ad019, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10716.b8", 0x10000, 0x40ba1d48, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10723.a7", 0x08000, 0x99953526, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10724.a8", 0x08000, 0xf971a817, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10725.a9", 0x08000, 0x6a50e08f, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10726.a10", 0x08000, 0xd50b7736, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0033.key", 0x02000, 0x49e882e5, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aliensynj) -STD_ROM_FN(Aliensynj) - -static struct BurnRomInfo AltbeastRomDesc[] = { - { "epr-11907.a7", 0x20000, 0x29e0c3ad, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11906.a5", 0x20000, 0x4c9e9cd8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11674.a14", 0x20000, 0xa57a66d5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11675.a15", 0x20000, 0x2ef2f144, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11676.a16", 0x20000, 0x0c04acac, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11677.b1", 0x20000, 0xa01425cd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11681.b5", 0x20000, 0xd9e03363, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11678.b2", 0x20000, 0x17a9fc53, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11682.b6", 0x20000, 0xe3f77c5e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11679.b3", 0x20000, 0x14dcc245, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11683.b7", 0x20000, 0xf9a60f06, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11680.b4", 0x20000, 0xf43dcdec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11684.b8", 0x20000, 0xb20c0edb, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11671.a10", 0x08000, 0x2b71343b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0078.c2", 0x01000, 0x8101925f, SYS16_ROM_I8751 | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Altbeast) -STD_ROM_FN(Altbeast) - -static struct BurnRomInfo AltbeastjRomDesc[] = { - { "epr-11885.a7", 0x20000, 0x5bb715aa, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11884.a5", 0x20000, 0xe1707090, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11722.a14", 0x10000, 0xadaa8db5, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11736.b14", 0x10000, 0xe9ad5e89, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11723.a15", 0x10000, 0x131a3f9a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11737.b15", 0x10000, 0x2e420023, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11724.a16", 0x10000, 0x6f2ed50a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11738.b16", 0x10000, 0xde3d6d02, SYS16_ROM_TILES_20000 | BRF_GRA }, - - { "epr-11725.b1", 0x10000, 0xf8b3684e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11729.b5", 0x10000, 0xae3c2793, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11726.b2", 0x10000, 0x3cce5419, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11730.b6", 0x10000, 0x3af62b55, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11727.b3", 0x10000, 0xb0390078, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11731.b7", 0x10000, 0x2a87744a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11728.b4", 0x10000, 0xf3a43fd8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11732.b8", 0x10000, 0x2fb3e355, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11717.a1", 0x10000, 0x676be0cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11733.b10", 0x10000, 0x802cac94, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11718.a2", 0x10000, 0x882864c2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11734.b11", 0x10000, 0x76c704d2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11719.a3", 0x10000, 0x339987f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11735.b12", 0x10000, 0x4fe406aa, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11671.a10", 0x08000, 0x2b71343b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0077.c2", 0x01000, 0x00000000, BRF_NODUMP }, -}; - - -STD_ROM_PICK(Altbeastj) -STD_ROM_FN(Altbeastj) - -static struct BurnRomInfo Altbeast2RomDesc[] = { - { "epr-11705.a7", 0x20000, 0x57dc5c7a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11704.a5", 0x20000, 0x33bbcf07, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11674.a14", 0x20000, 0xa57a66d5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11675.a15", 0x20000, 0x2ef2f144, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11676.a16", 0x20000, 0x0c04acac, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11677.b1", 0x20000, 0xa01425cd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11681.b5", 0x20000, 0xd9e03363, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11678.b2", 0x20000, 0x17a9fc53, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11682.b6", 0x20000, 0xe3f77c5e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11679.b3", 0x20000, 0x14dcc245, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11683.b7", 0x20000, 0xf9a60f06, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11680.b4", 0x20000, 0xf43dcdec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11684.b8", 0x20000, 0xb20c0edb, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11686.a10", 0x08000, 0x828a45b3, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0066.key", 0x02000, 0xed85a054, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Altbeast2) -STD_ROM_FN(Altbeast2) - -static struct BurnRomInfo Altbeastj1RomDesc[] = { - { "epr-11670.a7", 0x20000, 0xb748eb07, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11669.a5", 0x20000, 0x005ecd11, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11674.a14", 0x20000, 0xa57a66d5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11675.a15", 0x20000, 0x2ef2f144, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11676.a16", 0x20000, 0x0c04acac, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11677.b1", 0x20000, 0xa01425cd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11681.b5", 0x20000, 0xd9e03363, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11678.b2", 0x20000, 0x17a9fc53, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11682.b6", 0x20000, 0xe3f77c5e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11679.b3", 0x20000, 0x14dcc245, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11683.b7", 0x20000, 0xf9a60f06, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11680.b4", 0x20000, 0xf43dcdec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11684.b8", 0x20000, 0xb20c0edb, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11671.a10", 0x08000, 0x2b71343b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, - - // reconstructed key; some of the RNG-independent bits could be incorrect - { "317-0065.key", 0x02000, 0x9e0f619d, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Altbeastj1) -STD_ROM_FN(Altbeastj1) - - -static struct BurnRomInfo Altbeastj3RomDesc[] = { - { "epr-11721.a7", 0x20000, 0x1c5d11de, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11720.a5", 0x20000, 0x735350cf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11722.a14", 0x10000, 0xadaa8db5, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11736.b14", 0x10000, 0xe9ad5e89, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11723.a15", 0x10000, 0x131a3f9a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11737.b15", 0x10000, 0x2e420023, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11724.a16", 0x10000, 0x6f2ed50a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11738.b16", 0x10000, 0xde3d6d02, SYS16_ROM_TILES_20000 | BRF_GRA }, - - { "epr-11725.b1", 0x10000, 0xf8b3684e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11729.b5", 0x10000, 0xae3c2793, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11726.b2", 0x10000, 0x3cce5419, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11730.b6", 0x10000, 0x3af62b55, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11727.b3", 0x10000, 0xb0390078, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11731.b7", 0x10000, 0x2a87744a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11728.b4", 0x10000, 0xf3a43fd8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11732.b8", 0x10000, 0x2fb3e355, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11717.a1", 0x10000, 0x676be0cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11733.b10", 0x10000, 0x802cac94, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11718.a2", 0x10000, 0x882864c2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11734.b11", 0x10000, 0x76c704d2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11719.a3", 0x10000, 0x339987f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11735.b12", 0x10000, 0x4fe406aa, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11671.a10", 0x08000, 0x2b71343b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0068.key", 0x02000, 0xc1ed4310, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Altbeastj3) -STD_ROM_FN(Altbeastj3) - -static struct BurnRomInfo Altbeastj3dRomDesc[] = { - { "bootleg_epr-11721.a7", 0x20000, 0xb9c963a0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11720.a5", 0x20000, 0x6a1e91fc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11722.a14", 0x10000, 0xadaa8db5, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11736.b14", 0x10000, 0xe9ad5e89, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11723.a15", 0x10000, 0x131a3f9a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11737.b15", 0x10000, 0x2e420023, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11724.a16", 0x10000, 0x6f2ed50a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11738.b16", 0x10000, 0xde3d6d02, SYS16_ROM_TILES_20000 | BRF_GRA }, - - { "epr-11725.b1", 0x10000, 0xf8b3684e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11729.b5", 0x10000, 0xae3c2793, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11726.b2", 0x10000, 0x3cce5419, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11730.b6", 0x10000, 0x3af62b55, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11727.b3", 0x10000, 0xb0390078, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11731.b7", 0x10000, 0x2a87744a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11728.b4", 0x10000, 0xf3a43fd8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11732.b8", 0x10000, 0x2fb3e355, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11717.a1", 0x10000, 0x676be0cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11733.b10", 0x10000, 0x802cac94, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11718.a2", 0x10000, 0x882864c2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11734.b11", 0x10000, 0x76c704d2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11719.a3", 0x10000, 0x339987f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11735.b12", 0x10000, 0x4fe406aa, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11671.a10", 0x08000, 0x2b71343b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Altbeastj3d) -STD_ROM_FN(Altbeastj3d) - -static struct BurnRomInfo Altbeast4RomDesc[] = { - { "epr-11740.a7", 0x20000, 0xce227542, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11739.a5", 0x20000, 0xe466eb65, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11722.a14", 0x10000, 0xadaa8db5, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11736.b14", 0x10000, 0xe9ad5e89, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11723.a15", 0x10000, 0x131a3f9a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11737.b15", 0x10000, 0x2e420023, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11724.a16", 0x10000, 0x6f2ed50a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11738.b16", 0x10000, 0xde3d6d02, SYS16_ROM_TILES_20000 | BRF_GRA }, - - { "epr-11725.b1", 0x10000, 0xf8b3684e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11729.b5", 0x10000, 0xae3c2793, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11726.b2", 0x10000, 0x3cce5419, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11730.b6", 0x10000, 0x3af62b55, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11727.b3", 0x10000, 0xb0390078, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11731.b7", 0x10000, 0x2a87744a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11728.b4", 0x10000, 0xf3a43fd8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11732.b8", 0x10000, 0x2fb3e355, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11717.a1", 0x10000, 0x676be0cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11733.b10", 0x10000, 0x802cac94, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11718.a2", 0x10000, 0x882864c2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11734.b11", 0x10000, 0x76c704d2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11719.a3", 0x10000, 0x339987f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11735.b12", 0x10000, 0x4fe406aa, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11686.a10", 0x08000, 0x828a45b3, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0066.key", 0x02000, 0xed85a054, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Altbeast4) -STD_ROM_FN(Altbeast4) - -static struct BurnRomInfo Altbeast5RomDesc[] = { - { "epr-11742.a7", 0x20000, 0x61839534, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11741.a5", 0x20000, 0x9b2159cb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11722.a14", 0x10000, 0xadaa8db5, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11736.b14", 0x10000, 0xe9ad5e89, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11723.a15", 0x10000, 0x131a3f9a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11737.b15", 0x10000, 0x2e420023, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11724.a16", 0x10000, 0x6f2ed50a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11738.b16", 0x10000, 0xde3d6d02, SYS16_ROM_TILES_20000 | BRF_GRA }, - - { "epr-11725.b1", 0x10000, 0xf8b3684e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11729.b5", 0x10000, 0xae3c2793, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11726.b2", 0x10000, 0x3cce5419, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11730.b6", 0x10000, 0x3af62b55, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11727.b3", 0x10000, 0xb0390078, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11731.b7", 0x10000, 0x2a87744a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11728.b4", 0x10000, 0xf3a43fd8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11732.b8", 0x10000, 0x2fb3e355, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11717.a1", 0x10000, 0x676be0cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11733.b10", 0x10000, 0x802cac94, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11718.a2", 0x10000, 0x882864c2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11734.b11", 0x10000, 0x76c704d2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11719.a3", 0x10000, 0x339987f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11735.b12", 0x10000, 0x4fe406aa, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11671.a10", 0x08000, 0x2b71343b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0069.key", 0x02000, 0x959e256a, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Altbeast5) -STD_ROM_FN(Altbeast5) - -static struct BurnRomInfo Altbeast5dRomDesc[] = { - { "bootleg_epr-11742.a7", 0x20000, 0x62c517e1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11741.a5", 0x20000, 0x5873f049, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11722.a14", 0x10000, 0xadaa8db5, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11736.b14", 0x10000, 0xe9ad5e89, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11723.a15", 0x10000, 0x131a3f9a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11737.b15", 0x10000, 0x2e420023, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11724.a16", 0x10000, 0x6f2ed50a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11738.b16", 0x10000, 0xde3d6d02, SYS16_ROM_TILES_20000 | BRF_GRA }, - - { "epr-11725.b1", 0x10000, 0xf8b3684e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11729.b5", 0x10000, 0xae3c2793, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11726.b2", 0x10000, 0x3cce5419, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11730.b6", 0x10000, 0x3af62b55, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11727.b3", 0x10000, 0xb0390078, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11731.b7", 0x10000, 0x2a87744a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11728.b4", 0x10000, 0xf3a43fd8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11732.b8", 0x10000, 0x2fb3e355, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11717.a1", 0x10000, 0x676be0cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11733.b10", 0x10000, 0x802cac94, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11718.a2", 0x10000, 0x882864c2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11734.b11", 0x10000, 0x76c704d2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11719.a3", 0x10000, 0x339987f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11735.b12", 0x10000, 0x4fe406aa, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11671.a10", 0x08000, 0x2b71343b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Altbeast5d) -STD_ROM_FN(Altbeast5d) - -static struct BurnRomInfo Altbeast6RomDesc[] = { - { "epr-11883.a7", 0x20000, 0xc5b3e8f7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11882.a5", 0x20000, 0x9c01170b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11722.a14", 0x10000, 0xadaa8db5, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11736.b14", 0x10000, 0xe9ad5e89, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11723.a15", 0x10000, 0x131a3f9a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11737.b15", 0x10000, 0x2e420023, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11724.a16", 0x10000, 0x6f2ed50a, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "epr-11738.b16", 0x10000, 0xde3d6d02, SYS16_ROM_TILES_20000 | BRF_GRA }, - - { "epr-11725.b1", 0x10000, 0xf8b3684e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11729.b5", 0x10000, 0xae3c2793, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11726.b2", 0x10000, 0x3cce5419, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11730.b6", 0x10000, 0x3af62b55, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11727.b3", 0x10000, 0xb0390078, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11731.b7", 0x10000, 0x2a87744a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11728.b4", 0x10000, 0xf3a43fd8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11732.b8", 0x10000, 0x2fb3e355, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11717.a1", 0x10000, 0x676be0cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11733.b10", 0x10000, 0x802cac94, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11718.a2", 0x10000, 0x882864c2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11734.b11", 0x10000, 0x76c704d2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11719.a3", 0x10000, 0x339987f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11735.b12", 0x10000, 0x4fe406aa, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11671.a10", 0x08000, 0x2b71343b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-11672.a11", 0x20000, 0xbbd7f460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-11673.a12", 0x20000, 0x400c4a36, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0076.c2", 0x01000, 0x00000000, BRF_NODUMP }, -}; - - -STD_ROM_PICK(Altbeast6) -STD_ROM_FN(Altbeast6) - -static struct BurnRomInfo AltbeastblRomDesc[] = { - { "4.bin", 0x10000, 0x790b4b3a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "6.bin", 0x10000, 0x0f65f25d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "3.bin", 0x10000, 0x65cdd72b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "5.bin", 0x10000, 0x3393fbc4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "12.bin", 0x10000, 0xa4967d10, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "11.bin", 0x10000, 0x021e82ab, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "10.bin", 0x10000, 0x1a26cf3f, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "9.bin", 0x10000, 0x277ef086, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "8.bin", 0x10000, 0x661225af, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "7.bin", 0x10000, 0xd7019da7, SYS16_ROM_TILES_20000 | BRF_GRA }, - - { "18.bin", 0x10000, 0xf8b3684e, SYS16_ROM_SPRITES | BRF_GRA }, - { "22.bin", 0x10000, 0xae3c2793, SYS16_ROM_SPRITES | BRF_GRA }, - { "17.bin", 0x10000, 0x3cce5419, SYS16_ROM_SPRITES | BRF_GRA }, - { "21.bin", 0x10000, 0x3af62b55, SYS16_ROM_SPRITES | BRF_GRA }, - { "16.bin", 0x10000, 0xb0390078, SYS16_ROM_SPRITES | BRF_GRA }, - { "20.bin", 0x10000, 0x2a87744a, SYS16_ROM_SPRITES | BRF_GRA }, - { "15.bin", 0x10000, 0xf3a43fd8, SYS16_ROM_SPRITES | BRF_GRA }, - { "19.bin", 0x10000, 0x2fb3e355, SYS16_ROM_SPRITES | BRF_GRA }, - { "23.bin", 0x10000, 0x676be0cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "25.bin", 0x10000, 0x802cac94, SYS16_ROM_SPRITES | BRF_GRA }, - { "24.bin", 0x10000, 0x882864c2, SYS16_ROM_SPRITES | BRF_GRA }, - { "26.bin", 0x10000, 0x76c704d2, SYS16_ROM_SPRITES | BRF_GRA }, - { "13.bin", 0x10000, 0x339987f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "14.bin", 0x10000, 0x4fe406aa, SYS16_ROM_SPRITES | BRF_GRA }, - - { "1.bin", 0x10000, 0x67e09da3, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - { "2.bin", 0x10000, 0x7c653d8b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Altbeastbl) -STD_ROM_FN(Altbeastbl) - -static struct BurnRomInfo MutantwarrRomDesc[] = { - { "4.bin", 0x10000, 0x1bed3505, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "6.bin", 0x10000, 0x8bfb70e4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "3.bin", 0x10000, 0x40b0afec, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "5.bin", 0x10000, 0x2a9ef382, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "16.bin", 0x10000, 0xa4967d10, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "15.bin", 0x10000, 0xe091ae2c, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "14.bin", 0x10000, 0x1a26cf3f, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "13.bin", 0x10000, 0x277ef086, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "12.bin", 0x10000, 0x661225af, SYS16_ROM_TILES_20000 | BRF_GRA }, - { "11.bin", 0x10000, 0xd7019da7, SYS16_ROM_TILES_20000 | BRF_GRA }, - - { "20.bin", 0x10000, 0xf8b3684e, SYS16_ROM_SPRITES | BRF_GRA }, - { "10.bin", 0x10000, 0xae3c2793, SYS16_ROM_SPRITES | BRF_GRA }, - { "19.bin", 0x10000, 0x3cce5419, SYS16_ROM_SPRITES | BRF_GRA }, - { "9.bin", 0x10000, 0x3af62b55, SYS16_ROM_SPRITES | BRF_GRA }, - { "18.bin", 0x10000, 0xb0390078, SYS16_ROM_SPRITES | BRF_GRA }, - { "8.bin", 0x10000, 0x2a87744a, SYS16_ROM_SPRITES | BRF_GRA }, - { "17.bin", 0x10000, 0xf3a43fd8, SYS16_ROM_SPRITES | BRF_GRA }, - { "7.bin", 0x10000, 0x2fb3e355, SYS16_ROM_SPRITES | BRF_GRA }, - { "22.bin", 0x10000, 0x676be0cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "25.bin", 0x10000, 0x802cac94, SYS16_ROM_SPRITES | BRF_GRA }, - { "23.bin", 0x10000, 0x882864c2, SYS16_ROM_SPRITES | BRF_GRA }, - { "26.bin", 0x10000, 0x76c704d2, SYS16_ROM_SPRITES | BRF_GRA }, - { "21.bin", 0x10000, 0x339987f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "24.bin", 0x10000, 0x4fe406aa, SYS16_ROM_SPRITES | BRF_GRA }, - - { "1.bin", 0x10000, 0x67e09da3, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - { "2.bin", 0x10000, 0x7c653d8b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Mutantwarr) -STD_ROM_FN(Mutantwarr) - -static struct BurnRomInfo AtomicpRomDesc[] = { - { "ap-t2.bin", 0x10000, 0x97421047, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "ap-t1.bin", 0x10000, 0x5c65fe56, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "ap-t4.bin", 0x08000, 0x332e58f4, SYS16_ROM_TILES | BRF_GRA }, - { "ap-t3.bin", 0x08000, 0xdddc122c, SYS16_ROM_TILES | BRF_GRA }, - { "ap-t5.bin", 0x08000, 0xef5ecd6b, SYS16_ROM_TILES | BRF_GRA }, -}; - - -STD_ROM_PICK(Atomicp) -STD_ROM_FN(Atomicp) - -static struct BurnRomInfo AurailRomDesc[] = { - { "epr-13577.a7", 0x20000, 0x6701b686, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13576.a5", 0x20000, 0x1e428d94, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13447.a8", 0x20000, 0x70a52167, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13445.a6", 0x20000, 0x28dfc3dd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13450.a14", 0x20000, 0x0fc4a7a8, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13465.b14", 0x20000, 0xe08135e0, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13451.a15", 0x20000, 0x1c49852f, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13466.b15", 0x20000, 0xe14c6684, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13452.a16", 0x20000, 0x047bde5e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13467.b16", 0x20000, 0x6309fec4, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13453.b1", 0x20000, 0x5fa0a9f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13457.b5", 0x20000, 0x0d1b54da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13454.b2", 0x20000, 0x5f6b33b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13458.b6", 0x20000, 0xbad340c3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13455.b3", 0x20000, 0x4e80520b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13459.b7", 0x20000, 0x7e9165ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13456.b4", 0x20000, 0x5733c428, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13460.b8", 0x20000, 0x66b8f9b3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13440.a1", 0x20000, 0x4f370b2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13461.b10", 0x20000, 0xf76014bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13441.a2", 0x20000, 0x37cf9cb4, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13462.b11", 0x20000, 0x1061e7da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13442.a3", 0x20000, 0x049698ef, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13463.b12", 0x20000, 0x7dbcfbf1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13443.a4", 0x20000, 0x77a8989e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13464.b13", 0x20000, 0x551df422, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13448.a10", 0x08000, 0xb5183fb9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13449.a11", 0x20000, 0xd3d9aaf9, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Aurail) -STD_ROM_FN(Aurail) - -static struct BurnRomInfo Aurail1RomDesc[] = { - { "epr-13469.a7", 0x20000, 0xc628b69d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13468.a5", 0x20000, 0xce092218, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13447.a8", 0x20000, 0x70a52167, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13445.a6", 0x20000, 0x28dfc3dd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13450.a14", 0x20000, 0x0fc4a7a8, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13465.b14", 0x20000, 0xe08135e0, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13451.a15", 0x20000, 0x1c49852f, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13466.b15", 0x20000, 0xe14c6684, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13452.a16", 0x20000, 0x047bde5e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13467.b16", 0x20000, 0x6309fec4, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13453.b1", 0x20000, 0x5fa0a9f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13457.b5", 0x20000, 0x0d1b54da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13454.b2", 0x20000, 0x5f6b33b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13458.b6", 0x20000, 0xbad340c3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13455.b3", 0x20000, 0x4e80520b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13459.b7", 0x20000, 0x7e9165ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13456.b4", 0x20000, 0x5733c428, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13460.b8", 0x20000, 0x66b8f9b3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13440.a1", 0x20000, 0x4f370b2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13461.b10", 0x20000, 0xf76014bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13441.a2", 0x20000, 0x37cf9cb4, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13462.b11", 0x20000, 0x1061e7da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13442.a3", 0x20000, 0x049698ef, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13463.b12", 0x20000, 0x7dbcfbf1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13443.a4", 0x20000, 0x77a8989e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13464.b13", 0x20000, 0x551df422, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13448.a10", 0x08000, 0xb5183fb9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13449.a11", 0x20000, 0xd3d9aaf9, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0168.key", 0x02000, 0xbc2d1792, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aurail1) -STD_ROM_FN(Aurail1) - -static struct BurnRomInfo Aurail1dRomDesc[] = { - { "bootleg_epr-13469.a7", 0x20000, 0x75ef3eec, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13468.a5", 0x20000, 0xe46e4f55, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13447.a8", 0x20000, 0x70a52167, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13445.a6", 0x20000, 0x28dfc3dd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13450.a14", 0x20000, 0x0fc4a7a8, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13465.b14", 0x20000, 0xe08135e0, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13451.a15", 0x20000, 0x1c49852f, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13466.b15", 0x20000, 0xe14c6684, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13452.a16", 0x20000, 0x047bde5e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13467.b16", 0x20000, 0x6309fec4, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13453.b1", 0x20000, 0x5fa0a9f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13457.b5", 0x20000, 0x0d1b54da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13454.b2", 0x20000, 0x5f6b33b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13458.b6", 0x20000, 0xbad340c3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13455.b3", 0x20000, 0x4e80520b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13459.b7", 0x20000, 0x7e9165ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13456.b4", 0x20000, 0x5733c428, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13460.b8", 0x20000, 0x66b8f9b3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13440.a1", 0x20000, 0x4f370b2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13461.b10", 0x20000, 0xf76014bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13441.a2", 0x20000, 0x37cf9cb4, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13462.b11", 0x20000, 0x1061e7da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13442.a3", 0x20000, 0x049698ef, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13463.b12", 0x20000, 0x7dbcfbf1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13443.a4", 0x20000, 0x77a8989e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13464.b13", 0x20000, 0x551df422, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13448.a10", 0x08000, 0xb5183fb9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13449.a11", 0x20000, 0xd3d9aaf9, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Aurail1d) -STD_ROM_FN(Aurail1d) - -static struct BurnRomInfo AurailjRomDesc[] = { - { "epr-13446.a7", 0x20000, 0xd1f57b2a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13444.a5", 0x20000, 0x7a2b045f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13447.a8", 0x20000, 0x70a52167, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13445.a6", 0x20000, 0x28dfc3dd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13450.a14", 0x20000, 0x0fc4a7a8, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13465.b14", 0x20000, 0xe08135e0, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13451.a15", 0x20000, 0x1c49852f, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13466.b15", 0x20000, 0xe14c6684, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13452.a16", 0x20000, 0x047bde5e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13467.b16", 0x20000, 0x6309fec4, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13453.b1", 0x20000, 0x5fa0a9f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13457.b5", 0x20000, 0x0d1b54da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13454.b2", 0x20000, 0x5f6b33b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13458.b6", 0x20000, 0xbad340c3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13455.b3", 0x20000, 0x4e80520b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13459.b7", 0x20000, 0x7e9165ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13456.b4", 0x20000, 0x5733c428, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13460.b8", 0x20000, 0x66b8f9b3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13440.a1", 0x20000, 0x4f370b2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13461.b10", 0x20000, 0xf76014bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13441.a2", 0x20000, 0x37cf9cb4, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13462.b11", 0x20000, 0x1061e7da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13442.a3", 0x20000, 0x049698ef, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13463.b12", 0x20000, 0x7dbcfbf1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13443.a4", 0x20000, 0x77a8989e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13464.b13", 0x20000, 0x551df422, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13448.a10", 0x08000, 0xb5183fb9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13449.a11", 0x20000, 0xd3d9aaf9, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0167.key", 0x02000, 0xbc2d1792, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Aurailj) -STD_ROM_FN(Aurailj) - -static struct BurnRomInfo AurailjdRomDesc[] = { - { "bootleg_epr-13446.a7", 0x20000, 0x25221510, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13444.a5", 0x20000, 0x56ba5356, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13447.a8", 0x20000, 0x70a52167, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13445.a6", 0x20000, 0x28dfc3dd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13450.a14", 0x20000, 0x0fc4a7a8, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13465.b14", 0x20000, 0xe08135e0, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13451.a15", 0x20000, 0x1c49852f, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13466.b15", 0x20000, 0xe14c6684, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13452.a16", 0x20000, 0x047bde5e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13467.b16", 0x20000, 0x6309fec4, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13453.b1", 0x20000, 0x5fa0a9f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13457.b5", 0x20000, 0x0d1b54da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13454.b2", 0x20000, 0x5f6b33b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13458.b6", 0x20000, 0xbad340c3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13455.b3", 0x20000, 0x4e80520b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13459.b7", 0x20000, 0x7e9165ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13456.b4", 0x20000, 0x5733c428, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13460.b8", 0x20000, 0x66b8f9b3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13440.a1", 0x20000, 0x4f370b2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13461.b10", 0x20000, 0xf76014bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13441.a2", 0x20000, 0x37cf9cb4, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13462.b11", 0x20000, 0x1061e7da, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13442.a3", 0x20000, 0x049698ef, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13463.b12", 0x20000, 0x7dbcfbf1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13443.a4", 0x20000, 0x77a8989e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13464.b13", 0x20000, 0x551df422, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13448.a10", 0x08000, 0xb5183fb9, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13449.a11", 0x20000, 0xd3d9aaf9, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Aurailjd) -STD_ROM_FN(Aurailjd) - -static struct BurnRomInfo BayrouteRomDesc[] = { - { "epr-12517.a7", 0x20000, 0x436728a9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12516.a5", 0x20000, 0x4ff0353f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12458.a8", 0x20000, 0xe7c7476a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12456.a6", 0x20000, 0x25dc2eaf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12462.a14", 0x10000, 0xa19943b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12463.a15", 0x10000, 0x62f8200d, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12464.a16", 0x10000, 0xc8c59703, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12465.b1", 0x20000, 0x11d61b45, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12467.b5", 0x20000, 0xc3b4e4c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12466.b2", 0x20000, 0xa57f236f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12468.b6", 0x20000, 0xd89c77de, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12459.a10", 0x08000, 0x3e1d29d0, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12460.a11", 0x20000, 0x0bae570d, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12461.a12", 0x20000, 0xb03b8b46, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0116.key", 0x02000, 0x8778ee49, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Bayroute) -STD_ROM_FN(Bayroute) - -static struct BurnRomInfo BayroutedRomDesc[] = { - { "bootleg_epr-12517.a7", 0x20000, 0x7e90b39d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12516.a5", 0x20000, 0x34afc1fd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12458.a8", 0x20000, 0xe7c7476a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12456.a6", 0x20000, 0x25dc2eaf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12462.a14", 0x10000, 0xa19943b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12463.a15", 0x10000, 0x62f8200d, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12464.a16", 0x10000, 0xc8c59703, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12465.b1", 0x20000, 0x11d61b45, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12467.b5", 0x20000, 0xc3b4e4c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12466.b2", 0x20000, 0xa57f236f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12468.b6", 0x20000, 0xd89c77de, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12459.a10", 0x08000, 0x3e1d29d0, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12460.a11", 0x20000, 0x0bae570d, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12461.a12", 0x20000, 0xb03b8b46, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Bayrouted) -STD_ROM_FN(Bayrouted) - -static struct BurnRomInfo BayroutejRomDesc[] = { - { "epr-12457.a7", 0x20000, 0xbc726255, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12455.a5", 0x20000, 0xb6a722eb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12458.a8", 0x20000, 0xe7c7476a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12456.a6", 0x20000, 0x25dc2eaf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12462.a14", 0x10000, 0xa19943b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12463.a15", 0x10000, 0x62f8200d, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12464.a16", 0x10000, 0xc8c59703, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12465.b1", 0x20000, 0x11d61b45, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12467.b5", 0x20000, 0xc3b4e4c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12466.b2", 0x20000, 0xa57f236f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12468.b6", 0x20000, 0xd89c77de, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12459.a10", 0x08000, 0x3e1d29d0, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12460.a11", 0x20000, 0x0bae570d, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12461.a12", 0x20000, 0xb03b8b46, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0115.key", 0x02000, 0x75a55614, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Bayroutej) -STD_ROM_FN(Bayroutej) - -static struct BurnRomInfo BayroutejdRomDesc[] = { - { "bootleg_epr-12457.a7", 0x20000, 0x43e9011c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12455.a5", 0x20000, 0x8f56ae92, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12458.a8", 0x20000, 0xe7c7476a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12456.a6", 0x20000, 0x25dc2eaf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12462.a14", 0x10000, 0xa19943b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12463.a15", 0x10000, 0x62f8200d, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12464.a16", 0x10000, 0xc8c59703, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12465.b1", 0x20000, 0x11d61b45, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12467.b5", 0x20000, 0xc3b4e4c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12466.b2", 0x20000, 0xa57f236f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12468.b6", 0x20000, 0xd89c77de, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12459.a10", 0x08000, 0x3e1d29d0, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12460.a11", 0x20000, 0x0bae570d, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12461.a12", 0x20000, 0xb03b8b46, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Bayroutejd) -STD_ROM_FN(Bayroutejd) - -static struct BurnRomInfo Bayroute1RomDesc[] = { - { "br.a4", 0x10000, 0x91c6424b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "br.a1", 0x10000, 0x76954bf3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "br.a5", 0x10000, 0x9d6fd183, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "br.a2", 0x10000, 0x5ca1e3d2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "br.a6", 0x10000, 0xed97ad4c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "br.a3", 0x10000, 0x0d362905, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12462.a14", 0x10000, 0xa19943b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12463.a15", 0x10000, 0x62f8200d, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12464.a16", 0x10000, 0xc8c59703, SYS16_ROM_TILES | BRF_GRA }, - - { "br_obj0o.b1", 0x10000, 0x098a5e82, SYS16_ROM_SPRITES | BRF_GRA }, - { "br_obj0e.b5", 0x10000, 0x85238af9, SYS16_ROM_SPRITES | BRF_GRA }, - { "br_obj1o.b2", 0x10000, 0xcc641da1, SYS16_ROM_SPRITES | BRF_GRA }, - { "br_obj1e.b6", 0x10000, 0xd3123315, SYS16_ROM_SPRITES | BRF_GRA }, - { "br_obj2o.b3", 0x10000, 0x84efac1f, SYS16_ROM_SPRITES | BRF_GRA }, - { "br_obj2e.b7", 0x10000, 0xb73b12cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "br_obj3o.b4", 0x10000, 0xa2e238ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "br.b8", 0x10000, 0xd8de78ff, SYS16_ROM_SPRITES | BRF_GRA }, - -#if !defined ROM_VERIFY - { "sound.a7", 0x08000, 0x9e1ce6ed, SYS16_ROM_Z80PROG | BRF_PRG }, // Needs to be verified - - { "sound.a8", 0x10000, 0x077e9981, SYS16_ROM_UPD7759DATA | BRF_SND }, // Needs to be verified - { "sound.a9", 0x10000, 0x3c3f5f41, SYS16_ROM_UPD7759DATA | BRF_SND }, // Needs to be verified - { "sound.a10", 0x10000, 0x7c251347, SYS16_ROM_UPD7759DATA | BRF_SND }, // Needs to be verified - { "sound.a11", 0x10000, 0xa602ea2d, SYS16_ROM_UPD7759DATA | BRF_SND }, // Needs to be verified -#else - { "sound.a7", 0x08000, 0x00000000, SYS16_ROM_Z80PROG | BRF_NODUMP | BRF_PRG }, - - { "sound.a8", 0x10000, 0x00000000, SYS16_ROM_UPD7759DATA | BRF_NODUMP | BRF_SND }, - { "sound.a9", 0x10000, 0x00000000, SYS16_ROM_UPD7759DATA | BRF_NODUMP | BRF_SND }, - { "sound.a10", 0x10000, 0x00000000, SYS16_ROM_UPD7759DATA | BRF_NODUMP | BRF_SND }, - { "sound.a11", 0x10000, 0x00000000, SYS16_ROM_UPD7759DATA | BRF_NODUMP | BRF_SND }, -#endif -}; - - -STD_ROM_PICK(Bayroute1) -STD_ROM_FN(Bayroute1) - -static struct BurnRomInfo Blox16bRomDesc[] = { - { "bs16b.p00", 0x040000, 0xfd1978b9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "bs16b.scr", 0x040000, 0x1de4e95b, SYS16_ROM_TILES | BRF_GRA }, - - { "bs16b.obj", 0x020000, 0x05076220, SYS16_ROM_SPRITES | BRF_GRA }, - - { "bs16b.snd", 0x018000, 0x930c7e7b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Blox16b) -STD_ROM_FN(Blox16b) - -static struct BurnRomInfo BulletRomDesc[] = { - { "epr-11010.a4", 0x08000, 0xdd9001de, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11007.a1", 0x08000, 0xd9e08110, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11011.a5", 0x08000, 0x7f446b9f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11008.a2", 0x08000, 0x34824d3b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11012.a6", 0x08000, 0x3992f159, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11009.a3", 0x08000, 0xdf199999, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10994.b9", 0x10000, 0x3035468a, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10995.b10", 0x10000, 0x6b97aff1, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10996.b11", 0x10000, 0x501bddd6, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10999.b1", 0x10000, 0x119f0008, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11003.b5", 0x10000, 0x2f429089, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11000.b2", 0x10000, 0xf5482bbe, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11004.b6", 0x10000, 0x8c886df0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11001.b3", 0x10000, 0x65ea71e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11005.b7", 0x10000, 0xea2f9d50, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11002.b4", 0x10000, 0x9e25042b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11006.b8", 0x10000, 0x6b7384f2, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10997.a7", 0x08000, 0x5dd9cab5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10998.a8", 0x08000, 0xf971a817, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0041.key", 0x02000, 0x4cd4861a, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Bullet) -STD_ROM_FN(Bullet) - -static struct BurnRomInfo BulletdRomDesc[] = { - { "bootleg_epr-11010.a4", 0x08000, 0xc4b7cb63, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11007.a1", 0x08000, 0x2afa84c5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11011.a5", 0x08000, 0x7f446b9f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11008.a2", 0x08000, 0x34824d3b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11012.a6", 0x08000, 0x3992f159, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11009.a3", 0x08000, 0xdf199999, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10994.b9", 0x10000, 0x3035468a, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10995.b10", 0x10000, 0x6b97aff1, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10996.b11", 0x10000, 0x501bddd6, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10999.b1", 0x10000, 0x119f0008, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11003.b5", 0x10000, 0x2f429089, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11000.b2", 0x10000, 0xf5482bbe, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11004.b6", 0x10000, 0x8c886df0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11001.b3", 0x10000, 0x65ea71e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11005.b7", 0x10000, 0xea2f9d50, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11002.b4", 0x10000, 0x9e25042b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11006.b8", 0x10000, 0x6b7384f2, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10997.a7", 0x08000, 0x5dd9cab5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10998.a8", 0x08000, 0xf971a817, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Bulletd) -STD_ROM_FN(Bulletd) - -static struct BurnRomInfo CottonRomDesc[] = { - { "epr-13921a.a7", 0x20000, 0xf047a037, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13919a.a5", 0x20000, 0x651108b1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13922a.a8", 0x20000, 0x1ca248c5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13920a.a6", 0x20000, 0xfa3610f9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13862.a14", 0x20000, 0xa47354b6, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13877.b14", 0x20000, 0xd38424b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13863.a15", 0x20000, 0x8c990026, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13878.b15", 0x20000, 0x21c15b8a, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13864.a16", 0x20000, 0xd2b175bf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13879.b16", 0x20000, 0xb9d62531, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13865.b1", 0x20000, 0x7024f404, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13869.b5", 0x20000, 0xab4b3468, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13866.b2", 0x20000, 0x6169bba4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13870.b6", 0x20000, 0x69b41ac3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13867.b3", 0x20000, 0xb014f02d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13871.b7", 0x20000, 0x0801cf02, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13868.b4", 0x20000, 0xe62a7cd6, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13872.b8", 0x20000, 0xf066f315, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13852.a1", 0x20000, 0x943aba8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13873.b10", 0x20000, 0x1bd145f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13853.a2", 0x20000, 0x7ea93200, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13874.b11", 0x20000, 0x4fd59bff, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13891.a3", 0x20000, 0xc6b3c414, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13894.b12", 0x20000, 0xe3d0bee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13855.a4", 0x20000, 0x856f3ee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13876.b13", 0x20000, 0x1c5ffad8, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13892.a10", 0x08000, 0xfdfbe6ad, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13893.a11", 0x20000, 0x384233df, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0181a.key", 0x02000, 0x5c419b36, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Cotton) -STD_ROM_FN(Cotton) - -static struct BurnRomInfo CottondRomDesc[] = { - { "bootleg_epr-13921a.a7", 0x20000, 0x92947867, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13919a.a5", 0x20000, 0x30f131fb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13922a.a8", 0x20000, 0xf0f75329, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13920a.a6", 0x20000, 0xa3721aab, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13862.a14", 0x20000, 0xa47354b6, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13877.b14", 0x20000, 0xd38424b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13863.a15", 0x20000, 0x8c990026, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13878.b15", 0x20000, 0x21c15b8a, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13864.a16", 0x20000, 0xd2b175bf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13879.b16", 0x20000, 0xb9d62531, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13865.b1", 0x20000, 0x7024f404, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13869.b5", 0x20000, 0xab4b3468, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13866.b2", 0x20000, 0x6169bba4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13870.b6", 0x20000, 0x69b41ac3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13867.b3", 0x20000, 0xb014f02d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13871.b7", 0x20000, 0x0801cf02, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13868.b4", 0x20000, 0xe62a7cd6, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13872.b8", 0x20000, 0xf066f315, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13852.a1", 0x20000, 0x943aba8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13873.b10", 0x20000, 0x1bd145f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13853.a2", 0x20000, 0x7ea93200, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13874.b11", 0x20000, 0x4fd59bff, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13891.a3", 0x20000, 0xc6b3c414, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13894.b12", 0x20000, 0xe3d0bee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13855.a4", 0x20000, 0x856f3ee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13876.b13", 0x20000, 0x1c5ffad8, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13892.a10", 0x08000, 0xfdfbe6ad, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13893.a11", 0x20000, 0x384233df, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Cottond) -STD_ROM_FN(Cottond) - -static struct BurnRomInfo CottonuRomDesc[] = { - { "cotton.a7", 0x20000, 0xe7ef7d10, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "cotton.a5", 0x20000, 0xabe4f83e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "cotton.a8", 0x20000, 0xfc0f4401, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "cotton.a6", 0x20000, 0xf50f1ea2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13862.a14", 0x20000, 0xa47354b6, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13877.b14", 0x20000, 0xd38424b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13863.a15", 0x20000, 0x8c990026, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13878.b15", 0x20000, 0x21c15b8a, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13864.a16", 0x20000, 0xd2b175bf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13879.b16", 0x20000, 0xb9d62531, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13865.b1", 0x20000, 0x7024f404, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13869.b5", 0x20000, 0xab4b3468, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13866.b2", 0x20000, 0x6169bba4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13870.b6", 0x20000, 0x69b41ac3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13867.b3", 0x20000, 0xb014f02d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13871.b7", 0x20000, 0x0801cf02, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13868.b4", 0x20000, 0xe62a7cd6, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13872.b8", 0x20000, 0xf066f315, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13852.a1", 0x20000, 0x943aba8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13873.b10", 0x20000, 0x1bd145f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13853.a2", 0x20000, 0x7ea93200, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13874.b11", 0x20000, 0x4fd59bff, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13891.a3", 0x20000, 0xc6b3c414, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13894.b12", 0x20000, 0xe3d0bee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13855.a4", 0x20000, 0x856f3ee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13876.b13", 0x20000, 0x1c5ffad8, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13892.a10", 0x08000, 0xfdfbe6ad, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13893.a11", 0x20000, 0x384233df, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0180.key", 0x02000, 0xa236b915, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Cottonu) -STD_ROM_FN(Cottonu) - -static struct BurnRomInfo CottonudRomDesc[] = { - { "bootleg_cotton.a7", 0x20000, 0xf6b585ca, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_cotton.a5", 0x20000, 0x6b328522, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_cotton.a8", 0x20000, 0xf9147b71, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_cotton.a6", 0x20000, 0x10365de4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13862.a14", 0x20000, 0xa47354b6, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13877.b14", 0x20000, 0xd38424b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13863.a15", 0x20000, 0x8c990026, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13878.b15", 0x20000, 0x21c15b8a, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13864.a16", 0x20000, 0xd2b175bf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13879.b16", 0x20000, 0xb9d62531, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13865.b1", 0x20000, 0x7024f404, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13869.b5", 0x20000, 0xab4b3468, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13866.b2", 0x20000, 0x6169bba4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13870.b6", 0x20000, 0x69b41ac3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13867.b3", 0x20000, 0xb014f02d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13871.b7", 0x20000, 0x0801cf02, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13868.b4", 0x20000, 0xe62a7cd6, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13872.b8", 0x20000, 0xf066f315, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13852.a1", 0x20000, 0x943aba8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13873.b10", 0x20000, 0x1bd145f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13853.a2", 0x20000, 0x7ea93200, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13874.b11", 0x20000, 0x4fd59bff, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13891.a3", 0x20000, 0xc6b3c414, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13894.b12", 0x20000, 0xe3d0bee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13855.a4", 0x20000, 0x856f3ee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13876.b13", 0x20000, 0x1c5ffad8, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13892.a10", 0x08000, 0xfdfbe6ad, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13893.a11", 0x20000, 0x384233df, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Cottonud) -STD_ROM_FN(Cottonud) - -static struct BurnRomInfo CottonjRomDesc[] = { - { "epr-13858b.a7", 0x20000, 0x2d113dac, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13856b.a5", 0x20000, 0x5aab2ac4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13859b.a8", 0x20000, 0x2e67367d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13857b.a6", 0x20000, 0x20361f02, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13862.a14", 0x20000, 0xa47354b6, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13877.b14", 0x20000, 0xd38424b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13863.a15", 0x20000, 0x8c990026, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13878.b15", 0x20000, 0x21c15b8a, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13864.a16", 0x20000, 0xd2b175bf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13879.b16", 0x20000, 0xb9d62531, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13865.b1", 0x20000, 0x7024f404, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13869.b5", 0x20000, 0xab4b3468, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13866.b2", 0x20000, 0x6169bba4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13870.b6", 0x20000, 0x69b41ac3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13867.b3", 0x20000, 0xb014f02d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13871.b7", 0x20000, 0x0801cf02, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13868.b4", 0x20000, 0xe62a7cd6, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13872.b8", 0x20000, 0xf066f315, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13852.a1", 0x20000, 0x943aba8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13873.b10", 0x20000, 0x1bd145f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13853.a2", 0x20000, 0x7ea93200, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13874.b11", 0x20000, 0x4fd59bff, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13854.a3", 0x20000, 0x1c942190, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13875.b12", 0x20000, 0x6a66868d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13855.a4", 0x20000, 0x856f3ee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13876.b13", 0x20000, 0x1c5ffad8, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13860.a10", 0x08000, 0x6a57b027, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13061.a11", 0x20000, 0x4d21153f, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0179b.key", 0x02000, 0x488096d3, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, // Same key data, but labeled as REV B -}; - - -STD_ROM_PICK(Cottonj) -STD_ROM_FN(Cottonj) - -static struct BurnRomInfo CottonjdRomDesc[] = { - { "bootleg_epr-13858b.a7", 0x20000, 0x739acf3b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13856b.a5", 0x20000, 0x19597b1f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13859b.a8", 0x20000, 0x10548c39, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13857b.a6", 0x20000, 0x6d289f3e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13862.a14", 0x20000, 0xa47354b6, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13877.b14", 0x20000, 0xd38424b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13863.a15", 0x20000, 0x8c990026, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13878.b15", 0x20000, 0x21c15b8a, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13864.a16", 0x20000, 0xd2b175bf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13879.b16", 0x20000, 0xb9d62531, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13865.b1", 0x20000, 0x7024f404, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13869.b5", 0x20000, 0xab4b3468, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13866.b2", 0x20000, 0x6169bba4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13870.b6", 0x20000, 0x69b41ac3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13867.b3", 0x20000, 0xb014f02d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13871.b7", 0x20000, 0x0801cf02, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13868.b4", 0x20000, 0xe62a7cd6, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13872.b8", 0x20000, 0xf066f315, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13852.a1", 0x20000, 0x943aba8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13873.b10", 0x20000, 0x1bd145f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13853.a2", 0x20000, 0x7ea93200, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13874.b11", 0x20000, 0x4fd59bff, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13854.a3", 0x20000, 0x1c942190, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13875.b12", 0x20000, 0x6a66868d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13855.a4", 0x20000, 0x856f3ee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13876.b13", 0x20000, 0x1c5ffad8, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13860.a10", 0x08000, 0x6a57b027, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13061.a11", 0x20000, 0x4d21153f, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Cottonjd) -STD_ROM_FN(Cottonjd) - -static struct BurnRomInfo CottonjaRomDesc[] = { - { "epr-13858a.a7", 0x20000, 0x276f42fe, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13856a.a5", 0x20000, 0x14e6b5e7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13859a.a8", 0x20000, 0x4703ef9d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13857a.a6", 0x20000, 0xde37e527, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13862.a14", 0x20000, 0xa47354b6, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13877.b14", 0x20000, 0xd38424b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13863.a15", 0x20000, 0x8c990026, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13878.b15", 0x20000, 0x21c15b8a, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13864.a16", 0x20000, 0xd2b175bf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13879.b16", 0x20000, 0xb9d62531, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13865.b1", 0x20000, 0x7024f404, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13869.b5", 0x20000, 0xab4b3468, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13866.b2", 0x20000, 0x6169bba4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13870.b6", 0x20000, 0x69b41ac3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13867.b3", 0x20000, 0xb014f02d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13871.b7", 0x20000, 0x0801cf02, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13868.b4", 0x20000, 0xe62a7cd6, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13872.b8", 0x20000, 0xf066f315, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13852.a1", 0x20000, 0x943aba8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13873.b10", 0x20000, 0x1bd145f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13853.a2", 0x20000, 0x7ea93200, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13874.b11", 0x20000, 0x4fd59bff, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13854.a3", 0x20000, 0x1c942190, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13875.b12", 0x20000, 0x6a66868d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13855.a4", 0x20000, 0x856f3ee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13876.b13", 0x20000, 0x1c5ffad8, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13860.a10", 0x08000, 0x6a57b027, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13061.a11", 0x20000, 0x4d21153f, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0179a.key", 0x02000, 0x488096d3, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Cottonja) -STD_ROM_FN(Cottonja) - -static struct BurnRomInfo CottonjadRomDesc[] = { - { "bootleg_epr-13858a.a7", 0x20000, 0xf048fba4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13856a.a5", 0x20000, 0x04f5bbe1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13859a.a8", 0x20000, 0xfc259bef, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13857a.a6", 0x20000, 0xe191e939, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13862.a14", 0x20000, 0xa47354b6, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13877.b14", 0x20000, 0xd38424b5, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13863.a15", 0x20000, 0x8c990026, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13878.b15", 0x20000, 0x21c15b8a, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13864.a16", 0x20000, 0xd2b175bf, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13879.b16", 0x20000, 0xb9d62531, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13865.b1", 0x20000, 0x7024f404, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13869.b5", 0x20000, 0xab4b3468, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13866.b2", 0x20000, 0x6169bba4, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13870.b6", 0x20000, 0x69b41ac3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13867.b3", 0x20000, 0xb014f02d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13871.b7", 0x20000, 0x0801cf02, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13868.b4", 0x20000, 0xe62a7cd6, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13872.b8", 0x20000, 0xf066f315, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13852.a1", 0x20000, 0x943aba8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13873.b10", 0x20000, 0x1bd145f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13853.a2", 0x20000, 0x7ea93200, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13874.b11", 0x20000, 0x4fd59bff, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13854.a3", 0x20000, 0x1c942190, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13875.b12", 0x20000, 0x6a66868d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13855.a4", 0x20000, 0x856f3ee2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13876.b13", 0x20000, 0x1c5ffad8, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13860.a10", 0x08000, 0x6a57b027, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13061.a11", 0x20000, 0x4d21153f, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Cottonjad) -STD_ROM_FN(Cottonjad) - -static struct BurnRomInfo DduxRomDesc[] = { - { "epr-11191.a7", 0x20000, 0x500e400a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11190.a5", 0x20000, 0x2a698308, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11915.a8", 0x20000, 0xd8ed3132, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11913.a6", 0x20000, 0x30c6cb92, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11917.a14", 0x10000, 0x6f772190, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11918.a15", 0x10000, 0xc731db95, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11919.a16", 0x10000, 0x64d5a491, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-11920.b1", 0x20000, 0xe5d1e3cd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11922.b5", 0x20000, 0x70b0c4dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11921.b2", 0x20000, 0x61d2358c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11923.b6", 0x20000, 0xc9ffe47d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11916.a10", 0x08000, 0x7ab541cf, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0096.key", 0x02000, 0x6fd7d26e, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Ddux) -STD_ROM_FN(Ddux) - -static struct BurnRomInfo DduxdRomDesc[] = { - { "bootleg_epr-11191.a7", 0x20000, 0x7721eeba, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11190.a5", 0x20000, 0x5ee350cd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11915.a8", 0x20000, 0xd8ed3132, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11913.a6", 0x20000, 0x30c6cb92, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11917.a14", 0x10000, 0x6f772190, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11918.a15", 0x10000, 0xc731db95, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11919.a16", 0x10000, 0x64d5a491, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-11920.b1", 0x20000, 0xe5d1e3cd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11922.b5", 0x20000, 0x70b0c4dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11921.b2", 0x20000, 0x61d2358c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11923.b6", 0x20000, 0xc9ffe47d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11916.a10", 0x08000, 0x7ab541cf, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Dduxd) -STD_ROM_FN(Dduxd) - -static struct BurnRomInfo Ddux1RomDesc[] = { - { "epr-12189.a7", 0x20000, 0x558e9b5d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12188.a5", 0x20000, 0x802a240f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11915.a8", 0x20000, 0xd8ed3132, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11913.a6", 0x20000, 0x30c6cb92, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11917.a14", 0x10000, 0x6f772190, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11918.a15", 0x10000, 0xc731db95, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11919.a16", 0x10000, 0x64d5a491, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-11920.b1", 0x20000, 0xe5d1e3cd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11922.b5", 0x20000, 0x70b0c4dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11921.b2", 0x20000, 0x61d2358c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11923.b6", 0x20000, 0xc9ffe47d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11916.a10", 0x08000, 0x7ab541cf, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0095.c2", 0x01000, 0x00000000, BRF_NODUMP }, // Intel i8751 protection MCU -}; - - -STD_ROM_PICK(Ddux1) -STD_ROM_FN(Ddux1) - -static struct BurnRomInfo DduxjRomDesc[] = { - { "epr-11914.a7", 0x20000, 0xa3eedc3b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11912.a5", 0x20000, 0x05989323, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11915.a8", 0x20000, 0xd8ed3132, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11913.a6", 0x20000, 0x30c6cb92, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11917.a14", 0x10000, 0x6f772190, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11918.a15", 0x10000, 0xc731db95, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11919.a16", 0x10000, 0x64d5a491, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-11920.b1", 0x20000, 0xe5d1e3cd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11922.b5", 0x20000, 0x70b0c4dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11921.b2", 0x20000, 0x61d2358c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11923.b6", 0x20000, 0xc9ffe47d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11916.a10", 0x08000, 0x7ab541cf, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0094.key", 0x02000, 0xdb98f594, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Dduxj) -STD_ROM_FN(Dduxj) - -static struct BurnRomInfo DduxjdRomDesc[] = { - { "bootleg_epr-11914.a7", 0x20000, 0x8d52572d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11912.a5", 0x20000, 0x811ceee9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11915.a8", 0x20000, 0xd8ed3132, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11913.a6", 0x20000, 0x30c6cb92, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11917.a14", 0x10000, 0x6f772190, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11918.a15", 0x10000, 0xc731db95, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11919.a16", 0x10000, 0x64d5a491, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-11920.b1", 0x20000, 0xe5d1e3cd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11922.b5", 0x20000, 0x70b0c4dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11921.b2", 0x20000, 0x61d2358c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11923.b6", 0x20000, 0xc9ffe47d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11916.a10", 0x08000, 0x7ab541cf, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Dduxjd) -STD_ROM_FN(Dduxjd) - -static struct BurnRomInfo DduxblRomDesc[] = { - { "dduxb03.bin", 0x20000, 0xe7526012, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "dduxb05.bin", 0x20000, 0x459d1237, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "dduxb02.bin", 0x20000, 0xd8ed3132, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "dduxb04.bin", 0x20000, 0x30c6cb92, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "dduxb14.bin", 0x10000, 0x664bd135, SYS16_ROM_TILES | BRF_GRA }, - { "dduxb15.bin", 0x10000, 0xce0d2b30, SYS16_ROM_TILES | BRF_GRA }, - { "dduxb16.bin", 0x10000, 0x6de95434, SYS16_ROM_TILES | BRF_GRA }, - - { "dduxb10.bin", 0x10000, 0x0be3aee5, SYS16_ROM_SPRITES | BRF_GRA }, - { "dduxb06.bin", 0x10000, 0xb0079e99, SYS16_ROM_SPRITES | BRF_GRA }, - { "dduxb11.bin", 0x10000, 0xcfb2af18, SYS16_ROM_SPRITES | BRF_GRA }, - { "dduxb07.bin", 0x10000, 0x0217369c, SYS16_ROM_SPRITES | BRF_GRA }, - { "dduxb12.bin", 0x10000, 0x28ce9b15, SYS16_ROM_SPRITES | BRF_GRA }, - { "dduxb08.bin", 0x10000, 0x8844f336, SYS16_ROM_SPRITES | BRF_GRA }, - { "dduxb13.bin", 0x10000, 0xefe57759, SYS16_ROM_SPRITES | BRF_GRA }, - { "dduxb09.bin", 0x10000, 0x6b64f665, SYS16_ROM_SPRITES | BRF_GRA }, - - { "dduxb01.bin", 0x08000, 0x0dbef0d7, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Dduxbl) -STD_ROM_FN(Dduxbl) - -static struct BurnRomInfo DunkshotRomDesc[] = { - { "epr-10523c.a4", 0x08000, 0x106733c2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10520c.a1", 0x08000, 0xba9c5d10, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10524.a5", 0x08000, 0x22777314, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // == epr-10471.a5 - { "epr-10521.a2", 0x08000, 0xe2d5f97a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // == epr-10468.a2 - { "epr-10525.a6", 0x08000, 0x7f41f334, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10522.a3", 0x08000, 0xe5b5f754, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10528.b9", 0x08000, 0xa8a3762d, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10529.b10", 0x08000, 0x80cbff50, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10530.b11", 0x08000, 0x2dbe1e52, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10477.b1", 0x08000, 0xf9d3b2cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10481.b5", 0x08000, 0xfeb04bc9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10478.b2", 0x08000, 0x5b5c5c92, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10482.b6", 0x08000, 0x5bc07618, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10479.b3", 0x08000, 0xe84190a0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10483.b7", 0x08000, 0x7cab4f9e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10526.b4", 0x08000, 0xbf200754, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10527.b8", 0x08000, 0x39b1a242, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10473.a7", 0x08000, 0x7f1f5a27, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10474.a8", 0x08000, 0x419a656e, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10475.a9", 0x08000, 0x17d55e85, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10476.a10", 0x08000, 0xa6be0956, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0022.key", 0x02000, 0x4eedc66d, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Dunkshot) -STD_ROM_FN(Dunkshot) - -static struct BurnRomInfo DunkshotaRomDesc[] = { - // several roms had replacement? (different style to others) labels with 'T' markings, content identical. - { "epr-10523a.a4", 0x08000, 0x22e3f074, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10520a.a1", 0x08000, 0x16e213ba, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10524.a5", 0x08000, 0x22777314, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // == epr-10471.a5 - { "epr-10521.a2", 0x08000, 0xe2d5f97a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, // == epr-10468.a2 - { "epr-10525.a6", 0x08000, 0x7f41f334, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10522.a3", 0x08000, 0xe5b5f754, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10528.b9", 0x08000, 0xa8a3762d, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10529.b10", 0x08000, 0x80cbff50, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10530.b11", 0x08000, 0x2dbe1e52, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10477.b1", 0x08000, 0xf9d3b2cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10481.b5", 0x08000, 0xfeb04bc9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10478.b2", 0x08000, 0x5b5c5c92, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10482.b6", 0x08000, 0x5bc07618, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10479.b3", 0x08000, 0xe84190a0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10483.b7", 0x08000, 0x7cab4f9e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10526.b4", 0x08000, 0xbf200754, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10527.b8", 0x08000, 0x39b1a242, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10473.a7", 0x08000, 0x7f1f5a27, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10474.a8", 0x08000, 0x419a656e, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10475.a9", 0x08000, 0x17d55e85, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10476.a10", 0x08000, 0xa6be0956, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0022.key", 0x02000, 0x4eedc66d, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Dunkshota) -STD_ROM_FN(Dunkshota) - -static struct BurnRomInfo DunkshotoRomDesc[] = { - { "epr-10470.a4", 0x08000, 0x8c60761f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10467.a1", 0x08000, 0x29774114, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10471.a5", 0x08000, 0x22777314, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10468.a2", 0x08000, 0xe2d5f97a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10472.a6", 0x08000, 0x206027a6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10469.a3", 0x08000, 0xaa442b81, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10485.b9", 0x08000, 0xf16dda29, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10486.b10", 0x08000, 0x311d973c, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10487.b11", 0x08000, 0xa8fb179f, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10477.b1", 0x08000, 0xf9d3b2cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10481.b5", 0x08000, 0xfeb04bc9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10478.b2", 0x08000, 0x5b5c5c92, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10482.b6", 0x08000, 0x5bc07618, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10479.b3", 0x08000, 0xe84190a0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10483.b7", 0x08000, 0x7cab4f9e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10480.b4", 0x08000, 0x5dffd9dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10484.b8", 0x08000, 0xbcb5fcc9, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10473.a7", 0x08000, 0x7f1f5a27, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10474.a8", 0x08000, 0x419a656e, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10475.a9", 0x08000, 0x17d55e85, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-10476.a10", 0x08000, 0xa6be0956, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0022.key", 0x02000, 0x4eedc66d, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Dunkshoto) -STD_ROM_FN(Dunkshoto) - -static struct BurnRomInfo EswatRomDesc[] = { - { "epr-12659.a2", 0x40000, 0xc5ab2db9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12658.a1", 0x40000, 0xaf40bd71, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12624.b11", 0x40000, 0x375a5ec4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12625.b12", 0x40000, 0x3b8c757e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12626.b13", 0x40000, 0x3efca25c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12618.b1", 0x40000, 0x0d1530bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12621.b4", 0x40000, 0x18ff0799, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12619.b2", 0x40000, 0x32069246, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12622.b5", 0x40000, 0xa3dfe436, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12620.b3", 0x40000, 0xf6b096e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12623.b6", 0x40000, 0x6773fef6, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12617.a13", 0x08000, 0x7efecf23, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12616.a11", 0x40000, 0x254347c2, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0130.key", 0x02000, 0xba7b717b, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Eswat) -STD_ROM_FN(Eswat) - -static struct BurnRomInfo EswatdRomDesc[] = { - { "bootleg_epr-12659.a2", 0x40000, 0x3157f69d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12658.a1", 0x40000, 0x0feb544b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12624.b11", 0x40000, 0x375a5ec4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12625.b12", 0x40000, 0x3b8c757e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12626.b13", 0x40000, 0x3efca25c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12618.b1", 0x40000, 0x0d1530bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12621.b4", 0x40000, 0x18ff0799, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12619.b2", 0x40000, 0x32069246, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12622.b5", 0x40000, 0xa3dfe436, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12620.b3", 0x40000, 0xf6b096e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12623.b6", 0x40000, 0x6773fef6, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12617.a13", 0x08000, 0x7efecf23, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12616.a11", 0x40000, 0x254347c2, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Eswatd) -STD_ROM_FN(Eswatd) - -static struct BurnRomInfo EswatjRomDesc[] = { - { "epr-12615.a2", 0x40000, 0x388c2ea7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12614.a1", 0x40000, 0xd5f0fb47, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12624.b11", 0x40000, 0x375a5ec4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12625.b12", 0x40000, 0x3b8c757e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12626.b13", 0x40000, 0x3efca25c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12618.b1", 0x40000, 0x0d1530bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12621.b4", 0x40000, 0x18ff0799, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12619.b2", 0x40000, 0x32069246, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12622.b5", 0x40000, 0xa3dfe436, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12620.b3", 0x40000, 0xf6b096e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12623.b6", 0x40000, 0x6773fef6, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12617.a13", 0x08000, 0x7efecf23, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12616.a11", 0x40000, 0x254347c2, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0128.key", 0x02000, 0x95f96277, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Eswatj) -STD_ROM_FN(Eswatj) - -static struct BurnRomInfo EswatjdRomDesc[] = { - { "bootleg_epr-12615.a2", 0x40000, 0x5103480e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12614.a1", 0x40000, 0x51f404a5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12624.b11", 0x40000, 0x375a5ec4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12625.b12", 0x40000, 0x3b8c757e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12626.b13", 0x40000, 0x3efca25c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12618.b1", 0x40000, 0x0d1530bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12621.b4", 0x40000, 0x18ff0799, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12619.b2", 0x40000, 0x32069246, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12622.b5", 0x40000, 0xa3dfe436, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12620.b3", 0x40000, 0xf6b096e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12623.b6", 0x40000, 0x6773fef6, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12617.a13", 0x08000, 0x7efecf23, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12616.a11", 0x40000, 0x254347c2, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Eswatjd) -STD_ROM_FN(Eswatjd) - -static struct BurnRomInfo Eswatj1RomDesc[] = { - { "epr-12683.a7", 0x20000, 0x33c34cfd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12681.a5", 0x20000, 0x6b2feb09, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12684.a8", 0x20000, 0x2e5b866b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12682.a6", 0x20000, 0x8e1f57d2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12688.a14", 0x20000, 0x12f898db, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12700.b14", 0x10000, 0x37a721c7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12689.a15", 0x20000, 0x339746d0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12701.b15", 0x10000, 0x703bf496, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12690.a16", 0x20000, 0x33cf7a55, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12702.b16", 0x10000, 0x70b70211, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12691.b1", 0x20000, 0x2ff5cb9e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12694.b5", 0x20000, 0x10a27526, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12692.b2", 0x20000, 0x01b2e832, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12695.b6", 0x20000, 0xba3ba6fd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12693.b3", 0x20000, 0xd12ef57a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12696.b7", 0x20000, 0x54b51ca4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12678.a1", 0x20000, 0xa8afd649, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12697.b10", 0x20000, 0x6ac4cbfb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12679.a2", 0x20000, 0xb4c4a2ab, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12698.b11", 0x20000, 0x99784b36, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12680.a3", 0x20000, 0xf321452c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12699.b12", 0x20000, 0xac329586, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12685.a10", 0x08000, 0x5d0c16d7, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12686.a11", 0x20000, 0xf451705e, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12687.a12", 0x20000, 0x9e87571f, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0131.key", 0x02000, 0x8f71726d, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Eswatj1) -STD_ROM_FN(Eswatj1) - -static struct BurnRomInfo Eswatj1dRomDesc[] = { - { "bootleg_epr-12683.a7", 0x20000, 0x4f9d7a85, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12681.a5", 0x20000, 0x3e113af2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12684.a8", 0x20000, 0x2e5b866b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12682.a6", 0x20000, 0x8e1f57d2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12688.a14", 0x20000, 0x12f898db, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12700.b14", 0x10000, 0x37a721c7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12689.a15", 0x20000, 0x339746d0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12701.b15", 0x10000, 0x703bf496, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12690.a16", 0x20000, 0x33cf7a55, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12702.b16", 0x10000, 0x70b70211, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12691.b1", 0x20000, 0x2ff5cb9e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12694.b5", 0x20000, 0x10a27526, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12692.b2", 0x20000, 0x01b2e832, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12695.b6", 0x20000, 0xba3ba6fd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12693.b3", 0x20000, 0xd12ef57a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12696.b7", 0x20000, 0x54b51ca4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12678.a1", 0x20000, 0xa8afd649, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12697.b10", 0x20000, 0x6ac4cbfb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12679.a2", 0x20000, 0xb4c4a2ab, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12698.b11", 0x20000, 0x99784b36, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12680.a3", 0x20000, 0xf321452c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12699.b12", 0x20000, 0xac329586, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12685.a10", 0x08000, 0x5d0c16d7, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12686.a11", 0x20000, 0xf451705e, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12687.a12", 0x20000, 0x9e87571f, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Eswatj1d) -STD_ROM_FN(Eswatj1d) - -static struct BurnRomInfo EswatuRomDesc[] = { - { "epr-12657.a2", 0x40000, 0x43ca72aa, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12656.a1", 0x40000, 0x5f018967, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12624.b11", 0x40000, 0x375a5ec4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12625.b12", 0x40000, 0x3b8c757e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12626.b13", 0x40000, 0x3efca25c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12618.b1", 0x40000, 0x0d1530bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12621.b4", 0x40000, 0x18ff0799, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12619.b2", 0x40000, 0x32069246, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12622.b5", 0x40000, 0xa3dfe436, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12620.b3", 0x40000, 0xf6b096e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12623.b6", 0x40000, 0x6773fef6, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12617.a13", 0x08000, 0x7efecf23, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12616.a11", 0x40000, 0x254347c2, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0129.key", 0x02000, 0x128302c7, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Eswatu) -STD_ROM_FN(Eswatu) - -static struct BurnRomInfo EswatudRomDesc[] = { - { "bootleg_epr-12657.a2", 0x40000, 0x85b42ecc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12656.a1", 0x40000, 0x0509949f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12624.b11", 0x40000, 0x375a5ec4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12625.b12", 0x40000, 0x3b8c757e, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12626.b13", 0x40000, 0x3efca25c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12618.b1", 0x40000, 0x0d1530bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12621.b4", 0x40000, 0x18ff0799, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12619.b2", 0x40000, 0x32069246, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12622.b5", 0x40000, 0xa3dfe436, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12620.b3", 0x40000, 0xf6b096e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12623.b6", 0x40000, 0x6773fef6, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12617.a13", 0x08000, 0x7efecf23, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12616.a11", 0x40000, 0x254347c2, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Eswatud) -STD_ROM_FN(Eswatud) - -static struct BurnRomInfo EswatblRomDesc[] = { - { "eswat_c.rom", 0x10000, 0x1028cc81, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "eswat_f.rom", 0x10000, 0xf7b2d388, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "eswat_b.rom", 0x10000, 0x87c6b1b5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "eswat_e.rom", 0x10000, 0x937ddf9a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "eswat_a.rom", 0x08000, 0x2af4fc62, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "eswat_d.rom", 0x08000, 0xb4751e19, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "ic19", 0x40000, 0x375a5ec4, SYS16_ROM_TILES | BRF_GRA }, - { "ic20", 0x40000, 0x3b8c757e, SYS16_ROM_TILES | BRF_GRA }, - { "ic21", 0x40000, 0x3efca25c, SYS16_ROM_TILES | BRF_GRA }, - - { "ic9", 0x40000, 0x0d1530bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic12", 0x40000, 0x18ff0799, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic10", 0x40000, 0x32069246, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic13", 0x40000, 0xa3dfe436, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic11", 0x40000, 0xf6b096e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic14", 0x40000, 0x6773fef6, SYS16_ROM_SPRITES | BRF_GRA }, - - { "ic8", 0x08000, 0x7efecf23, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "ic6", 0x40000, 0x254347c2, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Eswatbl) -STD_ROM_FN(Eswatbl) - -static struct BurnRomInfo ExctleagRomDesc[] = { - { "epr-11939.a4", 0x10000, 0x117dd98f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11936.a1", 0x10000, 0x0863de60, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11940.a5", 0x10000, 0xdec83274, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11937.a2", 0x10000, 0x4ebda367, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11941.a6", 0x10000, 0x4df2d451, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11938.a3", 0x10000, 0x07c08d47, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11942.b09", 0x10000, 0xeb70e827, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11943.b10", 0x10000, 0xd97c8982, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11944.b11", 0x10000, 0xa75cae80, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11950.b1", 0x10000, 0xaf497849, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11954.b5", 0x10000, 0x5fa2106c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11951.b2", 0x10000, 0xc04fa974, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11955.b6", 0x10000, 0x86a0c368, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11952.b3", 0x10000, 0xe64a9761, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11956.b7", 0x10000, 0xaff5c2fa, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11953.b4", 0x10000, 0x4cae3999, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11957.b8", 0x10000, 0x218f835b, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11945.a7", 0x08000, 0xc2a83012, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11140.a8", 0x08000, 0xb297371b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11141.a9", 0x08000, 0x19756aa6, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11142.a10", 0x08000, 0x25d26c66, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11143.a11", 0x08000, 0x848b7b77, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0079.key", 0x02000, 0xeffefa1c, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Exctleag) -STD_ROM_FN(Exctleag) - -static struct BurnRomInfo ExctleagdRomDesc[] = { - { "bootleg_epr-11939.a4", 0x10000, 0x42db9082, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11936.a1", 0x10000, 0x8a0c126c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11940.a5", 0x10000, 0xe490bb47, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11937.a2", 0x10000, 0xf1c07e10, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11941.a6", 0x10000, 0x4df2d451, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11938.a3", 0x10000, 0x07c08d47, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11942.b09", 0x10000, 0xeb70e827, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11943.b10", 0x10000, 0xd97c8982, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11944.b11", 0x10000, 0xa75cae80, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11950.b1", 0x10000, 0xaf497849, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11954.b5", 0x10000, 0x5fa2106c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11951.b2", 0x10000, 0xc04fa974, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11955.b6", 0x10000, 0x86a0c368, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11952.b3", 0x10000, 0xe64a9761, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11956.b7", 0x10000, 0xaff5c2fa, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11953.b4", 0x10000, 0x4cae3999, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11957.b8", 0x10000, 0x218f835b, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11945.a7", 0x08000, 0xc2a83012, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11140.a8", 0x08000, 0xb297371b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11141.a9", 0x08000, 0x19756aa6, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11142.a10", 0x08000, 0x25d26c66, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11143.a11", 0x08000, 0x848b7b77, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Exctleagd) -STD_ROM_FN(Exctleagd) - -static struct BurnRomInfo FantzonetaRomDesc[] = { - { "fzta__a07.bin", 0x020000, 0xad07d1fd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "fzta__a05.bin", 0x020000, 0x47dbe11b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "fzta__a14.bin", 0x010000, 0x9468ab33, SYS16_ROM_TILES | BRF_GRA }, - { "fzta__a15.bin", 0x010000, 0x22a3cf75, SYS16_ROM_TILES | BRF_GRA }, - { "fzta__a16.bin", 0x010000, 0x25cba87f, SYS16_ROM_TILES | BRF_GRA }, - - { "fzta__b01.bin", 0x020000, 0x0beb4a22, SYS16_ROM_SPRITES | BRF_GRA }, - { "fzta__b05.bin", 0x020000, 0x7f676c69, SYS16_ROM_SPRITES | BRF_GRA }, - { "fzta__a01.bin", 0x020000, 0x40e1db9a, SYS16_ROM_SPRITES | BRF_GRA }, - { "fzta__b10.bin", 0x020000, 0xacbb5cff, SYS16_ROM_SPRITES | BRF_GRA }, - - { "fzta__a10.bin", 0x008000, 0xdab6fcd0, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fantzoneta) -STD_ROM_FN(Fantzoneta) - -static struct BurnRomInfo Fantzn2xRomDesc[] = { - { "fz2.a7", 0x020000, 0x94c05f0b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "fz2.a5", 0x020000, 0xf3526895, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "fz2.a8", 0x020000, 0xb2ebb209, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "fz2.a6", 0x020000, 0x6833f546, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "fz2.a14", 0x020000, 0x1c0a4537, SYS16_ROM_TILES | BRF_GRA }, - { "fz2.a15", 0x020000, 0x2b933344, SYS16_ROM_TILES | BRF_GRA }, - { "fz2.a16", 0x020000, 0xe63281a1, SYS16_ROM_TILES | BRF_GRA }, - - { "fz2.b1", 0x020000, 0x46bba615, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.b5", 0x020000, 0xbebeee5d, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.b2", 0x020000, 0x6681a7b6, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.b6", 0x020000, 0x42d3241f, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.b3", 0x020000, 0x5863926f, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.b7", 0x020000, 0xcd830510, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.b4", 0x020000, 0xb98fa5b6, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.b8", 0x020000, 0xe8248f68, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.a1", 0x020000, 0x9d2f41f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.b10", 0x020000, 0x7686ea33, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.a2", 0x020000, 0x3b4050b7, SYS16_ROM_SPRITES | BRF_GRA }, - { "fz2.b11", 0x020000, 0xda8a95dc, SYS16_ROM_SPRITES | BRF_GRA }, - - { "fz2.a10", 0x008000, 0x92c92924, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "fz2.a11", 0x020000, 0x8c641bb9, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Fantzn2x) -STD_ROM_FN(Fantzn2x) - -static struct BurnRomInfo Fantzn2xpRomDesc[] = { - { "cpu1b.bin", 0x020000, 0xd23ef944, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "cpu1a.bin", 0x020000, 0x407490e4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "cpu1d.bin", 0x020000, 0xc8c7716b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "cpu1c.bin", 0x020000, 0x242e7b6e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "tilea.bin", 0x020000, 0x47e0e5ce, SYS16_ROM_TILES | BRF_GRA }, - { "tileb.bin", 0x020000, 0x59e181b7, SYS16_ROM_TILES | BRF_GRA }, - { "tilec.bin", 0x020000, 0x375d354c, SYS16_ROM_TILES | BRF_GRA }, - - { "obja.bin", 0x020000, 0x9af87a4d, SYS16_ROM_SPRITES | BRF_GRA }, - { "objb.bin", 0x020000, 0x2fdbca68, SYS16_ROM_SPRITES | BRF_GRA }, - { "objc.bin", 0x020000, 0x2587487a, SYS16_ROM_SPRITES | BRF_GRA }, - { "objd.bin", 0x020000, 0x8de4e7aa, SYS16_ROM_SPRITES | BRF_GRA }, - { "obje.bin", 0x020000, 0xdfada4ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "objf.bin", 0x020000, 0x65e5d23d, SYS16_ROM_SPRITES | BRF_GRA }, - { "objg.bin", 0x020000, 0xdc9fbb75, SYS16_ROM_SPRITES | BRF_GRA }, - { "objh.bin", 0x020000, 0x97bb7c19, SYS16_ROM_SPRITES | BRF_GRA }, - { "obji.bin", 0x020000, 0xc7790fee, SYS16_ROM_SPRITES | BRF_GRA }, - { "objj.bin", 0x020000, 0x4535eb0e, SYS16_ROM_SPRITES | BRF_GRA }, - - { "cpu2a.bin", 0x008000, 0x92c92924, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "cpu2b.bin", 0x020000, 0x2c8ad475, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Fantzn2xp) -STD_ROM_FN(Fantzn2xp) - -static struct BurnRomInfo Fantzn2xps2RomDesc[] = { - { "fz2_s16c.p00", 0x040000, 0xb7d16c1d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "fz2_s16c.p01", 0x040000, 0x2c47487c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "fz2_s16c.scr", 0x080000, 0xed3b1ac0, SYS16_ROM_TILES | BRF_GRA }, - - { "fz2_s16c.spr", 0x200000, 0x14d06fee, SYS16_ROM_SPRITES | BRF_GRA }, - - { "fz2_s16c.snd", 0x030000, 0x0ed30ec1, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fantzn2xps2) -STD_ROM_FN(Fantzn2xps2) - -static struct BurnRomInfo FantzntaRomDesc[] = { - { "fz1_s16b_ta.p00",0x040000, 0xbad0537a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "fz1_s16b.scr", 0x040000, 0x10ecd8b9, SYS16_ROM_TILES | BRF_GRA }, - - { "fz1_s16b_ta.obj",0x200000, 0x51fd438f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "fz1_s16b.snd", 0x020000, 0xa00701fb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fantznta) -STD_ROM_FN(Fantznta) - -static struct BurnRomInfo FpointRomDesc[] = { - { "epr-12599b.a4", 0x10000, 0x26e3f354, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12598b.a1", 0x10000, 0xc0f2c97d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12593.a14", 0x10000, 0xcc0582d8, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12594.a15", 0x10000, 0x8bfc4815, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12595.a16", 0x10000, 0x5b18d60b, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12596.b1", 0x10000, 0x4a4041f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12597.b5", 0x10000, 0x6961e676, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12592.a10", 0x08000, 0x9a8c11bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0127a.key", 0x02000, 0x5adb0042, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fpoint) -STD_ROM_FN(Fpoint) - -static struct BurnRomInfo FpointdRomDesc[] = { - { "bootleg_epr-12599b.a4", 0x10000, 0xf5102d28, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12598b.a1", 0x10000, 0x5335558c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12593.a14", 0x10000, 0xcc0582d8, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12594.a15", 0x10000, 0x8bfc4815, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12595.a16", 0x10000, 0x5b18d60b, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12596.b1", 0x10000, 0x4a4041f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12597.b5", 0x10000, 0x6961e676, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12592.a10", 0x08000, 0x9a8c11bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fpointd) -STD_ROM_FN(Fpointd) - -static struct BurnRomInfo Fpoint1RomDesc[] = { - { "epr-12591b.a7", 0x10000, 0x248b3e1b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12590b.a5", 0x10000, 0x75256e3d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12593.a14", 0x10000, 0xcc0582d8, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12594.a15", 0x10000, 0x8bfc4815, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12595.a16", 0x10000, 0x5b18d60b, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12596.b1", 0x10000, 0x4a4041f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12597.b5", 0x10000, 0x6961e676, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12592.a10", 0x08000, 0x9a8c11bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0127a.key", 0x02000, 0x5adb0042, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fpoint1) -STD_ROM_FN(Fpoint1) - -static struct BurnRomInfo Fpoint1dRomDesc[] = { - { "bootleg_epr-12591b.a7", 0x10000, 0xf778e067, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12590b.a5", 0x10000, 0xe6e2f2cc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12593.a14", 0x10000, 0xcc0582d8, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12594.a15", 0x10000, 0x8bfc4815, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12595.a16", 0x10000, 0x5b18d60b, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12596.b1", 0x10000, 0x4a4041f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12597.b5", 0x10000, 0x6961e676, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12592.a10", 0x08000, 0x9a8c11bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fpoint1d) -STD_ROM_FN(Fpoint1d) - -static struct BurnRomInfo FpointblRomDesc[] = { - { "flpoint.003", 0x10000, 0x4d6df514, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "flpoint.002", 0x10000, 0x4dff2ee8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "flpoint.006", 0x10000, 0xc539727d, SYS16_ROM_TILES | BRF_GRA }, - { "flpoint.005", 0x10000, 0x82c0b8b0, SYS16_ROM_TILES | BRF_GRA }, - { "flpoint.004", 0x10000, 0x522426ae, SYS16_ROM_TILES | BRF_GRA }, - - { "12596.bin", 0x10000, 0x4a4041f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "12597.bin", 0x10000, 0x6961e676, SYS16_ROM_SPRITES | BRF_GRA }, - - { "flpoint.001", 0x08000, 0xc5b8e0fe, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Fpointbl) -STD_ROM_FN(Fpointbl) - -static struct BurnRomInfo FpointbjRomDesc[] = { - { "boot2.003", 0x10000, 0x6c00d1b0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "boot2.002", 0x10000, 0xc1fcd704, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "flpoint.006", 0x10000, 0xc539727d, SYS16_ROM_TILES | BRF_GRA }, - { "flpoint.005", 0x10000, 0x82c0b8b0, SYS16_ROM_TILES | BRF_GRA }, - { "flpoint.004", 0x10000, 0x522426ae, SYS16_ROM_TILES | BRF_GRA }, - - { "12596.bin", 0x10000, 0x4a4041f3, SYS16_ROM_SPRITES | BRF_GRA }, - { "12597.bin", 0x10000, 0x6961e676, SYS16_ROM_SPRITES | BRF_GRA }, - - { "flpoint.001", 0x08000, 0xc5b8e0fe, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "82s129.1", 0x00100, 0xa7c22d96, BRF_OPT }, - { "82s123.2", 0x00020, 0x58bcf8bd, BRF_OPT }, - { "fpointbj_gal16v8_1.bin", 0x00117, 0xba7f292c, BRF_OPT }, - { "fpointbj_gal16v8_3.bin", 0x00117, 0xce1ab1e1, BRF_OPT }, - { "fpointbj_gal20v8.bin", 0x00400, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - - -STD_ROM_PICK(Fpointbj) -STD_ROM_FN(Fpointbj) - -static struct BurnRomInfo GoldnaxeRomDesc[] = { - { "epr-12545.ic2", 0x40000, 0xa97c4e4d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12544.ic1", 0x40000, 0x5e38f668, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.ic19", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.ic20", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.ic21", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.ic9", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.ic12", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.ic10", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.ic13", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.ic11", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.ic14", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.ic8", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.ic6", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0123a.c2", 0x01000, 0xcf19e7d4, SYS16_ROM_I8751 | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Goldnaxe) -STD_ROM_FN(Goldnaxe) - -static struct BurnRomInfo Goldnaxe1RomDesc[] = { - { "epr-12389.ic2", 0x40000, 0x35d5fa77, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12388.ic1", 0x40000, 0x72952a93, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.ic19", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.ic20", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.ic21", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.ic9", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.ic12", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.ic10", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.ic13", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.ic11", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.ic14", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.ic8", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.ic6", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0110.key", 0x02000, 0xcd517dc6, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Goldnaxe1) -STD_ROM_FN(Goldnaxe1) - -static struct BurnRomInfo Goldnaxe1dRomDesc[] = { - { "bootleg_epr-12389.ic2", 0x40000, 0x0c443d5e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12388.ic1", 0x40000, 0x841d70ed, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.ic19", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.ic20", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.ic21", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.ic9", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.ic12", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.ic10", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.ic13", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.ic11", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.ic14", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.ic8", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.ic6", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Goldnaxe1d) -STD_ROM_FN(Goldnaxe1d) - -static struct BurnRomInfo Goldnaxe2RomDesc[] = { - { "epr-12523.a7", 0x20000, 0x8e6128d7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12522.a5", 0x20000, 0xb6c35160, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12521.a8", 0x20000, 0x5001d713, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12519.a6", 0x20000, 0x4438ca8e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.a14", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.a15", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.a16", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.b1", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.b5", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.b2", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.b6", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.b3", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.b7", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.a10", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.a11", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0112.c2", 0x01000, 0xd8f2f1c0, BRF_OPT }, // Intel i8751 protection MCU -}; - - -STD_ROM_PICK(Goldnaxe2) -STD_ROM_FN(Goldnaxe2) - -static struct BurnRomInfo Goldnaxe3RomDesc[] = { - { "epr-12525.a7", 0x20000, 0x48332c76, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12524.a5", 0x20000, 0x8e58f342, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12521.a8", 0x20000, 0x5001d713, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12519.a6", 0x20000, 0x4438ca8e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.a14", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.a15", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.a16", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.b1", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.b5", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.b2", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.b6", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.b3", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.b7", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.a10", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.a11", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0120.key", 0x02000, 0x946e9fa6, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Goldnaxe3) -STD_ROM_FN(Goldnaxe3) - -static struct BurnRomInfo Goldnaxe3dRomDesc[] = { - { "bootleg_epr-12525.a7", 0x20000, 0xf8dbae51, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12524.a5", 0x20000, 0x908e4159, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12521.a8", 0x20000, 0x5001d713, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12519.a6", 0x20000, 0x4438ca8e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.a14", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.a15", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.a16", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.b1", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.b5", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.b2", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.b6", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.b3", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.b7", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.a10", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.a11", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Goldnaxe3d) -STD_ROM_FN(Goldnaxe3d) - -static struct BurnRomInfo GoldnaxejRomDesc[] = { - { "epr-12540.a7", 0x20000, 0x0c7ccc6d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12539.a5", 0x20000, 0x1f24f7d0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12521.a8", 0x20000, 0x5001d713, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12519.a6", 0x20000, 0x4438ca8e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.a14", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.a15", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.a16", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.b1", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.b5", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.b2", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.b6", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.b3", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.b7", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.a10", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.a11", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0121.key", 0x02000, 0x72afed01, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Goldnaxej) -STD_ROM_FN(Goldnaxej) - -static struct BurnRomInfo GoldnaxejdRomDesc[] = { - { "bootleg_epr-12540.a7", 0x20000, 0x601bb784, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12539.a5", 0x20000, 0xc76c0969, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12521.a8", 0x20000, 0x5001d713, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12519.a6", 0x20000, 0x4438ca8e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.a14", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.a15", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.a16", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.b1", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.b5", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.b2", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.b6", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.b3", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.b7", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.a10", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.a11", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Goldnaxejd) -STD_ROM_FN(Goldnaxejd) - -static struct BurnRomInfo GoldnaxeuRomDesc[] = { - { "epr-12543.ic2", 0x40000, 0xb0df9ca4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12542.ic1", 0x40000, 0xb7994d3c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.ic19", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.ic20", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.ic21", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.ic9", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.ic12", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.ic10", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.ic13", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.ic11", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.ic14", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.ic8", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.ic6", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0122.key", 0x02000, 0xf123c2fb, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Goldnaxeu) -STD_ROM_FN(Goldnaxeu) - -static struct BurnRomInfo GoldnaxeudRomDesc[] = { - { "bootleg_epr-12543.ic2", 0x40000, 0xe3089080, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12542.ic1", 0x40000, 0x1e84364b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12385.ic19", 0x20000, 0xb8a4e7e0, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12386.ic20", 0x20000, 0x25d7d779, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12387.ic21", 0x20000, 0xc7fcadf3, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12378.ic9", 0x40000, 0x119e5a82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12379.ic12", 0x40000, 0x1a0e8c57, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12380.ic10", 0x40000, 0xbb2c0853, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12381.ic13", 0x40000, 0x81ba6ecc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12382.ic11", 0x40000, 0x81601c6f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12383.ic14", 0x40000, 0x5dbacf7a, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12390.ic8", 0x08000, 0x399fc5f5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12384.ic6", 0x20000, 0x6218d8e7, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Goldnaxeud) -STD_ROM_FN(Goldnaxeud) - -static struct BurnRomInfo HwchampRomDesc[] = { - { "epr-11239.a7", 0x20000, 0xe5abfed7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11238.a5", 0x20000, 0x25180124, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11241.a14", 0x20000, 0xfc586a86, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11166.b14", 0x20000, 0xaeaaa9d8, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11242.a15", 0x20000, 0x7715a742, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11167.b15", 0x20000, 0x63a82afa, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11243.a16", 0x20000, 0xf30cd5fd, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-11168.b16", 0x20000, 0x5b8494a8, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-11158.b1", 0x20000, 0xfc098a13, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11162.b5", 0x20000, 0x5db934a8, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11159.b2", 0x20000, 0x1f27ee74, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11163.b6", 0x20000, 0x8a6a5cf1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11160.b3", 0x20000, 0xc0b2ba82, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11164.b7", 0x20000, 0xd6c7917b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11161.b4", 0x20000, 0x35c9e44b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11165.b8", 0x20000, 0x57e8f9d2, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11240.a10", 0x08000, 0x96a12d9d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11244.a11", 0x20000, 0x4191c03d, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-11245.a12", 0x20000, 0xa4d53f7b, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "pls153.bin", 0x000eb, 0x39b47212, BRF_OPT }, // PLD -}; - - -STD_ROM_PICK(Hwchamp) -STD_ROM_FN(Hwchamp) - -static struct BurnRomInfo HwchampjRomDesc[] = { - { "epr-11152.a7", 0x20000, 0x8ab0ce62, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11153.a5", 0x20000, 0x84a743de, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11202.a14", 0x20000, 0x7c94ede3, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11213.b14", 0x20000, 0xaeaaa9d8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11203.a15", 0x20000, 0x327754f7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11214.b15", 0x20000, 0x63a82afa, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11204.a16", 0x20000, 0xdfc4cd33, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11215.b16", 0x20000, 0x5b8494a8, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11205.b1", 0x20000, 0xfc098a13, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11209.b5", 0x20000, 0x5db934a8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11206.b2", 0x20000, 0x1f27ee74, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11210.b6", 0x20000, 0x8a6a5cf1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11207.b3", 0x20000, 0xc0b2ba82, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11211.b7", 0x20000, 0xd6c7917b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11208.b4", 0x20000, 0x35c9e44b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11212.b8", 0x20000, 0x57e8f9d2, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11154.a10", 0x08000, 0x65791275, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11200.a11", 0x20000, 0x5c41a68a, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11201.a12", 0x20000, 0x9a993120, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0046.key", 0x02000, 0x488b3f8b, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, - - { "pls153.bin", 0x000eb, 0x39b47212, BRF_OPT }, // PLD -}; - - -STD_ROM_PICK(Hwchampj) -STD_ROM_FN(Hwchampj) - -static struct BurnRomInfo HwchampjdRomDesc[] = { - { "bootleg_epr-11152.a7", 0x20000, 0x3672978a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11153.a5", 0x20000, 0x804b65bc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11202.a14", 0x20000, 0x7c94ede3, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11213.b14", 0x20000, 0xaeaaa9d8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11203.a15", 0x20000, 0x327754f7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11214.b15", 0x20000, 0x63a82afa, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11204.a16", 0x20000, 0xdfc4cd33, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11215.b16", 0x20000, 0x5b8494a8, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11205.b1", 0x20000, 0xfc098a13, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11209.b5", 0x20000, 0x5db934a8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11206.b2", 0x20000, 0x1f27ee74, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11210.b6", 0x20000, 0x8a6a5cf1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11207.b3", 0x20000, 0xc0b2ba82, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11211.b7", 0x20000, 0xd6c7917b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11208.b4", 0x20000, 0x35c9e44b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11212.b8", 0x20000, 0x57e8f9d2, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11154.a10", 0x08000, 0x65791275, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11200.a11", 0x20000, 0x5c41a68a, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11201.a12", 0x20000, 0x9a993120, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "pls153.bin", 0x000eb, 0x39b47212, BRF_OPT }, // PLD -}; - - -STD_ROM_PICK(Hwchampjd) -STD_ROM_FN(Hwchampjd) - -static struct BurnRomInfo LockonphRomDesc[] = { - { "B4", 0x40000, 0xfbb896f4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "B2", 0x40000, 0xfc1c9f81, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "B3", 0x20000, 0x3f8c0215, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "B1", 0x20000, 0xf11a72ac, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "B10", 0x20000, 0xd3a8bd15, SYS16_ROM_TILES | BRF_GRA }, - { "B7", 0x20000, 0x787c382e, SYS16_ROM_TILES | BRF_GRA }, - { "B9", 0x20000, 0xaae2cef1, SYS16_ROM_TILES | BRF_GRA }, - { "B8", 0x20000, 0xcd30abe0, SYS16_ROM_TILES | BRF_GRA }, - - { "B14", 0x40000, 0xaf943525, SYS16_ROM_SPRITES | BRF_GRA }, - { "B12", 0x40000, 0x9088d980, SYS16_ROM_SPRITES | BRF_GRA }, - { "B13", 0x20000, 0x62f4b64f, SYS16_ROM_SPRITES | BRF_GRA }, - { "B11", 0x20000, 0x5da3dfcd, SYS16_ROM_SPRITES | BRF_GRA }, - - { "B6", 0x10000, 0xaa7b1880, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "B5", 0x20000, 0xd6369a39, SYS16_ROM_MSM6295 | BRF_SND }, -}; - - -STD_ROM_PICK(Lockonph) -STD_ROM_FN(Lockonph) - -static struct BurnRomInfo MvpRomDesc[] = { - { "epr-13000.a2", 0x40000, 0x2e0e21ec, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12999.a1", 0x40000, 0xfd213d28, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13011.b11", 0x40000, 0x1cb871fc, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13012.b12", 0x40000, 0xb75e6821, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13013.b13", 0x40000, 0xf1944a3c, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13003.b1", 0x40000, 0x21424151, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13006.b4", 0x40000, 0x2e9afd2f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13004.b2", 0x40000, 0x0aa09dd3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13007.b5", 0x40000, 0x55c8605b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13005.b3", 0x40000, 0xc899c810, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13008.b6", 0x40000, 0xb3d46dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13009.b7", 0x40000, 0x126d2e37, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13010.b8", 0x40000, 0xdf37c567, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13002.a13", 0x08000, 0x1b6e1515, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13001.a11", 0x40000, 0xe8cace8c, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0143.key", 0x02000, 0xfba2e8da, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Mvp) -STD_ROM_FN(Mvp) - -static struct BurnRomInfo MvpdRomDesc[] = { - { "bootleg_epr-13000.a2", 0x40000, 0xfa72e415, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12999.a1", 0x40000, 0x0af75927, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13011.b11", 0x40000, 0x1cb871fc, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13012.b12", 0x40000, 0xb75e6821, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13013.b13", 0x40000, 0xf1944a3c, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13003.b1", 0x40000, 0x21424151, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13006.b4", 0x40000, 0x2e9afd2f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13004.b2", 0x40000, 0x0aa09dd3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13007.b5", 0x40000, 0x55c8605b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13005.b3", 0x40000, 0xc899c810, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13008.b6", 0x40000, 0xb3d46dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13009.b7", 0x40000, 0x126d2e37, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13010.b8", 0x40000, 0xdf37c567, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13002.a13", 0x08000, 0x1b6e1515, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13001.a11", 0x40000, 0xe8cace8c, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Mvpd) -STD_ROM_FN(Mvpd) - -static struct BurnRomInfo MvpjRomDesc[] = { - { "epr-12967.a7", 0x20000, 0xe53ac137, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12965.a5", 0x20000, 0x4266cb9e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12968.a8", 0x20000, 0x91c772ac, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12966.a6", 0x20000, 0x39365a79, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12971.a14", 0x20000, 0x245dcd1f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12983.b14", 0x20000, 0xf3570fc9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12972.a15", 0x20000, 0xff7c4278, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12984.b15", 0x20000, 0xd37d1876, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12973.a16", 0x20000, 0x8dc9b9ea, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12985.b16", 0x20000, 0xe3f33a8a, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12974.b1", 0x20000, 0xe1da5597, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12977.b5", 0x20000, 0xb9eb9762, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12975.b2", 0x20000, 0x364d51d1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12978.b6", 0x20000, 0x014b5442, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12976.b3", 0x20000, 0x43b549c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12979.b7", 0x20000, 0x20f603f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12962.a1", 0x20000, 0x9b678da3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12980.b10", 0x20000, 0x883b792a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12963.a2", 0x20000, 0x8870f95a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12981.b11", 0x20000, 0x48636cb0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12964.a3", 0x20000, 0xf9148c5d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12982.b12", 0x20000, 0xc4453292, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12969.a10", 0x08000, 0xec621893, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12970.a11", 0x20000, 0x8f7d7657, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0142.key", 0x02000, 0x90468045, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Mvpj) -STD_ROM_FN(Mvpj) - -static struct BurnRomInfo MvpjdRomDesc[] = { - { "bootleg_epr-12967.a7", 0x20000, 0x7eb52b77, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12965.a5", 0x20000, 0x62c961b0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12968.a8", 0x20000, 0x91c772ac, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12966.a6", 0x20000, 0x39365a79, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12971.a14", 0x20000, 0x245dcd1f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12983.b14", 0x20000, 0xf3570fc9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12972.a15", 0x20000, 0xff7c4278, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12984.b15", 0x20000, 0xd37d1876, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12973.a16", 0x20000, 0x8dc9b9ea, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12985.b16", 0x20000, 0xe3f33a8a, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12974.b1", 0x20000, 0xe1da5597, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12977.b5", 0x20000, 0xb9eb9762, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12975.b2", 0x20000, 0x364d51d1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12978.b6", 0x20000, 0x014b5442, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12976.b3", 0x20000, 0x43b549c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12979.b7", 0x20000, 0x20f603f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12962.a1", 0x20000, 0x9b678da3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12980.b10", 0x20000, 0x883b792a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12963.a2", 0x20000, 0x8870f95a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12981.b11", 0x20000, 0x48636cb0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12964.a3", 0x20000, 0xf9148c5d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12982.b12", 0x20000, 0xc4453292, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12969.a10", 0x08000, 0xec621893, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12970.a11", 0x20000, 0x8f7d7657, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Mvpjd) -STD_ROM_FN(Mvpjd) - -static struct BurnRomInfo PassshtRomDesc[] = { - { "epr-11871.a4", 0x10000, 0x0f9ccea5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11870.a1", 0x10000, 0xdf43ebcf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11854.b9", 0x10000, 0xd31c0b6c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11855.b10", 0x10000, 0xb78762b4, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11856.b11", 0x10000, 0xea49f666, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-11862.b1", 0x10000, 0xb6e94727, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11865.b5", 0x10000, 0x17e8d5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11863.b2", 0x10000, 0x3e670098, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11866.b6", 0x10000, 0x50eb71cc, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11864.b3", 0x10000, 0x05733ca8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11867.b7", 0x10000, 0x81e49697, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11857.a7", 0x08000, 0x789edc06, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11858.a8", 0x08000, 0x08ab0018, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11859.a9", 0x08000, 0x8673e01b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11860.a10", 0x08000, 0x10263746, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11861.a11", 0x08000, 0x38b54a71, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0080.key", 0x02000, 0x222d016f, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Passsht) -STD_ROM_FN(Passsht) - -static struct BurnRomInfo PassshtdRomDesc[] = { - { "bootleg_epr-11871.a4", 0x10000, 0xf009c017, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11870.a1", 0x10000, 0x9cd5f12f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11854.b9", 0x10000, 0xd31c0b6c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11855.b10", 0x10000, 0xb78762b4, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11856.b11", 0x10000, 0xea49f666, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-11862.b1", 0x10000, 0xb6e94727, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11865.b5", 0x10000, 0x17e8d5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11863.b2", 0x10000, 0x3e670098, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11866.b6", 0x10000, 0x50eb71cc, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11864.b3", 0x10000, 0x05733ca8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11867.b7", 0x10000, 0x81e49697, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11857.a7", 0x08000, 0x789edc06, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11858.a8", 0x08000, 0x08ab0018, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11859.a9", 0x08000, 0x8673e01b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11860.a10", 0x08000, 0x10263746, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11861.a11", 0x08000, 0x38b54a71, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Passshtd) -STD_ROM_FN(Passshtd) - -static struct BurnRomInfo PassshtaRomDesc[] = { - { "8.a4", 0x10000, 0xb84dc139, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "5.a1", 0x10000, 0xeffe29df, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11854.b9", 0x10000, 0xd31c0b6c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11855.b10", 0x10000, 0xb78762b4, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11856.b11", 0x10000, 0xea49f666, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-11862.b1", 0x10000, 0xb6e94727, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11865.b5", 0x10000, 0x17e8d5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11863.b2", 0x10000, 0x3e670098, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11866.b6", 0x10000, 0x50eb71cc, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11864.b3", 0x10000, 0x05733ca8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11867.b7", 0x10000, 0x81e49697, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11857.a7", 0x08000, 0x789edc06, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11858.a8", 0x08000, 0x08ab0018, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11859.a9", 0x08000, 0x8673e01b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11860.a10", 0x08000, 0x10263746, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11861.a11", 0x08000, 0x38b54a71, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0074.key", 0x02000, 0x71bd232d, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Passshta) -STD_ROM_FN(Passshta) - -static struct BurnRomInfo PassshtadRomDesc[] = { - { "bootleg_8.a4", 0x10000, 0x6d63bf18, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_5.a1", 0x10000, 0xfd4d0419, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11854.b9", 0x10000, 0xd31c0b6c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11855.b10", 0x10000, 0xb78762b4, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11856.b11", 0x10000, 0xea49f666, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-11862.b1", 0x10000, 0xb6e94727, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11865.b5", 0x10000, 0x17e8d5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11863.b2", 0x10000, 0x3e670098, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11866.b6", 0x10000, 0x50eb71cc, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11864.b3", 0x10000, 0x05733ca8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11867.b7", 0x10000, 0x81e49697, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11857.a7", 0x08000, 0x789edc06, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11858.a8", 0x08000, 0x08ab0018, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11859.a9", 0x08000, 0x8673e01b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11860.a10", 0x08000, 0x10263746, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11861.a11", 0x08000, 0x38b54a71, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Passshtad) -STD_ROM_FN(Passshtad) - -static struct BurnRomInfo PassshtjRomDesc[] = { - { "epr-11853.a4", 0x10000, 0xfab337e7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11852.a1", 0x10000, 0x892a81fc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11854.b9", 0x10000, 0xd31c0b6c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11855.b10", 0x10000, 0xb78762b4, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11856.b11", 0x10000, 0xea49f666, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-11862.b1", 0x10000, 0xb6e94727, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11865.b5", 0x10000, 0x17e8d5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11863.b2", 0x10000, 0x3e670098, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11866.b6", 0x10000, 0x50eb71cc, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11864.b3", 0x10000, 0x05733ca8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11867.b7", 0x10000, 0x81e49697, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11857.a7", 0x08000, 0x789edc06, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11858.a8", 0x08000, 0x08ab0018, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11859.a9", 0x08000, 0x8673e01b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11860.a10", 0x08000, 0x10263746, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11861.a11", 0x08000, 0x38b54a71, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0070.key", 0x02000, 0x5d0308aa, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Passshtj) -STD_ROM_FN(Passshtj) - -static struct BurnRomInfo PassshtjdRomDesc[] = { - { "bootleg_epr-11853.a4", 0x10000, 0xaf289531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11852.a1", 0x10000, 0xce765977, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11854.b9", 0x10000, 0xd31c0b6c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11855.b10", 0x10000, 0xb78762b4, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11856.b11", 0x10000, 0xea49f666, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-11862.b1", 0x10000, 0xb6e94727, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11865.b5", 0x10000, 0x17e8d5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11863.b2", 0x10000, 0x3e670098, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11866.b6", 0x10000, 0x50eb71cc, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11864.b3", 0x10000, 0x05733ca8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11867.b7", 0x10000, 0x81e49697, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11857.a7", 0x08000, 0x789edc06, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11858.a8", 0x08000, 0x08ab0018, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11859.a9", 0x08000, 0x8673e01b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11860.a10", 0x08000, 0x10263746, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11861.a11", 0x08000, 0x38b54a71, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Passshtjd) -STD_ROM_FN(Passshtjd) - -static struct BurnRomInfo PassshtbRomDesc[] = { - { "pass3_2p.bin", 0x10000, 0x26bb9299, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pass4_2p.bin", 0x10000, 0x06ac6d5d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr11854.b9", 0x10000, 0xd31c0b6c, SYS16_ROM_TILES | BRF_GRA }, - { "opr11855.b10", 0x10000, 0xb78762b4, SYS16_ROM_TILES | BRF_GRA }, - { "opr11856.b11", 0x10000, 0xea49f666, SYS16_ROM_TILES | BRF_GRA }, - - { "opr11862.b1", 0x10000, 0xb6e94727, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr11865.b5", 0x10000, 0x17e8d5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr11863.b2", 0x10000, 0x3e670098, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr11866.b6", 0x10000, 0x50eb71cc, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr11864.b3", 0x10000, 0x05733ca8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr11867.b7", 0x10000, 0x81e49697, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr11857.a7", 0x08000, 0x789edc06, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr11858.a8", 0x08000, 0x08ab0018, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr11859.a9", 0x08000, 0x8673e01b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr11860.a10", 0x08000, 0x10263746, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr11861.a11", 0x08000, 0x38b54a71, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Passshtb) -STD_ROM_FN(Passshtb) - -static struct BurnRomInfo CencourtRomDesc[] = { - { "a4_56f6.a4", 0x10000, 0x7116dce6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "a1_478b.a1", 0x10000, 0x37beb770, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-b-9.b9", 0x10000, 0x9a55cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-b-10.b10", 0x10000, 0xfc13ca35, SYS16_ROM_TILES | BRF_GRA }, - { "epr-b-11.b11", 0x10000, 0x1503c203, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-b-1.b1", 0x10000, 0xb18bfccf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-b-5.b5", 0x10000, 0x3481a8e8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-b-2.b2", 0x10000, 0x61a996c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-b-6.b6", 0x10000, 0x2116bcb1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-b-3.b3", 0x10000, 0x69a2e109, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-b-7.b7", 0x10000, 0xccf6b09f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-b-4.b4", 0x10000, 0xbdf63cd2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-b-8.b8", 0x10000, 0x88a90641, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-a-7.a7", 0x08000, 0x9e1b81c6, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, // encrypted - - { "epr-a-8.a8", 0x08000, 0x08ab0018, SYS16_ROM_UPD7759DATA | BRF_SND }, // == epr-11858.a8 - { "epr-a-9.a9", 0x08000, 0x8673e01b, SYS16_ROM_UPD7759DATA | BRF_SND }, // == epr-11859.a9 - { "epr-a-10.a10", 0x08000, 0x10263746, SYS16_ROM_UPD7759DATA | BRF_SND }, // == epr-11860.a10 - { "epr-a-11.a11", 0x08000, 0x38b54a71, SYS16_ROM_UPD7759DATA | BRF_SND }, // == epr-11861.a11 - - { "mc-8123b_center_court.key", 0x02000, 0x2be5c90b, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, // No official 317-xxxx number -}; - - -STD_ROM_PICK(Cencourt) -STD_ROM_FN(Cencourt) - -static struct BurnRomInfo RiotcityRomDesc[] = { - { "epr-14612.bin", 0x20000, 0xa1b331ec, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14610.bin", 0x20000, 0xcd4f2c50, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14613.bin", 0x20000, 0x0659df4c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14611.bin", 0x20000, 0xd9e6f80b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14616.bin", 0x20000, 0x46d30368, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14625.bin", 0x20000, 0xabfb80fe, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14617.bin", 0x20000, 0x884e40f9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14626.bin", 0x20000, 0x4ef55846, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14618.bin", 0x20000, 0x00eb260e, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14627.bin", 0x20000, 0x961e5f82, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-14619.bin", 0x40000, 0x6f2b5ef7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14622.bin", 0x40000, 0x7ca7e40d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14620.bin", 0x40000, 0x66183333, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14623.bin", 0x40000, 0x98630049, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14621.bin", 0x40000, 0xc0f2820e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14624.bin", 0x40000, 0xd1a68448, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14614.bin", 0x10000, 0xc65cc69a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-14615.bin", 0x20000, 0x46653db1, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Riotcity) -STD_ROM_FN(Riotcity) - -static struct BurnRomInfo RyukyuRomDesc[] = { - { "epr-13348.a7", 0x10000, 0x5f0e0c86, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13347.a5", 0x10000, 0x398031fa, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13351.a14", 0x20000, 0xa68a4e6d, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13352.a15", 0x20000, 0x5e5531e4, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13353.a16", 0x20000, 0x6d23dfd8, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13354.b1", 0x20000, 0xf07aad99, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13356.b5", 0x20000, 0x5498290b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13355.b2", 0x20000, 0x67890019, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13357.b6", 0x20000, 0xf9e7cf03, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13349.a10", 0x08000, 0xb83183f8, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13350.a11", 0x20000, 0x3c59a658, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-5023.key", 0x02000, 0x43704331, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Ryukyu) -STD_ROM_FN(Ryukyu) - -static struct BurnRomInfo RyukyudRomDesc[] = { - { "bootleg_epr-13348.a7", 0x10000, 0x3a96bdcd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13347.a5", 0x10000, 0x99fddef0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-13351.a14", 0x20000, 0xa68a4e6d, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13352.a15", 0x20000, 0x5e5531e4, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13353.a16", 0x20000, 0x6d23dfd8, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13354.b1", 0x20000, 0xf07aad99, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13356.b5", 0x20000, 0x5498290b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13355.b2", 0x20000, 0x67890019, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13357.b6", 0x20000, 0xf9e7cf03, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13349.a10", 0x08000, 0xb83183f8, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13350.a11", 0x20000, 0x3c59a658, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Ryukyud) -STD_ROM_FN(Ryukyud) - -static struct BurnRomInfo SdibRomDesc[] = { - { "epr-10986a.a4", 0x08000, 0x3e136215, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10984a.a1", 0x08000, 0x44bf3cf5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10987a.a5", 0x08000, 0xcfd79404, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10985a.a2", 0x08000, 0x1c21a03f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10829.a6", 0x08000, 0xa431ab08, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10826.a3", 0x08000, 0x2ed8e4b7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10772.b9", 0x10000, 0x182b6301, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10773.b10", 0x10000, 0x8f7129a2, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10774.b11", 0x10000, 0x4409411f, SYS16_ROM_TILES | BRF_GRA }, - - { "10760.b1", 0x10000, 0x70de327b, SYS16_ROM_SPRITES | BRF_GRA }, - { "10763.b5", 0x10000, 0x99ec5cb5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10761.b2", 0x10000, 0x4e80f80d, SYS16_ROM_SPRITES | BRF_GRA }, - { "10764.b6", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10762.b3", 0x10000, 0x464b5f78, SYS16_ROM_SPRITES | BRF_GRA }, - { "10765.b7", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "10775.a7", 0x08000, 0x4cbd55a8, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0028.key", 0x02000, 0x9a5307b2, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sdib) -STD_ROM_FN(Sdib) - -static struct BurnRomInfo SdiblRomDesc[] = { - { "a4.rom", 0x08000, 0xf2c41dd6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "a1.rom", 0x08000, 0xa9f816ef, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "a5.rom", 0x08000, 0x7952e27e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "a2.rom", 0x08000, 0x369af326, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "a6.rom", 0x08000, 0x8ee2c287, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "a3.rom", 0x08000, 0x193e4231, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10772.b9", 0x10000, 0x182b6301, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10773.b10", 0x10000, 0x8f7129a2, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10774.b11", 0x10000, 0x4409411f, SYS16_ROM_TILES | BRF_GRA }, - - { "b1.rom", 0x10000, 0x30e2c50a, SYS16_ROM_SPRITES | BRF_GRA }, - { "b5.rom", 0x10000, 0x794e3e8b, SYS16_ROM_SPRITES | BRF_GRA }, - { "b2.rom", 0x10000, 0x6a8b3fd0, SYS16_ROM_SPRITES | BRF_GRA }, - { "10764.b6", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "b3.rom", 0x10000, 0xb9de3aeb, SYS16_ROM_SPRITES | BRF_GRA }, - { "10765.b7", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "a7.rom", 0x08000, 0x793f9f7f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sdibl) -STD_ROM_FN(Sdibl) - -static struct BurnRomInfo Sdibl2RomDesc[] = { - { "de1", 0x08000, 0x56f6fd26, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do1", 0x08000, 0x549c759f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de2", 0x08000, 0xb0a9ad05, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do2", 0x08000, 0x54b7ec04, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de3", 0x08000, 0x8ee2c287, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do3", 0x08000, 0x193e4231, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "pe1", 0x08000, 0xf0a190c0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po1", 0x08000, 0xf68c4d0e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe2", 0x08000, 0x109c9afd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po2", 0x08000, 0x6d614e76, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe3", 0x08000, 0x589e2cfe, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po3", 0x08000, 0x57ba57b2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10772.b9", 0x10000, 0x182b6301, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10773.b10", 0x10000, 0x8f7129a2, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10774.b11", 0x10000, 0x4409411f, SYS16_ROM_TILES | BRF_GRA }, - - { "10760.b1", 0x10000, 0x70de327b, SYS16_ROM_SPRITES | BRF_GRA }, - { "10763.b5", 0x10000, 0x99ec5cb5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10761.b2", 0x10000, 0x4e80f80d, SYS16_ROM_SPRITES | BRF_GRA }, - { "10764.b6", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10762.b3", 0x10000, 0x464b5f78, SYS16_ROM_SPRITES | BRF_GRA }, - { "10765.b7", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "a7.rom", 0x08000, 0x793f9f7f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sdibl2) -STD_ROM_FN(Sdibl2) - -static struct BurnRomInfo Sdibl3RomDesc[] = { - { "de1a", 0x08000, 0x3908c6a0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do1a", 0x08000, 0xcd7b7750, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de2a", 0x08000, 0xf45f6935, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do2a", 0x08000, 0xd3d3efaa, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de3", 0x08000, 0x8ee2c287, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do3", 0x08000, 0x193e4231, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "pe1a", 0x08000, 0xe4d8f399, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po1a", 0x08000, 0x910f9532, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe2a", 0x08000, 0x76a261b1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po2a", 0x08000, 0x2cd18da8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe3a", 0x08000, 0x19120b62, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po3a", 0x08000, 0x4dce4361, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10772.b9", 0x10000, 0x182b6301, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10773.b10", 0x10000, 0x8f7129a2, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10774.b11", 0x10000, 0x4409411f, SYS16_ROM_TILES | BRF_GRA }, - - { "10760.b1", 0x10000, 0x70de327b, SYS16_ROM_SPRITES | BRF_GRA }, - { "10763.b5", 0x10000, 0x99ec5cb5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10761.b2", 0x10000, 0x4e80f80d, SYS16_ROM_SPRITES | BRF_GRA }, - { "10764.b6", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10762.b3", 0x10000, 0x464b5f78, SYS16_ROM_SPRITES | BRF_GRA }, - { "10765.b7", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "a7.rom", 0x08000, 0x793f9f7f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sdibl3) -STD_ROM_FN(Sdibl3) - -static struct BurnRomInfo Sdibl4RomDesc[] = { - { "de1b", 0x08000, 0x8045bfd1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do1b", 0x08000, 0x8f86f2ad, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de2b", 0x08000, 0x1b284afd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do2b", 0x08000, 0x8c979a2b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de3", 0x08000, 0x8ee2c287, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do3", 0x08000, 0x193e4231, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "pe1b", 0x08000, 0xaba84f5e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po1b", 0x08000, 0x249278a3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe2b", 0x08000, 0x480d4379, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po2b", 0x08000, 0xf27eae0b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe3a", 0x08000, 0x19120b62, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po3a", 0x08000, 0x4dce4361, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10772.b9", 0x10000, 0x182b6301, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10773.b10", 0x10000, 0x8f7129a2, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10774.b11", 0x10000, 0x4409411f, SYS16_ROM_TILES | BRF_GRA }, - - { "10760.b1", 0x10000, 0x70de327b, SYS16_ROM_SPRITES | BRF_GRA }, - { "10763.b5", 0x10000, 0x99ec5cb5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10761.b2", 0x10000, 0x4e80f80d, SYS16_ROM_SPRITES | BRF_GRA }, - { "10764.b6", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10762.b3", 0x10000, 0x464b5f78, SYS16_ROM_SPRITES | BRF_GRA }, - { "10765.b7", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "a7.rom", 0x08000, 0x793f9f7f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sdibl4) -STD_ROM_FN(Sdibl4) - -static struct BurnRomInfo Sdibl5RomDesc[] = { - { "de1c", 0x08000, 0x3e3d4cc1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do1c", 0x08000, 0xa71ad68c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de2c", 0x08000, 0x770bbec5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do2c", 0x08000, 0x0f1f339f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de3", 0x08000, 0x8ee2c287, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do3", 0x08000, 0x193e4231, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "pe1c", 0x08000, 0xd7d444d5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po1c", 0x08000, 0x1bc879dd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe2c", 0x08000, 0x5cd1bfc8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po2c", 0x08000, 0xb404d1be, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe3a", 0x08000, 0x19120b62, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po3a", 0x08000, 0x4dce4361, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10772.b9", 0x10000, 0x182b6301, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10773.b10", 0x10000, 0x8f7129a2, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10774.b11", 0x10000, 0x4409411f, SYS16_ROM_TILES | BRF_GRA }, - - { "10760.b1", 0x10000, 0x70de327b, SYS16_ROM_SPRITES | BRF_GRA }, - { "10763.b5", 0x10000, 0x99ec5cb5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10761.b2", 0x10000, 0x4e80f80d, SYS16_ROM_SPRITES | BRF_GRA }, - { "10764.b6", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10762.b3", 0x10000, 0x464b5f78, SYS16_ROM_SPRITES | BRF_GRA }, - { "10765.b7", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "a7.rom", 0x08000, 0x793f9f7f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sdibl5) -STD_ROM_FN(Sdibl5) - -static struct BurnRomInfo Sdibl6RomDesc[] = { - { "de1c", 0x08000, 0x3e3d4cc1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do1c", 0x08000, 0xa71ad68c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de2c", 0x08000, 0x770bbec5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do2c", 0x08000, 0x0f1f339f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "de3", 0x08000, 0x8ee2c287, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "do3", 0x08000, 0x193e4231, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "pe1d", 0x08000, 0xc8b9e556, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po1d", 0x08000, 0x38eaeeb1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe2c", 0x08000, 0x5cd1bfc8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po2c", 0x08000, 0xb404d1be, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "pe3a", 0x08000, 0x19120b62, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "po3d", 0x08000, 0xb1e5c2f1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10772.b9", 0x10000, 0x182b6301, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10773.b10", 0x10000, 0x8f7129a2, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10774.b11", 0x10000, 0x4409411f, SYS16_ROM_TILES | BRF_GRA }, - - { "10760.b1", 0x10000, 0x70de327b, SYS16_ROM_SPRITES | BRF_GRA }, - { "10763.b5", 0x10000, 0x99ec5cb5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10761.b2", 0x10000, 0x4e80f80d, SYS16_ROM_SPRITES | BRF_GRA }, - { "10764.b6", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10762.b3", 0x10000, 0x464b5f78, SYS16_ROM_SPRITES | BRF_GRA }, - { "10765.b7", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "a7.rom", 0x08000, 0x793f9f7f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sdibl6) -STD_ROM_FN(Sdibl6) - -static struct BurnRomInfo DefenseRomDesc[] = { - { "epr-10917a.a4", 0x08000, 0xd91ac47c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10915.a1", 0x08000, 0x7344c510, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10918a.a5", 0x08000, 0xe41befcd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10916a.a2", 0x08000, 0x7f58ba12, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10829.a6", 0x08000, 0xa431ab08, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10826.a3", 0x08000, 0x2ed8e4b7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "10919.b9", 0x10000, 0x23b88f82, SYS16_ROM_TILES | BRF_GRA }, - { "10920.b10", 0x10000, 0x22b1fb4c, SYS16_ROM_TILES | BRF_GRA }, - { "10921.b11", 0x10000, 0x7788f55d, SYS16_ROM_TILES | BRF_GRA }, - - { "10760.b1", 0x10000, 0x70de327b, SYS16_ROM_SPRITES | BRF_GRA }, - { "10763.b5", 0x10000, 0x99ec5cb5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10761.b2", 0x10000, 0x4e80f80d, SYS16_ROM_SPRITES | BRF_GRA }, - { "10764.b6", 0x10000, 0x602da5d5, SYS16_ROM_SPRITES | BRF_GRA }, - { "10762.b3", 0x10000, 0x464b5f78, SYS16_ROM_SPRITES | BRF_GRA }, - { "10765.b7", 0x10000, 0x0a73a057, SYS16_ROM_SPRITES | BRF_GRA }, - - { "10775.a7", 0x08000, 0x4cbd55a8, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0028.key", 0x02000, 0x9a5307b2, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Defense) -STD_ROM_FN(Defense) - -static struct BurnRomInfo Shinobi2RomDesc[] = { - { "epr-11282.a4", 0x10000, 0x5f2e5524, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11280.a1", 0x10000, 0xbdfe5c38, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11283.a5", 0x10000, 0x9d46e707, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11281.a2", 0x10000, 0x7961d07e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11284.b9", 0x10000, 0x5f62e163, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11285.b10", 0x10000, 0x75f8fbc9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11286.b11", 0x10000, 0x06508bb9, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11290.b1", 0x10000, 0x611f413a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11294.b5", 0x10000, 0x5eb00fc1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11291.b2", 0x10000, 0x3c0797c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11295.b6", 0x10000, 0x25307ef8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11292.b3", 0x10000, 0xc29ac34e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11296.b7", 0x10000, 0x04a437f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11293.b4", 0x10000, 0x41f41063, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11297.b8", 0x10000, 0xb6e1fd72, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11287.a7", 0x08000, 0xe8cccd42, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11288.a8", 0x08000, 0xc8df8460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11289.a9", 0x08000, 0xe5a4cf30, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0049.key", 0x02000, 0x8fac824f, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Shinobi2) -STD_ROM_FN(Shinobi2) - -static struct BurnRomInfo Shinobi2dRomDesc[] = { - { "bootleg_epr-11282.a4", 0x10000, 0xb930399d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11280.a1", 0x10000, 0x343f4c46, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11283.a5", 0x10000, 0x9d46e707, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11281.a2", 0x10000, 0x7961d07e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11284.b9", 0x10000, 0x5f62e163, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11285.b10", 0x10000, 0x75f8fbc9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11286.b11", 0x10000, 0x06508bb9, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11290.b1", 0x10000, 0x611f413a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11294.b5", 0x10000, 0x5eb00fc1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11291.b2", 0x10000, 0x3c0797c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11295.b6", 0x10000, 0x25307ef8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11292.b3", 0x10000, 0xc29ac34e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11296.b7", 0x10000, 0x04a437f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11293.b4", 0x10000, 0x41f41063, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11297.b8", 0x10000, 0xb6e1fd72, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11287.a7", 0x08000, 0xe8cccd42, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11288.a8", 0x08000, 0xc8df8460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11289.a9", 0x08000, 0xe5a4cf30, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shinobi2d) -STD_ROM_FN(Shinobi2d) - -static struct BurnRomInfo Shinobi3RomDesc[] = { - { "epr-11299.a4", 0x10000, 0xb930399d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11298.a1", 0x10000, 0x343f4c46, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11283.a5", 0x10000, 0x9d46e707, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11281.a2", 0x10000, 0x7961d07e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11284.b9", 0x10000, 0x5f62e163, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11285.b10", 0x10000, 0x75f8fbc9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11286.b11", 0x10000, 0x06508bb9, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11290.b1", 0x10000, 0x611f413a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11294.b5", 0x10000, 0x5eb00fc1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11291.b2", 0x10000, 0x3c0797c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11295.b6", 0x10000, 0x25307ef8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11292.b3", 0x10000, 0xc29ac34e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11296.b7", 0x10000, 0x04a437f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11293.b4", 0x10000, 0x41f41063, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11297.b8", 0x10000, 0xb6e1fd72, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11372.a7", 0x08000, 0x0824269a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11288.a8", 0x08000, 0xc8df8460, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11289.a9", 0x08000, 0xe5a4cf30, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0054.key", 0x02000, 0x39fd4535, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Shinobi3) -STD_ROM_FN(Shinobi3) - -static struct BurnRomInfo Shinobi4RomDesc[] = { - { "epr-11360.a7", 0x20000, 0xb1f67ab9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11359.a5", 0x20000, 0x0f0306e1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11363.a14", 0x20000, 0x40914168, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11364.a15", 0x20000, 0xe63649a4, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11365.a16", 0x20000, 0x1ef55d20, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11366.b1", 0x20000, 0x319ede73, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11368.b5", 0x20000, 0x0377d7ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11367.b2", 0x20000, 0x1d06c5c7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11369.b6", 0x20000, 0xd751d2a2, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11377.a10", 0x08000, 0x0fb6af34, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11362.a11", 0x20000, 0x256af749, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0054.key", 0x02000, 0x39fd4535, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Shinobi4) -STD_ROM_FN(Shinobi4) - -static struct BurnRomInfo Shinobi5RomDesc[] = { - { "epr-11360.a7", 0x20000, 0xb1f67ab9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11359.a5", 0x20000, 0x0f0306e1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11363.a14", 0x20000, 0x40914168, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11364.a15", 0x20000, 0xe63649a4, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11365.a16", 0x20000, 0x1ef55d20, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11366.b1", 0x20000, 0x319ede73, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11368.b5", 0x20000, 0x0377d7ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11367.b2", 0x20000, 0x1d06c5c7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11369.b6", 0x20000, 0xd751d2a2, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11361.a10", 0x08000, 0x1f47ebcb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11362.a11", 0x20000, 0x256af749, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shinobi5) -STD_ROM_FN(Shinobi5) - -static struct BurnRomInfo SjryukoRomDesc[] = { - { "epr-12256.a4", 0x08000, 0x5987ee1b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12253.a1", 0x08000, 0x26a822df, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12257.a5", 0x08000, 0x3a2acc3f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12254.a2", 0x08000, 0x7e908217, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12224-95.b9", 0x08000, 0xeac17ba1, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12225-94.b10", 0x08000, 0x2310fc98, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12226-93.b11", 0x08000, 0x210e6999, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12232-10.b1", 0x10000, 0x0adec62b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12236-11.b5", 0x10000, 0x286b9af8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12233-17.b2", 0x10000, 0x3e45969c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12237-18.b6", 0x10000, 0xe5058e96, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12234-23.b3", 0x10000, 0x8c8d54ef, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12238-24.b7", 0x10000, 0x7ada3304, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12235-29.b4", 0x10000, 0xfa45d511, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12239-30.b8", 0x10000, 0x91f70c8b, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12244.a7", 0x08000, 0xcb2a47e5, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12245.a8", 0x08000, 0x66164134, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-12246.a9", 0x08000, 0xf1242582, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-12247.a10", 0x08000, 0xef8a64c6, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-12248.a11", 0x08000, 0xd1eabdab, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-5021.key", 0x02000, 0xc3e32937, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sjryuko) -STD_ROM_FN(Sjryuko) - -static struct BurnRomInfo SnapperRomDesc[] = { - { "snap2.r01", 0x10000, 0x9a9e4ed3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "snap1.r02", 0x10000, 0xcd468d6a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "snap4.r03", 0x08000, 0x0f848e1e, SYS16_ROM_TILES | BRF_GRA }, - { "snap3.r04", 0x08000, 0xc7f8cf0e, SYS16_ROM_TILES | BRF_GRA }, - { "snap5.r05", 0x08000, 0x378e08eb, SYS16_ROM_TILES | BRF_GRA }, -}; - - -STD_ROM_PICK(Snapper) -STD_ROM_FN(Snapper) - -static struct BurnRomInfo SonicbomRomDesc[] = { - { "epr-11342.a4", 0x10000, 0x454693f1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11340.a1", 0x10000, 0x03ba3fed, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11343.a5", 0x10000, 0xedfeb7d4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11341.a2", 0x10000, 0x0338f771, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11344.b9", 0x10000, 0x59a9f940, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11345.b10", 0x10000, 0xb44c068b, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11346.b11", 0x10000, 0xe5ada66c, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-11350.b1", 0x10000, 0x525ba1df, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11354.b5", 0x10000, 0x793fa3ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11351.b2", 0x10000, 0x63b1f1ca, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11355.b6", 0x10000, 0xfe0fa332, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11352.b3", 0x10000, 0x047fa4b0, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11356.b7", 0x10000, 0xaea3c39d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11353.b4", 0x10000, 0x4e0791f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11357.b8", 0x10000, 0xa7c5ea41, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11347.a7", 0x08000, 0xb41f0ced, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11348.a8", 0x08000, 0x89924588, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11349.a9", 0x08000, 0x8e4b6204, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0053.key", 0x02000, 0x91c80c88, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Sonicbom) -STD_ROM_FN(Sonicbom) - -static struct BurnRomInfo SonicbomdRomDesc[] = { - { "bootleg_epr-11342.a4", 0x10000, 0x089158ef, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11340.a1", 0x10000, 0x253cbd27, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11343.a5", 0x10000, 0xedfeb7d4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11341.a2", 0x10000, 0x0338f771, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-11344.b9", 0x10000, 0x59a9f940, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11345.b10", 0x10000, 0xb44c068b, SYS16_ROM_TILES | BRF_GRA }, - { "opr-11346.b11", 0x10000, 0xe5ada66c, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-11350.b1", 0x10000, 0x525ba1df, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11354.b5", 0x10000, 0x793fa3ac, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11351.b2", 0x10000, 0x63b1f1ca, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11355.b6", 0x10000, 0xfe0fa332, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11352.b3", 0x10000, 0x047fa4b0, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11356.b7", 0x10000, 0xaea3c39d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11353.b4", 0x10000, 0x4e0791f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-11357.b8", 0x10000, 0xa7c5ea41, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11347.a7", 0x08000, 0xb41f0ced, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11348.a8", 0x08000, 0x89924588, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11349.a9", 0x08000, 0x8e4b6204, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Sonicbomd) -STD_ROM_FN(Sonicbomd) - -static struct BurnRomInfo SuprleagRomDesc[] = { - { "epr-11133.a4", 0x10000, 0xeed72f37, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11130.a1", 0x10000, 0xe2451676, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11134.a5", 0x10000, 0xccd857f5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11131.a2", 0x10000, 0x9b78c2cc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11135.a6", 0x10000, 0x3735e0e1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11132.a3", 0x10000, 0xff199325, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11136.b9", 0x10000, 0xc3860ce4, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11137.b10", 0x10000, 0x92d96187, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11138.b11", 0x10000, 0xc01dc773, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11144.b1", 0x10000, 0xb31de51c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11148.b5", 0x10000, 0x126e1309, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11145.b2", 0x10000, 0x4223d2c3, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11149.b6", 0x10000, 0x694d3765, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11146.b3", 0x10000, 0xbf0359b6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11150.b7", 0x10000, 0x9fc0aded, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11147.b4", 0x10000, 0x3e592772, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11151.b8", 0x10000, 0x9de95169, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11139.a7", 0x08000, 0x9cbd99da, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11140.a8", 0x08000, 0xb297371b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11141.a9", 0x08000, 0x19756aa6, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11142.a10", 0x08000, 0x25d26c66, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-11143.a11", 0x08000, 0x848b7b77, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0045.key", 0x02000, 0x0594cc2e, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Suprleag) -STD_ROM_FN(Suprleag) - -static struct BurnRomInfo Tetris1RomDesc[] = { - { "epr-12164.a4", 0x08000, 0xb329cd6f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12163.a1", 0x08000, 0xd372d3f3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12165.b9", 0x10000, 0x62640221, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12166.b10", 0x10000, 0x9abd183b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12167.b11", 0x10000, 0x2495fd4e, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12169.b1", 0x08000, 0xdacc6165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12170.b5", 0x08000, 0x87354e42, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12168.a7", 0x08000, 0xbd9ba01b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0091.key", 0x02000, 0xa7937661, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Tetris1) -STD_ROM_FN(Tetris1) - -static struct BurnRomInfo Tetris1dRomDesc[] = { - { "bootleg_epr-12164.a4", 0x08000, 0x39469b3d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12163.a1", 0x08000, 0x451ea7a1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12165.b9", 0x10000, 0x62640221, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12166.b10", 0x10000, 0x9abd183b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12167.b11", 0x10000, 0x2495fd4e, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12169.b1", 0x08000, 0xdacc6165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12170.b5", 0x08000, 0x87354e42, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12168.a7", 0x08000, 0xbd9ba01b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Tetris1d) -STD_ROM_FN(Tetris1d) - -static struct BurnRomInfo Tetris2RomDesc[] = { - { "epr-12193.a7", 0x20000, 0x44466ed4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12192.a5", 0x20000, 0xa1c8af00, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12165.b9", 0x10000, 0x62640221, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12166.b10", 0x10000, 0x9abd183b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12167.b11", 0x10000, 0x2495fd4e, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12194.b1", 0x10000, 0x2fb38880, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12195.b5", 0x10000, 0xd6a02cba, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12168.a7", 0x08000, 0xbd9ba01b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0092.key", 0x02000, 0xd10e1ad9, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Tetris2) -STD_ROM_FN(Tetris2) - -static struct BurnRomInfo Tetris2dRomDesc[] = { - { "bootleg_epr-12193.a7", 0x10000, 0xe8c59f9d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12192.a5", 0x10000, 0x8ff44f5f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12165.b9", 0x10000, 0x62640221, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12166.b10", 0x10000, 0x9abd183b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12167.b11", 0x10000, 0x2495fd4e, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12194.b1", 0x10000, 0x2fb38880, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12195.b5", 0x10000, 0xd6a02cba, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12168.a7", 0x08000, 0xbd9ba01b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Tetris2d) -STD_ROM_FN(Tetris2d) - -static struct BurnRomInfo TetrisblRomDesc[] = { - { "rom2.bin", 0x10000, 0x4d165c38, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "rom1.bin", 0x10000, 0x1e912131, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr12165.b9", 0x10000, 0x62640221, SYS16_ROM_TILES | BRF_GRA }, - { "epr12166.b10", 0x10000, 0x9abd183b, SYS16_ROM_TILES | BRF_GRA }, - { "epr12167.b11", 0x10000, 0x2495fd4e, SYS16_ROM_TILES | BRF_GRA }, - - { "obj0-o.rom", 0x10000, 0x2fb38880, SYS16_ROM_SPRITES | BRF_GRA }, - { "obj0-e.rom", 0x10000, 0xd6a02cba, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr12168.a7", 0x08000, 0xbd9ba01b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Tetrisbl) -STD_ROM_FN(Tetrisbl) - -static struct BurnRomInfo TimescanRomDesc[] = { - { "epr-10853.a4", 0x08000, 0x24d7c5fb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10850.a1", 0x08000, 0xf1575732, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10854.a5", 0x08000, 0x82d0b237, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10851.a2", 0x08000, 0xf5ce271b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10855.a6", 0x08000, 0x63e95a53, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10852.a3", 0x08000, 0x7cd1382b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10543.b9", 0x08000, 0x07dccc37, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10544.b10", 0x08000, 0x84fb9a3a, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10545.b11", 0x08000, 0xc8694bc0, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-10548.b1", 0x08000, 0xaa150735, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10552.b5", 0x08000, 0x6fcbb9f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10549.b2", 0x08000, 0x2f59f067, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10553.b6", 0x08000, 0x8a220a9f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10550.b3", 0x08000, 0xf05069ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10554.b7", 0x08000, 0xdc64f809, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10551.b4", 0x08000, 0x435d811f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10555.b8", 0x08000, 0x2143c471, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10562.a7", 0x08000, 0x3f5028bf, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-10563.a8", 0x08000, 0x9db7eddf, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Timescan) -STD_ROM_FN(Timescan) - -static struct BurnRomInfo ToryumonRomDesc[] = { - { "epr-17689.a2", 0x20000, 0x4f0dee19, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-17688.a1", 0x20000, 0x717d81c7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-17700.b11", 0x40000, 0x8f288b37, SYS16_ROM_TILES | BRF_GRA }, - { "epr-17701.b12", 0x40000, 0x6dfb025b, SYS16_ROM_TILES | BRF_GRA }, - { "epr-17702.b13", 0x40000, 0xae0b7eab, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-17692.b1", 0x20000, 0x543c4327, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-17695.b4", 0x20000, 0xee60f244, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-17693.b2", 0x20000, 0x4a350b3e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-17696.b5", 0x20000, 0x6edb54f1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-17694.b3", 0x20000, 0xb296d71d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-17697.b6", 0x20000, 0x6ccb7b28, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-17698.b7", 0x20000, 0xcd4dfb82, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-17699.b8", 0x20000, 0x2694ecce, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-17691.a13", 0x08000, 0x14205388, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-17690.a11", 0x40000, 0x4f9ba4e4, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Toryumon) -STD_ROM_FN(Toryumon) - -static struct BurnRomInfo TturfRomDesc[] = { - { "epr-12327.a7", 0x20000, 0x0376c593, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12326.a5", 0x20000, 0xf998862b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12268.a14", 0x10000, 0xe0dac07f, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12269.a15", 0x10000, 0x457a8790, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12270.a16", 0x10000, 0x69fc025b, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12279.b1", 0x10000, 0x7a169fb1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12283.b5", 0x10000, 0xae0fa085, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12278.b2", 0x10000, 0x961d06b7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12282.b6", 0x10000, 0xe8671ee1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12277.b3", 0x10000, 0xf16b6ba2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12281.b7", 0x10000, 0x1ef1077f, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12276.b4", 0x10000, 0x838bd71f, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12280.b8", 0x10000, 0x639a57cb, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12328.a10", 0x08000, 0x13a346de, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-12329.a11", 0x10000, 0xed9a686d, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "opr-12330.a12", 0x10000, 0xfb762bca, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0104.c2", 0x01000, 0x00000000, BRF_NODUMP }, // Intel i8751 protection MCU -}; - - -STD_ROM_PICK(Tturf) -STD_ROM_FN(Tturf) - -static struct BurnRomInfo TturfuRomDesc[] = { - { "epr-12266.a1", 0x10000, 0xf549def8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12264.a4", 0x10000, 0xf7cdb289, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12267.a2", 0x10000, 0x3c3ce191, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12265.a5", 0x10000, 0x8cdadd9a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12268.a14", 0x10000, 0xe0dac07f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12269.a15", 0x10000, 0x457a8790, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12270.a16", 0x10000, 0x69fc025b, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12276.b4", 0x10000, 0x838bd71f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12280.b8", 0x10000, 0x639a57cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12277.b3", 0x10000, 0xf16b6ba2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12281.b7", 0x10000, 0x1ef1077f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12278.b2", 0x10000, 0x961d06b7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12282.b6", 0x10000, 0xe8671ee1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12279.b1", 0x10000, 0x7a169fb1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12283.b5", 0x10000, 0xae0fa085, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12271.a7", 0x08000, 0x99671e52, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12272.a8", 0x08000, 0x7cf7e69f, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-12273.a9", 0x08000, 0x28f0bb8b, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-12274.a10", 0x08000, 0x8207f0c4, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "epr-12275.a11", 0x08000, 0x182f3c3d, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0099.c2", 0x01000, 0xf676e3e4, BRF_OPT }, // Intel i8751 protection MCU -}; - - -STD_ROM_PICK(Tturfu) -STD_ROM_FN(Tturfu) - -static struct BurnRomInfo Wb3RomDesc[] = { - { "epr-12259.a7", 0x20000, 0x54927c7e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12258.a5", 0x20000, 0x01f5898c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12124.a14", 0x10000, 0xdacefb6f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12125.a15", 0x10000, 0x9fc36df7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12126.a16", 0x10000, 0xa693fd94, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12127.a10", 0x08000, 0x0bb901bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0098.c2", 0x01000, 0x00000000, BRF_NODUMP }, // Intel i8751 protection MCU -}; - - -STD_ROM_PICK(Wb3) -STD_ROM_FN(Wb3) - -static struct BurnRomInfo Wb32RomDesc[] = { - { "epr-12100.a4", 0x10000, 0xf5ca4abc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12098.a1", 0x10000, 0xd998e5e5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12101.a5", 0x10000, 0x6146492b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12099.a2", 0x10000, 0x3e243b45, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12124.b9", 0x10000, 0xdacefb6f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12125.b10", 0x10000, 0x9fc36df7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12126.b11", 0x10000, 0xa693fd94, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12127.a7", 0x08000, 0x0bb901bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0085.key", 0x02000, 0x8150f38d, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb32) -STD_ROM_FN(Wb32) - -static struct BurnRomInfo Wb32dRomDesc[] = { - { "bootleg_epr-12100.a4", 0x10000, 0x15e3117e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12098.a1", 0x10000, 0x41a46e75, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12101.a5", 0x10000, 0x6146492b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12099.a2", 0x10000, 0x3e243b45, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12124.b9", 0x10000, 0xdacefb6f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12125.b10", 0x10000, 0x9fc36df7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12126.b11", 0x10000, 0xa693fd94, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12127.a7", 0x08000, 0x0bb901bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb32d) -STD_ROM_FN(Wb32d) - -static struct BurnRomInfo Wb33RomDesc[] = { - { "epr-12137.a7", 0x20000, 0x6f81238e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12136.a5", 0x20000, 0x4cf05003, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12124.a14", 0x10000, 0xdacefb6f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12125.a15", 0x10000, 0x9fc36df7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12126.a16", 0x10000, 0xa693fd94, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12127.a10", 0x08000, 0x0bb901bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0089.key", 0x02000, 0x597d30d3, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb33) -STD_ROM_FN(Wb33) - -static struct BurnRomInfo Wb33dRomDesc[] = { - { "bootleg_epr-12137.a7", 0x20000, 0x18a898af, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12136.a5", 0x20000, 0xe3d21248, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12124.a14", 0x10000, 0xdacefb6f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12125.a15", 0x10000, 0x9fc36df7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12126.a16", 0x10000, 0xa693fd94, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12127.a10", 0x08000, 0x0bb901bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb33d) -STD_ROM_FN(Wb33d) - -static struct BurnRomInfo Wb34RomDesc[] = { - { "epr-12131.a7", 0x20000, 0xb95ecf88, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12128.a5", 0x20000, 0xb711372b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12124.a14", 0x10000, 0xdacefb6f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12125.a15", 0x10000, 0x9fc36df7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12126.a16", 0x10000, 0xa693fd94, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12127.a10", 0x08000, 0x0bb901bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0087.key", 0x02000, 0x162cb531, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb34) -STD_ROM_FN(Wb34) - -static struct BurnRomInfo Wb34dRomDesc[] = { - { "bootleg_epr-12131.a7", 0x20000, 0x64e864b1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12128.a5", 0x20000, 0x1b0fdaec, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12124.a14", 0x10000, 0xdacefb6f, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12125.a15", 0x10000, 0x9fc36df7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12126.a16", 0x10000, 0xa693fd94, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12127.a10", 0x08000, 0x0bb901bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb34d) -STD_ROM_FN(Wb34d) - -static struct BurnRomInfo Wb3bblRomDesc[] = { - { "wb3_03", 0x10000, 0x0019ab3b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "wb3_05", 0x10000, 0x196e17ee, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "wb3_02", 0x10000, 0xc87350cb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "wb3_04", 0x10000, 0x565d5035, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "wb3_14", 0x10000, 0xd3f20bca, SYS16_ROM_TILES | BRF_GRA }, - { "wb3_15", 0x10000, 0x96ff9d52, SYS16_ROM_TILES | BRF_GRA }, - { "wb3_16", 0x10000, 0xafaf0d31, SYS16_ROM_TILES | BRF_GRA }, - - { "epr12090.b1", 0x10000, 0xaeeecfca, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr12094.b5", 0x10000, 0x615e4927, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr12091.b2", 0x10000, 0x8409a243, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr12095.b6", 0x10000, 0xe774ec2c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr12092.b3", 0x10000, 0x5c2f0d90, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr12096.b7", 0x10000, 0x0cd59d6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr12093.b4", 0x10000, 0x4891e7bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr12097.b8", 0x10000, 0xe645902c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr12127.a10", 0x08000, 0x0bb901bb, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wb3bbl) -STD_ROM_FN(Wb3bbl) - -static struct BurnRomInfo WrestwarRomDesc[] = { - { "epr-12372.a7", 0x20000, 0xeeaba126, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12371.a5", 0x20000, 0x6714600a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12146.a8", 0x20000, 0xb77ba665, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12144.a6", 0x20000, 0xddf075cb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12150.a14", 0x20000, 0x6a821ab9, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12151.a15", 0x20000, 0x2b1a0751, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12152.a16", 0x20000, 0xf6e190fe, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12153.b1", 0x20000, 0xffa7d368, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12157.b5", 0x20000, 0x8d7794c1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12154.b2", 0x20000, 0x0ed343f2, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12158.b6", 0x20000, 0x99458d58, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12155.b3", 0x20000, 0x3087104d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12159.b7", 0x20000, 0xabcf9bed, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12156.b4", 0x20000, 0x41b6068b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12160.b8", 0x20000, 0x97eac164, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12141.a1", 0x20000, 0x260311c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12161.b10", 0x20000, 0x35a4b1b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12142.a2", 0x10000, 0x12e38a5c, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12162.b11", 0x10000, 0xfa06fd24, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12147.a10", 0x08000, 0xc3609607, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12148.a11", 0x20000, 0xfb9a7f29, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12149.a12", 0x20000, 0xd6617b19, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0103.c2", 0x01000, 0xaa0710f5, BRF_OPT } // Intel i8751 protection MCU -}; - - -STD_ROM_PICK(Wrestwar) -STD_ROM_FN(Wrestwar) - -static struct BurnRomInfo Wrestwar1RomDesc[] = { - { "epr-12145.a7", 0x20000, 0x2af51e2e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12143.a5", 0x20000, 0x4131e345, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12146.a8", 0x20000, 0xb77ba665, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12144.a6", 0x20000, 0xddf075cb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12150.a14", 0x20000, 0x6a821ab9, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12151.a15", 0x20000, 0x2b1a0751, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12152.a16", 0x20000, 0xf6e190fe, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12153.b1", 0x20000, 0xffa7d368, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12157.b5", 0x20000, 0x8d7794c1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12154.b2", 0x20000, 0x0ed343f2, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12158.b6", 0x20000, 0x99458d58, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12155.b3", 0x20000, 0x3087104d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12159.b7", 0x20000, 0xabcf9bed, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12156.b4", 0x20000, 0x41b6068b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12160.b8", 0x20000, 0x97eac164, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12141.a1", 0x20000, 0x260311c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12161.b10", 0x20000, 0x35a4b1b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12142.a2", 0x10000, 0x12e38a5c, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12162.b11", 0x10000, 0xfa06fd24, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12147.a10", 0x08000, 0xc3609607, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12148.a11", 0x20000, 0xfb9a7f29, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12149.a12", 0x20000, 0xd6617b19, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0090.key", 0x02000, 0xb7c24c4a, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wrestwar1) -STD_ROM_FN(Wrestwar1) - -static struct BurnRomInfo Wrestwar1dRomDesc[] = { - { "bootleg_epr-12145.a7", 0x20000, 0x6a50d373, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12143.a5", 0x20000, 0x02e24543, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12146.a8", 0x20000, 0xb77ba665, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12144.a6", 0x20000, 0xddf075cb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12150.a14", 0x20000, 0x6a821ab9, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12151.a15", 0x20000, 0x2b1a0751, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12152.a16", 0x20000, 0xf6e190fe, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12153.b1", 0x20000, 0xffa7d368, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12157.b5", 0x20000, 0x8d7794c1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12154.b2", 0x20000, 0x0ed343f2, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12158.b6", 0x20000, 0x99458d58, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12155.b3", 0x20000, 0x3087104d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12159.b7", 0x20000, 0xabcf9bed, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12156.b4", 0x20000, 0x41b6068b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12160.b8", 0x20000, 0x97eac164, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12141.a1", 0x20000, 0x260311c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12161.b10", 0x20000, 0x35a4b1b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12142.a2", 0x10000, 0x12e38a5c, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12162.b11", 0x10000, 0xfa06fd24, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12147.a10", 0x08000, 0xc3609607, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12148.a11", 0x20000, 0xfb9a7f29, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12149.a12", 0x20000, 0xd6617b19, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Wrestwar1d) -STD_ROM_FN(Wrestwar1d) - -static struct BurnRomInfo Wrestwar2RomDesc[] = { - { "epr-12370.a7", 0x20000, 0xcb5dbb76, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12369.a5", 0x20000, 0x6f47dd2f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12146.a8", 0x20000, 0xb77ba665, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12144.a6", 0x20000, 0xddf075cb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12150.a14", 0x20000, 0x6a821ab9, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12151.a15", 0x20000, 0x2b1a0751, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12152.a16", 0x20000, 0xf6e190fe, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12153.b1", 0x20000, 0xffa7d368, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12157.b5", 0x20000, 0x8d7794c1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12154.b2", 0x20000, 0x0ed343f2, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12158.b6", 0x20000, 0x99458d58, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12155.b3", 0x20000, 0x3087104d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12159.b7", 0x20000, 0xabcf9bed, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12156.b4", 0x20000, 0x41b6068b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12160.b8", 0x20000, 0x97eac164, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12141.a1", 0x20000, 0x260311c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12161.b10", 0x20000, 0x35a4b1b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12142.a2", 0x10000, 0x12e38a5c, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12162.b11", 0x10000, 0xfa06fd24, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12147.a10", 0x08000, 0xc3609607, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12148.a11", 0x20000, 0xfb9a7f29, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12149.a12", 0x20000, 0xd6617b19, SYS16_ROM_UPD7759DATA | BRF_SND }, - - { "317-0102.key", 0x02000, 0x28ba1bf0, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Wrestwar2) -STD_ROM_FN(Wrestwar2) - -static struct BurnRomInfo Wrestwar2dRomDesc[] = { - { "bootleg_epr-12370.a7", 0x20000, 0xf4d09243, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12369.a5", 0x20000, 0xd5f5e59a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12146.a8", 0x20000, 0xb77ba665, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12144.a6", 0x20000, 0xddf075cb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12150.a14", 0x20000, 0x6a821ab9, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12151.a15", 0x20000, 0x2b1a0751, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12152.a16", 0x20000, 0xf6e190fe, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12153.b1", 0x20000, 0xffa7d368, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12157.b5", 0x20000, 0x8d7794c1, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12154.b2", 0x20000, 0x0ed343f2, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12158.b6", 0x20000, 0x99458d58, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12155.b3", 0x20000, 0x3087104d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12159.b7", 0x20000, 0xabcf9bed, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12156.b4", 0x20000, 0x41b6068b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12160.b8", 0x20000, 0x97eac164, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12141.a1", 0x20000, 0x260311c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12161.b10", 0x20000, 0x35a4b1b1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12142.a2", 0x10000, 0x12e38a5c, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12162.b11", 0x10000, 0xfa06fd24, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12147.a10", 0x08000, 0xc3609607, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12148.a11", 0x20000, 0xfb9a7f29, SYS16_ROM_UPD7759DATA | BRF_SND }, - { "mpr-12149.a12", 0x20000, 0xd6617b19, SYS16_ROM_UPD7759DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Wrestwar2d) -STD_ROM_FN(Wrestwar2d) - -/*==================================================== -Bootleg Z80 Handling -====================================================*/ - -UINT8 __fastcall BootlegZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x01: { - return BurnYM2151ReadStatus(); - } - - case 0x40: - case 0xc0: { - return System16SoundLatch; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read Port -> %02X\n"), a); -#endif - - return 0; -} - -void __fastcall BootlegZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - d &= 0xff; - - switch (a) { - case 0x00: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x01: { - BurnYM2151WriteRegister(d); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Write Port -> %02X, %02X\n"), a, d); -#endif -} - -UINT8 __fastcall BootlegZ80Read(UINT16 a) -{ - switch (a) { - case 0xe000: - case 0xe800: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return System16SoundLatch; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read -> %04X\n"), a); -#endif - - return 0; -} - -#if 0 && defined FBA_DEBUG -void __fastcall BootlegZ80Write(UINT16 a, UINT8 d) -{ - - bprintf(PRINT_NORMAL, _T("Z80 Write -> %04X, %02X\n"), a, d); -} -#endif - -void BootlegMapZ80() -{ - ZetMapArea(0x0000, 0x7fff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0x7fff, 2, System16Z80Rom); - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram); - - ZetSetReadHandler(BootlegZ80Read); -#if 0 && defined FBA_DEBUG - ZetSetWriteHandler(BootlegZ80Write); -#endif - ZetSetInHandler(BootlegZ80PortRead); - ZetSetOutHandler(BootlegZ80PortWrite); -} - -/*==================================================== -Memory Handlers - used by games not using the mapper -====================================================*/ - -static UINT8 __fastcall System16BReadByte(UINT32 a) -{ - switch (a) { - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - return 0xff - System16Input[1]; - } - - case 0xc41005: { - return System16Dip[2]; - } - - case 0xc41007: { - return 0xff - System16Input[2]; - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -static void __fastcall System16BWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16BTileByteWrite((a - 0x400000) ^ 1, d); - return; - } - - switch (a) { - case 0xc40001: { - System16VideoEnable = d & 0x20; - System16ScreenFlip = d & 0x40; - return; - } - - case 0xfe0007: { - System16SoundLatch = d; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -static void __fastcall System16BWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16BTileWordWrite(a - 0x400000, d); - return; - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -static INT16 AceattacTrack1X = 0; -static INT16 AceattacTrack1Y = 0; -static INT16 AceattacTrack2X = 0; -static INT16 AceattacTrack2Y = 0; -static INT8 AceattacDial1 = 0; -static INT8 AceattacDial2 = 0; - -static void AceattacMakeAnalogInputs() -{ - if (System16InputPort3[0]) AceattacTrack1X += 0x40; - if (System16InputPort3[1]) AceattacTrack1X -= 0x40; - if (AceattacTrack1X >= 0x100) AceattacTrack1X = 0; - if (AceattacTrack1X < 0) AceattacTrack1X = 0xfd; - - if (System16InputPort3[2]) AceattacTrack1Y -= 0x40; - if (System16InputPort3[3]) AceattacTrack1Y += 0x40; - if (AceattacTrack1Y >= 0x100) AceattacTrack1Y = 0; - if (AceattacTrack1Y < 0) AceattacTrack1Y = 0xfd; - - if (System16InputPort4[0]) AceattacDial1 += 0x01; - if (System16InputPort4[1]) AceattacDial1 -= 0x01; - if (AceattacDial1 >= 0x10) AceattacDial1 = 0; - if (AceattacDial1 < 0) AceattacDial1 = 0x0f; - - if (System16InputPort3[4]) AceattacTrack2X += 0x40; - if (System16InputPort3[5]) AceattacTrack2X -= 0x40; - if (AceattacTrack2X >= 0x100) AceattacTrack2X = 0; - if (AceattacTrack2X < 0) AceattacTrack2X = 0xfd; - - if (System16InputPort3[6]) AceattacTrack2Y -= 0x40; - if (System16InputPort3[7]) AceattacTrack2Y += 0x40; - if (AceattacTrack2Y >= 0x100) AceattacTrack2Y = 0; - if (AceattacTrack2Y < 0) AceattacTrack2Y = 0xfd; - - if (System16InputPort4[2]) AceattacDial2 += 0x01; - if (System16InputPort4[3]) AceattacDial2 -= 0x01; - if (AceattacDial2 >= 0x10) AceattacDial2 = 0; - if (AceattacDial2 < 0) AceattacDial2 = 0x0f; -} - -static UINT8 AceattacReadIO(UINT32 offset) -{ - switch (offset) { - case 0x0800: { - return 0xff - System16Input[0]; - } - - case 0x0802: { - return AceattacDial1 | (AceattacDial2 << 4); - } - - case 0x1000: { - return System16Dip[0]; - } - - case 0x1001: { - return System16Dip[1]; - } - - case 0x1800: { - return AceattacTrack1X & 0xff; - } - - case 0x1801: { - return ((AceattacTrack1X >> 8) & 0x0f) | (System16Input[2] & 0xf0); - } - - case 0x1802: { - return AceattacTrack1Y & 0xff; - } - - case 0x1803: { - return ((AceattacTrack1Y >> 8) & 0x0f); - } - - case 0x1808: { - return AceattacTrack2X & 0xff; - } - - case 0x1809: { - return ((AceattacTrack2X >> 8) & 0x0f) | (System16Input[6] & 0xf0); - } - - case 0x180a: { - return AceattacTrack2Y & 0xff; - } - - case 0x180b: { - return ((AceattacTrack2Y >> 8) & 0xff); - } - - case 0x1810: { - return 0xff - System16Input[1]; - } - - case 0x1811: { - return 0xff - System16Input[5]; - } - } - - return sega_315_5195_io_read(offset); -} - -static void __fastcall AltbeastblSoundWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xc42007: { - System16SoundLatch = d; - bprintf(PRINT_NORMAL, _T("Sound Latch Wrote %x\n"), d); -// ZetOpen(0); -// ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); -// ZetClose(); - return; - } - } -} - -static void __fastcall AltbeastblGfxWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x418000: { - System16ScrollY[0] = d + 1; - return; - } - - case 0x418008: { - System16ScrollX[0] = ((d ^ 0xffff) & 0x3ff) + 2; - return; - } - - case 0x418010: { - System16ScrollY[1] = d + 1; - return; - } - - case 0x418018: { - System16ScrollX[1] = ((d ^ 0xffff) & 0x3ff) + 4; - return; - } - - case 0x418020: { - BootlegBgPage[3] = (d >> 0) & 0xf; - BootlegFgPage[3] = (d >> 4) & 0xf; - return; - } - - case 0x418022: { - BootlegBgPage[2] = (d >> 0) & 0xf; - BootlegFgPage[2] = (d >> 4) & 0xf; - return; - } - - case 0x418024: { - BootlegBgPage[1] = (d >> 0) & 0xf; - BootlegFgPage[1] = (d >> 4) & 0xf; - return; - } - - case 0x418026: { - BootlegBgPage[0] = (d >> 0) & 0xf; - BootlegFgPage[0] = (d >> 4) & 0xf; - return; - } - } -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X, 0x%04X\n"), a, d, d ^ 0xffff); -#endif -} - -static void __fastcall DduxblGfxWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xc46021: { - BootlegFgPage[1] = d & 0xf; - BootlegBgPage[1] = (d >> 4) & 0xf; - return; - } - - case 0xc46023: { - BootlegFgPage[0] = d & 0xf; - BootlegBgPage[0] = (d >> 4) & 0xf; - return; - } - - case 0xc46025: { - BootlegFgPage[3] = d & 0xf; - BootlegBgPage[3] = (d >> 4) & 0xf; - return; - } - - case 0xc46027: { - BootlegFgPage[2] = d & 0xf; - BootlegBgPage[2] = (d >> 4) & 0xf; - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -static void __fastcall DduxblGfxWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xc46000: { - System16ScrollY[1] = d; - return; - } - - case 0xc46008: { - System16ScrollX[1] = (d ^ 0xffff) & 0x1ff; - return; - } - - case 0xc46010: { - System16ScrollY[0] = d; - return; - } - - case 0xc46018: { - System16ScrollX[0] = (d ^ 0xffff) & 0x1ff; - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -static void __fastcall DduxblWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x3f0001: { - if (System16TileBanks[0] != (d & 0x07)) { - System16TileBanks[0] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - - case 0x3f0003: { - if (System16TileBanks[1] != (d & 0x07)) { - System16TileBanks[1] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - - case 0xc40001: { - System16VideoEnable = d & 0x20; - System16ScreenFlip = d & 0x40; - return; - } - - case 0xc40007: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -static INT16 DunkshotTrack1X = 0; -static INT16 DunkshotTrack1Y = 0; -static INT16 DunkshotTrack2X = 0; -static INT16 DunkshotTrack2Y = 0; -static INT16 DunkshotTrack3X = 0; -static INT16 DunkshotTrack3Y = 0; -static INT16 DunkshotTrack4X = 0; -static INT16 DunkshotTrack4Y = 0; - -static void DunkshotMakeAnalogInputs() -{ - if (System16InputPort2[0]) DunkshotTrack1X += 0x40; - if (System16InputPort2[1]) DunkshotTrack1X -= 0x40; - if (DunkshotTrack1X >= 0x1000) DunkshotTrack1X = 0; - if (DunkshotTrack1X < 0) DunkshotTrack1X = 0xfc0; - - if (System16InputPort2[2]) DunkshotTrack1Y -= 0x40; - if (System16InputPort2[3]) DunkshotTrack1Y += 0x40; - if (DunkshotTrack1Y >= 0x1000) DunkshotTrack1Y = 0; - if (DunkshotTrack1Y < 0) DunkshotTrack1Y = 0xfc0; - - if (System16InputPort2[4]) DunkshotTrack2X += 0x40; - if (System16InputPort2[5]) DunkshotTrack2X -= 0x40; - if (DunkshotTrack2X >= 0x1000) DunkshotTrack2X = 0; - if (DunkshotTrack2X < 0) DunkshotTrack2X = 0xfc0; - - if (System16InputPort2[6]) DunkshotTrack2Y -= 0x40; - if (System16InputPort2[7]) DunkshotTrack2Y += 0x40; - if (DunkshotTrack2Y >= 0x1000) DunkshotTrack2Y = 0; - if (DunkshotTrack2Y < 0) DunkshotTrack2Y = 0xfc0; - - if (System16InputPort3[0]) DunkshotTrack3X += 0x40; - if (System16InputPort3[1]) DunkshotTrack3X -= 0x40; - if (DunkshotTrack3X >= 0x1000) DunkshotTrack3X = 0; - if (DunkshotTrack3X < 0) DunkshotTrack3X = 0xfc0; - - if (System16InputPort3[2]) DunkshotTrack3Y -= 0x40; - if (System16InputPort3[3]) DunkshotTrack3Y += 0x40; - if (DunkshotTrack3Y >= 0x1000) DunkshotTrack3Y = 0; - if (DunkshotTrack3Y < 0) DunkshotTrack3Y = 0xfc0; - - if (System16InputPort3[4]) DunkshotTrack4X += 0x40; - if (System16InputPort3[5]) DunkshotTrack4X -= 0x40; - if (DunkshotTrack4X >= 0x1000) DunkshotTrack4X = 0; - if (DunkshotTrack4X < 0) DunkshotTrack4X = 0xfc0; - - if (System16InputPort3[6]) DunkshotTrack4Y -= 0x40; - if (System16InputPort3[7]) DunkshotTrack4Y += 0x40; - if (DunkshotTrack4Y >= 0x1000) DunkshotTrack4Y = 0; - if (DunkshotTrack4Y < 0) DunkshotTrack4Y = 0xfc0; -} - -static UINT8 DunkshotReadIO(UINT32 offset) -{ - switch (offset & (0x3000 / 2)) { - case 0x3000 / 2: { - switch (offset & 0x0f) { - case 0x00: return DunkshotTrack1X & 0xff; - case 0x01: return DunkshotTrack1X >> 8; - case 0x02: return DunkshotTrack1Y & 0xff; - case 0x03: return DunkshotTrack1Y >> 8; - case 0x04: return DunkshotTrack2X & 0xff; - case 0x05: return DunkshotTrack2X >> 8; - case 0x06: return DunkshotTrack2Y & 0xff; - case 0x07: return DunkshotTrack2Y >> 8; - case 0x08: return DunkshotTrack3X & 0xff; - case 0x09: return DunkshotTrack3X >> 8; - case 0x0a: return DunkshotTrack3Y & 0xff; - case 0x0b: return DunkshotTrack3Y >> 8; - case 0x0c: return DunkshotTrack4X & 0xff; - case 0x0d: return DunkshotTrack4X >> 8; - case 0x0e: return DunkshotTrack4Y & 0xff; - case 0x0f: return DunkshotTrack4Y >> 8; - } - break; - } - } - - return sega_315_5195_io_read(offset); -} - -static void __fastcall EswatblBankWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x3e2001: { - if (System16TileBanks[0] != (d & 0x07)) { - System16TileBanks[0] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - - case 0x3e2003: { - if (System16TileBanks[1] != (d & 0x07)) { - System16TileBanks[1] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - } -} - -static void __fastcall EswatblSoundWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xc42007: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - } -} - -static void __fastcall EswatblGfxWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x418031: { - System16TileBanks[1] = d & 7; - return; - } - } -} - -static void __fastcall EswatblGfxWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x418000: { - System16ScrollY[0] = d; - return; - } - - case 0x418008: { - System16ScrollX[0] = (d ^ 0xffff); - return; - } - - case 0x418010: { - System16ScrollY[1] = d; - return; - } - - case 0x418018: { - System16ScrollX[1] = (d ^ 0xffff); - return; - } - - case 0x418020: { - BootlegFgPage[3] = (d >> 12) & 0xf; - BootlegFgPage[2] = (d >> 8) & 0xf; - BootlegFgPage[1] = (d >> 4) & 0xf; - BootlegFgPage[0] = (d >> 0) & 0xf; - return; - } - - case 0x418028: { - BootlegBgPage[3] = (d >> 12) & 0xf; - BootlegBgPage[2] = (d >> 8) & 0xf; - BootlegBgPage[1] = (d >> 4) & 0xf; - BootlegBgPage[0] = (d >> 0) & 0xf; - return; - } - } -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -static INT16 ExctleagTrack1X = 0; -static INT16 ExctleagTrack1Y = 0; -static INT16 ExctleagTrack2X = 0; -static INT16 ExctleagTrack2Y = 0; - -static void ExctleagMakeAnalogInputs() -{ - if (System16InputPort4[0]) ExctleagTrack1X += 0x1; - if (System16InputPort4[1]) ExctleagTrack1X -= 0x1; - if (ExctleagTrack1X >= 0x100) ExctleagTrack1X = 0; - if (ExctleagTrack1X < 0) ExctleagTrack1X = 0xff; - - if (System16InputPort4[2]) ExctleagTrack1Y -= 0x1; - if (System16InputPort4[3]) ExctleagTrack1Y += 0x1; - if (ExctleagTrack1Y >= 0x100) ExctleagTrack1Y = 0; - if (ExctleagTrack1Y < 0) ExctleagTrack1Y = 0xff; - - if (System16InputPort4[4]) ExctleagTrack2X += 0x4; - if (System16InputPort4[5]) ExctleagTrack2X -= 0x4; - if (ExctleagTrack2X >= 0x100) ExctleagTrack2X = 0; - if (ExctleagTrack2X < 0) ExctleagTrack2X = 0xfc; - - if (System16InputPort4[6]) ExctleagTrack2Y -= 0x4; - if (System16InputPort4[7]) ExctleagTrack2Y += 0x4; - if (ExctleagTrack2Y >= 0x100) ExctleagTrack2Y = 0; - if (ExctleagTrack2Y < 0) ExctleagTrack2Y = 0xfc; -} - -static UINT8 ExctleagReadIO(UINT32 offset) -{ - switch (offset) { - case 0x0800: { - return 0xff - System16Input[0]; - } - - case 0x0801: { - return 0xff - System16Input[1]; - } - - case 0x0802: { - return 0xff - System16Input[3]; - } - - case 0x0803: { - return 0xff - System16Input[2]; - } - - case 0x1000: { - return System16Dip[0]; - } - - case 0x1001: { - return System16Dip[1]; - } - - case 0x1800: - case 0x1801: { - return ExctleagTrack1X; - } - - case 0x1802: - case 0x1803: { - return ExctleagTrack1Y; - } - - case 0x1804: - case 0x1805: { - return ExctleagTrack2X; - } - - case 0x1806: - case 0x1807: { - return ExctleagTrack2Y; - } - } - - return sega_315_5195_io_read(offset); -} - -static UINT8 __fastcall FpointblReadByte(UINT32 a) -{ - switch (a) { - case 0x601001: { - return 0xff - System16Input[0]; - } - - case 0x601003: { - return 0xff - System16Input[1]; - } - - case 0x601005: { - return 0xff - System16Input[2]; - } - - case 0x600001: { - return System16Dip[0]; - } - - case 0x600003: { - return System16Dip[1]; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -static void __fastcall FpointblWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x600007: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - - } - - case 0x843001: { - System16VideoEnable = d & 0x20; - System16ScreenFlip = d & 0x40; - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -static void __fastcall FpointblGfxWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xc46000: { - System16ScrollY[0] = d; - return; - } - - case 0xc46008: { - System16ScrollX[0] = (d ^ 0xffff); - return; - } - - case 0xc46010: { - System16ScrollY[1] = d + 2; - return; - } - - case 0xc46018: { - System16ScrollX[1] = (d ^ 0xffff); - return; - } - - case 0xc46022: { - BootlegFgPage[3] = (d >> 12) & 0xf; - BootlegFgPage[2] = (d >> 8) & 0xf; - BootlegFgPage[1] = (d >> 4) & 0xf; - BootlegFgPage[0] = (d >> 0) & 0xf; - return; - } - - case 0xc46026: { - BootlegBgPage[0] = (d >> 12) & 0xf; - BootlegBgPage[1] = (d >> 8) & 0xf; - BootlegBgPage[2] = (d >> 4) & 0xf; - BootlegBgPage[3] = (d >> 0) & 0xf; - return; - } - } -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X, 0x%04X\n"), a, d, d ^ 0xffff); -#endif -} - -static UINT8 HwchampInputVal; - -static UINT8 HwchampReadIO(UINT32 offset) -{ - UINT16 result; - - switch (offset) { - case 0x0800: { - return 0xff - System16Input[0]; - } - - case 0x1000: { - return System16Dip[1]; - } - - case 0x1001: { - return System16Dip[0]; - } - - case 0x1810: - case 0x1811: - case 0x1812: - case 0x1818: - case 0x1819: - case 0x181a: { - result = (HwchampInputVal & 0x80) >> 7; - HwchampInputVal <<= 1; - return result & 0xff; - } - } - - return sega_315_5195_io_read(offset); -} - -static void HwchampWriteIO(UINT32 offset, UINT8 d) -{ - UINT8 temp = 0; - - switch (offset) { - case 0x1810: - case 0x1818: { - temp = 0x80 + (System16AnalogPort0 >> 4); - if (temp < 0x01) temp = 0x01; - if (temp > 0xfe) temp = 0xfe; - HwchampInputVal = temp; - return; - } - - case 0x1811: - case 0x1819: { - temp = 0x26; - if (System16AnalogPort2 > 1) temp = 0xfe; - HwchampInputVal = temp; - return; - } - - case 0x1812: - case 0x181a: { - temp = 0x26; - if (System16AnalogPort1 > 1) temp = 0xfe; - HwchampInputVal = temp; - return; - } - } - - sega_315_5195_io_write(offset, d); -} - -static UINT8 __fastcall LockonphZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x01: { - return BurnYM2151ReadStatus(); - } - - case 0x80: { - return MSM6295ReadStatus(0); - } - - case 0xc0: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return System16SoundLatch; - } - } - - bprintf(PRINT_NORMAL, _T("Z80 Read Port -> %02X\n"), a); - - return 0; -} - -static void __fastcall LockonphZ80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - d &= 0xff; - - switch (a) { - case 0x00: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x01: { - BurnYM2151WriteRegister(d); - return; - } - - case 0x40: { - return; - } - - case 0x80: { - MSM6295Command(0, d); - return; - } - } - - bprintf(PRINT_NORMAL, _T("Z80 Write Port -> %02X, %02X\n"), a, d); -} - -static UINT8 __fastcall LockonphReadByte(UINT32 a) -{ - switch (a) { - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - return 0xff - System16Input[1]; - } - - case 0xc41005: { - return 0xff - System16Input[2]; - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - } - - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); - - return 0; -} - -static void __fastcall LockonphWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x3f0001: { - if (System16TileBanks[0] != (d & 0x07)) { - System16TileBanks[0] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - - case 0x3f0003: { - if (System16TileBanks[1] != (d & 0x07)) { - System16TileBanks[1] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - - case 0x777707: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - - case 0xc40001: { - return; - } - } - - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -} - -static UINT16 __fastcall LockonphReadWord(UINT32 a) -{ - bprintf(PRINT_NORMAL, _T("68000 Read Word -> 0x%06X\n"), a); - - return 0; -} - -static void __fastcall LockonphWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16BTileWordWrite(a - 0x400000, d); - return; - } - - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -} - -static void __fastcall PassshtbGfxWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xc46000: { - System16ScrollY[0] = d; - return; - } - - case 0xc46002: { - System16ScrollX[0] = (d ^ 0xffff) & 0x1ff; - return; - } - - case 0xc46004: { - System16ScrollY[1] = d; - return; - } - - case 0xc46006: { - System16ScrollX[1] = (d ^ 0xffff) & 0x1ff; - return; - } - -/* case 0xc46022: { - BootlegFgPage[3] = (d >> 12) & 0xf; - BootlegFgPage[2] = (d >> 8) & 0xf; - BootlegFgPage[1] = (d >> 4) & 0xf; - BootlegFgPage[0] = (d >> 0) & 0xf; - return; - } - - case 0xc46026: { - BootlegBgPage[0] = (d >> 12) & 0xf; - BootlegBgPage[1] = (d >> 8) & 0xf; - BootlegBgPage[2] = (d >> 4) & 0xf; - BootlegBgPage[3] = (d >> 0) & 0xf; - return; - }*/ - } -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X, 0x%04X\n"), a, d, (d ^ 0xffff) & 0x1ff); -#endif -} - -static INT16 SdiTrack1X = 0; -static INT16 SdiTrack1Y = 0; -static INT16 SdiTrack2X = 0; -static INT16 SdiTrack2Y = 0; - -static void SdibMakeAnalogInputs() -{ - SdiTrack1X -= (System16AnalogPort0 >> 8) & 0xff; - SdiTrack1Y += (System16AnalogPort1 >> 8) & 0xff; - - SdiTrack2X -= (System16AnalogPort2 >> 8) & 0xff; - SdiTrack2Y += (System16AnalogPort3 >> 8) & 0xff; -} - -static UINT8 SdibReadIO(UINT32 offset) -{ - switch (offset) { - case 0x0800: { - return 0xff - System16Input[0]; - } - - case 0x0802: { - return 0xff - System16Input[1]; - } - - case 0x1000: { - return System16Dip[1]; - } - - case 0x1001: { - return System16Dip[0]; - } - - case 0x1800: { - return SdiTrack1X; - } - - case 0x1802: { - return SdiTrack1Y; - } - - case 0x1804: { - return SdiTrack2X; - } - - case 0x1806: { - return SdiTrack2Y; - } - } - - return sega_315_5195_io_read(offset); -} - -static UINT8 __fastcall SdiblReadByte(UINT32 a) -{ - switch (a) { - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41005: { - return 0xff - System16Input[1]; - } - - case 0xc42003: { - return System16Dip[1]; - } - - case 0xc42005: { - return System16Dip[0]; - } - - case 0xc43001: { - return SdiTrack1X; - } - - case 0xc43005: { - return SdiTrack1Y; - } - - case 0xc43009: { - return SdiTrack2X; - } - - case 0xc4300d: { - return SdiTrack2Y; - } - } - - return 0xff; -} - -static void __fastcall SdiblSoundWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x123407: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - } -} - -static UINT8 MahjongInputNum; - -static UINT8 SjryukoReadIO(UINT32 offset) -{ - switch (offset) { - case 0x0800: { - return 0xff - System16Input[0]; - } - - case 0x0801: { - if (System16Input[MahjongInputNum + 1] != 0xff) return 0xff & ~(1 << MahjongInputNum); - return 0xff; - } - - case 0x802: { - return 0xff - System16Input[MahjongInputNum + 1]; - } - - case 0x803: { - return 0xff - System16Input[2]; - } - - case 0x1000: { - return System16Dip[0]; - } - - case 0x1001: { - return System16Dip[1]; - } - } - - return sega_315_5195_io_read(offset); -} - -static void SjryukoWriteIO(UINT32 offset, UINT8 d) -{ - switch (offset) { - case 0x0001: { - System16VideoEnable = d & 0x20; - System16ScreenFlip = d & 0x40; - if (d & 4) MahjongInputNum = (MahjongInputNum + 1) % 6; - return; - } - } - - sega_315_5195_io_write(offset, d); -} - -static void __fastcall TetrisblGfxWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x418000: { - System16ScrollY[0] = d; - return; - } - - case 0x418008: { - System16ScrollX[0] = (d ^ 0xffff) & 0x3ff; - return; - } - - case 0x418010: { - System16ScrollY[1] = d; - return; - } - - case 0x418018: { - System16ScrollX[1] = ((d ^ 0xffff) & 0x3ff) + 2; - return; - } - - case 0x418020: { - BootlegFgPage[3] = (d >> 12) & 0xf; - BootlegFgPage[2] = (d >> 8) & 0xf; - BootlegFgPage[1] = (d >> 4) & 0xf; - BootlegFgPage[0] = (d >> 0) & 0xf; - return; - } - - case 0x418028: { - BootlegBgPage[0] = (d >> 12) & 0xf; - BootlegBgPage[1] = (d >> 8) & 0xf; - BootlegBgPage[2] = (d >> 4) & 0xf; - BootlegBgPage[3] = (d >> 0) & 0xf; - return; - } - } -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X, 0x%04X\n"), a, d, (d ^ 0xffff) & 0x3ff); -#endif -} - -static void __fastcall TetrisblSndWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xc42007: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - } -} - -static void __fastcall Wb3bblGfxWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xc46000: { - System16ScrollY[0] = d; - return; - } - - case 0xc46002: { - System16ScrollX[0] = (d ^ 0xffff) & 0x3ff; - return; - } - - case 0xc46004: { - System16ScrollY[1] = d; - return; - } - - case 0xc46006: { - System16ScrollX[1] = (d ^ 0xffff) & 0x3ff; - return; - } - -/* case 0xc46022: { - BootlegFgPage[3] = (d >> 12) & 0xf; - BootlegFgPage[2] = (d >> 8) & 0xf; - BootlegFgPage[1] = (d >> 4) & 0xf; - BootlegFgPage[0] = (d >> 0) & 0xf; - return; - } - - case 0xc46026: { - BootlegBgPage[0] = (d >> 12) & 0xf; - BootlegBgPage[1] = (d >> 8) & 0xf; - BootlegBgPage[2] = (d >> 4) & 0xf; - BootlegBgPage[3] = (d >> 0) & 0xf; - return; - }*/ - } -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X, 0x%04X\n"), a, d, d ^ 0xffff); -#endif -} - -/*==================================================== -Driver Inits -====================================================*/ - -static INT32 Fantzn2xPlaneOffsets[3] = { 1, 2, 3 }; -static INT32 Fantzn2xXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 Fantzn2xYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 LockonphPlaneOffsets[4] = { 0x300000, 0x200000, 0x100000, 0 }; -static INT32 LockonphXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 LockonphYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - -static INT32 AceattacInit() -{ - System16MakeAnalogInputsDo = AceattacMakeAnalogInputs; - sega_315_5195_custom_io_do = AceattacReadIO; - - return System16Init(); -} - -static INT32 AliensynInit() -{ - INT32 nRet = System16Init(); - AlienSyndrome = true; - - return nRet; -} - -static void Altbeastj_Sim8751() -{ - // System Inputs - *((UINT16*)(System16Ram + 0x30d0)) = BURN_ENDIAN_SWAP_INT16((UINT16)(System16Input[0] << 8)); - - // Tile Banking - INT32 Bank = (System16Ram[0x3094 + 1] << 8) | System16Ram[0x3094 + 0]; - Bank &= 0xff; - Bank = (Bank & 0x01) | ((Bank & 0xfe) << 1); - System16TileBanks[1] = Bank & 7; - - // Sound command - UINT16 temp = (System16Ram[0x30d4 + 1] << 8) | System16Ram[0x30d4 + 0]; - if ((temp & 0xff00) != 0x0000) { - System16SoundLatch = temp >> 8; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - *((UINT16*)(System16Ram + 0x30d4)) = BURN_ENDIAN_SWAP_INT16((UINT16)(temp & 0xff)); - } -} - -static void Altbeast6_Sim8751() -{ - // System Inputs - *((UINT16*)(System16Ram + 0x3096)) = BURN_ENDIAN_SWAP_INT16((UINT16)(System16Input[0] << 8)); - - // Tile Banking - INT32 Bank = (System16Ram[0x3094 + 1] << 8) | System16Ram[0x3094 + 0]; - Bank &= 0xff; - Bank = (Bank & 0x01) | ((Bank & 0xfe) << 1); - System16TileBanks[1] = Bank & 7; - - // Sound command - UINT16 temp = (System16Ram[0x3098 + 1] << 8) | System16Ram[0x3098 + 0]; - if ((temp & 0xff00) != 0x0000) { - System16SoundLatch = temp >> 8; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - *((UINT16*)(System16Ram + 0x3098)) = BURN_ENDIAN_SWAP_INT16((UINT16)(temp & 0xff)); - } -} - -static INT32 AltbeastjInit() -{ - Simulate8751 = Altbeastj_Sim8751; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1a0000 - 0xe0000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0xe0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0xe0000); - memset(System16Sprites, 0, 0x1a0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x00000, 0x20000); - memcpy(System16Sprites + 0x040000, pTemp + 0x20000, 0x20000); - memcpy(System16Sprites + 0x080000, pTemp + 0x40000, 0x20000); - memcpy(System16Sprites + 0x0c0000, pTemp + 0x60000, 0x20000); - memcpy(System16Sprites + 0x100000, pTemp + 0x80000, 0x20000); - memcpy(System16Sprites + 0x140000, pTemp + 0xa0000, 0x20000); - memcpy(System16Sprites + 0x180000, pTemp + 0xc0000, 0x20000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 Altbeast6Init() -{ - Simulate8751 = Altbeast6_Sim8751; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1a0000 - 0xe0000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0xe0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0xe0000); - memset(System16Sprites, 0, 0x1a0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x00000, 0x20000); - memcpy(System16Sprites + 0x040000, pTemp + 0x20000, 0x20000); - memcpy(System16Sprites + 0x080000, pTemp + 0x40000, 0x20000); - memcpy(System16Sprites + 0x0c0000, pTemp + 0x60000, 0x20000); - memcpy(System16Sprites + 0x100000, pTemp + 0x80000, 0x20000); - memcpy(System16Sprites + 0x140000, pTemp + 0xa0000, 0x20000); - memcpy(System16Sprites + 0x180000, pTemp + 0xc0000, 0x20000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 Altbeast4Init() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1a0000 - 0xe0000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0xe0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0xe0000); - memset(System16Sprites, 0, 0x1a0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x00000, 0x20000); - memcpy(System16Sprites + 0x040000, pTemp + 0x20000, 0x20000); - memcpy(System16Sprites + 0x080000, pTemp + 0x40000, 0x20000); - memcpy(System16Sprites + 0x0c0000, pTemp + 0x60000, 0x20000); - memcpy(System16Sprites + 0x100000, pTemp + 0x80000, 0x20000); - memcpy(System16Sprites + 0x140000, pTemp + 0xa0000, 0x20000); - memcpy(System16Sprites + 0x180000, pTemp + 0xc0000, 0x20000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static void AltbeastblMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, System16BReadByte); - SekSetWriteByteHandler(0, System16BWriteByte); - SekSetWriteWordHandler(0, System16BWriteWord); - SekMapHandler(1, 0x418000, 0x418031, MAP_WRITE); - SekSetWriteWordHandler(1, AltbeastblGfxWriteWord); - SekMapHandler(2, 0xc42006, 0xc42007, MAP_WRITE); - SekSetWriteByteHandler(2, AltbeastblSoundWriteByte); - SekClose(); -} - -static INT32 AltbeastblInit() -{ - System16Map68KDo = AltbeastblMap68K; - - INT32 nRet = System16Init(); - - System16SpriteXOffset = 114; - - if (!nRet) { - bSystem16BootlegRender = true; - } - - return nRet; -} - -static INT32 AtomicpInit() -{ - INT32 nRet = System16Init(); - - System16IgnoreVideoEnable = 1; - System16YM2413IRQInterval = 166; - - return nRet; -} - -static INT32 Blox16bLoadRom() -{ - if (BurnLoadRom(System16Rom + 0x00000, 0, 1)) return 1; - - System16TempGfx = (UINT8*)BurnMalloc(System16TileRomSize); - BurnLoadRom(System16TempGfx, 1, 1); - GfxDecode(0x2000, 3, 8, 8, Fantzn2xPlaneOffsets, Fantzn2xXOffsets, Fantzn2xYOffsets, 0x100, System16TempGfx, System16Tiles); - System16NumTiles = 0x2000; - BurnFree(System16TempGfx); - - BurnLoadRom(System16Sprites, 2, 1); - BurnByteswap(System16Sprites, System16SpriteRomSize); - - if (BurnLoadRom(System16Z80Rom, 3, 1)) return 1; - memcpy(System16UPD7759Data, System16Z80Rom + 0x10000, 0x08000); - - return 0; -} - -static INT32 Blox16bInit() -{ - System16CustomLoadRomDo = Blox16bLoadRom; - System16UPD7759DataSize = 0x08000; - - return System16Init(); -} - -static void Ddux_Sim8751() -{ - // Sound command - UINT16 temp = (System16Ram[0x0bd0 + 1] << 8) | System16Ram[0x0bd0 + 0]; - if ((temp & 0xff00) != 0x0000) { - System16SoundLatch = temp >> 8; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - *((UINT16*)(System16Ram + 0x0bd0)) = BURN_ENDIAN_SWAP_INT16((UINT16)(temp & 0xff)); - } -} - -static INT32 Ddux1Init() -{ - Simulate8751 = Ddux_Sim8751; - - return System16Init(); -} - -static void DduxblMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, System16BReadByte); - SekSetWriteWordHandler(0, System16BWriteWord); - SekSetWriteByteHandler(0, DduxblWriteByte); - SekMapHandler(2, 0xc46000, 0xc46027, MAP_WRITE); - SekSetWriteByteHandler(2, DduxblGfxWriteByte); - SekSetWriteWordHandler(2, DduxblGfxWriteWord); - SekClose(); -} - -static INT32 DduxblInit() -{ - System16CustomLoadRomDo = CustomLoadRom40000; - System16Map68KDo = DduxblMap68K; - - System16SpriteXOffset = 112; - - System16MapZ80Do = BootlegMapZ80; - - INT32 nRet = System16Init(); - - if (!nRet) { - bSystem16BootlegRender = true; - } - - return nRet; -} - -static INT32 DunkshotInit() -{ - System16MakeAnalogInputsDo = DunkshotMakeAnalogInputs; - sega_315_5195_custom_io_do = DunkshotReadIO; - - System16BTileAlt = true; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x80000 - 0x40000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x80000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x80000); - memset(System16Sprites, 0, 0x80000); - memcpy(System16Sprites + 0x00000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x10000, pTemp + 0x00000, 0x10000); - memcpy(System16Sprites + 0x20000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x30000, pTemp + 0x10000, 0x10000); - memcpy(System16Sprites + 0x40000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x50000, pTemp + 0x20000, 0x10000); - memcpy(System16Sprites + 0x60000, pTemp + 0x30000, 0x10000); - memcpy(System16Sprites + 0x70000, pTemp + 0x30000, 0x10000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 DunkshotExit() -{ - DunkshotTrack1X = 0; - DunkshotTrack1Y = 0; - DunkshotTrack2X = 0; - DunkshotTrack2Y = 0; - DunkshotTrack3X = 0; - DunkshotTrack3Y = 0; - DunkshotTrack4X = 0; - DunkshotTrack4Y = 0; - - return System16Exit(); -} - -static INT32 DunkshotScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(DunkshotTrack1X); - SCAN_VAR(DunkshotTrack1Y); - SCAN_VAR(DunkshotTrack2X); - SCAN_VAR(DunkshotTrack2Y); - SCAN_VAR(DunkshotTrack3X); - SCAN_VAR(DunkshotTrack3Y); - SCAN_VAR(DunkshotTrack4X); - SCAN_VAR(DunkshotTrack4Y); - } - - return System16Scan(nAction, pnMin);; -} - -static void EswatblMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0bffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0bffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, System16BReadByte); - SekSetWriteByteHandler(0, System16BWriteByte); - SekSetWriteWordHandler(0, System16BWriteWord); - SekMapHandler(1, 0x418000, 0x418031, MAP_WRITE); - SekSetWriteWordHandler(1, EswatblGfxWriteWord); - SekSetWriteByteHandler(1, EswatblGfxWriteByte); - SekMapHandler(2, 0xc42006, 0xc42007, MAP_WRITE); - SekSetWriteByteHandler(2, EswatblSoundWriteByte); - SekMapHandler(3, 0x3e2000, 0x3e2003, MAP_WRITE); - SekSetWriteByteHandler(3, EswatblBankWriteByte); - SekClose(); -} - -static INT32 EswatInit() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1c0000 - 0x180000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x1c0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x1c0000); - memset(System16Sprites, 0, 0x1c0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x000000, 0x40000); - memcpy(System16Sprites + 0x100000, pTemp + 0x040000, 0x40000); - memcpy(System16Sprites + 0x040000, pTemp + 0x080000, 0x40000); - memcpy(System16Sprites + 0x140000, pTemp + 0x0c0000, 0x40000); - memcpy(System16Sprites + 0x080000, pTemp + 0x100000, 0x40000); - memcpy(System16Sprites + 0x180000, pTemp + 0x140000, 0x40000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 Eswatj1Init() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1c0000 - 0x180000; - - System16TileRomSize = 0x0c0000 - 0x090000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x0c0000); - if (pTemp) { - memcpy(pTemp, System16Sprites + 0x0c0000, 0x0c0000); - memcpy(System16Sprites + 0x100000, pTemp + 0x000000, 0xc0000); - } else { - nRet = 1; - } - BurnFree(pTemp); - - System16TempGfx = (UINT8*)BurnMalloc(System16TileRomSize); - if (System16TempGfx) { - BurnLoadRom(System16TempGfx + 0x000000, 4, 1); - BurnLoadRom(System16TempGfx + 0x020000, 5, 1); - BurnLoadRom(System16TempGfx + 0x040000, 6, 1); - BurnLoadRom(System16TempGfx + 0x060000, 7, 1); - BurnLoadRom(System16TempGfx + 0x080000, 8, 1); - BurnLoadRom(System16TempGfx + 0x0a0000, 9, 1); - System16Decode8x8Tiles(System16Tiles, System16NumTiles, System16TileRomSize * 2 / 3, System16TileRomSize * 1 / 3, 0); - } else { - nRet = 1; - } - BurnFree(System16TempGfx); - } - - return nRet; -} - -static INT32 EswatblInit() -{ - System16Map68KDo = EswatblMap68K; - - System16SpriteXOffset = 124; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1c0000 - 0x180000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x1c0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x1c0000); - memset(System16Sprites, 0, 0x1c0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x000000, 0x40000); - memcpy(System16Sprites + 0x100000, pTemp + 0x040000, 0x40000); - memcpy(System16Sprites + 0x040000, pTemp + 0x080000, 0x40000); - memcpy(System16Sprites + 0x140000, pTemp + 0x0c0000, 0x40000); - memcpy(System16Sprites + 0x080000, pTemp + 0x100000, 0x40000); - memcpy(System16Sprites + 0x180000, pTemp + 0x140000, 0x40000); - } else { - nRet = 1; - } - BurnFree(pTemp); - - bSystem16BootlegRender = true; - } - - return nRet; -} - -static INT32 ExctleagInit() -{ - System16MakeAnalogInputsDo = ExctleagMakeAnalogInputs; - sega_315_5195_custom_io_do = ExctleagReadIO; - - return System16Init(); -} - -static INT32 ExctleagExit() -{ - ExctleagTrack1X = 0; - ExctleagTrack1Y = 0; - ExctleagTrack2X = 0; - ExctleagTrack2Y = 0; - - return System16Exit(); -} - -static INT32 ExctleagScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(ExctleagTrack1X); - SCAN_VAR(ExctleagTrack1Y); - SCAN_VAR(ExctleagTrack2X); - SCAN_VAR(ExctleagTrack2Y); - } - - return System16Scan(nAction, pnMin);; -} - -static INT32 FantzonetaInit() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x180000 - 0x80000; - - INT32 nRet = System16Init(); - memcpy(System16Sprites + 0x100000, System16Sprites + 0x040000, 0x40000); - - return nRet; -} - -static INT32 Fantzn2xLoadRom() -{ - return System16LoadRoms(1); -} - -static INT32 Fantzn2xps2LoadRom() -{ - if (BurnLoadRom(System16Rom + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(System16Rom + 0x40000, 1, 1)) return 1; - - memcpy(System16Code, System16Rom, 0x100000); - - System16TempGfx = (UINT8*)BurnMalloc(System16TileRomSize); - BurnLoadRom(System16TempGfx, 2, 1); - GfxDecode(0x4000, 3, 8, 8, Fantzn2xPlaneOffsets, Fantzn2xXOffsets, Fantzn2xYOffsets, 0x100, System16TempGfx, System16Tiles); - System16NumTiles = 0x4000; - BurnFree(System16TempGfx); - - BurnLoadRom(System16Sprites, 3, 1); - - if (BurnLoadRom(System16Z80Rom, 4, 1)) return 1; - memcpy(System16UPD7759Data, System16Z80Rom + 0x10000, 0x20000); - - return 0; -} - -static INT32 Fantzn2xInit() -{ - System16CustomLoadRomDo = Fantzn2xLoadRom; - - return System16Init(); -} - -static INT32 Fantzn2xps2Init() -{ - System16CustomLoadRomDo = Fantzn2xps2LoadRom; - System16UPD7759DataSize = 0x20000; - - return System16Init(); -} - -static INT32 FantzntaLoadRom() -{ - if (BurnLoadRom(System16Rom + 0x00000, 0, 1)) return 1; - - System16TempGfx = (UINT8*)BurnMalloc(System16TileRomSize); - BurnLoadRom(System16TempGfx, 1, 1); - GfxDecode(0x2000, 3, 8, 8, Fantzn2xPlaneOffsets, Fantzn2xXOffsets, Fantzn2xYOffsets, 0x100, System16TempGfx, System16Tiles); - System16NumTiles = 0x2000; - BurnFree(System16TempGfx); - - BurnLoadRom(System16Sprites, 2, 1); - BurnByteswap(System16Sprites, System16SpriteRomSize); - - if (BurnLoadRom(System16Z80Rom, 3, 1)) return 1; - memcpy(System16UPD7759Data, System16Z80Rom + 0x10000, 0x10000); - - return 0; -} - -static INT32 FantzntaInit() -{ - System16CustomLoadRomDo = FantzntaLoadRom; - System16UPD7759DataSize = 0x10000; - - return System16Init(); -} - -static void FpointblMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - SekSetWriteWordHandler(0, System16BWriteWord); - SekSetReadByteHandler(0, FpointblReadByte); - SekSetWriteByteHandler(0, FpointblWriteByte); - SekMapHandler(1, 0xc46000, 0xc46031, MAP_WRITE); - SekSetWriteWordHandler(1, FpointblGfxWriteWord); - SekClose(); -} - -static INT32 FpointblInit() -{ - System16Map68KDo = FpointblMap68K; - System16MapZ80Do = BootlegMapZ80; - - INT32 nRet = System16Init(); - - System16SpriteXOffset = 109; - - if (!nRet) { - bSystem16BootlegRender = true; - } - - return nRet; -} - -static void Goldnaxe_Sim8751() -{ - // Protection MCU - UINT16 temp1 = (System16Ram[0x2cd8 + 1] << 8) | System16Ram[0x2cd8 + 0]; - UINT16 temp2 = (System16Ram[0x2cda + 1] << 8) | System16Ram[0x2cda + 0]; - UINT16 temp3 = (System16Ram[0x2cdc + 1] << 8) | System16Ram[0x2cdc + 0]; - UINT16 temp4 = (System16Ram[0x2cde + 1] << 8) | System16Ram[0x2cde + 0]; - if (temp1 == 0 && temp2 == 0 && temp3 == 0 && temp4 == 0) { - *((UINT16*)(System16Ram + 0x2cd8)) = BURN_ENDIAN_SWAP_INT16(0x048c); - *((UINT16*)(System16Ram + 0x2cda)) = BURN_ENDIAN_SWAP_INT16(0x159d); - *((UINT16*)(System16Ram + 0x2cdc)) = BURN_ENDIAN_SWAP_INT16(0x26ae); - *((UINT16*)(System16Ram + 0x2cde)) = BURN_ENDIAN_SWAP_INT16(0x37bf); - } - - // Sound command - UINT16 temp = (System16Ram[0x2cfc + 1] << 8) | System16Ram[0x2cfc + 0]; - if ((temp & 0xff00) != 0x0000) { - System16SoundLatch = temp >> 8; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - *((UINT16*)(System16Ram + 0x2cfc)) = BURN_ENDIAN_SWAP_INT16((UINT16)(temp & 0xff)); - } - - // Inputs - *((UINT16*)(System16Ram + 0x2cd0)) = BURN_ENDIAN_SWAP_INT16((UINT16)(~((System16Input[1] << 8) | System16Input[2]))); - *((UINT16*)(System16Ram + 0x2c96)) = BURN_ENDIAN_SWAP_INT16((UINT16)(~System16Input[0] << 8)); -} - -static INT32 GoldnaxeInit() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1c0000 - 0x180000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x1c0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x1c0000); - memset(System16Sprites, 0, 0x1c0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x000000, 0x40000); - memcpy(System16Sprites + 0x100000, pTemp + 0x040000, 0x40000); - memcpy(System16Sprites + 0x040000, pTemp + 0x080000, 0x40000); - memcpy(System16Sprites + 0x140000, pTemp + 0x0c0000, 0x40000); - memcpy(System16Sprites + 0x080000, pTemp + 0x100000, 0x40000); - memcpy(System16Sprites + 0x180000, pTemp + 0x140000, 0x40000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 Goldnaxe2Init() -{ - Simulate8751 = Goldnaxe_Sim8751; - - UINT8 memory_control_5704[0x10] = { 0x02,0x00, 0x02,0x08, 0x00,0x1f, 0x00,0xff, 0x00,0x20, 0x01,0x10, 0x00,0x14, 0x00,0xc4 }; - System16I8751InitialConfig = memory_control_5704; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1c0000 - 0x180000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x1c0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x1c0000); - memset(System16Sprites, 0, 0x1c0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x000000, 0x40000); - memcpy(System16Sprites + 0x100000, pTemp + 0x040000, 0x40000); - memcpy(System16Sprites + 0x040000, pTemp + 0x080000, 0x40000); - memcpy(System16Sprites + 0x140000, pTemp + 0x0c0000, 0x40000); - memcpy(System16Sprites + 0x080000, pTemp + 0x100000, 0x40000); - memcpy(System16Sprites + 0x180000, pTemp + 0x140000, 0x40000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 Goldnaxe3Init() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1c0000 - 0x180000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x1c0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x1c0000); - memset(System16Sprites, 0, 0x1c0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x000000, 0x40000); - memcpy(System16Sprites + 0x100000, pTemp + 0x040000, 0x40000); - memcpy(System16Sprites + 0x040000, pTemp + 0x080000, 0x40000); - memcpy(System16Sprites + 0x140000, pTemp + 0x0c0000, 0x40000); - memcpy(System16Sprites + 0x080000, pTemp + 0x100000, 0x40000); - memcpy(System16Sprites + 0x180000, pTemp + 0x140000, 0x40000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 HwchampInit() -{ - sega_315_5195_custom_io_do = HwchampReadIO; - sega_315_5195_custom_io_write_do = HwchampWriteIO; - - return System16Init(); -} - -static INT32 HwchampExit() -{ - HwchampInputVal = 0; - - return System16Exit(); -} - -static INT32 HwchampScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(HwchampInputVal); - } - - return System16Scan(nAction, pnMin);; -} - -static void LockonphMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0bffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0bffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x841fff, MAP_RAM); - SekMapMemory(System16Ram , 0xff0000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, LockonphReadByte); - SekSetWriteByteHandler(0, LockonphWriteByte); - SekSetReadWordHandler(0, LockonphReadWord); - SekSetWriteWordHandler(0, LockonphWriteWord); - SekClose(); -} - -static void LockonphMapZ80() -{ - ZetMapArea(0x0000, 0xf7ff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0xf7ff, 2, System16Z80Rom); - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram); - - ZetSetInHandler(LockonphZ80PortRead); - ZetSetOutHandler(LockonphZ80PortWrite); -} - -static INT32 LockonphInit() -{ - Lockonph = true; - - System16Map68KDo = LockonphMap68K; - System16MapZ80Do = LockonphMapZ80; - - System16SpriteRomSize = 0x40000; - - INT32 nRet = System16Init(); - - System16TempGfx = (UINT8*)BurnMalloc(System16TileRomSize); - BurnLoadRom(System16TempGfx + 0x00000, 4, 1); - BurnLoadRom(System16TempGfx + 0x20000, 5, 1); - BurnLoadRom(System16TempGfx + 0x40000, 6, 1); - BurnLoadRom(System16TempGfx + 0x60000, 7, 1); - GfxDecode(0x4000, 4, 8, 8, LockonphPlaneOffsets, LockonphXOffsets, LockonphYOffsets, 0x40, System16TempGfx, System16Tiles); - System16NumTiles = 0x4000; - BurnFree(System16TempGfx); - - System16ClockSpeed = 8000000; - System16Z80ClockSpeed = 4000000; - System16IgnoreVideoEnable = 1; - System16SpritePalOffset = 0x800; - System16YM2413IRQInterval = 166; // used to drive the YM2151 - - return nRet; -} - -static INT32 MvpInit() -{ - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x200000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x200000); - memset(System16Sprites, 0, 0x200000); - memcpy(System16Sprites + 0x000000, pTemp + 0x000000, 0x40000); - memcpy(System16Sprites + 0x100000, pTemp + 0x040000, 0x40000); - memcpy(System16Sprites + 0x040000, pTemp + 0x080000, 0x40000); - memcpy(System16Sprites + 0x140000, pTemp + 0x0c0000, 0x40000); - memcpy(System16Sprites + 0x080000, pTemp + 0x100000, 0x40000); - memcpy(System16Sprites + 0x180000, pTemp + 0x140000, 0x40000); - memcpy(System16Sprites + 0x0c0000, pTemp + 0x180000, 0x40000); - memcpy(System16Sprites + 0x1c0000, pTemp + 0x1c0000, 0x40000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 MvpjInit() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x200000 - 0x180000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x200000); - if (pTemp) { - memset(pTemp, 0, 0x200000); - memcpy(pTemp, System16Sprites, 0x200000); - memset(System16Sprites, 0, 0x200000); - memcpy(System16Sprites + 0x000000, pTemp + 0x000000, 0xc0000); - memcpy(System16Sprites + 0x100000, pTemp + 0x0c0000, 0xc0000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static void PassshtbMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, System16BReadByte); - SekSetWriteByteHandler(0, System16BWriteByte); - SekSetWriteWordHandler(0, System16BWriteWord); - SekMapHandler(1, 0xc46000, 0xc46031, MAP_WRITE); - SekSetWriteWordHandler(1, PassshtbGfxWriteWord); - SekClose(); -} - -static INT32 PassshtbInit() -{ - System16Map68KDo = PassshtbMap68K; - - INT32 nRet = System16Init(); - -// System16SpriteXOffset = 114; - - if (!nRet) { - bSystem16BootlegRender = true; - } - - return nRet; -} - -static INT32 RiotcityInit() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x1c0000 - 0x180000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x1c0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x1c0000); - memset(System16Sprites, 0, 0x1c0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x000000, 0x40000); - memcpy(System16Sprites + 0x100000, pTemp + 0x040000, 0x40000); - memcpy(System16Sprites + 0x040000, pTemp + 0x080000, 0x40000); - memcpy(System16Sprites + 0x140000, pTemp + 0x0c0000, 0x40000); - memcpy(System16Sprites + 0x080000, pTemp + 0x100000, 0x40000); - memcpy(System16Sprites + 0x180000, pTemp + 0x140000, 0x40000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 SdibInit() -{ - System16MakeAnalogInputsDo = SdibMakeAnalogInputs; - sega_315_5195_custom_io_do = SdibReadIO; - - return System16Init(); -} - -static void SdiblMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - SekSetWriteByteHandler(0, System16BWriteByte); - SekSetWriteWordHandler(0, System16BWriteWord); - SekSetReadByteHandler(0, SdiblReadByte); - SekMapHandler(1, 0x123406, 0x123407, MAP_WRITE); - SekSetWriteByteHandler(1, SdiblSoundWriteByte); - SekClose(); -} - -static INT32 SdiblInit() -{ - System16Map68KDo = SdiblMap68K; - System16MakeAnalogInputsDo = SdibMakeAnalogInputs; - - return System16Init(); -} - -static INT32 SdibExit() -{ - SdiTrack1X = 0; - SdiTrack1Y = 0; - SdiTrack2X = 0; - SdiTrack2Y = 0; - - return System16Exit(); -} - -static INT32 SdibScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(SdiTrack1X); - SCAN_VAR(SdiTrack1Y); - SCAN_VAR(SdiTrack2X); - SCAN_VAR(SdiTrack2Y); - } - - return System16Scan(nAction, pnMin);; -} - -static INT32 Sdibl2LoadRom() -{ - memset(System16Code, 0, System16RomSize); - memcpy(System16Code, System16Rom + 0x30000, 0x30000); - memset(System16Rom + 0x30000, 0, 0x30000); - - return 0; -} - -static INT32 Sdibl2Init() -{ - System16CustomDecryptOpCodeDo = Sdibl2LoadRom; - - return SdiblInit(); -} - -static INT32 SjryukoInit() -{ - sega_315_5195_custom_io_do = SjryukoReadIO; - sega_315_5195_custom_io_write_do = SjryukoWriteIO; - - System16BTileAlt = true; - - return System16Init(); -} - -static INT32 SjryukoExit() -{ - MahjongInputNum = 0; - - return System16Exit(); -} - -static INT32 SjryukoScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(MahjongInputNum); - } - - return System16Scan(nAction, pnMin);; -} - -static INT32 SnapperInit() -{ - INT32 nRet = System16Init(); - - System16IgnoreVideoEnable = 1; - System16YM2413IRQInterval = 41; - - return nRet; -} - -static void TetrisblMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, System16BReadByte); - SekSetWriteByteHandler(0, System16BWriteByte); - SekSetWriteWordHandler(0, System16BWriteWord); - SekMapHandler(1, 0x418000, 0x418031, MAP_WRITE); - SekSetWriteWordHandler(1, TetrisblGfxWriteWord); - SekMapHandler(2, 0xc42006, 0xc42007, MAP_WRITE); - SekSetWriteByteHandler(2, TetrisblSndWriteByte); - SekClose(); -} - -static INT32 TetrisblInit() -{ - System16Map68KDo = TetrisblMap68K; - - INT32 nRet = System16Init(); - - System16SpriteXOffset = 114; - - if (!nRet) { - bSystem16BootlegRender = true; - } - - return nRet; -} - -static INT32 TimescanInit() -{ - System16BTileAlt = true; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0x80000 - 0x40000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x80000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x40000); - memset(System16Sprites, 0, 0x80000); - memcpy(System16Sprites + 0x000000, pTemp + 0x00000, 0x20000); - memcpy(System16Sprites + 0x020000, pTemp + 0x10000, 0x20000); - memcpy(System16Sprites + 0x040000, pTemp + 0x20000, 0x20000); - memcpy(System16Sprites + 0x060000, pTemp + 0x30000, 0x20000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static void Tturf_Sim8751() -{ - // Inputs - *((UINT16*)(System16Ram + 0x01e6)) = BURN_ENDIAN_SWAP_INT16((UINT16)(~System16Input[0] << 8)); - *((UINT16*)(System16Ram + 0x01e8)) = BURN_ENDIAN_SWAP_INT16((UINT16)(~System16Input[1] << 8)); - *((UINT16*)(System16Ram + 0x01ea)) = BURN_ENDIAN_SWAP_INT16((UINT16)(~System16Input[2] << 8)); - - // Sound command - UINT16 temp = (System16Ram[0x01d0 + 1] << 8) | System16Ram[0x01d0 + 0]; - if ((temp & 0xff00) != 0x0000) { - System16SoundLatch = temp & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - *((UINT16*)(System16Ram + 0x01d0)) = BURN_ENDIAN_SWAP_INT16((UINT16)(temp & 0xff)); - } -} - -static INT32 TturfInit() -{ - Simulate8751 = Tturf_Sim8751; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0xe0000 - 0x80000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0xe0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x80000); - memset(System16Sprites, 0, 0xe0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x00000, 0x20000); - memcpy(System16Sprites + 0x040000, pTemp + 0x20000, 0x20000); - memcpy(System16Sprites + 0x080000, pTemp + 0x40000, 0x20000); - memcpy(System16Sprites + 0x0c0000, pTemp + 0x60000, 0x20000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 TturfuInit() -{ - Simulate8751 = Tturf_Sim8751; - - return System16Init(); -} - -void Wb3_Sim8751() -{ - // Sound command - UINT16 temp = (System16Ram[0x0008 + 1] << 8) | System16Ram[0x0008 + 0]; - if ((temp & 0xff00) != 0x0000) { - System16SoundLatch = temp >> 8; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - *((UINT16*)(System16Ram + 0x0008)) = BURN_ENDIAN_SWAP_INT16((UINT16)(temp & 0xff)); - } -} - -static INT32 Wb3Init() -{ - Simulate8751 = Wb3_Sim8751; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0xe0000 - 0x80000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0xe0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x80000); - memset(System16Sprites, 0, 0xe0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x00000, 0x20000); - memcpy(System16Sprites + 0x040000, pTemp + 0x20000, 0x20000); - memcpy(System16Sprites + 0x080000, pTemp + 0x40000, 0x20000); - memcpy(System16Sprites + 0x0c0000, pTemp + 0x60000, 0x20000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 Wb33Init() -{ - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0xe0000 - 0x80000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0xe0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x80000); - memset(System16Sprites, 0, 0xe0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x00000, 0x20000); - memcpy(System16Sprites + 0x040000, pTemp + 0x20000, 0x20000); - memcpy(System16Sprites + 0x080000, pTemp + 0x40000, 0x20000); - memcpy(System16Sprites + 0x0c0000, pTemp + 0x60000, 0x20000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static void Wb3bblMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, System16BReadByte); - SekSetWriteByteHandler(0, System16BWriteByte); - SekSetWriteWordHandler(0, System16BWriteWord); - SekMapHandler(1, 0xc44000, 0xc46031, MAP_WRITE); - SekSetWriteWordHandler(1, Wb3bblGfxWriteWord); - SekClose(); -} - -static INT32 Wb3bblInit() -{ - System16Map68KDo = Wb3bblMap68K; - - // Start off with some sprite rom and let the load routine add on the rest - System16SpriteRomSize = 0xe0000 - 0x80000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0xe0000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x80000); - memset(System16Sprites, 0, 0xe0000); - memcpy(System16Sprites + 0x000000, pTemp + 0x00000, 0x20000); - memcpy(System16Sprites + 0x040000, pTemp + 0x20000, 0x20000); - memcpy(System16Sprites + 0x080000, pTemp + 0x40000, 0x20000); - memcpy(System16Sprites + 0x0c0000, pTemp + 0x60000, 0x20000); - } else { - nRet = 1; - } - BurnFree(pTemp); - - bSystem16BootlegRender = true; - } - - return nRet; -} - -static void Wrestwar_Sim8751() -{ - // System Inputs - *((UINT16*)(System16Ram + 0x2082)) = BURN_ENDIAN_SWAP_INT16((UINT16)~System16Input[0]); - - // Sound command - UINT16 temp = (System16Ram[0x208e + 1] << 8) | System16Ram[0x208e + 0]; - if ((temp & 0xff00) != 0x0000) { - System16SoundLatch = temp & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - *((UINT16*)(System16Ram + 0x208e)) = BURN_ENDIAN_SWAP_INT16((UINT16)(temp & 0xff)); - } -} - -static INT32 WrestwarInit() -{ - Simulate8751 = Wrestwar_Sim8751; - - return System16Init(); -} - -/*==================================================== -Driver defs -====================================================*/ - -struct BurnDriver BurnDrvAceattac = { - "aceattac", NULL, NULL, NULL, "1988", - "Ace Attacker (FD1094 317-0059)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358 | HARDWARE_SEGA_FD1094_ENC, GBF_SPORTSMISC, 0, - NULL, AceattacRomInfo, AceattacRomName, NULL, NULL, AceattacInputInfo, AceattacDIPInfo, - AceattacInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvAliensyn = { - "aliensyn", NULL, NULL, NULL, "1987", - "Alien Syndrome (set 4, System 16B, unprotected)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_MAZE, 0, - NULL, AliensynRomInfo, AliensynRomName, NULL, NULL, System16bfire1InputInfo, AliensynDIPInfo, - AliensynInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAliensyn3 = { - "aliensyn3", "aliensyn", NULL, NULL, "1987", - "Alien Syndrome (set 3, System 16B, FD1089A 317-0033)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL | HARDWARE_SEGA_FD1089A_ENC, GBF_MAZE, 0, - NULL, Aliensyn3RomInfo, Aliensyn3RomName, NULL, NULL, System16bfire1InputInfo, AliensynDIPInfo, - AliensynInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAliensyn7 = { - "aliensyn7", "aliensyn", NULL, NULL, "1987", - "Alien Syndrome (set 7, System 16B, MC-8123B 317-00xx)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL | HARDWARE_SEGA_MC8123_ENC, GBF_MAZE, 0, - NULL, Aliensyn7RomInfo, Aliensyn7RomName, NULL, NULL, System16bfire1InputInfo, AliensynDIPInfo, - AliensynInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAliensynj = { - "aliensynj", "aliensyn", NULL, NULL, "1987", - "Alien Syndrome (set 6, Japan, new, System 16B, FD1089A 317-0033)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL | HARDWARE_SEGA_FD1089A_ENC, GBF_MAZE, 0, - NULL, AliensynjRomInfo, AliensynjRomName, NULL, NULL, System16bfire1InputInfo, AliensynjDIPInfo, - AliensynInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeast = { - "altbeast", NULL, NULL, NULL, "1988", - "Altered Beast (set 8, 8751 317-0078)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_SCRFIGHT, 0, - NULL, AltbeastRomInfo, AltbeastRomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeastj = { - "altbeastj", "altbeast", NULL, NULL, "1988", - "Juuouki (set 7, Japan, 8751 317-0077)\0", NULL, "Sega", "System 16B", - L"Juuoki (set 7, Japan, 8751 317-0077)\0\u7363\u738B\u8A18\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_SCRFIGHT, 0, - NULL, AltbeastjRomInfo, AltbeastjRomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - AltbeastjInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeast2 = { - "altbeast2", "altbeast", NULL, NULL, "1988", - "Altered Beast (set 2, MC-8123B 317-0066)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521 | HARDWARE_SEGA_MC8123_ENC, GBF_SCRFIGHT, 0, - NULL, Altbeast2RomInfo, Altbeast2RomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeastj1 = { - "altbeastj1", "altbeast", NULL, NULL, "1988", - "Juuouki (set 1, Japan, FD1094 317-0065)\0", NULL, "Sega", "System 16B", - L"Juuoki (set 1, Japan, FD1094 317-0065)\0\u7363\u738B\u8A18\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521 | HARDWARE_SEGA_FD1094_ENC, GBF_SCRFIGHT, 0, - NULL, Altbeastj1RomInfo, Altbeastj1RomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeastj3 = { - "altbeastj3", "altbeast", NULL, NULL, "1988", - "Juuouki (set 3, Japan, FD1094 317-0068)\0", NULL, "Sega", "System 16B", - L"Juuoki (set 3, Japan, FD1094 317-0068)\0\u7363\u738B\u8A18\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521 | HARDWARE_SEGA_FD1094_ENC, GBF_SCRFIGHT, 0, - NULL, Altbeastj3RomInfo, Altbeastj3RomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - Altbeast4Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeastj3d = { - "altbeastj3d", "altbeast", NULL, NULL, "1988", - "Juuouki (set 3, Japan, FD1094 317-0068 decrypted)\0", NULL, "Sega", "System 16B", - L"Juuoki (set 3, Japan, FD1094 317-0068 decrypted)\0\u7363\u738B\u8A18\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_SCRFIGHT, 0, - NULL, Altbeastj3dRomInfo, Altbeastj3dRomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - Altbeast4Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeast4 = { - "altbeast4", "altbeast", NULL, NULL, "1988", - "Altered Beast (set 4, MC-8123B 317-0066)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521 | HARDWARE_SEGA_MC8123_ENC, GBF_SCRFIGHT, 0, - NULL, Altbeast4RomInfo, Altbeast4RomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - Altbeast4Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeast5 = { - "altbeast5", "altbeast", NULL, NULL, "1988", - "Altered Beast (set 5, FD1094 317-0069)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521 | HARDWARE_SEGA_FD1094_ENC, GBF_SCRFIGHT, 0, - NULL, Altbeast5RomInfo, Altbeast5RomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - Altbeast4Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeast5d = { - "altbeast5d", "altbeast", NULL, NULL, "1988", - "Altered Beast (set 5, FD1094 317-0069 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_SCRFIGHT, 0, - NULL, Altbeast5dRomInfo, Altbeast5dRomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - Altbeast4Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAltbeast6 = { - "altbeast6", "altbeast", NULL, NULL, "1988", - "Altered Beast (set 6, 8751 317-0076)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_SCRFIGHT, 0, - NULL, Altbeast6RomInfo, Altbeast6RomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - Altbeast6Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvAltbeastbl = { - "altbeastbl", "altbeast", NULL, NULL, "1988", - "Altered Beast (Datsu bootleg)\0", "no Sound", "bootleg (Datsu)", "System 16B", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358 | HARDWARE_SEGA_INVERT_TILES, GBF_SCRFIGHT, 0, - NULL, AltbeastblRomInfo, AltbeastblRomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - AltbeastblInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvMutantwarr = { - "mutantwarr", "altbeast", NULL, NULL, "1988", - "Mutant Warrior (Altered Beast - Datsu bootleg)\0", "no Sound", "bootleg (Datsu)", "System 16B", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358 | HARDWARE_SEGA_INVERT_TILES, GBF_SCRFIGHT, 0, - NULL, MutantwarrRomInfo, MutantwarrRomName, NULL, NULL, System16bfire3InputInfo, AltbeastDIPInfo, - AltbeastblInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAtomicp = { - "atomicp", NULL, NULL, NULL, "1990", - "Atomic Point (Korea)\0", NULL, "Philco", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_YM2413, GBF_MISC, 0, - NULL, AtomicpRomInfo, AtomicpRomName, NULL, NULL, AtomicpInputInfo, AtomicpDIPInfo, - AtomicpInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAurail = { - "aurail", NULL, NULL, NULL, "1990", - "Aurail (set 3, US, unprotected)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_VERSHOOT, 0, - NULL, AurailRomInfo, AurailRomName, NULL, NULL, System16bfire3InputInfo, AurailDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAurail1 = { - "aurail1", "aurail", NULL, NULL, "1990", - "Aurail (set 2, World, FD1089B 317-0168)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1089B_ENC, GBF_VERSHOOT, 0, - NULL, Aurail1RomInfo, Aurail1RomName, NULL, NULL, System16bfire3InputInfo, AurailDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAurail1d = { - "aurail1d", "aurail", NULL, NULL, "1990", - "Aurail (set 2, World, FD1089B 317-0168 decrypted)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_VERSHOOT, 0, - NULL, Aurail1dRomInfo, Aurail1dRomName, NULL, NULL, System16bfire3InputInfo, AurailDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAurailj = { - "aurailj", "aurail", NULL, NULL, "1990", - "Aurail (set 1, Japan, FD1089A 317-0167)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1089A_ENC, GBF_VERSHOOT, 0, - NULL, AurailjRomInfo, AurailjRomName, NULL, NULL, System16bfire3InputInfo, AurailDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAurailjd = { - "aurailjd", "aurail", NULL, NULL, "1990", - "Aurail (set 1, Japan, FD1089A 317-0167 decrypted)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_VERSHOOT, 0, - NULL, AurailjdRomInfo, AurailjdRomName, NULL, NULL, System16bfire3InputInfo, AurailDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBayroute = { - "bayroute", NULL, NULL, NULL, "1989", - "Bay Route (set 3, World, FD1094 317-0116)\0", NULL, "Sunsoft / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, BayrouteRomInfo, BayrouteRomName, NULL, NULL, System16bfire3InputInfo, BayrouteDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBayrouted = { - "bayrouted", "bayroute", NULL, NULL, "1989", - "Bay Route (set 3, World, FD1094 317-0116 decrypted)\0", NULL, "Sunsoft / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_PLATFORM, 0, - NULL, BayroutedRomInfo, BayroutedRomName, NULL, NULL, System16bfire3InputInfo, BayrouteDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBayroutej = { - "bayroutej", "bayroute", NULL, NULL, "1989", - "Bay Route (set 2, Japan, FD1094 317-0115)\0", NULL, "Sunsoft / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, BayroutejRomInfo, BayroutejRomName, NULL, NULL, System16bfire3InputInfo, BayrouteDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBayroutejd = { - "bayroutejd", "bayroute", NULL, NULL, "1989", - "Bay Route (set 2, Japan, FD1094 317-0115 decrypted)\0", NULL, "Sunsoft / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_PLATFORM, 0, - NULL, BayroutejdRomInfo, BayroutejdRomName, NULL, NULL, System16bfire3InputInfo, BayrouteDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBayroute1 = { - "bayroute1", "bayroute", NULL, NULL, "1989", - "Bay Route (set 1, US, unprotected)\0", "", "Sunsoft / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_PLATFORM, 0, - NULL, Bayroute1RomInfo, Bayroute1RomName, NULL, NULL, System16bfire3InputInfo, BayrouteDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBlox16b = { - "blox16b", "bloxeed", NULL, NULL, "2008", - "Bloxeed (System 16B, PS2 data file)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704_PS2, GBF_PUZZLE, 0, - NULL, Blox16bRomInfo, Blox16bRomName, NULL, NULL, System16bfire3InputInfo, Blox16bDIPInfo, - Blox16bInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBullet = { - "bullet", NULL, NULL, NULL, "1987", - "Bullet (FD1094 317-0041)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_5358_SMALL, GBF_VERSHOOT, 0, - NULL, BulletRomInfo, BulletRomName, NULL, NULL, BulletInputInfo, BulletDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBulletd = { - "bulletd", "bullet", NULL, NULL, "1987", - "Bullet (FD1094 317-0041 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_VERSHOOT, 0, - NULL, BulletdRomInfo, BulletdRomName, NULL, NULL, BulletInputInfo, BulletDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCotton = { - "cotton", NULL, NULL, NULL, "1991", - "Cotton (set 3, World, FD1094 317-0181a)\0", NULL, "Success / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_HORSHOOT, 0, - NULL, CottonRomInfo, CottonRomName, NULL, NULL, System16bInputInfo, CottonDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCottond = { - "cottond", "cotton", NULL, NULL, "1991", - "Cotton (set 3, World, FD1094 317-0181a decrypted)\0", NULL, "Success / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_HORSHOOT, 0, - NULL, CottondRomInfo, CottondRomName, NULL, NULL, System16bInputInfo, CottonDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCottonu = { - "cottonu", "cotton", NULL, NULL, "1991", - "Cotton (set 2, US, FD1094 317-0180)\0", NULL, "Success / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_HORSHOOT, 0, - NULL, CottonuRomInfo, CottonuRomName, NULL, NULL, System16bInputInfo, CottonDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCottonud = { - "cottonud", "cotton", NULL, NULL, "1991", - "Cotton (set 2, US, FD1094 317-0180 decrypted)\0", NULL, "Success / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_HORSHOOT, 0, - NULL, CottonudRomInfo, CottonudRomName, NULL, NULL, System16bInputInfo, CottonDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCottonj = { - "cottonj", "cotton", NULL, NULL, "1991", - "Cotton (set 2, Japan, Rev B, FD1094 317-0179b))\0", NULL, "Success / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_HORSHOOT, 0, - NULL, CottonjRomInfo, CottonjRomName, NULL, NULL, System16bInputInfo, CottonDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCottonjd = { - "cottonjd", "cotton", NULL, NULL, "1991", - "Cotton (set 2, Japan, Rev B, FD1094 317-0179b decrypted))\0", NULL, "Success / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_HORSHOOT, 0, - NULL, CottonjdRomInfo, CottonjdRomName, NULL, NULL, System16bInputInfo, CottonDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCottonja = { - "cottonja", "cotton", NULL, NULL, "1991", - "Cotton (set 1, Japan, Rev A, FD1094 317-0179a))\0", NULL, "Success / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_HORSHOOT, 0, - NULL, CottonjaRomInfo, CottonjaRomName, NULL, NULL, System16bInputInfo, CottonDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCottonjad = { - "cottonjad", "cotton", NULL, NULL, "1991", - "Cotton (set 1, Japan, Rev A, FD1094 317-0179a decrypted))\0", NULL, "Success / Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_HORSHOOT, 0, - NULL, CottonjadRomInfo, CottonjadRomName, NULL, NULL, System16bInputInfo, CottonDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdux = { - "ddux", NULL, NULL, NULL, "1989", - "Dynamite Dux (set 2, FD1094 317-0096)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521 | HARDWARE_SEGA_FD1094_ENC, GBF_SCRFIGHT, 0, - NULL, DduxRomInfo, DduxRomName, NULL, NULL, System16bInputInfo, DduxDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDduxd = { - "dduxd", "ddux", NULL, NULL, "1989", - "Dynamite Dux (set 2, FD1094 317-0096 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_SCRFIGHT, 0, - NULL, DduxdRomInfo, DduxdRomName, NULL, NULL, System16bInputInfo, DduxDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDduxj = { - "dduxj", "ddux", NULL, NULL, "1989", - "Dynamite Dux (set 2, Japan, FD1094 317-0094)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521 | HARDWARE_SEGA_FD1094_ENC, GBF_SCRFIGHT, 0, - NULL, DduxjRomInfo, DduxjRomName, NULL, NULL, System16bInputInfo, DduxDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDduxjd = { - "dduxjd", "ddux", NULL, NULL, "1989", - "Dynamite Dux (set 2, Japan, FD1094 317-0094 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_SCRFIGHT, 0, - NULL, DduxjdRomInfo, DduxjdRomName, NULL, NULL, System16bInputInfo, DduxDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdux1 = { - "ddux1", "ddux", NULL, NULL, "1989", - "Dynamite Dux (set 1, 8751 317-0095)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_SCRFIGHT, 0, - NULL, Ddux1RomInfo, Ddux1RomName, NULL, NULL, System16bInputInfo, DduxDIPInfo, - Ddux1Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDduxbl = { - "dduxbl", "ddux", NULL, NULL, "1989", - "Dynamite Dux (bootleg)\0", NULL, "bootleg", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_INVERT_TILES | HARDWARE_SEGA_5358, GBF_SCRFIGHT, 0, - NULL, DduxblRomInfo, DduxblRomName, NULL, NULL, System16bInputInfo, DduxDIPInfo, - DduxblInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDunkshot = { - "dunkshot", NULL, NULL, NULL, "1987", - "Dunk Shot (Rev C, FD1089 317-0022)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1089A_ENC | HARDWARE_SEGA_5358_SMALL, GBF_SPORTSMISC, 0, - NULL, DunkshotRomInfo, DunkshotRomName, NULL, NULL, DunkshotInputInfo, DunkshotDIPInfo, - DunkshotInit, DunkshotExit, System16BFrame, NULL, DunkshotScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDunkshota = { - "dunkshota", "dunkshot", NULL, NULL, "1987", - "Dunk Shot (Rev A, FD1089 317-0022)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1089A_ENC | HARDWARE_SEGA_5358_SMALL, GBF_SPORTSMISC, 0, - NULL, DunkshotaRomInfo, DunkshotaRomName, NULL, NULL, DunkshotInputInfo, DunkshotDIPInfo, - DunkshotInit, DunkshotExit, System16BFrame, NULL, DunkshotScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDunkshoto = { - "dunkshoto", "dunkshot", NULL, NULL, "1986", - "Dunk Shot (FD1089 317-0022)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1089A_ENC | HARDWARE_SEGA_5358_SMALL, GBF_SPORTSMISC, 0, - NULL, DunkshotoRomInfo, DunkshotoRomName, NULL, NULL, DunkshotInputInfo, DunkshotDIPInfo, - DunkshotInit, DunkshotExit, System16BFrame, NULL, DunkshotScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEswat = { - "eswat", NULL, NULL, NULL, "1989", - "E-Swat - Cyber Police (set 4, World, FD1094 317-0130)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, EswatRomInfo, EswatRomName, NULL, NULL, System16bfire3InputInfo, EswatDIPInfo, - EswatInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEswatd = { - "eswatd", "eswat", NULL, NULL, "1989", - "E-Swat - Cyber Police (set 4, World, FD1094 317-0130 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797, GBF_PLATFORM, 0, - NULL, EswatdRomInfo, EswatdRomName, NULL, NULL, System16bfire3InputInfo, EswatDIPInfo, - EswatInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEswatj = { - "eswatj", "eswat", NULL, NULL, "1989", - "E-Swat - Cyber Police (set 2, Japan, FD1094 317-0128)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, EswatjRomInfo, EswatjRomName, NULL, NULL, System16bfire3InputInfo, EswatDIPInfo, - EswatInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEswatjd = { - "eswatjd", "eswat", NULL, NULL, "1989", - "E-Swat - Cyber Police (set 2, Japan, FD1094 317-0128 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797, GBF_PLATFORM, 0, - NULL, EswatjdRomInfo, EswatjdRomName, NULL, NULL, System16bfire3InputInfo, EswatDIPInfo, - EswatInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEswatj1 = { - "eswatj1", "eswat", NULL, NULL, "1989", - "E-Swat - Cyber Police (set 1, Japan, FD1094 317-0131)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, Eswatj1RomInfo, Eswatj1RomName, NULL, NULL, System16bfire3InputInfo, EswatDIPInfo, - Eswatj1Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEswatj1d = { - "eswatj1d", "eswat", NULL, NULL, "1989", - "E-Swat - Cyber Police (set 1, Japan, FD1094 317-0131 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_PLATFORM, 0, - NULL, Eswatj1dRomInfo, Eswatj1dRomName, NULL, NULL, System16bfire3InputInfo, EswatDIPInfo, - Eswatj1Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEswatu = { - "eswatu", "eswat", NULL, NULL, "1989", - "E-Swat - Cyber Police (set 3, US, FD1094 317-0129)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, EswatuRomInfo, EswatuRomName, NULL, NULL, System16bfire3InputInfo, EswatDIPInfo, - EswatInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEswatud = { - "eswatud", "eswat", NULL, NULL, "1989", - "E-Swat - Cyber Police (set 3, US, FD1094 317-0129 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797, GBF_PLATFORM, 0, - NULL, EswatudRomInfo, EswatudRomName, NULL, NULL, System16bfire3InputInfo, EswatDIPInfo, - EswatInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEswatbl = { - "eswatbl", "eswat", NULL, NULL, "1989", - "E-Swat - Cyber Police (bootleg)\0", NULL, "bootleg", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797, GBF_PLATFORM, 0, - NULL, EswatblRomInfo, EswatblRomName, NULL, NULL, System16bfire3InputInfo, EswatDIPInfo, - EswatblInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvExctleag = { - "exctleag", NULL, NULL, NULL, "1989", - "Excite League (FD1094 317-0079)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, ExctleagRomInfo, ExctleagRomName, NULL, NULL, ExctleagInputInfo, ExctleagDIPInfo, - ExctleagInit, ExctleagExit, System16BFrame, NULL, ExctleagScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvExctleagd = { - "exctleagd", "exctleag", NULL, NULL, "1989", - "Excite League (FD1094 317-0079 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, ExctleagdRomInfo, ExctleagdRomName, NULL, NULL, ExctleagInputInfo, ExctleagDIPInfo, - ExctleagInit, ExctleagExit, System16BFrame, NULL, ExctleagScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantzoneta = { - "fantzoneta", "fantzone", NULL, NULL, "2008", - "Fantasy Zone (Time Attack, bootleg)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_HORSHOOT, 0, - NULL, FantzonetaRomInfo, FantzonetaRomName, NULL, NULL, System16bInputInfo, FantzonetaDIPInfo, - FantzonetaInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantzn2x = { - "fantzn2x", NULL, NULL, NULL, "2008", - "Fantasy Zone II - The Tears of Opa-Opa (System 16C)\0", NULL, "Sega / M2", "System 16C", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704_PS2, GBF_HORSHOOT, 0, - NULL, Fantzn2xRomInfo, Fantzn2xRomName, NULL, NULL, System16bInputInfo, Fantzn2xDIPInfo, - Fantzn2xInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantzn2xp = { - "fantzn2xp", "fantzn2x", NULL, NULL, "2008", - "Fantasy Zone II - The Tears of Opa-Opa (System 16C, prototype)\0", NULL, "Sega / M2", "System 16C", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704_PS2, GBF_HORSHOOT, 0, - NULL, Fantzn2xpRomInfo, Fantzn2xpRomName, NULL, NULL, System16bInputInfo, Fantzn2xDIPInfo, - Fantzn2xInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantzn2xps2 = { - "fantzn2xps2", "fantzn2x", NULL, NULL, "2008", - "Fantasy Zone II - The Tears of Opa-Opa (System 16C, PS2 data file)\0", NULL, "Sega / M2", "System 16C", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704_PS2, GBF_HORSHOOT, 0, - NULL, Fantzn2xps2RomInfo, Fantzn2xps2RomName, NULL, NULL, System16bInputInfo, Fantzn2xDIPInfo, - Fantzn2xps2Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFantznta = { - "fantznta", "fantzn2x", NULL, NULL, "2008", - "Fantasy Zone Time Attack (System 16B, PS2 data file)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704_PS2, GBF_HORSHOOT, 0, - NULL, FantzntaRomInfo, FantzntaRomName, NULL, NULL, System16bInputInfo, Fantzn2xDIPInfo, - FantzntaInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFpoint = { - "fpoint", NULL, NULL, NULL, "1989", - "Flash Point (set 2, Japan, FD1094 317-0127A)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_5358, GBF_PUZZLE, 0, - NULL, FpointRomInfo, FpointRomName, NULL, NULL, System16bfire1InputInfo, FpointDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFpointd = { - "fpointd", "fpoint", NULL, NULL, "1989", - "Flash Point (set 2, Japan, FD1094 317-0127A decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_PUZZLE, 0, - NULL, FpointdRomInfo, FpointdRomName, NULL, NULL, System16bfire1InputInfo, FpointDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFpoint1 = { - "fpoint1", "fpoint", NULL, NULL, "1989", - "Flash Point (set 1, Japan, FD1094 317-0127A)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_PUZZLE, 0, - NULL, Fpoint1RomInfo, Fpoint1RomName, NULL, NULL, System16bfire1InputInfo, FpointDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFpoint1d = { - "fpoint1d", "fpoint", NULL, NULL, "1989", - "Flash Point (set 1, Japan, FD1094 317-0127A decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_PUZZLE, 0, - NULL, Fpoint1dRomInfo, Fpoint1dRomName, NULL, NULL, System16bfire1InputInfo, FpointDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFpointbl = { - "fpointbl", "fpoint", NULL, NULL, "1989", - "Flash Point (World, bootleg)\0", NULL, "bootleg", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_INVERT_TILES, GBF_PUZZLE, 0, - NULL, FpointblRomInfo, FpointblRomName, NULL, NULL, FpointblInputInfo, FpointDIPInfo, - FpointblInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFpointbj = { - "fpointbj", "fpoint", NULL, NULL, "1989", - "Flash Point (Japan, bootleg)\0", NULL, "bootleg", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_INVERT_TILES, GBF_PUZZLE, 0, - NULL, FpointbjRomInfo, FpointbjRomName, NULL, NULL, FpointblInputInfo, FpointDIPInfo, - FpointblInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxe = { - "goldnaxe", NULL, NULL, NULL, "1989", - "Golden Axe (set 6, US, 8751 317-123A)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797, GBF_SCRFIGHT, 0, - NULL, GoldnaxeRomInfo, GoldnaxeRomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - GoldnaxeInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxe1 = { - "goldnaxe1", "goldnaxe", NULL, NULL, "1989", - "Golden Axe (set 1, World, FD1094 317-0110)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797 | HARDWARE_SEGA_FD1094_ENC, GBF_SCRFIGHT, 0, - NULL, Goldnaxe1RomInfo, Goldnaxe1RomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - Goldnaxe3Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxe1d = { - "goldnaxe1d", "goldnaxe", NULL, NULL, "1989", - "Golden Axe (set 1, World, FD1094 317-0110 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797, GBF_SCRFIGHT, 0, - NULL, Goldnaxe1dRomInfo, Goldnaxe1dRomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - Goldnaxe3Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxe2 = { - "goldnaxe2", "goldnaxe", NULL, NULL, "1989", - "Golden Axe (set 2, US, 8751 317-0112)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_SCRFIGHT, 0, - NULL, Goldnaxe2RomInfo, Goldnaxe2RomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - Goldnaxe2Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxe3 = { - "goldnaxe3", "goldnaxe", NULL, NULL, "1989", - "Golden Axe (set 3, World, FD1094 317-0120)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_SCRFIGHT, 0, - NULL, Goldnaxe3RomInfo, Goldnaxe3RomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - Goldnaxe3Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxe3d = { - "goldnaxe3d", "goldnaxe", NULL, NULL, "1989", - "Golden Axe (set 3, World, FD1094 317-0120 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_SCRFIGHT, 0, - NULL, Goldnaxe3dRomInfo, Goldnaxe3dRomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - Goldnaxe3Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxej = { - "goldnaxej", "goldnaxe", NULL, NULL, "1989", - "Golden Axe (set 4, Japan, FD1094 317-0121)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_SCRFIGHT, 0, - NULL, GoldnaxejRomInfo, GoldnaxejRomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - Goldnaxe3Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxejd = { - "goldnaxejd", "goldnaxe", NULL, NULL, "1989", - "Golden Axe (set 4, Japan, FD1094 317-0121 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_SCRFIGHT, 0, - NULL, GoldnaxejdRomInfo, GoldnaxejdRomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - Goldnaxe3Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxeu = { - "goldnaxeu", "goldnaxe", NULL, NULL, "1989", - "Golden Axe (set 5, US, FD1094 317-0122)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797 | HARDWARE_SEGA_FD1094_ENC, GBF_SCRFIGHT, 0, - NULL, GoldnaxeuRomInfo, GoldnaxeuRomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - Goldnaxe3Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGoldnaxeud = { - "goldnaxeud", "goldnaxe", NULL, NULL, "1989", - "Golden Axe (set 5, US, FD1094 317-0122 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797, GBF_SCRFIGHT, 0, - NULL, GoldnaxeudRomInfo, GoldnaxeudRomName, NULL, NULL, System16bfire3InputInfo, GoldnaxeDIPInfo, - Goldnaxe3Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHwchamp = { - "hwchamp", NULL, NULL, NULL, "1987", - "Heavyweight Champ\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_VSFIGHT, 0, - NULL, HwchampRomInfo, HwchampRomName, NULL, NULL, HwchampInputInfo, HwchampDIPInfo, - HwchampInit, HwchampExit, System16BFrame, NULL, HwchampScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHwchampj = { - "hwchampj", "hwchamp", NULL, NULL, "1987", - "Heavyweight Champ (Japan, FD1094 317-0046)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521 | HARDWARE_SEGA_FD1094_ENC, GBF_VSFIGHT, 0, - NULL, HwchampjRomInfo, HwchampjRomName, NULL, NULL, HwchampInputInfo, HwchampDIPInfo, - HwchampInit, HwchampExit, System16BFrame, NULL, HwchampScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHwchampjd = { - "hwchampjd", "hwchamp", NULL, NULL, "1987", - "Heavyweight Champ (Japan, FD1094 317-0046 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_VSFIGHT, 0, - NULL, HwchampjdRomInfo, HwchampjdRomName, NULL, NULL, HwchampInputInfo, HwchampDIPInfo, - HwchampInit, HwchampExit, System16BFrame, NULL, HwchampScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLockonph = { - "lockonph", NULL, NULL, NULL, "1991", - "Lock On (Philko)\0", NULL, "Philco", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B, GBF_MISC, 0, - NULL,LockonphRomInfo, LockonphRomName, NULL, NULL, LockonphInputInfo, LockonphDIPInfo, - LockonphInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMvp = { - "mvp", NULL, NULL, NULL, "1989", - "MVP (set 2, US, FD1094 317-0143)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797 | HARDWARE_SEGA_FD1094_ENC, GBF_SPORTSMISC, 0, - NULL, MvpRomInfo, MvpRomName, NULL, NULL, System16bfire3InputInfo, MvpDIPInfo, - MvpInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMvpd = { - "mvpd", "mvp", NULL, NULL, "1989", - "MVP (set 2, US, FD1094 317-0143 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797, GBF_SPORTSMISC, 0, - NULL, MvpdRomInfo, MvpdRomName, NULL, NULL, System16bfire3InputInfo, MvpDIPInfo, - MvpInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMvpj = { - "mvpj", "mvp", NULL, NULL, "1989", - "MVP (set 1, Japan, FD1094 317-0142)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_SPORTSMISC, 0, - NULL, MvpjRomInfo, MvpjRomName, NULL, NULL, System16bfire3InputInfo, MvpDIPInfo, - MvpjInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMvpjd = { - "mvpjd", "mvp", NULL, NULL, "1989", - "MVP (set 1, Japan, FD1094 317-0142 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_SPORTSMISC, 0, - NULL, MvpjdRomInfo, MvpjdRomName, NULL, NULL, System16bfire3InputInfo, MvpDIPInfo, - MvpjInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPasssht = { - "passsht", NULL, NULL, NULL, "1988", - "Passing Shot (World, 2 Players, FD1094 317-0080)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, PassshtRomInfo, PassshtRomName, NULL, NULL, System16bfire4InputInfo, PassshtDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvPassshtd = { - "passshtd", "passsht", NULL, NULL, "1988", - "Passing Shot (World, 2 Players, FD1094 317-0080 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, PassshtdRomInfo, PassshtdRomName, NULL, NULL, System16bfire4InputInfo, PassshtDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvPassshta = { - "passshta", "passsht", NULL, NULL, "1988", - "Passing Shot (World, 4 Players, FD1094 317-0074)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, PassshtaRomInfo, PassshtaRomName, NULL, NULL, PassshtInputInfo, PassshtaDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvPassshtad = { - "passshtad", "passsht", NULL, NULL, "1988", - "Passing Shot (World, 4 Players, FD1094 317-0074 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, PassshtadRomInfo, PassshtadRomName, NULL, NULL, PassshtInputInfo, PassshtaDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvPassshtj = { - "passshtj", "passsht", NULL, NULL, "1988", - "Passing Shot (Japan, 4 Players, FD1094 317-0070)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, PassshtjRomInfo, PassshtjRomName, NULL, NULL, PassshtInputInfo, PassshtaDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvPassshtjd = { - "passshtjd", "passsht", NULL, NULL, "1988", - "Passing Shot (Japan, 4 Players, FD1094 317-0070 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, PassshtjdRomInfo, PassshtjdRomName, NULL, NULL, PassshtInputInfo, PassshtaDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriverD BurnDrvPassshtb = { - "passshtb", "passsht", NULL, NULL, "1988", - "Passing Shot (bootleg, 2 Players)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - 0 | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, PassshtbRomInfo, PassshtbRomName, NULL, NULL, PassshtInputInfo, PassshtDIPInfo, - PassshtbInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvCencourt = { - "cencourt", "passsht", NULL, NULL, "1988", - "Center Court (World, 4 Players, prototype, MC-8123B)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 4, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358 | HARDWARE_SEGA_MC8123_ENC, GBF_SPORTSMISC, 0, - NULL, CencourtRomInfo, CencourtRomName, NULL, NULL, PassshtInputInfo, CencourtDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvRiotcity = { - "riotcity", NULL, NULL, NULL, "1991", - "Riot City (Japan)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_SCRFIGHT, 0, - NULL, RiotcityRomInfo, RiotcityRomName, NULL, NULL, System16bInputInfo, RiotcityDIPInfo, - RiotcityInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRyukyu = { - "ryukyu", NULL, NULL, NULL, "1990", - "RyuKyu (Japan, FD1094 317-5023)\0", NULL, "Success / Sega", "System 16B", - L"RyuKyu \u7409\u7403 (Japan, FD1094 317-5023)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_PUZZLE, 0, - NULL, RyukyuRomInfo, RyukyuRomName, NULL, NULL, RyukyuInputInfo, RyukyuDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRyukyud = { - "ryukyud", "ryukyu", NULL, NULL, "1990", - "RyuKyu (Japan, FD1094 317-5023 decrypted)\0", NULL, "Success / Sega", "System 16B", - L"RyuKyu \u7409\u7403 (Japan, FD1094 317-5023 decrypted)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_PUZZLE, 0, - NULL, RyukyudRomInfo, RyukyudRomName, NULL, NULL, RyukyuInputInfo, RyukyuDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSdib = { - "sdib", "sdi", NULL, NULL, "1987", - "SDI - Strategic Defense Initiative (System 16B, FD1089A 317-0028)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1089A_ENC | HARDWARE_SEGA_5358_SMALL, GBF_SHOOT, 0, - NULL, SdibRomInfo, SdibRomName, NULL, NULL, SdiInputInfo, SdibDIPInfo, - SdibInit, SdibExit, System16BFrame, NULL, SdibScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSdibl = { - "sdibl", "sdi", NULL, NULL, "1987", - "SDI - Strategic Defense Initiative (bootleg, original hardware)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_SHOOT, 0, - NULL, SdiblRomInfo, SdiblRomName, NULL, NULL, SdiInputInfo, SdibDIPInfo, - SdiblInit, SdibExit, System16BFrame, NULL, SdibScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSdibl2 = { - "sdibl2", "sdi", NULL, NULL, "1987", - "SDI - Strategic Defense Initiative (bootleg, set 1)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_SHOOT, 0, - NULL, Sdibl2RomInfo, Sdibl2RomName, NULL, NULL, SdiInputInfo, SdibDIPInfo, - Sdibl2Init, SdibExit, System16BFrame, NULL, SdibScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSdibl3 = { - "sdibl3", "sdi", NULL, NULL, "1987", - "SDI - Strategic Defense Initiative (bootleg, set 2)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_SHOOT, 0, - NULL, Sdibl3RomInfo, Sdibl3RomName, NULL, NULL, SdiInputInfo, SdibDIPInfo, - Sdibl2Init, SdibExit, System16BFrame, NULL, SdibScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSdibl4 = { - "sdibl4", "sdi", NULL, NULL, "1987", - "SDI - Strategic Defense Initiative (bootleg, set 3)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_SHOOT, 0, - NULL, Sdibl4RomInfo, Sdibl4RomName, NULL, NULL, SdiInputInfo, SdibDIPInfo, - Sdibl2Init, SdibExit, System16BFrame, NULL, SdibScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSdibl5 = { - "sdibl5", "sdi", NULL, NULL, "1987", - "SDI - Strategic Defense Initiative (bootleg, set 4)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_SHOOT, 0, - NULL, Sdibl5RomInfo, Sdibl5RomName, NULL, NULL, SdiInputInfo, SdibDIPInfo, - Sdibl2Init, SdibExit, System16BFrame, NULL, SdibScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSdibl6 = { - "sdibl6", "sdi", NULL, NULL, "1987", - "SDI - Strategic Defense Initiative (bootleg, set 5)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_SHOOT, 0, - NULL, Sdibl6RomInfo, Sdibl6RomName, NULL, NULL, SdiInputInfo, SdibDIPInfo, - Sdibl2Init, SdibExit, System16BFrame, NULL, SdibScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDefense = { - "defense", "sdi", NULL, NULL, "1987", - "Defense (System 16B, FD1089A 317-0028)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1089A_ENC | HARDWARE_SEGA_5358_SMALL, GBF_SHOOT, 0, - NULL, DefenseRomInfo, DefenseRomName, NULL, NULL, SdiInputInfo, SdibDIPInfo, - SdibInit, SdibExit, System16BFrame, NULL, SdibScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinobi2 = { - "shinobi2", "shinobi", NULL, NULL, "1987", - "Shinobi (set 2, System 16B, FD1094 317-0049)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, Shinobi2RomInfo, Shinobi2RomName, NULL, NULL, System16bfire3InputInfo, ShinobiDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinobi2d = { - "shinobi2d", "shinobi", NULL, NULL, "1987", - "Shinobi (set 2, System 16B, FD1094 317-0049 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_PLATFORM, 0, - NULL, Shinobi2dRomInfo, Shinobi2dRomName, NULL, NULL, System16bfire3InputInfo, ShinobiDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinobi3 = { - "shinobi3", "shinobi", NULL, NULL, "1987", - "Shinobi (set 3, System 16B, MC-8123B 317-0054)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358 | HARDWARE_SEGA_MC8123_ENC, GBF_PLATFORM, 0, - NULL, Shinobi3RomInfo, Shinobi3RomName, NULL, NULL, System16bfire3InputInfo, ShinobiDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinobi4 = { - "shinobi4", "shinobi", NULL, NULL, "1987", - "Shinobi (set 4, System 16B, MC-8123B 317-0054)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521 | HARDWARE_SEGA_MC8123_ENC, GBF_PLATFORM, 0, - NULL, Shinobi4RomInfo, Shinobi4RomName, NULL, NULL, System16bfire3InputInfo, ShinobiDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinobi5 = { - "shinobi5", "shinobi", NULL, NULL, "1987", - "Shinobi (set 5, System 16B, unprotected)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5521, GBF_PLATFORM, 0, - NULL, Shinobi5RomInfo, Shinobi5RomName, NULL, NULL, System16bfire3InputInfo, ShinobiDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSjryuko = { - "sjryuko", NULL, NULL, NULL, "1987", - "Sukeban Jansi Ryuko (set 2, System 16B, FD1089B 317-5021)\0", NULL, "White Board", "System 16B", - L"Sukeban Jansi Ryuko (set 2, System 16B, FD1089B 317-5021)\0\u30B9\u30B1\u30D0\u30F3\u96C0\u58EB \u7ADC\u5B50\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1089B_ENC | HARDWARE_SEGA_5358_SMALL, GBF_MAHJONG, 0, - NULL, SjryukoRomInfo, SjryukoRomName, NULL, NULL, SjryukoInputInfo, SjryukoDIPInfo, - SjryukoInit, SjryukoExit, System16BFrame, NULL, SjryukoScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSnapper = { - "snapper", NULL, NULL, NULL, "1990", - "Snapper (Korea)\0", NULL, "Philko", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_YM2413, GBF_MISC, 0, - NULL, SnapperRomInfo, SnapperRomName, NULL, NULL, SnapperInputInfo, SnapperDIPInfo, - SnapperInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSonicbom = { - "sonicbom", NULL, NULL, NULL, "1987", - "Sonic Boom (FD1094 317-0053)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358 | HARDWARE_SEGA_FD1094_ENC, GBF_VERSHOOT, 0, - NULL, SonicbomRomInfo, SonicbomRomName, NULL, NULL, System16bInputInfo, SonicbomDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvSonicbomd = { - "sonicbomd", "sonicbom", NULL, NULL, "1987", - "Sonic Boom (FD1094 317-0053 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_VERSHOOT, 0, - NULL, SonicbomdRomInfo, SonicbomdRomName, NULL, NULL, System16bInputInfo, SonicbomDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvSuprleag = { - "suprleag", NULL, NULL, NULL, "1987", - "Super League (FD1094 317-0045)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_5358, GBF_SPORTSMISC, 0, - NULL, SuprleagRomInfo, SuprleagRomName, NULL, NULL, ExctleagInputInfo, ExctleagDIPInfo, - ExctleagInit, ExctleagExit, System16BFrame, NULL, ExctleagScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetris1 = { - "tetris1", "tetris", NULL, NULL, "1988", - "Tetris (set 1, Japan, System 16B, FD1094 317-0091)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL | HARDWARE_SEGA_FD1094_ENC, GBF_PUZZLE, 0, - NULL, Tetris1RomInfo, Tetris1RomName, NULL, NULL, System16bfire1InputInfo, TetrisDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetris1d = { - "tetris1d", "tetris", NULL, NULL, "1988", - "Tetris (set 1, Japan, System 16B, FD1094 317-0091 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_PUZZLE, 0, - NULL, Tetris1dRomInfo, Tetris1dRomName, NULL, NULL, System16bfire1InputInfo, TetrisDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetris2 = { - "tetris2", "tetris", NULL, NULL, "1988", - "Tetris (set 2, Japan, System 16B, FD1094 317-0092)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_PUZZLE, 0, - NULL, Tetris2RomInfo, Tetris2RomName, NULL, NULL, System16bfire1InputInfo, TetrisDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetris2d = { - "tetris2d", "tetris", NULL, NULL, "1988", - "Tetris (set 2, Japan, System 16B, FD1094 317-0092 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_PUZZLE, 0, - NULL, Tetris2dRomInfo, Tetris2dRomName, NULL, NULL, System16bfire1InputInfo, TetrisDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetrisbl = { - "tetrisbl", "tetris", NULL, NULL, "1988", - "Tetris (bootleg)\0", NULL, "bootleg", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B, GBF_PUZZLE, 0, - NULL, TetrisblRomInfo, TetrisblRomName, NULL, NULL, System16bfire1InputInfo, TetrisDIPInfo, - TetrisblInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTimescan = { - "timescan", NULL, NULL, NULL, "1987", - "Time Scanner (set 2, System 16B)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358_SMALL, GBF_PINBALL, 0, - NULL, TimescanRomInfo, TimescanRomName, NULL, NULL, System16bDip3InputInfo, TimescanDIPInfo, - TimescanInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvToryumon = { - "toryumon", NULL, NULL, NULL, "1994", - "Toryumon\0", NULL, "Sega / Westone", "System 16B", - L"Toryumon\0\u767B\u9F8D\u9580\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5797, GBF_PUZZLE, 0, - NULL, ToryumonRomInfo, ToryumonRomName, NULL, NULL, System16bfire1InputInfo, ToryumonDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTturf = { - "tturf", NULL, NULL, NULL, "1989", - "Tough Turf (set 2, Japan, 8751 317-0104)\0", NULL, "Sega / Sunsoft", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_SCRFIGHT, 0, - NULL, TturfRomInfo, TturfRomName, NULL, NULL, System16bfire3InputInfo, TturfDIPInfo, - TturfInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTturfu = { - "tturfu", "tturf", NULL, NULL, "1989", - "Tough Turf (set 1, US, 8751 317-0099)\0", NULL, "Sega / Sunsoft", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_SCRFIGHT, 0, - NULL, TturfuRomInfo, TturfuRomName, NULL, NULL, System16bfire3InputInfo, TturfDIPInfo, - TturfuInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb3 = { - "wb3", NULL, NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 6, World, System 16B, 8751 317-0098)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_PLATFORM, 0, - NULL, Wb3RomInfo, Wb3RomName, NULL, NULL, System16bInputInfo, Wb3DIPInfo, - Wb3Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb32 = { - "wb32", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 2, Japan, System 16B, FD1094 317-0085)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, Wb32RomInfo, Wb32RomName, NULL, NULL, System16bInputInfo, Wb3DIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb32d = { - "wb32d", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 2, Japan, System 16B, FD1094 317-0085 decrypted)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5358, GBF_PLATFORM, 0, - NULL, Wb32dRomInfo, Wb32dRomName, NULL, NULL, System16bInputInfo, Wb3DIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb33 = { - "wb33", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 3, World, System 16B, FD1094 317-0089)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, Wb33RomInfo, Wb33RomName, NULL, NULL, System16bInputInfo, Wb3DIPInfo, - Wb33Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb33d = { - "wb33d", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 3, World, System 16B, FD1094 317-0089 decrypted)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_PLATFORM, 0, - NULL, Wb33dRomInfo, Wb33dRomName, NULL, NULL, System16bInputInfo, Wb3DIPInfo, - Wb33Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb34 = { - "wb34", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 4, Japan, System 16B, FD1094 317-0087)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_PLATFORM, 0, - NULL, Wb34RomInfo, Wb34RomName, NULL, NULL, System16bInputInfo, Wb3DIPInfo, - Wb33Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWb34d = { - "wb34d", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (set 4, Japan, System 16B, FD1094 317-0087 decrypted)\0", NULL, "Sega / Westone", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_PLATFORM, 0, - NULL, Wb34dRomInfo, Wb34dRomName, NULL, NULL, System16bInputInfo, Wb3DIPInfo, - Wb33Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvWb3bbl = { - "wb3bbl", "wb3", NULL, NULL, "1988", - "Wonder Boy III - Monster Lair (bootleg)\0", NULL, "bootleg", "System 16B", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_INVERT_TILES, GBF_PLATFORM, 0, - NULL, Wb3bblRomInfo, Wb3bblRomName, NULL, NULL, System16bInputInfo, Wb3DIPInfo, - Wb3bblInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWrestwar = { - "wrestwar", NULL, NULL, NULL, "1988", - "Wrestle War (set 3, World, 8751 317-0103)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_VSFIGHT, 0, - NULL, WrestwarRomInfo, WrestwarRomName, NULL, NULL, System16bInputInfo, WrestwarDIPInfo, - WrestwarInit, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvWrestwar1 = { - "wrestwar1", "wrestwar", NULL, NULL, "1988", - "Wrestle War (set 1, Japan, FD1094 317-0090)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_VSFIGHT, 0, - NULL, Wrestwar1RomInfo, Wrestwar1RomName, NULL, NULL, System16bInputInfo, WrestwarDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvWrestwar1d = { - "wrestwar1d", "wrestwar", NULL, NULL, "1988", - "Wrestle War (set 1, Japan, FD1094 317-0090 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_VSFIGHT, 0, - NULL, Wrestwar1dRomInfo, Wrestwar1dRomName, NULL, NULL, System16bInputInfo, WrestwarDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvWrestwar2 = { - "wrestwar2", "wrestwar", NULL, NULL, "1988", - "Wrestle War (set 2, World, FD1094 317-0102)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704 | HARDWARE_SEGA_FD1094_ENC, GBF_VSFIGHT, 0, - NULL, Wrestwar2RomInfo, Wrestwar2RomName, NULL, NULL, System16bInputInfo, WrestwarDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvWrestwar2d = { - "wrestwar2d", "wrestwar", NULL, NULL, "1988", - "Wrestle War (set 2, World, FD1094 317-0102 decrypted)\0", NULL, "Sega", "System 16B", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_5704, GBF_VSFIGHT, 0, - NULL, Wrestwar2dRomInfo, Wrestwar2dRomName, NULL, NULL, System16bInputInfo, WrestwarDIPInfo, - System16Init, System16Exit, System16BFrame, NULL, System16Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -// ISG Selection Master Type 2006 hardware - -static UINT16 IsgsmCartAddrLatch; -static UINT32 IsgsmCartAddr; -static INT32 IsgsmType = 0; -static UINT32 IsgsmAddr; -static UINT8 IsgsmMode; -static UINT16 IsgsmAddrLatch; -static UINT32 IsgsmSecurity; -static UINT16 IsgsmSecurityLatch; -static UINT8 IsgsmRleControlPosition = 8; -static UINT8 IsgsmRleControlByte; -static INT32 IsgsmRleLatched; -static UINT8 IsgsmRleByte; -static UINT8 IsgsmReadXor; -static UINT32 nCartSize; -static INT32 GameRomMapped = 0; - -typedef UINT32 (*isgsm_security_callback)(UINT32 input); -isgsm_security_callback IsgsmSecurityCallback; - -static INT32 IsgsmTilePlaneOffsets[3] = { 0x200000, 0x100000, 0 }; -static INT32 IsgsmTileXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 IsgsmTileYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; - -static struct BurnDIPInfo ShinfzDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfc, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x13, 0x01, 0x0c, 0x08, "2" }, - {0x13, 0x01, 0x0c, 0x0c, "3" }, - {0x13, 0x01, 0x0c, 0x04, "4" }, - {0x13, 0x01, 0x0c, 0x00, "240" }, - - {0 , 0xfe, 0 , 4 , "Extra Ship Cost" }, - {0x13, 0x01, 0x30, 0x30, "5000" }, - {0x13, 0x01, 0x30, 0x20, "10000" }, - {0x13, 0x01, 0x30, 0x10, "15000" }, - {0x13, 0x01, 0x30, 0x00, "20000" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x13, 0x01, 0xc0, 0x80, "Easy" }, - {0x13, 0x01, 0xc0, 0xc0, "Normal" }, - {0x13, 0x01, 0xc0, 0x40, "Hard" }, - {0x13, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 3 , "Game Select" }, - {0x15, 0x01, 0x03, 0x00, "Shinobi Ninja Game" }, - {0x15, 0x01, 0x03, 0x01, "FZ-2006 Game I" }, - {0x15, 0x01, 0x03, 0x02, "FZ-2006 Game II" }, -}; - -STDDIPINFO(Shinfz) - -static struct BurnDIPInfo TetrbxDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - // Dip 1 - - // Dip 2 - - // Dip 3 - {0 , 0xfe, 0 , 3 , "Game Select" }, - {0x15, 0x01, 0x03, 0x00, "Tetris" }, - {0x15, 0x01, 0x03, 0x01, "Tetris II (Blox)" }, - {0x15, 0x01, 0x03, 0x02, "Tetris Turbo" }, -}; - -STDDIPINFO(Tetrbx) - -static struct BurnRomInfo emptyRomDesc[] = { - { "", 0, 0, 0 }, -}; - -static struct BurnRomInfo IsgsmRomDesc[] = { - { "ism2006v00.u1", 0x020000, 0x2292585c, BRF_ESS | BRF_PRG | BRF_BIOS }, -}; - -STD_ROM_PICK(Isgsm) -STD_ROM_FN(Isgsm) - -static struct BurnRomInfo ShinfzRomDesc[] = { - { "shin06.u13", 0x200000, 0x39d773e9, BRF_ESS | BRF_PRG }, -}; - -STDROMPICKEXT(Shinfz, Shinfz, Isgsm) -STD_ROM_FN(Shinfz) - -static struct BurnRomInfo TetrbxRomDesc[] = { - { "tetr06.u13", 0x080000, 0x884dd693, BRF_ESS | BRF_PRG }, -}; - -STDROMPICKEXT(Tetrbx, Tetrbx, Isgsm) -STD_ROM_FN(Tetrbx) - -static UINT32 ShinfzSecurity(UINT32 input) -{ - return BITSWAP32(input, 19, 20, 25, 26, 15, 0, 16, 2, 8, 9, 13, 14, 31, 21, 7, 18, 11, 30, 22, 17, 3, 4, 12, 28, 29, 5, 27, 10, 23, 24, 1, 6); -} - -static UINT32 TetrbxSecurity(UINT32 input) -{ - return input; -} - -UINT8 __fastcall IsgsmReadByte(UINT32 a) -{ - switch (a) { - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - return 0xff - System16Input[1]; - } - - case 0xc41007: { - return 0xff - System16Input[2]; - } - - case 0xc42001: { - return System16Dip[0]; - } - - case 0xc42003: { - return System16Dip[1]; - } - - case 0xe80001: { - UINT32 Address; - UINT8 Data; - - IsgsmCartAddr++; - Address = (IsgsmCartAddr & (nCartSize - 1)); - Data = System16Rom[(0x100000 + Address) ^ 1] ^ IsgsmReadXor; - - return Data; - } - - case 0xe80003: { - return System16Dip[2]; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -void __fastcall IsgsmWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16BTileByteWrite((a - 0x400000) ^ 1, d); - return; - } - - switch (a) { - case 0x3f0001: { - if (System16TileBanks[0] != (d & 0x07)) { - System16TileBanks[0] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - - case 0x3f0003: { - if (System16TileBanks[1] != (d & 0x07)) { - System16TileBanks[1] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - - case 0x3f2001: { - if (System16TileBanks[0] != (d & 0x07)) { - System16TileBanks[0] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - - case 0x3f2003: { - if (System16TileBanks[1] != (d & 0x07)) { - System16TileBanks[1] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - - case 0xc40001: { - System16VideoEnable = d & 0x20; - System16ScreenFlip = d & 0x40; - return; - } - - case 0xc43001: { - // ???? - return; - } - - case 0xe00001: { - UINT8 *pDest = 0; - int AddressMask = 0; - - switch (IsgsmType & 0x0f) { - case 0x00: { - pDest = System16Sprites; - AddressMask = 0x1fffff; - break; - } - - case 0x01: { - pDest = System16TempGfx; - AddressMask = 0xfffff; - break; - } - - case 0x02: { - pDest = System16Z80Rom; - AddressMask = 0x3ffff; - break; - } - - case 0x03: { - pDest = System16Rom + 0x300000; - AddressMask = 0xfffff; - break; - } - } - - if ((IsgsmType & 0x10) == 0x00) { - switch (IsgsmType & 0xe0) { - case 0x00: d = BITSWAP08(d, 0, 7, 6, 5, 4, 3, 2, 1); break; - case 0x20: d = BITSWAP08(d, 7, 6, 5, 4, 3, 2, 1, 0); break; - case 0x40: d = BITSWAP08(d, 6, 5, 4, 3, 2, 1, 0, 7); break; - case 0x60: d = BITSWAP08(d, 5, 4, 3, 2, 1, 0, 7, 6); break; - case 0x80: d = BITSWAP08(d, 4, 3, 2, 1, 0, 7, 6, 5); break; - case 0xa0: d = BITSWAP08(d, 3, 2, 1, 0, 7, 6, 5, 4); break; - case 0xc0: d = BITSWAP08(d, 2, 1, 0, 7, 6, 5, 4, 3); break; - case 0xe0: d = BITSWAP08(d, 1, 0, 7, 6, 5, 4, 3, 2); break; - } - } - - if (pDest) { - INT32 BytesToWrite; - BytesToWrite = 1; - - if (IsgsmMode & 0x04) { - if (!IsgsmRleLatched) { - if (IsgsmRleControlPosition == 8) { - IsgsmRleControlByte = d; - IsgsmRleControlPosition = 0; - BytesToWrite = 0; - } else { - if (((IsgsmRleControlByte << IsgsmRleControlPosition) & 0x80) == 0) { - IsgsmRleByte = d; - IsgsmRleLatched = 1; - } else { - BytesToWrite = 1; - } - - IsgsmRleControlPosition++; - } - } else { - IsgsmRleLatched = 0; - BytesToWrite = d + 2; - d = IsgsmRleByte; - } - } - - for (INT32 i = 0; i < BytesToWrite; i++) { - UINT8 Byte = 0; - - if (IsgsmMode & 0x08) { - IsgsmAddr++; - IsgsmAddr &= 0xfffffff; - } else { - IsgsmAddr--; - IsgsmAddr &= 0xfffffff; - } - - switch (IsgsmMode & 0x03) { - case 0x00: Byte = d; break; - case 0x01: Byte = pDest[IsgsmAddr & AddressMask] ^ d; break; - case 0x02: Byte = pDest[IsgsmAddr & AddressMask] | d; break; - case 0x03: Byte = pDest[IsgsmAddr & AddressMask] & d; break; - } - - if ((IsgsmType & 0x10) == 0x10) { - switch (IsgsmType & 0xe0) { - case 0x00: Byte = BITSWAP08(Byte, 0, 7, 6, 5, 4, 3, 2, 1); break; - case 0x20: Byte = BITSWAP08(Byte, 7, 6, 5, 4, 3, 2, 1, 0); break; - case 0x40: Byte = BITSWAP08(Byte, 6, 5, 4, 3, 2, 1, 0, 7); break; - case 0x60: Byte = BITSWAP08(Byte, 5, 4, 3, 2, 1, 0, 7, 6); break; - case 0x80: Byte = BITSWAP08(Byte, 4, 3, 2, 1, 0, 7, 6, 5); break; - case 0xa0: Byte = BITSWAP08(Byte, 3, 2, 1, 0, 7, 6, 5, 4); break; - case 0xc0: Byte = BITSWAP08(Byte, 2, 1, 0, 7, 6, 5, 4, 3); break; - case 0xe0: Byte = BITSWAP08(Byte, 1, 0, 7, 6, 5, 4, 3, 2); break; - } - } - - if ((IsgsmType & 0x0f) == 0x01) { - if (IsgsmAddr < System16TileRomSize) { - pDest[IsgsmAddr] = Byte; - GfxDecodeSingle((IsgsmAddr & 0x1ffff) / 8, 3, 8, 8, IsgsmTilePlaneOffsets, IsgsmTileXOffsets, IsgsmTileYOffsets, 0x40, System16TempGfx, System16Tiles); - } - } else { - pDest[IsgsmAddr & AddressMask] = Byte; - } - } - } - - return; - } - - case 0xe00003: { - IsgsmType = d; - return; - } - - case 0xfe0007: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - - case 0xfe0009: { - if (d == 0) { - ZetOpen(0); - ZetReset(); - ZetClose(); - System16Z80Enable = true; - } - - if (d == 1) { - ZetOpen(0); - ZetReset(); - ZetClose(); - System16Z80Enable = false; - } - - return; - } - - case 0xfe000b: { - SekMapMemory(System16Rom + 0x300000, 0x000000, 0x0fffff, MAP_ROM); - GameRomMapped = 1; - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -UINT16 __fastcall IsgsmReadWord(UINT32 a) -{ - switch (a) { - case 0xe80008: { - return (IsgsmSecurity >> 16) & 0xffff; - } - - case 0xe8000a: { - return IsgsmSecurity & 0xffff; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Word -> 0x%06X\n"), a); -#endif - - return 0xffff; -} - -void __fastcall IsgsmWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16BTileWordWrite(a - 0x400000, d); - return; - } - - switch (a) { - case 0xe00004: { - IsgsmAddrLatch = d; - return; - } - - case 0xe00006: { - IsgsmMode = (IsgsmAddrLatch & 0xf000) >> 12; - IsgsmAddr = d | ((IsgsmAddrLatch & 0x0fff) << 16); - - IsgsmRleControlPosition = 8; - IsgsmRleControlByte = 0; - IsgsmRleLatched = 0; - return; - } - - case 0xe80004: { - IsgsmCartAddrLatch = d; - return; - } - - case 0xe80006: { - IsgsmCartAddr = d | IsgsmCartAddrLatch << 16; - return; - } - - case 0xe80008: { - IsgsmSecurityLatch = d; - return; - } - - case 0xe8000a: { - IsgsmSecurity = d | IsgsmSecurityLatch << 16; - if (IsgsmSecurityCallback) IsgsmSecurity = IsgsmSecurityCallback(IsgsmSecurity); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -static void IsgsmMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(System16ExtraRam , 0x200000, 0x23ffff, MAP_RAM); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Rom + 0x100000 , 0xee0000, 0xefffff, MAP_ROM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - SekSetReadWordHandler(0, IsgsmReadWord); - SekSetWriteWordHandler(0, IsgsmWriteWord); - SekSetReadByteHandler(0, IsgsmReadByte); - SekSetWriteByteHandler(0, IsgsmWriteByte); - SekClose(); -} - -static INT32 IsgsmInit() -{ - System16RomSize = 0x400000; - System16TileRomSize = 0x60000; - System16SpriteRomSize = 0x200000; - System16UPD7759DataSize = 0x30000; - - System16Map68KDo = IsgsmMap68K; - - INT32 nRet = System16Init(); - - if (!nRet) { - memset(System16Rom, 0, 0x400000); - - // Load and Decrypt BIOS - UINT16 *pTemp = (UINT16*)BurnMalloc(0x20000); - memset(pTemp, 0, 0x20000); - UINT16 *Rom = (UINT16*)System16Rom; - - nRet = BurnLoadRom(System16Rom, 0x80, 1); if (nRet) return 1; - - for (UINT32 i = 0; i < 0x10000; i++) { - pTemp[i ^ 0x4127] = BITSWAP16(Rom[i], 6, 14, 4, 2, 12, 10, 8, 0, 1, 9, 11, 13, 3, 5, 7, 15); - } - - memcpy(Rom, pTemp, 0x20000); - BurnFree(pTemp); - - // Load program ROM - nRet = BurnLoadRom(System16Rom + 0x100000, 0, 1); if (nRet) return 1; - - System16TempGfx = (UINT8*)BurnMalloc(System16TileRomSize); - memset(System16TempGfx, 0, System16TileRomSize); - memset(System16Tiles, 0, System16NumTiles * 8 * 8); - memset(System16Sprites, 0, System16TileRomSize); - - System16UPD7759Data = (UINT8*)(System16Z80Rom + 0x10000); - } - - System16ClockSpeed = 16000000; - - return nRet; -} - -static INT32 ShinfzInit() -{ - INT32 nRet = IsgsmInit(); - - if (!nRet) { - nCartSize = 0x200000; - UINT16 *pTemp = (UINT16*)BurnMalloc(0x200000); - memset(pTemp, 0, 0x200000); - UINT16 *Rom = (UINT16*)(System16Rom + 0x100000); - - for (UINT32 i = 0; i < 0x100000; i++) { - pTemp[i ^ 0x68956] = BITSWAP16(Rom[i], 8, 4, 12, 3, 6, 7, 1, 0, 15, 11, 5, 14, 10, 2, 9, 13); - } - - memcpy(Rom, pTemp, 0x200000); - BurnFree(pTemp); - - IsgsmReadXor = 0x66; - IsgsmSecurityCallback = ShinfzSecurity; - } - - return nRet; -} - -static INT32 TetrbxInit() -{ - INT32 nRet = IsgsmInit(); - - if (!nRet) { - nCartSize = 0x80000; - UINT16 *pTemp = (UINT16*)BurnMalloc(nCartSize); - memset(pTemp, 0, nCartSize); - UINT16 *Rom = (UINT16*)(System16Rom + 0x100000); - - for (UINT32 i = 0; i < nCartSize >> 1; i++) { - pTemp[i ^ 0x2a6e6] = BITSWAP16(Rom[i], 4, 0, 12, 5, 7, 3, 1, 14, 10, 11, 9, 6, 15, 2, 13, 8); - } - - memcpy(Rom, pTemp, nCartSize); - BurnFree(pTemp); - - IsgsmReadXor = 0x73; - IsgsmSecurityCallback = TetrbxSecurity; - } - - return nRet; -} - -static INT32 IsgsmExit() -{ - INT32 nRet = System16Exit(); - - BurnFree(System16TempGfx); - - IsgsmCartAddrLatch = 0; - IsgsmCartAddr = 0; - IsgsmType = 0; - IsgsmAddr = 0; - IsgsmMode = 0; - IsgsmAddrLatch = 0; - IsgsmSecurity = 0; - IsgsmSecurityLatch = 0; - IsgsmRleControlPosition = 0; - IsgsmRleControlByte = 0; - IsgsmRleLatched = 0; - IsgsmRleByte = 0; - IsgsmReadXor = 0; - nCartSize = 0; - IsgsmSecurityCallback = NULL; - GameRomMapped = 0; - - return nRet; -} - -static INT32 IsgsmScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - ba.Data = System16Sprites; - ba.nLen = System16SpriteRomSize - 1; - ba.nAddress = 0; - ba.szName = "SpriteROM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = System16TempGfx; - ba.nLen = System16TileRomSize - 1; - ba.nAddress = 0; - ba.szName = "TileROM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = System16Z80Rom; - ba.nLen = 0x3ffff; - ba.nAddress = 0; - ba.szName = "Z80ROM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = System16Rom + 0x300000; - ba.nLen = 0xfffff; - ba.nAddress = 0; - ba.szName = "GameROM"; - BurnAcb(&ba); - - SCAN_VAR(IsgsmCartAddrLatch); - SCAN_VAR(IsgsmCartAddr); - SCAN_VAR(IsgsmType); - SCAN_VAR(IsgsmAddr); - SCAN_VAR(IsgsmMode); - SCAN_VAR(IsgsmAddrLatch); - SCAN_VAR(IsgsmSecurity); - SCAN_VAR(IsgsmSecurityLatch); - SCAN_VAR(IsgsmRleControlPosition); - SCAN_VAR(IsgsmRleControlByte); - SCAN_VAR(IsgsmRleLatched); - SCAN_VAR(IsgsmRleByte); - SCAN_VAR(GameRomMapped); - - if (nAction & ACB_WRITE) { - if (GameRomMapped) { - SekOpen(0); - SekMapMemory(System16Rom + 0x300000, 0x000000, 0x0fffff, MAP_ROM); - SekClose(); - } - - for (UINT32 i = 0; i < System16TileRomSize; i++) { - GfxDecodeSingle((i & 0x1ffff) / 8, 3, 8, 8, IsgsmTilePlaneOffsets, IsgsmTileXOffsets, IsgsmTileYOffsets, 0x40, System16TempGfx, System16Tiles); - } - } - } - - return System16Scan(nAction, pnMin); -} - -struct BurnDriver BurnDrvIsgsm = { - "isgsm", NULL, NULL, NULL, "2006", - "ISG Selection Master Type 2006 System BIOS\0", "BIOS only", "ISG", "ISG Selection Master Type 2006", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_BOARDROM, 0, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_ISGSM | HARDWARE_SEGA_5521, GBF_BIOS, 0, - NULL, IsgsmRomInfo, IsgsmRomName, NULL, NULL, System16bDip3InputInfo, NULL, - IsgsmInit, IsgsmExit, System16BFrame, NULL, IsgsmScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShinfz = { - "shinfz", NULL, "isgsm", NULL, "2006", - "Shinobi / FZ-2006 (Korean System 16 bootleg) (ISG Selection Master Type 2006)\0", NULL, "ISG", "ISG Selection Master Type 2006", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_ISGSM | HARDWARE_SEGA_5521, GBF_SCRFIGHT, 0, - NULL, ShinfzRomInfo, ShinfzRomName, NULL, NULL, System16bDip3InputInfo, ShinfzDIPInfo, - ShinfzInit, IsgsmExit, System16BFrame, NULL, IsgsmScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTetrbx = { - "tetrbx", NULL, "isgsm", NULL, "2006", - "Tetris / Bloxeed (Korean System 16 bootleg) (ISG Selection Master Type 2006)\0", NULL, "ISG", "ISG Selection Master Type 2006", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM16B | HARDWARE_SEGA_ISGSM | HARDWARE_SEGA_5521, GBF_SCRFIGHT, 0, - NULL, TetrbxRomInfo, TetrbxRomName, NULL, NULL, System16bDip3InputInfo, TetrbxDIPInfo, - TetrbxInit, IsgsmExit, System16BFrame, NULL, IsgsmScan, - NULL, 0x1800, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_sys18.cpp b/jan/src/burn/drv/sega/d_sys18.cpp deleted file mode 100644 index 7edda56f9..000000000 --- a/jan/src/burn/drv/sega/d_sys18.cpp +++ /dev/null @@ -1,3700 +0,0 @@ -#include "sys16.h" - -/*==================================================== -Input defs -====================================================*/ - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo System18InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Service 2" , BIT_DIGITAL , System16InputPort0 + 6 , "service2" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(System18) - -static struct BurnInputInfo AstormInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , System16InputPort0 + 0, "p3 coin" }, - {"Start 3" , BIT_DIGITAL , System16InputPort0 + 6, "p3 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 3" }, - {"P1 Service" , BIT_DIGITAL , System16InputPort1 + 3, "p1 fire 4" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 3" }, - {"P2 Service" , BIT_DIGITAL , System16InputPort2 + 3, "p2 fire 4" }, - - {"P3 Up" , BIT_DIGITAL , System16InputPort3 + 5, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , System16InputPort3 + 4, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , System16InputPort3 + 7, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , System16InputPort3 + 6, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort3 + 0, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort3 + 1, "p3 fire 2" }, - {"P3 Fire 3" , BIT_DIGITAL , System16InputPort3 + 2, "p3 fire 3" }, - {"P3 Service" , BIT_DIGITAL , System16InputPort3 + 3, "p3 fire 4" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Astorm) - -static struct BurnInputInfo DdcrewInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , System16InputPort0 + 7, "p3 coin" }, - {"Start 3" , BIT_DIGITAL , System16InputPort3 + 3, "p3 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - - {"P3 Up" , BIT_DIGITAL , System16InputPort3 + 5, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , System16InputPort3 + 4, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , System16InputPort3 + 7, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , System16InputPort3 + 6, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort3 + 0, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort3 + 1, "p3 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Ddcrew) - -static struct BurnInputInfo Ddcrew2InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Ddcrew2) - -static struct BurnInputInfo DdcrewuInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , System16InputPort5 + 2, "p3 coin" }, - {"Start 3" , BIT_DIGITAL , System16InputPort5 + 0, "p3 start" }, - {"Coin 4" , BIT_DIGITAL , System16InputPort5 + 3, "p4 coin" }, - {"Start 4" , BIT_DIGITAL , System16InputPort5 + 1, "p4 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - - {"P3 Up" , BIT_DIGITAL , System16InputPort3 + 5, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , System16InputPort3 + 4, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , System16InputPort3 + 7, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , System16InputPort3 + 6, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort3 + 0, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort3 + 1, "p3 fire 2" }, - - {"P4 Up" , BIT_DIGITAL , System16InputPort4 + 5, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , System16InputPort4 + 4, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , System16InputPort4 + 7, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , System16InputPort4 + 6, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , System16InputPort4 + 0, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , System16InputPort4 + 1, "p4 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Ddcrewu) - -static struct BurnInputInfo DesertbrInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , System16InputPort3 + 3, "p3 coin" }, - {"Start 3" , BIT_DIGITAL , System16InputPort0 + 7, "p3 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , System16InputPort1 + 2, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , System16InputPort2 + 2, "p2 fire 3" }, - - {"P3 Up" , BIT_DIGITAL , System16InputPort3 + 5, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , System16InputPort3 + 4, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , System16InputPort3 + 7, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , System16InputPort3 + 6, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort3 + 0, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort3 + 1, "p3 fire 2" }, - {"P3 Fire 3" , BIT_DIGITAL , System16InputPort3 + 2, "p3 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Desertbr) - -static struct BurnInputInfo LghostInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Coin 3" , BIT_DIGITAL , System16InputPort0 + 7, "p3 coin" }, - - A("P1 X-Axis" , BIT_ANALOG_REL, &System16AnalogPort0, "mouse x-axis" ), - A("P1 Y-Axis" , BIT_ANALOG_REL, &System16AnalogPort1, "mouse y-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "mouse button 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "mouse button 2" }, - - A("P2 X-Axis" , BIT_ANALOG_REL, &System16AnalogPort2, "p2 x-axis" ), - A("P2 Y-Axis" , BIT_ANALOG_REL, &System16AnalogPort3, "p2 y-axis" ), - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort1 + 2, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort1 + 3, "p2 fire 2" }, - - A("P3 X-Axis" , BIT_ANALOG_REL, &System16AnalogPort4, "p3 x-axis" ), - A("P3 Y-Axis" , BIT_ANALOG_REL, &System16AnalogPort5, "p3 y-axis" ), - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort1 + 7, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort1 + 6, "p3 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 4 , "service" }, - {"Service 2" , BIT_DIGITAL , System16InputPort0 + 5 , "service2" }, - {"Service 3" , BIT_DIGITAL , System16InputPort0 + 6 , "service3" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Lghost) - -static struct BurnInputInfo MwalkInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , System16InputPort0 + 7, "p3 coin" }, - {"Start 3" , BIT_DIGITAL , System16InputPort3 + 3, "p3 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 5, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 1, "p1 fire 2" }, - {"P1 Service" , BIT_DIGITAL , System16InputPort1 + 3, "service" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 5, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort2 + 1, "p2 fire 2" }, - {"P2 Service" , BIT_DIGITAL , System16InputPort2 + 3, "service2" }, - - {"P3 Up" , BIT_DIGITAL , System16InputPort3 + 5, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , System16InputPort3 + 4, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , System16InputPort3 + 7, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , System16InputPort3 + 6, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , System16InputPort3 + 0, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , System16InputPort3 + 1, "p3 fire 2" }, - {"P3 Service" , BIT_DIGITAL , System16InputPort0 + 6, "service3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH, System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Mwalk) - -static struct BurnInputInfo WwallyInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort1 + 3, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort1 + 4, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort1 + 1, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort1 + 2, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 0, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort2 + 3, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort2 + 4, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort2 + 1, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort2 + 2, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort2 + 0, "p2 fire 1" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Wwally) - -#undef A - -/*==================================================== -Dip defs -====================================================*/ - -#define SYSTEM18_COINAGE(dipval) \ - {0 , 0xfe, 0 , 16 , "Coin A" }, \ - {dipval, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x05, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0x0f, 0x04, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x01, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0x0f, 0x02, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0x0f, 0x03, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0x0f, 0x00, "Free Play (if coin B too) or 1C/1C" }, \ - \ - {0 , 0xfe, 0 , 16 , "Coin B" }, \ - {dipval, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x50, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0xf0, 0x40, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x10, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0xf0, 0x20, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0xf0, 0x30, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0xf0, 0x00, "Free Play (if coin A too) or 1C/1C" }, - -static struct BurnDIPInfo AstormDIPList[]= -{ - // Default Values - {0x21, 0xff, 0xff, 0xff, NULL }, - {0x22, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x21) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x22, 0x01, 0x01, 0x01, "Off" }, - {0x22, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x22, 0x01, 0x02, 0x02, "Off" }, - {0x22, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x22, 0x01, 0x1c, 0x04, "Easiest" }, - {0x22, 0x01, 0x1c, 0x08, "Easier" }, - {0x22, 0x01, 0x1c, 0x0c, "Easy" }, - {0x22, 0x01, 0x1c, 0x1c, "Normal" }, - {0x22, 0x01, 0x1c, 0x10, "Hard" }, - {0x22, 0x01, 0x1c, 0x14, "Harder" }, - {0x22, 0x01, 0x1c, 0x18, "Hardest" }, - {0x22, 0x01, 0x1c, 0x00, "Special" }, - - {0 , 0xfe, 0 , 2 , "Coin Chutes" }, - {0x22, 0x01, 0x20, 0x00, "1" }, - {0x22, 0x01, 0x20, 0x20, "3" }, -}; - -STDDIPINFO(Astorm) - -static struct BurnDIPInfo Astorm2pDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x16) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x17, 0x01, 0x02, 0x02, "Off" }, - {0x17, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x17, 0x01, 0x1c, 0x04, "Easiest" }, - {0x17, 0x01, 0x1c, 0x08, "Easier" }, - {0x17, 0x01, 0x1c, 0x0c, "Easy" }, - {0x17, 0x01, 0x1c, 0x1c, "Normal" }, - {0x17, 0x01, 0x1c, 0x10, "Hard" }, - {0x17, 0x01, 0x1c, 0x14, "Harder" }, - {0x17, 0x01, 0x1c, 0x18, "Hardest" }, - {0x17, 0x01, 0x1c, 0x00, "Special" }, - - {0 , 0xfe, 0 , 2 , "Coin Chutes" }, - {0x17, 0x01, 0x20, 0x00, "1" }, - {0x17, 0x01, 0x20, 0x20, "2" }, -}; - -STDDIPINFO(Astorm2p) - -static struct BurnDIPInfo CltchitrDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x16) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x17, 0x01, 0x02, 0x02, "Off" }, - {0x17, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Game Time P1" }, - {0x17, 0x01, 0x0c, 0x04, "2 Credits 18 Outcounts 14 Min" }, - {0x17, 0x01, 0x0c, 0x00, "1 Credit 6 Outcounts 7 Min" }, - {0x17, 0x01, 0x0c, 0x08, "1 Credit 12 Outcounts 12 Min" }, - {0x17, 0x01, 0x0c, 0x0c, "1C 6OC 8M / 2C 18OC 14M" }, - - {0 , 0xfe, 0 , 4 , "Game Time P2" }, - {0x17, 0x01, 0x30, 0x10, "4 Credits 18 Outcounts 16 Min" }, - {0x17, 0x01, 0x30, 0x00, "2 Credits 6 Outcounts 8 Min" }, - {0x17, 0x01, 0x30, 0x20, "2 Credits 12 Outcounts 14 Min" }, - {0x17, 0x01, 0x30, 0x30, "2C 6OC 8M / 4C 18OC 16M" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x17, 0x01, 0xc0, 0x40, "Easiest" }, - {0x17, 0x01, 0xc0, 0x80, "Easy" }, - {0x17, 0x01, 0xc0, 0xc0, "Normal" }, - {0x17, 0x01, 0xc0, 0x00, "Hard" }, -}; - -STDDIPINFO(Cltchitr) - -static struct BurnDIPInfo DdcrewDIPList[]= -{ - // Default Values - {0x1b, 0xff, 0xff, 0xff, NULL }, - {0x1c, 0xff, 0xff, 0xf7, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x1b) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Credits Needed" }, - {0x1c, 0x01, 0x01, 0x01, "1 to start, 1 to continue" }, - {0x1c, 0x01, 0x01, 0x00, "2 to start, 1 to continue" }, - - {0 , 0xfe, 0 , 2 , "Switch to Start" }, - {0x1c, 0x01, 0x02, 0x02, "Start" }, - {0x1c, 0x01, 0x02, 0x00, "Attack" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x1c, 0x01, 0x04, 0x04, "Common" }, - {0x1c, 0x01, 0x04, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1c, 0x01, 0x08, 0x08, "Off" }, - {0x1c, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Player Start/Continue" }, - {0x1c, 0x01, 0x30, 0x30, "3/3" }, - {0x1c, 0x01, 0x30, 0x20, "2/3" }, - {0x1c, 0x01, 0x30, 0x10, "2/2" }, - {0x1c, 0x01, 0x30, 0x00, "3/4" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1c, 0x01, 0xc0, 0x80, "Easy" }, - {0x1c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x1c, 0x01, 0xc0, 0x40, "Hard" }, - {0x1c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Ddcrew) - -static struct BurnDIPInfo Ddcrew2DIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xf7, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x13) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Credits Needed" }, - {0x14, 0x01, 0x01, 0x01, "1 to start, 1 to continue" }, - {0x14, 0x01, 0x01, 0x00, "2 to start, 1 to continue" }, - - {0 , 0xfe, 0 , 2 , "Switch to Start" }, - {0x14, 0x01, 0x02, 0x02, "Start" }, - {0x14, 0x01, 0x02, 0x00, "Attack" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x14, 0x01, 0x04, 0x04, "Common" }, - {0x14, 0x01, 0x04, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Player Start/Continue" }, - {0x14, 0x01, 0x30, 0x30, "3/3" }, - {0x14, 0x01, 0x30, 0x20, "2/3" }, - {0x14, 0x01, 0x30, 0x10, "2/2" }, - {0x14, 0x01, 0x30, 0x00, "3/4" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0xc0, 0x80, "Easy" }, - {0x14, 0x01, 0xc0, 0xc0, "Normal" }, - {0x14, 0x01, 0xc0, 0x40, "Hard" }, - {0x14, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Ddcrew2) - -static struct BurnDIPInfo DdcrewuDIPList[]= -{ - // Default Values - {0x23, 0xff, 0xff, 0xff, NULL }, - {0x24, 0xff, 0xff, 0xf7, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x23) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Credits Needed" }, - {0x24, 0x01, 0x01, 0x01, "1 to start, 1 to continue" }, - {0x24, 0x01, 0x01, 0x00, "2 to start, 1 to continue" }, - - {0 , 0xfe, 0 , 2 , "Switch to Start" }, - {0x24, 0x01, 0x02, 0x02, "Start" }, - {0x24, 0x01, 0x02, 0x00, "Attack" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x24, 0x01, 0x04, 0x04, "Common" }, - {0x24, 0x01, 0x04, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x24, 0x01, 0x08, 0x08, "Off" }, - {0x24, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Player Start/Continue" }, - {0x24, 0x01, 0x30, 0x30, "3/3" }, - {0x24, 0x01, 0x30, 0x20, "2/3" }, - {0x24, 0x01, 0x30, 0x10, "2/2" }, - {0x24, 0x01, 0x30, 0x00, "3/4" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x24, 0x01, 0xc0, 0x80, "Easy" }, - {0x24, 0x01, 0xc0, 0xc0, "Normal" }, - {0x24, 0x01, 0xc0, 0x40, "Hard" }, - {0x24, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Ddcrewu) - -static struct BurnDIPInfo DesertbrDIPList[]= -{ - // Default Values - {0x1e, 0xff, 0xff, 0xff, NULL }, - {0x1f, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x1e) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1f, 0x01, 0x02, 0x02, "Off" }, - {0x1f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Play Mode" }, - {0x1f, 0x01, 0x08, 0x00, "2 Players" }, - {0x1f, 0x01, 0x08, 0x08, "3 Players" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x15, 0x01, 0x10, 0x10, "Common" }, - {0x15, 0x01, 0x10, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 2 , "Start Button" }, - {0x15, 0x01, 0x20, 0x20, "Use" }, - {0x15, 0x01, 0x20, 0x00, "Unused" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1f, 0x01, 0xc0, 0x80, "Easy" }, - {0x1f, 0x01, 0xc0, 0xc0, "Normal" }, - {0x1f, 0x01, 0xc0, 0x40, "Hard" }, - {0x1f, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Desertbr) - -static struct BurnDIPInfo HamawayDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xbf, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x16) - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x17, 0x01, 0x03, 0x02, "Easy" }, - {0x17, 0x01, 0x03, 0x03, "Normal" }, - {0x17, 0x01, 0x03, 0x01, "Hard" }, - {0x17, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Number of Players" }, - {0x17, 0x01, 0x0c, 0x08, "1" }, - {0x17, 0x01, 0x0c, 0x04, "2" }, - {0x17, 0x01, 0x0c, 0x0c, "3" }, - {0x17, 0x01, 0x0c, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Advertise Sound" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Credit to Start" }, - {0x17, 0x01, 0x80, 0x80, "1" }, - {0x17, 0x01, 0x80, 0x00, "2" }, -}; - -STDDIPINFO(Hamaway) - -static struct BurnDIPInfo LghostDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x14) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 8 , "Difficulty" }, - {0x15, 0x01, 0x1c, 0x18, "Easy" }, - {0x15, 0x01, 0x1c, 0x14, "Easier" }, - {0x15, 0x01, 0x1c, 0x0c, "Easiest" }, - {0x15, 0x01, 0x1c, 0x1c, "Normal" }, - {0x15, 0x01, 0x1c, 0x10, "Hard" }, - {0x15, 0x01, 0x1c, 0x04, "Harder" }, - {0x15, 0x01, 0x1c, 0x08, "Hardest" }, - {0x15, 0x01, 0x1c, 0x00, "Extra Hardest" }, - - {0 , 0xfe, 0 , 2 , "Continue Mode" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x15, 0x01, 0x40, 0x00, "Common" }, - {0x15, 0x01, 0x40, 0x40, "Individual" }, -}; - -STDDIPINFO(Lghost) - -static struct BurnDIPInfo MwalkDIPList[]= -{ - // Default Values - {0x1e, 0xff, 0xff, 0xff, NULL }, - {0x1f, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x1e) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x1f, 0x01, 0x01, 0x01, "Off" }, - {0x1f, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1f, 0x01, 0x02, 0x02, "Off" }, - {0x1f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x1f, 0x01, 0x04, 0x04, "2" }, - {0x1f, 0x01, 0x04, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Player Vitality" }, - {0x1f, 0x01, 0x08, 0x08, "Low" }, - {0x1f, 0x01, 0x08, 0x00, "High" }, - - {0 , 0xfe, 0 , 2 , "Play Mode" }, - {0x1f, 0x01, 0x10, 0x10, "2 Players" }, - {0x1f, 0x01, 0x10, 0x00, "3 Players" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x1f, 0x01, 0x20, 0x20, "Common" }, - {0x1f, 0x01, 0x20, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1f, 0x01, 0xc0, 0x80, "Easy" }, - {0x1f, 0x01, 0xc0, 0xc0, "Normal" }, - {0x1f, 0x01, 0xc0, 0x40, "Hard" }, - {0x1f, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Mwalk) - -static struct BurnDIPInfo MwalkuDIPList[]= -{ - // Default Values - {0x1e, 0xff, 0xff, 0xff, NULL }, - {0x1f, 0xff, 0xff, 0xcd, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x1e) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x1f, 0x01, 0x01, 0x01, "Off" }, - {0x1f, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x1f, 0x01, 0x02, 0x02, "Off" }, - {0x1f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x1f, 0x01, 0x04, 0x04, "2" }, - {0x1f, 0x01, 0x04, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Player Vitality" }, - {0x1f, 0x01, 0x08, 0x08, "Low" }, - {0x1f, 0x01, 0x08, 0x00, "High" }, - - {0 , 0xfe, 0 , 2 , "Play Mode" }, - {0x1f, 0x01, 0x10, 0x00, "2 Players" }, - {0x1f, 0x01, 0x10, 0x10, "3 Players" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x1f, 0x01, 0x20, 0x00, "Common" }, - {0x1f, 0x01, 0x20, 0x20, "Individual" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1f, 0x01, 0xc0, 0x80, "Easy" }, - {0x1f, 0x01, 0xc0, 0xc0, "Normal" }, - {0x1f, 0x01, 0xc0, 0x40, "Hard" }, - {0x1f, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Mwalku) - -static struct BurnDIPInfo ShdancerDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x16) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x17, 0x01, 0x01, 0x01, "Off" }, - {0x17, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x17, 0x01, 0x02, 0x02, "Off" }, - {0x17, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x17, 0x01, 0x0c, 0x00, "2" }, - {0x17, 0x01, 0x0c, 0x0c, "3" }, - {0x17, 0x01, 0x0c, 0x08, "4" }, - {0x17, 0x01, 0x0C, 0x04, "5" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x17, 0x01, 0x30, 0x20, "Easy" }, - {0x17, 0x01, 0x30, 0x30, "Normal" }, - {0x17, 0x01, 0x30, 0x10, "Hard" }, - {0x17, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time Adjust" }, - {0x17, 0x01, 0xc0, 0x00, "2:20" }, - {0x17, 0x01, 0xc0, 0x40, "2:40" }, - {0x17, 0x01, 0xc0, 0xc0, "3:00" }, - {0x17, 0x01, 0xc0, 0x80, "3:30" }, -}; - -STDDIPINFO(Shdancer) - -static struct BurnDIPInfo WwallyDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - SYSTEM18_COINAGE(0x11) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "2 Credits to Start" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x12, 0x01, 0x02, 0x02, "Off" }, - {0x12, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x12, 0x01, 0x04, 0x04, "Common" }, - {0x12, 0x01, 0x04, 0x00, "Individual" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x60, 0x40, "Easy" }, - {0x12, 0x01, 0x60, 0x60, "Normal" }, - {0x12, 0x01, 0x60, 0x20, "Hard" }, - {0x12, 0x01, 0x60, 0x00, "Hardest" }, -}; - -STDDIPINFO(Wwally) - -#undef SYSTEM18_COINAGE - -/*==================================================== -Rom defs -====================================================*/ - -static struct BurnRomInfo AstormRomDesc[] = { - { "epr-13182.a6", 0x40000, 0xe31f2a1c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13181.a5", 0x40000, 0x78cd3b26, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13073.bin", 0x40000, 0xdf5d0a61, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13074.bin", 0x40000, 0x787afab8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13075.bin", 0x40000, 0x4e01b477, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13082.bin", 0x40000, 0xa782b704, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13089.bin", 0x40000, 0x2a4227f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13081.bin", 0x40000, 0xeb510228, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13088.bin", 0x40000, 0x3b6b4c55, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13080.bin", 0x40000, 0xe668eefb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13087.bin", 0x40000, 0x2293427d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13079.bin", 0x40000, 0xde9221ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13086.bin", 0x40000, 0x8c9a71c4, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13083a.bin", 0x20000, 0xe7528e06, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13076.bin", 0x40000, 0x94e6c76e, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13077.bin", 0x40000, 0xe2ec0d8d, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13078.bin", 0x40000, 0x15684dc5, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0154.key", 0x02000, 0xb86b6b8f, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Astorm) -STD_ROM_FN(Astorm) - -static struct BurnRomInfo Astorm3dRomDesc[] = { - { "bootleg_epr-13165.a6", 0x40000, 0x2a0dbff5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13164.a5", 0x40000, 0xf981a183, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13073.bin", 0x40000, 0xdf5d0a61, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13074.bin", 0x40000, 0x787afab8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13075.bin", 0x40000, 0x4e01b477, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13082.bin", 0x40000, 0xa782b704, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13089.bin", 0x40000, 0x2a4227f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13081.bin", 0x40000, 0xeb510228, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13088.bin", 0x40000, 0x3b6b4c55, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13080.bin", 0x40000, 0xe668eefb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13087.bin", 0x40000, 0x2293427d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13079.bin", 0x40000, 0xde9221ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13086.bin", 0x40000, 0x8c9a71c4, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13083.bin", 0x20000, 0x5df3af20, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13076.bin", 0x40000, 0x94e6c76e, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13077.bin", 0x40000, 0xe2ec0d8d, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13078.bin", 0x40000, 0x15684dc5, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Astorm3d) -STD_ROM_FN(Astorm3d) - -static struct BurnRomInfo Astorm3RomDesc[] = { - { "epr-13165.a6", 0x40000, 0x6efcd381, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13164.a5", 0x40000, 0x97d693c6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13073.bin", 0x40000, 0xdf5d0a61, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13074.bin", 0x40000, 0x787afab8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13075.bin", 0x40000, 0x4e01b477, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13082.bin", 0x40000, 0xa782b704, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13089.bin", 0x40000, 0x2a4227f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13081.bin", 0x40000, 0xeb510228, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13088.bin", 0x40000, 0x3b6b4c55, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13080.bin", 0x40000, 0xe668eefb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13087.bin", 0x40000, 0x2293427d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13079.bin", 0x40000, 0xde9221ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13086.bin", 0x40000, 0x8c9a71c4, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13083.bin", 0x20000, 0x5df3af20, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13076.bin", 0x40000, 0x94e6c76e, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13077.bin", 0x40000, 0xe2ec0d8d, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13078.bin", 0x40000, 0x15684dc5, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0148.key", 0x02000, 0x72e4b64a, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Astorm3) -STD_ROM_FN(Astorm3) - -static struct BurnRomInfo AstormjRomDesc[] = { - { "epr-13085.a6", 0x40000, 0x15f74e2d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13084.a5", 0x40000, 0x9687b38f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13073.bin", 0x40000, 0xdf5d0a61, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13074.bin", 0x40000, 0x787afab8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13075.bin", 0x40000, 0x4e01b477, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13082.bin", 0x40000, 0xa782b704, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13089.bin", 0x40000, 0x2a4227f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13081.bin", 0x40000, 0xeb510228, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13088.bin", 0x40000, 0x3b6b4c55, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13080.bin", 0x40000, 0xe668eefb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13087.bin", 0x40000, 0x2293427d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13079.bin", 0x40000, 0xde9221ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13086.bin", 0x40000, 0x8c9a71c4, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13083b.bin", 0x20000, 0x169b4b5f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13076.bin", 0x40000, 0x94e6c76e, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13077.bin", 0x40000, 0xe2ec0d8d, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13078.bin", 0x40000, 0x15684dc5, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0146.key", 0x02000, 0xe94991c5, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Astormj) -STD_ROM_FN(Astormj) - -static struct BurnRomInfo AstormjdRomDesc[] = { - { "bootleg_epr-13085.a6", 0x40000, 0xc0d7f3c2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13084.a5", 0x40000, 0x006635f0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13073.bin", 0x40000, 0xdf5d0a61, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13074.bin", 0x40000, 0x787afab8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13075.bin", 0x40000, 0x4e01b477, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13082.bin", 0x40000, 0xa782b704, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13089.bin", 0x40000, 0x2a4227f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13081.bin", 0x40000, 0xeb510228, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13088.bin", 0x40000, 0x3b6b4c55, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13080.bin", 0x40000, 0xe668eefb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13087.bin", 0x40000, 0x2293427d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13079.bin", 0x40000, 0xde9221ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13086.bin", 0x40000, 0x8c9a71c4, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13083b.bin", 0x20000, 0x169b4b5f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13076.bin", 0x40000, 0x94e6c76e, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13077.bin", 0x40000, 0xe2ec0d8d, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13078.bin", 0x40000, 0x15684dc5, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Astormjd) -STD_ROM_FN(Astormjd) - -static struct BurnRomInfo AstormuRomDesc[] = { - { "epr-13095.a6", 0x40000, 0x55d40742, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13094.a5", 0x40000, 0x92b305f9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13073.bin", 0x40000, 0xdf5d0a61, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13074.bin", 0x40000, 0x787afab8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13075.bin", 0x40000, 0x4e01b477, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13082.bin", 0x40000, 0xa782b704, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13089.bin", 0x40000, 0x2a4227f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13081.bin", 0x40000, 0xeb510228, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13088.bin", 0x40000, 0x3b6b4c55, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13080.bin", 0x40000, 0xe668eefb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13087.bin", 0x40000, 0x2293427d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13079.bin", 0x40000, 0xde9221ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13086.bin", 0x40000, 0x8c9a71c4, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13083.bin", 0x20000, 0x5df3af20, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13076.bin", 0x40000, 0x94e6c76e, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13077.bin", 0x40000, 0xe2ec0d8d, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13078.bin", 0x40000, 0x15684dc5, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0147.key", 0x02000, 0x3fd54ba7, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Astormu) -STD_ROM_FN(Astormu) - -static struct BurnRomInfo AstormudRomDesc[] = { - { "bootleg_epr-13095.a6", 0x40000, 0xa29b1eea, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13094.a5", 0x40000, 0x81f4c6b6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13073.bin", 0x40000, 0xdf5d0a61, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13074.bin", 0x40000, 0x787afab8, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13075.bin", 0x40000, 0x4e01b477, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13082.bin", 0x40000, 0xa782b704, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13089.bin", 0x40000, 0x2a4227f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13081.bin", 0x40000, 0xeb510228, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13088.bin", 0x40000, 0x3b6b4c55, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13080.bin", 0x40000, 0xe668eefb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13087.bin", 0x40000, 0x2293427d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13079.bin", 0x40000, 0xde9221ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13086.bin", 0x40000, 0x8c9a71c4, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13083.bin", 0x20000, 0x5df3af20, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13076.bin", 0x40000, 0x94e6c76e, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13077.bin", 0x40000, 0xe2ec0d8d, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13078.bin", 0x40000, 0x15684dc5, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Astormud) -STD_ROM_FN(Astormud) - -static struct BurnRomInfo BloxeedRomDesc[] = { - { "epr-12911.a6", 0x20000, 0xa481581a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12910.a5", 0x20000, 0xdd1bc3bf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12884.b1", 0x10000, 0xe024aa33, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12885.b2", 0x10000, 0x8041b814, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12886.b3", 0x10000, 0xde32285e, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12887.b11", 0x10000, 0xf0c0f49d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12891.a11", 0x10000, 0x90d31a8c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12888.a4", 0x20000, 0x6f2fc63c, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "317-0139.key", 0x02000, 0x9aae84cb, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Bloxeed) -STD_ROM_FN(Bloxeed) - -static struct BurnRomInfo BloxeeddRomDesc[] = { - { "bootleg_epr-12911.a6", 0x20000, 0x2d634453, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12910.a5", 0x20000, 0xe6d2e9cc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "opr-12884.b1", 0x10000, 0xe024aa33, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12885.b2", 0x10000, 0x8041b814, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12886.b3", 0x10000, 0xde32285e, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-12887.b11", 0x10000, 0xf0c0f49d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-12891.a11", 0x10000, 0x90d31a8c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12888.a4", 0x20000, 0x6f2fc63c, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Bloxeedd) -STD_ROM_FN(Bloxeedd) - -static struct BurnRomInfo CltchitrRomDesc[] = { - { "epr-13794.a4", 0x40000, 0xc8d80233, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13795.a6", 0x40000, 0xb0b60b67, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13784.a5", 0x40000, 0x80c8180d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13786.a7", 0x40000, 0x3095dac0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13773.c1", 0x80000, 0x3fc600e5, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13774.c2", 0x80000, 0x2411a824, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13775.c3", 0x80000, 0xcf527bf6, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13779.c10", 0x80000, 0xc707f416, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13787.a10", 0x80000, 0xf05c68c6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13780.c11", 0x80000, 0xa4c341e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13788.a11", 0x80000, 0x0106fea6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13781.c12", 0x80000, 0xf33b13af, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13789.a12", 0x80000, 0x09ba8835, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13793.c7", 0x80000, 0xa3d31944, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13792.c6", 0x80000, 0x808f9695, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13791.c5", 0x80000, 0x35c16d80, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0176.key", 0x02000, 0x9b072430, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Cltchitr) -STD_ROM_FN(Cltchitr) - -static struct BurnRomInfo CltchitrdRomDesc[] = { - { "bootleg_epr-13794.a4", 0x40000, 0xb15de2c5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13795.a6", 0x40000, 0x8fc7e524, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13784.a5", 0x40000, 0x80c8180d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13786.a7", 0x40000, 0x3095dac0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13773.c1", 0x80000, 0x3fc600e5, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13774.c2", 0x80000, 0x2411a824, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13775.c3", 0x80000, 0xcf527bf6, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13779.c10", 0x80000, 0xc707f416, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13787.a10", 0x80000, 0xf05c68c6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13780.c11", 0x80000, 0xa4c341e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13788.a11", 0x80000, 0x0106fea6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13781.c12", 0x80000, 0xf33b13af, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13789.a12", 0x80000, 0x09ba8835, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13793.c7", 0x80000, 0xa3d31944, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13792.c6", 0x80000, 0x808f9695, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13791.c5", 0x80000, 0x35c16d80, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Cltchitrd) -STD_ROM_FN(Cltchitrd) - -static struct BurnRomInfo CltchitrjRomDesc[] = { - { "epr-13783.a4", 0x40000, 0xe2a1d5af, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13796.a6", 0x40000, 0x06001c67, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13785.a5", 0x40000, 0x09714762, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13797.a7", 0x40000, 0x361ade9f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13773.c1", 0x80000, 0x3fc600e5, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13774.c2", 0x80000, 0x2411a824, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13775.c3", 0x80000, 0xcf527bf6, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13779.c10", 0x80000, 0xc707f416, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13787.a10", 0x80000, 0xf05c68c6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13780.c11", 0x80000, 0xa4c341e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13788.a11", 0x80000, 0x0106fea6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13781.c12", 0x80000, 0xf33b13af, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13789.a12", 0x80000, 0x09ba8835, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13782.c13", 0x40000, 0x73790852, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13790.a13", 0x40000, 0x23849101, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13778.c7", 0x20000, 0x35e86146, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13777.c6", 0x80000, 0xd1524782, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13776.c5", 0x80000, 0x282ac9fe, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0175.key", 0x02000, 0x70d9d283, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Cltchitrj) -STD_ROM_FN(Cltchitrj) - -static struct BurnRomInfo CltchitrjdRomDesc[] = { - { "bootleg_epr-13783.a4", 0x40000, 0xdafd48af, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13796.a6", 0x40000, 0x219aae33, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13785.a5", 0x40000, 0x09714762, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13797.a7", 0x40000, 0x361ade9f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13773.c1", 0x80000, 0x3fc600e5, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13774.c2", 0x80000, 0x2411a824, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13775.c3", 0x80000, 0xcf527bf6, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13779.c10", 0x80000, 0xc707f416, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13787.a10", 0x80000, 0xf05c68c6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13780.c11", 0x80000, 0xa4c341e0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13788.a11", 0x80000, 0x0106fea6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13781.c12", 0x80000, 0xf33b13af, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13789.a12", 0x80000, 0x09ba8835, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13782.c13", 0x40000, 0x73790852, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13790.a13", 0x40000, 0x23849101, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13778.c7", 0x20000, 0x35e86146, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13777.c6", 0x80000, 0xd1524782, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-13776.c5", 0x80000, 0x282ac9fe, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Cltchitrjd) -STD_ROM_FN(Cltchitrjd) - -static struct BurnRomInfo DdcrewRomDesc[] = { - { "epr-14160.a4", 0x40000, 0xb9f897b7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14161.a6", 0x40000, 0xbb03c1f0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0190.key", 0x02000, 0x2d502b11, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Ddcrew) -STD_ROM_FN(Ddcrew) - -static struct BurnRomInfo DdcrewdRomDesc[] = { - { "bootleg_epr-14160.a4", 0x40000, 0x22a6c8e3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14161.a6", 0x40000, 0xd9eaba00, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Ddcrewd) -STD_ROM_FN(Ddcrewd) - -static struct BurnRomInfo Ddcrew1RomDesc[] = { - { "epr-14154.a4", 0x40000, 0x9a0dadf0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14155.a6", 0x40000, 0xe74362f4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0187.key", 0x02000, 0x1dfb60be, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Ddcrew1) -STD_ROM_FN(Ddcrew1) - -static struct BurnRomInfo Ddcrew1dRomDesc[] = { - { "bootleg_epr-14154.a4", 0x40000, 0x95749c77, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14155.a6", 0x40000, 0xbef3c932, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Ddcrew1d) -STD_ROM_FN(Ddcrew1d) - -static struct BurnRomInfo Ddcrew2RomDesc[] = { - { "epr-14148.a4", 0x40000, 0xdf4cb0cf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14149.a6", 0x40000, 0x380ff818, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0184.key", 0x02000, 0xcee06254, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Ddcrew2) -STD_ROM_FN(Ddcrew2) - -static struct BurnRomInfo Ddcrew2dRomDesc[] = { - { "bootleg_epr-14148.a4", 0x40000, 0xf3ddb3b9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14149.a6", 0x40000, 0x98a83ee1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Ddcrew2d) -STD_ROM_FN(Ddcrew2d) - -static struct BurnRomInfo DdcrewjRomDesc[] = { - { "epr-14150.a4", 0x40000, 0xfc866b19, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14151.a6", 0x40000, 0x46d23fe4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0185.key", 0x02000, 0xa650b506, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Ddcrewj) -STD_ROM_FN(Ddcrewj) - -static struct BurnRomInfo DdcrewjdRomDesc[] = { - { "bootleg_epr-14150.a4", 0x40000, 0x1f267de5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14151.a6", 0x40000, 0x35074062, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Ddcrewjd) -STD_ROM_FN(Ddcrewjd) - -static struct BurnRomInfo Ddcrewj2RomDesc[] = { - { "epr-14138.a4", 0x40000, 0xdf280b1b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14140.a6", 0x40000, 0x48f223ee, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0182.key", 0x02000, 0x2e8a3601, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Ddcrewj2) -STD_ROM_FN(Ddcrewj2) - -static struct BurnRomInfo Ddcrewj2dRomDesc[] = { - { "bootleg_epr-14138.a4", 0x40000, 0x1a586bb2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14140.a6", 0x40000, 0x43e030ae, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Ddcrewj2d) -STD_ROM_FN(Ddcrewj2d) - -static struct BurnRomInfo DdcrewuRomDesc[] = { - { "epr-14152.a4", 0x40000, 0x69c7b571, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14153.a6", 0x40000, 0xe01fae0c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0186.key", 0x02000, 0x7acaf1fd, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Ddcrewu) -STD_ROM_FN(Ddcrewu) - -static struct BurnRomInfo DdcrewudRomDesc[] = { - { "bootleg_epr-14152.a4", 0x40000, 0x41b782d0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14153.a6", 0x40000, 0x48070486, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14139.a5", 0x40000, 0x06c31531, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mpr-14141.a7", 0x40000, 0x080a494b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-14127.c1", 0x40000, 0x2228cd88, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14128.c2", 0x40000, 0xedba8e10, SYS16_ROM_TILES | BRF_GRA }, - { "epr-14129.c3", 0x40000, 0xe8ecc305, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14134.c10", 0x80000, 0x4fda6a4b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14142.a10", 0x80000, 0x3cbf1f2a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14135.c11", 0x80000, 0xe9c74876, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14143.a11", 0x80000, 0x59022c31, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14136.c12", 0x80000, 0x720d9858, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14144.a12", 0x80000, 0x7775fdd4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14137.c13", 0x80000, 0x846c4265, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-14145.a13", 0x80000, 0x0e76c797, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14133.c7", 0x20000, 0xcff96665, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14132.c6", 0x80000, 0x1fae0220, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14131.c5", 0x80000, 0xbe5a7d0b, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "epr-14130.c4", 0x80000, 0x948f34a1, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Ddcrewud) -STD_ROM_FN(Ddcrewud) - -static struct BurnRomInfo DesertbrRomDesc[] = { - { "epr-14802.a4", 0x080000, 0x9ab93cbc, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14902.a6", 0x080000, 0x6724e7b1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14793.a5", 0x080000, 0xdc9d7af3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14795.a7", 0x080000, 0x7e5bf7d9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14781.c1", 0x100000, 0xc4f7d7aa, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14782.c2", 0x100000, 0xccc98d05, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14783.c3", 0x100000, 0xef202bec, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14788.c10", 0x100000, 0xb5b05536, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14796.a10", 0x100000, 0xc033220a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14789.c11", 0x100000, 0x0f9bcb97, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14797.a11", 0x100000, 0x4c301cc9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14790.c12", 0x100000, 0x6a07ac27, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14798.a12", 0x100000, 0x50634625, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14791.c13", 0x100000, 0xa4ae352b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14799.a13", 0x100000, 0xaeb7b025, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14787.c7", 0x040000, 0xcc6feec7, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14786.c6", 0x080000, 0xcc8349f2, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14785.c5", 0x080000, 0x7babba13, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14784.c4", 0x080000, 0x073878e4, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0196.key", 0x002000, 0xcb942262, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Desertbr) -STD_ROM_FN(Desertbr) - -static struct BurnRomInfo DesertbrdRomDesc[] = { - { "bootleg_epr-14802.a4", 0x80000, 0xaf74af1c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14902.a6", 0x80000, 0xc883404b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14793.a5", 0x80000, 0xdc9d7af3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14795.a7", 0x80000, 0x7e5bf7d9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14781.c1", 0x100000, 0xc4f7d7aa, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14782.c2", 0x100000, 0xccc98d05, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14783.c3", 0x100000, 0xef202bec, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14788.c10", 0x100000, 0xb5b05536, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14796.a10", 0x100000, 0xc033220a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14789.c11", 0x100000, 0x0f9bcb97, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14797.a11", 0x100000, 0x4c301cc9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14790.c12", 0x100000, 0x6a07ac27, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14798.a12", 0x100000, 0x50634625, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14791.c13", 0x100000, 0xa4ae352b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14799.a13", 0x100000, 0xaeb7b025, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14787.c7", 0x40000, 0xcc6feec7, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14786.c6", 0x80000, 0xcc8349f2, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14785.c5", 0x80000, 0x7babba13, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14784.c4", 0x80000, 0x073878e4, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Desertbrd) -STD_ROM_FN(Desertbrd) - -static struct BurnRomInfo DesertbrjRomDesc[] = { - { "epr-14792.a4", 0x080000, 0x453d9d02, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14794.a6", 0x080000, 0x4426758f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14793.a5", 0x080000, 0xdc9d7af3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14795.a7", 0x080000, 0x7e5bf7d9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14781.c1", 0x100000, 0xc4f7d7aa, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14782.c2", 0x100000, 0xccc98d05, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14783.c3", 0x100000, 0xef202bec, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14788.c10", 0x100000, 0xb5b05536, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14796.a10", 0x100000, 0xc033220a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14789.c11", 0x100000, 0x0f9bcb97, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14797.a11", 0x100000, 0x4c301cc9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14790.c12", 0x100000, 0x6a07ac27, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14798.a12", 0x100000, 0x50634625, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14791.c13", 0x100000, 0xa4ae352b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14799.a13", 0x100000, 0xaeb7b025, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14787.c7", 0x040000, 0xcc6feec7, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14786.c6", 0x080000, 0xcc8349f2, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14785.c5", 0x080000, 0x7babba13, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14784.c4", 0x080000, 0x073878e4, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0194.key", 0x002000, 0x40cbc4cb, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Desertbrj) -STD_ROM_FN(Desertbrj) - -static struct BurnRomInfo DesertbrjdRomDesc[] = { - { "bootleg_epr-14792.a4", 0x80000, 0xfd8ed26d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14794.a6", 0x80000, 0x399f167d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14793.a5", 0x80000, 0xdc9d7af3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14795.a7", 0x80000, 0x7e5bf7d9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14781.c1", 0x100000, 0xc4f7d7aa, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14782.c2", 0x100000, 0xccc98d05, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14783.c3", 0x100000, 0xef202bec, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14788.c10", 0x100000, 0xb5b05536, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14796.a10", 0x100000, 0xc033220a, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14789.c11", 0x100000, 0x0f9bcb97, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14797.a11", 0x100000, 0x4c301cc9, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14790.c12", 0x100000, 0x6a07ac27, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14798.a12", 0x100000, 0x50634625, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14791.c13", 0x100000, 0xa4ae352b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14799.a13", 0x100000, 0xaeb7b025, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14787.c7", 0x40000, 0xcc6feec7, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14786.c6", 0x80000, 0xcc8349f2, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14785.c5", 0x80000, 0x7babba13, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14784.c4", 0x80000, 0x073878e4, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Desertbrjd) -STD_ROM_FN(Desertbrjd) - -static struct BurnRomInfo HamawayRomDesc[] = { - { "4.bin", 0x040000, 0xcc0981e1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "6.bin", 0x040000, 0xe8599ee6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "5.bin", 0x040000, 0xfdb247fd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "7.bin", 0x040000, 0x63711470, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "c10.bin", 0x040000, 0xc55cb5cf, SYS16_ROM_TILES | BRF_GRA }, - { "1.bin", 0x040000, 0x33be003f, SYS16_ROM_TILES | BRF_GRA }, - { "c11.bin", 0x040000, 0x37787915, SYS16_ROM_TILES | BRF_GRA }, - { "2.bin", 0x040000, 0x60ca5c9f, SYS16_ROM_TILES | BRF_GRA }, - { "c12.bin", 0x040000, 0xf12f1cf3, SYS16_ROM_TILES | BRF_GRA }, - { "3.bin", 0x040000, 0x520aa7ae, SYS16_ROM_TILES | BRF_GRA }, - - { "c17.bin", 0x040000, 0xaa28d7aa, SYS16_ROM_SPRITES | BRF_GRA }, - { "10.bin", 0x040000, 0xc4c95161, SYS16_ROM_SPRITES | BRF_GRA }, - { "c18.bin", 0x040000, 0x0f8fe8bb, SYS16_ROM_SPRITES | BRF_GRA }, - { "11.bin", 0x040000, 0x2b5eacbc, SYS16_ROM_SPRITES | BRF_GRA }, - { "c19.bin", 0x040000, 0x3c616caa, SYS16_ROM_SPRITES | BRF_GRA }, - { "12.bin", 0x040000, 0xc7bbd579, SYS16_ROM_SPRITES | BRF_GRA }, - - { "c16.bin", 0x040000, 0x913cc18c, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "c15.bin", 0x040000, 0xb53694fc, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Hamaway) -STD_ROM_FN(Hamaway) - -static struct BurnRomInfo LghostRomDesc[] = { - { "epr-13429.a4", 0x40000, 0x09bd65c0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13430.a6", 0x40000, 0x51009fe0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13411.a5", 0x40000, 0x5160167b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13413.a7", 0x40000, 0x656b3bd8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13414.c1", 0x40000, 0xdada2419, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13415.c2", 0x40000, 0xbbb62c48, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13416.c3", 0x40000, 0x1d11dbae, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13604.c10", 0x80000, 0x4009c8e5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13603.a10", 0x80000, 0x5350a94e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13424.c11", 0x80000, 0xfb98d920, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13421.a11", 0x80000, 0x2fc75890, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13425.c12", 0x80000, 0xf8252589, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13422.a12", 0x80000, 0x48a0754d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13426.c13", 0x80000, 0x5cfb1e25, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13423.a13", 0x80000, 0x335bbc9d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13417.c7", 0x20000, 0xcd7beb49, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13420.c6", 0x40000, 0x3de0dee4, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13419.c5", 0x40000, 0xe7021b0a, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13418.c4", 0x40000, 0x0732594d, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0166.key", 0x02000, 0x8379961f, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Lghost) -STD_ROM_FN(Lghost) - -static struct BurnRomInfo LghostdRomDesc[] = { - { "bootleg_epr-13429.a4", 0x40000, 0x3d641671, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13430.a6", 0x40000, 0xf0ba14be, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13411.a5", 0x40000, 0x5160167b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13413.a7", 0x40000, 0x656b3bd8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13414.c1", 0x40000, 0xdada2419, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13415.c2", 0x40000, 0xbbb62c48, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13416.c3", 0x40000, 0x1d11dbae, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13604.c10", 0x80000, 0x4009c8e5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13603.a10", 0x80000, 0x5350a94e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13424.c11", 0x80000, 0xfb98d920, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13421.a11", 0x80000, 0x2fc75890, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13425.c12", 0x80000, 0xf8252589, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13422.a12", 0x80000, 0x48a0754d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13426.c13", 0x80000, 0x5cfb1e25, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13423.a13", 0x80000, 0x335bbc9d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13417.c7", 0x20000, 0xcd7beb49, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13420.c6", 0x40000, 0x3de0dee4, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13419.c5", 0x40000, 0xe7021b0a, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13418.c4", 0x40000, 0x0732594d, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Lghostd) -STD_ROM_FN(Lghostd) - -static struct BurnRomInfo LghostuRomDesc[] = { - { "epr-13427.a4", 0x40000, 0x5bf8fb6b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13428.a6", 0x40000, 0x276775f5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13411.a5", 0x40000, 0x5160167b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13413.a7", 0x40000, 0x656b3bd8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13414.c1", 0x40000, 0xdada2419, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13415.c2", 0x40000, 0xbbb62c48, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13416.c3", 0x40000, 0x1d11dbae, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13604.c10", 0x80000, 0x4009c8e5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13603.a10", 0x80000, 0x5350a94e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13424.c11", 0x80000, 0xfb98d920, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13421.a11", 0x80000, 0x2fc75890, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13425.c12", 0x80000, 0xf8252589, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13422.a12", 0x80000, 0x48a0754d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13426.c13", 0x80000, 0x5cfb1e25, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13423.a13", 0x80000, 0x335bbc9d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13417.c7", 0x20000, 0xcd7beb49, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13420.c6", 0x40000, 0x3de0dee4, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13419.c5", 0x40000, 0xe7021b0a, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13418.c4", 0x40000, 0x0732594d, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0165.key", 0x02000, 0xa04267ab, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Lghostu) -STD_ROM_FN(Lghostu) - -static struct BurnRomInfo LghostudRomDesc[] = { - { "bootleg_epr-13427.a4", 0x40000, 0x8e9e092e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13428.a6", 0x40000, 0x346d4ba3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13411.a5", 0x40000, 0x5160167b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13413.a7", 0x40000, 0x656b3bd8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13414.c1", 0x40000, 0xdada2419, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13415.c2", 0x40000, 0xbbb62c48, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13416.c3", 0x40000, 0x1d11dbae, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13604.c10", 0x80000, 0x4009c8e5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13603.a10", 0x80000, 0x5350a94e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13424.c11", 0x80000, 0xfb98d920, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13421.a11", 0x80000, 0x2fc75890, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13425.c12", 0x80000, 0xf8252589, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13422.a12", 0x80000, 0x48a0754d, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13426.c13", 0x80000, 0x5cfb1e25, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13423.a13", 0x80000, 0x335bbc9d, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13417.c7", 0x20000, 0xcd7beb49, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13420.c6", 0x40000, 0x3de0dee4, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13419.c5", 0x40000, 0xe7021b0a, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13418.c4", 0x40000, 0x0732594d, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Lghostud) -STD_ROM_FN(Lghostud) - -static struct BurnRomInfo MwalkRomDesc[] = { - { "epr-13235.a6", 0x40000, 0x6983e129, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13234.a5", 0x40000, 0xc9fd20f2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13216.b1", 0x40000, 0x862d2c03, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13217.b2", 0x40000, 0x7d1ac3ec, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13218.b3", 0x40000, 0x56d3393c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13224.b11", 0x40000, 0xc59f107b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13231.a11", 0x40000, 0xa5e96346, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13223.b10", 0x40000, 0x364f60ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13230.a10", 0x40000, 0x9550091f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13222.b9", 0x40000, 0x523df3ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13229.a9", 0x40000, 0xf40dc45d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13221.b8", 0x40000, 0x9ae7546a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13228.a8", 0x40000, 0xde3786be, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13225.a4", 0x20000, 0x56c2e82b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13219.b4", 0x40000, 0x19e2061f, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13220.b5", 0x40000, 0x58d4d9ce, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13249.b6", 0x40000, 0x623edc5d, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0159.key", 0x02000, 0x507838f0, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, - - { "315-5437.ic4", 0x01000, 0x4bf63bc1, SYS16_ROM_I8751 | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Mwalk) -STD_ROM_FN(Mwalk) - -static struct BurnRomInfo MwalkdRomDesc[] = { - { "bootleg_epr-13235.a6", 0x40000, 0x9973f6c3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13234.a5", 0x40000, 0xef5098e9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13216.b1", 0x40000, 0x862d2c03, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13217.b2", 0x40000, 0x7d1ac3ec, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13218.b3", 0x40000, 0x56d3393c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13224.b11", 0x40000, 0xc59f107b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13231.a11", 0x40000, 0xa5e96346, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13223.b10", 0x40000, 0x364f60ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13230.a10", 0x40000, 0x9550091f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13222.b9", 0x40000, 0x523df3ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13229.a9", 0x40000, 0xf40dc45d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13221.b8", 0x40000, 0x9ae7546a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13228.a8", 0x40000, 0xde3786be, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13225.a4", 0x20000, 0x56c2e82b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13219.b4", 0x40000, 0x19e2061f, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13220.b5", 0x40000, 0x58d4d9ce, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13249.b6", 0x40000, 0x623edc5d, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "315-5437.ic4", 0x01000, 0x4bf63bc1, SYS16_ROM_I8751 | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Mwalkd) -STD_ROM_FN(Mwalkd) - -static struct BurnRomInfo MwalkjRomDesc[] = { - { "epr-13227.a6", 0x40000, 0x6c0534b3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13226.a5", 0x40000, 0x99765854, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13216.b1", 0x40000, 0x862d2c03, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13217.b2", 0x40000, 0x7d1ac3ec, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13218.b3", 0x40000, 0x56d3393c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13224.b11", 0x40000, 0xc59f107b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13231.a11", 0x40000, 0xa5e96346, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13223.b10", 0x40000, 0x364f60ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13230.a10", 0x40000, 0x9550091f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13222.b9", 0x40000, 0x523df3ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13229.a9", 0x40000, 0xf40dc45d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13221.b8", 0x40000, 0x9ae7546a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13228.a8", 0x40000, 0xde3786be, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13225.a4", 0x20000, 0x56c2e82b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13219.b4", 0x40000, 0x19e2061f, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13220.b5", 0x40000, 0x58d4d9ce, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13249.b6", 0x40000, 0x623edc5d, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0157.key", 0x02000, 0x324d6931, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, - - { "315-5437.ic4", 0x01000, 0x4bf63bc1, SYS16_ROM_I8751 | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Mwalkj) -STD_ROM_FN(Mwalkj) - -static struct BurnRomInfo MwalkjdRomDesc[] = { - { "bootleg_epr-13227.a6", 0x40000, 0xd8e00521, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13226.a5", 0x40000, 0xcb0ba822, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13216.b1", 0x40000, 0x862d2c03, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13217.b2", 0x40000, 0x7d1ac3ec, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13218.b3", 0x40000, 0x56d3393c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13224.b11", 0x40000, 0xc59f107b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13231.a11", 0x40000, 0xa5e96346, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13223.b10", 0x40000, 0x364f60ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13230.a10", 0x40000, 0x9550091f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13222.b9", 0x40000, 0x523df3ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13229.a9", 0x40000, 0xf40dc45d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13221.b8", 0x40000, 0x9ae7546a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13228.a8", 0x40000, 0xde3786be, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13225.a4", 0x20000, 0x56c2e82b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13219.b4", 0x40000, 0x19e2061f, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13220.b5", 0x40000, 0x58d4d9ce, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13249.b6", 0x40000, 0x623edc5d, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "315-5437.ic4", 0x01000, 0x4bf63bc1, SYS16_ROM_I8751 | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Mwalkjd) -STD_ROM_FN(Mwalkjd) - -static struct BurnRomInfo MwalkuRomDesc[] = { - { "epr-13233.a6", 0x40000, 0xf3dac671, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13232.a5", 0x40000, 0x541d8bdf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13216.b1", 0x40000, 0x862d2c03, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13217.b2", 0x40000, 0x7d1ac3ec, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13218.b3", 0x40000, 0x56d3393c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13224.b11", 0x40000, 0xc59f107b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13231.a11", 0x40000, 0xa5e96346, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13223.b10", 0x40000, 0x364f60ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13230.a10", 0x40000, 0x9550091f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13222.b9", 0x40000, 0x523df3ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13229.a9", 0x40000, 0xf40dc45d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13221.b8", 0x40000, 0x9ae7546a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13228.a8", 0x40000, 0xde3786be, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13225.a4", 0x20000, 0x56c2e82b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13219.b4", 0x40000, 0x19e2061f, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13220.b5", 0x40000, 0x58d4d9ce, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13249.b6", 0x40000, 0x623edc5d, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0158.key", 0x02000, 0xa8a50e8c, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, - - { "315-5437.ic4", 0x01000, 0x4bf63bc1, SYS16_ROM_I8751 | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Mwalku) -STD_ROM_FN(Mwalku) - -static struct BurnRomInfo MwalkudRomDesc[] = { - { "bootleg_epr-13233.a6", 0x40000, 0xb34fe725, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13232.a5", 0x40000, 0x0d100fd4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13216.b1", 0x40000, 0x862d2c03, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13217.b2", 0x40000, 0x7d1ac3ec, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-13218.b3", 0x40000, 0x56d3393c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-13224.b11", 0x40000, 0xc59f107b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13231.a11", 0x40000, 0xa5e96346, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13223.b10", 0x40000, 0x364f60ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13230.a10", 0x40000, 0x9550091f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13222.b9", 0x40000, 0x523df3ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13229.a9", 0x40000, 0xf40dc45d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13221.b8", 0x40000, 0x9ae7546a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13228.a8", 0x40000, 0xde3786be, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13225.a4", 0x20000, 0x56c2e82b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13219.b4", 0x40000, 0x19e2061f, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13220.b5", 0x40000, 0x58d4d9ce, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-13249.b6", 0x40000, 0x623edc5d, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "315-5437.ic4", 0x01000, 0x4bf63bc1, SYS16_ROM_I8751 | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Mwalkud) -STD_ROM_FN(Mwalkud) - -static struct BurnRomInfo Mwalkbl2RomDesc[] = { - { "mwalkbl.01", 0x10000, 0xf49cdb16, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mwalkbl.05", 0x10000, 0xc483f29f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mwalkbl.02", 0x10000, 0x0bde1896, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mwalkbl.06", 0x10000, 0x5b9fc688, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mwalkbl.03", 0x10000, 0x0c5fe15c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mwalkbl.07", 0x10000, 0x9e600704, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mwalkbl.04", 0x10000, 0x64692f79, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "mwalkbl.08", 0x10000, 0x546ca530, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr13216.b1", 0x40000, 0x862d2c03, SYS16_ROM_TILES | BRF_GRA }, - { "mpr13217.b2", 0x40000, 0x7d1ac3ec, SYS16_ROM_TILES | BRF_GRA }, - { "mpr13218.b3", 0x40000, 0x56d3393c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr13224.b11", 0x40000, 0xc59f107b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr13231.a11", 0x40000, 0xa5e96346, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr13223.b10", 0x40000, 0x364f60ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr13230.a10", 0x40000, 0x9550091f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr13222.b9", 0x40000, 0x523df3ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr13229.a9", 0x40000, 0xf40dc45d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr13221.b8", 0x40000, 0x9ae7546a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr13228.a8", 0x40000, 0xde3786be, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr13225.a4", 0x20000, 0x56c2e82b, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr13219.b4", 0x40000, 0x19e2061f, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr13220.b5", 0x40000, 0x58d4d9ce, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr13249.b6", 0x40000, 0x623edc5d, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Mwalkbl2) -STD_ROM_FN(Mwalkbl2) - -static struct BurnRomInfo ShdancerRomDesc[] = { - { "epr-12774b.a6", 0x40000, 0x3d5b3fa9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12773b.a5", 0x40000, 0x2596004e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12712.b1", 0x40000, 0x9bdabe3d, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12713.b2", 0x40000, 0x852d2b1c, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12714.b3", 0x40000, 0x448226ce, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12719.b11", 0x40000, 0xd6888534, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12726.a11", 0x40000, 0xff344945, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12718.b10", 0x40000, 0xba2efc0c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12725.a10", 0x40000, 0x268a0c17, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12717.b9", 0x40000, 0xc81cc4f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12724.a9", 0x40000, 0x0f4903dc, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12716.b8", 0x40000, 0xa870e629, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12723.a8", 0x40000, 0xc606cf90, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12987.a4", 0x20000, 0xd1c020cc, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12715.b4", 0x40000, 0x07051a52, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shdancer) -STD_ROM_FN(Shdancer) - -static struct BurnRomInfo Shdancer1RomDesc[] = { - { "epr-12772b.a6", 0x40000, 0x6868a4d4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12771b.a5", 0x40000, 0x04e30c84, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12712.b1", 0x40000, 0x9bdabe3d, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12713.b2", 0x40000, 0x852d2b1c, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12714.b3", 0x40000, 0x448226ce, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12719.b11", 0x40000, 0xd6888534, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12726.a11", 0x40000, 0xff344945, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12718.b10", 0x40000, 0xba2efc0c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12725.a10", 0x40000, 0x268a0c17, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12717.b9", 0x40000, 0xc81cc4f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12724.a9", 0x40000, 0x0f4903dc, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12716.b8", 0x40000, 0xa870e629, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12723.a8", 0x40000, 0xc606cf90, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12720.a4", 0x20000, 0x7a0d8de1, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12715.b4", 0x40000, 0x07051a52, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shdancer1) -STD_ROM_FN(Shdancer1) - -static struct BurnRomInfo ShdancerjRomDesc[] = { - { "epr-12722b.a6", 0x40000, 0xc00552a2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12721b.a5", 0x40000, 0x653d351a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12712.b1", 0x40000, 0x9bdabe3d, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12713.b2", 0x40000, 0x852d2b1c, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-12714.b3", 0x40000, 0x448226ce, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12719.b11", 0x40000, 0xd6888534, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12726.a11", 0x40000, 0xff344945, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12718.b10", 0x40000, 0xba2efc0c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12725.a10", 0x40000, 0x268a0c17, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12717.b9", 0x40000, 0xc81cc4f8, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12724.a9", 0x40000, 0x0f4903dc, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12716.b8", 0x40000, 0xa870e629, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12723.a8", 0x40000, 0xc606cf90, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12720.a4", 0x20000, 0x7a0d8de1, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-12715.b4", 0x40000, 0x07051a52, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shdancerj) -STD_ROM_FN(Shdancerj) - -static struct BurnRomInfo ShdancblRomDesc[] = { - { "ic39", 0x10000, 0xadc1781c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "ic53", 0x10000, 0x1c1ac463, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "ic38", 0x10000, 0xcd6e155b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "ic52", 0x10000, 0xbb3c49a4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "ic37", 0x10000, 0x1bd8d5c3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "ic51", 0x10000, 0xce2e71b4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "ic36", 0x10000, 0xbb861290, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "ic50", 0x10000, 0x7f7b82b1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "ic4", 0x20000, 0xf0a016fe, SYS16_ROM_TILES | BRF_GRA }, - { "ic18", 0x20000, 0xf6bee053, SYS16_ROM_TILES | BRF_GRA }, - { "ic3", 0x20000, 0xe07e6b5d, SYS16_ROM_TILES | BRF_GRA }, - { "ic17", 0x20000, 0xf59deba1, SYS16_ROM_TILES | BRF_GRA }, - { "ic2", 0x20000, 0x60095070, SYS16_ROM_TILES | BRF_GRA }, - { "ic16", 0x20000, 0x0f0d5dd3, SYS16_ROM_TILES | BRF_GRA }, - - { "ic73", 0x10000, 0x59e77c96, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic58", 0x10000, 0x9cd5c8c7, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic74", 0x10000, 0x90ea5407, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic59", 0x10000, 0xff40e872, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic75", 0x10000, 0x27d2fa61, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic60", 0x10000, 0x826d7245, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic76", 0x10000, 0xf36db688, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic61", 0x10000, 0xdcf8068b, SYS16_ROM_SPRITES | BRF_GRA }, - - { "ic77", 0x10000, 0xf93470b7, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic62", 0x10000, 0x50ca8065, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic78", 0x10000, 0xe533be5d, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic63", 0x10000, 0xd1866aa9, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic95", 0x10000, 0x828b8294, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic90", 0x10000, 0x3602b758, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic94", 0x10000, 0xe2fa2b41, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic89", 0x10000, 0x1ba4be93, SYS16_ROM_SPRITES | BRF_GRA }, - - { "ic79", 0x10000, 0xf22548ee, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic64", 0x10000, 0x7a8b7bcc, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic80", 0x10000, 0x6209f7f9, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic65", 0x10000, 0x90ffca14, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic81", 0x10000, 0x34692f23, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic66", 0x10000, 0x5d655517, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic82", 0x10000, 0x7ae40237, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic67", 0x10000, 0x0e5d0855, SYS16_ROM_SPRITES | BRF_GRA }, - - { "ic83", 0x10000, 0xa9040a32, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic68", 0x10000, 0x8d684e53, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic84", 0x10000, 0xd6810031, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic69", 0x10000, 0xc47d32e2, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic92", 0x10000, 0xb57d5cb5, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic88", 0x10000, 0x9de140e1, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic91", 0x10000, 0x49def6c8, SYS16_ROM_SPRITES | BRF_GRA }, - { "ic87", 0x10000, 0x8172a991, SYS16_ROM_SPRITES | BRF_GRA }, - - { "ic45", 0x10000, 0x576b3a81, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "ic46", 0x10000, 0xc84e8c84, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Shdancbl) -STD_ROM_FN(Shdancbl) - -static struct BurnRomInfo WwallyjRomDesc[] = { - { "epr-14730b.a4", 0x040000, 0xe72bc17a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14731b.a6", 0x040000, 0x6e3235b9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14719.c1", 0x040000, 0x8b58c743, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14720.c2", 0x040000, 0xf96d19f4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14721.c3", 0x040000, 0xc4ced91d, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14726.c10", 0x100000, 0x7213d1d3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14732.a10", 0x100000, 0x04ced549, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14727.c11", 0x100000, 0x3b74e0f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14733.a11", 0x100000, 0x6da0444f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14728.c12", 0x080000, 0x5b921587, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14734.a12", 0x080000, 0x6f3f5ed9, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14725.c7", 0x020000, 0x2b29684f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14724.c6", 0x080000, 0x47cbea86, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14723.c5", 0x080000, 0xbc5adc27, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14722.c4", 0x080000, 0x1bd081f8, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0197b.key", 0x002000, 0xf5b7c5b4, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Wwallyj) -STD_ROM_FN(Wwallyj) - -static struct BurnRomInfo WwallyjdRomDesc[] = { - { "bootleg_epr-14730b.a4", 0x40000, 0x1d46f791, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14731b.a6", 0x40000, 0xa0f6325e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14719.c1", 0x40000, 0x8b58c743, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14720.c2", 0x40000, 0xf96d19f4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14721.c3", 0x40000, 0xc4ced91d, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14726.c10", 0x100000, 0x7213d1d3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14732.a10", 0x100000, 0x04ced549, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14727.c11", 0x100000, 0x3b74e0f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14733.a11", 0x100000, 0x6da0444f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14728.c12", 0x80000, 0x5b921587, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14734.a12", 0x80000, 0x6f3f5ed9, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14725.c7", 0x20000, 0x2b29684f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14724.c6", 0x80000, 0x47cbea86, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14723.c5", 0x80000, 0xbc5adc27, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14722.c4", 0x80000, 0x1bd081f8, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Wwallyjd) -STD_ROM_FN(Wwallyjd) - -static struct BurnRomInfo WwallyjaRomDesc[] = { - { "epr-14730a.a4", 0x040000, 0xdaa7880e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-14731a.a6", 0x040000, 0x5e36353b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14719.c1", 0x040000, 0x8b58c743, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14720.c2", 0x040000, 0xf96d19f4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14721.c3", 0x040000, 0xc4ced91d, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14726.c10", 0x100000, 0x7213d1d3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14732.a10", 0x100000, 0x04ced549, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14727.c11", 0x100000, 0x3b74e0f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14733.a11", 0x100000, 0x6da0444f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14728.c12", 0x080000, 0x5b921587, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14734.a12", 0x080000, 0x6f3f5ed9, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14725.c7", 0x020000, 0x2b29684f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14724.c6", 0x080000, 0x47cbea86, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14723.c5", 0x080000, 0xbc5adc27, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14722.c4", 0x080000, 0x1bd081f8, SYS16_ROM_RF5C68DATA | BRF_SND }, - - { "317-0197a.key", 0x002000, 0x2fb6a9a1, SYS16_ROM_KEY | BRF_ESS | BRF_PRG}, -}; - - -STD_ROM_PICK(Wwallyja) -STD_ROM_FN(Wwallyja) - -static struct BurnRomInfo WwallyjadRomDesc[] = { - { "bootleg_epr-14730a.a4", 0x40000, 0x0d9fb6df, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-14731a.a6", 0x40000, 0xb88c140d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14719.c1", 0x40000, 0x8b58c743, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14720.c2", 0x40000, 0xf96d19f4, SYS16_ROM_TILES | BRF_GRA }, - { "mpr-14721.c3", 0x40000, 0xc4ced91d, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-14726.c10", 0x100000, 0x7213d1d3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14732.a10", 0x100000, 0x04ced549, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14727.c11", 0x100000, 0x3b74e0f0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14733.a11", 0x100000, 0x6da0444f, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14728.c12", 0x80000, 0x5b921587, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-14734.a12", 0x80000, 0x6f3f5ed9, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14725.c7", 0x20000, 0x2b29684f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-14724.c6", 0x80000, 0x47cbea86, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14723.c5", 0x80000, 0xbc5adc27, SYS16_ROM_RF5C68DATA | BRF_SND }, - { "mpr-14722.c4", 0x80000, 0x1bd081f8, SYS16_ROM_RF5C68DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Wwallyjad) -STD_ROM_FN(Wwallyjad) - -/*==================================================== -Memory Handlers -====================================================*/ - -static UINT8 misc_io_data[0x10]; - -UINT8 system18_io_chip_r(UINT32 offset) -{ - switch (offset) { - case 0x03: - case 0x07: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return 0xff; - } - - case 0x00: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return 0xff - System16Input[1]; - } - - case 0x01: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return 0xff - System16Input[2]; - } - - case 0x02: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return 0xff - System16Input[3]; - } - - case 0x04: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return 0xff - System16Input[0]; - } - - case 0x05: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return System16Dip[0]; - } - - case 0x06: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return System16Dip[1]; - } - - case 0x08: { - return 'S'; - } - - case 0x09: { - return 'E'; - } - - case 0x0a: { - return 'G'; - } - - case 0x0b: { - return 'A'; - } - - case 0x0c: - case 0x0e: { - return misc_io_data[0x0e]; - } - - case 0x0d: - case 0x0f: { - return misc_io_data[0x0f]; - } - } - - return 0xff; -} - -void system18_io_chip_w(UINT32 offset, UINT16 d) -{ - UINT8 old; - - offset &= 0x1f/2; - - old = misc_io_data[offset]; - misc_io_data[offset] = d; - - switch (offset) { - case 0x00: - case 0x01: - case 0x02: - case 0x04: - case 0x05: - case 0x06: { - return; - } - - case 0x07: { - for (INT32 i = 0; i < 4; i++) { - if (System16TileBanks[0 + i] != ((d & 0xf) * 4 + i)) { - System16TileBanks[0 + i] = (d & 0xf) * 4 + i; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - if (System16TileBanks[4 + i] != (((d >> 4) & 0xf) * 4 + i)) { - System16TileBanks[4 + i] = ((d >> 4) & 0xf) * 4 + i; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - } - return; - } - - case 0x0e: { - System16VideoEnable = d & 0x02; - if ((old ^ d) & 4) System18VdpEnable = d & 0x04; - return; - } - - } -} - -static UINT8 DdcrewReadIO(UINT32 offset) -{ - switch (offset) { - case 0x1810: { - return 0xff - System16Input[3]; - } - - case 0x1811: { - return 0xff - System16Input[4]; - } - - case 0x1812: { - return 0xff - System16Input[5]; - } - } - - return sega_315_5195_io_read(offset); -} - -static UINT8 LghostValue; - -static UINT8 LghostReadIO(UINT32 offset) -{ - switch (offset) { - case 0x1808: - case 0x1809: - case 0x180a: - case 0x180b: { - UINT8 result = LghostValue | 0x7f; - LghostValue <<= 1; - return result; - } - } - - return sega_315_5195_io_read(offset); -} - -static void LghostWriteIO(UINT32 offset, UINT8 d) -{ - switch (offset) { - case 0x1808: { - LghostValue = ~BurnGunReturnY(0); - return; - } - - case 0x1809: { - LghostValue = BurnGunReturnX(0); - return; - } - - case 0x180a: { - LghostValue = (System16AnalogSelect) ? ~BurnGunReturnY(2) : ~BurnGunReturnY(1); - return; - } - - case 0x180b: { - LghostValue = (System16AnalogSelect) ? BurnGunReturnX(2) : BurnGunReturnX(1); - return; - } - - case 0x1810: { - System16AnalogSelect = d & 1; - return; - } - - case 0x181a: { - // ??? - return; - } - } - - sega_315_5195_io_write(offset, d); -} - -static INT16 WwallyTrack1X = 0; -static INT16 WwallyTrack1Y = 0; -static INT16 WwallyTrack2X = 0; -static INT16 WwallyTrack2Y = 0; - -static UINT8 WwallyLastX[2]; -static UINT8 WwallyLastY[2]; - -static UINT8 WwallyReadIO(UINT32 offset) -{ - switch (offset) { - case 0x1800: { - return (WwallyTrack1X - WwallyLastX[0]) & 0xff; - } - - case 0x1802: { - return (WwallyTrack1Y - WwallyLastY[0]) & 0xff; - } - - case 0x1804: { - return (WwallyTrack2X - WwallyLastX[1]) & 0xff; - } - - case 0x1806: { - return (WwallyTrack2Y - WwallyLastY[1]) & 0xff; - } - } - - return sega_315_5195_io_read(offset); -} - -static void WwallyWriteIO(UINT32 offset, UINT8 d) -{ - switch (offset) { - case 0x1800: { - WwallyLastX[0] = WwallyTrack1X; - WwallyLastY[0] = WwallyTrack1Y; - return; - } - - case 0x1804: { - WwallyLastX[1] = WwallyTrack2X; - WwallyLastY[1] = WwallyTrack2Y; - return; - } - } - - sega_315_5195_io_write(offset, d); -} - -void System18GfxBankWrite(UINT32 offset, UINT16 d) -{ - // Tile Banking - if (offset < 8) { - INT32 MaxBanks = System16NumTiles / 1024; - if (d >= MaxBanks) d %= MaxBanks; - if (System16TileBanks[offset] != d) { - System16TileBanks[offset] = d; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - } else { - // Sprite Banking - INT32 MaxBanks = System16SpriteRomSize / 0x40000; - if (d >= MaxBanks) d = 255; - System16SpriteBanks[(offset - 8) * 2 + 0] = d * 2 + 0; - System16SpriteBanks[(offset - 8) * 2 + 1] = d * 2 + 1; - } -} - -void HamawayGfxBankWrite(UINT32 offset, UINT16 d) -{ - if (offset < 8) { - d &= 0x9f; - if (d & 0x80) d += 0x20; - d &= 0x3f; - if (System16TileBanks[offset] != d) { - System16TileBanks[offset] = d; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - } -} - -static UINT16 __fastcall System18ReadWord(UINT32 a) -{ - if (a >= 0xc00000 && a <= 0xc0000f) { - return GenesisVDPRead((a - 0xc00000) >> 1); - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Word -> 0x%06X\n"), a); -#endif - - return 0xffff; -} - -static UINT8 __fastcall System18ReadByte(UINT32 a) -{ - if (a >= 0xa40000 && a <= 0xa4001f) { - return system18_io_chip_r((a - 0xa40000) >> 1); - } - - if (a >= 0xe40000 && a <= 0xe4001f) { - return system18_io_chip_r((a - 0xe40000) >> 1); - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -static void __fastcall System18WriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16BTileWordWrite(a - 0x400000, d); - return; - } - - if (a >= 0xc00000 && a <= 0xc0000f) { - GenesisVDPWrite((a - 0xc00000) >> 1, d); - return; - } - - switch (a) { - case 0xe42000: { - System18VdpMixing = d & 0xff; - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -static void __fastcall System18WriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x400000 && a <= 0x40ffff) { - System16BTileByteWrite((a - 0x400000) ^ 1, d); - return; - } - - if (a >= 0x3e0000 && a <= 0x3e001f) { - System18GfxBankWrite((a - 0x3e0000) >> 1, d); - return; - } - - if (a >= 0xa40000 && a <= 0xa41fff) { - system18_io_chip_w((a - 0xa40000) >> 1, d); - return; - } - - if (a >= 0xc00000 && a <= 0xc0000f) { - GenesisVDPWrite((a - 0xc00000) >> 1, d); - return; - } - - if (a >= 0xe40000 && a <= 0xe41fff) { - system18_io_chip_w((a - 0xe40000) >> 1, d); - return; - } - - switch (a) { - case 0xa42001: - case 0xe42001: { - System18VdpMixing = d & 0xff; - return; - } - - case 0xfe0007: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - ZetClose(); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -static UINT8 __fastcall Mwalkbl2ReadByte(UINT32 a) -{ - switch (a) { - case 0xc40001: { - return System16Dip[0]; - } - - case 0xc40003: { - return System16Dip[1]; - } - - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - return 0xff - System16Input[1]; - } - - case 0xc41005: { - return 0xff - System16Input[2]; - } - - case 0xc41007: { - return 0xff - System16Input[3]; - } - } - - return 0xff; -} - -static void __fastcall Mwalkbl2WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xc40007: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - ZetClose(); - return; - } - - case 0xc46601: { - System16VideoEnable = d & 0x02; - return; - } - - case 0xc46801: { - for (INT32 i = 0; i < 4; i++) { - if (System16TileBanks[0 + i] != ((d & 0xf) * 4 + i)) { - System16TileBanks[0 + i] = (d & 0xf) * 4 + i; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - if (System16TileBanks[4 + i] != (((d >> 4) & 0xf) * 4 + i)) { - System16TileBanks[4 + i] = ((d >> 4) & 0xf) * 4 + i; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - } - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -static void __fastcall Mwalkbl2WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xc46000: { - System16ScrollY[1] = d & 0xff; - return; - } - - case 0xc46200: { - System16ScrollY[0] = d & 0xff; - return; - } - - case 0xc46400: { - BootlegBgPage[0] = (d >> 8) & 0xf; - System16ScrollX[0] = d & 0xff; - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -static UINT8 __fastcall ShdancblReadByte(UINT32 a) -{ - switch (a) { - case 0xc40001: { - return System16Dip[0]; - } - - case 0xc40003: { - return System16Dip[1]; - } - - case 0xc41001: { - return 0xff - System16Input[0]; - } - - case 0xc41003: { - return 0xff - System16Input[1]; - } - - case 0xc41005: { - return 0xff - System16Input[2]; - } - - case 0xc41007: { - return 0xff - System16Input[3]; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -static void __fastcall ShdancblWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xc40007: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO);; - ZetClose(); - return; - } - - case 0xe4001d: { - //System16VideoEnable = d & 0x02; - return; - } - - case 0xe4000f: { - for (INT32 i = 0; i < 4; i++) { - if (System16TileBanks[0 + i] != ((d & 0xf) * 4 + i)) { - System16TileBanks[0 + i] = (d & 0xf) * 4 + i; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - if (System16TileBanks[4 + i] != (((d >> 4) & 0xf) * 4 + i)) { - System16TileBanks[4 + i] = ((d >> 4) & 0xf) * 4 + i; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - } - return; - } - - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -/*==================================================== -Driver inits -====================================================*/ - -static void WwallyMakeAnalogInputs() -{ - if (System16InputPort1[1]) WwallyTrack1X += 0x4; - if (System16InputPort1[2]) WwallyTrack1X -= 0x4; - if (WwallyTrack1X >= 0x100) WwallyTrack1X = 0; - if (WwallyTrack1X < 0) WwallyTrack1X = 0xfc; - - if (System16InputPort1[3]) WwallyTrack1Y -= 0x4; - if (System16InputPort1[4]) WwallyTrack1Y += 0x4; - if (WwallyTrack1Y >= 0x100) WwallyTrack1Y = 0; - if (WwallyTrack1Y < 0) WwallyTrack1Y = 0xfc; - - if (System16InputPort2[1]) WwallyTrack2X += 0x4; - if (System16InputPort2[2]) WwallyTrack2X -= 0x4; - if (WwallyTrack2X >= 0x100) WwallyTrack2X = 0; - if (WwallyTrack2X < 0) WwallyTrack2X = 0xfc; - - if (System16InputPort2[3]) WwallyTrack2Y -= 0x4; - if (System16InputPort2[4]) WwallyTrack2Y += 0x4; - if (WwallyTrack2Y >= 0x100) WwallyTrack2Y = 0; - if (WwallyTrack2Y < 0) WwallyTrack2Y = 0xfc; -} - -static INT32 System18Bank40000Init() -{ - System16SpriteRomSize = 0x800000 - 0x400000; - - INT32 nRet = System16Init(); - - if (!nRet) { - UINT8 *pTemp = (UINT8*)BurnMalloc(0x400000); - if (pTemp) { - memcpy(pTemp, System16Sprites, 0x400000); - memset(System16Sprites, 0, System16SpriteRomSize); - memcpy(System16Sprites + 0x000000, pTemp + 0x000000, 0x100000); - memcpy(System16Sprites + 0x200000, pTemp + 0x100000, 0x100000); - memcpy(System16Sprites + 0x400000, pTemp + 0x200000, 0x100000); - memcpy(System16Sprites + 0x600000, pTemp + 0x300000, 0x100000); - } else { - nRet = 1; - } - BurnFree(pTemp); - } - - return nRet; -} - -static INT32 DdcrewInit() -{ - sega_315_5195_custom_io_do = DdcrewReadIO; - - return System18Bank40000Init(); -} - -static INT32 HamawayInit() -{ - INT32 nRet = System16Init(); - - HammerAway = true; - // game is loud - bring the volumes down - BurnYM3438SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM3438SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); - RF5C68PCMSetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -static INT32 LghostInit() -{ - BurnGunInit(3, true); - - sega_315_5195_custom_io_do = LghostReadIO; - sega_315_5195_custom_io_write_do = LghostWriteIO; - - LaserGhost = true; - - return System18Bank40000Init(); -} - -static INT32 Mwalkbl2PatchRom() -{ - *((UINT16*)(System16Rom + 0x070212)) = 0x4e71; - *((UINT16*)(System16Rom + 0x070116)) = 0x4e71; - *((UINT16*)(System16Rom + 0x00314a)) = 0x4642; - System16Rom[0x00311a] = 0x3f; - System16Rom[0x070103] = 0x00; - System16Rom[0x070109] = 0x00; - System16Rom[0x007727] = 0x00; - System16Rom[0x007729] = 0x00; - System16Rom[0x00780d] = 0x00; - System16Rom[0x00780f] = 0x00; - System16Rom[0x007861] = 0x00; - System16Rom[0x007863] = 0x00; - System16Rom[0x007d47] = 0x00; - System16Rom[0x007863] = 0x00; - System16Rom[0x008533] = 0x00; - System16Rom[0x008535] = 0x00; - System16Rom[0x0085bd] = 0x00; - System16Rom[0x0085bf] = 0x00; - System16Rom[0x009a4b] = 0x00; - System16Rom[0x009a4d] = 0x00; - System16Rom[0x009b2f] = 0x00; - System16Rom[0x009b31] = 0x00; - System16Rom[0x00a05b] = 0x00; - System16Rom[0x00a05d] = 0x00; - System16Rom[0x00a23f] = 0x00; - System16Rom[0x00a241] = 0x00; - System16Rom[0x010159] = 0x00; - System16Rom[0x01015b] = 0x00; - System16Rom[0x0109fb] = 0x00; - System16Rom[0x0109fd] = 0x00; - - return 0; -} - -static void Mwalkbl2Map68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - - SekSetReadWordHandler(0, System18ReadWord); - SekSetWriteWordHandler(0, System18WriteWord); - SekSetReadByteHandler(0, System18ReadByte); - SekSetWriteByteHandler(0, System18WriteByte); - SekClose(); -} - -static INT32 Mwalkbl2Init() -{ - System16CustomLoadRomDo = Mwalkbl2PatchRom; - System16Map68KDo = Mwalkbl2Map68K; - - System16SpriteXOffset = 128; - - INT32 nRet = System16Init(); - - if (!nRet) { - SekOpen(0); - SekMapHandler(1, 0xc40000, 0xc41009, MAP_READ); - SekSetReadByteHandler(1, Mwalkbl2ReadByte); - SekMapHandler(2, 0xc40006, 0xc46801, MAP_WRITE); - SekSetWriteByteHandler(2, Mwalkbl2WriteByte); - SekSetWriteWordHandler(2, Mwalkbl2WriteWord); - SekClose(); - } - - return nRet; -} - -static void ShdancblMap68K() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - - SekSetReadWordHandler(0, System18ReadWord); - SekSetWriteWordHandler(0, System18WriteWord); - SekSetReadByteHandler(0, System18ReadByte); - SekSetWriteByteHandler(0, System18WriteByte); - SekClose(); -} - -static INT32 ShdancblInit() -{ - System16SpriteXOffset = 112; - System16Map68KDo = ShdancblMap68K; - - INT32 nRet = System16Init(); - - if (!nRet) { - SekOpen(0); - SekSetReadByteHandler(0, ShdancblReadByte); - SekSetWriteByteHandler(0, ShdancblWriteByte); - SekClose(); - - System16VideoEnable = 1; - } - - return nRet; -} - -static INT32 WwallyInit() -{ - System16MakeAnalogInputsDo = WwallyMakeAnalogInputs; - sega_315_5195_custom_io_do = WwallyReadIO; - sega_315_5195_custom_io_write_do = WwallyWriteIO; - - return System16Init(); -} - -static INT32 System18Exit() -{ - memset(misc_io_data, 0, sizeof(misc_io_data)); - HammerAway = false; - - GenesisVDPExit(); - - return System16Exit(); -} - -static INT32 System18Scan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(misc_io_data); - - GenesisVDPScan(); - } - - return System16Scan(nAction, pnMin);; -} - -static INT32 LghostExit() -{ - LghostValue = 0; - - return System18Exit(); -} - -static INT32 LghostScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(LghostValue); - } - - return System18Scan(nAction, pnMin);; -} - -static INT32 WwallyExit() -{ - WwallyTrack1X = 0; - WwallyTrack1Y = 0; - WwallyTrack2X = 0; - WwallyTrack2Y = 0; - - memset(WwallyLastX, 0, sizeof(WwallyLastX)); - memset(WwallyLastY, 0, sizeof(WwallyLastY)); - - return System18Exit(); -} - -static INT32 WwallyScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(WwallyTrack1X); - SCAN_VAR(WwallyTrack1Y); - SCAN_VAR(WwallyTrack2X); - SCAN_VAR(WwallyTrack2Y); - SCAN_VAR(WwallyLastX); - SCAN_VAR(WwallyLastY); - } - - return System18Scan(nAction, pnMin);; -} - -/*==================================================== -Driver defs -====================================================*/ - -struct BurnDriver BurnDrvAstorm = { - "astorm", NULL, NULL, NULL, "1990", - "Alien Storm (set 4, World, 2 Players, FD1094 317-0154)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, AstormRomInfo, AstormRomName, NULL, NULL, System18InputInfo, Astorm2pDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAstorm3 = { - "astorm3", "astorm", NULL, NULL, "1990", - "Alien Storm (set 3, World, 3 Players, FD1094 317-0148)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, Astorm3RomInfo, Astorm3RomName, NULL, NULL, AstormInputInfo, AstormDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAstorm3d = { - "astorm3d", "astorm", NULL, NULL, "1990", - "Alien Storm (set 3, World, 3 Players, FD1094 317-0148 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, Astorm3dRomInfo, Astorm3dRomName, NULL, NULL, AstormInputInfo, AstormDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAstormj = { - "astormj", "astorm", NULL, NULL, "1990", - "Alien Storm (set 1, Japan Rev B, 2 Players, FD1094 317-0146)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, AstormjRomInfo, AstormjRomName, NULL, NULL, System18InputInfo, Astorm2pDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAstormjd = { - "astormjd", "astorm", NULL, NULL, "1990", - "Alien Storm (set 1, Japan Rev B, 2 Players, FD1094 317-0146 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, AstormjdRomInfo, AstormjdRomName, NULL, NULL, System18InputInfo, Astorm2pDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAstormu = { - "astormu", "astorm", NULL, NULL, "1990", - "Alien Storm (set 2, US, 3 Players, FD1094 317-0147)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, AstormuRomInfo, AstormuRomName, NULL, NULL, AstormInputInfo, AstormDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAstormud = { - "astormud", "astorm", NULL, NULL, "1990", - "Alien Storm (set 2, US, 3 Players, FD1094 317-0147 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, AstormudRomInfo, AstormudRomName, NULL, NULL, AstormInputInfo, AstormDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBloxeed = { - "bloxeed", NULL, NULL, NULL, "1990", - "Bloxeed (Japan, FD1094 317-0139)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5874, GBF_PUZZLE, 0, - NULL, BloxeedRomInfo, BloxeedRomName, NULL, NULL, System18InputInfo, NULL, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBloxeedd = { - "bloxeedd", "bloxeed", NULL, NULL, "1990", - "Bloxeed (Japan, FD1094 317-0139 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5874, GBF_PUZZLE, 0, - NULL, BloxeeddRomInfo, BloxeeddRomName, NULL, NULL, System18InputInfo, NULL, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCltchitr = { - "cltchitr", NULL, NULL, NULL, "1991", - "Clutch Hitter (set 2, US, FD1094 317-0176)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SPORTSMISC, 0, - NULL, CltchitrRomInfo, CltchitrRomName, NULL, NULL, System18InputInfo, CltchitrDIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCltchitrd = { - "cltchitrd", "cltchitr", NULL, NULL, "1991", - "Clutch Hitter (set 2, US, FD1094 317-0176 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SPORTSMISC, 0, - NULL, CltchitrdRomInfo, CltchitrdRomName, NULL, NULL, System18InputInfo, CltchitrDIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCltchitrj = { - "cltchitrj", "cltchitr", NULL, NULL, "1991", - "Clutch Hitter (set 1, Japan, FD1094 317-0175)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SPORTSMISC, 0, - NULL, CltchitrjRomInfo, CltchitrjRomName, NULL, NULL, System18InputInfo, CltchitrDIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCltchitrjd = { - "cltchitrjd", "cltchitr", NULL, NULL, "1991", - "Clutch Hitter (set 1, Japan, FD1094 317-0175 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SPORTSMISC, 0, - NULL, CltchitrjdRomInfo, CltchitrjdRomName, NULL, NULL, System18InputInfo, CltchitrDIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrew = { - "ddcrew", NULL, NULL, NULL, "1991", - "D. D. Crew (set 4, World, 3 Players, FD1094 317-0190)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, DdcrewRomInfo, DdcrewRomName, NULL, NULL, DdcrewInputInfo, DdcrewDIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrewd = { - "ddcrewd", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 4, World, 3 Players, FD1094 317-0190 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, DdcrewdRomInfo, DdcrewdRomName, NULL, NULL, DdcrewInputInfo, DdcrewDIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrew1 = { - "ddcrew1", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 1, World, 4 Players, FD1094 317-?)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, Ddcrew1RomInfo, Ddcrew1RomName, NULL, NULL, DdcrewuInputInfo, DdcrewuDIPInfo, - DdcrewInit, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrew1d = { - "ddcrew1d", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 1, World, 4 Players, FD1094 317-? decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, Ddcrew1dRomInfo, Ddcrew1dRomName, NULL, NULL, DdcrewuInputInfo, DdcrewuDIPInfo, - DdcrewInit, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrew2 = { - "ddcrew2", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 2, World, 2 Players, FD1094 317-0184)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, Ddcrew2RomInfo, Ddcrew2RomName, NULL, NULL, Ddcrew2InputInfo, Ddcrew2DIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrew2d = { - "ddcrew2d", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 2, World, 2 Players, FD1094 317-0184 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, Ddcrew2dRomInfo, Ddcrew2dRomName, NULL, NULL, Ddcrew2InputInfo, Ddcrew2DIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrewj = { - "ddcrewj", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 5, Japan, 4 Players, FD1094 317-0185)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, DdcrewjRomInfo, DdcrewjRomName, NULL, NULL, DdcrewuInputInfo, DdcrewuDIPInfo, - DdcrewInit, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrewjd = { - "ddcrewjd", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 5, Japan, 4 Players, FD1094 317-0185 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, DdcrewjdRomInfo, DdcrewjdRomName, NULL, NULL, DdcrewuInputInfo, DdcrewuDIPInfo, - DdcrewInit, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrewj2 = { - "ddcrewj2", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 6, Japan, 2 Players, FD1094 317-0182)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, Ddcrewj2RomInfo, Ddcrewj2RomName, NULL, NULL, Ddcrew2InputInfo, Ddcrew2DIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrewj2d = { - "ddcrewj2d", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 6, Japan, 2 Players, FD1094 317-0182 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, Ddcrewj2dRomInfo, Ddcrewj2dRomName, NULL, NULL, Ddcrew2InputInfo, Ddcrew2DIPInfo, - System18Bank40000Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrewu = { - "ddcrewu", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 3, US, 4 Players, FD1094 317-0186)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, DdcrewuRomInfo, DdcrewuRomName, NULL, NULL, DdcrewuInputInfo, DdcrewuDIPInfo, - DdcrewInit, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDdcrewud = { - "ddcrewud", "ddcrew", NULL, NULL, "1991", - "D. D. Crew (set 3, US, 4 Players, FD1094 317-0186 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 4, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SCRFIGHT, 0, - NULL, DdcrewudRomInfo, DdcrewudRomName, NULL, NULL, DdcrewuInputInfo, DdcrewuDIPInfo, - DdcrewInit, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDesertbr = { - "desertbr", NULL, NULL, NULL, "1992", - "Desert Breaker (World, FD1094 317-0196)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_VERSHOOT, 0, - NULL, DesertbrRomInfo, DesertbrRomName, NULL, NULL, DesertbrInputInfo, DesertbrDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDesertbrd = { - "desertbrd", "desertbr", NULL, NULL, "1992", - "Desert Breaker (World, FD1094 317-0196 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_VERSHOOT, 0, - NULL, DesertbrdRomInfo, DesertbrdRomName, NULL, NULL, DesertbrInputInfo, DesertbrDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDesertbrj = { - "desertbrj", "desertbr", NULL, NULL, "1992", - "Desert Breaker (Japan, FD1094 317-0194)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_VERSHOOT, 0, - NULL, DesertbrjRomInfo, DesertbrjRomName, NULL, NULL, DesertbrInputInfo, DesertbrDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDesertbrjd = { - "desertbrjd", "desertbr", NULL, NULL, "1992", - "Desert Breaker (Japan, FD1094 317-0194 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_BOOTLEG, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_VERSHOOT, 0, - NULL, DesertbrjdRomInfo, DesertbrjdRomName, NULL, NULL, DesertbrInputInfo, DesertbrDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvHamaway = { - "hamaway", NULL, NULL, NULL, "1992", - "Hammer Away (prototype)\0", NULL, "Sega / Santos", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_PROTOTYPE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_837_7525, GBF_PUZZLE, 0, - NULL, HamawayRomInfo, HamawayRomName, NULL, NULL, System18InputInfo, HamawayDIPInfo, - HamawayInit, WwallyExit, System18Frame, NULL, WwallyScan, - NULL, 0x1800, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvLghost = { - "lghost", NULL, NULL, NULL, "1990", - "Laser Ghost (set 2, World, 317-0166)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SHOOT, 0, - NULL, LghostRomInfo, LghostRomName, NULL, NULL, LghostInputInfo, LghostDIPInfo, - LghostInit, LghostExit, System18Frame, NULL, LghostScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLghostd = { - "lghostd", "lghost", NULL, NULL, "1990", - "Laser Ghost (set 2, World, 317-0166 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SHOOT, 0, - NULL, LghostdRomInfo, LghostdRomName, NULL, NULL, LghostInputInfo, LghostDIPInfo, - LghostInit, LghostExit, System18Frame, NULL, LghostScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLghostu = { - "lghostu", "lghost", NULL, NULL, "1990", - "Laser Ghost (set 1, US, 317-0165)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_SHOOT, 0, - NULL, LghostuRomInfo, LghostuRomName, NULL, NULL, LghostInputInfo, LghostDIPInfo, - LghostInit, LghostExit, System18Frame, NULL, LghostScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLghostud = { - "lghostud", "lghost", NULL, NULL, "1990", - "Laser Ghost (set 1, US, 317-0165 decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_SHOOT, 0, - NULL, LghostudRomInfo, LghostudRomName, NULL, NULL, LghostInputInfo, LghostDIPInfo, - LghostInit, LghostExit, System18Frame, NULL, LghostScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMWalk = { - "mwalk", NULL, NULL, NULL, "1990", - "Michael Jackson's Moonwalker (set 3, World, FD1094/8751 317-0159)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, MwalkRomInfo, MwalkRomName, NULL, NULL, MwalkInputInfo, MwalkDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMWalkd = { - "mwalkd", "mwalk", NULL, NULL, "1990", - "Michael Jackson's Moonwalker (World) (bootleg of FD1094/8751 317-0159)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, MwalkdRomInfo, MwalkdRomName, NULL, NULL, MwalkInputInfo, MwalkDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMWalkj = { - "mwalkj", "mwalk", NULL, NULL, "1990", - "Michael Jackson's Moonwalker (Japan) (FD1094/8751 317-0157)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, MwalkjRomInfo, MwalkjRomName, NULL, NULL, MwalkInputInfo, MwalkDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMWalkjd = { - "mwalkjd", "mwalk", NULL, NULL, "1990", - "Michael Jackson's Moonwalker (Japan) (bootleg of FD1094/8751 317-0157 set)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, MwalkjdRomInfo, MwalkjdRomName, NULL, NULL, MwalkInputInfo, MwalkDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMWalku = { - "mwalku", "mwalk", NULL, NULL, "1990", - "Michael Jackson's Moonwalker (US) (FD1094/8751 317-0158)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, MwalkuRomInfo, MwalkuRomName, NULL, NULL, MwalkInputInfo, MwalkuDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMWalkud = { - "mwalkud", "mwalk", NULL, NULL, "1990", - "Michael Jackson's Moonwalker (US) (bootleg of FD1094/8751 317-0158)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 3, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5874, GBF_PLATFORM, 0, - NULL, MwalkudRomInfo, MwalkudRomName, NULL, NULL, MwalkInputInfo, MwalkuDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMWalkbl2 = { - "mwalkbl2", "mwalk", NULL, NULL, "1990", - "Michael Jackson's Moonwalker (bootleg)\0", NULL, "bootleg", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 3, HARDWARE_SEGA_SYSTEM18, GBF_PLATFORM, 0, - NULL, Mwalkbl2RomInfo, Mwalkbl2RomName, NULL, NULL, MwalkInputInfo, MwalkDIPInfo, - Mwalkbl2Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShdancer = { - "shdancer", NULL, NULL, NULL, "1989", - "Shadow Dancer (set 3, US)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_SHADOW, GBF_PLATFORM, 0, - NULL, ShdancerRomInfo, ShdancerRomName, NULL, NULL, System18InputInfo, ShdancerDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShdancer1 = { - "shdancer1", "shdancer", NULL, NULL, "1989", - "Shadow Dancer (set 1)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_SHADOW, GBF_PLATFORM, 0, - NULL, Shdancer1RomInfo, Shdancer1RomName, NULL, NULL, System18InputInfo, ShdancerDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvShdancerj = { - "shdancerj", "shdancer", NULL, NULL, "1989", - "Shadow Dancer (set 2, Japan)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_SHADOW, GBF_PLATFORM, 0, - NULL, ShdancerjRomInfo, ShdancerjRomName, NULL, NULL, System18InputInfo, ShdancerDIPInfo, - System16Init, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvShdancbl = { - "shdancbl", "shdancer", NULL, NULL, "1989", - "Shadow Dancer (bootleg)\0", NULL, "bootleg", "System 18", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_INVERT_TILES, GBF_PLATFORM, 0, - NULL, ShdancblRomInfo, ShdancblRomName, NULL, NULL, System18InputInfo, ShdancerDIPInfo, - ShdancblInit, System18Exit, System18Frame, NULL, System18Scan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWwallyj = { - "wwallyj", NULL, NULL, NULL, "1992", - "Wally wo Sagase! (rev B, Japan, FD1094 317-0197B)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_PUZZLE, 0, - NULL, WwallyjRomInfo, WwallyjRomName, NULL, NULL, WwallyInputInfo, WwallyDIPInfo, - WwallyInit, WwallyExit, System18Frame, NULL, WwallyScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWwallyjd = { - "wwallyjd", "wwallyj", NULL, NULL, "1992", - "Wally wo Sagase! (rev B, Japan, FD1094 317-0197B decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_PUZZLE, 0, - NULL, WwallyjdRomInfo, WwallyjdRomName, NULL, NULL, WwallyInputInfo, WwallyDIPInfo, - WwallyInit, WwallyExit, System18Frame, NULL, WwallyScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWwallyja = { - "wwallyja", "wwallyj", NULL, NULL, "1992", - "Wally wo Sagase! (rev A, Japan, FD1094 317-0197A)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_FD1094_ENC | HARDWARE_SEGA_171_5987, GBF_PUZZLE, 0, - NULL, WwallyjaRomInfo, WwallyjaRomName, NULL, NULL, WwallyInputInfo, WwallyDIPInfo, - WwallyInit, WwallyExit, System18Frame, NULL, WwallyScan, - NULL, 0x1800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvWwallyjad = { - "wwallyjad", "wwallyj", NULL, NULL, "1992", - "Wally wo Sagase! (rev A, Japan, FD1094 317-0197A decrypted)\0", NULL, "Sega", "System 18", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEM18 | HARDWARE_SEGA_171_5987, GBF_PUZZLE, 0, - NULL, WwallyjadRomInfo, WwallyjadRomName, NULL, NULL, WwallyInputInfo, WwallyDIPInfo, - WwallyInit, WwallyExit, System18Frame, NULL, WwallyScan, - NULL, 0x1800, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_xbrd.cpp b/jan/src/burn/drv/sega/d_xbrd.cpp deleted file mode 100644 index aa7001b40..000000000 --- a/jan/src/burn/drv/sega/d_xbrd.cpp +++ /dev/null @@ -1,3941 +0,0 @@ -#include "sys16.h" -#include "segapcm.h" - -/*==================================================== -Input defs -====================================================*/ - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo AbcopInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - {"Jump" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Abcop) - -static struct BurnInputInfo Aburner2InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Up/Down" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 y-axis" ), - A("Throttle" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 z-axis" ), - {"Vulcan" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 1" }, - {"Missile" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Aburner2) - -static struct BurnInputInfo GpriderInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - {"Shift Down" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 3" }, - {"Shift Up" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 4" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Gprider) - -static struct BurnInputInfo LastsurvInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - {"P1 Up" , BIT_DIGITAL , System16InputPort2 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , System16InputPort2 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , System16InputPort2 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , System16InputPort2 + 1, "p1 right" }, - {"P1 Turn Left" , BIT_DIGITAL , System16InputPort6 + 0, "p1 fire 2" }, - {"P1 Turn Right" , BIT_DIGITAL , System16InputPort6 + 1, "p1 fire 3" }, - {"P1 Fire" , BIT_DIGITAL , System16InputPort3 + 4, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , System16InputPort1 + 2, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , System16InputPort1 + 3, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , System16InputPort1 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , System16InputPort1 + 1, "p2 right" }, - {"P2 Turn Left" , BIT_DIGITAL , System16InputPort6 + 2, "p2 fire 2" }, - {"P2 Turn Right" , BIT_DIGITAL , System16InputPort6 + 3, "p2 fire 3" }, - {"P2 Fire" , BIT_DIGITAL , System16InputPort3 + 0, "p2 fire 1" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Service 2" , BIT_DIGITAL , System16InputPort0 + 3 , "service 2" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Lastsurv) - -static struct BurnInputInfo LoffireInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("P1 X-Axis" , BIT_ANALOG_REL, &System16AnalogPort0, "mouse x-axis" ), - A("P1 Y-Axis" , BIT_ANALOG_REL, &System16AnalogPort1, "mouse y-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort1 + 7, "mouse button 1" }, - {"P1 Fire 2" , BIT_DIGITAL , System16InputPort1 + 6, "mouse button 2" }, - - A("P2 X-Axis" , BIT_ANALOG_REL, &System16AnalogPort2, "p2 x-axis" ), - A("P2 Y-Axis" , BIT_ANALOG_REL, &System16AnalogPort3, "p2 y-axis" ), - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort1 + 5, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , System16InputPort1 + 4, "p2 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Service 2" , BIT_DIGITAL , System16InputPort0 + 3 , "service2" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Loffire) - -static struct BurnInputInfo RacheroInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - {"Move to centre" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 3" }, - {"Suicide" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 4" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Rachero) - -static struct BurnInputInfo SmgpInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - {"Shift Down" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 3" }, - {"Shift Up" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 4" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Smgp) - -static struct BurnInputInfo ThndrbldInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Up/Down" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 y-axis" ), - A("Throttle" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 z-axis" ), - {"Cannon" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 1" }, - {"Missile" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Thndrbld) - -#undef A - -/*==================================================== -Dip Defs -====================================================*/ - -#define BOARDX_COINAGE(dipval) \ - {0 , 0xfe, 0 , 16 , "Coin A" }, \ - {dipval, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x05, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0x0f, 0x04, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x01, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0x0f, 0x02, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0x0f, 0x03, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0x0f, 0x00, "Free Play (if coin B too) or 1C/1C" }, \ - \ - {0 , 0xfe, 0 , 16 , "Coin B" }, \ - {dipval, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x50, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0xf0, 0x40, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x10, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0xf0, 0x20, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0xf0, 0x30, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0xf0, 0x00, "Free Play (if coin A too) or 1C/1C" }, - -static struct BurnDIPInfo AbcopDIPList[]= -{ - // Default Values - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0xf9, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x09) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Credits" }, - {0x0a, 0x01, 0x01, 0x01, "1 to start, 1 to continue" }, - {0x0a, 0x01, 0x01, 0x00, "2 to start, 1 to continue" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x02, 0x02, "Off" }, - {0x0a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0a, 0x01, 0x04, 0x04, "No" }, - {0x0a, 0x01, 0x04, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Time" }, - {0x0a, 0x01, 0x30, 0x10, "Easy" }, - {0x0a, 0x01, 0x30, 0x30, "Normal" }, - {0x0a, 0x01, 0x30, 0x20, "Hard" }, - {0x0a, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0a, 0x01, 0xc0, 0x40, "Easy" }, - {0x0a, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0a, 0x01, 0xc0, 0x80, "Hard" }, - {0x0a, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Abcop) - -static struct BurnDIPInfo Aburner2DIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xcd, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Cabinet Type" }, - {0x0c, 0x01, 0x03, 0x03, "Moving Deluxe" }, - {0x0c, 0x01, 0x03, 0x02, "Moving Standard" }, - {0x0c, 0x01, 0x03, 0x01, "Upright 1" }, - {0x0c, 0x01, 0x03, 0x00, "Upright 2" }, - - {0 , 0xfe, 0 , 2 , "Throttle Lever" }, - {0x0c, 0x01, 0x04, 0x00, "No" }, - {0x0c, 0x01, 0x04, 0x04, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0c, 0x01, 0x08, 0x08, "3" }, - {0x0c, 0x01, 0x08, 0x00, "4" }, - - {0 , 0xfe, 0 , 2 , "Ship Increase" }, - {0x0c, 0x01, 0x10, 0x10, "No" }, - {0x0c, 0x01, 0x10, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x20, 0x20, "No" }, - {0x0c, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x80, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x40, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Aburner2) - -static struct BurnDIPInfo AburnerDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xc1, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Cabinet Type" }, - {0x0c, 0x01, 0x03, 0x03, "Moving Deluxe" }, - {0x0c, 0x01, 0x03, 0x02, "Moving Standard" }, - {0x0c, 0x01, 0x03, 0x01, "Upright 1" }, - {0x0c, 0x01, 0x03, 0x00, "Upright 2" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0c, 0x01, 0x10, 0x10, "3" }, - {0x0c, 0x01, 0x10, 0x00, "3 x credits" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x20, 0x20, "No" }, - {0x0c, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x80, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x40, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Aburner) - -static struct BurnDIPInfo GpriderDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet Type" }, - {0x0c, 0x01, 0x03, 0x03, "Ride On" }, - {0x0c, 0x01, 0x03, 0x02, "Upright" }, - - {0 , 0xfe, 0 , 2 , "ID Number" }, - {0x0c, 0x01, 0x08, 0x08, "Main" }, - {0x0c, 0x01, 0x08, 0x00, "Slave" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x10, 0x00, "Off" }, - {0x0c, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x80, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x40, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Gprider) - -static struct BurnDIPInfo LastsurvDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xbf, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x14) - - // Dip 2 - {0 , 0xfe, 0 , 4 , "ID No" }, - {0x15, 0x01, 0x03, 0x03, "1" }, - {0x15, 0x01, 0x03, 0x02, "2" }, - {0x15, 0x01, 0x03, 0x01, "3" }, - {0x15, 0x01, 0x03, 0x00, "4" }, - - {0 , 0xfe, 0 , 3 , "Network" }, - {0x15, 0x01, 0x0c, 0x0c, "Off" }, - {0x15, 0x01, 0x0c, 0x08, "On (2)" }, - {0x15, 0x01, 0x0c, 0x04, "On (4)" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x30, 0x20, "Easy" }, - {0x15, 0x01, 0x30, 0x30, "Normal" }, - {0x15, 0x01, 0x30, 0x10, "Hard" }, - {0x15, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x15, 0x01, 0x80, 0x80, "Single" }, - {0x15, 0x01, 0x80, 0x00, "Twin" }, -}; - -STDDIPINFO(Lastsurv) - -static struct BurnDIPInfo LoffireDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0x9c, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x0e) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0f, 0x01, 0x01, 0x01, "Japanese" }, - {0x0f, 0x01, 0x01, 0x00, "English" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x02, 0x02, "Cockpit" }, - {0x0f, 0x01, 0x02, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "2 Credits to start" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0f, 0x01, 0x18, 0x10, "Easy" }, - {0x0f, 0x01, 0x18, 0x18, "Normal" }, - {0x0f, 0x01, 0x18, 0x08, "Hard" }, - {0x0f, 0x01, 0x18, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0f, 0x01, 0x20, 0x20, "No" }, - {0x0f, 0x01, 0x20, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x0f, 0x01, 0x80, 0x80, "Single" }, - {0x0f, 0x01, 0x80, 0x00, "Twin" }, -}; - -STDDIPINFO(Loffire) - -static struct BurnDIPInfo RacheroDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xf9, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Credits" }, - {0x0c, 0x01, 0x01, 0x01, "1 to start, 1 to continue" }, - {0x0c, 0x01, 0x01, 0x00, "2 to start, 1 to continue" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x02, 0x02, "Off" }, - {0x0c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x04, 0x04, "No" }, - {0x0c, 0x01, 0x04, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Time" }, - {0x0c, 0x01, 0x30, 0x10, "Easy" }, - {0x0c, 0x01, 0x30, 0x30, "Normal" }, - {0x0c, 0x01, 0x30, 0x20, "Hard" }, - {0x0c, 0x01, 0x30, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x40, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x80, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Very Hard" }, -}; - -STDDIPINFO(Rachero) - -static struct BurnDIPInfo SmgpDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 8 , "Machine ID" }, - {0x0c, 0x01, 0x07, 0x07, "1" }, - {0x0c, 0x01, 0x07, 0x06, "2" }, - {0x0c, 0x01, 0x07, 0x05, "3" }, - {0x0c, 0x01, 0x07, 0x04, "4" }, - {0x0c, 0x01, 0x07, 0x03, "5" }, - {0x0c, 0x01, 0x07, 0x02, "6" }, - {0x0c, 0x01, 0x07, 0x01, "7" }, - {0x0c, 0x01, 0x07, 0x00, "8" }, - - {0 , 0xfe, 0 , 8 , "Number of Machines" }, - {0x0c, 0x01, 0x38, 0x38, "1" }, - {0x0c, 0x01, 0x38, 0x30, "2" }, - {0x0c, 0x01, 0x38, 0x28, "3" }, - {0x0c, 0x01, 0x38, 0x20, "4" }, - {0x0c, 0x01, 0x38, 0x18, "5" }, - {0x0c, 0x01, 0x38, 0x10, "6" }, - {0x0c, 0x01, 0x38, 0x08, "7" }, - {0x0c, 0x01, 0x38, 0x00, "8" }, - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x0c, 0x01, 0xc0, 0xc0, "Deluxe" }, - {0x0c, 0x01, 0xc0, 0x80, "Cockpit" }, - {0x0c, 0x01, 0xc0, 0x40, "Upright" }, -}; - -STDDIPINFO(Smgp) - -static struct BurnDIPInfo ThndrbldDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet Type" }, - {0x0c, 0x01, 0x01, 0x01, "Econ Upright" }, - {0x0c, 0x01, 0x01, 0x00, "Mini Upright" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x02, 0x02, "Off" }, - {0x0c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Time" }, - {0x0c, 0x01, 0x04, 0x04, "30 sec" }, - {0x0c, 0x01, 0x04, 0x00, "0 sec" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0c, 0x01, 0x18, 0x08, "2" }, - {0x0c, 0x01, 0x18, 0x18, "3" }, - {0x0c, 0x01, 0x18, 0x10, "4" }, - {0x0c, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x20, 0x00, "No" }, - {0x0c, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x40, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x80, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Thndrbld) - -static struct BurnDIPInfo Thndrbld1DIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xfd, NULL }, - - // Dip 1 - BOARDX_COINAGE(0x0b) - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Cabinet Type" }, - {0x0c, 0x01, 0x01, 0x01, "Deluxe" }, - {0x0c, 0x01, 0x01, 0x00, "Standing" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x02, 0x02, "Off" }, - {0x0c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Time" }, - {0x0c, 0x01, 0x04, 0x04, "30 sec" }, - {0x0c, 0x01, 0x04, 0x00, "0 sec" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0c, 0x01, 0x18, 0x08, "2" }, - {0x0c, 0x01, 0x18, 0x18, "3" }, - {0x0c, 0x01, 0x18, 0x10, "4" }, - {0x0c, 0x01, 0x18, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x20, 0x00, "No" }, - {0x0c, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0xc0, 0x40, "Easy" }, - {0x0c, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0c, 0x01, 0xc0, 0x80, "Hard" }, - {0x0c, 0x01, 0xc0, 0x00, "Hardest" }, -}; - -STDDIPINFO(Thndrbld1) - -#undef BOARDX_COINAGE - -/*==================================================== -Rom Defs -====================================================*/ - -static struct BurnRomInfo AbcopRomDesc[] = { - { "epr-13568b.ic58", 0x20000, 0xf88db35b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13556b.ic63", 0x20000, 0x337bf32e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13559.ic57", 0x20000, 0x4588bf19, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13558.ic62", 0x20000, 0x11259ed4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13566.ic20", 0x20000, 0x22e52f32, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13565.ic29", 0x20000, 0xa21784bd, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-13553.ic154", 0x10000, 0x8c418837, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13554.ic153", 0x10000, 0x4e3df9f0, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13555.ic152", 0x10000, 0x6c4a1d42, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13552.ic90", 0x20000, 0xcc2cf706, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13551.ic94", 0x20000, 0xd6f276c1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13550.ic98", 0x20000, 0xf16518dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13549.ic102", 0x20000, 0xcba407a7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13548.ic91", 0x20000, 0x080fd805, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13547.ic95", 0x20000, 0x42d4dd68, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13546.ic99", 0x20000, 0xca6fbf3d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13545.ic103", 0x20000, 0xc9e58dd2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13544.ic92", 0x20000, 0x9c1436d9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13543.ic96", 0x20000, 0x2c1c8f0e, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13542.ic100", 0x20000, 0x01fd52b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13541.ic104", 0x20000, 0xa45c547b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13540.ic93", 0x20000, 0x84b42ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13539.ic97", 0x20000, 0xcd6e524f, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13538.ic101", 0x20000, 0xbf9a4586, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13537.ic105", 0x20000, 0xfa14ed3e, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-13564.ic40", 0x10000, 0xe70ba138, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-13560.ic17", 0x10000, 0x83050925, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13563.ic11", 0x20000, 0x4083e74f, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-13562.ic12", 0x20000, 0x3cc3968f, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-13561.ic13", 0x20000, 0x80a7c02a, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0169b.key", 0x02000, 0x058da36e, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Abcop) -STD_ROM_FN(Abcop) - -static struct BurnRomInfo AbcopdRomDesc[] = { - { "bootleg_epr13568b.ic58", 0x20000, 0x3c367a01, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr13556b.ic63", 0x20000, 0x1078246e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13559.ic57", 0x20000, 0x4588bf19, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13558.ic62", 0x20000, 0x11259ed4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13566.ic20", 0x20000, 0x22e52f32, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13565.ic29", 0x20000, 0xa21784bd, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-13553.ic154", 0x10000, 0x8c418837, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13554.ic153", 0x10000, 0x4e3df9f0, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13555.ic152", 0x10000, 0x6c4a1d42, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13552.ic90", 0x20000, 0xcc2cf706, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13551.ic94", 0x20000, 0xd6f276c1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13550.ic98", 0x20000, 0xf16518dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13549.ic102", 0x20000, 0xcba407a7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13548.ic91", 0x20000, 0x080fd805, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13547.ic95", 0x20000, 0x42d4dd68, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13546.ic99", 0x20000, 0xca6fbf3d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13545.ic103", 0x20000, 0xc9e58dd2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13544.ic92", 0x20000, 0x9c1436d9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13543.ic96", 0x20000, 0x2c1c8f0e, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13542.ic100", 0x20000, 0x01fd52b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13541.ic104", 0x20000, 0xa45c547b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13540.ic93", 0x20000, 0x84b42ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13539.ic97", 0x20000, 0xcd6e524f, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13538.ic101", 0x20000, 0xbf9a4586, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13537.ic105", 0x20000, 0xfa14ed3e, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-13564.ic40", 0x10000, 0xe70ba138, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-13560.ic17", 0x10000, 0x83050925, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13563.ic11", 0x20000, 0x4083e74f, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-13562.ic12", 0x20000, 0x3cc3968f, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-13561.ic13", 0x20000, 0x80a7c02a, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Abcopd) -STD_ROM_FN(Abcopd) - -static struct BurnRomInfo AbcopjRomDesc[] = { - { "epr-13557b.ic58", 0x20000, 0x554e106a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13556b.ic63", 0x20000, 0x337bf32e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13559.ic57", 0x20000, 0x4588bf19, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13558.ic62", 0x20000, 0x11259ed4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13566.ic20", 0x20000, 0x22e52f32, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13565.ic29", 0x20000, 0xa21784bd, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-13553.ic154", 0x10000, 0x8c418837, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13554.ic153", 0x10000, 0x4e3df9f0, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13555.ic152", 0x10000, 0x6c4a1d42, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13552.ic90", 0x20000, 0xcc2cf706, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13551.ic94", 0x20000, 0xd6f276c1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13550.ic98", 0x20000, 0xf16518dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13549.ic102", 0x20000, 0xcba407a7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13548.ic91", 0x20000, 0x080fd805, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13547.ic95", 0x20000, 0x42d4dd68, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13546.ic99", 0x20000, 0xca6fbf3d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13545.ic103", 0x20000, 0xc9e58dd2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13544.ic92", 0x20000, 0x9c1436d9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13543.ic96", 0x20000, 0x2c1c8f0e, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13542.ic100", 0x20000, 0x01fd52b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13541.ic104", 0x20000, 0xa45c547b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13540.ic93", 0x20000, 0x84b42ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13539.ic97", 0x20000, 0xcd6e524f, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13538.ic101", 0x20000, 0xbf9a4586, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13537.ic105", 0x20000, 0xfa14ed3e, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-13564.ic40", 0x10000, 0xe70ba138, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-13560.ic17", 0x10000, 0x83050925, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13563.ic11", 0x20000, 0x4083e74f, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-13562.ic12", 0x20000, 0x3cc3968f, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-13561.ic13", 0x20000, 0x80a7c02a, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0169b.key", 0x02000, 0x058da36e, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Abcopj) -STD_ROM_FN(Abcopj) - -static struct BurnRomInfo AbcopjdRomDesc[] = { - { "bootleg_epr-13557b.ic58", 0x20000, 0x91f5d930, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13556b.ic63", 0x20000, 0x1078246e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13559.ic57", 0x20000, 0x4588bf19, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13558.ic62", 0x20000, 0x11259ed4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13566.ic20", 0x20000, 0x22e52f32, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13565.ic29", 0x20000, 0xa21784bd, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-13553.ic154", 0x10000, 0x8c418837, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13554.ic153", 0x10000, 0x4e3df9f0, SYS16_ROM_TILES | BRF_GRA }, - { "opr-13555.ic152", 0x10000, 0x6c4a1d42, SYS16_ROM_TILES | BRF_GRA }, - - { "opr-13552.ic90", 0x20000, 0xcc2cf706, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13551.ic94", 0x20000, 0xd6f276c1, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13550.ic98", 0x20000, 0xf16518dd, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13549.ic102", 0x20000, 0xcba407a7, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13548.ic91", 0x20000, 0x080fd805, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13547.ic95", 0x20000, 0x42d4dd68, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13546.ic99", 0x20000, 0xca6fbf3d, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13545.ic103", 0x20000, 0xc9e58dd2, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13544.ic92", 0x20000, 0x9c1436d9, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13543.ic96", 0x20000, 0x2c1c8f0e, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13542.ic100", 0x20000, 0x01fd52b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13541.ic104", 0x20000, 0xa45c547b, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13540.ic93", 0x20000, 0x84b42ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13539.ic97", 0x20000, 0xcd6e524f, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13538.ic101", 0x20000, 0xbf9a4586, SYS16_ROM_SPRITES | BRF_GRA }, - { "opr-13537.ic105", 0x20000, 0xfa14ed3e, SYS16_ROM_SPRITES | BRF_GRA }, - - { "opr-13564.ic40", 0x10000, 0xe70ba138, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-13560.ic17", 0x10000, 0x83050925, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "opr-13563.ic11", 0x20000, 0x4083e74f, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-13562.ic12", 0x20000, 0x3cc3968f, SYS16_ROM_PCMDATA | BRF_SND }, - { "opr-13561.ic13", 0x20000, 0x80a7c02a, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Abcopjd) -STD_ROM_FN(Abcopjd) - -static struct BurnRomInfo Aburner2RomDesc[] = { - { "epr-11107.58", 0x20000, 0x6d87bab7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11108.63", 0x20000, 0x202a3e1d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11109.20", 0x20000, 0x85a0fe07, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11110.29", 0x20000, 0xf3d6797c, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11115.154", 0x10000, 0xe8e32921, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11114.153", 0x10000, 0x2e97f633, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11113.152", 0x10000, 0x36058c8c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-10932.90", 0x20000, 0xcc0821d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10934.94", 0x20000, 0x4a51b1fa, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10936.98", 0x20000, 0xada70d64, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10938.102", 0x20000, 0xe7675baf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10933.91", 0x20000, 0xc8efb2c3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10935.95", 0x20000, 0xc1e23521, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10937.99", 0x20000, 0xf0199658, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10939.103", 0x20000, 0xa0d49480, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11103.92", 0x20000, 0xbdd60da2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11104.96", 0x20000, 0x06a35fce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11105.100", 0x20000, 0x027b0689, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11106.104", 0x20000, 0x9e1fec09, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11116.93", 0x20000, 0x49b4c1ba, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11117.97", 0x20000, 0x821fbb71, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11118.101", 0x20000, 0x8f38540b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11119.105", 0x20000, 0xd0343a8e, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10922.40", 0x10000, 0xb49183d4, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-11112.17", 0x10000, 0xd777fc6d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-10931.11", 0x20000, 0x9209068f, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-10930.12", 0x20000, 0x6493368b, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11102.13", 0x20000, 0x6c07c78d, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Aburner2) -STD_ROM_FN(Aburner2) - -static struct BurnRomInfo Aburner2gRomDesc[] = { - { "epr-11173a.58", 0x20000, 0xcbf480f4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11174a.63", 0x20000, 0xed7cba77, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11109.20", 0x20000, 0x85a0fe07, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11110.29", 0x20000, 0xf3d6797c, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11115.154", 0x10000, 0xe8e32921, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11114.153", 0x10000, 0x2e97f633, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11113.152", 0x10000, 0x36058c8c, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-10932.90", 0x20000, 0xcc0821d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10934.94", 0x20000, 0x4a51b1fa, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10936.98", 0x20000, 0xada70d64, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10938.102", 0x20000, 0xe7675baf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10933.91", 0x20000, 0xc8efb2c3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10935.95", 0x20000, 0xc1e23521, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10937.99", 0x20000, 0xf0199658, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10939.103", 0x20000, 0xa0d49480, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11094.92", 0x20000, 0xbdd60da2, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11095.96", 0x20000, 0x06a35fce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11096.100", 0x20000, 0x027b0689, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11097.104", 0x20000, 0x9e1fec09, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11116.93", 0x20000, 0x49b4c1ba, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11117.97", 0x20000, 0x821fbb71, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11118.101", 0x20000, 0x8f38540b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11119.105", 0x20000, 0xd0343a8e, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10922.40", 0x10000, 0xb49183d4, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-11112.17", 0x10000, 0xd777fc6d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-10931.11", 0x20000, 0x9209068f, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-10930.12", 0x20000, 0x6493368b, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10929.13", 0x20000, 0x6c07c78d, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Aburner2g) -STD_ROM_FN(Aburner2g) - -static struct BurnRomInfo AburnerRomDesc[] = { - { "epr-10940.58", 0x20000, 0x4d132c4e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-10941.63", 0x20000, 0x136ea264, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-10927.20", 0x20000, 0x66d36757, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-10928.29", 0x20000, 0x7c01d40b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-10926.154", 0x10000, 0xed8bd632, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10925.153", 0x10000, 0x4ef048cc, SYS16_ROM_TILES | BRF_GRA }, - { "epr-10924.152", 0x10000, 0x50c15a6d, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-10932.90", 0x20000, 0xcc0821d6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10934.94", 0x20000, 0x4a51b1fa, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10936.98", 0x20000, 0xada70d64, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10938.102", 0x20000, 0xe7675baf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10933.91", 0x20000, 0xc8efb2c3, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10935.95", 0x20000, 0xc1e23521, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10937.99", 0x20000, 0xf0199658, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-10939.103", 0x20000, 0xa0d49480, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10942.92", 0x20000, 0x5ce10b8c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10943.96", 0x20000, 0xb98294dc, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10944.100", 0x20000, 0x17be8f67, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10945.104", 0x20000, 0xdf4d4c4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10946.93", 0x20000, 0xd7d485f4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10947.97", 0x20000, 0x08838392, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10948.101", 0x20000, 0x64284761, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-10949.105", 0x20000, 0xd8437d92, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-10922.40", 0x10000, 0xb49183d4, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-10923.17", 0x10000, 0x6888eb8f, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-10931.11", 0x20000, 0x9209068f, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-10930.12", 0x20000, 0x6493368b, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-10929.13", 0x20000, 0x6c07c78d, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Aburner) -STD_ROM_FN(Aburner) - -static struct BurnRomInfo GpriderRomDesc[] = { - { "epr-13409.ic58", 0x20000, 0x9abb81b6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13408.ic63", 0x20000, 0x8e410e97, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13395.ic20", 0x20000, 0xd6ccfac7, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13394.ic29", 0x20000, 0x914a55ec, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13393.ic21", 0x20000, 0x08d023cc, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13392.ic30", 0x20000, 0xf927cd42, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13383.ic154", 0x10000, 0x24f897a7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13384.ic153", 0x10000, 0xfe8238bd, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13385.ic152", 0x10000, 0x6df1b995, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13382.ic90", 0x20000, 0x01dac209, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13381.ic94", 0x20000, 0x3a50d931, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13380.ic98", 0x20000, 0xad1024c8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13379.ic102", 0x20000, 0x1ac17625, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13378.ic91", 0x20000, 0x50c9b867, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13377.ic95", 0x20000, 0x9b12f5c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13376.ic99", 0x20000, 0x449ac518, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13375.ic103", 0x20000, 0x5489a9ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13374.ic92", 0x20000, 0x6a319e4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13373.ic96", 0x20000, 0xeca5588b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13372.ic100", 0x20000, 0x0b45a433, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13371.ic104", 0x20000, 0xb68f4cff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13370.ic93", 0x20000, 0x78276620, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13369.ic97", 0x20000, 0x8625bf0f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13368.ic101", 0x20000, 0x0f50716c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13367.ic105", 0x20000, 0x4b1bb51f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13388.ic17", 0x10000, 0x706581e4, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13391.ic11", 0x20000, 0x8c30c867, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13390.ic12", 0x20000, 0x8c93cd05, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13389.ic13", 0x20000, 0x4e4c758e, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0163.key", 0x02000, 0xc1d4d207, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Gprider) -STD_ROM_FN(Gprider) - -static struct BurnRomInfo GpridersRomDesc[] = { - { "epr-13409.ic58", 0x20000, 0x9abb81b6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13408.ic63", 0x20000, 0x8e410e97, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13395.ic20", 0x20000, 0xd6ccfac7, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13394.ic29", 0x20000, 0x914a55ec, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13393.ic21", 0x20000, 0x08d023cc, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13392.ic30", 0x20000, 0xf927cd42, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13383.ic154", 0x10000, 0x24f897a7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13384.ic153", 0x10000, 0xfe8238bd, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13385.ic152", 0x10000, 0x6df1b995, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13382.ic90", 0x20000, 0x01dac209, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13381.ic94", 0x20000, 0x3a50d931, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13380.ic98", 0x20000, 0xad1024c8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13379.ic102", 0x20000, 0x1ac17625, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13378.ic91", 0x20000, 0x50c9b867, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13377.ic95", 0x20000, 0x9b12f5c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13376.ic99", 0x20000, 0x449ac518, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13375.ic103", 0x20000, 0x5489a9ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13374.ic92", 0x20000, 0x6a319e4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13373.ic96", 0x20000, 0xeca5588b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13372.ic100", 0x20000, 0x0b45a433, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13371.ic104", 0x20000, 0xb68f4cff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13370.ic93", 0x20000, 0x78276620, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13369.ic97", 0x20000, 0x8625bf0f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13368.ic101", 0x20000, 0x0f50716c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13367.ic105", 0x20000, 0x4b1bb51f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13388.ic17", 0x10000, 0x706581e4, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13391.ic11", 0x20000, 0x8c30c867, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13390.ic12", 0x20000, 0x8c93cd05, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13389.ic13", 0x20000, 0x4e4c758e, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0163.key", 0x02000, 0xc1d4d207, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Gpriders) -STD_ROM_FN(Gpriders) - -static struct BurnRomInfo GpriderjRomDesc[] = { - { "epr-13387.ic58", 0x20000, 0xa1e8b2c5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13386.ic63", 0x20000, 0xd8be9e66, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13395.ic20", 0x20000, 0xd6ccfac7, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13394.ic29", 0x20000, 0x914a55ec, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13393.ic21", 0x20000, 0x08d023cc, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13392.ic30", 0x20000, 0xf927cd42, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13383.ic154", 0x10000, 0x24f897a7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13384.ic153", 0x10000, 0xfe8238bd, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13385.ic152", 0x10000, 0x6df1b995, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13382.ic90", 0x20000, 0x01dac209, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13381.ic94", 0x20000, 0x3a50d931, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13380.ic98", 0x20000, 0xad1024c8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13379.ic102", 0x20000, 0x1ac17625, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13378.ic91", 0x20000, 0x50c9b867, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13377.ic95", 0x20000, 0x9b12f5c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13376.ic99", 0x20000, 0x449ac518, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13375.ic103", 0x20000, 0x5489a9ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13374.ic92", 0x20000, 0x6a319e4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13373.ic96", 0x20000, 0xeca5588b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13372.ic100", 0x20000, 0x0b45a433, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13371.ic104", 0x20000, 0xb68f4cff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13370.ic93", 0x20000, 0x78276620, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13369.ic97", 0x20000, 0x8625bf0f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13368.ic101", 0x20000, 0x0f50716c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13367.ic105", 0x20000, 0x4b1bb51f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13388.ic17", 0x10000, 0x706581e4, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13391.ic11", 0x20000, 0x8c30c867, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13390.ic12", 0x20000, 0x8c93cd05, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13389.ic13", 0x20000, 0x4e4c758e, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0161.key", 0x02000, 0xe38ddc16, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Gpriderj) -STD_ROM_FN(Gpriderj) - -static struct BurnRomInfo GpriderjsRomDesc[] = { - { "epr-13387.ic58", 0x20000, 0xa1e8b2c5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13386.ic63", 0x20000, 0xd8be9e66, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13395.ic20", 0x20000, 0xd6ccfac7, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13394.ic29", 0x20000, 0x914a55ec, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13393.ic21", 0x20000, 0x08d023cc, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13392.ic30", 0x20000, 0xf927cd42, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13383.ic154", 0x10000, 0x24f897a7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13384.ic153", 0x10000, 0xfe8238bd, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13385.ic152", 0x10000, 0x6df1b995, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13382.ic90", 0x20000, 0x01dac209, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13381.ic94", 0x20000, 0x3a50d931, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13380.ic98", 0x20000, 0xad1024c8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13379.ic102", 0x20000, 0x1ac17625, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13378.ic91", 0x20000, 0x50c9b867, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13377.ic95", 0x20000, 0x9b12f5c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13376.ic99", 0x20000, 0x449ac518, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13375.ic103", 0x20000, 0x5489a9ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13374.ic92", 0x20000, 0x6a319e4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13373.ic96", 0x20000, 0xeca5588b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13372.ic100", 0x20000, 0x0b45a433, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13371.ic104", 0x20000, 0xb68f4cff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13370.ic93", 0x20000, 0x78276620, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13369.ic97", 0x20000, 0x8625bf0f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13368.ic101", 0x20000, 0x0f50716c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13367.ic105", 0x20000, 0x4b1bb51f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13388.ic17", 0x10000, 0x706581e4, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13391.ic11", 0x20000, 0x8c30c867, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13390.ic12", 0x20000, 0x8c93cd05, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13389.ic13", 0x20000, 0x4e4c758e, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0161.key", 0x02000, 0xe38ddc16, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Gpriderjs) -STD_ROM_FN(Gpriderjs) - -static struct BurnRomInfo GprideruRomDesc[] = { - { "epr-13407.ic58", 0x20000, 0x03553ebd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13406.ic63", 0x20000, 0x122c711f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13395.ic20", 0x20000, 0xd6ccfac7, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13394.ic29", 0x20000, 0x914a55ec, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13393.ic21", 0x20000, 0x08d023cc, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13392.ic30", 0x20000, 0xf927cd42, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13383.ic154", 0x10000, 0x24f897a7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13384.ic153", 0x10000, 0xfe8238bd, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13385.ic152", 0x10000, 0x6df1b995, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13382.ic90", 0x20000, 0x01dac209, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13381.ic94", 0x20000, 0x3a50d931, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13380.ic98", 0x20000, 0xad1024c8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13379.ic102", 0x20000, 0x1ac17625, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13378.ic91", 0x20000, 0x50c9b867, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13377.ic95", 0x20000, 0x9b12f5c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13376.ic99", 0x20000, 0x449ac518, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13375.ic103", 0x20000, 0x5489a9ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13374.ic92", 0x20000, 0x6a319e4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13373.ic96", 0x20000, 0xeca5588b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13372.ic100", 0x20000, 0x0b45a433, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13371.ic104", 0x20000, 0xb68f4cff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13370.ic93", 0x20000, 0x78276620, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13369.ic97", 0x20000, 0x8625bf0f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13368.ic101", 0x20000, 0x0f50716c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13367.ic105", 0x20000, 0x4b1bb51f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13388.ic17", 0x10000, 0x706581e4, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13391.ic11", 0x20000, 0x8c30c867, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13390.ic12", 0x20000, 0x8c93cd05, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13389.ic13", 0x20000, 0x4e4c758e, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0162.key", 0x02000, 0x8067de53, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Gprideru) -STD_ROM_FN(Gprideru) - -static struct BurnRomInfo GpriderusRomDesc[] = { - { "epr-13407.ic58", 0x20000, 0x03553ebd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13406.ic63", 0x20000, 0x122c711f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13395.ic20", 0x20000, 0xd6ccfac7, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13394.ic29", 0x20000, 0x914a55ec, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13393.ic21", 0x20000, 0x08d023cc, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13392.ic30", 0x20000, 0xf927cd42, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13383.ic154", 0x10000, 0x24f897a7, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13384.ic153", 0x10000, 0xfe8238bd, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13385.ic152", 0x10000, 0x6df1b995, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13382.ic90", 0x20000, 0x01dac209, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13381.ic94", 0x20000, 0x3a50d931, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13380.ic98", 0x20000, 0xad1024c8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13379.ic102", 0x20000, 0x1ac17625, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13378.ic91", 0x20000, 0x50c9b867, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13377.ic95", 0x20000, 0x9b12f5c0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13376.ic99", 0x20000, 0x449ac518, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13375.ic103", 0x20000, 0x5489a9ff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13374.ic92", 0x20000, 0x6a319e4f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13373.ic96", 0x20000, 0xeca5588b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13372.ic100", 0x20000, 0x0b45a433, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13371.ic104", 0x20000, 0xb68f4cff, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13370.ic93", 0x20000, 0x78276620, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13369.ic97", 0x20000, 0x8625bf0f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13368.ic101", 0x20000, 0x0f50716c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13367.ic105", 0x20000, 0x4b1bb51f, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13388.ic17", 0x10000, 0x706581e4, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13391.ic11", 0x20000, 0x8c30c867, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13390.ic12", 0x20000, 0x8c93cd05, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13389.ic13", 0x20000, 0x4e4c758e, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0162.key", 0x02000, 0x8067de53, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Gpriderus) -STD_ROM_FN(Gpriderus) - -static struct BurnRomInfo LastsurvRomDesc[] = { - { "epr-12046.ic58", 0x20000, 0xf94f3a1a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12047.ic63", 0x20000, 0x1b45c116, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12048.ic57", 0x20000, 0x648e38ca, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12049.ic62", 0x20000, 0x6c5c4753, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12050.ic20", 0x20000, 0x985a0f36, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12051.ic29", 0x20000, 0xf967d5a8, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12052.ic21", 0x20000, 0x9f7a424d, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12053.ic30", 0x20000, 0xefcf30f6, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12055.ic154", 0x10000, 0x150014a4, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12056.ic153", 0x10000, 0x3cd4c306, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12057.ic152", 0x10000, 0x37e91770, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12064.ic90", 0x20000, 0x84562a69, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12063.ic94", 0x20000, 0xd163727c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12062.ic98", 0x20000, 0x6b57833b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12061.ic102", 0x20000, 0x8907d5ba, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12068.ic91", 0x20000, 0x8b12d342, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12067.ic95", 0x20000, 0x1a1cdd89, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12066.ic99", 0x20000, 0xa91d16b5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12065.ic103", 0x20000, 0xf4ce14c6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12072.ic92", 0x20000, 0x222064c8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12071.ic96", 0x20000, 0xa329b78c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12070.ic100", 0x20000, 0x97cc6706, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12069.ic104", 0x20000, 0x2c3ba66e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12076.ic93", 0x20000, 0x24f628e1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12075.ic97", 0x20000, 0x69b3507f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12074.ic101", 0x20000, 0xee6cbb73, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12073.ic105", 0x20000, 0x167e6342, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12054.ic17", 0x10000, 0xe9b39216, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12058.ic11", 0x20000, 0x4671cb46, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12059.ic12", 0x20000, 0x8c99aff4, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12060.ic13", 0x20000, 0x7ed382b3, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0083.key", 0x02000, 0xdca0b9cc, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Lastsurv) -STD_ROM_FN(Lastsurv) - -static struct BurnRomInfo LastsurvdRomDesc[] = { - { "bootleg_epr-12046.ic58", 0x20000, 0xddef5278, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12047.ic63", 0x20000, 0x3981a891, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12048.ic57", 0x20000, 0x648e38ca, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12049.ic62", 0x20000, 0x6c5c4753, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12050.ic20", 0x20000, 0x985a0f36, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12051.ic29", 0x20000, 0xf967d5a8, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12052.ic21", 0x20000, 0x9f7a424d, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12053.ic30", 0x20000, 0xefcf30f6, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12055.ic154", 0x10000, 0x150014a4, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12056.ic153", 0x10000, 0x3cd4c306, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12057.ic152", 0x10000, 0x37e91770, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12064.ic90", 0x20000, 0x84562a69, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12063.ic94", 0x20000, 0xd163727c, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12062.ic98", 0x20000, 0x6b57833b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12061.ic102", 0x20000, 0x8907d5ba, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12068.ic91", 0x20000, 0x8b12d342, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12067.ic95", 0x20000, 0x1a1cdd89, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12066.ic99", 0x20000, 0xa91d16b5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12065.ic103", 0x20000, 0xf4ce14c6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12072.ic92", 0x20000, 0x222064c8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12071.ic96", 0x20000, 0xa329b78c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12070.ic100", 0x20000, 0x97cc6706, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12069.ic104", 0x20000, 0x2c3ba66e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12076.ic93", 0x20000, 0x24f628e1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12075.ic97", 0x20000, 0x69b3507f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12074.ic101", 0x20000, 0xee6cbb73, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12073.ic105", 0x20000, 0x167e6342, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12054.ic17", 0x10000, 0xe9b39216, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12058.ic11", 0x20000, 0x4671cb46, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12059.ic12", 0x20000, 0x8c99aff4, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12060.ic13", 0x20000, 0x7ed382b3, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Lastsurvd) -STD_ROM_FN(Lastsurvd) - -static struct BurnRomInfo LoffireRomDesc[] = { - { "epr-12849.58", 0x20000, 0x61cfd2fe, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12850.63", 0x20000, 0x14598f2a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12804.20", 0x20000, 0xb853480e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12805.29", 0x20000, 0x4a7200c3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12802.21", 0x20000, 0xd746bb39, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12803.30", 0x20000, 0xc1d9e751, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12791.154", 0x10000, 0xacfa69ba, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12792.153", 0x10000, 0xe506723c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12793.152", 0x10000, 0x0ce8cce3, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12787.90", 0x20000, 0x6431a3a6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12788.94", 0x20000, 0x1982a0ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12789.98", 0x20000, 0x97d03274, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12790.102", 0x20000, 0x816e76e6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12783.91", 0x20000, 0xc13feea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12784.95", 0x20000, 0x39b94c65, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12785.99", 0x20000, 0x05ed0059, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12786.103", 0x20000, 0xa4123165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12779.92", 0x20000, 0xae58af7c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12780.96", 0x20000, 0xee670c1e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12781.100", 0x20000, 0x538f6bc5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12782.104", 0x20000, 0x5acc34f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12775.93", 0x20000, 0x693056ec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12776.97", 0x20000, 0x61efbdfd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12777.101", 0x20000, 0x29d5b953, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12778.105", 0x20000, 0x2fb68e07, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12798.17", 0x10000, 0x0587738d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12799.11", 0x20000, 0xbc60181c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12800.12", 0x20000, 0x1158c1a3, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12801.13", 0x20000, 0x2d6567c4, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0136.key", 0x02000, 0x344bfe0c, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Loffire) -STD_ROM_FN(Loffire) - -static struct BurnRomInfo LoffiredRomDesc[] = { - { "bootleg_epr-12849.58", 0x20000, 0xdfd1ab45, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12850.63", 0x20000, 0x90889ae9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12804.20", 0x20000, 0xb853480e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12805.29", 0x20000, 0x4a7200c3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12802.21", 0x20000, 0xd746bb39, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12803.30", 0x20000, 0xc1d9e751, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12791.154", 0x10000, 0xacfa69ba, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12792.153", 0x10000, 0xe506723c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12793.152", 0x10000, 0x0ce8cce3, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12787.90", 0x20000, 0x6431a3a6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12788.94", 0x20000, 0x1982a0ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12789.98", 0x20000, 0x97d03274, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12790.102", 0x20000, 0x816e76e6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12783.91", 0x20000, 0xc13feea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12784.95", 0x20000, 0x39b94c65, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12785.99", 0x20000, 0x05ed0059, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12786.103", 0x20000, 0xa4123165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12779.92", 0x20000, 0xae58af7c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12780.96", 0x20000, 0xee670c1e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12781.100", 0x20000, 0x538f6bc5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12782.104", 0x20000, 0x5acc34f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12775.93", 0x20000, 0x693056ec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12776.97", 0x20000, 0x61efbdfd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12777.101", 0x20000, 0x29d5b953, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12778.105", 0x20000, 0x2fb68e07, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12798.17", 0x10000, 0x0587738d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12799.11", 0x20000, 0xbc60181c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12800.12", 0x20000, 0x1158c1a3, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12801.13", 0x20000, 0x2d6567c4, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Loffired) -STD_ROM_FN(Loffired) - -static struct BurnRomInfo LoffirejRomDesc[] = { - { "epr-12794.58", 0x20000, 0x1e588992, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12795.63", 0x20000, 0xd43d7427, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12804.20", 0x20000, 0xb853480e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12805.29", 0x20000, 0x4a7200c3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12802.21", 0x20000, 0xd746bb39, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12803.30", 0x20000, 0xc1d9e751, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12791.154", 0x10000, 0xacfa69ba, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12792.153", 0x10000, 0xe506723c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12793.152", 0x10000, 0x0ce8cce3, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12787.90", 0x20000, 0x6431a3a6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12788.94", 0x20000, 0x1982a0ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12789.98", 0x20000, 0x97d03274, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12790.102", 0x20000, 0x816e76e6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12783.91", 0x20000, 0xc13feea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12784.95", 0x20000, 0x39b94c65, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12785.99", 0x20000, 0x05ed0059, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12786.103", 0x20000, 0xa4123165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12779.92", 0x20000, 0xae58af7c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12780.96", 0x20000, 0xee670c1e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12781.100", 0x20000, 0x538f6bc5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12782.104", 0x20000, 0x5acc34f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12775.93", 0x20000, 0x693056ec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12776.97", 0x20000, 0x61efbdfd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12777.101", 0x20000, 0x29d5b953, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12778.105", 0x20000, 0x2fb68e07, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12798.17", 0x10000, 0x0587738d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12799.11", 0x20000, 0xbc60181c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12800.12", 0x20000, 0x1158c1a3, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12801.13", 0x20000, 0x2d6567c4, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0134.key", 0x02000, 0x732626d4, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Loffirej) -STD_ROM_FN(Loffirej) - -static struct BurnRomInfo LoffirejdRomDesc[] = { - { "bootleg_epr-12794.58", 0x20000, 0x795f110d, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12795.63", 0x20000, 0x87c52aaa, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12804.20", 0x20000, 0xb853480e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12805.29", 0x20000, 0x4a7200c3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12802.21", 0x20000, 0xd746bb39, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12803.30", 0x20000, 0xc1d9e751, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12791.154", 0x10000, 0xacfa69ba, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12792.153", 0x10000, 0xe506723c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12793.152", 0x10000, 0x0ce8cce3, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12787.90", 0x20000, 0x6431a3a6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12788.94", 0x20000, 0x1982a0ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12789.98", 0x20000, 0x97d03274, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12790.102", 0x20000, 0x816e76e6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12783.91", 0x20000, 0xc13feea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12784.95", 0x20000, 0x39b94c65, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12785.99", 0x20000, 0x05ed0059, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12786.103", 0x20000, 0xa4123165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12779.92", 0x20000, 0xae58af7c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12780.96", 0x20000, 0xee670c1e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12781.100", 0x20000, 0x538f6bc5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12782.104", 0x20000, 0x5acc34f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12775.93", 0x20000, 0x693056ec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12776.97", 0x20000, 0x61efbdfd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12777.101", 0x20000, 0x29d5b953, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12778.105", 0x20000, 0x2fb68e07, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12798.17", 0x10000, 0x0587738d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12799.11", 0x20000, 0xbc60181c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12800.12", 0x20000, 0x1158c1a3, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12801.13", 0x20000, 0x2d6567c4, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Loffirejd) -STD_ROM_FN(Loffirejd) - -static struct BurnRomInfo LoffireuRomDesc[] = { - { "epr-12847a.58", 0x20000, 0xc50eb4ed, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12848a.63", 0x20000, 0xf8ff8640, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12804.20", 0x20000, 0xb853480e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12805.29", 0x20000, 0x4a7200c3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12802.21", 0x20000, 0xd746bb39, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12803.30", 0x20000, 0xc1d9e751, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12791.154", 0x10000, 0xacfa69ba, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12792.153", 0x10000, 0xe506723c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12793.152", 0x10000, 0x0ce8cce3, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12787.90", 0x20000, 0x6431a3a6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12788.94", 0x20000, 0x1982a0ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12789.98", 0x20000, 0x97d03274, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12790.102", 0x20000, 0x816e76e6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12783.91", 0x20000, 0xc13feea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12784.95", 0x20000, 0x39b94c65, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12785.99", 0x20000, 0x05ed0059, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12786.103", 0x20000, 0xa4123165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12779.92", 0x20000, 0xae58af7c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12780.96", 0x20000, 0xee670c1e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12781.100", 0x20000, 0x538f6bc5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12782.104", 0x20000, 0x5acc34f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12775.93", 0x20000, 0x693056ec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12776.97", 0x20000, 0x61efbdfd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12777.101", 0x20000, 0x29d5b953, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12778.105", 0x20000, 0x2fb68e07, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12798.17", 0x10000, 0x0587738d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12799.11", 0x20000, 0xbc60181c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12800.12", 0x20000, 0x1158c1a3, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12801.13", 0x20000, 0x2d6567c4, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0135.key", 0x02000, 0xc53ad019, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Loffireu) -STD_ROM_FN(Loffireu) - -static struct BurnRomInfo LoffireudRomDesc[] = { - { "bootleg_epr-12847a.58", 0x20000, 0x74d270d0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12848a.63", 0x20000, 0x7f27e058, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12804.20", 0x20000, 0xb853480e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12805.29", 0x20000, 0x4a7200c3, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12802.21", 0x20000, 0xd746bb39, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12803.30", 0x20000, 0xc1d9e751, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "opr-12791.154", 0x10000, 0xacfa69ba, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12792.153", 0x10000, 0xe506723c, SYS16_ROM_TILES | BRF_GRA }, - { "opr-12793.152", 0x10000, 0x0ce8cce3, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12787.90", 0x20000, 0x6431a3a6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12788.94", 0x20000, 0x1982a0ce, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12789.98", 0x20000, 0x97d03274, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12790.102", 0x20000, 0x816e76e6, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12783.91", 0x20000, 0xc13feea9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12784.95", 0x20000, 0x39b94c65, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12785.99", 0x20000, 0x05ed0059, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12786.103", 0x20000, 0xa4123165, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12779.92", 0x20000, 0xae58af7c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12780.96", 0x20000, 0xee670c1e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12781.100", 0x20000, 0x538f6bc5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12782.104", 0x20000, 0x5acc34f7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12775.93", 0x20000, 0x693056ec, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12776.97", 0x20000, 0x61efbdfd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12777.101", 0x20000, 0x29d5b953, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12778.105", 0x20000, 0x2fb68e07, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12798.17", 0x10000, 0x0587738d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12799.11", 0x20000, 0xbc60181c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12800.12", 0x20000, 0x1158c1a3, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12801.13", 0x20000, 0x2d6567c4, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Loffireud) -STD_ROM_FN(Loffireud) - -static struct BurnRomInfo RascotRomDesc[] = { - { "epr-13965a.ic58", 0x20000, 0x7eacdfb3, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13694a.ic63", 0x20000, 0x15b86498, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13967.ic20", 0x20000, 0x3b92e2b8, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13966.ic29", 0x20000, 0xeaa644e1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13961" , 0x10000, 0x68038629, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13962", 0x10000, 0x7d7605bc, SYS16_ROM_TILES | BRF_GRA }, - { "epr-13963", 0x10000, 0xf3376b65, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-13960", 0x20000, 0xb974128d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13959", 0x20000, 0xdb245b22, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13958", 0x20000, 0x7803a027, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13957", 0x20000, 0x6d50fb54, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-14221a", 0x10000, 0x0d429ac4, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Rascot) -STD_ROM_FN(Rascot) - -static struct BurnRomInfo RacheroRomDesc[] = { - { "epr-13129.ic58", 0x20000, 0xad9f32e7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13130.ic63", 0x20000, 0x6022777b, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12855.ic57", 0x20000, 0xcecf1e73, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12856.ic62", 0x20000, 0xda900ebb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12857.ic20", 0x20000, 0x8a2328cc, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12858.ic29", 0x20000, 0x38a248b7, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12879.ic154", 0x10000, 0xc1a9de7a, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12880.ic153", 0x10000, 0x27ff04a5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12881.ic152", 0x10000, 0x72f14491, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12872.ic90", 0x20000, 0x68d56139, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12873.ic94", 0x20000, 0x3d3ec450, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12874.ic98", 0x20000, 0x7d6bde23, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12875.ic102", 0x20000, 0xe33092bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12868.ic91", 0x20000, 0x96289583, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12869.ic95", 0x20000, 0x2ef0de02, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12870.ic99", 0x20000, 0xc76630e1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12871.ic103", 0x20000, 0x23401b1a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12864.ic92", 0x20000, 0x77d6cff4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12865.ic96", 0x20000, 0x1e7e685b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12866.ic100", 0x20000, 0xfdf31329, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12867.ic104", 0x20000, 0xb25e37fd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12860.ic93", 0x20000, 0x86b64119, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12861.ic97", 0x20000, 0xbccff19b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12862.ic101", 0x20000, 0x7d4c3b05, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12863.ic105", 0x20000, 0x85095053, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12859.ic17", 0x10000, 0xd57881da, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12876.ic11", 0x20000, 0xf72a34a0, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12877.ic12", 0x20000, 0x18c1b6d2, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12878.ic13", 0x20000, 0x7c212c15, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0144.key", 0x02000, 0x8740bbff, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Rachero) -STD_ROM_FN(Rachero) - -static struct BurnRomInfo RacherodRomDesc[] = { - { "bootleg_epr-13129.ic58", 0x20000, 0x82ee7312, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-13130.ic63", 0x20000, 0x53fb8649, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12855.ic57", 0x20000, 0xcecf1e73, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12856.ic62", 0x20000, 0xda900ebb, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12857.ic20", 0x20000, 0x8a2328cc, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12858.ic29", 0x20000, 0x38a248b7, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12879.ic154", 0x10000, 0xc1a9de7a, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12880.ic153", 0x10000, 0x27ff04a5, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12881.ic152", 0x10000, 0x72f14491, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-12872.ic90", 0x20000, 0x68d56139, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12873.ic94", 0x20000, 0x3d3ec450, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12874.ic98", 0x20000, 0x7d6bde23, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12875.ic102", 0x20000, 0xe33092bf, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12868.ic91", 0x20000, 0x96289583, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12869.ic95", 0x20000, 0x2ef0de02, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12870.ic99", 0x20000, 0xc76630e1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12871.ic103", 0x20000, 0x23401b1a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12864.ic92", 0x20000, 0x77d6cff4, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12865.ic96", 0x20000, 0x1e7e685b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12866.ic100", 0x20000, 0xfdf31329, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12867.ic104", 0x20000, 0xb25e37fd, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12860.ic93", 0x20000, 0x86b64119, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12861.ic97", 0x20000, 0xbccff19b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12862.ic101", 0x20000, 0x7d4c3b05, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12863.ic105", 0x20000, 0x85095053, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12859.ic17", 0x10000, 0xd57881da, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12876.ic11", 0x20000, 0xf72a34a0, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12877.ic12", 0x20000, 0x18c1b6d2, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-12878.ic13", 0x20000, 0x7c212c15, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Racherod) -STD_ROM_FN(Racherod) - -static struct BurnRomInfo SmgpRomDesc[] = { - { "epr-12563b.58", 0x20000, 0xbaf1f333, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12564b.63", 0x20000, 0xb5191af0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12576a.20", 0x20000, 0x2c9599c1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12577a.29", 0x20000, 0xabf9a50b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, // comm cpu - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, // motor cpu - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, - - { "317-0126a.key", 0x02000, 0x2abc1982, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Smgp) -STD_ROM_FN(Smgp) - -static struct BurnRomInfo SmgpdRomDesc[] = { - { "bootleg_epr-12563b.58", 0x20000, 0xaf30e3cd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12564b.63", 0x20000, 0xeb7cadfe, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12576a.20", 0x20000, 0x2c9599c1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12577a.29", 0x20000, 0xabf9a50b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Smgpd) -STD_ROM_FN(Smgpd) - -static struct BurnRomInfo Smgp6RomDesc[] = { - { "epr-12563a.58", 0x20000, 0x2e64b10e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12564a.63", 0x20000, 0x5baba3e7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12576a.20", 0x20000, 0x2c9599c1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12577a.29", 0x20000, 0xabf9a50b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, // comm cpu - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, // motor cpu - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, - - { "317-0126a.key", 0x02000, 0x2abc1982, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - -STD_ROM_PICK(Smgp6) -STD_ROM_FN(Smgp6) - -static struct BurnRomInfo Smgp6dRomDesc[] = { - { "bootleg_epr-12563a.58", 0x20000, 0x3ba5a1f0, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12564a.63", 0x20000, 0x05ce14e9, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12576a.20", 0x20000, 0x2c9599c1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12577a.29", 0x20000, 0xabf9a50b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Smgp6d) -STD_ROM_FN(Smgp6d) - -static struct BurnRomInfo Smgp5RomDesc[] = { - { "epr-12563.58", 0x20000, 0x6d7325ae, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12564.63", 0x20000, 0xadfbf921, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12576.20", 0x20000, 0x23266b26, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12577.29", 0x20000, 0xd5b53211, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12413.93", 0x20000, 0x2f1693df, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12414.97", 0x20000, 0xc78f3d45, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12415.101", 0x20000, 0x6080e9ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12416.105", 0x20000, 0x6f1f2769, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, // comm cpu - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, // motor cpu - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, - - { "317-0126.key", 0x02000, 0x4d917996, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Smgp5) -STD_ROM_FN(Smgp5) - -static struct BurnRomInfo Smgp5dRomDesc[] = { - { "bootleg_epr-12563.58", 0x20000, 0x6c7f0549, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12564.63", 0x20000, 0xc2b3a219, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12576.20", 0x20000, 0x23266b26, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12577.29", 0x20000, 0xd5b53211, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12413.93", 0x20000, 0x2f1693df, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12414.97", 0x20000, 0xc78f3d45, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12415.101", 0x20000, 0x6080e9ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12416.105", 0x20000, 0x6f1f2769, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Smgp5d) -STD_ROM_FN(Smgp5d) - -static struct BurnRomInfo SmgpuRomDesc[] = { - { "epr-12561c.58", 0x20000, 0xa5b0f3fe, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12562c.63", 0x20000, 0x799e55f4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12574a.20", 0x20000, 0xf8b5c38b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12575a.29", 0x20000, 0x248b1d17, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, // comm cpu - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, // motor cpu - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, - - { "317-0125a.key", 0x02000, 0x3ecdb120, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Smgpu) -STD_ROM_FN(Smgpu) - -static struct BurnRomInfo SmgpudRomDesc[] = { - { "bootleg_epr-12561c.58", 0x20000, 0x7053e379, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12562c.63", 0x20000, 0xdb848e75, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12574a.20", 0x20000, 0xf8b5c38b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12575a.29", 0x20000, 0x248b1d17, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Smgpud) -STD_ROM_FN(Smgpud) - -static struct BurnRomInfo Smgpu1RomDesc[] = { - { "epr-12561b.58", 0x20000, 0x80a32655, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12562b.63", 0x20000, 0xd525f2a8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12574a.20", 0x20000, 0xf8b5c38b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12575a.29", 0x20000, 0x248b1d17, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, // comm cpu - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, // motor cpu - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, - - { "317-0125a.key", 0x02000, 0x3ecdb120, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Smgpu1) -STD_ROM_FN(Smgpu1) - -static struct BurnRomInfo Smgpu1dRomDesc[] = { - { "bootleg_epr-12561.58", 0x20000, 0x554036d2, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12562.63", 0x20000, 0x773f2929, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12574a.20", 0x20000, 0xf8b5c38b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12575a.29", 0x20000, 0x248b1d17, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Smgpu1d) -STD_ROM_FN(Smgpu1d) - -static struct BurnRomInfo Smgpu2RomDesc[] = { - { "epr-12561a.58", 0x20000, 0xe505eb89, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12562a.63", 0x20000, 0xc3af4215, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12574a.20", 0x20000, 0xf8b5c38b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12575a.29", 0x20000, 0x248b1d17, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, // comm cpu - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, // motor cpu - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, - - { "317-0125a.key", 0x02000, 0x3ecdb120, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Smgpu2) -STD_ROM_FN(Smgpu2) - -static struct BurnRomInfo Smgpu2dRomDesc[] = { - { "bootleg_epr-12561a.58", 0x20000, 0x30e6fb0e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12562a.63", 0x20000, 0x61b59994, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12574a.20", 0x20000, 0xf8b5c38b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12575a.29", 0x20000, 0x248b1d17, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12609.93", 0x20000, 0xa867812f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12610.97", 0x20000, 0x53b99417, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12611.101", 0x20000, 0xbd5c6ab0, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12612.105", 0x20000, 0xac86e890, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Smgpu2d) -STD_ROM_FN(Smgpu2d) - -static struct BurnRomInfo SmgpjRomDesc[] = { - { "epr-12432b.58", 0x20000, 0xc1a29db1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12433b.63", 0x20000, 0x97199eb1, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12441a.20", 0x20000, 0x2c9599c1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12442a.29", 0x20000, 0x77a5ec16, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12413.93", 0x20000, 0x2f1693df, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12414.97", 0x20000, 0xc78f3d45, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12415.101", 0x20000, 0x6080e9ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12416.105", 0x20000, 0x6f1f2769, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, // comm cpu - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, // motor cpu - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, - - { "317-0124a.key", 0x02000, 0x022a8a16, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Smgpj) -STD_ROM_FN(Smgpj) - -static struct BurnRomInfo SmgpjdRomDesc[] = { - { "bootleg_epr-12432b.58", 0x20000, 0x1c46c4de, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-12433b.63", 0x20000, 0xae8a4942, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12441a.20", 0x20000, 0x2c9599c1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12442a.29", 0x20000, 0x77a5ec16, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12413.93", 0x20000, 0x2f1693df, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12414.97", 0x20000, 0xc78f3d45, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12415.101", 0x20000, 0x6080e9ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12416.105", 0x20000, 0x6f1f2769, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, -}; - - -STD_ROM_PICK(Smgpjd) -STD_ROM_FN(Smgpjd) - -static struct BurnRomInfo SmgpjaRomDesc[] = { - { "epr-12432a.58", 0x20000, 0x22517672, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12433a.63", 0x20000, 0xa46b5d13, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-12441a.20", 0x20000, 0x2c9599c1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-12442a.29", 0x20000, 0x77a5ec16, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12429.154", 0x10000, 0x5851e614, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12430.153", 0x10000, 0x05e00134, SYS16_ROM_TILES | BRF_GRA }, - { "epr-12431.152", 0x10000, 0x35572f4a, SYS16_ROM_TILES | BRF_GRA }, - - { "mpr-12425.90", 0x20000, 0x14bf2a15, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12426.94", 0x20000, 0x28b60dc0, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12427.98", 0x20000, 0x0a367928, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12428.102", 0x20000, 0xefa80ad5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12421.91", 0x20000, 0x25f46140, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12422.95", 0x20000, 0xcb51c8f6, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12423.99", 0x20000, 0x0be9818e, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12424.103", 0x20000, 0x0ce00dfc, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12417.92", 0x20000, 0xa806eabf, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12418.96", 0x20000, 0xed1a0f2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12419.100", 0x20000, 0xce4568cb, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-12420.104", 0x20000, 0x679442eb, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12413.93", 0x20000, 0x2f1693df, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12414.97", 0x20000, 0xc78f3d45, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12415.101", 0x20000, 0x6080e9ed, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-12416.105", 0x20000, 0x6f1f2769, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-12436.17", 0x10000, 0x16ec5f0a, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-12535.8", 0x10000, 0x80453597, SYS16_ROM_Z80PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12587.14", 0x08000, 0x2afe648b, SYS16_ROM_Z80PROG3 | BRF_ESS | BRF_PRG }, // comm cpu - - { "epr-12505.8", 0x08000, 0x5020788a, SYS16_ROM_Z80PROG4 | BRF_ESS | BRF_PRG }, // motor cpu - - { "mpr-12437.11", 0x20000, 0xa1c7e712, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12438.12", 0x20000, 0x6573d46b, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-12439.13", 0x20000, 0x13bf6de5, SYS16_ROM_PCMDATA | BRF_SND }, - - { "mpr-12437.20", 0x20000, 0xa1c7e712, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12438.21", 0x20000, 0x6573d46b, SYS16_ROM_PCM2DATA | BRF_SND }, - { "mpr-12439.22", 0x20000, 0x13bf6de5, SYS16_ROM_PCM2DATA | BRF_SND }, - - { "317-0124a.key", 0x02000, 0x022a8a16, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Smgpja) -STD_ROM_FN(Smgpja) - -static struct BurnRomInfo ThndrbldRomDesc[] = { - { "epr-11405.ic58", 0x20000, 0xe057dd5a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11406.ic63", 0x20000, 0xc6b994b8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11306.ic57", 0x20000, 0x4b95f2b4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11307.ic62", 0x20000, 0x2d6833e4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11390.ic20", 0x20000, 0xed988fdb, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11391.ic29", 0x20000, 0x12523bc1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11310.ic21", 0x20000, 0x5d9fa02c, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11311.ic30", 0x20000, 0x483de21b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11314.ic154", 0x10000, 0xd4f954a9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11315.ic153", 0x10000, 0x35813088, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11316.ic152", 0x10000, 0x84290dff, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11323.ic90", 0x20000, 0x27e40735, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11322.ic94", 0x20000, 0x10364d74, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11321.ic98", 0x20000, 0x8e738f58, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11320.ic102", 0x20000, 0xa95c76b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11327.ic91", 0x20000, 0xdeae90f1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11326.ic95", 0x20000, 0x29198403, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11325.ic99", 0x20000, 0xb9e98ae9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11324.ic103", 0x20000, 0x9742b552, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11331.ic92", 0x20000, 0x3a2c042e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11330.ic96", 0x20000, 0xaa7c70c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11329.ic100", 0x20000, 0x31b20257, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11328.ic104", 0x20000, 0xda39e89c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11395.ic93", 0x20000, 0x90775579, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11394.ic97", 0x20000, 0x5f2783be, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11393.ic101", 0x20000, 0x525e2e1d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11392.ic105", 0x20000, 0xb4a382f7, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11313.ic29", 0x10000, 0x6a56c4c3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-11396.ic17", 0x10000, 0xd37b54a4, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11317.ic11", 0x20000, 0xd4e7ac1f, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11318.ic12", 0x20000, 0x70d3f02c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11319.ic13", 0x20000, 0x50d9242e, SYS16_ROM_PCMDATA | BRF_SND }, - - { "317-0056.key", 0x02000, 0xb40cd2c5, SYS16_ROM_KEY | BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(Thndrbld) -STD_ROM_FN(Thndrbld) - -static struct BurnRomInfo ThndrblddRomDesc[] = { - { "bootleg_epr-11405.ic58", 0x20000, 0x1642fd59, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "bootleg_epr-11406.ic63", 0x20000, 0xaa87dd75, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11306.ic57", 0x20000, 0x4b95f2b4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11307.ic62", 0x20000, 0x2d6833e4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11390.ic20", 0x20000, 0xed988fdb, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11391.ic29", 0x20000, 0x12523bc1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11310.ic21", 0x20000, 0x5d9fa02c, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11311.ic30", 0x20000, 0x483de21b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11314.ic154", 0x10000, 0xd4f954a9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11315.ic153", 0x10000, 0x35813088, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11316.ic152", 0x10000, 0x84290dff, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11323.ic90", 0x20000, 0x27e40735, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11322.ic94", 0x20000, 0x10364d74, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11321.ic98", 0x20000, 0x8e738f58, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11320.ic102", 0x20000, 0xa95c76b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11327.ic91", 0x20000, 0xdeae90f1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11326.ic95", 0x20000, 0x29198403, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11325.ic99", 0x20000, 0xb9e98ae9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11324.ic103", 0x20000, 0x9742b552, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11331.ic92", 0x20000, 0x3a2c042e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11330.ic96", 0x20000, 0xaa7c70c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11329.ic100", 0x20000, 0x31b20257, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11328.ic104", 0x20000, 0xda39e89c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11395.ic93", 0x20000, 0x90775579, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11394.ic97", 0x20000, 0x5f2783be, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11393.ic101", 0x20000, 0x525e2e1d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11392.ic105", 0x20000, 0xb4a382f7, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11313.ic29", 0x10000, 0x6a56c4c3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-11396.ic17", 0x10000, 0xd37b54a4, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11317.ic11", 0x20000, 0xd4e7ac1f, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11318.ic12", 0x20000, 0x70d3f02c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11319.ic13", 0x20000, 0x50d9242e, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Thndrbldd) -STD_ROM_FN(Thndrbldd) - -static struct BurnRomInfo Thndrbld1RomDesc[] = { - { "epr-11304.ic58", 0x20000, 0xa90630ef, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11305.ic63", 0x20000, 0x9ba3ef61, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11306.ic57", 0x20000, 0x4b95f2b4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11307.ic62", 0x20000, 0x2d6833e4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11308.ic20", 0x20000, 0x7956c238, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11309.ic29", 0x20000, 0xc887f620, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11310.ic21", 0x20000, 0x5d9fa02c, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11311.ic30", 0x20000, 0x483de21b, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11314.ic154", 0x10000, 0xd4f954a9, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11315.ic153", 0x10000, 0x35813088, SYS16_ROM_TILES | BRF_GRA }, - { "epr-11316.ic152", 0x10000, 0x84290dff, SYS16_ROM_TILES | BRF_GRA }, - - { "epr-11323.ic90", 0x20000, 0x27e40735, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11322.ic94", 0x20000, 0x10364d74, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11321.ic98", 0x20000, 0x8e738f58, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11320.ic102", 0x20000, 0xa95c76b8, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11327.ic91", 0x20000, 0xdeae90f1, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11326.ic95", 0x20000, 0x29198403, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11325.ic99", 0x20000, 0xb9e98ae9, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11324.ic103", 0x20000, 0x9742b552, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11331.ic92", 0x20000, 0x3a2c042e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11330.ic96", 0x20000, 0xaa7c70c5, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11329.ic100", 0x20000, 0x31b20257, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11328.ic104", 0x20000, 0xda39e89c, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11335.ic93", 0x20000, 0xf19b3e86, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11334.ic97", 0x20000, 0x348f91c7, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11333.ic101", 0x20000, 0x05a2333f, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11332.ic105", 0x20000, 0xdc089ec6, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11313.ic29", 0x10000, 0x6a56c4c3, SYS16_ROM_ROAD | BRF_GRA }, - - { "epr-11312.ic17", 0x10000, 0x3b974ed2, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-11317.ic11", 0x20000, 0xd4e7ac1f, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11318.ic12", 0x20000, 0x70d3f02c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11319.ic13", 0x20000, 0x50d9242e, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Thndrbld1) -STD_ROM_FN(Thndrbld1) - -/*==================================================== -Memory Handlers -====================================================*/ - -typedef UINT8 (*io_custom_read)(UINT8); -static io_custom_read iochip_custom_read[2][8] = {{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }}; - -typedef void (*io_custom_write)(UINT8); -static io_custom_write iochip_custom_write[2][8] = {{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }}; - -static UINT8 iochip_regs[2][8] = {{ 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0 }}; - -static UINT8 LastsurvMux = 0; -static INT32 LastsurvPosition[2] = { 0, 0 }; - -static inline UINT16 iochip_r(INT32 which, INT32 port, INT32 inputval) -{ - UINT16 result = iochip_regs[which][port]; - - if (iochip_custom_read[which][port]) { - inputval = iochip_custom_read[which][port](inputval); - } - - if (port <= 0x03) { - // for ports 0-3, the direction is controlled 4 bits at a time by register 6 - if (((iochip_regs[which][6] >> (2 * port + 0)) & 0x01)) { - result = (result & ~0x0f) | (inputval & 0x0f); - } - - if (((iochip_regs[which][6] >> (2 * port + 1)) & 0x01)) { - result = (result & ~0xf0) | (inputval & 0xf0); - } - } else { - // for port 4, the direction is controlled 1 bit at a time by register 7 - if ((iochip_regs[which][7] >> 0) & 0x01) { - result = (result & ~0x01) | (inputval & 0x01); - } - - if ((iochip_regs[which][7] >> 1) & 0x01) { - result = (result & ~0x02) | (inputval & 0x02); - } - - if ((iochip_regs[which][7] >> 2) & 0x01) { - result = (result & ~0x04) | (inputval & 0x04); - } - - if ((iochip_regs[which][7] >> 3) & 0x01) { - result = (result & ~0x08) | (inputval & 0x08); - } - - result &= 0x0f; - } - - return result; -} - -UINT16 __fastcall XBoardReadWord(UINT32 a) -{ - if (a >= 0x0e0000 && a <= 0x0e0007) { - return System16MultiplyChipRead(0, (a - 0x0e0000) >> 1); - } - - if (a >= 0x0e4000 && a <= 0x0e401f) { - return System16DivideChipRead(0, (a - 0x0e4000) >> 1); - } - - if (a >= 0x0e8000 && a <= 0x0e801f) { - return System16CompareTimerChipRead(0, (a - 0x0e8000) >> 1); - } - - if (a >= 0x2e0000 && a <= 0x2e0007) { - return System16MultiplyChipRead(1, (a - 0x2e0000) >> 1); - } - - if (a >= 0x2e4000 && a <= 0x2e401f) { - return System16DivideChipRead(1, (a - 0x2e4000) >> 1); - } - - if (a >= 0x2e8000 && a <= 0x2e800f) { - return System16CompareTimerChipRead(1, (a - 0x2e8000) >> 1); - } - - switch (a) { - case 0x2ee000: { - // swap the halves of the road RAM - memcpy(System16RoadRamBuff, System16RoadRam, 0x1000); - UINT32 *src = (UINT32 *)System16RoadRamBuff; - UINT32 *dst = (UINT32 *)System16RoadRam; - for (INT32 i = 0; i < 0x1000/4; i++) { - UINT32 temp = *src; - *src++ = *dst; - *dst++ = temp; - } - - return System16RoadControl; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Word -> 0x%06X\n"), a); -#endif - - return 0xffff; -} - -UINT8 __fastcall XBoardReadByte(UINT32 a) -{ - if (a >= 0x0e4000 && a <= 0x0e401f) { - return (UINT8)System16DivideChipRead(0, (a - 0x0e4000) >> 1); - } - - if (a >= 0x2e4000 && a <= 0x2e401f) { - return (UINT8)System16DivideChipRead(0, (a - 0x2e4000) >> 1); - } - - if (a >= 0x140000 && a <= 0x14ffff) { - INT32 offset = ((a - 0x140000) >> 1) & 7; - switch (offset) { - case 0x00: { - return iochip_r(0, 0, 0xff); - } - - case 0x01: { - return iochip_r(0, 1, 0xff); - } - - case 0x02: { - return iochip_r(0, 2, 0); - } - - case 0x03: { - return iochip_r(0, 3, 0); - } - - case 0x04: { - return iochip_r(0, 4, 0); - } - } - - return 0; - } - - if (a >= 0x150000 && a <= 0x15ffff) { - INT32 offset = ((a - 0x150000) >> 1) & 0x07; - switch (offset) { - case 0x00: { - return iochip_r(1, 0, ~System16Input[0]); - } - - case 0x01: { - return iochip_r(1, 1, ~System16Input[1]); - } - - case 0x02: { - return iochip_r(1, 2, System16Dip[0]); - } - - case 0x03: { - return iochip_r(1, 3, System16Dip[1]); - } - - case 0x04: { - return iochip_r(1, 4, 0); - } - } - - return 0; - } - - switch (a) { - case 0x130001: { - if (System16ProcessAnalogControlsDo) return System16ProcessAnalogControlsDo((iochip_regs[0][2] >> 2) & 7); - } - - case 0x2ee000: - case 0x2ee001: - case 0x2ee002: { - // swap the halves of the road RAM - memcpy(System16RoadRamBuff, System16RoadRam, 0x1000); - UINT32 *src = (UINT32 *)System16RoadRamBuff; - UINT32 *dst = (UINT32 *)System16RoadRam; - for (INT32 i = 0; i < 0x1000/4; i++) { - UINT32 temp = *src; - *src++ = *dst; - *dst++ = temp; - } - - return System16RoadControl; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -void __fastcall XBoardWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x0c0000 && a <= 0x0cffff) { - System16BTileWordWrite(a - 0x0c0000, d); - return; - } - - if (a >= 0x0e0000 && a <= 0x0e0007) { - System16MultiplyChipWrite(0, (a - 0x0e0000) >> 1, d); - return; - } - - if (a >= 0x0e4000 && a <= 0x0e401f) { - System16DivideChipWrite(0, (a - 0x0e4000) >> 1, d); - return; - } - - if (a >= 0x0e8000 && a <= 0x0e801f) { - if (a == 0x0e8016) { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - nSystem16CyclesDone[2] += ZetRun(100); - ZetClose(); - - if (System16Z80Rom2Num) { - ZetOpen(1); - ZetNmi(); - nSystem16CyclesDone[3] += ZetRun(100); - ZetClose(); - } - } - - System16CompareTimerChipWrite(0, (a - 0x0e8000) >> 1, d); - return; - } - - if (a >= 0x140000 && a <= 0x14ffff) { - INT32 offset = ((a - 0x140000) >> 1) & 7; - - iochip_regs[0][offset] = d; - - if (offset == 0x02) { - System16VideoEnable = d & 0x20; - if (!(d & 0x01)) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } - } - - if (iochip_custom_write[0][offset]) { - iochip_custom_write[0][offset](d); - } - - return; - } - - if (a >= 0x150000 && a <= 0x15ffff) { - INT32 offset = ((a - 0x150000) >> 1) & 7; - - iochip_regs[1][offset] = d; - - if (iochip_custom_write[1][offset]) { - iochip_custom_write[1][offset](d); - } - - return; - } - - if (a >= 0x2e0000 && a <= 0x2e0007) { - System16MultiplyChipWrite(1, (a - 0x2e0000) >> 1, d); - return; - } - - if (a >= 0x2e4000 && a <= 0x2e401f) { - System16DivideChipWrite(1, (a - 0x2e4000) >> 1, d); - return; - } - - if (a >= 0x2e8000 && a <= 0x2e800f) { - System16CompareTimerChipWrite(1, (a - 0x2e8000) >> 1, d); - return; - } - - switch (a) { - case 0x110000: { - UINT32 *src = (UINT32 *)System16SpriteRam; - UINT32 *dst = (UINT32 *)System16SpriteRamBuff; - - // swap the halves of the sprite RAM - for (UINT32 i = 0; i < System16SpriteRamSize/4; i++) { - UINT32 temp = *src; - *src++ = *dst; - *dst++ = temp; - } - - // hack for thunderblade - memset(System16SpriteRam, 0xff, System16SpriteRamSize); - - return; - } - - case 0x2ee000: { - System16RoadControl = d & 7; - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -void __fastcall XBoardWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x0c0000 && a <= 0x0cffff) { - System16BTileByteWrite((a - 0x0c0000) ^ 1, d); - return; - } - - if (a >= 0x140000 && a <= 0x14ffff) { - INT32 offset = ((a - 0x140000) >> 1) & 7; - - iochip_regs[0][offset] = d; - - if (offset == 0x02) { - System16VideoEnable = d & 0x20; - if (!(d & 0x01)) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } - } - - if (iochip_custom_write[0][offset]) { - iochip_custom_write[0][offset](d); - } - - return; - } - - if (a >= 0x150000 && a <= 0x15ffff) { - INT32 offset = ((a - 0x150000) >> 1) & 7; - - iochip_regs[1][offset] = d; - - if (iochip_custom_write[1][offset]) { - iochip_custom_write[1][offset](d); - } - - return; - } - - switch (a) { - case 0x110000: - case 0x110001: { - UINT32 *src = (UINT32 *)System16SpriteRam; - UINT32 *dst = (UINT32 *)System16SpriteRamBuff; - - // swap the halves of the sprite RAM - for (UINT32 i = 0; i < System16SpriteRamSize/4; i++) { - UINT32 temp = *src; - *src++ = *dst; - *dst++ = temp; - } - - // hack for thunderblade - memset(System16SpriteRam, 0xff, System16SpriteRamSize); - return; - } - - case 0x130001: { - System16AnalogSelect = d; - return; - } - - case 0x0e8017: { - System16CompareTimerChipWrite(0, (a - 0x0e8000) >> 1, d); - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - nSystem16CyclesDone[2] += ZetRun(100); - ZetClose(); - - if (System16Z80Rom2Num) { - ZetOpen(1); - ZetNmi(); - nSystem16CyclesDone[3] += ZetRun(100); - ZetClose(); - } - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -UINT16 __fastcall XBoard2ReadWord(UINT32 a) -{ - if (a >= 0x0e0000 && a <= 0x0e0007) { - return System16MultiplyChipRead(1, (a - 0x0e0000) >> 1); - } - - if (a >= 0x0e4000 && a <= 0x0e401f) { - return System16DivideChipRead(1, (a - 0x0e4000) >> 1); - } - - if (a >= 0x0e8000 && a <= 0x0e800f) { - return System16CompareTimerChipRead(1, (a - 0x0e8000) >> 1); - } - - if (a >= 0x2e0000 && a <= 0x2e0007) { - return System16MultiplyChipRead(1, (a - 0x2e0000) >> 1); - } - - if (a >= 0x2e4000 && a <= 0x2e401f) { - return System16DivideChipRead(1, (a - 0x2e4000) >> 1); - } - - switch (a) { - case 0x0ee000: - case 0x2ee000: { - // swap the halves of the road RAM - memcpy(System16RoadRamBuff, System16RoadRam, 0x1000); - UINT32 *src = (UINT32 *)System16RoadRamBuff; - UINT32 *dst = (UINT32 *)System16RoadRam; - for (INT32 i = 0; i < 0x1000/4; i++) { - UINT32 temp = *src; - *src++ = *dst; - *dst++ = temp; - } - - return System16RoadControl; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 # 2 Read Word -> 0x%06X\n"), a); -#endif - - return 0; -} - -UINT8 __fastcall XBoard2ReadByte(UINT32 a) -{ - switch (a) { - case 0x0ee000: - case 0x0ee001: { - // swap the halves of the road RAM - memcpy(System16RoadRamBuff, System16RoadRam, 0x1000); - UINT32 *src = (UINT32 *)System16RoadRamBuff; - UINT32 *dst = (UINT32 *)System16RoadRam; - for (INT32 i = 0; i < 0x1000/4; i++) { - UINT32 temp = *src; - *src++ = *dst; - *dst++ = temp; - } - - return System16RoadControl; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 # 2 Read Byte -> 0x%06X\n"), a); -#endif - - return 0; -} - -void __fastcall XBoard2WriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x0e0000 && a <= 0x0e0007) { - System16MultiplyChipWrite(1, (a - 0x0e0000) >> 1, d); - return; - } - - if (a >= 0x0e4000 && a <= 0x0e401f) { - System16DivideChipWrite(1, (a - 0x0e4000) >> 1, d); - return; - } - - if (a >= 0x0e8000 && a <= 0x0e800f) { - System16CompareTimerChipWrite(1, (a - 0x0e8000) >> 1, d); - return; - } - - if (a >= 0x2e0000 && a <= 0x2e0007) { - System16MultiplyChipWrite(1, (a - 0x2e0000) >> 1, d); - return; - } - - if (a >= 0x2e4000 && a <= 0x2e401f) { - System16DivideChipWrite(1, (a - 0x2e4000) >> 1, d); - return; - } - - switch (a) { - case 0x0ee000: - case 0x2ee000: { - System16RoadControl = d & 7; - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 # 2 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -void __fastcall XBoard2WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x0ee001: - case 0x2ee000: { - System16RoadControl = d & 7; - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 # 2 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -/*==================================================== -Driver Inits -====================================================*/ - -static UINT8 AbcopProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - // Left / Right - case 0: { - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) < 0xf82 && (System16AnalogPort0 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort0 >> 4); - } - - if (temp < 0x20) { - temp = 0x20; - return temp; - } - - if (temp > 0xe0) { - temp = 0xe0; - return temp; - } - - return temp; - } - - // Accelerate - case 1: { - if (System16AnalogPort1 > 1) return 0xff; - return 0; - } - } - - return 0; -} - -static INT32 AbcopInit() -{ - System16ProcessAnalogControlsDo = AbcopProcessAnalogControls; - - return System16Init(); -} - -static UINT8 AburnerProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - // Left / Right - case 0: { - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) > 0x7f && (System16AnalogPort0 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort0 >> 4); - } - - if (temp < 0x45) { - temp = 0x20; - return temp; - } - - if (temp > 0xb0) { - temp = 0xe0; - return temp; - } -// bprintf(PRINT_NORMAL, _T("[%X,%X]"), temp, System16AnalogPort0 >> 4); - return temp; - } - - // Up / Down - case 1: { - // Prevent CHAR data overflow - if((System16AnalogPort1 >> 4) < 0xf82 && (System16AnalogPort1 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort1 >> 4); - } - - if (temp < 0x40) { - temp = 0x40; - return temp; - } - - if (temp > 0xc0) { - temp = 0xc0; - return temp; - } - - return temp; - } - - // Throttle - case 2: { - // Prevent CHAR data overflow - if((System16AnalogPort2 >> 4) > 0x7f && (System16AnalogPort2 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort2 >> 4); - } - -// bprintf(PRINT_NORMAL, _T("[%X,%X]"), temp, System16AnalogPort2 >> 4); - if (temp > 0xb0) { - temp = 0xff; - return temp; - } - - if (temp < 0x45) { - temp = 0; - return temp; - } - - temp = 0x80; - - return temp; - } - } - - return 0; -} - -static INT32 Aburner2Init() -{ - System16ProcessAnalogControlsDo = AburnerProcessAnalogControls; - - INT32 nRet = System16Init(); - - if (!nRet) { - System16RoadPriority = 0; - } - - return nRet; -} - -static UINT8 GpriderProcessAnalogControls(UINT16 value) -{ - switch (value) { - // Left / Right - case 0: { - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) > 0x7f && (System16AnalogPort0 >> 4) <= 0x80) { - return 0x80 + 0x7f; - } else { - return 0x80 + (System16AnalogPort0 >> 4); - } - } - - // Accelerate - case 1: { - if (System16AnalogPort1 > 1) return 0x10; - return 0xef; - } - - // Brake - case 2: { - if (System16AnalogPort2 > 1) return 0x10; - return 0xef; - } - } - - return 0; -} - -static INT32 GpriderInit() -{ - System16ProcessAnalogControlsDo = GpriderProcessAnalogControls; - - return System16Init(); -} - -static UINT8 LastsurvIOCustomRead(UINT8) -{ - if (LastsurvMux < 2) { - UINT8 Positions[8] = { 0x60, 0xe0, 0xa0, 0xb0, 0x90, 0xd0, 0x50, 0x70 }; - - return 0x0f - System16Input[1 + LastsurvMux] + Positions[LastsurvPosition[LastsurvMux ^ 0x01] >> 4]; - } - - return 0xff - System16Input[1 + LastsurvMux]; -} - -static void LastsurvIOCustomWrite(UINT8 d) -{ - LastsurvMux = (d >> 5) & 0x03; -} - -static void LastsurvMakeAnalogInputs() -{ - if (System16InputPort6[0]) { - LastsurvPosition[0] -= 0x02; - System16InputPort6[0] = 0; - } - - if (System16InputPort6[1]) { - LastsurvPosition[0] += 0x02; - System16InputPort6[1] = 0; - } - - if (System16InputPort6[2]) { - LastsurvPosition[1] -= 0x02; - System16InputPort6[2] = 0; - } - - if (System16InputPort6[3]) { - LastsurvPosition[1] += 0x02; - System16InputPort6[3] = 0; - } - - if (LastsurvPosition[0] < 0) LastsurvPosition[0] = 0x7e; - if (LastsurvPosition[0] > 0x7e) LastsurvPosition[0] = 0; - - if (LastsurvPosition[1] < 0) LastsurvPosition[1] = 0x7e; - if (LastsurvPosition[1] > 0x7e) LastsurvPosition[1] = 0; -} - -static INT32 LastsurvInit() -{ - iochip_custom_read[1][1] = LastsurvIOCustomRead; - iochip_custom_write[0][3] = LastsurvIOCustomWrite; - - System16MakeAnalogInputsDo = LastsurvMakeAnalogInputs; - - INT32 nRet = System16Init(); - - if (!nRet) { - System16RoadPriority = 0; - - // reverse YM2151 channels - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.43, BURN_SND_ROUTE_RIGHT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.43, BURN_SND_ROUTE_LEFT); - } - - return nRet; -} - -static UINT8 LoffireProcessAnalogControls(UINT16 value) -{ - switch (value) { - case 0: { - return BurnGunReturnX(0); - } - - case 1: { - return ~BurnGunReturnY(0); - } - - case 2: { - return BurnGunReturnX(1); - } - - case 3: { - return ~BurnGunReturnY(1); - } - } - - return 0; -} - -static INT32 LoffireInit() -{ - BurnGunInit(2, true); - - System16ProcessAnalogControlsDo = LoffireProcessAnalogControls; - INT32 rc = System16Init(); - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_1, 1.0, BURN_SND_ROUTE_BOTH); - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_2, 1.0, BURN_SND_ROUTE_BOTH); - - return rc; -} - -static UINT8 RacheroProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - // Left / Right - case 0: { - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) < 0xf82 && (System16AnalogPort0 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort0 >> 4); - } - - if (temp < 0x20) temp = 0x20; - if (temp > 0xe0) temp = 0xe0; - return temp; - } - - // Accelerate - case 1: { - if (System16AnalogPort1 > 1) return 0xff; - return 0; - } - - // Brake - case 2: { - if (System16AnalogPort2 > 1) return 0xff; - return 0; - } - } - - return 0; -} - -static INT32 RacheroInit() -{ - System16ProcessAnalogControlsDo = RacheroProcessAnalogControls; - - return System16Init(); -} - -static INT32 RascotInit() -{ - INT32 nRet = System16Init(); - - if (!nRet) { - System16RoadPriority = 0; - - // patch out bootup link test - UINT16 *ROM = (UINT16*)System16Rom2; - ROM[0xb78 / 2] = 0x601e; - ROM[0x57e / 2] = 0x4e71; - ROM[0x5d0 / 2] = 0x6008; - ROM[0x606 / 2] = 0x4e71; - } - - return nRet; -} - -static UINT8 SmgpProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - // Left / Right - case 0: { - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) > 0x7f && (System16AnalogPort0 >> 4) <= 0x80) { - return 0x80 + 0x7f; - } else { - return 0x80 + (System16AnalogPort0 >> 4); - } - - if (temp < 0x39) temp = 0x38; - if (temp > 0xc8) temp = 0xc8; - return temp; - } - - // Accelerate - case 1: { - if (System16AnalogPort1 > 1) return 0xb8; - return 0x38; - } - - // Brake - case 2: { - if (System16AnalogPort2 > 1) return 0xa8; - return 0x28; - } - } - - return 0; -} - -static INT32 SmgpInit() -{ - System16ProcessAnalogControlsDo = SmgpProcessAnalogControls; - - INT32 nRet = System16Init(); - - if (!nRet) { - System16RoadPriority = 0; - } - - return nRet; -} - -static UINT8 ThndrbldProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - // Left / Right - case 0: { - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) < 0xf82 && (System16AnalogPort0 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort0 >> 4); - } - - if (temp < 0x20) { - temp = 0x20; - return temp; - } - - if (temp > 0xe0) { - temp = 0xe0; - return temp; - } - - return temp; - } - - // Throttle - case 1: { - // Prevent CHAR data overflow - if((System16AnalogPort2 >> 4) > 0x7f && (System16AnalogPort2 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort2 >> 4); - } - - if (temp == 1) temp = 0; - return temp; - } - - // Up / Down - case 2: { - // Prevent CHAR data overflow - if((System16AnalogPort1 >> 4) > 0x7f && (System16AnalogPort1 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort1 >> 4); - } - - if (temp < 0x20) { - temp = 0x20; - return temp; - } - - if (temp > 0xe0) { - temp = 0xe0; - return temp; - } - - return temp; - } - } - - return 0; -} - -static INT32 ThndrbldInit() -{ - System16ProcessAnalogControlsDo = ThndrbldProcessAnalogControls; - - return System16Init(); -} - -static INT32 XBoardExit() -{ - memset(iochip_regs, 0, sizeof(iochip_regs)); - - for (INT32 i = 0; i < 8; i++) { - iochip_custom_read[0][i] = NULL; - iochip_custom_read[1][i] = NULL; - iochip_custom_write[0][i] = NULL; - iochip_custom_write[1][i] = NULL; - } - - LastsurvMux = 0; - LastsurvPosition[0] = LastsurvPosition[1] = 0; - - return System16Exit(); -} - -static INT32 XBoardScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(iochip_regs); - SCAN_VAR(LastsurvPosition); - SCAN_VAR(LastsurvMux); - } - - return System16Scan(nAction, pnMin);; -} - -/*==================================================== -Driver Defs -====================================================*/ - -struct BurnDriver BurnDrvAbcop = { - "abcop", NULL, NULL, NULL, "1990", - "A.B. Cop (World, FD1094 317-0169b)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, AbcopRomInfo, AbcopRomName, NULL, NULL, AbcopInputInfo, AbcopDIPInfo, - AbcopInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAbcopd = { - "abcopd", "abcop", NULL, NULL, "1990", - "A.B. Cop (World, FD1094 317-0169b decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, AbcopdRomInfo, AbcopdRomName, NULL, NULL, AbcopInputInfo, AbcopDIPInfo, - AbcopInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAbcopj = { - "abcopj", "abcop", NULL, NULL, "1990", - "A.B. Cop (Japan, FD1094 317-0169b)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, AbcopjRomInfo, AbcopjRomName, NULL, NULL, AbcopInputInfo, AbcopDIPInfo, - AbcopInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAbcopjd = { - "abcopjd", "abcop", NULL, NULL, "1990", - "A.B. Cop (Japan, FD1094 317-0169b decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, AbcopjdRomInfo, AbcopjdRomName, NULL, NULL, AbcopInputInfo, AbcopDIPInfo, - AbcopInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAburner2 = { - "aburner2", NULL, NULL, NULL, "1987", - "After Burner II\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_SHOOT, 0, - NULL, Aburner2RomInfo, Aburner2RomName, NULL, NULL, Aburner2InputInfo, Aburner2DIPInfo, - Aburner2Init, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAburner2g = { - "aburner2g", "aburner2", NULL, NULL, "1987", - "After Burner II (German)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_SHOOT, 0, - NULL, Aburner2gRomInfo, Aburner2gRomName, NULL, NULL, Aburner2InputInfo, Aburner2DIPInfo, - Aburner2Init, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvAburner = { - "aburner", "aburner2", NULL, NULL, "1987", - "After Burner\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_SHOOT, 0, - NULL, AburnerRomInfo, AburnerRomName, NULL, NULL, Aburner2InputInfo, AburnerDIPInfo, - Aburner2Init, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGprider = { - "gprider", NULL, NULL, NULL, "1990", - "GP Rider (World, FD1094 317-0163) (Twin setup)\0", "Single version only", "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, GpriderRomInfo, GpriderRomName, NULL, NULL, GpriderInputInfo, GpriderDIPInfo, - GpriderInit, XBoardExit, XBoardFrameGPRider, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGpriders = { - "gpriders", "gprider", NULL, NULL, "1990", - "GP Rider (World, FD1094 317-0163)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, GpridersRomInfo, GpridersRomName, NULL, NULL, GpriderInputInfo, GpriderDIPInfo, - GpriderInit, XBoardExit, XBoardFrameGPRider, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGpriderj = { - "gpriderj", "gprider", NULL, NULL, "1990", - "GP Rider (Japan, FD1094 317-0161) (Twin setup)\0", "Single version only", "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, GpriderjRomInfo, GpriderjRomName, NULL, NULL, GpriderInputInfo, GpriderDIPInfo, - GpriderInit, XBoardExit, XBoardFrameGPRider, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGpriderjs = { - "gpriderjs", "gprider", NULL, NULL, "1990", - "GP Rider (Japan, FD1094 317-0161)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, GpriderjsRomInfo, GpriderjsRomName, NULL, NULL, GpriderInputInfo, GpriderDIPInfo, - GpriderInit, XBoardExit, XBoardFrameGPRider, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGprideru = { - "gprideru", "gprider", NULL, NULL, "1990", - "GP Rider (US, FD1094 317-0162) (Twin setup)\0", "Single version only", "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, GprideruRomInfo, GprideruRomName, NULL, NULL, GpriderInputInfo, GpriderDIPInfo, - GpriderInit, XBoardExit, XBoardFrameGPRider, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGpriderus = { - "gpriderus", "gprider", NULL, NULL, "1990", - "GP Rider (US, FD1094 317-0162)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, GpriderusRomInfo, GpriderusRomName, NULL, NULL, GpriderInputInfo, GpriderDIPInfo, - GpriderInit, XBoardExit, XBoardFrameGPRider, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLastsurv = { - "lastsurv", NULL, NULL, NULL, "1987", - "Last Survivor (FD1094 317-0083)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_SHOOT, 0, - NULL, LastsurvRomInfo, LastsurvRomName, NULL, NULL, LastsurvInputInfo, LastsurvDIPInfo, - LastsurvInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLastsurvd = { - "lastsurvd", "lastsurv", NULL, NULL, "1987", - "Last Survivor (FD1094 317-0083 decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_SHOOT, 0, - NULL, LastsurvdRomInfo, LastsurvdRomName, NULL, NULL, LastsurvInputInfo, LastsurvDIPInfo, - LastsurvInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLoffire = { - "loffire", NULL, NULL, NULL, "1989", - "Line of Fire / Bakudan Yarou (World, FD1094 317-0136)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_SHOOT, 0, - NULL, LoffireRomInfo, LoffireRomName, NULL, NULL, LoffireInputInfo, LoffireDIPInfo, - LoffireInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLoffired = { - "loffired", "loffire", NULL, NULL, "1989", - "Line of Fire / Bakudan Yarou (World, FD1094 317-0136 decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_SHOOT, 0, - NULL, LoffiredRomInfo, LoffiredRomName, NULL, NULL, LoffireInputInfo, LoffireDIPInfo, - LoffireInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLoffirej = { - "loffirej", "loffire", NULL, NULL, "1989", - "Line of Fire / Bakudan Yarou (Japan, FD1094 317-0134)\0", NULL, "Sega", "X-Board", - L"Line of Fire / Bakudan Yarou (Japan, FD1094 317-0134)\0\u7206\u5F3E\u91CE\u90CE\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_SHOOT, 0, - NULL, LoffirejRomInfo, LoffirejRomName, NULL, NULL, LoffireInputInfo, LoffireDIPInfo, - LoffireInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLoffirejd = { - "loffirejd", "loffire", NULL, NULL, "1989", - "Line of Fire / Bakudan Yarou (Japan, FD1094 317-0134 decrypted)\0", NULL, "Sega", "X-Board", - L"Line of Fire / Bakudan Yarou (Japan, FD1094 317-0134 decrypted)\0\u7206\u5F3E\u91CE\u90CE\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_SHOOT, 0, - NULL, LoffirejdRomInfo, LoffirejdRomName, NULL, NULL, LoffireInputInfo, LoffireDIPInfo, - LoffireInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLoffireu = { - "loffireu", "loffire", NULL, NULL, "1989", - "Line of Fire / Bakudan Yarou (US, FD1094 317-0135)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_SHOOT, 0, - NULL, LoffireuRomInfo, LoffireuRomName, NULL, NULL, LoffireInputInfo, LoffireDIPInfo, - LoffireInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLoffireud = { - "loffireud", "loffire", NULL, NULL, "1989", - "Line of Fire / Bakudan Yarou (US, FD1094 317-0135 decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_SHOOT, 0, - NULL, LoffireudRomInfo, LoffireudRomName, NULL, NULL, LoffireInputInfo, LoffireDIPInfo, - LoffireInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRachero = { - "rachero", NULL, NULL, NULL, "1989", - "Racing Hero (FD1094 317-0144)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, RacheroRomInfo, RacheroRomName, NULL, NULL, RacheroInputInfo, RacheroDIPInfo, - RacheroInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRacherod = { - "racherod", "rachero", NULL, NULL, "1989", - "Racing Hero (FD1094 317-0144 decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, RacherodRomInfo, RacherodRomName, NULL, NULL, RacheroInputInfo, RacheroDIPInfo, - RacheroInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriverD BurnDrvRascot = { - "rascot", NULL, NULL, NULL, "19??", - "Royal Ascot\0", NULL, "????", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_MISC, 0, - NULL, RascotRomInfo, RascotRomName, NULL, NULL, Aburner2InputInfo, Aburner2DIPInfo, - RascotInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgp = { - "smgp", NULL, NULL, NULL, "1989", - "Super Monaco GP (World, Rev B, FD1094 317-0126a)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, SmgpRomInfo, SmgpRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpd = { - "smgpd", "smgp", NULL, NULL, "1989", - "Super Monaco GP (World, Rev B, FD1094 317-0126a decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, SmgpdRomInfo, SmgpdRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgp6 = { - "smgp6", "smgp", NULL, NULL, "1989", - "Super Monaco GP (World, Rev A, FD1094 317-0126a)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, Smgp6RomInfo, Smgp6RomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgp6d = { - "smgp6d", "smgp", NULL, NULL, "1989", - "Super Monaco GP (World, Rev A, FD1094 317-0126a decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Smgp6dRomInfo, Smgp6dRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgp5 = { - "smgp5", "smgp", NULL, NULL, "1989", - "Super Monaco GP (World, FD1094 317-0126)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, Smgp5RomInfo, Smgp5RomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgp5d = { - "smgp5d", "smgp", NULL, NULL, "1989", - "Super Monaco GP (World, FD1094 317-0126 decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Smgp5dRomInfo, Smgp5dRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpu = { - "smgpu", "smgp", NULL, NULL, "1989", - "Super Monaco GP (US, Rev C, FD1094 317-0125a)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, SmgpuRomInfo, SmgpuRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpud = { - "smgpud", "smgp", NULL, NULL, "1989", - "Super Monaco GP (US, Rev C, FD1094 317-0125a decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, SmgpudRomInfo, SmgpudRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpu1 = { - "smgpu1", "smgp", NULL, NULL, "1989", - "Super Monaco GP (US, Rev B, FD1094 317-0125a)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, Smgpu1RomInfo, Smgpu1RomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpu1d = { - "smgpu1d", "smgp", NULL, NULL, "1989", - "Super Monaco GP (US, Rev B, FD1094 317-0125a decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Smgpu1dRomInfo, Smgpu1dRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpu2 = { - "smgpu2", "smgp", NULL, NULL, "1989", - "Super Monaco GP (US, Rev A, FD1094 317-0125a)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, Smgpu2RomInfo, Smgpu2RomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpu2d = { - "smgpu2d", "smgp", NULL, NULL, "1989", - "Super Monaco GP (US, Rev A, FD1094 317-0125a decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, Smgpu2dRomInfo, Smgpu2dRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpj = { - "smgpj", "smgp", NULL, NULL, "1989", - "Super Monaco GP (Japan, Rev B, FD1094 317-0124a)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, SmgpjRomInfo, SmgpjRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpjd = { - "smgpjd", "smgp", NULL, NULL, "1989", - "Super Monaco GP (Japan, Rev B, FD1094 317-0124a decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_RACING, 0, - NULL, SmgpjdRomInfo, SmgpjdRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSmgpja = { - "smgpja", "smgp", NULL, NULL, "1989", - "Super Monaco GP (Japan, Rev A, FD1094 317-0124a)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_RACING, 0, - NULL, SmgpjaRomInfo, SmgpjaRomName, NULL, NULL, SmgpInputInfo, SmgpDIPInfo, - SmgpInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThndrbld = { - "thndrbld", NULL, NULL, NULL, "1987", - "Thunder Blade (upright, FD1094 317-0056)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32 | HARDWARE_SEGA_FD1094_ENC, GBF_SHOOT, 0, - NULL, ThndrbldRomInfo, ThndrbldRomName, NULL, NULL, ThndrbldInputInfo, ThndrbldDIPInfo, - ThndrbldInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThndrbldd = { - "thndrbldd", "thndrbld", NULL, NULL, "1987", - "Thunder Blade (upright, FD1094 317-0056 decrypted)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_SHOOT, 0, - NULL, ThndrblddRomInfo, ThndrblddRomName, NULL, NULL, ThndrbldInputInfo, ThndrbldDIPInfo, - ThndrbldInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThndrbld1 = { - "thndrbld1", "thndrbld", NULL, NULL, "1987", - "Thunder Blade (deluxe/standing, unprotected)\0", NULL, "Sega", "X-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMX | HARDWARE_SEGA_SPRITE_LOAD32, GBF_SHOOT, 0, - NULL, Thndrbld1RomInfo, Thndrbld1RomName, NULL, NULL, ThndrbldInputInfo, Thndrbld1DIPInfo, - ThndrbldInit, XBoardExit, XBoardFrame, NULL, XBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_ybrd.cpp b/jan/src/burn/drv/sega/d_ybrd.cpp deleted file mode 100644 index 707cfb1bb..000000000 --- a/jan/src/burn/drv/sega/d_ybrd.cpp +++ /dev/null @@ -1,2237 +0,0 @@ -#include "sys16.h" - -/*==================================================== -Input Defs -====================================================*/ - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo Gforce2InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Up/Down" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 y-axis" ), - A("Throttle" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 z-axis" ), - {"Shoot" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 1" }, - {"Missile" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Gforce2) - -static struct BurnInputInfo GlocInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Up/Down" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 y-axis" ), - A("Throttle" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 z-axis" ), - {"Fire 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 2" }, - {"Fire 3" , BIT_DIGITAL , System16InputPort0 + 0, "p1 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Gloc) - -static struct BurnInputInfo Glocr360InputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Up/Down" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 y-axis" ), - A("Moving Roll" , BIT_ANALOG_REL, &System16AnalogPort2, "p2 x-axis" ), - A("Moving Pitch" , BIT_ANALOG_REL, &System16AnalogPort3, "p3 x-axis" ), - {"Fire 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , System16InputPort0 + 5, "p1 fire 2" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Glocr360) - -static struct BurnInputInfo PdriftInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 6, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 7, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &System16AnalogPort0, "p1 x-axis" ), - A("Accelerate" , BIT_ANALOG_REL, &System16AnalogPort1, "p1 fire 1" ), - A("Brake" , BIT_ANALOG_REL, &System16AnalogPort2, "p1 fire 2" ), - {"Gear" , BIT_DIGITAL , &System16Gear , "p1 fire 3" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 2 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 1 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Pdrift) - -static struct BurnInputInfo RchaseInputList[] = { - {"Coin 1" , BIT_DIGITAL , System16InputPort0 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , System16InputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , System16InputPort0 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , System16InputPort0 + 6, "p2 start" }, - - A("P1 Left/Right" , BIT_ANALOG_REL, &System16AnalogPort0, "mouse x-axis" ), - A("P1 Up/Down" , BIT_ANALOG_REL, &System16AnalogPort1, "mouse y-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , System16InputPort0 + 1, "mouse button 1" }, - - A("P2 Left/Right" , BIT_ANALOG_REL, &System16AnalogPort2, "p2 x-axis" ), - A("P2 Up/Down" , BIT_ANALOG_REL, &System16AnalogPort3, "p2 y-axis" ), - {"P2 Fire 1" , BIT_DIGITAL , System16InputPort0 + 0, "p2 fire 1" }, - - {"Service" , BIT_DIGITAL , System16InputPort0 + 3 , "service" }, - {"Diagnostics" , BIT_DIGITAL , System16InputPort0 + 2 , "diag" }, - {"Reset" , BIT_DIGITAL , &System16Reset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , System16Dip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , System16Dip + 1 , "dip" }, -}; - -STDINPUTINFO(Rchase) - -#undef A - -/*==================================================== -Dip Defs -====================================================*/ - -#define YBOARD_COINAGE(dipval) \ - {0 , 0xfe, 0 , 16 , "Coin A" }, \ - {dipval, 0x01, 0x0f, 0x07, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x08, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x09, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x05, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0x0f, 0x04, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0x0f, 0x01, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0x0f, 0x02, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0x0f, 0x03, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0x0f, 0x06, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0x0f, 0x00, "Free Play (if coin B too) or 1C/1C" }, \ - \ - {0 , 0xfe, 0 , 16 , "Coin B" }, \ - {dipval, 0x01, 0xf0, 0x70, "4 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x80, "3 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x90, "2 Coins 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x50, "2 Coins 1 Credit 5/3 6/4" }, \ - {dipval, 0x01, 0xf0, 0x40, "2 Coins 1 Credit 4/3" }, \ - {dipval, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, \ - {dipval, 0x01, 0xf0, 0x10, "1 Coin 1 Credit 2/3" }, \ - {dipval, 0x01, 0xf0, 0x20, "1 Coin 1 Credit 4/5" }, \ - {dipval, 0x01, 0xf0, 0x30, "1 Coin 1 Credit 5/6" }, \ - {dipval, 0x01, 0xf0, 0x60, "2 Coins 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, \ - {dipval, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, \ - {dipval, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, \ - {dipval, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, \ - {dipval, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, \ - {dipval, 0x01, 0xf0, 0x00, "Free Play (if coin A too) or 1C/1C" }, - -static struct BurnDIPInfo Gforce2DIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0x7e, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Energy Timer" }, - {0x0b, 0x01, 0x06, 0x04, "Easy" }, - {0x0b, 0x01, 0x06, 0x06, "Normal" }, - {0x0b, 0x01, 0x06, 0x02, "Hard" }, - {0x0b, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Shield Strength" }, - {0x0b, 0x01, 0x08, 0x08, "Weak" }, - {0x0b, 0x01, 0x08, 0x00, "Strong" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0x30, 0x20, "Easy" }, - {0x0b, 0x01, 0x30, 0x30, "Normal" }, - {0x0b, 0x01, 0x30, 0x10, "Hard" }, - {0x0b, 0x01, 0x30, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Cabinet" }, - {0x0b, 0x01, 0xc0, 0xc0, "Super Deluxe" }, - {0x0b, 0x01, 0xc0, 0x80, "Deluxe" }, - {0x0b, 0x01, 0xc0, 0x40, "Upright" }, - {0x0b, 0x01, 0xc0, 0x00, "City" }, - - // Dip 2 - YBOARD_COINAGE(0x0c) -}; - -STDDIPINFO(Gforce2) - -static struct BurnDIPInfo GlocDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x6b, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x0c, 0x01, 0x18, 0x18, "Moving" }, - {0x0c, 0x01, 0x18, 0x10, "Cockpit" }, - {0x0c, 0x01, 0x18, 0x08, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x20, 0x00, "No" }, - {0x0c, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Credits" }, - {0x0c, 0x01, 0xc0, 0x40, "1 to start, 1 to continue" }, - {0x0c, 0x01, 0xc0, 0xc0, "2 to start, 1 to continue" }, - {0x0c, 0x01, 0xc0, 0x80, "3 to start, 2 to continue" }, - {0x0c, 0x01, 0xc0, 0x00, "4 to start, 3 to continue" }, - - // Dip 2 - YBOARD_COINAGE(0x0d) -}; - -STDDIPINFO(Gloc) - -static struct BurnDIPInfo Glocr360DIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0xf3, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 3 , "Game Type" }, - {0x0c, 0x01, 0x03, 0x02, "Fighting Only" }, - {0x0c, 0x01, 0x03, 0x03, "Fight/Experience" }, - {0x0c, 0x01, 0x03, 0x01, "Experience Only" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 9 , "Initial Credit" }, - {0x0c, 0x01, 0xf0, 0xf0, "1" }, - {0x0c, 0x01, 0xf0, 0xe0, "2" }, - {0x0c, 0x01, 0xf0, 0xd0, "3" }, - {0x0c, 0x01, 0xf0, 0xc0, "4" }, - {0x0c, 0x01, 0xf0, 0xb0, "5" }, - {0x0c, 0x01, 0xf0, 0xa0, "6" }, - {0x0c, 0x01, 0xf0, 0x90, "8" }, - {0x0c, 0x01, 0xf0, 0x80, "10" }, - {0x0c, 0x01, 0xf0, 0x70, "12" }, - - // Dip 2 - {0 , 0xfe, 0 , 9 , "Coin A" }, - {0x0d, 0x01, 0x0f, 0x0f, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits" }, - {0x0d, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits" }, - {0x0d, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits" }, - {0x0d, 0x01, 0x0f, 0x09, "1 Coin 7 Credits" }, - {0x0d, 0x01, 0x0f, 0x08, "1 Coin 8 Credits" }, - {0x0d, 0x01, 0x0f, 0x00, "Free Play (if coin B too) or 1C/1C" }, - - {0 , 0xfe, 0 , 9 , "Coin B" }, - {0x0d, 0x01, 0xf0, 0xf0, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits" }, - {0x0d, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits" }, - {0x0d, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits" }, - {0x0d, 0x01, 0xf0, 0x90, "1 Coin 7 Credits" }, - {0x0d, 0x01, 0xf0, 0x80, "1 Coin 8 Credits" }, - {0x0d, 0x01, 0xf0, 0x00, "Free Play (if coin A too) or 1C/1C" }, -}; - -STDDIPINFO(Glocr360) - -static struct BurnDIPInfo PdriftDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xea, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x0a, 0x01, 0x03, 0x03, "Moving" }, - {0x0a, 0x01, 0x03, 0x02, "Upright/Sit Down" }, - {0x0a, 0x01, 0x03, 0x01, "Mini Upright" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Credits" }, - {0x0a, 0x01, 0x08, 0x08, "1 to start, 1 to continue" }, - {0x0a, 0x01, 0x08, 0x18, "2 to start, 1 to continue" }, - {0x0a, 0x01, 0x08, 0x00, "2 to start, 2 to continue" }, - {0x0a, 0x01, 0x08, 0x10, "3 to start, 2 to continue" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0a, 0x01, 0x20, 0x00, "No" }, - {0x0a, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0a, 0x01, 0xc0, 0x80, "Easy" }, - {0x0a, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0a, 0x01, 0xc0, 0x40, "Hard" }, - {0x0a, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - YBOARD_COINAGE(0x0b) -}; - -STDDIPINFO(Pdrift) - -static struct BurnDIPInfo PdrifteDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xea, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x0a, 0x01, 0x03, 0x03, "Moving" }, - {0x0a, 0x01, 0x03, 0x02, "Upright" }, - {0x0a, 0x01, 0x03, 0x01, "Mini Upright" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Initial Credit" }, - {0x0a, 0x01, 0x10, 0x00, "1" }, - {0x0a, 0x01, 0x10, 0x10, "2" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0a, 0x01, 0x20, 0x00, "No" }, - {0x0a, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0a, 0x01, 0xc0, 0x80, "Easy" }, - {0x0a, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0a, 0x01, 0xc0, 0x40, "Hard" }, - {0x0a, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - YBOARD_COINAGE(0x0b) -}; - -STDDIPINFO(Pdrifte) - -static struct BurnDIPInfo PdriftjDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xea, NULL }, - {0x0b, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x0a, 0x01, 0x03, 0x03, "Moving" }, - {0x0a, 0x01, 0x03, 0x02, "Upright/Sit Down" }, - {0x0a, 0x01, 0x03, 0x01, "Mini Upright" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Initial Credit" }, - {0x0a, 0x01, 0x10, 0x00, "1" }, - {0x0a, 0x01, 0x10, 0x10, "2" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0a, 0x01, 0x20, 0x00, "No" }, - {0x0a, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0a, 0x01, 0xc0, 0x80, "Easy" }, - {0x0a, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0a, 0x01, 0xc0, 0x40, "Hard" }, - {0x0a, 0x01, 0xc0, 0x00, "Hardest" }, - - // Dip 2 - YBOARD_COINAGE(0x0b) -}; - -STDDIPINFO(Pdriftj) - -static struct BurnDIPInfo RchaseDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0x63, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Credits" }, - {0x0d, 0x01, 0x03, 0x03, "1 to start, 1 to continue" }, - {0x0d, 0x01, 0x03, 0x02, "2 to start, 1 to continue" }, - {0x0d, 0x01, 0x03, 0x01, "3 to start, 2 to continue" }, - {0x0d, 0x01, 0x03, 0x00, "4 to start, 3 to continue" }, - - {0 , 0xfe, 0 , 2 , "Coin Chute" }, - {0x0d, 0x01, 0x04, 0x04, "Single" }, - {0x0d, 0x01, 0x04, 0x00, "Twin" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x08, 0x08, "Moving" }, - {0x0d, 0x01, 0x08, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0d, 0x01, 0x60, 0x40, "Easy" }, - {0x0d, 0x01, 0x60, 0x60, "Normal" }, - {0x0d, 0x01, 0x60, 0x20, "Hard" }, - {0x0d, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x80, 0x80, "Off" }, - {0x0d, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Coin to Credit" }, - {0x0e, 0x01, 0x03, 0x00, "4 Coins 1 Credit" }, - {0x0e, 0x01, 0x03, 0x01, "3 Coins 1 Credit" }, - {0x0e, 0x01, 0x03, 0x02, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x03, 0x03, "1 Coins 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Coin #1 mulitplier" }, - {0x0e, 0x01, 0x04, 0x04, "x1" }, - {0x0e, 0x01, 0x04, 0x00, "x2" }, - - {0 , 0xfe, 0 , 4 , "Coin #2 mulitplier" }, - {0x0e, 0x01, 0x18, 0x18, "x1" }, - {0x0e, 0x01, 0x18, 0x10, "x4" }, - {0x0e, 0x01, 0x18, 0x08, "x5" }, - {0x0e, 0x01, 0x18, 0x00, "x6" }, - - {0 , 0xfe, 0 , 8 , "Bonus Adder" }, - {0x0e, 0x01, 0xe0, 0xe0, "None" }, - {0x0e, 0x01, 0xe0, 0xc0, "2 gives 1 more" }, - {0x0e, 0x01, 0xe0, 0xa0, "3 gives 1 more" }, - {0x0e, 0x01, 0xe0, 0x80, "4 gives 1 more" }, - {0x0e, 0x01, 0xe0, 0x60, "5 gives 1 more" }, - {0x0e, 0x01, 0xe0, 0x40, "6 gives 1 more" }, - {0x0e, 0x01, 0xe0, 0x20, "7 gives 1 more" }, - {0x0e, 0x01, 0xe0, 0x00, "Error" }, -}; - -STDDIPINFO(Rchase) - -static struct BurnDIPInfo StrkfgtrDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0x5b, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x08, 0x00, "No" }, - {0x0c, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 4 , "Credits" }, - {0x0c, 0x01, 0x30, 0x10, "1 to start, 1 to continue" }, - {0x0c, 0x01, 0x30, 0x30, "2 to start, 1 to continue" }, - {0x0c, 0x01, 0x30, 0x20, "3 to start, 2 to continue" }, - {0x0c, 0x01, 0x30, 0x00, "4 to start, 3 to continue" }, - - {0 , 0xfe, 0 , 3 , "Cabinet" }, - {0x0c, 0x01, 0xc0, 0xc0, "Moving" }, - {0x0c, 0x01, 0xc0, 0x80, "Cockpit" }, - {0x0c, 0x01, 0xc0, 0x40, "Upright" }, - - // Dip 2 - YBOARD_COINAGE(0x0d) -}; - -STDDIPINFO(Strkfgtr) - -#undef YBOARD_COINAGE - -/*==================================================== -Rom Defs -====================================================*/ - -static struct BurnRomInfo Gforce2RomDesc[] = { - { "epr-11688.25", 0x20000, 0xc845f2df, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11687.24", 0x20000, 0x1cbefbbf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11875.81", 0x20000, 0xc81701c6, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11874.80", 0x20000, 0x5301fd79, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11816b.54", 0x20000, 0x317dd0c2, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-11815b.53", 0x20000, 0xf1fb22f1, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "mpr-11468.14", 0x20000, 0x74ca9ca5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11467.16", 0x20000, 0x6e60e736, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11695.15", 0x20000, 0x38a864be, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11694.17", 0x20000, 0x7e297b84, SYS16_ROM_SPRITES | BRF_GRA }, - - { "mpr-11469.67", 0x20000, 0xed7a2299, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11470.75", 0x20000, 0x34dea550, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11477.63", 0x20000, 0xa2784653, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11478.71", 0x20000, 0x8b778993, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11471.86", 0x20000, 0xf1974069, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11472.114", 0x20000, 0x0d24409a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11479.82", 0x20000, 0xecd6138a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11480.110", 0x20000, 0x64ad66c5, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "mpr-11473.66", 0x20000, 0x0538c6ec, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11474.74", 0x20000, 0xeb923c50, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11481.62", 0x20000, 0x78e652b6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11482.70", 0x20000, 0x2f879766, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11475.85", 0x20000, 0x69cfec89, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11476.113", 0x20000, 0xa60b9b79, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11483.81", 0x20000, 0xd5d3a505, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11484.109", 0x20000, 0xb8a56a50, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11696.65", 0x20000, 0x99e8e49e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11697.73", 0x20000, 0x7545c52e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11700.61", 0x20000, 0xe13839c1, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11701.69", 0x20000, 0x9fb3d365, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11698.84", 0x20000, 0xcfeba3e2, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11699.112", 0x20000, 0x4a00534a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11702.80", 0x20000, 0x2a09c627, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11703.108", 0x20000, 0x43bb7d9f, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11524.64", 0x20000, 0x5d35849f, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11525.72", 0x20000, 0x9ae47552, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11532.60", 0x20000, 0xb3565ddb, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11533.68", 0x20000, 0xf5d16e8a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11526.83", 0x20000, 0x094cb3f0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11527.111", 0x20000, 0xe821a144, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11534.79", 0x20000, 0xb7f0ad7c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11535.107", 0x20000, 0x95da7a46, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11693.102", 0x10000, 0x0497785c, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11465.107", 0x80000, 0xe1436dab, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11516.106", 0x20000, 0x19d0e17f, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11814.105", 0x20000, 0x0b05d376, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Gforce2) -STD_ROM_FN(Gforce2) - -static struct BurnRomInfo Gforce2sdRomDesc[] = { - { "epr-11688.25", 0x20000, 0xc845f2df, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11687.24", 0x20000, 0x1cbefbbf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11875.81", 0x20000, 0xc81701c6, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11874.80", 0x20000, 0x5301fd79, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11816b.54", 0x20000, 0x317dd0c2, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-11815b.53", 0x20000, 0xf1fb22f1, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "mpr-11468.14", 0x20000, 0x74ca9ca5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11467.16", 0x20000, 0x6e60e736, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11695.15", 0x20000, 0x38a864be, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11694.17", 0x20000, 0x7e297b84, SYS16_ROM_SPRITES | BRF_GRA }, - - { "mpr-11469.67", 0x20000, 0xed7a2299, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11470.75", 0x20000, 0x34dea550, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11477.63", 0x20000, 0xa2784653, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11478.71", 0x20000, 0x8b778993, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11471.86", 0x20000, 0xf1974069, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11472.114", 0x20000, 0x0d24409a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11479.82", 0x20000, 0xecd6138a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11480.110", 0x20000, 0x64ad66c5, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "mpr-11473.66", 0x20000, 0x0538c6ec, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11474.74", 0x20000, 0xeb923c50, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11481.62", 0x20000, 0x78e652b6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11482.70", 0x20000, 0x2f879766, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11475.85", 0x20000, 0x69cfec89, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11476.113", 0x20000, 0xa60b9b79, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11483.81", 0x20000, 0xd5d3a505, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11484.109", 0x20000, 0xb8a56a50, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11696.65", 0x20000, 0x99e8e49e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11697.73", 0x20000, 0x7545c52e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11700.61", 0x20000, 0xe13839c1, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11701.69", 0x20000, 0x9fb3d365, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11698.84", 0x20000, 0xcfeba3e2, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11699.112", 0x20000, 0x4a00534a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11702.80", 0x20000, 0x2a09c627, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11703.108", 0x20000, 0x43bb7d9f, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11524.64", 0x20000, 0x5d35849f, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11525.72", 0x20000, 0x9ae47552, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11532.60", 0x20000, 0xb3565ddb, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11533.68", 0x20000, 0xf5d16e8a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11526.83", 0x20000, 0x094cb3f0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11527.111", 0x20000, 0xe821a144, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11534.79", 0x20000, 0xb7f0ad7c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11535.107", 0x20000, 0x95da7a46, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11693.102", 0x10000, 0x0497785c, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11465.107", 0x80000, 0xe1436dab, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11516.106", 0x20000, 0x19d0e17f, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11814.105", 0x20000, 0x0b05d376, SYS16_ROM_PCMDATA | BRF_SND }, - - { "motorpcb.prg", 0x08000, 0xfecee31e, BRF_OPT }, -}; - - -STD_ROM_PICK(Gforce2sd) -STD_ROM_FN(Gforce2sd) - -static struct BurnRomInfo Gforce2jRomDesc[] = { - { "epr-11511.25", 0x20000, 0xd80a86d6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11510.24", 0x20000, 0xd2b1bef4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11515.81", 0x20000, 0xd85875cf, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11514.80", 0x20000, 0x3dcc6919, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11513.54", 0x20000, 0xe18bc177, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-11512.53", 0x20000, 0x6010e63e, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "mpr-11468.14", 0x20000, 0x74ca9ca5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11467.16", 0x20000, 0x6e60e736, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11695.15", 0x20000, 0x38a864be, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11694.17", 0x20000, 0x7e297b84, SYS16_ROM_SPRITES | BRF_GRA }, - - { "mpr-11469.67", 0x20000, 0xed7a2299, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11470.75", 0x20000, 0x34dea550, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11477.63", 0x20000, 0xa2784653, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11478.71", 0x20000, 0x8b778993, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11471.86", 0x20000, 0xf1974069, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11472.114", 0x20000, 0x0d24409a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11479.82", 0x20000, 0xecd6138a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11480.110", 0x20000, 0x64ad66c5, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "mpr-11473.66", 0x20000, 0x0538c6ec, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11474.74", 0x20000, 0xeb923c50, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11481.62", 0x20000, 0x78e652b6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11482.70", 0x20000, 0x2f879766, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11475.85", 0x20000, 0x69cfec89, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11476.113", 0x20000, 0xa60b9b79, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11483.81", 0x20000, 0xd5d3a505, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11484.109", 0x20000, 0xb8a56a50, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11696.65", 0x20000, 0x99e8e49e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11697.73", 0x20000, 0x7545c52e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11700.61", 0x20000, 0xe13839c1, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11701.69", 0x20000, 0x9fb3d365, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11698.84", 0x20000, 0xcfeba3e2, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11699.112", 0x20000, 0x4a00534a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11702.80", 0x20000, 0x2a09c627, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11703.108", 0x20000, 0x43bb7d9f, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11524.64", 0x20000, 0x5d35849f, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11525.72", 0x20000, 0x9ae47552, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11532.60", 0x20000, 0xb3565ddb, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11533.68", 0x20000, 0xf5d16e8a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11526.83", 0x20000, 0x094cb3f0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11527.111", 0x20000, 0xe821a144, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11534.79", 0x20000, 0xb7f0ad7c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11535.107", 0x20000, 0x95da7a46, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11693.102", 0x10000, 0x0497785c, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11465.107", 0x80000, 0xe1436dab, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11516.106", 0x20000, 0x19d0e17f, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11814.105", 0x20000, 0x0b05d376, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Gforce2j) -STD_ROM_FN(Gforce2j) - -static struct BurnRomInfo Gforce2jaRomDesc[] = { - { "epr-11688.25", 0x20000, 0xc845f2df, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11687.24", 0x20000, 0x1cbefbbf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11875.81", 0x20000, 0xc81701c6, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11874.80", 0x20000, 0x5301fd79, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11690a.54", 0x20000, 0xe18bc177, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-11689a.53", 0x20000, 0x6010e63e, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "mpr-11468.14", 0x20000, 0x74ca9ca5, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-11467.16", 0x20000, 0x6e60e736, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11695.15", 0x20000, 0x38a864be, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11694.17", 0x20000, 0x7e297b84, SYS16_ROM_SPRITES | BRF_GRA }, - - { "mpr-11469.67", 0x20000, 0xed7a2299, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11470.75", 0x20000, 0x34dea550, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11477.63", 0x20000, 0xa2784653, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11478.71", 0x20000, 0x8b778993, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11471.86", 0x20000, 0xf1974069, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11472.114", 0x20000, 0x0d24409a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11479.82", 0x20000, 0xecd6138a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11480.110", 0x20000, 0x64ad66c5, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "mpr-11473.66", 0x20000, 0x0538c6ec, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11474.74", 0x20000, 0xeb923c50, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11481.62", 0x20000, 0x78e652b6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11482.70", 0x20000, 0x2f879766, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11475.85", 0x20000, 0x69cfec89, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11476.113", 0x20000, 0xa60b9b79, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11483.81", 0x20000, 0xd5d3a505, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-11484.109", 0x20000, 0xb8a56a50, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11696.65", 0x20000, 0x99e8e49e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11697.73", 0x20000, 0x7545c52e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11700.61", 0x20000, 0xe13839c1, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11701.69", 0x20000, 0x9fb3d365, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11698.84", 0x20000, 0xcfeba3e2, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11699.112", 0x20000, 0x4a00534a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11702.80", 0x20000, 0x2a09c627, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11703.108", 0x20000, 0x43bb7d9f, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11524.64", 0x20000, 0x5d35849f, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11525.72", 0x20000, 0x9ae47552, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11532.60", 0x20000, 0xb3565ddb, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11533.68", 0x20000, 0xf5d16e8a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11526.83", 0x20000, 0x094cb3f0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11527.111", 0x20000, 0xe821a144, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11534.79", 0x20000, 0xb7f0ad7c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11535.107", 0x20000, 0x95da7a46, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11693.102", 0x10000, 0x0497785c, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11465.107", 0x80000, 0xe1436dab, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11516.106", 0x20000, 0x19d0e17f, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11814.105", 0x20000, 0x0b05d376, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Gforce2ja) -STD_ROM_FN(Gforce2ja) - -static struct BurnRomInfo GlocRomDesc[] = { - { "epr-13172.25", 0x20000, 0x75e7174c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13171.24", 0x20000, 0x90733468, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13028.27", 0x20000, 0xb6aa2edf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13027.26", 0x20000, 0x6463c87a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13032.81", 0x20000, 0x7da09c4e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13031.80", 0x20000, 0xf3c7e3f4, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13030.54", 0x20000, 0x81abcabf, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-13029.53", 0x20000, 0xf3638efb, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-13037.14", 0x80000, 0xb801a250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13039.16", 0x80000, 0xd7e1266d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13038.15", 0x80000, 0x0b2edb6d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13040.17", 0x80000, 0x4aeb3a85, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13048.67", 0x80000, 0xfe1eb0dd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13056.75", 0x80000, 0x5904f8e6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13044.63", 0x80000, 0x4d931f89, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13052.71", 0x80000, 0x0291f040, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13064.86", 0x80000, 0x5f8e651b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13072.114", 0x80000, 0x6b85641a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13060.82", 0x80000, 0xee16ad97, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13068.110", 0x80000, 0x64d52bbb, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13047.66", 0x80000, 0x53340832, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13055.74", 0x80000, 0x39b6b665, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13043.62", 0x80000, 0x208f16fd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13051.70", 0x80000, 0xad62cbd4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13063.85", 0x80000, 0xc580bf6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13071.113", 0x80000, 0xdf99ef99, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13059.81", 0x80000, 0x4c982558, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13067.109", 0x80000, 0xf97f6119, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13046.65", 0x80000, 0xc75a86e9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13054.73", 0x80000, 0x2934549a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13042.61", 0x80000, 0x53ed97af, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13050.69", 0x80000, 0x04429068, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13062.84", 0x80000, 0x4fdb4ee3, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13070.112", 0x80000, 0x52ea130e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13058.80", 0x80000, 0x19ff1626, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13066.108", 0x80000, 0xbc70a250, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13045.64", 0x80000, 0x54d5bc6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13053.72", 0x80000, 0x9502af13, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13041.60", 0x80000, 0xd0a7402c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13049.68", 0x80000, 0x5b9c0b6c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13061.83", 0x80000, 0x7b95ec3b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13069.111", 0x80000, 0xe1f538f0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13057.79", 0x80000, 0x73baefee, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13065.107", 0x80000, 0x8937a655, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13033.102", 0x10000, 0x6df5e827, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13036.107", 0x80000, 0x7890c26c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13035.106", 0x80000, 0x009fa13e, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13034.105", 0x80000, 0xcd22d95d, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Gloc) -STD_ROM_FN(Gloc) - -static struct BurnRomInfo GlocuRomDesc[] = { - { "epr-13170.25", 0x20000, 0x45189229, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13169.24", 0x20000, 0x1b47cd6e, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13028.27", 0x20000, 0xb6aa2edf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13027.26", 0x20000, 0x6463c87a, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13032.81", 0x20000, 0x7da09c4e, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13031.80", 0x20000, 0xf3c7e3f4, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13030.54", 0x20000, 0x81abcabf, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-13029.53", 0x20000, 0xf3638efb, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-13037.14", 0x80000, 0xb801a250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13039.16", 0x80000, 0xd7e1266d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13038.15", 0x80000, 0x0b2edb6d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13040.17", 0x80000, 0x4aeb3a85, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13048.67", 0x80000, 0xfe1eb0dd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13056.75", 0x80000, 0x5904f8e6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13044.63", 0x80000, 0x4d931f89, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13052.71", 0x80000, 0x0291f040, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13064.86", 0x80000, 0x5f8e651b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13072.114", 0x80000, 0x6b85641a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13060.82", 0x80000, 0xee16ad97, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13068.110", 0x80000, 0x64d52bbb, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13047.66", 0x80000, 0x53340832, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13055.74", 0x80000, 0x39b6b665, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13043.62", 0x80000, 0x208f16fd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13051.70", 0x80000, 0xad62cbd4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13063.85", 0x80000, 0xc580bf6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13071.113", 0x80000, 0xdf99ef99, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13059.81", 0x80000, 0x4c982558, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13067.109", 0x80000, 0xf97f6119, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13046.65", 0x80000, 0xc75a86e9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13054.73", 0x80000, 0x2934549a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13042.61", 0x80000, 0x53ed97af, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13050.69", 0x80000, 0x04429068, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13062.84", 0x80000, 0x4fdb4ee3, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13070.112", 0x80000, 0x52ea130e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13058.80", 0x80000, 0x19ff1626, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13066.108", 0x80000, 0xbc70a250, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13045.64", 0x80000, 0x54d5bc6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13053.72", 0x80000, 0x9502af13, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13041.60", 0x80000, 0xd0a7402c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13049.68", 0x80000, 0x5b9c0b6c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13061.83", 0x80000, 0x7b95ec3b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13069.111", 0x80000, 0xe1f538f0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13057.79", 0x80000, 0x73baefee, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13065.107", 0x80000, 0x8937a655, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13033.102", 0x10000, 0x6df5e827, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13036.107", 0x80000, 0x7890c26c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13035.106", 0x80000, 0x009fa13e, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13034.105", 0x80000, 0xcd22d95d, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Glocu) -STD_ROM_FN(Glocu) - -static struct BurnRomInfo Glocr360RomDesc[] = { - { "epr-13623.25", 0x20000, 0x58ad10e7, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13622.24", 0x20000, 0xc4e68dbf, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13323a.27", 0x20000, 0x02e24a33, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13322a.26", 0x20000, 0x94f67740, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13327.81", 0x20000, 0x627036f9, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13326.80", 0x20000, 0x162ac233, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13325a.54", 0x20000, 0xaba307e5, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-13324a.53", 0x20000, 0xeb1b19e5, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-13037.14", 0x80000, 0xb801a250, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13039.16", 0x80000, 0xd7e1266d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13038.15", 0x80000, 0x0b2edb6d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13040.17", 0x80000, 0x4aeb3a85, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13048.67", 0x80000, 0xfe1eb0dd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13056.75", 0x80000, 0x5904f8e6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13044.63", 0x80000, 0x4d931f89, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13052.71", 0x80000, 0x0291f040, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13064.86", 0x80000, 0x5f8e651b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13072.114", 0x80000, 0x6b85641a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13060.82", 0x80000, 0xee16ad97, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13068.110", 0x80000, 0x64d52bbb, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13047.66", 0x80000, 0x53340832, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13055.74", 0x80000, 0x39b6b665, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13043.62", 0x80000, 0x208f16fd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13051.70", 0x80000, 0xad62cbd4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13063.85", 0x80000, 0xc580bf6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13071.113", 0x80000, 0xdf99ef99, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13059.81", 0x80000, 0x4c982558, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13067.109", 0x80000, 0xf97f6119, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13331.65", 0x80000, 0x8ea8febe, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13333.73", 0x80000, 0x5bcd37d4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13330.61", 0x80000, 0x1e325d52, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13332.69", 0x80000, 0x8fd8067e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13335.84", 0x80000, 0x98ea420b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13337.112", 0x80000, 0xf55f00a4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13334.80", 0x80000, 0x72725060, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13336.108", 0x80000, 0xe2d4d477, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13045.64", 0x80000, 0x54d5bc6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13053.72", 0x80000, 0x9502af13, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13041.60", 0x80000, 0xd0a7402c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13049.68", 0x80000, 0x5b9c0b6c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13061.83", 0x80000, 0x7b95ec3b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13069.111", 0x80000, 0xe1f538f0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13057.79", 0x80000, 0x73baefee, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13065.107", 0x80000, 0x8937a655, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13624.102", 0x10000, 0xeff33f2d, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "epr-13036.107", 0x80000, 0x7890c26c, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13035.106", 0x80000, 0x009fa13e, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-13625.105", 0x80000, 0xfae71fd2, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Glocr360) -STD_ROM_FN(Glocr360) - -static struct BurnRomInfo PdriftRomDesc[] = { - { "epr-12017.25", 0x20000, 0x31190322, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12016.24", 0x20000, 0x499f64a6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11748.27", 0x20000, 0x82a76cab, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11747.26", 0x20000, 0x9796ece5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11905.81", 0x20000, 0x1cf68109, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11904.80", 0x20000, 0xbb993681, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12019a.54", 0x20000, 0x11188a30, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-12018a.53", 0x20000, 0x1c582e1f, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-11791.14", 0x20000, 0x36b2910a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11789.16", 0x20000, 0xb86f8d2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11792.15", 0x20000, 0xc85caf6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11790.17", 0x20000, 0x2a564e66, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11757.67", 0x20000, 0xe46dc478, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11758.75", 0x20000, 0x5b435c87, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11773.63", 0x20000, 0x1b5d5758, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11774.71", 0x20000, 0x2ca0c170, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11759.86", 0x20000, 0xac8111f6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11760.114", 0x20000, 0x91282af9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11775.82", 0x20000, 0x48225793, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11776.110", 0x20000, 0x78c46198, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11761.66", 0x20000, 0xbaa5d065, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11762.74", 0x20000, 0x1d1af7a5, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11777.62", 0x20000, 0x9662dd32, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11778.70", 0x20000, 0x2dfb7494, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11763.85", 0x20000, 0x1ee23407, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11764.113", 0x20000, 0xe859305e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11779.81", 0x20000, 0xa49cd793, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11780.109", 0x20000, 0xd514ed81, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11765.65", 0x20000, 0x649e2dff, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11766.73", 0x20000, 0xd92fb7fc, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11781.61", 0x20000, 0x9692d4cd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11782.69", 0x20000, 0xc913bb43, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11767.84", 0x20000, 0x1f8ad054, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11768.112", 0x20000, 0xdb2c4053, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11783.80", 0x20000, 0x6d189007, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11784.108", 0x20000, 0x57f5fd64, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11769.64", 0x20000, 0x28f0ab51, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11770.72", 0x20000, 0xd7557ea9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11785.60", 0x20000, 0xe6ef32c4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11786.68", 0x20000, 0x2066b49d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11771.83", 0x20000, 0x67635618, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11772.111", 0x20000, 0x0f798d3a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11787.79", 0x20000, 0xe631dc12, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11788.107", 0x20000, 0x8464c66e, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11899.102", 0x10000, 0xed9fa889, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11754.107", 0x80000, 0xebeb8484, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11756.105", 0x20000, 0x12e43f8a, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11755.106", 0x20000, 0xc2db1244, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-11895.ic1", 0x20000, 0xee99a6fd, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11896.ic2", 0x20000, 0x4bebc015, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11897.ic3", 0x20000, 0x4463cb95, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11898.ic4", 0x20000, 0x5d19d767, SYS16_ROM_PROM | BRF_OPT }, -}; - - -STD_ROM_PICK(Pdrift) -STD_ROM_FN(Pdrift) - -static struct BurnRomInfo PdriftaRomDesc[] = { - { "epr-12017.25", 0x20000, 0x31190322, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-12016.24", 0x20000, 0x499f64a6, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11748.27", 0x20000, 0x82a76cab, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11747.26", 0x20000, 0x9796ece5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11905.81", 0x20000, 0x1cf68109, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11904.80", 0x20000, 0xbb993681, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-12019.54", 0x20000, 0xe514d7b6, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-12018.53", 0x20000, 0x0a3f7faf, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-11791.14", 0x20000, 0x36b2910a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11789.16", 0x20000, 0xb86f8d2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11792.15", 0x20000, 0xc85caf6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11790.17", 0x20000, 0x2a564e66, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11757.67", 0x20000, 0xe46dc478, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11758.75", 0x20000, 0x5b435c87, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11773.63", 0x20000, 0x1b5d5758, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11774.71", 0x20000, 0x2ca0c170, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11759.86", 0x20000, 0xac8111f6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11760.114", 0x20000, 0x91282af9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11775.82", 0x20000, 0x48225793, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11776.110", 0x20000, 0x78c46198, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11761.66", 0x20000, 0xbaa5d065, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11762.74", 0x20000, 0x1d1af7a5, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11777.62", 0x20000, 0x9662dd32, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11778.70", 0x20000, 0x2dfb7494, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11763.85", 0x20000, 0x1ee23407, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11764.113", 0x20000, 0xe859305e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11779.81", 0x20000, 0xa49cd793, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11780.109", 0x20000, 0xd514ed81, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11765.65", 0x20000, 0x649e2dff, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11766.73", 0x20000, 0xd92fb7fc, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11781.61", 0x20000, 0x9692d4cd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11782.69", 0x20000, 0xc913bb43, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11767.84", 0x20000, 0x1f8ad054, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11768.112", 0x20000, 0xdb2c4053, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11783.80", 0x20000, 0x6d189007, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11784.108", 0x20000, 0x57f5fd64, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11769.64", 0x20000, 0x28f0ab51, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11770.72", 0x20000, 0xd7557ea9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11785.60", 0x20000, 0xe6ef32c4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11786.68", 0x20000, 0x2066b49d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11771.83", 0x20000, 0x67635618, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11772.111", 0x20000, 0x0f798d3a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11787.79", 0x20000, 0xe631dc12, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11788.107", 0x20000, 0x8464c66e, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11899.102", 0x10000, 0xed9fa889, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11754.107", 0x80000, 0xebeb8484, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11756.105", 0x20000, 0x12e43f8a, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11755.106", 0x20000, 0xc2db1244, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-11895.ic1", 0x20000, 0xee99a6fd, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11896.ic2", 0x20000, 0x4bebc015, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11897.ic3", 0x20000, 0x4463cb95, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11898.ic4", 0x20000, 0x5d19d767, SYS16_ROM_PROM | BRF_OPT }, -}; - - -STD_ROM_PICK(Pdrifta) -STD_ROM_FN(Pdrifta) - -static struct BurnRomInfo PdrifteRomDesc[] = { - { "epr-11901.25", 0x20000, 0x16744be8, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11900.24", 0x20000, 0x0a170d06, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11748.27", 0x20000, 0x82a76cab, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11747.26", 0x20000, 0x9796ece5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11905.81", 0x20000, 0x1cf68109, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11904.80", 0x20000, 0xbb993681, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11903.54", 0x20000, 0xd004f411, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-11902.53", 0x20000, 0xe8028e08, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-11791.14", 0x20000, 0x36b2910a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11789.16", 0x20000, 0xb86f8d2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11792.15", 0x20000, 0xc85caf6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11790.17", 0x20000, 0x2a564e66, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11757.67", 0x20000, 0xe46dc478, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11758.75", 0x20000, 0x5b435c87, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11773.63", 0x20000, 0x1b5d5758, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11774.71", 0x20000, 0x2ca0c170, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11759.86", 0x20000, 0xac8111f6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11760.114", 0x20000, 0x91282af9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11775.82", 0x20000, 0x48225793, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11776.110", 0x20000, 0x78c46198, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11761.66", 0x20000, 0xbaa5d065, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11762.74", 0x20000, 0x1d1af7a5, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11777.62", 0x20000, 0x9662dd32, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11778.70", 0x20000, 0x2dfb7494, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11763.85", 0x20000, 0x1ee23407, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11764.113", 0x20000, 0xe859305e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11779.81", 0x20000, 0xa49cd793, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11780.109", 0x20000, 0xd514ed81, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11765.65", 0x20000, 0x649e2dff, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11766.73", 0x20000, 0xd92fb7fc, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11781.61", 0x20000, 0x9692d4cd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11782.69", 0x20000, 0xc913bb43, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11767.84", 0x20000, 0x1f8ad054, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11768.112", 0x20000, 0xdb2c4053, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11783.80", 0x20000, 0x6d189007, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11784.108", 0x20000, 0x57f5fd64, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11769.64", 0x20000, 0x28f0ab51, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11770.72", 0x20000, 0xd7557ea9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11785.60", 0x20000, 0xe6ef32c4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11786.68", 0x20000, 0x2066b49d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11771.83", 0x20000, 0x67635618, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11772.111", 0x20000, 0x0f798d3a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11787.79", 0x20000, 0xe631dc12, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11788.107", 0x20000, 0x8464c66e, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11899.102", 0x10000, 0xed9fa889, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11754.107", 0x80000, 0xebeb8484, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11756.105", 0x20000, 0x12e43f8a, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11755.106", 0x20000, 0xc2db1244, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-11895.ic1", 0x20000, 0xee99a6fd, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11896.ic2", 0x20000, 0x4bebc015, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11897.ic3", 0x20000, 0x4463cb95, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11898.ic4", 0x20000, 0x5d19d767, SYS16_ROM_PROM | BRF_OPT }, -}; - - -STD_ROM_PICK(Pdrifte) -STD_ROM_FN(Pdrifte) - -static struct BurnRomInfo PdriftjRomDesc[] = { - { "epr-11746a.25", 0x20000, 0xb0f1caf4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11745a.24", 0x20000, 0xa89720cd, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11748.27", 0x20000, 0x82a76cab, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-11747.26", 0x20000, 0x9796ece5, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-11752.81", 0x20000, 0xb6bb8111, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-11751.80", 0x20000, 0x7f0d0311, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-11750b.54", 0x20000, 0xbc14ce30, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-11749b.53", 0x20000, 0x9e385568, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-11791.14", 0x20000, 0x36b2910a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11789.16", 0x20000, 0xb86f8d2b, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11792.15", 0x20000, 0xc85caf6e, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-11790.17", 0x20000, 0x2a564e66, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-11757.67", 0x20000, 0xe46dc478, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11758.75", 0x20000, 0x5b435c87, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11773.63", 0x20000, 0x1b5d5758, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11774.71", 0x20000, 0x2ca0c170, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11759.86", 0x20000, 0xac8111f6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11760.114", 0x20000, 0x91282af9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11775.82", 0x20000, 0x48225793, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11776.110", 0x20000, 0x78c46198, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11761.66", 0x20000, 0xbaa5d065, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11762.74", 0x20000, 0x1d1af7a5, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11777.62", 0x20000, 0x9662dd32, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11778.70", 0x20000, 0x2dfb7494, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11763.85", 0x20000, 0x1ee23407, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11764.113", 0x20000, 0xe859305e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11779.81", 0x20000, 0xa49cd793, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11780.109", 0x20000, 0xd514ed81, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11765.65", 0x20000, 0x649e2dff, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11766.73", 0x20000, 0xd92fb7fc, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11781.61", 0x20000, 0x9692d4cd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11782.69", 0x20000, 0xc913bb43, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11767.84", 0x20000, 0x1f8ad054, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11768.112", 0x20000, 0xdb2c4053, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11783.80", 0x20000, 0x6d189007, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11784.108", 0x20000, 0x57f5fd64, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11769.64", 0x20000, 0x28f0ab51, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11770.72", 0x20000, 0xd7557ea9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11785.60", 0x20000, 0xe6ef32c4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11786.68", 0x20000, 0x2066b49d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11771.83", 0x20000, 0x67635618, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11772.111", 0x20000, 0x0f798d3a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11787.79", 0x20000, 0xe631dc12, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-11788.107", 0x20000, 0x8464c66e, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-11899.102", 0x10000, 0xed9fa889, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-11754.107", 0x80000, 0xebeb8484, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11756.105", 0x20000, 0x12e43f8a, SYS16_ROM_PCMDATA | BRF_SND }, - { "epr-11755.106", 0x20000, 0xc2db1244, SYS16_ROM_PCMDATA | BRF_SND }, - - { "epr-11895.ic1", 0x20000, 0xee99a6fd, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11896.ic2", 0x20000, 0x4bebc015, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11897.ic3", 0x20000, 0x4463cb95, SYS16_ROM_PROM | BRF_OPT }, - { "epr-11898.ic4", 0x20000, 0x5d19d767, SYS16_ROM_PROM | BRF_OPT }, -}; - - -STD_ROM_PICK(Pdriftj) -STD_ROM_FN(Pdriftj) - -static struct BurnRomInfo RchaseRomDesc[] = { - { "epr-13986.25", 0x20000, 0x388b2365, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13985.24", 0x20000, 0x14dba5d4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13988.27", 0x20000, 0xdc1cd5a4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13987.26", 0x20000, 0x43be9e60, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13992a.81", 0x20000, 0xc5d525b6, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13991a.80", 0x20000, 0x299e3c7c, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-14092.54", 0x20000, 0x18eb23c5, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, // same as epr-13990.54 belown - { "epr-14091.53", 0x20000, 0x72a56f71, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, // 1 byte difference between regions - - { "mpr-13997.14", 0x40000, 0x1fdf1b87, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13999.16", 0x40000, 0x9a1dd53c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "mpr-14021.67", 0x80000, 0x9fa88781, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14022.75", 0x80000, 0x49e824bb, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14009.63", 0x80000, 0x35b5187e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14010.71", 0x80000, 0x9a538b9b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14023.86", 0x80000, 0xe11c6c67, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14024.114", 0x80000, 0x16344535, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14011.82", 0x80000, 0x78e9983b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14012.110", 0x80000, 0xe9daa1a4, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "mpr-14017.66", 0x80000, 0xb83df159, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14018.74", 0x80000, 0x76dbe9ce, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14005.62", 0x80000, 0x9e998209, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14006.70", 0x80000, 0x2caddf1a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14019.85", 0x80000, 0xb15e19ff, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14020.113", 0x80000, 0x84c7008f, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14007.81", 0x80000, 0xc3cf5faa, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14008.109", 0x80000, 0x7e91beb2, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "mpr-14013.65", 0x80000, 0x31dbb2c3, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14014.73", 0x80000, 0x7e68257d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14001.61", 0x80000, 0x71031ad0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14002.69", 0x80000, 0x27e70a5e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14015.84", 0x80000, 0x7540bf85, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14016.112", 0x80000, 0x7d87b94d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14003.80", 0x80000, 0x87725d74, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14004.108", 0x80000, 0x73477291, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13993.102", 0x10000, 0x7cc3b543, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13996.107", 0x80000, 0x345f5a41, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-13995.106", 0x80000, 0xf604c270, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-13994.105", 0x80000, 0x76095538, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Rchase) -STD_ROM_FN(Rchase) - -static struct BurnRomInfo RchasejRomDesc[] = { - { "epr-13986.25", 0x20000, 0x388b2365, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13985.24", 0x20000, 0x14dba5d4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13988.27", 0x20000, 0xdc1cd5a4, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13987.26", 0x20000, 0x43be9e60, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13992a.81", 0x20000, 0xc5d525b6, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13991a.80", 0x20000, 0x299e3c7c, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13990.54", 0x20000, 0x18eb23c5, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-13989.53", 0x20000, 0x8f4f824e, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "mpr-13997.14", 0x40000, 0x1fdf1b87, SYS16_ROM_SPRITES | BRF_GRA }, - { "mpr-13999.16", 0x40000, 0x9a1dd53c, SYS16_ROM_SPRITES | BRF_GRA }, - - { "mpr-14021.67", 0x80000, 0x9fa88781, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14022.75", 0x80000, 0x49e824bb, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14009.63", 0x80000, 0x35b5187e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14010.71", 0x80000, 0x9a538b9b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14023.86", 0x80000, 0xe11c6c67, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14024.114", 0x80000, 0x16344535, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14011.82", 0x80000, 0x78e9983b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14012.110", 0x80000, 0xe9daa1a4, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "mpr-14017.66", 0x80000, 0xb83df159, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14018.74", 0x80000, 0x76dbe9ce, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14005.62", 0x80000, 0x9e998209, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14006.70", 0x80000, 0x2caddf1a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14019.85", 0x80000, 0xb15e19ff, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14020.113", 0x80000, 0x84c7008f, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14007.81", 0x80000, 0xc3cf5faa, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14008.109", 0x80000, 0x7e91beb2, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "mpr-14013.65", 0x80000, 0x31dbb2c3, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14014.73", 0x80000, 0x7e68257d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14001.61", 0x80000, 0x71031ad0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14002.69", 0x80000, 0x27e70a5e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14015.84", 0x80000, 0x7540bf85, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14016.112", 0x80000, 0x7d87b94d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14003.80", 0x80000, 0x87725d74, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "mpr-14004.108", 0x80000, 0x73477291, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13993.102", 0x10000, 0x7cc3b543, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13996.107", 0x80000, 0x345f5a41, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-13995.106", 0x80000, 0xf604c270, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-13994.105", 0x80000, 0x76095538, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Rchasej) -STD_ROM_FN(Rchasej) - -static struct BurnRomInfo StrkfgtrRomDesc[] = { - { "epr-13889.25", 0x20000, 0xf4173114, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13888.24", 0x20000, 0x65e2b226, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13826.27", 0x20000, 0x3d34ea55, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13825.26", 0x20000, 0xfe218d83, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13830.81", 0x20000, 0xf9adc9d1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13829.80", 0x20000, 0xc5cd85dd, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13828.54", 0x20000, 0x2470cf5f, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-13827.53", 0x20000, 0xa9d0cf7d, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-13832.14", 0x80000, 0x41679754, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13833.16", 0x80000, 0x6148e11a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13038.15", 0x80000, 0x0b2edb6d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13040.17", 0x80000, 0x4aeb3a85, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13048.67", 0x80000, 0xfe1eb0dd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13056.75", 0x80000, 0x5904f8e6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13044.63", 0x80000, 0x4d931f89, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13052.71", 0x80000, 0x0291f040, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13064.86", 0x80000, 0x5f8e651b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13072.114", 0x80000, 0x6b85641a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13060.82", 0x80000, 0xee16ad97, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13068.110", 0x80000, 0x64d52bbb, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13047.66", 0x80000, 0x53340832, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13055.74", 0x80000, 0x39b6b665, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13043.62", 0x80000, 0x208f16fd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13051.70", 0x80000, 0xad62cbd4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13063.85", 0x80000, 0xc580bf6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13071.113", 0x80000, 0xdf99ef99, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13059.81", 0x80000, 0x4c982558, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13067.109", 0x80000, 0xf97f6119, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13046.65", 0x80000, 0xc75a86e9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13054.73", 0x80000, 0x2934549a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13042.61", 0x80000, 0x53ed97af, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13050.69", 0x80000, 0x04429068, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13062.84", 0x80000, 0x4fdb4ee3, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13070.112", 0x80000, 0x52ea130e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13058.80", 0x80000, 0x19ff1626, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13066.108", 0x80000, 0xbc70a250, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13045.64", 0x80000, 0x54d5bc6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13053.72", 0x80000, 0x9502af13, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13041.60", 0x80000, 0xd0a7402c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13049.68", 0x80000, 0x5b9c0b6c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13061.83", 0x80000, 0x7b95ec3b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13069.111", 0x80000, 0xe1f538f0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13057.79", 0x80000, 0x73baefee, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13065.107", 0x80000, 0x8937a655, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13831.102", 0x10000, 0xdabbcea1, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13036.107", 0x80000, 0x7890c26c, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-13035.106", 0x80000, 0x009fa13e, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-13034.105", 0x80000, 0xcd22d95d, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Strkfgtr) -STD_ROM_FN(Strkfgtr) - -static struct BurnRomInfo StrkfgtrjRomDesc[] = { - { "epr-13824.25", 0x20000, 0x2cf2610c, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13823.24", 0x20000, 0x2c98242f, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13826.27", 0x20000, 0x3d34ea55, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - { "epr-13825.26", 0x20000, 0xfe218d83, SYS16_ROM_PROG | BRF_ESS | BRF_PRG }, - - { "epr-13830.81", 0x20000, 0xf9adc9d1, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - { "epr-13829.80", 0x20000, 0xc5cd85dd, SYS16_ROM_PROG2 | BRF_ESS | BRF_PRG }, - - { "epr-13828.54", 0x20000, 0x2470cf5f, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - { "epr-13827.53", 0x20000, 0xa9d0cf7d, SYS16_ROM_PROG3 | BRF_ESS | BRF_PRG }, - - { "epr-13832.14", 0x80000, 0x41679754, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13833.16", 0x80000, 0x6148e11a, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13038.15", 0x80000, 0x0b2edb6d, SYS16_ROM_SPRITES | BRF_GRA }, - { "epr-13040.17", 0x80000, 0x4aeb3a85, SYS16_ROM_SPRITES | BRF_GRA }, - - { "epr-13048.67", 0x80000, 0xfe1eb0dd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13056.75", 0x80000, 0x5904f8e6, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13044.63", 0x80000, 0x4d931f89, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13052.71", 0x80000, 0x0291f040, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13064.86", 0x80000, 0x5f8e651b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13072.114", 0x80000, 0x6b85641a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13060.82", 0x80000, 0xee16ad97, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13068.110", 0x80000, 0x64d52bbb, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13047.66", 0x80000, 0x53340832, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13055.74", 0x80000, 0x39b6b665, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13043.62", 0x80000, 0x208f16fd, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13051.70", 0x80000, 0xad62cbd4, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13063.85", 0x80000, 0xc580bf6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13071.113", 0x80000, 0xdf99ef99, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13059.81", 0x80000, 0x4c982558, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13067.109", 0x80000, 0xf97f6119, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13046.65", 0x80000, 0xc75a86e9, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13054.73", 0x80000, 0x2934549a, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13042.61", 0x80000, 0x53ed97af, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13050.69", 0x80000, 0x04429068, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13062.84", 0x80000, 0x4fdb4ee3, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13070.112", 0x80000, 0x52ea130e, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13058.80", 0x80000, 0x19ff1626, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13066.108", 0x80000, 0xbc70a250, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13045.64", 0x80000, 0x54d5bc6d, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13053.72", 0x80000, 0x9502af13, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13041.60", 0x80000, 0xd0a7402c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13049.68", 0x80000, 0x5b9c0b6c, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13061.83", 0x80000, 0x7b95ec3b, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13069.111", 0x80000, 0xe1f538f0, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13057.79", 0x80000, 0x73baefee, SYS16_ROM_SPRITES2 | BRF_GRA }, - { "epr-13065.107", 0x80000, 0x8937a655, SYS16_ROM_SPRITES2 | BRF_GRA }, - - { "epr-13831.102", 0x10000, 0xdabbcea1, SYS16_ROM_Z80PROG | BRF_ESS | BRF_PRG }, - - { "mpr-13036.107", 0x80000, 0x7890c26c, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-13035.106", 0x80000, 0x009fa13e, SYS16_ROM_PCMDATA | BRF_SND }, - { "mpr-13034.105", 0x80000, 0xcd22d95d, SYS16_ROM_PCMDATA | BRF_SND }, -}; - - -STD_ROM_PICK(Strkfgtrj) -STD_ROM_FN(Strkfgtrj) - -/*==================================================== -Memory Handlers -====================================================*/ - -static UINT8 misc_io_data[0x10]; -static UINT8 analog_data[4]; - -static UINT8 io_chip_r(UINT32 offset) -{ - switch (offset) { - case 0x00: - case 0x02: - case 0x03: - case 0x04: - case 0x07: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return 0xff; - } - - case 0x01: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return 0xff - System16Input[0]; - } - - case 0x05: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return System16Dip[0]; - } - - case 0x06: { - if (misc_io_data[0x1e/2] & (1 << offset)) return misc_io_data[offset]; - return System16Dip[1]; - } - - case 0x08: { - return 'S'; - } - - case 0x09: { - return 'E'; - } - - case 0x0a: { - return 'G'; - } - - case 0x0b: { - return 'A'; - } - - case 0x0c: - case 0x0e: { - return misc_io_data[0x0e]; - } - - case 0x0d: - case 0x0f: { - return misc_io_data[0x0f]; - } - } - - return 0xff; -} - -static void io_chip_w(UINT32 offset, UINT16 d) -{ - misc_io_data[offset] = d; - - switch (offset) { - case 0x04: { - System16VideoEnable = d & 0x80; - - if (d & 0x04) { - INT32 nLastCPU = nSekActive; - SekClose(); - SekOpen(2); - SekReset(); - SekClose(); - SekOpen(nLastCPU); - } - - if (d & 0x08) { - INT32 nLastCPU = nSekActive; - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(nLastCPU); - } - - if (!(d & 0x10)) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } - - return; - } - } -} - -static UINT8 analog_r(UINT32 offset) -{ - INT32 result = analog_data[offset] & 0x80; - analog_data[offset] <<= 1; - return result; -} - -static void analog_w(UINT32 offset, UINT16 /*d*/) -{ - if (offset == 3) { - if (System16ProcessAnalogControlsDo) analog_data[offset] = System16ProcessAnalogControlsDo(3 + (misc_io_data[0x08/2] & 3)); - } else { - if (System16ProcessAnalogControlsDo) analog_data[offset] = System16ProcessAnalogControlsDo(offset & 3); - } -} - -UINT16 __fastcall YBoardReadWord(UINT32 a) -{ - if (a >= 0x080000 && a <= 0x080007) { - return System16MultiplyChipRead(0, (a - 0x080000) >> 1); - } - - if (a >= 0x084000 && a <= 0x08401f) { - return System16DivideChipRead(0, (a - 0x084000) >> 1); - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Word -> 0x%06X\n"), a); -#endif - - return 0xffff; -} - -UINT8 __fastcall YBoardReadByte(UINT32 a) -{ - if (a >= 0x100000 && a <= 0x10001f) { - return io_chip_r((a - 0x100000) >> 1); - } - - if (a >= 0x100040 && a <= 0x100047) { - return analog_r((a - 0x100040) >> 1); - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -void __fastcall YBoardWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x100000 && a <= 0x10001f) { - io_chip_w((a - 0x100000) >> 1, d); - return; - } - - if (a >= 0x080000 && a <= 0x080007) { - System16MultiplyChipWrite(0, (a - 0x080000) >> 1, d); - return; - } - - if (a >= 0x084000 && a <= 0x08401f) { - System16DivideChipWrite(0, (a - 0x084000) >> 1, d); - return; - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -void __fastcall YBoardWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x100000 && a <= 0x10001f) { - io_chip_w((a - 0x100000) >> 1, d); - return; - } - - if (a >= 0x100040 && a <= 0x100047) { - analog_w((a - 0x100040) >> 1, d); - return; - } - - switch (a) { - case 0x082001: { - System16SoundLatch = d & 0xff; - ZetOpen(0); - ZetNmi(); - ZetClose(); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 Write Byte -> 0x%06X, 0x%02X\n"), a, d); -#endif -} - -UINT16 __fastcall YBoard2ReadWord(UINT32 a) -{ - if (a >= 0x080000 && a <= 0x080007) { - return System16MultiplyChipRead(1, (a - 0x080000) >> 1); - } - - if (a >= 0x084000 && a <= 0x08401f) { - return System16DivideChipRead(1, (a - 0x084000) >> 1); - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 #2 Read Word -> 0x%06X\n"), a); -#endif - - return 0xffff; -} - -void __fastcall YBoard2WriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x080000 && a <= 0x080007) { - System16MultiplyChipWrite(1, (a - 0x080000) >> 1, d); - return; - } - - if (a >= 0x084000 && a <= 0x08401f) { - System16DivideChipWrite(1, (a - 0x084000) >> 1, d); - return; - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 #2 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -UINT16 __fastcall YBoard3ReadWord(UINT32 a) -{ - if (a >= 0x080000 && a <= 0x080007) { - return System16MultiplyChipRead(2, (a - 0x080000) >> 1); - } - - if (a >= 0x084000 && a <= 0x08401f) { - return System16DivideChipRead(2, (a - 0x084000) >> 1); - } - - switch (a) { - case 0x198000: { - /* swap the halves of the rotation RAM */ - UINT32 *src = (UINT32 *)System16RotateRam; - UINT32 *dst = (UINT32 *)System16RotateRamBuff; - - for (UINT32 i = 0; i < System16RotateRamSize/4; i++) { - UINT32 temp = *src; - *src++ = *dst; - *dst++ = temp; - } - return 0xffff; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 #3 Read Word -> 0x%06X\n"), a); -#endif - - return 0xffff; -} - -UINT8 __fastcall YBoard3ReadByte(UINT32 a) -{ - if (a >= 0x084000 && a <= 0x08401f) { - return System16DivideChipRead(2, (a - 0x084000) >> 1); - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 #3 Read Byte -> 0x%06X\n"), a); -#endif - - return 0xff; -} - -void __fastcall YBoard3WriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x080000 && a <= 0x080007) { - System16MultiplyChipWrite(2, (a - 0x080000) >> 1, d); - return; - } - - if (a >= 0x084000 && a <= 0x08401f) { - System16DivideChipWrite(2, (a - 0x084000) >> 1, d); - return; - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68000 #3 Write Word -> 0x%06X, 0x%04X\n"), a, d); -#endif -} - -/*==================================================== -Driver Inits -====================================================*/ - -static UINT8 Gforce2ProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - - // Left/Right - case 0: { - - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) > 0x7f && (System16AnalogPort0 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort0 >> 4); - } - - return temp; - } - - // Up/Down - case 1: { - - // Prevent CHAR data overflow - if((System16AnalogPort1 >> 4) < 0xf82 && (System16AnalogPort1 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort1 >> 4); - } - - return temp; - } - - // Throttle - case 2: { - - // Prevent CHAR data overflow - if((System16AnalogPort2 >> 4) > 0x7f && (System16AnalogPort2 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort2 >> 4); - } - - // full throttle - if(temp == 0) { - temp = 1; - return temp; - } - - // throttle range - if(temp > 0 && temp < 128) { - return temp; - } - - // normal speed - temp = 0; - - //bprintf(0, _T("(0x80 - (System16AnalogPort1 >> 4)) int-> %d port-> %d char-> %d\n"), 0x80 - (System16AnalogPort1 >> 4), (System16AnalogPort1 >> 4), temp); - - return temp; - } - } - - return 0; -} - -static UINT8 GlocProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - - // Up/Down - case 3: { - - // Prevent CHAR data overflow - if((System16AnalogPort1 >> 4) < 0xf82 && (System16AnalogPort1 >> 4) > 0x80) { - temp = (UINT8)(0x80 - 0xf82); - } else { - temp = 0x80 - (System16AnalogPort1 >> 4); - } - - if (temp < 0x40) temp = 0x40; - if (temp > 0xc0) temp = 0xc0; - return temp; - } - - // Throttle [?] - case 4: { - temp = 0x80 + (System16AnalogPort2 >> 4); - if (temp > 0xc0) return 0xff; - if (temp < 0x40) return 0; - return 0x80; - } - - // Left/Right - case 5: { - - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) > 0x7f && (System16AnalogPort0 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort0 >> 4); - } - - if (temp < 0x20) temp = 0x20; - if (temp > 0xe0) temp = 0xe0; - return temp; - } - } - - return 0; -} - -static UINT8 Glocr360ProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - - // Moving Pitch - case 1: { - - // Prevent CHAR data overflow - if((System16AnalogPort3 >> 4) > 0x7f && (System16AnalogPort3 >> 4) <= 0x80) { - temp = 0x7f + 0x7f; - } else { - temp = 0x7f + (System16AnalogPort3 >> 4); - } - - if (temp == 0xfe) temp = 0xff; - return temp; - } - - // Moving Roll - case 2: { - - // Prevent CHAR data overflow - if((System16AnalogPort2 >> 4) > 0x7f && (System16AnalogPort2 >> 4) <= 0x80) { - temp = 0x7f + 0x7f; - } else { - temp = 0x7f + (System16AnalogPort2 >> 4); - } - - if (temp == 0xfe) temp = 0xff; - return temp; - } - - // Up/Down - case 3: { - - // Prevent CHAR data overflow - if((System16AnalogPort1 >> 4) < 0xf82 && (System16AnalogPort1 >> 4) > 0x80) { - temp = (UINT8)(0x7f - 0xf82); - } else { - temp = 0x7f - (System16AnalogPort1 >> 4); - } - - if (temp == 0xfe) temp = 0xff; - return temp; - } - - // Left/Right - case 5: { - - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) > 0x7f && (System16AnalogPort0 >> 4) <= 0x80) { - temp = 0x7f + 0x7f; - } else { - temp = 0x7f + (System16AnalogPort0 >> 4); - } - - if (temp == 0xfe) temp = 0xff; - return temp; - } - } - - return 0; -} - -static UINT8 PdriftProcessAnalogControls(UINT16 value) -{ - UINT8 temp = 0; - - switch (value) { - - // Brake - case 3: { - if (System16AnalogPort2 > 1) return 0xff; - return 0; - } - - // Accelerate - case 4: { - if (System16AnalogPort1 > 1) return 0xff; - return 0; - } - - // Steering - case 5: { - - // Prevent CHAR data overflow - if((System16AnalogPort0 >> 4) > 0x7f && (System16AnalogPort0 >> 4) <= 0x80) { - temp = 0x80 + 0x7f; - } else { - temp = 0x80 + (System16AnalogPort0 >> 4); - } - - if (temp < 0x20) temp = 0x20; - if (temp > 0xe0) temp = 0xe0; - return temp; - } - } - - return 0; -} - -static UINT8 RchaseProcessAnalogControls(UINT16 value) -{ - switch (value) { - case 0: { - return BurnGunReturnX(0); - } - - case 1: { - return BurnGunReturnY(0); - } - - case 2: { - return BurnGunReturnX(1); - } - - case 3: { - return BurnGunReturnY(1); - } - } - - return 0; -} - -static INT32 Gforce2Init() -{ - System16ProcessAnalogControlsDo = Gforce2ProcessAnalogControls; - - System16PCMDataSizePreAllocate = 0x180000; - - INT32 nRet = System16Init(); - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x0c0000); - memcpy(pTemp, System16PCMData, 0x0c0000); - memset(System16PCMData, 0, 0x180000); - memcpy(System16PCMData + 0x000000, pTemp + 0x000000, 0x80000); - memcpy(System16PCMData + 0x080000, pTemp + 0x080000, 0x20000); - memcpy(System16PCMData + 0x0a0000, pTemp + 0x080000, 0x20000); - memcpy(System16PCMData + 0x0c0000, pTemp + 0x080000, 0x20000); - memcpy(System16PCMData + 0x0e0000, pTemp + 0x080000, 0x20000); - memcpy(System16PCMData + 0x100000, pTemp + 0x0a0000, 0x20000); - memcpy(System16PCMData + 0x120000, pTemp + 0x0a0000, 0x20000); - memcpy(System16PCMData + 0x140000, pTemp + 0x0a0000, 0x20000); - memcpy(System16PCMData + 0x160000, pTemp + 0x0a0000, 0x20000); - BurnFree(pTemp); - - return nRet; -} - -static INT32 GlocInit() -{ - System16ProcessAnalogControlsDo = GlocProcessAnalogControls; - - return System16Init(); -} - -static INT32 Glocr360Init() -{ - System16ProcessAnalogControlsDo = Glocr360ProcessAnalogControls; - - return System16Init(); -} - -static INT32 PdriftInit() -{ - System16ProcessAnalogControlsDo = PdriftProcessAnalogControls; - - System16HasGears = true; - - System16PCMDataSizePreAllocate = 0x180000; - - INT32 nRet = System16Init(); - - UINT8 *pTemp = (UINT8*)BurnMalloc(0x0c0000); - memcpy(pTemp, System16PCMData, 0x0c0000); - memset(System16PCMData, 0, 0x180000); - memcpy(System16PCMData + 0x000000, pTemp + 0x000000, 0x80000); - memcpy(System16PCMData + 0x080000, pTemp + 0x080000, 0x20000); - memcpy(System16PCMData + 0x0a0000, pTemp + 0x080000, 0x20000); - memcpy(System16PCMData + 0x0c0000, pTemp + 0x080000, 0x20000); - memcpy(System16PCMData + 0x0e0000, pTemp + 0x080000, 0x20000); - memcpy(System16PCMData + 0x100000, pTemp + 0x0a0000, 0x20000); - memcpy(System16PCMData + 0x120000, pTemp + 0x0a0000, 0x20000); - memcpy(System16PCMData + 0x140000, pTemp + 0x0a0000, 0x20000); - memcpy(System16PCMData + 0x160000, pTemp + 0x0a0000, 0x20000); - BurnFree(pTemp); - - return nRet; -} - -static INT32 RchaseInit() -{ - BurnGunInit(2, false); - - System16ProcessAnalogControlsDo = RchaseProcessAnalogControls; - - return System16Init(); -} - -static INT32 YBoardExit() -{ - memset(misc_io_data, 0, sizeof(misc_io_data)); - memset(analog_data, 0, sizeof(analog_data)); - - return System16Exit(); -} - -static INT32 YBoardScan(INT32 nAction,INT32 *pnMin) -{ - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029660; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(misc_io_data); - SCAN_VAR(analog_data); - } - - return System16Scan(nAction, pnMin);; -} - -struct BurnDriver BurnDrvGforce2 = { - "gforce2", NULL, NULL, NULL, "1988", - "Galaxy Force 2\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, Gforce2RomInfo, Gforce2RomName, NULL, NULL, Gforce2InputInfo, Gforce2DIPInfo, - Gforce2Init, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGforce2sd = { - "gforce2sd", "gforce2", NULL, NULL, "1988", - "Galaxy Force 2 (Super Deluxe unit)\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, Gforce2sdRomInfo, Gforce2sdRomName, NULL, NULL, Gforce2InputInfo, Gforce2DIPInfo, - Gforce2Init, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGforce2j = { - "gforce2j", "gforce2", NULL, NULL, "1988", - "Galaxy Force 2 (Japan)\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, Gforce2jRomInfo, Gforce2jRomName, NULL, NULL, Gforce2InputInfo, Gforce2DIPInfo, - Gforce2Init, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGforce2ja = { - "gforce2ja", "gforce2", NULL, NULL, "1988", - "Galaxy Force 2 (Japan, Rev A)\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, Gforce2jaRomInfo, Gforce2jaRomName, NULL, NULL, Gforce2InputInfo, Gforce2DIPInfo, - Gforce2Init, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGloc = { - "gloc", NULL, NULL, NULL, "1990", - "G-LOC Air Battle (World)\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, GlocRomInfo, GlocRomName, NULL, NULL, GlocInputInfo, GlocDIPInfo, - GlocInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGlocu = { - "glocu", "gloc", NULL, NULL, "1990", - "G-LOC Air Battle (US)\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, GlocuRomInfo, GlocuRomName, NULL, NULL, GlocInputInfo, GlocDIPInfo, - GlocInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGlocr360 = { - "glocr360", "gloc", NULL, NULL, "1990", - "G-LOC R360\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, Glocr360RomInfo, Glocr360RomName, NULL, NULL, Glocr360InputInfo, Glocr360DIPInfo, - Glocr360Init, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPdrift = { - "pdrift", NULL, NULL, NULL, "1988", - "Power Drift (World, Rev A)\0", "Select Auto-Center preset in Input Configuration", "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMY, GBF_RACING, 0, - NULL, PdriftRomInfo, PdriftRomName, NULL, NULL, PdriftInputInfo, PdriftDIPInfo, - PdriftInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPdrifta = { - "pdrifta", "pdrift", NULL, NULL, "1988", - "Power Drift (World)\0", "Select Auto-Center preset in Input Configuration", "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_RACING, 0, - NULL, PdriftaRomInfo, PdriftaRomName, NULL, NULL, PdriftInputInfo, PdriftDIPInfo, - PdriftInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPdrifte = { - "pdrifte", "pdrift", NULL, NULL, "1988", - "Power Drift (World, Earlier)\0", "Select Auto-Center preset in Input Configuration", "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_RACING, 0, - NULL, PdrifteRomInfo, PdrifteRomName, NULL, NULL, PdriftInputInfo, PdrifteDIPInfo, - PdriftInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPdriftj = { - "pdriftj", "pdrift", NULL, NULL, "1988", - "Power Drift (Japan)\0", "Select Auto-Center preset in Input Configuration", "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_RACING, 0, - NULL, PdriftjRomInfo, PdriftjRomName, NULL, NULL, PdriftInputInfo, PdriftjDIPInfo, - PdriftInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRchase = { - "rchase", NULL, NULL, NULL, "1991", - "Rail Chase (World)\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, RchaseRomInfo, RchaseRomName, NULL, NULL, RchaseInputInfo, RchaseDIPInfo, - RchaseInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRchasej = { - "rchasej", "rchase", NULL, NULL, "1991", - "Rail Chase (Japan)\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, RchasejRomInfo, RchasejRomName, NULL, NULL, RchaseInputInfo, RchaseDIPInfo, - RchaseInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvStrkfgtr = { - "strkfgtr", NULL, NULL, NULL, "1991", - "Strike Fighter (World)\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, StrkfgtrRomInfo, StrkfgtrRomName, NULL, NULL, GlocInputInfo, StrkfgtrDIPInfo, - GlocInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvStrkfgtrj = { - "strkfgtrj", "strkfgtr", NULL, NULL, "1991", - "Strike Fighter (Japan)\0", NULL, "Sega", "Y-Board", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SYSTEMY, GBF_SHOOT, 0, - NULL, StrkfgtrjRomInfo, StrkfgtrjRomName, NULL, NULL, GlocInputInfo, StrkfgtrDIPInfo, - GlocInit, YBoardExit, YBoardFrame, NULL, YBoardScan, - NULL, 0x6000, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/sega/d_zaxxon.cpp b/jan/src/burn/drv/sega/d_zaxxon.cpp deleted file mode 100644 index dea4d0fcb..000000000 --- a/jan/src/burn/drv/sega/d_zaxxon.cpp +++ /dev/null @@ -1,2271 +0,0 @@ -/* - Games supported: - * Zaxxon yes - * Super Zaxxon yes - * Future Spy yes - * Razmatazz no sound+bad controls sega_universal_sound_board_rom ? - * Ixion no - * Congo Bongo yes - - To do: - Need to add Sega USB support. - Analog inputs for Raxmatazz and Ixion - Clean up video code -*/ -#include "tiles_generic.h" -#include "z80_intf.h" -#include "8255ppi.h" -#include "sn76496.h" -#include "samples.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80DecROM; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvColPROM; -static UINT8 *DrvCharColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvSprRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT32 *DrvPalette; - -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[8]; -static UINT8 DrvReset; - -static UINT8 *interrupt_enable; - -static UINT8 *zaxxon_fg_color; -static UINT8 *zaxxon_bg_color; -static UINT8 *zaxxon_bg_enable; -static UINT32 *zaxxon_bg_scroll; -static UINT8 *zaxxon_flipscreen; -static UINT8 *zaxxon_coin_enable; -static UINT8 *zaxxon_coin_status; -static UINT8 *zaxxon_coin_last; - -static UINT8 *congo_color_bank; -static UINT8 *congo_fg_bank; -static UINT8 *congo_custom; - -static UINT8 *zaxxon_bg_pixmap; - -static UINT8 *soundlatch; - -static UINT8 *sound_state; - -static INT32 futspy_sprite = 0; -static INT32 hardware_type = 0; -static UINT8 no_flip = 0; - -static struct BurnInputInfo ZaxxonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up"} , - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Zaxxon) - -static struct BurnInputInfo CongoBongoInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(CongoBongo) - -static struct BurnInputInfo FutspyInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Futspy) - -static struct BurnDIPInfo CongoBongoDIPList[]= -{ - {0x10, 0xff, 0xff, 0x7f, NULL }, - {0x11, 0xff, 0xff, 0x33, NULL }, - - {0 , 0xfe, 0 , 1, "Service Mode (No Toggle)" }, - {0x10, 0x01, 0x01, 0x00, "Off" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x03, 0x03, "10000" }, - {0x10, 0x01, 0x03, 0x01, "20000" }, - {0x10, 0x01, 0x03, 0x02, "30000" }, - {0x10, 0x01, 0x03, 0x00, "40000" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x10, "4" }, - {0x10, 0x01, 0x30, 0x20, "5" }, - {0x10, 0x01, 0x30, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Sound" }, - {0x10, 0x01, 0x40, 0x00, "Off" }, - {0x10, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x80, 0x00, "Upright" }, - {0x10, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x10, 0x01, 0x0c, 0x0c, "Easy" }, - {0x10, 0x01, 0x0c, 0x04, "Medium" }, - {0x10, 0x01, 0x0c, 0x08, "Hard" }, - {0x10, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x11, 0x01, 0x0f, 0x0f, "4 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x07, "3 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0b, "2 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coins / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0x0f, 0x0a, "2 Coins / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0x0f, 0x03, "1 Coin / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x02, "1 Coin / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin / 1 Credit + Bonus each 4" }, - {0x11, 0x01, 0x0f, 0x04, "1 Coin / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin / 2 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "1 Coin / 2 Credits + Bonus each 5" }, - {0x11, 0x01, 0x0f, 0x00, "1 Coin / 2 Credits + Bonus each 4" }, - {0x11, 0x01, 0x0f, 0x05, "1 Coin / 3 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "1 Coin / 4 Credits" }, - {0x11, 0x01, 0x0f, 0x01, "1 Coin / 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin / 6 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x11, 0x01, 0xf0, 0xf0, "4 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x70, "3 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0xb0, "2 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x60, "2 Coins / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0xf0, 0xa0, "2 Coins / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0xf0, 0x30, "1 Coin / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x20, "1 Coin / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coin / 1 Credit + Bonus each 4" }, - {0x11, 0x01, 0xf0, 0x40, "1 Coin / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin / 2 Credits" }, - {0x11, 0x01, 0xf0, 0x80, "1 Coin / 2 Credits + Bonus each 5" }, - {0x11, 0x01, 0xf0, 0x00, "1 Coin / 2 Credits + Bonus each 4" }, - {0x11, 0x01, 0xf0, 0x50, "1 Coin / 3 Credits" }, - {0x11, 0x01, 0xf0, 0x90, "1 Coin / 4 Credits" }, - {0x11, 0x01, 0xf0, 0x10, "1 Coin / 5 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin / 6 Credits" }, -}; - -STDDIPINFO(CongoBongo) - -static struct BurnDIPInfo ZaxxonDIPList[]= -{ - {0x10, 0xff, 0xff, 0x7f, NULL }, - {0x11, 0xff, 0xff, 0x33, NULL }, - - {0 , 0xfe, 0 , 1, "Service Mode (No Toggle)" }, - {0x10, 0x01, 0x01, 0x00, "Off" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x03, 0x03, "10000" }, - {0x10, 0x01, 0x03, 0x01, "20000" }, - {0x10, 0x01, 0x03, 0x02, "30000" }, - {0x10, 0x01, 0x03, 0x00, "40000" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x10, 0x01, 0x08, 0x00, "Off" }, - {0x10, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x10, "4" }, - {0x10, 0x01, 0x30, 0x20, "5" }, - {0x10, 0x01, 0x30, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Sound" }, - {0x10, 0x01, 0x40, 0x00, "Off" }, - {0x10, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x80, 0x00, "Upright" }, - {0x10, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x11, 0x01, 0x0f, 0x0f, "4 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x07, "3 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0b, "2 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coins / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0x0f, 0x0a, "2 Coins / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0x0f, 0x03, "1 Coin / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x02, "1 Coin / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin / 1 Credit + Bonus each 4" }, - {0x11, 0x01, 0x0f, 0x04, "1 Coin / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin / 2 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "1 Coin / 2 Credits + Bonus each 5" }, - {0x11, 0x01, 0x0f, 0x00, "1 Coin / 2 Credits + Bonus each 4" }, - {0x11, 0x01, 0x0f, 0x05, "1 Coin / 3 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "1 Coin / 4 Credits" }, - {0x11, 0x01, 0x0f, 0x01, "1 Coin / 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin / 6 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x11, 0x01, 0xf0, 0xf0, "4 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x70, "3 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0xb0, "2 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x60, "2 Coins / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0xf0, 0xa0, "2 Coins / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0xf0, 0x30, "1 Coin / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x20, "1 Coin / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coin / 1 Credit + Bonus each 4" }, - {0x11, 0x01, 0xf0, 0x40, "1 Coin / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin / 2 Credits" }, - {0x11, 0x01, 0xf0, 0x80, "1 Coin / 2 Credits + Bonus each 5" }, - {0x11, 0x01, 0xf0, 0x00, "1 Coin / 2 Credits + Bonus each 4" }, - {0x11, 0x01, 0xf0, 0x50, "1 Coin / 3 Credits" }, - {0x11, 0x01, 0xf0, 0x90, "1 Coin / 4 Credits" }, - {0x11, 0x01, 0xf0, 0x10, "1 Coin / 5 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin / 6 Credits" }, -}; - -STDDIPINFO(Zaxxon) - -static struct BurnDIPInfo SzaxxonDIPList[]= -{ - {0x10, 0xff, 0xff, 0x7f, NULL }, - {0x11, 0xff, 0xff, 0x33, NULL }, - - {0 , 0xfe, 0 , 1, "Service Mode (No Toggle)" }, - {0x10, 0x01, 0x01, 0x00, "Off" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x10, 0x01, 0x03, 0x03, "10000" }, - {0x10, 0x01, 0x03, 0x01, "20000" }, - {0x10, 0x01, 0x03, 0x02, "30000" }, - {0x10, 0x01, 0x03, 0x00, "40000" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x10, 0x01, 0x08, 0x00, "Off" }, - {0x10, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x10, "4" }, - {0x10, 0x01, 0x30, 0x20, "5" }, - {0x10, 0x01, 0x30, 0x00, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Sound" }, - {0x10, 0x01, 0x40, 0x00, "Off" }, - {0x10, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x80, 0x00, "Upright" }, - {0x10, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x10, 0x01, 0x04, 0x04, "Normal" }, - {0x10, 0x01, 0x04, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x11, 0x01, 0x0f, 0x0f, "4 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x07, "3 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x0b, "2 Coins / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x06, "2 Coins / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0x0f, 0x0a, "2 Coins / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0x0f, 0x03, "1 Coin / 1 Credit" }, - {0x11, 0x01, 0x0f, 0x02, "1 Coin / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0x0f, 0x0c, "1 Coin / 1 Credit + Bonus each 4" }, - {0x11, 0x01, 0x0f, 0x04, "1 Coin / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0x0f, 0x0d, "1 Coin / 2 Credits" }, - {0x11, 0x01, 0x0f, 0x08, "1 Coin / 2 Credits + Bonus each 5" }, - {0x11, 0x01, 0x0f, 0x00, "1 Coin / 2 Credits + Bonus each 4" }, - {0x11, 0x01, 0x0f, 0x05, "1 Coin / 3 Credits" }, - {0x11, 0x01, 0x0f, 0x09, "1 Coin / 4 Credits" }, - {0x11, 0x01, 0x0f, 0x01, "1 Coin / 5 Credits" }, - {0x11, 0x01, 0x0f, 0x0e, "1 Coin / 6 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x11, 0x01, 0xf0, 0xf0, "4 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x70, "3 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0xb0, "2 Coins / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x60, "2 Coins / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0xf0, 0xa0, "2 Coins / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0xf0, 0x30, "1 Coin / 1 Credit" }, - {0x11, 0x01, 0xf0, 0x20, "1 Coin / 1 Credit + Bonus each 5" }, - {0x11, 0x01, 0xf0, 0xc0, "1 Coin / 1 Credit + Bonus each 4" }, - {0x11, 0x01, 0xf0, 0x40, "1 Coin / 1 Credit + Bonus each 2" }, - {0x11, 0x01, 0xf0, 0xd0, "1 Coin / 2 Credits" }, - {0x11, 0x01, 0xf0, 0x80, "1 Coin / 2 Credits + Bonus each 5" }, - {0x11, 0x01, 0xf0, 0x00, "1 Coin / 2 Credits + Bonus each 4" }, - {0x11, 0x01, 0xf0, 0x50, "1 Coin / 3 Credits" }, - {0x11, 0x01, 0xf0, 0x90, "1 Coin / 4 Credits" }, - {0x11, 0x01, 0xf0, 0x10, "1 Coin / 5 Credits" }, - {0x11, 0x01, 0xf0, 0xe0, "1 Coin / 6 Credits" }, -}; - -STDDIPINFO(Szaxxon) - -static struct BurnDIPInfo FutspyDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x43, NULL }, - - {0 , 0xfe, 0 , 2, "Coin B" }, - {0x12, 0x01, 0x0f, 0x00, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x12, 0x01, 0xf0, 0x00, "1 Coin 1 Credit" }, - {0x12, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x0c, 0x00, "3" }, - {0x13, 0x01, 0x0c, 0x04, "4" }, - {0x13, 0x01, 0x0c, 0x08, "5" }, - {0x13, 0x01, 0x0c, 0x0c, "Free Play" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x30, 0x00, "20K 40K 60K" }, - {0x13, 0x01, 0x30, 0x10, "30K 60K 90K" }, - {0x13, 0x01, 0x30, 0x20, "40K 70K 100K" }, - {0x13, 0x01, 0x30, 0x30, "40K 80K 120K" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0xc0, 0x00, "Easy" }, - {0x13, 0x01, 0xc0, 0x40, "Medium" }, - {0x13, 0x01, 0xc0, 0x80, "Hard" }, - {0x13, 0x01, 0xc0, 0xc0, "Hardest" }, -}; - -STDDIPINFO(Futspy) - -static void ZaxxonPPIWriteA(UINT8 data) -{ - UINT8 diff = data ^ sound_state[0]; - sound_state[0] = data; - - BurnSampleSetRoute(10, BURN_SND_SAMPLE_ROUTE_1, 0.01 + 0.01 * (data & 0x03), BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(10, BURN_SND_SAMPLE_ROUTE_2, 0.01 + 0.01 * (data & 0x03), BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(11, BURN_SND_SAMPLE_ROUTE_1, 0.01 + 0.01 * (data & 0x03), BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(11, BURN_SND_SAMPLE_ROUTE_2, 0.01 + 0.01 * (data & 0x03), BURN_SND_ROUTE_BOTH); - - /* PLAYER SHIP C: channel 10 */ - if ((diff & 0x04) && !(data & 0x04)) { BurnSampleStop(11); BurnSamplePlay(10); } - if ((diff & 0x04) && (data & 0x04)) BurnSampleStop(10); - - /* PLAYER SHIP D: channel 11 */ - if ((diff & 0x08) && !(data & 0x08)) { BurnSampleStop(10); BurnSamplePlay(11); } - if ((diff & 0x08) && (data & 0x08)) BurnSampleStop(11); - - /* HOMING MISSILE: channel 0 */ - if ((diff & 0x10) && !(data & 0x10)) BurnSamplePlay(0); - if ((diff & 0x10) && (data & 0x10)) BurnSampleStop(0); - - /* BASE MISSILE: channel 1 */ - if ((diff & 0x20) && !(data & 0x20)) BurnSamplePlay(1); - - /* LASER: channel 2 */ - if ((diff & 0x40) && !(data & 0x40)) BurnSamplePlay(2); - if ((diff & 0x40) && (data & 0x40)) BurnSampleStop(2); - - /* BATTLESHIP: channel 3 */ - if ((diff & 0x80) && !(data & 0x80)) BurnSamplePlay(3); - if ((diff & 0x80) && (data & 0x80)) BurnSampleStop(3); -} - -static void ZaxxonPPIWriteB(UINT8 data) -{ - UINT8 diff = data ^ sound_state[1]; - sound_state[1] = data; - - /* S-EXP: channel 4 */ - if ((diff & 0x10) && !(data & 0x10)) BurnSamplePlay(4); - - /* M-EXP: channel 5 */ - if ((diff & 0x20) && !(data & 0x20) && !BurnSampleGetStatus(5)) BurnSamplePlay(5); - - /* CANNON: channel 6 */ - if ((diff & 0x80) && !(data & 0x80)) BurnSamplePlay(6); -} - -static void ZaxxonPPIWriteC(UINT8 data) -{ - UINT8 diff = data ^ sound_state[2]; - sound_state[2] = data; - - /* SHOT: channel 7 */ - if ((diff & 0x01) && !(data & 0x01)) BurnSamplePlay(7); - - /* ALARM2: channel 8 */ - if ((diff & 0x04) && !(data & 0x04)) BurnSamplePlay(8); - - /* ALARM3: channel 9 */ - if ((diff & 0x08) && !(data & 0x08) && !BurnSampleGetStatus(9)) BurnSamplePlay(9); -} - -static UINT8 CongoPPIReadA() -{ - return *soundlatch; -} - -static void CongoPPIWriteB(UINT8 data) -{ - UINT8 diff = data ^ sound_state[1]; - sound_state[1] = data; - - if ((diff & 0x02) && !(data & 0x02) && !BurnSampleGetStatus(0)) BurnSamplePlay(0); -} - -static void CongoPPIWriteC(UINT8 data) -{ - UINT8 diff = data ^ sound_state[2]; - sound_state[2] = data; - - /* BASS DRUM: channel 1 */ - if ((diff & 0x01) && !(data & 0x01)) BurnSamplePlay(1); - if ((diff & 0x01) && (data & 0x01)) BurnSampleStop(1); - - /* CONGA (LOW): channel 2 */ - if ((diff & 0x02) && !(data & 0x02)) BurnSamplePlay(2); - if ((diff & 0x02) && (data & 0x02)) BurnSampleStop(2); - - /* CONGA (HIGH): channel 3 */ - if ((diff & 0x04) && !(data & 0x04)) BurnSamplePlay(3); - if ((diff & 0x04) && (data & 0x04)) BurnSampleStop(3); - - /* RIM: channel 4 */ - if ((diff & 0x08) && !(data & 0x08)) BurnSamplePlay(4); - if ((diff & 0x08) && (data & 0x08)) BurnSampleStop(4); -} - -static UINT8 __fastcall zaxxon_read(UINT16 address) -{ - // address mirroring - if ((address & 0xe700) == 0xc000) address &= ~0x18f8; - if ((address & 0xe700) == 0xc100) address &= ~0x18ff; - if ((address & 0xe000) == 0xe000) address &= ~0x1f00; - - switch (address) - { - case 0xc000: - return DrvInputs[0]; - - case 0xc001: - return DrvInputs[1]; - - case 0xc002: - return DrvDips[0]; - - case 0xc003: - return DrvDips[1]; - - case 0xc100: - return DrvInputs[2]; - - case 0xe03c: - case 0xe03d: - case 0xe03e: - case 0xe03f: - return ppi8255_r(0, address & 0x03); - } - - return 0; -} - -static void zaxxon_coin_inserted(UINT8 param) -{ - if (zaxxon_coin_last[param] != DrvJoy4[param]) - { - zaxxon_coin_status[param] = zaxxon_coin_enable[param]; - } -} - -static UINT8 zaxxon_coin_r(UINT8 param) -{ - return zaxxon_coin_status[param]; -} - -static void zaxxon_coin_enable_w(UINT8 offset, UINT8 data) -{ - zaxxon_coin_enable[offset] = data; - if (!zaxxon_coin_enable[offset]) - zaxxon_coin_status[offset] = 0; -} - -static void __fastcall zaxxon_write(UINT16 address, UINT8 data) -{ - // address mirroring - if ((address & 0xe700) == 0xc000) address &= ~0x18f8; - if ((address & 0xe000) == 0xe000) address &= ~0x1f00; - - switch (address) - { - case 0xc000: - case 0xc001: - case 0xc002: - zaxxon_coin_enable_w(address & 3, data & 1); - return; - - case 0xc003: - case 0xc004: - // coin counter_w - return; - - case 0xc006: - *zaxxon_flipscreen = ~data & 1; - return; - - case 0xe03c: - case 0xe03d: - case 0xe03e: - case 0xe03f: - ppi8255_w(0, address & 0x03, data); - return; - - case 0xe0f0: - *interrupt_enable = data & 1; - if (~data & 1) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0xe0f1: - *zaxxon_fg_color = (data & 1) << 7; - return; - - case 0xe0f8: - *zaxxon_bg_scroll &= 0xf00; - *zaxxon_bg_scroll |= data; - return; - - case 0xe0f9: - *zaxxon_bg_scroll &= 0x0ff; - *zaxxon_bg_scroll |= (data & 0x07) << 8; - return; - - case 0xe0fa: - *zaxxon_bg_color = data << 7; - return; - - case 0xe0fb: - *zaxxon_bg_enable = data & 1; - return; - } -} - -static UINT8 __fastcall congo_read(UINT16 address) -{ - // address mirroring - if ((address & 0xe008) == 0xc000) address &= ~0x1fc4; - if ((address & 0xe008) == 0xc008) address &= ~0x1fc7; - - switch (address) - { - case 0xc000: - return DrvInputs[0]; // in0 - case 0xc001: - return DrvInputs[1]; // in1 - case 0xc002: - return DrvDips[0]; // dsw02 // dsw1 - case 0xc003: - return DrvDips[1]; // dsw03 // dsw2 - case 0xc008: - return DrvInputs[2]; - } - - return 0; -} - -static void congo_sprite_custom_w(INT32 offset, UINT8 data) -{ - congo_custom[offset] = data; - - /* seems to trigger on a write of 1 to the 4th byte */ - if (offset == 3 && data == 0x01) - { - UINT16 saddr = congo_custom[0] | (congo_custom[1] << 8); - INT32 count = congo_custom[2]; - - /* count cycles (just a guess) */ - ZetIdle(-count * 5); - - /* this is just a guess; the chip is hardwired to the spriteram */ - while (count-- >= 0) - { - UINT8 daddr = DrvZ80RAM[saddr & 0xfff] * 4; - DrvSprRAM[(daddr + 0) & 0xff] = DrvZ80RAM[(saddr + 1) & 0xfff]; - DrvSprRAM[(daddr + 1) & 0xff] = DrvZ80RAM[(saddr + 2) & 0xfff]; - DrvSprRAM[(daddr + 2) & 0xff] = DrvZ80RAM[(saddr + 3) & 0xfff]; - DrvSprRAM[(daddr + 3) & 0xff] = DrvZ80RAM[(saddr + 4) & 0xfff]; - saddr += 0x20; - } - } -} - -static void __fastcall congo_write(UINT16 address, UINT8 data) -{ - // address mirroring - if ((address & 0xe000) == 0xc000) address &= ~0x1fc0; - - switch (address) - { - case 0xc018: - case 0xc019: - case 0xc01a: - zaxxon_coin_enable_w(address & 3, data & 1); - return; - - case 0xc01b: - case 0xc01c: - // zaxxon_coin_counter_w - return; - - case 0xc01d: - *zaxxon_bg_enable = data & 1; - return; - - case 0xc01e: - *zaxxon_flipscreen = ~data & 1; - return; - - case 0xc01f: - *interrupt_enable = data & 1; - if (~data & 1) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0xc021: - *zaxxon_fg_color = data << 7; - return; - - case 0xc023: - *zaxxon_bg_color = data << 7; - return; - - case 0xc026: - *congo_fg_bank = data & 1; - return; - - case 0xc027: - *congo_color_bank = data & 1; - return; - - case 0xc028: - //case 0xc02a: - *zaxxon_bg_scroll &= 0xf00; - *zaxxon_bg_scroll |= data; - return; - - case 0xc029: - //case 0xc02b: - *zaxxon_bg_scroll &= 0x0ff; - *zaxxon_bg_scroll |= (data & 0x07) << 8; - return; - - case 0xc030: - case 0xc031: - case 0xc032: - case 0xc033: - congo_sprite_custom_w(address & 3, data); - return; - - case 0xc038: - case 0xc039: - case 0xc03a: - case 0xc03b: - case 0xc03c: - case 0xc03d: - case 0xc03e: - case 0xc03f: - *soundlatch = data; - return; - } -} - -static void __fastcall congo_sound_write(UINT16 address, UINT8 data) -{ - // address mirroring - if ((address & 0xe000) == 0x6000) address &= ~0x1fff; - if ((address & 0xe000) == 0x8000) address &= ~0x1ffc; - if ((address & 0xe000) == 0xa000) address &= ~0x1fff; - - switch (address) - { - case 0x6000: - SN76496Write(0, data); - return; - - case 0x8000: - case 0x8001: - case 0x8002: - case 0x8003: - ppi8255_w(0, address & 0x03, data); - return; - - case 0xa000: - SN76496Write(1, data); - return; - } -} - -static UINT8 __fastcall congo_sound_read(UINT16 address) -{ - // address mirroring - if ((address & 0xe000) == 0x8000) address &= ~0x1ffc; - - switch (address) - { - case 0x8000: - case 0x8001: - case 0x8002: - case 0x8003: - return ppi8255_r(0, address & 0x03); - } - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 CharPlane[2] = { 0x4000 * 1, 0x4000 * 0 }; - INT32 TilePlane[3] = { 0x10000 * 2, 0x10000 * 1, 0x10000 * 0 }; - INT32 SpritePlane[3] = { 0x20000 * 2, 0x20000 * 1, 0x20000 * 0 }; - INT32 SpriteXOffs[32] = { STEP8(0, 1), STEP8(64, 1), STEP8(128, 1), STEP8(192, 1) }; - INT32 SpriteYOffs[32] = { STEP8(0, 8), STEP8(256, 8), STEP8(512, 8), STEP8(768, 8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x1000); - - GfxDecode(0x0100, 2, 8, 8, CharPlane, SpriteXOffs, SpriteYOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x6000); - - GfxDecode(0x0400, 3, 8, 8, TilePlane, SpriteXOffs, SpriteYOffs, 0x040, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0xc000); - - GfxDecode(0x0080, 3, 32, 32, SpritePlane, SpriteXOffs, SpriteYOffs, 0x400, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit(INT32 len) -{ - for (INT32 i = 0; i < len; i++) - { - INT32 bit0, bit1, bit2, r, g, b; - - bit0 = (DrvColPROM[i] >> 0) & 0x01; - bit1 = (DrvColPROM[i] >> 1) & 0x01; - bit2 = (DrvColPROM[i] >> 2) & 0x01; - r = bit0 * 33 + bit1 * 70 + bit2 * 151; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - g = bit0 * 33 + bit1 * 70 + bit2 * 151; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - b = bit0 * 78 + bit1 * 168; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } - - DrvCharColPROM = DrvColPROM; - DrvCharColPROM += 0x100; // Character color prom starts at DrvColPROM + 0x100 -} - -static void bg_layer_init() -{ - INT32 len = (hardware_type == 2) ? 0x2000 : 0x4000; - INT32 mask = len-1; - - for (INT32 offs = 0; offs < 32 * 512; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 moffs = offs & mask; - - INT32 code = (DrvGfxROM3[moffs]) | ((DrvGfxROM3[moffs | len] & 3) << 8); - INT32 color = (DrvGfxROM3[moffs | len] & 0xf0) >> 1; - - UINT8 *src = DrvGfxROM1 + (code << 6); - - for (INT32 y = 0; y < 8; y++, sy++) { - for (INT32 x = 0; x < 8; x++) { - zaxxon_bg_pixmap[sy * 256 + sx + x] = src[(y << 3) | x] | color; - } - } - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - if (hardware_type == 2) { - ZetOpen(1); - ZetReset(); - ZetClose(); - } - - BurnSampleReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - DrvZ80DecROM = Next; Next += 0x010000; - DrvZ80ROM2 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x004000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x020000; - DrvGfxROM3 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000200; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(INT32); - - zaxxon_bg_pixmap = Next; Next += 0x100000; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x001000; - DrvZ80RAM2 = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x000100; - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000400; - - interrupt_enable = Next; Next += 0x000001; - - zaxxon_fg_color = Next; Next += 0x000001; - zaxxon_bg_color = Next; Next += 0x000001; - zaxxon_bg_enable = Next; Next += 0x000001; - congo_color_bank = Next; Next += 0x000001; - congo_fg_bank = Next; Next += 0x000001; - congo_custom = Next; Next += 0x000004; - zaxxon_flipscreen = Next; Next += 0x000001; - zaxxon_coin_enable = Next; Next += 0x000004; - zaxxon_coin_status = Next; Next += 0x000004; - zaxxon_coin_last = Next; Next += 0x000004; - - zaxxon_bg_scroll = (UINT32*)Next; Next += 0x000001 * sizeof(INT32); - - soundlatch = Next; Next += 0x000001; - - sound_state = Next; Next += 0x000003; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0800, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x4000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x8000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x0000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x2000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x4000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x6000, 14, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 15, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 16, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(0x200); - bg_layer_init(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x5fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x6000, 0x6fff, MAP_RAM); - - // address mirroring - for (INT32 i = 0; i < 0x2000; i+= 0x400) { - ZetMapMemory(DrvVidRAM, 0x8000 + i, 0x83ff + i, MAP_RAM); - } - - for (INT32 i = 0; i < 0x1000; i+= 0x100) { - ZetMapMemory(DrvSprRAM, 0xa000 + i, 0xa0ff + i, MAP_RAM); - } - - ZetSetWriteHandler(zaxxon_write); - ZetSetReadHandler(zaxxon_read); - ZetClose(); - - ppi8255_init(1); - PPI0PortWriteA = ZaxxonPPIWriteA; - PPI0PortWriteB = ZaxxonPPIWriteB; - PPI0PortWriteC = ZaxxonPPIWriteC; - - BurnSampleInit(0); - - BurnSampleSetAllRoutesAllSamples(0.50, BURN_SND_ROUTE_BOTH); - - // for Zaxxon: - // Homing Missile - BurnSampleSetRoute(0, BURN_SND_SAMPLE_ROUTE_1, 0.61, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(0, BURN_SND_SAMPLE_ROUTE_2, 0.61, BURN_SND_ROUTE_BOTH); - // Ground Missile take-off - BurnSampleSetRoute(1, BURN_SND_SAMPLE_ROUTE_1, 0.30, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(1, BURN_SND_SAMPLE_ROUTE_2, 0.30, BURN_SND_ROUTE_BOTH); - // Pew! Pew! - BurnSampleSetRoute(6, BURN_SND_SAMPLE_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(6, BURN_SND_SAMPLE_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - - BurnSampleSetRoute(10, BURN_SND_SAMPLE_ROUTE_1, 0.01 * 3, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(10, BURN_SND_SAMPLE_ROUTE_2, 0.01 * 3, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(11, BURN_SND_SAMPLE_ROUTE_1, 0.01 * 3, BURN_SND_ROUTE_BOTH); - BurnSampleSetRoute(11, BURN_SND_SAMPLE_ROUTE_2, 0.01 * 3, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 CongoInit() -{ - hardware_type = 2; - futspy_sprite = 1; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x6000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x4000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x2000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x4000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x6000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x8000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0xa000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x0000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x2000, 15, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 16, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0100, 16, 1)) return 1; // reload - - if (BurnLoadRom(DrvZ80ROM2 + 0x0000, 17, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(0x200); - bg_layer_init(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0x8000, 0x8fff, MAP_RAM); - - // address mirroring - for (INT32 i = 0; i < 0x2000; i+= 0x800) { - ZetMapMemory(DrvVidRAM, 0xa000, 0xa3ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0xa400, 0xa7ff, MAP_RAM); - } - - ZetSetWriteHandler(congo_write); - ZetSetReadHandler(congo_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x1fff, MAP_ROM); - - for (INT32 i = 0; i < 0x2000; i+= 0x800) { - ZetMapMemory(DrvZ80RAM2, 0x4000 + i, 0x47ff + i, MAP_RAM); - } - - ZetSetWriteHandler(congo_sound_write); - ZetSetReadHandler(congo_sound_read); - ZetClose(); - - ppi8255_init(1); - PPI0PortReadA = CongoPPIReadA; - PPI0PortWriteA = NULL; - PPI0PortWriteB = CongoPPIWriteB; - PPI0PortWriteC = CongoPPIWriteC; - - BurnSampleInit(1); - BurnSampleSetAllRoutesAllSamples(0.10, BURN_SND_ROUTE_BOTH); - - SN76489AInit(0, 4000000, 0); - SN76489AInit(1, 4000000 / 4, 1); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - BurnSampleExit(); - ppi8255_exit(); - if (hardware_type == 2) { - SN76496Exit(); - } - GenericTilesExit(); - BurnFree (AllMem); - AllMem = NULL; - - futspy_sprite = 0; - hardware_type = 0; - no_flip = 0; - - return 0; -} - -static void draw_fg_layer(INT32 type) -{ - for (INT32 offs = 0x40; offs < 0x3c0; offs++) - { - INT32 color; - - INT32 sx = offs & 0x1f; - INT32 sy = offs >> 5; - - INT32 code = DrvVidRAM[offs] + (*congo_fg_bank << 8); - - switch (type) - { - case 0: - color = DrvCharColPROM[(sx | ((sy >> 2) << 5))] & 0x0f; - break; - - case 2: - color = (DrvColRAM[offs] & 0x1f) + (*congo_color_bank << 8); - break; - - default: - color = DrvCharColPROM[offs] & 0x0f; - break; - } - - if (no_flip) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx * 8, (sy * 8) - 16, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, 248 - (sx * 8), 232 - (sy * 8), color, 3, 0, 0, DrvGfxROM0); - } - } -} - -static void draw_background(INT32 skew) -{ - if (*zaxxon_bg_enable) - { - UINT8 *pixmap = zaxxon_bg_pixmap; - INT32 colorbase = *zaxxon_bg_color + (*congo_color_bank << 8); - INT32 xmask = 255; - INT32 ymask = 4095; - INT32 flipmask = *zaxxon_flipscreen ? 0xff : 0x00; - INT32 flipoffs = *zaxxon_flipscreen ? 0x38 : 0x40; - INT32 x, y; - - if (*zaxxon_flipscreen) - flipoffs += 7; - else - flipoffs -= 1; - - for (y = 0; y < 224; y++) - { - UINT16 *dst = pTransDraw + (223-y) * 0x100; - INT32 srcx, srcy, vf; - UINT8 *src; - - vf = (y + 16) ^ flipmask; - srcy = vf + ((*zaxxon_bg_scroll << 1) ^ 0xfff) + 1; - src = pixmap + (srcy & ymask) * 0x100; - - for (x = 0; x < 256; x++) - { - srcx = x ^ flipmask; - if (skew) - { - srcx += ((vf >> 1) ^ 0xff) + 1; - srcx += flipoffs; - } - - dst[255-x] = src[srcx & xmask] + colorbase; - } - } - } - else - memset (pTransDraw, 0, nScreenWidth * nScreenHeight * 2); -} - -static INT32 find_minimum_y(UINT8 value) -{ - INT32 flipmask = *zaxxon_flipscreen ? 0xff : 0x00; - INT32 flipconst = *zaxxon_flipscreen ? 0xef : 0xf1; - INT32 y; - - for (y = 0; y < 256; y += 16) - { - INT32 sum = (value + flipconst + 1) + (y ^ flipmask); - if ((sum & 0xe0) == 0xe0) - break; - } - - while (1) - { - INT32 sum = (value + flipconst + 1) + ((y - 1) ^ flipmask); - if ((sum & 0xe0) != 0xe0) - break; - y--; - } - - return (y + 1) & 0xff; -} - - -static inline INT32 find_minimum_x(UINT8 value) -{ - INT32 flipmask = *zaxxon_flipscreen ? 0xff : 0x00; - INT32 x; - - x = (value + 0xef + 1) ^ flipmask; - if (flipmask) - x -= 31; - return x & 0xff; -} - -static void draw_sprites(UINT16 flipxmask, UINT16 flipymask) -{ - INT32 flipmask = *zaxxon_flipscreen ? 0xff : 0x00; - - for (INT32 offs = 0x7c; offs >= 0; offs -= 4) - { - INT32 sy = find_minimum_y(DrvSprRAM[offs]); - INT32 flipy = (DrvSprRAM[offs + (flipymask >> 8)] ^ flipmask) & flipymask; - INT32 flipx = (DrvSprRAM[offs + (flipxmask >> 8)] ^ flipmask) & flipxmask; - - INT32 code = DrvSprRAM[offs + 1] & (0x3f | (futspy_sprite * 0x40)); - - INT32 color = (DrvSprRAM[offs + 2] & 0x1f) + (*congo_color_bank << 5); - INT32 sx = find_minimum_x(DrvSprRAM[offs + 3]); - - sx = (240 - sx) - 16; - if (sx < -15) sx += 256; - sy = (240 - sy) - 32; - if (sy < -15) sy += 256; - - if (flipy) { - if (flipx) { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_Clip(pTransDraw, code, sx - 256, sy, color, 3, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy - 256, color, 3, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_Clip(pTransDraw, code, sx - 256, sy - 256, color, 3, 0, 0, DrvGfxROM2); - - } else { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx - 256, sy, color, 3, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 256, color, 3, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx - 256, sy - 256, color, 3, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - if (sx > 31 && sx < (nScreenWidth - 31) && sy > 31 && sy < (nScreenHeight-31)) { - Render32x32Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx - 256, sy, color, 3, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 256, color, 3, 0, 0, DrvGfxROM2); - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx - 256, sy - 256, color, 3, 0, 0, DrvGfxROM2); - } - } - } - } -} - - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(0x200); - DrvRecalc = 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (hardware_type == 1) { - if (nBurnLayer & 1) draw_background(0); - } else { - if (nBurnLayer & 1) draw_background(1); - } - - INT32 flipx_mask = 0x140; - if (futspy_sprite) flipx_mask += 0x040; - if (hardware_type == 2) flipx_mask += 0x100; - - if (nBurnLayer & 2) draw_sprites(flipx_mask, 0x180); - - if (nBurnLayer & 4) draw_fg_layer(hardware_type); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void zaxxon_coin_lockout() -{ - // soft-coin lockout - prevents 30 coins per 1 insert-coin keypress. - if (DrvJoy4[0]) // a coin inserted - zaxxon_coin_inserted(0); - if (DrvJoy4[1]) // b coin inserted - zaxxon_coin_inserted(1); - if (DrvJoy4[2]) // service pressed - zaxxon_coin_inserted(2); - DrvInputs[2] += (zaxxon_coin_r(0)) ? 0x20 : 0; - DrvInputs[2] += (zaxxon_coin_r(1)) ? 0x40 : 0; - DrvInputs[2] += (zaxxon_coin_r(2)) ? 0x80 : 0; - zaxxon_coin_last[0] = DrvJoy4[0]; - zaxxon_coin_last[1] = DrvJoy4[1]; - zaxxon_coin_last[2] = DrvJoy4[2]; - // end soft-coin lockout -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0x00; - DrvInputs[1] = 0x00; - DrvInputs[2] = 0x00; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - // DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - DrvInputs[2] ^= (DrvJoy3[2] & 1) << 2; // start 1 - DrvInputs[2] ^= (DrvJoy3[3] & 1) << 3; // start 2 - zaxxon_coin_lockout(); - } - - ZetOpen(0); - ZetRun(3041250 / 60); - if (*interrupt_enable) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - if (pBurnSoundOut) { - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - } - - return 0; -} - -static INT32 CongoFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0x00; - DrvInputs[1] = 0x00; - DrvInputs[2] = 0x00; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - zaxxon_coin_lockout(); - } - - INT32 nCyclesSegment; - INT32 nInterleave = 32; - INT32 nCyclesTotal[2] = { 3041250 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nCyclesSegment); - if (i == nInterleave-1 && *interrupt_enable) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - - ZetOpen(1); - nCyclesSegment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(nCyclesSegment); - if ((i%7)==0) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - SN76496Update(1, pSoundBuf, nSegmentLength); - } - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - BurnSampleScan(nAction, pnMin); - - if (hardware_type == 2) { - SN76496Scan(nAction, pnMin); - } - } - - return 0; -} - - -static struct BurnSampleInfo zaxxonSampleDesc[] = { - {"03", SAMPLE_AUTOLOOP }, /* 0 - Homing Missile */ - {"02", SAMPLE_NOLOOP }, /* 1 - Base Missile */ - {"01", SAMPLE_AUTOLOOP }, /* 2 - Laser (force field) */ - {"00", SAMPLE_AUTOLOOP }, /* 3 - Battleship (end of level boss) */ - {"11", SAMPLE_NOLOOP }, /* 4 - S-Exp (enemy explosion) */ - {"10", SAMPLE_NOLOOP }, /* 5 - M-Exp (ship explosion) */ - {"08", SAMPLE_NOLOOP }, /* 6 - Cannon (ship fire) */ - {"23", SAMPLE_NOLOOP }, /* 7 - Shot (enemy fire) */ - {"21", SAMPLE_NOLOOP }, /* 8 - Alarm 2 (target lock) */ - {"20", SAMPLE_NOLOOP }, /* 9 - Alarm 3 (low fuel) */ - {"05", SAMPLE_AUTOLOOP }, /* 10 - initial background noise */ - {"04", SAMPLE_AUTOLOOP }, /* 11 - looped asteroid noise */ - { "", 0 } -}; - -STD_SAMPLE_PICK(zaxxon) -STD_SAMPLE_FN(zaxxon) - - -static struct BurnSampleInfo congoSampleDesc[] = { - {"gorilla", SAMPLE_NOLOOP }, /* 0 */ - {"bass", SAMPLE_NOLOOP }, /* 1 */ - {"congal", SAMPLE_NOLOOP }, /* 2 */ - {"congah", SAMPLE_NOLOOP }, /* 3 */ - {"rim", SAMPLE_NOLOOP }, /* 4 */ - { "", 0 } -}; - -STD_SAMPLE_PICK(congo) -STD_SAMPLE_FN(congo) - - -// Zaxxon (set 1, rev D) - -static struct BurnRomInfo zaxxonRomDesc[] = { - { "zaxxon_rom3d.u27", 0x2000, 0x6e2b4a30, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "zaxxon_rom2d.u28", 0x2000, 0x1c9ea398, 1 | BRF_PRG | BRF_ESS }, // 1 - { "zaxxon_rom1d.u29", 0x1000, 0x1c123ef9, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "zaxxon_rom14.u68", 0x0800, 0x07bf8c52, 2 | BRF_GRA }, // 3 Characters - { "zaxxon_rom15.u69", 0x0800, 0xc215edcb, 2 | BRF_GRA }, // 4 - - { "zaxxon_rom6.u113", 0x2000, 0x6e07bb68, 3 | BRF_GRA }, // 5 Background Tiles - { "zaxxon_rom5.u112", 0x2000, 0x0a5bce6a, 3 | BRF_GRA }, // 6 - { "zaxxon_rom4.u111", 0x2000, 0xa5bf1465, 3 | BRF_GRA }, // 7 - - { "zaxxon_rom11.u77", 0x2000, 0xeaf0dd4b, 4 | BRF_GRA }, // 8 Sprites - { "zaxxon_rom12.u78", 0x2000, 0x1c5369c7, 4 | BRF_GRA }, // 9 - { "zaxxon_rom13.u79", 0x2000, 0xab4e8a9a, 4 | BRF_GRA }, // 10 - - { "zaxxon_rom8.u91", 0x2000, 0x28d65063, 5 | BRF_GRA }, // 11 Tilemaps - { "zaxxon_rom7.u90", 0x2000, 0x6284c200, 5 | BRF_GRA }, // 12 - { "zaxxon_rom10.u93", 0x2000, 0xa95e61fd, 5 | BRF_GRA }, // 13 - { "zaxxon_rom9.u92", 0x2000, 0x7e42691f, 5 | BRF_GRA }, // 14 - - { "mro16.u76", 0x0100, 0x6cc6695b, 6 | BRF_GRA }, // 15 Color Proms - { "zaxxon.u72", 0x0100, 0xdeaa21f7, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(zaxxon) -STD_ROM_FN(zaxxon) - -struct BurnDriver BurnDrvZaxxon = { - "zaxxon", NULL, NULL, "zaxxon", "1982", - "Zaxxon (set 1, rev D)\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_VERSHOOT, 0, - NULL, zaxxonRomInfo, zaxxonRomName, zaxxonSampleInfo, zaxxonSampleName, ZaxxonInputInfo, ZaxxonDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Zaxxon (set 2, unknown rev) - -static struct BurnRomInfo zaxxon2RomDesc[] = { - { "zaxxon_rom3a.u27", 0x2000, 0xb18e428a, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "zaxxon_rom2a.u28", 0x2000, 0x1c9ea398, 1 | BRF_PRG | BRF_ESS }, // 1 - { "zaxxon_rom1a.u29", 0x1000, 0x1977d933, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "zaxxon_rom14.u68", 0x0800, 0x07bf8c52, 2 | BRF_GRA }, // 3 Characters - { "zaxxon_rom15.u69", 0x0800, 0xc215edcb, 2 | BRF_GRA }, // 4 - - { "zaxxon_rom6.u113", 0x2000, 0x6e07bb68, 3 | BRF_GRA }, // 5 Background Tiles - { "zaxxon_rom5.u112", 0x2000, 0x0a5bce6a, 3 | BRF_GRA }, // 6 - { "zaxxon_rom4.u111", 0x2000, 0xa5bf1465, 3 | BRF_GRA }, // 7 - - { "zaxxon_rom11.u77", 0x2000, 0xeaf0dd4b, 4 | BRF_GRA }, // 8 Sprites - { "zaxxon_rom12.u78", 0x2000, 0x1c5369c7, 4 | BRF_GRA }, // 9 - { "zaxxon_rom13.u79", 0x2000, 0xab4e8a9a, 4 | BRF_GRA }, // 10 - - { "zaxxon_rom8.u91", 0x2000, 0x28d65063, 5 | BRF_GRA }, // 11 Tilemaps - { "zaxxon_rom7.u90", 0x2000, 0x6284c200, 5 | BRF_GRA }, // 12 - { "zaxxon_rom10.u93", 0x2000, 0xa95e61fd, 5 | BRF_GRA }, // 13 - { "zaxxon_rom9.u92", 0x2000, 0x7e42691f, 5 | BRF_GRA }, // 14 - - { "mro16.u76", 0x0100, 0x6cc6695b, 6 | BRF_GRA }, // 15 Color Proms - { "mro17.u41", 0x0100, 0xa9e1fb43, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(zaxxon2) -STD_ROM_FN(zaxxon2) - -struct BurnDriver BurnDrvZaxxon2 = { - "zaxxon2", "zaxxon", NULL, "zaxxon", "1982", - "Zaxxon (set 2, unknown rev)\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_VERSHOOT, 0, - NULL, zaxxon2RomInfo, zaxxon2RomName, zaxxonSampleInfo, zaxxonSampleName, ZaxxonInputInfo, ZaxxonDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Zaxxon (set 3, unknown rev) - -static struct BurnRomInfo zaxxon3RomDesc[] = { - { "zaxxon3_alt.u27", 0x2000, 0x2f2f2b7c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "zaxxon2_alt.u28", 0x2000, 0xae7e1c38, 1 | BRF_PRG | BRF_ESS }, // 1 - { "zaxxon1_alt.u29", 0x1000, 0xcc67c097, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "zaxxon_rom14.u68", 0x0800, 0x07bf8c52, 2 | BRF_GRA }, // 3 Characters - { "zaxxon_rom15.u69", 0x0800, 0xc215edcb, 2 | BRF_GRA }, // 4 - - { "zaxxon_rom6.u113", 0x2000, 0x6e07bb68, 3 | BRF_GRA }, // 5 Background Tiles - { "zaxxon_rom5.u112", 0x2000, 0x0a5bce6a, 3 | BRF_GRA }, // 6 - { "zaxxon_rom4.u111", 0x2000, 0xa5bf1465, 3 | BRF_GRA }, // 7 - - { "zaxxon_rom11.u77", 0x2000, 0xeaf0dd4b, 4 | BRF_GRA }, // 8 Sprites - { "zaxxon_rom12.u78", 0x2000, 0x1c5369c7, 4 | BRF_GRA }, // 9 - { "zaxxon_rom13.u79", 0x2000, 0xab4e8a9a, 4 | BRF_GRA }, // 10 - - { "zaxxon_rom8.u91", 0x2000, 0x28d65063, 5 | BRF_GRA }, // 11 Tilemaps - { "zaxxon_rom7.u90", 0x2000, 0x6284c200, 5 | BRF_GRA }, // 12 - { "zaxxon_rom10.u93", 0x2000, 0xa95e61fd, 5 | BRF_GRA }, // 13 - { "zaxxon_rom9.u92", 0x2000, 0x7e42691f, 5 | BRF_GRA }, // 14 - - { "mro16.u76", 0x0100, 0x6cc6695b, 6 | BRF_GRA }, // 15 Color Proms - { "mro17.u41", 0x0100, 0xa9e1fb43, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(zaxxon3) -STD_ROM_FN(zaxxon3) - -struct BurnDriver BurnDrvZaxxon3 = { - "zaxxon3", "zaxxon", NULL, "zaxxon", "1982", - "Zaxxon (set 3, unknown rev)\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_VERSHOOT, 0, - NULL, zaxxon3RomInfo, zaxxon3RomName, zaxxonSampleInfo, zaxxonSampleName, ZaxxonInputInfo, ZaxxonDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Zaxxon (Japan) - -static struct BurnRomInfo zaxxonjRomDesc[] = { - { "zaxxon_rom3.u13", 0x2000, 0x925168c7, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "zaxxon_rom2.u12", 0x2000, 0xc088df92, 1 | BRF_PRG | BRF_ESS }, // 1 - { "zaxxon_rom1.u11", 0x1000, 0xf832dd79, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "zaxxon_rom14.u54", 0x0800, 0x07bf8c52, 2 | BRF_GRA }, // 3 Characters - { "zaxxon_rom15.u55", 0x0800, 0xc215edcb, 2 | BRF_GRA }, // 4 - - { "zaxxon_rom6.u70", 0x2000, 0x6e07bb68, 3 | BRF_GRA }, // 5 Background Tiles - { "zaxxon_rom5.u69", 0x2000, 0x0a5bce6a, 3 | BRF_GRA }, // 6 - { "zaxxon_rom4.u68", 0x2000, 0xa5bf1465, 3 | BRF_GRA }, // 7 - - { "zaxxon_rom11.u59", 0x2000, 0xeaf0dd4b, 4 | BRF_GRA }, // 8 Sprites - { "zaxxon_rom12.u60", 0x2000, 0x1c5369c7, 4 | BRF_GRA }, // 9 - { "zaxxon_rom13.u61", 0x2000, 0xab4e8a9a, 4 | BRF_GRA }, // 10 - - { "zaxxon_rom8.u58", 0x2000, 0x28d65063, 5 | BRF_GRA }, // 11 Tilemaps - { "zaxxon_rom7.u57", 0x2000, 0x6284c200, 5 | BRF_GRA }, // 12 - { "zaxxon_rom10.u60", 0x2000, 0xa95e61fd, 5 | BRF_GRA }, // 13 - { "zaxxon_rom9.u59", 0x2000, 0x7e42691f, 5 | BRF_GRA }, // 14 - - { "mro16.u76", 0x0100, 0x6cc6695b, 6 | BRF_GRA }, // 15 Color Proms - { "mro17.u41", 0x0100, 0xa9e1fb43, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(zaxxonj) -STD_ROM_FN(zaxxonj) - -static void zaxxonj_decode() -{ - static const UINT8 data_xortable[2][8] = - { - { 0x0a,0x0a,0x22,0x22,0xaa,0xaa,0x82,0x82 }, /* ...............0 */ - { 0xa0,0xaa,0x28,0x22,0xa0,0xaa,0x28,0x22 }, /* ...............1 */ - }; - - static const UINT8 opcode_xortable[8][8] = - { - { 0x8a,0x8a,0x02,0x02,0x8a,0x8a,0x02,0x02 }, /* .......0...0...0 */ - { 0x80,0x80,0x08,0x08,0xa8,0xa8,0x20,0x20 }, /* .......0...0...1 */ - { 0x8a,0x8a,0x02,0x02,0x8a,0x8a,0x02,0x02 }, /* .......0...1...0 */ - { 0x02,0x08,0x2a,0x20,0x20,0x2a,0x08,0x02 }, /* .......0...1...1 */ - { 0x88,0x0a,0x88,0x0a,0xaa,0x28,0xaa,0x28 }, /* .......1...0...0 */ - { 0x80,0x80,0x08,0x08,0xa8,0xa8,0x20,0x20 }, /* .......1...0...1 */ - { 0x88,0x0a,0x88,0x0a,0xaa,0x28,0xaa,0x28 }, /* .......1...1...0 */ - { 0x02,0x08,0x2a,0x20,0x20,0x2a,0x08,0x02 } /* .......1...1...1 */ - }; - - INT32 A; - UINT8 *rom = DrvZ80ROM; - INT32 size = 0x6000; - UINT8 *decrypt = DrvZ80DecROM; - - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80DecROM, DrvZ80ROM ); - ZetClose(); - - for (A = 0x0000; A < size; A++) - { - INT32 i,j; - UINT8 src; - - src = rom[A]; - - /* pick the translation table from bit 0 of the address */ - i = A & 1; - - /* pick the offset in the table from bits 1, 3 and 5 of the source data */ - j = ((src >> 1) & 1) + (((src >> 3) & 1) << 1) + (((src >> 5) & 1) << 2); - /* the bottom half of the translation table is the mirror image of the top */ - if (src & 0x80) j = 7 - j; - - /* decode the ROM data */ - rom[A] = src ^ data_xortable[i][j]; - - /* now decode the opcodes */ - /* pick the translation table from bits 0, 4, and 8 of the address */ - i = ((A >> 0) & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2); - decrypt[A] = src ^ opcode_xortable[i][j]; - } -} - -static INT32 ZaxxonjInit() -{ - INT32 nRet = DrvInit(); - - if (nRet == 0) { - zaxxonj_decode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvZaxxonj = { - "zaxxonj", "zaxxon", NULL, "zaxxon", "1982", - "Zaxxon (Japan)\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_VERSHOOT, 0, - NULL, zaxxonjRomInfo, zaxxonjRomName, zaxxonSampleInfo, zaxxonSampleName, ZaxxonInputInfo, ZaxxonDIPInfo, - ZaxxonjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Jackson - -static struct BurnRomInfo zaxxonbRomDesc[] = { - { "jackson_rom3.u27", 0x2000, 0x125bca1c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "jackson_rom2.u28", 0x2000, 0xc088df92, 1 | BRF_PRG | BRF_ESS }, // 1 - { "jackson_rom1.u29", 0x1000, 0xe7bdc417, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "zaxxon_rom14.u54", 0x0800, 0x07bf8c52, 2 | BRF_GRA }, // 3 Characters - { "zaxxon_rom15.u55", 0x0800, 0xc215edcb, 2 | BRF_GRA }, // 4 - - { "zaxxon_rom6.u70", 0x2000, 0x6e07bb68, 3 | BRF_GRA }, // 5 Background Tiles - { "zaxxon_rom5.u69", 0x2000, 0x0a5bce6a, 3 | BRF_GRA }, // 6 - { "zaxxon_rom4.u68", 0x2000, 0xa5bf1465, 3 | BRF_GRA }, // 7 - - { "zaxxon_rom11.u59", 0x2000, 0xeaf0dd4b, 4 | BRF_GRA }, // 8 Sprites - { "zaxxon_rom12.u60", 0x2000, 0x1c5369c7, 4 | BRF_GRA }, // 9 - { "zaxxon_rom13.u61", 0x2000, 0xab4e8a9a, 4 | BRF_GRA }, // 10 - - { "zaxxon_rom8.u58", 0x2000, 0x28d65063, 5 | BRF_GRA }, // 11 Tilemaps - { "zaxxon_rom7.u57", 0x2000, 0x6284c200, 5 | BRF_GRA }, // 12 - { "zaxxon_rom10.u60", 0x2000, 0xa95e61fd, 5 | BRF_GRA }, // 13 - { "zaxxon_rom9.u59", 0x2000, 0x7e42691f, 5 | BRF_GRA }, // 14 - - { "mro16.u76", 0x0100, 0x6cc6695b, 6 | BRF_GRA }, // 15 Color Proms - { "zaxxon.u72", 0x0100, 0xdeaa21f7, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(zaxxonb) -STD_ROM_FN(zaxxonb) - -struct BurnDriver BurnDrvZaxxonb = { - "zaxxonb", "zaxxon", NULL, "zaxxon", "1982", - "Jackson\0", NULL, "bootleg", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_VERSHOOT, 0, - NULL, zaxxonbRomInfo, zaxxonbRomName, zaxxonSampleInfo, zaxxonSampleName, ZaxxonInputInfo, ZaxxonDIPInfo, - ZaxxonjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Super Zaxxon - -static struct BurnRomInfo szaxxonRomDesc[] = { - { "1804e.u27", 0x2000, 0xaf7221da, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "1803e.u28", 0x2000, 0x1b90fb2a, 1 | BRF_PRG | BRF_ESS }, // 1 - { "1802e.u29", 0x1000, 0x07258b4a, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "1815b.u68", 0x0800, 0xbccf560c, 2 | BRF_GRA }, // 3 Characters - { "1816b.u69", 0x0800, 0xd28c628b, 2 | BRF_GRA }, // 4 - - { "1807b.u113", 0x2000, 0xf51af375, 3 | BRF_GRA }, // 5 Background Tiles - { "1806b.u112", 0x2000, 0xa7de021d, 3 | BRF_GRA }, // 6 - { "1805b.u111", 0x2000, 0x5bfb3b04, 3 | BRF_GRA }, // 7 - - { "1812e.u77", 0x2000, 0x1503ae41, 4 | BRF_GRA }, // 8 Sprites - { "1813e.u78", 0x2000, 0x3b53d83f, 4 | BRF_GRA }, // 9 - { "1814e.u79", 0x2000, 0x581e8793, 4 | BRF_GRA }, // 10 - - { "1809b.u91", 0x2000, 0xdd1b52df, 5 | BRF_GRA }, // 11 Tilemaps - { "1808b.u90", 0x2000, 0xb5bc07f0, 5 | BRF_GRA }, // 12 - { "1811b.u93", 0x2000, 0x68e84174, 5 | BRF_GRA }, // 13 - { "1810b.u92", 0x2000, 0xa509994b, 5 | BRF_GRA }, // 14 - - { "pr-5168.u98", 0x0100, 0x15727a9f, 6 | BRF_GRA }, // 15 Color Proms - { "pr-5167.u72", 0x0100, 0xdeaa21f7, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(szaxxon) -STD_ROM_FN(szaxxon) - -static void sega_decode(const UINT8 convtable[32][4]) -{ - INT32 A; - INT32 length = 0x6000; - INT32 cryptlen = length; - UINT8 *rom = DrvZ80ROM; - UINT8 *decrypted = DrvZ80DecROM; - - memcpy (DrvZ80DecROM, DrvZ80ROM, 0x6000); - - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80DecROM, DrvZ80ROM); - ZetClose(); - - for (A = 0x0000;A < cryptlen;A++) - { - INT32 xorval = 0; - UINT8 src = rom[A]; - /* pick the translation table from bits 0, 4, 8 and 12 of the address */ - INT32 row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2) + (((A >> 12) & 1) << 3); - /* pick the offset in the table from bits 3 and 5 of the source data */ - INT32 col = ((src >> 3) & 1) + (((src >> 5) & 1) << 1); - /* the bottom half of the translation table is the mirror image of the top */ - if (src & 0x80) - { - col = 3 - col; - xorval = 0xa8; - } - - /* decode the opcodes */ - decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval); - - /* decode the data */ - rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval); - - if (convtable[2*row][col] == 0xff) /* table incomplete! (for development) */ - decrypted[A] = 0xee; - if (convtable[2*row+1][col] == 0xff) /* table incomplete! (for development) */ - rom[A] = 0xee; - } -} - -static void szaxxon_decode() -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...0...0 */ - { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */ - { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...0...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...1 */ - { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */ - { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...1...1...0 */ - { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...1 */ - { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...1...0 */ - { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...0...1...1 */ - { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...1...0...0 */ - { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...1...0...1 */ - { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static INT32 sZaxxonInit() -{ - INT32 nRet = DrvInit(); - - if (nRet == 0) { - szaxxon_decode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvSzaxxon = { - "szaxxon", NULL, NULL, "zaxxon", "1982", - "Super Zaxxon\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_VERSHOOT, 0, - NULL, szaxxonRomInfo, szaxxonRomName, zaxxonSampleInfo, zaxxonSampleName, ZaxxonInputInfo, SzaxxonDIPInfo, - sZaxxonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Future Spy - -static struct BurnRomInfo futspyRomDesc[] = { - { "fs_snd.u27", 0x2000, 0x7578fe7f, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "fs_snd.u28", 0x2000, 0x8ade203c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "fs_snd.u29", 0x1000, 0x734299c3, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "fs_snd.u68", 0x0800, 0x305fae2d, 2 | BRF_GRA }, // 3 Characters - { "fs_snd.u69", 0x0800, 0x3c5658c0, 2 | BRF_GRA }, // 4 - - { "fs_vid.u113", 0x2000, 0x36d2bdf6, 3 | BRF_GRA }, // 5 Background Tiles - { "fs_vid.u112", 0x2000, 0x3740946a, 3 | BRF_GRA }, // 6 - { "fs_vid.u111", 0x2000, 0x4cd4df98, 3 | BRF_GRA }, // 7 - - { "fs_vid.u77", 0x4000, 0x1b93c9ec, 4 | BRF_GRA }, // 8 Sprites - { "fs_vid.u78", 0x4000, 0x50e55262, 4 | BRF_GRA }, // 9 - { "fs_vid.u79", 0x4000, 0xbfb02e3e, 4 | BRF_GRA }, // 10 - - { "fs_vid.u91", 0x2000, 0x86da01f4, 5 | BRF_GRA }, // 11 Tilemaps - { "fs_vid.u90", 0x2000, 0x2bd41d2d, 5 | BRF_GRA }, // 12 - { "fs_vid.u93", 0x2000, 0xb82b4997, 5 | BRF_GRA }, // 13 - { "fs_vid.u92", 0x2000, 0xaf4015af, 5 | BRF_GRA }, // 14 - - { "futrprom.u98", 0x0100, 0x9ba2acaa, 6 | BRF_GRA }, // 15 Color Proms - { "futrprom.u72", 0x0100, 0xf9e26790, 6 | BRF_GRA }, // 16 -}; - -STD_ROM_PICK(futspy) -STD_ROM_FN(futspy) - -static void futspy_decode() -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x28,0x08,0x20,0x00 }, { 0x28,0x08,0x20,0x00 }, /* ...0...0...0...0 */ - { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...0...0...0...1 */ - { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...0...0...1...0 */ - { 0xa0,0x80,0x20,0x00 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...0...1...1 */ - { 0x28,0x08,0x20,0x00 }, { 0x88,0x80,0xa8,0xa0 }, /* ...0...1...0...0 */ - { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */ - { 0x80,0x00,0xa0,0x20 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...1...1...0 */ - { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...1...1 */ - { 0x88,0x80,0xa8,0xa0 }, { 0x28,0x08,0x20,0x00 }, /* ...1...0...0...0 */ - { 0x80,0x00,0xa0,0x20 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...0...1 */ - { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x88,0x00,0x80 }, /* ...1...0...1...0 */ - { 0x80,0x00,0xa0,0x20 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...0...1...1 */ - { 0x88,0x80,0xa8,0xa0 }, { 0x88,0x80,0xa8,0xa0 }, /* ...1...1...0...0 */ - { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...1...1...0...1 */ - { 0x80,0x00,0xa0,0x20 }, { 0x28,0x08,0x20,0x00 }, /* ...1...1...1...0 */ - { 0x20,0x28,0xa0,0xa8 }, { 0xa0,0x80,0x20,0x00 } /* ...1...1...1...1 */ - }; - - sega_decode(convtable); -} - -static INT32 futspyInit() -{ - futspy_sprite = 1; - no_flip = 1; - - INT32 nRet = DrvInit(); - - if (nRet == 0) { - futspy_decode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvFutspy = { - "futspy", NULL, NULL, "zaxxon", "1984", - "Future Spy\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_VERSHOOT, 0, - NULL, futspyRomInfo, futspyRomName, zaxxonSampleInfo, zaxxonSampleName, FutspyInputInfo, FutspyDIPInfo, - futspyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Razzmatazz - -static struct BurnRomInfo razmatazRomDesc[] = { - { "u27", 0x2000, 0x254f350f, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "u28", 0x2000, 0x3a1eaa99, 1 | BRF_PRG | BRF_ESS }, // 1 - { "u29", 0x2000, 0x0ee67e78, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "1921.u68", 0x0800, 0x77f8ff5a, 2 | BRF_GRA }, // 3 Characters - { "1922.u69", 0x0800, 0xcf63621e, 2 | BRF_GRA }, // 4 - - { "1934.u113", 0x2000, 0x39bb679c, 3 | BRF_GRA }, // 5 Background Tiles - { "1933.u112", 0x2000, 0x1022185e, 3 | BRF_GRA }, // 6 - { "1932.u111", 0x2000, 0xc7a715eb, 3 | BRF_GRA }, // 7 - - { "1925.u77", 0x2000, 0xa7965437, 4 | BRF_GRA }, // 8 Sprites - { "1926.u78", 0x2000, 0x9a3af434, 4 | BRF_GRA }, // 9 - { "1927.u79", 0x2000, 0x0323de2b, 4 | BRF_GRA }, // 10 - - { "1929.u91", 0x2000, 0x55c7c757, 6 | BRF_GRA }, // 11 Tilemaps - { "1928.u90", 0x2000, 0xe58b155b, 6 | BRF_GRA }, // 12 - { "1931.u93", 0x2000, 0x55fe0f82, 6 | BRF_GRA }, // 13 - { "1930.u92", 0x2000, 0xf355f105, 6 | BRF_GRA }, // 14 - - { "clr.u98", 0x0100, 0x0fd671af, 5 | BRF_GRA }, // 15 Color Proms - { "clr.u72", 0x0100, 0x03233bc5, 5 | BRF_GRA }, // 16 - - { "1924.u51", 0x0800, 0xa75e0011, 7 | BRF_PRG | BRF_ESS }, // 17 Universal Sound Board Code - { "1923.u50", 0x0800, 0x59994a51, 7 | BRF_PRG | BRF_ESS }, // 18 -}; - -STD_ROM_PICK(razmataz) -STD_ROM_FN(razmataz) - -static void nprinces_decode() -{ - static const UINT8 convtable[32][4] = - { - /* opcode data address */ - /* A B C D A B C D */ - { 0x08,0x88,0x00,0x80 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...0...0...0 */ - { 0xa8,0xa0,0x28,0x20 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...1 */ - { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...1...0...0 */ - { 0xa8,0xa0,0x28,0x20 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...1...0...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */ - { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...0...0 */ - { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...1 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...0 */ - { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...1 */ - { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */ - { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 } /* ...1...1...1...1 */ - }; - - - sega_decode(convtable); -} - -static INT32 razmatazInit() -{ - hardware_type = 1; - no_flip = 1; - - INT32 nRet = DrvInit(); - - if (nRet == 0) { - nprinces_decode(); - } - - return nRet; -} - -struct BurnDriver BurnDrvRazmataz = { - "razmataz", NULL, NULL, NULL, "1983", - "Razzmatazz\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - 0 | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, razmatazRomInfo, razmatazRomName, NULL, NULL, ZaxxonInputInfo, ZaxxonDIPInfo, //RazmatazInputInfo, RazmatazDIPInfo, - razmatazInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Ixion (prototype) - -static struct BurnRomInfo ixionRomDesc[] = { - { "1937d.u27", 0x2000, 0xf447aac5, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "1938b.u28", 0x2000, 0x17f48640, 1 | BRF_PRG | BRF_ESS }, // 1 - { "1955b.u29", 0x1000, 0x78636ec6, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "1939a.u68", 0x0800, 0xc717ddc7, 1 | BRF_GRA }, // 3 Characters - { "1940a.u69", 0x0800, 0xec4bb3ad, 1 | BRF_GRA }, // 4 - - { "1952a.u113", 0x2000, 0xffb9b03d, 2 | BRF_GRA }, // 5 Background Tiles - { "1951a.u112", 0x2000, 0xdb743f1b, 2 | BRF_GRA }, // 6 - { "1950a.u111", 0x2000, 0xc2de178a, 2 | BRF_GRA }, // 7 - - { "1945a.u77", 0x2000, 0x3a3fbfe7, 3 | BRF_GRA }, // 8 Sprites - { "1946a.u78", 0x2000, 0xf2cb1b53, 3 | BRF_GRA }, // 9 - { "1947a.u79", 0x2000, 0xd2421e92, 3 | BRF_GRA }, // 10 - - { "1948a.u91", 0x2000, 0x7a7fcbbe, 4 | BRF_GRA }, // 11 Tilemaps - { "1953a.u90", 0x2000, 0x6b626ea7, 4 | BRF_GRA }, // 12 - { "1949a.u93", 0x2000, 0xe7722d09, 4 | BRF_GRA }, // 13 - { "1954a.u92", 0x2000, 0xa970f5ff, 4 | BRF_GRA }, // 14 - - { "1942a.u98", 0x0100, 0x3a8e6f74, 5 | BRF_GRA }, // 15 proms - { "1941a.u72", 0x0100, 0xa5d0d97e, 5 | BRF_GRA }, // 16 - - { "1944a.u51", 0x0800, 0x88215098, 7 | BRF_PRG | BRF_ESS }, // 17 Univesal Sound Board Code - { "1943a.u50", 0x0800, 0x77e5a1f0, 7 | BRF_PRG | BRF_ESS }, // 18 -}; - -STD_ROM_PICK(ixion) -STD_ROM_FN(ixion) - -static INT32 ixionInit() -{ - hardware_type = 1; - - INT32 nRet = DrvInit(); - - if (nRet == 0) { - szaxxon_decode(); - } - - return DrvInit(); -} - -struct BurnDriver BurnDrvIxion = { - "ixion", NULL, NULL, NULL, "1983", - "Ixion (prototype)\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - 0 | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_MISC, 0, - NULL, ixionRomInfo, ixionRomName, NULL, NULL, ZaxxonInputInfo, ZaxxonDIPInfo, //RazmatazInputInfo, RazmatazDIPInfo, - ixionInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Congo Bongo - -static struct BurnRomInfo congoRomDesc[] = { - { "congo_rev_c_rom1.u21", 0x2000, 0x09355b5b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "congo_rev_c_rom2a.u22", 0x2000, 0x1c5e30ae, 1 | BRF_PRG | BRF_ESS }, // 1 - { "congo_rev_c_rom3.u23", 0x2000, 0x5ee1132c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "congo_rev_c_rom4.u24", 0x2000, 0x5332b9bf, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "tip_top_rom_5.u76", 0x1000, 0x7bf6ba2b, 1 | BRF_GRA }, // 4 Characters - - { "tip_top_rom_8.u93", 0x2000, 0xdb99a619, 2 | BRF_GRA }, // 5 Background Tiles - { "tip_top_rom_9.u94", 0x2000, 0x93e2309e, 2 | BRF_GRA }, // 6 - { "tip_top_rom_10.u95", 0x2000, 0xf27a9407, 2 | BRF_GRA }, // 7 - - { "tip_top_rom_12.u78", 0x2000, 0x15e3377a, 3 | BRF_GRA }, // 8 Sprites - { "tip_top_rom_13.u79", 0x2000, 0x1d1321c8, 3 | BRF_GRA }, // 9 - { "tip_top_rom_11.u77", 0x2000, 0x73e2709f, 3 | BRF_GRA }, // 10 - { "tip_top_rom_14.u104", 0x2000, 0xbf9169fe, 3 | BRF_GRA }, // 11 - { "tip_top_rom_16.u106", 0x2000, 0xcb6d5775, 3 | BRF_GRA }, // 12 - { "tip_top_rom_15.u105", 0x2000, 0x7b15a7a4, 3 | BRF_GRA }, // 13 - - { "tip_top_rom_6.u57", 0x2000, 0xd637f02b, 4 | BRF_GRA }, // 14 Tilemaps - { "tip_top_rom_7.u58", 0x2000, 0x80927943, 4 | BRF_GRA }, // 15 - - { "mr019.u87", 0x0100, 0xb788d8ae, 5 | BRF_GRA }, // 16 Color Proms - - { "tip_top_rom_17.u19", 0x2000, 0x5024e673, 6 | BRF_PRG | BRF_ESS }, // 17 Sound Z80 Code -}; - -STD_ROM_PICK(congo) -STD_ROM_FN(congo) - -struct BurnDriver BurnDrvCongo = { - "congo", NULL, NULL, "congo", "1983", - "Congo Bongo\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_PLATFORM, 0, - NULL, congoRomInfo, congoRomName, congoSampleInfo, congoSampleName, CongoBongoInputInfo, CongoBongoDIPInfo, - CongoInit, DrvExit, CongoFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Congo Bongo (Rev C, 3 board stack) - -static struct BurnRomInfo congoaRomDesc[] = { - { "congo_rev_c_rom1.u35", 0x2000, 0x09355b5b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "congo_rev_c_rom2a.u34", 0x2000, 0x1c5e30ae, 1 | BRF_PRG | BRF_ESS }, // 1 - { "congo_rev_c_rom3.u33", 0x2000, 0x5ee1132c, 1 | BRF_PRG | BRF_ESS }, // 2 - { "congo_rev_c_rom4.u32", 0x2000, 0x5332b9bf, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "tip_top_rom_5.u76", 0x1000, 0x7bf6ba2b, 1 | BRF_GRA }, // 4 Characters - - { "tip_top_rom_8.u93", 0x2000, 0xdb99a619, 2 | BRF_GRA }, // 5 Background Tiles - { "tip_top_rom_9.u94", 0x2000, 0x93e2309e, 2 | BRF_GRA }, // 6 - { "tip_top_rom_10.u95", 0x2000, 0xf27a9407, 2 | BRF_GRA }, // 7 - - { "tip_top_rom_12.u78", 0x2000, 0x15e3377a, 3 | BRF_GRA }, // 8 Sprites - { "tip_top_rom_13.u79", 0x2000, 0x1d1321c8, 3 | BRF_GRA }, // 9 - { "tip_top_rom_11.u77", 0x2000, 0x73e2709f, 3 | BRF_GRA }, // 10 - { "tip_top_rom_14.u104", 0x2000, 0xbf9169fe, 3 | BRF_GRA }, // 11 - { "tip_top_rom_16.u106", 0x2000, 0xcb6d5775, 3 | BRF_GRA }, // 12 - { "tip_top_rom_15.u105", 0x2000, 0x7b15a7a4, 3 | BRF_GRA }, // 13 - - { "tip_top_rom_6.u57", 0x2000, 0xd637f02b, 4 | BRF_GRA }, // 14 Tilemaps - { "tip_top_rom_7.u58", 0x2000, 0x80927943, 4 | BRF_GRA }, // 15 - - { "mr018.u68", 0x0200, 0x56b9f1ba, 5 | BRF_GRA }, // 16 Color Proms - - { "tip_top_rom_17.u11", 0x2000, 0x5024e673, 6 | BRF_PRG | BRF_ESS }, // 17 Sound Z80 Code -}; - -STD_ROM_PICK(congoa) -STD_ROM_FN(congoa) - -struct BurnDriver BurnDrvCongoa = { - "congoa", "congo", NULL, "congo", "1983", - "Congo Bongo (Rev C, 3 board stack)\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_PLATFORM, 0, - NULL, congoaRomInfo, congoaRomName, congoSampleInfo, congoSampleName, CongoBongoInputInfo, CongoBongoDIPInfo, - CongoInit, DrvExit, CongoFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Tip Top - -static struct BurnRomInfo tiptopRomDesc[] = { - { "tiptop1.u35", 0x2000, 0xe19dc77b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code - { "tiptop2.u34", 0x2000, 0x3fcd3b6e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "tiptop3.u33", 0x2000, 0x1c94250b, 1 | BRF_PRG | BRF_ESS }, // 2 - { "tiptop4.u32", 0x2000, 0x577b501b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "tip_top_rom_5.u76", 0x1000, 0x7bf6ba2b, 1 | BRF_GRA }, // 4 Characters - - { "tip_top_rom_8.u93", 0x2000, 0xdb99a619, 2 | BRF_GRA }, // 5 Background Tiles - { "tip_top_rom_9.u94", 0x2000, 0x93e2309e, 2 | BRF_GRA }, // 6 - { "tip_top_rom_10.u95", 0x2000, 0xf27a9407, 2 | BRF_GRA }, // 7 - - { "tip_top_rom_12.u78", 0x2000, 0x15e3377a, 3 | BRF_GRA }, // 8 Sprites - { "tip_top_rom_13.u79", 0x2000, 0x1d1321c8, 3 | BRF_GRA }, // 9 - { "tip_top_rom_11.u77", 0x2000, 0x73e2709f, 3 | BRF_GRA }, // 10 - { "tip_top_rom_14.u104", 0x2000, 0xbf9169fe, 3 | BRF_GRA }, // 11 - { "tip_top_rom_16.u106", 0x2000, 0xcb6d5775, 3 | BRF_GRA }, // 12 - { "tip_top_rom_15.u105", 0x2000, 0x7b15a7a4, 3 | BRF_GRA }, // 13 - - { "tip_top_rom_6.u57", 0x2000, 0xd637f02b, 4 | BRF_GRA }, // 14 Tilemaps - { "tip_top_rom_7.u58", 0x2000, 0x80927943, 4 | BRF_GRA }, // 15 - - { "mr018.u68", 0x0200, 0x56b9f1ba, 5 | BRF_GRA }, // 16 Color Proms - - { "tip_top_rom_17.u11", 0x2000, 0x5024e673, 6 | BRF_PRG | BRF_ESS }, // 17 Sound Z80 Code -}; - -STD_ROM_PICK(tiptop) -STD_ROM_FN(tiptop) - -struct BurnDriver BurnDrvTiptop = { - "tiptop", "congo", NULL, "congo", "1983", - "Tip Top\0", NULL, "Sega", "Zaxxon", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_SEGA_MISC, GBF_PLATFORM, 0, - NULL, tiptopRomInfo, tiptopRomName, congoSampleInfo, congoSampleName, CongoBongoInputInfo, CongoBongoDIPInfo, - CongoInit, DrvExit, CongoFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/sega/fd1089.cpp b/jan/src/burn/drv/sega/fd1089.cpp deleted file mode 100644 index cca978164..000000000 --- a/jan/src/burn/drv/sega/fd1089.cpp +++ /dev/null @@ -1,282 +0,0 @@ -// based on MAME sources for FD1089 by Nicola Salmoria, Andreas Naive, and Charles MacDonald - -#include "sys16.h" -#include "bitswap.h" - -struct parameters -{ - INT32 xor1; - INT32 s7,s6,s5,s4,s3,s2,s1,s0; -}; - -static UINT8 basetable_fd1089[0x100] = -{ - 0x00,0x1c,0x76,0x6a,0x5e,0x42,0x24,0x38,0x4b,0x67,0xad,0x81,0xe9,0xc5,0x03,0x2f, - 0x45,0x69,0xaf,0x83,0xe7,0xcb,0x01,0x2d,0x02,0x1e,0x78,0x64,0x5c,0x40,0x2a,0x36, - 0x32,0x2e,0x44,0x58,0xe4,0xf8,0x9e,0x82,0x29,0x05,0xcf,0xe3,0x93,0xbf,0x79,0x55, - 0x3f,0x13,0xd5,0xf9,0x85,0xa9,0x63,0x4f,0xb8,0xa4,0xc2,0xde,0x6e,0x72,0x18,0x04, - 0x0c,0x10,0x7a,0x66,0xfc,0xe0,0x86,0x9a,0x47,0x6b,0xa1,0x8d,0xbb,0x97,0x51,0x7d, - 0x17,0x3b,0xfd,0xd1,0xeb,0xc7,0x0d,0x21,0xa0,0xbc,0xda,0xc6,0x50,0x4c,0x26,0x3a, - 0x3e,0x22,0x48,0x54,0x46,0x5a,0x3c,0x20,0x25,0x09,0xc3,0xef,0xc1,0xed,0x2b,0x07, - 0x6d,0x41,0x87,0xab,0x89,0xa5,0x6f,0x43,0x1a,0x06,0x60,0x7c,0x62,0x7e,0x14,0x08, - 0x0a,0x16,0x70,0x6c,0xdc,0xc0,0xaa,0xb6,0x4d,0x61,0xa7,0x8b,0xf7,0xdb,0x11,0x3d, - 0x5b,0x77,0xbd,0x91,0xe1,0xcd,0x0b,0x27,0x80,0x9c,0xf6,0xea,0x56,0x4a,0x2c,0x30, - 0xb0,0xac,0xca,0xd6,0xee,0xf2,0x98,0x84,0x37,0x1b,0xdd,0xf1,0x95,0xb9,0x73,0x5f, - 0x39,0x15,0xdf,0xf3,0x9b,0xb7,0x71,0x5d,0xb2,0xae,0xc4,0xd8,0xec,0xf0,0x96,0x8a, - 0xa8,0xb4,0xd2,0xce,0xd0,0xcc,0xa6,0xba,0x1f,0x33,0xf5,0xd9,0xfb,0xd7,0x1d,0x31, - 0x57,0x7b,0xb1,0x9d,0xb3,0x9f,0x59,0x75,0x8c,0x90,0xfa,0xe6,0xf4,0xe8,0x8e,0x92, - 0x12,0x0e,0x68,0x74,0xe2,0xfe,0x94,0x88,0x65,0x49,0x8f,0xa3,0x99,0xb5,0x7f,0x53, - 0x35,0x19,0xd3,0xff,0xc9,0xe5,0x23,0x0f,0xbe,0xa2,0xc8,0xd4,0x4e,0x52,0x34,0x28, -}; - - -/* common to FD1089A and FD1089B */ -static const struct parameters addr_params[16] = -{ - { 0x23, 6,4,5,7,3,0,1,2 }, - { 0x92, 2,5,3,6,7,1,0,4 }, - { 0xb8, 6,7,4,2,0,5,1,3 }, - { 0x74, 5,3,7,1,4,6,0,2 }, - { 0xcf, 7,4,1,0,6,2,3,5 }, - { 0xc4, 3,1,6,4,5,0,2,7 }, - { 0x51, 5,7,2,4,3,1,6,0 }, - { 0x14, 7,2,0,6,1,3,4,5 }, - { 0x7f, 3,5,6,0,2,1,7,4 }, - { 0x03, 2,3,4,0,6,7,5,1 }, - { 0x96, 3,1,7,5,2,4,6,0 }, - { 0x30, 7,6,2,3,0,4,5,1 }, - { 0xe2, 1,0,3,7,4,5,2,6 }, - { 0x72, 1,6,0,5,7,2,4,3 }, - { 0xf5, 0,4,1,2,6,5,7,3 }, - { 0x5b, 0,7,5,3,1,4,2,6 }, -}; - -static UINT8 rearrange_key(UINT8 table, INT32 opcode) -{ - if (opcode == 0) { - table ^= (1<<4); - table ^= (1<<5); - table ^= (1<<6); - - if (BIT(~table,3)) - table ^= (1<<1); - - if (BIT(table,6)) - table ^= (1<<7); - - table = BITSWAP08(table,1,0,6,4,3,5,2,7); - - if (BIT(table,6)) - table = BITSWAP08(table,7,6,2,4,5,3,1,0); - } else { - table ^= (1<<2); - table ^= (1<<3); - table ^= (1<<4); - - if (BIT(~table,3)) - table ^= (1<<5); - - if (BIT(~table,7)) - table ^= (1<<6); - - table = BITSWAP08(table,5,6,7,4,2,3,1,0); - - if (BIT(table,6)) - table = BITSWAP08(table,7,6,5,3,2,4,1,0); - } - - if (BIT(table,6)) { - if (BIT(table,5)) - table ^= (1<<4); - } else { - if (BIT(~table,4)) - table ^= (1<<5); - } - - return table; -} - -static INT32 decode_fd1089a(INT32 val,INT32 key,INT32 opcode) -{ - INT32 table; - - static const struct parameters data_params[16] = - { - { 0x55, 6,5,1,0,7,4,2,3 }, - { 0x94, 7,6,4,2,0,5,1,3 }, - { 0x8d, 1,4,2,3,0,6,7,5 }, - { 0x9a, 4,3,5,6,0,2,1,7 }, - { 0x72, 4,3,7,0,5,6,1,2 }, - { 0xff, 1,7,2,3,6,4,5,0 }, - { 0x06, 6,5,3,2,4,1,0,7 }, - { 0xc5, 3,5,1,4,2,7,0,6 }, - { 0xec, 4,7,5,1,6,0,2,3 }, - { 0x89, 3,5,0,6,1,2,7,4 }, - { 0x5c, 1,3,0,7,5,2,4,6 }, - { 0x3f, 7,3,0,2,4,6,1,5 }, - { 0x57, 6,4,7,2,1,5,3,0 }, - { 0xf7, 6,3,7,0,5,4,2,1 }, - { 0x3a, 6,1,3,2,7,4,5,0 }, - { 0xac, 1,6,3,5,0,7,4,2 }, - }; - const struct parameters *p; - const struct parameters *q; - INT32 family; - - /* special case - don't decrypt */ - if (key == 0x40) - return val; - - table = rearrange_key(key, opcode); - - p = &addr_params[table >> 4]; - val = BITSWAP08(val, p->s7,p->s6,p->s5,p->s4,p->s3,p->s2,p->s1,p->s0) ^ p->xor1; - - if (BIT(table,3)) val ^= 0x01; - if (BIT(table,0)) val ^= 0xb1; - if (opcode) val ^= 0x34; - if (opcode == 0) - if (BIT(table,6)) - val ^= 0x01; - - val = basetable_fd1089[val]; - - family = table & 0x07; - if (opcode == 0) - { - if (BIT(~table,6) & BIT(table,2)) family ^= 8; - if (BIT(table,4)) family ^= 8; - } - else - { - if (BIT(table,6) & BIT(table,2)) family ^= 8; - if (BIT(table,5)) family ^= 8; - } - - if (BIT(table,0)) - { - if (BIT(val,0)) val ^= 0xc0; - if (BIT(~val,6) ^ BIT(val,4)) - val = BITSWAP08(val, 7,6,5,4,1,0,2,3); - } - else - { - if (BIT(~val,6) ^ BIT(val,4)) - val = BITSWAP08(val, 7,6,5,4,0,1,3,2); - } - if (BIT(~val,6)) - val = BITSWAP08(val, 7,6,5,4,2,3,0,1); - - q = &data_params[family]; - - val ^= q->xor1; - val = BITSWAP08(val, q->s7,q->s6,q->s5,q->s4,q->s3,q->s2,q->s1,q->s0); - - return val; -} - -static INT32 decode_fd1089b(INT32 val,INT32 key,INT32 opcode) -{ - INT32 table; - INT32 xor1; - - const struct parameters *p; - - /* special case - don't decrypt */ - if (key == 0x40) - return val; - - table = rearrange_key(key, opcode); - - p = &addr_params[table >> 4]; - val = BITSWAP08(val, p->s7,p->s6,p->s5,p->s4,p->s3,p->s2,p->s1,p->s0) ^ p->xor1; - - if (BIT(table,3)) val ^= 0x01; - if (BIT(table,0)) val ^= 0xb1; - if (opcode) val ^= 0x34; - if (opcode == 0) - if (BIT(table,6)) - val ^= 0x01; - - val = basetable_fd1089[val]; - - xor1 = 0; - if (opcode == 0) - { - if (BIT(~table,6) & BIT(table,2)) xor1 ^= 0x01; - if (BIT(table,4)) xor1 ^= 0x01; - } - else - { - if (BIT(table,6) & BIT(table,2)) xor1 ^= 0x01; - if (BIT(table,5)) xor1 ^= 0x01; - } - - val ^= xor1; - - if (BIT(table,2)) - { - val = BITSWAP08(val, 7,6,5,4,1,0,3,2); - - if (BIT(table,0) ^ BIT(table,1)) - val = BITSWAP08(val, 7,6,5,4,0,1,3,2); - } - else - { - val = BITSWAP08(val, 7,6,5,4,3,2,0,1); - - if (BIT(table,0) ^ BIT(table,1)) - val = BITSWAP08(val, 7,6,5,4,1,0,2,3); - } - - return val; -} - -static UINT16 fd1089_decrypt(/*offs_t*/INT32 addr,UINT16 val,const UINT8 *key,INT32 opcode) -{ - INT32 tbl_num,src; - - /* pick the translation table from bits ff022a of the address */ - tbl_num = ((addr & 0x000002) >> 1) | - ((addr & 0x000008) >> 2) | - ((addr & 0x000020) >> 3) | - ((addr & 0x000200) >> 6) | - ((addr & 0xff0000) >> 12); - - src = ((val & 0x0008) >> 3) | - ((val & 0x0040) >> 5) | - ((val & 0xfc00) >> 8); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1089A_ENC) src = decode_fd1089a(src,key[tbl_num + (1^opcode) * 0x1000],opcode); - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1089B_ENC) src = decode_fd1089b(src,key[tbl_num + (1^opcode) * 0x1000],opcode); - - src = ((src & 0x01) << 3) | - ((src & 0x02) << 5) | - ((src & 0xfc) << 8); - - return (val & ~0xfc48) | src; -} - -static void sys16_decrypt(const UINT8 *key) -{ - UINT16 *rom = (UINT16 *)System16Rom; - INT32 size = 0x100000; - INT32 A; - UINT16 *decrypted = (UINT16 *)System16Code; - - for (A = 0;A < size;A+=2) - { - UINT16 src = BURN_ENDIAN_SWAP_INT16(rom[A / 2]); - - /* decode the opcodes */ - decrypted[A/2] = BURN_ENDIAN_SWAP_INT16(fd1089_decrypt(A,src,key,1)); - - /* decode the data */ - rom[A/2] = BURN_ENDIAN_SWAP_INT16(fd1089_decrypt(A,src,key,0)); - } -} - -void FD1089Decrypt() -{ - sys16_decrypt(System16Key); -} diff --git a/jan/src/burn/drv/sega/fd1094.cpp b/jan/src/burn/drv/sega/fd1094.cpp deleted file mode 100644 index 6ba1d0768..000000000 --- a/jan/src/burn/drv/sega/fd1094.cpp +++ /dev/null @@ -1,533 +0,0 @@ -/***************************************************************************** - -FD1094 encryption - - -The FD1094 is a custom CPU based on the 68000, which runs encrypted code. -The decryption key is stored in 8KB of battery-backed RAM; when the battery -dies, the CPU can no longer decrypt the program code and the game stops -working (though the CPU itself still works - it just uses a wrong decryption -key). - -Being a 68000, the encryption works on 16-bit words. Only words fetched from -program space are decrypted; words fetched from data space are not affected. - -The decryption can logically be split in two parts. The first part consists -of a series of conditional XORs and bitswaps, controlled by the decryption -key, which will be described in the next paragraph. The second part does a -couple more XORs which don't depend on the key, followed by the replacement -of several values with FFFF. This last step is done to prevent usage of any -PC-relative opcode, which would easily allow an intruder to dump decrypted -values from program space. The FFFF replacement may affect either ~300 values -or ~5000, depending on the decryption key. - -The main part of the decryption can itself be subdivided in four consecutive -steps. The first one is executed only if bit 15 of the encrypted value is 1; -the second one only if bit 14 of the _current_ value is 1; the third one only -if bit 13 of the current value is 1; the fourth one is always executed. The -first three steps consist of a few conditional XORs and a final conditional -bitswap; the fourth one consists of a fixed XOR and a few conditional -bitswaps. There is, however, a special case: if bits 15, 14 and 13 of the -encrypted value are all 0, none of the above steps are executed, replaced by -a single fixed bitswap. - -In the end, the decryption of a value at a given address is controlled by 32 -boolean variables; 8 of them change at every address (repeating after 0x2000 -words), and constitute the main key which is stored in the battery-backed -RAM; the other 24 don't change with the address, and depend solely on bytes -1, 2, and 3 of the battery-backed RAM, modified by the "state" which the CPU -is in. - -The CPU can be in one of 256 possible states. The 8 bits of the state modify -the 24 bits of the global key in a fixed way, which isn't affected by the -battery-backed RAM. -On reset, the CPU goes in state 0x00. The state can then be modified by the -program, executing the instruction -CMPI.L #$00xxFFFF, D0 -where xx is the state. -When an interrupt happens, the CPU enters "irq mode", forcing a specific -state, which is stored in byte 0 of the battery-backed RAM. Irq mode can also -be selected by the program with the instruction -CMPI.L #$0200FFFF, D0 -When RTE is executed, the CPU leaves irq mode, restoring the previous state. -This can also be done by the program with the instruction -CMPI.L #$0300FFFF, D0 - -Since bytes 0-3 of the battery-backed RAM are used to store the irq state and -the global key, they have a double use: this one, and the normal 8-bit key -that changes at every address. To prevent that double use, the CPU fetches -the 8-bit key from a different place when decrypting words 0-3, but this only -happens after wrapping around at least once; when decrypting the first four -words of memory, which correspond the the initial SP and initial PC vectors, -the 8-bit key is taken from bytes 0-3 of RAM. Instead, when fetching the -vectors, the global key is handled differently, to prevent double use of -those bytes. But this special handling of the global key doesn't apply to -normal operations: reading words 1-3 from program space results in bytes 1-3 -of RAM being used both for the 8-bit key and for the 24-bit global key. - - - -There is still uncertainty about the assignment of two global key bits. - -key[1] ------- -key_0b invert; \ bits 7,5 always 1 for now (but 0 in a bad CPU) -global_xor0; / -key_5b invert; bit 6 -key_2b invert; bit 4 -key_1b invert; bit 3 always 1 for now (but 0 in a bad CPU) -global_xor1; bit 2 -key_0c invert; bit 1 -global_swap2; bit 0 - -key[2] ------- -key_1a invert; bit 7 always 1 for now (but 0 in a bad CPU) -key_6b invert; bit 6 always 1 for now (but 0 in a bad CPU) -global_swap0a; bit 5 -key_7a invert; bit 4 -key_4a invert; bit 3 -global_swap0b; bit 2 -key_6a invert; bit 1 -key_3a invert; bit 0 - -key[3] ------- -key_2a invert; bit 7 always 1 for now (but 0 in a bad CPU) -global_swap3; bit 6 always 1 for now (but 0 in a bad CPU) -key_5a_invert; bit 5 -global_swap1; bit 4 -key_3b invert; bit 3 -global_swap4; bit 2 -key_0a invert; bit 1 -key_4b invert; bit 0 - - -summary of global keys: ------------------------ - ..... .. .. -0049 10101000 11110101 11100011 -0050 10101000 11110101 11100011 -0053 11111111 11111111 11111111 -0056 10101111 11111110 11101000 -0058-02C 10101111 11110101 11111000 -0058-03D 10101111 11110100 11100100 -0058-05C 10101110 11111001 11110010 -0058-09D 10101100 11111001 11100101 -0068 10101111 11111001 11110101 -0070 10101111 11110111 11111001 -0080 10101111 11110111 11100101 -0084 10101111 11110101 11100000 -0085 10101111 11110100 11110111 -0087 10101111 11110100 11110111 -0089 10101111 11110100 11100010 -0090 10101111 11111110 11100100 -0091 10101111 11110100 11100100 -0092 10101111 11110100 11100011 -0093 10101111 11110100 11100010 -0093A 11111101 11110110 11101110 -0096 10101111 11110100 11101010 -0102 10101111 11111101 11111100 -0110 10101110 11111100 11100010 -0115 11111011 11111010 11110100 -0116 11111100 11100001 11110110 -0118 10101110 11111100 11111000 -0120 10101110 11111100 11100010 -0121 10101110 11111100 11100010 -0122 10101110 11111011 11111011 -0124A 11111001 11101010 11110100 -0125A 11111001 11110000 11101111 -0126 11111010 11100011 11111110 -0126A 11111001 11101111 11110000 -0127A 10101110 11111000 11111001 -0128 11111111 11100011 11101011 -0129 11111111 11100011 11101011 -0130 11111111 11100011 11101100 -0134 10101110 11110100 11100001 -0136 10101110 11110100 11100010 -0139 11111100 11100110 11110000 -0142 11111110 11100111 11101110 -0143 11111101 11111101 11101101 -0144 11111101 11101000 11101101 -0146 11111011 11100101 11101110 -0147 11111011 11110001 11110001 -0148 11111011 11100101 11110000 -0153 11111011 11110101 11110001 -0157 11111000 11101011 11110101 -0158 11111000 11110000 11110000 -0159 11111000 11101011 11110101 -0162 11111110 11110001 11110000 -0163 11111110 11110010 11110000 -0165 10101101 11110100 11100110 -0166 10101101 11110100 11101110 -0169B 11111001 11011100 11011111 -0175 10101100 11111100 11101001 -0176 10101100 11111100 11110001 -0179A 11111001 11001000 11101110 -0180 11111100 11001010 11111111 -0181A 11111001 11001000 11101110 -0184 11111000 11110011 11101111 -0186 10101100 11111000 11111110 -0196 11101011 11110011 11101001 -0197A 10101011 11111001 11101100 -5023 11111011 11101101 11111010 - ..... .. .. -unknown 11111111 11110110 10111110 (Shinobi 16A, part no. unreadable, could be dead) -dead 00001111 00001111 00001111 (Alien Storm CPU with no battery) -bad 11100000 10101011 10111001 (flaky 317-0049) - -based on MAME FD1094 sources by Nicola Salmoria, Andreas Naive, Charles MacDonald - -*****************************************************************************/ - -#include "burnint.h" -#include "fd1094.h" -#include "bitswap.h" - -#define BIT(x,n) (((x)>>(n))&1) -#define FALSE 0 -#define TRUE 1 -#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0])) - -/* -317-0162 CPU also needs to mask: -0x107a, -0x127a, -0x147a, -0x167a, -0x187a, -0x1a7a, -0x1c7a, -0x1e7a, -this only happens with 317-0162 so far; I assume it is a fault in the CPU. -*/ -static const UINT16 masked_opcodes[] = -{ - 0x013a,0x033a,0x053a,0x073a,0x083a,0x093a,0x0b3a,0x0d3a,0x0f3a, - - 0x103a, 0x10ba,0x10fa, 0x113a,0x117a,0x11ba,0x11fa, - 0x123a, 0x12ba,0x12fa, 0x133a,0x137a,0x13ba,0x13fa, - 0x143a, 0x14ba,0x14fa, 0x153a,0x157a,0x15ba, - 0x163a, 0x16ba,0x16fa, 0x173a,0x177a,0x17ba, - 0x183a, 0x18ba,0x18fa, 0x193a,0x197a,0x19ba, - 0x1a3a, 0x1aba,0x1afa, 0x1b3a,0x1b7a,0x1bba, - 0x1c3a, 0x1cba,0x1cfa, 0x1d3a,0x1d7a,0x1dba, - 0x1e3a, 0x1eba,0x1efa, 0x1f3a,0x1f7a,0x1fba, - - 0x203a,0x207a,0x20ba,0x20fa, 0x213a,0x217a,0x21ba,0x21fa, - 0x223a,0x227a,0x22ba,0x22fa, 0x233a,0x237a,0x23ba,0x23fa, - 0x243a,0x247a,0x24ba,0x24fa, 0x253a,0x257a,0x25ba, - 0x263a,0x267a,0x26ba,0x26fa, 0x273a,0x277a,0x27ba, - 0x283a,0x287a,0x28ba,0x28fa, 0x293a,0x297a,0x29ba, - 0x2a3a,0x2a7a,0x2aba,0x2afa, 0x2b3a,0x2b7a,0x2bba, - 0x2c3a,0x2c7a,0x2cba,0x2cfa, 0x2d3a,0x2d7a,0x2dba, - 0x2e3a,0x2e7a,0x2eba,0x2efa, 0x2f3a,0x2f7a,0x2fba, - - 0x303a,0x307a,0x30ba,0x30fa, 0x313a,0x317a,0x31ba,0x31fa, - 0x323a,0x327a,0x32ba,0x32fa, 0x333a,0x337a,0x33ba,0x33fa, - 0x343a,0x347a,0x34ba,0x34fa, 0x353a,0x357a,0x35ba, - 0x363a,0x367a,0x36ba,0x36fa, 0x373a,0x377a,0x37ba, - 0x383a,0x387a,0x38ba,0x38fa, 0x393a,0x397a,0x39ba, - 0x3a3a,0x3a7a,0x3aba,0x3afa, 0x3b3a,0x3b7a,0x3bba, - 0x3c3a,0x3c7a,0x3cba,0x3cfa, 0x3d3a,0x3d7a,0x3dba, - 0x3e3a,0x3e7a,0x3eba,0x3efa, 0x3f3a,0x3f7a,0x3fba, - - 0x41ba,0x43ba,0x44fa,0x45ba,0x46fa,0x47ba,0x49ba,0x4bba,0x4cba,0x4cfa,0x4dba,0x4fba, - - 0x803a,0x807a,0x80ba,0x80fa, 0x81fa, - 0x823a,0x827a,0x82ba,0x82fa, 0x83fa, - 0x843a,0x847a,0x84ba,0x84fa, 0x85fa, - 0x863a,0x867a,0x86ba,0x86fa, 0x87fa, - 0x883a,0x887a,0x88ba,0x88fa, 0x89fa, - 0x8a3a,0x8a7a,0x8aba,0x8afa, 0x8bfa, - 0x8c3a,0x8c7a,0x8cba,0x8cfa, 0x8dfa, - 0x8e3a,0x8e7a,0x8eba,0x8efa, 0x8ffa, - - 0x903a,0x907a,0x90ba,0x90fa, 0x91fa, - 0x923a,0x927a,0x92ba,0x92fa, 0x93fa, - 0x943a,0x947a,0x94ba,0x94fa, 0x95fa, - 0x963a,0x967a,0x96ba,0x96fa, 0x97fa, - 0x983a,0x987a,0x98ba,0x98fa, 0x99fa, - 0x9a3a,0x9a7a,0x9aba,0x9afa, 0x9bfa, - 0x9c3a,0x9c7a,0x9cba,0x9cfa, 0x9dfa, - 0x9e3a,0x9e7a,0x9eba,0x9efa, 0x9ffa, - - 0xb03a,0xb07a,0xb0ba,0xb0fa, 0xb1fa, - 0xb23a,0xb27a,0xb2ba,0xb2fa, 0xb3fa, - 0xb43a,0xb47a,0xb4ba,0xb4fa, 0xb5fa, - 0xb63a,0xb67a,0xb6ba,0xb6fa, 0xb7fa, - 0xb83a,0xb87a,0xb8ba,0xb8fa, 0xb9fa, - 0xba3a,0xba7a,0xbaba,0xbafa, 0xbbfa, - 0xbc3a,0xbc7a,0xbcba,0xbcfa, 0xbdfa, - 0xbe3a,0xbe7a,0xbeba,0xbefa, 0xbffa, - - 0xc03a,0xc07a,0xc0ba,0xc0fa, 0xc1fa, - 0xc23a,0xc27a,0xc2ba,0xc2fa, 0xc3fa, - 0xc43a,0xc47a,0xc4ba,0xc4fa, 0xc5fa, - 0xc63a,0xc67a,0xc6ba,0xc6fa, 0xc7fa, - 0xc83a,0xc87a,0xc8ba,0xc8fa, 0xc9fa, - 0xca3a,0xca7a,0xcaba,0xcafa, 0xcbfa, - 0xcc3a,0xcc7a,0xccba,0xccfa, 0xcdfa, - 0xce3a,0xce7a,0xceba,0xcefa, 0xcffa, - - 0xd03a,0xd07a,0xd0ba,0xd0fa, 0xd1fa, - 0xd23a,0xd27a,0xd2ba,0xd2fa, 0xd3fa, - 0xd43a,0xd47a,0xd4ba,0xd4fa, 0xd5fa, - 0xd63a,0xd67a,0xd6ba,0xd6fa, 0xd7fa, - 0xd83a,0xd87a,0xd8ba,0xd8fa, 0xd9fa, - 0xda3a,0xda7a,0xdaba,0xdafa, 0xdbfa, - 0xdc3a,0xdc7a,0xdcba,0xdcfa, 0xddfa, - 0xde3a,0xde7a,0xdeba,0xdefa, 0xdffa -}; - -static UINT8 masked_opcodes_lookup[2][65536/8/2]; -static UINT8 masked_opcodes_created = FALSE; - -static INT32 final_decrypt(INT32 i,INT32 moreffff) -{ - UINT32 j; - - /* final "obfuscation": invert bits 7 and 14 following a fixed pattern */ - INT32 dec = i; - if ((i & 0xf080) == 0x8000) dec ^= 0x0080; - if ((i & 0xf080) == 0xc080) dec ^= 0x0080; - if ((i & 0xb080) == 0x8000) dec ^= 0x4000; - if ((i & 0xb100) == 0x0000) dec ^= 0x4000; - - /* mask out opcodes doing PC-relative addressing, replace them with FFFF */ - if (!masked_opcodes_created) - { - masked_opcodes_created = TRUE; - for (j = 0; j < ARRAY_LENGTH(masked_opcodes); j++) - { - UINT16 opcode = masked_opcodes[j]; - masked_opcodes_lookup[0][opcode >> 4] |= 1 << ((opcode >> 1) & 7); - masked_opcodes_lookup[1][opcode >> 4] |= 1 << ((opcode >> 1) & 7); - } - for (j = 0; j < 65536; j += 2) - { - if ((j & 0xff80) == 0x4e80 || (j & 0xf0f8) == 0x50c8 || (j & 0xf000) == 0x6000) - masked_opcodes_lookup[1][j >> 4] |= 1 << ((j >> 1) & 7); - } - } - - if ((masked_opcodes_lookup[moreffff][dec >> 4] >> ((dec >> 1) & 7)) & 1) - dec = 0xffff; - - return BURN_ENDIAN_SWAP_INT16(dec); -} - - -/* note: address is the word offset (physical address / 2) */ -static INT32 decode(INT32 address,INT32 val,UINT8 *main_key,INT32 gkey1,INT32 gkey2,INT32 gkey3,INT32 vector_fetch) -{ - INT32 mainkey,key_F,key_6a,key_7a,key_6b; - INT32 key_0a,key_0b,key_0c; - INT32 key_1a,key_1b,key_2a,key_2b,key_3a,key_3b,key_4a,key_4b,key_5a,key_5b; - INT32 global_xor0,global_xor1; - INT32 global_swap0a,global_swap1,global_swap2,global_swap3,global_swap4; - INT32 global_swap0b; - - - /* for address xx0000-xx0006 (but only if >= 000008), use key xx2000-xx2006 */ - if ((address & 0x0ffc) == 0 && address >= 4) - mainkey = main_key[(address & 0x1fff) | 0x1000]; - else - mainkey = main_key[address & 0x1fff]; - - if (address & 0x1000) key_F = BIT(mainkey,7); - else key_F = BIT(mainkey,6); - - /* the CPU has been verified to produce different results when fetching opcodes - from 0000-0006 than when fetching the inital SP and PC on reset. */ - if (vector_fetch) - { - if (address <= 3) gkey3 = 0x00; // supposed to always be the case - if (address <= 2) gkey2 = 0x00; - if (address <= 1) gkey1 = 0x00; - if (address <= 1) key_F = 0; - } - - global_xor0 = 1^BIT(gkey1,5); // could be bit 7 - global_xor1 = 1^BIT(gkey1,2); - global_swap2 = 1^BIT(gkey1,0); - - global_swap0a = 1^BIT(gkey2,5); - global_swap0b = 1^BIT(gkey2,2); - - global_swap3 = 1^BIT(gkey3,6); - global_swap1 = 1^BIT(gkey3,4); - global_swap4 = 1^BIT(gkey3,2); - - key_0a = BIT(mainkey,0) ^ BIT(gkey3,1); - key_0b = BIT(mainkey,0) ^ BIT(gkey1,7); // could be bit 5 - key_0c = BIT(mainkey,0) ^ BIT(gkey1,1); - - key_1a = BIT(mainkey,1) ^ BIT(gkey2,7); - key_1b = BIT(mainkey,1) ^ BIT(gkey1,3); - - key_2a = BIT(mainkey,2) ^ BIT(gkey3,7); - key_2b = BIT(mainkey,2) ^ BIT(gkey1,4); - - key_3a = BIT(mainkey,3) ^ BIT(gkey2,0); - key_3b = BIT(mainkey,3) ^ BIT(gkey3,3); - - key_4a = BIT(mainkey,4) ^ BIT(gkey2,3); - key_4b = BIT(mainkey,4) ^ BIT(gkey3,0); - - key_5a = BIT(mainkey,5) ^ BIT(gkey3,5); - key_5b = BIT(mainkey,5) ^ BIT(gkey1,6); - - key_6a = BIT(mainkey,6) ^ BIT(gkey2,1); - key_6b = BIT(mainkey,6) ^ BIT(gkey2,6); - - key_7a = BIT(mainkey,7) ^ BIT(gkey2,4); - - - if ((val & 0xe000) == 0x0000) - val = BITSWAP16(val, 12,15,14,13,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); - else - { - if (val & 0x8000) - { - if (!global_xor1) if (~val & 0x0008) val ^= 0x2410; // 13,10,4 - if (~val & 0x0004) val ^= 0x0022; // 5,1 - if (!key_1b) if (~val & 0x1000) val ^= 0x0848; // 11,6,3 - if (!global_swap2) if (!key_0c) val ^= 0x4101; // 14,8,0 - if (!key_2b) val = BITSWAP16(val, 15,14,13, 9,11,10,12, 8, 2, 6, 5, 4, 3, 7, 1, 0); // 12,9,7,2 - - val = 0x6561 ^ BITSWAP16(val, 15, 9,10,13, 3,12, 0,14, 6, 5, 2,11, 8, 1, 4, 7); - } - if (val & 0x4000) - { - if (!global_xor0) if (val & 0x0800) val ^= 0x9048; // 15,12,6,3 - if (!key_3a) if (val & 0x0004) val ^= 0x0202; // 9,1 - if (!key_6a) if (val & 0x0400) val ^= 0x0004; // 2 - if (!key_5b) if (!key_0b) val ^= 0x08a1; // 11,7,5,0 - if (!global_swap0b) val = BITSWAP16(val, 15,14,10,12,11,13, 9, 4, 7, 6, 5, 8, 3, 2, 1, 0); // 13,10,8,4 - - val = 0x3523 ^ BITSWAP16(val, 13,14, 7, 0, 8, 6, 4, 2, 1,15, 3,11,12,10, 5, 9); - } - if (val & 0x2000) - { - if (!key_4a) if (val & 0x0100) val ^= 0x4210; // 14,9,4 - if (!key_1a) if (val & 0x0040) val ^= 0x0080; // 7 - if (!key_7a) if (val & 0x0001) val ^= 0x110a; // 12,8,3,1 - if (!key_4b) if (!key_0a) val ^= 0x0040; // 6 - if (!global_swap0a) if (!key_6b) val ^= 0x0404; // 10,2 - if (!key_5b) val = BITSWAP16(val, 0,14,13,12,15,10, 9, 8, 7, 6,11, 4, 3, 2, 1, 5); // 15,11,5,0 - - val = 0x99a5 ^ BITSWAP16(val, 10, 2,13, 7, 8, 0, 3,14, 6,15, 1,11, 9, 4, 5,12); - } - - val = 0x87ff ^ BITSWAP16(val, 5,15,13,14, 6, 0, 9,10, 4,11, 1, 2,12, 3, 7, 8); - - if (!global_swap4) val = BITSWAP16(val, 6,14,13,12,11,10, 9, 5, 7,15, 8, 4, 3, 2, 1, 0); // 15-6, 8-5 - if (!global_swap3) val = BITSWAP16(val, 15,12,14,13,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); // 12-13-14 - if (!global_swap2) val = BITSWAP16(val, 15,14,13,12,11, 2, 9, 8,10, 6, 5, 4, 3, 0, 1, 7); // 10-2-0-7 - if (!key_3b) val = BITSWAP16(val, 15,14,13,12,11,10, 4, 8, 7, 6, 5, 9, 1, 2, 3, 0); // 9-4, 3-1 - - if (!key_2a) val = BITSWAP16(val, 15,12,13,14,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); // 14-12 - if (!global_swap1) val = BITSWAP16(val, 15,14,13,12, 9, 8,11,10, 7, 6, 5, 4, 3, 2, 1, 0); // 11...8 - if (!key_5a) val = BITSWAP16(val, 15,14,13,12,11,10, 9, 8, 4, 5, 7, 6, 3, 2, 1, 0); // 7...4 - if (!global_swap0a) val = BITSWAP16(val, 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 0, 3, 2, 1); // 3...0 - } - - return final_decrypt(val,key_F); -} - - -static INT32 global_key1,global_key2,global_key3; - -INT32 fd1094_decode(INT32 address,INT32 val,UINT8 *key,INT32 vector_fetch) -{ - if (!key) return 0; - - return decode(address,BURN_ENDIAN_SWAP_INT16(val),key,global_key1,global_key2,global_key3,vector_fetch); -} - -INT32 fd1094_set_state(UINT8 *key,INT32 state) -{ - static INT32 selected_state,irq_mode; - - if (!key) return 0; - - switch (state & 0x300) - { - case 0x0000: // 0x00xx: select state xx - selected_state = state & 0xff; - break; - - case FD1094_STATE_RESET: // 0x01xx: select state xx and exit irq mode - selected_state = state & 0xff; - irq_mode = 0; - break; - - case FD1094_STATE_IRQ: // 0x02xx: enter irq mode - irq_mode = 1; - break; - - case FD1094_STATE_RTE: // 0x03xx: exit irq mode - irq_mode = 0; - break; - } - - if (irq_mode) - state = key[0]; - else - state = selected_state; - - global_key1 = key[1]; - global_key2 = key[2]; - global_key3 = key[3]; - - if (state & 0x0001) - { - global_key1 ^= 0x04; // global_xor1 - global_key2 ^= 0x80; // key_1a invert - global_key3 ^= 0x80; // key_2a invert - } - if (state & 0x0002) - { - global_key1 ^= 0x01; // global_swap2 - global_key2 ^= 0x10; // key_7a invert - global_key3 ^= 0x01; // key_4b invert - } - if (state & 0x0004) - { - global_key1 ^= 0x80; // key_0b invert - could be 0x20 - global_key2 ^= 0x40; // key_6b invert - global_key3 ^= 0x04; // global_swap4 - } - if (state & 0x0008) - { - global_key1 ^= 0x20; // global_xor0 - could be 0x80 - global_key2 ^= 0x02; // key_6a invert - global_key3 ^= 0x20; // key_5a invert - } - if (state & 0x0010) - { - global_key1 ^= 0x02; // key_0c invert - global_key1 ^= 0x40; // key_5b invert - global_key2 ^= 0x08; // key_4a invert - } - if (state & 0x0020) - { - global_key1 ^= 0x08; // key_1b invert - global_key3 ^= 0x08; // key_3b invert - global_key3 ^= 0x10; // global_swap1 - } - if (state & 0x0040) - { - global_key1 ^= 0x10; // key_2b invert - global_key2 ^= 0x20; // global_swap0a - global_key2 ^= 0x04; // global_swap0b - } - if (state & 0x0080) - { - global_key2 ^= 0x01; // key_3a invert - global_key3 ^= 0x02; // key_0a invert - global_key3 ^= 0x40; // global_swap3 - } - return state & 0xff; -} diff --git a/jan/src/burn/drv/sega/fd1094.h b/jan/src/burn/drv/sega/fd1094.h deleted file mode 100644 index 6a4f1ae17..000000000 --- a/jan/src/burn/drv/sega/fd1094.h +++ /dev/null @@ -1,6 +0,0 @@ -#define FD1094_STATE_RESET 0x0100 -#define FD1094_STATE_IRQ 0x0200 -#define FD1094_STATE_RTE 0x0300 - -INT32 fd1094_set_state(UINT8 *key, INT32 state); -INT32 fd1094_decode(INT32 address, INT32 val, UINT8 *key, INT32 vector_fetch); diff --git a/jan/src/burn/drv/sega/genesis_vid.cpp b/jan/src/burn/drv/sega/genesis_vid.cpp deleted file mode 100644 index 801bb96e8..000000000 --- a/jan/src/burn/drv/sega/genesis_vid.cpp +++ /dev/null @@ -1,909 +0,0 @@ -#include "genesis_vid.h" -#include "burnint.h" - -INT32 GenesisScreenNumber; -UINT32 *GenesisPalette = NULL; -UINT16 GenesisPaletteBase; -UINT8 VdpBgColour; - -UINT8 *VdpVRAM = NULL; -UINT8 *VdpVSRAM = NULL; -UINT16 *VdpTransLookup = NULL; -UINT8 GenesisVdpRegs[32]; -UINT16 GenesisBgPalLookup[4]; -UINT16 GenesisSpPalLookup[4]; -UINT32 VdpScrollABase; -UINT32 VdpScrollBBase; -UINT32 VdpWindowBase; -UINT32 VdpSpriteBase; - -INT32 VdpHScrollMask; -UINT32 VdpHScrollSize; -UINT32 VdpHScrollBase; -UINT8 VdpVScrollMode; - -UINT8 VdpWindowWidth; -UINT8 VdpScrollWidth; -UINT8 VdpScrollHeight; -UINT8 VdpWindowRight; -UINT8 VdpWindowDown; -UINT32 VdpWindowHPos; -UINT32 VdpWindowVPos; - -UINT8 VdpCmdPart; -UINT8 VdpCode; -UINT32 VdpAddress; - -#define VRAM_SIZE 0x10000 -#define VRAM_MASK (VRAM_SIZE - 1) -#define VSRAM_SIZE 0x80 -#define VSRAM_MASK (VSRAM_SIZE - 1) -#define CRAM_SIZE 0x40 - -#define VDP_VRAM_BYTE(x) (VdpVRAM[(x) & VRAM_MASK]) -#define VDP_VSRAM_BYTE(x) (VdpVSRAM[(x) & VSRAM_MASK]) -#define VDP_VRAM_WORD(x) ((VDP_VRAM_BYTE(x) << 8) | VDP_VRAM_BYTE((x) + 1)) -#define VDP_VSRAM_WORD(x) ((VDP_VSRAM_BYTE(x) << 8) | VDP_VSRAM_BYTE((x) + 1)) - -#define EXTRACT_PIXEL(x,i) (((x) >> (((i) ^ 1) * 4)) & 0x0f) - -static void VdpRegisterWrite(INT32 d, INT32 /*vBlank*/) -{ - UINT8 RegNum = (d & 0x1f00) >> 8; - UINT8 RegDat = d & 0x00ff; - - GenesisVdpRegs[RegNum] = RegDat; - - switch (RegNum) { - case 0x01: { - // Video Modes - return; - } - - case 0x02: { - // Scroll A Name Table Base - VdpScrollABase = (RegDat & 0x38) << 10; - return; - } - - case 0x03: { - // Window Name Table Base - VdpWindowBase = (RegDat & 0x3e) << 10; - return; - } - - case 0x04: { - // Scroll B Name Table Base - VdpScrollBBase = (RegDat & 0x07) << 13; - return; - } - - case 0x05: { - // Sprite Table Base - VdpSpriteBase = (RegDat & 0x7e) << 9; - return; - } - - case 0x07: { - // BG Colour - VdpBgColour = RegDat & 0x3f; - return; - } - - case 0x0b: { - // Scroll Modes - static const UINT16 MaskTable[4] = { 0x000, 0x007, 0xff8, 0xfff }; - VdpVScrollMode = (RegDat & 0x04) >> 2; - VdpHScrollMask = MaskTable[RegDat & 3]; - VdpHScrollSize = 4 * ((VdpHScrollMask < 224) ? (VdpHScrollMask + 1) : 224); - return; - } - - case 0x0c: { - // Video Modes - switch (RegDat & 0x81) { - case 0x00: { - // 32 cell - VdpWindowWidth = 32; - return; - } - - case 0x01: { - // 40 cell corrupted - VdpWindowWidth = 64; - return; - } - - case 0x80: { - // illegal - VdpWindowWidth = 64; - return; - } - - case 0x81: { - // 40 cell - VdpWindowWidth = 64; - return; - } - } - return; - } - - case 0x0d: { - // H Scroll Base - VdpHScrollBase = (RegDat & 0x3f) << 10; - return; - } - - case 0x10: { - // Scroll Size - static const UINT8 SizeTable[4] = { 32, 64, 128, 128 }; - VdpScrollWidth = SizeTable[RegDat & 0x03]; - VdpScrollHeight = SizeTable[(RegDat & 0x30) >> 4]; - return; - } - - case 0x11: { - // Window H Pos - VdpWindowRight = RegDat & 0x80; - VdpWindowHPos = (RegDat & 0x1f) << 4; - return; - } - - case 012: { - // Window V Pos - VdpWindowDown = RegDat & 0x80; - VdpWindowVPos = (RegDat & 0x1f) << 3; - return; - } - } -} - -static UINT16 VDPDataRead() -{ - INT32 read = 0; - - VdpCmdPart = 0; - - switch (VdpCode & 0xf) { - case 0x00: { - read = VDP_VRAM_WORD(VdpAddress & ~1); - break; - } - - case 0x04: { - read = VDP_VSRAM_WORD(VdpAddress & ~1); - break; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Genesis VDP Data Read %x\n"), VdpCode); -// } - } - - VdpAddress += GenesisVdpRegs[15]; - return read; -} - -static UINT16 VDPControlRead() -{ - INT32 status = 0x3600; - - VdpCmdPart = 0; - - // If Vblank status |= 0x8 - // if Hblank status |= 0x4 - - return status; -} - -UINT16 GenesisVDPRead(UINT32 offset) -{ - switch(offset) { - case 0x00: - case 0x01: { - return VDPDataRead(); - } - - case 0x02: - case 0x03: { - return VDPControlRead(); - } - } - -// bprintf(PRINT_NORMAL, _T("Genesis VDP Read %x\n"), offset); - - return 0; -} - -static void VDPControlWrite(UINT16 data) -{ - if (!VdpCmdPart) { - if ((data & 0xc000) == 0x8000) { - VdpRegisterWrite(data, 0); - } else { - VdpCode = (VdpCode & 0x3c) | ((data >> 14) & 0x03); - VdpAddress = (VdpAddress & 0xc000) | (data & 0x3fff); - VdpCmdPart = 1; - } - } else { - VdpCode = (VdpCode & 0x03) | ((data >> 2) & 0x3c); - VdpAddress = (VdpAddress & 0x3fff) | ((data << 14) & 0xc000); - VdpCmdPart = 0; - // DMA Stuff here - } -} - -inline static UINT8 pal3bit(UINT8 bits) -{ - bits &= 7; - return (bits << 5) | (bits << 2) | (bits >> 1); -} - -static void VDPDataWrite(UINT16 data) -{ - VdpCmdPart = 0; - - // DMA Stuff here - - switch (VdpCode & 0xf) { - case 0x01: { - if (VdpAddress & 1) data = ((data & 0xff) << 8) | ((data >> 8) & 0xff); - VDP_VRAM_BYTE(VdpAddress & ~1) = data >> 8; - VDP_VRAM_BYTE(VdpAddress | 1 ) = data; - break; - } - - case 0x03: { - INT32 offset = (VdpAddress >> 1) % CRAM_SIZE; - //palette_set_color(Machine, offset + genesis_palette_base, pal3bit(data >> 1), pal3bit(data >> 5), pal3bit(data >> 9)); - //System16Palette[offset + 0x1800 /*GenesisPaletteBase*/] = BurnHighCol(pal3bit(data >> 1), pal3bit(data >> 5), pal3bit(data >> 9), 0); - GenesisPalette[offset + GenesisPaletteBase] = BurnHighCol(pal3bit(data >> 1), pal3bit(data >> 5), pal3bit(data >> 9), 0); - break; - } - - case 0x05: { - if (VdpAddress & 1) data = ((data & 0xff) << 8) | ((data >> 8) & 0xff); - VDP_VSRAM_BYTE(VdpAddress & ~1) = data >> 8; - VDP_VSRAM_BYTE(VdpAddress | 1) = data; - break; - } - -// default: { -// bprintf(PRINT_NORMAL, _T("Genesis VDP Data Write %x\n"), VdpCode); -// } - } - - VdpAddress += GenesisVdpRegs[15]; -} - -void GenesisVDPWrite(UINT32 offset, UINT16 data) -{ - switch (offset) { - case 0x00: - case 0x01: { - VDPDataWrite(data); - return; - } - - case 0x02: - case 0x03: { - VDPControlWrite(data); - return; - } - } - -// bprintf(PRINT_NORMAL, _T("Genesis VDP Write %x\n"), data); -} - -INT32 StartGenesisVDP(INT32 ScreenNum, UINT32* pal) -{ - INT32 i; - static const UINT8 VdpInit[24] = - { - 0x04, 0x44, 0x30, 0x3C, 0x07, 0x6C, 0x00, 0x00, - 0x00, 0x00, 0xFF, 0x00, 0x01, 0x37, 0x00, 0x02, - 0x01, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x80, - }; - - GenesisScreenNumber = ScreenNum; - - GenesisPalette = pal; - - VdpVRAM = (UINT8*)BurnMalloc(VRAM_SIZE); - VdpVSRAM = (UINT8*)BurnMalloc(VSRAM_SIZE); - VdpTransLookup = (UINT16*)BurnMalloc(0x1000 * sizeof(UINT16)); - - memset(VdpVRAM, 0, VRAM_SIZE); - memset(VdpVSRAM, 0, VSRAM_SIZE); - - // Init the transparency lookup table - for (i = 0; i < 0x1000; i++) { - INT32 OriginalColour = i & 0x7ff; - INT32 HalfBright = i & 0x800; - - if (OriginalColour & 0x100) - VdpTransLookup[i] = OriginalColour; - else if (HalfBright) - VdpTransLookup[i] = OriginalColour | 0x800; - else - VdpTransLookup[i] = OriginalColour | 0x1000; - } - - // Reset Palettes - GenesisPaletteBase = 0; - GenesisBgPalLookup[0] = GenesisSpPalLookup[0] = 0x00; - GenesisBgPalLookup[1] = GenesisSpPalLookup[1] = 0x10; - GenesisBgPalLookup[2] = GenesisSpPalLookup[2] = 0x20; - GenesisBgPalLookup[3] = GenesisSpPalLookup[3] = 0x30; - - // Reset VDP - for (i = 0; i < 24; i++) { - VdpRegisterWrite(0x8000 | (i << 8) | VdpInit[i], 1); - } - VdpCmdPart = 0; - VdpCode = 0; - VdpAddress = 0; - - return 0; -} - -void GenesisVDPExit() -{ - BurnFree(VdpVRAM); - BurnFree(VdpVSRAM); - BurnFree(VdpTransLookup); - - memset(GenesisVdpRegs, 0, sizeof(GenesisVdpRegs)); - memset(GenesisBgPalLookup, 0, sizeof(GenesisBgPalLookup)); - memset(GenesisSpPalLookup, 0, sizeof(GenesisSpPalLookup)); - - GenesisPalette = NULL; - - GenesisScreenNumber = 0; - GenesisPaletteBase = 0; - VdpBgColour = 0; - VdpScrollABase = 0; - VdpScrollBBase = 0; - VdpWindowBase = 0; - VdpSpriteBase = 0; - VdpHScrollMask = 0; - VdpHScrollSize = 0; - VdpHScrollBase = 0; - VdpVScrollMode = 0; - VdpWindowWidth = 0; - VdpScrollWidth = 0; - VdpScrollHeight = 0; - VdpWindowRight = 0; - VdpWindowDown = 0; - VdpWindowHPos = 0; - VdpWindowVPos = 0; - VdpCmdPart = 0; - VdpCode = 0; - VdpAddress = 0; -} - -void GenesisVDPScan() -{ - struct BurnArea ba; - - memset(&ba, 0, sizeof(ba)); - ba.Data = VdpVRAM; - ba.nLen = VRAM_SIZE; - ba.szName = "GenVDP VRAM"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = VdpVSRAM; - ba.nLen = VSRAM_SIZE; - ba.szName = "GenVDP VSRAM"; - BurnAcb(&ba); - - ScanVar(GenesisVdpRegs, 32, "GenVDP Regs"); - - SCAN_VAR(VdpBgColour); - SCAN_VAR(VdpScrollABase); - SCAN_VAR(VdpScrollBBase); - SCAN_VAR(VdpWindowBase); - SCAN_VAR(VdpSpriteBase); - SCAN_VAR(VdpHScrollMask); - SCAN_VAR(VdpHScrollSize); - SCAN_VAR(VdpHScrollBase); - SCAN_VAR(VdpVScrollMode); - SCAN_VAR(VdpWindowWidth); - SCAN_VAR(VdpScrollWidth); - SCAN_VAR(VdpScrollHeight); - SCAN_VAR(VdpWindowRight); - SCAN_VAR(VdpWindowDown); - SCAN_VAR(VdpWindowHPos); - SCAN_VAR(VdpWindowVPos); - SCAN_VAR(VdpCmdPart); - SCAN_VAR(VdpCode); - SCAN_VAR(VdpAddress); -} - -inline INT32 vdp_gethscroll(INT32 plane, INT32 line) -{ - line &= VdpHScrollMask; - return 0x400 - (VDP_VRAM_WORD(VdpHScrollBase + (4 * line) + plane) & 0x3ff); -} - - -/* Note: We expect plane = 0 for Scroll A, plane = 2 for Scroll B - A Column is 8 Pixels Wide */ -static INT32 vdp_getvscroll(INT32 plane, INT32 column) -{ - UINT32 vsramoffset; - - switch (VdpVScrollMode) - { - case 0x00: /* Overall Scroll */ - return VDP_VSRAM_WORD(plane) & 0x7ff; - - case 0x01: /* Column Scroll */ - if (column == 40) column = 39; /* Fix Minor Innacuracy Only affects PotoPoto */ - vsramoffset = (4 * (column >> 1)) + plane; - return VDP_VSRAM_WORD(vsramoffset) & 0x7ff; - } - return 0; -} - -static void get_scroll_tiles(UINT32 line, INT32 scrollnum, UINT32 scrollbase, UINT32 *tiles, INT32 *offset) -{ - INT32 linehscroll = vdp_gethscroll(scrollnum, line); - INT32 column; - - /* adjust for partial tiles and then pre-divide hscroll to get the tile offset */ - *offset = -(linehscroll % 8); - linehscroll /= 8; - - /* loop over columns */ - for (column = 0; column < 41; column++) - { - INT32 columnvscroll = vdp_getvscroll(scrollnum, (column - (linehscroll & 1)) & 0x3f) + line; - - /* determine the base of the tilemap row */ - INT32 temp = ((columnvscroll / 8) & (VdpScrollHeight - 1)) * VdpScrollWidth; - INT32 tilebase = scrollbase + 2 * temp; - - /* offset into the tilemap based on the column */ - temp = (linehscroll + column) & (VdpScrollWidth - 1); - tilebase += 2 * temp; - - /* get the tile info */ - *tiles++ = ((columnvscroll % 8) << 16) | VDP_VRAM_WORD(tilebase); - } -} - -static void get_window_tiles(UINT32 line, UINT32 scrollbase, UINT32 *tiles) -{ - INT32 column; - - /* loop over columns */ - for (column = 0; column < 40; column++) - { - /* determine the base of the tilemap row */ - INT32 temp = (line / 8) * VdpWindowWidth + column; - INT32 tilebase = scrollbase + 2 * temp; - - /* get the tile info */ - *tiles++ = ((line % 8) << 16) | VDP_VRAM_WORD(tilebase); - } -} - -static void drawline_tiles(UINT32 *tiles, UINT16 *bmap, UINT32 pri, INT32 offset, INT32 lclip, INT32 rclip) -{ - /* adjust for the 8-pixel slop */ - bmap += offset; - if (lclip > rclip) - return; - - /* loop over columns */ - for ( ; offset < 320; offset += 8, bmap += 8) - { - UINT32 tile = *tiles++; - - /* if the tile is the correct priority, draw it */ - if (((tile >> 15) & 1) == pri && offset < 320) - { - INT32 colbase = GenesisBgPalLookup[(tile & 0x6000) >> 13]; - UINT32 *tp = (UINT32 *)&VDP_VRAM_BYTE((tile & 0x7ff) * 32); - UINT32 mytile; - INT32 col; - - /* vertical flipping */ - if (!(tile & 0x1000)) - mytile = tp[tile >> 16]; - else - mytile = tp[(tile >> 16) ^ 7]; - - /* skip if all-transparent */ - if (!mytile) - continue; - - /* non-clipped */ - if (offset >= lclip && offset <= rclip - 7) - { - /* non-flipped */ - if (!(tile & 0x0800)) - { - col = EXTRACT_PIXEL(mytile, 0); if (col) bmap[0] = colbase + col; - col = EXTRACT_PIXEL(mytile, 1); if (col) bmap[1] = colbase + col; - col = EXTRACT_PIXEL(mytile, 2); if (col) bmap[2] = colbase + col; - col = EXTRACT_PIXEL(mytile, 3); if (col) bmap[3] = colbase + col; - col = EXTRACT_PIXEL(mytile, 4); if (col) bmap[4] = colbase + col; - col = EXTRACT_PIXEL(mytile, 5); if (col) bmap[5] = colbase + col; - col = EXTRACT_PIXEL(mytile, 6); if (col) bmap[6] = colbase + col; - col = EXTRACT_PIXEL(mytile, 7); if (col) bmap[7] = colbase + col; - } - - /* horizontal flip */ - else - { - col = EXTRACT_PIXEL(mytile, 7); if (col) bmap[0] = colbase + col; - col = EXTRACT_PIXEL(mytile, 6); if (col) bmap[1] = colbase + col; - col = EXTRACT_PIXEL(mytile, 5); if (col) bmap[2] = colbase + col; - col = EXTRACT_PIXEL(mytile, 4); if (col) bmap[3] = colbase + col; - col = EXTRACT_PIXEL(mytile, 3); if (col) bmap[4] = colbase + col; - col = EXTRACT_PIXEL(mytile, 2); if (col) bmap[5] = colbase + col; - col = EXTRACT_PIXEL(mytile, 1); if (col) bmap[6] = colbase + col; - col = EXTRACT_PIXEL(mytile, 0); if (col) bmap[7] = colbase + col; - } - } - - /* clipped */ - else if (offset >= lclip - 8 && offset <= rclip) - { - /* non-flipped */ - if (!(tile & 0x0800)) - { - col = EXTRACT_PIXEL(mytile, 0); if (col && (offset + 0) >= lclip && (offset + 0) <= rclip) bmap[0] = colbase + col; - col = EXTRACT_PIXEL(mytile, 1); if (col && (offset + 1) >= lclip && (offset + 1) <= rclip) bmap[1] = colbase + col; - col = EXTRACT_PIXEL(mytile, 2); if (col && (offset + 2) >= lclip && (offset + 2) <= rclip) bmap[2] = colbase + col; - col = EXTRACT_PIXEL(mytile, 3); if (col && (offset + 3) >= lclip && (offset + 3) <= rclip) bmap[3] = colbase + col; - col = EXTRACT_PIXEL(mytile, 4); if (col && (offset + 4) >= lclip && (offset + 4) <= rclip) bmap[4] = colbase + col; - col = EXTRACT_PIXEL(mytile, 5); if (col && (offset + 5) >= lclip && (offset + 5) <= rclip) bmap[5] = colbase + col; - col = EXTRACT_PIXEL(mytile, 6); if (col && (offset + 6) >= lclip && (offset + 6) <= rclip) bmap[6] = colbase + col; - col = EXTRACT_PIXEL(mytile, 7); if (col && (offset + 7) >= lclip && (offset + 7) <= rclip) bmap[7] = colbase + col; - } - - /* horizontal flip */ - else - { - col = EXTRACT_PIXEL(mytile, 7); if (col && (offset + 0) >= lclip && (offset + 0) <= rclip) bmap[0] = colbase + col; - col = EXTRACT_PIXEL(mytile, 6); if (col && (offset + 1) >= lclip && (offset + 1) <= rclip) bmap[1] = colbase + col; - col = EXTRACT_PIXEL(mytile, 5); if (col && (offset + 2) >= lclip && (offset + 2) <= rclip) bmap[2] = colbase + col; - col = EXTRACT_PIXEL(mytile, 4); if (col && (offset + 3) >= lclip && (offset + 3) <= rclip) bmap[3] = colbase + col; - col = EXTRACT_PIXEL(mytile, 3); if (col && (offset + 4) >= lclip && (offset + 4) <= rclip) bmap[4] = colbase + col; - col = EXTRACT_PIXEL(mytile, 2); if (col && (offset + 5) >= lclip && (offset + 5) <= rclip) bmap[5] = colbase + col; - col = EXTRACT_PIXEL(mytile, 1); if (col && (offset + 6) >= lclip && (offset + 6) <= rclip) bmap[6] = colbase + col; - col = EXTRACT_PIXEL(mytile, 0); if (col && (offset + 7) >= lclip && (offset + 7) <= rclip) bmap[7] = colbase + col; - } - } - } - } -} - -static void draw8pixs(UINT16 *bmap, INT32 patno, INT32 /*priority*/, INT32 colbase, INT32 patline) -{ - UINT32 tile = *(UINT32 *)&VDP_VRAM_BYTE(patno * 32 + 4 * patline); - INT32 col; - - /* skip if all-transparent */ - if (!tile) - return; - - /* non-transparent */ - if ((colbase & 0x30) != 0x30 || !(GenesisVdpRegs[12] & 0x08)) - { - col = EXTRACT_PIXEL(tile, 0); if (col) bmap[0] = colbase + col; - col = EXTRACT_PIXEL(tile, 1); if (col) bmap[1] = colbase + col; - col = EXTRACT_PIXEL(tile, 2); if (col) bmap[2] = colbase + col; - col = EXTRACT_PIXEL(tile, 3); if (col) bmap[3] = colbase + col; - col = EXTRACT_PIXEL(tile, 4); if (col) bmap[4] = colbase + col; - col = EXTRACT_PIXEL(tile, 5); if (col) bmap[5] = colbase + col; - col = EXTRACT_PIXEL(tile, 6); if (col) bmap[6] = colbase + col; - col = EXTRACT_PIXEL(tile, 7); if (col) bmap[7] = colbase + col; - } - - /* transparent */ - else - { - col = EXTRACT_PIXEL(tile, 0); - if (col) - { - if (col < 0x0e) bmap[0] = colbase + col; - else bmap[0] = VdpTransLookup[((col & 1) << 11) | (bmap[0] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 1); - if (col) - { - if (col < 0x0e) bmap[1] = colbase + col; - else bmap[1] = VdpTransLookup[((col & 1) << 11) | (bmap[1] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 2); - if (col) - { - if (col < 0x0e) bmap[2] = colbase + col; - else bmap[2] = VdpTransLookup[((col & 1) << 11) | (bmap[2] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 3); - if (col) - { - if (col < 0x0e) bmap[3] = colbase + col; - else bmap[3] = VdpTransLookup[((col & 1) << 11) | (bmap[3] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 4); - if (col) - { - if (col < 0x0e) bmap[4] = colbase + col; - else bmap[4] = VdpTransLookup[((col & 1) << 11) | (bmap[4] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 5); - if (col) - { - if (col < 0x0e) bmap[5] = colbase + col; - else bmap[5] = VdpTransLookup[((col & 1) << 11) | (bmap[5] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 6); - if (col) - { - if (col < 0x0e) bmap[6] = colbase + col; - else bmap[6] = VdpTransLookup[((col & 1) << 11) | (bmap[6] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 7); - if (col) - { - if (col < 0x0e) bmap[7] = colbase + col; - else bmap[7] = VdpTransLookup[((col & 1) << 11) | (bmap[7] & 0x7ff)]; - } - } -} - - -/* draw a horizontally-flipped section of a sprite */ -static void draw8pixs_hflip(UINT16 *bmap, INT32 patno, INT32 /*priority*/, INT32 colbase, INT32 patline) -{ - UINT32 tile = *(UINT32 *)&VDP_VRAM_BYTE(patno * 32 + 4 * patline); - INT32 col; - - /* skip if all-transparent */ - if (!tile) - return; - - /* non-transparent */ - if ((colbase & 0x30) != 0x30 || !(GenesisVdpRegs[12] & 0x08)) - { - col = EXTRACT_PIXEL(tile, 7); if (col) bmap[0] = colbase + col; - col = EXTRACT_PIXEL(tile, 6); if (col) bmap[1] = colbase + col; - col = EXTRACT_PIXEL(tile, 5); if (col) bmap[2] = colbase + col; - col = EXTRACT_PIXEL(tile, 4); if (col) bmap[3] = colbase + col; - col = EXTRACT_PIXEL(tile, 3); if (col) bmap[4] = colbase + col; - col = EXTRACT_PIXEL(tile, 2); if (col) bmap[5] = colbase + col; - col = EXTRACT_PIXEL(tile, 1); if (col) bmap[6] = colbase + col; - col = EXTRACT_PIXEL(tile, 0); if (col) bmap[7] = colbase + col; - } - - /* transparent */ - else - { - col = EXTRACT_PIXEL(tile, 7); - if (col) - { - if (col < 0x0e) bmap[0] = colbase + col; - else bmap[0] = VdpTransLookup[((col & 1) << 11) | (bmap[0] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 6); - if (col) - { - if (col < 0x0e) bmap[1] = colbase + col; - else bmap[1] = VdpTransLookup[((col & 1) << 11) | (bmap[1] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 5); - if (col) - { - if (col < 0x0e) bmap[2] = colbase + col; - else bmap[2] = VdpTransLookup[((col & 1) << 11) | (bmap[2] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 4); - if (col) - { - if (col < 0x0e) bmap[3] = colbase + col; - else bmap[3] = VdpTransLookup[((col & 1) << 11) | (bmap[3] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 3); - if (col) - { - if (col < 0x0e) bmap[4] = colbase + col; - else bmap[4] = VdpTransLookup[((col & 1) << 11) | (bmap[4] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 2); - if (col) - { - if (col < 0x0e) bmap[5] = colbase + col; - else bmap[5] = VdpTransLookup[((col & 1) << 11) | (bmap[5] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 1); - if (col) - { - if (col < 0x0e) bmap[6] = colbase + col; - else bmap[6] = VdpTransLookup[((col & 1) << 11) | (bmap[6] & 0x7ff)]; - } - col = EXTRACT_PIXEL(tile, 0); - if (col) - { - if (col < 0x0e) bmap[7] = colbase + col; - else bmap[7] = VdpTransLookup[((col & 1) << 11) | (bmap[7] & 0x7ff)]; - } - } -} - -static void drawline_sprite(INT32 line, UINT16 *bmap, INT32 priority, UINT8 *spritebase) -{ - INT32 spriteypos = (((spritebase[0] & 0x01) << 8) | spritebase[1]) - 0x80; - INT32 spritexpos = (((spritebase[6] & 0x01) << 8) | spritebase[7]) - 0x80; - INT32 spriteheight = ((spritebase[2] & 0x03) + 1) * 8; - INT32 spritewidth = (((spritebase[2] & 0x0c) >> 2) + 1) * 8; - INT32 spriteattr, patno, patflip, patline, colbase, x; - - /* skip if out of range */ - if (line < spriteypos || line >= spriteypos + spriteheight) - return; - if (spritexpos + spritewidth < 0 || spritexpos >= 320) - return; - - /* extract the remaining data */ - spriteattr = (spritebase[4] << 8) | spritebase[5]; - patno = spriteattr & 0x07FF; - patflip = (spriteattr & 0x1800) >> 11; - patline = line - spriteypos; - - /* determine the color base */ - colbase = GenesisSpPalLookup[(spriteattr & 0x6000) >> 13]; - - /* adjust for the X position */ - spritewidth >>= 3; - spriteheight >>= 3; - - /* switch off the flip mode */ - bmap += spritexpos; - switch (patflip) - { - case 0x00: /* No Flip */ - for (x = 0; x < spritewidth; x++, bmap += 8) - { - if (spritexpos >= -7 && spritexpos < 320) - draw8pixs(bmap, patno, priority, colbase, patline); - spritexpos += 8; - patno += spriteheight; - } - break; - - case 0x01: /* Horizontal Flip */ - patno += spriteheight * (spritewidth - 1); - for (x = 0; x < spritewidth; x++, bmap += 8) - { - if (spritexpos >= -7 && spritexpos < 320) - draw8pixs_hflip(bmap, patno, priority, colbase, patline); - spritexpos += 8; - patno -= spriteheight; - } - break; - - case 0x02: /* Vertical Flip */ - patline = 8 * spriteheight - patline - 1; - for (x = 0; x < spritewidth; x++, bmap += 8) - { - if (spritexpos >= -7 && spritexpos < 320) - draw8pixs(bmap, patno, priority, colbase, patline); - spritexpos += 8; - patno += spriteheight; - } - break; - - case 0x03: /* Both Flip */ - patno += spriteheight * (spritewidth - 1); - patline = 8 * spriteheight - patline - 1; - for (x = 0; x < spritewidth; x++, bmap += 8) - { - if (spritexpos >= -7 && spritexpos < 320) - draw8pixs_hflip(bmap, patno, priority, colbase, patline); - spritexpos += 8; - patno -= spriteheight; - } - break; - } -} - -void vdp_drawline(UINT16 *bitmap, UINT32 line, INT32 bgfill) -{ - INT32 lowsprites, highsprites, link; - UINT32 scrolla_tiles[41], scrollb_tiles[41], window_tiles[41]; - INT32 scrolla_offset, scrollb_offset; - UINT8 *lowlist[81], *highlist[81]; - INT32 bgcolor = bgfill ? bgfill : GenesisBgPalLookup[0]; - INT32 window_lclip, window_rclip; - INT32 scrolla_lclip, scrolla_rclip; - INT32 column, sprite; - - /* clear to the background color */ - for (column = 0; column < 320; column++) - bitmap[column] = bgcolor; - - /* if display is disabled, stop */ - if (!(GenesisVdpRegs[1] & 0x40)) - return; - - /* Sprites need to be Drawn in Reverse order .. may as well sort them here */ - link = lowsprites = highsprites = 0; - for (sprite = 0; sprite < 80; sprite++) - { - UINT8 *spritebase = &VDP_VRAM_BYTE(VdpSpriteBase + 8 * link); - - /* sort into high/low priorities */ - if (spritebase[4] & 0x0080) - highlist[++highsprites] = spritebase; - else - lowlist[++lowsprites] = spritebase; - - /* get the link; if 0, stop processing */ - link = spritebase[3] & 0x7F; - if (!link) - break; - } - - /* get tiles for the B scroll layer */ - get_scroll_tiles(line, 2, VdpScrollBBase, scrollb_tiles, &scrollb_offset); - - /* get tiles for the A scroll layer */ - get_scroll_tiles(line, 0, VdpScrollABase, scrolla_tiles, &scrolla_offset); - - /* get tiles for the window layer */ - get_window_tiles(line, VdpWindowBase, window_tiles); - - /* compute the windowing for this line */ - if ((VdpWindowDown && line >= VdpWindowVPos) || (!VdpWindowDown && line < VdpWindowVPos)) - window_lclip = 0, window_rclip = 320 - 1; - else if (VdpWindowRight) - window_lclip = VdpWindowHPos, window_rclip = 320 - 1; - else - window_lclip = 0, window_rclip = VdpWindowHPos - 1; - - /* compute the clipping of the scroll A layer */ - if (window_lclip == 0) - { - scrolla_lclip = window_rclip + 1; - scrolla_rclip = 320 - 1; - } - else - { - scrolla_lclip = 0; - scrolla_rclip = window_lclip - 1; - } - - /* Scroll B Low */ - drawline_tiles(scrollb_tiles, bitmap, 0, scrollb_offset, 0, 320 - 1); - - /* Scroll A Low */ - drawline_tiles(scrolla_tiles, bitmap, 0, scrolla_offset, scrolla_lclip, scrolla_rclip); - - /* Window Low */ - drawline_tiles(window_tiles, bitmap, 0, 0, window_lclip, window_rclip); - - /* Sprites Low */ - for (sprite = lowsprites; sprite > 0; sprite--) - drawline_sprite(line, bitmap, 0, lowlist[sprite]); - - /* Scroll B High */ - drawline_tiles(scrollb_tiles, bitmap, 1, scrollb_offset, 0, 320 - 1); - - /* Scroll A High */ - drawline_tiles(scrolla_tiles, bitmap, 1, scrolla_offset, scrolla_lclip, scrolla_rclip); - - /* Window High */ - drawline_tiles(window_tiles, bitmap, 1, 0, window_lclip, window_rclip); - - /* Sprites High */ - for (sprite = highsprites; sprite > 0; sprite--) - drawline_sprite(line, bitmap, 1, highlist[sprite]); -} diff --git a/jan/src/burn/drv/sega/genesis_vid.h b/jan/src/burn/drv/sega/genesis_vid.h deleted file mode 100644 index e81ccea6d..000000000 --- a/jan/src/burn/drv/sega/genesis_vid.h +++ /dev/null @@ -1,12 +0,0 @@ -#include "driver.h" - -extern UINT16 GenesisPaletteBase; -extern UINT16 GenesisBgPalLookup[4]; -extern UINT16 GenesisSpPalLookup[4]; - -INT32 StartGenesisVDP(INT32 ScreenNum, UINT32* pal); -void GenesisVDPExit(); -void GenesisVDPScan(); -UINT16 GenesisVDPRead(UINT32 offset); -void GenesisVDPWrite(UINT32 offset, UINT16 data); -void vdp_drawline(UINT16 *bitmap, UINT32 line, INT32 bgfill); diff --git a/jan/src/burn/drv/sega/mc8123.cpp b/jan/src/burn/drv/sega/mc8123.cpp deleted file mode 100644 index 471424d68..000000000 --- a/jan/src/burn/drv/sega/mc8123.cpp +++ /dev/null @@ -1,335 +0,0 @@ -// Based on MAME sources by Nicola Salmoria, David Widel - -#include "burnint.h" -#include "bitswap.h" - -static INT32 decrypt_type0(INT32 val,INT32 param,INT32 swap) -{ - if (swap == 0) val = BITSWAP08(val,7,5,3,1,2,0,6,4); - if (swap == 1) val = BITSWAP08(val,5,3,7,2,1,0,4,6); - if (swap == 2) val = BITSWAP08(val,0,3,4,6,7,1,5,2); - if (swap == 3) val = BITSWAP08(val,0,7,3,2,6,4,1,5); - - if (BIT(param,3) && BIT(val,7)) - val ^= (1<<5)|(1<<3)|(1<<0); - - if (BIT(param,2) && BIT(val,6)) - val ^= (1<<7)|(1<<2)|(1<<1); - - if (BIT(val,6)) val ^= (1<<7); - - if (BIT(param,1) && BIT(val,7)) - val ^= (1<<6); - - if (BIT(val,2)) val ^= (1<<5)|(1<<0); - - val ^= (1<<4)|(1<<3)|(1<<1); - - if (BIT(param,2)) val ^= (1<<5)|(1<<2)|(1<<0); - if (BIT(param,1)) val ^= (1<<7)|(1<<6); - if (BIT(param,0)) val ^= (1<<5)|(1<<0); - - if (BIT(param,0)) val = BITSWAP08(val,7,6,5,1,4,3,2,0); - - return val; -} - - -static INT32 decrypt_type1a(INT32 val,INT32 param,INT32 swap) -{ - if (swap == 0) val = BITSWAP08(val,4,2,6,5,3,7,1,0); - if (swap == 1) val = BITSWAP08(val,6,0,5,4,3,2,1,7); - if (swap == 2) val = BITSWAP08(val,2,3,6,1,4,0,7,5); - if (swap == 3) val = BITSWAP08(val,6,5,1,3,2,7,0,4); - - if (BIT(param,2)) val = BITSWAP08(val,7,6,1,5,3,2,4,0); - - if (BIT(val,1)) val ^= (1<<0); - if (BIT(val,6)) val ^= (1<<3); - if (BIT(val,7)) val ^= (1<<6)|(1<<3); - if (BIT(val,2)) val ^= (1<<6)|(1<<3)|(1<<1); - if (BIT(val,4)) val ^= (1<<7)|(1<<6)|(1<<2); - - if (BIT(val,7) ^ BIT(val,2)) - val ^= (1<<4); - - val ^= (1<<6)|(1<<3)|(1<<1)|(1<<0); - - if (BIT(param,3)) val ^= (1<<7)|(1<<2); - if (BIT(param,1)) val ^= (1<<6)|(1<<3); - - if (BIT(param,0)) val = BITSWAP08(val,7,6,1,4,3,2,5,0); - - return val; -} - -static INT32 decrypt_type1b(INT32 val,INT32 param,INT32 swap) -{ - if (swap == 0) val = BITSWAP08(val,1,0,3,2,5,6,4,7); - if (swap == 1) val = BITSWAP08(val,2,0,5,1,7,4,6,3); - if (swap == 2) val = BITSWAP08(val,6,4,7,2,0,5,1,3); - if (swap == 3) val = BITSWAP08(val,7,1,3,6,0,2,5,4); - - if (BIT(val,2) && BIT(val,0)) - val ^= (1<<7)|(1<<4); - - if (BIT(val,7)) val ^= (1<<2); - if (BIT(val,5)) val ^= (1<<7)|(1<<2); - if (BIT(val,1)) val ^= (1<<5); - if (BIT(val,6)) val ^= (1<<1); - if (BIT(val,4)) val ^= (1<<6)|(1<<5); - if (BIT(val,0)) val ^= (1<<6)|(1<<2)|(1<<1); - if (BIT(val,3)) val ^= (1<<7)|(1<<6)|(1<<2)|(1<<1)|(1<<0); - - val ^= (1<<6)|(1<<4)|(1<<0); - - if (BIT(param,3)) val ^= (1<<4)|(1<<1); - if (BIT(param,2)) val ^= (1<<7)|(1<<6)|(1<<3)|(1<<0); - if (BIT(param,1)) val ^= (1<<4)|(1<<3); - if (BIT(param,0)) val ^= (1<<6)|(1<<2)|(1<<1)|(1<<0); - - return val; -} - -static INT32 decrypt_type2a(INT32 val,INT32 param,INT32 swap) -{ - if (swap == 0) val = BITSWAP08(val,0,1,4,3,5,6,2,7); - if (swap == 1) val = BITSWAP08(val,6,3,0,5,7,4,1,2); - if (swap == 2) val = BITSWAP08(val,1,6,4,5,0,3,7,2); - if (swap == 3) val = BITSWAP08(val,4,6,7,5,2,3,1,0); - - if (BIT(val,3) || (BIT(param,1) && BIT(val,2))) - val = BITSWAP08(val,6,0,7,4,3,2,1,5); - - if (BIT(val,5)) val ^= (1<<7); - if (BIT(val,6)) val ^= (1<<5); - if (BIT(val,0)) val ^= (1<<6); - if (BIT(val,4)) val ^= (1<<3)|(1<<0); - if (BIT(val,1)) val ^= (1<<2); - - val ^= (1<<7)|(1<<6)|(1<<5)|(1<<4)|(1<<1); - - if (BIT(param,2)) val ^= (1<<4)|(1<<3)|(1<<2)|(1<<1)|(1<<0); - - if (BIT(param,3)) - { - if (BIT(param,0)) - val = BITSWAP08(val,7,6,5,3,4,1,2,0); - else - val = BITSWAP08(val,7,6,5,1,2,4,3,0); - } - else - { - if (BIT(param,0)) - val = BITSWAP08(val,7,6,5,2,1,3,4,0); - } - - return val; -} - -static INT32 decrypt_type2b(INT32 val,INT32 param,INT32 swap) -{ - // only 0x20 possible encryptions for this method - all others have 0x40 - // this happens because BIT(param,2) cancels the other three - - if (swap == 0) val = BITSWAP08(val,1,3,4,6,5,7,0,2); - if (swap == 1) val = BITSWAP08(val,0,1,5,4,7,3,2,6); - if (swap == 2) val = BITSWAP08(val,3,5,4,1,6,2,0,7); - if (swap == 3) val = BITSWAP08(val,5,2,3,0,4,7,6,1); - - if (BIT(val,7) && BIT(val,3)) - val ^= (1<<6)|(1<<4)|(1<<0); - - if (BIT(val,7)) val ^= (1<<2); - if (BIT(val,5)) val ^= (1<<7)|(1<<3); - if (BIT(val,1)) val ^= (1<<5); - if (BIT(val,4)) val ^= (1<<7)|(1<<5)|(1<<3)|(1<<1); - - if (BIT(val,7) && BIT(val,5)) - val ^= (1<<4)|(1<<0); - - if (BIT(val,5) && BIT(val,1)) - val ^= (1<<4)|(1<<0); - - if (BIT(val,6)) val ^= (1<<7)|(1<<5); - if (BIT(val,3)) val ^= (1<<7)|(1<<6)|(1<<5)|(1<<1); - if (BIT(val,2)) val ^= (1<<3)|(1<<1); - - val ^= (1<<7)|(1<<3)|(1<<2)|(1<<1); - - if (BIT(param,3)) val ^= (1<<6)|(1<<3)|(1<<1); - if (BIT(param,2)) val ^= (1<<7)|(1<<6)|(1<<5)|(1<<3)|(1<<2)|(1<<1); // same as the other three combined - if (BIT(param,1)) val ^= (1<<7); - if (BIT(param,0)) val ^= (1<<5)|(1<<2); - - return val; -} - -static INT32 decrypt_type3a(INT32 val,INT32 param,INT32 swap) -{ - if (swap == 0) val = BITSWAP08(val,5,3,1,7,0,2,6,4); - if (swap == 1) val = BITSWAP08(val,3,1,2,5,4,7,0,6); - if (swap == 2) val = BITSWAP08(val,5,6,1,2,7,0,4,3); - if (swap == 3) val = BITSWAP08(val,5,6,7,0,4,2,1,3); - - if (BIT(val,2)) val ^= (1<<7)|(1<<5)|(1<<4); - if (BIT(val,3)) val ^= (1<<0); - - if (BIT(param,0)) val = BITSWAP08(val,7,2,5,4,3,1,0,6); - - if (BIT(val,1)) val ^= (1<<6)|(1<<0); - if (BIT(val,3)) val ^= (1<<4)|(1<<2)|(1<<1); - - if (BIT(param,3)) val ^= (1<<4)|(1<<3); - - if (BIT(val,3)) val = BITSWAP08(val,5,6,7,4,3,2,1,0); - - if (BIT(val,5)) val ^= (1<<2)|(1<<1); - - val ^= (1<<6)|(1<<5)|(1<<4)|(1<<3); - - if (BIT(param,2)) val ^= (1<<7); - if (BIT(param,1)) val ^= (1<<4); - if (BIT(param,0)) val ^= (1<<0); - - return val; -} - -static INT32 decrypt_type3b(INT32 val,INT32 param,INT32 swap) -{ - if (swap == 0) val = BITSWAP08(val,3,7,5,4,0,6,2,1); - if (swap == 1) val = BITSWAP08(val,7,5,4,6,1,2,0,3); - if (swap == 2) val = BITSWAP08(val,7,4,3,0,5,1,6,2); - if (swap == 3) val = BITSWAP08(val,2,6,4,1,3,7,0,5); - - if (BIT(val,2)) val ^= (1<<7); - - if (BIT(val,7)) val = BITSWAP08(val,7,6,3,4,5,2,1,0); - - if (BIT(param,3)) val ^= (1<<7); - - if (BIT(val,4)) val ^= (1<<6); - if (BIT(val,1)) val ^= (1<<6)|(1<<4)|(1<<2); - - if (BIT(val,7) && BIT(val,6)) - val ^= (1<<1); - - if (BIT(val,7)) val ^= (1<<1); - - if (BIT(param,3)) val ^= (1<<7); - if (BIT(param,2)) val ^= (1<<0); - - if (BIT(param,3)) val = BITSWAP08(val,4,6,3,2,5,0,1,7); - - if (BIT(val,4)) val ^= (1<<1); - if (BIT(val,5)) val ^= (1<<4); - if (BIT(val,7)) val ^= (1<<2); - - val ^= (1<<5)|(1<<3)|(1<<2); - - if (BIT(param,1)) val ^= (1<<7); - if (BIT(param,0)) val ^= (1<<3); - - return val; -} - -static INT32 decrypt(INT32 val, INT32 key, INT32 opcode) -{ - INT32 type = 0; - INT32 swap = 0; - INT32 param = 0; - - key ^= 0xff; - - // no encryption - if (key == 0x00) - return val; - - type ^= BIT(key,0) << 0; - type ^= BIT(key,2) << 0; - type ^= BIT(key,0) << 1; - type ^= BIT(key,1) << 1; - type ^= BIT(key,2) << 1; - type ^= BIT(key,4) << 1; - type ^= BIT(key,4) << 2; - type ^= BIT(key,5) << 2; - - swap ^= BIT(key,0) << 0; - swap ^= BIT(key,1) << 0; - swap ^= BIT(key,2) << 1; - swap ^= BIT(key,3) << 1; - - param ^= BIT(key,0) << 0; - param ^= BIT(key,0) << 1; - param ^= BIT(key,2) << 1; - param ^= BIT(key,3) << 1; - param ^= BIT(key,0) << 2; - param ^= BIT(key,1) << 2; - param ^= BIT(key,6) << 2; - param ^= BIT(key,1) << 3; - param ^= BIT(key,6) << 3; - param ^= BIT(key,7) << 3; - - if (!opcode) - { - param ^= 1 << 0; - type ^= 1 << 0; - } - - switch (type) - { - default: - case 0: return decrypt_type0(val,param,swap); - case 1: return decrypt_type0(val,param,swap); - case 2: return decrypt_type1a(val,param,swap); - case 3: return decrypt_type1b(val,param,swap); - case 4: return decrypt_type2a(val,param,swap); - case 5: return decrypt_type2b(val,param,swap); - case 6: return decrypt_type3a(val,param,swap); - case 7: return decrypt_type3b(val,param,swap); - } -} - -static UINT8 mc8123_decrypt(INT32 addr,UINT8 val,const UINT8 *key,INT32 opcode) -{ - INT32 tbl_num; - - /* pick the translation table from bits fd57 of the address */ - tbl_num = (addr & 7) + ((addr & 0x10)>>1) + ((addr & 0x40)>>2) + ((addr & 0x100)>>3) + ((addr & 0xc00)>>4) + ((addr & 0xf000)>>4) ; - - return decrypt(val,key[tbl_num + (opcode ? 0 : 0x1000)],opcode); -} - -void mc8123_decrypt_rom(INT32 /*banknum*/, INT32 numbanks, UINT8 *pRom, UINT8 *pFetch, UINT8 *pKey) -{ - UINT8 *decrypted1 = pFetch; - UINT8 *decrypted2 = numbanks > 1 ? decrypted1 + 0x10000 : decrypted1 + 0x8000; - UINT8 *rom = pRom; - UINT8 *key = pKey; - INT32 A, bank; - - for (A = 0x0000;A < 0x8000;A++) - { - UINT8 src = rom[A]; - - /* decode the opcodes */ - decrypted1[A] = mc8123_decrypt(A,src,key,1); - - /* decode the data */ - rom[A] = mc8123_decrypt(A,src,key,0); - } - - for (bank = 0; bank < numbanks; ++bank) - { - for (A = 0x8000;A < 0xc000;A++) - { - UINT8 src = rom[0x8000 + 0x4000*bank + A]; - - /* decode the opcodes */ - decrypted2[0x4000 * bank + (A-0x8000)] = mc8123_decrypt(A,src,key,1); - - /* decode the data */ - rom[0x8000 + 0x4000*bank + A] = mc8123_decrypt(A,src,key,0); - } - } -} diff --git a/jan/src/burn/drv/sega/mc8123.h b/jan/src/burn/drv/sega/mc8123.h deleted file mode 100644 index 6418dcfad..000000000 --- a/jan/src/burn/drv/sega/mc8123.h +++ /dev/null @@ -1 +0,0 @@ -void mc8123_decrypt_rom(INT32 banknum, INT32 numbanks, UINT8 *pRom, UINT8 *pFetch, UINT8 *pKey); diff --git a/jan/src/burn/drv/sega/sega_315_5195.cpp b/jan/src/burn/drv/sega/sega_315_5195.cpp deleted file mode 100644 index 9b557639d..000000000 --- a/jan/src/burn/drv/sega/sega_315_5195.cpp +++ /dev/null @@ -1,1873 +0,0 @@ -#include "sys16.h" - -#define MAX_MIRRORS 256 -#define LOG_MAPPER 0 - -// Laser Ghost does a write byte of 00 to fe0008 triggering IRQ7 during gun calibration - this trashes the memory map - disable it for now -bool LaserGhost = false; - -typedef struct -{ - UINT8 regs[0x20]; - - UINT32 tile_ram_start, tile_ram_end; - UINT32 tile_ram_start_mirror[MAX_MIRRORS], tile_ram_end_mirror[MAX_MIRRORS]; - UINT32 tile_ram_num_mirrors; - - UINT32 io_start, io_end; - UINT32 io_start_mirror[MAX_MIRRORS], io_end_mirror[MAX_MIRRORS]; - UINT32 io_num_mirrors; - - UINT32 bank_5704_start, bank_5704_end; - UINT32 bank_5704_start_mirror[MAX_MIRRORS], bank_5704_end_mirror[MAX_MIRRORS]; - UINT32 bank_5704_num_mirrors; - - UINT32 korean_sound_start, korean_sound_end; - UINT32 korean_sound_start_mirror[MAX_MIRRORS], korean_sound_end_mirror[MAX_MIRRORS]; - UINT32 korean_sound_num_mirrors; - - UINT32 math1_5797_start, math1_5797_end; - UINT32 math1_5797_start_mirror[MAX_MIRRORS], math1_5797_end_mirror[MAX_MIRRORS]; - UINT32 math1_5797_num_mirrors; - - UINT32 math2_5797_start, math2_5797_end; - UINT32 math2_5797_start_mirror[MAX_MIRRORS], math2_5797_end_mirror[MAX_MIRRORS]; - UINT32 math2_5797_num_mirrors; - - UINT32 genesis_vdp_start, genesis_vdp_end; - UINT32 genesis_vdp_start_mirror[MAX_MIRRORS], genesis_vdp_end_mirror[MAX_MIRRORS]; - UINT32 genesis_vdp_num_mirrors; - - UINT32 bank_5987_start, bank_5987_end; - UINT32 bank_5987_start_mirror[MAX_MIRRORS], bank_5987_end_mirror[MAX_MIRRORS]; - UINT32 bank_5987_num_mirrors; - - UINT32 bank_7525_start, bank_7525_end; - UINT32 bank_7525_start_mirror[MAX_MIRRORS], bank_7525_end_mirror[MAX_MIRRORS]; - UINT32 bank_7525_num_mirrors; - - UINT32 road_ctrl_start, road_ctrl_end; - UINT32 road_ctrl_start_mirror[MAX_MIRRORS], road_ctrl_end_mirror[MAX_MIRRORS]; - UINT32 road_ctrl_num_mirrors; -} sega_315_5195_struct; - -static sega_315_5195_struct chip; - -static bool mapper_in_use = false; -static UINT32 region_start = 0; -static UINT32 region_end = 0; -static UINT32 region_mirror = 0; -static bool open_bus_recurse = false; - -sega_315_5195_custom_io sega_315_5195_custom_io_do = NULL; -sega_315_5195_custom_io_write sega_315_5195_custom_io_write_do = NULL; - -static void compute_region(INT32 index, UINT32 length, UINT32 mirror, UINT32 offset) -{ - static const UINT32 region_size_map[4] = { 0x00ffff, 0x01ffff, 0x07ffff, 0x1fffff }; - - UINT32 size_mask = region_size_map[chip.regs[0x10 + 2 * index] & 3]; - UINT32 base = (chip.regs[0x11 + 2 * index] << 16) & ~size_mask; - mirror = mirror & size_mask; - UINT32 start = base + (offset & size_mask); - - UINT32 final_length = length - 1; - if (size_mask < final_length) final_length = size_mask; - UINT32 end = start + final_length; - - region_start = start; - region_end = end; - region_mirror = mirror; -} - -static void map_mirrors(UINT8 *data, UINT32 start, UINT32 end, UINT32 mirror, UINT32 map_mode) -{ - if (!mirror) return; - - INT32 lmirrorbit[18], lmirrorbits, hmirrorbit[14], hmirrorbits, lmirrorcount, hmirrorcount; - - hmirrorbits = lmirrorbits = 0; - for (INT32 i = 0; i < 18; i++) { - if (mirror & (1 << i)) lmirrorbit[lmirrorbits++] = 1 << i; - } - for (INT32 i = 18; i < 32; i++) { - if (mirror & (1 << i)) hmirrorbit[hmirrorbits++] = 1 << i; - } - - for (hmirrorcount = 0; hmirrorcount < (1 << hmirrorbits); hmirrorcount++) { - INT32 hmirrorbase = 0; - for (INT32 i = 0; i < hmirrorbits; i++) { - if (hmirrorcount & (1 << i)) hmirrorbase |= hmirrorbit[i]; - } - - for (lmirrorcount = 0; lmirrorcount < (1 << lmirrorbits); lmirrorcount++) { - INT32 lmirrorbase = hmirrorbase; - for (INT32 i = 0; i < lmirrorbits; i++) { - if (lmirrorcount & (1 << i)) lmirrorbase |= lmirrorbit[i]; - } - - SekMapMemory(data, start + lmirrorbase, end + lmirrorbase, map_mode); - - if (LOG_MAPPER) bprintf(PRINT_IMPORTANT, _T("MIRROR: %x, %x\n"), start + lmirrorbase, end + lmirrorbase); - } - } -} - -static void store_mirrors(UINT32 *store_start, UINT32* store_end, UINT32 start, UINT32 end, UINT32 mirror, UINT32 *num_mirrors) -{ - if (!mirror) return; - - INT32 lmirrorbit[18], lmirrorbits, hmirrorbit[14], hmirrorbits, lmirrorcount = 0, hmirrorcount; - - hmirrorbits = lmirrorbits = 0; - for (INT32 i = 0; i < 18; i++) { - if (mirror & (1 << i)) lmirrorbit[lmirrorbits++] = 1 << i; - } - for (INT32 i = 18; i < 32; i++) { - if (mirror & (1 << i)) hmirrorbit[hmirrorbits++] = 1 << i; - } - - for (hmirrorcount = 0; hmirrorcount < (1 << hmirrorbits); hmirrorcount++) { - INT32 hmirrorbase = 0; - for (INT32 i = 0; i < hmirrorbits; i++) { - if (hmirrorcount & (1 << i)) hmirrorbase |= hmirrorbit[i]; - } - - for (lmirrorcount = 0; lmirrorcount < (1 << lmirrorbits); lmirrorcount++) { - INT32 lmirrorbase = hmirrorbase; - for (INT32 i = 0; i < lmirrorbits; i++) { - if (lmirrorcount & (1 << i)) lmirrorbase |= lmirrorbit[i]; - } - - store_start[lmirrorcount] = start + lmirrorbase; - store_end[lmirrorcount] = end + lmirrorbase; - - if (LOG_MAPPER) bprintf(PRINT_IMPORTANT, _T("MIRROR %i: %x, %x\n"), lmirrorcount, start + lmirrorbase, end + lmirrorbase); - } - } - - if (lmirrorcount > MAX_MIRRORS) { - *num_mirrors = MAX_MIRRORS; - } else { - *num_mirrors = lmirrorcount; - } -} - -static void update_mapping() -{ - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Remapping\n")); - - SekMapHandler(0, 0x000000, 0xffffff, MAP_RAM); - chip.tile_ram_start = chip.tile_ram_end = 0x000000; - chip.io_start = chip.io_end = 0x000000; - chip.bank_5704_start = chip.bank_5704_end = 0x000000; - chip.korean_sound_start = chip.korean_sound_end = 0x000000; - chip.math1_5797_start = chip.math1_5797_end = 0x000000; - chip.math2_5797_start = chip.math2_5797_end = 0x000000; - chip.genesis_vdp_start = chip.genesis_vdp_end = 0x000000; - chip.bank_5987_start = chip.bank_5987_end = 0x000000; - chip.bank_7525_start = chip.bank_7525_end = 0x000000; - chip.road_ctrl_start = chip.road_ctrl_end = 0x000000; - - chip.tile_ram_num_mirrors = 0; - chip.io_num_mirrors = 0; - chip.bank_5704_num_mirrors = 0; - chip.korean_sound_num_mirrors = 0; - chip.math1_5797_num_mirrors = 0; - chip.math2_5797_num_mirrors = 0; - chip.genesis_vdp_num_mirrors = 0; - chip.bank_5987_num_mirrors = 0; - chip.bank_7525_num_mirrors = 0; - chip.road_ctrl_num_mirrors = 0; - - memset(chip.tile_ram_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.tile_ram_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.io_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.io_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.bank_5704_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.bank_5704_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.korean_sound_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.korean_sound_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.math1_5797_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.math1_5797_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.math2_5797_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.math2_5797_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.genesis_vdp_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.genesis_vdp_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.bank_5987_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.bank_5987_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.bank_7525_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.bank_7525_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.road_ctrl_start_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - memset(chip.road_ctrl_end_mirror, 0, MAX_MIRRORS * sizeof(UINT32)); - - for (INT32 index = 7; index >= 0; index--) { - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) { - switch (index) { - case 7: { - compute_region(index, 0x004000, 0xffc000, 0x000000); - chip.io_start = region_start; - chip.io_end = region_end; - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("IO: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - store_mirrors(chip.io_start_mirror, chip.io_end_mirror, region_start, region_end, region_mirror, &chip.io_num_mirrors); - - break; - } - - case 6: { - compute_region(index, 0x001000, 0xfff000, 0x000000); - SekMapMemory(System16PaletteRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Palette RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16PaletteRam, region_start, region_end, region_mirror, MAP_RAM); - - break; - } - - case 5: { - compute_region(index, 0x001000, 0xfef000, 0x010000); - SekMapMemory(System16TextRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Text RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16TextRam, region_start, region_end, region_mirror, MAP_RAM); - - compute_region(index, 0x010000, 0xfe0000, 0x000000); - SekMapMemory(System16TileRam, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Tile RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - chip.tile_ram_start = region_start; - chip.tile_ram_end = region_end; - - store_mirrors(chip.tile_ram_start_mirror, chip.tile_ram_end_mirror, region_start, region_end, region_mirror, &chip.tile_ram_num_mirrors); - - break; - } - - case 4: { - compute_region(index, 0x000800, 0xfff800, 0x000000); - SekMapMemory(System16SpriteRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Sprite RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16SpriteRam, region_start, region_end, region_mirror, MAP_RAM); - - break; - } - - case 3: { - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704_PS2) { - compute_region(index, 0x040000, ~(0x040000 - 1), 0x000000); - SekMapMemory(System16Ram, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Work RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - } else { - compute_region(index, 0x004000, ~(0x004000 - 1), 0x000000); - SekMapMemory(System16Ram, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Work RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Ram, region_start, region_end, region_mirror, MAP_RAM); - } - - break; - } - - case 2: { - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358_SMALL) { - compute_region(index, 0x020000, 0xfe0000, 0x000000); - SekMapMemory(System16Rom + 0x20000, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 2: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion) + 0x20000, region_start, region_end, MAP_FETCH); - } else { - SekMapMemory(System16Code + 0x20000, region_start, region_end, MAP_FETCH); - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358) { - compute_region(index, 0x020000, 0xfe0000, 0x000000); - SekMapMemory(System16Rom + 0x40000, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 2: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion) + 0x40000, region_start, region_end, MAP_FETCH); - } else { - SekMapMemory(System16Code + 0x40000, region_start, region_end, MAP_FETCH); - } - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5521) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704_PS2)) { - compute_region(index, 0x010000, 0xff0000, 0x000000); - chip.bank_5704_start = region_start; - chip.bank_5704_end = region_end; - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 2: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - store_mirrors(chip.bank_5704_start_mirror, chip.bank_5704_end_mirror, region_start, region_end, region_mirror, &chip.bank_5704_num_mirrors); - } - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - break; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5797) { - compute_region(index, 0x010000, 0xff0000, 0x000000); - chip.math2_5797_start = region_start; - chip.math2_5797_end = region_end; - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 2: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - store_mirrors(chip.math2_5797_start_mirror, chip.math2_5797_end_mirror, region_start, region_end, region_mirror, &chip.math2_5797_num_mirrors); - } - - break; - } - - case 1: { - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358_SMALL) { - compute_region(index, 0x020000, 0xfe0000, 0x000000); - SekMapMemory(System16Rom + 0x10000, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 1: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom + 0x10000, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion) + 0x10000, region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion) + 0x10000, region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code + 0x10000, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code + 0x10000, region_start, region_end, region_mirror, MAP_FETCH); - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358) { - compute_region(index, 0x020000, 0xfe0000, 0x000000); - SekMapMemory(System16Rom + 0x20000, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 1: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom + 0x20000, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion) + 0x20000, region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion) + 0x20000, region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code + 0x20000, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code + 0x20000, region_start, region_end, region_mirror, MAP_FETCH); - } - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5521) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704_PS2)) { - compute_region(index, 0x040000, 0xfc0000, 0x000000); - SekMapMemory(System16Rom + 0x40000, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 1: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom + 0x40000, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion) + 0x40000, region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion) + 0x40000, region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code + 0x40000, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code + 0x40000, region_start, region_end, region_mirror, MAP_FETCH); - } - } - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - compute_region(index, 0x010000, 0xff0000, 0x000000); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 1: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - chip.korean_sound_start = region_start; - chip.korean_sound_end = region_end; - - store_mirrors(chip.korean_sound_start_mirror, chip.korean_sound_end_mirror, region_start, region_end, region_mirror, &chip.korean_sound_num_mirrors); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5797) { - compute_region(index, 0x004000, 0xffc000, 0x000000); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 1: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - chip.math1_5797_start = region_start; - chip.math1_5797_end = region_end; - - store_mirrors(chip.math1_5797_start_mirror, chip.math1_5797_end_mirror, region_start, region_end, region_mirror, &chip.math1_5797_num_mirrors); - } - - break; - } - - case 0: { - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358_SMALL)) { - compute_region(index, 0x020000, 0xfe0000, 0x000000); - SekMapMemory(System16Rom, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 0: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion), region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion), region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code, region_start, region_end, region_mirror, MAP_FETCH); - } - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5521) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704_PS2)) { - compute_region(index, 0x040000, 0xfc0000, 0x000000); - SekMapMemory(System16Rom, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 0: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion), region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion), region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code, region_start, region_end, region_mirror, MAP_FETCH); - } - } - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - compute_region(index, 0x040000, 0xfc0000, 0x000000); - SekMapMemory(System16Rom, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 0: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion), region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion), region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code, region_start, region_end, region_mirror, MAP_FETCH); - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5797) { - compute_region(index, 0x080000, 0xf80000, 0x000000); - SekMapMemory(System16Rom, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 0: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion), region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion), region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code, region_start, region_end, region_mirror, MAP_FETCH); - } - } - - break; - } - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - switch (index) { - case 7: { - compute_region(index, 0x004000, 0xffc000, 0x000000); - chip.io_start = region_start; - chip.io_end = region_end; - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("IO: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - store_mirrors(chip.io_start_mirror, chip.io_end_mirror, region_start, region_end, region_mirror, &chip.io_num_mirrors); - - break; - } - - case 6: { - compute_region(index, 0x001000, 0xfff000, 0x000000); - SekMapMemory(System16PaletteRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Palette RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16PaletteRam, region_start, region_end, region_mirror, MAP_RAM); - - break; - } - - case 5: { - compute_region(index, 0x001000, 0xfef000, 0x010000); - SekMapMemory(System16TextRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Text RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16TextRam, region_start, region_end, region_mirror, MAP_RAM); - - compute_region(index, 0x010000, 0xfe0000, 0x000000); - SekMapMemory(System16TileRam, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Tile RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - chip.tile_ram_start = region_start; - chip.tile_ram_end = region_end; - - store_mirrors(chip.tile_ram_start_mirror, chip.tile_ram_end_mirror, region_start, region_end, region_mirror, &chip.tile_ram_num_mirrors); - - break; - } - - case 4: { - compute_region(index, 0x004000, 0xffc000, 0x000000); - SekMapMemory(System16SpriteRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Sprite RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16SpriteRam, region_start, region_end, region_mirror, MAP_RAM); - - break; - } - - case 3: { - compute_region(index, 0x004000, 0xffc000, 0x000000); - SekMapMemory(System16Ram, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Work RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Ram, region_start, region_end, region_mirror, MAP_RAM); - - break; - } - - case 2: { - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_171_5874) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_171_5987) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_837_7525)) { - compute_region(index, 0x000010, 0xfffff0, 0x000000); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 2: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - chip.genesis_vdp_start = region_start; - chip.genesis_vdp_end = region_end; - - //store_mirrors(chip.genesis_vdp_start_mirror, chip.genesis_vdp_end_mirror, region_start, region_end, region_mirror, &chip.genesis_vdp_num_mirrors); - } - - break; - } - - case 1: { - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_171_5874) { - compute_region(index, 0x080000, 0xf80000, 0x000000); - SekMapMemory(System16Rom + 0x80000, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 1: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom + 0x80000, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion) + 0x80000, region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion) + 0x80000, region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code + 0x80000, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code + 0x80000, region_start, region_end, region_mirror, MAP_FETCH); - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_171_5987) { - if (System16RomSize <= 0x100000) { - compute_region(index, 0x080000, 0xf80000, 0x000000); - SekMapMemory(System16Rom + 0x80000, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 1: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom + 0x80000, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion) + 0x80000, region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion) + 0x80000, region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code + 0x80000, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code + 0x80000, region_start, region_end, region_mirror, MAP_FETCH); - } - } else { - compute_region(index, 0x100000, 0xf00000, 0x000000); - SekMapMemory(System16Rom + 0x100000, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 1: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom + 0x100000, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion) + 0x100000, region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion) + 0x100000, region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code, region_start + 0x100000, region_end, MAP_FETCH); - map_mirrors(System16Code, region_start + 0x100000, region_end, region_mirror, MAP_FETCH); - } - } - - chip.bank_5987_start = region_start; - chip.bank_5987_end = region_end; - - store_mirrors(chip.bank_5987_start_mirror, chip.bank_5987_end_mirror, region_start, region_end, region_mirror, &chip.bank_5987_num_mirrors); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_837_7525) { - compute_region(index, 0x080000, 0xf80000, 0x000000); - SekMapMemory(System16Rom + 0x80000, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 1: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom + 0x80000, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion) + 0x80000, region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion) + 0x80000, region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code + 0x80000, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code + 0x80000, region_start, region_end, region_mirror, MAP_FETCH); - } - - chip.bank_7525_start = region_start; - chip.bank_7525_end = region_end; - - store_mirrors(chip.bank_7525_start_mirror, chip.bank_7525_end_mirror, region_start, region_end, region_mirror, &chip.bank_7525_num_mirrors); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_171_SHADOW) { - compute_region(index, 0x000010, 0xfffff0, 0x000000); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 2: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - chip.genesis_vdp_start = region_start; - chip.genesis_vdp_end = region_end; - - //store_mirrors(chip.genesis_vdp_start_mirror, chip.genesis_vdp_end_mirror, region_start, region_end, region_mirror, &chip.genesis_vdp_num_mirrors); - } - - break; - } - - case 0: { - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_171_5874) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_171_SHADOW)) { - compute_region(index, 0x080000, 0xf80000, 0x000000); - SekMapMemory(System16Rom, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 0: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion), region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion), region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code, region_start, region_end, region_mirror, MAP_FETCH); - } - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_171_5987) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_837_7525)) { - if (System16RomSize <= 0x100000) { - compute_region(index, 0x080000, 0xf80000, 0x000000); - SekMapMemory(System16Rom, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 0: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion), region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion), region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code, region_start, region_end, region_mirror, MAP_FETCH); - } - } else { - compute_region(index, 0x100000, 0xf00000, 0x000000); - SekMapMemory(System16Rom, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 0: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion), region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion), region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code, region_start, region_end, region_mirror, MAP_FETCH); - } - } - } - - break; - } - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN) { - switch (index) { - case 7: { - break; - } - - case 6: { - break; - } - - case 5: { - // road control - compute_region(index, 0x010000, 0xf00000, 0x090000); - chip.road_ctrl_start = region_start; - chip.road_ctrl_end = region_end; - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Road Ctrl: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - store_mirrors(chip.road_ctrl_start_mirror, chip.road_ctrl_end_mirror, region_start, region_end, region_mirror, &chip.road_ctrl_num_mirrors); - - // road ram - compute_region(index, 0x001000, 0xf0f000, 0x080000); - SekMapMemory(System16RoadRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Road RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16RoadRam, region_start, region_end, region_mirror, MAP_RAM); - - // shared ram - compute_region(index, 0x008000, 0xf18000, 0x060000); - SekMapMemory(System16Ram, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Shared RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Ram, region_start, region_end, region_mirror, MAP_RAM); - - // second 68k rom - compute_region(index, 0x060000, 0xf00000, 0x000000); - SekMapMemory(System16Rom2, region_start, region_end, MAP_ROM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("68K #2 ROM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom2, region_start, region_end, region_mirror, MAP_ROM); - - break; - } - - case 4: { - compute_region(index, 0x010000, 0xf00000, 0x090000); - chip.io_start = region_start; - chip.io_end = region_end; - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("IO: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - store_mirrors(chip.io_start_mirror, chip.io_end_mirror, region_start, region_end, region_mirror, &chip.io_num_mirrors); - - break; - } - - case 3: { - compute_region(index, 0x001000, 0xff0000, 0x000000); - SekMapMemory(System16SpriteRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Sprite RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16SpriteRam, region_start, region_end, region_mirror, MAP_RAM); - - break; - } - - case 2: { - compute_region(index, 0x002000, 0xffe000, 0x000000); - SekMapMemory(System16PaletteRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Palette RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16PaletteRam, region_start, region_end, region_mirror, MAP_RAM); - - break; - } - - case 1: { - compute_region(index, 0x001000, 0xfef000, 0x010000); - SekMapMemory(System16TextRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Text RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16TextRam, region_start, region_end, region_mirror, MAP_RAM); - - compute_region(index, 0x010000, 0xfe0000, 0x000000); - SekMapMemory(System16TileRam, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Tile RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - chip.tile_ram_start = region_start; - chip.tile_ram_end = region_end; - - store_mirrors(chip.tile_ram_start_mirror, chip.tile_ram_end_mirror, region_start, region_end, region_mirror, &chip.tile_ram_num_mirrors); - - break; - } - - case 0: { - // work ram - compute_region(index, 0x008000, 0xf98000, 0x060000); - SekMapMemory(System16ExtraRam, region_start, region_end, MAP_RAM); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Work RAM: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16ExtraRam, region_start, region_end, region_mirror, MAP_RAM); - - // rom - compute_region(index, 0x060000, 0xf80000, 0x000000); - SekMapMemory(System16Rom, region_start, region_end, MAP_READ); - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("ROM 0: %x, %x, %x, %x\n"), index, region_start, region_end, region_mirror); - - map_mirrors(System16Rom, region_start, region_end, region_mirror, MAP_READ); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekMapMemory(((UINT8*)fd1094_userregion), region_start, region_end, MAP_FETCH); - map_mirrors(((UINT8*)fd1094_userregion), region_start, region_end, region_mirror, MAP_FETCH); - } else { - SekMapMemory(System16Code, region_start, region_end, MAP_FETCH); - map_mirrors(System16Code, region_start, region_end, region_mirror, MAP_FETCH); - } - - break; - } - } - } - } -} - -static UINT16 open_bus_read() -{ - if (open_bus_recurse) return 0xffff; - - open_bus_recurse = true; - UINT16 result = (System16Rom[SekGetPC(0) + 1] << 8) | System16Rom[SekGetPC(0) + 0]; - open_bus_recurse = false; - return result; -} - -static UINT8 chip_read(UINT32 offset, INT32 data_width) -{ - offset &= 0x1f; - - switch (offset) { - case 0x00: - case 0x01: { - return chip.regs[offset]; - } - - case 0x02: { - return ((chip.regs[0x02] & 3) == 3) ? 0x00 : 0x0f; - } - - case 0x03: { - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - return System16MCUData; - } - - return 0xff; - } - } - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Read %x, %x\n"), offset, SekGetPC(0)); - - if (data_width == 16) return open_bus_read(); - - return 0xff; -} - -static void chip_write(UINT32 offset, UINT8 data) -{ - offset &= 0x1f; - - UINT8 oldval = chip.regs[offset]; - chip.regs[offset] = data; - - switch (offset) { - case 0x02: { - if ((oldval ^ chip.regs[offset]) & 3) - { - if ((chip.regs[offset] & 3) == 3) { - if (LOG_MAPPER) bprintf(PRINT_IMPORTANT, _T("Write forced reset\n")); - - System1668KEnable = false; - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) { - SekClose(); - fd1094_machine_init(); - SekOpen(0); - } - - INT32 active_cpu = SekGetActive(); - if (active_cpu == -1) { - SekOpen(0); - SekReset(); - SekClose(); - } else { - SekReset(); - } - } else { - if (LOG_MAPPER) bprintf(PRINT_IMPORTANT, _T("Write cleared reset\n")); - System1668KEnable = true; - } - } - break; - } - - case 0x03: { - System16SoundLatch = data; - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) { - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) == 0) { - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - ZetOpen(0); - ZetNmi(); - ZetClose(); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN) { - ZetOpen(0); - ZetNmi(); - nSystem16CyclesDone[2] += ZetRun(200); - ZetClose(); - } - - break; - } - - case 0x04: { - if ((chip.regs[offset] & 7) != 7) { - if (System1668KEnable) { - for (INT32 irqnum = 0; irqnum < 8; irqnum++) { - if (irqnum == (~chip.regs[offset] & 7)) { - if (LOG_MAPPER) bprintf(PRINT_IMPORTANT, _T("Mapper: Triggering IRQ %i \n"), irqnum); - - if (System16I8751RomNum && irqnum == 4) { - // the I8751 does the vblank IRQ - SekSetIRQLine(irqnum, CPU_IRQSTATUS_ACK); - nSystem16CyclesDone[0] += SekRun(200); - SekSetIRQLine(irqnum, CPU_IRQSTATUS_NONE); - } else { - // normal - just raise it - SekSetIRQLine(irqnum, CPU_IRQSTATUS_ACK); - } - } else { - SekSetIRQLine(irqnum, CPU_IRQSTATUS_NONE); - - if (LOG_MAPPER) bprintf(PRINT_IMPORTANT, _T("Mapper: Clearing IRQ %i\n"), irqnum); - } - } - } - } - break; - } - - case 0x05: { - if (data == 0x01) { - UINT32 addr = (chip.regs[0x0a] << 17) | (chip.regs[0x0b] << 9) | (chip.regs[0x0c] << 1); - SekWriteWord(addr, (chip.regs[0x00] << 8) | chip.regs[0x01]); - - if (LOG_MAPPER) bprintf(PRINT_IMPORTANT, _T("Mapper Chip Write Word %06x . %04x\n"), addr, (chip.regs[0x00] << 8) | chip.regs[0x01]); - } else if (data == 0x02) { - UINT32 addr = (chip.regs[0x07] << 17) | (chip.regs[0x08] << 9) | (chip.regs[0x09] << 1); - UINT16 result = SekReadWord(addr); - - if (LOG_MAPPER) bprintf(PRINT_IMPORTANT, _T("Mapper Chip Read Word %06x\n"), addr); - - chip.regs[0x00] = result >> 8; - chip.regs[0x01] = result; - } - break; - } - - case 0x07: - case 0x08: - case 0x09: { - // writes here latch a 68000 address for writing - break; - } - - case 0x0a: - case 0x0b: - case 0x0c: { - // writes here latch a 68000 address for reading - break; - } - - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x15: - case 0x16: - case 0x17: - case 0x18: - case 0x19: - case 0x1a: - case 0x1b: - case 0x1c: - case 0x1d: - case 0x1e: - case 0x1f: { - if (oldval != data) update_mapping(); - break; - } - - default: { - //bprintf(PRINT_NORMAL, _T("Write %x, %x\n"), offset, data); - } - } -} - -UINT8 sega_315_5195_io_read(UINT32 offset) -{ - offset &= 0x1fff; - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - switch (offset & (0x3000 / 2)) { - case 0x1000 / 2: { - if ((offset & 3) == 1) return 0xff - System16Input[1]; - if ((offset & 3) == 2) return System16Dip[0]; - if ((offset & 3) == 3) return System16Dip[1]; - return 0xff - System16Input[0]; - } - } - } else { - switch (offset & (0x3000 / 2)) { - case 0x1000 / 2: { - if ((offset & 3) == 1) return 0xff - System16Input[1]; - if ((offset & 3) == 2) return System16Dip[2]; - if ((offset & 3) == 3) return 0xff - System16Input[2]; - return 0xff - System16Input[0]; - } - - case 0x2000 / 2: { - if ((offset & 1) == 1) return System16Dip[1]; - return System16Dip[0]; - } - } - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - switch (offset & (0x3000 / 2)) { - case 0x0000 / 2: - case 0x1000 / 2: { - return system18_io_chip_r(offset); - } - } - } - - return open_bus_read(); -} - -static UINT16 math1_5797_read(UINT32 offset) -{ - offset &= 0x1fff; - - switch (offset & (0x3000 / 2)) { - case 0x0000 / 2: { - return System16MultiplyChipRead(0, offset); - } - - case 0x1000 / 2: { - return System16CompareTimerChipRead(0, offset); - } - } - - return open_bus_read(); -} - -void sega_315_5195_io_write(UINT32 offset, UINT8 d) -{ - offset &= 0x1fff; - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) { - switch (offset & (0x3000 / 2)) { - case 0x0000 / 2: { - System16VideoEnable = d & 0x20; - System16ScreenFlip = d & 0x40; - return; - } - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - switch (offset & (0x3000 / 2)) { - case 0x0000 / 2: - case 0x1000 / 2: { - system18_io_chip_w(offset, d); - return; - } - - case 0x2000 / 2: { - System18VdpMixing = d & 0xff; - return; - } - } - } -} - -static void bank_5704_write(UINT32 offset, UINT8 d) -{ - offset &= 0x01; - - if (System16TileBanks[offset] != (d & 0x07)) { - System16TileBanks[offset] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } -} - -static void korean_sound_write(UINT32 offset, UINT8 d) -{ - switch (offset) { - case 0x00: { - BurnYM2413Write(0, d); - return; - } - - case 0x01: { - BurnYM2413Write(1, d); - return; - } - } -} - -static void math1_5797_write(UINT32 offset, UINT16 d) -{ - offset &= 0x1fff; - - switch (offset & (0x3000 / 2)) { - case 0x0000 / 2: { - System16MultiplyChipWrite(0, offset, d); - return; - } - - case 0x1000 / 2: { - System16CompareTimerChipWrite(0, offset, d); - return; - } - - case 0x2000 / 2: { - offset &= 0x01; - - if (System16TileBanks[offset] != (d & 0x07)) { - System16TileBanks[offset] = d & 0x07; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - return; - } - } -} - -UINT8 __fastcall sega_315_5195_read_byte(UINT32 a) -{ - if (chip.io_start > 0) { - if (a >= chip.io_start && a <= chip.io_end) { - UINT16 offset = (a - chip.io_start) >> 1; - if (sega_315_5195_custom_io_do) return sega_315_5195_custom_io_do(offset); - return sega_315_5195_io_read(offset); - } - } - - if (chip.genesis_vdp_start > 0) { - if (a >= chip.genesis_vdp_start && a <= chip.genesis_vdp_end) { - UINT16 offset = (a - chip.genesis_vdp_start) >> 1; - return GenesisVDPRead(offset) & 0xff; - } - } - - if (chip.road_ctrl_start > 0) { - if (a >= chip.road_ctrl_start && a <= chip.road_ctrl_end) { - UINT16 offset = (a - chip.road_ctrl_start) >> 1; - return System16RoadControlRead(offset) & 0xff; - } - } - - for (INT32 i = 0; i < chip.io_num_mirrors; i++) { - if (chip.io_start_mirror[i] > 0) { - if (a >= chip.io_start_mirror[i] && a <= chip.io_end_mirror[i]) { - UINT16 offset = (a - chip.io_start_mirror[i]) >> 1; - if (sega_315_5195_custom_io_do) return sega_315_5195_custom_io_do(offset); - return sega_315_5195_io_read(offset); - } - } - } - - for (INT32 i = 0; i < chip.genesis_vdp_num_mirrors; i++) { - if (chip.genesis_vdp_start_mirror[i] > 0) { - if (a >= chip.genesis_vdp_start_mirror[i] && a <= chip.genesis_vdp_end_mirror[i]) { - UINT16 offset = (a - chip.genesis_vdp_start_mirror[i]) >> 1; - return GenesisVDPRead(offset) & 0xff; - } - } - } - - for (INT32 i = 0; i < chip.road_ctrl_num_mirrors; i++) { - if (chip.road_ctrl_start_mirror[i] > 0) { - if (a >= chip.road_ctrl_start_mirror[i] && a <= chip.road_ctrl_end_mirror[i]) { - UINT16 offset = (a - chip.road_ctrl_start_mirror[i]) >> 1; - return System16RoadControlRead(offset) & 0xff; - } - } - } - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Read Byte 0x%06X\n"), a); - - return chip_read(a >> 1, 16); -} - -UINT16 __fastcall sega_315_5195_read_word(UINT32 a) -{ - if (chip.io_start > 0) { - if (a >= chip.io_start && a <= chip.io_end) { - UINT16 offset = (a - chip.io_start) >> 1; - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - if (sega_315_5195_custom_io_do) return sega_315_5195_custom_io_do(offset) | (open_bus_read() & 0xff00); - return sega_315_5195_io_read(offset) | (open_bus_read() & 0xff00); - } - if (sega_315_5195_custom_io_do) return sega_315_5195_custom_io_do(offset); - return sega_315_5195_io_read(offset); - } - } - - if (chip.math1_5797_start > 0) { - if (a >= chip.math1_5797_start && a <= chip.math1_5797_end) { - UINT16 offset = (a - chip.math1_5797_start) >> 1; - return math1_5797_read(offset); - } - } - - if (chip.math2_5797_start > 0) { - if (a >= chip.math2_5797_start && a <= chip.math2_5797_end) { - UINT16 offset = (a - chip.math2_5797_start) >> 1; - return System16CompareTimerChipRead(1, offset); - } - } - - if (chip.genesis_vdp_start > 0) { - if (a >= chip.genesis_vdp_start && a <= chip.genesis_vdp_end) { - UINT16 offset = (a - chip.genesis_vdp_start) >> 1; - return GenesisVDPRead(offset); - } - } - - if (chip.road_ctrl_start > 0) { - if (a >= chip.road_ctrl_start && a <= chip.road_ctrl_end) { - UINT16 offset = (a - chip.road_ctrl_start) >> 1; - return System16RoadControlRead(offset); - } - } - - for (INT32 i = 0; i < chip.io_num_mirrors; i++) { - if (chip.io_start_mirror[i] > 0) { - if (a >= chip.io_start_mirror[i] && a <= chip.io_end_mirror[i]) { - UINT16 offset = (a - chip.io_start_mirror[i]) >> 1; - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - if (sega_315_5195_custom_io_do) return sega_315_5195_custom_io_do(offset) | (open_bus_read() & 0xff00); - return sega_315_5195_io_read(offset) | (open_bus_read() & 0xff00); - } - if (sega_315_5195_custom_io_do) return sega_315_5195_custom_io_do(offset); - return sega_315_5195_io_read(offset); - } - } - } - - for (INT32 i = 0; i < chip.math1_5797_num_mirrors; i++) { - if (chip.math1_5797_start_mirror[i] > 0) { - if (a >= chip.math1_5797_start_mirror[i] && a <= chip.math1_5797_end_mirror[i]) { - UINT16 offset = (a - chip.math1_5797_start_mirror[i]) >> 1; - return math1_5797_read(offset); - } - } - } - - for (INT32 i = 0; i < chip.math2_5797_num_mirrors; i++) { - if (chip.math2_5797_start_mirror[i] > 0) { - if (a >= chip.math2_5797_start_mirror[i] && a <= chip.math2_5797_end_mirror[i]) { - UINT16 offset = (a - chip.math2_5797_start_mirror[i]) >> 1; - return System16CompareTimerChipRead(1, offset); - } - } - } - - for (INT32 i = 0; i < chip.genesis_vdp_num_mirrors; i++) { - if (chip.genesis_vdp_start_mirror[i] > 0) { - if (a >= chip.genesis_vdp_start_mirror[i] && a <= chip.genesis_vdp_end_mirror[i]) { - UINT16 offset = (a - chip.genesis_vdp_start_mirror[i]) >> 1; - return GenesisVDPRead(offset); - } - } - } - - for (INT32 i = 0; i < chip.road_ctrl_num_mirrors; i++) { - if (chip.road_ctrl_start_mirror[i] > 0) { - if (a >= chip.road_ctrl_start_mirror[i] && a <= chip.road_ctrl_end_mirror[i]) { - UINT16 offset = (a - chip.road_ctrl_start_mirror[i]) >> 1; - return System16RoadControlRead(offset) & 0xff; - } - } - } - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Read Word 0x%06X\n"), a); - - return chip_read(a >> 1, 16); -} - -void __fastcall sega_315_5195_write_byte(UINT32 a, UINT8 d) -{ - if (chip.tile_ram_start > 0) { - if (a >= chip.tile_ram_start && a <= chip.tile_ram_end) { - System16BTileByteWrite((a - chip.tile_ram_start) ^ 1, d); - return; - } - } - - if (chip.io_start > 0) { - if (a >= chip.io_start && a <= chip.io_end) { - UINT16 offset = (a - chip.io_start) >> 1; - if (sega_315_5195_custom_io_write_do) { - sega_315_5195_custom_io_write_do(offset, d); - } else { - sega_315_5195_io_write(offset, d); - } - return; - } - } - - if (chip.bank_5704_start > 0) { - if (a >= chip.bank_5704_start && a <= chip.bank_5704_end) { - UINT16 offset = (a - chip.bank_5704_start) >> 1; - bank_5704_write(offset, d); - return; - } - } - - if (chip.korean_sound_start > 0) { - if (a >= chip.korean_sound_start && a <= chip.korean_sound_end) { - UINT16 offset = (a - chip.korean_sound_start) >> 1; - korean_sound_write(offset, d); - return; - } - } - - if (chip.math1_5797_start > 0) { - if (a >= chip.math1_5797_start && a <= chip.math1_5797_end) { - UINT16 offset = (a - chip.math1_5797_start) >> 1; - math1_5797_write(offset, d); - return; - } - } - - if (chip.math2_5797_start > 0) { - if (a >= chip.math2_5797_start && a <= chip.math2_5797_end) { - UINT16 offset = (a - chip.math2_5797_start) >> 1; - System16CompareTimerChipWrite(1, offset, d); - return; - } - } - - if (chip.genesis_vdp_start > 0) { - if (a >= chip.genesis_vdp_start && a <= chip.genesis_vdp_end) { - UINT16 offset = (a - chip.genesis_vdp_start) >> 1; - GenesisVDPWrite(offset, d); - return; - } - } - - if (chip.bank_5987_start > 0) { - if (a >= chip.bank_5987_start && a <= chip.bank_5987_end) { - UINT16 offset = (a - chip.bank_5987_start) >> 1; - System18GfxBankWrite(offset, d); - return; - } - } - - if (chip.bank_7525_start > 0) { - if (a >= chip.bank_7525_start && a <= chip.bank_7525_end) { - UINT16 offset = (a - chip.bank_7525_start) >> 1; - HamawayGfxBankWrite(offset, d); - return; - } - } - - if (chip.road_ctrl_start > 0) { - if (a >= chip.road_ctrl_start && a <= chip.road_ctrl_end) { - UINT16 offset = (a - chip.road_ctrl_start) >> 1; - System16RoadControlWrite(offset, d); - return; - } - } - - for (INT32 i = 0; i < chip.io_num_mirrors; i++) { - if (chip.io_start_mirror[i] > 0) { - if (a >= chip.io_start_mirror[i] && a <= chip.io_end_mirror[i]) { - UINT16 offset = (a - chip.io_start_mirror[i]) >> 1; - if (sega_315_5195_custom_io_write_do) { - sega_315_5195_custom_io_write_do(offset, d); - } else { - sega_315_5195_io_write(offset, d); - } - return; - } - } - } - - for (INT32 i = 0; i < chip.tile_ram_num_mirrors; i++) { - if (chip.tile_ram_start_mirror[i] > 0) { - if (a >= chip.tile_ram_start_mirror[i] && a <= chip.tile_ram_end_mirror[i]) { - System16BTileByteWrite((a - chip.tile_ram_start_mirror[i]) ^ 1, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.bank_5704_num_mirrors; i++) { - if (chip.bank_5704_start_mirror[i] > 0) { - if (a >= chip.bank_5704_start_mirror[i] && a <= chip.bank_5704_end_mirror[i]) { - UINT16 offset = (a - chip.bank_5704_start_mirror[i]) >> 1; - bank_5704_write(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.korean_sound_num_mirrors; i++) { - if (chip.korean_sound_start > 0) { - if (a >= chip.korean_sound_start_mirror[i] && a <= chip.korean_sound_end_mirror[i]) { - UINT16 offset = (a - chip.korean_sound_start_mirror[i]) >> 1; - korean_sound_write(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.math1_5797_num_mirrors; i++) { - if (chip.math1_5797_start_mirror[i] > 0) { - if (a >= chip.math1_5797_start_mirror[i] && a <= chip.math1_5797_end_mirror[i]) { - UINT16 offset = (a - chip.math1_5797_start_mirror[i]) >> 1; - math1_5797_write(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.math2_5797_num_mirrors; i++) { - if (chip.math2_5797_start_mirror[i] > 0) { - if (a >= chip.math2_5797_start_mirror[i] && a <= chip.math2_5797_end_mirror[i]) { - UINT16 offset = (a - chip.math2_5797_start_mirror[i]) >> 1; - System16CompareTimerChipWrite(1, offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.genesis_vdp_num_mirrors; i++) { - if (chip.genesis_vdp_start_mirror[i] > 0) { - if (a >= chip.genesis_vdp_start_mirror[i] && a <= chip.genesis_vdp_end_mirror[i]) { - UINT16 offset = (a - chip.genesis_vdp_start_mirror[i]) >> 1; - GenesisVDPWrite(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.bank_5987_num_mirrors; i++) { - if (chip.bank_5987_start_mirror[i] > 0) { - if (a >= chip.bank_5987_start_mirror[i] && a <= chip.bank_5987_end_mirror[i]) { - UINT16 offset = (a - chip.bank_5987_start_mirror[i]) >> 1; - System18GfxBankWrite(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.bank_7525_num_mirrors; i++) { - if (chip.bank_7525_start_mirror[i] > 0) { - if (a >= chip.bank_7525_start_mirror[i] && a <= chip.bank_7525_end_mirror[i]) { - UINT16 offset = (a - chip.bank_7525_start_mirror[i]) >> 1; - HamawayGfxBankWrite(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.road_ctrl_num_mirrors; i++) { - if (chip.road_ctrl_start_mirror[i] > 0) { - if (a >= chip.road_ctrl_start_mirror[i] && a <= chip.road_ctrl_end_mirror[i]) { - UINT16 offset = (a - chip.road_ctrl_start_mirror[i]) >> 1; - System16RoadControlWrite(offset, d); - return; - } - } - } - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Write Byte 0x%06X, 0x%02X\n"), a, d); - - if (LaserGhost && a == 0xfe0008 && d == 0x00) return; - - chip_write(a >> 1, d & 0xff); -} - -void __fastcall sega_315_5195_write_word(UINT32 a, UINT16 d) -{ - if (chip.tile_ram_start > 0) { - if (a >= chip.tile_ram_start && a <= chip.tile_ram_end) { - System16BTileWordWrite(a - chip.tile_ram_start, d); - return; - } - } - - if (chip.io_start > 0) { - if (a >= chip.io_start && a <= chip.io_end) { - UINT16 offset = (a - chip.io_start) >> 1; - if (sega_315_5195_custom_io_write_do) { - sega_315_5195_custom_io_write_do(offset, d & 0xff); - } else { - sega_315_5195_io_write(offset, d & 0xff); - } - return; - } - } - - if (chip.bank_5704_start > 0) { - if (a >= chip.bank_5704_start && a <= chip.bank_5704_end) { - UINT16 offset = (a - chip.bank_5704_start) >> 1; - bank_5704_write(offset, d & 0xff); - return; - } - } - - if (chip.math1_5797_start > 0) { - if (a >= chip.math1_5797_start && a <= chip.math1_5797_end) { - UINT16 offset = (a - chip.math1_5797_start) >> 1; - math1_5797_write(offset, d); - return; - } - } - - if (chip.math2_5797_start > 0) { - if (a >= chip.math2_5797_start && a <= chip.math2_5797_end) { - UINT16 offset = (a - chip.math2_5797_start) >> 1; - System16CompareTimerChipWrite(1, offset, d); - return; - } - } - - if (chip.genesis_vdp_start > 0) { - if (a >= chip.genesis_vdp_start && a <= chip.genesis_vdp_end) { - UINT16 offset = (a - chip.genesis_vdp_start) >> 1; - GenesisVDPWrite(offset, d); - return; - } - } - - if (chip.bank_5987_start > 0) { - if (a >= chip.bank_5987_start && a <= chip.bank_5987_end) { - UINT16 offset = (a - chip.bank_5987_start) >> 1; - System18GfxBankWrite(offset, d); - return; - } - } - - if (chip.bank_7525_start > 0) { - if (a >= chip.bank_7525_start && a <= chip.bank_7525_end) { - UINT16 offset = (a - chip.bank_7525_start) >> 1; - HamawayGfxBankWrite(offset, d); - return; - } - } - - if (chip.road_ctrl_start > 0) { - if (a >= chip.road_ctrl_start && a <= chip.road_ctrl_end) { - UINT16 offset = (a - chip.road_ctrl_start) >> 1; - System16RoadControlWrite(offset, d); - return; - } - } - - for (INT32 i = 0; i < chip.io_num_mirrors; i++) { - if (chip.io_start_mirror[i] > 0) { - if (a >= chip.io_start_mirror[i] && a <= chip.io_end_mirror[i]) { - UINT16 offset = (a - chip.io_start_mirror[i]) >> 1; - if (sega_315_5195_custom_io_write_do) { - sega_315_5195_custom_io_write_do(offset, d & 0xff); - } else { - sega_315_5195_io_write(offset, d & 0xff); - } - return; - } - } - } - - for (INT32 i = 0; i < chip.tile_ram_num_mirrors; i++) { - if (chip.tile_ram_start_mirror[i] > 0) { - if (a >= chip.tile_ram_start_mirror[i] && a <= chip.tile_ram_end_mirror[i]) { - System16BTileWordWrite(a - chip.tile_ram_start_mirror[i], d); - return; - } - } - } - - for (INT32 i = 0; i < chip.bank_5704_num_mirrors; i++) { - if (chip.bank_5704_start_mirror[i] > 0) { - if (a >= chip.bank_5704_start_mirror[i] && a <= chip.bank_5704_end_mirror[i]) { - UINT16 offset = (a - chip.bank_5704_start_mirror[i]) >> 1; - bank_5704_write(offset, d & 0xff); - return; - } - } - } - - for (INT32 i = 0; i < chip.math1_5797_num_mirrors; i++) { - if (chip.math1_5797_start_mirror[i] > 0) { - if (a >= chip.math1_5797_start_mirror[i] && a <= chip.math1_5797_end_mirror[i]) { - UINT16 offset = (a - chip.math1_5797_start_mirror[i]) >> 1; - math1_5797_write(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.math2_5797_num_mirrors; i++) { - if (chip.math2_5797_start_mirror[i] > 0) { - if (a >= chip.math2_5797_start_mirror[i] && a <= chip.math2_5797_end_mirror[i]) { - UINT16 offset = (a - chip.math2_5797_start_mirror[i]) >> 1; - System16CompareTimerChipWrite(1, offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.genesis_vdp_num_mirrors; i++) { - if (chip.genesis_vdp_start_mirror[i] > 0) { - if (a >= chip.genesis_vdp_start_mirror[i] && a <= chip.genesis_vdp_end_mirror[i]) { - UINT16 offset = (a - chip.genesis_vdp_start_mirror[i]) >> 1; - GenesisVDPWrite(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.bank_5987_num_mirrors; i++) { - if (chip.bank_5987_start_mirror[i] > 0) { - if (a >= chip.bank_5987_start_mirror[i] && a <= chip.bank_5987_end_mirror[i]) { - UINT16 offset = (a - chip.bank_5987_start_mirror[i]) >> 1; - System18GfxBankWrite(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.bank_7525_num_mirrors; i++) { - if (chip.bank_7525_start_mirror[i] > 0) { - if (a >= chip.bank_7525_start_mirror[i] && a <= chip.bank_7525_end_mirror[i]) { - UINT16 offset = (a - chip.bank_7525_start_mirror[i]) >> 1; - HamawayGfxBankWrite(offset, d); - return; - } - } - } - - for (INT32 i = 0; i < chip.road_ctrl_num_mirrors; i++) { - if (chip.road_ctrl_start_mirror[i] > 0) { - if (a >= chip.road_ctrl_start_mirror[i] && a <= chip.road_ctrl_end_mirror[i]) { - UINT16 offset = (a - chip.road_ctrl_start_mirror[i]) >> 1; - System16RoadControlWrite(offset, d); - return; - } - } - } - - if (LOG_MAPPER) bprintf(PRINT_NORMAL, _T("Write Word 0x%06X, 0x%04X\n"), a, d); - - chip_write(a >> 1, d & 0xff); -} - -UINT8 sega_315_5195_i8751_read_port(INT32 port) -{ - switch (port) { - case MCS51_PORT_P1: { - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) { - return 0xff - System16Input[0]; - } - return 0; - } - - case 0xff00: - case 0xff01: - case 0xff02: - case 0xff03: - case 0xff04: - case 0xff05: - case 0xff06: - case 0xff07: - case 0xff08: - case 0xff09: - case 0xff0a: - case 0xff0b: - case 0xff0c: - case 0xff0d: - case 0xff0e: - case 0xff0f: - case 0xff10: - case 0xff11: - case 0xff12: - case 0xff13: - case 0xff14: - case 0xff15: - case 0xff16: - case 0xff17: - case 0xff18: - case 0xff19: - case 0xff1a: - case 0xff1b: - case 0xff1c: - case 0xff1d: - case 0xff1e: - case 0xff1f: { - return chip_read((UINT32)port, 8); - } - } - - return 0; -} - -void sega_315_5195_i8751_write_port(INT32 port, UINT8 data) -{ - switch (port) { - case MCS51_PORT_P1: { - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) { - if (System1668KEnable) { - INT32 active_cpu = SekGetActive(); - if (active_cpu == -1) { - SekOpen(0); - nSystem16CyclesDone[0] += SekRun(10000); - SekClose(); - } else { - nSystem16CyclesDone[0] += SekRun(10000); - } - } - } - - return; - } - - case 0xff00: - case 0xff01: - case 0xff02: - case 0xff03: - case 0xff04: - case 0xff05: - case 0xff06: - case 0xff07: - case 0xff08: - case 0xff09: - case 0xff0a: - case 0xff0b: - case 0xff0c: - case 0xff0d: - case 0xff0e: - case 0xff0f: - case 0xff10: - case 0xff11: - case 0xff12: - case 0xff13: - case 0xff14: - case 0xff15: - case 0xff16: - case 0xff17: - case 0xff18: - case 0xff19: - case 0xff1a: - case 0xff1b: - case 0xff1c: - case 0xff1d: - case 0xff1e: - case 0xff1f: { - chip_write((UINT32)port, data); - return; - } - } -} - -void sega_315_5195_reset() -{ - if (mapper_in_use) { - update_mapping(); - - open_bus_recurse = false; - } -} - -void sega_315_5195_configure_explicit(UINT8 *map_data) -{ - memcpy(&chip.regs[0x10], map_data, 0x10); - update_mapping(); -} - -void sega_315_5195_init() -{ - memset((void*)&chip, 0, sizeof(sega_315_5195_struct)); - - mapper_in_use = true; -} - -void sega_315_5195_exit() -{ - memset((void*)&chip, 0, sizeof(sega_315_5195_struct)); - - region_start = 0; - region_end = 0; - region_mirror = 0; - open_bus_recurse = false; - mapper_in_use = false; - - sega_315_5195_custom_io_do = NULL; - sega_315_5195_custom_io_write_do = NULL; -} - -INT32 sega_315_5195_scan(INT32 nAction) -{ - if (!mapper_in_use) return 0; - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(chip.regs); - SCAN_VAR(open_bus_recurse); - - if (nAction & ACB_WRITE) { - SekOpen(0); - update_mapping(); - SekClose(); - } - } - - return 0; -} diff --git a/jan/src/burn/drv/sega/sys16.h b/jan/src/burn/drv/sega/sys16.h deleted file mode 100644 index 1d5a65c3b..000000000 --- a/jan/src/burn/drv/sega/sys16.h +++ /dev/null @@ -1,342 +0,0 @@ -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "burn_ym2203.h" -#include "burn_ym2413.h" -#include "burn_ym2612.h" -#include "rf5c68.h" -#include "burn_gun.h" -#include "bitswap.h" -#include "genesis_vid.h" -#include "8255ppi.h" -#include "burn_shift.h" -#include "mcs51.h" -#include "resnet.h" -#include "msm6295.h" - -#define SYS16_ROM_PROG 1 -#define SYS16_ROM_TILES 2 -#define SYS16_ROM_SPRITES 3 -#define SYS16_ROM_Z80PROG 4 -#define SYS16_ROM_KEY 5 -#define SYS16_ROM_7751PROG 6 -#define SYS16_ROM_7751DATA 7 -#define SYS16_ROM_UPD7759DATA 8 -#define SYS16_ROM_PROG2 9 -#define SYS16_ROM_ROAD 10 -#define SYS16_ROM_PCMDATA 11 -#define SYS16_ROM_Z80PROG2 12 -#define SYS16_ROM_Z80PROG3 13 -#define SYS16_ROM_Z80PROG4 14 -#define SYS16_ROM_PCM2DATA 15 -#define SYS16_ROM_PROM 16 -#define SYS16_ROM_PROG3 17 -#define SYS16_ROM_SPRITES2 18 -#define SYS16_ROM_RF5C68DATA 19 -#define SYS16_ROM_I8751 20 -#define SYS16_ROM_MSM6295 21 -#define SYS16_ROM_TILES_20000 22 - -// sys16_run.cpp -extern UINT8 System16InputPort0[8]; -extern UINT8 System16InputPort1[8]; -extern UINT8 System16InputPort2[8]; -extern UINT8 System16InputPort3[8]; -extern UINT8 System16InputPort4[8]; -extern UINT8 System16InputPort5[8]; -extern UINT8 System16InputPort6[8]; -extern UINT8 System16Gear; -extern INT32 System16AnalogPort0; -extern INT32 System16AnalogPort1; -extern INT32 System16AnalogPort2; -extern INT32 System16AnalogPort3; -extern INT32 System16AnalogPort4; -extern INT32 System16AnalogPort5; -extern INT32 System16AnalogSelect; -extern UINT8 System16Dip[3]; -extern UINT8 System16Input[7]; -extern UINT8 System16Reset; -extern UINT8 System16MCUData; -extern UINT8 *System16Rom; -extern UINT8 *System16Code; -extern UINT8 *System16Rom2; -extern UINT8 *System16Z80Rom; -extern UINT8 *System16Z80Code; -extern UINT8 *System16UPD7759Data; -extern UINT8 *System16PCMData; -extern UINT8 *System16RF5C68Data; -extern UINT8 *System16I8751Rom; -extern UINT8 *System16Prom; -extern UINT8 *System16Key; -extern UINT8 *System16Ram; -extern UINT8 *System16ExtraRam; -extern UINT8 *System16Z80Ram; -extern UINT8 *System16TempGfx; -extern UINT8 *System16PriorityMap; -extern UINT8 *System16TileRam; -extern UINT8 *System16TextRam; -extern UINT8 *System16TextRam; -extern UINT8 *System16SpriteRam; -extern UINT8 *System16SpriteRamBuff; -extern UINT8 *System16SpriteRam2; -extern UINT8 *System16RotateRam; -extern UINT8 *System16RotateRamBuff; -extern UINT8 *System16PaletteRam; -extern UINT8 *System16RoadRam; -extern UINT8 *System16RoadRamBuff; -extern UINT32 *System16Palette; -extern UINT8 *System16Tiles; -extern UINT8 *System16Sprites; -extern UINT8 *System16Sprites2; -extern UINT8 *System16Roads; -extern UINT32 System16NumTiles; -extern UINT32 System16RomSize; -extern UINT32 System16Rom2Size; -extern UINT32 System16TileRomSize; -extern UINT32 System16SpriteRomSize; -extern UINT32 System16Sprite2RomSize; -extern UINT32 System16RoadRomSize; -extern UINT32 System16Z80RomSize; -extern UINT32 System16Z80Rom2Num; -extern UINT32 System16PCMDataSize; -extern UINT32 System16PCMDataSizePreAllocate; -extern UINT32 System16ExtraRamSize; -extern UINT32 System16SpriteRamSize; -extern UINT32 System16SpriteRam2Size; -extern UINT32 System16RotateRamSize; -extern UINT32 System16UPD7759DataSize; -extern UINT32 System16I8751RomNum; -extern UINT32 System16MSM6295RomNum; - -extern UINT8 System16VideoControl; -extern INT32 System16SoundLatch; -extern bool System16BTileAlt; -extern bool Shangon; -extern bool Hangon; -extern bool AlienSyndrome; -extern bool HammerAway; -extern bool Lockonph; -extern bool System16Z80Enable; -extern bool System1668KEnable; - -extern INT32 System16YM2413IRQInterval; - -extern bool System16HasGears; - -extern INT32 nSystem16CyclesDone[4]; -extern UINT32 System16ClockSpeed; -extern UINT32 System16Z80ClockSpeed; - -extern UINT8* System16I8751InitialConfig; - -typedef void (*Sim8751)(); -extern Sim8751 Simulate8751; - -typedef void (*System16Map68K)(); -extern System16Map68K System16Map68KDo; - -typedef void (*System16MapZ80)(); -extern System16MapZ80 System16MapZ80Do; - -typedef INT32 (*System16CustomLoadRom)(); -extern System16CustomLoadRom System16CustomLoadRomDo; - -typedef INT32 (*System16CustomDecryptOpCode)(); -extern System16CustomDecryptOpCode System16CustomDecryptOpCodeDo; - -typedef UINT8 (*System16ProcessAnalogControls)(UINT16 value); -extern System16ProcessAnalogControls System16ProcessAnalogControlsDo; - -typedef void (*System16MakeAnalogInputs)(); -extern System16MakeAnalogInputs System16MakeAnalogInputsDo; - -UINT8 __fastcall System16PPIZ80PortRead(UINT16 a); -void __fastcall System16Z80PortWrite(UINT16 a, UINT8 d); - -INT32 System16LoadRoms(bool bLoad); - -INT32 CustomLoadRom20000(); -INT32 CustomLoadRom40000(); - -UINT16 System16MultiplyChipRead(INT32 which, INT32 offset); -void System16MultiplyChipWrite(INT32 which, INT32 offset, UINT16 data); -UINT16 System16CompareTimerChipRead(INT32 which, INT32 offset); -void System16CompareTimerChipWrite(INT32 which, INT32 offset, UINT16 data); -UINT16 System16DivideChipRead(INT32 which, INT32 offset); -void System16DivideChipWrite(INT32 which, INT32 offset, UINT16 data); - -INT32 System16Init(); -INT32 System16Exit(); -INT32 System16AFrame(); -INT32 System16BFrame(); -INT32 System18Frame(); -INT32 HangonFrame(); -INT32 HangonYM2203Frame(); -INT32 OutrunFrame(); -INT32 XBoardFrame(); -INT32 XBoardFrameGPRider(); -INT32 YBoardFrame(); -INT32 System16Scan(INT32 nAction, INT32 *pnMin); - -// d_sys16a.cpp -void System16APPI0WritePortA(UINT8 data); -void System16APPI0WritePortB(UINT8 data); -void System16APPI0WritePortC(UINT8 data); -UINT16 __fastcall System16AReadWord(UINT32 a); -UINT8 __fastcall System16AReadByte(UINT32 a); -void __fastcall System16AWriteWord(UINT32 a, UINT16 d); -void __fastcall System16AWriteByte(UINT32 a, UINT8 d); -UINT8 System16A_I8751ReadPort(INT32 port); -void System16A_I8751WritePort(INT32 port, UINT8 data); - -// d_sys16b.cpp - -// d_sys18.cpp -UINT8 system18_io_chip_r(UINT32 offset); -void system18_io_chip_w(UINT32 offset, UINT16 d); -void System18GfxBankWrite(UINT32 offset, UINT16 d); -void HamawayGfxBankWrite(UINT32 offset, UINT16 d); - -// d_hangon.cpp -void HangonPPI0WritePortA(UINT8 data); -void HangonPPI0WritePortB(UINT8 data); -void HangonPPI0WritePortC(UINT8 data); -UINT8 HangonPPI1ReadPortC(); -void HangonPPI1WritePortA(UINT8 data); -UINT16 __fastcall HangonReadWord(UINT32 a); -UINT8 __fastcall HangonReadByte(UINT32 a); -void __fastcall HangonWriteWord(UINT32 a, UINT16 d); -void __fastcall HangonWriteByte(UINT32 a, UINT8 d); - -// d_outrun.cpp -void OutrunPPI0WritePortC(UINT8 data); -UINT16 System16RoadControlRead(UINT32 a); -void System16RoadControlWrite(UINT32 offset, UINT16 d); -UINT16 __fastcall Outrun2ReadWord(UINT32 a); -UINT8 __fastcall Outrun2ReadByte(UINT32 a); -void __fastcall Outrun2WriteWord(UINT32 a, UINT16 d); -void __fastcall Outrun2WriteByte(UINT32 a, UINT8 d); - -// d_xbrd.cpp -UINT16 __fastcall XBoardReadWord(UINT32 a); -UINT8 __fastcall XBoardReadByte(UINT32 a); -void __fastcall XBoardWriteWord(UINT32 a, UINT16 d); -void __fastcall XBoardWriteByte(UINT32 a, UINT8 d); -UINT16 __fastcall XBoard2ReadWord(UINT32 a); -UINT8 __fastcall XBoard2ReadByte(UINT32 a); -void __fastcall XBoard2WriteWord(UINT32 a, UINT16 d); -void __fastcall XBoard2WriteByte(UINT32 a, UINT8 d); - -// d_ybrd.cpp -UINT16 __fastcall YBoardReadWord(UINT32 a); -UINT8 __fastcall YBoardReadByte(UINT32 a); -void __fastcall YBoardWriteWord(UINT32 a, UINT16 d); -void __fastcall YBoardWriteByte(UINT32 a, UINT8 d); -UINT16 __fastcall YBoard2ReadWord(UINT32 a); -void __fastcall YBoard2WriteWord(UINT32 a, UINT16 d); -UINT16 __fastcall YBoard3ReadWord(UINT32 a); -UINT8 __fastcall YBoard3ReadByte(UINT32 a); -void __fastcall YBoard3WriteWord(UINT32 a, UINT16 d); - -// sys16_gfx.cpp -extern INT32 System16VideoEnable; -extern INT32 System18VdpEnable; -extern INT32 System18VdpMixing; -extern INT32 System16ScreenFlip; -extern INT32 System16SpriteShadow; -extern INT32 System16SpriteXOffset; -extern INT32 System16SpriteBanks[16]; -extern INT32 System16TileBanks[8]; -extern INT32 System16OldTileBanks[8]; -extern INT32 System16Page[4]; -extern INT32 System16OldPage[4]; -extern UINT8 BootlegFgPage[4]; -extern UINT8 BootlegBgPage[4]; -extern INT32 System16ScrollX[4]; -extern INT32 System16ScrollY[4]; -extern INT32 System16ColScroll; -extern INT32 System16RowScroll; -extern INT32 System16RoadControl; -extern INT32 System16RoadColorOffset1; -extern INT32 System16RoadColorOffset2; -extern INT32 System16RoadColorOffset3; -extern INT32 System16RoadXOffset; -extern INT32 System16RoadPriority; -extern INT32 System16PaletteEntries; -extern INT32 System16SpritePalOffset; -extern INT32 System16TilemapColorOffset; -extern INT32 System16TileBankSize; -extern INT32 System16RecalcBgTileMap; -extern INT32 System16RecalcBgAltTileMap; -extern INT32 System16RecalcFgTileMap; -extern INT32 System16RecalcFgAltTileMap; -extern INT32 System16CreateOpaqueTileMaps; -extern INT32 System16IgnoreVideoEnable; - -extern bool bSystem16BootlegRender; - -extern UINT16 *pTempDraw; - -void System16PaletteInit(); -void System16PaletteExit(); - -void System16GfxScan(INT32 nAction); -void System16Decode8x8Tiles(UINT8 *pTile, INT32 Num, INT32 offs1, INT32 offs2, INT32 offs3); -void OutrunDecodeRoad(); -void HangonDecodeRoad(); -void System16ATileMapsInit(INT32 bOpaque); -void System16BTileMapsInit(INT32 bOpaque); -void System16TileMapsExit(); -void System16ARender(); -void System16BRender(); -void System16BootlegRender(); -void System16BAltRender(); -void System16ATileByteWrite(UINT32 Offset, UINT8 d); -void System16ATileWordWrite(UINT32 Offset, UINT16 d); -void System16BTileByteWrite(UINT32 Offset, UINT8 d); -void System16BTileWordWrite(UINT32 Offset, UINT16 d); -void System18Render(); -void HangonRender(); -void HangonAltRender(); -void OutrunRender(); -void ShangonRender(); -void XBoardRender(); -void YBoardRender(); - -// fd1089.cpp -void FD1089Decrypt(); - -// sys16_fd1094.cpp -extern UINT16* fd1094_userregion; - -void fd1094_driver_init(INT32 nCPU); -void fd1094_machine_init(); -void fd1094_exit(); -void fd1094_scan(INT32 nAction); - -// genesis_vid.cpp - -// sega_315_5195.cpp -extern bool LaserGhost; - -typedef UINT8 (*sega_315_5195_custom_io)(UINT32); -extern sega_315_5195_custom_io sega_315_5195_custom_io_do; - -typedef void (*sega_315_5195_custom_io_write)(UINT32, UINT8); -extern sega_315_5195_custom_io_write sega_315_5195_custom_io_write_do; - -UINT8 sega_315_5195_io_read(UINT32 offset); -void sega_315_5195_io_write(UINT32 offset, UINT8 d); -UINT8 __fastcall sega_315_5195_read_byte(UINT32 a); -UINT16 __fastcall sega_315_5195_read_word(UINT32 a); -void __fastcall sega_315_5195_write_byte(UINT32 a, UINT8 d); -void __fastcall sega_315_5195_write_word(UINT32 a, UINT16 d); -UINT8 sega_315_5195_i8751_read_port(INT32 port); -void sega_315_5195_i8751_write_port(INT32 port, UINT8 data); - -void sega_315_5195_reset(); -void sega_315_5195_configure_explicit(UINT8 *map_data); -void sega_315_5195_init(); -void sega_315_5195_exit(); -INT32 sega_315_5195_scan(INT32 nAction); diff --git a/jan/src/burn/drv/sega/sys16_fd1094.cpp b/jan/src/burn/drv/sega/sys16_fd1094.cpp deleted file mode 100644 index 0ce08c1d3..000000000 --- a/jan/src/burn/drv/sega/sys16_fd1094.cpp +++ /dev/null @@ -1,251 +0,0 @@ -#include "sys16.h" -#include "fd1094.h" - -#define S16_NUMCACHE 8 - -static UINT8 *fd1094_key; // the memory region containing key -static UINT16 *fd1094_cpuregion; // the CPU region with encrypted code -static UINT32 fd1094_cpuregionsize; // the size of this region in bytes - -UINT16* fd1094_userregion; // a user region where the current decrypted state is put and executed from -static UINT16* fd1094_cacheregion[S16_NUMCACHE]; // a cache region where S16_NUMCACHE states are stored to improve performance -static INT32 fd1094_cached_states[S16_NUMCACHE]; // array of cached state numbers -static INT32 fd1094_current_cacheposition; // current position in cache array - -static INT32 fd1094_state; -static INT32 fd1094_selected_state; - -static INT32 nFD1094CPU = 0; - -bool System18Banking; -/* -static void *fd1094_get_decrypted_base(void) -{ - if (!fd1094_key) - return NULL; - return fd1094_userregion; -}*/ - -/* this function checks the cache to see if the current state is cached, - if it is then it copies the cached data to the user region where code is - executed from, if its not cached then it gets decrypted to the current - cache position using the functions in fd1094.c */ -static void fd1094_setstate_and_decrypt(INT32 state) -{ - INT32 i; - UINT32 addr; - - switch (state & 0x300) { - case 0x000: - case FD1094_STATE_RESET: - fd1094_selected_state = state & 0xff; - break; - } - - fd1094_state = state; - - // force a flush of the prefetch cache - m68k_set_reg(M68K_REG_PREF_ADDR, 0x1000); - - /* set the FD1094 state ready to decrypt.. */ - state = fd1094_set_state(fd1094_key,state); - - /* first check the cache, if its cached we don't need to decrypt it, just copy */ - for (i=0;i=S16_NUMCACHE) - { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("out of cache, performance may suffer, increase S16_NUMCACHE!\n")); -#endif - fd1094_current_cacheposition=0; - } -} - -/* Callback for CMP.L instructions (state change) */ -INT32 __fastcall fd1094_cmp_callback(UINT32 val, INT32 reg) -{ - if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ? - { - fd1094_setstate_and_decrypt((val & 0xffff0000) >> 16); - } - - return 0; -} - -/* Callback when the FD1094 enters interrupt code */ -INT32 __fastcall fd1094_int_callback (INT32 irq) -{ - fd1094_setstate_and_decrypt(FD1094_STATE_IRQ); - return (0x60+irq*4)/4; // vector address -} - -INT32 __fastcall fd1094_rte_callback (void) -{ - fd1094_setstate_and_decrypt(FD1094_STATE_RTE); - - return 0; -} - -void fd1094_kludge_reset_values(void) -{ - INT32 i; - - for (i = 0;i < 4;i++) { - fd1094_userregion[i] = fd1094_decode(i,fd1094_cpuregion[i],fd1094_key,1); - } - - SekOpen(nFD1094CPU); - SekMapMemory((UINT8*)fd1094_userregion, 0x000000, 0x0fffff, MAP_FETCH); -// if (System18Banking) SekMapMemory((UINT8*)fd1094_userregion + 0x200000, 0x200000, 0x27ffff, MAP_FETCH); - SekClose(); -} - - -/* function, to be called from MACHINE_RESET (every reset) */ -void fd1094_machine_init(void) -{ - fd1094_setstate_and_decrypt(FD1094_STATE_RESET); - fd1094_kludge_reset_values(); - - SekOpen(nFD1094CPU); - SekSetCmpCallback(fd1094_cmp_callback); - SekSetRTECallback(fd1094_rte_callback); - SekSetIrqCallback(fd1094_int_callback); - SekClose(); -} - -/* startup function, to be called from DRIVER_INIT (once on startup) */ -void fd1094_driver_init(INT32 nCPU) -{ - INT32 i; - - nFD1094CPU = nCPU; - - if (nFD1094CPU == 0) { - fd1094_cpuregion = (UINT16*)System16Rom; - fd1094_cpuregionsize = System16RomSize; - } - - if (nFD1094CPU == 1) { - fd1094_cpuregion = (UINT16*)System16Rom2; - fd1094_cpuregionsize = System16Rom2Size; - } - - if (nFD1094CPU >= 2) { - bprintf(PRINT_ERROR, _T("Invalid CPU called for FD1094 Driver Init\n")); - } - - fd1094_key = System16Key; - - /* punt if no key; this allows us to be called even for non-FD1094 games */ - if (!fd1094_key) - return; - - for (i=0;i 0x0fffff) System18Banking = true; -} - -void fd1094_exit() -{ - System18Banking = false; - nFD1094CPU = 0; - - for (INT32 i = 0; i < S16_NUMCACHE; i++) { - BurnFree(fd1094_cacheregion[i]); - } - - fd1094_current_cacheposition = 0; -} - -void fd1094_scan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(fd1094_selected_state); - SCAN_VAR(fd1094_state); - - if (nAction & ACB_WRITE) { - if (fd1094_state != -1) { - INT32 selected_state = fd1094_selected_state; - INT32 state = fd1094_state; - - fd1094_machine_init(); - - fd1094_setstate_and_decrypt(selected_state); - fd1094_setstate_and_decrypt(state); - } - } - } -} diff --git a/jan/src/burn/drv/sega/sys16_gfx.cpp b/jan/src/burn/drv/sega/sys16_gfx.cpp deleted file mode 100644 index 46f6398fe..000000000 --- a/jan/src/burn/drv/sega/sys16_gfx.cpp +++ /dev/null @@ -1,3429 +0,0 @@ -#include "sys16.h" - -INT32 System16SpriteBanks[16]; -INT32 System16TileBanks[8]; -INT32 System16OldTileBanks[8]; -INT32 System16Page[4]; -INT32 System16OldPage[4]; -UINT8 BootlegFgPage[4]; -UINT8 BootlegBgPage[4]; -INT32 System16ScrollX[4] = {0, 0, 0, 0}; -INT32 System16ScrollY[4] = {0, 0, 0, 0}; -INT32 System16VideoEnable; -INT32 System18VdpEnable; -INT32 System18VdpMixing; -INT32 System16ScreenFlip; -INT32 System16SpriteShadow; -INT32 System16SpriteXOffset = 0; -INT32 System16ColScroll = 0; -INT32 System16RowScroll = 0; -INT32 System16RoadControl = 0; -INT32 System16RoadColorOffset1 = 0; -INT32 System16RoadColorOffset2 = 0; -INT32 System16RoadColorOffset3 = 0; -INT32 System16RoadXOffset = 0; -INT32 System16RoadPriority = 0; -INT32 System16PaletteEntries = 0; -INT32 System16SpritePalOffset = 0x400; -INT32 System16TilemapColorOffset = 0; -INT32 System16TileBankSize = 0; -INT32 System16RecalcBgTileMap = 0; -INT32 System16RecalcBgAltTileMap = 0; -INT32 System16RecalcFgTileMap = 0; -INT32 System16RecalcFgAltTileMap = 0; -INT32 System16CreateOpaqueTileMaps = 0; -INT32 System16IgnoreVideoEnable = 0; - -bool bSystem16BootlegRender; - -UINT16 *pTempDraw = NULL; -static UINT16 *pSys16BgTileMapOpaque = NULL; -static UINT16 *pSys16BgAltTileMapOpaque = NULL; -static UINT16 *pSys16BgTileMapPri0 = NULL; -static UINT16 *pSys16BgTileMapPri1 = NULL; -static UINT16 *pSys16FgTileMapPri0 = NULL; -static UINT16 *pSys16FgTileMapPri1 = NULL; -static UINT16 *pSys16BgAltTileMapPri0 = NULL; -static UINT16 *pSys16BgAltTileMapPri1 = NULL; -static UINT16 *pSys16FgAltTileMapPri0 = NULL; -static UINT16 *pSys16FgAltTileMapPri1 = NULL; - -static UINT8 System16PaletteNormal[32]; -static UINT8 System16PaletteShadow[32]; -static UINT8 System16PaletteHilight[32]; - -/*==================================================== -Scan Function -====================================================*/ - -void System16GfxScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - if (nAction & ACB_WRITE) { - if (((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16A) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_HANGON)) { - System16RecalcBgTileMap = 1; - System16RecalcFgTileMap = 1; - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMX)) { - System16RecalcFgAltTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcBgTileMap = 1; - System16RecalcBgAltTileMap = 1; - System16RecalcFgTileMap = 1; - System16RecalcFgAltTileMap = 1; - } - } - } -} - -/*==================================================== -Decode Functions -====================================================*/ - -void System16Decode8x8Tiles(UINT8 *pTile, INT32 Num, INT32 offs1, INT32 offs2, INT32 offs3) -{ - INT32 c, y, x, Dat1, Dat2, Dat3, Col; - - for (c = 0; c < Num; c++) { - for (y = 0; y < 8; y++) { - Dat1 = System16TempGfx[offs1 + (c * 8) + y]; - Dat2 = System16TempGfx[offs2 + (c * 8) + y]; - Dat3 = System16TempGfx[offs3 + (c * 8) + y]; - for (x = 0; x < 8; x++) { - Col = 0; - if (Dat1 & 1) { Col |= 4;} - if (Dat2 & 1) { Col |= 2;} - if (Dat3 & 1) { Col |= 1;} - pTile[(c * 64) + (y * 8) + (7 - x)] = Col; - Dat1 >>= 1; - Dat2 >>= 1; - Dat3 >>= 1; - } - } - } -} - -void OutrunDecodeRoad() -{ - for (INT32 y = 0; y < 256 * 2; y++) { - UINT8 *src = System16TempGfx + ((y & 0xff) * 0x40 + (y >> 8) * 0x8000) % System16RoadRomSize; - UINT8 *dst = System16Roads + y * 512; - - /* loop over columns */ - for (INT32 x = 0; x < 512; x++) - { - dst[x] = (((src[x/8] >> (~x & 7)) & 1) << 0) | (((src[x/8 + 0x4000] >> (~x & 7)) & 1) << 1); - - /* pre-mark road data in the "stripe" area with a high bit */ - if (x >= 256-8 && x < 256 && dst[x] == 3) - dst[x] |= 4; - } - } - - /* set up a dummy road in the last entry */ - memset(System16Roads + 256 * 2 * 512, 3, 512); -} - -void HangonDecodeRoad() -{ - INT32 x, y; - - /* loop over rows */ - for (y = 0; y < 256; y++) - { - UINT8 *src = System16TempGfx + ((y & 0xff) * 0x40) % System16RoadRomSize; - UINT8 *dst = System16Roads + y * 512; - - /* loop over columns */ - for (x = 0; x < 512; x++) - dst[x] = (((src[x/8] >> (~x & 7)) & 1) << 0) | (((src[x/8 + 0x4000] >> (~x & 7)) & 1) << 1); - } -} - -/*==================================================== -Tile Layer Rendering -====================================================*/ - -#define PLOTPIXEL(x, po) pPixel[x] = nPalette | pTileData[x] | po; -#define PLOTPIXEL_MASK(x, mc, po) if (pTileData[x] != mc) {pPixel[x] = nPalette | pTileData[x] | po;} - -static inline void RenderTile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * 1024) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += 1024, pTileData += 8) { - PLOTPIXEL(0, nPaletteOffset); - PLOTPIXEL(1, nPaletteOffset); - PLOTPIXEL(2, nPaletteOffset); - PLOTPIXEL(3, nPaletteOffset); - PLOTPIXEL(4, nPaletteOffset); - PLOTPIXEL(5, nPaletteOffset); - PLOTPIXEL(6, nPaletteOffset); - PLOTPIXEL(7, nPaletteOffset); - } -} - -static void RenderTile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * 1024) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += 1024, pTileData += 8) { - PLOTPIXEL_MASK(0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(7, nMaskColour, nPaletteOffset); - } -} - -#undef PLOTPIXEL -#undef PLOTPIXEL_MASK - -void System16ATileMapsInit(INT32 bOpaque) -{ - if (bOpaque) { - pSys16BgTileMapOpaque = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - } - - pSys16BgTileMapPri0 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16BgTileMapPri1 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16FgTileMapPri0 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16FgTileMapPri1 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); -} - -void System16BTileMapsInit(INT32 bOpaque) -{ - if (bOpaque) { - pSys16BgTileMapOpaque = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16BgAltTileMapOpaque = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - } - - pSys16BgTileMapPri0 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16BgTileMapPri1 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16FgTileMapPri0 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16FgTileMapPri1 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - - pSys16BgAltTileMapPri0 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16BgAltTileMapPri1 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16FgAltTileMapPri0 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - pSys16FgAltTileMapPri1 = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); -} - -void System16TileMapsExit() -{ - BurnFree(pSys16BgTileMapOpaque); - BurnFree(pSys16BgAltTileMapOpaque); - BurnFree(pSys16BgTileMapPri0); - BurnFree(pSys16BgTileMapPri1); - BurnFree(pSys16FgTileMapPri0); - BurnFree(pSys16FgTileMapPri1); - BurnFree(pSys16BgAltTileMapPri0); - BurnFree(pSys16BgAltTileMapPri1); - BurnFree(pSys16FgAltTileMapPri0); - BurnFree(pSys16FgAltTileMapPri1); -} - -static void System16ACreateBgTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, i, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - UINT16 *pDest = NULL; - - if (System16CreateOpaqueTileMaps) memset(pSys16BgTileMapOpaque, 0, 1024 * 512 * sizeof(UINT16)); - EffPage = System16Page[1]; - EffPage = ((EffPage >> 4) & 0x0707) | ((EffPage << 4) & 0x7070); - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_HANGON) EffPage &= 0x3333; - for (i = 0; i < 2; i++) { - if (i == 0) pDest = pSys16BgTileMapPri0; - if (i == 1) pDest = pSys16BgTileMapPri1; - memset(pDest, 0, 1024 * 512 * sizeof(UINT16)); - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 12) & 1; - - if (Priority != i) continue; - - x = 8 * mx; - x += xOffs; - - Code = ((Attr >> 1) & 0x1000) | (Attr & 0xfff); - Code &= (System16NumTiles - 1); - Colour = (Attr >> 5) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = 0x100 | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = 0x200 | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = 0x300 | System16TilemapColorOffset; - - if (System16CreateOpaqueTileMaps) RenderTile(pSys16BgTileMapOpaque, Code, x, y, Colour, 3, ColourOff, System16Tiles); - RenderTile_Mask(pDest, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - } - } - } - } -} - -static void System16ACreateFgTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - - memset(pSys16FgTileMapPri0, 0, 1024 * 512 * sizeof(UINT16)); - memset(pSys16FgTileMapPri1, 0, 1024 * 512 * sizeof(UINT16)); - - EffPage = System16Page[0]; - EffPage = ((EffPage >> 4) & 0x0707) | ((EffPage << 4) & 0x7070); - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_HANGON) EffPage &= 0x3333; - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 12) & 1; - - x = 8 * mx; - x += xOffs; - - Code = ((Attr >> 1) & 0x1000) | (Attr & 0xfff); - Code &= (System16NumTiles - 1); - Colour = (Attr >> 5) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = 0x100 | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = 0x200 | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = 0x300 | System16TilemapColorOffset; - - if (Priority == 0) RenderTile_Mask(pSys16FgTileMapPri0, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - if (Priority == 1) RenderTile_Mask(pSys16FgTileMapPri1, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - } - } - } -} - -static void System16BCreateBgTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, i, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - UINT16 *pDest = NULL; - - INT32 ColourDepth = 3; - INT32 ColourOffsMultiplier = 1; - if (Lockonph) { - ColourDepth = 4; - ColourOffsMultiplier = 2; - } - - if (System16CreateOpaqueTileMaps) memset(pSys16BgTileMapOpaque, 0, 1024 * 512 * sizeof(UINT16)); - EffPage = System16Page[1]; - for (i = 0; i < 2; i++) { - if (i == 0) pDest = pSys16BgTileMapPri0; - if (i == 1) pDest = pSys16BgTileMapPri1; - memset(pDest, 0, 1024 * 512 * sizeof(UINT16)); - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 15) & 1; - - if (Priority != i) continue; - - x = 8 * mx; - x += xOffs; - - Code = Attr & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Attr >> 6) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = (0x100 * ColourOffsMultiplier) | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = (0x200 * ColourOffsMultiplier) | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = (0x300 * ColourOffsMultiplier) | System16TilemapColorOffset; - - if (System16CreateOpaqueTileMaps) RenderTile(pSys16BgTileMapOpaque, Code, x, y, Colour, ColourDepth, ColourOff, System16Tiles); - RenderTile_Mask(pDest, Code, x, y, Colour, ColourDepth, 0, ColourOff, System16Tiles); - } - } - } - } -} - -static void System16BCreateBgAltTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, i, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - UINT16 *pDest = NULL; - - INT32 ColourDepth = 3; - INT32 ColourOffsMultiplier = 1; - if (Lockonph) { - ColourDepth = 4; - ColourOffsMultiplier = 2; - } - - if (System16CreateOpaqueTileMaps) memset(pSys16BgAltTileMapOpaque, 0, 1024 * 512 * sizeof(UINT16)); - EffPage = System16Page[3]; - for (i = 0; i < 2; i++) { - if (i == 0) pDest = pSys16BgAltTileMapPri0; - if (i == 1) pDest = pSys16BgAltTileMapPri1; - if (System16RecalcBgAltTileMap) memset(pDest, 0,1024 * 512 * sizeof(UINT16)); - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 15) & 1; - - if (Priority != i) continue; - - x = 8 * mx; - x += xOffs; - - Code = Attr & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Attr >> 6) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = (0x100 * ColourOffsMultiplier) | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = (0x200 * ColourOffsMultiplier) | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = (0x300 * ColourOffsMultiplier) | System16TilemapColorOffset; - - if (System16CreateOpaqueTileMaps) RenderTile(pSys16BgAltTileMapOpaque, Code, x, y, Colour, ColourDepth, ColourOff, System16Tiles); - if (System16RecalcBgAltTileMap) RenderTile_Mask(pDest, Code, x, y, Colour, ColourDepth, 0, ColourOff, System16Tiles); - } - } - } - } -} - -static void System16BCreateFgTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - - INT32 ColourDepth = 3; - INT32 ColourOffsMultiplier = 1; - if (Lockonph) { - ColourDepth = 4; - ColourOffsMultiplier = 2; - } - - memset(pSys16FgTileMapPri0, 0, 1024 * 512 * sizeof(UINT16)); - memset(pSys16FgTileMapPri1, 0, 1024 * 512 * sizeof(UINT16)); - - EffPage = System16Page[0]; - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 15) & 1; - - x = 8 * mx; - x += xOffs; - - Code = Attr & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Attr >> 6) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = (0x100 * ColourOffsMultiplier) | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = (0x200 * ColourOffsMultiplier) | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = (0x300 * ColourOffsMultiplier) | System16TilemapColorOffset; - - if (Priority == 0) RenderTile_Mask(pSys16FgTileMapPri0, Code, x, y, Colour, ColourDepth, 0, ColourOff, System16Tiles); - if (Priority == 1) RenderTile_Mask(pSys16FgTileMapPri1, Code, x, y, Colour, ColourDepth, 0, ColourOff, System16Tiles); - } - } - } -} - -static void System16BCreateFgAltTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - - INT32 ColourDepth = 3; - INT32 ColourOffsMultiplier = 1; - if (Lockonph) { - ColourDepth = 4; - ColourOffsMultiplier = 2; - } - - memset(pSys16FgAltTileMapPri0, 0, 1024 * 512 * sizeof(UINT16)); - memset(pSys16FgAltTileMapPri1, 0, 1024 * 512 * sizeof(UINT16)); - - EffPage = System16Page[2]; - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 15) & 1; - - x = 8 * mx; - x += xOffs; - - Code = Attr & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Attr >> 6) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = (0x100 * ColourOffsMultiplier) | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = (0x200 * ColourOffsMultiplier) | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = (0x300 * ColourOffsMultiplier) | System16TilemapColorOffset; - - if (Priority == 0) RenderTile_Mask(pSys16FgAltTileMapPri0, Code, x, y, Colour, ColourDepth, 0, ColourOff, System16Tiles); - if (Priority == 1) RenderTile_Mask(pSys16FgAltTileMapPri1, Code, x, y, Colour, ColourDepth, 0, ColourOff, System16Tiles); - } - } - } -} - -static void System16BAltCreateBgTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, i, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - UINT16 *pDest = NULL; - - if (System16CreateOpaqueTileMaps) memset(pSys16BgTileMapOpaque, 0, 1024 * 512 * sizeof(UINT16)); - EffPage = System16Page[1]; - for (i = 0; i < 2; i++) { - if (i == 0) pDest = pSys16BgTileMapPri0; - if (i == 1) pDest = pSys16BgTileMapPri1; - memset(pDest, 0, 1024 * 512 * sizeof(UINT16)); - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 15) & 1; - - if (Priority != i) continue; - - x = 8 * mx; - x += xOffs; - - Code = Attr & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Attr >> 5) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = 0x100 | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = 0x200 | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = 0x300 | System16TilemapColorOffset; - - if (System16CreateOpaqueTileMaps) RenderTile(pSys16BgTileMapOpaque, Code, x, y, Colour, 3, ColourOff, System16Tiles); - RenderTile_Mask(pDest, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - } - } - } - } -} - -static void System16BAltCreateBgAltTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, i, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - UINT16 *pDest = NULL; - - if (System16CreateOpaqueTileMaps) memset(pSys16BgAltTileMapOpaque, 0, 1024 * 512 * sizeof(UINT16)); - EffPage = System16Page[3]; - for (i = 0; i < 2; i++) { - if (i == 0) pDest = pSys16BgAltTileMapPri0; - if (i == 1) pDest = pSys16BgAltTileMapPri1; - if (System16RecalcBgAltTileMap) memset(pDest, 0,1024 * 512 * sizeof(UINT16)); - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 15) & 1; - - if (Priority != i) continue; - - x = 8 * mx; - x += xOffs; - - Code = Attr & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Attr >> 5) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = 0x100 | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = 0x200 | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = 0x300 | System16TilemapColorOffset; - - if (System16CreateOpaqueTileMaps) RenderTile(pSys16BgAltTileMapOpaque, Code, x, y, Colour, 3, ColourOff, System16Tiles); - if (System16RecalcBgAltTileMap) RenderTile_Mask(pDest, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - } - } - } - } -} - -static void System16BAltCreateFgTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - - memset(pSys16FgTileMapPri0, 0, 1024 * 512 * sizeof(UINT16)); - memset(pSys16FgTileMapPri1, 0, 1024 * 512 * sizeof(UINT16)); - - EffPage = System16Page[0]; - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 15) & 1; - - x = 8 * mx; - x += xOffs; - - Code = Attr & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Attr >> 5) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = 0x100 | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = 0x200 | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = 0x300 | System16TilemapColorOffset; - - if (Priority == 0) RenderTile_Mask(pSys16FgTileMapPri0, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - if (Priority == 1) RenderTile_Mask(pSys16FgTileMapPri1, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - } - } - } -} - -static void System16BAltCreateFgAltTileMaps() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex, Priority, ColourOff, TilePage, xOffs, yOffs; - UINT16 *VideoRam = (UINT16*)System16TileRam; - UINT16 EffPage, ActPage; - - memset(pSys16FgAltTileMapPri0, 0, 1024 * 512 * sizeof(UINT16)); - memset(pSys16FgAltTileMapPri1, 0, 1024 * 512 * sizeof(UINT16)); - - EffPage = System16Page[2]; - for (TilePage = 0; TilePage < 4; TilePage++) { - ActPage = (EffPage >> 0) & 0x0f; - xOffs = 0; - yOffs = 0; - if (TilePage == 1) { ActPage = (EffPage >> 4) & 0x0f; xOffs = 512; } - if (TilePage == 2) { ActPage = (EffPage >> 8) & 0x0f; yOffs = 256; } - if (TilePage == 3) { ActPage = (EffPage >> 12) & 0x0f; xOffs = 512; yOffs = 256; } - for (my = 0; my < 32; my++) { - y = 8 * my; - y += yOffs; - for (mx = 0; mx < 64; mx++) { - TileIndex = (ActPage * 64 * 32) + (my * 64) + mx; - - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Priority = (Attr >> 15) & 1; - - x = 8 * mx; - x += xOffs; - - Code = Attr & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Attr >> 5) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = 0x100 | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = 0x200 | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = 0x300 | System16TilemapColorOffset; - - if (Priority == 0) RenderTile_Mask(pSys16FgAltTileMapPri0, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - if (Priority == 1) RenderTile_Mask(pSys16FgAltTileMapPri1, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - } - } - } -} - -static void System16ACreateTileMaps() -{ - if (System16RecalcBgTileMap) { - System16ACreateBgTileMaps(); - System16RecalcBgTileMap = 0; - } - - if (System16RecalcFgTileMap) { - System16ACreateFgTileMaps(); - System16RecalcFgTileMap = 0; - } -} - -static void System16BCreateTileMaps() -{ - UINT16 *TextRam = (UINT16*)System16TextRam; - INT32 i; - - // Check if we need the alt tilemaps - if (System16RecalcFgAltTileMap) { - System16RecalcFgAltTileMap = 0; - for (i = 0xf80/2 + 0 * 0x40/2; i < 0xf80/2 + 0 * 0x40/2 + 224/8; i++) { - if (TextRam[i] & 0x8000) System16RecalcFgAltTileMap = 1; - } - } - - if (System16RecalcBgAltTileMap) { - System16RecalcBgAltTileMap = 0; - for (i = 0xf80/2 + 1 * 0x40/2; i < 0xf80/2 + 1 * 0x40/2 + 224/8; i++) { - if (TextRam[i] & 0x8000) System16RecalcBgAltTileMap = 1; - } - } - - if (System16RecalcBgTileMap) { - System16BCreateBgTileMaps(); - System16RecalcBgTileMap = 0; - } - - if (System16RecalcBgAltTileMap) { - System16BCreateBgAltTileMaps(); - System16RecalcBgAltTileMap = 0; - } - - if (System16RecalcFgTileMap) { - System16BCreateFgTileMaps(); - System16RecalcFgTileMap = 0; - } - - if (System16RecalcFgAltTileMap) { - System16BCreateFgAltTileMaps(); - System16RecalcFgAltTileMap = 0; - } -} - -static void System16BAltCreateTileMaps() -{ - UINT16 *TextRam = (UINT16*)System16TextRam; - INT32 i; - - // Check if we need the alt tilemaps - if (System16RecalcFgAltTileMap) { - System16RecalcFgAltTileMap = 0; - for (i = 0xf80/2 + 0 * 0x40/2; i < 0xf80/2 + 0 * 0x40/2 + 224/8; i++) { - if (TextRam[i] & 0x8000) System16RecalcFgAltTileMap = 1; - } - } - - if (System16RecalcBgAltTileMap) { - System16RecalcBgAltTileMap = 0; - for (i = 0xf80/2 + 1 * 0x40/2; i < 0xf80/2 + 1 * 0x40/2 + 224/8; i++) { - if (TextRam[i] & 0x8000) System16RecalcBgAltTileMap = 1; - } - } - - if (System16RecalcBgTileMap) { - System16BAltCreateBgTileMaps(); - System16RecalcBgTileMap = 0; - } - - if (System16RecalcBgAltTileMap) { - System16BAltCreateBgAltTileMaps(); - System16RecalcBgAltTileMap = 0; - } - - if (System16RecalcFgTileMap) { - System16BAltCreateFgTileMaps(); - System16RecalcFgTileMap = 0; - } - - if (System16RecalcFgAltTileMap) { - System16BAltCreateFgAltTileMaps(); - System16RecalcFgAltTileMap = 0; - } -} - -void System16ATileWordWrite(UINT32 Offset, UINT16 d) -{ - UINT16 *TileRam = (UINT16*)System16TileRam; - - UINT32 FgPage1Addr = (((System16Page[0] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage2Addr = (((System16Page[0] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage3Addr = (((System16Page[0] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage4Addr = (((System16Page[0] >> 12) & 0xf) * (32 * 64)) << 1; - - UINT32 BgPage1Addr = (((System16Page[1] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage2Addr = (((System16Page[1] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage3Addr = (((System16Page[1] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage4Addr = (((System16Page[1] >> 12) & 0xf) * (32 * 64)) << 1; - - if ((Offset >= FgPage1Addr && Offset <= (FgPage1Addr + 0xfff)) || (Offset >= FgPage2Addr && Offset <= (FgPage2Addr + 0xfff)) || (Offset >= FgPage3Addr && Offset <= (FgPage3Addr + 0xfff)) || (Offset >= FgPage4Addr && Offset <= (FgPage4Addr + 0xfff))) { - if (TileRam[Offset >> 1] != BURN_ENDIAN_SWAP_INT16(d)) System16RecalcFgTileMap = 1; - } - - if ((Offset >= BgPage1Addr && Offset <= (BgPage1Addr + 0xfff)) || (Offset >= BgPage2Addr && Offset <= (BgPage2Addr + 0xfff)) || (Offset >= BgPage3Addr && Offset <= (BgPage3Addr + 0xfff)) || (Offset >= BgPage4Addr && Offset <= (BgPage4Addr + 0xfff))) { - if (TileRam[Offset >> 1] != BURN_ENDIAN_SWAP_INT16(d)) System16RecalcBgTileMap = 1; - } - - TileRam[Offset >> 1] = BURN_ENDIAN_SWAP_INT16(d); -} - -void System16ATileByteWrite(UINT32 Offset, UINT8 d) -{ - UINT32 FgPage1Addr = (((System16Page[0] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage2Addr = (((System16Page[0] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage3Addr = (((System16Page[0] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage4Addr = (((System16Page[0] >> 12) & 0xf) * (32 * 64)) << 1; - - UINT32 BgPage1Addr = (((System16Page[1] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage2Addr = (((System16Page[1] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage3Addr = (((System16Page[1] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage4Addr = (((System16Page[1] >> 12) & 0xf) * (32 * 64)) << 1; - - if ((Offset >= FgPage1Addr && Offset <= (FgPage1Addr + 0xfff)) || (Offset >= FgPage2Addr && Offset <= (FgPage2Addr + 0xfff)) || (Offset >= FgPage3Addr && Offset <= (FgPage3Addr + 0xfff)) || (Offset >= FgPage4Addr && Offset <= (FgPage4Addr + 0xfff))) { - if (System16TileRam[Offset] != d) System16RecalcFgTileMap = 1; - } - - if ((Offset >= BgPage1Addr && Offset <= (BgPage1Addr + 0xfff)) || (Offset >= BgPage2Addr && Offset <= (BgPage2Addr + 0xfff)) || (Offset >= BgPage3Addr && Offset <= (BgPage3Addr + 0xfff)) || (Offset >= BgPage4Addr && Offset <= (BgPage4Addr + 0xfff))) { - if (System16TileRam[Offset] != d) System16RecalcBgTileMap = 1; - } - - System16TileRam[Offset] = d; -} - -void System16BTileWordWrite(UINT32 Offset, UINT16 d) -{ - UINT16 *TileRam = (UINT16*)System16TileRam; - - UINT32 FgPage1Addr = (((System16Page[0] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage2Addr = (((System16Page[0] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage3Addr = (((System16Page[0] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage4Addr = (((System16Page[0] >> 12) & 0xf) * (32 * 64)) << 1; - - UINT32 BgPage1Addr = (((System16Page[1] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage2Addr = (((System16Page[1] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage3Addr = (((System16Page[1] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage4Addr = (((System16Page[1] >> 12) & 0xf) * (32 * 64)) << 1; - - UINT32 FgAltPage1Addr = (((System16Page[2] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 FgAltPage2Addr = (((System16Page[2] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 FgAltPage3Addr = (((System16Page[2] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 FgAltPage4Addr = (((System16Page[2] >> 12) & 0xf) * (32 * 64)) << 1; - - UINT32 BgAltPage1Addr = (((System16Page[3] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 BgAltPage2Addr = (((System16Page[3] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 BgAltPage3Addr = (((System16Page[3] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 BgAltPage4Addr = (((System16Page[3] >> 12) & 0xf) * (32 * 64)) << 1; - - if ((Offset >= FgPage1Addr && Offset <= (FgPage1Addr + 0xfff)) || (Offset >= FgPage2Addr && Offset <= (FgPage2Addr + 0xfff)) || (Offset >= FgPage3Addr && Offset <= (FgPage3Addr + 0xfff)) || (Offset >= FgPage4Addr && Offset <= (FgPage4Addr + 0xfff))) { - if (TileRam[Offset >> 1] != BURN_ENDIAN_SWAP_INT16(d)) System16RecalcFgTileMap = 1; - } - - if ((Offset >= BgPage1Addr && Offset <= (BgPage1Addr + 0xfff)) || (Offset >= BgPage2Addr && Offset <= (BgPage2Addr + 0xfff)) || (Offset >= BgPage3Addr && Offset <= (BgPage3Addr + 0xfff)) || (Offset >= BgPage4Addr && Offset <= (BgPage4Addr + 0xfff))) { - if (TileRam[Offset >> 1] != BURN_ENDIAN_SWAP_INT16(d)) System16RecalcBgTileMap = 1; - } - - if ((Offset >= FgAltPage1Addr && Offset <= (FgAltPage1Addr + 0xfff)) || (Offset >= FgAltPage2Addr && Offset <= (FgAltPage2Addr + 0xfff)) || (Offset >= FgAltPage3Addr && Offset <= (FgAltPage3Addr + 0xfff)) || (Offset >= FgAltPage4Addr && Offset <= (FgAltPage4Addr + 0xfff))) { - if (TileRam[Offset >> 1] != BURN_ENDIAN_SWAP_INT16(d)) System16RecalcFgAltTileMap = 1; - } - - if ((Offset >= BgAltPage1Addr && Offset <= (BgAltPage1Addr + 0xfff)) || (Offset >= BgAltPage2Addr && Offset <= (BgAltPage2Addr + 0xfff)) || (Offset >= BgAltPage3Addr && Offset <= (BgAltPage3Addr + 0xfff)) || (Offset >= BgAltPage4Addr && Offset <= (BgAltPage4Addr + 0xfff))) { - if (TileRam[Offset >> 1] != BURN_ENDIAN_SWAP_INT16(d)) System16RecalcBgAltTileMap = 1; - } - - TileRam[Offset >> 1] = BURN_ENDIAN_SWAP_INT16(d); -} - -void System16BTileByteWrite(UINT32 Offset, UINT8 d) -{ - UINT32 FgPage1Addr = (((System16Page[0] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage2Addr = (((System16Page[0] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage3Addr = (((System16Page[0] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 FgPage4Addr = (((System16Page[0] >> 12) & 0xf) * (32 * 64)) << 1; - - UINT32 BgPage1Addr = (((System16Page[1] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage2Addr = (((System16Page[1] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage3Addr = (((System16Page[1] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 BgPage4Addr = (((System16Page[1] >> 12) & 0xf) * (32 * 64)) << 1; - - UINT32 FgAltPage1Addr = (((System16Page[2] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 FgAltPage2Addr = (((System16Page[2] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 FgAltPage3Addr = (((System16Page[2] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 FgAltPage4Addr = (((System16Page[2] >> 12) & 0xf) * (32 * 64)) << 1; - - UINT32 BgAltPage1Addr = (((System16Page[3] >> 0) & 0xf) * (32 * 64)) << 1; - UINT32 BgAltPage2Addr = (((System16Page[3] >> 4) & 0xf) * (32 * 64)) << 1; - UINT32 BgAltPage3Addr = (((System16Page[3] >> 8) & 0xf) * (32 * 64)) << 1; - UINT32 BgAltPage4Addr = (((System16Page[3] >> 12) & 0xf) * (32 * 64)) << 1; - - if ((Offset >= FgPage1Addr && Offset <= (FgPage1Addr + 0xfff)) || (Offset >= FgPage2Addr && Offset <= (FgPage2Addr + 0xfff)) || (Offset >= FgPage3Addr && Offset <= (FgPage3Addr + 0xfff)) || (Offset >= FgPage4Addr && Offset <= (FgPage4Addr + 0xfff))) { - if (System16TileRam[Offset] != d) System16RecalcFgTileMap = 1; - } - - if ((Offset >= BgPage1Addr && Offset <= (BgPage1Addr + 0xfff)) || (Offset >= BgPage2Addr && Offset <= (BgPage2Addr + 0xfff)) || (Offset >= BgPage3Addr && Offset <= (BgPage3Addr + 0xfff)) || (Offset >= BgPage4Addr && Offset <= (BgPage4Addr + 0xfff))) { - if (System16TileRam[Offset] != d) System16RecalcBgTileMap = 1; - } - - if ((Offset >= FgAltPage1Addr && Offset <= (FgAltPage1Addr + 0xfff)) || (Offset >= FgAltPage2Addr && Offset <= (FgAltPage2Addr + 0xfff)) || (Offset >= FgAltPage3Addr && Offset <= (FgAltPage3Addr + 0xfff)) || (Offset >= FgAltPage4Addr && Offset <= (FgAltPage4Addr + 0xfff))) { - if (System16TileRam[Offset] != d) System16RecalcFgAltTileMap = 1; - } - - if ((Offset >= BgAltPage1Addr && Offset <= (BgAltPage1Addr + 0xfff)) || (Offset >= BgAltPage2Addr && Offset <= (BgAltPage2Addr + 0xfff)) || (Offset >= BgAltPage3Addr && Offset <= (BgAltPage3Addr + 0xfff)) || (Offset >= BgAltPage4Addr && Offset <= (BgAltPage4Addr + 0xfff))) { - if (System16TileRam[Offset] != d) System16RecalcBgAltTileMap = 1; - } - - System16TileRam[Offset] = d; -} - -static void System16ARenderTileLayer(INT32 Page, INT32 PriorityDraw, INT32 Transparent) -{ - INT32 xScroll, yScroll, x, y; - UINT16 *TextRam = (UINT16*)System16TextRam; - - xScroll = System16ScrollX[Page]; - yScroll = System16ScrollY[Page]; - UINT16 Pix; - - UINT16 *pTileMapSrc = NULL; - UINT16 *pTileMapDest = NULL; - INT32 xSrcOff, ySrcOff, RowScrollIndex, xEffScroll, yEffScroll; - - if (System16ColScroll && System16RowScroll) { - for (y = 0; y < nScreenHeight; y++) { - pTileMapDest = pTransDraw + (y * nScreenWidth); - - RowScrollIndex = y / 8; - if (System16ScreenFlip) RowScrollIndex = (216 - y) / 8; - - xEffScroll = BURN_ENDIAN_SWAP_INT16(TextRam[0xf80/2 + RowScrollIndex * 2 + Page]) & 0x1ff; - if (System16ScreenFlip) xEffScroll += 17; - - for (x = 0; x < nScreenWidth; x++) { - yEffScroll = BURN_ENDIAN_SWAP_INT16(TextRam[0xf30/2 + (x/16) * 2 + Page]) & 0xff; - - ySrcOff = (y + yEffScroll) & 0x1ff; - if (System16ScreenFlip) ySrcOff = ((216 - y) + yEffScroll) & 0x1ff; - - if (Page == 0 && PriorityDraw == 0) pTileMapSrc = pSys16FgTileMapPri0 + (ySrcOff * 1024); - if (Page == 0 && PriorityDraw == 1) pTileMapSrc = pSys16FgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 0 && Transparent == 1) pTileMapSrc = pSys16BgTileMapPri0 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 1 && Transparent == 1) pTileMapSrc = pSys16BgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && Transparent == 0) pTileMapSrc = pSys16BgTileMapOpaque + (ySrcOff * 1024); - - xSrcOff = (x - xEffScroll + 200) & 0x3ff; - if (System16ScreenFlip) xSrcOff = ((312 - x) - xEffScroll + 200) & 0x3ff; - - Pix = pTileMapSrc[xSrcOff]; - - if (Transparent) { - if (Pix) pTileMapDest[x] = Pix; - } else { - pTileMapDest[x] = Pix; - } - } - } - } else { - if (System16ColScroll) { - for (y = 0; y < nScreenHeight; y++) { - pTileMapDest = pTransDraw + (y * nScreenWidth); - - xEffScroll = xScroll; - if (System16ScreenFlip) xEffScroll += 17; - - for (x = 0; x < nScreenWidth; x++) { - yEffScroll = BURN_ENDIAN_SWAP_INT16(TextRam[0xf30/2 + (x/16) * 2 + Page]) & 0xff; - - ySrcOff = (y + yEffScroll) & 0x1ff; - if (System16ScreenFlip) ySrcOff = ((216 - y) + yEffScroll) & 0x1ff; - - if (Page == 0 && PriorityDraw == 0) pTileMapSrc = pSys16FgTileMapPri0 + (ySrcOff * 1024); - if (Page == 0 && PriorityDraw == 1) pTileMapSrc = pSys16FgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 0 && Transparent == 1) pTileMapSrc = pSys16BgTileMapPri0 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 1 && Transparent == 1) pTileMapSrc = pSys16BgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && Transparent == 0) pTileMapSrc = pSys16BgTileMapOpaque + (ySrcOff * 1024); - - xSrcOff = (x - xEffScroll + 200) & 0x3ff; - if (System16ScreenFlip) xSrcOff = ((312 - x) - xEffScroll + 200) & 0x3ff; - - Pix = pTileMapSrc[xSrcOff]; - - if (Transparent) { - if (Pix) pTileMapDest[x] = Pix; - } else { - pTileMapDest[x] = Pix; - } - } - } - } else { - if (System16RowScroll) { - for (y = 0; y < nScreenHeight; y++) { - pTileMapDest = pTransDraw + (y * nScreenWidth); - - RowScrollIndex = y / 8; - if (System16ScreenFlip) RowScrollIndex = (216 - y) / 8; - - xEffScroll = BURN_ENDIAN_SWAP_INT16(TextRam[0xf80/2 + RowScrollIndex * 2 + Page]) & 0x1ff; - if (System16ScreenFlip) xEffScroll += 17; - - for (x = 0; x < nScreenWidth; x++) { - yEffScroll = yScroll; - - ySrcOff = (y + yEffScroll) & 0x1ff; - if (System16ScreenFlip) ySrcOff = ((216 - y) + yEffScroll) & 0x1ff; - - if (Page == 0 && PriorityDraw == 0) pTileMapSrc = pSys16FgTileMapPri0 + (ySrcOff * 1024); - if (Page == 0 && PriorityDraw == 1) pTileMapSrc = pSys16FgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 0 && Transparent == 1) pTileMapSrc = pSys16BgTileMapPri0 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 1 && Transparent == 1) pTileMapSrc = pSys16BgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && Transparent == 0) pTileMapSrc = pSys16BgTileMapOpaque + (ySrcOff * 1024); - - xSrcOff = (x - xEffScroll + 200) & 0x3ff; - if (System16ScreenFlip) xSrcOff = ((312 - x) - xEffScroll + 200) & 0x3ff; - - Pix = pTileMapSrc[xSrcOff]; - - if (Transparent) { - if (Pix) pTileMapDest[x] = Pix; - } else { - pTileMapDest[x] = Pix; - } - } - } - } else { - for (y = 0; y < nScreenHeight; y++) { - pTileMapDest = pTransDraw + (y * nScreenWidth); - - if (System16ScreenFlip) xScroll += 17; - - ySrcOff = (y + yScroll) & 0x1ff; - if (System16ScreenFlip) ySrcOff = ((216 - y) + yScroll) & 0x1ff; - - if (Page == 0 && PriorityDraw == 0) pTileMapSrc = pSys16FgTileMapPri0 + (ySrcOff * 1024); - if (Page == 0 && PriorityDraw == 1) pTileMapSrc = pSys16FgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 0) pTileMapSrc = pSys16BgTileMapPri0 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 1) pTileMapSrc = pSys16BgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && Transparent == 0) pTileMapSrc = pSys16BgTileMapOpaque + (ySrcOff * 1024); - - for (x = 0; x < nScreenWidth; x++) { - xSrcOff = (x - xScroll + 200) & 0x3ff; - if (System16ScreenFlip) xSrcOff = ((312 - x) - xScroll + 200) & 0x3ff; - - Pix = pTileMapSrc[xSrcOff]; - - if (Transparent) { - if (Pix) pTileMapDest[x] = Pix; - } else { - pTileMapDest[x] = Pix; - } - } - } - } - } - } -} - -static void System16BRenderTileLayer(INT32 Page, INT32 PriorityDraw, INT32 Transparent) -{ - INT32 xScroll, yScroll, x, y; - UINT16 *TextRam = (UINT16*)System16TextRam; - - xScroll = System16ScrollX[Page]; - yScroll = System16ScrollY[Page]; - UINT16 Pix; - - UINT16 *pTileMapSrc = NULL; - UINT16 *pTileMapDest = NULL; - INT32 xSrcOff, ySrcOff, RowScrollIndex, RowScroll, xEffScroll, yEffScroll; - - if (yScroll & 0x8000) { - for (y = 0; y < nScreenHeight; y++) { - pTileMapDest = pTransDraw + (y * nScreenWidth); - - RowScrollIndex = y / 8; - if (System16ScreenFlip) RowScrollIndex = (216 - y) / 8; - - RowScroll = BURN_ENDIAN_SWAP_INT16(TextRam[0xf80/2 + 0x40/2 * Page + RowScrollIndex]); - xEffScroll = (xScroll & 0x8000) ? RowScroll : xScroll; - - for (x = 0; x < nScreenWidth; x++) { - yEffScroll = BURN_ENDIAN_SWAP_INT16(TextRam[0xf16/2 + 0x40/2 * Page + (x+9)/16]); - - if (RowScroll & 0x8000) { - xEffScroll = System16ScrollX[Page + 2]; - yEffScroll = System16ScrollY[Page + 2]; - - ySrcOff = (y + yEffScroll) & 0x1ff; - if (System16ScreenFlip) ySrcOff = ((216 - y) + yEffScroll) & 0x1ff; - - if (Page == 0 && PriorityDraw == 0) pTileMapSrc = pSys16FgAltTileMapPri0 + (ySrcOff * 1024); - if (Page == 0 && PriorityDraw == 1) pTileMapSrc = pSys16FgAltTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 0) pTileMapSrc = pSys16BgAltTileMapPri0 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 1) pTileMapSrc = pSys16BgAltTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && Transparent == 0) pTileMapSrc = pSys16BgAltTileMapOpaque + (ySrcOff * 1024); - } else { - ySrcOff = (y + yEffScroll) & 0x1ff; - if (System16ScreenFlip) ySrcOff = ((216 - y) + yEffScroll) & 0x1ff; - - if (Page == 0 && PriorityDraw == 0) pTileMapSrc = pSys16FgTileMapPri0 + (ySrcOff * 1024); - if (Page == 0 && PriorityDraw == 1) pTileMapSrc = pSys16FgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 0 && Transparent == 1) pTileMapSrc = pSys16BgTileMapPri0 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 1 && Transparent == 1) pTileMapSrc = pSys16BgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && Transparent == 0) pTileMapSrc = pSys16BgTileMapOpaque + (ySrcOff * 1024); - } - - xSrcOff = (x - xEffScroll + 192) & 0x3ff; - if (System16ScreenFlip) xSrcOff = ((312 - x) - xEffScroll + 192) & 0x3ff; - - Pix = pTileMapSrc[xSrcOff]; - - if (Transparent) { - if (Pix) pTileMapDest[x] = Pix; - } else { - pTileMapDest[x] = Pix; - } - } - } - } else { - for (y = 0; y < nScreenHeight; y++) { - pTileMapDest = pTransDraw + (y * nScreenWidth); - - RowScrollIndex = y / 8; - if (System16ScreenFlip) RowScrollIndex = (216 - y) / 8; - - RowScroll = BURN_ENDIAN_SWAP_INT16(TextRam[0xf80/2 + 0x40/2 * Page + RowScrollIndex]); - xEffScroll = (xScroll & 0x8000) ? RowScroll : xScroll; - yEffScroll = yScroll; - - if (RowScroll & 0x8000) { - xEffScroll = System16ScrollX[Page + 2]; - yEffScroll = System16ScrollY[Page + 2]; - - ySrcOff = (y + yEffScroll) & 0x1ff; - if (System16ScreenFlip) ySrcOff = ((216 - y) + yEffScroll) & 0x1ff; - - if (Page == 0 && PriorityDraw == 0) pTileMapSrc = pSys16FgAltTileMapPri0 + (ySrcOff * 1024); - if (Page == 0 && PriorityDraw == 1) pTileMapSrc = pSys16FgAltTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 0) pTileMapSrc = pSys16BgAltTileMapPri0 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 1) pTileMapSrc = pSys16BgAltTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && Transparent == 0) pTileMapSrc = pSys16BgAltTileMapOpaque + (ySrcOff * 1024); - } else { - ySrcOff = (y + yEffScroll) & 0x1ff; - if (System16ScreenFlip) ySrcOff = ((216 - y) + yEffScroll) & 0x1ff; - - if (Page == 0 && PriorityDraw == 0) pTileMapSrc = pSys16FgTileMapPri0 + (ySrcOff * 1024); - if (Page == 0 && PriorityDraw == 1) pTileMapSrc = pSys16FgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 0) pTileMapSrc = pSys16BgTileMapPri0 + (ySrcOff * 1024); - if (Page == 1 && PriorityDraw == 1) pTileMapSrc = pSys16BgTileMapPri1 + (ySrcOff * 1024); - if (Page == 1 && Transparent == 0) pTileMapSrc = pSys16BgTileMapOpaque + (ySrcOff * 1024); - } - - for (x = 0; x < nScreenWidth; x++) { - xSrcOff = (x - xEffScroll + 192) & 0x3ff; - if (System16ScreenFlip) xSrcOff = ((312 - x) - xEffScroll + 192) & 0x3ff; - - Pix = pTileMapSrc[xSrcOff]; - - if (Transparent) { - if (Pix) pTileMapDest[x] = Pix; - } else { - pTileMapDest[x] = Pix; - } - } - } - } -} - -static void BootlegRenderTileLayer(INT32 Page, INT32 PriorityDraw, INT32 Transparent) -{ - INT32 mx, my, Code, Colour, x, y, Priority, TileIndex, ColourOff; - - UINT16 EffPage, ActPage = 0, xScroll, yScroll; - - EffPage = System16Page[Page]; - xScroll = System16ScrollX[Page]; - yScroll = System16ScrollY[Page]; - - INT32 yStartPosArray[28 * 21]; - - float yPos = float(yScroll % 8); - INT32 yStartPos = INT32(yPos) * -1; - - if (yScroll & 0x8000) { - for (y = 0; y < 224; y += 8) { - for (x = -8; x < 320; x += 16) { - INT32 yColScrollTemp = (System16TextRam[0xf16 + (0x40 * Page) + (2 * (x + 8) / 16) + 1] << 8) | System16TextRam[0xf16 + (0x40 * Page) + (2 * (x + 8) / 16) + 0]; - float yTempPos = float(yColScrollTemp % 8); - INT32 yTempStartPos = INT32(yTempPos) * -1; - yStartPosArray[(y / 8) + (28 * ((x + 8) / 16))] = yTempStartPos + y; - } - } - - for (INT32 ny = 0; ny < 28; ny++) { - INT32 RowScrollIndex = ny; - - INT32 RowScroll = (System16TextRam[0xf80 + (0x40 * Page) + (2 * RowScrollIndex) + 1] << 8) | System16TextRam[0xf80 + (0x40 * Page) + (2 * RowScrollIndex) + 0]; - - INT32 xScrollRow = ((xScroll & 0x8000) ? RowScroll : xScroll); - - INT32 yScrollCol; - - if (RowScroll & 0x8000) { - EffPage = System16Page[Page + 2]; - xScrollRow = System16ScrollX[Page + 2]; - yScrollCol = System16ScrollY[Page + 2]; - } - - float xPos = float(xScrollRow % 8); - INT32 xStartPos = (INT32)xPos; - - if (xStartPos == 1) xStartPos = -7; - if (xStartPos == 2) xStartPos = -6; - if (xStartPos == 3) xStartPos = -5; - if (xStartPos == 4) xStartPos = -4; - if (xStartPos == 5) xStartPos = -3; - if (xStartPos == 6) xStartPos = -2; - if (xStartPos == 7) xStartPos = -1; - if (xStartPos == 0) xStartPos = 0; - - for (x = -8; x < 320; x += 16) { - INT32 x2 = xStartPos + x; - - yScrollCol = (System16TextRam[0xf16 + (0x40 * Page) + (2 * (x + 8) / 16) + 1] << 8) | System16TextRam[0xf16 + (0x40 * Page) + (2 * (x + 8) / 16) + 0]; - - my = ((ny * 8) + (yScrollCol & 0x1ff)) / 8; - - if (my > 63) my -= 64; - - y = yStartPosArray[ny + (28 * ((x + 8) / 16))]; - - mx = (x2 - (xScrollRow & 0x3ff) + 192) / 8; - if (mx < 0) mx += 128; - if (Page == 1) { - if (my < 32 && mx < 64) ActPage = BootlegBgPage[0]; - if (my < 32 && mx >= 64) ActPage = BootlegBgPage[1]; - if (my >= 32 && mx < 64) ActPage = BootlegBgPage[2]; - if (my >= 32 && mx >= 64) ActPage = BootlegBgPage[3]; - } - if (Page == 0) { - if (my < 32 && mx < 64) ActPage = BootlegFgPage[0]; - if (my < 32 && mx >= 64) ActPage = BootlegFgPage[1]; - if (my >= 32 && mx < 64) ActPage = BootlegFgPage[2]; - if (my >= 32 && mx >= 64) ActPage = BootlegFgPage[3]; - } - - TileIndex = 64 * 32 * 2 * ActPage + ((2 * 64 * my) & 0xfff) + ((2 * mx) & 0x7f); - INT32 Data = (System16TileRam[TileIndex + 1] << 8) | System16TileRam[TileIndex + 0]; - INT32 Data2 = (System16TileRam[TileIndex + 3] << 8) | System16TileRam[TileIndex + 2]; - - Priority = (Data >> 15) & 1; - - if (Priority == PriorityDraw) { - Code = Data & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Data >> 6) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = 0x100 | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = 0x200 | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = 0x300 | System16TilemapColorOffset; - - if (Transparent) { - if (x2 > 7 && x2 < 312 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x2, y, Colour, 3, 0, ColourOff, System16Tiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x2, y, Colour, 3, 0, ColourOff, System16Tiles); - } - } else { - if (x2 > 7 && x2 < 312 && y > 7 && y < 216) { - Render8x8Tile(pTransDraw, Code, x2, y, Colour, 3, ColourOff, System16Tiles); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x2, y, Colour, 3, ColourOff, System16Tiles); - } - } - - Code = Data2 & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Data2 >> 6) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = 0x100 | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = 0x200 | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = 0x300 | System16TilemapColorOffset; - - INT32 x1 = x2 + 8; - - if (Transparent) { - if (x1 > 7 && x1 < 312 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x1, y, Colour, 3, 0, ColourOff, System16Tiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x1, y, Colour, 3, 0, ColourOff, System16Tiles); - } - } else { - if (x1 > 7 && x1 < 312 && y > 7 && y < 216) { - Render8x8Tile(pTransDraw, Code, x1, y, Colour, 3, ColourOff, System16Tiles); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x1, y, Colour, 3, ColourOff, System16Tiles); - } - } - } - } - } - } else { - for (y = yStartPos; y < 224; y += 8) { - INT32 RowScrollIndex = y / 8; - INT32 RowScroll = (System16TextRam[0xf80 + (0x40 * Page) + (2 * RowScrollIndex) + 1] << 8) | System16TextRam[0xf80 + (0x40 * Page) + (2 * RowScrollIndex) + 0]; - - INT32 xScrollRow = ((xScroll & 0x8000) ? RowScroll : xScroll); - - if (RowScroll & 0x8000) { - EffPage = System16Page[Page + 2]; - xScrollRow = System16ScrollX[Page + 2]; - yScroll = System16ScrollY[Page + 2]; - } - - float xPos = float(xScrollRow % 8); - INT32 xStartPos = (INT32)xPos; - - if (xStartPos == 1) xStartPos = -7; - if (xStartPos == 2) xStartPos = -6; - if (xStartPos == 3) xStartPos = -5; - if (xStartPos == 4) xStartPos = -4; - if (xStartPos == 5) xStartPos = -3; - if (xStartPos == 6) xStartPos = -2; - if (xStartPos == 7) xStartPos = -1; - - my = (y + (yScroll & 0x1ff)) / 8; - - if (my > 63) my -= 64; - - for (x = xStartPos; x < 320; x += 8) { - mx = (x - (xScrollRow & 0x3ff) + 192) / 8; - if (mx < 0) mx += 128; - if (Page == 1) { - if (my < 32 && mx < 64) ActPage = BootlegBgPage[0]; - if (my < 32 && mx >= 64) ActPage = BootlegBgPage[1]; - if (my >= 32 && mx < 64) ActPage = BootlegBgPage[2]; - if (my >= 32 && mx >= 64) ActPage = BootlegBgPage[3]; - } - if (Page == 0) { - if (my < 32 && mx < 64) ActPage = BootlegFgPage[0]; - if (my < 32 && mx >= 64) ActPage = BootlegFgPage[1]; - if (my >= 32 && mx < 64) ActPage = BootlegFgPage[2]; - if (my >= 32 && mx >= 64) ActPage = BootlegFgPage[3]; - } - - TileIndex = 64 * 32 * 2 * ActPage + ((2 * 64 * my) & 0xfff) + ((2 * mx) & 0x7f); - INT32 Data = (System16TileRam[TileIndex + 1] << 8) | System16TileRam[TileIndex + 0]; - - Priority = (Data >> 15) & 1; - - if (Priority == PriorityDraw) { - Code = Data & 0x1fff; - Code = System16TileBanks[Code / System16TileBankSize] * System16TileBankSize + Code % System16TileBankSize; - Code &= (System16NumTiles - 1); - Colour = (Data >> 6) & 0x7f; - - ColourOff = System16TilemapColorOffset; - if (Colour >= 0x20) ColourOff = 0x100 | System16TilemapColorOffset; - if (Colour >= 0x40) ColourOff = 0x200 | System16TilemapColorOffset; - if (Colour >= 0x60) ColourOff = 0x300 | System16TilemapColorOffset; - - if (Transparent) { - if (x > 7 && x < 312 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 3, 0, ColourOff, System16Tiles); - } - } else { - if (x > 7 && x < 312 && y > 7 && y < 216) { - Render8x8Tile(pTransDraw, Code, x, y, Colour, 3, ColourOff, System16Tiles); - } else { - Render8x8Tile_Clip(pTransDraw, Code, x, y, Colour, 3, ColourOff, System16Tiles); - } - } - } - } - } - } -} - -static void System16ARenderTextLayer(INT32 PriorityDraw) -{ - INT32 mx, my, Code, Colour, x, y, Priority, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = (System16TextRam[TileIndex + 1] << 8) | System16TextRam[TileIndex + 0]; - - Priority = (Code >> 11) & 1; - - if (Priority == PriorityDraw) { - Colour = (Code >> 8) & 0x07; - Code &= 0xff; - - x = 8 * mx; - y = 8 * my; - - x -= 192; - - if (System16ScreenFlip) { - x = 312 - x; - y = 216 - y; - - if (x > 7 && x < 312 && y > 7 && y < 216) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 3, 0, System16TilemapColorOffset, System16Tiles); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, System16TilemapColorOffset, System16Tiles); - } - - } else { - if (x > 7 && x < 312 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 3, 0, System16TilemapColorOffset, System16Tiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 3, 0, System16TilemapColorOffset, System16Tiles); - } - } - } - - TileIndex +=2; - } - } -} - -static void System16BRenderTextLayer(INT32 PriorityDraw) -{ - INT32 mx, my, Code, Colour, x, y, Priority, TileIndex = 0; - - INT32 ColourDepth = 3; - if (Lockonph) ColourDepth = 4; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = (System16TextRam[TileIndex + 1] << 8) | System16TextRam[TileIndex + 0]; - Priority = (Code >> 15) & 1; - - if (Priority == PriorityDraw) { - Colour = (Code >> 9) & 0x07; - Code &= 0x1ff; - - Code += System16TileBanks[0] * System16TileBankSize; - - Code &= (System16NumTiles - 1); - - x = 8 * mx; - y = 8 * my; - - x -= 192; - - if (System16ScreenFlip) { - x = 312 - x; - y = 216 - y; - - if (x > 7 && x < 312 && y > 7 && y < 216) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, ColourDepth, 0, System16TilemapColorOffset, System16Tiles); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, ColourDepth, 0, System16TilemapColorOffset, System16Tiles); - } - } else { - if (x > 7 && x < 312 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, ColourDepth, 0, System16TilemapColorOffset, System16Tiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, ColourDepth, 0, System16TilemapColorOffset, System16Tiles); - } - } - } - - TileIndex +=2 ; - } - } -} - -static void System16BAltRenderTextLayer(INT32 PriorityDraw) -{ - INT32 mx, my, Code, Colour, x, y, Priority, TileIndex = 0; - - for (my = 0; my < 32; my++) { - for (mx = 0; mx < 64; mx++) { - Code = (System16TextRam[TileIndex + 1] << 8) | System16TextRam[TileIndex + 0]; - Priority = (Code >> 15) & 1; - - if (Priority == PriorityDraw) { - Colour = (Code >> 8) & 0x07; - Code &= 0xff; - - Code += System16TileBanks[0] * System16TileBankSize; - - Code &= (System16NumTiles - 1); - - x = 8 * mx; - y = 8 * my; - - x -= 192; - - if (System16ScreenFlip) { - x = 312 - x; - y = 216 - y; - - if (x > 7 && x < 312 && y > 7 && y < 216) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 3, 0, System16TilemapColorOffset, System16Tiles); - } else { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 3, 0, System16TilemapColorOffset, System16Tiles); - } - } else { - if (x > 7 && x < 312 && y > 7 && y < 216) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 3, 0, System16TilemapColorOffset, System16Tiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 3, 0, System16TilemapColorOffset, System16Tiles); - } - } - } - - TileIndex +=2 ; - } - } -} - -/*==================================================== -Sprite Rendering -====================================================*/ - -static void System16DrawPixel(INT32 x, INT32 pix, INT32 colour, UINT16* pPixel, UINT16* PalRAM) -{ - x += System16SpriteXOffset; - if (x >= 0 && x <= 319 && pix != 0 && pix != 15) { - if (colour == (0x3f << 4)) { - pPixel[x] &= (System16PaletteEntries - 1); - pPixel[x] += (PalRAM[pPixel[x]] & 0x8000) ? (System16PaletteEntries * 2) : System16PaletteEntries; - } else { - pPixel[x] = (pix | colour | System16SpritePalOffset) & (System16PaletteEntries - 1); - } - } -} - -static void System16ARenderSpriteLayer(INT32 Priority) -{ - UINT8 numbanks = System16SpriteRomSize / 0x10000; - - const UINT16 *spritebase = (const UINT16*)System16Sprites; - UINT16 *data; - - UINT16 *PalRAM = (UINT16*)System16PaletteRam; - - for (data = (UINT16*)System16SpriteRam; data < (UINT16*)System16SpriteRam + System16SpriteRamSize / 2; data += 8) { - if ((BURN_ENDIAN_SWAP_INT16(data[0]) >> 8) > 0xf0) break; - INT32 sprpri = 1 << ((BURN_ENDIAN_SWAP_INT16(data[4]) >> 0) & 0x3); - -#if 1 && defined FBA_DEBUG - if (sprpri != 1 && sprpri != 2 && sprpri != 4 && sprpri != 8) bprintf(PRINT_IMPORTANT, _T("Unknown Sprite Priority - %x\n"), sprpri); -#endif - - if (sprpri != Priority) continue; - - INT32 bottom = (BURN_ENDIAN_SWAP_INT16(data[0]) >> 8) + 1; - INT32 top = (BURN_ENDIAN_SWAP_INT16(data[0]) & 0xff) + 1; - INT32 xpos = (BURN_ENDIAN_SWAP_INT16(data[1]) & 0x1ff) - 0xbd; - INT32 pitch = (INT16)BURN_ENDIAN_SWAP_INT16(data[2]); - UINT16 addr = BURN_ENDIAN_SWAP_INT16(data[3]); - INT32 color = ((BURN_ENDIAN_SWAP_INT16(data[4]) >> 8) & 0x3f) << 4; - INT32 bank = System16SpriteBanks[(BURN_ENDIAN_SWAP_INT16(data[4]) >> 4) & 0x7]; - const UINT16 *spritedata; - INT32 x, y, pix, xdelta = 1; - - /* initialize the end address to the start address */ - data[7] = addr; - - /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ - if ((top >= bottom) || bank == 255) - continue; - - /* clamp to within the memory region size */ - if (numbanks) - bank %= numbanks; - spritedata = spritebase + 0x8000 * bank; - - if (System16ScreenFlip) { - INT32 temp = top; - top = 224 - bottom; - bottom = 224 - temp; - xpos = 320 - xpos; - xdelta = -1; - } - - for (y = top; y < bottom; y++) { - addr += pitch; - if (y >= 0 && y <= 223) { - UINT16* pPixel = pTransDraw + (y * 320); - if (!(addr & 0x8000)) { - /* start at the word before because we preincrement below */ - data[7] = addr - 1; - for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) { - UINT16 pixels = BURN_ENDIAN_SWAP_INT16(spritedata[++data[7] & 0x7fff]); - - pix = (pixels >> 12) & 0xf; System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; - pix = (pixels >> 8) & 0xf; System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; - pix = (pixels >> 4) & 0xf; System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; - pix = (pixels >> 0) & 0xf; System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; - - if (pix == 15) break; - } - } else { - data[7] = addr + 1; - for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) { - UINT16 pixels = BURN_ENDIAN_SWAP_INT16(spritedata[--data[7] & 0x7fff]); - - /* draw four pixels */ - pix = (pixels >> 0) & 0xf; System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; - pix = (pixels >> 4) & 0xf; System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; - pix = (pixels >> 8) & 0xf; System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; - pix = (pixels >> 12) & 0xf; System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; - - /* stop if the last pixel in the group was 0xf */ - if (pix == 15) break; - } - } - } - } - } -} - -static void System16BRenderSpriteLayer(INT32 Priority) -{ - UINT8 numbanks; - const UINT16 *spritebase; - UINT16 *data; - - UINT16 *PalRAM = (UINT16*)System16PaletteRam; - - spritebase = (const UINT16 *)System16Sprites; - numbanks = System16SpriteRomSize / 0x20000; - - for (data = (UINT16*)System16SpriteRam; data < (UINT16*)System16SpriteRam + System16SpriteRamSize / 2; data += 8) { - if (BURN_ENDIAN_SWAP_INT16(data[2]) & 0x8000) break; - INT32 sprpri = 1 << ((BURN_ENDIAN_SWAP_INT16(data[4]) >> 6) & 0x3); - -#if 1 && defined FBA_DEBUG - if (sprpri != 1 && sprpri != 2 && sprpri != 4 && sprpri != 8) bprintf(PRINT_IMPORTANT, _T("Unknown Sprite Priority - %x\n"), sprpri); -#endif - - if (Priority && sprpri != Priority) continue; - - INT32 bottom = BURN_ENDIAN_SWAP_INT16(data[0]) >> 8; - INT32 top = BURN_ENDIAN_SWAP_INT16(data[0]) & 0xff; - INT32 xpos = (BURN_ENDIAN_SWAP_INT16(data[1]) & 0x1ff) - 0xb8; - INT32 hide = BURN_ENDIAN_SWAP_INT16(data[2]) & 0x4000; - INT32 flip = BURN_ENDIAN_SWAP_INT16(data[2]) & 0x100; - INT32 pitch = (INT8)(BURN_ENDIAN_SWAP_INT16(data[2]) & 0xff); - UINT16 addr = BURN_ENDIAN_SWAP_INT16(data[3]); - INT32 bank = System16SpriteBanks[(BURN_ENDIAN_SWAP_INT16(data[4]) >> 8) & 0xf]; - INT32 color = ((BURN_ENDIAN_SWAP_INT16(data[4]) & 0x3f) << 4); - INT32 vzoom = (BURN_ENDIAN_SWAP_INT16(data[5]) >> 5) & 0x1f; - INT32 hzoom = BURN_ENDIAN_SWAP_INT16(data[5]) & 0x1f; - const UINT16 *spritedata; - INT32 x, y, pix, xdelta = 1; - - /* initialize the end address to the start address */ - data[7] = addr; - - /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ - if (hide || (top >= bottom) || bank == 255) - continue; - - /* clamp to within the memory region size */ - if (numbanks) - bank %= numbanks; - spritedata = spritebase + 0x10000 * bank; - - /* reset the yzoom counter */ - data[5] &= 0x03ff; - - if (System16ScreenFlip) { - INT32 temp = top; - top = 224 - bottom; - bottom = 224 - temp; - xpos = 320 - xpos; - xdelta = -1; - } - - /* loop from top to bottom */ - for (y = top; y < bottom; y++) { - /* advance a row */ - addr += pitch; - - /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ - data[5] += vzoom << 10; - if (data[5] & 0x8000) { - addr += pitch; - data[5] &= ~0x8000; - } - - /* skip drawing if not within the cliprect */ - if (y >= 0 && y <= 223) { - UINT16* pPixel = pTransDraw + (y * 320); - int xacc; - - /* compute the initial X zoom accumulator; this is verified on the real PCB */ - xacc = 4 * hzoom; - - /* non-flipped case */ - if (!flip) { - /* start at the word before because we preincrement below */ - data[7] = addr - 1; - for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) { - UINT16 pixels = BURN_ENDIAN_SWAP_INT16(spritedata[++data[7]]); - - /* draw four pixels */ - pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; } - pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; } - pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; } - pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; } - - /* stop if the last pixel in the group was 0xf */ - if (pix == 15) break; - } - } else { - /* start at the word after because we predecrement below */ - data[7] = addr + 1; - for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) { - UINT16 pixels = BURN_ENDIAN_SWAP_INT16(spritedata[--data[7]]); - - /* draw four pixels */ - pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; } - pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; } - pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; } - pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { System16DrawPixel(x, pix, color, pPixel, PalRAM); x += xdelta; } - - /* stop if the last pixel in the group was 0xf */ - if (pix == 15) break; - } - } - } - } - } -} - -inline static void OutrunDrawPixel(INT32 x, INT32 pix, INT32 colour, INT32 shadow, UINT16* pPixel, UINT16* PalRAM) -{ - if (x >= 0 && x <= 319 && pix != 0 && pix != 15) { - if (shadow && pix == 0xa) { - pPixel[x] &= (System16PaletteEntries - 1); - pPixel[x] += (PalRAM[pPixel[x]] & 0x8000) ? (System16PaletteEntries * 2) : System16PaletteEntries; - } else { - pPixel[x] = (pix | colour | 0x800) & (System16PaletteEntries - 1); - } - } -} - -static void OutrunRenderSpriteLayer(INT32 Priority) -{ - UINT8 numbanks = System16SpriteRomSize / 0x40000; - const UINT32 *spritebase = (const UINT32 *)System16Sprites; - UINT16 *data; - - UINT16 *PalRAM = (UINT16*)System16PaletteRam; - - for (data = (UINT16*)System16SpriteRamBuff; data < (UINT16*)System16SpriteRamBuff + System16SpriteRamSize / 2; data += 8) { - if (BURN_ENDIAN_SWAP_INT16(data[0]) & 0x8000) break; - INT32 sprpri = 1 << ((BURN_ENDIAN_SWAP_INT16(data[3]) >> 12) & 3); - -#if 1 && defined FBA_DEBUG - if (sprpri != 1 && sprpri != 2 && sprpri != 4 && sprpri != 8) bprintf(PRINT_IMPORTANT, _T("Unknown Sprite Priority - %x\n"), sprpri); -#endif - if (sprpri != Priority) continue; - - INT32 hide = (BURN_ENDIAN_SWAP_INT16(data[0]) & 0x5000); - INT32 bank = (BURN_ENDIAN_SWAP_INT16(data[0]) >> 9) & 7; - INT32 top = (BURN_ENDIAN_SWAP_INT16(data[0]) & 0x1ff) - 0x100; - UINT16 addr = BURN_ENDIAN_SWAP_INT16(data[1]); - INT32 pitch = (INT16)((BURN_ENDIAN_SWAP_INT16(data[2]) >> 1) | ((BURN_ENDIAN_SWAP_INT16(data[4]) & 0x1000) << 3)) >> 8; - INT32 xpos = BURN_ENDIAN_SWAP_INT16(data[2]) & 0x1ff; - INT32 shadow = (BURN_ENDIAN_SWAP_INT16(data[3]) >> 14) & 1; - INT32 vzoom = BURN_ENDIAN_SWAP_INT16(data[3]) & 0x7ff; - INT32 ydelta = (BURN_ENDIAN_SWAP_INT16(data[4]) & 0x8000) ? 1 : -1; - INT32 flip = (~(BURN_ENDIAN_SWAP_INT16(data[4])) >> 14) & 1; - INT32 xdelta = (BURN_ENDIAN_SWAP_INT16(data[4]) & 0x2000) ? 1 : -1; - INT32 hzoom = BURN_ENDIAN_SWAP_INT16(data[4]) & 0x7ff; - INT32 height = (BURN_ENDIAN_SWAP_INT16(data[5]) >> 8) + 1; - INT32 color = (BURN_ENDIAN_SWAP_INT16(data[5]) & 0x7f) << 4; - INT32 x, y, ytarget, yacc = 0, pix; - const UINT32 *spritedata; - - /* adjust X coordinate */ - /* note: the threshhold below is a guess. If it is too high, rachero will draw garbage */ - /* If it is too low, smgp won't draw the bottom part of the road */ - if (xpos < 0x80 && xdelta < 0) - xpos += 0x200; - xpos -= 0xbe; - - /* initialize the end address to the start address */ - data[7] = BURN_ENDIAN_SWAP_INT16(addr); - - /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ - if (hide || height == 0) - continue; - - /* clamp to within the memory region size */ - if (numbanks) - bank %= numbanks; - spritedata = spritebase + 0x10000 * bank; - - /* clamp to a maximum of 8x (not 100% confirmed) */ - if (vzoom < 0x40) vzoom = 0x40; - if (hzoom < 0x40) hzoom = 0x40; - - /* loop from top to bottom */ - ytarget = top + ydelta * height; - for (y = top; y != ytarget; y += ydelta) - { - /* skip drawing if not within the cliprect */ - if (y >= 0 && y <= 223) { - UINT16* pPixel = pTransDraw + (y * 320); - INT32 xacc = 0; - - /* non-flipped case */ - if (!flip) - { - /* start at the word before because we preincrement below */ - data[7] = addr - 1; - for (x = xpos; (xdelta > 0 && x <= 319) || (xdelta < 0 && x >= 0); ) - { - UINT32 pixels = BURN_ENDIAN_SWAP_INT32(spritedata[++data[7]]); - - /* draw four pixels */ - pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 8) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 4) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 0) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - - /* stop if the second-to-last pixel in the group was 0xf */ - if ((pixels & 0x000000f0) == 0x000000f0) - break; - } - } - - /* flipped case */ - else - { - /* start at the word after because we predecrement below */ - data[7] = addr + 1; - for (x = xpos; (xdelta > 0 && x <= 319) || (xdelta < 0 && x >= 0); ) - { - UINT32 pixels = BURN_ENDIAN_SWAP_INT32(spritedata[--data[7]]); - - /* draw four pixels */ - pix = (pixels >> 0) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 4) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 8) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { OutrunDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - - /* stop if the second-to-last pixel in the group was 0xf */ - if ((pixels & 0x0f000000) == 0x0f000000) - break; - } - } - } - - /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ - yacc += vzoom; - addr += pitch * (yacc >> 9); - yacc &= 0x1ff; - } - } -} - -inline static void HangonDrawPixel(INT32 x, INT32 pix, INT32 colour, INT32 shadow, UINT16* pPixel, UINT16* PalRAM) -{ - if (x >= 0 && x <= 319 && pix != 0 && pix != 15) { - if (shadow && pix == 0xa) { - pPixel[x] &= (System16PaletteEntries - 1); - pPixel[x] += (PalRAM[pPixel[x]] & 0x8000) ? (System16PaletteEntries * 2) : System16PaletteEntries; - } else { - pPixel[x] = (pix | colour | 0x400) & (System16PaletteEntries - 1); - } - } -} - -static void HangonRenderSpriteLayer(INT32 Priority) -{ - UINT8 numbanks = System16SpriteRomSize / 0x20000; - const UINT32 *spritebase = (UINT32*)System16Sprites; - const UINT8 *zoom = System16Prom; - UINT16 *data; - - UINT16 *PalRAM = (UINT16*)System16PaletteRam; - - for (data = (UINT16*)System16SpriteRam; data < (UINT16*)System16SpriteRam + System16SpriteRamSize / 2; data += 8) { - if ((BURN_ENDIAN_SWAP_INT16(data[0]) >> 8) > 0xf0) break; - INT32 sprpri = ((BURN_ENDIAN_SWAP_INT16(data[2]) >> 14) & 1) ? (1<<3) : (1<<1); - -#if 1 && defined FBA_DEBUG - if (sprpri != 1 && sprpri != 2 && sprpri != 4 && sprpri != 8) bprintf(PRINT_IMPORTANT, _T("Unknown Sprite Priority - %x\n"), sprpri); -#endif - - if (sprpri != Priority) continue; - - INT32 bottom = (BURN_ENDIAN_SWAP_INT16(data[0]) >> 8) + 1; - INT32 top = (BURN_ENDIAN_SWAP_INT16(data[0]) & 0xff) + 1; - INT32 bank = System16SpriteBanks[(BURN_ENDIAN_SWAP_INT16(data[1]) >> 12) & 0x7]; - INT32 xpos = (BURN_ENDIAN_SWAP_INT16(data[1]) & 0x1ff) - 0xbd; - INT32 shadow = (~(BURN_ENDIAN_SWAP_INT16(data[2])) >> 15) & 1; - INT32 color = (((BURN_ENDIAN_SWAP_INT16(data[2]) >> 8) & 0x3f) << 4); - INT32 pitch = (INT16)(BURN_ENDIAN_SWAP_INT16(data[2]) << 9) >> 9; - UINT16 addr = BURN_ENDIAN_SWAP_INT16(data[3]); - INT32 hzoom = ((BURN_ENDIAN_SWAP_INT16(data[4]) >> 8) & 0x3f) << 1; - INT32 vzoom = (BURN_ENDIAN_SWAP_INT16(data[4]) >> 0) & 0x3f; - INT32 x, y, pix, zaddr, zmask; - const UINT32 *spritedata; - - /* initialize the end address to the start address */ - data[7] = addr; - - /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ - if ((top >= bottom) || bank == 255) - continue; - - /* clamp to within the memory region size */ - if (numbanks) - bank %= numbanks; - spritedata = spritebase + 0x8000 * bank; - - /* determine the starting zoom address and mask */ - zaddr = (vzoom & 0x38) << 5; - zmask = 1 << (vzoom & 7); - - for (y = top; y < bottom; y++) { - addr += pitch; - - /* if the zoom bit says so, add pitch a second time */ - if (zoom[zaddr++] & zmask) - addr += pitch; - - if (y >= 0 && y <= 223) { - UINT16* pPixel = pTransDraw + (y * 320); - INT32 xacc = 0x00; - - if (!(addr & 0x8000)) { - /* start at the word before because we preincrement below */ - data[7] = addr - 1; - for (x = xpos; x <= 319; ) { - UINT32 pixels = BURN_ENDIAN_SWAP_INT32(spritedata[++data[7] & 0x7fff]); - - pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - - if (pix == 15) break; - } - } else { - data[7] = addr + 1; - for (x = xpos; x <= 319; ) { - UINT32 pixels = BURN_ENDIAN_SWAP_INT32(spritedata[--data[7] & 0x7fff]); - - pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x++; } - - /* stop if the last pixel in the group was 0xf */ - if (pix == 15) break; - } - } - } - } - } -} - -inline static void HangonAltDrawPixel(INT32 x, INT32 pix, INT32 colour, UINT16* pPixel) -{ - if (x >= 0 && x <= 319 && pix != 0 && pix != 15) { - if (colour == (0x3f << 4)) { - pPixel[x] &= (System16PaletteEntries - 1); - pPixel[x] += ((System16SpriteShadow) ? System16PaletteEntries * 2 : System16PaletteEntries); - } else { - pPixel[x] = (pix | colour | 0x400) & (System16PaletteEntries - 1); - } - } -} - -static void HangonAltRenderSpriteLayer(INT32 Priority) -{ - UINT8 numbanks = System16SpriteRomSize / 0x10000; - const UINT16 *spritebase = (UINT16*)System16Sprites; - const UINT8 *zoom = System16Prom; - UINT16 *data; - - for (data = (UINT16*)System16SpriteRam; data < (UINT16*)System16SpriteRam + System16SpriteRamSize / 2; data += 8) { - if ((BURN_ENDIAN_SWAP_INT16(data[0]) >> 8) > 0xf0) break; - INT32 sprpri = 1 << ((BURN_ENDIAN_SWAP_INT16(data[4]) >> 0) & 0x3); - -#if 1 && defined FBA_DEBUG - if (sprpri != 1 && sprpri != 2 && sprpri != 4 && sprpri != 8) bprintf(PRINT_IMPORTANT, _T("Unknown Sprite Priority - %x\n"), sprpri); -#endif - - if (sprpri != Priority) continue; - - INT32 bottom = (BURN_ENDIAN_SWAP_INT16(data[0]) >> 8) + 1; - INT32 top = (BURN_ENDIAN_SWAP_INT16(data[0]) & 0xff) + 1; - INT32 bank = System16SpriteBanks[(BURN_ENDIAN_SWAP_INT16(data[1]) >> 12) & 0xf]; - INT32 xpos = (BURN_ENDIAN_SWAP_INT16(data[1]) & 0x1ff) - 0xbd; - INT32 pitch = (INT16)BURN_ENDIAN_SWAP_INT16(data[2]); - UINT16 addr = BURN_ENDIAN_SWAP_INT16(data[3]); - INT32 color = (((BURN_ENDIAN_SWAP_INT16(data[4]) >> 8) & 0x3f) << 4); - INT32 vzoom = (BURN_ENDIAN_SWAP_INT16(data[4]) >> 2) & 0x3f; - INT32 hzoom = vzoom << 1; - - INT32 x, y, pix, zaddr, zmask; - const UINT16 *spritedata; - - /* initialize the end address to the start address */ - data[7] = addr; - - /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ - if ((top >= bottom) || bank == 255) - continue; - - /* clamp to within the memory region size */ - if (numbanks) - bank %= numbanks; - spritedata = spritebase + 0x8000 * bank; - - /* determine the starting zoom address and mask */ - zaddr = (vzoom & 0x38) << 5; - zmask = 1 << (vzoom & 7); - - /* loop from top to bottom */ - for (y = top; y < bottom; y++) - { - /* advance a row */ - addr += pitch; - - /* if the zoom bit says so, add pitch a second time */ - if (zoom[zaddr++] & zmask) - addr += pitch; - - /* skip drawing if not within the cliprect */ - if (y >= 0 && y <= 223) - { - UINT16* pPixel = pTransDraw + (y * 320); - INT32 xacc = 0x00; - - /* note that the System 16A sprites have a design flaw that allows the address */ - /* to carry into the flip flag, which is the topmost bit -- it is very important */ - /* to emulate this as the games compensate for it */ - - /* non-flipped case */ - if (!(addr & 0x8000)) - { - /* start at the word before because we preincrement below */ - data[7] = addr - 1; - for (x = xpos; x <= 319; ) - { - UINT16 pixels = BURN_ENDIAN_SWAP_INT16(spritedata[++data[7] & 0x7fff]); - - /* draw four pixels */ - pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonAltDrawPixel(x, pix, color, pPixel); x++; } - pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonAltDrawPixel(x, pix, color, pPixel); x++; } - pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonAltDrawPixel(x, pix, color, pPixel); x++; } - pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonAltDrawPixel(x, pix, color, pPixel); x++; } - - /* stop if the last pixel in the group was 0xf */ - if (pix == 15) - break; - } - } - - /* flipped case */ - else - { - /* start at the word after because we predecrement below */ - data[7] = addr + 1; - for (x = xpos; x <= 319; ) - { - UINT16 pixels = BURN_ENDIAN_SWAP_INT16(spritedata[--data[7] & 0x7fff]); - - /* draw four pixels */ - pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonAltDrawPixel(x, pix, color, pPixel); x++; } - pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonAltDrawPixel(x, pix, color, pPixel); x++; } - pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonAltDrawPixel(x, pix, color, pPixel); x++; } - pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= 0) HangonAltDrawPixel(x, pix, color, pPixel); x++; } - - /* stop if the last pixel in the group was 0xf */ - if (pix == 15) - break; - } - } - } - } - } -} - -inline static void BoardXDrawPixel(INT32 x, INT32 pix, INT32 colour, INT32 shadow, UINT16* pPixel, UINT16* PalRAM) -{ - if (x >= 0 && x <= 319 && pix != 0 && pix != 15) { - if (shadow && pix == 0xa) { - pPixel[x] &= (System16PaletteEntries - 1); - pPixel[x] += (PalRAM[pPixel[x]] & 0x8000) ? (System16PaletteEntries * 2) : System16PaletteEntries; - } else { - pPixel[x] = (pix | colour) & (System16PaletteEntries - 1); - } - } -} - -static void XBoardRenderSpriteLayer(INT32 Priority) -{ - UINT8 numbanks = System16SpriteRomSize / 0x40000; - const UINT32 *spritebase = (const UINT32 *)System16Sprites; - UINT16 *data; - - UINT16 *PalRAM = (UINT16*)System16PaletteRam; - - for (data = (UINT16*)System16SpriteRamBuff; data < (UINT16*)System16SpriteRamBuff + System16SpriteRamSize / 2; data += 8) { - if (BURN_ENDIAN_SWAP_INT16(data[0]) & 0x8000) break; - INT32 sprpri = 1 << ((BURN_ENDIAN_SWAP_INT16(data[3]) >> 12) & 3); - -#if 1 && defined FBA_DEBUG - if (sprpri != 1 && sprpri != 2 && sprpri != 4 && sprpri != 8) bprintf(PRINT_IMPORTANT, _T("Unknown Sprite Priority - %x\n"), sprpri); -#endif - if (sprpri != Priority) continue; - - INT32 hide = (BURN_ENDIAN_SWAP_INT16(data[0]) & 0x5000); - INT32 bank = (BURN_ENDIAN_SWAP_INT16(data[0]) >> 9) & 7; - INT32 top = (BURN_ENDIAN_SWAP_INT16(data[0]) & 0x1ff) - 0x100; - UINT16 addr = BURN_ENDIAN_SWAP_INT16(data[1]); - INT32 pitch = (INT16)((BURN_ENDIAN_SWAP_INT16(data[2]) >> 1) | ((BURN_ENDIAN_SWAP_INT16(data[4]) & 0x1000) << 3)) >> 8; - INT32 xpos = BURN_ENDIAN_SWAP_INT16(data[2]) & 0x1ff; - INT32 shadow = (BURN_ENDIAN_SWAP_INT16(data[3]) >> 14) & 1; - INT32 vzoom = BURN_ENDIAN_SWAP_INT16(data[3]) & 0x7ff; - INT32 ydelta = (BURN_ENDIAN_SWAP_INT16(data[4]) & 0x8000) ? 1 : -1; - INT32 flip = (~(BURN_ENDIAN_SWAP_INT16(data[4])) >> 14) & 1; - INT32 xdelta = (BURN_ENDIAN_SWAP_INT16(data[4]) & 0x2000) ? 1 : -1; - INT32 hzoom = BURN_ENDIAN_SWAP_INT16(data[4]) & 0x7ff; - INT32 height = (BURN_ENDIAN_SWAP_INT16(data[5]) & 0xfff) + 1; - INT32 color = (BURN_ENDIAN_SWAP_INT16(data[6]) & 0xff) << 4; - INT32 x, y, ytarget, yacc = 0, pix; - const UINT32 *spritedata; - - /* adjust X coordinate */ - /* note: the threshhold below is a guess. If it is too high, rachero will draw garbage */ - /* If it is too low, smgp won't draw the bottom part of the road */ - if (xpos < 0x80 && xdelta < 0) - xpos += 0x200; - xpos -= 0xbe; - - /* initialize the end address to the start address */ - data[7] = addr; - - /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ - if (hide || height == 0) - continue; - - /* clamp to within the memory region size */ - if (numbanks) - bank %= numbanks; - spritedata = spritebase + 0x10000 * bank; - - /* clamp to a maximum of 8x (not 100% confirmed) */ - if (vzoom < 0x40) vzoom = 0x40; - if (hzoom < 0x40) hzoom = 0x40; - - /* loop from top to bottom */ - ytarget = top + ydelta * height; - for (y = top; y != ytarget; y += ydelta) - { - /* skip drawing if not within the cliprect */ - if (y >= 0 && y <= 223) { - UINT16* pPixel = pTransDraw + (y * 320); - INT32 xacc = 0; - - /* non-flipped case */ - if (!flip) - { - /* start at the word before because we preincrement below */ - data[7] = addr - 1; - for (x = xpos; (xdelta > 0 && x <= 319) || (xdelta < 0 && x >= 0); ) - { - UINT32 pixels = BURN_ENDIAN_SWAP_INT32(spritedata[++data[7]]); - - /* draw four pixels */ - pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 8) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 4) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 0) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - - /* stop if the second-to-last pixel in the group was 0xf */ - if ((pixels & 0x000000f0) == 0x000000f0) - break; - } - } - - /* flipped case */ - else - { - /* start at the word after because we predecrement below */ - data[7] = addr + 1; - for (x = xpos; (xdelta > 0 && x <= 319) || (xdelta < 0 && x >= 0); ) - { - UINT32 pixels = BURN_ENDIAN_SWAP_INT32(spritedata[--data[7]]); - - /* draw four pixels */ - pix = (pixels >> 0) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 4) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 8) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { BoardXDrawPixel(x, pix, color, shadow, pPixel, PalRAM); x += xdelta; xacc += hzoom; } xacc -= 0x200; - - /* stop if the second-to-last pixel in the group was 0xf */ - if ((pixels & 0x0f000000) == 0x0f000000) - break; - } - } - } - - /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ - yacc += vzoom; - addr += pitch * (yacc >> 9); - yacc &= 0x1ff; - } - } -} - -inline static void YBoardSystem16BDrawPixel(INT32 x, INT32 pix, INT32 Priority, INT32 colour, UINT16* pPixel, UINT8* pPriorityMap, UINT16* PalRAM) -{ - if (x >= 0 && x <= 319 && pix != 0 && pix != 15) { - UINT16 Pixel = pPixel[x]; - if (Pixel != 0xffff) { - if (Priority < (pPriorityMap[x] & 0x1f)) { - if (pix == 14) { - pPixel[x] &= (System16PaletteEntries - 1); - pPixel[x] += (PalRAM[pPixel[x]] & 0x8000) ? (System16PaletteEntries * 2) : System16PaletteEntries; - } else { - pPixel[x] = (pix | colour | 0x800) & (System16PaletteEntries - 1); - } - } - } - } -} - -static void YBoardSystem16BRenderSpriteLayer() -{ - UINT8 numbanks; - const UINT16 *spritebase; - UINT16 *data; - - spritebase = (const UINT16 *)System16Sprites; - numbanks = System16SpriteRomSize / 0x20000; - - UINT16 *PalRAM = (UINT16*)System16PaletteRam; - - for (data = (UINT16*)System16SpriteRam; data < (UINT16*)System16SpriteRam + System16SpriteRamSize / 2; data += 8) { - if (BURN_ENDIAN_SWAP_INT16(data[2]) & 0x8000) break; - INT32 sprpri = (data[1] >> 8) & 0x1e; - - INT32 bottom = BURN_ENDIAN_SWAP_INT16(data[0]) >> 8; - INT32 top = BURN_ENDIAN_SWAP_INT16(data[0]) & 0xff; - INT32 xpos = (BURN_ENDIAN_SWAP_INT16(data[1]) & 0x1ff) - 0xb8; - INT32 hide = BURN_ENDIAN_SWAP_INT16(data[2]) & 0x4000; - INT32 flip = BURN_ENDIAN_SWAP_INT16(data[2]) & 0x100; - INT32 pitch = (INT8)(BURN_ENDIAN_SWAP_INT16(data[2]) & 0xff); - UINT16 addr = BURN_ENDIAN_SWAP_INT16(data[3]); - INT32 bank = System16SpriteBanks[(BURN_ENDIAN_SWAP_INT16(data[4]) >> 8) & 0xf]; - INT32 color = ((BURN_ENDIAN_SWAP_INT16(data[4]) & 0x7f) << 4); - INT32 vzoom = (BURN_ENDIAN_SWAP_INT16(data[5]) >> 5) & 0x1f; - INT32 hzoom = BURN_ENDIAN_SWAP_INT16(data[5]) & 0x1f; - const UINT16 *spritedata; - INT32 x, y, pix, xdelta = 1; - - /* initialize the end address to the start address */ - data[7] = addr; - - /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ - if (hide || (top >= bottom) || bank == 255) - continue; - - /* clamp to within the memory region size */ - if (numbanks) - bank %= numbanks; - spritedata = spritebase + 0x10000 * bank; - - /* reset the yzoom counter */ - data[5] &= 0x03ff; - - /* loop from top to bottom */ - for (y = top; y < bottom; y++) { - /* advance a row */ - addr += pitch; - - /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ - data[5] += vzoom << 10; - if (data[5] & 0x8000) { - addr += pitch; - data[5] &= ~0x8000; - } - - /* skip drawing if not within the cliprect */ - if (y >= 0 && y <= 223) { - UINT16* pPixel = pTransDraw + (y * 320); - UINT8* pPrio = System16PriorityMap + (y * 320); - INT32 xacc; - - /* compute the initial X zoom accumulator; this is verified on the real PCB */ - xacc = 4 * hzoom; - - /* non-flipped case */ - if (!flip) { - /* start at the word before because we preincrement below */ - data[7] = addr - 1; - for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) { - UINT16 pixels = BURN_ENDIAN_SWAP_INT16(spritedata[++data[7]]); - - /* draw four pixels */ - pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { YBoardSystem16BDrawPixel(x, pix, sprpri, color, pPixel, pPrio, PalRAM); x += xdelta; } - pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { YBoardSystem16BDrawPixel(x, pix, sprpri, color, pPixel, pPrio, PalRAM); x += xdelta; } - pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { YBoardSystem16BDrawPixel(x, pix, sprpri, color, pPixel, pPrio, PalRAM); x += xdelta; } - pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { YBoardSystem16BDrawPixel(x, pix, sprpri, color, pPixel, pPrio, PalRAM); x += xdelta; } - - /* stop if the last pixel in the group was 0xf */ - if (pix == 15) break; - } - } else { - /* start at the word after because we predecrement below */ - data[7] = addr + 1; - for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) { - UINT16 pixels = BURN_ENDIAN_SWAP_INT16(spritedata[--data[7]]); - - /* draw four pixels */ - pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { YBoardSystem16BDrawPixel(x, pix, sprpri, color, pPixel, pPrio, PalRAM); x += xdelta; } - pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { YBoardSystem16BDrawPixel(x, pix, sprpri, color, pPixel, pPrio, PalRAM); x += xdelta; } - pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { YBoardSystem16BDrawPixel(x, pix, sprpri, color, pPixel, pPrio, PalRAM); x += xdelta; } - pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { YBoardSystem16BDrawPixel(x, pix, sprpri, color, pPixel, pPrio, PalRAM); x += xdelta; } - - /* stop if the last pixel in the group was 0xf */ - if (pix == 15) break; - } - } - } - } - } -} - -inline static void YBoardDrawPixel(INT32 x, UINT32 ind, UINT32 colourpri, UINT16* pPixel) -{ - if (x >= 0 && x <= 511 && ind < 0x1fe) { - pPixel[x] = (ind | colourpri)/* & (System16PaletteEntries - 1)*/; - } -} - -static void YBoardRenderSpriteLayer() -{ - UINT8 numbanks = System16Sprite2RomSize / 0x80000; - const UINT64 *spritebase = (const UINT64 *)System16Sprites2; - const UINT16 *rotatebase = (UINT16*)System16RotateRamBuff; - UINT8 visited[0x1000]; - UINT16 *data; - INT32 next = 0; - - /* reset the visited list */ - memset(visited, 0, sizeof(visited)); - - for (INT32 y = 0; y <= 511; y++) - if (!(BURN_ENDIAN_SWAP_INT16(rotatebase[y & ~1]) & 0xc000)) - memset(pTempDraw + (y * 512), 0xff, 512 * sizeof(UINT16)); - - for (data = (UINT16*)System16SpriteRam2; !(BURN_ENDIAN_SWAP_INT16(data[0]) & 0x8000) && !visited[next]; data = (UINT16*)System16SpriteRam2 + next * 8) - { - INT32 hide = (BURN_ENDIAN_SWAP_INT16(data[0]) & 0x5000); - UINT16 *indirect = (UINT16*)System16SpriteRam2 + ((BURN_ENDIAN_SWAP_INT16(data[0]) & 0x7ff) << 4); - INT32 bank = ((BURN_ENDIAN_SWAP_INT16(data[1]) >> 8) & 0x10) | ((BURN_ENDIAN_SWAP_INT16(data[2]) >> 12) & 0x0f); - INT32 xpos = (BURN_ENDIAN_SWAP_INT16(data[1]) & 0xfff) - 0x600; - INT32 top = (BURN_ENDIAN_SWAP_INT16(data[2]) & 0xfff) - 0x600; - UINT16 addr = BURN_ENDIAN_SWAP_INT16(data[3]); - INT32 height = BURN_ENDIAN_SWAP_INT16(data[4]); - INT32 ydelta = (BURN_ENDIAN_SWAP_INT16(data[5]) & 0x4000) ? 1 : -1; - INT32 flip = (~(BURN_ENDIAN_SWAP_INT16(data[5])) >> 13) & 1; - INT32 xdelta = (BURN_ENDIAN_SWAP_INT16(data[5]) & 0x1000) ? 1 : -1; - INT32 zoom = BURN_ENDIAN_SWAP_INT16(data[5]) & 0x7ff; - INT32 colorpri= (BURN_ENDIAN_SWAP_INT16(data[6]) << 1) & 0xfe00; - INT32 pitch = (INT8)BURN_ENDIAN_SWAP_INT16(data[6]); - INT32 x, y, ytarget, yacc = 0, pix, ind; - const UINT64 *spritedata; - UINT16 offs; - - /* note that we've visited this entry and get the offset of the next one */ - visited[next] = 1; - next = BURN_ENDIAN_SWAP_INT16(data[7]) & 0xfff; - - /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ - if (hide || height == 0) - continue; - - /* clamp to within the memory region size */ - if (numbanks) - bank %= numbanks; - spritedata = spritebase + 0x10000 * bank; - - /* clamp to a maximum of 8x (not 100% confirmed) */ - if (zoom == 0) zoom = 1; - - /* loop from top to bottom */ - ytarget = top + ydelta * height; - for (y = top; y != ytarget; y += ydelta) - { - /* skip drawing if not within the cliprect */ - if (y >= 0 && y <= 511) - { - //UINT16* pPixel = pTransDraw + (y * 320); - UINT16* pPixel = pTempDraw + (y * 512); - INT32 minx = BURN_ENDIAN_SWAP_INT16(rotatebase[y & ~1]); - INT32 maxx = BURN_ENDIAN_SWAP_INT16(rotatebase[y | 1]); - INT32 xacc = 0; - - /* bit 0x8000 from rotate RAM means that Y is above the top of the screen */ - if ((minx & 0x8000) && ydelta < 0) - break; - - /* bit 0x4000 from rotate RAM means that Y is below the bottom of the screen */ - if ((minx & 0x4000) && ydelta > 0) - break; - - /* if either bit is set, skip the rest for this scanline */ - if (!(minx & 0xc000)) - { - /* clamp min/max to the cliprect */ - minx -= 0x600; - maxx -= 0x600; - if (minx < 0) - minx = 0; - if (maxx > 511) - maxx = 511; - - /* non-flipped case */ - if (!flip) - { - /* start at the word before because we preincrement below */ - offs = addr - 1; - for (x = xpos; (xdelta > 0 && x <= maxx) || (xdelta < 0 && x >= minx); ) - { - UINT64 pixels = BURN_ENDIAN_SWAP_INT64(spritedata[++offs]); - - /* draw four pixels */ - pix = (pixels >> 60) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 56) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 52) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 48) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 44) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 40) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 36) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 32) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 28) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 24) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 20) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 16) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 12) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 8) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 4) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 0) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - - /* stop if the second-to-last pixel in the group was 0xf */ - if (pix == 0x0f) - break; - } - } - - /* flipped case */ - else - { - /* start at the word after because we predecrement below */ - offs = addr + 1; - for (x = xpos; (xdelta > 0 && x <= maxx) || (xdelta < 0 && x >= minx); ) - { - UINT64 pixels = BURN_ENDIAN_SWAP_INT64(spritedata[--offs]); - - /* draw four pixels */ - pix = (pixels >> 0) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 4) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 8) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 12) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 16) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 20) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 24) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 28) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 32) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 36) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 40) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 44) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 48) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 52) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 56) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - pix = (pixels >> 60) & 0xf; ind = BURN_ENDIAN_SWAP_INT16(indirect[pix]); while (xacc < 0x200) { YBoardDrawPixel(x, ind, colorpri, pPixel); x += xdelta; xacc += zoom; } xacc -= 0x200; - - /* stop if the second-to-last pixel in the group was 0xf */ - if (pix == 0x0f) - break; - } - } - } - } - - /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ - yacc += zoom; - addr += pitch * (yacc >> 9); - yacc &= 0x1ff; - } - } -} - -/*==================================================== -Road Rendering -====================================================*/ - -static void OutrunRenderRoadBackgroundLayer() -{ - UINT16 *roadram = (UINT16*)System16RoadRam; - INT32 x, y; - - for (y = 0; y < 224; y++) { - UINT16* pPixel = pTransDraw + (y * 320); - INT32 data0 = BURN_ENDIAN_SWAP_INT16(roadram[0x000 + y]); - INT32 data1 = BURN_ENDIAN_SWAP_INT16(roadram[0x100 + y]); - - INT32 color = -1; - - switch (System16RoadControl & 3) { - case 0: { - if (data0 & 0x800) color = data0 & 0x7f; - break; - } - - case 1: { - if (data0 & 0x800) color = data0 & 0x7f; - else if (data1 & 0x800) color = data1 & 0x7f; - break; - } - - case 2: { - if (data1 & 0x800) color = data1 & 0x7f; - else if (data0 & 0x800) color = data0 & 0x7f; - break; - } - - case 3: { - if (data1 & 0x800) color = data1 & 0x7f; - break; - } - } - - if (color != -1) { - for (x = 0; x < 320; x++) { - pPixel[x] = color | System16RoadColorOffset3; - } - } - } -} - -static void OutrunRenderRoadForegroundLayer() -{ - UINT16 *roadram = (UINT16*)System16RoadRam; - INT32 x, y; - - for (y = 0; y < 224; y++) { - static const UINT8 priority_map[2][8] = { - { 0x80,0x81,0x81,0x87,0,0,0,0x00 }, - { 0x81,0x81,0x81,0x8f,0,0,0,0x80 } - }; - - UINT16* pPixel = pTransDraw + (y * 320); - INT32 data0 = BURN_ENDIAN_SWAP_INT16(roadram[0x000 + y]); - INT32 data1 = BURN_ENDIAN_SWAP_INT16(roadram[0x100 + y]); - - /* if both roads are low priority, skip */ - if ((data0 & 0x800) && (data1 & 0x800)) continue; - - INT32 hpos0, hpos1, color0, color1; - INT32 control = System16RoadControl & 3; - UINT16 color_table[32]; - UINT8 *src0, *src1; - UINT8 bgcolor; - - /* get road 0 data */ - src0 = (data0 & 0x800) ? System16Roads + 256 * 2 * 512 : (System16Roads + (0x000 + ((data0 >> 1) & 0xff)) * 512); - hpos0 = BURN_ENDIAN_SWAP_INT16((roadram[0x200 + ((System16RoadControl & 4) ? y : (data0 & 0x1ff))])) & 0xfff; - color0 = BURN_ENDIAN_SWAP_INT16(roadram[0x600 + ((System16RoadControl & 4) ? y : (data0 & 0x1ff))]); - - /* get road 1 data */ - src1 = (data1 & 0x800) ? System16Roads + 256 * 2 * 512 : (System16Roads + (0x100 + ((data1 >> 1) & 0xff)) * 512); - hpos1 = BURN_ENDIAN_SWAP_INT16((roadram[0x400 + ((System16RoadControl & 4) ? (0x100 + y) : (data1 & 0x1ff))])) & 0xfff; - color1 = BURN_ENDIAN_SWAP_INT16(roadram[0x600 + ((System16RoadControl & 4) ? (0x100 + y) : (data1 & 0x1ff))]); - - /* determine the 5 colors for road 0 */ - color_table[0x00] = System16RoadColorOffset1 ^ 0x00 ^ ((color0 >> 0) & 1); - color_table[0x01] = System16RoadColorOffset1 ^ 0x02 ^ ((color0 >> 1) & 1); - color_table[0x02] = System16RoadColorOffset1 ^ 0x04 ^ ((color0 >> 2) & 1); - bgcolor = (color0 >> 8) & 0xf; - color_table[0x03] = (data0 & 0x200) ? color_table[0x00] : (System16RoadColorOffset2 ^ 0x00 ^ bgcolor); - color_table[0x07] = System16RoadColorOffset1 ^ 0x06 ^ ((color0 >> 3) & 1); - - /* determine the 5 colors for road 1 */ - color_table[0x10] = System16RoadColorOffset1 ^ 0x08 ^ ((color1 >> 4) & 1); - color_table[0x11] = System16RoadColorOffset1 ^ 0x0a ^ ((color1 >> 5) & 1); - color_table[0x12] = System16RoadColorOffset1 ^ 0x0c ^ ((color1 >> 6) & 1); - bgcolor = (color1 >> 8) & 0xf; - color_table[0x13] = (data1 & 0x200) ? color_table[0x10] : (System16RoadColorOffset2 ^ 0x10 ^ bgcolor); - color_table[0x17] = System16RoadColorOffset1 ^ 0x0e ^ ((color1 >> 7) & 1); - - /* draw the road */ - switch (control) { - case 0: { - if (data0 & 0x800) continue; - hpos0 = (hpos0 - (0x5f8 + System16RoadXOffset)) & 0xfff; - for (x = 0; x < 320; x++) { - INT32 pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3; - pPixel[x] = color_table[0x00 + pix0]; - hpos0 = (hpos0 + 1) & 0xfff; - } - break; - } - - case 1: { - hpos0 = (hpos0 - (0x5f8 + System16RoadXOffset)) & 0xfff; - hpos1 = (hpos1 - (0x5f8 + System16RoadXOffset)) & 0xfff; - for (x = 0; x < 320; x++) { - INT32 pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3; - INT32 pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3; - if ((priority_map[0][pix0] >> pix1) & 1) { - pPixel[x] = color_table[0x10 + pix1]; - } else { - pPixel[x] = color_table[0x00 + pix0]; - } - hpos0 = (hpos0 + 1) & 0xfff; - hpos1 = (hpos1 + 1) & 0xfff; - } - break; - } - - case 2: { - hpos0 = (hpos0 - (0x5f8 + System16RoadXOffset)) & 0xfff; - hpos1 = (hpos1 - (0x5f8 + System16RoadXOffset)) & 0xfff; - for (x = 0; x < 320; x++) { - INT32 pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3; - INT32 pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3; - if ((priority_map[1][pix0] >> pix1) & 1) { - pPixel[x] = color_table[0x10 + pix1]; - } else { - pPixel[x] = color_table[0x00 + pix0]; - } - hpos0 = (hpos0 + 1) & 0xfff; - hpos1 = (hpos1 + 1) & 0xfff; - } - break; - } - - case 3: { - if (data1 & 0x800) continue; - hpos1 = (hpos1 - (0x5f8 + System16RoadXOffset)) & 0xfff; - for (x = 0; x < 320; x++) { - INT32 pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3; - pPixel[x] = color_table[0x10 + pix1]; - hpos1 = (hpos1 + 1) & 0xfff; - } - break; - } - } - } -} - -static void HangonRenderRoadLayer(INT32 priority) -{ - UINT16 *roadram = (UINT16*)System16RoadRam; - INT32 x, y; - - for (y = 0; y <= 223; y++) - { - UINT16* pPixel = pTransDraw + (y * 320); - INT32 control = BURN_ENDIAN_SWAP_INT16(roadram[0x000 + y]); - INT32 ff9j1 = 0, ff9j2 = 0, ctr9m = 0, ctr9n9p = 0, ctr9n9p_ena = 0, ss8j = 0, plycont = 0; - - /* the PLYCONT signal controls the road layering */ - plycont = (control >> 10) & 3; - - if (plycont != priority) continue; - - INT32 hpos = BURN_ENDIAN_SWAP_INT16(roadram[0x100 + (control & 0xff)]); - INT32 color0 = BURN_ENDIAN_SWAP_INT16(roadram[0x200 + (control & 0xff)]); - INT32 color1 = BURN_ENDIAN_SWAP_INT16(roadram[0x300 + (control & 0xff)]); - UINT8 *src; - - /* compute the offset of the road graphics for this line */ - src = System16Roads + (0x000 + (control & 0xff)) * 512; - - /* initialize the 4-bit counter at 9M, which counts bits within each road byte */ - ctr9m = hpos & 7; - - /* initialize the two 4-bit counters at 9P (low) and 9N (high), which count road data bytes */ - ctr9n9p = (hpos >> 3) & 0xff; - - /* initialize the flip-flop at 9J (lower half), which controls the counting direction */ - ff9j1 = (hpos >> 11) & 1; - - /* initialize the flip-flop at 9J (upper half), which controls the background color */ - ff9j2 = 1; - - /* initialize the serial shifter at 8S, which delays several signals after we flip */ - ss8j = 0; - - /* draw this scanline from the beginning */ - for (x = -24; x <= 319; x++) - { - INT32 md, color, select; - - /* ---- the following logic all happens constantly ---- */ - - /* the enable is controlled by the value in the counter at 9M */ - ctr9n9p_ena = (ctr9m == 7); - - /* if we carried out of the 9P/9N counters, we will forcibly clear the flip-flop at 9J (lower half) */ - if ((ctr9n9p & 0xff) == 0xff) - ff9j1 = 0; - - /* if the control word bit 8 is clear, we will forcibly set the flip-flop at 9J (lower half) */ - if (!(control & 0x100)) - ff9j1 = 1; - - /* for the Hang On/Super Hang On case only: if the control word bit 9 is clear, we will forcibly */ - /* set the flip-flip at 9J (upper half) */ - if (Hangon && !(control & 0x200)) - ff9j2 = 1; - - /* ---- now process the pixel ---- */ - md = 3; - - /* the Space Harrier/Enduro Racer hardware has a tweak that maps the control word bit 9 to the */ - /* /CE line on the road ROM; use this to effectively disable the road data */ - if (Hangon || !(control & 0x200)) - - /* the /OE line on the road ROM is linked to the AND of bits 2 & 3 of the counter at 9N */ - if ((ctr9n9p & 0xc0) == 0xc0) - { - /* note that the pixel logic is hidden in a custom at 9S; this is just a guess */ - if (ss8j & 1) - md = src[((ctr9n9p & 0x3f) << 3) | ctr9m]; - else - md = src[((ctr9n9p & 0x3f) << 3) | (ctr9m ^ 7)]; - } - - /* "select" is a made-up signal that comes from bit 3 of the serial shifter and is */ - /* used in several places for color selection */ - select = (ss8j >> 3) & 1; - - /* check the flip-flop at 9J (upper half) to determine if we should use the background color; */ - /* the output of this is ANDed with M0 and M1 so it only affects pixels with a value of 3; */ - /* this is done by the AND gates at 9L and 7K */ - if (ff9j2 && md == 3) - { - /* in this case, the "select" signal is used to select which background color to use */ - /* since the color0 control word contains two selections */ - color = (color0 >> (select ? 0 : 8)) & 0x3f; - color |= 0x7c0; - } - - /* if we're not using the background color, we select pixel data from an alternate path */ - else - { - /* the AND gates at 7L, 9K, and 7K clamp the pixel value to 0 if bit 7 of the color 1 */ - /* signal is 1 and if the pixel value is 3 (both M0 and M1 == 1) */ - if ((color1 & 0x80) && md == 3) - md = 0; - - /* the pixel value plus the "select" line combine to form a mux into the low 8 bits of color1 */ - color = (color1 >> ((md << 1) | select)) & 1; - - /* this value becomes the low bit of the final color; the "select" line itself and the pixel */ - /* value form the other bits */ - color |= select << 3; - color |= md << 1; - color |= 0x038; - } - - /* write the pixel if we're past the minimum clip */ - if (x >= 0) - pPixel[x] = color; - - /* ---- the following logic all happens on the 6M clock ---- */ - - /* clock the counter at 9M */ - ctr9m = (ctr9m + 1) & 7; - - /* if enabled, clock on the two cascaded 4-bit counters at 9P and 9N */ - if (ctr9n9p_ena) - { - if (ff9j1) - ctr9n9p++; - else - ctr9n9p--; - } - - /* clock the flip-flop at 9J (upper half) */ - ff9j2 = !(!ff9j1 && (ss8j & 0x80)); - - /* clock the serial shift register at 8J */ - ss8j = (ss8j << 1) | ff9j1; - } - } -} - -/*==================================================== -Rotation Layer Rendering -====================================================*/ - -void System16RotateDraw() -{ - UINT16 *pRotateBuff = (UINT16*)System16RotateRamBuff; - - INT32 currx = (BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f0]) << 16) | BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f1]); - INT32 curry = (BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f2]) << 16) | BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f3]); - INT32 dyy = (BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f4]) << 16) | BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f5]); - INT32 dxx = (BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f6]) << 16) | BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f7]); - INT32 dxy = (BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f8]) << 16) | BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3f9]); - INT32 dyx = (BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3fa]) << 16) | BURN_ENDIAN_SWAP_INT16(pRotateBuff[0x3fb]); - INT32 x, y; - - /* advance forward based on the clip rect */ - currx += dxx * (0 + 27) + dxy * 0; - curry += dyx * (0 + 27) + dyy * 0; - - /* loop over screen Y coordinates */ - for (y = 0; y <= 223; y++) - { - UINT16* pPixel = pTransDraw + (y * 320); - UINT16* pSrc = pTempDraw; - UINT8* pPri = System16PriorityMap + (y * 320); - INT32 tx = currx; - INT32 ty = curry; - - /* loop over screen X coordinates */ - for (x = 0; x <= 319; x++) - { - /* fetch the pixel from the source bitmap */ - INT32 sx = (tx >> 14) & 0x1ff; - INT32 sy = (ty >> 14) & 0x1ff; - INT32 pix = pSrc[sy * 512 + (sx & 0x1ff)]; - - /* non-zero pixels get written; everything else is the scanline color */ - if (pix != 0xffff) - { - *pPixel++ = ((pix & 0x1ff) | ((pix >> 6) & 0x200) | ((pix >> 3) & 0xc00) | 0x1000) & (System16PaletteEntries - 1); - *pPri++ = (pix >> 8) | 1; - } - else - { - *pPixel++ = /*info->colorbase +*/ sy; - *pPri++ = 0xff; - } - - /* advance the source X/Y pointers */ - tx += dxx; - ty += dyx; - } - - /* advance the source X/Y pointers */ - currx += dxy; - curry += dyy; - } -} - -/*==================================================== -Genesis VDP Rendering -====================================================*/ - -static void System18DrawVDP() -{ - INT32 x, y; - - for (y = 0; y < 224; y++) - { - UINT16 *src = pTempDraw + (y * 320); - UINT16 *dst = pTransDraw + (y * 320); - - for (x = 0; x < 320; x++) - { - UINT16 pix = src[x]; - if (pix != 0xffff) - { - dst[x] = pix; - } - } - } -} - -void UpdateSystem18VDP() -{ - for (INT32 y = 0; y < 224; y++) { - UINT16* pPixel = pTempDraw + (y * 320); - vdp_drawline(pPixel, y, 0xffff); - } -} - -/*==================================================== -Palette Generation -====================================================*/ - -void System16PaletteInit() -{ - static const INT32 resistances_normal[6] = { 3900, 2000, 1000, 1000/2, 1000/4, 0 }; - double weights_normal[6]; - compute_resistor_weights(0, 255, -1.0, 6, resistances_normal, weights_normal, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, 0, 0); - - // compute weight table for shadow/hilight palette entries - static const INT32 resistances_sh[6] = { 3900, 2000, 1000, 1000/2, 1000/4, 470 }; - double weights_sh[6]; - compute_resistor_weights(0, 255, -1.0, 6, resistances_sh, weights_sh, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, 0, 0); - - // compute R, G, B for each weight - for (INT32 value = 0; value < 32; value++) { - INT32 i4 = (value >> 4) & 1; - INT32 i3 = (value >> 3) & 1; - INT32 i2 = (value >> 2) & 1; - INT32 i1 = (value >> 1) & 1; - INT32 i0 = (value >> 0) & 1; - System16PaletteNormal[value] = combine_6_weights(weights_normal, i0, i1, i2, i3, i4, 0); - System16PaletteShadow[value] = combine_6_weights(weights_sh, i0, i1, i2, i3, i4, 0); - System16PaletteHilight[value] = combine_6_weights(weights_sh, i0, i1, i2, i3, i4, 1); - } -} - -void System16PaletteExit() -{ - memset(System16PaletteNormal, 0, 32 * sizeof(UINT8)); - memset(System16PaletteShadow, 0, 32 * sizeof(UINT8)); - memset(System16PaletteHilight, 0, 32 * sizeof(UINT8)); -} - -static INT32 System16CalcPalette() -{ - INT32 i; - - for (i = 0; i < System16PaletteEntries * 2; i +=2) { - INT32 r, g, b; - INT32 nColour = (System16PaletteRam[i + 1] << 8) | System16PaletteRam[i + 0]; - - r = ((nColour >> 12) & 0x01) | ((nColour << 1) & 0x1e); - g = ((nColour >> 13) & 0x01) | ((nColour >> 3) & 0x1e); - b = ((nColour >> 14) & 0x01) | ((nColour >> 7) & 0x1e); - - System16Palette[i / 2] = BurnHighCol(System16PaletteNormal[r], System16PaletteNormal[g], System16PaletteNormal[b], 0); - System16Palette[(i / 2) + System16PaletteEntries] = BurnHighCol(System16PaletteShadow[r], System16PaletteShadow[g], System16PaletteShadow[b], 0); - System16Palette[(i / 2) + (System16PaletteEntries * 2)] = BurnHighCol(System16PaletteHilight[r], System16PaletteHilight[g], System16PaletteHilight[b], 0); - } - - return 0; -} - -static INT32 PhilkoCalcPalette() -{ - INT32 i; - - for (i = 0; i < System16PaletteEntries * 2; i +=2) { - INT32 r, g, b; - INT32 nColour = (System16PaletteRam[i + 1] << 8) | System16PaletteRam[i + 0]; - - b = (nColour >> 0) & 0x1f; - g = (nColour >> 5) & 0x1f; - r = (nColour >> 10) & 0x1f; - - System16Palette[i / 2] = BurnHighCol(System16PaletteNormal[r], System16PaletteNormal[g], System16PaletteNormal[b], 0); - System16Palette[(i / 2) + System16PaletteEntries] = BurnHighCol(System16PaletteShadow[r], System16PaletteShadow[g], System16PaletteShadow[b], 0); - System16Palette[(i / 2) + (System16PaletteEntries * 2)] = BurnHighCol(System16PaletteHilight[r], System16PaletteHilight[g], System16PaletteHilight[b], 0); - } - - return 0; -} - -/*==================================================== -Frame Rendering -====================================================*/ - -inline static void System16AUpdateTileValues() -{ - UINT16 *TextRam = (UINT16*)System16TextRam; - INT32 i; - - for (i = 0; i < 2; i++) { - System16OldPage[i] = System16Page[i]; - System16Page[i] = (System16ScreenFlip) ? BURN_ENDIAN_SWAP_INT16(TextRam[0xe8e/2 - i]) : BURN_ENDIAN_SWAP_INT16(TextRam[0xe9e/2 - i]); - System16ScrollX[i] = BURN_ENDIAN_SWAP_INT16(TextRam[0xff8/2 + i]) & 0x1ff; - System16ScrollY[i] = BURN_ENDIAN_SWAP_INT16(TextRam[0xf24/2 + i]) & 0x0ff; - } - - if (System16OldPage[0] != System16Page[0]) { - System16RecalcFgTileMap = 1; - } - - if (System16OldPage[1] != System16Page[1]) { - System16RecalcBgTileMap = 1; - } -} - -void System16ARender() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - System16AUpdateTileValues(); - System16ACreateTileMaps(); - - System16CalcPalette(); - System16ARenderTileLayer(1, 0, 0); - System16ARenderSpriteLayer(1); - System16ARenderTileLayer(1, 0, 1); - System16ARenderSpriteLayer(2); - System16ARenderTileLayer(1, 1, 1); - System16ARenderTileLayer(0, 0, 1); - System16ARenderSpriteLayer(4); - System16ARenderTileLayer(0, 1, 1); - System16ARenderTextLayer(0); - System16ARenderSpriteLayer(8); - System16ARenderTextLayer(1); - BurnTransferCopy(System16Palette); -} - -void System16BootlegRender() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - System16CalcPalette(); - BootlegRenderTileLayer(1, 0, 0); - BootlegRenderTileLayer(1, 1, 0); - System16BRenderSpriteLayer(1); - BootlegRenderTileLayer(1, 0, 1); - System16BRenderSpriteLayer(2); - BootlegRenderTileLayer(1, 1, 1); - BootlegRenderTileLayer(0, 0, 1); - System16BRenderSpriteLayer(4); - BootlegRenderTileLayer(0, 1, 1); - System16BRenderTextLayer(0); - System16BRenderSpriteLayer(8); - System16BRenderTextLayer(1); - BurnTransferCopy(System16Palette); -} - -inline static void System16BUpdateTileValues() -{ - UINT16 *TextRam = (UINT16*)System16TextRam; - - for (INT32 i = 0; i < 4; i++) { - System16OldPage[i] = System16Page[i]; - System16Page[i] = BURN_ENDIAN_SWAP_INT16(TextRam[(0xe80 >> 1) + i]); - System16ScrollX[i] = BURN_ENDIAN_SWAP_INT16(TextRam[(0xe98 >> 1) + i]); - System16ScrollY[i] = BURN_ENDIAN_SWAP_INT16(TextRam[(0xe90 >> 1) + i]); - } - - if (System16OldPage[0] != System16Page[0]) { - System16RecalcFgTileMap = 1; - } - - if (System16OldPage[1] != System16Page[1]) { - System16RecalcBgTileMap = 1; - } - - if (System16OldPage[2] != System16Page[2]) { - System16RecalcFgAltTileMap = 1; - } - - if (System16OldPage[3] != System16Page[3]) { - System16RecalcBgAltTileMap = 1; - } -} - -void System16BRender() -{ - if (!System16IgnoreVideoEnable) { - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - } - - System16BUpdateTileValues(); - System16BCreateTileMaps(); - - if (Lockonph) { - PhilkoCalcPalette(); - } else { - System16CalcPalette(); - } - - System16BRenderTileLayer(1, 0, 0); - System16BRenderSpriteLayer(1); - System16BRenderTileLayer(1, 0, 1); - System16BRenderSpriteLayer(2); - System16BRenderTileLayer(1, 1, 1); - System16BRenderTileLayer(0, 0, 1); - System16BRenderSpriteLayer(4); - System16BRenderTileLayer(0, 1, 1); - System16BRenderTextLayer(0); - System16BRenderSpriteLayer(8); - System16BRenderTextLayer(1); - BurnTransferCopy(System16Palette); -} - -void System16BAltRender() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - System16BUpdateTileValues(); - System16BAltCreateTileMaps(); - - System16CalcPalette(); - System16BRenderTileLayer(1, 0, 0); - System16BRenderSpriteLayer(1); - System16BRenderTileLayer(1, 0, 1); - System16BRenderSpriteLayer(2); - System16BRenderTileLayer(1, 1, 1); - System16BRenderTileLayer(0, 0, 1); - System16BRenderSpriteLayer(4); - System16BRenderTileLayer(0, 1, 1); - System16BAltRenderTextLayer(0); - System16BRenderSpriteLayer(8); - System16BAltRenderTextLayer(1); - BurnTransferCopy(System16Palette); -} - -void System18Render() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - INT32 VDPLayer = (System18VdpMixing >> 1) & 3; - INT32 VDPPri = (System18VdpMixing & 1) ? (1 << VDPLayer) : 0; - - System16BUpdateTileValues(); - System16BCreateTileMaps(); - - System16CalcPalette(); - - if (System18VdpEnable) UpdateSystem18VDP(); - - System16BRenderTileLayer(1, 0, 0); - if (System18VdpEnable && VDPLayer == 0 && !VDPPri) System18DrawVDP(); - System16BRenderSpriteLayer(1); - if (System18VdpEnable && VDPLayer == 0 && VDPPri) System18DrawVDP(); - System16BRenderTileLayer(1, 0, 1); - if (System18VdpEnable && VDPLayer == 1 && !VDPPri) System18DrawVDP(); - System16BRenderSpriteLayer(2); - if (System18VdpEnable && VDPLayer == 1 && VDPPri) System18DrawVDP(); - System16BRenderTileLayer(1, 1, 1); - System16BRenderTileLayer(0, 0, 1); - if (System18VdpEnable && VDPLayer == 2 && !VDPPri) System18DrawVDP(); - System16BRenderSpriteLayer(4); - if (System18VdpEnable && VDPLayer == 2 && VDPPri) System18DrawVDP(); - System16BRenderTileLayer(0, 1, 1); - System16BRenderTextLayer(0); - if (System18VdpEnable && VDPLayer == 3 && !VDPPri) System18DrawVDP(); - System16BRenderSpriteLayer(8); - if (System18VdpEnable && VDPLayer == 3 && VDPPri) System18DrawVDP(); - System16BRenderTextLayer(1); - BurnTransferCopy(System16Palette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } -} - -void HangonRender() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - System16CalcPalette(); - - System16AUpdateTileValues(); - System16ACreateTileMaps(); - - HangonRenderRoadLayer(0); - HangonRenderSpriteLayer(1); - System16ARenderTileLayer(1, 0, 1); - HangonRenderSpriteLayer(2); - System16ARenderTileLayer(1, 1, 1); - System16ARenderTileLayer(0, 0, 1); - HangonRenderSpriteLayer(4); - System16ARenderTileLayer(0, 1, 1); - HangonRenderRoadLayer(1); - HangonRenderSpriteLayer(8); - System16ARenderTextLayer(0); - System16ARenderTextLayer(1); - BurnTransferCopy(System16Palette); -} - -void HangonAltRender() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - System16CalcPalette(); - - System16AUpdateTileValues(); - System16ACreateTileMaps(); - - HangonRenderRoadLayer(0); - HangonAltRenderSpriteLayer(1); - System16ARenderTileLayer(1, 0, 1); - HangonAltRenderSpriteLayer(2); - System16ARenderTileLayer(1, 1, 1); - System16ARenderTileLayer(0, 0, 1); - HangonAltRenderSpriteLayer(4); - System16ARenderTileLayer(0, 1, 1); - HangonRenderRoadLayer(1); - HangonAltRenderSpriteLayer(8); - System16ARenderTextLayer(0); - System16ARenderTextLayer(1); - BurnTransferCopy(System16Palette); -} - -void OutrunRender() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - System16BUpdateTileValues(); - System16BCreateTileMaps(); - - System16CalcPalette(); - OutrunRenderRoadBackgroundLayer(); - OutrunRenderSpriteLayer(1); - System16BRenderTileLayer(1, 0, 1); - OutrunRenderSpriteLayer(2); - System16BRenderTileLayer(1, 1, 1); - System16BRenderTileLayer(0, 0, 1); - OutrunRenderSpriteLayer(4); - System16BRenderTileLayer(0, 1, 1); - OutrunRenderRoadForegroundLayer(); - System16BRenderTextLayer(0); - OutrunRenderSpriteLayer(8); - System16BRenderTextLayer(1); - BurnTransferCopy(System16Palette); - - if (System16HasGears) BurnShiftRender(); -} - -void ShangonRender() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - System16BUpdateTileValues(); - System16BAltCreateTileMaps(); - - System16CalcPalette(); - OutrunRenderRoadBackgroundLayer(); - //System16BRenderSpriteLayer(1); - System16BRenderTileLayer(1, 0, 1); - //System16BRenderSpriteLayer(2); - System16BRenderTileLayer(1, 1, 1); - System16BRenderTileLayer(0, 0, 1); - //System16BRenderSpriteLayer(4); - System16BRenderTileLayer(0, 1, 1); - OutrunRenderRoadForegroundLayer(); - //System16BRenderSpriteLayer(8); - System16BRenderSpriteLayer(0); - System16BAltRenderTextLayer(0); - System16BAltRenderTextLayer(1); - BurnTransferCopy(System16Palette); -} - -void XBoardRender() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - System16BUpdateTileValues(); - System16BCreateTileMaps(); - - System16CalcPalette(); - OutrunRenderRoadBackgroundLayer(); - if (!System16RoadPriority) OutrunRenderRoadForegroundLayer(); - XBoardRenderSpriteLayer(1); - System16BRenderTileLayer(1, 0, 1); - XBoardRenderSpriteLayer(2); - System16BRenderTileLayer(1, 1, 1); - System16BRenderTileLayer(0, 0, 1); - XBoardRenderSpriteLayer(4); - System16BRenderTileLayer(0, 1, 1); - if (System16RoadPriority) OutrunRenderRoadForegroundLayer(); - System16BRenderTextLayer(0); - XBoardRenderSpriteLayer(8); - System16BRenderTextLayer(1); - BurnTransferCopy(System16Palette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } -} - -void YBoardRender() -{ - if (!System16VideoEnable) { - BurnTransferClear(); - return; - } - - System16CalcPalette(); - YBoardRenderSpriteLayer(); - System16RotateDraw(); - YBoardSystem16BRenderSpriteLayer(); - BurnTransferCopy(System16Palette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } - - if (System16HasGears) BurnShiftRender(); -} diff --git a/jan/src/burn/drv/sega/sys16_run.cpp b/jan/src/burn/drv/sega/sys16_run.cpp deleted file mode 100644 index 999c9ec31..000000000 --- a/jan/src/burn/drv/sega/sys16_run.cpp +++ /dev/null @@ -1,3759 +0,0 @@ -#include "sys16.h" -#include "dac.h" -#include "i8039.h" -#include "mc8123.h" -#include "upd7759.h" -#include "segapcm.h" - -UINT8 System16InputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 System16InputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 System16InputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 System16InputPort3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 System16InputPort4[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 System16InputPort5[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 System16InputPort6[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -UINT8 System16Gear = 0; -INT32 System16AnalogPort0 = 0; -INT32 System16AnalogPort1 = 0; -INT32 System16AnalogPort2 = 0; -INT32 System16AnalogPort3 = 0; -INT32 System16AnalogPort4 = 0; -INT32 System16AnalogPort5 = 0; -INT32 System16AnalogSelect = 0; -UINT8 System16Dip[3] = {0, 0, 0}; -UINT8 System16Input[7] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -UINT8 System16Reset = 0; -UINT8 System16MCUData = 0; - -UINT8 *Mem = NULL; -UINT8 *MemEnd = NULL; -UINT8 *RamStart = NULL; -UINT8 *RamEnd = NULL; -UINT8 *System16Rom = NULL; -UINT8 *System16Code = NULL; -UINT8 *System16Rom2 = NULL; -UINT8 *System16Rom3 = NULL; -UINT8 *System16Z80Rom = NULL; -UINT8 *System16Z80Code = NULL; -UINT8 *System16Z80Rom2 = NULL; -UINT8 *System16Z80Rom3 = NULL; -UINT8 *System16Z80Rom4 = NULL; -UINT8 *System167751Prog = NULL; -UINT8 *System167751Data = NULL; -UINT8 *System16UPD7759Data = NULL; -UINT8 *System16PCMData = NULL; -UINT8 *System16PCM2Data = NULL; -UINT8 *System16RF5C68Data = NULL; -UINT8 *System16I8751Rom = NULL; -UINT8 *System16Prom = NULL; -UINT8 *System16Key = NULL; -UINT8 *System16Ram = NULL; -UINT8 *System16ExtraRam = NULL; -UINT8 *System16ExtraRam2 = NULL; -UINT8 *System16ExtraRam3 = NULL; -UINT8 *System16BackupRam = NULL; -UINT8 *System16BackupRam2 = NULL; -UINT8 *System16Z80Ram = NULL; -UINT8 *System16Z80Ram2 = NULL; -UINT8 *System16TileRam = NULL; -UINT8 *System16TextRam = NULL; -UINT8 *System16SpriteRam = NULL; -UINT8 *System16SpriteRamBuff = NULL; -UINT8 *System16SpriteRam2 = NULL; -UINT8 *System16RotateRam = NULL; -UINT8 *System16RotateRamBuff = NULL; -UINT8 *System16PaletteRam = NULL; -UINT8 *System16RoadRam = NULL; -UINT8 *System16RoadRamBuff = NULL; -UINT8 *System16Tiles = NULL; -UINT8 *System16Sprites = NULL; -UINT8 *System16Sprites2 = NULL; -UINT8 *System16Roads = NULL; -UINT32 *System16Palette = NULL; -UINT8 *System16TempGfx = NULL; -UINT8 *System16PriorityMap = NULL; - -UINT32 System16RomSize = 0; -UINT32 System16RomNum = 0; -UINT32 System16Rom2Size = 0; -UINT32 System16Rom2Num = 0; -UINT32 System16Rom3Size = 0; -UINT32 System16Rom3Num = 0; -UINT32 System16TileRomSize = 0; -UINT32 System16TileRomNum = 0; -UINT32 System16NumTiles = 0; -UINT32 System16SpriteRomSize = 0; -UINT32 System16SpriteRomNum = 0; -UINT32 System16Sprite2RomSize = 0; -UINT32 System16Sprite2RomNum = 0; -UINT32 System16RoadRomSize = 0; -UINT32 System16RoadRomNum = 0; -UINT32 System16Z80RomSize = 0; -UINT32 System16Z80RomNum = 0; -UINT32 System16Z80Rom2Size = 0; -UINT32 System16Z80Rom2Num = 0; -UINT32 System16Z80Rom3Size = 0; -UINT32 System16Z80Rom3Num = 0; -UINT32 System16Z80Rom4Size = 0; -UINT32 System16Z80Rom4Num = 0; -UINT32 System167751ProgSize = 0; -UINT32 System167751ProgNum = 0; -UINT32 System167751DataSize = 0; -UINT32 System167751DataNum = 0; -UINT32 System16UPD7759DataSize = 0; -UINT32 System16UPD7759DataNum = 0; -UINT32 System16PCMDataSize = 0; -UINT32 System16PCMDataNum = 0; -UINT32 System16PCMDataSizePreAllocate = 0; -UINT32 System16PCM2DataSize = 0; -UINT32 System16PCM2DataNum = 0; -UINT32 System16RF5C68DataSize = 0; -UINT32 System16RF5C68DataNum = 0; -UINT32 System16I8751RomSize = 0; -UINT32 System16I8751RomNum = 0; -UINT32 System16MSM6295RomSize = 0; -UINT32 System16MSM6295RomNum = 0; -UINT32 System16PromSize = 0; -UINT32 System16PromNum = 0; -UINT32 System16KeySize = 0; -UINT32 System16KeyNum = 0; -UINT32 System16RamSize = 0; -UINT32 System16ExtraRamSize = 0; -UINT32 System16ExtraRam2Size = 0; -UINT32 System16ExtraRam3Size = 0; -UINT32 System16SpriteRamSize = 0; -UINT32 System16SpriteRam2Size = 0; -UINT32 System16RotateRamSize = 0; -UINT32 System16BackupRamSize = 0; -UINT32 System16BackupRam2Size = 0; - -bool System16HasGears = false; - -UINT8 System16VideoControl; -INT32 System16SoundLatch; -bool System16BTileAlt = false; -bool Shangon = false; -bool Hangon = false; -bool AlienSyndrome = false; -bool HammerAway = false; -bool Lockonph = false; -bool System16Z80Enable = true; -bool System1668KEnable = true; - -INT32 nSystem16CyclesDone[4]; -static INT32 nCyclesTotal[4]; -static INT32 nCyclesSegment; -UINT32 System16ClockSpeed = 0; -UINT32 System16Z80ClockSpeed = 0; - -INT32 System16YM2413IRQInterval; - -#ifdef BUILD_A68K -static bool bUseAsm68KCoreOldValue = false; -#endif - -static UINT8 N7751Command; -static UINT32 N7751RomAddress; -static UINT32 UPD7759BankAddress; -static UINT32 RF5C68PCMBankAddress; - -UINT8 *System16I8751InitialConfig = NULL; - -Sim8751 Simulate8751; -System16Map68K System16Map68KDo; -System16MapZ80 System16MapZ80Do; -System16CustomLoadRom System16CustomLoadRomDo; -System16CustomDecryptOpCode System16CustomDecryptOpCodeDo; -System16ProcessAnalogControls System16ProcessAnalogControlsDo; -System16MakeAnalogInputs System16MakeAnalogInputsDo; - -/*==================================================== -Inputs -====================================================*/ - -inline static void System16ClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x30) == 0x30) { - *nJoystickInputs &= ~0x30; - } - if ((*nJoystickInputs & 0xc0) == 0xc0) { - *nJoystickInputs &= ~0xc0; - } -} - -inline static void System16MakeInputs() -{ - // Reset Inputs - System16Input[0] = System16Input[1] = System16Input[2] = System16Input[3] = System16Input[4] = System16Input[5] = System16Input[6] = 0; - - // Compile Digital Inputs - for (int i = 0; i < 8; i++) { - System16Input[0] |= (System16InputPort0[i] & 1) << i; - System16Input[1] |= (System16InputPort1[i] & 1) << i; - System16Input[2] |= (System16InputPort2[i] & 1) << i; - System16Input[3] |= (System16InputPort3[i] & 1) << i; - System16Input[4] |= (System16InputPort4[i] & 1) << i; - System16Input[5] |= (System16InputPort5[i] & 1) << i; - System16Input[6] |= (System16InputPort6[i] & 1) << i; - } - - if (System16MakeAnalogInputsDo) System16MakeAnalogInputsDo(); -} - -inline static void OutrunMakeInputs() -{ - // Reset Inputs - System16Input[0] = 0; - - System16InputPort0[4] = BurnShiftInputCheckToggle(System16Gear) ? 0x00 : 0x01; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - System16Input[0] |= (System16InputPort0[i] & 1) << i; - } -} - -inline static void PdriftMakeInputs() -{ - // Reset Inputs - System16Input[0] = 0; - - System16InputPort0[5] = BurnShiftInputCheckToggle(System16Gear) ? 0x00 : 0x01; - - // Compile Digital Inputs - for (INT32 i = 0; i < 8; i++) { - System16Input[0] |= (System16InputPort0[i] & 1) << i; - } -} - -static void System16GunMakeInputs() -{ - if (nBurnGunNumPlayers) BurnGunMakeInputs(0, (INT16)System16AnalogPort0, (INT16)System16AnalogPort1); - if (nBurnGunNumPlayers >= 2) BurnGunMakeInputs(1, (INT16)System16AnalogPort2, (INT16)System16AnalogPort3); - if (nBurnGunNumPlayers >= 3) BurnGunMakeInputs(2, (INT16)System16AnalogPort4, (INT16)System16AnalogPort5); -} - -/*==================================================== -Reset Driver -====================================================*/ - -static INT32 System16DoReset() -{ - INT32 i; - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC_CPU2)) { - fd1094_machine_init(); - } - - if (System16I8751InitialConfig) { - SekOpen(0); - sega_315_5195_configure_explicit(System16I8751InitialConfig); - SekClose(); - } - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM) { - SekOpen(0); - SekMapMemory(System16Rom, 0x000000, 0x0fffff, MAP_ROM); - SekClose(); - } - - SekOpen(0); - System1668KEnable = true; - if (((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN)) { - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM) == 0) { - sega_315_5195_reset(); - } - } - SekReset(); - SekClose(); - - if (System16HasGears) BurnShiftReset(); - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMX || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_HANGON || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMY) { - SekOpen(1); - SekReset(); - SekClose(); - - System16RoadControl = 0; - System16AnalogSelect = 0; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMY) { - SekOpen(2); - SekReset(); - SekClose(); - } - - if (System16Z80RomNum || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM)) { - ZetOpen(0); - ZetReset(); - ZetClose(); - } - - if (System16Z80Rom2Num) { - ZetOpen(1); - ZetReset(); - ZetClose(); - } - - if (System167751ProgSize) { - N7751Reset(); - DACReset(); - N7751Command = 0; - N7751RomAddress = 0; - } - - if (System16UPD7759DataSize) { - UPD7759Reset(); - UPD7759BankAddress = 0; - } - - if (System16MSM6295RomSize) { - MSM6295Reset(0); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - BurnYM3438Reset(); - RF5C68PCMReset(); - } else { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2203) { - BurnYM2203Reset(); - } else { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - BurnYM2413Reset(); - } else { - BurnYM2151Reset(); - } - } - } - - if (System16I8751RomNum) { - mcs51_reset(); - } - - // Reset Variables - for (i = 0; i < 4; i++) { - System16Page[i] = 0; - System16OldPage[i] = 0; - System16ScrollX[i] = 0; - System16ScrollY[i] = 0; - BootlegBgPage[i] = 0; - BootlegFgPage[i] = 0; - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358_SMALL)) { - System16SpriteBanks[ 0] = 0; - System16SpriteBanks[ 1] = 255; - System16SpriteBanks[ 2] = 255; - System16SpriteBanks[ 3] = 255; - System16SpriteBanks[ 4] = 255; - System16SpriteBanks[ 5] = 255; - System16SpriteBanks[ 6] = 255; - System16SpriteBanks[ 7] = 3; - System16SpriteBanks[ 8] = 255; - System16SpriteBanks[ 9] = 255; - System16SpriteBanks[10] = 255; - System16SpriteBanks[11] = 2; - System16SpriteBanks[12] = 255; - System16SpriteBanks[13] = 1; - System16SpriteBanks[14] = 0; - System16SpriteBanks[15] = 255; - } else { - for (i = 0; i < 16; i++) { - System16SpriteBanks[i] = i; - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18 || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMX) { - for (i = 0; i < 8; i++) { - System16TileBanks[i] = i; - System16OldTileBanks[i] = i; - } - } - - System16VideoEnable = 0; - System18VdpEnable = 0; - System18VdpMixing = 0; - System16VideoControl = 0; - System16ScreenFlip = 0; - System16SoundLatch = 0; - System16ColScroll = 0; - System16RowScroll = 0; - System16MCUData = 0; - - return 0; -} - -INT32 __fastcall OutrunResetCallback() -{ - INT32 nLastCPU = nSekActive; - SekClose(); - - SekOpen(1); - SekReset(); - SekClose(); - - SekOpen(nLastCPU); - - return 0; -} - -/*==================================================== -Z80 Memory Handlers -====================================================*/ - -UINT8 __fastcall System16Z80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x01: { - return BurnYM2151ReadStatus(); - } - - case 0x40: - case 0xc0: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return System16SoundLatch; - } - - case 0x80: { - if (System16UPD7759DataSize) { - return UPD7759BusyRead(0) << 7; - } - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read Port -> %02X\n"), a); -#endif - - return 0; -} - -UINT8 __fastcall System16PPIZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x01: { - return BurnYM2151ReadStatus(); - } - - case 0x40: - case 0xc0: { - ppi8255_set_portC(0, 0x00); - return System16SoundLatch; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read Port -> %02X\n"), a); -#endif - - return 0; -} - -UINT8 __fastcall SystemXZ80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x01: { - return BurnYM2151ReadStatus(); - } - - case 0x40: - case 0xc0: { - return System16SoundLatch; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read Port -> %02X\n"), a); -#endif - - return 0; -} - -UINT8 __fastcall System16Z80PortRead2(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x40: - case 0xc0: { - return System16SoundLatch; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read Port -> %02X\n"), a); -#endif - - return 0; -} - -void __fastcall System16Z80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - d &= 0xff; - - switch (a) { - case 0x00: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x01: { - BurnYM2151WriteRegister(d); - return; - } - - case 0x40: { - if (System16UPD7759DataSize) { - UPD7759StartWrite(0,d & 0x80); - UPD7759ResetWrite(0,d & 0x40); - - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5358_SMALL)) { - if (!(d & 0x04)) UPD7759BankAddress = 0x00000; - if (!(d & 0x08)) UPD7759BankAddress = 0x10000; - if (!(d & 0x10)) UPD7759BankAddress = 0x20000; - if (!(d & 0x20)) UPD7759BankAddress = 0x30000; - UPD7759BankAddress += (d & 0x03) * 0x4000; - - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5521) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704) || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704_PS2)) { - UPD7759BankAddress = ((d & 0x08) >> 3) * 0x20000; - UPD7759BankAddress += (d & 0x07) * 0x4000; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5797) { - UPD7759BankAddress = ((d & 0x08) >> 3) * 0x40000; - UPD7759BankAddress += ((d & 0x10) >> 4) * 0x20000; - UPD7759BankAddress += (d & 0x07) * 0x04000; - } - - UPD7759BankAddress %= System16UPD7759DataSize; - - ZetMapArea(0x8000, 0xdfff, 0, System16UPD7759Data + UPD7759BankAddress); - ZetMapArea(0x8000, 0xdfff, 2, System16UPD7759Data + UPD7759BankAddress); - return; - } - } - - case 0x80: { - if (System167751ProgSize) { - N7751RomAddress &= 0x3fff; - N7751RomAddress |= (d & 0x01) << 14; - if (!(d & 0x02) && System167751DataNum >= 1) N7751RomAddress |= 0x00000; - if (!(d & 0x04) && System167751DataNum >= 2) N7751RomAddress |= 0x08000; - if (!(d & 0x08) && System167751DataNum >= 3) N7751RomAddress |= 0x10000; - if (!(d & 0x10) && System167751DataNum >= 4) N7751RomAddress |= 0x18000; - N7751Command = d >> 5; - return; - } - - if (System16UPD7759DataSize) { - UPD7759PortWrite(0,d); - return; - } - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Write Port -> %02X, %02X\n"), a, d); -#endif -} - -#if 0 && defined FBA_DEBUG -UINT8 __fastcall System16Z80Read(UINT16 a) -{ - bprintf(PRINT_NORMAL, _T("Z80 Read -> %04X\n"), a); - - return 0; -} -#endif - -#if 0 && defined FBA_DEBUG -void __fastcall System16Z80Write(UINT16 a, UINT8 d) -{ - bprintf(PRINT_NORMAL, _T("Z80 Write -> %04X, %02X\n"), a, d); -} -#endif - -UINT8 __fastcall System16Z80PCMRead(UINT16 a) -{ - if (a >= 0xf000 && a <= 0xf0ff) { - return SegaPCMRead(0, a - 0xf000); - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read -> %04X\n"), a); -#endif - - return 0; -} - -void __fastcall System16Z80PCMWrite(UINT16 a, UINT8 d) -{ - if (a >= 0xf000 && a <= 0xf0ff) { - SegaPCMWrite(0, a - 0xf000, d); - return; - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Write -> %04X, %02X\n"), a, d); -#endif -} - -UINT8 __fastcall System16Z802203PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x40: { - ppi8255_set_portC(0, 0x00); - return System16SoundLatch; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read Port -> %02X\n"), a); -#endif - - return 0; -} - -UINT8 __fastcall System16Z802203Read(UINT16 a) -{ - if (a >= 0xe000 && a <= 0xe0ff) { - return SegaPCMRead(0, a - 0xe000); - } - - switch (a) { - case 0xd000: { - return BurnYM2203Read(0, 0); - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read -> %04X\n"), a); -#endif - - return 0; -} - -void __fastcall System16Z802203Write(UINT16 a, UINT8 d) -{ - if (a >= 0xe000 && a <= 0xe0ff) { - SegaPCMWrite(0, a - 0xe000, d); - return; - } - - switch (a) { - case 0xd000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0xd001: { - BurnYM2203Write(0, 1, d); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Write -> %04X, %02X\n"), a, d); -#endif -} - -UINT8 __fastcall System16Z80Read2(UINT16 a) -{ - if (a >= 0xf000 && a <= 0xf0ff) { - return SegaPCMRead(1, a - 0xf000); - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read -> %04X\n"), a); -#endif - - return 0; -} - -void __fastcall System16Z80Write2(UINT16 a, UINT8 d) -{ - if (a >= 0xf000 && a <= 0xf0ff) { - SegaPCMWrite(1, a - 0xf000, d); - return; - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Write -> %04X, %02X\n"), a, d); -#endif -} - -UINT8 __fastcall System18Z80PortRead(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x80: { - return BurnYM3438Read(0, 0); - } - - case 0xc0: { - return System16SoundLatch; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read Port -> %02X\n"), a); -#endif - - return 0; -} - -void __fastcall System18Z80PortWrite(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x80: { - BurnYM3438Write(0, 0, d); - return; - } - - case 0x81: { - BurnYM3438Write(0, 1, d); - return; - } - - case 0x82: { - BurnYM3438Write(0, 2, d); - return; - } - - case 0x83: { - BurnYM3438Write(0, 3, d); - return; - } - - case 0x90: { - BurnYM3438Write(1, 0, d); - return; - } - - case 0x91: { - BurnYM3438Write(1, 1, d); - return; - } - - case 0x92: { - BurnYM3438Write(1, 2, d); - return; - } - - case 0x93: { - BurnYM3438Write(1, 3, d); - return; - } - - case 0xa0: { - RF5C68PCMBankAddress = d * 0x2000; - ZetMapArea(0xa000, 0xbfff, 0, System16Z80Rom + 0x10000 + RF5C68PCMBankAddress); - ZetMapArea(0xa000, 0xbfff, 2, System16Z80Rom + 0x10000 + RF5C68PCMBankAddress); - return; - } - - case 0xc0: { - System16MCUData = d; - mcs51_set_irq_line(MCS51_INT1_LINE, CPU_IRQSTATUS_ACK); - nSystem16CyclesDone[2] += mcs51Run(2000); - mcs51_set_irq_line(MCS51_INT1_LINE, CPU_IRQSTATUS_NONE); - return; - } - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Write Port -> %02X, %02X\n"), a, d); -#endif -} - -UINT8 __fastcall System18Z80Read(UINT16 a) -{ - if (a >= 0xd000 && a <= 0xdfff) { - return RF5C68PCMRead(a - 0xd000); - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Read -> %04X\n"), a); -#endif - - return 0; -} - -void __fastcall System18Z80Write(UINT16 a, UINT8 d) -{ - if (a >= 0xc000 && a <= 0xc00f) { - RF5C68PCMRegWrite(a - 0xc000, d); - return; - } - - if (a >= 0xd000 && a <= 0xdfff) { - RF5C68PCMWrite(a - 0xd000, d); - return; - } - -#if 0 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Z80 Write -> %04X, %02X\n"), a, d); -#endif -} - -void System16N7751ControlWrite(UINT32 Port, UINT32 Data) -{ - if (!(Data & 0x01)) { - N7751Reset(); - return; - } - - if (!(Data & 0x02)) { - N7751SetIrqState(1); - return; - } - - if (Data & 0x02) { - N7751SetIrqState(0); - return; - } - - bprintf(PRINT_NORMAL, _T("YM2151 Write Port %x, %02X\n"), Port, Data); -} - -UINT8 __fastcall N7751ReadIo(UINT32 Port) -{ - switch (Port) { - case 0x102: { - return 0x80 | ((N7751Command & 0x07) << 4); - } - - case 0x120: { - return System167751Data[N7751RomAddress]; - } - } - - return 0; -} - -void __fastcall N7751WriteIo(UINT32 Port, UINT8 Value) -{ - switch (Port) { - case 0x101: { - DACSignedWrite(0, Value); - return; - } - - case 0x102: { - return; - } - - case 0x104: - case 0x105: - case 0x106: - case 0x107: { - INT32 Offset = Port - 0x104; - INT32 Mask = (0xf << (4 * Offset)) & 0x3fff; - INT32 NewData = (Value << (4 * Offset)) & Mask; - N7751RomAddress = (N7751RomAddress & ~Mask) | NewData; - return; - } - } -} - -UINT8 __fastcall N7751Read(UINT32 Address) -{ - if (Address < 0x400) return System167751Prog[Address]; - return 0; -} - -/*==================================================== -Allocate Memory -====================================================*/ - -static INT32 System16MemIndex() -{ - UINT8 *Next; Next = Mem; - - System16PaletteEntries = 0x800; - System16RamSize = 0x4000; - System16ExtraRamSize = 0; - System16ExtraRam2Size = 0; - System16ExtraRam3Size = 0; - System16SpriteRamSize = 0x800; - System16SpriteRam2Size = 0; - System16RotateRamSize = 0; - System16BackupRamSize = 0; - System16BackupRam2Size = 0; - bool SpriteBuffer = false; - bool HasRoad = false; - bool UseTempDraw = false; - INT32 Z80RomSize = 0x10000; - INT32 Z80RamSize = 0x00800; - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - Z80RomSize = 0x210000; - Z80RamSize = 0x2000; - UseTempDraw = true; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_HANGON) { - System16ExtraRamSize = 0x4000; - System16SpriteRamSize = 0x1000; - System16RamSize = 0x10000; - - HasRoad = true; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN) { - System16PaletteEntries = 0x1000; - System16RamSize = 0x8000; - System16ExtraRamSize = 0x8000; - System16SpriteRamSize = 0x1000; - SpriteBuffer = true; - HasRoad = true; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMX) { - System16PaletteEntries = 0x2000; - System16RamSize = 0x8000; - System16SpriteRamSize = 0x1000; - System16BackupRamSize = 0x4000; - System16BackupRam2Size = 0x4000; - SpriteBuffer = true; - HasRoad = true; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMY) { - System16PaletteEntries = 0x2000; - System16RamSize = 0x10000; - System16ExtraRamSize = 0x10000; - System16ExtraRam2Size = 0x10000; - System16ExtraRam3Size = 0x10000; - System16SpriteRamSize = 0x1000; - System16BackupRamSize = 0x4000; - System16SpriteRam2Size = 0x10000; - System16RotateRamSize = 0x800; - UseTempDraw = true; - } - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM) { - System16ExtraRamSize = 0x40000; - Z80RomSize = 0x40000; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704_PS2) { - System16RamSize = 0x40000; - } - - if (Lockonph) { - System16PaletteEntries = 0x1000; - System16RamSize = 0x10000; - } - - System16Rom = Next; Next += (System16RomSize > 0x100000) ? System16RomSize : 0x100000; - System16Code = Next; Next += (System16RomSize > 0x100000) ? System16RomSize : 0x100000; - System16Rom2 = Next; (System16Rom2Size) ? Next += 0x080000 : Next += 0; - System16Rom3 = Next; (System16Rom3Size) ? Next += 0x080000 : Next += 0; - System16Z80Rom = Next; Next += Z80RomSize; - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MC8123_ENC) { - System16Z80Code = Next; Next += Z80RomSize; - } - System16Z80Rom2 = Next; Next += System16Z80Rom2Size; - System16Z80Rom3 = Next; Next += System16Z80Rom3Size; - System16Z80Rom4 = Next; Next += System16Z80Rom4Size; - System167751Prog = Next; Next += System167751ProgSize; - System167751Data = Next; Next += System167751DataSize; - System16UPD7759Data = Next; Next += System16UPD7759DataSize; - System16PCMData = Next; Next += System16PCMDataSize; - System16PCM2Data = Next; Next += System16PCM2DataSize; - System16RF5C68Data = Next; Next += System16RF5C68DataSize; - System16Key = Next; Next += System16KeySize; - System16Prom = Next; Next += System16PromSize; - System16I8751Rom = Next; Next += System16I8751RomSize; - MSM6295ROM = Next; Next += System16MSM6295RomSize; - - RamStart = Next; - - System16Ram = Next; Next += System16RamSize; - System16ExtraRam = Next; Next += System16ExtraRamSize; - System16ExtraRam2 = Next; Next += System16ExtraRam2Size; - System16ExtraRam3 = Next; Next += System16ExtraRam3Size; - System16TileRam = Next; (System16TileRomSize) ? Next += 0x10000 : Next += 0; - System16TextRam = Next; (System16TileRomSize) ? Next += 0x01000 : Next += 0; - System16SpriteRam = Next; Next += System16SpriteRamSize; - System16SpriteRam2 = Next; Next += System16SpriteRam2Size; - System16RotateRam = Next; Next += System16RotateRamSize; - System16RotateRamBuff= Next; Next += System16RotateRamSize; - if (SpriteBuffer) { System16SpriteRamBuff = Next; Next += System16SpriteRamSize; } - System16PaletteRam = Next; Next += System16PaletteEntries * 2; - - if (HasRoad) { - System16RoadRam = Next; Next += 0x01000; - System16RoadRamBuff = Next; Next += 0x01000; - } - - System16BackupRam = Next; Next += System16BackupRamSize; - System16BackupRam2 = Next; Next += System16BackupRam2Size; - - System16Z80Ram = Next; Next += Z80RamSize; - - if (System16Z80Rom2Num) { - System16Z80Ram2 = Next; Next += 0x800; - } - - RamEnd = Next; - - System16Tiles = Next; Next += (System16NumTiles * 8 * 8); - System16Sprites = Next; Next += System16SpriteRomSize; - System16Sprites2 = Next; Next += System16Sprite2RomSize; - - if (HasRoad) { - System16Roads = Next; Next += 0x40000; - } - - System16Palette = (UINT32*)Next; Next += System16PaletteEntries * 3 * sizeof(UINT32) + (((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) ? (0x40 * sizeof(UINT32)) : 0); - - if (UseTempDraw) { pTempDraw = (UINT16*)Next; Next += (512 * 512 * sizeof(UINT16)); } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMY) { System16PriorityMap = Next; Next += 320 * 224; } - - MemEnd = Next; - - return 0; -} - -/*==================================================== -Rom Loading -====================================================*/ - -INT32 System16LoadRoms(bool bLoad) -{ - struct BurnRomInfo ri; - ri.nType = 0; - ri.nLen = 0; - INT32 nOffset = -1; - UINT32 i; - INT32 nRet = 0; - - if (!bLoad) { - do { - ri.nLen = 0; - ri.nType = 0; - BurnDrvGetRomInfo(&ri, ++nOffset); - if ((ri.nType & 0xff) == SYS16_ROM_PROG) { - System16RomSize += ri.nLen; - System16RomNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_PROG2) { - System16Rom2Size += ri.nLen; - System16Rom2Num++; - } - if ((ri.nType & 0xff) == SYS16_ROM_PROG3) { - System16Rom3Size += ri.nLen; - System16Rom3Num++; - } - if ((ri.nType & 0xff) == SYS16_ROM_TILES) { - System16TileRomSize += ri.nLen; - System16TileRomNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_TILES_20000) { - System16TileRomSize += 0x20000; - System16TileRomNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_SPRITES) { - System16SpriteRomSize += ri.nLen; - System16SpriteRomNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_SPRITES2) { - System16Sprite2RomSize += ri.nLen; - System16Sprite2RomNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_ROAD) { - System16RoadRomSize += ri.nLen; - System16RoadRomNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_Z80PROG) { - System16Z80RomSize += ri.nLen; - System16Z80RomNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_Z80PROG2) { - System16Z80Rom2Size += ri.nLen; - System16Z80Rom2Num++; - } - if ((ri.nType & 0xff) == SYS16_ROM_Z80PROG3) { - System16Z80Rom3Size += ri.nLen; - System16Z80Rom3Num++; - } - if ((ri.nType & 0xff) == SYS16_ROM_Z80PROG4) { - System16Z80Rom4Size += ri.nLen; - System16Z80Rom4Num++; - } - if ((ri.nType & 0xff) == SYS16_ROM_7751PROG) { - System167751ProgSize += ri.nLen; - System167751ProgNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_7751DATA) { - System167751DataSize += ri.nLen; - System167751DataNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_UPD7759DATA) { - if (ri.nLen < 0x10000) { - System16UPD7759DataSize += 0x10000; - } else { - System16UPD7759DataSize += ri.nLen; - } - System16UPD7759DataNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_PCMDATA) { - if (System16PCMDataSizePreAllocate) { - System16PCMDataSize = System16PCMDataSizePreAllocate; - } else { - System16PCMDataSize += ri.nLen; - } - - System16PCMDataNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_PCM2DATA) { - System16PCM2DataSize += ri.nLen; - System16PCM2DataNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_RF5C68DATA) { - System16RF5C68DataNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_PROM) { - System16PromSize += ri.nLen; - System16PromNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_KEY) { - System16KeySize += ri.nLen; - System16KeyNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_I8751) { - System16I8751RomSize += ri.nLen; - System16I8751RomNum++; - } - if ((ri.nType & 0xff) == SYS16_ROM_MSM6295) { - System16MSM6295RomSize += ri.nLen; - System16MSM6295RomNum++; - } - } while (ri.nLen); - - System16NumTiles = System16TileRomSize / 24; - if (System16RF5C68DataNum) { - System16Z80RomNum += System16RF5C68DataNum; - System16Z80RomSize = 0x210000; - } - -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("68K Rom Size: 0x%X (%i roms)\n"), System16RomSize, System16RomNum); - if (System16Rom2Size) bprintf(PRINT_NORMAL, _T("68K #2 Rom Size: 0x%X (%i roms)\n"), System16Rom2Size, System16Rom2Num); - if (System16Rom3Size) bprintf(PRINT_NORMAL, _T("68K #3 Rom Size: 0x%X (%i roms)\n"), System16Rom3Size, System16Rom3Num); - bprintf(PRINT_NORMAL, _T("Tile Rom Size: 0x%X (%i roms, 0x%X Tiles)\n"), System16TileRomSize, System16TileRomNum, System16NumTiles); - bprintf(PRINT_NORMAL, _T("Sprite Rom Size: 0x%X (%i roms)\n"), System16SpriteRomSize, System16SpriteRomNum); - if (System16Sprite2RomSize) bprintf(PRINT_NORMAL, _T("Sprite Rom 2 Size: 0x%X (%i roms)\n"), System16Sprite2RomSize, System16Sprite2RomNum); - bprintf(PRINT_NORMAL, _T("Z80 Rom Size: 0x%X (%i roms)\n"), System16Z80RomSize, System16Z80RomNum); - if (System16Z80Rom2Size) bprintf(PRINT_NORMAL, _T("Z80 #2 Rom Size: 0x%X (%i roms)\n"), System16Z80Rom2Size, System16Z80Rom2Num); - if (System16Z80Rom3Size) bprintf(PRINT_NORMAL, _T("Z80 #3 Rom Size: 0x%X (%i roms)\n"), System16Z80Rom3Size, System16Z80Rom3Num); - if (System16Z80Rom4Size) bprintf(PRINT_NORMAL, _T("Z80 #4 Rom Size: 0x%X (%i roms)\n"), System16Z80Rom4Size, System16Z80Rom4Num); - if (System16RoadRomSize) bprintf(PRINT_NORMAL, _T("Road Rom Size: 0x%X (%i roms)\n"), System16RoadRomSize, System16RoadRomNum); - if (System167751ProgSize) bprintf(PRINT_NORMAL, _T("7751 Prog Size: 0x%X (%i roms)\n"), System167751ProgSize, System167751ProgNum); - if (System167751DataSize) bprintf(PRINT_NORMAL, _T("7751 Data Size: 0x%X (%i roms)\n"), System167751DataSize, System167751DataNum); - if (System16UPD7759DataSize) bprintf(PRINT_NORMAL, _T("UPD7759 Data Size: 0x%X (%i roms)\n"), System16UPD7759DataSize, System16UPD7759DataNum); - if (System16PCMDataSize) bprintf(PRINT_NORMAL, _T("PCM Data Size: 0x%X (%i roms)\n"), System16PCMDataSize, System16PCMDataNum); - if (System16PCM2DataSize) bprintf(PRINT_NORMAL, _T("PCM Data #2 Size: 0x%X (%i roms)\n"), System16PCM2DataSize, System16PCM2DataNum); - if (System16PromSize) bprintf(PRINT_NORMAL, _T("PROM Rom Size: 0x%X (%i roms)\n"), System16PromSize, System16PromNum); - if (System16KeySize) bprintf(PRINT_NORMAL, _T("Encryption Key Size: 0x%X\n"), System16KeySize); - if (System16I8751RomSize) bprintf(PRINT_NORMAL, _T("I8751 Prog Size: 0x%X\n"), System16I8751RomSize); - if (System16MSM6295RomSize) bprintf(PRINT_NORMAL, _T("MSM6295 Rom Size: 0x%X (%i roms)\n"), System16MSM6295RomSize, System16MSM6295RomNum); -#endif - } - - if (bLoad) { - INT32 Offset; - - // 68000 Program Roms - Offset = 0; - for (i = 0; i < System16RomNum; i += 2) { - nRet = BurnLoadRom(System16Rom + Offset + 1, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(System16Rom + Offset + 0, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - } - - // 68000 #2 Program Roms - if (System16Rom2Size) { - Offset = 0; - for (i = System16RomNum; i < System16RomNum + System16Rom2Num; i += 2) { - nRet = BurnLoadRom(System16Rom2 + Offset + 1, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(System16Rom2 + Offset + 0, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - } - } - - // 68000 #3 Program Roms - if (System16Rom3Size) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num; i < System16RomNum + System16Rom2Num + System16Rom3Num; i += 2) { - nRet = BurnLoadRom(System16Rom3 + Offset + 1, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(System16Rom3 + Offset + 0, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - } - } - - // Tile Roms - Offset = 0; - System16TempGfx = (UINT8*)BurnMalloc(System16TileRomSize); - for (i = System16RomNum + System16Rom2Num + System16Rom3Num; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum; i++) { - nRet = BurnLoadRom(System16TempGfx + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == SYS16_ROM_TILES_20000) { - Offset += 0x20000; - } else { - Offset += ri.nLen; - } - } - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_INVERT_TILES) { - for (i = 0; i < System16TileRomSize; i++) { - System16TempGfx[i] ^= 0xff; - } - } - System16Decode8x8Tiles(System16Tiles, System16NumTiles, System16TileRomSize * 2 / 3, System16TileRomSize * 1 / 3, 0); - BurnFree(System16TempGfx); - - // Sprite Roms - Offset = 0; - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_SPRITE_LOAD32) { - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum; i += 4) { - nRet = BurnLoadRom(System16Sprites + Offset + 0, i + 0, 4); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites + Offset + 1, i + 1, 4); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites + Offset + 2, i + 2, 4); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites + Offset + 3, i + 3, 4); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 2); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 3); - Offset += ri.nLen; - } - } else { - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum; i += 2) { - nRet = BurnLoadRom(System16Sprites + Offset + 0, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites + Offset + 1, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - } - } - - // Sprite 2 Roms - if (System16Sprite2RomSize) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum; i += 8) { - nRet = BurnLoadRom(System16Sprites2 + Offset + 7, i + 0, 8); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites2 + Offset + 6, i + 1, 8); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites2 + Offset + 5, i + 2, 8); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites2 + Offset + 4, i + 3, 8); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites2 + Offset + 3, i + 4, 8); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites2 + Offset + 2, i + 5, 8); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites2 + Offset + 1, i + 6, 8); if (nRet) return 1; - nRet = BurnLoadRom(System16Sprites2 + Offset + 0, i + 7, 8); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 2); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 3); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 4); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 5); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 6); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 7); - Offset += ri.nLen; - } - } - - // Road Roms - if (System16RoadRomSize) { - Offset = 0; - System16TempGfx = (UINT8*)BurnMalloc(System16RoadRomSize); - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum; i++) { - nRet = BurnLoadRom(System16TempGfx + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMX) OutrunDecodeRoad(); - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_HANGON) HangonDecodeRoad(); - BurnFree(System16TempGfx); - } - - // Z80 Program Roms - Offset = 0; - if (System16RF5C68DataNum) Offset = 0x10000; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum; i++) { - nRet = BurnLoadRom(System16Z80Rom + Offset, i, 1); - if (nRet) { - // Fill with 0xff - memset(System16Z80Rom, 0xff, System16Z80RomSize); - - nRet = 0; - } - - BurnDrvGetRomInfo(&ri, i + 0); - if (System16RF5C68DataNum) { - Offset += 0x80000; - } else { - Offset += ri.nLen; - } - } - if (System16RF5C68DataNum) { - memcpy(System16Z80Rom, System16Z80Rom + 0x10000, 0x10000); - System16RF5C68DataNum = 0; - } - - // Z80 #2 Program Roms - if (System16Z80Rom2Size) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum+ System16Z80RomNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num; i++) { - nRet = BurnLoadRom(System16Z80Rom2 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // Z80 #3 Program Roms - if (System16Z80Rom3Size) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num; i++) { - nRet = BurnLoadRom(System16Z80Rom3 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // Z80 #4 Program Roms - if (System16Z80Rom4Size) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num; i++) { - nRet = BurnLoadRom(System16Z80Rom4 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // 7751 Program Roms - if (System167751ProgSize) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum; i++) { - nRet = BurnLoadRom(System167751Prog + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // 7751 Data Roms - if (System167751DataSize) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum; i++) { - nRet = BurnLoadRom(System167751Data + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // UPD7759 Data Roms - if (System16UPD7759DataSize) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum; i++) { - nRet = BurnLoadRom(System16UPD7759Data + Offset, i, 1); - - if (nRet) { - memset(System16UPD7759Data, 0xff, System16UPD7759DataSize); - - nRet = 0; - } - - BurnDrvGetRomInfo(&ri, i + 0); - if (ri.nLen < 0x10000) { - Offset += 0x10000; - } else { - Offset += ri.nLen; - } - } - } - - // PCM Data Roms - if (System16PCMDataSize) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum + System16PCMDataNum; i++) { - nRet = BurnLoadRom(System16PCMData + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // PCM2 Data Roms - if (System16PCM2DataSize) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum + System16PCMDataNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum + System16PCMDataNum + System16PCM2DataNum; i++) { - nRet = BurnLoadRom(System16PCM2Data + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // PROMs - if (System16PromSize) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum + System16PCMDataNum + System16PCM2DataNum + System16RF5C68DataNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum + System16PCMDataNum + System16PCM2DataNum + System16RF5C68DataNum + System16PromNum; i++) { - nRet = BurnLoadRom(System16Prom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - - // Encryption Key - if (System16KeySize) { - Offset = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum + System16PCMDataNum + System16PCM2DataNum + System16RF5C68DataNum + System16PromNum; - nRet = BurnLoadRom(System16Key, Offset, 1); if (nRet) return 1; - } - - // I8751 Program Roms - if (System16I8751RomSize) { - Offset = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum + System16PCMDataNum + System16PCM2DataNum + System16RF5C68DataNum + System16PromNum + System16KeyNum; - nRet = BurnLoadRom(System16I8751Rom, Offset, 1); if (nRet) return 1; - } - - // MSM6295 Data Roms - if (System16MSM6295RomSize) { - Offset = 0; - for (i = System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum + System16PCMDataNum + System16PCM2DataNum + System16RF5C68DataNum + System16PromNum + System16KeyNum + System16I8751RomNum; i < System16RomNum + System16Rom2Num + System16Rom3Num + System16TileRomNum + System16SpriteRomNum + System16Sprite2RomNum + System16RoadRomNum + System16Z80RomNum + System16Z80Rom2Num + System16Z80Rom3Num + System16Z80Rom4Num + System167751ProgNum + System167751DataNum + System16UPD7759DataNum + System16PCMDataNum + System16PCM2DataNum + System16RF5C68DataNum + System16PromNum + System16KeyNum + System16I8751RomNum + System16MSM6295RomNum; i++) { - nRet = BurnLoadRom(MSM6295ROM + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - } - } - } - - return nRet; -} - -INT32 CustomLoadRom20000() -{ - INT32 nRet = 1; - UINT8 *pTemp = (UINT8*)BurnMalloc(0xc0000); - - if (pTemp) { - memcpy(pTemp, System16Rom, 0xc0000); - memset(System16Rom, 0, 0xc0000); - memcpy(System16Rom + 0x00000, pTemp + 0x00000, 0x20000); - memcpy(System16Rom + 0x80000, pTemp + 0x20000, 0x40000); - BurnFree(pTemp); - nRet = 0; - } - - return nRet; -} - -INT32 CustomLoadRom40000() -{ - INT32 nRet = 1; - UINT8 *pTemp = (UINT8*)BurnMalloc(0xc0000); - - if (pTemp) { - memcpy(pTemp, System16Rom, 0xc0000); - memset(System16Rom, 0, 0xc0000); - memcpy(System16Rom + 0x00000, pTemp + 0x00000, 0x40000); - memcpy(System16Rom + 0x80000, pTemp + 0x40000, 0x40000); - BurnFree(pTemp); - nRet = 0; - } - - return nRet; -} - -/*==================================================== -Sound Support Functions -====================================================*/ - -inline static INT32 System16SndGetBank(INT32 Reg86) -{ - return (Reg86>>4)&7; -} - -inline static INT32 PdriftSndGetBank(INT32 Reg86) -{ - return (Reg86>>3)&0x1f; -} - -inline void System16YM2151IRQHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static void System16YM2203IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static void System18YM3438IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static INT32 System16SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -inline static double System16GetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -inline static INT32 System18SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 8000000; -} - -inline static double System18GetTime() -{ - return (double)ZetTotalCycles() / 8000000; -} - -static void System16UPD7759DrqCallback(INT32 state) -{ - if (state) ZetNmi(); -} - -static INT32 System16ASyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (I8039TotalCycles() / ((6000000.0000 / 15) / (nBurnFPS / 100.0000)))); -} - -/*==================================================== -Multiply Protection Chip Emulation -====================================================*/ - -struct multiply_chip -{ - UINT16 regs[4]; -}; - -static struct multiply_chip multiply[3]; - -UINT16 System16MultiplyChipRead(INT32 which, INT32 offset) -{ - offset &= 3; - switch (offset) { - case 0: { - return multiply[which].regs[0]; - } - - case 1: { - return multiply[which].regs[1]; - } - - case 2: { - return ((INT16)multiply[which].regs[0] * (INT16)multiply[which].regs[1]) >> 16; - } - - case 3: { - return ((INT16)multiply[which].regs[0] * (INT16)multiply[which].regs[1]) & 0xffff; - } - } - - return 0xffff; -} - -void System16MultiplyChipWrite(INT32 which, INT32 offset, UINT16 data) -{ - offset &= 3; - switch (offset) { - case 0: { - multiply[which].regs[0] = data; - return; - } - - case 1: { - multiply[which].regs[1] = data; - return; - } - - case 2: { - multiply[which].regs[0] = data; - return; - } - - case 3: { - multiply[which].regs[1] = data; - return; - } - } -} - -/*==================================================== -Divide Protection Chip Emulation -====================================================*/ - -struct divide_chip -{ - UINT16 regs[8]; -}; - -static struct divide_chip divide[3]; - -static void update_divide(INT32 which, INT32 mode) -{ - /* clear the flags by default */ - divide[which].regs[6] = 0; - - /* if mode 0, store quotient/remainder */ - if (mode == 0) - { - INT32 dividend = (INT32)((divide[which].regs[0] << 16) | divide[which].regs[1]); - INT32 divisor = (INT16)divide[which].regs[2]; - INT32 quotient, remainder; - - /* perform signed divide */ - if (divisor == 0) - { - quotient = dividend;//((INT32)(dividend ^ divisor) < 0) ? 0x8000 : 0x7fff; - divide[which].regs[6] |= 0x4000; - } - else - quotient = dividend / divisor; - remainder = dividend - quotient * divisor; - - /* clamp to 16-bit signed */ - if (quotient < -32768) - { - quotient = -32768; - divide[which].regs[6] |= 0x8000; - } - else if (quotient > 32767) - { - quotient = 32767; - divide[which].regs[6] |= 0x8000; - } - - /* store quotient and remainder */ - divide[which].regs[4] = quotient; - divide[which].regs[5] = remainder; - } - - /* if mode 1, store 32-bit quotient */ - else - { - UINT32 dividend = (UINT32)((divide[which].regs[0] << 16) | divide[which].regs[1]); - UINT32 divisor = (UINT16)divide[which].regs[2]; - UINT32 quotient; - - /* perform unsigned divide */ - if (divisor == 0) - { - quotient = dividend;//0x7fffffff; - divide[which].regs[6] |= 0x4000; - } - else - quotient = dividend / divisor; - - /* store 32-bit quotient */ - divide[which].regs[4] = quotient >> 16; - divide[which].regs[5] = quotient & 0xffff; - } -} - -UINT16 System16DivideChipRead(INT32 which, INT32 offset) -{ - offset &= 7; - switch (offset) { - case 0: { - return divide[which].regs[0]; - } - - case 1: { - return divide[which].regs[1]; - } - - case 2: { - return divide[which].regs[2]; - } - - case 4: { - return divide[which].regs[4]; - } - - case 5: { - return divide[which].regs[5]; - } - - case 6: { - return divide[which].regs[6]; - } - } - - return 0xffff; -} - -void System16DivideChipWrite(INT32 which, INT32 offset, UINT16 data) -{ - INT32 a4 = offset & 8; - INT32 a3 = offset & 4; - - offset &= 3; - switch (offset) { - case 0: { - divide[which].regs[0] = data; - break; - } - - case 1: { - divide[which].regs[1] = data; - break; - } - - case 2: { - divide[which].regs[2] = data; - break; - } - - case 3: { - break; - } - } - - if (a4) update_divide(which, a3); -} - -/*==================================================== -Compare Timer Protection Chip Emulation -====================================================*/ - -struct compare_timer_chip -{ - UINT16 regs[16]; - UINT16 counter; - UINT8 bit; -}; - -static struct compare_timer_chip compare_timer[2]; - -inline static INT32 segaic16_compare_timer_clock(INT32 which) -{ - INT32 old_counter = compare_timer[which].counter; - INT32 result = 0; - - /* if we're enabled, clock the upcounter */ - if (compare_timer[which].regs[10] & 1) - compare_timer[which].counter++; - - /* regardless of the enable, a value of 0xfff will generate the IRQ */ - if (old_counter == 0xfff) - { - result = 1; - compare_timer[which].counter = compare_timer[which].regs[8] & 0xfff; - } - return result; -} - -inline static void update_compare(INT32 which, INT32 update_history) -{ - INT32 bound1 = (INT16)compare_timer[which].regs[0]; - INT32 bound2 = (INT16)compare_timer[which].regs[1]; - INT32 value = (INT16)compare_timer[which].regs[2]; - INT32 min = (bound1 < bound2) ? bound1 : bound2; - INT32 max = (bound1 > bound2) ? bound1 : bound2; - - if (value < min) - { - compare_timer[which].regs[7] = min; - compare_timer[which].regs[3] = 0x8000; - } - else if (value > max) - { - compare_timer[which].regs[7] = max; - compare_timer[which].regs[3] = 0x4000; - } - else - { - compare_timer[which].regs[7] = value; - compare_timer[which].regs[3] = 0x0000; - } - - if (update_history) - compare_timer[which].regs[4] |= (compare_timer[which].regs[3] == 0) << compare_timer[which].bit++; -} - -UINT16 System16CompareTimerChipRead(INT32 which, INT32 offset) -{ - offset &= 0xf; - switch (offset) { - case 0x0: return compare_timer[which].regs[0]; - case 0x1: return compare_timer[which].regs[1]; - case 0x2: return compare_timer[which].regs[2]; - case 0x3: return compare_timer[which].regs[3]; - case 0x4: return compare_timer[which].regs[4]; - case 0x5: return compare_timer[which].regs[1]; - case 0x6: return compare_timer[which].regs[2]; - case 0x7: return compare_timer[which].regs[7]; - } - - return 0xffff; -} - -void System16CompareTimerChipWrite(INT32 which, INT32 offset, UINT16 data) -{ - offset &= 0xf; - switch (offset) { - case 0x0: compare_timer[which].regs[0] = data; update_compare(which, 0); break; - case 0x1: compare_timer[which].regs[1] = data; update_compare(which, 0); break; - case 0x2: compare_timer[which].regs[2] = data; update_compare(which, 1); break; - case 0x4: compare_timer[which].regs[4] = 0; compare_timer[which].bit = 0; break; - case 0x6: compare_timer[which].regs[2] = data; update_compare(which, 0); break; - case 0x8: - case 0xc: compare_timer[which].regs[8] = data; break; - case 0xa: - case 0xe: compare_timer[which].regs[10] = data; break; - case 0xb: - case 0xf: - compare_timer[which].regs[11] = data; - break; - } -} - -/*==================================================== -Main Driver Init function -====================================================*/ - -INT32 System16Init() -{ - INT32 nRet = 0, nLen; - - // Allocate and Blank all required memory - Mem = NULL; - System16LoadRoms(0); // Get required rom sizes - System16MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - System16MemIndex(); - - // Load Roms - if (!((BurnDrvGetHardwareCode() & HARDWARE_SEGA_PCB_MASK) == HARDWARE_SEGA_5704_PS2)) { - nRet = System16LoadRoms(1); if (nRet) return 1; - } - if (System16CustomLoadRomDo) { nRet = System16CustomLoadRomDo(); if (nRet) return 1; } - - // Copy the first 68000 rom to code (FETCH) - memcpy(System16Code, System16Rom, System16RomSize); - - // Handle any op-code decryption - if (System16CustomDecryptOpCodeDo) { nRet = System16CustomDecryptOpCodeDo(); if (nRet) return 1; } - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1089A_ENC || BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1089B_ENC) { - FD1089Decrypt(); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC_CPU2)) { -#ifdef BUILD_A68K - // Make sure we use Musashi - if (bBurnUseASMCPUEmulation) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching to Musashi 68000 core\n")); -#endif - bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation; - bBurnUseASMCPUEmulation = false; - } -#endif - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) fd1094_driver_init(0); - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC_CPU2) fd1094_driver_init(1); - } - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MC8123_ENC) { - mc8123_decrypt_rom(0, 0, System16Z80Rom, System16Z80Code, System16Key); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16A) { - if (System16Map68KDo) { - System16Map68KDo(); - } else { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x0fffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x0fffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x840000, 0x840fff, MAP_RAM); - SekMapMemory(System16Ram , 0xffc000, 0xffffff, MAP_RAM); - - SekSetReadWordHandler(0, System16AReadWord); - SekSetWriteWordHandler(0, System16AWriteWord); - SekSetReadByteHandler(0, System16AReadByte); - SekSetWriteByteHandler(0, System16AWriteByte); - SekClose(); - } - - if (System16MapZ80Do) { - ZetInit(0); - ZetOpen(0); - System16MapZ80Do(); - ZetClose(); - } else { - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xdfff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0xdfff, 2, System16Z80Rom); - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram); - -#if 0 && defined FBA_DEBUG - ZetSetReadHandler(System16Z80Read); - ZetSetWriteHandler(System16Z80Write); -#endif - ZetSetInHandler(System16PPIZ80PortRead); - ZetSetOutHandler(System16Z80PortWrite); - ZetClose(); - } - - if (PPI0PortWriteA == NULL) PPI0PortWriteA = System16APPI0WritePortA; - if (PPI0PortWriteB == NULL) PPI0PortWriteB = System16APPI0WritePortB; - if (PPI0PortWriteC == NULL) PPI0PortWriteC = System16APPI0WritePortC; - ppi8255_init(1); - - BurnYM2151Init(4000000); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - if (System167751ProgSize) { - N7751Init(NULL); - - N7751SetIOReadHandler(N7751ReadIo); - N7751SetIOWriteHandler(N7751WriteIo); - N7751SetProgramReadHandler(N7751Read); - N7751SetCPUOpReadHandler(N7751Read); - N7751SetCPUOpReadArgHandler(N7751Read); - - YM2151SetPortWriteHandler(0, &System16N7751ControlWrite); - BurnYM2151SetAllRoutes(0.43, BURN_SND_ROUTE_BOTH); - DACInit(0, 0, 1, System16ASyncDAC); - DACSetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - } - - if (System16I8751RomNum) { - mcs51_program_data = System16I8751Rom; - mcs51_init(); - mcs51_set_write_handler(System16A_I8751WritePort); - mcs51_set_read_handler(System16A_I8751ReadPort); - } - - System16TileBankSize = 0x1000; - System16CreateOpaqueTileMaps = 1; - System16ATileMapsInit(1); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) { - if (System16Map68KDo) { - System16Map68KDo(); - } else { - SekInit(0, 0x68000); - SekOpen(0); - SekSetReadByteHandler(0, sega_315_5195_read_byte); - SekSetReadWordHandler(0, sega_315_5195_read_word); - SekSetWriteByteHandler(0, sega_315_5195_write_byte); - SekSetWriteWordHandler(0, sega_315_5195_write_word); - SekClose(); - - sega_315_5195_init(); - } - - if (System16Z80RomNum || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM)) { - if (System16MapZ80Do) { - ZetInit(0); - ZetOpen(0); - System16MapZ80Do(); - ZetClose(); - } else { - ZetInit(0); - ZetOpen(0); - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_MC8123_ENC) { - ZetMapArea(0x0000, 0xdfff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0xdfff, 2, System16Z80Code, System16Z80Rom); - } else { - ZetMapArea(0x0000, 0xdfff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0xdfff, 2, System16Z80Rom); - } - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram); - -#if 0 && defined FBA_DEBUG - ZetSetReadHandler(System16Z80Read); - ZetSetWriteHandler(System16Z80Write); -#endif - ZetSetInHandler(System16Z80PortRead); - ZetSetOutHandler(System16Z80PortWrite); - ZetClose(); - } - } - - if (System16I8751RomNum) { - mcs51_program_data = System16I8751Rom; - mcs51_init(); - mcs51_set_write_handler(sega_315_5195_i8751_write_port); - mcs51_set_read_handler(sega_315_5195_i8751_read_port); - } - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - BurnYM2413Init(5000000); - BurnYM2413SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - } else { - BurnYM2151Init(4000000); - BurnYM2151SetAllRoutes(0.43, BURN_SND_ROUTE_BOTH); - } - - if (System16UPD7759DataSize) { - UPD7759Init(0,UPD7759_STANDARD_CLOCK, NULL); - UPD7759SetDrqCallback(0,System16UPD7759DrqCallback); - UPD7759SetRoute(0, 0.48, BURN_SND_ROUTE_BOTH); - } - - if (System16MSM6295RomSize) { - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - } - - System16TileBankSize = 0x1000; - System16CreateOpaqueTileMaps = 1; - System16BTileMapsInit(1); - System16ClockSpeed = 10000000; - System16Z80ClockSpeed = 5000000; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - if (System16Map68KDo) { - System16Map68KDo(); - } else { - SekInit(0, 0x68000); - SekOpen(0); - SekSetReadByteHandler(0, sega_315_5195_read_byte); - SekSetReadWordHandler(0, sega_315_5195_read_word); - SekSetWriteByteHandler(0, sega_315_5195_write_byte); - SekSetWriteWordHandler(0, sega_315_5195_write_word); - SekClose(); - - sega_315_5195_init(); - } - - if (System16MapZ80Do) { - ZetInit(0); - ZetOpen(0); - System16MapZ80Do(); - ZetClose(); - } else { - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x9fff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0x9fff, 2, System16Z80Rom); - - ZetMapArea(0xa000, 0xbfff, 0, System16Z80Rom + 0xa000); - ZetMapArea(0xa000, 0xbfff, 2, System16Z80Rom + 0xa000); - - ZetMapArea(0xe000, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xe000, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xe000, 0xffff, 2, System16Z80Ram); - - ZetSetReadHandler(System18Z80Read); - ZetSetWriteHandler(System18Z80Write); - ZetSetInHandler(System18Z80PortRead); - ZetSetOutHandler(System18Z80PortWrite); - ZetClose(); - } - - if (System16I8751RomNum) { - mcs51_program_data = System16I8751Rom; - mcs51_init(); - mcs51_set_write_handler(sega_315_5195_i8751_write_port); - mcs51_set_read_handler(sega_315_5195_i8751_read_port); - } - - BurnYM3438Init(2, 8000000, &System18YM3438IRQHandler, System18SynchroniseStream, System18GetTime, 1); - BurnTimerAttachZet(8000000); - BurnYM3438SetAllRoutes(0, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM3438SetAllRoutes(1, 0.40, BURN_SND_ROUTE_BOTH); - - RF5C68PCMInit(10000000); - RF5C68PCMSetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - System16TileBankSize = 0x400; - System16CreateOpaqueTileMaps = 1; - System16BTileMapsInit(1); - - StartGenesisVDP(0, System16Palette); - GenesisPaletteBase = 0x1800; - GenesisBgPalLookup[0] = GenesisSpPalLookup[0] = 0x1800; - GenesisBgPalLookup[1] = GenesisSpPalLookup[1] = 0x1810; - GenesisBgPalLookup[2] = GenesisSpPalLookup[2] = 0x1820; - GenesisBgPalLookup[3] = GenesisSpPalLookup[3] = 0x1830; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_HANGON) { - if (System16Map68KDo) { - System16Map68KDo(); - } else { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x03ffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x03ffff, MAP_FETCH); - SekMapMemory(System16Ram , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(System16TileRam , 0x400000, 0x403fff, MAP_READ); - SekMapMemory(System16TextRam , 0x410000, 0x410fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x600000, 0x607fff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0xa00000, 0xa00fff, MAP_RAM); - SekMapMemory(System16Rom2 , 0xc00000, 0xc3ffff, MAP_READ); - SekMapMemory(System16RoadRam , 0xc68000, 0xc68fff, MAP_RAM); - SekMapMemory(System16ExtraRam , 0xc7c000, 0xc7ffff, MAP_RAM); - - SekSetReadWordHandler(0, HangonReadWord); - SekSetReadByteHandler(0, HangonReadByte); - SekSetWriteByteHandler(0, HangonWriteByte); - SekSetWriteWordHandler(0, HangonWriteWord); - SekClose(); - } - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(System16Rom2 , 0x000000, 0x03ffff, MAP_READ); - SekMapMemory(System16Rom2 , 0x000000, 0x03ffff, MAP_FETCH); - SekMapMemory(System16RoadRam , 0xc68000, 0xc68fff, MAP_RAM); - SekMapMemory(System16ExtraRam , 0xc7c000, 0xc7ffff, MAP_RAM); - SekClose(); - - if (System16MapZ80Do) { - ZetInit(0); - ZetOpen(0); - System16MapZ80Do(); - ZetClose(); - } else { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2203) { - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0x7fff, 2, System16Z80Rom); - - ZetMapArea(0xc000, 0xc7ff, 0, System16Z80Ram); - ZetMapArea(0xc000, 0xc7ff, 1, System16Z80Ram); - ZetMapArea(0xc000, 0xc7ff, 2, System16Z80Ram); - - ZetSetReadHandler(System16Z802203Read); - ZetSetWriteHandler(System16Z802203Write); - ZetSetInHandler(System16Z802203PortRead); - ZetClose(); - } else { - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xdfff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0xdfff, 2, System16Z80Rom); - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram); - - ZetSetReadHandler(System16Z80PCMRead); - ZetSetWriteHandler(System16Z80PCMWrite); - ZetSetInHandler(System16PPIZ80PortRead); - ZetSetOutHandler(System16Z80PortWrite); - ZetClose(); - } - } - - if (PPI0PortWriteA == NULL) PPI0PortWriteA = HangonPPI0WritePortA; - if (PPI0PortWriteB == NULL) PPI0PortWriteB = HangonPPI0WritePortB; - if (PPI0PortWriteC == NULL) PPI0PortWriteC = HangonPPI0WritePortC; - if (PPI1PortReadC == NULL) PPI1PortReadC = HangonPPI1ReadPortC; - if (PPI1PortWriteA == NULL) PPI1PortWriteA = HangonPPI1WritePortA; - ppi8255_init(2); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2203) { - BurnYM2203Init(1, 4000000, &System16YM2203IRQHandler, System16SynchroniseStream, System16GetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.37, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.13, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.13, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.13, BURN_SND_ROUTE_BOTH); - } else { - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&System16YM2151IRQHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.43, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.43, BURN_SND_ROUTE_RIGHT); - } - - if (System16PCMDataSize) { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2203) { - SegaPCMInit(0, 8000000, BANK_512, System16PCMData, System16PCMDataSize); - } else { - SegaPCMInit(0, 4000000, BANK_512, System16PCMData, System16PCMDataSize); - } - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_1, 1.0, BURN_SND_ROUTE_LEFT); - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_2, 1.0, BURN_SND_ROUTE_RIGHT); - } - - System16TileBankSize = 0x1000; - System16ATileMapsInit(0); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN) { - SekInit(0, 0x68000); - SekOpen(0); - SekSetResetCallback(OutrunResetCallback); - SekSetReadByteHandler(0, sega_315_5195_read_byte); - SekSetReadWordHandler(0, sega_315_5195_read_word); - SekSetWriteByteHandler(0, sega_315_5195_write_byte); - SekSetWriteWordHandler(0, sega_315_5195_write_word); - SekClose(); - - sega_315_5195_init(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(System16Rom2 , 0x000000, 0x03ffff, MAP_READ); - SekMapMemory(System16Rom2 , 0x000000, 0x03ffff, MAP_FETCH); - SekMapMemory(System16Ram , 0x060000, 0x067fff, MAP_RAM); - SekMapMemory(System16RoadRam , 0x080000, 0x080fff, MAP_RAM); - SekSetWriteWordHandler(0, Outrun2WriteWord); - SekSetReadByteHandler(0, Outrun2ReadByte); - SekSetWriteByteHandler(0, Outrun2WriteByte); - SekClose(); - - if (System16MapZ80Do) { - ZetInit(0); - ZetOpen(0); - System16MapZ80Do(); - ZetClose(); - } else { - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xdfff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0xdfff, 2, System16Z80Rom); - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram); - - ZetSetReadHandler(System16Z80PCMRead); - ZetSetWriteHandler(System16Z80PCMWrite); - ZetSetInHandler(System16PPIZ80PortRead); - ZetSetOutHandler(System16Z80PortWrite); - ZetClose(); - } - - if (PPI0PortWriteC == NULL) PPI0PortWriteC = OutrunPPI0WritePortC; - ppi8255_init(1); - - BurnYM2151Init(4000000); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.43, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.43, BURN_SND_ROUTE_RIGHT); - - if (System16PCMDataSize) { - SegaPCMInit(0, 4000000, BANK_512, System16PCMData, System16PCMDataSize); - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_1, 1.0, BURN_SND_ROUTE_LEFT); - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_2, 1.0, BURN_SND_ROUTE_RIGHT); - } - - System16RoadColorOffset1 = 0x400; - System16RoadColorOffset2 = 0x420; - System16RoadColorOffset3 = 0x780; - - System16TileBankSize = 0x1000; - System16BTileMapsInit(0); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMX) { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x07ffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x07ffff, MAP_FETCH); - SekMapMemory(System16TileRam , 0x0c0000, 0x0cffff, MAP_READ); - SekMapMemory(System16TextRam , 0x0d0000, 0x0d0fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x100000, 0x100fff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x101000, 0x101fff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x102000, 0x102fff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x103000, 0x103fff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x104000, 0x104fff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x105000, 0x105fff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x106000, 0x106fff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x107000, 0x107fff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x108000, 0x108fff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x109000, 0x109fff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x10a000, 0x10afff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x10b000, 0x10bfff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x10c000, 0x10cfff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x10d000, 0x10dfff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x10e000, 0x10efff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16SpriteRam , 0x10f000, 0x10ffff, MAP_RAM); // Tests past Sprite RAM in mem tests (mirror?) - SekMapMemory(System16PaletteRam , 0x120000, 0x123fff, MAP_RAM); - SekMapMemory(System16Rom2 , 0x200000, 0x27ffff, MAP_READ); - SekMapMemory(System16Ram , 0x29c000, 0x2a3fff, MAP_RAM); - SekMapMemory(System16RoadRam , 0x2ec000, 0x2ecfff, MAP_RAM); - SekMapMemory(System16RoadRam , 0x2ed000, 0x2edfff, MAP_RAM); // Tests past Road RAM in mem tests (mirror?) - SekMapMemory(System16BackupRam2 , 0xff4000, 0xff7fff, MAP_RAM); - SekMapMemory(System16BackupRam , 0xff8000, 0xffffff, MAP_RAM); - SekMapMemory(System16BackupRam2 , 0xffc000, 0xffffff, MAP_RAM); - SekSetResetCallback(OutrunResetCallback); - SekSetReadWordHandler(0, XBoardReadWord); - SekSetWriteWordHandler(0, XBoardWriteWord); - SekSetReadByteHandler(0, XBoardReadByte); - SekSetWriteByteHandler(0, XBoardWriteByte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(System16Rom2 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(System16Ram , 0x09c000, 0x0a3fff, MAP_RAM); - SekMapMemory(System16RoadRam , 0x0ec000, 0x0ecfff, MAP_RAM); - SekMapMemory(System16Rom2 , 0x200000, 0x27ffff, MAP_ROM); - SekMapMemory(System16Ram , 0x29c000, 0x2a3fff, MAP_RAM); - SekMapMemory(System16RoadRam , 0x2ec000, 0x2ecfff, MAP_RAM); - SekSetReadWordHandler(0, XBoard2ReadWord); - SekSetWriteWordHandler(0, XBoard2WriteWord); - SekSetReadByteHandler(0, XBoard2ReadByte); - SekSetWriteByteHandler(0, XBoard2WriteByte); - SekClose(); - - if (System16MapZ80Do) { - ZetInit(0); - ZetOpen(0); - System16MapZ80Do(); - ZetClose(); - } else { - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xdfff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0xdfff, 2, System16Z80Rom); - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram); - - ZetSetReadHandler(System16Z80PCMRead); - ZetSetWriteHandler(System16Z80PCMWrite); - ZetSetInHandler(SystemXZ80PortRead); - ZetSetOutHandler(System16Z80PortWrite); - ZetClose(); - } - - if (System16Z80Rom2Num) { - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0xefff, 0, System16Z80Rom2); - ZetMapArea(0x0000, 0xefff, 2, System16Z80Rom2); - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram2); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram2); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram2); - - ZetSetReadHandler(System16Z80Read2); - ZetSetWriteHandler(System16Z80Write2); - ZetSetInHandler(System16Z80PortRead2); - ZetClose(); - } - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&System16YM2151IRQHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.43, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.43, BURN_SND_ROUTE_RIGHT); - - if (System16PCMDataSize) { - SegaPCMInit(0, 4000000, BANK_512, System16PCMData, System16PCMDataSize); - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - } - - if (System16PCM2DataSize) { - SegaPCMInit(1, 4000000, BANK_512, System16PCM2Data, System16PCM2DataSize); - SegaPCMSetRoute(1, BURN_SND_SEGAPCM_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - SegaPCMSetRoute(1, BURN_SND_SEGAPCM_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - } - - System16RoadColorOffset1 = 0x1700; - System16RoadColorOffset2 = 0x1720; - System16RoadColorOffset3 = 0x1780; - System16RoadXOffset = -166; - System16RoadPriority = 1; - System16TilemapColorOffset = 0x1c00; - - System16TileBankSize = 0x1000; - System16BTileMapsInit(0); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMY) { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(System16Rom , 0x000000, 0x07ffff, MAP_READ); - SekMapMemory(System16Code , 0x000000, 0x07ffff, MAP_FETCH); - SekMapMemory(System16Ram , 0x0c0000, 0x0cffff, MAP_RAM); - SekMapMemory(System16ExtraRam , 0xff0000, 0xffffff, MAP_RAM); - SekSetReadWordHandler(0, YBoardReadWord); - SekSetWriteWordHandler(0, YBoardWriteWord); - SekSetReadByteHandler(0, YBoardReadByte); - SekSetWriteByteHandler(0, YBoardWriteByte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(System16Rom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(System16Ram , 0x0c0000, 0x0cffff, MAP_RAM); - SekMapMemory(System16SpriteRam2 , 0x180000, 0x18ffff, MAP_RAM); - SekMapMemory(System16ExtraRam2 , 0xff0000, 0xffbfff, MAP_RAM); - SekMapMemory(System16BackupRam , 0xffc000, 0xffffff, MAP_RAM); - SekSetReadWordHandler(0, YBoard2ReadWord); - SekSetWriteWordHandler(0, YBoard2WriteWord); - SekClose(); - - SekInit(2, 0x68000); - SekOpen(2); - SekMapMemory(System16Rom3 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(System16Ram , 0x0c0000, 0x0cffff, MAP_RAM); - SekMapMemory(System16RotateRam , 0x180000, 0x1807ff, MAP_RAM); - SekMapMemory(System16SpriteRam , 0x188000, 0x188fff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x190000, 0x193fff, MAP_RAM); - SekMapMemory(System16PaletteRam , 0x194000, 0x197fff, MAP_RAM); - SekMapMemory(System16ExtraRam3 , 0xff0000, 0xffffff, MAP_RAM); - SekSetReadWordHandler(0, YBoard3ReadWord); - SekSetWriteWordHandler(0, YBoard3WriteWord); - SekSetReadByteHandler(0, YBoard3ReadByte); - SekClose(); - - if (System16MapZ80Do) { - ZetInit(0); - ZetOpen(0); - System16MapZ80Do(); - ZetClose(); - } else { - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xdfff, 0, System16Z80Rom); - ZetMapArea(0x0000, 0xdfff, 2, System16Z80Rom); - - ZetMapArea(0xf800, 0xffff, 0, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 1, System16Z80Ram); - ZetMapArea(0xf800, 0xffff, 2, System16Z80Ram); - - ZetSetReadHandler(System16Z80PCMRead); - ZetSetWriteHandler(System16Z80PCMWrite); - ZetSetInHandler(SystemXZ80PortRead); - ZetSetOutHandler(System16Z80PortWrite); - ZetClose(); - } - - BurnYM2151Init(32215900 / 8); - BurnYM2151SetIrqHandler(&System16YM2151IRQHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.43, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.43, BURN_SND_ROUTE_RIGHT); - - if (System16PCMDataSize) { - SegaPCMInit(0, 32215900 / 8, BANK_12M | BANK_MASKF8, System16PCMData, System16PCMDataSize); - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_1, 1.0, BURN_SND_ROUTE_LEFT); - SegaPCMSetRoute(0, BURN_SND_SEGAPCM_ROUTE_2, 1.0, BURN_SND_ROUTE_RIGHT); - } - } - - GenericTilesInit(); - bSystem16BootlegRender = false; - System16SpritePalOffset = 0x400; - - System16PaletteInit(); - - if (System16HasGears) - BurnShiftInitDefault(); - - // Reset the driver - System16DoReset(); - - return 0; -} - -/*==================================================== -Exit Function -====================================================*/ - -INT32 System16Exit() -{ - INT32 i; - - SekExit(); - if (System16Z80RomNum || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM)) ZetExit(); - if (System167751ProgSize) { - N7751Exit(); - DACExit(); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - BurnYM3438Exit(); - RF5C68PCMExit(); - } else { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2203) { - BurnYM2203Exit(); - } else { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - BurnYM2413Exit(); - } else { - BurnYM2151Exit(); - } - } - } - - if (System16PCMDataSize) SegaPCMExit(); - if (System16UPD7759DataSize) UPD7759Exit(); - if (System16MSM6295RomSize) MSM6295Exit(0); - - if (((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16A) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_HANGON) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN)) { - ppi8255_exit(); - } - - if (nBurnGunNumPlayers) BurnGunExit(); - - if (((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN)) { - sega_315_5195_exit(); - } - - if (System16I8751RomNum) { - mcs51_exit(); - } - - GenericTilesExit(); - System16PaletteExit(); - System16TileMapsExit(); - - BurnFree(Mem); - - // Reset Variables - for (i = 0; i < 4; i++) { - System16Page[i] = 0; - System16OldPage[i] = 0; - System16ScrollX[i] = 0; - System16ScrollY[i] = 0; - BootlegBgPage[i] = 0; - BootlegFgPage[i] = 0; - } - - for (i = 0; i < 16; i++) { - System16SpriteBanks[i] = 0; - } - - for (i = 0; i < 8; i++) { - System16TileBanks[i] = 0; - System16OldTileBanks[i] = 0; - } - - System16VideoEnable = 0; - System18VdpEnable = 0; - System18VdpMixing = 0; - System16ScreenFlip = 0; - System16SpriteShadow = 0; - System16SpriteXOffset = 0; - System16VideoControl = 0; - System16SoundLatch = 0; - System16ColScroll = 0; - System16RowScroll = 0; - System16IgnoreVideoEnable = 0; - System16MCUData = 0; - - if (System16HasGears) BurnShiftExit(); - System16HasGears = false; - - System16RoadControl = 0; - System16RoadColorOffset1 = 0; - System16RoadColorOffset2 = 0; - System16RoadColorOffset3 = 0; - System16RoadXOffset = 0; - System16RoadPriority = 0; - System16AnalogSelect = 0; - - System16ClockSpeed = 0; - System16Z80ClockSpeed = 0; - - System16PaletteEntries = 0; - System16SpritePalOffset = 0x400; - System16RamSize = 0; - System16ExtraRamSize = 0; - System16ExtraRam2Size = 0; - System16ExtraRam3Size = 0; - System16SpriteRamSize = 0; - System16SpriteRam2Size = 0; - System16RotateRamSize = 0; - System16TilemapColorOffset = 0; - System16TileBankSize = 0; - System16RecalcBgTileMap = 0; - System16RecalcBgAltTileMap = 0; - System16RecalcFgTileMap = 0; - System16RecalcFgAltTileMap = 0; - System16CreateOpaqueTileMaps = 0; - - System16BTileAlt = false; - Shangon = false; - Hangon = false; - AlienSyndrome = false; - LaserGhost = false; - HammerAway = false; - Lockonph = false; - System1668KEnable = true; - System16Z80Enable = true; - - bSystem16BootlegRender = false; - - System16YM2413IRQInterval = 0; - - UPD7759BankAddress = 0; - N7751Command = 0; - N7751RomAddress = 0; - - System16RomSize = 0; - System16RomNum = 0; - System16Rom2Size = 0; - System16Rom2Num = 0; - System16Rom3Size = 0; - System16Rom3Num = 0; - System16TileRomSize = 0; - System16TileRomNum = 0; - System16NumTiles = 0; - System16SpriteRomSize = 0; - System16SpriteRomNum = 0; - System16Sprite2RomSize = 0; - System16Sprite2RomNum = 0; - System16RoadRomSize = 0; - System16RoadRomNum = 0; - System16Z80RomSize = 0; - System16Z80RomNum = 0; - System16Z80Rom2Size = 0; - System16Z80Rom2Num = 0; - System16Z80Rom3Size = 0; - System16Z80Rom3Num = 0; - System16Z80Rom4Size = 0; - System16Z80Rom4Num = 0; - System167751ProgSize = 0; - System167751ProgNum = 0; - System167751DataSize = 0; - System167751DataNum = 0; - System16UPD7759DataSize = 0; - System16UPD7759DataNum = 0; - System16PCMDataSizePreAllocate = 0; - System16PCMDataSize = 0; - System16PCMDataNum = 0; - System16PCM2DataSize = 0; - System16PCM2DataNum = 0; - System16RF5C68DataSize = 0; - System16RF5C68DataNum = 0; - System16PromSize = 0; - System16PromNum = 0; - System16KeyNum = 0; - System16KeySize = 0; - System16I8751RomSize = 0; - System16I8751RomNum = 0; - System16MSM6295RomSize = 0; - System16MSM6295RomNum = 0; - - Simulate8751 = NULL; - System16Map68KDo = NULL; - System16MapZ80Do = NULL; - System16CustomLoadRomDo = NULL; - System16CustomDecryptOpCodeDo = NULL; - System16ProcessAnalogControlsDo = NULL; - System16MakeAnalogInputsDo = NULL; - System16I8751InitialConfig = NULL; - - memset(multiply, 0, sizeof(multiply)); - memset(divide, 0, sizeof(divide)); - memset(compare_timer, 0, sizeof(compare_timer)); - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC_CPU2)) { - fd1094_exit(); - -#ifdef BUILD_A68K - // Switch back CPU core if needed - if (bUseAsm68KCoreOldValue) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching back to A68K core\n")); -#endif - bUseAsm68KCoreOldValue = false; - bBurnUseASMCPUEmulation = true; - } -#endif - } - - return 0; -} - -/*==================================================== -Frame Functions -====================================================*/ - -INT32 System16AFrame() -{ - INT32 nInterleave = 100; // alien syndrome needs high interleave for the DAC sounds to be processed - - if (System16Reset) System16DoReset(); - - System16MakeInputs(); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = 4000000 / 60; - nCyclesTotal[2] = (6000000 / 15) / 60; - nCyclesTotal[3] = (8000000 / 12) / 60; - nSystem16CyclesDone[0] = nSystem16CyclesDone[1] = nSystem16CyclesDone[2] = nSystem16CyclesDone[3] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - I8039NewFrame(); - - SekOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - if (System1668KEnable) { - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (System167751ProgSize) { - nCurrentCPU = 2; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = N7751Run(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - } - - if (System16I8751RomNum) { - nCurrentCPU = 3; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += mcs51Run(nCyclesSegment); - - if (i == (nInterleave - 1)) { - mcs51_set_irq_line(MCS51_INT0_LINE, CPU_IRQSTATUS_ACK); - mcs51_set_irq_line(MCS51_INT0_LINE, CPU_IRQSTATUS_NONE); - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - ZetClose(); - } - } - - if (System1668KEnable && !System16I8751RomNum) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (Simulate8751) Simulate8751(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - } - - if (System167751ProgSize) DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) System16ARender(); - - return 0; -} - -INT32 System16BFrame() -{ - INT32 nInterleave = (nBurnSoundRate <= 44100) ? 183 : 200; // For the UPD7759 - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) || Lockonph) nInterleave = System16YM2413IRQInterval; - - if (System16Reset) System16DoReset(); - - System16MakeInputs(); - if (AlienSyndrome) { - System16ClearOpposites(&System16Input[1]); // P1 - System16ClearOpposites(&System16Input[2]); // P2 - } - - nCyclesTotal[0] = (INT32)((INT64)System16ClockSpeed * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = System16Z80ClockSpeed / 60; - nCyclesTotal[2] = (8000000 / 12) / 60; - nSystem16CyclesDone[0] = nSystem16CyclesDone[1] = nSystem16CyclesDone[2] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - if (System16Z80RomNum || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM) && System16Z80Enable)) ZetNewFrame(); - - SekOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - if (System1668KEnable) { - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) || Lockonph) { - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - } - - // Run Z80 - if (System16Z80RomNum || ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM) && System16Z80Enable)) { - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - } - - if (System16I8751RomNum) { - nCurrentCPU = 2; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += mcs51Run(nCyclesSegment); - - if (i == (nInterleave - 1)) { - mcs51_set_irq_line(MCS51_INT0_LINE, CPU_IRQSTATUS_ACK); - nSystem16CyclesDone[nCurrentCPU] += mcs51Run(2000); - mcs51_set_irq_line(MCS51_INT0_LINE, CPU_IRQSTATUS_NONE); - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - BurnYM2413Render(pSoundBuf, nSegmentLength); - } else { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - if (System16UPD7759DataSize) UPD7759Update(0,pSoundBuf, nSegmentLength); - if (System16MSM6295RomSize) MSM6295Render(0, pSoundBuf, nSegmentLength); - ZetClose(); - } - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - BurnYM2413Render(pSoundBuf, nSegmentLength); - } else { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - if (System16UPD7759DataSize) UPD7759Update(0,pSoundBuf, nSegmentLength); - if (System16MSM6295RomSize) MSM6295Render(0, pSoundBuf, nSegmentLength); - ZetClose(); - } - } - } - - if (!System16I8751RomNum && System1668KEnable) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (Simulate8751) Simulate8751(); - - if (pBurnDraw) { - if (System16BTileAlt) { - System16BAltRender(); - } else { - if (bSystem16BootlegRender) { - System16BootlegRender(); - } else { - System16BRender(); - } - } - } - - return 0; -} - -INT32 System18Frame() -{ - INT32 nInterleave = nBurnSoundLen; - - if (HammerAway) nInterleave = 100; - - if (System16Reset) System16DoReset(); - - System16MakeInputs(); - - if (nBurnGunNumPlayers) System16GunMakeInputs(); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = 8000000 / 60; - nCyclesTotal[2] = (8000000 / 12) / 60; - nSystem16CyclesDone[0] = nSystem16CyclesDone[1] = nSystem16CyclesDone[2] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - if (System1668KEnable) { - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - nCurrentCPU = 1; - ZetOpen(0); - BurnTimerUpdate(i * (nCyclesTotal[nCurrentCPU] / nInterleave)); - ZetClose(); - - if (System16I8751RomNum) { - nCurrentCPU = 2; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += mcs51Run(nCyclesSegment); - - if (i == (nInterleave - 1)) { - mcs51_set_irq_line(MCS51_INT0_LINE, CPU_IRQSTATUS_ACK); - nSystem16CyclesDone[nCurrentCPU] += mcs51Run(2000); - mcs51_set_irq_line(MCS51_INT0_LINE, CPU_IRQSTATUS_NONE); - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - RF5C68PCMUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (!System16I8751RomNum && System1668KEnable) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - ZetOpen(0); - BurnTimerEndFrame(nCyclesTotal[1]); - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - RF5C68PCMUpdate(pSoundBuf, nSegmentLength); - } - } - - ZetOpen(0); - if (pBurnSoundOut) BurnYM3438Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - if (pBurnDraw) { - System18Render(); - } - - return 0; -} - -INT32 HangonFrame() -{ - INT32 nInterleave = 10, i; - - if (System16Reset) System16DoReset(); - - System16MakeInputs(); - - nCyclesTotal[0] = (INT32)((INT64)System16ClockSpeed * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)System16ClockSpeed * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[2] = 4000000 / 60; - nSystem16CyclesDone[0] = nSystem16CyclesDone[1] = nSystem16CyclesDone[2] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - SekClose(); - - // Run 68000 #2 - nCurrentCPU = 1; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = SekRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - SekClose(); - - // Run Z80 - nCurrentCPU = 2; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - SegaPCMUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - SegaPCMUpdate(pSoundBuf, nSegmentLength); - } - } - - SekOpen(0); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (Simulate8751) Simulate8751(); - - if (pBurnDraw) { - HangonRender(); - } - - return 0; -} - -INT32 HangonYM2203Frame() -{ - INT32 nInterleave = 100, i; - - if (System16Reset) System16DoReset(); - - System16MakeInputs(); - - nCyclesTotal[0] = (INT32)((INT64)System16ClockSpeed * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)System16ClockSpeed * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[2] = 4000000 / 60; - nSystem16CyclesDone[0] = nSystem16CyclesDone[1] = nSystem16CyclesDone[2] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - SekClose(); - - // Run 68000 #2 - nCurrentCPU = 1; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = SekRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - SekClose(); - - ZetOpen(0); - BurnTimerUpdate(i * (nCyclesTotal[2] / nInterleave)); - ZetClose(); - } - - SekOpen(0); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - ZetOpen(0); - BurnTimerEndFrame(nCyclesTotal[2]); - ZetClose(); - - if (pBurnSoundOut) { - ZetOpen(0); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - SegaPCMUpdate(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } - - if (Simulate8751) Simulate8751(); - - if (pBurnDraw) { - if (Hangon) { - HangonAltRender(); - } else { - HangonRender(); - } - } - - return 0; -} - -INT32 OutrunFrame() -{ - INT32 nInterleave = 100, i; - - if (System16Reset) System16DoReset(); - - if (System16HasGears) { - OutrunMakeInputs(); - } else { - System16MakeInputs(); - } - - nCyclesTotal[0] = (INT32)((INT64)(40000000 / 4) * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)(40000000 / 4) * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[2] = (16000000 / 4) / 60; - nSystem16CyclesDone[0] = nSystem16CyclesDone[1] = nSystem16CyclesDone[2] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 20 || i == 60 || i == 80) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run 68000 #2 - nCurrentCPU = 1; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = SekRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - SekClose(); - - // Run Z80 - nCurrentCPU = 2; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - SegaPCMUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - SegaPCMUpdate(pSoundBuf, nSegmentLength); - } - } - - for (i = 0; i < 2; i++) { - SekOpen(i); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - if (pBurnDraw) { - if (!Shangon) { - OutrunRender(); - } else { - ShangonRender(); - } - } - - return 0; -} - -INT32 XBoardFrame() -{ - INT32 nInterleave = 100, i; - - if (System16Reset) System16DoReset(); - - System16MakeInputs(); - - if (nBurnGunNumPlayers) System16GunMakeInputs(); - - nCyclesTotal[0] = (INT32)((INT64)(50000000 / 4) * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)(50000000 / 4) * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[2] = (16000000 / 4) / 60; - nCyclesTotal[3] = (16000000 / 4) / 60; - nSystem16CyclesDone[0] = nSystem16CyclesDone[1] = nSystem16CyclesDone[2] = nSystem16CyclesDone[3] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 20 || i == 40 || i == 60 || i == 80) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == 99) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run 68000 #2 - nCurrentCPU = 1; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = SekRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 99) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - nCurrentCPU = 2; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - // Run Z80 #2 - if (System16Z80Rom2Num) { - nCurrentCPU = 3; - ZetOpen(1); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - if (System16PCMDataSize) SegaPCMUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - if (System16PCMDataSize) SegaPCMUpdate(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - XBoardRender(); - } - - return 0; -} - -INT32 XBoardFrameGPRider() -{ - INT32 nInterleave = 100, i; - - if (System16Reset) System16DoReset(); - - System16MakeInputs(); - - if (nBurnGunNumPlayers) System16GunMakeInputs(); - - nCyclesTotal[0] = (INT32)((INT64)(50000000 / 4) * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)(50000000 / 4) * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[2] = (16000000 / 4) / 60; - nCyclesTotal[3] = (16000000 / 4) / 60; - nSystem16CyclesDone[0] = nSystem16CyclesDone[1] = nSystem16CyclesDone[2] = nSystem16CyclesDone[3] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - // ACK for 1 interleave cycle to make gprider happy - if (i == 20 || i == 40 || i == 60 || i == 80) SekSetIRQLine(2, CPU_IRQSTATUS_ACK); - if (i == 21 || i == 41 || i == 61 || i == 81) SekSetIRQLine(2, CPU_IRQSTATUS_NONE); - if (i == 98) SekSetIRQLine(4, CPU_IRQSTATUS_ACK); - if (i == 99) SekSetIRQLine(4, CPU_IRQSTATUS_NONE); - SekClose(); - - // Run 68000 #2 - nCurrentCPU = 1; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = SekRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 99) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - nCurrentCPU = 2; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - // Run Z80 #2 - if (System16Z80Rom2Num) { - nCurrentCPU = 3; - ZetOpen(1); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - if (System16PCMDataSize) SegaPCMUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - if (System16PCMDataSize) SegaPCMUpdate(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - XBoardRender(); - } - - return 0; -} - -INT32 YBoardFrame() -{ - INT32 nInterleaveBoost = 8; - INT32 nInterleave = 262 * nInterleaveBoost, i; - - if (System16Reset) System16DoReset(); - - if (System16HasGears) { - PdriftMakeInputs(); - } else { - System16MakeInputs(); - } - - if (nBurnGunNumPlayers) System16GunMakeInputs(); - - nCyclesTotal[0] = (INT32)((INT64)(50000000 / 4) * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)(50000000 / 4) * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[2] = (INT32)((INT64)(50000000 / 4) * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[3] = (32215900 / 8) / 60; - nSystem16CyclesDone[0] = nSystem16CyclesDone[1] = nSystem16CyclesDone[2] = nSystem16CyclesDone[3] = 0; - - INT32 nSoundBufferPos = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - if (i == 170 * nInterleaveBoost) SekSetIRQLine(2, CPU_IRQSTATUS_ACK); - if (i == 171 * nInterleaveBoost) SekSetIRQLine(2, CPU_IRQSTATUS_NONE); - if (i == 223 * nInterleaveBoost) SekSetIRQLine(4, CPU_IRQSTATUS_ACK); - if (i == 224 * nInterleaveBoost) SekSetIRQLine(4, CPU_IRQSTATUS_NONE); - SekClose(); - - // Run 68000 #2 - nCurrentCPU = 1; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = SekRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 170 * nInterleaveBoost) SekSetIRQLine(2, CPU_IRQSTATUS_ACK); - if (i == 171 * nInterleaveBoost) SekSetIRQLine(2, CPU_IRQSTATUS_NONE); - if (i == 223 * nInterleaveBoost) SekSetIRQLine(4, CPU_IRQSTATUS_ACK); - if (i == 224 * nInterleaveBoost) SekSetIRQLine(4, CPU_IRQSTATUS_NONE); - SekClose(); - - // Run 68000 #3 - nCurrentCPU = 2; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = SekRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 170 * nInterleaveBoost) SekSetIRQLine(2, CPU_IRQSTATUS_ACK); - if (i == 171 * nInterleaveBoost) SekSetIRQLine(2, CPU_IRQSTATUS_NONE); - if (i == 223 * nInterleaveBoost) SekSetIRQLine(4, CPU_IRQSTATUS_ACK); - if (i == 224 * nInterleaveBoost) SekSetIRQLine(4, CPU_IRQSTATUS_NONE); - SekClose(); - - // Run Z80 - nCurrentCPU = 3; - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment; - ZetClose(); - - if (pBurnSoundOut && (i % (nInterleaveBoost * 2)) == (nInterleaveBoost * 2) - 1) { // update 131x per frame - INT32 nSegmentLength = nBurnSoundLen / (nInterleave / (nInterleaveBoost * 2)); - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - SegaPCMUpdate(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - SegaPCMUpdate(pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - YBoardRender(); - } - - return 0; -} - -/*==================================================== -Driver Scan -====================================================*/ - -INT32 System16Scan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029740; - } - - if (nAction & ACB_NVRAM) { - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMX || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEMY) { - if (System16BackupRamSize) { - memset(&ba, 0, sizeof(ba)); - ba.Data = System16BackupRam; - ba.nLen = System16BackupRamSize; - ba.szName = "Backup Ram 1"; - BurnAcb(&ba); - } - - if (System16BackupRam2Size) { - memset(&ba, 0, sizeof(ba)); - ba.Data = System16BackupRam2; - ba.nLen = System16BackupRam2Size; - ba.szName = "Backup Ram 2"; - BurnAcb(&ba); - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16A || (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - memset(&ba, 0, sizeof(ba)); - ba.Data = System16Ram; - ba.nLen = System16RamSize; - ba.szName = "Work Ram"; - BurnAcb(&ba); - } - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - if (System16Z80RomNum || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM)) { - ZetScan(nAction); - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC) || (BurnDrvGetHardwareCode() & HARDWARE_SEGA_FD1094_ENC_CPU2)) { - fd1094_scan(nAction); - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16A) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_HANGON) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN)) { - ppi8255_scan(); - } - - if (((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM16B) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_OUTRUN)) { - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_ISGSM) == 0) { - sega_315_5195_scan(nAction); - } - } - - if (System16I8751RomNum) mcs51_scan(nAction); - - if (nBurnGunNumPlayers) BurnGunScan(); - - if (System16HasGears) BurnShiftScan(nAction); - - SCAN_VAR(System16SoundLatch); - SCAN_VAR(System16Input); - SCAN_VAR(System16Dip); - SCAN_VAR(System16VideoEnable); - SCAN_VAR(System16ScreenFlip); - SCAN_VAR(System16ScrollX); - SCAN_VAR(System16ScrollY); - SCAN_VAR(System16ColScroll); - SCAN_VAR(System16RowScroll); - SCAN_VAR(System16SpriteBanks); - SCAN_VAR(System16TileBanks); - SCAN_VAR(System16Page); - SCAN_VAR(BootlegBgPage); - SCAN_VAR(BootlegFgPage); - SCAN_VAR(System16AnalogSelect); - SCAN_VAR(nSystem16CyclesDone); - SCAN_VAR(nCyclesSegment); - SCAN_VAR(System16RoadControl); - SCAN_VAR(multiply); - SCAN_VAR(divide); - SCAN_VAR(compare_timer); - SCAN_VAR(N7751Command); - SCAN_VAR(N7751RomAddress); - SCAN_VAR(UPD7759BankAddress); - SCAN_VAR(System18VdpMixing); - SCAN_VAR(System18VdpEnable); - SCAN_VAR(RF5C68PCMBankAddress); - SCAN_VAR(System16Z80Enable); - SCAN_VAR(System1668KEnable); - SCAN_VAR(System16MCUData); - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SYSTEM18) { - BurnYM3438Scan(nAction, pnMin); - RF5C68PCMScan(nAction); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0xa000, 0xbfff, 0, System16Z80Rom + 0x10000 + RF5C68PCMBankAddress); - ZetMapArea(0xa000, 0xbfff, 2, System16Z80Rom + 0x10000 + RF5C68PCMBankAddress); - ZetClose(); - } - } else { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2203) { - BurnYM2203Scan(nAction, pnMin); - } else { - if (BurnDrvGetHardwareCode() & HARDWARE_SEGA_YM2413) { - BurnYM2413Scan(nAction); - } else { - BurnYM2151Scan(nAction); - } - } - } - - if (System16UPD7759DataSize) { - UPD7759Scan(0,nAction, pnMin); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x8000, 0xdfff, 0, System16UPD7759Data + UPD7759BankAddress); - ZetMapArea(0x8000, 0xdfff, 2, System16UPD7759Data + UPD7759BankAddress); - ZetClose(); - } - } - - if (System16MSM6295RomSize) { - MSM6295Scan(0, nAction); - } - - if (System167751ProgSize) { - N7751Scan(nAction, pnMin); - DACScan(nAction, pnMin); - } - - if (System16PCMDataSize) { - SegaPCMScan(nAction, pnMin); - } - - System16GfxScan(nAction); - } - - return 0; -} diff --git a/jan/src/burn/drv/sg1000/d_sg1000.cpp b/jan/src/burn/drv/sg1000/d_sg1000.cpp deleted file mode 100644 index 07d5f365a..000000000 --- a/jan/src/burn/drv/sg1000/d_sg1000.cpp +++ /dev/null @@ -1,4404 +0,0 @@ -// FB Alpha Sega SG-1000-based arcade driver module -// Based on MAME driver by Tomasz Slanina -// Code by iq_132, fixups & bring up-to-date by dink Aug 18, 2014 - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -#include "tms9928a.h" -#include "8255ppi.h" -#include "sn76496.h" - -static UINT8 *AllMem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *AllRam = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80ROM = NULL; -static UINT8 *DrvZ80Dec = NULL; -static UINT8 *DrvZ80RAM = NULL; - -static UINT8 DrvInputs[2]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; -static UINT8 DrvNMI; -static UINT8 ramexp = 0; // ram expansion mode - -static struct BurnInputInfo Sg1000InputList[] = { - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 7, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 2" }, - - {"Console Pause", BIT_DIGITAL, &DrvNMI, "consolepause" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, -}; - -STDINPUTINFO(Sg1000) - -static struct BurnDIPInfo Sg1000DIPList[]= -{ - {0x12, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x12, 0x01, 0x30, 0x00, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x30, 0x10, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x12, 0x01, 0x80, 0x00, "Japanese" }, - {0x12, 0x01, 0x80, 0x80, "English" }, -}; - -STDDIPINFO(Sg1000) - -static void __fastcall sg1000_write_port(UINT16 port, UINT8 data) -{ - port &= 0xff; - switch (port & ~0x3f) - { - case 0x40: - SN76496Write(0, data); - return; - } - - switch (port & ~0x3e) - { - case 0x80: - TMS9928AWriteVRAM(data); - return; - - case 0x81: - TMS9928AWriteRegs(data); - return; - } - - /*switch (port) - { // only for sf/sc-3000/7000 - case 0xdc: - case 0xdd: - case 0xde: - case 0xdf: - ppi8255_w(0, port & 3, data); - return; - }*/ - - //bprintf(0, _T("port[%X] data[%X],"), port, data); -} - -static UINT8 __fastcall sg1000_read_port(UINT16 port) -{ - port &= 0xff; - - switch (port & ~0x3e) - { - case 0x80: - return TMS9928AReadVRAM(); - - case 0x81: - return TMS9928AReadRegs(); - } - - switch (port) - { - /* // only for sf/sc-3000/7000 - case 0xdc: - case 0xdd: - case 0xde: - case 0xdf: - return ppi8255_r(0, port & 3); - */ - case 0xdc: - return DrvInputs[0]; - - case 0xdd: - return DrvInputs[1]; - - case 0xde: - return 0x80; - - } - //bprintf(0, _T("port[%X],"), port); - - return 0; -} - -static UINT8 sg1000_ppi8255_portA_read() { return DrvInputs[0]; } -static UINT8 sg1000_ppi8255_portB_read() { return DrvInputs[1]; } -static UINT8 sg1000_ppi8255_portC_read() { return DrvDips[0]; } - -static void sg1000_ppi8255_portC_write(UINT8 data) -{ - data &= 0x01; // coin counter -} - -static void vdp_interrupt(INT32 state) -{ - ZetSetIRQLine(0, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - TMS9928AReset(); - ZetClose(); - - SN76496Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - DrvZ80Dec = Next; Next += 0x010000; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x010400; - - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static void __fastcall sg1000_write(UINT16 address, UINT8 data) -{ // normal 0xc000 - 0xc3ff addressing mode w/mirror - address &= ~0x3c00; - if (address >= 0xc000 && address <= 0xc3ff) { - DrvZ80RAM[address-0xc000] = data; - return; - } - //bprintf(0, _T("a[%X] d[%X],"), address, data); -} - -static UINT8 __fastcall sg1000_read(UINT16 address) -{ // normal 0xc000 - 0xc3ff addressing mode w/mirror - address &= ~0x3c00; - if (address >= 0xc000 && address <= 0xc3ff) { - return DrvZ80RAM[address-0xc000]; - } - //bprintf(0, _T("a[%X],"), address); - return 0; -} - -static INT32 DrvLoadRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - INT32 len0 = 0; - UINT8 *Load0 = DrvZ80ROM; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & BRF_PRG) == BRF_PRG) { - if (BurnLoadRom(Load0, i, 1)) return 1; - Load0 += ri.nLen; - len0 += ri.nLen; - bprintf(0, _T("SG-1000 - Loaded PRG #%X to 0x%X.\n"), i, len0); - - continue; - } - } - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (DrvLoadRoms()) return 1; - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xbfff, MAP_ROM); - - if ((BurnDrvGetHardwareCode() & HARDWARE_SEGA_SG1000_RAMEXP) == HARDWARE_SEGA_SG1000_RAMEXP) { - bprintf(0, _T("SG-1000 - RAM Expansion mode.\n")); - ramexp = 1; - ZetMapMemory(DrvZ80RAM, 0xc000, 0xffff, MAP_RAM); - ZetMapMemory(DrvZ80ROM, 0x0000, 0xbfff, MAP_RAM); // Romspace mapped as ram too for Jumbo/DahJee games/Aaronix - } else ramexp = 0; - - ZetSetOutHandler(sg1000_write_port); - ZetSetInHandler(sg1000_read_port); - ZetSetWriteHandler(sg1000_write); - ZetSetReadHandler(sg1000_read); - ZetClose(); - - SN76489AInit(0, 3579545, 0); - SN76496SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - TMS9928AInit(TMS99x8A, 0x4000, 0, 0, vdp_interrupt); - - ppi8255_init(1); - PPI0PortReadA = sg1000_ppi8255_portA_read; - PPI0PortReadB = sg1000_ppi8255_portB_read; - PPI0PortReadC = sg1000_ppi8255_portC_read; - PPI0PortWriteC = sg1000_ppi8255_portC_write; - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - TMS9928AExit(); - ZetExit(); - SN76496Exit(); - ppi8255_exit(); - - BurnFree (AllMem); - AllMem = NULL; - - ramexp = 0; - - return 0; -} - -static INT32 DrvFrame() -{ - static UINT8 lastnmi = 0; - - if (DrvReset) { - DrvDoReset(); - } - - { // Compile Inputs - memset (DrvInputs, 0xff, 2); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - if (i==6 || i==7) - DrvInputs[1] ^= (DrvJoy1[i] & 1) << i; - else - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[1] = { 3579545 / 60 }; - INT32 nCyclesDone[1] = { 0 }; - INT32 nSoundBufferPos = 0; - - ZetOpen(0); - - if (DrvNMI && !lastnmi) { - bprintf(0, _T("nmi %X.\n"), DrvNMI); - ZetNmi(); - lastnmi = DrvNMI; - } else lastnmi = DrvNMI; - - for (INT32 i = 0; i < nInterleave; i++) - { - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - - TMS9928AScanline(i); - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - SN76496Update(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - ZetClose(); - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - SN76496Update(0, pSoundBuf, nSegmentLength); - } - } - - if (pBurnDraw) { - TMS9928ADraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029708; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllMem; - ba.nLen = MemEnd - AllMem; // some games use romspace as ram. - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - TMS9928AScan(nAction, pnMin); - } - - return 0; -} - -INT32 SG1KGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = BurnDrvGetTextA(DRV_NAME); - } else { - pszGameName = BurnDrvGetTextA(DRV_PARENT); - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - - // remove the "SG1K_" - for (UINT32 j = 0; j < strlen(pszGameName); j++) { - szFilename[j] = pszGameName[j + 5]; - } - - *pszName = szFilename; - - return 0; -} - -// Super UWOL SG-1000 - -static struct BurnRomInfo sg1k_superuwolRomDesc[] = { - { "mojon-twins--super-uwol.sg", 0x0c000, 0xaa8ea6eb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_superuwol) -STD_ROM_FN(sg1k_superuwol) - -struct BurnDriver BurnDrvsg1k_superuwol = { - "sg1k_superuwol", NULL, NULL, NULL, "2016", - "Super UWOL! SG-1000\0", NULL, "Mojon Twins", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_superuwolRomInfo, sg1k_superuwolRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - -// End of driver, the following driver info. has been synthesized from hash/sg1000.xml of MESS - -// San-nin Mahjong (Jpn, OMV) - -static struct BurnRomInfo sg1k_3ninmjRomDesc[] = { - { "san-nin mahjong.bin", 0x04000, 0x885fa64d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_3ninmj) -STD_ROM_FN(sg1k_3ninmj) - -struct BurnDriver BurnDrvsg1k_3ninmj = { - "sg1k_3ninmj", "sg1k_mahjong", NULL, NULL, "1984", - "San-nin Mahjong (Jpn, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_3ninmjRomInfo, sg1k_3ninmjRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// San-nin Mahjong (Tw) - -static struct BurnRomInfo sg1k_3ninmjtRomDesc[] = { - { "san-nin mahjong (tw).bin", 0x04000, 0x6fd17655, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_3ninmjt) -STD_ROM_FN(sg1k_3ninmjt) - -struct BurnDriver BurnDrvsg1k_3ninmjt = { - "sg1k_3ninmjt", "sg1k_mahjong", NULL, NULL, "1984?", - "San-nin Mahjong (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_3ninmjtRomInfo, sg1k_3ninmjtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Bank Panic (Jpn) - -static struct BurnRomInfo sg1k_bankpRomDesc[] = { - { "bank panic (japan).bin", 0x08000, 0xd8a87095, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_bankp) -STD_ROM_FN(sg1k_bankp) - -struct BurnDriver BurnDrvsg1k_bankp = { - "sg1k_bankp", NULL, NULL, NULL, "1985", - "Bank Panic (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_bankpRomInfo, sg1k_bankpRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Bi Li Da Dao (Tw) - -static struct BurnRomInfo sg1k_bilidadaRomDesc[] = { - { "bank panic (tw).bin", 0x08000, 0xbd43fde4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_bilidada) -STD_ROM_FN(sg1k_bilidada) - -struct BurnDriver BurnDrvsg1k_bilidada = { - "sg1k_bilidada", "sg1k_bankp", NULL, NULL, "1985?", - "Bi Li Da Dao (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_bilidadaRomInfo, sg1k_bilidadaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// The Black Onyx (Jpn) - -static struct BurnRomInfo sg1k_blckonyxRomDesc[] = { - { "black onyx, the (japan).bin", 0x08000, 0x26ecd094, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_blckonyx) -STD_ROM_FN(sg1k_blckonyx) - -struct BurnDriver BurnDrvsg1k_blckonyx = { - "sg1k_blckonyx", NULL, NULL, NULL, "1987", - "The Black Onyx (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_blckonyxRomInfo, sg1k_blckonyxRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Bomb Jack (Jpn) - -static struct BurnRomInfo sg1k_bombjackRomDesc[] = { - { "bomb jack (japan).bin", 0x08000, 0xea0f2691, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_bombjack) -STD_ROM_FN(sg1k_bombjack) - -struct BurnDriver BurnDrvsg1k_bombjack = { - "sg1k_bombjack", NULL, NULL, NULL, "1985", - "Bomb Jack (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_bombjackRomInfo, sg1k_bombjackRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Bomb Jack (Kor) - -static struct BurnRomInfo sg1k_bombjackk1RomDesc[] = { - { "bomb jack [english logo] (kr).bin", 0x08000, 0x0c69d837, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_bombjackk1) -STD_ROM_FN(sg1k_bombjackk1) - -struct BurnDriver BurnDrvsg1k_bombjackk1 = { - "sg1k_bombjackk1", "sg1k_bombjack", NULL, NULL, "1985?", - "Bomb Jack (Kor)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_bombjackk1RomInfo, sg1k_bombjackk1RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Beom Jjaek (Kor) - -static struct BurnRomInfo sg1k_bombjackk2RomDesc[] = { - { "bomb jack [korean logo] (kr).bin", 0x08000, 0xb0c7b310, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_bombjackk2) -STD_ROM_FN(sg1k_bombjackk2) - -struct BurnDriver BurnDrvsg1k_bombjackk2 = { - "sg1k_bombjackk2", "sg1k_bombjack", NULL, NULL, "1985?", - "Beom Jjaek (Kor)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_bombjackk2RomInfo, sg1k_bombjackk2RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Bomb Jack (Tw) - -static struct BurnRomInfo sg1k_bombjackt1RomDesc[] = { - { "bomb jack [english logo] (tw).bin", 0x08000, 0xcda3a335, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_bombjackt1) -STD_ROM_FN(sg1k_bombjackt1) - -struct BurnDriver BurnDrvsg1k_bombjackt1 = { - "sg1k_bombjackt1", "sg1k_bombjack", NULL, NULL, "1985?", - "Bomb Jack (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_bombjackt1RomInfo, sg1k_bombjackt1RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Bomber Man Special (Tw) - -static struct BurnRomInfo sg1k_bombmnspRomDesc[] = { - { "bomberman special (tw).bin", 0x0c000, 0x69fc1494, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_bombmnsp) -STD_ROM_FN(sg1k_bombmnsp) - -struct BurnDriver BurnDrvsg1k_bombmnsp = { - "sg1k_bombmnsp", NULL, NULL, NULL, "1986?", - "Bomber Man Special (Tw)\0", NULL, "DahJee", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_bombmnspRomInfo, sg1k_bombmnspRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Chaoren (Tw) - -static struct BurnRomInfo sg1k_bombjackt2RomDesc[] = { - { "bomb jack [chinese logo] (tw).bin", 0x08000, 0xdeb213fe, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_bombjackt2) -STD_ROM_FN(sg1k_bombjackt2) - -struct BurnDriver BurnDrvsg1k_bombjackt2 = { - "sg1k_bombjackt2", "sg1k_bombjack", NULL, NULL, "1985?", - "Chaoren (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_bombjackt2RomInfo, sg1k_bombjackt2RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Borderline (Euro, Jpn) - -static struct BurnRomInfo sg1k_bordrlinRomDesc[] = { - { "borderline (japan, europe).bin", 0x04000, 0x0b4bca74, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_bordrlin) -STD_ROM_FN(sg1k_bordrlin) - -struct BurnDriver BurnDrvsg1k_bordrlin = { - "sg1k_bordrlin", NULL, NULL, NULL, "1983", - "Borderline (Euro, Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_bordrlinRomInfo, sg1k_bordrlinRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Cabbage Patch Kids (Tw) - -static struct BurnRomInfo sg1k_cabkidsRomDesc[] = { - { "cabbage patch kids (tw).bin", 0x08000, 0x9d91ab78, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_cabkids) -STD_ROM_FN(sg1k_cabkids) - -struct BurnDriver BurnDrvsg1k_cabkids = { - "sg1k_cabkids", NULL, NULL, NULL, "198?", - "Cabbage Patch Kids (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_cabkidsRomInfo, sg1k_cabkidsRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// The Castle (Jpn) - -static struct BurnRomInfo sg1k_castleRomDesc[] = { - { "mpr-10159.ic1", 0x08000, 0x092f29d6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_castle) -STD_ROM_FN(sg1k_castle) - -struct BurnDriver BurnDrvsg1k_castle = { - "sg1k_castle", NULL, NULL, NULL, "1986", - "The Castle (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_castleRomInfo, sg1k_castleRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mowang migong ~ The Castle (Tw) - -static struct BurnRomInfo sg1k_castletRomDesc[] = { - { "castle, the [msx] (tw).bin", 0x0c000, 0x2e366ccf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_castlet) -STD_ROM_FN(sg1k_castlet) - -struct BurnDriver BurnDrvsg1k_castlet = { - "sg1k_castlet", "sg1k_castle", NULL, NULL, "1986?", - "Mowang migong ~ The Castle (Tw)\0", NULL, "DahJee", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_castletRomInfo, sg1k_castletRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Chack'n Pop (Jpn) - -static struct BurnRomInfo sg1k_chacknRomDesc[] = { - { "chack'n pop (japan).bin", 0x08000, 0xd37bda49, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_chackn) -STD_ROM_FN(sg1k_chackn) - -struct BurnDriver BurnDrvsg1k_chackn = { - "sg1k_chackn", NULL, NULL, NULL, "1985", - "Chack'n Pop (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_chacknRomInfo, sg1k_chacknRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Da Yu (Tw) - -static struct BurnRomInfo sg1k_dayuRomDesc[] = { - { "chack'n pop (tw).bin", 0x08000, 0xd81a72ce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_dayu) -STD_ROM_FN(sg1k_dayu) - -struct BurnDriver BurnDrvsg1k_dayu = { - "sg1k_dayu", "sg1k_chackn", NULL, NULL, "1985?", - "Da Yu (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_dayuRomInfo, sg1k_dayuRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Challenge Derby (Jpn, OMV) - -static struct BurnRomInfo sg1k_chaldrbyRomDesc[] = { - { "challenge derby [16k].bin", 0x04000, 0xc91551da, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_chaldrby) -STD_ROM_FN(sg1k_chaldrby) - -struct BurnDriver BurnDrvsg1k_chaldrby = { - "sg1k_chaldrby", NULL, NULL, NULL, "1984", - "Challenge Derby (Jpn, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_chaldrbyRomInfo, sg1k_chaldrbyRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Challenge Derby (Jpn, OMV, Alt) - -static struct BurnRomInfo sg1k_chaldrbyaRomDesc[] = { - { "challenge derby [40k].bin", 0x0a000, 0x02bc891f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_chaldrbya) -STD_ROM_FN(sg1k_chaldrbya) - -struct BurnDriver BurnDrvsg1k_chaldrbya = { - "sg1k_chaldrbya", "sg1k_chaldrby", NULL, NULL, "1984", - "Challenge Derby (Jpn, OMV, Alt)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_chaldrbyaRomInfo, sg1k_chaldrbyaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Challenge Derby (Jpn, OMV, Hacked) - -static struct BurnRomInfo sg1k_chaldrbybRomDesc[] = { - { "challenge derby [ver.b] [40k].bin", 0x0a000, 0xc5f014dc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_chaldrbyb) -STD_ROM_FN(sg1k_chaldrbyb) - -struct BurnDriver BurnDrvsg1k_chaldrbyb = { - "sg1k_chaldrbyb", "sg1k_chaldrby", NULL, NULL, "1984", - "Challenge Derby (Jpn, OMV, Hacked)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_chaldrbybRomInfo, sg1k_chaldrbybRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Baseball (Jpn) - -static struct BurnRomInfo sg1k_champbasRomDesc[] = { - { "mpr-6381.ic1", 0x04000, 0x5970a12b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champbas) -STD_ROM_FN(sg1k_champbas) - -struct BurnDriver BurnDrvsg1k_champbas = { - "sg1k_champbas", NULL, NULL, NULL, "1983", - "Champion Baseball (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champbasRomInfo, sg1k_champbasRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Baseball (Jpn, Older) - -static struct BurnRomInfo sg1k_champbasaRomDesc[] = { - { "champion baseball [40k].bin", 0x0a000, 0xc0c16fa7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champbasa) -STD_ROM_FN(sg1k_champbasa) - -struct BurnDriver BurnDrvsg1k_champbasa = { - "sg1k_champbasa", "sg1k_champbas", NULL, NULL, "1983", - "Champion Baseball (Jpn, Older)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champbasaRomInfo, sg1k_champbasaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Baseball (Tw) - -static struct BurnRomInfo sg1k_champbastRomDesc[] = { - { "champion baseball [16k] (tw).bin", 0x04000, 0x677e6878, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champbast) -STD_ROM_FN(sg1k_champbast) - -struct BurnDriver BurnDrvsg1k_champbast = { - "sg1k_champbast", "sg1k_champbas", NULL, NULL, "1985?", - "Champion Baseball (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champbastRomInfo, sg1k_champbastRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Billiards (Jpn) - -static struct BurnRomInfo sg1k_champbilRomDesc[] = { - { "champion billiards (japan).bin", 0x08000, 0x62b21e31, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champbil) -STD_ROM_FN(sg1k_champbil) - -struct BurnDriver BurnDrvsg1k_champbil = { - "sg1k_champbil", NULL, NULL, NULL, "1986", - "Champion Billiards (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champbilRomInfo, sg1k_champbilRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Boxing (Jpn) - -static struct BurnRomInfo sg1k_champboxRomDesc[] = { - { "mpr-6100.ic1", 0x08000, 0x26f947d1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champbox) -STD_ROM_FN(sg1k_champbox) - -struct BurnDriver BurnDrvsg1k_champbox = { - "sg1k_champbox", NULL, NULL, NULL, "1984", - "Champion Boxing (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champboxRomInfo, sg1k_champboxRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Boxing (Tw) - -static struct BurnRomInfo sg1k_champboxtRomDesc[] = { - { "champion boxing (tw).bin", 0x08000, 0x15d2ce33, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champboxt) -STD_ROM_FN(sg1k_champboxt) - -struct BurnDriver BurnDrvsg1k_champboxt = { - "sg1k_champboxt", "sg1k_champbox", NULL, NULL, "1984?", - "Champion Boxing (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champboxtRomInfo, sg1k_champboxtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Boxing (Jpn, MyCard) - -static struct BurnRomInfo sg1k_champbox1RomDesc[] = { - { "champion boxing (japan) (mycard).bin", 0x08000, 0xf8b2ac1d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champbox1) -STD_ROM_FN(sg1k_champbox1) - -struct BurnDriver BurnDrvsg1k_champbox1 = { - "sg1k_champbox1", "sg1k_champbox", NULL, NULL, "1984", - "Champion Boxing (Jpn, MyCard)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champbox1RomInfo, sg1k_champbox1RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Golf (Jpn) - -static struct BurnRomInfo sg1k_champglfRomDesc[] = { - { "mpr-5435.ic1", 0x08000, 0x868419b5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champglf) -STD_ROM_FN(sg1k_champglf) - -struct BurnDriver BurnDrvsg1k_champglf = { - "sg1k_champglf", NULL, NULL, NULL, "1983", - "Champion Golf (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champglfRomInfo, sg1k_champglfRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Golf (Kor) - -static struct BurnRomInfo sg1k_champglfkRomDesc[] = { - { "champion golf (kr).bin", 0x08000, 0x35af42ad, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champglfk) -STD_ROM_FN(sg1k_champglfk) - -struct BurnDriver BurnDrvsg1k_champglfk = { - "sg1k_champglfk", "sg1k_champglf", NULL, NULL, "198?", - "Champion Golf (Kor)\0", NULL, "Samsung", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champglfkRomInfo, sg1k_champglfkRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Golf (Jpn, MyCard) - -static struct BurnRomInfo sg1k_champglf1RomDesc[] = { - { "champion golf [card].bin", 0x08000, 0x5a904122, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champglf1) -STD_ROM_FN(sg1k_champglf1) - -struct BurnDriver BurnDrvsg1k_champglf1 = { - "sg1k_champglf1", "sg1k_champglf", NULL, NULL, "1983", - "Champion Golf (Jpn, MyCard)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champglf1RomInfo, sg1k_champglf1RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Ice Hockey (Jpn) - -static struct BurnRomInfo sg1k_champiceRomDesc[] = { - { "champion ice hockey (japan).bin", 0x08000, 0xbdc05652, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champice) -STD_ROM_FN(sg1k_champice) - -struct BurnDriver BurnDrvsg1k_champice = { - "sg1k_champice", NULL, NULL, NULL, "1985", - "Champion Ice Hockey (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champiceRomInfo, sg1k_champiceRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Ice Hockey (Kor) - -static struct BurnRomInfo sg1k_champicekRomDesc[] = { - { "champion ice hockey (kr).bin", 0x08000, 0xec0b862c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champicek) -STD_ROM_FN(sg1k_champicek) - -struct BurnDriver BurnDrvsg1k_champicek = { - "sg1k_champicek", "sg1k_champice", NULL, NULL, "198?", - "Champion Ice Hockey (Kor)\0", NULL, "Samsung", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champicekRomInfo, sg1k_champicekRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Qugunqiu (Tw) - -static struct BurnRomInfo sg1k_champicetRomDesc[] = { - { "champion ice hockey (tw).bin", 0x08000, 0xc6e5192f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champicet) -STD_ROM_FN(sg1k_champicet) - -struct BurnDriver BurnDrvsg1k_champicet = { - "sg1k_champicet", "sg1k_champice", NULL, NULL, "1985?", - "Qugunqiu (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champicetRomInfo, sg1k_champicetRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Kendou (Jpn) - -static struct BurnRomInfo sg1k_champkenRomDesc[] = { - { "champion kendou (japan).bin", 0x08000, 0x10cdebce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champken) -STD_ROM_FN(sg1k_champken) - -struct BurnDriver BurnDrvsg1k_champken = { - "sg1k_champken", NULL, NULL, NULL, "1986", - "Champion Kendou (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champkenRomInfo, sg1k_champkenRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Jiandao (Tw) - -static struct BurnRomInfo sg1k_champkentRomDesc[] = { - { "champion kendou (tw).bin", 0x08000, 0xa5f61363, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champkent) -STD_ROM_FN(sg1k_champkent) - -struct BurnDriver BurnDrvsg1k_champkent = { - "sg1k_champkent", "sg1k_champken", NULL, NULL, "1986?", - "Jiandao (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champkentRomInfo, sg1k_champkentRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Pro Wrestling (Jpn) - -static struct BurnRomInfo sg1k_champpwrRomDesc[] = { - { "champion pro wrestling (japan).bin", 0x08000, 0x372fe6bc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champpwr) -STD_ROM_FN(sg1k_champpwr) - -struct BurnDriver BurnDrvsg1k_champpwr = { - "sg1k_champpwr", NULL, NULL, NULL, "1985", - "Champion Pro Wrestling (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champpwrRomInfo, sg1k_champpwrRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Soccer (Jpn) - -static struct BurnRomInfo sg1k_champscrRomDesc[] = { - { "champion soccer (japan).bin", 0x04000, 0x6f39719e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champscr) -STD_ROM_FN(sg1k_champscr) - -struct BurnDriver BurnDrvsg1k_champscr = { - "sg1k_champscr", NULL, NULL, NULL, "1984", - "Champion Soccer (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champscrRomInfo, sg1k_champscrRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Soccer (Tw) - -static struct BurnRomInfo sg1k_champscrtRomDesc[] = { - { "champion soccer (tw).bin", 0x04000, 0x269c1aee, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champscrt) -STD_ROM_FN(sg1k_champscrt) - -struct BurnDriver BurnDrvsg1k_champscrt = { - "sg1k_champscrt", "sg1k_champscr", NULL, NULL, "1984?", - "Champion Soccer (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champscrtRomInfo, sg1k_champscrtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Champion Tennis (Jpn) - -static struct BurnRomInfo sg1k_champtnsRomDesc[] = { - { "mpr-5439.ic1", 0x02000, 0x7c663316, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_champtns) -STD_ROM_FN(sg1k_champtns) - -struct BurnDriver BurnDrvsg1k_champtns = { - "sg1k_champtns", NULL, NULL, NULL, "1983", - "Champion Tennis (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_champtnsRomInfo, sg1k_champtnsRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Choplifter (Jpn) - -static struct BurnRomInfo sg1k_chopliftRomDesc[] = { - { "choplifter (japan).bin", 0x08000, 0x732b7180, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_choplift) -STD_ROM_FN(sg1k_choplift) - -struct BurnDriver BurnDrvsg1k_choplift = { - "sg1k_choplift", NULL, NULL, NULL, "1985", - "Choplifter (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_chopliftRomInfo, sg1k_chopliftRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Choplifter (Jpn, Prototype) - -static struct BurnRomInfo sg1k_chopliftpRomDesc[] = { - { "choplifter (japan) (proto).bin", 0x08000, 0xff435469, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_chopliftp) -STD_ROM_FN(sg1k_chopliftp) - -struct BurnDriver BurnDrvsg1k_chopliftp = { - "sg1k_chopliftp", "sg1k_choplift", NULL, NULL, "1985", - "Choplifter (Jpn, Prototype)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_chopliftpRomInfo, sg1k_chopliftpRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Choplifter (Kor) - -static struct BurnRomInfo sg1k_chopliftkRomDesc[] = { - { "choplifter (kr).bin", 0x08000, 0x954d8f26, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_chopliftk) -STD_ROM_FN(sg1k_chopliftk) - -struct BurnDriver BurnDrvsg1k_chopliftk = { - "sg1k_chopliftk", "sg1k_choplift", NULL, NULL, "1985?", - "Choplifter (Kor)\0", NULL, "Sega?", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_chopliftkRomInfo, sg1k_chopliftkRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Fei Lang (Tw) - -static struct BurnRomInfo sg1k_feilangRomDesc[] = { - { "choplifter [chinese logo] (tw).bin", 0x08000, 0x746a8d86, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_feilang) -STD_ROM_FN(sg1k_feilang) - -struct BurnDriver BurnDrvsg1k_feilang = { - "sg1k_feilang", "sg1k_choplift", NULL, NULL, "1985?", - "Fei Lang (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_feilangRomInfo, sg1k_feilangRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Fei Lang ~ Choplifter (Tw, Alt) - -static struct BurnRomInfo sg1k_feilangaRomDesc[] = { - { "choplifter [english logo] (tw).bin", 0x08000, 0x7c603987, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_feilanga) -STD_ROM_FN(sg1k_feilanga) - -struct BurnDriver BurnDrvsg1k_feilanga = { - "sg1k_feilanga", "sg1k_choplift", NULL, NULL, "1985?", - "Fei Lang ~ Choplifter (Tw, Alt)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_feilangaRomInfo, sg1k_feilangaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Choplifter (Tw) - -static struct BurnRomInfo sg1k_choplifttRomDesc[] = { - { "choplifter [no logo] (tw).bin", 0x08000, 0x825e1aae, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_chopliftt) -STD_ROM_FN(sg1k_chopliftt) - -struct BurnDriver BurnDrvsg1k_chopliftt = { - "sg1k_chopliftt", "sg1k_choplift", NULL, NULL, "1985?", - "Choplifter (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_choplifttRomInfo, sg1k_choplifttRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Championship Lode Runner (Jpn) - -static struct BurnRomInfo sg1k_cloderunRomDesc[] = { - { "championship lode runner (japan).bin", 0x08000, 0x11db4b1d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_cloderun) -STD_ROM_FN(sg1k_cloderun) - -struct BurnDriver BurnDrvsg1k_cloderun = { - "sg1k_cloderun", NULL, NULL, NULL, "1985", - "Championship Lode Runner (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_cloderunRomInfo, sg1k_cloderunRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Xun Bao Er Dai (Tw) - -static struct BurnRomInfo sg1k_cloderuntRomDesc[] = { - { "championship lode runner (tw).bin", 0x08000, 0xec95ebcb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_cloderunt) -STD_ROM_FN(sg1k_cloderunt) - -struct BurnDriver BurnDrvsg1k_cloderunt = { - "sg1k_cloderunt", "sg1k_cloderun", NULL, NULL, "1985?", - "Xun Bao Er Dai (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_cloderuntRomInfo, sg1k_cloderuntRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Maxi Tuan ~ Circus Charlie (Tw) - -static struct BurnRomInfo sg1k_circuscRomDesc[] = { - { "circus charlie (tw).bin", 0x08000, 0x3404fce4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_circusc) -STD_ROM_FN(sg1k_circusc) - -struct BurnDriver BurnDrvsg1k_circusc = { - "sg1k_circusc", NULL, NULL, NULL, "198?", - "Maxi Tuan ~ Circus Charlie (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_circuscRomInfo, sg1k_circuscRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Circus Charlie (Kor) - -static struct BurnRomInfo sg1k_circusckRomDesc[] = { - { "circus charlie (kr).bin", 0x08000, 0x7f7f009d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_circusck) -STD_ROM_FN(sg1k_circusck) - -struct BurnDriver BurnDrvsg1k_circusck = { - "sg1k_circusck", "sg1k_circusc", NULL, NULL, "198?", - "Circus Charlie (Kor)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_circusckRomInfo, sg1k_circusckRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Congo Bongo (Euro, Jpn, v1) - -static struct BurnRomInfo sg1k_congoRomDesc[] = { - { "congo bongo [v1].bin", 0x06000, 0x5a24c7cf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_congo) -STD_ROM_FN(sg1k_congo) - -struct BurnDriver BurnDrvsg1k_congo = { - "sg1k_congo", NULL, NULL, NULL, "1983", - "Congo Bongo (Euro, Jpn, v1)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_congoRomInfo, sg1k_congoRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Congo Bongo (Euro, Jpn, v1 Alt) - -static struct BurnRomInfo sg1k_congoaRomDesc[] = { - { "congo bongo [v1] [40k map].bin", 0x0a000, 0xf1506565, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_congoa) -STD_ROM_FN(sg1k_congoa) - -struct BurnDriver BurnDrvsg1k_congoa = { - "sg1k_congoa", "sg1k_congo", NULL, NULL, "1983", - "Congo Bongo (Euro, Jpn, v1 Alt)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_congoaRomInfo, sg1k_congoaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Congo Bongo (Jpn, v0) - -static struct BurnRomInfo sg1k_congobRomDesc[] = { - { "congo bongo [v0].bin", 0x06000, 0x5eb48a20, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_congob) -STD_ROM_FN(sg1k_congob) - -struct BurnDriver BurnDrvsg1k_congob = { - "sg1k_congob", "sg1k_congo", NULL, NULL, "1983", - "Congo Bongo (Jpn, v0)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_congobRomInfo, sg1k_congobRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Congo Bongo (Tw) - -static struct BurnRomInfo sg1k_congotRomDesc[] = { - { "congo bongo (tw).bin", 0x06000, 0xf7eb94c5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_congot) -STD_ROM_FN(sg1k_congot) - -struct BurnDriver BurnDrvsg1k_congot = { - "sg1k_congot", "sg1k_congo", NULL, NULL, "19??", - "Congo Bongo (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_congotRomInfo, sg1k_congotRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// C_So! (Jpn) - -static struct BurnRomInfo sg1k_csoRomDesc[] = { - { "c_so! (japan).bin", 0x08000, 0xbe7ed0eb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_cso) -STD_ROM_FN(sg1k_cso) - -struct BurnDriver BurnDrvsg1k_cso = { - "sg1k_cso", NULL, NULL, NULL, "1985", - "C_So! (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_csoRomInfo, sg1k_csoRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Wanpi Gui (Tw) - -static struct BurnRomInfo sg1k_csotRomDesc[] = { - { "c_so! (tw).bin", 0x08000, 0x82c4e3e5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_csot) -STD_ROM_FN(sg1k_csot) - -struct BurnDriver BurnDrvsg1k_csot = { - "sg1k_csot", "sg1k_cso", NULL, NULL, "1985?", - "Wanpi Gui (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_csotRomInfo, sg1k_csotRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Da Cike (Tw) - -static struct BurnRomInfo sg1k_dacikeRomDesc[] = { - { "yie ar kung-fu ii [dahjee] (tw).bin", 0x0c000, 0xfc87463c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_dacike) -STD_ROM_FN(sg1k_dacike) - -struct BurnDriver BurnDrvsg1k_dacike = { - "sg1k_dacike", NULL, NULL, NULL, "1986?", - "Yie Ar Kung-Fu II, Da Cike (Tw)\0", NULL, "DahJee", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_dacikeRomInfo, sg1k_dacikeRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Dokidoki Penguin Land (Jpn) - -static struct BurnRomInfo sg1k_dokidokiRomDesc[] = { - { "dokidoki penguin land (japan).bin", 0x08000, 0x346556b9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_dokidoki) -STD_ROM_FN(sg1k_dokidoki) - -struct BurnDriver BurnDrvsg1k_dokidoki = { - "sg1k_dokidoki", NULL, NULL, NULL, "1985", - "Dokidoki Penguin Land (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_dokidokiRomInfo, sg1k_dokidokiRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Qi E (Tw) - -static struct BurnRomInfo sg1k_qieRomDesc[] = { - { "doki doki penguin land (19xx)(-)(tw).bin", 0x08000, 0xfdc095bc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_qie) -STD_ROM_FN(sg1k_qie) - -struct BurnDriver BurnDrvsg1k_qie = { - "sg1k_qie", "sg1k_dokidoki", NULL, NULL, "1985?", - "Qi E (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_qieRomInfo, sg1k_qieRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Dragon Wang (Jpn, v1) - -static struct BurnRomInfo sg1k_dragwangRomDesc[] = { - { "dragon wang (japan).bin", 0x08000, 0x99c3de21, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_dragwang) -STD_ROM_FN(sg1k_dragwang) - -struct BurnDriver BurnDrvsg1k_dragwang = { - "sg1k_dragwang", NULL, NULL, NULL, "1985", - "Dragon Wang (Jpn, v1)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_dragwangRomInfo, sg1k_dragwangRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Jing Wu Men (Tw) - -static struct BurnRomInfo sg1k_jingwumnRomDesc[] = { - { "dragon wang (tw).bin", 0x08000, 0x7c7d4397, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_jingwumn) -STD_ROM_FN(sg1k_jingwumn) - -struct BurnDriver BurnDrvsg1k_jingwumn = { - "sg1k_jingwumn", "sg1k_dragwang", NULL, NULL, "1985?", - "Jing Wu Men (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_jingwumnRomInfo, sg1k_jingwumnRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Jing Wu Men (Tw, Alt) - -static struct BurnRomInfo sg1k_jingwumnaRomDesc[] = { - { "dragon wang [v0] [english logo] (tw).bin", 0x08000, 0x6f94e5c0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_jingwumna) -STD_ROM_FN(sg1k_jingwumna) - -struct BurnDriver BurnDrvsg1k_jingwumna = { - "sg1k_jingwumna", "sg1k_dragwang", NULL, NULL, "1985?", - "Jing Wu Men (Tw, Alt)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_jingwumnaRomInfo, sg1k_jingwumnaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Dragon Wang (Jpn, v0) - -static struct BurnRomInfo sg1k_dragwang1RomDesc[] = { - { "dragon wang (japan) (alt).bin", 0x08000, 0x60f30138, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_dragwang1) -STD_ROM_FN(sg1k_dragwang1) - -struct BurnDriver BurnDrvsg1k_dragwang1 = { - "sg1k_dragwang1", "sg1k_dragwang", NULL, NULL, "1985", - "Dragon Wang (Jpn, v0)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_dragwang1RomInfo, sg1k_dragwang1RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Drol (Jpn) - -static struct BurnRomInfo sg1k_drolRomDesc[] = { - { "drol (japan).bin", 0x08000, 0x288940cb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_drol) -STD_ROM_FN(sg1k_drol) - -struct BurnDriver BurnDrvsg1k_drol = { - "sg1k_drol", NULL, NULL, NULL, "1985", - "Drol (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_drolRomInfo, sg1k_drolRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Drol (Tw) - -static struct BurnRomInfo sg1k_droltRomDesc[] = { - { "drol (tw).bin", 0x08000, 0xb7fc033d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_drolt) -STD_ROM_FN(sg1k_drolt) - -struct BurnDriver BurnDrvsg1k_drolt = { - "sg1k_drolt", "sg1k_drol", NULL, NULL, "1985?", - "Drol (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_droltRomInfo, sg1k_droltRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Drol (Kor) - -static struct BurnRomInfo sg1k_drolkRomDesc[] = { - { "drol (kr).bin", 0x08000, 0x1d7c53bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_drolk) -STD_ROM_FN(sg1k_drolk) - -struct BurnDriver BurnDrvsg1k_drolk = { - "sg1k_drolk", "sg1k_drol", NULL, NULL, "198?", - "Drol (Kor)\0", NULL, "Samsung", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_drolkRomInfo, sg1k_drolkRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Elevator Action (Jpn) - -static struct BurnRomInfo sg1k_elevatorRomDesc[] = { - { "elevator action (japan).bin", 0x08000, 0x5af8f69d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_elevator) -STD_ROM_FN(sg1k_elevator) - -struct BurnDriver BurnDrvsg1k_elevator = { - "sg1k_elevator", NULL, NULL, NULL, "1985", - "Elevator Action (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_elevatorRomInfo, sg1k_elevatorRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Die Dui Die (Tw) - -static struct BurnRomInfo sg1k_elevatortRomDesc[] = { - { "elevator action (tw).bin", 0x08000, 0x6846e36d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_elevatort) -STD_ROM_FN(sg1k_elevatort) - -struct BurnDriver BurnDrvsg1k_elevatort = { - "sg1k_elevatort", "sg1k_elevator", NULL, NULL, "1985?", - "Die Dui Die (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_elevatortRomInfo, sg1k_elevatortRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Exerion (Euro, Jpn) - -static struct BurnRomInfo sg1k_exerionRomDesc[] = { - { "mpr-5692.ic1", 0x04000, 0xa2c45b61, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_exerion) -STD_ROM_FN(sg1k_exerion) - -struct BurnDriver BurnDrvsg1k_exerion = { - "sg1k_exerion", NULL, NULL, NULL, "1983", - "Exerion (Euro, Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_exerionRomInfo, sg1k_exerionRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Exerion (Tw) - -static struct BurnRomInfo sg1k_exeriontRomDesc[] = { - { "exerion (tw).bin", 0x04000, 0xb5c84a32, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_exeriont) -STD_ROM_FN(sg1k_exeriont) - -struct BurnDriver BurnDrvsg1k_exeriont = { - "sg1k_exeriont", "sg1k_exerion", NULL, NULL, "1983?", - "Exerion (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_exeriontRomInfo, sg1k_exeriontRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Exerion (Kor) - -static struct BurnRomInfo sg1k_exerionkRomDesc[] = { - { "exerion (kr).bin", 0x08000, 0xfc628d0d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_exerionk) -STD_ROM_FN(sg1k_exerionk) - -struct BurnDriver BurnDrvsg1k_exerionk = { - "sg1k_exerionk", "sg1k_exerion", NULL, NULL, "198?", - "Exerion (Kor)\0", NULL, "Samsung", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_exerionkRomInfo, sg1k_exerionkRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Flicky (Jpn, v1) - -static struct BurnRomInfo sg1k_flickyRomDesc[] = { - { "flicky [v1].bin", 0x08000, 0x26d2862c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_flicky) -STD_ROM_FN(sg1k_flicky) - -struct BurnDriver BurnDrvsg1k_flicky = { - "sg1k_flicky", NULL, NULL, NULL, "1984", - "Flicky (Jpn, v1)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_flickyRomInfo, sg1k_flickyRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Flicky (Jpn, v0) - -static struct BurnRomInfo sg1k_flickyaRomDesc[] = { - { "flicky (japan).bin", 0x08000, 0xbd24d27b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_flickya) -STD_ROM_FN(sg1k_flickya) - -struct BurnDriver BurnDrvsg1k_flickya = { - "sg1k_flickya", "sg1k_flicky", NULL, NULL, "1984", - "Flicky (Jpn, v0)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_flickyaRomInfo, sg1k_flickyaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Flicky (Tw) - -static struct BurnRomInfo sg1k_flickytRomDesc[] = { - { "flicky (tw).bin", 0x08000, 0xcd0666a7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_flickyt) -STD_ROM_FN(sg1k_flickyt) - -struct BurnDriver BurnDrvsg1k_flickyt = { - "sg1k_flickyt", "sg1k_flicky", NULL, NULL, "1984?", - "Flicky (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_flickytRomInfo, sg1k_flickytRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Girl's Garden (Jpn) - -static struct BurnRomInfo sg1k_girlgardRomDesc[] = { - { "girl's garden (japan).bin", 0x08000, 0x1898f274, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_girlgard) -STD_ROM_FN(sg1k_girlgard) - -struct BurnDriver BurnDrvsg1k_girlgard = { - "sg1k_girlgard", NULL, NULL, NULL, "1984", - "Girl's Garden (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_girlgardRomInfo, sg1k_girlgardRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Girl's Garden (Tw) - -static struct BurnRomInfo sg1k_girlgardtRomDesc[] = { - { "girl's garden (tw).bin", 0x08000, 0xb9635ac4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_girlgardt) -STD_ROM_FN(sg1k_girlgardt) - -struct BurnDriver BurnDrvsg1k_girlgardt = { - "sg1k_girlgardt", "sg1k_girlgard", NULL, NULL, "1984?", - "Girl's Garden (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_girlgardtRomInfo, sg1k_girlgardtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Golgo 13 (Jpn) - -static struct BurnRomInfo sg1k_golgo13RomDesc[] = { - { "golgo 13 (japan).bin", 0x08000, 0x0d159ed0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_golgo13) -STD_ROM_FN(sg1k_golgo13) - -struct BurnDriver BurnDrvsg1k_golgo13 = { - "sg1k_golgo13", NULL, NULL, NULL, "1984", - "Golgo 13 (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_golgo13RomInfo, sg1k_golgo13RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// GP World (Jpn, v1) - -static struct BurnRomInfo sg1k_gpworldRomDesc[] = { - { "gp world (japan).bin", 0x08000, 0x191ffe0a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_gpworld) -STD_ROM_FN(sg1k_gpworld) - -struct BurnDriver BurnDrvsg1k_gpworld = { - "sg1k_gpworld", NULL, NULL, NULL, "1985", - "GP World (Jpn, v1)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_gpworldRomInfo, sg1k_gpworldRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// GP World (Jpn, v0) - -static struct BurnRomInfo sg1k_gpworldaRomDesc[] = { - { "mpr-6485.ic1", 0x08000, 0x942adf84, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_gpworlda) -STD_ROM_FN(sg1k_gpworlda) - -struct BurnDriver BurnDrvsg1k_gpworlda = { - "sg1k_gpworlda", "sg1k_gpworld", NULL, NULL, "1985", - "GP World (Jpn, v0)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_gpworldaRomInfo, sg1k_gpworldaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// GP World (Tw) - -static struct BurnRomInfo sg1k_gpworldtRomDesc[] = { - { "gp world (tw).bin", 0x08000, 0xf19f7548, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_gpworldt) -STD_ROM_FN(sg1k_gpworldt) - -struct BurnDriver BurnDrvsg1k_gpworldt = { - "sg1k_gpworldt", "sg1k_gpworld", NULL, NULL, "1985?", - "GP World (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_gpworldtRomInfo, sg1k_gpworldtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Gulkave (Jpn) - -static struct BurnRomInfo sg1k_gulkaveRomDesc[] = { - { "gulkave (japan).bin", 0x08000, 0x15a754a3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_gulkave) -STD_ROM_FN(sg1k_gulkave) - -struct BurnDriver BurnDrvsg1k_gulkave = { - "sg1k_gulkave", NULL, NULL, NULL, "1986", - "Gulkave (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_gulkaveRomInfo, sg1k_gulkaveRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Gulkave (Kor) - -static struct BurnRomInfo sg1k_gulkavekRomDesc[] = { - { "gulkave (kr).bin", 0x08000, 0xddcb708b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_gulkavek) -STD_ROM_FN(sg1k_gulkavek) - -struct BurnDriver BurnDrvsg1k_gulkavek = { - "sg1k_gulkavek", "sg1k_gulkave", NULL, NULL, "198?", - "Gulkave (Kor)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_gulkavekRomInfo, sg1k_gulkavekRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Guzzler (Jpn, OMV) - -static struct BurnRomInfo sg1k_guzzlerRomDesc[] = { - { "guzzler (japan) (om).bin", 0x02000, 0x61fa9ea0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_guzzler) -STD_ROM_FN(sg1k_guzzler) - -struct BurnDriver BurnDrvsg1k_guzzler = { - "sg1k_guzzler", NULL, NULL, NULL, "1983", - "Guzzler (Jpn, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_guzzlerRomInfo, sg1k_guzzlerRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Guzzler (Tw) - -static struct BurnRomInfo sg1k_guzzlertRomDesc[] = { - { "guzzler (tw).bin", 0x02000, 0xeb808158, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_guzzlert) -STD_ROM_FN(sg1k_guzzlert) - -struct BurnDriver BurnDrvsg1k_guzzlert = { - "sg1k_guzzlert", "sg1k_guzzler", NULL, NULL, "1983?", - "Guzzler (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_guzzlertRomInfo, sg1k_guzzlertRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Hang-On II (Jpn) - -static struct BurnRomInfo sg1k_hangon2RomDesc[] = { - { "hang-on ii (japan).bin", 0x08000, 0x9be3c6bd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_hangon2) -STD_ROM_FN(sg1k_hangon2) - -struct BurnDriver BurnDrvsg1k_hangon2 = { - "sg1k_hangon2", NULL, NULL, NULL, "1985", - "Hang-On II (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_hangon2RomInfo, sg1k_hangon2RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Hang-On II (Tw) - -static struct BurnRomInfo sg1k_hangon2t1RomDesc[] = { - { "hang-on ii [english logo] (tw).bin", 0x08000, 0xcabd451b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_hangon2t1) -STD_ROM_FN(sg1k_hangon2t1) - -struct BurnDriver BurnDrvsg1k_hangon2t1 = { - "sg1k_hangon2t1", "sg1k_hangon2", NULL, NULL, "1985?", - "Hang-On II (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_hangon2t1RomInfo, sg1k_hangon2t1RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Motuo Feiche (Tw) - -static struct BurnRomInfo sg1k_hangon2t2RomDesc[] = { - { "hang-on ii [chinese logo] (tw).bin", 0x08000, 0xe98a111e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_hangon2t2) -STD_ROM_FN(sg1k_hangon2t2) - -struct BurnDriver BurnDrvsg1k_hangon2t2 = { - "sg1k_hangon2t2", "sg1k_hangon2", NULL, NULL, "1985?", - "Motuo Feiche (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_hangon2t2RomInfo, sg1k_hangon2t2RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// H.E.R.O. (Jpn) - -static struct BurnRomInfo sg1k_heroRomDesc[] = { - { "h.e.r.o. (japan).bin", 0x08000, 0x4587de6e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_hero) -STD_ROM_FN(sg1k_hero) - -struct BurnDriver BurnDrvsg1k_hero = { - "sg1k_hero", NULL, NULL, NULL, "1985", - "H.E.R.O. (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_heroRomInfo, sg1k_heroRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Qing Feng Xia (Tw) - -static struct BurnRomInfo sg1k_herotRomDesc[] = { - { "h.e.r.o. (tw).bin", 0x08000, 0x83958998, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_herot) -STD_ROM_FN(sg1k_herot) - -struct BurnDriver BurnDrvsg1k_herot = { - "sg1k_herot", "sg1k_hero", NULL, NULL, "1985?", - "Qing Feng Xia (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_herotRomInfo, sg1k_herotRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Home Mahjong (Jpn, v1) - -static struct BurnRomInfo sg1k_homemjRomDesc[] = { - { "home mahjong (japan) (v1.1).bin", 0x0c000, 0xe7e0f0e3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_homemj) -STD_ROM_FN(sg1k_homemj) - -struct BurnDriver BurnDrvsg1k_homemj = { - "sg1k_homemj", "sg1k_mahjong", NULL, NULL, "1984", - "Home Mahjong (Jpn, v1)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_homemjRomInfo, sg1k_homemjRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Home Mahjong (Jpn, v0) - -static struct BurnRomInfo sg1k_homemj1RomDesc[] = { - { "home mahjong (japan) (v1.0).bin", 0x0c000, 0xc9d1ae7d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_homemj1) -STD_ROM_FN(sg1k_homemj1) - -struct BurnDriver BurnDrvsg1k_homemj1 = { - "sg1k_homemj1", "sg1k_mahjong", NULL, NULL, "1984", - "Home Mahjong (Jpn, v0)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_homemj1RomInfo, sg1k_homemj1RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Yon-nin Mahjong (Tw) - -static struct BurnRomInfo sg1k_homemjtRomDesc[] = { - { "home mahjong (tw).bin", 0x0c000, 0x0583a9fa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_homemjt) -STD_ROM_FN(sg1k_homemjt) - -struct BurnDriver BurnDrvsg1k_homemjt = { - "sg1k_homemjt", "sg1k_mahjong", NULL, NULL, "1984?", - "Yon-nin Mahjong (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_homemjtRomInfo, sg1k_homemjtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Hustle Chumy (Jpn) - -static struct BurnRomInfo sg1k_hustleRomDesc[] = { - { "hustle chumy (japan).bin", 0x04000, 0xa627d440, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_hustle) -STD_ROM_FN(sg1k_hustle) - -struct BurnDriver BurnDrvsg1k_hustle = { - "sg1k_hustle", NULL, NULL, NULL, "1984", - "Hustle Chumy (Jpn)\0", NULL, "Compile", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_hustleRomInfo, sg1k_hustleRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Hyper Sports (Jpn) - -static struct BurnRomInfo sg1k_hypersptRomDesc[] = { - { "mpr-6487.ic1", 0x08000, 0xba09a0fd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_hyperspt) -STD_ROM_FN(sg1k_hyperspt) - -struct BurnDriver BurnDrvsg1k_hyperspt = { - "sg1k_hyperspt", NULL, NULL, NULL, "1985", - "Hyper Sports (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_hypersptRomInfo, sg1k_hypersptRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Hyper Sports (Tw) - -static struct BurnRomInfo sg1k_hyperspttRomDesc[] = { - { "hyper sports (tw).bin", 0x08000, 0x87619ac2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_hypersptt) -STD_ROM_FN(sg1k_hypersptt) - -struct BurnDriver BurnDrvsg1k_hypersptt = { - "sg1k_hypersptt", "sg1k_hyperspt", NULL, NULL, "1985?", - "Hyper Sports (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_hyperspttRomInfo, sg1k_hyperspttRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Hyper Sports (Kor) - -static struct BurnRomInfo sg1k_hypersptkRomDesc[] = { - { "hyper sports (kr).bin", 0x08000, 0x3157ef9c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_hypersptk) -STD_ROM_FN(sg1k_hypersptk) - -struct BurnDriver BurnDrvsg1k_hypersptk = { - "sg1k_hypersptk", "sg1k_hyperspt", NULL, NULL, "198?", - "Hyper Sports (Kor)\0", NULL, "Samsung", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_hypersptkRomInfo, sg1k_hypersptkRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Hyper Sports 2 (Tw) - -static struct BurnRomInfo sg1k_hypersp2RomDesc[] = { - { "hyper sports 2 (tw).bin", 0x08000, 0xb0234e12, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_hypersp2) -STD_ROM_FN(sg1k_hypersp2) - -struct BurnDriver BurnDrvsg1k_hypersp2 = { - "sg1k_hypersp2", NULL, NULL, NULL, "198?", - "Hyper Sports 2 (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_hypersp2RomInfo, sg1k_hypersp2RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// 007 James Bond (Jpn, v2.7, OMV) - -static struct BurnRomInfo sg1k_jb007RomDesc[] = { - { "james bond 007 (japan) (v2.7) (om).bin", 0x04000, 0x90160849, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_jb007) -STD_ROM_FN(sg1k_jb007) - -struct BurnDriver BurnDrvsg1k_jb007 = { - "sg1k_jb007", NULL, NULL, NULL, "1984", - "007 James Bond (Jpn, v2.7, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_jb007RomInfo, sg1k_jb007RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// 007 James Bond (Jpn, v2.6, OMV) - -static struct BurnRomInfo sg1k_jb007aRomDesc[] = { - { "007 james bond [v2.6] [40k map].bin", 0x0a000, 0xa8b5b57f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_jb007a) -STD_ROM_FN(sg1k_jb007a) - -struct BurnDriver BurnDrvsg1k_jb007a = { - "sg1k_jb007a", "sg1k_jb007", NULL, NULL, "1984", - "007 James Bond (Jpn, v2.6, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_jb007aRomInfo, sg1k_jb007aRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// 007 James Bond (Tw) - -static struct BurnRomInfo sg1k_jb007tRomDesc[] = { - { "james bond 007 (tw).bin", 0x04000, 0x76d6c64d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_jb007t) -STD_ROM_FN(sg1k_jb007t) - -struct BurnDriver BurnDrvsg1k_jb007t = { - "sg1k_jb007t", "sg1k_jb007", NULL, NULL, "1984?", - "007 James Bond (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_jb007tRomInfo, sg1k_jb007tRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Jinzita (Tw) - -static struct BurnRomInfo sg1k_jinzitaRomDesc[] = { - { "king's valley (tw).bin", 0x08000, 0x223397a1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_jinzita) -STD_ROM_FN(sg1k_jinzita) - -struct BurnDriver BurnDrvsg1k_jinzita = { - "sg1k_jinzita", NULL, NULL, NULL, "198?", - "King's Valley, Jinzita (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_jinzitaRomInfo, sg1k_jinzitaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Lode Runner (Euro, Jpn) - -static struct BurnRomInfo sg1k_ldrunRomDesc[] = { - { "mpr-5998.ic1", 0x08000, 0x00ed3970, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_ldrun) -STD_ROM_FN(sg1k_ldrun) - -struct BurnDriver BurnDrvsg1k_ldrun = { - "sg1k_ldrun", NULL, NULL, NULL, "1984", - "Lode Runner (Euro, Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_ldrunRomInfo, sg1k_ldrunRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Lode Runner (Kor) - -static struct BurnRomInfo sg1k_ldrunkRomDesc[] = { - { "lode runner (kr).bin", 0x08000, 0xe68bc7d6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_ldrunk) -STD_ROM_FN(sg1k_ldrunk) - -struct BurnDriver BurnDrvsg1k_ldrunk = { - "sg1k_ldrunk", "sg1k_ldrun", NULL, NULL, "1984?", - "Lode Runner (Kor)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_ldrunkRomInfo, sg1k_ldrunkRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Lode Runner (Tw) - -static struct BurnRomInfo sg1k_ldruntRomDesc[] = { - { "lode runner (tw).bin", 0x08000, 0xd953bdb7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_ldrunt) -STD_ROM_FN(sg1k_ldrunt) - -struct BurnDriver BurnDrvsg1k_ldrunt = { - "sg1k_ldrunt", "sg1k_ldrun", NULL, NULL, "1984?", - "Lode Runner (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_ldruntRomInfo, sg1k_ldruntRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// SG-1000 M2 Check Program - -static struct BurnRomInfo sg1k_m2cpRomDesc[] = { - { "sg-1000 m2 check program.bin", 0x02000, 0x207e7e99, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_m2cp) -STD_ROM_FN(sg1k_m2cp) - -struct BurnDriver BurnDrvsg1k_m2cp = { - "sg1k_m2cp", NULL, NULL, NULL, "1984", - "SG-1000 M2 Check Program\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_m2cpRomInfo, sg1k_m2cpRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Magical Tree (Tw) - -static struct BurnRomInfo sg1k_magtreeRomDesc[] = { - { "magical tree (tw).bin", 0x08000, 0xb3a8291a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_magtree) -STD_ROM_FN(sg1k_magtree) - -struct BurnDriver BurnDrvsg1k_magtree = { - "sg1k_magtree", NULL, NULL, NULL, "198?", - "Magical Tree (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_magtreeRomInfo, sg1k_magtreeRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Magical Kid Wiz (Tw) - -static struct BurnRomInfo sg1k_mkidwizRomDesc[] = { - { "magical kid wiz (tw).bin", 0x0c000, 0xffc4ee3f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_mkidwiz) -STD_ROM_FN(sg1k_mkidwiz) - -struct BurnDriver BurnDrvsg1k_mkidwiz = { - "sg1k_mkidwiz", NULL, NULL, NULL, "198?", - "Magical Kid Wiz (Tw)\0", "Stuck at boot logo?", "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_mkidwizRomInfo, sg1k_mkidwizRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mahjong (Jpn) - -static struct BurnRomInfo sg1k_mahjongRomDesc[] = { - { "mahjong (japan).bin", 0x06000, 0x6d909857, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_mahjong) -STD_ROM_FN(sg1k_mahjong) - -struct BurnDriver BurnDrvsg1k_mahjong = { - "sg1k_mahjong", NULL, NULL, NULL, "1983", - "Mahjong (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_mahjongRomInfo, sg1k_mahjongRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mahjong (Jpn, Alt) - -static struct BurnRomInfo sg1k_mahjongaRomDesc[] = { - { "mahjong [big 1983].bin", 0x06000, 0x1c137cab, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_mahjonga) -STD_ROM_FN(sg1k_mahjonga) - -struct BurnDriver BurnDrvsg1k_mahjonga = { - "sg1k_mahjonga", "sg1k_mahjong", NULL, NULL, "1983", - "Mahjong (Jpn, Alt)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_mahjongaRomInfo, sg1k_mahjongaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mahjong (Tw) - -static struct BurnRomInfo sg1k_mahjongtRomDesc[] = { - { "mahjong (tw).bin", 0x06000, 0xbc823a89, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_mahjongt) -STD_ROM_FN(sg1k_mahjongt) - -struct BurnDriver BurnDrvsg1k_mahjongt = { - "sg1k_mahjongt", "sg1k_mahjong", NULL, NULL, "1983?", - "Mahjong (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_mahjongtRomInfo, sg1k_mahjongtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Monaco GP (Jpn, v2) - -static struct BurnRomInfo sg1k_monacogpRomDesc[] = { - { "monaco gp [32k] [v2].bin", 0x08000, 0x02e5d66a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_monacogp) -STD_ROM_FN(sg1k_monacogp) - -struct BurnDriver BurnDrvsg1k_monacogp = { - "sg1k_monacogp", NULL, NULL, NULL, "1983", - "Monaco GP (Jpn, v2)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_monacogpRomInfo, sg1k_monacogpRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Monaco GP (Jpn, v1) - -static struct BurnRomInfo sg1k_monacogpaRomDesc[] = { - { "monaco gp [32k].bin", 0x08000, 0xda2d57f3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_monacogpa) -STD_ROM_FN(sg1k_monacogpa) - -struct BurnDriver BurnDrvsg1k_monacogpa = { - "sg1k_monacogpa", "sg1k_monacogp", NULL, NULL, "1983", - "Monaco GP (Jpn, v1)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_monacogpaRomInfo, sg1k_monacogpaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Monaco GP (Jpn, v0) - -static struct BurnRomInfo sg1k_monacogpbRomDesc[] = { - { "monaco gp [24k].bin", 0x0a000, 0x8572d73a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_monacogpb) -STD_ROM_FN(sg1k_monacogpb) - -struct BurnDriver BurnDrvsg1k_monacogpb = { - "sg1k_monacogpb", "sg1k_monacogp", NULL, NULL, "1983", - "Monaco GP (Jpn, v0)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_monacogpbRomInfo, sg1k_monacogpbRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Monaco GP (Tw) - -static struct BurnRomInfo sg1k_monacogptRomDesc[] = { - { "monaco gp (tw).bin", 0x08000, 0x01cda679, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_monacogpt) -STD_ROM_FN(sg1k_monacogpt) - -struct BurnDriver BurnDrvsg1k_monacogpt = { - "sg1k_monacogpt", "sg1k_monacogp", NULL, NULL, "1983?", - "Monaco GP (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_monacogptRomInfo, sg1k_monacogptRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Moyu Chuanqi (Tw) - -static struct BurnRomInfo sg1k_moyuchuaRomDesc[] = { - { "knightmare [jumbo] (tw).bin", 0x0c000, 0x281d2888, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_moyuchua) -STD_ROM_FN(sg1k_moyuchua) - -struct BurnDriver BurnDrvsg1k_moyuchua = { - "sg1k_moyuchua", NULL, NULL, NULL, "1986?", - "Knightmare, Moyu Chuanqi (Tw)\0", NULL, "Jumbo", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_moyuchuaRomInfo, sg1k_moyuchuaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Ninja Princess (Jpn) - -static struct BurnRomInfo sg1k_ninjapriRomDesc[] = { - { "ninja princess (japan).bin", 0x08000, 0x3b912408, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_ninjapri) -STD_ROM_FN(sg1k_ninjapri) - -struct BurnDriver BurnDrvsg1k_ninjapri = { - "sg1k_ninjapri", NULL, NULL, NULL, "1986", - "Ninja Princess (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_ninjapriRomInfo, sg1k_ninjapriRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Renzhe Gongzhu (Tw) - -static struct BurnRomInfo sg1k_ninjapritRomDesc[] = { - { "ninja princess (tw).bin", 0x08000, 0x464d144b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_ninjaprit) -STD_ROM_FN(sg1k_ninjaprit) - -struct BurnDriver BurnDrvsg1k_ninjaprit = { - "sg1k_ninjaprit", "sg1k_ninjapri", NULL, NULL, "1986?", - "Renzhe Gongzhu (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_ninjapritRomInfo, sg1k_ninjapritRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// N-Sub (Euro?) - -static struct BurnRomInfo sg1k_nsubRomDesc[] = { - { "n-sub (europe) (1988).bin", 0x04000, 0x09196fc5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_nsub) -STD_ROM_FN(sg1k_nsub) - -struct BurnDriver BurnDrvsg1k_nsub = { - "sg1k_nsub", NULL, NULL, NULL, "1988", - "N-Sub (Euro?)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_nsubRomInfo, sg1k_nsubRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// N-Sub (Jpn) - -static struct BurnRomInfo sg1k_nsubaRomDesc[] = { - { "n-sub [16k].bin", 0x04000, 0x652bbd1e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_nsuba) -STD_ROM_FN(sg1k_nsuba) - -struct BurnDriver BurnDrvsg1k_nsuba = { - "sg1k_nsuba", "sg1k_nsub", NULL, NULL, "1983", - "N-Sub (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_nsubaRomInfo, sg1k_nsubaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// N-Sub (Jpn, Alt) - -static struct BurnRomInfo sg1k_nsubbRomDesc[] = { - { "n-sub [40k].bin", 0x0a000, 0xb377d6e1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_nsubb) -STD_ROM_FN(sg1k_nsubb) - -struct BurnDriver BurnDrvsg1k_nsubb = { - "sg1k_nsubb", "sg1k_nsub", NULL, NULL, "1983", - "N-Sub (Jpn, Alt)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_nsubbRomInfo, sg1k_nsubbRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// N-Sub (Tw) - -static struct BurnRomInfo sg1k_nsubtRomDesc[] = { - { "n-sub (tw).bin", 0x04000, 0x3e371769, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_nsubt) -STD_ROM_FN(sg1k_nsubt) - -struct BurnDriver BurnDrvsg1k_nsubt = { - "sg1k_nsubt", "sg1k_nsub", NULL, NULL, "1983?", - "N-Sub (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_nsubtRomInfo, sg1k_nsubtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Okamoto Ayako no Match Play Golf (Jpn, OMV) - -static struct BurnRomInfo sg1k_matchpgRomDesc[] = { - { "okamoto ayako no match play golf [b] (jp).bin", 0x08000, 0x49d3db2c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_matchpg) -STD_ROM_FN(sg1k_matchpg) - -struct BurnDriver BurnDrvsg1k_matchpg = { - "sg1k_matchpg", NULL, NULL, NULL, "1984?", - "Okamoto Ayako no Match Play Golf (Jpn, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_matchpgRomInfo, sg1k_matchpgRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Okamoto Ayako no Match Play Golf (Jpn, OMV, Alt) - -static struct BurnRomInfo sg1k_matchpgaRomDesc[] = { - { "okamoto ayako no match play golf [a] (jp).bin", 0x08000, 0x547dd7fd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_matchpga) -STD_ROM_FN(sg1k_matchpga) - -struct BurnDriver BurnDrvsg1k_matchpga = { - "sg1k_matchpga", "sg1k_matchpg", NULL, NULL, "1984?", - "Okamoto Ayako no Match Play Golf (Jpn, OMV, Alt)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_matchpgaRomInfo, sg1k_matchpgaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Okamoto Ayako no Match Play Golf (Tw) - -static struct BurnRomInfo sg1k_matchpgtRomDesc[] = { - { "okamoto ayako no match play golf (tw).bin", 0x08000, 0xb60492d5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_matchpgt) -STD_ROM_FN(sg1k_matchpgt) - -struct BurnDriver BurnDrvsg1k_matchpgt = { - "sg1k_matchpgt", "sg1k_matchpg", NULL, NULL, "1984?", - "Okamoto Ayako no Match Play Golf (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_matchpgtRomInfo, sg1k_matchpgtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Orguss (Euro, Jpn) - -static struct BurnRomInfo sg1k_orgussRomDesc[] = { - { "mpr-5743.ic1", 0x08000, 0xf4f78b76, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_orguss) -STD_ROM_FN(sg1k_orguss) - -struct BurnDriver BurnDrvsg1k_orguss = { - "sg1k_orguss", NULL, NULL, NULL, "1984", - "Orguss (Euro, Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_orgussRomInfo, sg1k_orgussRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Othello (Jpn) - -static struct BurnRomInfo sg1k_othelloRomDesc[] = { - { "othello (japan).bin", 0x08000, 0xaf4f14bc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_othello) -STD_ROM_FN(sg1k_othello) - -struct BurnDriver BurnDrvsg1k_othello = { - "sg1k_othello", NULL, NULL, NULL, "1985", - "Othello (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_othelloRomInfo, sg1k_othelloRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Hei Bai Qi (Tw) - -static struct BurnRomInfo sg1k_heibaiqiRomDesc[] = { - { "othello (tw).bin", 0x08000, 0x1d1a0ca3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_heibaiqi) -STD_ROM_FN(sg1k_heibaiqi) - -struct BurnDriver BurnDrvsg1k_heibaiqi = { - "sg1k_heibaiqi", "sg1k_othello", NULL, NULL, "1985?", - "Hei Bai Qi (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_heibaiqiRomInfo, sg1k_heibaiqiRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pacar (Euro, Jpn) - -static struct BurnRomInfo sg1k_pacarRomDesc[] = { - { "mpr-5556.ic1", 0x04000, 0x30c52e5e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_pacar) -STD_ROM_FN(sg1k_pacar) - -struct BurnDriver BurnDrvsg1k_pacar = { - "sg1k_pacar", NULL, NULL, NULL, "1983", - "Pacar (Euro, Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_pacarRomInfo, sg1k_pacarRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pacar (Jpn, Alt) - -static struct BurnRomInfo sg1k_pacaraRomDesc[] = { - { "pacar [40k map].bin", 0x0a000, 0x19949375, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_pacara) -STD_ROM_FN(sg1k_pacara) - -struct BurnDriver BurnDrvsg1k_pacara = { - "sg1k_pacara", "sg1k_pacar", NULL, NULL, "1983", - "Pacar (Jpn, Alt)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_pacaraRomInfo, sg1k_pacaraRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pacar (Tw) - -static struct BurnRomInfo sg1k_pacartRomDesc[] = { - { "pacar (tw).bin", 0x04000, 0xdd6817a0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_pacart) -STD_ROM_FN(sg1k_pacart) - -struct BurnDriver BurnDrvsg1k_pacart = { - "sg1k_pacart", "sg1k_pacar", NULL, NULL, "1983?", - "Pacar (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_pacartRomInfo, sg1k_pacartRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pachinko II (Jpn) - -static struct BurnRomInfo sg1k_pachink2RomDesc[] = { - { "pachinko ii (japan).bin", 0x04000, 0xfd7cb50a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_pachink2) -STD_ROM_FN(sg1k_pachink2) - -struct BurnDriver BurnDrvsg1k_pachink2 = { - "sg1k_pachink2", NULL, NULL, NULL, "1984", - "Pachinko II (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_pachink2RomInfo, sg1k_pachink2RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pachinko II (Tw) - -static struct BurnRomInfo sg1k_pachink2tRomDesc[] = { - { "pachinko ii (tw).bin", 0x04000, 0x6ebe81bf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_pachink2t) -STD_ROM_FN(sg1k_pachink2t) - -struct BurnDriver BurnDrvsg1k_pachink2t = { - "sg1k_pachink2t", "sg1k_pachink2", NULL, NULL, "1984?", - "Pachinko II (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_pachink2tRomInfo, sg1k_pachink2tRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pachinko (Jpn) - -static struct BurnRomInfo sg1k_pachinkoRomDesc[] = { - { "pachinko (japan).bin", 0x0a000, 0x326587e1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_pachinko) -STD_ROM_FN(sg1k_pachinko) - -struct BurnDriver BurnDrvsg1k_pachinko = { - "sg1k_pachinko", NULL, NULL, NULL, "1983", - "Pachinko (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_pachinkoRomInfo, sg1k_pachinkoRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Ping Pong (Tw) - -static struct BurnRomInfo sg1k_pingpongRomDesc[] = { - { "ping pong (konami's) (tw).bin", 0x08000, 0x4d972a9e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_pingpong) -STD_ROM_FN(sg1k_pingpong) - -struct BurnDriver BurnDrvsg1k_pingpong = { - "sg1k_pingpong", NULL, NULL, NULL, "1985?", - "Ping Pong (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_pingpongRomInfo, sg1k_pingpongRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pitfall II - The Lost Caverns (Jpn, v0) - -static struct BurnRomInfo sg1k_pitfall2aRomDesc[] = { - { "pitfall ii - the lost caverns (japan).bin", 0x08000, 0x37fca2eb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_pitfall2a) -STD_ROM_FN(sg1k_pitfall2a) - -struct BurnDriver BurnDrvsg1k_pitfall2a = { - "sg1k_pitfall2a", "sg1k_pitfall2", NULL, NULL, "1985", - "Pitfall II - The Lost Caverns (Jpn, v0)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_pitfall2aRomInfo, sg1k_pitfall2aRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pitfall II - The Lost Caverns (Jpn, v1) - -static struct BurnRomInfo sg1k_pitfall2RomDesc[] = { - { "pitfall ii - the lost caverns (japan) (alt).bin", 0x08000, 0x3db74761, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_pitfall2) -STD_ROM_FN(sg1k_pitfall2) - -struct BurnDriver BurnDrvsg1k_pitfall2 = { - "sg1k_pitfall2", NULL, NULL, NULL, "1985", - "Pitfall II - The Lost Caverns (Jpn, v1)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_pitfall2RomInfo, sg1k_pitfall2RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Fa Gui Qibing (Tw) - -static struct BurnRomInfo sg1k_faguiqibRomDesc[] = { - { "pitfall ii [v0] [chinese logo] (tw).bin", 0x08000, 0x476a079b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_faguiqib) -STD_ROM_FN(sg1k_faguiqib) - -struct BurnDriver BurnDrvsg1k_faguiqib = { - "sg1k_faguiqib", "sg1k_pitfall2", NULL, NULL, "1985?", - "Fa Gui Qibing (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_faguiqibRomInfo, sg1k_faguiqibRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Fa Gui Qibing (Tw, Alt) - -static struct BurnRomInfo sg1k_faguiqibaRomDesc[] = { - { "pitfall ii [v0] [english logo] (tw).bin", 0x08000, 0x4e93bc8e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_faguiqiba) -STD_ROM_FN(sg1k_faguiqiba) - -struct BurnDriver BurnDrvsg1k_faguiqiba = { - "sg1k_faguiqiba", "sg1k_pitfall2", NULL, NULL, "1985?", - "Fa Gui Qibing (Tw, Alt)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_faguiqibaRomInfo, sg1k_faguiqibaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pop Flamer (Euro, Jpn) - -static struct BurnRomInfo sg1k_popflameRomDesc[] = { - { "pop flamer (japan, europe).bin", 0x04000, 0xdb6404ba, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_popflame) -STD_ROM_FN(sg1k_popflame) - -struct BurnDriver BurnDrvsg1k_popflame = { - "sg1k_popflame", NULL, NULL, NULL, "1983", - "Pop Flamer (Euro, Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_popflameRomInfo, sg1k_popflameRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Pop Flamer (Tw) - -static struct BurnRomInfo sg1k_popflametRomDesc[] = { - { "pop flamer (tw).bin", 0x04000, 0xab1da8a6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_popflamet) -STD_ROM_FN(sg1k_popflamet) - -struct BurnDriver BurnDrvsg1k_popflamet = { - "sg1k_popflamet", "sg1k_popflame", NULL, NULL, "1983?", - "Pop Flamer (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_popflametRomInfo, sg1k_popflametRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Q*bert (Jpn, OMV) - -static struct BurnRomInfo sg1k_qbertRomDesc[] = { - { "q-bert (japan) (om).bin", 0x02000, 0x77db4704, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_qbert) -STD_ROM_FN(sg1k_qbert) - -struct BurnDriver BurnDrvsg1k_qbert = { - "sg1k_qbert", NULL, NULL, NULL, "1983", - "Q*bert (Jpn, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_qbertRomInfo, sg1k_qbertRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Rally-X (Tw) - -static struct BurnRomInfo sg1k_rallyxRomDesc[] = { - { "rally-x (tw).bin", 0x08000, 0xaaac12cf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_rallyx) -STD_ROM_FN(sg1k_rallyx) - -struct BurnDriver BurnDrvsg1k_rallyx = { - "sg1k_rallyx", NULL, NULL, NULL, "1986?", - "Rally-X (Tw)\0", NULL, "DahJee", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_rallyxRomInfo, sg1k_rallyxRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Road Fighter (Tw) - -static struct BurnRomInfo sg1k_roadfghtRomDesc[] = { - { "road fighter (tw).bin", 0x08000, 0xd2edd329, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_roadfght) -STD_ROM_FN(sg1k_roadfght) - -struct BurnDriver BurnDrvsg1k_roadfght = { - "sg1k_roadfght", NULL, NULL, NULL, "1986?", - "Road Fighter (Tw)\0", NULL, "Jumbo?", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_roadfghtRomInfo, sg1k_roadfghtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Huojian Che (Tw) - -static struct BurnRomInfo sg1k_huojicheRomDesc[] = { - { "road fighter [jumbo] (tw).bin", 0x08000, 0x29e047cc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_huojiche) -STD_ROM_FN(sg1k_huojiche) - -struct BurnDriver BurnDrvsg1k_huojiche = { - "sg1k_huojiche", "sg1k_roadfght", NULL, NULL, "1986?", - "Huojian Che (Tw)\0", NULL, "Jumbo", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_huojicheRomInfo, sg1k_huojicheRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Rock n' Bolt (Jpn) - -static struct BurnRomInfo sg1k_rocknbolRomDesc[] = { - { "rock n' bolt (japan).bin", 0x08000, 0x0ffdd03d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_rocknbol) -STD_ROM_FN(sg1k_rocknbol) - -struct BurnDriver BurnDrvsg1k_rocknbol = { - "sg1k_rocknbol", NULL, NULL, NULL, "1985", - "Rock n' Bolt (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_rocknbolRomInfo, sg1k_rocknbolRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Mo Tian Da Lou (Tw) - -static struct BurnRomInfo sg1k_motiandaRomDesc[] = { - { "rock n' bolt (tw).bin", 0x08000, 0x4eacb981, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_motianda) -STD_ROM_FN(sg1k_motianda) - -struct BurnDriver BurnDrvsg1k_motianda = { - "sg1k_motianda", "sg1k_rocknbol", NULL, NULL, "1985?", - "Mo Tian Da Lou (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_motiandaRomInfo, sg1k_motiandaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Safari Hunting (Jpn) - -static struct BurnRomInfo sg1k_safarihuRomDesc[] = { - { "safari hunting (japan).bin", 0x04000, 0x49e9718b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_safarihu) -STD_ROM_FN(sg1k_safarihu) - -struct BurnDriver BurnDrvsg1k_safarihu = { - "sg1k_safarihu", NULL, NULL, NULL, "1983", - "Safari Hunting (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_safarihuRomInfo, sg1k_safarihuRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Safari Hunting (Tw) - -static struct BurnRomInfo sg1k_safarihutRomDesc[] = { - { "safari hunting (tw).bin", 0x04000, 0x6dc51c01, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_safarihut) -STD_ROM_FN(sg1k_safarihut) - -struct BurnDriver BurnDrvsg1k_safarihut = { - "sg1k_safarihut", "sg1k_safarihu", NULL, NULL, "1983?", - "Safari Hunting (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - 0 | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_safarihutRomInfo, sg1k_safarihutRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Safari Race (Euro?) - -static struct BurnRomInfo sg1k_safarircRomDesc[] = { - { "safari race [1988].bin", 0x08000, 0x619dd066, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_safarirc) -STD_ROM_FN(sg1k_safarirc) - -struct BurnDriver BurnDrvsg1k_safarirc = { - "sg1k_safarirc", NULL, NULL, NULL, "1988", - "Safari Race (Euro?)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_safarircRomInfo, sg1k_safarircRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Safari Race (Jpn) - -static struct BurnRomInfo sg1k_safarircjRomDesc[] = { - { "mpr-5977.ic1", 0x08000, 0x08707fe3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_safarircj) -STD_ROM_FN(sg1k_safarircj) - -struct BurnDriver BurnDrvsg1k_safarircj = { - "sg1k_safarircj", "sg1k_safarirc", NULL, NULL, "1984", - "Safari Race (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_safarircjRomInfo, sg1k_safarircjRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Safari Race (Tw) - -static struct BurnRomInfo sg1k_safarirctRomDesc[] = { - { "safari race (tw).bin", 0x08000, 0xb2724428, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_safarirct) -STD_ROM_FN(sg1k_safarirct) - -struct BurnDriver BurnDrvsg1k_safarirct = { - "sg1k_safarirct", "sg1k_safarirc", NULL, NULL, "1984?", - "Safari Race (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_safarirctRomInfo, sg1k_safarirctRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sega Flipper (Euro, Jpn) - -static struct BurnRomInfo sg1k_segaflipRomDesc[] = { - { "sega flipper (japan, europe).bin", 0x04000, 0x8efc77bc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_segaflip) -STD_ROM_FN(sg1k_segaflip) - -struct BurnDriver BurnDrvsg1k_segaflip = { - "sg1k_segaflip", NULL, NULL, NULL, "1983", - "Sega Flipper (Euro, Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_segaflipRomInfo, sg1k_segaflipRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sega Flipper (Jpn, Alt) - -static struct BurnRomInfo sg1k_segaflipaRomDesc[] = { - { "sega flipper [40k map].bin", 0x0a000, 0xfd76ad99, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_segaflipa) -STD_ROM_FN(sg1k_segaflipa) - -struct BurnDriver BurnDrvsg1k_segaflipa = { - "sg1k_segaflipa", "sg1k_segaflip", NULL, NULL, "1983", - "Sega Flipper (Jpn, Alt)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_segaflipaRomInfo, sg1k_segaflipaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Flipper (Tw) - -static struct BurnRomInfo sg1k_segafliptRomDesc[] = { - { "sega flipper (tw).bin", 0x04000, 0x042c36ba, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_segaflipt) -STD_ROM_FN(sg1k_segaflipt) - -struct BurnDriver BurnDrvsg1k_segaflipt = { - "sg1k_segaflipt", "sg1k_segaflip", NULL, NULL, "1984?", - "Flipper (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_segafliptRomInfo, sg1k_segafliptRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sega-Galaga (Jpn) - -static struct BurnRomInfo sg1k_segagalaRomDesc[] = { - { "sega-galaga (japan).bin", 0x04000, 0x981e36c1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_segagala) -STD_ROM_FN(sg1k_segagala) - -struct BurnDriver BurnDrvsg1k_segagala = { - "sg1k_segagala", NULL, NULL, NULL, "1983", - "Sega-Galaga (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_segagalaRomInfo, sg1k_segagalaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sega-Galaga (Jpn, Alt) - -static struct BurnRomInfo sg1k_segagala1RomDesc[] = { - { "sega-galaga [40k map].bin", 0x0a000, 0x31283003, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_segagala1) -STD_ROM_FN(sg1k_segagala1) - -struct BurnDriver BurnDrvsg1k_segagala1 = { - "sg1k_segagala1", "sg1k_segagala", NULL, NULL, "1983", - "Sega-Galaga (Jpn, Alt)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_segagala1RomInfo, sg1k_segagala1RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Galaga (Tw) - -static struct BurnRomInfo sg1k_galagaRomDesc[] = { - { "galaga (tw).bin", 0x04000, 0x845bbb22, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_galaga) -STD_ROM_FN(sg1k_galaga) - -struct BurnDriver BurnDrvsg1k_galaga = { - "sg1k_galaga", "sg1k_segagala", NULL, NULL, "1983?", - "Galaga (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_galagaRomInfo, sg1k_galagaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Serizawa Hachidan no Tsumeshogi (Jpn) - -static struct BurnRomInfo sg1k_serizawaRomDesc[] = { - { "serizawa hachidan no tsumeshogi (japan).bin", 0x04000, 0x545fc9bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_serizawa) -STD_ROM_FN(sg1k_serizawa) - -struct BurnDriver BurnDrvsg1k_serizawa = { - "sg1k_serizawa", NULL, NULL, NULL, "1983", - "Serizawa Hachidan no Tsumeshogi (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_serizawaRomInfo, sg1k_serizawaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Shinnyushain Tooru Kun (Jpn) - -static struct BurnRomInfo sg1k_shinnyusRomDesc[] = { - { "shinnyushain tooru kun (japan).bin", 0x08000, 0x5a917e06, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_shinnyus) -STD_ROM_FN(sg1k_shinnyus) - -struct BurnDriver BurnDrvsg1k_shinnyus = { - "sg1k_shinnyus", NULL, NULL, NULL, "1985", - "Shinnyushain Tooru Kun (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_shinnyusRomInfo, sg1k_shinnyusRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Shinnyushain Tooru Kun (Tw) - -static struct BurnRomInfo sg1k_shinnyustRomDesc[] = { - { "shinnyushain tooru kun (tw).bin", 0x08000, 0x33fc5cf6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_shinnyust) -STD_ROM_FN(sg1k_shinnyust) - -struct BurnDriver BurnDrvsg1k_shinnyust = { - "sg1k_shinnyust", "sg1k_shinnyus", NULL, NULL, "19??", - "Shinnyushain Tooru Kun (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_shinnyustRomInfo, sg1k_shinnyustRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Shuangxiang Pao (Tw) - -static struct BurnRomInfo sg1k_sxpaoRomDesc[] = { - { "twinbee [jumbo] (tw).bin", 0x0c000, 0xc550b4f0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_sxpao) -STD_ROM_FN(sg1k_sxpao) - -struct BurnDriver BurnDrvsg1k_sxpao = { - "sg1k_sxpao", NULL, NULL, NULL, "1986?", - "Twinbee (Tw)\0", NULL, "Jumbo", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000 | HARDWARE_SEGA_SG1000_RAMEXP, GBF_MISC, 0, - SG1KGetZipName, sg1k_sxpaoRomInfo, sg1k_sxpaoRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sindbad Mystery (Euro, Jpn) - -static struct BurnRomInfo sg1k_sindbadmRomDesc[] = { - { "mpr-5546.ic1", 0x08000, 0x01932df9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_sindbadm) -STD_ROM_FN(sg1k_sindbadm) - -struct BurnDriver BurnDrvsg1k_sindbadm = { - "sg1k_sindbadm", NULL, NULL, NULL, "1983", - "Sindbad Mystery (Euro, Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_sindbadmRomInfo, sg1k_sindbadmRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Sindbad Mystery (Tw) - -static struct BurnRomInfo sg1k_sindbadmtRomDesc[] = { - { "sindbad mystery (tw).bin", 0x08000, 0x945f7847, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_sindbadmt) -STD_ROM_FN(sg1k_sindbadmt) - -struct BurnDriver BurnDrvsg1k_sindbadmt = { - "sg1k_sindbadmt", "sg1k_sindbadm", NULL, NULL, "1983?", - "Sindbad Mystery (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_sindbadmtRomInfo, sg1k_sindbadmtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Soukoban (Jpn) - -static struct BurnRomInfo sg1k_sokobanRomDesc[] = { - { "soukoban (japan).bin", 0x08000, 0x922c5468, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_sokoban) -STD_ROM_FN(sg1k_sokoban) - -struct BurnDriver BurnDrvsg1k_sokoban = { - "sg1k_sokoban", NULL, NULL, NULL, "1985", - "Soukoban (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_sokobanRomInfo, sg1k_sokobanRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Soukoban (Tw) - -static struct BurnRomInfo sg1k_sokobantRomDesc[] = { - { "soukoban (tw).bin", 0x08000, 0xa2c3fc97, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_sokobant) -STD_ROM_FN(sg1k_sokobant) - -struct BurnDriver BurnDrvsg1k_sokobant = { - "sg1k_sokobant", "sg1k_sokoban", NULL, NULL, "1985?", - "Soukoban (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_sokobantRomInfo, sg1k_sokobantRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Soukoban (Kor) - -static struct BurnRomInfo sg1k_sokobankRomDesc[] = { - { "soukoban (kr).bin", 0x08000, 0x148ea752, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_sokobank) -STD_ROM_FN(sg1k_sokobank) - -struct BurnDriver BurnDrvsg1k_sokobank = { - "sg1k_sokobank", "sg1k_sokoban", NULL, NULL, "1985?", - "Soukoban (Kor)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_sokobankRomInfo, sg1k_sokobankRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// I.Q. (Kor) - -static struct BurnRomInfo sg1k_iqRomDesc[] = { - { "soukoban [iq logo] (kr).bin", 0x08000, 0x89bafec5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_iq) -STD_ROM_FN(sg1k_iq) - -struct BurnDriver BurnDrvsg1k_iq = { - "sg1k_iq", "sg1k_sokoban", NULL, NULL, "1985?", - "I.Q. (Kor)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_iqRomInfo, sg1k_iqRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Space Armor (Jpn, v20, OMV) - -static struct BurnRomInfo sg1k_spacearmRomDesc[] = { - { "space armor [v2].bin", 0x04000, 0xac4f0a5c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_spacearm) -STD_ROM_FN(sg1k_spacearm) - -struct BurnDriver BurnDrvsg1k_spacearm = { - "sg1k_spacearm", NULL, NULL, NULL, "1984", - "Space Armor (Jpn, v20, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_spacearmRomInfo, sg1k_spacearmRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Space Armor (Jpn, v20, OMV, Alt) - -static struct BurnRomInfo sg1k_spacearmaRomDesc[] = { - { "space armor [v1].bin", 0x04000, 0xd5fdb4a3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_spacearma) -STD_ROM_FN(sg1k_spacearma) - -struct BurnDriver BurnDrvsg1k_spacearma = { - "sg1k_spacearma", "sg1k_spacearm", NULL, NULL, "1984", - "Space Armor (Jpn, v20, OMV, Alt)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_spacearmaRomInfo, sg1k_spacearmaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Space Armor (Jpn, v10, OMV) - -static struct BurnRomInfo sg1k_spacearmbRomDesc[] = { - { "space armor [v0] [40k map].bin", 0x0a000, 0xd23b0e3e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_spacearmb) -STD_ROM_FN(sg1k_spacearmb) - -struct BurnDriver BurnDrvsg1k_spacearmb = { - "sg1k_spacearmb", "sg1k_spacearm", NULL, NULL, "1984", - "Space Armor (Jpn, v10, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_spacearmbRomInfo, sg1k_spacearmbRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Space Invaders (Jpn) - -static struct BurnRomInfo sg1k_spaceinvRomDesc[] = { - { "space invaders (japan).bin", 0x04000, 0x6ad5cb3d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_spaceinv) -STD_ROM_FN(sg1k_spaceinv) - -struct BurnDriver BurnDrvsg1k_spaceinv = { - "sg1k_spaceinv", NULL, NULL, NULL, "1985", - "Space Invaders (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_spaceinvRomInfo, sg1k_spaceinvRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Space Invaders (Tw) - -static struct BurnRomInfo sg1k_spaceinvtRomDesc[] = { - { "space invaders (tw).bin", 0x04000, 0x0760ea93, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_spaceinvt) -STD_ROM_FN(sg1k_spaceinvt) - -struct BurnDriver BurnDrvsg1k_spaceinvt = { - "sg1k_spaceinvt", "sg1k_spaceinv", NULL, NULL, "1985?", - "Space Invaders (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_spaceinvtRomInfo, sg1k_spaceinvtRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Space Mountain (Jpn, OMV) - -static struct BurnRomInfo sg1k_spacemntRomDesc[] = { - { "space mountain (japan) (om).bin", 0x02000, 0xbbd87d8f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_spacemnt) -STD_ROM_FN(sg1k_spacemnt) - -struct BurnDriver BurnDrvsg1k_spacemnt = { - "sg1k_spacemnt", NULL, NULL, NULL, "1983", - "Space Mountain (Jpn, OMV)\0", NULL, "Tsukuda Original", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_spacemntRomInfo, sg1k_spacemntRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Space Slalom (Jpn) - -static struct BurnRomInfo sg1k_spaceslaRomDesc[] = { - { "space slalom (japan).bin", 0x02000, 0xb8b58b30, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_spacesla) -STD_ROM_FN(sg1k_spacesla) - -struct BurnDriver BurnDrvsg1k_spacesla = { - "sg1k_spacesla", NULL, NULL, NULL, "1983", - "Space Slalom (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_spaceslaRomInfo, sg1k_spaceslaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Star Force (Jpn) - -static struct BurnRomInfo sg1k_starfrceRomDesc[] = { - { "star force (japan).bin", 0x08000, 0xb846b52a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_starfrce) -STD_ROM_FN(sg1k_starfrce) - -struct BurnDriver BurnDrvsg1k_starfrce = { - "sg1k_starfrce", NULL, NULL, NULL, "1985", - "Star Force (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_starfrceRomInfo, sg1k_starfrceRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Star Force (Tw) - -static struct BurnRomInfo sg1k_starfrcetRomDesc[] = { - { "star force (tw).bin", 0x08000, 0x1f736931, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_starfrcet) -STD_ROM_FN(sg1k_starfrcet) - -struct BurnDriver BurnDrvsg1k_starfrcet = { - "sg1k_starfrcet", "sg1k_starfrce", NULL, NULL, "1985?", - "Star Force (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_starfrcetRomInfo, sg1k_starfrcetRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Star Force (Tw, Alt) - -static struct BurnRomInfo sg1k_starfrcetaRomDesc[] = { - { "star force [b] (tw).bin", 0x08000, 0x6f9b1ccd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_starfrceta) -STD_ROM_FN(sg1k_starfrceta) - -struct BurnDriver BurnDrvsg1k_starfrceta = { - "sg1k_starfrceta", "sg1k_starfrce", NULL, NULL, "1985?", - "Star Force (Tw, Alt)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_starfrcetaRomInfo, sg1k_starfrcetaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Star Jacker (Euro, Jpn, v1.2) - -static struct BurnRomInfo sg1k_starjackRomDesc[] = { - { "star jacker (japan, europe) (v1.2).bin", 0x08000, 0x3fe59505, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_starjack) -STD_ROM_FN(sg1k_starjack) - -struct BurnDriver BurnDrvsg1k_starjack = { - "sg1k_starjack", NULL, NULL, NULL, "1983", - "Star Jacker (Euro, Jpn, v1.2)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_starjackRomInfo, sg1k_starjackRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Star Jacker (Euro, Jpn, v1.1) - -static struct BurnRomInfo sg1k_starjack1RomDesc[] = { - { "star jacker (japan, europe) (v1.1).bin", 0x08000, 0x7f25deca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_starjack1) -STD_ROM_FN(sg1k_starjack1) - -struct BurnDriver BurnDrvsg1k_starjack1 = { - "sg1k_starjack1", "sg1k_starjack", NULL, NULL, "1983", - "Star Jacker (Euro, Jpn, v1.1)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_starjack1RomInfo, sg1k_starjack1RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Star Jacker (Jpn, v1.0) - -static struct BurnRomInfo sg1k_starjack2RomDesc[] = { - { "star jacker (japan) (v1.0).bin", 0x08000, 0x1ae94122, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_starjack2) -STD_ROM_FN(sg1k_starjack2) - -struct BurnDriver BurnDrvsg1k_starjack2 = { - "sg1k_starjack2", "sg1k_starjack", NULL, NULL, "1983", - "Star Jacker (Jpn, v1.0)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_starjack2RomInfo, sg1k_starjack2RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Star Jacker (Tw) - -static struct BurnRomInfo sg1k_starjacktRomDesc[] = { - { "star jacker [v1] (tw).bin", 0x08000, 0xdf162201, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_starjackt) -STD_ROM_FN(sg1k_starjackt) - -struct BurnDriver BurnDrvsg1k_starjackt = { - "sg1k_starjackt", "sg1k_starjack", NULL, NULL, "1983?", - "Star Jacker (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_starjacktRomInfo, sg1k_starjacktRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Tank (Jpn) - -static struct BurnRomInfo sg1k_supertnkRomDesc[] = { - { "super tank (japan).bin", 0x08000, 0x084cc13e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_supertnk) -STD_ROM_FN(sg1k_supertnk) - -struct BurnDriver BurnDrvsg1k_supertnk = { - "sg1k_supertnk", NULL, NULL, NULL, "1986", - "Super Tank (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_supertnkRomInfo, sg1k_supertnkRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Super Tank (Kor) - -static struct BurnRomInfo sg1k_supertnkkRomDesc[] = { - { "super tank (kr).bin", 0x08000, 0x4c48b7ac, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_supertnkk) -STD_ROM_FN(sg1k_supertnkk) - -struct BurnDriver BurnDrvsg1k_supertnkk = { - "sg1k_supertnkk", "sg1k_supertnk", NULL, NULL, "1986?", - "Super Tank (Kor)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_supertnkkRomInfo, sg1k_supertnkkRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Chaoji Tanke (Tw) - -static struct BurnRomInfo sg1k_supertnktRomDesc[] = { - { "super tank (tw).bin", 0x08000, 0xd0c3df3f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_supertnkt) -STD_ROM_FN(sg1k_supertnkt) - -struct BurnDriver BurnDrvsg1k_supertnkt = { - "sg1k_supertnkt", "sg1k_supertnk", NULL, NULL, "1986?", - "Chaoji Tanke (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_supertnktRomInfo, sg1k_supertnktRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Terebi Oekaki (Jpn) - -static struct BurnRomInfo sg1k_terebioeRomDesc[] = { - { "terebi oekaki (japan).bin", 0x02000, 0xdd4a661b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_terebioe) -STD_ROM_FN(sg1k_terebioe) - -struct BurnDriver BurnDrvsg1k_terebioe = { - "sg1k_terebioe", NULL, NULL, NULL, "1985", - "Terebi Oekaki (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_terebioeRomInfo, sg1k_terebioeRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Wonder Boy (Jpn, v1) - -static struct BurnRomInfo sg1k_wboyRomDesc[] = { - { "wonder boy [v1].bin", 0x08000, 0xe8f0344d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_wboy) -STD_ROM_FN(sg1k_wboy) - -struct BurnDriver BurnDrvsg1k_wboy = { - "sg1k_wboy", NULL, NULL, NULL, "1986", - "Wonder Boy (Jpn, v1)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_wboyRomInfo, sg1k_wboyRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Wonder Boy (Jpn, v0) - -static struct BurnRomInfo sg1k_wboyaRomDesc[] = { - { "wonder boy (japan).bin", 0x08000, 0x160535c5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_wboya) -STD_ROM_FN(sg1k_wboya) - -struct BurnDriver BurnDrvsg1k_wboya = { - "sg1k_wboya", "sg1k_wboy", NULL, NULL, "1986", - "Wonder Boy (Jpn, v0)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_wboyaRomInfo, sg1k_wboyaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Taotailang (Tw) - -static struct BurnRomInfo sg1k_wboytRomDesc[] = { - { "wonder boy [v1] (tw).bin", 0x08000, 0x953fc2b2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_wboyt) -STD_ROM_FN(sg1k_wboyt) - -struct BurnDriver BurnDrvsg1k_wboyt = { - "sg1k_wboyt", "sg1k_wboy", NULL, NULL, "1986?", - "Taotailang (Tw)\0", NULL, "Unknown", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_wboytRomInfo, sg1k_wboytRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Yamato (Euro, Jpn) - -static struct BurnRomInfo sg1k_yamatoRomDesc[] = { - { "yamato (japan, europe).bin", 0x04000, 0xe2fd5201, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_yamato) -STD_ROM_FN(sg1k_yamato) - -struct BurnDriver BurnDrvsg1k_yamato = { - "sg1k_yamato", NULL, NULL, NULL, "1983", - "Yamato (Euro, Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_yamatoRomInfo, sg1k_yamatoRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Yamato (Euro, Jpn, Alt) - -static struct BurnRomInfo sg1k_yamatoaRomDesc[] = { - { "yamato [40k map].bin", 0x0a000, 0x9c7497ff, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_yamatoa) -STD_ROM_FN(sg1k_yamatoa) - -struct BurnDriver BurnDrvsg1k_yamatoa = { - "sg1k_yamatoa", "sg1k_yamato", NULL, NULL, "1983", - "Yamato (Euro, Jpn, Alt)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_yamatoaRomInfo, sg1k_yamatoaRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Yamato (Tw) - -static struct BurnRomInfo sg1k_yamatotRomDesc[] = { - { "yamato (tw).bin", 0x04000, 0xb65a093f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_yamatot) -STD_ROM_FN(sg1k_yamatot) - -struct BurnDriver BurnDrvsg1k_yamatot = { - "sg1k_yamatot", "sg1k_yamato", NULL, NULL, "1983?", - "Yamato (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_yamatotRomInfo, sg1k_yamatotRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Yie Ar Kung-Fu (Tw) - -static struct BurnRomInfo sg1k_yiearRomDesc[] = { - { "yie ar kung-fu (tw).bin", 0x08000, 0xbb0f1930, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_yiear) -STD_ROM_FN(sg1k_yiear) - -struct BurnDriver BurnDrvsg1k_yiear = { - "sg1k_yiear", NULL, NULL, NULL, "1985?", - "Yie Ar Kung-Fu (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_yiearRomInfo, sg1k_yiearRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Zaxxon (Jpn) - -static struct BurnRomInfo sg1k_zaxxonRomDesc[] = { - { "zaxxon (japan).bin", 0x08000, 0x905467e4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_zaxxon) -STD_ROM_FN(sg1k_zaxxon) - -struct BurnDriver BurnDrvsg1k_zaxxon = { - "sg1k_zaxxon", NULL, NULL, NULL, "1985", - "Zaxxon (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_zaxxonRomInfo, sg1k_zaxxonRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Zaxxon (Tw) - -static struct BurnRomInfo sg1k_zaxxontRomDesc[] = { - { "zaxxon (tw).bin", 0x08000, 0x49cae925, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_zaxxont) -STD_ROM_FN(sg1k_zaxxont) - -struct BurnDriver BurnDrvsg1k_zaxxont = { - "sg1k_zaxxont", "sg1k_zaxxon", NULL, NULL, "1985?", - "Zaxxon (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_zaxxontRomInfo, sg1k_zaxxontRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Zippy Race (Jpn) - -static struct BurnRomInfo sg1k_zippyracRomDesc[] = { - { "zippy race (japan).bin", 0x08000, 0xbc5d20df, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_zippyrac) -STD_ROM_FN(sg1k_zippyrac) - -struct BurnDriver BurnDrvsg1k_zippyrac = { - "sg1k_zippyrac", NULL, NULL, NULL, "1983", - "Zippy Race (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_zippyracRomInfo, sg1k_zippyracRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Zippy Race (Tw) - -static struct BurnRomInfo sg1k_zippyractRomDesc[] = { - { "zippy race (tw).bin", 0x08000, 0xbcf441a5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_zippyract) -STD_ROM_FN(sg1k_zippyract) - -struct BurnDriver BurnDrvsg1k_zippyract = { - "sg1k_zippyract", "sg1k_zippyrac", NULL, NULL, "1983?", - "Zippy Race (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_zippyractRomInfo, sg1k_zippyractRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Zoom 909 (Jpn) - -static struct BurnRomInfo sg1k_zoom909RomDesc[] = { - { "zoom 909 (japan).bin", 0x08000, 0x093830d8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_zoom909) -STD_ROM_FN(sg1k_zoom909) - -struct BurnDriver BurnDrvsg1k_zoom909 = { - "sg1k_zoom909", NULL, NULL, NULL, "1985", - "Zoom 909 (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_zoom909RomInfo, sg1k_zoom909RomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Huo Hu Li (Tw) - -static struct BurnRomInfo sg1k_huohuliRomDesc[] = { - { "zoom 909 (tw).bin", 0x08000, 0x9943fc2b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_huohuli) -STD_ROM_FN(sg1k_huohuli) - -struct BurnDriver BurnDrvsg1k_huohuli = { - "sg1k_huohuli", "sg1k_zoom909", NULL, NULL, "1985?", - "Huo Hu Li (Tw)\0", NULL, "Aaronix", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_huohuliRomInfo, sg1k_huohuliRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - -// Sega Music Editor (Euro?) - -static struct BurnRomInfo sg1k_musicRomDesc[] = { - { "music.bin", 0x08000, 0x622010e1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_music) -STD_ROM_FN(sg1k_music) - -struct BurnDriver BurnDrvsg1k_music = { - "sg1k_music", NULL, NULL, NULL, "198?", - "Sega Music Editor (Euro?)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_musicRomInfo, sg1k_musicRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; - - -// Music (Jpn) - -static struct BurnRomInfo sg1k_musicjRomDesc[] = { - { "music (jp).bin", 0x08000, 0x2ec28526, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sg1k_musicj) -STD_ROM_FN(sg1k_musicj) - -struct BurnDriver BurnDrvsg1k_musicj = { - "sg1k_musicj", NULL, NULL, NULL, "1983", - "Music (Jpn)\0", NULL, "Sega", "Sega SG-1000", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_SG1000, GBF_MISC, 0, - SG1KGetZipName, sg1k_musicjRomInfo, sg1k_musicjRomName, NULL, NULL, Sg1000InputInfo, Sg1000DIPInfo, - DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, - 272, 228, 4, 3 -}; diff --git a/jan/src/burn/drv/sms/d_sms.cpp b/jan/src/burn/drv/sms/d_sms.cpp deleted file mode 100644 index 367d272ce..000000000 --- a/jan/src/burn/drv/sms/d_sms.cpp +++ /dev/null @@ -1,27369 +0,0 @@ -// Sega Mastersystem driver for FBA, interface for SMS Plus by Charles MacDonald - -#include "smsshared.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "burn_ym2413.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvRAM; -static UINT32 *DrvPalette; -static UINT8 DrvReset; - -UINT8 SMSPaletteRecalc; -UINT8 SMSJoy1[12]; -UINT8 SMSJoy2[12]; -UINT8 SMSDips[3]; - -static struct BurnDIPInfo SMSDIPList[] = { - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "FM Unit Emulation"}, - {0x0e, 0x01, 0x04, 0x04, "On (Change needs restart!)"}, - {0x0e, 0x01, 0x04, 0x00, "Off" }, -}; - -STDDIPINFO(SMS) - -static struct BurnDIPInfo GGDIPList[]= -{ - {0x0e, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Display full screen (overscan mode)"}, - {0x0e, 0x01, 0x08, 0x08, "On" }, - {0x0e, 0x01, 0x08, 0x00, "Off" }, -}; - -STDDIPINFO(GG) - -static struct BurnInputInfo SMSInputList[] = { - {"P1 Start(GG)/Pause(SMS)", BIT_DIGITAL, SMSJoy1 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, SMSJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, SMSJoy1 + 4, "p1 down" }, - {"P1 Left", BIT_DIGITAL, SMSJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, SMSJoy1 + 6, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, SMSJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, SMSJoy1 + 8, "p1 fire 2" }, - - {"P2 Up", BIT_DIGITAL, SMSJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, SMSJoy2 + 4, "p2 down" }, - {"P2 Left", BIT_DIGITAL, SMSJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, SMSJoy2 + 6, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, SMSJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, SMSJoy2 + 8, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, SMSDips + 0, "dip" }, -}; - -STDINPUTINFO(SMS) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - AllRam = Next; - DrvRAM = Next; Next += 0x2000; // RAM (not used..yet!) - RamEnd = Next; - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - vdp_init(); // gets rid of crap on the screen w/GG - render_init(); // "" - system_reset(); - - return 0; -} - -INT32 SMSExit() -{ - ZetExit(); - GenericTilesExit(); - - BurnFree (AllMem); - - if (cart.rom) { - BurnFree (cart.rom); - cart.rom = NULL; - } - - system_shutdown(); - - return 0; -} - -static inline void DrvClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x0c) { - *nJoystickInputs &= ~0x0c; - } -} - -void DrvCalcPalette() -{ - for (INT32 i = 0; i < PALETTE_SIZE; i++) - { - int r, g, b; - r = bitmap.pal.color[i][0]; - g = bitmap.pal.color[i][1]; - b = bitmap.pal.color[i][2]; - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -INT32 SMSDraw() -{ - DrvCalcPalette(); - BurnTransferCopy(DrvPalette); - return 0; -} - -INT32 SMSFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - // Inputs! - /* Reset input states */ - input.system = 0; - input.pad[0] = 0; - input.pad[1] = 0; - input.analog[0] = 0x7F; - input.analog[1] = 0x7F; - - /* Parse player 1 joystick state */ - if(SMSJoy1[3]) input.pad[0] |= INPUT_UP; - if(SMSJoy1[4]) input.pad[0] |= INPUT_DOWN; - if(SMSJoy1[5]) input.pad[0] |= INPUT_LEFT; - if(SMSJoy1[6]) input.pad[0] |= INPUT_RIGHT; - if(SMSJoy1[7]) input.pad[0] |= INPUT_BUTTON2; - if(SMSJoy1[8]) input.pad[0] |= INPUT_BUTTON1; - DrvClearOpposites(&input.pad[0]); - // Player 2 - if(SMSJoy2[3]) input.pad[1] |= INPUT_UP; - if(SMSJoy2[4]) input.pad[1] |= INPUT_DOWN; - if(SMSJoy2[5]) input.pad[1] |= INPUT_LEFT; - if(SMSJoy2[6]) input.pad[1] |= INPUT_RIGHT; - if(SMSJoy2[7]) input.pad[1] |= INPUT_BUTTON2; - if(SMSJoy2[8]) input.pad[1] |= INPUT_BUTTON1; - DrvClearOpposites(&input.pad[1]); - if(SMSJoy1[1]) input.system |= (IS_GG) ? INPUT_START : INPUT_PAUSE; - - gg_overscanmode = (SMSDips[0] & 0x08); - - } - - BurnTransferClear(); - - ZetOpen(0); - system_frame(0); - ZetClose(); - - if (pBurnDraw) - SMSDraw(); - - return 0; -} - -void system_manage_sram(UINT8 */*sram*/, INT32 /*slot*/, INT32 /*mode*/) -{ - -} - -// Notes: -// Back to the Future II - bottom of the screen is corrupt, playable -// Street Fighter II - reboots @ game start - -// GG: -// Surf ninjas - weird graphics at boot, playable -// T2 - Judgement Day - glitchy sprites in-game, noted to play the SMS version instead. - -static INT32 load_rom() -{ - INT32 size; - struct BurnRomInfo ri; - - BurnDrvGetRomInfo(&ri, 0); - size = ri.nLen; - - /* Don't load games smaller than 16K */ - if(size < 0x2000) return 0; - - cart.rom = (UINT8 *)BurnMalloc(0x100000); - if (BurnLoadRom(cart.rom + 0x0000, 0, 1)) return 0; - - /* Take care of image header, if present */ - if((size / 512) & 1) - { bprintf(0, _T("Removed SMS Cart header.\n")); - size -= 512; - memmove(cart.rom, cart.rom + 512, size); - } - - cart.pages = (size / 0x4000); - cart.pages8k = (size / 0x2000); - - /* Assign default settings (US NTSC machine) */ - cart.mapper = MAPPER_SEGA; - sms.display = DISPLAY_NTSC; - sms.territory = TERRITORY_EXPORT; - - /* Figure out game image type */ - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_GAME_GEAR) { - sms.console = CONSOLE_GG; - } else { - sms.console = CONSOLE_SMS; - } - - // Override mapper from hardware code - switch (BurnDrvGetHardwareCode() & 0xff) { - case HARDWARE_SMS_MAPPER_NONE: - cart.mapper = MAPPER_NONE; - break; - - case HARDWARE_SMS_MAPPER_CODIES: { - cart.mapper = MAPPER_CODIES; - break; - } - - case HARDWARE_SMS_MAPPER_MSX: { - cart.mapper = MAPPER_MSX; - break; - } - - case HARDWARE_SMS_MAPPER_MSX_NEMESIS: { - cart.mapper = MAPPER_MSX_NEMESIS; - break; - } - - case HARDWARE_SMS_MAPPER_KOREA: { - cart.mapper = MAPPER_KOREA; - break; - } - - case HARDWARE_SMS_MAPPER_KOREA8K: { - cart.mapper = MAPPER_KOREA8K; - break; - } - - case HARDWARE_SMS_MAPPER_4PAK: { - cart.mapper = MAPPER_4PAK; - break; - } - - case HARDWARE_SMS_MAPPER_XIN1: { - cart.mapper = MAPPER_XIN1; - break; - } - - default: { - cart.mapper = MAPPER_SEGA; - break; - } - } - - // Override GG SMS mode from hardware code - if ((BurnDrvGetHardwareCode() & HARDWARE_SMS_GG_SMS_MODE) == HARDWARE_SMS_GG_SMS_MODE) { - sms.console = CONSOLE_SMS; - } - - // Override PAL mode from hardware code - if ((BurnDrvGetHardwareCode() & HARDWARE_SMS_DISPLAY_PAL) == HARDWARE_SMS_DISPLAY_PAL) { - sms.display = DISPLAY_PAL; - } - - // Override Japanese territory from hardware code - if ((BurnDrvGetHardwareCode() & HARDWARE_SMS_JAPANESE) == HARDWARE_SMS_JAPANESE) { - sms.territory = TERRITORY_DOMESTIC; - } - - system_assign_device(PORT_A, DEVICE_PAD2B); - system_assign_device(PORT_B, DEVICE_PAD2B); - - return 1; -} - -INT32 SMSInit() -{ - cart.rom = NULL; - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - GenericTilesInit(); - - if(load_rom() == 0) - { - bprintf(0, _T("Error loading SMS/GG rom!\n")); - return 1; - } else { - bprintf(0, _T("SMS/GG rom loaded ok!\n")); - } - - /* Set up bitmap structure */ - memset(&bitmap, 0, sizeof(bitmap_t)); - bitmap.width = 256; - bitmap.height = 192; - bitmap.depth = 16; - bitmap.granularity = 2; - bitmap.pitch = bitmap.width * bitmap.granularity; - bitmap.data = (UINT8 *)pTransDraw; - bitmap.viewport.x = 0; - bitmap.viewport.y = 0; - bitmap.viewport.w = 256; - bitmap.viewport.h = 192; - - snd.fm_clock = (sms.display == DISPLAY_PAL) ? CLOCK_PAL : CLOCK_NTSC; - snd.psg_clock = (sms.display == DISPLAY_PAL) ? CLOCK_PAL : CLOCK_NTSC; - sms.use_fm = (SMSDips[0] & 0x04); - - system_init(); - - return 0; -} - -static void system_load_state() -{ - if(cart.mapper == MAPPER_MSX || cart.mapper == MAPPER_MSX_NEMESIS) { - if (cart.fcr[3]) sms_mapper8k_w(3, cart.fcr[3]); - if (cart.fcr[2]) sms_mapper8k_w(2, cart.fcr[2]); - if (cart.fcr[1]) sms_mapper8k_w(1, cart.fcr[1]); - if (cart.fcr[0]) sms_mapper8k_w(0, cart.fcr[0]); - } else { - if(cart.mapper == MAPPER_KOREA8K) { - if (cart.fcr[3]) sms_mapper8kvirt_w(3, cart.fcr[3]); - if (cart.fcr[2]) sms_mapper8kvirt_w(2, cart.fcr[2]); - if (cart.fcr[1]) sms_mapper8kvirt_w(1, cart.fcr[1]); - if (cart.fcr[0]) sms_mapper8kvirt_w(0, cart.fcr[0]); - } else if (cart.mapper != MAPPER_XIN1 && cart.mapper != MAPPER_NONE) { - sms_mapper_w(3, cart.fcr[3]); - sms_mapper_w(2, cart.fcr[2]); - sms_mapper_w(1, cart.fcr[1]); - sms_mapper_w(0, cart.fcr[0]); - } - - if (!smsvdp_tmsmode) { - /* Force full pattern cache update when not in a TMS9918 mode */ - bg_list_index = 0x200; - for(INT32 i = 0; i < 0x200; i++) { - bg_name_list[i] = i; - bg_name_dirty[i] = (UINT8)-1; - } - /* Restore palette */ - for(INT32 i = 0; i < PALETTE_SIZE; i++) - palette_sync(i, 1); - } - viewport_check(); // fixes 4pak all action sstate screen corruption - } -} - -INT32 SMSScan(INT32 nAction, INT32 *pnMin) -{ - if (pnMin) { - *pnMin = 0x029708; - } - - if (nAction & ACB_VOLATILE) { - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(vdp); - SCAN_VAR(sms); - SCAN_VAR(cart.fcr); - if (sms.use_fm) // put it down here so we keep compatibility with non-fm states. - BurnYM2413Scan(nAction); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - system_load_state(); - ZetClose(); - } - } - - return 0; -} - -INT32 SMSGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = BurnDrvGetTextA(DRV_NAME); - } else { - pszGameName = BurnDrvGetTextA(DRV_PARENT); - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - // remove sms_ - for (UINT32 j = 0; j < strlen(pszGameName); j++) { - szFilename[j] = pszGameName[j+4]; - } - - *pszName = szFilename; - - return 0; -} - -INT32 GGGetZipName(char** pszName, UINT32 i) -{ - static char szFilename[MAX_PATH]; - char* pszGameName = NULL; - - if (pszName == NULL) { - return 1; - } - - if (i == 0) { - pszGameName = BurnDrvGetTextA(DRV_NAME); - } else { - pszGameName = BurnDrvGetTextA(DRV_PARENT); - } - - if (pszGameName == NULL) { - *pszName = NULL; - return 1; - } - // remove sms_ - for (UINT32 j = 0; j < strlen(pszGameName); j++) { - szFilename[j] = pszGameName[j+3]; - } - - *pszName = szFilename; - - return 0; -} - -// 4 PAK All Action (Aus) - -static struct BurnRomInfo sms_4pakRomDesc[] = { - { "4 pak all action (aus).bin", 0x100000, 0xa67f2a5c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_4pak) -STD_ROM_FN(sms_4pak) - -struct BurnDriver BurnDrvsms_4pak = { - "sms_4pak", NULL, NULL, NULL, "1995", - "4 PAK All Action (Aus)\0", NULL, "HES", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_4PAK, GBF_MISC, 0, - SMSGetZipName, sms_4pakRomInfo, sms_4pakRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// 20 em 1 (Bra) - -static struct BurnRomInfo sms_20em1RomDesc[] = { - { "20 em 1 (brazil).bin", 0x40000, 0xf0f35c22, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_20em1) -STD_ROM_FN(sms_20em1) - -struct BurnDriverD BurnDrvsms_20em1 = { - "sms_20em1", NULL, NULL, NULL, "1995", - "20 em 1 (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_20em1RomInfo, sms_20em1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Three Dragon Story (Kor) - -static struct BurnRomInfo sms_3dragonRomDesc[] = { - { "three dragon story, the (k).bin", 0x08000, 0x8640e7e8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_3dragon) -STD_ROM_FN(sms_3dragon) - -struct BurnDriver BurnDrvsms_3dragon = { - "sms_3dragon", NULL, NULL, NULL, "19??", - "The Three Dragon Story (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_3dragonRomInfo, sms_3dragonRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// 94 Super World Cup Soccer (Kor) - -static struct BurnRomInfo sms_94swcRomDesc[] = { - { "94 super world cup soccer (kr).bin", 0x40000, 0x060d6a7c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_94swc) -STD_ROM_FN(sms_94swc) - -struct BurnDriver BurnDrvsms_94swc = { - "sms_94swc", NULL, NULL, NULL, "1994", - "94 Super World Cup Soccer (Kor)\0", NULL, "Daou Infosys", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_94swcRomInfo, sms_94swcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ace of Aces (Euro) - -static struct BurnRomInfo sms_aceofaceRomDesc[] = { - { "ace of aces (europe).bin", 0x40000, 0x887d9f6b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aceoface) -STD_ROM_FN(sms_aceoface) - -struct BurnDriver BurnDrvsms_aceoface = { - "sms_aceoface", NULL, NULL, NULL, "1991", - "Ace of Aces (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM /*| HARDWARE_SMS_DISPLAY_PAL */, GBF_MISC, 0, - SMSGetZipName, sms_aceofaceRomInfo, sms_aceofaceRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Action Fighter (Euro, USA, Bra, v2) - -static struct BurnRomInfo sms_actionfgRomDesc[] = { - { "mpr-11043.ic1", 0x20000, 0x3658f3e0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_actionfg) -STD_ROM_FN(sms_actionfg) - -struct BurnDriver BurnDrvsms_actionfg = { - "sms_actionfg", NULL, NULL, NULL, "1986", - "Action Fighter (Euro, USA, Bra, v2)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_actionfgRomInfo, sms_actionfgRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Action Fighter (Euro, Jpn, v1) - -static struct BurnRomInfo sms_actionfg1RomDesc[] = { - { "action fighter (japan, europe) (v1.1).bin", 0x20000, 0xd91b340d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_actionfg1) -STD_ROM_FN(sms_actionfg1) - -struct BurnDriver BurnDrvsms_actionfg1 = { - "sms_actionfg1", "sms_actionfg", NULL, NULL, "1986", - "Action Fighter (Euro, Jpn, v1)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_actionfg1RomInfo, sms_actionfg1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Addams Family (Euro) - -static struct BurnRomInfo sms_addfamRomDesc[] = { - { "addams family, the (europe).bin", 0x40000, 0x72420f38, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_addfam) -STD_ROM_FN(sms_addfam) - -struct BurnDriver BurnDrvsms_addfam = { - "sms_addfam", NULL, NULL, NULL, "1993", - "The Addams Family (Euro)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_addfamRomInfo, sms_addfamRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Aerial Assault (Euro, Bra) - -static struct BurnRomInfo sms_aerialasRomDesc[] = { - { "aerial assault (europe).bin", 0x40000, 0xecf491cf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aerialas) -STD_ROM_FN(sms_aerialas) - -struct BurnDriver BurnDrvsms_aerialas = { - "sms_aerialas", NULL, NULL, NULL, "1990", - "Aerial Assault (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_aerialasRomInfo, sms_aerialasRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Aerial Assault (USA) - -static struct BurnRomInfo sms_aerialasuRomDesc[] = { - { "mpr-13299-f.ic1", 0x40000, 0x15576613, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aerialasu) -STD_ROM_FN(sms_aerialasu) - -struct BurnDriver BurnDrvsms_aerialasu = { - "sms_aerialasu", "sms_aerialas", NULL, NULL, "1990", - "Aerial Assault (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_aerialasuRomInfo, sms_aerialasuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// After Burner (World) - -static struct BurnRomInfo sms_aburnerRomDesc[] = { - { "mpr-11271 w01.ic2", 0x80000, 0x1c951f8e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aburner) -STD_ROM_FN(sms_aburner) - -struct BurnDriver BurnDrvsms_aburner = { - "sms_aburner", NULL, NULL, NULL, "1987", - "After Burner (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_aburnerRomInfo, sms_aburnerRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Agigongnyong Dooly (Kor) - -static struct BurnRomInfo sms_agidoolyRomDesc[] = { - { "agigongnyong dooly (kr).bin", 0x20000, 0x4f1be9fa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_agidooly) -STD_ROM_FN(sms_agidooly) - -struct BurnDriver BurnDrvsms_agidooly = { - "sms_agidooly", "sms_dinodool", NULL, NULL, "1991", - "Agigongnyong Dooly (Kor)\0", NULL, "Daou Infosys", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_agidoolyRomInfo, sms_agidoolyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Air Rescue (Euro, Bra, Kor) - -static struct BurnRomInfo sms_airrescRomDesc[] = { - { "air rescue (europe).bin", 0x40000, 0x8b43d21d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_airresc) -STD_ROM_FN(sms_airresc) - -struct BurnDriver BurnDrvsms_airresc = { - "sms_airresc", NULL, NULL, NULL, "1992", - "Air Rescue (Euro, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_airrescRomInfo, sms_airrescRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Aladdin (Euro, Bra, Kor) - -static struct BurnRomInfo sms_aladdinRomDesc[] = { - { "aladdin (europe).bin", 0x80000, 0xc8718d40, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aladdin) -STD_ROM_FN(sms_aladdin) - -struct BurnDriver BurnDrvsms_aladdin = { - "sms_aladdin", NULL, NULL, NULL, "1994", - "Disney's Aladdin (Euro, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_aladdinRomInfo, sms_aladdinRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Aleste (Jpn) - -static struct BurnRomInfo sms_alesteRomDesc[] = { - { "aleste (japan).bin", 0x20000, 0xd8c4165b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aleste) -STD_ROM_FN(sms_aleste) - -struct BurnDriver BurnDrvsms_aleste = { - "sms_aleste", "sms_pstrike", NULL, NULL, "1988", - "Aleste (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alesteRomInfo, sms_alesteRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Aleste II gg2sms - -static struct BurnRomInfo sms_aleste2gg2smsRomDesc[] = { - { "Aleste IIgg2sms.sms", 0x40000, 0x516d899d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aleste2gg2sms) -STD_ROM_FN(sms_aleste2gg2sms) - -struct BurnDriver BurnDrvsms_aleste2gg2sms = { - "sms_alesteiigg2sms", NULL, NULL, NULL, "1993", - "Aleste II GG (SMS Conversion)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_aleste2gg2smsRomInfo, sms_aleste2gg2smsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd BMX Trial (Jpn) - -static struct BurnRomInfo sms_alexbmxRomDesc[] = { - { "alex kidd bmx trial (japan).bin", 0x20000, 0xf9dbb533, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alexbmx) -STD_ROM_FN(sms_alexbmx) - -struct BurnDriver BurnDrvsms_alexbmx = { - "sms_alexbmx", NULL, NULL, NULL, "1987", - "Alex Kidd BMX Trial (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alexbmxRomInfo, sms_alexbmxRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd - High-Tech World (Euro, USA) - -static struct BurnRomInfo sms_alexhitwRomDesc[] = { - { "mpr-12408.ic1", 0x20000, 0x013c0a94, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alexhitw) -STD_ROM_FN(sms_alexhitw) - -struct BurnDriver BurnDrvsms_alexhitw = { - "sms_alexhitw", NULL, NULL, NULL, "1989", - "Alex Kidd - High-Tech World (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alexhitwRomInfo, sms_alexhitwRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd in Miracle World (Euro, USA, v1) - -static struct BurnRomInfo sms_alexkiddRomDesc[] = { - { "alex kidd in miracle world (usa, europe) (v1.1).bin", 0x20000, 0xaed9aac4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alexkidd) -STD_ROM_FN(sms_alexkidd) - -struct BurnDriver BurnDrvsms_alexkidd = { - "sms_alexkidd", NULL, NULL, NULL, "1986", - "Alex Kidd in Miracle World (Euro, USA, v1)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alexkiddRomInfo, sms_alexkiddRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd in Miracle World (Euro, USA, v0) - -static struct BurnRomInfo sms_alexkidd1RomDesc[] = { - { "alex kidd in miracle world (usa, europe).bin", 0x20000, 0x17a40e29, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alexkidd1) -STD_ROM_FN(sms_alexkidd1) - -struct BurnDriver BurnDrvsms_alexkidd1 = { - "sms_alexkidd1", "sms_alexkidd", NULL, NULL, "1986", - "Alex Kidd in Miracle World (Euro, USA, v0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alexkidd1RomInfo, sms_alexkidd1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd in Miracle World (Bra, v1, Pirate) - -static struct BurnRomInfo sms_alexkiddbRomDesc[] = { - { "alex kidd in miracle world (b) [hack].bin", 0x20000, 0x7545d7c2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alexkiddb) -STD_ROM_FN(sms_alexkiddb) - -struct BurnDriver BurnDrvsms_alexkiddb = { - "sms_alexkiddb", "sms_alexkidd", NULL, NULL, "1986", - "Alex Kidd in Miracle World (Bra, v1, Pirate)\0", NULL, "pirate", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alexkiddbRomInfo, sms_alexkiddbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd no Miracle World (Jpn) - -static struct BurnRomInfo sms_alexkiddjRomDesc[] = { - { "mpr-10379.ic1", 0x20000, 0x08c9ec91, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alexkiddj) -STD_ROM_FN(sms_alexkiddj) - -struct BurnDriver BurnDrvsms_alexkiddj = { - "sms_alexkiddj", "sms_alexkidd", NULL, NULL, "1986", - "Alex Kidd no Miracle World (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alexkiddjRomInfo, sms_alexkiddjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd in Radaxian Rumble 1.02e - -static struct BurnRomInfo sms_alexkiddrrRomDesc[] = { - { "akrr102e.sms", 0x80000, 0x368b64b0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alexkiddrr) -STD_ROM_FN(sms_alexkiddrr) - -struct BurnDriver BurnDrvsms_alexkiddrr = { - "sms_akrr102e", "sms_alexkidd", NULL, NULL, "2015", - "Alex Kidd in Radaxian Rumble (ver. 1.02e)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alexkiddrrRomInfo, sms_alexkiddrrRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd - The Lost Stars (World) - -static struct BurnRomInfo sms_alexlostRomDesc[] = { - { "mpr-11402 w09.ic1", 0x40000, 0xc13896d5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alexlost) -STD_ROM_FN(sms_alexlost) - -struct BurnDriver BurnDrvsms_alexlost = { - "sms_alexlost", NULL, NULL, NULL, "1988", - "Alex Kidd - The Lost Stars (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alexlostRomInfo, sms_alexlostRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd in Shinobi World (Euro, USA, Bra) - -static struct BurnRomInfo sms_alexshinRomDesc[] = { - { "alex kidd in shinobi world (usa, europe).bin", 0x40000, 0xd2417ed7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alexshin) -STD_ROM_FN(sms_alexshin) - -struct BurnDriver BurnDrvsms_alexshin = { - "sms_alexshin", NULL, NULL, NULL, "1990", - "Alex Kidd in Shinobi World (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alexshinRomInfo, sms_alexshinRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alf (USA, Bra) - -static struct BurnRomInfo sms_alfRomDesc[] = { - { "alf (usa).bin", 0x20000, 0x82038ad4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alf) -STD_ROM_FN(sms_alf) - -struct BurnDriver BurnDrvsms_alf = { - "sms_alf", NULL, NULL, NULL, "1989", - "Alf (USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alfRomInfo, sms_alfRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alibaba and 40 Thieves (Kor) - -static struct BurnRomInfo sms_alibabaRomDesc[] = { - { "alibaba and 40 thieves (kr).sms", 0x08000, 0x08bf3de3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alibaba) -STD_ROM_FN(sms_alibaba) - -struct BurnDriver BurnDrvsms_alibaba = { - "sms_alibaba", NULL, NULL, NULL, "1989", - "Alibaba and 40 Thieves (Kor)\0", NULL, "HiCom", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_alibabaRomInfo, sms_alibabaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alien³ (Euro, Bra) - -static struct BurnRomInfo sms_alien3RomDesc[] = { - { "alien 3 (europe).bin", 0x40000, 0xb618b144, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_alien3) -STD_ROM_FN(sms_alien3) - -struct BurnDriver BurnDrvsms_alien3 = { - "sms_alien3", NULL, NULL, NULL, "1992", - "Alien 3 (Euro, Bra)\0", NULL, "Arena", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_alien3RomInfo, sms_alien3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Altered Beast (Euro, USA, Bra) - -static struct BurnRomInfo sms_altbeastRomDesc[] = { - { "mpr-12534 t35.ic2", 0x40000, 0xbba2fe98, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_altbeast) -STD_ROM_FN(sms_altbeast) - -struct BurnDriver BurnDrvsms_altbeast = { - "sms_altbeast", NULL, NULL, NULL, "1989", - "Altered Beast (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_altbeastRomInfo, sms_altbeastRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// American Baseball (Euro, Bra) - -static struct BurnRomInfo sms_ameribbRomDesc[] = { - { "mpr-12555f.ic1", 0x40000, 0x7b27202f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ameribb) -STD_ROM_FN(sms_ameribb) - -struct BurnDriver BurnDrvsms_ameribb = { - "sms_ameribb", NULL, NULL, NULL, "1989", - "American Baseball (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ameribbRomInfo, sms_ameribbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// American Pro Football (Euro) - -static struct BurnRomInfo sms_ameripfRomDesc[] = { - { "american pro football (europe).bin", 0x40000, 0x3727d8b2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ameripf) -STD_ROM_FN(sms_ameripf) - -struct BurnDriver BurnDrvsms_ameripf = { - "sms_ameripf", NULL, NULL, NULL, "1989", - "American Pro Football (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ameripfRomInfo, sms_ameripfRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Andre Agassi Tennis (Euro, Bra) - -static struct BurnRomInfo sms_agassiRomDesc[] = { - { "andre agassi tennis (europe).bin", 0x40000, 0xf499034d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_agassi) -STD_ROM_FN(sms_agassi) - -struct BurnDriver BurnDrvsms_agassi = { - "sms_agassi", NULL, NULL, NULL, "1993", - "Andre Agassi Tennis (Euro, Bra)\0", NULL, "TecMagik", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_agassiRomInfo, sms_agassiRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Anmitsu Hime (Jpn) - -static struct BurnRomInfo sms_anmitsuRomDesc[] = { - { "anmitsu hime (japan).bin", 0x20000, 0xfff63b0b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_anmitsu) -STD_ROM_FN(sms_anmitsu) - -struct BurnDriver BurnDrvsms_anmitsu = { - "sms_anmitsu", "sms_alexhitw", NULL, NULL, "1987", - "Anmitsu Hime (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_anmitsuRomInfo, sms_anmitsuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Arcade Smash Hits (Euro) - -static struct BurnRomInfo sms_arcadeshRomDesc[] = { - { "arcade smash hits (europe).bin", 0x40000, 0xe4163163, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_arcadesh) -STD_ROM_FN(sms_arcadesh) - -struct BurnDriver BurnDrvsms_arcadesh = { - "sms_arcadesh", NULL, NULL, NULL, "1992", - "Arcade Smash Hits (Euro)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_arcadeshRomInfo, sms_arcadeshRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Argos no Juujiken (Jpn) - -static struct BurnRomInfo sms_argosnjRomDesc[] = { - { "argos no juujiken (japan).bin", 0x20000, 0xbae75805, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_argosnj) -STD_ROM_FN(sms_argosnj) - -struct BurnDriver BurnDrvsms_argosnj = { - "sms_argosnj", NULL, NULL, NULL, "1988", - "Argos no Juujiken (Jpn)\0", NULL, "Tecmo", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_argosnjRomInfo, sms_argosnjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Argos no Juujiken (Jpn, Pirate?) - -static struct BurnRomInfo sms_argosnj1RomDesc[] = { - { "argos no juujiken [hack].bin", 0x20000, 0x32da4b0d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_argosnj1) -STD_ROM_FN(sms_argosnj1) - -struct BurnDriver BurnDrvsms_argosnj1 = { - "sms_argosnj1", "sms_argosnj", NULL, NULL, "1988", - "Argos no Juujiken (Jpn, Pirate?)\0", NULL, "Tecmo", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_argosnj1RomInfo, sms_argosnj1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Ariel The Little Mermaid (Bra) - -static struct BurnRomInfo sms_arielRomDesc[] = { - { "ariel - the little mermaid (brazil).bin", 0x40000, 0xf4b3a7bd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ariel) -STD_ROM_FN(sms_ariel) - -struct BurnDriver BurnDrvsms_ariel = { - "sms_ariel", NULL, NULL, NULL, "1997", - "Disney's Ariel The Little Mermaid (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_arielRomInfo, sms_arielRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ashura (Jpn) - -static struct BurnRomInfo sms_ashuraRomDesc[] = { - { "mpr-10386.ic1", 0x20000, 0xae705699, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ashura) -STD_ROM_FN(sms_ashura) - -struct BurnDriver BurnDrvsms_ashura = { - "sms_ashura", "sms_secret", NULL, NULL, "1986", - "Ashura (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ashuraRomInfo, sms_ashuraRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Assault City (Euro, Bra, Light Phaser version) - -static struct BurnRomInfo sms_assaultcRomDesc[] = { - { "assault city (europe) (light phaser).bin", 0x40000, 0x861b6e79, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_assaultc) -STD_ROM_FN(sms_assaultc) - -struct BurnDriver BurnDrvsms_assaultc = { - "sms_assaultc", NULL, NULL, NULL, "1990", - "Assault City (Euro, Bra, Light Phaser version)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_assaultcRomInfo, sms_assaultcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Assault City (Euro) - -static struct BurnRomInfo sms_assaultc1RomDesc[] = { - { "assault city (europe).bin", 0x40000, 0x0bd8da96, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_assaultc1) -STD_ROM_FN(sms_assaultc1) - -struct BurnDriver BurnDrvsms_assaultc1 = { - "sms_assaultc1", "sms_assaultc", NULL, NULL, "1990", - "Assault City (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_assaultc1RomInfo, sms_assaultc1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astérix and the Great Rescue (Euro, Bra) - -static struct BurnRomInfo sms_astergreRomDesc[] = { - { "asterix and the great rescue (europe) (en,fr,de,es,it).bin", 0x80000, 0xf9b7d26b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_astergre) -STD_ROM_FN(sms_astergre) - -struct BurnDriver BurnDrvsms_astergre = { - "sms_astergre", NULL, NULL, NULL, "1993", - "Asterix and the Great Rescue (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_astergreRomInfo, sms_astergreRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Asterix (Euro, v1) - -static struct BurnRomInfo sms_asterixRomDesc[] = { - { "asterix (europe) (en,fr) (v1.1).bin", 0x80000, 0x8c9d5be8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_asterix) -STD_ROM_FN(sms_asterix) - -struct BurnDriver BurnDrvsms_asterix = { - "sms_asterix", NULL, NULL, NULL, "1991", - "Asterix (Euro, v1)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_asterixRomInfo, sms_asterixRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Asterix (Euro, Bra, v0) - -static struct BurnRomInfo sms_asterix1RomDesc[] = { - { "mpr-14520-f.ic1", 0x80000, 0x147e02fa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_asterix1) -STD_ROM_FN(sms_asterix1) - -struct BurnDriver BurnDrvsms_asterix1 = { - "sms_asterix1", "sms_asterix", NULL, NULL, "1991", - "Asterix (Euro, Bra, v0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_asterix1RomInfo, sms_asterix1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Asterix and the Secret Mission (Euro) - -static struct BurnRomInfo sms_astermisRomDesc[] = { - { "asterix and the secret mission (europe) (en,fr,de).bin", 0x80000, 0xdef9b14e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_astermis) -STD_ROM_FN(sms_astermis) - -struct BurnDriver BurnDrvsms_astermis = { - "sms_astermis", NULL, NULL, NULL, "1993", - "Asterix and the Secret Mission (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_astermisRomInfo, sms_astermisRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alien Storm (Euro, Bra) - -static struct BurnRomInfo sms_astormRomDesc[] = { - { "mpr-14254.ic1", 0x40000, 0x7f30f793, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_astorm) -STD_ROM_FN(sms_astorm) - -struct BurnDriver BurnDrvsms_astorm = { - "sms_astorm", NULL, NULL, NULL, "1991", - "Alien Storm (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_astormRomInfo, sms_astormRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astro Flash (Jpn, Pirate) - -static struct BurnRomInfo sms_astrofl1RomDesc[] = { - { "astro flash [hack].bin", 0x08000, 0x0e21e6cf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_astrofl1) -STD_ROM_FN(sms_astrofl1) - -struct BurnDriver BurnDrvsms_astrofl1 = { - "sms_astrofl1", "sms_transbot", NULL, NULL, "1985", - "Astro Flash (Jpn, Pirate)\0", NULL, "pirate", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_astrofl1RomInfo, sms_astrofl1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astro Warrior & Pit Pot (Euro) - -static struct BurnRomInfo sms_astropitRomDesc[] = { - { "mpr-11070.ic1", 0x20000, 0x69efd483, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_astropit) -STD_ROM_FN(sms_astropit) - -struct BurnDriver BurnDrvsms_astropit = { - "sms_astropit", NULL, NULL, NULL, "1987", - "Astro Warrior and Pit Pot (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_astropitRomInfo, sms_astropitRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astro Warrior (Jpn, USA, Bra) - -static struct BurnRomInfo sms_astrowRomDesc[] = { - { "mpr-10387.ic1", 0x20000, 0x299cbb74, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_astrow) -STD_ROM_FN(sms_astrow) - -struct BurnDriver BurnDrvsms_astrow = { - "sms_astrow", NULL, NULL, NULL, "1986", - "Astro Warrior (Jpn, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_astrowRomInfo, sms_astrowRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alien Syndrome (Euro, USA, Bra) - -static struct BurnRomInfo sms_aliensynRomDesc[] = { - { "mpr-11384 w10.ic1", 0x40000, 0x5cbfe997, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aliensyn) -STD_ROM_FN(sms_aliensyn) - -struct BurnDriver BurnDrvsms_aliensyn = { - "sms_aliensyn", NULL, NULL, NULL, "1987", - "Alien Syndrome (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_aliensynRomInfo, sms_aliensynRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alien Syndrome (Jpn) - -static struct BurnRomInfo sms_aliensynjRomDesc[] = { - { "alien syndrome (japan).bin", 0x40000, 0x4cc11df9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aliensynj) -STD_ROM_FN(sms_aliensynj) - -struct BurnDriver BurnDrvsms_aliensynj = { - "sms_aliensynj", "sms_aliensyn", NULL, NULL, "1987", - "Alien Syndrome (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_aliensynjRomInfo, sms_aliensynjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alien Syndrome (Prototype) - -static struct BurnRomInfo sms_aliensynpRomDesc[] = { - { "alien syndrome (proto).bin", 0x40000, 0xc148868c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aliensynp) -STD_ROM_FN(sms_aliensynp) - -struct BurnDriver BurnDrvsms_aliensynp = { - "sms_aliensynp", "sms_aliensyn", NULL, NULL, "1987", - "Alien Syndrome (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_aliensynpRomInfo, sms_aliensynpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ayrton Senna's Super Monaco GP II (Euro, Bra, Kor) - -static struct BurnRomInfo sms_smgp2RomDesc[] = { - { "ayrton senna's super monaco gp ii (europe).bin", 0x80000, 0xe890331d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_smgp2) -STD_ROM_FN(sms_smgp2) - -struct BurnDriver BurnDrvsms_smgp2 = { - "sms_smgp2", NULL, NULL, NULL, "1992", - "Ayrton Senna's Super Monaco GP II (Euro, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_smgp2RomInfo, sms_smgp2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Aztec Adventure - The Golden Road to Paradise (Euro, USA) ~ Nazca '88 - The Golden Road to Paradise (Jpn) - -static struct BurnRomInfo sms_aztecadvRomDesc[] = { - { "mpr-11121.ic1", 0x20000, 0xff614eb3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_aztecadv) -STD_ROM_FN(sms_aztecadv) - -struct BurnDriver BurnDrvsms_aztecadv = { - "sms_aztecadv", NULL, NULL, NULL, "1987", - "Aztec Adventure - The Golden Road to Paradise (Euro, USA) ~ Nazca '88 - The Golden Road to Paradise (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_aztecadvRomInfo, sms_aztecadvRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Back to the Future Part II (Euro, Bra) - -static struct BurnRomInfo sms_backtof2RomDesc[] = { - { "back to the future part ii (europe).bin", 0x40000, 0xe5ff50d8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_backtof2) -STD_ROM_FN(sms_backtof2) - -struct BurnDriver BurnDrvsms_backtof2 = { - "sms_backtof2", NULL, NULL, NULL, "1990", - "Back to the Future Part II (Euro, Bra)\0", NULL, "Image Works", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_backtof2RomInfo, sms_backtof2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Back to the Future Part III (Euro) - -static struct BurnRomInfo sms_backtof3RomDesc[] = { - { "back to the future part iii (europe).bin", 0x40000, 0x2d48c1d3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_backtof3) -STD_ROM_FN(sms_backtof3) - -struct BurnDriver BurnDrvsms_backtof3 = { - "sms_backtof3", NULL, NULL, NULL, "1992", - "Back to the Future Part III (Euro)\0", NULL, "Image Works", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_backtof3RomInfo, sms_backtof3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Baku Baku Animal (Bra) - -static struct BurnRomInfo sms_bakubakuRomDesc[] = { - { "baku baku animal (brazil).bin", 0x40000, 0x35d84dc2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bakubaku) -STD_ROM_FN(sms_bakubaku) - -struct BurnDriver BurnDrvsms_bakubaku = { - "sms_bakubaku", NULL, NULL, NULL, "1996", - "Baku Baku Animal (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bakubakuRomInfo, sms_bakubakuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bank Panic (Euro) - -static struct BurnRomInfo sms_bankpRomDesc[] = { - { "mpr-12554.ic1", 0x08000, 0x655fb1f4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bankp) -STD_ROM_FN(sms_bankp) - -struct BurnDriver BurnDrvsms_bankp = { - "sms_bankp", NULL, NULL, NULL, "1987", - "Bank Panic (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bankpRomInfo, sms_bankpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Simpsons - Bart vs. The Space Mutants (Euro, Bra) - -static struct BurnRomInfo sms_bartvssmRomDesc[] = { - { "simpsons, the - bart vs. the space mutants (europe).bin", 0x40000, 0xd1cc08ee, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bartvssm) -STD_ROM_FN(sms_bartvssm) - -struct BurnDriver BurnDrvsms_bartvssm = { - "sms_bartvssm", NULL, NULL, NULL, "1992", - "The Simpsons - Bart vs. The Space Mutants (Euro, Bra)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bartvssmRomInfo, sms_bartvssmRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Simpsons - Bart vs. The World (Euro, Bra) - -static struct BurnRomInfo sms_bartvswRomDesc[] = { - { "mpr-15988.ic1", 0x40000, 0xf6b2370a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bartvsw) -STD_ROM_FN(sms_bartvsw) - -struct BurnDriver BurnDrvsms_bartvsw = { - "sms_bartvsw", NULL, NULL, NULL, "1993", - "The Simpsons - Bart vs. The World (Euro, Bra)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bartvswRomInfo, sms_bartvswRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Basket Ball Nightmare (Euro, Bra) - -static struct BurnRomInfo sms_basketnRomDesc[] = { - { "mpr-12728.ic1", 0x40000, 0x0df8597f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_basketn) -STD_ROM_FN(sms_basketn) - -struct BurnDriver BurnDrvsms_basketn = { - "sms_basketn", NULL, NULL, NULL, "1989", - "Basket Ball Nightmare (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_basketnRomInfo, sms_basketnRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Batman Returns (Euro, Bra) - -static struct BurnRomInfo sms_batmanrnRomDesc[] = { - { "batman returns (europe).bin", 0x40000, 0xb154ec38, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_batmanrn) -STD_ROM_FN(sms_batmanrn) - -struct BurnDriver BurnDrvsms_batmanrn = { - "sms_batmanrn", NULL, NULL, NULL, "1993", - "Batman Returns (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_batmanrnRomInfo, sms_batmanrnRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Battlemaniacs (Bra) - -static struct BurnRomInfo sms_bmaniacsRomDesc[] = { - { "battlemaniacs (brazil).bin", 0x40000, 0x1cbb7bf1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bmaniacs) -STD_ROM_FN(sms_bmaniacs) - -struct BurnDriver BurnDrvsms_bmaniacs = { - "sms_bmaniacs", NULL, NULL, NULL, "1994", - "Battlemaniacs (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bmaniacsRomInfo, sms_bmaniacsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Battle Out Run (Euro, Bra) - -static struct BurnRomInfo sms_battleorRomDesc[] = { - { "battle out run (europe).bin", 0x40000, 0xc19430ce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_battleor) -STD_ROM_FN(sms_battleor) - -struct BurnDriver BurnDrvsms_battleor = { - "sms_battleor", NULL, NULL, NULL, "1989", - "Battle Out Run (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_battleorRomInfo, sms_battleorRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shadow of the Beast (Euro, Bra) - -static struct BurnRomInfo sms_beastRomDesc[] = { - { "shadow of the beast (europe).bin", 0x40000, 0x1575581d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_beast) -STD_ROM_FN(sms_beast) - -struct BurnDriver BurnDrvsms_beast = { - "sms_beast", NULL, NULL, NULL, "1991", - "Shadow of the Beast (Euro, Bra)\0", NULL, "TecMagik", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_beastRomInfo, sms_beastRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Best Game Collection - Hang On + Pit Pot + Spy vs Spy (Kor) - -static struct BurnRomInfo sms_hicom3aRomDesc[] = { - { "hi-com 3-in-1 the best game collection a (kr).sms", 0x20000, 0x98af0236, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hicom3a) -STD_ROM_FN(sms_hicom3a) - -struct BurnDriver BurnDrvsms_hicom3a = { - "sms_hicom3a", NULL, NULL, NULL, "1990", - "The Best Game Collection - Hang On + Pit Pot + Spy vs Spy (Kor)\0", NULL, "Hi-Com", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_XIN1, GBF_MISC, 0, - SMSGetZipName, sms_hicom3aRomInfo, sms_hicom3aRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Best Game Collection - Great Baseball + Great Soccer + Super Tennis (Kor) - -static struct BurnRomInfo sms_hicom3bRomDesc[] = { - { "hi-com 3-in-1 the best game collection b (kr).sms", 0x20000, 0x6ebfe1c3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hicom3b) -STD_ROM_FN(sms_hicom3b) - -struct BurnDriver BurnDrvsms_hicom3b = { - "sms_hicom3b", "sms_hicom3a", NULL, NULL, "1990", - "The Best Game Collection - Great Baseball + Great Soccer + Super Tennis (Kor)\0", NULL, "Hi-Com", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_XIN1, GBF_MISC, 0, - SMSGetZipName, sms_hicom3bRomInfo, sms_hicom3bRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Best Game Collection - Teddy Boy Blues + Pit-Pot + Astro Flash (Kor) - -static struct BurnRomInfo sms_hicom3cRomDesc[] = { - { "hi-com 3-in-1 the best game collection c (kr).sms", 0x20000, 0x81a36a4f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hicom3c) -STD_ROM_FN(sms_hicom3c) - -struct BurnDriver BurnDrvsms_hicom3c = { - "sms_hicom3c", "sms_hicom3a", NULL, NULL, "1990", - "The Best Game Collection - Teddy Boy Blues + Pit-Pot + Astro Flash (Kor)\0", NULL, "Hi-Com", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_XIN1, GBF_MISC, 0, - SMSGetZipName, sms_hicom3cRomInfo, sms_hicom3cRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Best Game Collection - Teddy Boy Blues + Great Soccer + Comical Machine Gun Joe (Kor) - -static struct BurnRomInfo sms_hicom3dRomDesc[] = { - { "hi-com 3-in-1 the best game collection d (kr).sms", 0x20000, 0x8d2d695d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hicom3d) -STD_ROM_FN(sms_hicom3d) - -struct BurnDriver BurnDrvsms_hicom3d = { - "sms_hicom3d", "sms_hicom3a", NULL, NULL, "1990", - "The Best Game Collection - Teddy Boy Blues + Great Soccer + Comical Machine Gun Joe (Kor)\0", NULL, "Hi-Com", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_XIN1, GBF_MISC, 0, - SMSGetZipName, sms_hicom3dRomInfo, sms_hicom3dRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Best Game Collection - Ghost House + Teddy Boy Blues + Seishun Scandal (Kor) - -static struct BurnRomInfo sms_hicom3eRomDesc[] = { - { "hi-com 3-in-1 the best game collection e (kr).sms", 0x20000, 0x82c09b57, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hicom3e) -STD_ROM_FN(sms_hicom3e) - -struct BurnDriver BurnDrvsms_hicom3e = { - "sms_hicom3e", "sms_hicom3a", NULL, NULL, "1990", - "The Best Game Collection - Ghost House + Teddy Boy Blues + Seishun Scandal (Kor)\0", NULL, "Hi-Com", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_XIN1, GBF_MISC, 0, - SMSGetZipName, sms_hicom3eRomInfo, sms_hicom3eRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Best Game Collection - Satellite-7 + Great Baseball + Seishun Scandal (Kor) - -static struct BurnRomInfo sms_hicom3fRomDesc[] = { - { "hi-com 3-in-1 the best game collection f (kr).sms", 0x20000, 0x4088eeb4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hicom3f) -STD_ROM_FN(sms_hicom3f) - -struct BurnDriver BurnDrvsms_hicom3f = { - "sms_hicom3f", "sms_hicom3a", NULL, NULL, "1990", - "The Best Game Collection - Satellite-7 + Great Baseball + Seishun Scandal (Kor)\0", NULL, "Hi-Com", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_XIN1, GBF_MISC, 0, - SMSGetZipName, sms_hicom3fRomInfo, sms_hicom3fRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Best Game Collection (Kor, 8 in 1 Ver. A) - -static struct BurnRomInfo sms_hicom8aRomDesc[] = { - { "hi-com 8-in-1 the best game collection a (kr).sms", 0x40000, 0xfba94148, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hicom8a) -STD_ROM_FN(sms_hicom8a) - -struct BurnDriver BurnDrvsms_hicom8a = { - "sms_hicom8a", "sms_hicom3a", NULL, NULL, "1990", - "The Best Game Collection (Kor, 8 in 1 Ver. A)\0", NULL, "Hi-Com", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_XIN1, GBF_MISC, 0, - SMSGetZipName, sms_hicom8aRomInfo, sms_hicom8aRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Best Game Collection (Kor, 8 in 1 Ver. B) - -static struct BurnRomInfo sms_hicom8bRomDesc[] = { - { "hi-com 8-in-1 the best game collection b (kr).sms", 0x40000, 0x8333c86e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hicom8b) -STD_ROM_FN(sms_hicom8b) - -struct BurnDriver BurnDrvsms_hicom8b = { - "sms_hicom8b", "sms_hicom3a", NULL, NULL, "1990", - "The Best Game Collection (Kor, 8 in 1 Ver. B)\0", NULL, "Hi-Com", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_XIN1, GBF_MISC, 0, - SMSGetZipName, sms_hicom8bRomInfo, sms_hicom8bRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Best Game Collection (Kor, 8 in 1 Ver. C) - -static struct BurnRomInfo sms_hicom8cRomDesc[] = { - { "hi-com 8-in-1 the best game collection c (kr).sms", 0x40000, 0x00e9809f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hicom8c) -STD_ROM_FN(sms_hicom8c) - -struct BurnDriver BurnDrvsms_hicom8c = { - "sms_hicom8c", "sms_hicom3a", NULL, NULL, "1990", - "The Best Game Collection (Kor, 8 in 1 Ver. C)\0", NULL, "Hi-Com", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_XIN1, GBF_MISC, 0, - SMSGetZipName, sms_hicom8cRomInfo, sms_hicom8cRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Black Belt (Euro, USA) - -static struct BurnRomInfo sms_blackbltRomDesc[] = { - { "black belt (usa, europe).bin", 0x20000, 0xda3a2f57, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_blackblt) -STD_ROM_FN(sms_blackblt) - -struct BurnDriver BurnDrvsms_blackblt = { - "sms_blackblt", NULL, NULL, NULL, "1986", - "Black Belt (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_blackbltRomInfo, sms_blackbltRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Blade Eagle (World) - -static struct BurnRomInfo sms_bladeagRomDesc[] = { - { "mpr-11421.ic1", 0x40000, 0x8ecd201c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bladeag) -STD_ROM_FN(sms_bladeag) - -struct BurnDriver BurnDrvsms_bladeag = { - "sms_bladeag", NULL, NULL, NULL, "1988", - "Blade Eagle (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bladeagRomInfo, sms_bladeagRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Blade Eagle (USA, Prototype) - -static struct BurnRomInfo sms_bladeag1RomDesc[] = { - { "blade eagle (world) (beta).bin", 0x40000, 0x58d5fc48, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bladeag1) -STD_ROM_FN(sms_bladeag1) - -struct BurnDriver BurnDrvsms_bladeag1 = { - "sms_bladeag1", "sms_bladeag", NULL, NULL, "1988", - "Blade Eagle (USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bladeag1RomInfo, sms_bladeag1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Block Hole (Kor) - -static struct BurnRomInfo sms_blockholRomDesc[] = { - { "block hole (kr).sms", 0x08000, 0x643b6b76, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_blockhol) -STD_ROM_FN(sms_blockhol) - -struct BurnDriver BurnDrvsms_blockhol = { - "sms_blockhol", NULL, NULL, NULL, "1990", - "Block Hole (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_blockholRomInfo, sms_blockholRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bomber Raid (World) - -static struct BurnRomInfo sms_bombraidRomDesc[] = { - { "mpr-12043f.ic1", 0x40000, 0x3084cf11, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bombraid) -STD_ROM_FN(sms_bombraid) - -struct BurnDriver BurnDrvsms_bombraid = { - "sms_bombraid", NULL, NULL, NULL, "1989", - "Bomber Raid (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bombraidRomInfo, sms_bombraidRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bonanza Bros. (Euro, Bra) - -static struct BurnRomInfo sms_bnzabrosRomDesc[] = { - { "bonanza bros. (europe).bin", 0x40000, 0xcaea8002, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bnzabros) -STD_ROM_FN(sms_bnzabros) - -struct BurnDriver BurnDrvsms_bnzabros = { - "sms_bnzabros", NULL, NULL, NULL, "1991", - "Bonanza Bros. (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bnzabrosRomInfo, sms_bnzabrosRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Bonkers Wax Up! (Bra) - -static struct BurnRomInfo sms_bonkersRomDesc[] = { - { "bonkers wax up! (brazil).bin", 0x80000, 0xb3768a7a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bonkers) -STD_ROM_FN(sms_bonkers) - -struct BurnDriver BurnDrvsms_bonkers = { - "sms_bonkers", NULL, NULL, NULL, "1994", - "Disney's Bonkers Wax Up! (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_bonkersRomInfo, sms_bonkersRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chouon Senshi Borgman (Jpn) - -static struct BurnRomInfo sms_borgmanRomDesc[] = { - { "chouon senshi borgman (japan).bin", 0x20000, 0xe421e466, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_borgman) -STD_ROM_FN(sms_borgman) - -struct BurnDriver BurnDrvsms_borgman = { - "sms_borgman", "sms_cyborgh", NULL, NULL, "1988", - "Chouon Senshi Borgman (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_borgmanRomInfo, sms_borgmanRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chouon Senshi Borgman (Jpn, Prototype) - -static struct BurnRomInfo sms_borgmanpRomDesc[] = { - { "chouon senshi borgman [proto] (jp).bin", 0x20000, 0x86f49ae9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_borgmanp) -STD_ROM_FN(sms_borgmanp) - -struct BurnDriver BurnDrvsms_borgmanp = { - "sms_borgmanp", "sms_cyborgh", NULL, NULL, "1988", - "Chouon Senshi Borgman (Jpn, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_borgmanpRomInfo, sms_borgmanpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bram Stoker's Dracula (Euro) - -static struct BurnRomInfo sms_draculaRomDesc[] = { - { "bram stoker's dracula (europe).bin", 0x40000, 0x1b10a951, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dracula) -STD_ROM_FN(sms_dracula) - -struct BurnDriver BurnDrvsms_dracula = { - "sms_dracula", NULL, NULL, NULL, "1993", - "Bram Stoker's Dracula (Euro)\0", NULL, "Sony Imagesoft", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_draculaRomInfo, sms_draculaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bubble Bobble (Kor, Clover) - -static struct BurnRomInfo sms_bublbokcRomDesc[] = { - { "bobble bobble [clover] (kr).bin", 0x08000, 0x25eb9f80, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bublbokc) -STD_ROM_FN(sms_bublbokc) - -struct BurnDriver BurnDrvsms_bublbokc = { - "sms_bublbokc", "sms_bublbobl", NULL, NULL, "1990", - "Bubble Bobble (Kor, Clover)\0", NULL, "Clover", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bublbokcRomInfo, sms_bublbokcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bubble Bobble (Kor, YM Soft) - -static struct BurnRomInfo sms_bublbokyRomDesc[] = { - { "power boggle boggle (kr).bin", 0x08000, 0x6d309ac5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bublboky) -STD_ROM_FN(sms_bublboky) - -struct BurnDriver BurnDrvsms_bublboky = { - "sms_bublboky", "sms_bublbobl", NULL, NULL, "1990", - "Bubble Bobble (Kor, YM Soft)\0", NULL, "YM Soft", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_bublbokyRomInfo, sms_bublbokyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Bubble Bobble (Kor) - -static struct BurnRomInfo sms_suprbublRomDesc[] = { - { "super bubble bobble (kr).bin", 0x08000, 0x22c09cfd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_suprbubl) -STD_ROM_FN(sms_suprbubl) - -struct BurnDriver BurnDrvsms_suprbubl = { - "sms_suprbubl", "sms_bublbobl", NULL, NULL, "1989", - "Super Bubble Bobble (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_suprbublRomInfo, sms_suprbublRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// New Boggle Boggle 2 (Kor) - -static struct BurnRomInfo sms_newbogl2RomDesc[] = { - { "new boggle boggle (kr).bin", 0x08000, 0xdbbf4dd1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_newbogl2) -STD_ROM_FN(sms_newbogl2) - -struct BurnDriver BurnDrvsms_newbogl2 = { - "sms_newbogl2", "sms_bublbobl", NULL, NULL, "1989", - "New Boggle Boggle 2 (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_newbogl2RomInfo, sms_newbogl2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bubble Bobble (Euro, Bra) - -static struct BurnRomInfo sms_bublboblRomDesc[] = { - { "mpr-14177-f.ic1", 0x40000, 0xe843ba7e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bublbobl) -STD_ROM_FN(sms_bublbobl) - -struct BurnDriver BurnDrvsms_bublbobl = { - "sms_bublbobl", NULL, NULL, NULL, "1988", - "Bubble Bobble (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bublboblRomInfo, sms_bublboblRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Buggy Run (Euro, Bra) - -static struct BurnRomInfo sms_buggyrunRomDesc[] = { - { "mpr-15984 w06.ic1", 0x80000, 0xb0fc4577, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_buggyrun) -STD_ROM_FN(sms_buggyrun) - -struct BurnDriver BurnDrvsms_buggyrun = { - "sms_buggyrun", NULL, NULL, NULL, "1993", - "Buggy Run (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_buggyrunRomInfo, sms_buggyrunRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// C_So! (Kor) - -static struct BurnRomInfo sms_csoRomDesc[] = { - { "c_so! [msx] (kr).bin", 0x08000, 0x0918fba0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_cso) -STD_ROM_FN(sms_cso) - -struct BurnDriver BurnDrvsms_cso = { - "sms_cso", NULL, NULL, NULL, "198?", - "C_So! (Kor)\0", NULL, "Joy Soft", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_csoRomInfo, sms_csoRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// California Games II (Euro) - -static struct BurnRomInfo sms_calgame2RomDesc[] = { - { "mpr-15643-f.ic1", 0x40000, 0xc0e25d62, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_calgame2) -STD_ROM_FN(sms_calgame2) - -struct BurnDriver BurnDrvsms_calgame2 = { - "sms_calgame2", NULL, NULL, NULL, "1993", - "California Games II (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_calgame2RomInfo, sms_calgame2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// California Games II (Bra, Kor) - -static struct BurnRomInfo sms_calgame2bRomDesc[] = { - { "california games ii (brazil, korea).bin", 0x40000, 0x45c50294, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_calgame2b) -STD_ROM_FN(sms_calgame2b) - -struct BurnDriver BurnDrvsms_calgame2b = { - "sms_calgame2b", "sms_calgame2", NULL, NULL, "1993", - "California Games II (Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_calgame2bRomInfo, sms_calgame2bRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// California Games (Euro, USA, Bra) - -static struct BurnRomInfo sms_calgamesRomDesc[] = { - { "mpr-12342f.ic1", 0x40000, 0xac6009a7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_calgames) -STD_ROM_FN(sms_calgames) - -struct BurnDriver BurnDrvsms_calgames = { - "sms_calgames", NULL, NULL, NULL, "1989", - "California Games (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_calgamesRomInfo, sms_calgamesRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Captain Silver (Euro, Jpn) - -static struct BurnRomInfo sms_captsilvRomDesc[] = { - { "mpr-11457f.ic1", 0x40000, 0xa4852757, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_captsilv) -STD_ROM_FN(sms_captsilv) - -struct BurnDriver BurnDrvsms_captsilv = { - "sms_captsilv", NULL, NULL, NULL, "1988", - "Captain Silver (Euro, Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_captsilvRomInfo, sms_captsilvRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Captain Silver (USA) - -static struct BurnRomInfo sms_captsilvuRomDesc[] = { - { "captain silver (usa).bin", 0x20000, 0xb81f6fa5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_captsilvu) -STD_ROM_FN(sms_captsilvu) - -struct BurnDriver BurnDrvsms_captsilvu = { - "sms_captsilvu", "sms_captsilv", NULL, NULL, "1988", - "Captain Silver (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_captsilvuRomInfo, sms_captsilvuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Casino Games (Euro, USA) - -static struct BurnRomInfo sms_casinoRomDesc[] = { - { "mpr-13167.ic1", 0x40000, 0x3cff6e80, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_casino) -STD_ROM_FN(sms_casino) - -struct BurnDriver BurnDrvsms_casino = { - "sms_casino", NULL, NULL, NULL, "1989", - "Casino Games (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_casinoRomInfo, sms_casinoRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Castelo Rá-Tim-Bum (Bra) - -static struct BurnRomInfo sms_casteloRomDesc[] = { - { "castelo ra-tim-bum (brazil).bin", 0x80000, 0x31ffd7c3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_castelo) -STD_ROM_FN(sms_castelo) - -struct BurnDriver BurnDrvsms_castelo = { - "sms_castelo", NULL, NULL, NULL, "1997", - "Castelo Ra-Tim-Bum (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_casteloRomInfo, sms_casteloRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Castle of Illusion Starring Mickey Mouse (Euro, Bra) - -static struct BurnRomInfo sms_castlillRomDesc[] = { - { "mpr-13584a.ic1", 0x40000, 0x953f42e1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_castlill) -STD_ROM_FN(sms_castlill) - -struct BurnDriver BurnDrvsms_castlill = { - "sms_castlill", NULL, NULL, NULL, "1990", - "Castle of Illusion Starring Mickey Mouse (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_castlillRomInfo, sms_castlillRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Castle of Illusion Starring Mickey Mouse (USA, Display Unit Sample) - -static struct BurnRomInfo sms_castlillsRomDesc[] = { - { "castle of illusion - starring mickey mouse (unknown) (sample).bin", 0x08000, 0xbd610939, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_castlills) -STD_ROM_FN(sms_castlills) - -struct BurnDriver BurnDrvsms_castlills = { - "sms_castlills", "sms_castlill", NULL, NULL, "1990", - "Castle of Illusion Starring Mickey Mouse (USA, Display Unit Sample)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_castlillsRomInfo, sms_castlillsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Castle of Illusion Starring Mickey Mouse (USA) - -static struct BurnRomInfo sms_castlilluRomDesc[] = { - { "castle of illusion starring mickey mouse (usa).bin", 0x40000, 0xb9db4282, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_castlillu) -STD_ROM_FN(sms_castlillu) - -struct BurnDriver BurnDrvsms_castlillu = { - "sms_castlillu", "sms_castlill", NULL, NULL, "1990", - "Castle of Illusion Starring Mickey Mouse (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_castlilluRomInfo, sms_castlilluRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Champions of Europe (Euro, Bra) - -static struct BurnRomInfo sms_champeurRomDesc[] = { - { "mpr-14689.ic1", 0x40000, 0x23163a12, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_champeur) -STD_ROM_FN(sms_champeur) - -struct BurnDriver BurnDrvsms_champeur = { - "sms_champeur", NULL, NULL, NULL, "1992", - "Champions of Europe (Euro, Bra)\0", NULL, "TecMagik", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_champeurRomInfo, sms_champeurRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chapolim x Dracula - Um Duelo Assustador (Bra) - -static struct BurnRomInfo sms_chapolimRomDesc[] = { - { "chapolim x dracula - um duelo assustador (brazil).bin", 0x20000, 0x492c7c6e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_chapolim) -STD_ROM_FN(sms_chapolim) - -struct BurnDriver BurnDrvsms_chapolim = { - "sms_chapolim", "sms_ghosth", NULL, NULL, "1990", - "Chapolim x Dracula - Um Duelo Assustador (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_chapolimRomInfo, sms_chapolimRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taito Chase H.Q. (Euro) - -static struct BurnRomInfo sms_chasehqRomDesc[] = { - { "taito chase h.q. (europe).bin", 0x40000, 0x85cfc9c9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_chasehq) -STD_ROM_FN(sms_chasehq) - -struct BurnDriver BurnDrvsms_chasehq = { - "sms_chasehq", NULL, NULL, NULL, "1990", - "Taito Chase H.Q. (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_chasehqRomInfo, sms_chasehqRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cheese Cat-astrophe Starring Speedy Gonzales (Euro, Bra) - -static struct BurnRomInfo sms_cheeseRomDesc[] = { - { "cheese cat-astrophe starring speedy gonzales (europe) (en,fr,de,es).bin", 0x80000, 0x46340c41, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_cheese) -STD_ROM_FN(sms_cheese) - -struct BurnDriver BurnDrvsms_cheese = { - "sms_cheese", NULL, NULL, NULL, "1995", - "Cheese Cat-astrophe Starring Speedy Gonzales (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_cheeseRomInfo, sms_cheeseRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Championship Hockey (Euro) - -static struct BurnRomInfo sms_champhckRomDesc[] = { - { "championship hockey (europe).bin", 0x40000, 0x7e5839a0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_champhck) -STD_ROM_FN(sms_champhck) - -struct BurnDriver BurnDrvsms_champhck = { - "sms_champhck", NULL, NULL, NULL, "1994", - "Championship Hockey (Euro)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_champhckRomInfo, sms_champhckRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Choplifter (Euro, USA, Bra) - -static struct BurnRomInfo sms_chopliftRomDesc[] = { - { "mpr-10149 w04.ic1", 0x20000, 0x4a21c15f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_choplift) -STD_ROM_FN(sms_choplift) - -struct BurnDriver BurnDrvsms_choplift = { - "sms_choplift", NULL, NULL, NULL, "1986", - "Choplifter (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_chopliftRomInfo, sms_chopliftRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Choplifter (Jpn, Prototype) - -static struct BurnRomInfo sms_chopliftjRomDesc[] = { - { "choplifter (japan) (proto).bin", 0x20000, 0x16ec3575, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_chopliftj) -STD_ROM_FN(sms_chopliftj) - -struct BurnDriver BurnDrvsms_chopliftj = { - "sms_chopliftj", "sms_choplift", NULL, NULL, "1986", - "Choplifter (Jpn, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_chopliftjRomInfo, sms_chopliftjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Choplifter (USA, Prototype) - -static struct BurnRomInfo sms_chopliftpRomDesc[] = { - { "choplifter [proto].bin", 0x20000, 0xfd981232, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_chopliftp) -STD_ROM_FN(sms_chopliftp) - -struct BurnDriver BurnDrvsms_chopliftp = { - "sms_chopliftp", "sms_choplift", NULL, NULL, "1986", - "Choplifter (USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_chopliftpRomInfo, sms_chopliftpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chuck Rock (Euro, Bra) - -static struct BurnRomInfo sms_chuckrckRomDesc[] = { - { "chuck rock (europe).bin", 0x80000, 0xdd0e2927, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_chuckrck) -STD_ROM_FN(sms_chuckrck) - -struct BurnDriver BurnDrvsms_chuckrck = { - "sms_chuckrck", NULL, NULL, NULL, "1992", - "Chuck Rock (Euro, Bra)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_chuckrckRomInfo, sms_chuckrckRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chuck Rock II - Son of Chuck (Euro) - -static struct BurnRomInfo sms_chukrck2RomDesc[] = { - { "chuck rock ii - son of chuck (europe).bin", 0x80000, 0xc30e690a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_chukrck2) -STD_ROM_FN(sms_chukrck2) - -struct BurnDriver BurnDrvsms_chukrck2 = { - "sms_chukrck2", NULL, NULL, NULL, "1993", - "Chuck Rock II - Son of Chuck (Euro)\0", NULL, "Core Design", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_chukrck2RomInfo, sms_chukrck2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chuck Rock II - Son of Chuck (Bra) - -static struct BurnRomInfo sms_chukrck2bRomDesc[] = { - { "chuck rock ii - son of chuck (brazil).bin", 0x80000, 0x87783c04, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_chukrck2b) -STD_ROM_FN(sms_chukrck2b) - -struct BurnDriver BurnDrvsms_chukrck2b = { - "sms_chukrck2b", "sms_chukrck2", NULL, NULL, "1993", - "Chuck Rock II - Son of Chuck (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_chukrck2bRomInfo, sms_chukrck2bRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Circuit (Jpn) - -static struct BurnRomInfo sms_circuitRomDesc[] = { - { "circuit, the (japan).bin", 0x20000, 0x8fb75994, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_circuit) -STD_ROM_FN(sms_circuit) - -struct BurnDriver BurnDrvsms_circuit = { - "sms_circuit", "sms_worldgp", NULL, NULL, "1986", - "The Circuit (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_circuitRomInfo, sms_circuitRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cloud Master (Euro, USA) - -static struct BurnRomInfo sms_cloudmstRomDesc[] = { - { "cloud master (usa, europe).bin", 0x40000, 0xe7f62e6d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_cloudmst) -STD_ROM_FN(sms_cloudmst) - -struct BurnDriver BurnDrvsms_cloudmst = { - "sms_cloudmst", NULL, NULL, NULL, "1989", - "Cloud Master (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_cloudmstRomInfo, sms_cloudmstRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Color and Switch Test (v1.3) - -static struct BurnRomInfo sms_colorsRomDesc[] = { - { "color and switch test (unknown) (v1.3).bin", 0x08000, 0x7253c3ec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_colors) -STD_ROM_FN(sms_colors) - -struct BurnDriver BurnDrvsms_colors = { - "sms_colors", NULL, NULL, NULL, "19??", - "Color and Switch Test (v1.3)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_colorsRomInfo, sms_colorsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Columns (Euro, USA, Bra, Kor) - -static struct BurnRomInfo sms_columnsRomDesc[] = { - { "mpr-13293.ic1", 0x20000, 0x665fda92, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_columns) -STD_ROM_FN(sms_columns) - -struct BurnDriver BurnDrvsms_columns = { - "sms_columns", NULL, NULL, NULL, "1990", - "Columns (Euro, USA, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_columnsRomInfo, sms_columnsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Columns (Prototype) - -static struct BurnRomInfo sms_columnspRomDesc[] = { - { "columns [proto].bin", 0x20000, 0x3fb40043, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_columnsp) -STD_ROM_FN(sms_columnsp) - -struct BurnDriver BurnDrvsms_columnsp = { - "sms_columnsp", "sms_columns", NULL, NULL, "1990", - "Columns (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_columnspRomInfo, sms_columnspRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Comic Bakery (Kor) - -static struct BurnRomInfo sms_comicbakRomDesc[] = { - { "comic bakery (kor).bin", 0x08000, 0x7778e256, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_comicbak) -STD_ROM_FN(sms_comicbak) - -struct BurnDriver BurnDrvsms_comicbak = { - "sms_comicbak", NULL, NULL, NULL, "19??", - "Comic Bakery (Kor)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_comicbakRomInfo, sms_comicbakRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Comical Machine Gun Joe (Tw) - -static struct BurnRomInfo sms_comicaltwRomDesc[] = { - { "comical machine gun joe (tw).bin", 0x08000, 0x84ad5ae4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_comicaltw) -STD_ROM_FN(sms_comicaltw) - -struct BurnDriver BurnDrvsms_comicaltw = { - "sms_comicaltw", "sms_comical", NULL, NULL, "1986?", - "Comical Machine Gun Joe (Tw)\0", NULL, "Aaronix", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_comicaltwRomInfo, sms_comicaltwRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Comical Machine Gun Joe (Kor) - -static struct BurnRomInfo sms_comicalkRomDesc[] = { - { "comical machine gun joe (kr).bin", 0x08000, 0x643f6bfc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_comicalk) -STD_ROM_FN(sms_comicalk) - -struct BurnDriver BurnDrvsms_comicalk = { - "sms_comicalk", "sms_comical", NULL, NULL, "198?", - "Comical Machine Gun Joe (Kor)\0", NULL, "Samsung", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_comicalkRomInfo, sms_comicalkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cool Spot (Euro) - -static struct BurnRomInfo sms_coolspotRomDesc[] = { - { "cool spot (europe).bin", 0x40000, 0x13ac9023, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_coolspot) -STD_ROM_FN(sms_coolspot) - -struct BurnDriver BurnDrvsms_coolspot = { - "sms_coolspot", NULL, NULL, NULL, "1993", - "Cool Spot (Euro)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_coolspotRomInfo, sms_coolspotRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cosmic Spacehead (Euro) - -static struct BurnRomInfo sms_cosmicRomDesc[] = { - { "cosmic spacehead (europe) (en,fr,de,es).bin", 0x40000, 0x29822980, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_cosmic) -STD_ROM_FN(sms_cosmic) - -struct BurnDriver BurnDrvsms_cosmic = { - "sms_cosmic", NULL, NULL, NULL, "1993", - "Cosmic Spacehead (Euro)\0", NULL, "Codemasters", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_cosmicRomInfo, sms_cosmicRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Cyber Shinobi (Euro, Bra) - -static struct BurnRomInfo sms_cybersRomDesc[] = { - { "cyber shinobi, the (europe).bin", 0x40000, 0x1350e4f8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_cybers) -STD_ROM_FN(sms_cybers) - -struct BurnDriver BurnDrvsms_cybers = { - "sms_cybers", NULL, NULL, NULL, "1990", - "The Cyber Shinobi (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_cybersRomInfo, sms_cybersRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Cyber Shinobi (Prototype) - -static struct BurnRomInfo sms_cyberspRomDesc[] = { - { "cyber shinobi, the [proto].bin", 0x20000, 0xdac00a3a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_cybersp) -STD_ROM_FN(sms_cybersp) - -struct BurnDriver BurnDrvsms_cybersp = { - "sms_cybersp", "sms_cybers", NULL, NULL, "1990", - "The Cyber Shinobi (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_cyberspRomInfo, sms_cyberspRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cyborg Hunter (Euro, USA, Bra) - -static struct BurnRomInfo sms_cyborghRomDesc[] = { - { "cyborg hunter (usa, europe).bin", 0x20000, 0x908e7524, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_cyborgh) -STD_ROM_FN(sms_cyborgh) - -struct BurnDriver BurnDrvsms_cyborgh = { - "sms_cyborgh", NULL, NULL, NULL, "1988", - "Cyborg Hunter (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_cyborghRomInfo, sms_cyborghRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cyborg Z (Kor) - -static struct BurnRomInfo sms_cyborgzRomDesc[] = { - { "cyborg z (kr).bin", 0x20000, 0x77efe84a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_cyborgz) -STD_ROM_FN(sms_cyborgz) - -struct BurnDriver BurnDrvsms_cyborgz = { - "sms_cyborgz", NULL, NULL, NULL, "1991", - "Cyborg Z (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_cyborgzRomInfo, sms_cyborgzRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Daffy Duck in Hollywood (Euro, Bra) - -static struct BurnRomInfo sms_daffyRomDesc[] = { - { "daffy duck in hollywood (europe) (en,fr,de,es,it).bin", 0x80000, 0x71abef27, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_daffy) -STD_ROM_FN(sms_daffy) - -struct BurnDriver BurnDrvsms_daffy = { - "sms_daffy", NULL, NULL, NULL, "1994", - "Daffy Duck in Hollywood (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_daffyRomInfo, sms_daffyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dallyeora Pigu-Wang (Kor) - -static struct BurnRomInfo sms_dallyeRomDesc[] = { - { "dallyeora pigu-wang (korea) (unl).bin", 0x6c000, 0x89b79e77, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dallye) -STD_ROM_FN(sms_dallye) - -struct BurnDriver BurnDrvsms_dallye = { - "sms_dallye", NULL, NULL, NULL, "1995", - "Dallyeora Pigu-Wang (Kor)\0", NULL, "Game Line", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_KOREA, GBF_MISC, 0, - SMSGetZipName, sms_dallyeRomInfo, sms_dallyeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Danan: The Jungle Fighter (Euro, Bra) - -static struct BurnRomInfo sms_dananRomDesc[] = { - { "danan - the jungle fighter (europe).bin", 0x40000, 0xae4a28d7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_danan) -STD_ROM_FN(sms_danan) - -struct BurnDriver BurnDrvsms_danan = { - "sms_danan", NULL, NULL, NULL, "1990", - "Danan: The Jungle Fighter (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dananRomInfo, sms_dananRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Double Dragon (World) - -static struct BurnRomInfo sms_ddragonRomDesc[] = { - { "mpr-11831 t03.ic1", 0x40000, 0xa55d89f3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ddragon) -STD_ROM_FN(sms_ddragon) - -struct BurnDriver BurnDrvsms_ddragon = { - "sms_ddragon", NULL, NULL, NULL, "1988", - "Double Dragon (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ddragonRomInfo, sms_ddragonRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Double Dragon (Kor) - -static struct BurnRomInfo sms_ddragonkRomDesc[] = { - { "double dragon (kr).bin", 0x40000, 0xaeacfca7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ddragonk) -STD_ROM_FN(sms_ddragonk) - -struct BurnDriver BurnDrvsms_ddragonk = { - "sms_ddragonk", "sms_ddragon", NULL, NULL, "198?", - "Double Dragon (Kor)\0", NULL, "Samsung", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ddragonkRomInfo, sms_ddragonkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dead Angle (Euro, USA) - -static struct BurnRomInfo sms_deadangRomDesc[] = { - { "mpr-12654f.ic1", 0x40000, 0xe2f7193e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_deadang) -STD_ROM_FN(sms_deadang) - -struct BurnDriver BurnDrvsms_deadang = { - "sms_deadang", NULL, NULL, NULL, "1989", - "Dead Angle (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_deadangRomInfo, sms_deadangRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Deep Duck Trouble Starring Donald Duck (Euro, Bra) - -static struct BurnRomInfo sms_deepduckRomDesc[] = { - { "deep duck trouble starring donald duck (europe).bin", 0x80000, 0x42fc3a6e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_deepduck) -STD_ROM_FN(sms_deepduck) - -struct BurnDriver BurnDrvsms_deepduck = { - "sms_deepduck", NULL, NULL, NULL, "1993", - "Deep Duck Trouble Starring Donald Duck (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_deepduckRomInfo, sms_deepduckRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Desert Speedtrap Starring Road Runner and Wile E. Coyote (Euro, Bra) - -static struct BurnRomInfo sms_desertRomDesc[] = { - { "desert speedtrap starring road runner and wile e. coyote (europe) (en,fr,de,es,it).bin", 0x40000, 0xb137007a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_desert) -STD_ROM_FN(sms_desert) - -struct BurnDriver BurnDrvsms_desert = { - "sms_desert", NULL, NULL, NULL, "1993", - "Desert Speedtrap Starring Road Runner and Wile E. Coyote (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_desertRomInfo, sms_desertRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dick Tracy (Euro, USA, Bra) - -static struct BurnRomInfo sms_dicktrRomDesc[] = { - { "mpr-13644.ic1", 0x40000, 0xf6fab48d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dicktr) -STD_ROM_FN(sms_dicktr) - -struct BurnDriver BurnDrvsms_dicktr = { - "sms_dicktr", NULL, NULL, NULL, "1990", - "Dick Tracy (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dicktrRomInfo, sms_dicktrRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dinobasher Starring Bignose the Caveman (Euro, Prototype) - -static struct BurnRomInfo sms_dinobashRomDesc[] = { - { "dinobasher starring bignose the caveman (europe) (proto).bin", 0x40000, 0xea5c3a6f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dinobash) -STD_ROM_FN(sms_dinobash) - -struct BurnDriver BurnDrvsms_dinobash = { - "sms_dinobash", NULL, NULL, NULL, "19??", - "Dinobasher Starring Bignose the Caveman (Euro, Prototype)\0", NULL, "Codemasters", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_dinobashRomInfo, sms_dinobashRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Dinosaur Dooley (Kor) - -static struct BurnRomInfo sms_dinodoolRomDesc[] = { - { "dinosaur dooley, the (korea) (unl).bin", 0x20000, 0x32f4b791, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dinodool) -STD_ROM_FN(sms_dinodool) - -struct BurnDriver BurnDrvsms_dinodool = { - "sms_dinodool", NULL, NULL, NULL, "19??", - "The Dinosaur Dooley (Kor)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dinodoolRomInfo, sms_dinodoolRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Doki Doki Penguin Land - Uchuu Daibouken (Jpn) - -static struct BurnRomInfo sms_dokidokiRomDesc[] = { - { "doki doki penguin land - uchuu daibouken (japan).bin", 0x20000, 0x2bcdb8fa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dokidoki) -STD_ROM_FN(sms_dokidoki) - -struct BurnDriver BurnDrvsms_dokidoki = { - "sms_dokidoki", "sms_pengland", NULL, NULL, "1987", - "Doki Doki Penguin Land - Uchuu Daibouken (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dokidokiRomInfo, sms_dokidokiRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Doki Doki Penguin Land - Uchuu Daibouken (Jpn, Prototype) - -static struct BurnRomInfo sms_dokidokipRomDesc[] = { - { "doki doki penguin land - uchuu daibouken (japan, proto).bin", 0x20000, 0x56bd2455, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dokidokip) -STD_ROM_FN(sms_dokidokip) - -struct BurnDriver BurnDrvsms_dokidokip = { - "sms_dokidokip", "sms_pengland", NULL, NULL, "1987", - "Doki Doki Penguin Land - Uchuu Daibouken (Jpn, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dokidokipRomInfo, sms_dokidokipRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Double Hawk (Euro) - -static struct BurnRomInfo sms_doublhwkRomDesc[] = { - { "double hawk (europe).bin", 0x40000, 0x8370f6cd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_doublhwk) -STD_ROM_FN(sms_doublhwk) - -struct BurnDriver BurnDrvsms_doublhwk = { - "sms_doublhwk", NULL, NULL, NULL, "1990", - "Double Hawk (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_doublhwkRomInfo, sms_doublhwkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Double Hawk (Euro, Prototype) - -static struct BurnRomInfo sms_doublhwkpRomDesc[] = { - { "double hawk (europe) (beta).bin", 0x40000, 0xf76d5cee, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_doublhwkp) -STD_ROM_FN(sms_doublhwkp) - -struct BurnDriver BurnDrvsms_doublhwkp = { - "sms_doublhwkp", "sms_doublhwk", NULL, NULL, "1990", - "Double Hawk (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_doublhwkpRomInfo, sms_doublhwkpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Double Target - Cynthia no Nemuri (Jpn) - -static struct BurnRomInfo sms_doubltgtRomDesc[] = { - { "double target - cynthia no nemuri (japan).bin", 0x20000, 0x52b83072, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_doubltgt) -STD_ROM_FN(sms_doubltgt) - -struct BurnDriver BurnDrvsms_doubltgt = { - "sms_doubltgt", "sms_quartet", NULL, NULL, "1987", - "Double Target - Cynthia no Nemuri (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_doubltgtRomInfo, sms_doubltgtRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dragon - The Bruce Lee Story (Euro) - -static struct BurnRomInfo sms_dragonRomDesc[] = { - { "dragon - the bruce lee story (europe).bin", 0x40000, 0xc88a5064, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dragon) -STD_ROM_FN(sms_dragon) - -struct BurnDriver BurnDrvsms_dragon = { - "sms_dragon", NULL, NULL, NULL, "1994", - "Dragon - The Bruce Lee Story (Euro)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dragonRomInfo, sms_dragonRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dragon Crystal (Euro, Bra) - -static struct BurnRomInfo sms_dcrystalRomDesc[] = { - { "dragon crystal (europe).bin", 0x20000, 0x9549fce4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dcrystal) -STD_ROM_FN(sms_dcrystal) - -struct BurnDriver BurnDrvsms_dcrystal = { - "sms_dcrystal", NULL, NULL, NULL, "1991", - "Dragon Crystal (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dcrystalRomInfo, sms_dcrystalRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dr. HELLO (Kor) - -static struct BurnRomInfo sms_drhelloRomDesc[] = { - { "dr. hello (k).bin", 0x08000, 0x16537865, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_drhello) -STD_ROM_FN(sms_drhello) - -struct BurnDriver BurnDrvsms_drhello = { - "sms_drhello", NULL, NULL, NULL, "19??", - "Dr. HELLO (Kor)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_drhelloRomInfo, sms_drhelloRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dr. Robotnik's Mean Bean Machine (Euro, Bra) - -static struct BurnRomInfo sms_drrobotnRomDesc[] = { - { "dr. robotnik's mean bean machine (europe).bin", 0x40000, 0x6c696221, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_drrobotn) -STD_ROM_FN(sms_drrobotn) - -struct BurnDriver BurnDrvsms_drrobotn = { - "sms_drrobotn", NULL, NULL, NULL, "1993", - "Dr. Robotnik's Mean Bean Machine (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_drrobotnRomInfo, sms_drrobotnRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Desert Strike (Euro) - -static struct BurnRomInfo sms_dstrikeRomDesc[] = { - { "desert strike (europe) (en,fr,de,es).bin", 0x80000, 0x6c1433f9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dstrike) -STD_ROM_FN(sms_dstrike) - -struct BurnDriver BurnDrvsms_dstrike = { - "sms_dstrike", NULL, NULL, NULL, "1992", - "Desert Strike (Euro)\0", NULL, "Domark", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dstrikeRomInfo, sms_dstrikeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gokuaku Doumei Dump Matsumoto (Jpn) - -static struct BurnRomInfo sms_dumpmatsRomDesc[] = { - { "gokuaku doumei dump matsumoto (japan).bin", 0x20000, 0xa249fa9d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dumpmats) -STD_ROM_FN(sms_dumpmats) - -struct BurnDriver BurnDrvsms_dumpmats = { - "sms_dumpmats", "sms_prowres", NULL, NULL, "1986", - "Gokuaku Doumei Dump Matsumoto (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dumpmatsRomInfo, sms_dumpmatsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dynamite Duke (Euro, Bra) - -static struct BurnRomInfo sms_dyndukeRomDesc[] = { - { "dynamite duke (europe).bin", 0x40000, 0x07306947, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dynduke) -STD_ROM_FN(sms_dynduke) - -struct BurnDriver BurnDrvsms_dynduke = { - "sms_dynduke", NULL, NULL, NULL, "1991", - "Dynamite Duke (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dyndukeRomInfo, sms_dyndukeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dynamite Dux (Euro, Bra) - -static struct BurnRomInfo sms_dduxRomDesc[] = { - { "dynamite dux (europe).bin", 0x40000, 0x0e1cc1e0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ddux) -STD_ROM_FN(sms_ddux) - -struct BurnDriver BurnDrvsms_ddux = { - "sms_ddux", NULL, NULL, NULL, "1989", - "Dynamite Dux (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dduxRomInfo, sms_dduxRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dynamite Headdy (Bra) - -static struct BurnRomInfo sms_dheadRomDesc[] = { - { "dynamite headdy (brazil).bin", 0x80000, 0x7db5b0fa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_dhead) -STD_ROM_FN(sms_dhead) - -struct BurnDriver BurnDrvsms_dhead = { - "sms_dhead", NULL, NULL, NULL, "1994", - "Dynamite Headdy (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_dheadRomInfo, sms_dheadRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// E.I. - Exa Innova (Kor) - -static struct BurnRomInfo sms_exainnovRomDesc[] = { - { "e.i. - exa innova (kr).sms", 0x08000, 0xdd74bcf1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_exainnov) -STD_ROM_FN(sms_exainnov) - -struct BurnDriver BurnDrvsms_exainnov = { - "sms_exainnov", NULL, NULL, NULL, "19??", - "E.I. - Exa Innova (Kor)\0", NULL, "HiCom", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_exainnovRomInfo, sms_exainnovRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Eagles 5 (Kor) - -static struct BurnRomInfo sms_eagles5RomDesc[] = { - { "eagles 5 (kr).bin", 0x08000, 0xf06f2ccb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_eagles5) -STD_ROM_FN(sms_eagles5) - -struct BurnDriver BurnDrvsms_eagles5 = { - "sms_eagles5", NULL, NULL, NULL, "1990", - "Eagles 5 (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_eagles5RomInfo, sms_eagles5RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ecco the Dolphin (Euro, Bra) - -static struct BurnRomInfo sms_eccoRomDesc[] = { - { "ecco the dolphin (europe).bin", 0x80000, 0x6687fab9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ecco) -STD_ROM_FN(sms_ecco) - -struct BurnDriver BurnDrvsms_ecco = { - "sms_ecco", NULL, NULL, NULL, "1993", - "Ecco the Dolphin (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_eccoRomInfo, sms_eccoRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ecco - The Tides of Time (Bra) - -static struct BurnRomInfo sms_ecco2RomDesc[] = { - { "ecco - the tides of time (brazil).bin", 0x80000, 0x7c28703a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ecco2) -STD_ROM_FN(sms_ecco2) - -struct BurnDriver BurnDrvsms_ecco2 = { - "sms_ecco2", NULL, NULL, NULL, "1996", - "Ecco - The Tides of Time (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ecco2RomInfo, sms_ecco2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Earthworm Jim (Bra) - -static struct BurnRomInfo sms_ejimRomDesc[] = { - { "earthworm jim (brazil).bin", 0x80000, 0xc4d5efc5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ejim) -STD_ROM_FN(sms_ejim) - -struct BurnDriver BurnDrvsms_ejim = { - "sms_ejim", NULL, NULL, NULL, "1996", - "Earthworm Jim (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_ejimRomInfo, sms_ejimRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Enduro Racer (Euro, USA, Bra) - -static struct BurnRomInfo sms_enduroRomDesc[] = { - { "mpr-10843 w28.ic1", 0x20000, 0x00e73541, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_enduro) -STD_ROM_FN(sms_enduro) - -struct BurnDriver BurnDrvsms_enduro = { - "sms_enduro", NULL, NULL, NULL, "1987", - "Enduro Racer (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_enduroRomInfo, sms_enduroRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Enduro Racer (Jpn) - -static struct BurnRomInfo sms_endurojRomDesc[] = { - { "mpr-10745.ic1", 0x40000, 0x5d5c50b3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_enduroj) -STD_ROM_FN(sms_enduroj) - -struct BurnDriver BurnDrvsms_enduroj = { - "sms_enduroj", "sms_enduro", NULL, NULL, "1987", - "Enduro Racer (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_endurojRomInfo, sms_endurojRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// E-SWAT - City Under Siege (Euro, USA, Easy Version) - -static struct BurnRomInfo sms_eswatcRomDesc[] = { - { "e-swat - city under siege (usa, europe) (easy version).bin", 0x40000, 0xc4bb1676, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_eswatc) -STD_ROM_FN(sms_eswatc) - -struct BurnDriver BurnDrvsms_eswatc = { - "sms_eswatc", NULL, NULL, NULL, "1990", - "E-SWAT - City Under Siege (Euro, USA, Easy Version)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_eswatcRomInfo, sms_eswatcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// E-SWAT - City Under Siege (Euro, USA, Bra, Hard Version) - -static struct BurnRomInfo sms_eswatc1RomDesc[] = { - { "e-swat - city under siege (usa, europe) (hard version).bin", 0x40000, 0xc10fce39, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_eswatc1) -STD_ROM_FN(sms_eswatc1) - -struct BurnDriver BurnDrvsms_eswatc1 = { - "sms_eswatc1", "sms_eswatc", NULL, NULL, "1990", - "E-SWAT - City Under Siege (Euro, USA, Bra, Hard Version)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_eswatc1RomInfo, sms_eswatc1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Excellent Dizzy Collection (Euro, USA, Prototype) - -static struct BurnRomInfo sms_excdizzyRomDesc[] = { - { "excellent dizzy collection, the (usa, europe) (en,fr,de,es,it) (proto).bin", 0x40000, 0x8813514b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_excdizzy) -STD_ROM_FN(sms_excdizzy) - -struct BurnDriver BurnDrvsms_excdizzy = { - "sms_excdizzy", NULL, NULL, NULL, "19??", - "The Excellent Dizzy Collection (Euro, USA, Prototype)\0", NULL, "Codemasters", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_excdizzyRomInfo, sms_excdizzyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// F1 (Euro, Bra) - -static struct BurnRomInfo sms_f1RomDesc[] = { - { "mpr-15830-f.ic1", 0x40000, 0xec788661, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_f1) -STD_ROM_FN(sms_f1) - -struct BurnDriver BurnDrvsms_f1 = { - "sms_f1", NULL, NULL, NULL, "1993", - "F1 (Euro, Bra)\0", NULL, "Domark", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_f1RomInfo, sms_f1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// F-1 Spirit - The way to Formula-1 (Kor) - -static struct BurnRomInfo sms_f1spiritRomDesc[] = { - { "f-1 spirit - the way to formula-1 (kr)", 0x20000, 0x06965ed9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_f1spirit) -STD_ROM_FN(sms_f1spirit) - -struct BurnDriver BurnDrvsms_f1spirit = { - "sms_f1spirit", NULL, NULL, NULL, "1987", - "F-1 Spirit - The way to Formula-1 (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_f1spiritRomInfo, sms_f1spiritRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// F-16 Fighting Falcon (USA) - -static struct BurnRomInfo sms_f16falcRomDesc[] = { - { "f-16 fighting falcon (usa).bin", 0x08000, 0x184c23b7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_f16falc) -STD_ROM_FN(sms_f16falc) - -struct BurnDriver BurnDrvsms_f16falc = { - "sms_f16falc", "sms_f16fight", NULL, NULL, "1985", - "F-16 Fighting Falcon (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_f16falcRomInfo, sms_f16falcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// F-16 Fighting Falcon (Tw) - -static struct BurnRomInfo sms_f16falctwRomDesc[] = { - { "f-16 fighting falcon (tw).bin", 0x08000, 0xc4c53226, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_f16falctw) -STD_ROM_FN(sms_f16falctw) - -struct BurnDriver BurnDrvsms_f16falctw = { - "sms_f16falctw", "sms_f16fight", NULL, NULL, "1985?", - "F-16 Fighting Falcon (Tw)\0", NULL, "Aaronix", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_f16falctwRomInfo, sms_f16falctwRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// F-16 Fighter (Euro, USA) - -static struct BurnRomInfo sms_f16fightRomDesc[] = { - { "mpr-12643.ic1", 0x08000, 0xeaebf323, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_f16fight) -STD_ROM_FN(sms_f16fight) - -struct BurnDriver BurnDrvsms_f16fight = { - "sms_f16fight", NULL, NULL, NULL, "1986", - "F-16 Fighter (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_f16fightRomInfo, sms_f16fightRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// FA Tetris (Kor) - -static struct BurnRomInfo sms_fatetrisRomDesc[] = { - { "fa tetris (kr).bin", 0x08000, 0x17ab6883, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fatetris) -STD_ROM_FN(sms_fatetris) - -struct BurnDriver BurnDrvsms_fatetris = { - "sms_fatetris", NULL, NULL, NULL, "1989", - "FA Tetris (Kor)\0", NULL, "FA Soft", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_fatetrisRomInfo, sms_fatetrisRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Family Games (Jpn) - -static struct BurnRomInfo sms_familyRomDesc[] = { - { "mpr-11276.ic1", 0x20000, 0x7abc70e9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_family) -STD_ROM_FN(sms_family) - -struct BurnDriver BurnDrvsms_family = { - "sms_family", "sms_parlour", NULL, NULL, "1987", - "Family Games (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_familyRomInfo, sms_familyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantastic Dizzy (Euro) - -static struct BurnRomInfo sms_fantdizzRomDesc[] = { - { "fantastic dizzy (europe) (en,fr,de,es,it).bin", 0x40000, 0xb9664ae1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fantdizz) -STD_ROM_FN(sms_fantdizz) - -struct BurnDriver BurnDrvsms_fantdizz = { - "sms_fantdizz", NULL, NULL, NULL, "1993", - "Fantastic Dizzy (Euro)\0", NULL, "Codemasters", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_fantdizzRomInfo, sms_fantdizzRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantasy Zone II - The Tears of Opa-Opa (Euro, USA, Bra) - -static struct BurnRomInfo sms_fantzon2RomDesc[] = { - { "mpr-10848 w05.ic1", 0x40000, 0xb8b141f9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fantzon2) -STD_ROM_FN(sms_fantzon2) - -struct BurnDriver BurnDrvsms_fantzon2 = { - "sms_fantzon2", NULL, NULL, NULL, "1987", - "Fantasy Zone II - The Tears of Opa-Opa (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fantzon2RomInfo, sms_fantzon2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantasy Zone II - Opa Opa no Namida (Jpn) - -static struct BurnRomInfo sms_fantzon2jRomDesc[] = { - { "mpr-10847.ic1", 0x40000, 0xc722fb42, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fantzon2j) -STD_ROM_FN(sms_fantzon2j) - -struct BurnDriver BurnDrvsms_fantzon2j = { - "sms_fantzon2j", "sms_fantzon2", NULL, NULL, "1987", - "Fantasy Zone II - Opa Opa no Namida (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fantzon2jRomInfo, sms_fantzon2jRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantasy Zone (World, v2) - -static struct BurnRomInfo sms_fantzoneRomDesc[] = { - { "mpr-10118 w01.ic1", 0x20000, 0x65d7e4e0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fantzone) -STD_ROM_FN(sms_fantzone) - -struct BurnDriver BurnDrvsms_fantzone = { - "sms_fantzone", NULL, NULL, NULL, "1986", - "Fantasy Zone (World, v2)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fantzoneRomInfo, sms_fantzoneRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantasy Zone (World, v1, Prototype) - -static struct BurnRomInfo sms_fantzone1RomDesc[] = { - { "fantasy zone (world) (v1.1) (beta).bin", 0x20000, 0xf46264fe, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fantzone1) -STD_ROM_FN(sms_fantzone1) - -struct BurnDriver BurnDrvsms_fantzone1 = { - "sms_fantzone1", "sms_fantzone", NULL, NULL, "1986", - "Fantasy Zone (World, v1, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fantzone1RomInfo, sms_fantzone1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantasy Zone (Jpn, v0) - -static struct BurnRomInfo sms_fantzonejRomDesc[] = { - { "mpr-7751.ic1", 0x20000, 0x0ffbcaa3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fantzonej) -STD_ROM_FN(sms_fantzonej) - -struct BurnDriver BurnDrvsms_fantzonej = { - "sms_fantzonej", "sms_fantzone", NULL, NULL, "1986", - "Fantasy Zone (Jpn, v0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fantzonejRomInfo, sms_fantzonejRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantasy Zone (Tw) - -static struct BurnRomInfo sms_fantzonetwRomDesc[] = { - { "fantasy zone (tw).bin", 0x20000, 0x5fd48352, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fantzonetw) -STD_ROM_FN(sms_fantzonetw) - -struct BurnDriver BurnDrvsms_fantzonetw = { - "sms_fantzonetw", "sms_fantzone", NULL, NULL, "1986?", - "Fantasy Zone (Tw)\0", NULL, "Aaronix", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fantzonetwRomInfo, sms_fantzonetwRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantasy Zone - The Maze (Euro, USA) - -static struct BurnRomInfo sms_fantzonmRomDesc[] = { - { "fantasy zone - the maze (usa, europe).bin", 0x20000, 0xd29889ad, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fantzonm) -STD_ROM_FN(sms_fantzonm) - -struct BurnDriver BurnDrvsms_fantzonm = { - "sms_fantzonm", NULL, NULL, NULL, "1987", - "Fantasy Zone - The Maze (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fantzonmRomInfo, sms_fantzonmRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Final Bubble Bobble (Jpn) - -static struct BurnRomInfo sms_finalbbRomDesc[] = { - { "final bubble bobble (japan).bin", 0x40000, 0x3ebb7457, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_finalbb) -STD_ROM_FN(sms_finalbb) - -struct BurnDriver BurnDrvsms_finalbb = { - "sms_finalbb", "sms_bublbobl", NULL, NULL, "1988", - "Final Bubble Bobble (Jpn)\0", NULL, "Sega ", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_finalbbRomInfo, sms_finalbbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Felipe em Acao (Bra) - -static struct BurnRomInfo sms_felipeRomDesc[] = { - { "felipe em acao (b).bin", 0x08000, 0xccb2cab4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_felipe) -STD_ROM_FN(sms_felipe) - -struct BurnDriver BurnDrvsms_felipe = { - "sms_felipe", "sms_teddyboy", NULL, NULL, "19??", - "Felipe em Acao (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_felipeRomInfo, sms_felipeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Férias Frustradas do Pica-Pau (Bra) - -static struct BurnRomInfo sms_feriasRomDesc[] = { - { "ferias frustradas do pica pau (brazil).bin", 0x80000, 0xbf6c2e37, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ferias) -STD_ROM_FN(sms_ferias) - -struct BurnDriver BurnDrvsms_ferias = { - "sms_ferias", NULL, NULL, NULL, "1996", - "Ferias Frustradas do Pica-Pau (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_feriasRomInfo, sms_feriasRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// FIFA International Soccer (Bra) - -static struct BurnRomInfo sms_fifaRomDesc[] = { - { "fifa international soccer (brazil) (en,es,pt).bin", 0x80000, 0x9bb3b5f9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fifa) -STD_ROM_FN(sms_fifa) - -struct BurnDriver BurnDrvsms_fifa = { - "sms_fifa", NULL, NULL, NULL, "1994", - "FIFA International Soccer (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fifaRomInfo, sms_fifaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fire and Forget II (Euro) - -static struct BurnRomInfo sms_fireforgRomDesc[] = { - { "fire and forget ii (europe).bin", 0x40000, 0xf6ad7b1d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fireforg) -STD_ROM_FN(sms_fireforg) - -struct BurnDriver BurnDrvsms_fireforg = { - "sms_fireforg", NULL, NULL, NULL, "1990", - "Fire and Forget II (Euro)\0", NULL, "Titus Arcade", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fireforgRomInfo, sms_fireforgRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fire and Ice (Bra) - -static struct BurnRomInfo sms_fireiceRomDesc[] = { - { "fire and ice (brazil).bin", 0x40000, 0x8b24a640, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fireice) -STD_ROM_FN(sms_fireice) - -struct BurnDriver BurnDrvsms_fireice = { - "sms_fireice", NULL, NULL, NULL, "1993", - "Fire and Ice (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_fireiceRomInfo, sms_fireiceRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Flash (Euro, Bra) - -static struct BurnRomInfo sms_flashRomDesc[] = { - { "flash, the (europe).bin", 0x40000, 0xbe31d63f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_flash) -STD_ROM_FN(sms_flash) - -struct BurnDriver BurnDrvsms_flash = { - "sms_flash", NULL, NULL, NULL, "1993", - "The Flash (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_flashRomInfo, sms_flashRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Flashpoint (Kor) - -static struct BurnRomInfo sms_fpointRomDesc[] = { - { "flashpoint (kr).bin", 0x08000, 0x61e8806f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_fpoint) -STD_ROM_FN(sms_fpoint) - -struct BurnDriver BurnDrvsms_fpoint = { - "sms_fpoint", NULL, NULL, NULL, "199?", - "Flashpoint (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_fpointRomInfo, sms_fpointRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Flintstones (Euro, Bra) - -static struct BurnRomInfo sms_flintRomDesc[] = { - { "mpr-13701-f.ic1", 0x40000, 0xca5c78a5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_flint) -STD_ROM_FN(sms_flint) - -struct BurnDriver BurnDrvsms_flint = { - "sms_flint", NULL, NULL, NULL, "1991", - "The Flintstones (Euro, Bra)\0", NULL, "Grandslam", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_flintRomInfo, sms_flintRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// George Foreman's KO Boxing (Euro, Bra) - -static struct BurnRomInfo sms_georgekoRomDesc[] = { - { "george foreman's ko boxing (europe).bin", 0x40000, 0xa64898ce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_georgeko) -STD_ROM_FN(sms_georgeko) - -struct BurnDriver BurnDrvsms_georgeko = { - "sms_georgeko", NULL, NULL, NULL, "1992", - "George Foreman's KO Boxing (Euro, Bra)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_georgekoRomInfo, sms_georgekoRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Forgotten Worlds (Euro, Bra, Aus) - -static struct BurnRomInfo sms_forgottnRomDesc[] = { - { "mpr-13706-f.ic1", 0x40000, 0x38c53916, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_forgottn) -STD_ROM_FN(sms_forgottn) - -struct BurnDriver BurnDrvsms_forgottn = { - "sms_forgottn", NULL, NULL, NULL, "1991", - "Forgotten Worlds (Euro, Bra, Aus)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_forgottnRomInfo, sms_forgottnRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fushigi no Oshiro Pit Pot (Jpn, Pirate?) - -static struct BurnRomInfo sms_pitpot1RomDesc[] = { - { "fushigi no oshiro pit pot [hack].bin", 0x08000, 0x5d08e823, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pitpot1) -STD_ROM_FN(sms_pitpot1) - -struct BurnDriver BurnDrvsms_pitpot1 = { - "sms_pitpot1", "sms_pitpot", NULL, NULL, "1985", - "Fushigi no Oshiro Pit Pot (Jpn, Pirate?)\0", NULL, "pirate", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pitpot1RomInfo, sms_pitpot1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gaegujangi Ggachi (Kor) - -static struct BurnRomInfo sms_gaegujanRomDesc[] = { - { "gaegujangi ggachi (korea) (unl).bin", 0x80000, 0x8b40f6bf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gaegujan) -STD_ROM_FN(sms_gaegujan) - -struct BurnDriver BurnDrvsms_gaegujan = { - "sms_gaegujan", NULL, NULL, NULL, "19??", - "Gaegujangi Ggachi (Kor)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_gaegujanRomInfo, sms_gaegujanRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gain Ground (Euro, Bra) - -static struct BurnRomInfo sms_ggroundRomDesc[] = { - { "gain ground (europe).bin", 0x40000, 0x3ec5e627, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gground) -STD_ROM_FN(sms_gground) - -struct BurnDriver BurnDrvsms_gground = { - "sms_gground", NULL, NULL, NULL, "1990", - "Gain Ground (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ggroundRomInfo, sms_ggroundRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gain Ground (Euro, Prototype) - -static struct BurnRomInfo sms_ggroundpRomDesc[] = { - { "gain ground [proto].bin", 0x40000, 0xd40d03c7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ggroundp) -STD_ROM_FN(sms_ggroundp) - -struct BurnDriver BurnDrvsms_ggroundp = { - "sms_ggroundp", "sms_gground", NULL, NULL, "1990", - "Gain Ground (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ggroundpRomInfo, sms_ggroundpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Galactic Protector (Jpn) - -static struct BurnRomInfo sms_galactprRomDesc[] = { - { "mpr-11385.ic1", 0x20000, 0xa6fa42d0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_galactpr) -STD_ROM_FN(sms_galactpr) - -struct BurnDriver BurnDrvsms_galactpr = { - "sms_galactpr", NULL, NULL, NULL, "1988", - "Galactic Protector (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_galactprRomInfo, sms_galactprRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Galaxian (Kor) - -static struct BurnRomInfo sms_galaxianRomDesc[] = { - { "galaxian [kr].bin", 0x08000, 0x577ec227, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_galaxian) -STD_ROM_FN(sms_galaxian) - -struct BurnDriver BurnDrvsms_galaxian = { - "sms_galaxian", NULL, NULL, NULL, "199?", - "Galaxian (Kor)\0", NULL, "HiCom", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_galaxianRomInfo, sms_galaxianRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Galaxy Force (Euro, Bra) - -static struct BurnRomInfo sms_gforceRomDesc[] = { - { "mpr-12566a.ic2", 0x80000, 0xa4ac35d8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gforce) -STD_ROM_FN(sms_gforce) - -struct BurnDriver BurnDrvsms_gforce = { - "sms_gforce", NULL, NULL, NULL, "1989", - "Galaxy Force (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_gforceRomInfo, sms_gforceRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Galaxy Force (USA) - -static struct BurnRomInfo sms_gforceuRomDesc[] = { - { "galaxy force (usa).bin", 0x80000, 0x6c827520, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gforceu) -STD_ROM_FN(sms_gforceu) - -struct BurnDriver BurnDrvsms_gforceu = { - "sms_gforceu", "sms_gforce", NULL, NULL, "1989", - "Galaxy Force (USA)\0", NULL, "Activision", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_gforceuRomInfo, sms_gforceuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Game Box Serie Esportes Radicais (Bra) - -static struct BurnRomInfo sms_gameboxRomDesc[] = { - { "mpr-18796.ic1", 0x40000, 0x1890f407, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gamebox) -STD_ROM_FN(sms_gamebox) - -struct BurnDriver BurnDrvsms_gamebox = { - "sms_gamebox", NULL, NULL, NULL, "19??", - "Game Box Serie Esportes Radicais (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_gameboxRomInfo, sms_gameboxRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gangcheol RoboCop (Kor) - -static struct BurnRomInfo sms_robocopRomDesc[] = { - { "gangcheol robocop (kr).bin", 0x10000, 0xad522efd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_robocop) -STD_ROM_FN(sms_robocop) - -struct BurnDriver BurnDrvsms_robocop = { - "sms_robocop", NULL, NULL, NULL, "1992", - "Gangcheol RoboCop (Kor)\0", NULL, "Sieco", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_robocopRomInfo, sms_robocopRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gangster Town (Euro, USA, Bra) - -static struct BurnRomInfo sms_gangsterRomDesc[] = { - { "mpr-11049.ic1", 0x20000, 0x5fc74d2a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gangster) -STD_ROM_FN(sms_gangster) - -struct BurnDriver BurnDrvsms_gangster = { - "sms_gangster", NULL, NULL, NULL, "1987", - "Gangster Town (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_gangsterRomInfo, sms_gangsterRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gauntlet (Euro, Bra) - -static struct BurnRomInfo sms_gauntletRomDesc[] = { - { "gauntlet (europe).bin", 0x20000, 0xd9190956, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gauntlet) -STD_ROM_FN(sms_gauntlet) - -struct BurnDriver BurnDrvsms_gauntlet = { - "sms_gauntlet", NULL, NULL, NULL, "1990", - "Gauntlet (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_gauntletRomInfo, sms_gauntletRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Golden Axe (Euro, USA) - -static struct BurnRomInfo sms_goldnaxeRomDesc[] = { - { "mpr-13166.ic1", 0x80000, 0xc08132fb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_goldnaxe) -STD_ROM_FN(sms_goldnaxe) - -struct BurnDriver BurnDrvsms_goldnaxe = { - "sms_goldnaxe", NULL, NULL, NULL, "1989", - "Golden Axe (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_goldnaxeRomInfo, sms_goldnaxeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Golden Axe Warrior (Euro, USA, Bra) - -static struct BurnRomInfo sms_gaxewarrRomDesc[] = { - { "mpr-13664-f.ic1", 0x40000, 0xc7ded988, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gaxewarr) -STD_ROM_FN(sms_gaxewarr) - -struct BurnDriver BurnDrvsms_gaxewarr = { - "sms_gaxewarr", NULL, NULL, NULL, "1990", - "Golden Axe Warrior (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_gaxewarrRomInfo, sms_gaxewarrRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Geraldinho (Bra) - -static struct BurnRomInfo sms_geraldRomDesc[] = { - { "geraldinho (brazil).bin", 0x08000, 0x956c416b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gerald) -STD_ROM_FN(sms_gerald) - -struct BurnDriver BurnDrvsms_gerald = { - "sms_gerald", "sms_teddyboy", NULL, NULL, "19??", - "Geraldinho (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_geraldRomInfo, sms_geraldRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ghostbusters (Euro, USA, Kor) - -static struct BurnRomInfo sms_ghostbstRomDesc[] = { - { "mpr-10516.ic1", 0x20000, 0x1ddc3059, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ghostbst) -STD_ROM_FN(sms_ghostbst) - -struct BurnDriver BurnDrvsms_ghostbst = { - "sms_ghostbst", NULL, NULL, NULL, "1989", - "Ghostbusters (Euro, USA, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ghostbstRomInfo, sms_ghostbstRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ghost House (Euro, USA, Bra) - -static struct BurnRomInfo sms_ghosthRomDesc[] = { - { "mpr-12586.ic1", 0x08000, 0xf1f8ff2d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ghosth) -STD_ROM_FN(sms_ghosth) - -struct BurnDriver BurnDrvsms_ghosth = { - "sms_ghosth", NULL, NULL, NULL, "1986", - "Ghost House (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ghosthRomInfo, sms_ghosthRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ghost House (Jpn, Pirate?) - -static struct BurnRomInfo sms_ghosthj1RomDesc[] = { - { "ghost house (j) [hack].bin", 0x08000, 0xdabcc054, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ghosthj1) -STD_ROM_FN(sms_ghosthj1) - -struct BurnDriver BurnDrvsms_ghosthj1 = { - "sms_ghosthj1", "sms_ghosth", NULL, NULL, "1986", - "Ghost House (Jpn, Pirate?)\0", NULL, "pirate", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ghosthj1RomInfo, sms_ghosthj1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ghost House (Kor) - -static struct BurnRomInfo sms_ghosthkRomDesc[] = { - { "ghost house (kr).bin", 0x08000, 0x1203afc9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ghosthk) -STD_ROM_FN(sms_ghosthk) - -struct BurnDriver BurnDrvsms_ghosthk = { - "sms_ghosthk", "sms_ghosth", NULL, NULL, "198?", - "Ghost House (Kor)\0", NULL, "Samsung", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ghosthkRomInfo, sms_ghosthkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ghouls'n Ghosts (Euro, USA, Bra) - -static struct BurnRomInfo sms_ghoulsRomDesc[] = { - { "ghouls'n ghosts (usa, europe).bin", 0x40000, 0x7a92eba6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ghouls) -STD_ROM_FN(sms_ghouls) - -struct BurnDriver BurnDrvsms_ghouls = { - "sms_ghouls", NULL, NULL, NULL, "1988", - "Ghouls'n Ghosts (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ghoulsRomInfo, sms_ghoulsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ghouls'n Ghosts (USA, Demo) - -static struct BurnRomInfo sms_ghoulsdRomDesc[] = { - { "ghouls'n ghosts [demo].bin", 0x08000, 0x96ca6902, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ghoulsd) -STD_ROM_FN(sms_ghoulsd) - -struct BurnDriver BurnDrvsms_ghoulsd = { - "sms_ghoulsd", "sms_ghouls", NULL, NULL, "1988", - "Ghouls'n Ghosts (USA, Demo)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ghoulsdRomInfo, sms_ghoulsdRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Global Defense (Euro, USA) - -static struct BurnRomInfo sms_globaldRomDesc[] = { - { "mpr-11274.ic1", 0x20000, 0xb746a6f5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_globald) -STD_ROM_FN(sms_globald) - -struct BurnDriver BurnDrvsms_globald = { - "sms_globald", NULL, NULL, NULL, "1987", - "Global Defense (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_globaldRomInfo, sms_globaldRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Global Defense (Euro, USA, Prototype) - -static struct BurnRomInfo sms_globaldpRomDesc[] = { - { "global defense (usa, europe) (beta).bin", 0x20000, 0x91a0fc4e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_globaldp) -STD_ROM_FN(sms_globaldp) - -struct BurnDriver BurnDrvsms_globaldp = { - "sms_globaldp", "sms_globald", NULL, NULL, "1987", - "Global Defense (Euro, USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_globaldpRomInfo, sms_globaldpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// G-LOC Air Battle (Euro, Bra, Kor) - -static struct BurnRomInfo sms_glocRomDesc[] = { - { "g-loc air battle (europe).bin", 0x40000, 0x05cdc24e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gloc) -STD_ROM_FN(sms_gloc) - -struct BurnDriver BurnDrvsms_gloc = { - "sms_gloc", NULL, NULL, NULL, "1991", - "G-LOC Air Battle (Euro, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_glocRomInfo, sms_glocRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Golfamania (Euro, Bra) - -static struct BurnRomInfo sms_golfamanRomDesc[] = { - { "mpr-13144.ic1", 0x40000, 0x48651325, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_golfaman) -STD_ROM_FN(sms_golfaman) - -struct BurnDriver BurnDrvsms_golfaman = { - "sms_golfaman", NULL, NULL, NULL, "1990", - "Golfamania (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_golfamanRomInfo, sms_golfamanRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Golfamania (Prototype) - -static struct BurnRomInfo sms_golfamanpRomDesc[] = { - { "golfamania (europe) (beta).bin", 0x40000, 0x5dabfdc3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_golfamanp) -STD_ROM_FN(sms_golfamanp) - -struct BurnDriver BurnDrvsms_golfamanp = { - "sms_golfamanp", "sms_golfaman", NULL, NULL, "1990", - "Golfamania (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_golfamanpRomInfo, sms_golfamanpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Golvellius (Euro, USA) - -static struct BurnRomInfo sms_golvellRomDesc[] = { - { "mpr-11935f.ic1", 0x40000, 0xa51376fe, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_golvell) -STD_ROM_FN(sms_golvell) - -struct BurnDriver BurnDrvsms_golvell = { - "sms_golvell", NULL, NULL, NULL, "1988", - "Golvellius (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_golvellRomInfo, sms_golvellRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// GP Rider (Euro, Bra) - -static struct BurnRomInfo sms_gpriderRomDesc[] = { - { "gp rider (europe).bin", 0x80000, 0xec2da554, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gprider) -STD_ROM_FN(sms_gprider) - -struct BurnDriver BurnDrvsms_gprider = { - "sms_gprider", NULL, NULL, NULL, "1993", - "GP Rider (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_gpriderRomInfo, sms_gpriderRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Baseball (Euro, USA, Bra) - -static struct BurnRomInfo sms_greatbasRomDesc[] = { - { "mpr-10415 w11.ic1", 0x20000, 0x10ed6b57, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatbas) -STD_ROM_FN(sms_greatbas) - -struct BurnDriver BurnDrvsms_greatbas = { - "sms_greatbas", NULL, NULL, NULL, "1985", - "Great Baseball (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatbasRomInfo, sms_greatbasRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Baseball (Jpn, Pirate?) - -static struct BurnRomInfo sms_greatbasj1RomDesc[] = { - { "great baseball (j) [hack].bin", 0x08000, 0xc1e699db, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatbasj1) -STD_ROM_FN(sms_greatbasj1) - -struct BurnDriver BurnDrvsms_greatbasj1 = { - "sms_greatbasj1", "sms_greatbas", NULL, NULL, "1985", - "Great Baseball (Jpn, Pirate?)\0", NULL, "pirate", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatbasj1RomInfo, sms_greatbasj1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Basketball (World) - -static struct BurnRomInfo sms_greatbskRomDesc[] = { - { "mpr-11073.ic1", 0x20000, 0x2ac001eb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatbsk) -STD_ROM_FN(sms_greatbsk) - -struct BurnDriver BurnDrvsms_greatbsk = { - "sms_greatbsk", NULL, NULL, NULL, "1987", - "Great Basketball (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatbskRomInfo, sms_greatbskRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Football (World) - -static struct BurnRomInfo sms_greatftbRomDesc[] = { - { "mpr-10576.ic1", 0x20000, 0x2055825f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatftb) -STD_ROM_FN(sms_greatftb) - -struct BurnDriver BurnDrvsms_greatftb = { - "sms_greatftb", NULL, NULL, NULL, "1987", - "Great Football (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatftbRomInfo, sms_greatftbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Golf (Euro, USA) ~ Masters Golf (Japan) - -static struct BurnRomInfo sms_greatglfRomDesc[] = { - { "mpr-11192 w36.ic1", 0x20000, 0x98e4ae4a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatglf) -STD_ROM_FN(sms_greatglf) - -struct BurnDriver BurnDrvsms_greatglf = { - "sms_greatglf", NULL, NULL, NULL, "1987", - "Great Golf (Euro, USA) ~ Masters Golf (Japan)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatglfRomInfo, sms_greatglfRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Golf (Euro, USA, v1.0) - -static struct BurnRomInfo sms_greatglf1RomDesc[] = { - { "great golf (ue) (v1.0) [!].bin", 0x20000, 0xc6611c84, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatglf1) -STD_ROM_FN(sms_greatglf1) - -struct BurnDriver BurnDrvsms_greatglf1 = { - "sms_greatglf1", "sms_greatglf", NULL, NULL, "1987", - "Great Golf (Euro, USA, v1.0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatglf1RomInfo, sms_greatglf1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Golf (Prototype) - -static struct BurnRomInfo sms_greatglfpRomDesc[] = { - { "great golf (world) (beta).bin", 0x20000, 0x4847bc91, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatglfp) -STD_ROM_FN(sms_greatglfp) - -struct BurnDriver BurnDrvsms_greatglfp = { - "sms_greatglfp", "sms_greatglf", NULL, NULL, "1987", - "Great Golf (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatglfpRomInfo, sms_greatglfpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Golf (Jpn) - -static struct BurnRomInfo sms_greatgljRomDesc[] = { - { "great golf (japan).bin", 0x20000, 0x6586bd1f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatglj) -STD_ROM_FN(sms_greatglj) - -struct BurnDriver BurnDrvsms_greatglj = { - "sms_greatglj", NULL, NULL, NULL, "1986", - "Great Golf (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatgljRomInfo, sms_greatgljRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Golf (Kor) - -static struct BurnRomInfo sms_greatglkRomDesc[] = { - { "great golf [jp] (kr).sms", 0x20000, 0x5def1bf5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatglk) -STD_ROM_FN(sms_greatglk) - -struct BurnDriver BurnDrvsms_greatglk = { - "sms_greatglk", "sms_greatglj", NULL, NULL, "19??", - "Great Golf (Kor)\0", NULL, "Samsung?", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatglkRomInfo, sms_greatglkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Ice Hockey (Jpn, USA) - -static struct BurnRomInfo sms_greaticeRomDesc[] = { - { "mpr-10389.ic1", 0x10000, 0x0cb7e21f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatice) -STD_ROM_FN(sms_greatice) - -struct BurnDriver BurnDrvsms_greatice = { - "sms_greatice", NULL, NULL, NULL, "1987", - "Great Ice Hockey (Jpn, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greaticeRomInfo, sms_greaticeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Soccer (Euro) - -static struct BurnRomInfo sms_greatscrRomDesc[] = { - { "great soccer (europe).bin", 0x08000, 0x0ed170c9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatscr) -STD_ROM_FN(sms_greatscr) - -struct BurnDriver BurnDrvsms_greatscr = { - "sms_greatscr", NULL, NULL, NULL, "1985", - "Great Soccer (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatscrRomInfo, sms_greatscrRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Soccer (Tw) - -static struct BurnRomInfo sms_greatscrtwRomDesc[] = { - { "great soccer (tw).bin", 0x08000, 0x84665648, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatscrtw) -STD_ROM_FN(sms_greatscrtw) - -struct BurnDriver BurnDrvsms_greatscrtw = { - "sms_greatscrtw", "sms_greatscr", NULL, NULL, "1985?", - "Great Soccer (Tw)\0", NULL, "Aaronix", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatscrtwRomInfo, sms_greatscrtwRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Volleyball (Euro, USA, Bra) - -static struct BurnRomInfo sms_greatvolRomDesc[] = { - { "great volleyball (usa, europe).bin", 0x20000, 0x8d43ea95, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatvol) -STD_ROM_FN(sms_greatvol) - -struct BurnDriver BurnDrvsms_greatvol = { - "sms_greatvol", NULL, NULL, NULL, "1987", - "Great Volleyball (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatvolRomInfo, sms_greatvolRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Volleyball (Jpn) - -static struct BurnRomInfo sms_greatvoljRomDesc[] = { - { "great volleyball (japan).bin", 0x20000, 0x6819b0c0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatvolj) -STD_ROM_FN(sms_greatvolj) - -struct BurnDriver BurnDrvsms_greatvolj = { - "sms_greatvolj", "sms_greatvol", NULL, NULL, "1987", - "Great Volleyball (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatvoljRomInfo, sms_greatvoljRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gun.Smoke (Kor) - -static struct BurnRomInfo sms_gunsmokeRomDesc[] = { - { "gun.smoke (kr).bin", 0x08000, 0x3af7ccad, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_gunsmoke) -STD_ROM_FN(sms_gunsmoke) - -struct BurnDriver BurnDrvsms_gunsmoke = { - "sms_gunsmoke", NULL, NULL, NULL, "1990", - "Gun.Smoke (Kor)\0", NULL, "ProSoft", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_gunsmokeRomInfo, sms_gunsmokeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Haja no Fuuin (Jpn) - -static struct BurnRomInfo sms_hajafuinRomDesc[] = { - { "haja no fuuin (japan).bin", 0x40000, 0xb9fdf6d9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hajafuin) -STD_ROM_FN(sms_hajafuin) - -struct BurnDriver BurnDrvsms_hajafuin = { - "sms_hajafuin", "sms_miracle", NULL, NULL, "1987", - "Haja no Fuuin (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hajafuinRomInfo, sms_hajafuinRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hang-On (Euro, Bra, Aus) - -static struct BurnRomInfo sms_hangonRomDesc[] = { - { "hang-on (europe).bin", 0x08000, 0x071b045e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hangon) -STD_ROM_FN(sms_hangon) - -struct BurnDriver BurnDrvsms_hangon = { - "sms_hangon", NULL, NULL, NULL, "1985", - "Hang-On (Euro, Bra, Aus)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hangonRomInfo, sms_hangonRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hang-On and Astro Warrior (USA) - -static struct BurnRomInfo sms_hangonawRomDesc[] = { - { "mpr-11125.ic1", 0x20000, 0x1c5059f0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hangonaw) -STD_ROM_FN(sms_hangonaw) - -struct BurnDriver BurnDrvsms_hangonaw = { - "sms_hangonaw", NULL, NULL, NULL, "1986", - "Hang-On and Astro Warrior (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hangonawRomInfo, sms_hangonawRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hang-On and Safari Hunt (USA) - -static struct BurnRomInfo sms_hangonshRomDesc[] = { - { "mpr-10137 w02.ic1", 0x20000, 0xe167a561, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hangonsh) -STD_ROM_FN(sms_hangonsh) - -struct BurnDriver BurnDrvsms_hangonsh = { - "sms_hangonsh", NULL, NULL, NULL, "1986", - "Hang-On and Safari Hunt (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hangonshRomInfo, sms_hangonshRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hang-On and Safari Hunt (USA, Prototype) - -static struct BurnRomInfo sms_hangonshpRomDesc[] = { - { "hang-on and safari hunt [proto].bin", 0x20000, 0xa120b77f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hangonshp) -STD_ROM_FN(sms_hangonshp) - -struct BurnDriver BurnDrvsms_hangonshp = { - "sms_hangonshp", "sms_hangonsh", NULL, NULL, "1986", - "Hang-On and Safari Hunt (USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hangonshpRomInfo, sms_hangonshpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Heavyweight Champ (Euro) - -static struct BurnRomInfo sms_heavywRomDesc[] = { - { "heavyweight champ (europe).bin", 0x40000, 0xfdab876a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_heavyw) -STD_ROM_FN(sms_heavyw) - -struct BurnDriver BurnDrvsms_heavyw = { - "sms_heavyw", NULL, NULL, NULL, "1991", - "Heavyweight Champ (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_heavywRomInfo, sms_heavywRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Advanced Dungeons and Dragons - Heroes of the Lance (Euro, Bra) - -static struct BurnRomInfo sms_herolancRomDesc[] = { - { "heroes of the lance (europe).bin", 0x80000, 0xcde13ffb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_herolanc) -STD_ROM_FN(sms_herolanc) - -struct BurnDriver BurnDrvsms_herolanc = { - "sms_herolanc", NULL, NULL, NULL, "1991", - "Advanced Dungeons and Dragons - Heroes of the Lance (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_herolancRomInfo, sms_herolancRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// High School! Kimengumi (Jpn) - -static struct BurnRomInfo sms_highscRomDesc[] = { - { "high school! kimengumi (japan).bin", 0x20000, 0x9eb1aa4f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_highsc) -STD_ROM_FN(sms_highsc) - -struct BurnDriver BurnDrvsms_highsc = { - "sms_highsc", NULL, NULL, NULL, "1986", - "High School! Kimengumi (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_highscRomInfo, sms_highscRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hokuto no Ken (Jpn) - -static struct BurnRomInfo sms_hokutoRomDesc[] = { - { "hokuto no ken (japan).bin", 0x20000, 0x24f5fe8c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hokuto) -STD_ROM_FN(sms_hokuto) - -struct BurnDriver BurnDrvsms_hokuto = { - "sms_hokuto", "sms_blackblt", NULL, NULL, "1986", - "Hokuto no Ken (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hokutoRomInfo, sms_hokutoRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hokuto no Ken (Tw) - -static struct BurnRomInfo sms_hokutotwRomDesc[] = { - { "hokuto no ken (tw).bin", 0x20000, 0xc4ab363d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hokutotw) -STD_ROM_FN(sms_hokutotw) - -struct BurnDriver BurnDrvsms_hokutotw = { - "sms_hokutotw", "sms_blackblt", NULL, NULL, "1986?", - "Hokuto no Ken (Tw)\0", NULL, "Aaronix", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hokutotwRomInfo, sms_hokutotwRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Home Alone (Euro) - -static struct BurnRomInfo sms_homeaRomDesc[] = { - { "home alone (europe).bin", 0x40000, 0xc9dbf936, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_homea) -STD_ROM_FN(sms_homea) - -struct BurnDriver BurnDrvsms_homea = { - "sms_homea", NULL, NULL, NULL, "1993", - "Home Alone (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_homeaRomInfo, sms_homeaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hook (Euro, Prototype) - -static struct BurnRomInfo sms_hookRomDesc[] = { - { "hook (europe) (proto).bin", 0x40000, 0x9ced34a7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hook) -STD_ROM_FN(sms_hook) - -struct BurnDriver BurnDrvsms_hook = { - "sms_hook", NULL, NULL, NULL, "19??", - "Hook (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hookRomInfo, sms_hookRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hoshi wo Sagashite... (Jpn) - -static struct BurnRomInfo sms_hoshiwRomDesc[] = { - { "mpr-11454.ic1", 0x40000, 0x955a009e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hoshiw) -STD_ROM_FN(sms_hoshiw) - -struct BurnDriver BurnDrvsms_hoshiw = { - "sms_hoshiw", NULL, NULL, NULL, "1988", - "Hoshi wo Sagashite... (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hoshiwRomInfo, sms_hoshiwRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hwarang Ui Geom (Kor) - -static struct BurnRomInfo sms_hwaranRomDesc[] = { - { "hwarang ui geom (korea).bin", 0x40000, 0xe4b7c56a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hwaran) -STD_ROM_FN(sms_hwaran) - -struct BurnDriver BurnDrvsms_hwaran = { - "sms_hwaran", "sms_kenseid", NULL, NULL, "1988", - "Hwarang Ui Geom (Kor)\0", NULL, "Samsung", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hwaranRomInfo, sms_hwaranRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Impossible Mission (Euro, Bra) - -static struct BurnRomInfo sms_impmissRomDesc[] = { - { "impossible mission (europe).bin", 0x20000, 0x64d6af3b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_impmiss) -STD_ROM_FN(sms_impmiss) - -struct BurnDriver BurnDrvsms_impmiss = { - "sms_impmiss", NULL, NULL, NULL, "1990", - "Impossible Mission (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_impmissRomInfo, sms_impmissRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Impossible Mission (Euro, Prototype) - -static struct BurnRomInfo sms_impmisspRomDesc[] = { - { "impossible mission (europe) (beta).bin", 0x20000, 0x71c4ca8f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_impmissp) -STD_ROM_FN(sms_impmissp) - -struct BurnDriver BurnDrvsms_impmissp = { - "sms_impmissp", "sms_impmiss", NULL, NULL, "1990", - "Impossible Mission (Euro, Prototype)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_impmisspRomInfo, sms_impmisspRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Incredible Crash Dummies (Euro, Bra) - -static struct BurnRomInfo sms_crashdumRomDesc[] = { - { "incredible crash dummies, the (europe).bin", 0x40000, 0xb4584dde, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_crashdum) -STD_ROM_FN(sms_crashdum) - -struct BurnDriver BurnDrvsms_crashdum = { - "sms_crashdum", NULL, NULL, NULL, "1993", - "The Incredible Crash Dummies (Euro, Bra)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_crashdumRomInfo, sms_crashdumRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Incredible Hulk (Euro, Bra) - -static struct BurnRomInfo sms_hulkRomDesc[] = { - { "incredible hulk, the (europe).bin", 0x80000, 0xbe9a7071, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hulk) -STD_ROM_FN(sms_hulk) - -struct BurnDriver BurnDrvsms_hulk = { - "sms_hulk", NULL, NULL, NULL, "1994", - "The Incredible Hulk (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hulkRomInfo, sms_hulkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Indiana Jones and the Last Crusade (Euro, Bra) - -static struct BurnRomInfo sms_indycrusRomDesc[] = { - { "mpr-13309.ic1", 0x40000, 0x8aeb574b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_indycrus) -STD_ROM_FN(sms_indycrus) - -struct BurnDriver BurnDrvsms_indycrus = { - "sms_indycrus", NULL, NULL, NULL, "1990", - "Indiana Jones and the Last Crusade (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_indycrusRomInfo, sms_indycrusRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Indiana Jones and the Last Crusade (Euro, Prototype) - -static struct BurnRomInfo sms_indycruspRomDesc[] = { - { "indiana jones and the last crusade (europe) (beta).bin", 0x40000, 0xacec894d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_indycrusp) -STD_ROM_FN(sms_indycrusp) - -struct BurnDriver BurnDrvsms_indycrusp = { - "sms_indycrusp", "sms_indycrus", NULL, NULL, "1990", - "Indiana Jones and the Last Crusade (Euro, Prototype)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_indycruspRomInfo, sms_indycruspRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// James 'Buster' Douglas Knockout Boxing (USA) - -static struct BurnRomInfo sms_jbdougkoRomDesc[] = { - { "james 'buster' douglas knockout boxing (usa).bin", 0x40000, 0x6a664405, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_jbdougko) -STD_ROM_FN(sms_jbdougko) - -struct BurnDriver BurnDrvsms_jbdougko = { - "sms_jbdougko", "sms_heavyw", NULL, NULL, "1990", - "James 'Buster' Douglas Knockout Boxing (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_jbdougkoRomInfo, sms_jbdougkoRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// James 'Buster' Douglas Knockout Boxing (USA, Prototype) - -static struct BurnRomInfo sms_jbdougkopRomDesc[] = { - { "james buster douglas knockout boxing [proto].bin", 0x40000, 0xcfb4bd7b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_jbdougkop) -STD_ROM_FN(sms_jbdougkop) - -struct BurnDriver BurnDrvsms_jbdougkop = { - "sms_jbdougkop", "sms_heavyw", NULL, NULL, "1990", - "James 'Buster' Douglas Knockout Boxing (USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_jbdougkopRomInfo, sms_jbdougkopRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// James Bond 007 - The Duel (Euro) - -static struct BurnRomInfo sms_jb007RomDesc[] = { - { "mpr-15484.ic1", 0x40000, 0x8d23587f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_jb007) -STD_ROM_FN(sms_jb007) - -struct BurnDriver BurnDrvsms_jb007 = { - "sms_jb007", NULL, NULL, NULL, "1993", - "James Bond 007 - The Duel (Euro)\0", NULL, "Domark", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_jb007RomInfo, sms_jb007RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// James Bond 007 - The Duel (Bra) - -static struct BurnRomInfo sms_jb007bRomDesc[] = { - { "james bond 007 - the duel (brazil).bin", 0x40000, 0x8feff688, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_jb007b) -STD_ROM_FN(sms_jb007b) - -struct BurnDriver BurnDrvsms_jb007b = { - "sms_jb007b", "sms_jb007", NULL, NULL, "1993", - "James Bond 007 - The Duel (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_jb007bRomInfo, sms_jb007bRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Janggun ui Adeul (Kor) - -static struct BurnRomInfo sms_janggunRomDesc[] = { - { "janggun ui adeul (kr).bin", 0x80000, 0x192949d5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_janggun) -STD_ROM_FN(sms_janggun) - -struct BurnDriver BurnDrvsms_janggun = { - "sms_janggun", NULL, NULL, NULL, "1992", - "Janggun ui Adeul (Kor)\0", NULL, "Daou Infosys", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_KOREA8K, GBF_MISC, 0, - SMSGetZipName, sms_janggunRomInfo, sms_janggunRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Jang Pung 3 (Kor) - -static struct BurnRomInfo sms_jangpun3RomDesc[] = { - { "jang pung 3 (kr).bin", 0x100000, 0x18fb98a3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_jangpun3) -STD_ROM_FN(sms_jangpun3) - -struct BurnDriver BurnDrvsms_jangpun3 = { - "sms_jangpun3", NULL, NULL, NULL, "1994", - "Jang Pung 3 (Kor)\0", NULL, "Sanghun", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_KOREA, GBF_MISC, 0, - SMSGetZipName, sms_jangpun3RomInfo, sms_jangpun3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Joe Montana Football (Euro, USA, Bra) - -static struct BurnRomInfo sms_joemontRomDesc[] = { - { "mpr-13605 t35.ic1", 0x40000, 0x0a9089e5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_joemont) -STD_ROM_FN(sms_joemont) - -struct BurnDriver BurnDrvsms_joemont = { - "sms_joemont", NULL, NULL, NULL, "1990", - "Joe Montana Football (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_joemontRomInfo, sms_joemontRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Jungle Book (Euro, Bra) - -static struct BurnRomInfo sms_jungleRomDesc[] = { - { "mpr-16057.ic1", 0x40000, 0x695a9a15, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_jungle) -STD_ROM_FN(sms_jungle) - -struct BurnDriver BurnDrvsms_jungle = { - "sms_jungle", NULL, NULL, NULL, "1994", - "The Jungle Book (Euro, Bra)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_jungleRomInfo, sms_jungleRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Jurassic Park (Euro) - -static struct BurnRomInfo sms_jparkRomDesc[] = { - { "jurassic park (europe).bin", 0x80000, 0x0667ed9f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_jpark) -STD_ROM_FN(sms_jpark) - -struct BurnDriver BurnDrvsms_jpark = { - "sms_jpark", NULL, NULL, NULL, "1993", - "Jurassic Park (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_jparkRomInfo, sms_jparkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kenseiden (Euro, USA, Bra) - -static struct BurnRomInfo sms_kenseidRomDesc[] = { - { "kenseiden (usa, europe).bin", 0x40000, 0x516ed32e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_kenseid) -STD_ROM_FN(sms_kenseid) - -struct BurnDriver BurnDrvsms_kenseid = { - "sms_kenseid", NULL, NULL, NULL, "1988", - "Kenseiden (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_kenseidRomInfo, sms_kenseidRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kenseiden (Jpn) - -static struct BurnRomInfo sms_kenseidjRomDesc[] = { - { "mpr-11488.ic1", 0x40000, 0x05ea5353, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_kenseidj) -STD_ROM_FN(sms_kenseidj) - -struct BurnDriver BurnDrvsms_kenseidj = { - "sms_kenseidj", "sms_kenseid", NULL, NULL, "1988", - "Kenseiden (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_kenseidjRomInfo, sms_kenseidjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// King's Quest - Quest for the Crown (USA) - -static struct BurnRomInfo sms_kingqstRomDesc[] = { - { "king's quest - quest for the crown (usa).bin", 0x20000, 0xf8d33bc4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_kingqst) -STD_ROM_FN(sms_kingqst) - -struct BurnDriver BurnDrvsms_kingqst = { - "sms_kingqst", NULL, NULL, NULL, "1989", - "King's Quest - Quest for the Crown (USA)\0", NULL, "Parker Brothers", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_kingqstRomInfo, sms_kingqstRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// King's Quest - Quest for the Crown (USA, Prototype) - -static struct BurnRomInfo sms_kingqstpRomDesc[] = { - { "king's quest - quest for the crown (usa) (beta).bin", 0x20000, 0xb7fe0a9d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_kingqstp) -STD_ROM_FN(sms_kingqstp) - -struct BurnDriver BurnDrvsms_kingqstp = { - "sms_kingqstp", "sms_kingqst", NULL, NULL, "1989", - "King's Quest - Quest for the Crown (USA, Prototype)\0", NULL, "Parker Brothers", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_kingqstpRomInfo, sms_kingqstpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// King and Balloon (Kor) - -static struct BurnRomInfo sms_kingballRomDesc[] = { - { "king and balloon (kr).sms", 0x08000, 0x0ae470e5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_kingball) -STD_ROM_FN(sms_kingball) - -struct BurnDriver BurnDrvsms_kingball = { - "sms_kingball", NULL, NULL, NULL, "19??", - "King and Balloon (Kor)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_kingballRomInfo, sms_kingballRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Klax (Euro) - -static struct BurnRomInfo sms_klaxRomDesc[] = { - { "klax (europe).bin", 0x20000, 0x2b435fd6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_klax) -STD_ROM_FN(sms_klax) - -struct BurnDriver BurnDrvsms_klax = { - "sms_klax", NULL, NULL, NULL, "1991", - "Klax (Euro)\0", NULL, "Tengen", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_klaxRomInfo, sms_klaxRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Knightmare II - The Maze of Galious (Kor) - -static struct BurnRomInfo sms_knightm2RomDesc[] = { - { "knightmare ii - the maze of galious [kr].bin", 0x20000, 0xf89af3cc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_knightm2) -STD_ROM_FN(sms_knightm2) - -struct BurnDriver BurnDrvsms_knightm2 = { - "sms_knightm2", NULL, NULL, NULL, "199?", - "Knightmare II - The Maze of Galious (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_knightm2RomInfo, sms_knightm2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Krusty's Fun House (Euro, Bra) - -static struct BurnRomInfo sms_krustyfhRomDesc[] = { - { "krusty's fun house (europe).bin", 0x40000, 0x64a585eb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_krustyfh) -STD_ROM_FN(sms_krustyfh) - -struct BurnDriver BurnDrvsms_krustyfh = { - "sms_krustyfh", NULL, NULL, NULL, "1992", - "Krusty's Fun House (Euro, Bra)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_krustyfhRomInfo, sms_krustyfhRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kujaku Ou (Jpn) - -static struct BurnRomInfo sms_kujakuRomDesc[] = { - { "kujaku ou (japan).bin", 0x80000, 0xd11d32e4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_kujaku) -STD_ROM_FN(sms_kujaku) - -struct BurnDriver BurnDrvsms_kujaku = { - "sms_kujaku", "sms_spellcst", NULL, NULL, "1988", - "Kujaku Ou (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_kujakuRomInfo, sms_kujakuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kung Fu Kid (Euro, USA, Bra) - -static struct BurnRomInfo sms_kungfukRomDesc[] = { - { "mpr-11069.ic1", 0x20000, 0x1e949d1f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_kungfuk) -STD_ROM_FN(sms_kungfuk) - -struct BurnDriver BurnDrvsms_kungfuk = { - "sms_kungfuk", NULL, NULL, NULL, "1987", - "Kung Fu Kid (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_kungfukRomInfo, sms_kungfukRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Land of Illusion Starring Mickey Mouse (Euro, Bra) - -static struct BurnRomInfo sms_landillRomDesc[] = { - { "mpr-15163.ic1", 0x80000, 0x24e97200, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_landill) -STD_ROM_FN(sms_landill) - -struct BurnDriver BurnDrvsms_landill = { - "sms_landill", NULL, NULL, NULL, "1992", - "Land of Illusion Starring Mickey Mouse (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_landillRomInfo, sms_landillRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Laser Ghost (Euro) - -static struct BurnRomInfo sms_lghostRomDesc[] = { - { "laser ghost (europe).bin", 0x40000, 0x0ca95637, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_lghost) -STD_ROM_FN(sms_lghost) - -struct BurnDriver BurnDrvsms_lghost = { - "sms_lghost", NULL, NULL, NULL, "1991", - "Laser Ghost (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_lghostRomInfo, sms_lghostRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Legend of Illusion Starring Mickey Mouse (Bra) - -static struct BurnRomInfo sms_legndillRomDesc[] = { - { "mpr-20989-s.ic1", 0x80000, 0x6350e649, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_legndill) -STD_ROM_FN(sms_legndill) - -struct BurnDriver BurnDrvsms_legndill = { - "sms_legndill", NULL, NULL, NULL, "1994", - "Legend of Illusion Starring Mickey Mouse (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_legndillRomInfo, sms_legndillRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lemmings (Euro, Bra, Kor) - -static struct BurnRomInfo sms_lemmingsRomDesc[] = { - { "mpr-15221-f.ic1", 0x40000, 0xf369b2d8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_lemmings) -STD_ROM_FN(sms_lemmings) - -struct BurnDriver BurnDrvsms_lemmings = { - "sms_lemmings", NULL, NULL, NULL, "1991", - "Lemmings (Euro, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_lemmingsRomInfo, sms_lemmingsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lemmings (Euro, Prototype) - -static struct BurnRomInfo sms_lemmingspRomDesc[] = { - { "lemmings (europe) (beta).bin", 0x40000, 0x2c61ed88, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_lemmingsp) -STD_ROM_FN(sms_lemmingsp) - -struct BurnDriver BurnDrvsms_lemmingsp = { - "sms_lemmingsp", "sms_lemmings", NULL, NULL, "1991", - "Lemmings (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_lemmingspRomInfo, sms_lemmingspRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lemmings 2 - The Tribes (Euro, Prototype) - -static struct BurnRomInfo sms_lemming2RomDesc[] = { - { "lemmings 2 - the tribes [proto].bin", 0x80000, 0xcf5aecca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_lemming2) -STD_ROM_FN(sms_lemming2) - -struct BurnDriver BurnDrvsms_lemming2 = { - "sms_lemming2", NULL, NULL, NULL, "1994", - "Lemmings 2 - The Tribes (Euro, Prototype)\0", NULL, "Psygnosis", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_lemming2RomInfo, sms_lemming2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Line of Fire (Euro, Bra, Kor) - -static struct BurnRomInfo sms_loffireRomDesc[] = { - { "line of fire (europe).bin", 0x80000, 0xcb09f355, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_loffire) -STD_ROM_FN(sms_loffire) - -struct BurnDriver BurnDrvsms_loffire = { - "sms_loffire", NULL, NULL, NULL, "1991", - "Line of Fire (Euro, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_loffireRomInfo, sms_loffireRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's The Lion King (Euro, Bra) - -static struct BurnRomInfo sms_lionkingRomDesc[] = { - { "lion king, the (europe).bin", 0x80000, 0xc352c7eb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_lionking) -STD_ROM_FN(sms_lionking) - -struct BurnDriver BurnDrvsms_lionking = { - "sms_lionking", NULL, NULL, NULL, "1994", - "Disney's The Lion King (Euro, Bra)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_lionkingRomInfo, sms_lionkingRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lord of the Sword (Euro, USA, Bra) - -static struct BurnRomInfo sms_lordswrdRomDesc[] = { - { "lord of the sword (usa, europe).bin", 0x40000, 0xe8511b08, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_lordswrd) -STD_ROM_FN(sms_lordswrd) - -struct BurnDriver BurnDrvsms_lordswrd = { - "sms_lordswrd", NULL, NULL, NULL, "1988", - "Lord of the Sword (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_lordswrdRomInfo, sms_lordswrdRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lord of Sword (Jpn) - -static struct BurnRomInfo sms_lordswrdjRomDesc[] = { - { "lord of sword (japan).bin", 0x40000, 0xaa7d6f45, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_lordswrdj) -STD_ROM_FN(sms_lordswrdj) - -struct BurnDriver BurnDrvsms_lordswrdj = { - "sms_lordswrdj", "sms_lordswrd", NULL, NULL, "1988", - "Lord of Sword (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_lordswrdjRomInfo, sms_lordswrdjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Loretta no Shouzou (Jpn) - -static struct BurnRomInfo sms_lorettaRomDesc[] = { - { "mpr-10517.ic2", 0x20000, 0x323f357f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_loretta) -STD_ROM_FN(sms_loretta) - -struct BurnDriver BurnDrvsms_loretta = { - "sms_loretta", NULL, NULL, NULL, "1987", - "Loretta no Shouzou (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_lorettaRomInfo, sms_lorettaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lucky Dime Caper Starring Donald Duck (Euro, Bra) - -static struct BurnRomInfo sms_luckydimRomDesc[] = { - { "mpr-14358-f.ic1", 0x40000, 0xa1710f13, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_luckydim) -STD_ROM_FN(sms_luckydim) - -struct BurnDriver BurnDrvsms_luckydim = { - "sms_luckydim", NULL, NULL, NULL, "1991", - "The Lucky Dime Caper Starring Donald Duck (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_luckydimRomInfo, sms_luckydimRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lucky Dime Caper Starring Donald Duck (Euro, Prototype) - -static struct BurnRomInfo sms_luckydimpRomDesc[] = { - { "lucky dime caper starring donald duck, the (europe) (beta).bin", 0x40000, 0x7f6d0df6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_luckydimp) -STD_ROM_FN(sms_luckydimp) - -struct BurnDriver BurnDrvsms_luckydimp = { - "sms_luckydimp", "sms_luckydim", NULL, NULL, "1991", - "The Lucky Dime Caper Starring Donald Duck (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_luckydimpRomInfo, sms_luckydimpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mahjong Sengoku Jidai (Jpn, HK) - -static struct BurnRomInfo sms_mjsengokRomDesc[] = { - { "mpr-11193.ic1", 0x20000, 0xbcfbfc67, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mjsengok) -STD_ROM_FN(sms_mjsengok) - -struct BurnDriver BurnDrvsms_mjsengok = { - "sms_mjsengok", NULL, NULL, NULL, "1987", - "Mahjong Sengoku Jidai (Jpn, HK)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mjsengokRomInfo, sms_mjsengokRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mahjong Sengoku Jidai (Jpn, Prototype) - -static struct BurnRomInfo sms_mjsengokpRomDesc[] = { - { "mahjong sengoku jidai (japan) (beta).bin", 0x20000, 0x996b2a07, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mjsengokp) -STD_ROM_FN(sms_mjsengokp) - -struct BurnDriver BurnDrvsms_mjsengokp = { - "sms_mjsengokp", "sms_mjsengok", NULL, NULL, "1987", - "Mahjong Sengoku Jidai (Jpn, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mjsengokpRomInfo, sms_mjsengokpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Makai Retsuden (Jpn) - -static struct BurnRomInfo sms_makairetRomDesc[] = { - { "mpr-10742.ic1", 0x20000, 0xca860451, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_makairet) -STD_ROM_FN(sms_makairet) - -struct BurnDriver BurnDrvsms_makairet = { - "sms_makairet", "sms_kungfuk", NULL, NULL, "1987", - "Makai Retsuden (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_makairetRomInfo, sms_makairetRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Maou Golvellius (Jpn) - -static struct BurnRomInfo sms_maougolvRomDesc[] = { - { "maou golvellius (japan).bin", 0x40000, 0xbf0411ad, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_maougolv) -STD_ROM_FN(sms_maougolv) - -struct BurnDriver BurnDrvsms_maougolv = { - "sms_maougolv", "sms_golvell", NULL, NULL, "1988", - "Maou Golvellius (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_maougolvRomInfo, sms_maougolvRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Maou Golvellius (Jpn, Prototype) - -static struct BurnRomInfo sms_maougolvpRomDesc[] = { - { "maou golvellius [proto] (jp).bin", 0x40000, 0x21a21352, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_maougolvp) -STD_ROM_FN(sms_maougolvp) - -struct BurnDriver BurnDrvsms_maougolvp = { - "sms_maougolvp", "sms_golvell", NULL, NULL, "1988", - "Maou Golvellius (Jpn, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_maougolvpRomInfo, sms_maougolvpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Marble Madness (Euro) - -static struct BurnRomInfo sms_marbleRomDesc[] = { - { "marble madness (europe).bin", 0x40000, 0xbf6f3e5f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_marble) -STD_ROM_FN(sms_marble) - -struct BurnDriver BurnDrvsms_marble = { - "sms_marble", NULL, NULL, NULL, "1992", - "Marble Madness (Euro)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_marbleRomInfo, sms_marbleRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Marksman Shooting and Trap Shooting and Safari Hunt (Euro, Bra) - -static struct BurnRomInfo sms_marksmanRomDesc[] = { - { "mpr-10157f.ic2", 0x20000, 0xe8215c2e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_marksman) -STD_ROM_FN(sms_marksman) - -struct BurnDriver BurnDrvsms_marksman = { - "sms_marksman", NULL, NULL, NULL, "1986", - "Marksman Shooting and Trap Shooting and Safari Hunt (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_marksmanRomInfo, sms_marksmanRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Marksman Shooting and Trap Shooting (USA) - -static struct BurnRomInfo sms_marksmanuRomDesc[] = { - { "marksman shooting and trap shooting (usa).bin", 0x20000, 0xe8ea842c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_marksmanu) -STD_ROM_FN(sms_marksmanu) - -struct BurnDriver BurnDrvsms_marksmanu = { - "sms_marksmanu", "sms_marksman", NULL, NULL, "1986", - "Marksman Shooting and Trap Shooting (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_marksmanuRomInfo, sms_marksmanuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Masters of Combat (Euro, Bra, Aus) - -static struct BurnRomInfo sms_mastcombRomDesc[] = { - { "masters of combat (europe).bin", 0x40000, 0x93141463, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mastcomb) -STD_ROM_FN(sms_mastcomb) - -struct BurnDriver BurnDrvsms_mastcomb = { - "sms_mastcomb", NULL, NULL, NULL, "1993", - "Masters of Combat (Euro, Bra, Aus)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mastcombRomInfo, sms_mastcombRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Master of Darkness (Euro, Bra) - -static struct BurnRomInfo sms_mastdarkRomDesc[] = { - { "mpr-15203-f.ic1", 0x40000, 0x96fb4d4b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mastdark) -STD_ROM_FN(sms_mastdark) - -struct BurnDriver BurnDrvsms_mastdark = { - "sms_mastdark", NULL, NULL, NULL, "1992", - "Master of Darkness (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mastdarkRomInfo, sms_mastdarkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Maze Hunter 3-D (Euro, USA, Bra) - -static struct BurnRomInfo sms_mazehuntRomDesc[] = { - { "mpr-11564.ic1", 0x20000, 0x31b8040b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mazehunt) -STD_ROM_FN(sms_mazehunt) - -struct BurnDriver BurnDrvsms_mazehunt = { - "sms_mazehunt", NULL, NULL, NULL, "1988", - "Maze Hunter 3-D (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mazehuntRomInfo, sms_mazehuntRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Maze Walker (Jpn) - -static struct BurnRomInfo sms_mazewalkRomDesc[] = { - { "mpr-11337.ic1", 0x20000, 0x871562b0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mazewalk) -STD_ROM_FN(sms_mazewalk) - -struct BurnDriver BurnDrvsms_mazewalk = { - "sms_mazewalk", "sms_mazehunt", NULL, NULL, "1988", - "Maze Walker (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mazewalkRomInfo, sms_mazewalkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Megumi Rescue (Jpn) - -static struct BurnRomInfo sms_megumiRomDesc[] = { - { "megumi rescue (japan).bin", 0x20000, 0x29bc7fad, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_megumi) -STD_ROM_FN(sms_megumi) - -struct BurnDriver BurnDrvsms_megumi = { - "sms_megumi", NULL, NULL, NULL, "1988", - "Megumi Rescue (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_megumiRomInfo, sms_megumiRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mercs (Euro, Bra) - -static struct BurnRomInfo sms_mercsRomDesc[] = { - { "mpr-14269-f.ic1", 0x80000, 0xd7416b83, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mercs) -STD_ROM_FN(sms_mercs) - -struct BurnDriver BurnDrvsms_mercs = { - "sms_mercs", NULL, NULL, NULL, "1990", - "Mercs (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mercsRomInfo, sms_mercsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mickey's Ultimate Challenge (Bra) - -static struct BurnRomInfo sms_mickeyucRomDesc[] = { - { "mickey's ultimate challenge (brazil).bin", 0x40000, 0x25051dd5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mickeyuc) -STD_ROM_FN(sms_mickeyuc) - -struct BurnDriver BurnDrvsms_mickeyuc = { - "sms_mickeyuc", NULL, NULL, NULL, "1998", - "Mickey's Ultimate Challenge (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mickeyucRomInfo, sms_mickeyucRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mick and Mack as the Global Gladiators (Euro, Bra) - -static struct BurnRomInfo sms_mickmackRomDesc[] = { - { "mpr-15510-f.ic1", 0x40000, 0xb67ceb76, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mickmack) -STD_ROM_FN(sms_mickmack) - -struct BurnDriver BurnDrvsms_mickmack = { - "sms_mickmack", NULL, NULL, NULL, "1993", - "Mick and Mack as the Global Gladiators (Euro, Bra)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mickmackRomInfo, sms_mickmackRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Micro Machines (Euro) - -static struct BurnRomInfo sms_micromacRomDesc[] = { - { "micro machines (europe).bin", 0x40000, 0xa577ce46, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_micromac) -STD_ROM_FN(sms_micromac) - -struct BurnDriver BurnDrvsms_micromac = { - "sms_micromac", NULL, NULL, NULL, "1994", - "Micro Machines (Euro)\0", NULL, "Codemasters", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_micromacRomInfo, sms_micromacRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Show do Milhão (Bra, Prototype) - -static struct BurnRomInfo sms_sdmilhaoRomDesc[] = { - { "milhao.bin", 0x20000, 0x58423688, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sdmilhao) -STD_ROM_FN(sms_sdmilhao) - -struct BurnDriver BurnDrvsms_sdmilhao = { - "sms_sdmilhao", NULL, NULL, NULL, "2003", - "Show do Milhao (Bra, Prototype)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sdmilhaoRomInfo, sms_sdmilhaoRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Miracle Warriors - Seal of the Dark Lord (Euro, USA, Bra) - -static struct BurnRomInfo sms_miracleRomDesc[] = { - { "miracle warriors - seal of the dark lord (usa, europe).bin", 0x40000, 0x0e333b6e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_miracle) -STD_ROM_FN(sms_miracle) - -struct BurnDriver BurnDrvsms_miracle = { - "sms_miracle", NULL, NULL, NULL, "1987", - "Miracle Warriors - Seal of the Dark Lord (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_miracleRomInfo, sms_miracleRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Miracle Warriors - Seal of the Dark Lord (Prototype) - -static struct BurnRomInfo sms_miraclepRomDesc[] = { - { "miracle warriors - seal of the dark lord (usa, europe) (beta).bin", 0x40000, 0x301a59aa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_miraclep) -STD_ROM_FN(sms_miraclep) - -struct BurnDriver BurnDrvsms_miraclep = { - "sms_miraclep", "sms_miracle", NULL, NULL, "1987", - "Miracle Warriors - Seal of the Dark Lord (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_miraclepRomInfo, sms_miraclepRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Missile Defense 3-D (Euro, USA, Bra) - -static struct BurnRomInfo sms_missil3dRomDesc[] = { - { "mpr-10844 w29.ic1", 0x20000, 0xfbe5cfbb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_missil3d) -STD_ROM_FN(sms_missil3d) - -struct BurnDriver BurnDrvsms_missil3d = { - "sms_missil3d", NULL, NULL, NULL, "19??", - "Missile Defense 3-D (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_missil3dRomInfo, sms_missil3dRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mortal Kombat (Euro, Bra) - -static struct BurnRomInfo sms_mkRomDesc[] = { - { "mpr-15757.ic1", 0x80000, 0x302dc686, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mk) -STD_ROM_FN(sms_mk) - -struct BurnDriver BurnDrvsms_mk = { - "sms_mk", NULL, NULL, NULL, "1993", - "Mortal Kombat (Euro, Bra)\0", NULL, "Arena", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mkRomInfo, sms_mkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mortal Kombat II (Euro, Bra) - -static struct BurnRomInfo sms_mk2RomDesc[] = { - { "mortal kombat ii (europe).bin", 0x80000, 0x2663bf18, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mk2) -STD_ROM_FN(sms_mk2) - -struct BurnDriver BurnDrvsms_mk2 = { - "sms_mk2", NULL, NULL, NULL, "1994", - "Mortal Kombat II (Euro, Bra)\0", NULL, "Acclaim Entertainment", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mk2RomInfo, sms_mk2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mortal Kombat 3 (Bra) - -static struct BurnRomInfo sms_mk3RomDesc[] = { - { "mortal kombat 3 (brazil).bin", 0x80000, 0x395ae757, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mk3) -STD_ROM_FN(sms_mk3) - -struct BurnDriver BurnDrvsms_mk3 = { - "sms_mk3", NULL, NULL, NULL, "1996", - "Mortal Kombat 3 (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mk3RomInfo, sms_mk3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mônica no Castelo do Dragao (Bra) - -static struct BurnRomInfo sms_monicaRomDesc[] = { - { "monica no castelo do dragao (brazil).bin", 0x40000, 0x01d67c0b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_monica) -STD_ROM_FN(sms_monica) - -struct BurnDriver BurnDrvsms_monica = { - "sms_monica", "sms_wboymlnd", NULL, NULL, "1991", - "Monica no Castelo do Dragao (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_monicaRomInfo, sms_monicaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Monopoly (Euro) - -static struct BurnRomInfo sms_monopolyRomDesc[] = { - { "monopoly (usa, europe).bin", 0x20000, 0x026d94a4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_monopoly) -STD_ROM_FN(sms_monopoly) - -struct BurnDriver BurnDrvsms_monopoly = { - "sms_monopoly", NULL, NULL, NULL, "1988", - "Monopoly (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_monopolyRomInfo, sms_monopolyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Monopoly (USA) - -static struct BurnRomInfo sms_monopolyuRomDesc[] = { - { "monopoly (usa).bin", 0x20000, 0x69538469, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_monopolyu) -STD_ROM_FN(sms_monopolyu) - -struct BurnDriver BurnDrvsms_monopolyu = { - "sms_monopolyu", "sms_monopoly", NULL, NULL, "1988", - "Monopoly (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_monopolyuRomInfo, sms_monopolyuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Monopoly (USA, Prototype) - -static struct BurnRomInfo sms_monopolypRomDesc[] = { - { "monopoly [proto].bin", 0x20000, 0x7e9d87fc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_monopolyp) -STD_ROM_FN(sms_monopolyp) - -struct BurnDriver BurnDrvsms_monopolyp = { - "sms_monopolyp", "sms_monopoly", NULL, NULL, "1988", - "Monopoly (USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_monopolypRomInfo, sms_monopolypRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Montezuma's Revenge Featuring Panama Joe (USA) - -static struct BurnRomInfo sms_montezumRomDesc[] = { - { "mpr-12402.ic1", 0x20000, 0x82fda895, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_montezum) -STD_ROM_FN(sms_montezum) - -struct BurnDriver BurnDrvsms_montezum = { - "sms_montezum", NULL, NULL, NULL, "1989", - "Montezuma's Revenge Featuring Panama Joe (USA)\0", NULL, "Parker Brothers", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_montezumRomInfo, sms_montezumRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Montezuma's Revenge Featuring Panama Joe (USA, Prototype) - -static struct BurnRomInfo sms_montezumpRomDesc[] = { - { "montezuma's revenge - featuring panama joe [proto].bin", 0x20000, 0x575d0fcf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_montezump) -STD_ROM_FN(sms_montezump) - -struct BurnDriver BurnDrvsms_montezump = { - "sms_montezump", "sms_montezum", NULL, NULL, "1989", - "Montezuma's Revenge Featuring Panama Joe (USA, Prototype)\0", NULL, "Parker Brothers", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_montezumpRomInfo, sms_montezumpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mopiranger (Kor) - -static struct BurnRomInfo sms_mopirangRomDesc[] = { - { "mopiranger (kr).bin", 0x08000, 0xb49aa6fc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mopirang) -STD_ROM_FN(sms_mopirang) - -struct BurnDriver BurnDrvsms_mopirang = { - "sms_mopirang", NULL, NULL, NULL, "19??", - "Mopiranger (Kor)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_mopirangRomInfo, sms_mopirangRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ms. Pac-Man (Euro, Bra) - -static struct BurnRomInfo sms_mspacmanRomDesc[] = { - { "ms. pac-man (europe).bin", 0x20000, 0x3cd816c6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mspacman) -STD_ROM_FN(sms_mspacman) - -struct BurnDriver BurnDrvsms_mspacman = { - "sms_mspacman", NULL, NULL, NULL, "1991", - "Ms. Pac-Man (Euro, Bra)\0", NULL, "Tengen", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mspacmanRomInfo, sms_mspacmanRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Michael Jackson's Moonwalker (Euro, USA, Bra, Kor) - -static struct BurnRomInfo sms_mwalkRomDesc[] = { - { "michael jackson's moonwalker (usa, europe).bin", 0x40000, 0x56cc906b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mwalk) -STD_ROM_FN(sms_mwalk) - -struct BurnDriver BurnDrvsms_mwalk = { - "sms_mwalk", NULL, NULL, NULL, "1990", - "Michael Jackson's Moonwalker (Euro, USA, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mwalkRomInfo, sms_mwalkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Michael Jackson's Moonwalker (USA, Prototype) - -static struct BurnRomInfo sms_mwalkpRomDesc[] = { - { "michael jackson's moonwalker (usa, europe) (beta).bin", 0x40000, 0x54123936, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_mwalkp) -STD_ROM_FN(sms_mwalkp) - -struct BurnDriver BurnDrvsms_mwalkp = { - "sms_mwalkp", "sms_mwalk", NULL, NULL, "1990", - "Michael Jackson's Moonwalker (USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_mwalkpRomInfo, sms_mwalkpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Micro Xevious (Kor) - -static struct BurnRomInfo sms_xeviousRomDesc[] = { - { "micro xevious, the (kr).bin", 0x08000, 0x41cc2ade, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_xevious) -STD_ROM_FN(sms_xevious) - -struct BurnDriver BurnDrvsms_xevious = { - "sms_xevious", NULL, NULL, NULL, "1990", - "The Micro Xevious (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_xeviousRomInfo, sms_xeviousRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// My Hero (Euro, USA, Bra) - -static struct BurnRomInfo sms_myheroRomDesc[] = { - { "my hero (usa, europe).bin", 0x08000, 0x62f0c23d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_myhero) -STD_ROM_FN(sms_myhero) - -struct BurnDriver BurnDrvsms_myhero = { - "sms_myhero", NULL, NULL, NULL, "1986", - "My Hero (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_myheroRomInfo, sms_myheroRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Jam (Euro, Prototype) - -static struct BurnRomInfo sms_nbajamRomDesc[] = { - { "nba jam [proto].bin", 0x80000, 0x332a847d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_nbajam) -STD_ROM_FN(sms_nbajam) - -struct BurnDriver BurnDrvsms_nbajam = { - "sms_nbajam", NULL, NULL, NULL, "1994", - "NBA Jam (Euro, Prototype)\0", NULL, "Acclaim", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_nbajamRomInfo, sms_nbajamRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Golf (Prototype) - -static struct BurnRomInfo sms_supgolfRomDesc[] = { - { "super golf [proto].bin", 0x40000, 0x7f7b568d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_supgolf) -STD_ROM_FN(sms_supgolf) - -struct BurnDriver BurnDrvsms_supgolf = { - "sms_supgolf", "sms_golfaman", NULL, NULL, "1989", - "Super Golf (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_supgolfRomInfo, sms_supgolfRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Nekkyuu Koushien (Jpn) - -static struct BurnRomInfo sms_nekkyuRomDesc[] = { - { "mpr-11886.ic1", 0x40000, 0x5b5f9106, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_nekkyu) -STD_ROM_FN(sms_nekkyu) - -struct BurnDriver BurnDrvsms_nekkyu = { - "sms_nekkyu", NULL, NULL, NULL, "1988", - "Nekkyuu Koushien (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_nekkyuRomInfo, sms_nekkyuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Nemesis (Kor) - -static struct BurnRomInfo sms_nemesisRomDesc[] = { - { "nemesis (kr).bin", 0x20000, 0xe316c06d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_nemesis) -STD_ROM_FN(sms_nemesis) - -struct BurnDriver BurnDrvsms_nemesis = { - "sms_nemesis", NULL, NULL, NULL, "1987", - "Nemesis (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX_NEMESIS, GBF_MISC, 0, - SMSGetZipName, sms_nemesisRomInfo, sms_nemesisRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Nemesis 2 (Kor) - -static struct BurnRomInfo sms_nemesis2RomDesc[] = { - { "nemesis 2 (kr).bin", 0x20000, 0x0a77fa5e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_nemesis2) -STD_ROM_FN(sms_nemesis2) - -struct BurnDriver BurnDrvsms_nemesis2 = { - "sms_nemesis2", NULL, NULL, NULL, "1987", - "Nemesis 2 (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_nemesis2RomInfo, sms_nemesis2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Ninja (Euro, USA) - -static struct BurnRomInfo sms_ninjaRomDesc[] = { - { "mpr-11046.ic1", 0x20000, 0x66a15bd9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ninja) -STD_ROM_FN(sms_ninja) - -struct BurnDriver BurnDrvsms_ninja = { - "sms_ninja", NULL, NULL, NULL, "1986", - "The Ninja (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ninjaRomInfo, sms_ninjaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Ninja (Jpn) - -static struct BurnRomInfo sms_ninjajRomDesc[] = { - { "mpr-10409.ic1", 0x20000, 0x320313ec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ninjaj) -STD_ROM_FN(sms_ninjaj) - -struct BurnDriver BurnDrvsms_ninjaj = { - "sms_ninjaj", "sms_ninja", NULL, NULL, "1986", - "The Ninja (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ninjajRomInfo, sms_ninjajRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ninja Gaiden (Euro, Bra) - -static struct BurnRomInfo sms_ngaidenRomDesc[] = { - { "mpr-14677.ic1", 0x40000, 0x1b1d8cc2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ngaiden) -STD_ROM_FN(sms_ngaiden) - -struct BurnDriver BurnDrvsms_ngaiden = { - "sms_ngaiden", NULL, NULL, NULL, "1992", - "Ninja Gaiden (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ngaidenRomInfo, sms_ngaidenRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ninja Gaiden (Euro, Prototype) - -static struct BurnRomInfo sms_ngaidenpRomDesc[] = { - { "ninja gaiden (europe) (beta).bin", 0x40000, 0x761e9396, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ngaidenp) -STD_ROM_FN(sms_ngaidenp) - -struct BurnDriver BurnDrvsms_ngaidenp = { - "sms_ngaidenp", "sms_ngaiden", NULL, NULL, "1992", - "Ninja Gaiden (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ngaidenpRomInfo, sms_ngaidenpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Olympic Gold (Euro) - -static struct BurnRomInfo sms_olympgldRomDesc[] = { - { "mpr-14754-f.ic1", 0x40000, 0x6a5a1e39, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_olympgld) -STD_ROM_FN(sms_olympgld) - -struct BurnDriver BurnDrvsms_olympgld = { - "sms_olympgld", NULL, NULL, NULL, "1992", - "Olympic Gold (Euro)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_olympgldRomInfo, sms_olympgldRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Olympic Gold (Kor) - -static struct BurnRomInfo sms_olympgldkRomDesc[] = { - { "olympic gold (korea) (en,fr,de,es,it,nl,pt,sv).bin", 0x40000, 0xd1a7b1aa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_olympgldk) -STD_ROM_FN(sms_olympgldk) - -struct BurnDriver BurnDrvsms_olympgldk = { - "sms_olympgldk", "sms_olympgld", NULL, NULL, "1992", - "Olympic Gold (Kor)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_olympgldkRomInfo, sms_olympgldkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Opa Opa (Jpn) - -static struct BurnRomInfo sms_opaopaRomDesc[] = { - { "opa opa (japan).bin", 0x20000, 0xbea27d5c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_opaopa) -STD_ROM_FN(sms_opaopa) - -struct BurnDriver BurnDrvsms_opaopa = { - "sms_opaopa", "sms_fantzonm", NULL, NULL, "1987", - "Opa Opa (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_opaopaRomInfo, sms_opaopaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Operation Wolf (Euro, Bra) - -static struct BurnRomInfo sms_opwolfRomDesc[] = { - { "operation wolf (europe).bin", 0x40000, 0x205caae8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_opwolf) -STD_ROM_FN(sms_opwolf) - -struct BurnDriver BurnDrvsms_opwolf = { - "sms_opwolf", NULL, NULL, NULL, "1990", - "Operation Wolf (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_opwolfRomInfo, sms_opwolfRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Ottifants (Euro, Bra) - -static struct BurnRomInfo sms_ottifantRomDesc[] = { - { "ottifants, the (europe) (en,fr,de,es,it).bin", 0x40000, 0x82ef2a7d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ottifant) -STD_ROM_FN(sms_ottifant) - -struct BurnDriver BurnDrvsms_ottifant = { - "sms_ottifant", NULL, NULL, NULL, "1993", - "The Ottifants (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ottifantRomInfo, sms_ottifantRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Out Run (World) - -static struct BurnRomInfo sms_outrunRomDesc[] = { - { "mpr-11078 w04.ic1", 0x40000, 0x5589d8d2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_outrun) -STD_ROM_FN(sms_outrun) - -struct BurnDriver BurnDrvsms_outrun = { - "sms_outrun", NULL, NULL, NULL, "1987", - "Out Run (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_outrunRomInfo, sms_outrunRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Out Run 3-D (Euro, Bra) - -static struct BurnRomInfo sms_outrun3dRomDesc[] = { - { "mpr-12130.ic1", 0x40000, 0xd6f43dda, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_outrun3d) -STD_ROM_FN(sms_outrun3d) - -struct BurnDriver BurnDrvsms_outrun3d = { - "sms_outrun3d", NULL, NULL, NULL, "1991", - "Out Run 3-D (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_outrun3dRomInfo, sms_outrun3dRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Out Run Europa (Euro, Bra) - -static struct BurnRomInfo sms_outrneurRomDesc[] = { - { "out run europa (europe).bin", 0x40000, 0x3932adbc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_outrneur) -STD_ROM_FN(sms_outrneur) - -struct BurnDriver BurnDrvsms_outrneur = { - "sms_outrneur", NULL, NULL, NULL, "1991", - "Out Run Europa (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_outrneurRomInfo, sms_outrneurRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pac-Mania (Euro) - -static struct BurnRomInfo sms_pacmaniaRomDesc[] = { - { "pac-mania (europe).bin", 0x20000, 0xbe57a9a5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pacmania) -STD_ROM_FN(sms_pacmania) - -struct BurnDriver BurnDrvsms_pacmania = { - "sms_pacmania", NULL, NULL, NULL, "1991", - "Pac-Mania (Euro)\0", NULL, "Tengen", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pacmaniaRomInfo, sms_pacmaniaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Paperboy (Euro, v0) - -static struct BurnRomInfo sms_paperboyRomDesc[] = { - { "paperboy (europe).bin", 0x20000, 0x294e0759, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_paperboy) -STD_ROM_FN(sms_paperboy) - -struct BurnDriver BurnDrvsms_paperboy = { - "sms_paperboy", NULL, NULL, NULL, "1990", - "Paperboy (Euro, v0)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_paperboyRomInfo, sms_paperboyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Paperboy (USA, Bra, v1) - -static struct BurnRomInfo sms_paperboyuRomDesc[] = { - { "mpr-13306a-m.ic1", 0x20000, 0x327a0b4c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_paperboyu) -STD_ROM_FN(sms_paperboyu) - -struct BurnDriver BurnDrvsms_paperboyu = { - "sms_paperboyu", "sms_paperboy", NULL, NULL, "1990", - "Paperboy (USA, Bra, v1)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_paperboyuRomInfo, sms_paperboyuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Parlour Games (Euro, USA) - -static struct BurnRomInfo sms_parlourRomDesc[] = { - { "mpr-11817-s.ic2", 0x20000, 0xe030e66c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_parlour) -STD_ROM_FN(sms_parlour) - -struct BurnDriver BurnDrvsms_parlour = { - "sms_parlour", NULL, NULL, NULL, "1987", - "Parlour Games (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_parlourRomInfo, sms_parlourRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pat Riley Basketball (USA, Prototype) - -static struct BurnRomInfo sms_patrileyRomDesc[] = { - { "pat riley basketball (usa) (proto).bin", 0x40000, 0x9aefe664, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_patriley) -STD_ROM_FN(sms_patriley) - -struct BurnDriver BurnDrvsms_patriley = { - "sms_patriley", NULL, NULL, NULL, "19??", - "Pat Riley Basketball (USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_patrileyRomInfo, sms_patrileyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Penguin Adventure (Kor) - -static struct BurnRomInfo sms_pengadvRomDesc[] = { - { "penguin adventure (kr).bin", 0x20000, 0x445525e2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pengadv) -STD_ROM_FN(sms_pengadv) - -struct BurnDriver BurnDrvsms_pengadv = { - "sms_pengadv", NULL, NULL, NULL, "199?", - "Penguin Adventure (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_pengadvRomInfo, sms_pengadvRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Penguin Land (Euro, USA) - -static struct BurnRomInfo sms_penglandRomDesc[] = { - { "mpr-11190.ic1", 0x20000, 0xf97e9875, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pengland) -STD_ROM_FN(sms_pengland) - -struct BurnDriver BurnDrvsms_pengland = { - "sms_pengland", NULL, NULL, NULL, "1987", - "Penguin Land (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_penglandRomInfo, sms_penglandRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// PGA Tour Golf (Euro) - -static struct BurnRomInfo sms_pgatourRomDesc[] = { - { "pga tour golf (europe).bin", 0x40000, 0x95b9ea95, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pgatour) -STD_ROM_FN(sms_pgatour) - -struct BurnDriver BurnDrvsms_pgatour = { - "sms_pgatour", NULL, NULL, NULL, "1991", - "PGA Tour Golf (Euro)\0", NULL, "Tengen", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_pgatourRomInfo, sms_pgatourRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// PitFighter - The Ultimate Challenge (Euro) - -static struct BurnRomInfo sms_pitfightRomDesc[] = { - { "pit fighter (europe).bin", 0x80000, 0xb840a446, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pitfight) -STD_ROM_FN(sms_pitfight) - -struct BurnDriver BurnDrvsms_pitfight = { - "sms_pitfight", NULL, NULL, NULL, "1991", - "PitFighter - The Ultimate Challenge (Euro)\0", NULL, "Domark", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_pitfightRomInfo, sms_pitfightRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// PitFighter - The Ultimate Challenge (Bra) - -static struct BurnRomInfo sms_pitfightbRomDesc[] = { - { "pit fighter (brazil).bin", 0x80000, 0xaa4d4b5a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pitfightb) -STD_ROM_FN(sms_pitfightb) - -struct BurnDriver BurnDrvsms_pitfightb = { - "sms_pitfightb", "sms_pitfight", NULL, NULL, "1991", - "PitFighter - The Ultimate Challenge (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pitfightbRomInfo, sms_pitfightbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pooyan (Kor) - -static struct BurnRomInfo sms_pooyanRomDesc[] = { - { "pooyan (kr).sms", 0x08000, 0xca082218, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pooyan) -STD_ROM_FN(sms_pooyan) - -struct BurnDriver BurnDrvsms_pooyan = { - "sms_pooyan", NULL, NULL, NULL, "19??", - "Pooyan (Kor)\0", NULL, "HiCom", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_NONE, GBF_MISC, 0, - SMSGetZipName, sms_pooyanRomInfo, sms_pooyanRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Populous (Euro, Bra) - -static struct BurnRomInfo sms_populousRomDesc[] = { - { "populous (europe).bin", 0x40000, 0xc7a1fdef, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_populous) -STD_ROM_FN(sms_populous) - -struct BurnDriver BurnDrvsms_populous = { - "sms_populous", NULL, NULL, NULL, "1989", - "Populous (Euro, Bra)\0", NULL, "TecMagik", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_populousRomInfo, sms_populousRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Poseidon Wars 3-D (Euro, USA, Bra) - -static struct BurnRomInfo sms_poseidonRomDesc[] = { - { "mpr-12122f.ic1", 0x40000, 0xabd48ad2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_poseidon) -STD_ROM_FN(sms_poseidon) - -struct BurnDriver BurnDrvsms_poseidon = { - "sms_poseidon", NULL, NULL, NULL, "1988", - "Poseidon Wars 3-D (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_poseidonRomInfo, sms_poseidonRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Power Strike (Euro, Bra, Kor) - -static struct BurnRomInfo sms_pstrikeRomDesc[] = { - { "mpr-11685 w48.ic1", 0x20000, 0x4077efd9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pstrike) -STD_ROM_FN(sms_pstrike) - -struct BurnDriver BurnDrvsms_pstrike = { - "sms_pstrike", NULL, NULL, NULL, "1988", - "Power Strike (Euro, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pstrikeRomInfo, sms_pstrikeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Power Strike II (Euro, Bra) - -static struct BurnRomInfo sms_pstrike2RomDesc[] = { - { "mpr-15671.ic1", 0x80000, 0xa109a6fe, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pstrike2) -STD_ROM_FN(sms_pstrike2) - -struct BurnDriver BurnDrvsms_pstrike2 = { - "sms_pstrike2", NULL, NULL, NULL, "1993", - "Power Strike II (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pstrike2RomInfo, sms_pstrike2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Prince of Persia (Euro, Bra) - -static struct BurnRomInfo sms_ppersiaRomDesc[] = { - { "prince of persia (europe).bin", 0x40000, 0x7704287d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ppersia) -STD_ROM_FN(sms_ppersia) - -struct BurnDriver BurnDrvsms_ppersia = { - "sms_ppersia", NULL, NULL, NULL, "1992", - "Prince of Persia (Euro, Bra)\0", NULL, "Domark", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ppersiaRomInfo, sms_ppersiaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Predator 2 (Euro) - -static struct BurnRomInfo sms_predatr2RomDesc[] = { - { "predator 2 (europe).bin", 0x40000, 0x0047b615, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_predatr2) -STD_ROM_FN(sms_predatr2) - -struct BurnDriver BurnDrvsms_predatr2 = { - "sms_predatr2", NULL, NULL, NULL, "1992", - "Predator 2 (Euro)\0", NULL, "Arena", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_predatr2RomInfo, sms_predatr2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Predator 2 (Bra) - -static struct BurnRomInfo sms_predatr2bRomDesc[] = { - { "predator 2 (br).bin", 0x40000, 0x2b54c82b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_predatr2b) -STD_ROM_FN(sms_predatr2b) - -struct BurnDriver BurnDrvsms_predatr2b = { - "sms_predatr2b", "sms_predatr2", NULL, NULL, "1992?", - "Predator 2 (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_predatr2bRomInfo, sms_predatr2bRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pro Wrestling (Euro, USA, Bra) - -static struct BurnRomInfo sms_prowresRomDesc[] = { - { "mpr-10154f.ic1", 0x20000, 0xfbde42d3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_prowres) -STD_ROM_FN(sms_prowres) - -struct BurnDriver BurnDrvsms_prowres = { - "sms_prowres", NULL, NULL, NULL, "1986", - "Pro Wrestling (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_prowresRomInfo, sms_prowresRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Pro Yakyuu Pennant Race (Jpn) - -static struct BurnRomInfo sms_proyakyuRomDesc[] = { - { "mpr-10749.ic1", 0x20000, 0xda9be8f0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_proyakyu) -STD_ROM_FN(sms_proyakyu) - -struct BurnDriver BurnDrvsms_proyakyu = { - "sms_proyakyu", NULL, NULL, NULL, "1987", - "The Pro Yakyuu Pennant Race (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_proyakyuRomInfo, sms_proyakyuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Phantasy Star (Euro, USA, v3) - -static struct BurnRomInfo sms_pstarRomDesc[] = { - { "mpr-11711at.ic2", 0x80000, 0x00bef1d7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pstar) -STD_ROM_FN(sms_pstar) - -struct BurnDriver BurnDrvsms_pstar = { - "sms_pstar", NULL, NULL, NULL, "1987", - "Phantasy Star (Euro, USA, v3)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pstarRomInfo, sms_pstarRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Phantasy Star (Euro, USA, v2) - -static struct BurnRomInfo sms_pstar1RomDesc[] = { - { "phantasy star (usa, europe) (v1.2).bin", 0x80000, 0xe4a65e79, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pstar1) -STD_ROM_FN(sms_pstar1) - -struct BurnDriver BurnDrvsms_pstar1 = { - "sms_pstar1", "sms_pstar", NULL, NULL, "1987", - "Phantasy Star (Euro, USA, v2)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pstar1RomInfo, sms_pstar1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Phantasy Star (Bra) - -static struct BurnRomInfo sms_pstarbRomDesc[] = { - { "phantasy star (brazil).bin", 0x80000, 0x75971bef, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pstarb) -STD_ROM_FN(sms_pstarb) - -struct BurnDriver BurnDrvsms_pstarb = { - "sms_pstarb", "sms_pstar", NULL, NULL, "1987", - "Phantasy Star (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pstarbRomInfo, sms_pstarbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Phantasy Star (Jpn) - -static struct BurnRomInfo sms_pstarjRomDesc[] = { - { "mpr-11198.ic1", 0x80000, 0x6605d36a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pstarj) -STD_ROM_FN(sms_pstarj) - -struct BurnDriver BurnDrvsms_pstarj = { - "sms_pstarj", "sms_pstar", NULL, NULL, "1987", - "Phantasy Star (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pstarjRomInfo, sms_pstarjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Phantasy Star (Jpn, MD - -static struct BurnRomInfo sms_pstarjmdRomDesc[] = { - { "phantasy star (j) (from saturn collection cd) [!].bin", 0x80000, 0x07301f83, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pstarjmd) -STD_ROM_FN(sms_pstarjmd) - -struct BurnDriver BurnDrvsms_pstarjmd = { - "sms_pstarjmd", "sms_pstar", NULL, NULL, "1994", - "Phantasy Star (Jpn, MD\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pstarjmdRomInfo, sms_pstarjmdRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Phantasy Star (Kor) - -static struct BurnRomInfo sms_pstarkRomDesc[] = { - { "phantasy star (korea).bin", 0x80000, 0x747e83b5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pstark) -STD_ROM_FN(sms_pstark) - -struct BurnDriver BurnDrvsms_pstark = { - "sms_pstark", "sms_pstar", NULL, NULL, "1987", - "Phantasy Star (Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pstarkRomInfo, sms_pstarkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Psychic World (Euro, Bra) - -static struct BurnRomInfo sms_psychicwRomDesc[] = { - { "psychic world (europe).bin", 0x40000, 0x5c0b1f0f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_psychicw) -STD_ROM_FN(sms_psychicw) - -struct BurnDriver BurnDrvsms_psychicw = { - "sms_psychicw", NULL, NULL, NULL, "1991", - "Psychic World (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_psychicwRomInfo, sms_psychicwRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Psycho Fox (Euro, USA, Bra) - -static struct BurnRomInfo sms_psychofRomDesc[] = { - { "psycho fox (usa, europe).bin", 0x40000, 0x97993479, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_psychof) -STD_ROM_FN(sms_psychof) - -struct BurnDriver BurnDrvsms_psychof = { - "sms_psychof", NULL, NULL, NULL, "1989", - "Psycho Fox (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_psychofRomInfo, sms_psychofRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Putt and Putter (Euro, Bra) - -static struct BurnRomInfo sms_puttputtRomDesc[] = { - { "putt and putter (europe).bin", 0x20000, 0x357d4f78, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_puttputt) -STD_ROM_FN(sms_puttputt) - -struct BurnDriver BurnDrvsms_puttputt = { - "sms_puttputt", NULL, NULL, NULL, "1992", - "Putt and Putter (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_puttputtRomInfo, sms_puttputtRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Putt and Putter (Euro, Prototype) - -static struct BurnRomInfo sms_puttputtpRomDesc[] = { - { "putt and putter (europe) (beta).bin", 0x20000, 0x8167ccc4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_puttputtp) -STD_ROM_FN(sms_puttputtp) - -struct BurnDriver BurnDrvsms_puttputtp = { - "sms_puttputtp", "sms_puttputt", NULL, NULL, "1992", - "Putt and Putter (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_puttputtpRomInfo, sms_puttputtpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Puznic (Kor) - -static struct BurnRomInfo sms_puznicRomDesc[] = { - { "puznic (kr).sms", 0x08000, 0x76e8265f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_puznic) -STD_ROM_FN(sms_puznic) - -struct BurnDriver BurnDrvsms_puznic = { - "sms_puznic", NULL, NULL, NULL, "1990", - "Puznic (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_puznicRomInfo, sms_puznicRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Quartet (Euro, USA) - -static struct BurnRomInfo sms_quartetRomDesc[] = { - { "mpr-10418 w15.ic1", 0x20000, 0xe0f34fa6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_quartet) -STD_ROM_FN(sms_quartet) - -struct BurnDriver BurnDrvsms_quartet = { - "sms_quartet", NULL, NULL, NULL, "1987", - "Quartet (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_quartetRomInfo, sms_quartetRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Quest for the Shaven Yak Starring Ren Hoëk and Stimpy (Bra) - -static struct BurnRomInfo sms_shavnyakRomDesc[] = { - { "quest for the shaven yak starring ren hoek and stimpy (brazil).bin", 0x80000, 0xf42e145c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_shavnyak) -STD_ROM_FN(sms_shavnyak) - -struct BurnDriver BurnDrvsms_shavnyak = { - "sms_shavnyak", NULL, NULL, NULL, "1993", - "Quest for the Shaven Yak Starring Ren Hoek and Stimpy (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_shavnyakRomInfo, sms_shavnyakRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rainbow Islands - The Story of Bubble Bobble 2 (Euro) - -static struct BurnRomInfo sms_rbislandRomDesc[] = { - { "rainbow islands - the story of bubble bobble 2 (europe).bin", 0x40000, 0xc172a22c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rbisland) -STD_ROM_FN(sms_rbisland) - -struct BurnDriver BurnDrvsms_rbisland = { - "sms_rbisland", NULL, NULL, NULL, "1993", - "Rainbow Islands - The Story of Bubble Bobble 2 (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rbislandRomInfo, sms_rbislandRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rainbow Islands - The Story of Bubble Bobble 2 (Bra) - -static struct BurnRomInfo sms_rbislandbRomDesc[] = { - { "rainbow islands - the story of bubble bobble 2 (brazil).bin", 0x40000, 0x00ec173a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rbislandb) -STD_ROM_FN(sms_rbislandb) - -struct BurnDriver BurnDrvsms_rbislandb = { - "sms_rbislandb", "sms_rbisland", NULL, NULL, "1993", - "Rainbow Islands - The Story of Bubble Bobble 2 (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rbislandbRomInfo, sms_rbislandbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rambo - First Blood Part II (USA) - -static struct BurnRomInfo sms_rambo2RomDesc[] = { - { "mpr-10407 w10.ic1", 0x20000, 0xbbda65f0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rambo2) -STD_ROM_FN(sms_rambo2) - -struct BurnDriver BurnDrvsms_rambo2 = { - "sms_rambo2", "sms_secret", NULL, NULL, "1986", - "Rambo - First Blood Part II (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rambo2RomInfo, sms_rambo2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rambo III (Euro, USA, Bra) - -static struct BurnRomInfo sms_rambo3RomDesc[] = { - { "mpr-12036f.ic1", 0x40000, 0xda5a7013, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rambo3) -STD_ROM_FN(sms_rambo3) - -struct BurnDriver BurnDrvsms_rambo3 = { - "sms_rambo3", NULL, NULL, NULL, "1988", - "Rambo III (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rambo3RomInfo, sms_rambo3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rampage (Euro, USA, Bra) - -static struct BurnRomInfo sms_rampageRomDesc[] = { - { "mpr-12042f.ic1", 0x40000, 0x42fc47ee, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rampage) -STD_ROM_FN(sms_rampage) - -struct BurnDriver BurnDrvsms_rampage = { - "sms_rampage", NULL, NULL, NULL, "1988", - "Rampage (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rampageRomInfo, sms_rampageRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rampart (Euro) - -static struct BurnRomInfo sms_rampartRomDesc[] = { - { "rampart (europe).bin", 0x40000, 0x426e5c8a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rampart) -STD_ROM_FN(sms_rampart) - -struct BurnDriver BurnDrvsms_rampart = { - "sms_rampart", NULL, NULL, NULL, "1991", - "Rampart (Euro)\0", NULL, "Tengen", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rampartRomInfo, sms_rampartRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rastan (Euro, USA, Bra) - -static struct BurnRomInfo sms_rastanRomDesc[] = { - { "rastan (usa, europe).bin", 0x40000, 0xc547eb1b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rastan) -STD_ROM_FN(sms_rastan) - -struct BurnDriver BurnDrvsms_rastan = { - "sms_rastan", NULL, NULL, NULL, "1988", - "Rastan (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rastanRomInfo, sms_rastanRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// R.C. Grand Prix (Euro, USA, Bra) - -static struct BurnRomInfo sms_rcgpRomDesc[] = { - { "mpr-12903 t24.ic1", 0x40000, 0x54316fea, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rcgp) -STD_ROM_FN(sms_rcgp) - -struct BurnDriver BurnDrvsms_rcgp = { - "sms_rcgp", NULL, NULL, NULL, "1989", - "R.C. Grand Prix (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rcgpRomInfo, sms_rcgpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// R.C. Grand Prix (Prototype) - -static struct BurnRomInfo sms_rcgppRomDesc[] = { - { "r.c. grand prix [proto].bin", 0x40000, 0x767f11b8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rcgpp) -STD_ROM_FN(sms_rcgpp) - -struct BurnDriver BurnDrvsms_rcgpp = { - "sms_rcgpp", "sms_rcgp", NULL, NULL, "1989", - "R.C. Grand Prix (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rcgppRomInfo, sms_rcgppRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Reggie Jackson Baseball (USA) - -static struct BurnRomInfo sms_regjacksRomDesc[] = { - { "reggie jackson baseball (usa).bin", 0x40000, 0x6d94bb0e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_regjacks) -STD_ROM_FN(sms_regjacks) - -struct BurnDriver BurnDrvsms_regjacks = { - "sms_regjacks", "sms_ameribb", NULL, NULL, "1988", - "Reggie Jackson Baseball (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_regjacksRomInfo, sms_regjacksRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Renegade (Euro, Bra) - -static struct BurnRomInfo sms_renegadeRomDesc[] = { - { "renegade (europe).bin", 0x40000, 0x3be7f641, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_renegade) -STD_ROM_FN(sms_renegade) - -struct BurnDriver BurnDrvsms_renegade = { - "sms_renegade", NULL, NULL, NULL, "1993", - "Renegade (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_renegadeRomInfo, sms_renegadeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rescue Mission (Euro, USA, Bra) - -static struct BurnRomInfo sms_rescuemsRomDesc[] = { - { "mpr-11400.ic1", 0x20000, 0x79ac8e7f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rescuems) -STD_ROM_FN(sms_rescuems) - -struct BurnDriver BurnDrvsms_rescuems = { - "sms_rescuems", NULL, NULL, NULL, "1988", - "Rescue Mission (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rescuemsRomInfo, sms_rescuemsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Road Fighter (Kor) - -static struct BurnRomInfo sms_roadfghtRomDesc[] = { - { "road fighter (kr).bin", 0x08000, 0x8034bd27, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_roadfght) -STD_ROM_FN(sms_roadfght) - -struct BurnDriver BurnDrvsms_roadfght = { - "sms_roadfght", NULL, NULL, NULL, "19??", - "Road Fighter (Kor)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_roadfghtRomInfo, sms_roadfghtRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Road Rash (Euro, Bra) - -static struct BurnRomInfo sms_roadrashRomDesc[] = { - { "road rash (europe).bin", 0x80000, 0xb876fc74, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_roadrash) -STD_ROM_FN(sms_roadrash) - -struct BurnDriver BurnDrvsms_roadrash = { - "sms_roadrash", NULL, NULL, NULL, "1993", - "Road Rash (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_roadrashRomInfo, sms_roadrashRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// James Pond 2 - Codename RoboCod (Euro, Bra) - -static struct BurnRomInfo sms_robocodRomDesc[] = { - { "james pond 2 - codename robocod (europe).bin", 0x80000, 0x102d5fea, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_robocod) -STD_ROM_FN(sms_robocod) - -struct BurnDriver BurnDrvsms_robocod = { - "sms_robocod", NULL, NULL, NULL, "1993", - "James Pond 2 - Codename RoboCod (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_robocodRomInfo, sms_robocodRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// RoboCop 3 (Euro, Bra) - -static struct BurnRomInfo sms_robocop3RomDesc[] = { - { "robocop 3 (europe).bin", 0x40000, 0x9f951756, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_robocop3) -STD_ROM_FN(sms_robocop3) - -struct BurnDriver BurnDrvsms_robocop3 = { - "sms_robocop3", NULL, NULL, NULL, "1993", - "RoboCop 3 (Euro, Bra)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_robocop3RomInfo, sms_robocop3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// RoboCop versus The Terminator (Euro, Bra) - -static struct BurnRomInfo sms_robotermRomDesc[] = { - { "robocop versus the terminator (europe).bin", 0x80000, 0x8212b754, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_roboterm) -STD_ROM_FN(sms_roboterm) - -struct BurnDriver BurnDrvsms_roboterm = { - "sms_roboterm", NULL, NULL, NULL, "1993", - "RoboCop versus The Terminator (Euro, Bra)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_robotermRomInfo, sms_robotermRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rocky (World) - -static struct BurnRomInfo sms_rockyRomDesc[] = { - { "mpr-11072 w01.ic1", 0x40000, 0x1bcc7be3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rocky) -STD_ROM_FN(sms_rocky) - -struct BurnDriver BurnDrvsms_rocky = { - "sms_rocky", NULL, NULL, NULL, "1987", - "Rocky (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rockyRomInfo, sms_rockyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// R-Type (World) - -static struct BurnRomInfo sms_rtypeRomDesc[] = { - { "mpr-12002 t13.ic2", 0x80000, 0xbb54b6b0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rtype) -STD_ROM_FN(sms_rtype) - -struct BurnDriver BurnDrvsms_rtype = { - "sms_rtype", NULL, NULL, NULL, "1988", - "R-Type (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rtypeRomInfo, sms_rtypeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// R-Type (Prototype) - -static struct BurnRomInfo sms_rtypepRomDesc[] = { - { "r-type (proto).bin", 0x80000, 0x0d0840d5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_rtypep) -STD_ROM_FN(sms_rtypep) - -struct BurnDriver BurnDrvsms_rtypep = { - "sms_rtypep", "sms_rtype", NULL, NULL, "1988", - "R-Type (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_rtypepRomInfo, sms_rtypepRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Running Battle (Euro, Bra) - -static struct BurnRomInfo sms_runningRomDesc[] = { - { "mpr-14252-f.ic1", 0x40000, 0x1fdae719, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_running) -STD_ROM_FN(sms_running) - -struct BurnDriver BurnDrvsms_running = { - "sms_running", NULL, NULL, NULL, "1991", - "Running Battle (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_runningRomInfo, sms_runningRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sagaia (Euro, Bra) - -static struct BurnRomInfo sms_sagaiaRomDesc[] = { - { "sagaia (europe).bin", 0x40000, 0x66388128, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sagaia) -STD_ROM_FN(sms_sagaia) - -struct BurnDriver BurnDrvsms_sagaia = { - "sms_sagaia", NULL, NULL, NULL, "1992", - "Sagaia (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sagaiaRomInfo, sms_sagaiaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sangokushi 3 (Kor) - -static struct BurnRomInfo sms_sangoku3RomDesc[] = { - { "sangokushi 3 (korea) (unl).bin", 0x100000, 0x97d03541, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sangoku3) -STD_ROM_FN(sms_sangoku3) - -struct BurnDriver BurnDrvsms_sangoku3 = { - "sms_sangoku3", NULL, NULL, NULL, "1994", - "Sangokushi 3 (Kor)\0", NULL, "Game Line", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_KOREA, GBF_MISC, 0, - SMSGetZipName, sms_sangoku3RomInfo, sms_sangoku3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sapo Xulé - O Mestre do Kung Fu (Bra) - -static struct BurnRomInfo sms_sapomestrRomDesc[] = { - { "sapo xule - o mestre do kung fu (brazil).bin", 0x40000, 0x890e83e4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sapomestr) -STD_ROM_FN(sms_sapomestr) - -struct BurnDriver BurnDrvsms_sapomestr = { - "sms_sapomestr", "sms_kungfuk", NULL, NULL, "1995", - "Sapo Xule - O Mestre do Kung Fu (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sapomestrRomInfo, sms_sapomestrRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// S.O.S Lagoa Poluida (Bra) - -static struct BurnRomInfo sms_sapososRomDesc[] = { - { "sapo xule - s.o.s lagoa poluida (brazil).bin", 0x20000, 0x7ab2946a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_saposos) -STD_ROM_FN(sms_saposos) - -struct BurnDriver BurnDrvsms_saposos = { - "sms_saposos", "sms_astrow", NULL, NULL, "1995", - "S.O.S Lagoa Poluida (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sapososRomInfo, sms_sapososRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sapo Xulé vs. Os Invasores do Brejo (Bra) - -static struct BurnRomInfo sms_sapoxuleRomDesc[] = { - { "sapo xule vs. os invasores do brejo (brazil).bin", 0x40000, 0x9a608327, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sapoxule) -STD_ROM_FN(sms_sapoxule) - -struct BurnDriver BurnDrvsms_sapoxule = { - "sms_sapoxule", "sms_psychof", NULL, NULL, "1995", - "Sapo Xule vs. Os Invasores do Brejo (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sapoxuleRomInfo, sms_sapoxuleRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Satellite 7 (Jpn, Pirate?) - -static struct BurnRomInfo sms_satell7aRomDesc[] = { - { "satellite 7 (j) [hack].bin", 0x08000, 0x87b9ecb8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_satell7a) -STD_ROM_FN(sms_satell7a) - -struct BurnDriver BurnDrvsms_satell7a = { - "sms_satell7a", "sms_satell7", NULL, NULL, "1985", - "Satellite 7 (Jpn, Pirate?)\0", NULL, "pirate", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_satell7aRomInfo, sms_satell7aRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Smurfs 2 (Euro) - -static struct BurnRomInfo sms_smurfs2RomDesc[] = { - { "schtroumpfs autour du monde, les (europe) (en,fr,de,es).bin", 0x40000, 0x97e5bb7d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_smurfs2) -STD_ROM_FN(sms_smurfs2) - -struct BurnDriver BurnDrvsms_smurfs2 = { - "sms_smurfs2", NULL, NULL, NULL, "1996", - "The Smurfs 2 (Euro)\0", NULL, "Infogrames", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_smurfs2RomInfo, sms_smurfs2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Smurfs 2 (Euro, Prototype) - -static struct BurnRomInfo sms_smurfs2pRomDesc[] = { - { "schtroumpfs autour du monde, les (europe) (en,fr,de,es) (beta).bin", 0x40000, 0x7982ae67, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_smurfs2p) -STD_ROM_FN(sms_smurfs2p) - -struct BurnDriver BurnDrvsms_smurfs2p = { - "sms_smurfs2p", "sms_smurfs2", NULL, NULL, "1996", - "The Smurfs 2 (Euro, Prototype)\0", NULL, "Infogrames", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_smurfs2pRomInfo, sms_smurfs2pRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Special Criminal Investigation (Euro) - -static struct BurnRomInfo sms_sciRomDesc[] = { - { "special criminal investigation (europe).bin", 0x40000, 0xfa8e4ca0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sci) -STD_ROM_FN(sms_sci) - -struct BurnDriver BurnDrvsms_sci = { - "sms_sci", NULL, NULL, NULL, "1992", - "Special Criminal Investigation (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sciRomInfo, sms_sciRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Special Criminal Investigation (Euro, Prototype) - -static struct BurnRomInfo sms_scipRomDesc[] = { - { "special criminal investigation (europe) (beta).bin", 0x40000, 0x1b7d2a20, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_scip) -STD_ROM_FN(sms_scip) - -struct BurnDriver BurnDrvsms_scip = { - "sms_scip", "sms_sci", NULL, NULL, "1992", - "Special Criminal Investigation (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_scipRomInfo, sms_scipRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Scramble Spirits (Euro, Bra) - -static struct BurnRomInfo sms_sspiritsRomDesc[] = { - { "scramble spirits (europe).bin", 0x40000, 0x9a8b28ec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sspirits) -STD_ROM_FN(sms_sspirits) - -struct BurnDriver BurnDrvsms_sspirits = { - "sms_sspirits", NULL, NULL, NULL, "1989", - "Scramble Spirits (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sspiritsRomInfo, sms_sspiritsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// SDI (Jpn) - -static struct BurnRomInfo sms_sdiRomDesc[] = { - { "mpr-11191.ic1", 0x20000, 0x1de2c2d0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sdi) -STD_ROM_FN(sms_sdi) - -struct BurnDriver BurnDrvsms_sdi = { - "sms_sdi", "sms_globald", NULL, NULL, "1987", - "SDI (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sdiRomInfo, sms_sdiRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Secret Command (Euro) - -static struct BurnRomInfo sms_secretRomDesc[] = { - { "secret command (europe).bin", 0x20000, 0x00529114, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_secret) -STD_ROM_FN(sms_secret) - -struct BurnDriver BurnDrvsms_secret = { - "sms_secret", NULL, NULL, NULL, "1986", - "Secret Command (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_secretRomInfo, sms_secretRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sega Chess (Euro, Bra) - -static struct BurnRomInfo sms_segachssRomDesc[] = { - { "sega chess (europe).bin", 0x40000, 0xa8061aef, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_segachss) -STD_ROM_FN(sms_segachss) - -struct BurnDriver BurnDrvsms_segachss = { - "sms_segachss", NULL, NULL, NULL, "1991", - "Sega Chess (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_segachssRomInfo, sms_segachssRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sega Graphic Board (Jpn, Prototype v2.0) - -static struct BurnRomInfo sms_segagfxRomDesc[] = { - { "graphic board v2.0.bin", 0x08000, 0x276aa542, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_segagfx) -STD_ROM_FN(sms_segagfx) - -struct BurnDriver BurnDrvsms_segagfx = { - "sms_segagfx", NULL, NULL, NULL, "1987", - "Sega Graphic Board (Jpn, Prototype v2.0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_segagfxRomInfo, sms_segagfxRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sega World Tournament Golf (Euro, Bra, Kor) - -static struct BurnRomInfo sms_segawtgRomDesc[] = { - { "sega world tournament golf (europe).bin", 0x40000, 0x296879dd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_segawtg) -STD_ROM_FN(sms_segawtg) - -struct BurnDriver BurnDrvsms_segawtg = { - "sms_segawtg", NULL, NULL, NULL, "1993", - "Sega World Tournament Golf (Euro, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_segawtgRomInfo, sms_segawtgRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Seishun Scandal (Jpn, Pirate?) - -static struct BurnRomInfo sms_seishun1RomDesc[] = { - { "seishyun scandal (j) [hack].bin", 0x08000, 0xbcd91d78, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_seishun1) -STD_ROM_FN(sms_seishun1) - -struct BurnDriver BurnDrvsms_seishun1 = { - "sms_seishun1", "sms_myhero", NULL, NULL, "1986", - "Seishun Scandal (Jpn, Pirate?)\0", NULL, "pirate", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_seishun1RomInfo, sms_seishun1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sensible Soccer (Euro) - -static struct BurnRomInfo sms_sensibleRomDesc[] = { - { "sensible soccer (europe).bin", 0x20000, 0xf8176918, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sensible) -STD_ROM_FN(sms_sensible) - -struct BurnDriver BurnDrvsms_sensible = { - "sms_sensible", NULL, NULL, NULL, "1993", - "Sensible Soccer (Euro)\0", NULL, "Sony Imagesoft", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sensibleRomInfo, sms_sensibleRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sky Jaguar (Kor) - -static struct BurnRomInfo sms_skyjagRomDesc[] = { - { "sky jaguar (kr).bin", 0x08000, 0x5b8e65e4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_skyjag) -STD_ROM_FN(sms_skyjag) - -struct BurnDriver BurnDrvsms_skyjag = { - "sms_skyjag", NULL, NULL, NULL, "199?", - "Sky Jaguar (Kor)\0", NULL, "Samsung", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_skyjagRomInfo, sms_skyjagRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Street Fighter II (Bra) - -static struct BurnRomInfo sms_sf2RomDesc[] = { - { "street fighter ii (brazil).bin", 0xc8000, 0x0f8287ec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sf2) -STD_ROM_FN(sms_sf2) - -struct BurnDriver BurnDrvsms_sf2 = { - "sms_sf2", NULL, NULL, NULL, "1997", - "Street Fighter II (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_sf2RomInfo, sms_sf2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shadow Dancer (Euro, Bra, Kor) - -static struct BurnRomInfo sms_shdancerRomDesc[] = { - { "shadow dancer (europe).bin", 0x80000, 0x3793c01a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_shdancer) -STD_ROM_FN(sms_shdancer) - -struct BurnDriver BurnDrvsms_shdancer = { - "sms_shdancer", NULL, NULL, NULL, "1991", - "Shadow Dancer (Euro, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM /*| HARDWARE_SMS_DISPLAY_PAL */, GBF_MISC, 0, - SMSGetZipName, sms_shdancerRomInfo, sms_shdancerRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shanghai (Euro, USA) - -static struct BurnRomInfo sms_shanghaiRomDesc[] = { - { "shanghai (usa, europe).bin", 0x20000, 0xaab67ec3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_shanghai) -STD_ROM_FN(sms_shanghai) - -struct BurnDriver BurnDrvsms_shanghai = { - "sms_shanghai", NULL, NULL, NULL, "1988", - "Shanghai (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_shanghaiRomInfo, sms_shanghaiRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shanghai (Prototype) - -static struct BurnRomInfo sms_shanghaipRomDesc[] = { - { "shanghai (usa, europe) (beta).bin", 0x20000, 0xd5d25156, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_shanghaip) -STD_ROM_FN(sms_shanghaip) - -struct BurnDriver BurnDrvsms_shanghaip = { - "sms_shanghaip", "sms_shanghai", NULL, NULL, "1988", - "Shanghai (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_shanghaipRomInfo, sms_shanghaipRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Space Harrier (Euro) - -static struct BurnRomInfo sms_sharrierRomDesc[] = { - { "mpr-11071.ic1", 0x40000, 0xca1d3752, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sharrier) -STD_ROM_FN(sms_sharrier) - -struct BurnDriver BurnDrvsms_sharrier = { - "sms_sharrier", NULL, NULL, NULL, "1986", - "Space Harrier (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sharrierRomInfo, sms_sharrierRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Space Harrier 3-D (Euro, USA, Bra) - -static struct BurnRomInfo sms_sharr3dRomDesc[] = { - { "mpr-11564.ic1", 0x40000, 0x6bd5c2bf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sharr3d) -STD_ROM_FN(sms_sharr3d) - -struct BurnDriver BurnDrvsms_sharr3d = { - "sms_sharr3d", NULL, NULL, NULL, "1988", - "Space Harrier 3-D (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sharr3dRomInfo, sms_sharr3dRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Space Harrier 3D (Jpn) - -static struct BurnRomInfo sms_sharr3djRomDesc[] = { - { "space harrier 3d (japan).bin", 0x40000, 0x156948f9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sharr3dj) -STD_ROM_FN(sms_sharr3dj) - -struct BurnDriver BurnDrvsms_sharr3dj = { - "sms_sharr3dj", "sms_sharr3d", NULL, NULL, "1988", - "Space Harrier 3D (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sharr3djRomInfo, sms_sharr3djRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Space Harrier (Jpn, USA) - -static struct BurnRomInfo sms_sharrierjuRomDesc[] = { - { "space harrier (japan).bin", 0x40000, 0xbeddf80e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sharrierju) -STD_ROM_FN(sms_sharrierju) - -struct BurnDriver BurnDrvsms_sharrierju = { - "sms_sharrierju", "sms_sharrier", NULL, NULL, "1986", - "Space Harrier (Jpn, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sharrierjuRomInfo, sms_sharrierjuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shinobi (Euro, USA, Bra, v1) - -static struct BurnRomInfo sms_shinobiRomDesc[] = { - { "shinobi (usa, europe).bin", 0x40000, 0x0c6fac4e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_shinobi) -STD_ROM_FN(sms_shinobi) - -struct BurnDriver BurnDrvsms_shinobi = { - "sms_shinobi", NULL, NULL, NULL, "1988", - "Shinobi (Euro, USA, Bra, v1)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_shinobiRomInfo, sms_shinobiRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shinobi (Jpn, Bra, v0) - -static struct BurnRomInfo sms_shinobijRomDesc[] = { - { "shinobi (japan).bin", 0x40000, 0xe1fff1bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_shinobij) -STD_ROM_FN(sms_shinobij) - -struct BurnDriver BurnDrvsms_shinobij = { - "sms_shinobij", "sms_shinobi", NULL, NULL, "1988", - "Shinobi (Jpn, Bra, v0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_shinobijRomInfo, sms_shinobijRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shooting Gallery (Euro, USA, Bra) - -static struct BurnRomInfo sms_shootingRomDesc[] = { - { "mpr-10515.ic1", 0x20000, 0x4b051022, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_shooting) -STD_ROM_FN(sms_shooting) - -struct BurnDriver BurnDrvsms_shooting = { - "sms_shooting", NULL, NULL, NULL, "1987", - "Shooting Gallery (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_shootingRomInfo, sms_shootingRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sítio do Picapau Amarelo (Bra) - -static struct BurnRomInfo sms_sitioRomDesc[] = { - { "sitio do picapau amarelo (brazil).bin", 0x100000, 0xabdf3923, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sitio) -STD_ROM_FN(sms_sitio) - -struct BurnDriver BurnDrvsms_sitio = { - "sms_sitio", NULL, NULL, NULL, "1997", - "Sitio do Picapau Amarelo (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sitioRomInfo, sms_sitioRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Slap Shot (USA, v2) - -static struct BurnRomInfo sms_slapshotRomDesc[] = { - { "slap shot (usa) (v1.2).bin", 0x40000, 0x702c3e98, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_slapshot) -STD_ROM_FN(sms_slapshot) - -struct BurnDriver BurnDrvsms_slapshot = { - "sms_slapshot", NULL, NULL, NULL, "1990", - "Slap Shot (USA, v2)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_slapshotRomInfo, sms_slapshotRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Slap Shot (Euro, v1) - -static struct BurnRomInfo sms_slapshotaRomDesc[] = { - { "slap shot (europe) (v1.1).bin", 0x40000, 0xd33b296a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_slapshota) -STD_ROM_FN(sms_slapshota) - -struct BurnDriver BurnDrvsms_slapshota = { - "sms_slapshota", "sms_slapshot", NULL, NULL, "1990", - "Slap Shot (Euro, v1)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_slapshotaRomInfo, sms_slapshotaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Slap Shot (Euro, v0) - -static struct BurnRomInfo sms_slapshotbRomDesc[] = { - { "mpr-12934.ic1", 0x40000, 0xc93bd0e9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_slapshotb) -STD_ROM_FN(sms_slapshotb) - -struct BurnDriver BurnDrvsms_slapshotb = { - "sms_slapshotb", "sms_slapshot", NULL, NULL, "1989", - "Slap Shot (Euro, v0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_slapshotbRomInfo, sms_slapshotbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Slap Shoot (Prototype) - -static struct BurnRomInfo sms_slapshotpRomDesc[] = { - { "slap shot (proto).bin", 0x40000, 0xfbb0a92a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_slapshotp) -STD_ROM_FN(sms_slapshotp) - -struct BurnDriver BurnDrvsms_slapshotp = { - "sms_slapshotp", "sms_slapshot", NULL, NULL, "1990", - "Slap Shoot (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_slapshotpRomInfo, sms_slapshotpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Monaco GP (Euro, Bra) - -static struct BurnRomInfo sms_smgpRomDesc[] = { - { "mpr-13289.ic1", 0x40000, 0x55bf81a0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_smgp) -STD_ROM_FN(sms_smgp) - -struct BurnDriver BurnDrvsms_smgp = { - "sms_smgp", NULL, NULL, NULL, "1990", - "Super Monaco GP (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_smgpRomInfo, sms_smgpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Monaco GP (USA) - -static struct BurnRomInfo sms_smgpuRomDesc[] = { - { "mpr-13295 t32.ic1", 0x40000, 0x3ef12baa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_smgpu) -STD_ROM_FN(sms_smgpu) - -struct BurnDriver BurnDrvsms_smgpu = { - "sms_smgpu", "sms_smgp", NULL, NULL, "1990", - "Super Monaco GP (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_smgpuRomInfo, sms_smgpuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Monaco GP (Euro, Prototype) - -static struct BurnRomInfo sms_smgpp1RomDesc[] = { - { "super monaco gp [proto 1].bin", 0x40000, 0xdd7adbcc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_smgpp1) -STD_ROM_FN(sms_smgpp1) - -struct BurnDriver BurnDrvsms_smgpp1 = { - "sms_smgpp1", "sms_smgp", NULL, NULL, "1990", - "Super Monaco GP (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_smgpp1RomInfo, sms_smgpp1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Monaco GP (Euro, Older Prototype) - -static struct BurnRomInfo sms_smgpp2RomDesc[] = { - { "super monaco gp (proto).bin", 0x40000, 0xa1d6d963, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_smgpp2) -STD_ROM_FN(sms_smgpp2) - -struct BurnDriver BurnDrvsms_smgpp2 = { - "sms_smgpp2", "sms_smgp", NULL, NULL, "1990", - "Super Monaco GP (Euro, Older Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_smgpp2RomInfo, sms_smgpp2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Promocao Especial M. System III Compact (Bra, Sample) - -static struct BurnRomInfo sms_sms3sampRomDesc[] = { - { "promocao especial m. system iii compact (brazil) (sample).bin", 0x08000, 0x30af0233, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sms3samp) -STD_ROM_FN(sms_sms3samp) - -struct BurnDriver BurnDrvsms_sms3samp = { - "sms_sms3samp", NULL, NULL, NULL, "19??", - "Promocao Especial M. System III Compact (Bra, Sample)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sms3sampRomInfo, sms_sms3sampRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Smurfs (Euro, Bra) - -static struct BurnRomInfo sms_smurfsRomDesc[] = { - { "smurfs, the (europe) (en,fr,de,es).bin", 0x40000, 0x3e63768a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_smurfs) -STD_ROM_FN(sms_smurfs) - -struct BurnDriver BurnDrvsms_smurfs = { - "sms_smurfs", NULL, NULL, NULL, "1994", - "The Smurfs (Euro, Bra)\0", NULL, "Infogrames", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_smurfsRomInfo, sms_smurfsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Solomon no Kagi - Oujo Rihita no Namida (Jpn) - -static struct BurnRomInfo sms_solomonRomDesc[] = { - { "solomon no kagi - oujo rihita no namida (japan).bin", 0x20000, 0x11645549, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_solomon) -STD_ROM_FN(sms_solomon) - -struct BurnDriver BurnDrvsms_solomon = { - "sms_solomon", NULL, NULL, NULL, "1988", - "Solomon no Kagi - Oujo Rihita no Namida (Jpn)\0", NULL, "Salio", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_solomonRomInfo, sms_solomonRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog (Euro, USA, Bra) - -static struct BurnRomInfo sms_sonicRomDesc[] = { - { "mpr-14271-f.ic1", 0x40000, 0xb519e833, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sonic) -STD_ROM_FN(sms_sonic) - -struct BurnDriver BurnDrvsms_sonic = { - "sms_sonic", NULL, NULL, NULL, "1991", - "Sonic The Hedgehog (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sonicRomInfo, sms_sonicRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Sonic The Hedgehog FM MOD 1.02 (Euro, USA, Bra) - -static struct BurnRomInfo sms_sonicfm102RomDesc[] = { - { "Sonic1SMS_FM_v102.sms", 0x40000, 0x7c077b38, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sonicfm102) -STD_ROM_FN(sms_sonicfm102) - -struct BurnDriver BurnDrvsms_sonicfm102 = { - "sms_sonicfm102", "sms_sonic", NULL, NULL, "1991", - "Sonic The Hedgehog (FM Mod 1.02)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sonicfm102RomInfo, sms_sonicfm102RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog 2 (Euro, Bra, Kor, v1) - -static struct BurnRomInfo sms_sonic2RomDesc[] = { - { "sonic the hedgehog 2 (europe) (v1.1).bin", 0x80000, 0xd6f2bfca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sonic2) -STD_ROM_FN(sms_sonic2) - -struct BurnDriver BurnDrvsms_sonic2 = { - "sms_sonic2", NULL, NULL, NULL, "1992", - "Sonic The Hedgehog 2 (Euro, Bra, Kor, v1)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sonic2RomInfo, sms_sonic2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog 2 (Euro, Bra, v0) - -static struct BurnRomInfo sms_sonic2aRomDesc[] = { - { "mpr-15159.ic1", 0x80000, 0x5b3b922c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sonic2a) -STD_ROM_FN(sms_sonic2a) - -struct BurnDriver BurnDrvsms_sonic2a = { - "sms_sonic2a", "sms_sonic2", NULL, NULL, "1992", - "Sonic The Hedgehog 2 (Euro, Bra, v0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sonic2aRomInfo, sms_sonic2aRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Blast (Bra) - -static struct BurnRomInfo sms_sonicblsRomDesc[] = { - { "mpr-19947-s.u2", 0x100000, 0x96b3f29e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sonicbls) -STD_ROM_FN(sms_sonicbls) - -struct BurnDriver BurnDrvsms_sonicbls = { - "sms_sonicbls", NULL, NULL, NULL, "1997", - "Sonic Blast (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sonicblsRomInfo, sms_sonicblsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog Chaos (Euro, Bra) - -static struct BurnRomInfo sms_soniccRomDesc[] = { - { "mpr-15926-f.ic1", 0x80000, 0xaedf3bdf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sonicc) -STD_ROM_FN(sms_sonicc) - -struct BurnDriver BurnDrvsms_sonicc = { - "sms_sonicc", NULL, NULL, NULL, "1993", - "Sonic The Hedgehog Chaos (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_soniccRomInfo, sms_soniccRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic's Edusoft (Prototype) - -static struct BurnRomInfo sms_soniceduRomDesc[] = { - { "sonic's edusoft (unknown) (proto).bin", 0x40000, 0xd9096263, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sonicedu) -STD_ROM_FN(sms_sonicedu) - -struct BurnDriver BurnDrvsms_sonicedu = { - "sms_sonicedu", NULL, NULL, NULL, "19??", - "Sonic's Edusoft (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_soniceduRomInfo, sms_soniceduRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog Spinball (Euro, Bra) - -static struct BurnRomInfo sms_sspinRomDesc[] = { - { "sonic spinball (europe).bin", 0x80000, 0x11c1bc8a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sspin) -STD_ROM_FN(sms_sspin) - -struct BurnDriver BurnDrvsms_sspin = { - "sms_sspin", NULL, NULL, NULL, "1994", - "Sonic The Hedgehog Spinball (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sspinRomInfo, sms_sspinRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Streets of Rage (Euro, Bra) - -static struct BurnRomInfo sms_sorRomDesc[] = { - { "streets of rage (europe).bin", 0x80000, 0x4ab3790f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sor) -STD_ROM_FN(sms_sor) - -struct BurnDriver BurnDrvsms_sor = { - "sms_sor", NULL, NULL, NULL, "1993", - "Streets of Rage (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sorRomInfo, sms_sorRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Streets of Rage II (Euro, Bra) - -static struct BurnRomInfo sms_sor2RomDesc[] = { - { "streets of rage ii (europe).bin", 0x80000, 0x04e9c089, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sor2) -STD_ROM_FN(sms_sor2) - -struct BurnDriver BurnDrvsms_sor2 = { - "sms_sor2", NULL, NULL, NULL, "1993", - "Streets of Rage II (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sor2RomInfo, sms_sor2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Space Gun (Euro) - -static struct BurnRomInfo sms_spacegunRomDesc[] = { - { "mpr-15063.ic1", 0x80000, 0xa908cff5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spacegun) -STD_ROM_FN(sms_spacegun) - -struct BurnDriver BurnDrvsms_spacegun = { - "sms_spacegun", NULL, NULL, NULL, "1992", - "Space Gun (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_spacegunRomInfo, sms_spacegunRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Speedball (Image Works) (Euro) - -static struct BurnRomInfo sms_speedblRomDesc[] = { - { "speedball (europe) (mirrorsoft).bin", 0x20000, 0xa57cad18, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_speedbl) -STD_ROM_FN(sms_speedbl) - -struct BurnDriver BurnDrvsms_speedbl = { - "sms_speedbl", NULL, NULL, NULL, "1990", - "Speedball (Image Works) (Euro)\0", NULL, "Image Works", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_speedblRomInfo, sms_speedblRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Speedball 2 (Euro) - -static struct BurnRomInfo sms_speedbl2RomDesc[] = { - { "speedball 2 (europe).bin", 0x40000, 0x0c7366a0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_speedbl2) -STD_ROM_FN(sms_speedbl2) - -struct BurnDriver BurnDrvsms_speedbl2 = { - "sms_speedbl2", NULL, NULL, NULL, "1992", - "Speedball 2 (Euro)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_speedbl2RomInfo, sms_speedbl2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Speedball (Virgin) (Euro, USA) - -static struct BurnRomInfo sms_speedblvRomDesc[] = { - { "speedball (europe) (virgin).bin", 0x20000, 0x5ccc1a65, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_speedblv) -STD_ROM_FN(sms_speedblv) - -struct BurnDriver BurnDrvsms_speedblv = { - "sms_speedblv", NULL, NULL, NULL, "1992", - "Speedball (Virgin) (Euro, USA)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_speedblvRomInfo, sms_speedblvRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// SpellCaster (Euro, USA, Bra) - -static struct BurnRomInfo sms_spellcstRomDesc[] = { - { "mpr-12532-t.ic2", 0x80000, 0x4752cae7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spellcst) -STD_ROM_FN(sms_spellcst) - -struct BurnDriver BurnDrvsms_spellcst = { - "sms_spellcst", NULL, NULL, NULL, "1988", - "SpellCaster (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_spellcstRomInfo, sms_spellcstRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spider-Man - Return of the Sinister Six (Euro, Bra) - -static struct BurnRomInfo sms_spidermnRomDesc[] = { - { "spider-man - return of the sinister six (europe).bin", 0x40000, 0xebe45388, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spidermn) -STD_ROM_FN(sms_spidermn) - -struct BurnDriver BurnDrvsms_spidermn = { - "sms_spidermn", NULL, NULL, NULL, "1992", - "Spider-Man - Return of the Sinister Six (Euro, Bra)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_spidermnRomInfo, sms_spidermnRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spider-Man vs. The Kingpin (Euro, USA, Bra) - -static struct BurnRomInfo sms_spidkingRomDesc[] = { - { "mpr-13949 t42.ic1", 0x40000, 0x908ff25c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spidking) -STD_ROM_FN(sms_spidking) - -struct BurnDriver BurnDrvsms_spidking = { - "sms_spidking", NULL, NULL, NULL, "1990", - "Spider-Man vs. The Kingpin (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_spidkingRomInfo, sms_spidkingRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Pad Football (USA) - -static struct BurnRomInfo sms_sportsftRomDesc[] = { - { "sports pad football (usa).bin", 0x20000, 0xe42e4998, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sportsft) -STD_ROM_FN(sms_sportsft) - -struct BurnDriver BurnDrvsms_sportsft = { - "sms_sportsft", NULL, NULL, NULL, "1987", - "Sports Pad Football (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sportsftRomInfo, sms_sportsftRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Pad Soccer (Jpn) - -static struct BurnRomInfo sms_sportsscRomDesc[] = { - { "sports pad soccer (japan).bin", 0x20000, 0x41c948bf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sportssc) -STD_ROM_FN(sms_sportssc) - -struct BurnDriver BurnDrvsms_sportssc = { - "sms_sportssc", "sms_worldsoc", NULL, NULL, "1988", - "Sports Pad Soccer (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sportsscRomInfo, sms_sportsscRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spy vs. Spy (Euro, USA, Bra) - -static struct BurnRomInfo sms_spyvsspyRomDesc[] = { - { "spy vs. spy (usa, europe).bin", 0x08000, 0x78d7faab, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spyvsspy) -STD_ROM_FN(sms_spyvsspy) - -struct BurnDriver BurnDrvsms_spyvsspy = { - "sms_spyvsspy", NULL, NULL, NULL, "1986", - "Spy vs. Spy (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_spyvsspyRomInfo, sms_spyvsspyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spy vs Spy (Kor) - -static struct BurnRomInfo sms_spyvsspykRomDesc[] = { - { "spy vs spy (japan).bin", 0x08000, 0xd41b9a08, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spyvsspyk) -STD_ROM_FN(sms_spyvsspyk) - -struct BurnDriver BurnDrvsms_spyvsspyk = { - "sms_spyvsspyk", "sms_spyvsspy", NULL, NULL, "1986", - "Spy vs Spy (Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_spyvsspykRomInfo, sms_spyvsspykRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spy vs. Spy (Jpn, Pirate?) - -static struct BurnRomInfo sms_spyvsspyj1RomDesc[] = { - { "spy vs. spy (j) [hack].bin", 0x08000, 0xa71bc542, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spyvsspyj1) -STD_ROM_FN(sms_spyvsspyj1) - -struct BurnDriver BurnDrvsms_spyvsspyj1 = { - "sms_spyvsspyj1", "sms_spyvsspy", NULL, NULL, "1986", - "Spy vs. Spy (Jpn, Pirate?)\0", NULL, "pirate", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_spyvsspyj1RomInfo, sms_spyvsspyj1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spy vs Spy (Tw) - -static struct BurnRomInfo sms_spyvsspytwRomDesc[] = { - { "spy vs spy (tw).bin", 0x08000, 0x689f58a2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spyvsspytw) -STD_ROM_FN(sms_spyvsspytw) - -struct BurnDriver BurnDrvsms_spyvsspytw = { - "sms_spyvsspytw", "sms_spyvsspy", NULL, NULL, "1986?", - "Spy vs Spy (Tw)\0", NULL, "Aaronix", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_spyvsspytwRomInfo, sms_spyvsspytwRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spy vs. Spy (USA, Display Unit Sample) - -static struct BurnRomInfo sms_spyvsspysRomDesc[] = { - { "spy vs. spy (u) (display-unit cart) [!].bin", 0x40000, 0xb87e1b2b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spyvsspys) -STD_ROM_FN(sms_spyvsspys) - -struct BurnDriver BurnDrvsms_spyvsspys = { - "sms_spyvsspys", "sms_spyvsspy", NULL, NULL, "1986", - "Spy vs. Spy (USA, Display Unit Sample)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_spyvsspysRomInfo, sms_spyvsspysRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Space Invaders (Euro) - -static struct BurnRomInfo sms_ssinvRomDesc[] = { - { "super space invaders (europe).bin", 0x40000, 0x1d6244ee, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ssinv) -STD_ROM_FN(sms_ssinv) - -struct BurnDriver BurnDrvsms_ssinv = { - "sms_ssinv", NULL, NULL, NULL, "1991", - "Super Space Invaders (Euro)\0", NULL, "Domark", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ssinvRomInfo, sms_ssinvRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Smash T.V. (Euro) - -static struct BurnRomInfo sms_smashtvRomDesc[] = { - { "super smash t.v. (europe).bin", 0x40000, 0xe0b1aff8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_smashtv) -STD_ROM_FN(sms_smashtv) - -struct BurnDriver BurnDrvsms_smashtv = { - "sms_smashtv", NULL, NULL, NULL, "1992", - "Smash T.V. (Euro)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_smashtvRomInfo, sms_smashtvRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Star Wars (Euro, Bra) - -static struct BurnRomInfo sms_starwarsRomDesc[] = { - { "star wars (europe).bin", 0x80000, 0xd4b8f66d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_starwars) -STD_ROM_FN(sms_starwars) - -struct BurnDriver BurnDrvsms_starwars = { - "sms_starwars", NULL, NULL, NULL, "1993", - "Star Wars (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_starwarsRomInfo, sms_starwarsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Street Master (Kor) - -static struct BurnRomInfo sms_strtmastRomDesc[] = { - { "street master (kr).bin", 0x20000, 0x83f0eede, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_strtmast) -STD_ROM_FN(sms_strtmast) - -struct BurnDriver BurnDrvsms_strtmast = { - "sms_strtmast", NULL, NULL, NULL, "1992", - "Street Master (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_strtmastRomInfo, sms_strtmastRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Strider (Euro, USA, Bra, Kor) - -static struct BurnRomInfo sms_striderRomDesc[] = { - { "mpr-14093 w08.ic1", 0x80000, 0x9802ed31, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_strider) -STD_ROM_FN(sms_strider) - -struct BurnDriver BurnDrvsms_strider = { - "sms_strider", NULL, NULL, NULL, "1991", - "Strider (Euro, USA, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_striderRomInfo, sms_striderRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Strider (USA, Display Unit Sample) - -static struct BurnRomInfo sms_striderdRomDesc[] = { - { "strider (demo).bin", 0x20000, 0xb990269a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_striderd) -STD_ROM_FN(sms_striderd) - -struct BurnDriver BurnDrvsms_striderd = { - "sms_striderd", "sms_strider", NULL, NULL, "1991", - "Strider (USA, Display Unit Sample)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_striderdRomInfo, sms_striderdRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Strider II (Euro, Bra) - -static struct BurnRomInfo sms_strider2RomDesc[] = { - { "strider ii (europe).bin", 0x40000, 0xb8f0915a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_strider2) -STD_ROM_FN(sms_strider2) - -struct BurnDriver BurnDrvsms_strider2 = { - "sms_strider2", NULL, NULL, NULL, "1992", - "Strider II (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_strider2RomInfo, sms_strider2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Submarine Attack (Euro) - -static struct BurnRomInfo sms_submarinRomDesc[] = { - { "submarine attack (europe).bin", 0x40000, 0xd8f2f1b9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_submarin) -STD_ROM_FN(sms_submarin) - -struct BurnDriver BurnDrvsms_submarin = { - "sms_submarin", NULL, NULL, NULL, "1990", - "Submarine Attack (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_submarinRomInfo, sms_submarinRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Suho Jeonsa (Kor) - -static struct BurnRomInfo sms_suhocheoRomDesc[] = { - { "suho cheonsa (kr).bin", 0x40000, 0x01686d67, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_suhocheo) -STD_ROM_FN(sms_suhocheo) - -struct BurnDriver BurnDrvsms_suhocheo = { - "sms_suhocheo", NULL, NULL, NULL, "19??", - "Suho Jeonsa (Kor)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_suhocheoRomInfo, sms_suhocheoRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sukeban Deka II - Shoujo Tekkamen Densetsu (Jpn) - -static struct BurnRomInfo sms_sukebanRomDesc[] = { - { "sukeban deka ii - shoujo tekkamen densetsu (japan).bin", 0x20000, 0xb13df647, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sukeban) -STD_ROM_FN(sms_sukeban) - -struct BurnDriver BurnDrvsms_sukeban = { - "sms_sukeban", NULL, NULL, NULL, "1987", - "Sukeban Deka II - Shoujo Tekkamen Densetsu (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sukebanRomInfo, sms_sukebanRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Summer Games (Euro) - -static struct BurnRomInfo sms_sumgamesRomDesc[] = { - { "summer games (europe).bin", 0x20000, 0x8da5c93f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sumgames) -STD_ROM_FN(sms_sumgames) - -struct BurnDriver BurnDrvsms_sumgames = { - "sms_sumgames", NULL, NULL, NULL, "1991", - "Summer Games (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sumgamesRomInfo, sms_sumgamesRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Summer Games (Euro, Prototype) - -static struct BurnRomInfo sms_sumgamespRomDesc[] = { - { "summer games (europe) (beta).bin", 0x20000, 0x80eb1fff, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sumgamesp) -STD_ROM_FN(sms_sumgamesp) - -struct BurnDriver BurnDrvsms_sumgamesp = { - "sms_sumgamesp", "sms_sumgames", NULL, NULL, "1991", - "Summer Games (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sumgamespRomInfo, sms_sumgamespRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Superman - The Man of Steel (Euro, Bra) - -static struct BurnRomInfo sms_supermanRomDesc[] = { - { "mpr-15506.ic1", 0x40000, 0x6f9ac98f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_superman) -STD_ROM_FN(sms_superman) - -struct BurnDriver BurnDrvsms_superman = { - "sms_superman", NULL, NULL, NULL, "1993", - "Superman - The Man of Steel (Euro, Bra)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_supermanRomInfo, sms_supermanRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Arkanoid (Kor) - -static struct BurnRomInfo sms_superarkRomDesc[] = { - { "woody pop (super arkanoid) (kr).bin", 0x08000, 0xc9dd4e5f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_superark) -STD_ROM_FN(sms_superark) - -struct BurnDriver BurnDrvsms_superark = { - "sms_superark", "sms_woodypop", NULL, NULL, "1989", - "Super Arkanoid (Kor)\0", NULL, "HiCom", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_JAPANESE, GBF_MISC, 0, - SMSGetZipName, sms_superarkRomInfo, sms_superarkRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Basketball (USA, CES Demo) - -static struct BurnRomInfo sms_suprbsktRomDesc[] = { - { "super basketball (usa) (sample).bin", 0x10000, 0x0dbf3b4a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_suprbskt) -STD_ROM_FN(sms_suprbskt) - -struct BurnDriver BurnDrvsms_suprbskt = { - "sms_suprbskt", NULL, NULL, NULL, "1989?", - "Super Basketball (USA, CES Demo)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_suprbsktRomInfo, sms_suprbsktRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Bioman 1 (Kor) - -static struct BurnRomInfo sms_sbioman1RomDesc[] = { - { "super bioman 1.bin", 0x10000, 0xa66d26cf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sbioman1) -STD_ROM_FN(sms_sbioman1) - -struct BurnDriver BurnDrvsms_sbioman1 = { - "sms_sbioman1", NULL, NULL, NULL, "1992", - "Super Bioman 1 (Kor)\0", NULL, "HiCom", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sbioman1RomInfo, sms_sbioman1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Boy I (Kor) - -static struct BurnRomInfo sms_sboy1RomDesc[] = { - { "super boy 1.bin", 0x0c000, 0xbf5a994a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sboy1) -STD_ROM_FN(sms_sboy1) - -struct BurnDriver BurnDrvsms_sboy1 = { - "sms_sboy1", NULL, NULL, NULL, "1989", - "Super Boy I (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sboy1RomInfo, sms_sboy1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Boy II (Kor) - -static struct BurnRomInfo sms_sboy2RomDesc[] = { - { "super boy ii (kor).bin", 0x0c000, 0x67c2f0ff, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sboy2) -STD_ROM_FN(sms_sboy2) - -struct BurnDriver BurnDrvsms_sboy2 = { - "sms_sboy2", NULL, NULL, NULL, "1989", - "Super Boy II (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_KOREA, GBF_MISC, 0, - SMSGetZipName, sms_sboy2RomInfo, sms_sboy2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Boy 3 (Kor) - -static struct BurnRomInfo sms_sboy3RomDesc[] = { - { "super boy 3.bin", 0x20000, 0x9195c34c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sboy3) -STD_ROM_FN(sms_sboy3) - -struct BurnDriver BurnDrvsms_sboy3 = { - "sms_sboy3", NULL, NULL, NULL, "1991", - "Super Boy 3 (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_sboy3RomInfo, sms_sboy3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Boy 4 (Kor) - -static struct BurnRomInfo sms_sboy4RomDesc[] = { - { "super boy 4 (kor).bin", 0x40000, 0xb995b4f0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sboy4) -STD_ROM_FN(sms_sboy4) - -struct BurnDriver BurnDrvsms_sboy4 = { - "sms_sboy4", NULL, NULL, NULL, "1992", - "Super Boy 4 (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sboy4RomInfo, sms_sboy4RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Kick Off (Euro, Bra) - -static struct BurnRomInfo sms_skickoffRomDesc[] = { - { "mpr-14397-f.ic1", 0x40000, 0x406aa0c2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_skickoff) -STD_ROM_FN(sms_skickoff) - -struct BurnDriver BurnDrvsms_skickoff = { - "sms_skickoff", NULL, NULL, NULL, "1991", - "Super Kick Off (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_skickoffRomInfo, sms_skickoffRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Off Road (Euro) - -static struct BurnRomInfo sms_superoffRomDesc[] = { - { "super off road (europe).bin", 0x20000, 0x54f68c2a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_superoff) -STD_ROM_FN(sms_superoff) - -struct BurnDriver BurnDrvsms_superoff = { - "sms_superoff", NULL, NULL, NULL, "1992", - "Super Off Road (Euro)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_superoffRomInfo, sms_superoffRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Racing (Jpn) - -static struct BurnRomInfo sms_superracRomDesc[] = { - { "super racing (japan).bin", 0x40000, 0x7e0ef8cb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_superrac) -STD_ROM_FN(sms_superrac) - -struct BurnDriver BurnDrvsms_superrac = { - "sms_superrac", NULL, NULL, NULL, "1988", - "Super Racing (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_superracRomInfo, sms_superracRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Tennis (Euro, USA) - -static struct BurnRomInfo sms_stennisRomDesc[] = { - { "mpr-12584.ic1", 0x08000, 0x914514e3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_stennis) -STD_ROM_FN(sms_stennis) - -struct BurnDriver BurnDrvsms_stennis = { - "sms_stennis", NULL, NULL, NULL, "1985", - "Super Tennis (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_stennisRomInfo, sms_stennisRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// T2 - The Arcade Game (Euro) - -static struct BurnRomInfo sms_t2agRomDesc[] = { - { "mpr-16073.ic1", 0x80000, 0x93ca8152, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_t2ag) -STD_ROM_FN(sms_t2ag) - -struct BurnDriver BurnDrvsms_t2ag = { - "sms_t2ag", NULL, NULL, NULL, "1993", - "T2 - The Arcade Game (Euro)\0", NULL, "Arena", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_t2agRomInfo, sms_t2agRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz-Mania (Euro, Bra) - -static struct BurnRomInfo sms_tazmaniaRomDesc[] = { - { "mpr-15161.ic1", 0x40000, 0x7cc3e837, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tazmania) -STD_ROM_FN(sms_tazmania) - -struct BurnDriver BurnDrvsms_tazmania = { - "sms_tazmania", NULL, NULL, NULL, "1992", - "Taz-Mania (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tazmaniaRomInfo, sms_tazmaniaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz-Mania (Euro, Prototype) - -static struct BurnRomInfo sms_tazmaniapRomDesc[] = { - { "taz-mania (europe) (beta).bin", 0x40000, 0x1b312e04, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tazmaniap) -STD_ROM_FN(sms_tazmaniap) - -struct BurnDriver BurnDrvsms_tazmaniap = { - "sms_tazmaniap", "sms_tazmania", NULL, NULL, "1992", - "Taz-Mania (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tazmaniapRomInfo, sms_tazmaniapRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Bra) - -static struct BurnRomInfo sms_tazmarsRomDesc[] = { - { "taz in escape from mars (brazil).bin", 0x80000, 0x11ce074c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tazmars) -STD_ROM_FN(sms_tazmars) - -struct BurnDriver BurnDrvsms_tazmars = { - "sms_tazmars", NULL, NULL, NULL, "19??", - "Taz in Escape from Mars (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tazmarsRomInfo, sms_tazmarsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tecmo World Cup '92 (Euro, Prototype) - -static struct BurnRomInfo sms_tecmow92RomDesc[] = { - { "tecmo world cup '92 (europe) (beta).bin", 0x40000, 0x96e75f48, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tecmow92) -STD_ROM_FN(sms_tecmow92) - -struct BurnDriver BurnDrvsms_tecmow92 = { - "sms_tecmow92", NULL, NULL, NULL, "19??", - "Tecmo World Cup '92 (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tecmow92RomInfo, sms_tecmow92RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tecmo World Cup '93 (Euro) - -static struct BurnRomInfo sms_tecmow93RomDesc[] = { - { "tecmo world cup '93 (europe).bin", 0x40000, 0x5a1c3dde, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tecmow93) -STD_ROM_FN(sms_tecmow93) - -struct BurnDriver BurnDrvsms_tecmow93 = { - "sms_tecmow93", NULL, NULL, NULL, "1993", - "Tecmo World Cup '93 (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tecmow93RomInfo, sms_tecmow93RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Teddy Boy (Euro, USA, Bra) - -static struct BurnRomInfo sms_teddyboyRomDesc[] = { - { "mpr-12668.ic1", 0x08000, 0x2728faa3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_teddyboy) -STD_ROM_FN(sms_teddyboy) - -struct BurnDriver BurnDrvsms_teddyboy = { - "sms_teddyboy", NULL, NULL, NULL, "1985", - "Teddy Boy (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_teddyboyRomInfo, sms_teddyboyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Teddy Boy Blues (Jpn, Pirate?) - -static struct BurnRomInfo sms_teddyboyj1RomDesc[] = { - { "teddy boy blues (j) [hack].bin", 0x08000, 0x9dfa67ee, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_teddyboyj1) -STD_ROM_FN(sms_teddyboyj1) - -struct BurnDriver BurnDrvsms_teddyboyj1 = { - "sms_teddyboyj1", "sms_teddyboy", NULL, NULL, "1985", - "Teddy Boy Blues (Jpn, Pirate?)\0", NULL, "pirate", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_teddyboyj1RomInfo, sms_teddyboyj1RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tennis Ace (Euro, Bra) - -static struct BurnRomInfo sms_tennisRomDesc[] = { - { "tennis ace (europe).bin", 0x40000, 0x1a390b93, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tennis) -STD_ROM_FN(sms_tennis) - -struct BurnDriver BurnDrvsms_tennis = { - "sms_tennis", NULL, NULL, NULL, "1989", - "Tennis Ace (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tennisRomInfo, sms_tennisRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tensai Bakabon (Jpn) - -static struct BurnRomInfo sms_bakabonRomDesc[] = { - { "tensai bakabon (japan).bin", 0x40000, 0x8132ab2c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bakabon) -STD_ROM_FN(sms_bakabon) - -struct BurnDriver BurnDrvsms_bakabon = { - "sms_bakabon", NULL, NULL, NULL, "1988", - "Tensai Bakabon (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bakabonRomInfo, sms_bakabonRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Terminator 2 - Judgment Day (Euro) - -static struct BurnRomInfo sms_term2RomDesc[] = { - { "terminator 2 - judgment day (europe).bin", 0x40000, 0xac56104f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_term2) -STD_ROM_FN(sms_term2) - -struct BurnDriver BurnDrvsms_term2 = { - "sms_term2", NULL, NULL, NULL, "1993", - "Terminator 2 - Judgment Day (Euro)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_term2RomInfo, sms_term2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Terminator (Euro) - -static struct BurnRomInfo sms_termntrRomDesc[] = { - { "terminator, the (europe).bin", 0x40000, 0xedc5c012, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_termntr) -STD_ROM_FN(sms_termntr) - -struct BurnDriver BurnDrvsms_termntr = { - "sms_termntr", NULL, NULL, NULL, "1992", - "The Terminator (Euro)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_termntrRomInfo, sms_termntrRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Terminator (Bra) - -static struct BurnRomInfo sms_termntrbRomDesc[] = { - { "terminator, the (brazil).bin", 0x40000, 0xe3d5ce9a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_termntrb) -STD_ROM_FN(sms_termntrb) - -struct BurnDriver BurnDrvsms_termntrb = { - "sms_termntrb", "sms_termntr", NULL, NULL, "1992", - "The Terminator (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_termntrbRomInfo, sms_termntrbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Thunder Blade (Euro, USA, Bra) - -static struct BurnRomInfo sms_tbladeRomDesc[] = { - { "mpr-11820f.ic1", 0x40000, 0xae920e4b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tblade) -STD_ROM_FN(sms_tblade) - -struct BurnDriver BurnDrvsms_tblade = { - "sms_tblade", NULL, NULL, NULL, "1988", - "Thunder Blade (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tbladeRomInfo, sms_tbladeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Thunder Blade (Jpn) - -static struct BurnRomInfo sms_tbladejRomDesc[] = { - { "thunder blade (japan).bin", 0x40000, 0xc0ce19b1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tbladej) -STD_ROM_FN(sms_tbladej) - -struct BurnDriver BurnDrvsms_tbladej = { - "sms_tbladej", "sms_tblade", NULL, NULL, "1988", - "Thunder Blade (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tbladejRomInfo, sms_tbladejRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Time Soldiers (Euro, USA, Bra) - -static struct BurnRomInfo sms_timesoldRomDesc[] = { - { "mpr-12129f.ic1", 0x40000, 0x51bd14be, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_timesold) -STD_ROM_FN(sms_timesold) - -struct BurnDriver BurnDrvsms_timesold = { - "sms_timesold", NULL, NULL, NULL, "1989", - "Time Soldiers (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_timesoldRomInfo, sms_timesoldRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The New Zealand Story (Euro) - -static struct BurnRomInfo sms_tnzsRomDesc[] = { - { "new zealand story, the (europe).bin", 0x40000, 0xc660ff34, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tnzs) -STD_ROM_FN(sms_tnzs) - -struct BurnDriver BurnDrvsms_tnzs = { - "sms_tnzs", NULL, NULL, NULL, "1992", - "The New Zealand Story (Euro)\0", NULL, "TecMagik", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_tnzsRomInfo, sms_tnzsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tom and Jerry - The Movie (Euro, Bra) - -static struct BurnRomInfo sms_tomjermvRomDesc[] = { - { "tom and jerry - the movie (europe).bin", 0x40000, 0xbf7b7285, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tomjermv) -STD_ROM_FN(sms_tomjermv) - -struct BurnDriver BurnDrvsms_tomjermv = { - "sms_tomjermv", NULL, NULL, NULL, "1992", - "Tom and Jerry - The Movie (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tomjermvRomInfo, sms_tomjermvRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tom and Jerry (Prototype) - -static struct BurnRomInfo sms_tomjerryRomDesc[] = { - { "tom and jerry (europe) (beta).bin", 0x40000, 0x0c2fc2de, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tomjerry) -STD_ROM_FN(sms_tomjerry) - -struct BurnDriver BurnDrvsms_tomjerry = { - "sms_tomjerry", "sms_tomjermv", NULL, NULL, "1992", - "Tom and Jerry (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tomjerryRomInfo, sms_tomjerryRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Toto World 3 (Kor) - -static struct BurnRomInfo sms_totowld3RomDesc[] = { - { "toto world 3 (korea) (unl).bin", 0x40000, 0x4f8d75ec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_totowld3) -STD_ROM_FN(sms_totowld3) - -struct BurnDriver BurnDrvsms_totowld3 = { - "sms_totowld3", NULL, NULL, NULL, "1993", - "Toto World 3 (Kor)\0", NULL, "Open Corp.", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_totowld3RomInfo, sms_totowld3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// TransBot (Euro, USA, Bra) - -static struct BurnRomInfo sms_transbotRomDesc[] = { - { "mpr-12552.ic1", 0x08000, 0x4bc42857, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_transbot) -STD_ROM_FN(sms_transbot) - -struct BurnDriver BurnDrvsms_transbot = { - "sms_transbot", NULL, NULL, NULL, "1985", - "TransBot (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_transbotRomInfo, sms_transbotRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// TransBot (USA, Prototype) - -static struct BurnRomInfo sms_transbotpRomDesc[] = { - { "transbot [proto].bin", 0x08000, 0x58b99750, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_transbotp) -STD_ROM_FN(sms_transbotp) - -struct BurnDriver BurnDrvsms_transbotp = { - "sms_transbotp", "sms_transbot", NULL, NULL, "1985", - "TransBot (USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_transbotpRomInfo, sms_transbotpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Treinamento Do Mymo (Bra) - -static struct BurnRomInfo sms_treinamRomDesc[] = { - { "treinamento do mymo (b).bin", 0x40000, 0xe94784f2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_treinam) -STD_ROM_FN(sms_treinam) - -struct BurnDriver BurnDrvsms_treinam = { - "sms_treinam", NULL, NULL, NULL, "19??", - "Treinamento Do Mymo (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_treinamRomInfo, sms_treinamRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Trivial Pursuit - Genus Edition (Euro) - -static struct BurnRomInfo sms_trivialRomDesc[] = { - { "trivial pursuit - genus edition (europe) (en,fr,de,es).bin", 0x80000, 0xe5374022, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_trivial) -STD_ROM_FN(sms_trivial) - -struct BurnDriver BurnDrvsms_trivial = { - "sms_trivial", NULL, NULL, NULL, "1992", - "Trivial Pursuit - Genus Edition (Euro)\0", NULL, "Domark", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_trivialRomInfo, sms_trivialRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ttoriui Moheom (Kor) - -static struct BurnRomInfo sms_ttoriuiRomDesc[] = { - { "ttoriui moheom (kr).bin", 0x08000, 0x178801d2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ttoriui) -STD_ROM_FN(sms_ttoriui) - -struct BurnDriver BurnDrvsms_ttoriui = { - "sms_ttoriui", "sms_myhero", NULL, NULL, "19??", - "Ttoriui Moheom (Kor)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ttoriuiRomInfo, sms_ttoriuiRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Turma da Mônica em O Resgate (Bra) - -static struct BurnRomInfo sms_turmamonRomDesc[] = { - { "mpr-15999.ic1", 0x40000, 0x22cca9bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_turmamon) -STD_ROM_FN(sms_turmamon) - -struct BurnDriver BurnDrvsms_turmamon = { - "sms_turmamon", "sms_wboy3", NULL, NULL, "1993", - "Turma da Monica em O Resgate (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_turmamonRomInfo, sms_turmamonRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// As Aventuras da TV Colosso (Bra) - -static struct BurnRomInfo sms_tvcolosRomDesc[] = { - { "tv colosso (brazil).bin", 0x80000, 0xe1714a88, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_tvcolos) -STD_ROM_FN(sms_tvcolos) - -struct BurnDriver BurnDrvsms_tvcolos = { - "sms_tvcolos", "sms_asterix", NULL, NULL, "1996", - "As Aventuras da TV Colosso (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_tvcolosRomInfo, sms_tvcolosRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ultima IV - Quest of the Avatar (Euro, Bra) - -static struct BurnRomInfo sms_ultima4RomDesc[] = { - { "mpr-13135.ic1", 0x80000, 0xb52d60c8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ultima4) -STD_ROM_FN(sms_ultima4) - -struct BurnDriver BurnDrvsms_ultima4 = { - "sms_ultima4", NULL, NULL, NULL, "1990", - "Ultima IV - Quest of the Avatar (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ultima4RomInfo, sms_ultima4RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ultima IV - Quest of the Avatar (Euro, Prototype) - -static struct BurnRomInfo sms_ultima4pRomDesc[] = { - { "ultima iv - quest of the avatar (europe) (beta).bin", 0x80000, 0xde9f8517, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ultima4p) -STD_ROM_FN(sms_ultima4p) - -struct BurnDriver BurnDrvsms_ultima4p = { - "sms_ultima4p", "sms_ultima4", NULL, NULL, "1990", - "Ultima IV - Quest of the Avatar (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ultima4pRomInfo, sms_ultima4pRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ultimate Soccer (Euro, Bra) - -static struct BurnRomInfo sms_ultsoccrRomDesc[] = { - { "ultimate soccer (europe) (en,fr,de,es,it).bin", 0x40000, 0x15668ca4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ultsoccr) -STD_ROM_FN(sms_ultsoccr) - -struct BurnDriver BurnDrvsms_ultsoccr = { - "sms_ultsoccr", NULL, NULL, NULL, "1993", - "Ultimate Soccer (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ultsoccrRomInfo, sms_ultsoccrRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Vampire (Euro, Prototype) - -static struct BurnRomInfo sms_vampireRomDesc[] = { - { "vampire (europe) (beta).bin", 0x40000, 0x20f40cae, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_vampire) -STD_ROM_FN(sms_vampire) - -struct BurnDriver BurnDrvsms_vampire = { - "sms_vampire", "sms_mastdark", NULL, NULL, "19??", - "Vampire (Euro, Prototype)\0", NULL, "Unknown", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_vampireRomInfo, sms_vampireRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Virtua Fighter Animation (Bra) - -static struct BurnRomInfo sms_vfaRomDesc[] = { - { "virtua fighter animation (brazil).bin", 0x100000, 0x57f1545b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_vfa) -STD_ROM_FN(sms_vfa) - -struct BurnDriver BurnDrvsms_vfa = { - "sms_vfa", NULL, NULL, NULL, "1997", - "Virtua Fighter Animation (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_vfaRomInfo, sms_vfaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Vigilante (Euro, USA, Bra) - -static struct BurnRomInfo sms_vigilantRomDesc[] = { - { "mpr-12138f.ic1", 0x40000, 0xdfb0b161, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_vigilant) -STD_ROM_FN(sms_vigilant) - -struct BurnDriver BurnDrvsms_vigilant = { - "sms_vigilant", NULL, NULL, NULL, "1989", - "Vigilante (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_vigilantRomInfo, sms_vigilantRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Walter Payton Football (USA) - -static struct BurnRomInfo sms_wpaytonRomDesc[] = { - { "walter payton football (usa).bin", 0x40000, 0x3d55759b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wpayton) -STD_ROM_FN(sms_wpayton) - -struct BurnDriver BurnDrvsms_wpayton = { - "sms_wpayton", "sms_ameripf", NULL, NULL, "1989", - "Walter Payton Football (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wpaytonRomInfo, sms_wpaytonRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wanted (Euro, USA, Bra) - -static struct BurnRomInfo sms_wantedRomDesc[] = { - { "mpr-12533f.ic1", 0x20000, 0x5359762d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wanted) -STD_ROM_FN(sms_wanted) - -struct BurnDriver BurnDrvsms_wanted = { - "sms_wanted", NULL, NULL, NULL, "1989", - "Wanted (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wantedRomInfo, sms_wantedRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy (Euro, USA, Bra, v1) - -static struct BurnRomInfo sms_wboyRomDesc[] = { - { "wonder boy (usa, europe).bin", 0x20000, 0x73705c02, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wboy) -STD_ROM_FN(sms_wboy) - -struct BurnDriver BurnDrvsms_wboy = { - "sms_wboy", NULL, NULL, NULL, "1987", - "Wonder Boy (Euro, USA, Bra, v1)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wboyRomInfo, sms_wboyRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy (Euro, Kor, v0) ~ Super Wonder Boy (Jpn, v0) - -static struct BurnRomInfo sms_wboyaRomDesc[] = { - { "super wonder boy (japan).bin", 0x20000, 0xe2fcb6f3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wboya) -STD_ROM_FN(sms_wboya) - -struct BurnDriver BurnDrvsms_wboya = { - "sms_wboya", "sms_wboy", NULL, NULL, "1987", - "Wonder Boy (Euro, Kor, v0) ~ Super Wonder Boy (Jpn, v0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wboyaRomInfo, sms_wboyaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy III - The Dragon's Trap (Euro, USA, Kor) - -static struct BurnRomInfo sms_wboy3RomDesc[] = { - { "mpr-12570.ic1", 0x40000, 0x679e1676, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wboy3) -STD_ROM_FN(sms_wboy3) - -struct BurnDriver BurnDrvsms_wboy3 = { - "sms_wboy3", NULL, NULL, NULL, "1989", - "Wonder Boy III - The Dragon's Trap (Euro, USA, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wboy3RomInfo, sms_wboy3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy in Monster Land (Euro, USA) - -static struct BurnRomInfo sms_wboymlndRomDesc[] = { - { "mpr-11487.ic1", 0x40000, 0x8cbef0c1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wboymlnd) -STD_ROM_FN(sms_wboymlnd) - -struct BurnDriver BurnDrvsms_wboymlnd = { - "sms_wboymlnd", NULL, NULL, NULL, "1988", - "Wonder Boy in Monster Land (Euro, USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wboymlndRomInfo, sms_wboymlndRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy in Monster Land (Prototype) - -static struct BurnRomInfo sms_wboymlndpRomDesc[] = { - { "wonder boy in monster land [proto].bin", 0x40000, 0x8312c429, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wboymlndp) -STD_ROM_FN(sms_wboymlndp) - -struct BurnDriver BurnDrvsms_wboymlndp = { - "sms_wboymlndp", "sms_wboymlnd", NULL, NULL, "1988", - "Wonder Boy in Monster Land (Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wboymlndpRomInfo, sms_wboymlndpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Wonder Boy - Monster World (Jpn) - -static struct BurnRomInfo sms_wboymlndjRomDesc[] = { - { "super wonder boy - monster world (japan).bin", 0x40000, 0xb1da6a30, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wboymlndj) -STD_ROM_FN(sms_wboymlndj) - -struct BurnDriver BurnDrvsms_wboymlndj = { - "sms_wboymlndj", "sms_wboymlnd", NULL, NULL, "1988", - "Super Wonder Boy - Monster World (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wboymlndjRomInfo, sms_wboymlndjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy in Monster Land (Euro, USA, Hacked?) - -static struct BurnRomInfo sms_wboymlndaRomDesc[] = { - { "wonder boy in monster land [hack].bin", 0x40000, 0x7522cf0a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wboymlnda) -STD_ROM_FN(sms_wboymlnda) - -struct BurnDriver BurnDrvsms_wboymlnda = { - "sms_wboymlnda", "sms_wboymlnd", NULL, NULL, "1988", - "Wonder Boy in Monster Land (Euro, USA, Hacked?)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wboymlndaRomInfo, sms_wboymlndaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy in Monster World (Euro, Kor) - -static struct BurnRomInfo sms_wboymwldRomDesc[] = { - { "mpr-15317.ic1", 0x80000, 0x7d7ce80b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wboymwld) -STD_ROM_FN(sms_wboymwld) - -struct BurnDriver BurnDrvsms_wboymwld = { - "sms_wboymwld", NULL, NULL, NULL, "1993", - "Wonder Boy in Monster World (Euro, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wboymwldRomInfo, sms_wboymwldRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy in Monster World (Euro, Prototype) - -static struct BurnRomInfo sms_wboymwldpRomDesc[] = { - { "wonder boy in monster world (europe) (beta).bin", 0x80000, 0x81bff9bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wboymwldp) -STD_ROM_FN(sms_wboymwldp) - -struct BurnDriver BurnDrvsms_wboymwldp = { - "sms_wboymwldp", "sms_wboymwld", NULL, NULL, "1993", - "Wonder Boy in Monster World (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wboymwldpRomInfo, sms_wboymwldpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonsiin (Kor) - -static struct BurnRomInfo sms_wonsiinRomDesc[] = { - { "wonsiin (kr).bin", 0x20000, 0xa05258f5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wonsiin) -STD_ROM_FN(sms_wonsiin) - -struct BurnDriver BurnDrvsms_wonsiin = { - "sms_wonsiin", NULL, NULL, NULL, "1991", - "Wonsiin (Kor)\0", NULL, "Zemina", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_wonsiinRomInfo, sms_wonsiinRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Class Leader Board (Euro, Bra) - -static struct BurnRomInfo sms_wcleadRomDesc[] = { - { "world class leader board (europe).bin", 0x40000, 0xc9a449b7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wclead) -STD_ROM_FN(sms_wclead) - -struct BurnDriver BurnDrvsms_wclead = { - "sms_wclead", NULL, NULL, NULL, "1991", - "World Class Leader Board (Euro, Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wcleadRomInfo, sms_wcleadRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Cup Italia '90 (Euro, Bra) - -static struct BurnRomInfo sms_wcup90RomDesc[] = { - { "mpr-13292.ic1", 0x20000, 0x6e1ad6fd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wcup90) -STD_ROM_FN(sms_wcup90) - -struct BurnDriver BurnDrvsms_wcup90 = { - "sms_wcup90", NULL, NULL, NULL, "1990", - "World Cup Italia '90 (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wcup90RomInfo, sms_wcup90RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Cup Italia '90 (USA, Demo) - -static struct BurnRomInfo sms_wcup90dRomDesc[] = { - { "world cup italia '90 [demo].bin", 0x20000, 0xa0cf8b15, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wcup90d) -STD_ROM_FN(sms_wcup90d) - -struct BurnDriver BurnDrvsms_wcup90d = { - "sms_wcup90d", "sms_wcup90", NULL, NULL, "1990", - "World Cup Italia '90 (USA, Demo)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wcup90dRomInfo, sms_wcup90dRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Cup USA 94 (Euro, Bra) - -static struct BurnRomInfo sms_wcup94RomDesc[] = { - { "world cup usa 94 (europe) (en,fr,de,es,it,nl,pt,sv).bin", 0x80000, 0xa6bf8f9e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wcup94) -STD_ROM_FN(sms_wcup94) - -struct BurnDriver BurnDrvsms_wcup94 = { - "sms_wcup94", NULL, NULL, NULL, "1992", - "World Cup USA 94 (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wcup94RomInfo, sms_wcup94RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wimbledon II (Euro, Bra) - -static struct BurnRomInfo sms_wimbled2RomDesc[] = { - { "wimbledon ii (europe).bin", 0x40000, 0x7f3afe58, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wimbled2) -STD_ROM_FN(sms_wimbled2) - -struct BurnDriver BurnDrvsms_wimbled2 = { - "sms_wimbled2", NULL, NULL, NULL, "1993", - "Wimbledon II (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wimbled2RomInfo, sms_wimbled2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wimbledon (Euro) - -static struct BurnRomInfo sms_wimbledRomDesc[] = { - { "mpr-14686.ic1", 0x40000, 0x912d92af, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wimbled) -STD_ROM_FN(sms_wimbled) - -struct BurnDriver BurnDrvsms_wimbled = { - "sms_wimbled", NULL, NULL, NULL, "1992", - "Wimbledon (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wimbledRomInfo, sms_wimbledRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Winter Olympics - Lillehammer '94 (Euro) - -static struct BurnRomInfo sms_wintolRomDesc[] = { - { "winter olympics - lillehammer '94 (europe) (en,fr,de,es,it,pt,sv,no).bin", 0x80000, 0xa20290b6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wintol) -STD_ROM_FN(sms_wintol) - -struct BurnDriver BurnDrvsms_wintol = { - "sms_wintol", NULL, NULL, NULL, "1993", - "Winter Olympics - Lillehammer '94 (Euro)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wintolRomInfo, sms_wintolRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Winter Olympics - Lillehammer '94 (Bra) - -static struct BurnRomInfo sms_wintolbRomDesc[] = { - { "winter olympics - lillehammer '94 (brazil) (en,fr,de,es,it,pt,sv,no).bin", 0x80000, 0x2fec2b4a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wintolb) -STD_ROM_FN(sms_wintolb) - -struct BurnDriver BurnDrvsms_wintolb = { - "sms_wintolb", "sms_wintol", NULL, NULL, "1993", - "Winter Olympics - Lillehammer '94 (Bra)\0", NULL, "U.S. Gold", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wintolbRomInfo, sms_wintolbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wolfchild (Euro, Bra) - -static struct BurnRomInfo sms_wolfchldRomDesc[] = { - { "mpr-15714.ic1", 0x40000, 0x1f8efa1d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wolfchld) -STD_ROM_FN(sms_wolfchld) - -struct BurnDriver BurnDrvsms_wolfchld = { - "sms_wolfchld", NULL, NULL, NULL, "1993", - "Wolfchild (Euro, Bra)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wolfchldRomInfo, sms_wolfchldRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Games (Euro, Bra) - -static struct BurnRomInfo sms_wldgamesRomDesc[] = { - { "world games (europe).bin", 0x20000, 0xa2a60bc8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wldgames) -STD_ROM_FN(sms_wldgames) - -struct BurnDriver BurnDrvsms_wldgames = { - "sms_wldgames", NULL, NULL, NULL, "1989", - "World Games (Euro, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wldgamesRomInfo, sms_wldgamesRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Games (Euro, Prototype) - -static struct BurnRomInfo sms_wldgamespRomDesc[] = { - { "world games (europe) (beta).bin", 0x20000, 0x914d3fc4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wldgamesp) -STD_ROM_FN(sms_wldgamesp) - -struct BurnDriver BurnDrvsms_wldgamesp = { - "sms_wldgamesp", "sms_wldgames", NULL, NULL, "1989", - "World Games (Euro, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wldgamespRomInfo, sms_wldgamespRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Grand Prix (Euro) - -static struct BurnRomInfo sms_worldgpRomDesc[] = { - { "mpr-10156.ic1", 0x20000, 0x4aaad0d6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_worldgp) -STD_ROM_FN(sms_worldgp) - -struct BurnDriver BurnDrvsms_worldgp = { - "sms_worldgp", NULL, NULL, NULL, "1986", - "World Grand Prix (Euro)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_worldgpRomInfo, sms_worldgpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Grand Prix (USA, Bra, Kor) - -static struct BurnRomInfo sms_worldgpuRomDesc[] = { - { "mpr-10151.ic2", 0x20000, 0x7b369892, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_worldgpu) -STD_ROM_FN(sms_worldgpu) - -struct BurnDriver BurnDrvsms_worldgpu = { - "sms_worldgpu", "sms_worldgp", NULL, NULL, "1986", - "World Grand Prix (USA, Bra, Kor)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_worldgpuRomInfo, sms_worldgpuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Grand Prix (USA, Prototype) - -static struct BurnRomInfo sms_worldgppRomDesc[] = { - { "world grand prix [proto].bin", 0x20000, 0xb5a9f824, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_worldgpp) -STD_ROM_FN(sms_worldgpp) - -struct BurnDriver BurnDrvsms_worldgpp = { - "sms_worldgpp", "sms_worldgp", NULL, NULL, "1986", - "World Grand Prix (USA, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_worldgppRomInfo, sms_worldgppRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Soccer (Euro, Jpn, Kor) ~ Great Soccer (USA) - -static struct BurnRomInfo sms_worldsocRomDesc[] = { - { "mpr-10747f.ic1", 0x20000, 0x72112b75, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_worldsoc) -STD_ROM_FN(sms_worldsoc) - -struct BurnDriver BurnDrvsms_worldsoc = { - "sms_worldsoc", NULL, NULL, NULL, "1987", - "World Soccer (Euro, Jpn, Kor) ~ Great Soccer (USA)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_worldsocRomInfo, sms_worldsocRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// WWF Wrestlemania - Steel Cage Challenge (Euro, Bra) - -static struct BurnRomInfo sms_wwfsteelRomDesc[] = { - { "wwf wrestlemania - steel cage challenge (europe).bin", 0x40000, 0x2db21448, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_wwfsteel) -STD_ROM_FN(sms_wwfsteel) - -struct BurnDriver BurnDrvsms_wwfsteel = { - "sms_wwfsteel", NULL, NULL, NULL, "1993", - "WWF Wrestlemania - Steel Cage Challenge (Euro, Bra)\0", NULL, "Flying Edge", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_wwfsteelRomInfo, sms_wwfsteelRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Where in the World is Carmen Sandiego? (USA) - -static struct BurnRomInfo sms_carmnwldRomDesc[] = { - { "where in the world is carmen sandiego (usa).bin", 0x20000, 0x428b1e7c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_carmnwld) -STD_ROM_FN(sms_carmnwld) - -struct BurnDriver BurnDrvsms_carmnwld = { - "sms_carmnwld", NULL, NULL, NULL, "1989", - "Where in the World is Carmen Sandiego? (USA)\0", NULL, "Parker Brothers", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_carmnwldRomInfo, sms_carmnwldRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Where in the World is Carmen Sandiego? (Bra) - -static struct BurnRomInfo sms_carmnwldbRomDesc[] = { - { "where in the world is carmen sandiego (brazil).bin", 0x20000, 0x88aa8ca6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_carmnwldb) -STD_ROM_FN(sms_carmnwldb) - -struct BurnDriver BurnDrvsms_carmnwldb = { - "sms_carmnwldb", "sms_carmnwld", NULL, NULL, "1989", - "Where in the World is Carmen Sandiego? (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_carmnwldbRomInfo, sms_carmnwldbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Xenon 2 - Megablast (Image Works) (Euro) - -static struct BurnRomInfo sms_xenon2RomDesc[] = { - { "xenon 2 - megablast (europe) (image works).bin", 0x40000, 0x5c205ee1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_xenon2) -STD_ROM_FN(sms_xenon2) - -struct BurnDriver BurnDrvsms_xenon2 = { - "sms_xenon2", NULL, NULL, NULL, "1991", - "Xenon 2 - Megablast (Image Works) (Euro)\0", NULL, "Image Works", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_xenon2RomInfo, sms_xenon2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Xenon 2 - Megablast (Virgin) (Euro) - -static struct BurnRomInfo sms_xenon2vRomDesc[] = { - { "xenon 2 - megablast (europe) (virgin).bin", 0x40000, 0xec726c0d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_xenon2v) -STD_ROM_FN(sms_xenon2v) - -struct BurnDriver BurnDrvsms_xenon2v = { - "sms_xenon2v", "sms_xenon2", NULL, NULL, "1991", - "Xenon 2 - Megablast (Virgin) (Euro)\0", NULL, "Virgin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_xenon2vRomInfo, sms_xenon2vRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Mojo World (Bra) - -static struct BurnRomInfo sms_xmenmojoRomDesc[] = { - { "x-men - mojo world (brazil).bin", 0x80000, 0x3e1387f6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_xmenmojo) -STD_ROM_FN(sms_xmenmojo) - -struct BurnDriver BurnDrvsms_xmenmojo = { - "sms_xmenmojo", NULL, NULL, NULL, "1996", - "X-Men - Mojo World (Bra)\0", NULL, "Tec Toy", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_xmenmojoRomInfo, sms_xmenmojoRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Xyzolog (Kor) - -static struct BurnRomInfo sms_xyzologRomDesc[] = { - { "xyzolog (kr).sms", 0x0c000, 0x565c799f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_xyzolog) -STD_ROM_FN(sms_xyzolog) - -struct BurnDriver BurnDrvsms_xyzolog = { - "sms_xyzolog", NULL, NULL, NULL, "19??", - "Xyzolog (Kor)\0", NULL, "Taito?", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_MAPPER_MSX, GBF_MISC, 0, - SMSGetZipName, sms_xyzologRomInfo, sms_xyzologRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ys (Jpn) - -static struct BurnRomInfo sms_ysjRomDesc[] = { - { "ys (japan).bin", 0x40000, 0x32759751, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ysj) -STD_ROM_FN(sms_ysj) - -struct BurnDriver BurnDrvsms_ysj = { - "sms_ysj", "sms_ys", NULL, NULL, "1988", - "Ys (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ysjRomInfo, sms_ysjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ys - The Vanished Omens (Euro, USA, Bra) - -static struct BurnRomInfo sms_ysRomDesc[] = { - { "mpr-12044f.ic1", 0x40000, 0xb33e2827, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ys) -STD_ROM_FN(sms_ys) - -struct BurnDriver BurnDrvsms_ys = { - "sms_ys", NULL, NULL, NULL, "1988", - "Ys - The Vanished Omens (Euro, USA, Bra)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ysRomInfo, sms_ysRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ys (USA, Demo) - -static struct BurnRomInfo sms_ysdRomDesc[] = { - { "ys - the vanished omens [demo].bin", 0x40000, 0xe8b82066, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ysd) -STD_ROM_FN(sms_ysd) - -struct BurnDriver BurnDrvsms_ysd = { - "sms_ysd", "sms_ys", NULL, NULL, "1988", - "Ys (USA, Demo)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ysdRomInfo, sms_ysdRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zaxxon 3-D (World) - -static struct BurnRomInfo sms_zaxxon3dRomDesc[] = { - { "mpr-11197.ic1", 0x40000, 0xa3ef13cb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_zaxxon3d) -STD_ROM_FN(sms_zaxxon3d) - -struct BurnDriver BurnDrvsms_zaxxon3d = { - "sms_zaxxon3d", NULL, NULL, NULL, "1987", - "Zaxxon 3-D (World)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_zaxxon3dRomInfo, sms_zaxxon3dRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zaxxon 3-D (World, Prototype) - -static struct BurnRomInfo sms_zaxxon3dpRomDesc[] = { - { "zaxxon 3-d (world) (beta).bin", 0x40000, 0xbba74147, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_zaxxon3dp) -STD_ROM_FN(sms_zaxxon3dp) - -struct BurnDriver BurnDrvsms_zaxxon3dp = { - "sms_zaxxon3dp", "sms_zaxxon3d", NULL, NULL, "1987", - "Zaxxon 3-D (World, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_zaxxon3dpRomInfo, sms_zaxxon3dpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zillion (Euro, v2) - -static struct BurnRomInfo sms_zillionRomDesc[] = { - { "zillion (europe) (v1.2).bin", 0x20000, 0x7ba54510, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_zillion) -STD_ROM_FN(sms_zillion) - -struct BurnDriver BurnDrvsms_zillion = { - "sms_zillion", NULL, NULL, NULL, "1987", - "Zillion (Euro, v2)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_zillionRomInfo, sms_zillionRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zillion (Euro, v0) ~ Akai Koudan Zillion (Jpn, v0) - -static struct BurnRomInfo sms_zillionbRomDesc[] = { - { "zillion (japan, europe) (en,ja).bin", 0x20000, 0x60c19645, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_zillionb) -STD_ROM_FN(sms_zillionb) - -struct BurnDriver BurnDrvsms_zillionb = { - "sms_zillionb", "sms_zillion", NULL, NULL, "1987", - "Zillion (Euro, v0) ~ Akai Koudan Zillion (Jpn, v0)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_zillionbRomInfo, sms_zillionbRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zillion (USA, v1) - -static struct BurnRomInfo sms_zillionaRomDesc[] = { - { "zillion (usa) (v1.1).bin", 0x20000, 0x5718762c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_zilliona) -STD_ROM_FN(sms_zilliona) - -struct BurnDriver BurnDrvsms_zilliona = { - "sms_zilliona", "sms_zillion", NULL, NULL, "1987", - "Zillion (USA, v1)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_zillionaRomInfo, sms_zillionaRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zillion II - The Tri Formation (Euro, USA) ~ Tri Formation (Jpn) - -static struct BurnRomInfo sms_zillion2RomDesc[] = { - { "zillion ii - the tri formation (world).bin", 0x20000, 0x2f2e3bc9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_zillion2) -STD_ROM_FN(sms_zillion2) - -struct BurnDriver BurnDrvsms_zillion2 = { - "sms_zillion2", NULL, NULL, NULL, "1987", - "Zillion II - The Tri Formation (Euro, USA) ~ Tri Formation (Jpn)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_zillion2RomInfo, sms_zillion2RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zool - Ninja of the 'Nth' Dimension (Euro) - -static struct BurnRomInfo sms_zoolRomDesc[] = { - { "mpr-15992.ic1", 0x40000, 0x9d9d0a5f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_zool) -STD_ROM_FN(sms_zool) - -struct BurnDriver BurnDrvsms_zool = { - "sms_zool", NULL, NULL, NULL, "1993", - "Zool - Ninja of the 'Nth' Dimension (Euro)\0", NULL, "Gremlin Interactive", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_zoolRomInfo, sms_zoolRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The A-Team (Music prototype) - -static struct BurnRomInfo sms_sn_ateamRomDesc[] = { - { "a-team music [proto].bin", 0x08000, 0x0eb430ff, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sn_ateam) -STD_ROM_FN(sms_sn_ateam) - -struct BurnDriver BurnDrvsms_sn_ateam = { - "sms_sn_ateam", NULL, NULL, NULL, "1992", - "The A-Team (Music prototype)\0", NULL, "Probe", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sn_ateamRomInfo, sms_sn_ateamRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lethal Weapon 3 (Music prototype) - -static struct BurnRomInfo sms_sn_lwep3RomDesc[] = { - { "lethal weapon 3 music [proto].bin", 0x08000, 0xeb71247b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_sn_lwep3) -STD_ROM_FN(sms_sn_lwep3) - -struct BurnDriver BurnDrvsms_sn_lwep3 = { - "sms_sn_lwep3", NULL, NULL, NULL, "1992", - "Lethal Weapon 3 (Music prototype)\0", NULL, "Probe", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_sn_lwep3RomInfo, sms_sn_lwep3RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astro Flash (Jpn, MyCard) - -static struct BurnRomInfo sms_astroflRomDesc[] = { - { "astro flash (japan).bin", 0x08000, 0xc795182d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_astrofl) -STD_ROM_FN(sms_astrofl) - -struct BurnDriver BurnDrvsms_astrofl = { - "sms_astrofl", "sms_transbot", NULL, NULL, "1985", - "Astro Flash (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_astroflRomInfo, sms_astroflRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bank Panic (Euro, Sega Card) - -static struct BurnRomInfo sms_bankpcRomDesc[] = { - { "mpr-12554.ic1", 0x08000, 0x655fb1f4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_bankpc) -STD_ROM_FN(sms_bankpc) - -struct BurnDriver BurnDrvsms_bankpc = { - "sms_bankpc", "sms_bankp", NULL, NULL, "1987", - "Bank Panic (Euro, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bankpcRomInfo, sms_bankpcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Comical Machine Gun Joe (Jpn, MyCard) - -static struct BurnRomInfo sms_comicalRomDesc[] = { - { "comical machine gun joe (japan).bin", 0x08000, 0x9d549e08, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_comical) -STD_ROM_FN(sms_comical) - -struct BurnDriver BurnDrvsms_comical = { - "sms_comical", NULL, NULL, NULL, "1986", - "Comical Machine Gun Joe (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_comicalRomInfo, sms_comicalRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// F-16 Fighter (Euro, USA, Sega Card) - -static struct BurnRomInfo sms_f16fightcRomDesc[] = { - { "f-16 fighter (euro, usa).bin", 0x08000, 0xeaebf323, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_f16fightc) -STD_ROM_FN(sms_f16fightc) - -struct BurnDriver BurnDrvsms_f16fightc = { - "sms_f16fightc", "sms_f16fight", NULL, NULL, "1986", - "F-16 Fighter (Euro, USA, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_f16fightcRomInfo, sms_f16fightcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// F-16 Fighting Falcon (Jpn, MyCard) - -static struct BurnRomInfo sms_f16falcjcRomDesc[] = { - { "f-16 fighting falcon (japan).bin", 0x08000, 0x7ce06fce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_f16falcjc) -STD_ROM_FN(sms_f16falcjc) - -struct BurnDriver BurnDrvsms_f16falcjc = { - "sms_f16falcjc", "sms_f16fight", NULL, NULL, "1985", - "F-16 Fighting Falcon (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_f16falcjcRomInfo, sms_f16falcjcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// F-16 Fighting Falcon (USA, Sega Card for Display Unit) - -static struct BurnRomInfo sms_f16falccRomDesc[] = { - { "f-16 fighting falcon (usa).bin", 0x08000, 0x184c23b7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_f16falcc) -STD_ROM_FN(sms_f16falcc) - -struct BurnDriver BurnDrvsms_f16falcc = { - "sms_f16falcc", "sms_f16fight", NULL, NULL, "1985", - "F-16 Fighting Falcon (USA, Sega Card for Display Unit)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_f16falccRomInfo, sms_f16falccRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fushigi no Oshiro Pit Pot (Jpn, MyCard) - -static struct BurnRomInfo sms_pitpotRomDesc[] = { - { "fushigi no oshiro pit pot (japan).bin", 0x08000, 0xe6795c53, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_pitpot) -STD_ROM_FN(sms_pitpot) - -struct BurnDriver BurnDrvsms_pitpot = { - "sms_pitpot", NULL, NULL, NULL, "1985", - "Fushigi no Oshiro Pit Pot (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_pitpotRomInfo, sms_pitpotRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ghost House (Euro, USA, Bra, Sega Card) - -static struct BurnRomInfo sms_ghosthcRomDesc[] = { - { "ghost house (euro, usa, bra).bin", 0x08000, 0xf1f8ff2d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ghosthc) -STD_ROM_FN(sms_ghosthc) - -struct BurnDriver BurnDrvsms_ghosthc = { - "sms_ghosthc", "sms_ghosth", NULL, NULL, "1986", - "Ghost House (Euro, USA, Bra, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ghosthcRomInfo, sms_ghosthcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ghost House (Sega Card, Prototype) - -static struct BurnRomInfo sms_ghosthcpRomDesc[] = { - { "ghost house (usa, europe) (beta).bin", 0x08000, 0xc3e7c1ed, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ghosthcp) -STD_ROM_FN(sms_ghosthcp) - -struct BurnDriver BurnDrvsms_ghosthcp = { - "sms_ghosthcp", "sms_ghosth", NULL, NULL, "1986", - "Ghost House (Sega Card, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ghosthcpRomInfo, sms_ghosthcpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ghost House (Jpn, MyCard) - -static struct BurnRomInfo sms_ghosthjRomDesc[] = { - { "ghost house (japan).bin", 0x08000, 0xc0f3ce7e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_ghosthj) -STD_ROM_FN(sms_ghosthj) - -struct BurnDriver BurnDrvsms_ghosthj = { - "sms_ghosthj", "sms_ghosth", NULL, NULL, "1986", - "Ghost House (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_ghosthjRomInfo, sms_ghosthjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Baseball (Jpn, MyCard) - -static struct BurnRomInfo sms_greatbasjRomDesc[] = { - { "great baseball (japan).bin", 0x08000, 0x89e98a7c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatbasj) -STD_ROM_FN(sms_greatbasj) - -struct BurnDriver BurnDrvsms_greatbasj = { - "sms_greatbasj", "sms_greatbas", NULL, NULL, "1985", - "Great Baseball (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatbasjRomInfo, sms_greatbasjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Soccer (Euro, Sega Card) - -static struct BurnRomInfo sms_greatscrcRomDesc[] = { - { "great soccer (europe).bin", 0x08000, 0x0ed170c9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatscrc) -STD_ROM_FN(sms_greatscrc) - -struct BurnDriver BurnDrvsms_greatscrc = { - "sms_greatscrc", "sms_greatscr", NULL, NULL, "1985", - "Great Soccer (Euro, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatscrcRomInfo, sms_greatscrcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Soccer (Jpn, MyCard) - -static struct BurnRomInfo sms_greatscrjRomDesc[] = { - { "great soccer (japan).bin", 0x08000, 0x2d7fd7ef, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greatscrj) -STD_ROM_FN(sms_greatscrj) - -struct BurnDriver BurnDrvsms_greatscrj = { - "sms_greatscrj", "sms_greatscr", NULL, NULL, "1985", - "Great Soccer (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greatscrjRomInfo, sms_greatscrjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Great Tennis (Jpn, MyCard) - -static struct BurnRomInfo sms_greattnsRomDesc[] = { - { "great tennis (japan).bin", 0x08000, 0x95cbf3dd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_greattns) -STD_ROM_FN(sms_greattns) - -struct BurnDriver BurnDrvsms_greattns = { - "sms_greattns", "sms_stennis", NULL, NULL, "1985", - "Great Tennis (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_greattnsRomInfo, sms_greattnsRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hang-On (Euro, Bra, Aus, Sega Card) - -static struct BurnRomInfo sms_hangoncRomDesc[] = { - { "hang-on (europe).bin", 0x08000, 0x071b045e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hangonc) -STD_ROM_FN(sms_hangonc) - -struct BurnDriver BurnDrvsms_hangonc = { - "sms_hangonc", "sms_hangon", NULL, NULL, "1985", - "Hang-On (Euro, Bra, Aus, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hangoncRomInfo, sms_hangoncRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hang-On (Jpn, MyCard) - -static struct BurnRomInfo sms_hangonjRomDesc[] = { - { "hang-on (japan).bin", 0x08000, 0x5c01adf9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hangonj) -STD_ROM_FN(sms_hangonj) - -struct BurnDriver BurnDrvsms_hangonj = { - "sms_hangonj", "sms_hangon", NULL, NULL, "1985", - "Hang-On (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_hangonjRomInfo, sms_hangonjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// My Hero (Euro, USA, Bra, Sega Card) - -static struct BurnRomInfo sms_myherocRomDesc[] = { - { "my hero (usa, europe).bin", 0x08000, 0x62f0c23d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_myheroc) -STD_ROM_FN(sms_myheroc) - -struct BurnDriver BurnDrvsms_myheroc = { - "sms_myheroc", "sms_myhero", NULL, NULL, "1986", - "My Hero (Euro, USA, Bra, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_myherocRomInfo, sms_myherocRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Satellite 7 (Jpn, MyCard) - -static struct BurnRomInfo sms_satell7RomDesc[] = { - { "satellite 7 (japan).bin", 0x08000, 0x16249e19, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_satell7) -STD_ROM_FN(sms_satell7) - -struct BurnDriver BurnDrvsms_satell7 = { - "sms_satell7", NULL, NULL, NULL, "1985", - "Satellite 7 (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_satell7RomInfo, sms_satell7RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Seishun Scandal (Jpn, MyCard) - -static struct BurnRomInfo sms_seishunRomDesc[] = { - { "seishun scandal (japan).bin", 0x08000, 0xf0ba2bc6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_seishun) -STD_ROM_FN(sms_seishun) - -struct BurnDriver BurnDrvsms_seishun = { - "sms_seishun", "sms_myhero", NULL, NULL, "1986", - "Seishun Scandal (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_seishunRomInfo, sms_seishunRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spy vs. Spy (Euro, USA, Bra, Sega Card) - -static struct BurnRomInfo sms_spyvsspycRomDesc[] = { - { "spy vs. spy (usa, europe).bin", 0x08000, 0x78d7faab, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spyvsspyc) -STD_ROM_FN(sms_spyvsspyc) - -struct BurnDriver BurnDrvsms_spyvsspyc = { - "sms_spyvsspyc", "sms_spyvsspy", NULL, NULL, "1986", - "Spy vs. Spy (Euro, USA, Bra, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_spyvsspycRomInfo, sms_spyvsspycRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spy vs Spy (Jpn, MyCard) - -static struct BurnRomInfo sms_spyvsspyjRomDesc[] = { - { "spy vs spy (japan).bin", 0x08000, 0xd41b9a08, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_spyvsspyj) -STD_ROM_FN(sms_spyvsspyj) - -struct BurnDriver BurnDrvsms_spyvsspyj = { - "sms_spyvsspyj", "sms_spyvsspy", NULL, NULL, "1986", - "Spy vs Spy (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_spyvsspyjRomInfo, sms_spyvsspyjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Tennis (Euro, USA, Sega Card) - -static struct BurnRomInfo sms_stenniscRomDesc[] = { - { "super tennis (euro, usa).bin", 0x08000, 0x914514e3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_stennisc) -STD_ROM_FN(sms_stennisc) - -struct BurnDriver BurnDrvsms_stennisc = { - "sms_stennisc", "sms_stennis", NULL, NULL, "1985", - "Super Tennis (Euro, USA, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_stenniscRomInfo, sms_stenniscRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Teddy Boy (Euro, USA, Bra, Sega Card) - -static struct BurnRomInfo sms_teddyboycRomDesc[] = { - { "teddy boy (euro, usa, bra).bin", 0x08000, 0x2728faa3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_teddyboyc) -STD_ROM_FN(sms_teddyboyc) - -struct BurnDriver BurnDrvsms_teddyboyc = { - "sms_teddyboyc", "sms_teddyboy", NULL, NULL, "1985", - "Teddy Boy (Euro, USA, Bra, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_teddyboycRomInfo, sms_teddyboycRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Teddy Boy Blues (Jpn, Ep-MyCard, Prototype) - -static struct BurnRomInfo sms_teddyboyjpRomDesc[] = { - { "teddy boy blues (japan) (proto) (ep-mycard).bin", 0x0c000, 0xd7508041, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_teddyboyjp) -STD_ROM_FN(sms_teddyboyjp) - -struct BurnDriver BurnDrvsms_teddyboyjp = { - "sms_teddyboyjp", "sms_teddyboy", NULL, NULL, "1985", - "Teddy Boy Blues (Jpn, Ep-MyCard, Prototype)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_teddyboyjpRomInfo, sms_teddyboyjpRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Teddy Boy Blues (Jpn, MyCard) - -static struct BurnRomInfo sms_teddyboyjRomDesc[] = { - { "teddy boy blues (japan).bin", 0x08000, 0x316727dd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_teddyboyj) -STD_ROM_FN(sms_teddyboyj) - -struct BurnDriver BurnDrvsms_teddyboyj = { - "sms_teddyboyj", "sms_teddyboy", NULL, NULL, "1985", - "Teddy Boy Blues (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_teddyboyjRomInfo, sms_teddyboyjRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// TransBot (Euro, USA, Bra, Sega Card) - -static struct BurnRomInfo sms_transbotcRomDesc[] = { - { "transbot (euro, usa, bra).bin", 0x08000, 0x4bc42857, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_transbotc) -STD_ROM_FN(sms_transbotc) - -struct BurnDriver BurnDrvsms_transbotc = { - "sms_transbotc", "sms_transbot", NULL, NULL, "1985", - "TransBot (Euro, USA, Bra, Sega Card)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_transbotcRomInfo, sms_transbotcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Woody Pop - Shinjinrui no Block Kuzushi (Jpn, MyCard) - -static struct BurnRomInfo sms_woodypopRomDesc[] = { - { "woody pop - shinjinrui no block kuzushi (japan).bin", 0x08000, 0x315917d4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_woodypop) -STD_ROM_FN(sms_woodypop) - -struct BurnDriver BurnDrvsms_woodypop = { - "sms_woodypop", NULL, NULL, NULL, "1987", - "Woody Pop - Shinjinrui no Block Kuzushi (Jpn, MyCard)\0", NULL, "Sega", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_woodypopRomInfo, sms_woodypopRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// 5 in 1 Funpak (USA) - -static struct BurnRomInfo gg_5in1funRomDesc[] = { - { "5 in 1 funpak (usa).bin", 0x40000, 0xf85a8ce8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_5in1fun) -STD_ROM_FN(gg_5in1fun) - -struct BurnDriver BurnDrvgg_5in1fun = { - "gg_5in1fun", NULL, NULL, NULL, "1994", - "5 in 1 Funpak (USA)\0", NULL, "Interplay", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_5in1funRomInfo, gg_5in1funRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Aa Harimanada (Jpn) - -static struct BurnRomInfo gg_aaharimaRomDesc[] = { - { "aa harimanada (japan).bin", 0x80000, 0x1d17d2a0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aaharima) -STD_ROM_FN(gg_aaharima) - -struct BurnDriver BurnDrvgg_aaharima = { - "gg_aaharima", NULL, NULL, NULL, "1993", - "Aa Harimanada (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aaharimaRomInfo, gg_aaharimaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Addams Family (World) - -static struct BurnRomInfo gg_addfamRomDesc[] = { - { "mpr-16234-f.ic1", 0x40000, 0x1d01f999, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_addfam) -STD_ROM_FN(gg_addfam) - -struct BurnDriver BurnDrvgg_addfam = { - "gg_addfam", NULL, NULL, NULL, "1993", - "The Addams Family (World)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_addfamRomInfo, gg_addfamRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Adventures of Batman and Robin (Euro, USA) - -static struct BurnRomInfo gg_advbatmrRomDesc[] = { - { "adventures of batman and robin, the (usa, europe).bin", 0x80000, 0xbb4f23ff, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_advbatmr) -STD_ROM_FN(gg_advbatmr) - -struct BurnDriver BurnDrvgg_advbatmr = { - "gg_advbatmr", NULL, NULL, NULL, "1995", - "The Adventures of Batman and Robin (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_advbatmrRomInfo, gg_advbatmrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Aerial Assault (Jpn, v1) - -static struct BurnRomInfo gg_aerialasjRomDesc[] = { - { "aerial assault (japan) (v1.1).bin", 0x20000, 0x04fe6dde, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aerialasj) -STD_ROM_FN(gg_aerialasj) - -struct BurnDriver BurnDrvgg_aerialasj = { - "gg_aerialasj", "gg_aerialas", NULL, NULL, "1992", - "Aerial Assault (Jpn, v1)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aerialasjRomInfo, gg_aerialasjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Aerial Assault (World, v0) - -static struct BurnRomInfo gg_aerialasRomDesc[] = { - { "aerial assault (world).bin", 0x20000, 0x3e549b7a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aerialas) -STD_ROM_FN(gg_aerialas) - -struct BurnDriver BurnDrvgg_aerialas = { - "gg_aerialas", NULL, NULL, NULL, "1992", - "Aerial Assault (World, v0)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aerialasRomInfo, gg_aerialasRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Aladdin (Jpn) - -static struct BurnRomInfo gg_aladdinjRomDesc[] = { - { "aladdin (japan).bin", 0x80000, 0x770e95e1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aladdinj) -STD_ROM_FN(gg_aladdinj) - -struct BurnDriver BurnDrvgg_aladdinj = { - "gg_aladdinj", "gg_aladdin", NULL, NULL, "1994", - "Disney's Aladdin (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aladdinjRomInfo, gg_aladdinjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Aladdin (Euro, USA, Bra) - -static struct BurnRomInfo gg_aladdinRomDesc[] = { - { "aladdin (usa, europe).bin", 0x80000, 0x7a41c1dc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aladdin) -STD_ROM_FN(gg_aladdin) - -struct BurnDriver BurnDrvgg_aladdin = { - "gg_aladdin", NULL, NULL, NULL, "1994", - "Disney's Aladdin (Euro, USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aladdinRomInfo, gg_aladdinRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Aladdin (Prototype, 19931229) - -static struct BurnRomInfo gg_aladdinp3RomDesc[] = { - { "aladdin (prototype - dec 29, 1993).bin", 0x80000, 0x5b1f717f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aladdinp3) -STD_ROM_FN(gg_aladdinp3) - -struct BurnDriver BurnDrvgg_aladdinp3 = { - "gg_aladdinp3", "gg_aladdin", NULL, NULL, "1993", - "Disney's Aladdin (Prototype, 19931229)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aladdinp3RomInfo, gg_aladdinp3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Aladdin (Prototype, 19940111) - -static struct BurnRomInfo gg_aladdinp2RomDesc[] = { - { "aladdin (prototype - jan 11, 1994).bin", 0x80000, 0x8a1693ab, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aladdinp2) -STD_ROM_FN(gg_aladdinp2) - -struct BurnDriver BurnDrvgg_aladdinp2 = { - "gg_aladdinp2", "gg_aladdin", NULL, NULL, "1994", - "Disney's Aladdin (Prototype, 19940111)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aladdinp2RomInfo, gg_aladdinp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Aladdin (Prototype, 19940113) - -static struct BurnRomInfo gg_aladdinp1RomDesc[] = { - { "aladdin (prototype - jan 13, 1994).bin", 0x80000, 0x75a7f142, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aladdinp1) -STD_ROM_FN(gg_aladdinp1) - -struct BurnDriver BurnDrvgg_aladdinp1 = { - "gg_aladdinp1", "gg_aladdin", NULL, NULL, "1994", - "Disney's Aladdin (Prototype, 19940113)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aladdinp1RomInfo, gg_aladdinp1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alex Kidd in Miracle World (Tw, SMS Mode) - -static struct BurnRomInfo gg_alexkiddRomDesc[] = { - { "alex kidd in miracle world [sms-gg] (tw).bin", 0x20000, 0x6f8e46cf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_alexkidd) -STD_ROM_FN(gg_alexkidd) - -struct BurnDriver BurnDrvgg_alexkidd = { - "gg_alexkidd", NULL, NULL, NULL, "198?", - "Alex Kidd in Miracle World (Tw, SMS Mode)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE | HARDWARE_SMS_JAPANESE, GBF_MISC, 0, - GGGetZipName, gg_alexkiddRomInfo, gg_alexkiddRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alien (Euro, USA) - -static struct BurnRomInfo gg_alien3RomDesc[] = { - { "alien 3 (usa, europe).bin", 0x40000, 0x11a68c08, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_alien3) -STD_ROM_FN(gg_alien3) - -struct BurnDriver BurnDrvgg_alien3 = { - "gg_alien3", NULL, NULL, NULL, "1992", - "Alien 3 (Euro, USA)\0", NULL, "Arena", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_alien3RomInfo, gg_alien3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alien (Jpn) - -static struct BurnRomInfo gg_alien3jRomDesc[] = { - { "alien 3 (jp).bin", 0x40000, 0x06f6eebb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_alien3j) -STD_ROM_FN(gg_alien3j) - -struct BurnDriver BurnDrvgg_alien3j = { - "gg_alien3j", "gg_alien3", NULL, NULL, "1992", - "Alien 3 (Jpn)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_alien3jRomInfo, gg_alien3jRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alien Syndrome (Jpn) - -static struct BurnRomInfo gg_aliensynjRomDesc[] = { - { "alien syndrome (japan).bin", 0x20000, 0xffe4ed47, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aliensynj) -STD_ROM_FN(gg_aliensynj) - -struct BurnDriver BurnDrvgg_aliensynj = { - "gg_aliensynj", "gg_aliensyn", NULL, NULL, "1992", - "Alien Syndrome (Jpn)\0", NULL, "SIMS", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aliensynjRomInfo, gg_aliensynjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Alien Syndrome (Euro, USA) - -static struct BurnRomInfo gg_aliensynRomDesc[] = { - { "alien syndrome (usa, europe).bin", 0x20000, 0xbb5e10e0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_aliensyn) -STD_ROM_FN(gg_aliensyn) - -struct BurnDriver BurnDrvgg_aliensyn = { - "gg_aliensyn", NULL, NULL, NULL, "1992", - "Alien Syndrome (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_aliensynRomInfo, gg_aliensynRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Andre Agassi Tennis (USA) - -static struct BurnRomInfo gg_agassiRomDesc[] = { - { "andre agassi tennis (usa).bin", 0x40000, 0x46c9fa3e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_agassi) -STD_ROM_FN(gg_agassi) - -struct BurnDriver BurnDrvgg_agassi = { - "gg_agassi", NULL, NULL, NULL, "1993", - "Andre Agassi Tennis (USA)\0", NULL, "TecMagik", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_agassiRomInfo, gg_agassiRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Arcade Classics (USA) - -static struct BurnRomInfo gg_arcadeclRomDesc[] = { - { "arcade classics (usa).bin", 0x40000, 0x3deca813, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_arcadecl) -STD_ROM_FN(gg_arcadecl) - -struct BurnDriver BurnDrvgg_arcadecl = { - "gg_arcadecl", NULL, NULL, NULL, "1996", - "Arcade Classics (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_arcadeclRomInfo, gg_arcadeclRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Arch Rivals (USA) - -static struct BurnRomInfo gg_archrivlRomDesc[] = { - { "arch rivals (usa).bin", 0x40000, 0xf0204191, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_archrivl) -STD_ROM_FN(gg_archrivl) - -struct BurnDriver BurnDrvgg_archrivl = { - "gg_archrivl", NULL, NULL, NULL, "1992", - "Arch Rivals (USA)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_archrivlRomInfo, gg_archrivlRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Arena (Euro, USA) - -static struct BurnRomInfo gg_arenaRomDesc[] = { - { "arena (usa, europe).bin", 0x80000, 0x7cb3facf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_arena) -STD_ROM_FN(gg_arena) - -struct BurnDriver BurnDrvgg_arena = { - "gg_arena", NULL, NULL, NULL, "1995", - "Arena (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_arenaRomInfo, gg_arenaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Ariel the Little Mermaid (Euro, USA) - -static struct BurnRomInfo gg_arielRomDesc[] = { - { "mpr-15394-f.ic1", 0x40000, 0x97e3a18c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ariel) -STD_ROM_FN(gg_ariel) - -struct BurnDriver BurnDrvgg_ariel = { - "gg_ariel", NULL, NULL, NULL, "1991", - "Disney's Ariel the Little Mermaid (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_arielRomInfo, gg_arielRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Arliel - Crystal Densetsu (Jpn) - -static struct BurnRomInfo gg_arlielRomDesc[] = { - { "mpr-14389.ic1", 0x40000, 0x35fa3f68, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_arliel) -STD_ROM_FN(gg_arliel) - -struct BurnDriver BurnDrvgg_arliel = { - "gg_arliel", "gg_crystalw", NULL, NULL, "1991", - "Arliel - Crystal Densetsu (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_arlielRomInfo, gg_arlielRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astérix and the Great Rescue (Euro) - -static struct BurnRomInfo gg_astergreRomDesc[] = { - { "mpr-16718.ic1", 0x80000, 0x328c5cc8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_astergre) -STD_ROM_FN(gg_astergre) - -struct BurnDriver BurnDrvgg_astergre = { - "gg_astergre", NULL, NULL, NULL, "1993", - "Asterix and the Great Rescue (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_astergreRomInfo, gg_astergreRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astérix and the Great Rescue (USA) - -static struct BurnRomInfo gg_astergreuRomDesc[] = { - { "asterix and the great rescue (usa).bin", 0x80000, 0x78208b40, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_astergreu) -STD_ROM_FN(gg_astergreu) - -struct BurnDriver BurnDrvgg_astergreu = { - "gg_astergreu", "gg_astergre", NULL, NULL, "1994", - "Asterix and the Great Rescue (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_astergreuRomInfo, gg_astergreuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astérix and the Great Rescue (Prototype, 19940216) - -static struct BurnRomInfo gg_astergrep5RomDesc[] = { - { "asterix (prototype - feb 16, 1994).bin", 0x80000, 0x1e8d735c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_astergrep5) -STD_ROM_FN(gg_astergrep5) - -struct BurnDriver BurnDrvgg_astergrep5 = { - "gg_astergrep5", "gg_astergre", NULL, NULL, "1994", - "Asterix and the Great Rescue (Prototype, 19940216)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_astergrep5RomInfo, gg_astergrep5RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astérix and the Great Rescue (Prototype, 19940222) - -static struct BurnRomInfo gg_astergrep4RomDesc[] = { - { "asterix (prototype - feb 22, 1994).bin", 0x80000, 0x31bd3d8a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_astergrep4) -STD_ROM_FN(gg_astergrep4) - -struct BurnDriver BurnDrvgg_astergrep4 = { - "gg_astergrep4", "gg_astergre", NULL, NULL, "1994", - "Asterix and the Great Rescue (Prototype, 19940222)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_astergrep4RomInfo, gg_astergrep4RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astérix and the Great Rescue (Prototype, 19940125) - -static struct BurnRomInfo gg_astergrep3RomDesc[] = { - { "asterix (prototype - jan 25, 1994).bin", 0x80000, 0xba45f00f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_astergrep3) -STD_ROM_FN(gg_astergrep3) - -struct BurnDriver BurnDrvgg_astergrep3 = { - "gg_astergrep3", "gg_astergre", NULL, NULL, "1994", - "Asterix and the Great Rescue (Prototype, 19940125)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_astergrep3RomInfo, gg_astergrep3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astérix and the Great Rescue (Prototype, 19940313) - -static struct BurnRomInfo gg_astergrep2RomDesc[] = { - { "asterix (prototype - mar 13, 1994).bin", 0x80000, 0xfaf09846, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_astergrep2) -STD_ROM_FN(gg_astergrep2) - -struct BurnDriver BurnDrvgg_astergrep2 = { - "gg_astergrep2", "gg_astergre", NULL, NULL, "1994", - "Asterix and the Great Rescue (Prototype, 19940313)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_astergrep2RomInfo, gg_astergrep2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Astérix and the Great Rescue (Prototype, 19940315) - -static struct BurnRomInfo gg_astergrep1RomDesc[] = { - { "asterix (prototype - mar 15, 1994).bin", 0x80000, 0x66d8eb63, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_astergrep1) -STD_ROM_FN(gg_astergrep1) - -struct BurnDriver BurnDrvgg_astergrep1 = { - "gg_astergrep1", "gg_astergre", NULL, NULL, "1994", - "Asterix and the Great Rescue (Prototype, 19940315)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_astergrep1RomInfo, gg_astergrep1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Asterix and the Secret Mission (Euro) - -static struct BurnRomInfo gg_astermisRomDesc[] = { - { "asterix and the secret mission (europe) (en,fr,de).bin", 0x80000, 0xc01a8051, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_astermis) -STD_ROM_FN(gg_astermis) - -struct BurnDriver BurnDrvgg_astermis = { - "gg_astermis", NULL, NULL, NULL, "1993", - "Asterix and the Secret Mission (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_astermisRomInfo, gg_astermisRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ax Battler - A Legend of Golden Axe (Euro, USA, v2.4) - -static struct BurnRomInfo gg_axbattlrRomDesc[] = { - { "ax battler - a legend of golden axe (usa, europe) (v2.4).bin", 0x40000, 0x663bcf8a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_axbattlr) -STD_ROM_FN(gg_axbattlr) - -struct BurnDriver BurnDrvgg_axbattlr = { - "gg_axbattlr", NULL, NULL, NULL, "1991", - "Ax Battler - A Legend of Golden Axe (Euro, USA, v2.4)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_axbattlrRomInfo, gg_axbattlrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ax Battler - A Legend of Golden Axe (Euro, USA, Prototype v2.0) - -static struct BurnRomInfo gg_axbattlrpRomDesc[] = { - { "ax battler - a legend of golden axe [v2.0] [proto].bin", 0x40000, 0x3435ab54, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_axbattlrp) -STD_ROM_FN(gg_axbattlrp) - -struct BurnDriver BurnDrvgg_axbattlrp = { - "gg_axbattlrp", "gg_axbattlr", NULL, NULL, "1991", - "Ax Battler - A Legend of Golden Axe (Euro, USA, Prototype v2.0)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_axbattlrpRomInfo, gg_axbattlrpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ax Battler - Golden Axe Densetsu (Jpn, v1.5) - -static struct BurnRomInfo gg_axbattlrjRomDesc[] = { - { "ax battler - golden axe densetsu (japan) (v1.5).bin", 0x40000, 0xdfcf555f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_axbattlrj) -STD_ROM_FN(gg_axbattlrj) - -struct BurnDriver BurnDrvgg_axbattlrj = { - "gg_axbattlrj", "gg_axbattlr", NULL, NULL, "1991", - "Ax Battler - Golden Axe Densetsu (Jpn, v1.5)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_axbattlrjRomInfo, gg_axbattlrjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ayrton Senna's Super Monaco GP II (Jpn) - -static struct BurnRomInfo gg_smgp2jRomDesc[] = { - { "mpr-15044.ic1", 0x40000, 0x661faeff, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_smgp2j) -STD_ROM_FN(gg_smgp2j) - -struct BurnDriver BurnDrvgg_smgp2j = { - "gg_smgp2j", "gg_smgp2", NULL, NULL, "1992", - "Ayrton Senna's Super Monaco GP II (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_smgp2jRomInfo, gg_smgp2jRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ayrton Senna's Super Monaco GP II (Euro, USA) - -static struct BurnRomInfo gg_smgp2RomDesc[] = { - { "mpr-15049-f.ic1", 0x40000, 0x1d1b1dd3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_smgp2) -STD_ROM_FN(gg_smgp2) - -struct BurnDriver BurnDrvgg_smgp2 = { - "gg_smgp2", NULL, NULL, NULL, "1992", - "Ayrton Senna's Super Monaco GP II (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_smgp2RomInfo, gg_smgp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ayrton Senna's Super Monaco GP II (Euro, USA, Prototype) - -static struct BurnRomInfo gg_smgp2pRomDesc[] = { - { "ayrton senna's super monaco gp ii (proto).bin", 0x40000, 0x6afb8ec6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_smgp2p) -STD_ROM_FN(gg_smgp2p) - -struct BurnDriver BurnDrvgg_smgp2p = { - "gg_smgp2p", "gg_smgp2", NULL, NULL, "1992", - "Ayrton Senna's Super Monaco GP II (Euro, USA, Prototype)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_smgp2pRomInfo, gg_smgp2pRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Baku Baku Animal (Euro) - -static struct BurnRomInfo gg_bakubakuRomDesc[] = { - { "baku baku animal (europe).bin", 0x40000, 0x10ac9374, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bakubaku) -STD_ROM_FN(gg_bakubaku) - -struct BurnDriver BurnDrvgg_bakubaku = { - "gg_bakubaku", NULL, NULL, NULL, "1996", - "Baku Baku Animal (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bakubakuRomInfo, gg_bakubakuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Baku Baku Animal (USA) - -static struct BurnRomInfo gg_bakubakuuRomDesc[] = { - { "baku baku animal (usa).bin", 0x40000, 0x8d8bfdc4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bakubakuu) -STD_ROM_FN(gg_bakubakuu) - -struct BurnDriver BurnDrvgg_bakubakuu = { - "gg_bakubakuu", "gg_bakubaku", NULL, NULL, "1996", - "Baku Baku Animal (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bakubakuuRomInfo, gg_bakubakuuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Baku Baku Animal - Sekai Shiikugakari Senshu-ken (Jpn) - -static struct BurnRomInfo gg_bakubakujRomDesc[] = { - { "mpr-18706-s.ic1", 0x40000, 0x7174b802, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bakubakuj) -STD_ROM_FN(gg_bakubakuj) - -struct BurnDriver BurnDrvgg_bakubakuj = { - "gg_bakubakuj", "gg_bakubaku", NULL, NULL, "1996", - "Baku Baku Animal - Sekai Shiikugakari Senshu-ken (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bakubakujRomInfo, gg_bakubakujRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Barbie Super Model (Prototype) - -static struct BurnRomInfo gg_barbieRomDesc[] = { - { "barbie super model (unknown) (proto).bin", 0x40000, 0x03a0ce9e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_barbie) -STD_ROM_FN(gg_barbie) - -struct BurnDriver BurnDrvgg_barbie = { - "gg_barbie", NULL, NULL, NULL, "199?", - "Barbie Super Model (Prototype)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_barbieRomInfo, gg_barbieRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Simpsons - Bartman Meets Radioactive Man (USA) - -static struct BurnRomInfo gg_bartmanRomDesc[] = { - { "mpr-16373.ic1", 0x40000, 0xffa447a9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bartman) -STD_ROM_FN(gg_bartman) - -struct BurnDriver BurnDrvgg_bartman = { - "gg_bartman", NULL, NULL, NULL, "1992", - "The Simpsons - Bartman Meets Radioactive Man (USA)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bartmanRomInfo, gg_bartmanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Batman Forever (World) - -static struct BurnRomInfo gg_batmanfRomDesc[] = { - { "batman forever (world).bin", 0x80000, 0x618b19e2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_batmanf) -STD_ROM_FN(gg_batmanf) - -struct BurnDriver BurnDrvgg_batmanf = { - "gg_batmanf", NULL, NULL, NULL, "1995", - "Batman Forever (World)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_batmanfRomInfo, gg_batmanfRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Batman Returns (World) - -static struct BurnRomInfo gg_batmanrnRomDesc[] = { - { "epoxy.u1", 0x40000, 0x7ac4a3ca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_batmanrn) -STD_ROM_FN(gg_batmanrn) - -struct BurnDriver BurnDrvgg_batmanrn = { - "gg_batmanrn", NULL, NULL, NULL, "1992", - "Batman Returns (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_batmanrnRomInfo, gg_batmanrnRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Batter Up (Euro, USA) - -static struct BurnRomInfo gg_batterupRomDesc[] = { - { "batter up (usa, europe).bin", 0x20000, 0x16448209, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_batterup) -STD_ROM_FN(gg_batterup) - -struct BurnDriver BurnDrvgg_batterup = { - "gg_batterup", NULL, NULL, NULL, "1991", - "Batter Up (Euro, USA)\0", NULL, "Namco", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_batterupRomInfo, gg_batterupRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Battleship (Euro, USA) - -static struct BurnRomInfo gg_bshipRomDesc[] = { - { "battleship (usa, europe).bin", 0x10000, 0xfddd8cd9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bship) -STD_ROM_FN(gg_bship) - -struct BurnDriver BurnDrvgg_bship = { - "gg_bship", NULL, NULL, NULL, "1993", - "Battleship (Euro, USA)\0", NULL, "Mindscape", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bshipRomInfo, gg_bshipRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Battletoads (Euro, Jpn) - -static struct BurnRomInfo gg_btoadsRomDesc[] = { - { "battletoads (japan, europe).bin", 0x40000, 0xcb3cd075, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_btoads) -STD_ROM_FN(gg_btoads) - -struct BurnDriver BurnDrvgg_btoads = { - "gg_btoads", NULL, NULL, NULL, "1993", - "Battletoads (Euro, Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_btoadsRomInfo, gg_btoadsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Battletoads (USA) - -static struct BurnRomInfo gg_btoadsuRomDesc[] = { - { "battletoads (usa).bin", 0x40000, 0x817cc0ca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_btoadsu) -STD_ROM_FN(gg_btoadsu) - -struct BurnDriver BurnDrvgg_btoadsu = { - "gg_btoadsu", "gg_btoads", NULL, NULL, "1993", - "Battletoads (USA)\0", NULL, "Tradewest", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_btoadsuRomInfo, gg_btoadsuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Beavis and Butt-head (Euro, USA) - -static struct BurnRomInfo gg_beavisRomDesc[] = { - { "beavis and butt-head (europe).bin", 0x80000, 0xa6bf865e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_beavis) -STD_ROM_FN(gg_beavis) - -struct BurnDriver BurnDrvgg_beavis = { - "gg_beavis", NULL, NULL, NULL, "1994", - "Beavis and Butt-head (Euro, USA)\0", NULL, "Viacom New Media", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_beavisRomInfo, gg_beavisRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Beavis and Butt-head (Prototype?) - -static struct BurnRomInfo gg_beavispRomDesc[] = { - { "beavis and butt-head (usa).bin", 0x80000, 0x3858f14f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_beavisp) -STD_ROM_FN(gg_beavisp) - -struct BurnDriver BurnDrvgg_beavisp = { - "gg_beavisp", "gg_beavis", NULL, NULL, "1994", - "Beavis and Butt-head (Prototype?)\0", NULL, "Viacom New Media", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_beavispRomInfo, gg_beavispRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (USA) - -static struct BurnRomInfo gg_berensRomDesc[] = { - { "berenstain bears' camping adventure, the (usa).bin", 0x40000, 0xa4bb9ffb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berens) -STD_ROM_FN(gg_berens) - -struct BurnDriver BurnDrvgg_berens = { - "gg_berens", NULL, NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensRomInfo, gg_berensRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940801) - -static struct BurnRomInfo gg_berensp12RomDesc[] = { - { "berenstain bears (prototype - aug 01, 1994).bin", 0x40000, 0x882b8f53, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp12) -STD_ROM_FN(gg_berensp12) - -struct BurnDriver BurnDrvgg_berensp12 = { - "gg_berensp12", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940801)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp12RomInfo, gg_berensp12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940811-A) - -static struct BurnRomInfo gg_berensp11RomDesc[] = { - { "berenstain bears (prototype - aug 11, 1994 - a).bin", 0x40000, 0x81a5e68f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp11) -STD_ROM_FN(gg_berensp11) - -struct BurnDriver BurnDrvgg_berensp11 = { - "gg_berensp11", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940811-A)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp11RomInfo, gg_berensp11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940811) - -static struct BurnRomInfo gg_berensp10RomDesc[] = { - { "berenstain bears (prototype - aug 11, 1994).bin", 0x40000, 0x50d400b8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp10) -STD_ROM_FN(gg_berensp10) - -struct BurnDriver BurnDrvgg_berensp10 = { - "gg_berensp10", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940811)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp10RomInfo, gg_berensp10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940812) - -static struct BurnRomInfo gg_berensp09RomDesc[] = { - { "berenstain bears (prototype - aug 12, 1994).bin", 0x40000, 0x0e676927, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp09) -STD_ROM_FN(gg_berensp09) - -struct BurnDriver BurnDrvgg_berensp09 = { - "gg_berensp09", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940812)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp09RomInfo, gg_berensp09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940813) - -static struct BurnRomInfo gg_berensp08RomDesc[] = { - { "berenstain bears (prototype - aug 13, 1994).bin", 0x40000, 0xf8f11b2a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp08) -STD_ROM_FN(gg_berensp08) - -struct BurnDriver BurnDrvgg_berensp08 = { - "gg_berensp08", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940813)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp08RomInfo, gg_berensp08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940814) - -static struct BurnRomInfo gg_berensp07RomDesc[] = { - { "berenstain bears (prototype - aug 14, 1994).bin", 0x40000, 0xd0971f78, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp07) -STD_ROM_FN(gg_berensp07) - -struct BurnDriver BurnDrvgg_berensp07 = { - "gg_berensp07", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940814)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp07RomInfo, gg_berensp07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940819) - -static struct BurnRomInfo gg_berensp06RomDesc[] = { - { "berenstain bears (prototype - aug 19, 1994).bin", 0x40000, 0x177d65ac, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp06) -STD_ROM_FN(gg_berensp06) - -struct BurnDriver BurnDrvgg_berensp06 = { - "gg_berensp06", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940819)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp06RomInfo, gg_berensp06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940820) - -static struct BurnRomInfo gg_berensp05RomDesc[] = { - { "berenstain bears (prototype - aug 20, 1994).bin", 0x40000, 0xf61ac1e8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp05) -STD_ROM_FN(gg_berensp05) - -struct BurnDriver BurnDrvgg_berensp05 = { - "gg_berensp05", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940820)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp05RomInfo, gg_berensp05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940824) - -static struct BurnRomInfo gg_berensp04RomDesc[] = { - { "berenstain bears (prototype - aug 24, 1994).bin", 0x40000, 0xb73486d6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp04) -STD_ROM_FN(gg_berensp04) - -struct BurnDriver BurnDrvgg_berensp04 = { - "gg_berensp04", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940824)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp04RomInfo, gg_berensp04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940825-B) - -static struct BurnRomInfo gg_berensp03RomDesc[] = { - { "berenstain bears (prototype - aug 25, 1994 - b).bin", 0x40000, 0xe07b865e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp03) -STD_ROM_FN(gg_berensp03) - -struct BurnDriver BurnDrvgg_berensp03 = { - "gg_berensp03", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940825-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp03RomInfo, gg_berensp03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940826-B) - -static struct BurnRomInfo gg_berensp02RomDesc[] = { - { "berenstain bears (prototype - aug 26, 1994 - b).bin", 0x40000, 0x217b1ef0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp02) -STD_ROM_FN(gg_berensp02) - -struct BurnDriver BurnDrvgg_berensp02 = { - "gg_berensp02", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940826-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp02RomInfo, gg_berensp02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940826) - -static struct BurnRomInfo gg_berensp01RomDesc[] = { - { "berenstain bears (prototype - aug 26, 1994).bin", 0x40000, 0x167a4af6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp01) -STD_ROM_FN(gg_berensp01) - -struct BurnDriver BurnDrvgg_berensp01 = { - "gg_berensp01", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940826)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp01RomInfo, gg_berensp01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940715-B) - -static struct BurnRomInfo gg_berensp16RomDesc[] = { - { "berenstain bears (prototype - jul 15, 1994 - b).bin", 0x40000, 0xfcf47bc9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp16) -STD_ROM_FN(gg_berensp16) - -struct BurnDriver BurnDrvgg_berensp16 = { - "gg_berensp16", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940715-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp16RomInfo, gg_berensp16RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940721) - -static struct BurnRomInfo gg_berensp15RomDesc[] = { - { "berenstain bears (prototype - jul 21, 1994).bin", 0x40000, 0xa279c6bc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp15) -STD_ROM_FN(gg_berensp15) - -struct BurnDriver BurnDrvgg_berensp15 = { - "gg_berensp15", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940721)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp15RomInfo, gg_berensp15RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940722) - -static struct BurnRomInfo gg_berensp14RomDesc[] = { - { "berenstain bears (prototype - jul 22, 1994).bin", 0x40000, 0xffbf5abe, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp14) -STD_ROM_FN(gg_berensp14) - -struct BurnDriver BurnDrvgg_berensp14 = { - "gg_berensp14", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940722)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp14RomInfo, gg_berensp14RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940727) - -static struct BurnRomInfo gg_berensp13RomDesc[] = { - { "berenstain bears (prototype - jul 27, 1994).bin", 0x40000, 0x112b123f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp13) -STD_ROM_FN(gg_berensp13) - -struct BurnDriver BurnDrvgg_berensp13 = { - "gg_berensp13", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940727)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp13RomInfo, gg_berensp13RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Berenstain Bears' Camping Adventure (Prototype, 19940628) - -static struct BurnRomInfo gg_berensp17RomDesc[] = { - { "berenstain bears (prototype - jun 28, 1994).bin", 0x40000, 0x75a7a8ca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berensp17) -STD_ROM_FN(gg_berensp17) - -struct BurnDriver BurnDrvgg_berensp17 = { - "gg_berensp17", "gg_berens", NULL, NULL, "1994", - "The Berenstain Bears' Camping Adventure (Prototype, 19940628)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berensp17RomInfo, gg_berensp17RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Berlin no Kabe - The Berlin Wall (Jpn) - -static struct BurnRomInfo gg_berlinRomDesc[] = { - { "berlin no kabe (japan).bin", 0x40000, 0x325b1797, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_berlin) -STD_ROM_FN(gg_berlin) - -struct BurnDriver BurnDrvgg_berlin = { - "gg_berlin", NULL, NULL, NULL, "1991", - "Berlin no Kabe - The Berlin Wall (Jpn)\0", NULL, "Kaneko", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_berlinRomInfo, gg_berlinRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bishoujo Senshi Sailor Moon S (Jpn) - -static struct BurnRomInfo gg_sailormsRomDesc[] = { - { "mpr-17715.ic1", 0x80000, 0xfe7374d2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sailorms) -STD_ROM_FN(gg_sailorms) - -struct BurnDriver BurnDrvgg_sailorms = { - "gg_sailorms", NULL, NULL, NULL, "1995", - "Bishoujo Senshi Sailor Moon S (Jpn)\0", NULL, "Bandai", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sailormsRomInfo, gg_sailormsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Bonkers Wax Up! (Euro, USA) - -static struct BurnRomInfo gg_bonkersRomDesc[] = { - { "bonkers wax up! (usa, europe).bin", 0x80000, 0xbfceba5f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkers) -STD_ROM_FN(gg_bonkers) - -struct BurnDriver BurnDrvgg_bonkers = { - "gg_bonkers", NULL, NULL, NULL, "1995", - "Disney's Bonkers Wax Up! (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersRomInfo, gg_bonkersRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disneys Bonkers Wax Up! (Prototype, 19941203) - -static struct BurnRomInfo gg_bonkersp07RomDesc[] = { - { "bonkers wax up! (prototype - dec 03, 1994).bin", 0x80000, 0x63429025, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp07) -STD_ROM_FN(gg_bonkersp07) - -struct BurnDriver BurnDrvgg_bonkersp07 = { - "gg_bonkersp07", "gg_bonkers", NULL, NULL, "1994", - "Disneys Bonkers Wax Up! (Prototype, 19941203)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp07RomInfo, gg_bonkersp07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disneys Bonkers Wax Up! (Prototype, 19941205) - -static struct BurnRomInfo gg_bonkersp06RomDesc[] = { - { "bonkers wax up! (prototype - dec 05, 1994).bin", 0x80000, 0xc2229b6e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp06) -STD_ROM_FN(gg_bonkersp06) - -struct BurnDriver BurnDrvgg_bonkersp06 = { - "gg_bonkersp06", "gg_bonkers", NULL, NULL, "1994", - "Disneys Bonkers Wax Up! (Prototype, 19941205)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp06RomInfo, gg_bonkersp06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Bonkers Wax Up! (Prototype, 19941207-C) - -static struct BurnRomInfo gg_bonkersp05RomDesc[] = { - { "bonkers wax up! (prototype - dec 07, 1994 - c).bin", 0x80000, 0xedaf25e7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp05) -STD_ROM_FN(gg_bonkersp05) - -struct BurnDriver BurnDrvgg_bonkersp05 = { - "gg_bonkersp05", "gg_bonkers", NULL, NULL, "1994", - "Disney's Bonkers Wax Up! (Prototype, 19941207-C)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp05RomInfo, gg_bonkersp05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Bonkers Wax Up! (Prototype, 19941208-B) - -static struct BurnRomInfo gg_bonkersp04RomDesc[] = { - { "bonkers wax up! (prototype - dec 08, 1994 - b).bin", 0x80000, 0x9907a738, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp04) -STD_ROM_FN(gg_bonkersp04) - -struct BurnDriver BurnDrvgg_bonkersp04 = { - "gg_bonkersp04", "gg_bonkers", NULL, NULL, "1994", - "Disney's Bonkers Wax Up! (Prototype, 19941208-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp04RomInfo, gg_bonkersp04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Bonkers Wax Up! (Prototype, 19941208-C) - -static struct BurnRomInfo gg_bonkersp03RomDesc[] = { - { "bonkers wax up! (prototype - dec 08, 1994 - c).bin", 0x80000, 0x91258adc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp03) -STD_ROM_FN(gg_bonkersp03) - -struct BurnDriver BurnDrvgg_bonkersp03 = { - "gg_bonkersp03", "gg_bonkers", NULL, NULL, "1994", - "Disney's Bonkers Wax Up! (Prototype, 19941208-C)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp03RomInfo, gg_bonkersp03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Bonkers Wax Up! (Prototype, 19941211) - -static struct BurnRomInfo gg_bonkersp02RomDesc[] = { - { "bonkers wax up! (prototype - dec 11, 1994).bin", 0x80000, 0x9a405d0d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp02) -STD_ROM_FN(gg_bonkersp02) - -struct BurnDriver BurnDrvgg_bonkersp02 = { - "gg_bonkersp02", "gg_bonkers", NULL, NULL, "1994", - "Disney's Bonkers Wax Up! (Prototype, 19941211)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp02RomInfo, gg_bonkersp02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's Bonkers Wax Up! (Prototype, 19941212-D) - -static struct BurnRomInfo gg_bonkersp01RomDesc[] = { - { "bonkers wax up! (prototype - dec 12, 1994 - d).bin", 0x80000, 0x6d295894, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp01) -STD_ROM_FN(gg_bonkersp01) - -struct BurnDriver BurnDrvgg_bonkersp01 = { - "gg_bonkersp01", "gg_bonkers", NULL, NULL, "1994", - "Disney's Bonkers Wax Up! (Prototype, 19941212-D)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp01RomInfo, gg_bonkersp01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bonkers Wax Up! (Prototype, 19941115) - -static struct BurnRomInfo gg_bonkersp12RomDesc[] = { - { "bonkers wax up! (prototype - nov 15, 1994).bin", 0x80000, 0x85510a57, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp12) -STD_ROM_FN(gg_bonkersp12) - -struct BurnDriver BurnDrvgg_bonkersp12 = { - "gg_bonkersp12", "gg_bonkers", NULL, NULL, "1994", - "Bonkers Wax Up! (Prototype, 19941115)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp12RomInfo, gg_bonkersp12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bonkers Wax Up! (Prototype, 19941121) - -static struct BurnRomInfo gg_bonkersp11RomDesc[] = { - { "bonkers wax up! (prototype - nov 21, 1994).bin", 0x80000, 0xdab43f8f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp11) -STD_ROM_FN(gg_bonkersp11) - -struct BurnDriver BurnDrvgg_bonkersp11 = { - "gg_bonkersp11", "gg_bonkers", NULL, NULL, "1994", - "Bonkers Wax Up! (Prototype, 19941121)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp11RomInfo, gg_bonkersp11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bonkers Wax Up! (Prototype, 19941123) - -static struct BurnRomInfo gg_bonkersp10RomDesc[] = { - { "bonkers wax up! (prototype - nov 23, 1994).bin", 0x80000, 0x1b081950, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp10) -STD_ROM_FN(gg_bonkersp10) - -struct BurnDriver BurnDrvgg_bonkersp10 = { - "gg_bonkersp10", "gg_bonkers", NULL, NULL, "1994", - "Bonkers Wax Up! (Prototype, 19941123)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp10RomInfo, gg_bonkersp10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bonkers Wax Up! (Prototype, 19941126) - -static struct BurnRomInfo gg_bonkersp09RomDesc[] = { - { "bonkers wax up! (prototype - nov 26, 1994).bin", 0x80000, 0xeb3f22c2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp09) -STD_ROM_FN(gg_bonkersp09) - -struct BurnDriver BurnDrvgg_bonkersp09 = { - "gg_bonkersp09", "gg_bonkers", NULL, NULL, "1994", - "Bonkers Wax Up! (Prototype, 19941126)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp09RomInfo, gg_bonkersp09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bonkers Wax Up! (Prototype, 19941129) - -static struct BurnRomInfo gg_bonkersp08RomDesc[] = { - { "bonkers wax up! (prototype - nov 29, 1994).bin", 0x80000, 0xad6a62fa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp08) -STD_ROM_FN(gg_bonkersp08) - -struct BurnDriver BurnDrvgg_bonkersp08 = { - "gg_bonkersp08", "gg_bonkers", NULL, NULL, "1994", - "Bonkers Wax Up! (Prototype, 19941129)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp08RomInfo, gg_bonkersp08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bonkers Wax Up! (Prototype, 19941031) - -static struct BurnRomInfo gg_bonkersp13RomDesc[] = { - { "bonkers wax up! (prototype - oct 31, 1994).bin", 0x80000, 0x777dfd80, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bonkersp13) -STD_ROM_FN(gg_bonkersp13) - -struct BurnDriver BurnDrvgg_bonkersp13 = { - "gg_bonkersp13", "gg_bonkers", NULL, NULL, "1994", - "Bonkers Wax Up! (Prototype, 19941031)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bonkersp13RomInfo, gg_bonkersp13RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bram Stoker's Dracula (Euro) - -static struct BurnRomInfo gg_draculaRomDesc[] = { - { "bram stoker's dracula (usa).bin", 0x40000, 0x69ebe5fa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dracula) -STD_ROM_FN(gg_dracula) - -struct BurnDriver BurnDrvgg_dracula = { - "gg_dracula", NULL, NULL, NULL, "1994", - "Bram Stoker's Dracula (Euro)\0", NULL, "Sony Imagesoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_draculaRomInfo, gg_draculaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bram Stoker's Dracula (USA) - -static struct BurnRomInfo gg_draculauRomDesc[] = { - { "dracula (bram stoker's) (us).bin", 0x40000, 0xd966ec47, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_draculau) -STD_ROM_FN(gg_draculau) - -struct BurnDriver BurnDrvgg_draculau = { - "gg_draculau", "gg_dracula", NULL, NULL, "1992", - "Bram Stoker's Dracula (USA)\0", NULL, "Sony Imagesoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_draculauRomInfo, gg_draculauRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bubble Bobble (Euro, USA) - -static struct BurnRomInfo gg_bublboblRomDesc[] = { - { "bubble bobble (usa, europe).bin", 0x40000, 0xfba338c5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bublbobl) -STD_ROM_FN(gg_bublbobl) - -struct BurnDriver BurnDrvgg_bublbobl = { - "gg_bublbobl", NULL, NULL, NULL, "1994", - "Bubble Bobble (Euro, USA)\0", NULL, "Taito", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bublboblRomInfo, gg_bublboblRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bugs Bunny in Double Trouble (Euro, USA) - -static struct BurnRomInfo gg_bugsbunRomDesc[] = { - { "mpr-18846-s.ic1", 0x80000, 0x5c34d9cd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bugsbun) -STD_ROM_FN(gg_bugsbun) - -struct BurnDriver BurnDrvgg_bugsbun = { - "gg_bugsbun", NULL, NULL, NULL, "1996", - "Bugs Bunny in Double Trouble (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bugsbunRomInfo, gg_bugsbunRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Bust-A-Move (Euro, USA) - -static struct BurnRomInfo gg_bamRomDesc[] = { - { "bust-a-move (usa, europe).bin", 0x40000, 0xc90f29ef, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bam) -STD_ROM_FN(gg_bam) - -struct BurnDriver BurnDrvgg_bam = { - "gg_bam", NULL, NULL, NULL, "1995", - "Bust-A-Move (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bamRomInfo, gg_bamRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Buster Ball (Jpn) - -static struct BurnRomInfo gg_busterbRomDesc[] = { - { "buster ball (japan).bin", 0x20000, 0x7cb079d0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_busterb) -STD_ROM_FN(gg_busterb) - -struct BurnDriver BurnDrvgg_busterb = { - "gg_busterb", NULL, NULL, NULL, "1992", - "Buster Ball (Jpn)\0", NULL, "Riverhill Software", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_busterbRomInfo, gg_busterbRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Buster Fight (Jpn) - -static struct BurnRomInfo gg_busterfRomDesc[] = { - { "buster fight (japan).bin", 0x40000, 0xa72a1753, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_busterf) -STD_ROM_FN(gg_busterf) - -struct BurnDriver BurnDrvgg_busterf = { - "gg_busterf", NULL, NULL, NULL, "1994", - "Buster Fight (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_busterfRomInfo, gg_busterfRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Caesars Palace (USA) - -static struct BurnRomInfo gg_caesarsRomDesc[] = { - { "caesars palace (usa).bin", 0x40000, 0xc53b60b8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_caesars) -STD_ROM_FN(gg_caesars) - -struct BurnDriver BurnDrvgg_caesars = { - "gg_caesars", NULL, NULL, NULL, "1993", - "Caesars Palace (USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_caesarsRomInfo, gg_caesarsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Captain America and the Avengers (Euro, USA) - -static struct BurnRomInfo gg_captavenRomDesc[] = { - { "captain america and the avengers (usa, europe).bin", 0x40000, 0x5675dfdd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_captaven) -STD_ROM_FN(gg_captaven) - -struct BurnDriver BurnDrvgg_captaven = { - "gg_captaven", NULL, NULL, NULL, "1993", - "Captain America and the Avengers (Euro, USA)\0", NULL, "Mindscape", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_captavenRomInfo, gg_captavenRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Car Licence (Jpn) - -static struct BurnRomInfo gg_carlicenRomDesc[] = { - { "car licence (japan).bin", 0x80000, 0xf6a697f8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_carlicen) -STD_ROM_FN(gg_carlicen) - -struct BurnDriver BurnDrvgg_carlicen = { - "gg_carlicen", NULL, NULL, NULL, "199?", - "Car Licence (Jpn)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_carlicenRomInfo, gg_carlicenRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Casino Funpak (USA) - -static struct BurnRomInfo gg_casinofnRomDesc[] = { - { "casino funpak (usa).bin", 0x40000, 0x2b732056, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_casinofn) -STD_ROM_FN(gg_casinofn) - -struct BurnDriver BurnDrvgg_casinofn = { - "gg_casinofn", NULL, NULL, NULL, "1995", - "Casino Funpak (USA)\0", NULL, "Interplay", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_casinofnRomInfo, gg_casinofnRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Castle of Illusion Starring Mickey Mouse (Euro, USA, SMS Mode) - -static struct BurnRomInfo gg_castlillRomDesc[] = { - { "mpr-13704-f.ic1", 0x40000, 0x59840fd6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_castlill) -STD_ROM_FN(gg_castlill) - -struct BurnDriver BurnDrvgg_castlill = { - "gg_castlill", NULL, NULL, NULL, "1991", - "Castle of Illusion Starring Mickey Mouse (Euro, USA, SMS Mode)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_castlillRomInfo, gg_castlillRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chakan (Euro, USA) - -static struct BurnRomInfo gg_chakanRomDesc[] = { - { "chakan (usa, europe).bin", 0x40000, 0xdfc7adc8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chakan) -STD_ROM_FN(gg_chakan) - -struct BurnDriver BurnDrvgg_chakan = { - "gg_chakan", NULL, NULL, NULL, "1992", - "Chakan (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chakanRomInfo, gg_chakanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Championship Hockey (Euro) - -static struct BurnRomInfo gg_champhckRomDesc[] = { - { "championship hockey (euro).bin", 0x40000, 0xe21d2a88, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_champhck) -STD_ROM_FN(gg_champhck) - -struct BurnDriver BurnDrvgg_champhck = { - "gg_champhck", NULL, NULL, NULL, "1992", - "Championship Hockey (Euro)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_champhckRomInfo, gg_champhckRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Chessmaster (Euro, USA) - -static struct BurnRomInfo gg_chessmstRomDesc[] = { - { "chessmaster, the (usa, europe).bin", 0x20000, 0xda811ba6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chessmst) -STD_ROM_FN(gg_chessmst) - -struct BurnDriver BurnDrvgg_chessmst = { - "gg_chessmst", NULL, NULL, NULL, "1991", - "The Chessmaster (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chessmstRomInfo, gg_chessmstRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (USA, Bra) - -static struct BurnRomInfo gg_chicagoRomDesc[] = { - { "mpr-18190-s.ic1", 0x80000, 0x6b0fcec3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicago) -STD_ROM_FN(gg_chicago) - -struct BurnDriver BurnDrvgg_chicago = { - "gg_chicago", NULL, NULL, NULL, "1995", - "Chicago Syndicate (USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagoRomInfo, gg_chicagoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950703) - -static struct BurnRomInfo gg_chicagop09RomDesc[] = { - { "chicago syndicate (prototype - jul 03, 1995).bin", 0x80000, 0xe3c0ea98, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop09) -STD_ROM_FN(gg_chicagop09) - -struct BurnDriver BurnDrvgg_chicagop09 = { - "gg_chicagop09", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950703)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop09RomInfo, gg_chicagop09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950705) - -static struct BurnRomInfo gg_chicagop08RomDesc[] = { - { "chicago syndicate (prototype - jul 05, 1995).bin", 0x80000, 0x4158e203, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop08) -STD_ROM_FN(gg_chicagop08) - -struct BurnDriver BurnDrvgg_chicagop08 = { - "gg_chicagop08", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950705)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop08RomInfo, gg_chicagop08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950707) - -static struct BurnRomInfo gg_chicagop07RomDesc[] = { - { "chicago syndicate (prototype - jul 07, 1995).bin", 0x80000, 0xe44d1b01, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop07) -STD_ROM_FN(gg_chicagop07) - -struct BurnDriver BurnDrvgg_chicagop07 = { - "gg_chicagop07", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950707)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop07RomInfo, gg_chicagop07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950710) - -static struct BurnRomInfo gg_chicagop06RomDesc[] = { - { "chicago syndicate (prototype - jul 10, 1995).bin", 0x80000, 0x42becef6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop06) -STD_ROM_FN(gg_chicagop06) - -struct BurnDriver BurnDrvgg_chicagop06 = { - "gg_chicagop06", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950710)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop06RomInfo, gg_chicagop06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950711) - -static struct BurnRomInfo gg_chicagop05RomDesc[] = { - { "chicago syndicate (prototype - jul 11, 1995).bin", 0x80000, 0xafe46aa8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop05) -STD_ROM_FN(gg_chicagop05) - -struct BurnDriver BurnDrvgg_chicagop05 = { - "gg_chicagop05", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950711)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop05RomInfo, gg_chicagop05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950719) - -static struct BurnRomInfo gg_chicagop04RomDesc[] = { - { "chicago syndicate (prototype - jul 19, 1995).bin", 0x80000, 0xdd5f9327, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop04) -STD_ROM_FN(gg_chicagop04) - -struct BurnDriver BurnDrvgg_chicagop04 = { - "gg_chicagop04", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950719)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop04RomInfo, gg_chicagop04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950720) - -static struct BurnRomInfo gg_chicagop03RomDesc[] = { - { "chicago syndicate (prototype - jul 20, 1995).bin", 0x80000, 0xb0597a54, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop03) -STD_ROM_FN(gg_chicagop03) - -struct BurnDriver BurnDrvgg_chicagop03 = { - "gg_chicagop03", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950720)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop03RomInfo, gg_chicagop03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950721-B) - -static struct BurnRomInfo gg_chicagop02RomDesc[] = { - { "chicago syndicate (prototype - jul 21, 1995 - b).bin", 0x80000, 0x26ced733, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop02) -STD_ROM_FN(gg_chicagop02) - -struct BurnDriver BurnDrvgg_chicagop02 = { - "gg_chicagop02", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950721-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop02RomInfo, gg_chicagop02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950721) - -static struct BurnRomInfo gg_chicagop01RomDesc[] = { - { "chicago syndicate (prototype - jul 21, 1995).bin", 0x80000, 0x8e149bb8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop01) -STD_ROM_FN(gg_chicagop01) - -struct BurnDriver BurnDrvgg_chicagop01 = { - "gg_chicagop01", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950721)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop01RomInfo, gg_chicagop01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950601) - -static struct BurnRomInfo gg_chicagop23RomDesc[] = { - { "chicago syndicate (prototype - jun 01, 1995).bin", 0x80000, 0x448c6890, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop23) -STD_ROM_FN(gg_chicagop23) - -struct BurnDriver BurnDrvgg_chicagop23 = { - "gg_chicagop23", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950601)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop23RomInfo, gg_chicagop23RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950605) - -static struct BurnRomInfo gg_chicagop22RomDesc[] = { - { "chicago syndicate (prototype - jun 05, 1995).bin", 0x80000, 0xaf43b940, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop22) -STD_ROM_FN(gg_chicagop22) - -struct BurnDriver BurnDrvgg_chicagop22 = { - "gg_chicagop22", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950605)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop22RomInfo, gg_chicagop22RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950607) - -static struct BurnRomInfo gg_chicagop21RomDesc[] = { - { "chicago syndicate (prototype - jun 07, 1995).bin", 0x80000, 0x9b2fd7f3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop21) -STD_ROM_FN(gg_chicagop21) - -struct BurnDriver BurnDrvgg_chicagop21 = { - "gg_chicagop21", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950607)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop21RomInfo, gg_chicagop21RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950608) - -static struct BurnRomInfo gg_chicagop20RomDesc[] = { - { "chicago syndicate (prototype - jun 08, 1995).bin", 0x80000, 0x2036d4b7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop20) -STD_ROM_FN(gg_chicagop20) - -struct BurnDriver BurnDrvgg_chicagop20 = { - "gg_chicagop20", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950608)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop20RomInfo, gg_chicagop20RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950612) - -static struct BurnRomInfo gg_chicagop19RomDesc[] = { - { "chicago syndicate (prototype - jun 12, 1995).bin", 0x80000, 0xf2c24745, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop19) -STD_ROM_FN(gg_chicagop19) - -struct BurnDriver BurnDrvgg_chicagop19 = { - "gg_chicagop19", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950612)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop19RomInfo, gg_chicagop19RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950614) - -static struct BurnRomInfo gg_chicagop18RomDesc[] = { - { "chicago syndicate (prototype - jun 14, 1995).bin", 0x80000, 0x463a2197, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop18) -STD_ROM_FN(gg_chicagop18) - -struct BurnDriver BurnDrvgg_chicagop18 = { - "gg_chicagop18", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950614)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop18RomInfo, gg_chicagop18RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950619) - -static struct BurnRomInfo gg_chicagop17RomDesc[] = { - { "chicago syndicate (prototype - jun 19, 1995).bin", 0x80000, 0x3cdb35b1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop17) -STD_ROM_FN(gg_chicagop17) - -struct BurnDriver BurnDrvgg_chicagop17 = { - "gg_chicagop17", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950619)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop17RomInfo, gg_chicagop17RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950620) - -static struct BurnRomInfo gg_chicagop16RomDesc[] = { - { "chicago syndicate (prototype - jun 20, 1995).bin", 0x80000, 0xbf82cf83, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop16) -STD_ROM_FN(gg_chicagop16) - -struct BurnDriver BurnDrvgg_chicagop16 = { - "gg_chicagop16", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950620)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop16RomInfo, gg_chicagop16RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950622) - -static struct BurnRomInfo gg_chicagop15RomDesc[] = { - { "chicago syndicate (prototype - jun 22, 1995).bin", 0x80000, 0x4ac79cec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop15) -STD_ROM_FN(gg_chicagop15) - -struct BurnDriver BurnDrvgg_chicagop15 = { - "gg_chicagop15", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950622)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop15RomInfo, gg_chicagop15RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950626) - -static struct BurnRomInfo gg_chicagop14RomDesc[] = { - { "chicago syndicate (prototype - jun 26, 1995).bin", 0x80000, 0xabe696e5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop14) -STD_ROM_FN(gg_chicagop14) - -struct BurnDriver BurnDrvgg_chicagop14 = { - "gg_chicagop14", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950626)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop14RomInfo, gg_chicagop14RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950628) - -static struct BurnRomInfo gg_chicagop13RomDesc[] = { - { "chicago syndicate (prototype - jun 28, 1995).bin", 0x80000, 0x5cd07aed, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop13) -STD_ROM_FN(gg_chicagop13) - -struct BurnDriver BurnDrvgg_chicagop13 = { - "gg_chicagop13", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950628)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop13RomInfo, gg_chicagop13RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950629-B) - -static struct BurnRomInfo gg_chicagop12RomDesc[] = { - { "chicago syndicate (prototype - jun 29, 1995 - b).bin", 0x80000, 0xd3614e4e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop12) -STD_ROM_FN(gg_chicagop12) - -struct BurnDriver BurnDrvgg_chicagop12 = { - "gg_chicagop12", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950629-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop12RomInfo, gg_chicagop12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950629) - -static struct BurnRomInfo gg_chicagop11RomDesc[] = { - { "chicago syndicate (prototype - jun 29, 1995).bin", 0x80000, 0xe1112763, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop11) -STD_ROM_FN(gg_chicagop11) - -struct BurnDriver BurnDrvgg_chicagop11 = { - "gg_chicagop11", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950629)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop11RomInfo, gg_chicagop11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950630-B) - -static struct BurnRomInfo gg_chicagop10RomDesc[] = { - { "chicago syndicate (prototype - jun 30, 1995 - b).bin", 0x80000, 0xf68a3581, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop10) -STD_ROM_FN(gg_chicagop10) - -struct BurnDriver BurnDrvgg_chicagop10 = { - "gg_chicagop10", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950630-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop10RomInfo, gg_chicagop10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chicago Syndicate (Prototype, 19950505) - -static struct BurnRomInfo gg_chicagop24RomDesc[] = { - { "chicago syndicate (prototype - may 05, 1995).bin", 0x80000, 0xa5fa4eaf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chicagop24) -STD_ROM_FN(gg_chicagop24) - -struct BurnDriver BurnDrvgg_chicagop24 = { - "gg_chicagop24", "gg_chicago", NULL, NULL, "1995", - "Chicago Syndicate (Prototype, 19950505)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chicagop24RomInfo, gg_chicagop24RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Choplifter III (USA) - -static struct BurnRomInfo gg_choplft3RomDesc[] = { - { "choplifter iii (usa, europe).bin", 0x40000, 0xc2e8a692, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_choplft3) -STD_ROM_FN(gg_choplft3) - -struct BurnDriver BurnDrvgg_choplft3 = { - "gg_choplft3", NULL, NULL, NULL, "1993", - "Choplifter III (USA)\0", NULL, "Extreme Entertainment Group", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_choplft3RomInfo, gg_choplft3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chuck Rock (World) - -static struct BurnRomInfo gg_chuckrckRomDesc[] = { - { "mpr-15054 j20.ic1", 0x40000, 0x191b1ed8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chuckrck) -STD_ROM_FN(gg_chuckrck) - -struct BurnDriver BurnDrvgg_chuckrck = { - "gg_chuckrck", NULL, NULL, NULL, "1992", - "Chuck Rock (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chuckrckRomInfo, gg_chuckrckRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chuck Rock (World, Prototype) - -static struct BurnRomInfo gg_chuckrckpRomDesc[] = { - { "chuck rock (proto).bin", 0x40000, 0xcb3a1d23, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chuckrckp) -STD_ROM_FN(gg_chuckrckp) - -struct BurnDriver BurnDrvgg_chuckrckp = { - "gg_chuckrckp", "gg_chuckrck", NULL, NULL, "1992", - "Chuck Rock (World, Prototype)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chuckrckpRomInfo, gg_chuckrckpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chuck Rock II - Son of Chuck (Euro) - -static struct BurnRomInfo gg_chukrck2RomDesc[] = { - { "chuck rock ii - son of chuck (europe).bin", 0x40000, 0x656708bf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chukrck2) -STD_ROM_FN(gg_chukrck2) - -struct BurnDriver BurnDrvgg_chukrck2 = { - "gg_chukrck2", NULL, NULL, NULL, "1994", - "Chuck Rock II - Son of Chuck (Euro)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chukrck2RomInfo, gg_chukrck2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Chuck Rock II - Son of Chuck (USA) - -static struct BurnRomInfo gg_chukrck2uRomDesc[] = { - { "chuck rock ii - son of chuck (usa).bin", 0x40000, 0x3fcc28c9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chukrck2u) -STD_ROM_FN(gg_chukrck2u) - -struct BurnDriver BurnDrvgg_chukrck2u = { - "gg_chukrck2u", "gg_chukrck2", NULL, NULL, "1994", - "Chuck Rock II - Son of Chuck (USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_chukrck2uRomInfo, gg_chukrck2uRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// CJ Elephant Fugitive (Euro) - -static struct BurnRomInfo gg_cjRomDesc[] = { - { "cj elephant fugitive.bin", 0x40000, 0x72981057, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_cj) -STD_ROM_FN(gg_cj) - -struct BurnDriver BurnDrvgg_cj = { - "gg_cj", NULL, NULL, NULL, "1991", - "CJ Elephant Fugitive (Euro)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES, GBF_MISC, 0, - GGGetZipName, gg_cjRomInfo, gg_cjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cliffhanger (USA) - -static struct BurnRomInfo gg_cliffhRomDesc[] = { - { "cliffhanger (usa, europe).bin", 0x40000, 0xbf75b153, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_cliffh) -STD_ROM_FN(gg_cliffh) - -struct BurnDriver BurnDrvgg_cliffh = { - "gg_cliffh", NULL, NULL, NULL, "1993", - "Cliffhanger (USA)\0", NULL, "Sony Imagesoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_cliffhRomInfo, gg_cliffhRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Clutch Hitter (USA) - -static struct BurnRomInfo gg_clutchitRomDesc[] = { - { "clutch hitter (usa).bin", 0x20000, 0xd228a467, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_clutchit) -STD_ROM_FN(gg_clutchit) - -struct BurnDriver BurnDrvgg_clutchit = { - "gg_clutchit", NULL, NULL, NULL, "1991", - "Clutch Hitter (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_clutchitRomInfo, gg_clutchitRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Coca Cola Kid (Jpn) - -static struct BurnRomInfo gg_cocakidRomDesc[] = { - { "mpr-16686-s.ic1", 0x80000, 0xc7598b81, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_cocakid) -STD_ROM_FN(gg_cocakid) - -struct BurnDriver BurnDrvgg_cocakid = { - "gg_cocakid", NULL, NULL, NULL, "1994", - "Coca Cola Kid (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_cocakidRomInfo, gg_cocakidRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Columns (Jpn, Older) - -static struct BurnRomInfo gg_columnsj1RomDesc[] = { - { "columns (japan).bin", 0x08000, 0xf3ca6676, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_columnsj1) -STD_ROM_FN(gg_columnsj1) - -struct BurnDriver BurnDrvgg_columnsj1 = { - "gg_columnsj1", "gg_columns", NULL, NULL, "1990", - "Columns (Jpn, Older)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_columnsj1RomInfo, gg_columnsj1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Columns (Jpn) - -static struct BurnRomInfo gg_columnsjRomDesc[] = { - { "columns [v1] (jp).bin", 0x08000, 0xac37e092, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_columnsj) -STD_ROM_FN(gg_columnsj) - -struct BurnDriver BurnDrvgg_columnsj = { - "gg_columnsj", "gg_columns", NULL, NULL, "1990", - "Columns (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_columnsjRomInfo, gg_columnsjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Columns (Euro, USA, Bra) - -static struct BurnRomInfo gg_columnsRomDesc[] = { - { "mpr-13696.ic1", 0x08000, 0x83fa26d9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_columns) -STD_ROM_FN(gg_columns) - -struct BurnDriver BurnDrvgg_columns = { - "gg_columns", NULL, NULL, NULL, "1990", - "Columns (Euro, USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_columnsRomInfo, gg_columnsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cool Spot (Euro) - -static struct BurnRomInfo gg_coolspotRomDesc[] = { - { "cool spot.bin", 0x40000, 0xba0714db, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_coolspot) -STD_ROM_FN(gg_coolspot) - -struct BurnDriver BurnDrvgg_coolspot = { - "gg_coolspot", NULL, NULL, NULL, "1993", - "Cool Spot (Euro)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_coolspotRomInfo, gg_coolspotRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cool Spot (USA) - -static struct BurnRomInfo gg_coolspotuRomDesc[] = { - { "cool spot (usa).bin", 0x40000, 0x2c758fc8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_coolspotu) -STD_ROM_FN(gg_coolspotu) - -struct BurnDriver BurnDrvgg_coolspotu = { - "gg_coolspotu", "gg_coolspot", NULL, NULL, "1993", - "Cool Spot (USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_coolspotuRomInfo, gg_coolspotuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cosmic Spacehead (Euro) - -static struct BurnRomInfo gg_cosmicRomDesc[] = { - { "cosmic spacehead (europe).bin", 0x40000, 0x6caa625b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_cosmic) -STD_ROM_FN(gg_cosmic) - -struct BurnDriver BurnDrvgg_cosmic = { - "gg_cosmic", NULL, NULL, NULL, "1993", - "Cosmic Spacehead (Euro)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES, GBF_MISC, 0, - GGGetZipName, gg_cosmicRomInfo, gg_cosmicRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Crayon Shin-chan - Taiketsu! Kantamu Panic!! (Jpn) - -static struct BurnRomInfo gg_crayonRomDesc[] = { - { "mpr-17805.ic1", 0x80000, 0x03d28eab, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_crayon) -STD_ROM_FN(gg_crayon) - -struct BurnDriver BurnDrvgg_crayon = { - "gg_crayon", NULL, NULL, NULL, "1995", - "Crayon Shin-chan - Taiketsu! Kantamu Panic!! (Jpn)\0", NULL, "Bandai", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_crayonRomInfo, gg_crayonRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Crazy Faces (Euro, Prototype) - -static struct BurnRomInfo gg_crazyfacRomDesc[] = { - { "crazy faces [proto].bin", 0x20000, 0x46ad6257, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_crazyfac) -STD_ROM_FN(gg_crazyfac) - -struct BurnDriver BurnDrvgg_crazyfac = { - "gg_crazyfac", NULL, NULL, NULL, "1993", - "Crazy Faces (Euro, Prototype)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_crazyfacRomInfo, gg_crazyfacRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Crystal Warriors (Euro, USA) - -static struct BurnRomInfo gg_crystalwRomDesc[] = { - { "mpr-14633.ic1", 0x40000, 0x529c864e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_crystalw) -STD_ROM_FN(gg_crystalw) - -struct BurnDriver BurnDrvgg_crystalw = { - "gg_crystalw", NULL, NULL, NULL, "1992", - "Crystal Warriors (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_crystalwRomInfo, gg_crystalwRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cutthroat Island (Euro, USA) - -static struct BurnRomInfo gg_cutthrRomDesc[] = { - { "cutthroat island (usa, europe).bin", 0x80000, 0x6a24e47e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_cutthr) -STD_ROM_FN(gg_cutthr) - -struct BurnDriver BurnDrvgg_cutthr = { - "gg_cutthr", NULL, NULL, NULL, "1995", - "Cutthroat Island (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_cutthrRomInfo, gg_cutthrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cutthroat Island (Prototype 19950916) - -static struct BurnRomInfo gg_cutthrpRomDesc[] = { - { "cutthroat island [proto].bin", 0x80000, 0x6352ef00, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_cutthrp) -STD_ROM_FN(gg_cutthrp) - -struct BurnDriver BurnDrvgg_cutthrp = { - "gg_cutthrp", "gg_cutthr", NULL, NULL, "1995", - "Cutthroat Island (Prototype 19950916)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_cutthrpRomInfo, gg_cutthrpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Daffy Duck in Hollywood (Euro) - -static struct BurnRomInfo gg_daffyRomDesc[] = { - { "daffy duck in hollywood (europe) (en,fr,de,es,it).bin", 0x80000, 0xaae268fc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_daffy) -STD_ROM_FN(gg_daffy) - -struct BurnDriver BurnDrvgg_daffy = { - "gg_daffy", NULL, NULL, NULL, "1994", - "Daffy Duck in Hollywood (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_daffyRomInfo, gg_daffyRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Deep Duck Trouble Starring Donald Duck (Euro, USA) - -static struct BurnRomInfo gg_deepduckRomDesc[] = { - { "deep duck trouble starring donald duck (usa, europe).bin", 0x80000, 0x5a136d7e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_deepduck) -STD_ROM_FN(gg_deepduck) - -struct BurnDriver BurnDrvgg_deepduck = { - "gg_deepduck", NULL, NULL, NULL, "1994", - "Deep Duck Trouble Starring Donald Duck (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_deepduckRomInfo, gg_deepduckRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Defenders of Oasis (Euro, USA) - -static struct BurnRomInfo gg_defoasisRomDesc[] = { - { "defenders of oasis (usa, europe).bin", 0x80000, 0xe2791cc1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_defoasis) -STD_ROM_FN(gg_defoasis) - -struct BurnDriver BurnDrvgg_defoasis = { - "gg_defoasis", NULL, NULL, NULL, "1992", - "Defenders of Oasis (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_defoasisRomInfo, gg_defoasisRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Defenders of Oasis (Euro, USA, Prototype) - -static struct BurnRomInfo gg_defoasispRomDesc[] = { - { "defenders of oasis (proto).bin", 0x40000, 0xc674eccc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_defoasisp) -STD_ROM_FN(gg_defoasisp) - -struct BurnDriver BurnDrvgg_defoasisp = { - "gg_defoasisp", "gg_defoasis", NULL, NULL, "1992", - "Defenders of Oasis (Euro, USA, Prototype)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_defoasispRomInfo, gg_defoasispRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Desert Speedtrap Starring Road Runner and Wile E. Coyote (Euro) - -static struct BurnRomInfo gg_desertRomDesc[] = { - { "mpr-16032.ic1", 0x40000, 0xec808026, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_desert) -STD_ROM_FN(gg_desert) - -struct BurnDriver BurnDrvgg_desert = { - "gg_desert", NULL, NULL, NULL, "1994", - "Desert Speedtrap Starring Road Runner and Wile E. Coyote (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_desertRomInfo, gg_desertRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Desert Speedtrap Starring Road Runner and Wile E. Coyote (USA) - -static struct BurnRomInfo gg_desertuRomDesc[] = { - { "desert speedtrap (usa).bin", 0x40000, 0xc2e111ac, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_desertu) -STD_ROM_FN(gg_desertu) - -struct BurnDriver BurnDrvgg_desertu = { - "gg_desertu", "gg_desert", NULL, NULL, "1994", - "Desert Speedtrap Starring Road Runner and Wile E. Coyote (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_desertuRomInfo, gg_desertuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Desert Strike (Euro) - -static struct BurnRomInfo gg_dstrikeRomDesc[] = { - { "desert strike (eu).bin", 0x80000, 0x3e44eca3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dstrike) -STD_ROM_FN(gg_dstrike) - -struct BurnDriver BurnDrvgg_dstrike = { - "gg_dstrike", NULL, NULL, NULL, "1992", - "Desert Strike (Euro)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dstrikeRomInfo, gg_dstrikeRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Desert Strike - Return to the Gulf (USA) - -static struct BurnRomInfo gg_dstrikeuRomDesc[] = { - { "desert strike - return to the gulf (usa).bin", 0x80000, 0xf6c400da, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dstrikeu) -STD_ROM_FN(gg_dstrikeu) - -struct BurnDriver BurnDrvgg_dstrikeu = { - "gg_dstrikeu", "gg_dstrike", NULL, NULL, "1992", - "Desert Strike - Return to the Gulf (USA)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dstrikeuRomInfo, gg_dstrikeuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Devilish (Euro, Bra) - -static struct BurnRomInfo gg_devilishRomDesc[] = { - { "devilish (europe).bin", 0x20000, 0xd43ac6c5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_devilish) -STD_ROM_FN(gg_devilish) - -struct BurnDriver BurnDrvgg_devilish = { - "gg_devilish", NULL, NULL, NULL, "1992", - "Devilish (Euro, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_devilishRomInfo, gg_devilishRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Devilish (Jpn) - -static struct BurnRomInfo gg_devilishjRomDesc[] = { - { "devilish (japan).bin", 0x20000, 0x25db174f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_devilishj) -STD_ROM_FN(gg_devilishj) - -struct BurnDriver BurnDrvgg_devilishj = { - "gg_devilishj", "gg_devilish", NULL, NULL, "1991", - "Devilish (Jpn)\0", NULL, "Genki", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_devilishjRomInfo, gg_devilishjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Devilish (USA) - -static struct BurnRomInfo gg_devilishuRomDesc[] = { - { "devilish (usa).bin", 0x20000, 0xc01293b0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_devilishu) -STD_ROM_FN(gg_devilishu) - -struct BurnDriver BurnDrvgg_devilishu = { - "gg_devilishu", "gg_devilish", NULL, NULL, "1991", - "Devilish (USA)\0", NULL, "Sage's Creations", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_devilishuRomInfo, gg_devilishuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Donald Duck no 4-Tsu no Hihou (Jpn) - -static struct BurnRomInfo gg_donald42RomDesc[] = { - { "donald duck no 4-tsu no hihou (japan).bin", 0x80000, 0x4457e7c0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_donald42) -STD_ROM_FN(gg_donald42) - -struct BurnDriver BurnDrvgg_donald42 = { - "gg_donald42", "gg_deepduck", NULL, NULL, "1993", - "Donald Duck no 4-Tsu no Hihou (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_donald42RomInfo, gg_donald42RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Donald Duck no Lucky Dime (Jpn) - -static struct BurnRomInfo gg_donaldldRomDesc[] = { - { "donald duck no lucky dime (japan).bin", 0x40000, 0x2d98bd87, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_donaldld) -STD_ROM_FN(gg_donaldld) - -struct BurnDriver BurnDrvgg_donaldld = { - "gg_donaldld", "gg_luckydim", NULL, NULL, "1991", - "Donald Duck no Lucky Dime (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_donaldldRomInfo, gg_donaldldRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Donald no Magical World (Jpn) - -static struct BurnRomInfo gg_donaldmwRomDesc[] = { - { "donald no magical world (japan) (en,ja).bin", 0x80000, 0x87b8b612, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_donaldmw) -STD_ROM_FN(gg_donaldmw) - -struct BurnDriver BurnDrvgg_donaldmw = { - "gg_donaldmw", NULL, NULL, NULL, "1994", - "Donald no Magical World (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_donaldmwRomInfo, gg_donaldmwRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Doraemon - Waku Waku Pocket Paradise (Jpn) - -static struct BurnRomInfo gg_doraemonRomDesc[] = { - { "doraemon - waku waku pocket paradise (japan).bin", 0x80000, 0x733292a6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_doraemon) -STD_ROM_FN(gg_doraemon) - -struct BurnDriver BurnDrvgg_doraemon = { - "gg_doraemon", NULL, NULL, NULL, "1996", - "Doraemon - Waku Waku Pocket Paradise (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_doraemonRomInfo, gg_doraemonRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Double Dragon (Euro, USA, Prototype) - -static struct BurnRomInfo gg_ddragonpRomDesc[] = { - { "double dragon (usa, europe) (beta).bin", 0x40000, 0x331904c0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ddragonp) -STD_ROM_FN(gg_ddragonp) - -struct BurnDriver BurnDrvgg_ddragonp = { - "gg_ddragonp", "gg_ddragon", NULL, NULL, "1993", - "Double Dragon (Euro, USA, Prototype)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ddragonpRomInfo, gg_ddragonpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Double Dragon (Euro, USA) - -static struct BurnRomInfo gg_ddragonRomDesc[] = { - { "double dragon (usa, europe).bin", 0x40000, 0x1307a290, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ddragon) -STD_ROM_FN(gg_ddragon) - -struct BurnDriver BurnDrvgg_ddragon = { - "gg_ddragon", NULL, NULL, NULL, "1993", - "Double Dragon (Euro, USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ddragonRomInfo, gg_ddragonRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dr. Robotnik's Mean Bean Machine (Euro, USA) - -static struct BurnRomInfo gg_drrobotnRomDesc[] = { - { "mpr-16075-f.ic1", 0x40000, 0x3c2d4f48, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_drrobotn) -STD_ROM_FN(gg_drrobotn) - -struct BurnDriver BurnDrvgg_drrobotn = { - "gg_drrobotn", NULL, NULL, NULL, "1993", - "Dr. Robotnik's Mean Bean Machine (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_drrobotnRomInfo, gg_drrobotnRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dr. Franken (Prototype Demo) - -static struct BurnRomInfo gg_drfranknRomDesc[] = { - { "dr. franken (demo).bin", 0x20000, 0xc9907dce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_drfrankn) -STD_ROM_FN(gg_drfrankn) - -struct BurnDriver BurnDrvgg_drfrankn = { - "gg_drfrankn", NULL, NULL, NULL, "1993", - "Dr. Franken (Prototype Demo)\0", NULL, "Elite", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_drfranknRomInfo, gg_drfranknRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dragon - The Bruce Lee Story (Euro) - -static struct BurnRomInfo gg_dragonRomDesc[] = { - { "dragon - the bruce lee story (europe).bin", 0x40000, 0x19e1cf2b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dragon) -STD_ROM_FN(gg_dragon) - -struct BurnDriver BurnDrvgg_dragon = { - "gg_dragon", NULL, NULL, NULL, "1994", - "Dragon - The Bruce Lee Story (Euro)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dragonRomInfo, gg_dragonRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dragon - The Bruce Lee Story (USA) - -static struct BurnRomInfo gg_dragonuRomDesc[] = { - { "dragon - the bruce lee story (usa).bin", 0x40000, 0x17f588e8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dragonu) -STD_ROM_FN(gg_dragonu) - -struct BurnDriver BurnDrvgg_dragonu = { - "gg_dragonu", "gg_dragon", NULL, NULL, "1995", - "Dragon - The Bruce Lee Story (USA)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dragonuRomInfo, gg_dragonuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dragon Crystal (Euro, USA) - -static struct BurnRomInfo gg_dcrystalRomDesc[] = { - { "mpr-13800-s.ic1", 0x20000, 0x0ef2ed93, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dcrystal) -STD_ROM_FN(gg_dcrystal) - -struct BurnDriver BurnDrvgg_dcrystal = { - "gg_dcrystal", NULL, NULL, NULL, "1990", - "Dragon Crystal (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dcrystalRomInfo, gg_dcrystalRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dragon Crystal - Tsurani no Meikyuu (Jpn) - -static struct BurnRomInfo gg_dcrystaljRomDesc[] = { - { "dragon crystal - tsurani no meikyuu (japan).bin", 0x20000, 0x89f12e1e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dcrystalj) -STD_ROM_FN(gg_dcrystalj) - -struct BurnDriver BurnDrvgg_dcrystalj = { - "gg_dcrystalj", "gg_dcrystal", NULL, NULL, "1990", - "Dragon Crystal - Tsurani no Meikyuu (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dcrystaljRomInfo, gg_dcrystaljRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dropzone (Euro) - -static struct BurnRomInfo gg_dropzoneRomDesc[] = { - { "dropzone ggdz e7f1.u1", 0x20000, 0x152f0dcc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dropzone) -STD_ROM_FN(gg_dropzone) - -struct BurnDriver BurnDrvgg_dropzone = { - "gg_dropzone", NULL, NULL, NULL, "1994", - "Dropzone (Euro)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES, GBF_MISC, 0, - GGGetZipName, gg_dropzoneRomInfo, gg_dropzoneRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dunk Kids (Jpn) - -static struct BurnRomInfo gg_dunkkidsRomDesc[] = { - { "mpr-17023.ic1", 0x80000, 0x77ed48f5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dunkkids) -STD_ROM_FN(gg_dunkkids) - -struct BurnDriver BurnDrvgg_dunkkids = { - "gg_dunkkids", NULL, NULL, NULL, "1994", - "Dunk Kids (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dunkkidsRomInfo, gg_dunkkidsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dynamite Headdy (Jpn) - -static struct BurnRomInfo gg_dheadjRomDesc[] = { - { "dynamite headdy (japan).bin", 0x80000, 0xf6af4b6b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dheadj) -STD_ROM_FN(gg_dheadj) - -struct BurnDriver BurnDrvgg_dheadj = { - "gg_dheadj", "gg_dhead", NULL, NULL, "1994", - "Dynamite Headdy (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dheadjRomInfo, gg_dheadjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dynamite Headdy (Euro, USA) - -static struct BurnRomInfo gg_dheadRomDesc[] = { - { "dynamite headdy (usa, europe).bin", 0x80000, 0x610ff95c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dhead) -STD_ROM_FN(gg_dhead) - -struct BurnDriver BurnDrvgg_dhead = { - "gg_dhead", NULL, NULL, NULL, "1994", - "Dynamite Headdy (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dheadRomInfo, gg_dheadRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dynamite Headdy (Prototype, 19940701) - -static struct BurnRomInfo gg_dheadp2RomDesc[] = { - { "dynamite headdy (prototype - jul 01, 1994).bin", 0x80000, 0x49389319, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dheadp2) -STD_ROM_FN(gg_dheadp2) - -struct BurnDriver BurnDrvgg_dheadp2 = { - "gg_dheadp2", "gg_dhead", NULL, NULL, "1994", - "Dynamite Headdy (Prototype, 19940701)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dheadp2RomInfo, gg_dheadp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dynamite Headdy (Prototype, 19940705) - -static struct BurnRomInfo gg_dheadp1RomDesc[] = { - { "dynamite headdy (prototype - jul 05, 1994).bin", 0x80000, 0xc7bea89a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dheadp1) -STD_ROM_FN(gg_dheadp1) - -struct BurnDriver BurnDrvgg_dheadp1 = { - "gg_dheadp1", "gg_dhead", NULL, NULL, "1994", - "Dynamite Headdy (Prototype, 19940705)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dheadp1RomInfo, gg_dheadp1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Dynamite Headdy (Prototype, 19940615) - -static struct BurnRomInfo gg_dheadp3RomDesc[] = { - { "dynamite headdy (prototype - jun 15, 1994).bin", 0x80000, 0x7bf339c0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_dheadp3) -STD_ROM_FN(gg_dheadp3) - -struct BurnDriver BurnDrvgg_dheadp3 = { - "gg_dheadp3", "gg_dhead", NULL, NULL, "1994", - "Dynamite Headdy (Prototype, 19940615)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_dheadp3RomInfo, gg_dheadp3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Earthworm Jim (Euro) - -static struct BurnRomInfo gg_ejimRomDesc[] = { - { "earthworm jim.bin", 0x80000, 0x691ae339, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ejim) -STD_ROM_FN(gg_ejim) - -struct BurnDriver BurnDrvgg_ejim = { - "gg_ejim", NULL, NULL, NULL, "1995", - "Earthworm Jim (Euro)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ejimRomInfo, gg_ejimRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Earthworm Jim (USA) - -static struct BurnRomInfo gg_ejimuRomDesc[] = { - { "earthworm jim (usa).bin", 0x80000, 0x5d3f23a9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ejimu) -STD_ROM_FN(gg_ejimu) - -struct BurnDriver BurnDrvgg_ejimu = { - "gg_ejimu", "gg_ejim", NULL, NULL, "1995", - "Earthworm Jim (USA)\0", NULL, "Playmates Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ejimuRomInfo, gg_ejimuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ecco the Dolphin (Jpn) - -static struct BurnRomInfo gg_eccojRomDesc[] = { - { "mpr-16428-f.ic1", 0x80000, 0xa32eb9d5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_eccoj) -STD_ROM_FN(gg_eccoj) - -struct BurnDriver BurnDrvgg_eccoj = { - "gg_eccoj", "gg_ecco", NULL, NULL, "1994", - "Ecco the Dolphin (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_eccojRomInfo, gg_eccojRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ecco the Dolphin (Euro, USA) - -static struct BurnRomInfo gg_eccoRomDesc[] = { - { "ecco the dolphin (usa, europe).bin", 0x80000, 0x866c7113, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ecco) -STD_ROM_FN(gg_ecco) - -struct BurnDriver BurnDrvgg_ecco = { - "gg_ecco", NULL, NULL, NULL, "1994", - "Ecco the Dolphin (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_eccoRomInfo, gg_eccoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ecco the Dolphin II (Jpn) - -static struct BurnRomInfo gg_ecco2jRomDesc[] = { - { "ecco the dolphin ii (japan).bin", 0x80000, 0xba9cef4f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ecco2j) -STD_ROM_FN(gg_ecco2j) - -struct BurnDriver BurnDrvgg_ecco2j = { - "gg_ecco2j", "gg_ecco2", NULL, NULL, "1995", - "Ecco the Dolphin II (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ecco2jRomInfo, gg_ecco2jRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ecco II - The Tides of Time (Euro, USA) - -static struct BurnRomInfo gg_ecco2RomDesc[] = { - { "ecco ii - the tides of time (usa, europe).bin", 0x80000, 0xe2f3b203, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ecco2) -STD_ROM_FN(gg_ecco2) - -struct BurnDriver BurnDrvgg_ecco2 = { - "gg_ecco2", NULL, NULL, NULL, "1994", - "Ecco II - The Tides of Time (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ecco2RomInfo, gg_ecco2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ernie Els Golf (Euro) - -static struct BurnRomInfo gg_ernieegRomDesc[] = { - { "ernie els golf (europe) (en,fr,de,es,it).bin", 0x40000, 0x5e53c7f7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ernieeg) -STD_ROM_FN(gg_ernieeg) - -struct BurnDriver BurnDrvgg_ernieeg = { - "gg_ernieeg", NULL, NULL, NULL, "1994", - "Ernie Els Golf (Euro)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES, GBF_MISC, 0, - GGGetZipName, gg_ernieegRomInfo, gg_ernieegRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Eternal Legend - Eien no Densetsu (Jpn) - -static struct BurnRomInfo gg_eternlegRomDesc[] = { - { "eternal legend - eien no densetsu (japan).bin", 0x40000, 0x04302bbd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_eternleg) -STD_ROM_FN(gg_eternleg) - -struct BurnDriver BurnDrvgg_eternleg = { - "gg_eternleg", NULL, NULL, NULL, "1991", - "Eternal Legend - Eien no Densetsu (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_eternlegRomInfo, gg_eternlegRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Evander Holyfield Boxing (Euro, USA) - -static struct BurnRomInfo gg_evanderRomDesc[] = { - { "mpr-15391.ic1", 0x40000, 0x36aaf536, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_evander) -STD_ROM_FN(gg_evander) - -struct BurnDriver BurnDrvgg_evander = { - "gg_evander", NULL, NULL, NULL, "1992", - "Evander Holyfield Boxing (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_evanderRomInfo, gg_evanderRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Excellent Dizzy Collection (Euro, SMS Mode) - -static struct BurnRomInfo gg_excdizzyRomDesc[] = { - { "excellent dizzy collection, the (europe).bin", 0x80000, 0xaa140c9c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_excdizzy) -STD_ROM_FN(gg_excdizzy) - -struct BurnDriver BurnDrvgg_excdizzy = { - "gg_excdizzy", NULL, NULL, NULL, "1995", - "The Excellent Dizzy Collection (Euro, SMS Mode)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - GGGetZipName, gg_excdizzyRomInfo, gg_excdizzyRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// The Excellent Dizzy Collection (Prototype, SMS Mode) - -static struct BurnRomInfo gg_excdizzypRomDesc[] = { - { "excellent dizzy collection, the (prototype) [s][!].bin", 0x40000, 0x8813514b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_excdizzyp) -STD_ROM_FN(gg_excdizzyp) - -struct BurnDriver BurnDrvgg_excdizzyp = { - "gg_excdizzyp", "gg_excdizzy", NULL, NULL, "1995", - "The Excellent Dizzy Collection (Prototype, SMS Mode)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - GGGetZipName, gg_excdizzypRomInfo, gg_excdizzypRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 224, 4, 3 -}; - - -// F-15 Strike Eagle (Euro, USA) - -static struct BurnRomInfo gg_f15seRomDesc[] = { - { "f-15 strike eagle (usa, europe).bin", 0x40000, 0x8bdb0806, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_f15se) -STD_ROM_FN(gg_f15se) - -struct BurnDriver BurnDrvgg_f15se = { - "gg_f15se", NULL, NULL, NULL, "1993", - "F-15 Strike Eagle (Euro, USA)\0", NULL, "Microprose", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_f15seRomInfo, gg_f15seRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// F1 (Euro, USA) - -static struct BurnRomInfo gg_f1RomDesc[] = { - { "f1 (usa, europe).bin", 0x40000, 0xd0a93e00, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_f1) -STD_ROM_FN(gg_f1) - -struct BurnDriver BurnDrvgg_f1 = { - "gg_f1", NULL, NULL, NULL, "1993", - "F1 (Euro, USA)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_f1RomInfo, gg_f1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// F1 World Championship Edition (Euro) - -static struct BurnRomInfo gg_f1wceRomDesc[] = { - { "f1 - world championship edition (euro).bin", 0x40000, 0x107092d0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_f1wce) -STD_ROM_FN(gg_f1wce) - -struct BurnDriver BurnDrvgg_f1wce = { - "gg_f1wce", NULL, NULL, NULL, "1995", - "F1 World Championship Edition (Euro)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_f1wceRomInfo, gg_f1wceRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Faceball 2000 (Jpn) - -static struct BurnRomInfo gg_faceballRomDesc[] = { - { "faceball 2000 (japan).bin", 0x40000, 0xaaf6f87d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_faceball) -STD_ROM_FN(gg_faceball) - -struct BurnDriver BurnDrvgg_faceball = { - "gg_faceball", NULL, NULL, NULL, "1993", - "Faceball 2000 (Jpn)\0", NULL, "Riverhill Software", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_faceballRomInfo, gg_faceballRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Factory Panic (Euro, Bra) - -static struct BurnRomInfo gg_factorypRomDesc[] = { - { "mpr-14238.ic1", 0x20000, 0x59e3be92, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_factoryp) -STD_ROM_FN(gg_factoryp) - -struct BurnDriver BurnDrvgg_factoryp = { - "gg_factoryp", NULL, NULL, NULL, "1991", - "Factory Panic (Euro, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_factorypRomInfo, gg_factorypRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantastic Dizzy (Euro, SMS Mode) - -static struct BurnRomInfo gg_fantdizzRomDesc[] = { - { "fantastic dizzy (europe) (en,fr,de,es,it).bin", 0x40000, 0xc888222b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fantdizz) -STD_ROM_FN(gg_fantdizz) - -struct BurnDriver BurnDrvgg_fantdizz = { - "gg_fantdizz", NULL, NULL, NULL, "1993", - "Fantastic Dizzy (Euro, SMS Mode)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE | HARDWARE_SMS_MAPPER_CODIES, GBF_MISC, 0, - GGGetZipName, gg_fantdizzRomInfo, gg_fantdizzRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantasy Zone Gear (Euro, Jpn) - -static struct BurnRomInfo gg_fantzoneRomDesc[] = { - { "fantasy zone gear (japan, europe).bin", 0x20000, 0xd69097e8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fantzone) -STD_ROM_FN(gg_fantzone) - -struct BurnDriver BurnDrvgg_fantzone = { - "gg_fantzone", NULL, NULL, NULL, "1991", - "Fantasy Zone Gear (Euro, Jpn)\0", NULL, "Sanritsu", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_fantzoneRomInfo, gg_fantzoneRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fantasy Zone Gear (USA) - -static struct BurnRomInfo gg_fantzoneuRomDesc[] = { - { "fantasy zone (us).bin", 0x20000, 0xfad007df, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fantzoneu) -STD_ROM_FN(gg_fantzoneu) - -struct BurnDriver BurnDrvgg_fantzoneu = { - "gg_fantzoneu", "gg_fantzone", NULL, NULL, "1991", - "Fantasy Zone Gear (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_fantzoneuRomInfo, gg_fantzoneuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fatal Fury Special (Euro) - -static struct BurnRomInfo gg_fatfurspRomDesc[] = { - { "fatal fury special.bin", 0x80000, 0xfbd76387, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fatfursp) -STD_ROM_FN(gg_fatfursp) - -struct BurnDriver BurnDrvgg_fatfursp = { - "gg_fatfursp", NULL, NULL, NULL, "1994", - "Fatal Fury Special (Euro)\0", NULL, "Takara", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_fatfurspRomInfo, gg_fatfurspRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fatal Fury Special (USA) - -static struct BurnRomInfo gg_fatfurspuRomDesc[] = { - { "fatal fury special (usa).bin", 0x80000, 0x449787e2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fatfurspu) -STD_ROM_FN(gg_fatfurspu) - -struct BurnDriver BurnDrvgg_fatfurspu = { - "gg_fatfurspu", "gg_fatfursp", NULL, NULL, "1994", - "Fatal Fury Special (USA)\0", NULL, "Takara", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_fatfurspuRomInfo, gg_fatfurspuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// FIFA International Soccer (Jpn) - -static struct BurnRomInfo gg_fifajRomDesc[] = { - { "fifa international soccer (japan).bin", 0x80000, 0x78159325, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fifaj) -STD_ROM_FN(gg_fifaj) - -struct BurnDriver BurnDrvgg_fifaj = { - "gg_fifaj", "gg_fifa", NULL, NULL, "1995", - "FIFA International Soccer (Jpn)\0", NULL, "Electronic Arts Victor", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_fifajRomInfo, gg_fifajRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// FIFA International Soccer (Euro, USA) - -static struct BurnRomInfo gg_fifaRomDesc[] = { - { "fifa international soccer (usa, europe).bin", 0x80000, 0xe632a3a2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fifa) -STD_ROM_FN(gg_fifa) - -struct BurnDriver BurnDrvgg_fifa = { - "gg_fifa", NULL, NULL, NULL, "1994", - "FIFA International Soccer (Euro, USA)\0", NULL, "Electronic Arts", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_fifaRomInfo, gg_fifaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// FIFA Soccer 96 (Euro, USA) - -static struct BurnRomInfo gg_fifa96RomDesc[] = { - { "fifa soccer 96 (usa, europe) (en,fr,de,es).bin", 0x80000, 0xc379de95, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fifa96) -STD_ROM_FN(gg_fifa96) - -struct BurnDriver BurnDrvgg_fifa96 = { - "gg_fifa96", NULL, NULL, NULL, "1995", - "FIFA Soccer 96 (Euro, USA)\0", NULL, "Black Pearl", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_fifa96RomInfo, gg_fifa96RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Foreman for Real (World) - -static struct BurnRomInfo gg_foremanRomDesc[] = { - { "mpr-18216.ic1", 0x80000, 0xd46d5685, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_foreman) -STD_ROM_FN(gg_foreman) - -struct BurnDriver BurnDrvgg_foreman = { - "gg_foreman", NULL, NULL, NULL, "1995", - "Foreman for Real (World)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_foremanRomInfo, gg_foremanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Frank Thomas Big Hurt Baseball (USA) - -static struct BurnRomInfo gg_bighurtRomDesc[] = { - { "frank thomas big hurt baseball (usa).bin", 0x80000, 0xc443c35c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bighurt) -STD_ROM_FN(gg_bighurt) - -struct BurnDriver BurnDrvgg_bighurt = { - "gg_bighurt", NULL, NULL, NULL, "1995", - "Frank Thomas Big Hurt Baseball (USA)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bighurtRomInfo, gg_bighurtRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fray - Shugyou Hen (Jpn) - -static struct BurnRomInfo gg_frayRomDesc[] = { - { "fray - shugyou hen (japan).bin", 0x40000, 0xe123d9b8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fray) -STD_ROM_FN(gg_fray) - -struct BurnDriver BurnDrvgg_fray = { - "gg_fray", NULL, NULL, NULL, "1991", - "Fray - Shugyou Hen (Jpn)\0", NULL, "Micro Cabin", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_frayRomInfo, gg_frayRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fred Couples' Golf (Jpn) - -static struct BurnRomInfo gg_fredcoupjRomDesc[] = { - { "fred couples' golf (japan).bin", 0x80000, 0xb1196cd7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fredcoupj) -STD_ROM_FN(gg_fredcoupj) - -struct BurnDriver BurnDrvgg_fredcoupj = { - "gg_fredcoupj", "gg_fredcoup", NULL, NULL, "1994", - "Fred Couples' Golf (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_fredcoupjRomInfo, gg_fredcoupjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Fred Couples' Golf (USA) - -static struct BurnRomInfo gg_fredcoupRomDesc[] = { - { "fred couples' golf (usa).bin", 0x80000, 0x46f40b9f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_fredcoup) -STD_ROM_FN(gg_fredcoup) - -struct BurnDriver BurnDrvgg_fredcoup = { - "gg_fredcoup", NULL, NULL, NULL, "1994", - "Fred Couples' Golf (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_fredcoupRomInfo, gg_fredcoupRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Frogger (USA, Prototype) - -static struct BurnRomInfo gg_froggerRomDesc[] = { - { "frogger (usa) (proto).bin", 0x20000, 0x02bbf994, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_frogger) -STD_ROM_FN(gg_frogger) - -struct BurnDriver BurnDrvgg_frogger = { - "gg_frogger", NULL, NULL, NULL, "199?", - "Frogger (USA, Prototype)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_froggerRomInfo, gg_froggerRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// From TV Animation - Slam Dunk - Shouri e no Starting 5 (Jpn) - -static struct BurnRomInfo gg_slamdunkRomDesc[] = { - { "from tv animation - slam dunk - shouri e no starting 5 (japan).bin", 0x80000, 0x751dad4c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_slamdunk) -STD_ROM_FN(gg_slamdunk) - -struct BurnDriver BurnDrvgg_slamdunk = { - "gg_slamdunk", NULL, NULL, NULL, "1994", - "From TV Animation - Slam Dunk - Shouri e no Starting 5 (Jpn)\0", NULL, "Bandai", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_slamdunkRomInfo, gg_slamdunkRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// G-LOC Air Battle (Jpn, v1) - -static struct BurnRomInfo gg_glocjRomDesc[] = { - { "g-loc air battle (japanv1.1).bin", 0x20000, 0x33237f50, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_glocj) -STD_ROM_FN(gg_glocj) - -struct BurnDriver BurnDrvgg_glocj = { - "gg_glocj", "gg_gloc", NULL, NULL, "1990", - "G-LOC Air Battle (Jpn, v1)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_glocjRomInfo, gg_glocjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// G-LOC Air Battle (Jpn, v0) - -static struct BurnRomInfo gg_glocj1RomDesc[] = { - { "g-loc air battle (japan).bin", 0x20000, 0x2333f615, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_glocj1) -STD_ROM_FN(gg_glocj1) - -struct BurnDriver BurnDrvgg_glocj1 = { - "gg_glocj1", "gg_gloc", NULL, NULL, "1990", - "G-LOC Air Battle (Jpn, v0)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_glocj1RomInfo, gg_glocj1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// G-LOC Air Battle (Euro, USA, Bra) - -static struct BurnRomInfo gg_glocRomDesc[] = { - { "g-loc air battle (usa, europe).bin", 0x20000, 0x18de59ed, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gloc) -STD_ROM_FN(gg_gloc) - -struct BurnDriver BurnDrvgg_gloc = { - "gg_gloc", NULL, NULL, NULL, "1991", - "G-LOC Air Battle (Euro, USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_glocRomInfo, gg_glocRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Galaga '91 (Jpn) - -static struct BurnRomInfo gg_galaga91RomDesc[] = { - { "galaga '91 (japan).bin", 0x20000, 0x0593ba24, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_galaga91) -STD_ROM_FN(gg_galaga91) - -struct BurnDriver BurnDrvgg_galaga91 = { - "gg_galaga91", "gg_galaga2", NULL, NULL, "1991", - "Galaga '91 (Jpn)\0", NULL, "Namcot", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_galaga91RomInfo, gg_galaga91RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Galaga 2 (Euro) - -static struct BurnRomInfo gg_galaga2RomDesc[] = { - { "galaga 2 (europe).bin", 0x20000, 0x95ecece2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_galaga2) -STD_ROM_FN(gg_galaga2) - -struct BurnDriver BurnDrvgg_galaga2 = { - "gg_galaga2", NULL, NULL, NULL, "1993", - "Galaga 2 (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_galaga2RomInfo, gg_galaga2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gamble Panic (Jpn) - -static struct BurnRomInfo gg_gambleRomDesc[] = { - { "gamble panic (japan).bin", 0x80000, 0x09534742, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gamble) -STD_ROM_FN(gg_gamble) - -struct BurnDriver BurnDrvgg_gamble = { - "gg_gamble", NULL, NULL, NULL, "1995", - "Gamble Panic (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_gambleRomInfo, gg_gambleRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gambler Jikochuushinha (Jpn) - -static struct BurnRomInfo gg_gamblerRomDesc[] = { - { "gambler jikochuushinha (japan).bin", 0x40000, 0x423803a7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gambler) -STD_ROM_FN(gg_gambler) - -struct BurnDriver BurnDrvgg_gambler = { - "gg_gambler", NULL, NULL, NULL, "1992", - "Gambler Jikochuushinha (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_gamblerRomInfo, gg_gamblerRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ganbare Gorby! (Jpn) - -static struct BurnRomInfo gg_ggorbyRomDesc[] = { - { "ganbare gorby! (japan).bin", 0x20000, 0xa1f2f4a1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ggorby) -STD_ROM_FN(gg_ggorby) - -struct BurnDriver BurnDrvgg_ggorby = { - "gg_ggorby", "gg_factoryp", NULL, NULL, "1991", - "Ganbare Gorby! (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ggorbyRomInfo, gg_ggorbyRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Garfield - Caught in the Act (Euro, USA) - -static struct BurnRomInfo gg_garfieldRomDesc[] = { - { "mpr-18201-s.ic2", 0x100000, 0xcd53f3af, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_garfield) -STD_ROM_FN(gg_garfield) - -struct BurnDriver BurnDrvgg_garfield = { - "gg_garfield", NULL, NULL, NULL, "1995", - "Garfield - Caught in the Act (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_garfieldRomInfo, gg_garfieldRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Garou Densetsu Special (Jpn) - -static struct BurnRomInfo gg_garouspRomDesc[] = { - { "mpr-17432.ic1", 0x80000, 0x9afb6f33, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_garousp) -STD_ROM_FN(gg_garousp) - -struct BurnDriver BurnDrvgg_garousp = { - "gg_garousp", "gg_fatfursp", NULL, NULL, "1994", - "Garou Densetsu Special (Jpn)\0", NULL, "Takara", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_garouspRomInfo, gg_garouspRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gear Stadium (Jpn) - -static struct BurnRomInfo gg_gearstadRomDesc[] = { - { "gear stadium (japan).bin", 0x20000, 0x0e300223, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gearstad) -STD_ROM_FN(gg_gearstad) - -struct BurnDriver BurnDrvgg_gearstad = { - "gg_gearstad", "gg_batterup", NULL, NULL, "1991", - "Gear Stadium (Jpn)\0", NULL, "Namcot", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_gearstadRomInfo, gg_gearstadRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gear Stadium Heiseiban (Jpn) - -static struct BurnRomInfo gg_gearstahRomDesc[] = { - { "gear stadium heiseiban (japan).bin", 0x20000, 0xa0530664, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gearstah) -STD_ROM_FN(gg_gearstah) - -struct BurnDriver BurnDrvgg_gearstah = { - "gg_gearstah", NULL, NULL, NULL, "1995", - "Gear Stadium Heiseiban (Jpn)\0", NULL, "Namcot", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_gearstahRomInfo, gg_gearstahRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gear Works (USA) - -static struct BurnRomInfo gg_gearworkRomDesc[] = { - { "gear works (usa).bin", 0x20000, 0xe9a2efb4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gearwork) -STD_ROM_FN(gg_gearwork) - -struct BurnDriver BurnDrvgg_gearwork = { - "gg_gearwork", NULL, NULL, NULL, "1994", - "Gear Works (USA)\0", NULL, "Sony Imagesoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_gearworkRomInfo, gg_gearworkRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// George Foreman's KO Boxing (Euro, USA) - -static struct BurnRomInfo gg_georgekoRomDesc[] = { - { "george foreman's ko boxing (usa, europe).bin", 0x20000, 0x58b44585, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_georgeko) -STD_ROM_FN(gg_georgeko) - -struct BurnDriver BurnDrvgg_georgeko = { - "gg_georgeko", NULL, NULL, NULL, "1992", - "George Foreman's KO Boxing (Euro, USA)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_georgekoRomInfo, gg_georgekoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// GG Aleste (Jpn) - -static struct BurnRomInfo gg_ggalesteRomDesc[] = { - { "gg aleste (japan).bin", 0x40000, 0x1b80a75b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ggaleste) -STD_ROM_FN(gg_ggaleste) - -struct BurnDriver BurnDrvgg_ggaleste = { - "gg_ggaleste", NULL, NULL, NULL, "1991", - "GG Aleste (Jpn)\0", NULL, "Compile", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ggalesteRomInfo, gg_ggalesteRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// GG Doraemon - Noranosuke no Yabou (Jpn) - -static struct BurnRomInfo gg_ggdoraRomDesc[] = { - { "gg doraemon - noranosuke no yabou (japan).bin", 0x40000, 0x9a8b2c16, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ggdora) -STD_ROM_FN(gg_ggdora) - -struct BurnDriver BurnDrvgg_ggdora = { - "gg_ggdora", NULL, NULL, NULL, "1993", - "GG Doraemon - Noranosuke no Yabou (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ggdoraRomInfo, gg_ggdoraRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// GG Portrait - Pai Chen (Jpn) - -static struct BurnRomInfo gg_ggportRomDesc[] = { - { "gg portrait - pai chen (japan).bin", 0x80000, 0x695cc120, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ggport) -STD_ROM_FN(gg_ggport) - -struct BurnDriver BurnDrvgg_ggport = { - "gg_ggport", NULL, NULL, NULL, "1996", - "GG Portrait - Pai Chen (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ggportRomInfo, gg_ggportRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// GG Portrait - Yuuki Akira (Jpn) - -static struct BurnRomInfo gg_ggport1RomDesc[] = { - { "gg portrait - yuuki akira (japan).bin", 0x80000, 0x51159f8f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ggport1) -STD_ROM_FN(gg_ggport1) - -struct BurnDriver BurnDrvgg_ggport1 = { - "gg_ggport1", NULL, NULL, NULL, "1996", - "GG Portrait - Yuuki Akira (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ggport1RomInfo, gg_ggport1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The GG Shinobi (Jpn) - -static struct BurnRomInfo gg_shinobijRomDesc[] = { - { "gg shinobi, the (japan).bin", 0x40000, 0x83926bd1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinobij) -STD_ROM_FN(gg_shinobij) - -struct BurnDriver BurnDrvgg_shinobij = { - "gg_shinobij", "gg_shinobi", NULL, NULL, "1991", - "The GG Shinobi (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinobijRomInfo, gg_shinobijRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The GG Shinobi (Euro, USA) - -static struct BurnRomInfo gg_shinobiRomDesc[] = { - { "shinobi (usa, europe).bin", 0x40000, 0x30f1c984, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinobi) -STD_ROM_FN(gg_shinobi) - -struct BurnDriver BurnDrvgg_shinobi = { - "gg_shinobi", NULL, NULL, NULL, "1991", - "The GG Shinobi (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinobiRomInfo, gg_shinobiRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Godzilla - Kaijuu Daishingeki (Jpn) - -static struct BurnRomInfo gg_godzillaRomDesc[] = { - { "godzilla - kaijuu daishingeki (japan).bin", 0x80000, 0x4cf97801, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_godzilla) -STD_ROM_FN(gg_godzilla) - -struct BurnDriver BurnDrvgg_godzilla = { - "gg_godzilla", NULL, NULL, NULL, "1995", - "Godzilla - Kaijuu Daishingeki (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_godzillaRomInfo, gg_godzillaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// GP Rider (Jpn) - -static struct BurnRomInfo gg_gpriderjRomDesc[] = { - { "mpr-16589.ic1", 0x80000, 0x7a26ec6a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gpriderj) -STD_ROM_FN(gg_gpriderj) - -struct BurnDriver BurnDrvgg_gpriderj = { - "gg_gpriderj", "gg_gprider", NULL, NULL, "1994", - "GP Rider (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_gpriderjRomInfo, gg_gpriderjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// GP Rider (Prototype, 19940104) - -static struct BurnRomInfo gg_gpriderpRomDesc[] = { - { "gp rider (prototype - jan 04, 1994).bin", 0x80000, 0x12e4f6db, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gpriderp) -STD_ROM_FN(gg_gpriderp) - -struct BurnDriver BurnDrvgg_gpriderp = { - "gg_gpriderp", "gg_gprider", NULL, NULL, "1994", - "GP Rider (Prototype, 19940104)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_gpriderpRomInfo, gg_gpriderpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// GP Rider (Euro, USA) - -static struct BurnRomInfo gg_gpriderRomDesc[] = { - { "mpr-16367-s.ic1", 0x80000, 0x876e9b72, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gprider) -STD_ROM_FN(gg_gprider) - -struct BurnDriver BurnDrvgg_gprider = { - "gg_gprider", NULL, NULL, NULL, "1994", - "GP Rider (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_gpriderRomInfo, gg_gpriderRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Greendog (Euro, USA) - -static struct BurnRomInfo gg_greendogRomDesc[] = { - { "greendog (usa, europe).bin", 0x40000, 0xf27925b0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_greendog) -STD_ROM_FN(gg_greendog) - -struct BurnDriver BurnDrvgg_greendog = { - "gg_greendog", NULL, NULL, NULL, "1993", - "Greendog (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_greendogRomInfo, gg_greendogRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Griffin (Jpn) - -static struct BurnRomInfo gg_griffinRomDesc[] = { - { "griffin (japan).bin", 0x20000, 0xa93e8b0f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_griffin) -STD_ROM_FN(gg_griffin) - -struct BurnDriver BurnDrvgg_griffin = { - "gg_griffin", NULL, NULL, NULL, "1991", - "Griffin (Jpn)\0", NULL, "Riot", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_griffinRomInfo, gg_griffinRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Gunstar Heroes (Jpn) - -static struct BurnRomInfo gg_gunstarRomDesc[] = { - { "mpr-17847-f.ic1", 0x80000, 0xc3c52767, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_gunstar) -STD_ROM_FN(gg_gunstar) - -struct BurnDriver BurnDrvgg_gunstar = { - "gg_gunstar", NULL, NULL, NULL, "1995", - "Gunstar Heroes (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_gunstarRomInfo, gg_gunstarRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Halley Wars (Jpn) - -static struct BurnRomInfo gg_halleywjRomDesc[] = { - { "halley wars (japan).bin", 0x20000, 0xdef5a5d0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_halleywj) -STD_ROM_FN(gg_halleywj) - -struct BurnDriver BurnDrvgg_halleywj = { - "gg_halleywj", "gg_halleyw", NULL, NULL, "1991", - "Halley Wars (Jpn)\0", NULL, "Taito", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_halleywjRomInfo, gg_halleywjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Halley Wars (Euro, USA, Bra) - -static struct BurnRomInfo gg_halleywRomDesc[] = { - { "halley wars (usa, europe).bin", 0x20000, 0x7e9dea46, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_halleyw) -STD_ROM_FN(gg_halleyw) - -struct BurnDriver BurnDrvgg_halleyw = { - "gg_halleyw", NULL, NULL, NULL, "1991", - "Halley Wars (Euro, USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_halleywRomInfo, gg_halleywRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Head Buster (Jpn) - -static struct BurnRomInfo gg_headbustRomDesc[] = { - { "head buster (japan).bin", 0x20000, 0x7e689995, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_headbust) -STD_ROM_FN(gg_headbust) - -struct BurnDriver BurnDrvgg_headbust = { - "gg_headbust", NULL, NULL, NULL, "1991", - "Head Buster (Jpn)\0", NULL, "Masaya", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_headbustRomInfo, gg_headbustRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Heavy Weight Champ (Jpn) - -static struct BurnRomInfo gg_heavywRomDesc[] = { - { "heavy weight champ (japan).bin", 0x20000, 0xbeed9150, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_heavyw) -STD_ROM_FN(gg_heavyw) - -struct BurnDriver BurnDrvgg_heavyw = { - "gg_heavyw", NULL, NULL, NULL, "1991", - "Heavy Weight Champ (Jpn)\0", NULL, "SIMS", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_heavywRomInfo, gg_heavywRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Home Alone (Euro, USA) - -static struct BurnRomInfo gg_homeaRomDesc[] = { - { "home alone (usa, europe).bin", 0x40000, 0xdde29f74, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_homea) -STD_ROM_FN(gg_homea) - -struct BurnDriver BurnDrvgg_homea = { - "gg_homea", NULL, NULL, NULL, "1992", - "Home Alone (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_homeaRomInfo, gg_homeaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Honoo no Toukyuuji - Dodge Danpei (Jpn) - -static struct BurnRomInfo gg_ddanpeiRomDesc[] = { - { "honoo no toukyuuji - dodge danpei (japan).bin", 0x20000, 0xdfa805a0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ddanpei) -STD_ROM_FN(gg_ddanpei) - -struct BurnDriver BurnDrvgg_ddanpei = { - "gg_ddanpei", NULL, NULL, NULL, "1992", - "Honoo no Toukyuuji - Dodge Danpei (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ddanpeiRomInfo, gg_ddanpeiRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hook (Euro) - -static struct BurnRomInfo gg_hookRomDesc[] = { - { "hook (eu).bin", 0x40000, 0xa5aa5ba1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_hook) -STD_ROM_FN(gg_hook) - -struct BurnDriver BurnDrvgg_hook = { - "gg_hook", NULL, NULL, NULL, "1992", - "Hook (Euro)\0", NULL, "Sony Imagesoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_hookRomInfo, gg_hookRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hook (USA) - -static struct BurnRomInfo gg_hookuRomDesc[] = { - { "hook (usa).bin", 0x40000, 0xf53ced2e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_hooku) -STD_ROM_FN(gg_hooku) - -struct BurnDriver BurnDrvgg_hooku = { - "gg_hooku", "gg_hook", NULL, NULL, "1992", - "Hook (USA)\0", NULL, "Sony Imagesoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_hookuRomInfo, gg_hookuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hurricanes (Euro) - -static struct BurnRomInfo gg_hurricanRomDesc[] = { - { "mpr-17442-f.ic1", 0x80000, 0x0a25eec5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_hurrican) -STD_ROM_FN(gg_hurrican) - -struct BurnDriver BurnDrvgg_hurrican = { - "gg_hurrican", NULL, NULL, NULL, "1994", - "Hurricanes (Euro)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - GGGetZipName, gg_hurricanRomInfo, gg_hurricanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hyokkori Hyoutanjima - Hyoutanjima no Daikoukai (Jpn) - -static struct BurnRomInfo gg_hyokkohjRomDesc[] = { - { "mpr-14690-f.ic1", 0x20000, 0x42389270, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_hyokkohj) -STD_ROM_FN(gg_hyokkohj) - -struct BurnDriver BurnDrvgg_hyokkohj = { - "gg_hyokkohj", NULL, NULL, NULL, "1992", - "Hyokkori Hyoutanjima - Hyoutanjima no Daikoukai (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_hyokkohjRomInfo, gg_hyokkohjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Hyper Pro Yakyuu '92 (Jpn) - -static struct BurnRomInfo gg_hypyak92RomDesc[] = { - { "mpr-14759.ic1", 0x20000, 0x056cae74, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_hypyak92) -STD_ROM_FN(gg_hypyak92) - -struct BurnDriver BurnDrvgg_hypyak92 = { - "gg_hypyak92", NULL, NULL, NULL, "1992", - "Hyper Pro Yakyuu '92 (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_hypyak92RomInfo, gg_hypyak92RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Puzzlle and Action Ichidant~R GG (Jpn) - -static struct BurnRomInfo gg_ichirggRomDesc[] = { - { "ichidant~r gg (japan).bin", 0x80000, 0x9f64c2bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ichirgg) -STD_ROM_FN(gg_ichirgg) - -struct BurnDriver BurnDrvgg_ichirgg = { - "gg_ichirgg", NULL, NULL, NULL, "1994", - "Puzzlle and Action Ichidant~R GG (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ichirggRomInfo, gg_ichirggRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// In the Wake of Vampire (Jpn) - -static struct BurnRomInfo gg_wakevampRomDesc[] = { - { "mpr-15156.ic1", 0x40000, 0xdab0f265, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wakevamp) -STD_ROM_FN(gg_wakevamp) - -struct BurnDriver BurnDrvgg_wakevamp = { - "gg_wakevamp", "gg_mastdark", NULL, NULL, "1992", - "In the Wake of Vampire (Jpn)\0", NULL, "SIMS", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wakevampRomInfo, gg_wakevampRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Incredible Crash Dummies (World) - -static struct BurnRomInfo gg_crashdumRomDesc[] = { - { "incredible crash dummies, the (usa, europe).bin", 0x40000, 0x087fc247, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_crashdum) -STD_ROM_FN(gg_crashdum) - -struct BurnDriver BurnDrvgg_crashdum = { - "gg_crashdum", NULL, NULL, NULL, "1992", - "The Incredible Crash Dummies (World)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_crashdumRomInfo, gg_crashdumRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Incredible Hulk (Euro, USA) - -static struct BurnRomInfo gg_hulkRomDesc[] = { - { "incredible hulk, the (usa, europe).bin", 0x80000, 0xd7055f88, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_hulk) -STD_ROM_FN(gg_hulk) - -struct BurnDriver BurnDrvgg_hulk = { - "gg_hulk", NULL, NULL, NULL, "1994", - "The Incredible Hulk (Euro, USA)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_hulkRomInfo, gg_hulkRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Indiana Jones and the Last Crusade (Euro, USA) - -static struct BurnRomInfo gg_indycrusRomDesc[] = { - { "indiana jones and the last crusade (usa, europe).bin", 0x40000, 0xb875226b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_indycrus) -STD_ROM_FN(gg_indycrus) - -struct BurnDriver BurnDrvgg_indycrus = { - "gg_indycrus", NULL, NULL, NULL, "1992", - "Indiana Jones and the Last Crusade (Euro, USA)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_indycrusRomInfo, gg_indycrusRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Iron Man X-O Manowar in Heavy Metal (USA, Alt) - -static struct BurnRomInfo gg_ironman1RomDesc[] = { - { "iron man x-o manowar in heavy metal (u) [a1].bin", 0x80000, 0x847ae5ce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ironman1) -STD_ROM_FN(gg_ironman1) - -struct BurnDriver BurnDrvgg_ironman1 = { - "gg_ironman1", "gg_ironman", NULL, NULL, "1996", - "Iron Man X-O Manowar in Heavy Metal (USA, Alt)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ironman1RomInfo, gg_ironman1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Iron Man X-O Manowar in Heavy Metal (Euro, USA) - -static struct BurnRomInfo gg_ironmanRomDesc[] = { - { "iron man x-o manowar in heavy metal (usa, europe).bin", 0x80000, 0x8927b69b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ironman) -STD_ROM_FN(gg_ironman) - -struct BurnDriver BurnDrvgg_ironman = { - "gg_ironman", NULL, NULL, NULL, "1996", - "Iron Man X-O Manowar in Heavy Metal (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ironmanRomInfo, gg_ironmanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Itchy and Scratchy Game (Euro, USA) - -static struct BurnRomInfo gg_itchyRomDesc[] = { - { "itchy and scratchy game, the (usa, europe).bin", 0x40000, 0x44e7e2da, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_itchy) -STD_ROM_FN(gg_itchy) - -struct BurnDriver BurnDrvgg_itchy = { - "gg_itchy", NULL, NULL, NULL, "1995", - "The Itchy and Scratchy Game (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_itchyRomInfo, gg_itchyRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// J.League GG Pro Striker '94 (Jpn) - -static struct BurnRomInfo gg_jleagu94RomDesc[] = { - { "mpr-16821.ic1", 0x80000, 0xa12a28a0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jleagu94) -STD_ROM_FN(gg_jleagu94) - -struct BurnDriver BurnDrvgg_jleagu94 = { - "gg_jleagu94", NULL, NULL, NULL, "1994", - "J.League GG Pro Striker '94 (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jleagu94RomInfo, gg_jleagu94RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// J.League Soccer - Dream Eleven (Jpn) - -static struct BurnRomInfo gg_jleagueRomDesc[] = { - { "j.league soccer - dream eleven (japan).bin", 0x80000, 0xabddf0eb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jleague) -STD_ROM_FN(gg_jleague) - -struct BurnDriver BurnDrvgg_jleague = { - "gg_jleague", NULL, NULL, NULL, "1995", - "J.League Soccer - Dream Eleven (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jleagueRomInfo, gg_jleagueRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// James Bond 007 - The Duel (Euro) - -static struct BurnRomInfo gg_jb007RomDesc[] = { - { "james bond 007 - the duel (europe).bin", 0x40000, 0x881a4524, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jb007) -STD_ROM_FN(gg_jb007) - -struct BurnDriver BurnDrvgg_jb007 = { - "gg_jb007", NULL, NULL, NULL, "1993", - "James Bond 007 - The Duel (Euro)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jb007RomInfo, gg_jb007RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// James Pond 3 - Operation Starfish (Euro) - -static struct BurnRomInfo gg_jpond3RomDesc[] = { - { "james pond 3 - operation starfi5h (europe).bin", 0x80000, 0x68bb7f71, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jpond3) -STD_ROM_FN(gg_jpond3) - -struct BurnDriver BurnDrvgg_jpond3 = { - "gg_jpond3", NULL, NULL, NULL, "1994", - "James Pond 3 - Operation Starfish (Euro)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - GGGetZipName, gg_jpond3RomInfo, gg_jpond3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// James Pond II - Codename RoboCod (Euro) - -static struct BurnRomInfo gg_robocodRomDesc[] = { - { "james pond ii - codename robocod (eu).bin", 0x80000, 0xc2f7928b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_robocod) -STD_ROM_FN(gg_robocod) - -struct BurnDriver BurnDrvgg_robocod = { - "gg_robocod", NULL, NULL, NULL, "1993", - "James Pond II - Codename RoboCod (Euro)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_robocodRomInfo, gg_robocodRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// James Pond II - Codename RoboCod (USA) - -static struct BurnRomInfo gg_robocoduRomDesc[] = { - { "james pond ii - codename robocod (usa).bin", 0x80000, 0x9fb5c155, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_robocodu) -STD_ROM_FN(gg_robocodu) - -struct BurnDriver BurnDrvgg_robocodu = { - "gg_robocodu", "gg_robocod", NULL, NULL, "1993", - "James Pond II - Codename RoboCod (USA)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_robocoduRomInfo, gg_robocoduRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Jang Pung II (Kor, SMS Mode) - -static struct BurnRomInfo gg_jangpun2RomDesc[] = { - { "jang pung ii (k) [s].bin", 0x40000, 0x76c5bdfb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jangpun2) -STD_ROM_FN(gg_jangpun2) - -struct BurnDriver BurnDrvgg_jangpun2 = { - "gg_jangpun2", NULL, NULL, NULL, "1993", - "Jang Pung II (Kor, SMS Mode)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_jangpun2RomInfo, gg_jangpun2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Jeopardy! (USA) - -static struct BurnRomInfo gg_jeopardyRomDesc[] = { - { "jeopardy! (usa).bin", 0x40000, 0xd7820c21, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jeopardy) -STD_ROM_FN(gg_jeopardy) - -struct BurnDriver BurnDrvgg_jeopardy = { - "gg_jeopardy", NULL, NULL, NULL, "1993", - "Jeopardy! (USA)\0", NULL, "GameTek", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jeopardyRomInfo, gg_jeopardyRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Jeopardy! - Sports Edition (Euro, USA) - -static struct BurnRomInfo gg_jeopardsRomDesc[] = { - { "jeopardy! - sports edition (usa, europe).bin", 0x40000, 0x2dd850b7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jeopards) -STD_ROM_FN(gg_jeopards) - -struct BurnDriver BurnDrvgg_jeopards = { - "gg_jeopards", NULL, NULL, NULL, "1994", - "Jeopardy! - Sports Edition (Euro, USA)\0", NULL, "GameTek", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jeopardsRomInfo, gg_jeopardsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Joe Montana's Football (Jpn) - -static struct BurnRomInfo gg_joemontjRomDesc[] = { - { "mpr-14319.ic1", 0x40000, 0x4a98678b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_joemontj) -STD_ROM_FN(gg_joemontj) - -struct BurnDriver BurnDrvgg_joemontj = { - "gg_joemontj", "gg_joemont", NULL, NULL, "1992", - "Joe Montana's Football (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_joemontjRomInfo, gg_joemontjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Joe Montana's Football (Euro, USA) - -static struct BurnRomInfo gg_joemontRomDesc[] = { - { "joe montana's football (usa, europe).bin", 0x40000, 0x2e01ba6c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_joemont) -STD_ROM_FN(gg_joemont) - -struct BurnDriver BurnDrvgg_joemont = { - "gg_joemont", NULL, NULL, NULL, "1991", - "Joe Montana's Football (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_joemontRomInfo, gg_joemontRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Journey from Darkness - Strider Returns (Euro, USA) - -static struct BurnRomInfo gg_striderrRomDesc[] = { - { "journey from darkness - strider returns (usa, europe).bin", 0x40000, 0x1ebfa5ca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_striderr) -STD_ROM_FN(gg_striderr) - -struct BurnDriver BurnDrvgg_striderr = { - "gg_striderr", NULL, NULL, NULL, "1992", - "Journey from Darkness - Strider Returns (Euro, USA)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_striderrRomInfo, gg_striderrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Judge Dredd (Euro, USA) - -static struct BurnRomInfo gg_jdreddRomDesc[] = { - { "judge dredd (usa, europe).bin", 0x80000, 0x04d23fc4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jdredd) -STD_ROM_FN(gg_jdredd) - -struct BurnDriver BurnDrvgg_jdredd = { - "gg_jdredd", NULL, NULL, NULL, "1995", - "Judge Dredd (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jdreddRomInfo, gg_jdreddRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Junction (Jpn) - -static struct BurnRomInfo gg_junctionjRomDesc[] = { - { "junction (japan).bin", 0x20000, 0xa8ef36a7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_junctionj) -STD_ROM_FN(gg_junctionj) - -struct BurnDriver BurnDrvgg_junctionj = { - "gg_junctionj", "gg_junction", NULL, NULL, "1991", - "Junction (Jpn)\0", NULL, "Micronet", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_junctionjRomInfo, gg_junctionjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Junction (USA) - -static struct BurnRomInfo gg_junctionRomDesc[] = { - { "junction (us).bin", 0x20000, 0x32abaa02, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_junction) -STD_ROM_FN(gg_junction) - -struct BurnDriver BurnDrvgg_junction = { - "gg_junction", NULL, NULL, NULL, "1991", - "Junction (USA)\0", NULL, "Micronet", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_junctionRomInfo, gg_junctionRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Jungle Book (Euro) - -static struct BurnRomInfo gg_jungleRomDesc[] = { - { "jungle book, the (europe).bin", 0x40000, 0x90100884, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jungle) -STD_ROM_FN(gg_jungle) - -struct BurnDriver BurnDrvgg_jungle = { - "gg_jungle", NULL, NULL, NULL, "1994", - "The Jungle Book (Euro)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jungleRomInfo, gg_jungleRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Jungle Book (USA) - -static struct BurnRomInfo gg_jungleuRomDesc[] = { - { "jungle book, the (usa).bin", 0x40000, 0x30c09f31, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jungleu) -STD_ROM_FN(gg_jungleu) - -struct BurnDriver BurnDrvgg_jungleu = { - "gg_jungleu", "gg_jungle", NULL, NULL, "1994", - "The Jungle Book (USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jungleuRomInfo, gg_jungleuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Jungle Strike (USA) - -static struct BurnRomInfo gg_jstrikeRomDesc[] = { - { "jungle strike (usa).bin", 0x80000, 0xd51642b0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jstrike) -STD_ROM_FN(gg_jstrike) - -struct BurnDriver BurnDrvgg_jstrike = { - "gg_jstrike", NULL, NULL, NULL, "1995", - "Jungle Strike (USA)\0", NULL, "Black Pearl Software", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jstrikeRomInfo, gg_jstrikeRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Jurassic Park (Jpn) - -static struct BurnRomInfo gg_jparkjRomDesc[] = { - { "jurassic park (japan).bin", 0x80000, 0x2f536ae3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jparkj) -STD_ROM_FN(gg_jparkj) - -struct BurnDriver BurnDrvgg_jparkj = { - "gg_jparkj", "gg_jpark", NULL, NULL, "1993", - "Jurassic Park (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jparkjRomInfo, gg_jparkjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Jurassic Park (Euro, USA) - -static struct BurnRomInfo gg_jparkRomDesc[] = { - { "mpr-15779.ic1", 0x80000, 0xbd6f2321, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_jpark) -STD_ROM_FN(gg_jpark) - -struct BurnDriver BurnDrvgg_jpark = { - "gg_jpark", NULL, NULL, NULL, "1993", - "Jurassic Park (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_jparkRomInfo, gg_jparkRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kaitou Saint Tale (Jpn) - -static struct BurnRomInfo gg_sainttalRomDesc[] = { - { "kaitou saint tale (japan).bin", 0x80000, 0x937fd52b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sainttal) -STD_ROM_FN(gg_sainttal) - -struct BurnDriver BurnDrvgg_sainttal = { - "gg_sainttal", NULL, NULL, NULL, "1996", - "Kaitou Saint Tale (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sainttalRomInfo, gg_sainttalRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kawasaki Superbike Challenge (Euro, USA) - -static struct BurnRomInfo gg_kawasakiRomDesc[] = { - { "kawasaki superbike challenge (usa, europe).bin", 0x40000, 0x23f9150a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_kawasaki) -STD_ROM_FN(gg_kawasaki) - -struct BurnDriver BurnDrvgg_kawasaki = { - "gg_kawasaki", NULL, NULL, NULL, "1995", - "Kawasaki Superbike Challenge (Euro, USA)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_kawasakiRomInfo, gg_kawasakiRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kenyuu Densetsu Yaiba (Jpn) - -static struct BurnRomInfo gg_yaibaRomDesc[] = { - { "kenyuu densetsu yaiba (japan).bin", 0x80000, 0xd9ce3f4c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_yaiba) -STD_ROM_FN(gg_yaiba) - -struct BurnDriver BurnDrvgg_yaiba = { - "gg_yaiba", NULL, NULL, NULL, "1994", - "Kenyuu Densetsu Yaiba (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_yaibaRomInfo, gg_yaibaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kick and Rush (Jpn) - -static struct BurnRomInfo gg_kickrushRomDesc[] = { - { "kick and rush (japan).bin", 0x40000, 0xfd14ce00, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_kickrush) -STD_ROM_FN(gg_kickrush) - -struct BurnDriver BurnDrvgg_kickrush = { - "gg_kickrush", "gg_tengenwc", NULL, NULL, "1993", - "Kick and Rush (Jpn)\0", NULL, "SIMS", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_kickrushRomInfo, gg_kickrushRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kinetic Connection (Jpn) - -static struct BurnRomInfo gg_kineticcRomDesc[] = { - { "mpr-13610.ic1", 0x20000, 0x4af7f2aa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_kineticc) -STD_ROM_FN(gg_kineticc) - -struct BurnDriver BurnDrvgg_kineticc = { - "gg_kineticc", NULL, NULL, NULL, "1991", - "Kinetic Connection (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_kineticcRomInfo, gg_kineticcRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kishin Douji Zenki (Jpn) - -static struct BurnRomInfo gg_zenkiRomDesc[] = { - { "mpr-18210.ic1", 0x80000, 0x7d622bdd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_zenki) -STD_ROM_FN(gg_zenki) - -struct BurnDriver BurnDrvgg_zenki = { - "gg_zenki", NULL, NULL, NULL, "1995", - "Kishin Douji Zenki (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_zenkiRomInfo, gg_zenkiRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Klax (Euro, USA) - -static struct BurnRomInfo gg_klaxRomDesc[] = { - { "mpr-15076-f.ic1", 0x20000, 0x9b40fc8e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_klax) -STD_ROM_FN(gg_klax) - -struct BurnDriver BurnDrvgg_klax = { - "gg_klax", NULL, NULL, NULL, "1992", - "Klax (Euro, USA)\0", NULL, "Tengen", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_klaxRomInfo, gg_klaxRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Krusty's Fun House (Euro, USA) - -static struct BurnRomInfo gg_krustyfhRomDesc[] = { - { "mpr-15461-f.ic1", 0x40000, 0xd01e784f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_krustyfh) -STD_ROM_FN(gg_krustyfh) - -struct BurnDriver BurnDrvgg_krustyfh = { - "gg_krustyfh", NULL, NULL, NULL, "1992", - "Krusty's Fun House (Euro, USA)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_krustyfhRomInfo, gg_krustyfhRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kuni-chan no Game Tengoku (Jpn) - -static struct BurnRomInfo gg_kunichanRomDesc[] = { - { "kuni-chan no game tengoku (japan).bin", 0x40000, 0x398f2358, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_kunichan) -STD_ROM_FN(gg_kunichan) - -struct BurnDriver BurnDrvgg_kunichan = { - "gg_kunichan", NULL, NULL, NULL, "1991", - "Kuni-chan no Game Tengoku (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_kunichanRomInfo, gg_kunichanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Kuni-chan no Game Tengoku Part 2 (Jpn) - -static struct BurnRomInfo gg_kunichn2RomDesc[] = { - { "kuni-chan no game tengoku part 2 (japan).bin", 0x40000, 0xf3774c65, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_kunichn2) -STD_ROM_FN(gg_kunichn2) - -struct BurnDriver BurnDrvgg_kunichn2 = { - "gg_kunichn2", NULL, NULL, NULL, "1992", - "Kuni-chan no Game Tengoku Part 2 (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_kunichn2RomInfo, gg_kunichn2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Land of Illusion Starring Mickey Mouse (Euro, USA) - -static struct BurnRomInfo gg_landillRomDesc[] = { - { "mpr-15486.ic1", 0x80000, 0x52dbf3e1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_landill) -STD_ROM_FN(gg_landill) - -struct BurnDriver BurnDrvgg_landill = { - "gg_landill", NULL, NULL, NULL, "1993", - "Land of Illusion Starring Mickey Mouse (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_landillRomInfo, gg_landillRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Last Action Hero (USA) - -static struct BurnRomInfo gg_lastactRomDesc[] = { - { "last action hero (usa).bin", 0x40000, 0x2d367c43, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lastact) -STD_ROM_FN(gg_lastact) - -struct BurnDriver BurnDrvgg_lastact = { - "gg_lastact", NULL, NULL, NULL, "1992", - "Last Action Hero (USA)\0", NULL, "Sony Imagesoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lastactRomInfo, gg_lastactRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Legend of Illusion Starring Mickey Mouse (Euro, USA) - -static struct BurnRomInfo gg_legndillRomDesc[] = { - { "legend of illusion starring mickey mouse (usa, europe).bin", 0x80000, 0xce5ad8b7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_legndill) -STD_ROM_FN(gg_legndill) - -struct BurnDriver BurnDrvgg_legndill = { - "gg_legndill", NULL, NULL, NULL, "1994", - "Legend of Illusion Starring Mickey Mouse (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_legndillRomInfo, gg_legndillRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Legend of Illusion Starring Mickey Mouse (Prototype, 19941011) - -static struct BurnRomInfo gg_legndillp3RomDesc[] = { - { "legend of illusion starring mickey mouse (prototype - oct 11, 1994).bin", 0x80000, 0xf9d4cee9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_legndillp3) -STD_ROM_FN(gg_legndillp3) - -struct BurnDriver BurnDrvgg_legndillp3 = { - "gg_legndillp3", "gg_legndill", NULL, NULL, "1994", - "Legend of Illusion Starring Mickey Mouse (Prototype, 19941011)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_legndillp3RomInfo, gg_legndillp3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Legend of Illusion Starring Mickey Mouse (Prototype, 19941014) - -static struct BurnRomInfo gg_legndillp2RomDesc[] = { - { "legend of illusion starring mickey mouse (prototype - oct 14, 1994).bin", 0x80000, 0x670ede92, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_legndillp2) -STD_ROM_FN(gg_legndillp2) - -struct BurnDriver BurnDrvgg_legndillp2 = { - "gg_legndillp2", "gg_legndill", NULL, NULL, "1994", - "Legend of Illusion Starring Mickey Mouse (Prototype, 19941014)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_legndillp2RomInfo, gg_legndillp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Legend of Illusion Starring Mickey Mouse (Prototype, 19941017) - -static struct BurnRomInfo gg_legndillp1RomDesc[] = { - { "legend of illusion starring mickey mouse (prototype - oct 17, 1994).bin", 0x80000, 0xde8545af, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_legndillp1) -STD_ROM_FN(gg_legndillp1) - -struct BurnDriver BurnDrvgg_legndillp1 = { - "gg_legndillp1", "gg_legndill", NULL, NULL, "1994", - "Legend of Illusion Starring Mickey Mouse (Prototype, 19941017)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_legndillp1RomInfo, gg_legndillp1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Legend of Illusion Starring Mickey Mouse (Prototype, 19940922) - -static struct BurnRomInfo gg_legndillp6RomDesc[] = { - { "legend of illusion starring mickey mouse (prototype - sep 22, 1994).bin", 0x80000, 0x1cc16ad9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_legndillp6) -STD_ROM_FN(gg_legndillp6) - -struct BurnDriver BurnDrvgg_legndillp6 = { - "gg_legndillp6", "gg_legndill", NULL, NULL, "1994", - "Legend of Illusion Starring Mickey Mouse (Prototype, 19940922)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_legndillp6RomInfo, gg_legndillp6RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Legend of Illusion Starring Mickey Mouse (Prototype, 19940930-SEL) - -static struct BurnRomInfo gg_legndillp5RomDesc[] = { - { "legend of illusion starring mickey mouse (prototype - sep 30, 1994 - sel).bin", 0x80000, 0xa0565a5c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_legndillp5) -STD_ROM_FN(gg_legndillp5) - -struct BurnDriver BurnDrvgg_legndillp5 = { - "gg_legndillp5", "gg_legndill", NULL, NULL, "1994", - "Legend of Illusion Starring Mickey Mouse (Prototype, 19940930-SEL)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_legndillp5RomInfo, gg_legndillp5RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Legend of Illusion Starring Mickey Mouse (Prototype, 19940930) - -static struct BurnRomInfo gg_legndillp4RomDesc[] = { - { "legend of illusion starring mickey mouse (prototype - sep 30, 1994).bin", 0x80000, 0x63020617, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_legndillp4) -STD_ROM_FN(gg_legndillp4) - -struct BurnDriver BurnDrvgg_legndillp4 = { - "gg_legndillp4", "gg_legndill", NULL, NULL, "1994", - "Legend of Illusion Starring Mickey Mouse (Prototype, 19940930)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_legndillp4RomInfo, gg_legndillp4RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lemmings (World, Prototype) - -static struct BurnRomInfo gg_lemmingspRomDesc[] = { - { "lemmings (world) (beta).bin", 0x40000, 0x51548f61, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lemmingsp) -STD_ROM_FN(gg_lemmingsp) - -struct BurnDriver BurnDrvgg_lemmingsp = { - "gg_lemmingsp", "gg_lemmings", NULL, NULL, "1992", - "Lemmings (World, Prototype)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lemmingspRomInfo, gg_lemmingspRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lemmings (World) - -static struct BurnRomInfo gg_lemmingsRomDesc[] = { - { "lemmings (world).bin", 0x40000, 0x0fde7baa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lemmings) -STD_ROM_FN(gg_lemmings) - -struct BurnDriver BurnDrvgg_lemmings = { - "gg_lemmings", NULL, NULL, NULL, "1992", - "Lemmings (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lemmingsRomInfo, gg_lemmingsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lemmings 2 - The Tribes (Euro, Prototype) - -static struct BurnRomInfo gg_lemming2RomDesc[] = { - { "lemmings 2 - the tribes [proto].bin", 0x80000, 0xfbc807e1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lemming2) -STD_ROM_FN(gg_lemming2) - -struct BurnDriver BurnDrvgg_lemming2 = { - "gg_lemming2", NULL, NULL, NULL, "1994", - "Lemmings 2 - The Tribes (Euro, Prototype)\0", NULL, "Psygnosis", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lemming2RomInfo, gg_lemming2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lion King (Euro) - -static struct BurnRomInfo gg_lionkingRomDesc[] = { - { "mpr-17271.ic1", 0x80000, 0x0cd9c20b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionking) -STD_ROM_FN(gg_lionking) - -struct BurnDriver BurnDrvgg_lionking = { - "gg_lionking", NULL, NULL, NULL, "1994", - "The Lion King (Euro)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingRomInfo, gg_lionkingRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lion King (Jpn) - -static struct BurnRomInfo gg_lionkingjRomDesc[] = { - { "lion king, the (disney's) (jp).bin", 0x80000, 0xc78b8637, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingj) -STD_ROM_FN(gg_lionkingj) - -struct BurnDriver BurnDrvgg_lionkingj = { - "gg_lionkingj", "gg_lionking", NULL, NULL, "1995", - "The Lion King (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingjRomInfo, gg_lionkingjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lion King (USA) - -static struct BurnRomInfo gg_lionkinguRomDesc[] = { - { "mpr-17074.ic1", 0x80000, 0x9808d7b3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingu) -STD_ROM_FN(gg_lionkingu) - -struct BurnDriver BurnDrvgg_lionkingu = { - "gg_lionkingu", "gg_lionking", NULL, NULL, "1994", - "The Lion King (USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkinguRomInfo, gg_lionkinguRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's The Lion King (Prototype, 19940803) - -static struct BurnRomInfo gg_lionkingp9RomDesc[] = { - { "lion king, the (prototype - aug 03, 1994).bin", 0x7d909, 0xaacb7387, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingp9) -STD_ROM_FN(gg_lionkingp9) - -struct BurnDriver BurnDrvgg_lionkingp9 = { - "gg_lionkingp9", "gg_lionking", NULL, NULL, "1994", - "Disney's The Lion King (Prototype, 19940803)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingp9RomInfo, gg_lionkingp9RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's The Lion King (Prototype, 19940811) - -static struct BurnRomInfo gg_lionkingp8RomDesc[] = { - { "lion king, the (prototype - aug 11, 1994).bin", 0x7d992, 0x214c13dc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingp8) -STD_ROM_FN(gg_lionkingp8) - -struct BurnDriver BurnDrvgg_lionkingp8 = { - "gg_lionkingp8", "gg_lionking", NULL, NULL, "1994", - "Disney's The Lion King (Prototype, 19940811)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingp8RomInfo, gg_lionkingp8RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's The Lion King (Prototype, 19940812) - -static struct BurnRomInfo gg_lionkingp7RomDesc[] = { - { "lion king, the (prototype - aug 12, 1994).bin", 0x7d9ae, 0x0e80efe0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingp7) -STD_ROM_FN(gg_lionkingp7) - -struct BurnDriver BurnDrvgg_lionkingp7 = { - "gg_lionkingp7", "gg_lionking", NULL, NULL, "1994", - "Disney's The Lion King (Prototype, 19940812)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingp7RomInfo, gg_lionkingp7RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's The Lion King (Prototype, 19940813) - -static struct BurnRomInfo gg_lionkingp6RomDesc[] = { - { "lion king, the (prototype - aug 13, 1994).bin", 0x7d9b2, 0x8250c11e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingp6) -STD_ROM_FN(gg_lionkingp6) - -struct BurnDriver BurnDrvgg_lionkingp6 = { - "gg_lionkingp6", "gg_lionking", NULL, NULL, "1994", - "Disney's The Lion King (Prototype, 19940813)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingp6RomInfo, gg_lionkingp6RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's The Lion King (Prototype, 19940814) - -static struct BurnRomInfo gg_lionkingp5RomDesc[] = { - { "lion king, the (prototype - aug 14, 1994).bin", 0x7d9b6, 0xeb10a2d4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingp5) -STD_ROM_FN(gg_lionkingp5) - -struct BurnDriver BurnDrvgg_lionkingp5 = { - "gg_lionkingp5", "gg_lionking", NULL, NULL, "1994", - "Disney's The Lion King (Prototype, 19940814)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingp5RomInfo, gg_lionkingp5RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Disney's The Lion King (Prototype, 19940816) - -static struct BurnRomInfo gg_lionkingp4RomDesc[] = { - { "lion king, the (prototype - aug 16, 1994).bin", 0x7d9b6, 0xc6af9643, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingp4) -STD_ROM_FN(gg_lionkingp4) - -struct BurnDriver BurnDrvgg_lionkingp4 = { - "gg_lionkingp4", "gg_lionking", NULL, NULL, "1994", - "Disney's The Lion King (Prototype, 19940816)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingp4RomInfo, gg_lionkingp4RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lion King (Prototype, 19940817-2) - -static struct BurnRomInfo gg_lionkingp3RomDesc[] = { - { "lion king, the (prototype - aug 17, 1994 - 2).bin", 0x7da3a, 0xb65030d0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingp3) -STD_ROM_FN(gg_lionkingp3) - -struct BurnDriver BurnDrvgg_lionkingp3 = { - "gg_lionkingp3", "gg_lionking", NULL, NULL, "1994", - "The Lion King (Prototype, 19940817-2)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingp3RomInfo, gg_lionkingp3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lion King (Prototype, 19940817) - -static struct BurnRomInfo gg_lionkingp2RomDesc[] = { - { "lion king, the (prototype - aug 17, 1994).bin", 0x7d9ea, 0x4214c474, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingp2) -STD_ROM_FN(gg_lionkingp2) - -struct BurnDriver BurnDrvgg_lionkingp2 = { - "gg_lionkingp2", "gg_lionking", NULL, NULL, "1994", - "The Lion King (Prototype, 19940817)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingp2RomInfo, gg_lionkingp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lion King (Prototype, 19940820) - -static struct BurnRomInfo gg_lionkingp1RomDesc[] = { - { "lion king, the (prototype - aug 20, 1994).bin", 0x7fe56, 0x3d0b31a2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lionkingp1) -STD_ROM_FN(gg_lionkingp1) - -struct BurnDriver BurnDrvgg_lionkingp1 = { - "gg_lionkingp1", "gg_lionking", NULL, NULL, "1994", - "The Lion King (Prototype, 19940820)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lionkingp1RomInfo, gg_lionkingp1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lost World - Jurassic Park (USA) - -static struct BurnRomInfo gg_lostwrldRomDesc[] = { - { "mpr-19811-s.ic2", 0x100000, 0x8d1597f5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lostwrld) -STD_ROM_FN(gg_lostwrld) - -struct BurnDriver BurnDrvgg_lostwrld = { - "gg_lostwrld", NULL, NULL, NULL, "1997", - "The Lost World - Jurassic Park (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lostwrldRomInfo, gg_lostwrldRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Lucky Dime Caper (Euro, USA) - -static struct BurnRomInfo gg_luckydimRomDesc[] = { - { "mpr-14461 j09.ic1", 0x40000, 0x07a7815a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_luckydim) -STD_ROM_FN(gg_luckydim) - -struct BurnDriver BurnDrvgg_luckydim = { - "gg_luckydim", NULL, NULL, NULL, "1991", - "The Lucky Dime Caper (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_luckydimRomInfo, gg_luckydimRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Lunar - Sanposuru Gakuen (Jpn) - -static struct BurnRomInfo gg_lunarRomDesc[] = { - { "lunar - sanposuru gakuen (japan).bin", 0x80000, 0x58459edd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lunar) -STD_ROM_FN(gg_lunar) - -struct BurnDriver BurnDrvgg_lunar = { - "gg_lunar", NULL, NULL, NULL, "1996", - "Lunar - Sanposuru Gakuen (Jpn)\0", NULL, "Game Arts", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lunarRomInfo, gg_lunarRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Madden NFL '95 (USA) - -static struct BurnRomInfo gg_madden95RomDesc[] = { - { "madden nfl '95 (usa).bin", 0x80000, 0x75c71ebf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_madden95) -STD_ROM_FN(gg_madden95) - -struct BurnDriver BurnDrvgg_madden95 = { - "gg_madden95", NULL, NULL, NULL, "1995", - "Madden NFL '95 (USA)\0", NULL, "Electronic Arts", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_madden95RomInfo, gg_madden95RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Madden NFL '96 (Euro, USA) - -static struct BurnRomInfo gg_madden96RomDesc[] = { - { "madden nfl '96 (usa, europe).bin", 0x80000, 0x9f59d302, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_madden96) -STD_ROM_FN(gg_madden96) - -struct BurnDriver BurnDrvgg_madden96 = { - "gg_madden96", NULL, NULL, NULL, "1995", - "Madden NFL '96 (Euro, USA)\0", NULL, "Black Pearl", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_madden96RomInfo, gg_madden96RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Madou Monogatari A - Dokidoki Vacation (Jpn) - -static struct BurnRomInfo gg_madoumnaRomDesc[] = { - { "madou monogatari a - dokidoki vacation (japan).bin", 0x80000, 0x7ec95282, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_madoumna) -STD_ROM_FN(gg_madoumna) - -struct BurnDriver BurnDrvgg_madoumna = { - "gg_madoumna", NULL, NULL, NULL, "1995", - "Madou Monogatari A - Dokidoki Vacation (Jpn)\0", NULL, "Compile", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_madoumnaRomInfo, gg_madoumnaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Madou Monogatari I - 3-Tsu no Madoukyuu (Jpn) - -static struct BurnRomInfo gg_madoumonRomDesc[] = { - { "madou monogatari i - 3-tsu no madoukyuu (japan).bin", 0x80000, 0x00c34d94, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_madoumon) -STD_ROM_FN(gg_madoumon) - -struct BurnDriver BurnDrvgg_madoumon = { - "gg_madoumon", NULL, NULL, NULL, "1993", - "Madou Monogatari I - 3-Tsu no Madoukyuu (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_madoumonRomInfo, gg_madoumonRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Madou Monogatari II - Arle 16-Sai (Jpn) - -static struct BurnRomInfo gg_madoumn2RomDesc[] = { - { "mpr-16616.ic1", 0x80000, 0x12eb2287, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_madoumn2) -STD_ROM_FN(gg_madoumn2) - -struct BurnDriver BurnDrvgg_madoumn2 = { - "gg_madoumn2", NULL, NULL, NULL, "1994", - "Madou Monogatari II - Arle 16-Sai (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_madoumn2RomInfo, gg_madoumn2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Madou Monogatari III - Kyuukyoku Joou-sama (Jpn, v1) - -static struct BurnRomInfo gg_madoumn3RomDesc[] = { - { "madou monogatari iii - kyuukyoku joou-sama (japan) (v1.1).bin", 0x80000, 0x568f4825, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_madoumn3) -STD_ROM_FN(gg_madoumn3) - -struct BurnDriver BurnDrvgg_madoumn3 = { - "gg_madoumn3", NULL, NULL, NULL, "1994", - "Madou Monogatari III - Kyuukyoku Joou-sama (Jpn, v1)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_madoumn3RomInfo, gg_madoumn3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Madou Monogatari III - Kyuukyoku Joou-sama (Jpn, v0) - -static struct BurnRomInfo gg_madoumn3aRomDesc[] = { - { "madou monogatari iii - kyuukyoku joou-sama (japan).bin", 0x80000, 0x0a634d79, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_madoumn3a) -STD_ROM_FN(gg_madoumn3a) - -struct BurnDriver BurnDrvgg_madoumn3a = { - "gg_madoumn3a", "gg_madoumn3", NULL, NULL, "1994", - "Madou Monogatari III - Kyuukyoku Joou-sama (Jpn, v0)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_madoumn3aRomInfo, gg_madoumn3aRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Magic Knight Rayearth (Jpn) - -static struct BurnRomInfo gg_rayearthRomDesc[] = { - { "mpr-17115.ic1", 0x80000, 0x8f82a6b9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_rayearth) -STD_ROM_FN(gg_rayearth) - -struct BurnDriver BurnDrvgg_rayearth = { - "gg_rayearth", NULL, NULL, NULL, "1994", - "Magic Knight Rayearth (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_rayearthRomInfo, gg_rayearthRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Magic Knight Rayearth 2 - Making of Magic Knight (Jpn) - -static struct BurnRomInfo gg_rayeart2RomDesc[] = { - { "mpr-18183-s.ic1", 0x80000, 0x1c2c2b04, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_rayeart2) -STD_ROM_FN(gg_rayeart2) - -struct BurnDriver BurnDrvgg_rayeart2 = { - "gg_rayeart2", NULL, NULL, NULL, "1995", - "Magic Knight Rayearth 2 - Making of Magic Knight (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_rayeart2RomInfo, gg_rayeart2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Magical Puzzle Popils (World) - -static struct BurnRomInfo gg_magiclppRomDesc[] = { - { "magical puzzle popils (world) (en,ja).bin", 0x20000, 0xcf6d7bc5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_magiclpp) -STD_ROM_FN(gg_magiclpp) - -struct BurnDriver BurnDrvgg_magiclpp = { - "gg_magiclpp", NULL, NULL, NULL, "1991", - "Magical Puzzle Popils (World)\0", NULL, "Tengen", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_magiclppRomInfo, gg_magiclppRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Magical Taruruuto-kun (Jpn) - -static struct BurnRomInfo gg_mtaruruRomDesc[] = { - { "magical taruruuto-kun (japan).bin", 0x20000, 0x6e1cc23c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mtaruru) -STD_ROM_FN(gg_mtaruru) - -struct BurnDriver BurnDrvgg_mtaruru = { - "gg_mtaruru", NULL, NULL, NULL, "1991", - "Magical Taruruuto-kun (Jpn)\0", NULL, "Tsukuda Original", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mtaruruRomInfo, gg_mtaruruRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Majors Pro Baseball (USA) - -static struct BurnRomInfo gg_majorsRomDesc[] = { - { "majors pro baseball, the (usa).bin", 0x40000, 0x36ebcd6d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_majors) -STD_ROM_FN(gg_majors) - -struct BurnDriver BurnDrvgg_majors = { - "gg_majors", NULL, NULL, NULL, "1992", - "The Majors Pro Baseball (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_majorsRomInfo, gg_majorsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mappy (Jpn) - -static struct BurnRomInfo gg_mappyRomDesc[] = { - { "mappy (japan).bin", 0x20000, 0x01d2dd2a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mappy) -STD_ROM_FN(gg_mappy) - -struct BurnDriver BurnDrvgg_mappy = { - "gg_mappy", NULL, NULL, NULL, "1991", - "Mappy (Jpn)\0", NULL, "Namcot", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mappyRomInfo, gg_mappyRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Marble Madness (Euro, USA) - -static struct BurnRomInfo gg_marbleRomDesc[] = { - { "marble madness (usa, europe).bin", 0x40000, 0x9559e339, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_marble) -STD_ROM_FN(gg_marble) - -struct BurnDriver BurnDrvgg_marble = { - "gg_marble", NULL, NULL, NULL, "1992", - "Marble Madness (Euro, USA)\0", NULL, "Tengen", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_marbleRomInfo, gg_marbleRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Marko's Magic Football (Euro) - -static struct BurnRomInfo gg_markoRomDesc[] = { - { "marko's magic football (europe) (en,fr,de,es).bin", 0x80000, 0x22c418bf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_marko) -STD_ROM_FN(gg_marko) - -struct BurnDriver BurnDrvgg_marko = { - "gg_marko", NULL, NULL, NULL, "1993", - "Marko's Magic Football (Euro)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_markoRomInfo, gg_markoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Master of Darkness (Euro) - -static struct BurnRomInfo gg_mastdarkRomDesc[] = { - { "master of darkness (eu).bin", 0x40000, 0x07d0eb42, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mastdark) -STD_ROM_FN(gg_mastdark) - -struct BurnDriver BurnDrvgg_mastdark = { - "gg_mastdark", NULL, NULL, NULL, "1993", - "Master of Darkness (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mastdarkRomInfo, gg_mastdarkRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mega Man (Euro, USA) - -static struct BurnRomInfo gg_megamanRomDesc[] = { - { "mega man (usa, europe).bin", 0x80000, 0x1ace93af, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_megaman) -STD_ROM_FN(gg_megaman) - -struct BurnDriver BurnDrvgg_megaman = { - "gg_megaman", NULL, NULL, NULL, "1995", - "Mega Man (Euro, USA)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_megamanRomInfo, gg_megamanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Megami Tensei Gaiden - Last Bible (Jpn) - -static struct BurnRomInfo gg_lastbiblRomDesc[] = { - { "megami tensei gaiden - last bible (japan).bin", 0x80000, 0x2e4ec17b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lastbibl) -STD_ROM_FN(gg_lastbibl) - -struct BurnDriver BurnDrvgg_lastbibl = { - "gg_lastbibl", NULL, NULL, NULL, "1994", - "Megami Tensei Gaiden - Last Bible (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lastbiblRomInfo, gg_lastbiblRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Megami Tensei Gaiden - Last Bible S (Jpn) - -static struct BurnRomInfo gg_lastbibsRomDesc[] = { - { "megami tensei gaiden - last bible s (japan).bin", 0x80000, 0x4ec30806, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_lastbibs) -STD_ROM_FN(gg_lastbibs) - -struct BurnDriver BurnDrvgg_lastbibs = { - "gg_lastbibs", NULL, NULL, NULL, "1995", - "Megami Tensei Gaiden - Last Bible S (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_lastbibsRomInfo, gg_lastbibsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mick and Mack as the Global Gladiators (Euro, USA) - -static struct BurnRomInfo gg_mickmackRomDesc[] = { - { "mick and mack as the global gladiators (usa, europe).bin", 0x40000, 0xd2b6021e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mickmack) -STD_ROM_FN(gg_mickmack) - -struct BurnDriver BurnDrvgg_mickmack = { - "gg_mickmack", NULL, NULL, NULL, "1992", - "Mick and Mack as the Global Gladiators (Euro, USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mickmackRomInfo, gg_mickmackRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mickey Mouse Densetsu no Oukoku - Legend of Illusion (Jpn) - -static struct BurnRomInfo gg_legndilljRomDesc[] = { - { "mickey mouse densetsu no oukoku - legend of illusion (japan).bin", 0x80000, 0xfe12a92f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_legndillj) -STD_ROM_FN(gg_legndillj) - -struct BurnDriver BurnDrvgg_legndillj = { - "gg_legndillj", "gg_legndill", NULL, NULL, "1995", - "Mickey Mouse Densetsu no Oukoku - Legend of Illusion (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_legndilljRomInfo, gg_legndilljRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mickey Mouse no Castle Illusion (Jpn, SMS Mode) - -static struct BurnRomInfo gg_castlilljRomDesc[] = { - { "mickey mouse no castle illusion (japan).bin", 0x40000, 0x9942b69b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_castlillj) -STD_ROM_FN(gg_castlillj) - -struct BurnDriver BurnDrvgg_castlillj = { - "gg_castlillj", "gg_castlill", NULL, NULL, "1991", - "Mickey Mouse no Castle Illusion (Jpn, SMS Mode)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE | HARDWARE_SMS_JAPANESE, GBF_MISC, 0, - GGGetZipName, gg_castlilljRomInfo, gg_castlilljRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mickey Mouse no Mahou no Crystal (Jpn) - -static struct BurnRomInfo gg_landilljRomDesc[] = { - { "mickey mouse no mahou no crystal (japan).bin", 0x80000, 0x0117c3df, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_landillj) -STD_ROM_FN(gg_landillj) - -struct BurnDriver BurnDrvgg_landillj = { - "gg_landillj", "gg_landill", NULL, NULL, "1993", - "Mickey Mouse no Mahou no Crystal (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_landilljRomInfo, gg_landilljRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mickey's Ultimate Challenge (Euro, USA) - -static struct BurnRomInfo gg_mickeyucRomDesc[] = { - { "mickey's ultimate challenge (usa, europe).bin", 0x40000, 0xeccf7a4f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mickeyuc) -STD_ROM_FN(gg_mickeyuc) - -struct BurnDriver BurnDrvgg_mickeyuc = { - "gg_mickeyuc", NULL, NULL, NULL, "1994", - "Mickey's Ultimate Challenge (Euro, USA)\0", NULL, "Hi Tech Expressions", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mickeyucRomInfo, gg_mickeyucRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Micro Machines (Euro) - -static struct BurnRomInfo gg_micromacRomDesc[] = { - { "micro machines (europe).bin", 0x40000, 0xf7c524f6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_micromac) -STD_ROM_FN(gg_micromac) - -struct BurnDriver BurnDrvgg_micromac = { - "gg_micromac", NULL, NULL, NULL, "1993", - "Micro Machines (Euro)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - GGGetZipName, gg_micromacRomInfo, gg_micromacRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Micro Machines 2 - Turbo Tournament (Euro) - -static struct BurnRomInfo gg_micromc2RomDesc[] = { - { "micro machines 2 - turbo tournament (europe).bin", 0x80000, 0xdbe8895c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_micromc2) -STD_ROM_FN(gg_micromc2) - -struct BurnDriver BurnDrvgg_micromc2 = { - "gg_micromc2", NULL, NULL, NULL, "1995", - "Micro Machines 2 - Turbo Tournament (Euro)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES, GBF_MISC, 0, - GGGetZipName, gg_micromc2RomInfo, gg_micromc2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mighty Morphin Power Rangers (Prototype, 19940716) - -static struct BurnRomInfo gg_mmprpRomDesc[] = { - { "mighty morphin power rangers (prototype - jul 16, 1994).bin", 0x80000, 0x2887f04a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mmprp) -STD_ROM_FN(gg_mmprp) - -struct BurnDriver BurnDrvgg_mmprp = { - "gg_mmprp", "gg_mmpr", NULL, NULL, "1994", - "Mighty Morphin Power Rangers (Prototype, 19940716)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mmprpRomInfo, gg_mmprpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mighty Morphin Power Rangers (Euro, USA) - -static struct BurnRomInfo gg_mmprRomDesc[] = { - { "mighty morphin power rangers (usa, europe).bin", 0x80000, 0x9289dfcc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mmpr) -STD_ROM_FN(gg_mmpr) - -struct BurnDriver BurnDrvgg_mmpr = { - "gg_mmpr", NULL, NULL, NULL, "1994", - "Mighty Morphin Power Rangers (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mmprRomInfo, gg_mmprRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mighty Morphin Power Rangers - The Movie (Prototype, 19950530) - -static struct BurnRomInfo gg_mmprtmpRomDesc[] = { - { "mighty morphin power rangers - the movie (prototype - may 30, 1995).bin", 0x80000, 0x8c665203, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mmprtmp) -STD_ROM_FN(gg_mmprtmp) - -struct BurnDriver BurnDrvgg_mmprtmp = { - "gg_mmprtmp", "gg_mmprtm", NULL, NULL, "1995", - "Mighty Morphin Power Rangers - The Movie (Prototype, 19950530)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mmprtmpRomInfo, gg_mmprtmpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mighty Morphin Power Rangers - The Movie (Euro, USA) - -static struct BurnRomInfo gg_mmprtmRomDesc[] = { - { "mighty morphin power rangers - the movie (usa, europe).bin", 0x80000, 0xb47c19e5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mmprtm) -STD_ROM_FN(gg_mmprtm) - -struct BurnDriver BurnDrvgg_mmprtm = { - "gg_mmprtm", NULL, NULL, NULL, "1995", - "Mighty Morphin Power Rangers - The Movie (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mmprtmRomInfo, gg_mmprtmRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// MLBPA Baseball (USA) - -static struct BurnRomInfo gg_mlbpaRomDesc[] = { - { "mlbpa baseball (usa).bin", 0x80000, 0x1ecf07b4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mlbpa) -STD_ROM_FN(gg_mlbpa) - -struct BurnDriver BurnDrvgg_mlbpa = { - "gg_mlbpa", NULL, NULL, NULL, "1995", - "MLBPA Baseball (USA)\0", NULL, "Electronic Arts", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mlbpaRomInfo, gg_mlbpaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Moldorian - Hikari to Yami no Sister (Jpn) - -static struct BurnRomInfo gg_moldoranRomDesc[] = { - { "moldorian - hikari to yami no sister (japan).bin", 0x80000, 0x4d5d15fb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_moldoran) -STD_ROM_FN(gg_moldoran) - -struct BurnDriver BurnDrvgg_moldoran = { - "gg_moldoran", NULL, NULL, NULL, "1994", - "Moldorian - Hikari to Yami no Sister (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_moldoranRomInfo, gg_moldoranRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Monster Truck Wars (Euro, USA) - -static struct BurnRomInfo gg_monstwarRomDesc[] = { - { "mpr-17420-s.ic1", 0x40000, 0x453c5cec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_monstwar) -STD_ROM_FN(gg_monstwar) - -struct BurnDriver BurnDrvgg_monstwar = { - "gg_monstwar", NULL, NULL, NULL, "1994", - "Monster Truck Wars (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_monstwarRomInfo, gg_monstwarRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Monster World II - Dragon no Wana (Jpn) - -static struct BurnRomInfo gg_mworld2RomDesc[] = { - { "monster world ii - dragon no wana (japan).bin", 0x40000, 0xea89e0e7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mworld2) -STD_ROM_FN(gg_mworld2) - -struct BurnDriver BurnDrvgg_mworld2 = { - "gg_mworld2", "gg_wboydtrp", NULL, NULL, "1992", - "Monster World II - Dragon no Wana (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mworld2RomInfo, gg_mworld2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mortal Kombat (Jpn, v3.3) - -static struct BurnRomInfo gg_mkjRomDesc[] = { - { "mortal kombat (japan) (v3.3).bin", 0x80000, 0xdbff0461, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mkj) -STD_ROM_FN(gg_mkj) - -struct BurnDriver BurnDrvgg_mkj = { - "gg_mkj", "gg_mk", NULL, NULL, "1993", - "Mortal Kombat (Jpn, v3.3)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mkjRomInfo, gg_mkjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mortal Kombat (Euro, USA, v2.6) - -static struct BurnRomInfo gg_mkRomDesc[] = { - { "mpr-15771.ic1", 0x80000, 0x07494f2a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mk) -STD_ROM_FN(gg_mk) - -struct BurnDriver BurnDrvgg_mk = { - "gg_mk", NULL, NULL, NULL, "1993", - "Mortal Kombat (Euro, USA, v2.6)\0", NULL, "Arena", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mkRomInfo, gg_mkRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mortal Kombat 3 (Euro) - -static struct BurnRomInfo gg_mk3RomDesc[] = { - { "mortal kombat 3 (europe).bin", 0x80000, 0xc2be62bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mk3) -STD_ROM_FN(gg_mk3) - -struct BurnDriver BurnDrvgg_mk3 = { - "gg_mk3", NULL, NULL, NULL, "1995", - "Mortal Kombat 3 (Euro)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mk3RomInfo, gg_mk3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Mortal Kombat II (World) - -static struct BurnRomInfo gg_mk2RomDesc[] = { - { "mortal kombat ii (world).bin", 0x80000, 0x4b304e0f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mk2) -STD_ROM_FN(gg_mk2) - -struct BurnDriver BurnDrvgg_mk2 = { - "gg_mk2", NULL, NULL, NULL, "1994", - "Mortal Kombat II (World)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mk2RomInfo, gg_mk2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ms. Pac-Man (USA) - -static struct BurnRomInfo gg_mspacmanRomDesc[] = { - { "ms. pac-man (usa).bin", 0x20000, 0x5ee88bd5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_mspacman) -STD_ROM_FN(gg_mspacman) - -struct BurnDriver BurnDrvgg_mspacman = { - "gg_mspacman", NULL, NULL, NULL, "199?", - "Ms. Pac-Man (USA)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_mspacmanRomInfo, gg_mspacmanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Nazo Puyo (Jpn, v1) - -static struct BurnRomInfo gg_nazopuyoRomDesc[] = { - { "nazo puyo (japan)(v1.1).bin", 0x20000, 0xd8d11f8d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nazopuyo) -STD_ROM_FN(gg_nazopuyo) - -struct BurnDriver BurnDrvgg_nazopuyo = { - "gg_nazopuyo", NULL, NULL, NULL, "1993", - "Nazo Puyo (Jpn, v1)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nazopuyoRomInfo, gg_nazopuyoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Nazo Puyo (Jpn, v0) - -static struct BurnRomInfo gg_nazopuyo1RomDesc[] = { - { "nazo puyo (japan).bin", 0x20000, 0xbcce5fd4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nazopuyo1) -STD_ROM_FN(gg_nazopuyo1) - -struct BurnDriver BurnDrvgg_nazopuyo1 = { - "gg_nazopuyo1", "gg_nazopuyo", NULL, NULL, "1993", - "Nazo Puyo (Jpn, v0)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nazopuyo1RomInfo, gg_nazopuyo1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Nazo Puyo 2 (Jpn) - -static struct BurnRomInfo gg_nazpuyo2RomDesc[] = { - { "nazo puyo 2 (japan).bin", 0x40000, 0x73939de4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nazpuyo2) -STD_ROM_FN(gg_nazpuyo2) - -struct BurnDriver BurnDrvgg_nazpuyo2 = { - "gg_nazpuyo2", NULL, NULL, NULL, "1993", - "Nazo Puyo 2 (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nazpuyo2RomInfo, gg_nazpuyo2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Nazo Puyo Arle no Roux (Jpn, Prototype) - -static struct BurnRomInfo gg_nazpyoarpRomDesc[] = { - { "nazo puyo arle no roux (japan) (development edition).bin", 0x40000, 0x4c874466, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nazpyoarp) -STD_ROM_FN(gg_nazpyoarp) - -struct BurnDriver BurnDrvgg_nazpyoarp = { - "gg_nazpyoarp", "gg_nazpyoar", NULL, NULL, "1994", - "Nazo Puyo Arle no Roux (Jpn, Prototype)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nazpyoarpRomInfo, gg_nazpyoarpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Nazo Puyo Arle no Roux (Jpn) - -static struct BurnRomInfo gg_nazpyoarRomDesc[] = { - { "mpr-16849.ic1", 0x40000, 0x54ab42a4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nazpyoar) -STD_ROM_FN(gg_nazpyoar) - -struct BurnDriver BurnDrvgg_nazpyoar = { - "gg_nazpyoar", NULL, NULL, NULL, "1994", - "Nazo Puyo Arle no Roux (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nazpyoarRomInfo, gg_nazpyoarRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (USA) - -static struct BurnRomInfo gg_nbaactRomDesc[] = { - { "nba action (usa).bin", 0x40000, 0x19030108, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaact) -STD_ROM_FN(gg_nbaact) - -struct BurnDriver BurnDrvgg_nbaact = { - "gg_nbaact", NULL, NULL, NULL, "1994", - "NBA Action Starring David Robinson (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactRomInfo, gg_nbaactRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Final A, 19940228) - -static struct BurnRomInfo gg_nbaactp08RomDesc[] = { - { "nba action starring david robinson (final a - feb 28, 1994).bin", 0x40000, 0xd15aa940, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp08) -STD_ROM_FN(gg_nbaactp08) - -struct BurnDriver BurnDrvgg_nbaactp08 = { - "gg_nbaactp08", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Final A, 19940228)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp08RomInfo, gg_nbaactp08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Final B, 19940301) - -static struct BurnRomInfo gg_nbaactp07RomDesc[] = { - { "nba action starring david robinson (final b - mar 01, 1994).bin", 0x40000, 0x4415c0bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp07) -STD_ROM_FN(gg_nbaactp07) - -struct BurnDriver BurnDrvgg_nbaactp07 = { - "gg_nbaactp07", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Final B, 19940301)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp07RomInfo, gg_nbaactp07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Final C, 19940302) - -static struct BurnRomInfo gg_nbaactp06RomDesc[] = { - { "nba action starring david robinson (final c - mar 02, 1994).bin", 0x40000, 0x5254577a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp06) -STD_ROM_FN(gg_nbaactp06) - -struct BurnDriver BurnDrvgg_nbaactp06 = { - "gg_nbaactp06", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Final C, 19940302)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp06RomInfo, gg_nbaactp06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Final D, 19940303) - -static struct BurnRomInfo gg_nbaactp05RomDesc[] = { - { "nba action starring david robinson (final d - mar 03, 1994).bin", 0x40000, 0x75a5bc5d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp05) -STD_ROM_FN(gg_nbaactp05) - -struct BurnDriver BurnDrvgg_nbaactp05 = { - "gg_nbaactp05", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Final D, 19940303)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp05RomInfo, gg_nbaactp05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Final E, 19940304) - -static struct BurnRomInfo gg_nbaactp04RomDesc[] = { - { "nba action starring david robinson (final e - mar 04, 1994).bin", 0x40000, 0x80c0586c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp04) -STD_ROM_FN(gg_nbaactp04) - -struct BurnDriver BurnDrvgg_nbaactp04 = { - "gg_nbaactp04", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Final E, 19940304)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp04RomInfo, gg_nbaactp04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Final F, 19940304) - -static struct BurnRomInfo gg_nbaactp03RomDesc[] = { - { "nba action starring david robinson (final f - mar 04, 1994).bin", 0x40000, 0xa82049df, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp03) -STD_ROM_FN(gg_nbaactp03) - -struct BurnDriver BurnDrvgg_nbaactp03 = { - "gg_nbaactp03", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Final F, 19940304)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp03RomInfo, gg_nbaactp03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Final G, 19940305) - -static struct BurnRomInfo gg_nbaactp02RomDesc[] = { - { "nba action starring david robinson (final g - mar 05, 1994).bin", 0x40000, 0xe197a0bb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp02) -STD_ROM_FN(gg_nbaactp02) - -struct BurnDriver BurnDrvgg_nbaactp02 = { - "gg_nbaactp02", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Final G, 19940305)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp02RomInfo, gg_nbaactp02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Final H, 19940308) - -static struct BurnRomInfo gg_nbaactp01RomDesc[] = { - { "nba action starring david robinson (final h - mar 08, 1994).bin", 0x40000, 0xc9e98a49, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp01) -STD_ROM_FN(gg_nbaactp01) - -struct BurnDriver BurnDrvgg_nbaactp01 = { - "gg_nbaactp01", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Final H, 19940308)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp01RomInfo, gg_nbaactp01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940202) - -static struct BurnRomInfo gg_nbaactp23RomDesc[] = { - { "nba action starring david robinson (prototype - feb 02, 1994).bin", 0x40000, 0xf9d5500b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp23) -STD_ROM_FN(gg_nbaactp23) - -struct BurnDriver BurnDrvgg_nbaactp23 = { - "gg_nbaactp23", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940202)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp23RomInfo, gg_nbaactp23RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940203) - -static struct BurnRomInfo gg_nbaactp22RomDesc[] = { - { "nba action starring david robinson (prototype - feb 03, 1994).bin", 0x40000, 0xe2341dce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp22) -STD_ROM_FN(gg_nbaactp22) - -struct BurnDriver BurnDrvgg_nbaactp22 = { - "gg_nbaactp22", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940203)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp22RomInfo, gg_nbaactp22RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940206) - -static struct BurnRomInfo gg_nbaactp21RomDesc[] = { - { "nba action starring david robinson (prototype - feb 06, 1994).bin", 0x40000, 0x07649147, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp21) -STD_ROM_FN(gg_nbaactp21) - -struct BurnDriver BurnDrvgg_nbaactp21 = { - "gg_nbaactp21", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940206)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp21RomInfo, gg_nbaactp21RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940208) - -static struct BurnRomInfo gg_nbaactp20RomDesc[] = { - { "nba action starring david robinson (prototype - feb 08, 1994).bin", 0x40000, 0x5e089fbc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp20) -STD_ROM_FN(gg_nbaactp20) - -struct BurnDriver BurnDrvgg_nbaactp20 = { - "gg_nbaactp20", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940208)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp20RomInfo, gg_nbaactp20RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940212) - -static struct BurnRomInfo gg_nbaactp19RomDesc[] = { - { "nba action starring david robinson (prototype - feb 12, 1994).bin", 0x40000, 0x0c0f6b4c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp19) -STD_ROM_FN(gg_nbaactp19) - -struct BurnDriver BurnDrvgg_nbaactp19 = { - "gg_nbaactp19", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940212)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp19RomInfo, gg_nbaactp19RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19941215) - -static struct BurnRomInfo gg_nbaactp18RomDesc[] = { - { "nba action starring david robinson (prototype - feb 15, 1994).bin", 0x40000, 0xe73b02a4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp18) -STD_ROM_FN(gg_nbaactp18) - -struct BurnDriver BurnDrvgg_nbaactp18 = { - "gg_nbaactp18", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19941215)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp18RomInfo, gg_nbaactp18RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940217) - -static struct BurnRomInfo gg_nbaactp17RomDesc[] = { - { "nba action starring david robinson (prototype - feb 17, 1994).bin", 0x40000, 0xc4b3328c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp17) -STD_ROM_FN(gg_nbaactp17) - -struct BurnDriver BurnDrvgg_nbaactp17 = { - "gg_nbaactp17", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940217)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp17RomInfo, gg_nbaactp17RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940220) - -static struct BurnRomInfo gg_nbaactp16RomDesc[] = { - { "nba action starring david robinson (prototype - feb 20, 1994).bin", 0x40000, 0x91e3026c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp16) -STD_ROM_FN(gg_nbaactp16) - -struct BurnDriver BurnDrvgg_nbaactp16 = { - "gg_nbaactp16", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940220)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp16RomInfo, gg_nbaactp16RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940221) - -static struct BurnRomInfo gg_nbaactp15RomDesc[] = { - { "nba action starring david robinson (prototype - feb 21, 1994).bin", 0x40000, 0x9265f8c3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp15) -STD_ROM_FN(gg_nbaactp15) - -struct BurnDriver BurnDrvgg_nbaactp15 = { - "gg_nbaactp15", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940221)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp15RomInfo, gg_nbaactp15RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940224) - -static struct BurnRomInfo gg_nbaactp14RomDesc[] = { - { "nba action starring david robinson (prototype - feb 24, 1994).bin", 0x40000, 0x21a79f63, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp14) -STD_ROM_FN(gg_nbaactp14) - -struct BurnDriver BurnDrvgg_nbaactp14 = { - "gg_nbaactp14", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940224)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp14RomInfo, gg_nbaactp14RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940225-B) - -static struct BurnRomInfo gg_nbaactp13RomDesc[] = { - { "nba action starring david robinson (prototype - feb 25, 1994 - b).bin", 0x40000, 0x188a319e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp13) -STD_ROM_FN(gg_nbaactp13) - -struct BurnDriver BurnDrvgg_nbaactp13 = { - "gg_nbaactp13", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940225-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp13RomInfo, gg_nbaactp13RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940225) - -static struct BurnRomInfo gg_nbaactp12RomDesc[] = { - { "nba action starring david robinson (prototype - feb 25, 1994).bin", 0x40000, 0xafc8a69e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp12) -STD_ROM_FN(gg_nbaactp12) - -struct BurnDriver BurnDrvgg_nbaactp12 = { - "gg_nbaactp12", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940225)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp12RomInfo, gg_nbaactp12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940226) - -static struct BurnRomInfo gg_nbaactp11RomDesc[] = { - { "nba action starring david robinson (prototype - feb 26, 1994).bin", 0x40000, 0x6896b65d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp11) -STD_ROM_FN(gg_nbaactp11) - -struct BurnDriver BurnDrvgg_nbaactp11 = { - "gg_nbaactp11", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940226)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp11RomInfo, gg_nbaactp11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940227) - -static struct BurnRomInfo gg_nbaactp10RomDesc[] = { - { "nba action starring david robinson (prototype - feb 27, 1994).bin", 0x40000, 0xab721f11, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp10) -STD_ROM_FN(gg_nbaactp10) - -struct BurnDriver BurnDrvgg_nbaactp10 = { - "gg_nbaactp10", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940227)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp10RomInfo, gg_nbaactp10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940228) - -static struct BurnRomInfo gg_nbaactp09RomDesc[] = { - { "nba action starring david robinson (prototype - feb 28, 1994).bin", 0x40000, 0x82e882d6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp09) -STD_ROM_FN(gg_nbaactp09) - -struct BurnDriver BurnDrvgg_nbaactp09 = { - "gg_nbaactp09", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940228)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp09RomInfo, gg_nbaactp09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940104) - -static struct BurnRomInfo gg_nbaactp28RomDesc[] = { - { "nba action starring david robinson (prototype - jan 04, 1994).bin", 0x40000, 0xc658b5b3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp28) -STD_ROM_FN(gg_nbaactp28) - -struct BurnDriver BurnDrvgg_nbaactp28 = { - "gg_nbaactp28", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940104)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp28RomInfo, gg_nbaactp28RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940106) - -static struct BurnRomInfo gg_nbaactp27RomDesc[] = { - { "nba action starring david robinson (prototype - jan 06, 1994).bin", 0x40000, 0x41dabd84, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp27) -STD_ROM_FN(gg_nbaactp27) - -struct BurnDriver BurnDrvgg_nbaactp27 = { - "gg_nbaactp27", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940106)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp27RomInfo, gg_nbaactp27RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940110) - -static struct BurnRomInfo gg_nbaactp26RomDesc[] = { - { "nba action starring david robinson (prototype - jan 10, 1994).bin", 0x40000, 0xa34b2b4c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp26) -STD_ROM_FN(gg_nbaactp26) - -struct BurnDriver BurnDrvgg_nbaactp26 = { - "gg_nbaactp26", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940110)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp26RomInfo, gg_nbaactp26RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940124) - -static struct BurnRomInfo gg_nbaactp25RomDesc[] = { - { "nba action starring david robinson (prototype - jan 24, 1994).bin", 0x40000, 0x9824f77d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp25) -STD_ROM_FN(gg_nbaactp25) - -struct BurnDriver BurnDrvgg_nbaactp25 = { - "gg_nbaactp25", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940124)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp25RomInfo, gg_nbaactp25RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19940129) - -static struct BurnRomInfo gg_nbaactp24RomDesc[] = { - { "nba action starring david robinson (prototype - jan 29, 1994).bin", 0x40000, 0x0d6bf79d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp24) -STD_ROM_FN(gg_nbaactp24) - -struct BurnDriver BurnDrvgg_nbaactp24 = { - "gg_nbaactp24", "gg_nbaact", NULL, NULL, "1994", - "NBA Action Starring David Robinson (Prototype, 19940129)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp24RomInfo, gg_nbaactp24RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19931201) - -static struct BurnRomInfo gg_nbaactp29RomDesc[] = { - { "nba action starring david robinson (prototype - dec 01, 1993).bin", 0x40000, 0x8c089da5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp29) -STD_ROM_FN(gg_nbaactp29) - -struct BurnDriver BurnDrvgg_nbaactp29 = { - "gg_nbaactp29", "gg_nbaact", NULL, NULL, "1993", - "NBA Action Starring David Robinson (Prototype, 19931201)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp29RomInfo, gg_nbaactp29RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Action Starring David Robinson (Prototype, 19931128) - -static struct BurnRomInfo gg_nbaactp30RomDesc[] = { - { "nba action starring david robinson (prototype - nov 28, 1993).bin", 0x40000, 0x31084021, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbaactp30) -STD_ROM_FN(gg_nbaactp30) - -struct BurnDriver BurnDrvgg_nbaactp30 = { - "gg_nbaactp30", "gg_nbaact", NULL, NULL, "1993", - "NBA Action Starring David Robinson (Prototype, 19931128)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbaactp30RomInfo, gg_nbaactp30RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Jam (Jpn) - -static struct BurnRomInfo gg_nbajamjRomDesc[] = { - { "nba jam (japan).bin", 0x80000, 0xa49e9033, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbajamj) -STD_ROM_FN(gg_nbajamj) - -struct BurnDriver BurnDrvgg_nbajamj = { - "gg_nbajamj", "gg_nbajam", NULL, NULL, "1994", - "NBA Jam (Jpn)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbajamjRomInfo, gg_nbajamjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Jam (USA, v1.1) - -static struct BurnRomInfo gg_nbajamRomDesc[] = { - { "nba jam (usa) (v1.1).bin", 0x80000, 0x820fa4ab, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbajam) -STD_ROM_FN(gg_nbajam) - -struct BurnDriver BurnDrvgg_nbajam = { - "gg_nbajam", NULL, NULL, NULL, "1993", - "NBA Jam (USA, v1.1)\0", NULL, "Arena", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbajamRomInfo, gg_nbajamRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Jam (Euro, USA) - -static struct BurnRomInfo gg_nbajam1RomDesc[] = { - { "mpr-16421-s.ic1", 0x80000, 0x8f17597e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbajam1) -STD_ROM_FN(gg_nbajam1) - -struct BurnDriver BurnDrvgg_nbajam1 = { - "gg_nbajam1", "gg_nbajam", NULL, NULL, "1993", - "NBA Jam (Euro, USA)\0", NULL, "Arena", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbajam1RomInfo, gg_nbajam1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NBA Jam Tournament Edition (World) - -static struct BurnRomInfo gg_nbajamteRomDesc[] = { - { "mpr-17625.ic1", 0x80000, 0x86c32e5b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nbajamte) -STD_ROM_FN(gg_nbajamte) - -struct BurnDriver BurnDrvgg_nbajamte = { - "gg_nbajamte", NULL, NULL, NULL, "1994", - "NBA Jam Tournament Edition (World)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nbajamteRomInfo, gg_nbajamteRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pet Club Neko Daisuki! (Jpn) - -static struct BurnRomInfo gg_nekodaisRomDesc[] = { - { "neko daisuki! (japan).bin", 0x80000, 0x3679be80, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nekodais) -STD_ROM_FN(gg_nekodais) - -struct BurnDriver BurnDrvgg_nekodais = { - "gg_nekodais", NULL, NULL, NULL, "1996", - "Pet Club Neko Daisuki! (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nekodaisRomInfo, gg_nekodaisRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (USA) - -static struct BurnRomInfo gg_nfl95RomDesc[] = { - { "nfl '95 (usa).bin", 0x80000, 0xdc5b0407, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95) -STD_ROM_FN(gg_nfl95) - -struct BurnDriver BurnDrvgg_nfl95 = { - "gg_nfl95", NULL, NULL, NULL, "1994", - "NFL '95 (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95RomInfo, gg_nfl95RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940808) - -static struct BurnRomInfo gg_nfl95p13RomDesc[] = { - { "nfl '95 (prototype - aug 08, 1994).bin", 0x80000, 0x8cd96d95, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p13) -STD_ROM_FN(gg_nfl95p13) - -struct BurnDriver BurnDrvgg_nfl95p13 = { - "gg_nfl95p13", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940808)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p13RomInfo, gg_nfl95p13RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940825-A) - -static struct BurnRomInfo gg_nfl95p12RomDesc[] = { - { "nfl '95 (prototype - aug 25, 1994 - a).bin", 0x80000, 0x7f769052, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p12) -STD_ROM_FN(gg_nfl95p12) - -struct BurnDriver BurnDrvgg_nfl95p12 = { - "gg_nfl95p12", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940825-A)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p12RomInfo, gg_nfl95p12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940825) - -static struct BurnRomInfo gg_nfl95p11RomDesc[] = { - { "nfl '95 (prototype - aug 25, 1994).bin", 0x80000, 0xfe140eaa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p11) -STD_ROM_FN(gg_nfl95p11) - -struct BurnDriver BurnDrvgg_nfl95p11 = { - "gg_nfl95p11", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940825)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p11RomInfo, gg_nfl95p11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940826) - -static struct BurnRomInfo gg_nfl95p10RomDesc[] = { - { "nfl '95 (prototype - aug 26, 1994).bin", 0x80000, 0xf77138dd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p10) -STD_ROM_FN(gg_nfl95p10) - -struct BurnDriver BurnDrvgg_nfl95p10 = { - "gg_nfl95p10", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940826)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p10RomInfo, gg_nfl95p10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940831) - -static struct BurnRomInfo gg_nfl95p09RomDesc[] = { - { "nfl '95 (prototype - aug 31, 1994).bin", 0x80000, 0xa3b046e7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p09) -STD_ROM_FN(gg_nfl95p09) - -struct BurnDriver BurnDrvgg_nfl95p09 = { - "gg_nfl95p09", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940831)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p09RomInfo, gg_nfl95p09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940902) - -static struct BurnRomInfo gg_nfl95p08RomDesc[] = { - { "nfl '95 (prototype - sep 02, 1994).bin", 0x80000, 0x3978387b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p08) -STD_ROM_FN(gg_nfl95p08) - -struct BurnDriver BurnDrvgg_nfl95p08 = { - "gg_nfl95p08", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940902)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p08RomInfo, gg_nfl95p08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940908) - -static struct BurnRomInfo gg_nfl95p07RomDesc[] = { - { "nfl '95 (prototype - sep 08, 1994).bin", 0x80000, 0xff70a26f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p07) -STD_ROM_FN(gg_nfl95p07) - -struct BurnDriver BurnDrvgg_nfl95p07 = { - "gg_nfl95p07", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940908)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p07RomInfo, gg_nfl95p07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940910) - -static struct BurnRomInfo gg_nfl95p06RomDesc[] = { - { "nfl '95 (prototype - sep 10, 1994).bin", 0x80000, 0x132db489, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p06) -STD_ROM_FN(gg_nfl95p06) - -struct BurnDriver BurnDrvgg_nfl95p06 = { - "gg_nfl95p06", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940910)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p06RomInfo, gg_nfl95p06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940911-B) - -static struct BurnRomInfo gg_nfl95p05RomDesc[] = { - { "nfl '95 (prototype - sep 11, 1994 - b).bin", 0x80000, 0xc57c6afd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p05) -STD_ROM_FN(gg_nfl95p05) - -struct BurnDriver BurnDrvgg_nfl95p05 = { - "gg_nfl95p05", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940911-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p05RomInfo, gg_nfl95p05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940911-C) - -static struct BurnRomInfo gg_nfl95p04RomDesc[] = { - { "nfl '95 (prototype - sep 11, 1994 - c).bin", 0x80000, 0x088e4b6d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p04) -STD_ROM_FN(gg_nfl95p04) - -struct BurnDriver BurnDrvgg_nfl95p04 = { - "gg_nfl95p04", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940911-C)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p04RomInfo, gg_nfl95p04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940912) - -static struct BurnRomInfo gg_nfl95p03RomDesc[] = { - { "nfl '95 (prototype - sep 12, 1994).bin", 0x80000, 0xb38f48b6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p03) -STD_ROM_FN(gg_nfl95p03) - -struct BurnDriver BurnDrvgg_nfl95p03 = { - "gg_nfl95p03", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940912)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p03RomInfo, gg_nfl95p03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940914-F) - -static struct BurnRomInfo gg_nfl95p02RomDesc[] = { - { "nfl '95 (prototype - sep 14, 1994 - f).bin", 0x80000, 0x2828cb66, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p02) -STD_ROM_FN(gg_nfl95p02) - -struct BurnDriver BurnDrvgg_nfl95p02 = { - "gg_nfl95p02", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940914-F)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p02RomInfo, gg_nfl95p02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL '95 (Prototype, 19940914) - -static struct BurnRomInfo gg_nfl95p01RomDesc[] = { - { "nfl '95 (prototype - sep 14, 1994).bin", 0x80000, 0x474a162b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nfl95p01) -STD_ROM_FN(gg_nfl95p01) - -struct BurnDriver BurnDrvgg_nfl95p01 = { - "gg_nfl95p01", "gg_nfl95", NULL, NULL, "1994", - "NFL '95 (Prototype, 19940914)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nfl95p01RomInfo, gg_nfl95p01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL Quarterback Club '96 (Euro, USA) - -static struct BurnRomInfo gg_nflqb96RomDesc[] = { - { "nfl quarterback club '96 (usa, europe).bin", 0x80000, 0xc348e53a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nflqb96) -STD_ROM_FN(gg_nflqb96) - -struct BurnDriver BurnDrvgg_nflqb96 = { - "gg_nflqb96", NULL, NULL, NULL, "1995", - "NFL Quarterback Club '96 (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nflqb96RomInfo, gg_nflqb96RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NFL Quarterback Club (World) - -static struct BurnRomInfo gg_nflqbRomDesc[] = { - { "nfl quarterback club (world).bin", 0x80000, 0x61785ed5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nflqb) -STD_ROM_FN(gg_nflqb) - -struct BurnDriver BurnDrvgg_nflqb = { - "gg_nflqb", NULL, NULL, NULL, "1994", - "NFL Quarterback Club (World)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nflqbRomInfo, gg_nflqbRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (USA) - -static struct BurnRomInfo gg_nhlasRomDesc[] = { - { "nhl all-star hockey (usa).bin", 0x80000, 0x4680c7aa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlas) -STD_ROM_FN(gg_nhlas) - -struct BurnDriver BurnDrvgg_nhlas = { - "gg_nhlas", NULL, NULL, NULL, "1995", - "NHL All-Star Hockey (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasRomInfo, gg_nhlasRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19941215) - -static struct BurnRomInfo gg_nhlasp17RomDesc[] = { - { "nhl all-star hockey (prototype - dec 15, 1994).bin", 0x80000, 0xe583d999, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp17) -STD_ROM_FN(gg_nhlasp17) - -struct BurnDriver BurnDrvgg_nhlasp17 = { - "gg_nhlasp17", "gg_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey (Prototype, 19941215)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp17RomInfo, gg_nhlasp17RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19941222) - -static struct BurnRomInfo gg_nhlasp16RomDesc[] = { - { "nhl all-star hockey (prototype - dec 22, 1994).bin", 0x80000, 0xdfba792a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp16) -STD_ROM_FN(gg_nhlasp16) - -struct BurnDriver BurnDrvgg_nhlasp16 = { - "gg_nhlasp16", "gg_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey (Prototype, 19941222)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp16RomInfo, gg_nhlasp16RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19941229) - -static struct BurnRomInfo gg_nhlasp15RomDesc[] = { - { "nhl all-star hockey (prototype - dec 29, 1994).bin", 0x80000, 0xe14d071b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp15) -STD_ROM_FN(gg_nhlasp15) - -struct BurnDriver BurnDrvgg_nhlasp15 = { - "gg_nhlasp15", "gg_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey (Prototype, 19941229)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp15RomInfo, gg_nhlasp15RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19941231) - -static struct BurnRomInfo gg_nhlasp14RomDesc[] = { - { "nhl all-star hockey (prototype - dec 31, 1994).bin", 0x80000, 0x8a2b6323, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp14) -STD_ROM_FN(gg_nhlasp14) - -struct BurnDriver BurnDrvgg_nhlasp14 = { - "gg_nhlasp14", "gg_nhlas", NULL, NULL, "1994", - "NHL All-Star Hockey (Prototype, 19941231)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp14RomInfo, gg_nhlasp14RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950102) - -static struct BurnRomInfo gg_nhlasp13RomDesc[] = { - { "nhl all-star hockey (prototype - jan 02, 1995).bin", 0x80000, 0x2551f22c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp13) -STD_ROM_FN(gg_nhlasp13) - -struct BurnDriver BurnDrvgg_nhlasp13 = { - "gg_nhlasp13", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950102)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp13RomInfo, gg_nhlasp13RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950103) - -static struct BurnRomInfo gg_nhlasp12RomDesc[] = { - { "nhl all-star hockey (prototype - jan 03, 1995).bin", 0x80000, 0xece5633b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp12) -STD_ROM_FN(gg_nhlasp12) - -struct BurnDriver BurnDrvgg_nhlasp12 = { - "gg_nhlasp12", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950103)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp12RomInfo, gg_nhlasp12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950107) - -static struct BurnRomInfo gg_nhlasp11RomDesc[] = { - { "nhl all-star hockey (prototype - jan 07, 1995).bin", 0x80000, 0x82504476, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp11) -STD_ROM_FN(gg_nhlasp11) - -struct BurnDriver BurnDrvgg_nhlasp11 = { - "gg_nhlasp11", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950107)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp11RomInfo, gg_nhlasp11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950111) - -static struct BurnRomInfo gg_nhlasp10RomDesc[] = { - { "nhl all-star hockey (prototype - jan 11, 1995).bin", 0x80000, 0x49f8b9e4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp10) -STD_ROM_FN(gg_nhlasp10) - -struct BurnDriver BurnDrvgg_nhlasp10 = { - "gg_nhlasp10", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950111)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp10RomInfo, gg_nhlasp10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950113) - -static struct BurnRomInfo gg_nhlasp09RomDesc[] = { - { "nhl all-star hockey (prototype - jan 13, 1995).bin", 0x80000, 0x87d8fe13, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp09) -STD_ROM_FN(gg_nhlasp09) - -struct BurnDriver BurnDrvgg_nhlasp09 = { - "gg_nhlasp09", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950113)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp09RomInfo, gg_nhlasp09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950116) - -static struct BurnRomInfo gg_nhlasp08RomDesc[] = { - { "nhl all-star hockey (prototype - jan 16, 1995).bin", 0x80000, 0x50dcf5b6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp08) -STD_ROM_FN(gg_nhlasp08) - -struct BurnDriver BurnDrvgg_nhlasp08 = { - "gg_nhlasp08", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950116)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp08RomInfo, gg_nhlasp08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950120) - -static struct BurnRomInfo gg_nhlasp07RomDesc[] = { - { "nhl all-star hockey (prototype - jan 20 ,1995).bin", 0x80000, 0x499b06c2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp07) -STD_ROM_FN(gg_nhlasp07) - -struct BurnDriver BurnDrvgg_nhlasp07 = { - "gg_nhlasp07", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950120)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp07RomInfo, gg_nhlasp07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950121) - -static struct BurnRomInfo gg_nhlasp06RomDesc[] = { - { "nhl all-star hockey (prototype - jan 21, 1995).bin", 0x80000, 0x16af7995, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp06) -STD_ROM_FN(gg_nhlasp06) - -struct BurnDriver BurnDrvgg_nhlasp06 = { - "gg_nhlasp06", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950121)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp06RomInfo, gg_nhlasp06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950124-A) - -static struct BurnRomInfo gg_nhlasp05RomDesc[] = { - { "nhl all-star hockey (prototype - jan 24, 1995 - a).bin", 0x80000, 0x0b1c38f4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp05) -STD_ROM_FN(gg_nhlasp05) - -struct BurnDriver BurnDrvgg_nhlasp05 = { - "gg_nhlasp05", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950124-A)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp05RomInfo, gg_nhlasp05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950124-B) - -static struct BurnRomInfo gg_nhlasp04RomDesc[] = { - { "nhl all-star hockey (prototype - jan 24, 1995 - b).bin", 0x80000, 0x0a4a6830, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp04) -STD_ROM_FN(gg_nhlasp04) - -struct BurnDriver BurnDrvgg_nhlasp04 = { - "gg_nhlasp04", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950124-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp04RomInfo, gg_nhlasp04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950124-C) - -static struct BurnRomInfo gg_nhlasp03RomDesc[] = { - { "nhl all-star hockey (prototype - jan 24, 1995 - c).bin", 0x80000, 0x54f5efb2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp03) -STD_ROM_FN(gg_nhlasp03) - -struct BurnDriver BurnDrvgg_nhlasp03 = { - "gg_nhlasp03", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950124-C)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp03RomInfo, gg_nhlasp03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950124) - -static struct BurnRomInfo gg_nhlasp02RomDesc[] = { - { "nhl all-star hockey (prototype - jan 24, 1995).bin", 0x80000, 0x74be3c4c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp02) -STD_ROM_FN(gg_nhlasp02) - -struct BurnDriver BurnDrvgg_nhlasp02 = { - "gg_nhlasp02", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950124)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp02RomInfo, gg_nhlasp02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL All-Star Hockey (Prototype, 19950125) - -static struct BurnRomInfo gg_nhlasp01RomDesc[] = { - { "nhl all-star hockey (prototype - jan 25, 1995).bin", 0x80000, 0xa587b13e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhlasp01) -STD_ROM_FN(gg_nhlasp01) - -struct BurnDriver BurnDrvgg_nhlasp01 = { - "gg_nhlasp01", "gg_nhlas", NULL, NULL, "1995", - "NHL All-Star Hockey (Prototype, 19950125)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlasp01RomInfo, gg_nhlasp01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// NHL Hockey (Euro, USA) - -static struct BurnRomInfo gg_nhlRomDesc[] = { - { "mpr-17850-s.ic1", 0x80000, 0x658713a5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nhl) -STD_ROM_FN(gg_nhl) - -struct BurnDriver BurnDrvgg_nhl = { - "gg_nhl", NULL, NULL, NULL, "1995", - "NHL Hockey (Euro, USA)\0", NULL, "Electronic Arts", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nhlRomInfo, gg_nhlRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ninja Gaiden (Jpn) - -static struct BurnRomInfo gg_ngaidenjRomDesc[] = { - { "ninja gaiden (japan).bin", 0x20000, 0x20ef017a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ngaidenj) -STD_ROM_FN(gg_ngaidenj) - -struct BurnDriver BurnDrvgg_ngaidenj = { - "gg_ngaidenj", "gg_ngaiden", NULL, NULL, "1991", - "Ninja Gaiden (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ngaidenjRomInfo, gg_ngaidenjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ninja Gaiden (Euro, USA) - -static struct BurnRomInfo gg_ngaidenRomDesc[] = { - { "ninja gaiden (usa, europe).bin", 0x20000, 0xc578756b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ngaiden) -STD_ROM_FN(gg_ngaiden) - -struct BurnDriver BurnDrvgg_ngaiden = { - "gg_ngaiden", NULL, NULL, NULL, "1991", - "Ninja Gaiden (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ngaidenRomInfo, gg_ngaidenRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ninku (Jpn) - -static struct BurnRomInfo gg_ninkuRomDesc[] = { - { "mpr-18000.ic1", 0x80000, 0xc3056e15, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ninku) -STD_ROM_FN(gg_ninku) - -struct BurnDriver BurnDrvgg_ninku = { - "gg_ninku", NULL, NULL, NULL, "1995", - "Ninku (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ninkuRomInfo, gg_ninkuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ninku 2 - Tenkuuryuu e no Michi (Jpn) - -static struct BurnRomInfo gg_ninku2RomDesc[] = { - { "mpr-18695.ic1", 0x80000, 0x06247dd2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ninku2) -STD_ROM_FN(gg_ninku2) - -struct BurnDriver BurnDrvgg_ninku2 = { - "gg_ninku2", NULL, NULL, NULL, "1995", - "Ninku 2 - Tenkuuryuu e no Michi (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ninku2RomInfo, gg_ninku2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ninku Gaiden - Hiroyuki Daikatsugeki (Jpn) - -static struct BurnRomInfo gg_ninkugRomDesc[] = { - { "mpr-18313.ic1", 0x80000, 0x9140f239, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ninkug) -STD_ROM_FN(gg_ninkug) - -struct BurnDriver BurnDrvgg_ninkug = { - "gg_ninkug", NULL, NULL, NULL, "1995", - "Ninku Gaiden - Hiroyuki Daikatsugeki (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ninkugRomInfo, gg_ninkugRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Nomo's World Series Baseball (Jpn) - -static struct BurnRomInfo gg_nomowsbRomDesc[] = { - { "mpr-18562.ic1", 0x80000, 0x4ed45bda, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_nomowsb) -STD_ROM_FN(gg_nomowsb) - -struct BurnDriver BurnDrvgg_nomowsb = { - "gg_nomowsb", NULL, NULL, NULL, "1995", - "Nomo's World Series Baseball (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_nomowsbRomInfo, gg_nomowsbRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Olympic Gold (Euro, v1, SMS Mode) - -static struct BurnRomInfo gg_olympgldRomDesc[] = { - { "mpr-14752-f.ic1", 0x40000, 0x1d93246e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_olympgld) -STD_ROM_FN(gg_olympgld) - -struct BurnDriver BurnDrvgg_olympgld = { - "gg_olympgld", NULL, NULL, NULL, "1992", - "Olympic Gold (Euro, v1, SMS Mode)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_olympgldRomInfo, gg_olympgldRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Olympic Gold (Jpn, USA, v0, SMS Mode) - -static struct BurnRomInfo gg_olympgldaRomDesc[] = { - { "olympic gold (japan, usa) (en,fr,de,es,it,nl,pt,sv).bin", 0x40000, 0xa2f9c7af, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_olympglda) -STD_ROM_FN(gg_olympglda) - -struct BurnDriver BurnDrvgg_olympglda = { - "gg_olympglda", "gg_olympgld", NULL, NULL, "1992", - "Olympic Gold (Jpn, USA, v0, SMS Mode)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_olympgldaRomInfo, gg_olympgldaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Ottifants (Euro) - -static struct BurnRomInfo gg_ottifantRomDesc[] = { - { "ottifants, the (europe) (en,fr,de,es,it).bin", 0x40000, 0x1e673168, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ottifant) -STD_ROM_FN(gg_ottifant) - -struct BurnDriver BurnDrvgg_ottifant = { - "gg_ottifant", NULL, NULL, NULL, "1992", - "The Ottifants (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ottifantRomInfo, gg_ottifantRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Out Run (Jpn) - -static struct BurnRomInfo gg_outrunjRomDesc[] = { - { "out run (japan).bin", 0x20000, 0xd58cb27c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_outrunj) -STD_ROM_FN(gg_outrunj) - -struct BurnDriver BurnDrvgg_outrunj = { - "gg_outrunj", "gg_outrun", NULL, NULL, "1991", - "Out Run (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_outrunjRomInfo, gg_outrunjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Out Run (Euro) - -static struct BurnRomInfo gg_outrunRomDesc[] = { - { "out run.bin", 0x20000, 0x9014b322, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_outrun) -STD_ROM_FN(gg_outrun) - -struct BurnDriver BurnDrvgg_outrun = { - "gg_outrun", NULL, NULL, NULL, "1991", - "Out Run (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_outrunRomInfo, gg_outrunRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Out Run Europa (Euro, Bra, SMS Mode) - -static struct BurnRomInfo gg_outrneurRomDesc[] = { - { "out run europa (euro).bin", 0x40000, 0x01eab89d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_outrneur) -STD_ROM_FN(gg_outrneur) - -struct BurnDriver BurnDrvgg_outrneur = { - "gg_outrneur", NULL, NULL, NULL, "1992", - "Out Run Europa (Euro, Bra, SMS Mode)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_outrneurRomInfo, gg_outrneurRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Out Run Europa (USA, SMS Mode) - -static struct BurnRomInfo gg_outrneuruRomDesc[] = { - { "out run europa (usa).bin", 0x40000, 0xf037ec00, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_outrneuru) -STD_ROM_FN(gg_outrneuru) - -struct BurnDriver BurnDrvgg_outrneuru = { - "gg_outrneuru", "gg_outrneur", NULL, NULL, "1992", - "Out Run Europa (USA, SMS Mode)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_outrneuruRomInfo, gg_outrneuruRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pac-Attack (Euro, USA) - -static struct BurnRomInfo gg_pacattakRomDesc[] = { - { "pac-attack (usa, europe).bin", 0x20000, 0x9273ee2c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pacattak) -STD_ROM_FN(gg_pacattak) - -struct BurnDriver BurnDrvgg_pacattak = { - "gg_pacattak", NULL, NULL, NULL, "1994", - "Pac-Attack (Euro, USA)\0", NULL, "Namco", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pacattakRomInfo, gg_pacattakRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pac-In-Time (Prototype) - -static struct BurnRomInfo gg_pacintimRomDesc[] = { - { "pac-in-time (unknown) (proto).bin", 0x40000, 0x64c28e20, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pacintim) -STD_ROM_FN(gg_pacintim) - -struct BurnDriver BurnDrvgg_pacintim = { - "gg_pacintim", NULL, NULL, NULL, "199?", - "Pac-In-Time (Prototype)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pacintimRomInfo, gg_pacintimRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pac-Man (Jpn) - -static struct BurnRomInfo gg_pacmanjRomDesc[] = { - { "mpr-13660.ic1", 0x20000, 0xa16c5e58, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pacmanj) -STD_ROM_FN(gg_pacmanj) - -struct BurnDriver BurnDrvgg_pacmanj = { - "gg_pacmanj", "gg_pacman", NULL, NULL, "1991", - "Pac-Man (Jpn)\0", NULL, "Namcot", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pacmanjRomInfo, gg_pacmanjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pac-Man (USA) - -static struct BurnRomInfo gg_pacmanRomDesc[] = { - { "pac-man (usa).bin", 0x20000, 0xb318dd37, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pacman) -STD_ROM_FN(gg_pacman) - -struct BurnDriver BurnDrvgg_pacman = { - "gg_pacman", NULL, NULL, NULL, "1991", - "Pac-Man (USA)\0", NULL, "Namco", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pacmanRomInfo, gg_pacmanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Panzer Dragoon Mini (Jpn) - -static struct BurnRomInfo gg_panzerRomDesc[] = { - { "panzer dragoon mini (japan).bin", 0x80000, 0xe9783cea, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_panzer) -STD_ROM_FN(gg_panzer) - -struct BurnDriver BurnDrvgg_panzer = { - "gg_panzer", NULL, NULL, NULL, "1996", - "Panzer Dragoon Mini (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_panzerRomInfo, gg_panzerRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Paperboy (Euro, USA) - -static struct BurnRomInfo gg_paperboyRomDesc[] = { - { "paperboy (usa, europe).bin", 0x20000, 0xf54b6803, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_paperboy) -STD_ROM_FN(gg_paperboy) - -struct BurnDriver BurnDrvgg_paperboy = { - "gg_paperboy", NULL, NULL, NULL, "1991", - "Paperboy (Euro, USA)\0", NULL, "Tengen", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_paperboyRomInfo, gg_paperboyRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Paperboy II (Euro, USA) - -static struct BurnRomInfo gg_paperbo2RomDesc[] = { - { "paperboy ii (usa, europe).bin", 0x40000, 0x8b2c454b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_paperbo2) -STD_ROM_FN(gg_paperbo2) - -struct BurnDriver BurnDrvgg_paperbo2 = { - "gg_paperbo2", NULL, NULL, NULL, "1992", - "Paperboy II (Euro, USA)\0", NULL, "Tengen", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_paperbo2RomInfo, gg_paperbo2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pengo (Jpn) - -static struct BurnRomInfo gg_pengojRomDesc[] = { - { "pengo (japan).bin", 0x08000, 0xce863dba, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pengoj) -STD_ROM_FN(gg_pengoj) - -struct BurnDriver BurnDrvgg_pengoj = { - "gg_pengoj", "gg_pengo", NULL, NULL, "1990", - "Pengo (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pengojRomInfo, gg_pengojRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pengo (Euro, USA) - -static struct BurnRomInfo gg_pengoRomDesc[] = { - { "mpr-13804-s.ic1", 0x08000, 0x0da23cc1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pengo) -STD_ROM_FN(gg_pengo) - -struct BurnDriver BurnDrvgg_pengo = { - "gg_pengo", NULL, NULL, NULL, "1991", - "Pengo (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pengoRomInfo, gg_pengoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pet Club Inu Daisuki! (Jpn) - -static struct BurnRomInfo gg_inudaisRomDesc[] = { - { "pet club inu daisuki! (japan).bin", 0x80000, 0xb42d8430, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_inudais) -STD_ROM_FN(gg_inudais) - -struct BurnDriver BurnDrvgg_inudais = { - "gg_inudais", NULL, NULL, NULL, "1996", - "Pet Club Inu Daisuki! (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_inudaisRomInfo, gg_inudaisRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pete Sampras Tennis (Euro) - -static struct BurnRomInfo gg_samprasRomDesc[] = { - { "pete sampras tennis (europe).bin", 0x40000, 0xc1756bee, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sampras) -STD_ROM_FN(gg_sampras) - -struct BurnDriver BurnDrvgg_sampras = { - "gg_sampras", NULL, NULL, NULL, "1994", - "Pete Sampras Tennis (Euro)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES, GBF_MISC, 0, - GGGetZipName, gg_samprasRomInfo, gg_samprasRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// PGA Tour 96 (Euro, USA) - -static struct BurnRomInfo gg_pga96RomDesc[] = { - { "pga tour 96 (usa, europe).bin", 0x80000, 0x542b6d8e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pga96) -STD_ROM_FN(gg_pga96) - -struct BurnDriver BurnDrvgg_pga96 = { - "gg_pga96", NULL, NULL, NULL, "1996", - "PGA Tour 96 (Euro, USA)\0", NULL, "Black Pearl", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pga96RomInfo, gg_pga96RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// PGA Tour Golf (USA, v1.1) - -static struct BurnRomInfo gg_pgatourRomDesc[] = { - { "pga tour golf (usa) (v1.1).bin", 0x40000, 0x1c77d996, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pgatour) -STD_ROM_FN(gg_pgatour) - -struct BurnDriver BurnDrvgg_pgatour = { - "gg_pgatour", NULL, NULL, NULL, "1994", - "PGA Tour Golf (USA, v1.1)\0", NULL, "Electronic Arts?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pgatourRomInfo, gg_pgatourRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// PGA Tour Golf (Euro, USA) - -static struct BurnRomInfo gg_pgatourtRomDesc[] = { - { "mpr-16044.ic1", 0x40000, 0x9700bb65, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pgatourt) -STD_ROM_FN(gg_pgatourt) - -struct BurnDriver BurnDrvgg_pgatourt = { - "gg_pgatourt", NULL, NULL, NULL, "1991", - "PGA Tour Golf (Euro, USA)\0", NULL, "Tengen", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pgatourtRomInfo, gg_pgatourtRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// PGA Tour Golf II (Euro, USA) - -static struct BurnRomInfo gg_pgatour2RomDesc[] = { - { "mpr-17319-s.ic1", 0x80000, 0x4a8ac851, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pgatour2) -STD_ROM_FN(gg_pgatour2) - -struct BurnDriver BurnDrvgg_pgatour2 = { - "gg_pgatour2", NULL, NULL, NULL, "1992", - "PGA Tour Golf II (Euro, USA)\0", NULL, "Time Warner Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pgatour2RomInfo, gg_pgatour2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Phantasy Star Adventure (Jpn) - -static struct BurnRomInfo gg_pstaradvRomDesc[] = { - { "phantasy star adventure (japan).bin", 0x20000, 0x1a51579d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pstaradv) -STD_ROM_FN(gg_pstaradv) - -struct BurnDriver BurnDrvgg_pstaradv = { - "gg_pstaradv", NULL, NULL, NULL, "1992", - "Phantasy Star Adventure (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pstaradvRomInfo, gg_pstaradvRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Phantasy Star Gaiden (Jpn) - -static struct BurnRomInfo gg_pstargdnRomDesc[] = { - { "phantasy star gaiden (japan).bin", 0x40000, 0xa942514a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pstargdn) -STD_ROM_FN(gg_pstargdn) - -struct BurnDriver BurnDrvgg_pstargdn = { - "gg_pstargdn", NULL, NULL, NULL, "1992", - "Phantasy Star Gaiden (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pstargdnRomInfo, gg_pstargdnRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Phantom 2040 (Euro, USA) - -static struct BurnRomInfo gg_phantomRomDesc[] = { - { "phantom 2040 (usa, europe).bin", 0x80000, 0x281b1c3a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_phantom) -STD_ROM_FN(gg_phantom) - -struct BurnDriver BurnDrvgg_phantom = { - "gg_phantom", NULL, NULL, NULL, "1995", - "Phantom 2040 (Euro, USA)\0", NULL, "Viacom New Media", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_phantomRomInfo, gg_phantomRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pinball Dreams (USA) - -static struct BurnRomInfo gg_pbdreamsRomDesc[] = { - { "pinball dreams (usa).bin", 0x20000, 0x635c483a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pbdreams) -STD_ROM_FN(gg_pbdreams) - -struct BurnDriver BurnDrvgg_pbdreams = { - "gg_pbdreams", NULL, NULL, NULL, "1993", - "Pinball Dreams (USA)\0", NULL, "GameTek", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pbdreamsRomInfo, gg_pbdreamsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pocket Jansou (Jpn) - -static struct BurnRomInfo gg_pocketjRomDesc[] = { - { "pocket jansou (japan).bin", 0x20000, 0xcc90c723, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pocketj) -STD_ROM_FN(gg_pocketj) - -struct BurnDriver BurnDrvgg_pocketj = { - "gg_pocketj", NULL, NULL, NULL, "1992", - "Pocket Jansou (Jpn)\0", NULL, "Namcot", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pocketjRomInfo, gg_pocketjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Poker Face Paul's Blackjack (USA) - -static struct BurnRomInfo gg_pokerfbjRomDesc[] = { - { "poker faced paul's blackjack (usa).bin", 0x20000, 0x89d34067, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pokerfbj) -STD_ROM_FN(gg_pokerfbj) - -struct BurnDriver BurnDrvgg_pokerfbj = { - "gg_pokerfbj", NULL, NULL, NULL, "1994", - "Poker Face Paul's Blackjack (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pokerfbjRomInfo, gg_pokerfbjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Poker Faced Paul's Gin (USA) - -static struct BurnRomInfo gg_pokerfgRomDesc[] = { - { "poker faced paul's gin (usa).bin", 0x20000, 0xafd61b89, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pokerfg) -STD_ROM_FN(gg_pokerfg) - -struct BurnDriver BurnDrvgg_pokerfg = { - "gg_pokerfg", NULL, NULL, NULL, "1994", - "Poker Faced Paul's Gin (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pokerfgRomInfo, gg_pokerfgRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Poker Face Paul's Poker (USA) - -static struct BurnRomInfo gg_pokerfpRomDesc[] = { - { "poker faced paul's poker (usa).bin", 0x20000, 0xe783daf8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pokerfp) -STD_ROM_FN(gg_pokerfp) - -struct BurnDriver BurnDrvgg_pokerfp = { - "gg_pokerfp", NULL, NULL, NULL, "1994", - "Poker Face Paul's Poker (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pokerfpRomInfo, gg_pokerfpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Poker Face Paul's Solitaire (USA) - -static struct BurnRomInfo gg_pokerfsRomDesc[] = { - { "poker faced paul's solitaire (usa).bin", 0x20000, 0x0e9b0c0a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pokerfs) -STD_ROM_FN(gg_pokerfs) - -struct BurnDriver BurnDrvgg_pokerfs = { - "gg_pokerfs", NULL, NULL, NULL, "1994", - "Poker Face Paul's Solitaire (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pokerfsRomInfo, gg_pokerfsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pop Breaker (Jpn) - -static struct BurnRomInfo gg_popbreakRomDesc[] = { - { "pop breaker (japan).bin", 0x20000, 0x71deba5a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_popbreak) -STD_ROM_FN(gg_popbreak) - -struct BurnDriver BurnDrvgg_popbreak = { - "gg_popbreak", NULL, NULL, NULL, "1991", - "Pop Breaker (Jpn)\0", NULL, "Micro Cabin", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_JAPANESE, GBF_MISC, 0, - GGGetZipName, gg_popbreakRomInfo, gg_popbreakRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Popeye no Beach Volleyball (Jpn) - -static struct BurnRomInfo gg_popeyeRomDesc[] = { - { "popeye no beach volleyball (japan).bin", 0x80000, 0x3ef66810, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_popeye) -STD_ROM_FN(gg_popeye) - -struct BurnDriver BurnDrvgg_popeye = { - "gg_popeye", NULL, NULL, NULL, "1994", - "Popeye no Beach Volleyball (Jpn)\0", NULL, "Technos Japan", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_popeyeRomInfo, gg_popeyeRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Power Drive (Euro) - -static struct BurnRomInfo gg_pdriveRomDesc[] = { - { "power drive (europe).bin", 0x80000, 0xac369ae3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pdrive) -STD_ROM_FN(gg_pdrive) - -struct BurnDriver BurnDrvgg_pdrive = { - "gg_pdrive", NULL, NULL, NULL, "1994", - "Power Drive (Euro)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pdriveRomInfo, gg_pdriveRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Power Strike II (Euro) ~ GG Aleste II (Jpn) - -static struct BurnRomInfo gg_pstrike2RomDesc[] = { - { "power strike ii (japan, europe).bin", 0x40000, 0x09de1528, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pstrike2) -STD_ROM_FN(gg_pstrike2) - -struct BurnDriver BurnDrvgg_pstrike2 = { - "gg_pstrike2", NULL, NULL, NULL, "1993", - "Power Strike II (Euro) ~ GG Aleste II (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pstrike2RomInfo, gg_pstrike2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Predator 2 (Euro, USA, SMS Mode) - -static struct BurnRomInfo gg_predatr2RomDesc[] = { - { "predator 2 (usa, europe).bin", 0x40000, 0xe5f789b9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_predatr2) -STD_ROM_FN(gg_predatr2) - -struct BurnDriver BurnDrvgg_predatr2 = { - "gg_predatr2", NULL, NULL, NULL, "1992", - "Predator 2 (Euro, USA, SMS Mode)\0", NULL, "Arena", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_predatr2RomInfo, gg_predatr2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Primal Rage (Euro, USA) - -static struct BurnRomInfo gg_primalRomDesc[] = { - { "mpr-18181.ic1", 0x80000, 0x2a34b5c7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_primal) -STD_ROM_FN(gg_primal) - -struct BurnDriver BurnDrvgg_primal = { - "gg_primal", NULL, NULL, NULL, "1994", - "Primal Rage (Euro, USA)\0", NULL, "Time Warner Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_primalRomInfo, gg_primalRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Prince of Persia (Euro, SMS Mode) - -static struct BurnRomInfo gg_ppersiaRomDesc[] = { - { "prince of persia (usa, europe) (beta).bin", 0x40000, 0x45f058d6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ppersia) -STD_ROM_FN(gg_ppersia) - -struct BurnDriver BurnDrvgg_ppersia = { - "gg_ppersia", NULL, NULL, NULL, "1992", - "Prince of Persia (Euro, SMS Mode)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_ppersiaRomInfo, gg_ppersiaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Prince of Persia (USA, SMS Mode) - -static struct BurnRomInfo gg_ppersiauRomDesc[] = { - { "prince of persia (usa, europe).bin", 0x40000, 0x311d2863, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ppersiau) -STD_ROM_FN(gg_ppersiau) - -struct BurnDriver BurnDrvgg_ppersiau = { - "gg_ppersiau", "gg_ppersia", NULL, NULL, "1992", - "Prince of Persia (USA, SMS Mode)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_ppersiauRomInfo, gg_ppersiauRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Pro Yakyuu '91 (Jpn) - -static struct BurnRomInfo gg_proyak91RomDesc[] = { - { "pro yakyuu '91, the (japan).bin", 0x20000, 0x6d3a10d3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_proyak91) -STD_ROM_FN(gg_proyak91) - -struct BurnDriver BurnDrvgg_proyak91 = { - "gg_proyak91", NULL, NULL, NULL, "1991", - "The Pro Yakyuu '91 (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_proyak91RomInfo, gg_proyak91RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pro Yakyuu GG League '94 (Jpn) - -static struct BurnRomInfo gg_proyak94RomDesc[] = { - { "pro yakyuu gg league '94 (japan).bin", 0x80000, 0xa1a19135, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_proyak94) -STD_ROM_FN(gg_proyak94) - -struct BurnDriver BurnDrvgg_proyak94 = { - "gg_proyak94", NULL, NULL, NULL, "1994", - "Pro Yakyuu GG League '94 (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_proyak94RomInfo, gg_proyak94RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Pro Yakyuu GG League (Jpn) - -static struct BurnRomInfo gg_proyakggRomDesc[] = { - { "mpr-15564.ic1", 0x40000, 0x2da8e943, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_proyakgg) -STD_ROM_FN(gg_proyakgg) - -struct BurnDriver BurnDrvgg_proyakgg = { - "gg_proyakgg", NULL, NULL, NULL, "1993", - "Pro Yakyuu GG League (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_proyakggRomInfo, gg_proyakggRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Psychic World (Jpn) - -static struct BurnRomInfo gg_psychicwjRomDesc[] = { - { "psychic world (japan).bin", 0x20000, 0xafcc7828, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_psychicwj) -STD_ROM_FN(gg_psychicwj) - -struct BurnDriver BurnDrvgg_psychicwj = { - "gg_psychicwj", "gg_psychicw", NULL, NULL, "1991", - "Psychic World (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_psychicwjRomInfo, gg_psychicwjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Psychic World (Euro, USA, Bra) - -static struct BurnRomInfo gg_psychicwRomDesc[] = { - { "psychic world (usa, europe) (v1.1).bin", 0x20000, 0x73779b22, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_psychicw) -STD_ROM_FN(gg_psychicw) - -struct BurnDriver BurnDrvgg_psychicw = { - "gg_psychicw", NULL, NULL, NULL, "1991", - "Psychic World (Euro, USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_psychicwRomInfo, gg_psychicwRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Putt and Putter (Jpn) - -static struct BurnRomInfo gg_puttputtjRomDesc[] = { - { "putt and putter (japan).bin", 0x20000, 0x407ac070, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_puttputtj) -STD_ROM_FN(gg_puttputtj) - -struct BurnDriver BurnDrvgg_puttputtj = { - "gg_puttputtj", "gg_puttputt", NULL, NULL, "1991", - "Putt and Putter (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_puttputtjRomInfo, gg_puttputtjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Putt and Putter (Euro, USA, Bra) - -static struct BurnRomInfo gg_puttputtRomDesc[] = { - { "putt and putter (usa, europe).bin", 0x20000, 0xecc301dd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_puttputt) -STD_ROM_FN(gg_puttputt) - -struct BurnDriver BurnDrvgg_puttputt = { - "gg_puttputt", NULL, NULL, NULL, "1991", - "Putt and Putter (Euro, USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_puttputtRomInfo, gg_puttputtRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Puyo Puyo (Jpn) - -static struct BurnRomInfo gg_puyopuyoRomDesc[] = { - { "mpr-15464.ic1", 0x40000, 0xd173a06f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_puyopuyo) -STD_ROM_FN(gg_puyopuyo) - -struct BurnDriver BurnDrvgg_puyopuyo = { - "gg_puyopuyo", NULL, NULL, NULL, "1993", - "Puyo Puyo (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_puyopuyoRomInfo, gg_puyopuyoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Puyo Puyo 2 (Jpn) - -static struct BurnRomInfo gg_puyopuy2RomDesc[] = { - { "mpr-17537.ic1", 0x80000, 0x3ab2393b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_puyopuy2) -STD_ROM_FN(gg_puyopuy2) - -struct BurnDriver BurnDrvgg_puyopuy2 = { - "gg_puyopuy2", NULL, NULL, NULL, "1994", - "Puyo Puyo 2 (Jpn)\0", NULL, "Compile", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_puyopuy2RomInfo, gg_puyopuy2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Puzzle and Action Tant~R (Jpn) - -static struct BurnRomInfo gg_tantrRomDesc[] = { - { "mpr-16607.ic1", 0x80000, 0x09151743, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tantr) -STD_ROM_FN(gg_tantr) - -struct BurnDriver BurnDrvgg_tantr = { - "gg_tantr", NULL, NULL, NULL, "1994", - "Puzzle and Action Tant~R (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tantrRomInfo, gg_tantrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Puzzle Bobble (Jpn) - -static struct BurnRomInfo gg_pbobbleRomDesc[] = { - { "puzzle bobble (japan).bin", 0x40000, 0x8e54ee04, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_pbobble) -STD_ROM_FN(gg_pbobble) - -struct BurnDriver BurnDrvgg_pbobble = { - "gg_pbobble", "gg_bam", NULL, NULL, "1996", - "Puzzle Bobble (Jpn)\0", NULL, "Taito", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_pbobbleRomInfo, gg_pbobbleRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Quest for the Shaven Yak Starring Ren Hoëk and Stimpy (Euro, USA) - -static struct BurnRomInfo gg_shavnyakRomDesc[] = { - { "quest for the shaven yak starring ren hoek and stimpy (usa, europe).bin", 0x80000, 0x6c451ee1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shavnyak) -STD_ROM_FN(gg_shavnyak) - -struct BurnDriver BurnDrvgg_shavnyak = { - "gg_shavnyak", NULL, NULL, NULL, "1993", - "Quest for the Shaven Yak Starring Ren Hoek and Stimpy (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shavnyakRomInfo, gg_shavnyakRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Quiz Gear Fight!! (Jpn) - -static struct BurnRomInfo gg_quizgearRomDesc[] = { - { "mpr-17816.ic1", 0x80000, 0x736cdb76, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_quizgear) -STD_ROM_FN(gg_quizgear) - -struct BurnDriver BurnDrvgg_quizgear = { - "gg_quizgear", NULL, NULL, NULL, "1995", - "The Quiz Gear Fight!! (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_quizgearRomInfo, gg_quizgearRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// R.B.I. Baseball '94 (USA) - -static struct BurnRomInfo gg_rbibb94RomDesc[] = { - { "mpr-17310-s.ic1", 0x80000, 0x6dc3295e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_rbibb94) -STD_ROM_FN(gg_rbibb94) - -struct BurnDriver BurnDrvgg_rbibb94 = { - "gg_rbibb94", NULL, NULL, NULL, "1994", - "R.B.I. Baseball '94 (USA)\0", NULL, "Time Warner Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_rbibb94RomInfo, gg_rbibb94RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// R.C. Grand Prix (USA, SMS Mode) - -static struct BurnRomInfo gg_rcgpRomDesc[] = { - { "r.c. grand prix (usa, europe).bin", 0x40000, 0x56201996, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_rcgp) -STD_ROM_FN(gg_rcgp) - -struct BurnDriver BurnDrvgg_rcgp = { - "gg_rcgp", NULL, NULL, NULL, "1992", - "R.C. Grand Prix (USA, SMS Mode)\0", NULL, "Absolute Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_rcgpRomInfo, gg_rcgpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rastan Saga (Jpn, SMS Mode) - -static struct BurnRomInfo gg_rastanRomDesc[] = { - { "rastan saga (japan).bin", 0x40000, 0x9c76fb3a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_rastan) -STD_ROM_FN(gg_rastan) - -struct BurnDriver BurnDrvgg_rastan = { - "gg_rastan", NULL, NULL, NULL, "1991", - "Rastan Saga (Jpn, SMS Mode)\0", NULL, "Taito", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_rastanRomInfo, gg_rastanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Revenge of Drancon (USA, Bra) - -static struct BurnRomInfo gg_revengedRomDesc[] = { - { "revenge of drancon (usa).bin", 0x20000, 0x03e9c607, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_revenged) -STD_ROM_FN(gg_revenged) - -struct BurnDriver BurnDrvgg_revenged = { - "gg_revenged", "gg_wboy", NULL, NULL, "1991", - "Revenge of Drancon (USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_revengedRomInfo, gg_revengedRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Riddick Bowe Boxing (Jpn) - -static struct BurnRomInfo gg_riddickjRomDesc[] = { - { "riddick bowe boxing (japan).bin", 0x40000, 0xa45fffb7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_riddickj) -STD_ROM_FN(gg_riddickj) - -struct BurnDriver BurnDrvgg_riddickj = { - "gg_riddickj", "gg_riddick", NULL, NULL, "1994", - "Riddick Bowe Boxing (Jpn)\0", NULL, "Micronet", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_riddickjRomInfo, gg_riddickjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Riddick Bowe Boxing (USA) - -static struct BurnRomInfo gg_riddickRomDesc[] = { - { "riddick bowe boxing (usa).bin", 0x40000, 0x38d8ec56, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_riddick) -STD_ROM_FN(gg_riddick) - -struct BurnDriver BurnDrvgg_riddick = { - "gg_riddick", NULL, NULL, NULL, "1993", - "Riddick Bowe Boxing (USA)\0", NULL, "Extreme Entertainment Group", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_riddickRomInfo, gg_riddickRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Rise of the Robots (Euro, USA) - -static struct BurnRomInfo gg_riseroboRomDesc[] = { - { "rise of the robots (usa, europe).bin", 0x80000, 0x100b77b2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_riserobo) -STD_ROM_FN(gg_riserobo) - -struct BurnDriver BurnDrvgg_riserobo = { - "gg_riserobo", NULL, NULL, NULL, "1994", - "Rise of the Robots (Euro, USA)\0", NULL, "Time Warner Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_riseroboRomInfo, gg_riseroboRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ristar - The Shooting Star (World) - -static struct BurnRomInfo gg_ristarRomDesc[] = { - { "ristar - the shooting star (world).bin", 0x80000, 0xefe65b3b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ristar) -STD_ROM_FN(gg_ristar) - -struct BurnDriver BurnDrvgg_ristar = { - "gg_ristar", NULL, NULL, NULL, "1995", - "Ristar - The Shooting Star (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ristarRomInfo, gg_ristarRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ristar - The Shooting Star (Prototype, 19941101) - -static struct BurnRomInfo gg_ristarp2RomDesc[] = { - { "ristar (prototype - nov 01, 1994).bin", 0x80000, 0x44fa6ae6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ristarp2) -STD_ROM_FN(gg_ristarp2) - -struct BurnDriver BurnDrvgg_ristarp2 = { - "gg_ristarp2", "gg_ristar", NULL, NULL, "1994", - "Ristar - The Shooting Star (Prototype, 19941101)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ristarp2RomInfo, gg_ristarp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ristar - The Shooting Star (Prototype, 19941102) - -static struct BurnRomInfo gg_ristarp1RomDesc[] = { - { "ristar (prototype - nov 02, 1994).bin", 0x80000, 0x302d2b4b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ristarp1) -STD_ROM_FN(gg_ristarp1) - -struct BurnDriver BurnDrvgg_ristarp1 = { - "gg_ristarp1", "gg_ristar", NULL, NULL, "1994", - "Ristar - The Shooting Star (Prototype, 19941102)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ristarp1RomInfo, gg_ristarp1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ristar - The Shooting Star (Prototype, 19941019) - -static struct BurnRomInfo gg_ristarp4RomDesc[] = { - { "ristar (prototype - oct 19, 1994).bin", 0x80000, 0x672d38d5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ristarp4) -STD_ROM_FN(gg_ristarp4) - -struct BurnDriver BurnDrvgg_ristarp4 = { - "gg_ristarp4", "gg_ristar", NULL, NULL, "1994", - "Ristar - The Shooting Star (Prototype, 19941019)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ristarp4RomInfo, gg_ristarp4RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ristar - The Shooting Star (Prototype, 19941026) - -static struct BurnRomInfo gg_ristarp3RomDesc[] = { - { "ristar (prototype - oct 26, 1994).bin", 0x80000, 0xa302413c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ristarp3) -STD_ROM_FN(gg_ristarp3) - -struct BurnDriver BurnDrvgg_ristarp3 = { - "gg_ristarp3", "gg_ristar", NULL, NULL, "1994", - "Ristar - The Shooting Star (Prototype, 19941026)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ristarp3RomInfo, gg_ristarp3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ristar - The Shooting Star (Prototype, 19940909) - -static struct BurnRomInfo gg_ristarp5RomDesc[] = { - { "ristar (prototype - sep 09, 1994).bin", 0x80000, 0xa1c214bd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ristarp5) -STD_ROM_FN(gg_ristarp5) - -struct BurnDriver BurnDrvgg_ristarp5 = { - "gg_ristarp5", "gg_ristar", NULL, NULL, "1994", - "Ristar - The Shooting Star (Prototype, 19940909)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ristarp5RomInfo, gg_ristarp5RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Road Rash (Euro) - -static struct BurnRomInfo gg_roadrashRomDesc[] = { - { "road rash (eu).bin", 0x80000, 0x176505d4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_roadrash) -STD_ROM_FN(gg_roadrash) - -struct BurnDriver BurnDrvgg_roadrash = { - "gg_roadrash", NULL, NULL, NULL, "1993", - "Road Rash (Euro)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_roadrashRomInfo, gg_roadrashRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Road Rash (USA) - -static struct BurnRomInfo gg_roadrashuRomDesc[] = { - { "road rash (usa).bin", 0x80000, 0x96045f76, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_roadrashu) -STD_ROM_FN(gg_roadrashu) - -struct BurnDriver BurnDrvgg_roadrashu = { - "gg_roadrashu", "gg_roadrash", NULL, NULL, "1993", - "Road Rash (USA)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_roadrashuRomInfo, gg_roadrashuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// RoboCop 3 (World) - -static struct BurnRomInfo gg_robocop3RomDesc[] = { - { "robocop 3 (usa, europe).bin", 0x40000, 0x069a0704, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_robocop3) -STD_ROM_FN(gg_robocop3) - -struct BurnDriver BurnDrvgg_robocop3 = { - "gg_robocop3", NULL, NULL, NULL, "1993", - "RoboCop 3 (World)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_robocop3RomInfo, gg_robocop3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// RoboCop versus The Terminator (Euro, USA) - -static struct BurnRomInfo gg_robotermRomDesc[] = { - { "mpr-16049.ic1", 0x80000, 0x4ab7fa4e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_roboterm) -STD_ROM_FN(gg_roboterm) - -struct BurnDriver BurnDrvgg_roboterm = { - "gg_roboterm", NULL, NULL, NULL, "1993", - "RoboCop versus The Terminator (Euro, USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_robotermRomInfo, gg_robotermRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Royal Stone - Hirakareshi Toki no Tobira (Jpn) - -static struct BurnRomInfo gg_royalstnRomDesc[] = { - { "royal stone - hirakareshi toki no tobira (japan).bin", 0x80000, 0x445d7cd2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_royalstn) -STD_ROM_FN(gg_royalstn) - -struct BurnDriver BurnDrvgg_royalstn = { - "gg_royalstn", NULL, NULL, NULL, "1995", - "Royal Stone - Hirakareshi Toki no Tobira (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_royalstnRomInfo, gg_royalstnRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ryuukyuu (Jpn) - -static struct BurnRomInfo gg_ryukyuRomDesc[] = { - { "mpr-13884.ic1", 0x20000, 0x95efd52b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ryukyu) -STD_ROM_FN(gg_ryukyu) - -struct BurnDriver BurnDrvgg_ryukyu = { - "gg_ryukyu", "gg_solitarp", NULL, NULL, "1991", - "Ryuukyuu (Jpn)\0", NULL, "Face", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ryukyuRomInfo, gg_ryukyuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// S.S. Lucifer - Man Overboard! (Euro) - -static struct BurnRomInfo gg_sslucifrRomDesc[] = { - { "s.s. lucifer - man overboard! (europe).bin", 0x40000, 0xd9a7f170, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sslucifr) -STD_ROM_FN(gg_sslucifr) - -struct BurnDriver BurnDrvgg_sslucifr = { - "gg_sslucifr", NULL, NULL, NULL, "1994", - "S.S. Lucifer - Man Overboard! (Euro)\0", NULL, "Codemasters", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES, GBF_MISC, 0, - GGGetZipName, gg_sslucifrRomInfo, gg_sslucifrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Samurai Shodown (USA) - -static struct BurnRomInfo gg_samshoRomDesc[] = { - { "samurai shodown (usa).bin", 0x80000, 0x98171deb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_samsho) -STD_ROM_FN(gg_samsho) - -struct BurnDriver BurnDrvgg_samsho = { - "gg_samsho", NULL, NULL, NULL, "1994", - "Samurai Shodown (USA)\0", NULL, "Takara", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_samshoRomInfo, gg_samshoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Samurai Spirits (Jpn) - -static struct BurnRomInfo gg_samspirRomDesc[] = { - { "samurai spirits (japan).bin", 0x80000, 0x93fd73dc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_samspir) -STD_ROM_FN(gg_samspir) - -struct BurnDriver BurnDrvgg_samspir = { - "gg_samspir", "gg_samsho", NULL, NULL, "1994", - "Samurai Spirits (Jpn)\0", NULL, "Takara", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_samspirRomInfo, gg_samspirRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Scratch Golf (USA) - -static struct BurnRomInfo gg_scratchgRomDesc[] = { - { "scratch golf (us).bin", 0x40000, 0xc10df4ce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_scratchg) -STD_ROM_FN(gg_scratchg) - -struct BurnDriver BurnDrvgg_scratchg = { - "gg_scratchg", NULL, NULL, NULL, "1994", - "Scratch Golf (USA)\0", NULL, "Vic Tokai", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_scratchgRomInfo, gg_scratchgRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Scratch Golf (Jpn) - -static struct BurnRomInfo gg_scratchgjRomDesc[] = { - { "mpr-16454.ic1", 0x40000, 0xec0f2c72, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_scratchgj) -STD_ROM_FN(gg_scratchgj) - -struct BurnDriver BurnDrvgg_scratchgj = { - "gg_scratchgj", "gg_scratchg", NULL, NULL, "1994", - "Scratch Golf (Jpn)\0", NULL, "Vic Tokai", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_scratchgjRomInfo, gg_scratchgjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// SD Gundam - Winner's History (Jpn) - -static struct BurnRomInfo gg_sdgundamRomDesc[] = { - { "mpr-17848.ic1", 0x80000, 0x5e2b39b8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sdgundam) -STD_ROM_FN(gg_sdgundam) - -struct BurnDriver BurnDrvgg_sdgundam = { - "gg_sdgundam", NULL, NULL, NULL, "1995", - "SD Gundam - Winner's History (Jpn)\0", NULL, "Bandai", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sdgundamRomInfo, gg_sdgundamRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sega Game Pack 4 in 1 (Euro) - -static struct BurnRomInfo gg_sega4in1RomDesc[] = { - { "mpr-15205.ic1", 0x40000, 0x0924d2ec, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sega4in1) -STD_ROM_FN(gg_sega4in1) - -struct BurnDriver BurnDrvgg_sega4in1 = { - "gg_sega4in1", NULL, NULL, NULL, "1991", - "Sega Game Pack 4 in 1 (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sega4in1RomInfo, gg_sega4in1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sega Game Pack 4 in 1 (Euro, Prototype) - -static struct BurnRomInfo gg_sega4in1pRomDesc[] = { - { "sega game pack 4 in 1 (proto).bin", 0x40000, 0x758a7123, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sega4in1p) -STD_ROM_FN(gg_sega4in1p) - -struct BurnDriver BurnDrvgg_sega4in1p = { - "gg_sega4in1p", "gg_sega4in1", NULL, NULL, "1991", - "Sega Game Pack 4 in 1 (Euro, Prototype)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sega4in1pRomInfo, gg_sega4in1pRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sensible Soccer (Euro) - -static struct BurnRomInfo gg_sensibleRomDesc[] = { - { "sensible soccer (europe).bin", 0x20000, 0x5b68da75, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sensible) -STD_ROM_FN(gg_sensible) - -struct BurnDriver BurnDrvgg_sensible = { - "gg_sensible", NULL, NULL, NULL, "1994", - "Sensible Soccer (Euro)\0", NULL, "Sony Imagesoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sensibleRomInfo, gg_sensibleRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shadam Crusader - Harukanaru Oukoku (Jpn) - -static struct BurnRomInfo gg_shadamRomDesc[] = { - { "shadam crusader - harukanaru oukoku (japan).bin", 0x80000, 0x09f9ed60, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shadam) -STD_ROM_FN(gg_shadam) - -struct BurnDriver BurnDrvgg_shadam = { - "gg_shadam", "gg_defoasis", NULL, NULL, "1992", - "Shadam Crusader - Harukanaru Oukoku (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shadamRomInfo, gg_shadamRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shanghai II (Jpn, v0) - -static struct BurnRomInfo gg_shangh2aRomDesc[] = { - { "shanghai ii (japan).bin", 0x20000, 0x2ae8c75f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shangh2a) -STD_ROM_FN(gg_shangh2a) - -struct BurnDriver BurnDrvgg_shangh2a = { - "gg_shangh2a", "gg_shangh2", NULL, NULL, "1990", - "Shanghai II (Jpn, v0)\0", NULL, "Sunsoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shangh2aRomInfo, gg_shangh2aRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shanghai II (Jpn, v1) - -static struct BurnRomInfo gg_shangh2RomDesc[] = { - { "mpr-13494.ic1", 0x20000, 0x81314249, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shangh2) -STD_ROM_FN(gg_shangh2) - -struct BurnDriver BurnDrvgg_shangh2 = { - "gg_shangh2", NULL, NULL, NULL, "1990", - "Shanghai II (Jpn, v1)\0", NULL, "Sunsoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shangh2RomInfo, gg_shangh2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shaq Fu (Euro, USA) - -static struct BurnRomInfo gg_shaqfuRomDesc[] = { - { "shaq fu (usa, europe).bin", 0x80000, 0x6fcb8ab0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shaqfu) -STD_ROM_FN(gg_shaqfu) - -struct BurnDriver BurnDrvgg_shaqfu = { - "gg_shaqfu", NULL, NULL, NULL, "1995", - "Shaq Fu (Euro, USA)\0", NULL, "Electronic Arts", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shaqfuRomInfo, gg_shaqfuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shikinjou (Jpn) - -static struct BurnRomInfo gg_shikinjoRomDesc[] = { - { "shikinjou (japan).bin", 0x20000, 0x9c5c7f53, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shikinjo) -STD_ROM_FN(gg_shikinjo) - -struct BurnDriver BurnDrvgg_shikinjo = { - "gg_shikinjo", NULL, NULL, NULL, "1991", - "Shikinjou (Jpn)\0", NULL, "Sunsoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shikinjoRomInfo, gg_shikinjoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shining Force Gaiden - Ensei, Jashin no Kuni e (Jpn) - -static struct BurnRomInfo gg_shinfrcgRomDesc[] = { - { "shining force gaiden - ensei, jashin no kuni e (japan).bin", 0x80000, 0x4d1f4699, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinfrcg) -STD_ROM_FN(gg_shinfrcg) - -struct BurnDriver BurnDrvgg_shinfrcg = { - "gg_shinfrcg", NULL, NULL, NULL, "1992", - "Shining Force Gaiden - Ensei, Jashin no Kuni e (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinfrcgRomInfo, gg_shinfrcgRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shining Force Gaiden - Final Conflict (Jpn) - -static struct BurnRomInfo gg_shinfrgfRomDesc[] = { - { "shining force gaiden - final conflict (japan).bin", 0x80000, 0x6019fe5e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinfrgf) -STD_ROM_FN(gg_shinfrgf) - -struct BurnDriver BurnDrvgg_shinfrgf = { - "gg_shinfrgf", NULL, NULL, NULL, "1995", - "Shining Force Gaiden - Final Conflict (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinfrgfRomInfo, gg_shinfrgfRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shining Force II - The Sword of Hajya (Euro, USA) - -static struct BurnRomInfo gg_shinfrc2RomDesc[] = { - { "shining force ii - the sword of hajya (usa, europe).bin", 0x80000, 0xa6ca6fa9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinfrc2) -STD_ROM_FN(gg_shinfrc2) - -struct BurnDriver BurnDrvgg_shinfrc2 = { - "gg_shinfrc2", NULL, NULL, NULL, "1994", - "Shining Force II - The Sword of Hajya (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinfrc2RomInfo, gg_shinfrc2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shining Force Gaiden II - Jashin no Kakusei (Jpn) - -static struct BurnRomInfo gg_shinfrg2RomDesc[] = { - { "mpr-15570 j07.u1", 0x80000, 0x30374681, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinfrg2) -STD_ROM_FN(gg_shinfrg2) - -struct BurnDriver BurnDrvgg_shinfrg2 = { - "gg_shinfrg2", "gg_shinfrc2", NULL, NULL, "1993", - "Shining Force Gaiden II - Jashin no Kakusei (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinfrg2RomInfo, gg_shinfrg2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shining Force II - The Sword of Hajya (Prototype, 19940427) - -static struct BurnRomInfo gg_shinfrc2p4RomDesc[] = { - { "shining force ii (prototype - apr 27, 1994).bin", 0x80000, 0x65e5345c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinfrc2p4) -STD_ROM_FN(gg_shinfrc2p4) - -struct BurnDriver BurnDrvgg_shinfrc2p4 = { - "gg_shinfrc2p4", "gg_shinfrc2", NULL, NULL, "1994", - "Shining Force II - The Sword of Hajya (Prototype, 19940427)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinfrc2p4RomInfo, gg_shinfrc2p4RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shining Force II - The Sword of Hajya (Prototype, 19940708) - -static struct BurnRomInfo gg_shinfrc2p1RomDesc[] = { - { "shining force ii (prototype - jul 08, 1994).bin", 0x80000, 0x80dca91d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinfrc2p1) -STD_ROM_FN(gg_shinfrc2p1) - -struct BurnDriver BurnDrvgg_shinfrc2p1 = { - "gg_shinfrc2p1", "gg_shinfrc2", NULL, NULL, "1994", - "Shining Force II - The Sword of Hajya (Prototype, 19940708)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinfrc2p1RomInfo, gg_shinfrc2p1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shining Force II - The Sword of Hajya (Prototype, 19940627) - -static struct BurnRomInfo gg_shinfrc2p2RomDesc[] = { - { "shining force ii (prototype - jun 27, 1994).bin", 0x80000, 0x8bfc56c3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinfrc2p2) -STD_ROM_FN(gg_shinfrc2p2) - -struct BurnDriver BurnDrvgg_shinfrc2p2 = { - "gg_shinfrc2p2", "gg_shinfrc2", NULL, NULL, "1994", - "Shining Force II - The Sword of Hajya (Prototype, 19940627)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinfrc2p2RomInfo, gg_shinfrc2p2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Shining Force II - The Sword of Hajya (Prototype, 19940530) - -static struct BurnRomInfo gg_shinfrc2p3RomDesc[] = { - { "shining force ii (prototype - may 30, 1994).bin", 0x80000, 0xe97ec011, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinfrc2p3) -STD_ROM_FN(gg_shinfrc2p3) - -struct BurnDriver BurnDrvgg_shinfrc2p3 = { - "gg_shinfrc2p3", "gg_shinfrc2", NULL, NULL, "1994", - "Shining Force II - The Sword of Hajya (Prototype, 19940530)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinfrc2p3RomInfo, gg_shinfrc2p3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The GG Shinobi II (World) - -static struct BurnRomInfo gg_shinobi2RomDesc[] = { - { "mpr-15154-f.ic1", 0x40000, 0x6201c694, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shinobi2) -STD_ROM_FN(gg_shinobi2) - -struct BurnDriver BurnDrvgg_shinobi2 = { - "gg_shinobi2", NULL, NULL, NULL, "1992", - "The GG Shinobi II (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_shinobi2RomInfo, gg_shinobi2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Side Pocket (USA) - -static struct BurnRomInfo gg_sidepockRomDesc[] = { - { "side pocket (usa).bin", 0x40000, 0x6a603eed, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sidepock) -STD_ROM_FN(gg_sidepock) - -struct BurnDriver BurnDrvgg_sidepock = { - "gg_sidepock", NULL, NULL, NULL, "1994", - "Side Pocket (USA)\0", NULL, "Data East", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sidepockRomInfo, gg_sidepockRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Simpsons - Bart vs. The Space Mutants (Euro, USA) - -static struct BurnRomInfo gg_bartvssmRomDesc[] = { - { "mpr-15229-s.ic1", 0x40000, 0xc0009274, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bartvssm) -STD_ROM_FN(gg_bartvssm) - -struct BurnDriver BurnDrvgg_bartvssm = { - "gg_bartvssm", NULL, NULL, NULL, "1992", - "The Simpsons - Bart vs. The Space Mutants (Euro, USA)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bartvssmRomInfo, gg_bartvssmRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Simpsons - Bart vs. The World (World) - -static struct BurnRomInfo gg_bartvswdRomDesc[] = { - { "mpr-15978.ic1", 0x40000, 0xda7bd5c7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_bartvswd) -STD_ROM_FN(gg_bartvswd) - -struct BurnDriver BurnDrvgg_bartvswd = { - "gg_bartvswd", NULL, NULL, NULL, "1993", - "The Simpsons - Bart vs. The World (World)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_bartvswdRomInfo, gg_bartvswdRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Skweek (Jpn) - -static struct BurnRomInfo gg_skweekRomDesc[] = { - { "skweek (japan).bin", 0x20000, 0x3d9c92c7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_skweek) -STD_ROM_FN(gg_skweek) - -struct BurnDriver BurnDrvgg_skweek = { - "gg_skweek", "gg_slider", NULL, NULL, "1991", - "Skweek (Jpn)\0", NULL, "Victor Musical Industries", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_skweekRomInfo, gg_skweekRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Slider (Euro, USA) - -static struct BurnRomInfo gg_sliderRomDesc[] = { - { "slider (usa, europe).bin", 0x20000, 0x4dc6f555, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_slider) -STD_ROM_FN(gg_slider) - -struct BurnDriver BurnDrvgg_slider = { - "gg_slider", NULL, NULL, NULL, "1991", - "Slider (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sliderRomInfo, gg_sliderRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Smurfs (Euro) - -static struct BurnRomInfo gg_smurfsRomDesc[] = { - { "smurfs, the (europe) (en,fr,de,es).bin", 0x40000, 0x354e1cbd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_smurfs) -STD_ROM_FN(gg_smurfs) - -struct BurnDriver BurnDrvgg_smurfs = { - "gg_smurfs", NULL, NULL, NULL, "1994", - "The Smurfs (Euro)\0", NULL, "Infogrames", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_smurfsRomInfo, gg_smurfsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Smurfs 2 (Euro) - -static struct BurnRomInfo gg_smurfs2RomDesc[] = { - { "smurfs travel the world, the.bin", 0x40000, 0x3eb337df, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_smurfs2) -STD_ROM_FN(gg_smurfs2) - -struct BurnDriver BurnDrvgg_smurfs2 = { - "gg_smurfs2", NULL, NULL, NULL, "1995", - "The Smurfs 2 (Euro)\0", NULL, "Infogrames", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_smurfs2RomInfo, gg_smurfs2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Solitaire Funpak (USA) - -static struct BurnRomInfo gg_solitairRomDesc[] = { - { "solitaire funpak (usa).bin", 0x40000, 0xf6f24b75, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_solitair) -STD_ROM_FN(gg_solitair) - -struct BurnDriver BurnDrvgg_solitair = { - "gg_solitair", NULL, NULL, NULL, "1994", - "Solitaire Funpak (USA)\0", NULL, "Interplay", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_solitairRomInfo, gg_solitairRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Solitaire Poker (Euro, USA) - -static struct BurnRomInfo gg_solitarpRomDesc[] = { - { "solitaire poker (usa, europe).bin", 0x20000, 0x06f2fc46, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_solitarp) -STD_ROM_FN(gg_solitarp) - -struct BurnDriver BurnDrvgg_solitarp = { - "gg_solitarp", NULL, NULL, NULL, "1991", - "Solitaire Poker (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_solitarpRomInfo, gg_solitarpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic and Tails (Jpn) - -static struct BurnRomInfo gg_sonictlsRomDesc[] = { - { "sonic and tails (japan).bin", 0x80000, 0x8ac0dade, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonictls) -STD_ROM_FN(gg_sonictls) - -struct BurnDriver BurnDrvgg_sonictls = { - "gg_sonictls", "gg_sonicc", NULL, NULL, "1993", - "Sonic and Tails (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonictlsRomInfo, gg_sonictlsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic and Tails (Jpn, Jitsuenyou Sample) - -static struct BurnRomInfo gg_sonictlssRomDesc[] = { - { "sonic and tails [demo] (jp).bin", 0x80000, 0xe0e3fb6a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonictlss) -STD_ROM_FN(gg_sonictlss) - -struct BurnDriver BurnDrvgg_sonictlss = { - "gg_sonictlss", "gg_sonicc", NULL, NULL, "1993", - "Sonic and Tails (Jpn, Jitsuenyou Sample)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonictlssRomInfo, gg_sonictlssRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic and Tails 2 (Jpn) - -static struct BurnRomInfo gg_sonictl2RomDesc[] = { - { "sonic and tails 2 (japan).bin", 0x80000, 0x496bce64, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonictl2) -STD_ROM_FN(gg_sonictl2) - -struct BurnDriver BurnDrvgg_sonictl2 = { - "gg_sonictl2", "gg_sonictri", NULL, NULL, "1994", - "Sonic and Tails 2 (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonictl2RomInfo, gg_sonictl2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Blast (Euro, USA) ~ G Sonic (Jpn) - -static struct BurnRomInfo gg_sonicblsRomDesc[] = { - { "mpr-19071-s.ic2", 0x100000, 0x031b9da9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicbls) -STD_ROM_FN(gg_sonicbls) - -struct BurnDriver BurnDrvgg_sonicbls = { - "gg_sonicbls", NULL, NULL, NULL, "1996", - "Sonic Blast (Euro, USA) ~ G Sonic (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicblsRomInfo, gg_sonicblsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Blast (Prototype 611, 19960531, 13.49) - -static struct BurnRomInfo gg_sonicblsp6RomDesc[] = { - { "sonic blast (prototype 611 - may 31, 1996, 13.49).bin", 0x80000, 0xc09ef45b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicblsp6) -STD_ROM_FN(gg_sonicblsp6) - -struct BurnDriver BurnDrvgg_sonicblsp6 = { - "gg_sonicblsp6", "gg_sonicbls", NULL, NULL, "1996", - "Sonic Blast (Prototype 611, 19960531, 13.49)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicblsp6RomInfo, gg_sonicblsp6RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Blast (Prototype 74, 19960717, 09.11) - -static struct BurnRomInfo gg_sonicblsp5RomDesc[] = { - { "sonic blast (prototype 74 - jul 17, 1996, 09.11).bin", 0x100000, 0x362b186d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicblsp5) -STD_ROM_FN(gg_sonicblsp5) - -struct BurnDriver BurnDrvgg_sonicblsp5 = { - "gg_sonicblsp5", "gg_sonicbls", NULL, NULL, "1996", - "Sonic Blast (Prototype 74, 19960717, 09.11)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicblsp5RomInfo, gg_sonicblsp5RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Blast (Prototype 806, 19960806, 18.37) - -static struct BurnRomInfo gg_sonicblsp4RomDesc[] = { - { "sonic blast (prototype 806 - aug 06, 1996, 18.37).bin", 0x100000, 0x19dad067, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicblsp4) -STD_ROM_FN(gg_sonicblsp4) - -struct BurnDriver BurnDrvgg_sonicblsp4 = { - "gg_sonicblsp4", "gg_sonicbls", NULL, NULL, "1996", - "Sonic Blast (Prototype 806, 19960806, 18.37)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicblsp4RomInfo, gg_sonicblsp4RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Blast (Prototype 821, 19960822, 09.38) - -static struct BurnRomInfo gg_sonicblsp3RomDesc[] = { - { "sonic blast (prototype 821 - aug 22, 1996, 09.38).bin", 0x100000, 0x5eecb549, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicblsp3) -STD_ROM_FN(gg_sonicblsp3) - -struct BurnDriver BurnDrvgg_sonicblsp3 = { - "gg_sonicblsp3", "gg_sonicbls", NULL, NULL, "1996", - "Sonic Blast (Prototype 821, 19960822, 09.38)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicblsp3RomInfo, gg_sonicblsp3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Blast (Prototype 827, 19960828, 11.13) - -static struct BurnRomInfo gg_sonicblsp2RomDesc[] = { - { "sonic blast (prototype 827 - aug 28, 1996, 11.13).bin", 0x100000, 0xe6847ac0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicblsp2) -STD_ROM_FN(gg_sonicblsp2) - -struct BurnDriver BurnDrvgg_sonicblsp2 = { - "gg_sonicblsp2", "gg_sonicbls", NULL, NULL, "1996", - "Sonic Blast (Prototype 827, 19960828, 11.13)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicblsp2RomInfo, gg_sonicblsp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Blast (Prototype 94, 19960902, 17.47) - -static struct BurnRomInfo gg_sonicblsp1RomDesc[] = { - { "sonic blast (prototype 94 - sep 02, 1996, 17.47).bin", 0x100000, 0x2f22a352, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicblsp1) -STD_ROM_FN(gg_sonicblsp1) - -struct BurnDriver BurnDrvgg_sonicblsp1 = { - "gg_sonicblsp1", "gg_sonicbls", NULL, NULL, "1996", - "Sonic Blast (Prototype 94, 19960902, 17.47)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicblsp1RomInfo, gg_sonicblsp1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Chaos (Euro, USA, Bra) - -static struct BurnRomInfo gg_soniccRomDesc[] = { - { "mpr-15973-f.ic1", 0x80000, 0x663f2abb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicc) -STD_ROM_FN(gg_sonicc) - -struct BurnDriver BurnDrvgg_sonicc = { - "gg_sonicc", NULL, NULL, NULL, "199?", - "Sonic Chaos (Euro, USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_soniccRomInfo, gg_soniccRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Drift (Jpn, Demo Sample) - -static struct BurnRomInfo gg_sonicdrsRomDesc[] = { - { "sonic drift (japan) (sample).bin", 0x80000, 0xbaac1fc0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicdrs) -STD_ROM_FN(gg_sonicdrs) - -struct BurnDriver BurnDrvgg_sonicdrs = { - "gg_sonicdrs", "gg_sonicdr", NULL, NULL, "1994", - "Sonic Drift (Jpn, Demo Sample)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicdrsRomInfo, gg_sonicdrsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Drift (Jpn) - -static struct BurnRomInfo gg_sonicdrRomDesc[] = { - { "sonic drift (japan).bin", 0x80000, 0x68f0a776, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicdr) -STD_ROM_FN(gg_sonicdr) - -struct BurnDriver BurnDrvgg_sonicdr = { - "gg_sonicdr", NULL, NULL, NULL, "1994", - "Sonic Drift (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicdrRomInfo, gg_sonicdrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Drift 2 (Jpn, USA) - -static struct BurnRomInfo gg_sonicdr2RomDesc[] = { - { "mpr-17623.ic1", 0x80000, 0xd6e8a305, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicdr2) -STD_ROM_FN(gg_sonicdr2) - -struct BurnDriver BurnDrvgg_sonicdr2 = { - "gg_sonicdr2", NULL, NULL, NULL, "1995", - "Sonic Drift 2 (Jpn, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicdr2RomInfo, gg_sonicdr2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Labyrinth (World) - -static struct BurnRomInfo gg_soniclabRomDesc[] = { - { "mpr-18314-s.ic1", 0x80000, 0x5550173b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_soniclab) -STD_ROM_FN(gg_soniclab) - -struct BurnDriver BurnDrvgg_soniclab = { - "gg_soniclab", NULL, NULL, NULL, "1995", - "Sonic Labyrinth (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_soniclabRomInfo, gg_soniclabRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Euro, USA) - -static struct BurnRomInfo gg_sspinRomDesc[] = { - { "sonic spinball (usa, europe).bin", 0x80000, 0xa9210434, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspin) -STD_ROM_FN(gg_sspin) - -struct BurnDriver BurnDrvgg_sspin = { - "gg_sspin", NULL, NULL, NULL, "1993", - "Sonic Spinball (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinRomInfo, gg_sspinRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0307, 19940307, 05.24) - -static struct BurnRomInfo gg_sspinp20RomDesc[] = { - { "sonic spinball (prototype 0307 - mar 07, 1994, 05.24).bin", 0x80000, 0x3283580d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp20) -STD_ROM_FN(gg_sspinp20) - -struct BurnDriver BurnDrvgg_sspinp20 = { - "gg_sspinp20", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0307, 19940307, 05.24)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp20RomInfo, gg_sspinp20RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 031094, 19940310, 17.41) - -static struct BurnRomInfo gg_sspinp19RomDesc[] = { - { "sonic spinball (prototype 031094 - mar 10, 1994, 17.41).bin", 0x80000, 0x1a736612, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp19) -STD_ROM_FN(gg_sspinp19) - -struct BurnDriver BurnDrvgg_sspinp19 = { - "gg_sspinp19", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 031094, 19940310, 17.41)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp19RomInfo, gg_sspinp19RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 031194, 19940311, 12.09) - -static struct BurnRomInfo gg_sspinp18RomDesc[] = { - { "sonic spinball (prototype 031194 - mar 11, 1994, 12.09).bin", 0x80000, 0x1aed8f62, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp18) -STD_ROM_FN(gg_sspinp18) - -struct BurnDriver BurnDrvgg_sspinp18 = { - "gg_sspinp18", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 031194, 19940311, 12.09)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp18RomInfo, gg_sspinp18RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 032194, 19940321, 07.12) - -static struct BurnRomInfo gg_sspinp17RomDesc[] = { - { "sonic spinball (prototype 032194 - mar 21, 1994, 07.12).bin", 0x80000, 0x46657b4e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp17) -STD_ROM_FN(gg_sspinp17) - -struct BurnDriver BurnDrvgg_sspinp17 = { - "gg_sspinp17", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 032194, 19940321, 07.12)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp17RomInfo, gg_sspinp17RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0328, 19940328, 06.54) - -static struct BurnRomInfo gg_sspinp16RomDesc[] = { - { "sonic spinball (prototype 0328 - mar 28, 1994, 06.54).bin", 0x80000, 0x1233c3e3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp16) -STD_ROM_FN(gg_sspinp16) - -struct BurnDriver BurnDrvgg_sspinp16 = { - "gg_sspinp16", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0328, 19940328, 06.54)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp16RomInfo, gg_sspinp16RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0329, 19940329, 07.35) - -static struct BurnRomInfo gg_sspinp15RomDesc[] = { - { "sonic spinball (prototype 0329 - mar 29, 1994, 07.35).bin", 0x80000, 0xaa7aedb0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp15) -STD_ROM_FN(gg_sspinp15) - -struct BurnDriver BurnDrvgg_sspinp15 = { - "gg_sspinp15", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0329, 19940329, 07.35)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp15RomInfo, gg_sspinp15RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0330, 19940330, 06.54) - -static struct BurnRomInfo gg_sspinp14RomDesc[] = { - { "sonic spinball (prototype 0330 - mar 30, 1994, 06.54).bin", 0x80000, 0x2ca34ab2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp14) -STD_ROM_FN(gg_sspinp14) - -struct BurnDriver BurnDrvgg_sspinp14 = { - "gg_sspinp14", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0330, 19940330, 06.54)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp14RomInfo, gg_sspinp14RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0405, 19940405, 18.07) - -static struct BurnRomInfo gg_sspinp13RomDesc[] = { - { "sonic spinball (prototype 0405 - apr 05, 1994, 18.07).bin", 0x80000, 0x09b913d5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp13) -STD_ROM_FN(gg_sspinp13) - -struct BurnDriver BurnDrvgg_sspinp13 = { - "gg_sspinp13", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0405, 19940405, 18.07)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp13RomInfo, gg_sspinp13RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0412, 19940412, 07.26) - -static struct BurnRomInfo gg_sspinp12RomDesc[] = { - { "sonic spinball (prototype 0412 - apr 12, 1994, 07.26).bin", 0x80000, 0xf8a432f6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp12) -STD_ROM_FN(gg_sspinp12) - -struct BurnDriver BurnDrvgg_sspinp12 = { - "gg_sspinp12", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0412, 19940412, 07.26)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp12RomInfo, gg_sspinp12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0413, 19940413, 02.54) - -static struct BurnRomInfo gg_sspinp11RomDesc[] = { - { "sonic spinball (prototype 0413 - apr 13, 1994, 02.54).bin", 0x80000, 0x1f1abf2c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp11) -STD_ROM_FN(gg_sspinp11) - -struct BurnDriver BurnDrvgg_sspinp11 = { - "gg_sspinp11", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0413, 19940413, 02.54)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp11RomInfo, gg_sspinp11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0415, 19940415, 17.33) - -static struct BurnRomInfo gg_sspinp10RomDesc[] = { - { "sonic spinball (prototype 0415 - apr 15, 1994, 17.33).bin", 0x80000, 0xe3b5cd1e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp10) -STD_ROM_FN(gg_sspinp10) - -struct BurnDriver BurnDrvgg_sspinp10 = { - "gg_sspinp10", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0415, 19940415, 17.33)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp10RomInfo, gg_sspinp10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0421, 19940421, 05.30) - -static struct BurnRomInfo gg_sspinp09RomDesc[] = { - { "sonic spinball (prototype 0421 - apr 21, 1994, 05.30).bin", 0x80000, 0xbbaecf7c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp09) -STD_ROM_FN(gg_sspinp09) - -struct BurnDriver BurnDrvgg_sspinp09 = { - "gg_sspinp09", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0421, 19940421, 05.30)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp09RomInfo, gg_sspinp09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0427, 19940427, 04.51) - -static struct BurnRomInfo gg_sspinp08RomDesc[] = { - { "sonic spinball (prototype 0427 - apr 27, 1994, 04.51).bin", 0x5c000, 0x07d32244, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp08) -STD_ROM_FN(gg_sspinp08) - -struct BurnDriver BurnDrvgg_sspinp08 = { - "gg_sspinp08", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0427, 19940427, 04.51)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp08RomInfo, gg_sspinp08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0429, 19940429, 06.01) - -static struct BurnRomInfo gg_sspinp07RomDesc[] = { - { "sonic spinball (prototype 0429 - apr 29, 1994, 06.01).bin", 0x80000, 0x30a7d062, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp07) -STD_ROM_FN(gg_sspinp07) - -struct BurnDriver BurnDrvgg_sspinp07 = { - "gg_sspinp07", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0429, 19940429, 06.01)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp07RomInfo, gg_sspinp07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0430, 19940429, 21.48) - -static struct BurnRomInfo gg_sspinp06RomDesc[] = { - { "sonic spinball (prototype 0430 - apr 29, 1994, 21.48).bin", 0x80000, 0x221c4ba4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp06) -STD_ROM_FN(gg_sspinp06) - -struct BurnDriver BurnDrvgg_sspinp06 = { - "gg_sspinp06", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0430, 19940429, 21.48)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp06RomInfo, gg_sspinp06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 503B, 19940503, 19.27) - -static struct BurnRomInfo gg_sspinp05RomDesc[] = { - { "sonic spinball (prototype 503b - may 03, 1994, 19.27).bin", 0x80000, 0xe2fe976a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp05) -STD_ROM_FN(gg_sspinp05) - -struct BurnDriver BurnDrvgg_sspinp05 = { - "gg_sspinp05", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 503B, 19940503, 19.27)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp05RomInfo, gg_sspinp05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0505, 19940505, 04.47) - -static struct BurnRomInfo gg_sspinp04RomDesc[] = { - { "sonic spinball (prototype 0505 - may 05, 1994, 04.47).bin", 0x80000, 0xbe76bf30, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp04) -STD_ROM_FN(gg_sspinp04) - -struct BurnDriver BurnDrvgg_sspinp04 = { - "gg_sspinp04", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0505, 19940505, 04.47)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp04RomInfo, gg_sspinp04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0506, 19940506, 13.04) - -static struct BurnRomInfo gg_sspinp03RomDesc[] = { - { "sonic spinball (prototype 0506 - may 06, 1994, 13.04).bin", 0x80000, 0xa4833d27, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp03) -STD_ROM_FN(gg_sspinp03) - -struct BurnDriver BurnDrvgg_sspinp03 = { - "gg_sspinp03", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0506, 19940506, 13.04)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp03RomInfo, gg_sspinp03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0525, 19940525, 13.24) - -static struct BurnRomInfo gg_sspinp02RomDesc[] = { - { "sonic spinball (prototype 0525 - may 25, 1994, 13.24).bin", 0x80000, 0xa035fd5c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp02) -STD_ROM_FN(gg_sspinp02) - -struct BurnDriver BurnDrvgg_sspinp02 = { - "gg_sspinp02", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0525, 19940525, 13.24)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp02RomInfo, gg_sspinp02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic Spinball (Prototype 0530, 19940530, 23.25) - -static struct BurnRomInfo gg_sspinp01RomDesc[] = { - { "sonic spinball (prototype 0530 - may 30, 1994, 23.25).bin", 0x80000, 0x6107819d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sspinp01) -STD_ROM_FN(gg_sspinp01) - -struct BurnDriver BurnDrvgg_sspinp01 = { - "gg_sspinp01", "gg_sspin", NULL, NULL, "1994", - "Sonic Spinball (Prototype 0530, 19940530, 23.25)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sspinp01RomInfo, gg_sspinp01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog (Jpn, USA, v0) - -static struct BurnRomInfo gg_sonicjRomDesc[] = { - { "sonic the hedgehog (japan).bin", 0x40000, 0x3e31cb8c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicj) -STD_ROM_FN(gg_sonicj) - -struct BurnDriver BurnDrvgg_sonicj = { - "gg_sonicj", "gg_sonic", NULL, NULL, "1991", - "Sonic The Hedgehog (Jpn, USA, v0)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicjRomInfo, gg_sonicjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog (Euro, Jpn, v1) - -static struct BurnRomInfo gg_sonicRomDesc[] = { - { "mpr-14459a.ic1", 0x40000, 0xd163356e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonic) -STD_ROM_FN(gg_sonic) - -struct BurnDriver BurnDrvgg_sonic = { - "gg_sonic", NULL, NULL, NULL, "1991", - "Sonic The Hedgehog (Euro, Jpn, v1)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicRomInfo, gg_sonicRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog (World, Prototype) - -static struct BurnRomInfo gg_sonicpRomDesc[] = { - { "sonic the hedgehog (world) (proto).bin", 0x40000, 0x816c0a1e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonicp) -STD_ROM_FN(gg_sonicp) - -struct BurnDriver BurnDrvgg_sonicp = { - "gg_sonicp", "gg_sonic", NULL, NULL, "1991", - "Sonic The Hedgehog (World, Prototype)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonicpRomInfo, gg_sonicpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog 2 (World) - -static struct BurnRomInfo gg_sonic2RomDesc[] = { - { "mpr-15169 j02.ic1", 0x80000, 0x95a18ec7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonic2) -STD_ROM_FN(gg_sonic2) - -struct BurnDriver BurnDrvgg_sonic2 = { - "gg_sonic2", NULL, NULL, NULL, "1992", - "Sonic The Hedgehog 2 (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonic2RomInfo, gg_sonic2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog 2 (Rolling Demo) - -static struct BurnRomInfo gg_sonic2dRomDesc[] = { - { "sonic_2_auto_demo_prototype_(1991-12-05)_tmr_sega_cb06_ffff.bin", 0x40000, 0x15ad37a5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonic2d) -STD_ROM_FN(gg_sonic2d) - -struct BurnDriver BurnDrvgg_sonic2d = { - "gg_sonic2d", "gg_sonic2", NULL, NULL, "1992", - "Sonic The Hedgehog 2 (Rolling Demo)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonic2dRomInfo, gg_sonic2dRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog - Triple Trouble (Euro, USA) - -static struct BurnRomInfo gg_sonictriRomDesc[] = { - { "mpr-17075.ic1", 0x80000, 0xd23a2a93, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonictri) -STD_ROM_FN(gg_sonictri) - -struct BurnDriver BurnDrvgg_sonictri = { - "gg_sonictri", NULL, NULL, NULL, "1994", - "Sonic The Hedgehog - Triple Trouble (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonictriRomInfo, gg_sonictriRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sonic The Hedgehog - Triple Trouble (Prototype 0808, 19940808, 18.05) - -static struct BurnRomInfo gg_sonictripRomDesc[] = { - { "sonic the hedgehog - triple trouble (prototype 0808 - aug 08, 1994, 18.05).bin", 0x80000, 0x80eb7cfb, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sonictrip) -STD_ROM_FN(gg_sonictrip) - -struct BurnDriver BurnDrvgg_sonictrip = { - "gg_sonictrip", "gg_sonictri", NULL, NULL, "1994", - "Sonic The Hedgehog - Triple Trouble (Prototype 0808, 19940808, 18.05)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sonictripRomInfo, gg_sonictripRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Soukoban (Jpn) - -static struct BurnRomInfo gg_sokobanRomDesc[] = { - { "soukoban (japan).bin", 0x20000, 0x0f3e3840, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sokoban) -STD_ROM_FN(gg_sokoban) - -struct BurnDriver BurnDrvgg_sokoban = { - "gg_sokoban", NULL, NULL, NULL, "1990", - "Soukoban (Jpn)\0", NULL, "Riverhill Software", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sokobanRomInfo, gg_sokobanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Space Harrier (World) - -static struct BurnRomInfo gg_sharrierRomDesc[] = { - { "mpr-14346.ic1", 0x20000, 0x600c15b3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sharrier) -STD_ROM_FN(gg_sharrier) - -struct BurnDriver BurnDrvgg_sharrier = { - "gg_sharrier", NULL, NULL, NULL, "1991", - "Space Harrier (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sharrierRomInfo, gg_sharrierRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Cheese Cat-astrophe Starring Speedy Gonzales (Euro) - -static struct BurnRomInfo gg_cheeseRomDesc[] = { - { "cheese catastrophe (euro).bin", 0x80000, 0x4e78fd36, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_cheese) -STD_ROM_FN(gg_cheese) - -struct BurnDriver BurnDrvgg_cheese = { - "gg_cheese", NULL, NULL, NULL, "1995", - "Cheese Cat-astrophe Starring Speedy Gonzales (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_cheeseRomInfo, gg_cheeseRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spider-Man - Return of the Sinister Six (Euro, USA) - -static struct BurnRomInfo gg_spidermnRomDesc[] = { - { "spider-man - return of the sinister six (usa, europe).bin", 0x40000, 0xbc240779, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_spidermn) -STD_ROM_FN(gg_spidermn) - -struct BurnDriver BurnDrvgg_spidermn = { - "gg_spidermn", NULL, NULL, NULL, "1993", - "Spider-Man - Return of the Sinister Six (Euro, USA)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_spidermnRomInfo, gg_spidermnRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spider-Man and the X-Men in Arcade's Revenge (USA) - -static struct BurnRomInfo gg_spidxmenRomDesc[] = { - { "spider-man and the x-men in arcade's revenge (usa).bin", 0x80000, 0x742a372b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_spidxmen) -STD_ROM_FN(gg_spidxmen) - -struct BurnDriver BurnDrvgg_spidxmen = { - "gg_spidxmen", NULL, NULL, NULL, "1992", - "Spider-Man and the X-Men in Arcade's Revenge (USA)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_spidxmenRomInfo, gg_spidxmenRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spider-Man vs. The Kingpin (Euro, USA) - -static struct BurnRomInfo gg_spidkingRomDesc[] = { - { "spider-man vs. the kingpin (usa, europe).bin", 0x40000, 0x2651024e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_spidking) -STD_ROM_FN(gg_spidking) - -struct BurnDriver BurnDrvgg_spidking = { - "gg_spidking", NULL, NULL, NULL, "1992", - "Spider-Man vs. The Kingpin (Euro, USA)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_spidkingRomInfo, gg_spidkingRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Spirou (Euro, Prototype) - -static struct BurnRomInfo gg_spirouRomDesc[] = { - { "spirou (europe) (proto).bin", 0x80000, 0xab622adc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_spirou) -STD_ROM_FN(gg_spirou) - -struct BurnDriver BurnDrvgg_spirou = { - "gg_spirou", NULL, NULL, NULL, "199?", - "Spirou (Euro, Prototype)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_spirouRomInfo, gg_spirouRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Illustrated Championship Football and Baseball (Euro, USA) - -static struct BurnRomInfo gg_sportillRomDesc[] = { - { "sports illustrated championship football and baseball (usa, europe).bin", 0x80000, 0xde25e2d8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sportill) -STD_ROM_FN(gg_sportill) - -struct BurnDriver BurnDrvgg_sportill = { - "gg_sportill", NULL, NULL, NULL, "1995", - "Sports Illustrated Championship Football and Baseball (Euro, USA)\0", NULL, "Black Pearl", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sportillRomInfo, gg_sportillRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (USA) - -static struct BurnRomInfo gg_sporttrvRomDesc[] = { - { "sports trivia (usa).bin", 0x20000, 0xa7af7ca9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrv) -STD_ROM_FN(gg_sporttrv) - -struct BurnDriver BurnDrvgg_sporttrv = { - "gg_sporttrv", NULL, NULL, NULL, "1995", - "Sports Trivia (USA)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvRomInfo, gg_sporttrvRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950308) - -static struct BurnRomInfo gg_sporttrvp12RomDesc[] = { - { "sports trivia (prototype - mar 08, 1995).bin", 0x20000, 0xc38d41c3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp12) -STD_ROM_FN(gg_sporttrvp12) - -struct BurnDriver BurnDrvgg_sporttrvp12 = { - "gg_sporttrvp12", "gg_sporttrv", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950308)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp12RomInfo, gg_sporttrvp12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950309) - -static struct BurnRomInfo gg_sporttrvp11RomDesc[] = { - { "sports trivia (prototype - mar 09, 1995).bin", 0x20000, 0x34407fe9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp11) -STD_ROM_FN(gg_sporttrvp11) - -struct BurnDriver BurnDrvgg_sporttrvp11 = { - "gg_sporttrvp11", "gg_sporttrv", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950309)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp11RomInfo, gg_sporttrvp11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950313) - -static struct BurnRomInfo gg_sporttrvp10RomDesc[] = { - { "sports trivia (prototype - mar 13, 1995).bin", 0x40000, 0xa8d1ac51, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp10) -STD_ROM_FN(gg_sporttrvp10) - -struct BurnDriver BurnDrvgg_sporttrvp10 = { - "gg_sporttrvp10", "gg_sporttrv", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950313)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp10RomInfo, gg_sporttrvp10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950316-1MEG) - -static struct BurnRomInfo gg_sporttrvp09RomDesc[] = { - { "sports trivia (prototype - mar 16, 1995 - 1meg).bin", 0x20000, 0x464f1b51, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp09) -STD_ROM_FN(gg_sporttrvp09) - -struct BurnDriver BurnDrvgg_sporttrvp09 = { - "gg_sporttrvp09", "gg_sporttrv", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950316-1MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp09RomInfo, gg_sporttrvp09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950316-2MEG) - -static struct BurnRomInfo gg_sporttrvp08RomDesc[] = { - { "sports trivia (prototype - mar 16, 1995 - 2meg).bin", 0x40000, 0xcaf87d8b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp08) -STD_ROM_FN(gg_sporttrvp08) - -struct BurnDriver BurnDrvgg_sporttrvp08 = { - "gg_sporttrvp08", "gg_sporttrv", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950316-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp08RomInfo, gg_sporttrvp08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950317-2MEG) - -static struct BurnRomInfo gg_sporttrvp07RomDesc[] = { - { "sports trivia (prototype - mar 17, 1995 - 2meg).bin", 0x40000, 0x43bb6b10, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp07) -STD_ROM_FN(gg_sporttrvp07) - -struct BurnDriver BurnDrvgg_sporttrvp07 = { - "gg_sporttrvp07", "gg_sporttrv", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950317-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp07RomInfo, gg_sporttrvp07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950320-2MEG) - -static struct BurnRomInfo gg_sporttrvp06RomDesc[] = { - { "sports trivia (prototype - mar 20, 1995 - 2meg).bin", 0x40000, 0xe7aff566, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp06) -STD_ROM_FN(gg_sporttrvp06) - -struct BurnDriver BurnDrvgg_sporttrvp06 = { - "gg_sporttrvp06", "gg_sporttrv", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950320-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp06RomInfo, gg_sporttrvp06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950320-QTEST) - -static struct BurnRomInfo gg_sporttrvp05RomDesc[] = { - { "sports trivia (prototype - mar 20, 1995 - qtest).bin", 0x40000, 0xa3e57816, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp05) -STD_ROM_FN(gg_sporttrvp05) - -struct BurnDriver BurnDrvgg_sporttrvp05 = { - "gg_sporttrvp05", "gg_sporttrv", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950320-QTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp05RomInfo, gg_sporttrvp05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950425-1MEG) - -static struct BurnRomInfo gg_sporttrvp04RomDesc[] = { - { "sports trivia (prototype - apr 25, 1995 - 1meg).bin", 0x20000, 0x895af58a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp04) -STD_ROM_FN(gg_sporttrvp04) - -struct BurnDriver BurnDrvgg_sporttrvp04 = { - "gg_sporttrvp04", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950425-1MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp04RomInfo, gg_sporttrvp04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950425-QTEST) - -static struct BurnRomInfo gg_sporttrvp03RomDesc[] = { - { "sports trivia (prototype - apr 25, 1995 - qtest).bin", 0x20000, 0x7524957c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp03) -STD_ROM_FN(gg_sporttrvp03) - -struct BurnDriver BurnDrvgg_sporttrvp03 = { - "gg_sporttrvp03", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950425-QTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp03RomInfo, gg_sporttrvp03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950427-1MEG) - -static struct BurnRomInfo gg_sporttrvp02RomDesc[] = { - { "sports trivia (prototype - apr 27, 1995 - 1meg).bin", 0x20000, 0x7898919f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp02) -STD_ROM_FN(gg_sporttrvp02) - -struct BurnDriver BurnDrvgg_sporttrvp02 = { - "gg_sporttrvp02", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950427-1MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp02RomInfo, gg_sporttrvp02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950504-1MEG) - -static struct BurnRomInfo gg_sporttrvp01RomDesc[] = { - { "sports trivia (prototype - may 04, 1995 - 1meg).bin", 0x20000, 0xbba4cf7b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sporttrvp01) -STD_ROM_FN(gg_sporttrvp01) - -struct BurnDriver BurnDrvgg_sporttrvp01 = { - "gg_sporttrvp01", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950504-1MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sporttrvp01RomInfo, gg_sporttrvp01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia - Championship Edition (Euro, USA) - -static struct BurnRomInfo gg_sprtrvceRomDesc[] = { - { "sports trivia - championship edition (usa, europe).bin", 0x40000, 0x5b5de94d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvce) -STD_ROM_FN(gg_sprtrvce) - -struct BurnDriver BurnDrvgg_sprtrvce = { - "gg_sprtrvce", NULL, NULL, NULL, "1995", - "Sports Trivia - Championship Edition (Euro, USA)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvceRomInfo, gg_sprtrvceRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950502-2MEG) - -static struct BurnRomInfo gg_sprtrvcep01RomDesc[] = { - { "sports trivia (prototype - may 02, 1995 - 2meg).bin", 0x40000, 0x15e7e261, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep01) -STD_ROM_FN(gg_sprtrvcep01) - -struct BurnDriver BurnDrvgg_sprtrvcep01 = { - "gg_sprtrvcep01", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950502-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep01RomInfo, gg_sprtrvcep01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950403-2MEG) - -static struct BurnRomInfo gg_sprtrvcep13RomDesc[] = { - { "sports trivia (prototype - apr 03, 1995 - 2meg).bin", 0x40000, 0x3e3d6728, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep13) -STD_ROM_FN(gg_sprtrvcep13) - -struct BurnDriver BurnDrvgg_sprtrvcep13 = { - "gg_sprtrvcep13", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950403-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep13RomInfo, gg_sprtrvcep13RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950403-QTEST) - -static struct BurnRomInfo gg_sprtrvcep12RomDesc[] = { - { "sports trivia (prototype - apr 03, 1995 - qtest).bin", 0x40000, 0xc68762e6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep12) -STD_ROM_FN(gg_sprtrvcep12) - -struct BurnDriver BurnDrvgg_sprtrvcep12 = { - "gg_sprtrvcep12", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950403-QTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep12RomInfo, gg_sprtrvcep12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950404-2MEG) - -static struct BurnRomInfo gg_sprtrvcep11RomDesc[] = { - { "sports trivia (prototype - apr 04, 1995 - 2meg).bin", 0x40000, 0xd61a366f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep11) -STD_ROM_FN(gg_sprtrvcep11) - -struct BurnDriver BurnDrvgg_sprtrvcep11 = { - "gg_sprtrvcep11", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950404-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep11RomInfo, gg_sprtrvcep11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950405-2MEG-B) - -static struct BurnRomInfo gg_sprtrvcep10RomDesc[] = { - { "sports trivia (prototype - apr 05, 1995 - 2meg - b).bin", 0x40000, 0x818ec54c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep10) -STD_ROM_FN(gg_sprtrvcep10) - -struct BurnDriver BurnDrvgg_sprtrvcep10 = { - "gg_sprtrvcep10", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950405-2MEG-B)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep10RomInfo, gg_sprtrvcep10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950405-2MEG-C) - -static struct BurnRomInfo gg_sprtrvcep09RomDesc[] = { - { "sports trivia (prototype - apr 05, 1995 - 2meg - c).bin", 0x40000, 0xf88a55f4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep09) -STD_ROM_FN(gg_sprtrvcep09) - -struct BurnDriver BurnDrvgg_sprtrvcep09 = { - "gg_sprtrvcep09", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950405-2MEG-C)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep09RomInfo, gg_sprtrvcep09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950405-QTEST) - -static struct BurnRomInfo gg_sprtrvcep08RomDesc[] = { - { "sports trivia (prototype - apr 05, 1995 - qtest).bin", 0x40000, 0x93b98f19, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep08) -STD_ROM_FN(gg_sprtrvcep08) - -struct BurnDriver BurnDrvgg_sprtrvcep08 = { - "gg_sprtrvcep08", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950405-QTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep08RomInfo, gg_sprtrvcep08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950406-2MEG) - -static struct BurnRomInfo gg_sprtrvcep07RomDesc[] = { - { "sports trivia (prototype - apr 06, 1995 - 2meg).bin", 0x40000, 0xcab74070, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep07) -STD_ROM_FN(gg_sprtrvcep07) - -struct BurnDriver BurnDrvgg_sprtrvcep07 = { - "gg_sprtrvcep07", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950406-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep07RomInfo, gg_sprtrvcep07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950407-2MEG) - -static struct BurnRomInfo gg_sprtrvcep06RomDesc[] = { - { "sports trivia (prototype - apr 07, 1995 - 2meg).bin", 0x40000, 0x352e8b8c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep06) -STD_ROM_FN(gg_sprtrvcep06) - -struct BurnDriver BurnDrvgg_sprtrvcep06 = { - "gg_sprtrvcep06", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950407-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep06RomInfo, gg_sprtrvcep06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950407-QTEST) - -static struct BurnRomInfo gg_sprtrvcep05RomDesc[] = { - { "sports trivia (prototype - apr 07, 1995 - qtest).bin", 0x40000, 0x961ae378, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep05) -STD_ROM_FN(gg_sprtrvcep05) - -struct BurnDriver BurnDrvgg_sprtrvcep05 = { - "gg_sprtrvcep05", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950407-QTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep05RomInfo, gg_sprtrvcep05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950411-2MEG) - -static struct BurnRomInfo gg_sprtrvcep04RomDesc[] = { - { "sports trivia (prototype - apr 11, 1995 - 2meg).bin", 0x40000, 0x8bdb184d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep04) -STD_ROM_FN(gg_sprtrvcep04) - -struct BurnDriver BurnDrvgg_sprtrvcep04 = { - "gg_sprtrvcep04", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950411-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep04RomInfo, gg_sprtrvcep04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950412-2MEG) - -static struct BurnRomInfo gg_sprtrvcep03RomDesc[] = { - { "sports trivia (prototype - apr 12, 1995 - 2meg).bin", 0x40000, 0x1e360a20, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep03) -STD_ROM_FN(gg_sprtrvcep03) - -struct BurnDriver BurnDrvgg_sprtrvcep03 = { - "gg_sprtrvcep03", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950412-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep03RomInfo, gg_sprtrvcep03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950428-2MEG) - -static struct BurnRomInfo gg_sprtrvcep02RomDesc[] = { - { "sports trivia (prototype - apr 28, 1995 - 2meg).bin", 0x40000, 0x26470d2b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep02) -STD_ROM_FN(gg_sprtrvcep02) - -struct BurnDriver BurnDrvgg_sprtrvcep02 = { - "gg_sprtrvcep02", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950428-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep02RomInfo, gg_sprtrvcep02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950321-2MEG) - -static struct BurnRomInfo gg_sprtrvcep24RomDesc[] = { - { "sports trivia (prototype - mar 21, 1995 - 2meg).bin", 0x40000, 0x18cf6145, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep24) -STD_ROM_FN(gg_sprtrvcep24) - -struct BurnDriver BurnDrvgg_sprtrvcep24 = { - "gg_sprtrvcep24", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950321-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep24RomInfo, gg_sprtrvcep24RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950323-2MEG) - -static struct BurnRomInfo gg_sprtrvcep23RomDesc[] = { - { "sports trivia (prototype - mar 23, 1995 - 2meg).bin", 0x40000, 0x27816c09, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep23) -STD_ROM_FN(gg_sprtrvcep23) - -struct BurnDriver BurnDrvgg_sprtrvcep23 = { - "gg_sprtrvcep23", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950323-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep23RomInfo, gg_sprtrvcep23RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950323-ALGOTEST) - -static struct BurnRomInfo gg_sprtrvcep22RomDesc[] = { - { "sports trivia (prototype - mar 23, 1995 - algotest).bin", 0x40000, 0x9a8ad5ca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep22) -STD_ROM_FN(gg_sprtrvcep22) - -struct BurnDriver BurnDrvgg_sprtrvcep22 = { - "gg_sprtrvcep22", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950323-ALGOTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep22RomInfo, gg_sprtrvcep22RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950323-QTEST) - -static struct BurnRomInfo gg_sprtrvcep21RomDesc[] = { - { "sports trivia (prototype - mar 23, 1995 - qtest).bin", 0x40000, 0xacb7e580, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep21) -STD_ROM_FN(gg_sprtrvcep21) - -struct BurnDriver BurnDrvgg_sprtrvcep21 = { - "gg_sprtrvcep21", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950323-QTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep21RomInfo, gg_sprtrvcep21RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950327-2MEG) - -static struct BurnRomInfo gg_sprtrvcep20RomDesc[] = { - { "sports trivia (prototype - mar 27, 1995 - 2meg).bin", 0x40000, 0x517bd817, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep20) -STD_ROM_FN(gg_sprtrvcep20) - -struct BurnDriver BurnDrvgg_sprtrvcep20 = { - "gg_sprtrvcep20", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950327-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep20RomInfo, gg_sprtrvcep20RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950327-ALGOTEST) - -static struct BurnRomInfo gg_sprtrvcep19RomDesc[] = { - { "sports trivia (prototype - mar 27, 1995 - algotest).bin", 0x40000, 0x511b1d24, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep19) -STD_ROM_FN(gg_sprtrvcep19) - -struct BurnDriver BurnDrvgg_sprtrvcep19 = { - "gg_sprtrvcep19", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950327-ALGOTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep19RomInfo, gg_sprtrvcep19RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950329-2MEG) - -static struct BurnRomInfo gg_sprtrvcep18RomDesc[] = { - { "sports trivia (prototype - mar 29, 1995 - 2meg).bin", 0x40000, 0xe906fbd8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep18) -STD_ROM_FN(gg_sprtrvcep18) - -struct BurnDriver BurnDrvgg_sprtrvcep18 = { - "gg_sprtrvcep18", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950329-2MEG)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep18RomInfo, gg_sprtrvcep18RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950329-ALGOTEST) - -static struct BurnRomInfo gg_sprtrvcep17RomDesc[] = { - { "sports trivia (prototype - mar 29, 1995 - algotest).bin", 0x40000, 0xe80459b3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep17) -STD_ROM_FN(gg_sprtrvcep17) - -struct BurnDriver BurnDrvgg_sprtrvcep17 = { - "gg_sprtrvcep17", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950329-ALGOTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep17RomInfo, gg_sprtrvcep17RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950329-QTEST) - -static struct BurnRomInfo gg_sprtrvcep16RomDesc[] = { - { "sports trivia (prototype - mar 29, 1995 - qtest).bin", 0x40000, 0x05047357, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep16) -STD_ROM_FN(gg_sprtrvcep16) - -struct BurnDriver BurnDrvgg_sprtrvcep16 = { - "gg_sprtrvcep16", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950329-QTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep16RomInfo, gg_sprtrvcep16RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950330-2MEG-D) - -static struct BurnRomInfo gg_sprtrvcep15RomDesc[] = { - { "sports trivia (prototype - mar 30, 1995 - 2meg - d).bin", 0x40000, 0x302b9b36, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep15) -STD_ROM_FN(gg_sprtrvcep15) - -struct BurnDriver BurnDrvgg_sprtrvcep15 = { - "gg_sprtrvcep15", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950330-2MEG-D)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep15RomInfo, gg_sprtrvcep15RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sports Trivia (Prototype, 19950330-QTEST) - -static struct BurnRomInfo gg_sprtrvcep14RomDesc[] = { - { "sports trivia (prototype - mar 30, 1995 - qtest).bin", 0x40000, 0xf3f9a87b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sprtrvcep14) -STD_ROM_FN(gg_sprtrvcep14) - -struct BurnDriver BurnDrvgg_sprtrvcep14 = { - "gg_sprtrvcep14", "gg_sprtrvce", NULL, NULL, "1995", - "Sports Trivia (Prototype, 19950330-QTEST)\0", NULL, "Sega?", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sprtrvcep14RomInfo, gg_sprtrvcep14RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Star Trek - The Next Generation (USA) - -static struct BurnRomInfo gg_stngRomDesc[] = { - { "star trek - the next generation - the advanced holodeck tutorial (usa).bin", 0x40000, 0x80156323, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_stng) -STD_ROM_FN(gg_stng) - -struct BurnDriver BurnDrvgg_stng = { - "gg_stng", NULL, NULL, NULL, "1994", - "Star Trek - The Next Generation (USA)\0", NULL, "Absolute Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_stngRomInfo, gg_stngRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Star Trek Generations - Beyond the Nexus (Euro, USA) - -static struct BurnRomInfo gg_stgbeynRomDesc[] = { - { "star trek generations - beyond the nexus (usa, europe).bin", 0x40000, 0x087fc5f0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_stgbeyn) -STD_ROM_FN(gg_stgbeyn) - -struct BurnDriver BurnDrvgg_stgbeyn = { - "gg_stgbeyn", NULL, NULL, NULL, "1994", - "Star Trek Generations - Beyond the Nexus (Euro, USA)\0", NULL, "Absolute Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_stgbeynRomInfo, gg_stgbeynRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Star Wars (Euro) - -static struct BurnRomInfo gg_starwarsRomDesc[] = { - { "star wars (europe).bin", 0x80000, 0xdb9bc599, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_starwars) -STD_ROM_FN(gg_starwars) - -struct BurnDriver BurnDrvgg_starwars = { - "gg_starwars", NULL, NULL, NULL, "1993", - "Star Wars (Euro)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_starwarsRomInfo, gg_starwarsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Star Wars (USA) - -static struct BurnRomInfo gg_starwarsuRomDesc[] = { - { "star wars (usa).bin", 0x80000, 0x0228769c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_starwarsu) -STD_ROM_FN(gg_starwarsu) - -struct BurnDriver BurnDrvgg_starwarsu = { - "gg_starwarsu", "gg_starwars", NULL, NULL, "1993", - "Star Wars (USA)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_starwarsuRomInfo, gg_starwarsuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Stargate (World) - -static struct BurnRomInfo gg_stargateRomDesc[] = { - { "stargate (world).bin", 0x40000, 0xfc7c64e4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_stargate) -STD_ROM_FN(gg_stargate) - -struct BurnDriver BurnDrvgg_stargate = { - "gg_stargate", NULL, NULL, NULL, "1994", - "Stargate (World)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_stargateRomInfo, gg_stargateRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Street Hero (USA, Prototype, SMS Mode) - -static struct BurnRomInfo gg_sheroRomDesc[] = { - { "street hero [proto 0] (us).bin", 0x80000, 0x9fa727a0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_shero) -STD_ROM_FN(gg_shero) - -struct BurnDriver BurnDrvgg_shero = { - "gg_shero", NULL, NULL, NULL, "1993", - "Street Hero (USA, Prototype, SMS Mode)\0", NULL, "Innovation Tech", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_sheroRomInfo, gg_sheroRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Street Hero (USA, Prototype Alt, SMS Mode) - -static struct BurnRomInfo gg_sheroaRomDesc[] = { - { "street hero [proto 1] (us).bin", 0x80000, 0xfb481971, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sheroa) -STD_ROM_FN(gg_sheroa) - -struct BurnDriver BurnDrvgg_sheroa = { - "gg_sheroa", "gg_shero", NULL, NULL, "1993", - "Street Hero (USA, Prototype Alt, SMS Mode)\0", NULL, "Innovation Tech", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_MAPPER_CODIES | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_sheroaRomInfo, gg_sheroaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Streets of Rage (World) ~ Bare Knuckle (Jpn) - -static struct BurnRomInfo gg_sorRomDesc[] = { - { "streets of rage (world).bin", 0x40000, 0x3d8bcf1d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sor) -STD_ROM_FN(gg_sor) - -struct BurnDriver BurnDrvgg_sor = { - "gg_sor", NULL, NULL, NULL, "1992", - "Streets of Rage (World) ~ Bare Knuckle (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sorRomInfo, gg_sorRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Streets of Rage II (World) ~ Bare Knuckle II - Shitou e no Chingonka (Jpn) - -static struct BurnRomInfo gg_sor2RomDesc[] = { - { "mpr-15665.ic1", 0x80000, 0x0b618409, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sor2) -STD_ROM_FN(gg_sor2) - -struct BurnDriver BurnDrvgg_sor2 = { - "gg_sor2", NULL, NULL, NULL, "1993", - "Streets of Rage II (World) ~ Bare Knuckle II - Shitou e no Chingonka (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sor2RomInfo, gg_sor2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Striker (Euro) - -static struct BurnRomInfo gg_strikerRomDesc[] = { - { "striker (europe) (en,fr,de,es,it).bin", 0x80000, 0xb421c057, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_striker) -STD_ROM_FN(gg_striker) - -struct BurnDriver BurnDrvgg_striker = { - "gg_striker", NULL, NULL, NULL, "1995", - "Striker (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_strikerRomInfo, gg_strikerRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Battletank (USA) - -static struct BurnRomInfo gg_sbtankRomDesc[] = { - { "super battletank (usa).bin", 0x40000, 0x73d6745a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sbtank) -STD_ROM_FN(gg_sbtank) - -struct BurnDriver BurnDrvgg_sbtank = { - "gg_sbtank", NULL, NULL, NULL, "1992", - "Super Battletank (USA)\0", NULL, "Majesco", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sbtankRomInfo, gg_sbtankRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Columns (Jpn) - -static struct BurnRomInfo gg_supercoljRomDesc[] = { - { "mpr-17865.ic1", 0x20000, 0x2a100717, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supercolj) -STD_ROM_FN(gg_supercolj) - -struct BurnDriver BurnDrvgg_supercolj = { - "gg_supercolj", "gg_supercol", NULL, NULL, "1995", - "Super Columns (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supercoljRomInfo, gg_supercoljRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Columns (Euro, USA) - -static struct BurnRomInfo gg_supercolRomDesc[] = { - { "super columns (usa, europe).bin", 0x20000, 0x8ba43af3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supercol) -STD_ROM_FN(gg_supercol) - -struct BurnDriver BurnDrvgg_supercol = { - "gg_supercol", NULL, NULL, NULL, "1995", - "Super Columns (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supercolRomInfo, gg_supercolRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Columns (Prototype, 19941201) - -static struct BurnRomInfo gg_supercolp6RomDesc[] = { - { "super columns (prototype - dec 01, 1994).bin", 0x20000, 0x56cf1d4f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supercolp6) -STD_ROM_FN(gg_supercolp6) - -struct BurnDriver BurnDrvgg_supercolp6 = { - "gg_supercolp6", "gg_supercol", NULL, NULL, "1994", - "Super Columns (Prototype, 19941201)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supercolp6RomInfo, gg_supercolp6RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Columns (Prototype, 19941215) - -static struct BurnRomInfo gg_supercolp5RomDesc[] = { - { "super columns (prototype - dec 15, 1994).bin", 0x20000, 0xabe92434, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supercolp5) -STD_ROM_FN(gg_supercolp5) - -struct BurnDriver BurnDrvgg_supercolp5 = { - "gg_supercolp5", "gg_supercol", NULL, NULL, "1994", - "Super Columns (Prototype, 19941215)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supercolp5RomInfo, gg_supercolp5RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Columns (Prototype, 19941221) - -static struct BurnRomInfo gg_supercolp4RomDesc[] = { - { "super columns (prototype - dec 21, 1994).bin", 0x20000, 0x81451fc0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supercolp4) -STD_ROM_FN(gg_supercolp4) - -struct BurnDriver BurnDrvgg_supercolp4 = { - "gg_supercolp4", "gg_supercol", NULL, NULL, "1994", - "Super Columns (Prototype, 19941221)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supercolp4RomInfo, gg_supercolp4RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Columns (Prototype, 19941226) - -static struct BurnRomInfo gg_supercolp3RomDesc[] = { - { "super columns (prototype - dec 26, 1994).bin", 0x20000, 0x5c4c633d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supercolp3) -STD_ROM_FN(gg_supercolp3) - -struct BurnDriver BurnDrvgg_supercolp3 = { - "gg_supercolp3", "gg_supercol", NULL, NULL, "1994", - "Super Columns (Prototype, 19941226)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supercolp3RomInfo, gg_supercolp3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Columns (Prototype, 19941228) - -static struct BurnRomInfo gg_supercolp2RomDesc[] = { - { "super columns (prototype - dec 28, 1994).bin", 0x20000, 0x3d931952, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supercolp2) -STD_ROM_FN(gg_supercolp2) - -struct BurnDriver BurnDrvgg_supercolp2 = { - "gg_supercolp2", "gg_supercol", NULL, NULL, "1994", - "Super Columns (Prototype, 19941228)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supercolp2RomInfo, gg_supercolp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Columns (Prototype, 19950106) - -static struct BurnRomInfo gg_supercolp1RomDesc[] = { - { "super columns (prototype - jan 06, 1995).bin", 0x20000, 0x096f4ff5, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supercolp1) -STD_ROM_FN(gg_supercolp1) - -struct BurnDriver BurnDrvgg_supercolp1 = { - "gg_supercolp1", "gg_supercol", NULL, NULL, "1995", - "Super Columns (Prototype, 19950106)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supercolp1RomInfo, gg_supercolp1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Columns (Prototype, 19941111) - -static struct BurnRomInfo gg_supercolp7RomDesc[] = { - { "super columns (prototype - nov 11, 1994).bin", 0x20000, 0xf28f89d1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supercolp7) -STD_ROM_FN(gg_supercolp7) - -struct BurnDriver BurnDrvgg_supercolp7 = { - "gg_supercolp7", "gg_supercol", NULL, NULL, "1994", - "Super Columns (Prototype, 19941111)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supercolp7RomInfo, gg_supercolp7RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Golf (USA) - -static struct BurnRomInfo gg_supgolfRomDesc[] = { - { "super golf (usa).bin", 0x20000, 0xe9570f36, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supgolf) -STD_ROM_FN(gg_supgolf) - -struct BurnDriver BurnDrvgg_supgolf = { - "gg_supgolf", NULL, NULL, NULL, "1991", - "Super Golf (USA)\0", NULL, "Sage's Creations", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supgolfRomInfo, gg_supgolfRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Golf (Jpn) - -static struct BurnRomInfo gg_supgolfjRomDesc[] = { - { "super golf (japan).bin", 0x20000, 0x528cbbce, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supgolfj) -STD_ROM_FN(gg_supgolfj) - -struct BurnDriver BurnDrvgg_supgolfj = { - "gg_supgolfj", "gg_supgolf", NULL, NULL, "1991", - "Super Golf (Jpn)\0", NULL, "Sigma Enterprises", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supgolfjRomInfo, gg_supgolfjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Kick Off (Euro, SMS Mode) - -static struct BurnRomInfo gg_skickoffRomDesc[] = { - { "super kick off (euro).bin", 0x40000, 0x10dbbef4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_skickoff) -STD_ROM_FN(gg_skickoff) - -struct BurnDriver BurnDrvgg_skickoff = { - "gg_skickoff", NULL, NULL, NULL, "1991", - "Super Kick Off (Euro, SMS Mode)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_skickoffRomInfo, gg_skickoffRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Momotarou Dentetsu III (Jpn) - -static struct BurnRomInfo gg_smomo3RomDesc[] = { - { "mpr-18440.ic1", 0x80000, 0xb731bb80, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_smomo3) -STD_ROM_FN(gg_smomo3) - -struct BurnDriver BurnDrvgg_smomo3 = { - "gg_smomo3", NULL, NULL, NULL, "1995", - "Super Momotarou Dentetsu III (Jpn)\0", NULL, "Hudson", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_smomo3RomInfo, gg_smomo3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Monaco GP (Jpn) - -static struct BurnRomInfo gg_smgpjRomDesc[] = { - { "super monaco gp (japan).bin", 0x20000, 0x4f686c4a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_smgpj) -STD_ROM_FN(gg_smgpj) - -struct BurnDriver BurnDrvgg_smgpj = { - "gg_smgpj", "gg_smgp", NULL, NULL, "1990", - "Super Monaco GP (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_smgpjRomInfo, gg_smgpjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Monaco GP (Euro, USA, Bra) - -static struct BurnRomInfo gg_smgpRomDesc[] = { - { "mpr-13771.ic1", 0x20000, 0xfcf12547, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_smgp) -STD_ROM_FN(gg_smgp) - -struct BurnDriver BurnDrvgg_smgp = { - "gg_smgp", NULL, NULL, NULL, "1991", - "Super Monaco GP (Euro, USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_smgpRomInfo, gg_smgpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Off Road (Euro, USA) - -static struct BurnRomInfo gg_superoffRomDesc[] = { - { "super off road (usa, europe).bin", 0x20000, 0xe8b42b1f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_superoff) -STD_ROM_FN(gg_superoff) - -struct BurnDriver BurnDrvgg_superoff = { - "gg_superoff", NULL, NULL, NULL, "1992", - "Super Off Road (Euro, USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_superoffRomInfo, gg_superoffRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Return of the Jedi (Euro, USA) - -static struct BurnRomInfo gg_suprjediRomDesc[] = { - { "super return of the jedi (usa, europe).bin", 0x80000, 0x4a38b6b6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_suprjedi) -STD_ROM_FN(gg_suprjedi) - -struct BurnDriver BurnDrvgg_suprjedi = { - "gg_suprjedi", NULL, NULL, NULL, "1995", - "Super Return of the Jedi (Euro, USA)\0", NULL, "Black Pearl", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_suprjediRomInfo, gg_suprjediRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Smash T.V. (World) - -static struct BurnRomInfo gg_smashtvRomDesc[] = { - { "super smash t.v. (world).bin", 0x40000, 0x1006e4e3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_smashtv) -STD_ROM_FN(gg_smashtv) - -struct BurnDriver BurnDrvgg_smashtv = { - "gg_smashtv", NULL, NULL, NULL, "1992", - "Smash T.V. (World)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_smashtvRomInfo, gg_smashtvRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Space Invaders (Euro, USA) - -static struct BurnRomInfo gg_ssinvRomDesc[] = { - { "super space invaders (usa, europe).bin", 0x40000, 0xdfe38e24, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ssinv) -STD_ROM_FN(gg_ssinv) - -struct BurnDriver BurnDrvgg_ssinv = { - "gg_ssinv", NULL, NULL, NULL, "1992", - "Super Space Invaders (Euro, USA)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ssinvRomInfo, gg_ssinvRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Super Tetris (Kor, SMS Mode?) - -static struct BurnRomInfo gg_stetrisRomDesc[] = { - { "super tetris (k) [s][!].bin", 0x10000, 0xbd1cc7df, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_stetris) -STD_ROM_FN(gg_stetris) - -struct BurnDriver BurnDrvgg_stetris = { - "gg_stetris", NULL, NULL, NULL, "199?", - "Super Tetris (Kor, SMS Mode?)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE | HARDWARE_SMS_JAPANESE, GBF_MISC, 0, - GGGetZipName, gg_stetrisRomInfo, gg_stetrisRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Superman - The Man of Steel (Euro) - -static struct BurnRomInfo gg_supermanRomDesc[] = { - { "mpr-15504-f.ic1", 0x40000, 0x73df5a15, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_superman) -STD_ROM_FN(gg_superman) - -struct BurnDriver BurnDrvgg_superman = { - "gg_superman", NULL, NULL, NULL, "1993", - "Superman - The Man of Steel (Euro)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supermanRomInfo, gg_supermanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Superman - The Man of Steel (Euro, Prototype) - -static struct BurnRomInfo gg_supermanpRomDesc[] = { - { "superman - the man of steel (proto).bin", 0x40000, 0xaa3f2172, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_supermanp) -STD_ROM_FN(gg_supermanp) - -struct BurnDriver BurnDrvgg_supermanp = { - "gg_supermanp", "gg_superman", NULL, NULL, "1993", - "Superman - The Man of Steel (Euro, Prototype)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_supermanpRomInfo, gg_supermanpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Surf Ninjas (USA, Bra) - -static struct BurnRomInfo gg_surfninjRomDesc[] = { - { "surf ninjas (usa).bin", 0x80000, 0x284482a8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_surfninj) -STD_ROM_FN(gg_surfninj) - -struct BurnDriver BurnDrvgg_surfninj = { - "gg_surfninj", NULL, NULL, NULL, "1993", - "Surf Ninjas (USA, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_surfninjRomInfo, gg_surfninjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Sylvan Tale (Jpn) - -static struct BurnRomInfo gg_sylvanRomDesc[] = { - { "sylvan tale (japan).bin", 0x80000, 0x45ef2062, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_sylvan) -STD_ROM_FN(gg_sylvan) - -struct BurnDriver BurnDrvgg_sylvan = { - "gg_sylvan", NULL, NULL, NULL, "1995", - "Sylvan Tale (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_sylvanRomInfo, gg_sylvanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// T2 - The Arcade Game (Euro, USA) - -static struct BurnRomInfo gg_t2agRomDesc[] = { - { "t2 - the arcade game (usa, europe).bin", 0x80000, 0x9479c83a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_t2ag) -STD_ROM_FN(gg_t2ag) - -struct BurnDriver BurnDrvgg_t2ag = { - "gg_t2ag", NULL, NULL, NULL, "1993", - "T2 - The Arcade Game (Euro, USA)\0", NULL, "Arena", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_t2agRomInfo, gg_t2agRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// T2 - The Arcade Game (Jpn) - -static struct BurnRomInfo gg_t2agjRomDesc[] = { - { "t2 - the arcade game (jp).bin", 0x80000, 0x0b1ba87f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_t2agj) -STD_ROM_FN(gg_t2agj) - -struct BurnDriver BurnDrvgg_t2agj = { - "gg_t2agj", "gg_t2ag", NULL, NULL, "1993", - "T2 - The Arcade Game (Jpn)\0", NULL, "Acclaim", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_t2agjRomInfo, gg_t2agjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tails Adventures (World) - -static struct BurnRomInfo gg_tailsadvRomDesc[] = { - { "tails adventures (world) (en,ja).bin", 0x80000, 0x5bb6e5d6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tailsadv) -STD_ROM_FN(gg_tailsadv) - -struct BurnDriver BurnDrvgg_tailsadv = { - "gg_tailsadv", NULL, NULL, NULL, "1995", - "Tails Adventures (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tailsadvRomInfo, gg_tailsadvRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tails no Skypatrol (Jpn) - -static struct BurnRomInfo gg_tailskypRomDesc[] = { - { "tails no skypatrol (japan).bin", 0x40000, 0x88618afa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tailskyp) -STD_ROM_FN(gg_tailskyp) - -struct BurnDriver BurnDrvgg_tailskyp = { - "gg_tailskyp", NULL, NULL, NULL, "1995", - "Tails no Skypatrol (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tailskypRomInfo, gg_tailskypRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taisen Mahjong HaoPai (Jpn) - -static struct BurnRomInfo gg_taisnmjRomDesc[] = { - { "taisen mahjong haopai (japan).bin", 0x20000, 0xcf9c607c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_taisnmj) -STD_ROM_FN(gg_taisnmj) - -struct BurnDriver BurnDrvgg_taisnmj = { - "gg_taisnmj", NULL, NULL, NULL, "1990", - "Taisen Mahjong HaoPai (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_taisnmjRomInfo, gg_taisnmjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taisen Mahjong HaoPai 2 (Jpn) - -static struct BurnRomInfo gg_taisnmj2RomDesc[] = { - { "taisen mahjong haopai 2 (japan).bin", 0x80000, 0x20527530, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_taisnmj2) -STD_ROM_FN(gg_taisnmj2) - -struct BurnDriver BurnDrvgg_taisnmj2 = { - "gg_taisnmj2", NULL, NULL, NULL, "1993", - "Taisen Mahjong HaoPai 2 (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_taisnmj2RomInfo, gg_taisnmj2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taisen-gata Daisenryaku G (Jpn) - -static struct BurnRomInfo gg_daisenrgRomDesc[] = { - { "mpr-14246.ic1", 0x40000, 0x7b7717b8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_daisenrg) -STD_ROM_FN(gg_daisenrg) - -struct BurnDriver BurnDrvgg_daisenrg = { - "gg_daisenrg", NULL, NULL, NULL, "1991", - "Taisen-gata Daisenryaku G (Jpn)\0", NULL, "SystemSoft", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_daisenrgRomInfo, gg_daisenrgRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taito Chase H.Q. (Jpn, SMS Mode) - -static struct BurnRomInfo gg_chasehqjRomDesc[] = { - { "taito chase h.q. (japan).bin", 0x20000, 0x7bb81e3d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chasehqj) -STD_ROM_FN(gg_chasehqj) - -struct BurnDriver BurnDrvgg_chasehqj = { - "gg_chasehqj", "gg_chasehq", NULL, NULL, "1991", - "Taito Chase H.Q. (Jpn, SMS Mode)\0", NULL, "Taito", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE | HARDWARE_SMS_JAPANESE, GBF_MISC, 0, - GGGetZipName, gg_chasehqjRomInfo, gg_chasehqjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taito Chase H.Q. (USA, SMS Mode) - -static struct BurnRomInfo gg_chasehqRomDesc[] = { - { "chase h.q. [sms-gg].bin", 0x20000, 0xc8381def, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_chasehq) -STD_ROM_FN(gg_chasehq) - -struct BurnDriver BurnDrvgg_chasehq = { - "gg_chasehq", NULL, NULL, NULL, "1991", - "Taito Chase H.Q. (USA, SMS Mode)\0", NULL, "Taito", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_chasehqRomInfo, gg_chasehqRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tale Spin (Euro, USA) - -static struct BurnRomInfo gg_talespinRomDesc[] = { - { "tale spin (usa, europe).bin", 0x40000, 0xf1732ffe, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_talespin) -STD_ROM_FN(gg_talespin) - -struct BurnDriver BurnDrvgg_talespin = { - "gg_talespin", NULL, NULL, NULL, "1993", - "Tale Spin (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_talespinRomInfo, gg_talespinRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tama and Friends Sanchoume Kouen - Tamalympic (Jpn) - -static struct BurnRomInfo gg_tamalympRomDesc[] = { - { "tama and friends sanchoume kouen - tamalympic (japan).bin", 0x40000, 0xdd1d2ebf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tamalymp) -STD_ROM_FN(gg_tamalymp) - -struct BurnDriver BurnDrvgg_tamalymp = { - "gg_tamalymp", NULL, NULL, NULL, "1995", - "Tama and Friends Sanchoume Kouen - Tamalympic (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tamalympRomInfo, gg_tamalympRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tarot no Yakata (Jpn) - -static struct BurnRomInfo gg_tarotRomDesc[] = { - { "tarot no yakata (japan).bin", 0x20000, 0x57834c03, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tarot) -STD_ROM_FN(gg_tarot) - -struct BurnDriver BurnDrvgg_tarot = { - "gg_tarot", NULL, NULL, NULL, "1991", - "Tarot no Yakata (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tarotRomInfo, gg_tarotRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tarzan - Lord of the Jungle (Euro) - -static struct BurnRomInfo gg_tarzanRomDesc[] = { - { "tarzan - lord of the jungle (europe).bin", 0x40000, 0xef3afe8b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tarzan) -STD_ROM_FN(gg_tarzan) - -struct BurnDriver BurnDrvgg_tarzan = { - "gg_tarzan", NULL, NULL, NULL, "1994", - "Tarzan - Lord of the Jungle (Euro)\0", NULL, "GameTek", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - GGGetZipName, gg_tarzanRomInfo, gg_tarzanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tatakae! Pro Yakyuu Twin League (Jpn) - -static struct BurnRomInfo gg_proyaktlRomDesc[] = { - { "tatakae! pro yakyuu twin league (japan).bin", 0x80000, 0xbec57602, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_proyaktl) -STD_ROM_FN(gg_proyaktl) - -struct BurnDriver BurnDrvgg_proyaktl = { - "gg_proyaktl", NULL, NULL, NULL, "1995", - "Tatakae! Pro Yakyuu Twin League (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_proyaktlRomInfo, gg_proyaktlRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Euro, USA) - -static struct BurnRomInfo gg_tazmarsRomDesc[] = { - { "taz in escape from mars (usa, europe).bin", 0x80000, 0xeebad66b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmars) -STD_ROM_FN(gg_tazmars) - -struct BurnDriver BurnDrvgg_tazmars = { - "gg_tazmars", NULL, NULL, NULL, "1994", - "Taz in Escape from Mars (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsRomInfo, gg_tazmarsRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940810) - -static struct BurnRomInfo gg_tazmarsp13RomDesc[] = { - { "taz in escape from mars (prototype - aug 10, 1994).bin", 0x80000, 0x92388016, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp13) -STD_ROM_FN(gg_tazmarsp13) - -struct BurnDriver BurnDrvgg_tazmarsp13 = { - "gg_tazmarsp13", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940810)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp13RomInfo, gg_tazmarsp13RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940812) - -static struct BurnRomInfo gg_tazmarsp12RomDesc[] = { - { "taz in escape from mars (prototype - aug 12, 1994).bin", 0x80000, 0xa43fdfad, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp12) -STD_ROM_FN(gg_tazmarsp12) - -struct BurnDriver BurnDrvgg_tazmarsp12 = { - "gg_tazmarsp12", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940812)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp12RomInfo, gg_tazmarsp12RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940814) - -static struct BurnRomInfo gg_tazmarsp11RomDesc[] = { - { "taz in escape from mars (prototype - aug 14, 1994).bin", 0x80000, 0x9267d968, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp11) -STD_ROM_FN(gg_tazmarsp11) - -struct BurnDriver BurnDrvgg_tazmarsp11 = { - "gg_tazmarsp11", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940814)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp11RomInfo, gg_tazmarsp11RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940819) - -static struct BurnRomInfo gg_tazmarsp10RomDesc[] = { - { "taz in escape from mars (prototype - aug 19, 1994).bin", 0x80000, 0x57747640, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp10) -STD_ROM_FN(gg_tazmarsp10) - -struct BurnDriver BurnDrvgg_tazmarsp10 = { - "gg_tazmarsp10", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940819)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp10RomInfo, gg_tazmarsp10RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940823) - -static struct BurnRomInfo gg_tazmarsp09RomDesc[] = { - { "taz in escape from mars (prototype - aug 23, 1994).bin", 0x80000, 0x6cd0fd78, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp09) -STD_ROM_FN(gg_tazmarsp09) - -struct BurnDriver BurnDrvgg_tazmarsp09 = { - "gg_tazmarsp09", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940823)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp09RomInfo, gg_tazmarsp09RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940829-B) - -static struct BurnRomInfo gg_tazmarsp08RomDesc[] = { - { "taz in escape from mars (prototype - aug 29, 1994 - b).bin", 0x80000, 0x3c03919d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp08) -STD_ROM_FN(gg_tazmarsp08) - -struct BurnDriver BurnDrvgg_tazmarsp08 = { - "gg_tazmarsp08", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940829-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp08RomInfo, gg_tazmarsp08RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940830) - -static struct BurnRomInfo gg_tazmarsp07RomDesc[] = { - { "taz in escape from mars (prototype - aug 30, 1994).bin", 0x80000, 0x09679b89, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp07) -STD_ROM_FN(gg_tazmarsp07) - -struct BurnDriver BurnDrvgg_tazmarsp07 = { - "gg_tazmarsp07", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940830)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp07RomInfo, gg_tazmarsp07RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940511) - -static struct BurnRomInfo gg_tazmarsp14RomDesc[] = { - { "taz in escape from mars (prototype - may 11, 1994).bin", 0x40000, 0x030f396a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp14) -STD_ROM_FN(gg_tazmarsp14) - -struct BurnDriver BurnDrvgg_tazmarsp14 = { - "gg_tazmarsp14", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940511)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp14RomInfo, gg_tazmarsp14RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940902) - -static struct BurnRomInfo gg_tazmarsp06RomDesc[] = { - { "taz in escape from mars (prototype - sep 02, 1994).bin", 0x80000, 0x18913d93, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp06) -STD_ROM_FN(gg_tazmarsp06) - -struct BurnDriver BurnDrvgg_tazmarsp06 = { - "gg_tazmarsp06", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940902)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp06RomInfo, gg_tazmarsp06RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940905-B) - -static struct BurnRomInfo gg_tazmarsp05RomDesc[] = { - { "taz in escape from mars (prototype - sep 05, 1994 - b).bin", 0x80000, 0xd84a631c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp05) -STD_ROM_FN(gg_tazmarsp05) - -struct BurnDriver BurnDrvgg_tazmarsp05 = { - "gg_tazmarsp05", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940905-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp05RomInfo, gg_tazmarsp05RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940905-C) - -static struct BurnRomInfo gg_tazmarsp04RomDesc[] = { - { "taz in escape from mars (prototype - sep 05, 1994 - c).bin", 0x80000, 0x61330a58, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp04) -STD_ROM_FN(gg_tazmarsp04) - -struct BurnDriver BurnDrvgg_tazmarsp04 = { - "gg_tazmarsp04", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940905-C)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp04RomInfo, gg_tazmarsp04RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940906-D) - -static struct BurnRomInfo gg_tazmarsp03RomDesc[] = { - { "taz in escape from mars (prototype - sep 06, 1994 - d).bin", 0x80000, 0x1f040bca, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp03) -STD_ROM_FN(gg_tazmarsp03) - -struct BurnDriver BurnDrvgg_tazmarsp03 = { - "gg_tazmarsp03", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940906-D)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp03RomInfo, gg_tazmarsp03RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940909-B) - -static struct BurnRomInfo gg_tazmarsp02RomDesc[] = { - { "taz in escape from mars (prototype - sep 09, 1994 - b).bin", 0x80000, 0xc867da05, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp02) -STD_ROM_FN(gg_tazmarsp02) - -struct BurnDriver BurnDrvgg_tazmarsp02 = { - "gg_tazmarsp02", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940909-B)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp02RomInfo, gg_tazmarsp02RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz in Escape from Mars (Prototype, 19940910) - -static struct BurnRomInfo gg_tazmarsp01RomDesc[] = { - { "taz in escape from mars (prototype - sep 10, 1994).bin", 0x80000, 0xfaf4bec0, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmarsp01) -STD_ROM_FN(gg_tazmarsp01) - -struct BurnDriver BurnDrvgg_tazmarsp01 = { - "gg_tazmarsp01", "gg_tazmars", NULL, NULL, "1994", - "Taz in Escape from Mars (Prototype, 19940910)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmarsp01RomInfo, gg_tazmarsp01RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Taz-Mania - The Search for the Lost Seabirds (Euro, USA) - -static struct BurnRomInfo gg_tazmaniaRomDesc[] = { - { "epoxy.u1", 0x40000, 0x36040c24, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tazmania) -STD_ROM_FN(gg_tazmania) - -struct BurnDriver BurnDrvgg_tazmania = { - "gg_tazmania", NULL, NULL, NULL, "1992", - "Taz-Mania - The Search for the Lost Seabirds (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tazmaniaRomInfo, gg_tazmaniaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (World) - -static struct BurnRomInfo gg_tempojrRomDesc[] = { - { "mpr-17792-s.ic1", 0x80000, 0xde466796, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojr) -STD_ROM_FN(gg_tempojr) - -struct BurnDriver BurnDrvgg_tempojr = { - "gg_tempojr", NULL, NULL, NULL, "1995", - "Tempo Jr. (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrRomInfo, gg_tempojrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (Prototype, 19941205) - -static struct BurnRomInfo gg_tempojrp8RomDesc[] = { - { "tempo jr. (prototype - dec 05, 1994).bin", 0x80000, 0x3475d48e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojrp8) -STD_ROM_FN(gg_tempojrp8) - -struct BurnDriver BurnDrvgg_tempojrp8 = { - "gg_tempojrp8", "gg_tempojr", NULL, NULL, "1994", - "Tempo Jr. (Prototype, 19941205)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrp8RomInfo, gg_tempojrp8RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (Prototype, 19941212) - -static struct BurnRomInfo gg_tempojrp7RomDesc[] = { - { "tempo jr. (prototype - dec 12, 1994).bin", 0x80000, 0xfb9a5885, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojrp7) -STD_ROM_FN(gg_tempojrp7) - -struct BurnDriver BurnDrvgg_tempojrp7 = { - "gg_tempojrp7", "gg_tempojr", NULL, NULL, "1994", - "Tempo Jr. (Prototype, 19941212)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrp7RomInfo, gg_tempojrp7RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (Prototype, 19941226) - -static struct BurnRomInfo gg_tempojrp6RomDesc[] = { - { "tempo jr. (prototype - dec 26, 1994).bin", 0x80000, 0xe484e41c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojrp6) -STD_ROM_FN(gg_tempojrp6) - -struct BurnDriver BurnDrvgg_tempojrp6 = { - "gg_tempojrp6", "gg_tempojr", NULL, NULL, "1994", - "Tempo Jr. (Prototype, 19941226)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrp6RomInfo, gg_tempojrp6RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (Prototype, 19950206) - -static struct BurnRomInfo gg_tempojrp2RomDesc[] = { - { "tempo jr. (prototype - feb 06, 1995).bin", 0x80000, 0x3ef6551c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojrp2) -STD_ROM_FN(gg_tempojrp2) - -struct BurnDriver BurnDrvgg_tempojrp2 = { - "gg_tempojrp2", "gg_tempojr", NULL, NULL, "1995", - "Tempo Jr. (Prototype, 19950206)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrp2RomInfo, gg_tempojrp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (Prototype, 19950215) - -static struct BurnRomInfo gg_tempojrp1RomDesc[] = { - { "tempo jr. (prototype - feb 15, 1995).bin", 0x80000, 0x79e83d67, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojrp1) -STD_ROM_FN(gg_tempojrp1) - -struct BurnDriver BurnDrvgg_tempojrp1 = { - "gg_tempojrp1", "gg_tempojr", NULL, NULL, "1995", - "Tempo Jr. (Prototype, 19950215)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrp1RomInfo, gg_tempojrp1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (Prototype, 19950117) - -static struct BurnRomInfo gg_tempojrp5RomDesc[] = { - { "tempo jr. (prototype - jan 17, 1995).bin", 0x80000, 0xab6dc88c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojrp5) -STD_ROM_FN(gg_tempojrp5) - -struct BurnDriver BurnDrvgg_tempojrp5 = { - "gg_tempojrp5", "gg_tempojr", NULL, NULL, "1995", - "Tempo Jr. (Prototype, 19950117)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrp5RomInfo, gg_tempojrp5RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (Prototype, 19950120) - -static struct BurnRomInfo gg_tempojrp4RomDesc[] = { - { "tempo jr. (prototype - jan 20, 1995).bin", 0x80000, 0x96d64b16, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojrp4) -STD_ROM_FN(gg_tempojrp4) - -struct BurnDriver BurnDrvgg_tempojrp4 = { - "gg_tempojrp4", "gg_tempojr", NULL, NULL, "1995", - "Tempo Jr. (Prototype, 19950120)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrp4RomInfo, gg_tempojrp4RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (Prototype, 19950131) - -static struct BurnRomInfo gg_tempojrp3RomDesc[] = { - { "tempo jr. (prototype - jan 31, 1995).bin", 0x80000, 0x7afedf36, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojrp3) -STD_ROM_FN(gg_tempojrp3) - -struct BurnDriver BurnDrvgg_tempojrp3 = { - "gg_tempojrp3", "gg_tempojr", NULL, NULL, "1995", - "Tempo Jr. (Prototype, 19950131)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrp3RomInfo, gg_tempojrp3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tempo Jr. (Prototype, 19941128) - -static struct BurnRomInfo gg_tempojrp9RomDesc[] = { - { "tempo jr. (prototype - nov 28, 1994).bin", 0x80000, 0xa33b5b92, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tempojrp9) -STD_ROM_FN(gg_tempojrp9) - -struct BurnDriver BurnDrvgg_tempojrp9 = { - "gg_tempojrp9", "gg_tempojr", NULL, NULL, "1994", - "Tempo Jr. (Prototype, 19941128)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tempojrp9RomInfo, gg_tempojrp9RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tengen World Cup Soccer (Euro, USA) - -static struct BurnRomInfo gg_tengenwcRomDesc[] = { - { "mpr-15642-f.ic1", 0x40000, 0xdd6d2e34, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tengenwc) -STD_ROM_FN(gg_tengenwc) - -struct BurnDriver BurnDrvgg_tengenwc = { - "gg_tengenwc", NULL, NULL, NULL, "1993", - "Tengen World Cup Soccer (Euro, USA)\0", NULL, "Tengen", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tengenwcRomInfo, gg_tengenwcRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Terminator 2 - Judgment Day (Euro, USA) - -static struct BurnRomInfo gg_term2RomDesc[] = { - { "terminator 2 - judgment day (usa, europe).bin", 0x40000, 0x1bd15773, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_term2) -STD_ROM_FN(gg_term2) - -struct BurnDriver BurnDrvgg_term2 = { - "gg_term2", NULL, NULL, NULL, "1993", - "Terminator 2 - Judgment Day (Euro, USA)\0", "Glitchy graphics, use the SMS version, instead!", "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_term2RomInfo, gg_term2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// The Terminator (Euro, USA) - -static struct BurnRomInfo gg_termntrRomDesc[] = { - { "terminator, the (usa, europe).bin", 0x40000, 0xc029a5fd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_termntr) -STD_ROM_FN(gg_termntr) - -struct BurnDriver BurnDrvgg_termntr = { - "gg_termntr", NULL, NULL, NULL, "1992", - "The Terminator (Euro, USA)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_termntrRomInfo, gg_termntrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tesserae (Euro, USA) - -static struct BurnRomInfo gg_tesseraeRomDesc[] = { - { "tesserae (usa, europe).bin", 0x20000, 0xca0e11cc, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tesserae) -STD_ROM_FN(gg_tesserae) - -struct BurnDriver BurnDrvgg_tesserae = { - "gg_tesserae", NULL, NULL, NULL, "1993", - "Tesserae (Euro, USA)\0", NULL, "GameTek", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tesseraeRomInfo, gg_tesseraeRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tintin in Tibet (Euro) - -static struct BurnRomInfo gg_tintinRomDesc[] = { - { "tintin in tibet (europe) (en,fr,de,es,nl,sv).bin", 0x80000, 0x969cf389, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tintin) -STD_ROM_FN(gg_tintin) - -struct BurnDriver BurnDrvgg_tintin = { - "gg_tintin", NULL, NULL, NULL, "1996", - "Tintin in Tibet (Euro)\0", NULL, "Infogrames", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tintinRomInfo, gg_tintinRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tom and Jerry - The Movie (Jpn) - -static struct BurnRomInfo gg_tomjermvjRomDesc[] = { - { "tom and jerry - the movie (jp).bin", 0x40000, 0xa1453efa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tomjermvj) -STD_ROM_FN(gg_tomjermvj) - -struct BurnDriver BurnDrvgg_tomjermvj = { - "gg_tomjermvj", "gg_tomjermv", NULL, NULL, "1993", - "Tom and Jerry - The Movie (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tomjermvjRomInfo, gg_tomjermvjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Tom and Jerry - The Movie (USA) - -static struct BurnRomInfo gg_tomjermvRomDesc[] = { - { "tom and jerry - the movie (usa).bin", 0x40000, 0x5cd33ff2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_tomjermv) -STD_ROM_FN(gg_tomjermv) - -struct BurnDriver BurnDrvgg_tomjermv = { - "gg_tomjermv", NULL, NULL, NULL, "1993", - "Tom and Jerry - The Movie (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_tomjermvRomInfo, gg_tomjermvRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Torarete Tamaru ka!? (Jpn) - -static struct BurnRomInfo gg_torareteRomDesc[] = { - { "mpr-16707.ic1", 0x80000, 0x5bcf9b97, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_torarete) -STD_ROM_FN(gg_torarete) - -struct BurnDriver BurnDrvgg_torarete = { - "gg_torarete", NULL, NULL, NULL, "1994", - "Torarete Tamaru ka!? (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_torareteRomInfo, gg_torareteRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// True Lies (World) - -static struct BurnRomInfo gg_trueliesRomDesc[] = { - { "true lies (world).bin", 0x80000, 0x5173b02a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_truelies) -STD_ROM_FN(gg_truelies) - -struct BurnDriver BurnDrvgg_truelies = { - "gg_truelies", NULL, NULL, NULL, "1995", - "True Lies (World)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_trueliesRomInfo, gg_trueliesRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Ultimate Soccer (Euro, Jpn, Bra) - -static struct BurnRomInfo gg_ultsoccrRomDesc[] = { - { "mpr-15827.ic1", 0x40000, 0x820965a3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ultsoccr) -STD_ROM_FN(gg_ultsoccr) - -struct BurnDriver BurnDrvgg_ultsoccr = { - "gg_ultsoccr", NULL, NULL, NULL, "1993", - "Ultimate Soccer (Euro, Jpn, Bra)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ultsoccrRomInfo, gg_ultsoccrRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Urban Strike (Euro, USA) - -static struct BurnRomInfo gg_ustrikeRomDesc[] = { - { "urban strike (usa, europe).bin", 0x80000, 0x185e9fc1, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_ustrike) -STD_ROM_FN(gg_ustrike) - -struct BurnDriver BurnDrvgg_ustrike = { - "gg_ustrike", NULL, NULL, NULL, "1995", - "Urban Strike (Euro, USA)\0", NULL, "Black Pearl", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_ustrikeRomInfo, gg_ustrikeRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Vampire - Master of Darkness (USA) - -static struct BurnRomInfo gg_vampireRomDesc[] = { - { "vampire - master of darkness (usa).bin", 0x40000, 0x7ec64025, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_vampire) -STD_ROM_FN(gg_vampire) - -struct BurnDriver BurnDrvgg_vampire = { - "gg_vampire", "gg_mastdark", NULL, NULL, "1993", - "Vampire - Master of Darkness (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_vampireRomInfo, gg_vampireRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Virtua Fighter Animation (Euro, USA) - -static struct BurnRomInfo gg_vfaRomDesc[] = { - { "mpr-18864-s.ic2", 0x100000, 0xd431c452, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_vfa) -STD_ROM_FN(gg_vfa) - -struct BurnDriver BurnDrvgg_vfa = { - "gg_vfa", NULL, NULL, NULL, "1996", - "Virtua Fighter Animation (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_vfaRomInfo, gg_vfaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Virtua Fighter Mini (Jpn) - -static struct BurnRomInfo gg_vfminiRomDesc[] = { - { "mpr-18679-s.ic1", 0x100000, 0xc05657f8, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_vfmini) -STD_ROM_FN(gg_vfmini) - -struct BurnDriver BurnDrvgg_vfmini = { - "gg_vfmini", "gg_vfa", NULL, NULL, "1996", - "Virtua Fighter Mini (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_vfminiRomInfo, gg_vfminiRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// VR Troopers (Euro, USA) - -static struct BurnRomInfo gg_vrtroopRomDesc[] = { - { "vr troopers (usa, europe).bin", 0x80000, 0xb0f22745, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_vrtroop) -STD_ROM_FN(gg_vrtroop) - -struct BurnDriver BurnDrvgg_vrtroop = { - "gg_vrtroop", NULL, NULL, NULL, "1995", - "VR Troopers (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_vrtroopRomInfo, gg_vrtroopRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wagyan Land (Jpn) - -static struct BurnRomInfo gg_wagyanRomDesc[] = { - { "mpr-13930.ic1", 0x40000, 0x29e697b2, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wagyan) -STD_ROM_FN(gg_wagyan) - -struct BurnDriver BurnDrvgg_wagyan = { - "gg_wagyan", NULL, NULL, NULL, "1991", - "Wagyan Land (Jpn)\0", NULL, "Namcot", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wagyanRomInfo, gg_wagyanRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wagyan Land (Jpn, Alt) - -static struct BurnRomInfo gg_wagyanaRomDesc[] = { - { "wagan land (j) [a1].bin", 0x40000, 0xd5369192, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wagyana) -STD_ROM_FN(gg_wagyana) - -struct BurnDriver BurnDrvgg_wagyana = { - "gg_wagyana", "gg_wagyan", NULL, NULL, "1991", - "Wagyan Land (Jpn, Alt)\0", NULL, "Namcot", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wagyanaRomInfo, gg_wagyanaRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wheel of Fortune (USA) - -static struct BurnRomInfo gg_wheelofRomDesc[] = { - { "wheel of fortune (usa).bin", 0x20000, 0xe91cdb2a, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wheelof) -STD_ROM_FN(gg_wheelof) - -struct BurnDriver BurnDrvgg_wheelof = { - "gg_wheelof", NULL, NULL, NULL, "1992", - "Wheel of Fortune (USA)\0", NULL, "GameTek", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wheelofRomInfo, gg_wheelofRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wimbledon (World) - -static struct BurnRomInfo gg_wimbledRomDesc[] = { - { "mpr-14994.ic1", 0x20000, 0xce1108fd, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wimbled) -STD_ROM_FN(gg_wimbled) - -struct BurnDriver BurnDrvgg_wimbled = { - "gg_wimbled", NULL, NULL, NULL, "1992", - "Wimbledon (World)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wimbledRomInfo, gg_wimbledRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Winter Olympics - Lillehammer '94 (Jpn) - -static struct BurnRomInfo gg_wintoljRomDesc[] = { - { "mpr-16350.ic1", 0x80000, 0xd5195a39, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wintolj) -STD_ROM_FN(gg_wintolj) - -struct BurnDriver BurnDrvgg_wintolj = { - "gg_wintolj", "gg_wintol", NULL, NULL, "1994", - "Winter Olympics - Lillehammer '94 (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wintoljRomInfo, gg_wintoljRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Winter Olympics - Lillehammer '94 (Euro, USA) - -static struct BurnRomInfo gg_wintolRomDesc[] = { - { "mpr-16024.ic1", 0x80000, 0xd15d335b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wintol) -STD_ROM_FN(gg_wintol) - -struct BurnDriver BurnDrvgg_wintol = { - "gg_wintol", NULL, NULL, NULL, "1993", - "Winter Olympics - Lillehammer '94 (Euro, USA)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wintolRomInfo, gg_wintolRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wizard Pinball (Euro) - -static struct BurnRomInfo gg_wizardRomDesc[] = { - { "wizard pinball (europe).bin", 0x40000, 0x9e03f96c, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wizard) -STD_ROM_FN(gg_wizard) - -struct BurnDriver BurnDrvgg_wizard = { - "gg_wizard", NULL, NULL, NULL, "1995", - "Wizard Pinball (Euro)\0", NULL, "Domark", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wizardRomInfo, gg_wizardRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wolfchild (Euro) - -static struct BurnRomInfo gg_wolfchldRomDesc[] = { - { "mpr-15717-s.ic1", 0x40000, 0x840a8f8e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wolfchld) -STD_ROM_FN(gg_wolfchld) - -struct BurnDriver BurnDrvgg_wolfchld = { - "gg_wolfchld", NULL, NULL, NULL, "1993", - "Wolfchild (Euro)\0", NULL, "Virgin Interactive", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wolfchldRomInfo, gg_wolfchldRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy (Euro) - -static struct BurnRomInfo gg_wboyRomDesc[] = { - { "mpr-13912.ic1", 0x20000, 0xea2dd3a7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wboy) -STD_ROM_FN(gg_wboy) - -struct BurnDriver BurnDrvgg_wboy = { - "gg_wboy", NULL, NULL, NULL, "1991", - "Wonder Boy (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wboyRomInfo, gg_wboyRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy (Jpn) - -static struct BurnRomInfo gg_wboyjRomDesc[] = { - { "wonder boy (japan).bin", 0x20000, 0x9977fcb3, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wboyj) -STD_ROM_FN(gg_wboyj) - -struct BurnDriver BurnDrvgg_wboyj = { - "gg_wboyj", "gg_wboy", NULL, NULL, "1990", - "Wonder Boy (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wboyjRomInfo, gg_wboyjRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy - The Dragon's Trap (Euro) - -static struct BurnRomInfo gg_wboydtrpRomDesc[] = { - { "mpr-14768.ic1", 0x40000, 0xa74c97a7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wboydtrp) -STD_ROM_FN(gg_wboydtrp) - -struct BurnDriver BurnDrvgg_wboydtrp = { - "gg_wboydtrp", NULL, NULL, NULL, "1992", - "Wonder Boy - The Dragon's Trap (Euro)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wboydtrpRomInfo, gg_wboydtrpRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Wonder Boy III - The Dragon's Trap (Euro, Prototype) - -static struct BurnRomInfo gg_wboydtrppRomDesc[] = { - { "wonder boy iii - the dragon's trap (europe) (beta).bin", 0x40000, 0xdb1b5b44, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wboydtrpp) -STD_ROM_FN(gg_wboydtrpp) - -struct BurnDriver BurnDrvgg_wboydtrpp = { - "gg_wboydtrpp", "gg_wboydtrp", NULL, NULL, "1992", - "Wonder Boy III - The Dragon's Trap (Euro, Prototype)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wboydtrppRomInfo, gg_wboydtrppRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Woody Pop (Euro, USA, v1.1) - -static struct BurnRomInfo gg_woodypopRomDesc[] = { - { "mpr-13808.ic1", 0x08000, 0xb74f3a4f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_woodypop) -STD_ROM_FN(gg_woodypop) - -struct BurnDriver BurnDrvgg_woodypop = { - "gg_woodypop", NULL, NULL, NULL, "1991", - "Woody Pop (Euro, USA, v1.1)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_woodypopRomInfo, gg_woodypopRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Woody Pop (Euro, USA) - -static struct BurnRomInfo gg_woodypop1RomDesc[] = { - { "woody pop (usa, europe).bin", 0x08000, 0x9c0e5a04, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_woodypop1) -STD_ROM_FN(gg_woodypop1) - -struct BurnDriver BurnDrvgg_woodypop1 = { - "gg_woodypop1", "gg_woodypop", NULL, NULL, "1991", - "Woody Pop (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_woodypop1RomInfo, gg_woodypop1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Class Leader Board (Euro, USA) - -static struct BurnRomInfo gg_wcleadRomDesc[] = { - { "mpr-14251.ic1", 0x40000, 0x868fe528, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wclead) -STD_ROM_FN(gg_wclead) - -struct BurnDriver BurnDrvgg_wclead = { - "gg_wclead", NULL, NULL, NULL, "1991", - "World Class Leader Board (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wcleadRomInfo, gg_wcleadRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Cup USA 94 (Euro, USA) - -static struct BurnRomInfo gg_wcup94RomDesc[] = { - { "world cup usa 94 (usa, europe) (en,fr,de,es,it,nl,pt,sv).bin", 0x80000, 0xd2bb3690, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wcup94) -STD_ROM_FN(gg_wcup94) - -struct BurnDriver BurnDrvgg_wcup94 = { - "gg_wcup94", NULL, NULL, NULL, "1994", - "World Cup USA 94 (Euro, USA)\0", NULL, "U.S. Gold", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wcup94RomInfo, gg_wcup94RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// World Derby (Jpn) - -static struct BurnRomInfo gg_wderbyRomDesc[] = { - { "world derby (japan).bin", 0x80000, 0x1e81861f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wderby) -STD_ROM_FN(gg_wderby) - -struct BurnDriver BurnDrvgg_wderby = { - "gg_wderby", NULL, NULL, NULL, "1994", - "World Derby (Jpn)\0", NULL, "CRI", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wderbyRomInfo, gg_wderbyRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// WWF Raw (Euro, USA) - -static struct BurnRomInfo gg_wwfrawRomDesc[] = { - { "wwf raw (usa, europe).bin", 0x80000, 0x8dc68d92, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wwfraw) -STD_ROM_FN(gg_wwfraw) - -struct BurnDriver BurnDrvgg_wwfraw = { - "gg_wwfraw", NULL, NULL, NULL, "1994", - "WWF Raw (Euro, USA)\0", NULL, "Acclaim Entertainment", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wwfrawRomInfo, gg_wwfrawRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// WWF Wrestlemania Steel Cage Challenge (Euro, SMS Mode) - -static struct BurnRomInfo gg_wwfsteelRomDesc[] = { - { "wwf wrestlemania steel cage challenge (europe).bin", 0x40000, 0xda8e95a9, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wwfsteel) -STD_ROM_FN(gg_wwfsteel) - -struct BurnDriver BurnDrvgg_wwfsteel = { - "gg_wwfsteel", NULL, NULL, NULL, "1993", - "WWF Wrestlemania Steel Cage Challenge (Euro, SMS Mode)\0", NULL, "Flying Edge", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR | HARDWARE_SMS_GG_SMS_MODE, GBF_MISC, 0, - GGGetZipName, gg_wwfsteelRomInfo, gg_wwfsteelRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men (USA) - -static struct BurnRomInfo gg_xmenRomDesc[] = { - { "x-men (usa).bin", 0x80000, 0x567a5ee6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmen) -STD_ROM_FN(gg_xmen) - -struct BurnDriver BurnDrvgg_xmen = { - "gg_xmen", NULL, NULL, NULL, "1994", - "X-Men (USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenRomInfo, gg_xmenRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Gamemaster's Legacy (Euro, USA) - -static struct BurnRomInfo gg_xmenglRomDesc[] = { - { "x-men - gamemaster's legacy (usa, europe).bin", 0x80000, 0xc169c344, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmengl) -STD_ROM_FN(gg_xmengl) - -struct BurnDriver BurnDrvgg_xmengl = { - "gg_xmengl", NULL, NULL, NULL, "1994", - "X-Men - Gamemaster's Legacy (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenglRomInfo, gg_xmenglRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Gamemaster's Legacy (Prototype, 19940810) - -static struct BurnRomInfo gg_xmenglp3RomDesc[] = { - { "x-men - gamemaster's legacy (prototype - aug 10, 1994).bin", 0x80000, 0x66cc4034, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenglp3) -STD_ROM_FN(gg_xmenglp3) - -struct BurnDriver BurnDrvgg_xmenglp3 = { - "gg_xmenglp3", "gg_xmengl", NULL, NULL, "1994", - "X-Men - Gamemaster's Legacy (Prototype, 19940810)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenglp3RomInfo, gg_xmenglp3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Gamemaster's Legacy (Prototype 36, 19940831) - -static struct BurnRomInfo gg_xmenglp2RomDesc[] = { - { "x-men - gamemaster's legacy (prototype 36 - aug 31, 1994).bin", 0x80000, 0x271a0a1d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenglp2) -STD_ROM_FN(gg_xmenglp2) - -struct BurnDriver BurnDrvgg_xmenglp2 = { - "gg_xmenglp2", "gg_xmengl", NULL, NULL, "1994", - "X-Men - Gamemaster's Legacy (Prototype 36, 19940831)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenglp2RomInfo, gg_xmenglp2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Gamemaster's Legacy (Prototype 51, 19940906) - -static struct BurnRomInfo gg_xmenglp1RomDesc[] = { - { "x-men - gamemaster's legacy (prototype 51 - sep 06, 1994).bin", 0x80000, 0xa3cf94ba, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenglp1) -STD_ROM_FN(gg_xmenglp1) - -struct BurnDriver BurnDrvgg_xmenglp1 = { - "gg_xmenglp1", "gg_xmengl", NULL, NULL, "1994", - "X-Men - Gamemaster's Legacy (Prototype 51, 19940906)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenglp1RomInfo, gg_xmenglp1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Mojo World (Euro, USA) - -static struct BurnRomInfo gg_xmenmojoRomDesc[] = { - { "x-men - mojo world (usa, europe).bin", 0x80000, 0xc2cba9d7, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenmojo) -STD_ROM_FN(gg_xmenmojo) - -struct BurnDriver BurnDrvgg_xmenmojo = { - "gg_xmenmojo", NULL, NULL, NULL, "1996", - "X-Men - Mojo World (Euro, USA)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenmojoRomInfo, gg_xmenmojoRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Mojo World (Prototype, 19960605) - -static struct BurnRomInfo gg_xmenmojop7RomDesc[] = { - { "x-men - mojo world (prototype - jun 05, 1996).bin", 0x80000, 0x626f9987, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenmojop7) -STD_ROM_FN(gg_xmenmojop7) - -struct BurnDriver BurnDrvgg_xmenmojop7 = { - "gg_xmenmojop7", "gg_xmenmojo", NULL, NULL, "1996", - "X-Men - Mojo World (Prototype, 19960605)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenmojop7RomInfo, gg_xmenmojop7RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Mojo World (Prototype, 19960613) - -static struct BurnRomInfo gg_xmenmojop6RomDesc[] = { - { "x-men - mojo world (prototype - jun 13, 1996).bin", 0x80000, 0xc4f3ced4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenmojop6) -STD_ROM_FN(gg_xmenmojop6) - -struct BurnDriver BurnDrvgg_xmenmojop6 = { - "gg_xmenmojop6", "gg_xmenmojo", NULL, NULL, "1996", - "X-Men - Mojo World (Prototype, 19960613)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenmojop6RomInfo, gg_xmenmojop6RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Mojo World (Prototype, 19960624) - -static struct BurnRomInfo gg_xmenmojop5RomDesc[] = { - { "x-men - mojo world (prototype - jun 24, 1996).bin", 0x80000, 0x78001a5d, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenmojop5) -STD_ROM_FN(gg_xmenmojop5) - -struct BurnDriver BurnDrvgg_xmenmojop5 = { - "gg_xmenmojop5", "gg_xmenmojo", NULL, NULL, "1996", - "X-Men - Mojo World (Prototype, 19960624)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenmojop5RomInfo, gg_xmenmojop5RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Mojo World (Prototype, 19960625) - -static struct BurnRomInfo gg_xmenmojop4RomDesc[] = { - { "x-men - mojo world (prototype - jun 25, 1996).bin", 0x80000, 0xd4d2f077, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenmojop4) -STD_ROM_FN(gg_xmenmojop4) - -struct BurnDriver BurnDrvgg_xmenmojop4 = { - "gg_xmenmojop4", "gg_xmenmojo", NULL, NULL, "1996", - "X-Men - Mojo World (Prototype, 19960625)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenmojop4RomInfo, gg_xmenmojop4RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Mojo World (Prototype, 19960627) - -static struct BurnRomInfo gg_xmenmojop3RomDesc[] = { - { "x-men - mojo world (prototype - jun 27, 1996).bin", 0x80000, 0x425ac73f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenmojop3) -STD_ROM_FN(gg_xmenmojop3) - -struct BurnDriver BurnDrvgg_xmenmojop3 = { - "gg_xmenmojop3", "gg_xmenmojo", NULL, NULL, "1996", - "X-Men - Mojo World (Prototype, 19960627)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenmojop3RomInfo, gg_xmenmojop3RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Mojo World (Prototype, 19960628) - -static struct BurnRomInfo gg_xmenmojop2RomDesc[] = { - { "x-men - mojo world (prototype - jun 28, 1996).bin", 0x80000, 0xd44925ea, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenmojop2) -STD_ROM_FN(gg_xmenmojop2) - -struct BurnDriver BurnDrvgg_xmenmojop2 = { - "gg_xmenmojop2", "gg_xmenmojo", NULL, NULL, "1996", - "X-Men - Mojo World (Prototype, 19960628)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenmojop2RomInfo, gg_xmenmojop2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// X-Men - Mojo World (Prototype, 19960629) - -static struct BurnRomInfo gg_xmenmojop1RomDesc[] = { - { "x-men - mojo world (prototype - jun 29, 1996).bin", 0x80000, 0xba71da19, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_xmenmojop1) -STD_ROM_FN(gg_xmenmojop1) - -struct BurnDriver BurnDrvgg_xmenmojop1 = { - "gg_xmenmojop1", "gg_xmenmojo", NULL, NULL, "1996", - "X-Men - Mojo World (Prototype, 19960629)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_xmenmojop1RomInfo, gg_xmenmojop1RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Yogi Bear in Yogi Bear's Goldrush (Prototype) - -static struct BurnRomInfo gg_yogibearRomDesc[] = { - { "yogi bear in yogi bear's goldrush (unknown) (proto).bin", 0x40000, 0xe678f264, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_yogibear) -STD_ROM_FN(gg_yogibear) - -struct BurnDriver BurnDrvgg_yogibear = { - "gg_yogibear", NULL, NULL, NULL, "199?", - "Yogi Bear in Yogi Bear's Goldrush (Prototype)\0", NULL, "Unknown", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_yogibearRomInfo, gg_yogibearRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Yu Yu Hakusho - Horobishimono no Gyakushuu (Jpn) - -static struct BurnRomInfo gg_yuyuRomDesc[] = { - { "mpr-16456.ic1", 0x80000, 0x88ebbf9e, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_yuyu) -STD_ROM_FN(gg_yuyu) - -struct BurnDriver BurnDrvgg_yuyu = { - "gg_yuyu", NULL, NULL, NULL, "1994", - "Yu Yu Hakusho - Horobishimono no Gyakushuu (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_yuyuRomInfo, gg_yuyuRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Yu Yu Hakusho 2 - Gekitou! Nanakyou no Tatakai (Jpn) - -static struct BurnRomInfo gg_yuyu2RomDesc[] = { - { "mpr-17084.ic1", 0x80000, 0x46ae9159, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_yuyu2) -STD_ROM_FN(gg_yuyu2) - -struct BurnDriver BurnDrvgg_yuyu2 = { - "gg_yuyu2", NULL, NULL, NULL, "1994", - "Yu Yu Hakusho 2 - Gekitou! Nanakyou no Tatakai (Jpn)\0", NULL, "Sega", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_yuyu2RomInfo, gg_yuyu2RomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zan Gear (Jpn) - -static struct BurnRomInfo gg_zangearRomDesc[] = { - { "zan gear (japan).bin", 0x20000, 0x141aaf96, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_zangear) -STD_ROM_FN(gg_zangear) - -struct BurnDriver BurnDrvgg_zangear = { - "gg_zangear", NULL, NULL, NULL, "1990", - "Zan Gear (Jpn)\0", NULL, "Wolf Team", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_zangearRomInfo, gg_zangearRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zool (Euro) - -static struct BurnRomInfo gg_zoolRomDesc[] = { - { "zool (euro).bin", 0x40000, 0x23904898, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_zool) -STD_ROM_FN(gg_zool) - -struct BurnDriver BurnDrvgg_zool = { - "gg_zool", NULL, NULL, NULL, "1994", - "Zool (Euro)\0", NULL, "Gremlin", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_zoolRomInfo, gg_zoolRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zool no Yume Bouken (Jpn) - -static struct BurnRomInfo gg_zooljRomDesc[] = { - { "zool no yume bouken (japan).bin", 0x40000, 0xe35ef7ed, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_zoolj) -STD_ROM_FN(gg_zoolj) - -struct BurnDriver BurnDrvgg_zoolj = { - "gg_zoolj", "gg_zool", NULL, NULL, "1994", - "Zool no Yume Bouken (Jpn)\0", NULL, "Infocom", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_zooljRomInfo, gg_zooljRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zool (USA) - -static struct BurnRomInfo gg_zooluRomDesc[] = { - { "zool (usa).bin", 0x40000, 0xb287c695, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_zoolu) -STD_ROM_FN(gg_zoolu) - -struct BurnDriver BurnDrvgg_zoolu = { - "gg_zoolu", "gg_zool", NULL, NULL, "1993", - "Zool (USA)\0", NULL, "GameTek", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_zooluRomInfo, gg_zooluRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zoop (USA, Prototype) - -static struct BurnRomInfo gg_zooppRomDesc[] = { - { "zoop (europe).bin", 0x20000, 0xf397f041, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_zoopp) -STD_ROM_FN(gg_zoopp) - -struct BurnDriver BurnDrvgg_zoopp = { - "gg_zoopp", "gg_zoop", NULL, NULL, "1995", - "Zoop (USA, Prototype)\0", NULL, "Viacom New Media", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_zooppRomInfo, gg_zooppRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// Zoop (USA) - -static struct BurnRomInfo gg_zoopRomDesc[] = { - { "zoop (usa).bin", 0x20000, 0x3247ff8b, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_zoop) -STD_ROM_FN(gg_zoop) - -struct BurnDriver BurnDrvgg_zoop = { - "gg_zoop", NULL, NULL, NULL, "1995", - "Zoop (USA)\0", NULL, "Viacom New Media", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_zoopRomInfo, gg_zoopRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - - -// WildSnake 1.0 Unreleased (Prototype?) (Spectrum Holobyte) - -static struct BurnRomInfo gg_wildsnakeRomDesc[] = { - { "WildSnake [Proto].gg", 0x20000, 0xd460cc7f, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(gg_wildsnake) -STD_ROM_FN(gg_wildsnake) - -struct BurnDriver BurnDrvgg_wildsnake = { - "gg_wildsnake", NULL, NULL, NULL, "1994", - "WildSnake (Prototype / Unreleased)\0", NULL, "Spectrum HoloByte", "Sega Game Gear", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_GAME_GEAR, GBF_MISC, 0, - GGGetZipName, gg_wildsnakeRomInfo, gg_wildsnakeRomName, NULL, NULL, SMSInputInfo, GGDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Hong Kil Dong (KR) - -static struct BurnRomInfo sms_hongkildongRomDesc[] = { - { "Hong Kil Dong (KR).sms", 0x0C000, 0x8040b2fa, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_hongkildong) -STD_ROM_FN(sms_hongkildong) - -struct BurnDriver BurnDrvsms_hongkildong = { - "sms_hongkildong", NULL, NULL, NULL, "1991", - "Hong Kil Dong (Kor)\0", NULL, "Clover", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_hongkildongRomInfo, sms_hongkildongRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// DARC (Version 1.0) - -static struct BurnRomInfo sms_darcRomDesc[] = { - { "DARC.sms", 0x80000, 0x61B3C657, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_darc) -STD_ROM_FN(sms_darc) - -struct BurnDriver BurnDrvsms_darc = { - "sms_darc10", NULL, NULL, NULL, "2015", - "DARC (Version 1.0)\0", "Turn ON 'FM Emulation' in Dips for music/sfx!", "Zipper", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_darcRomInfo, sms_darcRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Lost Raider (Version 1.01) - -static struct BurnRomInfo sms_lostraider101RomDesc[] = { - { "LostRaider-SMS-1.01.sms", 0x20000, 0x2553b745, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_lostraider101) -STD_ROM_FN(sms_lostraider101) - -struct BurnDriver BurnDrvsms_lostraider101 = { - "sms_lostraider101", NULL, NULL, NULL, "2015", - "Lost Raider (Version 1.01)\0", NULL, "Vingazole & Ichigobankai", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_lostraider101RomInfo, sms_lostraider101RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Moggy Master (Version 1.00) - -static struct BurnRomInfo sms_moggym100RomDesc[] = { - { "mojon-twins--moggy-master.sms", 0x10000, 0x039539df, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_moggym100) -STD_ROM_FN(sms_moggym100) - -struct BurnDriver BurnDrvsms_moggym100 = { - "sms_moggym100", NULL, NULL, NULL, "2015", - "Moggy Master (Version 1.00)\0", NULL, "Mojon Twins", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_moggym100RomInfo, sms_moggym100RomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Geki Oko PunPun Maru (Version 20151031b) - -static struct BurnRomInfo sms_punpunRomDesc[] = { - { "punpun_20151031b.sms", 0x40000, 0xb35ebcdf, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_punpun) -STD_ROM_FN(sms_punpun) - -struct BurnDriver BurnDrvsms_punpun = { - "sms_punpun", NULL, NULL, NULL, "2013", - "Geki Oko PunPun Maru (Version 20151031b?)\0", NULL, "Future Driver", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_JAPANESE, GBF_MISC, 0, - SMSGetZipName, sms_punpunRomInfo, sms_punpunRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Waimanu: Scary Monsters Saga - -static struct BurnRomInfo sms_waimanuRomDesc[] = { - { "WaimanuSMS.sms", 0x20000, 0x195c3f78, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_waimanu) -STD_ROM_FN(sms_waimanu) - -struct BurnDriver BurnDrvsms_waimanu = { - "sms_WaimanuSMS", NULL, NULL, NULL, "2015", - "Waimanu: Scary Monsters Saga\0", NULL, "Disjointed Studio", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_waimanuRomInfo, sms_waimanuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Bruce Lee (Version 1.0) - -static struct BurnRomInfo sms_bruceleeRomDesc[] = { - { "BruceLee-SMS-1.00.sms", 0x20000, 0x37E27A38, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_brucelee) -STD_ROM_FN(sms_brucelee) - -struct BurnDriver BurnDrvsms_brucelee = { - "sms_brucelee10", NULL, NULL, NULL, "2015", - "Bruce Lee (Version 1.0)\0", NULL, "Kagesan", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_bruceleeRomInfo, sms_bruceleeRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Lambo (DEMO) by Genesis Project - -static struct BurnRomInfo sms_lamboRomDesc[] = { - { "GenesisProject-Lambo.sms", 0x40000, 0x92FE2775, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_lambo) -STD_ROM_FN(sms_lambo) - -struct BurnDriver BurnDrvsms_lambo = { - "sms_lambo", NULL, NULL, NULL, "2015", - "Lambo (Demo)\0", NULL, "Genesis Project", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM | HARDWARE_SMS_DISPLAY_PAL, GBF_MISC, 0, - SMSGetZipName, sms_lamboRomInfo, sms_lamboRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Bara Buruu (Version 1.0) - -static struct BurnRomInfo sms_baraburuRomDesc[] = { - { "BaraBuruu-SMS-1.00.sms", 0x20000, 0x43e39aa4, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_baraburu) -STD_ROM_FN(sms_baraburu) - -struct BurnDriver BurnDrvsms_baraburu = { - "sms_baraburu10", NULL, NULL, NULL, "2016", - "Bara Buruu (Version 1.0)\0", NULL, "Kagesan", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_baraburuRomInfo, sms_baraburuRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - -// Data Storm (Version 1.0) - -static struct BurnRomInfo sms_datastormRomDesc[] = { - { "datastorm.sms", 0x8000, 0x37b775d6, BRF_PRG | BRF_ESS }, -}; - -STD_ROM_PICK(sms_datastorm) -STD_ROM_FN(sms_datastorm) - -struct BurnDriver BurnDrvsms_datastorm = { - "sms_datastorm10", NULL, NULL, NULL, "2016", - "Data Storm (Version 1.0)\0", NULL, "haroldoop", "Sega Master System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_SEGA_MASTER_SYSTEM, GBF_MISC, 0, - SMSGetZipName, sms_datastormRomInfo, sms_datastormRomName, NULL, NULL, SMSInputInfo, SMSDIPInfo, - SMSInit, SMSExit, SMSFrame, SMSDraw, SMSScan, &SMSPaletteRecalc, 0x1000, - 256, 192, 4, 3 -}; - diff --git a/jan/src/burn/drv/sms/sms.cpp b/jan/src/burn/drv/sms/sms.cpp deleted file mode 100644 index 39f2772f0..000000000 --- a/jan/src/burn/drv/sms/sms.cpp +++ /dev/null @@ -1,700 +0,0 @@ -/* - sms.c -- - Sega Master System console emulation. -*/ -#include "smsshared.h" -#include "z80_intf.h" - -/* SMS context */ -sms_t sms; - -/* Pull-up resistors on data bus */ -UINT8 data_bus_pullup = 0x00; -UINT8 data_bus_pulldown = 0x00; - -static UINT8 dummy_write[0xffff]; - -static UINT8 *korean8kmap8000_9fff, *korean8kmapa000_bfff, *korean8kmap4000_5fff, *korean8kmap6000_7fff; - -void __fastcall writemem_mapper_sega(UINT16 offset, UINT8 data) -{ - sms.wram[offset & 0x1fff] = data; - - if(offset >= 0xFFFC) - sms_mapper_w(offset & 3, data); -} - -void __fastcall writemem_mapper_codies(UINT16 offset, UINT8 data) -{ - switch(offset & 0xC000) - { - case 0x0000: - sms_mapper_w(1, data); - return; - case 0x4000: - sms_mapper_w(2, data); - return; - case 0x8000: - sms_mapper_w(3, data); - return; - } -} - -void __fastcall writemem_mapper_msx(UINT16 offset, UINT8 data) -{ - if (offset <= 0x0003) { - sms_mapper8k_w(offset & 3, data); - return; - } - - if (offset >= 0xc000 /*&& offset <= 0xffff*/) - sms.wram[offset & 0x1fff] = data; -} - -void __fastcall writemem_mapper_none(UINT16 offset, UINT8 data) -{ - if (offset >= 0xc000 /*&& offset <= 0xffff*/) - sms.wram[offset & 0x1fff] = data; -} - -void __fastcall writemem_mapper_korea(UINT16 offset, UINT8 data) -{ - if (offset == 0xA000) { - sms_mapper_w(3, data); - return; - } - - sms.wram[offset & 0x1fff] = data; -} - -void __fastcall writemem_mapper_4pak(UINT16 offset, UINT8 data) -{ - switch (offset) { - case 0x3FFE: { - sms_mapper_w(1, data); - return; - } - case 0x7FFF: { - sms_mapper_w(2, data); - return; - } - case 0xBFFF: { - sms_mapper_w(3, (cart.fcr[1] & 0x30) + data); - return; - } - } - - sms.wram[offset & 0x1fff] = data; -} - -void __fastcall writemem_mapper_xin1(UINT16 offset, UINT8 data) -{ - if (offset == 0xFFFF) { - sms.wram[0x1fff] = data; - cart.fcr[0] = data % (cart.pages * 2); - return; - } - - sms.wram[offset & 0x1fff] = data; -} - -UINT8 __fastcall readmem_mapper_xin1(UINT16 offset) // HiCom Xin1 -{ - if(offset >= 0xc000 /*&& offset <= 0xffff*/) - return sms.wram[offset & 0x1fff]; - else - if (offset >= 0x8000) { - return cart.rom[offset & 0x3fff]; - } - - return cart.rom[(cart.fcr[0] * 0x8000) + offset]; -} - - -void __fastcall writemem_mapper_korea8k(UINT16 offset, UINT8 data) -{ - if (offset == 0x4000) { - sms_mapper8kvirt_w(2, data); - return; - } - - if (offset == 0x6000) { - sms_mapper8kvirt_w(3, data); - return; - } - - if (offset == 0x8000) { - sms_mapper8kvirt_w(0, data); - return; - } - - if (offset == 0xA000) { - sms_mapper8kvirt_w(1, data); - return; - } - - if (offset == 0xFFFE) { - sms_mapper8kvirt_w(2, (data << 1) & 0xFF); - sms_mapper8kvirt_w(3, (1 + (data << 1)) & 0xFF); - } - else if (offset == 0xFFFF) { - sms_mapper8kvirt_w(0, (data << 1) & 0xFF); - sms_mapper8kvirt_w(1, (1 + (data << 1)) & 0xFF); - } - - sms.wram[offset & 0x1fff] = data; -} - -UINT8 __fastcall readmem_mapper_korea8k(UINT16 offset) // aka Janggun -{ - UINT8 data = 0; - - if(offset >= 0xc000 /*&& offset <= 0xffff*/) - data = sms.wram[offset & 0x1fff]; - else - if(/*offset >= 0x0000 &&*/ offset <= 0x3fff) - data = cart.rom[offset]; - else - if(offset >= 0x4000 && offset <= 0x5fff) - data = korean8kmap4000_5fff[offset & 0x1fff]; - else - if(offset >= 0x6000 && offset <= 0x7fff) - data = korean8kmap6000_7fff[offset & 0x1fff]; - else - if(offset >= 0x8000 && offset <= 0x9fff) - data = korean8kmap8000_9fff[offset & 0x1fff]; - else - if(offset >= 0xa000 && offset <= 0xbfff) - data = korean8kmapa000_bfff[offset & 0x1fff]; - - /* 16k page */ - UINT8 page = offset >> 14; - - /* $4000-$7FFF and $8000-$BFFF area are protected */ - if (((page == 1) && (cart.fcr[2] & 0x80)) || ((page == 2) && (cart.fcr[0] & 0x80))) { - /* bit-swapped value */ - data = (((data >> 7) & 0x01) | ((data >> 5) & 0x02) | - ((data >> 3) & 0x04) | ((data >> 1) & 0x08) | - ((data << 1) & 0x10) | ((data << 3) & 0x20) | - ((data << 5) & 0x40) | ((data << 7) & 0x80)); - } - - return data; -} - -void sms_init(void) -{ - ZetInit(0); - ZetOpen(0); - - /* Default: open bus */ - data_bus_pullup = 0x00; - data_bus_pulldown = 0x00; - - bprintf(0, _T("Cart mapper: ")); - /* Assign mapper */ - if(cart.mapper == MAPPER_CODIES) { - bprintf(0, _T("Codemasters\n")); - ZetSetWriteHandler(writemem_mapper_codies); - } - else if (cart.mapper == MAPPER_MSX || cart.mapper == MAPPER_MSX_NEMESIS) - { - bprintf(0, _T("MSX\n")); - ZetSetWriteHandler(writemem_mapper_msx); - } - else if (cart.mapper == MAPPER_NONE) - { - bprintf(0, _T("NONE.\n")); - ZetSetWriteHandler(writemem_mapper_none); - } - else if (cart.mapper == MAPPER_KOREA) - { - bprintf(0, _T("Korea\n")); - ZetSetWriteHandler(writemem_mapper_korea); - } - else if (cart.mapper == MAPPER_KOREA8K) - { - bprintf(0, _T("Korea 8k\n")); - ZetSetWriteHandler(writemem_mapper_korea8k); - ZetSetReadHandler(readmem_mapper_korea8k); - } - else if (cart.mapper == MAPPER_4PAK) - { - bprintf(0, _T("4PAK All Action\n")); - ZetSetWriteHandler(writemem_mapper_4pak); - } - else if (cart.mapper == MAPPER_XIN1) - { - bprintf(0, _T("Hi Com Xin1\n")); - ZetSetWriteHandler(writemem_mapper_xin1); - ZetSetReadHandler(readmem_mapper_xin1); - } - else { - bprintf(0, _T("Sega\n")); - ZetSetWriteHandler(writemem_mapper_sega); - } - - /* Force SMS (J) console type if FM sound enabled */ - if(sms.use_fm) - { - bprintf(0, _T("Emulating FM\n")); - sms.console = CONSOLE_SMSJ; - sms.territory = TERRITORY_DOMESTIC; - sms.display = DISPLAY_NTSC; - } - - /* Initialize selected console emulation */ - switch(sms.console) - { - case CONSOLE_SMS: - ZetSetOutHandler(sms_port_w); - ZetSetInHandler(sms_port_r); - break; - - case CONSOLE_SMSJ: - ZetSetOutHandler(sms_port_w); - ZetSetInHandler(sms_port_r); - break; - - case CONSOLE_SMS2: - ZetSetOutHandler(sms_port_w); - ZetSetInHandler(sms_port_r); - data_bus_pullup = 0xFF; - break; - - case CONSOLE_GG: - ZetSetOutHandler(gg_port_w); - ZetSetInHandler(gg_port_r); - data_bus_pullup = 0xFF; - break; - - case CONSOLE_GGMS: - ZetSetOutHandler(ggms_port_w); - ZetSetInHandler(ggms_port_r); - data_bus_pullup = 0xFF; - break; - } - ZetClose(); - sms_reset(); -} - -void sms_shutdown(void) -{ - /* Nothing to do */ -} - -void sms_reset(void) -{ - ZetOpen(0); - - /* Clear SMS context */ - memset(&dummy_write, 0, sizeof(dummy_write)); - memset(&sms.wram, 0, sizeof(sms.wram)); - memset(cart.sram, 0, sizeof(cart.sram)); - - sms.paused = 0x00; - sms.save = 0x00; - sms.fm_detect = 0x00; - sms.memctrl = 0xAB; - sms.ioctrl = 0xFF; - - if (IS_SMS) - sms.wram[0] = 0xA8; // BIOS usually sets this. (memory control register) - - cart.fcr[0] = 0x00; - cart.fcr[1] = 0x00; - cart.fcr[2] = 0x01; - cart.fcr[3] = 0x02; - - // Default (0x0000 - 0xbfff) mappings: - if (cart.mapper == MAPPER_KOREA8K) { // aka Janggun ui Adeul (Kor) - ZetMapMemory(cart.rom + 0x0000, 0x0000, 0x03ff, MAP_ROM); - ZetMapMemory(cart.rom + 0x0400, 0x0400, 0x3fff, MAP_ROM); - // These are mapped manually due to encryption (see readmem_mapper_korea8k()!) - korean8kmap4000_5fff = cart.rom + 0x4000; - korean8kmap6000_7fff = cart.rom + 0x6000; - korean8kmap8000_9fff = cart.rom + 0x8000; - korean8kmapa000_bfff = cart.rom + 0xa000; - cart.fcr[2] = 0x00; cart.fcr[3] = 0x00; - } else - if (cart.mapper == MAPPER_XIN1) { - // HiCom Xin1 Carts - // Nothing here (uses virtual mapping, see readmem/writemem_mapper_xin1()) - } else { - ZetMapMemory(cart.rom + 0x0000, 0x0000, 0x03ff, MAP_ROM); - ZetMapMemory(cart.rom + 0x0400, 0x0400, 0x3fff, MAP_ROM); - ZetMapMemory(cart.rom + 0x4000, 0x4000, 0x7fff, MAP_ROM); - ZetMapMemory(cart.rom + 0x8000, 0x8000, 0xbfff, MAP_ROM); - } - - // Work Ram (0xc000 - 0xffff) mappings: - if(cart.mapper == MAPPER_CODIES || cart.mapper == MAPPER_4PAK) { - ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xe000, 0xffff, MAP_RAM); - } else - if(cart.mapper == MAPPER_SEGA || cart.mapper == MAPPER_KOREA8K || cart.mapper == MAPPER_XIN1) { - ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory((UINT8 *)&dummy_write, 0x0000, 0xbfff, MAP_WRITE); - ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xe000, 0xffff, MAP_READ); - } else - { // MSX & Korea Mappers - ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xe000, 0xffff, MAP_RAM); - memset(&sms.wram[1], 0xf0, sizeof(sms.wram) - 1); // this memory pattern fixes booting of a few korean games - cart.fcr[2] = 0x00; cart.fcr[3] = 0x00; - } - ZetReset(); - ZetClose(); - - switch (cart.mapper) - { - case MAPPER_MSX_NEMESIS: { - bprintf(0, _T("(Nemesis-MSX: cart rom-page 0x0f remapped to 0x0000 - 0x1fff)\n")); - cart.fcr[2] = 0x00; cart.fcr[3] = 0x00; - UINT32 poffset = (0x0f) << 13; - ZetOpen(0); - ZetMapMemory(cart.rom + poffset, 0x0000, 0x1fff, MAP_ROM); - ZetReset(); - ZetClose(); - } - } - - if (IS_SMS) { - // Z80 Stack Pointer set by SMS Bios, fix for Shadow Dancer and Ace of Aces - // ZetSetSP() Must be called after ZetReset() when the cpu is in a closed state. - ZetSetSP(0, 0xdff0); - } -} - -void sms_mapper8kvirt_w(INT32 address, UINT8 data) -{ - /* Calculate ROM page index */ - UINT32 poffset = (data % (cart.pages8k)) << 13; - - /* Save frame control register data */ - cart.fcr[address & 3] = data; - //bprintf(0, _T("pof(%X)a%X = %X,"), poffset, address, data); - - /* 4 x 8k banks */ - switch (address & 3) - { - case 0: /* cartridge ROM bank (8k) at $8000-$9FFF */ - korean8kmap8000_9fff = cart.rom + poffset; - break; - - case 1: /* cartridge ROM bank (8k) at $A000-$BFFF */ - korean8kmapa000_bfff = cart.rom + poffset; - break; - - case 2: /* cartridge ROM bank (8k) at $4000-$5FFF */ - korean8kmap4000_5fff = cart.rom + poffset; - break; - - case 3: /* cartridge ROM bank (8k) at $6000-$7FFF */ - korean8kmap6000_7fff = cart.rom + poffset; - break; - } -} - -void sms_mapper8k_w(INT32 address, UINT8 data) -{ - /* Calculate ROM page index */ - UINT32 poffset = (data % (cart.pages8k)) << 13; - - /* Save frame control register data */ - cart.fcr[address & 3] = data; - //bprintf(0, _T("pof(%X)a%X = %X,"), poffset, address, data); - - /* 4 x 8k banks */ - switch (address & 3) - { - case 0: /* cartridge ROM bank (8k) at $8000-$9FFF */ - ZetMapMemory(cart.rom + poffset, 0x8000, 0x9fff, MAP_ROM); - break; - - case 1: /* cartridge ROM bank (8k) at $A000-$BFFF */ - ZetMapMemory(cart.rom + poffset, 0xa000, 0xbfff, MAP_ROM); - break; - - case 2: /* cartridge ROM bank (8k) at $4000-$5FFF */ - ZetMapMemory(cart.rom + poffset, 0x4000, 0x5fff, MAP_ROM); - break; - - case 3: /* cartridge ROM bank (8k) at $6000-$7FFF */ - ZetMapMemory(cart.rom + poffset, 0x6000, 0x7fff, MAP_ROM); - break; - } -} - -void sms_mapper_w(INT32 address, UINT8 data) -{ - /* Calculate ROM page index */ - UINT32 poffset = (data % cart.pages) << 14; - //bprintf(0, _T("address[%X] pof(%X) data[%X],"), address, poffset, data); - - /* Save frame control register data */ - cart.fcr[address & 3] = data; - - switch(address & 3) - { - case 0: // page 2 - if(data & 8) - { - UINT32 offset = (data & 4) ? 0x4000 : 0x0000; - sms.save = 1; - ZetMapMemory((UINT8 *)&cart.sram + offset, 0x8000, 0xbfff, MAP_RAM); - } - else - { - poffset = ((cart.fcr[3] % cart.pages) << 14); - ZetMapMemory(cart.rom + poffset, 0x8000, 0xbfff, MAP_ROM); - if (cart.mapper == MAPPER_SEGA) - ZetMapMemory((UINT8 *)&dummy_write, 0x8000, 0xbfff, MAP_WRITE); - } - break; - - case 1: // page 0 - ZetMapMemory(cart.rom + poffset, 0x0000, 0x3fff, MAP_ROM); - if(cart.mapper != MAPPER_CODIES && cart.mapper != MAPPER_4PAK && cart.mapper != MAPPER_XIN1) // first 1k is in the Sega mapper - ZetMapMemory(cart.rom + 0x0000, 0x0000, 0x03ff, MAP_ROM); - break; - - case 2: // page 1 - ZetMapMemory(cart.rom + poffset, 0x4000, 0x7fff, MAP_ROM); - break; - - case 3: // page 2 - if(!(cart.fcr[0] & 0x08)) - { - ZetMapMemory(cart.rom + poffset, 0x8000, 0xbfff, MAP_ROM); - } - break; - } -} - -/* Read unmapped memory */ -UINT8 z80_read_unmapped(void) -{ - INT32 pc = ZetGetPC(-1); - UINT8 data; - pc = (pc - 1) & 0xFFFF; - data = ZetReadByte(pc); - - return ((data | data_bus_pullup) & ~data_bus_pulldown); -} - -void memctrl_w(UINT8 data) -{ - sms.memctrl = data; -} - -/*--------------------------------------------------------------------------*/ -/* Sega Master System port handlers */ -/*--------------------------------------------------------------------------*/ - -void __fastcall sms_port_w(UINT16 port, UINT8 data) -{ - port &= 0xFF; - - if(port >= 0xF0) - { - switch(port) - { - case 0xF0: - fmunit_write(0, data); - return; - - case 0xF1: - fmunit_write(1, data); - return; - - case 0xF2: - fmunit_detect_w(data); - return; - } - } - - switch(port & 0xC1) - { - case 0x00: - memctrl_w(data); - return; - - case 0x01: - ioctrl_w(data); - return; - - case 0x40: - case 0x41: - psg_write(data); - return; - - case 0x80: - case 0x81: - vdp_write(port, data); - return; - - case 0xC0: - case 0xC1: - return; - } -} - -UINT8 __fastcall sms_port_r(UINT16 port) -{ - port &= 0xFF; - - if(port == 0xF2 && sms.use_fm) - return fmunit_detect_r(); - - switch(port & 0xC0) - { - case 0x00: - return z80_read_unmapped(); - - case 0x40: - return vdp_counter_r(port); - - case 0x80: - return vdp_read(port); - - case 0xC0: - return input_r(port); - } - - /* Just to please the compiler */ - return 0; -} - - - -/*--------------------------------------------------------------------------*/ -/* Game Gear port handlers */ -/*--------------------------------------------------------------------------*/ - -void __fastcall gg_port_w(UINT16 port, UINT8 data) -{ - port &= 0xFF; - - if(port <= 0x06) { - sio_w(port, data); - return; - } - - switch(port & 0xC1) - { - case 0x00: - memctrl_w(data); - return; - - case 0x01: - ioctrl_w(data); - return; - - case 0x40: - case 0x41: - psg_write(data); - return; - - case 0x80: - case 0x81: - gg_vdp_write(port, data); - return; - } -} - - -UINT8 __fastcall gg_port_r(UINT16 port) -{ - port &= 0xFF; - - if(port <= 0x06) - return sio_r(port); - - switch(port & 0xC0) - { - case 0x00: - return z80_read_unmapped(); - - case 0x40: - return vdp_counter_r(port); - - case 0x80: - return vdp_read(port); - - case 0xC0: - switch(port) - { - case 0xC0: - case 0xC1: - case 0xDC: - case 0xDD: - return input_r(port); - } - return z80_read_unmapped(); - } - - /* Just to please the compiler */ - return 0; -} - -/*--------------------------------------------------------------------------*/ -/* Game Gear (MS) port handlers */ -/*--------------------------------------------------------------------------*/ - -void __fastcall ggms_port_w(UINT16 port, UINT8 data) -{ - port &= 0xFF; - - switch(port & 0xC1) - { - case 0x00: - memctrl_w(data); - return; - - case 0x01: - ioctrl_w(data); - return; - - case 0x40: - case 0x41: - psg_write(data); - return; - - case 0x80: - case 0x81: - gg_vdp_write(port, data); - return; - } -} - -UINT8 __fastcall ggms_port_r(UINT16 port) -{ - port &= 0xFF; - - switch(port & 0xC0) - { - case 0x00: - return z80_read_unmapped(); - - case 0x40: - return vdp_counter_r(port); - - case 0x80: - return vdp_read(port); - - case 0xC0: - switch(port) - { - case 0xC0: - case 0xC1: - case 0xDC: - case 0xDD: - return input_r(port); - } - return z80_read_unmapped(); - } - - /* Just to please the compiler */ - return 0; -} diff --git a/jan/src/burn/drv/sms/sms.h b/jan/src/burn/drv/sms/sms.h deleted file mode 100644 index 56e242339..000000000 --- a/jan/src/burn/drv/sms/sms.h +++ /dev/null @@ -1,110 +0,0 @@ - -#ifndef _SMS_H_ -#define _SMS_H_ - -enum { - SLOT_BIOS = 0, - SLOT_CARD = 1, - SLOT_CART = 2, - SLOT_EXP = 3 -}; - -enum { - MAPPER_NONE = 0, - MAPPER_SEGA = 1, - MAPPER_CODIES = 2, - MAPPER_MSX = 3, - MAPPER_MSX_NEMESIS = 4, - MAPPER_KOREA = 5, - MAPPER_KOREA8K = 6, - MAPPER_4PAK = 7, - MAPPER_XIN1 = 8 -}; - -enum { - DISPLAY_NTSC = 0, - DISPLAY_PAL = 1 -}; - -enum { - FPS_NTSC = 60, - FPS_PAL = 50 -}; - -enum { - CLOCK_NTSC = 3579545, - CLOCK_PAL = 3579545 -}; - -enum { - CONSOLE_SMS = 0x20, - CONSOLE_SMSJ = 0x21, - CONSOLE_SMS2 = 0x22, - - CONSOLE_GG = 0x40, - CONSOLE_GGMS = 0x41, - - CONSOLE_MD = 0x80, - CONSOLE_MDPBC = 0x81, - CONSOLE_GEN = 0x82, - CONSOLE_GENPBC = 0x83 -}; - -#define HWTYPE_SMS CONSOLE_SMS -#define HWTYPE_GG CONSOLE_GG -#define HWTYPE_MD CONSOLE_MD - -#define IS_SMS (sms.console & HWTYPE_SMS) -#define IS_GG (sms.console & HWTYPE_GG) -#define IS_MD (sms.console & HWTYPE_MD) - -enum { - TERRITORY_DOMESTIC = 0, - TERRITORY_EXPORT = 1 -}; - -/* SMS context */ -typedef struct -{ - UINT8 wram[0x2000]; - UINT8 paused; - UINT8 save; - UINT8 territory; - UINT8 console; - UINT8 display; - UINT8 fm_detect; - UINT8 use_fm; - UINT8 memctrl; - UINT8 ioctrl; - struct { - UINT8 pdr; /* Parallel data register */ - UINT8 ddr; /* Data direction register */ - UINT8 txdata; /* Transmit data buffer */ - UINT8 rxdata; /* Receive data buffer */ - UINT8 sctrl; /* Serial mode control and status */ - } sio; - struct { - INT32 type; - } device[2]; -} sms_t; - -/* Global data */ -extern sms_t sms; - -/* Function prototypes */ -void sms_init(void); -void sms_reset(void); -void sms_shutdown(void); -void sms_mapper_w(INT32 address, UINT8 data); -void sms_mapper8k_w(INT32 address, UINT8 data); -void sms_mapper8kvirt_w(INT32 address, UINT8 data); - -/* port-map Function prototypes */ -UINT8 z80_read_unmapped(void); -void __fastcall gg_port_w(UINT16 port, UINT8 data); -UINT8 __fastcall gg_port_r(UINT16 port); -void __fastcall ggms_port_w(UINT16 port, UINT8 data); -UINT8 __fastcall ggms_port_r(UINT16 port); -void __fastcall sms_port_w(UINT16 port, UINT8 data); -UINT8 __fastcall sms_port_r(UINT16 port); -#endif /* _SMS_H_ */ diff --git a/jan/src/burn/drv/sms/smsfmintf.cpp b/jan/src/burn/drv/sms/smsfmintf.cpp deleted file mode 100644 index faed66ca0..000000000 --- a/jan/src/burn/drv/sms/smsfmintf.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - fmintf.c -- - Interface to EMU2413 and YM2413 emulators. -*/ -#include "smsshared.h" -#include "burn_ym2413.h" - - -void FM_Init(void) -{ - BurnYM2413Init(snd.fm_clock); - BurnYM2413SetAllRoutes(2.10, BURN_SND_ROUTE_BOTH); -} - - -void FM_Shutdown(void) -{ - BurnYM2413Exit(); -} - - -void FM_Reset(void) -{ - BurnYM2413Reset(); -} - - -void FM_Write(INT32 offset, INT32 data) -{ - BurnYM2413Write(offset, data); -} - diff --git a/jan/src/burn/drv/sms/smsfmintf.h b/jan/src/burn/drv/sms/smsfmintf.h deleted file mode 100644 index 0ad17c7d5..000000000 --- a/jan/src/burn/drv/sms/smsfmintf.h +++ /dev/null @@ -1,21 +0,0 @@ - -#ifndef _FMINTF_H_ -#define _FMINTF_H_ - -enum { - SND_EMU2413, /* Mitsutaka Okazaki's YM2413 emulator */ - SND_YM2413 /* Jarek Burczynski's YM2413 emulator */ -}; - -typedef struct { - UINT8 latch; - UINT8 reg[0x40]; -} FM_Context; - -/* Function prototypes */ -void FM_Init(void); -void FM_Shutdown(void); -void FM_Reset(void); -void FM_Update(INT16 **buffer, INT32 length); -void FM_Write(INT32 offset, INT32 data); -#endif /* _FMINTF_H_ */ diff --git a/jan/src/burn/drv/sms/smshvc.h b/jan/src/burn/drv/sms/smshvc.h deleted file mode 100644 index 2aa07bef8..000000000 --- a/jan/src/burn/drv/sms/smshvc.h +++ /dev/null @@ -1,207 +0,0 @@ -#ifndef _HVC_H_ -#define _HVC_H_ - -UINT8 hc_ntsc_256[] = -{ -/* 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, - 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, -*/ - 0xF4,0xF5,0xF6,0xF6,0xF7,0xF8,0xF9,0xF9,0xFA,0xFB,0xFC,0xFC,0xFD,0xFE,0xFF,0xFF, - 0x00,0x01,0x02,0x02,0x03,0x04,0x05,0x05,0x06,0x07,0x08,0x08,0x09,0x0A,0x0B,0x0B, - 0x0C,0x0D,0x0E,0x0E,0x0F,0x10,0x11,0x11,0x12,0x13,0x14,0x14,0x15,0x16,0x17,0x17, - 0x18,0x19,0x1A,0x1A,0x1B,0x1C,0x1D,0x1D,0x1E,0x1F,0x20,0x20,0x21,0x22,0x23,0x23, - 0x24,0x25,0x26,0x26,0x27,0x28,0x29,0x29,0x2A,0x2B,0x2C,0x2C,0x2D,0x2E,0x2F,0x2F, - 0x30,0x31,0x32,0x32,0x33,0x34,0x35,0x35,0x36,0x37,0x38,0x38,0x39,0x3A,0x3B,0x3B, - 0x3C,0x3D,0x3E,0x3E,0x3F,0x40,0x41,0x41,0x42,0x43,0x44,0x44,0x45,0x46,0x47,0x47, - 0x48,0x49,0x4A,0x4A,0x4B,0x4C,0x4D,0x4D,0x4E,0x4F,0x50,0x50,0x51,0x52,0x53,0x53, - 0x54,0x55,0x56,0x56,0x57,0x58,0x59,0x59,0x5A,0x5B,0x5C,0x5C,0x5D,0x5E,0x5F,0x5F, - 0x60,0x61,0x62,0x62,0x63,0x64,0x65,0x65,0x66,0x67,0x68,0x68,0x69,0x6A,0x6B,0x6B, - 0x6C,0x6D,0x6E,0x6E,0x6F,0x70,0x71,0x71,0x72,0x73,0x74,0x74,0x75,0x76,0x77,0x77, - 0x78,0x79,0x7A,0x7A,0x7B,0x7C,0x7D,0x7D,0x7E,0x7F,0x80,0x80,0x81,0x82,0x83,0x83, - 0x84,0x85,0x86,0x86,0x87,0x88,0x89,0x89,0x8A,0x8B,0x8C,0x8C,0x8D,0x8E,0x8F,0x8F, - 0x90,0x91,0x92,0x92,0x93, - 0xE9,0xEA,0xEA,0xEB,0xEC,0xED,0xED,0xEE,0xEF,0xF0,0xF0, - 0xF1,0xF2,0xF3,0xF3 - -}; - -UINT8 vc_ntsc_192[] = -{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, - 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, -}; - -UINT8 vc_ntsc_224[] = -{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, - 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, -}; - -UINT8 vc_ntsc_256[] = -{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 -}; - -UINT8 vc_pal_192[] = -{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, - 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, -}; - -UINT8 vc_pal_224[] = -{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, - 0x00, 0x01, 0x02, - 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, -}; - -UINT8 vc_pal_256[] = -{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, - 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, -}; - -UINT8 *hc_table[] = -{ - hc_ntsc_256, -}; - -UINT8 *vc_table[2][4] = -{ - { - vc_ntsc_192, - vc_ntsc_224, - vc_ntsc_256, - vc_ntsc_192, - }, - { - vc_pal_192, - vc_pal_224, - vc_pal_256, - vc_pal_192, - } -}; - -#endif /* _HVC_H_ */ - diff --git a/jan/src/burn/drv/sms/smspio.cpp b/jan/src/burn/drv/sms/smspio.cpp deleted file mode 100644 index a9d167d23..000000000 --- a/jan/src/burn/drv/sms/smspio.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/* - pio.c -- - I/O chip and peripheral emulation. -*/ -#include "smsshared.h" - -io_state io_lut[2][256]; -io_state *io_current; - -void pio_init(void) -{ - INT32 i, j; - - /* Make pin state LUT */ - for(j = 0; j < 2; j++) - { - for(i = 0; i < 0x100; i++) - { - /* Common control: pin direction */ - io_lut[j][i].tr_dir[0] = (i & 0x01) ? PIN_DIR_IN : PIN_DIR_OUT; - io_lut[j][i].th_dir[0] = (i & 0x02) ? PIN_DIR_IN : PIN_DIR_OUT; - io_lut[j][i].tr_dir[1] = (i & 0x04) ? PIN_DIR_IN : PIN_DIR_OUT; - io_lut[j][i].th_dir[1] = (i & 0x08) ? PIN_DIR_IN : PIN_DIR_OUT; - - if(j == 1) - { - /* Programmable output state (Export machines only) */ - io_lut[j][i].tr_level[0] = (i & 0x01) ? PIN_LVL_HI : (i & 0x10) ? PIN_LVL_HI : PIN_LVL_LO; - io_lut[j][i].th_level[0] = (i & 0x02) ? PIN_LVL_HI : (i & 0x20) ? PIN_LVL_HI : PIN_LVL_LO; - io_lut[j][i].tr_level[1] = (i & 0x04) ? PIN_LVL_HI : (i & 0x40) ? PIN_LVL_HI : PIN_LVL_LO; - io_lut[j][i].th_level[1] = (i & 0x08) ? PIN_LVL_HI : (i & 0x80) ? PIN_LVL_HI : PIN_LVL_LO; - } - else - { - /* Fixed output state (Domestic machines only) */ - io_lut[j][i].tr_level[0] = (i & 0x01) ? PIN_LVL_HI : PIN_LVL_LO; - io_lut[j][i].th_level[0] = (i & 0x02) ? PIN_LVL_HI : PIN_LVL_LO; - io_lut[j][i].tr_level[1] = (i & 0x04) ? PIN_LVL_HI : PIN_LVL_LO; - io_lut[j][i].th_level[1] = (i & 0x08) ? PIN_LVL_HI : PIN_LVL_LO; - } - } - } - - // hack dos code doesn't call system_reset - pio_reset(); -} - - -void pio_reset(void) -{ - /* GG SIO power-on defaults */ - sms.sio.pdr = 0x7F; - sms.sio.ddr = 0xFF; - sms.sio.txdata = 0x00; - sms.sio.rxdata = 0xFF; - sms.sio.sctrl = 0x00; - - /* SMS I/O power-on defaults */ - ioctrl_w(0xFF); -} - - -void pio_shutdown(void) -{ - /* Nothing to do */ -} - - -void system_assign_device(INT32 port, INT32 type) -{ - sms.device[port].type = type; -} - -void ioctrl_w(UINT8 data) -{ - sms.ioctrl = data; - io_current = &io_lut[sms.territory][data]; -} - -UINT8 device_r(INT32 offset) -{ - UINT8 temp = 0x7F; - - switch(sms.device[offset].type) - { - case DEVICE_NONE: - break; - case DEVICE_PAD2B: - break; - case DEVICE_PADDLE: - break; - } - - return temp; -} - -UINT8 input_r(INT32 offset) -{ - UINT8 temp = 0xFF; - - /* - If I/O chip is disabled, reads return last byte of instruction that - read the I/O port. - */ - if(sms.memctrl & 0x04) - return z80_read_unmapped(); - - offset &= 1; - if(offset == 0) - { - /* Input port #0 */ - - if(input.pad[0] & INPUT_UP) temp &= ~0x01; /* D0 */ - if(input.pad[0] & INPUT_DOWN) temp &= ~0x02; /* D1 */ - if(input.pad[0] & INPUT_LEFT) temp &= ~0x04; /* D2 */ - if(input.pad[0] & INPUT_RIGHT) temp &= ~0x08; /* D3 */ - if(input.pad[0] & INPUT_BUTTON2) temp &= ~0x10; /* TL */ - if(input.pad[0] & INPUT_BUTTON1) temp &= ~0x20; /* TR */ - - if(sms.console == CONSOLE_GG) - { - UINT8 state = sio_r(0x01); - temp = (temp & 0x3F) | (state & 0x03) << 6; /* Insert D1,D0 */ - } - else - { - if(input.pad[1] & INPUT_UP) temp &= ~0x40; /* D0 */ - if(input.pad[1] & INPUT_DOWN) temp &= ~0x80; /* D1 */ - } - - /* Adjust TR state if it is an output */ - if(io_current->tr_dir[0] == PIN_DIR_OUT) { - temp &= ~0x20; - temp |= (io_current->tr_level[0] == PIN_LVL_HI) ? 0x20 : 0x00; - } - } - else - { - /* Input port #1 */ - if(sms.console == CONSOLE_GG) - { - UINT8 state = sio_r(0x01); - temp = (temp & 0xF0) | ((state & 0x3C) >> 2); /* Insert TR,TL,D3,D2 */ - temp = (temp & 0x7F) | ((state & 0x40) << 1); /* Insert TH */ - } - else - { - if(input.pad[1] & INPUT_LEFT) temp &= ~0x01; /* D2 */ - if(input.pad[1] & INPUT_RIGHT) temp &= ~0x02; /* D3 */ - if(input.pad[1] & INPUT_BUTTON2) temp &= ~0x04; /* TL */ - if(input.pad[1] & INPUT_BUTTON1) temp &= ~0x08; /* TR */ - - /* Adjust TR state if it is an output */ - if(io_current->tr_dir[1] == PIN_DIR_OUT) { - temp &= ~0x08; - temp |= (io_current->tr_level[1] == PIN_LVL_HI) ? 0x08 : 0x00; - } - - /* Adjust TH state if it is an output */ - if(io_current->th_dir[1] == PIN_DIR_OUT) { - temp &= ~0x80; - temp |= (io_current->th_level[1] == PIN_LVL_HI) ? 0x80 : 0x00; - } - - if(input.system & INPUT_RESET) temp &= ~0x10; - } - - /* /CONT fixed at '1' for SMS/SMS2/GG */ - /* /CONT fixed at '0' for GEN/MD */ - if(IS_MD) temp &= ~0x20; - - /* Adjust TH state if it is an output */ - if(io_current->th_dir[0] == PIN_DIR_OUT) { - temp &= ~0x40; - temp |= (io_current->th_level[0] == PIN_LVL_HI) ? 0x40 : 0x00; - } - } - return temp; -} - -UINT8 sio_r(INT32 offset) -{ - UINT8 temp; - - switch(offset & 0xFF) - { - case 0: /* Input port #2 */ - temp = 0xE0; - if(input.system & INPUT_START) temp &= ~0x80; - if(sms.territory == TERRITORY_DOMESTIC) temp &= ~0x40; - if(sms.display == DISPLAY_NTSC) temp &= ~0x20; - return temp; - - case 1: /* Parallel data register */ - temp = 0x00; - temp |= (sms.sio.ddr & 0x01) ? 0x01 : (sms.sio.pdr & 0x01); - temp |= (sms.sio.ddr & 0x02) ? 0x02 : (sms.sio.pdr & 0x02); - temp |= (sms.sio.ddr & 0x04) ? 0x04 : (sms.sio.pdr & 0x04); - temp |= (sms.sio.ddr & 0x08) ? 0x08 : (sms.sio.pdr & 0x08); - temp |= (sms.sio.ddr & 0x10) ? 0x10 : (sms.sio.pdr & 0x10); - temp |= (sms.sio.ddr & 0x20) ? 0x20 : (sms.sio.pdr & 0x20); - temp |= (sms.sio.ddr & 0x40) ? 0x40 : (sms.sio.pdr & 0x40); - temp |= (sms.sio.pdr & 0x80); - return temp; - - case 2: /* Data direction register and NMI enable */ - return sms.sio.ddr; - - case 3: /* Transmit data buffer */ - return sms.sio.txdata; - - case 4: /* Receive data buffer */ - return sms.sio.rxdata; - - case 5: /* Serial control */ - return sms.sio.sctrl; - - case 6: /* Stereo sound control */ - return 0xFF; - } - - /* Just to please compiler */ - return 0; -} - -void sio_w(INT32 offset, INT32 data) -{ - switch(offset & 0xFF) - { - case 0: /* Input port #2 (read-only) */ - return; - - case 1: /* Parallel data register */ - sms.sio.pdr = data; - return; - - case 2: /* Data direction register and NMI enable */ - sms.sio.ddr = data; - return; - - case 3: /* Transmit data buffer */ - sms.sio.txdata = data; - return; - - case 4: /* Receive data buffer */ - return; - - case 5: /* Serial control */ - sms.sio.sctrl = data & 0xF8; - return; - - case 6: /* Stereo output control */ - psg_stereo_w(data); - return; - } -} - diff --git a/jan/src/burn/drv/sms/smspio.h b/jan/src/burn/drv/sms/smspio.h deleted file mode 100644 index 420e60896..000000000 --- a/jan/src/burn/drv/sms/smspio.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _SMSPIO_H_ -#define _SMSPIO_H_ - -#define SIO_TXFL (1 << 0) /* 1= Transmit buffer full */ -#define SIO_RXRD (1 << 1) /* 1= Receive buffer full */ -#define SIO_FRER (1 << 2) /* 1= Framing error occured */ - -#define MAX_DEVICE 2 -#define DEVICE_D0 (1 << 0) -#define DEVICE_D1 (1 << 1) -#define DEVICE_D2 (1 << 2) -#define DEVICE_D3 (1 << 3) -#define DEVICE_TL (1 << 4) -#define DEVICE_TR (1 << 5) -#define DEVICE_TH (1 << 6) -#define DEVICE_ALL (DEVICE_D0 | DEVICE_D1 | DEVICE_D2 | DEVICE_D3 | DEVICE_TL | DEVICE_TR | DEVICE_TH) - -#define PIN_LVL_LO 0 /* Pin outputs 0V */ -#define PIN_LVL_HI 1 /* Pin outputs +5V */ -#define PIN_DIR_OUT 0 /* Pin is is an active driving output */ -#define PIN_DIR_IN 1 /* Pin is in active-low input mode */ - -enum { - PORT_A = 0, /* I/O port A */ - PORT_B = 1 /* I/O port B */ -}; - -enum { - DEVICE_NONE = 0, /* No peripheral */ - DEVICE_PAD2B = 1, /* Standard 2-button digital joystick/gamepad */ - DEVICE_PADDLE = 2 /* Paddle controller; rotary dial with fire button */ -}; - -typedef struct { - UINT8 tr_level[2]; /* TR pin output level */ - UINT8 th_level[2]; /* TH pin output level */ - UINT8 tr_dir[2]; /* TR pin direction */ - UINT8 th_dir[2]; /* TH pin direction */ -} io_state; - -/* Global variables */ -extern io_state io_lut[2][256]; -extern io_state *io_current; - -/* Function prototypes */ -void pio_init(void); -void pio_reset(void); -void pio_shutdown(void); -void system_assign_device(INT32 port, INT32 type); - -void io_lut_init(void); -void ioctrl_w(UINT8 data); -UINT8 input_r(INT32 offset); -void sio_w(INT32 offset, INT32 data); -UINT8 sio_r(INT32 offset); - -#endif /* _PIO_H_ */ diff --git a/jan/src/burn/drv/sms/smsrender.cpp b/jan/src/burn/drv/sms/smsrender.cpp deleted file mode 100644 index e1e7d6572..000000000 --- a/jan/src/burn/drv/sms/smsrender.cpp +++ /dev/null @@ -1,620 +0,0 @@ -/* - render.c -- - Display rendering. -*/ - -#include "smsshared.h" - -UINT8 sms_cram_expand_table[4]; -UINT8 gg_cram_expand_table[16]; - -/* Background drawing function */ -void (*render_bg)(INT16 line) = NULL; -void (*render_obj)(INT16 line) = NULL; - -/* Pointer to output buffer */ -UINT8 *linebuf; - -/* Internal buffer for drawing non 8-bit displays */ -UINT8 internal_buffer[0x200]; - -/* Precalculated pixel table */ -UINT16 pixel[PALETTE_SIZE]; - -/* Dirty pattern info */ -UINT8 bg_name_dirty[0x200]; /* 1= This pattern is dirty */ -UINT16 bg_name_list[0x200]; /* List of modified pattern indices */ -UINT16 bg_list_index; /* # of modified patterns in list */ -UINT8 bg_pattern_cache[0x20000];/* Cached and flipped patterns */ - -/* Pixel look-up table */ -UINT8 lut[0x10000]; - -/* Attribute expansion table */ -static const UINT32 atex[4] = -{ - 0x00000000, - 0x10101010, - 0x20202020, - 0x30303030, -}; - -/* Bitplane to packed pixel LUT */ -UINT32 bp_lut[0x10000]; - -UINT32 gg_overscanmode; - -/* Macros to access memory 32-bits at a time (from MAME's drawgfx.c) */ - -#ifdef ALIGN_DWORD - -static __inline__ UINT32 read_dword(void *address) -{ - if ((UINT32)address & 3) - { -#ifdef LSB_FIRST /* little endian version */ - return ( *((UINT8 *)address) + - (*((UINT8 *)address+1) << 8) + - (*((UINT8 *)address+2) << 16) + - (*((UINT8 *)address+3) << 24) ); -#else /* big endian version */ - return ( *((UINT8 *)address+3) + - (*((UINT8 *)address+2) << 8) + - (*((UINT8 *)address+1) << 16) + - (*((UINT8 *)address) << 24) ); -#endif - } - else - return *(UINT32 *)address; -} - - -static __inline__ void write_dword(void *address, UINT32 data) -{ - if ((UINT32)address & 3) - { -#ifdef LSB_FIRST - *((UINT8 *)address) = data; - *((UINT8 *)address+1) = (data >> 8); - *((UINT8 *)address+2) = (data >> 16); - *((UINT8 *)address+3) = (data >> 24); -#else - *((UINT8 *)address+3) = data; - *((UINT8 *)address+2) = (data >> 8); - *((UINT8 *)address+1) = (data >> 16); - *((UINT8 *)address) = (data >> 24); -#endif - return; - } - else - *(UINT32 *)address = data; -} -#else -#define read_dword(address) *(UINT32 *)address -#define write_dword(address,data) *(UINT32 *)address=data -#endif - - -/****************************************************************************/ - - -void render_shutdown(void) -{ -} - -/* Initialize the rendering data */ -void render_init(void) -{ - INT32 i, j; - INT32 bx, sx, b, s, bp, bf, sf, c; - - make_tms_tables(); - memset(&lut, 0, sizeof(lut)); - memset(&bp_lut, 0, sizeof(bp_lut)); - - /* Generate 64k of data for the look up table */ - for(bx = 0; bx < 0x100; bx++) - { - for(sx = 0; sx < 0x100; sx++) - { - /* Background pixel */ - b = (bx & 0x0F); - - /* Background priority */ - bp = (bx & 0x20) ? 1 : 0; - - /* Full background pixel + priority + sprite marker */ - bf = (bx & 0x7F); - - /* Sprite pixel */ - s = (sx & 0x0F); - - /* Full sprite pixel, w/ palette and marker bits added */ - sf = (sx & 0x0F) | 0x10 | 0x40; - - /* Overwriting a sprite pixel ? */ - if(bx & 0x40) - { - /* Return the input */ - c = bf; - } - else - { - /* Work out priority and transparency for both pixels */ - if(bp) - { - /* Underlying pixel is high priority */ - if(b) - { - c = bf | 0x40; - } - else - { - - if(s) - { - c = sf; - } - else - { - c = bf; - } - } - } - else - { - /* Underlying pixel is low priority */ - if(s) - { - c = sf; - } - else - { - c = bf; - } - } - } - - /* Store result */ - lut[(bx << 8) | (sx)] = c; - } - } - - /* Make bitplane to pixel lookup table */ - for(i = 0; i < 0x100; i++) - for(j = 0; j < 0x100; j++) - { - INT32 x; - UINT32 out = 0; - for(x = 0; x < 8; x++) - { - out |= (j & (0x80 >> x)) ? (UINT32)(8 << (x << 2)) : 0; - out |= (i & (0x80 >> x)) ? (UINT32)(4 << (x << 2)) : 0; - } -#if LSB_FIRST - bp_lut[(j << 8) | (i)] = out; -#else - bp_lut[(i << 8) | (j)] = out; -#endif - } - - for(i = 0; i < 4; i++) - { - UINT8 c2 = i << 6 | i << 4 | i << 2 | i; - sms_cram_expand_table[i] = c2; - } - - for(i = 0; i < 16; i++) - { - UINT8 c2 = i << 4 | i; - gg_cram_expand_table[i] = c2; - } - - render_reset(); - -} - - -/* Reset the rendering data */ -void render_reset(void) -{ - INT32 i; - - /* Clear display bitmap */ - memset(bitmap.data, 0, bitmap.width * bitmap.height); - - /* Clear palette */ - for(i = 0; i < PALETTE_SIZE; i++) - { - palette_sync(i, 1); - } - - /* Invalidate pattern cache */ - memset(&bg_name_dirty, 0, sizeof(bg_name_dirty)); - memset(&bg_name_list, 0, sizeof(bg_name_list)); - bg_list_index = 0; - memset(&bg_pattern_cache, 0, sizeof(bg_pattern_cache)); - memset(&internal_buffer, 0, sizeof(internal_buffer)); - /* Pick render routine */ - render_bg = render_bg_sms; - render_obj = render_obj_sms; -} - - -/* Draw a line of the display */ -void render_line(INT16 line) -{ - /* Ensure we're within the viewport range */ - if(line >= vdp.height) - return; - - /* Point to current line in output buffer */ - linebuf = (bitmap.depth == 8) ? &bitmap.data[(line * bitmap.pitch)] : &internal_buffer[0]; - - /* Update pattern cache */ - update_bg_pattern_cache(); - - memset(linebuf, 0, bitmap.width); - - INT32 extend = (vdp.extended && IS_GG) ? 16 : 0; // GG: in extended mode, the screen starts 16pixels lower than usual. - - if((IS_GG) && ((!gg_overscanmode && ((line < 24 + extend) || (line > 167 + extend))) || (gg_overscanmode && line < 9))) { - // GG: Blank top and bottom borders. - // GG: If overscan mode is enabled, only blank the top 8 lines (which are the most corrupted). - } else - if(!(vdp.reg[1] & 0x40)) - { // Blank line with backdrop color (full width) - memset(linebuf, BACKDROP_COLOR, bitmap.width); - } - else - { - /* Draw background */ - if(render_bg != NULL) - render_bg(line); - - /* Draw sprites */ - if(render_obj != NULL) - render_obj(line); - - /* Blank leftmost column of display & center screen */ - if(vdp.reg[0] & 0x20) - { - if (IS_GG) - bitmap.viewport.x = 44; // fixes crap on the right side of the screen in Devilish, Yuyu & Codemasters games - memset(linebuf, BACKDROP_COLOR, 8); - // center the screen -dink - memmove(linebuf+4, linebuf+8, bitmap.viewport.w + bitmap.viewport.x); - if (!IS_GG) - memset(linebuf+bitmap.viewport.w + bitmap.viewport.x - 4, BACKDROP_COLOR, 4); - } else { - if (IS_GG) - bitmap.viewport.x = 48; - } - } - - if(bitmap.depth != 8) remap_8_to_16(line, extend); -} - - -/* Draw the Master System background */ -void render_bg_sms(INT16 line) -{ - INT32 locked = 0; - INT32 yscroll_mask = (vdp.extended) ? 256 : 224; - INT32 v_line = (line + vdp.reg[9]) % yscroll_mask; - INT32 v_row = (v_line & 7) << 3; - INT32 hscroll = ((vdp.reg[0] & 0x40) && (line < 0x10)) ? 0 : (0x100 - vdp.reg[8]); - INT32 column = 0; - UINT16 attr; - UINT16 *nt = (UINT16 *)&vdp.vram[vdp.ntab + ((v_line >> 3) << 6)]; - INT32 nt_scroll = (hscroll >> 3); - INT32 shift = (hscroll & 7); - UINT32 atex_mask; - UINT32 *cache_ptr; - UINT32 *linebuf_ptr = (UINT32 *)&linebuf[0 - shift]; - - /* Draw first column (clipped) */ - if(shift) - { - INT32 x; - - for(x = shift; x < 8; x++) - linebuf[(0 - shift) + (x)] = 0; - - column++; - } - - /* Draw a line of the background */ - for(; column < 32; column++) - { - /* Stop vertical scrolling for leftmost eight columns */ - if((vdp.reg[0] & 0x80) && (!locked) && (column >= 24)) - { - locked = 1; - v_row = (line & 7) << 3; - nt = (UINT16 *)&vdp.vram[((vdp.reg[2] << 10) & 0x3800) + ((line >> 3) << 6)]; - } - - /* Get name table attribute word */ - attr = nt[(column + nt_scroll) & 0x1F]; - -#ifndef LSB_FIRST - attr = (((attr & 0xFF) << 8) | ((attr & 0xFF00) >> 8)); -#endif - /* Expand priority and palette bits */ - atex_mask = atex[(attr >> 11) & 3]; - - /* Point to a line of pattern data in cache */ - cache_ptr = (UINT32 *)&bg_pattern_cache[((attr & 0x7FF) << 6) | (v_row)]; - - /* Copy the left half, adding the attribute bits in */ - write_dword( &linebuf_ptr[(column << 1)] , read_dword( &cache_ptr[0] ) | (atex_mask)); - - /* Copy the right half, adding the attribute bits in */ - write_dword( &linebuf_ptr[(column << 1) | (1)], read_dword( &cache_ptr[1] ) | (atex_mask)); - } - - /* Draw last column (clipped) */ - if(shift) - { - INT32 x, c, a; - - UINT8 *p = &linebuf[(0 - shift)+(column << 3)]; - - attr = nt[(column + nt_scroll) & 0x1F]; - -#ifndef LSB_FIRST - attr = (((attr & 0xFF) << 8) | ((attr & 0xFF00) >> 8)); -#endif - a = (attr >> 7) & 0x30; - - for(x = 0; x < shift; x++) - { - c = bg_pattern_cache[((attr & 0x7FF) << 6) | (v_row) | (x)]; - p[x] = ((c) | (a)); - } - } -} - -/* Draw sprites */ -void render_obj_sms(INT16 line) -{ - INT32 i; - UINT8 collision_buffer = 0; - - /* Sprite count for current line (8 max.) */ - INT32 count = 0; - - /* Sprite dimensions */ - INT32 width = 8; - INT32 height = (vdp.reg[1] & 0x02) ? 16 : 8; - - /* Pointer to sprite attribute table */ - UINT8 *st = (UINT8 *)&vdp.vram[vdp.satb]; - - /* Adjust dimensions for double size sprites */ - if(vdp.reg[1] & 0x01) - { - width *= 2; - height *= 2; - } - - /* Draw sprites in front-to-back order */ - for(i = 0; i < 64; i++) - { - /* Sprite Y position */ - INT32 yp = st[i]; - - /* Found end of sprite list marker for non-extended modes? */ - if(vdp.extended == 0 && yp == 208) - goto end; - - /* Actual Y position is +1 */ - yp++; - - /* Wrap Y coordinate for sprites > 240 */ - if(yp > 240) yp -= 256; - - /* Check if sprite falls on current line */ - if((line >= yp) && (line < (yp + height))) - { - UINT8 *linebuf_ptr; - - /* Width of sprite */ - INT32 start = 0; - INT32 end = width; - - /* Sprite X position */ - INT32 xp = st[0x80 + (i << 1)]; - - /* Pattern name */ - INT32 n = st[0x81 + (i << 1)]; - - /* Bump sprite count */ - count++; - - /* Too many sprites on this line ? */ - if(count == 9) - { - vdp.status |= 0x40; - goto end; - } - - /* X position shift */ - if(vdp.reg[0] & 0x08) xp -= 8; - - /* Add MSB of pattern name */ - if(vdp.reg[6] & 0x04) n |= 0x0100; - - /* Mask LSB for 8x16 sprites */ - if(vdp.reg[1] & 0x02) n &= 0x01FE; - - /* Point to offset in line buffer */ - linebuf_ptr = (UINT8 *)&linebuf[xp]; - - /* Clip sprites on left edge */ - if(xp < 0) - { - start = (0 - xp); - } - - /* Clip sprites on right edge */ - if((xp + width) > 256) - { - end = (256 - xp); - } - - /* Draw double size sprite */ - if(vdp.reg[1] & 0x01) - { - INT16 x; - UINT8 *cache_ptr = (UINT8 *)&bg_pattern_cache[(n << 6) | (((line - yp) >> 1) << 3)]; - - /* Draw sprite line */ - for(x = start; x < end; x++) - { - /* Source pixel from cache */ - UINT8 sp = cache_ptr[(x >> 1)]; - - /* Only draw opaque sprite pixels */ - if(sp) - { - /* Background pixel from line buffer */ - UINT8 bg = linebuf_ptr[x]; - - /* Look up result */ - linebuf_ptr[x] = lut[(bg << 8) | (sp)]; - - /* Update collision buffer */ - collision_buffer |= bg; - } - } - } - else /* Regular size sprite (8x8 / 8x16) */ - { - INT16 x; - UINT8 *cache_ptr = (UINT8 *)&bg_pattern_cache[(n << 6) | ((line - yp) << 3)]; - - /* Draw sprite line */ - for(x = start; x < end; x++) - { - /* Source pixel from cache */ - UINT8 sp = cache_ptr[x]; - - /* Only draw opaque sprite pixels */ - if(sp) - { - /* Background pixel from line buffer */ - UINT8 bg = linebuf_ptr[x]; - - /* Look up result */ - linebuf_ptr[x] = lut[(bg << 8) | (sp)]; - - /* Update collision buffer */ - collision_buffer |= bg; - } - } - } - } - } -end: - /* Set sprite collision flag */ - if(collision_buffer & 0x40) - vdp.status |= 0x20; -} - - - -void update_bg_pattern_cache(void) -{ - INT32 i; - UINT8 x, y; - UINT16 name; - - if(!bg_list_index) return; - - for(i = 0; i < bg_list_index; i++) - { - name = bg_name_list[i]; - bg_name_list[i] = 0; - - for(y = 0; y < 8; y++) - { - if(bg_name_dirty[name] & (1 << y)) - { - UINT8 *dst = &bg_pattern_cache[name << 6]; - - UINT16 *bp01 = (UINT16 *)&vdp.vram[(name << 5) | (y << 2) | (0)]; - UINT16 *bp23 = (UINT16 *)&vdp.vram[(name << 5) | (y << 2) | (2)]; - UINT32 temp = (bp_lut[*bp01] >> 2) | (bp_lut[*bp23]); - - for(x = 0; x < 8; x++) - { - UINT8 c = (temp >> (x << 2)) & 0x0F; - dst[0x00000 | (y << 3) | (x)] = (c); - dst[0x08000 | (y << 3) | (x ^ 7)] = (c); - dst[0x10000 | ((y ^ 7) << 3) | (x)] = (c); - dst[0x18000 | ((y ^ 7) << 3) | (x ^ 7)] = (c); - } - } - } - bg_name_dirty[name] = 0; - } - bg_list_index = 0; -} - - -/* Update a palette entry */ -void palette_sync(INT16 index, INT16 force) -{ - INT16 r, g, b; - - // unless we are forcing an update, - // if not in mode 4, exit - - - if(IS_SMS && !force && ((vdp.reg[0] & 4) == 0) ) - return; - - if(IS_GG) - { - /* ----BBBBGGGGRRRR */ - r = (vdp.cram[(index << 1) | (0)] >> 0) & 0x0F; - g = (vdp.cram[(index << 1) | (0)] >> 4) & 0x0F; - b = (vdp.cram[(index << 1) | (1)] >> 0) & 0x0F; - - r = gg_cram_expand_table[r]; - g = gg_cram_expand_table[g]; - b = gg_cram_expand_table[b]; - } - else - { - /* --BBGGRR */ - r = (vdp.cram[index] >> 0) & 3; - g = (vdp.cram[index] >> 2) & 3; - b = (vdp.cram[index] >> 4) & 3; - - r = sms_cram_expand_table[r]; - g = sms_cram_expand_table[g]; - b = sms_cram_expand_table[b]; - } - - bitmap.pal.color[index][0] = r; - bitmap.pal.color[index][1] = g; - bitmap.pal.color[index][2] = b; - - pixel[index] = MAKE_PIXEL(r, g, b); - - bitmap.pal.dirty[index] = bitmap.pal.update = 1; -} - -void remap_8_to_16(INT16 line, INT16 extend) -{ - if (line > nScreenHeight || (line - extend) < 0) return; - - UINT16 *p = (UINT16 *)&bitmap.data[((line - extend) * bitmap.pitch)]; - for (INT32 i = bitmap.viewport.x; i < bitmap.viewport.w + bitmap.viewport.x; i++) - { - p[i] = internal_buffer[i] & PIXEL_MASK; - } -} diff --git a/jan/src/burn/drv/sms/smsrender.h b/jan/src/burn/drv/sms/smsrender.h deleted file mode 100644 index 69ea9fe95..000000000 --- a/jan/src/burn/drv/sms/smsrender.h +++ /dev/null @@ -1,40 +0,0 @@ - -#ifndef _SMSRENDER_H_ -#define _SMSRENDER_H_ - -/* Pack RGB data into a 16-bit RGB 5:6:5 format */ -#define MAKE_PIXEL(r,g,b) (((r << 8) & 0xF800) | ((g << 3) & 0x07E0) | ((b >> 3) & 0x001F)) - -/* Used for blanking a line in whole or in part */ -#define BACKDROP_COLOR (0x10 | (vdp.reg[7] & 0x0F)) - -extern UINT8 sms_cram_expand_table[4]; -extern UINT8 gg_cram_expand_table[16]; -extern void (*render_bg)(INT16 line); -extern void (*render_obj)(INT16 line); -extern UINT8 *linebuf; -extern UINT8 internal_buffer[0x200]; -extern UINT16 pixel[]; -extern UINT8 bg_name_dirty[0x200]; -extern UINT16 bg_name_list[0x200]; -extern UINT16 bg_list_index; -extern UINT8 bg_pattern_cache[0x20000]; -extern UINT8 tms_lookup[16][256][2]; -extern UINT8 mc_lookup[16][256][8]; -extern UINT8 txt_lookup[256][2]; -extern UINT8 bp_expand[256][8]; -extern UINT8 lut[0x10000]; -extern UINT32 bp_lut[0x10000]; -extern UINT32 gg_overscanmode; - -void render_shutdown(void); -void render_init(void); -void render_reset(void); -void render_line(INT16 line); -void render_bg_sms(INT16 line); -void render_obj_sms(INT16 line); -void update_bg_pattern_cache(void); -void palette_sync(INT16 index, INT16 force); -void remap_8_to_16(INT16 line, INT16 extend); - -#endif /* _RENDER_H_ */ diff --git a/jan/src/burn/drv/sms/smsshared.h b/jan/src/burn/drv/sms/smsshared.h deleted file mode 100644 index df25b6d92..000000000 --- a/jan/src/burn/drv/sms/smsshared.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _SMSSHARED_H_ -#define _SMSSHARED_H_ - -#include "tiles_generic.h" - -#include "sms.h" -#include "smspio.h" -#include "smsvdp.h" -#include "smsrender.h" -#include "smstms.h" -//#include "smssn76489.h" -#include "smsfmintf.h" -#include "smssound.h" -#include "smssystem.h" - -#endif /* _SHARED_H_ */ diff --git a/jan/src/burn/drv/sms/smssound.cpp b/jan/src/burn/drv/sms/smssound.cpp deleted file mode 100644 index 609d92fa8..000000000 --- a/jan/src/burn/drv/sms/smssound.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - sound.c -- - Sound emulation. -*/ -#include "smsshared.h" -#include "sn76496.h" - -snd_t snd; - -INT32 sound_init(void) -{ - /* If we are reinitializing, shut down sound emulation */ - if(snd.enabled) - { - sound_shutdown(); - } - - /* Disable sound until initialization is complete */ - snd.enabled = 0; - - // Init sound emulation - SN76489Init(0, snd.psg_clock, 1); - SN76496SetRoute(0, 0.70, BURN_SND_ROUTE_BOTH); - - FM_Init(); - - /* Inform other functions that we can use sound */ - snd.enabled = 1; - - return 1; -} - - -void sound_shutdown(void) -{ - if(!snd.enabled) - return; - - /* Shut down SN76489 emulation */ - SN76496Exit(); - - /* Shut down YM2413 emulation */ - FM_Shutdown(); - - snd.enabled = 0; -} - - -void sound_reset(void) -{ - if(!snd.enabled) - return; - - /* Reset SN76489 emulator */ - SN76496Reset(); - - /* Reset YM2413 emulator */ - FM_Reset(); -} - - -/*--------------------------------------------------------------------------*/ -/* Sound chip access handlers */ -/*--------------------------------------------------------------------------*/ - -void psg_stereo_w(INT32 data) -{ - if(!snd.enabled) return; - - SN76496StereoWrite(0, data); -} - - -void psg_write(INT32 data) -{ - if(!snd.enabled) return; - - SN76496Write(0, data); -} - -/*--------------------------------------------------------------------------*/ -/* Mark III FM Unit / Master System (J) built-in FM handlers */ -/*--------------------------------------------------------------------------*/ - -INT32 fmunit_detect_r(void) -{ - return sms.fm_detect; -} - -void fmunit_detect_w(INT32 data) -{ - sms.fm_detect = data; -} - -void fmunit_write(INT32 offset, INT32 data) -{ - if(!snd.enabled || !sms.use_fm) - return; - - FM_Write(offset, data); -} - - diff --git a/jan/src/burn/drv/sms/smssound.h b/jan/src/burn/drv/sms/smssound.h deleted file mode 100644 index cbe94d4c2..000000000 --- a/jan/src/burn/drv/sms/smssound.h +++ /dev/null @@ -1,44 +0,0 @@ - -#ifndef _SMSSOUND_H_ -#define _SMSSOUND_H_ - -enum { - STREAM_PSG_L, /* PSG left channel */ - STREAM_PSG_R, /* PSG right channel */ - STREAM_FM_MO, /* YM2413 melody channel */ - STREAM_FM_RO, /* YM2413 rhythm channel */ - STREAM_MAX /* Total # of sound streams */ -}; - -/* Sound emulation structure */ -typedef struct -{ - void (*mixer_callback)(INT16 **stream, INT16 **output, INT32 length); - INT16 *output[2]; - INT16 *stream[STREAM_MAX]; - INT32 fm_which; - INT32 enabled; - INT32 fps; - INT32 buffer_size; - INT32 sample_count; - INT32 sample_rate; - INT32 done_so_far; - UINT32 fm_clock; - UINT32 psg_clock; -} snd_t; - - -/* Global data */ -extern snd_t snd; - -/* Function prototypes */ -void psg_write(INT32 data); -void psg_stereo_w(INT32 data); -INT32 fmunit_detect_r(void); -void fmunit_detect_w(INT32 data); -void fmunit_write(INT32 offset, INT32 data); -INT32 sound_init(void); -void sound_shutdown(void); -void sound_reset(void); - -#endif /* _SOUND_H_ */ diff --git a/jan/src/burn/drv/sms/smssystem.cpp b/jan/src/burn/drv/sms/smssystem.cpp deleted file mode 100644 index 856c5df26..000000000 --- a/jan/src/burn/drv/sms/smssystem.cpp +++ /dev/null @@ -1,209 +0,0 @@ -/* - Copyright (C) 1998-2004 Charles MacDonald - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "smsshared.h" -#include "z80_intf.h" -#include "sn76496.h" -#include "burn_ym2413.h" - -bitmap_t bitmap; -cart_t cart; -input_t input; - -/* Run the virtual console emulation for one frame */ -void system_frame(INT32 skip_render) -{ - static INT32 iline_table[] = {0xC0, 0xE0, 0xF0}; - INT32 lpf = (sms.display == DISPLAY_NTSC) ? 262 : 313; - INT32 iline, z80cnt = 0;; - INT32 nSoundBufferPos = 0; - - /* Debounce pause key */ - if(input.system & INPUT_PAUSE) - { - if(!sms.paused) - { - sms.paused = 1; - - ZetNmi(); - } - } - else - { - sms.paused = 0; - } - - ZetNewFrame(); - - text_counter = 0; - - /* End of frame, parse sprites for line 0 on line 261 (VCount=$FF) */ - if(vdp.mode <= 7) - parse_line(0); - - for(vdp.line = 0; vdp.line < lpf;) - { - iline = iline_table[vdp.extended]; - z80cnt = 0; - - if(!skip_render) - { - render_line(vdp.line); - } - - if(vdp.line <= iline) - { - vdp.left -= 1; - if(vdp.left == -1) - { - vdp.left = vdp.reg[0x0A]; - vdp.hint_pending = 1; - - if(vdp.reg[0x00] & 0x10) - { - /*if (!(ZetTotalCycles() % CYCLES_PER_LINE)) { - ZetRun(1); - z80cnt++; - }*/ - ZetRun(16); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - } - } - else - { - vdp.left = vdp.reg[0x0A]; - } - - ZetRun(228 - z80cnt); - - if(vdp.line == iline) - { - vdp.status |= 0x80; - vdp.vint_pending = 1; - - if(vdp.reg[0x01] & 0x20) - { - ZetRun(16); // Fixes Zool, Monster Truck Wars, Chicago Syndacite, Terminator 2 (SMS) - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } - } - - // Render Sound Segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / lpf; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (sms.use_fm) { - BurnYM2413Render(pSoundBuf, nSegmentLength); - } else { - memset(pSoundBuf, 0, nSegmentLength * 2 * sizeof(INT16)); - } - SN76496Update(0, pSoundBuf, nSegmentLength); - - nSoundBufferPos += nSegmentLength; - } - - ++vdp.line; - - if(vdp.mode <= 7) - parse_line(vdp.line); - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - if (sms.use_fm) { - BurnYM2413Render(pSoundBuf, nSegmentLength); - } else { - memset(pSoundBuf, 0, nSegmentLength * 2 * sizeof(INT16)); - } - SN76496Update(0, pSoundBuf, nSegmentLength); - } - } -} - - - - -void system_init(void) -{ - sms_init(); - pio_init(); - vdp_init(); - render_init(); - sound_init(); - - sms.save = 0; -} - -void system_shutdown(void) -{ -#ifdef DEBUG - INT32 i; - - /*error("PC:%04X\tSP:%04X\n", z80_get_reg(Z80_PC), z80_get_reg(Z80_SP)); - error("AF:%04X\tAF:%04X\n", z80_get_reg(Z80_AF), z80_get_reg(Z80_AF2)); - error("BC:%04X\tBC:%04X\n", z80_get_reg(Z80_BC), z80_get_reg(Z80_BC2)); - error("DE:%04X\tDE:%04X\n", z80_get_reg(Z80_DE), z80_get_reg(Z80_DE2)); - error("HL:%04X\tHL:%04X\n", z80_get_reg(Z80_HL), z80_get_reg(Z80_HL2)); - error("IX:%04X\tIY:%04X\n", z80_get_reg(Z80_IX), z80_get_reg(Z80_IY)); - - for(i = 0; i <= 0x0A; i++) - error("%02X ", vdp.reg[i]); - error("\n"); - - error("MODE:%02X\n", vdp.mode & 7); - error("PN:%04X\n", vdp.pn); - error("CT:%04X\n", vdp.ct); - error("PG:%04X\n", vdp.pg); - error("SA:%04X\n", vdp.sa); - error("SG:%04X\n", vdp.sg); - - error("\n");*/ -#endif - - sms_shutdown(); - pio_shutdown(); - vdp_shutdown(); - render_shutdown(); - sound_shutdown(); -} - -void system_reset(void) -{ - sms_reset(); - pio_reset(); - vdp_reset(); - render_reset(); - sound_reset(); -// system_manage_sram(cart.sram, SLOT_CART, SRAM_LOAD); -} - -void system_poweron(void) -{ - system_reset(); -} - -void system_poweroff(void) -{ -// system_manage_sram(cart.sram, SLOT_CART, SRAM_SAVE); -} - - diff --git a/jan/src/burn/drv/sms/smssystem.h b/jan/src/burn/drv/sms/smssystem.h deleted file mode 100644 index 9f241c42a..000000000 --- a/jan/src/burn/drv/sms/smssystem.h +++ /dev/null @@ -1,90 +0,0 @@ - -#ifndef _SMSSYSTEM_H_ -#define _SMSSYSTEM_H_ - -#define APP_NAME "SMS Plus" -#define APP_VERSION "1.3" - -#define PALETTE_SIZE 0x20 - -/* Mask for removing unused pixel data */ -#define PIXEL_MASK 0x1F - -/* These can be used for 'input.pad[]' */ -#define INPUT_UP 0x00000001 -#define INPUT_DOWN 0x00000002 -#define INPUT_LEFT 0x00000004 -#define INPUT_RIGHT 0x00000008 -#define INPUT_BUTTON2 0x00000010 -#define INPUT_BUTTON1 0x00000020 - -/* These can be used for 'input.system' */ -#define INPUT_START 0x00000001 /* Game Gear only */ -#define INPUT_PAUSE 0x00000002 /* Master System only */ -#define INPUT_RESET 0x00000004 /* Master System only */ - -enum { - SRAM_SAVE = 0, - SRAM_LOAD = 1 -}; - - -/* User input structure */ -typedef struct -{ - UINT8 pad[2]; - UINT8 analog[2]; - UINT32 system; -} input_t; - -/* Game image structure */ -typedef struct -{ - UINT8 *rom; - UINT8 pages; - UINT8 pages8k; - UINT32 sram_crc; - INT32 mapper; - UINT8 sram[0x8000]; - UINT8 fcr[4]; -} cart_t; - -/* Bitmap structure */ -typedef struct -{ - unsigned char *data; - INT32 width; - INT32 height; - INT32 pitch; - INT32 depth; - INT32 granularity; - struct { - INT32 x, y, w, h; - INT32 ox, oy, ow, oh; - INT32 changed; - } viewport; - struct - { - UINT8 color[PALETTE_SIZE][3]; - UINT8 dirty[PALETTE_SIZE]; - UINT8 update; - }pal; -} bitmap_t; - -/* Global variables */ -extern bitmap_t bitmap; /* Display bitmap */ -extern cart_t cart; /* Game cartridge data */ -extern input_t input; /* Controller input */ - -/* Function prototypes */ -void system_frame(INT32 skip_render); -void system_init(void); -void system_shutdown(void); -void system_reset(void); -void system_manage_sram(UINT8 *sram, INT32 slot, INT32 mode); -void system_poweron(void); -void system_poweroff(void); - -#endif /* _SYSTEM_H_ */ - - diff --git a/jan/src/burn/drv/sms/smstms.cpp b/jan/src/burn/drv/sms/smstms.cpp deleted file mode 100644 index 499ee386a..000000000 --- a/jan/src/burn/drv/sms/smstms.cpp +++ /dev/null @@ -1,517 +0,0 @@ -/* - tms.c -- - TMS9918 and legacy video mode support. -*/ -#include "smsshared.h" - -INT16 text_counter; /* Text offset counter */ -UINT8 tms_lookup[16][256][2]; /* Expand BD, PG data into 8-bit pixels (G1,G2) */ -UINT8 mc_lookup[16][256][8]; /* Expand BD, PG data into 8-bit pixels (MC) */ -UINT8 txt_lookup[256][2]; /* Expand BD, PG data into 8-bit pixels (TX) */ -UINT8 bp_expand[256][8]; /* Expand PG data into 8-bit pixels */ -UINT8 tms_obj_lut[16*256]; /* Look up priority between SG and display pixels */ - -static const UINT8 diff_mask[] = {0x07, 0x07, 0x0F, 0x0F}; -static const UINT8 name_mask[] = {0xFF, 0xFF, 0xFC, 0xFC}; -static const UINT8 diff_shift[] = {0, 1, 0, 1}; -static const UINT8 size_tab[] = {8, 16, 16, 32}; - -/* Internally latched sprite data in the VDP */ -typedef struct { - INT16 xpos; - UINT8 attr; - UINT8 sg[2]; -} tms_sprite; - -tms_sprite sprites[4]; -INT16 sprites_found; - -void parse_line(INT16 line) -{ - INT16 yp, i; - INT16 mode = vdp.reg[1] & 3; - INT16 size = size_tab[mode]; - INT16 diff, name; - UINT8 *sa, *sg; - tms_sprite *p; - - /* Reset # of sprites found */ - sprites_found = 0; - - /* Parse sprites */ - for(i = 0; i < 32; i++) - { - /* PoINT16 to current sprite in SA and our current sprite record */ - p = &sprites[sprites_found]; - sa = &vdp.vram[vdp.sa + (i << 2)]; - - /* Fetch Y coordinate */ - yp = sa[0]; - - /* Check for end marker */ - if(yp == 0xD0) - goto parse_end; - - /* Wrap Y position */ - if(yp > 0xE0) - yp -= 256; - - /* Check if sprite falls on following line */ - if(line >= yp && line < (yp + size)) - { - /* Sprite overflow on this line */ - if(sprites_found == 4) - { - /* Set 5S and abort parsing */ - vdp.status |= 0x40; - goto parse_end; - } - - /* Fetch X position */ - p->xpos = sa[1]; - - /* Fetch name */ - name = sa[2] & name_mask[mode]; - - /* Load attribute into attribute storage */ - p->attr = sa[3]; - - /* Apply early clock bit */ - if(p->attr & 0x80) - p->xpos -= 32; - - /* Calculate offset in pattern */ - diff = ((line - yp) >> diff_shift[mode]) & diff_mask[mode]; - - /* Insert additional name bit for 16-pixel tall sprites */ - if(diff & 8) - name |= 1; - - /* Fetch SG data */ - sg = &vdp.vram[vdp.sg | (name << 3) | (diff & 7)]; - p->sg[0] = sg[0x00]; - p->sg[1] = sg[0x10]; - - /* Bump found sprite count */ - ++sprites_found; - } - } -parse_end: - - /* Insert number of last sprite entry processed */ - vdp.status = (vdp.status & 0xE0) | (i & 0x1F); -} - -void render_obj_tms(INT16 /*line*/) -{ - INT16 i, x = 0; - INT16 size, start, end, mode; - UINT8 *lb, *lutp, *ex[2]; - tms_sprite *p; - - mode = vdp.reg[1] & 3; - size = size_tab[mode]; - - /* Render sprites */ - for(i = 0; i < sprites_found; i++) - { - p = &sprites[i]; - lb = &linebuf[p->xpos]; - lutp = &tms_obj_lut[(p->attr & 0x0F) << 8]; - - /* PoINT16 to expanded PG data */ - ex[0] = bp_expand[p->sg[0]]; - ex[1] = bp_expand[p->sg[1]]; - - /* Clip left edge */ - if(p->xpos < 0) - start = 0 - p->xpos; - else - start = 0; - - /* Clip right edge */ - if(p->xpos > 256 - size) - end = 256 - p->xpos; - else - end = size; - - /* Render sprite line */ - switch(mode) - { - case 0: /* 8x8 */ - for(x = start; x < end; x++) { - if(ex[0][x]) - lb[x] = lutp[lb[x]]; - } - break; - - case 1: /* 8x8 zoomed */ - for(x = start; x < end; x++) { - if(ex[0][x >> 1]) - lb[x] = lutp[lb[x]]; - } - break; - - case 2: /* 16x16 */ - for(x = start; x < end; x++) { - if(ex[(x >> 3) & 1][x & 7]) - lb[x] = lutp[lb[x]]; - } - break; - - case 3: /* 16x16 zoomed */ - for(x = start; x < end; x++) { - if(ex[(x >> 4) & 1][(x >> 1) & 7]) - lb[x] = lutp[lb[x]]; - } - break; - } - } -} - -/**** -1.) NOTE: xpos can be negative, but the 'start' value that is added - to xpos will ensure it is positive. - - For an EC sprite that is offscreen, 'start' will be larger - than 'end' and the for-loop used for rendering will abort - on the first pass. -***/ - - -#define RENDER_TX_LINE \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; - -#define RENDER_TX_BORDER \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; \ - *lb++ = 0x10 | clut[0]; - -#define RENDER_GR_LINE \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; \ - *lb++ = 0x10 | clut[ *bpex++ ]; - -#define RENDER_MC_LINE \ - *lb++ = 0x10 | *mcex++; \ - *lb++ = 0x10 | *mcex++; \ - *lb++ = 0x10 | *mcex++; \ - *lb++ = 0x10 | *mcex++; \ - *lb++ = 0x10 | *mcex++; \ - *lb++ = 0x10 | *mcex++; \ - *lb++ = 0x10 | *mcex++; \ - *lb++ = 0x10 | *mcex++; - -void make_tms_tables(void) -{ - INT16 i, j, x; - INT16 bd, pg, ct; - INT16 sx, bx; - - for(sx = 0; sx < 16; sx++) - { - for(bx = 0; bx < 256; bx++) - { -// UINT8 bd = (bx & 0x0F); - UINT8 bs = (bx & 0x40); -// UINT8 bt = (bd == 0) ? 1 : 0; - UINT8 sd = (sx & 0x0F); -// UINT8 st = (sd == 0) ? 1 : 0; - - // opaque sprite pixel, choose 2nd pal and set sprite marker - if(sd && !bs) - { - tms_obj_lut[(sx<<8)|(bx)] = sd | 0x10 | 0x40; - } - else - if(sd && bs) - { - // writing over a sprite - tms_obj_lut[(sx<<8)|(bx)] = bx; - } - else - { - tms_obj_lut[(sx<<8)|(bx)] = bx; - } - } - } - - - /* Text lookup table */ - for(bd = 0; bd < 256; bd++) - { - UINT8 bg = (bd >> 0) & 0x0F; - UINT8 fg = (bd >> 4) & 0x0F; - - /* If foreground is transparent, use background color */ - if(fg == 0) fg = bg; - - txt_lookup[bd][0] = bg; - txt_lookup[bd][1] = fg; - } - - /* Multicolor lookup table */ - for(bd = 0; bd < 16; bd++) - { - for(pg = 0; pg < 256; pg++) - { - INT16 l = (pg >> 4) & 0x0F; - INT16 r = (pg >> 0) & 0x0F; - - /* If foreground is transparent, use background color */ - if(l == 0) l = bd; - if(r == 0) r = bd; - - /* Unpack 2 nibbles across eight pixels */ - for(x = 0; x < 8; x++) - { - INT16 c = (x & 4) ? r : l; - - mc_lookup[bd][pg][x] = c; - } - } - } - - /* Make bitmap data expansion table */ - memset(bp_expand, 0, sizeof(bp_expand)); - for(i = 0; i < 256; i++) - { - for(j = 0; j < 8; j++) - { - INT16 c = (i >> (j ^ 7)) & 1; - bp_expand[i][j] = c; - } - } - - /* Graphics I/II lookup table */ - for(bd = 0; bd < 0x10; bd++) - { - for(ct = 0; ct < 0x100; ct++) - { - INT16 backdrop = (bd & 0x0F); - INT16 background = (ct >> 0) & 0x0F; - INT16 foreground = (ct >> 4) & 0x0F; - - /* If foreground is transparent, use background color */ - if(background == 0) background = backdrop; - if(foreground == 0) foreground = backdrop; - - tms_lookup[bd][ct][0] = background; - tms_lookup[bd][ct][1] = foreground; - } - } -} - - -void render_bg_tms(INT16 line) -{ - switch(vdp.mode & 7) - { - case 0: /* Graphics I */ - render_bg_m0(line); - break; - - case 1: /* Text */ - render_bg_m1(line); - break; - - case 2: /* Graphics II */ - render_bg_m2(line); - break; - - case 3: /* Text (Extended PG) */ - render_bg_m1x(line); - break; - - case 4: /* Multicolor */ - render_bg_m3(line); - break; - - case 5: /* Invalid (1+3) */ - render_bg_inv(line); - break; - - case 6: /* Multicolor (Extended PG) */ - render_bg_m3x(line); - break; - - case 7: /* Invalid (1+2+3) */ - render_bg_inv(line); - break; - } -} - -/* Graphics I */ -void render_bg_m0(INT16 line) -{ - INT16 v_row = (line & 7); - INT16 column; - INT16 name; - - UINT8 *clut; - UINT8 *bpex; - UINT8 *lb = &linebuf[0]; - UINT8 *pn = &vdp.vram[vdp.pn + ((line >> 3) << 5)]; - UINT8 *ct = &vdp.vram[vdp.ct]; - UINT8 *pg = &vdp.vram[vdp.pg | (v_row)]; - - for(column = 0; column < 32; column++) - { - name = pn[column]; - clut = &tms_lookup[vdp.bd][ct[name >> 3]][0]; - bpex = &bp_expand[pg[name << 3]][0]; - RENDER_GR_LINE - } -} - -/* Text */ -void render_bg_m1(INT16 line) -{ - INT16 v_row = (line & 7); - INT16 column; - - UINT8 *clut; - UINT8 *bpex; - UINT8 *lb = &linebuf[0]; -// UINT8 *pn = &vdp.vram[vdp.pn + ((line >> 3) * 40)]; - - UINT8 *pn = &vdp.vram[vdp.pn + text_counter]; - - UINT8 *pg = &vdp.vram[vdp.pg | (v_row)]; - UINT8 bk = vdp.reg[7]; - - clut = &txt_lookup[bk][0]; - - for(column = 0; column < 40; column++) - { - bpex = &bp_expand[pg[pn[column] << 3]][0]; - RENDER_TX_LINE - } - - /* V3 */ - if((vdp.line & 7) == 7) - text_counter += 40; - - RENDER_TX_BORDER -} - -/* Text + extended PG */ -void render_bg_m1x(INT16 line) -{ - INT16 v_row = (line & 7); - INT16 column; - - UINT8 *clut; - UINT8 *bpex; - UINT8 *lb = &linebuf[0]; - UINT8 *pn = &vdp.vram[vdp.pn + ((line >> 3) * 40)]; - UINT8 *pg = &vdp.vram[vdp.pg + (v_row) + ((line & 0xC0) << 5)]; - UINT8 bk = vdp.reg[7]; - - clut = &tms_lookup[0][bk][0]; - - for(column = 0; column < 40; column++) - { - bpex = &bp_expand[pg[pn[column] << 3]][0]; - RENDER_TX_LINE - } - RENDER_TX_BORDER -} - -/* Invalid (2+3/1+2+3) */ -void render_bg_inv(INT16 /*line*/) -{ - INT16 column; - UINT8 *clut; - UINT8 *bpex; - UINT8 *lb = &linebuf[0]; - UINT8 bk = vdp.reg[7]; - - clut = &txt_lookup[bk][0]; - - for(column = 0; column < 40; column++) - { - bpex = &bp_expand[0xF0][0]; - RENDER_TX_LINE - } -} - -/* Multicolor */ -void render_bg_m3(INT16 line) -{ - INT16 column; - UINT8 *mcex; - UINT8 *lb = &linebuf[0]; - - UINT8 *pn = &vdp.vram[vdp.pn + ((line >> 3) << 5)]; - UINT8 *pg = &vdp.vram[vdp.pg + ((line >> 2) & 7)]; - - for(column = 0; column < 32; column++) - { - mcex = &mc_lookup[vdp.bd][pg[pn[column]<<3]][0]; - RENDER_MC_LINE - } -} - -/* Multicolor + extended PG */ -void render_bg_m3x(INT16 line) -{ - INT16 column; - UINT8 *mcex; - UINT8 *lb = &linebuf[0]; - UINT8 *pn = &vdp.vram[vdp.pn + ((line >> 3) << 5)]; - UINT8 *pg = &vdp.vram[vdp.pg + ((line >> 2) & 7) + ((line & 0xC0) << 5)]; - - for(column = 0; column < 32; column++) - { - mcex = &mc_lookup[vdp.bd][pg[pn[column]<<3]][0]; - RENDER_MC_LINE - } -} - -/* Graphics II */ -void render_bg_m2(INT16 line) -{ - INT16 v_row = (line & 7); - INT16 column; - INT16 name; - - UINT8 *clut; - UINT8 *bpex; - UINT8 *lb = &linebuf[0]; - UINT8 *pn = &vdp.vram[vdp.pn | ((line & 0xF8) << 2)]; - UINT8 *ct = &vdp.vram[(vdp.ct & 0x2000) | (v_row) | ((line & 0xC0) << 5)]; - UINT8 *pg = &vdp.vram[(vdp.pg & 0x2000) | (v_row) | ((line & 0xC0) << 5)]; - - for(column = 0; column < 32; column++) - { - name = pn[column] << 3; - clut = &tms_lookup[vdp.bd][ct[name]][0]; - bpex = &bp_expand[pg[name]][0]; - RENDER_GR_LINE - } -} - diff --git a/jan/src/burn/drv/sms/smstms.h b/jan/src/burn/drv/sms/smstms.h deleted file mode 100644 index 6b402634c..000000000 --- a/jan/src/burn/drv/sms/smstms.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _SMSTMS_H_ -#define _SMSTMS_H_ - -extern INT16 text_counter; - - -void make_tms_tables(void); -void render_bg_tms(INT16 line); -void render_bg_m0(INT16 line); -void render_bg_m1(INT16 line); -void render_bg_m1x(INT16 line); -void render_bg_inv(INT16 line); -void render_bg_m3(INT16 line); -void render_bg_m3x(INT16 line); -void render_bg_m2(INT16 line); -void render_obj_tms(INT16 line); -void parse_line(INT16 line); - -#endif /* _TMS_H_ */ diff --git a/jan/src/burn/drv/sms/smsvdp.cpp b/jan/src/burn/drv/sms/smsvdp.cpp deleted file mode 100644 index 6d8932a45..000000000 --- a/jan/src/burn/drv/sms/smsvdp.cpp +++ /dev/null @@ -1,569 +0,0 @@ -/* - vdp.c -- - Video Display Processor (VDP) emulation. -*/ -#include "smsshared.h" -#include "z80_intf.h" -#include "smshvc.h" - -static const UINT8 tms_crom[] = -{ - 0x00, 0x00, 0x08, 0x0C, - 0x10, 0x30, 0x01, 0x3C, - 0x02, 0x03, 0x05, 0x0F, - 0x04, 0x33, 0x15, 0x3F -}; - -static UINT32 TMS9928A_palette[16] = { - 0x000000, 0x000000, 0x21c842, 0x5edc78, 0x5455ed, 0x7d76fc, 0xd4524d, 0x42ebf5, - 0xfc5554, 0xff7978, 0xd4c154, 0xe6ce80, 0x21b03b, 0xc95bba, 0xcccccc, 0xffffff -}; - -/* Mark a pattern as dirty */ -#define MARK_BG_DIRTY(addr) \ -{ \ - INT32 name = (addr >> 5) & 0x1FF; \ - if(bg_name_dirty[name] == 0) \ - { \ - bg_name_list[bg_list_index] = name; \ - bg_list_index++; \ - } \ - bg_name_dirty[name] |= (1 << ((addr >> 2) & 7)); \ -} - - -/* VDP context */ -vdp_t vdp; -UINT32 smsvdp_tmsmode; - -/* Initialize VDP emulation */ -void vdp_init(void) -{ - vdp_reset(); -} - -void vdp_shutdown(void) -{ - /* Nothing to do */ -} - - -/* Reset VDP emulation */ -void vdp_reset(void) -{ - memset(&vdp, 0, sizeof(vdp_t)); - vdp.extended = 0; - vdp.height = 192; - - if (IS_SMS) - { - vdp.reg[0] = 0x36; - vdp.reg[1] = 0x80; - vdp.reg[2] = 0xFF; - vdp.reg[3] = 0xFF; - vdp.reg[4] = 0xFF; - vdp.reg[5] = 0xFF; - vdp.reg[6] = 0xFB; - vdp.reg[10] = 0xFF; - } - - bitmap.viewport.x = (IS_GG) ? 48 : 0; // 44 for (vdp.reg[0] & 0x20 && IS_GG) - bitmap.viewport.y = (IS_GG) ? 24 : 0; - bitmap.viewport.w = (IS_GG) ? 160 : 256; - bitmap.viewport.h = (IS_GG) ? 144 : 192; - bitmap.viewport.changed = 1; -} - - -void viewport_check(void) -{ - INT32 i; - - INT32 m1 = (vdp.reg[1] >> 4) & 1; - INT32 m3 = (vdp.reg[1] >> 3) & 1; - INT32 m2 = (vdp.reg[0] >> 1) & 1; - INT32 m4 = (vdp.reg[0] >> 2) & 1; - - vdp.mode = (m4 << 3 | m3 << 2 | m2 << 1 | m1 << 0); - - // check if this is switching out of tms - if(!IS_GG) - { - if(m4) - { - smsvdp_tmsmode = 0; - /* Restore SMS palette */ - for(i = 0; i < PALETTE_SIZE; i++) - { - palette_sync(i, 1); - } - } - else - { - smsvdp_tmsmode = 1; - /* Load TMS9918 palette */ - for(i = 0; i < PALETTE_SIZE; i++) - { - INT32 r, g, b; - - /*r = (tms_crom[i & 0x0F] >> 0) & 3; - g = (tms_crom[i & 0x0F] >> 2) & 3; - b = (tms_crom[i & 0x0F] >> 4) & 3; - - r = sms_cram_expand_table[r]; - g = sms_cram_expand_table[g]; - b = sms_cram_expand_table[b];*/ - r = TMS9928A_palette[i & 0x0f] >> 16; - g = TMS9928A_palette[i & 0x0f] >> 8; - b = TMS9928A_palette[i & 0x0f] >> 0; - - bitmap.pal.color[i][0] = r; - bitmap.pal.color[i][1] = g; - bitmap.pal.color[i][2] = b; - - pixel[i] = MAKE_PIXEL(r, g, b); - - bitmap.pal.dirty[i] = bitmap.pal.update = 1; - } - } - } - - /* Check for extended modes when M4 and M2 are set */ - if((vdp.reg[0] & 0x06) == 0x06) - { - /* Examine M1 and M3 to determine selected mode */ - switch(vdp.reg[1] & 0x18) - { - case 0x00: /* 192 */ - case 0x18: /* 192 */ - vdp.height = 192; - vdp.extended = 0; - if(bitmap.viewport.h != 192 && IS_SMS) - { - bitmap.viewport.oh = bitmap.viewport.h; - bitmap.viewport.h = 192; - bitmap.viewport.changed = 1; - } - vdp.ntab = (vdp.reg[2] << 10) & 0x3800; - break; - - case 0x08: /* 240 */ - vdp.height = 240; - vdp.extended = 2; - if(bitmap.viewport.h != 240 && IS_SMS) - { - bitmap.viewport.oh = bitmap.viewport.h; - bitmap.viewport.h = 240; - bitmap.viewport.changed = 1; - } - vdp.ntab = ((vdp.reg[2] << 10) & 0x3000) | 0x0700; - break; - - case 0x10: /* 224 */ - vdp.height = 224; - vdp.extended = 1; - if(bitmap.viewport.h != 224 && IS_SMS) - { - bitmap.viewport.oh = bitmap.viewport.h; - bitmap.viewport.h = 224; - bitmap.viewport.changed = 1; - } - vdp.ntab = ((vdp.reg[2] << 10) & 0x3000) | 0x0700; - break; - - } - } - else - { - vdp.height = 192; - vdp.extended = 0; - if(bitmap.viewport.h != 192 && IS_SMS) - { - bitmap.viewport.oh = bitmap.viewport.h; - bitmap.viewport.h = 192; - bitmap.viewport.changed = 1; - } - vdp.ntab = (vdp.reg[2] << 10) & 0x3800; - } - - vdp.pn = (vdp.reg[2] << 10) & 0x3C00; - vdp.ct = (vdp.reg[3] << 6) & 0x3FC0; - vdp.pg = (vdp.reg[4] << 11) & 0x3800; - vdp.sa = (vdp.reg[5] << 7) & 0x3F80; - vdp.sg = (vdp.reg[6] << 11) & 0x3800; - - render_bg = (vdp.mode & 8) ? render_bg_sms : render_bg_tms; - render_obj = (vdp.mode & 8) ? render_obj_sms : render_obj_tms; -} - - -void vdp_reg_w(UINT8 r, UINT8 d) -{ - /* Store register data */ - vdp.reg[r] = d; - - switch(r) - { - case 0x00: /* Mode Control No. 1 */ - if(vdp.hint_pending) - { - if(d & 0x10) - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - else - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - viewport_check(); - break; - - case 0x01: /* Mode Control No. 2 */ - if(vdp.vint_pending) - { - if(d & 0x20) - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - else - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - viewport_check(); - break; - - case 0x02: /* Name Table A Base Address */ - vdp.ntab = (vdp.reg[2] << 10) & 0x3800; - vdp.pn = (vdp.reg[2] << 10) & 0x3C00; - viewport_check(); - break; - - case 0x03: - vdp.ct = (vdp.reg[3] << 6) & 0x3FC0; - break; - - case 0x04: - vdp.pg = (vdp.reg[4] << 11) & 0x3800; - break; - - case 0x05: /* Sprite Attribute Table Base Address */ - vdp.satb = (vdp.reg[5] << 7) & 0x3F00; - vdp.sa = (vdp.reg[5] << 7) & 0x3F80; - break; - - case 0x06: - vdp.sg = (vdp.reg[6] << 11) & 0x3800; - break; - - case 0x07: - vdp.bd = (vdp.reg[7] & 0x0F); - break; - } -} - - -void vdp_write(INT32 offset, UINT8 data) -{ - INT32 index; - - switch(offset & 1) - { - case 0: /* Data port */ - - vdp.pending = 0; - - switch(vdp.code) - { - case 0: /* VRAM write */ - case 1: /* VRAM write */ - case 2: /* VRAM write */ - index = (vdp.addr & 0x3FFF); - if(data != vdp.vram[index]) - { - vdp.vram[index] = data; - MARK_BG_DIRTY(vdp.addr); - } - break; - - case 3: /* CRAM write */ - index = (vdp.addr & 0x1F); - if(data != vdp.cram[index]) - { - vdp.cram[index] = data; - palette_sync(index, 0); - } - break; - } - vdp.addr = (vdp.addr + 1) & 0x3FFF; - return; - - case 1: /* Control port */ - if(vdp.pending == 0) - { - vdp.addr = (vdp.addr & 0x3F00) | (data & 0xFF); - vdp.latch = data; - vdp.pending = 1; - } - else - { - vdp.pending = 0; - vdp.code = (data >> 6) & 3; - vdp.addr = (data << 8 | vdp.latch) & 0x3FFF; - - if(vdp.code == 0) - { - vdp.buffer = vdp.vram[vdp.addr & 0x3FFF]; - vdp.addr = (vdp.addr + 1) & 0x3FFF; - } - - if(vdp.code == 2) - { - INT32 r = (data & 0x0F); - INT32 d = vdp.latch; - vdp_reg_w(r, d); - } - } - return; - } -} - -UINT8 vdp_read(INT32 offset) -{ - UINT8 temp; - - switch(offset & 1) - { - case 0: /* CPU <-> VDP data buffer */ - vdp.pending = 0; - temp = vdp.buffer; - vdp.buffer = vdp.vram[vdp.addr & 0x3FFF]; - vdp.addr = (vdp.addr + 1) & 0x3FFF; - return temp; - - case 1: /* Status flags */ - temp = vdp.status | 0x1f; - vdp.pending = 0; - vdp.status = 0; - vdp.vint_pending = 0; - vdp.hint_pending = 0; - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return temp; - } - - /* Just to please the compiler */ - return 0; -} - -UINT8 vdp_counter_r(INT32 offset) -{ - //INT32 cpixel; - - switch(offset & 1) - { - case 0: /* V Counter */ - return vc_table[sms.display][vdp.extended][vdp.line & 0x1FF]; - - case 1: /* H Counter */ - //cpixel = (((ZetTotalCycles() % CYCLES_PER_LINE) / 4) * 3) * 2; - //return hc_table[0][(cpixel >> 1) & 0x01FF]; - return hc_table[0][ZetTotalCycles() % CYCLES_PER_LINE]; - } - - /* Just to please the compiler */ - return 0; -} - - -/*--------------------------------------------------------------------------*/ -/* Game Gear VDP handlers */ -/*--------------------------------------------------------------------------*/ - -void gg_vdp_write(INT32 offset, UINT8 data) -{ - INT32 index; - - switch(offset & 1) - { - case 0: /* Data port */ - vdp.pending = 0; - switch(vdp.code) - { - case 0: /* VRAM write */ - case 1: /* VRAM write */ - case 2: /* VRAM write */ - index = (vdp.addr & 0x3FFF); - if(data != vdp.vram[index]) - { - vdp.vram[index] = data; - MARK_BG_DIRTY(vdp.addr); - } - break; - - case 3: /* CRAM write */ - if(vdp.addr & 1) - { - vdp.cram_latch = (vdp.cram_latch & 0x00FF) | ((data & 0xFF) << 8); - vdp.cram[(vdp.addr & 0x3E) | (0)] = (vdp.cram_latch >> 0) & 0xFF; - vdp.cram[(vdp.addr & 0x3E) | (1)] = (vdp.cram_latch >> 8) & 0xFF; - palette_sync((vdp.addr >> 1) & 0x1F, 0); - } - else - { - vdp.cram_latch = (vdp.cram_latch & 0xFF00) | ((data & 0xFF) << 0); - } - break; - } - vdp.addr = (vdp.addr + 1) & 0x3FFF; - return; - - case 1: /* Control port */ - if(vdp.pending == 0) - { - vdp.addr = (vdp.addr & 0x3F00) | (data & 0xFF); - vdp.latch = data; - vdp.pending = 1; - } - else - { - vdp.pending = 0; - vdp.code = (data >> 6) & 3; - vdp.addr = (data << 8 | vdp.latch) & 0x3FFF; - - if(vdp.code == 0) - { - vdp.buffer = vdp.vram[vdp.addr & 0x3FFF]; - vdp.addr = (vdp.addr + 1) & 0x3FFF; - } - - if(vdp.code == 2) - { - INT32 r = (data & 0x0F); - INT32 d = vdp.latch; - vdp_reg_w(r, d); - } - } - return; - } -} - -/*--------------------------------------------------------------------------*/ -/* MegaDrive / Genesis VDP handlers */ -/*--------------------------------------------------------------------------*/ - -void md_vdp_write(INT32 offset, UINT8 data) -{ - INT32 index; - - switch(offset & 1) - { - case 0: /* Data port */ - - vdp.pending = 0; - - switch(vdp.code) - { - case 0: /* VRAM write */ - case 1: /* VRAM write */ - index = (vdp.addr & 0x3FFF); - if(data != vdp.vram[index]) - { - vdp.vram[index] = data; - MARK_BG_DIRTY(vdp.addr); - } - break; - - case 2: /* CRAM write */ - case 3: /* CRAM write */ - index = (vdp.addr & 0x1F); - if(data != vdp.cram[index]) - { - vdp.cram[index] = data; - palette_sync(index, 0); - } - break; - } - vdp.addr = (vdp.addr + 1) & 0x3FFF; - return; - - case 1: /* Control port */ - if(vdp.pending == 0) - { - vdp.latch = data; - vdp.pending = 1; - } - else - { - vdp.pending = 0; - vdp.code = (data >> 6) & 3; - vdp.addr = (data << 8 | vdp.latch) & 0x3FFF; - - if(vdp.code == 0) - { - vdp.buffer = vdp.vram[vdp.addr & 0x3FFF]; - vdp.addr = (vdp.addr + 1) & 0x3FFF; - } - - if(vdp.code == 2) - { - INT32 r = (data & 0x0F); - INT32 d = vdp.latch; - vdp_reg_w(r, d); - } - } - return; - } -} - -/*--------------------------------------------------------------------------*/ -/* TMS9918 VDP handlers */ -/*--------------------------------------------------------------------------*/ - -void tms_write(INT32 offset, INT32 data) -{ - INT32 index; - - switch(offset & 1) - { - case 0: /* Data port */ - - vdp.pending = 0; - - switch(vdp.code) - { - case 0: /* VRAM write */ - case 1: /* VRAM write */ - case 2: /* VRAM write */ - case 3: /* VRAM write */ - index = (vdp.addr & 0x3FFF); - if(data != vdp.vram[index]) - { - vdp.vram[index] = data; - MARK_BG_DIRTY(vdp.addr); - } - break; - } - vdp.addr = (vdp.addr + 1) & 0x3FFF; - return; - - case 1: /* Control port */ - if(vdp.pending == 0) - { - vdp.latch = data; - vdp.pending = 1; - } - else - { - vdp.pending = 0; - vdp.code = (data >> 6) & 3; - vdp.addr = (data << 8 | vdp.latch) & 0x3FFF; - - if(vdp.code == 0) - { - vdp.buffer = vdp.vram[vdp.addr & 0x3FFF]; - vdp.addr = (vdp.addr + 1) & 0x3FFF; - } - - if(vdp.code == 2) - { - INT32 r = (data & 0x07); - INT32 d = vdp.latch; - vdp_reg_w(r, d); - } - } - return; - } -} diff --git a/jan/src/burn/drv/sms/smsvdp.h b/jan/src/burn/drv/sms/smsvdp.h deleted file mode 100644 index 9c88a6861..000000000 --- a/jan/src/burn/drv/sms/smsvdp.h +++ /dev/null @@ -1,67 +0,0 @@ - -#ifndef _SMSVDP_H_ -#define _SMSVDP_H_ - -/* - vdp1 - - mode 4 when m4 set and m1 reset - - vdp2 - - mode 4 when m4 set and m2,m1 != 1,0 - - -*/ - -/* Display timing (NTSC) */ - -#define MASTER_CLOCK 3579545 -#define LINES_PER_FRAME 262 -#define FRAMES_PER_SECOND 60 -#define CYCLES_PER_LINE ((MASTER_CLOCK / FRAMES_PER_SECOND) / LINES_PER_FRAME) - -/* VDP context */ -typedef struct -{ - UINT8 vram[0x4000]; - UINT8 cram[0x40]; - UINT8 reg[0x10]; - UINT8 status; - UINT8 latch; - UINT8 pending; - UINT8 buffer; - UINT8 code; - UINT16 addr; - INT32 pn, ct, pg, sa, sg; - INT32 ntab; - INT32 satb; - INT32 line; - INT32 left; - UINT8 height; - UINT8 extended; - UINT8 mode; - UINT8 vint_pending; - UINT8 hint_pending; - UINT16 cram_latch; - UINT8 bd; -} vdp_t; - -/* Global data */ -extern vdp_t vdp; -extern UINT32 smsvdp_tmsmode; - -/* Function prototypes */ -void vdp_init(void); -void vdp_shutdown(void); -void vdp_reset(void); -UINT8 vdp_counter_r(INT32 offset); -UINT8 vdp_read(INT32 offset); -void vdp_write(INT32 offset, UINT8 data); -void gg_vdp_write(INT32 offset, UINT8 data); -void md_vdp_write(INT32 offset, UINT8 data); -void tms_write(INT32 offset, INT32 data); -void viewport_check(void); - -#endif /* _VDP_H_ */ - diff --git a/jan/src/burn/drv/snes/d_snes.cpp b/jan/src/burn/drv/snes/d_snes.cpp deleted file mode 100644 index ed4e373b9..000000000 --- a/jan/src/burn/drv/snes/d_snes.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "snes.h" - -unsigned char DoSnesReset = 0; - -unsigned char SnesJoy1[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -static struct BurnInputInfo SnesInputList[] = -{ - {"P1 Start", BIT_DIGITAL, SnesJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, SnesJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, SnesJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, SnesJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, SnesJoy1 + 3, "p1 right" }, - {"P1 Button A", BIT_DIGITAL, SnesJoy1 + 6, "p1 fire 1" }, - {"P1 Button B", BIT_DIGITAL, SnesJoy1 + 4, "p1 fire 2" }, - {"P1 Button C", BIT_DIGITAL, SnesJoy1 + 5, "p1 fire 3" }, - {"P1 Button X", BIT_DIGITAL, SnesJoy1 + 10, "p1 fire 4" }, - {"P1 Button Y", BIT_DIGITAL, SnesJoy1 + 9, "p1 fire 5" }, - {"P1 Button Z", BIT_DIGITAL, SnesJoy1 + 8, "p1 fire 6" }, - {"P1 Mode", BIT_DIGITAL, SnesJoy1 + 11, "p1 select" }, - {"Reset" , BIT_DIGITAL , &DoSnesReset , "reset" }, -}; - -STDINPUTINFO(Snes) - -static struct BurnDIPInfo SnesDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0x02, NULL }, -}; - -STDDIPINFO(Snes) - -static struct BurnRomInfo rSuperMarioWorldEuropeRev1RomDesc[] = { - { "smw.sfc", 524288, 0xb47f5f20, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(rSuperMarioWorldEuropeRev1) -STD_ROM_FN(rSuperMarioWorldEuropeRev1) - -struct BurnDriverD BurnDrvrSMW = { - "smw", NULL, NULL, NULL, "1986", - "Super Mario World (Europe) (Rev 1)\0", NULL, "Nintendo", "Miscellaneous", - L"Super Mario World (Europe) (Rev 1)", NULL, NULL, NULL, - BDF_GAME_WORKING|BDF_16BIT_ONLY , 2, HARDWARE_PREFIX_MISC_POST90S, GBF_SHOOT,0 , - NULL, rSuperMarioWorldEuropeRev1RomInfo, rSuperMarioWorldEuropeRev1RomName,NULL,NULL, SnesInputInfo, SnesDIPInfo, - SnesInit, SnesExit, SnesFrame, NULL, SnesScan, - NULL,0x6000,512 , 244, 4, 3 -}; - -static struct BurnRomInfo rSuperMarioWorldEuropeRomDesc[] = { - { "smwa.sfc", 524288, 0x3c41070f, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(rSuperMarioWorldEurope) -STD_ROM_FN(rSuperMarioWorldEurope) - -struct BurnDriverD BurnDrvrSuperMarioWorldEurope = { - "smwa", NULL, NULL, NULL, "1986", - "Super Mario World (Europe)\0", NULL, "Nintendo", "Miscellaneous", - L"Super Mario World (Europe)", NULL, NULL, NULL, - BDF_GAME_WORKING|BDF_16BIT_ONLY , 2, HARDWARE_PREFIX_MISC_POST90S, GBF_SHOOT,0 , - NULL, rSuperMarioWorldEuropeRomInfo, rSuperMarioWorldEuropeRomName,NULL,NULL, SnesInputInfo, SnesDIPInfo, - SnesInit, SnesExit, SnesFrame, NULL, SnesScan, - NULL,0x6000,512 , 244, 4, 3 -}; - -static struct BurnRomInfo rSuperMarioWorldJapanRomDesc[] = { - { "smwj.sfc", 524288, 0xec0ddac, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(rSuperMarioWorldJapan) -STD_ROM_FN(rSuperMarioWorldJapan) - -struct BurnDriverD BurnDrvrSuperMarioWorldJapan = { - "smwj", NULL, NULL, NULL, "1986", - "Super Mario World (Japan)\0", NULL, "Nintendo", "Miscellaneous", - L"Super Mario World (Japan)", NULL, NULL, NULL, - BDF_GAME_WORKING|BDF_16BIT_ONLY , 2, HARDWARE_PREFIX_MISC_POST90S, GBF_SHOOT,0 , - NULL, rSuperMarioWorldJapanRomInfo, rSuperMarioWorldJapanRomName,NULL,NULL, SnesInputInfo, SnesDIPInfo, - SnesInit, SnesExit, SnesFrame, NULL, SnesScan, - NULL,0x6000,512 , 244, 4, 3 -}; - -static struct BurnRomInfo rSuperMarioWorldUSARomDesc[] = { - { "smwu.sfc", 524288, 0xb19ed489, BRF_ESS | BRF_PRG }, -}; - - -STD_ROM_PICK(rSuperMarioWorldUSA) -STD_ROM_FN(rSuperMarioWorldUSA) - -struct BurnDriverD BurnDrvrSuperMarioWorldUSA = { - "smwu", NULL, NULL, NULL, "1986", - "Super Mario World (USA)\0", NULL, "Nintendo", "Miscellaneous", - L"Super Mario World (USA)", NULL, NULL, NULL, - BDF_GAME_WORKING|BDF_16BIT_ONLY , 2, HARDWARE_PREFIX_MISC_POST90S, GBF_SHOOT,0 , - NULL, rSuperMarioWorldUSARomInfo, rSuperMarioWorldUSARomName,NULL,NULL, SnesInputInfo, SnesDIPInfo, - SnesInit, SnesExit, SnesFrame, NULL, SnesScan, - NULL,0x6000,512 , 244, 4, 3 -}; diff --git a/jan/src/burn/drv/snes/snes.h b/jan/src/burn/drv/snes/snes.h deleted file mode 100644 index d659f4a8d..000000000 --- a/jan/src/burn/drv/snes/snes.h +++ /dev/null @@ -1,257 +0,0 @@ -#pragma once - -#include "tiles_generic.h" -#include "bitswap.h" - -/* Useful definitions */ -#define SNES_SCR_WIDTH 256 /* 32 characters 8 pixels wide */ -#define SNES_SCR_HEIGHT_NTSC 224 /* Can be 224 or 240 height */ -#define SNES_SCR_HEIGHT_PAL 274 /* ??? */ -#define SNES_VTOTAL_NTSC 262 /* Maximum number of lines for NTSC systems */ -#define SNES_VTOTAL_PAL 312 /* Maximum number of lines for PAL systems */ -#define SNES_HTOTAL 341 /* Maximum number pixels per line (incl. hblank) */ -#define SNES_DMA_BASE 0x4300 /* Base DMA register address */ -#define SNES_MODE_20 0x1 /* Lo-ROM cart */ -#define SNES_MODE_21 0x2 /* Hi-ROM cart */ -#define SNES_MODE_22 0x4 /* Extended Lo-ROM cart - SDD-1 */ -#define SNES_MODE_25 0x8 /* Extended Hi-ROM cart */ -#define SNES_NTSC 0x00 -#define SNES_PAL 0x10 -#define SNES_VRAM_SIZE 0x20000 /* 128kb of video ram */ -#define SNES_CGRAM_SIZE 0x202 /* 256 16-bit colours + 1 tacked on 16-bit colour for fixed colour */ -#define SNES_OAM_SIZE 0x440 /* 1088 bytes of Object Attribute Memory */ -#define SNES_SPCRAM_SIZE 0x10000 /* 64kb of spc700 ram */ -#define SNES_EXROM_START 0x1000000 -#define FIXED_COLOUR 256 /* Position in cgram for fixed colour */ -/* Definitions for PPU Memory-Mapped registers */ -#define INIDISP 0x2100 -#define OBSEL 0x2101 -#define OAMADDL 0x2102 -#define OAMADDH 0x2103 -#define OAMDATA 0x2104 -#define BGMODE 0x2105 /* abcdefff = abcd: bg4-1 tile size | e: BG3 high priority | f: mode */ -#define MOSAIC 0x2106 /* xxxxabcd = x: pixel size | abcd: affects bg 1-4 */ -#define BG1SC 0x2107 -#define BG2SC 0x2108 -#define BG3SC 0x2109 -#define BG4SC 0x210A -#define BG12NBA 0x210B -#define BG34NBA 0x210C -#define BG1HOFS 0x210D -#define BG1VOFS 0x210E -#define BG2HOFS 0x210F -#define BG2VOFS 0x2110 -#define BG3HOFS 0x2111 -#define BG3VOFS 0x2112 -#define BG4HOFS 0x2113 -#define BG4VOFS 0x2114 -#define VMAIN 0x2115 /* i---ffrr = i: Increment timing | f: Full graphic | r: increment rate */ -#define VMADDL 0x2116 /* aaaaaaaa = a: LSB of vram address */ -#define VMADDH 0x2117 /* aaaaaaaa = a: MSB of vram address */ -#define VMDATAL 0x2118 /* dddddddd = d: data to be written */ -#define VMDATAH 0x2119 /* dddddddd = d: data to be written */ -#define M7SEL 0x211A /* ab----yx = a: screen over | y: vertical flip | x: horizontal flip */ -#define M7A 0x211B /* aaaaaaaa = a: COSINE rotate angle / X expansion */ -#define M7B 0x211C /* aaaaaaaa = a: SINE rotate angle / X expansion */ -#define M7C 0x211D /* aaaaaaaa = a: SINE rotate angle / Y expansion */ -#define M7D 0x211E /* aaaaaaaa = a: COSINE rotate angle / Y expansion */ -#define M7X 0x211F -#define M7Y 0x2120 -#define CGADD 0x2121 -#define CGDATA 0x2122 -#define W12SEL 0x2123 -#define W34SEL 0x2124 -#define WOBJSEL 0x2125 -#define WH0 0x2126 /* pppppppp = p: Left position of window 1 */ -#define WH1 0x2127 /* pppppppp = p: Right position of window 1 */ -#define WH2 0x2128 /* pppppppp = p: Left position of window 2 */ -#define WH3 0x2129 /* pppppppp = p: Right position of window 2 */ -#define WBGLOG 0x212A /* aabbccdd = a: BG4 params | b: BG3 params | c: BG2 params | d: BG1 params */ -#define WOBJLOG 0x212B /* ----ccoo = c: Colour window params | o: Object window params */ -#define TM 0x212C -#define TS 0x212D -#define TMW 0x212E -#define TSW 0x212F -#define CGWSEL 0x2130 -#define CGADSUB 0x2131 -#define COLDATA 0x2132 -#define SETINI 0x2133 -#define MPYL 0x2134 -#define MPYM 0x2135 -#define MPYH 0x2136 -#define SLHV 0x2137 -#define ROAMDATA 0x2138 -#define RVMDATAL 0x2139 -#define RVMDATAH 0x213A -#define RCGDATA 0x213B -#define OPHCT 0x213C -#define OPVCT 0x213D -#define STAT77 0x213E -#define STAT78 0x213F -#define APU00 0x2140 -#define APU01 0x2141 -#define APU02 0x2142 -#define APU03 0x2143 -#define WMDATA 0x2180 -#define WMADDL 0x2181 -#define WMADDM 0x2182 -#define WMADDH 0x2183 -/* Definitions for CPU Memory-Mapped registers */ - -extern UINT16 snes_cgram[SNES_CGRAM_SIZE]; -extern UINT32 snesPal[0x20000]; -/*SPC700*/ -extern double spccycles; -extern double spctotal2; -extern double spctotal3; -void execspc(); - -static inline void clockspc(int cyc) -{ - spccycles+=cyc; - if (spccycles>0) execspc(); -} - -/*65816*/ -/*Registers*/ -typedef union -{ - UINT16 w; - struct - { -#ifndef BIG_ENDIAN - UINT8 l,h; -#else - UINT8 h,l; -#endif - } b; -} reg; - - -extern unsigned long pbr,dbr; -extern UINT16 pc,dp; - - - -extern INT32 ins,output; -extern INT32 timetolive; -extern INT32 inwai; -/*Opcode table*/ -extern void (*opcodes[256][5])(); - -/*CPU modes : 0 = X1M1 -1 = X1M0 -2 = X0M1 -3 = X0M0 -4 = emulation*/ -extern INT32 cpumode; - -/*Current opcode*/ -extern UINT8 global_opcode; -/*Global cycles count*/ -extern INT32 cycles; - -/*Memory*/ -extern UINT8 *SNES_ram; -extern UINT8 *SNES_rom; -extern UINT8 *memlookup[2048]; -extern UINT8 *memread; -extern UINT8 *memwrite; -extern UINT8 *accessspeed; - -extern INT32 lorom; - - -unsigned char snes_readmem(unsigned long adress); -void snes_writemem(unsigned long ad, unsigned char v); - -#define readmemw(a) (snes_readmem(a))|((snes_readmem((a)+1))<<8) -#define writememw(a,v) snes_writemem(a,(v)&0xFF); snes_writemem((a)+1,(v)>>8) -#define writememw2(a,v) snes_writemem((a)+1,(v)>>8); snes_writemem(a,(v)&0xFF) - -/*Video*/ -extern INT32 nmi,vbl,joyscan; -extern INT32 nmienable; - -extern INT32 ppumask; - -extern INT32 yirq,xirq,irqenable,irq; -extern INT32 lines; - - - -extern int global_pal; - -/*DMA registers*/ -extern unsigned short dmadest[8],dmasrc[8],dmalen[8]; -extern unsigned long hdmaaddr[8],hdmaaddr2[8]; -extern unsigned char dmabank[8],dmaibank[8],dmactrl[8],hdmastat[8],hdmadat[8]; -extern int hdmacount[8]; -extern unsigned char hdmaena; - -// debugging -void snemlog( TCHAR *format, ...); - -// ppu stuff -void resetppu(); -void initppu(); -void initspc(); -void exitspc(); -void makeopcodetable(); -unsigned char readppu(unsigned short addr); -void writeppu(unsigned short addr, unsigned char val); -void drawline(int line); - -// io stuff -void readjoy(); -unsigned char readio(unsigned short addr); -unsigned char readjoyold(unsigned short addr); -void writeio(unsigned short addr, unsigned char val); -void writejoyold(unsigned short addr, unsigned char val); - -struct CPU_P -{ - int c,z,i,d,b,v,n,m,x,e; -}; - -extern CPU_P p; - -// spc stuff -unsigned char readfromspc(unsigned short addr); -void writetospc(unsigned short addr, unsigned char val); -void resetspc(); - -extern unsigned char voiceon; - -//snes.cpp stuff - - - -// cpu stuff -void irq65816(); -void nmi65816(); -void reset65816(); -extern int skipz,setzf; -//mem stuff - -void allocmem(); - -void initsnem(); -void resetsnem(); -void execframe(); -void loadrom(char *fn); - -void snes_mapmem(); -void freemem(); -extern unsigned short srammask; -extern unsigned char *SNES_sram; -extern INT32 spctotal; - -// snes_main.cpp -INT32 SnesInit(); -INT32 SnesExit(); -INT32 SnesFrame(); -INT32 SnesScan(INT32 nAction,INT32 *pnMin); -extern unsigned char DoSnesReset; - -extern unsigned char SnesJoy1[12]; diff --git a/jan/src/burn/drv/snes/snes_65816.cpp b/jan/src/burn/drv/snes/snes_65816.cpp deleted file mode 100644 index 7b20c0e9b..000000000 --- a/jan/src/burn/drv/snes/snes_65816.cpp +++ /dev/null @@ -1,4529 +0,0 @@ -/*Snem 0.1 by Tom Walker -65816 emulation*/ - -#include -#include "snes.h" - -void updatecpumode(); -int inwai=0; - -reg a,x,y,s; -unsigned long pbr,dbr; -unsigned short pc,dp; -int skipz,setzf; -int ins; -extern int output; -extern int timetolive; -void (*opcodes[256][5])(); -int cpumode; - -/*Current opcode*/ -unsigned char global_opcode; -/*Global cycles count*/ -int cycles; - -CPU_P p; - - -/*Temporary variables*/ -unsigned long addr; - -/*Addressing modes*/ -static inline unsigned long absolute() -{ - unsigned long temp=readmemw(pbr|pc); pc+=2; - return temp|dbr; -} - -static inline unsigned long absolutex() -{ - unsigned long temp=(readmemw(pbr|pc))+x.w+dbr; pc+=2; - return temp; -} - -static inline unsigned long absolutey() -{ - unsigned long temp=(readmemw(pbr|pc))+y.w+dbr; pc+=2; - return temp; -} - -static inline unsigned long absolutelong() -{ - unsigned long temp=readmemw(pbr|pc); pc+=2; - temp|=(snes_readmem(pbr|pc)<<16); pc++; - return temp; -} - -static inline unsigned long absolutelongx() -{ - unsigned long temp=(readmemw(pbr|pc))+x.w; pc+=2; - temp+=(snes_readmem(pbr|pc)<<16); pc++; - return temp; -} - -static inline unsigned long zeropage() /*It's actually direct page, but I'm used to calling it zero page*/ -{ - unsigned long temp=snes_readmem(pbr|pc); pc++; - temp+=dp; - if (dp&0xFF) { cycles-=6; clockspc(6); } - return temp&0xFFFF; -} - -static inline unsigned long zeropagex() -{ - unsigned long temp=snes_readmem(pbr|pc)+x.w; pc++; - if (p.e) temp&=0xFF; - temp+=dp; - if (dp&0xFF) { cycles-=6; clockspc(6); } - return temp&0xFFFF; -} - -static inline unsigned long zeropagey() -{ - unsigned long temp=snes_readmem(pbr|pc)+y.w; pc++; - if (p.e) temp&=0xFF; - temp+=dp; - if (dp&0xFF) { cycles-=6; clockspc(6); } - return temp&0xFFFF; -} - -static inline unsigned long stack() -{ - unsigned long temp=snes_readmem(pbr|pc); pc++; - temp+=s.w; - return temp&0xFFFF; -} - -static inline unsigned long indirect() -{ - unsigned long temp=(snes_readmem(pbr|pc)+dp)&0xFFFF; pc++; - return (readmemw(temp))+dbr; -} - -static inline unsigned long indirectx() -{ - unsigned long temp=(snes_readmem(pbr|pc)+dp+x.w)&0xFFFF; pc++; - return (readmemw(temp))+dbr; -} -static inline unsigned long jindirectx() /*JSR (,x) uses PBR instead of DBR, and 2 byte address insted of 1 + dp*/ -{ - unsigned long temp=(snes_readmem(pbr|pc)+(snes_readmem((pbr|pc)+1)<<8)+x.w)+pbr; pc+=2; - return temp; -} - -static inline unsigned long indirecty() -{ - unsigned long temp=(snes_readmem(pbr|pc)+dp)&0xFFFF; pc++; - return (readmemw(temp))+y.w+dbr; -} -static inline unsigned long sindirecty() -{ - unsigned long temp=(snes_readmem(pbr|pc)+s.w)&0xFFFF; pc++; - return (readmemw(temp))+y.w+dbr; -} - -static inline unsigned long indirectl() -{ - unsigned long temp=(snes_readmem(pbr|pc)+dp)&0xFFFF; pc++; - unsigned long address=readmemw(temp)|(snes_readmem(temp+2)<<16); - return address; -} - -static inline unsigned long indirectly() -{ - unsigned long temp=(snes_readmem(pbr|pc)+dp)&0xFFFF; pc++; - unsigned long address=(readmemw(temp)|(snes_readmem(temp+2)<<16))+y.w; - return address; -} - -/*Flag setting*/ -#define setzn8(v) p.z=!(v); p.n=(v)&0x80 -#define setzn16(v) p.z=!(v); p.n=(v)&0x8000 - -/*ADC/SBC macros*/ -#define ADC8() tempw=a.b.l+temp+((p.c)?1:0); \ - p.v=(!((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ - a.b.l=tempw&0xFF; \ - setzn8(a.b.l); \ - p.c=tempw&0x100; - -#define ADC16() templ=a.w+tempw+((p.c)?1:0); \ - p.v=(!((a.w^tempw)&0x8000)&&((a.w^templ)&0x8000)); \ - a.w=templ&0xFFFF; \ - setzn16(a.w); \ - p.c=templ&0x10000; - -#define ADCBCD8() \ - tempw=(a.b.l&0xF)+(temp&0xF)+(p.c?1:0); \ - if (tempw>9) \ -{ \ - tempw+=6; \ -} \ - tempw+=((a.b.l&0xF0)+(temp&0xF0)); \ - if (tempw>0x9F) \ -{ \ - tempw+=0x60; \ -} \ - p.v=(!((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ - a.b.l=tempw&0xFF; \ - setzn8(a.b.l); \ - p.c=tempw>0xFF; \ - cycles-=6; clockspc(6); - -#define ADCBCD16() \ - templ=(a.w&0xF)+(tempw&0xF)+(p.c?1:0); \ - if (templ>9) \ -{ \ - templ+=6; \ -} \ - templ+=((a.w&0xF0)+(tempw&0xF0)); \ - if (templ>0x9F) \ -{ \ - templ+=0x60; \ -} \ - templ+=((a.w&0xF00)+(tempw&0xF00)); \ - if (templ>0x9FF) \ -{ \ - templ+=0x600; \ -} \ - templ+=((a.w&0xF000)+(tempw&0xF000)); \ - if (templ>0x9FFF) \ -{ \ - templ+=0x6000; \ -} \ - p.v=(!((a.w^tempw)&0x8000)&&((a.w^templ)&0x8000)); \ - a.w=templ&0xFFFF; \ - setzn16(a.w); \ - p.c=templ>0xFFFF; \ - cycles-=6; clockspc(6); - -#define SBC8() tempw=a.b.l-temp-((p.c)?0:1); \ - p.v=(((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ - a.b.l=tempw&0xFF; \ - setzn8(a.b.l); \ - p.c=tempw<=0xFF; - -#define SBC16() templ=a.w-tempw-((p.c)?0:1); \ - p.v=(((a.w^tempw)&(a.w^templ))&0x8000); \ - a.w=templ&0xFFFF; \ - setzn16(a.w); \ - p.c=templ<=0xFFFF; - -#define SBCBCD8() \ - tempw=(a.b.l&0xF)-(temp&0xF)-(p.c?0:1); \ - if (tempw>9) \ -{ \ - tempw-=6; \ -} \ - tempw+=((a.b.l&0xF0)-(temp&0xF0)); \ - if (tempw>0x9F) \ -{ \ - tempw-=0x60; \ -} \ - p.v=(((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ - a.b.l=tempw&0xFF; \ - setzn8(a.b.l); \ - p.c=tempw<=0xFF; \ - cycles-=6; clockspc(6); - -#define SBCBCD16() \ - templ=(a.w&0xF)-(tempw&0xF)-(p.c?0:1); \ - if (templ>9) \ -{ \ - templ-=6; \ -} \ - templ+=((a.w&0xF0)-(tempw&0xF0)); \ - if (templ>0x9F) \ -{ \ - templ-=0x60; \ -} \ - templ+=((a.w&0xF00)-(tempw&0xF00)); \ - if (templ>0x9FF) \ -{ \ - templ-=0x600; \ -} \ - templ+=((a.w&0xF000)-(tempw&0xF000)); \ - if (templ>0x9FFF) \ -{ \ - templ-=0x6000; \ -} \ - p.v=(((a.w^tempw)&0x8000)&&((a.w^templ)&0x8000)); \ - a.w=templ&0xFFFF; \ - setzn16(a.w); \ - p.c=templ<=0xFFFF; \ - cycles-=6; clockspc(6); - -/*Instructions*/ -static inline void inca8() -{ - snes_readmem(pbr|pc); - a.b.l++; - setzn8(a.b.l); -} -static inline void inca16() -{ - snes_readmem(pbr|pc); - a.w++; - setzn16(a.w); -} -static inline void inx8() -{ - snes_readmem(pbr|pc); - x.b.l++; - setzn8(x.b.l); -} -static inline void inx16() -{ - snes_readmem(pbr|pc); - x.w++; - setzn16(x.w); -} -static inline void iny8() -{ - snes_readmem(pbr|pc); - y.b.l++; - setzn8(y.b.l); -} -static inline void iny16() -{ - snes_readmem(pbr|pc); - y.w++; - setzn16(y.w); -} - -static inline void deca8() -{ - snes_readmem(pbr|pc); - a.b.l--; - setzn8(a.b.l); -} -static inline void deca16() -{ - snes_readmem(pbr|pc); - a.w--; - setzn16(a.w); -} -static inline void dex8() -{ - snes_readmem(pbr|pc); - x.b.l--; - setzn8(x.b.l); -} -static inline void dex16() -{ - snes_readmem(pbr|pc); - x.w--; - setzn16(x.w); -} -static inline void dey8() -{ - snes_readmem(pbr|pc); - y.b.l--; - setzn8(y.b.l); -} -static inline void dey16() -{ - snes_readmem(pbr|pc); - y.w--; - setzn16(y.w); -} - -/*INC group*/ -static inline void incZp8() -{ - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - temp++; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void incZp16() -{ - unsigned short temp; - addr=zeropage(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - temp++; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void incZpx8() -{ - unsigned char temp; - addr=zeropagex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - temp++; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void incZpx16() -{ - unsigned short temp; - addr=zeropagex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - temp++; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void incAbs8() -{ - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - temp++; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void incAbs16() -{ - unsigned short temp; - addr=absolute(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - temp++; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void incAbsx8() -{ - unsigned char temp; - addr=absolutex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - temp++; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void incAbsx16() -{ - unsigned short temp; - addr=absolutex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - temp++; - setzn16(temp); - writememw2(addr,temp); -} - -/*DEC group*/ -static inline void decZp8() -{ - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - temp--; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void decZp16() -{ - unsigned short temp; - addr=zeropage(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - temp--; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void decZpx8() -{ - unsigned char temp; - addr=zeropagex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - temp--; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void decZpx16() -{ - unsigned short temp; - addr=zeropagex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - temp--; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void decAbs8() -{ - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - temp--; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void decAbs16() -{ - unsigned short temp; - addr=absolute(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - temp--; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void decAbsx8() -{ - unsigned char temp; - addr=absolutex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - temp--; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void decAbsx16() -{ - unsigned short temp; - addr=absolutex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - temp--; - setzn16(temp); - writememw2(addr,temp); -} - -/*Flag group*/ -static inline void clc() -{ - snes_readmem(pbr|pc); - p.c=0; -} -static inline void cld() -{ - snes_readmem(pbr|pc); - p.d=0; -} -static inline void cli() -{ - snes_readmem(pbr|pc); - p.i=0; -} -static inline void clv() -{ - snes_readmem(pbr|pc); - p.v=0; -} - -static inline void sec() -{ - snes_readmem(pbr|pc); - p.c=1; -} -static inline void sed() -{ - snes_readmem(pbr|pc); - p.d=1; -} -static inline void sei() -{ - snes_readmem(pbr|pc); - p.i=1; -} - -static inline void xce() -{ - int temp=p.c; - p.c=p.e; - p.e=temp; - snes_readmem(pbr|pc); - updatecpumode(); -} - -static inline void sep() -{ - unsigned char temp=snes_readmem(pbr|pc); pc++; - if (temp&1) p.c=1; - if (temp&2) p.z=1; - if (temp&4) p.i=1; - if (temp&8) p.d=1; - if (temp&0x40) p.v=1; - if (temp&0x80) p.n=1; - if (!p.e) - { - if (temp&0x10) p.x=1; - if (temp&0x20) p.m=1; - updatecpumode(); - } -} - -static inline void rep() -{ - unsigned char temp=snes_readmem(pbr|pc); pc++; - if (temp&1) p.c=0; - if (temp&2) p.z=0; - if (temp&4) p.i=0; - if (temp&8) p.d=0; - if (temp&0x40) p.v=0; - if (temp&0x80) p.n=0; - if (!p.e) - { - if (temp&0x10) p.x=0; - if (temp&0x20) p.m=0; - updatecpumode(); - } -} - -/*Transfer group*/ -static inline void tax8() -{ - snes_readmem(pbr|pc); - x.b.l=a.b.l; - setzn8(x.b.l); -} -static inline void tay8() -{ - snes_readmem(pbr|pc); - y.b.l=a.b.l; - setzn8(y.b.l); -} -static inline void txa8() -{ - snes_readmem(pbr|pc); - a.b.l=x.b.l; - setzn8(a.b.l); -} -static inline void tya8() -{ - snes_readmem(pbr|pc); - a.b.l=y.b.l; - setzn8(a.b.l); -} -static inline void tsx8() -{ - snes_readmem(pbr|pc); - x.b.l=s.b.l; - setzn8(x.b.l); -} -static inline void txs8() -{ - snes_readmem(pbr|pc); - s.b.l=x.b.l; - // setzn8(s.b.l); -} -static inline void txy8() -{ - snes_readmem(pbr|pc); - y.b.l=x.b.l; - setzn8(y.b.l); -} -static inline void tyx8() -{ - snes_readmem(pbr|pc); - x.b.l=y.b.l; - setzn8(x.b.l); -} - -static inline void tax16() -{ - snes_readmem(pbr|pc); - x.w=a.w; - setzn16(x.w); -} -static inline void tay16() -{ - snes_readmem(pbr|pc); - y.w=a.w; - setzn16(y.w); -} -static inline void txa16() -{ - snes_readmem(pbr|pc); - a.w=x.w; - setzn16(a.w); -} -static inline void tya16() -{ - snes_readmem(pbr|pc); - a.w=y.w; - setzn16(a.w); -} -static inline void tsx16() -{ - snes_readmem(pbr|pc); - x.w=s.w; - setzn16(x.w); -} -static inline void txs16() -{ - snes_readmem(pbr|pc); - s.w=x.w; - // setzn16(s.w); -} -static inline void txy16() -{ - snes_readmem(pbr|pc); - y.w=x.w; - setzn16(y.w); -} -static inline void tyx16() -{ - snes_readmem(pbr|pc); - x.w=y.w; - setzn16(x.w); -} - -/*LDX group*/ -static inline void ldxImm8() -{ - x.b.l=snes_readmem(pbr|pc); pc++; - setzn8(x.b.l); -} - -static inline void ldxZp8() -{ - addr=zeropage(); - x.b.l=snes_readmem(addr); - setzn8(x.b.l); -} - -static inline void ldxZpy8() -{ - addr=zeropagey(); - x.b.l=snes_readmem(addr); - setzn8(x.b.l); -} - -static inline void ldxAbs8() -{ - addr=absolute(); - x.b.l=snes_readmem(addr); - setzn8(x.b.l); -} -static inline void ldxAbsy8() -{ - addr=absolutey(); - x.b.l=snes_readmem(addr); - setzn8(x.b.l); -} - -static inline void ldxImm16() -{ - x.w=readmemw(pbr|pc); pc+=2; - setzn16(x.w); -} -static inline void ldxZp16() -{ - addr=zeropage(); - x.w=readmemw(addr); - setzn16(x.w); -} -static inline void ldxZpy16() -{ - addr=zeropagey(); - x.w=readmemw(addr); - setzn16(x.w); -} -static inline void ldxAbs16() -{ - addr=absolute(); - x.w=readmemw(addr); - setzn16(x.w); -} -static inline void ldxAbsy16() -{ - addr=absolutey(); - x.w=readmemw(addr); - setzn16(x.w); -} - -/*LDY group*/ -static inline void ldyImm8() -{ - y.b.l=snes_readmem(pbr|pc); pc++; - setzn8(y.b.l); -} -static inline void ldyZp8() -{ - addr=zeropage(); - y.b.l=snes_readmem(addr); - setzn8(y.b.l); -} -static inline void ldyZpx8() -{ - addr=zeropagex(); - y.b.l=snes_readmem(addr); - setzn8(y.b.l); -} -static inline void ldyAbs8() -{ - addr=absolute(); - y.b.l=snes_readmem(addr); - setzn8(y.b.l); -} -static inline void ldyAbsx8() -{ - addr=absolutex(); - y.b.l=snes_readmem(addr); - setzn8(y.b.l); -} - -static inline void ldyImm16() -{ - y.w=readmemw(pbr|pc); - pc+=2; - setzn16(y.w); -} -static inline void ldyZp16() -{ - addr=zeropage(); - y.w=readmemw(addr); - setzn16(y.w); -} -static inline void ldyZpx16() -{ - addr=zeropagex(); - y.w=readmemw(addr); - setzn16(y.w); -} -static inline void ldyAbs16() -{ - addr=absolute(); - y.w=readmemw(addr); - setzn16(y.w); -} -static inline void ldyAbsx16() -{ - addr=absolutex(); - y.w=readmemw(addr); - setzn16(y.w); -} - -/*LDA group*/ -static inline void ldaImm8() -{ - a.b.l=snes_readmem(pbr|pc); pc++; - setzn8(a.b.l); -} -static inline void ldaZp8() -{ - addr=zeropage(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaZpx8() -{ - addr=zeropagex(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaSp8() -{ - addr=stack(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaSIndirecty8() -{ - addr=sindirecty(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaAbs8() -{ - addr=absolute(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaAbsx8() -{ - addr=absolutex(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaAbsy8() -{ - addr=absolutey(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaLong8() -{ - addr=absolutelong(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaLongx8() -{ - addr=absolutelongx(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaIndirect8() -{ - addr=indirect(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaIndirectx8() -{ - addr=indirectx(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaIndirecty8() -{ - addr=indirecty(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaIndirectLong8() -{ - addr=indirectl(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void ldaIndirectLongy8() -{ - addr=indirectly(); - a.b.l=snes_readmem(addr); - setzn8(a.b.l); -} - -static inline void ldaImm16() -{ - a.w=readmemw(pbr|pc); pc+=2; - setzn16(a.w); -} -static inline void ldaZp16() -{ - addr=zeropage(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaZpx16() -{ - addr=zeropagex(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaSp16() -{ - addr=stack(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaSIndirecty16() -{ - addr=sindirecty(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaAbs16() -{ - addr=absolute(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaAbsx16() -{ - addr=absolutex(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaAbsy16() -{ - addr=absolutey(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaLong16() -{ - addr=absolutelong(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaLongx16() -{ - addr=absolutelongx(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaIndirect16() -{ - addr=indirect(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaIndirectx16() -{ - addr=indirectx(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaIndirecty16() -{ - addr=indirecty(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaIndirectLong16() -{ - addr=indirectl(); - a.w=readmemw(addr); - setzn16(a.w); -} -static inline void ldaIndirectLongy16() -{ - addr=indirectly(); - a.w=readmemw(addr); - setzn16(a.w); -} - -/*STA group*/ -static inline void staZp8() -{ - addr=zeropage(); - snes_writemem(addr,a.b.l); -} -static inline void staZpx8() -{ - addr=zeropagex(); - snes_writemem(addr,a.b.l); -} -static inline void staAbs8() -{ - addr=absolute(); - snes_writemem(addr,a.b.l); -} -static inline void staAbsx8() -{ - addr=absolutex(); - snes_writemem(addr,a.b.l); -} -static inline void staAbsy8() -{ - addr=absolutey(); - snes_writemem(addr,a.b.l); -} -static inline void staLong8() -{ - addr=absolutelong(); - snes_writemem(addr,a.b.l); -} -static inline void staLongx8() -{ - addr=absolutelongx(); - snes_writemem(addr,a.b.l); -} -static inline void staIndirect8() -{ - addr=indirect(); - snes_writemem(addr,a.b.l); -} -static inline void staIndirectx8() -{ - addr=indirectx(); - snes_writemem(addr,a.b.l); -} -static inline void staIndirecty8() -{ - addr=indirecty(); - snes_writemem(addr,a.b.l); -} -static inline void staIndirectLong8() -{ - addr=indirectl(); - snes_writemem(addr,a.b.l); -} -static inline void staIndirectLongy8() -{ - addr=indirectly(); - snes_writemem(addr,a.b.l); -} -static inline void staSp8() -{ - addr=stack(); - snes_writemem(addr,a.b.l); -} -static inline void staSIndirecty8() -{ - addr=sindirecty(); - snes_writemem(addr,a.b.l); -} - -static inline void staZp16() -{ - addr=zeropage(); - writememw(addr,a.w); -} -static inline void staZpx16() -{ - addr=zeropagex(); - writememw(addr,a.w); -} -static inline void staAbs16() -{ - addr=absolute(); - writememw(addr,a.w); -} -static inline void staAbsx16() -{ - addr=absolutex(); - writememw(addr,a.w); -} -static inline void staAbsy16() -{ - addr=absolutey(); - writememw(addr,a.w); -} -static inline void staLong16() -{ - addr=absolutelong(); - writememw(addr,a.w); -} -static inline void staLongx16() -{ - addr=absolutelongx(); - writememw(addr,a.w); -} -static inline void staIndirect16() -{ - addr=indirect(); - writememw(addr,a.w); -} -static inline void staIndirectx16() -{ - addr=indirectx(); - writememw(addr,a.w); -} -static inline void staIndirecty16() -{ - addr=indirecty(); - writememw(addr,a.w); -} -static inline void staIndirectLong16() -{ - addr=indirectl(); - writememw(addr,a.w); -} -static inline void staIndirectLongy16() -{ - addr=indirectly(); - writememw(addr,a.w); -} -static inline void staSp16() -{ - addr=stack(); - writememw(addr,a.w); -} -static inline void staSIndirecty16() -{ - addr=sindirecty(); - writememw(addr,a.w); -} - -/*STX group*/ -static inline void stxZp8() -{ - addr=zeropage(); - snes_writemem(addr,x.b.l); -} -static inline void stxZpy8() -{ - addr=zeropagey(); - snes_writemem(addr,x.b.l); -} -static inline void stxAbs8() -{ - addr=absolute(); - snes_writemem(addr,x.b.l); -} - -static inline void stxZp16() -{ - addr=zeropage(); - writememw(addr,x.w); -} -static inline void stxZpy16() -{ - addr=zeropagey(); - writememw(addr,x.w); -} -static inline void stxAbs16() -{ - addr=absolute(); - writememw(addr,x.w); -} - -/*STY group*/ -static inline void styZp8() -{ - addr=zeropage(); - snes_writemem(addr,y.b.l); -} -static inline void styZpx8() -{ - addr=zeropagex(); - snes_writemem(addr,y.b.l); -} -static inline void styAbs8() -{ - addr=absolute(); - snes_writemem(addr,y.b.l); -} - -static inline void styZp16() -{ - addr=zeropage(); - writememw(addr,y.w); -} -static inline void styZpx16() -{ - addr=zeropagex(); - writememw(addr,y.w); -} -static inline void styAbs16() -{ - addr=absolute(); - writememw(addr,y.w); -} - -/*STZ group*/ -static inline void stzZp8() -{ - addr=zeropage(); - snes_writemem(addr,0); -} -static inline void stzZpx8() -{ - addr=zeropagex(); - snes_writemem(addr,0); -} -static inline void stzAbs8() -{ - addr=absolute(); - snes_writemem(addr,0); -} -static inline void stzAbsx8() -{ - addr=absolutex(); - snes_writemem(addr,0); -} - -static inline void stzZp16() -{ - addr=zeropage(); - writememw(addr,0); -} -static inline void stzZpx16() -{ - addr=zeropagex(); - writememw(addr,0); -} -static inline void stzAbs16() -{ - addr=absolute(); - writememw(addr,0); -} -static inline void stzAbsx16() -{ - addr=absolutex(); - writememw(addr,0); -} - -/*ADC group*/ -static inline void adcImm8() -{ - unsigned short tempw; - unsigned char temp=snes_readmem(pbr|pc); pc++; - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcZp8() -{ - unsigned short tempw; - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcZpx8() -{ - unsigned short tempw; - unsigned char temp; - addr=zeropagex(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcSp8() -{ - unsigned short tempw; - unsigned char temp; - addr=stack(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcAbs8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcAbsx8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolutex(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcAbsy8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolutey(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcLong8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolutelong(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcLongx8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolutelongx(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcIndirect8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirect(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcIndirectx8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirectx(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcIndirecty8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirecty(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcsIndirecty8() -{ - unsigned short tempw; - unsigned char temp; - addr=sindirecty(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcIndirectLong8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirectl(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static inline void adcIndirectLongy8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirectly(); - temp=snes_readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} - -static inline void adcImm16() -{ - unsigned long templ; - unsigned short tempw; - tempw=readmemw(pbr|pc); pc+=2; - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcZp16() -{ - unsigned long templ; - unsigned short tempw; - addr=zeropage(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcZpx16() -{ - unsigned long templ; - unsigned short tempw; - addr=zeropagex(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcSp16() -{ - unsigned long templ; - unsigned short tempw; - addr=stack(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcAbs16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolute(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcAbsx16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolutex(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcAbsy16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolutey(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcLong16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolutelong(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcLongx16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolutelongx(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcIndirect16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirect(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcIndirectx16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirectx(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcIndirecty16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirecty(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcsIndirecty16() -{ - unsigned long templ; - unsigned short tempw; - addr=sindirecty(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcIndirectLong16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirectl(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static inline void adcIndirectLongy16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirectly(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} - -/*SBC group*/ -static inline void sbcImm8() -{ - unsigned short tempw; - unsigned char temp=snes_readmem(pbr|pc); pc++; - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcZp8() -{ - unsigned short tempw; - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcZpx8() -{ - unsigned short tempw; - unsigned char temp; - addr=zeropagex(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcSp8() -{ - unsigned short tempw; - unsigned char temp; - addr=stack(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcAbs8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcAbsx8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolutex(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcAbsy8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolutey(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcLong8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolutelong(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcLongx8() -{ - unsigned short tempw; - unsigned char temp; - addr=absolutelongx(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcIndirect8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirect(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcIndirectx8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirectx(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcIndirecty8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirecty(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcIndirectLong8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirectl(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static inline void sbcIndirectLongy8() -{ - unsigned short tempw; - unsigned char temp; - addr=indirectly(); - temp=snes_readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} - -static inline void sbcImm16() -{ - unsigned long templ; - unsigned short tempw; - tempw=readmemw(pbr|pc); pc+=2; - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcZp16() -{ - unsigned long templ; - unsigned short tempw; - addr=zeropage(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcZpx16() -{ - unsigned long templ; - unsigned short tempw; - addr=zeropagex(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcSp16() -{ - unsigned long templ; - unsigned short tempw; - addr=stack(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcAbs16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolute(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcAbsx16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolutex(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcAbsy16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolutey(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcLong16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolutelong(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcLongx16() -{ - unsigned long templ; - unsigned short tempw; - addr=absolutelongx(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcIndirect16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirect(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcIndirectx16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirectx(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcIndirecty16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirecty(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcIndirectLong16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirectl(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static inline void sbcIndirectLongy16() -{ - unsigned long templ; - unsigned short tempw; - addr=indirectly(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} - -/*EOR group*/ -static inline void eorImm8() -{ - a.b.l^=snes_readmem(pbr|pc); pc++; - setzn8(a.b.l); -} -static inline void eorZp8() -{ - addr=zeropage(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void eorZpx8() -{ - addr=zeropagex(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void eorSp8() -{ - addr=stack(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void eorAbs8() -{ - addr=absolute(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void eorAbsx8() -{ - addr=absolutex(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void eorAbsy8() -{ - addr=absolutey(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void eorLong8() -{ - addr=absolutelong(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void eorLongx8() -{ - addr=absolutelongx(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void eorIndirect8() -{ - addr=indirect(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void eorIndirectx8() -{ - addr=indirectx(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} - -static inline void eorIndirecty8() -{ - addr=indirecty(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} - -static inline void eorIndirectLong8() -{ - addr=indirectl(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} - -static inline void eorIndirectLongy8() -{ - addr=indirectly(); - a.b.l^=snes_readmem(addr); - setzn8(a.b.l); -} - -static inline void eorImm16() -{ - a.w^=readmemw(pbr|pc); pc+=2; - setzn16(a.w); -} - -static inline void eorZp16() -{ - addr=zeropage(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorZpx16() -{ - addr=zeropagex(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorSp16() -{ - addr=stack(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorAbs16() -{ - addr=absolute(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorAbsx16() -{ - addr=absolutex(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorAbsy16() -{ - addr=absolutey(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorLong16() -{ - addr=absolutelong(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorLongx16() -{ - addr=absolutelongx(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorIndirect16() -{ - addr=indirect(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static inline void eorIndirectx16() -{ - addr=indirectx(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorIndirecty16() -{ - addr=indirecty(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorIndirectLong16() -{ - addr=indirectl(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -static inline void eorIndirectLongy16() -{ - addr=indirectly(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -/*AND group*/ -static inline void andImm8() -{ - a.b.l&=snes_readmem(pbr|pc); pc++; - setzn8(a.b.l); -} -static inline void andZp8() -{ - addr=zeropage(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andZpx8() -{ - addr=zeropagex(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} - -static inline void andSp8() -{ - addr=stack(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andAbs8() -{ - addr=absolute(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andAbsx8() -{ - addr=absolutex(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andAbsy8() -{ - addr=absolutey(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andLong8() -{ - addr=absolutelong(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andLongx8() -{ - addr=absolutelongx(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andIndirect8() -{ - addr=indirect(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andIndirectx8() -{ - addr=indirectx(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andIndirecty8() -{ - addr=indirecty(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andIndirectLong8() -{ - addr=indirectl(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void andIndirectLongy8() -{ - addr=indirectly(); - a.b.l&=snes_readmem(addr); - setzn8(a.b.l); -} - -static inline void andImm16() -{ - a.w&=readmemw(pbr|pc); pc+=2; - setzn16(a.w); -} -static inline void andZp16() -{ - addr=zeropage(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andZpx16() -{ - addr=zeropagex(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andSp16() -{ - addr=stack(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andAbs16() -{ - addr=absolute(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andAbsx16() -{ - addr=absolutex(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andAbsy16() -{ - addr=absolutey(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andLong16() -{ - addr=absolutelong(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andLongx16() -{ - addr=absolutelongx(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andIndirect16() -{ - addr=indirect(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andIndirectx16() -{ - addr=indirectx(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andIndirecty16() -{ - addr=indirecty(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andIndirectLong16() -{ - addr=indirectl(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static inline void andIndirectLongy16() -{ - addr=indirectly(); - a.w&=readmemw(addr); - setzn16(a.w); -} - -/*ORA group*/ -static inline void oraImm8() -{ - a.b.l|=snes_readmem(pbr|pc); pc++; - setzn8(a.b.l); -} -static inline void oraZp8() -{ - addr=zeropage(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraZpx8() -{ - addr=zeropagex(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraSp8() -{ - addr=stack(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraAbs8() -{ - addr=absolute(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraAbsx8() -{ - addr=absolutex(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraAbsy8() -{ - addr=absolutey(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraLong8() -{ - addr=absolutelong(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraLongx8() -{ - addr=absolutelongx(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraIndirect8() -{ - addr=indirect(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraIndirectx8() -{ - addr=indirectx(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraIndirecty8() -{ - addr=indirecty(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraIndirectLong8() -{ - addr=indirectl(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} -static inline void oraIndirectLongy8() -{ - addr=indirectly(); - a.b.l|=snes_readmem(addr); - setzn8(a.b.l); -} - -static inline void oraImm16() -{ - a.w|=readmemw(pbr|pc); pc+=2; - setzn16(a.w); -} -static inline void oraZp16() -{ - addr=zeropage(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraZpx16() -{ - addr=zeropagex(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraSp16() -{ - addr=stack(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraAbs16() -{ - addr=absolute(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraAbsx16() -{ - addr=absolutex(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraAbsy16() -{ - addr=absolutey(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraLong16() -{ - addr=absolutelong(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraLongx16() -{ - addr=absolutelongx(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraIndirect16() -{ - addr=indirect(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraIndirectx16() -{ - addr=indirectx(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraIndirecty16() -{ - addr=indirecty(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraIndirectLong16() -{ - addr=indirectl(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static inline void oraIndirectLongy16() -{ - addr=indirectly(); - a.w|=readmemw(addr); - setzn16(a.w); -} - -/*BIT group*/ -static inline void bitImm8() -{ - unsigned char temp=snes_readmem(pbr|pc); pc++; - p.z=!(temp&a.b.l); -} -static inline void bitImm16() -{ - unsigned short temp=readmemw(pbr|pc); pc+=2; - p.z=!(temp&a.w); - setzf=0; -} - -static inline void bitZp8() -{ - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - p.z=!(temp&a.b.l); - p.v=temp&0x40; - p.n=temp&0x80; -} -static inline void bitZp16() -{ - unsigned short temp; - addr=zeropage(); - temp=readmemw(addr); - p.z=!(temp&a.w); - p.v=temp&0x4000; - p.n=temp&0x8000; -} - -static inline void bitZpx8() -{ - unsigned char temp; - addr=zeropagex(); - temp=snes_readmem(addr); - p.z=!(temp&a.b.l); - p.v=temp&0x40; - p.n=temp&0x80; -} -static inline void bitZpx16() -{ - unsigned short temp; - addr=zeropagex(); - temp=readmemw(addr); - p.z=!(temp&a.w); - p.v=temp&0x4000; - p.n=temp&0x8000; -} - -static inline void bitAbs8() -{ - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - p.z=!(temp&a.b.l); - p.v=temp&0x40; - p.n=temp&0x80; -} -static inline void bitAbs16() -{ - unsigned short temp; - addr=absolute(); - temp=readmemw(addr); - p.z=!(temp&a.w); - p.v=temp&0x4000; - p.n=temp&0x8000; -} - -static inline void bitAbsx8() -{ - unsigned char temp; - addr=absolutex(); - temp=snes_readmem(addr); - p.z=!(temp&a.b.l); - p.v=temp&0x40; - p.n=temp&0x80; -} -static inline void bitAbsx16() -{ - unsigned short temp; - addr=absolutex(); - temp=readmemw(addr); - p.z=!(temp&a.w); - p.v=temp&0x4000; - p.n=temp&0x8000; -} - -/*CMP group*/ -static inline void cmpImm8() -{ - unsigned char temp; - temp=snes_readmem(pbr|pc); pc++; - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpZp8() -{ - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpZpx8() -{ - unsigned char temp; - addr=zeropagex(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpSp8() -{ - unsigned char temp; - addr=stack(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpAbs8() -{ - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpAbsx8() -{ - unsigned char temp; - addr=absolutex(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpAbsy8() -{ - unsigned char temp; - addr=absolutey(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpLong8() -{ - unsigned char temp; - addr=absolutelong(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpLongx8() -{ - unsigned char temp; - addr=absolutelongx(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpIndirect8() -{ - unsigned char temp; - addr=indirect(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpIndirectx8() -{ - unsigned char temp; - addr=indirectx(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpIndirecty8() -{ - unsigned char temp; - addr=indirecty(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpIndirectLong8() -{ - unsigned char temp; - addr=indirectl(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static inline void cmpIndirectLongy8() -{ - unsigned char temp; - addr=indirectly(); - temp=snes_readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} - -static inline void cmpImm16() -{ - unsigned short temp; - temp=readmemw(pbr|pc); pc+=2; - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpZp16() -{ - unsigned short temp; - addr=zeropage(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpSp16() -{ - unsigned short temp; - addr=stack(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpZpx16() -{ - unsigned short temp; - addr=zeropagex(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpAbs16() -{ - unsigned short temp; - addr=absolute(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpAbsx16() -{ - unsigned short temp; - addr=absolutex(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpAbsy16() -{ - unsigned short temp; - addr=absolutey(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpLong16() -{ - unsigned short temp; - addr=absolutelong(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpLongx16() -{ - unsigned short temp; - addr=absolutelongx(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpIndirect16() -{ - unsigned short temp; - addr=indirect(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpIndirectx16() -{ - unsigned short temp; - addr=indirectx(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpIndirecty16() -{ - unsigned short temp; - addr=indirecty(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpIndirectLong16() -{ - unsigned short temp; - addr=indirectl(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static inline void cmpIndirectLongy16() -{ - unsigned short temp; - addr=indirectly(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} - -/*Stack Group*/ -static inline void phb() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,dbr>>16); - s.w--; -} -static inline void phbe() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,dbr>>16); - s.b.l--; -} - -static inline void phk() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,pbr>>16); - s.w--; -} -static inline void phke() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,pbr>>16); - s.b.l--; -} - -static inline void pea() -{ - addr=readmemw(pbr|pc); pc+=2; - snes_writemem(s.w,addr>>8); - s.w--; - snes_writemem(s.w,addr&0xFF); - s.w--; -} - -static inline void pei() -{ - addr=indirect(); - snes_writemem(s.w,addr>>8); - s.w--; - snes_writemem(s.w,addr&0xFF); - s.w--; -} - -static inline void per() -{ - addr=readmemw(pbr|pc); pc+=2; - addr+=pc; - snes_writemem(s.w,addr>>8); - s.w--; - snes_writemem(s.w,addr&0xFF); - s.w--; -} - -static inline void phd() -{ - snes_writemem(s.w,dp>>8); - s.w--; - snes_writemem(s.w,dp&0xFF); - s.w--; -} -static inline void pld() -{ - snes_readmem(pbr|pc); - s.w++; - cycles-=6; - clockspc(6); - dp=snes_readmem(s.w); - s.w++; - dp|=(snes_readmem(s.w)<<8); -} - -static inline void pha8() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,a.b.l); - s.w--; -} -static inline void pha16() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,a.b.h); - s.w--; - snes_writemem(s.w,a.b.l); - s.w--; -} - -static inline void phx8() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,x.b.l); - s.w--; -} -static inline void phx16() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,x.b.h); - s.w--; - snes_writemem(s.w,x.b.l); - s.w--; -} - -static inline void phy8() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,y.b.l); - s.w--; -} -static inline void phy16() -{ - snes_readmem(pbr|pc); - snes_writemem(s.w,y.b.h); - s.w--; - snes_writemem(s.w,y.b.l); - s.w--; -} - -static inline void pla8() -{ - snes_readmem(pbr|pc); - s.w++; - cycles-=6; - clockspc(6); - a.b.l=snes_readmem(s.w); - setzn8(a.b.l); -} -static inline void pla16() -{ - snes_readmem(pbr|pc); - s.w++; cycles-=6; - clockspc(6); - a.b.l=snes_readmem(s.w); - s.w++; - a.b.h=snes_readmem(s.w); - setzn16(a.w); -} - -static inline void plx8() -{ - snes_readmem(pbr|pc); - s.w++; - cycles-=6; - clockspc(6); - x.b.l=snes_readmem(s.w); - setzn8(x.b.l); -} -static inline void plx16() -{ - snes_readmem(pbr|pc); - s.w++; cycles-=6; - clockspc(6); - x.b.l=snes_readmem(s.w); - s.w++; - x.b.h=snes_readmem(s.w); - setzn16(x.w); -} - -static inline void ply8() -{ - snes_readmem(pbr|pc); - s.w++; - cycles-=6; - clockspc(6); - y.b.l=snes_readmem(s.w); - setzn8(y.b.l); -} -static inline void ply16() -{ - snes_readmem(pbr|pc); - s.w++; - cycles-=6; - clockspc(6); - y.b.l=snes_readmem(s.w); - s.w++; y.b.h=snes_readmem(s.w); - setzn16(y.w); -} - -static inline void plb() -{ - snes_readmem(pbr|pc); - s.w++; - cycles-=6; - clockspc(6); - dbr=snes_readmem(s.w)<<16; -} -static inline void plbe() -{ - snes_readmem(pbr|pc); - s.b.l++; - cycles-=6; - clockspc(6); - dbr=snes_readmem(s.w)<<16; -} - -static inline void plp() -{ - unsigned char temp=snes_readmem(s.w+1); s.w++; - p.c=temp&1; - p.z=temp&2; - p.i=temp&4; - p.d=temp&8; - p.x=temp&0x10; - p.m=temp&0x20; - p.v=temp&0x40; - p.n=temp&0x80; - cycles-=12; - clockspc(12); - updatecpumode(); -} -static inline void plpe() -{ - unsigned char temp; - s.b.l++; temp=snes_readmem(s.w); - p.c=temp&1; - p.z=temp&2; - p.i=temp&4; - p.d=temp&8; - p.v=temp&0x40; - p.n=temp&0x80; - cycles-=12; - clockspc(12); -} - -static inline void php() -{ - unsigned char temp=(p.c)?1:0; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - if (p.x) temp|=0x10; - if (p.m) temp|=0x20; - snes_readmem(pbr|pc); - snes_writemem(s.w,temp); s.w--; -} -static inline void phpe() -{ - unsigned char temp=(p.c)?1:0; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - temp|=0x30; - snes_readmem(pbr|pc); - snes_writemem(s.w,temp); - s.b.l--; -} - -/*CPX group*/ -static inline void cpxImm8() -{ - unsigned char temp=snes_readmem(pbr|pc); pc++; - setzn8(x.b.l-temp); - p.c=(x.b.l>=temp); -} - -static inline void cpxImm16() -{ - unsigned short temp=readmemw(pbr|pc); pc+=2; - setzn16(x.w-temp); - p.c=(x.w>=temp); -} - -static inline void cpxZp8() -{ - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - setzn8(x.b.l-temp); - p.c=(x.b.l>=temp); -} -static inline void cpxZp16() -{ - unsigned short temp; - addr=zeropage(); - temp=readmemw(addr); - setzn16(x.w-temp); - p.c=(x.w>=temp); -} - -static inline void cpxAbs8() -{ - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - setzn8(x.b.l-temp); - p.c=(x.b.l>=temp); -} -static inline void cpxAbs16() -{ - unsigned short temp; - addr=absolute(); - temp=readmemw(addr); - setzn16(x.w-temp); - p.c=(x.w>=temp); -} - -/*CPY group*/ -static inline void cpyImm8() -{ - unsigned char temp=snes_readmem(pbr|pc); pc++; - setzn8(y.b.l-temp); - p.c=(y.b.l>=temp); -} -static inline void cpyImm16() -{ - unsigned short temp=readmemw(pbr|pc); pc+=2; - setzn16(y.w-temp); - p.c=(y.w>=temp); -} - -static inline void cpyZp8() -{ - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - setzn8(y.b.l-temp); - p.c=(y.b.l>=temp); -} -static inline void cpyZp16() -{ - unsigned short temp; - addr=zeropage(); - temp=readmemw(addr); - setzn16(y.w-temp); - p.c=(y.w>=temp); -} - -static inline void cpyAbs8() -{ - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - setzn8(y.b.l-temp); - p.c=(y.b.l>=temp); -} - -static inline void cpyAbs16() -{ - unsigned short temp; - addr=absolute(); - temp=readmemw(addr); - setzn16(y.w-temp); - p.c=(y.w>=temp); -} - -/*Branch group*/ -static inline void bcc() -{ - signed char temp=(signed char)snes_readmem(pbr|pc); pc++; - if (!p.c) - { - pc+=temp; - cycles-=6; - clockspc(6); - } -} - -static inline void bcs() -{ - signed char temp=(signed char)snes_readmem(pbr|pc); pc++; - if (p.c) - { - pc+=temp; - cycles-=6; - clockspc(6); - } -} - -static inline void beq() -{ - signed char temp=(signed char)snes_readmem(pbr|pc); pc++; - if (setzf>0) - { - p.z=0; - } - if (setzf<0) - { - p.z=1; - } - setzf=0; - if (p.z) - { - pc+=temp; - cycles-=6; - clockspc(6); - } -} - -static inline void bne() -{ - signed char temp=(signed char)snes_readmem(pbr|pc); pc++; - if (setzf>0) - { - p.z=1; - } - if (setzf<0) - { - p.z=0; - } - setzf=0; - if (!p.z) - { - pc+=temp; - cycles-=6; clockspc(6); - } - skipz=0; -} - -static inline void bpl() -{ - signed char temp=(signed char)snes_readmem(pbr|pc); pc++; - if (!p.n) - { - pc+=temp; - cycles-=6; clockspc(6); - } -} - -static inline void bmi() -{ - signed char temp=(signed char)snes_readmem(pbr|pc); pc++; - if (p.n) - { - pc+=temp; - cycles-=6; clockspc(6); - } -} - -static inline void bvc() -{ - signed char temp=(signed char)snes_readmem(pbr|pc); pc++; - if (!p.v) - { - pc+=temp; - cycles-=6; clockspc(6); - } -} - -static inline void bvs() -{ - signed char temp=(signed char)snes_readmem(pbr|pc); pc++; - if (p.v) - { - pc+=temp; - cycles-=6; clockspc(6); - } -} - -static inline void bra() -{ - signed char temp=(signed char)snes_readmem(pbr|pc); pc++; - pc+=temp; - cycles-=6; clockspc(6); -} - -static inline void brl() -{ - unsigned short temp=readmemw(pbr|pc); pc+=2; - pc+=temp; - cycles-=6; clockspc(6); -} - -/*Jump group*/ -static inline void jmp() -{ - addr=readmemw(pbr|pc); - pc=addr&0xFFFF; -} - -static inline void jmplong() -{ - addr=readmemw(pbr|pc)|(snes_readmem((pbr|pc)+2)<<16); - pc=addr&0xFFFF; - pbr=addr&0xFF0000; -} - -static inline void jmpind() -{ - addr=readmemw(pbr|pc); - pc=readmemw(addr); -} - -static inline void jmpindx() -{ - addr=(readmemw(pbr|pc))+x.w+pbr; - pc=readmemw(addr); -} - -static inline void jmlind() -{ - addr=readmemw(pbr|pc); - pc=readmemw(addr); - pbr=snes_readmem(addr+2)<<16; -} - -static inline void jsr() -{ - addr=readmemw(pbr|pc); pc++; - snes_readmem(pbr|pc); - snes_writemem(s.w,pc>>8); s.w--; - snes_writemem(s.w,pc&0xFF); s.w--; - pc=addr&0xFFFF; -} - -static inline void jsre() -{ - addr=readmemw(pbr|pc); pc++; - snes_readmem(pbr|pc); - snes_writemem(s.w,pc>>8); s.b.l--; - snes_writemem(s.w,pc&0xFF); s.b.l--; - pc=addr&0xFFFF; -} - -static inline void jsrIndx() -{ - addr=jindirectx(); pc--; - snes_writemem(s.w,pc>>8); s.w--; - snes_writemem(s.w,pc&0xFF); s.w--; - pc=readmemw(addr); -} - -static inline void jsrIndxe() -{ - addr=jindirectx(); pc--; - snes_writemem(s.w,pc>>8); s.b.l--; - snes_writemem(s.w,pc&0xFF); s.b.l--; - pc=readmemw(addr); -} - -static inline void jsl() -{ - unsigned char temp; - addr=readmemw(pbr|pc); pc+=2; - temp=snes_readmem(pbr|pc); - snes_writemem(s.w,pbr>>16); s.w--; - snes_writemem(s.w,pc>>8); s.w--; - snes_writemem(s.w,pc&0xFF); s.w--; - pc=addr&0xFFFF; - pbr=temp<<16; -} - -static inline void jsle() -{ - unsigned char temp; - addr=readmemw(pbr|pc); pc+=2; - temp=snes_readmem(pbr|pc); - snes_writemem(s.w,pbr>>16); s.b.l--; - snes_writemem(s.w,pc>>8); s.b.l--; - snes_writemem(s.w,pc&0xFF); s.b.l--; - pc=addr&0xFFFF; - pbr=temp<<16; -} - -static inline void rtl() -{ - cycles-=18; clockspc(18); - pc=readmemw(s.w+1); s.w+=2; - pbr=snes_readmem(s.w+1)<<16; s.w++; - pc++; -} - -static inline void rtle() -{ - cycles-=18; clockspc(18); - s.b.l++; pc=snes_readmem(s.w); - s.b.l++; pc|=(snes_readmem(s.w)<<8); - s.b.l++; pbr=snes_readmem(s.w)<<16; -} - -static inline void rts() -{ - cycles-=18; clockspc(18); - pc=readmemw(s.w+1); s.w+=2; - pc++; -} - -static inline void rtse() -{ - cycles-=18; clockspc(18); - s.b.l++; - pc=snes_readmem(s.w); - s.b.l++; - pc|=(snes_readmem(s.w)<<8); -} - -static inline void rti() -{ - unsigned char temp; - cycles-=6; - s.w++; - clockspc(6); - temp=snes_readmem(s.w); - p.c=temp&1; - p.z=temp&2; - p.i=temp&4; - p.d=temp&8; - p.x=temp&0x10; - p.m=temp&0x20; - p.v=temp&0x40; - p.n=temp&0x80; - s.w++; - pc=snes_readmem(s.w); - s.w++; - pc|=(snes_readmem(s.w)<<8); - s.w++; - pbr=snes_readmem(s.w)<<16; - updatecpumode(); -} - -/*Shift group*/ -static inline void asla8() -{ - snes_readmem(pbr|pc); - p.c=a.b.l&0x80; - a.b.l<<=1; - setzn8(a.b.l); -} -static inline void asla16() -{ - snes_readmem(pbr|pc); - p.c=a.w&0x8000; - a.w<<=1; - setzn16(a.w); -} - -static inline void aslZp8() -{ - unsigned char temp; - - addr=zeropage(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - p.c=temp&0x80; - temp<<=1; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void aslZp16() -{ - unsigned short temp; - - addr=zeropage(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - p.c=temp&0x8000; - temp<<=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void aslZpx8() -{ - unsigned char temp; - - addr=zeropagex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - p.c=temp&0x80; - temp<<=1; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void aslZpx16() -{ - unsigned short temp; - - addr=zeropagex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - p.c=temp&0x8000; - temp<<=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void aslAbs8() -{ - unsigned char temp; - - addr=absolute(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - p.c=temp&0x80; - temp<<=1; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void aslAbs16() -{ - unsigned short temp; - - addr=absolute(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - p.c=temp&0x8000; - temp<<=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void aslAbsx8() -{ - unsigned char temp; - - addr=absolutex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - p.c=temp&0x80; - temp<<=1; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void aslAbsx16() -{ - unsigned short temp; - - addr=absolutex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - p.c=temp&0x8000; - temp<<=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void lsra8() -{ - snes_readmem(pbr|pc); - p.c=a.b.l&1; - a.b.l>>=1; - setzn8(a.b.l); -} -static inline void lsra16() -{ - snes_readmem(pbr|pc); - p.c=a.w&1; - a.w>>=1; - setzn16(a.w); -} - -static inline void lsrZp8() -{ - unsigned char temp; - - addr=zeropage(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void lsrZp16() -{ - unsigned short temp; - - addr=zeropage(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void lsrZpx8() -{ - unsigned char temp; - - addr=zeropagex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void lsrZpx16() -{ - unsigned short temp; - - addr=zeropagex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void lsrAbs8() -{ - unsigned char temp; - - addr=absolute(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void lsrAbs16() -{ - unsigned short temp; - - addr=absolute(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void lsrAbsx8() -{ - unsigned char temp; - - addr=absolutex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void lsrAbsx16() -{ - unsigned short temp; - - addr=absolutex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void rola8() -{ - snes_readmem(pbr|pc); - addr=p.c; - p.c=a.b.l&0x80; - a.b.l<<=1; - if (addr) a.b.l|=1; - setzn8(a.b.l); -} - -static inline void rola16() -{ - snes_readmem(pbr|pc); - addr=p.c; - p.c=a.w&0x8000; - a.w<<=1; - if (addr) a.w|=1; - setzn16(a.w); -} - -static inline void rolZp8() -{ - unsigned char temp; - int tempc; - addr=zeropage(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn8(temp); - snes_writemem(addr,temp); -} - -static inline void rolZp16() -{ - unsigned short temp; - int tempc; - addr=zeropage(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&0x8000; - temp<<=1; - if (tempc) temp|=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void rolZpx8() -{ - unsigned char temp; - int tempc; - addr=zeropagex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void rolZpx16() -{ - unsigned short temp; - int tempc; - addr=zeropagex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&0x8000; - temp<<=1; - if (tempc) temp|=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void rolAbs8() -{ - unsigned char temp; - int tempc; - addr=absolute(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void rolAbs16() -{ - unsigned short temp; - int tempc; - addr=absolute(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&0x8000; - temp<<=1; - if (tempc) temp|=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void rolAbsx8() -{ - unsigned char temp; - int tempc; - addr=absolutex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void rolAbsx16() -{ - unsigned short temp; - int tempc; - addr=absolutex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&0x8000; - temp<<=1; - if (tempc) temp|=1; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void rora8() -{ - snes_readmem(pbr|pc); - addr=p.c; - p.c=a.b.l&1; - a.b.l>>=1; - if (addr) a.b.l|=0x80; - setzn8(a.b.l); -} -static inline void rora16() -{ - snes_readmem(pbr|pc); - addr=p.c; - p.c=a.w&1; - a.w>>=1; - if (addr) a.w|=0x8000; - setzn16(a.w); -} - -static inline void rorZp8() -{ - unsigned char temp; - int tempc; - addr=zeropage(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void rorZp16() -{ - unsigned short temp; - int tempc; - addr=zeropage(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x8000; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void rorZpx8() -{ - unsigned char temp; - int tempc; - addr=zeropagex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void rorZpx16() -{ - unsigned short temp; - int tempc; - addr=zeropagex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x8000; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void rorAbs8() -{ - unsigned char temp; - int tempc; - addr=absolute(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void rorAbs16() -{ - unsigned short temp; - int tempc; - addr=absolute(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x8000; - setzn16(temp); - writememw2(addr,temp); -} - -static inline void rorAbsx8() -{ - unsigned char temp; - int tempc; - addr=absolutex(); - temp=snes_readmem(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn8(temp); - snes_writemem(addr,temp); -} -static inline void rorAbsx16() -{ - unsigned short temp; - int tempc; - addr=absolutex(); - temp=readmemw(addr); - cycles-=6; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x8000; - setzn16(temp); - writememw2(addr,temp); -} - -/*Misc group*/ -static inline void xba() -{ - snes_readmem(pbr|pc); - a.w=(a.w>>8)|(a.w<<8); - setzn8(a.b.l); -} -static inline void nop() -{ - cycles-=6; clockspc(6); -} - -static inline void tcd() -{ - snes_readmem(pbr|pc); - dp=a.w; - setzn16(dp); -} - -static inline void tdc() -{ - snes_readmem(pbr|pc); - a.w=dp; - setzn16(a.w); -} - -static inline void tcs() -{ - snes_readmem(pbr|pc); - s.w=a.w; -} - -static inline void tsc() -{ - snes_readmem(pbr|pc); - a.w=s.w; - setzn16(a.w); -} - -static inline void trbZp8() -{ - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - p.z=!(a.b.l&temp); - temp&=~a.b.l; - cycles-=6; clockspc(6); - snes_writemem(addr,temp); -} -static inline void trbZp16() -{ - unsigned short temp; - addr=zeropage(); - temp=readmemw(addr); - p.z=!(a.w&temp); - temp&=~a.w; - cycles-=6; clockspc(6); - writememw2(addr,temp); -} - -static inline void trbAbs8() -{ - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - p.z=!(a.b.l&temp); - temp&=~a.b.l; - cycles-=6; clockspc(6); - snes_writemem(addr,temp); -} -static inline void trbAbs16() -{ - unsigned short temp; - addr=absolute(); - temp=readmemw(addr); - p.z=!(a.w&temp); - temp&=~a.w; - cycles-=6; clockspc(6); - writememw2(addr,temp); -} - -static inline void tsbZp8() -{ - unsigned char temp; - addr=zeropage(); - temp=snes_readmem(addr); - p.z=!(a.b.l&temp); - temp|=a.b.l; - cycles-=6; clockspc(6); - snes_writemem(addr,temp); -} -static inline void tsbZp16() -{ - unsigned short temp; - addr=zeropage(); - temp=readmemw(addr); - p.z=!(a.w&temp); - temp|=a.w; - cycles-=6; clockspc(6); - writememw2(addr,temp); -} - -static inline void tsbAbs8() -{ - unsigned char temp; - addr=absolute(); - temp=snes_readmem(addr); - p.z=!(a.b.l&temp); - temp|=a.b.l; - cycles-=6; clockspc(6); - snes_writemem(addr,temp); -} -static inline void tsbAbs16() -{ - unsigned short temp; - addr=absolute(); - temp=readmemw(addr); - p.z=!(a.w&temp); - temp|=a.w; - cycles-=6; clockspc(6); - writememw2(addr,temp); -} - -static inline void wai() -{ - snes_readmem(pbr|pc); - inwai=1; - pc--; - -} - -static inline void mvp() -{ - unsigned char temp; - dbr=(snes_readmem(pbr|pc))<<16; pc++; - addr=(snes_readmem(pbr|pc))<<16; pc++; - temp=snes_readmem(addr|x.w); - snes_writemem(dbr|y.w,temp); - x.w--; - y.w--; - a.w--; - if (a.w!=0xFFFF) pc-=3; - cycles-=12; clockspc(12); -} - -static inline void mvn() -{ - unsigned char temp; - dbr=(snes_readmem(pbr|pc))<<16; pc++; - addr=(snes_readmem(pbr|pc))<<16; pc++; - temp=snes_readmem(addr|x.w); - snes_writemem(dbr|y.w,temp); - x.w++; - y.w++; - a.w--; - if (a.w!=0xFFFF) pc-=3; - cycles-=12; clockspc(12); -} - -static inline void brk() -{ - unsigned char temp=0; - snes_writemem(s.w,pbr>>16); s.w--; - snes_writemem(s.w,pc>>8); s.w--; - snes_writemem(s.w,pc&0xFF); s.w--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.x) temp|=0x10; - if (p.m) temp|=0x20; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - snes_writemem(s.w,temp); s.w--; - pc=readmemw(0xFFE6); - pbr=0; - p.i=1; - p.d=0; -} - -/*Functions*/ -void reset65816() -{ - pbr=dbr=0; - s.w=0x1FF; - cpumode=4; - p.e=1; - p.i=1; - pc=readmemw(0xFFFC); - a.w=x.w=y.w=0; - p.x=p.m=1; - skipz=0; -} - -static inline void badopcode() -{ - //snemlog(L"Bad opcode %02X\n",opcode); - pc--; -} - -void makeopcodetable() -{ - int c,d; - for (c=0;c<256;c++) - { - for (d=0;d<5;d++) - { - opcodes[c][d]=badopcode; - } - } - /*LDA group*/ - opcodes[0xA9][0]=opcodes[0xA9][2]=opcodes[0xA9][4]=ldaImm8; - opcodes[0xA9][1]=opcodes[0xA9][3]=ldaImm16; - opcodes[0xA5][0]=opcodes[0xA5][2]=opcodes[0xA5][4]=ldaZp8; - opcodes[0xA5][1]=opcodes[0xA5][3]=ldaZp16; - opcodes[0xB5][0]=opcodes[0xB5][2]=opcodes[0xB5][4]=ldaZpx8; - opcodes[0xB5][1]=opcodes[0xB5][3]=ldaZpx16; - opcodes[0xA3][0]=opcodes[0xA3][2]=opcodes[0xA3][4]=ldaSp8; - opcodes[0xA3][1]=opcodes[0xA3][3]=ldaSp16; - opcodes[0xB3][0]=opcodes[0xB3][2]=opcodes[0xB3][4]=ldaSIndirecty8; - opcodes[0xB3][1]=opcodes[0xB3][3]=ldaSIndirecty16; - opcodes[0xAD][0]=opcodes[0xAD][2]=opcodes[0xAD][4]=ldaAbs8; - opcodes[0xAD][1]=opcodes[0xAD][3]=ldaAbs16; - opcodes[0xBD][0]=opcodes[0xBD][2]=opcodes[0xBD][4]=ldaAbsx8; - opcodes[0xBD][1]=opcodes[0xBD][3]=ldaAbsx16; - opcodes[0xB9][0]=opcodes[0xB9][2]=opcodes[0xB9][4]=ldaAbsy8; - opcodes[0xB9][1]=opcodes[0xB9][3]=ldaAbsy16; - opcodes[0xAF][0]=opcodes[0xAF][2]=opcodes[0xAF][4]=ldaLong8; - opcodes[0xAF][1]=opcodes[0xAF][3]=ldaLong16; - opcodes[0xBF][0]=opcodes[0xBF][2]=opcodes[0xBF][4]=ldaLongx8; - opcodes[0xBF][1]=opcodes[0xBF][3]=ldaLongx16; - opcodes[0xB2][0]=opcodes[0xB2][2]=opcodes[0xB2][4]=ldaIndirect8; - opcodes[0xB2][1]=opcodes[0xB2][3]=ldaIndirect16; - opcodes[0xA1][0]=opcodes[0xA1][2]=opcodes[0xA1][4]=ldaIndirectx8; - opcodes[0xA1][1]=opcodes[0xA1][3]=ldaIndirectx16; - opcodes[0xB1][0]=opcodes[0xB1][2]=opcodes[0xB1][4]=ldaIndirecty8; - opcodes[0xB1][1]=opcodes[0xB1][3]=ldaIndirecty16; - opcodes[0xA7][0]=opcodes[0xA7][2]=opcodes[0xA7][4]=ldaIndirectLong8; - opcodes[0xA7][1]=opcodes[0xA7][3]=ldaIndirectLong16; - opcodes[0xB7][0]=opcodes[0xB7][2]=opcodes[0xB7][4]=ldaIndirectLongy8; - opcodes[0xB7][1]=opcodes[0xB7][3]=ldaIndirectLongy16; - /*LDX group*/ - opcodes[0xA2][0]=opcodes[0xA2][1]=opcodes[0xA2][4]=ldxImm8; - opcodes[0xA2][2]=opcodes[0xA2][3]=ldxImm16; - opcodes[0xA6][0]=opcodes[0xA6][1]=opcodes[0xA6][4]=ldxZp8; - opcodes[0xA6][2]=opcodes[0xA6][3]=ldxZp16; - opcodes[0xB6][0]=opcodes[0xB6][1]=opcodes[0xB6][4]=ldxZpy8; - opcodes[0xB6][2]=opcodes[0xB6][3]=ldxZpy16; - opcodes[0xAE][0]=opcodes[0xAE][1]=opcodes[0xAE][4]=ldxAbs8; - opcodes[0xAE][2]=opcodes[0xAE][3]=ldxAbs16; - opcodes[0xBE][0]=opcodes[0xBE][1]=opcodes[0xBE][4]=ldxAbsy8; - opcodes[0xBE][2]=opcodes[0xBE][3]=ldxAbsy16; - /*LDY group*/ - opcodes[0xA0][0]=opcodes[0xA0][1]=opcodes[0xA0][4]=ldyImm8; - opcodes[0xA0][2]=opcodes[0xA0][3]=ldyImm16; - opcodes[0xA4][0]=opcodes[0xA4][1]=opcodes[0xA4][4]=ldyZp8; - opcodes[0xA4][2]=opcodes[0xA4][3]=ldyZp16; - opcodes[0xB4][0]=opcodes[0xB4][1]=opcodes[0xB4][4]=ldyZpx8; - opcodes[0xB4][2]=opcodes[0xB4][3]=ldyZpx16; - opcodes[0xAC][0]=opcodes[0xAC][1]=opcodes[0xAC][4]=ldyAbs8; - opcodes[0xAC][2]=opcodes[0xAC][3]=ldyAbs16; - opcodes[0xBC][0]=opcodes[0xBC][1]=opcodes[0xBC][4]=ldyAbsx8; - opcodes[0xBC][2]=opcodes[0xBC][3]=ldyAbsx16; - - /*STA group*/ - opcodes[0x85][0]=opcodes[0x85][2]=opcodes[0x85][4]=staZp8; - opcodes[0x85][1]=opcodes[0x85][3]=staZp16; - opcodes[0x95][0]=opcodes[0x95][2]=opcodes[0x95][4]=staZpx8; - opcodes[0x95][1]=opcodes[0x95][3]=staZpx16; - opcodes[0x8D][0]=opcodes[0x8D][2]=opcodes[0x8D][4]=staAbs8; - opcodes[0x8D][1]=opcodes[0x8D][3]=staAbs16; - opcodes[0x9D][0]=opcodes[0x9D][2]=opcodes[0x9D][4]=staAbsx8; - opcodes[0x9D][1]=opcodes[0x9D][3]=staAbsx16; - opcodes[0x99][0]=opcodes[0x99][2]=opcodes[0x99][4]=staAbsy8; - opcodes[0x99][1]=opcodes[0x99][3]=staAbsy16; - opcodes[0x8F][0]=opcodes[0x8F][2]=opcodes[0x8F][4]=staLong8; - opcodes[0x8F][1]=opcodes[0x8F][3]=staLong16; - opcodes[0x9F][0]=opcodes[0x9F][2]=opcodes[0x9F][4]=staLongx8; - opcodes[0x9F][1]=opcodes[0x9F][3]=staLongx16; - opcodes[0x92][0]=opcodes[0x92][2]=opcodes[0x92][4]=staIndirect8; - opcodes[0x92][1]=opcodes[0x92][3]=staIndirect16; - opcodes[0x81][0]=opcodes[0x81][2]=opcodes[0x81][4]=staIndirectx8; - opcodes[0x81][1]=opcodes[0x81][3]=staIndirectx16; - opcodes[0x91][0]=opcodes[0x91][2]=opcodes[0x91][4]=staIndirecty8; - opcodes[0x91][1]=opcodes[0x91][3]=staIndirecty16; - opcodes[0x87][0]=opcodes[0x87][2]=opcodes[0x87][4]=staIndirectLong8; - opcodes[0x87][1]=opcodes[0x87][3]=staIndirectLong16; - opcodes[0x97][0]=opcodes[0x97][2]=opcodes[0x97][4]=staIndirectLongy8; - opcodes[0x97][1]=opcodes[0x97][3]=staIndirectLongy16; - opcodes[0x83][0]=opcodes[0x83][2]=opcodes[0x83][4]=staSp8; - opcodes[0x83][1]=opcodes[0x83][3]=staSp16; - opcodes[0x93][0]=opcodes[0x93][2]=opcodes[0x93][4]=staSIndirecty8; - opcodes[0x93][1]=opcodes[0x93][3]=staSIndirecty16; - /*STX group*/ - opcodes[0x86][0]=opcodes[0x86][1]=opcodes[0x86][4]=stxZp8; - opcodes[0x86][2]=opcodes[0x86][3]=stxZp16; - opcodes[0x96][0]=opcodes[0x96][1]=opcodes[0x96][4]=stxZpy8; - opcodes[0x96][2]=opcodes[0x96][3]=stxZpy16; - opcodes[0x8E][0]=opcodes[0x8E][1]=opcodes[0x8E][4]=stxAbs8; - opcodes[0x8E][2]=opcodes[0x8E][3]=stxAbs16; - /*STY group*/ - opcodes[0x84][0]=opcodes[0x84][1]=opcodes[0x84][4]=styZp8; - opcodes[0x84][2]=opcodes[0x84][3]=styZp16; - opcodes[0x94][0]=opcodes[0x94][1]=opcodes[0x94][4]=styZpx8; - opcodes[0x94][2]=opcodes[0x94][3]=styZpx16; - opcodes[0x8C][0]=opcodes[0x8C][1]=opcodes[0x8C][4]=styAbs8; - opcodes[0x8C][2]=opcodes[0x8C][3]=styAbs16; - /*STZ group*/ - opcodes[0x64][0]=opcodes[0x64][2]=opcodes[0x64][4]=stzZp8; - opcodes[0x64][1]=opcodes[0x64][3]=stzZp16; - opcodes[0x74][0]=opcodes[0x74][2]=opcodes[0x74][4]=stzZpx8; - opcodes[0x74][1]=opcodes[0x74][3]=stzZpx16; - opcodes[0x9C][0]=opcodes[0x9C][2]=opcodes[0x9C][4]=stzAbs8; - opcodes[0x9C][1]=opcodes[0x9C][3]=stzAbs16; - opcodes[0x9E][0]=opcodes[0x9E][2]=opcodes[0x9E][4]=stzAbsx8; - opcodes[0x9E][1]=opcodes[0x9E][3]=stzAbsx16; - - opcodes[0x3A][0]=opcodes[0x3A][2]=opcodes[0x3A][4]=deca8; - opcodes[0x3A][1]=opcodes[0x3A][3]=deca16; - opcodes[0xCA][0]=opcodes[0xCA][1]=opcodes[0xCA][4]=dex8; - opcodes[0xCA][2]=opcodes[0xCA][3]=dex16; - opcodes[0x88][0]=opcodes[0x88][1]=opcodes[0x88][4]=dey8; - opcodes[0x88][2]=opcodes[0x88][3]=dey16; - opcodes[0x1A][0]=opcodes[0x1A][2]=opcodes[0x1A][4]=inca8; - opcodes[0x1A][1]=opcodes[0x1A][3]=inca16; - opcodes[0xE8][0]=opcodes[0xE8][1]=opcodes[0xE8][4]=inx8; - opcodes[0xE8][2]=opcodes[0xE8][3]=inx16; - opcodes[0xC8][0]=opcodes[0xC8][1]=opcodes[0xC8][4]=iny8; - opcodes[0xC8][2]=opcodes[0xC8][3]=iny16; - - /*INC group*/ - opcodes[0xE6][0]=opcodes[0xE6][2]=opcodes[0xE6][4]=incZp8; - opcodes[0xE6][1]=opcodes[0xE6][3]=incZp16; - opcodes[0xF6][0]=opcodes[0xF6][2]=opcodes[0xF6][4]=incZpx8; - opcodes[0xF6][1]=opcodes[0xF6][3]=incZpx16; - opcodes[0xEE][0]=opcodes[0xEE][2]=opcodes[0xEE][4]=incAbs8; - opcodes[0xEE][1]=opcodes[0xEE][3]=incAbs16; - opcodes[0xFE][0]=opcodes[0xFE][2]=opcodes[0xFE][4]=incAbsx8; - opcodes[0xFE][1]=opcodes[0xFE][3]=incAbsx16; - - /*DEC group*/ - opcodes[0xC6][0]=opcodes[0xC6][2]=opcodes[0xC6][4]=decZp8; - opcodes[0xC6][1]=opcodes[0xC6][3]=decZp16; - opcodes[0xD6][0]=opcodes[0xD6][2]=opcodes[0xD6][4]=decZpx8; - opcodes[0xD6][1]=opcodes[0xD6][3]=decZpx16; - opcodes[0xCE][0]=opcodes[0xCE][2]=opcodes[0xCE][4]=decAbs8; - opcodes[0xCE][1]=opcodes[0xCE][3]=decAbs16; - opcodes[0xDE][0]=opcodes[0xDE][2]=opcodes[0xDE][4]=decAbsx8; - opcodes[0xDE][1]=opcodes[0xDE][3]=decAbsx16; - - /*AND group*/ - opcodes[0x29][0]=opcodes[0x29][2]=opcodes[0x29][4]=andImm8; - opcodes[0x29][1]=opcodes[0x29][3]=andImm16; - opcodes[0x25][0]=opcodes[0x25][2]=opcodes[0x25][4]=andZp8; - opcodes[0x25][1]=opcodes[0x25][3]=andZp16; - opcodes[0x35][0]=opcodes[0x35][2]=opcodes[0x35][4]=andZpx8; - opcodes[0x35][1]=opcodes[0x35][3]=andZpx16; - opcodes[0x23][0]=opcodes[0x23][2]=opcodes[0x23][4]=andSp8; - opcodes[0x23][1]=opcodes[0x23][3]=andSp16; - opcodes[0x2D][0]=opcodes[0x2D][2]=opcodes[0x2D][4]=andAbs8; - opcodes[0x2D][1]=opcodes[0x2D][3]=andAbs16; - opcodes[0x3D][0]=opcodes[0x3D][2]=opcodes[0x3D][4]=andAbsx8; - opcodes[0x3D][1]=opcodes[0x3D][3]=andAbsx16; - opcodes[0x39][0]=opcodes[0x39][2]=opcodes[0x39][4]=andAbsy8; - opcodes[0x39][1]=opcodes[0x39][3]=andAbsy16; - opcodes[0x2F][0]=opcodes[0x2F][2]=opcodes[0x2F][4]=andLong8; - opcodes[0x2F][1]=opcodes[0x2F][3]=andLong16; - opcodes[0x3F][0]=opcodes[0x3F][2]=opcodes[0x3F][4]=andLongx8; - opcodes[0x3F][1]=opcodes[0x3F][3]=andLongx16; - opcodes[0x32][0]=opcodes[0x32][2]=opcodes[0x32][4]=andIndirect8; - opcodes[0x32][1]=opcodes[0x32][3]=andIndirect16; - opcodes[0x21][0]=opcodes[0x21][2]=opcodes[0x21][4]=andIndirectx8; - opcodes[0x21][1]=opcodes[0x21][3]=andIndirectx16; - opcodes[0x31][0]=opcodes[0x31][2]=opcodes[0x31][4]=andIndirecty8; - opcodes[0x31][1]=opcodes[0x31][3]=andIndirecty16; - opcodes[0x27][0]=opcodes[0x27][2]=opcodes[0x27][4]=andIndirectLong8; - opcodes[0x27][1]=opcodes[0x27][3]=andIndirectLong16; - opcodes[0x37][0]=opcodes[0x37][2]=opcodes[0x37][4]=andIndirectLongy8; - opcodes[0x37][1]=opcodes[0x37][3]=andIndirectLongy16; - - /*EOR group*/ - opcodes[0x49][0]=opcodes[0x49][2]=opcodes[0x49][4]=eorImm8; - opcodes[0x49][1]=opcodes[0x49][3]=eorImm16; - opcodes[0x45][0]=opcodes[0x45][2]=opcodes[0x45][4]=eorZp8; - opcodes[0x45][1]=opcodes[0x45][3]=eorZp16; - opcodes[0x55][0]=opcodes[0x55][2]=opcodes[0x55][4]=eorZpx8; - opcodes[0x55][1]=opcodes[0x55][3]=eorZpx16; - opcodes[0x43][0]=opcodes[0x43][2]=opcodes[0x43][4]=eorSp8; - opcodes[0x43][1]=opcodes[0x43][3]=eorSp16; - opcodes[0x4D][0]=opcodes[0x4D][2]=opcodes[0x4D][4]=eorAbs8; - opcodes[0x4D][1]=opcodes[0x4D][3]=eorAbs16; - opcodes[0x5D][0]=opcodes[0x5D][2]=opcodes[0x5D][4]=eorAbsx8; - opcodes[0x5D][1]=opcodes[0x5D][3]=eorAbsx16; - opcodes[0x59][0]=opcodes[0x59][2]=opcodes[0x59][4]=eorAbsy8; - opcodes[0x59][1]=opcodes[0x59][3]=eorAbsy16; - opcodes[0x4F][0]=opcodes[0x4F][2]=opcodes[0x4F][4]=eorLong8; - opcodes[0x4F][1]=opcodes[0x4F][3]=eorLong16; - opcodes[0x5F][0]=opcodes[0x5F][2]=opcodes[0x5F][4]=eorLongx8; - opcodes[0x5F][1]=opcodes[0x5F][3]=eorLongx16; - opcodes[0x52][0]=opcodes[0x52][2]=opcodes[0x52][4]=eorIndirect8; - opcodes[0x52][1]=opcodes[0x52][3]=eorIndirect16; - opcodes[0x41][0]=opcodes[0x41][2]=opcodes[0x41][4]=eorIndirectx8; - opcodes[0x41][1]=opcodes[0x41][3]=eorIndirectx16; - opcodes[0x51][0]=opcodes[0x51][2]=opcodes[0x51][4]=eorIndirecty8; - opcodes[0x51][1]=opcodes[0x51][3]=eorIndirecty16; - opcodes[0x47][0]=opcodes[0x47][2]=opcodes[0x47][4]=eorIndirectLong8; - opcodes[0x47][1]=opcodes[0x47][3]=eorIndirectLong16; - opcodes[0x57][0]=opcodes[0x57][2]=opcodes[0x57][4]=eorIndirectLongy8; - opcodes[0x57][1]=opcodes[0x57][3]=eorIndirectLongy16; - - /*ORA group*/ - opcodes[0x09][0]=opcodes[0x09][2]=opcodes[0x09][4]=oraImm8; - opcodes[0x09][1]=opcodes[0x09][3]=oraImm16; - opcodes[0x05][0]=opcodes[0x05][2]=opcodes[0x05][4]=oraZp8; - opcodes[0x05][1]=opcodes[0x05][3]=oraZp16; - opcodes[0x15][0]=opcodes[0x15][2]=opcodes[0x15][4]=oraZpx8; - opcodes[0x15][1]=opcodes[0x15][3]=oraZpx16; - opcodes[0x03][0]=opcodes[0x03][2]=opcodes[0x03][4]=oraSp8; - opcodes[0x03][1]=opcodes[0x03][3]=oraSp16; - opcodes[0x0D][0]=opcodes[0x0D][2]=opcodes[0x0D][4]=oraAbs8; - opcodes[0x0D][1]=opcodes[0x0D][3]=oraAbs16; - opcodes[0x1D][0]=opcodes[0x1D][2]=opcodes[0x1D][4]=oraAbsx8; - opcodes[0x1D][1]=opcodes[0x1D][3]=oraAbsx16; - opcodes[0x19][0]=opcodes[0x19][2]=opcodes[0x19][4]=oraAbsy8; - opcodes[0x19][1]=opcodes[0x19][3]=oraAbsy16; - opcodes[0x0F][0]=opcodes[0x0F][2]=opcodes[0x0F][4]=oraLong8; - opcodes[0x0F][1]=opcodes[0x0F][3]=oraLong16; - opcodes[0x1F][0]=opcodes[0x1F][2]=opcodes[0x1F][4]=oraLongx8; - opcodes[0x1F][1]=opcodes[0x1F][3]=oraLongx16; - opcodes[0x12][0]=opcodes[0x12][2]=opcodes[0x12][4]=oraIndirect8; - opcodes[0x12][1]=opcodes[0x12][3]=oraIndirect16; - opcodes[0x01][0]=opcodes[0x01][2]=opcodes[0x01][4]=oraIndirectx8; - opcodes[0x01][1]=opcodes[0x01][3]=oraIndirectx16; - opcodes[0x11][0]=opcodes[0x11][2]=opcodes[0x11][4]=oraIndirecty8; - opcodes[0x11][1]=opcodes[0x11][3]=oraIndirecty16; - opcodes[0x07][0]=opcodes[0x07][2]=opcodes[0x07][4]=oraIndirectLong8; - opcodes[0x07][1]=opcodes[0x07][3]=oraIndirectLong16; - opcodes[0x17][0]=opcodes[0x17][2]=opcodes[0x17][4]=oraIndirectLongy8; - opcodes[0x17][1]=opcodes[0x17][3]=oraIndirectLongy16; - - /*ADC group*/ - opcodes[0x69][0]=opcodes[0x69][2]=opcodes[0x69][4]=adcImm8; - opcodes[0x69][1]=opcodes[0x69][3]=adcImm16; - opcodes[0x65][0]=opcodes[0x65][2]=opcodes[0x65][4]=adcZp8; - opcodes[0x65][1]=opcodes[0x65][3]=adcZp16; - opcodes[0x75][0]=opcodes[0x75][2]=opcodes[0x75][4]=adcZpx8; - opcodes[0x75][1]=opcodes[0x75][3]=adcZpx16; - opcodes[0x63][0]=opcodes[0x63][2]=opcodes[0x63][4]=adcSp8; - opcodes[0x63][1]=opcodes[0x63][3]=adcSp16; - opcodes[0x6D][0]=opcodes[0x6D][2]=opcodes[0x6D][4]=adcAbs8; - opcodes[0x6D][1]=opcodes[0x6D][3]=adcAbs16; - opcodes[0x7D][0]=opcodes[0x7D][2]=opcodes[0x7D][4]=adcAbsx8; - opcodes[0x7D][1]=opcodes[0x7D][3]=adcAbsx16; - opcodes[0x79][0]=opcodes[0x79][2]=opcodes[0x79][4]=adcAbsy8; - opcodes[0x79][1]=opcodes[0x79][3]=adcAbsy16; - opcodes[0x6F][0]=opcodes[0x6F][2]=opcodes[0x6F][4]=adcLong8; - opcodes[0x6F][1]=opcodes[0x6F][3]=adcLong16; - opcodes[0x7F][0]=opcodes[0x7F][2]=opcodes[0x7F][4]=adcLongx8; - opcodes[0x7F][1]=opcodes[0x7F][3]=adcLongx16; - opcodes[0x72][0]=opcodes[0x72][2]=opcodes[0x72][4]=adcIndirect8; - opcodes[0x72][1]=opcodes[0x72][3]=adcIndirect16; - opcodes[0x61][0]=opcodes[0x61][2]=opcodes[0x61][4]=adcIndirectx8; - opcodes[0x61][1]=opcodes[0x61][3]=adcIndirectx16; - opcodes[0x71][0]=opcodes[0x71][2]=opcodes[0x71][4]=adcIndirecty8; - opcodes[0x71][1]=opcodes[0x71][3]=adcIndirecty16; - opcodes[0x73][0]=opcodes[0x73][2]=opcodes[0x73][4]=adcsIndirecty8; - opcodes[0x73][1]=opcodes[0x73][3]=adcsIndirecty16; - opcodes[0x67][0]=opcodes[0x67][2]=opcodes[0x67][4]=adcIndirectLong8; - opcodes[0x67][1]=opcodes[0x67][3]=adcIndirectLong16; - opcodes[0x77][0]=opcodes[0x77][2]=opcodes[0x77][4]=adcIndirectLongy8; - opcodes[0x77][1]=opcodes[0x77][3]=adcIndirectLongy16; - - /*SBC group*/ - opcodes[0xE9][0]=opcodes[0xE9][2]=opcodes[0xE9][4]=sbcImm8; - opcodes[0xE9][1]=opcodes[0xE9][3]=sbcImm16; - opcodes[0xE5][0]=opcodes[0xE5][2]=opcodes[0xE5][4]=sbcZp8; - opcodes[0xE5][1]=opcodes[0xE5][3]=sbcZp16; - opcodes[0xE3][0]=opcodes[0xE3][2]=opcodes[0xE3][4]=sbcSp8; - opcodes[0xE3][1]=opcodes[0xE3][3]=sbcSp16; - opcodes[0xF5][0]=opcodes[0xF5][2]=opcodes[0xF5][4]=sbcZpx8; - opcodes[0xF5][1]=opcodes[0xF5][3]=sbcZpx16; - opcodes[0xED][0]=opcodes[0xED][2]=opcodes[0xED][4]=sbcAbs8; - opcodes[0xED][1]=opcodes[0xED][3]=sbcAbs16; - opcodes[0xFD][0]=opcodes[0xFD][2]=opcodes[0xFD][4]=sbcAbsx8; - opcodes[0xFD][1]=opcodes[0xFD][3]=sbcAbsx16; - opcodes[0xF9][0]=opcodes[0xF9][2]=opcodes[0xF9][4]=sbcAbsy8; - opcodes[0xF9][1]=opcodes[0xF9][3]=sbcAbsy16; - opcodes[0xEF][0]=opcodes[0xEF][2]=opcodes[0xEF][4]=sbcLong8; - opcodes[0xEF][1]=opcodes[0xEF][3]=sbcLong16; - opcodes[0xFF][0]=opcodes[0xFF][2]=opcodes[0xFF][4]=sbcLongx8; - opcodes[0xFF][1]=opcodes[0xFF][3]=sbcLongx16; - opcodes[0xF2][0]=opcodes[0xF2][2]=opcodes[0xF2][4]=sbcIndirect8; - opcodes[0xF2][1]=opcodes[0xF2][3]=sbcIndirect16; - opcodes[0xE1][0]=opcodes[0xE1][2]=opcodes[0xE1][4]=sbcIndirectx8; - opcodes[0xE1][1]=opcodes[0xE1][3]=sbcIndirectx16; - opcodes[0xF1][0]=opcodes[0xF1][2]=opcodes[0xF1][4]=sbcIndirecty8; - opcodes[0xF1][1]=opcodes[0xF1][3]=sbcIndirecty16; - opcodes[0xE7][0]=opcodes[0xE7][2]=opcodes[0xE7][4]=sbcIndirectLong8; - opcodes[0xE7][1]=opcodes[0xE7][3]=sbcIndirectLong16; - opcodes[0xF7][0]=opcodes[0xF7][2]=opcodes[0xF7][4]=sbcIndirectLongy8; - opcodes[0xF7][1]=opcodes[0xF7][3]=sbcIndirectLongy16; - - /*Transfer group*/ - opcodes[0xAA][0]=opcodes[0xAA][1]=opcodes[0xAA][4]=tax8; - opcodes[0xAA][2]=opcodes[0xAA][3]=tax16; - opcodes[0xA8][0]=opcodes[0xA8][1]=opcodes[0xA8][4]=tay8; - opcodes[0xA8][2]=opcodes[0xA8][3]=tay16; - opcodes[0x8A][0]=opcodes[0x8A][2]=opcodes[0x8A][4]=txa8; - opcodes[0x8A][1]=opcodes[0x8A][3]=txa16; - opcodes[0x98][0]=opcodes[0x98][2]=opcodes[0x98][4]=tya8; - opcodes[0x98][1]=opcodes[0x98][3]=tya16; - opcodes[0x9B][0]=opcodes[0x9B][1]=opcodes[0x9B][4]=txy8; - opcodes[0x9B][2]=opcodes[0x9B][3]=txy16; - opcodes[0xBB][0]=opcodes[0xBB][1]=opcodes[0xBB][4]=tyx8; - opcodes[0xBB][2]=opcodes[0xBB][3]=tyx16; - opcodes[0xBA][0]=opcodes[0xBA][1]=opcodes[0xBA][4]=tsx8; - opcodes[0xBA][2]=opcodes[0xBA][3]=tsx16; - opcodes[0x9A][0]=opcodes[0x9A][1]=opcodes[0x9A][4]=txs8; - opcodes[0x9A][2]=opcodes[0x9A][3]=txs16; - - /*Flag Group*/ - opcodes[0x18][0]=opcodes[0x18][1]=opcodes[0x18][2]= - opcodes[0x18][3]=opcodes[0x18][4]=clc; - opcodes[0xD8][0]=opcodes[0xD8][1]=opcodes[0xD8][2]= - opcodes[0xD8][3]=opcodes[0xD8][4]=cld; - opcodes[0x58][0]=opcodes[0x58][1]=opcodes[0x58][2]= - opcodes[0x58][3]=opcodes[0x58][4]=cli; - opcodes[0xB8][0]=opcodes[0xB8][1]=opcodes[0xB8][2]= - opcodes[0xB8][3]=opcodes[0xB8][4]=clv; - opcodes[0x38][0]=opcodes[0x38][1]=opcodes[0x38][2]= - opcodes[0x38][3]=opcodes[0x38][4]=sec; - opcodes[0xF8][0]=opcodes[0xF8][1]=opcodes[0xF8][2]= - opcodes[0xF8][3]=opcodes[0xF8][4]=sed; - opcodes[0x78][0]=opcodes[0x78][1]=opcodes[0x78][2]= - opcodes[0x78][3]=opcodes[0x78][4]=sei; - opcodes[0xFB][0]=opcodes[0xFB][1]=opcodes[0xFB][2]= - opcodes[0xFB][3]=opcodes[0xFB][4]=xce; - opcodes[0xE2][0]=opcodes[0xE2][1]=opcodes[0xE2][2]= - opcodes[0xE2][3]=opcodes[0xE2][4]=sep; - opcodes[0xC2][0]=opcodes[0xC2][1]=opcodes[0xC2][2]= - opcodes[0xC2][3]=opcodes[0xC2][4]=rep; - - /*Stack group*/ - opcodes[0x8B][0]=opcodes[0x8B][1]=opcodes[0x8B][2]= - opcodes[0x8B][3]=phb; - opcodes[0x8B][4]=phbe; - opcodes[0x4B][0]=opcodes[0x4B][1]=opcodes[0x4B][2]= - opcodes[0x4B][3]=phk; - opcodes[0x4B][4]=phke; - opcodes[0xAB][0]=opcodes[0xAB][1]=opcodes[0xAB][2]= - opcodes[0xAB][3]=plb; - opcodes[0xAB][4]=plbe; - opcodes[0x08][0]=opcodes[0x08][1]=opcodes[0x08][2]= - opcodes[0x08][3]=php; - opcodes[0x08][4]=php; - opcodes[0x28][0]=opcodes[0x28][1]=opcodes[0x28][2]= - opcodes[0x28][3]=plp; - opcodes[0x28][4]=plp; - opcodes[0x48][0]=opcodes[0x48][2]=opcodes[0x48][4]=pha8; - opcodes[0x48][1]=opcodes[0x48][3]=pha16; - opcodes[0xDA][0]=opcodes[0xDA][1]=opcodes[0xDA][4]=phx8; - opcodes[0xDA][2]=opcodes[0xDA][3]=phx16; - opcodes[0x5A][0]=opcodes[0x5A][1]=opcodes[0x5A][4]=phy8; - opcodes[0x5A][2]=opcodes[0x5A][3]=phy16; - opcodes[0x68][0]=opcodes[0x68][2]=opcodes[0x68][4]=pla8; - opcodes[0x68][1]=opcodes[0x68][3]=pla16; - opcodes[0xFA][0]=opcodes[0xFA][1]=opcodes[0xFA][4]=plx8; - opcodes[0xFA][2]=opcodes[0xFA][3]=plx16; - opcodes[0x7A][0]=opcodes[0x7A][1]=opcodes[0x7A][4]=ply8; - opcodes[0x7A][2]=opcodes[0x7A][3]=ply16; - opcodes[0xD4][0]=opcodes[0xD4][1]=opcodes[0xD4][2]= - opcodes[0xD4][3]=opcodes[0xD4][4]=pei; - opcodes[0xF4][0]=opcodes[0xF4][1]=opcodes[0xF4][2]= - opcodes[0xF4][3]=opcodes[0xF4][4]=pea; - opcodes[0x62][0]=opcodes[0x62][1]=opcodes[0x62][2]= - opcodes[0x62][3]=opcodes[0x62][4]=per; - opcodes[0x0B][0]=opcodes[0x0B][1]=opcodes[0x0B][2]= - opcodes[0x0B][3]=opcodes[0x0B][4]=phd; - opcodes[0x2B][0]=opcodes[0x2B][1]=opcodes[0x2B][2]= - opcodes[0x2B][3]=opcodes[0x2B][4]=pld; - - /*CMP group*/ - opcodes[0xC9][0]=opcodes[0xC9][2]=opcodes[0xC9][4]=cmpImm8; - opcodes[0xC9][1]=opcodes[0xC9][3]=cmpImm16; - opcodes[0xC5][0]=opcodes[0xC5][2]=opcodes[0xC5][4]=cmpZp8; - opcodes[0xC5][1]=opcodes[0xC5][3]=cmpZp16; - opcodes[0xC3][0]=opcodes[0xC3][2]=opcodes[0xC3][4]=cmpSp8; - opcodes[0xC3][1]=opcodes[0xC3][3]=cmpSp16; - opcodes[0xD5][0]=opcodes[0xD5][2]=opcodes[0xD5][4]=cmpZpx8; - opcodes[0xD5][1]=opcodes[0xD5][3]=cmpZpx16; - opcodes[0xCD][0]=opcodes[0xCD][2]=opcodes[0xCD][4]=cmpAbs8; - opcodes[0xCD][1]=opcodes[0xCD][3]=cmpAbs16; - opcodes[0xDD][0]=opcodes[0xDD][2]=opcodes[0xDD][4]=cmpAbsx8; - opcodes[0xDD][1]=opcodes[0xDD][3]=cmpAbsx16; - opcodes[0xD9][0]=opcodes[0xD9][2]=opcodes[0xD9][4]=cmpAbsy8; - opcodes[0xD9][1]=opcodes[0xD9][3]=cmpAbsy16; - opcodes[0xCF][0]=opcodes[0xCF][2]=opcodes[0xCF][4]=cmpLong8; - opcodes[0xCF][1]=opcodes[0xCF][3]=cmpLong16; - opcodes[0xDF][0]=opcodes[0xDF][2]=opcodes[0xDF][4]=cmpLongx8; - opcodes[0xDF][1]=opcodes[0xDF][3]=cmpLongx16; - opcodes[0xD2][0]=opcodes[0xD2][2]=opcodes[0xD2][4]=cmpIndirect8; - opcodes[0xD2][1]=opcodes[0xD2][3]=cmpIndirect16; - opcodes[0xC1][0]=opcodes[0xC1][2]=opcodes[0xC1][4]=cmpIndirectx8; - opcodes[0xC1][1]=opcodes[0xC1][3]=cmpIndirectx16; - opcodes[0xD1][0]=opcodes[0xD1][2]=opcodes[0xD1][4]=cmpIndirecty8; - opcodes[0xD1][1]=opcodes[0xD1][3]=cmpIndirecty16; - opcodes[0xC7][0]=opcodes[0xC7][2]=opcodes[0xC7][4]=cmpIndirectLong8; - opcodes[0xC7][1]=opcodes[0xC7][3]=cmpIndirectLong16; - opcodes[0xD7][0]=opcodes[0xD7][2]=opcodes[0xD7][4]=cmpIndirectLongy8; - opcodes[0xD7][1]=opcodes[0xD7][3]=cmpIndirectLongy16; - - /*CPX group*/ - opcodes[0xE0][0]=opcodes[0xE0][1]=opcodes[0xE0][4]=cpxImm8; - opcodes[0xE0][2]=opcodes[0xE0][3]=cpxImm16; - opcodes[0xE4][0]=opcodes[0xE4][1]=opcodes[0xE4][4]=cpxZp8; - opcodes[0xE4][2]=opcodes[0xE4][3]=cpxZp16; - opcodes[0xEC][0]=opcodes[0xEC][1]=opcodes[0xEC][4]=cpxAbs8; - opcodes[0xEC][2]=opcodes[0xEC][3]=cpxAbs16; - - /*CPY group*/ - opcodes[0xC0][0]=opcodes[0xC0][1]=opcodes[0xC0][4]=cpyImm8; - opcodes[0xC0][2]=opcodes[0xC0][3]=cpyImm16; - opcodes[0xC4][0]=opcodes[0xC4][1]=opcodes[0xC4][4]=cpyZp8; - opcodes[0xC4][2]=opcodes[0xC4][3]=cpyZp16; - opcodes[0xCC][0]=opcodes[0xCC][1]=opcodes[0xCC][4]=cpyAbs8; - opcodes[0xCC][2]=opcodes[0xCC][3]=cpyAbs16; - - /*Branch group*/ - opcodes[0x90][0]=opcodes[0x90][1]=opcodes[0x90][2]= - opcodes[0x90][3]=opcodes[0x90][4]=bcc; - opcodes[0xB0][0]=opcodes[0xB0][1]=opcodes[0xB0][2]= - opcodes[0xB0][3]=opcodes[0xB0][4]=bcs; - opcodes[0xF0][0]=opcodes[0xF0][1]=opcodes[0xF0][2]= - opcodes[0xF0][3]=opcodes[0xF0][4]=beq; - opcodes[0xD0][0]=opcodes[0xD0][1]=opcodes[0xD0][2]= - opcodes[0xD0][3]=opcodes[0xD0][4]=bne; - opcodes[0x80][0]=opcodes[0x80][1]=opcodes[0x80][2]= - opcodes[0x80][3]=opcodes[0x80][4]=bra; - opcodes[0x82][0]=opcodes[0x82][1]=opcodes[0x82][2]= - opcodes[0x82][3]=opcodes[0x82][4]=brl; - opcodes[0x10][0]=opcodes[0x10][1]=opcodes[0x10][2]= - opcodes[0x10][3]=opcodes[0x10][4]=bpl; - opcodes[0x30][0]=opcodes[0x30][1]=opcodes[0x30][2]= - opcodes[0x30][3]=opcodes[0x30][4]=bmi; - opcodes[0x50][0]=opcodes[0x50][1]=opcodes[0x50][2]= - opcodes[0x50][3]=opcodes[0x50][4]=bvc; - opcodes[0x70][0]=opcodes[0x70][1]=opcodes[0x70][2]= - opcodes[0x70][3]=opcodes[0x70][4]=bvs; - - /*Jump group*/ - opcodes[0x4C][0]=opcodes[0x4C][1]=opcodes[0x4C][2]= - opcodes[0x4C][3]=opcodes[0x4C][4]=jmp; - opcodes[0x5C][0]=opcodes[0x5C][1]=opcodes[0x5C][2]= - opcodes[0x5C][3]=opcodes[0x5C][4]=jmplong; - opcodes[0x6C][0]=opcodes[0x6C][1]=opcodes[0x6C][2]= - opcodes[0x6C][3]=opcodes[0x6C][4]=jmpind; - opcodes[0x7C][0]=opcodes[0x7C][1]=opcodes[0x7C][2]= - opcodes[0x7C][3]=opcodes[0x7C][4]=jmpindx; - opcodes[0xDC][0]=opcodes[0xDC][1]=opcodes[0xDC][2]= - opcodes[0xDC][3]=opcodes[0xDC][4]=jmlind; - opcodes[0x20][0]=opcodes[0x20][1]=opcodes[0x20][2]= - opcodes[0x20][3]=jsr; - opcodes[0x20][4]=jsre; - opcodes[0xFC][0]=opcodes[0xFC][1]=opcodes[0xFC][2]= - opcodes[0xFC][3]=jsrIndx; - opcodes[0xFC][4]=jsrIndxe; - opcodes[0x60][0]=opcodes[0x60][1]=opcodes[0x60][2]= - opcodes[0x60][3]=rts; - opcodes[0x60][4]=rtse; - opcodes[0x6B][0]=opcodes[0x6B][1]=opcodes[0x6B][2]= - opcodes[0x6B][3]=rtl; - opcodes[0x6B][4]=rtle; - opcodes[0x40][0]=opcodes[0x40][1]=opcodes[0x40][2]= - opcodes[0x40][3]=rti; - opcodes[0x22][0]=opcodes[0x22][1]=opcodes[0x22][2]= - opcodes[0x22][3]=jsl; - opcodes[0x22][4]=jsle; - - /*Shift group*/ - opcodes[0x0A][0]=opcodes[0x0A][2]=opcodes[0x0A][4]=asla8; - opcodes[0x0A][1]=opcodes[0x0A][3]=asla16; - opcodes[0x06][0]=opcodes[0x06][2]=opcodes[0x06][4]=aslZp8; - opcodes[0x06][1]=opcodes[0x06][3]=aslZp16; - opcodes[0x16][0]=opcodes[0x16][2]=opcodes[0x16][4]=aslZpx8; - opcodes[0x16][1]=opcodes[0x16][3]=aslZpx16; - opcodes[0x0E][0]=opcodes[0x0E][2]=opcodes[0x0E][4]=aslAbs8; - opcodes[0x0E][1]=opcodes[0x0E][3]=aslAbs16; - opcodes[0x1E][0]=opcodes[0x1E][2]=opcodes[0x1E][4]=aslAbsx8; - opcodes[0x1E][1]=opcodes[0x1E][3]=aslAbsx16; - - opcodes[0x4A][0]=opcodes[0x4A][2]=opcodes[0x4A][4]=lsra8; - opcodes[0x4A][1]=opcodes[0x4A][3]=lsra16; - opcodes[0x46][0]=opcodes[0x46][2]=opcodes[0x46][4]=lsrZp8; - opcodes[0x46][1]=opcodes[0x46][3]=lsrZp16; - opcodes[0x56][0]=opcodes[0x56][2]=opcodes[0x56][4]=lsrZpx8; - opcodes[0x56][1]=opcodes[0x56][3]=lsrZpx16; - opcodes[0x4E][0]=opcodes[0x4E][2]=opcodes[0x4E][4]=lsrAbs8; - opcodes[0x4E][1]=opcodes[0x4E][3]=lsrAbs16; - opcodes[0x5E][0]=opcodes[0x5E][2]=opcodes[0x5E][4]=lsrAbsx8; - opcodes[0x5E][1]=opcodes[0x5E][3]=lsrAbsx16; - - opcodes[0x2A][0]=opcodes[0x2A][2]=opcodes[0x2A][4]=rola8; - opcodes[0x2A][1]=opcodes[0x2A][3]=rola16; - opcodes[0x26][0]=opcodes[0x26][2]=opcodes[0x26][4]=rolZp8; - opcodes[0x26][1]=opcodes[0x26][3]=rolZp16; - opcodes[0x36][0]=opcodes[0x36][2]=opcodes[0x36][4]=rolZpx8; - opcodes[0x36][1]=opcodes[0x36][3]=rolZpx16; - opcodes[0x2E][0]=opcodes[0x2E][2]=opcodes[0x2E][4]=rolAbs8; - opcodes[0x2E][1]=opcodes[0x2E][3]=rolAbs16; - opcodes[0x3E][0]=opcodes[0x3E][2]=opcodes[0x3E][4]=rolAbsx8; - opcodes[0x3E][1]=opcodes[0x3E][3]=rolAbsx16; - - opcodes[0x6A][0]=opcodes[0x6A][2]=opcodes[0x6A][4]=rora8; - opcodes[0x6A][1]=opcodes[0x6A][3]=rora16; - opcodes[0x66][0]=opcodes[0x66][2]=opcodes[0x66][4]=rorZp8; - opcodes[0x66][1]=opcodes[0x66][3]=rorZp16; - opcodes[0x76][0]=opcodes[0x76][2]=opcodes[0x76][4]=rorZpx8; - opcodes[0x76][1]=opcodes[0x76][3]=rorZpx16; - opcodes[0x6E][0]=opcodes[0x6E][2]=opcodes[0x6E][4]=rorAbs8; - opcodes[0x6E][1]=opcodes[0x6E][3]=rorAbs16; - opcodes[0x7E][0]=opcodes[0x7E][2]=opcodes[0x7E][4]=rorAbsx8; - opcodes[0x7E][1]=opcodes[0x7E][3]=rorAbsx16; - - /*BIT group*/ - opcodes[0x89][0]=opcodes[0x89][2]=opcodes[0x89][4]=bitImm8; - opcodes[0x89][1]=opcodes[0x89][3]=bitImm16; - opcodes[0x24][0]=opcodes[0x24][2]=opcodes[0x24][4]=bitZp8; - opcodes[0x24][1]=opcodes[0x24][3]=bitZp16; - opcodes[0x34][0]=opcodes[0x34][2]=opcodes[0x34][4]=bitZpx8; - opcodes[0x34][1]=opcodes[0x34][3]=bitZpx16; - opcodes[0x2C][0]=opcodes[0x2C][2]=opcodes[0x2C][4]=bitAbs8; - opcodes[0x2C][1]=opcodes[0x2C][3]=bitAbs16; - opcodes[0x3C][0]=opcodes[0x3C][2]=opcodes[0x3C][4]=bitAbsx8; - opcodes[0x3C][1]=opcodes[0x3C][3]=bitAbsx16; - - /*Misc group*/ - opcodes[0x00][0]=opcodes[0x00][1]=opcodes[0x00][2]= - opcodes[0x00][3]=opcodes[0x00][4]=brk; - opcodes[0xEB][0]=opcodes[0xEB][1]=opcodes[0xEB][2]= - opcodes[0xEB][3]=opcodes[0xEB][4]=xba; - opcodes[0xEA][0]=opcodes[0xEA][1]=opcodes[0xEA][2]= - opcodes[0xEA][3]=opcodes[0xEA][4]=nop; - opcodes[0x5B][0]=opcodes[0x5B][1]=opcodes[0x5B][2]= - opcodes[0x5B][3]=opcodes[0x5B][4]=tcd; - opcodes[0x7B][0]=opcodes[0x7B][1]=opcodes[0x7B][2]= - opcodes[0x7B][3]=opcodes[0x7B][4]=tdc; - opcodes[0x1B][0]=opcodes[0x1B][1]=opcodes[0x1B][2]= - opcodes[0x1B][3]=opcodes[0x1B][4]=tcs; - opcodes[0x3B][0]=opcodes[0x3B][1]=opcodes[0x3B][2]= - opcodes[0x3B][3]=opcodes[0x3B][4]=tsc; - opcodes[0xCB][0]=opcodes[0xCB][1]=opcodes[0xCB][2]= - opcodes[0xCB][3]=opcodes[0xCB][4]=wai; - opcodes[0x44][0]=opcodes[0x44][1]=opcodes[0x44][2]= - opcodes[0x44][3]=opcodes[0x44][4]=mvp; - opcodes[0x54][0]=opcodes[0x54][1]=opcodes[0x54][2]= - opcodes[0x54][3]=opcodes[0x54][4]=mvn; - opcodes[0x04][0]=opcodes[0x04][2]=opcodes[0x04][4]=tsbZp8; - opcodes[0x04][1]=opcodes[0x04][3]=tsbZp16; - opcodes[0x0C][0]=opcodes[0x0C][2]=opcodes[0x0C][4]=tsbAbs8; - opcodes[0x0C][1]=opcodes[0x0C][3]=tsbAbs16; - opcodes[0x14][0]=opcodes[0x14][2]=opcodes[0x14][4]=trbZp8; - opcodes[0x14][1]=opcodes[0x14][3]=trbZp16; - opcodes[0x1C][0]=opcodes[0x1C][2]=opcodes[0x1C][4]=trbAbs8; - opcodes[0x1C][1]=opcodes[0x1C][3]=trbAbs16; -} - -void updatecpumode() -{ - if (p.e) - { - cpumode=4; - x.b.h=y.b.h=0; - } - else - { - cpumode=0; - if (!p.m) cpumode|=1; - if (!p.x) cpumode|=2; - if (p.x) x.b.h=y.b.h=0; - } -} - -void nmi65816() -{ - unsigned char temp=0; - // printf("NMI %i %i %i\n",p.i,inwai,irqenable); - snes_readmem(pbr|pc); - cycles-=6; - clockspc(6); - if (inwai) - { - pc++; - } - inwai=0; - if (!p.e) - { - // //printf("%02X -> %04X\n",pbr>>16,s.w); - snes_writemem(s.w,pbr>>16); s.w--; - // //printf("%02X -> %04X\n",pc>>8,s.w); - snes_writemem(s.w,pc>>8); s.w--; - // //printf("%02X -> %04X\n",pc&0xFF,s.w); - snes_writemem(s.w,pc&0xFF); s.w--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.x) temp|=0x10; - if (p.m) temp|=0x20; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - // //printf("%02X -> %04X\n",temp,s.w); - snes_writemem(s.w,temp); s.w--; - pc=readmemw(0xFFEA); - pbr=0; - p.i=1; - p.d=0; - // printf("NMI\n"); - } - else - { - //snemlog(L"Emulation mode NMI\n"); - } -} - -void irq65816() -{ - unsigned char temp=0; - // printf("IRQ %i %i %i\n",p.i,inwai,irqenable); - snes_readmem(pbr|pc); - cycles-=6; clockspc(6); - if (inwai && p.i) - { - pc++; - inwai=0; - return; - } - if (inwai) pc++; - inwai=0; - if (!p.e) - { - snes_writemem(s.w,pbr>>16); s.w--; - snes_writemem(s.w,pc>>8); s.w--; - snes_writemem(s.w,pc&0xFF); s.w--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.x) temp|=0x10; - if (p.m) temp|=0x20; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - snes_writemem(s.w,temp); s.w--; - pc=readmemw(0xFFEE); - pbr=0; - p.i=1; - p.d=0; - // printf("IRQ\n"); - } - else - { - //snemlog(L"Emulation mode IRQ\n"); - } -} diff --git a/jan/src/burn/drv/snes/snes_io.cpp b/jan/src/burn/drv/snes/snes_io.cpp deleted file mode 100644 index 8443740a5..000000000 --- a/jan/src/burn/drv/snes/snes_io.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/*Snem 0.1 by Tom Walker -I/O, or $42xx*/ - -#include "snes.h" - -extern int intthisline; -int dmaops=0; -extern int framenum; -extern int oldnmi; - -int padpos,padstat; -unsigned short pad[4]; - -void readjoy() -{ - pad[0]=0; - if (SnesJoy1[6]) - pad[0]|=0x8000; - if (SnesJoy1[4]) - pad[0]|=0x4000; - if (SnesJoy1[11]) - pad[0]|=0x2000; - if (SnesJoy1[7]) - pad[0]|=0x1000; - if (SnesJoy1[0]) - pad[0]|=0x0800; - if (SnesJoy1[1]) - pad[0]|=0x0400; - if (SnesJoy1[2]) - pad[0]|=0x0200; - if (SnesJoy1[3]) - pad[0]|=0x0100; - if (SnesJoy1[5]) - pad[0]|=0x0080; - if (SnesJoy1[10]) - pad[0]|=0x0040; - if (SnesJoy1[9]) - pad[0]|=0x0020; - if (SnesJoy1[8]) - pad[0]|=0x0010; - padpos=16; - // printf("Read joy\n"); -} - -unsigned char readjoyold(unsigned short addr) -{ - int temp; - if (addr==0x4016) - { - temp=pad[0]>>(padpos^15); - if (!(padstat&1)) padpos++; - if (padpos>15) temp=1; - // printf("Read 4016 %i %i %02X %06X\n",temp&1,padpos,padstat,pbr|pc); - return temp&1; - } - return 0xFF; -} - -void writejoyold(unsigned short addr, unsigned char val) -{ - if (addr==0x4016) - { - // printf("Write 4016 %02X\n",val); - if ((val&1) && !(padstat&1)) padpos=0; - padstat=val; - } -} - -unsigned short mulr,divc,divr; -unsigned char mula,mulb,divb; - -void writeio(unsigned short addr, unsigned char val) -{ - int c,d=0,offset=0,speed; - unsigned char temp; - switch (addr&0x1FF) - { - case 0x00: - nmienable=val&0x80; - irqenable=(val>>4)&3; - if (!irqenable) - { - irq=0; - } - break; - case 0x02: /*Multiplicand A*/ - mula=val; - return; - case 0x03: /*Multiplier B*/ - mulb=val; - mulr=mula*mulb; - return; - case 0x04: /*Dividend C Low*/ - divc&=0xFF00; - divc|=val; - return; - case 0x05: /*Dividend C High*/ - divc&=0xFF; - divc|=(val<<8); - return; - case 0x06: /*Divisor B*/ - divb=val; - if (divb) - { - divr=divc/divb; - mulr=divc%divb; - } - else - { - divr=0xFFFF; - mulr=divc; - } - return; - case 0x07: /*X low*/ - xirq=(xirq&0x100)|val; - intthisline=0; - break; - case 0x08: /*X high*/ - xirq=(xirq&0xFF)|(val&0x100); - intthisline=0; - break; - case 0x09: /*Y low*/ - yirq=(yirq&0x100)|val; - break; - case 0x0A: /*Y high*/ - yirq=(yirq&0xFF)|(val&0x100); - break; - case 0x0B: /*DMA enable*/ - for (c=1;c<0x100;c<<=1) - { - if (val&c) - { - /* if (getvramaddr()==0xB000) - { - dmaops++; - if (dmaops==3) return; - }*/ - // if (!dmalen[d]) printf("DMA %i ctrl %02X src %06X dest %02X size %04X %i\n",d,dmactrl[d],(dmabank[d]<<16)|dmasrc[d],dmadest[d],dmalen[d],dmaops); - do - { - if (dmactrl[d]&0x80) - { - // printf("Dest %04X+%04X SRC %06X %04X\n",dmadest[d],offset,dmabank[d],dmasrc[d]); - temp=readppu(dmadest[d]+offset); - snes_writemem((dmabank[d]<<16)|dmasrc[d],temp); - } - else - { - temp=snes_readmem((dmabank[d]<<16)|dmasrc[d]); - // if (dmabank[d]==0 && dmasrc[d]<0x2000) printf("%02X %06X %04X\n",temp,dmabank[d]|dmasrc[d],dmalen[d]); - writeppu(dmadest[d]+offset,temp); - } - if (!(dmactrl[d]&8)) - { - if (dmactrl[d]&0x10) dmasrc[d]--; - else dmasrc[d]++; - } - switch (dmactrl[d]&7) - { - case 0: /*1 address write twice*/ - case 2: /*1 address write once*/ - break; - case 1: /*2 addresses*/ - offset++; - offset&=1; - break; - - default: - break; - } - dmalen[d]--; - - } while (dmalen[d]!=0); - } - d++; - } - break; - case 0x0C: /*HDMA enable*/ - hdmaena=val; - // printf("HDMA ena : %02X %06X %i %i\n",val,pbr|pc,framenum,lines); - break; - case 0x0D: /*ROM speed select*/ - if (val&1) speed=6; - else speed=8; - for (c=192;c<256;c++) - { - for (d=0;d<8;d++) - { - accessspeed[(c<<3)|d]=speed; - } - } - for (c=128;c<192;c++) - { - accessspeed[(c<<3)|4]=accessspeed[(c<<3)|5]=speed; - accessspeed[(c<<3)|6]=accessspeed[(c<<3)|7]=speed; - } - break; - case 0x100: case 0x110: case 0x120: case 0x130: /*DMA control*/ - case 0x140: case 0x150: case 0x160: case 0x170: - dmactrl[(addr>>4)&7]=val; - // printf("Write ctrl %i %02X %06X\n",(addr>>4)&7,val,pbr|pc); - break; - case 0x101: case 0x111: case 0x121: case 0x131: /*DMA dest*/ - case 0x141: case 0x151: case 0x161: case 0x171: - dmadest[(addr>>4)&7]=val|0x2100; - break; - case 0x102: case 0x112: case 0x122: case 0x132: /*DMA src low*/ - case 0x142: case 0x152: case 0x162: case 0x172: - dmasrc[(addr>>4)&7]=(dmasrc[(addr>>4)&7]&0xFF00)|val; - break; - case 0x103: case 0x113: case 0x123: case 0x133: /*DMA src high*/ - case 0x143: case 0x153: case 0x163: case 0x173: - dmasrc[(addr>>4)&7]=(dmasrc[(addr>>4)&7]&0xFF)|(val<<8); - break; - case 0x104: case 0x114: case 0x124: case 0x134: /*DMA src bank*/ - case 0x144: case 0x154: case 0x164: case 0x174: - dmabank[(addr>>4)&7]=val; - break; - case 0x105: case 0x115: case 0x125: case 0x135: /*DMA size low*/ - case 0x145: case 0x155: case 0x165: case 0x175: - dmalen[(addr>>4)&7]=(dmalen[(addr>>4)&7]&0xFF00)|val; - break; - case 0x106: case 0x116: case 0x126: case 0x136: /*DMA size high*/ - case 0x146: case 0x156: case 0x166: case 0x176: - dmalen[(addr>>4)&7]=(dmalen[(addr>>4)&7]&0xFF)|(val<<8); - break; - case 0x107: case 0x117: case 0x127: case 0x137: /*HDMA ibank*/ - case 0x147: case 0x157: case 0x167: case 0x177: - dmaibank[(addr>>4)&7]=val; - break; - case 0x108: case 0x118: case 0x128: case 0x138: - case 0x148: case 0x158: case 0x168: case 0x178: - hdmaaddr[(addr>>4)&7]=(hdmaaddr[(addr>>4)&7]&0xFF00)|val; - // printf("HDMA addr %i now %04X %06X\n",(addr>>4)&7,hdmaaddr[(addr>>4)&7],pbr|pc); - break; - case 0x109: case 0x119: case 0x129: case 0x139: - case 0x149: case 0x159: case 0x169: case 0x179: - hdmaaddr[(addr>>4)&7]=(hdmaaddr[(addr>>4)&7]&0xFF)|(val<<8); - // printf("HDMA addr %i now %04X %06X\n",(addr>>4)&7,hdmaaddr[(addr>>4)&7],pbr|pc); - break; - case 0x10A: case 0x11A: case 0x12A: case 0x13A: /*HDMA lines left*/ - case 0x14A: case 0x15A: case 0x16A: case 0x17A: - hdmacount[(addr>>4)&7]=val; - break; - } -} - -unsigned char readio(unsigned short addr) -{ - int temp=0; - if (addr==0x4016 || addr==0x4017) - { - // printf("Read oldstyle joypad\n"); - // dumpregs(); - // exit(-1); - } - // if (addr!=0x4218 && addr!=0x4219) snemlog("Read IO %04X %02X:%04X %04X\n",addr,pbr>>16,pc,dp); - switch (addr&0x1FF) - { - case 0: - return 0; - - case 0xB: /*DMA enable*/ - return 0; - case 0x0C: /*HDMA enable*/ - return hdmaena; - - case 0x10: /*NMI*/ - if (nmi) temp=0x80; - nmi=oldnmi=0; - return temp; - - case 0x11: /*IRQ*/ - if (irq) temp=0x80; - irq=0; - return temp; - - case 0x12: /*VBL*/ - if (vbl) temp|=0x80; - if (joyscan) temp|=1; - if (cycles<340) temp|=0x40; /*340=1364-(256 pixels * 4)*/ - return temp; - - case 0x13: /*I/O port*/ - return 0; - - case 0x14: /*Division Result Low*/ - // printf("Read div low\n"); - return divr; - case 0x15: /*Division Result High*/ - // printf("Read div high\n"); - return divr>>8; - case 0x16: /*Multiplication Result Low*/ - // printf("Read mul low\n"); - return mulr; - case 0x17: /*Multiplication Result High*/ - // printf("Read mul high\n"); - return mulr>>8; - - case 0x18: /*Joypad #1*/ - // printf("Read joy low %02X %06X %i\n",pad[0]>>8,pbr|pc,ins); - return pad[0]&0xFF; - case 0x19: - // printf("Read joy high %02X %06X\n",pad[0]&0xFF,pbr|pc); - return pad[0]>>8; - - case 0x1A: case 0x1B: /*Joypad #2*/ - case 0x1C: case 0x1D: /*Joypad #3*/ - case 0x1E: case 0x1F: /*Joypad #4*/ - return 0; - - case 0x100: case 0x110: case 0x120: case 0x130: /*DMA control*/ - case 0x140: case 0x150: case 0x160: case 0x170: - return dmactrl[(addr>>4)&7]; - break; - case 0x101: case 0x111: case 0x121: case 0x131: /*DMA dest*/ - case 0x141: case 0x151: case 0x161: case 0x171: - return dmadest[(addr>>4)&7]&0xFF; - break; - case 0x102: case 0x112: case 0x122: case 0x132: /*DMA src low*/ - case 0x142: case 0x152: case 0x162: case 0x172: - return dmasrc[(addr>>4)&7]&0xFF; - break; - case 0x103: case 0x113: case 0x123: case 0x133: /*DMA src high*/ - case 0x143: case 0x153: case 0x163: case 0x173: - return dmasrc[(addr>>4)&7]>>8; - break; - case 0x104: case 0x114: case 0x124: case 0x134: /*DMA src bank*/ - case 0x144: case 0x154: case 0x164: case 0x174: - return dmabank[(addr>>4)&7]; - break; - case 0x105: case 0x115: case 0x125: case 0x135: /*DMA size low*/ - case 0x145: case 0x155: case 0x165: case 0x175: - return dmalen[(addr>>4)&7]&0xFF; - break; - case 0x106: case 0x116: case 0x126: case 0x136: /*DMA size high*/ - case 0x146: case 0x156: case 0x166: case 0x176: - return dmalen[(addr>>4)&7]>>8; - break; - case 0x107: case 0x117: case 0x127: case 0x137: /*HDMA indirect bank*/ - case 0x147: case 0x157: case 0x167: case 0x177: - return dmaibank[(addr>>4)&7];//>>8; - break; - - default: - return 0; - } -} - diff --git a/jan/src/burn/drv/snes/snes_main.cpp b/jan/src/burn/drv/snes/snes_main.cpp deleted file mode 100644 index 1c49b4734..000000000 --- a/jan/src/burn/drv/snes/snes_main.cpp +++ /dev/null @@ -1,479 +0,0 @@ -#include -#include "snes.h" - -static INT32 frames; -INT32 intthisline; -INT32 framenum; -INT32 oldnmi=0; -INT32 spcclck; -double spcclck2,spcclck3; - -extern int pal; -UINT16 srammask=0; - - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; - -UINT8 *SNES_sram; -UINT8 *SNES_ram; -UINT8 *SNES_rom; -UINT8 *memlookup[2048]; -UINT8 *memread; -UINT8 *memwrite; -UINT8 *accessspeed; -INT32 lorom; - - -static INT32 MemIndex(UINT32 cart_size) -{ - UINT8 *Next; Next = AllMem; - - SNES_rom = Next; Next += cart_size; - // Technically these are not ram but need to be saved with machine state but not reset with machine - memread = Next; Next += 0x800; - memwrite = Next; Next += 0x800; - accessspeed = Next; Next += 0x800; - AllRam = Next; - // but these really are ram - SNES_ram = Next; Next += 0x20000; - SNES_sram = Next; Next += 0x2000; - RamEnd = Next; - MemEnd = Next; - - return 0; -} - - - - -void __cdecl snemlog(TCHAR *format,...) -{ - bprintf(0,format); -} - -void snes_mapmem() -{ - - int c,d; - for (c=0;c<0x800;c++) - { - memread[c]=0; - memwrite[c]=0; - } - if (lorom) - { - for (c=0;c<96;c++) - { - for (d=0;d<4;d++) - { - memread[(c<<3)|(d+4)]=1; - memlookup[(c<<3)|(d+4)]=&SNES_rom[((d*0x2000)+(c*0x8000))&0x3FFFFF]; - memread[(c<<3)|(d+4)|0x400]=1; - memlookup[(c<<3)|(d+4)|0x400]=&SNES_rom[((d*0x2000)+(c*0x8000))&0x3FFFFF]; - - } - - } - - for (c=0;c<64;c++) - { - memread[(c<<3)|0]=memwrite[(c<<3)|0]=1; - memlookup[(c<<3)|0]=SNES_ram; - } - - for (c=0;c<64;c++) - { - memread[(c<<3)|0x400]=memwrite[(c<<3)|0x400]=1; - memlookup[(c<<3)|0x400]=SNES_ram; - } - - for (c=0;c<8;c++) - { - memread[(0x7E<<3)|c]=memwrite[(0x7E<<3)|c]=1; - memlookup[(0x7E<<3)|c]=&SNES_ram[c*0x2000]; - memread[(0x7F<<3)|c]=memwrite[(0x7F<<3)|c]=1; - memlookup[(0x7F<<3)|c]=&SNES_ram[(c*0x2000)+0x10000]; - } - - } - else - { - for (c=0;c<2048;c++) - { - memread[c]=1; - memwrite[c]=0; - memlookup[c]=&SNES_rom[(c*0x2000)&0x3FFFFF]; - } - for (c=0;c<64;c++) - { - for (d=1;d<4;d++) - { - memread[(c<<3)+d]=memwrite[(c<<3)+d]=0; - memread[(c<<3)+d+1024]=memwrite[(c<<3)+d+1024]=0; - } - } - for (c=0;c<64;c++) - { - memread[(c<<3)|0]=memwrite[(c<<3)|0]=1; - memlookup[(c<<3)|0]=SNES_ram; - memread[(c<<3)|1024]=memwrite[(c<<3)|1024]=1; - memlookup[(c<<3)|1024]=SNES_ram; - } - for (c=0;c<8;c++) - { - memread[(0x7E<<3)|c]=memwrite[(0x7E<<3)|c]=1; - memlookup[(0x7E<<3)|c]=&SNES_ram[c*0x2000]; - memread[(0x7F<<3)|c]=memwrite[(0x7F<<3)|c]=1; - memlookup[(0x7F<<3)|c]=&SNES_ram[(c*0x2000)+0x10000]; - } - for (c=0;c<16;c++) - { - memread[(0x70<<3)+c]=memwrite[(0x70<<3)+c]=1; - memlookup[(0x70<<3)+c]=SNES_sram; - } - } - /*Set up access speed table*/ - for (c=0;c<64;c++) - { - accessspeed[(c<<3)|0]=8; - accessspeed[(c<<3)|1]=6; - accessspeed[(c<<3)|2]=6; - accessspeed[(c<<3)|3]=6; - accessspeed[(c<<3)|4]=accessspeed[(c<<3)|5]=8; - accessspeed[(c<<3)|6]=accessspeed[(c<<3)|7]=8; - } - for (c=64;c<128;c++) - { - for (d=0;d<8;d++) - { - accessspeed[(c<<3)|d]=8; - } - } - for (c=128;c<192;c++) - { - accessspeed[(c<<3)|0]=8; - accessspeed[(c<<3)|1]=6; - accessspeed[(c<<3)|2]=6; - accessspeed[(c<<3)|3]=6; - accessspeed[(c<<3)|4]=accessspeed[(c<<3)|5]=8; - accessspeed[(c<<3)|6]=accessspeed[(c<<3)|7]=8; - } - for (c=192;c<256;c++) - { - for (d=0;d<8;d++) - { - accessspeed[(c<<3)|d]=8; - } - } -} - -unsigned char snes_readmem(unsigned long addr) -{ - cycles-=accessspeed[(addr>>13)&0x7FF]; - clockspc(accessspeed[(addr>>13)&0x7FF]); - if (memread[(addr>>13)&0x7FF]) - { - return memlookup[(addr>>13)&0x7FF][addr&0x1FFF]; - } - - addr&=~0xFF000000; - - if (((addr>>16)&0x7F)<0x40) - { - switch (addr&0xF000) - { - case 0x2000: - return readppu(addr); - case 0x4000: - if ((addr&0xE00)==0x200) - { - return readio(addr); - } - if ((addr&0xFFFE)==0x4016) - { - return readjoyold(addr); - } - //snemlog(L"Bad Read %06X\n",addr); - return 0; - case 0x6000: - case 0x7000: - if (!lorom) - { - return SNES_sram[addr&srammask]; - } - default: - //snemlog(L"Bad read %06X\n",addr); - return 0xFF; - } - } - - if ((addr>>16)>=0xD0 && (addr>>16)<=0xFE) - { - return 0; - } - - if ((addr>>16)==0x70) - { - if (srammask) - { - return SNES_sram[addr&srammask]; - } - return 0; - } - - if ((addr>>16)==0x60) - { - return 0; - } - - //snemlog(L"Bad read %06X\n",addr); - - return 0xff; -} - -void snes_writemem(unsigned long addr, unsigned char val) -{ - cycles-=accessspeed[(addr>>13)&0x7FF]; - clockspc(accessspeed[(addr>>13)&0x7FF]); - if (memwrite[(addr>>13)&0x7FF]) - { - memlookup[(addr>>13)&0x7FF][(addr)&0x1FFF]=val; - return; - } - - addr&=~0xFF000000; - if (((addr>>16)&0x7F)<0x40) - { - switch (addr&0xF000) - { - - case 0x2000: - writeppu(addr,val); - return; - - case 0x3000: - return; - - case 0x4000: - if ((addr&0xE00)==0x200) - writeio(addr,val); - if ((addr&0xFFFE)==0x4016) - writejoyold(addr,val); - return; - - case 0x5000: - return; - - case 0x6000: - case 0x7000: - if (!lorom) - { - SNES_sram[addr&srammask]=val; - } - return; - case 0x8000: - case 0x9000: - case 0xA000: - case 0xB000: - case 0xC000: - case 0xD000: - case 0xE000: - case 0xF000: - return; - default: - break; - //snemlog(L"Bad write %06X %02X\n",addr,val); - - } - } - - if ((addr>>16)>=0xD0 && (addr>>16)<=0xFE) - { - return; - } - - if ((addr>>16)==0x70) - { - SNES_sram[addr&srammask]=val; - return; - } -} - - -void SnesReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - resetppu(); - resetspc(); - reset65816(); - frames=0; -} - -INT32 SnesInit() -{ - INT32 nret = 0; - - UINT16 temp,temp2; - - struct BurnRomInfo ri; - BurnDrvGetRomInfo(&ri, 0); - UINT32 length = ri.nLen; - - AllMem = NULL; - MemIndex(length); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(length); - - initppu(); - initspc(); - makeopcodetable(); - - SnesReset(); - - spccycles=-10000; - - - BurnLoadRom(SNES_rom,0,0); - - - temp=SNES_rom[0x7FDC]|(SNES_rom[0x7FDD]<<8); - temp2=SNES_rom[0x7FDE]|(SNES_rom[0x7FDF]<<8); - if ((temp|temp2)==0xFFFF) - { - lorom=1; - } - else - { - lorom=0; - } - - snes_mapmem(); - - if (((snes_readmem(0xFFFD)<<8)|snes_readmem(0xFFFC))==0xFFFF) - { - lorom^=1; - snes_mapmem(); - } - - srammask=(1<<(snes_readmem(0xFFD8)+10))-1; - - if (!snes_readmem(0xFFD8)) - { - srammask=0; - } - - if (snes_readmem(0xFFD9)>1) - { - global_pal=1; - } - else - { - global_pal=0; - } - - if (srammask) - { - memset(SNES_sram,0,srammask+1); - } - - memset(SNES_ram,0x55,128*1024); - - SnesReset(); - - return nret; -} - -INT32 SnesExit() -{ - for (int i=0;i<2048;i++) - { - memlookup[i]=NULL; - } - exitspc(); - BurnFree (AllMem); - return 0; -} - -INT32 SnesFrame() -{ - if (DoSnesReset) - { - SnesReset(); - } - - nmi=vbl=0; - framenum++; - if (framenum==50) - { - spcclck=spctotal; - spcclck2=spctotal2; - spcclck3=spctotal3; - spctotal=0; - spctotal2=0.0f; - spctotal3=0.0f; - } - for (lines=0;lines<((global_pal)?312:262);lines++) - { - // snemlog("%i %02X:%04X %i %i %i\n",lines,pbr>>16,pc,irqenable,xirq,yirq); - if ((irqenable==2/* || irqenable==1*/) && (lines==yirq)) - { - irq=1; - /*snemlog("Raise IRQ line %i %02X\n",lines,lines);*/ - } - if (lines<225) - { - drawline(lines); - } - cycles+=1364; - intthisline=0; - while (cycles>0) - { - global_opcode=snes_readmem(pbr|pc); - pc++; - opcodes[global_opcode ][cpumode](); - if ((((irqenable==3) && (lines==yirq)) || (irqenable==1)) && !intthisline) - { - if (((1364-cycles)>>2)>=xirq) - { - irq=1; - intthisline=1; - // snemlog("Raise IRQ horiz %i %i\n",lines,irqenable); - } - } - ins++; - if (oldnmi!=nmi && nmienable && nmi) - { - nmi65816(); - } - else if (irq && (!p.i || inwai)) - { - irq65816(); - } - oldnmi=nmi; - } - if (lines==0xE0) - { - nmi=1; - vbl=joyscan=1; - readjoy(); - } - if (lines==0xE3) - { - joyscan=0; - } - - } - frames++; - - return 0; -} - -INT32 SnesScan(INT32,INT32 *) -{ - return 0; -} diff --git a/jan/src/burn/drv/snes/snes_ppu.cpp b/jan/src/burn/drv/snes/snes_ppu.cpp deleted file mode 100644 index 67fa5a33a..000000000 --- a/jan/src/burn/drv/snes/snes_ppu.cpp +++ /dev/null @@ -1,2708 +0,0 @@ -/* -Snem 0.1 by Tom Walker -PPU emulation -*/ -#include -#include "snes.h" - - -#define SNES_INLINE - -#define uint unsigned int -#define uint16 unsigned short -#define uint32 unsigned int - - -int nmi,vbl,joyscan; -int nmienable; - -int yirq,xirq,irqenable,irq; -int lines; - - -int global_pal; - -/*DMA registers*/ -unsigned short dmadest[8],dmasrc[8],dmalen[8]; -unsigned long hdmaaddr[8],hdmaaddr2[8]; -unsigned char dmabank[8],dmaibank[8],dmactrl[8],hdmastat[8],hdmadat[8]; -int hdmacount[8]; -unsigned char hdmaena; - - -/* layers */ -enum -{ - SNES_BG1 = 0, - SNES_BG2, - SNES_BG3, - SNES_BG4, - SNES_OAM, - SNES_COLOR -}; - -/* offset-per-tile modes */ -enum -{ - SNES_OPT_NONE = 0, - SNES_OPT_MODE2, - SNES_OPT_MODE4, - SNES_OPT_MODE6 -}; - -struct SNES_PPU_STRUCT /* once all the regs are saved in this structure, it would be better to reorganize it a bit... */ -{ - struct - { - /* clipmasks */ - UINT8 window1_enabled, window1_invert; - UINT8 window2_enabled, window2_invert; - UINT8 wlog_mask; - /* color math enabled */ - UINT8 color_math; - - UINT8 charmap; - UINT8 tilemap; - UINT8 tilemap_size; - - UINT8 tile_size; - UINT8 mosaic_enabled; // actually used only for layers 0->3! - - UINT8 main_window_enabled; - UINT8 sub_window_enabled; - UINT8 main_bg_enabled; - UINT8 sub_bg_enabled; - - UINT16 hoffs; - UINT16 voffs; - } layer[6]; // this is for the BG1 - BG2 - BG3 - BG4 - OBJ - color layers - - struct - { - UINT8 address_low; - UINT8 address_high; - UINT8 saved_address_low; - UINT8 saved_address_high; - UINT16 address; - UINT16 priority_rotation; - UINT8 next_charmap; - UINT8 next_size; - UINT8 size_; - UINT8 size[2]; - UINT32 next_name_select; - UINT32 name_select; - UINT8 first_sprite; - UINT8 flip; - UINT16 write_latch; - } oam; - - struct - { - UINT16 horizontal[4]; - UINT16 vertical[4]; - } bgd_offset; - - struct - { - UINT16 latch_horz; - UINT16 latch_vert; - UINT16 current_horz; - UINT16 current_vert; - UINT8 last_visible_line; - UINT8 interlace_count; - } beam; - - struct - { - UINT8 repeat; - UINT8 hflip; - UINT8 vflip; - INT16 matrix_a; - INT16 matrix_b; - INT16 matrix_c; - INT16 matrix_d; - INT16 origin_x; - INT16 origin_y; - UINT16 hor_offset; - UINT16 ver_offset; - UINT8 extbg; - } mode7; - - UINT8 mosaic_size; - UINT8 clip_to_black; - UINT8 prevent_color_math; - UINT8 sub_add_mode; - UINT8 bg3_priority_bit; - UINT8 direct_color; - UINT8 ppu_last_scroll; /* as per Anomie's doc and Theme Park, all scroll regs shares (but mode 7 ones) the same - 'previous' scroll value */ - UINT8 mode7_last_scroll; /* as per Anomie's doc mode 7 scroll regs use a different value, shared with mode 7 matrix! */ - - UINT8 ppu1_open_bus, ppu2_open_bus; - UINT8 ppu1_version, ppu2_version; - UINT8 window1_left, window1_right, window2_left, window2_right; - - UINT16 mosaic_table[16][4096]; - UINT8 clipmasks[6][SNES_SCR_WIDTH]; - UINT8 update_windows; - UINT8 update_offsets; - UINT8 update_oam_list; - UINT8 mode; - UINT8 interlace; //doubles the visible resolution - UINT8 obj_interlace; - UINT8 screen_brightness; - UINT8 screen_disabled; - UINT8 pseudo_hires; - UINT8 color_modes; - UINT8 stat77_flags; -}; - - -static UINT16 cgram_address =0; /* CGRAM address */ -static UINT8 vram_read_offset=2; /* VRAM read offset */ - - -static UINT16 vram_fgr_high, vram_fgr_increment, vram_fgr_count, vram_fgr_mask, vram_fgr_shift, vram_read_buffer; -static const UINT16 vram_fgr_inctab[4] = { 1, 32, 128, 128 }; -static const UINT16 vram_fgr_inccnts[4] = { 0, 32, 64, 128 }; -static const UINT16 vram_fgr_shiftab[4] = { 0, 5, 6, 7 }; - -#define SNES_MAINSCREEN 0 -#define SNES_SUBSCREEN 1 -#define SNES_CLIP_NEVER 0 -#define SNES_CLIP_IN 1 -#define SNES_CLIP_OUT 2 -#define SNES_CLIP_ALWAYS 3 - - - -static const UINT16 table_obj_offset[8][8] = -{ - { (0*32), (0*32)+32, (0*32)+64, (0*32)+96, (0*32)+128, (0*32)+160, (0*32)+192, (0*32)+224 }, - { (16*32), (16*32)+32, (16*32)+64, (16*32)+96, (16*32)+128, (16*32)+160, (16*32)+192, (16*32)+224 }, - { (32*32), (32*32)+32, (32*32)+64, (32*32)+96, (32*32)+128, (32*32)+160, (32*32)+192, (32*32)+224 }, - { (48*32), (48*32)+32, (48*32)+64, (48*32)+96, (48*32)+128, (48*32)+160, (48*32)+192, (48*32)+224 }, - { (64*32), (64*32)+32, (64*32)+64, (64*32)+96, (64*32)+128, (64*32)+160, (64*32)+192, (64*32)+224 }, - { (80*32), (80*32)+32, (80*32)+64, (80*32)+96, (80*32)+128, (80*32)+160, (80*32)+192, (80*32)+224 }, - { (96*32), (96*32)+32, (96*32)+64, (96*32)+96, (96*32)+128, (96*32)+160, (96*32)+192, (96*32)+224 }, - { (112*32), (112*32)+32, (112*32)+64, (112*32)+96, (112*32)+128, (112*32)+160, (112*32)+192, (112*32)+224 } -}; - -struct SCANLINE -{ - int enable, clip; - - UINT16 buffer[SNES_SCR_WIDTH]; - UINT8 priority[SNES_SCR_WIDTH]; - UINT8 layer[SNES_SCR_WIDTH]; - UINT8 blend_exception[SNES_SCR_WIDTH]; -}; - -UINT16 snes_cgram[SNES_CGRAM_SIZE]; -UINT16 snes_oam[SNES_OAM_SIZE]; -UINT8 snes_vram[SNES_VRAM_SIZE]; -static UINT16 snes_ram[0x4000]; -static struct SCANLINE scanlines[2]; -struct SNES_PPU_STRUCT snes_ppu; - -enum -{ - SNES_COLOR_DEPTH_2BPP = 0, - SNES_COLOR_DEPTH_4BPP, - SNES_COLOR_DEPTH_8BPP -}; - - - -/***************************************** -* snes_draw_blend() -* -* Routine for additive/subtractive blending -* between the main and sub screens. -*****************************************/ - -SNES_INLINE void snes_draw_blend( UINT16 offset, UINT16 *colour, UINT8 prevent_color_math, UINT8 black_pen_clip, int switch_screens ) -{ - /* when color math is applied to subscreen pixels, the blending depends on the blending used by the previous mainscreen - pixel, except for subscreen pixel 0 which has no previous mainscreen pixel, see comments in snes_refresh_scanline */ - if (switch_screens && offset > 0) - offset -= 1; - - if ((black_pen_clip == SNES_CLIP_ALWAYS) || - (black_pen_clip == SNES_CLIP_IN && snes_ppu.clipmasks[SNES_COLOR][offset]) || - (black_pen_clip == SNES_CLIP_OUT && !snes_ppu.clipmasks[SNES_COLOR][offset])) - *colour = 0; //clip to black before color math - - if (prevent_color_math == SNES_CLIP_ALWAYS) // blending mode 3 == always OFF - return; - -#ifdef SNES_LAYER_DEBUG - if (!debug_options.transparency_disabled) -#endif /* SNES_LAYER_DEBUG */ - if ((prevent_color_math == SNES_CLIP_NEVER) || - (prevent_color_math == SNES_CLIP_IN && !snes_ppu.clipmasks[SNES_COLOR][offset]) || - (prevent_color_math == SNES_CLIP_OUT && snes_ppu.clipmasks[SNES_COLOR][offset])) - { - UINT16 r, g, b; - struct SCANLINE *subscreen; - int clip_max = 0; // if add then clip to 0x1f, if sub then clip to 0 - -#ifdef SNES_LAYER_DEBUG - /* Toggle drawing of SNES_SUBSCREEN or SNES_MAINSCREEN */ - if (debug_options.draw_subscreen) - { - subscreen = switch_screens ? &scanlines[SNES_SUBSCREEN] : &scanlines[SNES_MAINSCREEN]; - } - else -#endif /* SNES_LAYER_DEBUG */ - { - subscreen = switch_screens ? &scanlines[SNES_MAINSCREEN] : &scanlines[SNES_SUBSCREEN]; - } - - if (snes_ppu.sub_add_mode) /* SNES_SUBSCREEN*/ - { - if (!BIT(snes_ppu.color_modes, 7)) - { - /* 0x00 add */ - r = (*colour & 0x1f) + (subscreen->buffer[offset] & 0x1f); - g = ((*colour & 0x3e0) >> 5) + ((subscreen->buffer[offset] & 0x3e0) >> 5); - b = ((*colour & 0x7c00) >> 10) + ((subscreen->buffer[offset] & 0x7c00) >> 10); - clip_max = 1; - } - else - { - /* 0x80 sub */ - r = (*colour & 0x1f) - (subscreen->buffer[offset] & 0x1f); - g = ((*colour & 0x3e0) >> 5) - ((subscreen->buffer[offset] & 0x3e0) >> 5); - b = ((*colour & 0x7c00) >> 10) - ((subscreen->buffer[offset] & 0x7c00) >> 10); - if (r > 0x1f) r = 0; - if (g > 0x1f) g = 0; - if (b > 0x1f) b = 0; - } - /* only halve if the color is not the back colour */ - if (BIT(snes_ppu.color_modes, 6) && (subscreen->buffer[offset] != snes_cgram[FIXED_COLOUR])) - { - r >>= 1; - g >>= 1; - b >>= 1; - } - } - else /* Fixed colour */ - { - if (!BIT(snes_ppu.color_modes, 7)) - { - /* 0x00 add */ - r = (*colour & 0x1f) + (snes_cgram[FIXED_COLOUR] & 0x1f); - g = ((*colour & 0x3e0) >> 5) + ((snes_cgram[FIXED_COLOUR] & 0x3e0) >> 5); - b = ((*colour & 0x7c00) >> 10) + ((snes_cgram[FIXED_COLOUR] & 0x7c00) >> 10); - clip_max = 1; - } - else - { - /* 0x80: sub */ - r = (*colour & 0x1f) - (snes_cgram[FIXED_COLOUR] & 0x1f); - g = ((*colour & 0x3e0) >> 5) - ((snes_cgram[FIXED_COLOUR] & 0x3e0) >> 5); - b = ((*colour & 0x7c00) >> 10) - ((snes_cgram[FIXED_COLOUR] & 0x7c00) >> 10); - if (r > 0x1f) r = 0; - if (g > 0x1f) g = 0; - if (b > 0x1f) b = 0; - } - /* halve if necessary */ - if (BIT(snes_ppu.color_modes, 6)) - { - r >>= 1; - g >>= 1; - b >>= 1; - } - } - - /* according to anomie's docs, after addition has been performed, division by 2 happens *before* clipping to max, hence we clip now */ - if (clip_max) - { - if (r > 0x1f) r = 0x1f; - if (g > 0x1f) g = 0x1f; - if (b > 0x1f) b = 0x1f; - } - - *colour = ((r & 0x1f) | ((g & 0x1f) << 5) | ((b & 0x1f) << 10)); - } -} - - - - - - -/***************************************** -* snes_draw_tile() -* -* Draw tiles with variable bit planes -*****************************************/ - -SNES_INLINE void snes_draw_tile( UINT8 planes, UINT8 layer, UINT16 tileaddr, INT16 xpos, UINT8 priority, UINT8 flip, UINT8 direct_colors, UINT16 palNo, UINT8 hires ) -{ - UINT8 mask, plane[8]; - UINT16 c; - INT16 ii, jj; - - for (ii = 0; ii < planes / 2; ii++) - { - plane[2 * ii] = snes_vram[tileaddr + 16 * ii]; - plane[2 * ii + 1] = snes_vram[tileaddr + 16 * ii + 1]; - } - - if (flip) - mask = 0x1; - else - mask = 0x80; - - for (ii = xpos; ii < (xpos + 8); ii++) - { - UINT8 colour = 0; - if (flip) - { - for (jj = 0; jj < planes; jj++) - colour |= plane[jj] & mask ? (1 << jj) : 0; - - mask <<= 1; - } - else - { - for (jj = 0; jj < planes; jj++) - colour |= plane[jj] & mask ? (1 << jj) : 0; - - mask >>= 1; - } - - - if (!hires) - { - if (ii >= 0 && ii < (SNES_SCR_WIDTH << hires) && scanlines[SNES_MAINSCREEN].enable) - { - if (scanlines[SNES_MAINSCREEN].priority[ii] <= priority) - { - UINT8 clr = colour; - -#ifdef SNES_LAYER_DEBUG - if (!debug_options.windows_disabled) -#endif /* SNES_LAYER_DEBUG */ - /* Clip to windows */ - if (scanlines[SNES_MAINSCREEN].clip) - clr &= snes_ppu.clipmasks[layer][ii]; - - /* Only draw if we have a colour (0 == transparent) */ - if (clr) - { - if (direct_colors) - { - /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ - c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); - c |= ((palNo & 0x04) >> 1) | ((palNo & 0x08) << 3) | ((palNo & 0x10) << 8); - } - else - c = snes_cgram[(palNo + clr) % FIXED_COLOUR]; - - if (snes_ppu.layer[SNES_MAINSCREEN].mosaic_enabled) // handle horizontal mosaic - { - int x_mos; - - //TODO: 512 modes has the h values doubled. - for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) - { - scanlines[SNES_MAINSCREEN].buffer[ii + x_mos] = c; - scanlines[SNES_MAINSCREEN].priority[ii + x_mos] = priority; - scanlines[SNES_MAINSCREEN].layer[ii + x_mos] = layer; - } - - ii += x_mos - 1; - } - else - { - scanlines[SNES_MAINSCREEN].buffer[ii] = c; - scanlines[SNES_MAINSCREEN].priority[ii] = priority; - scanlines[SNES_MAINSCREEN].layer[ii] = layer; - } - } - } - } - - if (ii >= 0 && ii < (SNES_SCR_WIDTH << hires) && scanlines[SNES_SUBSCREEN].enable) - { - if (scanlines[SNES_SUBSCREEN].priority[ii] <= priority) - { - UINT8 clr = colour; - -#ifdef SNES_LAYER_DEBUG - if (!debug_options.windows_disabled) -#endif /* SNES_LAYER_DEBUG */ - /* Clip to windows */ - if (scanlines[SNES_SUBSCREEN].clip) - clr &= snes_ppu.clipmasks[layer][ii]; - - /* Only draw if we have a colour (0 == transparent) */ - if (clr) - { - if (direct_colors) - { - /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ - c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); - c |= ((palNo & 0x04) >> 1) | ((palNo & 0x08) << 3) | ((palNo & 0x10) << 8); - } - else - c = snes_cgram[(palNo + clr) % FIXED_COLOUR]; - - if (snes_ppu.layer[SNES_SUBSCREEN].mosaic_enabled) // handle horizontal mosaic - { - int x_mos; - - //TODO: 512 modes has the h values doubled. - for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) - { - scanlines[SNES_SUBSCREEN].buffer[ii + x_mos] = c; - scanlines[SNES_SUBSCREEN].priority[ii + x_mos] = priority; - scanlines[SNES_SUBSCREEN].layer[ii + x_mos] = layer; - } - - ii += x_mos - 1; - } - else - { - scanlines[SNES_SUBSCREEN].buffer[ii] = c; - scanlines[SNES_SUBSCREEN].priority[ii] = priority; - scanlines[SNES_SUBSCREEN].layer[ii] = layer; - } - } - } - } - } - else /* hires */ - { - if (ii >= 0 && ii < (SNES_SCR_WIDTH << hires) && (ii & 1) && scanlines[SNES_MAINSCREEN].enable) - { - if (scanlines[SNES_MAINSCREEN].priority[ii >> 1] <= priority) - { - UINT8 clr = colour; - -#ifdef SNES_LAYER_DEBUG - if (!debug_options.windows_disabled) -#endif /* SNES_LAYER_DEBUG */ - /* Clip to windows */ - if (scanlines[SNES_MAINSCREEN].clip) - clr &= snes_ppu.clipmasks[layer][ii >> 1]; - - /* Only draw if we have a colour (0 == transparent) */ - if (clr) - { - if (direct_colors) - { - /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ - c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); - c |= ((palNo & 0x04) >> 1) | ((palNo & 0x08) << 3) | ((palNo & 0x10) << 8); - } - else - c = snes_cgram[(palNo + clr) % FIXED_COLOUR]; - - if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic - { - int x_mos; - - //TODO: 512 modes has the h values doubled. - for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) - { - scanlines[SNES_MAINSCREEN].buffer[(ii + x_mos) >> 1] = c; - scanlines[SNES_MAINSCREEN].priority[(ii + x_mos) >> 1] = priority; - scanlines[SNES_MAINSCREEN].layer[(ii + x_mos) >> 1] = layer; - } - ii += x_mos - 1; - } - else - { - scanlines[SNES_MAINSCREEN].buffer[ii >> 1] = c; - scanlines[SNES_MAINSCREEN].priority[ii >> 1] = priority; - scanlines[SNES_MAINSCREEN].layer[ii >> 1] = layer; - } - } - } - } - - if (ii >= 0 && ii < (SNES_SCR_WIDTH << hires) && !(ii & 1) && scanlines[SNES_SUBSCREEN].enable) - { - if (scanlines[SNES_SUBSCREEN].priority[ii >> 1] <= priority) - { - UINT8 clr = colour; - -#ifdef SNES_LAYER_DEBUG - if (!debug_options.windows_disabled) -#endif /* SNES_LAYER_DEBUG */ - /* Clip to windows */ - if (scanlines[SNES_SUBSCREEN].clip) - clr &= snes_ppu.clipmasks[layer][ii >> 1]; - - /* Only draw if we have a colour (0 == transparent) */ - if (clr) - { - if (direct_colors) - { - /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ - c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); - c |= ((palNo & 0x04) >> 1) | ((palNo & 0x08) << 3) | ((palNo & 0x10) << 8); - } - else - c = snes_cgram[(palNo + clr) % FIXED_COLOUR]; - - if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic - { - int x_mos; - - //TODO: 512 modes has the h values doubled. - for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) - { - scanlines[SNES_SUBSCREEN].buffer[(ii + x_mos) >> 1] = c; - scanlines[SNES_SUBSCREEN].priority[(ii + x_mos) >> 1] = priority; - scanlines[SNES_SUBSCREEN].layer[(ii + x_mos) >> 1] = layer; - } - ii += x_mos - 1; - } - else - { - scanlines[SNES_SUBSCREEN].buffer[ii >> 1] = c; - scanlines[SNES_SUBSCREEN].priority[ii >> 1] = priority; - scanlines[SNES_SUBSCREEN].layer[ii >> 1] = layer; - } - } - } - } - } - } -} - -/***************************************** -* snes_draw_tile_x2() -* -* Draw 2 tiles with variable bit planes -*****************************************/ - -SNES_INLINE void snes_draw_tile_x2( UINT8 planes, UINT8 layer, UINT16 tileaddr, INT16 xpos, UINT8 priority, UINT8 flip, UINT8 direct_colors, UINT16 palNo, UINT8 hires ) -{ - if (flip) - { - snes_draw_tile(planes, layer, tileaddr + (8 * planes), xpos, priority, flip, direct_colors, palNo, hires); - snes_draw_tile(planes, layer, tileaddr, xpos + 8, priority, flip, direct_colors, palNo, hires); - } - else - { - snes_draw_tile(planes, layer, tileaddr, xpos, priority, flip, direct_colors, palNo, hires); - snes_draw_tile(planes, layer, tileaddr + (8 * planes), xpos + 8, priority, flip, direct_colors, palNo, hires); - } -} - -/***************************************** -* snes_draw_tile_object() -* -* Draw tiles with 4 bit planes(16 colors) -* The same as snes_draw_tile_4() except -* that it takes a blend parameter. -*****************************************/ - -SNES_INLINE void snes_draw_tile_object( UINT16 tileaddr, INT16 xpos, UINT8 priority, UINT8 flip, UINT16 palNo, UINT8 blend ) -{ - UINT8 mask, plane[4]; - UINT16 c; - INT16 ii, jj; - - plane[0] = snes_vram[tileaddr]; - plane[1] = snes_vram[tileaddr + 1]; - plane[2] = snes_vram[tileaddr + 16]; - plane[3] = snes_vram[tileaddr + 17]; - - if (flip) - mask = 0x01; - else - mask = 0x80; - - for (ii = xpos; ii < (xpos + 8); ii++) - { - UINT8 colour = 0; - if (flip) - { - for (jj = 0; jj < 4; jj++) - colour |= plane[jj] & mask ? (1 << jj) : 0; - - mask <<= 1; - } - else - { - for (jj = 0; jj < 4; jj++) - colour |= plane[jj] & mask ? (1 << jj) : 0; - - mask >>= 1; - } - - if (ii >= 0 && ii < SNES_SCR_WIDTH && scanlines[SNES_MAINSCREEN].enable) - { - if (scanlines[SNES_MAINSCREEN].priority[ii] <= priority) - { - UINT8 clr = colour; - -#ifdef SNES_LAYER_DEBUG - if (!debug_options.windows_disabled) -#endif /* SNES_LAYER_DEBUG */ - /* Clip to windows */ - if (scanlines[SNES_MAINSCREEN].clip) - clr &= snes_ppu.clipmasks[SNES_OAM][ii]; - - /* Only draw if we have a colour (0 == transparent) */ - if (clr) - { - c = snes_cgram[(palNo + clr) % FIXED_COLOUR]; - - scanlines[SNES_MAINSCREEN].buffer[ii] = c; - scanlines[SNES_MAINSCREEN].priority[ii] = priority; - scanlines[SNES_MAINSCREEN].layer[ii] = SNES_OAM; - scanlines[SNES_MAINSCREEN].blend_exception[ii] = blend; - } - } - } - - if (ii >= 0 && ii < SNES_SCR_WIDTH && scanlines[SNES_SUBSCREEN].enable) - { - if (scanlines[SNES_SUBSCREEN].priority[ii] <= priority) - { - UINT8 clr = colour; - -#ifdef SNES_LAYER_DEBUG - if (!debug_options.windows_disabled) -#endif /* SNES_LAYER_DEBUG */ - /* Clip to windows */ - if (scanlines[SNES_SUBSCREEN].clip) - clr &= snes_ppu.clipmasks[SNES_OAM][ii]; - - /* Only draw if we have a colour (0 == transparent) */ - if (clr) - { - c = snes_cgram[(palNo + clr) % FIXED_COLOUR]; - - scanlines[SNES_SUBSCREEN].buffer[ii] = c; - scanlines[SNES_SUBSCREEN].priority[ii] = priority; - scanlines[SNES_SUBSCREEN].layer[ii] = SNES_OAM; - scanlines[SNES_SUBSCREEN].blend_exception[ii] = blend; - } - } - } - } -} - - - - -/********************************************* -* snes_get_tmap_addr() -* -* Find the address in VRAM of the tile (x,y) -*********************************************/ - -SNES_INLINE UINT32 snes_get_tmap_addr( UINT8 layer, UINT8 tile_size, UINT32 base, UINT32 xpos, UINT32 ypos ) -{ - UINT32 res = base; - xpos >>= (3 + tile_size); - ypos >>= (3 + tile_size); - - res += (snes_ppu.layer[layer].tilemap_size & 2) ? ((ypos & 0x20) << ((snes_ppu.layer[layer].tilemap_size & 1) ? 7 : 6)) : 0; - /* Scroll vertically */ - res += (ypos & 0x1f) << 6; - /* Offset horizontally */ - res += (snes_ppu.layer[layer].tilemap_size & 1) ? ((xpos & 0x20) << 6) : 0; - /* Scroll horizontally */ - res += (xpos & 0x1f) << 1; - - return res; -} - - -/********************************************* -* snes_update_line() -* -* Update an entire line of tiles. -*********************************************/ - -SNES_INLINE void snes_update_line( UINT8 color_depth, UINT8 hires, UINT8 priority_a, UINT8 priority_b, UINT8 layer, UINT16 curline, UINT8 offset_per_tile, UINT8 direct_colors ) -{ - UINT32 tmap, tile, xoff, yoff; - UINT32 charaddr; - UINT16 ii = 0, vflip, hflip, pal_col, pal_direct; - INT8 yscroll; - UINT8 xscroll; - UINT8 priority; - UINT32 addr; - UINT16 tilemap; - /* scrolling */ - UINT16 opt_bit = (layer == SNES_BG1) ? 13 : (layer == SNES_BG2) ? 14 : 0; - UINT8 tile_size; - /* variables depending on color_depth */ - UINT8 tile_divider = (color_depth == SNES_COLOR_DEPTH_8BPP) ? 4 : 2; - UINT8 color_planes = 2 << color_depth; - /* below we cheat to simplify the code: 8BPP should have 0 pal offset, not 0x100 (but we take care of this by later using pal % FIXED_COLOUR) */ - UINT8 color_shift = 2 << color_depth; - -#ifdef SNES_LAYER_DEBUG - if (debug_options.bg_disabled[layer]) - return; -#endif /* SNES_LAYER_DEBUG */ - - scanlines[SNES_MAINSCREEN].enable = snes_ppu.layer[layer].main_bg_enabled; - scanlines[SNES_SUBSCREEN].enable = snes_ppu.layer[layer].sub_bg_enabled; - scanlines[SNES_MAINSCREEN].clip = snes_ppu.layer[layer].main_window_enabled; - scanlines[SNES_SUBSCREEN].clip = snes_ppu.layer[layer].sub_window_enabled; - - if (!scanlines[SNES_MAINSCREEN].enable && !scanlines[SNES_SUBSCREEN].enable) - return; - - /* Handle Mosaic effects */ - if (snes_ppu.layer[layer].mosaic_enabled) - curline -= (curline % (snes_ppu.mosaic_size + 1)); - - if ((snes_ppu.interlace == 2) && !hires) - curline /= 2; - - /* Find the size of the tiles (8x8 or 16x16) */ - tile_size = snes_ppu.layer[layer].tile_size; - - /* Find scroll info */ - xoff = snes_ppu.layer[layer].hoffs; - yoff = snes_ppu.layer[layer].voffs; - - xscroll = xoff & ((1 << (3 + tile_size)) - 1); - - /* Jump to base map address */ - tmap = snes_ppu.layer[layer].tilemap << 9; - charaddr = snes_ppu.layer[layer].charmap << 13; - - while (ii < 256 + (8 << tile_size)) - { - // determine the horizontal position (Bishojo Janshi Suchi Pai & Desert Figther have tile_size & hires == 1) - UINT32 xpos = xoff + (ii << (tile_size * hires)); - UINT32 ypos = yoff + curline; - - if (offset_per_tile != SNES_OPT_NONE) - { - int opt_x = ii + (xoff & 7); - UINT32 haddr = 0, vaddr = 0; - UINT16 hval = 0, vval = 0; - - if (opt_x >= 8) - { - switch (offset_per_tile) - { - case SNES_OPT_MODE2: - case SNES_OPT_MODE6: - haddr = snes_get_tmap_addr(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff)); - vaddr = snes_get_tmap_addr(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff) + 8); - hval = snes_vram[haddr] | (snes_vram[haddr + 1] << 8); - vval = snes_vram[vaddr] | (snes_vram[vaddr + 1] << 8); - if (BIT(hval, opt_bit)) - xpos = opt_x + (hval & ~7); - if (BIT(vval, opt_bit)) - ypos = curline + vval; - break; - case SNES_OPT_MODE4: - haddr = snes_get_tmap_addr(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff)); - hval = snes_vram[haddr] | (snes_vram[haddr + 1] << 8); - if (BIT(hval, opt_bit)) - { - if (!BIT(hval, 15)) - xpos = opt_x + (hval & ~7); - else - ypos = curline + hval; - } - break; - } - } - } - - addr = snes_get_tmap_addr(layer, tile_size, tmap, xpos, ypos); - - /* - Tilemap format - vhopppcc cccccccc - - v/h = Vertical/Horizontal flip this tile. - o = Tile priority. - ppp = Tile palette. The number of entries in the palette depends on the Mode and the BG. - cccccccccc = Tile number. - */ - tilemap = snes_vram[addr] | (snes_vram[addr + 1] << 8); - vflip = BIT(tilemap, 15); - hflip = BIT(tilemap, 14); - priority = BIT(tilemap, 13) ? priority_b : priority_a; - pal_direct = ((tilemap & 0x1c00) >> 8); - tile = tilemap & 0x03ff; - - pal_col = ((pal_direct >> 2) << color_shift); - - /* Mode 0 palettes are layer specific */ - if (snes_ppu.mode == 0) - { - pal_col += (layer << 5); - } - - /* figure out which line to draw */ - yscroll = ypos & ((8 << tile_size) - 1); - - if (yscroll > ((8 << tile_size) - 1)) /* scrolled into the next tile */ - yscroll -= (8 << tile_size); - - if (vflip) - { - if (tile_size) - { - if (yscroll > 7) - { - yscroll -= 8; - } - else - { - tile += 32 / tile_divider; - } - } - yscroll = -yscroll + 7; - } - else - { - if (yscroll > 7) - { - tile += 32 / tile_divider; - yscroll -= 8; - } - } - yscroll <<= 1; - - /* below, only color_planes depends on color_depth */ - if (hires) /* Hi-Res: 2bpp & 4bpp */ - { - snes_draw_tile_x2(color_planes, layer, charaddr + (tile * 8 * color_planes) + yscroll, (ii - xscroll) * 2, priority, hflip, direct_colors, direct_colors ? pal_direct : pal_col, hires); - ii += 8; - } - else /* tile_size = 0 */ - { - if (tile_size) - { - snes_draw_tile_x2(color_planes, layer, charaddr + (tile * 8 * color_planes) + yscroll, ii - xscroll, priority, hflip, direct_colors, direct_colors ? pal_direct : pal_col, hires); - ii += 16; - } - else /* No Hi-Res: 2bpp, 4bpp & 8bpp */ - { - snes_draw_tile(color_planes, layer, charaddr + (tile * 8 * color_planes) + yscroll, ii - xscroll, priority, hflip, direct_colors, direct_colors ? pal_direct : pal_col, hires); - ii += 8; - } - } - } -} - - -/********************************************* -* snes_update_line_mode7() -* -* Update an entire line of mode7 tiles. -*********************************************/ - -#define MODE7_CLIP(x) (((x) & 0x2000) ? ((x) | ~0x03ff) : ((x) & 0x03ff)) - -static void snes_update_line_mode7( UINT8 priority_a, UINT8 priority_b, UINT8 layer, UINT16 curline ) -{ - UINT32 tiled; - INT16 ma, mb, mc, md; - INT32 xc, yc, tx, ty, sx, sy, hs, vs, xpos, xdir, x0, y0; - UINT8 priority = priority_a; - UINT8 colour = 0; - UINT16 *mosaic_x, *mosaic_y; - UINT16 c; - -#ifdef SNES_LAYER_DEBUG - if (debug_options.bg_disabled[layer]) - return; -#endif /* SNES_LAYER_DEBUG */ - - scanlines[SNES_MAINSCREEN].enable = snes_ppu.layer[layer].main_bg_enabled; - scanlines[SNES_SUBSCREEN].enable = snes_ppu.layer[layer].sub_bg_enabled; - scanlines[SNES_MAINSCREEN].clip = snes_ppu.layer[layer].main_window_enabled; - scanlines[SNES_SUBSCREEN].clip = snes_ppu.layer[layer].sub_window_enabled; - - if (!scanlines[SNES_MAINSCREEN].enable && !scanlines[SNES_SUBSCREEN].enable) - return; - - ma = snes_ppu.mode7.matrix_a; - mb = snes_ppu.mode7.matrix_b; - mc = snes_ppu.mode7.matrix_c; - md = snes_ppu.mode7.matrix_d; - xc = snes_ppu.mode7.origin_x; - yc = snes_ppu.mode7.origin_y; - hs = snes_ppu.mode7.hor_offset; - vs = snes_ppu.mode7.ver_offset; - - /* Sign extend */ - xc <<= 19; - xc >>= 19; - yc <<= 19; - yc >>= 19; - hs <<= 19; - hs >>= 19; - vs <<= 19; - vs >>= 19; - - /* Vertical flip */ - if (snes_ppu.mode7.vflip) - sy = 255 - curline; - else - sy = curline; - - /* Horizontal flip */ - if (snes_ppu.mode7.hflip) - { - xpos = 255; - xdir = -1; - } - else - { - xpos = 0; - xdir = 1; - } - - /* MOSAIC - to be verified */ - if (layer == 1) // BG2 use two different bits for horizontal and vertical mosaic - { - mosaic_x = snes_ppu.mosaic_table[snes_ppu.layer[SNES_BG2].mosaic_enabled ? snes_ppu.mosaic_size : 0]; - mosaic_y = snes_ppu.mosaic_table[snes_ppu.layer[SNES_BG1].mosaic_enabled ? snes_ppu.mosaic_size : 0]; - } - else // BG1 works as usual - { - mosaic_x = snes_ppu.mosaic_table[snes_ppu.layer[SNES_BG1].mosaic_enabled ? snes_ppu.mosaic_size : 0]; - mosaic_y = snes_ppu.mosaic_table[snes_ppu.layer[SNES_BG1].mosaic_enabled ? snes_ppu.mosaic_size : 0]; - } - - /* Let's do some mode7 drawing huh? */ - /* These can be computed only once, since they do not depend on sx */ - x0 = ((ma * MODE7_CLIP(hs - xc)) & ~0x3f) + ((mb * mosaic_y[sy]) & ~0x3f) + ((mb * MODE7_CLIP(vs - yc)) & ~0x3f) + (xc << 8); - y0 = ((mc * MODE7_CLIP(hs - xc)) & ~0x3f) + ((md * mosaic_y[sy]) & ~0x3f) + ((md * MODE7_CLIP(vs - yc)) & ~0x3f) + (yc << 8); - - for (sx = 0; sx < 256; sx++, xpos += xdir) - { - tx = (x0 + (ma * mosaic_x[sx])) >> 8; - ty = (y0 + (mc * mosaic_x[sx])) >> 8; - - switch (snes_ppu.mode7.repeat) - { - case 0x00: /* Repeat if outside screen area */ - case 0x01: /* Repeat if outside screen area */ - tx &= 0x3ff; - ty &= 0x3ff; - tiled = snes_vram[(((tx >> 3) & 0x7f) + (((ty >> 3) & 0x7f) * 128)) * 2] << 7; - colour = snes_vram[tiled + ((tx & 0x07) * 2) + ((ty & 0x07) * 16) + 1]; - break; - case 0x02: /* Single colour backdrop screen if outside screen area */ - if ((tx > 0) && (tx < 1024) && (ty > 0) && (ty < 1024)) - { - tiled = snes_vram[(((tx >> 3) & 0x7f) + (((ty >> 3) & 0x7f) * 128)) * 2] << 7; - colour = snes_vram[tiled + ((tx & 0x07) * 2) + ((ty & 0x07) * 16) + 1]; - } - else - colour = 0; - break; - case 0x03: /* Character 0x00 repeat if outside screen area */ - if ((tx > 0) && (tx < 1024) && (ty > 0) && (ty < 1024)) - tiled = snes_vram[(((tx >> 3) & 0x7f) + (((ty >> 3) & 0x7f) * 128)) * 2] << 7; - else - tiled = 0; - - colour = snes_vram[tiled + ((tx & 0x07) * 2) + ((ty & 0x07) * 16) + 1]; - break; - } - - /* The last bit is for priority in EXTBG mode (used only for BG2) */ - if (layer == 1) - { - priority = ((colour & 0x80) >> 7) ? priority_b : priority_a; - colour &= 0x7f; - } - - if (scanlines[SNES_MAINSCREEN].enable) - { - UINT8 clr = colour; - - if (scanlines[SNES_MAINSCREEN].clip) - clr &= snes_ppu.clipmasks[layer][xpos]; - - /* Draw pixel if appropriate */ - if (scanlines[SNES_MAINSCREEN].priority[xpos] <= priority && clr > 0) - { - /* Direct select, but only outside EXTBG! */ - if (snes_ppu.direct_color && layer == 0) - { - /* 0 | BB000 | GGG00 | RRR00, HW confirms that the data is zero padded. */ - c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); - } - else - c = snes_cgram[clr]; - - scanlines[SNES_MAINSCREEN].buffer[xpos] = c; - scanlines[SNES_MAINSCREEN].priority[xpos] = priority; - scanlines[SNES_MAINSCREEN].layer[xpos] = layer; - } - } - - if (scanlines[SNES_SUBSCREEN].enable) - { - UINT8 clr = colour; - - if (scanlines[SNES_SUBSCREEN].clip) - clr &= snes_ppu.clipmasks[layer][xpos]; - - /* Draw pixel if appropriate */ - if (scanlines[SNES_SUBSCREEN].priority[xpos] <= priority && clr > 0) - { - /* Direct select, but only outside EXTBG! */ - if (snes_ppu.direct_color && layer == 0) - { - /* 0 | BB000 | GGG00 | RRR00, HW confirms that the data is zero padded. */ - c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); - } - else - c = snes_cgram[clr]; - - scanlines[SNES_SUBSCREEN].buffer[xpos] = c; - scanlines[SNES_SUBSCREEN].priority[xpos] = priority; - scanlines[SNES_SUBSCREEN].layer[xpos] = layer; - } - } - } -} - - -/********************************************* -* snes_update_objects() -* -* Update an entire line of sprites. -* FIXME: We need to support high priority bit -*********************************************/ - -struct OAM -{ - UINT16 tile; - INT16 x, y; - UINT8 size, vflip, hflip, priority_bits, pal; - int height, width; -}; - -static struct OAM oam_list[(SNES_SCR_WIDTH / 2) + 1]; - -#if 0 - -// FIXME: The following functions should be used to create sprite list with -// obsel data from the previous line. Unfortunately, some games are very picky -// about when you set up sprite attributes (e.g. Super Star Wars - The Empire -// Strikes Back and Super Street Fighter II) and they would freeze if we only build -// part of the sprite attributes at the right moment and part of them later, during -// scanline drawing. Hence, these functions are on hold until more OAM refactoring -// is done (soon-ish) -static void snes_update_obsel( void ) -{ - snes_ppu.layer[SNES_OAM].charmap = snes_ppu.oam.next_charmap; - snes_ppu.oam.name_select = snes_ppu.oam.next_name_select; - - if (snes_ppu.oam.size_ != snes_ppu.oam.next_size) - { - snes_ppu.oam.size_ = snes_ppu.oam.next_size; - snes_ppu.update_oam_list = 1; - } -} - -static void snes_oam_list_build( void ) -{ - UINT8 *oamram = (UINT8 *)snes_oam; - INT16 oam = 0x1ff; - UINT16 oam_extra = oam + 0x20; - UINT16 extra = 0; - int i; - - snes_ppu.update_oam_list = 0; // eventually, we can optimize the code by only calling this function when there is a change in size - - for (i = 128; i > 0; i--) - { - if ((i % 4) == 0) - extra = oamram[oam_extra--]; - - oam_list[i].vflip = (oamram[oam] & 0x80) >> 7; - oam_list[i].hflip = (oamram[oam] & 0x40) >> 6; - oam_list[i].priority_bits = (oamram[oam] & 0x30) >> 4; - oam_list[i].pal = 128 + ((oamram[oam] & 0x0e) << 3); - oam_list[i].tile = (oamram[oam--] & 0x1) << 8; - oam_list[i].tile |= oamram[oam--]; - oam_list[i].y = oamram[oam--] + 1; /* We seem to need to add one here.... */ - oam_list[i].x = oamram[oam--]; - oam_list[i].size = (extra & 0x80) >> 7; - extra <<= 1; - oam_list[i].x |= ((extra & 0x80) << 1); - extra <<= 1; - oam_list[i].y *= snes_ppu.obj_interlace; - - /* Adjust if past maximum position */ - if (oam_list[i].y >= snes_ppu.beam.last_visible_line * snes_ppu.interlace) - oam_list[i].y -= 256 * snes_ppu.interlace; - if (oam_list[i].x > 255) - oam_list[i].x -= 512; - - /* Determine object size */ - switch (snes_ppu.oam.next_size) - { - case 0: /* 8x8 or 16x16 */ - oam_list[i].width = oam_list[i].size ? 2 : 1; - oam_list[i].height = oam_list[i].size ? 2 : 1; - break; - case 1: /* 8x8 or 32x32 */ - oam_list[i].width = oam_list[i].size ? 4 : 1; - oam_list[i].height = oam_list[i].size ? 4 : 1; - break; - case 2: /* 8x8 or 64x64 */ - oam_list[i].width = oam_list[i].size ? 8 : 1; - oam_list[i].height = oam_list[i].size ? 8 : 1; - break; - case 3: /* 16x16 or 32x32 */ - oam_list[i].width = oam_list[i].size ? 4 : 2; - oam_list[i].height = oam_list[i].size ? 4 : 2; - break; - case 4: /* 16x16 or 64x64 */ - oam_list[i].width = oam_list[i].size ? 8 : 2; - oam_list[i].height = oam_list[i].size ? 8 : 2; - break; - case 5: /* 32x32 or 64x64 */ - oam_list[i].width = oam_list[i].size ? 8 : 4; - oam_list[i].height = oam_list[i].size ? 8 : 4; - break; - case 6: /* undocumented: 16x32 or 32x64 */ - oam_list[i].width = oam_list[i].size ? 4 : 2; - oam_list[i].height = oam_list[i].size ? 8 : 4; - if (snes_ppu.obj_interlace && !oam_list[i].size) - oam_list[i].height = 2; - break; - case 7: /* undocumented: 16x32 or 32x32 */ - oam_list[i].width = oam_list[i].size ? 4 : 2; - oam_list[i].height = oam_list[i].size ? 4 : 4; - if (snes_ppu.obj_interlace && !oam_list[i].size) - oam_list[i].height = 2; - break; - default: - /* we should never enter here... */ - logerror("Object size unsupported: %d\n", snes_ppu.oam.size_); - break; - } - } -} -#endif - -static void snes_update_objects( UINT8 priority_tbl, UINT16 curline ) -{ - INT8 xs, ys; - UINT8 line; - UINT8 range_over = 0, time_over = 0; - UINT8 height, width, vflip, hflip, priority, palNo, blend; - UINT16 tile; - INT16 i, xpos, ypos; - UINT32 name_sel = 0, charaddr; - static const UINT8 table_obj_priority[10][4] = { - {2, 5, 8, 11}, // mode 0 - {1, 3, 6, 9}, // mode 1 - {1, 3, 5, 7}, // mode 2 - {1, 3, 5, 7}, // mode 3 - {1, 3, 5, 7}, // mode 4 - {1, 3, 5, 7}, // mode 5 - {0, 2, 3, 5}, // mode 6 - {0, 2, 3, 4}, // mode 7 - {1, 3, 5, 6}, // mode 7 EXTBG - {1, 2, 5, 8} // mode 1 + BG3 priority bit - }; - UINT8 *oamram = (UINT8 *)snes_oam; - INT16 oam = 0x1ff; - UINT16 oam_extra = oam + 0x20; - UINT16 extra = 0; - -#ifdef SNES_LAYER_DEBUG - if (debug_options.bg_disabled[SNES_OAM]) - return; -#endif /* SNES_LAYER_DEBUG */ - - scanlines[SNES_MAINSCREEN].enable = snes_ppu.layer[SNES_OAM].main_bg_enabled; - scanlines[SNES_SUBSCREEN].enable = snes_ppu.layer[SNES_OAM].sub_bg_enabled; - scanlines[SNES_MAINSCREEN].clip = snes_ppu.layer[SNES_OAM].main_window_enabled; - scanlines[SNES_SUBSCREEN].clip = snes_ppu.layer[SNES_OAM].sub_window_enabled; - - if (!scanlines[SNES_MAINSCREEN].enable && !scanlines[SNES_SUBSCREEN].enable) - return; - - curline /= snes_ppu.interlace; - curline *= snes_ppu.obj_interlace; - - charaddr = snes_ppu.oam.next_charmap << 13; - - for (i = 128; i > 0; i--) - { - if ((i % 4) == 0) - extra = oamram[oam_extra--]; - - oam_list[i].vflip = (oamram[oam] & 0x80) >> 7; - oam_list[i].hflip = (oamram[oam] & 0x40) >> 6; - oam_list[i].priority_bits = (oamram[oam] & 0x30) >> 4; - oam_list[i].pal = 128 + ((oamram[oam] & 0x0e) << 3); - oam_list[i].tile = (oamram[oam--] & 0x1) << 8; - oam_list[i].tile |= oamram[oam--]; - oam_list[i].y = oamram[oam--] + 1; /* We seem to need to add one here.... */ - oam_list[i].x = oamram[oam--]; - oam_list[i].size = (extra & 0x80) >> 7; - extra <<= 1; - oam_list[i].x |= ((extra & 0x80) << 1); - extra <<= 1; - oam_list[i].y *= snes_ppu.obj_interlace; - - /* Adjust if past maximum position */ - if (oam_list[i].y >= snes_ppu.beam.last_visible_line * snes_ppu.interlace) - oam_list[i].y -= 256 * snes_ppu.interlace; - if (oam_list[i].x > 255) - oam_list[i].x -= 512; - tile = oam_list[i].tile; - xpos = oam_list[i].x; - ypos = oam_list[i].y; - height = oam_list[i].height; - width = oam_list[i].width; - vflip = oam_list[i].vflip; - hflip = oam_list[i].hflip; - priority = table_obj_priority[priority_tbl][oam_list[i].priority_bits]; - palNo = oam_list[i].pal; - - /* Draw sprite if it intersects the current line */ - if (curline >= ypos && curline < (ypos + (snes_ppu.oam.size[oam_list[i].size] << 3))) - { - /* Only objects using palettes 4-7 can be transparent */ - blend = (palNo < 192) ? 1 : 0; - - /* Only objects using tiles over 255 use name select */ - name_sel = (tile < 256) ? 0 : snes_ppu.oam.next_name_select; - - ys = (curline - ypos) >> 3; - line = (curline - ypos) % 8; - if (vflip) - { - ys = snes_ppu.oam.size[oam_list[i].size] - ys - 1; - line = (-1 * line) + 7; - } - line <<= 1; - tile <<= 5; - if (hflip) - { - UINT8 count = 0; - for (xs = (snes_ppu.oam.size[oam_list[i].size] - 1); xs >= 0; xs--) - { - if ((xpos + (count << 3) < SNES_SCR_WIDTH)) - { - snes_draw_tile_object(charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, xpos + (count++ << 3), priority, hflip, palNo, blend); - } - time_over++; /* Increase time_over. Should we stop drawing if exceeded 34 tiles? */ - } - } - else - { - for (xs = 0; xs < snes_ppu.oam.size[oam_list[i].size]; xs++) - { - if ((xpos + (xs << 3) < SNES_SCR_WIDTH)) - { - snes_draw_tile_object(charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, xpos + (xs << 3), priority, hflip, palNo, blend); - } - time_over++; /* Increase time_over. Should we stop drawing if exceeded 34 tiles? */ - } - } - - /* Increase range_over. Stop drawing if exceeded 32 objects and enforcing that limit is enabled */ - range_over++; - if (range_over == 32) //&& (input_port_read(machine, "INTERNAL") & 0x01) ) - { - /* Set the flag in STAT77 register */ - snes_ppu.stat77_flags |= 0x40; - /* FIXME: This stops the SNESTest rom from drawing the object test properly. Maybe we shouldn't stop drawing? */ - /* return; */ - } - } - } - - if (time_over >= 34) - { - /* Set the flag in STAT77 register */ - snes_ppu.stat77_flags |= 0x80; - } -} - - -/********************************************* -* snes_update_mode_X() -* -* Update Mode X line. -*********************************************/ - -static void snes_update_mode_0( UINT16 curline ) -{ -#ifdef SNES_LAYER_DEBUG - if (debug_options.mode_disabled[0]) - return; -#endif /* SNES_LAYER_DEBUG */ - - snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 0, 3, SNES_BG4, curline, SNES_OPT_NONE, 0); - snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 1, 4, SNES_BG3, curline, SNES_OPT_NONE, 0); - snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 6, 9, SNES_BG2, curline, SNES_OPT_NONE, 0); - snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 7, 10, SNES_BG1, curline, SNES_OPT_NONE, 0); - snes_update_objects(0, curline); -} - -static void snes_update_mode_1( UINT16 curline ) -{ -#ifdef SNES_LAYER_DEBUG - if (debug_options.mode_disabled[1]) - return; -#endif /* SNES_LAYER_DEBUG */ - - if (!snes_ppu.bg3_priority_bit) - { - snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 0, 2, SNES_BG3, curline, SNES_OPT_NONE, 0); - snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 4, 7, SNES_BG2, curline, SNES_OPT_NONE, 0); - snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 5, 8, SNES_BG1, curline, SNES_OPT_NONE, 0); - snes_update_objects(1, curline); - } - else - { - snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 0, 9, SNES_BG3, curline, SNES_OPT_NONE, 0); - snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 3, 6, SNES_BG2, curline, SNES_OPT_NONE, 0); - snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 4, 7, SNES_BG1, curline, SNES_OPT_NONE, 0); - snes_update_objects(9, curline); - } -} - -static void snes_update_mode_2( UINT16 curline ) -{ -#ifdef SNES_LAYER_DEBUG - if (debug_options.mode_disabled[2]) - return; -#endif /* SNES_LAYER_DEBUG */ - - snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 0, 4, SNES_BG2, curline, SNES_OPT_MODE2, 0); - snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 2, 6, SNES_BG1, curline, SNES_OPT_MODE2, 0); - snes_update_objects(2, curline); -} - -static void snes_update_mode_3( UINT16 curline ) -{ -#ifdef SNES_LAYER_DEBUG - if (debug_options.mode_disabled[3]) - return; -#endif /* SNES_LAYER_DEBUG */ - - snes_update_line(SNES_COLOR_DEPTH_4BPP, 0, 0, 4, SNES_BG2, curline, SNES_OPT_NONE, 0); - snes_update_line(SNES_COLOR_DEPTH_8BPP, 0, 2, 6, SNES_BG1, curline, SNES_OPT_NONE, snes_ppu.direct_color); - snes_update_objects(3, curline); -} - -static void snes_update_mode_4( UINT16 curline ) -{ -#ifdef SNES_LAYER_DEBUG - if (debug_options.mode_disabled[4]) - return; -#endif /* SNES_LAYER_DEBUG */ - - snes_update_line(SNES_COLOR_DEPTH_2BPP, 0, 0, 4, SNES_BG2, curline, SNES_OPT_MODE4, 0); - snes_update_line(SNES_COLOR_DEPTH_8BPP, 0, 2, 6, SNES_BG1, curline, SNES_OPT_MODE4, snes_ppu.direct_color); - snes_update_objects(4, curline); -} - -static void snes_update_mode_5( UINT16 curline ) -{ -#ifdef SNES_LAYER_DEBUG - if (debug_options.mode_disabled[5]) - return; -#endif /* SNES_LAYER_DEBUG */ - - snes_update_line(SNES_COLOR_DEPTH_4BPP, 1, 2, 6, SNES_BG1, curline, SNES_OPT_NONE, 0); - snes_update_line(SNES_COLOR_DEPTH_2BPP, 1, 0, 4, SNES_BG2, curline, SNES_OPT_NONE, 0); - snes_update_objects(5, curline); -} - -static void snes_update_mode_6( UINT16 curline ) -{ -#ifdef SNES_LAYER_DEBUG - if (debug_options.mode_disabled[6]) - return; -#endif /* SNES_LAYER_DEBUG */ - - snes_update_line(SNES_COLOR_DEPTH_4BPP, 1, 1, 4, SNES_BG1, curline, SNES_OPT_MODE6, 0); - snes_update_objects(6, curline); -} - -static void snes_update_mode_7( UINT16 curline ) -{ -#ifdef SNES_LAYER_DEBUG - if (debug_options.mode_disabled[7]) - return; -#endif /* SNES_LAYER_DEBUG */ - - if (!snes_ppu.mode7.extbg) - { - snes_update_line_mode7(1, 1, SNES_BG1, curline); - snes_update_objects(7, curline); - } - else - { - snes_update_line_mode7(0, 4, SNES_BG2, curline); - snes_update_line_mode7(2, 2, SNES_BG1, curline); - snes_update_objects(8, curline); - } -} - - - -/********************************************* -* snes_draw_screens() -* -* Draw the whole screen (Mode 0 -> 7). -*********************************************/ - -static void snes_draw_screens( UINT16 curline ) -{ - switch (snes_ppu.mode) - { - case 0: snes_update_mode_0(curline); break; /* Mode 0 */ - case 1: snes_update_mode_1(curline); break; /* Mode 1 */ - case 2: snes_update_mode_2(curline); break; /* Mode 2 - Supports offset per tile */ - case 3: snes_update_mode_3(curline); break; /* Mode 3 - Supports direct colour */ - case 4: snes_update_mode_4(curline); break; /* Mode 4 - Supports offset per tile and direct colour */ - case 5: snes_update_mode_5(curline); break; /* Mode 5 - Supports hires */ - case 6: snes_update_mode_6(curline); break; /* Mode 6 - Supports offset per tile and hires */ - case 7: snes_update_mode_7(curline); break; /* Mode 7 - Supports direct colour */ - } -} - -/********************************************* -* snes_update_windowmasks() -* -* An example of how windows work: -* Win1: ...#####...... -* Win2: ......#####... -* IN OUT -* OR: ...########... ###........### -* AND: ......##...... ######..###### -* XOR: ...###..###... ###...##...### -* XNOR: ###...##...### ...###..###... -*********************************************/ - -static void snes_update_windowmasks( void ) -{ - UINT16 ii, jj; - INT8 w1, w2; - - snes_ppu.update_windows = 0; /* reset the flag */ - - for (ii = 0; ii < SNES_SCR_WIDTH; ii++) - { - /* update bg 1, 2, 3, 4, obj & color windows */ - /* jj = layer */ - for (jj = 0; jj < 6; jj++) - { - snes_ppu.clipmasks[jj][ii] = 0xff; /* let's start from un-masked */ - w1 = w2 = -1; - - if (snes_ppu.layer[jj].window1_enabled) - { - /* Default to mask area inside */ - if ((ii < snes_ppu.window1_left) || (ii > snes_ppu.window1_right)) - w1 = 0; - else - w1 = 1; - - /* If mask area is outside then swap */ - if (snes_ppu.layer[jj].window1_invert) - w1 = !w1; - } - - if (snes_ppu.layer[jj].window2_enabled) - { - if ((ii < snes_ppu.window2_left) || (ii > snes_ppu.window2_right)) - w2 = 0; - else - w2 = 1; - if (snes_ppu.layer[jj].window2_invert) - w2 = !w2; - } - - /* mask if the appropriate expression is true */ - if (w1 >= 0 && w2 >= 0) - { - switch (snes_ppu.layer[jj].wlog_mask) - { - case 0x00: /* OR */ - snes_ppu.clipmasks[jj][ii] = w1 | w2 ? 0x00 : 0xff; - break; - case 0x01: /* AND */ - snes_ppu.clipmasks[jj][ii] = w1 & w2 ? 0x00 : 0xff; - break; - case 0x02: /* XOR */ - snes_ppu.clipmasks[jj][ii] = w1 ^ w2 ? 0x00 : 0xff; - break; - case 0x03: /* XNOR */ - snes_ppu.clipmasks[jj][ii] = !(w1 ^ w2) ? 0x00 : 0xff; - break; - } - } - else if (w1 >= 0) - snes_ppu.clipmasks[jj][ii] = w1 ? 0x00 : 0xff; - else if (w2 >= 0) - snes_ppu.clipmasks[jj][ii] = w2 ? 0x00 : 0xff; - } - } -} - -/********************************************* -* snes_update_offsets() -* -* Update the offsets with the latest changes. -*********************************************/ - -static void snes_update_offsets( void ) -{ - int ii; - for (ii = 0; ii < 4; ii++) - { - } - snes_ppu.update_offsets = 0; -} - -static SNES_INLINE unsigned char pal5bit(unsigned char bits) -{ - bits &= 0x1f; - return (bits << 3); -} -/********************************************* -* snes_refresh_scanline() -* -* Redraw the current line. -*********************************************/ -#define RGB_BLACK 0x00 - - -#if 0 -SNES_INLINE static unsigned int CalcCol(unsigned short nColour) -{ - int r, g, b; - - //r = pal5bit(nColour >> 0); - //g = pal5bit(nColour >> 5); - //b = pal5bit(nColour >> 10); - - r = (nColour & 0x7C00) >> 7; // Red - r |= r >> 0; - g = (nColour & 0x03E0) >> 2; // Green - g |= g >> 5; - b = (nColour & 0x001F) << 3; // Blue - b |= b >> 10; - - return BurnHighCol(r, g, b, 0); -} -#endif - - - -static void snes_refresh_scanline(UINT16 curline ) -{ - UINT16 ii; - int xpos; - int fade; - struct SCANLINE *scanline1, *scanline2; - UINT16 c; - unsigned short * dstbitmap = (unsigned short * )pBurnDraw; - - if (snes_ppu.screen_disabled) /* screen is forced blank */ - for (xpos = 0; xpos < SNES_SCR_WIDTH * 2; xpos++) - { - if (pBurnDraw) - { - dstbitmap[(curline*(nBurnPitch>>1))+xpos]= RGB_BLACK; - } - } - else - { - /* Update clip window masks if necessary */ - if (snes_ppu.update_windows) - snes_update_windowmasks(); - /* Update the offsets if necessary */ - if (snes_ppu.update_offsets) - snes_update_offsets(); - - /* Clear priority */ - memset(scanlines[SNES_MAINSCREEN].priority, 0, SNES_SCR_WIDTH); - memset(scanlines[SNES_SUBSCREEN].priority, 0, SNES_SCR_WIDTH); - - /* Clear layers */ - memset(scanlines[SNES_MAINSCREEN].layer, SNES_COLOR, SNES_SCR_WIDTH); - memset(scanlines[SNES_SUBSCREEN].layer, SNES_COLOR, SNES_SCR_WIDTH); - - /* Clear blend_exception (only used for OAM) */ - memset(scanlines[SNES_MAINSCREEN].blend_exception, 0, SNES_SCR_WIDTH); - memset(scanlines[SNES_SUBSCREEN].blend_exception, 0, SNES_SCR_WIDTH); - - /* Draw back colour */ - for (ii = 0; ii < SNES_SCR_WIDTH; ii++) - { - if (snes_ppu.mode == 5 || snes_ppu.mode == 6) - scanlines[SNES_SUBSCREEN].buffer[ii] = snes_cgram[0]; - else - scanlines[SNES_SUBSCREEN].buffer[ii] = snes_cgram[FIXED_COLOUR]; - - scanlines[SNES_MAINSCREEN].buffer[ii] = snes_cgram[0]; - } - - /* Draw screens */ - snes_draw_screens(curline); - -#ifdef SNES_LAYER_DEBUG - if (snes_dbg_video(machine, bitmap, curline)) - { - profiler_mark_end(); - return; - } - - /* Toggle drawing of SNES_SUBSCREEN or SNES_MAINSCREEN */ - if (debug_options.draw_subscreen) - { - scanline1 = &scanlines[SNES_SUBSCREEN]; - scanline2 = &scanlines[SNES_MAINSCREEN]; - } - else -#endif /* SNES_LAYER_DEBUG */ - { - scanline1 = &scanlines[SNES_MAINSCREEN]; - scanline2 = &scanlines[SNES_SUBSCREEN]; - } - - /* Phew! Draw the line to screen */ - fade = snes_ppu.screen_brightness; - - for (xpos = 0; xpos < SNES_SCR_WIDTH; xpos++) - { - int r, g, b, hires; - hires = (snes_ppu.mode != 5 && snes_ppu.mode != 6) ? 0 : 1; - c = scanline1->buffer[xpos]; - - /* perform color math if the layer wants it (except if it's an object > 192) */ - if (!scanline1->blend_exception[xpos] && snes_ppu.layer[scanline1->layer[xpos]].color_math) - snes_draw_blend(xpos, &c, snes_ppu.prevent_color_math, snes_ppu.clip_to_black, 0); - - r = ((c & 0x1f) * fade) >> 4; - g = (((c & 0x3e0) >> 5) * fade) >> 4; - b = (((c & 0x7c00) >> 10) * fade) >> 4; - - if (pBurnDraw) - { - dstbitmap[(curline * (nBurnPitch>>1))+ (xpos<<1) + 1] =BurnHighCol(pal5bit(r),pal5bit(g),pal5bit(b),0); //BurnHighCol(pal5bit(r),pal5bit(g),pal5bit(b),0); - } - - /* in hires, the first pixel (of 512) is subscreen pixel, then the first mainscreen pixel follows, and so on... */ - if (!hires) - { - if (pBurnDraw) - { - dstbitmap[(curline * (nBurnPitch>>1))+(xpos<<1) + 0] =BurnHighCol(pal5bit(r),pal5bit(g),pal5bit(b),0); //BurnHighCol(pal5bit(r), pal5bit(g), pal5bit(b),0); - } - } - else - { - c = scanline2->buffer[xpos]; - - /* in hires, subscreen pixels are blended as well: for each subscreen pixel, color math is applied if - it had been applied to the previous mainscreen pixel. What happens at subscreen pixel 0 (which has no - previous mainscreen pixel) is undocumented. Until more info are discovered, we (arbitrarily) apply to it - the same color math as the *next* mainscreen pixel (i.e. mainscreen pixel 0) */ - - if (xpos == 0 && !scanline1->blend_exception[0] && snes_ppu.layer[scanline1->layer[0]].color_math) - snes_draw_blend(0, &c, snes_ppu.prevent_color_math, snes_ppu.clip_to_black, 1); - else if (xpos > 0 && !scanline1->blend_exception[xpos - 1] && snes_ppu.layer[scanline1->layer[xpos - 1]].color_math) - snes_draw_blend(xpos, &c, snes_ppu.prevent_color_math, snes_ppu.clip_to_black, 1); - - - r = ((c & 0x1f) * fade) >> 4; - g = (((c & 0x3e0) >> 5) * fade) >> 4; - b = (((c & 0x7c00) >> 10) * fade) >> 4; - if (pBurnDraw) - { - dstbitmap[(curline * (nBurnPitch>>1))+ (xpos<<1) + 0] = BurnHighCol(pal5bit(r),pal5bit(g),pal5bit(b),0);//BurnHighCol(pal5bit(r), pal5bit(g), pal5bit(b),0); - } - } - } - } -} - - - -static int hcount,vcount; - - -void initppu() -{ - -} - -void resetppu() -{ - memset(snes_cgram,0x0000,SNES_CGRAM_SIZE*2); - memset(snes_oam,0xff,SNES_OAM_SIZE*2); - memset(snes_vram,0x55,SNES_VRAM_SIZE); - memset(snes_ram,0x55,0x4000*2); - - snes_ppu.update_windows = 1; - snes_ppu.beam.latch_vert = 0; - snes_ppu.beam.latch_horz = 0; - snes_ppu.beam.current_vert = 0; - snes_ppu.beam.current_horz = 0; - snes_ppu.beam.last_visible_line = 240; - snes_ppu.mode = 0; - snes_ppu.ppu1_version = 1; // 5C77 chip version number, read by STAT77, only '1' is known - snes_ppu.ppu2_version = 3; // 5C78 chip version number, read by STAT78, only '2' & '3' encountered so far. - cgram_address = 0; - vram_read_offset = 2; - - /* Inititialize mosaic table */ - for (int j = 0; j < 16; j++) - { - for (int i = 0; i < 4096; i++) - { - snes_ppu.mosaic_table[j][i] = (i / (j + 1)) * (j + 1); - } - } - snes_ram[VMAIN] = 0x80; - snes_ram[STAT78] = SNES_NTSC; - - //snes_ram[HTIMEL] = 0xff; - //snes_ram[HTIMEH] = 0x1; - //snes_ram[VTIMEL] = 0xff; - //snes_ram[VTIMEH] = 0x1; - snes_ppu.interlace = 1; - snes_ppu.obj_interlace = 1; - snes_ppu.beam.current_vert = SNES_VTOTAL_NTSC; -} - - - - -#define CONTINUOUS 1 -#define INDIRECT 2 - -void dohdma(int line) -{ - int c; - for (c=0;c<8;c++) - { - if (!line) - { - hdmaaddr[c]=dmasrc[c]; - hdmacount[c]=0; - // if (c==2) - // printf("Reset HDMA %i loading from %02X%04X %i\n",c,dmabank[c],hdmaaddr[c],hdmacount[c]); - } - if (hdmaena&(1<= APU00 && offset < WMDATA) - { - writetospc(offset,data); - return; - } - - switch (offset) - { - - case SLHV: - vcount=lines; - hcount=(1364-cycles)>>2; - break; - case INIDISP: /* Initial settings for screen */ - if ((snes_ppu.screen_disabled & 0x80) && (!(data & 0x80))) //a 1->0 force blank transition causes a reset OAM address - { - // memory_write_byte(space, OAMADDL, snes_ppu.oam.saved_address_low); - // memory_write_byte(space, OAMADDH, snes_ppu.oam.saved_address_high); - } - snes_ppu.screen_disabled = data & 0x80; - snes_ppu.screen_brightness = (data & 0x0f) + 1; - break; - case OBSEL: /* Object size and data area designation */ - snes_ppu.oam.next_charmap = (data & 0x03) << 1; - snes_ppu.oam.next_name_select = (((data & 0x18) >> 3) * 0x1000) << 1; - snes_ppu.oam.next_size = (data & 0xe0) >> 5; - switch ((data & 0xe0) >> 5) - { - case 0: /* 8 & 16 */ - snes_ppu.oam.size[0] = 1; - snes_ppu.oam.size[1] = 2; - break; - case 1: /* 8 & 32 */ - snes_ppu.oam.size[0] = 1; - snes_ppu.oam.size[1] = 4; - break; - case 2: /* 8 & 64 */ - snes_ppu.oam.size[0] = 1; - snes_ppu.oam.size[1] = 8; - break; - case 3: /* 16 & 32 */ - snes_ppu.oam.size[0] = 2; - snes_ppu.oam.size[1] = 4; - break; - case 4: /* 16 & 64 */ - snes_ppu.oam.size[0] = 2; - snes_ppu.oam.size[1] = 8; - break; - case 5: /* 32 & 64 */ - snes_ppu.oam.size[0] = 4; - snes_ppu.oam.size[1] = 8; - break; - default: - /* Unknown size so default to 8 & 16 */ -// logerror("Object size unsupported: %d\n", (data & 0xe0) >> 5); - - snes_ppu.oam.size[0] = 1; - snes_ppu.oam.size[1] = 2; - break; - } - case OAMADDL: /* Address for accessing OAM (low) */ - snes_ppu.oam.address_low = data; - snes_ppu.oam.saved_address_low = data; - snes_ppu.oam.address = ((snes_ppu.oam.address_high & 0x1) << 8) + data; - snes_ram[OAMDATA] = 0; - break; - case OAMADDH: /* Address for accessing OAM (high) */ - snes_ppu.oam.address_high = data & 0x1; - snes_ppu.oam.saved_address_high = data; - snes_ppu.oam.address = ((data & 0x1) << 8) + snes_ppu.oam.address_low; - snes_ppu.oam.priority_rotation = BIT(data, 7); - snes_ram[OAMDATA] = 0; - break; - case OAMDATA: /* Data for OAM write (DW) */ - { - int oam_addr = snes_ppu.oam.address; - - if (oam_addr >= 0x100) - { - oam_addr &= 0x10f; - if (!(snes_ram[OAMDATA])) - { - snes_oam[oam_addr] &= 0xff00; - snes_oam[oam_addr] |= data; - } - else - { - snes_oam[oam_addr] &= 0x00ff; - snes_oam[oam_addr] |= (data << 8); - } - } - else - { - oam_addr &= 0x1ff; - if (!(snes_ram[OAMDATA])) - { - snes_ppu.oam.write_latch = data; - } - else - { - snes_oam[oam_addr] = (data << 8) | snes_ppu.oam.write_latch; - } - } - snes_ram[OAMDATA] = (snes_ram[OAMDATA] + 1) % 2; - if (snes_ram[OAMDATA] == 0) - { - snes_ram[OAMDATA] = 0; - snes_ppu.oam.address++; - snes_ppu.oam.address_low = snes_ram[OAMADDL] = snes_ppu.oam.address & 0xff; - snes_ppu.oam.address_high = snes_ram[OAMADDH] = (snes_ppu.oam.address >> 8) & 0x1; - } - return; - } - - case BGMODE: /* BG mode and character size settings */ - snes_ppu.mode = data & 0x07; - // snes_dynamic_res_change(space->machine); - snes_ppu.bg3_priority_bit = BIT(data, 3); - snes_ppu.layer[SNES_BG1].tile_size = BIT(data, 4); - snes_ppu.layer[SNES_BG2].tile_size = BIT(data, 5); - snes_ppu.layer[SNES_BG3].tile_size = BIT(data, 6); - snes_ppu.layer[SNES_BG4].tile_size = BIT(data, 7); - snes_ppu.update_offsets = 1; - break; - case MOSAIC: /* Size and screen designation for mosaic */ - /* FIXME: We support horizontal mosaic only partially */ - snes_ppu.mosaic_size = (data & 0xf0) >> 4; - snes_ppu.layer[SNES_BG1].mosaic_enabled = BIT(data, 0); - snes_ppu.layer[SNES_BG2].mosaic_enabled = BIT(data, 1); - snes_ppu.layer[SNES_BG3].mosaic_enabled = BIT(data, 2); - snes_ppu.layer[SNES_BG4].mosaic_enabled = BIT(data, 3); - break; - case BG1SC: /* Address for storing SC data BG1 SC size designation */ - case BG2SC: /* Address for storing SC data BG2 SC size designation */ - case BG3SC: /* Address for storing SC data BG3 SC size designation */ - case BG4SC: /* Address for storing SC data BG4 SC size designation */ - snes_ppu.layer[offset - BG1SC].tilemap = data & 0xfc; - snes_ppu.layer[offset - BG1SC].tilemap_size = data & 0x3; - break; - case BG12NBA: /* Address for BG 1 and 2 character data */ - snes_ppu.layer[SNES_BG1].charmap = (data & 0x0f); - snes_ppu.layer[SNES_BG2].charmap = (data & 0xf0) >> 4; - break; - case BG34NBA: /* Address for BG 3 and 4 character data */ - snes_ppu.layer[SNES_BG3].charmap = (data & 0x0f); - snes_ppu.layer[SNES_BG4].charmap = (data & 0xf0) >> 4; - break; - - // Anomie says "H Current = (Byte<<8) | (Prev&~7) | ((Current>>8)&7); V Current = (Current<<8) | Prev;" and Prev is shared by all scrolls but in Mode 7! - case BG1HOFS: /* BG1 - horizontal scroll (DW) */ - /* In Mode 0->6 we use ppu_last_scroll as Prev */ - snes_ppu.layer[SNES_BG1].hoffs = (data << 8) | (snes_ppu.ppu_last_scroll & ~7) | ((snes_ppu.layer[SNES_BG1].hoffs >> 8) & 7); - snes_ppu.ppu_last_scroll = data; - /* In Mode 7 we use mode7_last_scroll as Prev */ - snes_ppu.mode7.hor_offset = (data << 8) | (snes_ppu.mode7_last_scroll & ~7) | ((snes_ppu.mode7.hor_offset >> 8) & 7); - snes_ppu.mode7_last_scroll = data; - snes_ppu.update_offsets = 1; - return; - case BG1VOFS: /* BG1 - vertical scroll (DW) */ - /* In Mode 0->6 we use ppu_last_scroll as Prev */ - snes_ppu.layer[SNES_BG1].voffs = (data << 8) | snes_ppu.ppu_last_scroll; - snes_ppu.ppu_last_scroll = data; - /* In Mode 7 we use mode7_last_scroll as Prev */ - snes_ppu.mode7.ver_offset = (data << 8) | snes_ppu.mode7_last_scroll; - snes_ppu.mode7_last_scroll = data; - snes_ppu.update_offsets = 1; - return; - case BG2HOFS: /* BG2 - horizontal scroll (DW) */ - snes_ppu.layer[SNES_BG2].hoffs = (data << 8) | (snes_ppu.ppu_last_scroll & ~7) | ((snes_ppu.layer[SNES_BG2].hoffs >> 8) & 7); - snes_ppu.ppu_last_scroll = data; - snes_ppu.update_offsets = 1; - return; - case BG2VOFS: /* BG2 - vertical scroll (DW) */ - snes_ppu.layer[SNES_BG2].voffs = (data << 8) | (snes_ppu.ppu_last_scroll); - snes_ppu.ppu_last_scroll = data; - snes_ppu.update_offsets = 1; - return; - case BG3HOFS: /* BG3 - horizontal scroll (DW) */ - snes_ppu.layer[SNES_BG3].hoffs = (data << 8) | (snes_ppu.ppu_last_scroll & ~7) | ((snes_ppu.layer[SNES_BG3].hoffs >> 8) & 7); - snes_ppu.ppu_last_scroll = data; - snes_ppu.update_offsets = 1; - return; - case BG3VOFS: /* BG3 - vertical scroll (DW) */ - snes_ppu.layer[SNES_BG3].voffs = (data << 8) | (snes_ppu.ppu_last_scroll); - snes_ppu.ppu_last_scroll = data; - snes_ppu.update_offsets = 1; - return; - case BG4HOFS: /* BG4 - horizontal scroll (DW) */ - snes_ppu.layer[SNES_BG4].hoffs = (data << 8) | (snes_ppu.ppu_last_scroll & ~7) | ((snes_ppu.layer[SNES_BG4].hoffs >> 8) & 7); - snes_ppu.ppu_last_scroll = data; - snes_ppu.update_offsets = 1; - return; - case BG4VOFS: /* BG4 - vertical scroll (DW) */ - snes_ppu.layer[SNES_BG4].voffs = (data << 8) | (snes_ppu.ppu_last_scroll); - snes_ppu.ppu_last_scroll = data; - snes_ppu.update_offsets = 1; - return; - case VMAIN: /* VRAM address increment value designation */ - vram_fgr_high = (data & 0x80); - vram_fgr_increment = vram_fgr_inctab[data & 3]; - - if (data & 0xc) - { - int md = (data & 0xc) >> 2; - - vram_fgr_count = vram_fgr_inccnts[md]; - vram_fgr_mask = (vram_fgr_count * 8) - 1; - vram_fgr_shift = vram_fgr_shiftab[md]; - } - else - { - vram_fgr_count = 0; - } -// printf("VMAIN: high %x inc %x count %x mask %x shift %x\n", vram_fgr_high, vram_fgr_increment, vram_fgr_count, vram_fgr_mask, vram_fgr_shift); - break; - case VMADDL: /* Address for VRAM read/write (low) */ - case VMADDH: /* Address for VRAM read/write (high) */ - { - UINT32 addr; - - snes_ram[offset] = data; - addr = (snes_ram[VMADDH] << 8) | snes_ram[VMADDL]; - - if (vram_fgr_count) - { - UINT32 rem = addr & vram_fgr_mask; - UINT32 faddr = (addr & ~vram_fgr_mask) + (rem >> vram_fgr_shift) + ((rem & (vram_fgr_count - 1)) << 3); - - vram_read_buffer = snes_vram[(faddr << 1) & 0x1ffff] | snes_vram[((faddr << 1) + 1) & 0x1ffff] << 8; - } - else - { - vram_read_buffer = snes_vram[(addr << 1) & 0x1ffff] | snes_vram[((addr << 1) + 1) & 0x1ffff] << 8; - } - - } - break; - case VMDATAL: /* 2118: Data for VRAM write (low) */ - { - UINT32 addr = (snes_ram[VMADDH] << 8) | snes_ram[VMADDL]; - - if (vram_fgr_count) - { - UINT32 rem = addr & vram_fgr_mask; - UINT32 faddr = (addr & ~vram_fgr_mask) + (rem >> vram_fgr_shift) + ((rem & (vram_fgr_count - 1)) << 3); - - snes_vram[(faddr << 1) & 0x1ffff] = data; - } - else - { - snes_vram[(addr << 1) & 0x1ffff] = data; - } - - if (!vram_fgr_high) - { - addr += vram_fgr_increment; - snes_ram[VMADDL] = addr & 0xff; - snes_ram[VMADDH] = (addr >> 8) & 0xff; - } - } - return; - case VMDATAH: /* 2119: Data for VRAM write (high) */ - { - UINT32 addr = (snes_ram[VMADDH] << 8) | snes_ram[VMADDL]; - - if (vram_fgr_count) - { - UINT32 rem = addr & vram_fgr_mask; - UINT32 faddr = (addr & ~vram_fgr_mask) + (rem >> vram_fgr_shift) + ((rem & (vram_fgr_count - 1)) << 3); - - snes_vram[((faddr << 1) + 1) & 0x1ffff] = data; - } - else - { - snes_vram[((addr << 1) + 1) & 0x1ffff] = data; - } - - if (vram_fgr_high) - { - addr += vram_fgr_increment; - snes_ram[VMADDL] = addr & 0xff; - snes_ram[VMADDH] = (addr >> 8) & 0xff; - } - } - return; - case M7SEL: /* Mode 7 initial settings */ - snes_ppu.mode7.repeat = (data >> 6) & 3; - snes_ppu.mode7.vflip = BIT(data, 1); - snes_ppu.mode7.hflip = BIT(data, 0); - break; - /* As per Anomie's doc: Reg = (Current<<8) | Prev; and there is only one Prev, shared by these matrix regs and Mode 7 scroll regs */ - case M7A: /* Mode 7 COS angle/x expansion (DW) */ - snes_ppu.mode7.matrix_a = snes_ppu.mode7_last_scroll + (data << 8); - snes_ppu.mode7_last_scroll = data; - break; - case M7B: /* Mode 7 SIN angle/ x expansion (DW) */ - snes_ppu.mode7.matrix_b = snes_ppu.mode7_last_scroll + (data << 8); - snes_ppu.mode7_last_scroll = data; - break; - case M7C: /* Mode 7 SIN angle/y expansion (DW) */ - snes_ppu.mode7.matrix_c = snes_ppu.mode7_last_scroll + (data << 8); - snes_ppu.mode7_last_scroll = data; - break; - case M7D: /* Mode 7 COS angle/y expansion (DW) */ - snes_ppu.mode7.matrix_d = snes_ppu.mode7_last_scroll + (data << 8); - snes_ppu.mode7_last_scroll = data; - break; - case M7X: /* Mode 7 x center position (DW) */ - snes_ppu.mode7.origin_x = snes_ppu.mode7_last_scroll + (data << 8); - snes_ppu.mode7_last_scroll = data; - break; - case M7Y: /* Mode 7 y center position (DW) */ - snes_ppu.mode7.origin_y = snes_ppu.mode7_last_scroll + (data << 8); - snes_ppu.mode7_last_scroll = data; - break; - case CGADD: /* Initial address for colour RAM writing */ - /* CGRAM is 16-bit, but when reading/writing we treat it as - * 8-bit, so we need to double the address */ - cgram_address = data << 1; - break; - case CGDATA: /* Data for colour RAM */ - ((UINT8 *)snes_cgram)[cgram_address] = data; - cgram_address = (cgram_address + 1) % (SNES_CGRAM_SIZE - 2); - break; - case W12SEL: /* Window mask settings for BG1-2 */ - if (data != snes_ram[offset]) - { - snes_ppu.layer[SNES_BG1].window1_invert = BIT(data, 0); - snes_ppu.layer[SNES_BG1].window1_enabled = BIT(data, 1); - snes_ppu.layer[SNES_BG1].window2_invert = BIT(data, 2); - snes_ppu.layer[SNES_BG1].window2_enabled = BIT(data, 3); - snes_ppu.layer[SNES_BG2].window1_invert = BIT(data, 4); - snes_ppu.layer[SNES_BG2].window1_enabled = BIT(data, 5); - snes_ppu.layer[SNES_BG2].window2_invert = BIT(data, 6); - snes_ppu.layer[SNES_BG2].window2_enabled = BIT(data, 7); - snes_ppu.update_windows = 1; - } - break; - case W34SEL: /* Window mask settings for BG3-4 */ - if (data != snes_ram[offset]) - { - snes_ppu.layer[SNES_BG3].window1_invert = BIT(data, 0); - snes_ppu.layer[SNES_BG3].window1_enabled = BIT(data, 1); - snes_ppu.layer[SNES_BG3].window2_invert = BIT(data, 2); - snes_ppu.layer[SNES_BG3].window2_enabled = BIT(data, 3); - snes_ppu.layer[SNES_BG4].window1_invert = BIT(data, 4); - snes_ppu.layer[SNES_BG4].window1_enabled = BIT(data, 5); - snes_ppu.layer[SNES_BG4].window2_invert = BIT(data, 6); - snes_ppu.layer[SNES_BG4].window2_enabled = BIT(data, 7); - snes_ppu.update_windows = 1; - } - break; - case WOBJSEL: /* Window mask settings for objects */ - if (data != snes_ram[offset]) - { - snes_ppu.layer[SNES_OAM].window1_invert = BIT(data, 0); - snes_ppu.layer[SNES_OAM].window1_enabled = BIT(data, 1); - snes_ppu.layer[SNES_OAM].window2_invert = BIT(data, 2); - snes_ppu.layer[SNES_OAM].window2_enabled = BIT(data, 3); - snes_ppu.layer[SNES_COLOR].window1_invert = BIT(data, 4); - snes_ppu.layer[SNES_COLOR].window1_enabled = BIT(data, 5); - snes_ppu.layer[SNES_COLOR].window2_invert = BIT(data, 6); - snes_ppu.layer[SNES_COLOR].window2_enabled = BIT(data, 7); - snes_ppu.update_windows = 1; - } - break; - case WH0: /* Window 1 left position */ - if (data != snes_ram[offset]) - { - snes_ppu.window1_left = data; - snes_ppu.update_windows = 1; - } - break; - case WH1: /* Window 1 right position */ - if (data != snes_ram[offset]) - { - snes_ppu.window1_right = data; - snes_ppu.update_windows = 1; - } - break; - case WH2: /* Window 2 left position */ - if (data != snes_ram[offset]) - { - snes_ppu.window2_left = data; - snes_ppu.update_windows = 1; - } - break; - case WH3: /* Window 2 right position */ - if (data != snes_ram[offset]) - { - snes_ppu.window2_right = data; - snes_ppu.update_windows = 1; - } - break; - case WBGLOG: /* Window mask logic for BG's */ - if (data != snes_ram[offset]) - { - snes_ppu.layer[SNES_BG1].wlog_mask = data & 0x03; - snes_ppu.layer[SNES_BG2].wlog_mask = (data & 0x0c) >> 2; - snes_ppu.layer[SNES_BG3].wlog_mask = (data & 0x30) >> 4; - snes_ppu.layer[SNES_BG4].wlog_mask = (data & 0xc0) >> 6; - snes_ppu.update_windows = 1; - } - break; - case WOBJLOG: /* Window mask logic for objects */ - if (data != snes_ram[offset]) - { - snes_ppu.layer[SNES_OAM].wlog_mask = data & 0x03; - snes_ppu.layer[SNES_COLOR].wlog_mask = (data & 0x0c) >> 2; - snes_ppu.update_windows = 1; - } - break; - case TM: /* Main screen designation */ - snes_ppu.layer[SNES_BG1].main_bg_enabled = BIT(data, 0); - snes_ppu.layer[SNES_BG2].main_bg_enabled = BIT(data, 1); - snes_ppu.layer[SNES_BG3].main_bg_enabled = BIT(data, 2); - snes_ppu.layer[SNES_BG4].main_bg_enabled = BIT(data, 3); - snes_ppu.layer[SNES_OAM].main_bg_enabled = BIT(data, 4); - break; - case TS: /* Subscreen designation */ - snes_ppu.layer[SNES_BG1].sub_bg_enabled = BIT(data, 0); - snes_ppu.layer[SNES_BG2].sub_bg_enabled = BIT(data, 1); - snes_ppu.layer[SNES_BG3].sub_bg_enabled = BIT(data, 2); - snes_ppu.layer[SNES_BG4].sub_bg_enabled = BIT(data, 3); - snes_ppu.layer[SNES_OAM].sub_bg_enabled = BIT(data, 4); - break; - case TMW: /* Window mask for main screen designation */ - snes_ppu.layer[SNES_BG1].main_window_enabled = BIT(data, 0); - snes_ppu.layer[SNES_BG2].main_window_enabled = BIT(data, 1); - snes_ppu.layer[SNES_BG3].main_window_enabled = BIT(data, 2); - snes_ppu.layer[SNES_BG4].main_window_enabled = BIT(data, 3); - snes_ppu.layer[SNES_OAM].main_window_enabled = BIT(data, 4); - break; - case TSW: /* Window mask for subscreen designation */ - snes_ppu.layer[SNES_BG1].sub_window_enabled = BIT(data, 0); - snes_ppu.layer[SNES_BG2].sub_window_enabled = BIT(data, 1); - snes_ppu.layer[SNES_BG3].sub_window_enabled = BIT(data, 2); - snes_ppu.layer[SNES_BG4].sub_window_enabled = BIT(data, 3); - snes_ppu.layer[SNES_OAM].sub_window_enabled = BIT(data, 4); - break; - case CGWSEL: /* Initial settings for Fixed colour addition or screen addition */ - /* FIXME: We don't support direct select for modes 3 & 4 or subscreen window stuff */ - snes_ppu.clip_to_black = (data >> 6) & 0x03; - snes_ppu.prevent_color_math = (data >> 4) & 0x03; - snes_ppu.sub_add_mode = BIT(data, 1); - snes_ppu.direct_color = BIT(data, 0); -#ifdef SNES_DBG_REG_W - if ((data & 0x2) != (snes_ram[CGWSEL] & 0x2)) - mame_printf_debug( "Add/Sub Layer: %s\n", ((data & 0x2) >> 1) ? "Subscreen" : "Fixed colour" ); -#endif - break; - case CGADSUB: /* Addition/Subtraction designation for each screen */ - snes_ppu.color_modes = data & 0xc0; - snes_ppu.layer[SNES_BG1].color_math = BIT(data, 0); - snes_ppu.layer[SNES_BG2].color_math = BIT(data, 1); - snes_ppu.layer[SNES_BG3].color_math = BIT(data, 2); - snes_ppu.layer[SNES_BG4].color_math = BIT(data, 3); - snes_ppu.layer[SNES_OAM].color_math = BIT(data, 4); - snes_ppu.layer[SNES_COLOR].color_math = BIT(data, 5); - break; - case COLDATA: /* Fixed colour data for fixed colour addition/subtraction */ - { - /* Store it in the extra space we made in the CGRAM. It doesn't really go there, but it's as good a place as any. */ - UINT8 r, g, b; - - /* Get existing value. */ - r = snes_cgram[FIXED_COLOUR] & 0x1f; - g = (snes_cgram[FIXED_COLOUR] & 0x3e0) >> 5; - b = (snes_cgram[FIXED_COLOUR] & 0x7c00) >> 10; - /* Set new value */ - if (data & 0x20) - r = data & 0x1f; - if (data & 0x40) - g = data & 0x1f; - if (data & 0x80) - b = data & 0x1f; - snes_cgram[FIXED_COLOUR] = (r | (g << 5) | (b << 10)); - } break; - case SETINI: /* Screen mode/video select */ - /* FIXME: We only support line count and interlace here */ - snes_ppu.interlace = (data & 0x01) ? 2 : 1; - snes_ppu.obj_interlace = (data & 0x02) ? 2 : 1; - snes_ppu.beam.last_visible_line = (data & 0x04) ? 240 : 225; - snes_ppu.pseudo_hires = BIT(data, 3); - snes_ppu.mode7.extbg = BIT(data, 6); - // snes_dynamic_res_change(space->machine); -#ifdef SNES_DBG_REG_W - if ((data & 0x8) != (snes_ram[SETINI] & 0x8)) - mame_printf_debug( "Pseudo 512 mode: %s\n", (data & 0x8) ? "on" : "off" ); -#endif - break; - case APU00: case APU01: case APU02: case APU03: - - writetospc(offset,data); - break; - - default: - printf("%x, %x",offset,data); - break; - } -} - - - -static UINT8 read_ophct =0; -static UINT8 read_opvct =0; -static UINT8 temp=0; -unsigned char readppu(unsigned short offset) -{ -// snes_state *state = (snes_state *)space->machine->driver_data; - UINT8 value = 0; - - // APU is mirrored from 2140 to 217f - if (offset >= APU00 && offset < WMDATA) - { - return readfromspc(offset & 0x3); -// return spc_port_out[offset & 0x3]; - } - - /* offset is from 0x000000 */ - switch (offset) - { - case OAMDATA: /* 21xy for x=0,1,2 and y=4,5,6,8,9,a returns PPU1 open bus*/ - case BGMODE: - case MOSAIC: - case BG2SC: - case BG3SC: - case BG4SC: - case BG4VOFS: - case VMAIN: - case VMADDL: - case VMDATAL: - case VMDATAH: - case M7SEL: - case W34SEL: - case WOBJSEL: - case WH0: - case WH2: - case WH3: - case WBGLOG: - return snes_ppu.ppu1_open_bus; - -// According to BSNES, these should return snes_open_bus_r! -// case OAMADDL: -// case OAMADDH: -// case VMADDH: -// case CGADD: -// case CGDATA: -// return snes_ram[offset]; - case MPYL: /* Multiplication result (low) */ - { - /* Perform 16bit * 8bit multiply */ - UINT32 c = snes_ppu.mode7.matrix_a * (INT8)(snes_ppu.mode7.matrix_b >> 8); - snes_ppu.ppu1_open_bus = c & 0xff; - return snes_ppu.ppu1_open_bus; - } - case MPYM: /* Multiplication result (mid) */ - { - /* Perform 16bit * 8bit multiply */ - UINT32 c = snes_ppu.mode7.matrix_a * (INT8)(snes_ppu.mode7.matrix_b >> 8); - snes_ppu.ppu1_open_bus = (c >> 8) & 0xff; - return snes_ppu.ppu1_open_bus; - } - case MPYH: /* Multiplication result (high) */ - { - /* Perform 16bit * 8bit multiply */ - UINT32 c = snes_ppu.mode7.matrix_a * (INT8)(snes_ppu.mode7.matrix_b >> 8); - snes_ppu.ppu1_open_bus = (c >> 16) & 0xff; - return snes_ppu.ppu1_open_bus; - } - case SLHV: /* Software latch for H/V counter */ - temp=vcount&0xFF; - vcount>>=8; - return temp; - case ROAMDATA: /* Read data from OAM (DR) */ - { - int oam_addr = snes_ppu.oam.address; - - if (oam_addr & 0x100) - { - oam_addr &= 0x10f; - } - else - { - oam_addr &= 0x1ff; - } - - snes_ppu.ppu1_open_bus = (snes_oam[oam_addr] >> (snes_ram[OAMDATA] << 3)) & 0xff; - snes_ram[OAMDATA] = (snes_ram[OAMDATA] + 1) % 2; - if (snes_ram[OAMDATA] == 0) - { - snes_ppu.oam.address++; - snes_ppu.oam.address_low = snes_ram[OAMADDL] = snes_ppu.oam.address & 0xff; - snes_ppu.oam.address_high = snes_ram[OAMADDH] = (snes_ppu.oam.address >> 8) & 0x1; - } - return snes_ppu.ppu1_open_bus; - } - case RVMDATAL: /* Read data from VRAM (low) */ - { - UINT32 addr = (snes_ram[VMADDH] << 8) | snes_ram[VMADDL]; - - snes_ppu.ppu1_open_bus = vram_read_buffer & 0xff; - - if (!vram_fgr_high) - { - if (vram_fgr_count) - { - UINT32 rem = addr & vram_fgr_mask; - UINT32 faddr = (addr & ~vram_fgr_mask) + (rem >> vram_fgr_shift) + - ((rem & (vram_fgr_count - 1)) << 3); - - vram_read_buffer = snes_vram[(faddr<<1)&0x1ffff] | snes_vram[((faddr<<1)+1) & 0x1ffff]<<8; - } - else - { - vram_read_buffer = snes_vram[(addr<<1)&0x1ffff] | snes_vram[((addr<<1)+1) & 0x1ffff]<<8; - } - - addr += vram_fgr_increment; - snes_ram[VMADDL] = addr&0xff; - snes_ram[VMADDH] = (addr>>8)&0xff; - } - } - return snes_ppu.ppu1_open_bus; - case RVMDATAH: /* Read data from VRAM (high) */ - { - UINT32 addr = (snes_ram[VMADDH] << 8) | snes_ram[VMADDL]; - - snes_ppu.ppu1_open_bus = (vram_read_buffer>>8) & 0xff; - - if (vram_fgr_high) - { - if (vram_fgr_count) - { - UINT32 rem = addr & vram_fgr_mask; - UINT32 faddr = (addr & ~vram_fgr_mask) + (rem >> vram_fgr_shift) + - ((rem & (vram_fgr_count - 1)) << 3); - - vram_read_buffer = snes_vram[(faddr<<1)&0x1ffff] | snes_vram[((faddr<<1)+1) & 0x1ffff]<<8; - } - else - { - vram_read_buffer = snes_vram[(addr<<1)&0x1ffff] | snes_vram[((addr<<1)+1) & 0x1ffff]<<8; - } - - addr += vram_fgr_increment; - snes_ram[VMADDL] = addr&0xff; - snes_ram[VMADDH] = (addr>>8)&0xff; - } - } - return snes_ppu.ppu1_open_bus; - case RCGDATA: /* Read data from CGRAM */ - if (!(cgram_address & 0x01)) - { - snes_ppu.ppu2_open_bus = ((UINT8 *)snes_cgram)[cgram_address] & 0xff; - } - else - { - snes_ppu.ppu2_open_bus &= 0x80; - snes_ppu.ppu2_open_bus |= ((UINT8 *)snes_cgram)[cgram_address] & 0x7f; - } - - cgram_address = (cgram_address + 1) % (SNES_CGRAM_SIZE - 2); - return snes_ppu.ppu2_open_bus; - case OPHCT: /* Horizontal counter data by ext/soft latch */ - { - if (read_ophct) - { - snes_ppu.ppu2_open_bus &= 0xfe; - snes_ppu.ppu2_open_bus |= (snes_ppu.beam.latch_horz >> 8) & 0x01; - } - else - { - snes_ppu.ppu2_open_bus = snes_ppu.beam.latch_horz & 0xff; - } - read_ophct ^= 1; - return snes_ppu.ppu2_open_bus; - } - case OPVCT: /* Vertical counter data by ext/soft latch */ - { - if (read_opvct) - { - snes_ppu.ppu2_open_bus &= 0xfe; - snes_ppu.ppu2_open_bus |= (snes_ppu.beam.latch_vert >> 8) & 0x01; - } - else - { - snes_ppu.ppu2_open_bus = snes_ppu.beam.latch_vert & 0xff; - } - read_opvct ^= 1; - return snes_ppu.ppu2_open_bus; - } - case STAT77: /* PPU status flag and version number */ - value = snes_ppu.stat77_flags & 0xc0; // 0x80 & 0x40 are Time Over / Range Over Sprite flags, set by the video code - // 0x20 - Master/slave mode select. Little is known about this bit. We always seem to read back 0 here. - value |= (snes_ppu.ppu1_open_bus & 0x10); - value |= (snes_ppu.ppu1_version & 0x0f); - snes_ppu.stat77_flags = value; // not sure if this is needed... - snes_ppu.ppu1_open_bus = value; - return snes_ppu.ppu1_open_bus; - case STAT78: /* PPU status flag and version number */ - read_ophct = 0; - read_opvct = 0; - value = snes_ram[offset]; - value |= (snes_ppu.ppu1_open_bus & 0x20); - value |= (snes_ppu.ppu2_version & 0x0f); - snes_ram[offset] = value; // not sure if this is needed... - snes_ppu.ppu2_open_bus = value; - return snes_ppu.ppu2_open_bus; - case WMDATA: /* Data to read from WRAM */ - { - UINT32 addr = ((snes_ram[WMADDH] & 0x1) << 16) | (snes_ram[WMADDM] << 8) | snes_ram[WMADDL]; - value = snes_ram[addr++]; - //value = memory_read_byte(space, 0x7e0000 + addr++); - addr &= 0x1ffff; - snes_ram[WMADDH] = (addr >> 16) & 0x1; - snes_ram[WMADDM] = (addr >> 8) & 0xff; - snes_ram[WMADDL] = addr & 0xff; - return value; - } - case WMADDL: /* Address to read/write to wram (low) */ - case WMADDM: /* Address to read/write to wram (mid) */ - case WMADDH: /* Address to read/write to wram (high) */ - return snes_ram[offset]; - } - return 0xff; -} - - -void dumpvram() -{ -} diff --git a/jan/src/burn/drv/snes/snes_spc700.cpp b/jan/src/burn/drv/snes/snes_spc700.cpp deleted file mode 100644 index 33658fcfb..000000000 --- a/jan/src/burn/drv/snes/snes_spc700.cpp +++ /dev/null @@ -1,1923 +0,0 @@ -#include -#include "snes.h" - -int spcoutput; - -int spctotal,dsptotal; - -double spccycles; -double spctotal2; -double spctotal3; - -struct SPC_Struct -{ - union - { - unsigned short w; - struct - { - unsigned char a,y; - } b; - } ya; - unsigned char x; - unsigned char s; - unsigned short pc; - struct SPC_P - { - int n,v,p,b,h,i,z,c; - } p; -} spc; - - -unsigned char *spcram; -unsigned char spcrom[64]= -{ - 0xCD,0xEF,0xBD,0xE8,0x00,0xC6,0x1D,0xD0, - 0xFC,0x8F,0xAA,0xF4,0x8F,0xBB,0xF5,0x78, - 0xCC,0xF4,0xD0,0xFB,0x2F,0x19,0xEB,0xF4, - 0xD0,0xFC,0x7E,0xF4,0xD0,0x0B,0xE4,0xF5, - 0xCB,0xF4,0xD7,0x00,0xFC,0xD0,0xF3,0xAB, - 0x01,0x10,0xEF,0x7E,0xF4,0x10,0xEB,0xBA, - 0xF6,0xDA,0x00,0xBA,0xF4,0xC4,0xF4,0xDD, - 0x5D,0xD0,0xDB,0x1F,0x00,0x00,0xC0,0xFF -}; - -unsigned char *spcreadhigh; -unsigned char spctocpu[4]; -unsigned char dspaddr; -unsigned char voiceon; -int spctimer[3],spctimer2[3],spclimit[3]; - -unsigned char readfromspc(unsigned short addr) -{ - return spctocpu[addr&3]; -} - -void writetospc(unsigned short addr, unsigned char val) -{ - spcram[(addr&3)+0xF4]=val; -} - - - -void writespcregs(unsigned short a, unsigned char v) -{ - switch (a) - { - case 0xF1: - if (v&0x10) spcram[0xF4]=spcram[0xF5]=0; - if (v&0x20) spcram[0xF6]=spcram[0xF7]=0; - spcram[0xF1]=v; - if (v&0x80) spcreadhigh=spcrom; - else spcreadhigh=spcram+0xFFC0; - // printf("Write F1 %02X %04X\n",v,spc.pc); - break; - case 0xF4: case 0xF5: case 0xF6: case 0xF7: - spctocpu[a&3]=v; - // printf("SPC writes %02X to %02X\n",v,a); - break; - case 0xFA: case 0xFB: case 0xFC: - spclimit[a-0xFA]=v; - // printf("SPC limit %i = %02X\n",a-0xFA,v); - break; - case 0xFD: case 0xFE: case 0xFF: - spcram[a]=v; - break; - } -} - -unsigned short getspcpc() -{ - return spc.pc; -} -unsigned char readspcregs(unsigned short a) -{ - unsigned char v; - switch (a) - { - case 0xFD: case 0xFE: case 0xFF: - // printf("Read timer %04X\n",spc.pc); - v=spcram[a]; - spcram[a]=0; - return v; - } - return spcram[a]; -} - -#define readspc(a) ((((a)&0xFFC0)==0xFFC0)?spcreadhigh[(a)&63]:((((a)&0xFFF0)==0xF0)?readspcregs(a):spcram[a])) -#define writespc(a,v) /*if ((a)==0x17 || (a)==0x221) printf("Write %04X %02X %04X\n",a,v,spc.pc); */if (((a)&0xFFF0)==0xF0) writespcregs(a,v); else spcram[a]=v - -void initspc() -{ - spcram=(UINT8*)BurnMalloc(65536); - memset(spcram,0,65536); -} - -void exitspc() -{ - BurnFree(spcram); -} - -void resetspc() -{ - memset(&spc,0,sizeof(spc)); - spc.pc=0xFFC0; - spcreadhigh=spcrom; - spc.x=spc.ya.w=0; - spccycles=0; - spc.p.p=0; - spctimer[0]=spctimer[1]=spctimer[2]=0; - spctimer2[0]=spctimer2[1]=spctimer2[2]=0; - spcram[0xF1]=0x80; -} - -#define getdp() addr=readspc(spc.pc)|spc.p.p; spc.pc++ -#define getdpx() addr=((readspc(spc.pc)+spc.x)&0xFF)|spc.p.p; spc.pc++ -#define getdpy() addr=((readspc(spc.pc)+spc.ya.b.y)&0xFF)|spc.p.p; spc.pc++ -#define getabs() addr=readspc(spc.pc)|(readspc(spc.pc+1)<<8); spc.pc+=2 - -#define setspczn(v) spc.p.z=!(v); spc.p.n=(v)&0x80 -#define setspczn16(v) spc.p.z=!(v); spc.p.n=(v)&0x8000 - -#define spccycles(c) spccount+=c - -#define ADC(ac,temp) tempw=ac+temp+((spc.p.c)?1:0); \ - spc.p.v=(!((ac^temp)&0x80)&&((ac^tempw)&0x80)); \ - ac=tempw&0xFF; \ - setspczn(ac); \ - spc.p.c=tempw&0x100; - -#define SBC(ac,temp) tempw=ac-temp-((spc.p.c)?0:1); \ - spc.p.v=(((ac^temp)&0x80)&&((ac^tempw)&0x80)); \ - ac=tempw&0xFF; \ - setspczn(ac); \ - spc.p.c=tempw<=0xFF; - -unsigned short spc2,spc3; -void execspc() -{ - unsigned char opcode,temp,temp2; - unsigned short addr,addr2,tempw; - unsigned long templ; - int spccount; - // snemlog("ExecSPC %i\n",spccycles); - while (spccycles>0) - { - spc3=spc2; - spc2=spc.pc; - spccount=0; - opcode=readspc(spc.pc); spc.pc++; - switch (opcode) - { - case 0x00: /*NOP*/ - spccycles(2); - break; - - case 0x02: /*SET1 d.0*/ - getdp(); - temp=readspc(addr)|0x01; - writespc(addr,temp); - spccycles(4); - break; - case 0x22: /*SET1 d.1*/ - getdp(); - temp=readspc(addr)|0x02; - writespc(addr,temp); - spccycles(4); - break; - case 0x42: /*SET1 d.2*/ - getdp(); - temp=readspc(addr)|0x04; - writespc(addr,temp); - spccycles(4); - break; - case 0x62: /*SET1 d.3*/ - getdp(); - temp=readspc(addr)|0x08; - writespc(addr,temp); - spccycles(4); - break; - case 0x82: /*SET1 d.4*/ - getdp(); - temp=readspc(addr)|0x10; - writespc(addr,temp); - spccycles(4); - break; - case 0xA2: /*SET1 d.5*/ - getdp(); - temp=readspc(addr)|0x20; - writespc(addr,temp); - spccycles(4); - break; - case 0xC2: /*SET1 d.6*/ - getdp(); - temp=readspc(addr)|0x40; - writespc(addr,temp); - spccycles(4); - break; - case 0xE2: /*SET1 d.7*/ - getdp(); - temp=readspc(addr)|0x80; - writespc(addr,temp); - spccycles(4); - break; - - case 0x12: /*CLR1 d.0*/ - getdp(); - temp=readspc(addr)&~0x01; - writespc(addr,temp); - spccycles(4); - break; - case 0x32: /*CLR1 d.1*/ - getdp(); - temp=readspc(addr)&~0x02; - writespc(addr,temp); - spccycles(4); - break; - case 0x52: /*CLR1 d.2*/ - getdp(); - temp=readspc(addr)&~0x04; - writespc(addr,temp); - spccycles(4); - break; - case 0x72: /*CLR1 d.3*/ - getdp(); - temp=readspc(addr)&~0x08; - writespc(addr,temp); - spccycles(4); - break; - case 0x92: /*CLR1 d.4*/ - getdp(); - temp=readspc(addr)&~0x10; - writespc(addr,temp); - spccycles(4); - break; - case 0xB2: /*CLR1 d.5*/ - getdp(); - temp=readspc(addr)&~0x20; - writespc(addr,temp); - spccycles(4); - break; - case 0xD2: /*CLR1 d.6*/ - getdp(); - temp=readspc(addr)&~0x40; - writespc(addr,temp); - spccycles(4); - break; - case 0xF2: /*CLR1 d.7*/ - getdp(); - temp=readspc(addr)&~0x80; - writespc(addr,temp); - spccycles(4); - break; - - case 0x04: /*OR A,(xx)*/ - getdp(); - spc.ya.b.a|=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(3); - break; - - case 0x05: /*OR A,(xxxx)*/ - getabs(); - spc.ya.b.a|=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(4); - break; - - case 0x06: /*OR A,(X)*/ - addr=spc.x+spc.p.p; - spc.ya.b.a|=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(3); - break; - - case 0x07: /*OR A,(xx+X)*/ - getdpx(); - addr2=readspc(addr)+(readspc(addr+1)<<8); - spc.ya.b.a|=readspc(addr2); - setspczn(spc.ya.b.a); - spccycles(6); - break; - - case 0x08: /*OR A,#*/ - spc.ya.b.a|=readspc(spc.pc); spc.pc++; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0x09: /*OR (xx),(xx)*/ - addr=readspc(spc.pc)+spc.p.p; spc.pc++; - addr2=readspc(spc.pc)+spc.p.p; spc.pc++; - temp=readspc(addr)|readspc(addr2); - setspczn(temp); - writespc(addr2,temp); - spccycles(6); - break; - - case 0x0B: /*ASL (xx)*/ - getdp(); - temp=readspc(addr); - spc.p.c=temp&0x80; - temp<<=1; - setspczn(temp); - writespc(addr,temp); - spccycles(4); - break; - - case 0x0C: /*ASL (xxxx)*/ - getabs(); - temp=readspc(addr); - spc.p.c=temp&0x80; - temp<<=1; - setspczn(temp); - writespc(addr,temp); - spccycles(4); - break; - - case 0x0D: /*PUSH PSW*/ - temp=(spc.p.c)?1:0; - if (spc.p.z) temp|=0x02; - if (spc.p.i) temp|=0x04; - if (spc.p.h) temp|=0x08; - if (spc.p.b) temp|=0x10; - if (spc.p.p) temp|=0x20; - if (spc.p.v) temp|=0x40; - if (spc.p.n) temp|=0x80; - writespc(spc.s+0x100,temp); spc.s--; - spccycles(4); - break; - - case 0x0E: /*TSET1 xxxx*/ - getabs(); - temp=readspc(addr); - setspczn(spc.ya.b.a&temp); - temp|=spc.ya.b.a; - writespc(addr,temp); - spccycles(6); - break; - - case 0x10: /*BPL*/ - addr=readspc(spc.pc); spc.pc++; - if (addr&0x80) addr|=0xFF00; - if (!spc.p.n) - { - spc.pc+=addr; - spccycles(2); - } - spccycles(2); - break; - - case 0x14: /*OR A,(xx+X)*/ - getdpx(); - spc.ya.b.a|=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(4); - break; - - case 0x15: /*OR A,(xxxx+X)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.x; spc.pc+=2; - spc.ya.b.a|=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(5); - break; - - case 0x16: /*OR A,(xxxx+Y)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.ya.b.y; spc.pc+=2; - spc.ya.b.a|=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(5); - break; - - case 0x17: /*OR A,(xx)+Y*/ - getdp(); - addr2=readspc(addr)+(readspc(addr+1)<<8)+spc.ya.b.y; - spc.ya.b.a|=readspc(addr2); - setspczn(spc.ya.b.a); - spccycles(6); - break; - - case 0x18: /*OR (xx),#*/ - temp2=readspc(spc.pc); spc.pc++; - getdp(); - temp2|=readspc(addr); - setspczn(temp2); - writespc(addr,temp2); - spccycles(5); - break; - - case 0x1A: /*DECW xx*/ - getdp(); - tempw=(readspc(addr)+(readspc(addr+1)<<8))-1; - writespc(addr,tempw&0xFF); - writespc(addr+1,tempw>>8); - spc.p.z=!tempw; spc.p.n=tempw&0x8000; - spccycles(6); - break; - - case 0x1B: /*ASL (xx+X)*/ - getdpx(); - temp=readspc(addr); - spc.p.c=temp&0x80; - temp<<=1; - setspczn(temp); - writespc(addr,temp); - spccycles(4); - break; - - case 0x1C: /*ASL A*/ - spc.p.c=spc.ya.b.a&0x80; - spc.ya.b.a<<=1; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0x1D: /*DEC X*/ - spc.x--; - setspczn(spc.x); - spccycles(2); - break; - - case 0x1E: /*CMP X,(xxxx)*/ - getabs(); - temp=readspc(addr); - setspczn(spc.x-temp); - spc.p.c=(spc.x>=temp); - spccycles(4); - break; - - case 0x1F: /*JMP (xxxx+X)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.x; spc.pc+=2; - spc.pc=readspc(addr)|(readspc(addr+1)<<8); - // printf("JMPx %06X\n",spc.pc); - spccycles(6); - break; - - case 0x20: /*CLRP*/ - spc.p.p=0; - spccycles(2); - break; - - case 0x24: /*AND A,(xx)*/ - getdp(); - spc.ya.b.a&=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(3); - break; - - case 0x25: /*AND A,(xxxx)*/ - getabs(); - spc.ya.b.a&=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(4); - break; - - case 0x26: /*AND A,(X)*/ - addr=spc.x+spc.p.p; - spc.ya.b.a&=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(3); - break; - - case 0x27: /*AND A,(xx+X)*/ - getdpx(); - addr2=readspc(addr)+(readspc(addr+1)<<8); - spc.ya.b.a&=readspc(addr2); - setspczn(spc.ya.b.a); - spccycles(6); - break; - - case 0x28: /*AND A,#*/ - spc.ya.b.a&=readspc(spc.pc); spc.pc++; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0x29: /*AND (xx),(xx)*/ - addr=readspc(spc.pc)+spc.p.p; spc.pc++; - addr2=readspc(spc.pc)+spc.p.p; spc.pc++; - temp=readspc(addr)&readspc(addr2); - setspczn(temp); - writespc(addr2,temp); - spccycles(6); - break; - - case 0x2B: /*ROL (xx)*/ - getdp(); - temp=readspc(addr); - templ=spc.p.c; - spc.p.c=temp&0x80; - temp<<=1; - if (templ) temp|=1; - setspczn(temp); - writespc(addr,temp); - spccycles(4); - break; - - case 0x2D: /*PUSH A*/ - writespc(spc.s+0x100,spc.ya.b.a); spc.s--; - spccycles(4); - break; - - case 0x2E: /*CBNE A,(xx)*/ - getdp(); - temp=readspc(addr); - addr=readspc(spc.pc); spc.pc++; - if (addr&0x80) addr|=0xFF00; - if (spc.ya.b.a!=temp) - { - spc.pc+=addr; - spccycles(2); - } - spccycles(5); - break; - - case 0x2F: /*BRA*/ - addr=readspc(spc.pc); spc.pc++; - if (addr&0x80) addr|=0xFF00; - spc.pc+=addr; - spccycles(4); - break; - - case 0x30: /*BMI*/ - addr=readspc(spc.pc); spc.pc++; - if (addr&0x80) addr|=0xFF00; - if (spc.p.n) - { - spc.pc+=addr; - spccycles(2); - } - spccycles(2); - break; - - case 0x35: /*AND A,(xxxx+X)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.x; spc.pc+=2; - spc.ya.b.a&=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(5); - break; - - case 0x36: /*AND A,(xxxx+Y)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.ya.b.y; spc.pc+=2; - spc.ya.b.a&=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(5); - break; - - case 0x38: /*AND (xx),#*/ - temp2=readspc(spc.pc); spc.pc++; - getdp(); - temp2&=readspc(addr); - setspczn(temp2); - writespc(addr,temp2); - spccycles(5); - break; - - case 0x3A: /*INCW xx*/ - getdp(); - tempw=readspc(addr)+(readspc(addr+1)<<8)+1; - writespc(addr,tempw&0xFF); - writespc(addr+1,tempw>>8); - spc.p.z=!tempw; spc.p.n=tempw&0x8000; - spccycles(6); - break; - - case 0x3C: /*ROL A*/ - templ=spc.p.c; - spc.p.c=spc.ya.b.a&0x80; - spc.ya.b.a<<=1; - if (templ) spc.ya.b.a|=1; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0x3D: /*INC X*/ - spc.x++; - setspczn(spc.x); - spccycles(2); - break; - - case 0x3E: /*CMP X,(xx)*/ - getdp(); - temp=readspc(addr); - setspczn(spc.x-temp); - spc.p.c=(spc.x>=temp); - spccycles(3); - break; - - case 0x3F: /*CALL*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8); spc.pc+=2; - // printf("CALL %04X->",spc.pc); - writespc(spc.s+0x100,spc.pc>>8); spc.s--; - writespc(spc.s+0x100,spc.pc&0xFF); spc.s--; - spc.pc=addr; - // printf("%04X\n",spc.pc); - spccycles(8); - break; - - case 0x40: /*SETP*/ - // printf("SETP!!\n"); - spc.p.p=0x100; - spccycles(2); - break; - - case 0x44: /*EOR A,(xx)*/ - getdp(); - spc.ya.b.a^=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(3); - break; - - case 0x45: /*EOR A,(xxxx)*/ - getabs(); - spc.ya.b.a^=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(4); - break; - - case 0x46: /*EOR A,(X)*/ - addr=spc.x+spc.p.p; - spc.ya.b.a^=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(3); - break; - - case 0x47: /*EOR A,(xx+X)*/ - getdpx(); - addr2=readspc(addr)+(readspc(addr+1)<<8); - spc.ya.b.a^=readspc(addr2); - setspczn(spc.ya.b.a); - spccycles(6); - break; - - case 0x48: /*EOR A,#*/ - spc.ya.b.a^=readspc(spc.pc); spc.pc++; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0x49: /*EOR (xx),(xx)*/ - addr=readspc(spc.pc)+spc.p.p; spc.pc++; - addr2=readspc(spc.pc)+spc.p.p; spc.pc++; - temp=readspc(addr)^readspc(addr2); - setspczn(temp); - writespc(addr2,temp); - spccycles(6); - break; - - case 0x4B: /*LSR (xx)*/ - getdp(); - temp=readspc(addr); - spc.p.c=temp&1; - temp>>=1; - setspczn(temp); - writespc(addr,temp); - spccycles(4); - break; - - case 0x4C: /*LSR (xxxx)*/ - getabs(); - temp=readspc(addr); - spc.p.c=temp&1; - temp>>=1; - setspczn(temp); - writespc(addr,temp); - spccycles(5); - break; - - case 0x4D: /*PUSH X*/ - writespc(spc.s+0x100,spc.x); spc.s--; - spccycles(4); - break; - - case 0x4E: /*TCLR1 xxxx*/ - getabs(); - temp=readspc(addr); - setspczn(spc.ya.b.a&temp); - temp&=~spc.ya.b.a; - writespc(addr,temp); - spccycles(6); - break; - - case 0x4F: /*PCALL*/ - temp=readspc(spc.pc); spc.pc++; - writespc(spc.s+0x100,spc.pc>>8); spc.s--; - writespc(spc.s+0x100,spc.pc&0xFF); spc.s--; - spc.pc=0xFF00|temp; - spccycles(6); - break; - - case 0x50: /*BVC*/ - addr=readspc(spc.pc); spc.pc++; - if (addr&0x80) addr|=0xFF00; - if (!spc.p.v) - { - spc.pc+=addr; - spccycles(2); - } - spccycles(2); - break; - - case 0x55: /*EOR A,(xxxx+X)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.x; spc.pc+=2; - spc.ya.b.a^=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(5); - break; - - case 0x56: /*EOR A,(xxxx+Y)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.ya.b.y; spc.pc+=2; - spc.ya.b.a^=readspc(addr); - setspczn(spc.ya.b.a); - spccycles(5); - break; - - case 0x58: /*EOR (xx),#*/ - temp2=readspc(spc.pc); spc.pc++; - getdp(); - temp2^=readspc(addr); - setspczn(temp2); - writespc(addr,temp2); - spccycles(5); - break; - - case 0x5A: /*CMPW YA,xx*/ - getdp(); - tempw=readspc(addr)|(readspc(addr+1)<<8); - setspczn16(spc.ya.w-tempw); - spccycles(4); - break; - - case 0x5B: /*LSR (xx+X)*/ - getdpx(); - temp=readspc(addr); - spc.p.c=temp&1; - temp>>=1; - setspczn(temp); - writespc(addr,temp); - spccycles(5); - break; - - case 0x5C: /*LSR A*/ - spc.p.c=spc.ya.b.a&1; - spc.ya.b.a>>=1; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0x5D: /*MOV X,A*/ - spc.x=spc.ya.b.a; - setspczn(spc.x); - spccycles(2); - break; - - case 0x5E: /*CMP Y,(xxxx)*/ - getabs(); - temp=readspc(addr); - setspczn(spc.ya.b.y-temp); - spc.p.c=(spc.ya.b.y>=temp); - spccycles(4); - break; - - case 0x5F: /*JMP xxxx*/ - getabs(); - spc.pc=addr; - // printf("JMP %04X\n",spc.pc); - spccycles(3); - break; - - case 0x60: /*CLRC*/ - spc.p.c=0; - spccycles(2); - break; - - case 0x64: /*CMP A,(xx)*/ - getdp(); - temp=readspc(addr); - setspczn(spc.ya.b.a-temp); - spc.p.c=(spc.ya.b.a>=temp); - spccycles(3); - break; - - case 0x65: /*CMP A,(xxxx)*/ - getabs(); - temp=readspc(addr); - setspczn(spc.ya.b.a-temp); - spc.p.c=(spc.ya.b.a>=temp); - spccycles(4); - break; - - case 0x66: /*CMP A,(X)*/ - addr=spc.x+spc.p.p; - temp=readspc(addr); - setspczn(spc.ya.b.a-temp); - spc.p.c=(spc.ya.b.a>=temp); - spccycles(3); - break; - - case 0x68: /*CMP A,#*/ - temp=readspc(spc.pc); spc.pc++; - setspczn(spc.ya.b.a-temp); - spc.p.c=(spc.ya.b.a>=temp); - spccycles(2); - break; - - case 0x69: /*CMP (xx),(xx)*/ - getdp(); addr2=addr; - getdp(); - temp=readspc(addr2); - temp2=readspc(addr); - spc.p.c=(temp>=temp2); - setspczn(temp-temp2); - spccycles(6); - break; - - case 0x6B: /*ROR (xx)*/ - getdp(); - temp=readspc(addr); - templ=spc.p.c; - spc.p.c=temp&1; - temp>>=1; - if (templ) temp|=0x80; - setspczn(temp); - writespc(addr,temp); - spccycles(4); - break; - - case 0x6D: /*PUSH Y*/ - writespc(spc.s+0x100,spc.ya.b.y); spc.s--; - spccycles(4); - break; - - case 0x6E: /*DBNZ (xx)*/ - getdp(); - temp=readspc(addr)-1; - writespc(addr,temp); - addr=readspc(spc.pc); spc.pc++; - if (addr&0x80) addr|=0xFF00; - if (temp) - { - spc.pc+=addr; - spccycles(2); - } - spccycles(5); - break; - - case 0x6F: /*RET*/ - spc.s++; spc.pc=readspc(spc.s+0x100); - spc.s++; spc.pc|=(readspc(spc.s+0x100)<<8); - // printf("RET %04X\n",spc.pc); - spccycles(5); - break; - - case 0x70: /*BVS*/ - addr=readspc(spc.pc); spc.pc++; - if (addr&0x80) addr|=0xFF00; - if (spc.p.v) - { - spc.pc+=addr; - spccycles(2); - } - spccycles(2); - break; - - case 0x74: /*CMP A,(xx+X)*/ - getdpx(); - temp=readspc(addr); - setspczn(spc.ya.b.a-temp); - spc.p.c=(spc.ya.b.a>=temp); - spccycles(5); - break; - - case 0x75: /*CMP A,(xxxx+X)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.x; spc.pc+=2; - temp=readspc(addr); - setspczn(spc.ya.b.a-temp); - spc.p.c=(spc.ya.b.a>=temp); - spccycles(5); - break; - - case 0x76: /*CMP A,(xxxx+Y)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.ya.b.y; spc.pc+=2; - temp=readspc(addr); - setspczn(spc.ya.b.a-temp); - spc.p.c=(spc.ya.b.a>=temp); - spccycles(5); - break; - - case 0x77: /*CMP A,(xx)+Y*/ - addr=readspc(spc.pc)+spc.p.p; spc.pc++; - addr2=readspc(addr)+(readspc(addr+1)<<8)+spc.ya.b.y; - temp=readspc(addr2); - setspczn(spc.ya.b.a-temp); - spc.p.c=(spc.ya.b.a>=temp); - spccycles(6); - break; - - case 0x78: /*CMP (xx),#*/ - temp=readspc(spc.pc); spc.pc++; - getdp(); - temp2=readspc(addr); - setspczn(temp2-temp); - spc.p.c=(temp2>=temp); - spccycles(5); - break; - - case 0x7A: /*ADDW YA,xx*/ - addr=readspc(spc.pc)+spc.p.p; spc.pc++; - // printf("ADDW %04X ",addr); - tempw=readspc(addr)|(readspc(addr+1)<<8); - // printf("%04X+%04X",tempw,spc.ya.w); - templ=spc.ya.w+tempw; - spc.p.v=(!((spc.ya.w^tempw)&0x8000)&&((spc.ya.w^templ)&0x8000)); - spc.ya.w=templ&0xFFFF; - setspczn16(spc.ya.w); - spc.p.c=templ&0x10000; - // printf("=%04X\n",spc.ya.w); - /* templ=spc.ya.w+tempw; - spc.p.c=templ&0x10000; - spc.p.v=(!((spc.ya.w^tempw)&0x8000)&&((spc.ya.w^templ)&0x8000)); - spc.ya.w=templ&0xFFFF; - spc.p.z=!spc.ya.w; - spc.p.n=spc.ya.w&0x8000;*/ - spccycles(5); - break; - - case 0x7B: /*ROR (xx+X)*/ - getdpx(); - temp=readspc(addr); - templ=spc.p.c; - spc.p.c=temp&1; - temp>>=1; - if (templ) temp|=0x80; - setspczn(temp); - writespc(addr,temp); - spccycles(4); - break; - - case 0x7C: /*ROR A*/ - templ=spc.p.c; - spc.p.c=spc.ya.b.a&1; - spc.ya.b.a>>=1; - if (templ) spc.ya.b.a|=0x80; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0x7D: /*MOV A,X*/ - spc.ya.b.a=spc.x; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0x7E: /*CMP Y,(xx)*/ - getdp(); - temp=readspc(addr); - setspczn(spc.ya.b.y-temp); - spc.p.c=(spc.ya.b.y>=temp); - spccycles(3); - break; - - case 0x80: /*SETC*/ - spc.p.c=1; - spccycles(2); - break; - - case 0x84: /*ADC A,(xx)*/ - getdp(); - temp=readspc(addr); - ADC(spc.ya.b.a,temp); - spccycles(3); - break; - - case 0x85: /*ADC A,(xxxx)*/ - getabs(); - temp=readspc(addr); - ADC(spc.ya.b.a,temp); - spccycles(4); - break; - - case 0x88: /*ADC A,#*/ - temp=readspc(spc.pc); spc.pc++; - ADC(spc.ya.b.a,temp); - spccycles(2); - break; - - case 0x89: /*ADC (xx),(xx)*/ - addr=readspc(spc.pc)+spc.p.p; spc.pc++; - addr2=readspc(spc.pc)+spc.p.p; spc.pc++; - temp=readspc(addr); - temp2=readspc(addr2); - ADC(temp2,temp); - writespc(addr2,temp2); - spccycles(6); - break; - - case 0x8A: /*EOR1 m.b*/ - addr=readspc(spc.pc)|(readspc(spc.pc+1)<<8); spc.pc+=2; - tempw=addr>>13; - addr&=0x1FFF; - temp=readspc(addr); - spc.p.c=(spc.p.c?1:0)^((temp&(1<=tempw); - setspczn16(spc.ya.w); - /* templ=spc.ya.w-tempw; - spc.p.c=(spc.ya.w>=tempw); - spc.p.v=(((spc.ya.w^tempw)&0x8000)&&((spc.ya.w^templ)&0x8000)); - spc.ya.w=templ&0xFFFF; - spc.p.z=!spc.ya.w; - spc.p.n=spc.ya.w&0x8000;*/ - spccycles(5); - break; - - case 0x9B: /*DEC (xx+X)*/ - getdpx(); - temp=readspc(addr)-1; - setspczn(temp); - writespc(addr,temp); - spccycles(5); - break; - - case 0x9C: /*DEC A*/ - spc.ya.b.a--; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0x9D: /*MOV X,SP*/ - spc.x=spc.s; - setspczn(spc.x); - spccycles(2); - break; - - case 0x9E: /*DIV YA,X*/ - if (spc.x) - { - temp=spc.ya.w/spc.x; - spc.ya.b.y=spc.ya.w%spc.x; - spc.ya.b.a=temp; - setspczn(temp); - spc.p.v=0; - } - else - { - spc.ya.w=0xFFFF; - spc.p.v=1; - } - spccycles(12); - break; - - case 0x9F: /*XCN*/ - spc.ya.b.a=(spc.ya.b.a>>4)|(spc.ya.b.a<<4); - setspczn(spc.ya.b.a); - spccycles(5); - break; - - case 0xA4: /*SBC A,(xx)*/ - getdp(); - temp=readspc(addr); - SBC(spc.ya.b.a,temp); - spccycles(3); - break; - - case 0xA5: /*SBC A,(xxxx)*/ - getabs(); - temp=readspc(addr); - SBC(spc.ya.b.a,temp); - spccycles(4); - break; - - case 0xA8: /*SBC A,#*/ - temp=readspc(spc.pc); spc.pc++; - SBC(spc.ya.b.a,temp); - spccycles(2); - break; - - case 0xA9: /*SBC (xx),(xx)*/ - addr=readspc(spc.pc)+spc.p.p; spc.pc++; - addr2=readspc(spc.pc)+spc.p.p; spc.pc++; - temp=readspc(addr); - temp2=readspc(addr2); - SBC(temp2,temp); - writespc(addr2,temp2); - spccycles(6); - break; - - case 0xAA: /*MOV1 C,m.b*/ - getabs(); - tempw=addr>>13; - addr&=0x1FFF; - temp=readspc(addr); - spc.p.c=temp&(1<=temp); - spccycles(2); - break; - - case 0xAE: /*POP A*/ - spc.s++; spc.ya.b.a=readspc(spc.s+0x100); - // setspczn(spc.ya.b.a); - spccycles(4); - break; - - case 0xAF: /*MOV (X+),A*/ - writespc(spc.x+spc.p.p,spc.ya.b.a); - spc.x++; - spccycles(4); - break; - - case 0xB0: /*BCS*/ - addr=readspc(spc.pc); spc.pc++; - if (addr&0x80) addr|=0xFF00; - if (spc.p.c) - { - spc.pc+=addr; - spccycles(2); - } - spccycles(2); - break; - - case 0xB4: /*SBC A,(xx+X)*/ - getdpx(); - temp=readspc(addr); - SBC(spc.ya.b.a,temp); - spccycles(4); - break; - - case 0xB5: /*SBC A,(xxxx+X)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.x; spc.pc+=2; - temp=readspc(addr); - SBC(spc.ya.b.a,temp); - spccycles(5); - break; - - case 0xB6: /*SBC A,(xxxx+Y)*/ - addr=readspc(spc.pc)+(readspc(spc.pc+1)<<8)+spc.ya.b.y; spc.pc+=2; - temp=readspc(addr); - SBC(spc.ya.b.a,temp); - spccycles(5); - break; - - case 0xB7: /*SBC A,(xx)+Y*/ - addr=readspc(spc.pc)+spc.p.p; spc.pc++; - addr2=readspc(addr)+(readspc(addr+1)<<8)+spc.ya.b.y; - temp=readspc(addr2); - SBC(spc.ya.b.a,temp); - spccycles(6); - break; - - case 0xB8: /*SBC (xx),#*/ - temp2=readspc(spc.pc); spc.pc++; - getdp(); - temp=readspc(addr); - SBC(temp,temp2); - writespc(addr,temp); - spccycles(5); - break; - - case 0xBA: /*MOVW YA,(xx)*/ - getdp(); - spc.ya.b.a=readspc(addr); - spc.ya.b.y=readspc(addr+1); - setspczn16(spc.ya.w); - spccycles(5); - break; - - case 0xBB: /*INC (xx+X)*/ - getdpx(); - temp=readspc(addr)+1; - setspczn(temp); - writespc(addr,temp); - spccycles(5); - break; - - case 0xBC: /*INC A*/ - spc.ya.b.a++; - setspczn(spc.ya.b.a); - spccycles(2); - break; - - case 0xBD: /*MOV SP,X*/ - spc.s=spc.x; - spccycles(2); - break; - - case 0xC0: /*DI*/ - spc.p.i=0; - spccycles(3); - break; - - case 0xC4: /*MOV (xx),A*/ - getdp(); - writespc(addr,spc.ya.b.a); - spccycles(4); - break; - - case 0xC5: /*MOV (xxxx),A*/ - getabs(); - writespc(addr,spc.ya.b.a); - spccycles(5); - break; - - case 0xC6: /*MOV (X),A*/ - writespc(spc.x+spc.p.p,spc.ya.b.a); - spccycles(4); - break; - - case 0xC7: /*MOV (xx+X),A*/ - getdpx(); - addr2=readspc(addr)+(readspc(addr+1)<<8); - writespc(addr2,spc.ya.b.a); - spccycles(7); - break; - - case 0xC8: /*CMP X,#*/ - temp=readspc(spc.pc); spc.pc++; - setspczn(spc.x-temp); - spc.p.c=(spc.x>=temp); - spccycles(2); - break; - - case 0xC9: /*MOV (xxxx),X*/ - getabs(); - writespc(addr,spc.x); - spccycles(5); - break; - - case 0xCA: /*MOV1 m.b,C*/ - addr=readspc(spc.pc)|(readspc(spc.pc+1)<<8); spc.pc+=2; - tempw=addr>>13; - addr&=0x1FFF; - temp=readspc(addr); - if (spc.p.c) temp|= (1<>13; - addr&=0x1FFF; - temp=readspc(addr); - temp^=(1<> 0; - CRAM[1][2] = cchip_round_height[round] >> 8; - - CRAM[1][0x142] = cchip_round_address[round] >> 24; - CRAM[1][0x143] = cchip_round_address[round] >> 16; - CRAM[1][0x144] = cchip_round_address[round] >> 8; - CRAM[1][0x145] = cchip_round_address[round] >> 0; - - /* set the secret room or boss flag */ - - CRAM[1][0x148] = (round >= 40 || round % 4 == 3); -} - -static void RequestWorldData(void) -{ - INT32 world = CRAM[0][0x00D] / 4; /* 0...9 */ - - /* the extra version has the world data swapped around */ - - if (ExtraVersion) - { - static const UINT8 world_swap[] = - { - 8, 7, 6, 4, 0, 2, 3, 5, 1, 9 - }; - - world = world_swap[world]; - } - - /* first two bytes in each bank are left unchanged */ - - memcpy(CRAM[4] + 2, CROM_BANK4[world].data, CROM_BANK4[world].size); - memcpy(CRAM[5] + 2, CROM_BANK5[world].data, CROM_BANK5[world].size); - memcpy(CRAM[7] + 2, CROM_BANK7[world].data, CROM_BANK7[world].size); - - /* banks 5 and 6 are different in the extra version */ - - if (ExtraVersion) - { - INT32 i; - - for (i = 0; i < 8; i++) - { - UINT16 patch = cchip_extra_patch[world][i]; - - if (patch != 0) - { - CRAM[5][CRAM[5][2] + 22 * i + 18] = patch >> 0; - CRAM[5][CRAM[5][2] + 22 * i + 19] = patch >> 8; - } - } - - memcpy(CRAM[6] + 2, CROM_BANK6_EXTRA, sizeof CROM_BANK6_EXTRA); - } - else - { - memcpy(CRAM[6] + 2, CROM_BANK6, sizeof CROM_BANK6); - } -} - -static void RequestGoalinData(void) -{ - INT32 n = BurnRandom() % 15; - - CRAM[1][0x14B] = 0x00; /* x coordinates */ - CRAM[1][0x14D] = 0x10; - CRAM[1][0x14F] = 0x20; - CRAM[1][0x151] = 0x38; - CRAM[1][0x153] = 0x50; - CRAM[1][0x155] = 0x60; - - CRAM[1][0x14A] = cchip_goalin[n][0]; /* y coordinates */ - CRAM[1][0x14C] = cchip_goalin[n][1]; - CRAM[1][0x14E] = cchip_goalin[n][2]; - CRAM[1][0x150] = cchip_goalin[n][3]; - CRAM[1][0x152] = cchip_goalin[n][4]; - CRAM[1][0x154] = cchip_goalin[n][5]; -} - -void RainbowCChipUpdate(UINT8 Input1, UINT8 Input2, UINT8 Input3, UINT8 Input4) -{ - if (CRAM[1][0x100] == 1) { - RequestRoundData(); - - CRAM[1][0x100] = 0xFF; - } - - if (CRAM[5][0x000] == 1) { - RequestWorldData(); - - CRAM[5][0x000] = 0xFF; - } - - if (CRAM[1][0x149] == 1) { - RequestGoalinData(); - - CRAM[1][0x149] = 0xFF; - } - - CRAM[0][3] = Input1; - CRAM[0][4] = Input2; - CRAM[0][5] = Input3; - CRAM[0][6] = Input4; -} - -UINT16 RainbowCChipCtrlRead() -{ - return 0x01; -} - -UINT16 RainbowCChipRamRead(UINT32 Offset) -{ - return CRAM[CurrentBank][Offset]; -} - -void RainbowCChipCtrlWrite(UINT16) -{ - -} - -void RainbowCChipBankWrite(UINT16 Data) -{ - CurrentBank = Data & 7; -} - -void RainbowCChipRamWrite(UINT32 Offset, UINT16 Data) -{ - CRAM[CurrentBank][Offset] = Data; -} - -void RainbowCChipReset() -{ - for (INT32 i = 0; i < 8; i++) { - memset(CRAM[i], 0, 0x400); - } - - ExtraVersion = 0; - CurrentBank = 0; -} - -void RainbowCChipInit(INT32 Version) -{ - ExtraVersion = Version; - - for (INT32 i = 0; i < 8; i++) { - CRAM[i] = (UINT8*)BurnMalloc(0x400); - memset(CRAM[i], 0, 0x400); - } - - TaitoIC_RainbowCChipInUse = 1; -} - -void RainbowCChipExit() -{ - for (INT32 i = 0; i < 8; i++) { - BurnFree(CRAM[i]); - } - - ExtraVersion = 0; - CurrentBank = 0; -} - -void RainbowCChipScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - for (INT32 i = 0; i < 8; i++) { - memset(&ba, 0, sizeof(ba)); - ba.Data = CRAM[i]; - ba.nLen = 0x400; - ba.szName = "CChip Ram"; - BurnAcb(&ba); - } - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(CurrentBank); - - BurnRandomScan(nAction); - } -} - -///////////////////////////////////////////////////////////////////////////////////////// - -// Operation Wolf C-Chip - -#define OPWOLF_REGION_JAPAN 1 -#define OPWOLF_REGION_US 2 -#define OPWOLF_REGION_WORLD 3 -#define OPWOLF_REGION_OTHER 4 - -static INT32 CChipRegion; - -static UINT8 CurrentCmd=0; -static UINT8* CChipRam=0; -static UINT8 CChipLast_7a=0; -static UINT8 CChipLast_04=0; -static UINT8 CChipLast_05=0; -static UINT8 CChipCoinsForCredit[2]={1,1}; -static UINT8 CChipCreditsForCoin[2]={1,1}; -static UINT8 CChipCoins[2]={0,0}; -static UINT8 c588=0, c589=0, c58a=0; -static UINT8 triggeredLevel1b; // These variables derived from comparison to unprotection version -static UINT8 triggeredLevel2; -static UINT8 triggeredLevel2b; -static UINT8 triggeredLevel2c; -static UINT8 triggeredLevel3b; -static UINT8 triggeredLevel13b; -static UINT8 triggeredLevel4; -static UINT8 triggeredLevel5; -static UINT8 triggeredLevel7; -static UINT8 triggeredLevel8; -static UINT8 triggeredLevel9; - -static const UINT16 level_data_00[] = { - 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x0010, - 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x002b, - 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x0020, - 0x0780, 0x1208, 0x0300, 0x5d01, 0x0004, 0x0030, - 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0038, - 0x0780, 0x0309, 0x0300, 0x4d01, 0x0004, 0x0048, - 0x0980, 0x1108, 0x0300, 0x5a01, 0xc005, 0x0018, - 0x0980, 0x0109, 0x0300, 0x4b01, 0xc005, 0x0028, - 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x0004, - 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x8002, - 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x0017, - 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x8015, - 0x0b80, 0x020a, 0x0000, 0x6401, 0x0007, 0x0034, - 0x0c80, 0x010b, 0x0000, 0xf201, 0x0007, 0x8032, - 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x803e, - 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x803d, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x0008, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x000b, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x001b, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x001e, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x8007, 0x0038, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x8007, 0x003b, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x8042, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x8045, - 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x8007, - 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x801a, - 0x0c80, 0x000b, 0x0000, 0xf101, 0x000c, 0x8037, - 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x0042, - 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x8009, - 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x801c, - 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x0044, - 0x0c80, 0x030b, 0x0000, 0xf401, 0x0008, 0x0028, - 0x0c80, 0x030b, 0x0000, 0xf401, 0x0008, 0x804b, - 0x0c00, 0x040b, 0x0000, 0xf501, 0x0008, 0x8026, - 0xffff -}; - -static const UINT16 level_data_01[] = { - 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0010, - 0x0780, 0x0209, 0x0300, 0x4c01, 0x4004, 0x0020, - 0x0780, 0x0309, 0x0300, 0x4d01, 0xe003, 0x0030, - 0x0780, 0x0309, 0x0300, 0x4d01, 0x8003, 0x0040, - 0x0780, 0x0209, 0x0300, 0x4c01, 0x8004, 0x0018, - 0x0780, 0x0309, 0x0300, 0x4d01, 0xc003, 0x0028, - 0x0b80, 0x000b, 0x0000, 0x0b02, 0x8009, 0x0029, - 0x0b80, 0x0409, 0x0000, 0x0f02, 0x8008, 0x8028, - 0x0b80, 0x040a, 0x0000, 0x3502, 0x000a, 0x8028, - 0x0b80, 0x050a, 0x0000, 0x1002, 0x8006, 0x8028, - 0x0b80, 0x120a, 0x0000, 0x3602, 0x0008, 0x004d, - 0x0b80, 0x120a, 0x0000, 0x3602, 0x0008, 0x004f, - 0x0b80, 0x120a, 0x0000, 0x3602, 0x0008, 0x0001, - 0x0b80, 0x120a, 0x0000, 0x3602, 0x0008, 0x0003, - 0x0b80, 0x130a, 0x0000, 0x3a02, 0x0007, 0x0023, - 0x0b80, 0x130a, 0x0000, 0x3a02, 0x0007, 0x8025, - 0x0b80, 0x130a, 0x0000, 0x3a02, 0x8009, 0x0023, - 0x0b80, 0x130a, 0x0000, 0x3a02, 0x8009, 0x8025, - 0x0b80, 0x140a, 0x0000, 0x3e02, 0x0007, 0x000d, - 0x0b80, 0x140a, 0x0000, 0x3e02, 0x0007, 0x800f, - 0x0b80, 0x000b, 0x0000, 0x0102, 0x0007, 0x804e, - 0x0b80, 0xd24b, 0x0000, 0x0302, 0x0007, 0x000e, - 0x0b80, 0x000b, 0x0000, 0x0402, 0x8006, 0x0020, - 0x0b80, 0xd34b, 0x0000, 0x0502, 0x8006, 0x0024, - 0x0b80, 0x000b, 0x0000, 0x0602, 0x8009, 0x0001, - 0x0b80, 0xd44b, 0x0000, 0x0702, 0x800b, 0x800b, - 0x0b80, 0xd54b, 0x0000, 0x0802, 0x800b, 0x000e, - 0x0b80, 0x000b, 0x0000, 0x0902, 0x800b, 0x0010, - 0x0b80, 0x000b, 0x0000, 0x0a02, 0x0009, 0x0024, - 0x0b80, 0xd64b, 0x0000, 0x0c02, 0x000c, 0x8021, - 0x0b80, 0x000b, 0x0000, 0x0d02, 0x000c, 0x0025, - 0x0b80, 0x000b, 0x0000, 0x0e02, 0x8009, 0x004e, - 0x0b80, 0x000b, 0x0300, 0x4e01, 0x8006, 0x8012, - 0x0b80, 0x000b, 0x0300, 0x4e01, 0x0007, 0x8007, - 0xffff -}; - -static const UINT16 level_data_02[] = { - 0x0480, 0x000b, 0x0300, 0x4501, 0x0001, 0x0018, - 0x0480, 0x000b, 0x0300, 0x4501, 0x2001, 0x0030, - 0x0780, 0x1208, 0x0300, 0x5d01, 0x0004, 0x0010, - 0x0780, 0x1208, 0x0300, 0x5d01, 0x2004, 0x001c, - 0x0780, 0x1208, 0x0300, 0x5d01, 0xe003, 0x0026, - 0x0780, 0x1208, 0x0300, 0x5d01, 0x8003, 0x0034, - 0x0780, 0x1208, 0x0300, 0x5d01, 0x3004, 0x0040, - 0x0780, 0x010c, 0x0300, 0x4601, 0x4004, 0x0022, - 0x0780, 0x010c, 0x0300, 0x4601, 0x6004, 0x0042, - 0x0780, 0x000c, 0x0500, 0x7b01, 0x800b, 0x0008, - 0x0780, 0x010c, 0x0300, 0x4601, 0x2004, 0x0008, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x0004, - 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x8003, - 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x000c, - 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x800b, - 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x001c, - 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x801b, - 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x002c, - 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x802b, - 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x0044, - 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x8043, - 0x0b80, 0x000b, 0x0000, 0x1902, 0x000b, 0x004c, - 0x0b80, 0x000b, 0x0000, 0x1a02, 0x0009, 0x804b, - 0x0b80, 0x020c, 0x0300, 0x4801, 0xa009, 0x0010, - 0x0b80, 0x020c, 0x0300, 0x4801, 0xa009, 0x0028, - 0x0b80, 0x020c, 0x0300, 0x4801, 0xa009, 0x0036, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0xffff -}; - -static const UINT16 level_data_03[] = { - 0x0480, 0x000b, 0x0300, 0x4501, 0x0001, 0x0018, - 0x0480, 0x000b, 0x0300, 0x4501, 0x2001, 0x002b, - 0x0780, 0x010c, 0x0300, 0x4601, 0x0004, 0x000d, - 0x0780, 0x000c, 0x0500, 0x7b01, 0x800b, 0x0020, - 0x0780, 0x010c, 0x0300, 0x4601, 0x2004, 0x0020, - 0x0780, 0x010c, 0x0300, 0x4601, 0x8003, 0x0033, - 0x0780, 0x010c, 0x0300, 0x4601, 0x0004, 0x003c, - 0x0780, 0x010c, 0x0300, 0x4601, 0xd003, 0x0045, - 0x0780, 0x000c, 0x0500, 0x7b01, 0x900b, 0x0041, - 0x0780, 0x010c, 0x0300, 0x4601, 0x3004, 0x0041, - 0x0b80, 0x020c, 0x0300, 0x4801, 0x0007, 0x0000, - 0x0b80, 0x410a, 0x0000, 0x2b02, 0xe006, 0x4049, - 0x0b80, 0x020c, 0x0300, 0x4801, 0x8007, 0x000b, - 0x0b80, 0x000b, 0x0000, 0x2702, 0x800a, 0x8005, - 0x0b80, 0x000b, 0x0000, 0x1e02, 0x0008, 0x800e, - 0x0b80, 0x000b, 0x0000, 0x1f02, 0x8007, 0x0011, - 0x0b80, 0x000b, 0x0000, 0x2802, 0x000b, 0x0012, - 0x0b80, 0x000b, 0x0000, 0x2002, 0x0007, 0x8015, - 0x0b80, 0x000b, 0x0000, 0x2102, 0x0007, 0x801b, - 0x0b80, 0x000b, 0x0000, 0x2902, 0x800a, 0x001a, - 0x0b80, 0x000b, 0x0000, 0x2202, 0x8007, 0x001e, - 0x0b80, 0x000b, 0x0000, 0x1e02, 0x0008, 0x0025, - 0x0b80, 0x000b, 0x0000, 0x2302, 0x8007, 0x802c, - 0x0b80, 0x000b, 0x0000, 0x2802, 0x000b, 0x8028, - 0x0b80, 0x020c, 0x0300, 0x4801, 0x0007, 0x0030, - 0x0b80, 0x400a, 0x0000, 0x2e02, 0x4007, 0x002d, - 0x0b80, 0x000b, 0x0000, 0x2702, 0x800a, 0x8035, - 0x0b80, 0x020c, 0x0300, 0x4801, 0x8007, 0x0022, - 0x0b80, 0x000b, 0x0000, 0x2402, 0x8007, 0x0047, - 0x0b80, 0x000b, 0x0000, 0x2a02, 0x800a, 0x004b, - 0x0b80, 0x000b, 0x0000, 0x2502, 0x0007, 0x804b, - 0x0b80, 0x000b, 0x0000, 0x2602, 0x0007, 0x004e, - 0x0b80, 0x020c, 0x0300, 0x4801, 0x0007, 0x8043, - 0x0b80, 0x020c, 0x0300, 0x4801, 0x8007, 0x803d, - 0xffff -}; - -static const UINT16 level_data_04[] = { - 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0010, - 0x0780, 0x0209, 0x0300, 0x4c01, 0x4004, 0x0020, - 0x0780, 0x0309, 0x0300, 0x4d01, 0xe003, 0x0030, - 0x0780, 0x0309, 0x0300, 0x4d01, 0x8003, 0x0040, - 0x0780, 0x0209, 0x0300, 0x4c01, 0x8004, 0x0018, - 0x0780, 0x0309, 0x0300, 0x4d01, 0xc003, 0x0028, - 0x0780, 0x000b, 0x0300, 0x5601, 0x8004, 0x0008, - 0x0780, 0x000b, 0x0300, 0x5601, 0x8004, 0x0038, - 0x0780, 0x000b, 0x0300, 0x5501, 0x8004, 0x0048, - 0x0980, 0x0509, 0x0f00, 0x0f01, 0x4005, 0x4007, - 0x0980, 0x0509, 0x0f00, 0x0f01, 0x4005, 0x4037, - 0x0b80, 0x030a, 0x0000, 0x1302, 0x8006, 0x0040, - 0x0b80, 0x110a, 0x0000, 0x1502, 0x8008, 0x8048, - 0x0b80, 0x110a, 0x0000, 0x1502, 0x8008, 0x8049, - 0x0b80, 0x000b, 0x0000, 0xf601, 0x0007, 0x8003, - 0x0b80, 0x000b, 0x0000, 0xf701, 0x0007, 0x0005, - 0x0b80, 0x000b, 0x0000, 0xf901, 0x0007, 0x8008, - 0x0b80, 0x000b, 0x0000, 0xf901, 0x0007, 0x0010, - 0x0b80, 0x000b, 0x0000, 0xfa01, 0x0007, 0x8013, - 0x0b80, 0x000b, 0x0000, 0xf801, 0x800b, 0x800b, - 0x0b80, 0x000b, 0x0000, 0x0002, 0x800b, 0x801a, - 0x0b80, 0x000b, 0x0000, 0xf901, 0x0007, 0x8017, - 0x0b80, 0x000b, 0x0000, 0xfa01, 0x0007, 0x001b, - 0x0b80, 0x000b, 0x0000, 0xf801, 0x800b, 0x0013, - 0x0b80, 0x000b, 0x0000, 0x4202, 0x800b, 0x0016, - 0x0b80, 0x000b, 0x0000, 0xfb01, 0x8007, 0x8020, - 0x0b80, 0x000b, 0x0000, 0xf601, 0x0007, 0x8023, - 0x0b80, 0x000b, 0x0000, 0x4202, 0x800b, 0x800e, - 0x0b80, 0x000b, 0x0000, 0x4302, 0x800b, 0x801d, - 0x0b80, 0x000b, 0x0000, 0xf701, 0x0007, 0x0025, - 0x0b80, 0x000b, 0x0000, 0xfd01, 0x8006, 0x003f, - 0x0b80, 0x000b, 0x0000, 0xfe01, 0x0007, 0x0046, - 0x0b80, 0x000b, 0x0000, 0xff01, 0x8007, 0x8049, - 0x0b80, 0x000b, 0x0000, 0xfc01, 0x8009, 0x0042, - 0xffff -}; - -static const UINT16 level_data_05[] = { - 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x0010, - 0x0480, 0x1008, 0x0300, 0x5701, 0x0001, 0x002b, - 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x0020, - 0x0780, 0x1208, 0x0300, 0x5d01, 0x0004, 0x0030, - 0x0780, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0038, - 0x0780, 0x0309, 0x0300, 0x4d01, 0x0004, 0x0048, - 0x0980, 0x1108, 0x0300, 0x5a01, 0xc005, 0x0018, - 0x0980, 0x0109, 0x0300, 0x4b01, 0xc005, 0x0028, - 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x0004, - 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x8002, - 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x0017, - 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x8015, - 0x0b80, 0x020a, 0x0000, 0x6401, 0x0007, 0x0034, - 0x0c80, 0x010b, 0x0000, 0xf201, 0x0007, 0x8032, - 0x0b80, 0x020a, 0x0000, 0x6401, 0x8006, 0x803e, - 0x0c80, 0x010b, 0x0000, 0xf201, 0x8006, 0x803d, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x0008, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x000b, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x001b, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x001e, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x8007, 0x0038, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x8007, 0x003b, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x8042, - 0x0b80, 0x100a, 0x0000, 0x6001, 0x0007, 0x8045, - 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x8007, - 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x801a, - 0x0c80, 0x000b, 0x0000, 0xf101, 0x000c, 0x8037, - 0x0c80, 0x000b, 0x0000, 0xf101, 0x800b, 0x0042, - 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x8009, - 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x801c, - 0x0c80, 0xd04b, 0x0000, 0xf301, 0x8006, 0x0044, - 0x0c80, 0x030b, 0x0000, 0xf401, 0x0008, 0x0028, - 0x0c80, 0x030b, 0x0000, 0xf401, 0x0008, 0x804b, - 0x0c00, 0x040b, 0x0000, 0xf501, 0x0008, 0x8026, - 0xffff -}; - -static const UINT16 level_data_06[] = { - 0x0000, 0x1008, 0x0300, 0x5701, 0x0001, 0x0010, - 0x0000, 0x1008, 0x0300, 0x5701, 0x0001, 0x002b, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0700, 0x0009, 0x0300, 0x4a01, 0x0004, 0x0020, - 0x0700, 0x1208, 0x0300, 0x5d01, 0x0004, 0x0030, - 0x0700, 0x0209, 0x0300, 0x4c01, 0x0004, 0x0038, - 0x0700, 0x0309, 0x0300, 0x4d01, 0x0004, 0x0048, - 0x0900, 0x1108, 0x0300, 0x5a01, 0xc005, 0x0018, - 0x0900, 0x0109, 0x0300, 0x4b01, 0xc005, 0x0028, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0980, 0xdb4c, 0x0000, 0x3202, 0x0006, 0x0004, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0x0000, 0x000b, 0x0000, 0x0000, 0x0018, 0x0000, - 0xffff -}; - -static const UINT16 level_data_07[] = { - 0x0480, 0x000b, 0x0300, 0x4501, 0x0001, 0x0001, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0780, 0x0109, 0x0300, 0x4a01, 0x0004, 0x0004, - 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x000d, - 0x0780, 0x000c, 0x0500, 0x7b01, 0x000c, 0x0005, - 0x0780, 0x000c, 0x0540, 0x7b01, 0x000c, 0x0005, - 0x0780, 0x010c, 0x0300, 0x4601, 0x0005, 0x0005, - 0x0780, 0x000c, 0x0500, 0x7b01, 0x800b, 0xc00d, - 0x0780, 0x000c, 0x0540, 0x7b01, 0x800b, 0xc00d, - 0x0780, 0x010c, 0x0300, 0x4601, 0x8004, 0xc00d, - 0x0900, 0x0109, 0x0340, 0x4b01, 0x2006, 0x400c, - 0x0780, 0x020c, 0x0300, 0x4801, 0x8007, 0x0008, - 0x0780, 0x020c, 0x0300, 0x4801, 0x4007, 0xc00b, - 0x0980, 0x0109, 0x0300, 0x4b01, 0xc006, 0x8007, - 0x0980, 0x0109, 0x0300, 0x4b01, 0x8007, 0x8008, - 0x0980, 0x0109, 0x0300, 0x4b01, 0xc006, 0x800c, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0xffff -}; - -static const UINT16 level_data_08[] = { - 0xffff -}; - -static const UINT16 level_data_09[] = { - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0780, 0x0109, 0x0300, 0x4a01, 0x8003, 0x8003, - 0x0780, 0x0009, 0x0300, 0x4a01, 0x0004, 0x800e, - 0x0780, 0x000c, 0x0500, 0x7b01, 0x000c, 0x0005, - 0x0780, 0x000c, 0x0540, 0x7b01, 0x000c, 0x0005, - 0x0780, 0x010c, 0x0300, 0x4601, 0x0005, 0x0005, - 0x0780, 0x000c, 0x0500, 0x7b01, 0x800b, 0xc00d, - 0x0780, 0x000c, 0x0540, 0x7b01, 0x800b, 0xc00d, - 0x0780, 0x010c, 0x0300, 0x4601, 0x8004, 0xc00d, - 0x0900, 0x0109, 0x0340, 0x4b01, 0x2006, 0x400c, - 0x0780, 0x020c, 0x0300, 0x4801, 0x8007, 0x0008, - 0x0780, 0x020c, 0x0300, 0x4801, 0x4007, 0xc00b, - 0x0980, 0x0109, 0x0300, 0x4b01, 0xc006, 0x8007, - 0x0980, 0x0109, 0x0300, 0x4b01, 0x8007, 0x8008, - 0x0980, 0x0109, 0x0300, 0x4b01, 0xc006, 0x800c, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0xf001, 0x0000, 0x0000, - 0xffff -}; - -static const UINT16 *const level_data_lookup[] = -{ - level_data_00, - level_data_01, - level_data_02, - level_data_03, - level_data_04, - level_data_05, - level_data_06, - level_data_07, - level_data_08, - level_data_09 -}; - -static void AccessLevelDataCommand() -{ - // Level data command - if (CurrentCmd == 0xf5) - { - int const level = CChipRam[0x1b] % 10; - UINT16 const *const level_data = level_data_lookup[level]; - - // The c-chip data is stored as a series of 3 word sets, delimited by 0xffff - memset(CChipRam + 0x200, 0, 0x200); - for (unsigned i = 0; (i < 0x200) && (level_data[i] != 0xffff); i += 3) - { - CChipRam[0x200 + i*2 + 0] = level_data[i]>>8; - CChipRam[0x200 + i*2 + 1] = level_data[i]&0xff; - CChipRam[0x200 + i*2 + 2] = level_data[i+1]>>8; - CChipRam[0x200 + i*2 + 3] = level_data[i+1]&0xff; - CChipRam[0x200 + i*2 + 4] = level_data[i+2]>>8; - CChipRam[0x200 + i*2 + 5] = level_data[i+2]&0xff; - } - - // The bootleg cchip writes 0 to these locations - we can probably assume the real one - // does similar as this is just zeroing out work variables used in the level. - CChipRam[0x0] = 0; - CChipRam[0x76] = 0; - CChipRam[0x75] = 0; - CChipRam[0x74] = 0; - CChipRam[0x72] = 0; - CChipRam[0x71] = 0; - // CChipRam[0x70] = 0; // The bootleg writes this to disable mini-levels. The real c-chip does not do this. - CChipRam[0x66] = 0; - CChipRam[0x2b] = 0; - CChipRam[0x30] = 0; - CChipRam[0x31] = 0; - CChipRam[0x32] = 0; - CChipRam[0x27] = 0; - c588 = 0; - c589 = 0; - c58a = 0; - triggeredLevel1b = 0; - triggeredLevel13b = 0; - triggeredLevel2 = 0; - triggeredLevel2b = 0; - triggeredLevel2c = 0; - triggeredLevel3b = 0; - triggeredLevel4 = 0; - triggeredLevel5 = 0; - triggeredLevel7 = 0; - triggeredLevel8 = 0; - triggeredLevel9 = 0; - - CChipRam[0x1a] = 0; - CChipRam[0x7a] = 1; // Signal command complete - - bprintf(0, _T("Signal level command complete\n")); - } - - CurrentCmd = 0; -} - -static void updateDifficulty(INT32 Mode) -{ - // The game is made up of 6 rounds, when you complete the - // sixth you return to the start but with harder difficulty. - if (Mode == 0) - { - switch (CChipRam[0x15]&3) // Dipswitch B - { - case 3: - CChipRam[0x2c]=0x31; - CChipRam[0x77]=0x05; - CChipRam[0x25]=0x0f; - CChipRam[0x26]=0x0b; - break; - case 0: - CChipRam[0x2c]=0x20; - CChipRam[0x77]=0x06; - CChipRam[0x25]=0x07; - CChipRam[0x26]=0x03; - break; - case 1: - CChipRam[0x2c]=0x31; - CChipRam[0x77]=0x05; - CChipRam[0x25]=0x0f; - CChipRam[0x26]=0x0b; - break; - case 2: - CChipRam[0x2c]=0x3c; - CChipRam[0x77]=0x04; - CChipRam[0x25]=0x13; - CChipRam[0x26]=0x0f; - break; - } - } - else - { - switch (CChipRam[0x15]&3) // Dipswitch B - { - case 3: - CChipRam[0x2c]=0x46; - CChipRam[0x77]=0x05; - CChipRam[0x25]=0x11; - CChipRam[0x26]=0x0e; - break; - case 0: - CChipRam[0x2c]=0x30; - CChipRam[0x77]=0x06; - CChipRam[0x25]=0x0b; - CChipRam[0x26]=0x03; - break; - case 1: - CChipRam[0x2c]=0x3a; - CChipRam[0x77]=0x05; - CChipRam[0x25]=0x0f; - CChipRam[0x26]=0x09; - break; - case 2: - CChipRam[0x2c]=0x4c; - CChipRam[0x77]=0x04; - CChipRam[0x25]=0x19; - CChipRam[0x26]=0x11; - break; - }; - } -} - -void OpwolfCChipUpdate(UINT8 Input1, UINT8 Input2) -{ - // Update input ports, these are used by both the 68k directly and by the c-chip - CChipRam[0x4] = Input1; - CChipRam[0x5] = Input2; - - // Coin slots - if (CChipRam[0x4]!=CChipLast_04) - { - INT32 slot=-1; - - if (CChipRam[0x4]&1) slot=0; - if (CChipRam[0x4]&2) slot=1; - - if (slot != -1) - { - CChipCoins[slot]++; - if (CChipCoins[slot] >= CChipCoinsForCredit[slot]) - { - CChipRam[0x53]+=CChipCreditsForCoin[slot]; - CChipRam[0x51]=0x55; - CChipRam[0x52]=0x55; - CChipCoins[slot]-=CChipCoinsForCredit[slot]; - } - } - - if (CChipRam[0x53]>9) - CChipRam[0x53]=9; - } - CChipLast_04=CChipRam[0x4]; - - // Service switch - if (CChipRam[0x5]!=CChipLast_05) - { - if ((CChipRam[0x5]&4)==0) - { - CChipRam[0x53]++; - CChipRam[0x51]=0x55; - CChipRam[0x52]=0x55; - } - } - CChipLast_05=CChipRam[0x5]; - - // These variables are cleared every frame during attract mode and the intro. - if (CChipRam[0x34] < 2) - { - updateDifficulty(0); - CChipRam[0x76]=0; - CChipRam[0x75]=0; - CChipRam[0x74]=0; - CChipRam[0x72]=0; - CChipRam[0x71]=0; - CChipRam[0x70]=0; - CChipRam[0x66]=0; - CChipRam[0x2b]=0; - CChipRam[0x30]=0; - CChipRam[0x31]=0; - CChipRam[0x32]=0; - CChipRam[0x27]=0; - c588=0; - c589=0; - c58a=0; - } - - // The unprotected Operation Wolf (prototype) shows the game sets up a special thread function specific to each level of the game. - // This includes the end of level check as different levels have different rules. In the protected version this logic is moved - // to the c-chip, so we simulate it here. - if (CChipRam[0x1c] == 0 && CChipRam[0x1d] == 0 && CChipRam[0x1e] == 0 && CChipRam[0x1f] == 0 && CChipRam[0x20] == 0) - { - // Special handling for end of level 6 - if (CChipRam[0x1b] == 0x6) - { - // Don't signal end of level until final boss is destroyed - if (CChipRam[0x27] == 0x1) - CChipRam[0x32] = 1; - } - // Level 2 - Boss check - cross-referenced from logic at 0x91CE in OpWolfP - // When all enemies are destroyed c-chip signals function 4 in the level function table, which - // starts the 'WARNING' sequences for the boss. - else if (CChipRam[0x1b] == 0x2) - { - if (triggeredLevel2==0 && CChipRam[0x5f]==0) - { - CChipRam[0x5f] = 4; // 0xBE at 68K side - triggeredLevel2=1; - } - - // When the level 2 boss has been defeated the 68K will write 0xff to $ff0ba.l - this should signal - // the c-chip to start the end of level routine. See code at 0xC370 in OpWolf and 0x933e in OpWolfP - if (triggeredLevel2 && CChipRam[0x5d]!=0) - { - // Signal end of level - CChipRam[0x32] = 1; - CChipRam[0x5d] = 0; // acknowledge 68K command - } - } - else if (CChipRam[0x1b] == 0x4) - { - CChipRam[0x32] = 1; - - // When level 4 (powder magazine) is complete the c-chip triggers an explosion animation. - if (triggeredLevel4==0 && CChipRam[0x5f]==0) - { - CChipRam[0x5f]=10; - triggeredLevel4=1; - } - } - else - { - // Signal end of level - CChipRam[0x32] = 1; - } - } - - // When all men are destroyed (not necessarily vehicles) the enemy look up table changes - // Reference functions around 0x96A4 in the unprotected prototype. - // Level 1 has a specific table. - // Level 3 has an additional flag set - if (CChipRam[0x1c] == 0 && CChipRam[0x1d] == 0) - { - // Compare code at 0x96DC in prototype with 0xC3A2 in protected version - if (CChipRam[0x1b] == 0x1 && triggeredLevel1b==0 && CChipRam[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) - { - CChipRam[0x5f]=7; - triggeredLevel1b=1; - } - - // Compare code at 0x96BC in prototype with 0xC3B2 in protected version - if (CChipRam[0x1b] == 0x3 && triggeredLevel3b==0 && CChipRam[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) - { - CChipRam[0x5f]=8; - triggeredLevel3b=1; - } - - // Compare code at 0x96BC in prototype with 0xC3C8 in protected version - if ((CChipRam[0x1b] != 0x1 && CChipRam[0x1b] != 0x3) && triggeredLevel13b==0 && CChipRam[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) - { - CChipRam[0x5f]=9; - triggeredLevel13b=1; - } - } - - //------------------------------------------------------------------------------------------------- - // Level 2. On level 2 specifically when there are less than 45 men left the enemy lookup table is - // switched. This drops down a wave of paratroopers. When there are less than 25 men left the lookup - // table is switched again. - // See code at 0xC37A and 0xc390 in protected version against 0x9648 in prototype. - if (CChipRam[0x1b] == 0x2) - { - // (Note: it's correct that 25 decimal is represented as 0x25 in hex here). - int numMen=(CChipRam[0x1d]<<8) + CChipRam[0x1c]; - if (numMen<0x25 && triggeredLevel2b==1 && triggeredLevel2c==0 && CChipRam[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) - { - CChipRam[0x5f]=6; - triggeredLevel2c=1; - } - - // (Note: it's correct that 45 decimal is represented as 0x45 in hex here). - if (numMen<0x45 && triggeredLevel2b==0 && CChipRam[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) - { - CChipRam[0x5f]=5; - triggeredLevel2b=1; - } - } - - //------------------------------------------------------------------------------------------------- - // Level 5 - if (CChipRam[0x1b] == 0x5) - { - // When all men are destroyed (not necessarily vehicles), the c-chip writes 1 to location - // 0x2f to spawn a thread that scrolls the screen upwards to focus on the helicopter - // enemies. The 68K acknowledges this by writing 2 to 0x2f. - // See code at 0x4ED6 in prototype and 0x687e in original. - if (CChipRam[0x1c] == 0 && CChipRam[0x1d] == 0 && triggeredLevel5==0) - { - CChipRam[0x2f] = 1; - triggeredLevel5 = 1; - } - } - - //------------------------------------------------------------------------------------------------- - // Level 6 - if (CChipRam[0x1b] == 0x6) - { - // Check for triggering final helicopter (end boss) - if (c58a == 0) - { - if ((CChipRam[0x72] & 0x7f) >= 8 && CChipRam[0x74] == 0 && CChipRam[0x1c] == 0 && CChipRam[0x1d] == 0 && CChipRam[0x1f] == 0) - { - CChipRam[0x30] = 1; - CChipRam[0x74] = 1; - c58a = 1; - } - } - - if (CChipRam[0x1a] == 0x90) - CChipRam[0x74] = 0; - - if (c58a != 0) - { - if (c589 == 0 && CChipRam[0x27] == 0 && CChipRam[0x75] == 0 && CChipRam[0x1c] == 0 && CChipRam[0x1d] == 0 && CChipRam[0x1e] == 0 && CChipRam[0x1f] == 0) - { - CChipRam[0x31] = 1; - CChipRam[0x75] = 1; - c589 = 1; - } - } - - if (CChipRam[0x2b] == 0x1) - { - CChipRam[0x2b] = 0; - - if (CChipRam[0x30] == 0x1) - { - if (CChipRam[0x1a] != 0x90) - CChipRam[0x1a]--; - } - - if (CChipRam[0x72] == 0x9) - { - if (CChipRam[0x76] != 0x4) - { - CChipRam[0x76] = 3; - } - } - else - { - // This timer is derived from the bootleg rather than the real board, I'm not 100% sure about it - c588 |= 0x80; - - CChipRam[0x72] = c588; - c588++; - - CChipRam[0x1a]--; - CChipRam[0x1a]--; - CChipRam[0x1a]--; - } - } - - // Update difficulty settings - if (CChipRam[0x76] == 0) - { - CChipRam[0x76] = 1; - updateDifficulty(1); - } - } - - //------------------------------------------------------------------------------------------------- - // Start of level 7 - should trigger '1' in level thread table (compare 0xC164 in protected to 0x9468 in unprotected) - if (CChipRam[0x1b] == 0x7 && triggeredLevel7==0 && CChipRam[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) - { - triggeredLevel7 = 1; - CChipRam[0x5f] = 1; - } - - //------------------------------------------------------------------------------------------------- - // Start of level 8 - should trigger '2' in level thread table (compare 0xC18E in protected to 0x9358 in unprotected) - // This controls the 'zoom in helicopters' enemy - if (CChipRam[0x1b] == 0x8 && triggeredLevel8==0 && CChipRam[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) - { - triggeredLevel8 = 1; - CChipRam[0x5f] = 2; - } - - //------------------------------------------------------------------------------------------------- - // Start of level 9 - should trigger '3' in level thread table (compare 0xC1B0 in protected to 0x9500 in unprotected) - // This controls the 'zoom in helicopters' enemy - if (CChipRam[0x1b] == 0x9 && triggeredLevel9==0 && CChipRam[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) - { - triggeredLevel9 = 1; - CChipRam[0x5f] = 3; - } - - if (CChipRam[0xe] == 1) - { - CChipRam[0xe] = 0xfd; - CChipRam[0x61] = 0x04; - } - - // Access level data command (address 0xf5 goes from 1 -> 0) - if (CChipRam[0x7a]==0 && CChipLast_7a!=0 && CurrentCmd!=0xf5) - { - // Simulate time for command to execute (exact timing unknown, this is close) - CurrentCmd=0xf5; - bprintf(PRINT_NORMAL, _T("Accessing Level Data Command\n")); - AccessLevelDataCommand(); -// timer_set(ATTOTIME_IN_CYCLES(80000,0), NULL, 0, opwolf_timer_callback); - } - CChipLast_7a=CChipRam[0x7a]; - - // This seems to some kind of periodic counter - results are expected - // by the 68k when the counter reaches 0xa - if (CChipRam[0x7f]==0xa) - { - CChipRam[0xfe]=0xf7; - CChipRam[0xff]=0x6e; - } - - // These are set every frame - CChipRam[0x64]=0; - CChipRam[0x66]=0; -} - -UINT16 OpwolfCChipStatusRead() -{ - return 0x01; -} - -UINT16 OpwolfCChipDataRead(UINT32 Offset) -{ - return CChipRam[(CurrentBank * 0x400) + Offset]; -} - -void OpwolfCChipStatusWrite() -{ - CChipRam[0x3d] = 1; - CChipRam[0x7a] = 1; - updateDifficulty(0); -} - -void OpwolfCChipBankWrite(UINT16 Data) -{ - CurrentBank = Data & 7; -} - -void OpwolfCChipDataWrite(UINT8 *p68kRom, UINT32 Offset, UINT16 Data ) -{ - CChipRam[(CurrentBank * 0x400) + Offset] = Data & 0xff; - - if (CurrentBank == 0) { - if (Offset == 0x14) - { - UINT16* rom = (UINT16*)p68kRom; - UINT32 CoinTable[2]= { 0, 0}; - UINT8 CoinOffset[2]; - INT32 Slot; - - if ((CChipRegion == OPWOLF_REGION_JAPAN) || (CChipRegion == OPWOLF_REGION_US)) { - CoinTable[0] = 0x03ffce; - CoinTable[1] = 0x03ffce; - } - if ((CChipRegion == OPWOLF_REGION_WORLD) || (CChipRegion == OPWOLF_REGION_OTHER)) { - CoinTable[0] = 0x03ffde; - CoinTable[1] = 0x03ffee; - } - - CoinOffset[0] = 12 - (4 * ((Data & 0x30) >> 4)); - CoinOffset[1] = 12 - (4 * ((Data & 0xc0) >> 6)); - - for (Slot = 0; Slot < 2; Slot++) { - if (CoinTable[Slot]) { - CChipCoinsForCredit[Slot] = rom[(CoinTable[Slot] + CoinOffset[Slot] + 0) / 2] & 0xff; - CChipCreditsForCoin[Slot] = rom[(CoinTable[Slot] + CoinOffset[Slot] + 2) / 2] & 0xff; - } - } - } - - // Dip switch B - if (Offset == 0x15) { - updateDifficulty(0); - } - } -} - -void OpwolfCChipReset() -{ - memset(CChipRam, 0, 0x400 * 8); - - CChipLast_7a = 0; - CChipLast_04 = 0xfc; - CChipLast_05 = 0xff; - CChipCoins[0] = 0; - CChipCoins[1] = 0; - CChipCoinsForCredit[0] = 1; - CChipCreditsForCoin[0] = 1; - CChipCoinsForCredit[1] = 1; - CChipCreditsForCoin[1] = 1; - CurrentBank = 0; - CurrentCmd = 0; - c588 = 0; - c589 = 0; - c58a = 0; - triggeredLevel1b = 0; - triggeredLevel13b = 0; - triggeredLevel2 = 0; - triggeredLevel2b = 0; - triggeredLevel2c = 0; - triggeredLevel3b = 0; - triggeredLevel4 = 0; - triggeredLevel5 = 0; - triggeredLevel7 = 0; - triggeredLevel8 = 0; - triggeredLevel9 = 0; -} - -void OpwolfCChipInit(INT32 Region) -{ - CChipRegion = Region; - - CChipRam = (UINT8*)BurnMalloc(0x400 * 8); - memset(CChipRam, 0, 0x400 * 8); - - CChipLast_7a = 0; - CChipLast_04 = 0xfc; - CChipLast_05 = 0xff; - CChipCoins[0] = 0; - CChipCoins[1] = 0; - CChipCoinsForCredit[0] = 1; - CChipCreditsForCoin[0] = 1; - CChipCoinsForCredit[1] = 1; - CChipCreditsForCoin[1] = 1; - - TaitoIC_OpwolfCChipInUse = 1; -} - -void OpwolfCChipExit() -{ - BurnFree(CChipRam); - - CChipRegion = 0; - - CChipLast_7a = 0; - CChipLast_04 = 0; - CChipLast_05 = 0; - CChipCoins[0] = 0; - CChipCoins[1] = 0; - CChipCoinsForCredit[0] = 0; - CChipCreditsForCoin[0] = 0; - CChipCoinsForCredit[1] = 0; - CChipCreditsForCoin[1] = 0; - CurrentBank = 0; - CurrentCmd = 0; - c588 = 0; - c589 = 0; - c58a = 0; - -} - -void OpwolfCChipScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = CChipRam; - ba.nLen = 0x400 * 8; - ba.szName = "C-Chip Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(CurrentBank); - SCAN_VAR(CurrentCmd); - SCAN_VAR(CChipLast_7a); - SCAN_VAR(CChipLast_04); - SCAN_VAR(CChipLast_05); - SCAN_VAR(CChipCoinsForCredit); - SCAN_VAR(CChipCreditsForCoin); - SCAN_VAR(CChipCoins); - SCAN_VAR(c588); - SCAN_VAR(c589); - SCAN_VAR(c58a); - SCAN_VAR(triggeredLevel1b); - SCAN_VAR(triggeredLevel13b); - SCAN_VAR(triggeredLevel2); - SCAN_VAR(triggeredLevel2b); - SCAN_VAR(triggeredLevel2c); - SCAN_VAR(triggeredLevel3b); - SCAN_VAR(triggeredLevel4); - SCAN_VAR(triggeredLevel5); - SCAN_VAR(triggeredLevel7); - SCAN_VAR(triggeredLevel8); - SCAN_VAR(triggeredLevel9); - } -} - -#undef OPWOLF_REGION_JAPAN -#undef OPWOLF_REGION_US -#undef OPWOLF_REGION_WORLD -#undef OPWOLF_REGION_OTHER - - -/************************************************************************* - - Bonze Adventure C-Chip - ====================== - - Based on RAINE. Improvements with a lot of help from Ruben Panossian. - Additional thanks to Robert Gallagher and stephh. - - Taken from MAME 0.96 Aug 1, 2016. Current C-chip prot for Bonze will - cause the game to crash / freeze if you die in certain places. Don't - update until this is fixed in MAME. - dink - -*************************************************************************/ - - -static INT32 current_round = 0; -static INT32 current_bank = 0; -static INT32 coin_lockout = 0; - -static UINT8 cval[26]; -static UINT8 cc_port; -static UINT8 restart_status; - -struct cchip_mapping -{ - UINT16 xmin; - UINT16 xmax; - UINT16 ymin; - UINT16 ymax; - UINT8 index; -}; - -static const UINT16 CLEV[][13] = -{ -/* map start player start player y-range player x-range map y-range map x-range time */ - { 0x0000, 0x0018, 0x0020, 0x0030, 0x0028, 0x00D0, 0x0050, 0x0090, 0x0000, 0x0118, 0x0000, 0x0C90, 0x3800 }, - { 0x0000, 0x0100, 0x0048, 0x0028, 0x0028, 0x0090, 0x0070, 0x00B0, 0x0000, 0x02C0, 0x0000, 0x0CA0, 0x3000 }, - { 0x0000, 0x0518, 0x0068, 0x00B8, 0x0028, 0x00D0, 0x0068, 0x00B0, 0x02F8, 0x0518, 0x0000, 0x0EF8, 0x3000 }, - { 0x0978, 0x0608, 0x00C8, 0x00B0, 0x0028, 0x00D0, 0x0098, 0x00C8, 0x0608, 0x06E8, 0x0000, 0x0A48, 0x2000 }, - { 0x0410, 0x0708, 0x0070, 0x0030, 0x0028, 0x00D0, 0x0060, 0x0090, 0x0708, 0x0708, 0x0410, 0x1070, 0x3800 }, - { 0x1288, 0x0808, 0x0099, 0x00CE, 0x0028, 0x00D0, 0x0060, 0x00C0, 0x0000, 0x0808, 0x1288, 0x1770, 0x3000 }, - { 0x11B0, 0x0908, 0x0118, 0x0040, 0x0028, 0x00D0, 0x00B0, 0x00C0, 0x0900, 0x0910, 0x0050, 0x11B0, 0x3800 }, - { 0x0000, 0x0808, 0x0028, 0x00B8, 0x0028, 0x00D0, 0x0070, 0x00B0, 0x0808, 0x0808, 0x0000, 0x0398, 0x1000 }, - { 0x06F8, 0x0808, 0x0028, 0x00B8, 0x0028, 0x00D0, 0x0070, 0x00B0, 0x0808, 0x0808, 0x06F8, 0x06F8, 0x8800 }, - { 0x06F8, 0x0808, 0x0028, 0x00B8, 0x0028, 0x00D0, 0x0070, 0x00B0, 0x0808, 0x0808, 0x06F8, 0x06F8, 0xffff }, - { 0x06F8, 0x0808, 0x0028, 0x00B8, 0x0028, 0x00D0, 0x0070, 0x00B0, 0x0808, 0x0808, 0x06F8, 0x06F8, 0xffff }, -}; - -static UINT16 CPOS[][4] = -{ -/* map start player start */ - { 0x0000, 0x0018, 0x0020, 0x00A8 }, - { 0x01E0, 0x0018, 0x0070, 0x0098 }, - { 0x0438, 0x0018, 0x0070, 0x00A8 }, - { 0x04A0, 0x0018, 0x0070, 0x0080 }, - { 0x06B8, 0x0018, 0x0078, 0x0078 }, - { 0x08C8, 0x0018, 0x0070, 0x0028 }, - { 0x09C0, 0x0018, 0x0070, 0x00A8 }, - { 0x0A68, 0x0018, 0x0070, 0x0058 }, - { 0x0C40, 0x0018, 0x0070, 0x0040 }, - { 0x0000, 0x0208, 0x0040, 0x0070 }, - { 0x0080, 0x0218, 0x00B0, 0x0080 }, - { 0x0450, 0x01F8, 0x0090, 0x0030 }, - { 0x0450, 0x0218, 0x00A0, 0x00A0 }, - { 0x07A8, 0x0218, 0x0090, 0x0060 }, - { 0x0840, 0x0218, 0x0088, 0x0060 }, - { 0x0958, 0x0218, 0x00A0, 0x0070 }, - { 0x0A98, 0x0218, 0x0088, 0x0050 }, - { 0x0C20, 0x0200, 0x00A0, 0x0028 }, - { 0x0000, 0x0518, 0x0068, 0x00B0 }, - { 0x00D0, 0x0518, 0x0078, 0x0060 }, - { 0x02F0, 0x0518, 0x0078, 0x0048 }, - { 0x0670, 0x0518, 0x0078, 0x0048 }, - { 0x07D8, 0x0518, 0x0070, 0x0060 }, - { 0x09E8, 0x0500, 0x0080, 0x0080 }, - { 0x02E8, 0x04B0, 0x0080, 0x0090 }, - { 0x0278, 0x0318, 0x0078, 0x00A8 }, - { 0x0390, 0x0318, 0x0070, 0x00B8 }, - { 0x0608, 0x0318, 0x0080, 0x0058 }, - { 0x0878, 0x0318, 0x0078, 0x0098 }, - { 0x0908, 0x0418, 0x0078, 0x0030 }, - { 0x0B20, 0x0418, 0x0070, 0x0080 }, - { 0x0A48, 0x0608, 0x00C0, 0x0068 }, - { 0x0930, 0x0608, 0x00B8, 0x0080 }, - { 0x07E8, 0x0608, 0x00B8, 0x0078 }, - { 0x0630, 0x0608, 0x00C0, 0x0028 }, - { 0x02C8, 0x0608, 0x00C0, 0x0090 }, - { 0x02B0, 0x0608, 0x00B8, 0x0090 }, - { 0x00D8, 0x0608, 0x00B8, 0x00A0 }, - { 0x0020, 0x0610, 0x00B8, 0x00A8 }, - { 0x0560, 0x0708, 0x0068, 0x0090 }, - { 0x0860, 0x0708, 0x0060, 0x0090 }, - { 0x09C0, 0x0708, 0x0068, 0x0080 }, - { 0x0C58, 0x0708, 0x0068, 0x0070 }, - { 0x0D80, 0x0708, 0x0070, 0x00B0 }, - { 0x0EA8, 0x0708, 0x0070, 0x00B0 }, - { 0x0FC0, 0x0708, 0x0080, 0x0030 }, - { 0x1288, 0x0808, 0x0099, 0x00CE }, - { 0x12F0, 0x0808, 0x0078, 0x0028 }, - { 0x1488, 0x0808, 0x0080, 0x0070 }, - { 0x1600, 0x0808, 0x0080, 0x0090 }, - { 0x1508, 0x0708, 0x0080, 0x0090 }, - { 0x1770, 0x0728, 0x0080, 0x0080 }, - { 0x1770, 0x0650, 0x00D8, 0x0070 }, - { 0x1578, 0x05D0, 0x0098, 0x0060 }, - { 0x1508, 0x05E8, 0x0040, 0x0088 }, - { 0x1658, 0x0528, 0x0088, 0x0088 }, - { 0x1508, 0x04F8, 0x0080, 0x0060 }, - { 0x1500, 0x03E8, 0x0090, 0x0058 }, - { 0x1518, 0x0368, 0x0090, 0x0058 }, - { 0x15A8, 0x0268, 0x0080, 0x0058 }, - { 0x1650, 0x0250, 0x0080, 0x0058 }, - { 0x1630, 0x02B0, 0x0088, 0x0060 }, - { 0x16E0, 0x0398, 0x0068, 0x0068 }, - { 0x1680, 0x0528, 0x00A8, 0x0070 }, - { 0x1658, 0x0528, 0x0088, 0x0088 }, - { 0x1640, 0x05E8, 0x0088, 0x0088 }, - { 0x1770, 0x0588, 0x0090, 0x0088 }, - { 0x1770, 0x0508, 0x0098, 0x0088 }, - { 0x1770, 0x0450, 0x00D8, 0x0060 }, - { 0x1770, 0x0330, 0x00C0, 0x0080 }, - { 0x1740, 0x02A8, 0x0090, 0x0058 }, - { 0x16C8, 0x0178, 0x0080, 0x0060 }, - { 0x1508, 0x0208, 0x0028, 0x0060 }, - { 0x1618, 0x0110, 0x0078, 0x0068 }, - { 0x1770, 0x0118, 0x00C0, 0x0060 }, - { 0x1698, 0x0000, 0x0080, 0x0050 }, - { 0x1500, 0x0000, 0x0080, 0x0048 }, - { 0x1140, 0x0908, 0x00B8, 0x0068 }, - { 0x0FE8, 0x0908, 0x00B8, 0x0098 }, - { 0x0E08, 0x0908, 0x00B8, 0x0070 }, - { 0x0CD0, 0x0908, 0x00B8, 0x00B0 }, - { 0x08F8, 0x0908, 0x00B0, 0x0080 }, - { 0x07E8, 0x0908, 0x00B8, 0x00B8 }, - { 0x0660, 0x0908, 0x00B0, 0x0098 }, - { 0x03D0, 0x0908, 0x00B0, 0x0038 }, - { 0x00D0, 0x0908, 0x00B0, 0x0090 }, - { 0x0000, 0x0808, 0x0028, 0x00B8 }, - { 0x06F8, 0x0808, 0x0028, 0x00B8 } -}; - -static struct cchip_mapping CMAP[] = -{ - { 0x0000, 0x0250, 0x0000, 0x0100, 0x00 }, - { 0x0250, 0x04A8, 0x0000, 0x0100, 0x01 }, - { 0x04A8, 0x0730, 0x0000, 0x0100, 0x02 }, - { 0x0300, 0x0800, 0x0100, 0x0200, 0x03 }, - { 0x0730, 0x0938, 0x0000, 0x0100, 0x04 }, - { 0x0938, 0x0A30, 0x0000, 0x0100, 0x05 }, - { 0x0A30, 0x0AD8, 0x0000, 0x0100, 0x06 }, - { 0x0AD8, 0x0CB0, 0x0000, 0x0100, 0x07 }, - { 0x0C40, 0x0E80, 0x0000, 0x0100, 0x08 }, - { 0x0000, 0x0130, 0x0100, 0x0300, 0x09 }, - { 0x0130, 0x04F0, 0x0200, 0x0300, 0x0A }, - { 0x04F0, 0x0808, 0x0200, 0x0280, 0x0B }, - { 0x04F0, 0x0808, 0x0280, 0x0300, 0x0C }, - { 0x0808, 0x08C8, 0x0200, 0x0300, 0x0D }, - { 0x08C8, 0x09F8, 0x0200, 0x0300, 0x0E }, - { 0x09F8, 0x0B20, 0x0200, 0x0300, 0x0F }, - { 0x0B20, 0x0CC0, 0x0200, 0x0300, 0x10 }, - { 0x0CC0, 0x0E00, 0x0200, 0x0300, 0x11 }, - { 0x0000, 0x0148, 0x0500, 0x0600, 0x12 }, - { 0x0148, 0x0300, 0x0500, 0x0600, 0x13 }, - { 0x0300, 0x06E8, 0x0500, 0x0600, 0x14 }, - { 0x06E8, 0x0848, 0x0500, 0x0600, 0x15 }, - { 0x0848, 0x0A68, 0x0500, 0x0600, 0x16 }, - { 0x0A68, 0x0C00, 0x0500, 0x0600, 0x17 }, - { 0x0200, 0x0480, 0x0400, 0x0500, 0x18 }, - { 0x0200, 0x0400, 0x0300, 0x0400, 0x19 }, - { 0x0400, 0x0688, 0x0300, 0x0400, 0x1A }, - { 0x0688, 0x08F0, 0x0300, 0x0400, 0x1B }, - { 0x08F0, 0x0A80, 0x0300, 0x0400, 0x1C }, - { 0x0800, 0x0B90, 0x0400, 0x0500, 0x1D }, - { 0x0B90, 0x1100, 0x0400, 0x0500, 0x1E }, - { 0x09E8, 0x0C00, 0x0600, 0x0700, 0x1F }, - { 0x08A0, 0x09E8, 0x0600, 0x0700, 0x20 }, - { 0x06F0, 0x08A0, 0x0600, 0x0700, 0x21 }, - { 0x0388, 0x06F0, 0x0600, 0x0700, 0x22 }, - { 0x0368, 0x0388, 0x0600, 0x0700, 0x23 }, - { 0x0190, 0x0368, 0x0600, 0x0700, 0x24 }, - { 0x0000, 0x0190, 0x0600, 0x0700, 0x25 }, - { 0x0000, 0x0280, 0x0700, 0x0800, 0x26 }, - { 0x0380, 0x08C0, 0x0700, 0x0800, 0x27 }, - { 0x08C0, 0x0A28, 0x0700, 0x0800, 0x28 }, - { 0x0A20, 0x0CC0, 0x0700, 0x0800, 0x29 }, - { 0x0CC0, 0x0DF0, 0x0700, 0x0800, 0x2A }, - { 0x0DF0, 0x0F18, 0x0700, 0x0800, 0x2B }, - { 0x0F18, 0x1040, 0x0700, 0x0800, 0x2C }, - { 0x1040, 0x1280, 0x0700, 0x0800, 0x2D }, - { 0x1200, 0x1368, 0x0800, 0x0900, 0x2E }, - { 0x1368, 0x1508, 0x0800, 0x0900, 0x2F }, - { 0x1508, 0x1658, 0x0800, 0x0900, 0x30 }, - { 0x1658, 0x1900, 0x0800, 0x0900, 0x31 }, - { 0x1480, 0x1620, 0x0700, 0x0800, 0x32 }, - { 0x1620, 0x1900, 0x0700, 0x0800, 0x33 }, - - /* round 6 not fully mapped */ - - { 0x1200, 0x1580, 0x0000, 0x0100, 0x4C }, - { 0x10A0, 0x1380, 0x0900, 0x0A00, 0x4D }, - { 0x0EC0, 0x10A0, 0x0900, 0x0A00, 0x4E }, - { 0x0D80, 0x0EC0, 0x0900, 0x0A00, 0x4F }, - { 0x09A8, 0x0D80, 0x0900, 0x0A00, 0x50 }, - { 0x08A0, 0x09A8, 0x0900, 0x0A00, 0x51 }, - { 0x0710, 0x08A0, 0x0900, 0x0A00, 0x52 }, - { 0x0480, 0x0710, 0x0900, 0x0A00, 0x53 }, - { 0x0180, 0x0480, 0x0900, 0x0A00, 0x54 }, - { 0x0000, 0x0180, 0x0900, 0x0A00, 0x55 }, - { 0x0000, 0x0580, 0x0800, 0x0900, 0x56 }, - { 0x0580, 0x0900, 0x0800, 0x0900, 0x57 } -}; - -static void WriteLevelData(void) -{ - for (INT32 i = 0; i < 13; i++) - { - UINT16 v = CLEV[current_round][i]; - - cval[2 * i + 0] = v & 0xff; - cval[2 * i + 1] = v >> 8; - } -} - -static void WriteRestartPos(void) -{ - INT32 x = cval[0] + 256 * cval[1] + cval[4] + 256 * cval[5]; - INT32 y = cval[2] + 256 * cval[3] + cval[6] + 256 * cval[7]; - - for (INT32 n = 0; n < sizeof CMAP / sizeof CMAP[0]; n++) - { - if (x >= CMAP[n].xmin && x < CMAP[n].xmax && - y >= CMAP[n].ymin && y < CMAP[n].ymax) - { - for (INT32 i = 0; i < 4; i++) - { - UINT16 v = CPOS[CMAP[n].index][i]; - - cval[2 * i + 0] = v & 0xff; - cval[2 * i + 1] = v >> 8; - } - - return; - } - } -} - -void BonzeWriteCChipBank(INT32 data) -{ - current_bank = data & 7; -} - -void BonzeWriteCChipRam(INT32 offset, INT32 data) -{ - offset = (offset & 0xfff) / 2; - - if (current_bank == 0) - { - if (offset == 0x08) - { - cc_port = data; - coin_lockout = ~data >> 6; // data & 0xc0 - // coin_counter = data & 0x30; - } - - if (offset == 0x0e && data != 0x00) - { - WriteRestartPos(); - } - - if (offset == 0x0f && data != 0x00) - { - WriteLevelData(); - } - - if (offset == 0x10) - { - current_round = data; - } - - if (offset >= 0x11 && offset <= 0x2a) - { - cval[offset - 0x11] = data; - } - } -} - -UINT16 BonzeReadCChipRam(INT32 offset) -{ - offset = (offset & 0xfff) / 2; - - if (current_bank == 0) - { - switch (offset) - { - case 0x03: return TaitoInput[0]; /* STARTn + SERVICE1 */ - case 0x04: return TaitoInput[1] & coin_lockout; /* COINn */ - case 0x05: return TaitoInput[2]; /* Player controls + TILT */ - case 0x06: return TaitoInput[3]; /* Player controls (cocktail) */ - case 0x08: return cc_port; - } - - if (offset == 0x0e) - { - return 0; //restart_status; /* 0xff signals error, 0 signals ok */ - } - - if (offset >= 0x11 && offset <= 0x2a) - { - return cval[offset - 0x11]; - } - } - - return 0; -} - -void BonzeCChipReset() -{ - current_round = 0; - current_bank = 0; - coin_lockout = 0; - - memset (cval, 0, sizeof(cval)); - cc_port = 0; - restart_status = 0; -} - -void BonzeCChipScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = cval; - ba.nLen = sizeof(cval); - ba.szName = "C-Chip Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(current_round); - SCAN_VAR(current_bank); - SCAN_VAR(coin_lockout); - SCAN_VAR(cc_port); - SCAN_VAR(restart_status); - } -} - -/************************************************************************* - - Volfied C-Chip Protection - ========================= - - The C-Chip (Taito TC0030CMD) is an unidentified mask programmed - microcontroller of some sort with 64 pins. It probably has - about 2k of ROM and 8k of RAM. - - Cheat: - volfied:0:100191:00:001:Complete level with 99.9% Now! - volfied:0:100192:99:501:Complete level with 99.9% Now! (2/3) - volfied:0:100193:09:501:Complete level with 99.9% Now! (3/3) - -*************************************************************************/ - -UINT8 volfied_current_bank; -UINT8 volfied_current_flag; -UINT8 volfied_cc_port; -UINT8 volfied_current_cmd; -UINT8 * volfied_cchip_ram; - -static const UINT16 palette_data_01[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x104a, 0xce41, 0x8c39, 0x5252, 0xd662, 0x4a31, 0x0000, - 0x1e00, 0x1000, 0x9e01, 0x1e02, 0xde02, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x104a, 0xce41, 0x8c39, 0x5252, 0xd662, 0x4a31, 0x0000, - 0x1e00, 0x1000, 0x9e01, 0x1e02, 0xde02, 0x0000, 0x0000, 0x0000, - 0x0000, 0xd62a, 0x1002, 0xce01, 0x5a3b, 0xde7b, 0x4a31, 0x0000, - 0x1e00, 0x1000, 0x9e01, 0x1e02, 0xde02, 0x0038, 0x0e38, 0x0000 -}; - -static const UINT16 palette_data_02[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x4008, 0x0029, 0xc641, 0x4c52, 0x5473, 0xde7b, 0x1863, - 0x524a, 0xce39, 0x0821, 0x9c01, 0x1200, 0x8001, 0xc002, 0xce39, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x4a29, 0xce39, 0xde7b, 0x4001, 0x4002, 0xc003, - 0x9e01, 0x1e00, 0x0078, 0x0e00, 0x5401, 0x0040, 0xde03, 0x1600, - 0x0000, 0x4208, 0x0c39, 0xd061, 0x547a, 0x1472, 0xde7b, 0xde7b, - 0x187b, 0x947a, 0x0821, 0x9e79, 0x1040, 0x8079, 0xc07a, 0x0000 -}; - -static const UINT16 palette_data_03[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xc038, 0x4049, 0xc059, 0x406a, 0xc07a, 0x4208, 0x0821, - 0x8c31, 0x1042, 0x9c73, 0x1e03, 0x1a02, 0x0c00, 0x1860, 0x1e78, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x4a29, 0xce39, 0xde7b, 0x4001, 0x4002, 0xc003, - 0x9e01, 0x1e00, 0x0078, 0x0e00, 0x5401, 0x0040, 0xde03, 0x1600, - 0x0000, 0xc001, 0x4002, 0x8002, 0xc002, 0xc002, 0x0001, 0xc001, - 0x9201, 0xc002, 0xc003, 0x0003, 0x8002, 0x4001, 0xc002, 0x4003 -}; - -static const UINT16 palette_data_04[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x1042, 0xce39, 0x8c31, 0x524a, 0xd65a, 0x4a29, 0x0000, - 0x1e00, 0x1000, 0x8c21, 0xce29, 0x0039, 0x0038, 0x0e38, 0x0038, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0x1e00, 0xc003, 0x1042, 0xde03, 0x0000, 0xd65a, - 0xce39, 0x8c31, 0x4a29, 0x0078, 0xc07b, 0x1e02, 0x1e78, 0xc003, - 0x0000, 0x1002, 0xce01, 0x8c01, 0x5202, 0xd602, 0x4a01, 0x0000, - 0x1e00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -static const UINT16 palette_data_05[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x1200, 0x1600, 0x1a00, 0x9e01, 0x8021, 0xc029, 0x0032, - 0x803a, 0x4208, 0x0821, 0x1042, 0xd65a, 0x9c73, 0xde03, 0x5c02, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0x1e00, 0xc003, 0x1042, 0xde03, 0x0000, 0xd65a, - 0xce39, 0x8c31, 0x4a29, 0x0078, 0xc07b, 0x1e02, 0x1e78, 0xc003, - 0x0000, 0x5202, 0xd602, 0x5a03, 0xde03, 0x8021, 0xc029, 0x0032, - 0x803a, 0x4208, 0x0821, 0x1042, 0xd65a, 0x9c73, 0xde03, 0x5c02 -}; - -static const UINT16 palette_data_06[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x9e52, 0x9028, 0x9428, 0x9828, 0x9e28, 0x4208, 0xde7b, - 0xde03, 0x9c02, 0xc03a, 0x0063, 0x586b, 0x9252, 0x8a31, 0x5e31, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0x1e00, 0xc003, 0x1042, 0xde03, 0x0000, 0xd65a, - 0xce39, 0x8c31, 0x4a29, 0x0078, 0xc07b, 0x1e02, 0x1e78, 0xc003, - 0x0263, 0x9e52, 0x8058, 0x0879, 0x8c79, 0x107a, 0x4208, 0xde7b, - 0xde01, 0x1e01, 0xc03a, 0x0063, 0x586b, 0x9252, 0x8a31, 0x527a -}; - -static const UINT16 palette_data_07[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xc038, 0x4049, 0xc059, 0x406a, 0xc07a, 0x4208, 0x0821, - 0x8c31, 0x1042, 0x9c73, 0x1e03, 0x1a02, 0x0c00, 0x1860, 0x1e78, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x4a29, 0xce39, 0xde7b, 0x4001, 0x4002, 0xc003, - 0x9e01, 0x1e00, 0x0078, 0x0e00, 0x5401, 0x0040, 0xde03, 0x1600, - 0x0000, 0x8001, 0x0002, 0x8002, 0x0003, 0x8003, 0x4208, 0x0821, - 0x8c31, 0x1042, 0x9c73, 0x1e00, 0x5c02, 0x0c00, 0x1860, 0x1e78 -}; - -static const UINT16 palette_data_08[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x1042, 0xce39, 0x8c31, 0x524a, 0xd65a, 0x4a29, 0x0000, - 0x1e00, 0x1000, 0x9e01, 0x5e02, 0x5e03, 0x0038, 0x0e38, 0x0000, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0x1e00, 0xc003, 0x1042, 0xde03, 0x0000, 0xd65a, - 0xce39, 0x8c31, 0x4a29, 0x0078, 0xc07b, 0x1e02, 0x1e78, 0xc003, - 0x0000, 0x5202, 0x1002, 0xce19, 0x9432, 0x1843, 0x8c11, 0x0000, - 0x1e00, 0x1000, 0x9e01, 0x5e02, 0x5e03, 0x0038, 0x0e38, 0x0000 -}; - -static const UINT16 palette_data_09[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x1048, 0x1250, 0x1458, 0x1660, 0xd418, 0x9e02, 0xc203, - 0x4208, 0x4a29, 0x8c31, 0x1042, 0x1e78, 0x166b, 0x0c38, 0x1868, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0x1e00, 0xc003, 0x1042, 0xde03, 0x0000, 0xd65a, - 0xce39, 0x8c31, 0x4a29, 0x0078, 0xc07b, 0x1e02, 0x1e78, 0xc003, - 0x0000, 0x1600, 0x1a21, 0x5c29, 0xde39, 0xd418, 0x9e02, 0xc203, - 0x4208, 0x4a29, 0x8c31, 0x1042, 0x1e42, 0x186b, 0x9210, 0x9e31 -}; - -static const UINT16 palette_data_0a[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0038, 0x4a29, 0xce39, 0x9452, 0x9218, 0xde7b, - 0xc001, 0xc003, 0xde03, 0x1403, 0xcc01, 0x4a01, 0x0668, 0x4672, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0x1e00, 0xc003, 0x1042, 0xde03, 0x0000, 0xd65a, - 0xce39, 0x8c31, 0x4a29, 0x0078, 0xc07b, 0x1e02, 0x1e78, 0xc003, - 0x0000, 0x0000, 0x0038, 0x4a29, 0x5401, 0x9c02, 0x9218, 0xde7b, - 0x0003, 0xc003, 0x5e02, 0xde01, 0x5201, 0xd200, 0x0668, 0x4672 -}; - -static const UINT16 palette_data_0b[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0050, 0x8001, 0xc001, 0x0002, 0xc002, 0xd043, 0x9c73, 0x524a, - 0xce39, 0x8c31, 0x4208, 0xde03, 0x9c02, 0x1e60, 0x1a00, 0x1000, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0x1e00, 0xc003, 0x1042, 0xde03, 0x0000, 0xd65a, - 0xce39, 0x8c31, 0x4a29, 0x0078, 0xc07b, 0x1e02, 0x1e78, 0xc003, - 0x0000, 0x8c01, 0xce01, 0x1002, 0xd62a, 0xde4b, 0x9c73, 0x5202, - 0xce01, 0x8c01, 0x4208, 0xde03, 0x9c02, 0x1e60, 0x1a00, 0x1000 -}; - -static const UINT16 palette_data_0c[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0038, 0x4a29, 0xce39, 0x9452, 0x9218, 0x9e52, - 0xc001, 0xc003, 0x1e00, 0x1400, 0x0c00, 0x4a01, 0x0668, 0x4672, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0x1e00, 0xc003, 0x1042, 0xde03, 0x0000, 0xd65a, - 0xce39, 0x8c31, 0x4a29, 0x0078, 0xc07b, 0x1e02, 0x1e78, 0xc003, - 0x0000, 0x0000, 0x0038, 0x4a29, 0xce39, 0x9452, 0x9218, 0xde7b, - 0xc001, 0xc003, 0xde03, 0x1403, 0xcc01, 0x4a01, 0x0668, 0x4672 -}; - -static const UINT16 palette_data_0d[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0078, 0x4208, 0x1052, 0x9462, 0x1873, 0x5a73, 0xde7b, 0x1863, - 0x524a, 0xce39, 0x0821, 0x1600, 0x1000, 0xd201, 0xde03, 0x0a42, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0078, 0x4208, 0x1052, 0x9462, 0x1873, 0x5a73, 0xde7b, 0x1863, - 0x524a, 0xce39, 0x0821, 0x1600, 0x1000, 0xd201, 0xde03, 0x0a42, - 0x0000, 0x4208, 0x5029, 0x9431, 0xd839, 0x5a4a, 0x9e52, 0x5862, - 0xde4b, 0x8e39, 0x0821, 0x1600, 0x1000, 0xd201, 0x1e00, 0x0a42 -}; - -static const UINT16 palette_data_0e[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0e01, 0x5001, 0x9201, 0xd401, 0x1602, 0x1200, 0x1600, - 0x4208, 0x0821, 0x8c31, 0x1042, 0x5a6b, 0x8001, 0x0002, 0x9a02, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x4a29, 0xce39, 0xde7b, 0x4001, 0x4002, 0xc003, - 0x9e01, 0x1e00, 0x0078, 0x0e00, 0x5401, 0x0040, 0xde03, 0x1600, - 0x0000, 0x8a21, 0x0a32, 0x4c3a, 0x8e4a, 0x504b, 0xd203, 0xc003, - 0x4208, 0x0821, 0x8c31, 0x1042, 0x5a6b, 0x8001, 0x0002, 0x545b -}; - -static const UINT16 palette_data_0f[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xc038, 0x4049, 0xc059, 0x406a, 0xc07a, 0x0000, 0x0821, - 0x9c31, 0x1042, 0x9c73, 0x1e02, 0x1a02, 0x0c00, 0x4002, 0xc001, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0xde7b, 0x1e00, 0xc003, 0x1042, 0xde03, 0x0000, 0xd65a, - 0xce39, 0x8c31, 0x4a29, 0x0078, 0xc07b, 0x1e02, 0x1e78, 0xc003, - 0x0000, 0xce00, 0x5201, 0xd601, 0x5a02, 0xde02, 0x0000, 0x0821, - 0x8c31, 0x1042, 0x9c73, 0x1e03, 0x1a02, 0x0c00, 0x9e01, 0x0e00 -}; - -static const UINT16 palette_data_10[0x50] = -{ - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0601, 0x8a09, 0x0e1a, 0x922a, 0x163b, 0xde7b, 0xd65a, - 0xce39, 0x0821, 0x0000, 0x0c00, 0x5208, 0x1a02, 0x9e03, 0xce39, - 0x0000, 0xde7b, 0xde03, 0x5e01, 0x5e02, 0xc07b, 0x0000, 0xde7b, - 0x0058, 0x4079, 0x407a, 0x407b, 0xd47b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x1400, 0x8002, 0x0068, 0x0000, 0x5e01, 0x5e02, 0x1e03, - 0xde03, 0xce39, 0xce39, 0xce39, 0xce39, 0xce39, 0xce39, 0xce39, - 0x0078, 0x4208, 0x1052, 0x9462, 0x1873, 0x5a73, 0xde7b, 0x1863, - 0x524a, 0xce39, 0x0821, 0x1600, 0x1000, 0xd201, 0xde03, 0x0a42 -}; - -static const UINT16 palette_data_11[0x50] = -{ - 0x0000, 0x4a29, 0x8c31, 0xce39, 0x1042, 0x524a, 0x9452, 0xd65a, - 0x1863, 0x0000, 0xde39, 0xde7b, 0xc001, 0x8002, 0x1800, 0x1e00, - 0x0000, 0xde7b, 0x1e00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1e00, 0x1e00, 0x1e00, 0x1e00, 0x1e00, 0x1e00, 0x1e00, 0x1e00, - 0x1e00, 0x1e00, 0x1e00, 0x1e00, 0x1e00, 0x1e00, 0x1e00, 0x1e00, - 0xde03, 0xde03, 0xde03, 0xde03, 0xde03, 0xde03, 0xde03, 0xde03, - 0xde03, 0xde03, 0xde03, 0xde03, 0xde03, 0xde03, 0xde03, 0xde03, - 0xde03, 0x0e00, 0x9e4a, 0x0000, 0x1042, 0xde7b, 0x9452, 0x4a29, - 0xce39, 0x1c02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -static const UINT16 *const palette_data_lookup[] = -{ - 0, - palette_data_01, - palette_data_02, - palette_data_03, - palette_data_04, - palette_data_05, - palette_data_06, - palette_data_07, - palette_data_08, - palette_data_09, - palette_data_0a, - palette_data_0b, - palette_data_0c, - palette_data_0d, - palette_data_0e, - palette_data_0f, - palette_data_10, - palette_data_11 -}; - - -static void volfied_timer_callback() -{ - // Palette commands - palette data written to bank 0: $10 - $af - if (volfied_current_cmd >= 0x1 && volfied_current_cmd < 0x12) - { - const UINT16* palette_data = palette_data_lookup[volfied_current_cmd]; - INT32 i; - for (i = 0; i < 0x50; i++) - { - volfied_cchip_ram[0x10 + i * 2 + 0] = palette_data[i] >> 8; - volfied_cchip_ram[0x10 + i * 2 + 1] = palette_data[i] & 0xff; - } - } - - // Unknown command - result written to bank 0: $23 - if (volfied_current_cmd >= 0x81 && volfied_current_cmd < 0x92) - { - switch (volfied_current_cmd) - { - case 0x81: volfied_cchip_ram[0x23] = 0xf; break; - case 0x82: volfied_cchip_ram[0x23] = 0x1; break; - case 0x83: volfied_cchip_ram[0x23] = 0x6; break; - case 0x84: volfied_cchip_ram[0x23] = 0xf; break; - case 0x85: volfied_cchip_ram[0x23] = 0x9; break; - case 0x86: volfied_cchip_ram[0x23] = 0x6; break; - case 0x87: volfied_cchip_ram[0x23] = 0x6; break; - case 0x88: volfied_cchip_ram[0x23] = 0xf; break; - case 0x89: volfied_cchip_ram[0x23] = 0x8; break; - case 0x8a: volfied_cchip_ram[0x23] = 0x1; break; - case 0x8b: volfied_cchip_ram[0x23] = 0xa; break; - case 0x8c: volfied_cchip_ram[0x23] = 0x1; break; - case 0x8d: volfied_cchip_ram[0x23] = 0x1; break; - case 0x8e: volfied_cchip_ram[0x23] = 0x8; break; - case 0x8f: volfied_cchip_ram[0x23] = 0x6; break; - case 0x90: volfied_cchip_ram[0x23] = 0xa; break; - case 0x91: volfied_cchip_ram[0x23] = 0x0; break; - } - } - - volfied_current_cmd = 0; -} - -/************************************* - * - * Writes to C-Chip - Important Bits - * - *************************************/ - -void VolfiedCChipBankWrite(UINT16 data) -{ - volfied_current_bank = data & 7; -} - -void VolfiedCChipRamWrite(INT32 offset, UINT8 data) -{ - volfied_cchip_ram[(volfied_current_bank * 0x400) + offset] = data; - -// if (offset != 0x8) -// logerror("%08x: volfied c write %04x %04x\n", cpu_get_pc(space->cpu), offset, data); - - if (volfied_current_bank == 0) - { - if (offset == 0x008) - { - volfied_cc_port = data; - -// coin_lockout_w(space->machine, 1, data & 0x80); -// coin_lockout_w(space->machine, 0, data & 0x40); -// coin_counter_w(space->machine, 1, data & 0x20); -// coin_counter_w(space->machine, 0, data & 0x10); - } - - if (offset == 0x3fe) - { - /******************* - (This table stored in ROM at $146a8) - (Level number stored at $100198.b, from $100118.b, from $100098.b) - (Level number at $b34 stored to $100098.b) - - round 01 => data $0A - round 02 => data $01 - round 03 => data $03 - round 04 => data $08 - round 05 => data $05 - round 06 => data $04 - round 07 => data $0B - round 08 => data $09 - round 09 => data $07 - round 10 => data $06 - round 11 => data $0E - round 12 => data $0D - round 13 => data $02 - round 14 => data $0C - round 15 => data $0F - round 16 => data $10 - final => data $11 - - ********************/ - - volfied_current_cmd = data; - - // Palette request cmd - verified to take around 122242 68000 cycles to complete - if (volfied_current_cmd >= 0x1 && volfied_current_cmd < 0x12) - { - //space->machine->scheduler().timer_set(downcast(space->cpu)->cycles_to_attotime(122242), FUNC(volfied_timer_callback)); -// nTaitoCyclesDone[0] += SekRun(122242); - volfied_timer_callback(); - } - // Unknown cmd - verified to take around 105500 68000 cycles to complete - else if (volfied_current_cmd >= 0x81 && volfied_current_cmd < 0x92) - { - //space->machine->scheduler().timer_set(downcast(space->cpu)->cycles_to_attotime(105500), FUNC(volfied_timer_callback)); -// nTaitoCyclesDone[0] += SekRun(105500); - volfied_timer_callback(); - } - else - { -// logerror("unknown cchip cmd %02x\n", data); - volfied_current_cmd = 0; - } - } - - // Some kind of timer command - if (offset == 0x3ff) - { - volfied_current_flag = data; - } - } -} - - -/************************************* - * - * Reads from C-Chip - * - *************************************/ - -UINT8 VolfiedCChipCtrlRead() -{ - return 0x01; -} - -UINT8 VolfiedCChipRamRead(INT32 offset) -{ - /* Check for input ports */ - if (volfied_current_bank == 0) - { - switch (offset) - { - case 0x03: return TaitoInput[0];//input_port_read(space->machine, "F00007"); /* STARTn + SERVICE1 */ - case 0x04: return TaitoInput[1];//input_port_read(space->machine, "F00009"); /* COINn */ - case 0x05: return TaitoInput[2];//input_port_read(space->machine, "F0000B"); /* Player controls + TILT */ - case 0x06: return TaitoInput[3];//input_port_read(space->machine, "F0000D"); /* Player controls (cocktail) */ - case 0x08: return volfied_cc_port; - } - } - -// if (cpu_get_pc(space->cpu)!=0x15ca8 && cpu_get_pc(space->cpu)!=0x15cd8 && cpu_get_pc(space->cpu)!=0x15cde) -// logerror("%08x: volfied c read %04x (bank %04x)\n", cpu_get_pc(space->cpu), offset, volfied_current_bank); - - /* Unknown */ - if (volfied_current_bank == 2 && offset == 0x005) - { - /* Not fully understood - Game writes: - 0001a0c2: volfied c write 0005 00aa - 0001a0ca: volfied c write 0006 0055 - 0001a0d2: volfied c write 0004 0065 - - Then expects 0x7c to replace the 0xaa some time later. - */ - return 0x7c; /* makes worm in round 1 appear */ - } - - /* Unknown - some kind of timer */ - if (volfied_current_bank == 0 && offset == 0x3ff) - { - return 2 * volfied_current_flag; /* fixes freeze after shield runs out */ - } - - /* Current command status */ - if (volfied_current_bank == 0 && offset == 0x3fe) - { - return volfied_current_cmd; - } - - return volfied_cchip_ram[(volfied_current_bank * 0x400) + offset]; -} - - -/************************************* - * - * C-Chip State Saving - * - *************************************/ - -void VolfiedCChipInit() -{ - volfied_cchip_ram = (UINT8*)BurnMalloc(0x400 * 8); - - TaitoIC_VolfiedCChipInUse = 1; - -// state->save_item(NAME(state->volfied_current_bank)); -// state->save_item(NAME(state->volfied_current_cmd)); -// state->save_item(NAME(state->volfied_current_flag)); -// state->save_item(NAME(state->volfied_cc_port)); -// state->save_pointer(NAME(state->volfied_cchip_ram), 0x400 * 8); -} - -void VolfiedCChipReset() -{ - volfied_current_bank = 0; - volfied_current_flag = 0; - volfied_cc_port = 0; - volfied_current_cmd = 0; -} - -void VolfiedCChipExit() -{ - BurnFree(volfied_cchip_ram); -} - -void VolfiedCChipScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = volfied_cchip_ram; - ba.nLen = 0x400 * 8; - ba.szName = "CChip Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(volfied_current_bank); - SCAN_VAR(volfied_current_flag); - SCAN_VAR(volfied_cc_port); - SCAN_VAR(volfied_current_cmd); - } -} diff --git a/jan/src/burn/drv/taito/d_arkanoid.cpp b/jan/src/burn/drv/taito/d_arkanoid.cpp deleted file mode 100644 index 83cf1fee9..000000000 --- a/jan/src/burn/drv/taito/d_arkanoid.cpp +++ /dev/null @@ -1,2082 +0,0 @@ -// FB Alpha Arkanoid driver module -// Based on MAME driver by Brad Oliver and MANY others. - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "taito_m68705.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvMcuROM; -static UINT8 *DrvGfxROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvMcuRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static INT16 *pAY8910Buffer[3]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; -static UINT8 *gfxbank; -static UINT8 *palettebank; -static UINT8 *paddleselect; -static UINT8 *bankselect; - -static UINT8 DrvInputs[4]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; -static UINT16 DrvAxis[2]; -static UINT32 nAnalogAxis[2] = {0,0}; - -static INT32 arkanoid_bootleg_id = 0; -static INT32 use_mcu; - -static UINT8 arkanoid_bootleg_cmd; - -enum { - ARKUNK=0, - ARKANGC, - ARKANGC2, - ARKBLOCK, - ARKBLOC2, - ARKGCBL, - PADDLE2, - HEXA, - TETRSARK -}; - -#define A(a, b, c, d) { a, b, (UINT8*)(c), d } - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 4, "p1 coin" }, - {"P1 start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy2 + 0, "p1 fire 1"}, - - A("P1 Right / left", BIT_ANALOG_REL, DrvAxis + 0, "p1 x-axis"), - - {"P2 Coin" , BIT_DIGITAL , DrvJoy1 + 5, "p2 coin" }, - {"P2 start" , BIT_DIGITAL , DrvJoy1 + 1, "p2 start" }, - {"P2 Button 1" , BIT_DIGITAL , DrvJoy2 + 2, "p2 fire 1"}, - - A("P2 Right / left", BIT_ANALOG_REL, DrvAxis + 1, "p1 x-axis"), - - {"Tilt", BIT_DIGITAL, DrvJoy1 + 3, "tilt" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "diag" }, - {"Reset", BIT_DIGITAL , &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnInputInfo tetrsarkInputList[] = { - {"P1 Coin" , BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 0, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1"}, - - {"P2 Coin" , BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 start" , BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 0, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(tetrsark) - -static struct BurnInputInfo HexaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, -}; - -STDINPUTINFO(Hexa) - -static struct BurnDIPInfo arkanoidDIPList[]= -{ - {0x0b, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0b, 0x01, 0x01, 0x01, "No" }, - {0x0b, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0b, 0x01, 0x08, 0x08, "Easy" }, - {0x0b, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0b, 0x01, 0x10, 0x10, "20K 60K 60K+" }, - {0x0b, 0x01, 0x10, 0x00, "20K" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0b, 0x01, 0x20, 0x20, "3" }, - {0x0b, 0x01, 0x20, 0x00, "5" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0b, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -}; - -STDDIPINFO(arkanoid) - -static struct BurnDIPInfo arkanoidjDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0b, 0x01, 0x01, 0x01, "No" }, - {0x0b, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0b, 0x01, 0x08, 0x08, "Easy" }, - {0x0b, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0b, 0x01, 0x10, 0x10, "20K 60K 60K+" }, - {0x0b, 0x01, 0x10, 0x00, "20K" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0b, 0x01, 0x20, 0x20, "3" }, - {0x0b, 0x01, 0x20, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0b, 0x01, 0x40, 0x40, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x40, 0x00, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x80, 0x00, "Upright" }, - {0x0b, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(arkanoidj) - -static struct BurnDIPInfo ark1ballDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0b, 0x01, 0x01, 0x01, "No" }, - {0x0b, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0b, 0x01, 0x08, 0x08, "Easy" }, - {0x0b, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0b, 0x01, 0x10, 0x10, "60K 100K 60K+" }, - {0x0b, 0x01, 0x10, 0x00, "60K" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0b, 0x01, 0x20, 0x20, "1" }, - {0x0b, 0x01, 0x20, 0x00, "2" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0b, 0x01, 0x40, 0x40, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x40, 0x00, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x80, 0x00, "Upright" }, - {0x0b, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(ark1ball) - -static struct BurnDIPInfo arkangcDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2 , "Ball Speed" }, - {0x0b, 0x01, 0x01, 0x01, "Normal" }, - {0x0b, 0x01, 0x01, 0x00, "Faster" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0b, 0x01, 0x08, 0x08, "Easy" }, - {0x0b, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0b, 0x01, 0x10, 0x10, "20K 60K 60K+" }, - {0x0b, 0x01, 0x10, 0x00, "20K" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0b, 0x01, 0x20, 0x20, "3" }, - {0x0b, 0x01, 0x20, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0b, 0x01, 0x40, 0x40, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x40, 0x00, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x80, 0x00, "Upright" }, - {0x0b, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(arkangc) - -static struct BurnDIPInfo arkangc2DIPList[]= -{ - {0x0b, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2 , "Ball Speed" }, - {0x0b, 0x01, 0x01, 0x01, "Slower" }, - {0x0b, 0x01, 0x01, 0x00, "Normal" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0b, 0x01, 0x08, 0x08, "Easy" }, - {0x0b, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0b, 0x01, 0x10, 0x10, "20K 60K 60K+" }, - {0x0b, 0x01, 0x10, 0x00, "20K" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0b, 0x01, 0x20, 0x20, "3" }, - {0x0b, 0x01, 0x20, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0b, 0x01, 0x40, 0x40, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x40, 0x00, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x80, 0x00, "Upright" }, - {0x0b, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(arkangc2) - -static struct BurnDIPInfo arkgcblDIPList[]= -{ - {0x0b, 0xff, 0xff, 0x5f, NULL }, - - {0 , 0xfe, 0 , 2 , "Round Select" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0b, 0x01, 0x08, 0x08, "Easy" }, - {0x0b, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0b, 0x01, 0x10, 0x10, "60K 100K 60K+" }, - {0x0b, 0x01, 0x10, 0x00, "60K" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0b, 0x01, 0x20, 0x00, "2" }, - {0x0b, 0x01, 0x20, 0x20, "3" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x80, 0x00, "Upright" }, - {0x0b, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(arkgcbl) - -static struct BurnDIPInfo paddle2DIPList[]= -{ - {0x0b, 0xff, 0xff, 0x5f, NULL }, - - {0 , 0xfe, 0 , 2 , "Round Select" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Controls ?" }, - {0x0b, 0x01, 0x04, 0x04, "Normal" }, - {0x0b, 0x01, 0x04, 0x00, "Alternate" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0b, 0x01, 0x08, 0x08, "Easy" }, - {0x0b, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0b, 0x01, 0x10, 0x10, "60K 60K 60K+" }, - {0x0b, 0x01, 0x10, 0x00, "60K" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0b, 0x01, 0x20, 0x00, "2" }, - {0x0b, 0x01, 0x20, 0x20, "3" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0b, 0x01, 0x40, 0x40, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x40, 0x00, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x80, 0x00, "Upright" }, - {0x0b, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(paddle2) - -static struct BurnDIPInfo arktayt2DIPList[]= -{ - {0x0b, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0b, 0x01, 0x01, 0x01, "No" }, - {0x0b, 0x01, 0x01, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Difficulty" }, - {0x0b, 0x01, 0x08, 0x08, "Easy" }, - {0x0b, 0x01, 0x08, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0b, 0x01, 0x10, 0x10, "60K 60K 60K+" }, - {0x0b, 0x01, 0x10, 0x00, "60K" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x0b, 0x01, 0x20, 0x20, "2" }, - {0x0b, 0x01, 0x20, 0x00, "3" }, - - {0 , 0xfe, 0 , 2 , "Coinage" }, - {0x0b, 0x01, 0x40, 0x00, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x40, 0x40, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x80, 0x00, "Upright" }, - {0x0b, 0x01, 0x80, 0x80, "Cocktail" }, -}; - -STDDIPINFO(arktayt2) - -static struct BurnDIPInfo tetrsarkDIPList[]= -{ - {0x0d, 0xff, 0xff, 0xf0, NULL }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x10, 0x10, "Upright" }, - {0x0d, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x20, 0x20, "Off" }, - {0x0d, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0xc0, 0x40, "1C 3C" }, - {0x0d, 0x01, 0xc0, 0x00, "1C 5C" }, -}; - -STDDIPINFO(tetrsark) - -static struct BurnDIPInfo HexaDIPList[]= -{ - {0x09, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x09, 0x01, 0x03, 0x00, "3 Coins 1 Credits" }, - {0x09, 0x01, 0x03, 0x01, "2 Coins 1 Credits" }, - {0x09, 0x01, 0x03, 0x03, "1 Coin 1 Credits" }, - {0x09, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Naughty Pics" }, - {0x09, 0x01, 0x04, 0x04, "Off" }, - {0x09, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x09, 0x01, 0x08, 0x08, "Off" }, - {0x09, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty?" }, - {0x09, 0x01, 0x30, 0x30, "Easy?" }, - {0x09, 0x01, 0x30, 0x20, "Medium?" }, - {0x09, 0x01, 0x30, 0x10, "Hard?" }, - {0x09, 0x01, 0x30, 0x00, "Hardest?" }, - - {0 , 0xfe, 0 , 2, "Pobys" }, - {0x09, 0x01, 0x40, 0x40, "2" }, - {0x09, 0x01, 0x40, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x09, 0x01, 0x80, 0x00, "Off" }, - {0x09, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Hexa) - -static UINT8 arkanoid_bootleg_f002_read() -{ - UINT8 arkanoid_bootleg_val = 0x00; - - switch (arkanoid_bootleg_id) - { - case ARKANGC: - case ARKBLOCK: - case ARKBLOC2: - case ARKANGC2: - break; - - case ARKGCBL: - switch (arkanoid_bootleg_cmd) - { - case 0x8a: - arkanoid_bootleg_val = 0xa5; - break; - case 0xff: - arkanoid_bootleg_val = 0xe2; - break; - default: - break; - } - break; - - case PADDLE2: - switch (arkanoid_bootleg_cmd) - { - case 0x24: // Avoid bad jump to 0x0066 - arkanoid_bootleg_val = 0x9b; - break; - case 0x36: // Avoid "BAD HARDWARE " message - arkanoid_bootleg_val = 0x2d; - break; - case 0x38: // Start of levels table (fixed offset) - arkanoid_bootleg_val = 0xf3; - break; - case 0x8a: // Current level (fixed routine) - arkanoid_bootleg_val = 0xa5; - break; - case 0xc3: // Avoid bad jump to 0xf000 - arkanoid_bootleg_val = 0x1d; - break; - case 0xe3: // Number of bricks left (fixed offset) - arkanoid_bootleg_val = 0x61; - break; - case 0xf7: // Avoid "U69" message - arkanoid_bootleg_val = 0x00; - break; - case 0xff: // Avoid "BAD HARDWARE " message (fixed routine) - arkanoid_bootleg_val = 0xe2; - break; - default: - break; - } - break; - } - - return arkanoid_bootleg_val; -} - -static void arkanoid_bootleg_d018_write(UINT8 data) -{ - arkanoid_bootleg_cmd = 0x00; - - switch (arkanoid_bootleg_id) - { - case ARKANGC: - case ARKBLOCK: - switch (data) - { - case 0x36: // unneeded value : no call 0x2050, unused A and overwritten HL (0x0313 -> 0x0340) - if (ZetGetPC(-1) == 0x7c47) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x38: // unneeded value : no call 0x2050, unused A and fixed HL (0x7bd5) - if (ZetGetPC(-1) == 0x7b87) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x8a: // unneeded value : no call 0x2050, unused A and overwritten HL (0x7b77 -> 0x7c1c) - if (ZetGetPC(-1) == 0x9661) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xe3: // unneeded value : call 0x2050 but fixed A (0x00) and fixed HL (0xed83) - if (ZetGetPC(-1) == 0x67e3) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xf7: // unneeded value : 3 * 'NOP' at 0x034f + 2 * 'NOP' at 0x35b - if (ZetGetPC(-1) == 0x0349) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xff: // unneeded value : no call 0x2050, unused A and overwritten HL (0x7c4f -> 0x7d31) - if (ZetGetPC(-1) == 0x9670) - arkanoid_bootleg_cmd = 0x00; - break; - default: - arkanoid_bootleg_cmd = 0x00; - break; - } - break; - - case ARKANGC2: - switch (data) - { - case 0x36: // unneeded value : call 0x2050 but fixed A (0x2d) - if (ZetGetPC(-1) == 0x7c4c) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x38: // unneeded value : call 0x2050 but fixed A (0xf3) - if (ZetGetPC(-1) == 0x7b87) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x88: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e3) - arkanoid_bootleg_cmd = 0x00; - if (ZetGetPC(-1) == 0x7c47) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x89: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e5) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x8a: // unneeded value : call 0x2050 but fixed A (0xa5) - if (ZetGetPC(-1) == 0x9661) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xc0: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e7) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xe3: // unneeded value : call 0x2050 but fixed A (0x61) - if (ZetGetPC(-1) == 0x67e9) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xff: // unneeded value : call 0x2050 but fixed A (0xe2) - if (ZetGetPC(-1) == 0x9670) - arkanoid_bootleg_cmd = 0x00; - break; - default: - arkanoid_bootleg_cmd = 0x00; - break; - } - break; - - case ARKBLOC2: - switch (data) - { - case 0x36: // unneeded value : call 0x2050 but fixed A (0x2d) - if (ZetGetPC(-1) == 0x7c4c) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x38: // unneeded value : call 0x2050 but fixed A (0xf3) - if (ZetGetPC(-1) == 0x7b87) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x88: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e3) - arkanoid_bootleg_cmd = 0x00; - if (ZetGetPC(-1) == 0x7c47) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x89: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e5) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x8a: // unneeded value : call 0x2050 but unused HL and fixed DE (0x7c1c) - if (ZetGetPC(-1) == 0x9661) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xc0: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e7) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xe3: // unneeded value : call 0x2050 but fixed A (0x61) - if (ZetGetPC(-1) == 0x67e9) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xf7: // unneeded value : call 0x2050 but never called (check code at 0x0340) - if (ZetGetPC(-1) == 0x0349) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xff: // unneeded value : no call 0x2050, unused A and fixed HL (0x7d31) - if (ZetGetPC(-1) == 0x9670) - arkanoid_bootleg_cmd = 0x00; - break; - default: - arkanoid_bootleg_cmd = 0x00; - break; - } - break; - - case ARKGCBL: - switch (data) - { - case 0x36: // unneeded value : call 0x2050 but fixed A (0x2d) - if (ZetGetPC(-1) == 0x7c4c) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x38: // unneeded value : call 0x2050 but fixed A (0xf3) - if (ZetGetPC(-1) == 0x7b87) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x88: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e3) - arkanoid_bootleg_cmd = 0x00; - if (ZetGetPC(-1) == 0x7c47) - arkanoid_bootleg_cmd = 0x00; - case 0x89: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e5) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x8a: // call 0x2050 with A read from 0xf002 and wrong HL - if (ZetGetPC(-1) == 0x9661) - arkanoid_bootleg_cmd = data; - break; - case 0xc0: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e7) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xe3: // unneeded value : call 0x2050 but fixed A (0x61) - if (ZetGetPC(-1) == 0x67e9) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xf7: // unneeded value : 3 * 'NOP' at 0x034f + 'JR NZ,$035D' at 0x35b - if (ZetGetPC(-1) == 0x0349) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xff: // call 0x2050 with A read from 0xf002 and wrong HL - if (ZetGetPC(-1) == 0x9670) - arkanoid_bootleg_cmd = data; - break; - default: - arkanoid_bootleg_cmd = 0x00; - break; - } - break; - - case PADDLE2: - switch (data) - { - case 0x24: // A read from 0xf002 (expected to be 0x9b) - if (ZetGetPC(-1) == 0xbd7a) - arkanoid_bootleg_cmd = data; - break; - case 0x36: // call 0x2050 with A read from 0xf002 and wrong HL - if (ZetGetPC(-1) == 0x7c4c) - arkanoid_bootleg_cmd = data; - break; - case 0x38: // call 0x2050 with A read from 0xf002 and wrong HL - if (ZetGetPC(-1) == 0x7b87) - arkanoid_bootleg_cmd = data; - break; - case 0x88: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e3) - arkanoid_bootleg_cmd = 0x00; - if (ZetGetPC(-1) == 0x7c47) - arkanoid_bootleg_cmd = 0x00; - case 0x89: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e5) - arkanoid_bootleg_cmd = 0x00; - break; - case 0x8a: // call 0x2050 with A read from 0xf002 and wrong HL - if (ZetGetPC(-1) == 0x9661) - arkanoid_bootleg_cmd = data; - break; - case 0xc0: // unneeded value : no read back - if (ZetGetPC(-1) == 0x67e7) - arkanoid_bootleg_cmd = 0x00; - break; - case 0xc3: // A read from 0xf002 (expected to be 0x1d) - if (ZetGetPC(-1) == 0xbd8a) - arkanoid_bootleg_cmd = data; - break; - case 0xe3: // call 0x2050 with A read from 0xf002 and wrong HL - if (ZetGetPC(-1) == 0x67e9) - arkanoid_bootleg_cmd = data; - break; - case 0xf7: // call 0x2050 with A read from 0xf002 and wrong HL - if (ZetGetPC(-1) == 0x0349) - arkanoid_bootleg_cmd = data; - break; - case 0xff: // call 0x2050 with A read from 0xf002 and wrong HL - if (ZetGetPC(-1) == 0x9670) - arkanoid_bootleg_cmd = data; - break; - default: - arkanoid_bootleg_cmd = 0x00; - break; - } - break; - - default: - break; - } -} - -static UINT8 arkanoid_bootleg_d008_read() -{ - switch (arkanoid_bootleg_id) - { - case ARKANGC: - case ARKBLOCK: - return 0x00; - - case ARKANGC2: - return 0x02; - - case ARKBLOC2: - return (DrvInputs[2] < 0x40) << 5; - - case ARKGCBL: - return ((DrvInputs[2] < 0x40) << 5) | 0x02; - - case PADDLE2: - return ((DrvInputs[2] < 0x40) << 5) | 0x0f; - - default: - return 0x00; - } - - return 0; -} - -UINT8 __fastcall arkanoid_read(UINT16 address) -{ - switch (address) - { - case 0xd001: - return AY8910Read(0); - - case 0xd008: - return arkanoid_bootleg_d008_read(); - - case 0xd00c: - { - INT32 ret = DrvInputs[0]; - if (use_mcu) { - ret &= 0x3f; - - if (!main_sent) ret |= 0x40; - if (!mcu_sent ) ret |= 0x80; - } - return ret; - } - - case 0xd010: - return DrvInputs[1]; - - case 0xd018: - if (use_mcu) { - return standard_taito_mcu_read(); - } else { - return DrvInputs[2]; - } - - case 0xf002: - return arkanoid_bootleg_f002_read(); - } - - if (address >= 0xf000) return DrvZ80ROM[address]; - - return 0; -} - -void __fastcall arkanoid_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xd000: - case 0xd001: - AY8910Write(0, address & 1, data); - break; - - case 0xd008: - { - *flipscreen = (data >> 0) & 3; - *gfxbank = (data >> 5) & 1; - *palettebank = (data >> 6) & 1; - *paddleselect= (data >> 2) & 1; - } - break; - - case 0xd010: // watchdog - break; - - case 0xd018: - if (use_mcu) { - from_main = data; - main_sent = 1; - } else { - arkanoid_bootleg_d018_write(data); - } - break; - } -} - -static void bankswitch(INT32 data) -{ - bankselect[0] = data; - - INT32 bank = 0x8000 + ((data & 0x10) >> 4) * 0x4000; - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM + bank); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM + bank); -} - -void __fastcall hexa_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xd000: - case 0xd001: - AY8910Write(0, address & 1, data); - return; - - case 0xd008: - *flipscreen = data & 0x03; // flipx & flipy - *gfxbank =(data & 0x20) >> 5; - bankswitch(data); - return; - } -} - -static void arkanoid_m68705_portC_write(UINT8 *data) -{ - if ((ddrC & 0x04) && (~*data & 0x04) && (portC_out & 0x04)) - { - main_sent = 0; - portA_in = from_main; - } - if ((ddrC & 0x08) && (~*data & 0x08) && (portC_out & 0x08)) - { - mcu_sent = 1; - from_mcu = portA_out; - } - - portC_out = *data; -} - -static void arkanoid_m68705_portB_read() -{ - ddrB = 0xff; - portB_out = (*paddleselect) ? DrvInputs[3] : DrvInputs[2]; -} - -static m68705_interface arkanoid_m68705_interface = { - NULL, - NULL, - arkanoid_m68705_portC_write, - NULL, - NULL, - NULL, - NULL, - arkanoid_m68705_portB_read, - standard_m68705_portC_in -}; - -static UINT8 ay8910_read_port_4(UINT32) -{ - INT32 ret = DrvDips[0]; - if (arkanoid_bootleg_id == TETRSARK) ret |= DrvInputs[1]; - - return ret; -} - -static UINT8 ay8910_read_port_5(UINT32) -{ - return DrvInputs[0]; -} - -static void DrvPaletteInit() -{ - INT32 len = BurnDrvGetPaletteEntries(); - - for (INT32 i = 0; i < len; i++) - { - INT32 bit0,bit1,bit2,bit3,r,g,b; - - bit0 = (DrvColPROM[i + len * 0] >> 0) & 0x01; - bit1 = (DrvColPROM[i + len * 0] >> 1) & 0x01; - bit2 = (DrvColPROM[i + len * 0] >> 2) & 0x01; - bit3 = (DrvColPROM[i + len * 0] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + len * 1] >> 0) & 0x01; - bit1 = (DrvColPROM[i + len * 1] >> 1) & 0x01; - bit2 = (DrvColPROM[i + len * 1] >> 2) & 0x01; - bit3 = (DrvColPROM[i + len * 1] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + len * 2] >> 0) & 0x01; - bit1 = (DrvColPROM[i + len * 2] >> 1) & 0x01; - bit2 = (DrvColPROM[i + len * 2] >> 2) & 0x01; - bit3 = (DrvColPROM[i + len * 2] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void DrvGfxDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - for (INT32 i = 0; i < 0x40000; i++) { - tmp[i] = ((DrvGfxROM[(i / 8) + 0x00000] >> (i & 7)) & 1) << 0; - tmp[i] |= ((DrvGfxROM[(i / 8) + 0x08000] >> (i & 7)) & 1) << 1; - tmp[i] |= ((DrvGfxROM[(i / 8) + 0x10000] >> (i & 7)) & 1) << 2; - } - - memcpy (DrvGfxROM, tmp, 0x40000); - BurnFree (tmp); -} - -static INT32 GetRoms() -{ - char* pRomName; - struct BurnRomInfo ri; - UINT8 *RomLoad = DrvZ80ROM; - UINT8 *GfxLoad = DrvGfxROM; - UINT8 *PrmLoad = DrvColPROM; - use_mcu = 0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & 7) == 1) { - if (BurnLoadRom(RomLoad, i, 1)) return 1; - RomLoad += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 2) { - if (BurnLoadRom(DrvMcuROM, i, 1)) return 1; - use_mcu = 1; - continue; - } - - if ((ri.nType & 7) == 3) { - if (BurnLoadRom(GfxLoad, i, 1)) return 1; - GfxLoad += ri.nLen; - continue; - } - - if ((ri.nType & 7) == 4) { - if (BurnLoadRom(PrmLoad, i, 1)) return 1; - PrmLoad += ri.nLen; - continue; - } - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - m67805_taito_reset(); - - AY8910Reset(0); - - nAnalogAxis[0] = 0; - nAnalogAxis[1] = 0; - arkanoid_bootleg_cmd = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - DrvMcuROM = Next; Next += 0x000800; - - DrvGfxROM = Next; Next += 0x040000; - - DrvColPROM = Next; Next += 0x000800; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x000800; - DrvMcuRAM = Next; Next += 0x000080; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - - flipscreen = Next; Next += 0x000001; - gfxbank = Next; Next += 0x000001; - palettebank = Next; Next += 0x000001; - paddleselect = Next; Next += 0x000001; - bankselect = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (GetRoms()) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM); - ZetMapArea(0xe000, 0xe7ff, 0, DrvVidRAM); - ZetMapArea(0xe000, 0xe7ff, 1, DrvVidRAM); - ZetMapArea(0xe000, 0xe7ff, 2, DrvVidRAM); - ZetMapArea(0xe800, 0xefff, 0, DrvSprRAM); - ZetMapArea(0xe800, 0xefff, 1, DrvSprRAM); - ZetMapArea(0xe800, 0xefff, 2, DrvSprRAM); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80ROM + 0xf000); - if (arkanoid_bootleg_id == HEXA) { - ZetSetWriteHandler(hexa_write); - } else { - ZetSetWriteHandler(arkanoid_write); - } - ZetSetReadHandler(arkanoid_read); - ZetClose(); - - m67805_taito_init(DrvMcuROM, DrvMcuRAM, &arkanoid_m68705_interface); - - AY8910Init(0, 1500000, nBurnSoundRate, &ay8910_read_port_5, &ay8910_read_port_4, NULL, NULL); - AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - if (arkanoid_bootleg_id == HEXA) { - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - } - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - m67805_taito_exit(); - - AY8910Exit(0); - - BurnFree (AllMem); - - arkanoid_bootleg_id = 0; - - return 0; -} - -static void draw_background_layer() -{ - for (INT32 offs = 0; offs < 32 * 30; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - if (*flipscreen) { - sx ^= 0xf8; - sy ^= 0xf8; - } - - sy -= 16; - - if (sy < 0 || sy >= nScreenHeight) continue; - - INT32 attr = DrvVidRAM[offs * 2 + 0]; - INT32 code = DrvVidRAM[offs * 2 + 1] | ((attr & 0x07) << 8) | (*gfxbank << 11); - INT32 color = ((attr & 0xf8) >> 3) | (*palettebank << 5); - - if (*flipscreen) { - Render8x8Tile_FlipY(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM); - } else { - Render8x8Tile_FlipX(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM); - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x40; offs+=4) - { - INT32 sx = DrvSprRAM[offs + 0]; - INT32 sy = 248 - DrvSprRAM[offs + 1]; - INT32 attr = DrvSprRAM[offs + 2]; - INT32 code = DrvSprRAM[offs + 3] | ((attr & 0x03) << 8) | (*gfxbank << 10); - INT32 color = ((attr & 0xf8) >> 3) | (*palettebank << 5); - - if (*flipscreen) { - sx = 248 - sx; - sy = 248 - sy; - - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code * 2 + 0, sx, sy - 8, color, 3, 0, 0, DrvGfxROM); - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code * 2 + 1, sx, sy - 16, color, 3, 0, 0, DrvGfxROM); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code * 2 + 0, sx, sy - 24, color, 3, 0, 0, DrvGfxROM); - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code * 2 + 1, sx, sy - 16, color, 3, 0, 0, DrvGfxROM); - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_background_layer(); - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 2); - - if (arkanoid_bootleg_id != HEXA) DrvInputs[0] = 0x4f; - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - nAnalogAxis[0] -= DrvAxis[0]; - DrvInputs[2] = (~nAnalogAxis[0] >> 8) & 0xfe; - - nAnalogAxis[1] -= DrvAxis[1]; - DrvInputs[3] = (~nAnalogAxis[1] >> 8) & 0xfe; - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 6000000 / 60, 3000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetOpen(0); - m6805Open(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nSegment); - - if (use_mcu) { - nSegment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += m6805Run(nSegment); - } - } - - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - - m6805Close(); - ZetClose(); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - if (use_mcu) { - m68705_taito_scan(nAction); - } - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(nAnalogAxis[0]); - SCAN_VAR(nAnalogAxis[1]); - SCAN_VAR(arkanoid_bootleg_cmd); - } - - return 0; -} - -static INT32 HexaScan(INT32 nAction, INT32 *pnMin) -{ - DrvScan(nAction, pnMin); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(*bankselect); - ZetClose(); - } - - return 0; -} - -/* rom numbering, with guesses: - A75 01 = Z80 code 1/2 v1.0 Japan - A75 01-1 = Z80 code 1/2 v1.1 Japan and USA/Romstar - A75 02 = Z80 code 2/2 v1.0 Japan - A75 03 = GFX 1/3 - A75 04 = GFX 2/3 - A75 05 = GFX 3/3 - A75 06 = MC68705P5 MCU code, v1.0 Japan and v1.0 USA/Romstar - A75 07 = PROM red - A75 08 = PROM green - A75 09 = PROM blue - A75 10 = Z80 code 2/2 v1.1 USA/Romstar - A75 11 = Z80 code 2/2 v1.2 Japan (paired with 01-1 v1.1 Japan) - (A75 12 through 17 are unknown, could be another two sets of z80 code plus mc68705p5) - A75 18 = Z80 code v2.0 2/2 USA/Romstar - A75 19 = Z80 code v2.0 1/2 USA/Romstar - A75 20 = MC68705P5 MCU code, v2.0 USA/Romstar - A75 21 = Z80 code v2.0 1/2 Japan - A75 22 = Z80 code v2.0 2/2 Japan - A75 23 = MC68705P5 MCU code, v2.0 Japan - A75 24 = Z80 code v2.1 1/2 Japan - A75 25 = Z80 code v2.1 2/2 Japan - A75 26 = MC68705P5 MCU code, v2.1 Japan - A75 27 = Z80 code 1/2 Tournament - A75 28 = Z80 code 2/2 Tournament - A75 29 = GFX 1/3 Tournament - A75 30 = GFX 2/3 Tournament - A75 31 = GFX 3/3 Tournament - A75 32 = MC68705P5 MCU code, Tournament - A75 33 = PROM red Tournament - A75 34 = PROM green Tournament - A75 35 = PROM blue Tournament - (one of the 21/22/23 or 24/25/26 sets is likely 'world'? or are these really two japan sets?) -*/ - -// Arkanoid (World, oldest rev) - -static struct BurnRomInfo arkanoidRomDesc[] = { - { "a75-01-1.ic17",0x8000, 0x5bcda3b0, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "a75-11.ic16", 0x8000, 0xeafd7191, 1 | BRF_ESS | BRF_PRG }, // 1 - - // if a75-06.ic14 0x515d77b6 gets replaced with 0x0be83647, the game will boot into a "BAD HARDWARE" message -dink aug29, 2016 - - { "a75-06__bootleg_68705.ic14", 0x0800, 0x515d77b6, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a75-03.ic64", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "a75-04.ic63", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "a75-05.ic62", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.ic24", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.ic23", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.ic22", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 - - { "arkanoid1_68705p3.ic14", 0x0800, 0x1b68e2d8, 0 | BRF_PRG | BRF_OPT }, // 9 Decapped roms - { "arkanoid_mcu.ic14", 0x0800, 0x4e44b50a, 0 | BRF_PRG | BRF_OPT }, // 10 - { "a75__06.ic14", 0x0800, 0x0be83647, 0 | BRF_PRG | BRF_OPT }, // 11 -}; - -STD_ROM_PICK(arkanoid) -STD_ROM_FN(arkanoid) - -struct BurnDriver BurnDrvarkanoid = { - "arkanoid", NULL, NULL, NULL, "1986", - "Arkanoid (World, oldest rev)\0", NULL, "Taito Corporation Japan", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkanoidRomInfo, arkanoidRomName, NULL, NULL, DrvInputInfo, arkanoidDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (US) - -static struct BurnRomInfo arkanoiduRomDesc[] = { - { "a75-19.ic17", 0x8000, 0xd3ad37d7, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "a75-18.ic16", 0x8000, 0xcdc08301, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75__20.ic14", 0x0800, 0x3994ee92, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a75-03.ic64", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "a75-04.ic63", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "a75-05.ic62", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.ic24", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.ic23", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.ic22", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(arkanoidu) -STD_ROM_FN(arkanoidu) - -struct BurnDriver BurnDrvarkanoidu = { - "arkanoidu", "arkanoid", NULL, NULL, "1986", - "Arkanoid (US)\0", NULL, "Taito America Corporation (Romstar license)", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkanoiduRomInfo, arkanoiduRomName, NULL, NULL, DrvInputInfo, arkanoidDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (US, oldest rev) -// Observed on a real TAITO J1100075A pcb (with K1100181A sticker), pcb is white painted, and has a "ROMSTAR(C) // All Rights Reserved // Serial No. // No 14128" sticker - -static struct BurnRomInfo arkanoiduoRomDesc[] = { - { "a75__01-1.ic17", 0x8000, 0x5bcda3b0, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "a75__10.ic16", 0x8000, 0xa1769e15, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75__06.ic14", 0x0800, 0x0be83647, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a75__03.ic64", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "a75__04.ic63", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "a75__05.ic62", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.ic24", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.ic23", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.ic22", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 - - { "a75__03(alternate).ic64", 0x8000, 0x983d4485, 0 | BRF_PRG | BRF_OPT }, // 10 -}; - -STD_ROM_PICK(arkanoiduo) -STD_ROM_FN(arkanoiduo) - -struct BurnDriver BurnDrvarkanoiduo = { - "arkanoiduo", "arkanoid", NULL, NULL, "1986", - "Arkanoid (US, oldest rev)\0", NULL, "Taito America Corporation (Romstar license)", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkanoiduoRomInfo, arkanoiduoRomName, NULL, NULL, DrvInputInfo, arkanoidDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Tournament Arkanoid (US) - -static struct BurnRomInfo arkatourRomDesc[] = { - { "a75-27.ic17", 0x8000, 0xe3b8faf5, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "a75-28.ic16", 0x8000, 0x326aca4d, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75__32.ic14", 0x0800, 0x8c20d15c, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a75-29.ic64", 0x8000, 0x5ddea3cf, 3 | BRF_GRA }, // 3 Graphics - { "a75-30.ic63", 0x8000, 0x5fcf2e85, 3 | BRF_GRA }, // 4 - { "a75-31.ic62", 0x8000, 0x7b76b192, 3 | BRF_GRA }, // 5 - - { "a75-33.ic24", 0x0200, 0xb4bf3c81, 4 | BRF_GRA }, // 6 Color Proms - { "a75-34.ic23", 0x0200, 0xde85a803, 4 | BRF_GRA }, // 7 - { "a75-35.ic22", 0x0200, 0x38acfd3b, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(arkatour) -STD_ROM_FN(arkatour) - -struct BurnDriver BurnDrvarkatour = { - "arkatour", NULL, NULL, NULL, "1987", - "Tournament Arkanoid (US)\0", NULL, "Taito America Corporation (Romstar license)", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkatourRomInfo, arkatourRomName, NULL, NULL, DrvInputInfo, arkanoidDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (Japan) - -static struct BurnRomInfo arkanoidjRomDesc[] = { - { "a75_24.ic17", 0x8000, 0x3f2b27e9, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "a75_25.ic16", 0x8000, 0xc13b2038, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75__26.ic14", 0x0800, 0x9c382c67, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a75-03.ic64", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "a75-04.ic63", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "a75-05.ic62", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.ic24", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.ic23", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.ic22", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(arkanoidj) -STD_ROM_FN(arkanoidj) - -struct BurnDriver BurnDrvarkanoidj = { - "arkanoidj", "arkanoid", NULL, NULL, "1986", - "Arkanoid (Japan)\0", NULL, "Taito Corporation", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkanoidjRomInfo, arkanoidjRomName, NULL, NULL, DrvInputInfo, arkanoidjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - -// Arkanoid (Japan, older rev) - -static struct BurnRomInfo arkanoidjaRomDesc[] = { - { "a75-21.ic17", 0x8000, 0xbf0455fc, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "a75-22.ic16", 0x8000, 0x3a2688d3, 1 | BRF_ESS | BRF_PRG }, // 1 - - // the handcrafted value at 0x351 (0x9ddb) seems incorrect compared to other sets? - //(but it appears the value is never used, and the data it would usually point to does not exist in the program rom?) - { "a75-23.ic14", 0x0800, 0x0a4abef6, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a75-03.ic64", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "a75-04.ic63", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "a75-05.ic62", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.ic24", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.ic23", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.ic22", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(arkanoidja) -STD_ROM_FN(arkanoidja) - -struct BurnDriver BurnDrvarkanoidja = { - "arkanoidja", "arkanoid", NULL, NULL, "1986", - "Arkanoid (Japan, older rev)\0", NULL, "Taito Corporation", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkanoidjaRomInfo, arkanoidjaRomName, NULL, NULL, DrvInputInfo, arkanoidjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (Japan, oldest rev) - -static struct BurnRomInfo arkanoidjbRomDesc[] = { - { "a75-01-1.ic17",0x8000, 0x5bcda3b0, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "a75-02.ic16", 0x8000, 0xbbc33ceb, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75__06.ic14", 0x0800, 0x0be83647, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a75-03.ic64", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "a75-04.ic63", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "a75-05.ic62", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.ic24", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.ic23", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.ic22", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(arkanoidjb) -STD_ROM_FN(arkanoidjb) - -struct BurnDriver BurnDrvarkanoidjb = { - "arkanoidjb", "arkanoid", NULL, NULL, "1986", - "Arkanoid (Japan, oldest rev)\0", NULL, "Taito Corporation", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkanoidjbRomInfo, arkanoidjbRomName, NULL, NULL, DrvInputInfo, arkanoidjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (bootleg with MCU set 1) - -static struct BurnRomInfo arkanoidjblRomDesc[] = { - { "e1.6d", 0x8000, 0xdd4f2b72, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "e2.6f", 0x8000, 0xbbc33ceb, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "68705p3.6i", 0x0800, 0x389a8cfb, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a75-03.rom", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "a75-04.rom", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "a75-05.rom", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 - - { "68705p3.6i", 0x0800, 0x389a8cfb, 0 | BRF_OPT | BRF_PRG }, // 9 Another MCU? -}; - -STD_ROM_PICK(arkanoidjbl) -STD_ROM_FN(arkanoidjbl) - -struct BurnDriver BurnDrvarkanoidjbl = { - "arkanoidjbl", "arkanoid", NULL, NULL, "1986", - "Arkanoid (bootleg with MCU set 1)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkanoidjblRomInfo, arkanoidjblRomName, NULL, NULL, DrvInputInfo, arkanoidjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (bootleg with MCU set 2) - -static struct BurnRomInfo arkanoidjbl2RomDesc[] = { - { "1.ic81", 0x8000, 0x9ff93dc2, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "2.ic82", 0x8000, 0xbbc33ceb, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75-06__bootleg_68705.ic14", 0x0800, 0x515d77b6, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a75-03.ic64", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "a75-04.ic63", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "a75-05.ic62", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.ic24", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.ic23", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.ic22", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(arkanoidjbl2) -STD_ROM_FN(arkanoidjbl2) - -struct BurnDriver BurnDrvarkanoidjbl2 = { - "arkanoidjbl2", "arkanoid", NULL, NULL, "1986", - "Arkanoid (bootleg with MCU set 2)\0", NULL, "bootleg (Beta)", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkanoidjbl2RomInfo, arkanoidjbl2RomName, NULL, NULL, DrvInputInfo, arkanoidjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (bootleg with MCU, alt) -// f205v id 318 - -static struct BurnRomInfo arkanoidjblaRomDesc[] = { - { "1.3f.ic81", 0x8000, 0x9ff93dc2, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "2.4f.ic82", 0x8000, 0xbbc33ceb, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75-06.ic14", 0x0800, 0x515d77b6, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "3.1c.ic33", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "4.3c.ic34", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "5.4c.ic35", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 - - { "68705p3.6i", 0x0800, 0x389a8cfb, 0 | BRF_OPT | BRF_PRG }, // 9 Another MCU? -}; - -STD_ROM_PICK(arkanoidjbla) -STD_ROM_FN(arkanoidjbla) - -struct BurnDriver BurnDrvarkanoidjbla = { - "arkanoidjbla", "arkanoid", NULL, NULL, "1986", - "Arkanoid (bootleg with MCU, alt)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkanoidjblaRomInfo, arkanoidjblaRomName, NULL, NULL, DrvInputInfo, arkanoidjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (bootleg with MCU, harder) - -static struct BurnRomInfo ark1ballRomDesc[] = { - { "a-1.7d", 0x8000, 0xdd4f2b72, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "2palline.7f", 0x8000, 0xed6b62ab, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75-06__bootleg_68705.ic14", 0x0800, 0x515d77b6, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "a-3.3a", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "a-4.3d", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "a-5.3f", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(ark1ball) -STD_ROM_FN(ark1ball) - -struct BurnDriver BurnDrvark1ball = { - "ark1ball", "arkanoid", NULL, NULL, "1986", - "Arkanoid (bootleg with MCU, harder)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, ark1ballRomInfo, ark1ballRomName, NULL, NULL, DrvInputInfo, ark1ballDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (bootleg with MCU, harder, alt) -// f205v id 196 - -static struct BurnRomInfo ark1ballaRomDesc[] = { - { "6c.bin", 0x8000, 0x9ff93dc2, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "6f.bin", 0x8000, 0xed6b62ab, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75-06.ic14", 0x0800, 0x515d77b6, 2 | BRF_ESS | BRF_PRG }, // 2 M68705 MCU - - { "3b.bin", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 3 Graphics - { "3c.bin", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 4 - { "3f.bin", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 5 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 6 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 7 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 8 -}; - -STD_ROM_PICK(ark1balla) -STD_ROM_FN(ark1balla) - -struct BurnDriver BurnDrvark1balla = { - "ark1balla", "arkanoid", NULL, NULL, "1986", - "Arkanoid (bootleg with MCU, harder, alt)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, ark1ballaRomInfo, ark1ballaRomName, NULL, NULL, DrvInputInfo, ark1ballDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (Game Corporation bootleg, set 1) - -static struct BurnRomInfo arkangcRomDesc[] = { - { "arkgc.1", 0x8000, 0xc54232e6, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "arkgc.2", 0x8000, 0x9f0d4754, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75-03.rom", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 2 Graphics - { "a75-04.rom", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 3 - { "a75-05.rom", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 4 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 5 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 6 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(arkangc) -STD_ROM_FN(arkangc) - -static INT32 arkangcInit() -{ - arkanoid_bootleg_id = ARKANGC; - - return DrvInit(); -} - -struct BurnDriver BurnDrvarkangc = { - "arkangc", "arkanoid", NULL, NULL, "1986", - "Arkanoid (Game Corporation bootleg, set 1)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkangcRomInfo, arkangcRomName, NULL, NULL, DrvInputInfo, arkangcDIPInfo, - arkangcInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (Game Corporation bootleg, set 2) - -static struct BurnRomInfo arkangc2RomDesc[] = { - { "1.81", 0x8000, 0xbd6eb996, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "2.82", 0x8000, 0x29dbe452, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75-03.rom", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 2 Graphics - { "a75-04.rom", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 3 - { "a75-05.rom", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 4 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 5 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 6 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(arkangc2) -STD_ROM_FN(arkangc2) - -static INT32 arkangc2Init() -{ - arkanoid_bootleg_id = ARKANGC2; - - return DrvInit(); -} - -struct BurnDriver BurnDrvarkangc2 = { - "arkangc2", "arkanoid", NULL, NULL, "1986", - "Arkanoid (Game Corporation bootleg, set 2)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkangc2RomInfo, arkangc2RomName, NULL, NULL, DrvInputInfo, arkangc2DIPInfo, - arkangc2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Block (Game Corporation bootleg, set 1) - -static struct BurnRomInfo arkblockRomDesc[] = { - { "ark-6.bin", 0x8000, 0x0be015de, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "arkgc.2", 0x8000, 0x9f0d4754, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75-03.rom", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 2 Graphics - { "a75-04.rom", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 3 - { "a75-05.rom", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 4 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 5 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 6 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(arkblock) -STD_ROM_FN(arkblock) - -static INT32 arkblockInit() -{ - arkanoid_bootleg_id = ARKBLOCK; - - return DrvInit(); -} - -struct BurnDriver BurnDrvarkblock = { - "arkblock", "arkanoid", NULL, NULL, "1986", - "Block (Game Corporation bootleg, set 1)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkblockRomInfo, arkblockRomName, NULL, NULL, DrvInputInfo, arkangcDIPInfo, - arkblockInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Block (Game Corporation bootleg, set 2) - -static struct BurnRomInfo arkbloc2RomDesc[] = { - { "block01.bin", 0x8000, 0x5be667e1, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "block02.bin", 0x8000, 0x4f883ef1, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75-03.rom", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 2 Graphics - { "a75-04.rom", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 3 - { "a75-05.rom", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 4 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 5 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 6 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(arkbloc2) -STD_ROM_FN(arkbloc2) - -static INT32 arkbloc2Init() -{ - arkanoid_bootleg_id = ARKBLOC2; - - return DrvInit(); -} - -struct BurnDriver BurnDrvarkbloc2 = { - "arkbloc2", "arkanoid", NULL, NULL, "1986", - "Block (Game Corporation bootleg, set 2)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkbloc2RomInfo, arkbloc2RomName, NULL, NULL, DrvInputInfo, arkangcDIPInfo, - arkbloc2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (bootleg on Block hardware) - -static struct BurnRomInfo arkgcblRomDesc[] = { - { "electric__16.6e", 0x8000, 0xb0f73900, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "electric__17.6f", 0x8000, 0x9827f297, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "electric__18.3a", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 2 Graphics - { "electric__19.3c", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 3 - { "electric__20.3d", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 4 - - { "82s129.5k", 0x0100, 0xfa70b64d, 4 | BRF_GRA }, // 5 Color Proms - { "82s129.5jk", 0x0100, 0xcca69884, 4 | BRF_GRA }, // 6 - { "82s129.5l", 0x0100, 0x3e4d2bf5, 4 | BRF_GRA }, // 7 - { "82s129.5kl", 0x0100, 0x085d625a, 4 | BRF_GRA }, // 8 - { "82s129.5mn", 0x0100, 0x0fe0b108, 4 | BRF_GRA }, // 9 - { "63s141.5m", 0x0100, 0x5553f675, 4 | BRF_GRA }, // 10 - - { "pal16r8.5f", 0x0104, 0x36471917, 0 | BRF_OPT | BRF_GRA }, // 11 PAL -}; - -STD_ROM_PICK(arkgcbl) -STD_ROM_FN(arkgcbl) - -static INT32 arkgcblInit() -{ - arkanoid_bootleg_id = ARKGCBL; - - return DrvInit(); -} - -struct BurnDriver BurnDrvarkgcbl = { - "arkgcbl", "arkanoid", NULL, NULL, "1986", - "Arkanoid (bootleg on Block hardware)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkgcblRomInfo, arkgcblRomName, NULL, NULL, DrvInputInfo, arkgcblDIPInfo, - arkgcblInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Paddle 2 (bootleg on Block hardware) - -static struct BurnRomInfo paddle2RomDesc[] = { - { "paddle2.16", 0x8000, 0xa286333c, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "paddle2.17", 0x8000, 0x04c2acb5, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "a75-03.rom", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 2 Graphics - { "a75-04.rom", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 3 - { "a75-05.rom", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 4 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 5 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 6 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(paddle2) -STD_ROM_FN(paddle2) - -static INT32 paddle2Init() -{ - arkanoid_bootleg_id = PADDLE2; - - return DrvInit(); -} - -struct BurnDriver BurnDrvpaddle2 = { - "paddle2", "arkanoid", NULL, NULL, "1986", - "Paddle 2 (bootleg on Block hardware)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, paddle2RomInfo, paddle2RomName, NULL, NULL, DrvInputInfo, paddle2DIPInfo, - paddle2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (Tayto bootleg) - -static struct BurnRomInfo arkataytRomDesc[] = { - { "ic81-v.3f", 0x8000, 0x154e2c6f, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ic82-w.5f", 0x8000, 0x4fa8cefa, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "1-ic33.2c", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 2 Graphics - { "2-ic34.3c", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 3 - { "3-ic35.5c", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 4 - - { "ic73.11e", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 5 Color Proms - { "ic74.12e", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 6 - { "ic75.13e", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(arkatayt) -STD_ROM_FN(arkatayt) - -struct BurnDriver BurnDrvarkatayt = { - "arkatayt", "arkanoid", NULL, NULL, "1986", - "Arkanoid (Tayto bootleg)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkataytRomInfo, arkataytRomName, NULL, NULL, DrvInputInfo, arkanoidjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid (Tayto bootleg, harder) - -static struct BurnRomInfo arktayt2RomDesc[] = { - { "ic81.3f", 0x8000, 0x6e0a2b6f, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ic82.5f", 0x8000, 0x5a97dd56, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "1-ic33.2c", 0x8000, 0x038b74ba, 3 | BRF_GRA }, // 2 Graphics - { "2-ic34.3c", 0x8000, 0x71fae199, 3 | BRF_GRA }, // 3 - { "3-ic35.5c", 0x8000, 0xc76374e2, 3 | BRF_GRA }, // 4 - - { "ic73.11e", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 5 Color Proms - { "ic74.12e", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 6 - { "ic75.13e", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(arktayt2) -STD_ROM_FN(arktayt2) - -struct BurnDriver BurnDrvarktayt2 = { - "arktayt2", "arkanoid", NULL, NULL, "1986", - "Arkanoid (Tayto bootleg, harder)\0", NULL, "bootleg", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arktayt2RomInfo, arktayt2RomName, NULL, NULL, DrvInputInfo, arktayt2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Tetris (D.R. Korea) - -static struct BurnRomInfo tetrsarkRomDesc[] = { - { "ic17.1", 0x8000, 0x1a505eda, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "ic16.2", 0x8000, 0x157bc4df, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "ic64.3", 0x8000, 0xc3e9b290, 3 | BRF_GRA }, // 2 Graphics - { "ic63.4", 0x8000, 0xde9a368f, 3 | BRF_GRA }, // 3 - { "ic62.5", 0x8000, 0xc8e80a00, 3 | BRF_GRA }, // 4 - - { "a75-07.bpr", 0x0200, 0x0af8b289, 4 | BRF_GRA }, // 5 Color Proms - { "a75-08.bpr", 0x0200, 0xabb002fb, 4 | BRF_GRA }, // 6 - { "a75-09.bpr", 0x0200, 0xa7c6c277, 4 | BRF_GRA }, // 7 - - { "14_mc68705p5_rom.bin", 0x0800, 0xdfbc4239, 0 | BRF_OPT }, // 8 MCU -}; - -STD_ROM_PICK(tetrsark) -STD_ROM_FN(tetrsark) - -static INT32 tetrsarkInit() -{ - arkanoid_bootleg_id = TETRSARK; - - INT32 nRet = DrvInit(); - - if (nRet == 0) { - for (INT32 i = 0; i < 0x8000; i++) { - DrvZ80ROM[i] ^= 0x94; - } - } - - return nRet; -} - -struct BurnDriver BurnDrvtetrsark = { - "tetrsark", NULL, NULL, NULL, "198?", - "Tetris (D.R. Korea)\0", "Wrong colors", "D.R. Korea", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, tetrsarkRomInfo, tetrsarkRomName, NULL, NULL, tetrsarkInputInfo, tetrsarkDIPInfo, - tetrsarkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Hexa - -static struct BurnRomInfo hexaRomDesc[] = { - { "hexa.20", 0x8000, 0x98b00586, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 Code - { "hexa.21", 0x8000, 0x3d5d006c, 1 | BRF_ESS | BRF_PRG }, // 1 - - { "hexa.17", 0x8000, 0xf6911dd6, 3 | BRF_GRA }, // 2 Graphics - { "hexa.18", 0x8000, 0x6e3d95d2, 3 | BRF_GRA }, // 3 - { "hexa.19", 0x8000, 0xffe97a31, 3 | BRF_GRA }, // 4 - - { "hexa.001", 0x0100, 0x88a055b4, 4 | BRF_GRA }, // 5 Color Proms - { "hexa.003", 0x0100, 0x3e9d4932, 4 | BRF_GRA }, // 6 - { "hexa.002", 0x0100, 0xff15366c, 4 | BRF_GRA }, // 7 -}; - -STD_ROM_PICK(hexa) -STD_ROM_FN(hexa) - -static INT32 HexaInit() -{ - arkanoid_bootleg_id = HEXA; - - return DrvInit(); -} - -struct BurnDriver BurnDrvHexa = { - "hexa", NULL, NULL, NULL, "199?", - "Hexa\0", NULL, "D. R. Korea", "Arkanoid", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, hexaRomInfo, hexaRomName, NULL, NULL, HexaInputInfo, HexaDIPInfo, - HexaInit, DrvExit, DrvFrame, DrvDraw, HexaScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; - diff --git a/jan/src/burn/drv/taito/d_ashnojoe.cpp b/jan/src/burn/drv/taito/d_ashnojoe.cpp deleted file mode 100644 index 0ac528957..000000000 --- a/jan/src/burn/drv/taito/d_ashnojoe.cpp +++ /dev/null @@ -1,722 +0,0 @@ -// FB Alpha Ashita No Joe / Success Joe driver module -// Based on MAME driver by driver by David Haywood and Pierpaolo Prazzoli - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "msm5205.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvZ80Banks; -static UINT8 *DrvPfRAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; - -static UINT32 *DrvPalette; - -static UINT8 *soundlatch; -static UINT8 *soundstatus; -static UINT8 *tilemap_reg; - -static UINT16 *scrollx; -static UINT16 *scrolly; - -static INT32 flipscreen; - -static UINT8 adpcm_byte = 0; -static UINT8 MSM5205_vclk_toggle = 0; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT16 DrvInputs[2]; - -static struct BurnInputInfo AshnojoeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 11, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 13, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 12, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 14, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 8, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Ashnojoe) - -static struct BurnDIPInfo AshnojoeDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x12, 0x01, 0x01, 0x00, "Upright" }, - {0x12, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x12, 0x01, 0x02, 0x00, "Off" }, - {0x12, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x04, 0x00, "Off" }, - {0x12, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x12, 0x01, 0x08, 0x08, "Off" }, - {0x12, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x12, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x03, 0x01, "Easy" }, - {0x13, 0x01, 0x03, 0x00, "Normal" }, - {0x13, 0x01, 0x03, 0x02, "Medium" }, - {0x13, 0x01, 0x03, 0x03, "Hard" }, - - {0 , 0xfe, 0 , 2, "Number of controller" }, - {0x13, 0x01, 0x04, 0x00, "2" }, - {0x13, 0x01, 0x04, 0x04, "1" }, -}; - -STDDIPINFO(Ashnojoe) - -void __fastcall ashnojoe_write_byte(UINT32 a, UINT8 d) -{ - bprintf (0, _T("%5.5x, %2.2x wb\n"), a, d); -} - -void __fastcall ashnojoe_write_word(UINT32 a, UINT16 d) -{ - switch (a) - { - case 0x4a006: - *tilemap_reg = d & 0xff; - return; - - case 0x4a008: - *soundlatch = d & 0xff; - *soundstatus = 1; - return; - - case 0x4a010: - case 0x4a012: - case 0x4a014: - case 0x4a016: - case 0x4a018: - scrollx[(a & 0x0f) / 2] = d; - return; - - case 0x4a020: - case 0x4a022: - case 0x4a024: - case 0x4a026: - case 0x4a028: - scrolly[(a & 0x0f) / 2] = d; - return; - } -} - -UINT8 __fastcall ashnojoe_read_byte(UINT32 a) -{ - bprintf (0, _T("%5.5x, rb\n"), a); - - return 0; -} - -UINT16 __fastcall ashnojoe_read_word(UINT32 a) -{ - switch (a) - { - case 0x4a000: - return DrvInputs[0]; - - case 0x4a002: - return DrvInputs[1]; - - case 0x4a004: - return ((DrvDips[1] << 8) | (DrvDips[0])); - - case 0x4a00a: - return 0; // debug? 1 kills sound - } - - return 0; -} - -void __fastcall ashnojoe_sound_write_port(UINT16 p, UINT8 d) -{ - switch (p & 0xff) - { - case 0x00: - BurnYM2203Write(0, 0, d); - return; - - case 0x01: - BurnYM2203Write(0, 1, d); - return; - - case 0x02: - adpcm_byte = d; - return; - } -} - -UINT8 __fastcall ashnojoe_sound_read_port(UINT16 p) -{ - switch (p & 0xff) - { - case 0x00: - return BurnYM2203Read(0, 0); - - case 0x01: - return BurnYM2203Read(0, 1); - - case 0x04: - *soundstatus = 0; - return *soundlatch; - - case 0x06: - return *soundstatus; - } - - return 0; -} - -void DrvYM2203WritePortA(UINT32, UINT32 d) -{ - MSM5205ResetWrite(0, !(d & 0x01)); -} - -void DrvYM2203WritePortB(UINT32, UINT32 d) -{ - if (ZetGetActive() == -1) return; // fix crash on init - - INT32 bank = (d & 0x0f) * 0x8000; - - ZetMapArea(0x8000, 0xffff, 0, DrvZ80Banks + bank); - ZetMapArea(0x8000, 0xffff, 2, DrvZ80Banks + bank); -} - -inline static void DrvIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - if (ZetGetActive() == -1) return 0; - - return (INT64)(double)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - if (ZetGetActive() == -1) return 0; - - return (double)ZetTotalCycles() / 4000000.0; -} - -static void ashnojoe_vclk_cb() -{ - if (MSM5205_vclk_toggle == 0) - { - MSM5205DataWrite(0, adpcm_byte >> 4); - } - else - { - MSM5205DataWrite(0, adpcm_byte & 0xf); - ZetNmi(); - } - - MSM5205_vclk_toggle ^= 1; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - - BurnYM2203Reset(); - MSM5205Reset(); - - ZetClose(); - - adpcm_byte = 0; - MSM5205_vclk_toggle = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x100000; - DrvZ80ROM = Next; Next += 0x010000; - DrvZ80Banks = Next; Next += 0x080000; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x040000; - DrvGfxROM2 = Next; Next += 0x040000; - DrvGfxROM3 = Next; Next += 0x200000; - DrvGfxROM4 = Next; Next += 0x600000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - AllRam = Next; - - DrvPfRAM = Next; Next += 0x009000; - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x001000; - - DrvZ80RAM = Next; Next += 0x002000; - - soundlatch = Next; Next += 0x000001; - soundstatus = Next; Next += 0x000001; - - tilemap_reg = Next; Next += 0x000001; - - scrollx = (UINT16*)Next; Next += 0x000008 * sizeof(UINT16); - scrolly = (UINT16*)Next; Next += 0x000008 * sizeof(UINT16); - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGfxExpand(UINT8 *gfx, INT32 len, INT32 bs) //0,1,2 -8x8, 3,4 16x16 -{ - if (bs) BurnByteswap(gfx, len); - - for (INT32 i = len-1; i >= 0; i--) { - gfx[i * 2 + 1] = gfx[i] & 0x0f; - gfx[i * 2 + 0] = gfx[i] >> 4; - } -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x080000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x010000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x000000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x010000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x000000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x010000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x000000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x080000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x000000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x080000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x100000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x180000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x200000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x280000, 17, 1)) return 1; - - if (BurnLoadRom(DrvZ80Banks + 0x000000, 18, 1)) return 1; - - DrvGfxExpand(DrvGfxROM0, 0x020000, 0); - DrvGfxExpand(DrvGfxROM1, 0x020000, 0); - DrvGfxExpand(DrvGfxROM2, 0x020000, 0); - DrvGfxExpand(DrvGfxROM3, 0x100000, 1); - DrvGfxExpand(DrvGfxROM4, 0x300000, 1); - } - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(DrvPfRAM, 0x040000, 0x048fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x049000, 0x049fff, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x04c000, 0x04ffff, MAP_RAM); - SekMapMemory(Drv68KROM + 0x080000, 0x080000, 0x0bffff, MAP_ROM); - SekSetWriteWordHandler(0, ashnojoe_write_word); - SekSetWriteByteHandler(0, ashnojoe_write_byte); - SekSetReadWordHandler(0, ashnojoe_read_word); - SekSetReadByteHandler(0, ashnojoe_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM); - ZetMapArea(0x6000, 0x7fff, 0, DrvZ80RAM); - ZetMapArea(0x6000, 0x7fff, 1, DrvZ80RAM); - ZetMapArea(0x6000, 0x7fff, 2, DrvZ80RAM); - ZetSetOutHandler(ashnojoe_sound_write_port); - ZetSetInHandler(ashnojoe_sound_read_port); - - MSM5205Init(0, DrvSynchroniseStream, 384000, ashnojoe_vclk_cb, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - BurnYM2203Init(1, 4000000, &DrvIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, NULL, NULL, &DrvYM2203WritePortA, &DrvYM2203WritePortB); - BurnTimerAttachZet(4000000); - BurnYM2203SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - - ZetClose(); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - SekExit(); - ZetExit(); - - BurnYM2203Exit(); - MSM5205Exit(); - - BurnFree(AllMem); - - return 0; -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - UINT16 *p = (UINT16*)DrvPalRAM; - - for (INT32 i = 0; i < 0x1000/2; i++) { - INT32 d = p[i]; - - r = (d >> 10) & 0x1f; - g = (d >> 5) & 0x1f; - b = (d >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_16x16_layer(UINT8 *ram, UINT8 *gfx, INT32 color_off, INT32 scroll_off, INT32 mask, INT32 transparent) -{ - INT32 xscroll = (scrollx[scroll_off] + 112) & 0x1ff; - INT32 yscroll = (scrolly[scroll_off] + 24) & 0x1ff; - - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 4; - INT32 sy = (offs >> 5) << 4; - - sx -= xscroll; - if (sx < -15) sx += 512; - sy -= yscroll; - if (sy < -15) sy += 512; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = vram[offs * 2 + 0] & mask; - INT32 color = ((vram[offs * 2 + 1] >> 8) & 0x1f) + color_off; - - if (flipscreen) { - if (transparent) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, 272 - sx, 192 - sy, color, 4, 15, 0, gfx); - } else { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, 272 - sx, 192 - sy, color, 4, 0, gfx); - } - } else { - if (transparent) { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, gfx); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, gfx); - } - } - } -} - -static void draw_8x8_layer(UINT8 *ram, UINT8 *gfx, INT32 color_off, INT32 scroll_off, INT32 high) -{ - INT32 xscroll = (scrollx[scroll_off] + 112) & 0x1ff; - INT32 yscroll = (scrolly[scroll_off] + 24) & (high ? 0x1ff : 0x0ff); - - UINT16 *vram = (UINT16*)ram; - - for (INT32 offs = 0; offs < 64 * (32 << high); offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - sx -= xscroll; - if (sx < -7) sx += 512; - sy -= yscroll; - if (sy < -7) sy += 256 << high; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 code = vram[offs] & 0x0fff; - INT32 color = (vram[offs] >> 12) + color_off; - - if (flipscreen) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, 280 - sx, 200 - sy, color, 4, 15, 0, gfx); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 15, 0, gfx); - } - } -} - -static INT32 DrvDraw() -{ - DrvRecalcPalette(); - - flipscreen = *tilemap_reg & 0x01; - - INT32 backlayer = (*tilemap_reg & 0x02) ? 0x7000 : 0x6000; - - if (nSpriteEnable & 0x01) draw_16x16_layer(DrvPfRAM + backlayer, DrvGfxROM3, 0x70, 4, 0x1fff, 0); - - if (nSpriteEnable & 0x02) draw_8x8_layer(DrvPfRAM + 0x2000, DrvGfxROM1, 0x60, 3, 1); - - if (nSpriteEnable & 0x04) draw_16x16_layer(DrvPfRAM + 0x5000, DrvGfxROM4, 0x40, 2, 0x7fff, 1); - - if (nSpriteEnable & 0x08) draw_16x16_layer(DrvPfRAM + 0x4000, DrvGfxROM4, 0x20, 1, 0x7fff, 1); - - if (nSpriteEnable & 0x10) draw_8x8_layer(DrvPfRAM + 0x0000, DrvGfxROM0, 0x10, 0, 1); - - if (nSpriteEnable & 0x20) draw_8x8_layer(DrvPfRAM + 0x8000, DrvGfxROM2, 0x00, 5, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0, 2 * sizeof(INT16)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - - } - - INT32 nInterleave = MSM5205CalcInterleave(0, 4000000); - INT32 nCyclesTotal[2] = { 8000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nNext[2] = { 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - nNext[0] += nCyclesTotal[0] / nInterleave; - - nCyclesDone[0] += SekRun(nNext[0] - nCyclesDone[0]); - if (i == (nInterleave - 1)) SekSetIRQLine(1, CPU_IRQSTATUS_AUTO); - - nNext[1] += nCyclesTotal[1] / nInterleave; - BurnTimerUpdate(nNext[1]); - MSM5205Update(); - nCyclesDone[1] += nNext[1]; - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2203Scan(nAction, pnMin); - MSM5205Scan(nAction, pnMin); - } - - return 0; -} - - -// Success Joe (World) - -static struct BurnRomInfo scessjoeRomDesc[] = { - { "5.4q", 0x10000, 0xc805f9e7, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "6.4s", 0x10000, 0xeda7a537, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sj201-nw.6m", 0x40000, 0x5a64ca42, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "9.8q", 0x08000, 0x8767e212, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "8.5e", 0x10000, 0x9bcb160e, 3 | BRF_GRA }, // 4 Character Tiles - { "7.5c", 0x10000, 0xb250c69d, 3 | BRF_GRA }, // 5 - - { "4.4e", 0x10000, 0xaa6336d3, 4 | BRF_GRA }, // 6 Character Tiles - { "3.4c", 0x10000, 0x7e2d86b5, 4 | BRF_GRA }, // 7 - - { "2.3m", 0x10000, 0xc3254938, 5 | BRF_GRA }, // 8 Character Tiles - { "1.1m", 0x10000, 0x5d16a6fa, 5 | BRF_GRA }, // 9 - - { "sj402-nw.8e", 0x80000, 0xb6d33d06, 6 | BRF_GRA }, // 10 Background Tiles - { "sj403-nw.7e", 0x80000, 0x07143f56, 6 | BRF_GRA }, // 11 - - { "sj404-nw.7a", 0x80000, 0x8f134128, 7 | BRF_GRA }, // 12 Foreground Tiles - { "sj405-nw.7c", 0x80000, 0x6fd81699, 7 | BRF_GRA }, // 13 - { "sj406-nw.7d", 0x80000, 0x634e33e6, 7 | BRF_GRA }, // 14 - { "sj407-nw.7f", 0x80000, 0x5c66ff06, 7 | BRF_GRA }, // 15 - { "sj408-nw.7g", 0x80000, 0x6a3b1ea1, 7 | BRF_GRA }, // 16 - { "sj409-nw.7j", 0x80000, 0xd8764213, 7 | BRF_GRA }, // 17 - - { "sj401-nw.10r", 0x80000, 0x25dfab59, 8 | BRF_PRG | BRF_ESS }, // 18 Z80 Banks -}; - -STD_ROM_PICK(scessjoe) -STD_ROM_FN(scessjoe) - -struct BurnDriver BurnDrvScessjoe = { - "scessjoe", NULL, NULL, NULL, "1990", - "Success Joe (World)\0", "Incomplete sound", "Taito Corporation / Wave", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, scessjoeRomInfo, scessjoeRomName, NULL, NULL, AshnojoeInputInfo, AshnojoeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x800, - 288, 208, 4, 3 -}; - - -// Ashita no Joe (Japan) - -static struct BurnRomInfo ashnojoeRomDesc[] = { - { "5.bin", 0x10000, 0xc61e1569, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code - { "6.bin", 0x10000, 0xc0a16338, 1 | BRF_PRG | BRF_ESS }, // 1 - { "sj201-nw.6m", 0x40000, 0x5a64ca42, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "9.8q", 0x08000, 0x8767e212, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 Code - - { "8.5e", 0x10000, 0x9bcb160e, 3 | BRF_GRA }, // 4 Character Tiles - { "7.bin", 0x10000, 0x7e1efc42, 3 | BRF_GRA }, // 5 - - { "4.4e", 0x10000, 0xaa6336d3, 4 | BRF_GRA }, // 6 Character Tiles - { "3.4c", 0x10000, 0x7e2d86b5, 4 | BRF_GRA }, // 7 - - { "2.3m", 0x10000, 0xc3254938, 5 | BRF_GRA }, // 8 Character Tiles - { "1.bin", 0x10000, 0x1bf585f0, 5 | BRF_GRA }, // 9 - - { "sj402-nw.8e", 0x80000, 0xb6d33d06, 6 | BRF_GRA }, // 10 Background Tiles - { "sj403-nw.7e", 0x80000, 0x07143f56, 6 | BRF_GRA }, // 11 - - { "sj404-nw.7a", 0x80000, 0x8f134128, 7 | BRF_GRA }, // 12 Foreground Tiles - { "sj405-nw.7c", 0x80000, 0x6fd81699, 7 | BRF_GRA }, // 13 - { "sj406-nw.7d", 0x80000, 0x634e33e6, 7 | BRF_GRA }, // 14 - { "sj407-nw.7f", 0x80000, 0x5c66ff06, 7 | BRF_GRA }, // 15 - { "sj408-nw.7g", 0x80000, 0x6a3b1ea1, 7 | BRF_GRA }, // 16 - { "sj409-nw.7j", 0x80000, 0xd8764213, 7 | BRF_GRA }, // 17 - - { "sj401-nw.10r", 0x80000, 0x25dfab59, 8 | BRF_PRG | BRF_ESS }, // 18 Z80 Banks -}; - -STD_ROM_PICK(ashnojoe) -STD_ROM_FN(ashnojoe) - -struct BurnDriver BurnDrvAshnojoe = { - "ashnojoe", "scessjoe", NULL, NULL, "1990", - "Ashita no Joe (Japan)\0", "Incomplete sound", "Taito Corporation / Wave", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, ashnojoeRomInfo, ashnojoeRomName, NULL, NULL, AshnojoeInputInfo, AshnojoeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x800, - 288, 208, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_asuka.cpp b/jan/src/burn/drv/taito/d_asuka.cpp deleted file mode 100644 index cb16040fa..000000000 --- a/jan/src/burn/drv/taito/d_asuka.cpp +++ /dev/null @@ -1,2415 +0,0 @@ -// FB Alpha Asuka & Asuka driver module -// Based on MAME driver by David Graves and Brian Troha - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "burn_ym2610.h" -#include "msm5205.h" -#include "taito_ic.h" -#include "taito.h" - -static UINT8 TaitoInputConfig; -static INT32 AsukaADPCMPos; -static INT32 AsukaADPCMData; - -static struct BurnInputInfo CadashInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort0 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort0 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort1 + 7, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort1 + 6, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Cadash) - -static struct BurnInputInfo AsukaInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset"}, - {"Service", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Asuka) - -static struct BurnInputInfo BonzeadvInputList[] = { - {"P1 Coin", BIT_DIGITAL, TaitoInputPort1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TaitoInputPort0 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TaitoInputPort2 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TaitoInputPort2 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TaitoInputPort2 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TaitoInputPort2 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TaitoInputPort2 + 6, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TaitoInputPort2 + 7, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, TaitoInputPort1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TaitoInputPort0 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TaitoInputPort3 + 1, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TaitoInputPort3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TaitoInputPort3 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TaitoInputPort3 + 4, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TaitoInputPort3 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TaitoInputPort3 + 6, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TaitoInputPort0 + 7, "service" }, - {"Tilt", BIT_DIGITAL, TaitoInputPort2 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TaitoDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TaitoDip + 1, "dip" }, -}; - -STDINPUTINFO(Bonzeadv) - -static struct BurnDIPInfo CadashDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Starting Time" }, - {0x14, 0x01, 0x0c, 0x00, "5:00" }, - {0x14, 0x01, 0x0c, 0x04, "6:00" }, - {0x14, 0x01, 0x0c, 0x0c, "7:00" }, - {0x14, 0x01, 0x0c, 0x08, "8:00" }, - - {0 , 0xfe, 0 , 4, "Add Time (after round clear)" }, - {0x14, 0x01, 0x30, 0x00, "Default - 2:00" }, - {0x14, 0x01, 0x30, 0x10, "Default - 1:00" }, - {0x14, 0x01, 0x30, 0x30, "Default" }, - {0x14, 0x01, 0x30, 0x20, "Default + 1:00" }, - - {0 , 0xfe, 0 , 3, "Communication Mode" }, - {0x14, 0x01, 0xc0, 0xc0, "Stand alone" }, - {0x14, 0x01, 0xc0, 0x80, "Master" }, - {0x14, 0x01, 0xc0, 0x00, "Slave" }, -}; - -STDDIPINFO(Cadash) - -static struct BurnDIPInfo CadashjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coins 2 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "2 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Starting Time" }, - {0x14, 0x01, 0x0c, 0x00, "5:00" }, - {0x14, 0x01, 0x0c, 0x04, "6:00" }, - {0x14, 0x01, 0x0c, 0x0c, "7:00" }, - {0x14, 0x01, 0x0c, 0x08, "8:00" }, - - {0 , 0xfe, 0 , 4, "Add Time (after round clear)" }, - {0x14, 0x01, 0x30, 0x00, "Default - 2:00" }, - {0x14, 0x01, 0x30, 0x10, "Default - 1:00" }, - {0x14, 0x01, 0x30, 0x30, "Default" }, - {0x14, 0x01, 0x30, 0x20, "Default + 1:00" }, - - {0 , 0xfe, 0 , 3, "Communication Mode" }, - {0x14, 0x01, 0xc0, 0xc0, "Stand alone" }, - {0x14, 0x01, 0xc0, 0x80, "Master" }, - {0x14, 0x01, 0xc0, 0x00, "Slave" }, -}; - -STDDIPINFO(Cadashj) - -static struct BurnDIPInfo CadashuDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Price to Continue" }, - {0x13, 0x01, 0xc0, 0xc0, "Same as Start" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Starting Time" }, - {0x14, 0x01, 0x0c, 0x00, "5:00" }, - {0x14, 0x01, 0x0c, 0x04, "6:00" }, - {0x14, 0x01, 0x0c, 0x0c, "7:00" }, - {0x14, 0x01, 0x0c, 0x08, "8:00" }, - - {0 , 0xfe, 0 , 4, "Add Time (after round clear)"}, - {0x14, 0x01, 0x30, 0x00, "Default - 2:00" }, - {0x14, 0x01, 0x30, 0x10, "Default - 1:00" }, - {0x14, 0x01, 0x30, 0x30, "Default" }, - {0x14, 0x01, 0x30, 0x20, "Default + 1:00" }, - - {0 , 0xfe, 0 , 3, "Communication Mode" }, - {0x14, 0x01, 0xc0, 0xc0, "Stand alone" }, - {0x14, 0x01, 0xc0, 0x80, "Master" }, - {0x14, 0x01, 0xc0, 0x00, "Slave" }, -}; - -STDDIPINFO(Cadashu) - - -static struct BurnDIPInfo EtoDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0x03, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Eto) - -static struct BurnDIPInfo AsukaDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Points" }, - {0x14, 0x01, 0x0c, 0x0c, "500" }, - {0x14, 0x01, 0x0c, 0x08, "1500" }, - {0x14, 0x01, 0x0c, 0x04, "2000" }, - {0x14, 0x01, 0x0c, 0x00, "2500" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x14, 0x01, 0xc0, 0x00, "No" }, - {0x14, 0x01, 0xc0, 0xc0, "Up To Level 2" }, - {0x14, 0x01, 0xc0, 0x80, "Up To Level 3" }, - {0x14, 0x01, 0xc0, 0x40, "Yes" }, -}; - -STDDIPINFO(Asuka) - -static struct BurnDIPInfo MofflottDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "20k And Every 50k" }, - {0x14, 0x01, 0x0c, 0x08, "50k And Every 100k" }, - {0x14, 0x01, 0x0c, 0x04, "100k Only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - {0x14, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Number Of Keys" }, - {0x14, 0x01, 0x80, 0x00, "B 14" }, - {0x14, 0x01, 0x80, 0x80, "A 16" }, -}; - -STDDIPINFO(Mofflott) - -static struct BurnDIPInfo GalmedesDIPList[]= -{ - {0x13, 0xff, 0xff, 0xf7, NULL }, - {0x14, 0xff, 0xff, 0xfb, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "Every 100k" }, - {0x14, 0x01, 0x0c, 0x0c, "100k And Every 200k" }, - {0x14, 0x01, 0x0c, 0x04, "150k And Every 200k" }, - {0x14, 0x01, 0x0c, 0x00, "Every 200k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x20, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x14, 0x01, 0x80, 0x80, "Mode A (Japan)" }, - {0x14, 0x01, 0x80, 0x00, "Mode B (World)" }, -}; - -STDDIPINFO(Galmedes) - -static struct BurnDIPInfo EarthjkrDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xf3, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "100k and 300k" }, - {0x14, 0x01, 0x0c, 0x08, "100k only" }, - {0x14, 0x01, 0x0c, 0x04, "200k only" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x00, "1" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x20, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - - {0 , 0xfe, 0 , 2, "Copyright" }, - {0x14, 0x01, 0x40, 0x40, "Visco" }, - {0x14, 0x01, 0x40, 0x00, "Visco (distributed by Romstar)" }, -}; - -STDDIPINFO(Earthjkr) - -static struct BurnDIPInfo BonzeadvDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xbc, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "40k 100k" }, - {0x14, 0x01, 0x0c, 0x0c, "50k 150k" }, - {0x14, 0x01, 0x0c, 0x04, "60k 200k" }, - {0x14, 0x01, 0x0c, 0x00, "80k 250k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - {0x14, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x40, "No" }, - {0x14, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Bonzeadv) - -static struct BurnDIPInfo JigkmgriDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xbc, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "40k 100k" }, - {0x14, 0x01, 0x0c, 0x0c, "50k 150k" }, - {0x14, 0x01, 0x0c, 0x04, "60k 200k" }, - {0x14, 0x01, 0x0c, 0x00, "80k 250k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - {0x14, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x40, "No" }, - {0x14, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Jigkmgri) - -//-------------------------------------------------------------------------------------------------------------------------- - -void __fastcall cadash_write_byte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x900000) - TC0100SCN0ByteWrite_Map(0xc00000, 0xc0ffff) -} - -void __fastcall cadash_write_word(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x900000) - TC0100SCN0WordWrite_Map(0xc00000, 0xc0ffff) - TC0100SCN0CtrlWordWrite_Map(0xc20000) - - switch (a) - { - case 0x080000: - case 0x080002: - PC090OJSpriteCtrl = (d & 0x3c) >> 2; - return; - - case 0xa00000: - case 0xa00002: - case 0xa00004: - TC0110PCRStep14rbgWordWrite(0, (a & 0x0f) / 2, d); - return; - - case 0x0c0000: - TC0140SYTPortWrite(d); - return; - - case 0x0c0002: - ZetClose(); - TC0140SYTCommWrite(d); - ZetOpen(0); - return; - } -} - -UINT8 __fastcall cadash_read_byte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x900000) - - return 0; -} - -UINT16 __fastcall cadash_read_word(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x900000) - if ((a & 0xffffff0) == 0xc20000) return TC0100SCNCtrl[0][(a & 0x0f)/2]; - - switch (a) - { - case 0xa00002: - return TC0110PCRWordRead(0); - - case 0x0c0002: - return TC0140SYTCommRead(); - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------------------- - -void __fastcall asuka_write_byte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x400000) - TC0100SCN0ByteWrite_Map(0xc00000, 0xc0ffff) - - switch (a) - { - case 0x3a0001: - PC090OJSpriteCtrl = ((d & 0x3c) >> 2) | ((d & 0x01) << 15); - return; - - case 0x3e0001: - TC0140SYTPortWrite(d); - return; - - case 0x3e0002: - case 0x3e0003: - ZetClose(); - TC0140SYTCommWrite(d); - ZetOpen(0); - return; - } -} - -void __fastcall asuka_write_word(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x400000) - TC0100SCN0WordWrite_Map(0xc00000, 0xc0ffff) - TC0100SCN0CtrlWordWrite_Map(0xc20000) - - switch (a) - { - case 0x3a0000: - PC090OJSpriteCtrl = ((d & 0x3c) >> 2) | ((d & 0x01) << 15); - return; - - case 0x200000: - case 0x200002: - case 0x200004: - TC0110PCRStep1WordWrite(0, (a & 0x0f) / 2, d); - return; - - case 0x3e0000: // galmedes - TC0140SYTPortWrite(d); - return; - - case 0x3e0002: - ZetClose(); - TC0140SYTCommWrite(d); - ZetOpen(0); - return; - } -} - -UINT8 __fastcall asuka_read_byte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x400000) - - switch (a) - { - case 0x3e0002: - case 0x3e0003: - return TC0140SYTCommRead(); - } - - return 0; -} - -UINT16 __fastcall asuka_read_word(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x400000) - if ((a & 0xffffff0) == 0xc20000) return TC0100SCNCtrl[0][(a & 0x0f)/2]; - - switch (a) - { - case 0x1076f0: - return 0; // maze of flott - - case 0x200002: - return TC0110PCRWordRead(0); - - case 0x3e0002: - return TC0140SYTCommRead(); - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------------------- - -void __fastcall eto_write_byte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0220IOCHalfWordWrite_Map(0x400000) - TC0100SCN0ByteWrite_Map(0xd00000, 0xd0ffff) - - if (a >= 0xc04000 && a <= 0xc0ffff) { - INT32 Offset = (a - 0xc00000) ^ 1; - if (TC0100SCNRam[0][Offset] != d) { - TC0100SCNBgLayerUpdate[0] = 1; - TC0100SCNFgLayerUpdate[0] = 1; - } - TC0100SCNRam[0][Offset] = d; - return; - } - - switch (a) - { - case 0x4a0000: - case 0x4a0001: - PC090OJSpriteCtrl = ((d & 0x3c) >> 2) | ((d & 0x01) << 15); - return; - } -} - -void __fastcall eto_write_word(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0220IOCHalfWordWrite_Map(0x400000) - TC0100SCN0WordWrite_Map(0xd00000, 0xd0ffff) - TC0100SCN0CtrlWordWrite_Map(0xd20000) - - if (a >= 0xc04000 && a <= 0xc0ffff) { - UINT16 *Ram = (UINT16*)TC0100SCNRam[0]; - INT32 Offset = (a - 0xc00000) >> 1; - if (Ram[Offset] != d) { - TC0100SCNBgLayerUpdate[0] = 1; - TC0100SCNFgLayerUpdate[0] = 1; - } - Ram[Offset] = d; - return; - } - - switch (a) - { - case 0x100000: - case 0x100002: - case 0x100004: - TC0110PCRStep1WordWrite(0, (a & 0x0f) / 2, d); - return; - - case 0x4e0000: - TC0140SYTPortWrite(d); - return; - - case 0x4e0002: - ZetClose(); - TC0140SYTCommWrite(d); - ZetOpen(0); - return; - } -} - -UINT8 __fastcall eto_read_byte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - TC0220IOCHalfWordRead_Map(0x400000) - - switch (a) - { - case 0x4e0002: - case 0x4e0003: - return TC0140SYTCommRead(); - } - - return 0; -} - -UINT16 __fastcall eto_read_word(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - TC0220IOCHalfWordRead_Map(0x400000) - if ((a & 0xffffff0) == 0xd20000) return TC0100SCNCtrl[0][(a & 0x0f)/2]; - - switch (a) - { - case 0x100002: - return TC0110PCRWordRead(0); - - case 0x4e0002: - return TC0140SYTCommRead(); - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------------------- - -void __fastcall bonze_write_byte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0xc00000, 0xc0ffff) - - switch (a) - { - case 0x3a0001: - PC090OJSpriteCtrl = (d & 0x3c) >> 2; - return; - - case 0x3e0001: - TC0140SYTPortWrite(d); - return; - - case 0x3e0003: - ZetClose(); - TC0140SYTCommWrite(d); - ZetOpen(0); - return; - - case 0x800803: // CChip Ctrl - return; - - case 0x800c01: - BonzeWriteCChipBank(d); - return; - } - - if ((a & 0xffff800) == 0x800000) { - BonzeWriteCChipRam(a, d); - return; - } -} - -void __fastcall bonze_write_word(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0xc00000, 0xc0ffff) - TC0100SCN0CtrlWordWrite_Map(0xc20000) - - switch (a) - { - case 0x200000: - case 0x200002: - case 0x200004: - TC0110PCRStep1WordWrite(0, (a & 0x0f) / 2, d); - return; - - case 0x3c0000: - TaitoWatchdog = 0; - return; - } - - if ((a & 0xffffc00) == 0xc10000) return; // nop -} - -UINT8 __fastcall bonze_read_byte(UINT32 a) -{ - switch (a) - { - case 0x3e0003: - return TC0140SYTCommRead(); - - case 0x800803: - return 1; // CChip Status - } - - if ((a & 0xfffff800) == 0x800000) { - return BonzeReadCChipRam(a); - } - - return 0; -} - -UINT16 __fastcall bonze_read_word(UINT32 a) -{ - if ((a & 0xffffff0) == 0xc20000) return TC0100SCNCtrl[0][(a & 0x0f)/2]; - - switch (a) - { - case 0x200002: - return TC0110PCRWordRead(0); - - case 0x390000: - return TaitoDip[0]; - - case 0x3b0000: - return TaitoDip[1]; - - case 0x3d0000: - return 0; // nop - } - - if ((a & 0xfffff800) == 0x800000) { - return BonzeReadCChipRam(a); - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------------------- - -void __fastcall cadash_sound_write(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0x9000: - BurnYM2151SelectRegister(d); - return; - - case 0x9001: - BurnYM2151WriteRegister(d); - return; - - case 0xa000: - TC0140SYTSlavePortWrite(d); - return; - - case 0xa001: - TC0140SYTSlaveCommWrite(d); - return; - - case 0xb000: { - if (TaitoNumMSM5205) AsukaADPCMPos = (AsukaADPCMPos & 0x00ff) | (d << 8); - return; - } - - case 0xc000: { - if (TaitoNumMSM5205) MSM5205ResetWrite(0, 0); - return; - } - - case 0xd000: { - if (TaitoNumMSM5205) { - MSM5205ResetWrite(0, 1); - AsukaADPCMPos &= 0xff00; - } - return; - } - } -} - -UINT8 __fastcall cadash_sound_read(UINT16 a) -{ - switch (a) - { - case 0x9000: - case 0x9001: - return BurnYM2151ReadStatus(); - - case 0xa001: - return TC0140SYTSlaveCommRead(); - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------------------- - -static void DrvSoundBankSwitch(UINT32, UINT32 bank) -{ - TaitoZ80Bank = bank & 0x03; - - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + TaitoZ80Bank * 0x4000); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + TaitoZ80Bank * 0x4000); -} - -void __fastcall bonze_sound_write(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - BurnYM2610Write(a & 3, d); - return; - - case 0xe200: - TC0140SYTSlavePortWrite(d); - return; - - case 0xe201: - TC0140SYTSlaveCommWrite(d); - return; - - case 0xf200: - DrvSoundBankSwitch(0, d); - return; - } -} - -UINT8 __fastcall bonze_sound_read(UINT16 a) -{ - switch (a) - { - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - return BurnYM2610Read(a & 3); - - case 0xe201: - return TC0140SYTSlaveCommRead(); - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------------------- - -static void DrvMakeInputs() -{ - memset (TC0220IOCInput, 0xff, sizeof ( TC0220IOCInput )); - - TC0220IOCInput[2] &= ~TaitoInputConfig; // asuka - - for (INT32 i = 0; i < 8; i++) { - TC0220IOCInput[0] ^= (TC0220IOCInputPort0[i] & 1) << i; - TC0220IOCInput[1] ^= (TC0220IOCInputPort1[i] & 1) << i; - TC0220IOCInput[2] ^= (TC0220IOCInputPort2[i] & 1) << i; - } -} - -static void CadashYM2151IRQHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(double)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -static void AsukaMSM5205Vck() -{ - if (AsukaADPCMData != -1) { - MSM5205DataWrite(0, AsukaADPCMData & 0x0f); - AsukaADPCMData = -1; - } else { - AsukaADPCMData = TaitoMSM5205Rom[AsukaADPCMPos]; - AsukaADPCMPos = (AsukaADPCMPos + 1) & 0xffff; - MSM5205DataWrite(0, AsukaADPCMData >> 4); - } -} - -static INT32 DrvDoReset() -{ - memset (TaitoRamStart, 0, TaitoRamEnd - TaitoRamStart); - -#if 0 - // This resets the YM2151 which calls DrvSoundBankSwitch via the port callback - TaitoDoReset(); -#else - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - if (TaitoNumYM2610) BurnYM2610Reset(); - if (TaitoNumMSM5205) MSM5205Reset(); - ZetOpen(0); - if (TaitoNumYM2151) BurnYM2151Reset(); - ZetClose(); -#endif - - ZetOpen(0); - DrvSoundBankSwitch(0, 1); - ZetClose(); - - BonzeCChipReset(); - - AsukaADPCMPos = 0; - AsukaADPCMData = -1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += 0x100000; - TaitoZ80Rom1 = Next; Next += 0x010000; - - TaitoChars = Next; Next += TaitoCharRomSize * 2; - TaitoSpritesA = Next; Next += TaitoSpriteARomSize * 2; - - TaitoMSM5205Rom = Next; Next += TaitoMSM5205RomSize; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x008000; - Taito68KRam2 = Next; Next += 0x001000; - - TaitoZ80Ram1 = Next; Next += 0x002000; - - TaitoRamEnd = Next; - TaitoMemEnd = Next; - - return 0; -} - -static void expand_graphics(UINT8 *src, INT32 len) -{ - for (INT32 i = (len * 2) - 2; i >= 0; i -= 2) { - src[i + 0] = src[(i / 2) ^ 1] >> 4; - src[i + 1] = src[(i / 2) ^ 1] & 0x0f; - } -} - -static void Cadash68KSetup() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x100000, 0x107fff, MAP_RAM); - SekMapMemory(Taito68KRam2, 0x800000, 0x800fff, MAP_RAM); // Network RAM - SekMapMemory(PC090OJRam, 0xb00000, 0xb03fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0], 0xc00000, 0xc0ffff, MAP_READ); - SekSetWriteByteHandler(0, cadash_write_byte); - SekSetWriteWordHandler(0, cadash_write_word); - SekSetReadByteHandler(0, cadash_read_byte); - SekSetReadWordHandler(0, cadash_read_word); - SekClose(); -} - -static void Eto68KSetup() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x40000, 0x080000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x200000, 0x203fff, MAP_RAM); - SekMapMemory(PC090OJRam, 0xc00000, 0xc03fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] + 0x4000, 0xc04000, 0xc0ffff, MAP_READ); // mirror - SekMapMemory(TC0100SCNRam[0], 0xd00000, 0xd0ffff, MAP_READ); - SekSetWriteByteHandler(0, eto_write_byte); - SekSetWriteWordHandler(0, eto_write_word); - SekSetReadByteHandler(0, eto_read_byte); - SekSetReadWordHandler(0, eto_read_word); - SekClose(); -} - -static void Asuka68KSetup() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x40000, 0x080000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0], 0xc00000, 0xc0ffff, MAP_READ); - SekMapMemory(PC090OJRam, 0xd00000, 0xd03fff, MAP_RAM); - SekSetWriteByteHandler(0, asuka_write_byte); - SekSetWriteWordHandler(0, asuka_write_word); - SekSetReadByteHandler(0, asuka_read_byte); - SekSetReadWordHandler(0, asuka_read_word); - SekClose(); -} - -static void Bonze68KSetup() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x40000, 0x080000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x10c000, 0x10ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0], 0xc00000, 0xc0ffff, MAP_READ); - SekMapMemory(PC090OJRam, 0xd00000, 0xd03fff, MAP_RAM); - SekSetWriteByteHandler(0, bonze_write_byte); - SekSetWriteWordHandler(0, bonze_write_word); - SekSetReadByteHandler(0, bonze_read_byte); - SekSetReadWordHandler(0, bonze_read_word); - SekClose(); -} - -static void CadashZ80Setup() -{ - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1); - ZetSetWriteHandler(cadash_sound_write); - ZetSetReadHandler(cadash_sound_read); - ZetClose(); -} - -static void BonzeZ80Setup() -{ - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1); - ZetSetWriteHandler(bonze_sound_write); - ZetSetReadHandler(bonze_sound_read); - ZetClose(); -} - -static void CadashSoundSetup() -{ - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&CadashYM2151IRQHandler); - BurnYM2151SetPortHandler(&DrvSoundBankSwitch); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - - TaitoNumYM2151 = 1; - TaitoNumYM2610 = 0; - TaitoNumMSM5205 = 0; -} - -static void AsukaSoundSetup() -{ - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&CadashYM2151IRQHandler); - BurnYM2151SetPortHandler(&DrvSoundBankSwitch); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, DrvSynchroniseStream, 384000, AsukaMSM5205Vck, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - TaitoNumYM2151 = 1; - TaitoNumMSM5205 = 1; - TaitoNumYM2610 = 0; -} - -static void BonzeSoundSetup() -{ - INT32 DrvSndROMLen = 0x80000; - BurnYM2610Init(8000000, TaitoYM2610ARom, &DrvSndROMLen, TaitoYM2610ARom, &DrvSndROMLen, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - TaitoNumYM2151 = 0; - TaitoNumYM2610 = 1; - TaitoNumMSM5205 = 0; -} - -static INT32 CommonInit(void (*Cpu68KSetup)(), void (*CpuZ80Setup)(), void (*SoundSetup)(), INT32 buffer_sprites) -{ - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoInputConfig = 0; - - TaitoLoadRoms(false); - - TaitoMem = NULL; - MemIndex(); - INT32 nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - TaitoLoadRoms(true); - - expand_graphics(TaitoChars, 0x80000); - expand_graphics(TaitoSpritesA, TaitoSpriteARomSize); - - GenericTilesInit(); - - PC090OJInit((TaitoSpriteARomSize * 2) / 0x100, 0, (256 - nScreenHeight) / 2, buffer_sprites); - TC0100SCNInit(0, (0x80000 * 2) / 0x40, 0, (256 - nScreenHeight) / 2, 0, NULL); - TC0110PCRInit(1, 0x1000); - TC0220IOCInit(); - TaitoMakeInputsFunction = DrvMakeInputs; - TC0140SYTInit(0); - - Cpu68KSetup(); - CpuZ80Setup(); - SoundSetup(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 1, TaitoChars); - if ((PC090OJSpriteCtrl & 0x8000)) PC090OJDrawSprites(TaitoSpritesA); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 1, TaitoChars); - if ((PC090OJSpriteCtrl & 0x8000)) PC090OJDrawSprites(TaitoSpritesA); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - if (!(PC090OJSpriteCtrl & 0x8000)) PC090OJDrawSprites(TaitoSpritesA); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - - BurnTransferCopy(TC0110PCRPalette); - - return 0; -} - -static INT32 CadashFrame() -{ - if (TaitoReset) { - DrvDoReset(); - } - - TaitoMakeInputsFunction(); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - INT32 nInterleave = 100; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 16000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nCycleSegment; - - nCycleSegment = (nCyclesTotal[0] / nInterleave) * (i+1); - if (i == (nInterleave - 1)) nCycleSegment -= 500; //? - nCyclesDone[0] += SekRun(nCycleSegment - SekTotalCycles()); - - nCycleSegment = (nCyclesTotal[1] / nInterleave) * (i+1); - nCyclesDone[1] += ZetRun(nCycleSegment - ZetTotalCycles()); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekRun(500); - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 EtoFrame() // Using for asuka too, but needs msm5205 -{ - if (TaitoReset) { - DrvDoReset(); - } - - TaitoMakeInputsFunction(); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - INT32 nInterleave = 100; - if (TaitoNumMSM5205) nInterleave = MSM5205CalcInterleave(0, 4000000); - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 8000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nCycleSegment; - - nCycleSegment = (nCyclesTotal[0] / nInterleave) * (i+1); - nCyclesDone[0] += SekRun(nCycleSegment - SekTotalCycles()); - - nCycleSegment = (nCyclesTotal[1] / nInterleave) * (i+1); - nCyclesDone[1] += ZetRun(nCycleSegment - ZetTotalCycles()); - if (TaitoNumMSM5205) MSM5205Update(); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - } - - if (TaitoNumMSM5205) MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 BonzeFrame() -{ - TaitoWatchdog++; - if (TaitoReset || TaitoWatchdog >= 180) { - DrvDoReset(); - } - - { - memset (TaitoInput, 0xff, 4); - TaitoInput[1] = 0; - - for (INT32 i = 0; i < 8; i++) { - TaitoInput[0] ^= (TaitoInputPort0[i] & 1) << i; - TaitoInput[1] ^= (TaitoInputPort1[i] & 1) << i; - TaitoInput[2] ^= (TaitoInputPort2[i] & 1) << i; - TaitoInput[3] ^= (TaitoInputPort3[i] & 1) << i; - } - } - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekRun(8000000 / 60); - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - BurnTimerEndFrame(4000000 / 60); - - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd - TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - TaitoICScan(nAction); - BonzeCChipScan(nAction); - - ZetOpen(0); // ZetOpen() here because it uses ZetMapArea() in the PortHandler of the YM - if (TaitoNumYM2151) BurnYM2151Scan(nAction); - if (TaitoNumYM2610) BurnYM2610Scan(nAction, pnMin); - if (TaitoNumMSM5205) MSM5205Scan(nAction, pnMin); - - SCAN_VAR(TaitoZ80Bank); - ZetClose(); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - DrvSoundBankSwitch(0, TaitoZ80Bank); - ZetClose(); - } - - return 0; -} - - -// Cadash (World) - -static struct BurnRomInfo cadashRomDesc[] = { - { "c21_14.ic11", 0x20000, 0x5daf13fb, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "c21_16.ic15", 0x20000, 0xcbaa2e75, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "c21_13.ic10", 0x20000, 0x6b9e0ee9, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "c21_17.ic14", 0x20000, 0xbf9a578a, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - - { "c21-08.38", 0x10000, 0xdca495a0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c21-02.9", 0x80000, 0x205883b9, BRF_GRA | TAITO_CHARS }, // 5 Characters - - { "c21-01.1", 0x80000, 0x1ff6f39c, BRF_GRA | TAITO_SPRITESA }, // 6 Sprites - - { "c21-07.57", 0x08000, 0xf02292bd, BRF_PRG | BRF_OPT }, // 7 HD64180RP8 code (link) - - { "pal16l8b-c21-09.ic34", 0x00104, 0x4b296700, BRF_OPT }, // 8 plds - { "pal16l8b-c21-10.ic45", 0x00104, 0x35642f00, BRF_OPT }, // 9 - { "pal16l8b-c21-11-1.ic46", 0x00104, 0xf4791e24, BRF_OPT }, // 10 - { "pal20l8b-c21-12.ic47", 0x00144, 0xbbc2cc97, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cadash) -STD_ROM_FN(cadash) - -static INT32 CadashInit() -{ - return CommonInit(Cadash68KSetup, CadashZ80Setup, CadashSoundSetup, 1); -} - -struct BurnDriver BurnDrvCadash = { - "cadash", NULL, NULL, NULL, "1989", - "Cadash (World)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, cadashRomInfo, cadashRomName, NULL, NULL, CadashInputInfo, CadashDIPInfo, - CadashInit, TaitoExit, CadashFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Cadash (Japan, version 2) - -static struct BurnRomInfo cadashjRomDesc[] = { - { "c21_04-2.ic11", 0x20000, 0x7a9c1828, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "c21_06-2.ic15", 0x20000, 0xc9d6440a, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "c21_03-2.ic10", 0x20000, 0x30afc320, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "c21_05-2.ic14", 0x20000, 0x2bc93209, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - - { "c21-08.38", 0x10000, 0xdca495a0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c21-02.9", 0x80000, 0x205883b9, BRF_GRA | TAITO_CHARS }, // 5 Characters - - { "c21-01.1", 0x80000, 0x1ff6f39c, BRF_GRA | TAITO_SPRITESA }, // 6 Sprites - - { "c21-07.57", 0x08000, 0xf02292bd, BRF_PRG | BRF_OPT }, // 7 HD64180RP8 code (link) - - { "pal16l8b-c21-09.ic34", 0x00104, 0x4b296700, BRF_OPT }, // 8 plds - { "pal16l8b-c21-10.ic45", 0x00104, 0x35642f00, BRF_OPT }, // 9 - { "pal16l8b-c21-11-1.ic46", 0x00104, 0xf4791e24, BRF_OPT }, // 10 - { "pal20l8b-c21-12.ic47", 0x00144, 0xbbc2cc97, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cadashj) -STD_ROM_FN(cadashj) - -struct BurnDriver BurnDrvCadashj = { - "cadashj", "cadash", NULL, NULL, "1989", - "Cadash (Japan, version 2)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, cadashjRomInfo, cadashjRomName, NULL, NULL, CadashInputInfo, CadashjDIPInfo, - CadashInit, TaitoExit, CadashFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Cadash (Japan, version 1) - -static struct BurnRomInfo cadashj1RomDesc[] = { - { "c21_04-1.ic11", 0x20000, 0xcc22ebe5, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "c21_06-1.ic15", 0x20000, 0x26e03304, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "c21_03-1.ic10", 0x20000, 0xc54888ed, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "c21_05-1.ic14", 0x20000, 0x834018d2, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - - { "c21-08.38", 0x10000, 0xdca495a0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c21-02.9", 0x80000, 0x205883b9, BRF_GRA | TAITO_CHARS }, // 5 Characters - - { "c21-01.1", 0x80000, 0x1ff6f39c, BRF_GRA | TAITO_SPRITESA }, // 6 Sprites - - { "c21-07.57", 0x08000, 0xf02292bd, BRF_PRG | BRF_OPT }, // 7 HD64180RP8 code (link) - - { "pal16l8b-c21-09.ic34", 0x00104, 0x4b296700, BRF_OPT }, // 8 plds - { "pal16l8b-c21-10.ic45", 0x00104, 0x35642f00, BRF_OPT }, // 9 - { "pal16l8b-c21-11-1.ic46", 0x00104, 0xf4791e24, BRF_OPT }, // 10 - { "pal20l8b-c21-12.ic47", 0x00144, 0xbbc2cc97, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cadashj1) -STD_ROM_FN(cadashj1) - -struct BurnDriver BurnDrvCadashj1 = { - "cadashj1", "cadash", NULL, NULL, "1989", - "Cadash (Japan, version 1)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, cadashj1RomInfo, cadashj1RomName, NULL, NULL, CadashInputInfo, CadashjDIPInfo, - CadashInit, TaitoExit, CadashFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Cadash (Japan, oldest version) - -static struct BurnRomInfo cadashjoRomDesc[] = { - { "c21_04.ic11", 0x20000, 0xbe7d3f12, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "c21_06.ic15", 0x20000, 0x1db3fe02, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "c21_03.ic10", 0x20000, 0x7e31c5a3, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "c21_05.ic14", 0x20000, 0xa4f4901d, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - - { "c21-08.38", 0x10000, 0xdca495a0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c21-02.9", 0x80000, 0x205883b9, BRF_GRA | TAITO_CHARS }, // 5 Characters - - { "c21-01.1", 0x80000, 0x1ff6f39c, BRF_GRA | TAITO_SPRITESA }, // 6 Sprites - - { "c21-07.57", 0x08000, 0xf02292bd, BRF_PRG | BRF_OPT }, // 7 HD64180RP8 code (link) - - { "pal16l8b-c21-09.ic34", 0x00104, 0x4b296700, BRF_OPT }, // 8 plds - { "pal16l8b-c21-10.ic45", 0x00104, 0x35642f00, BRF_OPT }, // 9 - { "pal16l8b-c21-11-1.ic46", 0x00104, 0xf4791e24, BRF_OPT }, // 10 - { "pal20l8b-c21-12.ic47", 0x00144, 0xbbc2cc97, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cadashjo) -STD_ROM_FN(cadashjo) - -struct BurnDriver BurnDrvCadashjo = { - "cadashjo", "cadash", NULL, NULL, "1989", - "Cadash (Japan, oldest version)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, cadashjoRomInfo, cadashjoRomName, NULL, NULL, CadashInputInfo, CadashjDIPInfo, - CadashInit, TaitoExit, CadashFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Cadash (US, version 2) - -static struct BurnRomInfo cadashuRomDesc[] = { - { "c21_14-2.ic11", 0x20000, 0xf823d418, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "c21_16-2.ic15", 0x20000, 0x90165577, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "c21_13-2.ic10", 0x20000, 0x92dcc3ae, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "c21_15-2.ic14", 0x20000, 0xf915d26a, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - - { "c21-08.38", 0x10000, 0xdca495a0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c21-02.9", 0x80000, 0x205883b9, BRF_GRA | TAITO_CHARS }, // 5 Characters - - { "c21-01.1", 0x80000, 0x1ff6f39c, BRF_GRA | TAITO_SPRITESA }, // 6 Sprites - - { "c21-07.57", 0x08000, 0xf02292bd, BRF_PRG | BRF_OPT }, // 7 HD64180RP8 code (link) - - { "pal16l8b-c21-09.ic34", 0x00104, 0x4b296700, BRF_OPT }, // 8 plds - { "pal16l8b-c21-10.ic45", 0x00104, 0x35642f00, BRF_OPT }, // 9 - { "pal16l8b-c21-11-1.ic46", 0x00104, 0xf4791e24, BRF_OPT }, // 10 - { "pal20l8b-c21-12.ic47", 0x00144, 0xbbc2cc97, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cadashu) -STD_ROM_FN(cadashu) - -struct BurnDriver BurnDrvCadashu = { - "cadashu", "cadash", NULL, NULL, "1989", - "Cadash (US, version 2)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, cadashuRomInfo, cadashuRomName, NULL, NULL, CadashInputInfo, CadashuDIPInfo, - CadashInit, TaitoExit, CadashFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Cadash (Italy) - -static struct BurnRomInfo cadashiRomDesc[] = { - { "c21_27-1.ic11", 0x20000, 0xd1d9e613, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "c21_29-1.ic15", 0x20000, 0x142256ef, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "c21_26-1.ic10", 0x20000, 0xc9cf6e30, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "c21_28-1.ic14", 0x20000, 0x641fc9dd, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - - { "c21-08.38", 0x10000, 0xdca495a0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c21-02.9", 0x80000, 0x205883b9, BRF_GRA | TAITO_CHARS }, // 5 Characters - - { "c21-01.1", 0x80000, 0x1ff6f39c, BRF_GRA | TAITO_SPRITESA }, // 6 Sprites - - { "c21-07.57", 0x08000, 0xf02292bd, BRF_PRG | BRF_OPT }, // 7 HD64180RP8 code (link) - - { "pal16l8b-c21-09.ic34", 0x00104, 0x4b296700, BRF_OPT }, // 8 plds - { "pal16l8b-c21-10.ic45", 0x00104, 0x35642f00, BRF_OPT }, // 9 - { "pal16l8b-c21-11-1.ic46", 0x00104, 0xf4791e24, BRF_OPT }, // 10 - { "pal20l8b-c21-12.ic47", 0x00144, 0xbbc2cc97, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cadashi) -STD_ROM_FN(cadashi) - -struct BurnDriver BurnDrvCadashi = { - "cadashi", "cadash", NULL, NULL, "1989", - "Cadash (Italy)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, cadashiRomInfo, cadashiRomName, NULL, NULL, CadashInputInfo, CadashDIPInfo, - CadashInit, TaitoExit, CadashFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Cadash (France) - -static struct BurnRomInfo cadashfRomDesc[] = { - { "c21_19.ic11", 0x20000, 0x4d70543b, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "c21_21.ic15", 0x20000, 0x0e5b9950, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "c21_18.ic10", 0x20000, 0x8a19e59b, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "c21_20.ic14", 0x20000, 0xb96acfd9, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - - { "c21-08.38", 0x10000, 0xdca495a0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c21-02.9", 0x80000, 0x205883b9, BRF_GRA | TAITO_CHARS }, // 5 Characters - - { "c21-01.1", 0x80000, 0x1ff6f39c, BRF_GRA | TAITO_SPRITESA }, // 6 Sprites - - { "c21-07.57", 0x08000, 0xf02292bd, BRF_PRG | BRF_OPT }, // 7 HD64180RP8 code (link) - - { "pal16l8b-c21-09.ic34", 0x00104, 0x4b296700, BRF_OPT }, // 8 plds - { "pal16l8b-c21-10.ic45", 0x00104, 0x35642f00, BRF_OPT }, // 9 - { "pal16l8b-c21-11-1.ic46", 0x00104, 0xf4791e24, BRF_OPT }, // 10 - { "pal20l8b-c21-12.ic47", 0x00144, 0xbbc2cc97, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cadashf) -STD_ROM_FN(cadashf) - -struct BurnDriver BurnDrvCadashf = { - "cadashf", "cadash", NULL, NULL, "1989", - "Cadash (France)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, cadashfRomInfo, cadashfRomName, NULL, NULL, CadashInputInfo, CadashDIPInfo, - CadashInit, TaitoExit, CadashFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Cadash (Germany, version 1) - -static struct BurnRomInfo cadashgRomDesc[] = { - { "c21_23-1.ic11", 0x20000, 0x30ddbabe, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "c21_25-1.ic15", 0x20000, 0x24e10611, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "c21_22-1.ic10", 0x20000, 0xdaf58b2d, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "c21_24-1.ic14", 0x20000, 0x2359b93e, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - - { "c21-08.38", 0x10000, 0xdca495a0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c21-02.9", 0x80000, 0x205883b9, BRF_GRA | TAITO_CHARS }, // 5 Characters - - { "c21-01.1", 0x80000, 0x1ff6f39c, BRF_GRA | TAITO_SPRITESA }, // 6 Sprites - - { "c21-07.57", 0x08000, 0xf02292bd, BRF_PRG | BRF_OPT }, // 7 HD64180RP8 code (link) - - { "pal16l8b-c21-09.ic34", 0x00104, 0x4b296700, BRF_OPT }, // 8 plds - { "pal16l8b-c21-10.ic45", 0x00104, 0x35642f00, BRF_OPT }, // 9 - { "pal16l8b-c21-11-1.ic46", 0x00104, 0xf4791e24, BRF_OPT }, // 10 - { "pal20l8b-c21-12.ic47", 0x00144, 0xbbc2cc97, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cadashg) -STD_ROM_FN(cadashg) - -struct BurnDriver BurnDrvCadashg = { - "cadashg", "cadash", NULL, NULL, "1989", - "Cadash (Germany, version 1)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, cadashgRomInfo, cadashgRomName, NULL, NULL, CadashInputInfo, CadashDIPInfo, - CadashInit, TaitoExit, CadashFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Cadash (World, prototype) - -static struct BurnRomInfo cadashpRomDesc[] = { - { "euro main h.ic11", 0x20000, 0x9dae00ca, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "euro main l.ic15", 0x20000, 0xba66b6a5, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "euro data h.bin", 0x20000, 0xbcce9d44, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "euro data l.bin", 0x20000, 0x21f5b591, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - - { "c21-08.38", 0x10000, 0xdca495a0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c21-02.9", 0x80000, 0x205883b9, BRF_GRA | TAITO_CHARS }, // 5 Characters - - { "c21-01.1", 0x80000, 0x1ff6f39c, BRF_GRA | TAITO_SPRITESA }, // 6 Sprites - - { "com.ic57", 0x08000, 0xbae1a92f, BRF_PRG | BRF_OPT }, // 7 HD64180RP8 code (link) - - { "pal16l8b-c21-09.ic34", 0x00104, 0x4b296700, BRF_OPT }, // 8 plds - { "pal16l8b-c21-10.ic45", 0x00104, 0x35642f00, BRF_OPT }, // 9 - { "pal16l8b-c21-11-1.ic46", 0x00104, 0xf4791e24, BRF_OPT }, // 10 - { "pal20l8b-c21-12.ic47", 0x00144, 0xbbc2cc97, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(cadashp) -STD_ROM_FN(cadashp) - -struct BurnDriver BurnDrvCadashp = { - "cadashp", "cadash", NULL, NULL, "1989", - "Cadash (World, prototype)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, cadashpRomInfo, cadashpRomName, NULL, NULL, CadashInputInfo, CadashjDIPInfo, - CadashInit, TaitoExit, CadashFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Kokontouzai Eto Monogatari (Japan) - -static struct BurnRomInfo etoRomDesc[] = { - { "eto-1.ic23", 0x20000, 0x44286597, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "eto-0.ic8", 0x20000, 0x57b79370, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "eto-2.ic30", 0x80000, 0x12f46fb5, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 2 - - { "eto-5.ic27", 0x10000, 0xb3689da0, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 3 Z80 Code - - { "eto-4.ic3", 0x80000, 0xa8768939, BRF_GRA | TAITO_CHARS }, // 4 Characters - - { "eto-3.ic6", 0x80000, 0xdd247397, BRF_GRA | TAITO_SPRITESA }, // 5 Sprites -}; - -STD_ROM_PICK(eto) -STD_ROM_FN(eto) - -static INT32 EtoInit() -{ - INT32 nRet = CommonInit(Eto68KSetup, CadashZ80Setup, CadashSoundSetup, 0); - - if (nRet == 0) { - BurnByteswap(Taito68KRom1 + 0x40000, 0x80000); - } - - return nRet; -} - -struct BurnDriver BurnDrvEto = { - "eto", NULL, NULL, NULL, "1994", - "Kokontouzai Eto Monogatari (Japan)\0", NULL, "Visco", "Taito Misc", - L"\u53E4\u4ECA\u6771\u897F\u5E72\u652F\u7269\u8A9E\0Kokontouzai Eto Monogatari (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, etoRomInfo, etoRomName, NULL, NULL, AsukaInputInfo, EtoDIPInfo, - EtoInit, TaitoExit, EtoFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 240, 4, 3 -}; - - -// Asuka & Asuka (World) - -static struct BurnRomInfo asukaRomDesc[] = { - { "b68-13.ic23", 0x20000, 0x855efb3e, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "b68-12.ic8", 0x20000, 0x271eeee9, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "b68-03.ic30", 0x80000, 0xd3a59b10, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 2 - - { "b68-11.ic27", 0x10000, 0xc378b508, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 3 Z80 Code - - { "b68-01.ic3", 0x80000, 0x89f32c94, BRF_GRA | TAITO_CHARS }, // 4 Characters - - { "b68-02.ic6", 0x80000, 0xf5018cd3, BRF_GRA | TAITO_SPRITESA }, // 5 Sprites - { "b68-07.ic5", 0x10000, 0xc113acc8, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 6 - { "b68-06.ic4", 0x10000, 0xf517e64d, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 7 - - { "b68-10.ic24", 0x10000, 0x387aaf40, BRF_SND | TAITO_MSM5205 }, // 8 MSM5205 Samples - - { "b68-04.ic32", 0x00144, 0x9be618d1, BRF_OPT }, // 8 plds - { "b68-05.ic43", 0x00104, 0xd6524ccc, BRF_OPT }, // 9 -}; - -STD_ROM_PICK(asuka) -STD_ROM_FN(asuka) - -static INT32 AsukaInit() -{ - INT32 nRet = CommonInit(Asuka68KSetup, CadashZ80Setup, AsukaSoundSetup, 0); - - if (nRet == 0) { - BurnByteswap(Taito68KRom1 + 0x40000, 0x80000); - } - - TaitoInputConfig = 0x30; - - return nRet; -} - -struct BurnDriver BurnDrvAsuka = { - "asuka", NULL, NULL, NULL, "1988", - "Asuka & Asuka (World)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, asukaRomInfo, asukaRomName, NULL, NULL, AsukaInputInfo, AsukaDIPInfo, - AsukaInit, TaitoExit, EtoFrame, DrvDraw, DrvScan, NULL, 0x1000, - 240, 320, 3, 4 -}; - - -// Asuka & Asuka (Japan) - -static struct BurnRomInfo asukajRomDesc[] = { - { "b68-09.ic23", 0x20000, 0x1eaa1bbb, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "b68-08.ic8", 0x20000, 0x8cc96e60, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "b68-03.ic30", 0x80000, 0xd3a59b10, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 2 - - { "b68-11.ic27", 0x10000, 0xc378b508, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 3 Z80 Code - - { "b68-01.ic3", 0x80000, 0x89f32c94, BRF_GRA | TAITO_CHARS }, // 4 Characters - - { "b68-02.ic6", 0x80000, 0xf5018cd3, BRF_GRA | TAITO_SPRITESA }, // 5 Sprites - { "b68-07.ic5", 0x10000, 0xc113acc8, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 6 - { "b68-06.ic4", 0x10000, 0xf517e64d, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 7 - - { "b68-10.ic24", 0x10000, 0x387aaf40, BRF_SND | TAITO_MSM5205 }, // 8 MSM5205 Samples - - { "b68-04.ic32", 0x00144, 0x9be618d1, BRF_OPT }, // 8 plds - { "b68-05.ic43", 0x00104, 0xd6524ccc, BRF_OPT }, -}; - -STD_ROM_PICK(asukaj) -STD_ROM_FN(asukaj) - -struct BurnDriver BurnDrvAsukaj = { - "asukaj", "asuka", NULL, NULL, "1988", - "Asuka & Asuka (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, asukajRomInfo, asukajRomName, NULL, NULL, AsukaInputInfo, AsukaDIPInfo, - AsukaInit, TaitoExit, EtoFrame, DrvDraw, DrvScan, NULL, 0x1000, - 240, 320, 3, 4 -}; - - -// Maze of Flott (Japan) - -static struct BurnRomInfo mofflottRomDesc[] = { - { "c17-09.bin", 0x20000, 0x05ee110f, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "c17-08.bin", 0x20000, 0xd0aacffd, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "c17-03.bin", 0x80000, 0x27047fc3, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 2 - - { "c17-07.bin", 0x10000, 0xcdb7bc2c, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 3 Z80 Code - - { "c17-01.bin", 0x80000, 0xe9466d42, BRF_GRA | TAITO_CHARS }, // 4 Characters - - { "c17-02.bin", 0x80000, 0x8860a8db, BRF_GRA | TAITO_SPRITESA }, // 5 Sprites - { "c17-05.bin", 0x10000, 0x57ac4741, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 6 - { "c17-04.bin", 0x10000, 0xf4250410, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 7 - - { "c17-06.bin", 0x10000, 0x5c332125, BRF_SND | TAITO_MSM5205 }, // 8 MSM5205 Samples -}; - -STD_ROM_PICK(mofflott) -STD_ROM_FN(mofflott) - -struct BurnDriver BurnDrvMofflott = { - "mofflott", NULL, NULL, NULL, "1989", - "Maze of Flott (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_MAZE, 0, - NULL, mofflottRomInfo, mofflottRomName, NULL, NULL, AsukaInputInfo, MofflottDIPInfo, - AsukaInit, TaitoExit, EtoFrame, DrvDraw, DrvScan, NULL, 0x1000, - 240, 320, 3, 4 -}; - - -// Galmedes (Japan) - -static struct BurnRomInfo galmedesRomDesc[] = { - { "gm-prg1.ic23", 0x20000, 0x32a70753, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "gm-prg0.ic8", 0x20000, 0xfae546a4, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "gm-30.ic30", 0x80000, 0x4da2a407, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 2 - - { "gm-snd.ic27", 0x10000, 0xd6f56c21, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 3 Z80 Code - - { "gm-scn.ic3", 0x80000, 0x3bab0581, BRF_GRA | TAITO_CHARS }, // 4 Characters - - { "gm-obj.ic6", 0x80000, 0x7a4a1315, BRF_GRA | TAITO_SPRITESA }, // 5 Sprites - - { "b68-04.ic32", 0x00144, 0x9be618d1, BRF_OPT }, // 6 plds - { "b68-05.ic43", 0x00104, 0xd6524ccc, BRF_OPT }, // 7 -}; - -STD_ROM_PICK(galmedes) -STD_ROM_FN(galmedes) - -static INT32 GalmedesInit() -{ - INT32 nRet = CommonInit(Asuka68KSetup, CadashZ80Setup, CadashSoundSetup, 0); - - if (nRet == 0) { - BurnByteswap(Taito68KRom1 + 0x40000, 0x80000); - } - - return nRet; -} - -struct BurnDriver BurnDrvGalmedes = { - "galmedes", NULL, NULL, NULL, "1992", - "Galmedes (Japan)\0", NULL, "Visco", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, galmedesRomInfo, galmedesRomName, NULL, NULL, AsukaInputInfo, GalmedesDIPInfo, - GalmedesInit, TaitoExit, EtoFrame, DrvDraw, DrvScan, NULL, 0x1000, - 240, 320, 3, 4 -}; - - -// U.N. Defense Force: Earth Joker (Japan) - -static struct BurnRomInfo earthjkrRomDesc[] = { - { "ej_3b.ic23", 0x20000, 0xbdd86fc2, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "ej_3a.ic8", 0x20000, 0x9c8050c6, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "ej_30e.ic30", 0x80000, 0x49d1f77f, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 2 - - { "ej_2.ic27", 0x10000, 0x42ba2566, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 3 Z80 Code - - { "ej_chr.ic3", 0x80000, 0xac675297, BRF_GRA | TAITO_CHARS }, // 4 Characters - - { "ej_obj.ic6", 0x80000, 0x5f21ac47, BRF_GRA | TAITO_SPRITESA }, // 5 Sprites - { "ej_1.ic5", 0x10000, 0xcb4891db, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 6 - { "ej_0.ic4", 0x10000, 0xb612086f, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 7 - - { "b68-04.ic32", 0x00144, 0x9be618d1, BRF_OPT }, // 8 plds - { "b68-05.ic43", 0x00104, 0xd6524ccc, BRF_OPT }, // 9 -}; - -STD_ROM_PICK(earthjkr) -STD_ROM_FN(earthjkr) - -struct BurnDriver BurnDrvEarthjkr = { - "earthjkr", NULL, NULL, NULL, "1993", - "U.N. Defense Force: Earth Joker (Japan)\0", NULL, "Visco", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, earthjkrRomInfo, earthjkrRomName, NULL, NULL, AsukaInputInfo, EarthjkrDIPInfo, - GalmedesInit, TaitoExit, EtoFrame, DrvDraw, DrvScan, NULL, 0x1000, - 240, 320, 3, 4 -}; - - -// U.N. Defense Force: Earth Joker (Japan, prototype?) -// was production PCB complete with MASK rom, could just be an early revision, not proto - -static struct BurnRomInfo earthjkrpRomDesc[] = { - { "4.ic8", 0x20000, 0xe9b1ef0c, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "3.ic23", 0x20000, 0x26c33225, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "5.ic30", 0x80000, 0xbf760b2d, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 2 - - { "ej_2.ic27", 0x10000, 0x42ba2566, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 3 Z80 Code - - { "ej_chr.ic3", 0x80000, 0xac675297, BRF_GRA | TAITO_CHARS }, // 4 Characters - - { "ej_obj.ic6", 0x80000, 0x5f21ac47, BRF_GRA | TAITO_SPRITESA }, // 5 Sprites - { "ej_1.ic5", 0x10000, 0xcb4891db, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 6 - { "ej_0.ic4", 0x10000, 0xb612086f, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 7 - - { "b68-04.ic32", 0x00144, 0x9be618d1, BRF_OPT }, // 8 plds - { "b68-05.ic43", 0x00104, 0xd6524ccc, BRF_OPT }, // 9 -}; - -STD_ROM_PICK(earthjkrp) -STD_ROM_FN(earthjkrp) - -struct BurnDriver BurnDrvEarthjkrp = { - "earthjkrp", "earthjkr", NULL, NULL, "1993", - "U.N. Defense Force: Earth Joker (Japan, prototype?)\0", NULL, "Visco", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, earthjkrpRomInfo, earthjkrpRomName, NULL, NULL, AsukaInputInfo, EarthjkrDIPInfo, - GalmedesInit, TaitoExit, EtoFrame, DrvDraw, DrvScan, NULL, 0x1000, - 240, 320, 3, 4 -}; - - -// Bonze Adventure (World, Newer) - -static struct BurnRomInfo bonzeadvRomDesc[] = { - { "b41-09-1.17", 0x10000, 0xaf821fbc, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "b41-11-1.26", 0x10000, 0x823fff00, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "b41-10.16", 0x10000, 0x4ca94d77, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "b41-15.25", 0x10000, 0xaed7a0d0, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - { "b41-01.15", 0x80000, 0x5d072fa4, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 4 - - { "b41-13.20", 0x10000, 0x9e464254, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 5 Z80 Code - - { "b41-03.1", 0x80000, 0x736d35d0, BRF_GRA | TAITO_CHARS }, // 6 Characters - - { "b41-02.7", 0x80000, 0x29f205d9, BRF_GRA | TAITO_SPRITESA }, // 7 Sprites - - { "b41-04.48", 0x80000, 0xc668638f, BRF_SND | TAITO_YM2610A }, // 8 YM2610 Samples -}; - -STD_ROM_PICK(bonzeadv) -STD_ROM_FN(bonzeadv) - -static INT32 BonzeInit() -{ - return CommonInit(Bonze68KSetup, BonzeZ80Setup, BonzeSoundSetup, 0); -} - -struct BurnDriver BurnDrvBonzeadv = { - "bonzeadv", NULL, NULL, NULL, "1988", - "Bonze Adventure (World, Newer)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bonzeadvRomInfo, bonzeadvRomName, NULL, NULL, BonzeadvInputInfo, BonzeadvDIPInfo, - BonzeInit, TaitoExit, BonzeFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Bonze Adventure (World, Older) - -static struct BurnRomInfo bonzeadvoRomDesc[] = { - { "b41-09.17", 0x10000, 0x06818710, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "b41-11.26", 0x10000, 0x33c4c2f4, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "b41-10.16", 0x10000, 0x4ca94d77, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "b41-15.25", 0x10000, 0xaed7a0d0, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - { "b41-01.15", 0x80000, 0x5d072fa4, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 4 - - { "b41-13.20", 0x10000, 0x9e464254, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 5 Z80 Code - - { "b41-03.1", 0x80000, 0x736d35d0, BRF_GRA | TAITO_CHARS }, // 6 Characters - - { "b41-02.7", 0x80000, 0x29f205d9, BRF_GRA | TAITO_SPRITESA }, // 7 Sprites - - { "b41-04.48", 0x80000, 0xc668638f, BRF_SND | TAITO_YM2610A }, // 8 YM2610 Samples -}; - -STD_ROM_PICK(bonzeadvo) -STD_ROM_FN(bonzeadvo) - -struct BurnDriver BurnDrvBonzeadvo = { - "bonzeadvo", "bonzeadv", NULL, NULL, "1988", - "Bonze Adventure (World, Older)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bonzeadvoRomInfo, bonzeadvoRomName, NULL, NULL, BonzeadvInputInfo, BonzeadvDIPInfo, - BonzeInit, TaitoExit, BonzeFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Bonze Adventure (US) - -static struct BurnRomInfo bonzeadvuRomDesc[] = { - { "b41-09-1.17", 0x10000, 0xaf821fbc, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "b41-11-1.26", 0x10000, 0x823fff00, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "b41-10.16", 0x10000, 0x4ca94d77, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "b41-14.25", 0x10000, 0x37def16a, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - { "b41-01.15", 0x80000, 0x5d072fa4, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 4 - - { "b41-13.20", 0x10000, 0x9e464254, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 5 Z80 Code - - { "b41-03.1", 0x80000, 0x736d35d0, BRF_GRA | TAITO_CHARS }, // 6 Characters - - { "b41-02.7", 0x80000, 0x29f205d9, BRF_GRA | TAITO_SPRITESA }, // 7 Sprites - - { "b41-04.48", 0x80000, 0xc668638f, BRF_SND | TAITO_YM2610A }, // 8 YM2610 Samples -}; - -STD_ROM_PICK(bonzeadvu) -STD_ROM_FN(bonzeadvu) - -struct BurnDriver BurnDrvBonzeadvu = { - "bonzeadvu", "bonzeadv", NULL, NULL, "1988", - "Bonze Adventure (US)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bonzeadvuRomInfo, bonzeadvuRomName, NULL, NULL, BonzeadvInputInfo, JigkmgriDIPInfo, - BonzeInit, TaitoExit, BonzeFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Bonze Adventure (World, prototype) - -static struct BurnRomInfo bonzeadvpRomDesc[] = { - { "0l.ic17", 0x10000, 0x9e046e6f, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "0h.ic26", 0x10000, 0x3e2b2628, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "1h.ic16", 0x10000, 0x52f31b98, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "1l.ic25", 0x10000, 0xc7e79b98, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - { "49eb.ic26", 0x20000, 0xc747650b, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 4 - { "fd65.ic20", 0x20000, 0xc32f3bd5, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 5 - { "0e7e.ic28", 0x20000, 0xdc1f9fd0, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 6 - { "a418.ic23", 0x20000, 0x51b02be6, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 7 - - { "b41-13.20", 0x10000, 0x9e464254, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 8 Z80 Code - - { "abbe.ic9", 0x20000, 0x50e6581c, BRF_GRA | TAITO_CHARS_BYTESWAP }, // 9 Characters - { "0ac8.ic15", 0x20000, 0x29002fc4, BRF_GRA | TAITO_CHARS_BYTESWAP }, // 10 - { "5ebf.ic5", 0x20000, 0xdac6f11f, BRF_GRA | TAITO_CHARS_BYTESWAP }, // 11 - { "77c8.ic12", 0x20000, 0xd8aaae12, BRF_GRA | TAITO_CHARS_BYTESWAP }, // 12 - - { "9369.ic19", 0x20000, 0xa9dd7f90, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 13 Sprites - { "e3ed.ic25", 0x20000, 0x7cc66ee2, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 14 - { "03eb.ic16", 0x20000, 0x39f32715, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 15 - { "b8e1.ic22", 0x20000, 0x15b836cf, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, // 16 - - { "6089.ic17", 0x20000, 0xb092783c, BRF_SND | TAITO_YM2610A }, // 17 YM2610 Samples - { "2e1f.ic14", 0x20000, 0xdf1f87c0, BRF_SND | TAITO_YM2610A }, // 18 - { "f66e.ic11", 0x20000, 0xc6df1b3e, BRF_SND | TAITO_YM2610A }, // 19 - { "49d7.ic7", 0x20000, 0x5584c02c, BRF_SND | TAITO_YM2610A }, // 20 -}; - -STD_ROM_PICK(bonzeadvp) -STD_ROM_FN(bonzeadvp) - -struct BurnDriver BurnDrvBonzeadvp = { - "bonzeadvp", "bonzeadv", NULL, NULL, "1988", - "Bonze Adventure (World, prototype)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bonzeadvpRomInfo, bonzeadvpRomName, NULL, NULL, BonzeadvInputInfo, JigkmgriDIPInfo, - BonzeInit, TaitoExit, BonzeFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Jigoku Meguri (Japan) - -static struct BurnRomInfo jigkmgriRomDesc[] = { - { "b41-09-1.17", 0x10000, 0xaf821fbc, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "b41-11-1.26", 0x10000, 0x823fff00, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "b41-10.16", 0x10000, 0x4ca94d77, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "b41-12.25", 0x10000, 0x40d9c1fc, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - { "b41-01.15", 0x80000, 0x5d072fa4, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 4 - - { "b41-13.20", 0x10000, 0x9e464254, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 5 Z80 Code - - { "b41-03.1", 0x80000, 0x736d35d0, BRF_GRA | TAITO_CHARS }, // 6 Characters - - { "b41-02.7", 0x80000, 0x29f205d9, BRF_GRA | TAITO_SPRITESA }, // 7 Sprites - - { "b41-04.48", 0x80000, 0xc668638f, BRF_SND | TAITO_YM2610A }, // 8 YM2610 Samples -}; - -STD_ROM_PICK(jigkmgri) -STD_ROM_FN(jigkmgri) - -struct BurnDriver BurnDrvJigkmgri = { - "jigkmgri", "bonzeadv", NULL, NULL, "1988", - "Jigoku Meguri (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - L"\u5730\u7344\u3081\u3050\u308A\0Jigoku Meguri (Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, jigkmgriRomInfo, jigkmgriRomName, NULL, NULL, BonzeadvInputInfo, JigkmgriDIPInfo, - BonzeInit, TaitoExit, BonzeFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Jigoku Meguri (Japan, hack?) -/* Copyright year has been removed */ - -static struct BurnRomInfo jigkmgriaRomDesc[] = { - { "blank_label.ic17", 0x10000, 0x5d3a5283, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 0 68K Code - { "bonzi__(ic26)__11a.ic26", 0x10000, 0xe1f2f205, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 1 - { "b41__10.ic16", 0x10000, 0x4ca94d77, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 2 - { "b41__12.ic25", 0x10000, 0x40d9c1fc, BRF_PRG | BRF_ESS | TAITO_68KROM1_BYTESWAP }, // 3 - { "b41-01.15", 0x80000, 0x5d072fa4, BRF_PRG | BRF_ESS | TAITO_68KROM1 }, // 4 - - { "b41__13.ic20", 0x10000, 0x9e464254, BRF_PRG | BRF_ESS | TAITO_Z80ROM1 }, // 5 Z80 Code - - { "b41-03.1", 0x80000, 0x736d35d0, BRF_GRA | TAITO_CHARS }, // 6 Characters - - { "b41-02.7", 0x80000, 0x29f205d9, BRF_GRA | TAITO_SPRITESA }, // 7 Sprites - - { "b41-04.48", 0x80000, 0xc668638f, BRF_SND | TAITO_YM2610A }, // 8 YM2610 Samples -}; - -STD_ROM_PICK(jigkmgria) -STD_ROM_FN(jigkmgria) - -struct BurnDriver BurnDrvJigkmgria = { - "jigkmgria", "bonzeadv", NULL, NULL, "19??", - "Jigoku Meguri (Japan, hack?)\0", NULL, "Taito Corporation", "Taito Misc", - L"\u5730\u7344\u3081\u3050\u308A\0Jigoku Meguri (Japan, hack?)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, jigkmgriaRomInfo, jigkmgriaRomName, NULL, NULL, BonzeadvInputInfo, JigkmgriDIPInfo, - BonzeInit, TaitoExit, BonzeFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_bublbobl.cpp b/jan/src/burn/drv/taito/d_bublbobl.cpp deleted file mode 100644 index 34eb3c0e2..000000000 --- a/jan/src/burn/drv/taito/d_bublbobl.cpp +++ /dev/null @@ -1,3116 +0,0 @@ -// Based on MAME driver by Chris Moore, Nicola Salmoria - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "m6800_intf.h" -#include "taito_m68705.h" -#include "burn_ym2203.h" -#include "burn_ym3526.h" -#include "bitswap.h" - -static UINT8 DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvDip[2] = {0, 0}; -static UINT8 DrvInput[3] = {0x00, 0x00, 0x00}; -static UINT8 DrvReset = 0; - -static UINT8 *Mem = NULL; -static UINT8 *MemEnd = NULL; -static UINT8 *RamStart = NULL; -static UINT8 *RamEnd = NULL; -static UINT8 *DrvZ80Rom1 = NULL; -static UINT8 *DrvZ80Rom2 = NULL; -static UINT8 *DrvZ80Rom3 = NULL; -static UINT8 *DrvMcuRom = NULL; -static UINT8 *DrvProm = NULL; -static UINT8 *DrvZ80Ram1 = NULL; -static UINT8 *DrvZ80Ram3 = NULL; -static UINT8 *DrvSharedRam = NULL; -static UINT8 *DrvMcuRam = NULL; -static UINT8 *DrvVideoRam = NULL; -static UINT8 *DrvSpriteRam = NULL; -static UINT8 *DrvPaletteRam = NULL; -static UINT8 *DrvTiles = NULL; -static UINT8 *DrvTempRom = NULL; -static UINT32 *DrvPalette = NULL; - -static UINT8 DrvRomBank; -static UINT8 DrvSlaveCPUActive; -static UINT8 DrvSoundCPUActive; -static UINT8 DrvMCUActive; -static UINT8 DrvVideoEnable; -static UINT8 DrvFlipScreen; -static INT32 IC43A; -static INT32 IC43B; -static INT32 DrvSoundStatus; -static INT32 DrvSoundNmiEnable; -static INT32 DrvSoundNmiPending; -static INT32 DrvSoundLatch; - -static INT32 nCyclesDone[4], nCyclesTotal[4]; -static INT32 nCyclesSegment; - -typedef INT32 (*BublboblCallbackFunc)(); -static BublboblCallbackFunc BublboblCallbackFunction; - -static UINT8 DrvMCUInUse; - -static INT32 bublbobl2 = 0; - -static INT32 mcu_address, mcu_latch; -static UINT8 ddr1, ddr2, ddr3, ddr4; -static UINT8 port1_in, port2_in, port3_in, port4_in; -static UINT8 port1_out, port2_out, port3_out, port4_out; - -static struct BurnInputInfo BublboblInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort1 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort2 + 6, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 5, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 4, "p1 fire 2" }, - - {"P2 Left" , BIT_DIGITAL , DrvInputPort2 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort2 + 5, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort2 + 4, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort0 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , DrvInputPort0 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Bublbobl) - -static struct BurnInputInfo BoblboblInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , DrvInputPort0 + 2, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 2" }, - - {"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, - {"Service" , BIT_DIGITAL , DrvInputPort1 + 3, "service" }, - {"Tilt" , BIT_DIGITAL , DrvInputPort1 + 2, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" }, -}; - -STDINPUTINFO(Boblbobl) - -static inline void BublboblMakeInputs() -{ - DrvInput[0] = 0xf3; - if (DrvInputPort0[0]) DrvInput[0] ^= 0x01; - if (DrvInputPort0[1]) DrvInput[0] ^= 0x02; - if (DrvInputPort0[2]) DrvInput[0] ^= 0x04; - if (DrvInputPort0[3]) DrvInput[0] ^= 0x08; - if (DrvInputPort0[4]) DrvInput[0] ^= 0x10; - if (DrvInputPort0[5]) DrvInput[0] ^= 0x20; - if (DrvInputPort0[6]) DrvInput[0] ^= 0x40; - if (DrvInputPort0[7]) DrvInput[0] ^= 0x80; - - if (bublbobl2) { - DrvInput[0] ^= 0x8c; - // Swap coins - DrvInput[0] = (DrvInput[0] & 0xf3) | ((DrvInput[0] & 0x04) << 1) | ((DrvInput[0] & 0x08) >> 1); - } - - DrvInput[1] = 0xff; - DrvInput[2] = 0xff; - for (INT32 i = 0; i < 8; i++) { - DrvInput[1] -= (DrvInputPort1[i] & 1) << i; - DrvInput[2] -= (DrvInputPort2[i] & 1) << i; - } -} - -static struct BurnDIPInfo BublboblDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xfe, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Mode" }, - {0x0f, 0x01, 0x05, 0x04, "Game, English" }, - {0x0f, 0x01, 0x05, 0x05, "Game, Japanese" }, - {0x0f, 0x01, 0x05, 0x01, "Test (Grid and Inputs)" }, - {0x0f, 0x01, 0x05, 0x00, "Test (RAM and Sound)/Pause"}, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0f, 0x01, 0x30, 0x10, "2 Coins 1 Play" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 1 Play" }, - {0x0f, 0x01, 0x30, 0x00, "2 Coins 3 Plays" }, - {0x0f, 0x01, 0x30, 0x20, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 1 Play" }, - {0x0f, 0x01, 0xc0, 0x00, "2 Coins 3 Plays" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0x03, 0x02, "Easy" }, - {0x10, 0x01, 0x03, 0x03, "Normal" }, - {0x10, 0x01, 0x03, 0x01, "Hard" }, - {0x10, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x10, 0x01, 0x0c, 0x08, "20k 80k 300k" }, - {0x10, 0x01, 0x0c, 0x0c, "30k 100k 400k" }, - {0x10, 0x01, 0x0c, 0x04, "40k 200k 500k" }, - {0x10, 0x01, 0x0c, 0x00, "50k 250k 500k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x30, 0x10, "1" }, - {0x10, 0x01, 0x30, 0x00, "2" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2 , "ROM Type" }, - {0x10, 0x01, 0x80, 0x80, "IC52=512kb, IC53=none" }, - {0x10, 0x01, 0x80, 0x00, "IC52=256kb, IC53=256kb" }, -}; - -STDDIPINFO(Bublbobl) - -static struct BurnDIPInfo BoblboblDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xfe, NULL }, - {0x10, 0xff, 0xff, 0x3f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Mode" }, - {0x0f, 0x01, 0x05, 0x04, "Game, English" }, - {0x0f, 0x01, 0x05, 0x05, "Game, Japanese" }, - {0x0f, 0x01, 0x05, 0x01, "Test (Grid and Inputs)" }, - {0x0f, 0x01, 0x05, 0x00, "Test (RAM and Sound)" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0f, 0x01, 0x30, 0x10, "2 Coins 1 Play" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 1 Play" }, - {0x0f, 0x01, 0x30, 0x00, "2 Coins 3 Plays" }, - {0x0f, 0x01, 0x30, 0x20, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 1 Play" }, - {0x0f, 0x01, 0xc0, 0x00, "2 Coins 3 Plays" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0x03, 0x02, "Easy" }, - {0x10, 0x01, 0x03, 0x03, "Normal" }, - {0x10, 0x01, 0x03, 0x01, "Hard" }, - {0x10, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x10, 0x01, 0x0c, 0x08, "20k 80k 300k" }, - {0x10, 0x01, 0x0c, 0x0c, "30k 100k 400k" }, - {0x10, 0x01, 0x0c, 0x04, "40k 200k 500k" }, - {0x10, 0x01, 0x0c, 0x00, "50k 250k 500k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x30, 0x10, "1" }, - {0x10, 0x01, 0x30, 0x00, "2" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 4 , "Monster Speed" }, - {0x10, 0x01, 0xc0, 0x00, "Normal" }, - {0x10, 0x01, 0xc0, 0x40, "Medium" }, - {0x10, 0x01, 0xc0, 0x80, "High" }, - {0x10, 0x01, 0xc0, 0xc0, "Very High" }, -}; - -STDDIPINFO(Boblbobl) - -static struct BurnDIPInfo SboblbobDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xfe, NULL }, - {0x10, 0xff, 0xff, 0x3f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Game" }, - {0x0f, 0x01, 0x01, 0x01, "Bobble Bobble" }, - {0x0f, 0x01, 0x01, 0x00, "Super Bobble Bobble" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0f, 0x01, 0x30, 0x10, "2 Coins 1 Play" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 1 Play" }, - {0x0f, 0x01, 0x30, 0x00, "2 Coins 3 Plays" }, - {0x0f, 0x01, 0x30, 0x20, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 1 Play" }, - {0x0f, 0x01, 0xc0, 0x00, "2 Coins 3 Plays" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0x03, 0x02, "Easy" }, - {0x10, 0x01, 0x03, 0x03, "Normal" }, - {0x10, 0x01, 0x03, 0x01, "Hard" }, - {0x10, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x10, 0x01, 0x0c, 0x08, "20k 80k 300k" }, - {0x10, 0x01, 0x0c, 0x0c, "30k 100k 400k" }, - {0x10, 0x01, 0x0c, 0x04, "40k 200k 500k" }, - {0x10, 0x01, 0x0c, 0x00, "50k 250k 500k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x30, 0x10, "1" }, - {0x10, 0x01, 0x30, 0x00, "2" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 4 , "Monster Speed" }, - {0x10, 0x01, 0xc0, 0x00, "Normal" }, - {0x10, 0x01, 0xc0, 0x40, "Medium" }, - {0x10, 0x01, 0xc0, 0x80, "High" }, - {0x10, 0x01, 0xc0, 0xc0, "Very High" }, -}; - -STDDIPINFO(Sboblbob) - -static struct BurnDIPInfo DlandDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0x3f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Game" }, - {0x0f, 0x01, 0x01, 0x01, "Dream Land" }, - {0x0f, 0x01, 0x01, 0x00, "Super Dream Land" }, - - {0 , 0xfe, 0 , 4 , "Mode" }, - {0x0f, 0x01, 0x05, 0x04, "Game, English" }, - {0x0f, 0x01, 0x05, 0x05, "Game, Japanese" }, - {0x0f, 0x01, 0x05, 0x01, "Test (Grid and Inputs)" }, - {0x0f, 0x01, 0x05, 0x00, "Test (RAM and Sound)" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0f, 0x01, 0x04, 0x00, "Off" }, - {0x0f, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0f, 0x01, 0x30, 0x10, "2 Coins 1 Play" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 1 Play" }, - {0x0f, 0x01, 0x30, 0x00, "2 Coins 3 Plays" }, - {0x0f, 0x01, 0x30, 0x20, "1 Coin 2 Plays" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Play" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 1 Play" }, - {0x0f, 0x01, 0xc0, 0x00, "2 Coins 3 Plays" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Plays" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0x03, 0x02, "Easy" }, - {0x10, 0x01, 0x03, 0x03, "Normal" }, - {0x10, 0x01, 0x03, 0x01, "Hard" }, - {0x10, 0x01, 0x03, 0x00, "Very Hard" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x10, 0x01, 0x0c, 0x08, "20k 80k 300k" }, - {0x10, 0x01, 0x0c, 0x0c, "30k 100k 400k" }, - {0x10, 0x01, 0x0c, 0x04, "40k 200k 500k" }, - {0x10, 0x01, 0x0c, 0x00, "50k 250k 500k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x30, 0x10, "1" }, - {0x10, 0x01, 0x30, 0x00, "2" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x20, "100 (Cheat)" }, - - {0 , 0xfe, 0 , 4 , "Monster Speed" }, - {0x10, 0x01, 0xc0, 0x00, "Normal" }, - {0x10, 0x01, 0xc0, 0x40, "Medium" }, - {0x10, 0x01, 0xc0, 0x80, "High" }, - {0x10, 0x01, 0xc0, 0xc0, "Very High" }, -}; - -STDDIPINFO(Dland) - -static struct BurnInputInfo TokioInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvInputPort0 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvInputPort1 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvInputPort1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvInputPort1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvInputPort1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvInputPort1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvInputPort1 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvInputPort1 + 4, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvInputPort0 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvInputPort2 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvInputPort2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvInputPort2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvInputPort2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvInputPort2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvInputPort2 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvInputPort2 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvInputPort0 + 1, "service" }, - {"Tilt", BIT_DIGITAL, DrvInputPort0 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, -}; - -STDINPUTINFO(Tokio) - -static struct BurnDIPInfo TokioDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0x7e, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Enemies" }, - {0x14, 0x01, 0x01, 0x01, "Few (Easy)" }, - {0x14, 0x01, 0x01, 0x00, "Many (Hard)" }, - - {0 , 0xfe, 0 , 2, "Enemy Shots" }, - {0x14, 0x01, 0x02, 0x02, "Few (Easy)" }, - {0x14, 0x01, 0x02, 0x00, "Many (Hard)" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "100K 400K" }, - {0x14, 0x01, 0x0c, 0x08, "200K 400K" }, - {0x14, 0x01, 0x0c, 0x04, "300K 400K" }, - {0x14, 0x01, 0x0c, 0x00, "400K 400K" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "99 (Cheat)" }, - - {0 , 0xfe, 0 , 0, "Language" }, - {0x14, 0x01, 0x80, 0x00, "English" }, - {0x14, 0x01, 0x80, 0x80, "Japanese" }, -}; - -STDDIPINFO(Tokio) - -static struct BurnRomInfo BublboblRomDesc[] = { - { "a78-06-1.51", 0x08000, 0x567934b6, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a78-05-1.52", 0x10000, 0x9f8ee242, BRF_ESS | BRF_PRG }, // 1 - - { "a78-08.37", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 3 Z80 #3 Program - - { "a78-01.17", 0x01000, 0xb1bfb53d, BRF_ESS | BRF_PRG }, // 4 MCU Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 18 PLDs - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 19 - { "pal16r4.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(Bublbobl) -STD_ROM_FN(Bublbobl) - -static struct BurnRomInfo BublbobluRomDesc[] = { - { "a78-06.51", 0x08000, 0xa6345edd, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a78-05.52", 0x10000, 0xb31d2edc, BRF_ESS | BRF_PRG }, // 1 - - { "a78-08.37", 0x08000, 0xd544be2e, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 3 Z80 #3 Program - - { "a78-01.17", 0x01000, 0xb1bfb53d, BRF_ESS | BRF_PRG }, // 4 MCU Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 18 PLDs - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 19 - { "pal16r4.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(Bublboblu) -STD_ROM_FN(Bublboblu) - -static struct BurnRomInfo Bublbob1RomDesc[] = { - { "a78-06.51", 0x08000, 0x32c8305b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a78-05.52", 0x10000, 0x53f4bc6e, BRF_ESS | BRF_PRG }, // 1 - - { "a78-08.37", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 3 Z80 #3 Program - - { "a78-01.17", 0x01000, 0xb1bfb53d, BRF_ESS | BRF_PRG }, // 4 MCU Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 18 PLDs - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 19 - { "pal16r4.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(Bublbob1) -STD_ROM_FN(Bublbob1) - -static struct BurnRomInfo BublbobrRomDesc[] = { - { "a78-25.51", 0x08000, 0x2d901c9d, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a78-24.52", 0x10000, 0xb7afedc4, BRF_ESS | BRF_PRG }, // 1 - - { "a78-08.37", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 3 Z80 #3 Program - - { "a78-01.17", 0x01000, 0xb1bfb53d, BRF_ESS | BRF_PRG }, // 4 MCU Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 18 PLDs - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 19 - { "pal16r4.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(Bublbobr) -STD_ROM_FN(Bublbobr) - -static struct BurnRomInfo Bubbobr1RomDesc[] = { - { "a78-06.51", 0x08000, 0x32c8305b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a78-21.52", 0x10000, 0x2844033d, BRF_ESS | BRF_PRG }, // 1 - - { "a78-08.37", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 3 Z80 #3 Program - - { "a78-01.17", 0x01000, 0xb1bfb53d, BRF_ESS | BRF_PRG }, // 4 MCU Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 18 PLDs - { "pal16l8.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 19 - { "pal16r4.bin", 0x00001, 0x00000000, BRF_OPT | BRF_NODUMP }, // 20 -}; - -STD_ROM_PICK(Bubbobr1) -STD_ROM_FN(Bubbobr1) - -static struct BurnRomInfo BoblboblRomDesc[] = { - { "bb3", 0x08000, 0x01f81936, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bb5", 0x08000, 0x13118eb1, BRF_ESS | BRF_PRG }, // 1 - { "bb4", 0x08000, 0xafda99d8, BRF_ESS | BRF_PRG }, // 2 - - { "a78-08.37", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "pal16r4.u36", 0x00104, 0x22fe26ac, BRF_OPT }, // 18 PLDs - { "pal16l8.u38", 0x00104, 0xc02d9663, BRF_OPT }, // 19 - { "pal16l8.u4", 0x00104, 0x077d20a8, BRF_OPT }, // 20 -}; - -STD_ROM_PICK(Boblbobl) -STD_ROM_FN(Boblbobl) - -static struct BurnRomInfo BbreduxRomDesc[] = { - { "redux_bb3", 0x08000, 0xd51de9f3, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "redux_bb5", 0x08000, 0xd29d3444, BRF_ESS | BRF_PRG }, // 1 - { "redux_bb4", 0x08000, 0x984149bd, BRF_ESS | BRF_PRG }, // 2 - - { "a78-08.37", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "pal16r4.u36", 0x00104, 0x22fe26ac, BRF_OPT }, // 18 PLDs - { "pal16l8.u38", 0x00104, 0xc02d9663, BRF_OPT }, // 19 - { "pal16l8.u4", 0x00104, 0x077d20a8, BRF_OPT }, // 20 -}; - -STD_ROM_PICK(Bbredux) -STD_ROM_FN(Bbredux) - -static struct BurnRomInfo BublboblbRomDesc[] = { - { "bbaladar.3", 0x08000, 0x31bfc6fb, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bbaladar.5", 0x08000, 0x16386e9a, BRF_ESS | BRF_PRG }, // 1 - { "bbaladar.4", 0x08000, 0x0c4bcb07, BRF_ESS | BRF_PRG }, // 2 - - { "a78-08.37", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "pal16r4.u36", 0x00104, 0x22fe26ac, BRF_OPT }, // 18 PLDs - { "pal16l8.u38", 0x00104, 0xc02d9663, BRF_OPT }, // 19 - { "pal16l8.u4", 0x00104, 0x077d20a8, BRF_OPT }, // 20 -}; - -STD_ROM_PICK(Bublboblb) -STD_ROM_FN(Bublboblb) - -static struct BurnRomInfo SboblboblRomDesc[] = { - { "cpu2-3.bin", 0x08000, 0x2d9107b6, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bb5", 0x08000, 0x13118eb1, BRF_ESS | BRF_PRG }, // 1 - { "cpu2-4.bin", 0x08000, 0x3f9fed10, BRF_ESS | BRF_PRG }, // 2 - - { "a78-08.37", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "gfx11.bin", 0x10000, 0x76f2b367, BRF_GRA }, // 5 Tiles - { "gfx10.bin", 0x10000, 0xd370f499, BRF_GRA }, // 6 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 7 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 8 - { "gfx8.bin", 0x10000, 0x677840e8, BRF_GRA }, // 9 - { "gfx7.bin", 0x10000, 0x702f61c0, BRF_GRA }, // 10 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 11 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 12 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 13 PROMs -}; - -STD_ROM_PICK(Sboblbobl) -STD_ROM_FN(Sboblbobl) - -static struct BurnRomInfo SboblboblaRomDesc[] = { - { "1c.bin", 0x08000, 0xf304152a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "1a.bin", 0x08000, 0x0865209c, BRF_ESS | BRF_PRG }, // 1 - { "1b.bin", 0x08000, 0x1f29b5c0, BRF_ESS | BRF_PRG }, // 2 - - { "1e.rom", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "1d.rom", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "1l.rom", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "1m.rom", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "1n.rom", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "1o.rom", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "1p.rom", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "1q.rom", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "1f.rom", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "1g.rom", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "1h.rom", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "1i.rom", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "1j.rom", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "1k.rom", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs -}; - -STD_ROM_PICK(Sboblbobla) -STD_ROM_FN(Sboblbobla) - -static struct BurnRomInfo SboblboblbRomDesc[] = { - { "bbb-3.rom", 0x08000, 0xf304152a, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bb5", 0x08000, 0x13118eb1, BRF_ESS | BRF_PRG }, // 1 - { "bbb-4.rom", 0x08000, 0x94c75591, BRF_ESS | BRF_PRG }, // 2 - - { "a78-08.37", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs -}; - -STD_ROM_PICK(Sboblboblb) -STD_ROM_FN(Sboblboblb) - -static struct BurnRomInfo SboblboblcRomDesc[] = { - { "3", 0x08000, 0xf2d44846, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "5", 0x08000, 0x3c5e4441, BRF_ESS | BRF_PRG }, // 1 - { "4", 0x08000, 0x1f29b5c0, BRF_ESS | BRF_PRG }, // 2 - - { "1", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "2", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "6", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "7", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "8", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "9", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "10", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "11", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs -}; - -STD_ROM_PICK(Sboblboblc) -STD_ROM_FN(Sboblboblc) - -static struct BurnRomInfo SboblbobldRomDesc[] = { - { "3.bin", 0x08000, 0x524cdc4f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "5.bin", 0x08000, 0x13118eb1, BRF_ESS | BRF_PRG }, // 1 - { "4.bin", 0x08000, 0x13fe9baa, BRF_ESS | BRF_PRG }, // 2 - - { "1.bin", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "2.bin", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "6", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "7", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "8", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "9", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "10", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "11", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs -}; - -STD_ROM_PICK(Sboblbobld) -STD_ROM_FN(Sboblbobld) - -static struct BurnRomInfo Bub68705RomDesc[] = { - { "2.bin", 0x08000, 0x32c8305b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "3-1.bin", 0x08000, 0x980c2615, BRF_ESS | BRF_PRG }, // 1 - { "3.bin", 0x08000, 0xe6c698f2, BRF_ESS | BRF_PRG }, // 2 - - { "4.bin", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "1.bin", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "68705.bin", 0x00800, 0x78caa635, BRF_ESS | BRF_PRG }, // 18 68705 Program Code -}; - -STD_ROM_PICK(Bub68705) -STD_ROM_FN(Bub68705) - -static struct BurnRomInfo Bub68705aRomDesc[] = { - { "2.bin", 0x08000, 0x32c8305b, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "3-1.bin", 0x08000, 0x980c2615, BRF_ESS | BRF_PRG }, // 1 - { "3.bin", 0x08000, 0xe6c698f2, BRF_ESS | BRF_PRG }, // 2 - - { "4.bin", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "1.bin", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "a78-09.12", 0x08000, 0x20358c22, BRF_GRA }, // 5 Tiles - { "a78-10.13", 0x08000, 0x930168a9, BRF_GRA }, // 6 - { "a78-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "a78-12.15", 0x08000, 0xd045549b, BRF_GRA }, // 8 - { "a78-13.16", 0x08000, 0xd0af35c5, BRF_GRA }, // 9 - { "a78-14.17", 0x08000, 0x7b5369a8, BRF_GRA }, // 10 - { "a78-15.30", 0x08000, 0x6b61a413, BRF_GRA }, // 11 - { "a78-16.31", 0x08000, 0xb5492d97, BRF_GRA }, // 12 - { "a78-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "a78-18.33", 0x08000, 0x9f243b68, BRF_GRA }, // 14 - { "a78-19.34", 0x08000, 0x66e9438c, BRF_GRA }, // 15 - { "a78-20.35", 0x08000, 0x9ef863ad, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "cpu68705.bin", 0x00800, 0x32bffbf4, BRF_ESS | BRF_PRG }, // 18 68705 Program Code -}; - -STD_ROM_PICK(Bub68705a) -STD_ROM_FN(Bub68705a) - - -static struct BurnRomInfo DlandRomDesc[] = { - { "dl_3.u69", 0x08000, 0x01eb3e4f, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "dl_5.u67", 0x08000, 0x75740b61, BRF_ESS | BRF_PRG }, // 1 - { "dl_4.u68", 0x08000, 0xc6a3776f, BRF_ESS | BRF_PRG }, // 2 - - { "dl_1.u42", 0x08000, 0xae11a07b, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "dl_2.u74", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "dl_6.58", 0x10000, 0x6352d3fa, BRF_GRA }, // 5 Tiles - { "dl_7.59", 0x10000, 0x37a38b69, BRF_GRA }, // 6 - { "dl_8.60", 0x10000, 0x509ee5b1, BRF_GRA }, // 7 - { "dl_9.61", 0x10000, 0xae8514d7, BRF_GRA }, // 8 - { "dl_10.62", 0x10000, 0x6d406fb7, BRF_GRA }, // 9 - { "dl_11.63", 0x10000, 0xbdf9c0ab, BRF_GRA }, // 10 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 11 PROMs -}; - -STD_ROM_PICK(Dland) -STD_ROM_FN(Dland) - -static struct BurnRomInfo BublcaveRomDesc[] = { - { "bublcave-06.51", 0x08000, 0xe8b9af5e, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bublcave-05.52", 0x10000, 0xcfe14cb8, BRF_ESS | BRF_PRG }, // 1 - - { "bublcave-08.37", 0x08000, 0xa9384086, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 3 Z80 #3 Program - - { "a78-01.17", 0x01000, 0xb1bfb53d, BRF_ESS | BRF_PRG }, // 4 MCU Program - - { "bublcave-09.12", 0x08000, 0xb90b7eef, BRF_GRA }, // 5 Tiles - { "bublcave-10.13", 0x08000, 0x4fb22f05, BRF_GRA }, // 6 - { "bublcave-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "bublcave-12.15", 0x08000, 0xe49eb49e, BRF_GRA }, // 8 - { "bublcave-13.16", 0x08000, 0x61919734, BRF_GRA }, // 9 - { "bublcave-14.17", 0x08000, 0x7e3a13bd, BRF_GRA }, // 10 - { "bublcave-15.30", 0x08000, 0xc253c73a, BRF_GRA }, // 11 - { "bublcave-16.31", 0x08000, 0xe66c92ee, BRF_GRA }, // 12 - { "bublcave-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "bublcave-18.33", 0x08000, 0x47ee2544, BRF_GRA }, // 14 - { "bublcave-19.34", 0x08000, 0x1ceeb1fa, BRF_GRA }, // 15 - { "bublcave-20.35", 0x08000, 0x64322e24, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs -}; - -STD_ROM_PICK(Bublcave) -STD_ROM_FN(Bublcave) - -static struct BurnRomInfo BoblcaveRomDesc[] = { - { "lc12_bb3", 0x08000, 0xdddc9a24, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "lc12_bb5", 0x08000, 0x0bc4de52, BRF_ESS | BRF_PRG }, // 1 - { "lc12_bb4", 0x08000, 0xbd7afdf4, BRF_ESS | BRF_PRG }, // 2 - - { "bublcave-08.37", 0x08000, 0xa9384086, BRF_ESS | BRF_PRG }, // 3 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 4 Z80 #3 Program - - { "bublcave-09.12", 0x08000, 0xb90b7eef, BRF_GRA }, // 5 Tiles - { "bublcave-10.13", 0x08000, 0x4fb22f05, BRF_GRA }, // 6 - { "bublcave-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "bublcave-12.15", 0x08000, 0xe49eb49e, BRF_GRA }, // 8 - { "bublcave-13.16", 0x08000, 0x61919734, BRF_GRA }, // 9 - { "bublcave-14.17", 0x08000, 0x7e3a13bd, BRF_GRA }, // 10 - { "bublcave-15.30", 0x08000, 0xc253c73a, BRF_GRA }, // 11 - { "bublcave-16.31", 0x08000, 0xe66c92ee, BRF_GRA }, // 12 - { "bublcave-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "bublcave-18.33", 0x08000, 0x47ee2544, BRF_GRA }, // 14 - { "bublcave-19.34", 0x08000, 0x1ceeb1fa, BRF_GRA }, // 15 - { "bublcave-20.35", 0x08000, 0x64322e24, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs - - { "pal16r4.u36", 0x00104, 0x22fe26ac, BRF_OPT }, // 18 PLDs - { "pal16l8.u38", 0x00104, 0xc02d9663, BRF_OPT }, // 19 - { "pal16l8.u4", 0x00104, 0x077d20a8, BRF_OPT }, // 20 -}; - -STD_ROM_PICK(Boblcave) -STD_ROM_FN(Boblcave) - -static struct BurnRomInfo Bublcave11RomDesc[] = { - { "bublcave10-06.51", 0x08000, 0x185cc219, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bublcave11-05.52", 0x10000, 0xb6b02df3, BRF_ESS | BRF_PRG }, // 1 - - { "bublcave11-08.37", 0x08000, 0xc5d14e62, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 3 Z80 #3 Program - - { "a78-01.17", 0x01000, 0xb1bfb53d, BRF_ESS | BRF_PRG }, // 4 MCU Program - - { "bublcave-09.12", 0x08000, 0xb90b7eef, BRF_GRA }, // 5 Tiles - { "bublcave-10.13", 0x08000, 0x4fb22f05, BRF_GRA }, // 6 - { "bublcave-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "bublcave-12.15", 0x08000, 0xe49eb49e, BRF_GRA }, // 8 - { "bublcave-13.16", 0x08000, 0x61919734, BRF_GRA }, // 9 - { "bublcave-14.17", 0x08000, 0x7e3a13bd, BRF_GRA }, // 10 - { "bublcave-15.30", 0x08000, 0xc253c73a, BRF_GRA }, // 11 - { "bublcave-16.31", 0x08000, 0xe66c92ee, BRF_GRA }, // 12 - { "bublcave-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "bublcave-18.33", 0x08000, 0x47ee2544, BRF_GRA }, // 14 - { "bublcave-19.34", 0x08000, 0x1ceeb1fa, BRF_GRA }, // 15 - { "bublcave-20.35", 0x08000, 0x64322e24, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs -}; - -STD_ROM_PICK(Bublcave11) -STD_ROM_FN(Bublcave11) - -static struct BurnRomInfo Bublcave10RomDesc[] = { - { "bublcave10-06.51", 0x08000, 0x185cc219, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "bublcave10-05.52", 0x10000, 0x381cdde7, BRF_ESS | BRF_PRG }, // 1 - - { "bublcave10-08.37", 0x08000, 0x026a68e1, BRF_ESS | BRF_PRG }, // 2 Z80 #2 Program - - { "a78-07.46", 0x08000, 0x4f9a26e8, BRF_ESS | BRF_PRG }, // 3 Z80 #3 Program - - { "a78-01.17", 0x01000, 0xb1bfb53d, BRF_ESS | BRF_PRG }, // 4 MCU Program - - { "bublcave-09.12", 0x08000, 0xb90b7eef, BRF_GRA }, // 5 Tiles - { "bublcave-10.13", 0x08000, 0x4fb22f05, BRF_GRA }, // 6 - { "bublcave-11.14", 0x08000, 0x9773e512, BRF_GRA }, // 7 - { "bublcave-12.15", 0x08000, 0xe49eb49e, BRF_GRA }, // 8 - { "bublcave-13.16", 0x08000, 0x61919734, BRF_GRA }, // 9 - { "bublcave-14.17", 0x08000, 0x7e3a13bd, BRF_GRA }, // 10 - { "bublcave-15.30", 0x08000, 0xc253c73a, BRF_GRA }, // 11 - { "bublcave-16.31", 0x08000, 0xe66c92ee, BRF_GRA }, // 12 - { "bublcave-17.32", 0x08000, 0xd69762d5, BRF_GRA }, // 13 - { "bublcave-18.33", 0x08000, 0x47ee2544, BRF_GRA }, // 14 - { "bublcave-19.34", 0x08000, 0x1ceeb1fa, BRF_GRA }, // 15 - { "bublcave-20.35", 0x08000, 0x64322e24, BRF_GRA }, // 16 - - { "a71-25.41", 0x00100, 0x2d0f8545, BRF_GRA }, // 17 PROMs -}; - -STD_ROM_PICK(Bublcave10) -STD_ROM_FN(Bublcave10) - -static struct BurnRomInfo tokioRomDesc[] = { - { "a71-02-1.ic4", 0x8000, 0xBB8DABD7, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program - { "a71-03-1.ic5", 0x8000, 0xEE49B383, BRF_ESS | BRF_PRG }, // 1 - { "a71-04.ic6", 0x8000, 0xa0a4ce0e, BRF_ESS | BRF_PRG }, // 2 - { "a71-05.ic7", 0x8000, 0x6da0b945, BRF_ESS | BRF_PRG }, // 3 - { "a71-06-1.ic8", 0x8000, 0x56927b3f, BRF_ESS | BRF_PRG }, // 4 - - { "a71-01.ic1", 0x8000, 0x0867c707, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program - - { "a71-07.ic10", 0x8000, 0xf298cc7b, BRF_ESS | BRF_PRG }, // 6 Z80 #3 Program - - { "a71-08.ic12", 0x8000, 0x0439ab13, BRF_GRA }, // 7 Tiles - { "a71-09.ic13", 0x8000, 0xedb3d2ff, BRF_GRA }, // 8 - { "a71-10.ic14", 0x8000, 0x69f0888c, BRF_GRA }, // 9 - { "a71-11.ic15", 0x8000, 0x4ae07c31, BRF_GRA }, // 10 - { "a71-12.ic16", 0x8000, 0x3f6bd706, BRF_GRA }, // 11 - { "a71-13.ic17", 0x8000, 0xf2c92aaa, BRF_GRA }, // 12 - { "a71-14.ic18", 0x8000, 0xc574b7b2, BRF_GRA }, // 13 - { "a71-15.ic19", 0x8000, 0x12d87e7f, BRF_GRA }, // 14 - { "a71-16.ic30", 0x8000, 0x0bce35b6, BRF_GRA }, // 15 - { "a71-17.ic31", 0x8000, 0xdeda6387, BRF_GRA }, // 16 - { "a71-18.ic32", 0x8000, 0x330cd9d7, BRF_GRA }, // 17 - { "a71-19.ic33", 0x8000, 0xfc4b29e0, BRF_GRA }, // 18 - { "a71-20.ic34", 0x8000, 0x65acb265, BRF_GRA }, // 19 - { "a71-21.ic35", 0x8000, 0x33cde9b2, BRF_GRA }, // 20 - { "a71-22.ic36", 0x8000, 0xfb98eac0, BRF_GRA }, // 21 - { "a71-23.ic37", 0x8000, 0x30bd46ad, BRF_GRA }, // 22 - - { "a71-25.ic41", 0x0100, 0x2d0f8545, BRF_GRA }, // 23 PROMs - - { "a71__24.ic57", 0x0800, 0x0f4b25de, 6 | BRF_PRG}, // 24 Mcu Code - - { "a71-26.ic19", 0x0117, 0x4e1f119c, 7 | BRF_OPT }, // 25 PLDs -}; - -STD_ROM_PICK(tokio) -STD_ROM_FN(tokio) - -static struct BurnRomInfo tokiooRomDesc[] = { - { "a71-02.ic4", 0x8000, 0xd556c908, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program - { "a71-03.ic5", 0x8000, 0x69dacf44, BRF_ESS | BRF_PRG }, // 1 - { "a71-04.ic6", 0x8000, 0xa0a4ce0e, BRF_ESS | BRF_PRG }, // 2 - { "a71-05.ic7", 0x8000, 0x6da0b945, BRF_ESS | BRF_PRG }, // 3 - { "a71-06.ic8", 0x8000, 0x447d6779, BRF_ESS | BRF_PRG }, // 4 - - { "a71-01.ic1", 0x8000, 0x0867c707, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program - - { "a71-07.ic10", 0x8000, 0xf298cc7b, BRF_ESS | BRF_PRG }, // 6 Z80 #3 Program - - { "a71-08.ic12", 0x8000, 0x0439ab13, BRF_GRA }, // 7 Tiles - { "a71-09.ic13", 0x8000, 0xedb3d2ff, BRF_GRA }, // 8 - { "a71-10.ic14", 0x8000, 0x69f0888c, BRF_GRA }, // 9 - { "a71-11.ic15", 0x8000, 0x4ae07c31, BRF_GRA }, // 10 - { "a71-12.ic16", 0x8000, 0x3f6bd706, BRF_GRA }, // 11 - { "a71-13.ic17", 0x8000, 0xf2c92aaa, BRF_GRA }, // 12 - { "a71-14.ic18", 0x8000, 0xc574b7b2, BRF_GRA }, // 13 - { "a71-15.ic19", 0x8000, 0x12d87e7f, BRF_GRA }, // 14 - { "a71-16.ic30", 0x8000, 0x0bce35b6, BRF_GRA }, // 15 - { "a71-17.ic31", 0x8000, 0xdeda6387, BRF_GRA }, // 16 - { "a71-18.ic32", 0x8000, 0x330cd9d7, BRF_GRA }, // 17 - { "a71-19.ic33", 0x8000, 0xfc4b29e0, BRF_GRA }, // 18 - { "a71-20.ic34", 0x8000, 0x65acb265, BRF_GRA }, // 19 - { "a71-21.ic35", 0x8000, 0x33cde9b2, BRF_GRA }, // 20 - { "a71-22.ic36", 0x8000, 0xfb98eac0, BRF_GRA }, // 21 - { "a71-23.ic37", 0x8000, 0x30bd46ad, BRF_GRA }, // 22 - - { "a71-25.ic41", 0x0100, 0x2d0f8545, BRF_GRA }, // 23 PROMs - - { "a71__24.ic57", 0x0800, 0x0f4b25de, 6 | BRF_PRG}, // 24 Mcu Code - - { "a71-26.ic19", 0x0117, 0x4e1f119c, 7 | BRF_OPT }, // 25 PLDs -}; - -STD_ROM_PICK(tokioo) -STD_ROM_FN(tokioo) - -static struct BurnRomInfo tokiouRomDesc[] = { - { "a71-27-1.ic4", 0x8000, 0x8c180896, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a71-28-1.ic5", 0x8000, 0x1b447527, BRF_ESS | BRF_PRG }, // 1 - { "a71-04.ic6", 0x8000, 0xa0a4ce0e, BRF_ESS | BRF_PRG }, // 2 - { "a71-05.ic7", 0x8000, 0x6da0b945, BRF_ESS | BRF_PRG }, // 3 - { "a71-06-1.ic8", 0x8000, 0x56927b3f, BRF_ESS | BRF_PRG }, // 4 - - { "a71-01.ic1", 0x8000, 0x0867c707, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program - - { "a71-07.ic10", 0x8000, 0xf298cc7b, BRF_ESS | BRF_PRG }, // 6 Z80 #3 Program - - { "a71-08.ic12", 0x8000, 0x0439ab13, BRF_GRA }, // 7 Tiles - { "a71-09.ic13", 0x8000, 0xedb3d2ff, BRF_GRA }, // 8 - { "a71-10.ic14", 0x8000, 0x69f0888c, BRF_GRA }, // 9 - { "a71-11.ic15", 0x8000, 0x4ae07c31, BRF_GRA }, // 10 - { "a71-12.ic16", 0x8000, 0x3f6bd706, BRF_GRA }, // 11 - { "a71-13.ic17", 0x8000, 0xf2c92aaa, BRF_GRA }, // 12 - { "a71-14.ic18", 0x8000, 0xc574b7b2, BRF_GRA }, // 13 - { "a71-15.ic19", 0x8000, 0x12d87e7f, BRF_GRA }, // 14 - { "a71-16.ic30", 0x8000, 0x0bce35b6, BRF_GRA }, // 15 - { "a71-17.ic31", 0x8000, 0xdeda6387, BRF_GRA }, // 16 - { "a71-18.ic32", 0x8000, 0x330cd9d7, BRF_GRA }, // 17 - { "a71-19.ic33", 0x8000, 0xfc4b29e0, BRF_GRA }, // 18 - { "a71-20.ic34", 0x8000, 0x65acb265, BRF_GRA }, // 19 - { "a71-21.ic35", 0x8000, 0x33cde9b2, BRF_GRA }, // 20 - { "a71-22.ic36", 0x8000, 0xfb98eac0, BRF_GRA }, // 21 - { "a71-23.ic37", 0x8000, 0x30bd46ad, BRF_GRA }, // 22 - - { "a71-25.ic41", 0x0100, 0x2d0f8545, BRF_GRA }, // 23 PROMs - - { "a71__24.ic57", 0x0800, 0x0f4b25de, 6 | BRF_PRG}, // 24 Mcu Code - - { "a71-26.ic19", 0x0117, 0x4e1f119c, 7 | BRF_OPT }, // 25 PLDs -}; - -STD_ROM_PICK(tokiou) -STD_ROM_FN(tokiou) - -static struct BurnRomInfo tokiobRomDesc[] = { - { "2.ic4", 0x8000, 0xf583b1ef, BRF_ESS | BRF_PRG }, // 0 Z80 #1 Program Code - { "a71-03.ic5", 0x8000, 0x69dacf44, BRF_ESS | BRF_PRG }, // 1 - { "a71-04.ic6", 0x8000, 0xa0a4ce0e, BRF_ESS | BRF_PRG }, // 2 - { "a71-05.ic7", 0x8000, 0x6da0b945, BRF_ESS | BRF_PRG }, // 3 - { "6.ic8", 0x8000, 0x1490e95b, BRF_ESS | BRF_PRG }, // 4 - - { "a71-01.ic1", 0x8000, 0x0867c707, BRF_ESS | BRF_PRG }, // 5 Z80 #2 Program - - { "a71-07.ic10", 0x8000, 0xf298cc7b, BRF_ESS | BRF_PRG }, // 6 Z80 #3 Program - - { "a71-08.ic12", 0x8000, 0x0439ab13, BRF_GRA }, // 7 Tiles - { "a71-09.ic13", 0x8000, 0xedb3d2ff, BRF_GRA }, // 8 - { "a71-10.ic14", 0x8000, 0x69f0888c, BRF_GRA }, // 9 - { "a71-11.ic15", 0x8000, 0x4ae07c31, BRF_GRA }, // 10 - { "a71-12.ic16", 0x8000, 0x3f6bd706, BRF_GRA }, // 11 - { "a71-13.ic17", 0x8000, 0xf2c92aaa, BRF_GRA }, // 12 - { "a71-14.ic18", 0x8000, 0xc574b7b2, BRF_GRA }, // 13 - { "a71-15.ic19", 0x8000, 0x12d87e7f, BRF_GRA }, // 14 - { "a71-16.ic30", 0x8000, 0x0bce35b6, BRF_GRA }, // 15 - { "a71-17.ic31", 0x8000, 0xdeda6387, BRF_GRA }, // 16 - { "a71-18.ic32", 0x8000, 0x330cd9d7, BRF_GRA }, // 17 - { "a71-19.ic33", 0x8000, 0xfc4b29e0, BRF_GRA }, // 18 - { "a71-20.ic34", 0x8000, 0x65acb265, BRF_GRA }, // 19 - { "a71-21.ic35", 0x8000, 0x33cde9b2, BRF_GRA }, // 20 - { "a71-22.ic36", 0x8000, 0xfb98eac0, BRF_GRA }, // 21 - { "a71-23.ic37", 0x8000, 0x30bd46ad, BRF_GRA }, // 22 - - { "a71-25.ic41", 0x0100, 0x2d0f8545, BRF_GRA }, // 23 PROMs -}; - -STD_ROM_PICK(tokiob) -STD_ROM_FN(tokiob) - - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - - DrvZ80Rom1 = Next; Next += 0x30000; - DrvZ80Rom2 = Next; Next += 0x08000; - DrvZ80Rom3 = Next; Next += 0x0a000; - DrvProm = Next; Next += 0x00100; - if (DrvMCUInUse) { - DrvMcuRom = Next; Next += 0x01000; - } - - RamStart = Next; - - DrvPaletteRam = Next; Next += 0x00200; - DrvVideoRam = Next; Next += 0x01d00; - DrvZ80Ram1 = Next; Next += 0x00400; - DrvZ80Ram3 = Next; Next += 0x01000; - DrvSharedRam = Next; Next += 0x01800; - DrvMcuRam = Next; Next += 0x000c0; - DrvSpriteRam = Next; Next += 0x00300; - - RamEnd = Next; - - DrvTiles = Next; Next += 0x4000 * 8 * 8; - DrvPalette = (UINT32*)Next; Next += 0x00100 * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvDoReset() -{ - for (INT32 i = 0; i < 3; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - if (DrvMCUInUse == 1) { - M6801Reset(); - } else if (DrvMCUInUse == 2) { - m67805_taito_reset(); - } - - BurnYM3526Reset(); - BurnYM2203Reset(); - - DrvRomBank = 0; - DrvSlaveCPUActive = 0; - DrvSoundCPUActive = 0; - DrvMCUActive = 0; - DrvVideoEnable = 0; - DrvFlipScreen = 0; - IC43A = 0; - IC43B = 0; - DrvSoundStatus = 0; - DrvSoundNmiEnable = 0; - DrvSoundNmiPending = 0; - DrvSoundLatch = 0; - mcu_latch = 0; - mcu_address = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 TokioDoReset() -{ - for (INT32 i = 0; i < 3; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - BurnYM2203Reset(); - - DrvRomBank = 0; - DrvVideoEnable = 1; - DrvFlipScreen = 0; - DrvSoundStatus = 0; - DrvSoundNmiEnable = 0; - DrvSoundNmiPending = 0; - DrvSoundLatch = 0; - - HiscoreReset(); - - return 0; -} - -UINT8 __fastcall BublboblRead1(UINT16 a) -{ - switch (a) { - case 0xfa00: { - return DrvSoundStatus; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall BublboblWrite1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xfa00: { - DrvSoundLatch = d; - DrvSoundNmiPending = 1; - return; - } - - case 0xfa03: { - if (d) { - ZetClose(); - ZetOpen(2); - ZetReset(); - ZetClose(); - ZetOpen(0); - DrvSoundCPUActive = 0; - } else { - DrvSoundCPUActive = 1; - } - return; - } - - case 0xfa80: { - // watchdog reset - return; - } - case 0xfb40: { - DrvRomBank = (d ^ 0x04) & 0x07; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - - if (!(d & 0x10)) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - DrvSlaveCPUActive = 0; - } else { - DrvSlaveCPUActive = 1; - } - - if (!(d & 0x20)) { - if (DrvMCUInUse == 2) { - m67805_taito_reset(); - } else { - M6801Reset(); - } - DrvMCUActive = 0; - } else { - DrvMCUActive = 1; - } - - DrvVideoEnable = d & 0x40; - DrvFlipScreen = d & 0x80; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall BoblboblRead1(UINT16 a) -{ - switch (a) { - case 0xfe00: { - return IC43A << 4; - } - - case 0xfe01: - case 0xfe02: - case 0xfe03: { - return BurnRandom() & 0xff; - } - - case 0xfe80: { - return IC43B << 4; - } - - case 0xfe81: - case 0xfe82: - case 0xfe83: { - return 0xff; - } - - case 0xff00: { - return DrvDip[0]; - } - - case 0xff01: { - return DrvDip[1]; - } - - case 0xff02: { - return DrvInput[0]; - } - - case 0xff03: { - return DrvInput[1]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall BoblboblWrite1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xfa00: { - DrvSoundLatch = d; - DrvSoundNmiPending = 1; - return; - } - - case 0xfa03: { - if (d) { - ZetClose(); - ZetOpen(2); - ZetReset(); - ZetClose(); - ZetOpen(0); - DrvSoundCPUActive = 0; - } else { - DrvSoundCPUActive = 1; - } - return; - } - - case 0xfa80: { - // nop - return; - } - - case 0xfb40: { - DrvRomBank = (d ^ 0x04) & 0x07; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - - if (!(d & 0x10)) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - DrvSlaveCPUActive = 0; - } else { - DrvSlaveCPUActive = 1; - } - - DrvVideoEnable = d & 0x40; - DrvFlipScreen = d & 0x80; - return; - } - - case 0xfe00: - case 0xfe01: - case 0xfe02: - case 0xfe03: { - INT32 Res = 0; - INT32 Offset = a - 0xfe00; - - switch (Offset) { - case 0x00: { - if (~IC43A & 8) Res ^= 1; - if (~IC43A & 1) Res ^= 2; - if (~IC43A & 1) Res ^= 4; - if (~IC43A & 2) Res ^= 4; - if (~IC43A & 4) Res ^= 8; - break; - } - - case 0x01: { - if (~IC43A & 8) Res ^= 1; - if (~IC43A & 2) Res ^= 1; - if (~IC43A & 8) Res ^= 2; - if (~IC43A & 1) Res ^= 4; - if (~IC43A & 4) Res ^= 8; - break; - } - - case 0x02: { - if (~IC43A & 4) Res ^= 1; - if (~IC43A & 8) Res ^= 2; - if (~IC43A & 2) Res ^= 4; - if (~IC43A & 1) Res ^= 8; - if (~IC43A & 4) Res ^= 8; - break; - } - - case 0x03: { - if (~IC43A & 2) Res ^= 1; - if (~IC43A & 4) Res ^= 2; - if (~IC43A & 8) Res ^= 2; - if (~IC43A & 8) Res ^= 4; - if (~IC43A & 1) Res ^= 8; - break; - } - } - - IC43A = Res; - return; - } - - case 0xfe80: - case 0xfe81: - case 0xfe82: - case 0xfe83: { - INT32 Offset = a - 0xfe80; - static const INT32 XorVal[4] = { 4, 1, 8, 2 }; - - IC43B = (d >> 4) ^ XorVal[Offset]; - return; - } - - case 0xff94: - case 0xff98: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall DrvSoundRead3(UINT16 a) -{ - switch (a) { - case 0x9000: { - return BurnYM2203Read(0, 0); - } - - case 0x9001: { - return BurnYM2203Read(0, 1); - } - - case 0xa000: { - return BurnYM3526Read(0); - } - - case 0xb000: { - return DrvSoundLatch; - } - - case 0xb001: { - // nop - return 0; - } - - case 0xe000: { - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #3 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall DrvSoundWrite3(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x9001: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xa000: { - BurnYM3526Write(0, d); - return; - } - - case 0xa001: { - BurnYM3526Write(1, d); - return; - } - - case 0xb000: { - DrvSoundStatus = d; - return; - } - - case 0xb001: { - DrvSoundNmiEnable = 1; - if (DrvSoundNmiPending) { - ZetNmi(); - DrvSoundNmiPending = 0; - } - return; - } - - case 0xb002: { - DrvSoundNmiEnable = 0; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #3 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 BublboblMcuReadByte(UINT16 Address) -{ - if (Address >= 0x0040 && Address <= 0x00ff) { - return DrvMcuRam[Address - 0x0040]; - } - - switch (Address) { - case 0x00: { - return ddr1; - } - - case 0x01: { - return ddr2; - } - - case 0x02: { - port1_in = DrvInput[0]; - return (port1_out & ddr1) | (port1_in & ~ddr1); - } - - case 0x03: { - return (port2_out & ddr2) | (port2_in & ~ddr2); - } - - case 0x04: { - return ddr3; - } - - case 0x05: { - return ddr4; - } - - case 0x06: { - return (port3_out & ddr3) | (port3_in & ~ddr3); - } - - case 0x07: { - return (port4_out & ddr4) | (port4_in & ~ddr4); - } - } - - bprintf(PRINT_NORMAL, _T("M6801 Read Byte -> %04X\n"), Address); - - return 0; -} - -void BublboblMcuWriteByte(UINT16 Address, UINT8 Data) -{ - if (Address >= 0x0040 && Address <= 0x00ff) { - DrvMcuRam[Address - 0x0040] = Data; - return; - } - - if (Address > 7 && Address <= 0x001f) { - m6803_internal_registers_w(Address, Data); - if (Address > 7) return; - } - - switch (Address) { - case 0x00: { - ddr1 = Data; - return; - } - - case 0x01: { - ddr2 = Data; - return; - } - - case 0x02: { - if ((port1_out & 0x40) && (~Data & 0x40)) { - ZetOpen(0); - ZetSetVector(DrvZ80Ram1[0]); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - port1_out = Data; - return; - } - - case 0x03: { - if ((~port2_out & 0x10) && (Data & 0x10)) { - INT32 nAddress = port4_out | ((Data & 0x0f) << 8); - - if (port1_out & 0x80) { - if (nAddress == 0x0000) port3_in = DrvDip[0]; - if (nAddress == 0x0001) port3_in = DrvDip[1]; - if (nAddress == 0x0002) port3_in = DrvInput[1]; - if (nAddress == 0x0003) port3_in = DrvInput[2]; - - if (nAddress >= 0x0c00 && nAddress <= 0x0fff) port3_in = DrvZ80Ram1[nAddress - 0x0c00]; - } else { - if (nAddress >= 0x0c00 && nAddress <= 0x0fff) DrvZ80Ram1[nAddress - 0x0c00] = port3_out; - } - } - - port2_out = Data; - return; - } - - case 0x04: { - ddr3 = Data; - return; - } - - case 0x05: { - ddr4 = Data; - return; - } - - case 0x06: { - port3_out = Data; - return; - } - - case 0x07: { - port4_out = Data; - return; - } - } - - bprintf(PRINT_NORMAL, _T("M6801 Write Byte -> %04X, %02X\n"), Address, Data); -} - -void bublbobl_68705_portB_out(UINT8 *bytevalue) -{ - INT32 data = *bytevalue;//lazy - - if ((ddrB & 0x01) && (~data & 0x01) && (portB_out & 0x01)) - { - portA_in = mcu_latch; - } - if ((ddrB & 0x02) && (data & 0x02) && (~portB_out & 0x02)) - { - mcu_address = (mcu_address & 0xff00) | portA_out; - } - if ((ddrB & 0x04) && (data & 0x04) && (~portB_out & 0x04)) - { - mcu_address = (mcu_address & 0x00ff) | ((portA_out & 0x0f) << 8); - } - if ((ddrB & 0x10) && (~data & 0x10) && (portB_out & 0x10)) - { - if (data & 0x08) /* read */ - { - if ((mcu_address & 0x0800) == 0x0000) - { - switch (mcu_address & 3) { - case 0: mcu_latch = DrvDip[0]; break; - case 1: mcu_latch = DrvDip[1]; break; - case 2: mcu_latch = DrvInput[1]; break; - case 3: mcu_latch = DrvInput[2]; break; - } - } - else if ((mcu_address & 0x0c00) == 0x0c00) - { - mcu_latch = DrvZ80Ram1[mcu_address & 0x03ff]; - } - } - else - { - if ((mcu_address & 0x0c00) == 0x0c00) - { - DrvZ80Ram1[mcu_address & 0x03ff] = portA_out; - } - } - } - if ((ddrB & 0x20) && (~data & 0x20) && (portB_out & 0x20)) - { - ZetOpen(0); - - /* hack to get random EXTEND letters (who is supposed to do this? 68705? PAL?) */ - DrvZ80Ram1[0x7c] = BurnRandom() % 6; - - ZetSetVector(DrvZ80Ram1[0]); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } -} - -static void bublbobl_68705_portC_in() -{ - portC_out = DrvInput[0]; - ddrC = 0xff; -} - -static m68705_interface bub68705_m68705_interface = { - NULL, bublbobl_68705_portB_out, NULL, - NULL, NULL, NULL, - NULL, NULL, bublbobl_68705_portC_in -}; - - -void __fastcall TokioWrite1(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0xfa80: { - DrvRomBank = d & 0x07; - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - return; - } - - case 0xfb00: { - DrvFlipScreen = d & 0x80; - return; - } - - case 0xfb80: { - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - return; - } - - case 0xfc00: { - DrvSoundLatch = d; - DrvSoundNmiPending = 1; - return; - } - } -} - -UINT8 __fastcall TokioRead1(UINT16 a) -{ - switch (a) - { - case 0xfa03: { - return DrvDip[0]; - } - - case 0xfa04: { - return DrvDip[1]; - } - - case 0xfa05: { - return DrvInput[0] & ~0x20; - } - - case 0xfa06: { - return DrvInput[1]; - } - - case 0xfa07: { - return DrvInput[2]; - } - - case 0xfc00: { - return DrvSoundStatus; - } - - case 0xfe00: { - return 0xbf; // Mcu read... - } - } - - return 0; -} - -void __fastcall TokioSoundWrite3(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0x9000: { - DrvSoundStatus = d; - return; - } - - case 0xa000: { - DrvSoundNmiEnable = 0; - return; - } - - case 0xa800: { - DrvSoundNmiEnable = 1; - if (DrvSoundNmiPending) { - ZetNmi(); - DrvSoundNmiPending = 0; - } - return; - } - - case 0xb000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0xb001: { - BurnYM2203Write(0, 1, d); - return; - } - } -} - -UINT8 __fastcall TokioSoundRead3(UINT16 a) -{ - switch (a) - { - case 0x9000: { - return DrvSoundLatch; - } - - case 0xb000: { - return BurnYM2203Read(0, 0); - } - - case 0xb001: { - return BurnYM2203Read(0, 1); - } - } - - return 0; -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3000000; -} - -inline static INT32 DrvYM3526SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 3000000; -} - -static INT32 TilePlaneOffsets[4] = { 0, 4, 0x200000, 0x200004 }; -static INT32 TileXOffsets[8] = { 3, 2, 1, 0, 11, 10, 9, 8 }; -static INT32 TileYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; - -static INT32 MachineInit() -{ - INT32 nLen; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(BublboblRead1); - ZetSetWriteHandler(BublboblWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xc000, 0xdcff, 0, DrvVideoRam ); - ZetMapArea(0xc000, 0xdcff, 1, DrvVideoRam ); - ZetMapArea(0xc000, 0xdcff, 2, DrvVideoRam ); - ZetMapArea(0xdd00, 0xdfff, 0, DrvSpriteRam ); - ZetMapArea(0xdd00, 0xdfff, 1, DrvSpriteRam ); - ZetMapArea(0xdd00, 0xdfff, 2, DrvSpriteRam ); - ZetMapArea(0xe000, 0xf7ff, 0, DrvSharedRam ); - ZetMapArea(0xe000, 0xf7ff, 1, DrvSharedRam ); - ZetMapArea(0xe000, 0xf7ff, 2, DrvSharedRam ); - ZetMapArea(0xf800, 0xf9ff, 0, DrvPaletteRam ); - ZetMapArea(0xf800, 0xf9ff, 1, DrvPaletteRam ); - ZetMapArea(0xf800, 0xf9ff, 2, DrvPaletteRam ); - ZetMapArea(0xfc00, 0xffff, 0, DrvZ80Ram1 ); - ZetMapArea(0xfc00, 0xffff, 1, DrvZ80Ram1 ); - ZetMapArea(0xfc00, 0xffff, 2, DrvZ80Ram1 ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom2 ); - ZetMapArea(0xe000, 0xf7ff, 0, DrvSharedRam ); - ZetMapArea(0xe000, 0xf7ff, 1, DrvSharedRam ); - ZetMapArea(0xe000, 0xf7ff, 2, DrvSharedRam ); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetSetReadHandler(DrvSoundRead3); - ZetSetWriteHandler(DrvSoundWrite3); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom3 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom3 ); - ZetMapArea(0x8000, 0x8fff, 0, DrvZ80Ram3 ); - ZetMapArea(0x8000, 0x8fff, 1, DrvZ80Ram3 ); - ZetMapArea(0x8000, 0x8fff, 2, DrvZ80Ram3 ); - ZetClose(); - - if (DrvMCUInUse == 1) { - M6801Init(1); - M6801MapMemory(DrvMcuRom, 0xf000, 0xffff, MAP_ROM); - M6801SetReadHandler(BublboblMcuReadByte); - M6801SetWriteHandler(BublboblMcuWriteByte); - } else if (DrvMCUInUse == 2) { - - m67805_taito_init(DrvMcuRom, DrvMcuRam, &bub68705_m68705_interface); - } - - BurnYM2203Init(1, 3000000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - - BurnYM3526Init(3000000, NULL, &DrvYM3526SynchroniseStream, 1); - BurnTimerAttachZetYM3526(6000000); - BurnYM3526SetRoute(BURN_SND_YM3526_ROUTE, 0.50, BURN_SND_ROUTE_BOTH); - - if (BublboblCallbackFunction()) return 1; - - GenericTilesInit(); - - // Reset the driver - DrvDoReset(); - - return 0; -} - -static INT32 BublboblCallback() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Roms - nRet = BurnLoadRom(DrvZ80Rom3 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load MCU Rom - nRet = BurnLoadRom(DrvMcuRom + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x48000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x58000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x68000, 16, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x80000; i++) DrvTempRom[i] ^= 0xff; - GfxDecode(0x4000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x80, DrvTempRom, DrvTiles); - - // Load the PROM - nRet = BurnLoadRom(DrvProm + 0x00000, 17, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 BublboblInit() -{ - BublboblCallbackFunction = BublboblCallback; - - DrvMCUInUse = 1; - - return MachineInit(); -} - -static INT32 BoblboblCallback() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x18000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Roms - nRet = BurnLoadRom(DrvZ80Rom3 + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x48000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x58000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x68000, 16, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x80000; i++) DrvTempRom[i] ^= 0xff; - GfxDecode(0x4000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x80, DrvTempRom, DrvTiles); - - // Load the PROM - nRet = BurnLoadRom(DrvProm + 0x00000, 17, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - ZetOpen(0); - ZetSetReadHandler(BoblboblRead1); - ZetSetWriteHandler(BoblboblWrite1); - ZetMemCallback(0xfe00, 0xffff, 0); - ZetMemCallback(0xfe00, 0xffff, 1); - ZetMemCallback(0xfe00, 0xffff, 2); - ZetClose(); - - return 0; -} - -static INT32 SboblboblCallback() -{ - INT32 nRet = 0; - - bublbobl2 = 1; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x18000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Roms - nRet = BurnLoadRom(DrvZ80Rom3 + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x68000, 12, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x80000; i++) DrvTempRom[i] ^= 0xff; - GfxDecode(0x4000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x80, DrvTempRom, DrvTiles); - - // Load the PROM - nRet = BurnLoadRom(DrvProm + 0x00000, 13, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - ZetOpen(0); - ZetSetReadHandler(BoblboblRead1); - ZetSetWriteHandler(BoblboblWrite1); - ZetMemCallback(0xfe00, 0xffff, 0); - ZetMemCallback(0xfe00, 0xffff, 1); - ZetMemCallback(0xfe00, 0xffff, 2); - ZetClose(); - - return 0; -} - -static INT32 BoblboblInit() -{ - BublboblCallbackFunction = BoblboblCallback; - - return MachineInit(); -} - -static INT32 SboblboblInit() -{ - BublboblCallbackFunction = SboblboblCallback; - - return MachineInit(); -} - -static INT32 Bub68705Callback() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x18000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Roms - nRet = BurnLoadRom(DrvZ80Rom3 + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x48000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x58000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x68000, 16, 1); if (nRet != 0) return 1; - - for (INT32 i = 0x00000; i < 0x80000; i++) - DrvTempRom[i] ^= 0xff; - - GfxDecode(0x4000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x80, DrvTempRom, DrvTiles); - - // Load the PROM - nRet = BurnLoadRom(DrvProm + 0x00000, 17, 1); if (nRet != 0) return 1; - - // Load the 68705 Rom - nRet = BurnLoadRom(DrvMcuRom + 0x00000, 18, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - return 0; -} - -static INT32 Bub68705Init() -{ - BublboblCallbackFunction = Bub68705Callback; - - DrvMCUInUse = 2; - - return MachineInit(); -} - -static INT32 DlandCallback() -{ - INT32 nRet = 0; - - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x18000, 2, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 3, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Roms - nRet = BurnLoadRom(DrvZ80Rom3 + 0x00000, 4, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x00000, 5, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 6, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 10, 1); if (nRet != 0) return 1; - - for (INT32 i = 0x00000; i < 0x40000; i++) - DrvTempRom[i] = BITSWAP08(DrvTempRom[i],7,6,5,4,0,1,2,3) ^ 0xff; - - for (INT32 i = 0x40000; i < 0x80000; i++) - DrvTempRom[i] = BITSWAP08(DrvTempRom[i],7,4,5,6,3,0,1,2) ^ 0xff; - - GfxDecode(0x4000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x80, DrvTempRom, DrvTiles); - - // Load the PROM - nRet = BurnLoadRom(DrvProm + 0x00000, 11, 1); if (nRet != 0) return 1; - - BurnFree(DrvTempRom); - - ZetOpen(0); - ZetSetReadHandler(BoblboblRead1); - ZetSetWriteHandler(BoblboblWrite1); - ZetMemCallback(0xfe00, 0xffff, 0); - ZetMemCallback(0xfe00, 0xffff, 1); - ZetMemCallback(0xfe00, 0xffff, 2); - ZetClose(); - - return 0; -} - -static INT32 DlandInit() -{ - BublboblCallbackFunction = DlandCallback; - - return MachineInit(); -} - -static INT32 TokioInit() -{ - INT32 nLen, nRet; - - // Allocate and Blank all required memory - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(Mem, 0, nLen); - MemIndex(); - - { - DrvTempRom = (UINT8 *)BurnMalloc(0x80000); - - // Load Z80 #1 Program Roms - nRet = BurnLoadRom(DrvZ80Rom1 + 0x00000, 0, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x10000, 1, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x18000, 2, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x20000, 3, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvZ80Rom1 + 0x28000, 4, 1); if (nRet != 0) return 1; - - // Load Z80 #2 Program Roms - nRet = BurnLoadRom(DrvZ80Rom2 + 0x00000, 5, 1); if (nRet != 0) return 1; - - // Load Z80 #3 Program Roms - nRet = BurnLoadRom(DrvZ80Rom3 + 0x00000, 6, 1); if (nRet != 0) return 1; - - // Load and decode the tiles - nRet = BurnLoadRom(DrvTempRom + 0x00000, 7, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x08000, 8, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x10000, 9, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x18000, 10, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x20000, 11, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x28000, 12, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x30000, 13, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x38000, 14, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x40000, 15, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x48000, 16, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x50000, 17, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x58000, 18, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x60000, 19, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x68000, 20, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x70000, 21, 1); if (nRet != 0) return 1; - nRet = BurnLoadRom(DrvTempRom + 0x78000, 22, 1); if (nRet != 0) return 1; - for (INT32 i = 0; i < 0x80000; i++) DrvTempRom[i] ^= 0xff; - GfxDecode(0x4000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x80, DrvTempRom, DrvTiles); - - // Load the PROM - nRet = BurnLoadRom(DrvProm + 0x00000, 23, 1); if (nRet != 0) return 1; - - // Load MCU Rom - //BurnLoadRom(DrvMcuRom + 0x00000, 24, 1); - - BurnFree(DrvTempRom); - } - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(TokioRead1); - ZetSetWriteHandler(TokioWrite1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom1 ); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 ); - ZetMapArea(0xc000, 0xdcff, 0, DrvVideoRam ); - ZetMapArea(0xc000, 0xdcff, 1, DrvVideoRam ); - ZetMapArea(0xc000, 0xdcff, 2, DrvVideoRam ); - ZetMapArea(0xdd00, 0xdfff, 0, DrvSpriteRam ); - ZetMapArea(0xdd00, 0xdfff, 1, DrvSpriteRam ); - ZetMapArea(0xdd00, 0xdfff, 2, DrvSpriteRam ); - ZetMapArea(0xe000, 0xf7ff, 0, DrvSharedRam ); - ZetMapArea(0xe000, 0xf7ff, 1, DrvSharedRam ); - ZetMapArea(0xe000, 0xf7ff, 2, DrvSharedRam ); - ZetMapArea(0xf800, 0xf9ff, 0, DrvPaletteRam ); - ZetMapArea(0xf800, 0xf9ff, 1, DrvPaletteRam ); - ZetMapArea(0xf800, 0xf9ff, 2, DrvPaletteRam ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom2 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom2 ); - ZetMapArea(0x8000, 0x97ff, 0, DrvSharedRam ); - ZetMapArea(0x8000, 0x97ff, 1, DrvSharedRam ); - ZetMapArea(0x8000, 0x97ff, 2, DrvSharedRam ); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetSetReadHandler(TokioSoundRead3); - ZetSetWriteHandler(TokioSoundWrite3); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom3 ); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom3 ); - ZetMapArea(0x8000, 0x8fff, 0, DrvZ80Ram3 ); - ZetMapArea(0x8000, 0x8fff, 1, DrvZ80Ram3 ); - ZetMapArea(0x8000, 0x8fff, 2, DrvZ80Ram3 ); - ZetClose(); - - BurnYM2203Init(1, 3000000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(3000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.08, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.08, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.08, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvVideoEnable = 1; - DrvMCUInUse = 0; - - // Reset the driver - TokioDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - ZetExit(); - BurnYM2203Exit(); - - if (DrvMCUInUse == 1) M6800Exit(); - if (DrvMCUInUse == 2) m6805Exit(); - - GenericTilesExit(); - - BurnFree(Mem); - - DrvRomBank = 0; - DrvSlaveCPUActive = 0; - DrvSoundCPUActive = 0; - DrvMCUActive = 0; - DrvVideoEnable = 0; - DrvFlipScreen = 0; - IC43A = 0; - IC43B = 0; - DrvSoundStatus = 0; - DrvSoundNmiEnable = 0; - DrvSoundNmiPending = 0; - DrvSoundLatch = 0; - DrvMCUInUse = 0; - - bublbobl2 = 0; - - mcu_latch = 0; - mcu_address = 0; - - BublboblCallbackFunction = NULL; - - return 0; -} - -static INT32 BublboblExit() -{ - BurnYM3526Exit(); - return DrvExit(); -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -inline static INT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(nColour >> 12); - g = pal4bit(nColour >> 8); - b = pal4bit(nColour >> 4); - - return BurnHighCol(r, g, b, 0); -} - -static void DrvCalcPalette() -{ - for (INT32 i = 0; i < 0x200; i += 2) { - DrvPalette[i / 2] = CalcCol(DrvPaletteRam[i | 1] | (DrvPaletteRam[i & ~1] << 8)); - } -} - -static void DrvVideoUpdate() -{ - INT32 sx, sy, xc, yc; - INT32 GfxNum, GfxAttr, GfxOffset; - const UINT8 *Prom; - const UINT8 *PromLine; - - if (!DrvVideoEnable) return; - - sx = 0; - - Prom = DrvProm; - - for (INT32 Offset = 0; Offset < 0x300; Offset += 4) { - if (*(UINT32 *)(&DrvSpriteRam[Offset]) == 0) continue; - - GfxNum = DrvSpriteRam[Offset + 1]; - GfxAttr = DrvSpriteRam[Offset + 3]; - PromLine = Prom + 0x80 + ((GfxNum & 0xe0) >> 1); - - GfxOffset = ((GfxNum & 0x1f) * 0x80); - if ((GfxNum & 0xa0) == 0xa0) GfxOffset |= 0x1000; - - sy = -DrvSpriteRam[Offset + 0]; - - for (yc = 0; yc < 32; yc++) { - if (PromLine[yc / 2] & 0x08) continue; - - if (!(PromLine[yc / 2] & 0x04)) { - sx = DrvSpriteRam[Offset + 2]; - if (GfxAttr & 0x40) sx -= 256; - } - - for (xc = 0; xc < 2; xc++) { - INT32 gOffs, Code, Colour, xFlip, yFlip, x, y, yPos; - - gOffs = GfxOffset + xc * 0x40 + (yc & 7) * 0x02 + (PromLine[yc / 2] & 0x03) * 0x10; - Code = DrvVideoRam[gOffs] + 256 * (DrvVideoRam[gOffs + 1] & 0x03) + 1024 * (GfxAttr & 0x0f); - Colour = (DrvVideoRam[gOffs + 1] & 0x3c) >> 2; - xFlip = DrvVideoRam[gOffs + 1] & 0x40; - yFlip = DrvVideoRam[gOffs + 1] & 0x80; - x = sx + xc * 8; - y = (sy + yc * 8) & 0xff; - - if (DrvFlipScreen) { - x = 248 - x; - y = 248 - y; - xFlip = !xFlip; - yFlip = !yFlip; - } - - yPos = y - 16; - - if (x > 8 && x < (nScreenWidth - 8) && yPos > 8 && yPos < (nScreenHeight - 8)) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, yPos, Colour, 4, 15, 0, DrvTiles); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Code, x, yPos, Colour, 4, 15, 0, DrvTiles); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, x, yPos, Colour, 4, 15, 0, DrvTiles); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, yPos, Colour, 4, 15, 0, DrvTiles); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, yPos, Colour, 4, 15, 0, DrvTiles); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Code, x, yPos, Colour, 4, 15, 0, DrvTiles); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, x, yPos, Colour, 4, 15, 0, DrvTiles); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, yPos, Colour, 4, 15, 0, DrvTiles); - } - } - } - } - } - - sx += 16; - } -} - -static void DrvDraw() -{ - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0x00ff; - } - - DrvCalcPalette(); - DrvVideoUpdate(); - BurnTransferCopy(DrvPalette); -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 100; - - if (DrvReset) DrvDoReset(); - - BublboblMakeInputs(); - - nCyclesTotal[0] = 6000000 / 60; - nCyclesTotal[1] = 6000000 / 60; - nCyclesTotal[2] = 3000000 / 60; - nCyclesTotal[3] = (DrvMCUInUse == 2) ? (4000000 / 60) : (1000000 / 60); - nCyclesDone[0] = nCyclesDone[1] = nCyclesDone[2] = nCyclesDone[3] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - BurnTimerUpdateYM3526(i * (nCyclesTotal[nCurrentCPU] / nInterleave)); - if (i == 94 && !DrvMCUInUse) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - //if (i == 99 && !DrvMCUInUse) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - // Run Z80 #2 - if (DrvSlaveCPUActive) { - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 94) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - //if (i == 99) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - } - - // Run Z80 #3 - if (DrvSoundCPUActive) { - nCurrentCPU = 2; - ZetOpen(nCurrentCPU); - BurnTimerUpdate((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - if (DrvSoundNmiPending) { - if (DrvSoundNmiEnable) { - ZetNmi(); - DrvSoundNmiPending = 0; - } - } - ZetClose(); - } - - if (DrvMCUInUse) { - if (DrvMCUActive) { - nCurrentCPU = 3; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (DrvMCUInUse == 2) { - nCyclesSegment = m6805Run(nCyclesSegment); - if (i == 49) m68705SetIrqLine(0, 1 /*ASSERT_LINE*/); // weird, but coinage issues when ack'd at 94 - if (i == 95) m68705SetIrqLine(0, 0 /*CLEAR_LINE*/); - } else { - nCyclesSegment = M6801Run(nCyclesSegment); - if (i == 94) M6801SetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == 95) M6801SetIRQLine(0, CPU_IRQSTATUS_NONE); - } - - nCyclesDone[nCurrentCPU] += nCyclesSegment; - } - } - } - - ZetOpen(0); - BurnTimerEndFrameYM3526(nCyclesTotal[0]); - ZetClose(); - - if (DrvSoundCPUActive) { - ZetOpen(2); - BurnTimerEndFrame(nCyclesTotal[2]); - ZetClose(); - } - - if (pBurnSoundOut) { - ZetOpen(2); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - ZetOpen(0); - BurnYM3526Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 TokioFrame() -{ - INT32 nInterleave = 100; - - if (DrvReset) TokioDoReset(); - - BublboblMakeInputs(); - - nCyclesTotal[0] = 6000000 / 60; - nCyclesTotal[1] = 6000000 / 60; - nCyclesTotal[2] = 3000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = nCyclesDone[2] = 0; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 90) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == 91) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesSegment = ZetRun(nCyclesSegment); - nCyclesDone[nCurrentCPU] += nCyclesSegment; - if (i == 90) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - if (i == 91) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - ZetClose(); - - // Run Z80 #3 - nCurrentCPU = 2; - ZetOpen(nCurrentCPU); - BurnTimerUpdate(i * (nCyclesTotal[nCurrentCPU] / nInterleave)); - if (DrvSoundNmiPending) { - if (DrvSoundNmiEnable) { - ZetNmi(); - DrvSoundNmiPending = 0; - } - } - ZetClose(); - } - - ZetOpen(2); - BurnTimerEndFrame(nCyclesTotal[2]); - ZetClose(); - - if (pBurnSoundOut) { - ZetOpen(2); - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } - - if (pBurnDraw) DrvDraw(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029706; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - if (DrvMCUInUse == 1) M6801Scan(nAction); - if (DrvMCUInUse == 2) m68705_taito_scan(nAction); - - BurnYM2203Scan(nAction, pnMin); - - if (strncmp(BurnDrvGetTextA(DRV_NAME), "tokio", 5) != 0) { - BurnYM3526Scan(nAction, pnMin); - } - - SCAN_VAR(DrvRomBank); - SCAN_VAR(DrvSlaveCPUActive); - SCAN_VAR(DrvSoundCPUActive); - SCAN_VAR(DrvMCUActive); - SCAN_VAR(DrvVideoEnable); - SCAN_VAR(DrvFlipScreen); - SCAN_VAR(IC43A); - SCAN_VAR(IC43B); - SCAN_VAR(DrvSoundStatus); - SCAN_VAR(DrvSoundNmiEnable); - SCAN_VAR(DrvSoundNmiPending); - SCAN_VAR(DrvSoundLatch); - SCAN_VAR(ddr1); - SCAN_VAR(ddr2); - SCAN_VAR(ddr3); - SCAN_VAR(ddr4); - SCAN_VAR(port1_in); - SCAN_VAR(port2_in); - SCAN_VAR(port3_in); - SCAN_VAR(port4_in); - SCAN_VAR(port1_out); - SCAN_VAR(port2_out); - SCAN_VAR(port3_out); - SCAN_VAR(port4_out); - SCAN_VAR(mcu_latch); - SCAN_VAR(mcu_address); - - BurnRandomScan(nAction); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom1 + 0x10000 + (DrvRomBank * 0x4000)); - ZetClose(); - } - - return 0; -} - -struct BurnDriver BurnDrvBublbobl = { - "bublbobl", NULL, NULL, NULL, "1986", - "Bubble Bobble (Japan, Ver 0.1)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, BublboblRomInfo, BublboblRomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - BublboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBublboblu = { - "bublboblu", "bublbobl", NULL, NULL, "2011", - "Bubble Bobble (Ultra Version, Hack)\0", NULL, "Hack (Penta Penguin)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, BublbobluRomInfo, BublbobluRomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - BublboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBublbob1 = { - "bublbobl1", "bublbobl", NULL, NULL, "1986", - "Bubble Bobble (Japan, Ver 0.0)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, Bublbob1RomInfo, Bublbob1RomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - BublboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBublbobr = { - "bublboblr", "bublbobl", NULL, NULL, "1986", - "Bubble Bobble (US, Ver 5.1)\0", NULL, "Taito America Corporation (Romstar license)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, BublbobrRomInfo, BublbobrRomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - BublboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBubbobr1 = { - "bublboblr1", "bublbobl", NULL, NULL, "1986", - "Bubble Bobble (US, Ver 1.0)\0", NULL, "Taito America Corporation (Romstar license)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, Bubbobr1RomInfo, Bubbobr1RomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - BublboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBoblbobl = { - "boblbobl", "bublbobl", NULL, NULL, "1986", - "Bobble Bobble (bootleg of Bubble Bobble)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, BoblboblRomInfo, BoblboblRomName, NULL, NULL, BoblboblInputInfo, BoblboblDIPInfo, - BoblboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBbredux = { - "bbredux", "bublbobl", NULL, NULL, "2013", - "Bobble Bobble ('bootleg redux' hack for Bobble Bobble PCB)\0", NULL, "bootleg (Punji)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, BbreduxRomInfo, BbreduxRomName, NULL, NULL, BoblboblInputInfo, BoblboblDIPInfo, - BoblboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBublboblb = { - "bublboblb", "bublbobl", NULL, NULL, "2013", - "Bubble Bobble (for Bobble Bobble PCB)\0", NULL, "bootleg (Aladar)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, BublboblbRomInfo, BublboblbRomName, NULL, NULL, BoblboblInputInfo, BoblboblDIPInfo, - BoblboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSboblbobl = { - "sboblbobl", "bublbobl", NULL, NULL, "1986", - "Super Bobble Bobble (bootleg, set 1)\0", NULL, "bootleg (Datsu)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, SboblboblRomInfo, SboblboblRomName, NULL, NULL, BoblboblInputInfo, BoblboblDIPInfo, - SboblboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSboblbobla = { - "sboblbobla", "bublbobl", NULL, NULL, "1986", - "Super Bobble Bobble (bootleg, set 2)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, SboblboblaRomInfo, SboblboblaRomName, NULL, NULL, BoblboblInputInfo, BoblboblDIPInfo, - BoblboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSboblboblb = { - "sboblboblb", "bublbobl", NULL, NULL, "1986", - "Super Bobble Bobble (bootleg, set 3)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, SboblboblbRomInfo, SboblboblbRomName, NULL, NULL, BoblboblInputInfo, SboblbobDIPInfo, - BoblboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSboblboblc = { - "sboblboblc", "bublbobl", NULL, NULL, "1986", - "Super Bobble Bobble (bootleg)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, SboblboblcRomInfo, SboblboblcRomName, NULL, NULL, BoblboblInputInfo, SboblbobDIPInfo, - BoblboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSboblbobld = { - "sboblbobld", "bublbobl", NULL, NULL, "1986", - "Super Bobble Bobble (bootleg, set 4)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, SboblbobldRomInfo, SboblbobldRomName, NULL, NULL, BoblboblInputInfo, SboblbobDIPInfo, - BoblboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBub68705 = { - "bub68705", "bublbobl", NULL, NULL, "1986", - "Bubble Bobble (boolteg with 68705, set 1)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, Bub68705RomInfo, Bub68705RomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - Bub68705Init, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBub68705a = { - "bub68705a", "bublbobl", NULL, NULL, "1986", - "Bubble Bobble (boolteg with 68705, set 2)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, Bub68705aRomInfo, Bub68705aRomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - Bub68705Init, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDland = { - "dland", "bublbobl", NULL, NULL, "1987", - "Dream Land / Super Dream Land (bootleg of Bubble Bobble)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, DlandRomInfo, DlandRomName, NULL, NULL, BoblboblInputInfo, DlandDIPInfo, - DlandInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBublcave = { - "bublcave", "bublbobl", NULL, NULL, "2013", - "Bubble Bobble: Lost Cave V1.2\0", NULL, "hack (Bisboch and Aladar)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HOMEBREW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, BublcaveRomInfo, BublcaveRomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - BublboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBoblcave = { - "boblcave", "bublbobl", NULL, NULL, "2013", - "Bubble Bobble: Lost Cave V1.2 (for Bobble Bobble PCB)\0", NULL, "hack (Bisboch and Aladar)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, BoblcaveRomInfo, BoblcaveRomName, NULL, NULL, BoblboblInputInfo, BoblboblDIPInfo, - BoblboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBublcave11 = { - "bublcave11", "bublbobl", NULL, NULL, "2013", - "Bubble Bobble: Lost Cave V1.1\0", NULL, "hack (Bisboch and Aladar)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HOMEBREW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, Bublcave11RomInfo, Bublcave11RomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - BublboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvBublcave10 = { - "bublcave10", "bublbobl", NULL, NULL, "2013", - "Bubble Bobble: Lost Cave V1.0\0", NULL, "hack (Bisboch and Aladar)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HOMEBREW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, Bublcave10RomInfo, Bublcave10RomName, NULL, NULL, BublboblInputInfo, BublboblDIPInfo, - BublboblInit, BublboblExit, DrvFrame, NULL, DrvScan, - NULL, 0x100, 256, 224, 4, 3 -}; - -struct BurnDriver BurnDrvTokio = { - "tokio", NULL, NULL, NULL, "1986", - "Tokio / Scramble Formation (newer)\0", "Use tokiob instead!", "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, tokioRomInfo, tokioRomName, NULL, NULL, TokioInputInfo, TokioDIPInfo, - TokioInit, DrvExit, TokioFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriverD BurnDrvTokioo = { - "tokioo", "tokio", NULL, NULL, "1986", - "Tokio / Scramble Formation (older)\0", "Use tokiob instead!", "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, tokiooRomInfo, tokiooRomName, NULL, NULL, TokioInputInfo, TokioDIPInfo, - TokioInit, DrvExit, TokioFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriverD BurnDrvTokiou = { - "tokiou", "tokio", NULL, NULL, "1986", - "Tokio / Scramble Formation (US)\0", "Use tokiob instead!", "Taito America Corporation (Romstar license)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, tokiouRomInfo, tokiouRomName, NULL, NULL, TokioInputInfo, TokioDIPInfo, - TokioInit, DrvExit, TokioFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTokiob = { - "tokiob", "tokio", NULL, NULL, "1986", - "Tokio / Scramble Formation (bootleg)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, tokiobRomInfo, tokiobRomName, NULL, NULL, TokioInputInfo, TokioDIPInfo, - TokioInit, DrvExit, TokioFrame, NULL, DrvScan, - NULL, 0x100, 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/taito/d_chaknpop.cpp b/jan/src/burn/drv/taito/d_chaknpop.cpp deleted file mode 100644 index d9bf771e1..000000000 --- a/jan/src/burn/drv/taito/d_chaknpop.cpp +++ /dev/null @@ -1,701 +0,0 @@ -// FB Alpha Chack'n Pop driver module -// Based on MAME driver by BUT - -#include "tiles_generic.h" -#include "taito_m68705.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvMcuROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvRAM; -static UINT8 *DrvMcuRAM; -static UINT8 *DrvTxtRAM; -static UINT8 *DrvSprRAM; -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *gfxmode; -static UINT8 *gfxflip; -static UINT8 *rambank; - -static UINT8 DrvInputs[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo ChaknpopInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 7, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Chaknpop) - -static struct BurnDIPInfo ChaknpopDIPList[]= -{ - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x4f, NULL }, - {0x15, 0xff, 0xff, 0x7d, NULL }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x13, 0x01, 0x0f, 0x0f, "9 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0e, "8 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0d, "7 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0c, "6 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x13, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x13, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x13, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x13, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x13, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x13, 0x01, 0xf0, 0xf0, "9 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xe0, "8 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xd0, "7 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xc0, "6 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x13, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x13, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x03, 0x00, "80k and every 100k" }, - {0x14, 0x01, 0x03, 0x01, "60k and every 100k" }, - {0x14, 0x01, 0x03, 0x02, "40k and every 100k" }, - {0x14, 0x01, 0x03, 0x03, "20k and every 100k" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x18, 0x00, "6" }, - {0x14, 0x01, 0x18, 0x08, "3" }, - {0x14, 0x01, 0x18, 0x10, "2" }, - {0x14, 0x01, 0x18, 0x18, "1" }, - - {0 , 0xfe, 0 , 2, "Training/Difficulty" }, - {0x14, 0x01, 0x20, 0x20, "Off/Every 10 Min." }, - {0x14, 0x01, 0x20, 0x00, "On/Every 7 Min." }, - -// {0 , 0xfe, 0 , 2, "Flip Screen" }, -// {0x14, 0x01, 0x40, 0x40, "Off" }, -// {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x14, 0x01, 0x80, 0x00, "Upright" }, - {0x14, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x15, 0x01, 0x01, 0x00, "English" }, - {0x15, 0x01, 0x01, 0x01, "Japanese" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Super Chack'n" }, - {0x15, 0x01, 0x04, 0x04, "pi" }, - {0x15, 0x01, 0x04, 0x00, "1st Chance" }, - - {0 , 0xfe, 0 , 2, "Endless (Cheat)" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Credit Info" }, - {0x15, 0x01, 0x10, 0x00, "Off" }, - {0x15, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Show Year" }, - {0x15, 0x01, 0x20, 0x00, "Off" }, - {0x15, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Infinite (Cheat)" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x15, 0x01, 0x80, 0x00, "1 Way" }, - {0x15, 0x01, 0x80, 0x80, "2 Way" }, -}; - -STDDIPINFO(Chaknpop) - -UINT8 __fastcall chaknpop_read(UINT16 address) -{ - switch (address) - { - case 0x8800: - return standard_taito_mcu_read(); - - case 0x8801: { - INT32 res = 0; - if (!main_sent) res |= 0x01; - if (mcu_sent) res |= 0x02; - return res; - } - - case 0x8802: - return 0xff; - - case 0x8804: - case 0x8805: - return AY8910Read(0); - - case 0x8806: - case 0x8807: - return AY8910Read(1); - - case 0x8808: - return DrvDips[2]; - - case 0x8809: - return DrvInputs[1]; - - case 0x880a: - return DrvInputs[0]; - - case 0x880b: - return DrvInputs[2]; - - case 0x880c: - return gfxmode[0]; - } - - return 0; -} - -static void bankswitch(INT32 bank) -{ - if (rambank[0] != bank) { - rambank[0] = bank; - - bank = bank ? 0x4000 : 0; - - ZetMapArea(0xc000, 0xffff, 0, DrvZ80RAM + bank); - ZetMapArea(0xc000, 0xffff, 1, DrvZ80RAM + bank); - ZetMapArea(0xc000, 0xffff, 2, DrvZ80RAM + bank); - } -} - -void __fastcall chaknpop_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8800: - standard_taito_mcu_write(data); - return; - - case 0x8801: - case 0x8802: // MCU port b & c - return; - - case 0x8804: - case 0x8805: - AY8910Write(0, address & 1, data); - return; - - case 0x8806: - case 0x8807: - AY8910Write(1, address & 1, data); - return; - - case 0x880c: { - gfxflip[0] = data & 0x01; - gfxflip[1] = data & 0x02; - bankswitch(data & 0x04); - gfxmode[0] = data; - } - return; - - case 0x880d: // coin lockout - return; - } -} - -static UINT8 ay8910_0_read_port_A(UINT32) -{ - return DrvDips[0]; -} - -static UINT8 ay8910_0_read_port_B(UINT32) -{ - return DrvDips[1]; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - m67805_taito_reset(); - - AY8910Reset(0); - AY8910Reset(1); - - rambank[0] = 0xff; - ZetOpen(0); - bankswitch(0); - ZetClose(); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 1024; i++) - { - INT32 bit0, bit1, bit2; - - INT32 col = (DrvColPROM[i] & 0x0f) + ((DrvColPROM[i + 1024] & 0x0f) << 4); - - bit0 = (col >> 0) & 0x01; - bit1 = (col >> 1) & 0x01; - bit2 = (col >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (col >> 3) & 0x01; - bit1 = (col >> 4) & 0x01; - bit2 = (col >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = 0; - bit1 = (col >> 6) & 0x01; - bit2 = (col >> 7) & 0x01; - INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - DrvPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[2] = { 0, 0x2000*8 }; - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7 , 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x4000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x4000); - - GfxDecode(0x0100, 2, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x4000); - - GfxDecode(0x0400, 2, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x00c000; - - DrvMcuROM = Next; Next += 0x000800; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvColPROM = Next; Next += 0x000800; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - AllRam = Next; - - DrvRAM = Next; Next += 0x000800; - DrvZ80RAM = Next; Next += 0x008000; - DrvTxtRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000100; - DrvMcuRAM = Next; Next += 0x000800; - - gfxflip = Next; Next += 0x000002; - gfxmode = Next; Next += 0x000001; - rambank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x2000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x6000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0xa000, 4, 1)) return 1; - - if (BurnLoadRom(DrvMcuROM + 0x0000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x2000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x2000, 9, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 10, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0400, 11, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvRAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvRAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvRAM); - ZetMapArea(0x9000, 0x93ff, 0, DrvTxtRAM); - ZetMapArea(0x9000, 0x93ff, 1, DrvTxtRAM); - ZetMapArea(0x9000, 0x93ff, 2, DrvTxtRAM); - ZetMapArea(0x9800, 0x98ff, 0, DrvSprRAM); - ZetMapArea(0x9800, 0x98ff, 1, DrvSprRAM); - ZetMapArea(0x9800, 0x98ff, 2, DrvSprRAM); - ZetMapArea(0xa000, 0xbfff, 0, DrvZ80ROM + 0xa000); - ZetMapArea(0xa000, 0xbfff, 2, DrvZ80ROM + 0xa000); - bankswitch(0); - ZetSetWriteHandler(chaknpop_write); - ZetSetReadHandler(chaknpop_read); - ZetClose(); - - m67805_taito_init(DrvMcuROM, DrvMcuRAM, &standard_m68705_interface); - - AY8910Init(0, 1536000, nBurnSoundRate, &ay8910_0_read_port_A, &ay8910_0_read_port_B, NULL, NULL); - AY8910Init(1, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - ZetExit(); - m67805_taito_exit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - return 0; -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0xc0; offs += 4) - { - INT32 sy = 241 - DrvSprRAM[offs + 0x40]; - INT32 attr = DrvSprRAM[offs + 0x41]; - INT32 color = DrvSprRAM[offs + 0x42] & 0x07; - INT32 sx = DrvSprRAM[offs + 0x43]; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - INT32 code = (attr & 0x3f) | ((DrvSprRAM[offs + 0x42] & 0x38) << 3); - - if (gfxflip[0]) { - sx = 240 - sx; - flipx = !flipx; - } - - if (gfxflip[1]) { - sy = 242 - sy; - flipy = !flipy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM0); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 2, 0, 0, DrvGfxROM0); - } - } - } -} - -static void draw_layer() -{ - for (INT32 offs = 32 * 2; offs < 32 * 32 - 32 * 2; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = ((offs >> 5) << 3) - 16; - - INT32 code = DrvTxtRAM[offs]; - INT32 color = (code == 0x74) ? DrvSprRAM[0x0b] : DrvSprRAM[0x01]; - - if (gfxmode[0] & 0x20 && code >= 0xc0) code += 0xc0; - - code |= (gfxmode[0] & 0x80) << 2; - - if (gfxflip[1]) sy = ((sy+16)^0xff)-16; - if (gfxflip[0]) sx ^= 0xff; - - if (gfxflip[1]) { - if (gfxflip[0]) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color+8, 2, 0, DrvGfxROM1); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color+8, 2, 0, DrvGfxROM1); - } - } else { - if (gfxflip[0]) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color+8, 2, 0, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color+8, 2, 0, DrvGfxROM1); - } - } - } -} - -static void draw_bitmap() -{ - INT32 dx = gfxflip[0] ? -1 : 1; - - for (INT32 offs = 0+(16*32); offs < 0x2000-(16*32); offs++) - { - INT32 x = ((offs & 0x1f) << 3) + 7; - INT32 y = (offs >> 5) + 16; - - if (!gfxflip[0]) x = 255 - x; - if (!gfxflip[1]) y = 255 - y; - - if (y < 0 || y >= nScreenHeight) continue; - - for (INT32 i = 0x80; i > 0; i >>= 1, x += dx) - { - if (x >= nScreenWidth || x < 0) continue; - - UINT32 color = 0; - - if (DrvZ80RAM[0x0000+offs] & i) color |= 0x200; - if (DrvZ80RAM[0x4000+offs] & i) color |= 0x100; - if (DrvZ80RAM[0x2000+offs] & i) color |= 0x080; - if (DrvZ80RAM[0x6000+offs] & i) color |= 0x040; - - if (color) { - pTransDraw[y * nScreenWidth + x] |= color; - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - BurnTransferClear(); - if (nBurnLayer & 1) draw_layer(); - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 4) draw_bitmap(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { 2350000 / 60, 3072000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - m6805Open(0); - nSegment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += m6805Run(nSegment); - m6805Close(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - m68705_taito_scan(nAction); - AY8910Scan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - INT32 bank = rambank[0]; - rambank[0] = 0xff; - ZetOpen(0); - bankswitch(bank); - ZetClose(); - } - - return 0; -} - - -// Chack'n Pop - -static struct BurnRomInfo chaknpopRomDesc[] = { - { "ao4_01.ic28", 0x2000, 0x386fe1c8, 1 | BRF_ESS | BRF_PRG }, // 0 Z80 code - { "ao4_02.ic27", 0x2000, 0x5562a6a7, 1 | BRF_ESS | BRF_PRG }, // 1 - { "ao4_03.ic26", 0x2000, 0x3e2f0a9c, 1 | BRF_ESS | BRF_PRG }, // 2 - { "ao4_04.ic25", 0x2000, 0x5209c7d4, 1 | BRF_ESS | BRF_PRG }, // 3 - { "ao4_05.ic3", 0x2000, 0x8720e024, 1 | BRF_ESS | BRF_PRG }, // 4 - - { "ao4_06.ic23", 0x0800, 0x9c78c24c, 2 | BRF_ESS | BRF_PRG }, // 5 m68705 code - - { "ao4_08.ic14", 0x2000, 0x5575a021, 3 | BRF_GRA }, // 6 Sprites - { "ao4_07.ic15", 0x2000, 0xae687c18, 3 | BRF_GRA }, // 7 - - { "ao4_09.ic98", 0x2000, 0x757a723a, 4 | BRF_GRA }, // 8 Tiles - { "ao4_10.ic97", 0x2000, 0x3e3fd608, 4 | BRF_GRA }, // 9 - - { "ao4-11.ic96", 0x0400, 0x9bf0e85f, 5 | BRF_GRA }, // 10 Color PROMs - { "ao4-12.ic95", 0x0400, 0x954ce8fc, 5 | BRF_GRA }, // 11 -}; - -STD_ROM_PICK(chaknpop) -STD_ROM_FN(chaknpop) - -struct BurnDriver BurnDrvChaknpop = { - "chaknpop", NULL, NULL, NULL, "1983", - "Chack'n Pop\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_MAZE, 0, - NULL, chaknpopRomInfo, chaknpopRomName, NULL, NULL, ChaknpopInputInfo, ChaknpopDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_darius2.cpp b/jan/src/burn/drv/taito/d_darius2.cpp deleted file mode 100644 index 1002b1ecb..000000000 --- a/jan/src/burn/drv/taito/d_darius2.cpp +++ /dev/null @@ -1,2088 +0,0 @@ -// Based on MAME driver by David Graves - -// tofix: darius2d's offsets and y screen size is wrong - it should be 232 and everything moved down 8px - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "taito.h" -#include "taito_ic.h" -#include "burn_ym2610.h" - -static INT32 Ninjaw = 0, Warriorb = 0; - -static double Darius2YM2610Route1MasterVol; -static double Darius2YM2610Route2MasterVol; - -static void Darius2Draw(); -static void Darius2dDraw(); -static void WarriorbDraw(); - -static struct BurnInputInfo Darius2InputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 6, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 6, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 7, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "tilt" }, - {"Freeze" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "freeze" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Darius2) - -static struct BurnInputInfo Darius2dInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 6, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 6, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 7, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "tilt" }, - {"Freeze" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "freeze" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Darius2d) - -static struct BurnInputInfo WarriorbInputList[] = -{ - {"P1 Coin" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 start" }, - {"P1 Up" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p2 start" }, - {"P2 Up" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0510NIOInputPort1 + 5, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0510NIOInputPort1 + 6, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 6, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 7, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "tilt" }, - {"Freeze" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "freeze" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Warriorb) - -static void Darius2MakeInputs() -{ - TC0220IOCInput[0] = 0xe2; - TC0220IOCInput[1] = 0xff; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] |= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] |= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] |= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] |= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] -= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] -= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] -= 0x80; - - for (INT32 i = 0; i < 8; i++) { - TC0220IOCInput[1] -= (TC0220IOCInputPort1[i] & 1) << i; - TC0220IOCInput[2] -= (TC0220IOCInputPort2[i] & 1) << i; - } -} - -static void Darius2dMakeInputs() -{ - TC0220IOCInput[0] = 0xff; - TC0220IOCInput[1] = 0xff; - TC0220IOCInput[2] = 0xf7; - - if (TC0220IOCInputPort2[0]) TC0220IOCInput[2] -= 0x01; - if (TC0220IOCInputPort2[1]) TC0220IOCInput[2] -= 0x02; - if (TC0220IOCInputPort2[2]) TC0220IOCInput[2] -= 0x04; - if (TC0220IOCInputPort2[3]) TC0220IOCInput[2] |= 0x08; - if (TC0220IOCInputPort2[4]) TC0220IOCInput[2] -= 0x10; - if (TC0220IOCInputPort2[5]) TC0220IOCInput[2] -= 0x20; - if (TC0220IOCInputPort2[6]) TC0220IOCInput[2] -= 0x40; - if (TC0220IOCInputPort2[7]) TC0220IOCInput[2] -= 0x80; - - for (INT32 i = 0; i < 8; i++) { - TC0220IOCInput[0] -= (TC0220IOCInputPort0[i] & 1) << i; - TC0220IOCInput[1] -= (TC0220IOCInputPort1[i] & 1) << i; - } -} - -static void WarriorbMakeInputs() -{ - TC0510NIOInput[0] = 0xff; - TC0510NIOInput[1] = 0xff; - TC0510NIOInput[2] = 0xf7; - - if (TC0510NIOInputPort2[0]) TC0510NIOInput[2] -= 0x01; - if (TC0510NIOInputPort2[1]) TC0510NIOInput[2] -= 0x02; - if (TC0510NIOInputPort2[2]) TC0510NIOInput[2] -= 0x04; - if (TC0510NIOInputPort2[3]) TC0510NIOInput[2] |= 0x08; - if (TC0510NIOInputPort2[4]) TC0510NIOInput[2] -= 0x10; - if (TC0510NIOInputPort2[5]) TC0510NIOInput[2] -= 0x20; - if (TC0510NIOInputPort2[6]) TC0510NIOInput[2] -= 0x40; - if (TC0510NIOInputPort2[7]) TC0510NIOInput[2] -= 0x80; - - for (INT32 i = 0; i < 8; i++) { - TC0510NIOInput[0] -= (TC0510NIOInputPort0[i] & 1) << i; - TC0510NIOInput[1] -= (TC0510NIOInputPort1[i] & 1) << i; - } -} - -static struct BurnDIPInfo Darius2DIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xfe, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Auto Fire" }, - {0x14, 0x01, 0x02, 0x02, "Normal" }, - {0x14, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Medium" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x0c, "every 700k" }, - {0x15, 0x01, 0x0c, 0x08, "every 800k" }, - {0x15, 0x01, 0x0c, 0x04, "every 900k" }, - {0x15, 0x01, 0x0c, 0x00, "every 1000K" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x30, 0x30, "3" }, - {0x15, 0x01, 0x30, 0x20, "4" }, - {0x15, 0x01, 0x30, 0x10, "5" }, - {0x15, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Darius2) - -static struct BurnDIPInfo Darius2dDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xfe, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Auto Fire" }, - {0x14, 0x01, 0x02, 0x02, "Normal" }, - {0x14, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Medium" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x15, 0x01, 0x0c, 0x0c, "every 700k" }, - {0x15, 0x01, 0x0c, 0x08, "every 800k" }, - {0x15, 0x01, 0x0c, 0x04, "every 900k" }, - {0x15, 0x01, 0x0c, 0x00, "every 1000K" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x15, 0x01, 0x30, 0x30, "3" }, - {0x15, 0x01, 0x30, 0x20, "4" }, - {0x15, 0x01, 0x30, 0x10, "5" }, - {0x15, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x15, 0x01, 0x80, 0x00, "Off" }, - {0x15, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Darius2d) - -static struct BurnDIPInfo NinjawDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Auto Fire" }, - {0x14, 0x01, 0x02, 0x02, "Normal" }, - {0x14, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x14, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x14, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Medium" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Ninjaw) - -static struct BurnDIPInfo NinjawjDIPList[]= -{ - // Default Values - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x01, 0x00, "Off" }, - {0x14, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Auto Fire" }, - {0x14, 0x01, 0x02, 0x02, "Normal" }, - {0x14, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x14, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x14, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x14, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Medium" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Ninjawj) - -static struct BurnDIPInfo WarriorbDIPList[]= -{ - // Default Values - {0x16, 0xff, 0xff, 0xff, NULL }, - {0x17, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Vitality Recovery" }, - {0x16, 0x01, 0x03, 0x02, "Less" }, - {0x16, 0x01, 0x03, 0x03, "Normal" }, - {0x16, 0x01, 0x03, 0x01, "More" }, - {0x16, 0x01, 0x03, 0x00, "Most" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x16, 0x01, 0x08, 0x00, "Off" }, - {0x16, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x16, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x16, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x16, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x16, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x16, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x16, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x16, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x16, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x17, 0x01, 0x03, 0x02, "Easy" }, - {0x17, 0x01, 0x03, 0x03, "Medium" }, - {0x17, 0x01, 0x03, 0x01, "Hard" }, - {0x17, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Gold Sheep at" }, - {0x17, 0x01, 0x04, 0x04, "50k only" }, - {0x17, 0x01, 0x04, 0x00, "50k, then every 70k" }, - - {0 , 0xfe, 0 , 2 , "Magic Energy Loss" }, - {0x17, 0x01, 0x08, 0x08, "Always Player" }, - {0x17, 0x01, 0x08, 0x00, "Player or Magician" }, - - {0 , 0xfe, 0 , 2 , "Player Starting Strength" }, - {0x17, 0x01, 0x10, 0x10, "Normal" }, - {0x17, 0x01, 0x10, 0x00, "Full" }, - - {0 , 0xfe, 0 , 2 , "Magician appears" }, - {0x17, 0x01, 0x20, 0x20, "When you get a crystal" }, - {0x17, 0x01, 0x20, 0x00, "Always" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x17, 0x01, 0x40, 0x00, "Off" }, - {0x17, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Rounds" }, - {0x17, 0x01, 0x80, 0x80, "Normal (10-14, depends on skill"}, - {0x17, 0x01, 0x80, 0x00, "Long (14)" }, -}; - -STDDIPINFO(Warriorb) - -static struct BurnRomInfo Darius2RomDesc[] = { - { "c07-32-1", 0x10000, 0x216c8f6a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07-29-1", 0x10000, 0x48de567f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07-31-1", 0x10000, 0x8279d2f8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07-30-1", 0x10000, 0x6122e400, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07-27", 0x20000, 0x0a6f7b6c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07-25", 0x20000, 0x059f40ce, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07-26", 0x20000, 0x1f411242, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07-24", 0x20000, 0x486c9c20, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c07-35-1", 0x10000, 0xdd8c4723, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c07-38-1", 0x10000, 0x46afb85c, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c07-34-1", 0x10000, 0x296984b8, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c07-37-1", 0x10000, 0x8b7d461f, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c07-33-1", 0x10000, 0x2da03a3f, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c07-36-1", 0x10000, 0x02cf2b1c, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c07-28", 0x20000, 0xda304bc5, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c07-03.12", 0x80000, 0x189bafce, BRF_GRA | TAITO_CHARS }, - { "c07-04.11", 0x80000, 0x50421e81, BRF_GRA | TAITO_CHARS }, - - { "c07-01", 0x80000, 0x3cf0f050, BRF_GRA | TAITO_SPRITESA }, - { "c07-02", 0x80000, 0x75d16d4b, BRF_GRA | TAITO_SPRITESA }, - - { "c07-10.95", 0x80000, 0x4bbe0ed9, BRF_SND | TAITO_YM2610A }, - { "c07-11.96", 0x80000, 0x3c815699, BRF_SND | TAITO_YM2610A }, - - { "c07-12.107", 0x80000, 0xe0b71258, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Darius2) -STD_ROM_FN(Darius2) - -static struct BurnRomInfo Darius2dRomDesc[] = { - { "c07_20-2.74", 0x20000, 0xa0f345b8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07_19-2.73", 0x20000, 0x925412c6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07_21-2.76", 0x20000, 0xbdd60e37, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07_18-2.71", 0x20000, 0x23fcd89b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07-09.75", 0x80000, 0xcc69c2ce, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "c07_17.69", 0x20000, 0xae16c905, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c07-03.12", 0x80000, 0x189bafce, BRF_GRA | TAITO_CHARS }, - { "c07-04.11", 0x80000, 0x50421e81, BRF_GRA | TAITO_CHARS }, - - { "c07-06.27", 0x80000, 0x5eebbcd6, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c07-05.24", 0x80000, 0xfb6d0550, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c07-08.25", 0x80000, 0xa07dc846, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c07-07.26", 0x80000, 0xfd9f9e74, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c07-10.95", 0x80000, 0x4bbe0ed9, BRF_SND | TAITO_YM2610A }, - { "c07-11.96", 0x80000, 0x3c815699, BRF_SND | TAITO_YM2610A }, - - { "c07-12.107", 0x80000, 0xe0b71258, BRF_SND | TAITO_YM2610B }, - - { "c07-13.37", 0x00400, 0x3ca18eb3, BRF_OPT }, - { "c07-14.38", 0x00400, 0xbaf2a193, BRF_OPT }, -}; - -STD_ROM_PICK(Darius2d) -STD_ROM_FN(Darius2d) - -static struct BurnRomInfo Darius2doRomDesc[] = { - { "c07_20-1.74", 0x20000, 0x48b0804a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07_19-1.73", 0x20000, 0x1f9a4f83, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07_21-1.76", 0x20000, 0xb491b0ca, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07_18-1.71", 0x20000, 0xc552e42f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c07-09.75", 0x80000, 0xcc69c2ce, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "c07_17.69", 0x20000, 0xae16c905, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c07-03.12", 0x80000, 0x189bafce, BRF_GRA | TAITO_CHARS }, - { "c07-04.11", 0x80000, 0x50421e81, BRF_GRA | TAITO_CHARS }, - - { "c07-06.27", 0x80000, 0x5eebbcd6, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c07-05.24", 0x80000, 0xfb6d0550, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c07-08.25", 0x80000, 0xa07dc846, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c07-07.26", 0x80000, 0xfd9f9e74, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c07-10.95", 0x80000, 0x4bbe0ed9, BRF_SND | TAITO_YM2610A }, - { "c07-11.96", 0x80000, 0x3c815699, BRF_SND | TAITO_YM2610A }, - - { "c07-12.107", 0x80000, 0xe0b71258, BRF_SND | TAITO_YM2610B }, - - { "c07-13.37", 0x00400, 0x3ca18eb3, BRF_OPT }, - { "c07-14.38", 0x00400, 0xbaf2a193, BRF_OPT }, -}; - -STD_ROM_PICK(Darius2do) -STD_ROM_FN(Darius2do) - -static struct BurnRomInfo NinjawRomDesc[] = { - { "b31_45.35", 0x10000, 0x107902c3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_47.32", 0x10000, 0xbd536b1e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_29.34", 0x10000, 0xf2941a37, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_27.31", 0x10000, 0x2f3ff642, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_41.5", 0x20000, 0x0daef28a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_39.2", 0x20000, 0xe9197c3c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_40.6", 0x20000, 0x2ce0f24e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_38.3", 0x20000, 0xbc68cd99, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b31_33.87", 0x10000, 0x6ce9af44, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_36.97", 0x10000, 0xba20b0d4, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_32.86", 0x10000, 0xe6025fec, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_35.96", 0x10000, 0x70d9a89f, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_31.85", 0x10000, 0x837f47e2, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_34.95", 0x10000, 0xd6b5fb2a, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b31_37.11", 0x20000, 0x0ca5799d, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b31-01.23", 0x80000, 0x8e8237a7, BRF_GRA | TAITO_CHARS }, - { "b31-02.24", 0x80000, 0x4c3b4e33, BRF_GRA | TAITO_CHARS }, - - { "b31-07.176", 0x80000, 0x33568cdb, BRF_GRA | TAITO_SPRITESA }, - { "b31-06.175", 0x80000, 0x0d59439e, BRF_GRA | TAITO_SPRITESA }, - { "b31-05.174", 0x80000, 0x0a1fc9fb, BRF_GRA | TAITO_SPRITESA }, - { "b31-04.173", 0x80000, 0x2e1e4cb5, BRF_GRA | TAITO_SPRITESA }, - - { "b31-09.18", 0x80000, 0x60a73382, BRF_SND | TAITO_YM2610A }, - { "b31-10.17", 0x80000, 0xc6434aef, BRF_SND | TAITO_YM2610A }, - { "b31-11.16", 0x80000, 0x8da531d4, BRF_SND | TAITO_YM2610A }, - - { "b31-08.19", 0x80000, 0xa0a1f87d, BRF_SND | TAITO_YM2610B }, - - { "b31-25.38", 0x00200, 0xa0b4ba48, BRF_OPT }, - { "b31-26.58", 0x00200, 0x13e5fe15, BRF_OPT }, -}; - -STD_ROM_PICK(Ninjaw) -STD_ROM_FN(Ninjaw) - -static struct BurnRomInfo NinjawjRomDesc[] = { - { "b31_30.35", 0x10000, 0x056edd9f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_28.32", 0x10000, 0xcfa7661c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_29.34", 0x10000, 0xf2941a37, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_27.31", 0x10000, 0x2f3ff642, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_41.5", 0x20000, 0x0daef28a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_39.2", 0x20000, 0xe9197c3c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_40.6", 0x20000, 0x2ce0f24e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_38.3", 0x20000, 0xbc68cd99, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b31_33.87", 0x10000, 0x6ce9af44, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_36.97", 0x10000, 0xba20b0d4, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_32.86", 0x10000, 0xe6025fec, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_35.96", 0x10000, 0x70d9a89f, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_31.85", 0x10000, 0x837f47e2, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_34.95", 0x10000, 0xd6b5fb2a, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b31_37.11", 0x20000, 0x0ca5799d, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b31-01.23", 0x80000, 0x8e8237a7, BRF_GRA | TAITO_CHARS }, - { "b31-02.24", 0x80000, 0x4c3b4e33, BRF_GRA | TAITO_CHARS }, - - { "b31-07.176", 0x80000, 0x33568cdb, BRF_GRA | TAITO_SPRITESA }, - { "b31-06.175", 0x80000, 0x0d59439e, BRF_GRA | TAITO_SPRITESA }, - { "b31-05.174", 0x80000, 0x0a1fc9fb, BRF_GRA | TAITO_SPRITESA }, - { "b31-04.173", 0x80000, 0x2e1e4cb5, BRF_GRA | TAITO_SPRITESA }, - - { "b31-09.18", 0x80000, 0x60a73382, BRF_SND | TAITO_YM2610A }, - { "b31-10.17", 0x80000, 0xc6434aef, BRF_SND | TAITO_YM2610A }, - { "b31-11.16", 0x80000, 0x8da531d4, BRF_SND | TAITO_YM2610A }, - - { "b31-08.19", 0x80000, 0xa0a1f87d, BRF_SND | TAITO_YM2610B }, - - { "b31-25.38", 0x00200, 0xa0b4ba48, BRF_OPT }, - { "b31-26.58", 0x00200, 0x13e5fe15, BRF_OPT }, -}; - -STD_ROM_PICK(Ninjawj) -STD_ROM_FN(Ninjawj) - -static struct BurnRomInfo NinjawuRomDesc[] = { - { "b31_49.35", 0x10000, 0xd38b6391, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_48.32", 0x10000, 0x4b5bb3d8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_29.34", 0x10000, 0xf2941a37, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_27.31", 0x10000, 0x2f3ff642, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_41.5", 0x20000, 0x0daef28a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_39.2", 0x20000, 0xe9197c3c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_40.6", 0x20000, 0x2ce0f24e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b31_38.3", 0x20000, 0xbc68cd99, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b31_33.87", 0x10000, 0x6ce9af44, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_36.97", 0x10000, 0xba20b0d4, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_32.86", 0x10000, 0xe6025fec, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_35.96", 0x10000, 0x70d9a89f, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_31.85", 0x10000, 0x837f47e2, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b31_34.95", 0x10000, 0xd6b5fb2a, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b31_37.11", 0x20000, 0x0ca5799d, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b31-01.23", 0x80000, 0x8e8237a7, BRF_GRA | TAITO_CHARS }, - { "b31-02.24", 0x80000, 0x4c3b4e33, BRF_GRA | TAITO_CHARS }, - - { "b31-07.176", 0x80000, 0x33568cdb, BRF_GRA | TAITO_SPRITESA }, - { "b31-06.175", 0x80000, 0x0d59439e, BRF_GRA | TAITO_SPRITESA }, - { "b31-05.174", 0x80000, 0x0a1fc9fb, BRF_GRA | TAITO_SPRITESA }, - { "b31-04.173", 0x80000, 0x2e1e4cb5, BRF_GRA | TAITO_SPRITESA }, - - { "b31-09.18", 0x80000, 0x60a73382, BRF_SND | TAITO_YM2610A }, - { "b31-10.17", 0x80000, 0xc6434aef, BRF_SND | TAITO_YM2610A }, - { "b31-11.16", 0x80000, 0x8da531d4, BRF_SND | TAITO_YM2610A }, - - { "b31-08.19", 0x80000, 0xa0a1f87d, BRF_SND | TAITO_YM2610B }, - - { "b31-25.38", 0x00200, 0xa0b4ba48, BRF_OPT }, - { "b31-26.58", 0x00200, 0x13e5fe15, BRF_OPT }, -}; - -STD_ROM_PICK(Ninjawu) -STD_ROM_FN(Ninjawu) - -static struct BurnRomInfo WarriorbRomDesc[] = { - { "d24_20-1.74", 0x040000, 0x4452dc25, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d24_19-1.73", 0x040000, 0x15c16016, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d24_21-1.76", 0x040000, 0x783ef8e1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d24_18-1.71", 0x040000, 0x4502db60, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d24-09.75", 0x100000, 0xece5cc59, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "d24_17.69", 0x020000, 0xe41e4aae, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d24-02.12", 0x100000, 0x9f50c271, BRF_GRA | TAITO_CHARS }, - { "d24-01.11", 0x100000, 0x326dcca9, BRF_GRA | TAITO_CHARS }, - - { "d24-07.47", 0x100000, 0x9f50c271, BRF_GRA | TAITO_CHARSB }, - { "d24-08.48", 0x100000, 0x1e6d1528, BRF_GRA | TAITO_CHARSB }, - - { "d24-06.27", 0x100000, 0x918486fe, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d24-03.24", 0x100000, 0x46db9fd7, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d24-04.25", 0x100000, 0x148e0493, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d24-05.26", 0x100000, 0x9f414317, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "d24-12.107", 0x100000, 0x279203a1, BRF_SND | TAITO_YM2610A }, - { "d24-10.95", 0x100000, 0x0e0c716d, BRF_SND | TAITO_YM2610A }, - { "d24-11.118", 0x100000, 0x15362573, BRF_SND | TAITO_YM2610A }, - - { "d24-13.37", 0x000400, 0x3ca18eb3, BRF_OPT }, - { "d24-14.38", 0x000400, 0xbaf2a193, BRF_OPT }, -}; - -STD_ROM_PICK(Warriorb) -STD_ROM_FN(Warriorb) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - Taito68KRom2 = Next; Next += Taito68KRom2Size; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - TaitoYM2610BRom = Next; Next += TaitoYM2610BRomSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x010000; - Taito68KRam2 = Next; Next += 0x010000; - TaitoZ80Ram1 = Next; Next += 0x002000; - TaitoSharedRam = Next; Next += 0x010000; - TaitoSpriteRam = Next; Next += 0x004000; - - TaitoRamEnd = Next; - - TaitoChars = Next; Next += TaitoNumChar * TaitoCharWidth * TaitoCharHeight; - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - - TaitoMemEnd = Next; - - return 0; -} - -static INT32 Darius2dMemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - TaitoYM2610BRom = Next; Next += TaitoYM2610BRomSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x010000; - TaitoZ80Ram1 = Next; Next += 0x002000; - TaitoSpriteRam = Next; Next += 0x001400; - - TaitoRamEnd = Next; - - TaitoChars = Next; Next += TaitoNumChar * TaitoCharWidth * TaitoCharHeight; - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - - TaitoMemEnd = Next; - - return 0; -} - -static INT32 WarriorbMemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - TaitoYM2610BRom = Next; Next += TaitoYM2610BRomSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x014000; - TaitoZ80Ram1 = Next; Next += 0x002000; - TaitoSpriteRam = Next; Next += 0x001400; - - TaitoRamEnd = Next; - - TaitoChars = Next; Next += TaitoNumChar * TaitoCharWidth * TaitoCharHeight; - TaitoCharsB = Next; Next += TaitoNumCharB * TaitoCharBWidth * TaitoCharBHeight; - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - - TaitoMemEnd = Next; - - return 0; -} - -static void Darius2CpuAReset(UINT16 d) -{ - TaitoCpuACtrl = d; - if (!(TaitoCpuACtrl & 1)) { - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - } -} - -UINT8 __fastcall Darius268K1ReadByte(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius268K1WriteByte(UINT32 a, UINT8 d) -{ - TC0100SCNTripleScreenByteWrite_Map(0x280000, 0x293fff) - TC0100SCN1ByteWrite_Map(0x2c0000, 0x2d3fff) - TC0100SCN2ByteWrite_Map(0x300000, 0x313fff) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Darius268K1ReadWord(UINT32 a) -{ - switch (a) { - case 0x200000: { - return TC0220IOCPortRegRead(); - } - - case 0x200002: { - return TC0220IOCHalfWordPortRead(); - } - - case 0x220002: { - return TC0140SYTCommRead(); - } - - case 0x340002: { - return TC0110PCRWordRead(0); - } - - case 0x350002: { - return TC0110PCRWordRead(1); - } - - case 0x360002: { - return TC0110PCRWordRead(2); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius268K1WriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0CtrlWordWrite_Map(0x2a0000) - TC0100SCN1CtrlWordWrite_Map(0x2e0000) - TC0100SCN2CtrlWordWrite_Map(0x320000) - TC0100SCNTripleScreenWordWrite_Map(0x280000, 0x293fff) - TC0100SCN1WordWrite_Map(0x2c0000, 0x2d3fff) - TC0100SCN2WordWrite_Map(0x300000, 0x313fff) - - switch (a) { - case 0x200000: { - TC0220IOCHalfWordPortRegWrite(d); - return; - } - - case 0x200002: { - TC0220IOCHalfWordPortWrite(d); - return; - } - - case 0x210000: { - Darius2CpuAReset(d); - return; - } - - case 0x220000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x220002: { - TC0140SYTCommWrite(d); - return; - } - - case 0x340000: - case 0x340002: { - TC0110PCRStep1WordWrite(0, (a - 0x340000) >> 1, d); - return; - } - - case 0x350000: - case 0x350002: { - TC0110PCRStep1WordWrite(1, (a - 0x350000) >> 1, d); - return; - } - - case 0x360000: - case 0x360002: { - TC0110PCRStep1WordWrite(2, (a - 0x360000) >> 1, d); - return; - } - - case 0x340004: - case 0x350004: - case 0x360004: { - //nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Darius268K2ReadByte(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius268K2WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Darius268K2ReadWord(UINT32 a) -{ - switch (a) { - case 0x200000: { - return TC0220IOCPortRegRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius268K2WriteWord(UINT32 a, UINT16 d) -{ - TC0100SCNTripleScreenWordWrite_Map(0x280000, 0x293fff) - - switch (a) { - case 0x210000: { - //??? - return; - } - - case 0x340000: - case 0x340002: { - TC0110PCRStep1WordWrite(0, (a - 0x340000) >> 1, d); - return; - } - - case 0x350000: - case 0x350002: { - TC0110PCRStep1WordWrite(1, (a - 0x350000) >> 1, d); - return; - } - - case 0x360000: - case 0x360002: { - TC0110PCRStep1WordWrite(2, (a - 0x360000) >> 1, d); - return; - } - - case 0x340004: - case 0x350004: - case 0x360004: { - //nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Darius2d68KReadByte(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius2d68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCNDualScreenByteWrite_Map(0x200000, 0x213fff) - TC0100SCN1ByteWrite_Map(0x240000, 0x25ffff) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Darius2d68KReadWord(UINT32 a) -{ - switch (a) { - case 0x400002: { - return TC0110PCRWordRead(0); - } - - case 0x420002: { - return TC0110PCRWordRead(1); - } - - case 0x800000: - case 0x800002: - case 0x800004: - case 0x800006: - case 0x800008: - case 0x80000a: - case 0x80000c: - case 0x80000e: { - return TC0220IOCRead((a - 0x800000) >> 1); - } - - case 0x830002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius2d68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCNDualScreenWordWrite_Map(0x200000, 0x213fff) - - if (a >= 0x214000 && a <= 0x2141ff) return; - - TC0100SCN0CtrlWordWrite_Map(0x220000) - TC0100SCN1CtrlWordWrite_Map(0x260000) - TC0100SCN1WordWrite_Map(0x240000, 0x25ffff) - - switch (a) { - case 0x400000: - case 0x400002: - case 0x400004: { - TC0110PCRStep1WordWrite(0, (a - 0x400000) >> 1, d); - return; - } - - case 0x420000: - case 0x420002: - case 0x420004: { - TC0110PCRStep1WordWrite(1, (a - 0x420000) >> 1, d); - return; - } - - case 0x800000: - case 0x800002: - case 0x800004: - case 0x800006: - case 0x800008: - case 0x80000a: - case 0x80000c: - case 0x80000e: { - TC0220IOCWrite((a - 0x800000) >> 1, d); - return; - } - - case 0x820000: { - // nop - return; - } - - case 0x830000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x830002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Warriorb68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x800000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Warriorb68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCNDualScreenByteWrite_Map(0x300000, 0x313fff) - TC0100SCN1ByteWrite_Map(0x340000, 0x35ffff) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Warriorb68KReadWord(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x800000) - - switch (a) { - case 0x400002: { - return TC0110PCRWordRead(0); - } - - case 0x420002: { - return TC0110PCRWordRead(1); - } - - case 0x830002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Warriorb68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCNDualScreenWordWrite_Map(0x300000, 0x313fff) - TC0100SCN1WordWrite_Map(0x340000, 0x35ffff) - - TC0100SCN0CtrlWordWrite_Map(0x320000) - TC0100SCN1CtrlWordWrite_Map(0x360000) - - TC0510NIOHalfWordWrite_Map(0x800000) - - switch (a) { - case 0x400000: - case 0x400002: - case 0x400004: { - TC0110PCRStep1WordWrite(0, (a - 0x400000) >> 1, d); - return; - } - - case 0x420000: - case 0x420002: - case 0x420004: { - TC0110PCRStep1WordWrite(1, (a - 0x420000) >> 1, d); - return; - } - - case 0x820000: { - // nop - return; - } - - case 0x830000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x830002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Darius2Z80Read(UINT16 a) -{ - switch (a) { - case 0xe000: { - return BurnYM2610Read(0); - } - - case 0xe002: { - return BurnYM2610Read(2); - } - - case 0xe201: { - return TC0140SYTSlaveCommRead(); - } - - case 0xea00: { - // NOP - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read %04X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius2Z80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - BurnYM2610Write(0, d); - return; - } - - case 0xe001: { - BurnYM2610Write(1, d); - return; - } - - case 0xe002: { - BurnYM2610Write(2, d); - return; - } - - case 0xe003: { - BurnYM2610Write(3, d); - return; - } - - case 0xe200: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xe201: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xe400: { - BurnYM2610SetLeftVolume(BURN_SND_YM2610_YM2610_ROUTE_1, Darius2YM2610Route1MasterVol * d / 255.0); - return; - } - - case 0xe401: { - BurnYM2610SetRightVolume(BURN_SND_YM2610_YM2610_ROUTE_1, Darius2YM2610Route1MasterVol * d / 255.0); - return; - } - - case 0xe402: { - BurnYM2610SetLeftVolume(BURN_SND_YM2610_YM2610_ROUTE_2, Darius2YM2610Route1MasterVol * d / 255.0); - return; - } - - case 0xe403: { - BurnYM2610SetRightVolume(BURN_SND_YM2610_YM2610_ROUTE_2, Darius2YM2610Route1MasterVol * d / 255.0); - return; - } - - case 0xe600: { - //??? - return; - } - - case 0xee00: { - //nop - return; - } - - case 0xf000: { - //nop - return; - } - - case 0xf200: { - TaitoZ80Bank = (d - 1) & 7; - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write %04X, %02X\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[8] = { 8, 12, 0, 4, 24, 28, 16, 20 }; -static INT32 CharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 SpritePlaneOffsets[4] = { 8, 12, 0, 4 }; -static INT32 SpriteXOffsets[16] = { 3, 2, 1, 0, 19, 18, 17, 16, 259, 258, 257, 256, 275, 274, 273, 272 }; -static INT32 SpriteYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; -static INT32 Darius2dSpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 Darius2dSpriteXOffsets[16] = { 12, 8, 44, 40, 4, 0, 36, 32, 28, 24, 60, 56, 20, 16, 52, 48 }; -static INT32 Darius2dSpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; - -static void Darius2FMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 Darius2SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / (16000000 / 4); -} - -static double Darius2GetTime() -{ - return (double)ZetTotalCycles() / (16000000 / 4); -} - -static INT32 Darius2Init() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x8000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x2000; - - if (Ninjaw) TaitoNumSpriteA = 0x4000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - GenericTilesInit(); - - TC0100SCNInit(0, TaitoNumChar, 22, 16, 0, NULL); - TC0100SCNSetClipArea(0, 288, nScreenHeight, 0); - TC0100SCNInit(1, TaitoNumChar, 24, 16, 0, NULL); - TC0100SCNSetClipArea(1, 288, nScreenHeight, 288); - TC0100SCNSetPaletteOffset(1, 0x1000); - TC0100SCNInit(2, TaitoNumChar, 26, 16, 0, NULL); - TC0100SCNSetClipArea(2, 288, nScreenHeight, 576); - TC0100SCNSetPaletteOffset(2, 0x2000); - TC0110PCRInit(3, 0x3000); - TC0140SYTInit(0); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x0c0000, 0x0cffff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x240000, 0x24ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x260000, 0x263fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x280000, 0x293fff, MAP_READ); - SekMapMemory(TC0100SCNRam[1] , 0x2c0000, 0x2d3fff, MAP_READ); - SekMapMemory(TC0100SCNRam[2] , 0x300000, 0x313fff, MAP_READ); - SekSetReadByteHandler(0, Darius268K1ReadByte); - SekSetWriteByteHandler(0, Darius268K1WriteByte); - SekSetReadWordHandler(0, Darius268K1ReadWord); - SekSetWriteWordHandler(0, Darius268K1WriteWord); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x080000, 0x08ffff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x240000, 0x24ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x260000, 0x263fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x280000, 0x293fff, MAP_READ); - SekSetReadByteHandler(0, Darius268K2ReadByte); - SekSetWriteByteHandler(0, Darius268K2WriteByte); - SekSetReadWordHandler(0, Darius268K2ReadWord); - SekSetWriteWordHandler(0, Darius268K2WriteWord); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Darius2Z80Read); - ZetSetWriteHandler(Darius2Z80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &Darius2FMIRQHandler, Darius2SynchroniseStream, Darius2GetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.03); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.03); - Darius2YM2610Route1MasterVol = 1.00; - Darius2YM2610Route2MasterVol = 1.00; - bYM2610UseSeperateVolumes = 1; - - TaitoDrawFunction = Darius2Draw; - TaitoMakeInputsFunction = Darius2MakeInputs; - TaitoIrqLine = 4; - - nTaitoCyclesTotal[0] = (16000000 / 2) / 60; - nTaitoCyclesTotal[1] = (16000000 / 2) / 60; - nTaitoCyclesTotal[2] = (16000000 / 4) / 60; - - TaitoResetFunction = TaitoDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 Darius2dInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x8000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = Darius2dSpritePlaneOffsets; - TaitoSpriteAXOffsets = Darius2dSpriteXOffsets; - TaitoSpriteAYOffsets = Darius2dSpriteYOffsets; - TaitoNumSpriteA = 0x4000; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - Darius2dMemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - Darius2dMemIndex(); - - GenericTilesInit(); - - TC0100SCNInit(0, TaitoNumChar, 4, 24, 0, NULL); - TC0100SCNSetClipArea(0, 320, nScreenHeight, 0); - TC0100SCNInit(1, TaitoNumChar, 4, 24, 0, NULL); - TC0100SCNSetClipArea(1, 320, nScreenHeight, 320); - TC0100SCNSetPaletteOffset(1, 0x1000); - TC0110PCRInit(2, 0x2000); - TC0140SYTInit(0); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x200000, 0x213fff, MAP_READ); - SekMapMemory(TC0100SCNRam[1] , 0x240000, 0x253fff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x600000, 0x6013ff, MAP_RAM); - SekSetReadByteHandler(0, Darius2d68KReadByte); - SekSetWriteByteHandler(0, Darius2d68KWriteByte); - SekSetReadWordHandler(0, Darius2d68KReadWord); - SekSetWriteWordHandler(0, Darius2d68KWriteWord); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Darius2Z80Read); - ZetSetWriteHandler(Darius2Z80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &Darius2FMIRQHandler, Darius2SynchroniseStream, Darius2GetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.03); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.03); - Darius2YM2610Route1MasterVol = 12.00; - Darius2YM2610Route2MasterVol = 12.00; - bYM2610UseSeperateVolumes = 1; - - TaitoDrawFunction = Darius2dDraw; - TaitoMakeInputsFunction = Darius2dMakeInputs; - TaitoIrqLine = 4; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = (16000000 / 4) / 60; - - TaitoResetFunction = TaitoDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 NinjawInit() -{ - Ninjaw = 1; - return Darius2Init(); -} - -static INT32 WarriorbInit() -{ - INT32 nLen; - - Warriorb = 1; - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x10000; - - TaitoCharBModulo = 0x100; - TaitoCharBNumPlanes = 4; - TaitoCharBWidth = 8; - TaitoCharBHeight = 8; - TaitoCharBPlaneOffsets = CharPlaneOffsets; - TaitoCharBXOffsets = CharXOffsets; - TaitoCharBYOffsets = CharYOffsets; - TaitoNumCharB = 0x10000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = Darius2dSpritePlaneOffsets; - TaitoSpriteAXOffsets = Darius2dSpriteXOffsets; - TaitoSpriteAYOffsets = Darius2dSpriteYOffsets; - TaitoNumSpriteA = 0x8000; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - WarriorbMemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - WarriorbMemIndex(); - - GenericTilesInit(); - - TC0100SCNInit(0, TaitoNumChar, 4, 8, 0, NULL); - TC0100SCNSetClipArea(0, 320, nScreenHeight, 0); - TC0100SCNInit(1, TaitoNumCharB, 5, 8, 0, NULL); - TC0100SCNSetClipArea(1, 320, nScreenHeight, 320); - TC0100SCNSetPaletteOffset(1, 0x1000); - TC0110PCRInit(2, 0x2000); - TC0140SYTInit(0); - TC0510NIOInit(); - - if (TaitoLoadRoms(1)) return 1; - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x200000, 0x213fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x300000, 0x313fff, MAP_READ); - SekMapMemory(TC0100SCNRam[1] , 0x340000, 0x353fff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x600000, 0x6013ff, MAP_RAM); - SekSetReadByteHandler(0, Warriorb68KReadByte); - SekSetWriteByteHandler(0, Warriorb68KWriteByte); - SekSetReadWordHandler(0, Warriorb68KReadWord); - SekSetWriteWordHandler(0, Warriorb68KWriteWord); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(Darius2Z80Read); - ZetSetWriteHandler(Darius2Z80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &Darius2FMIRQHandler, Darius2SynchroniseStream, Darius2GetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - Darius2YM2610Route1MasterVol = 12.00; - Darius2YM2610Route2MasterVol = 12.00; - bYM2610UseSeperateVolumes = 1; - - TaitoDrawFunction = WarriorbDraw; - TaitoMakeInputsFunction = WarriorbMakeInputs; - TaitoIrqLine = 4; - - nTaitoCyclesTotal[0] = 16000000 / 60; - nTaitoCyclesTotal[1] = (16000000 / 4) / 60; - - TaitoResetFunction = TaitoDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 Darius2Exit() -{ - Ninjaw = 0; - Warriorb = 0; - return TaitoExit(); -} - -static void Darius2RenderSprites(INT32 PriorityDraw) -{ - INT32 Offset, Data, Code, Colour, xFlip, yFlip; - INT32 x, y, Priority; - - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - - for (Offset = 0x2000 - 4; Offset >=0; Offset -= 4) { - Data = SpriteRam[Offset + 2]; - Code = Data & (TaitoNumSpriteA - 1); - - if (!Code) continue; - - Data = SpriteRam[Offset + 0]; - x = (Data - 32) & 0x3ff; - - Data = SpriteRam[Offset + 1]; - y = (Data - 0) & 0x1ff; - - Data = SpriteRam[Offset + 3]; - xFlip = (Data & 0x1); - yFlip = (Data & 0x2) >> 1; - Priority = (Data & 0x4) >> 2; - - if (Priority != PriorityDraw) continue; - - Colour = (Data & 0x7f00) >> 8; - - y -= 16; - - if (x > 0x3c0) x -= 0x400; - if (y > 0x180) y -= 0x200; - - if (x > 16 && x < (nScreenWidth - 16) && y > 16 && y < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } - } -} - -static void Darius2dRenderSprites(INT32 PriorityDraw) -{ - INT32 Offset, Data, Code, Colour, xFlip, yFlip; - INT32 x, y, Priority; - - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - -// for (Offset = 0; Offset < 0x001400 / 2; Offset += 4) { - for (Offset = (0x1400 / 2) - 4; Offset >= 0; Offset -= 4) { - Data = SpriteRam[Offset + 1]; - Code = Data & (TaitoNumSpriteA - 1); - - Data = SpriteRam[Offset + 0]; - y = (-(Data & 0x1ff) - 24) & 0x1ff; - yFlip = (Data & 0x200) >> 9; - - Data = SpriteRam[Offset + 2]; - Priority = (Data & 0x100) >> 8; - Colour = Data & 0x7f; - - Data = SpriteRam[Offset + 3]; - x = Data & 0x3ff; - xFlip = (Data & 0x400) >> 10; - - if (Priority != PriorityDraw) continue; - - y -= (Warriorb) ? 8 : 16+8; //darius2d (16+8) - - if (x > 0x3c0) x -= 0x400; - if (y > 0x180) y -= 0x200; - - if (x > 16 && x < (nScreenWidth - 16) && y > 16 && y < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } - } -} - -static void Darius2Draw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - INT32 Disable2 = TC0100SCNCtrl[1][6] & 0xf7; - INT32 Disable3 = TC0100SCNCtrl[2][6] & 0xf7; - - BurnTransferClear(); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (!(Disable2 & 0x02)) TC0100SCNRenderFgLayer(1, 0, TaitoChars); - if (!(Disable3 & 0x02)) TC0100SCNRenderFgLayer(2, 0, TaitoChars); - Darius2RenderSprites(1); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (!(Disable2 & 0x01)) TC0100SCNRenderBgLayer(1, 0, TaitoChars); - if (!(Disable3 & 0x01)) TC0100SCNRenderBgLayer(2, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (!(Disable2 & 0x01)) TC0100SCNRenderBgLayer(1, 0, TaitoChars); - if (!(Disable3 & 0x01)) TC0100SCNRenderBgLayer(2, 0, TaitoChars); - Darius2RenderSprites(1); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (!(Disable2 & 0x02)) TC0100SCNRenderFgLayer(1, 0, TaitoChars); - if (!(Disable3 & 0x02)) TC0100SCNRenderFgLayer(2, 0, TaitoChars); - } - - Darius2RenderSprites(0); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - if (!(Disable2 & 0x04)) TC0100SCNRenderCharLayer(1); - if (!(Disable3 & 0x04)) TC0100SCNRenderCharLayer(2); - BurnTransferCopy(TC0110PCRPalette); -} - -static void Darius2dDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - INT32 Disable2 = TC0100SCNCtrl[1][6] & 0xf7; - - BurnTransferClear(); - - if (TC0100SCNBottomLayer(0)) { - if (nBurnLayer & 2) if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (nBurnLayer & 2) if (!(Disable2 & 0x02)) TC0100SCNRenderFgLayer(1, 0, TaitoChars); - if (nSpriteEnable & 1) Darius2dRenderSprites(1); - if (nBurnLayer & 1) if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (nBurnLayer & 1) if (!(Disable2 & 0x01)) TC0100SCNRenderBgLayer(1, 0, TaitoChars); - } else { - if (nBurnLayer & 1) if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (nBurnLayer & 1) if (!(Disable2 & 0x01)) TC0100SCNRenderBgLayer(1, 0, TaitoChars); - if (nSpriteEnable & 1) Darius2dRenderSprites(1); - if (nBurnLayer & 2) if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (nBurnLayer & 2) if (!(Disable2 & 0x02)) TC0100SCNRenderFgLayer(1, 0, TaitoChars); - } - - if (nSpriteEnable & 2) Darius2dRenderSprites(0); - - if (nBurnLayer & 4) if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - if (nBurnLayer & 8) if (!(Disable2 & 0x04)) TC0100SCNRenderCharLayer(1); - BurnTransferCopy(TC0110PCRPalette); -} - -static void WarriorbDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - INT32 Disable2 = TC0100SCNCtrl[1][6] & 0xf7; - - BurnTransferClear(); - - if (TC0100SCNBottomLayer(0)) { - if (nBurnLayer & 2) if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (nBurnLayer & 2) if (!(Disable2 & 0x02)) TC0100SCNRenderFgLayer(1, 0, TaitoCharsB); - if (nSpriteEnable & 1) Darius2dRenderSprites(1); - if (nBurnLayer & 1) if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (nBurnLayer & 1) if (!(Disable2 & 0x01)) TC0100SCNRenderBgLayer(1, 0, TaitoCharsB); - } else { - if (nBurnLayer & 1) if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (nBurnLayer & 1) if (!(Disable2 & 0x01)) TC0100SCNRenderBgLayer(1, 0, TaitoCharsB); - if (nSpriteEnable & 1) Darius2dRenderSprites(1); - if (nBurnLayer & 2) if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (nBurnLayer & 2) if (!(Disable2 & 0x02)) TC0100SCNRenderFgLayer(1, 0, TaitoCharsB); - } - - if (nSpriteEnable & 2) Darius2dRenderSprites(0); - - if (nBurnLayer & 4) if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - if (nBurnLayer & 8) if (!(Disable2 & 0x04)) TC0100SCNRenderCharLayer(1); - BurnTransferCopy(TC0110PCRPalette); -} - -static INT32 Darius2Frame() -{ - INT32 nInterleave = 100; - - if (TaitoReset) TaitoResetFunction(); - - TaitoMakeInputsFunction(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = nTaitoCyclesDone[2] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 # 1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == nInterleave - 1) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run 68000 # 2 - if ((TaitoCpuACtrl & 0x01)) { - nCurrentCPU = 1; - SekOpen(1); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == nInterleave - 1) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - ZetOpen(0); - BurnTimerUpdate(i * (nTaitoCyclesTotal[2] / nInterleave)); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[2]); - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) TaitoDrawFunction(); - - return 0; -} - -static INT32 Darius2dFrame() -{ - INT32 nInterleave = 100; - - if (TaitoReset) TaitoResetFunction(); - - TaitoMakeInputsFunction(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[2] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 # 1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == nInterleave - 1) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - - ZetOpen(0); - BurnTimerUpdate(i * (nTaitoCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) TaitoDrawFunction(); - - return 0; -} - -static INT32 Darius2Scan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029684; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd-TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - TaitoICScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - if (TaitoNumYM2610) BurnYM2610Scan(nAction, pnMin); - - SCAN_VAR(TaitoInput); - SCAN_VAR(TaitoZ80Bank); - SCAN_VAR(nTaitoCyclesDone); - SCAN_VAR(nTaitoCyclesSegment); - } - - if (nAction & ACB_WRITE && TaitoZ80Bank) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetClose(); - } - - return 0; -} - -struct BurnDriver BurnDrvDarius2 = { - "darius2", NULL, NULL, NULL, "1989", - "Darius II (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, Darius2RomInfo, Darius2RomName, NULL, NULL, Darius2InputInfo, Darius2DIPInfo, - Darius2Init, Darius2Exit, Darius2Frame, NULL, Darius2Scan, - NULL, 0x3000, 864, 224, 12, 3 -}; - -struct BurnDriver BurnDrvDarius2d = { - "darius2d", "darius2", NULL, NULL, "1989", - "Darius II (dual screen) (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, Darius2dRomInfo, Darius2dRomName, NULL, NULL, Darius2dInputInfo, Darius2dDIPInfo, - Darius2dInit, Darius2Exit, Darius2dFrame, NULL, Darius2Scan, - NULL, 0x2000, 640, 224, 8, 3 -}; - -struct BurnDriver BurnDrvDarius2do = { - "darius2do", "darius2", NULL, NULL, "1989", - "Darius II (dual screen) (Japan old version)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, Darius2doRomInfo, Darius2doRomName, NULL, NULL, Darius2dInputInfo, Darius2dDIPInfo, - Darius2dInit, Darius2Exit, Darius2dFrame, NULL, Darius2Scan, - NULL, 0x2000, 640, 224, 8, 3 -}; - -struct BurnDriver BurnDrvNinjaw = { - "ninjaw", NULL, NULL, NULL, "1987", - "The Ninja Warriors (World)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, NinjawRomInfo, NinjawRomName, NULL, NULL, Darius2InputInfo, NinjawDIPInfo, - NinjawInit, Darius2Exit, Darius2Frame, NULL, Darius2Scan, - NULL, 0x3000, 864, 224, 12, 3 -}; - -struct BurnDriver BurnDrvNinjawj = { - "ninjawj", "ninjaw", NULL, NULL, "1987", - "The Ninja Warriors (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, NinjawjRomInfo, NinjawjRomName, NULL, NULL, Darius2InputInfo, NinjawjDIPInfo, - NinjawInit, Darius2Exit, Darius2Frame, NULL, Darius2Scan, - NULL, 0x3000, 864, 224, 12, 3 -}; - -struct BurnDriver BurnDrvNinjawu = { - "ninjawu", "ninjaw", NULL, NULL, "1987", - "The Ninja Warriors (US)\0", NULL, "Taito Corporation America (licensed to Romstar)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, NinjawuRomInfo, NinjawuRomName, NULL, NULL, Darius2InputInfo, NinjawjDIPInfo, - NinjawInit, Darius2Exit, Darius2Frame, NULL, Darius2Scan, - NULL, 0x3000, 864, 224, 12, 3 -}; - -struct BurnDriver BurnDrvWarriorb = { - "warriorb", NULL, NULL, NULL, "1991", - "Warrior Blade - Rastan Saga Episode III (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, WarriorbRomInfo, WarriorbRomName, NULL, NULL, WarriorbInputInfo, WarriorbDIPInfo, - WarriorbInit, Darius2Exit, Darius2dFrame, NULL, Darius2Scan, - NULL, 0x2000, 640, 240, 8, 3 -}; diff --git a/jan/src/burn/drv/taito/d_darkmist.cpp b/jan/src/burn/drv/taito/d_darkmist.cpp deleted file mode 100644 index 41190097b..000000000 --- a/jan/src/burn/drv/taito/d_darkmist.cpp +++ /dev/null @@ -1,900 +0,0 @@ -// FB Alpha The Lost Castle in Darkmist driver module -// Based on MAME driver by David Haywood, Nicola Salmoria, and Tomasz Slanina - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "t5182.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80ROMDec; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvGfxROM4; -static UINT8 *DrvColPROM; -static UINT16 *DrvColTable; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvScrollRAM; -static UINT8 *DrvPalRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *sprite_bank; -static UINT8 *z80_bank; -static UINT8 *layer_enable; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[2]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo DarkmistInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 4, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Darkmist) - -static struct BurnDIPInfo DarkmistDIPList[]= -{ - {0x11, 0xff, 0xff, 0xe7, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - {0x13, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x00, "5 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x04, "4 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x02, "3 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x06, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x07, 0x07, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x05, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 5 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x12, 0x01, 0x18, 0x10, "2 Coins 1 Credits" }, - {0x12, 0x01, 0x18, 0x18, "1 Coin 1 Credits" }, - {0x12, 0x01, 0x18, 0x00, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x18, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x12, 0x01, 0x20, 0x20, "Off" }, - {0x12, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x12, 0x01, 0x80, 0x80, "No" }, - {0x12, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x06, 0x06, "Easy" }, - {0x13, 0x01, 0x06, 0x04, "Normal" }, - {0x13, 0x01, 0x06, 0x02, "Hard" }, - {0x13, 0x01, 0x06, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x18, 0x18, "1" }, - {0x13, 0x01, 0x18, 0x10, "2" }, - {0x13, 0x01, 0x18, 0x08, "3" }, - {0x13, 0x01, 0x18, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x60, 0x20, "10K / 20K" }, - {0x13, 0x01, 0x60, 0x60, "20K / 40K" }, - {0x13, 0x01, 0x60, 0x40, "30K / 60K" }, - {0x13, 0x01, 0x60, 0x00, "40K / 80K" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Darkmist) - -static void bankswitch(INT32 data) -{ - *z80_bank = data; - - INT32 nBank = (data & 0x80) ? 0x14000 : 0x10000; - - ZetMapMemory(DrvZ80ROM + nBank, 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall darkmist_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0xd000) { - if (data != DrvPalRAM[address & 0x3ff]) { - DrvPalRAM[address & 0x3ff] = data; - DrvRecalc = 1; - } - return; - } - - if ((address & 0xff80) == 0xd600) { - t5182SharedRAM[address & 0x7f] = data; - return; - } - - switch (address) - { - case 0xc804: - *layer_enable = data; - bankswitch(data); - return; - - case 0xc805: - *sprite_bank = data; - return; - - case 0xd680: - ZetClose(); - ZetOpen(1); - t5182_setirq_callback(CPU_ASSERT); - ZetClose(); - ZetOpen(0); - return; - - case 0xd682: - case 0xd683: - t5182_semaphore_main = ~address & 1; - return; - } -} - -static UINT8 __fastcall darkmist_main_read(UINT16 address) -{ - if ((address & 0xff80) == 0xd600) { - return t5182SharedRAM[address & 0x7f]; - } - - switch (address) - { - case 0xc801: - return DrvInputs[0]; - - case 0xc802: - return DrvInputs[1]; - - case 0xc803: - return (DrvInputs[2] & ~0xe7) | (DrvDips[0] & 0xe7); - - case 0xc806: - return DrvDips[1]; - - case 0xc807: - return DrvDips[2]; - - case 0xc808: - return 0xff; // unknown - - case 0xd681: - return t5182_semaphore_snd; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - t5182Reset(); - - DrvRecalc = 1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x018000; - DrvZ80ROMDec = Next; Next += 0x008000; - - t5182ROM = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x008000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x080000; - DrvGfxROM3 = Next; Next += 0x020000; - DrvGfxROM4 = Next; Next += 0x020000; - - DrvColPROM = Next; Next += 0x000400; - DrvColTable = (UINT16*)Next; Next += 0x0400 * sizeof(UINT16); - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvPalRAM = Next; Next += 0x000400; - DrvScrollRAM = Next; Next += 0x000100; - DrvZ80RAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x001000; - - t5182SharedRAM = Next; Next += 0x000100; - - layer_enable = Next; Next += 0x000001; - z80_bank = Next; Next += 0x000001; - sprite_bank = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void decrypt_prg() -{ - for (INT32 i = 0; i < 0x8000; i++) - { - UINT8 p, d; - p = d = DrvZ80ROM[i]; - - if (((i & 0x20) == 0x00) && ((i & 0x8) != 0)) - p ^= 0x20; - - if (((i & 0x20) == 0x00) && ((i & 0xa) != 0)) - d ^= 0x20; - - if (((i & 0x200) == 0x200) && ((i & 0x408) != 0)) - p ^= 0x10; - - if ((i & 0x220) != 0x200) - { - p = BITSWAP08(p, 7,6,5,2,3,4,1,0); - d = BITSWAP08(d, 7,6,5,2,3,4,1,0); - } - - DrvZ80ROM[i] = d; - DrvZ80ROMDec[i] = p; - } -} - -static void decrypt_gfx() -{ - UINT8 *rom = DrvGfxROM0; - INT32 size = 0x4000; - UINT8 *buf = (UINT8*)BurnMalloc(0x40000); - - for (INT32 i = 0;i < size/2;i++) - { - INT32 w1; - - w1 = (rom[i + 0*size/2] << 8) + rom[i + 1*size/2]; - - w1 = BITSWAP16(w1, 9,14,7,2, 6,8,3,15,10,13,5,12,0,11,4,1); - - buf[i + 0*size/2] = w1 >> 8; - buf[i + 1*size/2] = w1 & 0xff; - } - - for (INT32 i = 0;i < size;i++) - { - rom[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,12,3,2,1,11,10,9,8,0,7,6,5,4)]; - } - - rom = DrvGfxROM1; - size = 0x40000; - - for (INT32 i = 0;i < size/2;i++) - { - INT32 w1; - - w1 = (rom[i + 0*size/2] << 8) + rom[i + 1*size/2]; - - w1 = BITSWAP16(w1, 9,14,7,2, 6,8,3,15,10,13,5,12,0,11,4,1); - - buf[i + 0*size/2] = w1 >> 8; - buf[i + 1*size/2] = w1 & 0xff; - } - - for (INT32 i = 0;i < size;i++) - { - rom[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,5,4,3,2,12,11,10,9,8,1,0,7,6)]; - } - - rom = DrvGfxROM2; - size = 0x40000; - - for (INT32 i = 0;i < size/2;i++) - { - INT32 w1; - - w1 = (rom[i + 0*size/2] << 8) + rom[i + 1*size/2]; - - w1 = BITSWAP16(w1, 9,14,7,2,6,8,3,15,10,13,5,12,0,11,4,1); - - buf[i + 0*size/2] = w1 >> 8; - buf[i + 1*size/2] = w1 & 0xff; - } - - for (INT32 i = 0;i < size;i++) - { - rom[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,12,11,10,9,8,5,4,3,13,7,6,1,0,2)]; - } - - rom = DrvGfxROM3; - size = 0x10000; - - memcpy( buf, rom, size ); - - for (INT32 i = 0;i < size;i++) - { - rom[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,16,15,6,5,4,3,2,14,13,12,11,8,7,1,0,10,9)]; - } - - rom = DrvGfxROM4; - size = 0x08000; - - memcpy( buf, rom, size ); - - for (INT32 i = 0;i < size;i++) - { - rom[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,5,4,3,2,11,10,9,8,13,12,1,0,7,6)]; - } - - BurnFree(buf); -} - -static void decrypt_snd() -{ - for (INT32 i = 0x8000; i < 0x10000; i++) - { - t5182ROM[i] = BITSWAP08(t5182ROM[i], 7,1,2,3,4,5,6,0); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[4] = { 0, 4, RGN_FRAC(0x04000, 1,2), RGN_FRAC(0x04000, 1,2)+4 }; - INT32 Plane1[4] = { 0, 4, RGN_FRAC(0x40000, 1,2), RGN_FRAC(0x40000, 1,2)+4 }; - INT32 Plane2[4] = { 0, 4, RGN_FRAC(0x40000, 1,2), RGN_FRAC(0x40000, 1,2)+4 }; - INT32 XOffs[16] = { STEP4(0,1), STEP4(8,1), STEP4(16,1), STEP4(24,1) }; - INT32 YOffs0[8] = { STEP8(0,16) }; - INT32 YOffs1[16] = { STEP16(0,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x04000); - - GfxDecode(0x0200, 4, 8, 8, Plane0, XOffs, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs, YOffs1, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane2, XOffs, YOffs1, 0x200, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x400; i++) - { - int ctabentry; - - if (DrvColPROM[i] & 0x40) - ctabentry = 0x100; - else - { - ctabentry = (DrvColPROM[i] & 0x3f); - - switch (i & 0x300) - { - case 0x000: ctabentry = ctabentry | 0x80; break; - case 0x100: ctabentry = ctabentry | 0x00; break; - case 0x200: ctabentry = ctabentry | 0x40; break; - case 0x300: ctabentry = ctabentry | 0xc0; break; - } - } - - DrvColTable[i] = ctabentry; - } -} - -static INT32 DrvInit() -{ - BurnSetRefreshRate(60.00); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(t5182ROM + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(t5182ROM + 0x08000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x20000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x30000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x08000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM4 + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM4 + 0x04000, 17, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 18, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 19, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00300, 21, 1)) return 1; - - decrypt_prg(); - decrypt_gfx(); - decrypt_snd(); - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80ROMDec, 0x0000, 0x7fff, MAP_FETCHOP); - ZetMapMemory(DrvPalRAM, 0xd000, 0xd3ff, MAP_ROM); - ZetMapMemory(DrvScrollRAM, 0xd400, 0xd4ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xd800, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xf000, 0xffff, MAP_RAM); - ZetSetWriteHandler(darkmist_main_write); - ZetSetReadHandler(darkmist_main_read); - ZetClose(); - - t5182Init(1, 14318180/4); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - t5182Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT32 p[0x101]; - - p[0x100] = 0; - - for (INT32 i = 0; i < 0x100; i++) { - INT32 r = DrvPalRAM[i+0x200] & 0x0f; - INT32 g = DrvPalRAM[i+0x000] >> 4; - INT32 b = DrvPalRAM[i+0x000] & 0x0f; - - p[i] = BurnHighCol(r+(r*16), g+(g*16), b+(b*16), 0); - } - - for (INT32 i = 0; i < 0x400; i++) { - DrvPalette[i] = p[DrvColTable[i]]; - } -} - -static void draw_bg_layer() -{ - INT32 scrollx = ((DrvScrollRAM[0x02]<<1)&0xfe) + (DrvScrollRAM[0x02]>>7) + ((DrvScrollRAM[0x01]&0xf0)<<4) + ((DrvScrollRAM[0x01]&0x01)<<12); - INT32 scrolly = ((DrvScrollRAM[0x06]<<1)&0xfe) + (DrvScrollRAM[0x06]>>7) + ((DrvScrollRAM[0x05]&0x30)<<4); - - scrolly = (scrolly + 16) & 0x3ff; - -#if 1 - INT32 scrx0 = scrollx >> 4; - INT32 scry0 = scrolly >> 4; - INT32 scrx1 = scrollx & 0x0f; - INT32 scry1 = scrolly & 0x0f; - INT32 scrx2 = scrx1 ? 1 : 0; - INT32 scry2 = scry1 ? 1 : 0; - - for (INT32 y = 0; y < 14 + scry2; y++) - { - INT32 sy = (((scry0 + y) & 0x3f) * 0x200); - - for (INT32 x = 0; x < 16 + scrx2; x++) - { - INT32 offs = sy + ((scrx0 + x) & 0x1ff); - - INT32 attr = DrvGfxROM3[offs + 0x8000]; - INT32 code = DrvGfxROM3[offs] + ((attr & 0x03) * 256); - INT32 color = attr >> 4; - - if (y == 0 || y >= 14 || x == 0 || x >= 16) - Render16x16Tile_Clip(pTransDraw, code, (x*16) - scrx1, (y*16) - scry1, color, 4, 0x000, DrvGfxROM1); - else - Render16x16Tile(pTransDraw, code, (x*16) - scrx1, (y*16) - scry1, color, 4, 0x000, DrvGfxROM1); - } - } -#else - for (INT32 offs = 0; offs < 512 * 64; offs++) - { - INT32 sx = (offs & 0x1ff) * 16; - INT32 sy = (offs / 0x200) * 16; - - sx -= scrollx; - if (sx < -15) sx += 512 * 16; - sy -= scrolly; - if (sy < -15) sy += 64 * 16; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvGfxROM3[offs + 0x8000]; - INT32 code = DrvGfxROM3[offs] + ((attr & 0x03) * 256); - INT32 color = attr >> 4; - - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0x000, DrvGfxROM1); - } -#endif -} - -static void draw_fg_layer() -{ - INT32 scrollx = ((DrvScrollRAM[0x0a]<<1)&0xfe) + (DrvScrollRAM[0x0a]>>7) + ((DrvScrollRAM[0x09]&0x30)<<4); - INT32 scrolly = ((DrvScrollRAM[0x0e]<<1)&0xfe) + (DrvScrollRAM[0x0e]>>7) + ((DrvScrollRAM[0x0d]&0xf0)<<4); - - scrolly = (scrolly + 16) & 0xfff; - -#if 1 - INT32 scrx0 = scrollx >> 4; - INT32 scry0 = scrolly >> 4; - INT32 scrx1 = scrollx & 0x0f; - INT32 scry1 = scrolly & 0x0f; - INT32 scrx2 = scrx1 ? 1 : 0; - INT32 scry2 = scry1 ? 1 : 0; - - for (INT32 y = 0; y < 14 + scry2; y++) - { - INT32 sy = (((scry0 + y) & 0xff) * 0x40); - - for (INT32 x = 0; x < 16 + scrx2; x++) - { - INT32 offs = sy + ((scrx0 + x) & 0x3f); - - INT32 attr = DrvGfxROM4[offs + 0x4000]; - INT32 code = DrvGfxROM4[offs] + ((attr & 0x03) * 256) + 0x400; - INT32 color = attr >> 4; - - if (y == 0 || y >= 14 || x == 0 || x >= 16) - Render16x16Tile_Mask_Clip(pTransDraw, code, (x*16) - scrx1, (y*16) - scry1, color, 4, 0, 0x100, DrvGfxROM1); - else - Render16x16Tile_Mask(pTransDraw, code, (x*16) - scrx1, (y*16) - scry1, color, 4, 0, 0x100, DrvGfxROM1); - } - } -#else - for (INT32 offs = 0; offs < 64 * 256; offs++) - { - INT32 sx = (offs & 0x3f) * 16; - INT32 sy = (offs / 0x40) * 16; - - sx -= scrollx; - if (sx < -15) sx += 64 * 16; - sy -= scrolly; - if (sy < -15) sy += 256 * 16; - - if (sx >= nScreenWidth || sy >= nScreenHeight) continue; - - INT32 attr = DrvGfxROM4[offs + 0x4000]; - INT32 code = DrvGfxROM4[offs] + ((attr & 0x03) * 256) + 0x400; - INT32 color = attr >> 4; - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0x100, DrvGfxROM1); - } -#endif -} - -static void draw_txt_layer() -{ - for (INT32 offs = 32 * 2; offs < (32 * 32) - (32 * 2); offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - INT32 attr = DrvVidRAM[offs + 0x400]; - INT32 code = DrvVidRAM[offs] + ((attr & 0x01) * 256); - INT32 color = attr >> 1; - - if (code == 0) continue; // not thoroughly tested... - - Render8x8Tile_Mask(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x300, DrvGfxROM0); - } -} - -static void draw_sprites() -{ - for (INT32 i = 0; i < 0x1000; i+=0x20) - { - INT32 sx = DrvSprRAM[i + 0x03]; - INT32 sy = DrvSprRAM[i + 0x02]; - INT32 attr = DrvSprRAM[i + 0x01]; - INT32 code = DrvSprRAM[i + 0x00]; - INT32 color = (attr & 0x1e) >> 1; - INT32 flipy = attr & 0x40; - INT32 flipx = attr & 0x80; - - //if (attr & 0x20) code += *sprite_bank * 256; - if (attr & 0x20) code += (*sprite_bank & 0x07) * 256; - - if (attr & 0x01) color = rand() & 0x0f; // ? - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x200, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x200, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy - 16, color, 4, 0, 0x200, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalc = 0; - DrvPaletteUpdate(); - } - - if ((*layer_enable & 0x04) == 0) { - BurnTransferClear(); - } - - if (*layer_enable & 0x04) draw_bg_layer(); - if (*layer_enable & 0x02) draw_fg_layer(); - if (*layer_enable & 0x01) draw_sprites(); - if (*layer_enable & 0x10) draw_txt_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - t5182_coin_input = (DrvJoy4[0] << 0) | (DrvJoy4[1] << 1); - } - - INT32 nSegment; - INT32 nInterleave = 16; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 4000000 / 60, 63079 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - - nSegment = ((nCyclesTotal[0] / nInterleave) * (i + 1)) - ZetTotalCycles(); - - nCyclesDone[0] += ZetRun(nSegment); - - if (i == 0) { - ZetSetVector(0x08); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - if (i == 15) { - ZetSetVector(0x10); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - } - - ZetClose(); - - ZetOpen(1); // t5182 - - nSegment = ((nCyclesTotal[1] / nInterleave) * (i + 1)) - ZetTotalCycles(); - - nCyclesDone[1] += ZetRun(nSegment); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - - ZetClose(); - } - - ZetOpen(1); // t5182 - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029729; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - t5182Scan(nAction); - } - - if (nAction & ACB_WRITE) { - DrvRecalc = 1; - } - - return 0; -} - - - -// The Lost Castle In Darkmist - -static struct BurnRomInfo darkmistRomDesc[] = { - { "dm_15.rom", 0x08000, 0x21e6503c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "dm_16.rom", 0x08000, 0x094579d9, 1 | BRF_PRG | BRF_ESS }, // 1 - -#if !defined (ROM_VERIFY) - { "t5182.rom", 0x02000, 0xd354c8fc, 2 | BRF_PRG | BRF_ESS }, // 2 t5182 (Z80 #1) Code -#else - { "", 0x00000, 0x00000000, 2 | BRF_PRG | BRF_ESS }, // 2 t5182 (Z80 #1) Code -#endif - - { "dm_17.rom", 0x08000, 0x7723dcae, 2 | BRF_PRG | BRF_ESS }, // 3 - - { "dm_13.rom", 0x02000, 0x38bb38d9, 3 | BRF_GRA }, // 4 Characters - { "dm_14.rom", 0x02000, 0xac5a31f3, 3 | BRF_GRA }, // 5 - - { "dm_05.rom", 0x10000, 0xca79a738, 4 | BRF_GRA }, // 6 Background & foreground tiles - { "dm_01.rom", 0x10000, 0x652aee6b, 4 | BRF_GRA }, // 7 - { "dm_06.rom", 0x10000, 0x9629ed2c, 4 | BRF_GRA }, // 8 - { "dm_02.rom", 0x10000, 0xe2dd15aa, 4 | BRF_GRA }, // 9 - - { "dm_09.rom", 0x10000, 0x52154b50, 5 | BRF_GRA }, // 10 Sprites - { "dm_11.rom", 0x08000, 0x3118e2f9, 5 | BRF_GRA }, // 11 - { "dm_10.rom", 0x10000, 0x34fd52b5, 5 | BRF_GRA }, // 12 - { "dm_12.rom", 0x08000, 0xcc4b9839, 5 | BRF_GRA }, // 13 - - { "dm_03.rom", 0x08000, 0x60b40c2a, 6 | BRF_GRA }, // 14 Background tile map - { "dm_04.rom", 0x08000, 0xd47b8cd9, 6 | BRF_GRA }, // 15 - - { "dm_07.rom", 0x04000, 0x889b1277, 7 | BRF_GRA }, // 16 Foreground tile map - { "dm_08.rom", 0x04000, 0xf76f6f46, 7 | BRF_GRA }, // 17 - - { "63s281n.m7", 0x00100, 0x897ef49f, 8 | BRF_GRA }, // 18 Color Proms - { "63s281n.d7", 0x00100, 0xa9975a96, 8 | BRF_GRA }, // 19 - { "63s281n.f11", 0x00100, 0x8096b206, 8 | BRF_GRA }, // 20 - { "63s281n.j15", 0x00100, 0x2ea780a4, 8 | BRF_GRA }, // 21 - - { "63s281n.l1", 0x00100, 0x208d17ca, 0 | BRF_OPT }, // 22 Unknown Proms - { "82s129.d11", 0x00100, 0x866eab0e, 0 | BRF_OPT }, // 23 -}; - -STD_ROM_PICK(darkmist) -STD_ROM_FN(darkmist) - -struct BurnDriver BurnDrvDarkmist = { - "darkmist", NULL, NULL, NULL, "1986", - "The Lost Castle In Darkmist\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, darkmistRomInfo, darkmistRomName, NULL, NULL, DarkmistInputInfo, DarkmistDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 224, 256, 3, 4 -}; - - diff --git a/jan/src/burn/drv/taito/d_exzisus.cpp b/jan/src/burn/drv/taito/d_exzisus.cpp deleted file mode 100644 index a7bf85abc..000000000 --- a/jan/src/burn/drv/taito/d_exzisus.cpp +++ /dev/null @@ -1,850 +0,0 @@ -// FB Alpha Exzisus driver module -// Based on MAME driver by Yochizo - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "taito_ic.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvZ80ROM3; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvZ80RAM3; -static UINT8 *DrvSharedRAMAB; -static UINT8 *DrvSharedRAMAC; -static UINT8 *DrvObjRAM0; -static UINT8 *DrvObjRAM1; -static UINT8 *DrvVidRAM0; -static UINT8 *DrvVidRAM1; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *flipscreen; -static UINT8 *nBank; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo ExzisusInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 3, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 2, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 3, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 2, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Exzisus) - -static struct BurnDIPInfo ExzisusDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "100k and every 150k" }, - {0x14, 0x01, 0x0c, 0x0c, "150k and every 200k" }, - {0x14, 0x01, 0x0c, 0x04, "150k" }, - {0x14, 0x01, 0x0c, 0x00, "200k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Service Mode (buggy)" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Exzisus) - -static void bankswitch(INT32 cpu, INT32 data) -{ - if ((data & 0x0f) >= 2) - { - nBank[cpu] = (data & 0x0f); - - ZetMapMemory((cpu ? DrvZ80ROM1 : DrvZ80ROM0) + ((nBank[cpu] - 2) * 0x4000) + 0x8000, 0x8000, 0xbfff, MAP_ROM); - } - - *flipscreen = data & 0x40; -} - -static void __fastcall exzisus_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf400: - bankswitch(0, data); - return; - - case 0xf404: - ZetClose(); - ZetOpen(2); - ZetReset(); - ZetClose(); - ZetOpen(0); - return; - } -} - -static void __fastcall exzisus_cpub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf000: - ZetClose(); - TC0140SYTPortWrite(data); - ZetOpen(0); - return; - - case 0xf001: - ZetClose(); - TC0140SYTCommWrite(data); - ZetOpen(0); - return; - - case 0xf400: - bankswitch(1, data); - return; - - case 0xf402: - // coin counter - return; - - case 0xf404: - // nop - return; - } -} - -static UINT8 __fastcall exzisus_cpub_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - return 0; // nop - - case 0xf001: - return TC0140SYTCommRead(); - - case 0xf400: - return DrvInputs[0]; - - case 0xf401: - return DrvInputs[1]; - - case 0xf402: - return DrvInputs[2] ^ 0x30; // coins high - - case 0xf404: - case 0xf405: - return DrvDips[address & 1]; - } - - return 0; -} - -static void __fastcall exzisus_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - BurnYM2151SelectRegister(data); - return; - - case 0x9001: - BurnYM2151WriteRegister(data); - return; - - case 0xa000: - TC0140SYTSlavePortWrite(data); - return; - - case 0xa001: - TC0140SYTSlaveCommWrite(data); - return; - } -} - -static UINT8 __fastcall exzisus_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9000: - case 0x9001: - return BurnYM2151ReadStatus(); - - case 0xa001: - return TC0140SYTSlaveCommRead(); - } - - return 0; -} - -static void exzisusYM2151IrqHandler(INT32 state) -{ - ZetSetIRQLine(0, (state) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - ZetOpen(2); - ZetReset(); - ZetClose(); - - ZetOpen(3); - ZetReset(); - BurnYM2151Reset(); - TC0140SYTReset(); - ZetClose(); - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x030000; - DrvZ80ROM2 = Next; Next += 0x008000; - DrvZ80ROM3 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x100000; - DrvGfxROM1 = Next; Next += 0x100000; - - DrvColPROM = Next; Next += 0x000c00; - - DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM1 = Next; Next += 0x001000; - DrvZ80RAM2 = Next; Next += 0x001000; - DrvZ80RAM3 = Next; Next += 0x001000; - - DrvSharedRAMAB = Next; Next += 0x000800; - DrvSharedRAMAC = Next; Next += 0x001000; - - DrvObjRAM0 = Next; Next += 0x000600; - DrvObjRAM1 = Next; Next += 0x000600; - DrvVidRAM0 = Next; Next += 0x001a00; - DrvVidRAM1 = Next; Next += 0x001a00; - - flipscreen = Next; Next += 0x000001; - nBank = Next; Next += 0x000002; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode(UINT8 *rom) -{ - INT32 Plane[4] = { 0x40000*8, 0x40000*8+4, 0, 4 }; - INT32 XOffs[8] = { STEP4(3, -1), STEP4(8+3,-1) }; - INT32 YOffs[8] = { STEP8(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x80000; i++) { - tmp[i] = rom[i] ^ 0xff; - } - - GfxDecode((0x80000 * 2) / 0x40, 4, 8, 8, Plane, XOffs, YOffs, 0x80, tmp, rom); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x400; i++) - { - int bit0,bit1,bit2,bit3,r,g,b; - - bit0 = (DrvColPROM[i + 0x000] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x000] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x000] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x000] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x400] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x400] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x400] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x400] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - bit0 = (DrvColPROM[i + 0x800] >> 0) & 0x01; - bit1 = (DrvColPROM[i + 0x800] >> 1) & 0x01; - bit2 = (DrvColPROM[i + 0x800] >> 2) & 0x01; - bit3 = (DrvColPROM[i + 0x800] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvInit(INT32 bigcolprom) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x10000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x20000, 4, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM3 + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x20000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x50000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x60000, 12, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x40000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x50000, 16, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 17, 1)) return 1; - - if (bigcolprom) { - if (BurnLoadRom(DrvColPROM + 0x00400, 18, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 19, 1)) return 1; - } else { - if (BurnLoadRom(DrvColPROM + 0x00100, 18, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00400, 19, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00500, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00800, 21, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00900, 22, 1)) return 1; - } - - DrvGfxDecode(DrvGfxROM0); - DrvGfxDecode(DrvGfxROM1); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvSharedRAMAC, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvObjRAM1, 0xc000, 0xc5ff, MAP_RAM); - ZetMapMemory(DrvVidRAM1, 0xc600, 0xdfff, MAP_RAM); - ZetMapMemory(DrvSharedRAMAB, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(exzisus_main_write); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvObjRAM0, 0xc000, 0xc5ff, MAP_RAM); - ZetMapMemory(DrvVidRAM0, 0xc600, 0xdfff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1, 0xe000, 0xefff, MAP_RAM); - ZetMapMemory(DrvSharedRAMAB, 0xf800, 0xffff, MAP_RAM); - ZetSetWriteHandler(exzisus_cpub_write); - ZetSetReadHandler(exzisus_cpub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvObjRAM1, 0x8000, 0x85ff, MAP_RAM); - ZetMapMemory(DrvVidRAM1, 0x8600, 0x9fff, MAP_RAM); - ZetMapMemory(DrvSharedRAMAC, 0xa000, 0xafff, MAP_RAM); - ZetMapMemory(DrvZ80RAM2, 0xb000, 0xbfff, MAP_RAM); - ZetClose(); - - ZetInit(3); - ZetOpen(3); - ZetMapMemory(DrvZ80ROM3, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM3, 0x8000, 0x8fff, MAP_RAM); - ZetSetWriteHandler(exzisus_sound_write); - ZetSetReadHandler(exzisus_sound_read); - ZetClose(); - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&exzisusYM2151IrqHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.50, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.50, BURN_SND_ROUTE_RIGHT); - - TC0140SYTInit(3); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - TC0140SYTReset(); - BurnYM2151Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void TC0010VCU(UINT8 *ObjRAM, UINT8 *VidRAM, UINT8 *gfx, INT32 color_offset) -{ - int offs; - int sx, sy, xc, yc; - int gfx_num, gfx_attr, gfx_offs; - - sx = 0; - for (offs = 0 ; offs < 0x600; offs += 4) - { - int height; - - if ( !(*(UINT32 *)(&ObjRAM[offs])) ) - { - continue; - } - - gfx_num = ObjRAM[offs + 1]; - gfx_attr = ObjRAM[offs + 3]; - - if ((gfx_num & 0x80) == 0) - { - gfx_offs = ((gfx_num & 0x7f) << 3); - height = 2; - - sx = ObjRAM[offs + 2]; - sx |= (gfx_attr & 0x40) << 2; - } - else - { - gfx_offs = ((gfx_num & 0x3f) << 7) + 0x0400; - height = 32; - - if (gfx_num & 0x40) - { - sx += 16; - } - else - { - sx = ObjRAM[offs + 2]; - sx |= (gfx_attr & 0x40) << 2; - } - } - - sy = 256 - (height << 3) - (ObjRAM[offs]); - - for (xc = 0 ; xc < 2 ; xc++) - { - int goffs = gfx_offs; - for (yc = 0 ; yc < height ; yc++) - { - int code, color, x, y; - - code = (VidRAM[goffs + 1] << 8) | VidRAM[goffs]; - color = (VidRAM[goffs + 1] >> 6) | (gfx_attr & 0x0f); - x = (sx + (xc << 3)) & 0xff; - y = (sy + (yc << 3)) & 0xff; - - if (*flipscreen) - { - x = 248 - x; - y = 248 - y; - - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code & 0x3fff, x, y - 16, color, 4, 0xf, color_offset, gfx); - } - else - { - Render8x8Tile_Mask_Clip(pTransDraw, code & 0x3fff, x, y - 16, color, 4, 0xf, color_offset, gfx); - } - - goffs += 2; - } - gfx_offs += height << 1; - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x3ff; - } - - TC0010VCU(DrvObjRAM0, DrvVidRAM0, DrvGfxROM0, 0x000); - TC0010VCU(DrvObjRAM1, DrvVidRAM1, DrvGfxROM1, 0x100); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nSegment; - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[4] = { 6000000 / 60, 6000000 / 60, 6000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[4] = { 0, 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - - nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - - nSegment = ZetTotalCycles(); - - ZetClose(); - - ZetOpen(1); - nCyclesDone[0] += ZetRun(nSegment - ZetTotalCycles()); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(2); - nCyclesDone[0] += ZetRun(nSegment - ZetTotalCycles()); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(3); - nCyclesDone[0] += ZetRun(nSegment - ZetTotalCycles()); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen / nInterleave; - - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - - nSoundBufferPos += nSegment; - } - - ZetClose(); - } - - ZetOpen(3); - - if (pBurnSoundOut) { - nSegment = nBurnSoundLen - nSoundBufferPos; - if (nSegment > 0) { - BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment); - } - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029698; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd-AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - ZetScan(nAction); - - BurnYM2151Scan(nAction); - TC0140SYTScan(nAction); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(0,nBank[0]); - ZetClose(); - - ZetOpen(1); - bankswitch(0,nBank[1]); - ZetClose(); - - DrvRecalc = 1; - } - - return 0; -} - - -// Exzisus (Japan, dedicated) - -static struct BurnRomInfo exzisusRomDesc[] = { - { "b12-09.7d", 0x10000, 0xe80f49a9, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code (Master) - { "b12-11.9d", 0x10000, 0x11fcda2c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b12-10.7f", 0x10000, 0xa60227f1, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code (Slave A) - { "b12-12.8f", 0x10000, 0xa662be67, 2 | BRF_PRG | BRF_ESS }, // 3 - { "b12-13.10f", 0x10000, 0x04a29633, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "b12-14.12c", 0x08000, 0xb5ce5e75, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 #2 Code (Slave B) - - { "b12-21.19f", 0x08000, 0xb7e0f00e, 4 | BRF_PRG | BRF_ESS }, // 6 Z80 #3 Code (Sound) - - { "b12-16.17d", 0x10000, 0x6fec6acb, 5 | BRF_GRA }, // 7 Chip #0 Tiles - { "b12-18.19d", 0x10000, 0x64e358aa, 5 | BRF_GRA }, // 8 - { "b12-20.20d", 0x10000, 0x87f52e89, 5 | BRF_GRA }, // 9 - { "b12-15.17c", 0x10000, 0xd81107c8, 5 | BRF_GRA }, // 10 - { "b12-17.19c", 0x10000, 0xdb1d5a6c, 5 | BRF_GRA }, // 11 - { "b12-19.20c", 0x10000, 0x772b2641, 5 | BRF_GRA }, // 12 - - { "b12-05.1c", 0x10000, 0xbe5c5cc1, 6 | BRF_GRA }, // 13 Chip #1 Tiles - { "b12-07.3c", 0x10000, 0x9353e39f, 6 | BRF_GRA }, // 14 - { "b12-06.1d", 0x10000, 0x8571e6ed, 6 | BRF_GRA }, // 15 - { "b12-08.3d", 0x10000, 0x55ea5cca, 6 | BRF_GRA }, // 16 - - { "b12-27.13l", 0x00100, 0x524c9a01, 7 | BRF_GRA }, // 17 Color Proms - { "b12-24.6m", 0x00100, 0x1aa5bde9, 7 | BRF_GRA }, // 18 - { "b12-26.12l", 0x00100, 0x65f42c61, 7 | BRF_GRA }, // 19 - { "b12-23.4m", 0x00100, 0xfad4db5f, 7 | BRF_GRA }, // 20 - { "b12-25.11l", 0x00100, 0x3e30f45b, 7 | BRF_GRA }, // 21 - { "b12-22.2m", 0x00100, 0x936855d2, 7 | BRF_GRA }, // 22 -}; - -STD_ROM_PICK(exzisus) -STD_ROM_FN(exzisus) - -static INT32 exzisusInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvExzisus = { - "exzisus", NULL, NULL, NULL, "1987", - "Exzisus (Japan, dedicated)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, exzisusRomInfo, exzisusRomName, NULL, NULL, ExzisusInputInfo, ExzisusDIPInfo, - exzisusInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Exzisus (Japan, conversion) - -static struct BurnRomInfo exzisusaRomDesc[] = { - { "b23-10.7d", 0x10000, 0xc80216fc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code (Master) - { "b23-12.9d", 0x10000, 0x13637f54, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b23-11.7f", 0x10000, 0xd6a79cef, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code (Slave A) - { "b12-12.8f", 0x10000, 0xa662be67, 2 | BRF_PRG | BRF_ESS }, // 3 - { "b12-13.10f", 0x10000, 0x04a29633, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "b23-13.12c", 0x08000, 0x51110aa1, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 #2 Code (Slave B) - - { "b23-14.19f", 0x08000, 0xf7ca7df2, 4 | BRF_PRG | BRF_ESS }, // 6 Z80 #3 Code (Sound) - - { "b12-16.17d", 0x10000, 0x6fec6acb, 5 | BRF_GRA }, // 7 Chip #0 Tiles - { "b12-18.19d", 0x10000, 0x64e358aa, 5 | BRF_GRA }, // 8 - { "b12-20.20d", 0x10000, 0x87f52e89, 5 | BRF_GRA }, // 9 - { "b12-15.17c", 0x10000, 0xd81107c8, 5 | BRF_GRA }, // 10 - { "b12-17.19c", 0x10000, 0xdb1d5a6c, 5 | BRF_GRA }, // 11 - { "b12-19.20c", 0x10000, 0x772b2641, 5 | BRF_GRA }, // 12 - - { "b23-06.1c", 0x10000, 0x44f8f661, 6 | BRF_GRA }, // 13 Chip #1 Tiles - { "b23-08.3c", 0x10000, 0x1ce498c1, 6 | BRF_GRA }, // 14 - { "b23-07.1d", 0x10000, 0xd7f6ec89, 6 | BRF_GRA }, // 15 - { "b23-09.3d", 0x10000, 0x6651617f, 6 | BRF_GRA }, // 16 - - { "b23-04.15l", 0x00400, 0x5042cffa, 7 | BRF_GRA }, // 17 Color Proms - { "b23-03.14l", 0x00400, 0x9458fd45, 7 | BRF_GRA }, // 18 - { "b23-05.16l", 0x00400, 0x87f0f69a, 7 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(exzisusa) -STD_ROM_FN(exzisusa) - -static INT32 exzisusaInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvExzisusa = { - "exzisusa", "exzisus", NULL, NULL, "1987", - "Exzisus (Japan, conversion)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, exzisusaRomInfo, exzisusaRomName, NULL, NULL, ExzisusInputInfo, ExzisusDIPInfo, - exzisusaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; - - -// Exzisus (TAD license) - -static struct BurnRomInfo exzisustRomDesc[] = { - { "b23-10.7d", 0x10000, 0xc80216fc, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code (Master) - { "b23-12.9d", 0x10000, 0x13637f54, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b23-15.7f", 0x10000, 0x2f8b3752, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code (Slave A) - { "b12-12.8f", 0x10000, 0xa662be67, 2 | BRF_PRG | BRF_ESS }, // 3 - { "b12-13.10f", 0x10000, 0x04a29633, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "b23-13.12c", 0x08000, 0x51110aa1, 3 | BRF_PRG | BRF_ESS }, // 5 Z80 #2 Code (Slave B) - - { "b23-14.19f", 0x08000, 0xf7ca7df2, 4 | BRF_PRG | BRF_ESS }, // 6 Z80 #3 Code (Sound) - - { "b12-16.17d", 0x10000, 0x6fec6acb, 5 | BRF_GRA }, // 7 Chip #0 Tiles - { "b12-18.19d", 0x10000, 0x64e358aa, 5 | BRF_GRA }, // 8 - { "b12-20.20d", 0x10000, 0x87f52e89, 5 | BRF_GRA }, // 9 - { "b12-15.17c", 0x10000, 0xd81107c8, 5 | BRF_GRA }, // 10 - { "b12-17.19c", 0x10000, 0xdb1d5a6c, 5 | BRF_GRA }, // 11 - { "b12-19.20c", 0x10000, 0x772b2641, 5 | BRF_GRA }, // 12 - - { "b23-06.1c", 0x10000, 0x44f8f661, 6 | BRF_GRA }, // 13 Chip #1 Tiles - { "b23-08.3c", 0x10000, 0x1ce498c1, 6 | BRF_GRA }, // 14 - { "b23-07.1d", 0x10000, 0xd7f6ec89, 6 | BRF_GRA }, // 15 - { "b23-09.3d", 0x10000, 0x6651617f, 6 | BRF_GRA }, // 16 - - { "b23-04.15l", 0x00400, 0x5042cffa, 7 | BRF_GRA }, // 17 Color Proms - { "b23-03.14l", 0x00400, 0x9458fd45, 7 | BRF_GRA }, // 18 - { "b23-05.16l", 0x00400, 0x87f0f69a, 7 | BRF_GRA }, // 19 -}; - -STD_ROM_PICK(exzisust) -STD_ROM_FN(exzisust) - -struct BurnDriver BurnDrvExzisust = { - "exzisust", "exzisus", NULL, NULL, "1987", - "Exzisus (TAD license)\0", NULL, "Taito Corporation (TAD license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, exzisustRomInfo, exzisustRomName, NULL, NULL, ExzisusInputInfo, ExzisusDIPInfo, - exzisusaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_flstory.cpp b/jan/src/burn/drv/taito/d_flstory.cpp deleted file mode 100644 index 10c004914..000000000 --- a/jan/src/burn/drv/taito/d_flstory.cpp +++ /dev/null @@ -1,1783 +0,0 @@ -// FB Alpha Fairyland story driver module -// Based on MAME driver by Nicola Salmoria - -// Todo: victnine - -#include "tiles_generic.h" -#include "taito_m68705.h" -#include "z80_intf.h" -#include "driver.h" -#include "dac.h" -#include "msm5232.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvMcuROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvMcuRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[3]; - -static UINT8 snd_data; -static UINT8 snd_flag; -static INT32 nmi_enable; -static INT32 pending_nmi; -static INT32 char_bank = 0; -static UINT8 m_gfxctrl; -static INT32 mcu_select; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static UINT8 *flipscreen; -static UINT8 *soundlatch; - -static INT32 select_game; - -static INT32 m_vol_ctrl[16]; -static UINT8 m_snd_ctrl0; -static UINT8 m_snd_ctrl1; -static UINT8 m_snd_ctrl2; - -static struct BurnInputInfo FlstoryInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Flstory) - -static struct BurnInputInfo RumbaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 5, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 4, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 5, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 4, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Rumba) - -static struct BurnDIPInfo RumbaDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfc, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0xe3, NULL }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x03, 0x00, "20000 50000" }, - {0x13, 0x01, 0x03, 0x01, "10000 60000" }, - {0x13, 0x01, 0x03, 0x02, "10000 40000" }, - {0x13, 0x01, 0x03, 0x03, "10000 20000" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x18, 0x18, "3" }, - {0x13, 0x01, 0x18, 0x10, "4" }, - {0x13, 0x01, 0x18, 0x08, "5" }, - {0x13, 0x01, 0x18, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x0f, "9 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "8 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "7 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "6 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0xf0, "9 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "8 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "7 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "6 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Training Stage" }, - {0x15, 0x01, 0x01, 0x00, "Off" }, - {0x15, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Language" }, - {0x15, 0x01, 0x04, 0x04, "Japanese" }, - {0x15, 0x01, 0x04, 0x00, "English" }, - - {0 , 0xfe, 0 , 2, "Attract Sound" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coinage Display" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Copyright String" }, - {0x15, 0x01, 0x20, 0x20, "Taito Corp. MCMLXXXIV" }, - {0x15, 0x01, 0x20, 0x00, "Taito Corporation" }, - - {0 , 0xfe, 0 , 2, "Infinite Lives" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Rumba) - -static struct BurnDIPInfo FlstoryDIPList[]= -{ - {0x0f, 0xff, 0xff, 0xec, NULL }, - {0x10, 0xff, 0xff, 0x00, NULL }, - {0x11, 0xff, 0xff, 0xf8, NULL }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0f, 0x01, 0x03, 0x00, "30000 100000" }, - {0x0f, 0x01, 0x03, 0x01, "30000 150000" }, - {0x0f, 0x01, 0x03, 0x02, "50000 150000" }, - {0x0f, 0x01, 0x03, 0x03, "70000 150000" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x18, 0x08, "3" }, - {0x0f, 0x01, 0x18, 0x10, "4" }, - {0x0f, 0x01, 0x18, 0x18, "5" }, - {0x0f, 0x01, 0x18, 0x00, "Infinite (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Debug Mode" }, - {0x0f, 0x01, 0x20, 0x20, "Off" }, - {0x0f, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x80, 0x80, "Upright" }, - {0x0f, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x0f, "9 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0e, "8 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0d, "7 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0c, "6 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x10, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x10, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x10, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x10, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x10, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0xf0, "9 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0xe0, "8 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0xd0, "7 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0xc0, "6 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x10, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x10, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x10, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x10, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x10, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x11, 0x01, 0x08, 0x00, "No" }, - {0x11, 0x01, 0x08, 0x08, "Yes" }, - - {0 , 0xfe, 0 , 2, "Attract Animation" }, - {0x11, 0x01, 0x10, 0x00, "Off" }, - {0x11, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Leave Off" }, - {0x11, 0x01, 0x20, 0x20, "Off" }, - {0x11, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x11, 0x01, 0x40, 0x40, "Off" }, - {0x11, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x11, 0x01, 0x80, 0x00, "1" }, - {0x11, 0x01, 0x80, 0x80, "2" }, -}; - -STDDIPINFO(Flstory) - -static struct BurnInputInfo Onna34roInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 5, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 4, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 5, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 4, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Onna34ro) - -static struct BurnDIPInfo Onna34roDIPList[]= -{ - {0x13, 0xff, 0xff, 0xc0, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x03, 0x00, "200000 200000" }, - {0x13, 0x01, 0x03, 0x01, "200000 300000" }, - {0x13, 0x01, 0x03, 0x02, "100000 200000" }, - {0x13, 0x01, 0x03, 0x03, "200000 100000" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x18, 0x10, "1" }, - {0x13, 0x01, 0x18, 0x08, "2" }, - {0x13, 0x01, 0x18, 0x00, "3" }, - {0x13, 0x01, 0x18, 0x18, "Endless (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x13, 0x01, 0x20, 0x20, "Off" }, - {0x13, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x80, "Upright" }, - {0x13, 0x01, 0x80, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x14, 0x01, 0x0f, 0x0f, "9 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "8 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "7 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "6 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0xf0, "9 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "8 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "7 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "6 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x15, 0x01, 0x01, 0x00, "Off" }, - {0x15, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Rack Test" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Coinage Display" }, - {0x15, 0x01, 0x10, 0x10, "Off" }, - {0x15, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x60, 0x20, "Easy" }, - {0x15, 0x01, 0x60, 0x00, "Normal" }, - {0x15, 0x01, 0x60, 0x40, "Difficult" }, - {0x15, 0x01, 0x60, 0x60, "Very Difficult" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x15, 0x01, 0x80, 0x80, "A and B" }, - {0x15, 0x01, 0x80, 0x00, "A only" }, -}; - -STDDIPINFO(Onna34ro) - -static struct BurnInputInfo VictnineInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 5, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 4, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy4 + 2, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, DrvJoy4 + 3, "p1 fire 4" }, - {"P1 Button 5", BIT_DIGITAL, DrvJoy4 + 4, "p1 fire 5" }, - {"P1 Button 6", BIT_DIGITAL, DrvJoy4 + 5, "p1 fire 6" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 5, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 4, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy5 + 2, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, DrvJoy5 + 3, "p2 fire 4" }, - {"P2 Button 5", BIT_DIGITAL, DrvJoy5 + 4, "p2 fire 5" }, - {"P2 Button 6", BIT_DIGITAL, DrvJoy5 + 5, "p2 fire 6" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Victnine) - -static struct BurnDIPInfo VictnineDIPList[]= -{ - {0x1b, 0xff, 0xff, 0x67, NULL }, - {0x1c, 0xff, 0xff, 0x00, NULL }, - {0x1d, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x1b, 0x01, 0x04, 0x04, "Off" }, - {0x1b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x1b, 0x01, 0x40, 0x40, "Off" }, - {0x1b, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Cabinet" }, - {0x1b, 0x01, 0xa0, 0x20, "Upright" }, - {0x1b, 0x01, 0xa0, 0xa0, "Cocktail" }, - {0x1b, 0x01, 0xa0, 0x00, "MA / MB" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x1c, 0x01, 0x0f, 0x0f, "9 Coins 1 Credits" }, - {0x1c, 0x01, 0x0f, 0x0e, "8 Coins 1 Credits" }, - {0x1c, 0x01, 0x0f, 0x0d, "7 Coins 1 Credits" }, - {0x1c, 0x01, 0x0f, 0x0c, "6 Coins 1 Credits" }, - {0x1c, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x1c, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x1c, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x1c, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x1c, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x1c, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x1c, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x1c, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x1c, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x1c, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x1c, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x1c, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x1c, 0x01, 0xf0, 0xf0, "9 Coins 1 Credits" }, - {0x1c, 0x01, 0xf0, 0xe0, "8 Coins 1 Credits" }, - {0x1c, 0x01, 0xf0, 0xd0, "7 Coins 1 Credits" }, - {0x1c, 0x01, 0xf0, 0xc0, "6 Coins 1 Credits" }, - {0x1c, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x1c, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x1c, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x1c, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x1c, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x1c, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x1c, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x1c, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x1c, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x1c, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x1c, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x1c, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Coinage Display" }, - {0x1d, 0x01, 0x10, 0x00, "Off" }, - {0x1d, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 2, "Show Year" }, - {0x1d, 0x01, 0x20, 0x00, "Off" }, - {0x1d, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "No hit" }, - {0x1d, 0x01, 0x40, 0x40, "Off" }, - {0x1d, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x1d, 0x01, 0x80, 0x80, "A and B" }, - {0x1d, 0x01, 0x80, 0x00, "A only" }, -}; - -STDDIPINFO(Victnine) - -static void gfxctrl_write(INT32 data) -{ - m_gfxctrl = data; - - INT32 bank = (data & 0x20) << 3; - - ZetMapArea(0xdd00, 0xddff, 0, DrvPalRAM + 0x000 + bank); - ZetMapArea(0xdd00, 0xddff, 1, DrvPalRAM + 0x000 + bank); - ZetMapArea(0xde00, 0xdeff, 0, DrvPalRAM + 0x200 + bank); - ZetMapArea(0xde00, 0xdeff, 1, DrvPalRAM + 0x200 + bank); - - if (select_game == 3) { - char_bank = 0; - return; - } - - char_bank = (data & 0x10) >> 4; - - if (data & 4) *flipscreen = (~data & 0x01); -} - -static void onna34ro_mcu_write(INT32 data) -{ - INT32 score_adr = (ZetReadByte(0xe29e) << 8) + ZetReadByte(0xe29d); - - mcu_sent = 1; - - switch (data) - { - case 0x0e: - from_mcu = 0xff; - break; - - case 0x01: - from_mcu = 0x6a; - break; - - case 0x40: if(score_adr >= 0xe000 && score_adr < 0xe800) from_mcu = ZetReadByte(score_adr); - break; - - case 0x41: if(score_adr >= 0xe000 && score_adr < 0xe800) from_mcu = ZetReadByte(score_adr+1); - break; - - case 0x42: if(score_adr >= 0xe000 && score_adr < 0xe800) from_mcu = ZetReadByte(score_adr+2) & 0x0f; - break; - - default: - from_mcu = 0x80; - } -} - -static const UINT8 victnine_mcu_data[0x100] = -{ - 0x3e, 0x08, 0xdd, 0x29, 0xcb, 0x14, 0xfd, 0x29, - 0xcb, 0x15, 0xd9, 0x29, 0xd9, 0x30, 0x0d, 0xd9, - 0x19, 0xd9, 0xdd, 0x09, 0x30, 0x01, 0x24, 0xfd, - 0x19, 0x30, 0x01, 0x2c, 0x3d, 0x20, 0xe3, 0xc9, - 0x11, 0x14, 0x00, 0x19, 0x7e, 0x32, 0xed, 0xe4, - 0x2a, 0x52, 0xe5, 0x22, 0xe9, 0xe4, 0x2a, 0x54, - 0xe5, 0x22, 0xeb, 0xe4, 0x21, 0x2a, 0xe6, 0xfe, - 0x06, 0x38, 0x02, 0xcb, 0xc6, 0xcb, 0xce, 0xc9, - 0x06, 0x00, 0x3a, 0xaa, 0xe4, 0x07, 0x07, 0x07, - 0xb0, 0x47, 0x3a, 0xab, 0xe4, 0x07, 0x07, 0xb0, - 0x47, 0x3a, 0xac, 0xe4, 0xe6, 0x03, 0xb0, 0x21, - 0xe3, 0xe6, 0xc9, 0x38, 0xe1, 0x29, 0x07, 0xc9, - 0x23, 0x7e, 0x47, 0xe6, 0x1f, 0x32, 0x0c, 0xe6, - 0x78, 0xe6, 0xe0, 0x07, 0x07, 0x47, 0xe6, 0x03, - 0x28, 0x06, 0xcb, 0x7a, 0x28, 0x02, 0xc6, 0x02, - 0x32, 0x0a, 0xe6, 0x78, 0xe6, 0x80, 0xc9, 0x3a, - 0x21, 0x29, 0xe5, 0x7e, 0xe6, 0xf8, 0xf6, 0x01, - 0x77, 0x23, 0x3a, 0x0a, 0xe6, 0x77, 0x21, 0x08, - 0xe6, 0xcb, 0xc6, 0xcb, 0x8e, 0x3a, 0x2b, 0xe5, - 0x21, 0xff, 0xe5, 0xfe, 0x02, 0xc9, 0x1f, 0xc6, - 0x47, 0x3a, 0xaa, 0xe4, 0xa7, 0x21, 0x00, 0xe5, - 0x28, 0x03, 0x21, 0x1b, 0xe5, 0x70, 0x3a, 0xaa, - 0xe4, 0xee, 0x01, 0x32, 0xaa, 0xe4, 0x21, 0xb0, - 0xe4, 0x34, 0x23, 0x36, 0x00, 0xc9, 0x2b, 0xb2, - 0xaf, 0x77, 0x12, 0x23, 0x13, 0x3c, 0xfe, 0x09, - 0x20, 0xf7, 0x3e, 0x01, 0x32, 0xad, 0xe4, 0x21, - 0x48, 0xe5, 0xcb, 0xfe, 0xc9, 0x32, 0xe5, 0xaa, - 0x21, 0x00, 0x13, 0xe4, 0x47, 0x1b, 0xa1, 0xc9, - 0x00, 0x08, 0x04, 0x0c, 0x05, 0x0d, 0x06, 0x0e, - 0x22, 0x66, 0xaa, 0x22, 0x33, 0x01, 0x11, 0x88, - 0x06, 0x05, 0x03, 0x04, 0x08, 0x01, 0x03, 0x02, - 0x06, 0x07, 0x02, 0x03, 0x15, 0x17, 0x11, 0x13 -}; - -static void victnine_mcu_write(INT32 data) -{ - INT32 seed = ZetReadByte(0xe685); - - if (!seed && (data & 0x37) == 0x37) - { - from_mcu = 0xa6; - } - else - { - data += seed; - - if ((data & ~0x1f) == 0xa0) - { - mcu_select = data & 0x1f; - } - else if (data < 0x20) - { - INT32 offset = mcu_select * 8 + data; - from_mcu = victnine_mcu_data[offset]; - } - else if (data >= 0x38 && data <= 0x3a) - { - from_mcu = ZetReadByte(0xe691 - 0x38 + data); - } - } -} - -void __fastcall flstory_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xff00) == 0xdc00) { - DrvSprRAM[address & 0xff] = data; - - if (((select_game == 2) || (select_game == 3)) && address == 0xdce0) { - gfxctrl_write(data); - } - - return; - } - - switch (address) - { - case 0xd000: - if (select_game == 2) { - victnine_mcu_write(data); - } else if (select_game == 10) { - onna34ro_mcu_write(data); - } else { - standard_taito_mcu_write(data); - } - return; - - case 0xd400: - { - *soundlatch = data; - - if (nmi_enable) { - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - } else { - pending_nmi = 1; - } - } - return; - - case 0xdf03: - if ((select_game != 2) && (select_game != 3)) gfxctrl_write(data | 0x04); - return; - } -} - -UINT8 __fastcall flstory_main_read(UINT16 address) -{ - switch (address) - { - case 0xd000: - if (select_game == 10) { - return from_mcu; - } - if (select_game == 2) { - return from_mcu - ZetReadByte(0xe685); - } else { - return standard_taito_mcu_read(); - } - - case 0xd400: - snd_flag = 0; - return snd_data; - - case 0xd401: - return snd_flag | 0xfd; - - case 0xd800: - case 0xd801: - case 0xd802: - return DrvDips[address & 3]; - - case 0xd803: if (select_game != 3) { - return DrvInputs[0] & 0x3f; - } else { - return DrvInputs[0] ^ 0x30; - } - - case 0xd804: - return DrvInputs[1]; - - case 0xd805: - { - INT32 res = 0; - if (!main_sent) res |= 0x01; - if (mcu_sent) res |= 0x02; - - if (select_game == 2) res |= DrvInputs[3]; - if (select_game == 10) res = 0x03; // onna always returns 3 - return res; - } - - case 0xd806: - return DrvInputs[2]; - - case 0xd807: - return DrvInputs[4]; - case 0xdce0: - return m_gfxctrl; - } - - return 0; -} - -static void ta7630_init() -{ - int i; - - double db = 0.0; - double db_step = 1.50; /* 1.50 dB step (at least, maybe more) */ - double db_step_inc = 0.125; - for (i = 0; i < 16; i++) - { - double max = 100.0 / pow(10.0, db/20.0 ); - m_vol_ctrl[15 - i] = (INT32)max; - - db += db_step; - db_step += db_step_inc; - } -/* - channels 0-2 AY#0 - channels 3,4 MSM5232 group1,group2 -*/ -} - -static void sound_control_0_w(UINT8 data) -{ - double vol; - m_snd_ctrl0 = data & 0xff; - - vol = m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0; - MSM5232SetRoute(vol, BURN_SND_MSM5232_ROUTE_0); - MSM5232SetRoute(vol, BURN_SND_MSM5232_ROUTE_1); - MSM5232SetRoute(vol, BURN_SND_MSM5232_ROUTE_2); - MSM5232SetRoute(vol, BURN_SND_MSM5232_ROUTE_3); -} - -static void sound_control_1_w(UINT8 data) -{ - double vol; - m_snd_ctrl1 = data & 0xff; - - vol = m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0; - MSM5232SetRoute(vol, BURN_SND_MSM5232_ROUTE_4); - MSM5232SetRoute(vol, BURN_SND_MSM5232_ROUTE_5); - MSM5232SetRoute(vol, BURN_SND_MSM5232_ROUTE_6); - MSM5232SetRoute(vol, BURN_SND_MSM5232_ROUTE_7); -} - -static void AY_ayportA_write(UINT32 /*addr*/, UINT32 data) -{ - if (data == 0xff) return; // ignore ay-init - m_snd_ctrl2 = data & 0xff; - - AY8910SetAllRoutes(0, m_vol_ctrl[(m_snd_ctrl2 >> 4) & 15] / ((select_game == 3) ? 1600.0 : 2000.0), BURN_SND_ROUTE_BOTH); -} - -void __fastcall flstory_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc800: - case 0xc801: - AY8910Write(0, address & 1, data); - return; - - case 0xca00: - case 0xca01: - case 0xca02: - case 0xca03: - case 0xca04: - case 0xca05: - case 0xca06: - case 0xca07: - case 0xca08: - case 0xca09: - case 0xca0a: - case 0xca0b: - case 0xca0c: - case 0xca0d: - MSM5232Write(address, data); - return; - - case 0xcc00: - sound_control_0_w(data); - break; - - case 0xce00: - sound_control_1_w(data); - break; - - case 0xd800: - snd_data = data; - snd_flag = 2; - return; - - case 0xda00: - nmi_enable = 1; - if (pending_nmi) - { - ZetNmi(); - pending_nmi = 0; - } - return; - - case 0xdc00: - nmi_enable = 0; - return; - - case 0xde00: - DACSignedWrite(0, data); - return; - } -} - -UINT8 __fastcall flstory_sound_read(UINT16 address) -{ - if (address == 0xd800) { - return *soundlatch; - } - - return 0; -} - -static INT32 flstoryDACSync() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (4000000.000 / (nBurnFPS / 100.000)))); -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - m67805_taito_reset(); - - ta7630_init(); - AY8910Reset(0); - MSM5232Reset(); - - DACReset(); - - snd_data = 0; - snd_flag = 0; - nmi_enable = 0; - pending_nmi = 0; - char_bank = 0; - mcu_select = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvMcuROM = Next; Next += 0x000800; - - DrvGfxROM0 = Next; Next += 0x040000; - DrvGfxROM1 = Next; Next += 0x040000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x001000; - DrvZ80RAM0 = Next; Next += 0x000800; - DrvZ80RAM1 = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x000100; - - DrvMcuRAM = Next; Next += 0x000080; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { RGN_FRAC(((select_game == 3) ? 0x8000 : 0x20000), 1, 2)+0, RGN_FRAC(((select_game == 3) ? 0x8000 : 0x20000), 1, 2)+4, 0x00000, 0x00004 }; - INT32 XOffs[16] = { 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0, 16*8+3, 16*8+2, 16*8+1, 16*8+0, 16*8+8+3, 16*8+8+2, 16*8+8+1, 16*8+8+0 }; - INT32 YOffs[16] = { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x20000); - if (tmp == NULL) { - return 1; - } - - for (INT32 i = 0; i < 0x20000; i++) tmp[i] = DrvGfxROM0[i] ^ 0xff; - - GfxDecode(0x1000, 4, 8, 8, Plane, XOffs, YOffs, 0x080, tmp, DrvGfxROM0); - GfxDecode(0x0400, 4, 16, 16, Plane, XOffs, YOffs, 0x200, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (select_game == 0) { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x14000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x18000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1c000, 12, 1)) return 1; - - if (BurnLoadRom(DrvMcuROM + 0x00000, 13, 1)) return 1; - } else if (select_game == 1) { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x06000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x08000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x14000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x18000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1c000, 15, 1)) return 1; - - if (BurnLoadRom(DrvMcuROM + 0x00000, 16, 1)) return 1; - } else if (select_game == 2) { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x0a000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 7, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 8, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x06000, 9, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x08000, 10, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x0a000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x06000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x12000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x14000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x16000, 19, 1)) return 1; - } else if (select_game == 3) { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 5, 1)) return 1; - - if (BurnLoadRom(DrvMcuROM + 0x00000, 6, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x06000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 10, 1)) return 1; - } else if (select_game == 10) { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x06000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x08000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x10000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x14000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x18000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1c000, 15, 1)) return 1; - } - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM0); - ZetMapArea(0xc000, 0xcfff, 0, DrvVidRAM); - ZetMapArea(0xc000, 0xcfff, 1, DrvVidRAM); - ZetMapArea(0xc000, 0xcfff, 2, DrvVidRAM); - ZetMapArea(0xdc00, 0xdcff, 0, DrvSprRAM); -// ZetMapArea(0xdc00, 0xdcff, 1, DrvSprRAM); - ZetMapArea(0xdc00, 0xdcff, 2, DrvSprRAM); - ZetMapArea(0xdd00, 0xddff, 0, DrvPalRAM); - ZetMapArea(0xdd00, 0xddff, 1, DrvPalRAM); - ZetMapArea(0xdd00, 0xddff, 2, DrvPalRAM); - ZetMapArea(0xde00, 0xdeff, 0, DrvPalRAM + 0x200); - ZetMapArea(0xde00, 0xdeff, 1, DrvPalRAM + 0x200); - ZetMapArea(0xde00, 0xdeff, 2, DrvPalRAM + 0x200); - ZetMapArea(0xe000, 0xe7ff, 0, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe7ff, 1, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe7ff, 2, DrvZ80RAM0); - ZetSetWriteHandler(flstory_main_write); - ZetSetReadHandler(flstory_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM1); - ZetMapArea(0xc000, 0xc7ff, 0, DrvZ80RAM1); - ZetMapArea(0xc000, 0xc7ff, 1, DrvZ80RAM1); - ZetMapArea(0xc000, 0xc7ff, 2, DrvZ80RAM1); - ZetMapArea(0xe000, 0xefff, 0, DrvZ80ROM1 + 0xe000); - ZetMapArea(0xe000, 0xefff, 2, DrvZ80ROM1 + 0xe000); - ZetSetWriteHandler(flstory_sound_write); - ZetSetReadHandler(flstory_sound_read); - ZetClose(); - - m67805_taito_init(DrvMcuROM, DrvMcuRAM, &standard_m68705_interface); - - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, AY_ayportA_write, NULL); - AY8910SetAllRoutes(0, 0.05, BURN_SND_ROUTE_BOTH); - if (select_game == 3) { - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - } - - MSM5232Init(2000000, 1); - MSM5232SetCapacitors(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6); - MSM5232SetRoute(1.00, BURN_SND_MSM5232_ROUTE_0); - MSM5232SetRoute(1.00, BURN_SND_MSM5232_ROUTE_1); - MSM5232SetRoute(1.00, BURN_SND_MSM5232_ROUTE_2); - MSM5232SetRoute(1.00, BURN_SND_MSM5232_ROUTE_3); - MSM5232SetRoute(1.00, BURN_SND_MSM5232_ROUTE_4); - MSM5232SetRoute(1.00, BURN_SND_MSM5232_ROUTE_5); - MSM5232SetRoute(1.00, BURN_SND_MSM5232_ROUTE_6); - MSM5232SetRoute(1.00, BURN_SND_MSM5232_ROUTE_7); - - DACInit(0, 0, 1, flstoryDACSync); - DACSetRoute(0, 0.20, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - m68705_taito_scan(nAction); - AY8910Scan(nAction, pnMin); - MSM5232Scan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(snd_data); - SCAN_VAR(snd_flag); - SCAN_VAR(nmi_enable); - SCAN_VAR(pending_nmi); - SCAN_VAR(char_bank); - SCAN_VAR(mcu_select); - SCAN_VAR(m_snd_ctrl0); - SCAN_VAR(m_snd_ctrl1); - SCAN_VAR(m_snd_ctrl2); - - DrvRecalc = 1; - } - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - m67805_taito_exit(); - - AY8910Exit(0); - MSM5232Exit(); - DACExit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_background_layer(INT32 type, INT32 priority) -{ //fg bg fg bg - INT32 masks[4] = { 0x3fff, 0xc000, 0x8000, 0x7fff }; - INT32 mask = masks[type & 0x03]; - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= DrvSprRAM[0xa0 + (offs & 0x1f)] + 16; - if (sy < -7) sy += 256; - if (sy >= nScreenHeight) continue; - - INT32 attr = DrvVidRAM[offs * 2 + 1]; - INT32 code = DrvVidRAM[offs * 2 + 0] | ((attr & 0xc0) << 2) | 0x400 | (char_bank * 0x800); - - INT32 flipy = attr & 0x10; - INT32 flipx = attr & 0x08; - if (select_game == 3) { - flipx = 0; flipy = 0; // no flipping in rumba - code &= 0x3ff; // mask code to max_rumba_chars-1 - } - - INT32 color = (attr & 0x0f) << 4; - INT32 prio = (attr & 0x20) >> 5; - if (priority && !prio) continue; - - if (type == 1) { // first background layer - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color >> 4, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color >> 4, 4, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color >> 4, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color >> 4, 4, 0, DrvGfxROM0); - } - } - } - else if (type == 6) { // not used (for now) - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color >> 4, 4, 15, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color >> 4, 4, 15, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color >> 4, 4, 15, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color >> 4, 4, 15, 0, DrvGfxROM0); - } - } - } - else - { - if (flipy) flipy = 0x38; - if (flipx) flipy |= 0x07; - UINT8 *src = DrvGfxROM0 + (code * 8 * 8); - UINT16 *dst; - - for (INT32 y = 0; y < 8; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - dst = pTransDraw + sy * nScreenWidth; - - for (INT32 x = 0; x < 8; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = src[((y << 3) | x) ^ flipy]; - if (mask & (1 << pxl)) continue; - - dst[sx] = pxl | color; - } - - sx -= 8; - } - } - } -} - -static void victnine_draw_background_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - sy -= DrvSprRAM[0xa0 + (offs & 0x1f)] + 16; - if (sy < -7) sy += 256; - if (sy >= nScreenHeight) continue; - - INT32 attr = DrvVidRAM[offs * 2 + 1]; - INT32 code = DrvVidRAM[offs * 2 + 0] | ((attr & 0x38) << 5); - - INT32 flipy = attr & 0x80; - INT32 flipx = attr & 0x40; - INT32 color = attr & 0x07; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } - - } -} - -static void draw_sprites(INT32 pri, INT32 type) -{ - for (INT32 i = 0; i < 0x20; i++) - { - INT32 pr = DrvSprRAM[0xa0-1 -i]; - INT32 offs = (pr & 0x1f) * 4; - - if ((pr & 0x80) == pri || type) - { - INT32 sy = DrvSprRAM[offs + 0]; - INT32 attr = DrvSprRAM[offs + 1]; - INT32 code = DrvSprRAM[offs + 2]; - if (type) { - code += (attr & 0x20) << 3; - } else { - code += ((attr & 0x30) << 4); - } - - INT32 sx = DrvSprRAM[offs + 3]; - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - - if (*flipscreen) - { - sx = (240 - sx) & 0xff; - sy = sy - 1; - - flipx ^= 0x40; - flipx ^= 0x80; - } - else - sy = 240 - sy - 1; - - sy -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, attr & 0x0f, 4, 15, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, attr & 0x0f, 4, 15, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, attr & 0x0f, 4, 15, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, attr & 0x0f, 4, 15, 0x100, DrvGfxROM1); - } - } - - if (sx > 240) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx - 256, sy, attr & 0x0f, 4, 15, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx - 256, sy, attr & 0x0f, 4, 15, 0x100, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx - 256, sy, attr & 0x0f, 4, 15, 0x100, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx - 256, sy, attr & 0x0f, 4, 15, 0x100, DrvGfxROM1); - } - } - } - } - } -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - for (INT32 i = 0; i < 0x200; i++) { - INT32 d = DrvPalRAM[i] | (DrvPalRAM[i + 0x200] << 8); - b = (d >> 8) & 0x0f; - g = (d >> 4) & 0x0f; - r = d & 0x0f; - DrvPalette[i] = BurnHighCol((r << 4) | r, (g << 4) | g, (b << 4) | b, 0); - } -} -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - BurnTransferClear(); - - if (nBurnLayer & 1) draw_background_layer(1, 0); - if (nBurnLayer & 2) draw_background_layer(3, 1); - if (nSpriteEnable & 1) draw_sprites(0x00, (select_game == 3)); - if (nBurnLayer & 4) draw_background_layer(0, 0); - if (nSpriteEnable & 2) draw_sprites(0x80, (select_game == 3)); - if (nBurnLayer & 8) draw_background_layer(2, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 victnineDraw() -{ - if (DrvRecalc) { - DrvRecalcPalette(); - } - - victnine_draw_background_layer(); - draw_sprites(0, 1); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 5); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[3] = { 5366500 / 60, 4000000 / 60, 3072000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - if (select_game == 2 || select_game == 3) - nCyclesTotal[0] = 4000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nSegment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(nSegment); - if (i == (nInterleave / 2) - 1) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - if (i == (nInterleave / 1) - 1) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (select_game == 0 || select_game == 1 || select_game == 3) { - m6805Open(0); - nSegment = nCyclesTotal[2] / nInterleave; - nCyclesDone[2] += m6805Run(nSegment); - m6805Close(); - } - } - - ZetOpen(1); - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - MSM5232Update(pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - - -// The FairyLand Story - -static struct BurnRomInfo flstoryRomDesc[] = { - { "cpu-a45.15", 0x4000, 0xf03fc969, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "cpu-a45.16", 0x4000, 0x311aa82e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cpu-a45.17", 0x4000, 0xa2b5d17d, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "snd.22", 0x2000, 0xd58b201d, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "snd.23", 0x2000, 0x25e7fd9d, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "vid-a45.18", 0x4000, 0x6f08f69e, 3 | BRF_GRA }, // 5 gfx1 - { "vid-a45.06", 0x4000, 0xdc856a75, 3 | BRF_GRA }, // 6 - { "vid-a45.08", 0x4000, 0xd0b028ca, 3 | BRF_GRA }, // 7 - { "vid-a45.20", 0x4000, 0x1b0edf34, 3 | BRF_GRA }, // 8 - { "vid-a45.19", 0x4000, 0x2b572dc9, 3 | BRF_GRA }, // 9 - { "vid-a45.07", 0x4000, 0xaa4b0762, 3 | BRF_GRA }, // 10 - { "vid-a45.09", 0x4000, 0x8336be58, 3 | BRF_GRA }, // 11 - { "vid-a45.21", 0x4000, 0xfc382bd1, 3 | BRF_GRA }, // 12 - - { "a45-20.mcu", 0x0800, 0x7d2cdd9b, 4 | BRF_PRG | BRF_ESS }, // 13 mcu -}; - -STD_ROM_PICK(flstory) -STD_ROM_FN(flstory) - -static INT32 flstoryInit() -{ - select_game = 0; - - return DrvInit(); -} - -struct BurnDriver BurnDrvFlstory = { - "flstory", NULL, NULL, NULL, "1985", - "The FairyLand Story\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, flstoryRomInfo, flstoryRomName, NULL, NULL, FlstoryInputInfo, FlstoryDIPInfo, - flstoryInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// The FairyLand Story (Japan) - -static struct BurnRomInfo flstoryjRomDesc[] = { - { "cpu-a45.15", 0x4000, 0xf03fc969, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "cpu-a45.16", 0x4000, 0x311aa82e, 1 | BRF_PRG | BRF_ESS }, // 1 - { "cpu-a45.17", 0x4000, 0xa2b5d17d, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a45_12.8", 0x2000, 0xd6f593fb, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "a45_13.9", 0x2000, 0x451f92f9, 2 | BRF_PRG | BRF_ESS }, // 4 - - { "vid-a45.18", 0x4000, 0x6f08f69e, 3 | BRF_GRA }, // 5 gfx1 - { "vid-a45.06", 0x4000, 0xdc856a75, 3 | BRF_GRA }, // 6 - { "vid-a45.08", 0x4000, 0xd0b028ca, 3 | BRF_GRA }, // 7 - { "vid-a45.20", 0x4000, 0x1b0edf34, 3 | BRF_GRA }, // 8 - { "vid-a45.19", 0x4000, 0x2b572dc9, 3 | BRF_GRA }, // 9 - { "vid-a45.07", 0x4000, 0xaa4b0762, 3 | BRF_GRA }, // 10 - { "vid-a45.09", 0x4000, 0x8336be58, 3 | BRF_GRA }, // 11 - { "vid-a45.21", 0x4000, 0xfc382bd1, 3 | BRF_GRA }, // 12 - - { "a45-20.mcu", 0x0800, 0x7d2cdd9b, 4 | BRF_PRG | BRF_ESS }, // 13 mcu -}; - -STD_ROM_PICK(flstoryj) -STD_ROM_FN(flstoryj) - -struct BurnDriver BurnDrvFlstoryj = { - "flstoryj", "flstory", NULL, NULL, "1985", - "The FairyLand Story (Japan)\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, flstoryjRomInfo, flstoryjRomName, NULL, NULL, FlstoryInputInfo, FlstoryDIPInfo, - flstoryInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Onna Sansirou - Typhoon Gal (set 1) - -static struct BurnRomInfo onna34roRomDesc[] = { - { "a52-01-1.40c", 0x4000, 0xffddcb02, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "a52-02-1.41c", 0x4000, 0xda97150d, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a52-03-1.42c", 0x4000, 0xb9749a53, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a52-12.08s", 0x2000, 0x28f48096, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "a52-13.09s", 0x2000, 0x4d3b16f3, 2 | BRF_PRG | BRF_ESS }, // 4 - { "a52-14.10s", 0x2000, 0x90a6f4e8, 2 | BRF_PRG | BRF_ESS }, // 5 - { "a52-15.37s", 0x2000, 0x5afc21d0, 2 | BRF_PRG | BRF_ESS }, // 6 - { "a52-16.38s", 0x2000, 0xccf42aee, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "a52-04.11v", 0x4000, 0x5b126294, 3 | BRF_GRA }, // 8 gfx1 - { "a52-06.10v", 0x4000, 0x78114721, 3 | BRF_GRA }, // 9 - { "a52-08.09v", 0x4000, 0x4a293745, 3 | BRF_GRA }, // 10 - { "a52-10.08v", 0x4000, 0x8be7b4db, 3 | BRF_GRA }, // 11 - { "a52-05.35v", 0x4000, 0xa1a99588, 3 | BRF_GRA }, // 12 - { "a52-07.34v", 0x4000, 0x0bf420f2, 3 | BRF_GRA }, // 13 - { "a52-09.33v", 0x4000, 0x39c543b5, 3 | BRF_GRA }, // 14 - { "a52-11.32v", 0x4000, 0xd1dda6b3, 3 | BRF_GRA }, // 15 - - { "a52_17.54c", 0x0800, 0x0ab2612e, 4 | BRF_PRG | BRF_ESS }, // 16 cpu2 -}; - -STD_ROM_PICK(onna34ro) -STD_ROM_FN(onna34ro) - -static INT32 onna34roInit() -{ - select_game = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvOnna34ro = { - "onna34ro", NULL, NULL, NULL, "1985", - "Onna Sansirou - Typhoon Gal\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, onna34roRomInfo, onna34roRomName, NULL, NULL, Onna34roInputInfo, Onna34roDIPInfo, - onna34roInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Onna Sansirou - Typhoon Gal (set 2) - -static struct BurnRomInfo onna34raRomDesc[] = { - { "ry-08.rom", 0x4000, 0xe4587b85, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "ry-07.rom", 0x4000, 0x6ffda515, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ry-06.rom", 0x4000, 0x6fefcda8, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a52-12.08s", 0x2000, 0x28f48096, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "a52-13.09s", 0x2000, 0x4d3b16f3, 2 | BRF_PRG | BRF_ESS }, // 4 - { "a52-14.10s", 0x2000, 0x90a6f4e8, 2 | BRF_PRG | BRF_ESS }, // 5 - { "a52-15.37s", 0x2000, 0x5afc21d0, 2 | BRF_PRG | BRF_ESS }, // 6 - { "a52-16.38s", 0x2000, 0xccf42aee, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "a52-04.11v", 0x4000, 0x5b126294, 3 | BRF_GRA }, // 8 gfx1 - { "a52-06.10v", 0x4000, 0x78114721, 3 | BRF_GRA }, // 9 - { "a52-08.09v", 0x4000, 0x4a293745, 3 | BRF_GRA }, // 10 - { "a52-10.08v", 0x4000, 0x8be7b4db, 3 | BRF_GRA }, // 11 - { "a52-05.35v", 0x4000, 0xa1a99588, 3 | BRF_GRA }, // 12 - { "a52-07.34v", 0x4000, 0x0bf420f2, 3 | BRF_GRA }, // 13 - { "a52-09.33v", 0x4000, 0x39c543b5, 3 | BRF_GRA }, // 14 - { "a52-11.32v", 0x4000, 0xd1dda6b3, 3 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(onna34ra) -STD_ROM_FN(onna34ra) - -static INT32 onna34roaInit() -{ - select_game = 10; - - return DrvInit(); -} - -struct BurnDriver BurnDrvOnna34ra = { - "onna34roa", "onna34ro", NULL, NULL, "1985", - "Onna Sansirou - Typhoon Gal (bootleg)\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, onna34raRomInfo, onna34raRomName, NULL, NULL, Onna34roInputInfo, Onna34roDIPInfo, - onna34roaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Victorious Nine - -static struct BurnRomInfo victnineRomDesc[] = { - { "a16-19.1", 0x2000, 0xdeb7c439, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "a16-20.2", 0x2000, 0x60cdb6ae, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a16-21.3", 0x2000, 0x121bea03, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a16-22.4", 0x2000, 0xb20e3027, 1 | BRF_PRG | BRF_ESS }, // 3 - { "a16-23.5", 0x2000, 0x95fe9cb7, 1 | BRF_PRG | BRF_ESS }, // 4 - { "a16-24.6", 0x2000, 0x32b5c155, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "a16-12.8", 0x2000, 0x4b9bff43, 2 | BRF_PRG | BRF_ESS }, // 6 audiocpu - { "a16-13.9", 0x2000, 0x355121b9, 2 | BRF_PRG | BRF_ESS }, // 7 - { "a16-14.10", 0x2000, 0x0f33ef4d, 2 | BRF_PRG | BRF_ESS }, // 8 - { "a16-15.37", 0x2000, 0xf91d63dc, 2 | BRF_PRG | BRF_ESS }, // 9 - { "a16-16.38", 0x2000, 0x9395351b, 2 | BRF_PRG | BRF_ESS }, // 10 - { "a16-17.39", 0x2000, 0x872270b3, 2 | BRF_PRG | BRF_ESS }, // 11 - - { "a16-06-1.7", 0x2000, 0xb708134d, 3 | BRF_GRA }, // 12 gfx1 - { "a16-07-2.8", 0x2000, 0xcdaf7f83, 3 | BRF_GRA }, // 13 - { "a16-10.90", 0x2000, 0xe8e42454, 3 | BRF_GRA }, // 14 - { "a16-11-1.91", 0x2000, 0x1f766661, 3 | BRF_GRA }, // 15 - { "a16-04.5", 0x2000, 0xb2fae99f, 3 | BRF_GRA }, // 16 - { "a16-05-1.6", 0x2000, 0x85dfbb6e, 3 | BRF_GRA }, // 17 - { "a16-08.88", 0x2000, 0x1ddb6466, 3 | BRF_GRA }, // 18 - { "a16-09-1.89", 0x2000, 0x23d4c43c, 3 | BRF_GRA }, // 19 - - { "a16-18.mcu", 0x0800, 0x00000000, 4 | BRF_NODUMP }, // 20 cpu2 -}; - -STD_ROM_PICK(victnine) -STD_ROM_FN(victnine) - -static INT32 victnineInit() -{ - select_game = 2; - - INT32 nRet = DrvInit(); - - AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - - return nRet; -} - -struct BurnDriverD BurnDrvVictnine = { - "victnine", NULL, NULL, NULL, "1984", - "Victorious Nine\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_TAITO_MISC, GBF_SPORTSMISC, 0, - NULL, victnineRomInfo, victnineRomName, NULL, NULL, VictnineInputInfo, VictnineDIPInfo, - victnineInit, DrvExit, DrvFrame, victnineDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - -static INT32 rumbaInit() -{ - select_game = 3; - - INT32 nRet = DrvInit(); - - return nRet; -} - -// Rumba Lumber - -static struct BurnRomInfo rumbaRomDesc[] = { - { "a23_01-1.bin", 0x4000, 0x4bea6e18, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu - { "a23_02-1.bin", 0x4000, 0x08f98c6f, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a23_03-1.bin", 0x4000, 0xab595427, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a23_08-1.bin", 0x2000, 0xa18eae00, 2 | BRF_PRG | BRF_ESS }, // 3 audiocpu - { "a23_09.bin", 0x2000, 0xd0a101d3, 2 | BRF_PRG | BRF_ESS }, // 4 - { "a23_10.bin", 0x2000, 0xf9447bd4, 2 | BRF_PRG | BRF_ESS }, // 5 - - { "a23_11.bin", 0x0800, 0xfddc99ce, 3 | BRF_PRG | BRF_ESS }, // 6 mcu - - { "a23_07.bin", 0x2000, 0xc98fbea6, 4 | BRF_GRA }, // 7 gfx1 - { "a23_06.bin", 0x2000, 0xbf1e3a7f, 4 | BRF_GRA }, // 8 - { "a23_05.bin", 0x2000, 0xb40db231, 4 | BRF_GRA }, // 9 - { "a23_04.bin", 0x2000, 0x1d4f001f, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(rumba) -STD_ROM_FN(rumba) - -struct BurnDriver BurnDrvRumba = { - "rumba", NULL, NULL, NULL, "1984", - "Rumba Lumber\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_MISC, 0, - NULL, rumbaRomInfo, rumbaRomName, NULL, NULL, RumbaInputInfo, RumbaDIPInfo, - rumbaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/taito/d_ksayakyu.cpp b/jan/src/burn/drv/taito/d_ksayakyu.cpp deleted file mode 100644 index 6b6a87383..000000000 --- a/jan/src/burn/drv/taito/d_ksayakyu.cpp +++ /dev/null @@ -1,604 +0,0 @@ -// FB Alpha Kusayakyuu (Sandlot Baseball) driver module -// Based on MAME driver by Tomasz Slanina - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "dac.h" -#include "burn_pal.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvMapROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static INT16 *pAY8910Buffer[6]; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 bankdata; -static UINT8 soundlatch; -static UINT8 sound_status; -static UINT8 video_control; -static INT32 flipscreen; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[1]; -static UINT8 DrvReset; - -static struct BurnInputInfo KsayakyuInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 7, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Ksayakyu) - -static struct BurnDIPInfo KsayakyuDIPList[]= -{ - {0x10, 0xff, 0xff, 0x38, NULL }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x10, 0x01, 0x03, 0x03, "2 Coins 1 Credits" }, - {0x10, 0x01, 0x03, 0x00, "1 Coin 1 Credits" }, - {0x10, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - {0x10, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x10, 0x01, 0x08, 0x08, "Upright" }, - {0x10, 0x01, 0x08, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 0, "Continue" }, - {0x10, 0x01, 0x40, 0x00, "7th inning" }, - {0x10, 0x01, 0x40, 0x40, "1st inning" }, -}; - -STDDIPINFO(Ksayakyu) - -static void bankswitch(INT32 data) -{ - bankdata = data & 1; - - ZetMapMemory(DrvZ80ROM0 + 0x10000 + (bankdata * 0x4000), 0x4000, 0x7fff, MAP_ROM); -} - -static void __fastcall ksayakyu_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa804: - video_control = data; - return; - - case 0xa805: - sound_status &= 0x7f; - soundlatch = data | 0x80; - return; - - case 0xa808: - bankswitch(data); - return; - } -} - -static UINT8 __fastcall ksayakyu_main_read(UINT16 address) -{ - switch (address) - { - case 0xa800: - case 0xa801: - case 0xa802: - return DrvInputs[address & 3]; - - case 0xa806: - return sound_status | 0x04; - - case 0xa803: - case 0xa807: - return 0; // watchdog? - } - - return 0; -} - -static void __fastcall ksayakyu_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa002: - case 0xa003: - AY8910Write(0, ~address & 1, data); - return; - - case 0xa006: - case 0xa007: - AY8910Write(1, ~address & 1, data); - return; - - case 0xa008: - DACWrite(0, data); - return; - - case 0xa00c: - sound_status |= 0x80; - soundlatch = 0; - return; - - case 0xa010: - return; // nop - } -} - -static UINT8 __fastcall ksayakyu_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa001: - return AY8910Read(0); - } - - return 0; -} - -static INT32 DrvDACSync() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / ((18432000.0000 / 8) / (nBurnFPS / 100.0000)))); -} - -static tilemap_callback( background ) -{ - INT32 attr = DrvMapROM[offs * 2 + 0]; - INT32 code = DrvMapROM[offs * 2 + 1] + ((attr & 3) << 8); - - TILE_SET_INFO(1, code, (attr >> 1) & 0x1e, (attr & 0x80) ? TILE_FLIPX : 0); -} - -static tilemap_callback( foreground ) -{ - INT32 attr = DrvVidRAM[offs * 2 + 0]; - INT32 code = DrvVidRAM[offs * 2 + 1] + ((attr & 3) << 8); - - TILE_SET_INFO(0, code, (attr >> 2) & 0xf, (attr & 0x80) ? TILE_FLIPX : 0); -} - -static UINT8 ay8910_0_portA_r(UINT32) -{ - return soundlatch; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - DACReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - soundlatch = 0; - sound_status = 0xff; - video_control = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x018000; - DrvZ80ROM1 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x010000; - - DrvMapROM = Next; Next += 0x004000; - - DrvColPROM = Next; Next += 0x000100; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000800; - DrvZ80RAM0 = Next; Next += 0x000800; - DrvZ80RAM1 = Next; Next += 0x000400; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Planes[3] = { 0, 0x2000 * 8, 0x2000 * 8 * 2 }; - INT32 XOffs[16] = { STEP8(0,1), STEP8(64,1) }; - INT32 YOffs[16] = { STEP8(0,8), STEP8(128,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x6000); - - GfxDecode(0x0400, 3, 8, 8, Planes, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x4000); - - GfxDecode(0x0400, 2, 8, 8, Planes, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x6000); - - GfxDecode(0x0100, 3, 16, 16, Planes, XOffs, YOffs, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x14000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x02000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x04000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM1 + 0x06000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 15, 1)) return 1; - - if (BurnLoadRom(DrvMapROM + 0x00001, 16, 2)) return 1; - if (BurnLoadRom(DrvMapROM + 0x00000, 17, 2)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 18, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80ROM0 + 0x8000, 0x8000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xa000, 0xa7ff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xb000, 0xb7ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xb800, 0xbfff, MAP_RAM); - ZetSetWriteHandler(ksayakyu_main_write); - ZetSetReadHandler(ksayakyu_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x8000, 0x83ff, MAP_RAM); - ZetSetWriteHandler(ksayakyu_sound_write); - ZetSetReadHandler(ksayakyu_sound_read); - ZetClose(); - - AY8910Init(0, 18432000/16, nBurnSoundRate, &ay8910_0_portA_r, NULL, NULL, NULL); - AY8910Init(1, 18432000/16, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - - DACInit(0, 0, 1, DrvDACSync); - DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - GenericTilemapInit(0, TILEMAP_SCAN_ROWS, background_map_callback, 8, 8, 32, 8 * 32); - GenericTilemapInit(1, TILEMAP_SCAN_ROWS, foreground_map_callback, 8, 8, 32, 32); - GenericTilemapSetGfx(0, DrvGfxROM0, 3, 8, 8, 0x10000, 0x00, 0xf); - GenericTilemapSetGfx(1, DrvGfxROM1, 2, 8, 8, 0x10000, 0x80, 0x1f); - GenericTilemapSetOffsets(TMAP_GLOBAL, 0, -16); - GenericTilemapSetTransparent(1, 0); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - DACExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - UINT8 r = DrvColPROM[i] & 0x07; - UINT8 g = (DrvColPROM[i] & 0x38) >> 3; - UINT8 b = DrvColPROM[i] >> 6; - - DrvPalette[i] = BurnHighCol(pal3bit(r), pal3bit(g), pal2bit(b), 0); - } -} - -static void draw_sprites() -{ - for (INT32 i = 0x400-4; i >= 0; i -= 4) - { - INT32 code = DrvSprRAM[i + 0]; - INT32 sy = DrvSprRAM[i + 1]; - INT32 sx = DrvSprRAM[i + 2]; - INT32 attr = DrvSprRAM[i + 3]; - INT32 color = (attr >> 3) & 0xf; - INT32 flipx = code & 0x80; - INT32 flipy = 1; - - if (flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - flipx ^= 0x80; - flipy ^= 1; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code & 0x7f, sx, sy - 16, color, 3, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code & 0x7f, sx, sy - 16, color, 3, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code & 0x7f, sx, sy - 16, color, 3, 0, 0, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code & 0x7f, sx, sy - 16, color, 3, 0, 0, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - flipscreen = video_control & 4; - - BurnTransferClear(); - - if (flipscreen) { - GenericTilemapSetFlip(TMAP_GLOBAL, ((video_control & 2) ? TMAP_FLIPY : (TMAP_FLIPY | TMAP_FLIPX)) ^ TMAP_FLIPY); - } else { - GenericTilemapSetFlip(TMAP_GLOBAL, ((video_control & 2) ? TMAP_FLIPX : 0) ^ TMAP_FLIPY); - } - - if ((video_control & 1) && (nBurnLayer & 1)) - { - GenericTilemapSetScrollY(0, ((video_control & 0xe0) << 3)); - - GenericTilemapDraw(0, pTransDraw, 0); - } - else - { - BurnTransferClear(); - } - - if (nBurnLayer & 2) GenericTilemapDraw(1, pTransDraw, 0); - - if (nBurnLayer & 4) draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - DrvInputs[2] = (DrvInputs[2] & 0x80) | (DrvDips[0] & 0x7f); - } - - ZetNewFrame(); - - INT32 nSegment; - INT32 nInterleave = 256; - INT32 nTotalCycles[2] = { (18432000 / 8) / 60, (18432000 / 8) / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nSegment = (nTotalCycles[0] - nCyclesDone[0]) / (nInterleave - i); - nCyclesDone[0] += ZetRun(nSegment); - if (i == 240) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(1); - nSegment = (nTotalCycles[1] - nCyclesDone[1]) / (nInterleave - i); - nCyclesDone[1] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029698; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - DACScan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(sound_status); - SCAN_VAR(bankdata); - SCAN_VAR(video_control); - } - - if (nAction & ACB_WRITE) - { - ZetOpen(0); - bankswitch(bankdata); - ZetClose(); - } - - return 0; -} - - -// Kusayakyuu - -static struct BurnRomInfo ksayakyuRomDesc[] = { - { "1.3a", 0x4000, 0x6607976d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "2.3b", 0x4000, 0xa289de5c, 1 | BRF_PRG | BRF_ESS }, // 1 - { "4.3d", 0x2000, 0xdb0ca023, 1 | BRF_PRG | BRF_ESS }, // 2 - { "3.3c", 0x4000, 0xbb4104a5, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "8.5l", 0x2000, 0x3fbae535, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 Code - { "7.5j", 0x2000, 0xad242eda, 2 | BRF_PRG | BRF_ESS }, // 5 - { "6.5h", 0x2000, 0x17986662, 2 | BRF_PRG | BRF_ESS }, // 6 - { "5.5f", 0x2000, 0xb0b21817, 2 | BRF_PRG | BRF_ESS }, // 7 - - { "9.3j", 0x2000, 0xef8411dd, 3 | BRF_GRA }, // 8 Foreground Tiles - { "10.3k", 0x2000, 0x1bdee573, 3 | BRF_GRA }, // 9 - { "11.3l", 0x2000, 0xc5859887, 3 | BRF_GRA }, // 10 - - { "14.9j", 0x2000, 0x982d06f0, 4 | BRF_GRA }, // 11 Sprites - { "15.9k", 0x2000, 0xdc126df9, 4 | BRF_GRA }, // 12 - { "16.9m", 0x2000, 0x574a172d, 4 | BRF_GRA }, // 13 - - { "17.9n", 0x2000, 0xa4c4e4ce, 5 | BRF_GRA }, // 14 Background Tiles - { "18.9r", 0x2000, 0x9d75b104, 5 | BRF_GRA }, // 15 - - { "13.7r", 0x2000, 0x0acb8c61, 6 | BRF_GRA }, // 16 Background Map - { "12.7n", 0x2000, 0xae8d6ed2, 6 | BRF_GRA }, // 17 - - { "9f.bin", 0x0100, 0xff71b27f, 7 | BRF_GRA }, // 18 Color data -}; - -STD_ROM_PICK(ksayakyu) -STD_ROM_FN(ksayakyu) - -struct BurnDriver BurnDrvKsayakyu = { - "ksayakyu", NULL, NULL, NULL, "1985", - "Kusayakyuu\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SPORTSMISC, 0, - NULL, ksayakyuRomInfo, ksayakyuRomName, NULL, NULL, KsayakyuInputInfo, KsayakyuDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_lkage.cpp b/jan/src/burn/drv/taito/d_lkage.cpp deleted file mode 100644 index dc92019be..000000000 --- a/jan/src/burn/drv/taito/d_lkage.cpp +++ /dev/null @@ -1,1187 +0,0 @@ -// FB Alpha Legend of Kage driver Module -// Based on MAME driver by Phil Stroffolino - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "taito_m68705.h" -#include "burn_ym2203.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvPortData; -static UINT8 *DrvMcuROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvMcuRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvUnkRAM; -static UINT8 *lkage_scroll; -static UINT8 *DrvVidReg; -static UINT32 *DrvPalette; -static UINT32 *Palette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInps[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static UINT8 flipscreen_x; -static UINT8 flipscreen_y; -static UINT8 soundlatch; - -static INT32 DrvNmiEnable; -static INT32 pending_nmi; - -static INT32 use_mcu; -static INT32 Lkageb; -static INT32 FakeMCUVal; - -static struct BurnInputInfo LkageInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 5, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 4, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 5, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 4, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Lkage) - -static struct BurnDIPInfo LkageDIPList[]= -{ - {0x13, 0xff, 0xff, 0x7f, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0xfe, NULL }, - - {0 , 0xfe, 0 , 4, "Bonus_Life" }, - {0x13, 0x01, 0x03, 0x03, "30000 100000" }, - {0x13, 0x01, 0x03, 0x02, "30000 70000" }, - {0x13, 0x01, 0x03, 0x01, "20000 70000" }, - {0x13, 0x01, 0x03, 0x00, "20000 50000" }, - - {0 , 0xfe, 0 , 2, "Free_Play" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x18, 0x18, "3" }, - {0x13, 0x01, 0x18, 0x10, "4" }, - {0x13, 0x01, 0x18, 0x08, "5" }, - {0x13, 0x01, 0x18, 0x00, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x40, "Off" }, - {0x13, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 16, "Coin_A" }, - {0x14, 0x01, 0x0f, 0x0f, "9 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "8 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "7 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "6 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin_B" }, - {0x14, 0x01, 0xf0, 0xf0, "9 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "8 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "7 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "6 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x01, 0x01, "Off" }, - {0x15, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Initial Season" }, - {0x15, 0x01, 0x02, 0x02, "Spring" }, - {0x15, 0x01, 0x02, 0x00, "Winter" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x0c, 0x0c, "Easiest" }, - {0x15, 0x01, 0x0c, 0x08, "Easy" }, - {0x15, 0x01, 0x0c, 0x04, "Normal" }, - {0x15, 0x01, 0x0c, 0x00, "Hard" }, - - {0 , 0xfe, 0 , 2, "Coinage Display" }, - {0x15, 0x01, 0x10, 0x10, "Coins/Credits" }, - {0x15, 0x01, 0x10, 0x00, "Insert Coin" }, - - {0 , 0xfe, 0 , 2, "Year Display" }, - {0x15, 0x01, 0x20, 0x00, "1985" }, - {0x15, 0x01, 0x20, 0x20, "MCMLXXXIV" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x15, 0x01, 0x80, 0x80, "A and B" }, - {0x15, 0x01, 0x80, 0x00, "A only" }, -}; - -STDDIPINFO(Lkage) - -static struct BurnDIPInfo BygoneDIPList[]= -{ - {0x13, 0xff, 0xff, 0x3c, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x40, NULL }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x18, 0x18, "3" }, - {0x13, 0x01, 0x18, 0x10, "4" }, - {0x13, 0x01, 0x18, 0x08, "5" }, - {0x13, 0x01, 0x18, 0x00, "255 (Cheat)" }, - - {0 , 0xfe, 0 , 0, "Flip Screen" }, - {0x13, 0x01, 0x40, 0x00, "Off" }, - {0x13, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x80, 0x00, "Upright" }, - {0x13, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x14, 0x01, 0x0f, 0x0f, "9 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0e, "8 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0d, "7 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0c, "6 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x14, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x14, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x14, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x14, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x14, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x14, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x14, 0x01, 0xf0, 0xf0, "9 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xe0, "8 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xd0, "7 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xc0, "6 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x14, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x14, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x14, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x14, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x14, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Bygone) - -void __fastcall lkage_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf800) == 0xe800) { - - DrvPalRAM[address & 0x7ff] = data; - - UINT16 col = (DrvPalRAM[(address & 0x7fe) | 1] << 8) | DrvPalRAM[(address & 0x7fe) | 0]; - - UINT8 r, g, b; - - r = (col >> 8) & 0x0f; - r |= r << 4; - - g = (col >> 4) & 0x0f; - g |= g << 4; - - b = (col >> 0) & 0x0f; - b |= b << 4; - - Palette[(address & 0x7ff) >> 1] = (r << 16) | (g << 8) | b; - DrvPalette[(address & 0x7ff) >> 1] = BurnHighCol(r, g, b, 0); - - return; - } - - switch (address) - { - case 0xf000: - case 0xf001: - case 0xf002: - case 0xf003: - DrvVidReg[address & 3] = data; - return; - - case 0xf060: - soundlatch = data; - if (DrvNmiEnable) { - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - } else { - pending_nmi = 1; - } - return; - - case 0xf061: - case 0xf063: - case 0xf0e1: - return; - - case 0xf062: { - if (Lkageb) { - FakeMCUVal = data; - } else { - standard_taito_mcu_write(data); - } - return; - } - - case 0xf0a0: - case 0xf0a1: - case 0xf0a2: - case 0xf0a3: - DrvUnkRAM[address & 3] = data; - return; - - case 0xf0c0: - case 0xf0c1: - case 0xf0c2: - case 0xf0c3: - case 0xf0c4: - case 0xf0c5: - lkage_scroll[address & 7] = data; - return; - } -} - -UINT8 __fastcall lkage_main_read(UINT16 address) -{ - switch (address) - { - case 0xf000: - case 0xf001: - case 0xf002: - case 0xf003: - return DrvVidReg[address & 3]; - - case 0xf061: - return 0xff; // sound status - - case 0xf062: { - if (Lkageb) { - switch (FakeMCUVal) { - case 0x01: return FakeMCUVal - 0x01; - case 0x90: return FakeMCUVal + 0x43; - case 0xa6: return FakeMCUVal + 0x27; - case 0x34: return FakeMCUVal + 0x7f; - case 0x48: return FakeMCUVal + 0xb7; - default: return FakeMCUVal; - } - } else { - return standard_taito_mcu_read(); - } - } - - case 0xf080: - case 0xf081: - case 0xf082: - return DrvDips[address & 3]; - - case 0xf083: - return DrvInps[0]; - - case 0xf084: - case 0xf085: - return DrvInps[address - 0xf083]; - - case 0xf087: { - if (Lkageb) { - return 0x03; - } else { - INT32 res = 0; - if (!main_sent) res |= 0x01; - if (mcu_sent) res |= 0x02; - return res; - } - } - - case 0xf0a0: - case 0xf0a1: - case 0xf0a2: - case 0xf0a3: - return DrvUnkRAM[address & 3]; - - case 0xf0c0: - case 0xf0c1: - case 0xf0c2: - case 0xf0c3: - case 0xf0c4: - case 0xf0c5: - return lkage_scroll[address & 7]; - } - - return 0; -} - -UINT8 __fastcall lkage_main_in(UINT16 port) -{ - if ((port & 0xc000) == 0x4000) { - return DrvPortData[port & 0x3fff]; - } - - return 0; -} - -UINT8 __fastcall lkage_sound_read(UINT16 address) -{ - switch (address) - { - case 0x9000: - return BurnYM2203Read(0, 0); - - case 0xa000: - return BurnYM2203Read(1, 0); - - case 0xb000: - return soundlatch; - - case 0xb001: - return 0; - } - - return 0; -} - -void __fastcall lkage_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x9000: - case 0x9001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xa000: - case 0xa001: - BurnYM2203Write(1, address & 1, data); - return; - - case 0xb000: - return; - - case 0xb001: - { - DrvNmiEnable = 1; - if (pending_nmi) { - ZetNmi(); - pending_nmi = 0; - } - } - return; - - case 0xb002: - DrvNmiEnable = 0; - return; - } -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 6000000.0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - for (INT32 i = 0; i < 2; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - m67805_taito_reset(); - - BurnYM2203Reset(); - - soundlatch = 0; - flipscreen_x = 0; - flipscreen_y = 0; - - DrvNmiEnable = 0; - pending_nmi = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvMcuROM = Next; Next += 0x000800; - - DrvPortData = Next; Next += 0x004000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x020000; - - DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - Palette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32); - - AllRam = Next; - - DrvVidRAM = Next; Next += 0x000c00; - - DrvZ80RAM0 = Next; Next += 0x000800; - DrvZ80RAM1 = Next; Next += 0x000800; - - DrvPalRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000100; - - DrvUnkRAM = Next; Next += 0x000004; - - DrvMcuRAM = Next; Next += 0x000080; - - lkage_scroll = Next; Next += 0x000006; - DrvVidReg = Next; Next += 0x000004; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane[4] = { 0x20000, 0x00000, 0x60000, 0x40000 }; - INT32 XOffs[16] = { 7, 6, 5, 4, 3, 2, 1, 0, - 64+7, 64+6, 64+5, 64+4, 64+3, 64+2, 64+1, 64+0}; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 128+0*8, 128+1*8, 128+2*8, 128+3*8, 128+4*8, 128+5*8, 128+6*8, 128+7*8 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x10000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x10000); - - GfxDecode(0x800, 4, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - GfxDecode(0x200, 4, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); - - BurnFree (tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - use_mcu = ~BurnDrvGetFlags() & BDF_BOOTLEG; - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x8000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 2, 1)) return 1; - - if (BurnLoadRom(DrvPortData, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x4000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x8000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xc000, 7, 1)) return 1; - - if (use_mcu) { - if (BurnLoadRom(DrvMcuROM + 0x0000, 9, 1)) return 1; - } - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0xdfff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0xdfff, 2, DrvZ80ROM0); - ZetMapArea(0xe000, 0xe7ff, 0, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe7ff, 1, DrvZ80RAM0); - ZetMapArea(0xe000, 0xe7ff, 2, DrvZ80RAM0); - ZetMapArea(0xe800, 0xefff, 0, DrvPalRAM); -// ZetMapArea(0xe800, 0xefff, 1, DrvPalRAM); - ZetMapArea(0xe800, 0xefff, 2, DrvPalRAM); - ZetMapArea(0xf100, 0xf1ff, 0, DrvSprRAM); // 0xf100 - 0xf15f - ZetMapArea(0xf100, 0xf1ff, 1, DrvSprRAM); - ZetMapArea(0xf100, 0xf1ff, 2, DrvSprRAM); - ZetMapArea(0xf400, 0xffff, 0, DrvVidRAM); - ZetMapArea(0xf400, 0xffff, 1, DrvVidRAM); - ZetMapArea(0xf400, 0xffff, 2, DrvVidRAM); - ZetSetWriteHandler(lkage_main_write); - ZetSetReadHandler(lkage_main_read); - ZetSetInHandler(lkage_main_in); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); - //ZetMapArea(0xe000, 0xefff, 0, DrvZ80ROM1 + 0xe000); - //ZetMapArea(0xe000, 0xefff, 2, DrvZ80ROM1 + 0xe000); - ZetSetWriteHandler(lkage_sound_write); - ZetSetReadHandler(lkage_sound_read); - ZetClose(); - - m67805_taito_init(DrvMcuROM, DrvMcuRAM, &standard_m68705_interface); - - BurnYM2203Init(2, 4000000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(6000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_YM2203_ROUTE, 0.40, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - m67805_taito_exit(); - - BurnYM2203Exit(); - - BurnFree (AllMem); - - Lkageb = 0; - FakeMCUVal = 0; - - return 0; -} - - -static void draw_sprites(INT32 prio) -{ - INT32 dx = (strcmp ("bygone", BurnDrvGetTextA(DRV_NAME)) == 0) ? 1 : 0; - - const UINT8 *source = DrvSprRAM + 0x60 - 4; - const UINT8 *finish = DrvSprRAM; - - while (source >= finish) - { - INT32 attributes = source[2]; - INT32 priority = attributes >> 7; - if (priority != prio) { - source -= 4; - continue; - } - - INT32 color = (attributes>>4)&7; - INT32 flipx = attributes & 0x01; - INT32 flipy = attributes & 0x02; - INT32 height = (attributes & 0x08) ? 2 : 1; - INT32 sx = source[0]-15+dx; - INT32 sy = 256-16*height-source[1]; - INT32 sprite_number = source[3] + ((attributes & 0x04) << 6); - INT32 y; - - if (flipscreen_x) - { - sx = 239 - sx - 24; - flipx = !flipx; - sx += 16; - } - if (flipscreen_y) - { - sy = 254 - 16*height - sy; - flipy = !flipy; - } - if (height == 2 && !flipy) - { - sprite_number ^= 1; - } - - sx -= 16; - sy -= 16; - - if (sx < -15) sx += 256; - - for (y = 0;y < height;y++) - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, sprite_number ^ y, sx, sy + (y << 4), color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, sprite_number ^ y, sx, sy + (y << 4), color, 4, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, sprite_number ^ y, sx, sy + (y << 4), color, 4, 0, 0, DrvGfxROM1); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, sprite_number ^ y, sx, sy + (y << 4), color, 4, 0, 0, DrvGfxROM1); - } - } - } - source -= 4; - } -} - -static void draw_layer(INT32 offset, INT32 bank, INT32 color, INT32 transp, INT32 scrollx, INT32 scrolly) -{ - color >>= 4; - - if (flipscreen_x) { - scrollx *= -1; - } - - if (flipscreen_y) { - scrolly *= -1; - } - - UINT8 *src = DrvVidRAM + offset; - - INT32 x_minus = flipscreen_x ? 24 : 16; - - for (INT32 offs = 0; offs < 0x400; offs++) - { - INT32 code = src[offs] | (bank << 8); - - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - if (flipscreen_x) sx ^= 0xf8; - if (flipscreen_y) sy ^= 0xf8; - - sx -= scrollx; - sy -= scrolly; - - sx -= x_minus; - sy -= 16; - - if (sx < -7) sx += 256; - if (sy < -15) sy += 256; - if (sx > 239) sx -= 256; - if (sy > 223) sy -= 256; - - if (transp) { - if (flipscreen_y) { - if (flipscreen_x) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } - } else { - if (flipscreen_x) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM0); - } - } - } else { - if (flipscreen_y) { - if (flipscreen_x) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } else { - if (flipscreen_x) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM0); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i++) { - INT32 rgb = Palette[i]; - DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0); - } - DrvRecalc = 0; - } - - flipscreen_x = ~DrvVidReg[2] & 0x01; - flipscreen_y = ~DrvVidReg[2] & 0x02; - - INT32 color_bank = (DrvVidReg[1] & 0xf0); - INT32 bg_bank = ((DrvVidReg[1] & 0x08) >> 1) + 1; - INT32 fg_bank = (DrvVidReg[0] & 0x04) >> 2; - INT32 tx_bank = (DrvVidReg[0] & 0x02) << 1; // bygone - -// if ((DrvVidReg[2] & 0xf0) == 0xf0) // mame - if ((DrvVidReg[2] & 0x0f) == 0x03) // Correct? Seems to give proper results in bygone... - { - draw_layer(0x800, bg_bank, 0x300 | color_bank, 0, lkage_scroll[4]+5, lkage_scroll[5]); - - draw_sprites(1); - - if (~DrvVidReg[1] & 2) draw_sprites(0); - - draw_layer(0x400, fg_bank, 0x200 | color_bank, 1, lkage_scroll[2]+3, lkage_scroll[3]); - - if ( DrvVidReg[1] & 2) draw_sprites(0); - - draw_layer(0x000, tx_bank, 0x110, 1, lkage_scroll[0]+1, lkage_scroll[1]); - } - else - { - if (nBurnLayer & 4)draw_layer(0x000, 0, 0x110, 0, lkage_scroll[0]+1, lkage_scroll[1]); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - DrvInps[0] = 0x0b; - DrvInps[1] = DrvInps[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - DrvInps[0] ^= (DrvJoy1[i] & 1) << i; - DrvInps[1] ^= (DrvJoy2[i] & 1) << i; - DrvInps[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[3] = { 6000000 / 60, 6000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext, nCyclesSegment; - - // Run Z80 #1 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - if (i == 99) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - // Run Z80 #2 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - BurnTimerUpdate(i * (nCyclesTotal[1] / nInterleave)); - ZetClose(); - - if (use_mcu) { - m6805Open(0); - nCyclesSegment = nCyclesTotal[2] / nInterleave; - nCyclesDone[2] += m6805Run(nCyclesSegment); - m6805Close(); - } - } - - ZetOpen(1); - BurnTimerEndFrame(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029697; - } - - if (nAction & ACB_VOLATILE) { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - - ZetScan(nAction); - BurnYM2203Scan(nAction, pnMin); - - SCAN_VAR(soundlatch); - SCAN_VAR(flipscreen_x); - SCAN_VAR(flipscreen_y); - SCAN_VAR(DrvNmiEnable); - SCAN_VAR(pending_nmi); - - DrvRecalc = 1; - } - - return 0; -} - - -// The Legend of Kage - -static struct BurnRomInfo lkageRomDesc[] = { - { "a54-01-2.37", 0x8000, 0x60fd9734, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a54-02-2.38", 0x8000, 0x878a25ce, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a54-04.54", 0x8000, 0x541faf9a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "a54-03.51", 0x4000, 0x493e76d8, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 #0 Data - - { "a54-05-1.84", 0x4000, 0x0033c06a, 4 | BRF_GRA }, // 4 Graphics - { "a54-06-1.85", 0x4000, 0x9f04d9ad, 4 | BRF_GRA }, // 5 - { "a54-07-1.86", 0x4000, 0xb20561a4, 4 | BRF_GRA }, // 6 - { "a54-08-1.87", 0x4000, 0x3ff3b230, 4 | BRF_GRA }, // 7 - - { "a54-10.2", 0x0200, 0x17dfbd14, 5 | BRF_OPT }, // 8 Prom (unused) - - { "a54-09.53", 0x0800, 0x0e8b8846, 6 | BRF_PRG | BRF_OPT }, // 9 68705 Code - - { "pal16l8-a54-11.34", 0x0104, 0x56232113, 7 | BRF_OPT }, // 10 Plds (unused) - { "pal16l8-a54-12.76", 0x0104, 0xe57c3c89, 7 | BRF_OPT }, // 11 - { "pal16l8a-a54-13.27", 0x0104, 0xc9b1938e, 7 | BRF_OPT }, // 12 - { "pal16l8a-a54-14.35", 0x0104, 0xa89c644e, 7 | BRF_OPT }, // 13 -}; - -STD_ROM_PICK(lkage) -STD_ROM_FN(lkage) - -struct BurnDriver BurnDrvLkage = { - "lkage", NULL, NULL, NULL, "1984", - "The Legend of Kage\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, lkageRomInfo, lkageRomName, NULL, NULL, LkageInputInfo, LkageDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// The Legend of Kage (older) - -static struct BurnRomInfo lkageoRomDesc[] = { - { "a54-01-1.37", 0x8000, 0x973da9c5, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a54-02-1.38", 0x8000, 0x27b509da, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a54-04.54", 0x8000, 0x541faf9a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "a54-03.51", 0x4000, 0x493e76d8, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 #0 Data - - { "a54-05-1.84", 0x4000, 0x0033c06a, 4 | BRF_GRA }, // 4 Graphics - { "a54-06-1.85", 0x4000, 0x9f04d9ad, 4 | BRF_GRA }, // 5 - { "a54-07-1.86", 0x4000, 0xb20561a4, 4 | BRF_GRA }, // 6 - { "a54-08-1.87", 0x4000, 0x3ff3b230, 4 | BRF_GRA }, // 7 - - { "a54-10.2", 0x0200, 0x17dfbd14, 5 | BRF_OPT }, // 8 Prom (unused) - - { "a54-09.53", 0x0800, 0x0e8b8846, 6 | BRF_PRG | BRF_OPT }, // 9 68705 Code - - { "pal16l8-a54-11.34", 0x0104, 0x56232113, 7 | BRF_OPT }, // 10 Plds (unused) - { "pal16l8-a54-12.76", 0x0104, 0xe57c3c89, 7 | BRF_OPT }, // 11 - { "pal16l8a-a54-13.27", 0x0104, 0xc9b1938e, 7 | BRF_OPT }, // 12 - { "pal16l8a-a54-14.35", 0x0104, 0xa89c644e, 7 | BRF_OPT }, // 13 -}; - -STD_ROM_PICK(lkageo) -STD_ROM_FN(lkageo) - -struct BurnDriver BurnDrvLkageo = { - "lkageo", "lkage", NULL, NULL, "1984", - "The Legend of Kage (older)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, lkageoRomInfo, lkageoRomName, NULL, NULL, LkageInputInfo, LkageDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// The Legend of Kage (oldest) - -static struct BurnRomInfo lkageooRomDesc[] = { - { "a54-01.37", 0x8000, 0x34eab2c5, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a54-02.38", 0x8000, 0xea471d8a, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a54-04.54", 0x8000, 0x541faf9a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "a54-03.51", 0x4000, 0x493e76d8, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 #0 Data - - { "a54-05.84", 0x4000, 0x76753e52, 4 | BRF_GRA }, // 4 Graphics - { "a54-06.85", 0x4000, 0xf33c015c, 4 | BRF_GRA }, // 5 - { "a54-07.86", 0x4000, 0x0e02c2e8, 4 | BRF_GRA }, // 6 - { "a54-08.87", 0x4000, 0x4ef5f073, 4 | BRF_GRA }, // 7 - - { "a54-10.2", 0x0200, 0x17dfbd14, 5 | BRF_OPT }, // 8 Prom (unused) - - { "a54-09.53", 0x0800, 0x0e8b8846, 6 | BRF_PRG | BRF_OPT }, // 9 68705 Code - - { "pal16l8-a54-11.34", 0x0104, 0x56232113, 7 | BRF_OPT }, // 10 Plds (unused) - { "pal16l8-a54-12.76", 0x0104, 0xe57c3c89, 7 | BRF_OPT }, // 11 - { "pal16l8a-a54-13.27", 0x0104, 0xc9b1938e, 7 | BRF_OPT }, // 12 - { "pal16l8a-a54-14.35", 0x0104, 0xa89c644e, 7 | BRF_OPT }, // 13 -}; - -STD_ROM_PICK(lkageoo) -STD_ROM_FN(lkageoo) - -struct BurnDriver BurnDrvLkageoo = { - "lkageoo", "lkage", NULL, NULL, "1984", - "The Legend of Kage (oldest)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, lkageooRomInfo, lkageooRomName, NULL, NULL, LkageInputInfo, LkageDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// The Legend of Kage (bootleg set 1) - -static struct BurnRomInfo lkagebRomDesc[] = { - { "ic37_1", 0x8000, 0x05694f7b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "ic38_2", 0x8000, 0x22efe29e, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a54-04.54", 0x8000, 0x541faf9a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "a54-03.51", 0x4000, 0x493e76d8, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 #0 Data - - { "ic93_5", 0x4000, 0x76753e52, 4 | BRF_GRA }, // 4 Graphics - { "ic94_6", 0x4000, 0xf33c015c, 4 | BRF_GRA }, // 5 - { "ic95_7", 0x4000, 0x0e02c2e8, 4 | BRF_GRA }, // 6 - { "ic96_8", 0x4000, 0x4ef5f073, 4 | BRF_GRA }, // 7 - - { "a54-10.2", 0x0200, 0x17dfbd14, 5 | BRF_OPT }, // 8 Prom (unused) -}; - -STD_ROM_PICK(lkageb) -STD_ROM_FN(lkageb) - -static INT32 LkagebInit() -{ - Lkageb = 1; - - return DrvInit(); -} - -struct BurnDriver BurnDrvLkageb = { - "lkageb", "lkage", NULL, NULL, "1984", - "The Legend of Kage (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, lkagebRomInfo, lkagebRomName, NULL, NULL, LkageInputInfo, LkageDIPInfo, - LkagebInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// The Legend of Kage (bootleg set 2) - -static struct BurnRomInfo lkageb2RomDesc[] = { - { "lok.a", 0x8000, 0x866df793, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "lok.b", 0x8000, 0xfba9400f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a54-04.54", 0x8000, 0x541faf9a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "a54-03.51", 0x4000, 0x493e76d8, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 #0 Data - - { "ic93_5", 0x4000, 0x76753e52, 4 | BRF_GRA }, // 4 Graphics - { "ic94_6", 0x4000, 0xf33c015c, 4 | BRF_GRA }, // 5 - { "ic95_7", 0x4000, 0x0e02c2e8, 4 | BRF_GRA }, // 6 - { "ic96_8", 0x4000, 0x4ef5f073, 4 | BRF_GRA }, // 7 - - { "a54-10.2", 0x0200, 0x17dfbd14, 5 | BRF_OPT }, // 8 Prom (unused) -}; - -STD_ROM_PICK(lkageb2) -STD_ROM_FN(lkageb2) - -struct BurnDriver BurnDrvLkageb2 = { - "lkageb2", "lkage", NULL, NULL, "1984", - "The Legend of Kage (bootleg set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, lkageb2RomInfo, lkageb2RomName, NULL, NULL, LkageInputInfo, LkageDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// The Legend of Kage (bootleg set 3) - -static struct BurnRomInfo lkageb3RomDesc[] = { - { "z1.bin", 0x8000, 0x60cac488, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "z2.bin", 0x8000, 0x22c95f17, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a54-04.54", 0x8000, 0x541faf9a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "a54-03.51", 0x4000, 0x493e76d8, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 #0 Data - - { "ic93_5", 0x4000, 0x76753e52, 4 | BRF_GRA }, // 4 Graphics - { "ic94_6", 0x4000, 0xf33c015c, 4 | BRF_GRA }, // 5 - { "ic95_7", 0x4000, 0x0e02c2e8, 4 | BRF_GRA }, // 6 - { "ic96_8", 0x4000, 0x4ef5f073, 4 | BRF_GRA }, // 7 - - { "a54-10.2", 0x0200, 0x17dfbd14, 5 | BRF_OPT }, // 8 Prom (unused) -}; - -STD_ROM_PICK(lkageb3) -STD_ROM_FN(lkageb3) - -struct BurnDriver BurnDrvLkageb3 = { - "lkageb3", "lkage", NULL, NULL, "1984", - "The Legend of Kage (bootleg set 3)\0", NULL, "bootleg", "hardware", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, lkageb3RomInfo, lkageb3RomName, NULL, NULL, LkageInputInfo, LkageDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; - - -// Bygone - -static struct BurnRomInfo bygoneRomDesc[] = { - { "a53_05.ic37", 0x8000, 0x63a3f08b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a53_06.ic38", 0x8000, 0xcb0dcb08, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a53_07.ic54", 0x8000, 0x72f69a77, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "a53_08.ic51", 0x4000, 0xf85139f9, 3 | BRF_PRG | BRF_ESS }, // 3 Z80 #0 Data - - { "a53_01.ic84", 0x4000, 0x38cf7fb2, 4 | BRF_GRA }, // 4 Graphics - { "a53_02.ic85", 0x4000, 0xdca7adfe, 4 | BRF_GRA }, // 5 - { "a53_03.ic86", 0x4000, 0xaf3eb997, 4 | BRF_GRA }, // 6 - { "a53_04.ic87", 0x4000, 0x65af72d3, 4 | BRF_GRA }, // 7 - - { "a54-10.ic2", 0x0400, 0x369722d9, 5 | BRF_OPT }, // 8 Prom (unused) - - { "a51_09.ic53", 0x0800, 0x0e8b8846, 6 | BRF_PRG | BRF_OPT }, // 9 68705 Code -}; - -STD_ROM_PICK(bygone) -STD_ROM_FN(bygone) - -struct BurnDriver BurnDrvBygone = { - "bygone", NULL, NULL, NULL, "1985", - "Bygone\0", "Imperfect sound", "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, bygoneRomInfo, bygoneRomName, NULL, NULL, LkageInputInfo, BygoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x400, - 240, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_minivdr.cpp b/jan/src/burn/drv/taito/d_minivdr.cpp deleted file mode 100644 index 1080db389..000000000 --- a/jan/src/burn/drv/taito/d_minivdr.cpp +++ /dev/null @@ -1,197 +0,0 @@ -// FB Alpha Minivader driver module -//Based on MAME Driver by Takahiro Nogi - -#include "tiles_generic.h" -#include "z80_intf.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; - -static UINT8 DrvJoy1[4]; -static UINT8 DrvInputs[1]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 3, "p1 coin" }, - {"P1 Left" , BIT_DIGITAL , DrvJoy1 + 0, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL , DrvJoy1 + 2, "p1 fire 1"}, - - {"Reset" , BIT_DIGITAL , &DrvReset , "reset" }, -}; - -STDINPUTINFO(Drv) - -UINT8 __fastcall minivdr_read(UINT16 address) -{ - if (address == 0xe008) { - return DrvInputs[0]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM = Next; Next += 0x010000; - - AllRam = Next; - - DrvZ80RAM = Next; Next += 0x002000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM, 0, 1)) return 1; - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea (0x0000, 0x1fff, 0, DrvZ80ROM); - ZetMapArea (0x0000, 0x1fff, 2, DrvZ80ROM); - ZetMapArea (0xa000, 0xbfff, 0, DrvZ80RAM); - ZetMapArea (0xa000, 0xbfff, 1, DrvZ80RAM); - ZetMapArea (0xa000, 0xbfff, 2, DrvZ80RAM); - ZetSetReadHandler(minivdr_read); - ZetClose(); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - BurnFree (AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - UINT32 DrvPalette[2]; - - DrvPalette[0] = 0; - DrvPalette[1] = BurnHighCol(0xff, 0xff, 0xff, 0); - - for (INT32 offs = 0x200; offs < 0x1e00; offs++) - { - INT32 sx = (offs << 3) & 0xf8; - INT32 sy = ((offs >> 5) - 0x10) << 8; - INT32 d = DrvZ80RAM[offs]; - - for (INT32 i = 0; i < 8; i++, sx++) - { - pTransDraw[sx + sy] = (d >> (7 - i)) & 1; - } - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - DrvInputs[0] = 0xff; - for (INT32 i = 0; i < 4; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - } - } - - ZetOpen(0); - ZetRun(4000000 / 60); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - } - - return 0; -} - - -// Minivader - -static struct BurnRomInfo minivadrRomDesc[] = { - { "d26-01.ic7", 0x2000, 0xa96c823d, BRF_ESS | BRF_PRG }, // Z80 code -}; - -STD_ROM_PICK(minivadr) -STD_ROM_FN(minivadr) - -struct BurnDriver BurnDrvminivadr = { - "minivadr", NULL, NULL, NULL, "1990", - "Minivader\0", NULL, "Taito Corporation", "Minivader", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 1, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, minivadrRomInfo, minivadrRomName, NULL, NULL, DrvInputInfo, NULL, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_othunder.cpp b/jan/src/burn/drv/taito/d_othunder.cpp deleted file mode 100644 index 7e6370818..000000000 --- a/jan/src/burn/drv/taito/d_othunder.cpp +++ /dev/null @@ -1,1287 +0,0 @@ -// Based on MAME driver by David Graves - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "taito.h" -#include "taito_ic.h" -#include "burn_ym2610.h" -#include "eeprom.h" -#include "burn_gun.h" - -static void OthunderDraw(); - -static double OthunderYM2610AY8910RouteMasterVol; -static double OthunderYM2610Route1MasterVol; -static double OthunderYM2610Route2MasterVol; -static UINT8 *OthunderPan; - -#ifdef BUILD_A68K -static bool bUseAsm68KCoreOldValue = false; -#endif - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo OthunderInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p2 start" }, - - A("P1 Gun X" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "mouse x-axis" ), - A("P1 Gun Y" , BIT_ANALOG_REL, &TaitoAnalogPort1 , "mouse y-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "mouse button 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "mouse button 2" }, - - A("P2 Gun X" , BIT_ANALOG_REL, &TaitoAnalogPort2 , "p2 x-axis" ), - A("P2 Gun Y" , BIT_ANALOG_REL, &TaitoAnalogPort3 , "p2 y-axis" ), - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "service" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, - {"Dip 3" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, -}; - -STDINPUTINFO(Othunder) - -#undef A - -static void TC0220IOCMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0xff; - TC0220IOCInput[1] = 0xff; - TC0220IOCInput[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - TC0220IOCInput[0] -= (TC0220IOCInputPort0[i] & 1) << i; - TC0220IOCInput[1] -= (TC0220IOCInputPort1[i] & 1) << i; - TC0220IOCInput[2] -= (TC0220IOCInputPort2[i] & 1) << i; - } -} - -static void OthunderMakeInputs() -{ - TC0220IOCMakeInputs(); - - BurnGunMakeInputs(0, (INT16)TaitoAnalogPort0, (INT16)TaitoAnalogPort1); - BurnGunMakeInputs(1, (INT16)TaitoAnalogPort2, (INT16)TaitoAnalogPort3); -} - -static struct BurnDIPInfo OthunderDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0x7f, NULL }, - {0x10, 0xff, 0xff, 0x07, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0e, 0x01, 0x02, 0x00, "Off" }, - {0x0e, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x04, 0x04, "Off" }, - {0x0e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x08, 0x00, "Off" }, - {0x0e, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0e, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0e, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0f, 0x01, 0x03, 0x02, "Easy" }, - {0x0f, 0x01, 0x03, 0x03, "Medium" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Magazines/Rockets" }, - {0x0f, 0x01, 0x0c, 0x0c, "5/3" }, - {0x0f, 0x01, 0x0c, 0x08, "6/4" }, - {0x0f, 0x01, 0x0c, 0x04, "7/5" }, - {0x0f, 0x01, 0x0c, 0x00, "8/6" }, - - {0 , 0xfe, 0 , 4 , "Bullets per Magazine" }, - {0x0f, 0x01, 0x30, 0x00, "30" }, - {0x0f, 0x01, 0x30, 0x10, "35" }, - {0x0f, 0x01, 0x30, 0x30, "40" }, - {0x0f, 0x01, 0x30, 0x20, "50" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0f, 0x01, 0x80, 0x00, "English" }, - {0x0f, 0x01, 0x80, 0x80, "Japanese" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Stereo Seperation" }, - {0x10, 0x01, 0x07, 0x07, "Maximum" }, - {0x10, 0x01, 0x07, 0x03, "High" }, - {0x10, 0x01, 0x07, 0x01, "Medium" }, - {0x10, 0x01, 0x07, 0x00, "Low" }, -}; - -STDDIPINFO(Othunder) - -static struct BurnDIPInfo OthunderjDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0x7f, NULL }, - {0x10, 0xff, 0xff, 0x07, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0e, 0x01, 0x02, 0x00, "Off" }, - {0x0e, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x04, 0x04, "Off" }, - {0x0e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x08, 0x00, "Off" }, - {0x0e, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0e, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0e, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0f, 0x01, 0x03, 0x02, "Easy" }, - {0x0f, 0x01, 0x03, 0x03, "Medium" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Magazines/Rockets" }, - {0x0f, 0x01, 0x0c, 0x0c, "5/3" }, - {0x0f, 0x01, 0x0c, 0x08, "6/4" }, - {0x0f, 0x01, 0x0c, 0x04, "7/5" }, - {0x0f, 0x01, 0x0c, 0x00, "8/6" }, - - {0 , 0xfe, 0 , 4 , "Bullets per Magazine" }, - {0x0f, 0x01, 0x30, 0x00, "30" }, - {0x0f, 0x01, 0x30, 0x10, "35" }, - {0x0f, 0x01, 0x30, 0x30, "40" }, - {0x0f, 0x01, 0x30, 0x20, "50" }, - - {0 , 0xfe, 0 , 2 , "language" }, - {0x0f, 0x01, 0x80, 0x00, "English" }, - {0x0f, 0x01, 0x80, 0x80, "Japanese" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Stereo Seperation" }, - {0x10, 0x01, 0x07, 0x07, "Maximum" }, - {0x10, 0x01, 0x07, 0x03, "High" }, - {0x10, 0x01, 0x07, 0x01, "Medium" }, - {0x10, 0x01, 0x07, 0x00, "Low" }, -}; - -STDDIPINFO(Othunderj) - -static struct BurnDIPInfo OthunderuDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0x7f, NULL }, - {0x10, 0xff, 0xff, 0x07, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0e, 0x01, 0x02, 0x00, "Off" }, - {0x0e, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x04, 0x04, "Off" }, - {0x0e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x08, 0x00, "Off" }, - {0x0e, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0e, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0e, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0f, 0x01, 0x03, 0x02, "Easy" }, - {0x0f, 0x01, 0x03, 0x03, "Medium" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Magazines/Rockets" }, - {0x0f, 0x01, 0x0c, 0x0c, "5/3" }, - {0x0f, 0x01, 0x0c, 0x08, "6/4" }, - {0x0f, 0x01, 0x0c, 0x04, "7/5" }, - {0x0f, 0x01, 0x0c, 0x00, "8/6" }, - - {0 , 0xfe, 0 , 4 , "Bullets per Magazine" }, - {0x0f, 0x01, 0x30, 0x00, "30" }, - {0x0f, 0x01, 0x30, 0x10, "35" }, - {0x0f, 0x01, 0x30, 0x30, "40" }, - {0x0f, 0x01, 0x30, 0x20, "50" }, - - {0 , 0xfe, 0 , 2 , "Continue Price" }, - {0x0f, 0x01, 0x40, 0x00, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0x40, 0x40, "Same as Start" }, - - {0 , 0xfe, 0 , 2 , "language" }, - {0x0f, 0x01, 0x80, 0x00, "English" }, - {0x0f, 0x01, 0x80, 0x80, "Japanese" }, - - // Dip 3 - {0 , 0xfe, 0 , 4 , "Stereo Seperation" }, - {0x10, 0x01, 0x07, 0x07, "Maximum" }, - {0x10, 0x01, 0x07, 0x03, "High" }, - {0x10, 0x01, 0x07, 0x01, "Medium" }, - {0x10, 0x01, 0x07, 0x00, "Low" }, -}; - -STDDIPINFO(Othunderu) - -static struct BurnRomInfo OthunderRomDesc[] = { - { "b67-20-1.ic63", 0x20000, 0x851a453b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-23-1.ic64", 0x20000, 0x6e4f3d56, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-14.ic61", 0x20000, 0x7f3dd724, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-15.ic62", 0x20000, 0xe84f62d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b67-13.ic40", 0x10000, 0x2936b4b1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b67-06.ic66", 0x80000, 0xb9a38d64, BRF_GRA | TAITO_CHARS}, - - { "b67-01.ic1", 0x80000, 0x81ad9acb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-02.ic2", 0x80000, 0xc20cd2fb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-03.ic3", 0x80000, 0xbc9019ed, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-04.ic4", 0x80000, 0x2af4c8af, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b67-05.ic43", 0x80000, 0x9593e42b, BRF_GRA | TAITO_SPRITEMAP }, - - { "b67-08.ic67", 0x80000, 0x458f41fb, BRF_SND | TAITO_YM2610A }, - - { "b67-07.ic44", 0x80000, 0x4f834357, BRF_SND | TAITO_YM2610B }, - - { "93c46_eeprom-othunder.ic86", 0x00080, 0x3729b844, BRF_PRG | TAITO_DEFAULT_EEPROM }, - - { "plhs18p8b-b67-09.ic15", 0x00149, 0x62035487, BRF_OPT }, - { "pal16l8a-b67-11.ic36", 0x00104, 0x3177fb06, BRF_OPT }, - { "pal20l8b-b67-12.ic37", 0x00144, 0xa47c2798, BRF_OPT }, - { "pal20l8b-b67-10.ic33", 0x00144, 0x4ced09c7, BRF_OPT }, -}; - -STD_ROM_PICK(Othunder) -STD_ROM_FN(Othunder) - -static struct BurnRomInfo OthunderoRomDesc[] = { - { "b67-20.ic63", 0x20000, 0x21439ea2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-23.ic64", 0x20000, 0x789e9daa, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-14.ic61", 0x20000, 0x7f3dd724, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-15.ic62", 0x20000, 0xe84f62d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b67-13.ic40", 0x10000, 0x2936b4b1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b67-06.ic66", 0x80000, 0xb9a38d64, BRF_GRA | TAITO_CHARS}, - - { "b67-01.ic1", 0x80000, 0x81ad9acb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-02.ic2", 0x80000, 0xc20cd2fb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-03.ic3", 0x80000, 0xbc9019ed, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-04.ic4", 0x80000, 0x2af4c8af, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b67-05.ic43", 0x80000, 0x9593e42b, BRF_GRA | TAITO_SPRITEMAP }, - - { "b67-08.ic67", 0x80000, 0x458f41fb, BRF_SND | TAITO_YM2610A }, - - { "b67-07.ic44", 0x80000, 0x4f834357, BRF_SND | TAITO_YM2610B }, - - { "93c46_eeprom-othunder.ic86", 0x00080, 0x3729b844, BRF_PRG | TAITO_DEFAULT_EEPROM }, - - { "plhs18p8b-b67-09.ic15", 0x00149, 0x62035487, BRF_OPT }, - { "pal16l8a-b67-11.ic36", 0x00104, 0x3177fb06, BRF_OPT }, - { "pal20l8b-b67-12.ic37", 0x00144, 0xa47c2798, BRF_OPT }, - { "pal20l8b-b67-10.ic33", 0x00144, 0x4ced09c7, BRF_OPT }, -}; - -STD_ROM_PICK(Othundero) -STD_ROM_FN(Othundero) - -static struct BurnRomInfo OthunderuRomDesc[] = { - { "b67-20-1.ic63", 0x20000, 0x851a453b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-22-1.ic64", 0x20000, 0x19480dc0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-14.ic61", 0x20000, 0x7f3dd724, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-15.ic62", 0x20000, 0xe84f62d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b67-13.ic40", 0x10000, 0x2936b4b1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b67-06.ic66", 0x80000, 0xb9a38d64, BRF_GRA | TAITO_CHARS}, - - { "b67-01.ic1", 0x80000, 0x81ad9acb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-02.ic2", 0x80000, 0xc20cd2fb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-03.ic3", 0x80000, 0xbc9019ed, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-04.ic4", 0x80000, 0x2af4c8af, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b67-05.ic43", 0x80000, 0x9593e42b, BRF_GRA | TAITO_SPRITEMAP }, - - { "b67-08.ic67", 0x80000, 0x458f41fb, BRF_SND | TAITO_YM2610A }, - - { "b67-07.ic44", 0x80000, 0x4f834357, BRF_SND | TAITO_YM2610B }, - - { "93c46_eeprom-othunder.ic86", 0x00080, 0x3729b844, BRF_PRG | TAITO_DEFAULT_EEPROM }, - - { "plhs18p8b-b67-09.ic15", 0x00149, 0x62035487, BRF_OPT }, - { "pal16l8a-b67-11.ic36", 0x00104, 0x3177fb06, BRF_OPT }, - { "pal20l8b-b67-12.ic37", 0x00144, 0xa47c2798, BRF_OPT }, - { "pal20l8b-b67-10.ic33", 0x00144, 0x4ced09c7, BRF_OPT }, -}; - -STD_ROM_PICK(Othunderu) -STD_ROM_FN(Othunderu) - -static struct BurnRomInfo OthunderuoRomDesc[] = { - { "b67-20.ic63", 0x20000, 0x21439ea2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-22.ic64", 0x20000, 0x0f99ad3c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-14.ic61", 0x20000, 0x7f3dd724, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-15.ic62", 0x20000, 0xe84f62d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b67-13.ic40", 0x10000, 0x2936b4b1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b67-06.ic66", 0x80000, 0xb9a38d64, BRF_GRA | TAITO_CHARS}, - - { "b67-01.ic1", 0x80000, 0x81ad9acb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-02.ic2", 0x80000, 0xc20cd2fb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-03.ic3", 0x80000, 0xbc9019ed, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-04.ic4", 0x80000, 0x2af4c8af, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b67-05.ic43", 0x80000, 0x9593e42b, BRF_GRA | TAITO_SPRITEMAP }, - - { "b67-08.ic67", 0x80000, 0x458f41fb, BRF_SND | TAITO_YM2610A }, - - { "b67-07.ic44", 0x80000, 0x4f834357, BRF_SND | TAITO_YM2610B }, - - { "93c46_eeprom-othunder.ic86", 0x00080, 0x3729b844, BRF_PRG | TAITO_DEFAULT_EEPROM }, - - { "plhs18p8b-b67-09.ic15", 0x00149, 0x62035487, BRF_OPT }, - { "pal16l8a-b67-11.ic36", 0x00104, 0x3177fb06, BRF_OPT }, - { "pal20l8b-b67-12.ic37", 0x00144, 0xa47c2798, BRF_OPT }, - { "pal20l8b-b67-10.ic33", 0x00144, 0x4ced09c7, BRF_OPT }, -}; - -STD_ROM_PICK(Othunderuo) -STD_ROM_FN(Othunderuo) - -static struct BurnRomInfo OthunderjRomDesc[] = { - { "b67-20.ic63", 0x20000, 0x21439ea2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-21.ic64", 0x20000, 0x9690fc86, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-14.ic61", 0x20000, 0x7f3dd724, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-15.ic62", 0x20000, 0xe84f62d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b67-13.ic40", 0x10000, 0x2936b4b1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b67-06.ic66", 0x80000, 0xb9a38d64, BRF_GRA | TAITO_CHARS}, - - { "b67-01.ic1", 0x80000, 0x81ad9acb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-02.ic2", 0x80000, 0xc20cd2fb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-03.ic3", 0x80000, 0xbc9019ed, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-04.ic4", 0x80000, 0x2af4c8af, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b67-05.ic43", 0x80000, 0x9593e42b, BRF_GRA | TAITO_SPRITEMAP }, - - { "b67-08.ic67", 0x80000, 0x458f41fb, BRF_SND | TAITO_YM2610A }, - - { "b67-07.ic44", 0x80000, 0x4f834357, BRF_SND | TAITO_YM2610B }, - - { "93c46_eeprom-othunder.ic86", 0x00080, 0x3729b844, BRF_PRG | TAITO_DEFAULT_EEPROM }, - - { "plhs18p8b-b67-09.ic15", 0x00149, 0x62035487, BRF_OPT }, - { "pal16l8a-b67-11.ic36", 0x00104, 0x3177fb06, BRF_OPT }, - { "pal20l8b-b67-12.ic37", 0x00144, 0xa47c2798, BRF_OPT }, - { "pal20l8b-b67-10.ic33", 0x00144, 0x4ced09c7, BRF_OPT }, -}; - -STD_ROM_PICK(Othunderj) -STD_ROM_FN(Othunderj) - -static struct BurnRomInfo OthunderjscRomDesc[] = { - // SC stands for Shopping Center. It was put in a smaller, single player cabinet aimed at children - { "b67-24.ic63", 0x20000, 0x18670e0b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-25.ic64", 0x20000, 0x3d422991, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-14.ic61", 0x20000, 0x7f3dd724, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b67-15.ic62", 0x20000, 0xe84f62d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b67-13.ic40", 0x10000, 0x2936b4b1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b67-06.ic66", 0x80000, 0xb9a38d64, BRF_GRA | TAITO_CHARS}, - - { "b67-01.ic1", 0x80000, 0x81ad9acb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-02.ic2", 0x80000, 0xc20cd2fb, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-03.ic3", 0x80000, 0xbc9019ed, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b67-04.ic4", 0x80000, 0x2af4c8af, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b67-05.ic43", 0x80000, 0x9593e42b, BRF_GRA | TAITO_SPRITEMAP }, - - { "b67-08.ic67", 0x80000, 0x458f41fb, BRF_SND | TAITO_YM2610A }, - - { "b67-07.ic44", 0x80000, 0x4f834357, BRF_SND | TAITO_YM2610B }, - - { "93c46_eeprom-othunder.ic86", 0x00080, 0x3729b844, BRF_PRG | TAITO_DEFAULT_EEPROM }, - - { "plhs18p8b-b67-09.ic15", 0x00149, 0x62035487, BRF_OPT }, - { "pal16l8a-b67-11.ic36", 0x00104, 0x3177fb06, BRF_OPT }, - { "pal20l8b-b67-12.ic37", 0x00144, 0xa47c2798, BRF_OPT }, - { "pal20l8b-b67-10.ic33", 0x00144, 0x4ced09c7, BRF_OPT }, -}; - -STD_ROM_PICK(Othunderjsc) -STD_ROM_FN(Othunderjsc) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - TaitoSpriteMapRom = Next; Next += TaitoSpriteMapRomSize; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - TaitoYM2610BRom = Next; Next += TaitoYM2610BRomSize; - TaitoDefaultEEProm = Next; Next += TaitoDefaultEEPromSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x10000; - TaitoZ80Ram1 = Next; Next += 0x02000; - TaitoSpriteRam = Next; Next += 0x00600; - OthunderPan = Next; Next += 0x00004; - - TaitoRamEnd = Next; - - TaitoChars = Next; Next += TaitoNumChar * TaitoCharWidth * TaitoCharHeight; - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - TaitoPalette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - - TaitoMemEnd = Next; - - return 0; -} - -static INT32 OthunderDoReset() -{ - TaitoDoReset(); - - return 0; -} - -static UINT8 OthunderInputBypassRead(INT32 Offset) -{ - switch (Offset) { - case 0x03: { - return (EEPROMRead() & 1) << 7; - } - - default: { - return TC0220IOCRead(Offset); - } - } - - return 0; -} - -static void OthunderInputBypassWrite(INT32 Offset, UINT16 Data) -{ - switch (Offset) { - case 0x03: { - EEPROMWrite(Data & 0x20, Data & 0x10, Data & 0x40); - return; - } - - default: { - TC0220IOCWrite(Offset, Data & 0xff); - } - } -} - -UINT8 __fastcall Othunder68KReadByte(UINT32 a) -{ - switch (a) { - case 0x500001: { - return ~BurnGunReturnX(0); - } - - case 0x500003: { - return BurnGunReturnY(0); - } - - case 0x500005: { - return ~BurnGunReturnX(1); - } - - case 0x500007: { - return BurnGunReturnY(1); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Othunder68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x200000, 0x20ffff) - - switch (a) { - case 0x500001: - case 0x500003: - case 0x500005: - case 0x500007: { - nTaitoCyclesDone[0] += SekRun(10); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Othunder68KReadWord(UINT32 a) -{ - switch (a) { - case 0x090000: - case 0x090002: - case 0x090004: - case 0x090006: - case 0x090008: - case 0x09000a: - case 0x09000c: - case 0x09000e: { - return OthunderInputBypassRead((a - 0x090000) >> 1); - } - - case 0x100002: { - return TC0110PCRWordRead(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Othunder68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x200000, 0x20ffff) - TC0100SCN0CtrlWordWrite_Map(0x220000) - - switch (a) { - case 0x090000: - case 0x090002: - case 0x090004: - case 0x090006: - case 0x090008: - case 0x09000a: - case 0x09000c: - case 0x09000e: { - OthunderInputBypassWrite((a - 0x090000) >> 1, d); - return; - } - - case 0x100000: - case 0x100002: - case 0x100004: { - TC0110PCRStep1RBSwapWordWrite(0, (a - 0x100000) >> 1, d); - return; - } - - case 0x300000: { - TC0140SYTPortWrite(d & 0xff); - return; - } - - case 0x300002: { - TC0140SYTCommWrite(d & 0xff); - return; - } - - case 0x500000: - case 0x500002: - case 0x500004: - case 0x500006: { - nTaitoCyclesDone[0] += SekRun(10); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - return; - } - - case 0x600000: - case 0x600002: { - // irq ack - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall OthunderZ80Read(UINT16 a) -{ - switch (a) { - case 0xe000: { - return BurnYM2610Read(0); - } - - case 0xe002: { - return BurnYM2610Read(2); - } - - case 0xe201: { - return TC0140SYTSlaveCommRead(); - } - - case 0xea00: { - return TaitoDip[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall OthunderZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - BurnYM2610Write(0, d); - return; - } - - case 0xe001: { - BurnYM2610Write(1, d); - return; - } - - case 0xe002: { - BurnYM2610Write(2, d); - return; - } - - case 0xe003: { - BurnYM2610Write(3, d); - return; - } - - case 0xe200: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xe201: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xe400: - case 0xe401: - case 0xe402: - case 0xe403: { - INT32 lVol, rVol; - - OthunderPan[a & 0x0003] = d & 0x1f; - - rVol = (OthunderPan[0] + OthunderPan[2]) * 100 / (2 * 0x1f); - lVol = (OthunderPan[1] + OthunderPan[3]) * 100 / (2 * 0x1f); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, OthunderYM2610AY8910RouteMasterVol * lVol / 100.0); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, OthunderYM2610AY8910RouteMasterVol * rVol / 100.0); - - rVol = OthunderPan[0] * 100 / 0x1f; - lVol = OthunderPan[1] * 100 / 0x1f; - if (rVol == 0) rVol = 100; // Fixes player gunshot can only be heard through the left speaker. - BurnYM2610SetLeftVolume(BURN_SND_YM2610_YM2610_ROUTE_1, OthunderYM2610Route1MasterVol * lVol / 100.0); - BurnYM2610SetRightVolume(BURN_SND_YM2610_YM2610_ROUTE_1, OthunderYM2610Route1MasterVol * rVol / 100.0); - - /* CH2 */ - rVol = OthunderPan[2] * 100 / 0x1f; - lVol = OthunderPan[3] * 100 / 0x1f; - BurnYM2610SetLeftVolume(BURN_SND_YM2610_YM2610_ROUTE_2, OthunderYM2610Route2MasterVol * lVol / 100.0); - BurnYM2610SetRightVolume(BURN_SND_YM2610_YM2610_ROUTE_2, OthunderYM2610Route2MasterVol * rVol / 100.0); - return; - } - - case 0xe600: { - // nop - return; - } - - case 0xee00: { - // nop - return; - } - - case 0xf000: { - // nop - return; - } - - case 0xf200: { - TaitoZ80Bank = (d - 1) & 7; - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static const eeprom_interface othunder_eeprom_interface = { - 6, /* address bits */ - 16, /* data bits */ - "0110", /* read command */ - "0101", /* write command */ - "0111", /* erase command */ - "0100000000", /* lock command */ - "0100111111", /* unlock command */ - 0, - 0 -}; - -static const UINT8 othunder_default_eeprom[128] = { - 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x41, 0x41, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xf0, 0xf0, - 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x41, 0x41, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xf0, 0xf0, - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0xf0, 0x00, - 0x00, 0x01, 0x42, 0x85, 0x00, 0x00, 0xf1, 0xe3, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0xf0, 0x00, - 0x00, 0x01, 0x42, 0x85, 0x00, 0x00, 0xf1, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -}; - -static void OthunderFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 OthunderSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / (16000000 / 4); -} - -static double OthunderGetTime() -{ - return (double)ZetTotalCycles() / (16000000 / 4); -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[8] = { 8, 12, 0, 4, 24, 28, 16, 20 }; -static INT32 CharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 SpritePlaneOffsets[4] = { 0, 8, 16, 24 }; -static INT32 SpriteXOffsets[16] = { 32, 33, 34, 35, 36, 37, 38, 39, 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 SpriteYOffsets[8] = { 0, 64, 128, 192, 256, 320, 384, 448 }; - -#ifdef BUILD_A68K -static void SwitchToMusashi() -{ - if (bBurnUseASMCPUEmulation) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching to Musashi 68000 core\n")); -#endif - bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation; - bBurnUseASMCPUEmulation = false; - } -} -#endif - -static INT32 OthunderInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x8000; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - TaitoNumEEPROM = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - GenericTilesInit(); - - TC0100SCNInit(0, TaitoNumChar, 4, 8, 1, NULL); - TC0110PCRInit(1, 0x1000); - TC0140SYTInit(0); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x080000, 0x08ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x200000, 0x20ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x400000, 0x4005ff, MAP_RAM); - SekSetReadWordHandler(0, Othunder68KReadWord); - SekSetWriteWordHandler(0, Othunder68KWriteWord); - SekSetReadByteHandler(0, Othunder68KReadByte); - SekSetWriteByteHandler(0, Othunder68KWriteByte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(OthunderZ80Read); - ZetSetWriteHandler(OthunderZ80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &OthunderFMIRQHandler, OthunderSynchroniseStream, OthunderGetTime, 0); - BurnTimerAttachZet(16000000 / 4); - OthunderYM2610AY8910RouteMasterVol = 0.25; - OthunderYM2610Route1MasterVol = 1.00; - OthunderYM2610Route2MasterVol = 1.00; - bYM2610UseSeperateVolumes = 1; - - EEPROMInit(&othunder_eeprom_interface); - if (!EEPROMAvailable()) EEPROMFill(TaitoDefaultEEProm, 0, 128); - - TaitoMakeInputsFunction = OthunderMakeInputs; - TaitoDrawFunction = OthunderDraw; - TaitoIrqLine = 5; - TaitoFrameInterleave = 100; - TaitoFlipScreenX = 1; - - nTaitoCyclesTotal[0] = 13000000 / 60; - nTaitoCyclesTotal[1] = (16000000 / 4) / 60; - - BurnGunInit(2, true); - - // Reset the driver - OthunderDoReset(); - - return 0; -} - -static INT32 OthunderExit() -{ - TaitoExit(); - -#ifdef BUILD_A68K - // Switch back CPU core if needed - if (bUseAsm68KCoreOldValue) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching back to A68K core\n")); -#endif - bUseAsm68KCoreOldValue = false; - bBurnUseASMCPUEmulation = true; - } -#endif - - return 0; -} - -static void RenderSpriteZoom(INT32 Code, INT32 sx, INT32 sy, INT32 Colour, INT32 xFlip, INT32 yFlip, INT32 xScale, INT32 yScale, UINT8* pSource) -{ - // We can use sprite A for sizes, etc. as only Chase HQ uses sprite B and it has the same sizes and count - - UINT8 *SourceBase = pSource + ((Code % TaitoNumSpriteA) * TaitoSpriteAWidth * TaitoSpriteAHeight); - - INT32 SpriteScreenHeight = (yScale * TaitoSpriteAHeight + 0x8000) >> 16; - INT32 SpriteScreenWidth = (xScale * TaitoSpriteAWidth + 0x8000) >> 16; - - Colour = 0x10 * (Colour % 0x100); - - if (TaitoFlipScreenX) { - xFlip = !xFlip; - sx = 320 - sx - (xScale >> 12); - } - - if (SpriteScreenWidth && SpriteScreenHeight) { - INT32 dx = (TaitoSpriteAWidth << 16) / SpriteScreenWidth; - INT32 dy = (TaitoSpriteAHeight << 16) / SpriteScreenHeight; - - INT32 ex = sx + SpriteScreenWidth; - INT32 ey = sy + SpriteScreenHeight; - - INT32 xIndexBase; - INT32 yIndex; - - if (xFlip) { - xIndexBase = (SpriteScreenWidth - 1) * dx; - dx = -dx; - } else { - xIndexBase = 0; - } - - if (yFlip) { - yIndex = (SpriteScreenHeight - 1) * dy; - dy = -dy; - } else { - yIndex = 0; - } - - if (sx < 0) { - INT32 Pixels = 0 - sx; - sx += Pixels; - xIndexBase += Pixels * dx; - } - - if (sy < 0) { - INT32 Pixels = 0 - sy; - sy += Pixels; - yIndex += Pixels * dy; - } - - if (ex > nScreenWidth) { - INT32 Pixels = ex - nScreenWidth; - ex -= Pixels; - } - - if (ey > nScreenHeight) { - INT32 Pixels = ey - nScreenHeight; - ey -= Pixels; - } - - if (ex > sx) { - INT32 y; - - for (y = sy; y < ey; y++) { - UINT8 *Source = SourceBase + ((yIndex >> 16) * TaitoSpriteAWidth); - UINT16* pPixel = pTransDraw + (y * nScreenWidth); - - INT32 x, xIndex = xIndexBase; - for (x = sx; x < ex; x++) { - INT32 c = Source[xIndex >> 16]; - if (c != 0) { - pPixel[x] = c | Colour; - } - xIndex += dx; - } - - yIndex += dy; - } - } - } -} - -static void OthunderRenderSprites(INT32 PriorityDraw) -{ - UINT16 *SpriteMap = (UINT16*)TaitoSpriteMapRom; - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Offset, Data, Tile, Colour, xFlip, yFlip; - INT32 x, y, Priority, xCur, yCur; - INT32 xZoom, yZoom, zx, zy; - INT32 SpriteChunk, MapOffset, Code, j, k, px, py; - INT32 BadChunks; - - for (Offset = 0x300 - 4; Offset >= 0; Offset -= 4) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]); - Priority = (Data & 0x8000) >> 15; - - if (Priority != 0 && Priority != 1) bprintf(PRINT_NORMAL, _T("Unused Priority %x\n"), Priority); - if (Priority != PriorityDraw) continue; - - xFlip = (Data & 0x4000) >> 14; - x = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]); - yFlip = (Data & 0x8000) >> 15; - Tile = Data & 0x1fff; - if (!Tile) continue; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 0]); - yZoom = (Data & 0xfe00) >> 9; - y = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - Colour = (Data & 0xff00) >> 8; - xZoom = (Data & 0x7f); - - MapOffset = Tile << 5; - - xZoom += 1; - yZoom += 1; - - y += 3; - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - BadChunks = 0; - - for (SpriteChunk = 0; SpriteChunk < 32; SpriteChunk++) { - k = SpriteChunk % 4; - j = SpriteChunk / 4; - - px = xFlip ? (3 - k) : k; - py = yFlip ? (7 - j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 2)]); - Code &= (TaitoNumSpriteA - 1); - - if (Code == 0xffff) { - BadChunks += 1; - continue; - } - - xCur = x + ((k * xZoom) / 4); - yCur = y + ((j * yZoom) / 8); - - zx = x + (((k + 1) * xZoom) / 4) - xCur; - zy = y + (((j + 1) * yZoom) / 8) - yCur; - - yCur -= 16; - - RenderSpriteZoom(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 13, TaitoSpritesA); - } - - } -} - -static void OthunderDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 1, TaitoChars); - OthunderRenderSprites(1); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 1, TaitoChars); - OthunderRenderSprites(1); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - OthunderRenderSprites(0); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TC0110PCRPalette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } -} - -static INT32 OthunderFrame() -{ - INT32 nInterleave = TaitoFrameInterleave; - - if (TaitoReset) OthunderDoReset(); - - TaitoMakeInputsFunction(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == (TaitoFrameInterleave - 1)) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - - ZetOpen(0); - BurnTimerUpdate(i * (nTaitoCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) TaitoDrawFunction(); - - return 0; -} - -static INT32 OthunderScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029709; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd-TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - TaitoICScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - - BurnGunScan(); - - SCAN_VAR(TaitoInput); - SCAN_VAR(TaitoZ80Bank); - SCAN_VAR(nTaitoCyclesDone); - SCAN_VAR(nTaitoCyclesSegment); - } - - if (nAction & ACB_WRITE) { - if (TaitoZ80Bank) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetClose(); - } - } - - return 0; -} - -struct BurnDriver BurnDrvOthunder = { - "othunder", NULL, NULL, NULL, "1988", - "Operation Thunderbolt (World, rev 1)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OthunderRomInfo, OthunderRomName, NULL, NULL, OthunderInputInfo, OthunderDIPInfo, - OthunderInit, OthunderExit, OthunderFrame, NULL, OthunderScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOthundero = { - "othundero", "othunder", NULL, NULL, "1988", - "Operation Thunderbolt (World)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OthunderoRomInfo, OthunderoRomName, NULL, NULL, OthunderInputInfo, OthunderuDIPInfo, - OthunderInit, OthunderExit, OthunderFrame, NULL, OthunderScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOthunderu = { - "othunderu", "othunder", NULL, NULL, "1988", - "Operation Thunderbolt (US, rev 1)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OthunderuRomInfo, OthunderuRomName, NULL, NULL, OthunderInputInfo, OthunderuDIPInfo, - OthunderInit, OthunderExit, OthunderFrame, NULL, OthunderScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOthunderuo = { - "othunderuo", "othunder", NULL, NULL, "1988", - "Operation Thunderbolt (US)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OthunderuoRomInfo, OthunderuoRomName, NULL, NULL, OthunderInputInfo, OthunderuDIPInfo, - OthunderInit, OthunderExit, OthunderFrame, NULL, OthunderScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOthunderj = { - "othunderj", "othunder", NULL, NULL, "1988", - "Operation Thunderbolt (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OthunderjRomInfo, OthunderjRomName, NULL, NULL, OthunderInputInfo, OthunderjDIPInfo, - OthunderInit, OthunderExit, OthunderFrame, NULL, OthunderScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOthunderjsc = { - "othunderjsc", "othunder", NULL, NULL, "1988", - "Operation Thunderbolt (Japan, SC)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OthunderjscRomInfo, OthunderjscRomName, NULL, NULL, OthunderInputInfo, OthunderjDIPInfo, - OthunderInit, OthunderExit, OthunderFrame, NULL, OthunderScan, - NULL, 0x1000, 320, 240, 4, 3 -}; \ No newline at end of file diff --git a/jan/src/burn/drv/taito/d_retofinv.cpp b/jan/src/burn/drv/taito/d_retofinv.cpp deleted file mode 100644 index a2d6a80d6..000000000 --- a/jan/src/burn/drv/taito/d_retofinv.cpp +++ /dev/null @@ -1,990 +0,0 @@ -// FB Alpha Return of the Invaders driver module -// Based on MAME driver by Jarek Parchanski and Andrea Mazzoleni - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "taito_m68705.h" -#include "bitswap.h" -#include "sn76496.h" - -static UINT8 *AllMem; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *MemEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvMcuROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvFgVRAM; -static UINT8 *DrvBgVRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvMcuRAM; - -static UINT16 *DrvTileOfst; -static UINT8 *DrvColTable; -static UINT32 *Palette; -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *coinlockout; -static UINT8 *soundlatch; -static UINT8 *soundlatch2; -static UINT8 *flipscreen; -static UINT8 *gfxbank; - -static INT32 enable_interrupt[2]; -static INT32 disable_cpu[3]; - -static INT32 use_mcu; - -static INT32 watchdog; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo RetofinvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 3, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 2, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Retofinv) - -static struct BurnDIPInfo RetofinvDIPList[]= -{ - {0x0d, 0xff, 0xff, 0x6f, NULL }, - {0x0e, 0xff, 0xff, 0x00, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0d, 0x01, 0x03, 0x03, "30k, 80k & every 80k" }, - {0x0d, 0x01, 0x03, 0x02, "30k, 80k" }, - {0x0d, 0x01, 0x03, 0x01, "30k" }, - {0x0d, 0x01, 0x03, 0x00, "None" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x0d, 0x01, 0x04, 0x04, "No" }, - {0x0d, 0x01, 0x04, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0d, 0x01, 0x18, 0x18, "1" }, - {0x0d, 0x01, 0x18, 0x10, "2" }, - {0x0d, 0x01, 0x18, 0x08, "3" }, - {0x0d, 0x01, 0x18, 0x00, "5 (retofin2 4)" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0d, 0x01, 0x40, 0x40, "Off" }, - {0x0d, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0d, 0x01, 0x80, 0x00, "Upright" }, - {0x0d, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x0e, 0x01, 0x0f, 0x0f, "9 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0e, "8 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0d, "7 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0c, "6 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x0e, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x0e, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x0e, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x0e, 0x01, 0xf0, 0xf0, "9 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xe0, "8 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xd0, "7 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xc0, "6 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x0e, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x0e, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x0e, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x0e, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Push Start to Skip Stage (Cheat)" }, - {0x0f, 0x01, 0x01, 0x01, "Off" }, - {0x0f, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Per Play Display" }, - {0x0f, 0x01, 0x10, 0x00, "No" }, - {0x0f, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Year Display" }, - {0x0f, 0x01, 0x20, 0x00, "No" }, - {0x0f, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 2, "Invulnerability (Cheat)" }, - {0x0f, 0x01, 0x40, 0x40, "Off" }, - {0x0f, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coinage" }, - {0x0f, 0x01, 0x80, 0x80, "A and B" }, - {0x0f, 0x01, 0x80, 0x00, "A only" }, -}; - -STDDIPINFO(Retofinv) - -// Reset cpu and keep sync -static inline void retofinv_cpu_reset(INT32 cpu, INT32 data) -{ - INT32 cycles = ZetTotalCycles(); - ZetClose(); - ZetOpen(cpu); - cycles -= ZetTotalCycles(); - if (data) { - ZetIdle(cycles - ZetTotalCycles()); - } else { - ZetRun(cycles); - ZetReset(); - } - disable_cpu[cpu-1] = data; - ZetClose(); - ZetOpen(0); -} - -void __fastcall retofinv_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xb800: - *flipscreen = data & 1; - return; - - case 0xb801: - gfxbank[0] = data & 1; - return; - - case 0xb802: - gfxbank[1] = data & 1; - return; - - case 0xc800: - { - data &= 1; - if (!data) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - enable_interrupt[0] = data; - } - return; - - case 0xc801: - *coinlockout = (data & 1) * 0xff; - return; - - case 0xc802: - retofinv_cpu_reset(2, data); - return; - - case 0xc803: - m67805_taito_reset(); - disable_cpu[2] = data; - return; - - case 0xc804: - { - data &= 1; - if (!data) ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - enable_interrupt[1] = data; - } - return; - - case 0xc805: - retofinv_cpu_reset(1, data); - return; - - case 0xd000: - watchdog = 0; - return; - - case 0xd800: - { - *soundlatch = data; - ZetClose(); - ZetOpen(2); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - } - return; - - case 0xe800: - standard_taito_mcu_write(data); - return; - } -} - -UINT8 __fastcall retofinv_main_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return DrvInputs[0]; - - case 0xc001: - return DrvInputs[1]; - - case 0xc002: // must be < 0x80; - return 0; - - case 0xc003: // mcu status - { - INT32 res = 0; - if (!main_sent) res |= 0x10; - if (mcu_sent) res |= 0x20; - return res; - } - - case 0xc004: - return DrvInputs[2] & (*coinlockout | 0xcf); - - case 0xc005: - return DrvDips[0]; - - case 0xc006: - return DrvDips[1]; - - case 0xc007: - return DrvDips[2]; - - case 0xf800: - return *soundlatch2; - - case 0xe000: - return standard_taito_mcu_read(); - } - - return 0; -} - -void __fastcall retofinv_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x6000: - *soundlatch2 = data; - return; - - case 0x8000: - SN76496Write(0, data); - return; - - case 0xa000: - SN76496Write(1, data); - return; - } -} - -UINT8 __fastcall retofinv_sound_read(UINT16 address) -{ - switch (address) - { - case 0x4000: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - DrvReset = 0; - - memset (AllRam, 0, RamEnd - AllRam); - - for (INT32 i = 0; i < 3; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - m67805_taito_reset(); - - enable_interrupt[0] = 0; - enable_interrupt[1] = 0; - disable_cpu[0] = 1; - disable_cpu[1] = 1; - disable_cpu[2] = 1; - - watchdog = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x010000; - DrvZ80ROM2 = Next; Next += 0x010000; - - DrvMcuROM = Next; Next += 0x000800; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000b00; - - AllRam = Next; - - DrvFgVRAM = Next; Next += 0x000800; - DrvBgVRAM = Next; Next += 0x000800; - DrvShareRAM = Next; Next += 0x001800; - - DrvZ80RAM2 = Next; Next += 0x000800; - - DrvMcuRAM = Next; Next += 0x000080; - - coinlockout = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - soundlatch2 = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - - gfxbank = Next; Next += 0x000004; // 2 - - RamEnd = Next; - - DrvColTable = Next; Next += 0x000a00; - Palette = (UINT32*)Next; Next += 0x0a00 * sizeof(UINT32); - DrvPalette = (UINT32*)Next; Next += 0x0a00 * sizeof(UINT32); - - DrvTileOfst = (UINT16*)Next; Next += 0x0400 * sizeof(UINT16); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[1] = { 0x00000 }; - INT32 Plane1[4] = { 0x00000, 0x20004, 0x20000, 0x00004 }; - INT32 XOffs0[8] = { 0x007, 0x006, 0x005, 0x004, 0x003, 0x002, 0x001, 0x000 }; - INT32 XOffs1[16] = { 0x000, 0x001, 0x002, 0x003, 0x040, 0x041, 0x042, 0x043, - 0x080, 0x081, 0x082, 0x083, 0x0c0, 0x0c1, 0x0c2, 0x0c3 }; - INT32 YOffs[16] = { 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038, - 0x100, 0x108, 0x110, 0x118, 0x120, 0x128, 0x130, 0x138 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x8000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0200, 1, 8, 8, Plane0, XOffs0, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x8000); - - GfxDecode(0x0100, 4, 16, 16, Plane1, XOffs1, YOffs, 0x200, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x8000); - - GfxDecode(0x0200, 4, 8, 8, Plane1, XOffs1, YOffs, 0x080, tmp, DrvGfxROM2); - - BurnFree (tmp); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 r = DrvColPROM[i + 0x000] & 0x0f; - INT32 g = DrvColPROM[i + 0x100] & 0x0f; - INT32 b = DrvColPROM[i + 0x200] & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i] = (r << 16) | (g << 8) | b; - } - - for (INT32 i = 0; i < 0x200; i++) { // foreground - DrvColTable[i] = (i >> 1) * (i & 1); - Palette[i + 0x000] = DrvPalette[DrvColTable[i]]; - } - - for (INT32 i = 0; i < 0x800; i++) { // everything else - DrvColTable[i + 0x200] = BITSWAP08(DrvColPROM[i + 0x300],4,5,6,7,3,2,1,0); - Palette[i + 0x200] = DrvPalette[DrvColTable[i + 0x200]]; - DrvColTable[i + 0x200] = (DrvColTable[i + 0x200] == 0xff) ? 0 : 1; - } - - DrvRecalc = 1; -} - -// Calculate offsets for tiles on screen -static void DrvCalculateOffsets() -{ - for (INT32 offs = 0; offs < 36 * 28; offs++) { - INT32 col = (offs % 36) - 2; - INT32 row = (offs / 36) + 2; - - if (col & 0x20) - DrvTileOfst[offs] = ((col & 0x1f) << 5) + row; - else - DrvTileOfst[offs] = (row << 5) + col; - } -} - -static INT32 DecodeBoot3PROMs() -{ - UINT8 *tmp = DrvGfxROM2 + 0x8000; // empty before gfx decode - - if (BurnLoadRom(tmp + 0x000, 16, 1)) return 1; - if (BurnLoadRom(tmp + 0x400, 18, 1)) return 1; - if (BurnLoadRom(tmp + 0x800, 15, 1)) return 1; - if (BurnLoadRom(tmp + 0xc00, 17, 1)) return 1; - - for (INT32 i = 0; i < 0x800; i++) { - DrvColPROM[i + 0x300] = (tmp[i] & 0x0f) | (tmp[i + 0x800] << 4); - } - - memset (tmp, 0, 0x1000); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 13, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 14, 1)) return 1; - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "retofin3") == 0) { - DecodeBoot3PROMs(); - } else { - if (BurnLoadRom(DrvColPROM + 0x00300, 15, 1)) return 1; - - if (BurnLoadRom(DrvMcuROM + 0x00000, 16, 1)) return 1; - } - - DrvCalculateOffsets(); - DrvPaletteInit(); - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0x8000, 0x87ff, 0, DrvFgVRAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvFgVRAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvFgVRAM); - ZetMapArea(0x8800, 0x9fff, 0, DrvShareRAM); - ZetMapArea(0x8800, 0x9fff, 1, DrvShareRAM); - ZetMapArea(0x8800, 0x9fff, 2, DrvShareRAM); - ZetMapArea(0xa000, 0xa7ff, 0, DrvBgVRAM); - ZetMapArea(0xa000, 0xa7ff, 1, DrvBgVRAM); - ZetMapArea(0xa000, 0xa7ff, 2, DrvBgVRAM); - ZetSetWriteHandler(retofinv_main_write); - ZetSetReadHandler(retofinv_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvFgVRAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvFgVRAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvFgVRAM); - ZetMapArea(0x8800, 0x9fff, 0, DrvShareRAM); - ZetMapArea(0x8800, 0x9fff, 1, DrvShareRAM); - ZetMapArea(0x8800, 0x9fff, 2, DrvShareRAM); - ZetMapArea(0xa000, 0xa7ff, 0, DrvBgVRAM); - ZetMapArea(0xa000, 0xa7ff, 1, DrvBgVRAM); - ZetMapArea(0xa000, 0xa7ff, 2, DrvBgVRAM); - ZetSetWriteHandler(retofinv_main_write); - ZetSetReadHandler(retofinv_main_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapArea(0x0000, 0x1fff, 0, DrvZ80ROM2); - ZetMapArea(0x0000, 0x1fff, 2, DrvZ80ROM2); - ZetMapArea(0x2000, 0x27ff, 0, DrvZ80RAM2); - ZetMapArea(0x2000, 0x27ff, 1, DrvZ80RAM2); - ZetMapArea(0x2000, 0x27ff, 2, DrvZ80RAM2); - ZetMapArea(0xe000, 0xffff, 0, DrvZ80ROM2 + 0xe000); - ZetMapArea(0xe000, 0xffff, 2, DrvZ80ROM2 + 0xe000); - ZetSetWriteHandler(retofinv_sound_write); - ZetSetReadHandler(retofinv_sound_read); - ZetClose(); - - m67805_taito_init(DrvMcuROM, DrvMcuRAM, &standard_m68705_interface); - - use_mcu = ~BurnDrvGetFlags() & BDF_BOOTLEG; - - SN76496Init(0, 18432000 / 6, 0); - SN76496Init(1, 18432000 / 6, 1); - SN76496SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - SN76496SetRoute(1, 0.80, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - m67805_taito_exit(); - - SN76496Exit(); - - BurnFree (AllMem); - - return 0; -} - -static void draw_background_layer() -{ - for (INT32 offs = 0; offs < 36 * 28; offs++) - { - INT32 sx = (offs % 36) << 3; - INT32 sy = (offs / 36) << 3; - - - INT32 ofst = DrvTileOfst[offs]; - - INT32 code = DrvBgVRAM[ofst] | (gfxbank[1] << 8); - INT32 color = (DrvBgVRAM[ofst + 0x400] & 0x3f) + 0x60; - - if (*flipscreen) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, 280 - sx, 216 - sy, color, 4, 0, DrvGfxROM2); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM2); - } - } -} - -static void draw_foreground_layer() -{ - INT32 flip = *flipscreen ? 0x3f : 0; - - for (INT32 offs = 0; offs < 36 * 28; offs++) - { - INT32 sx = (offs % 36) << 3; - INT32 sy = (offs / 36) << 3; - - if (*flipscreen) { - sx = 280 - sx; - sy = 216 - sy; - } - - INT32 ofst = DrvTileOfst[offs]; - - INT32 code = DrvFgVRAM[ofst + 0x000] | (gfxbank[0] << 8); - INT32 color = DrvFgVRAM[ofst + 0x400]; - - { - color <<= 1; - UINT8 *src = DrvGfxROM0 + code * 0x40; - UINT16 *dst = pTransDraw + (sy * nScreenWidth) + sx; - - for (INT32 y = 0; y < 8; y++) { - for (INT32 x = 0; x < 8; x++) { - INT32 pxl = src[((y << 3) | x) ^ flip] | color; - - if (DrvColTable[pxl]) { - dst[x] = pxl; - } - } - dst += nScreenWidth; - } - } - } -} - -static inline void draw_masked_sprite(INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 fx, INT32 fy) -{ - UINT16 *dst; - UINT8 *src = DrvGfxROM1 + code * 0x100; - - if (fx) fx = 0x0f; - if (fy) fx |= 0xf0; - - for (INT32 y = 0; y < 16; y++, sy++) { - if (sy < 0 || sy >= nScreenHeight) continue; - - dst = pTransDraw + sy * nScreenWidth; - - for (INT32 x = 0; x < 16; x++, sx++) { - if (sx < 0 || sx >= nScreenWidth) continue; - - INT32 pxl = src[((y << 4) | x) ^ fx] | color; - - if (DrvColTable[pxl]) { - dst[sx] = pxl; - } - } - - sx -= 16; - } -} - -static void draw_sprites() -{ - static const INT32 gfx_offs[2][2] = - { - { 0, 1 }, - { 2, 3 } - }; - - UINT8 *ram0 = DrvShareRAM + 0x780; - UINT8 *ram1 = DrvShareRAM + 0xf80; - UINT8 *ram2 = DrvShareRAM + 0x1780; - - for (INT32 offs = 0; offs < 0x80; offs += 2) - { - INT32 attr = ram2[offs]; - INT32 sprite= ram0[offs+0]; - INT32 color = (ram0[offs+1] & 0x3f) + 0x20; - INT32 sx = ((ram1[offs+1] << 1) + ((ram2[offs+1] & 0x80) >> 7)) - 39; - INT32 sy = 256 - ((ram1[offs] << 1) + ((attr & 0x80) >> 7)) + 1; - INT32 flipx = (attr & 0x01); - INT32 flipy = (attr & 0x02) >> 1; - INT32 sizey = (attr & 0x04) >> 2; - INT32 sizex = (attr & 0x08) >> 3; - - sprite &= ~sizex; - sprite &= ~(sizey << 1); - - if (*flipscreen) - { - flipx ^= 1; - flipy ^= 1; - } - - sy -= sizey << 4; - sy = (sy & 0xff) - 32; - - for (INT32 y = 0; y <= sizey; y++) - { - for (INT32 x = 0; x <= sizex; x++) - { - INT32 code = sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)]; - draw_masked_sprite(code, color << 4, sx + 16*x, sy + 16*y, flipx, flipy); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0xa00; i++) { - INT32 d = Palette[i]; - DrvPalette[i] = BurnHighCol(d >> 16, (d >> 8) & 0xff, d & 0xff, 0); - } - DrvRecalc = 0; - } - - draw_background_layer(); - draw_sprites(); - draw_foreground_layer(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (DrvReset || watchdog > 59) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - DrvInputs[0] = 0xff; - DrvInputs[1] = 0xff; - DrvInputs[2] = 0xcf; - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 100; - INT32 nCyclesTotal[4] = { 3072000 / 60, 3072000 / 60, 3072000 / 60, 3072000 / 60 }; - INT32 nCyclesDone[4] = { 0, 0, 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nCycleSegment = (nCyclesTotal[0] / nInterleave); - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCycleSegment); - if (i == (nInterleave - 1) && enable_interrupt[0]) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - - nCycleSegment *= (i + 1); - - if (disable_cpu[0]) { - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCycleSegment - ZetTotalCycles()); - if (i == (nInterleave - 1) && enable_interrupt[1]) ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - } - - if (disable_cpu[1]) { - ZetOpen(2); - nCyclesDone[1] += ZetRun(nCycleSegment - ZetTotalCycles()); - if (i == (nInterleave - 1) || i == (nInterleave / 2)-1) ZetNmi(); - ZetClose(); - } - - if (disable_cpu[2] && use_mcu) { - m6805Open(0); - nCycleSegment = nCyclesTotal[3] / nInterleave; - nCyclesDone[3] += m6805Run(nCycleSegment); - m6805Close(); - } - } - - if (pBurnSoundOut) { - SN76496Update(0, pBurnSoundOut, nBurnSoundLen); - SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - SN76496Scan(nAction, pnMin); - - SCAN_VAR(enable_interrupt[0]); - SCAN_VAR(enable_interrupt[1]); - SCAN_VAR(disable_cpu[0]); - SCAN_VAR(disable_cpu[1]); - SCAN_VAR(disable_cpu[2]); - SCAN_VAR(from_main); - SCAN_VAR(from_mcu); - SCAN_VAR(mcu_sent); - SCAN_VAR(main_sent); - } - - return 0; -} - - -// Return of the Invaders - -static struct BurnRomInfo retofinvRomDesc[] = { - { "a37-03.70", 0x2000, 0xeae7459d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a37-02.71", 0x2000, 0x72895e37, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a37-01.72", 0x2000, 0x505dd20b, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a37-04.62", 0x2000, 0xd2899cc1, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "a37-05.17", 0x2000, 0x9025abea, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "a37-16.61", 0x2000, 0x4e3f501c, 4 | BRF_GRA }, // 5 Characters - - { "a37-10.8", 0x2000, 0x6afdeec8, 5 | BRF_GRA }, // 6 Sprites - { "a37-11.9", 0x2000, 0xd3dc9da3, 5 | BRF_GRA }, // 7 - { "a37-12.10", 0x2000, 0xd10b2eed, 5 | BRF_GRA }, // 8 - { "a37-13.11", 0x2000, 0x00ca6b3d, 5 | BRF_GRA }, // 9 - - { "a37-14.55", 0x2000, 0xef7f8651, 6 | BRF_GRA }, // 10 Tiles - { "a37-15.56", 0x2000, 0x03b40905, 6 | BRF_GRA }, // 11 - - { "a37-06.13", 0x0100, 0xe9643b8b, 7 | BRF_GRA }, // 12 Color Proms - { "a37-07.4", 0x0100, 0xe8f34e11, 7 | BRF_GRA }, // 13 - { "a37-08.3", 0x0100, 0x50030af0, 7 | BRF_GRA }, // 14 - { "82s191n", 0x0800, 0x93c891e3, 7 | BRF_GRA }, // 15 - - { "a37-09.37", 0x0800, 0x79bd6ded, 8 | BRF_PRG | BRF_ESS }, // 16 68705 Code -}; - -STD_ROM_PICK(retofinv) -STD_ROM_FN(retofinv) - -struct BurnDriver BurnDrvRetofinv = { - "retofinv", NULL, NULL, NULL, "1985", - "Return of the Invaders\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, retofinvRomInfo, retofinvRomName, NULL, NULL, RetofinvInputInfo, RetofinvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0xa00, - 224, 288, 3, 4 -}; - - -// Return of the Invaders (bootleg set 1) - -static struct BurnRomInfo retofin1RomDesc[] = { - { "roi.02", 0x2000, 0xd98fd462, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "roi.01b", 0x2000, 0x3379f930, 1 | BRF_PRG | BRF_ESS }, // 1 - { "roi.01", 0x2000, 0x57679062, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a37-04.62", 0x2000, 0xd2899cc1, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "a37-05.17", 0x2000, 0x9025abea, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "a37-16.61", 0x2000, 0x4e3f501c, 4 | BRF_GRA }, // 5 Characters - - { "a37-10.8", 0x2000, 0x6afdeec8, 5 | BRF_GRA }, // 6 Sprites - { "a37-11.9", 0x2000, 0xd3dc9da3, 5 | BRF_GRA }, // 7 - { "a37-12.10", 0x2000, 0xd10b2eed, 5 | BRF_GRA }, // 8 - { "a37-13.11", 0x2000, 0x00ca6b3d, 5 | BRF_GRA }, // 9 - - { "a37-14.55", 0x2000, 0xef7f8651, 6 | BRF_GRA }, // 10 Tiles - { "a37-15.56", 0x2000, 0x03b40905, 6 | BRF_GRA }, // 11 - - { "a37-06.13", 0x0100, 0xe9643b8b, 7 | BRF_GRA }, // 12 Color Proms - { "a37-07.4", 0x0100, 0xe8f34e11, 7 | BRF_GRA }, // 13 - { "a37-08.3", 0x0100, 0x50030af0, 7 | BRF_GRA }, // 14 - { "82s191n", 0x0800, 0x93c891e3, 7 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(retofin1) -STD_ROM_FN(retofin1) - -struct BurnDriver BurnDrvRetofin1 = { - "retofinv1", "retofinv", NULL, NULL, "1985", - "Return of the Invaders (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, retofin1RomInfo, retofin1RomName, NULL, NULL, RetofinvInputInfo, RetofinvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0xa00, - 224, 288, 3, 4 -}; - - -// Return of the Invaders (bootleg set 2) - -static struct BurnRomInfo retofin2RomDesc[] = { - { "ri-c.1e", 0x2000, 0xe3c31260, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "roi.01b", 0x2000, 0x3379f930, 1 | BRF_PRG | BRF_ESS }, // 1 - { "ri-a.1c", 0x2000, 0x3ae7c530, 1 | BRF_PRG | BRF_ESS }, // 2 - - { "a37-04.62", 0x2000, 0xd2899cc1, 2 | BRF_PRG | BRF_ESS }, // 3 Z80 #1 Code - - { "a37-05.17", 0x2000, 0x9025abea, 3 | BRF_PRG | BRF_ESS }, // 4 Z80 #2 Code - - { "a37-16.61", 0x2000, 0x4e3f501c, 4 | BRF_GRA }, // 5 Characters - - { "a37-10.8", 0x2000, 0x6afdeec8, 5 | BRF_GRA }, // 6 Sprites - { "a37-11.9", 0x2000, 0xd3dc9da3, 5 | BRF_GRA }, // 7 - { "a37-12.10", 0x2000, 0xd10b2eed, 5 | BRF_GRA }, // 8 - { "a37-13.11", 0x2000, 0x00ca6b3d, 5 | BRF_GRA }, // 9 - - { "a37-14.55", 0x2000, 0xef7f8651, 6 | BRF_GRA }, // 10 Tiles - { "a37-15.56", 0x2000, 0x03b40905, 6 | BRF_GRA }, // 11 - - { "a37-06.13", 0x0100, 0xe9643b8b, 7 | BRF_GRA }, // 12 Color Proms - { "a37-07.4", 0x0100, 0xe8f34e11, 7 | BRF_GRA }, // 13 - { "a37-08.3", 0x0100, 0x50030af0, 7 | BRF_GRA }, // 14 - { "82s191n", 0x0800, 0x93c891e3, 7 | BRF_GRA }, // 15 -}; - -STD_ROM_PICK(retofin2) -STD_ROM_FN(retofin2) - -struct BurnDriver BurnDrvRetofin2 = { - "retofinv2", "retofinv", NULL, NULL, "1985", - "Return of the Invaders (bootleg set 2)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, retofin2RomInfo, retofin2RomName, NULL, NULL, RetofinvInputInfo, RetofinvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0xa00, - 224, 288, 3, 4 -}; diff --git a/jan/src/burn/drv/taito/d_rollrace.cpp b/jan/src/burn/drv/taito/d_rollrace.cpp deleted file mode 100644 index 8d8ec8889..000000000 --- a/jan/src/burn/drv/taito/d_rollrace.cpp +++ /dev/null @@ -1,908 +0,0 @@ -// FB Alpha Fighting Roller driver module -// Based on MAME driver by Pierpaolo Prazzoli - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvVidRAM; -static UINT8 *DrvColRAM; -static UINT8 *DrvSprRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[9]; - -static UINT8 sound_nmi_mask = 0; -static UINT8 soundlatch = 0; -static UINT8 nmi_mask = 0; -static UINT8 spritebank = 0; -static UINT8 charbank[2]; -static UINT8 backgroundcolor = 0; -static UINT8 backgroundflip = 0; -static UINT8 backgroundpen = 0; -static UINT8 backgroundpage = 0; -static UINT8 screen_flipy = 0; -static UINT8 screen_flipx = 0; - -static UINT8 set2 = 0; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x12, 0xff, 0xff, 0x00, NULL }, - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x12, 0x01, 0x07, 0x07, "6 Coins 1 Credit" }, - {0x12, 0x01, 0x07, 0x06, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x07, 0x04, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x07, 0x05, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x07, 0x03, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x12, 0x01, 0x38, 0x38, "6 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x30, "3 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x20, "2 Coins 1 Credit" }, - {0x12, 0x01, 0x38, 0x00, "1 Coin 1 Credit" }, - {0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" }, - {0x12, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, - {0x12, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, - {0x12, 0x01, 0x38, 0x18, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x40, 0x40, "Off" }, - {0x12, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x12, 0x01, 0x80, 0x80, "Off" }, - {0x12, 0x01, 0x80, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x13, 0x01, 0x03, 0x00, "2" }, - {0x13, 0x01, 0x03, 0x01, "3" }, - {0x13, 0x01, 0x03, 0x02, "5" }, - {0x13, 0x01, 0x03, 0x03, "7" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x13, 0x01, 0x0c, 0x00, "20000" }, - {0x13, 0x01, 0x0c, 0x04, "50000" }, - {0x13, 0x01, 0x0c, 0x08, "100000" }, - {0x13, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x13, 0x01, 0x30, 0x00, "A" }, - {0x13, 0x01, 0x30, 0x10, "B" }, - {0x13, 0x01, 0x30, 0x20, "C" }, - {0x13, 0x01, 0x30, 0x30, "D" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x40, 0x00, "Upright" }, - {0x13, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Drv) - -static UINT8 __fastcall rollrace_main_read(UINT16 address) -{ - switch (address) - { - case 0xd806: - return 0; // nop - - case 0xd900: - return 0x51; // protection? - - case 0xf800: - case 0xf801: - case 0xf802: - return DrvInputs[address & 3]; - - case 0xf804: - case 0xf805: - return DrvDips[address & 1]; - } - - return 0; -} - -static void __fastcall rollrace_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xd900: - // protection? - return; - - case 0xe800: - soundlatch = data; - return; - - case 0xf400: - backgroundcolor = data; - return; - - case 0xf801: - backgroundpen = data; - return; - - case 0xf802: - backgroundpage = data & 0x1f; - backgroundflip = (data & 0x80) >> 7; - return; - - case 0xf803: - screen_flipy = data & 0x01; - return; - - case 0xfc00: - screen_flipx = data & 0x01; - return; - - case 0xfc01: - nmi_mask = data & 0x01; - return; - - case 0xfc02: - return; // coin counter - - case 0xfc04: - case 0xfc05: - charbank[address & 1] = data; - return; - - case 0xfc06: - spritebank = data; - return; - } -} - -static UINT8 __fastcall rollrace_sound_read(UINT16 address) -{ - switch (address) - { - case 0x3000: - return soundlatch; - } - - return 0; -} - -static void __fastcall rollrace_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x3000: - sound_nmi_mask = data & 0x01; - return; - - case 0x4000: - case 0x4001: - case 0x5000: - case 0x5001: - case 0x6000: - case 0x6001: - AY8910Write((address >> 12) & 3, address & 1, data); - return; - } -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - AY8910Reset(2); - - sound_nmi_mask = 0; - soundlatch = 0; - nmi_mask = 0; - spritebank = 0; - charbank[0] = 0; - charbank[1] = 0; - backgroundcolor = 0; - backgroundflip = 0; - backgroundpen = 0; - backgroundpage = 0; - screen_flipy = 0; - screen_flipx = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x00a000; - DrvZ80ROM1 = Next; Next += 0x001000; - - DrvGfxROM0 = Next; Next += 0x010000; - DrvGfxROM1 = Next; Next += 0x010000; - DrvGfxROM2 = Next; Next += 0x030000; - DrvGfxROM3 = Next; Next += 0x008000; - - DrvColPROM = Next; Next += 0x000300; - - DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x000400; - DrvColRAM = Next; Next += 0x000100; - DrvSprRAM = Next; Next += 0x000100; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[6] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[7] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[8] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x100; i++) - { - INT32 bit0 = (DrvColPROM[0x000 + i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[0x000 + i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[0x000 + i] >> 2) & 0x01; - INT32 bit3 = (DrvColPROM[0x000 + i] >> 3) & 0x01; - INT32 r = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3; - - bit0 = (DrvColPROM[0x100 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[0x100 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[0x100 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[0x100 + i] >> 3) & 0x01; - INT32 g = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3; - - bit0 = (DrvColPROM[0x200 + i] >> 0) & 0x01; - bit1 = (DrvColPROM[0x200 + i] >> 1) & 0x01; - bit2 = (DrvColPROM[0x200 + i] >> 2) & 0x01; - bit3 = (DrvColPROM[0x200 + i] >> 3) & 0x01; - INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { 0x2000 * 0 * 8, 0x2000 * 1 * 8, 0x2000 * 2 * 8 }; - INT32 Plane1[3] = { 0x6000 * 2 * 8, 0x6000 * 1 * 8, 0x6000 * 0 * 8 }; - INT32 XOffs0[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; //{ STEP8(0,1) }; - INT32 YOffs0[8] = { 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 }; //{ STEP8(56,-8) }; - INT32 XOffs1[32] = { STEP8(0,1), STEP8(64,1), STEP8(128,1), STEP8(192,1) }; - INT32 YOffs1[32] = { STEP8(0,8), STEP8(256,8), STEP8(512,8), STEP8(768,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x12000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0x06000); - - GfxDecode(0x0400, 3, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x06000); - - GfxDecode(0x0400, 3, 8, 8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x12000); - - GfxDecode(0x00c0, 3, 32, 32, Plane1, XOffs1, YOffs1, 0x400, tmp, DrvGfxROM2); - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x02000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x06000, 3, 1)) return 1; - if (set2) - if (BurnLoadRom(DrvZ80ROM0 + 0x08000, 4, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x02000, 5 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 6 + set2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 7 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 8 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 9 + set2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x06000, 11 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0c000, 12 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x02000, 13 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 14 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0e000, 15 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x04000, 16 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x0a000, 17 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 18 + set2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 19 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x02000, 20 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x04000, 21 + set2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x06000, 22 + set2, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00000, 23 + set2, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00100, 24 + set2, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00200, 25 + set2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 26 + set2, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x9fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0xc000, 0xcfff, MAP_RAM); - ZetMapMemory(DrvVidRAM, 0xe000, 0xe3ff, MAP_RAM); - ZetMapMemory(DrvColRAM, 0xe400, 0xe4ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xf000, 0xf0ff, MAP_RAM); - ZetSetWriteHandler(rollrace_main_write); - ZetSetReadHandler(rollrace_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x0fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x2000, 0x2fff, MAP_RAM); - ZetSetWriteHandler(rollrace_sound_write); - ZetSetReadHandler(rollrace_sound_read); - ZetClose(); - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); // RIGHT SPEAKER - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); // RIGHT SPEAKER - AY8910Init(2, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); // LEFT SPEAKER - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(2, 0.10, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - AY8910Exit(0); - AY8910Exit(1); - AY8910Exit(2); - - BurnFree(AllMem); - - set2 = 0; - - return 0; -} - -static void draw_road() -{ - for (INT32 offs = 0x3ff; offs >= 0; offs--) - { - INT32 sx, sy, flipx, flipy; - - if(!(backgroundflip)) - { - sy = ( 31 - offs / 32 ); - } - else - sy = ( offs / 32 ); - - sx = ( offs%32 ); - - if(screen_flipx) - sx = 31-sx; - - if(screen_flipy) - sy = 31-sy; - - flipx = screen_flipx; - flipy = (backgroundflip^screen_flipy); - - sx = 8 * sx; - sy = 8 * sy; - - if (!set2) { - sx -= 16; // offset - sy -= 16; - } - - INT32 code = DrvGfxROM3[offs + ( backgroundpage * 1024 )] - + ((( DrvGfxROM3[offs + 0x4000 + ( backgroundpage * 1024 )] & 0xc0 ) >> 6 ) * 256 ); - INT32 color = backgroundcolor & 0x1f; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM1); - } - } - } -} - -/*static void draw_road() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sy = (offs / 0x20) * 8; - INT32 sx = (offs & 0x1f) * 8; - - INT32 flipy = 1; - INT32 flipx = 0; - - if (backgroundflip == 0) { sy ^= 0xf8; flipy ^= 1; } - if (screen_flipx) { sx ^= 0xf8; flipx ^= 1; } - if (screen_flipy) { sy ^= 0xf8; flipy ^= 1; } - - INT32 ofst = offs + (backgroundpage * 0x400); - INT32 code = DrvGfxROM3[ofst] + ((DrvGfxROM3[ofst + 0x4000] & 0xc0) << 2); - INT32 color = backgroundcolor & 0x1f; - - if (flipy) { - if (flipx) { - Render8x8Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM1); - } else { - Render8x8Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM1); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, DrvGfxROM1); - } - } - } -}*/ - -static void draw_text() -{ - INT32 bank = charbank[0] | (charbank[1] << 1); - - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f); - INT32 sy = (((offs / 0x20) * 8) + DrvColRAM[2 * sx]) & 0xff; - - INT32 code = DrvVidRAM[offs] + (bank * 0x100); - INT32 color = DrvColRAM[sx * 2 + 1] & 0x1f; - - if (!screen_flipy) sy = (248 - sy) & 0xff; - if ( screen_flipx) sx = 31 - sx; - - if (!set2) - sx -= 2; // offset - sy -= 2*8; // offset - - if (screen_flipy) { - if (screen_flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx * 8, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code, sx * 8, sy, color, 3, 0, 0, DrvGfxROM0); - } - } else { - if (screen_flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx * 8, sy, color, 3, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx * 8, sy, color, 3, 0, 0, DrvGfxROM0); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0x80-4 ; offs >=0x0 ; offs -= 4) - { - INT32 flipy = screen_flipy; - INT32 flipx = screen_flipx; - INT32 attr = DrvSprRAM[offs+1]; - INT32 color = DrvSprRAM[offs+2] & 0x1f; - INT32 sy = DrvSprRAM[offs] - 16; - INT32 sx = DrvSprRAM[offs+3] - 16; - if (!set2) { - sx += 16; //offset - sy -= 16; - } - - if (sx && sy) - { - if (screen_flipx) sx = 224 - sx; - if (screen_flipy) sy = 224 - sy; - - if (attr & 0x80) flipy ^= 1; - - INT32 bank = ((attr & 0x40) >> 6) & 1; - if (bank) bank += spritebank; - - INT32 code = (attr & 0x3f) + (bank * 0x40); - - if (flipy == 0) { - if (flipx) { - Render32x32Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } - } else { - if (flipx) { - Render32x32Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } else { - Render32x32Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, DrvGfxROM2); - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = backgroundpen; - } - - if (nBurnLayer & 2) draw_road(); - if (nBurnLayer & 4) draw_sprites(); - if (nBurnLayer & 8) draw_text(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { memset (DrvInputs, 0, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - DrvInputs[2] = (DrvInputs[2] & ~0x40) | (DrvDips[2] & 0x40); - } - - INT32 nInterleave = 16; - INT32 nCyclesTotal[2] = { 3000000 / 60, 1500000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - nCyclesDone[0] += ZetRun(nSegment); - if (nmi_mask && i == (nInterleave - 1)) ZetNmi(); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nSegment / 2); - if (sound_nmi_mask && (i % (nInterleave / 4)) == ((nInterleave / 4) - 1)) ZetNmi(); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - AY8910Scan(nAction, pnMin); - - SCAN_VAR(sound_nmi_mask); - SCAN_VAR(soundlatch); - SCAN_VAR(nmi_mask); - SCAN_VAR(spritebank); - SCAN_VAR(charbank); - SCAN_VAR(backgroundcolor); - SCAN_VAR(backgroundflip); - SCAN_VAR(backgroundpen); - SCAN_VAR(backgroundpage); - SCAN_VAR(screen_flipy); - SCAN_VAR(screen_flipx); - } - - return 0; -} - - -// Fighting Roller - -static struct BurnRomInfo fightrolRomDesc[] = { - { "4.8k", 0x2000, 0xefa2f430, 0 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "5.8h", 0x2000, 0x2497d9f6, 0 | BRF_PRG | BRF_ESS }, // 1 - { "6.8f", 0x2000, 0xf39727b9, 0 | BRF_PRG | BRF_ESS }, // 2 - { "7.8d", 0x2000, 0xee65b728, 0 | BRF_PRG | BRF_ESS }, // 3 - - { "3.7m", 0x2000, 0xca4f353c, 1 | BRF_GRA }, // 4 Text Tiles - { "2.8m", 0x2000, 0x93786171, 1 | BRF_GRA }, // 5 - { "1.9m", 0x2000, 0xdc072be1, 1 | BRF_GRA }, // 6 - - { "6.20k", 0x2000, 0x003d7515, 2 | BRF_GRA }, // 7 Road Tiles - { "7.18k", 0x2000, 0x27843afa, 2 | BRF_GRA }, // 8 - { "5.20f", 0x2000, 0x51dd0108, 2 | BRF_GRA }, // 9 - - { "8.17m", 0x2000, 0x08ad783e, 3 | BRF_GRA }, // 10 Sprites - { "9.17r", 0x2000, 0x69b23461, 3 | BRF_GRA }, // 11 - { "10.17t", 0x2000, 0xba6ccd8c, 3 | BRF_GRA }, // 12 - { "11.18m", 0x2000, 0x06a5d849, 3 | BRF_GRA }, // 13 - { "12.18r", 0x2000, 0x569815ef, 3 | BRF_GRA }, // 14 - { "13.18t", 0x2000, 0x4f8af872, 3 | BRF_GRA }, // 15 - { "14.19m", 0x2000, 0x93f3c649, 3 | BRF_GRA }, // 16 - { "15.19r", 0x2000, 0x5b3d87e4, 3 | BRF_GRA }, // 17 - { "16.19u", 0x2000, 0xa2c24b64, 3 | BRF_GRA }, // 18 - - { "1.17a", 0x2000, 0xf0fa72fc, 4 | BRF_GRA }, // 19 Road Map - { "3.18b", 0x2000, 0x954268f7, 4 | BRF_GRA }, // 20 - { "2.17d", 0x2000, 0x2e38bb0e, 4 | BRF_GRA }, // 21 - { "4.18d", 0x2000, 0x3d9e16ab, 4 | BRF_GRA }, // 22 - - { "tbp24s10.7u", 0x0100, 0x9d199d33, 5 | BRF_GRA }, // 23 Color PROMs - { "tbp24s10.7t", 0x0100, 0xc0426582, 5 | BRF_GRA }, // 24 - { "tbp24s10.6t", 0x0100, 0xc096e05c, 5 | BRF_GRA }, // 25 - - { "8.6f", 0x1000, 0x6ec3c545, 6 | BRF_PRG | BRF_ESS }, // 26 Z80 #1 Code -}; - -STD_ROM_PICK(fightrol) -STD_ROM_FN(fightrol) - -struct BurnDriver BurnDrvFightrol = { - "fightrol", NULL, NULL, NULL, "1983", - "Fighting Roller\0", NULL, "Kaneko (Taito license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_TAITO_MISC, GBF_MISC, 0, - NULL, fightrolRomInfo, fightrolRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 240, 3, 4 -}; - -// Roller Aces (set 1) - -static struct BurnRomInfo RollaceRomDesc[] = { - - { "w1.8k", 0x2000, 0xc0bd3cf3, BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "w2.8h", 0x2000, 0xc1900a75, BRF_ESS | BRF_PRG }, // 1 - { "w3.8f", 0x2000, 0x16ceced6, BRF_ESS | BRF_PRG }, // 2 - { "w4.8d", 0x2000, 0xae826a96, BRF_ESS | BRF_PRG }, // 3 - - { "w3.7m", 0x2000, 0xf9970aae, BRF_GRA }, // 4 Text Tiles - { "w2.8m", 0x2000, 0x80573091, BRF_GRA }, // 5 - { "w1.9m", 0x2000, 0xb37effd8, BRF_GRA }, // 6 - - { "6.20k", 0x2000, 0x003d7515, BRF_GRA }, // 7 Road Tiles - { "7.18k", 0x2000, 0x27843afa, BRF_GRA }, // 8 - { "5.20f", 0x2000, 0x51dd0108, BRF_GRA }, // 9 - - { "w8.17m", 0x2000, 0xe2afe3a3, BRF_GRA }, // 10 Sprites - { "w9.17p", 0x2000, 0x8a8e6b62, BRF_GRA }, // 11 - { "w10.17t", 0x2000, 0x70bf7b23, BRF_GRA }, // 12 - { "11.18m", 0x2000, 0x06a5d849, BRF_GRA }, // 13 - { "12.18r", 0x2000, 0x569815ef, BRF_GRA }, // 14 - { "13.18t", 0x2000, 0x4f8af872, BRF_GRA }, // 15 - { "14.19m", 0x2000, 0x93f3c649, BRF_GRA }, // 16 - { "15.19r", 0x2000, 0x5b3d87e4, BRF_GRA }, // 17 - { "16.19u", 0x2000, 0xa2c24b64, BRF_GRA }, // 18 - - { "1.17a", 0x2000, 0xf0fa72fc, BRF_GRA }, // 19 Road Map - { "3.18b", 0x2000, 0x954268f7, BRF_GRA }, // 20 - { "2.17d", 0x2000, 0x2e38bb0e, BRF_GRA }, // 21 - { "4.18d", 0x2000, 0x3d9e16ab, BRF_GRA }, // 22 - - { "tbp24s10.7u", 0x100, 0x9d199d33, BRF_GRA }, // 23 Color PROMs - { "tbp24s10.7t", 0x100, 0xc0426582, BRF_GRA }, // 24 - { "tbp24s10.6t", 0x100, 0xc096e05c, BRF_GRA }, // 25 - - { "8.6f", 0x1000, 0x6ec3c545, BRF_ESS | BRF_PRG }, // 26 Z80 #1 Code -}; - -STD_ROM_PICK(Rollace) -STD_ROM_FN(Rollace) - -struct BurnDriver BurnDrvRollace = { - "rollace", "fightrol", NULL, NULL, "1983", - "Roller Aces (set 1)\0", NULL, "Kaneko (Williams license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_16BIT_ONLY, 2, HARDWARE_TAITO_MISC, GBF_MISC, 0, - NULL, RollaceRomInfo, RollaceRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 240, 3, 4 -}; - -INT32 Rollace2DrvInit() -{ - set2 = 1; - - return DrvInit(); -} - -// Roller Aces (set 2) - -static struct BurnRomInfo Rollace2RomDesc[] = { - - { "8k.764", 0x2000, 0xa7abff82, BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "8h.764", 0x2000, 0x9716ba03, BRF_ESS | BRF_PRG }, // 1 - { "8f.764", 0x2000, 0x3eadb0e8, BRF_ESS | BRF_PRG }, // 2 - { "8d.764", 0x2000, 0xbaac14db, BRF_ESS | BRF_PRG }, // 3 - { "8c.764", 0x2000, 0xb418ce84, BRF_ESS | BRF_PRG }, // 4 - - { "7m.764", 0x2000, 0x8b9b27af, BRF_GRA }, // 5 Text Tiles - { "8m.764", 0x2000, 0x2dfc38f2, BRF_GRA }, // 6 - { "9m.764", 0x2000, 0x2e3a825b, BRF_GRA }, // 7 - - { "6.20k", 0x2000, 0x003d7515, BRF_GRA }, // 8 Road Tiles - { "7.18k", 0x2000, 0x27843afa, BRF_GRA }, // 9 - { "5.20f", 0x2000, 0x51dd0108, BRF_GRA }, // 10 - - { "17n.764", 0x2000, 0x3365703c, BRF_GRA }, // 11 Sprites - { "9.17r", 0x2000, 0x69b23461, BRF_GRA }, // 12 - { "17t.764", 0x2000, 0x5e84cc9b, BRF_GRA }, // 13 - { "11.18m", 0x2000, 0x06a5d849, BRF_GRA }, // 14 - { "12.18r", 0x2000, 0x569815ef, BRF_GRA }, // 15 - { "13.18t", 0x2000, 0x4f8af872, BRF_GRA }, // 16 - { "14.19m", 0x2000, 0x93f3c649, BRF_GRA }, // 17 - { "15.19r", 0x2000, 0x5b3d87e4, BRF_GRA }, // 18 - { "16.19u", 0x2000, 0xa2c24b64, BRF_GRA }, // 19 - - { "1.17a", 0x2000, 0xf0fa72fc, BRF_GRA }, // 20 Road Map - { "3.18b", 0x2000, 0x954268f7, BRF_GRA }, // 21 - { "17d.764", 0x2000, 0x32e69320, BRF_GRA }, // 22 - { "4.18d", 0x2000, 0x3d9e16ab, BRF_GRA }, // 23 - - { "tbp24s10.7u", 0x100, 0x9d199d33, BRF_GRA }, // 24 Color PROMs - { "tbp24s10.7t", 0x100, 0xc0426582, BRF_GRA }, // 25 - { "tbp24s10.6t", 0x100, 0xc096e05c, BRF_GRA }, // 26 - - { "8.6f", 0x1000, 0x6ec3c545, BRF_ESS | BRF_PRG }, // 27 Z80 #1 Code -}; - -STD_ROM_PICK(Rollace2) -STD_ROM_FN(Rollace2) - -struct BurnDriver BurnDrvRollace2 = { - "rollace2", "fightrol", NULL, NULL, "1983", - "Roller Aces (set 2)\0", NULL, "Kaneko (Williams license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_16BIT_ONLY, 2, HARDWARE_TAITO_MISC, GBF_MISC, 0, - NULL, Rollace2RomInfo, Rollace2RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - Rollace2DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 240, 3, 4 -}; - - diff --git a/jan/src/burn/drv/taito/d_slapshot.cpp b/jan/src/burn/drv/taito/d_slapshot.cpp deleted file mode 100644 index 91b7c07ca..000000000 --- a/jan/src/burn/drv/taito/d_slapshot.cpp +++ /dev/null @@ -1,990 +0,0 @@ -// Based on MAME driver by David Graves - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "taito.h" -#include "taito_ic.h" -#include "burn_ym2610.h" -#include "eeprom.h" -#include "burn_gun.h" -#include "timekpr.h" - -static void SlapshotDraw(); -static void Opwolf3Draw(); -static TaitoF2SpriteBufferUpdate TaitoF2SpriteBufferFunction; - -static INT32 CheckTimeKeeper = 0; // for gun auto-calibration -static INT32 Opwolf3mode = 0; - -#ifdef BUILD_A68K -static bool bUseAsm68KCoreOldValue = false; -#endif - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo SlapshotInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0640FIOInputPort1 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0640FIOInputPort3 + 4, "p1 start" }, - {"Start 2" , BIT_DIGITAL , TC0640FIOInputPort3 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0640FIOInputPort4 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0640FIOInputPort4 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0640FIOInputPort4 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0640FIOInputPort4 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0640FIOInputPort2 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0640FIOInputPort2 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0640FIOInputPort2 + 2, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , TC0640FIOInputPort4 + 4, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0640FIOInputPort4 + 5, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0640FIOInputPort4 + 6, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0640FIOInputPort4 + 7, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0640FIOInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0640FIOInputPort2 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0640FIOInputPort2 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0640FIOInputPort3 + 0, "service" }, - {"Tilt" , BIT_DIGITAL , TC0640FIOInputPort1 + 1, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, -}; - -STDINPUTINFO(Slapshot) - -static struct BurnInputInfo Opwolf3InputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0640FIOInputPort1 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0640FIOInputPort2 + 2, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0640FIOInputPort1 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0640FIOInputPort2 + 6, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , TC0640FIOInputPort1 + 6, "p3 coin" }, - {"Coin 4" , BIT_DIGITAL , TC0640FIOInputPort1 + 7, "p4 coin" }, - - A("P1 Gun X" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "mouse x-axis" ), - A("P1 Gun Y" , BIT_ANALOG_REL, &TaitoAnalogPort1 , "mouse y-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , TC0640FIOInputPort2 + 0, "mouse button 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0640FIOInputPort2 + 1, "mouse button 2" }, - - A("P2 Gun X" , BIT_ANALOG_REL, &TaitoAnalogPort2 , "p2 x-axis" ), - A("P2 Gun Y" , BIT_ANALOG_REL, &TaitoAnalogPort3 , "p2 y-axis" ), - {"P2 Fire 1" , BIT_DIGITAL , TC0640FIOInputPort2 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0640FIOInputPort2 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0640FIOInputPort3 + 0, "service" }, - {"Tilt" , BIT_DIGITAL , TC0640FIOInputPort1 + 1, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, -}; - -STDINPUTINFO(Opwolf3) - -#undef A - -static void TC0640FIOMakeInputs() -{ - TC0640FIOInput[0] = 0xff; - TC0640FIOInput[1] = 0xff; - TC0640FIOInput[2] = 0xff; - TC0640FIOInput[3] = 0xff; - TC0640FIOInput[4] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - TC0640FIOInput[0] -= (TC0640FIOInputPort0[i] & 1) << i; - TC0640FIOInput[1] -= (TC0640FIOInputPort1[i] & 1) << i; - TC0640FIOInput[2] -= (TC0640FIOInputPort2[i] & 1) << i; - TC0640FIOInput[3] -= (TC0640FIOInputPort3[i] & 1) << i; - TC0640FIOInput[4] -= (TC0640FIOInputPort4[i] & 1) << i; - } -} - -static void Opwolf3MakeInputs() -{ - TC0640FIOMakeInputs(); - - BurnGunMakeInputs(0, (INT16)TaitoAnalogPort0, (INT16)TaitoAnalogPort1); - BurnGunMakeInputs(1, (INT16)TaitoAnalogPort2, (INT16)TaitoAnalogPort3); -} - -static struct BurnDIPInfo SlapshotDIPList[]= -{ - {0x14, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, -}; - -STDDIPINFO(Slapshot) - -static struct BurnDIPInfo Opwolf3DIPList[]= -{ - {0x11, 0xff, 0xff, 0x10, NULL }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x10, 0x10, "Off" }, - {0x11, 0x01, 0x10, 0x00, "On" }, -}; - -STDDIPINFO(Opwolf3) - -static struct BurnRomInfo SlapshotRomDesc[] = { - { "d71-15.3", 0x080000, 0x1470153f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d71-16.1", 0x080000, 0xf13666e0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "d71-07.77", 0x010000, 0xdd5f670c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d71-04.79", 0x080000, 0xb727b81c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d71-05.80", 0x080000, 0x7b0f5d6d, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d71-06.37", 0x080000, 0xf3324188, BRF_SND | TAITO_YM2610A }, - - // Sprites - handled manually - { "d71-01.23", 0x100000, 0x0b1e8c27, BRF_GRA }, - { "d71-02.24", 0x100000, 0xccaaea2d, BRF_GRA }, - { "d71-03.25", 0x100000, 0xdccef9ec, BRF_GRA }, -}; - -STD_ROM_PICK(Slapshot) -STD_ROM_FN(Slapshot) - -static struct BurnRomInfo Opwolf3RomDesc[] = { - { "d74_16.3", 0x080000, 0x198ff1f6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d74_21.1", 0x080000, 0xc61c558b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d74_18.18", 0x080000, 0xbd5d7cdb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d74_17.17", 0x080000, 0xac35a672, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "d74_22.77", 0x010000, 0x118374a6, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d74_05.80", 0x200000, 0x85ea64cc, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d74_06.81", 0x200000, 0x2fa1e08d, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d74_01.37", 0x200000, 0x115313e0, BRF_SND | TAITO_YM2610A }, - - // Sprites - handled manually - { "d74_02.23", 0x200000, 0xaab86332, BRF_GRA }, - { "d74_03.24", 0x200000, 0x3f398916, BRF_GRA }, - { "d74_04.25", 0x200000, 0x2f385638, BRF_GRA }, -}; - -STD_ROM_PICK(Opwolf3) -STD_ROM_FN(Opwolf3) - -static struct BurnRomInfo Opwolf3uRomDesc[] = { - { "d74_16.3", 0x080000, 0x198ff1f6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d74_20.1", 0x080000, 0x960fd892, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d74_18.18", 0x080000, 0xbd5d7cdb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d74_17.17", 0x080000, 0xac35a672, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "d74_19.77", 0x010000, 0x05d53f06, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d74_05.80", 0x200000, 0x85ea64cc, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d74_06.81", 0x200000, 0x2fa1e08d, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d74_01.37", 0x200000, 0x115313e0, BRF_SND | TAITO_YM2610A }, - - // Sprites - handled manually - { "d74_02.23", 0x200000, 0xaab86332, BRF_GRA }, - { "d74_03.24", 0x200000, 0x3f398916, BRF_GRA }, - { "d74_04.25", 0x200000, 0x2f385638, BRF_GRA }, -}; - -STD_ROM_PICK(Opwolf3u) -STD_ROM_FN(Opwolf3u) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - TaitoYM2610BRom = Next; Next += TaitoYM2610BRomSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x10000; - TaitoZ80Ram1 = Next; Next += 0x02000; - TaitoSpriteRam = Next; Next += 0x10000; - TaitoSpriteRamBuffered = Next; Next += 0x10000; - TaitoSpriteExtension = Next; Next += 0x02000; - TaitoPaletteRam = Next; Next += 0x08000; - - TaitoRamEnd = Next; - - TaitoChars = Next; Next += TaitoNumChar * TaitoCharWidth * TaitoCharHeight; - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - TaitoPalette = (UINT32*)Next; Next += 0x02000 * sizeof(UINT32); - TaitoF2SpriteList = (TaitoF2SpriteEntry*)Next; Next += 0x400 * sizeof(TaitoF2SpriteEntry); - - TaitoMemEnd = Next; - - return 0; -} - -static INT32 SlapshotDoReset() -{ - TaitoDoReset(); - - CheckTimeKeeper = 1; - - return 0; -} - -UINT8 __fastcall Slapshot68KReadByte(UINT32 a) -{ - if (a >= 0xa00000 && a <= 0xa03fff) { - return TimeKeeperRead((a - 0xa00000) >> 1); - } - - if (a >= 0xc00000 && a <= 0xc0000f) { - return TC0640FIORead((a - 0xc00000) >> 1); - } - - if (a >= 0xc00020 && a <= 0xc0002f) { - if (a == 0xc00027) bprintf(PRINT_IMPORTANT, _T("%x\n"), a); - - if (a == 0xc00026) return (TC0640FIOInput[2] & 0xef) | (TaitoDip[0] & 0x10); - - return TC0640FIORead((a - 0xc00020) >> 1); - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Slapshot68KWriteByte(UINT32 a, UINT8 d) -{ - if (a <= 0x0fffff) return; - - if (a >= 0xa00000 && a <= 0xa03fff) { - TimeKeeperWrite((a - 0xa00000) >> 1, d); - return; - } - - TC0360PRIHalfWordWrite_Map(0xb00000) - - if (a >= 0xc00000 && a <= 0xc0000f) { - TC0640FIOWrite((a - 0xc00000) >> 1, d); - return; - } - - if (a >= 0xc00010 && a <= 0xc0002f) { - return; - } - - switch (a) { - case 0xd00000: { - TC0140SYTPortWrite(d); - return; - } - - case 0xd00002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Slapshot68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Slapshot68KWriteWord(UINT32 a, UINT16 d) -{ - if (a < 0x10000) return; // silly bad writes to rom area - - if (a == 0xe80000) return; // gun "rumble" - - TC0480SCPCtrlWordWrite_Map(0x830000) - - if (a >= 0xc00000 && a <= 0xc0000f) { - TC0640FIOWrite((a - 0xc00000) >> 1, d); - return; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Opwolf3Gun68KReadByte(UINT32 a) -{ - switch (a) { - case 0xe00000: { - float Temp = (float)~BurnGunReturnX(0) / 256.0; - Temp *= 160.0; - return ((UINT8)Temp - 0x5b) & 0xff; - } - - case 0xe00002: { - float Temp = (float)BurnGunReturnY(0) / 256.0; - Temp *= 112; - return ((UINT8)Temp + 0x08) & 0xff; - } - - case 0xe00004: { - float Temp = (float)~BurnGunReturnX(1) / 256.0; - Temp *= 160.0; - return ((UINT8)Temp - 0x5b) & 0xff; - } - - case 0xe00006: { - float Temp = (float)BurnGunReturnY(1) / 256.0; - Temp *= 112; - return ((UINT8)Temp + 0x08) & 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Opwolf3Gun68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xe00000: - case 0xe00002: - case 0xe00004: - case 0xe00006: { - SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Opwolf3Gun68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Opwolf3Gun68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall SlapshotZ80Read(UINT16 a) -{ - switch (a) { - case 0xe000: { - return BurnYM2610Read(0); - } - - case 0xe201: { - return TC0140SYTSlaveCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall SlapshotZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - BurnYM2610Write(0, d); - return; - } - - case 0xe001: { - BurnYM2610Write(1, d); - return; - } - - case 0xe002: { - BurnYM2610Write(2, d); - return; - } - - case 0xe003: { - BurnYM2610Write(3, d); - return; - } - - case 0xe200: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xe201: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xf200: { - TaitoZ80Bank = (d - 1) & 7; - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static void SlapshotFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 SlapshotSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double SlapshotGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[16] = { 4, 0, 20, 16, 12, 8, 28, 24, 36, 32, 52, 48, 44, 40, 60, 56 }; -static INT32 CharYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 SpritePlaneOffsets[6] = { 0x1000000, 0x1000001, 0, 1, 2, 3 }; -static INT32 SpriteXOffsets[16] = { 4, 0, 12, 8, 20, 16, 28, 24, 36, 32, 44, 40, 52, 48, 60, 56 }; -static INT32 SpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 Opwolf3SpritePlaneOffsets[6] = { 0x2000000, 0x2000001, 0, 1, 2, 3 }; - -#ifdef BUILD_A68K -static void SwitchToMusashi() -{ - if (bBurnUseASMCPUEmulation) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching to Musashi 68000 core\n")); -#endif - bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation; - bBurnUseASMCPUEmulation = false; - } -} -#endif - -static INT32 MachineInit() -{ - INT32 nLen; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - GenericTilesInit(); - - TaitoPriorityMap = pPrioDraw; - - TC0480SCPInit(TaitoNumChar, 3, 30, 9, -1, 1, -2); - TC0480SCPSetPriMap(TaitoPriorityMap); - TC0480SCPSetColourBase(256); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0640FIOInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, Taito68KRom1Size - 1, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(TaitoSpriteExtension , 0x700000, 0x701fff, MAP_RAM); - SekMapMemory(TC0480SCPRam , 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x900000, 0x907fff, MAP_RAM); - SekSetReadWordHandler(0, Slapshot68KReadWord); - SekSetWriteWordHandler(0, Slapshot68KWriteWord); - SekSetReadByteHandler(0, Slapshot68KReadByte); - SekSetWriteByteHandler(0, Slapshot68KWriteByte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(SlapshotZ80Read); - ZetSetWriteHandler(SlapshotZ80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2610Init(8000000, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &SlapshotFMIRQHandler, SlapshotSynchroniseStream, SlapshotGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - TaitoMakeInputsFunction = TC0640FIOMakeInputs; - TaitoDrawFunction = SlapshotDraw; - - nTaitoCyclesTotal[0] = 14364000 / 60; - nTaitoCyclesTotal[1] = 4000000 / 60; - - TimeKeeperInit(TIMEKEEPER_MK48T08, NULL); - - TaitoF2SpritesDisabled = 1; - TaitoF2SpritesActiveArea = 0; - TaitoF2SpriteType = 2; - TaitoXOffset = 3; - - TaitoF2SpriteBufferFunction = TaitoF2NoBuffer; - - for (INT32 i = 0; i < 8; i++) { - TaitoF2SpriteBankBuffered[i] = 0x400 * i; - TaitoF2SpriteBank[i] = TaitoF2SpriteBankBuffered[i]; - } - - return 0; -} - -static INT32 SlapshotInit() -{ - TaitoCharModulo = 0x400; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 16; - TaitoCharHeight = 16; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x2000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 6; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x4000; - - if (MachineInit()) return 1; - - INT32 nRet; - UINT8 *TempRom = (UINT8*)BurnMalloc(0x400000); - memset(TempRom, 0, 0x400000); - nRet = BurnLoadRom(TempRom + 0x000000, 6, 2); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x000001, 7, 2); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x300000, 8, 1); if (nRet) return 1; - INT32 Data; - INT32 Offset = 0x400000 / 2; - for (INT32 i = 0x400000 / 2 + 0x400000 / 4; i < 0x400000; i++) { - INT32 d1, d2, d3, d4; - - Data = TempRom[i]; - d1 = (Data >> 0) & 3; - d2 = (Data >> 2) & 3; - d3 = (Data >> 4) & 3; - d4 = (Data >> 6) & 3; - - TempRom[Offset] = (d1 << 2) | (d2 << 6); - Offset++; - - TempRom[Offset] = (d3 << 2) | (d4 << 6); - Offset++; - } - GfxDecode(TaitoNumSpriteA, TaitoSpriteANumPlanes, TaitoSpriteAWidth, TaitoSpriteAHeight, TaitoSpriteAPlaneOffsets, TaitoSpriteAXOffsets, TaitoSpriteAYOffsets, TaitoSpriteAModulo, TempRom, TaitoSpritesA); - BurnFree(TempRom); - - SlapshotDoReset(); - - return 0; -} - -static INT32 Opwolf3Init() -{ - TaitoCharModulo = 0x400; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 16; - TaitoCharHeight = 16; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x8000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 6; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = Opwolf3SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x8000; - - if (MachineInit()) return 1; - - INT32 nRet; - UINT8 *TempRom = (UINT8*)BurnMalloc(0x800000); - memset(TempRom, 0, 0x400000); - nRet = BurnLoadRom(TempRom + 0x000000, 8, 2); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x000001, 9, 2); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x600000, 10, 1); if (nRet) return 1; - INT32 Data; - INT32 Offset = 0x800000 / 2; - for (INT32 i = 0x800000 / 2 + 0x800000 / 4; i < 0x800000; i++) { - INT32 d1, d2, d3, d4; - - Data = TempRom[i]; - d1 = (Data >> 0) & 3; - d2 = (Data >> 2) & 3; - d3 = (Data >> 4) & 3; - d4 = (Data >> 6) & 3; - - TempRom[Offset] = (d1 << 2) | (d2 << 6); - Offset++; - - TempRom[Offset] = (d3 << 2) | (d4 << 6); - Offset++; - } - GfxDecode(TaitoNumSpriteA, TaitoSpriteANumPlanes, TaitoSpriteAWidth, TaitoSpriteAHeight, TaitoSpriteAPlaneOffsets, TaitoSpriteAXOffsets, TaitoSpriteAYOffsets, TaitoSpriteAModulo, TempRom, TaitoSpritesA); - BurnFree(TempRom); - - SekOpen(0); - SekMapHandler(1, 0xe00000, 0xe00007, MAP_RAM); - SekSetReadWordHandler(1, Opwolf3Gun68KReadWord); - SekSetWriteWordHandler(1, Opwolf3Gun68KWriteWord); - SekSetReadByteHandler(1, Opwolf3Gun68KReadByte); - SekSetWriteByteHandler(1, Opwolf3Gun68KWriteByte); - SekClose(); - - TaitoMakeInputsFunction = Opwolf3MakeInputs; - TaitoDrawFunction = Opwolf3Draw; - Opwolf3mode = 1; - - BurnGunInit(2, true); - - SlapshotDoReset(); - - return 0; -} - -static INT32 SlapshotExit() -{ - TaitoExit(); - -#ifdef BUILD_A68K - // Switch back CPU core if needed - if (bUseAsm68KCoreOldValue) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching back to A68K core\n")); -#endif - bUseAsm68KCoreOldValue = false; - bBurnUseASMCPUEmulation = true; - } -#endif - - TimeKeeperExit(); - - Opwolf3mode = 0; - - return 0; -} - -inline static INT32 CalcCol(INT32 nColour) -{ - INT32 r, g, b; - - r = (BURN_ENDIAN_SWAP_INT32(nColour) & 0x000000ff) >> 0; - g = (BURN_ENDIAN_SWAP_INT32(nColour) & 0xff000000) >> 24; - b = (BURN_ENDIAN_SWAP_INT32(nColour) & 0x00ff0000) >> 16; - - return BurnHighCol(r, g, b, 0); -} - -static void SlapshotCalcPalette() -{ - INT32 i; - UINT32* ps; - UINT32* pd; - - for (i = 0, ps = (UINT32*)TaitoPaletteRam, pd = TaitoPalette; i < 0x2000; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void SlapshotDraw() -{ - UINT8 Layer[4]; - UINT16 Priority = TC0480SCPGetBgPriority(); - - Layer[0] = (Priority & 0xf000) >> 12; - Layer[1] = (Priority & 0x0f00) >> 8; - Layer[2] = (Priority & 0x00f0) >> 4; - Layer[3] = (Priority & 0x000f) >> 0; - - TaitoF2TilePriority[0] = TC0360PRIRegs[4] & 0x0f; - TaitoF2TilePriority[1] = TC0360PRIRegs[4] >> 4; - TaitoF2TilePriority[2] = TC0360PRIRegs[5] & 0x0f; - TaitoF2TilePriority[3] = TC0360PRIRegs[5] >> 4; - - TaitoF2SpritePriority[0] = TC0360PRIRegs[6] & 0x0f; - TaitoF2SpritePriority[1] = TC0360PRIRegs[6] >> 4; - TaitoF2SpritePriority[2] = TC0360PRIRegs[7] & 0x0f; - TaitoF2SpritePriority[3] = TC0360PRIRegs[7] >> 4; - -#if 0 - // ** save this! ** for later impl. in d_taitof2 -dink - bprintf(0, _T("sprite %X %X %X %X\n"), TaitoF2SpritePriority[0], TaitoF2SpritePriority[1], TaitoF2SpritePriority[2], TaitoF2SpritePriority[3]); - bprintf(0, _T("tile %X %X %X %X\n"), TaitoF2TilePriority[0], TaitoF2TilePriority[1], TaitoF2TilePriority[2], TaitoF2TilePriority[3]); - bprintf(0, _T("layer %X %X %X %X\n"), Layer[0], Layer[1], Layer[2], Layer[3]); - bprintf(0, _T("pri %X %X %X %X %X %X %X %X %X %X.\n"), TC0360PRIRegs[0], TC0360PRIRegs[1], TC0360PRIRegs[2], TC0360PRIRegs[3], TC0360PRIRegs[4], TC0360PRIRegs[5], TC0360PRIRegs[6], TC0360PRIRegs[7], TC0360PRIRegs[8], TC0360PRIRegs[9], TC0360PRIRegs[10]); -#endif - - SlapshotCalcPalette(); - BurnTransferClear(); - - if (nBurnLayer & 1) TC0480SCPTilemapRenderPrio(Layer[0], 0, 1, TaitoChars); - if (nBurnLayer & 2) TC0480SCPTilemapRenderPrio(Layer[1], 0, 2, TaitoChars); - if (nBurnLayer & 4) TC0480SCPTilemapRenderPrio(Layer[2], 0, 4, TaitoChars); - if (nBurnLayer & 8) TC0480SCPTilemapRenderPrio(Layer[3], 0, 8, TaitoChars); - - { // sprite layer - TaitoF2MakeSpriteList(); - - INT32 primasks[4] = { 0, 0, 0, 0 }; - - for (INT32 i = 0; i < 4; i++) { - if (TaitoF2SpritePriority[i] < TaitoF2TilePriority[Layer[0]]) primasks[i] |= 0xaaaa; - if (TaitoF2SpritePriority[i] < TaitoF2TilePriority[Layer[1]]) primasks[i] |= 0xcccc; - if (TaitoF2SpritePriority[i] < TaitoF2TilePriority[Layer[2]]) primasks[i] |= 0xf0f0; - if (TaitoF2SpritePriority[i] < TaitoF2TilePriority[Layer[3]]) primasks[i] |= 0xff00; - } - - if (nSpriteEnable & 1) - TaitoF2RenderSpriteListPriMasks((INT32 *)&primasks); - } - - TC0480SCPRenderCharLayer(); - - BurnTransferCopy(TaitoPalette); -} - -static void Opwolf3Draw() -{ - SlapshotDraw(); - - /*for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { // game draws it's own targets. saving just incase. - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - }*/ -} - -static void Opwolf3Defaults() -{ - UINT8 opwolf3tkprdata[80] = { - // first 64 bytes of 8192 - 0x45,0x41,0x53,0x54,0x00,0x08,0x05,0x08,0x05,0x08,0xa5,0x77,0xa5,0x77,0x11,0x03, - 0x0e,0x00,0x01,0x39,0x41,0x00,0x00,0x7f,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x02,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe4,0x00,0x00,0x00, - // last 16 bytes of 8192 - 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x26,0x22,0x03,0x14,0x03,0x17 - }; - - UINT8 *tkprdat = TimeKeeperGetRaw(); - if (tkprdat) { - memset(tkprdat, 0, 8192); - memmove(tkprdat, opwolf3tkprdata, 64); - memmove(tkprdat + 0x1ff0, opwolf3tkprdata + 64, 16); - } - -} - -static INT32 SlapshotFrame() -{ - INT32 nInterleave = 100; - - if (TaitoReset) SlapshotDoReset(); - - if (CheckTimeKeeper) { - CheckTimeKeeper = 0; - if (Opwolf3mode && TimeKeeperIsEmpty()) { - bprintf(0, _T("Operation Wolf 3 default calibrations loaded..\n")); - Opwolf3Defaults(); - } - } - - - TaitoMakeInputsFunction(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - if ((GetCurrentFrame() % 60) == 0) TimeKeeperTick(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == 83) { SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); } - if (i == (nInterleave - 1)) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - ZetOpen(0); - BurnTimerUpdate((i + 1) * (nTaitoCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - TaitoF2HandleSpriteBuffering(); - - if (pBurnDraw) TaitoDrawFunction(); - - TaitoF2SpriteBufferFunction(); - - return 0; -} - -static INT32 SlapshotScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029709; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd-TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - TaitoICScan(nAction); - - TimeKeeperScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - - SCAN_VAR(TC0640FIOInput); - SCAN_VAR(TaitoZ80Bank); - SCAN_VAR(nTaitoCyclesDone); - SCAN_VAR(nTaitoCyclesSegment); - SCAN_VAR(TaitoF2SpriteBank); - SCAN_VAR(TaitoF2SpriteBankBuffered); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetClose(); - } - - return 0; -} - -static INT32 Opwolf3Scan(INT32 nAction, INT32 *pnMin) -{ - INT32 nRet = SlapshotScan(nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - BurnGunScan(); - } - - return nRet; -} - -struct BurnDriver BurnDrvSlapshot = { - "slapshot", NULL, NULL, NULL, "1994", - "Slap Shot (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SPORTSMISC, 0, - NULL, SlapshotRomInfo, SlapshotRomName, NULL, NULL, SlapshotInputInfo, SlapshotDIPInfo, - SlapshotInit, SlapshotExit, SlapshotFrame, NULL, SlapshotScan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvOpwolf3 = { - "opwolf3", NULL, NULL, NULL, "1994", - "Operation Wolf 3 (World)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, Opwolf3RomInfo, Opwolf3RomName, NULL, NULL, Opwolf3InputInfo, Opwolf3DIPInfo, - Opwolf3Init, SlapshotExit, SlapshotFrame, NULL, Opwolf3Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvOpwolf3u = { - "opwolf3u", "opwolf3", NULL, NULL, "1994", - "Operation Wolf 3 (US)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, Opwolf3uRomInfo, Opwolf3uRomName, NULL, NULL, Opwolf3InputInfo, Opwolf3DIPInfo, - Opwolf3Init, SlapshotExit, SlapshotFrame, NULL, Opwolf3Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_superchs.cpp b/jan/src/burn/drv/taito/d_superchs.cpp deleted file mode 100644 index 8b4df1c35..000000000 --- a/jan/src/burn/drv/taito/d_superchs.cpp +++ /dev/null @@ -1,889 +0,0 @@ -// Taito SuperChase driver for FB Alpha -// Based on MAME driver by Bryan McPhail, David Graves - -// Notes: -// SubCPU needs a 2mhz overclocking boost to prevent flashing glitches in -// certain areas. For example - late in level 1 near the SanFranCisco-style Cable Cars; -// when going down a hill, the background "buildings" tilemap will flash through the road -// near the bottom quarter of the screen. -dink - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "taitof3_snd.h" -#include "taito.h" -#include "taito_ic.h" -#include "eeprom.h" -//#include "es5506.h" -#include "burn_shift.h" - -struct SpriteEntry { - INT32 Code; - INT32 x; - INT32 y; - INT32 Colour; - INT32 xFlip; - INT32 yFlip; - INT32 xZoom; - INT32 yZoom; - INT32 Priority; -}; - -static struct SpriteEntry *SpriteList; - -static UINT8 SuperchsCoinWord; -static UINT16 SuperchsCpuACtrl; -static UINT8 SuperchsSteer = 0; - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} -static struct BurnInputInfo SuperchsInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort2 + 7, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort1 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort2 + 6, "p2 coin" }, - - A("P1 Steering" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - {"P1 Accelerate" , BIT_DIGITAL , TaitoInputPort3 + 0, "p1 fire 1" }, - {"P1 Fire 2 (Brake)" , BIT_DIGITAL , TaitoInputPort1 + 6, "p1 fire 2" }, - {"P1 Fire 3 (Nitro)" , BIT_DIGITAL , TaitoInputPort1 + 4, "p1 fire 3" }, - {"P1 Fire 4 (Shift)" , BIT_DIGITAL , TaitoInputPort1 + 5, "p1 fire 4" }, - {"P1 Fire 5 (Brake?)", BIT_DIGITAL , TaitoInputPort1 + 0, "p1 fire 5" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort2 + 5, "service" }, - {"Diagnosics" , BIT_DIGITAL , TaitoInputPort2 + 4, "diag" }, -}; - -STDINPUTINFO(Superchs) -#undef A - -static void SuperchsMakeInputs() -{ - TaitoInput[0] = 0x7f;// bit 7 is eeprom read - TaitoInput[1] = 0xff; - TaitoInput[2] = 0xf7;// bit 3 is freeze - - for (INT32 i = 0; i < 8; i++) { - TaitoInput[0] -= (TaitoInputPort0[i] & 1) << i; - TaitoInput[1] -= (TaitoInputPort1[i] & 1) << i; - TaitoInput[2] -= (TaitoInputPort2[i] & 1) << i; - } - - BurnShiftInputCheckToggle(TaitoInputPort1[5]); - - TaitoInput[1] = (TaitoInput[1] & ~0x20) | ((bBurnShiftStatus) ? 0x20 : 0x00); -} - -static struct BurnRomInfo SuperchsRomDesc[] = { - { "d46-35+.ic27", 0x040000, 0x1575c9a7, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, // Actually labeled D46 35* - { "d46-34+.ic25", 0x040000, 0xc72a4d2b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, // Actually labeled D46 34* - { "d46-33+.ic23", 0x040000, 0x3094bcd0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, // Actually labeled D46 33* - { "d46-32+.ic21", 0x040000, 0x4fbeb335, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, // Actually labeled D46 32* - - { "d46-24.ic127", 0x020000, 0xa006baa1, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "d46-23.ic112", 0x020000, 0x9a69dbd0, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "d46-37.ic8", 0x020000, 0x60b51b91, BRF_ESS | BRF_PRG | TAITO_68KROM3_BYTESWAP }, - { "d46-36.ic7", 0x020000, 0x8f7aa276, BRF_ESS | BRF_PRG | TAITO_68KROM3_BYTESWAP }, - - { "d46-05.ic87", 0x100000, 0x150d0e4c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d46-06.ic88", 0x100000, 0x321308be, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d46-04.ic67", 0x200000, 0x832769a9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d46-03.ic66", 0x200000, 0xe0e9cbfd, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d46-02.ic65", 0x200000, 0xa83ca82e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d46-01.ic64", 0x200000, 0x5c2ae92d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "d46-07.ic34", 0x080000, 0xc3b8b093, BRF_GRA | TAITO_SPRITEMAP }, - - { "d46-10.ic2", 0x200000, 0x306256be, BRF_SND | TAITO_ES5505_BYTESWAP }, //15 - { "d46-12.ic4", 0x200000, 0xa24a53a8, BRF_SND | TAITO_ES5505_BYTESWAP }, //16 - { "d46-11.ic5", 0x200000, 0xd4ea0f56, BRF_SND | TAITO_ES5505_BYTESWAP }, //17 - - { "eeprom-superchs.bin",0x000080, 0x230f0753, BRF_PRG | TAITO_DEFAULT_EEPROM }, - - { "pal16l8bcn-d46-13.ic82", 0x000104, 0x2f32e889, BRF_OPT }, - { "pal16l8bcn-d46-14.ic84", 0x000104, 0x5ac8b5f8, BRF_OPT }, - { "pal16l8bcn-d46-15.ic9", 0x000104, 0x38ea9f36, BRF_OPT }, - { "palce20v8h-d46-16.ic8", 0x000157, 0x64e1ff9f, BRF_OPT }, - { "palce20v8h-d46-17.ic10", 0x000157, 0x5c9d94e1, BRF_OPT }, - { "palce16v8h-d46-18.ic6", 0x000117, 0x7581b894, BRF_OPT }, - { "palce16v8h-d46-19.ic7", 0x000117, 0xa5d863d0, BRF_OPT }, - { "palce20v8h-d46-20.ic22", 0x000157, 0x838cbc11, BRF_OPT }, // Located on the sound board - { "palce20v8h-d46-21.ic23", 0x000157, 0x93c5aac2, BRF_OPT }, // Located on the sound board - { "palce20v8h-d46-22.ic24", 0x000157, 0xc6a10b06, BRF_OPT }, // Located on the sound board -}; - -STD_ROM_PICK(Superchs) -STD_ROM_FN(Superchs) - -static struct BurnRomInfo SuperchsuRomDesc[] = { - { "d46-35+.ic27", 0x040000, 0x1575c9a7, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, // Actually labeled D46 35* - { "d46-34+.ic25", 0x040000, 0xc72a4d2b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, // Actually labeled D46 34* - { "d46-33+.ic23", 0x040000, 0x3094bcd0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, // Actually labeled D46 33* - { "d46-31+.ic21", 0x040000, 0x38b983a3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, // Actually labeled D46 31* - - { "d46-24.ic127", 0x020000, 0xa006baa1, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "d46-23.ic112", 0x020000, 0x9a69dbd0, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "d46-37.ic8", 0x020000, 0x60b51b91, BRF_ESS | BRF_PRG | TAITO_68KROM3_BYTESWAP }, - { "d46-36.ic7", 0x020000, 0x8f7aa276, BRF_ESS | BRF_PRG | TAITO_68KROM3_BYTESWAP }, - - { "d46-05.ic87", 0x100000, 0x150d0e4c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d46-06.ic88", 0x100000, 0x321308be, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d46-04.ic67", 0x200000, 0x832769a9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d46-03.ic66", 0x200000, 0xe0e9cbfd, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d46-02.ic65", 0x200000, 0xa83ca82e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d46-01.ic64", 0x200000, 0x5c2ae92d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "d46-07.ic34", 0x080000, 0xc3b8b093, BRF_GRA | TAITO_SPRITEMAP }, - - { "d46-10.ic2", 0x200000, 0x306256be, BRF_SND | TAITO_ES5505_BYTESWAP }, // 15 - { "d46-12.ic4", 0x200000, 0xa24a53a8, BRF_SND | TAITO_ES5505_BYTESWAP }, - { "d46-11.ic5", 0x200000, 0xd4ea0f56, BRF_SND | TAITO_ES5505_BYTESWAP }, - - { "eeprom-superchs.bin",0x000080, 0x230f0753, BRF_PRG | TAITO_DEFAULT_EEPROM }, - - { "pal16l8bcn-d46-13.ic82", 0x000104, 0x2f32e889, BRF_OPT }, - { "pal16l8bcn-d46-14.ic84", 0x000104, 0x5ac8b5f8, BRF_OPT }, - { "pal16l8bcn-d46-15.ic9", 0x000104, 0x38ea9f36, BRF_OPT }, - { "palce20v8h-d46-16.ic8", 0x000157, 0x64e1ff9f, BRF_OPT }, - { "palce20v8h-d46-17.ic10", 0x000157, 0x5c9d94e1, BRF_OPT }, - { "palce16v8h-d46-18.ic6", 0x000117, 0x7581b894, BRF_OPT }, - { "palce16v8h-d46-19.ic7", 0x000117, 0xa5d863d0, BRF_OPT }, - { "palce20v8h-d46-20.ic22", 0x000157, 0x838cbc11, BRF_OPT }, // Located on the sound board - { "palce20v8h-d46-21.ic23", 0x000157, 0x93c5aac2, BRF_OPT }, // Located on the sound board - { "palce20v8h-d46-22.ic24", 0x000157, 0xc6a10b06, BRF_OPT }, // Located on the sound board -}; - -STD_ROM_PICK(Superchsu) -STD_ROM_FN(Superchsu) - -static struct BurnRomInfo SuperchsjRomDesc[] = { - { "d46-28+.ic27", 0x040000, 0x5c33784f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, - { "d46-27+.ic25", 0x040000, 0xe81125b8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, - { "d46-26+.ic23", 0x040000, 0x2aaba1b0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, - { "d46-25+.ic21", 0x040000, 0x4241e97a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP32 }, - - { "d46-24.ic127", 0x020000, 0xa006baa1, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "d46-23.ic112", 0x020000, 0x9a69dbd0, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "d46-30.ic8", 0x020000, 0x88f8a421, BRF_ESS | BRF_PRG | TAITO_68KROM3_BYTESWAP }, - { "d46-29.ic7", 0x020000, 0x04501fa5, BRF_ESS | BRF_PRG | TAITO_68KROM3_BYTESWAP }, - - { "d46-05.ic87", 0x100000, 0x150d0e4c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d46-06.ic88", 0x100000, 0x321308be, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d46-04.ic67", 0x200000, 0x832769a9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d46-03.ic66", 0x200000, 0xe0e9cbfd, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d46-02.ic65", 0x200000, 0xa83ca82e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "d46-01.ic64", 0x200000, 0x5c2ae92d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "d46-07.ic34", 0x080000, 0xc3b8b093, BRF_GRA | TAITO_SPRITEMAP }, - - { "d46-10.ic2", 0x200000, 0x306256be, BRF_SND | TAITO_ES5505_BYTESWAP }, - { "d46-09.ic4", 0x200000, 0x0acb8bc7, BRF_SND | TAITO_ES5505_BYTESWAP }, - { "d46-08.ic5", 0x200000, 0x4677e820, BRF_SND | TAITO_ES5505_BYTESWAP }, - - { "eeprom-superchs.bin",0x000080, 0x230f0753, BRF_PRG | TAITO_DEFAULT_EEPROM }, - - { "pal16l8bcn-d46-13.ic82", 0x000104, 0x2f32e889, BRF_OPT }, - { "pal16l8bcn-d46-14.ic84", 0x000104, 0x5ac8b5f8, BRF_OPT }, - { "pal16l8bcn-d46-15.ic9", 0x000104, 0x38ea9f36, BRF_OPT }, - { "palce20v8h-d46-16.ic8", 0x000157, 0x64e1ff9f, BRF_OPT }, - { "palce20v8h-d46-17.ic10", 0x000157, 0x5c9d94e1, BRF_OPT }, - { "palce16v8h-d46-18.ic6", 0x000117, 0x7581b894, BRF_OPT }, - { "palce16v8h-d46-19.ic7", 0x000117, 0xa5d863d0, BRF_OPT }, - { "palce20v8h-d46-20.ic22", 0x000157, 0x838cbc11, BRF_OPT }, // Located on the sound board - { "palce20v8h-d46-21.ic23", 0x000157, 0x93c5aac2, BRF_OPT }, // Located on the sound board - { "palce20v8h-d46-22.ic24", 0x000157, 0xc6a10b06, BRF_OPT }, // Located on the sound board -}; - -STD_ROM_PICK(Superchsj) -STD_ROM_FN(Superchsj) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - Taito68KRom2 = Next; Next += Taito68KRom2Size; - TaitoF3SoundRom = Next; - Taito68KRom3 = Next; Next += Taito68KRom3Size; - TaitoSpriteMapRom = Next; Next += TaitoSpriteMapRomSize; - TaitoF3ES5506Rom = Next; - TaitoES5505Rom = Next; Next += TaitoES5505RomSize; - TaitoDefaultEEProm = Next; Next += TaitoDefaultEEPromSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x020000; - Taito68KRam2 = Next; Next += 0x010200; - TaitoSpriteRam = Next; Next += 0x002000; - TaitoPaletteRam = Next; Next += 0x008000; - TaitoSharedRam = Next; Next += 0x010000; - TaitoF3SoundRam = Next; Next += 0x010000; - TaitoF3SharedRam = Next; Next += 0x000800; - TaitoES5510DSPRam = Next; Next += 0x000200; - TaitoES5510GPR = (UINT32*)Next; Next += 0x0000c0 * sizeof(UINT32); - TaitoES5510DRAM = (UINT16*)Next; Next += 0x200000 * sizeof(UINT16); - - TaitoRamEnd = Next; - - TaitoChars = Next; Next += TaitoNumChar * TaitoCharWidth * TaitoCharHeight; - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - TaitoPalette = (UINT32*)Next; Next += 0x02000 * sizeof(UINT32); - SpriteList = (SpriteEntry*)Next; Next += 0x4000 * sizeof(SpriteEntry); - - TaitoMemEnd = Next; - - return 0; -} - -static INT32 SuperchsDoReset() -{ - TaitoDoReset(); - - SuperchsCoinWord = 0; - SuperchsCpuACtrl = 0; - SuperchsSteer = 0; - - BurnShiftReset(); - - TaitoF3SoundReset(); - - return 0; -} - -UINT8 __fastcall Superchs68K1ReadByte(UINT32 a) -{ - switch (a) { - case 0x300000: { - return 0xff; - } - - case 0x300001: { - return TaitoInput[2] | TaitoDip[0]; - } - - case 0x300002: { - return TaitoInput[1]; - } - - case 0x300003: { - return TaitoInput[0] | ((EEPROMRead() & 1) ? 0x80 : 0x00); - } - - case 0x300004: { - return SuperchsCoinWord; - } - - case 0x340000: { - SuperchsSteer = (0xff - (TaitoAnalogPort0 >> 4)) + 0x80; // Inverted. - - if (SuperchsSteer < 0x20) SuperchsSteer = 0x20; - if (SuperchsSteer > 0xe0) SuperchsSteer = 0xe0; - - return SuperchsSteer; - } - - case 0x340001: { - if (TaitoInputPort3[0]) return 0x00; - return 0xff; - } - - case 0x340002: { - return 0x7f; - } - - case 0x340003: { - return 0x7f; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0xff; -} - -void __fastcall Superchs68K1WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x300000: { - // watchdog write - return; - } - - case 0x300003: { - EEPROMWrite(d & 0x20, d & 0x10, (d & 0x40)>>6); - return; - } - - case 0x300005: - case 0x300006: { - // superchs_input_w - return; - } - - case 0x300004: { - SuperchsCoinWord = d; - return; - } - - case 0x340000: - case 0x340001: - case 0x340002: { - SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - return; - } - - case 0x340003: { - // irq ack? - return; - } - - case 0x380000: { - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Superchs68K1ReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Superchs68K1WriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x140000 && a <= 0x141fff) { - UINT16 *Ram = (UINT16*)TaitoSpriteRam; - INT32 Offset = (a & 0x1fff) >> 1; - - Ram[Offset] = d; - return; - } - - TC0480SCPCtrlWordWrite_Map(0x1b0000) - - if ((a & 0xfff000) == 0x17f000) return; // unknown writes (lots) - - switch (a) { - case 0x240002: { - SuperchsCpuACtrl = d; - if (!(SuperchsCpuACtrl & 0x200)) { - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - } - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT32 __fastcall Superchs68K1ReadLong(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read long => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Superchs68K1WriteLong(UINT32 a, UINT32 d) -{ - if (a >= 0x140000 && a <= 0x141fff) { - UINT16 *Ram = (UINT16*)TaitoSpriteRam; - INT32 Offset = (a & 0x1fff) >> 1; - - Ram[Offset + 0] = BURN_ENDIAN_SWAP_INT32(d) & 0xffff; - Ram[Offset + 1] = BURN_ENDIAN_SWAP_INT32(d) >> 16; - return; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write long => %06X, %08X\n"), a, d); - } - } -} - -UINT8 __fastcall Superchs68K2ReadByte(UINT32 a) -{ - if (a >= 0x800000 && a <= 0x80ffff) { - INT32 Offset = (a & 0xffff); - UINT32 *Ram = (UINT32*)TaitoSharedRam; - if ((Offset&1)==0) return (Ram[(Offset/2)^1]&0xffff0000)>>16; - return (Ram[(Offset/2)^1]&0x0000ffff); - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Superchs68K2WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Superchs68K2ReadWord(UINT32 a) -{ - if (a >= 0x800000 && a <= 0x80ffff) { - INT32 Offset = (a & 0xffff); - UINT32 *Ram = (UINT32*)TaitoSharedRam; - if ((Offset&1)==0) return (Ram[Offset/2]&0xffff0000)>>16; - return (Ram[Offset/2]&0x0000ffff); - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Superchs68K2WriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x800000 && a <= 0x80ffff) { - INT32 Offset = (a & 0xffff); - UINT32 *Ram = (UINT32*)TaitoSharedRam; - if ((Offset&1)==0) { - Ram[Offset/2]=(Ram[Offset/2]&0x00ffffff)|((d&0xff00)<<16); - Ram[Offset/2]=(Ram[Offset/2]&0xff00ffff)|((d&0x00ff)<<16); - } else { - Ram[Offset/2]=(Ram[Offset/2]&0xffff00ff)|((d&0xff00)<< 0); - Ram[Offset/2]=(Ram[Offset/2]&0xffffff00)|((d&0x00ff)<< 0); - } - return; - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write word => %06X, %04X\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[16] = { 4, 0, 20, 16, 12, 8, 28, 24, 36, 32, 52, 48, 44, 40, 60, 56 }; -static INT32 CharYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 SpritePlaneOffsets[4] = { 0, 8, 16, 24 }; -static INT32 SpriteXOffsets[16] = { 32, 33, 34, 35, 36, 37, 38, 39, 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 SpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; - -static const eeprom_interface superchs_eeprom_interface = -{ - 6, /* address bits */ - 16, /* data bits */ - "0110", /* read command */ - "0101", /* write command */ - "0111", /* erase command */ - "0100000000", /* unlock command */ - "0100110000", /* lock command */ - 0, - 0, -}; - -static INT32 SuperchsInit() -{ - INT32 nLen; - - GenericTilesInit(); - - TaitoCharModulo = 0x400; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 16; - TaitoCharHeight = 16; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x10000; - - TaitoES5505RomSize = 0x2000000; - - TaitoNum68Ks = 3; - TaitoNumES5505 = 1; - TaitoNumEEPROM = 1; - - nTaitoCyclesTotal[0] = 20000000 / 60; - nTaitoCyclesTotal[1] = (16000000+2000000) / 60; - nTaitoCyclesTotal[2] = 16000000 / 60; - - TaitoLoadRoms(0); - - TaitoES5505RomSize = 0x2000000; - - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0480SCPInit(TaitoNumChar, 0, 0x20, 8, -1, 0, 0); - - TaitoES5505RomSize = 0x2000000; - TaitoF3ES5506RomSize = TaitoES5505RomSize; - - memset(TaitoES5505Rom, 0, TaitoES5505RomSize); - BurnLoadRom(TaitoES5505Rom + 0xc00000 + 1, 15, 2); - BurnLoadRom(TaitoES5505Rom + 0x000000 + 1, 16, 2); - BurnLoadRom(TaitoES5505Rom + 0x400000 + 1, 16, 2); - BurnLoadRom(TaitoES5505Rom + 0x800000 + 1, 17, 2); - - SekInit(0, 0x68EC020); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x11ffff, MAP_RAM); - SekMapMemory(TC0480SCPRam , 0x180000, 0x18ffff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(TaitoF3SharedRam , 0x2c0000, 0x2c07ff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x280000, 0x287fff, MAP_RAM); - SekSetReadByteHandler(0, Superchs68K1ReadByte); - SekSetWriteByteHandler(0, Superchs68K1WriteByte); - SekSetReadWordHandler(0, Superchs68K1ReadWord); - SekSetWriteWordHandler(0, Superchs68K1WriteWord); - SekSetReadLongHandler(0, Superchs68K1ReadLong); - SekSetWriteLongHandler(0, Superchs68K1WriteLong); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(Taito68KRam2 + 0x10000 , 0xa00000, 0xa001ff, MAP_RAM); - SekSetReadByteHandler(0, Superchs68K2ReadByte); - SekSetWriteByteHandler(0, Superchs68K2WriteByte); - SekSetReadWordHandler(0, Superchs68K2ReadWord); - SekSetWriteWordHandler(0, Superchs68K2WriteWord); - SekClose(); - - TaitoF3SoundInit(2); - TaitoF3VolumeOffset = 0.40; - - EEPROMInit(&superchs_eeprom_interface); - if (!EEPROMAvailable()) EEPROMFill(TaitoDefaultEEProm, 0, 128); - - BurnShiftInitDefault(); - - SuperchsDoReset(); - - return 0; -} - -static int SuperchsExit() -{ - TaitoExit(); - TaitoF3SoundExit(); - BurnShiftExit(); - - SuperchsCoinWord = 0; - SuperchsCpuACtrl = 0; - SuperchsSteer = 0; - - return 0; -} - -inline static UINT32 CalcCol(UINT32 nColour) -{ - INT32 r, g, b; - - r = (BURN_ENDIAN_SWAP_INT32(nColour) & 0x000000ff) >> 0; - b = (BURN_ENDIAN_SWAP_INT32(nColour) & 0x00ff0000) >> 16; - g = (BURN_ENDIAN_SWAP_INT32(nColour) & 0xff000000) >> 24; - - return BurnHighCol(r, g, b, 0); -} - -static void SuperchsCalcPalette() -{ - INT32 i; - UINT32* ps; - UINT32* pd; - - for (i = 0, ps = (UINT32*)TaitoPaletteRam, pd = TaitoPalette; i < 0x2000; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void SuperchsMakeSpriteList(INT32 xOffset, INT32 yOffset) -{ - UINT32 *SpriteRam = (UINT32*)TaitoSpriteRam; - UINT16 *SpriteMap = (UINT16*)TaitoSpriteMapRom; - INT32 Offset, Data, TileNum, Colour, xFlip, yFlip; - INT32 x, y, Priority, DblSize, xCur, yCur; - INT32 SpritesFlipscreen = 0; - INT32 xZoom, yZoom, zx, zy; - INT32 SpriteChunk, MapOffset, Code, j, k, px, py; - INT32 Dimension, TotalChunks, BadChunks; - - struct SpriteEntry *SpritePtr = SpriteList; - - memset(SpriteList, 0, 0x4000 * sizeof(SpriteEntry)); - - for (Offset = ((0x2000 / 4) - 4); Offset >= 0; Offset -= 4) { - Data = BURN_ENDIAN_SWAP_INT32(SpriteRam[Offset + 0]); - xFlip = (Data & 0x00800000) >> 23; - xZoom = (Data & 0x007f0000) >> 16; - TileNum = (Data & 0x00007fff); - - Data = BURN_ENDIAN_SWAP_INT32(SpriteRam[Offset + 2]); - Priority = (Data & 0x000c0000) >> 18; - Colour = (Data & 0x0003fc00) >> 10; - x = (Data & 0x000003ff); - - Data = BURN_ENDIAN_SWAP_INT32(SpriteRam[Offset + 3]); - DblSize = (Data & 0x00040000) >> 18; - yFlip = (Data & 0x00020000) >> 17; - yZoom = (Data & 0x0001fc00) >> 10; - y = (Data & 0x000003ff); - - Colour |= 0x100; - - if (!TileNum) continue; - - yFlip = !yFlip; - xZoom += 1; - yZoom += 1; - - y += yOffset; - - if (x > 0x340) x -= 0x400; - if (y > 0x340) y -= 0x400; - - x -= xOffset; - - BadChunks = 0; - Dimension = ((DblSize * 2) + 2); - TotalChunks = ((DblSize * 3) + 1) << 2; - MapOffset = TileNum << 2; - - for (SpriteChunk = 0; SpriteChunk < TotalChunks; SpriteChunk++) { - j = SpriteChunk / Dimension; - k = SpriteChunk % Dimension; - - px = k; - py = j; - - if (xFlip) px = Dimension - 1 - k; - if (yFlip) py = Dimension - 1 - j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << (DblSize + 1))]); - - if (Code == 0xffff) { - BadChunks += 1; - continue; - } - - xCur = x + ((k * xZoom) / Dimension); - yCur = y + ((j * yZoom) / Dimension); - - zx = x + (((k + 1) * xZoom) / Dimension) - xCur; - zy = y + (((j + 1) * yZoom) / Dimension) - yCur; - - if (SpritesFlipscreen) { - xCur = 320 - xCur - zx; - yCur = 256 - yCur - zy; - xFlip = !xFlip; - yFlip = !yFlip; - } - - SpritePtr->Code = Code; - SpritePtr->Colour = Colour; - SpritePtr->xFlip = !xFlip; - SpritePtr->yFlip = yFlip; - SpritePtr->x = xCur; - SpritePtr->y = yCur; - SpritePtr->xZoom = zx << 12; - SpritePtr->yZoom = zy << 12; - SpritePtr->Priority = Priority; - - SpritePtr++; - } - } -} - -static void SuperchsRenderSpriteList(INT32 SpritePriorityLevel) -{ - for (INT32 i = 0; i < 0x4000; i++) { - if (SpriteList[i].Priority == SpritePriorityLevel) { - RenderZoomedTile(pTransDraw, TaitoSpritesA, SpriteList[i].Code % TaitoNumSpriteA, 0x10 * (SpriteList[i].Colour & 0x1ff), 0, SpriteList[i].x, SpriteList[i].y, SpriteList[i].xFlip, SpriteList[i].yFlip, TaitoSpriteAWidth, TaitoSpriteAHeight, SpriteList[i].xZoom, SpriteList[i].yZoom); - } - } -} - -static void SuperchsDraw() -{ - UINT8 Layer[4]; - UINT16 Priority = TC0480SCPGetBgPriority(); - - Layer[0] = (Priority & 0xf000) >> 12; - Layer[1] = (Priority & 0x0f00) >> 8; - Layer[2] = (Priority & 0x00f0) >> 4; - Layer[3] = (Priority & 0x000f) >> 0; - - SuperchsCalcPalette(); - BurnTransferClear(); - - SuperchsMakeSpriteList(48, -116 - 16); - - if (nBurnLayer & 1) TC0480SCPTilemapRender(Layer[0], 1, TaitoChars); - if (nBurnLayer & 2) TC0480SCPTilemapRender(Layer[1], 0, TaitoChars); - if (nSpriteEnable & 1) SuperchsRenderSpriteList(0); - if (nBurnLayer & 4) TC0480SCPTilemapRender(Layer[2], 0, TaitoChars); - if (nBurnLayer & 8) TC0480SCPTilemapRender(Layer[3], 0, TaitoChars); - if (nSpriteEnable & 2) SuperchsRenderSpriteList(1); - if (nSpriteEnable & 4) SuperchsRenderSpriteList(2); - TC0480SCPRenderCharLayer(); - if (nSpriteEnable & 8) SuperchsRenderSpriteList(3); - BurnTransferCopy(TaitoPalette); - BurnShiftRender(); -} - -static INT32 SuperchsFrame() -{ - INT32 nInterleave = 64; - - if (TaitoReset) SuperchsDoReset(); - - SuperchsMakeInputs(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = nTaitoCyclesDone[2] = 0; - - SekNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == (nInterleave - 3)) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - if (i == (nInterleave - 1)) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - - if (SuperchsCpuACtrl & 0x200) { - nCurrentCPU = 1; - SekOpen(1); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - TaitoF3CpuUpdate(nInterleave, i); - } - - TaitoF3SoundUpdate(pBurnSoundOut, nBurnSoundLen); - - if (pBurnDraw) SuperchsDraw(); - - return 0; -} - -static INT32 SuperchsScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029740; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd-TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - TaitoICScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - TaitoF3SoundScan(nAction, pnMin); - BurnShiftScan(nAction); - - SCAN_VAR(SuperchsCoinWord); - SCAN_VAR(SuperchsCpuACtrl); - SCAN_VAR(SuperchsSteer); - } - - return 0; -} - -struct BurnDriver BurnDrvSuperchs = { - "superchs", NULL, NULL, NULL, "1992", - "Super Chase - Criminal Termination (World)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_RACING, 0, - NULL, SuperchsRomInfo, SuperchsRomName, NULL, NULL, SuperchsInputInfo, NULL, - SuperchsInit, SuperchsExit, SuperchsFrame, NULL, SuperchsScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSuperchsu = { - "superchsu", "superchs", NULL, NULL, "1992", - "Super Chase - Criminal Termination (US)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_RACING, 0, - NULL, SuperchsuRomInfo, SuperchsuRomName, NULL, NULL, SuperchsInputInfo, NULL, - SuperchsInit, SuperchsExit, SuperchsFrame, NULL, SuperchsScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSuperchsj = { - "superchsj", "superchs", NULL, NULL, "1992", - "Super Chase - Criminal Termination (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_RACING, 0, - NULL, SuperchsjRomInfo, SuperchsjRomName, NULL, NULL, SuperchsInputInfo, NULL, - SuperchsInit, SuperchsExit, SuperchsFrame, NULL, SuperchsScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - diff --git a/jan/src/burn/drv/taito/d_supridr.cpp b/jan/src/burn/drv/taito/d_supridr.cpp deleted file mode 100644 index 554faf102..000000000 --- a/jan/src/burn/drv/taito/d_supridr.cpp +++ /dev/null @@ -1,661 +0,0 @@ -// FB Alpha Super Rider driver module -// Based on MAME driver by Aaron Giles -// -// Notes: Added a lowpass filter effect to get rid of the headache-inducing -// high pitched hissing noise. - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "lowpass2.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvColPROM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvBgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvFgRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static UINT8 tilemapflipx; -static UINT8 tilemapflipy; -static UINT8 nmi_enable; -static UINT8 soundlatch; -static UINT8 fgdisable; -static UINT8 fgscrolly; -static UINT8 bgscrolly; - -static INT32 watchdog; - -static class LowPass2 *LP1 = NULL, *LP2 = NULL; -#define SampleFreq 44100.0 -#define CutFreq 1000.0 -#define Q 0.4 -#define Gain 1.0 -#define CutFreq2 1000.0 -#define Q2 0.3 -#define Gain2 1.475 - -static struct BurnInputInfo DrvInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 2, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Service", BIT_DIGITAL, DrvJoy3 + 1, "service" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dips", BIT_DIPSWITCH, DrvDips + 0, "dip" }, -}; - -STDINPUTINFO(Drv) - -static struct BurnDIPInfo DrvDIPList[]= -{ - {0x0d, 0xff, 0xff, 0x11, NULL }, - - {0, 0xfe, 0, 8, "Coinage" }, - {0x0d, 0x01, 0x07, 0x00, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0x07, 0x01, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0x07, 0x02, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0x07, 0x03, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0x07, 0x04, "1 Coin 4 Credits" }, - {0x0d, 0x01, 0x07, 0x05, "1 Coin 5 Credits" }, - {0x0d, 0x01, 0x07, 0x06, "1 Coin 6 Credits" }, - {0x0d, 0x01, 0x07, 0x07, "1 Coin 7 Credits" }, - - {0 , 0xfe, 0 , 4 , "Timer Speed" }, - {0x0d, 0x01, 0x18, 0x18, "Slow" }, - {0x0d, 0x01, 0x18, 0x10, "Medium" }, - {0x0d, 0x01, 0x18, 0x08, "Fast" }, - {0x0d, 0x01, 0x18, 0x00, "Fastest" }, - - {0 , 0xfe, 0 , 2 , "Bonus" }, - {0x0d, 0x01, 0x20, 0x00, "200k" }, - {0x0d, 0x01, 0x20, 0x20, "400k" }, - - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x40, 0x00, "Upright" }, - {0x0d, 0x01, 0x40, 0x40, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Invulnerability?" }, - {0x0d, 0x01, 0x80, 0x00, "Off" }, - {0x0d, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Drv) - -static void __fastcall supridr_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xb000: - nmi_enable = data; - return; - - case 0xb002: - case 0xb003: - // coin_lockout = ~data & 0x01; - return; - - case 0xb006: - tilemapflipx = data & 1; - return; - - case 0xb007: - tilemapflipy = data & 1; - return; - - case 0xb800: - soundlatch = data; - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(0); - return; - - case 0xc801: - fgdisable = ~data & 0x01; - return; - - case 0xc802: - fgscrolly = data; - return; - - case 0xc804: - bgscrolly = data; - return; - } -} - -static UINT8 __fastcall supridr_main_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - return DrvInputs[tilemapflipx ? 1 : 0]; // p2 / p1 - - case 0xa800: - return DrvInputs[2]; // system - - case 0xb000: - return DrvDips[0]; - } - - return 0; -} - -static UINT8 __fastcall supridr_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - watchdog = 0; - return 0; - } - - return 0; -} - -static void __fastcall supridr_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return; - - case 0x8c: - case 0x8d: - case 0x8e: - case 0x8f: - AY8910Write((port & 2)/2, port & 1, data); - return; - } -} - -static UINT8 __fastcall supridr_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x8d: - case 0x8f: - return AY8910Read((port & 2)/2); - } - - return 0; -} - -static UINT8 ay8910_1_portA(UINT32) -{ - return soundlatch; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset(AllRam, 0, RamEnd - AllRam); - } - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - tilemapflipx = 0; - tilemapflipy = 0; - nmi_enable = 0; - soundlatch = 0; - watchdog = 0; - fgdisable = 0; - fgscrolly = 0; - bgscrolly = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x010000; - DrvZ80ROM1 = Next; Next += 0x011000; - - DrvGfxROM0 = Next; Next += 0x014000; - DrvGfxROM1 = Next; Next += 0x014000; - DrvGfxROM2 = Next; Next += 0x018000; - - DrvColPROM = Next; Next += 0x000060; - - DrvPalette = (UINT32*)Next; Next += 0x0060 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x010800; - DrvZ80RAM1 = Next; Next += 0x010400; - DrvBgRAM = Next; Next += 0x010400; - DrvSprRAM = Next; Next += 0x010400; - DrvFgRAM = Next; Next += 0x010800; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x60; i++) - { - INT32 bit0 = (DrvColPROM[i] >> 0) & 0x01; - INT32 bit1 = (DrvColPROM[i] >> 1) & 0x01; - INT32 bit2 = (DrvColPROM[i] >> 2) & 0x01; - INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 3) & 0x01; - bit1 = (DrvColPROM[i] >> 4) & 0x01; - bit2 = (DrvColPROM[i] >> 5) & 0x01; - INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - bit0 = (DrvColPROM[i] >> 6) & 0x01; - bit1 = (DrvColPROM[i] >> 7) & 0x01; - INT32 b = 0x4f * bit0 + 0xa8 * bit1; - - DrvPalette[i] = BurnHighCol(r,g,b,0); - } -} - -static void DrvGfxDecode() -{ - INT32 Plane0[4] = { 0x1000 * 8, 0x1000 * 8 + 4, 0 , 4 }; - INT32 XOffs0[8] = { STEP4(0,1), STEP4(8,1) }; - INT32 YOffs0[8] = { STEP8(0,16) }; - - INT32 Plane1[3] = { 0x1000 * 8 * 0, 0x1000 * 8 * 1, 0x1000 * 8 * 2 }; - INT32 XOffs1[16] = { STEP8(0,1), STEP8(8*8,1) }; - INT32 YOffs1[16] = { STEP8(0,8), STEP8(8*8*2,8) }; - - UINT8 *tmp = (UINT8 *)BurnMalloc(0x3000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, DrvGfxROM0, 0x2000); - - GfxDecode(0x0100, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x2000); - - GfxDecode(0x0100, 4, 8, 8, Plane0, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x3000); - - GfxDecode(0x0080, 3, 16, 16, Plane1, XOffs1, YOffs1, 0x100, tmp, DrvGfxROM2); - - BurnFree (tmp); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x1000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x2000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x3000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x4000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x5000, 5, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x6000, 6, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x7000, 7, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0xc000, 8, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0xd000, 9, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0xe000, 10, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x0000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x0000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x1000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x0000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x1000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x0000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x1000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x2000, 18, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x0000, 19, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0020, 20, 1)) return 1; - if (BurnLoadRom(DrvColPROM + 0x0040, 21, 1)) return 1; - - DrvGfxDecode(); - DrvPaletteInit(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvBgRAM, 0x8800, 0x8bff, MAP_RAM); - ZetMapMemory(DrvFgRAM, 0x9000, 0x97ff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x9800, 0x9bff, MAP_RAM); - ZetMapMemory(DrvZ80ROM0 + 0xc000, 0xc000, 0xefff, MAP_ROM); - ZetSetWriteHandler(supridr_main_write); - ZetSetReadHandler(supridr_main_read); - ZetSetInHandler(supridr_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x0fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x3800, 0x3bff, MAP_RAM); - ZetSetOutHandler(supridr_sound_write_port); - ZetSetInHandler(supridr_sound_read_port); - ZetClose(); - - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1536000, nBurnSoundRate, &ay8910_1_portA, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.05, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.05, BURN_SND_ROUTE_BOTH); - GenericTilesInit(); - - LP1 = new LowPass2(CutFreq, SampleFreq, Q, Gain, - CutFreq2, Q2, Gain2); - LP2 = new LowPass2(CutFreq, SampleFreq, Q, Gain, - CutFreq2, Q2, Gain2); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - BurnFree (AllMem); - - delete LP1; - delete LP2; - LP1 = NULL; - LP2 = NULL; - - return 0; -} - -static void draw_bg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - if (sx > 4*8 && sx < (nScreenWidth - 1*8)) // don't scroll the player's status lines - sy -= bgscrolly; - - if (sy < -7) sy += 256; - - sy -= 16; // offsets - - INT32 code = DrvBgRAM[offs]; - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, 0, 4, 0x00, DrvGfxROM0); - } -} - -static void draw_fg_layer() -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - if (sx >= 32 && sx < 248) sy -= fgscrolly; - if (sy < -7) sy += 256; - sy -= 16; // offset - INT32 code = DrvFgRAM[offs]; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, 0, 4, 0, 0x20, DrvGfxROM1); - } -} - -static void draw_sprites() -{ - UINT8 *spr = DrvSprRAM + 0x40; - - for (INT32 i = 0; i < 48; i++) - { - INT32 code = (spr[i*4+1] & 0x3f) | ((spr[i*4+2] >> 1) & 0x40); - INT32 color = spr[i*4+2] & 0x03; // iq_132... right? or 0x7f... - INT32 flipx = spr[i*4+1] & 0x40; - INT32 flipy = spr[i*4+1] & 0x80; - INT32 sx = spr[i*4+3]; - INT32 sy = (240 - spr[i*4+0]) - 16; - - if (tilemapflipx) - { - flipx = !flipx; - sx = 240 - sx; - } - if (tilemapflipy) - { - flipy = !flipy; - sy = 240 - sy; - } - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x40, DrvGfxROM2); - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - draw_bg_layer(); - if (fgdisable) draw_fg_layer(); - - draw_sprites(); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nCyclesTotal[2] = { 3072000 / 60, 2500000 / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nInterleave = 100; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - if (i == (nInterleave - 1) && nmi_enable) ZetNmi(); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - if (LP1 && LP2) { - LP1->Filter(pBurnSoundOut, nBurnSoundLen); // Left - LP2->Filter(pBurnSoundOut+1, nBurnSoundLen); // Right - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - - SCAN_VAR(tilemapflipx); - SCAN_VAR(tilemapflipy); - SCAN_VAR(soundlatch); - SCAN_VAR(nmi_enable); - SCAN_VAR(fgscrolly); - SCAN_VAR(bgscrolly); - SCAN_VAR(fgdisable); - } - - return 0; -} - - -// Super Rider - -static struct BurnRomInfo suprridrRomDesc[] = { - { "sr8", 0x1000, 0x4a1f0a6c, 0 | BRF_ESS | BRF_PRG }, // 0 Z80 #0 Code - { "sr7", 0x1000, 0x523ee717, 0 | BRF_ESS | BRF_PRG }, // 1 - { "sr4", 0x1000, 0x300370ae, 0 | BRF_ESS | BRF_PRG }, // 2 - { "sr5", 0x1000, 0xc5bca683, 0 | BRF_ESS | BRF_PRG }, // 3 - { "sr6", 0x1000, 0x563bab28, 0 | BRF_ESS | BRF_PRG }, // 4 - { "sr3", 0x1000, 0x4b9d2ec5, 0 | BRF_ESS | BRF_PRG }, // 5 - { "sr2", 0x1000, 0x6fe18e1d, 0 | BRF_ESS | BRF_PRG }, // 6 - { "sr1", 0x1000, 0xf2ae64b3, 0 | BRF_ESS | BRF_PRG }, // 7 - { "1", 0x1000, 0xcaf12fa2, 0 | BRF_ESS | BRF_PRG }, // 8 - { "2", 0x1000, 0x2b3c638e, 0 | BRF_ESS | BRF_PRG }, // 9 - { "3", 0x1000, 0x2abdb5f4, 0 | BRF_ESS | BRF_PRG }, // 10 - - { "sr9", 0x1000, 0x1c5dba78, 1 | BRF_ESS | BRF_PRG }, // 11 Z80 #1 Code - - { "sr10", 0x1000, 0xa57ac8d0, 2 | BRF_GRA }, // 12 Background Tiles - { "sr11", 0x1000, 0xaa7ec7b2, 2 | BRF_GRA }, // 13 - - { "sr15", 0x1000, 0x744f3405, 2 | BRF_GRA }, // 14 Foreground Tiles - { "sr16", 0x1000, 0x3e1a876b, 2 | BRF_GRA }, // 15 - - { "sr12", 0x1000, 0x81494fe8, 2 | BRF_GRA }, // 16 Sprite Tiles - { "sr13", 0x1000, 0x63e94648, 2 | BRF_GRA }, // 17 - { "sr14", 0x1000, 0x277a70af, 2 | BRF_GRA }, // 18 - - { "clr.1b", 0x0020, 0x87a79fe8, 2 | BRF_GRA }, // 19 Color PROMs - { "clr.9c", 0x0020, 0x10d63240, 2 | BRF_GRA }, // 20 - { "clr.8a", 0x0020, 0x917eabcd, 2 | BRF_GRA }, // 21 -}; - -STD_ROM_PICK(suprridr) -STD_ROM_FN(suprridr) - -struct BurnDriver BurnDrvSuprridr = { - "suprridr", NULL, NULL, NULL, "1983", - "Super Rider\0", NULL, "Taito Corporation (Venture Line license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_PREFIX_TAITO, GBF_MISC, 0, - NULL, suprridrRomInfo, suprridrRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x60, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/taito/d_taitob.cpp b/jan/src/burn/drv/taito/d_taitob.cpp deleted file mode 100644 index 855c91139..000000000 --- a/jan/src/burn/drv/taito/d_taitob.cpp +++ /dev/null @@ -1,4281 +0,0 @@ -// FB Alpha Taito B System driver module -// Based on MAME driver by Jarek Burczynski and various others - -// to do: -// fix rambo alt sets inputs -// master of weapon title screen is incorrect (only w/ffwd) - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "taito.h" -#include "taito_ic.h" -#include "burn_ym2610.h" -#include "msm6295.h" -#include "burn_ym2203.h" -#include "burn_gun.h" -#include "eeprom.h" - -static UINT8 *DrvPxlRAM = NULL; -static UINT16 *DrvPxlScroll = NULL; -static UINT8 *DrvFramebuffer = NULL; - -static INT32 eeprom_latch = 0; -static INT32 coin_control = 0; - -static UINT8 color_config[4]; -static INT32 irq_config[2]; -static INT32 sound_config = 0; -static INT32 game_config = 0; // for disable opposites -static INT32 cpu_speed[2]; -static UINT8 nTaitoInputConfig[5] = { 0, 0, 0, 0, 0 }; - -static INT32 LastScrollX = 0; // hitice - -static struct BurnInputInfo CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Common) - -static struct BurnInputInfo PbobbleInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TaitoInputPort3 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TaitoInputPort3 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TaitoInputPort3 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TaitoInputPort3 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TaitoInputPort3 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TaitoInputPort3 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TaitoInputPort3 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TaitoInputPort3 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 6, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 6, "p3 start" }, - {"P3 Up", BIT_DIGITAL, TaitoInputPort5 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, TaitoInputPort5 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, TaitoInputPort5 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, TaitoInputPort5 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, TaitoInputPort4 + 0, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, TaitoInputPort4 + 1, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, TaitoInputPort4 + 2, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 7, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 7, "p4 start" }, - {"P4 Up", BIT_DIGITAL, TaitoInputPort5 + 4, "p4 up" }, - {"P4 Down", BIT_DIGITAL, TaitoInputPort5 + 5, "p4 down" }, - {"P4 Left", BIT_DIGITAL, TaitoInputPort5 + 6, "p4 left" }, - {"P4 Right", BIT_DIGITAL, TaitoInputPort5 + 7, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, TaitoInputPort4 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, TaitoInputPort4 + 5, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, TaitoInputPort4 + 6, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "service" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "service" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, -}; - -STDINPUTINFO(Pbobble) - -static struct BurnInputInfo QzshowbyInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, TaitoInputPort3 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TaitoInputPort3 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, TaitoInputPort3 + 3, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, TaitoInputPort3 + 2, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, TaitoInputPort3 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TaitoInputPort3 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, TaitoInputPort3 + 7, "p2 fire 3" }, - {"P2 Button 4", BIT_DIGITAL, TaitoInputPort3 + 6, "p2 fire 4" }, - - {"P3 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 6, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 6, "p3 start" }, - {"P3 Button 1", BIT_DIGITAL, TaitoInputPort5 + 8, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, TaitoInputPort5 + 9, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, TaitoInputPort5 + 11, "p3 fire 3" }, - {"P3 Button 4", BIT_DIGITAL, TaitoInputPort5 + 10, "p3 fire 4" }, - - {"P4 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 7, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 7, "p4 start" }, - {"P4 Button 1", BIT_DIGITAL, TaitoInputPort5 + 12, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, TaitoInputPort5 + 13, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, TaitoInputPort5 + 15, "p4 fire 3" }, - {"P4 Button 4", BIT_DIGITAL, TaitoInputPort5 + 14, "p4 fire 4" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "service" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "service" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, -}; - -STDINPUTINFO(Qzshowby) - -static struct BurnInputInfo SpacedxoInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, TaitoInputPort5 + 0, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, TaitoInputPort3 + 0, "p3 start" }, - {"P3 Up", BIT_DIGITAL, TaitoInputPort3 + 3, "p3 up" }, - {"P3 Down", BIT_DIGITAL, TaitoInputPort3 + 4, "p3 down" }, - {"P3 Left", BIT_DIGITAL, TaitoInputPort3 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, TaitoInputPort3 + 2, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, TaitoInputPort3 + 5, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, TaitoInputPort3 + 6, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, TaitoInputPort3 + 7, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, TaitoInputPort5 + 2, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, TaitoInputPort4 + 0, "p4 start" }, - {"P4 Up", BIT_DIGITAL, TaitoInputPort4 + 3, "p4 up" }, - {"P4 Down", BIT_DIGITAL, TaitoInputPort4 + 4, "p4 down" }, - {"P4 Left", BIT_DIGITAL, TaitoInputPort4 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, TaitoInputPort4 + 2, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, TaitoInputPort4 + 5, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, TaitoInputPort4 + 6, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, TaitoInputPort4 + 7, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "service" }, - {"Service", BIT_DIGITAL, TaitoInputPort5 + 1, "service" }, - {"Service", BIT_DIGITAL, TaitoInputPort5 + 3, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Spacedxo) - -static struct BurnInputInfo SelfeenaInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset"}, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Selfeena) - -static struct BurnInputInfo SbmInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p1 fire 3" }, - {"P1 Button 4", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p1 fire 4" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort0 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort0 + 7, "p2 right" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Sbm) - -static struct BurnInputInfo SilentdInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p2 fire 3" }, - - {"P3 Coin", BIT_DIGITAL, TaitoInputPort5 + 0, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, TaitoInputPort3 + 0, "p3 start" }, - {"P3 Up", BIT_DIGITAL, TaitoInputPort3 + 3, "p3 up" }, - {"P3 Down", BIT_DIGITAL, TaitoInputPort3 + 4, "p3 down" }, - {"P3 Left", BIT_DIGITAL, TaitoInputPort3 + 1, "p3 left" }, - {"P3 Right", BIT_DIGITAL, TaitoInputPort3 + 2, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, TaitoInputPort3 + 5, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, TaitoInputPort3 + 6, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, TaitoInputPort3 + 7, "p3 fire 3" }, - - {"P4 Coin", BIT_DIGITAL, TaitoInputPort5 + 2, "p4 coin" }, - {"P4 Start", BIT_DIGITAL, TaitoInputPort4 + 0, "p4 start" }, - {"P4 Up", BIT_DIGITAL, TaitoInputPort4 + 3, "p4 up" }, - {"P4 Down", BIT_DIGITAL, TaitoInputPort4 + 4, "p4 down" }, - {"P4 Left", BIT_DIGITAL, TaitoInputPort4 + 1, "p4 left" }, - {"P4 Right", BIT_DIGITAL, TaitoInputPort4 + 2, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, TaitoInputPort4 + 5, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, TaitoInputPort4 + 6, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, TaitoInputPort4 + 7, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Silentd) - -static struct BurnInputInfo ViofightInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, TC0220IOCInputPort0 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset"}, - {"Service", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Viofight) - -static struct BurnInputInfo HiticeInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p2 fire 3" }, - - {"P3 Start", BIT_DIGITAL, TaitoInputPort3 + 7, "p3 start" }, - {"P3 Up", BIT_DIGITAL, TaitoInputPort3 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, TaitoInputPort3 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, TaitoInputPort3 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, TaitoInputPort3 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, TaitoInputPort3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, TaitoInputPort3 + 5, "p3 fire 2" }, - {"P3 Button 3", BIT_DIGITAL, TaitoInputPort3 + 6, "p3 fire 3" }, - - {"P4 Start", BIT_DIGITAL, TaitoInputPort4 + 7, "p4 start" }, - {"P4 Up", BIT_DIGITAL, TaitoInputPort4 + 0, "p4 up" }, - {"P4 Down", BIT_DIGITAL, TaitoInputPort4 + 1, "p4 down" }, - {"P4 Left", BIT_DIGITAL, TaitoInputPort4 + 2, "p4 left" }, - {"P4 Right", BIT_DIGITAL, TaitoInputPort4 + 3, "p4 right" }, - {"P4 Button 1", BIT_DIGITAL, TaitoInputPort4 + 4, "p4 fire 1" }, - {"P4 Button 2", BIT_DIGITAL, TaitoInputPort4 + 5, "p4 fire 2" }, - {"P4 Button 3", BIT_DIGITAL, TaitoInputPort4 + 6, "p4 fire 3" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Hitice) - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo Rambo3uInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "p1 fire 2" }, - - A("P1 Trackball X", BIT_ANALOG_REL, &TaitoAnalogPort0, "p1 x-axis" ), - A("P1 Trackball Y", BIT_ANALOG_REL, &TaitoAnalogPort1, "p1 y-axis" ), - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p2 fire 2" }, - - A("P2 Trackball X", BIT_ANALOG_REL, &TaitoAnalogPort2, "p2 x-axis" ), - A("P2 Trackball Y", BIT_ANALOG_REL, &TaitoAnalogPort3, "p2 y-axis" ), - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset"}, - {"Service", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Rambo3u) - -#undef A - -static struct BurnDIPInfo NastarDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "100k only" }, - {0x14, 0x01, 0x0c, 0x08, "150k only" }, - {0x14, 0x01, 0x0c, 0x04, "200k only" }, - {0x14, 0x01, 0x0c, 0x00, "250k only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x20, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Nastar) - -static struct BurnDIPInfo Rastsag2DIPList[]= -{ - {0x13, 0xff, 0xff, 0x3f, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "100k only" }, - {0x14, 0x01, 0x0c, 0x08, "150k only" }, - {0x14, 0x01, 0x0c, 0x04, "200k only" }, - {0x14, 0x01, 0x0c, 0x00, "250k only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x20, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Rastsag2) - -static struct BurnDIPInfo NastarwDIPList[]= -{ - {0x13, 0xff, 0xff, 0x3e, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "100k only" }, - {0x14, 0x01, 0x0c, 0x08, "150k only" }, - {0x14, 0x01, 0x0c, 0x04, "200k only" }, - {0x14, 0x01, 0x0c, 0x00, "250k only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x20, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Nastarw) - -static struct BurnDIPInfo AshuraDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "every 100k" }, - {0x14, 0x01, 0x0c, 0x0c, "every 150k" }, - {0x14, 0x01, 0x0c, 0x04, "every 200k" }, - {0x14, 0x01, 0x0c, 0x00, "every 250k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x00, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Ashura) - -static struct BurnDIPInfo AshurajDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "every 100k" }, - {0x14, 0x01, 0x0c, 0x0c, "every 150k" }, - {0x14, 0x01, 0x0c, 0x04, "every 200k" }, - {0x14, 0x01, 0x0c, 0x00, "every 250k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x00, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Ashuraj) - -static struct BurnDIPInfo AshurauDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Continue Price" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "Same as Start" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "every 100k" }, - {0x14, 0x01, 0x0c, 0x0c, "every 150k" }, - {0x14, 0x01, 0x0c, 0x04, "every 200k" }, - {0x14, 0x01, 0x0c, 0x00, "every 250k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x00, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Ashurau) - -static struct BurnDIPInfo CrimecDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Hi Score" }, - {0x13, 0x01, 0x01, 0x01, "Scribble" }, - {0x13, 0x01, 0x01, 0x00, "3 Characters" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "every 80k" }, - {0x14, 0x01, 0x0c, 0x0c, "80k only" }, - {0x14, 0x01, 0x0c, 0x04, "160k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x14, 0x01, 0xc0, 0x00, "Off" }, - {0x14, 0x01, 0xc0, 0x40, "5 Times" }, - {0x14, 0x01, 0xc0, 0x80, "8 Times" }, - {0x14, 0x01, 0xc0, 0xc0, "On" }, -}; - -STDDIPINFO(Crimec) - -static struct BurnDIPInfo CrimecjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Hi Score" }, - {0x13, 0x01, 0x01, 0x01, "Scribble" }, - {0x13, 0x01, 0x01, 0x00, "3 Characters" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "every 80k" }, - {0x14, 0x01, 0x0c, 0x0c, "80k only" }, - {0x14, 0x01, 0x0c, 0x04, "160k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x14, 0x01, 0xc0, 0x00, "Off" }, - {0x14, 0x01, 0xc0, 0x40, "5 Times" }, - {0x14, 0x01, 0xc0, 0x80, "8 Times" }, - {0x14, 0x01, 0xc0, 0xc0, "On" }, -}; - -STDDIPINFO(Crimecj) - -static struct BurnDIPInfo CrimecuDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Hi Score" }, - {0x13, 0x01, 0x01, 0x01, "Scribble" }, - {0x13, 0x01, 0x01, 0x00, "3 Characters" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Price to Continue" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "Same as Start" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "every 80k" }, - {0x14, 0x01, 0x0c, 0x0c, "80k only" }, - {0x14, 0x01, 0x0c, 0x04, "160k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Allow Continue" }, - {0x14, 0x01, 0xc0, 0x00, "Off" }, - {0x14, 0x01, 0xc0, 0x40, "5 Times" }, - {0x14, 0x01, 0xc0, 0x80, "8 Times" }, - {0x14, 0x01, 0xc0, 0xc0, "On" }, -}; - -STDDIPINFO(Crimecu) - -static struct BurnDIPInfo TetristDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, -}; - -STDDIPINFO(Tetrist) - -static struct BurnDIPInfo Rambo3DIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x10, 0x00, "Off" }, - {0x14, 0x01, 0x10, 0x10, "On" }, -}; - -STDDIPINFO(Rambo3) - -static struct BurnDIPInfo MasterwDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "500k, 1000k and 1500k"}, - {0x14, 0x01, 0x0c, 0x0c, "500k and 1000k" }, - {0x14, 0x01, 0x0c, 0x04, "500k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Ship Type" }, - {0x14, 0x01, 0x80, 0x80, "Space Ship" }, - {0x14, 0x01, 0x80, 0x00, "Hover Cycle" }, -}; - -STDDIPINFO(Masterw) - -static struct BurnDIPInfo PbobbleDIPList[]= -{ - {0x29, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x29, 0x01, 0x80, 0x80, "Off" }, - {0x29, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Pbobble) - -static struct BurnDIPInfo QzshowbyDIPList[]= -{ - {0x1d, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode " }, - {0x1d, 0x01, 0x80, 0x80, "Off" }, - {0x1d, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Qzshowby) - -static struct BurnDIPInfo SpacedxoDIPList[]= -{ - {0x29, 0xff, 0xff, 0xfe, NULL }, - {0x2a, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x29, 0x01, 0x01, 0x00, "Upright" }, - {0x29, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x29, 0x01, 0x02, 0x02, "Off" }, - {0x29, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x29, 0x01, 0x04, 0x04, "Off" }, - {0x29, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x29, 0x01, 0x08, 0x00, "Off" }, - {0x29, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x29, 0x01, 0x30, 0x00, "3 Coins 1 Credits" }, - {0x29, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x29, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x29, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x29, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x29, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x29, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x29, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x2a, 0x01, 0x03, 0x02, "Easy" }, - {0x2a, 0x01, 0x03, 0x03, "Medium" }, - {0x2a, 0x01, 0x03, 0x01, "Hard" }, - {0x2a, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Match Point" }, - {0x2a, 0x01, 0x0c, 0x08, "4" }, - {0x2a, 0x01, 0x0c, 0x0c, "3" }, - {0x2a, 0x01, 0x0c, 0x04, "5" }, - {0x2a, 0x01, 0x0c, 0x00, "2" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x2a, 0x01, 0x30, 0x30, "3" }, - {0x2a, 0x01, 0x30, 0x20, "4" }, - {0x2a, 0x01, 0x30, 0x10, "5" }, - {0x2a, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x2a, 0x01, 0x40, 0x40, "1500 Points" }, - {0x2a, 0x01, 0x40, 0x00, "1000 Points" }, - - {0 , 0xfe, 0 , 2, "Game Type" }, - {0x2a, 0x01, 0x80, 0x80, "Double Company" }, - {0x2a, 0x01, 0x80, 0x00, "Single Company" }, -}; - -STDDIPINFO(Spacedxo) - -static struct BurnDIPInfo SelfeenaDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x0c, "100k only" }, - {0x16, 0x01, 0x0c, 0x08, "200k only" }, - {0x16, 0x01, 0x0c, 0x04, "300k only" }, - {0x16, 0x01, 0x0c, 0x00, "400k only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x00, "1" }, - {0x16, 0x01, 0x30, 0x10, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x20, "4" }, -}; - -STDDIPINFO(Selfeena) - -static struct BurnDIPInfo RyujinDIPList[]= -{ - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x0c, 0x00, "1" }, - {0x16, 0x01, 0x0c, 0x04, "2" }, - {0x16, 0x01, 0x0c, 0x0c, "3" }, - {0x16, 0x01, 0x0c, 0x08, "4" }, -}; - -STDDIPINFO(Ryujin) - -static struct BurnDIPInfo SbmDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Sbm) - -static struct BurnDIPInfo SilentdDIPList[]= -{ - {0x27, 0xff, 0xff, 0xff, NULL }, - {0x28, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x27, 0x01, 0x02, 0x02, "Off" }, - {0x27, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x27, 0x01, 0x04, 0x04, "Off" }, - {0x27, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x27, 0x01, 0x08, 0x00, "Off" }, - {0x27, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x27, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x27, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x27, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x27, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x28, 0x01, 0x03, 0x02, "Easy" }, - {0x28, 0x01, 0x03, 0x03, "Medium" }, - {0x28, 0x01, 0x03, 0x01, "Hard" }, - {0x28, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x28, 0x01, 0x04, 0x04, "Off" }, - {0x28, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Power-Up Bonus" }, - {0x28, 0x01, 0x08, 0x08, "Off" }, - {0x28, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Regain Power" }, - {0x28, 0x01, 0x10, 0x10, "Off" }, - {0x28, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Credits" }, - {0x28, 0x01, 0x20, 0x20, "Combined" }, - {0x28, 0x01, 0x20, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 4, "Cabinet Style" }, - {0x28, 0x01, 0xc0, 0xc0, "3 Players" }, - {0x28, 0x01, 0xc0, 0x80, "2 Players" }, - {0x28, 0x01, 0xc0, 0x40, "4 Players/1 Machine" }, - {0x28, 0x01, 0xc0, 0x00, "4 Players/2 Machines" }, -}; - -STDDIPINFO(Silentd) - -static struct BurnDIPInfo SilentdjDIPList[]= -{ - {0x27, 0xff, 0xff, 0xff, NULL }, - {0x28, 0xff, 0xff, 0xbf, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x27, 0x01, 0x02, 0x02, "Off" }, - {0x27, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x27, 0x01, 0x04, 0x04, "Off" }, - {0x27, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x27, 0x01, 0x08, 0x00, "Off" }, - {0x27, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x27, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x27, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x27, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x27, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x27, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x27, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x27, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x27, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x28, 0x01, 0x03, 0x02, "Easy" }, - {0x28, 0x01, 0x03, 0x03, "Medium" }, - {0x28, 0x01, 0x03, 0x01, "Hard" }, - {0x28, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x28, 0x01, 0x04, 0x04, "Off" }, - {0x28, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Power-Up Bonus" }, - {0x28, 0x01, 0x08, 0x08, "Off" }, - {0x28, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Regain Power" }, - {0x28, 0x01, 0x10, 0x10, "Off" }, - {0x28, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Credits" }, - {0x28, 0x01, 0x20, 0x20, "Combined" }, - {0x28, 0x01, 0x20, 0x00, "Separate" }, - - {0 , 0xfe, 0 , 4, "Cabinet Style" }, - {0x28, 0x01, 0xc0, 0xc0, "3 Players" }, - {0x28, 0x01, 0xc0, 0x80, "2 Players" }, - {0x28, 0x01, 0xc0, 0x40, "4 Players/1 Machine" }, - {0x28, 0x01, 0xc0, 0x00, "4 Players/2 Machines" }, -}; - -STDDIPINFO(Silentdj) - -static struct BurnDIPInfo ViofightDIPList[]= -{ - {0x14, 0xff, 0xff, 0xff, NULL }, - {0x15, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x14, 0x01, 0x04, 0x04, "Off" }, - {0x14, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x14, 0x01, 0x08, 0x00, "Off" }, - {0x14, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x14, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x14, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x14, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x14, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x14, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x14, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x15, 0x01, 0x03, 0x02, "Easy" }, - {0x15, 0x01, 0x03, 0x03, "Medium" }, - {0x15, 0x01, 0x03, 0x01, "Hard" }, - {0x15, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Viofight) - -static struct BurnDIPInfo HiticeDIPList[]= -{ - {0x25, 0xff, 0xff, 0xff, NULL }, - {0x26, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet Style" }, - {0x25, 0x01, 0x01, 0x01, "4 Players" }, - {0x25, 0x01, 0x01, 0x00, "2 Players" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x25, 0x01, 0x04, 0x04, "Off" }, - {0x25, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x25, 0x01, 0x08, 0x00, "Off" }, - {0x25, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x25, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x25, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x25, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x25, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x25, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x25, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x25, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x25, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x26, 0x01, 0x03, 0x02, "Easy" }, - {0x26, 0x01, 0x03, 0x03, "Medium" }, - {0x26, 0x01, 0x03, 0x01, "Hard" }, - {0x26, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Timer count" }, - {0x26, 0x01, 0x0c, 0x0c, "1 sec = 58/60" }, - {0x26, 0x01, 0x0c, 0x04, "1 sec = 56/60" }, - {0x26, 0x01, 0x0c, 0x08, "1 sec = 62/60" }, - {0x26, 0x01, 0x0c, 0x00, "1 sec = 45/60" }, - - {0 , 0xfe, 0 , 2, "Maximum credits" }, - {0x26, 0x01, 0x80, 0x00, "99" }, - {0x26, 0x01, 0x80, 0x80, "9" }, -}; - -STDDIPINFO(Hitice) - -static struct BurnDIPInfo Rambo3uDIPList[]= -{ - {0x17, 0xff, 0xff, 0xff, NULL }, - {0x18, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x17, 0x01, 0x02, 0x02, "Off" }, - {0x17, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x17, 0x01, 0x04, 0x04, "Off" }, - {0x17, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x17, 0x01, 0x08, 0x00, "Off" }, - {0x17, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x17, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x17, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x17, 0x01, 0x30, 0x00, "4 Coins 3 Credits" }, - {0x17, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Price to Continue" }, - {0x17, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x17, 0x01, 0xc0, 0x80, "1 Coin 1 Credits" }, - {0x17, 0x01, 0xc0, 0xc0, "Same as Start" }, - {0x17, 0x01, 0xc0, 0x00, "Same as Start or 1C/1C (if Coinage 4C/3C)" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x18, 0x01, 0x03, 0x02, "Easy" }, - {0x18, 0x01, 0x03, 0x03, "Medium" }, - {0x18, 0x01, 0x03, 0x01, "Hard" }, - {0x18, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 1, "Control" }, - {0x18, 0x01, 0x08, 0x08, "8 way Joystick" }, -// {0x18, 0x01, 0x08, 0x00, "Trackball" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x18, 0x01, 0x10, 0x00, "Off" }, - {0x18, 0x01, 0x10, 0x10, "On" }, -}; - -STDDIPINFO(Rambo3u) - -static const eeprom_interface taitob_eeprom_intf = -{ - 6, // address bits - 16, // data bits - "0110", // read command - "0101", // write command - "0111", // erase command - "0100000000", // lock command - "0100110000", // unlock command - 0, - 0 -}; - -static void bankswitch(UINT32, UINT32 data) -{ - if (ZetGetActive() == -1) return; // let's not crash - - TaitoZ80Bank = data & 0x03; - - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + TaitoZ80Bank * 0x4000); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + TaitoZ80Bank * 0x4000); -} - -static void __fastcall taitob_sound_write_ym2610(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - BurnYM2610Write(a & 3, d); - return; - - case 0xe200: - TC0140SYTSlavePortWrite(d); - return; - - case 0xe201: - TC0140SYTSlaveCommWrite(d); - return; - - case 0xf200: - bankswitch(0, d); - return; - } -} - -static UINT8 __fastcall taitob_sound_read_ym2610(UINT16 a) -{ - switch (a) - { - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - return BurnYM2610Read(a & 3); - - case 0xe201: - return TC0140SYTSlaveCommRead(); - } - - return 0; -} - -static void __fastcall taitob_sound_write_ym2203(UINT16 a, UINT8 d) -{ - switch (a) - { - case 0x9000: - case 0x9001: - BurnYM2203Write(0, a & 1, d); - return; - - case 0xb000: - case 0xb001: - MSM6295Command(0, d); - return; - - case 0xa000: - TC0140SYTSlavePortWrite(d); - return; - - case 0xa001: - TC0140SYTSlaveCommWrite(d); - return; - } -} - -static UINT8 __fastcall taitob_sound_read_ym2203(UINT16 a) -{ - switch (a) - { - case 0x9000: - case 0x9001: - return BurnYM2203Read(0, a & 1); - - case 0xb000: - case 0xb001: - return MSM6295ReadStatus(0); - - case 0xa001: - return TC0140SYTSlaveCommRead(); - } - - return 0; -} - -static inline void DrvClearOppositesCommon(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x00) { - *nJoystickInputs |= 0x03; - } - if ((*nJoystickInputs & 0x0c) == 0x00) { - *nJoystickInputs |= 0x0c; - } -} - -static void DrvMakeInputs() -{ - memset (TC0220IOCInput, 0xff, 3); - memset (TaitoInput + 3, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - TC0220IOCInput[0] ^= (TC0220IOCInputPort0[i] & 1) << i; - TC0220IOCInput[1] ^= (TC0220IOCInputPort1[i] & 1) << i; - TC0220IOCInput[2] ^= (TC0220IOCInputPort2[i] & 1) << i; - TaitoInput[3] ^= (TaitoInputPort3[i] & 1) << i; - TaitoInput[4] ^= (TaitoInputPort4[i] & 1) << i; - TaitoInput[5] ^= (TaitoInputPort5[i] & 1) << i; - } - - // normal coin state is active low, but some games have - // active high buttons or coin inputs - TC0220IOCInput[0] ^= nTaitoInputConfig[0]; - TC0220IOCInput[1] ^= nTaitoInputConfig[1]; - TC0220IOCInput[2] ^= nTaitoInputConfig[2]; - TaitoInput[3] ^= nTaitoInputConfig[3]; - - if (game_config == 1) { - // Clear Opposites - DrvClearOppositesCommon(&TC0220IOCInput[0]); - DrvClearOppositesCommon(&TC0220IOCInput[1]); - } - - // set up coin lockout - switch (nTaitoInputConfig[4]) { - case 0: // viofight, sbm, common - if (TaitoCoinLockout[0]) TC0220IOCInput[2] |= (1 << 2); - if (TaitoCoinLockout[1]) TC0220IOCInput[2] |= (1 << 3); - break; - - case 1: // rambo3a, hitice, selfeena - if (TaitoCoinLockout[0]) TC0220IOCInput[1] |= (1 << 4); - if (TaitoCoinLockout[1]) TC0220IOCInput[1] |= (1 << 5); - break; - - case 2: // silentd, spacedxo - if (TaitoCoinLockout[0]) TC0220IOCInput[1] |= (1 << 4); - if (TaitoCoinLockout[1]) TC0220IOCInput[1] |= (1 << 5); - if (TaitoCoinLockout[2]) TaitoInput[5] |= (1 << 0); - if (TaitoCoinLockout[3]) TaitoInput[5] |= (1 << 2); - break; - - case 3: // qzshowby, pbobble - if (TaitoCoinLockout[0]) TC0220IOCInput[0] |= (1 << 4); - if (TaitoCoinLockout[1]) TC0220IOCInput[0] |= (1 << 5); - if (TaitoCoinLockout[2]) TC0220IOCInput[0] |= (1 << 6); - if (TaitoCoinLockout[3]) TC0220IOCInput[0] |= (1 << 7); - break; - } - - // for rambo3a's trackball - if (nBurnGunNumPlayers) BurnGunMakeInputs(0, (INT16)TaitoAnalogPort0, (INT16)TaitoAnalogPort1); - if (nBurnGunNumPlayers) BurnGunMakeInputs(1, (INT16)TaitoAnalogPort2, (INT16)TaitoAnalogPort3); -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / cpu_speed[1]; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / (cpu_speed[1] * 1.0); -} - -static INT32 DrvDoReset(INT32 reset_ram) -{ - if (reset_ram) { - memset (TaitoRamStart, 0, TaitoRamEnd - TaitoRamStart); - } - - if (DrvFramebuffer) { - memset (DrvFramebuffer, 0, 1024 * 512); - } - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - if (sound_config == 0) { - BurnYM2610Reset(); - } else { - ZetOpen(0); - BurnYM2203Reset(); - ZetClose(); - MSM6295Reset(0); - } - - TaitoICReset(); - - EEPROMReset(); - - coin_control = 0; - eeprom_latch = 0; - TaitoZ80Bank = 0; - LastScrollX = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += ((Taito68KRom1Size - 1) | 0x7ffff) + 1; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - - TaitoChars = Next; Next += (TaitoCharRomSize * 8) / 4; - TaitoSpritesA = Next; Next += (TaitoCharRomSize * 8) / 4; - - TaitoMSM6295Rom = Next; Next += TaitoMSM6295RomSize; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - TaitoYM2610BRom = Next; Next += TaitoYM2610BRomSize; - - if (!(TaitoMSM6295RomSize | TaitoYM2610ARomSize | TaitoYM2610ARomSize)) { - Next += 0x040000; // games without samples... - } - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x010000; - TaitoPaletteRam = Next; Next += 0x002000; - TaitoSpriteRam = Next; Next += 0x002000; - - // hit the ice - DrvPxlRAM = Next; Next += 0x080000; - DrvPxlScroll = (UINT16*)Next; Next += 2 * sizeof(UINT16); - - TaitoZ80Ram1 = Next; Next += 0x002000; - - TaitoRamEnd = Next; - - TaitoPalette = (UINT32*)Next; Next += 0x1000 * sizeof(UINT32); - - TaitoMemEnd = Next; - - return 0; -} - -static void DrvGfxDecode(INT32 len, INT32 *tilemask0, INT32 *tilemask1) -{ - if (len == 0) return; // tetrist - - INT32 Planes[4] = { 0, 8, (len * 8) / 2 + 0, (len * 8) / 2 + 8 }; - INT32 XOffs[16] = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, 0x080, 0x081, 0x082, 0x083, 0x084, 0x085, 0x086, 0x087 }; - INT32 YOffs[16] = { 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x100, 0x110, 0x120, 0x130, 0x140, 0x150, 0x160, 0x170 }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return; - } - - memcpy (tmp, TaitoChars, len); - - GfxDecode(((len * 8) / 4) / ( 8 * 8), 4, 8, 8, Planes, XOffs, YOffs, 0x080, tmp, TaitoChars); - GfxDecode(((len * 8) / 4) / (16 * 16), 4, 16, 16, Planes, XOffs, YOffs, 0x200, tmp, TaitoSpritesA); - - *tilemask0 = (((len * 8) / 4) / ( 8 * 8)) - 1; - *tilemask1 = (((len * 8) / 4) / (16 * 16)) - 1; - - BurnFree (tmp); -} - -static void common_ym2610_init() -{ - sound_config = 0; - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1); - ZetSetWriteHandler(taitob_sound_write_ym2610); - ZetSetReadHandler(taitob_sound_read_ym2610); - ZetClose(); - - TC0140SYTInit(0); - - INT32 len0 = TaitoYM2610ARomSize; - INT32 len1 = TaitoYM2610BRomSize; - - BurnYM2610Init(8000000, TaitoYM2610ARom, &len0, TaitoYM2610BRom, &len1, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(cpu_speed[1]); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); -} - -static void common_ym2203_init() -{ - sound_config = 1; - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1); - ZetSetWriteHandler(taitob_sound_write_ym2203); - ZetSetReadHandler(taitob_sound_read_ym2203); - ZetClose(); - - TC0140SYTInit(0); - - BurnYM2203Init(1, 3000000, DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, NULL, NULL, &bankswitch, NULL); - BurnTimerAttachZet(cpu_speed[1]); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.25, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.25, BURN_SND_ROUTE_BOTH); - - MSM6295ROM = TaitoMSM6295Rom; - - MSM6295Init(0, 1056000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); -} - -static INT32 CommonInit(void (*pInitCallback)(), INT32 sound_type, INT32 color_select, INT32 input_type, INT32 irq0, INT32 irq1) -{ - static const UINT8 color_types[3][4] = { - { 0xc0, 0x80, 0x00, 0x40 }, - { 0x00, 0x40, 0xc0, 0x80 }, - { 0x30, 0x20, 0x00, 0x10 } - }; - - TaitoLoadRoms(false); - - TaitoMem = NULL; - MemIndex(); - INT32 nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(true)) return 1; - - INT32 tilemaskChars = 0, tilemaskSprites = 0; - DrvGfxDecode(TaitoCharRomSize, &tilemaskChars, &tilemaskSprites); - - memcpy (color_config, color_types[color_select], 4); - - irq_config[0] = irq0; - irq_config[1] = irq1; - - cpu_speed[0] = 12000000; - cpu_speed[1] = 4000000; - - nTaitoInputConfig[4] = input_type; - - TC0220IOCInit(); - TaitoMakeInputsFunction = DrvMakeInputs; - - TC0180VCUInit(TaitoChars, tilemaskChars, TaitoSpritesA, tilemaskSprites, 0, 16); - - EEPROMInit(&taitob_eeprom_intf); - EEPROMIgnoreErrMessage(1); - - if (pInitCallback) { - pInitCallback(); - } - - if (sound_type) { - common_ym2203_init(); - } else { - common_ym2610_init(); - } - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - EEPROMExit(); - - SekExit(); - ZetExit(); - - if (sound_config == 0) { - BurnYM2610Exit(); - } else { - BurnYM2203Exit(); - MSM6295Exit(0); - MSM6295ROM = NULL; - } - - if (DrvFramebuffer) { - BurnFree (DrvFramebuffer); - DrvFramebuffer = NULL; - } - - memset (nTaitoInputConfig, 0, 5); - - TaitoExit(); - - game_config = 0; - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT16 *p = (UINT16*)TaitoPaletteRam; - - for (INT32 i = 0; i < 0x2000 / 2; i++) - { - INT32 r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 12) & 0x0f; - INT32 g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 8) & 0x0f; - INT32 b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 4) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - TaitoPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void draw_hitice_framebuffer() -{ - if (DrvFramebuffer == NULL) return; - - INT32 scrollx = -((2 * DrvPxlScroll[0] + 0) & 0x3ff); - INT32 scrolly = -((1 * DrvPxlScroll[1] + 16) & 0x1ff); - - for (INT32 sy = 0; sy < nScreenHeight-17; sy++) - { - UINT16 *dst = pTransDraw + (sy + 17) * nScreenWidth; - UINT8 *src = DrvFramebuffer + ((sy - scrolly) & 0x1ff) * 1024; - - for (INT32 sx = 0; sx < nScreenWidth; sx++) { - INT32 pxl = src[(sx - scrollx) & 0x3ff]; - - if (pxl) { - dst[sx] = pxl | 0x800; - } - } - } -} - -static INT32 DrvDraw() -{ - DrvPaletteUpdate(); - - INT32 ctrl = TC0180VCUReadControl(); - - if (~ctrl & 0x20) { - BurnTransferClear(); - BurnTransferCopy(TaitoPalette); - return 0; - } - - if (~nBurnLayer & 1) BurnTransferClear(); - - if (nBurnLayer & 1) TC0180VCUDrawLayer(color_config[0], 1, -1); - - if (nSpriteEnable & 1) TC0180VCUFramebufferDraw(1, color_config[3] << 4); - - if (nBurnLayer & 2) TC0180VCUDrawLayer(color_config[1], 0, 0); - - draw_hitice_framebuffer(); - - if (nSpriteEnable & 2) TC0180VCUFramebufferDraw(0, color_config[3] << 4); - - if (nBurnLayer & 4) TC0180VCUDrawCharLayer(color_config[2]); - - BurnTransferCopy(TaitoPalette); - - TC0180VCUBufferSprites(); - - return 0; -} - -static INT32 DrvFrame() -{ - if (TaitoReset) { - DrvDoReset(1); - } - - SekNewFrame(); - ZetNewFrame(); - - TaitoWatchdog++; - if (TaitoWatchdog > 180) { - DrvDoReset(0); -// bprintf (0, _T("watchdog triggered!\n")); - } - - TaitoMakeInputsFunction(); - - SekOpen(0); - ZetOpen(0); - - INT32 SekSpeed = (INT32)((INT64)cpu_speed[0] * nBurnCPUSpeedAdjust / 0x100); - INT32 ZetSpeed = (INT32)((INT64)cpu_speed[1] * nBurnCPUSpeedAdjust / 0x100); - - INT32 nInterleave = 200; // high so that ym2203 sounds are good, 200 is perfect for irq #0 - INT32 nCyclesTotal[2] = { SekSpeed / 60, ZetSpeed / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nNext[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - nNext[0] += nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nNext[0] - nCyclesDone[0]); - if (i == 4) SekSetIRQLine(irq_config[0], CPU_IRQSTATUS_AUTO); // Start of frame + 5000 cycles - if (i == (nInterleave / 1) - 1) SekSetIRQLine(irq_config[1], CPU_IRQSTATUS_AUTO); // End of frame - nNext[1] += nCyclesTotal[1] / nInterleave; - BurnTimerUpdate(nNext[1]); - nCyclesDone[1] += nNext[1]; - } - - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - if (sound_config == 0) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } else { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static void hiticeFramebufferStateload(); // several pages below... - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029708; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd - TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - TaitoICScan(nAction); - - if (sound_config == 0) { - BurnYM2610Scan(nAction, pnMin); - } else { - ZetOpen(0); // because of bankswitch() port callback. - BurnYM2203Scan(nAction, pnMin); - ZetClose(); - MSM6295Scan(0, nAction); - } - - SCAN_VAR(TaitoZ80Bank); - SCAN_VAR(TaitoWatchdog); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(0, TaitoZ80Bank); - ZetClose(); - - if (DrvFramebuffer) { - hiticeFramebufferStateload(); - } - } - - return 0; -} - - -//---------------------------------------------------------------------------------------------------------- -// Rastan Saga 2 / Ashura Blaster - -static UINT8 __fastcall rastsag2_read_byte(UINT32 a) -{ - TC0180VCUHalfWordRead_Map(0x400000) - TC0220IOCHalfWordRead_Map(0xa00000) - - switch (a) - { - case 0x800002: - return TC0140SYTCommRead(); - } - - return 0; -} - -static void __fastcall rastsag2_write_byte(UINT32 a, UINT8 d) -{ - TC0180VCUHalfWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0xa00000) - - switch (a) - { - case 0x800000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x800002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall rastsag2_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x400000) -} - -static void NastarInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(TaitoPaletteRam, 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0180VCURAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x410000, 0x4137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x413800, 0x413fff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x600000, 0x607fff, MAP_RAM); - SekSetWriteByteHandler(0, rastsag2_write_byte); - SekSetWriteWordHandler(0, rastsag2_write_word); - SekSetReadByteHandler(0, rastsag2_read_byte); -// SekSetReadWordHandler(0, rastsag2_read_word); - SekClose(); -} - -//---------------------------------------------------------------------------------------------------------- -// Crime City - -static UINT8 __fastcall crimec_read_byte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x200000) - TC0180VCUHalfWordRead_Map(0x400000) - - switch (a) - { - case 0x600002: - return TC0140SYTCommRead(); - } - - return 0; -} - -static void __fastcall crimec_write_byte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x200000) - TC0180VCUHalfWordWrite_Map(0x400000) - - switch (a) - { - case 0x600000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x600002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall crimec_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x400000) -} - -static void CrimecInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(TC0180VCURAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x410000, 0x4137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x413800, 0x413fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0x800000, 0x801fff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0xa00000, 0xa0ffff, MAP_RAM); - SekSetWriteByteHandler(0, crimec_write_byte); - SekSetWriteWordHandler(0, crimec_write_word); - SekSetReadByteHandler(0, crimec_read_byte); -// SekSetReadWordHandler(0, crimec_read_word); - SekClose(); -} - -//---------------------------------------------------------------------------------------------------------- -// Tetris (ym2610) - -static UINT8 __fastcall tetrist_read_byte(UINT32 a) -{ - TC0180VCUHalfWordRead_Map(0x400000) - TC0220IOCHalfWordRead_Map(0x600000) - - switch (a) - { - case 0x200002: // not used? - return TC0140SYTCommRead(); - - case 0x600010: { // tracky1_lo_r - INT32 ret = (( TaitoAnalogPort1 >> 4) & 0xffff); - if (ret == 0xffff) return 0; - return (ret+1); - } - - case 0x600014: {// trackx1_lo_r - INT32 ret = ((~TaitoAnalogPort0 >> 4) & 0xffff); - if (ret == 0xffff) return 0; - return (ret+1); - } - - case 0x600018: {// tracky2_lo_r - INT32 ret = (( TaitoAnalogPort3 >> 4) & 0xffff); - if (ret == 0xffff) return 0; - return (ret+1); - } - - case 0x60001c: {// trackx2_lo_r - INT32 ret = ((~TaitoAnalogPort2 >> 4) & 0xffff); - if (ret == 0xffff) return 0; - return (ret+1); - } - } - - return 0; -} - -static UINT16 __fastcall tetrist_read_word(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x600000) - - switch (a) - { - case 0x600012: {// tracky1_hi_r - INT32 ret = (( TaitoAnalogPort1 >> 4) & 0xffff); - if (ret == 0xffff) return 0; - return (ret+1); - } - - case 0x600016: {// trackx1_hi_r - INT32 ret = ((~TaitoAnalogPort0 >> 4) & 0xffff); - if (ret == 0xffff) return 0; - return (ret+1); - } - - case 0x60001a: {// tracky2_hi_r - INT32 ret = (( TaitoAnalogPort3 >> 4) & 0xffff); - if (ret == 0xffff) return 0; - return (ret+1); - } - - case 0x60001e: {// trackx2_hi_r - INT32 ret = ((~TaitoAnalogPort2 >> 4) & 0xffff); - if (ret == 0xffff) return 0; - return (ret+1); - } - } - - return 0; -} - -static void __fastcall tetrist_write_byte(UINT32 a, UINT8 d) -{ - TC0180VCUHalfWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x600000) - - switch (a) - { - case 0x200000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x200002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall tetrist_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x600000) -} - -static void TetristInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(TC0180VCURAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x410000, 0x4137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x413800, 0x413fff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x800000, 0x807fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0xa00000, 0xa01fff, MAP_RAM); - SekSetWriteByteHandler(0, tetrist_write_byte); - SekSetWriteWordHandler(0, tetrist_write_word); - SekSetReadByteHandler(0, tetrist_read_byte); - SekSetReadWordHandler(0, tetrist_read_word); - SekClose(); -} - -//---------------------------------------------------------------------------------------------------------- -// Puzzle Bobble / Space Invaders Dx (v2.1) - -static UINT8 __fastcall pbobble_read_byte(UINT32 a) -{ - TC0180VCUHalfWordRead_Map(0x400000) - - switch (a) - { - case 0x500000: - return TC0220IOCDip[0]; - - case 0x500002: - return ((TC0220IOCInput[0] & 0xfe) | (EEPROMRead() & 1)); - - case 0x500004: - return TC0220IOCInput[1]; - - case 0x500006: - return TC0220IOCInput[2]; - - case 0x500008: - return TC0220IOCRead(0x08 / 2); - - case 0x50000e: - return TaitoInput[3]; - - case 0x500024: - return TaitoInput[4]; - - case 0x500026: - return eeprom_latch; - - case 0x50002e: - return TaitoInput[5]; - - case 0x700002: - return TC0140SYTCommRead(); - } - - return 0; -} - -static void __fastcall pbobble_write_byte(UINT32 a, UINT8 d) -{ - TC0180VCUHalfWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x500000) - - switch (a) - { - case 0x500026: - eeprom_latch = d; - EEPROMWrite((d & 0x08), (d & 0x10), (d & 0x04)); - return; - - case 0x500028: - coin_control = d; - TaitoCoinLockout[2] = ~d & 0x01; - TaitoCoinLockout[3] = ~d & 0x02; - // coin counter d & 0x04, d & 0x08 - return; - - case 0x600000: - case 0x600002: // gain - return; - - case 0x700000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x700002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall pbobble_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x500000) -} - -static void PbobbleInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(TC0180VCURAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x410000, 0x4137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x413800, 0x413fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0x800000, 0x801fff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x900000, 0x90ffff, MAP_RAM); - SekSetWriteByteHandler(0, pbobble_write_byte); - SekSetWriteWordHandler(0, pbobble_write_word); - SekSetReadByteHandler(0, pbobble_read_byte); -// SekSetReadWordHandler(0, pbobble_read_word); - SekClose(); -} - -//---------------------------------------------------------------------------------------------------------- -// Sel Feena / Ryu Jin - -static UINT8 __fastcall selfeena_read_byte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x400000) - TC0220IOCHalfWordRead_Map(0x410000) - - if (a >= 0x218000 && a <= 0x21801f) { - return TC0180VCUReadRegs(a); - } - - switch (a) - { - case 0x500002: // not used? - return TC0140SYTCommRead(); - } - - return 0; -} - -static void __fastcall selfeena_write_byte(UINT32 a, UINT8 d) -{ - TC0180VCUHalfWordWrite_Map(0x200000) - TC0220IOCHalfWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x410000) - - switch (a) - { - case 0x500000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x500002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall selfeena_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x200000) -} - -static void SelfeenaInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TC0180VCURAM, 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x210000, 0x2137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x213800, 0x213fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0x300000, 0x301fff, MAP_RAM); - SekSetWriteByteHandler(0, selfeena_write_byte); - SekSetWriteWordHandler(0, selfeena_write_word); - SekSetReadByteHandler(0, selfeena_read_byte); -// SekSetReadWordHandler(0, selfeena_read_word); - SekClose(); -} - -//---------------------------------------------------------------------------------------------------------- -// Sonic Blast Man - -static UINT8 __fastcall sbm_read_byte(UINT32 a) -{ - if ((a & 0xffffff0) == 0x300000) a ^= 2; - TC0220IOCHalfWordRead_Map(0x300000) - TC0180VCUHalfWordRead_Map(0x900000) - - switch (a) - { - case 0x320002: - return TC0140SYTCommRead(); - } - - return 0; -} - -static void __fastcall sbm_write_byte(UINT32 a, UINT8 d) -{ - if ((a & 0xffffff0) == 0x300000) a ^= 2; - TC0220IOCHalfWordWrite_Map(0x300000) - TC0180VCUHalfWordWrite_Map(0x900000) - - switch (a) - { - case 0x320000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x320002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall sbm_write_word(UINT32 a, UINT16 d) -{ - if ((a & 0xffffff0) == 0x0300000) a ^= 2; - TC0220IOCHalfWordWrite_Map(0x300000) - TC0180VCUWordWrite_Map(0x900000) -} - -static void SbmInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0180VCURAM, 0x900000, 0x90ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x910000, 0x9137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x913800, 0x913fff, MAP_RAM); - SekSetWriteByteHandler(0, sbm_write_byte); - SekSetWriteWordHandler(0, sbm_write_word); - SekSetReadByteHandler(0, sbm_read_byte); -// SekSetReadWordHandler(0, sbm_read_word); - SekClose(); -} - -//---------------------------------------------------------------------------------------------------------- -// Silent Dragon - -static UINT8 __fastcall silentd_read_byte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x200000) - TC0180VCUHalfWordRead_Map(0x500000) - - switch (a) - { - case 0x100003: // not used? - return TC0140SYTCommRead(); - - case 0x210001: - return TaitoInput[3]; - - case 0x220001: - return TaitoInput[4]; - - case 0x230001: - return TaitoInput[5]; - } - - return 0; -} - -static void __fastcall silentd_write_byte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x200000) - TC0180VCUHalfWordWrite_Map(0x500000) - - switch (a) - { - case 0x100000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x100002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall silentd_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x500000) -} - -static void SilentdInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(TaitoPaletteRam, 0x300000, 0x301fff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(TC0180VCURAM, 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x510000, 0x5137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x513800, 0x513fff, MAP_RAM); - SekSetWriteByteHandler(0, silentd_write_byte); - SekSetWriteWordHandler(0, silentd_write_word); - SekSetReadByteHandler(0, silentd_read_byte); -// SekSetReadWordHandler(0, silentd_read_word); - SekClose(); -} - -//---------------------------------------------------------------------------------------------------------- -// Violence Fight - -static UINT8 __fastcall viofight_read_byte(UINT32 a) -{ - TC0180VCUHalfWordRead_Map(0x400000) - TC0220IOCHalfWordRead_Map(0x800000) - - switch (a) - { - case 0x200002: - return TC0140SYTCommRead(); - } - - return 0; -} - -static void __fastcall viofight_write_byte(UINT32 a, UINT8 d) -{ - TC0180VCUHalfWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x800000) - - switch (a) - { - case 0x200000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x200002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall viofight_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x800000) -} - -static void ViofightInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(TC0180VCURAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x410000, 0x4137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x413800, 0x413fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0x600000, 0x601fff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0xa00000, 0xa03fff, MAP_RAM); - SekSetWriteByteHandler(0, viofight_write_byte); - SekSetWriteWordHandler(0, viofight_write_word); - SekSetReadByteHandler(0, viofight_read_byte); -// SekSetReadWordHandler(0, viofight_read_word); - SekClose(); - - memcpy (Taito68KRom1 + 0x40000, Taito68KRom1 + 0x20000, 0x40000); - - cpu_speed[1] = 6000000; // 6mhz -} - -//---------------------------------------------------------------------------------------------------------- -// Hit the Ice - -static UINT8 __fastcall hitice_read_byte(UINT32 a) -{ - TC0180VCUHalfWordRead_Map(0x400000) - TC0220IOCHalfWordRead_Map(0x600000) - - switch (a) - { - case 0x610000: - return TaitoInput[4]; - - case 0x610001: - return TaitoInput[3]; - - case 0x700002: - return TC0140SYTCommRead(); - } - - return 0; -} - -static void hiticeFramebufferUpdate(UINT32 offset) -{ - offset &= 0x7fffe; - DrvFramebuffer[offset + 0] = DrvPxlRAM[offset]; - DrvFramebuffer[offset + 1] = DrvPxlRAM[offset]; -} - -static void hiticeFramebufferStateload() -{ - for (INT32 i = 0; i < 0x80000; i+=2) { - hiticeFramebufferUpdate(i); - } -} - -static void __fastcall hitice_write_byte(UINT32 a, UINT8 d) -{ - TC0180VCUHalfWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x600000) - - if (a >= 0xb00000 && a <= 0xb7ffff) { - DrvPxlRAM[(a & 0x7ffff)^1] = d; - hiticeFramebufferUpdate(a); - return; - } - - switch (a) - { - case 0x700000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x700002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall hitice_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x600000) - - if (a >= 0xb00000 && a <= 0xb7ffff) { - *((UINT16*)(DrvPxlRAM + (a & 0x7fffe))) = d; - hiticeFramebufferUpdate(a); - return; - } - - switch (a) - { - case 0xbffff2: - DrvPxlScroll[0] = d; - if ((LastScrollX > d+0x10) || (LastScrollX < d-0x10)) - { - // Clear blitter framebuffer - memset (DrvPxlRAM, 0, 0x80000); - memset (DrvFramebuffer, 0, 1024 * 512); - } - LastScrollX = d; - return; - - case 0xbffff4: - DrvPxlScroll[1] = d; - return; - } -} - -static void HiticeInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(TC0180VCURAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x410000, 0x4137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x413800, 0x413fff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x800000, 0x803fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0xa00000, 0xa01fff, MAP_RAM); - SekMapMemory(DrvPxlRAM, 0xb00000, 0xb7ffff, MAP_ROM); - SekSetWriteByteHandler(0, hitice_write_byte); - SekSetWriteWordHandler(0, hitice_write_word); - SekSetReadByteHandler(0, hitice_read_byte); -// SekSetReadWordHandler(0, hitice_read_word); - SekClose(); - - DrvFramebuffer = (UINT8*)BurnMalloc(1024 * 512); -} - -//---------------------------------------------------------------------------------------------------------- -// Tetris (ym2203) - -static UINT8 __fastcall tetrista_read_byte(UINT32 a) -{ - TC0180VCUHalfWordRead_Map(0x400000) - - switch (a) - { - case 0x600000: - case 0x800000: - return TC0220IOCPortRegRead(); - - case 0x600002: - case 0x800002: - return TC0220IOCPortRead(); - - case 0xa00002: - return TC0140SYTCommRead(); - } - - return 0; -} - -static void __fastcall tetrista_write_byte(UINT32 a, UINT8 d) -{ - TC0180VCUHalfWordWrite_Map(0x400000) - - switch (a) - { - case 0x600000: - case 0x800000: - TaitoWatchdog = 0; - TC0220IOCHalfWordPortRegWrite(d); - return; - - case 0x600002: - case 0x800002: - TC0220IOCHalfWordPortWrite(d); - return; - - case 0xa00000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0xa00002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - } -} - -static void __fastcall tetrista_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x400000) -} - -static void TetristaInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(TaitoPaletteRam, 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0180VCURAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x410000, 0x4137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x413800, 0x413fff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x800000, 0x803fff, MAP_RAM); - SekSetWriteByteHandler(0, tetrista_write_byte); - SekSetWriteWordHandler(0, tetrista_write_word); - SekSetReadByteHandler(0, tetrista_read_byte); -// SekSetReadWordHandler(0, tetrista_read_word); - SekClose(); -} - -static void MasterwInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x200000, 0x203fff, MAP_RAM); - SekMapMemory(TC0180VCURAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x410000, 0x4137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x413800, 0x413fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0x600000, 0x601fff, MAP_RAM); - SekSetWriteByteHandler(0, tetrista_write_byte); - SekSetWriteWordHandler(0, tetrista_write_word); - SekSetReadByteHandler(0, tetrista_read_byte); -// SekSetReadWordHandler(0, tetrista_read_word); - SekClose(); -} - -//---------------------------------------------------------------------------------------------------------- -// Quiz Sekai Wa Show by shobai - - -static UINT8 __fastcall qzshowby_read_byte(UINT32 a) -{ - if (a != 0x200002) { - TC0220IOCHalfWordRead_Map(0x200000) - } - - TC0180VCUHalfWordRead_Map(0x400000) - - switch (a) - { - case 0x200002: - return ((TC0220IOCInput[0] & 0xfe) | (EEPROMRead() & 1)); - - case 0x200024: - return TC0220IOCInput[4]; - - case 0x200028: - return coin_control; - - case 0x20002e: - return TC0220IOCInput[5]; - - case 0x600002: - return TC0140SYTCommRead(); - } - - return 0; -} - -static void __fastcall qzshowby_write_byte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x200000) - TC0180VCUHalfWordWrite_Map(0x400000) - - switch (a) - { - case 0x200026: - EEPROMWrite((d & 0x08), (d & 0x10), (d & 0x04)); - return; - - case 0x200028: - coin_control = d; - TaitoCoinLockout[2] = ~d & 0x01; - TaitoCoinLockout[3] = ~d & 0x02; - // coin counter d & 0x04, d & 0x08 - return; - - case 0x600000: - TC0140SYTPortWrite(d & 0xff); - return; - - case 0x600002: - ZetClose(); - TC0140SYTCommWrite(d & 0xff); - ZetOpen(0); - return; - - case 0x700000: - case 0x700002: - // gain - return; - } -} - -static void __fastcall qzshowby_write_word(UINT32 a, UINT16 d) -{ - TC0180VCUWordWrite_Map(0x400000) - TC0220IOCHalfWordWrite_Map(0x200000) -} - -static void QzshowbyInitCallback() -{ - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(TC0180VCURAM, 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam, 0x410000, 0x4137ff, MAP_RAM); - SekMapMemory(TC0180VCUScrollRAM, 0x413800, 0x413fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0x800000, 0x801fff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x900000, 0x90ffff, MAP_RAM); - SekSetWriteByteHandler(0, qzshowby_write_byte); - SekSetWriteWordHandler(0, qzshowby_write_word); - SekSetReadByteHandler(0, qzshowby_read_byte); -// SekSetReadWordHandler(0, qzshowby_read_word); - SekClose(); -} - -//---------------------------------------------------------------------------------------------------------- - - -// Master of Weapon (World) - -static struct BurnRomInfo masterwRomDesc[] = { - { "b72_06.33", 0x020000, 0xae848eff, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b72_12.24", 0x020000, 0x7176ce70, TAITO_68KROM1_BYTESWAP }, // 1 - { "b72_04.34", 0x020000, 0x141e964c, TAITO_68KROM1_BYTESWAP }, // 2 - { "b72_03.25", 0x020000, 0xf4523496, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b72_07.30", 0x010000, 0x2b1a946f, TAITO_Z80ROM1 }, // 4 Z80 code - - { "b72-02.6", 0x080000, 0x843444eb, TAITO_CHARS }, // 5 Graphics Tiles - { "b72-01.5", 0x080000, 0xa24ac26e, TAITO_CHARS }, // 6 -}; - -STD_ROM_PICK(masterw) -STD_ROM_FN(masterw) - -static INT32 MasterwInit() -{ - return CommonInit(MasterwInitCallback, 1, 2, 0, 4, 5); -} - -struct BurnDriver BurnDrvMasterw = { - "masterw", NULL, NULL, NULL, "1989", - "Master of Weapon (World)\0", "Imperfect graphics", "Taito Corporation Japan", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VERSHOOT, 0, - NULL, masterwRomInfo, masterwRomName, NULL, NULL, CommonInputInfo, MasterwDIPInfo, - MasterwInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 224, 320, 3, 4 -}; - - -// Master of Weapon (US) - -static struct BurnRomInfo masterwuRomDesc[] = { - { "b72_06.33", 0x020000, 0xae848eff, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b72_11.24", 0x020000, 0x0671fee6, TAITO_68KROM1_BYTESWAP }, // 1 - { "b72_04.34", 0x020000, 0x141e964c, TAITO_68KROM1_BYTESWAP }, // 2 - { "b72_03.25", 0x020000, 0xf4523496, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b72_07.30", 0x010000, 0x2b1a946f, TAITO_Z80ROM1 }, // 4 Z80 code - - { "b72-02.6", 0x080000, 0x843444eb, TAITO_CHARS }, // 5 Graphics Tiles - { "b72-01.5", 0x080000, 0xa24ac26e, TAITO_CHARS }, // 6 -}; - -STD_ROM_PICK(masterwu) -STD_ROM_FN(masterwu) - -struct BurnDriver BurnDrvMasterwu = { - "masterwu", "masterw", NULL, NULL, "1989", - "Master of Weapon (US)\0", "Imperfect graphics", "Taito America Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VERSHOOT, 0, - NULL, masterwuRomInfo, masterwuRomName, NULL, NULL, CommonInputInfo, MasterwDIPInfo, - MasterwInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 224, 320, 3, 4 -}; - - -// Master of Weapon (Japan) - -static struct BurnRomInfo masterwjRomDesc[] = { - { "b72_06.33", 0x020000, 0xae848eff, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b72_05.24", 0x020000, 0x9f78af5c, TAITO_68KROM1_BYTESWAP }, // 1 - { "b72_04.34", 0x020000, 0x141e964c, TAITO_68KROM1_BYTESWAP }, // 2 - { "b72_03.25", 0x020000, 0xf4523496, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b72_07.30", 0x010000, 0x2b1a946f, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b72-02.6", 0x080000, 0x843444eb, TAITO_CHARS }, // 5 Graphics Tiles - { "b72-01.5", 0x080000, 0xa24ac26e, TAITO_CHARS }, // 6 -}; - -STD_ROM_PICK(masterwj) -STD_ROM_FN(masterwj) - -struct BurnDriver BurnDrvMasterwj = { - "masterwj", "masterw", NULL, NULL, "1989", - "Master of Weapon (Japan)\0", "Imperfect graphics", "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VERSHOOT, 0, - NULL, masterwjRomInfo, masterwjRomName, NULL, NULL, CommonInputInfo, MasterwDIPInfo, - MasterwInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 224, 320, 3, 4 -}; - - -// Yukiwo (World, prototype) - -static struct BurnRomInfo yukiwoRomDesc[] = { - { "ic33-rom0e.bin", 0x020000, 0xa0dd51d9, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "ic24-e882.bin", 0x020000, 0xd66f29d4, TAITO_68KROM1_BYTESWAP }, // 1 - { "ic34-rom1e.bin", 0x010000, 0x5ab7bc95, TAITO_68KROM1_BYTESWAP }, // 2 - { "ic25-rom10.bin", 0x010000, 0x0571b986, TAITO_68KROM1_BYTESWAP }, // 3 - - { "ic30-snd.bin", 0x008000, 0x8632adb7, TAITO_Z80ROM1 }, // 4 Z80 Code - { "ic30-snd.bin", 0x008000, 0x8632adb7, TAITO_Z80ROM1 }, // - - { "ic5-9df1.bin", 0x020000, 0x0507b908, TAITO_CHARS_BYTESWAP }, // 5 Graphics Tiles - { "ic1-a010.bin", 0x020000, 0x0030dce2, TAITO_CHARS_BYTESWAP }, // 6 - { "ic6-6f3f.bin", 0x020000, 0x77afcf80, TAITO_CHARS_BYTESWAP }, // 7 - { "ic2-6588.bin", 0x020000, 0x25e79bc2, TAITO_CHARS_BYTESWAP }, // 8 - { "ic7-7c16.bin", 0x020000, 0xa366bffd, TAITO_CHARS_BYTESWAP }, // 9 - { "ic3-1305.bin", 0x020000, 0x8772b1a6, TAITO_CHARS_BYTESWAP }, // 10 - { "ic8-e28a.bin", 0x020000, 0x1b3db354, TAITO_CHARS_BYTESWAP }, // 11 - { "ic4-9e5e.bin", 0x020000, 0x3b30166b, TAITO_CHARS_BYTESWAP }, // 12 -}; - -STD_ROM_PICK(yukiwo) -STD_ROM_FN(yukiwo) - -struct BurnDriver BurnDrvYukiwo = { - "yukiwo", "masterw", NULL, NULL, "1989", - "Yukiwo (World, prototype)\0", "Imperfect graphics", "Taito Corporation Japan", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_PROTOTYPE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VERSHOOT, 0, - NULL, yukiwoRomInfo, yukiwoRomName, NULL, NULL, CommonInputInfo, MasterwDIPInfo, - MasterwInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 224, 320, 3, 4 -}; - - -// Nastar (World) - -static struct BurnRomInfo nastarRomDesc[] = { - { "b81-08.50", 0x020000, 0xd6da9169, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b81-13.31", 0x020000, 0x60d176fb, TAITO_68KROM1_BYTESWAP }, // 1 - { "b81-10.49", 0x020000, 0x53f34344, TAITO_68KROM1_BYTESWAP }, // 2 - { "b81-09.30", 0x020000, 0x630d34af, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b81-11.37", 0x010000, 0x3704bf09, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b81-03.14", 0x080000, 0x551b75e6, TAITO_CHARS }, // 5 Graphics Tiles - { "b81-04.15", 0x080000, 0xcf734e12, TAITO_CHARS }, // 6 - - { "b81-02.2", 0x080000, 0x20ec3b86, TAITO_YM2610A }, // 7 YM2610 A Samples - - { "b81-01.1", 0x080000, 0xb33f796b, TAITO_YM2610B }, // 8 YM2610 B Samples - - { "ampal16l8-b81-05.21", 0x000104, 0x922fd368, BRF_OPT }, // 9 PLDs - { "ampal16l8-b81-06a.22", 0x000104, 0xbb1cec84, BRF_OPT }, // 10 -}; - -STD_ROM_PICK(nastar) -STD_ROM_FN(nastar) - -static INT32 NastarInit() -{ - game_config = 1; // CommonInputInfo - return CommonInit(NastarInitCallback, 0, 0, 0, 2, 4); -} - -struct BurnDriver BurnDrvNastar = { - "nastar", NULL, NULL, NULL, "1988", - "Nastar (World)\0", NULL, "Taito Corporation Japan", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SCRFIGHT, 0, - NULL, nastarRomInfo, nastarRomName, NULL, NULL, CommonInputInfo, NastarDIPInfo, - NastarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Rastan Saga 2 (Japan) - -static struct BurnRomInfo rastsag2RomDesc[] = { - { "b81-08.50", 0x020000, 0xd6da9169, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b81-07.31", 0x020000, 0x8edf17d7, TAITO_68KROM1_BYTESWAP }, // 1 - { "b81-10.49", 0x020000, 0x53f34344, TAITO_68KROM1_BYTESWAP }, // 2 - { "b81-09.30", 0x020000, 0x630d34af, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b81-11.37", 0x010000, 0x3704bf09, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b81-03.14", 0x080000, 0x551b75e6, TAITO_CHARS }, // 5 Graphics Tiles - { "b81-04.15", 0x080000, 0xcf734e12, TAITO_CHARS }, // 6 - - { "b81-02.2", 0x080000, 0x20ec3b86, TAITO_YM2610A }, // 7 YM2610 A Samples - - { "b81-01.1", 0x080000, 0xb33f796b, TAITO_YM2610B }, // 8 YM2610 B Samples -}; - -STD_ROM_PICK(rastsag2) -STD_ROM_FN(rastsag2) - -struct BurnDriver BurnDrvRastsag2 = { - "rastsag2", "nastar", NULL, NULL, "1988", - "Rastan Saga 2 (Japan)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SCRFIGHT, 0, - NULL, rastsag2RomInfo, rastsag2RomName, NULL, NULL, CommonInputInfo, Rastsag2DIPInfo, - NastarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Nastar Warrior (US) - -static struct BurnRomInfo nastarwRomDesc[] = { - { "b81-08.50", 0x020000, 0xd6da9169, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b81-12.31", 0x020000, 0xf9d82741, TAITO_68KROM1_BYTESWAP }, // 1 - { "b81-10.49", 0x020000, 0x53f34344, TAITO_68KROM1_BYTESWAP }, // 2 - { "b81-09.30", 0x020000, 0x630d34af, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b81-11.37", 0x010000, 0x3704bf09, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b81-03.14", 0x080000, 0x551b75e6, TAITO_CHARS }, // 5 Graphics Tiles - { "b81-04.15", 0x080000, 0xcf734e12, TAITO_CHARS }, // 6 - - { "b81-02.2", 0x080000, 0x20ec3b86, TAITO_YM2610A }, // 7 YM2610 A Samples - - { "b81-01.1", 0x080000, 0xb33f796b, TAITO_YM2610B }, // 8 YM2610 B Samples -}; - -STD_ROM_PICK(nastarw) -STD_ROM_FN(nastarw) - -struct BurnDriver BurnDrvNastarw = { - "nastarw", "nastar", NULL, NULL, "1988", - "Nastar Warrior (US)\0", NULL, "Taito America Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SCRFIGHT, 0, - NULL, nastarwRomInfo, nastarwRomName, NULL, NULL, CommonInputInfo, NastarwDIPInfo, - NastarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Rambo III (Europe set 1) - -static struct BurnRomInfo rambo3RomDesc[] = { - { "ramb3-11.bin", 0x020000, 0x1cc42247, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "ramb3-14.bin", 0x020000, 0x7d917c21, TAITO_68KROM1_BYTESWAP }, // 1 - { "ramb3-07.bin", 0x020000, 0xc973ff6f, TAITO_68KROM1_BYTESWAP }, // 2 - { "ramb3-06.bin", 0x020000, 0xa83d3fd5, TAITO_68KROM1_BYTESWAP }, // 3 - - { "ramb3-10.bin", 0x010000, 0xb18bc020, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "ramb3-03.bin", 0x080000, 0xf5808c41, TAITO_CHARS }, // 5 Graphics Tiles - { "ramb3-04.bin", 0x080000, 0xc57831ce, TAITO_CHARS }, // 6 - { "ramb3-01.bin", 0x080000, 0xc55fcf54, TAITO_CHARS }, // 7 - { "ramb3-02.bin", 0x080000, 0x9dd014c6, TAITO_CHARS }, // 8 - - { "ramb3-05.bin", 0x080000, 0x0179dc40, TAITO_YM2610A }, // 9 YM2610 A Samples -}; - -STD_ROM_PICK(rambo3) -STD_ROM_FN(rambo3) - -static INT32 Rambo3Init() -{ - nTaitoInputConfig[1] = 0x30; - BurnGunInit(2, false); - - return CommonInit(TetristInitCallback, 0, 2, 0, 1, 6); -} - -struct BurnDriver BurnDrvRambo3 = { - "rambo3", NULL, NULL, NULL, "1989", - "Rambo III (Europe)\0", NULL, "Taito Europe Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SHOOT, 0, - NULL, rambo3RomInfo, rambo3RomName, NULL, NULL, Rambo3uInputInfo, Rambo3uDIPInfo, - Rambo3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Rambo III (US) - -static struct BurnRomInfo rambo3uRomDesc[] = { - { "ramb3-11.bin", 0x020000, 0x1cc42247, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "ramb3-13.bin", 0x020000, 0x0a964cb7, TAITO_68KROM1_BYTESWAP }, // 1 - { "ramb3-07.bin", 0x020000, 0xc973ff6f, TAITO_68KROM1_BYTESWAP }, // 2 - { "ramb3-06.bin", 0x020000, 0xa83d3fd5, TAITO_68KROM1_BYTESWAP }, // 3 - - { "ramb3-10.bin", 0x010000, 0xb18bc020, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "ramb3-03.bin", 0x080000, 0xf5808c41, TAITO_CHARS }, // 5 Graphics Tiles - { "ramb3-04.bin", 0x080000, 0xc57831ce, TAITO_CHARS }, // 6 - { "ramb3-01.bin", 0x080000, 0xc55fcf54, TAITO_CHARS }, // 7 - { "ramb3-02.bin", 0x080000, 0x9dd014c6, TAITO_CHARS }, // 8 - - { "ramb3-05.bin", 0x080000, 0x0179dc40, TAITO_YM2610A }, // 9 YM2610 A Samples -}; - -STD_ROM_PICK(rambo3u) -STD_ROM_FN(rambo3u) - -struct BurnDriver BurnDrvRambo3u = { - "rambo3u", "rambo3", NULL, NULL, "1989", - "Rambo III (US)\0", NULL, "Taito Europe Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SHOOT, 0, - NULL, rambo3uRomInfo, rambo3uRomName, NULL, NULL, Rambo3uInputInfo, Rambo3uDIPInfo, - Rambo3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Rambo III (Europe, Proto?) - -static struct BurnRomInfo rambo3pRomDesc[] = { - { "r3-0e.rom", 0x010000, 0x3efa4177, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "r3-0o.rom", 0x010000, 0x55c38d92, TAITO_68KROM1_BYTESWAP }, // 1 - { "r3-1e.rom", 0x020000, 0x40e363c7, TAITO_68KROM1_BYTESWAP }, // 2 - { "r3-1o.rom", 0x020000, 0x7f1fe6ab, TAITO_68KROM1_BYTESWAP }, // 3 - - { "r3-00.rom", 0x010000, 0xdf7a6ed6, TAITO_Z80ROM1 }, // 4 Z80 Code - -// This order is different than that of MAME! This allows use of standard gfx decode. - { "r3-ch1ll.rom", 0x020000, 0xc86ea5fc, TAITO_CHARS_BYTESWAP }, // 5 Graphics Tiles - { "r3-ch1lh.rom", 0x020000, 0x75568cf0, TAITO_CHARS_BYTESWAP }, // 6 - { "r3-ch1hl.rom", 0x020000, 0x7525eb92, TAITO_CHARS_BYTESWAP }, // 7 - { "r3-ch1hh.rom", 0x020000, 0xe39cff37, TAITO_CHARS_BYTESWAP }, // 8 - { "r3-ch3ll.rom", 0x020000, 0xabe54b1e, TAITO_CHARS_BYTESWAP }, // 9 - { "r3-ch3lh.rom", 0x020000, 0x5a155c04, TAITO_CHARS_BYTESWAP }, // 10 - { "r3-ch3hl.rom", 0x020000, 0x80e5647e, TAITO_CHARS_BYTESWAP }, // 11 - { "r3-ch3hh.rom", 0x020000, 0xabe58fdb, TAITO_CHARS_BYTESWAP }, // 12 - { "r3-ch0ll.rom", 0x020000, 0xb416f1bf, TAITO_CHARS_BYTESWAP }, // 13 - { "r3-ch0lh.rom", 0x020000, 0x76a330a2, TAITO_CHARS_BYTESWAP }, // 14 - { "r3-ch0hl.rom", 0x020000, 0xa4cad36d, TAITO_CHARS_BYTESWAP }, // 15 - { "r3-ch0hh.rom", 0x020000, 0x4dc69751, TAITO_CHARS_BYTESWAP }, // 16 - { "r3-ch2ll.rom", 0x020000, 0xd0ce3051, TAITO_CHARS_BYTESWAP }, // 17 - { "r3-ch2lh.rom", 0x020000, 0xdf3bc48f, TAITO_CHARS_BYTESWAP }, // 18 - { "r3-ch2hl.rom", 0x020000, 0x837d8677, TAITO_CHARS_BYTESWAP }, // 19 - { "r3-ch2hh.rom", 0x020000, 0xbf37dfac, TAITO_CHARS_BYTESWAP }, // 20 - - { "r3-a1.rom", 0x020000, 0x4396fa19, TAITO_YM2610A }, // 21 YM2610 A Samples - { "r3-a2.rom", 0x020000, 0x41fe53a8, TAITO_YM2610A }, // 22 - { "r3-a3.rom", 0x020000, 0xe89249ba, TAITO_YM2610A }, // 23 - { "r3-a4.rom", 0x020000, 0x9cf4c21b, TAITO_YM2610A }, // 24 -}; - -STD_ROM_PICK(rambo3p) -STD_ROM_FN(rambo3p) - -static INT32 Rambo3pInit() -{ - INT32 nRet = CommonInit(TetristInitCallback, 0, 0, 0, 1, 6); - - if (nRet == 0) { - memmove (Taito68KRom1 + 0x40000, Taito68KRom1 + 0x20000, 0x40000); - } - - return nRet; -} - -struct BurnDriver BurnDrvRambo3p = { - "rambo3p", "rambo3", NULL, NULL, "1989", - "Rambo III (Europe, Proti?)\0", NULL, "Taito Europe Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SHOOT, 0, - NULL, rambo3pRomInfo, rambo3pRomName, NULL, NULL, CommonInputInfo, Rambo3DIPInfo, - Rambo3pInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Crime City (World) - -static struct BurnRomInfo crimecRomDesc[] = { - { "b99-07.40", 0x020000, 0x26e886e6, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b99-05.29", 0x020000, 0xff7f9a9d, TAITO_68KROM1_BYTESWAP }, // 1 - { "b99-06.39", 0x020000, 0x1f26aa92, TAITO_68KROM1_BYTESWAP }, // 2 - { "b99-14.28", 0x020000, 0x71c8b4d7, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b99-08.45", 0x010000, 0x26135451, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b99-02.18", 0x080000, 0x2a5d4a26, TAITO_CHARS }, // 5 Graphics Tiles - { "b99-01.19", 0x080000, 0xa19e373a, TAITO_CHARS }, // 6 - - { "b99-03.37", 0x080000, 0xdda10df7, TAITO_YM2610A }, // 7 YM2610 A Samples -}; - -STD_ROM_PICK(crimec) -STD_ROM_FN(crimec) - -static INT32 CrimecInit() -{ - return CommonInit(CrimecInitCallback, 0, 1, 0, 3, 5); -} - -struct BurnDriver BurnDrvCrimec = { - "crimec", NULL, NULL, NULL, "1989", - "Crime City (World)\0", NULL, "Taito Corporation Japan", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_PLATFORM, 0, - NULL, crimecRomInfo, crimecRomName, NULL, NULL, CommonInputInfo, CrimecDIPInfo, - CrimecInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Crime City (US) - -static struct BurnRomInfo crimecuRomDesc[] = { - { "b99-07.40", 0x020000, 0x26e886e6, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b99-05.29", 0x020000, 0xff7f9a9d, TAITO_68KROM1_BYTESWAP }, // 1 - { "b99-06.39", 0x020000, 0x1f26aa92, TAITO_68KROM1_BYTESWAP }, // 2 - { "b99-13.28", 0x020000, 0x06cf8441, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b99-08.45", 0x010000, 0x26135451, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b99-02.18", 0x080000, 0x2a5d4a26, TAITO_CHARS }, // 5 Graphics Tiles - { "b99-01.19", 0x080000, 0xa19e373a, TAITO_CHARS }, // 6 - - { "b99-03.37", 0x080000, 0xdda10df7, TAITO_YM2610A }, // 7 YM2610 A Samples -}; - -STD_ROM_PICK(crimecu) -STD_ROM_FN(crimecu) - -struct BurnDriver BurnDrvCrimecu = { - "crimecu", "crimec", NULL, NULL, "1989", - "Crime City (US)\0", NULL, "Taito America Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_PLATFORM, 0, - NULL, crimecuRomInfo, crimecuRomName, NULL, NULL, CommonInputInfo, CrimecuDIPInfo, - CrimecInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Crime City (Japan) - -static struct BurnRomInfo crimecjRomDesc[] = { - { "b99-07.40", 0x020000, 0x26e886e6, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b99-05.29", 0x020000, 0xff7f9a9d, TAITO_68KROM1_BYTESWAP }, // 1 - { "b99-06.39", 0x020000, 0x1f26aa92, TAITO_68KROM1_BYTESWAP }, // 2 - { "b99-15.28", 0x020000, 0xe8c1e56d, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b99-08.45", 0x010000, 0x26135451, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b99-02.18", 0x080000, 0x2a5d4a26, TAITO_CHARS }, // 5 Graphics Tiles - { "b99-01.19", 0x080000, 0xa19e373a, TAITO_CHARS }, // 6 - - { "b99-03.37", 0x080000, 0xdda10df7, TAITO_YM2610A }, // 7 YM2610 A Samples -}; - -STD_ROM_PICK(crimecj) -STD_ROM_FN(crimecj) - -struct BurnDriver BurnDrvCrimecj = { - "crimecj", "crimec", NULL, NULL, "1989", - "Crime City (Japan)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_PLATFORM, 0, - NULL, crimecjRomInfo, crimecjRomName, NULL, NULL, CommonInputInfo, CrimecjDIPInfo, - CrimecInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Tetris (Japan, B-System, YM2610) - -static struct BurnRomInfo tetristRomDesc[] = { - { "c12-03.50", 0x020000, 0x38f1ed41, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c12-02.31", 0x020000, 0xed9530bc, TAITO_68KROM1_BYTESWAP }, // 1 - { "c12-05.49", 0x020000, 0x128e9927, TAITO_68KROM1_BYTESWAP }, // 2 - { "c12-04.30", 0x020000, 0x5da7a319, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c12-06.37", 0x010000, 0xf2814b38, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b81-03.14", 0x080000, 0x551b75e6, BRF_OPT }, - { "b81-04.15", 0x080000, 0xcf734e12, BRF_OPT }, - - { "b81-02.2", 0x080000, 0x20ec3b86, BRF_OPT }, - - { "b81-01.1", 0x080000, 0xb33f796b, BRF_OPT }, -}; - -STD_ROM_PICK(tetrist) -STD_ROM_FN(tetrist) - -static INT32 TetristInit() -{ - return CommonInit(TetristInitCallback, 0, 0, 0, 2, 4); -} - -struct BurnDriver BurnDrvTetrist = { - "tetrist", "tetris", NULL, NULL, "1989", - "Tetris (Japan, B-System, YM2610)\0", "buggy - use parent!", "Sega", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_PUZZLE, 0, - NULL, tetristRomInfo, tetristRomName, NULL, NULL, CommonInputInfo, TetristDIPInfo, - TetristInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Tetris (Japan, B-System, YM2203) - -static struct BurnRomInfo tetristaRomDesc[] = { - { "c35-04.33", 0x020000, 0xfa6e42ff, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c35-03.24", 0x020000, 0xaebd8539, TAITO_68KROM1_BYTESWAP }, // 1 - { "c35-02.34", 0x020000, 0x128e9927, TAITO_68KROM1_BYTESWAP }, // 2 - { "c35-01.25", 0x020000, 0x5da7a319, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c35-05.30", 0x010000, 0x785c63fb, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b72-02.6", 0x080000, 0x843444eb, BRF_OPT }, // 5 Graphics Tiles (not used) - { "b72-01.5", 0x080000, 0xa24ac26e, BRF_OPT }, // 6 -}; - -STD_ROM_PICK(tetrista) -STD_ROM_FN(tetrista) - -static INT32 TetristaInit() -{ - return CommonInit(TetristaInitCallback, 1, 2, 0, 4, 5); -} - -struct BurnDriver BurnDrvTetrista = { - "tetrista", "tetris", NULL, NULL, "1989", - "Tetris (Japan, B-System, YM2203)\0", NULL, "Sega", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_PUZZLE, 0, - NULL, tetristaRomInfo, tetristaRomName, NULL, NULL, CommonInputInfo, TetristDIPInfo, - TetristaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Violence Fight (World) - -static struct BurnRomInfo viofightRomDesc[] = { - { "c16-11.42", 0x010000, 0x23dbd388, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c16-14.23", 0x010000, 0xdc934f6a, TAITO_68KROM1_BYTESWAP }, // 1 - { "c16-07.41", 0x020000, 0x64d1d059, TAITO_68KROM1_BYTESWAP }, // 2 - { "c16-06.22", 0x020000, 0x043761d8, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c16-12.32", 0x010000, 0x6fb028c7, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c16-01.1", 0x080000, 0x7059ce83, TAITO_CHARS }, // 5 Graphics Tiles - { "c16-02.2", 0x080000, 0xb458e905, TAITO_CHARS }, // 6 - { "c16-03.3", 0x080000, 0x515a9431, TAITO_CHARS }, // 7 - { "c16-04.4", 0x080000, 0xebf285e2, TAITO_CHARS }, // 8 - - { "c16-05.47", 0x080000, 0xa49d064a, TAITO_MSM6295 }, // 9 MSM6295 Samples - - { "pal16l8b-c16-08.ic34", 0x000104, 0x9456d278, BRF_OPT }, // 10 PLDs - { "pal16l8b-c16-09.ic35", 0x000104, 0x0965baab, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(viofight) -STD_ROM_FN(viofight) - -static INT32 ViofightInit() -{ - return CommonInit(ViofightInitCallback, 1, 2, 0, 1, 4); -} - -struct BurnDriver BurnDrvViofight = { - "viofight", NULL, NULL, NULL, "1989", - "Violence Fight (World)\0", NULL, "Taito Corporation Japan", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VSFIGHT, 0, - NULL, viofightRomInfo, viofightRomName, NULL, NULL, ViofightInputInfo, ViofightDIPInfo, - ViofightInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Violence Fight (US) - -static struct BurnRomInfo viofightuRomDesc[] = { - { "c16-11.42", 0x010000, 0x23dbd388, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c16-13.23", 0x010000, 0xab947ffc, TAITO_68KROM1_BYTESWAP }, // 1 - { "c16-07.41", 0x020000, 0x64d1d059, TAITO_68KROM1_BYTESWAP }, // 2 - { "c16-06.22", 0x020000, 0x043761d8, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c16-12.32", 0x010000, 0x6fb028c7, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c16-01.1", 0x080000, 0x7059ce83, TAITO_CHARS }, // 5 Graphics Tiles - { "c16-02.2", 0x080000, 0xb458e905, TAITO_CHARS }, // 6 - { "c16-03.3", 0x080000, 0x515a9431, TAITO_CHARS }, // 7 - { "c16-04.4", 0x080000, 0xebf285e2, TAITO_CHARS }, // 8 - - { "c16-05.47", 0x080000, 0xa49d064a, TAITO_MSM6295 }, // 9 MSM6295 Samples - - { "pal16l8b-c16-08.ic34", 0x000104, 0x9456d278, BRF_OPT }, // 10 PLDs - { "pal16l8b-c16-09.ic35", 0x000104, 0x0965baab, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(viofightu) -STD_ROM_FN(viofightu) - -struct BurnDriver BurnDrvViofightu = { - "viofightu", "viofight", NULL, NULL, "1989", - "Violence Fight (US)\0", NULL, "Taito America Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VSFIGHT, 0, - NULL, viofightuRomInfo, viofightuRomName, NULL, NULL, ViofightInputInfo, ViofightDIPInfo, - ViofightInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Violence Fight (Japan) - -static struct BurnRomInfo viofightjRomDesc[] = { - { "c16-11.42", 0x010000, 0x23dbd388, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c16-10.23", 0x010000, 0x329d2e46, TAITO_68KROM1_BYTESWAP }, // 1 - { "c16-07.41", 0x020000, 0x64d1d059, TAITO_68KROM1_BYTESWAP }, // 2 - { "c16-06.22", 0x020000, 0x043761d8, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c16-12.32", 0x010000, 0x6fb028c7, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c16-01.1", 0x080000, 0x7059ce83, TAITO_CHARS }, // 5 Graphics Tiles - { "c16-02.2", 0x080000, 0xb458e905, TAITO_CHARS }, // 6 - { "c16-03.3", 0x080000, 0x515a9431, TAITO_CHARS }, // 7 - { "c16-04.4", 0x080000, 0xebf285e2, TAITO_CHARS }, // 8 - - { "c16-05.47", 0x080000, 0xa49d064a, TAITO_MSM6295 }, // 9 MSM6295 Samples - - { "pal16l8b-c16-08.ic34", 0x000104, 0x9456d278, BRF_OPT }, // 10 PLDs - { "pal16l8b-c16-09.ic35", 0x000104, 0x0965baab, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(viofightj) -STD_ROM_FN(viofightj) - -struct BurnDriver BurnDrvViofightj = { - "viofightj", "viofight", NULL, NULL, "1989", - "Violence Fight (Japan)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VSFIGHT, 0, - NULL, viofightjRomInfo, viofightjRomName, NULL, NULL, ViofightInputInfo, ViofightDIPInfo, - ViofightInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Ashura Blaster (World) - -static struct BurnRomInfo ashuraRomDesc[] = { - { "c43-15.50", 0x020000, 0x5d05d6c6, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c43-13.31", 0x020000, 0x75b7d877, TAITO_68KROM1_BYTESWAP }, // 1 - { "c43-14.49", 0x020000, 0xede7f37d, TAITO_68KROM1_BYTESWAP }, // 2 - { "c43-12.30", 0x020000, 0xb08a4ba0, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c43-16", 0x010000, 0xcb26fce1, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c43-02", 0x080000, 0x105722ae, TAITO_CHARS }, // 5 Graphics Tiles - { "c43-03", 0x080000, 0x426606ba, TAITO_CHARS }, // 6 - - { "c43-01", 0x080000, 0xdb953f37, TAITO_YM2610A }, // 7 YM2610 A Samples -}; - -STD_ROM_PICK(ashura) -STD_ROM_FN(ashura) - -struct BurnDriver BurnDrvAshura = { - "ashura", NULL, NULL, NULL, "1990", - "Ashura Blaster (World)\0", NULL, "Taito Corporation Japan", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VERSHOOT, 0, - NULL, ashuraRomInfo, ashuraRomName, NULL, NULL, CommonInputInfo, AshuraDIPInfo, - NastarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 224, 320, 3, 4 -}; - - -// Ashura Blaster (Japan) - -static struct BurnRomInfo ashurajRomDesc[] = { - { "c43-07-1.50", 0x020000, 0xd5ceb20f, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c43-05-1.31", 0x020000, 0xa6f3bb37, TAITO_68KROM1_BYTESWAP }, // 1 - { "c43-06-1.49", 0x020000, 0x0f331802, TAITO_68KROM1_BYTESWAP }, // 2 - { "c43-04-1.30", 0x020000, 0xe06a2414, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c43-16", 0x010000, 0xcb26fce1, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c43-02", 0x080000, 0x105722ae, TAITO_CHARS }, // 5 Graphics Tiles - { "c43-03", 0x080000, 0x426606ba, TAITO_CHARS }, // 6 - - { "c43-01", 0x080000, 0xdb953f37, TAITO_YM2610A }, // 7 YM2610 A Samples -}; - -STD_ROM_PICK(ashuraj) -STD_ROM_FN(ashuraj) - -struct BurnDriver BurnDrvAshuraj = { - "ashuraj", "ashura", NULL, NULL, "1990", - "Ashura Blaster (Japan)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VERSHOOT, 0, - NULL, ashurajRomInfo, ashurajRomName, NULL, NULL, CommonInputInfo, AshurajDIPInfo, - NastarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 224, 320, 3, 4 -}; - - -// Ashura Blaster (US) - -static struct BurnRomInfo ashurauRomDesc[] = { - { "c43-11.50", 0x020000, 0xd5aefc9b, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c43-09.31", 0x020000, 0xe91d0ab1, TAITO_68KROM1_BYTESWAP }, // 1 - { "c43-10.49", 0x020000, 0xc218e7ea, TAITO_68KROM1_BYTESWAP }, // 2 - { "c43-08.30", 0x020000, 0x5ef4f19f, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c43-16", 0x010000, 0xcb26fce1, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c43-02", 0x080000, 0x105722ae, TAITO_CHARS }, // 5 Graphics Tiles - { "c43-03", 0x080000, 0x426606ba, TAITO_CHARS }, // 6 - - { "c43-01", 0x080000, 0xdb953f37, TAITO_YM2610A }, // 7 YM2610 A Samples -}; - -STD_ROM_PICK(ashurau) -STD_ROM_FN(ashurau) - -struct BurnDriver BurnDrvAshurau = { - "ashurau", "ashura", NULL, NULL, "1990", - "Ashura Blaster (US)\0", NULL, "Taito America Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VERSHOOT, 0, - NULL, ashurauRomInfo, ashurauRomName, NULL, NULL, CommonInputInfo, AshurauDIPInfo, - NastarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 224, 320, 3, 4 -}; - - -// Hit the Ice (US) - -static struct BurnRomInfo hiticeRomDesc[] = { - { "c59-10.42", 0x020000, 0xe4ffad15, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c59-12.64", 0x020000, 0xa080d7af, TAITO_68KROM1_BYTESWAP }, // 1 - { "c59-09.41", 0x010000, 0xe243e3b0, TAITO_68KROM1_BYTESWAP }, // 2 - { "c59-11.63", 0x010000, 0x4d4dfa52, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c59-08.50", 0x010000, 0xd3cbc10b, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c59-03.12", 0x080000, 0x9e513048, TAITO_CHARS }, // 5 Graphics Tiles - { "c59-02.13", 0x080000, 0xaffb5e07, TAITO_CHARS }, // 6 - - { "c59-01.30", 0x020000, 0x46ae291d, TAITO_MSM6295 }, // 7 MSM6295 Samples - - { "pal20l8b-c59-04.25", 0x000144, 0x2ebcf07c, BRF_OPT }, // 8 PLDs - { "pal16l8b-c59-05.26", 0x000104, 0x37b67c5c, BRF_OPT }, // 9 - { "pal20l8b-c59-06.53", 0x000144, 0xbf176875, BRF_OPT }, // 10 - { "pal16r4b-c59-07.61", 0x000104, 0xcf64bd95, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(hitice) -STD_ROM_FN(hitice) - -static INT32 HiticeInit() -{ - return CommonInit(HiticeInitCallback, 1, 0, 1, 6, 4); -} - -struct BurnDriver BurnDrvHitice = { - "hitice", NULL, NULL, NULL, "1990", - "Hit the Ice (US)\0", NULL, "Taito Corporation (Williams licence)", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SPORTSMISC, 0, - NULL, hiticeRomInfo, hiticeRomName, NULL, NULL, HiticeInputInfo, HiticeDIPInfo, - HiticeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Hit the Ice (Japan) - -static struct BurnRomInfo hiticejRomDesc[] = { - { "c59-23.42", 0x020000, 0x01958fcc, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c59-25.64", 0x020000, 0x71984c76, TAITO_68KROM1_BYTESWAP }, // 1 - { "c59-22.41", 0x010000, 0xc2c86140, TAITO_68KROM1_BYTESWAP }, // 2 - { "c59-24.63", 0x010000, 0x26c8f409, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c59-08.50", 0x010000, 0xd3cbc10b, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c59-03.12", 0x080000, 0x9e513048, TAITO_CHARS }, // 5 Graphics Tiles - { "c59-02.13", 0x080000, 0xaffb5e07, TAITO_CHARS }, // 6 - - { "c59-01.30", 0x020000, 0x46ae291d, TAITO_MSM6295 }, // 7 MSM6295 Samples - - { "pal20l8b-c59-04.25", 0x000144, 0x2ebcf07c, BRF_OPT }, // 8 PLDs - { "pal16l8b-c59-05.26", 0x000104, 0x37b67c5c, BRF_OPT }, // 9 - { "pal20l8b-c59-06.53", 0x000144, 0xbf176875, BRF_OPT }, // 10 - { "pal16r4b-c59-07.61", 0x000104, 0xcf64bd95, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(hiticej) -STD_ROM_FN(hiticej) - -struct BurnDriver BurnDrvHiticej = { - "hiticej", "hitice", NULL, NULL, "1990", - "Hit the Ice (Japan)\0", NULL, "Taito Corporation (licensed from Midway)", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SPORTSMISC, 0, - NULL, hiticejRomInfo, hiticejRomName, NULL, NULL, HiticeInputInfo, HiticeDIPInfo, - HiticeInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Sel Feena - -static struct BurnRomInfo selfeenaRomDesc[] = { - { "se-02.27", 0x020000, 0x08f0c8e3, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "se-01.26", 0x020000, 0xa06ca64b, TAITO_68KROM1_BYTESWAP }, // 1 - - { "se-03.39", 0x010000, 0x675998be, TAITO_Z80ROM1 }, // 2 Z80 Code - - { "se-04.2", 0x080000, 0x920ad100, TAITO_CHARS }, // 3 Graphics Tiles - { "se-05.1", 0x080000, 0xd297c995, TAITO_CHARS }, // 4 - - { "se-06.11", 0x080000, 0x80d5e772, TAITO_YM2610A }, // 5 YM2610 A Samples -}; - -STD_ROM_PICK(selfeena) -STD_ROM_FN(selfeena) - -static INT32 SelfeenaInit() -{ - return CommonInit(SelfeenaInitCallback, 0, 2, 1, 4, 6); -} - -struct BurnDriver BurnDrvSelfeena = { - "selfeena", NULL, NULL, NULL, "1991", - "Sel Feena\0", NULL, "East Technology", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_MAZE, 0, - NULL, selfeenaRomInfo, selfeenaRomName, NULL, NULL, SelfeenaInputInfo, SelfeenaDIPInfo, - SelfeenaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Silent Dragon (World) - -static struct BurnRomInfo silentdRomDesc[] = { - { "east-12-1.ic32", 0x020000, 0x5883d362, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "east-15-1.ic10", 0x020000, 0x8c0a72ae, TAITO_68KROM1_BYTESWAP }, // 1 - { "east-11.ic31", 0x020000, 0x35da4428, TAITO_68KROM1_BYTESWAP }, // 2 - { "east-09.ic9", 0x020000, 0x2f05b14a, TAITO_68KROM1_BYTESWAP }, // 3 - - { "east-13.ic15", 0x010000, 0x651861ab, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "east-04.ic28", 0x100000, 0x53237217, TAITO_CHARS }, // 5 Graphics Tiles - { "east-06.ic29", 0x100000, 0xe6e6dfa7, TAITO_CHARS }, // 6 - { "east-03.ic39", 0x100000, 0x1b9b2846, TAITO_CHARS }, // 7 - { "east-05.ic40", 0x100000, 0xe02472c5, TAITO_CHARS }, // 8 - - { "east-01.ic1", 0x080000, 0xb41fff1a, TAITO_YM2610A }, // 9 YM2610 A Samples - - { "east-02.ic3", 0x080000, 0xe0de5c39, TAITO_YM2610B }, // 10 YM2610 B Samples -}; - -STD_ROM_PICK(silentd) -STD_ROM_FN(silentd) - -static INT32 SilentdInit() -{ - INT32 nRet = CommonInit(SilentdInitCallback, 0, 2, 2, 4, 6); - - if (nRet == 0) { - cpu_speed[0] = 16000000; // 16mhz - } - - return nRet; -} - -struct BurnDriver BurnDrvSilentd = { - "silentd", NULL, NULL, NULL, "1992", - "Silent Dragon (World)\0", NULL, "Taito Corporation Japan", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SCRFIGHT, 0, - NULL, silentdRomInfo, silentdRomName, NULL, NULL, SilentdInputInfo, SilentdDIPInfo, - SilentdInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Silent Dragon (Japan) - -static struct BurnRomInfo silentdjRomDesc[] = { - { "east-12-1.ic32", 0x020000, 0x5883d362, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "east-10-1.ic10", 0x020000, 0x584306fc, TAITO_68KROM1_BYTESWAP }, // 1 - { "east-11.ic31", 0x020000, 0x35da4428, TAITO_68KROM1_BYTESWAP }, // 2 - { "east-09.ic9", 0x020000, 0x2f05b14a, TAITO_68KROM1_BYTESWAP }, // 3 - - { "east-13.ic15", 0x010000, 0x651861ab, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "east-04.ic28", 0x100000, 0x53237217, TAITO_CHARS }, // 5 Graphics Tiles - { "east-06.ic29", 0x100000, 0xe6e6dfa7, TAITO_CHARS }, // 6 - { "east-03.ic39", 0x100000, 0x1b9b2846, TAITO_CHARS }, // 7 - { "east-05.ic40", 0x100000, 0xe02472c5, TAITO_CHARS }, // 8 - - { "east-01.ic1", 0x080000, 0xb41fff1a, TAITO_YM2610A }, // 9 YM2610 A Samples - - { "east-02.ic3", 0x080000, 0xe0de5c39, TAITO_YM2610B }, // 10 YM2610 B Samples -}; - -STD_ROM_PICK(silentdj) -STD_ROM_FN(silentdj) - -struct BurnDriver BurnDrvSilentdj = { - "silentdj", "silentd", NULL, NULL, "1992", - "Silent Dragon (Japan)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SCRFIGHT, 0, - NULL, silentdjRomInfo, silentdjRomName, NULL, NULL, SilentdInputInfo, SilentdjDIPInfo, - SilentdInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Silent Dragon (US) - -static struct BurnRomInfo silentduRomDesc[] = { - { "east-12-1.ic32", 0x020000, 0x5883d362, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "east-14-1.ic10", 0x020000, 0x3267bcd5, TAITO_68KROM1_BYTESWAP }, // 1 - { "east-11.ic31", 0x020000, 0x35da4428, TAITO_68KROM1_BYTESWAP }, // 2 - { "east-09.ic9", 0x020000, 0x2f05b14a, TAITO_68KROM1_BYTESWAP }, // 3 - - { "east-13.ic15", 0x010000, 0x651861ab, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "east-04.ic28", 0x100000, 0x53237217, TAITO_CHARS }, // 5 Graphics Tiles - { "east-06.ic29", 0x100000, 0xe6e6dfa7, TAITO_CHARS }, // 6 - { "east-03.ic39", 0x100000, 0x1b9b2846, TAITO_CHARS }, // 7 - { "east-05.ic40", 0x100000, 0xe02472c5, TAITO_CHARS }, // 8 - - { "east-01.ic1", 0x080000, 0xb41fff1a, TAITO_YM2610A }, // 9 YM2610 A Samples - - { "east-02.ic3", 0x080000, 0xe0de5c39, TAITO_YM2610B }, // 10 YM2610 B Samples -}; - -STD_ROM_PICK(silentdu) -STD_ROM_FN(silentdu) - -struct BurnDriver BurnDrvSilentdu = { - "silentdu", "silentd", NULL, NULL, "1992", - "Silent Dragon (US)\0", NULL, "Taito America Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SCRFIGHT, 0, - NULL, silentduRomInfo, silentduRomName, NULL, NULL, SilentdInputInfo, SilentdjDIPInfo, - SilentdInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Ryu Jin (Japan) - -static struct BurnRomInfo ryujinRomDesc[] = { - { "ruj02.27", 0x020000, 0x0d223aee, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "ruj01.26", 0x020000, 0xc6bcdd1e, TAITO_68KROM1_BYTESWAP }, // 1 - { "ruj04.29", 0x020000, 0x0c153cab, TAITO_68KROM1_BYTESWAP }, // 2 - { "ruj03.28", 0x020000, 0x7695f89c, TAITO_68KROM1_BYTESWAP }, // 3 - - { "ruj05.39", 0x010000, 0x95270b16, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "ryujin07.2", 0x100000, 0x34f50980, TAITO_CHARS }, // 5 Graphics Tiles - { "ryujin06.1", 0x100000, 0x1b85ff34, TAITO_CHARS }, // 6 - - { "ryujin08.11", 0x080000, 0x480d040d, TAITO_YM2610A }, // 7 YM2610 A Samples -}; - -STD_ROM_PICK(ryujin) -STD_ROM_FN(ryujin) - -struct BurnDriver BurnDrvRyujin = { - "ryujin", NULL, NULL, NULL, "1993", - "Ryu Jin (Japan)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_VERSHOOT, 0, - NULL, ryujinRomInfo, ryujinRomName, NULL, NULL, SelfeenaInputInfo, RyujinDIPInfo, - SelfeenaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 224, 320, 3, 4 -}; - - -// Quiz Sekai wa SHOW by shobai (Japan) - -static struct BurnRomInfo qzshowbyRomDesc[] = { - { "d72-13.bin", 0x080000, 0xa867759f, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "d72-12.bin", 0x080000, 0x522c09a7, TAITO_68KROM1_BYTESWAP }, // 1 - - { "d72-11.bin", 0x020000, 0x2ca046e2, TAITO_Z80ROM1 }, // 2 Z80 Code - - { "d72-03.bin", 0x200000, 0x1de257d0, TAITO_CHARS }, // 3 Graphics Tiles - { "d72-02.bin", 0x200000, 0xbf0da640, TAITO_CHARS }, // 4 - - { "d72-01.bin", 0x200000, 0xb82b8830, TAITO_YM2610A }, // 5 YM2610 A Samples - - { "pal16l8-d72-05.bin", 0x0104, 0xc3d4cb7e, BRF_OPT }, // 6 PLDs - { "pal16l8-d72-06.bin", 0x0104, 0x27580efc, BRF_OPT }, // 7 - { "palce20v8-d72-07.bin", 0x0157, 0x6359e64c, BRF_OPT }, // 8 - { "palce20v8-d72-08.bin", 0x0157, 0x746a6474, BRF_OPT }, // 9 - { "palce20v8-d72-09.bin", 0x0157, 0x9f680800, BRF_OPT }, // 10 - { "palce16v8-d72-10.bin", 0x0117, 0xa5181ba2, BRF_OPT }, // 11 -}; - -STD_ROM_PICK(qzshowby) -STD_ROM_FN(qzshowby) - -static INT32 QzshowbyInit() -{ - return CommonInit(QzshowbyInitCallback, 0, 1, 3, 5, 3); -} - -struct BurnDriver BurnDrvQzshowby = { - "qzshowby", NULL, NULL, NULL, "1993", - "Quiz Sekai wa SHOW by shobai (Japan)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_QUIZ, 0, - NULL, qzshowbyRomInfo, qzshowbyRomName, NULL, NULL, QzshowbyInputInfo, QzshowbyDIPInfo, - QzshowbyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Puzzle Bobble (Japan, B-System) - -static struct BurnRomInfo pbobbleRomDesc[] = { - { "pb-1c18.bin", 0x040000, 0x5de14f49, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "pb-ic2.bin", 0x040000, 0x2abe07d1, TAITO_68KROM1_BYTESWAP }, // 1 - - { "pb-ic27.bin", 0x020000, 0x26efa4c4, TAITO_Z80ROM1 }, // 2 Z80 Code - - { "pb-ic14.bin", 0x080000, 0x55f90ea4, TAITO_CHARS }, // 3 Graphics Tiles - { "pb-ic9.bin", 0x080000, 0x3253aac9, TAITO_CHARS }, // 4 - - { "pb-ic15.bin", 0x100000, 0x0840cbc4, TAITO_YM2610A }, // 5 YM2610 A Samples -}; - -STD_ROM_PICK(pbobble) -STD_ROM_FN(pbobble) - -static INT32 PbobbleInit() -{ - return CommonInit(PbobbleInitCallback, 0, 1, 3, 5, 3); -} - -struct BurnDriver BurnDrvPbobble = { - "pbobble", NULL, NULL, NULL, "1994", - "Puzzle Bobble (Japan, B-System)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_BREAKOUT, 0, - NULL, pbobbleRomInfo, pbobbleRomName, NULL, NULL, PbobbleInputInfo, PbobbleDIPInfo, - PbobbleInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Space Invaders DX (US, v2.1) - -static struct BurnRomInfo spacedxRomDesc[] = { - { "d89-06", 0x040000, 0x7122751e, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "d89-xx.ic2", 0x040000, 0x56b0be6c, TAITO_68KROM1_BYTESWAP }, // 1 - - { "d89-07.27", 0x010000, 0xbd743401, TAITO_Z80ROM1 }, // 2 Z80 Code - - { "d89-02.14", 0x080000, 0xc36544b9, TAITO_CHARS }, // 3 Graphics Tiles - { "d89-01.9", 0x080000, 0xfffa0660, TAITO_CHARS }, // 4 - - { "d89-03.15", 0x080000, 0x218f31a4, TAITO_YM2610A }, // 5 YM2610 A Samples - - { "pal16l8-d72-05.ic37", 0x0104, 0xc3d4cb7e, BRF_OPT }, // 6 PLDs - { "pal16l8-d72-06.ic50", 0x0104, 0xe96b7f37, BRF_OPT }, // 7 - { "palce20v8-d72-07.ic28", 0x0157, 0x6359e64c, BRF_OPT }, // 8 - { "palce20v8-d72-09.ic47", 0x0157, 0xde1760fd, BRF_OPT }, // 9 - { "palce16v8-d72-10.ic12", 0x0117, 0xa5181ba2, BRF_OPT }, // 10 - { "pal20l8b-d89-04.ic40", 0x0144, 0x00000000, BRF_OPT | BRF_NODUMP }, // 12 -}; - -STD_ROM_PICK(spacedx) -STD_ROM_FN(spacedx) - -struct BurnDriver BurnDrvSpacedx = { - "spacedx", NULL, NULL, NULL, "1994", - "Space Invaders DX (US, v2.1)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SHOOT, 0, - NULL, spacedxRomInfo, spacedxRomName, NULL, NULL, PbobbleInputInfo, PbobbleDIPInfo, - PbobbleInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Space Invaders DX (Japan, v2.1) - -static struct BurnRomInfo spacedxjRomDesc[] = { - { "d89-06", 0x040000, 0x7122751e, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "d89-05", 0x040000, 0xbe1638af, TAITO_68KROM1_BYTESWAP }, // 1 - - { "d89-07.27", 0x010000, 0xbd743401, TAITO_Z80ROM1 }, // 2 Z80 Code - - { "d89-02.14", 0x080000, 0xc36544b9, TAITO_CHARS }, // 3 Graphics Tiles - { "d89-01.9", 0x080000, 0xfffa0660, TAITO_CHARS }, // 4 - - { "d89-03.15", 0x080000, 0x218f31a4, TAITO_YM2610A }, // 5 YM2610 A Samples - - { "pal16l8-d72-05.ic37", 0x0104, 0xc3d4cb7e, BRF_OPT }, // 6 PLDs - { "pal16l8-d72-06.ic50", 0x0104, 0xe96b7f37, BRF_OPT }, // 7 - { "palce20v8-d72-07.ic28", 0x0157, 0x6359e64c, BRF_OPT }, // 8 - { "palce20v8-d72-09.ic47", 0x0157, 0xde1760fd, BRF_OPT }, // 9 - { "palce16v8-d72-10.ic12", 0x0117, 0xa5181ba2, BRF_OPT }, // 10 - { "pal20l8b-d89-04.ic40", 0x0144, 0x00000000, BRF_OPT | BRF_NODUMP }, // 12 -}; - -STD_ROM_PICK(spacedxj) -STD_ROM_FN(spacedxj) - -struct BurnDriver BurnDrvSpacedxj = { - "spacedxj", "spacedx", NULL, NULL, "1994", - "Space Invaders DX (Japan, v2.1)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SHOOT, 0, - NULL, spacedxjRomInfo, spacedxjRomName, NULL, NULL, PbobbleInputInfo, PbobbleDIPInfo, - PbobbleInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Space Invaders DX (Japan, v2.0) - -static struct BurnRomInfo spacedxoRomDesc[] = { - { "d89-08.bin", 0x020000, 0x0c2fe7f9, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "d89-09.bin", 0x020000, 0x7f0a0ba4, TAITO_68KROM1_BYTESWAP }, // 1 - - { "d89-07.27", 0x010000, 0xbd743401, TAITO_Z80ROM1 }, // 2 Z80 Code - - { "d89-12.bin", 0x080000, 0x53df86f1, TAITO_CHARS }, // 3 Graphics Tiles - { "d89-13.bin", 0x080000, 0xc44c1352, TAITO_CHARS }, // 4 - - { "d89-03.15", 0x080000, 0x218f31a4, TAITO_YM2610A }, // 5 YM2610 A Samples -}; - -STD_ROM_PICK(spacedxo) -STD_ROM_FN(spacedxo) - -static INT32 SpacedxoInit() -{ - return CommonInit(SilentdInitCallback, 0, 2, 3, 4, 6); -} - -struct BurnDriver BurnDrvSpacedxo = { - "spacedxo", "spacedx", NULL, NULL, "1994", - "Space Invaders DX (Japan, v2.0)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_TAITOB, GBF_SHOOT, 0, - NULL, spacedxoRomInfo, spacedxoRomName, NULL, NULL, SpacedxoInputInfo, SpacedxoDIPInfo, - SpacedxoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Sonic Blast Man (US) - -static struct BurnRomInfo sbmRomDesc[] = { - { "c69-20-2.ic10", 0x020000, 0x225952a3, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c69-22-2.ic12", 0x020000, 0xd900ce83, TAITO_68KROM1_BYTESWAP }, // 1 - { "c69-19-2.ic9", 0x020000, 0xd6cfacfb, TAITO_68KROM1_BYTESWAP }, // 2 - { "c69-25-2.ic11", 0x020000, 0x70903898, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c69-31.ic28", 0x010000, 0xc999f753, TAITO_Z80ROM1 }, // 4 Z80 Code - - // Some roms are repeated to compensate for the way the taito rom loading system in fba works. - { "c69-01.ic5", 0x100000, 0x521fabe3, TAITO_CHARS }, // 5 Graphics Tiles - { "c69-13.ic2", 0x020000, 0xd1550884, TAITO_CHARS_BYTESWAP }, // 6 - { "c69-12.ic1", 0x020000, 0xeb56582c, TAITO_CHARS_BYTESWAP }, // 7 - { "c69-13.ic2", 0x020000, 0xd1550884, TAITO_CHARS_BYTESWAP }, // 8 - { "c69-12.ic1", 0x020000, 0xeb56582c, TAITO_CHARS_BYTESWAP }, // 9 - { "c69-13.ic2", 0x020000, 0xd1550884, TAITO_CHARS_BYTESWAP }, // 10 - { "c69-12.ic1", 0x020000, 0xeb56582c, TAITO_CHARS_BYTESWAP }, // 11 - { "c69-13.ic2", 0x020000, 0xd1550884, TAITO_CHARS_BYTESWAP }, // 12 - { "c69-12.ic1", 0x020000, 0xeb56582c, TAITO_CHARS_BYTESWAP }, // 13 - { "c69-02.ic6", 0x100000, 0xf0e20d35, TAITO_CHARS }, // 14 - { "c69-15.ic4", 0x020000, 0x9761d316, TAITO_CHARS_BYTESWAP }, // 15 - { "c69-14.ic3", 0x020000, 0x0ed0272a, TAITO_CHARS_BYTESWAP }, // 16 - { "c69-15.ic4", 0x020000, 0x9761d316, TAITO_CHARS_BYTESWAP }, // 17 - { "c69-14.ic3", 0x020000, 0x0ed0272a, TAITO_CHARS_BYTESWAP }, // 18 - { "c69-15.ic4", 0x020000, 0x9761d316, TAITO_CHARS_BYTESWAP }, // 19 - { "c69-14.ic3", 0x020000, 0x0ed0272a, TAITO_CHARS_BYTESWAP }, // 20 - { "c69-15.ic4", 0x020000, 0x9761d316, TAITO_CHARS_BYTESWAP }, // 21 - { "c69-14.ic3", 0x020000, 0x0ed0272a, TAITO_CHARS_BYTESWAP }, // 22 - - { "c69-26.ic36", 0x080000, 0x8784058b, TAITO_YM2610A }, // 23 ymsnd - - { "c69-04.ic6", 0x000104, 0x80498715, BRF_OPT }, // pld - { "c69-05.ic25", 0x000104, 0x35e345b4, BRF_OPT }, // pld - { "c69-06.ic17", 0x000144, 0x3988e5d1, BRF_OPT }, // pld -}; - -STD_ROM_PICK(sbm) -STD_ROM_FN(sbm) - -static INT32 SbmInit() -{ - nTaitoInputConfig[2] = 0x60; - - return CommonInit(SbmInitCallback, 0, 0, 0, 5, 4); -} - -struct BurnDriver BurnDrvSbm = { - "sbm", NULL, NULL, NULL, "1990", - "Sonic Blast Man (US)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - 0, 2, HARDWARE_TAITO_TAITOB, GBF_MISC, 0, - NULL, sbmRomInfo, sbmRomName, NULL, NULL, SbmInputInfo, SbmDIPInfo, - SbmInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; - - -// Sonic Blast Man (Japan) - -static struct BurnRomInfo sbmjRomDesc[] = { - { "c69-20-1.10", 0x020000, 0xb40e4910, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c69-22-1.12", 0x020000, 0xecbcf830, TAITO_68KROM1_BYTESWAP }, // 1 - { "c69-19-1.9", 0x020000, 0x5719c158, TAITO_68KROM1_BYTESWAP }, // 2 - { "c69-21-1.11", 0x020000, 0x73562394, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c69-23.28", 0x010000, 0xb2fce13e, TAITO_Z80ROM1 }, // 4 Z80 Code - - // Some roms are repeated to compensate for the way the taito rom loading system in fba works. - { "c69-01.ic5", 0x100000, 0x521fabe3, TAITO_CHARS }, // 5 Graphics Tiles - { "c69-13.ic2", 0x020000, 0xd1550884, TAITO_CHARS_BYTESWAP }, // 6 - { "c69-12.ic1", 0x020000, 0xeb56582c, TAITO_CHARS_BYTESWAP }, // 7 - { "c69-13.ic2", 0x020000, 0xd1550884, TAITO_CHARS_BYTESWAP }, // 8 - { "c69-12.ic1", 0x020000, 0xeb56582c, TAITO_CHARS_BYTESWAP }, // 9 - { "c69-13.ic2", 0x020000, 0xd1550884, TAITO_CHARS_BYTESWAP }, // 10 - { "c69-12.ic1", 0x020000, 0xeb56582c, TAITO_CHARS_BYTESWAP }, // 11 - { "c69-13.ic2", 0x020000, 0xd1550884, TAITO_CHARS_BYTESWAP }, // 12 - { "c69-12.ic1", 0x020000, 0xeb56582c, TAITO_CHARS_BYTESWAP }, // 13 - { "c69-02.ic6", 0x100000, 0xf0e20d35, TAITO_CHARS }, // 14 - { "c69-15.ic4", 0x020000, 0x9761d316, TAITO_CHARS_BYTESWAP }, // 15 - { "c69-14.ic3", 0x020000, 0x0ed0272a, TAITO_CHARS_BYTESWAP }, // 16 - { "c69-15.ic4", 0x020000, 0x9761d316, TAITO_CHARS_BYTESWAP }, // 17 - { "c69-14.ic3", 0x020000, 0x0ed0272a, TAITO_CHARS_BYTESWAP }, // 18 - { "c69-15.ic4", 0x020000, 0x9761d316, TAITO_CHARS_BYTESWAP }, // 19 - { "c69-14.ic3", 0x020000, 0x0ed0272a, TAITO_CHARS_BYTESWAP }, // 20 - { "c69-15.ic4", 0x020000, 0x9761d316, TAITO_CHARS_BYTESWAP }, // 21 - { "c69-14.ic3", 0x020000, 0x0ed0272a, TAITO_CHARS_BYTESWAP }, // 22 - - { "c69-03.36", 0x080000, 0x63e6b6e7, TAITO_YM2610A }, // 23 ymsnd -}; - -STD_ROM_PICK(sbmj) -STD_ROM_FN(sbmj) - -struct BurnDriver BurnDrvSbmj = { - "sbmj", "sbm", NULL, NULL, "1990", - "Sonic Blast Man (Japan)\0", NULL, "Taito Corporation", "Taito B System", - NULL, NULL, NULL, NULL, - BDF_CLONE, 2, HARDWARE_TAITO_TAITOB, GBF_MISC, 0, - NULL, sbmjRomInfo, sbmjRomName, NULL, NULL, SbmInputInfo, SbmDIPInfo, - SbmInit, DrvExit, DrvFrame, DrvDraw, DrvScan, NULL, 0x1000, - 320, 224, 4, 3 -}; \ No newline at end of file diff --git a/jan/src/burn/drv/taito/d_taitof2.cpp b/jan/src/burn/drv/taito/d_taitof2.cpp deleted file mode 100644 index 4a878eb52..000000000 --- a/jan/src/burn/drv/taito/d_taitof2.cpp +++ /dev/null @@ -1,11477 +0,0 @@ -// Based on MAME driver by David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "taito.h" -#include "taito_ic.h" -#include "burn_ym2610.h" -#include "burn_ym2203.h" -#include "msm6295.h" - -static INT32 Footchmp; -static INT32 YesnoDip; -static INT32 MjnquestInput; -static INT32 DriveoutSoundNibble; -static INT32 DriveoutOkiBank; - -INT32 TaitoF2SpriteType; -INT32 TaitoF2SpritesFlipScreen; -INT32 TaitoF2PrepareSprites; -INT32 TaitoF2SpritesDisabled, TaitoF2SpritesActiveArea, TaitoF2SpritesMasterScrollX, TaitoF2SpritesMasterScrollY; -INT32 TaitoF2SpriteBlendMode; -UINT16 TaitoF2SpriteBank[8]; -UINT16 TaitoF2SpriteBankBuffered[8]; -UINT8 TaitoF2TilePriority[5]; -UINT8 TaitoF2SpritePriority[4]; -struct TaitoF2SpriteEntry *TaitoF2SpriteList; -static TaitoF2SpriteBufferUpdate TaitoF2SpriteBufferFunction; - -static void TaitoF2Draw(); -static void TaitoF2PivotDraw(); -static void CameltryDraw(); -static void DriftoutDraw(); -static void FinalbDraw(); -static void FootchmpDraw(); -static void MetalbDraw(); -static void PulirulaDraw(); -static void QtorimonDraw(); -static void QzquestDraw(); -static void SsiDraw(); -static void ThundfoxDraw(); -static void YuyugogoDraw(); - -#ifdef BUILD_A68K -static bool bUseAsm68KCoreOldValue = false; -#endif - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo CameltryInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p2 start" }, - - A("P1 Paddle" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "p1 fire 1" }, - - A("P2 Paddle" , BIT_ANALOG_REL, &TaitoAnalogPort1 , "p2 x-axis" ), - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Cameltry) - -static struct BurnInputInfo DeadconxInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TaitoInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TaitoInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TaitoInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TaitoInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TaitoInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort2 + 4, "service" }, - {"Service 2" , BIT_DIGITAL , TaitoInputPort2 + 5, "service 2" }, - {"Service 3" , BIT_DIGITAL , TaitoInputPort2 + 6, "service 3" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort2 + 7, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Deadconx) - -static struct BurnInputInfo DinorexInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Dinorex) - -static struct BurnInputInfo DondokodInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Dondokod) - -static struct BurnInputInfo DriftoutInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - - {"P1 Up" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Driftout) - -static struct BurnInputInfo FinalbInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0220IOCInputPort0 + 6, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , TC0220IOCInputPort2 + 4, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , TC0220IOCInputPort2 + 5, "p1 fire 5" }, - - {"P2 Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0220IOCInputPort1 + 6, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , TC0220IOCInputPort2 + 6, "p2 fire 4" }, - {"P2 Fire 5" , BIT_DIGITAL , TC0220IOCInputPort2 + 7, "p2 fire 5" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Finalb) - -static struct BurnInputInfo FootchmpInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort1 + 7, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , TaitoInputPort2 + 2, "p3 coin" }, - {"Start 3" , BIT_DIGITAL , TaitoInputPort3 + 7, "p3 start" }, - {"Coin 4" , BIT_DIGITAL , TaitoInputPort2 + 3, "p4 coin" }, - {"Start 4" , BIT_DIGITAL , TaitoInputPort4 + 7, "p4 start" }, - - {"P1 Up" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TaitoInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TaitoInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TaitoInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TaitoInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TaitoInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 5, "p2 fire 2" }, - - {"P3 Up" , BIT_DIGITAL , TaitoInputPort3 + 0, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , TaitoInputPort3 + 1, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , TaitoInputPort3 + 2, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , TaitoInputPort3 + 3, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , TaitoInputPort3 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , TaitoInputPort3 + 5, "p3 fire 2" }, - - {"P4 Up" , BIT_DIGITAL , TaitoInputPort4 + 0, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , TaitoInputPort4 + 1, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , TaitoInputPort4 + 2, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , TaitoInputPort4 + 3, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , TaitoInputPort4 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , TaitoInputPort4 + 5, "p4 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort2 + 4, "service" }, - {"Service 2" , BIT_DIGITAL , TaitoInputPort2 + 5, "service 2" }, - {"Service 3" , BIT_DIGITAL , TaitoInputPort2 + 6, "service 3" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort2 + 7, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Footchmp) - -static struct BurnInputInfo GrowlInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort1 + 7, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , TaitoInputPort5 + 0, "p3 coin" }, - {"Start 3" , BIT_DIGITAL , TaitoInputPort3 + 7, "p3 start" }, - {"Coin 4" , BIT_DIGITAL , TaitoInputPort5 + 1, "p4 coin" }, - {"Start 4" , BIT_DIGITAL , TaitoInputPort4 + 7, "p4 start" }, - - {"P1 Up" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TaitoInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TaitoInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TaitoInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , TaitoInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TaitoInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TaitoInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TaitoInputPort1 + 6, "p2 fire 3" }, - - {"P3 Up" , BIT_DIGITAL , TaitoInputPort3 + 0, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , TaitoInputPort3 + 1, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , TaitoInputPort3 + 2, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , TaitoInputPort3 + 3, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , TaitoInputPort3 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , TaitoInputPort3 + 5, "p3 fire 2" }, - {"P3 Fire 3" , BIT_DIGITAL , TaitoInputPort3 + 6, "p3 fire 3" }, - - {"P4 Up" , BIT_DIGITAL , TaitoInputPort4 + 0, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , TaitoInputPort4 + 1, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , TaitoInputPort4 + 2, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , TaitoInputPort4 + 3, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , TaitoInputPort4 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , TaitoInputPort4 + 5, "p4 fire 2" }, - {"P4 Fire 3" , BIT_DIGITAL , TaitoInputPort4 + 6, "p4 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort2 + 1, "service" }, - {"Service 2" , BIT_DIGITAL , TaitoInputPort5 + 2, "service 2" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Growl) - -static struct BurnInputInfo GunfrontInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Gunfront) - -static struct BurnInputInfo KoshienInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , TC0510NIOInputPort2 + 4, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0510NIOInputPort2 + 5, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0510NIOInputPort2 + 6, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0510NIOInputPort2 + 7, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Koshien) - -static struct BurnInputInfo LiquidkInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Liquidk) - -static struct BurnInputInfo MegablstInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Megablst) - -static struct BurnInputInfo MetalbInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Metalb) - -static struct BurnInputInfo MjnquestInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort5 + 1, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 5, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort4 + 1, "p2 coin" }, - - {"Mahjong A" , BIT_DIGITAL , TaitoInputPort0 + 0, "mah a" }, - {"Mahjong B" , BIT_DIGITAL , TaitoInputPort1 + 0, "mah b" }, - {"Mahjong C" , BIT_DIGITAL , TaitoInputPort2 + 0, "mah c" }, - {"Mahjong D" , BIT_DIGITAL , TaitoInputPort3 + 0, "mah d" }, - {"Mahjong E" , BIT_DIGITAL , TaitoInputPort0 + 1, "mah e" }, - {"Mahjong F" , BIT_DIGITAL , TaitoInputPort1 + 1, "mah f" }, - {"Mahjong G" , BIT_DIGITAL , TaitoInputPort2 + 1, "mah g" }, - {"Mahjong H" , BIT_DIGITAL , TaitoInputPort3 + 1, "mah h" }, - {"Mahjong I" , BIT_DIGITAL , TaitoInputPort0 + 2, "mah i" }, - {"Mahjong J" , BIT_DIGITAL , TaitoInputPort1 + 2, "mah j" }, - {"Mahjong K" , BIT_DIGITAL , TaitoInputPort2 + 2, "mah k" }, - {"Mahjong L" , BIT_DIGITAL , TaitoInputPort3 + 2, "mah l" }, - {"Mahjong M" , BIT_DIGITAL , TaitoInputPort0 + 3, "mah m" }, - {"Mahjong N" , BIT_DIGITAL , TaitoInputPort1 + 3, "mah n" }, - {"Mahjong Kan" , BIT_DIGITAL , TaitoInputPort0 + 4, "mah kan" }, - {"Mahjong Pon" , BIT_DIGITAL , TaitoInputPort3 + 3, "mah pon" }, - {"Mahjong Chi" , BIT_DIGITAL , TaitoInputPort2 + 3, "mah chi" }, - {"Mahjong Reach" , BIT_DIGITAL , TaitoInputPort1 + 4, "mah reach" }, - {"Mahjong Ron" , BIT_DIGITAL , TaitoInputPort2 + 4, "mah ron" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort5 + 0, "service" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort4 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Mjnquest) - -static struct BurnInputInfo NinjakInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort2 + 4, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort2 + 5, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort1 + 7, "p2 start" }, - {"Coin 3" , BIT_DIGITAL , TaitoInputPort2 + 6, "p3 coin" }, - {"Start 3" , BIT_DIGITAL , TaitoInputPort3 + 7, "p3 start" }, - {"Coin 4" , BIT_DIGITAL , TaitoInputPort2 + 7, "p4 coin" }, - {"Start 4" , BIT_DIGITAL , TaitoInputPort4 + 7, "p4 start" }, - - {"P1 Up" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TaitoInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TaitoInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TaitoInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TaitoInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TaitoInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 5, "p2 fire 2" }, - - {"P3 Up" , BIT_DIGITAL , TaitoInputPort3 + 0, "p3 up" }, - {"P3 Down" , BIT_DIGITAL , TaitoInputPort3 + 1, "p3 down" }, - {"P3 Left" , BIT_DIGITAL , TaitoInputPort3 + 2, "p3 left" }, - {"P3 Right" , BIT_DIGITAL , TaitoInputPort3 + 3, "p3 right" }, - {"P3 Fire 1" , BIT_DIGITAL , TaitoInputPort3 + 4, "p3 fire 1" }, - {"P3 Fire 2" , BIT_DIGITAL , TaitoInputPort3 + 5, "p3 fire 2" }, - - {"P4 Up" , BIT_DIGITAL , TaitoInputPort4 + 0, "p4 up" }, - {"P4 Down" , BIT_DIGITAL , TaitoInputPort4 + 1, "p4 down" }, - {"P4 Left" , BIT_DIGITAL , TaitoInputPort4 + 2, "p4 left" }, - {"P4 Right" , BIT_DIGITAL , TaitoInputPort4 + 3, "p4 right" }, - {"P4 Fire 1" , BIT_DIGITAL , TaitoInputPort4 + 4, "p4 fire 1" }, - {"P4 Fire 2" , BIT_DIGITAL , TaitoInputPort4 + 5, "p4 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort2 + 1, "service" }, - {"Service 2" , BIT_DIGITAL , TaitoInputPort2 + 2, "service 2" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Ninjak) - -static struct BurnInputInfo PulirulaInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Pulirula) - -static struct BurnInputInfo QcrayonInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 5" }, - - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 fire 4" }, - {"P2 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 fire 5" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Qcrayon) - -static struct BurnInputInfo Qcrayon2InputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Qcrayon2) - -static struct BurnInputInfo QjinseiInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 5" }, - - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 fire 4" }, - {"P2 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 fire 5" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Qjinsei) - -static struct BurnInputInfo QtorimonInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p2 start" }, - - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 fire 4" }, - - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p2 fire 4" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Qtorimon) - -static struct BurnInputInfo QuizhqInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort1 + 7, "p2 start" }, - - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TaitoInputPort0 + 3, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , TaitoInputPort0 + 2, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , TaitoInputPort0 + 4, "p1 fire 5" }, - - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TaitoInputPort1 + 3, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , TaitoInputPort1 + 2, "p2 fire 4" }, - {"P2 Fire 5" , BIT_DIGITAL , TaitoInputPort1 + 4, "p2 fire 5" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Quizhq) - -static struct BurnInputInfo QzchikyuInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 5" }, - - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 fire 4" }, - {"P2 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p2 fire 5" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Qzchikyu) - -static struct BurnInputInfo QzquestInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 5" }, - - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 fire 4" }, - {"P2 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p2 fire 5" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Qzquest) - -static struct BurnInputInfo SolfigtrInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TaitoInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TaitoInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TaitoInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , TaitoInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TaitoInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TaitoInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TaitoInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Solfigtr) - -static struct BurnInputInfo SsiInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Ssi) - -static struct BurnInputInfo ThundfoxInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0220IOCInputPort0 + 6, "p1 fire 3" }, - - {"P2 Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0220IOCInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Thundfox) - -static struct BurnInputInfo YesnojInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort1 + 2, "p1 coin" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort1 + 3, "p2 coin" }, - - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 1, "p1 fire 2" }, - - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 2, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 3, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort1 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort1 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Yesnoj) - -static struct BurnInputInfo YuyugogoInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort2 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort2 + 3, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 7, "p2 start" }, - - {"P1 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 0, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 fire 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p1 fire 3" }, - {"P1 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "p1 fire 5" }, - - {"P2 Fire 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p2 fire 3" }, - {"P2 Fire 4" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p2 fire 4" }, - {"P2 Fire 5" , BIT_DIGITAL , TC0510NIOInputPort1 + 4, "p2 fire 5" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort2 + 1, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Yuyugogo) - -#undef A - -static void TC0220IOCMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0xff; - TC0220IOCInput[1] = 0xff; - TC0220IOCInput[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - TC0220IOCInput[0] -= (TC0220IOCInputPort0[i] & 1) << i; - TC0220IOCInput[1] -= (TC0220IOCInputPort1[i] & 1) << i; - TC0220IOCInput[2] -= (TC0220IOCInputPort2[i] & 1) << i; - } -} - -static void TC0510NIOMakeInputs() -{ - // Reset Inputs - TC0510NIOInput[0] = 0xff; - TC0510NIOInput[1] = 0xff; - TC0510NIOInput[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - TC0510NIOInput[0] -= (TC0510NIOInputPort0[i] & 1) << i; - TC0510NIOInput[1] -= (TC0510NIOInputPort1[i] & 1) << i; - TC0510NIOInput[2] -= (TC0510NIOInputPort2[i] & 1) << i; - } -} - -static void TaitoF2MakeInputs() -{ - // Reset Inputs - TaitoInput[0] = 0xff; - TaitoInput[1] = 0xff; - TaitoInput[2] = 0xff; - TaitoInput[3] = 0xff; - TaitoInput[4] = 0xff; - TaitoInput[5] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - TaitoInput[0] -= (TaitoInputPort0[i] & 1) << i; - TaitoInput[1] -= (TaitoInputPort1[i] & 1) << i; - TaitoInput[2] -= (TaitoInputPort2[i] & 1) << i; - TaitoInput[3] -= (TaitoInputPort3[i] & 1) << i; - TaitoInput[4] -= (TaitoInputPort4[i] & 1) << i; - TaitoInput[5] -= (TaitoInputPort5[i] & 1) << i; - } -} - -static struct BurnDIPInfo CameltryDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xfe, NULL }, - {0x0c, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x01, 0x00, "Upright" }, - {0x0b, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0b, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x0b, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0xc0, 0xc0, "Same as start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Medium" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Start remain time" }, - {0x0c, 0x01, 0x0c, 0x00, "35" }, - {0x0c, 0x01, 0x0c, 0x04, "40" }, - {0x0c, 0x01, 0x0c, 0x0c, "50" }, - {0x0c, 0x01, 0x0c, 0x08, "60" }, - - {0 , 0xfe, 0 , 4 , "Continue play time" }, - {0x0c, 0x01, 0x30, 0x00, "+20" }, - {0x0c, 0x01, 0x30, 0x10, "+25" }, - {0x0c, 0x01, 0x30, 0x30, "+30" }, - {0x0c, 0x01, 0x30, 0x20, "+40" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x0c, 0x01, 0x80, 0x80, "Single" }, - {0x0c, 0x01, 0x80, 0x00, "Dual" }, -}; - -STDDIPINFO(Cameltry) - -static struct BurnDIPInfo CameltrjDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xfe, NULL }, - {0x0c, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x01, 0x00, "Upright" }, - {0x0b, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0b, 0x01, 0x02, 0x02, "Off" }, - {0x0b, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0b, 0x01, 0x30, 0x00, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0b, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0b, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Medium" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Start remain time" }, - {0x0c, 0x01, 0x0c, 0x00, "35" }, - {0x0c, 0x01, 0x0c, 0x04, "40" }, - {0x0c, 0x01, 0x0c, 0x0c, "50" }, - {0x0c, 0x01, 0x0c, 0x08, "60" }, - - {0 , 0xfe, 0 , 4 , "Continue play time" }, - {0x0c, 0x01, 0x30, 0x00, "+20" }, - {0x0c, 0x01, 0x30, 0x10, "+25" }, - {0x0c, 0x01, 0x30, 0x30, "+30" }, - {0x0c, 0x01, 0x30, 0x20, "+40" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x0c, 0x01, 0x80, 0x80, "Single" }, - {0x0c, 0x01, 0x80, 0x00, "Dual" }, -}; - -STDDIPINFO(Cameltrj) - -static struct BurnDIPInfo DeadconxDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfe, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x15, 0x01, 0x01, 0x00, "Upright" }, - {0x15, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Damage" }, - {0x16, 0x01, 0x18, 0x10, "Small" }, - {0x16, 0x01, 0x18, 0x18, "Normal" }, - {0x16, 0x01, 0x18, 0x08, "Big" }, - {0x16, 0x01, 0x18, 0x00, "Biggest" }, - - {0 , 0xfe, 0 , 2 , "Game Type" }, - {0x16, 0x01, 0x80, 0x00, "1 Player Only" }, - {0x16, 0x01, 0x80, 0x80, "Multiplayer" }, -}; - -STDDIPINFO(Deadconx) - -static struct BurnDIPInfo DeadconxjDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfe, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x15, 0x01, 0x01, 0x00, "Upright" }, - {0x15, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x0c, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x03, 0x02, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Damage" }, - {0x16, 0x01, 0x18, 0x10, "Small" }, - {0x16, 0x01, 0x18, 0x18, "Normal" }, - {0x16, 0x01, 0x18, 0x08, "Big" }, - {0x16, 0x01, 0x18, 0x00, "Biggest" }, - - {0 , 0xfe, 0 , 2 , "Game Type" }, - {0x16, 0x01, 0x80, 0x00, "1 Player Only" }, - {0x16, 0x01, 0x80, 0x80, "Multiplayer" }, -}; - -STDDIPINFO(Deadconxj) - -static struct BurnDIPInfo DinorexDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Damage" }, - {0x16, 0x01, 0x0c, 0x08, "Small" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Big" }, - {0x16, 0x01, 0x0c, 0x00, "Biggest" }, - - {0 , 0xfe, 0 , 2 , "Timer Speed" }, - {0x16, 0x01, 0x10, 0x10, "Normal" }, - {0x16, 0x01, 0x10, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Match Type" }, - {0x16, 0x01, 0x20, 0x20, "Best of 3" }, - {0x16, 0x01, 0x20, 0x00, "Single" }, - - {0 , 0xfe, 0 , 2 , "2 Player Mode" }, - {0x16, 0x01, 0x40, 0x40, "Upright" }, - {0x16, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Dinorex) - -static struct BurnDIPInfo DinorexjDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x0c, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x03, 0x02, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Damage" }, - {0x16, 0x01, 0x0c, 0x08, "Small" }, - {0x16, 0x01, 0x0c, 0x0c, "Normal" }, - {0x16, 0x01, 0x0c, 0x04, "Big" }, - {0x16, 0x01, 0x0c, 0x00, "Biggest" }, - - {0 , 0xfe, 0 , 2 , "Timer Speed" }, - {0x16, 0x01, 0x10, 0x10, "Normal" }, - {0x16, 0x01, 0x10, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Match Type" }, - {0x16, 0x01, 0x20, 0x20, "Best of 3" }, - {0x16, 0x01, 0x20, 0x00, "Single" }, - - {0 , 0xfe, 0 , 2 , "2 Player Mode" }, - {0x16, 0x01, 0x40, 0x40, "Upright" }, - {0x16, 0x01, 0x40, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Dinorexj) - -static struct BurnDIPInfo DondokodDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "10k and 100k" }, - {0x14, 0x01, 0x0c, 0x08, "10k and 150k" }, - {0x14, 0x01, 0x0c, 0x04, "10k and 250k" }, - {0x14, 0x01, 0x0c, 0x00, "10k and 350k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, -}; - -STDDIPINFO(Dondokod) - -static struct BurnDIPInfo DondokodjDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "10k and 100k" }, - {0x14, 0x01, 0x0c, 0x08, "10k and 150k" }, - {0x14, 0x01, 0x0c, 0x04, "10k and 250k" }, - {0x14, 0x01, 0x0c, 0x00, "10k and 350k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, -}; - -STDDIPINFO(Dondokodj) - -static struct BurnDIPInfo DondokoduDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "Same as start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "10k and 100k" }, - {0x14, 0x01, 0x0c, 0x08, "10k and 150k" }, - {0x14, 0x01, 0x0c, 0x04, "10k and 250k" }, - {0x14, 0x01, 0x0c, 0x00, "10k and 350k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, -}; - -STDDIPINFO(Dondokodu) - -static struct BurnDIPInfo DriftoutDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0c, 0x01, 0x02, 0x02, "Off" }, - {0x0c, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x08, 0x00, "Off" }, - {0x0c, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0c, 0x01, 0x30, 0x00, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0c, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0d, 0x01, 0x03, 0x02, "Easy" }, - {0x0d, 0x01, 0x03, 0x03, "Medium" }, - {0x0d, 0x01, 0x03, 0x01, "Hard" }, - {0x0d, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Control" }, - {0x0d, 0x01, 0x0c, 0x0c, "Joystick" }, - {0x0d, 0x01, 0x0c, 0x08, "Paddle" }, - {0x0d, 0x01, 0x0c, 0x04, "Joystick" }, - {0x0d, 0x01, 0x0c, 0x00, "Steering Wheel" }, -}; - -STDDIPINFO(Driftout) - -static struct BurnDIPInfo FinalbDIPList[]= -{ - // Default Values - {0x19, 0xff, 0xff, 0xff, NULL }, - {0x1a, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Alternate Controls" }, - {0x19, 0x01, 0x01, 0x01, "Off" }, - {0x19, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x19, 0x01, 0x02, 0x02, "Off" }, - {0x19, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x19, 0x01, 0x04, 0x04, "Off" }, - {0x19, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x19, 0x01, 0x08, 0x00, "Off" }, - {0x19, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x19, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x19, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x19, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x19, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x19, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x19, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x19, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x19, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1a, 0x01, 0x03, 0x02, "Easy" }, - {0x1a, 0x01, 0x03, 0x03, "Medium" }, - {0x1a, 0x01, 0x03, 0x01, "Hard" }, - {0x1a, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Finalb) - -static struct BurnDIPInfo FinalbjDIPList[]= -{ - // Default Values - {0x19, 0xff, 0xff, 0xff, NULL }, - {0x1a, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Alternate Controls" }, - {0x19, 0x01, 0x01, 0x01, "Off" }, - {0x19, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x19, 0x01, 0x02, 0x02, "Off" }, - {0x19, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x19, 0x01, 0x04, 0x04, "Off" }, - {0x19, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x19, 0x01, 0x08, 0x00, "Off" }, - {0x19, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x19, 0x01, 0x30, 0x00, "2 Coins 1 Credit" }, - {0x19, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x19, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x19, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x19, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x19, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x19, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x19, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1a, 0x01, 0x03, 0x02, "Easy" }, - {0x1a, 0x01, 0x03, 0x03, "Medium" }, - {0x1a, 0x01, 0x03, 0x01, "Hard" }, - {0x1a, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Finalbj) - -static struct BurnDIPInfo FootchmpDIPList[]= -{ - // Default Values - {0x25, 0xff, 0xff, 0xfe, NULL }, - {0x26, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Game Over Type" }, - {0x25, 0x01, 0x01, 0x01, "Both Teams' Games Over" }, - {0x25, 0x01, 0x01, 0x00, "Losing Team's Game is Over" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x25, 0x01, 0x02, 0x02, "Off" }, - {0x25, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x25, 0x01, 0x04, 0x04, "Off" }, - {0x25, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x25, 0x01, 0x08, 0x00, "Off" }, - {0x25, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x25, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x25, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x25, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x25, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x25, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x25, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x25, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x25, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x26, 0x01, 0x03, 0x02, "Easy" }, - {0x26, 0x01, 0x03, 0x03, "Normal" }, - {0x26, 0x01, 0x03, 0x01, "Hard" }, - {0x26, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Game Time" }, - {0x26, 0x01, 0x0c, 0x00, "1 minute 30 seconds" }, - {0x26, 0x01, 0x0c, 0x0c, "2 minutes" }, - {0x26, 0x01, 0x0c, 0x04, "2 minutes 30 seconds" }, - {0x26, 0x01, 0x0c, 0x08, "3 minutes" }, - - {0 , 0xfe, 0 , 4 , "Cabinet" }, - {0x26, 0x01, 0x30, 0x30, "2 Players" }, - {0x26, 0x01, 0x30, 0x20, "4 Players / 4 Coin Slots" }, - {0x26, 0x01, 0x30, 0x10, "4 Players / 2 Cabinets Combined"}, - {0x26, 0x01, 0x30, 0x00, "4 Players / 2 Coin Slots" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x26, 0x01, 0x40, 0x00, "Off" }, - {0x26, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Version" }, - {0x26, 0x01, 0x80, 0x00, "Normal" }, - {0x26, 0x01, 0x80, 0x80, "European" }, - -}; - -STDDIPINFO(Footchmp) - -static struct BurnDIPInfo HtheroDIPList[]= -{ - // Default Values - {0x25, 0xff, 0xff, 0x7f, NULL }, - {0x26, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Game Over Type" }, - {0x25, 0x01, 0x80, 0x80, "Both Teams' Games Over" }, - {0x25, 0x01, 0x80, 0x00, "Losing Team's Game is Over" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x25, 0x01, 0x40, 0x40, "Off" }, - {0x25, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x25, 0x01, 0x20, 0x20, "Off" }, - {0x25, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x25, 0x01, 0x10, 0x00, "Off" }, - {0x25, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x25, 0x01, 0x0c, 0x00, "3 Coins 1 Credit" }, - {0x25, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x25, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x25, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x25, 0x01, 0x03, 0x00, "3 Coins 1 Credit" }, - {0x25, 0x01, 0x03, 0x02, "2 Coins 1 Credit" }, - {0x25, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x25, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x26, 0x01, 0xc0, 0x40, "Easy" }, - {0x26, 0x01, 0xc0, 0xc0, "Normal" }, - {0x26, 0x01, 0xc0, 0x80, "Hard" }, - {0x26, 0x01, 0xc0, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Game Time" }, - {0x26, 0x01, 0x30, 0x00, "1 minute 30 seconds" }, - {0x26, 0x01, 0x30, 0x30, "2 minutes" }, - {0x26, 0x01, 0x30, 0x20, "2 minutes 30 seconds" }, - {0x26, 0x01, 0x30, 0x10, "3 minutes" }, - - {0 , 0xfe, 0 , 4 , "Cabinet" }, - {0x26, 0x01, 0x0c, 0x0c, "2 Players" }, - {0x26, 0x01, 0x0c, 0x04, "4 Players / 4 Coin Slots" }, - {0x26, 0x01, 0x0c, 0x08, "4 Players / 2 Cabinets Combined"}, - {0x26, 0x01, 0x0c, 0x00, "4 Players / 2 Coin Slots" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x26, 0x01, 0x02, 0x00, "Off" }, - {0x26, 0x01, 0x02, 0x02, "On" }, -}; - -STDDIPINFO(Hthero) - -static struct BurnDIPInfo GrowlDIPList[]= -{ - // Default Values - {0x28, 0xff, 0xff, 0xff, NULL }, - {0x29, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x28, 0x01, 0x02, 0x02, "Off" }, - {0x28, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x28, 0x01, 0x04, 0x04, "Off" }, - {0x28, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x28, 0x01, 0x08, 0x00, "Off" }, - {0x28, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x28, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x28, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x28, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x28, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x28, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x28, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x28, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x28, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x29, 0x01, 0x03, 0x02, "Easy" }, - {0x29, 0x01, 0x03, 0x03, "Normal" }, - {0x29, 0x01, 0x03, 0x01, "Hard" }, - {0x29, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Cabinet Type" }, - {0x29, 0x01, 0x30, 0x30, "2 Players" }, - {0x29, 0x01, 0x30, 0x20, "4 Players / 4 Coin Slots" }, - {0x29, 0x01, 0x30, 0x10, "4 Players / 2 Cabinets Combined"}, - {0x29, 0x01, 0x30, 0x00, "4 Players / 2 Coin Slots" }, - - {0 , 0xfe, 0 , 2 , "Final Boss Continue" }, - {0x29, 0x01, 0x40, 0x00, "Off" }, - {0x29, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Growl) - -static struct BurnDIPInfo GrowluDIPList[]= -{ - // Default Values - {0x28, 0xff, 0xff, 0xff, NULL }, - {0x29, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x28, 0x01, 0x02, 0x02, "Off" }, - {0x28, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x28, 0x01, 0x04, 0x04, "Off" }, - {0x28, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x28, 0x01, 0x08, 0x00, "Off" }, - {0x28, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x28, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x28, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x28, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x28, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x28, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x28, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x28, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x28, 0x01, 0xc0, 0xc0, "Same as start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x29, 0x01, 0x03, 0x02, "Easy" }, - {0x29, 0x01, 0x03, 0x03, "Normal" }, - {0x29, 0x01, 0x03, 0x01, "Hard" }, - {0x29, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Cabinet Type" }, - {0x29, 0x01, 0x30, 0x30, "2 Players" }, - {0x29, 0x01, 0x30, 0x20, "4 Players / 4 Coin Slots" }, - {0x29, 0x01, 0x30, 0x10, "4 Players / 2 Cabinets Combined"}, - {0x29, 0x01, 0x30, 0x00, "4 Players / 2 Coin Slots" }, - - {0 , 0xfe, 0 , 2 , "Final Boss Continue" }, - {0x29, 0x01, 0x40, 0x00, "Off" }, - {0x29, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Growlu) - -static struct BurnDIPInfo RunarkDIPList[]= -{ - // Default Values - {0x28, 0xff, 0xff, 0xff, NULL }, - {0x29, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x28, 0x01, 0x02, 0x02, "Off" }, - {0x28, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x28, 0x01, 0x04, 0x04, "Off" }, - {0x28, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x28, 0x01, 0x08, 0x00, "Off" }, - {0x28, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x28, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x28, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x28, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x28, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x28, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x28, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x28, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x28, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x29, 0x01, 0x03, 0x02, "Easy" }, - {0x29, 0x01, 0x03, 0x03, "Normal" }, - {0x29, 0x01, 0x03, 0x01, "Hard" }, - {0x29, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Cabinet Type" }, - {0x29, 0x01, 0x30, 0x30, "2 Players" }, - {0x29, 0x01, 0x30, 0x20, "4 Players / 4 Coin Slots" }, - {0x29, 0x01, 0x30, 0x10, "4 Players / 2 Cabinets Combined"}, - {0x29, 0x01, 0x30, 0x00, "4 Players / 2 Coin Slots" }, - - {0 , 0xfe, 0 , 2 , "Final Boss Continue" }, - {0x29, 0x01, 0x40, 0x00, "Off" }, - {0x29, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Runark) - -static struct BurnDIPInfo GunfrontDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "10k and every 80k" }, - {0x14, 0x01, 0x0c, 0x0c, "20k and every 80k" }, - {0x14, 0x01, 0x0c, 0x04, "30k and every 80k" }, - {0x14, 0x01, 0x0c, 0x00, "60k and every 80k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x14, 0x01, 0x80, 0x00, "Single" }, - {0x14, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Gunfront) - -static struct BurnDIPInfo GunfrontjDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "10k and every 80k" }, - {0x14, 0x01, 0x0c, 0x0c, "20k and every 80k" }, - {0x14, 0x01, 0x0c, 0x04, "30k and every 80k" }, - {0x14, 0x01, 0x0c, 0x00, "60k and every 80k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "1" }, - {0x14, 0x01, 0x30, 0x10, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x14, 0x01, 0x80, 0x00, "Single" }, - {0x14, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Gunfrontj) - -static struct BurnDIPInfo KoshienDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Timer" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x20, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Koshien) - -static struct BurnDIPInfo LiquidkDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "30k and 100k" }, - {0x14, 0x01, 0x0c, 0x08, "30k and 150k" }, - {0x14, 0x01, 0x0c, 0x04, "50k and 250k" }, - {0x14, 0x01, 0x0c, 0x00, "50k and 350k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x14, 0x01, 0x80, 0x80, "Single" }, - {0x14, 0x01, 0x80, 0x00, "Dual" }, -}; - -STDDIPINFO(Liquidk) - -static struct BurnDIPInfo LiquidkuDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "Same as start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "30k and 100k" }, - {0x14, 0x01, 0x0c, 0x08, "30k and 150k" }, - {0x14, 0x01, 0x0c, 0x04, "50k and 250k" }, - {0x14, 0x01, 0x0c, 0x00, "50k and 350k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x14, 0x01, 0x80, 0x80, "Single" }, - {0x14, 0x01, 0x80, 0x00, "Dual" }, -}; - -STDDIPINFO(Liquidku) - -static struct BurnDIPInfo MegablstDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "100k only" }, - {0x14, 0x01, 0x0c, 0x04, "150k only" }, - {0x14, 0x01, 0x0c, 0x08, "200k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x14, 0x01, 0x40, 0x00, "Single" }, - {0x14, 0x01, 0x40, 0x40, "Dual" }, -}; - -STDDIPINFO(Megablst) - -static struct BurnDIPInfo MegablstjDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "100k only" }, - {0x14, 0x01, 0x0c, 0x04, "150k only" }, - {0x14, 0x01, 0x0c, 0x08, "200k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x14, 0x01, 0x40, 0x00, "Single" }, - {0x14, 0x01, 0x40, 0x40, "Dual" }, -}; - -STDDIPINFO(Megablstj) - -static struct BurnDIPInfo MegablstuDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "Same as start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "100k only" }, - {0x14, 0x01, 0x0c, 0x04, "150k only" }, - {0x14, 0x01, 0x0c, 0x08, "200k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x00, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x14, 0x01, 0x40, 0x00, "Single" }, - {0x14, 0x01, 0x40, 0x40, "Dual" }, -}; - -STDDIPINFO(Megablstu) - -static struct BurnDIPInfo MetalbDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x08, "50k and every 120k" }, - {0x16, 0x01, 0x0c, 0x0c, "70k and every 150k" }, - {0x16, 0x01, 0x0c, 0x04, "80k and every 160k" }, - {0x16, 0x01, 0x0c, 0x00, "100k and every 200k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x00, "1" }, - {0x16, 0x01, 0x30, 0x10, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Metalb) - -static struct BurnDIPInfo MetalbjDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x08, "50k and every 120k" }, - {0x16, 0x01, 0x0c, 0x0c, "70k and every 150k" }, - {0x16, 0x01, 0x0c, 0x04, "80k and every 160k" }, - {0x16, 0x01, 0x0c, 0x00, "100k and every 200k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x00, "1" }, - {0x16, 0x01, 0x30, 0x10, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Metalbj) - -static struct BurnDIPInfo MjnquestDIPList[]= -{ - // Default Values - {0x19, 0xff, 0xff, 0xff, NULL }, - {0x1a, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x19, 0x01, 0x02, 0x02, "Off" }, - {0x19, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x19, 0x01, 0x04, 0x04, "Off" }, - {0x19, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x19, 0x01, 0x08, 0x00, "Off" }, - {0x19, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x19, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x19, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x19, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x19, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x19, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x19, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x19, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x19, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x1a, 0x01, 0x03, 0x02, "Easy" }, - {0x1a, 0x01, 0x03, 0x03, "Medium" }, - {0x1a, 0x01, 0x03, 0x01, "Hard" }, - {0x1a, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Mjnquest) - -static struct BurnDIPInfo NinjakDIPList[]= -{ - // Default Values - {0x24, 0xff, 0xff, 0xff, NULL }, - {0x25, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x24, 0x01, 0x02, 0x02, "Off" }, - {0x24, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x24, 0x01, 0x04, 0x04, "Off" }, - {0x24, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x24, 0x01, 0x08, 0x00, "Off" }, - {0x24, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x24, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x24, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x24, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x24, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x24, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x24, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x24, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x24, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x25, 0x01, 0x03, 0x02, "Easy" }, - {0x25, 0x01, 0x03, 0x03, "Medium" }, - {0x25, 0x01, 0x03, 0x01, "Hard" }, - {0x25, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Cabinet Type" }, - {0x25, 0x01, 0x0c, 0x0c, "2 Players" }, - {0x25, 0x01, 0x0c, 0x08, "TROG (4 Players / 2 Coin Slots" }, - {0x25, 0x01, 0x0c, 0x04, "MTX2 (4 Players / 2 Cabinets" }, - {0x25, 0x01, 0x0c, 0x00, "YMNT (4 Players / 4 Coin Slots" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x25, 0x01, 0x30, 0x20, "2" }, - {0x25, 0x01, 0x30, 0x30, "3" }, - {0x25, 0x01, 0x30, 0x10, "4" }, - {0x25, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x25, 0x01, 0x40, 0x00, "Off" }, - {0x25, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Type" }, - {0x25, 0x01, 0x80, 0x00, "1 Player Only" }, - {0x25, 0x01, 0x80, 0x80, "Multiplayer" }, -}; - -STDDIPINFO(Ninjak) - -static struct BurnDIPInfo NinjakjDIPList[]= -{ - // Default Values - {0x24, 0xff, 0xff, 0xff, NULL }, - {0x25, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x24, 0x01, 0x02, 0x02, "Off" }, - {0x24, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x24, 0x01, 0x04, 0x04, "Off" }, - {0x24, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x24, 0x01, 0x08, 0x00, "Off" }, - {0x24, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x24, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x24, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x24, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x24, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x24, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x24, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x24, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x24, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x25, 0x01, 0x03, 0x02, "Easy" }, - {0x25, 0x01, 0x03, 0x03, "Medium" }, - {0x25, 0x01, 0x03, 0x01, "Hard" }, - {0x25, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Cabinet Type" }, - {0x25, 0x01, 0x0c, 0x0c, "2 Players" }, - {0x25, 0x01, 0x0c, 0x08, "TROG (4 Players / 2 Coin Slots" }, - {0x25, 0x01, 0x0c, 0x04, "MTX2 (4 Players / 2 Cabinets" }, - {0x25, 0x01, 0x0c, 0x00, "YMNT (4 Players / 4 Coin Slots" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x25, 0x01, 0x30, 0x20, "2" }, - {0x25, 0x01, 0x30, 0x30, "3" }, - {0x25, 0x01, 0x30, 0x10, "4" }, - {0x25, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x25, 0x01, 0x40, 0x00, "Off" }, - {0x25, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Type" }, - {0x25, 0x01, 0x80, 0x00, "1 Player Only" }, - {0x25, 0x01, 0x80, 0x80, "Multiplayer" }, -}; - -STDDIPINFO(Ninjakj) - -static struct BurnDIPInfo NinjakuDIPList[]= -{ - // Default Values - {0x24, 0xff, 0xff, 0xff, NULL }, - {0x25, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x24, 0x01, 0x02, 0x02, "Off" }, - {0x24, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x24, 0x01, 0x04, 0x04, "Off" }, - {0x24, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x24, 0x01, 0x08, 0x00, "Off" }, - {0x24, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x24, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x24, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x24, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x24, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x24, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x24, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x24, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x24, 0x01, 0xc0, 0xc0, "Same as start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x25, 0x01, 0x03, 0x02, "Easy" }, - {0x25, 0x01, 0x03, 0x03, "Medium" }, - {0x25, 0x01, 0x03, 0x01, "Hard" }, - {0x25, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Cabinet Type" }, - {0x25, 0x01, 0x0c, 0x0c, "2 Players" }, - {0x25, 0x01, 0x0c, 0x08, "TROG (4 Players / 2 Coin Slots" }, - {0x25, 0x01, 0x0c, 0x04, "MTX2 (4 Players / 2 Cabinets" }, - {0x25, 0x01, 0x0c, 0x00, "YMNT (4 Players / 4 Coin Slots" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x25, 0x01, 0x30, 0x20, "2" }, - {0x25, 0x01, 0x30, 0x30, "3" }, - {0x25, 0x01, 0x30, 0x10, "4" }, - {0x25, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x25, 0x01, 0x40, 0x00, "Off" }, - {0x25, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Game Type" }, - {0x25, 0x01, 0x80, 0x00, "1 Player Only" }, - {0x25, 0x01, 0x80, 0x80, "Multiplayer" }, -}; - -STDDIPINFO(Ninjaku) - -static struct BurnDIPInfo PulirulaDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 3 , "Magic" }, - {0x16, 0x01, 0x0c, 0x0c, "3" }, - {0x16, 0x01, 0x0c, 0x08, "4" }, - {0x16, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x20, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Pulirula) - -static struct BurnDIPInfo PulirulajDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 3 , "Magic" }, - {0x16, 0x01, 0x0c, 0x0c, "3" }, - {0x16, 0x01, 0x0c, 0x08, "4" }, - {0x16, 0x01, 0x0c, 0x04, "5" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x20, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Pulirulaj) - -static struct BurnDIPInfo QcrayonDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Default Time" }, - {0x12, 0x01, 0x0c, 0x00, "6 seconds" }, - {0x12, 0x01, 0x0c, 0x04, "7 seconds" }, - {0x12, 0x01, 0x0c, 0x08, "8 seconds" }, - {0x12, 0x01, 0x0c, 0x0c, "10 seconds" }, -}; - -STDDIPINFO(Qcrayon) - -static struct BurnDIPInfo Qcrayon2DIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Game Control" }, - {0x12, 0x01, 0x80, 0x80, "Joystick" }, - {0x12, 0x01, 0x80, 0x00, "4 Buttons" }, -}; - -STDDIPINFO(Qcrayon2) - -static struct BurnDIPInfo QjinseiDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Qjinsei) - -static struct BurnDIPInfo QtorimonDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0f, 0x01, 0x30, 0x00, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0x03, 0x02, "Easy" }, - {0x10, 0x01, 0x03, 0x03, "Medium" }, - {0x10, 0x01, 0x03, 0x01, "Hard" }, - {0x10, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x30, 0x10, "1" }, - {0x10, 0x01, 0x30, 0x20, "2" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2 , "Show Correct Answer" }, - {0x10, 0x01, 0x40, 0x40, "Off" }, - {0x10, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Qtorimon) - -static struct BurnDIPInfo QuizhqDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Time" }, - {0x12, 0x01, 0x0c, 0x0c, "5 seconds" }, - {0x12, 0x01, 0x0c, 0x08, "10 seconds" }, - {0x12, 0x01, 0x0c, 0x04, "15 seconds" }, - {0x12, 0x01, 0x0c, 0x00, "20 seconds" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x12, 0x01, 0x30, 0x20, "1" }, - {0x12, 0x01, 0x30, 0x30, "2" }, - {0x12, 0x01, 0x30, 0x10, "3" }, - {0x12, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x12, 0x01, 0x80, 0x00, "Single" }, - {0x12, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Quizhq) - -static struct BurnDIPInfo QzchikyuDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, - {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Qzchikyu) - -static struct BurnDIPInfo QzquestDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, - {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Qzquest) - -static struct BurnDIPInfo SolfigtrDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Solfigtr) - -static struct BurnDIPInfo SsiDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Shields" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - {0x14, 0x01, 0x0c, 0x0c, "1" }, - {0x14, 0x01, 0x0c, 0x04, "2" }, - {0x14, 0x01, 0x0c, 0x08, "3" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x14, 0x01, 0x10, 0x00, "2" }, - {0x14, 0x01, 0x10, 0x10, "3" }, - - {0 , 0xfe, 0 , 4 , "2 Player Mode" }, - {0x14, 0x01, 0xa0, 0xa0, "Simultaneous" }, - {0x14, 0x01, 0xa0, 0x80, "Alternate, Single" }, - {0x14, 0x01, 0xa0, 0x00, "Alternate, Dual" }, - {0x14, 0x01, 0xa0, 0x20, "Not Allowed" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Ssi) - -static struct BurnDIPInfo Majest12DIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Shields" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - {0x14, 0x01, 0x0c, 0x0c, "1" }, - {0x14, 0x01, 0x0c, 0x04, "2" }, - {0x14, 0x01, 0x0c, 0x08, "3" }, - - {0 , 0xfe, 0 , 2 , "Lives" }, - {0x14, 0x01, 0x10, 0x00, "2" }, - {0x14, 0x01, 0x10, 0x10, "3" }, - - {0 , 0xfe, 0 , 4 , "2 Player Mode" }, - {0x14, 0x01, 0xa0, 0xa0, "Simultaneous" }, - {0x14, 0x01, 0xa0, 0x80, "Alternate, Single" }, - {0x14, 0x01, 0xa0, 0x00, "Alternate, Dual" }, - {0x14, 0x01, 0xa0, 0x20, "Not Allowed" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Majest12) - -static struct BurnDIPInfo ThundfoxDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Timer" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x20, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Thundfox) - -static struct BurnDIPInfo ThundfoxjDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Timer" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x20, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Thundfoxj) - -static struct BurnDIPInfo ThundfoxuDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x15, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x15, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xc0, 0xc0, "Same as start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Timer" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x20, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Upright Controls" }, - {0x16, 0x01, 0x80, 0x00, "Single" }, - {0x16, 0x01, 0x80, 0x80, "Dual" }, -}; - -STDDIPINFO(Thundfoxu) - -static struct BurnDIPInfo YesnojDIPList[]= -{ - // Default Values - {0x09, 0xff, 0xff, 0xff, NULL }, - {0x0a, 0xff, 0xff, 0xfe, NULL }, - - // Dip 1 - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Results Printer" }, - {0x0a, 0x01, 0x01, 0x00, "Off" }, - {0x0a, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x02, 0x00, "Off" }, - {0x0a, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0a, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, -}; - -STDDIPINFO(Yesnoj) - -static struct BurnDIPInfo YuyugogoDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Yuyugogo) - -static struct BurnRomInfo CameltryRomDesc[] = { - { "c38-11", 0x020000, 0xbe172da0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c38-14", 0x020000, 0xffa430de, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c38-08.bin", 0x010000, 0x7ff78873, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c38-01.bin", 0x080000, 0xc170ff36, BRF_GRA | TAITO_SPRITESA }, - - { "c38-03.bin", 0x020000, 0x59fa59a7, BRF_SND | TAITO_YM2610A }, - - { "c38-02.bin", 0x020000, 0x1a11714b, BRF_GRA | TAITO_CHARS_PIVOT }, -}; - -STD_ROM_PICK(Cameltry) -STD_ROM_FN(Cameltry) - -static struct BurnRomInfo CameltryauRomDesc[] = { - { "c38-11", 0x020000, 0xbe172da0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c38-14", 0x020000, 0xffa430de, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c38-15.bin", 0x010000, 0x0e60faac, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c38-01.bin", 0x080000, 0xc170ff36, BRF_GRA | TAITO_SPRITESA }, - - { "c38-02.bin", 0x020000, 0x1a11714b, BRF_GRA | TAITO_CHARS_PIVOT }, - - { "c38-04.bin", 0x020000, 0x53d330bb, BRF_SND | TAITO_MSM6295 }, -}; - -STD_ROM_PICK(Cameltryau) -STD_ROM_FN(Cameltryau) - -static struct BurnRomInfo CameltryaRomDesc[] = { - { "c38-11", 0x020000, 0xbe172da0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c38-16", 0x020000, 0x66ad6164, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c38-15.bin", 0x010000, 0x0e60faac, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c38-01.bin", 0x080000, 0xc170ff36, BRF_GRA | TAITO_SPRITESA }, - - { "c38-02.bin", 0x020000, 0x1a11714b, BRF_GRA | TAITO_CHARS_PIVOT }, - - { "c38-04.bin", 0x020000, 0x53d330bb, BRF_SND | TAITO_MSM6295 }, -}; - -STD_ROM_PICK(Cameltrya) -STD_ROM_FN(Cameltrya) - -static struct BurnRomInfo CameltryjRomDesc[] = { - { "c38-09.bin", 0x020000, 0x2ae01120, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c38-10.bin", 0x020000, 0x48d8ff56, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c38-08.bin", 0x010000, 0x7ff78873, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c38-01.bin", 0x080000, 0xc170ff36, BRF_GRA | TAITO_SPRITESA }, - - { "c38-03.bin", 0x020000, 0x59fa59a7, BRF_SND | TAITO_YM2610A }, - - { "c38-02.bin", 0x020000, 0x1a11714b, BRF_GRA | TAITO_CHARS_PIVOT }, -}; - -STD_ROM_PICK(Cameltryj) -STD_ROM_FN(Cameltryj) - -static struct BurnRomInfo DeadconxRomDesc[] = { - { "d28-06.3", 0x040000, 0x5b4bff51, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d28-12.5", 0x040000, 0x9b74e631, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d28-09.2", 0x040000, 0x143a0cc1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d28-08.4", 0x040000, 0x4c872bd9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "d28-10.6", 0x010000, 0x40805d74, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d28-04.16", 0x080000, 0xdcabc26b, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d28-05.17", 0x080000, 0x862f9665, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d28-01.8", 0x100000, 0x181d7b69, BRF_GRA | TAITO_SPRITESA }, - { "d28-02.9", 0x100000, 0xd301771c, BRF_GRA | TAITO_SPRITESA }, - - { "d28-03.10", 0x100000, 0xa1804b52, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Deadconx) -STD_ROM_FN(Deadconx) - -static struct BurnRomInfo DeadconxjRomDesc[] = { - { "d28-06.3", 0x040000, 0x5b4bff51, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d28-07.5", 0x040000, 0x3fb8954c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d28-09.2", 0x040000, 0x143a0cc1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d28-08.4", 0x040000, 0x4c872bd9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "d28-10.6", 0x010000, 0x40805d74, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d28-04.16", 0x080000, 0xdcabc26b, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d28-05.17", 0x080000, 0x862f9665, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d28-01.8", 0x100000, 0x181d7b69, BRF_GRA | TAITO_SPRITESA }, - { "d28-02.9", 0x100000, 0xd301771c, BRF_GRA | TAITO_SPRITESA }, - - { "d28-03.10", 0x100000, 0xa1804b52, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Deadconxj) -STD_ROM_FN(Deadconxj) - -static struct BurnRomInfo DinorexRomDesc[] = { - { "d39-14.9", 0x080000, 0xe6aafdac, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d39-16.8", 0x080000, 0xcedc8537, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d39-04.6", 0x100000, 0x3800506d, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - { "d39-05.7", 0x100000, 0xe2ec3b5d, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "d39-12.5", 0x010000, 0x8292c7c1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d39-06.2", 0x100000, 0x52f62835, BRF_GRA | TAITO_CHARS }, - - { "d39-01.29", 0x200000, 0xd10e9c7d, BRF_GRA | TAITO_SPRITESA }, - { "d39-02.28", 0x200000, 0x6c304403, BRF_GRA | TAITO_SPRITESA }, - { "d39-03.27", 0x200000, 0xfc9cdab4, BRF_GRA | TAITO_SPRITESA }, - - { "d39-07.10", 0x100000, 0x28262816, BRF_SND | TAITO_YM2610A }, - { "d39-08.4", 0x080000, 0x377b8b7b, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Dinorex) -STD_ROM_FN(Dinorex) - -static struct BurnRomInfo DinorexjRomDesc[] = { - { "d39-14.9", 0x080000, 0xe6aafdac, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d39-13.8", 0x080000, 0xae496b2f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d39-04.6", 0x100000, 0x3800506d, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - { "d39-05.7", 0x100000, 0xe2ec3b5d, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "d39-12.5", 0x010000, 0x8292c7c1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d39-06.2", 0x100000, 0x52f62835, BRF_GRA | TAITO_CHARS }, - - { "d39-01.29", 0x200000, 0xd10e9c7d, BRF_GRA | TAITO_SPRITESA }, - { "d39-02.28", 0x200000, 0x6c304403, BRF_GRA | TAITO_SPRITESA }, - { "d39-03.27", 0x200000, 0xfc9cdab4, BRF_GRA | TAITO_SPRITESA }, - - { "d39-07.10", 0x100000, 0x28262816, BRF_SND | TAITO_YM2610A }, - { "d39-08.4", 0x080000, 0x377b8b7b, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Dinorexj) -STD_ROM_FN(Dinorexj) - -static struct BurnRomInfo DinorexuRomDesc[] = { - { "d39-14.9", 0x080000, 0xe6aafdac, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d39-15.8", 0x080000, 0xfe96723b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d39-04.6", 0x100000, 0x3800506d, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - { "d39-05.7", 0x100000, 0xe2ec3b5d, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "d39-12.5", 0x010000, 0x8292c7c1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d39-06.2", 0x100000, 0x52f62835, BRF_GRA | TAITO_CHARS }, - - { "d39-01.29", 0x200000, 0xd10e9c7d, BRF_GRA | TAITO_SPRITESA }, - { "d39-02.28", 0x200000, 0x6c304403, BRF_GRA | TAITO_SPRITESA }, - { "d39-03.27", 0x200000, 0xfc9cdab4, BRF_GRA | TAITO_SPRITESA }, - - { "d39-07.10", 0x100000, 0x28262816, BRF_SND | TAITO_YM2610A }, - { "d39-08.4", 0x080000, 0x377b8b7b, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Dinorexu) -STD_ROM_FN(Dinorexu) - -static struct BurnRomInfo DondokodRomDesc[] = { - { "b95-12.bin", 0x020000, 0xd0fce87a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b95-11-1.bin", 0x020000, 0xdad40cd3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b95-10.bin", 0x020000, 0xa46e1f0b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b95-14.bin", 0x020000, 0x6e4e1351, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b95-08.bin", 0x010000, 0xb5aa49e1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b95-02.bin", 0x080000, 0x67b4e979, BRF_GRA | TAITO_CHARS }, - - { "b95-01.bin", 0x080000, 0x51c176ce, BRF_GRA | TAITO_SPRITESA }, - - { "b95-04.bin", 0x080000, 0xac4c1716, BRF_SND | TAITO_YM2610A }, - - { "b95-03.bin", 0x080000, 0x543aa0d1, BRF_GRA | TAITO_CHARS_PIVOT }, -}; - -STD_ROM_PICK(Dondokod) -STD_ROM_FN(Dondokod) - -static struct BurnRomInfo DondokodjRomDesc[] = { - { "b95-12.bin", 0x020000, 0xd0fce87a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b95-11-1.bin", 0x020000, 0xdad40cd3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b95-10.bin", 0x020000, 0xa46e1f0b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b95-09.bin", 0x020000, 0xd8c86d39, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b95-08.bin", 0x010000, 0xb5aa49e1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b95-02.bin", 0x080000, 0x67b4e979, BRF_GRA | TAITO_CHARS }, - - { "b95-01.bin", 0x080000, 0x51c176ce, BRF_GRA | TAITO_SPRITESA }, - - { "b95-04.bin", 0x080000, 0xac4c1716, BRF_SND | TAITO_YM2610A }, - - { "b95-03.bin", 0x080000, 0x543aa0d1, BRF_GRA | TAITO_CHARS_PIVOT }, -}; - -STD_ROM_PICK(Dondokodj) -STD_ROM_FN(Dondokodj) - -static struct BurnRomInfo DondokoduRomDesc[] = { - { "b95-12.bin", 0x020000, 0xd0fce87a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b95-11-1.bin", 0x020000, 0xdad40cd3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b95-10.bin", 0x020000, 0xa46e1f0b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b95-13.bin", 0x020000, 0x350d2c65, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b95-08.bin", 0x010000, 0xb5aa49e1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b95-02.bin", 0x080000, 0x67b4e979, BRF_GRA | TAITO_CHARS }, - - { "b95-01.bin", 0x080000, 0x51c176ce, BRF_GRA | TAITO_SPRITESA }, - - { "b95-04.bin", 0x080000, 0xac4c1716, BRF_SND | TAITO_YM2610A }, - - { "b95-03.bin", 0x080000, 0x543aa0d1, BRF_GRA | TAITO_CHARS_PIVOT }, -}; - -STD_ROM_PICK(Dondokodu) -STD_ROM_FN(Dondokodu) - -static struct BurnRomInfo DriftoutRomDesc[] = { - { "ic46.rom", 0x080000, 0x71303738, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "ic45.rom", 0x080000, 0x43f81eca, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "do_50.rom", 0x010000, 0xffe10124, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "do_obj.rom", 0x080000, 0x5491f1c4, BRF_GRA | TAITO_SPRITESA }, - - { "do_snd.rom", 0x080000, 0xf2deb82b, BRF_SND | TAITO_YM2610A }, - - { "do_piv.rom", 0x080000, 0xc4f012f7, BRF_GRA | TAITO_CHARS_PIVOT }, -}; - -STD_ROM_PICK(Driftout) -STD_ROM_FN(Driftout) - -static struct BurnRomInfo DriftoutjRomDesc[] = { - { "do_46.rom", 0x080000, 0xf960363e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "do_45.rom", 0x080000, 0xe3fe66b9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "do_50.rom", 0x010000, 0xffe10124, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "do_obj.rom", 0x080000, 0x5491f1c4, BRF_GRA | TAITO_SPRITESA }, - - { "do_snd.rom", 0x080000, 0xf2deb82b, BRF_SND | TAITO_YM2610A }, - - { "do_piv.rom", 0x080000, 0xc4f012f7, BRF_GRA | TAITO_CHARS_PIVOT }, -}; - -STD_ROM_PICK(Driftoutj) -STD_ROM_FN(Driftoutj) - -static struct BurnRomInfo DriveoutRomDesc[] = { - { "driveout.003", 0x080000, 0xdc431e4e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "driveout.002", 0x080000, 0x6f9063f4, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "driveout.020", 0x008000, 0x99aaeb2e, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "driveout.084", 0x040000, 0x530ac420, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "driveout.081", 0x040000, 0x0e9a3e9e, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "do_piv.rom", 0x080000, 0xc4f012f7, BRF_GRA | TAITO_CHARS_PIVOT }, - - { "driveout.028", 0x080000, 0xcbde0b66, BRF_SND | TAITO_MSM6295 }, - { "driveout.029", 0x020000, 0x0aba2026, BRF_SND | TAITO_MSM6295 }, -}; - -STD_ROM_PICK(Driveout) -STD_ROM_FN(Driveout) - -static struct BurnRomInfo FinalbRomDesc[] = { - { "b82-09.10", 0x20000, 0x632f1ecd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b82-17.11", 0x20000, 0xe91b2ec9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b82_10.16", 0x10000, 0xa38aaaed, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b82-06.19", 0x20000, 0xfc450a25, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "b82-07.18", 0x20000, 0xec3df577, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "b82-04.4", 0x80000, 0x6346f98e, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "b82-03.5", 0x80000, 0xdaa11561, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "b82-05.3", 0x80000, 0xaa90b93a, BRF_GRA | TAITO_SPRITESA }, - - { "b82-02.1", 0x80000, 0x5dd06bdd, BRF_SND | TAITO_YM2610A }, - - { "b82-01.2", 0x80000, 0xf0eb6846, BRF_SND | TAITO_YM2610B }, - - { "tibpal16l8.ic41", 0x00104, 0x11a0a19a, BRF_OPT }, - { "tibpal16l8.ic42", 0x00104, 0xcc53deb8, BRF_OPT }, - { "tibpal16l8.ic51", 0x00104, 0xf2878537, BRF_OPT }, - { "gal16v8.ic13", 0x00117, 0xa4f75fd0, BRF_OPT }, - { "gal16v8.ic35", 0x00117, 0xca4eb3e1, BRF_OPT }, -}; - -STD_ROM_PICK(Finalb) -STD_ROM_FN(Finalb) - -static struct BurnRomInfo FinalbjRomDesc[] = { - { "b82-09.10", 0x20000, 0x632f1ecd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b82-08.11", 0x20000, 0x07154fe5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b82_10.16", 0x10000, 0xa38aaaed, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b82-06.19", 0x20000, 0xfc450a25, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "b82-07.18", 0x20000, 0xec3df577, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "b82-04.4", 0x80000, 0x6346f98e, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "b82-03.5", 0x80000, 0xdaa11561, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "b82-05.3", 0x80000, 0xaa90b93a, BRF_GRA | TAITO_SPRITESA }, - - { "b82-02.1", 0x80000, 0x5dd06bdd, BRF_SND | TAITO_YM2610A }, - - { "b82-01.2", 0x80000, 0xf0eb6846, BRF_SND | TAITO_YM2610B }, - - { "tibpal16l8.ic41", 0x00104, 0x11a0a19a, BRF_OPT }, - { "tibpal16l8.ic42", 0x00104, 0xcc53deb8, BRF_OPT }, - { "tibpal16l8.ic51", 0x00104, 0xf2878537, BRF_OPT }, - { "gal16v8.ic13", 0x00117, 0xa4f75fd0, BRF_OPT }, - { "gal16v8.ic35", 0x00117, 0xca4eb3e1, BRF_OPT }, -}; - -STD_ROM_PICK(Finalbj) -STD_ROM_FN(Finalbj) - -static struct BurnRomInfo FinalbuRomDesc[] = { - { "b82-09-1", 0x20000, 0x66729cb9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b82-6-14", 0x20000, 0x879387fa, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b82_10.16", 0x10000, 0xa38aaaed, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b82-06.19", 0x20000, 0xfc450a25, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "b82-07.18", 0x20000, 0xec3df577, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "b82-04.4", 0x80000, 0x6346f98e, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "b82-03.5", 0x80000, 0xdaa11561, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "b82-05.3", 0x80000, 0xaa90b93a, BRF_GRA | TAITO_SPRITESA }, - - { "b82-02.1", 0x80000, 0x5dd06bdd, BRF_SND | TAITO_YM2610A }, - - { "b82-01.2", 0x80000, 0xf0eb6846, BRF_SND | TAITO_YM2610B }, - - { "tibpal16l8.ic41", 0x00104, 0x11a0a19a, BRF_OPT }, - { "tibpal16l8.ic42", 0x00104, 0xcc53deb8, BRF_OPT }, - { "tibpal16l8.ic51", 0x00104, 0xf2878537, BRF_OPT }, - { "gal16v8.ic13", 0x00117, 0xa4f75fd0, BRF_OPT }, - { "gal16v8.ic35", 0x00117, 0xca4eb3e1, BRF_OPT }, -}; - -STD_ROM_PICK(Finalbu) -STD_ROM_FN(Finalbu) - -static struct BurnRomInfo FootchmpRomDesc[] = { - { "c80-11.6", 0x020000, 0xf78630fb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c80-10.4", 0x020000, 0x32c109cb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c80-12.7", 0x020000, 0x80d46fef, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c80-14.5", 0x020000, 0x40ac4828, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c80-15.70", 0x010000, 0x05aa7fd7, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c80-04.1", 0x080000, 0x9a17fe8c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "c80-05.2", 0x080000, 0xacde7071, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "c80-01.9", 0x100000, 0xf43782e6, BRF_GRA | TAITO_SPRITESA }, - { "c80-02.10", 0x100000, 0x060a8b61, BRF_GRA | TAITO_SPRITESA }, - - { "c80-03.57", 0x100000, 0x609938d5, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Footchmp) -STD_ROM_FN(Footchmp) - -static struct BurnRomInfo HtheroRomDesc[] = { - { "c80-16.6", 0x020000, 0x4e795b52, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c80-17.4", 0x020000, 0x42c0a838, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c80-12.7", 0x020000, 0x80d46fef, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c80-18.5", 0x020000, 0xaea22904, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c80-15.70", 0x010000, 0x05aa7fd7, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c80-04.1", 0x080000, 0x9a17fe8c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "c80-05.2", 0x080000, 0xacde7071, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "c80-01.9", 0x100000, 0xf43782e6, BRF_GRA | TAITO_SPRITESA }, - { "c80-02.10", 0x100000, 0x060a8b61, BRF_GRA | TAITO_SPRITESA }, - - { "c80-03.57", 0x100000, 0x609938d5, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Hthero) -STD_ROM_FN(Hthero) - -static struct BurnRomInfo Euroch92RomDesc[] = { - { "ec92_25.rom", 0x020000, 0x98482202, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "ec92_23.rom", 0x020000, 0xae5e75e9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "ec92_26.rom", 0x020000, 0xb986ccb2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "ec92_24.rom", 0x020000, 0xb31d94ac, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "ec92_27.rom", 0x010000, 0x2db48e65, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "ec92_21.rom", 0x080000, 0x5759ed37, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "ec92_22.rom", 0x080000, 0xd9a0d38e, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "ec92_19.rom", 0x100000, 0x219141a5, BRF_GRA | TAITO_SPRITESA }, - { "c80-02.10", 0x100000, 0x060a8b61, BRF_GRA | TAITO_SPRITESA }, - - { "c80-03.57", 0x100000, 0x609938d5, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Euroch92) -STD_ROM_FN(Euroch92) - -static struct BurnRomInfo GrowlRomDesc[] = { - { "c74-10-1.ic59", 0x040000, 0x8bf17a85, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-08-1.ic61", 0x040000, 0xbc70396f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-11.ic58", 0x040000, 0xee3bd6d5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-14.ic60", 0x040000, 0xb6c24ec7, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c74-12.ic62", 0x010000, 0xbb6ed668, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c74-01.ic34", 0x100000, 0x3434ce80, BRF_GRA | TAITO_CHARS }, - - { "c74-03.ic12", 0x100000, 0x1a0d8951, BRF_GRA | TAITO_SPRITESA }, - { "c74-02.ic11", 0x100000, 0x15a21506, BRF_GRA | TAITO_SPRITESA }, - - { "c74-04.ic28", 0x100000, 0x2d97edf2, BRF_SND | TAITO_YM2610A }, - { "c74-05.ic29", 0x080000, 0xe29c0828, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Growl) -STD_ROM_FN(Growl) - -static struct BurnRomInfo GrowlaRomDesc[] = { - { "c74-10.ic59", 0x040000, 0xca81a20b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-08.ic61", 0x040000, 0xaa35dd9e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-11.ic58", 0x040000, 0xee3bd6d5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-14.ic60", 0x040000, 0xb6c24ec7, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c74-12.ic62", 0x010000, 0xbb6ed668, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c74-01.ic34", 0x100000, 0x3434ce80, BRF_GRA | TAITO_CHARS }, - - { "c74-03.ic12", 0x100000, 0x1a0d8951, BRF_GRA | TAITO_SPRITESA }, - { "c74-02.ic11", 0x100000, 0x15a21506, BRF_GRA | TAITO_SPRITESA }, - - { "c74-04.ic28", 0x100000, 0x2d97edf2, BRF_SND | TAITO_YM2610A }, - { "c74-05.ic29", 0x080000, 0xe29c0828, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Growla) -STD_ROM_FN(Growla) - -static struct BurnRomInfo GrowluRomDesc[] = { - { "c74-10.ic59", 0x040000, 0xca81a20b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-08.ic61", 0x040000, 0xaa35dd9e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-11.ic58", 0x040000, 0xee3bd6d5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-13.ic60", 0x040000, 0xc1c57e51, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c74-12.ic62", 0x010000, 0xbb6ed668, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c74-01.ic34", 0x100000, 0x3434ce80, BRF_GRA | TAITO_CHARS }, - - { "c74-03.ic12", 0x100000, 0x1a0d8951, BRF_GRA | TAITO_SPRITESA }, - { "c74-02.ic11", 0x100000, 0x15a21506, BRF_GRA | TAITO_SPRITESA }, - - { "c74-04.ic28", 0x100000, 0x2d97edf2, BRF_SND | TAITO_YM2610A }, - { "c74-05.ic29", 0x080000, 0xe29c0828, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Growlu) -STD_ROM_FN(Growlu) - -static struct BurnRomInfo RunarkRomDesc[] = { - { "c74-10.ic59", 0x040000, 0xca81a20b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-08.ic61", 0x040000, 0xaa35dd9e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-11.ic58", 0x040000, 0xee3bd6d5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c74-09.ic14", 0x040000, 0x58cc2feb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c74-12.ic62", 0x010000, 0xbb6ed668, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c74-01.ic34", 0x100000, 0x3434ce80, BRF_GRA | TAITO_CHARS }, - - { "c74-03.ic12", 0x100000, 0x1a0d8951, BRF_GRA | TAITO_SPRITESA }, - { "c74-02.ic11", 0x100000, 0x15a21506, BRF_GRA | TAITO_SPRITESA }, - - { "c74-04.ic28", 0x100000, 0x2d97edf2, BRF_SND | TAITO_YM2610A }, - { "c74-05.ic29", 0x080000, 0xe29c0828, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Runark) -STD_ROM_FN(Runark) - -static struct BurnRomInfo GunfrontRomDesc[] = { - { "c71-09.ic42", 0x020000, 0x10a544a2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-08.ic41", 0x020000, 0xc17dc0a0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-10.ic40", 0x020000, 0xf39c0a06, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-14.ic39", 0x020000, 0x312da036, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-16.ic38", 0x020000, 0x1bbcc2d4, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-15.ic37", 0x020000, 0xdf3e00bb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c71-12.ic49", 0x010000, 0x0038c7f8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c71-02.ic59", 0x100000, 0x2a600c92, BRF_GRA | TAITO_CHARS }, - - { "c71-03.ic19", 0x100000, 0x9133c605, BRF_GRA | TAITO_SPRITESA }, - - { "c71-01.ic29", 0x100000, 0x0e73105a, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Gunfront) -STD_ROM_FN(Gunfront) - -static struct BurnRomInfo GunfrontjRomDesc[] = { - { "c71-09.ic42", 0x020000, 0x10a544a2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-08.ic41", 0x020000, 0xc17dc0a0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-10.ic40", 0x020000, 0xf39c0a06, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-11.ic39", 0x020000, 0xdf23c11a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-16.ic38", 0x020000, 0x1bbcc2d4, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c71-15.ic37", 0x020000, 0xdf3e00bb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c71-12.ic49", 0x010000, 0x0038c7f8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c71-02.ic59", 0x100000, 0x2a600c92, BRF_GRA | TAITO_CHARS }, - - { "c71-03.ic19", 0x100000, 0x9133c605, BRF_GRA | TAITO_SPRITESA }, - - { "c71-01.ic29", 0x100000, 0x0e73105a, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Gunfrontj) -STD_ROM_FN(Gunfrontj) - -static struct BurnRomInfo KoshienRomDesc[] = { - { "c81-11.bin", 0x020000, 0xb44ea8c9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c81-10.bin", 0x020000, 0x8f98c40a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c81-04.bin", 0x080000, 0x1592b460, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "c81-12.bin", 0x010000, 0x6e8625b6, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c81-03.bin", 0x100000, 0x29bbf492, BRF_GRA | TAITO_CHARS }, - - { "c81-01.bin", 0x100000, 0x64b15d2a, BRF_GRA | TAITO_SPRITESA }, - { "c81-02.bin", 0x100000, 0x962461e8, BRF_GRA | TAITO_SPRITESA }, - - { "c81-05.bin", 0x080000, 0x9c3d71be, BRF_SND | TAITO_YM2610A }, - { "c81-06.bin", 0x080000, 0x927833b4, BRF_SND | TAITO_YM2610B }, - - { "pal16l8b-c81-07.bin",0x000104, 0x46341732, BRF_OPT }, - { "pal16l8b-c81-08.bin",0x000104, 0xe7d2d300, BRF_OPT }, - { "pal16l8b-c81-09.bin",0x000104, 0xe4c012a1, BRF_OPT }, -}; - -STD_ROM_PICK(Koshien) -STD_ROM_FN(Koshien) - -static struct BurnRomInfo LiquidkRomDesc[] = { - { "c49-09.ic47", 0x20000, 0x6ae09eb9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c49-11.ic48", 0x20000, 0x42d2be6e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c49-10.ic45", 0x20000, 0x50bef2e0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c49-12.ic46", 0x20000, 0xcb16bad5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c49-08.ic32", 0x10000, 0x413c310c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c49-03.ic76", 0x80000, 0xc3364f9b, BRF_GRA | TAITO_CHARS }, - - { "c49-01.ic54", 0x80000, 0x67cc3163, BRF_GRA | TAITO_SPRITESA }, - { "c49-02.ic53", 0x80000, 0xd2400710, BRF_GRA | TAITO_SPRITESA }, - - { "c49-04.ic33", 0x80000, 0x474d45a4, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Liquidk) -STD_ROM_FN(Liquidk) - -static struct BurnRomInfo LiquidkuRomDesc[] = { - { "c49-09.ic47", 0x20000, 0x6ae09eb9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c49-11.ic48", 0x20000, 0x42d2be6e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c49-10.ic45", 0x20000, 0x50bef2e0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c49-14.ic46", 0x20000, 0xbc118a43, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c49-08.ic32", 0x10000, 0x413c310c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c49-03.ic76", 0x80000, 0xc3364f9b, BRF_GRA | TAITO_CHARS }, - - { "c49-01.ic54", 0x80000, 0x67cc3163, BRF_GRA | TAITO_SPRITESA }, - { "c49-02.ic53", 0x80000, 0xd2400710, BRF_GRA | TAITO_SPRITESA }, - - { "c49-04.ic33", 0x80000, 0x474d45a4, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Liquidku) -STD_ROM_FN(Liquidku) - -static struct BurnRomInfo MizubakuRomDesc[] = { - { "c49-09.ic47", 0x20000, 0x6ae09eb9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c49-11.ic48", 0x20000, 0x42d2be6e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c49-10.ic45", 0x20000, 0x50bef2e0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c49-13.ic46", 0x20000, 0x2518dbf9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c49-08.ic32", 0x10000, 0x413c310c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c49-03.ic76", 0x80000, 0xc3364f9b, BRF_GRA | TAITO_CHARS }, - - { "c49-01.ic54", 0x80000, 0x67cc3163, BRF_GRA | TAITO_SPRITESA }, - { "c49-02.ic53", 0x80000, 0xd2400710, BRF_GRA | TAITO_SPRITESA }, - - { "c49-04.ic33", 0x80000, 0x474d45a4, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Mizubaku) -STD_ROM_FN(Mizubaku) - -static struct BurnRomInfo MegablstRomDesc[] = { - { "c11-07.55", 0x020000, 0x11d228b6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c11-08.39", 0x020000, 0xa79d4dca, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c11-06.54", 0x020000, 0x7c249894, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c11-11.38", 0x020000, 0x263ecbf9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c11-12.3", 0x010000, 0xb11094f1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c11-05.58", 0x080000, 0x733e6d8e, BRF_GRA | TAITO_CHARS }, - - { "c11-03.32", 0x080000, 0x46718c7a, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c11-04.31", 0x080000, 0x663f33cc, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c11-01.29", 0x080000, 0xfd1ea532, BRF_SND | TAITO_YM2610A }, - { "c11-02.30", 0x080000, 0x451cc187, BRF_SND | TAITO_YM2610B }, - - { "pal16l8b-b89-01.ic8", 0x000104, 0x4095b97a, BRF_OPT }, - { "pal16l8b-b89-02.ic28", 0x000104, 0x6430b559, BRF_OPT }, - { "pal16l8b-b89-03.bin", 0x000104, 0x634592e2, BRF_OPT }, - { "palce16v8-b89-04.ic27", 0x000117, 0xfc136ae2, BRF_OPT }, - { "pal16l8b-c11-13.ic13", 0x000104, 0x421d7ea8, BRF_OPT }, - { "pal16l8b-c11-14.ic23", 0x000104, 0x5c740aee, BRF_OPT }, -}; - -STD_ROM_PICK(Megablst) -STD_ROM_FN(Megablst) - -static struct BurnRomInfo MegablstjRomDesc[] = { - { "c11-07.55", 0x020000, 0x11d228b6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c11-08.39", 0x020000, 0xa79d4dca, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c11-06.54", 0x020000, 0x7c249894, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c11-09.38", 0x020000, 0xc830aad5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c11-12.3", 0x010000, 0xb11094f1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c11-05.58", 0x080000, 0x733e6d8e, BRF_GRA | TAITO_CHARS }, - - { "c11-03.32", 0x080000, 0x46718c7a, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c11-04.31", 0x080000, 0x663f33cc, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c11-01.29", 0x080000, 0xfd1ea532, BRF_SND | TAITO_YM2610A }, - { "c11-02.30", 0x080000, 0x451cc187, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Megablstj) -STD_ROM_FN(Megablstj) - -static struct BurnRomInfo MegablstuRomDesc[] = { - { "c11-07.55", 0x020000, 0x11d228b6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c11-08.39", 0x020000, 0xa79d4dca, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c11-06.54", 0x020000, 0x7c249894, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c11-10.38", 0x020000, 0xbf379a43, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c11-12.3", 0x010000, 0xb11094f1, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c11-05.58", 0x080000, 0x733e6d8e, BRF_GRA | TAITO_CHARS }, - - { "c11-03.32", 0x080000, 0x46718c7a, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c11-04.31", 0x080000, 0x663f33cc, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c11-01.29", 0x080000, 0xfd1ea532, BRF_SND | TAITO_YM2610A }, - { "c11-02.30", 0x080000, 0x451cc187, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Megablstu) -STD_ROM_FN(Megablstu) - -static struct BurnRomInfo MetalbRomDesc[] = { - { "d16-16.8", 0x040000, 0x3150be61, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d16-18.7", 0x040000, 0x5216d092, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d12-07.9", 0x020000, 0xe07f5136, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d12-06.6", 0x020000, 0x131df731, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "d12-13.5", 0x020000, 0xbcca2649, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d12-03.14", 0x080000, 0x46b498c0, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d12-04.13", 0x080000, 0xab66d141, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d12-01.20", 0x100000, 0xb81523b9, BRF_GRA | TAITO_SPRITESA }, - - { "d12-02.10", 0x100000, 0x79263e74, BRF_SND | TAITO_YM2610A }, - { "d12-05.16", 0x080000, 0x7fd036c5, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Metalb) -STD_ROM_FN(Metalb) - -static struct BurnRomInfo MetalbjRomDesc[] = { - { "d12-12.8", 0x040000, 0x556f82b2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d12-11.7", 0x040000, 0xaf9ee28d, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d12-07.9", 0x020000, 0xe07f5136, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d12-06.6", 0x020000, 0x131df731, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "d12-13.5", 0x020000, 0xbcca2649, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d12-03.14", 0x080000, 0x46b498c0, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "d12-04.13", 0x080000, 0xab66d141, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "d12-01.20", 0x100000, 0xb81523b9, BRF_GRA | TAITO_SPRITESA }, - - { "d12-02.10", 0x100000, 0x79263e74, BRF_SND | TAITO_YM2610A }, - { "d12-05.16", 0x080000, 0x7fd036c5, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Metalbj) -STD_ROM_FN(Metalbj) - -static struct BurnRomInfo MjnquestRomDesc[] = { - { "c77-09", 0x020000, 0x0a005d01, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c77-08", 0x020000, 0x4244f775, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c77-04", 0x080000, 0xc2e7e038, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "c77-10", 0x010000, 0xf16b2c1e, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c77-01", 0x100000, 0x5ba51205, BRF_GRA | TAITO_CHARS }, - { "c77-02", 0x100000, 0x6a6f3040, BRF_GRA | TAITO_CHARS }, - - { "c77-05", 0x080000, 0xc5a54678, BRF_GRA | TAITO_SPRITESA }, - - { "c77-03", 0x080000, 0x312f17b1, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Mjnquest) -STD_ROM_FN(Mjnquest) - -static struct BurnRomInfo MjnquestbRomDesc[] = { - { "c77-09a", 0x020000, 0xfc17f1c2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c77-08", 0x020000, 0x4244f775, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c77-04", 0x080000, 0xc2e7e038, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "c77-10", 0x010000, 0xf16b2c1e, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c77-01", 0x100000, 0x5ba51205, BRF_GRA | TAITO_CHARS }, - { "c77-02", 0x100000, 0x6a6f3040, BRF_GRA | TAITO_CHARS }, - - { "c77-05", 0x080000, 0xc5a54678, BRF_GRA | TAITO_SPRITESA }, - - { "c77-03", 0x080000, 0x312f17b1, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Mjnquestb) -STD_ROM_FN(Mjnquestb) - -static struct BurnRomInfo NinjakRomDesc[] = { - { "c85-10x.ic50", 0x020000, 0xba7e6e74, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c85-13x.ic49", 0x020000, 0x0ac2cba2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c85-07.ic48", 0x020000, 0x3eccfd0a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c85-06.ic47", 0x020000, 0xd126ded1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c85-14.ic54", 0x010000, 0xf2a52a51, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c85-03.ic65", 0x080000, 0x4cc7b9df, BRF_GRA | TAITO_CHARS }, - - { "c85-01.ic19", 0x100000, 0xa711977c, BRF_GRA | TAITO_SPRITESA }, - { "c85-02.ic17", 0x100000, 0xa6ad0f3d, BRF_GRA | TAITO_SPRITESA }, - - { "c85-04.ic31", 0x080000, 0x5afb747e, BRF_SND | TAITO_YM2610A }, - { "c85-05.ic33", 0x080000, 0x3c1b0ed0, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Ninjak) -STD_ROM_FN(Ninjak) - -static struct BurnRomInfo NinjakjRomDesc[] = { - { "c85-10x.ic50", 0x020000, 0xba7e6e74, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c85-11x.ic49", 0x020000, 0xe4ccaa8e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c85-07.ic48", 0x020000, 0x3eccfd0a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c85-06.ic47", 0x020000, 0xd126ded1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c85-14.ic54", 0x010000, 0xf2a52a51, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c85-03.ic65", 0x080000, 0x4cc7b9df, BRF_GRA | TAITO_CHARS }, - - { "c85-01.ic19", 0x100000, 0xa711977c, BRF_GRA | TAITO_SPRITESA }, - { "c85-02.ic17", 0x100000, 0xa6ad0f3d, BRF_GRA | TAITO_SPRITESA }, - - { "c85-04.ic31", 0x080000, 0x5afb747e, BRF_SND | TAITO_YM2610A }, - { "c85-05.ic33", 0x080000, 0x3c1b0ed0, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Ninjakj) -STD_ROM_FN(Ninjakj) - -static struct BurnRomInfo NinjakuRomDesc[] = { - { "c85-15x.ic50", 0x020000, 0x719a481b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c85-12x.ic49", 0x020000, 0x6c3f7e1e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c85-07.ic48", 0x020000, 0x3eccfd0a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c85-06.ic47", 0x020000, 0xd126ded1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c85-14.ic54", 0x010000, 0xf2a52a51, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c85-03.ic65", 0x080000, 0x4cc7b9df, BRF_GRA | TAITO_CHARS }, - - { "c85-01.ic19", 0x100000, 0xa711977c, BRF_GRA | TAITO_SPRITESA }, - { "c85-02.ic17", 0x100000, 0xa6ad0f3d, BRF_GRA | TAITO_SPRITESA }, - - { "c85-04.ic31", 0x080000, 0x5afb747e, BRF_SND | TAITO_YM2610A }, - { "c85-05.ic33", 0x080000, 0x3c1b0ed0, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Ninjaku) -STD_ROM_FN(Ninjaku) - -static struct BurnRomInfo PulirulaRomDesc[] = { - { "c98-12.rom", 0x040000, 0x816d6cde, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c98-16.rom", 0x040000, 0x59df5c77, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c98-06.rom", 0x020000, 0x64a71b45, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c98-07.rom", 0x020000, 0x90195bc0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c98-14.rom", 0x020000, 0xa858e17c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c98-04.rom", 0x100000, 0x0e1fe3b2, BRF_GRA | TAITO_CHARS }, - - { "c98-02.rom", 0x100000, 0x4a2ad2b3, BRF_GRA | TAITO_SPRITESA }, - { "c98-03.rom", 0x100000, 0x589a678f, BRF_GRA | TAITO_SPRITESA }, - - { "c98-01.rom", 0x100000, 0x197f66f5, BRF_SND | TAITO_YM2610A }, - - { "c98-05.rom", 0x080000, 0x9ddd9c39, BRF_GRA | TAITO_CHARS_PIVOT }, -}; - -STD_ROM_PICK(Pulirula) -STD_ROM_FN(Pulirula) - -static struct BurnRomInfo PulirulajRomDesc[] = { - { "c98-12.rom", 0x040000, 0x816d6cde, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c98-13.rom", 0x040000, 0xb7d13d5b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c98-06.rom", 0x020000, 0x64a71b45, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c98-07.rom", 0x020000, 0x90195bc0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c98-14.rom", 0x020000, 0xa858e17c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c98-04.rom", 0x100000, 0x0e1fe3b2, BRF_GRA | TAITO_CHARS }, - - { "c98-02.rom", 0x100000, 0x4a2ad2b3, BRF_GRA | TAITO_SPRITESA }, - { "c98-03.rom", 0x100000, 0x589a678f, BRF_GRA | TAITO_SPRITESA }, - - { "c98-01.rom", 0x100000, 0x197f66f5, BRF_SND | TAITO_YM2610A }, - - { "c98-05.rom", 0x080000, 0x9ddd9c39, BRF_GRA | TAITO_CHARS_PIVOT }, -}; - -STD_ROM_PICK(Pulirulaj) -STD_ROM_FN(Pulirulaj) - -static struct BurnRomInfo QcrayonRomDesc[] = { - { "d55-13", 0x040000, 0x16afbfc7, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d55-14", 0x040000, 0x2fb3057f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d55-03", 0x100000, 0x4d161e76, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "d55-15", 0x010000, 0xba782eff, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d55-02", 0x100000, 0xf3db2f1c, BRF_GRA | TAITO_CHARS }, - - { "d55-05", 0x100000, 0xf0e59902, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "d55-04", 0x100000, 0x412975ce, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "d55-01", 0x100000, 0xa8309af4, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Qcrayon) -STD_ROM_FN(Qcrayon) - -static struct BurnRomInfo Qcrayon2RomDesc[] = { - { "d63-12", 0x040000, 0x0f445a38, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d63-13", 0x040000, 0x74455752, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d63-01", 0x080000, 0x872e38b4, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "d63-11", 0x010000, 0x2c7ac9e5, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d63-03", 0x100000, 0xd24843af, BRF_GRA | TAITO_CHARS }, - - { "d63-06", 0x200000, 0x58b1e4a8, BRF_GRA | TAITO_SPRITESA }, - - { "d63-02", 0x100000, 0x162ae165, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Qcrayon2) -STD_ROM_FN(Qcrayon2) - -static struct BurnRomInfo QjinseiRomDesc[] = { - { "d48-09", 0x040000, 0xa573b68d, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d48-10", 0x040000, 0x37143a5b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d48-03", 0x100000, 0xfb5ea8dc, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "d48-11", 0x010000, 0x656c5b54, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d48-04", 0x100000, 0x61e4b078, BRF_GRA | TAITO_CHARS }, - - { "d48-02", 0x100000, 0xa7b68e63, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "d48-01", 0x100000, 0x72a94b73, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "d48-05", 0x080000, 0x3fefd058, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Qjinsei) -STD_ROM_FN(Qjinsei) - -static struct BurnRomInfo QtorimonRomDesc[] = { - { "c41-04.bin", 0x020000, 0x0fbf5223, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c41-05.bin", 0x020000, 0x174bd5db, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "mask-51.bin", 0x020000, 0x12e14aca, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "mask-52.bin", 0x020000, 0xb3ef66f3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c41-06.bin", 0x010000, 0x753a98d8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c41-02.bin", 0x020000, 0x05dcd36d, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c41-01.bin", 0x020000, 0x39ff043c, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c41-03.bin", 0x020000, 0xb2c18e89, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Qtorimon) -STD_ROM_FN(Qtorimon) - -static struct BurnRomInfo QuizhqRomDesc[] = { - { "c53-05.bin", 0x020000, 0xc798fc20, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c53-01.bin", 0x020000, 0xbf44c93e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c53-52.bin", 0x020000, 0x12e14aca, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c53-51.bin", 0x020000, 0xb3ef66f3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c53-08.bin", 0x010000, 0x25187e81, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c53-03.bin", 0x020000, 0x47596e70, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c53-07.bin", 0x020000, 0x4f9fa82f, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c53-02.bin", 0x020000, 0xd704c6f4, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c53-06.bin", 0x020000, 0xf77f63fc, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c53-04.bin", 0x020000, 0x99890ad4, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Quizhq) -STD_ROM_FN(Quizhq) - -static struct BurnRomInfo QzchikyuRomDesc[] = { - { "d19-06.8", 0x020000, 0xde8c8e55, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d19-05.7", 0x020000, 0xc6d099d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d19-03.6", 0x080000, 0x5c1b92c0, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "d19-07.5", 0x010000, 0xa8935f84, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d19-02.10", 0x100000, 0xf2dce2f2, BRF_GRA | TAITO_CHARS }, - - { "d19-01.21", 0x100000, 0x6c4342d0, BRF_GRA | TAITO_SPRITESA }, - - { "d19-04.9", 0x080000, 0xd3c44905, BRF_SND | TAITO_YM2610A }, - - { "pal16l8b-d19-08.bin",0x000104, 0xc6240d10, BRF_OPT }, - { "pal16l8b-d19-09.bin",0x000104, 0x576f5db9, BRF_OPT }, - { "pal16l8b-d19-10.bin",0x000104, 0xea1232a5, BRF_OPT }, -}; - -STD_ROM_PICK(Qzchikyu) -STD_ROM_FN(Qzchikyu) - -static struct BurnRomInfo QzquestRomDesc[] = { - { "c92-06.8", 0x020000, 0x424be722, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c92-05.7", 0x020000, 0xda470f93, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c92-03.6", 0x080000, 0x1d697606, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "c92-07.5", 0x010000, 0x3e313db9, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c92-02.10", 0x100000, 0x2daccecf, BRF_GRA | TAITO_CHARS }, - - { "c92-01.21", 0x100000, 0x9976a285, BRF_GRA | TAITO_SPRITESA }, - - { "c92-04.9", 0x080000, 0xe421bb43, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Qzquest) -STD_ROM_FN(Qzquest) - -static struct BurnRomInfo SsiRomDesc[] = { - { "c64_15-1.ic9", 0x040000, 0xce9308a6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c64_16-1.ic8", 0x040000, 0x470a483a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c64-09.13", 0x010000, 0x88d7f65c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c64-01.1", 0x100000, 0xa1b4f486, BRF_GRA | TAITO_SPRITESA }, - - { "c64-02.2", 0x020000, 0x3cb0b907, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Ssi) -STD_ROM_FN(Ssi) - -static struct BurnRomInfo Majest12uRomDesc[] = { - { "c64_12.ic9", 0x040000, 0xd5716d7e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c64_14.ic8", 0x040000, 0xeee4ed8a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c64-09.13", 0x010000, 0x88d7f65c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c64-01.1", 0x100000, 0xa1b4f486, BRF_GRA | TAITO_SPRITESA }, - - { "c64-02.2", 0x020000, 0x3cb0b907, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Majest12u) -STD_ROM_FN(Majest12u) - -static struct BurnRomInfo Majest12jRomDesc[] = { - { "c64-07.10", 0x020000, 0xf29ed5c9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c64-08.11", 0x020000, 0xddfd33d5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c64-06.4", 0x020000, 0x18dc71ac, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c64-05.5", 0x020000, 0xb61866c0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c64-09.13", 0x010000, 0x88d7f65c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c64-01.1", 0x100000, 0xa1b4f486, BRF_GRA | TAITO_SPRITESA }, - - { "c64-02.2", 0x020000, 0x3cb0b907, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Majest12j) -STD_ROM_FN(Majest12j) - -static struct BurnRomInfo SolfigtrRomDesc[] = { - { "c91-05.59", 0x040000, 0xc1260e7c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c91-09.61", 0x040000, 0xd82b5266, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c91-07.62", 0x010000, 0xe471a05a, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c91-03.34", 0x100000, 0x8965da12, BRF_GRA | TAITO_CHARS }, - - { "c91-01.12", 0x100000, 0x0f3f4e00, BRF_GRA | TAITO_SPRITESA }, - { "c91-02.11", 0x100000, 0xe14ab98e, BRF_GRA | TAITO_SPRITESA }, - - { "c91-04.28", 0x080000, 0x390b1065, BRF_SND | TAITO_YM2610A }, - - { "pal16l8b-c74-06.ic48",0x000104, 0xc868dc16, BRF_OPT }, -}; - -STD_ROM_PICK(Solfigtr) -STD_ROM_FN(Solfigtr) - -static struct BurnRomInfo ThundfoxRomDesc[] = { - { "c28-13-1.51", 0x020000, 0xacb07013, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c28-16-1.40", 0x020000, 0x1e43d55b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c28-08.50", 0x020000, 0x38e038f1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c28-07.39", 0x020000, 0x24419abb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c28-14.3", 0x010000, 0x45ef3616, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c28-02.61", 0x080000, 0x6230a09d, BRF_GRA | TAITO_CHARS }, - - { "c28-01.63", 0x080000, 0x44552b25, BRF_GRA | TAITO_CHARSB }, - - { "c28-03.29", 0x080000, 0x51bdc7af, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c28-04.28", 0x080000, 0xba7ed535, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c28-06.41", 0x080000, 0xdb6983db, BRF_SND | TAITO_YM2610A }, - { "c28-05.42", 0x080000, 0xd3b238fa, BRF_SND | TAITO_YM2610B }, - - { "pal16l8b-b89-01.ic19",0x000104, 0x4095b97a, BRF_OPT }, - { "pal16l8b-b89-03.ic37",0x000104, 0x634592e2, BRF_OPT }, - { "pal16v8b-b89-04.ic33",0x000117, 0xfc136ae2, BRF_OPT }, - { "pal16l8b-c28-09.ic25",0x000104, 0x383e7305, BRF_OPT }, - { "pal16l8b-c28-10.ic26",0x000104, 0x47fccc07, BRF_OPT }, - { "pal16l8b-c28-11.ic35",0x000104, 0x33414fe8, BRF_OPT }, -}; - -STD_ROM_PICK(Thundfox) -STD_ROM_FN(Thundfox) - -static struct BurnRomInfo ThundfoxjRomDesc[] = { - { "c28-13-1.51", 0x020000, 0xacb07013, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c28-12-1.40", 0x020000, 0xf04db477, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c28-08.50", 0x020000, 0x38e038f1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c28-07.39", 0x020000, 0x24419abb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c28-14.3", 0x010000, 0x45ef3616, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c28-02.61", 0x080000, 0x6230a09d, BRF_GRA | TAITO_CHARS }, - - { "c28-01.63", 0x080000, 0x44552b25, BRF_GRA | TAITO_CHARSB }, - - { "c28-03.29", 0x080000, 0x51bdc7af, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c28-04.28", 0x080000, 0xba7ed535, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c28-06.41", 0x080000, 0xdb6983db, BRF_SND | TAITO_YM2610A }, - { "c28-05.42", 0x080000, 0xd3b238fa, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Thundfoxj) -STD_ROM_FN(Thundfoxj) - -static struct BurnRomInfo ThundfoxuRomDesc[] = { - { "c28-13-1.51", 0x020000, 0xacb07013, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c28-15-1.40", 0x020000, 0x874a84e1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c28-08.50", 0x020000, 0x38e038f1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c28-07.39", 0x020000, 0x24419abb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c28-14.3", 0x010000, 0x45ef3616, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c28-02.61", 0x080000, 0x6230a09d, BRF_GRA | TAITO_CHARS }, - - { "c28-01.63", 0x080000, 0x44552b25, BRF_GRA | TAITO_CHARSB }, - - { "c28-03.29", 0x080000, 0x51bdc7af, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c28-04.28", 0x080000, 0xba7ed535, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c28-06.41", 0x080000, 0xdb6983db, BRF_SND | TAITO_YM2610A }, - { "c28-05.42", 0x080000, 0xd3b238fa, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Thundfoxu) -STD_ROM_FN(Thundfoxu) - -static struct BurnRomInfo YesnojRomDesc[] = { - { "d20-05-2.2", 0x040000, 0x68adb929, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "d20-04-2.4", 0x040000, 0xa84762f8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "d20-06.5", 0x010000, 0x3eb537dc, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "d20-01.11", 0x080000, 0x9d8a4d57, BRF_GRA | TAITO_CHARS }, - - { "d20-02.12", 0x080000, 0xe71a8e40, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "d20-03.13", 0x080000, 0x6a51a1b4, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, -}; - -STD_ROM_PICK(Yesnoj) -STD_ROM_FN(Yesnoj) - -static struct BurnRomInfo YuyugogoRomDesc[] = { - { "c83-10.3", 0x020000, 0x4d185d03, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c83-09.2", 0x020000, 0xf9892792, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c83-03.10", 0x100000, 0xeed9acc2, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "c83-11.1", 0x010000, 0x461e702a, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c83-05.21", 0x020000, 0xeca57fb1, BRF_GRA | TAITO_CHARS }, - - { "c83-01.12", 0x100000, 0x8bf0d416, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c83-02.11", 0x100000, 0x20bb1c15, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c83-04.5", 0x100000, 0x2600093a, BRF_SND | TAITO_YM2610A }, -}; - -STD_ROM_PICK(Yuyugogo) -STD_ROM_FN(Yuyugogo) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - TaitoYM2610BRom = Next; Next += TaitoYM2610BRomSize; - if (TaitoNumMSM6295) {MSM6295ROM = Next; Next += 0x40000; } - TaitoMSM6295Rom = Next; Next += TaitoMSM6295RomSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x020000; - TaitoZ80Ram1 = Next; Next += 0x002000; - TaitoSpriteRam = Next; Next += 0x010000; - TaitoSpriteRamBuffered = Next; Next += 0x010000; - TaitoSpriteRamDelayed = Next; Next += 0x010000; - TaitoSpriteExtension = Next; Next += 0x004000; - TaitoPaletteRam = Next; Next += 0x004000; - - TaitoRamEnd = Next; - - TaitoChars = Next; Next += TaitoNumChar * TaitoCharWidth * TaitoCharHeight; - if (TaitoNumCharB) { TaitoCharsB = Next; Next += TaitoNumCharB * TaitoCharBWidth * TaitoCharBHeight; } - TaitoCharsPivot = Next; Next += TaitoNumCharPivot * TaitoCharPivotWidth * TaitoCharPivotHeight; - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - TaitoPalette = (UINT32*)Next; Next += 0x02000 * sizeof(UINT32); - TaitoPriorityMap = Next; Next += nScreenWidth * nScreenHeight; - TaitoF2SpriteList = (TaitoF2SpriteEntry*)Next; Next += 0x400 * sizeof(TaitoF2SpriteEntry); - - TaitoMemEnd = Next; - - return 0; -} - -static INT32 TaitoF2DoReset() -{ - TaitoDoReset(); - - YesnoDip = 0; - MjnquestInput = 0; - DriveoutSoundNibble = 0; - DriveoutOkiBank = 0; - - TaitoF2SpritesFlipScreen = 0; - TaitoF2SpriteBlendMode = 0; - TaitoF2TilePriority[0] = TaitoF2TilePriority[1] = TaitoF2TilePriority[2] = TaitoF2TilePriority[3] = TaitoF2TilePriority[4] = 0; - TaitoF2SpritePriority[0] = TaitoF2SpritePriority[1] = TaitoF2SpritePriority[2] = TaitoF2SpritePriority[3] = 0; - - return 0; -} - -static void TaitoF2SpriteBankWrite(INT32 Offset, UINT16 Data) -{ - INT32 i, j; - - if (Offset < 2) return; - if (Offset < 4) { - j = (Offset & 1) << 1; - i = Data << 11; - TaitoF2SpriteBankBuffered[j + 0] = i; - TaitoF2SpriteBankBuffered[j + 1] = i + 0x400; - } else { - i = Data << 10; - TaitoF2SpriteBankBuffered[Offset] = i; - } -} - -UINT8 __fastcall Cameltry68KReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Cameltry68KWriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0100SCN0ByteWrite_Map(0x800000, 0x813fff) - - switch (a) { - case 0x320000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x320002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Cameltry68KReadWord(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - - switch (a) { - case 0x300018: { - INT32 Temp = TaitoAnalogPort0 >> 6; - if (Temp >= 0x14 && Temp < 0x80) Temp = 0x14; - if (Temp <= 0x3ec && Temp > 0x80) Temp = 0x3ec; - return Temp; - } - - case 0x30001c: { - INT32 Temp = TaitoAnalogPort1 >> 6; - if (Temp >= 0x14 && Temp < 0x80) Temp = 0x14; - if (Temp <= 0x3ec && Temp > 0x80) Temp = 0x3ec; - return Temp; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Cameltry68KWriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0100SCN0WordWrite_Map(0x800000, 0x813fff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0280GRDCtrlWordWrite_Map(0xa02000) - TC0360PRIHalfWordWrite_Map(0xd00000) - - if (a >= 0x814000 && a <= 0x814fff) return; //??? - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Deadconx68KReadByte(UINT32 a) -{ - switch (a) { - case 0x700001: { - return TaitoDip[0]; - } - - case 0x700003: { - return TaitoDip[1]; - } - - case 0x700005: { - return TaitoInput[2]; - } - - case 0x700007: { - return 0xff; - } - - case 0x70000b: { - return TaitoInput[0]; - } - - case 0x70000d: { - return TaitoInput[1]; - } - - case 0x70000f: { - return 0xff; - } - - case 0x700011: { - return 0xff; - } - - case 0xa00002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Deadconx68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x700007: { - // coin write - return; - } - - case 0xa00000: { - TC0140SYTPortWrite(d); - return; - } - - case 0xa00002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Deadconx68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Deadconx68KWriteWord(UINT32 a, UINT16 d) -{ - TC0480SCPCtrlWordWrite_Map(0x430000) - TC0360PRIHalfWordWrite_Map(0x500000) - - switch (a) { - case 0x300000: - case 0x300002: - case 0x300004: - case 0x300006: - case 0x300008: - case 0x30000a: - case 0x30000c: - case 0x30000e: { - TaitoF2SpriteBankWrite((a - 0x300000) >> 1, d); - return; - } - - case 0x700006: { - // coin write - return; - } - - case 0x700008: - case 0x700012: - case 0x700014: - case 0x700016: - case 0x700018: { - // ??? - return; - } - - case 0x800000: { - // watchdog - return; - } - - case 0x900000: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Dinorex68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x300000) - - switch (a) { - case 0xa00002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Dinorex68KWriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordWrite_Map(0x300000) - TC0100SCN0ByteWrite_Map(0x900000, 0x90ffff) - - switch (a) { - case 0xa00000: { - TC0140SYTPortWrite(d); - return; - } - - case 0xa00002: { - TC0140SYTCommWrite(d); - return; - } - - case 0xb00000: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Dinorex68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Dinorex68KWriteWord(UINT32 a, UINT16 d) -{ - TC0510NIOHalfWordWrite_Map(0x300000) - TC0360PRIHalfWordWrite_Map(0x700000) - TC0100SCN0WordWrite_Map(0x900000, 0x90ffff) - TC0100SCN0CtrlWordWrite_Map(0x920000) - - switch (a) { - case 0xb00000: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Dondokod68KReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - - switch (a) { - case 0x320002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Dondokod68KWriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x320000: - case 0x320001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x320002: - case 0x320003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Dondokod68KReadWord(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Dondokod68KWriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0280GRDCtrlWordWrite_Map(0xa02000) - TC0360PRIHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x360000: { - //??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Driftout68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0xb00000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Driftout68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - TC0510NIOHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x200000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x200002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Driftout68KReadWord(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0xb00000) - - switch (a) { - case 0x200000: { - return 0; - } - - case 0xb00018: - case 0xb0001a: { - //driftout_paddle_r - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Driftout68KWriteWord(UINT32 a, UINT16 d) -{ - TC0430GRWCtrlWordWrite_Map(0x402000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0360PRIHalfWordSwapWrite_Map(0xa00000) - TC0510NIOHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0xa00000: { - //??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -void __fastcall Driveout68KWriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x200000: { - DriveoutSoundNibble = d & 1; - return; - } - - case 0x200002: { - if (!DriveoutSoundNibble) { - TaitoSoundLatch = (d & 0x0f) | (TaitoSoundLatch & 0xf0); - } else { - TaitoSoundLatch = ((d << 4) & 0xf0) | (TaitoSoundLatch & 0x0f); - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall Finalb68KReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Finalb68KWriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x320001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x320003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Finalb68KReadWord(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - - switch (a) { - case 0x200002: { - return TC0110PCRWordRead(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Finalb68KWriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - - if (a >= 0x810000 && a <= 0x81ffff) return; // NOP - - switch (a) { - case 0x200000: - case 0x200002: { - TC0110PCRWordWrite(0, (a - 0x200000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Footchmp68KReadByte(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Footchmp68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0xa00001: { - TC0140SYTPortWrite(d); - return; - } - - case 0xa00003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Footchmp68KReadWord(UINT32 a) -{ - switch (a) { - case 0x700000: { - return TaitoDip[0]; - } - - case 0x700002: { - return TaitoDip[1]; - } - - case 0x700004: { - return TaitoInput[2]; - } - - case 0x70000a: { - return TaitoInput[0]; - } - - case 0x70000c: { - return TaitoInput[1]; - } - - case 0x70000e: { - return TaitoInput[3]; - } - - case 0x700010: { - return TaitoInput[4]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0xffff; -} - -void __fastcall Footchmp68KWriteWord(UINT32 a, UINT16 d) -{ - TC0480SCPCtrlWordWrite_Map(0x430000) - TC0360PRIHalfWordWrite_Map(0x500000) - - switch (a) { - case 0x300000: - case 0x300002: - case 0x300004: - case 0x300006: - case 0x300008: - case 0x30000a: - case 0x30000c: - case 0x30000e: { - TaitoF2SpriteBankWrite((a - 0x300000) >> 1, d); - return; - } - - case 0x700006: - case 0x700008: - case 0x700012: - case 0x700014: - case 0x700016: - case 0x700018: { - return; - } - - case 0x800000: { - // watchdog - return; - } - - case 0x900000: { - // ???? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Growl68KReadByte(UINT32 a) -{ - switch (a) { - case 0x320001: { - return TaitoInput[0]; - } - - case 0x320003: { - return TaitoInput[1]; - } - - case 0x400002: { - return TC0140SYTCommRead(); - } - - case 0x508000: { - return TaitoInput[4]; - } - - case 0x508001: { - return TaitoInput[3]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Growl68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x400000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x400002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Growl68KReadWord(UINT32 a) -{ - switch (a) { - case 0x300000: { - return TaitoDip[0]; - } - - case 0x300002: { - return TaitoDip[1]; - } - - case 0x320000: { - return TaitoInput[0]; - } - - case 0x320004: { - return TaitoInput[2]; - } - - case 0x50c000: { - return TaitoInput[5]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Growl68KWriteWord(UINT32 a, UINT16 d) -{ - TC0360PRIHalfWordWrite_Map(0xb00000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - - switch (a) { - case 0x300004: { - // coin write - return; - } - - case 0x340000: { - // watchdog - return; - } - - case 0x500000: - case 0x500002: - case 0x500004: - case 0x500006: - case 0x500008: - case 0x50000a: - case 0x50000c: - case 0x50000e: { - TaitoF2SpriteBankWrite((a - 0x500000) >> 1, d); - return; - } - - case 0x504000: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Gunfront68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordSwapRead_Map(0x300000) - - switch (a) { - case 0x320002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Gunfront68KWriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordSwapWrite_Map(0x300000) - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x320000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x320002: { - TC0140SYTCommWrite(d); - return; - } - - case 0xa00000: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Gunfront68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Gunfront68KWriteWord(UINT32 a, UINT16 d) -{ - TC0510NIOHalfWordSwapWrite_Map(0x300000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0360PRIHalfWordWrite_Map(0xb00000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Koshien68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x300000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Koshien68KWriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordWrite_Map(0x300000) - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - TC0360PRIHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x320000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x320002: { - TC0140SYTCommWrite(d); - return; - } - - case 0x340000: { - //??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Koshien68KReadWord(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x300000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Koshien68KWriteWord(UINT32 a, UINT16 d) -{ - TC0510NIOHalfWordWrite_Map(0x300000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0360PRIHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0xa20000: { - TaitoF2SpriteBankBuffered[0] = 0x0000; - TaitoF2SpriteBankBuffered[1] = 0x0400; - TaitoF2SpriteBankBuffered[2] = ((d & 0x00f) + 1) * 0x800; - TaitoF2SpriteBankBuffered[4] = (((d & 0x0f0) >> 4) + 1) * 0x800; - TaitoF2SpriteBankBuffered[6] = (((d & 0xf00) >> 8) + 1) * 0x800; - TaitoF2SpriteBankBuffered[3] = TaitoF2SpriteBankBuffered[2] + 0x400; - TaitoF2SpriteBankBuffered[5] = TaitoF2SpriteBankBuffered[4] + 0x400; - TaitoF2SpriteBankBuffered[7] = TaitoF2SpriteBankBuffered[6] + 0x400; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Liquidk68KReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Liquidk68KWriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x320001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x320003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Liquidk68KReadWord(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x300000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Liquidk68KWriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x300000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0360PRIHalfWordWrite_Map(0xb00000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Megablst68KReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x120000) - - if (a >= 0x180000 && a <= 0x180fff) { - return MegabCChipRead((a - 0x180000) >> 1); - } - - switch (a) { - case 0x100002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Megablst68KWriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x120000) - TC0360PRIHalfWordWrite_Map(0x400000) - TC0100SCN0ByteWrite_Map(0x600000, 0x60ffff) - - if (a >= 0x180000 && a <= 0x180fff) { - MegabCChipWrite((a - 0x180000) >> 1, d); - return; - } - - switch (a) { - case 0x100000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x100002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Megablst68KReadWord(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x120000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Megablst68KWriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x120000) - TC0360PRIHalfWordWrite_Map(0x400000) - TC0100SCN0WordWrite_Map(0x600000, 0x60ffff) - TC0100SCN0CtrlWordWrite_Map(0x620000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Metalb68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordSwapRead_Map(0x800000) - - switch (a) { - case 0x900002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Metalb68KWriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordSwapWrite_Map(0x800000) - - switch (a) { - case 0x900000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x900002: { - TC0140SYTCommWrite(d); - return; - } - - case 0xa00000: { - //??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Metalb68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Metalb68KWriteWord(UINT32 a, UINT16 d) -{ - TC0480SCPCtrlWordWrite_Map(0x530000) - TC0360PRIHalfWordWrite_Map(0x600000) - TC0510NIOHalfWordSwapWrite_Map(0x800000) - - switch (a) { - case 0x42000c: - case 0x42000e: { - //??? - return; - } - - case 0xa00000: { - //??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Mjnquest68KReadByte(UINT32 a) -{ - switch (a) { - case 0x300000: { - return TaitoInput[4]; - } - - case 0x300001: { - return TaitoDip[0]; - } - - case 0x300002: { - return TaitoInput[5]; - } - - case 0x300003: { - return TaitoDip[1]; - } - - case 0x360002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Mjnquest68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x400000, 0x40ffff) - - switch (a) { - case 0x330000: - case 0x330001: { - //nop - return; - } - - case 0x360000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x360002: { - TC0140SYTCommWrite(d); - return; - } - - case 0x360005: { - //??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Mjnquest68KReadWord(UINT32 a) -{ - switch (a) { - case 0x310000: { - switch (MjnquestInput) { - case 0x01: return TaitoInput[0]; - case 0x02: return TaitoInput[1]; - case 0x04: return TaitoInput[2]; - case 0x08: return TaitoInput[3]; - case 0x10: return 0xff; - } - return 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Mjnquest68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x400000, 0x40ffff) - TC0100SCN0CtrlWordWrite_Map(0x420000) - - switch (a) { - case 0x200000: - case 0x200002: { - TC0110PCRWordWrite(0, (a - 0x200000) >> 1, d); - return; - } - - case 0x200004: { - //nop - return; - } - - case 0x300000: { - //??? - return; - } - - case 0x320000: { - MjnquestInput = d >> 6; - return; - } - - case 0x350000: { - //nop - return; - } - - case 0x380000: { - TC0100SCNSetGfxBank(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Ninjak68KReadByte(UINT32 a) -{ - switch (a) { - case 0x300000: { - return TaitoDip[0]; - } - - case 0x300002: { - return TaitoDip[1]; - } - - case 0x300004: { - return TaitoInput[0]; - } - - case 0x300006: { - return TaitoInput[1]; - } - - case 0x300008: { - return TaitoInput[3]; - } - - case 0x30000a: { - return TaitoInput[4]; - } - - case 0x30000c: { - return TaitoInput[2]; - } - - case 0x400002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ninjak68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x30000e: { - //coin write - return; - } - - case 0x300010: { - //??? - return; - } - - case 0x400000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x400002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Ninjak68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ninjak68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0360PRIHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x300000: - case 0x300012: - case 0x300014: - case 0x300016: - case 0x300018: { - //??? - return; - } - - case 0x380000: { - //watchdog - return; - } - - case 0x600000: - case 0x600002: - case 0x600004: - case 0x600006: - case 0x600008: - case 0x60000a: - case 0x60000c: - case 0x60000e: { - TaitoF2SpriteBankWrite((a - 0x600000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Pulirula68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0xb00000) - - switch (a) { - case 0x200002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Pulirula68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - TC0510NIOHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x200000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x200002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Pulirula68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Pulirula68KWriteWord(UINT32 a, UINT16 d) -{ - TC0430GRWCtrlWordWrite_Map(0x402000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0360PRIHalfWordSwapWrite_Map(0xa00000) - TC0510NIOHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x500000: { - //??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Qcrayon68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0xa00000) - - switch (a) { - case 0x500002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qcrayon68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x900000, 0x90ffff) - TC0510NIOHalfWordWrite_Map(0xa00000) - - switch (a) { - case 0x200000: { - //??? - return; - } - - case 0x500000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x500002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Qcrayon68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qcrayon68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x900000, 0x90ffff) - TC0100SCN0CtrlWordWrite_Map(0x920000) - TC0510NIOHalfWordWrite_Map(0xa00000) - TC0360PRIHalfWordWrite_Map(0xb00000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Qcrayon268KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x700000) - - switch (a) { - case 0xa00002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qcrayon268KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x500000, 0x50ffff) - TC0510NIOHalfWordWrite_Map(0x700000) - - switch (a) { - case 0x800000: { - //??? - return; - } - - case 0xa00000: { - TC0140SYTPortWrite(d); - return; - } - - case 0xa00002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Qcrayon268KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qcrayon268KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x500000, 0x50ffff) - TC0100SCN0CtrlWordWrite_Map(0x520000) - TC0510NIOHalfWordWrite_Map(0x700000) - TC0360PRIHalfWordWrite_Map(0x900000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Qjinsei68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0xb00000) - - switch (a) { - case 0x200002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qjinsei68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - TC0510NIOHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x200000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x200002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Qjinsei68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qjinsei68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0360PRIHalfWordWrite_Map(0xa00000) - TC0510NIOHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x500000: { - //nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Qtorimon68KReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x500000) - - switch (a) { - case 0x600002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qtorimon68KWriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x500000) - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x600000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x600002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Qtorimon68KReadWord(UINT32 a) -{ - switch (a) { - case 0x200002: { - return TC0110PCRWordRead(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qtorimon68KWriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x500000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - - if (a >= 0x810000 && a <= 0x81ffff) return; // NOP - - switch (a) { - case 0x200000: - case 0x200002: { - TC0110PCRWordWrite(0, (a - 0x200000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Quizhq68KReadByte(UINT32 a) -{ - switch (a) { - case 0x500001: { - return TaitoDip[1]; - } - - case 0x500003: { - return TaitoInput[0]; - } - - case 0x580001: { - return TaitoDip[0]; - } - - case 0x580003: { - return TaitoInput[1]; - } - - case 0x580005: { - return TaitoInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Quizhq68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x500005: { - //coin write - return; - } - - case 0x500007: { - //??? - return; - } - - case 0x580007: { - //nop - return; - } - - case 0x600001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x600003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Quizhq68KReadWord(UINT32 a) -{ - switch (a) { - case 0x500000: { - return TaitoDip[1]; - } - - case 0x500002: { - return TaitoInput[0]; - } - - case 0x580000: { - return TaitoDip[0]; - } - - case 0x580002: { - return TaitoInput[1]; - } - - case 0x580004: { - return TaitoInput[2]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Quizhq68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - - if (a >= 0x810000 && a <= 0x81ffff) return; // NOP - - switch (a) { - case 0x200000: - case 0x200002: { - TC0110PCRWordWrite(0, (a - 0x200000) >> 1, d); - return; - } - - case 0x680000: { - //nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Qzchikyu68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x200000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qzchikyu68KWriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordWrite_Map(0x200000) - TC0100SCN0ByteWrite_Map(0x700000, 0x70ffff) - - switch (a) { - case 0x300001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x300003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Qzchikyu68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qzchikyu68KWriteWord(UINT32 a, UINT16 d) -{ - TC0510NIOHalfWordWrite_Map(0x200000) - TC0100SCN0WordWrite_Map(0x700000, 0x70ffff) - TC0100SCN0CtrlWordWrite_Map(0x720000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Qzquest68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x200000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qzquest68KWriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordWrite_Map(0x200000) - TC0100SCN0ByteWrite_Map(0x700000, 0x70ffff) - - switch (a) { - case 0x300001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x300003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Qzquest68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Qzquest68KWriteWord(UINT32 a, UINT16 d) -{ - TC0510NIOHalfWordWrite_Map(0x200000) - TC0100SCN0WordWrite_Map(0x700000, 0x70ffff) - TC0100SCN0CtrlWordWrite_Map(0x720000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Solfigtr68KReadByte(UINT32 a) -{ - switch (a) { - case 0x300001: { - return TaitoDip[0]; - } - - case 0x300003: { - return TaitoDip[1]; - } - - case 0x320001: { - return TaitoInput[0]; - } - - case 0x320003: { - return TaitoInput[1]; - } - - case 0x320005: { - return TaitoInput[2]; - } - - case 0x400002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Solfigtr68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x300005: { - //coin write - return; - } - - case 0x400000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x400002: { - TC0140SYTCommWrite(d); - return; - } - - case 0x504000: { - //nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Solfigtr68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Solfigtr68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - TC0360PRIHalfWordWrite_Map(0xb00000) - - switch (a) { - case 0x300006: { - //??? - return; - } - - case 0x320006: { - //??? - return; - } - - case 0x340000: { - //watchdog - return; - } - - case 0x500000: - case 0x500002: - case 0x500004: - case 0x500006: - case 0x500008: - case 0x50000a: - case 0x50000c: - case 0x50000e: { - TaitoF2SpriteBankWrite((a - 0x500000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Ssi68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x100000) - - switch (a) { - case 0x400002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ssi68KWriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordWrite_Map(0x100000) - TC0100SCN0ByteWrite_Map(0x600000, 0x60ffff) - - switch (a) { - case 0x400000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x400002: { - TC0140SYTCommWrite(d); - return; - } - - case 0x500000: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Ssi68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Ssi68KWriteWord(UINT32 a, UINT16 d) -{ - TC0510NIOHalfWordWrite_Map(0x100000) - TC0100SCN0ByteWrite_Map(0x600000, 0x60ffff) - TC0100SCN0CtrlWordWrite_Map(0x620000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Thundfox68KReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x200000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Thundfox68KWriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x200000) - TC0100SCN0ByteWrite_Map(0x400000, 0x40ffff) - TC0360PRIHalfWordWrite_Map(0x800000) - - switch (a) { - case 0x220000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x220002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Thundfox68KReadWord(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x200000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Thundfox68KWriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x200000) - TC0100SCN0WordWrite_Map(0x400000, 0x40ffff) - TC0100SCN0CtrlWordWrite_Map(0x420000) - TC0100SCN1WordWrite_Map(0x500000, 0x50ffff) - TC0100SCN1CtrlWordWrite_Map(0x520000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Yesnoj68KReadByte(UINT32 a) -{ - if (a >= 0x700000 && a <= 0x70001f) return 0; - - switch (a) { - case 0x800002: { - return TC0140SYTCommRead(); - } - - case 0xa00001: { - return TaitoInput[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Yesnoj68KWriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x500000, 0x50ffff) - - switch (a) { - case 0x700015: - case 0x70001b: - case 0x70001d: - case 0x70001f: { - //??? - return; - } - - case 0x800000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x800002: { - TC0140SYTCommWrite(d); - return; - } - - case 0x900003: { - //nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Yesnoj68KReadWord(UINT32 a) -{ - switch (a) { - case 0xa00004: { - return TaitoInput[1]; - } - - case 0xb00000: { - YesnoDip = 1 - YesnoDip; - - if (YesnoDip) { - return TaitoDip[0]; - } else { - return TaitoDip[1]; - } - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Yesnoj68KWriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x500000, 0x50ffff) - TC0100SCN0CtrlWordWrite_Map(0x520000) - - switch (a) { - case 0x900002: - case 0x900006: - case 0xa00006: - case 0xc00000: - case 0xd00000: { - //nop - return; - } - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Yuyugogo68KReadByte(UINT32 a) -{ - TC0510NIOHalfWordRead_Map(0x200000) - - switch (a) { - case 0x400002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Yuyugogo68KWriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordWrite_Map(0x200000) - TC0100SCN0ByteWrite_Map(0x800000, 0x80ffff) - - switch (a) { - case 0x400000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x400002: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Yuyugogo68KReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Yuyugogo68KWriteWord(UINT32 a, UINT16 d) -{ - TC0510NIOHalfWordWrite_Map(0x200000) - TC0100SCN0WordWrite_Map(0x800000, 0x80ffff) - TC0100SCN0CtrlWordWrite_Map(0x820000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall TaitoF2Z80Read(UINT16 a) -{ - switch (a) { - case 0xe000: { - return BurnYM2610Read(0); - } - - case 0xe002: { - return BurnYM2610Read(2); - } - - case 0xe200: { - // NOP - return 0; - } - - case 0xe201: { - return TC0140SYTSlaveCommRead(); - } - - case 0xea00: { - // NOP - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall TaitoF2Z80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - BurnYM2610Write(0, d); - return; - } - - case 0xe001: { - BurnYM2610Write(1, d); - return; - } - - case 0xe002: { - BurnYM2610Write(2, d); - return; - } - - case 0xe003: { - BurnYM2610Write(3, d); - return; - } - - case 0xe200: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xe201: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xe400: - case 0xe401: - case 0xe402: - case 0xe403: { - return; - } - - case 0xe600: { - return; - } - - case 0xee00: { - return; - } - - case 0xf000: { - return; - } - - case 0xf200: { - TaitoZ80Bank = (d - 1) & 7; - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall CamltryaZ80Read(UINT16 a) -{ - switch (a) { - case 0x9000: { - return BurnYM2203Read(0, 0); - } - - case 0xa001: { - return TC0140SYTSlaveCommRead(); - } - - case 0xb000: { - return MSM6295ReadStatus(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall CamltryaZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x9001: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xa000: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xa001: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xb000: - case 0xb001: { - MSM6295Command(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall DriveoutZ80Read(UINT16 a) -{ - switch (a) { - case 0x9800: { - return MSM6295ReadStatus(0); - } - - case 0xa000: { - return TaitoSoundLatch; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall DriveoutZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - if ((d & 4)) { - DriveoutOkiBank = (d & 3); - memcpy(MSM6295ROM, TaitoMSM6295Rom + (DriveoutOkiBank * 0x40000), 0x40000); - } - return; - } - - case 0x9800: { - MSM6295Command(0, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[8] = { 8, 12, 0, 4, 24, 28, 16, 20 }; -static INT32 CharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 PivotPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 PivotXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 PivotYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 YuyugogoCharPlaneOffsets[1] = { 0 }; -static INT32 YuyugogoCharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 YuyugogoCharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 TC0480SCPCharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TC0480SCPCharXOffsets[16] = { 4, 0, 20, 16, 12, 8, 28, 24, 36, 32, 52, 48, 44, 40, 60, 56 }; -static INT32 TC0480SCPCharYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 SpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 SpriteXOffsets[16] = { 4, 0, 12, 8, 20, 16, 28, 24, 36, 32, 44, 40, 52, 48, 60, 56 }; -static INT32 SpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 FinalbSpritePlaneOffsets[6] = { 0x800000, 0x800001, 0, 1, 2, 3 }; -static INT32 FinalbSpriteXOffsets[16] = { 12, 8, 4, 0, 28, 24, 20, 16, 44, 40, 36, 32, 60, 56, 52, 48 }; -static INT32 FinalbSpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; - -static void TaitoF2FMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 TaitoF2SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / (24000000 / 6); -} - -static double TaitoF2GetTime() -{ - return (double)ZetTotalCycles() / (24000000 / 6); -} - -static INT32 CamltryaSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / (24000000 / 4); -} - -static double CamltryaGetTime() -{ - return (double)ZetTotalCycles() / (24000000 / 4); -} - -static void TaitoF2SoundInit() -{ - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(TaitoF2Z80Read); - ZetSetWriteHandler(TaitoF2Z80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2610Init(24000000 / 3, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &TaitoF2FMIRQHandler, TaitoF2SynchroniseStream, TaitoF2GetTime, 0); - BurnTimerAttachZet(24000000 / 6); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); -} - -#ifdef BUILD_A68K -static void SwitchToMusashi() -{ - if (bBurnUseASMCPUEmulation) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching to Musashi 68000 core\n")); -#endif - bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation; - bBurnUseASMCPUEmulation = false; - } -} -#endif - -static void TaitoF2Init() -{ - GenericTilesInit(); - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoF2SpritesDisabled = 1; - TaitoF2SpritesActiveArea = 0; - TaitoXOffset = 0; - TaitoF2SpriteType = 0; - - TaitoF2SpriteBufferFunction = TaitoF2NoBuffer; - TaitoDrawFunction = TaitoF2Draw; - - for (INT32 i = 0; i < 8; i++) { - TaitoF2SpriteBankBuffered[i] = 0x400 * i; - TaitoF2SpriteBank[i] = TaitoF2SpriteBankBuffered[i]; - } - - nTaitoCyclesTotal[0] = (24000000 / 2) / 60; - nTaitoCyclesTotal[1] = (24000000 / 6) / 60; -} - -static INT32 CameltryInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoCharPivotModulo = 0x100; - TaitoCharPivotNumPlanes = 4; - TaitoCharPivotWidth = 8; - TaitoCharPivotHeight = 8; - TaitoCharPivotPlaneOffsets = PivotPlaneOffsets; - TaitoCharPivotXOffsets = PivotXOffsets; - TaitoCharPivotYOffsets = PivotYOffsets; - TaitoNumCharPivot = 0x1000; - - TaitoNumSpriteA = 0x1000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, NULL); - TC0140SYTInit(0); - TC0220IOCInit(); - TC0280GRDInit(-16, -16, TaitoCharsPivot); - TC0360PRIInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x813fff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekMapMemory(TC0280GRDRam , 0xa00000, 0xa01fff, MAP_RAM); - SekSetReadByteHandler(0, Cameltry68KReadByte); - SekSetWriteByteHandler(0, Cameltry68KWriteByte); - SekSetReadWordHandler(0, Cameltry68KReadWord); - SekSetWriteWordHandler(0, Cameltry68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoDrawFunction = CameltryDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 CamltryaInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumYM2610 = 0; - TaitoNumYM2203 = 1; - TaitoNumMSM6295 = 1; - - TaitoCharPivotModulo = 0x100; - TaitoCharPivotNumPlanes = 4; - TaitoCharPivotWidth = 8; - TaitoCharPivotHeight = 8; - TaitoCharPivotPlaneOffsets = PivotPlaneOffsets; - TaitoCharPivotXOffsets = PivotXOffsets; - TaitoCharPivotYOffsets = PivotYOffsets; - TaitoNumCharPivot = 0x1000; - - TaitoNumSpriteA = 0x1000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, NULL); - TC0140SYTInit(0); - TC0220IOCInit(); - TC0280GRDInit(-16, -16, TaitoCharsPivot); - TC0360PRIInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x813fff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekMapMemory(TC0280GRDRam , 0xa00000, 0xa01fff, MAP_RAM); - SekSetReadByteHandler(0, Cameltry68KReadByte); - SekSetWriteByteHandler(0, Cameltry68KWriteByte); - SekSetReadWordHandler(0, Cameltry68KReadWord); - SekSetWriteWordHandler(0, Cameltry68KWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(CamltryaZ80Read); - ZetSetWriteHandler(CamltryaZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2203Init(1, 24000000 / 8, &TaitoF2FMIRQHandler, CamltryaSynchroniseStream, CamltryaGetTime, 0); - BurnTimerAttachZet(24000000 / 4); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.60, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.20, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, (4224000 / 4) / 132, 1); - MSM6295SetRoute(0, 0.10, BURN_SND_ROUTE_BOTH); - - nTaitoCyclesTotal[1] = (24000000 / 4) / 60; - - TaitoXOffset = 3; - TaitoDrawFunction = CameltryDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 DeadconxInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoCharModulo = 0x400; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 16; - TaitoCharHeight = 16; - TaitoCharPlaneOffsets = TC0480SCPCharPlaneOffsets; - TaitoCharXOffsets = TC0480SCPCharXOffsets; - TaitoCharYOffsets = TC0480SCPCharYOffsets; - TaitoNumChar = 0x2000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "deadconxj")) { - TC0480SCPInit(TaitoNumChar, 3, 0x34, -5, -1, 0, 26); - } else { - TC0480SCPInit(TaitoNumChar, 3, 0x1e, 8, -1, 0, 0); - } - - TC0140SYTInit(0); - TC0360PRIInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(TC0480SCPRam , 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x600000, 0x601fff, MAP_RAM); - SekSetReadByteHandler(0, Deadconx68KReadByte); - SekSetWriteByteHandler(0, Deadconx68KWriteByte); - SekSetReadWordHandler(0, Deadconx68KReadWord); - SekSetWriteWordHandler(0, Deadconx68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoDrawFunction = FootchmpDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 DinorexInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0xc000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x2fffff, MAP_ROM); - SekMapMemory(TaitoSpriteExtension , 0x400000, 0x400fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x500000, 0x501fff, MAP_RAM); - SekMapMemory(Taito68KRam1 , 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x900000, 0x90ffff, MAP_READ); - SekSetReadByteHandler(0, Dinorex68KReadByte); - SekSetWriteByteHandler(0, Dinorex68KWriteByte); - SekSetReadWordHandler(0, Dinorex68KReadWord); - SekSetWriteWordHandler(0, Dinorex68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteType = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 DondokodInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoCharPivotModulo = 0x100; - TaitoCharPivotNumPlanes = 4; - TaitoCharPivotWidth = 8; - TaitoCharPivotHeight = 8; - TaitoCharPivotPlaneOffsets = PivotPlaneOffsets; - TaitoCharPivotXOffsets = PivotXOffsets; - TaitoCharPivotYOffsets = PivotYOffsets; - TaitoNumCharPivot = 0x4000; - - TaitoNumChar = 0x4000; - TaitoNumSpriteA = 0x1000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0220IOCInit(); - TC0280GRDInit(-16, -16, TaitoCharsPivot); - TC0360PRIInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekMapMemory(TC0280GRDRam , 0xa00000, 0xa01fff, MAP_RAM); - SekSetReadByteHandler(0, Dondokod68KReadByte); - SekSetWriteByteHandler(0, Dondokod68KWriteByte); - SekSetReadWordHandler(0, Dondokod68KReadWord); - SekSetWriteWordHandler(0, Dondokod68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayed; - TaitoDrawFunction = TaitoF2PivotDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 DriftoutInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoCharPivotModulo = 0x100; - TaitoCharPivotNumPlanes = 4; - TaitoCharPivotWidth = 8; - TaitoCharPivotHeight = 8; - TaitoCharPivotPlaneOffsets = PivotPlaneOffsets; - TaitoCharPivotXOffsets = PivotXOffsets; - TaitoCharPivotYOffsets = PivotYOffsets; - TaitoNumCharPivot = 0x4000; - TaitoNumSpriteA = 0x1000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, NULL); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0430GRWInit(-16, 0, TaitoCharsPivot); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(TC0430GRWRam , 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x700000, 0x701fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Driftout68KReadByte); - SekSetWriteByteHandler(0, Driftout68KWriteByte); - SekSetReadWordHandler(0, Driftout68KReadWord); - SekSetWriteWordHandler(0, Driftout68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoDrawFunction = DriftoutDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 DriveoutInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumYM2610 = 0; - TaitoNumMSM6295 = 1; - - TaitoCharPivotModulo = 0x100; - TaitoCharPivotNumPlanes = 4; - TaitoCharPivotWidth = 8; - TaitoCharPivotHeight = 8; - TaitoCharPivotPlaneOffsets = PivotPlaneOffsets; - TaitoCharPivotXOffsets = PivotXOffsets; - TaitoCharPivotYOffsets = PivotYOffsets; - TaitoNumCharPivot = 0x4000; - TaitoNumSpriteA = 0x1000; - - TaitoLoadRoms(0); - - TaitoMSM6295RomSize = 0x100000; - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - UINT8 *TempRom = (UINT8*)BurnMalloc(0x100000); - memcpy(TempRom, TaitoMSM6295Rom, 0x100000); - memset(TaitoMSM6295Rom, 0, 0x100000); - memcpy(TaitoMSM6295Rom + 0x00000, TempRom + 0x00000, 0x20000); - memcpy(TaitoMSM6295Rom + 0x20000, TempRom + 0x80000, 0x20000); - memcpy(TaitoMSM6295Rom + 0x40000, TempRom + 0x20000, 0x20000); - memcpy(TaitoMSM6295Rom + 0x60000, TempRom + 0x80000, 0x20000); - memcpy(TaitoMSM6295Rom + 0x80000, TempRom + 0x40000, 0x20000); - memcpy(TaitoMSM6295Rom + 0xa0000, TempRom + 0x80000, 0x20000); - memcpy(TaitoMSM6295Rom + 0xc0000, TempRom + 0x60000, 0x20000); - memcpy(TaitoMSM6295Rom + 0xe0000, TempRom + 0x80000, 0x20000); - BurnFree(TempRom); - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, NULL); - TC0360PRIInit(); - TC0430GRWInit(-16, 0, TaitoCharsPivot); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(TC0430GRWRam , 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x700000, 0x701fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Driftout68KReadByte); - SekSetWriteByteHandler(0, Driveout68KWriteByte); - SekSetReadWordHandler(0, Driftout68KReadWord); - SekSetWriteWordHandler(0, Driftout68KWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(DriveoutZ80Read); - ZetSetWriteHandler(DriveoutZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x8000, 0x87ff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x87ff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x87ff, 2, TaitoZ80Ram1 ); - ZetClose(); - - MSM6295Init(0, 1056000 / 132, 0); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - TaitoXOffset = 3; - TaitoDrawFunction = DriftoutDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 FinalbInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x2000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 6; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = FinalbSpritePlaneOffsets; - TaitoSpriteAXOffsets = FinalbSpriteXOffsets; - TaitoSpriteAYOffsets = FinalbSpriteYOffsets; - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - TaitoNumSpriteA = 0x0000; // Need to load these outside of the usual routine - - if (TaitoLoadRoms(1)) return 1; - - TC0110PCRInit(1, 0x1000); - TC0100SCNInit(0, TaitoNumChar, 1, 8, 0, NULL); - TC0140SYTInit(0); - TC0220IOCInit(); - - // Load and decode Sprites - INT32 nRet; - TaitoNumSpriteA = 0x2000; - UINT8 *TempRom = (UINT8*)BurnMalloc(0x200000); - memset(TempRom, 0, 0x200000); - nRet = BurnLoadRom(TempRom + 0x000000 , 5, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(TempRom + 0x000001 , 6, 2); if (nRet != 0) return 1; - nRet = BurnLoadRom(TempRom + 0x180000 , 7, 1); if (nRet != 0) return 1; - - INT32 Offset = 0x100000; - UINT8 Data, d1, d2, d3, d4; - for (INT32 i = 0x180000; i < 0x200000; i++) { - Data = TempRom[i]; - d1 = (Data >> 0) & 3; - d2 = (Data >> 2) & 3; - d3 = (Data >> 4) & 3; - d4 = (Data >> 6) & 3; - - TempRom[Offset] = (d3 << 2) | (d4 << 6); - Offset++; - - TempRom[Offset] = (d1 << 2) | (d2 << 6); - Offset++; - } - GfxDecode(TaitoNumSpriteA, TaitoSpriteANumPlanes, TaitoSpriteAWidth, TaitoSpriteAHeight, FinalbSpritePlaneOffsets, FinalbSpriteXOffsets, FinalbSpriteYOffsets, TaitoSpriteAModulo, TempRom, TaitoSpritesA); - BurnFree(TempRom); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Finalb68KReadByte); - SekSetWriteByteHandler(0, Finalb68KWriteByte); - SekSetReadWordHandler(0, Finalb68KReadWord); - SekSetWriteWordHandler(0, Finalb68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 1; - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayed; - TaitoDrawFunction = FinalbDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 FootchmpInit() -{ - INT32 nLen; - - TaitoF2Init(); - - Footchmp = 1; - - TaitoCharModulo = 0x400; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 16; - TaitoCharHeight = 16; - TaitoCharPlaneOffsets = TC0480SCPCharPlaneOffsets; - TaitoCharXOffsets = TC0480SCPCharXOffsets; - TaitoCharYOffsets = TC0480SCPCharYOffsets; - TaitoNumChar = 0x2000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "hthero")) { - TC0480SCPInit(TaitoNumChar, 3, 0x33, -4, -1, 0, 24); - } else { - TC0480SCPInit(TaitoNumChar, 3, 0x1d, 8, -1, 0, 0); - } - TC0140SYTInit(0); - TC0360PRIInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(TC0480SCPRam , 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x600000, 0x601fff, MAP_RAM); - SekSetReadByteHandler(0, Footchmp68KReadByte); - SekSetWriteByteHandler(0, Footchmp68KWriteByte); - SekSetReadWordHandler(0, Footchmp68KReadWord); - SekSetWriteWordHandler(0, Footchmp68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteBufferFunction = TaitoF2FullBufferDelayed; - TaitoDrawFunction = FootchmpDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 GrowlInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0360PRIInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Growl68KReadByte); - SekSetWriteByteHandler(0, Growl68KWriteByte); - SekSetReadWordHandler(0, Growl68KReadWord); - SekSetWriteWordHandler(0, Growl68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 GunfrontInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Gunfront68KReadByte); - SekSetWriteByteHandler(0, Gunfront68KWriteByte); - SekSetReadWordHandler(0, Gunfront68KReadWord); - SekSetWriteWordHandler(0, Gunfront68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayed; - - TaitoXOffset = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 KoshienInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 1, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x40000 , 0x080000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Koshien68KReadByte); - SekSetWriteByteHandler(0, Koshien68KWriteByte); - SekSetReadWordHandler(0, Koshien68KReadWord); - SekSetWriteWordHandler(0, Koshien68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 1; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 LiquidkInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x4000; - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0220IOCInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Liquidk68KReadByte); - SekSetWriteByteHandler(0, Liquidk68KWriteByte); - SekSetReadWordHandler(0, Liquidk68KReadWord); - SekSetWriteWordHandler(0, Liquidk68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayed; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 MegablstInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x4000; - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0220IOCInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x300000, 0x301fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x600000, 0x60ffff, MAP_READ); - SekMapMemory(Taito68KRam1 + 0x10000 , 0x610000, 0x61ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x800000, 0x80ffff, MAP_RAM); - SekSetReadByteHandler(0, Megablst68KReadByte); - SekSetWriteByteHandler(0, Megablst68KWriteByte); - SekSetReadWordHandler(0, Megablst68KReadWord); - SekSetWriteWordHandler(0, Megablst68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - MegabCChipInit(); - - TaitoXOffset = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 MetalbInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoCharModulo = 0x400; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 16; - TaitoCharHeight = 16; - TaitoCharPlaneOffsets = TC0480SCPCharPlaneOffsets; - TaitoCharXOffsets = TC0480SCPCharXOffsets; - TaitoCharYOffsets = TC0480SCPCharYOffsets; - TaitoNumChar = 0x2000; - - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0480SCPInit(TaitoNumChar, 3, 0x32, -4, 1, 0, 24); - TC0480SCPSetColourBase(256); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(TC0480SCPRam , 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x700000, 0x703fff, MAP_RAM); - SekSetReadByteHandler(0, Metalb68KReadByte); - SekSetWriteByteHandler(0, Metalb68KWriteByte); - SekSetReadWordHandler(0, Metalb68KReadWord); - SekSetWriteWordHandler(0, Metalb68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoDrawFunction = MetalbDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 MjnquestInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x10000; - TaitoNumSpriteA = 0x1000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - // Load and decode Sprites - INT32 nRet; - UINT8 *TempRom = (UINT8*)BurnMalloc(TaitoSpriteARomSize); - memset(TempRom, 0, TaitoSpriteARomSize); - nRet = BurnLoadRom(TempRom + 0x000000 , 6, 1); if (nRet != 0) return 1; - for (UINT32 i = 0; i < TaitoSpriteARomSize; i += 2) { - INT32 Temp = TempRom[i]; - TempRom[i + 0] = (TempRom[i + 1] >> 4) | (TempRom[i + 1] << 4); - TempRom[i + 1] = (Temp >> 4) | (Temp << 4); - } - GfxDecode(TaitoNumSpriteA, TaitoSpriteANumPlanes, TaitoSpriteAWidth, TaitoSpriteAHeight, TaitoSpriteAPlaneOffsets, TaitoSpriteAXOffsets, TaitoSpriteAYOffsets, TaitoSpriteAModulo, TempRom, TaitoSpritesA); - BurnFree(TempRom); - - TC0110PCRInit(1, 0x1000); - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, NULL); - TC0100SCNSetGfxMask(0, 0x7fff); - TC0140SYTInit(0); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x40000 , 0x080000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x110000, 0x12ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x500000, 0x50ffff, MAP_RAM); - SekSetReadByteHandler(0, Mjnquest68KReadByte); - SekSetWriteByteHandler(0, Mjnquest68KWriteByte); - SekSetReadWordHandler(0, Mjnquest68KReadWord); - SekSetWriteWordHandler(0, Mjnquest68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoDrawFunction = FinalbDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 NinjakInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x4000; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Ninjak68KReadByte); - SekSetWriteByteHandler(0, Ninjak68KWriteByte); - SekSetReadWordHandler(0, Ninjak68KReadWord); - SekSetWriteWordHandler(0, Ninjak68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 PulirulaInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoCharPivotModulo = 0x100; - TaitoCharPivotNumPlanes = 4; - TaitoCharPivotWidth = 8; - TaitoCharPivotHeight = 8; - TaitoCharPivotPlaneOffsets = PivotPlaneOffsets; - TaitoCharPivotXOffsets = PivotXOffsets; - TaitoCharPivotYOffsets = PivotYOffsets; - TaitoNumCharPivot = 0x4000; - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0430GRWInit(-10, 0, TaitoCharsPivot); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(TC0430GRWRam , 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x700000, 0x701fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteExtension , 0x600000, 0x603fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Pulirula68KReadByte); - SekSetWriteByteHandler(0, Pulirula68KWriteByte); - SekSetReadWordHandler(0, Pulirula68KReadWord); - SekSetWriteWordHandler(0, Pulirula68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteType = 2; - TaitoDrawFunction = PulirulaDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 QcrayonInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(Taito68KRom1 + 0x80000 , 0x300000, 0x3fffff, MAP_ROM); - SekMapMemory(TaitoSpriteExtension , 0x600000, 0x603fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x700000, 0x701fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x900000, 0x90ffff, MAP_READ); - SekSetReadByteHandler(0, Qcrayon68KReadByte); - SekSetWriteByteHandler(0, Qcrayon68KWriteByte); - SekSetReadWordHandler(0, Qcrayon68KReadWord); - SekSetWriteWordHandler(0, Qcrayon68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteType = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 Qcrayon2Init() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x300000, 0x301fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x500000, 0x50ffff, MAP_READ); - SekMapMemory(Taito68KRom1 + 0x80000 , 0x600000, 0x6fffff, MAP_ROM); - SekMapMemory(TaitoSpriteExtension , 0xb00000, 0xb017ff, MAP_RAM); - SekSetReadByteHandler(0, Qcrayon268KReadByte); - SekSetWriteByteHandler(0, Qcrayon268KWriteByte); - SekSetReadWordHandler(0, Qcrayon268KReadWord); - SekSetWriteWordHandler(0, Qcrayon268KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteType = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 QjinseiInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0360PRIInit(); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x80000 , 0x100000, 0x1fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(TaitoSpriteExtension , 0x600000, 0x603fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x700000, 0x701fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Qjinsei68KReadByte); - SekSetWriteByteHandler(0, Qjinsei68KWriteByte); - SekSetReadWordHandler(0, Qjinsei68KReadWord); - SekSetWriteWordHandler(0, Qjinsei68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteType = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 QtorimonInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumSpriteA = 0x0800; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0110PCRInit(1, 0x1000); - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, NULL); - TC0140SYTInit(0); - TC0220IOCInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Qtorimon68KReadByte); - SekSetWriteByteHandler(0, Qtorimon68KWriteByte); - SekSetReadWordHandler(0, Qtorimon68KReadWord); - SekSetWriteWordHandler(0, Qtorimon68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayed; - TaitoDrawFunction = QtorimonDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 QuizhqInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumSpriteA = 0x1000; - - TaitoLoadRoms(0); - - Taito68KRom1Size = 0xc0000; - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - memcpy(Taito68KRom1 + 0x80000, Taito68KRom1 + 0x40000, 0x40000); - memset(Taito68KRom1 + 0x40000, 0, 0x40000); - - TC0110PCRInit(1, 0x1000); - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, NULL); - TC0140SYTInit(0); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x0bffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Quizhq68KReadByte); - SekSetWriteByteHandler(0, Quizhq68KWriteByte); - SekSetReadWordHandler(0, Quizhq68KReadWord); - SekSetWriteWordHandler(0, Quizhq68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayed; - TaitoDrawFunction = QtorimonDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 QzchikyuInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, NULL); - TC0140SYTInit(0); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x40000 , 0x100000, 0x17ffff, MAP_ROM); - SekMapMemory(TaitoPaletteRam , 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(Taito68KRam1 , 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x700000, 0x70ffff, MAP_READ); - SekSetReadByteHandler(0, Qzchikyu68KReadByte); - SekSetWriteByteHandler(0, Qzchikyu68KWriteByte); - SekSetReadWordHandler(0, Qzchikyu68KReadWord); - SekSetWriteWordHandler(0, Qzchikyu68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayedQzchikyu; - TaitoDrawFunction = QzquestDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 QzquestInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, NULL); - TC0140SYTInit(0); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x40000 , 0x100000, 0x1fffff, MAP_ROM); - SekMapMemory(TaitoPaletteRam , 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(Taito68KRam1 , 0x500000, 0x50ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x700000, 0x70ffff, MAP_READ); - SekSetReadByteHandler(0, Qzquest68KReadByte); - SekSetWriteByteHandler(0, Qzquest68KWriteByte); - SekSetReadWordHandler(0, Qzquest68KReadWord); - SekSetWriteWordHandler(0, Qzquest68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayed; - TaitoDrawFunction = QzquestDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 SolfigtrInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x8000; - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, TaitoPriorityMap); - TC0140SYTInit(0); - TC0360PRIInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x201fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekSetReadByteHandler(0, Solfigtr68KReadByte); - SekSetWriteByteHandler(0, Solfigtr68KWriteByte); - SekSetReadWordHandler(0, Solfigtr68KReadWord); - SekSetWriteWordHandler(0, Solfigtr68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 SsiInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 0, 0, 0, NULL); - TC0140SYTInit(0); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x300000, 0x301fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x600000, 0x60ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x800000, 0x80ffff, MAP_RAM); - SekSetReadByteHandler(0, Ssi68KReadByte); - SekSetWriteByteHandler(0, Ssi68KWriteByte); - SekSetReadWordHandler(0, Ssi68KReadWord); - SekSetWriteWordHandler(0, Ssi68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayedThundfox; - TaitoDrawFunction = SsiDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 ThundfoxInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoNumChar = 0x4000; - - TaitoCharBModulo = 0x100; - TaitoCharBNumPlanes = 4; - TaitoCharBWidth = 8; - TaitoCharBHeight = 8; - TaitoCharBPlaneOffsets = CharPlaneOffsets; - TaitoCharBXOffsets = CharXOffsets; - TaitoCharBYOffsets = CharYOffsets; - TaitoNumCharB = 0x4000; - - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, NULL); - TC0100SCNSetClipArea(0, nScreenWidth, nScreenHeight, 0); - TC0100SCNInit(1, TaitoNumCharB, 3, 16, 0, NULL); - TC0100SCNSetClipArea(1, nScreenWidth, nScreenHeight, 0); - TC0140SYTInit(0); - TC0220IOCInit(); - TC0360PRIInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(TaitoPaletteRam , 0x100000, 0x101fff, MAP_RAM); - SekMapMemory(Taito68KRam1 , 0x300000, 0x30ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x400000, 0x40ffff, MAP_READ); - SekMapMemory(TC0100SCNRam[1] , 0x500000, 0x50ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x600000, 0x60ffff, MAP_RAM); - SekSetReadByteHandler(0, Thundfox68KReadByte); - SekSetWriteByteHandler(0, Thundfox68KWriteByte); - SekSetReadWordHandler(0, Thundfox68KReadWord); - SekSetWriteWordHandler(0, Thundfox68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoXOffset = 3; - TaitoF2SpriteBufferFunction = TaitoF2PartialBufferDelayedThundfox; - TaitoDrawFunction = ThundfoxDraw; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 YesnojInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoCharModulo = 0x40; - TaitoCharNumPlanes = 1; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = YuyugogoCharPlaneOffsets; - TaitoCharXOffsets = YuyugogoCharXOffsets; - TaitoCharYOffsets = YuyugogoCharYOffsets; - TaitoNumChar = 0x10000; - - TaitoNumSpriteA = 0x2000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, NULL); - TC0140SYTInit(0); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x200000, 0x20ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x500000, 0x50ffff, MAP_READ); - SekMapMemory(TaitoPaletteRam , 0x600000, 0x601fff, MAP_RAM); - SekSetReadByteHandler(0, Yesnoj68KReadByte); - SekSetWriteByteHandler(0, Yesnoj68KWriteByte); - SekSetReadWordHandler(0, Yesnoj68KReadWord); - SekSetWriteWordHandler(0, Yesnoj68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoDrawFunction = YuyugogoDraw; - TaitoXOffset = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 YuyugogoInit() -{ - INT32 nLen; - - TaitoF2Init(); - - TaitoCharModulo = 0x40; - TaitoCharNumPlanes = 1; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = YuyugogoCharPlaneOffsets; - TaitoCharXOffsets = YuyugogoCharXOffsets; - TaitoCharYOffsets = YuyugogoCharYOffsets; - TaitoNumChar = 0x4000; - - TaitoNumSpriteA = 0x4000; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0100SCNInit(0, TaitoNumChar, 3, 8, 0, NULL); - TC0140SYTInit(0); - TC0510NIOInit(); - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(TC0100SCNRam[0] , 0x800000, 0x80ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0x900000, 0x90ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0xa00000, 0xa01fff, MAP_RAM); - SekMapMemory(Taito68KRam1 , 0xb00000, 0xb10fff, MAP_RAM); - SekMapMemory(TaitoSpriteExtension , 0xc00000, 0xc01fff, MAP_RAM); - SekMapMemory(Taito68KRom1 + 0x40000 , 0xd00000, 0xdfffff, MAP_ROM); - SekSetReadByteHandler(0, Yuyugogo68KReadByte); - SekSetWriteByteHandler(0, Yuyugogo68KWriteByte); - SekSetReadWordHandler(0, Yuyugogo68KReadWord); - SekSetWriteWordHandler(0, Yuyugogo68KWriteWord); - SekClose(); - - TaitoF2SoundInit(); - - TaitoDrawFunction = YuyugogoDraw; - TaitoF2SpriteType = 1; - TaitoXOffset = 3; - - // Reset the driver - TaitoF2DoReset(); - - return 0; -} - -static INT32 TaitoF2Exit() -{ - TaitoExit(); - - TaitoF2SpritesFlipScreen = 0; - TaitoF2SpriteBlendMode = 0; - TaitoF2TilePriority[0] = TaitoF2TilePriority[1] = TaitoF2TilePriority[2] = TaitoF2TilePriority[3] = TaitoF2TilePriority[4] = 0; - TaitoF2SpritePriority[0] = TaitoF2SpritePriority[1] = TaitoF2SpritePriority[2] = TaitoF2SpritePriority[3] = 0; - - TaitoF2SpriteType = 0; - Footchmp = 0; - YesnoDip = 0; - MjnquestInput = 0; - DriveoutSoundNibble = 0; - DriveoutOkiBank = 0; - - TaitoF2SpriteBufferFunction = NULL; - -#ifdef BUILD_A68K - // Switch back CPU core if needed - if (bUseAsm68KCoreOldValue) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching back to A68K core\n")); -#endif - bUseAsm68KCoreOldValue = false; - bBurnUseASMCPUEmulation = true; - } -#endif - - return 0; -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - - -inline static INT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 12); - g = pal4bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 8); - b = pal4bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 4); - - return BurnHighCol(r, g, b, 0); -} - -inline static INT32 QzquestCalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 10); - g = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 5); - b = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 0); - - return BurnHighCol(r, g, b, 0); -} - -static void TaitoF2CalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)TaitoPaletteRam, pd = TaitoPalette; i < 0x1000; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void MetalbCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)TaitoPaletteRam, pd = TaitoPalette; i < 0x2000; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void QzquestCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)TaitoPaletteRam, pd = TaitoPalette; i < 0x1000; i++, ps++, pd++) { - *pd = QzquestCalcCol(*ps); - } -} - -static void UpdateTaitoF2SpriteBanks() -{ - INT32 i; - - for (i = 0; i < 8; i++) { - TaitoF2SpriteBank[i] = TaitoF2SpriteBankBuffered[i]; - } -} - -void TaitoF2HandleSpriteBuffering() -{ - if (TaitoF2PrepareSprites) { - memcpy(TaitoSpriteRamBuffered, TaitoSpriteRam, 0x10000); - TaitoF2PrepareSprites = 0; - } -} - -static void TaitoF2UpdateSpritesActiveArea() -{ - INT32 Off; - UINT16 *SpriteRamBuffered = (UINT16*)TaitoSpriteRamBuffered; - - UpdateTaitoF2SpriteBanks(); - - TaitoF2HandleSpriteBuffering(); - - if (TaitoF2SpritesActiveArea == 0x8000 && SpriteRamBuffered[(0x8000 + 6) / 2] == 0 && SpriteRamBuffered[(0x8000 + 10) / 2] == 0) TaitoF2SpritesActiveArea = 0; - - for (Off = 0; Off < 0x4000; Off += 16) { - INT32 Offs = Off + TaitoF2SpritesActiveArea; - - if (SpriteRamBuffered[(Offs + 6) / 2] & 0x8000) { - TaitoF2SpritesDisabled = SpriteRamBuffered[(Offs + 10) / 2] & 0x1000; - if (Footchmp) { - TaitoF2SpritesActiveArea = 0x8000 * (SpriteRamBuffered[(Offs + 6) / 2] & 0x0001); - } else { - TaitoF2SpritesActiveArea = 0x8000 * (SpriteRamBuffered[(Offs + 10) / 2] & 0x0001); - } - } - - if ((SpriteRamBuffered[(Offs + 4) / 2] & 0xf000) == 0xa000) { - TaitoF2SpritesMasterScrollX = SpriteRamBuffered[(Offs + 4) / 2] & 0xfff; - if (TaitoF2SpritesMasterScrollX >= 0x800) TaitoF2SpritesMasterScrollX -= 0x1000; - - TaitoF2SpritesMasterScrollY = SpriteRamBuffered[(Offs + 6) / 2] & 0xfff; - if (TaitoF2SpritesMasterScrollY >= 0x800) TaitoF2SpritesMasterScrollY -= 0x1000; - } - } -} - -static void RenderSpriteZoom(INT32 Code, INT32 sx, INT32 sy, INT32 Colour, INT32 xFlip, INT32 yFlip, INT32 xScale, INT32 yScale, INT32 Priority, UINT8* pSource) -{ - UINT8 *SourceBase = pSource + ((Code % TaitoNumSpriteA) * TaitoSpriteAWidth * TaitoSpriteAHeight); - - INT32 SpriteScreenHeight = (yScale * TaitoSpriteAHeight + 0x8000) >> 16; - INT32 SpriteScreenWidth = (xScale * TaitoSpriteAWidth + 0x8000) >> 16; - - Colour = 0x10 * (Colour % 0x100); - - if (TaitoF2SpritesFlipScreen) { - xFlip = !xFlip; - sx = 320 - sx - (xScale >> 12); - yFlip = !yFlip; - sy = 256 - sy - (yScale >> 12); - } - - if (SpriteScreenWidth && SpriteScreenHeight) { - INT32 dx = (TaitoSpriteAWidth << 16) / SpriteScreenWidth; - INT32 dy = (TaitoSpriteAHeight << 16) / SpriteScreenHeight; - - INT32 ex = sx + SpriteScreenWidth; - INT32 ey = sy + SpriteScreenHeight; - - INT32 xIndexBase; - INT32 yIndex; - - if (xFlip) { - xIndexBase = (SpriteScreenWidth - 1) * dx; - dx = -dx; - } else { - xIndexBase = 0; - } - - if (yFlip) { - yIndex = (SpriteScreenHeight - 1) * dy; - dy = -dy; - } else { - yIndex = 0; - } - - if (sx < 0) { - INT32 Pixels = 0 - sx; - sx += Pixels; - xIndexBase += Pixels * dx; - } - - if (sy < 0) { - INT32 Pixels = 0 - sy; - sy += Pixels; - yIndex += Pixels * dy; - } - - if (ex > nScreenWidth) { - INT32 Pixels = ex - nScreenWidth; - ex -= Pixels; - } - - if (ey > nScreenHeight) { - INT32 Pixels = ey - nScreenHeight; - ey -= Pixels; - } - - if (ex > sx) { - INT32 y; - - for (y = sy; y < ey; y++) { - UINT8 *Source = SourceBase + ((yIndex >> 16) * TaitoSpriteAWidth); - UINT16* pPixel = pTransDraw + (y * nScreenWidth); - - INT32 x, xIndex = xIndexBase; - for (x = sx; x < ex; x++) { - INT32 c = Source[xIndex >> 16]; - if (c != 0) { - if (TaitoF2SpriteBlendMode) { - INT32 Pri = TaitoPriorityMap[(y * nScreenWidth) + x]; - INT32 TilePri = 0; - - if (TaitoIC_TC0100SCNInUse) { - if (Pri == 1) TilePri = TaitoF2TilePriority[0]; - if (Pri == 2) TilePri = TaitoF2TilePriority[1]; - if (Pri == 4) TilePri = TaitoF2TilePriority[2]; - } - - if (((TaitoF2SpriteBlendMode & 0xc0) == 0xc0) && (Priority == (TilePri - 1))) { - pPixel[x] = ((c | Colour) & 0xfff0) | (pPixel[x] & 0x0f); - } else { - if (((TaitoF2SpriteBlendMode & 0xc0) == 0xc0) && (Priority == (TilePri + 1))) { - if (pPixel[x] & 0x0f) { - pPixel[x] = (pPixel[x] & 0xfff0) | ((c | Colour) & 0x0f); - } else { - pPixel[x] = c | Colour; - } - } else { - if (((TaitoF2SpriteBlendMode & 0xc0) == 0x80) && (Priority == (TilePri - 1))) { - pPixel[x] = pPixel[x] & 0xffef; - } else { - if (((TaitoF2SpriteBlendMode & 0xc0) == 0x80) && (Priority == (TilePri + 1))) { - pPixel[x] = (c | Colour) & 0xffef; - } else { - pPixel[x] = c | Colour; - } - } - } - } - } else { - pPixel[x] = c | Colour; - } - } - xIndex += dx; - } - - yIndex += dy; - } - } - } -} - -static void RenderSpriteZoomPriMask(INT32 Code, INT32 sx, INT32 sy, INT32 Colour, INT32 xFlip, INT32 yFlip, INT32 xScale, INT32 yScale, INT32 Priority, UINT8* pSource) -{ - UINT8 *SourceBase = pSource + ((Code % TaitoNumSpriteA) * TaitoSpriteAWidth * TaitoSpriteAHeight); - - INT32 SpriteScreenHeight = (yScale * TaitoSpriteAHeight + 0x8000) >> 16; - INT32 SpriteScreenWidth = (xScale * TaitoSpriteAWidth + 0x8000) >> 16; - - Colour = 0x10 * (Colour % 0x100); - Priority |= 1<<31; - if (TaitoF2SpritesFlipScreen) { - xFlip = !xFlip; - sx = 320 - sx - (xScale >> 12); - yFlip = !yFlip; - sy = 256 - sy - (yScale >> 12); - } - - if (SpriteScreenWidth && SpriteScreenHeight) { - INT32 dx = (TaitoSpriteAWidth << 16) / SpriteScreenWidth; - INT32 dy = (TaitoSpriteAHeight << 16) / SpriteScreenHeight; - - INT32 ex = sx + SpriteScreenWidth; - INT32 ey = sy + SpriteScreenHeight; - - INT32 xIndexBase; - INT32 yIndex; - - if (xFlip) { - xIndexBase = (SpriteScreenWidth - 1) * dx; - dx = -dx; - } else { - xIndexBase = 0; - } - - if (yFlip) { - yIndex = (SpriteScreenHeight - 1) * dy; - dy = -dy; - } else { - yIndex = 0; - } - - if (sx < 0) { - INT32 Pixels = 0 - sx; - sx += Pixels; - xIndexBase += Pixels * dx; - } - - if (sy < 0) { - INT32 Pixels = 0 - sy; - sy += Pixels; - yIndex += Pixels * dy; - } - - if (ex > nScreenWidth) { - INT32 Pixels = ex - nScreenWidth; - ex -= Pixels; - } - - if (ey > nScreenHeight) { - INT32 Pixels = ey - nScreenHeight; - ey -= Pixels; - } - - if (ex > sx) { - INT32 y; - - for (y = sy; y < ey; y++) { - UINT8 *Source = SourceBase + ((yIndex >> 16) * TaitoSpriteAWidth); - UINT16* pPixel = pTransDraw + (y * nScreenWidth); - UINT8 *pri = TaitoPriorityMap + (y * nScreenWidth); - - INT32 x, xIndex = xIndexBase; - for (x = sx; x < ex; x++) { - INT32 c = Source[xIndex >> 16]; - if (c) { - if ((Priority & (1 << (pri[x]&0x1f))) == 0) { - pPixel[x] = c | Colour; - } - pri[x] = 0x1f; - } - xIndex += dx; - } - - yIndex += dy; - } - } - } -} - -void TaitoF2MakeSpriteList() -{ - INT32 i, x, y, Off, ExtOffs; - INT32 Code, Colour, SpriteData, SpriteCont, xFlip, yFlip; - INT32 xCurrent, yCurrent, BigSprite = 0; - INT32 yNum = 0, xNum = 0, xLatch = 0, yLatch = 0, LastContinuationTile = 0; - UINT32 ZoomWord, xZoom, yZoom, zx = 0, zy = 0, xZoomLatch = 0, yZoomLatch = 0; - INT32 xScroll1, yScroll1; - INT32 xScroll = 0, yScroll = 0; - INT32 xCur, yCur; - INT32 xOffset = 0; - - INT32 Disabled = TaitoF2SpritesDisabled; - INT32 MasterScrollX = TaitoF2SpritesMasterScrollX; - INT32 MasterScrollY = TaitoF2SpritesMasterScrollY; - INT32 Area = TaitoF2SpritesActiveArea; - - UINT16 *SpriteRamBuffered = (UINT16*)TaitoSpriteRamBuffered; - UINT16 *SpriteExtension = (UINT16*)TaitoSpriteExtension; - struct TaitoF2SpriteEntry *SpritePtr = TaitoF2SpriteList; - - memset(TaitoF2SpriteList, 0, 0x400 * sizeof(TaitoF2SpriteEntry)); - - xScroll1 = 0; - yScroll1 = 0; - x = y = 0; - xCurrent = yCurrent = 0; - Colour = 0; - - xOffset = TaitoXOffset; - if (TaitoF2SpritesFlipScreen) xOffset = -TaitoXOffset; - - if (Area == 0x8000 && SpriteRamBuffered[(0x8000 + 6) / 2] == 0 && SpriteRamBuffered[(0x8000 + 10) / 2] == 0) Area = 0; - - for (Off = 0; Off < 0x4000; Off += 16) { - INT32 Offs = Off + Area; - - if (SpriteRamBuffered[(Offs + 6) / 2] & 0x8000) { - Disabled = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 10) / 2]) & 0x1000; - TaitoF2SpritesFlipScreen = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 10) / 2]) & 0x2000; - - xOffset = TaitoXOffset; - if (TaitoF2SpritesFlipScreen) xOffset = -TaitoXOffset; - - if (Footchmp) { - Area = 0x8000 * (BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 6) / 2]) & 0x0001); - } else { - Area = 0x8000 * (BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 10) / 2]) & 0x0001); - } - } - - if ((BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 4) / 2]) & 0xf000) == 0xa000) { - MasterScrollX = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 4) / 2]) & 0xfff; - if (MasterScrollX >= 0x800) MasterScrollX -= 0x1000; - - MasterScrollY = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 6) / 2]) & 0xfff; - if (MasterScrollY >= 0x800) MasterScrollY -= 0x1000; - } - - if ((BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 4) / 2]) & 0xf000) == 0x5000) { - xScroll1 = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 4) / 2]) & 0xfff; - if (xScroll1 >= 0x800) xScroll1 -= 0x1000; - - yScroll1 = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 6) / 2]) & 0xfff; - if (yScroll1 >= 0x800) yScroll1 -= 0x1000; - } - - if (Disabled) - continue; - - SpriteData = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 8) / 2]); - - SpriteCont = (SpriteData & 0xff00) >> 8; - - if ((SpriteCont & 0x08) != 0) { - if (BigSprite == 0) { - xLatch = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 4) / 2]) & 0xfff; - yLatch = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 6) / 2]) & 0xfff; - xNum = 0; - yNum = 0; - ZoomWord = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 2) / 2]); - yZoomLatch = (ZoomWord >> 8) & 0xff; - xZoomLatch = (ZoomWord) & 0xff; - BigSprite = 1; - } - } else if (BigSprite) { - LastContinuationTile = 1; - } - - if ((SpriteCont & 0x04) == 0) Colour = SpriteData & 0xff; - - if (BigSprite == 0 || (SpriteCont & 0xf0) == 0) { - x = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 4) / 2]); - - if (x & 0x8000) { - xScroll = -xOffset - 0x60; - yScroll = 0; - } else if (x & 0x4000) { - xScroll = MasterScrollX - xOffset - 0x60; - yScroll = MasterScrollY; - } else { - xScroll = xScroll1 + MasterScrollX - xOffset - 0x60; - yScroll = yScroll1 + MasterScrollY; - } - - x &= 0xfff; - y = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[(Offs + 6) / 2]) & 0xfff; - - xCurrent = x; - yCurrent = y; - } else { - if ((SpriteCont & 0x10) == 0) { - y = yCurrent; - } else if ((SpriteCont & 0x20) != 0) { - y += 16; - yNum++; - } - - if ((SpriteCont & 0x40) == 0) { - x = xCurrent; - } else if ((SpriteCont & 0x80) != 0){ - x += 16; - yNum=0; - xNum++; - } - } - - if (BigSprite) { - xZoom = xZoomLatch; - yZoom = yZoomLatch; - zx = 0x10; - zy = 0x10; - - if (xZoom || yZoom) { - x = xLatch + (xNum * (0x100 - xZoom) + 12) / 16; - y = yLatch + (yNum * (0x100 - yZoom) + 12) / 16; - zx = xLatch + ((xNum + 1) * (0x100 - xZoom) + 12) / 16 - x; - zy = yLatch + ((yNum + 1) * (0x100 - yZoom) + 12) / 16 - y; - } - } else { - ZoomWord = SpriteRamBuffered[(Offs + 2) / 2]; - yZoom = (ZoomWord >> 8) & 0xff; - xZoom = (ZoomWord) & 0xff; - zx = (0x100 - xZoom) / 16; - zy = (0x100 - yZoom) / 16; - } - - if (LastContinuationTile) { - BigSprite = 0; - LastContinuationTile = 0; - } - - Code = 0; - ExtOffs = Offs; - if (ExtOffs >= 0x8000) ExtOffs -= 0x4000; - - if (TaitoF2SpriteType == 0) { - Code = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[Offs / 2]) & 0x1fff; - i = (Code & 0x1c00) >> 10; - Code = TaitoF2SpriteBank[i] + (Code & 0x3ff); - } - - if (TaitoF2SpriteType == 1) { - Code = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[Offs / 2]) & 0x3ff; - i = (BURN_ENDIAN_SWAP_INT16(SpriteExtension[(ExtOffs >> 4)]) & 0x3f) << 10; - Code = (i | Code); - } - - if (TaitoF2SpriteType == 2) { - Code = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[Offs / 2]) & 0xff; - i = (BURN_ENDIAN_SWAP_INT16(SpriteExtension[(ExtOffs >> 4)]) & 0xff00); - Code = (i | Code); - } - - if (TaitoF2SpriteType == 3) { - Code = BURN_ENDIAN_SWAP_INT16(SpriteRamBuffered[Offs / 2]) & 0xff; - i = (BURN_ENDIAN_SWAP_INT16(SpriteExtension[ExtOffs >> 4]) & 0xff) << 8; - Code = (i | Code); - } - - if (Code == 0) continue; - - xFlip = SpriteCont & 0x01; - yFlip = SpriteCont & 0x02; - - xCur = (x + xScroll) & 0xfff; - if (xCur >= 0x800) xCur -= 0x1000; - - yCur = (y + yScroll) & 0xfff; - if (yCur >= 0x800) yCur -= 0x1000; - - if (TaitoF2SpritesFlipScreen) { - yCur += 16; - } else { - yCur -= 16; - } - - INT32 Priority = (Colour & 0xc0) >> 6; - - SpritePtr->Code = Code; - SpritePtr->x = xCur; - SpritePtr->y = yCur; - SpritePtr->Colour = Colour; - SpritePtr->xFlip = xFlip; - SpritePtr->yFlip = yFlip; - SpritePtr->xZoom = zx << 12; - SpritePtr->yZoom = zy << 12; - SpritePtr->Priority = TaitoF2SpritePriority[Priority]; - SpritePtr->Priority_Raw = Priority; - SpritePtr++; - } -} - -void TaitoF2RenderSpriteList(INT32 TaitoF2SpritePriorityLevel) -{ - for (INT32 i = 0; i < 0x400; i++) { - if (TaitoF2SpriteList[i].Priority == TaitoF2SpritePriorityLevel) RenderSpriteZoom(TaitoF2SpriteList[i].Code, TaitoF2SpriteList[i].x, TaitoF2SpriteList[i].y, TaitoF2SpriteList[i].Colour, TaitoF2SpriteList[i].xFlip, TaitoF2SpriteList[i].yFlip, TaitoF2SpriteList[i].xZoom, TaitoF2SpriteList[i].yZoom, TaitoF2SpritePriorityLevel, TaitoSpritesA); - } -} - -void TaitoF2RenderSpriteListPriMasks(INT32 *primasks) -{ - for (INT32 i = 0x400-1; i > -1; i--) { - RenderSpriteZoomPriMask(TaitoF2SpriteList[i].Code, TaitoF2SpriteList[i].x, TaitoF2SpriteList[i].y, TaitoF2SpriteList[i].Colour, TaitoF2SpriteList[i].xFlip, TaitoF2SpriteList[i].yFlip, TaitoF2SpriteList[i].xZoom, TaitoF2SpriteList[i].yZoom, primasks[TaitoF2SpriteList[i].Priority_Raw & 3], TaitoSpritesA); - } -} - -void TaitoF2NoBuffer() -{ - TaitoF2UpdateSpritesActiveArea(); - TaitoF2PrepareSprites = 1; -} - -void TaitoF2PartialBufferDelayed() -{ - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - UINT16 *SpriteRamBuffered = (UINT16*)TaitoSpriteRamBuffered; - - TaitoF2UpdateSpritesActiveArea(); - TaitoF2PrepareSprites = 0; - memcpy(TaitoSpriteRamBuffered, TaitoSpriteRamDelayed, 0x10000); - for (INT32 i = 0; i < 0x10000 / 2; i += 4) SpriteRamBuffered[i] = SpriteRam[i]; - memcpy(TaitoSpriteRamDelayed, TaitoSpriteRam, 0x10000); -} - -void TaitoF2PartialBufferDelayedQzchikyu() -{ - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - UINT16 *SpriteRamBuffered = (UINT16*)TaitoSpriteRamBuffered; - - TaitoF2UpdateSpritesActiveArea(); - TaitoF2PrepareSprites = 0; - memcpy(TaitoSpriteRamBuffered, TaitoSpriteRamDelayed, 0x10000); - for (INT32 i = 0; i < 0x10000 / 2; i += 8) { - SpriteRamBuffered[i + 0] = SpriteRam[i + 0]; - SpriteRamBuffered[i + 1] = SpriteRam[i + 1]; - SpriteRamBuffered[i + 4] = SpriteRam[i + 4]; - SpriteRamBuffered[i + 5] = SpriteRam[i + 5]; - SpriteRamBuffered[i + 6] = SpriteRam[i + 6]; - SpriteRamBuffered[i + 7] = SpriteRam[i + 7]; - } - memcpy(TaitoSpriteRamDelayed, TaitoSpriteRam, 0x10000); -} - -void TaitoF2PartialBufferDelayedThundfox() -{ - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - UINT16 *SpriteRamBuffered = (UINT16*)TaitoSpriteRamBuffered; - - TaitoF2UpdateSpritesActiveArea(); - TaitoF2PrepareSprites = 0; - memcpy(TaitoSpriteRamBuffered, TaitoSpriteRamDelayed, 0x10000); - for (INT32 i = 0; i < 0x10000 / 2; i += 8) { - SpriteRamBuffered[i + 0] = SpriteRam[i + 0]; - SpriteRamBuffered[i + 1] = SpriteRam[i + 1]; - SpriteRamBuffered[i + 4] = SpriteRam[i + 4]; - } - memcpy(TaitoSpriteRamDelayed, TaitoSpriteRam, 0x10000); -} - -void TaitoF2FullBufferDelayed() -{ - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - UINT16 *SpriteRamBuffered = (UINT16*)TaitoSpriteRamBuffered; - - TaitoF2UpdateSpritesActiveArea(); - TaitoF2PrepareSprites = 0; - memcpy(TaitoSpriteRamBuffered, TaitoSpriteRamDelayed, 0x10000); - for (INT32 i = 0;i < 0x10000 / 2; i++) SpriteRamBuffered[i] = SpriteRam[i]; - memcpy(TaitoSpriteRamDelayed, TaitoSpriteRam, 0x10000); -} - -static void TaitoF2Draw() -{ - INT32 i; - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - INT32 DrawLayer0 = 1; - INT32 DrawLayer1 = 1; - INT32 DrawLayer2 = 1; - - if (TC0100SCNBottomLayer(0)) { - TaitoF2TilePriority[1] = TC0360PRIRegs[5] & 0x0f; - TaitoF2TilePriority[0] = TC0360PRIRegs[5] >> 4; - } else { - TaitoF2TilePriority[0] = TC0360PRIRegs[5] & 0x0f; - TaitoF2TilePriority[1] = TC0360PRIRegs[5] >> 4; - } - TaitoF2TilePriority[2] = TC0360PRIRegs[4] >> 4; - - if (TaitoF2TilePriority[1] < TaitoF2TilePriority[0]) TaitoF2TilePriority[1] = TaitoF2TilePriority[0]; - - TaitoF2SpritePriority[0] = TC0360PRIRegs[6] & 0x0f; - TaitoF2SpritePriority[1] = TC0360PRIRegs[6] >> 4; - TaitoF2SpritePriority[2] = TC0360PRIRegs[7] & 0x0f; - TaitoF2SpritePriority[3] = TC0360PRIRegs[7] >> 4; - - TaitoF2SpriteBlendMode = TC0360PRIRegs[0] & 0xc0; - - BurnTransferClear(); - TaitoF2CalcPalette(); - - // Detect when we are using sprite blending with the sprite under the tile layer - UINT8 TileAltPriority[3] = { 0xff, 0xff, 0xff }; - if (TaitoF2SpriteBlendMode) { - for (i = 0; i < 4; i++) { - if (TaitoF2SpritePriority[i] == TaitoF2TilePriority[0] - 1) { - TileAltPriority[0] = TaitoF2SpritePriority[i]; - DrawLayer0 = 0; - } - - if (TaitoF2SpritePriority[i] == TaitoF2TilePriority[1] - 1) { - TileAltPriority[1] = TaitoF2SpritePriority[i]; - DrawLayer1 = 0; - } - - if (TaitoF2SpritePriority[i] == TaitoF2TilePriority[2] - 1) { - TileAltPriority[2] = TaitoF2SpritePriority[i]; - DrawLayer2 = 0; - } - } - } - - TaitoF2MakeSpriteList(); - - if (TC0100SCNBottomLayer(0)) { - for (i = 0; i < 16; i++) { - if (TileAltPriority[0] == i) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TileAltPriority[1] == i) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TileAltPriority[2] == i) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (TaitoF2TilePriority[0] == i && DrawLayer0) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[1] == i && DrawLayer1) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[2] == i && DrawLayer2) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - } - } else { - for (i = 0; i < 16; i++) { - if (TileAltPriority[0] == i) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TileAltPriority[1] == i) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TileAltPriority[2] == i) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (TaitoF2TilePriority[0] == i && DrawLayer0) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[1] == i && DrawLayer1) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[2] == i && DrawLayer2) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - } - } - - BurnTransferCopy(TaitoPalette); -} - -static void TaitoF2PivotDraw() -{ - INT32 i; - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - INT32 DrawLayer0 = 1; - INT32 DrawLayer1 = 1; - INT32 DrawLayer2 = 1; - INT32 RozPriority; - - if (TC0100SCNBottomLayer(0)) { - TaitoF2TilePriority[1] = TC0360PRIRegs[5] & 0x0f; - TaitoF2TilePriority[0] = TC0360PRIRegs[5] >> 4; - } else { - TaitoF2TilePriority[0] = TC0360PRIRegs[5] & 0x0f; - TaitoF2TilePriority[1] = TC0360PRIRegs[5] >> 4; - } - TaitoF2TilePriority[2] = TC0360PRIRegs[4] >> 4; - - if (TaitoF2TilePriority[1] < TaitoF2TilePriority[0]) TaitoF2TilePriority[1] = TaitoF2TilePriority[0]; - - TaitoF2SpritePriority[0] = TC0360PRIRegs[6] & 0x0f; - TaitoF2SpritePriority[1] = TC0360PRIRegs[6] >> 4; - TaitoF2SpritePriority[2] = TC0360PRIRegs[7] & 0x0f; - TaitoF2SpritePriority[3] = TC0360PRIRegs[7] >> 4; - - TaitoF2SpriteBlendMode = TC0360PRIRegs[0] & 0xc0; - - RozPriority = (TC0360PRIRegs[1] & 0xc0) >> 6; - RozPriority = (TC0360PRIRegs[8 + (RozPriority / 2)] >> 4 * (RozPriority & 1)) & 0x0f; - TC0280GRDBaseColour = (TC0360PRIRegs[1] & 0x3f) << 2; - -// bprintf(PRINT_NORMAL, _T("TCBL %x, Blend %x, Roz %x, RozBase %x, T0 %x, T1 %x, T2 %x, S0 %x, S1 %x, S2 %x, S3 %x\n"), TC0100SCNBottomLayer(0), TaitoF2SpriteBlendMode, RozPriority, TaitoRozBaseColour, TaitoF2TilePriority[0], TaitoF2TilePriority[1], TaitoF2TilePriority[2], TaitoF2SpritePriority[0], TaitoF2SpritePriority[1], TaitoF2SpritePriority[2], TaitoF2SpritePriority[3]); - - BurnTransferClear(); - TaitoF2CalcPalette(); - - // Detect when we are using sprite blending with the sprite under the tile layer - UINT8 TileAltPriority[3] = { 0xff, 0xff, 0xff }; - if (TaitoF2SpriteBlendMode) { - for (i = 0; i < 4; i++) { - if (TaitoF2SpritePriority[i] == TaitoF2TilePriority[0] - 1) { - TileAltPriority[0] = TaitoF2SpritePriority[i]; - DrawLayer0 = 0; - } - - if (TaitoF2SpritePriority[i] == TaitoF2TilePriority[1] - 1) { - TileAltPriority[1] = TaitoF2SpritePriority[i]; - DrawLayer1 = 0; - } - - if (TaitoF2SpritePriority[i] == TaitoF2TilePriority[2] - 1) { - TileAltPriority[2] = TaitoF2SpritePriority[i]; - DrawLayer2 = 0; - } - } - } - - TaitoF2MakeSpriteList(); - - if (TC0100SCNBottomLayer(0)) { - for (i = 0; i < 16; i++) { - if (TileAltPriority[0] == i) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TileAltPriority[1] == i) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TileAltPriority[2] == i) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (RozPriority == i) TC0280GRDRenderLayer(); - if (TaitoF2TilePriority[0] == i && DrawLayer0) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[1] == i && DrawLayer1) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[2] == i && DrawLayer2) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - } - } else { - for (i = 0; i < 16; i++) { - if (TileAltPriority[0] == i) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TileAltPriority[1] == i) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TileAltPriority[2] == i) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (RozPriority == i) TC0280GRDRenderLayer(); - if (TaitoF2TilePriority[0] == i && DrawLayer0) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[1] == i && DrawLayer1) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[2] == i && DrawLayer2) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - } - } - - BurnTransferCopy(TaitoPalette); -} - -static void CameltryDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - INT32 i; - - INT32 RozPriority; - - TaitoF2TilePriority[2] = TC0360PRIRegs[4] >> 4; - - TaitoF2SpritePriority[0] = TC0360PRIRegs[6] & 0x0f; - TaitoF2SpritePriority[1] = TC0360PRIRegs[6] >> 4; - TaitoF2SpritePriority[2] = TC0360PRIRegs[7] & 0x0f; - TaitoF2SpritePriority[3] = TC0360PRIRegs[7] >> 4; - - RozPriority = (TC0360PRIRegs[1] & 0xc0) >> 6; - RozPriority = (TC0360PRIRegs[8 + (RozPriority / 2)] >> 4 * (RozPriority & 1)) & 0x0f; - TC0280GRDBaseColour = (TC0360PRIRegs[1] & 0x3f) << 2; - - BurnTransferClear(); - TaitoF2CalcPalette(); - - TaitoF2MakeSpriteList(); - - for (i = 0; i < 16; i++) { - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (RozPriority == i) TC0280GRDRenderLayer(); - if (TaitoF2TilePriority[2] == i) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - } - - BurnTransferCopy(TaitoPalette); -} - -static void DriftoutDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - INT32 i; - - INT32 RozPriority; - - TaitoF2TilePriority[2] = TC0360PRIRegs[4] >> 4; - - TaitoF2SpritePriority[0] = TC0360PRIRegs[6] & 0x0f; - TaitoF2SpritePriority[1] = TC0360PRIRegs[6] >> 4; - TaitoF2SpritePriority[2] = TC0360PRIRegs[7] & 0x0f; - TaitoF2SpritePriority[3] = TC0360PRIRegs[7] >> 4; - - RozPriority = (TC0360PRIRegs[1] & 0xc0) >> 6; - RozPriority = (TC0360PRIRegs[8 + (RozPriority / 2)] >> 4 * (RozPriority & 1)) & 0x0f; - TC0280GRDBaseColour = (TC0360PRIRegs[1] & 0x3f) << 2; - - BurnTransferClear(); - QzquestCalcPalette(); - - TaitoF2MakeSpriteList(); - - for (i = 0; i < 16; i++) { - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (RozPriority == i) TC0430GRWRenderLayer(); - if (TaitoF2TilePriority[2] == i) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - } - - BurnTransferCopy(TaitoPalette); -} - -static void FinalbDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - - TaitoF2SpritePriority[0] = 0; - TaitoF2SpritePriority[1] = 0; - TaitoF2SpritePriority[2] = 0; - TaitoF2SpritePriority[3] = 0; - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - TaitoF2MakeSpriteList(); - - TaitoF2RenderSpriteList(0); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TC0110PCRPalette); -} - -static void FootchmpDraw() -{ - UINT8 Layer[4]; - UINT16 Priority = TC0480SCPGetBgPriority(); - - Layer[0] = (Priority & 0xf000) >> 12; - Layer[1] = (Priority & 0x0f00) >> 8; - Layer[2] = (Priority & 0x00f0) >> 4; - Layer[3] = (Priority & 0x000f) >> 0; - - TaitoF2TilePriority[0] = TC0360PRIRegs[4] >> 4; - TaitoF2TilePriority[1] = TC0360PRIRegs[5] & 0x0f; - TaitoF2TilePriority[2] = TC0360PRIRegs[5] >> 4; - TaitoF2TilePriority[3] = TC0360PRIRegs[4] & 0x0f; - TaitoF2TilePriority[4] = TC0360PRIRegs[7] >> 4; - - TaitoF2SpritePriority[0] = TC0360PRIRegs[6] & 0x0f; - TaitoF2SpritePriority[1] = TC0360PRIRegs[6] >> 4; - TaitoF2SpritePriority[2] = TC0360PRIRegs[7] & 0x0f; - TaitoF2SpritePriority[3] = TC0360PRIRegs[7] >> 4; - - BurnTransferClear(); - TaitoF2CalcPalette(); - - TaitoF2MakeSpriteList(); - - for (INT32 i = 0; i < 16; i++) { - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (TaitoF2TilePriority[0] == i) TC0480SCPTilemapRender(Layer[0], 0, TaitoChars); - if (TaitoF2TilePriority[1] == i) TC0480SCPTilemapRender(Layer[1], 0, TaitoChars); - if (TaitoF2TilePriority[2] == i) TC0480SCPTilemapRender(Layer[2], 0, TaitoChars); - if (TaitoF2TilePriority[3] == i) TC0480SCPTilemapRender(Layer[3], 0, TaitoChars); - } - - TC0480SCPRenderCharLayer(); - - BurnTransferCopy(TaitoPalette); -} - -static void MetalbDraw() -{ - UINT8 Layer[4]; - UINT16 Priority = TC0480SCPGetBgPriority(); - - Layer[0] = (Priority & 0xf000) >> 12; - Layer[1] = (Priority & 0x0f00) >> 8; - Layer[2] = (Priority & 0x00f0) >> 4; - Layer[3] = (Priority & 0x000f) >> 0; - - TaitoF2TilePriority[Layer[0]] = TC0360PRIRegs[4] & 0x0f; - TaitoF2TilePriority[Layer[1]] = TC0360PRIRegs[4] >> 4; - TaitoF2TilePriority[Layer[2]] = TC0360PRIRegs[5] & 0x0f; - TaitoF2TilePriority[Layer[3]] = TC0360PRIRegs[5] >> 4; - TaitoF2TilePriority[4] = TC0360PRIRegs[9] & 0x0f; - - if (TaitoF2TilePriority[1] < TaitoF2TilePriority[0]) TaitoF2TilePriority[1] = TaitoF2TilePriority[0]; - if (TaitoF2TilePriority[2] < TaitoF2TilePriority[1]) TaitoF2TilePriority[2] = TaitoF2TilePriority[1]; - if (TaitoF2TilePriority[3] < TaitoF2TilePriority[2]) TaitoF2TilePriority[3] = TaitoF2TilePriority[2]; - - TaitoF2SpritePriority[0] = TC0360PRIRegs[6] & 0x0f; - TaitoF2SpritePriority[1] = TC0360PRIRegs[6] >> 4; - TaitoF2SpritePriority[2] = TC0360PRIRegs[7] & 0x0f; - TaitoF2SpritePriority[3] = TC0360PRIRegs[7] >> 4; - - TaitoF2SpriteBlendMode = TC0360PRIRegs[0] & 0xc0; - -// bprintf(PRINT_IMPORTANT, _T("SPR Bl %x, T0 %x, T1 %x, T2 %x, T3 %x, T4 %x, S0 %x, S1 %x, S2 %x, S3 %x\n"), TaitoF2SpriteBlendMode, TaitoF2TilePriority[0], TaitoF2TilePriority[1], TaitoF2TilePriority[2], TaitoF2TilePriority[3], TaitoF2TilePriority[4], TaitoF2SpritePriority[0], TaitoF2SpritePriority[1], TaitoF2SpritePriority[2], TaitoF2SpritePriority[3]); -// bprintf(PRINT_NORMAL, _T("L0 %x %x, L1 %x %x, L2 %x %x, L3 %x %x\n"), Layer[0], TaitoF2TilePriority[0], Layer[1], TaitoF2TilePriority[1], Layer[2], TaitoF2TilePriority[2], Layer[3], TaitoF2TilePriority[3]); - - BurnTransferClear(); - MetalbCalcPalette(); - - TaitoF2MakeSpriteList(); - - for (INT32 i = 0; i < 16; i++) { - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (TaitoF2TilePriority[0] == i) TC0480SCPTilemapRender(Layer[0], 0, TaitoChars); - if (TaitoF2TilePriority[1] == i) TC0480SCPTilemapRender(Layer[1], 0, TaitoChars); - if (TaitoF2TilePriority[2] == i) TC0480SCPTilemapRender(Layer[2], 0, TaitoChars); - if (TaitoF2TilePriority[3] == i) TC0480SCPTilemapRender(Layer[3], 0, TaitoChars); - } - - TC0480SCPRenderCharLayer(); - - BurnTransferCopy(TaitoPalette); -} - -static void PulirulaDraw() -{ - INT32 i; - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - INT32 DrawLayer0 = 1; - INT32 DrawLayer1 = 1; - INT32 DrawLayer2 = 1; - INT32 RozPriority; - - if (TC0100SCNBottomLayer(0)) { - TaitoF2TilePriority[1] = TC0360PRIRegs[5] & 0x0f; - TaitoF2TilePriority[0] = TC0360PRIRegs[5] >> 4; - } else { - TaitoF2TilePriority[0] = TC0360PRIRegs[5] & 0x0f; - TaitoF2TilePriority[1] = TC0360PRIRegs[5] >> 4; - } - TaitoF2TilePriority[2] = TC0360PRIRegs[4] >> 4; - - if (TaitoF2TilePriority[1] < TaitoF2TilePriority[0]) TaitoF2TilePriority[1] = TaitoF2TilePriority[0]; - - TaitoF2SpritePriority[0] = TC0360PRIRegs[6] & 0x0f; - TaitoF2SpritePriority[1] = TC0360PRIRegs[6] >> 4; - TaitoF2SpritePriority[2] = TC0360PRIRegs[7] & 0x0f; - TaitoF2SpritePriority[3] = TC0360PRIRegs[7] >> 4; - - TaitoF2SpriteBlendMode = TC0360PRIRegs[0] & 0xc0; - - RozPriority = (TC0360PRIRegs[1] & 0xc0) >> 6; - RozPriority = (TC0360PRIRegs[8 + (RozPriority / 2)] >> 4 * (RozPriority & 1)) & 0x0f; - TC0280GRDBaseColour = (TC0360PRIRegs[1] & 0x3f) << 2; - - bprintf(PRINT_NORMAL, _T("TCBL %x, Blend %x, Roz %x, RozBase %x, T0 %x, T1 %x, T2 %x, S0 %x, S1 %x, S2 %x, S3 %x\n"), TC0100SCNBottomLayer(0), TaitoF2SpriteBlendMode, RozPriority, TC0280GRDBaseColour, TaitoF2TilePriority[0], TaitoF2TilePriority[1], TaitoF2TilePriority[2], TaitoF2SpritePriority[0], TaitoF2SpritePriority[1], TaitoF2SpritePriority[2], TaitoF2SpritePriority[3]); - - BurnTransferClear(); - QzquestCalcPalette(); - - // Detect when we are using sprite blending with the sprite under the tile layer - UINT8 TileAltPriority[3] = { 0xff, 0xff, 0xff }; - if (TaitoF2SpriteBlendMode) { - for (i = 0; i < 4; i++) { - if (TaitoF2SpritePriority[i] == TaitoF2TilePriority[0] - 1) { - TileAltPriority[0] = TaitoF2SpritePriority[i]; - DrawLayer0 = 0; - } - - if (TaitoF2SpritePriority[i] == TaitoF2TilePriority[1] - 1) { - TileAltPriority[1] = TaitoF2SpritePriority[i]; - DrawLayer1 = 0; - } - - if (TaitoF2SpritePriority[i] == TaitoF2TilePriority[2] - 1) { - TileAltPriority[2] = TaitoF2SpritePriority[i]; - DrawLayer2 = 0; - } - } - } - - TaitoF2MakeSpriteList(); - - if (TC0100SCNBottomLayer(0)) { - for (i = 0; i < 16; i++) { - if (TileAltPriority[0] == i) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TileAltPriority[1] == i) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TileAltPriority[2] == i) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (RozPriority == i) TC0430GRWRenderLayer(); - if (TaitoF2TilePriority[0] == i && DrawLayer0) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[1] == i && DrawLayer1) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[2] == i && DrawLayer2) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - } - } else { - for (i = 0; i < 16; i++) { - if (TileAltPriority[0] == i) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TileAltPriority[1] == i) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TileAltPriority[2] == i) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (RozPriority == i) TC0430GRWRenderLayer(); - if (TaitoF2TilePriority[0] == i && DrawLayer0) { if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[1] == i && DrawLayer1) { if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); } - if (TaitoF2TilePriority[2] == i && DrawLayer2) { if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); } - } - } - - BurnTransferCopy(TaitoPalette); -} - -static void QtorimonDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - - TaitoF2SpritePriority[0] = 0; - TaitoF2SpritePriority[1] = 0; - TaitoF2SpritePriority[2] = 0; - TaitoF2SpritePriority[3] = 0; - - TaitoF2MakeSpriteList(); - - TaitoF2RenderSpriteList(0); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TC0110PCRPalette); -} - -static void QzquestDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - QzquestCalcPalette(); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - TaitoF2SpritePriority[0] = 0; - TaitoF2SpritePriority[1] = 0; - TaitoF2SpritePriority[2] = 0; - TaitoF2SpritePriority[3] = 0; - - TaitoF2MakeSpriteList(); - - TaitoF2RenderSpriteList(0); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TaitoPalette); -} - -static void SsiDraw() -{ - BurnTransferClear(); - TaitoF2CalcPalette(); - - TaitoF2SpritePriority[0] = 0; - TaitoF2SpritePriority[1] = 0; - TaitoF2SpritePriority[2] = 0; - TaitoF2SpritePriority[3] = 0; - - TaitoF2MakeSpriteList(); - - TaitoF2RenderSpriteList(0); - - BurnTransferCopy(TaitoPalette); -} - -static void ThundfoxDraw() -{ - INT32 Disable1 = TC0100SCNCtrl[0][6] & 0xf7; - INT32 Disable2 = TC0100SCNCtrl[1][6] & 0xf7; - - BurnTransferClear(); - TaitoF2CalcPalette(); - - INT32 TilePri[2][3]; - INT32 Layer[2][3]; - - TaitoF2MakeSpriteList(); - - Layer[0][0] = TC0100SCNBottomLayer(0); - Layer[0][1] = Layer[0][0] ^ 1; - Layer[0][2] = 2; - TilePri[0][Layer[0][0]] = TC0360PRIRegs[5] & 0x0f; - TilePri[0][Layer[0][1]] = TC0360PRIRegs[5] >> 4; - TilePri[0][Layer[0][2]] = TC0360PRIRegs[4] >> 4; - - Layer[1][0] = TC0100SCNBottomLayer(1); - Layer[1][1] = Layer[1][0] ^ 1; - Layer[1][2] = 2; - TilePri[1][Layer[1][0]] = TC0360PRIRegs[9] & 0x0f; - TilePri[1][Layer[1][1]] = TC0360PRIRegs[9] >> 4; - TilePri[1][Layer[1][2]] = TC0360PRIRegs[8] >> 4; - - TaitoF2SpritePriority[0] = TC0360PRIRegs[6] & 0x0f; - TaitoF2SpritePriority[1] = TC0360PRIRegs[6] >> 4; - TaitoF2SpritePriority[2] = TC0360PRIRegs[7] & 0x0f; - TaitoF2SpritePriority[3] = TC0360PRIRegs[7] >> 4; - -// bprintf(PRINT_NORMAL, _T("Layer0-0 %x, Layer 0-1 %x, Layer 0-2 %x, Layer1-0 %x, Layer 1-1 %x, Layer 1-2 %x, Sprite 0 %x, Sprite 1 %x, Sprite 2 %x, Sprite 3 %x\n"), TilePri[0][0], TilePri[0][1], TilePri[0][2], TilePri[1][0], TilePri[1][1], TilePri[1][2], TaitoF2SpritePriority[0], TaitoF2SpritePriority[1], TaitoF2SpritePriority[2], TaitoF2SpritePriority[3]); - - for (INT32 i = 0; i < 16; i++) { - if (TilePri[1][0] == i) { - if (TC0100SCNBottomLayer(1)) { - if (!(Disable2 & 0x02)) TC0100SCNRenderFgLayer(1, 0, TaitoCharsB); - } else { - if (!(Disable2 & 0x01)) TC0100SCNRenderBgLayer(1, 0, TaitoCharsB); - } - } - if (TilePri[0][0] == i) { - if (TC0100SCNBottomLayer(0)) { - if (!(Disable1 & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } else { - if (!(Disable1 & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } - } - if (TilePri[1][1] == i) { - if (!TC0100SCNBottomLayer(1)) { - if (!(Disable2 & 0x02)) TC0100SCNRenderFgLayer(1, 0, TaitoCharsB); - } else { - if (!(Disable2 & 0x01)) TC0100SCNRenderBgLayer(1, 0, TaitoCharsB); - } - } - if (TilePri[0][1] == i) { - if (!TC0100SCNBottomLayer(0)) { - if (!(Disable1 & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } else { - if (!(Disable1 & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } - } - if (TaitoF2SpritePriority[3] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[3]); - if (TaitoF2SpritePriority[2] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[2]); - if (TaitoF2SpritePriority[1] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[1]); - if (TaitoF2SpritePriority[0] == i) TaitoF2RenderSpriteList(TaitoF2SpritePriority[0]); - if (TilePri[1][2] == i) { if (!(Disable2 & 0x04)) TC0100SCNRenderCharLayer(1); } - if (TilePri[0][2] == i) { if (!(Disable1 & 0x04)) TC0100SCNRenderCharLayer(0); } - } - - BurnTransferCopy(TaitoPalette); -} - -static void YuyugogoDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - TaitoF2CalcPalette(); - - TaitoF2SpritePriority[0] = 0; - TaitoF2SpritePriority[1] = 0; - TaitoF2SpritePriority[2] = 0; - TaitoF2SpritePriority[3] = 0; - - TaitoF2MakeSpriteList(); - - TaitoF2RenderSpriteList(0); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TaitoPalette); -} - -static INT32 TaitoF2Frame() -{ - INT32 nInterleave = 40; - - if (TaitoReset) TaitoF2DoReset(); - - if (TaitoIC_TC0220IOCInUse) { - TC0220IOCMakeInputs(); - } else { - if (TaitoIC_TC0510NIOInUse) { - TC0510NIOMakeInputs(); - } else { - TaitoF2MakeInputs(); - } - } - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - if (i == (nInterleave - 1)) nTaitoCyclesSegment -= 500; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == (nInterleave - 1)) { - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - nTaitoCyclesDone[nCurrentCPU] += SekRun(500); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - SekClose(); - - nCurrentCPU = 1; - ZetOpen(0); - BurnTimerUpdate((i + 1) * (nTaitoCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[1]); - if (pBurnSoundOut) { - if (TaitoNumYM2610) BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - if (TaitoNumYM2203) BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - if (TaitoNumMSM6295) MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - TaitoF2HandleSpriteBuffering(); - - if (pBurnDraw) TaitoDrawFunction(); - - TaitoF2SpriteBufferFunction(); - - return 0; -} - -static INT32 DriveoutFrame() -{ - INT32 nInterleave = 10; - - if (TaitoReset) TaitoF2DoReset(); - - if (TaitoIC_TC0220IOCInUse) { - TC0220IOCMakeInputs(); - } else { - if (TaitoIC_TC0510NIOInUse) { - TC0510NIOMakeInputs(); - } else { - TaitoF2MakeInputs(); - } - } - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - if (i == 9) nTaitoCyclesSegment -= 500; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == 9) { - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - nTaitoCyclesDone[nCurrentCPU] += SekRun(500); - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - } - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesSegment = ZetRun(nTaitoCyclesSegment); - nTaitoCyclesDone[nCurrentCPU] += nTaitoCyclesSegment; - ZetClose(); - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - - TaitoF2HandleSpriteBuffering(); - - if (pBurnDraw) TaitoDrawFunction(); - - TaitoF2SpriteBufferFunction(); - - return 0; -} - -static INT32 TaitoF2Scan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029682; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd-TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - TaitoICScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - - SCAN_VAR(TaitoInput); - SCAN_VAR(TaitoZ80Bank); - SCAN_VAR(TaitoF2SpriteBank); - SCAN_VAR(TaitoF2SpriteBankBuffered); - SCAN_VAR(nTaitoCyclesDone); - SCAN_VAR(nTaitoCyclesSegment); - SCAN_VAR(YesnoDip); - SCAN_VAR(MjnquestInput); - SCAN_VAR(DriveoutSoundNibble); - SCAN_VAR(DriveoutOkiBank); - } - - if (nAction & ACB_WRITE) { - if (TaitoZ80Bank) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetClose(); - } - - if (DriveoutOkiBank) { - memcpy(MSM6295ROM, TaitoMSM6295Rom + (DriveoutOkiBank * 0x40000), 0x40000); - } - - TaitoF2SpriteBufferFunction(); - TaitoF2HandleSpriteBuffering(); - } - - return 0; -} - -struct BurnDriver BurnDrvCameltry = { - "cameltry", NULL, NULL, NULL, "1989", - "Cameltry (US, YM2610)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_MAZE, 0, - NULL, CameltryRomInfo, CameltryRomName, NULL, NULL, CameltryInputInfo, CameltryDIPInfo, - CameltryInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCameltryau = { - "cameltryau", "cameltry", NULL, NULL, "1989", - "Cameltry (World, YM2203 + M6295)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_MAZE, 0, - NULL, CameltryauRomInfo, CameltryauRomName, NULL, NULL, CameltryInputInfo, CameltryDIPInfo, - CamltryaInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCameltrya = { - "cameltrya", "cameltry", NULL, NULL, "1989", - "Cameltry (US, YM2203 + M6295)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_MAZE, 0, - NULL, CameltryaRomInfo, CameltryaRomName, NULL, NULL, CameltryInputInfo, CameltryDIPInfo, - CamltryaInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvCameltryj = { - "cameltryj", "cameltry", NULL, NULL, "1989", - "Cameltry (Japan, YM2610)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_MAZE, 0, - NULL, CameltryjRomInfo, CameltryjRomName, NULL, NULL, CameltryInputInfo, CameltrjDIPInfo, - CameltryInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDeadconx = { - "deadconx", NULL, NULL, NULL, "1992", - "Dead Connection (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_SHOOT, 0, - NULL, DeadconxRomInfo, DeadconxRomName, NULL, NULL, DeadconxInputInfo, DeadconxDIPInfo, - DeadconxInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDeadconxj = { - "deadconxj", "deadconx", NULL, NULL, "1992", - "Dead Connection (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_SHOOT, 0, - NULL, DeadconxjRomInfo, DeadconxjRomName, NULL, NULL, DeadconxInputInfo, DeadconxjDIPInfo, - DeadconxInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDinorex = { - "dinorex", NULL, NULL, NULL, "1992", - "Dino Rex (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_VSFIGHT, 0, - NULL, DinorexRomInfo, DinorexRomName, NULL, NULL, DinorexInputInfo, DinorexDIPInfo, - DinorexInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDinorexj = { - "dinorexj", "dinorex", NULL, NULL, "1992", - "Dino Rex (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_VSFIGHT, 0, - NULL, DinorexjRomInfo, DinorexjRomName, NULL, NULL, DinorexInputInfo, DinorexjDIPInfo, - DinorexInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDinorexu = { - "dinorexu", "dinorex", NULL, NULL, "1992", - "Dino Rex (US)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_VSFIGHT, 0, - NULL, DinorexuRomInfo, DinorexuRomName, NULL, NULL, DinorexInputInfo, DinorexDIPInfo, - DinorexInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDondokod = { - "dondokod", NULL, NULL, NULL, "1989", - "Don Doko Don (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_PLATFORM, 0, - NULL, DondokodRomInfo, DondokodRomName, NULL, NULL, DondokodInputInfo, DondokodDIPInfo, - DondokodInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDondokodj = { - "dondokodj", "dondokod", NULL, NULL, "1989", - "Don Doko Don (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_PLATFORM, 0, - NULL, DondokodjRomInfo, DondokodjRomName, NULL, NULL, DondokodInputInfo, DondokodjDIPInfo, - DondokodInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDondokodu = { - "dondokodu", "dondokod", NULL, NULL, "1989", - "Don Doko Don (US)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_PLATFORM, 0, - NULL, DondokoduRomInfo, DondokoduRomName, NULL, NULL, DondokodInputInfo, DondokoduDIPInfo, - DondokodInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDriftout = { - "driftout", NULL, NULL, NULL, "1991", - "Drift Out (Europe)\0", NULL, "Visco (Europe)", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_TAITOF2, GBF_RACING, 0, - NULL, DriftoutRomInfo, DriftoutRomName, NULL, NULL, DriftoutInputInfo, DriftoutDIPInfo, - DriftoutInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDriftoutj = { - "driftoutj", "driftout", NULL, NULL, "1991", - "Drift Out (Japan)\0", NULL, "Visco (Japan)", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_RACING, 0, - NULL, DriftoutjRomInfo, DriftoutjRomName, NULL, NULL, DriftoutInputInfo, DriftoutDIPInfo, - DriftoutInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDriveout = { - "driveout", "driftout", NULL, NULL, "1991", - "Drive Out\0", NULL, "bootleg", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_TAITOF2, GBF_RACING, 0, - NULL, DriveoutRomInfo, DriveoutRomName, NULL, NULL, DriftoutInputInfo, DriftoutDIPInfo, - DriveoutInit, TaitoF2Exit, DriveoutFrame, NULL, TaitoF2Scan, - NULL, 0x2000, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvFinalb = { - "finalb", NULL, NULL, NULL, "1988", - "Final Blow (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_VSFIGHT, 0, - NULL, FinalbRomInfo, FinalbRomName, NULL, NULL, FinalbInputInfo, FinalbDIPInfo, - FinalbInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFinalbj = { - "finalbj", "finalb", NULL, NULL, "1988", - "Final Blow (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_VSFIGHT, 0, - NULL, FinalbjRomInfo, FinalbjRomName, NULL, NULL, FinalbInputInfo, FinalbjDIPInfo, - FinalbInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFinalbu = { - "finalbu", "finalb", NULL, NULL, "1988", - "Final Blow (US)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_VSFIGHT, 0, - NULL, FinalbuRomInfo, FinalbuRomName, NULL, NULL, FinalbInputInfo, FinalbjDIPInfo, - FinalbInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvFootchmp = { - "footchmp", NULL, NULL, NULL, "1990", - "Football Champ (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_TAITO_TAITOF2, GBF_SPORTSFOOTBALL, 0, - NULL, FootchmpRomInfo, FootchmpRomName, NULL, NULL, FootchmpInputInfo, FootchmpDIPInfo, - FootchmpInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvHthero = { - "hthero", "footchmp", NULL, NULL, "1990", - "Hat Trick Hero (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_TAITO_TAITOF2, GBF_SPORTSFOOTBALL, 0, - NULL, HtheroRomInfo, HtheroRomName, NULL, NULL, FootchmpInputInfo, HtheroDIPInfo, - FootchmpInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEuroch92 = { - "euroch92", NULL, NULL, NULL, "1992", - "Euro Champ '92 (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_TAITO_TAITOF2, GBF_SPORTSFOOTBALL, 0, - NULL, Euroch92RomInfo, Euroch92RomName, NULL, NULL, FootchmpInputInfo, FootchmpDIPInfo, - FootchmpInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGrowl = { - "growl", NULL, NULL, NULL, "1990", - "Growl (World, Rev 1)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, GrowlRomInfo, GrowlRomName, NULL, NULL, GrowlInputInfo, GrowlDIPInfo, - GrowlInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGrowla = { - "growla", "growl", NULL, NULL, "1990", - "Growl (World)\0", NULL, "Taito America Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, GrowlaRomInfo, GrowlaRomName, NULL, NULL, GrowlInputInfo, GrowluDIPInfo, - GrowlInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGrowlu = { - "growlu", "growl", NULL, NULL, "1990", - "Growl (US)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, GrowluRomInfo, GrowluRomName, NULL, NULL, GrowlInputInfo, GrowluDIPInfo, - GrowlInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRunark = { - "runark", "growl", NULL, NULL, "1990", - "Runark (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, RunarkRomInfo, RunarkRomName, NULL, NULL, GrowlInputInfo, RunarkDIPInfo, - GrowlInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvGunfront = { - "gunfront", NULL, NULL, NULL, "1990", - "Gun & Frontier (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_TAITOF2, GBF_VERSHOOT, 0, - NULL, GunfrontRomInfo, GunfrontRomName, NULL, NULL, GunfrontInputInfo, GunfrontDIPInfo, - GunfrontInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvGunfrontj = { - "gunfrontj", "gunfront", NULL, NULL, "1990", - "Gun Frontier (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_TAITOF2, GBF_VERSHOOT, 0, - NULL, GunfrontjRomInfo, GunfrontjRomName, NULL, NULL, GunfrontInputInfo, GunfrontjDIPInfo, - GunfrontInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvKoshien = { - "koshien", NULL, NULL, NULL, "1990", - "Ah Eikou no Koshien (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - L"\u7532\u5B50\u5712 \u6804\u5149\u306E \u55DA\u547C (Japan)\0Ah Eikou no Koshien\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_SPORTSMISC, 0, - NULL, KoshienRomInfo, KoshienRomName, NULL, NULL, KoshienInputInfo, KoshienDIPInfo, - KoshienInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLiquidk = { - "liquidk", NULL, NULL, NULL, "1990", - "Liquid Kids (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_PLATFORM, 0, - NULL, LiquidkRomInfo, LiquidkRomName, NULL, NULL, LiquidkInputInfo, LiquidkDIPInfo, - LiquidkInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvLiquidku = { - "liquidku", "liquidk", NULL, NULL, "1990", - "Liquid Kids (US)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_PLATFORM, 0, - NULL, LiquidkuRomInfo, LiquidkuRomName, NULL, NULL, LiquidkInputInfo, LiquidkuDIPInfo, - LiquidkInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMizubaku = { - "mizubaku", "liquidk", NULL, NULL, "1990", - "Mizubaku Daibouken (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - L"\u30DF\u30BA\u30D0\u30AF \u5927\u5192\u967A \u30A2\u30C9\u30D9\u30F3\u30C1\u30E3\u30FC (Japan)\0Mizubaku Daibouken\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_PLATFORM, 0, - NULL, MizubakuRomInfo, MizubakuRomName, NULL, NULL, LiquidkInputInfo, LiquidkuDIPInfo, - LiquidkInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMegablst = { - "megablst", NULL, NULL, NULL, "1989", - "Mega Blast (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_HORSHOOT, 0, - NULL, MegablstRomInfo, MegablstRomName, NULL, NULL, MegablstInputInfo, MegablstDIPInfo, - MegablstInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMegablstj = { - "megablstj", "megablst", NULL, NULL, "1989", - "Mega Blast (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_HORSHOOT, 0, - NULL, MegablstjRomInfo, MegablstjRomName, NULL, NULL, MegablstInputInfo, MegablstjDIPInfo, - MegablstInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMegablstu = { - "megablstu", "megablst", NULL, NULL, "1989", - "Mega Blast (US)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_HORSHOOT, 0, - NULL, MegablstuRomInfo, MegablstuRomName, NULL, NULL, MegablstInputInfo, MegablstuDIPInfo, - MegablstInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMetalb = { - "metalb", NULL, NULL, NULL, "1991", - "Metal Black (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_HORSHOOT, 0, - NULL, MetalbRomInfo, MetalbRomName, NULL, NULL, MetalbInputInfo, MetalbDIPInfo, - MetalbInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMetalbj = { - "metalbj", "metalb", NULL, NULL, "1991", - "Metal Black (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_HORSHOOT, 0, - NULL, MetalbjRomInfo, MetalbjRomName, NULL, NULL, MetalbInputInfo, MetalbjDIPInfo, - MetalbInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMjnquest = { - "mjnquest", NULL, NULL, NULL, "1990", - "Mahjong Quest (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_MAHJONG, 0, - NULL, MjnquestRomInfo, MjnquestRomName, NULL, NULL, MjnquestInputInfo, MjnquestDIPInfo, - MjnquestInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvMjnquestb = { - "mjnquestb", "mjnquest", NULL, NULL, "1990", - "Mahjong Quest (No Nudity)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_MAHJONG, 0, - NULL, MjnquestbRomInfo, MjnquestbRomName, NULL, NULL, MjnquestInputInfo, MjnquestDIPInfo, - MjnquestInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNinjak = { - "ninjak", NULL, NULL, NULL, "1990", - "The Ninja Kids (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 4, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, NinjakRomInfo, NinjakRomName, NULL, NULL, NinjakInputInfo, NinjakDIPInfo, - NinjakInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNinjakj = { - "ninjakj", "ninjak", NULL, NULL, "1990", - "The Ninja Kids (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, NinjakjRomInfo, NinjakjRomName, NULL, NULL, NinjakInputInfo, NinjakjDIPInfo, - NinjakInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNinjaku = { - "ninjaku", "ninjak", NULL, NULL, "1990", - "The Ninja Kids (US)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, NinjakuRomInfo, NinjakuRomName, NULL, NULL, NinjakInputInfo, NinjakuDIPInfo, - NinjakInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPulirula = { - "pulirula", NULL, NULL, NULL, "1991", - "PuLiRuLa (World)\0", "Some priority problems", "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, PulirulaRomInfo, PulirulaRomName, NULL, NULL, PulirulaInputInfo, PulirulaDIPInfo, - PulirulaInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvPulirulaj = { - "pulirulaj", "pulirula", NULL, NULL, "1991", - "PuLiRuLa (Japan)\0", "Some priority problems", "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, PulirulajRomInfo, PulirulajRomName, NULL, NULL, PulirulaInputInfo, PulirulajDIPInfo, - PulirulaInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQcrayon = { - "qcrayon", NULL, NULL, NULL, "1993", - "Quiz Crayon Shinchan (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - L"\u30AF\u30A4\u30BA \u30AF\u30EC\u30E8\u30F3\u3057\u3093\u3061\u3083\u3093 (Japan)\0Quiz Crayon Shinchan\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_QUIZ, 0, - NULL, QcrayonRomInfo, QcrayonRomName, NULL, NULL, QcrayonInputInfo, QcrayonDIPInfo, - QcrayonInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQcrayon2 = { - "qcrayon2", NULL, NULL, NULL, "1993", - "Crayon Shinchan Orato Asobo (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - L"\u30AF\u30EC\u30E8\u30F3\u3057\u3093\u3061\u3083\u3093 \u30AA\u30E9\u3068\u904A\u307C (Japan)\0Crayon Shinchan Orato Asobo\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_QUIZ, 0, - NULL, Qcrayon2RomInfo, Qcrayon2RomName, NULL, NULL, Qcrayon2InputInfo, Qcrayon2DIPInfo, - Qcrayon2Init, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQjinsei = { - "qjinsei", NULL, NULL, NULL, "1992", - "Quiz Jinsei Gekijoh (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - L"\u30AF\u30A4\u30BA \u4EBA\u751F\u5287\u5834 (Japan)\0Quiz Jinsei Gekijoh\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_QUIZ, 0, - NULL, QjinseiRomInfo, QjinseiRomName, NULL, NULL, QjinseiInputInfo, QjinseiDIPInfo, - QjinseiInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQtorimon = { - "qtorimon", NULL, NULL, NULL, "1990", - "Quiz Torimonochou (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - L"\u304F\u3044\u305A \u82E6\u80C3\u982D \u6355\u7269\u5E33 (Japan)\0Quiz Torimonochou\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_QUIZ, 0, - NULL, QtorimonRomInfo, QtorimonRomName, NULL, NULL, QtorimonInputInfo, QtorimonDIPInfo, - QtorimonInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x800, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQuizhq = { - "quizhq", NULL, NULL, NULL, "1990", - "Quiz H.Q. (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_QUIZ, 0, - NULL, QuizhqRomInfo, QuizhqRomName, NULL, NULL, QuizhqInputInfo, QuizhqDIPInfo, - QuizhqInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQzchikyu = { - "qzchikyu", NULL, NULL, NULL, "1991", - "Quiz Chikyu Bouei Gun (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - L"\u30AF\u30A4\u30BA \u5730\u7403\u9632\u885B\u8ECD (Japan)\0Quiz Chikyu Bouei Gun\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_QUIZ, 0, - NULL, QzchikyuRomInfo, QzchikyuRomName, NULL, NULL, QzchikyuInputInfo, QzchikyuDIPInfo, - QzchikyuInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvQzquest = { - "qzquest", NULL, NULL, NULL, "1991", - "Quiz Quest - Hime to Yuusha no Monogatari (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - L"\u30AF\u30A4\u30BA \u30AF\u30A8\u30B9\u30C8 \uFF0D\u59EB\u3068\u52C7\u8005\u306E\u7269\u8A9E\uFF0D (Japan)\0Quiz Quest - Hime to Yuusha no Monogatari\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_QUIZ, 0, - NULL, QzquestRomInfo, QzquestRomName, NULL, NULL, QzquestInputInfo, QzquestDIPInfo, - QzquestInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSolfigtr = { - "solfigtr", NULL, NULL, NULL, "1991", - "Solitary Fighter (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_VSFIGHT, 0, - NULL, SolfigtrRomInfo, SolfigtrRomName, NULL, NULL, SolfigtrInputInfo, SolfigtrDIPInfo, - SolfigtrInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvSsi = { - "ssi", NULL, NULL, NULL, "1990", - "Super Space Invaders '91 (World)\0", NULL, "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_TAITOF2, GBF_SHOOT, 0, - NULL, SsiRomInfo, SsiRomName, NULL, NULL, SsiInputInfo, SsiDIPInfo, - SsiInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvMajest12u = { - "majest12u", "ssi", NULL, NULL, "1990", - "Majestic Twelve - The Space Invaders Part IV (US)\0", NULL, "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_TAITOF2, GBF_SHOOT, 0, - NULL, Majest12uRomInfo, Majest12uRomName, NULL, NULL, SsiInputInfo, Majest12DIPInfo, - SsiInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvMajest12j = { - "majest12j", "ssi", NULL, NULL, "1990", - "Majestic Twelve - The Space Invaders Part IV (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_TAITOF2, GBF_SHOOT, 0, - NULL, Majest12jRomInfo, Majest12jRomName, NULL, NULL, SsiInputInfo, Majest12DIPInfo, - SsiInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 224, 320, 3, 4 -}; - -struct BurnDriver BurnDrvThundfox = { - "thundfox", NULL, NULL, NULL, "1990", - "Thunder Fox (World)\0", "NULL", "Taito Corporation Japan", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, ThundfoxRomInfo, ThundfoxRomName, NULL, NULL, ThundfoxInputInfo, ThundfoxDIPInfo, - ThundfoxInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThundfoxj = { - "thundfoxj", "thundfox", NULL, NULL, "1990", - "Thunder Fox (Japan)\0", "NULL", "Taito Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, ThundfoxjRomInfo, ThundfoxjRomName, NULL, NULL, ThundfoxInputInfo, ThundfoxjDIPInfo, - ThundfoxInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvThundfoxu = { - "thundfoxu", "thundfox", NULL, NULL, "1990", - "Thunder Fox (US)\0", "NULL", "Taito America Corporation", "Taito-F2", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOF2, GBF_SCRFIGHT, 0, - NULL, ThundfoxuRomInfo, ThundfoxuRomName, NULL, NULL, ThundfoxInputInfo, ThundfoxuDIPInfo, - ThundfoxInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvYesnoj = { - "yesnoj", NULL, NULL, NULL, "1992", - "Yes/No Sinri Tokimeki Chart\0", NULL, "Taito Corporation", "Taito-F2", - L"\uFF39\uFF45\uFF53.\uFF2E\uFF4F \u5FC3\u7406 \u30C8\u30AD\u30E1\u30AD\u30C1\u30E3\u30FC\u30C8\0Yes/No Sinri Tokimeki Chart\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_QUIZ, 0, - NULL, YesnojRomInfo, YesnojRomName, NULL, NULL, YesnojInputInfo, YesnojDIPInfo, - YesnojInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvYuyugogo = { - "yuyugogo", NULL, NULL, NULL, "1990", - "Yuuyu no Quiz de GO!GO! (Japan)\0", NULL, "Taito Corporation", "Taito-F2", - L"\u3086\u3046\u3086 \u306E\u30AF\u30A4\u30BA\u3067 \uFF27\uFF4F!\uFF27\uFF4F! (Japan)\0Yuuyu no Quiz de GO!GO!\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOF2, GBF_QUIZ, 0, - NULL, YuyugogoRomInfo, YuyugogoRomName, NULL, NULL, YuyugogoInputInfo, YuyugogoDIPInfo, - YuyugogoInit, TaitoF2Exit, TaitoF2Frame, NULL, TaitoF2Scan, - NULL, 0x2000, 320, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_taitof3.cpp b/jan/src/burn/drv/taito/d_taitof3.cpp deleted file mode 100644 index 2ee2c149f..000000000 --- a/jan/src/burn/drv/taito/d_taitof3.cpp +++ /dev/null @@ -1,5799 +0,0 @@ -// FB Alpha Taito F3 driver module -// Based on MAME driver by Bryan McPhail and MANY others. - -/* - version .00001d ;) - - - known issues and workarounds - - scfinals & scfinalso coin inputs do not work, therefore a kludge is used. - -> if a coin is pressed, it instead presses the service coin :) - -> scfinals also displays a weird/corrupt version string in service mode(!!) - - no attempt at speed-ups - no attempt at cleaning at all - ROM sets might be out of date!!! - -*/ - -//#define USE_CPU_SPEEDHACKS - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "taito.h" -#include "taitof3_snd.h" -#include "taitof3_video.h" -#include "es5506.h" -#include "eeprom.h" -#include "msm6295.h" - -static UINT8 *DrvVRAMRAM; -static UINT8 *DrvPivotRAM; -static UINT16 *DrvCoinWord; - -static UINT8 DrvJoy1[16]; -static UINT8 DrvJoy2[16]; -static UINT8 DrvJoy3[16]; -static UINT8 DrvJoy4[16]; -static UINT8 DrvJoy5[16]; -static UINT8 DrvSrv[1]; -static UINT8 DrvReset; -static UINT16 DrvInputs[5]; -static UINT8 previous_coin; - -static INT32 sound_cpu_in_reset = 0; -static INT32 watchdog; - -INT32 f3_game = 0; -static INT32 supercupkludge = 0; - -static struct BurnInputInfo F3InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 4, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 12, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 4"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 13, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy1 + 7, "p2 fire 4"}, - - {"P3 Coin", BIT_DIGITAL, DrvJoy5 + 6, "p3 coin"}, - {"P3 Start", BIT_DIGITAL, DrvJoy1 + 14, "p3 start"}, - {"P3 Up", BIT_DIGITAL, DrvJoy4 + 0, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy4 + 1, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy4 + 2, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy4 + 3, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 8, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 9, "p3 fire 2"}, - {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 10, "p3 fire 3"}, - {"P3 Button 4", BIT_DIGITAL, DrvJoy3 + 11, "p3 fire 4"}, - - {"P4 Coin", BIT_DIGITAL, DrvJoy5 + 7, "p4 coin"}, - {"P4 Start", BIT_DIGITAL, DrvJoy1 + 15, "p4 start"}, - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 4, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 5, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 6, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 7, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy3 + 12, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy3 + 13, "p4 fire 2"}, - {"P4 Button 3", BIT_DIGITAL, DrvJoy3 + 14, "p4 fire 3"}, - {"P4 Button 4", BIT_DIGITAL, DrvJoy3 + 15, "p4 fire 4"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 9, "service"}, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 10, "service"}, - {"Service 3", BIT_DIGITAL, DrvJoy1 + 11, "service"}, - {"Service Mode", BIT_DIGITAL, DrvSrv + 0, "diag"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 8, "tilt"}, - {"Dip", BIT_DIPSWITCH, TaitoDip + 0, "dip"}, -}; - -STDINPUTINFO(F3) - -static struct BurnInputInfo KnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 4, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 12, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 3"}, - {"P1 Button 4", BIT_DIGITAL, DrvJoy4 + 0, "p1 fire 4"}, - {"P1 Button 5", BIT_DIGITAL, DrvJoy4 + 1, "p1 fire 5"}, - {"P1 Button 6", BIT_DIGITAL, DrvJoy4 + 2, "p1 fire 6"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 5, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 13, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p2 fire 3"}, - {"P2 Button 4", BIT_DIGITAL, DrvJoy4 + 0, "p2 fire 4"}, - {"P2 Button 5", BIT_DIGITAL, DrvJoy4 + 1, "p2 fire 5"}, - {"P2 Button 6", BIT_DIGITAL, DrvJoy4 + 2, "p2 fire 6"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service 1", BIT_DIGITAL, DrvJoy1 + 9, "service"}, - {"Service 2", BIT_DIGITAL, DrvJoy1 + 10, "service"}, - {"Service 3", BIT_DIGITAL, DrvJoy1 + 11, "service"}, - {"Service Mode", BIT_DIGITAL, DrvSrv + 0, "diag"}, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 8, "tilt"}, -}; - -STDINPUTINFO(Kn) - -static struct BurnDIPInfo gseekerDIPList[]= -{ - {0x2e, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2 , "Stage 5 Graphic Glitch Fix" }, - {0x2e, 0x01, 0x01, 0x01, "Yes" }, - {0x2e, 0x01, 0x01, 0x00, "No" }, -}; - -STDDIPINFO(gseeker) - -static void control_w(INT32 offset, UINT32 d, INT32 b) -{ - switch (offset & 0x1c) - { - case 0x00: - watchdog = 0; - return; - - case 0x04: - { - // bprintf (0, _T("contrl %2.2x, %8.8x, %8.8x\n"), offset, d, b); - if ((offset & 3) == 0) DrvCoinWord[0] = d << 0; // or 8? - } - return; - - case 0x10: - { - if ((offset & 3) == 3 || (offset == 0x4a0012 && b == 2)) { - EEPROMSetClockLine((d & 0x08) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE); - EEPROMWriteBit(d & 0x04); - EEPROMSetCSLine((d & 0x10) ? EEPROM_CLEAR_LINE : EEPROM_ASSERT_LINE); - } - } - return; - - case 0x14: - { - // bprintf (0, _T("contrl %2.2x, %8.8x, %8.8x\n"), offset, d, b); - if ((offset & 3) == 0) DrvCoinWord[1] = d << 0; // or 8? - } - return; - - case 0x1c: - { - if (BurnDrvGetFlags() & BDF_BOOTLEG) { - if ((offset & 3) == 3) { MSM6295Command(0, d); return; } - // bprintf (0, _T("Sound Command: %x, %x %d\n"), offset & 0x1f, d, b); - if ((offset & 3) == 0) { } // banking - } - } - return; - } -} - -static void __fastcall f3_main_write_long(UINT32 a, UINT32 d) -{ - if ((a & 0xffff80) == 0x300000) { - // sound_bankswitch_w - return; - } - - if ((a & 0xffffe0) == 0x4a0000) { - control_w(a, d,4); - return; - } - - if ((a & 0xfffffc) == 0xc80000) { - sound_cpu_in_reset = 0; - // sound_reset_0_w - return; - } - - if ((a & 0xfffffc) == 0xc80100) { - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - sound_cpu_in_reset = 1; - return; - } -} - -static void __fastcall f3_main_write_word(UINT32 a, UINT16 d) -{ - if ((a & 0xffff80) == 0x300000) { - // sound_bankswitch_w - return; - } - - if ((a & 0xffffe0) == 0x4a0000) { - control_w(a, d,2); - return; - } - - if ((a & 0xfffffc) == 0x4c0000) { - // unk - return; - } - - if ((a & 0xfffffc) == 0xc80000) { - sound_cpu_in_reset = 0; - return; - } - - if ((a & 0xfffffc) == 0xc80100) { - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - sound_cpu_in_reset = 1; - return; - } -} - -static void __fastcall f3_main_write_byte(UINT32 a, UINT8 d) -{ - if ((a & 0xffff80) == 0x300000) { - // sound_bankswitch_w - return; - } - - if ((a & 0xffffe0) == 0x4a0000) { - control_w(a, d,1); - return; - } - - if ((a & 0xfffffc) == 0xc80000) { - sound_cpu_in_reset = 0; - return; - } - - if ((a & 0xfffffc) == 0xc80100) { - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - sound_cpu_in_reset = 1; - return; - } -} - -static UINT32 control_r(INT32 offset, INT32 b) -{ - offset &= 0x1c; - - UINT32 ret = 0xffffffff; - - switch (offset & 0x1c) - { - case 0x00: - ret = DrvInputs[0] & 0xffff; - ret |= EEPROMRead() ? 0x01010000 : 0; - ret |= (DrvInputs[4] & 0xfe) << 16; - ret |= (DrvInputs[4] & 0xfe) << 24; - break; - - case 0x04: - ret = DrvInputs[1] | (DrvCoinWord[0] << 16); - break; - - case 0x08: - case 0x0c: - ret = ~0; // and - break; - - case 0x10: - ret = DrvInputs[2] | 0xffff0000; - break; - - case 0x14: - ret = DrvInputs[3] | (DrvCoinWord[1] << 16); - break; - - case 0x1c: - ret = MSM6295ReadStatus(0); - break; - } - - return ret; -} - -static UINT32 __fastcall f3_main_read_long(UINT32 a) -{ - if ((a & 0xffffe0) == 0x4a0000) { - return control_r(a, 4); - } - - return 0; -} - -static UINT16 __fastcall f3_main_read_word(UINT32 a) -{ - if ((a & 0xffffe0) == 0x4a0000) { - return control_r(a, 2) >> ((~a & 2) * 8); - } - - return 0; -} - -static UINT8 __fastcall f3_main_read_byte(UINT32 a) -{ - if ((a & 0xffffe0) == 0x4a0000) { - return control_r(a, 1) >> (((a & 3)^3) * 8); - } - - return 0; -} - -static void f3_palette_landmakr_onreset() -{ - for (INT32 i = 0; i < 0x8000/4; i++) { - UINT8 r = ((i & 1) ? 0xff : 0); - UINT8 g = ((i & 2) ? 0xff : 0); - UINT8 b = ((i & 4) ? 0xff : 0); - - *((UINT32*)(TaitoPaletteRam + (i * 4))) = r | (g << 24) | (b << 16); - } -} - -static void __fastcall f3_palette_write_long(UINT32 a, UINT32 d) -{ - if ((a & 0xff8000) == 0x440000) { - *((UINT32*)(TaitoPaletteRam + (a & 0x7ffc))) = (d << 16) | (d >> 16); - pPaletteUpdateCallback(a); - return; - } -} - -static void __fastcall f3_palette_write_word(UINT32 a, UINT16 d) -{ - if ((a & 0xff8000) == 0x440000) { - *((UINT16*)(TaitoPaletteRam + (a & 0x7ffe))) = d; - pPaletteUpdateCallback(a); - return; - } -} - -static void __fastcall f3_palette_write_byte(UINT32 a, UINT8 d) -{ - if ((a & 0xff8000) == 0x440000) { - TaitoPaletteRam[(a & 0x7fff) ^ 1] = d; - pPaletteUpdateCallback(a); - return; - } -} - -static void DrvVRAMExpand(UINT16 offset) -{ - offset &= 0x1ffc; - - TaitoCharsB[offset * 2 + 1] = DrvVRAMRAM[offset + 2] >> 4; - TaitoCharsB[offset * 2 + 0] = DrvVRAMRAM[offset + 2] & 0x0f; - TaitoCharsB[offset * 2 + 3] = DrvVRAMRAM[offset + 3] >> 4; - TaitoCharsB[offset * 2 + 2] = DrvVRAMRAM[offset + 3] & 0x0f; - TaitoCharsB[offset * 2 + 5] = DrvVRAMRAM[offset + 0] >> 4; - TaitoCharsB[offset * 2 + 4] = DrvVRAMRAM[offset + 0] & 0x0f; - TaitoCharsB[offset * 2 + 7] = DrvVRAMRAM[offset + 1] >> 4; - TaitoCharsB[offset * 2 + 6] = DrvVRAMRAM[offset + 1] & 0x0f; -} - -static void DrvPivotExpand(UINT16 offset) -{ - offset &= 0xfffc; - - TaitoCharsPivot[offset * 2 + 1] = DrvPivotRAM[offset + 2] >> 4; - TaitoCharsPivot[offset * 2 + 0] = DrvPivotRAM[offset + 2] & 0x0f; - TaitoCharsPivot[offset * 2 + 3] = DrvPivotRAM[offset + 3] >> 4; - TaitoCharsPivot[offset * 2 + 2] = DrvPivotRAM[offset + 3] & 0x0f; - TaitoCharsPivot[offset * 2 + 5] = DrvPivotRAM[offset + 0] >> 4; - TaitoCharsPivot[offset * 2 + 4] = DrvPivotRAM[offset + 0] & 0x0f; - TaitoCharsPivot[offset * 2 + 7] = DrvPivotRAM[offset + 1] >> 4; - TaitoCharsPivot[offset * 2 + 6] = DrvPivotRAM[offset + 1] & 0x0f; -} - -static void __fastcall f3_VRAM_write_long(UINT32 a, UINT32 d) -{ - if ((a & 0xffe000) == 0x61c000) { - *((UINT32*)(TaitoVideoRam + (a & 0x1ffc))) = (d << 16) | (d >> 16); - dirty_tile_count[9] = 1; - return; - } - - if ((a & 0xffe000) == 0x61e000) { - *((UINT32*)(DrvVRAMRAM + (a & 0x1ffc))) = (d << 16) | (d >> 16); - DrvVRAMExpand(a); - return; - } -} - -static void __fastcall f3_VRAM_write_word(UINT32 a, UINT16 d) -{ - if ((a & 0xffe000) == 0x61c000) { - *((UINT16*)(TaitoVideoRam + (a & 0x1ffe))) = d; - dirty_tile_count[9] = 1; - return; - } - - if ((a & 0xffe000) == 0x61e000) { - *((UINT16*)(DrvVRAMRAM + (a & 0x1ffe))) = d; - DrvVRAMExpand(a); - return; - } -} - -static void __fastcall f3_VRAM_write_byte(UINT32 a, UINT8 d) -{ - if ((a & 0xffe000) == 0x61c000) { - TaitoVideoRam[(a & 0x1fff) ^ 1] = d; - dirty_tile_count[9] = 1; - return; - } - - if ((a & 0xffe000) == 0x61e000) { - DrvVRAMRAM[(a & 0x1fff) ^ 1] = d; - DrvVRAMExpand(a); - return; - } -} - -static void __fastcall f3_pivot_write_long(UINT32 a, UINT32 d) -{ - if ((a & 0xff0000) == 0x630000) { - *((UINT32*)(DrvPivotRAM + (a & 0xfffc))) = (d << 16) | (d >> 16); - DrvPivotExpand(a); - dirty_tile_count[9] = 1; - return; - } -} - -static void __fastcall f3_pivot_write_word(UINT32 a, UINT16 d) -{ - if ((a & 0xff0000) == 0x630000) { - *((UINT16*)(DrvPivotRAM + (a & 0xfffe))) = d; - DrvPivotExpand(a); - dirty_tile_count[9] = 1; - return; - } -} - -static void __fastcall f3_pivot_write_byte(UINT32 a, UINT8 d) -{ - if ((a & 0xff0000) == 0x630000) { - DrvPivotRAM[(a & 0xffff) ^ 1] = d; - DrvPivotExpand(a); - dirty_tile_count[9] = 1; - return; - } -} - -static void __fastcall f3_playfield_write_long(UINT32 a, UINT32 d) -{ - if ((a & 0xff8000) == 0x610000) { - UINT32 *ram = (UINT32*)(TaitoF3PfRAM + (a & 0x7ffc)); - - if (ram[0] != ((d << 16) | (d >> 16))) { - ram[0] = (d << 16) | (d >> 16); - dirty_tiles[(a & 0x7ffc)/4] = 1; - dirty_tile_count[((a & 0x7000)/0x1000)] = 1; - } - return; - } -} - -static void __fastcall f3_playfield_write_word(UINT32 a, UINT16 d) -{ - if ((a & 0xff8000) == 0x610000) { - UINT16 *ram = (UINT16*)(TaitoF3PfRAM + (a & 0x7ffe)); - - if (ram[0] != d) { - ram[0] = d; - dirty_tiles[(a & 0x7ffc)/4] = 1; - dirty_tile_count[((a & 0x7000)/0x1000)] = 1; - } - return; - } -} - -static void __fastcall f3_playfield_write_byte(UINT32 a, UINT8 d) -{ - if ((a & 0xff8000) == 0x610000) { - if (TaitoF3PfRAM[(a & 0x7fff) ^ 1] != d) { - TaitoF3PfRAM[(a & 0x7fff) ^ 1] = d; - dirty_tiles[(a & 0x7ffc)/4] = 1; - dirty_tile_count[((a & 0x7000)/0x1000)] = 1; - } - return; - } -} - -static UINT32 speedhack_address; - -static void __fastcall f3_speedhack_write_long(UINT32 a, UINT32 d) -{ - a &= 0x1fffe; - *((UINT32*)(Taito68KRam1 + a)) = (d << 16) | (d >> 16); - if (a == (speedhack_address & ~3)) { - // SekIdle(100); - SekRunEnd(); // kill until next loop - } -} - -static void __fastcall f3_speedhack_write_word(UINT32 a, UINT16 d) -{ - a &= 0x1fffe; - *((UINT16*)(Taito68KRam1 + (a & 0x1fffe))) = d; - if (a == speedhack_address) { - // SekIdle(100); - SekRunEnd(); // kill until next loop - } -} - -static void __fastcall f3_speedhack_write_byte(UINT32 a, UINT8 d) -{ - Taito68KRam1[(a & 0x1ffff) ^ 1] = d; -} - -static void f3_speedhack_init(UINT32 address) -{ - if (address == 0) return; - -#ifndef USE_CPU_SPEEDHACKS - return; -#endif - - SekOpen(0); - - address &= ~0x20000; - - speedhack_address = address & 0x1fffe; - - SekMapHandler(5, address & ~0x3ff, address | 0x3ff, MAP_WRITE); - SekSetWriteLongHandler(5, f3_speedhack_write_long); - SekSetWriteWordHandler(5, f3_speedhack_write_word); - SekSetWriteByteHandler(5, f3_speedhack_write_byte); - - address |= 0x20000; - - SekMapHandler(6, address & ~0x3ff, address | 0x3ff, MAP_WRITE); - SekSetWriteLongHandler(6, f3_speedhack_write_long); - SekSetWriteWordHandler(6, f3_speedhack_write_word); - SekSetWriteByteHandler(6, f3_speedhack_write_byte); - SekClose(); -} - -static void f3_reset_dirtybuffer() -{ - memset (dirty_tiles, 1, 0x8000/4); - memset (dirty_tile_count, 1, 10); -} - -static INT32 DrvDoReset(INT32 full_reset) -{ - if (full_reset) { - memset (TaitoRamStart, 0, TaitoRamEnd - TaitoRamStart); - } - - SekOpen(0); - SekReset(); - SekClose(); - - if (BurnDrvGetFlags() & BDF_BOOTLEG) { - MSM6295Reset(0); - } else { - TaitoF3SoundReset(); - } - - EEPROMReset(); - - if (EEPROMAvailable() == 0) { - if (TaitoDefaultEEProm[0] != 0 && f3_game != SCFINALS) { - EEPROMFill((const UINT8*)TaitoDefaultEEProm, 0, 128); - } else if (f3_game == RECALH || f3_game == GSEEKER ) { - static const UINT8 recalh_eeprom[128] = { - 0x85,0x54,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf3,0x35, - 0x00,0x01,0x86,0xa0,0x00,0x13,0x04,0x13,0x00,0x00,0xc3,0x50,0x00,0x19,0x00,0x0a, - 0x00,0x00,0x4e,0x20,0x00,0x03,0x18,0x0d,0x00,0x00,0x27,0x10,0x00,0x05,0x14,0x18, - 0x00,0x00,0x13,0x88,0x00,0x00,0x12,0x27,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff - }; - - EEPROMFill(recalh_eeprom, 0, 128); - } else if (f3_game == ARKRETRN) { - static const UINT8 arkretrn_eeprom[128] = { - 0x54,0x41,0x49,0x54,0x4f,0x03,0x00,0x07,0xa1,0xe8,0xe0,0x01,0x11,0x12,0x30,0x00, - 0x00,0x00,0x02,0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x63, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - static const UINT8 arkretrnj_eeprom[128] = { - 0x54,0x41,0x49,0x54,0x4f,0x01,0x00,0x07,0xa1,0xe8,0xe0,0x01,0x11,0x11,0x30,0x00, - 0x00,0x00,0x02,0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x66, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - static const UINT8 arkretrnu_eeprom[128] = { - 0x54,0x41,0x49,0x54,0x4f,0x02,0x00,0x07,0xa1,0xe8,0xe0,0x01,0x11,0x11,0x30,0x00, - 0x00,0x00,0x02,0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4c,0x65, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - - if (strstr(BurnDrvGetTextA(DRV_NAME), "arkretrnu")) { - EEPROMFill(arkretrnu_eeprom, 0, 128); - } else if (strstr(BurnDrvGetTextA(DRV_NAME), "arkretrnj")) { - EEPROMFill(arkretrnj_eeprom, 0, 128); - } else { - EEPROMFill(arkretrn_eeprom, 0, 128); - } - } else if (f3_game == PUCHICAR) { - static const UINT8 puchicar_eeprom[128] = { - 0x54,0x41,0x49,0x54,0x4f,0x03,0x00,0x07,0xa1,0xf2,0xe0,0x01,0x11,0x12,0x30,0x00, - 0x00,0x00,0x02,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4d,0x59, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - static const UINT8 puchicarj_eeprom[128] = { - 0x54,0x41,0x49,0x54,0x4f,0x01,0x00,0x07,0xa1,0xf2,0xe0,0x01,0x11,0x11,0x30,0x00, - 0x00,0x00,0x02,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4d,0x5c, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }; - if (strstr(BurnDrvGetTextA(DRV_NAME), "puchicarj")) { - EEPROMFill(puchicarj_eeprom, 0, 128); - } else { - EEPROMFill(puchicar_eeprom, 0, 128); - } - } else if (f3_game == SCFINALS) { - static const UINT8 scfinals_eeprom[128] = { - 0x54,0x41,0x49,0x54,0x4f,0x03,0x50,0x01,0xe0,0x30,0xe0,0x01,0x11,0x12,0x30,0x00, - 0x00,0x00,0xff,0x00,0x00,0x32,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0xc3,0xf2, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff - }; - static const UINT8 scfinalso_eeprom[128] = { - 0x54,0x41,0x49,0x54,0x4f,0x03,0x50,0x01,0xe0,0x30,0xe0,0x01,0x11,0x12,0x30,0x00, - 0x00,0x00,0xff,0x00,0x00,0x31,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0xc3,0xf3, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff - }; - if (strstr(BurnDrvGetTextA(DRV_NAME), "scfinalso")) { - EEPROMFill(scfinalso_eeprom, 0, 128); - } else { - EEPROMFill(scfinals_eeprom, 0, 128); - } - } - } - - f3_reset_dirtybuffer(); - - TaitoF3VideoReset(); - - if (f3_game == LANDMAKR) - { // init landmakr's palette with rainbow, needed for text on the "you win" / "you lose" screen. - f3_palette_landmakr_onreset(); - } - - sound_cpu_in_reset = 1; - watchdog = 0; - previous_coin = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += 0x0200000; - - TaitoF3SoundRom = Next; - Taito68KRom2 = Next; Next += 0x0100000; - if (f3_game == KIRAMEKI) Next += 0x200000; - - TaitoSpritesA = Next; Next += TaitoSpriteARomSize; - TaitoChars = Next; Next += TaitoCharRomSize; - - tile_opaque_sp = Next; Next += TaitoSpriteARomSize / 0x100; - - tile_opaque_pf[0] = Next; Next += TaitoCharRomSize / 0x100; - tile_opaque_pf[1] = Next; Next += TaitoCharRomSize / 0x100; - tile_opaque_pf[2] = Next; Next += TaitoCharRomSize / 0x100; - tile_opaque_pf[3] = Next; Next += TaitoCharRomSize / 0x100; - tile_opaque_pf[4] = Next; Next += TaitoCharRomSize / 0x100; - tile_opaque_pf[5] = Next; Next += TaitoCharRomSize / 0x100; - tile_opaque_pf[6] = Next; Next += TaitoCharRomSize / 0x100; - tile_opaque_pf[7] = Next; Next += TaitoCharRomSize / 0x100; - - MSM6295ROM = Next; - TaitoF3ES5506Rom = Next; - TaitoES5505Rom = Next; Next += TaitoF3ES5506RomSize; - - TaitoDefaultEEProm = Next; Next += 0x0000080; - - pBurnDrvPalette = (UINT32 *)Next; - TaitoPalette = (UINT32 *)Next; Next += 0x0002000 * sizeof (UINT32); - - TaitoCharsB = Next; Next += 0x0004000; - TaitoCharsPivot = Next; Next += 0x0020000; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x0020000; - TaitoPaletteRam = Next; Next += 0x0008000; - TaitoSpriteRam = Next; Next += 0x0010000; - TaitoSpriteRamDelayed = Next; Next += 0x0010000; - TaitoSpriteRamDelayed2 = Next; Next += 0x0010000; - TaitoF3PfRAM = Next; Next += 0x000c000; - TaitoVideoRam = Next; Next += 0x0002000; - DrvVRAMRAM = Next; Next += 0x0002000; - TaitoF3LineRAM = Next; Next += 0x0010000; - DrvPivotRAM = Next; Next += 0x0010000; - TaitoF3CtrlRAM = Next; Next += 0x0000400; - - DrvCoinWord = (UINT16*)Next; Next += 2 * sizeof(INT16); - - TaitoF3SoundRam = Next; Next += 0x0010000; - TaitoF3SharedRam = Next; Next += 0x0000800; - TaitoES5510DSPRam = Next; Next += 0x0000200; - - TaitoES5510GPR = (UINT32*)Next; Next += 0x0000c0 * sizeof(UINT32); - TaitoES5510DRAM = (UINT16*)Next; Next += 0x200000 * sizeof(UINT16); - - TaitoRamEnd = Next; - - output_bitmap = (UINT32*)Next; Next += 512 * 512 * sizeof(INT32); - - TaitoPriorityMap = Next; Next += 1024 * 512; - - bitmap_layer[0] = (UINT16*)Next; Next += 1024 * 512 * sizeof(INT16); - bitmap_layer[1] = (UINT16*)Next; Next += 1024 * 512 * sizeof(INT16); - bitmap_layer[2] = (UINT16*)Next; Next += 1024 * 512 * sizeof(INT16); - bitmap_layer[3] = (UINT16*)Next; Next += 1024 * 512 * sizeof(INT16); - - bitmap_layer[4] = (UINT16*)Next; Next += 512 * 512 * sizeof(INT16); - bitmap_layer[5] = (UINT16*)Next; Next += 512 * 512 * sizeof(INT16); - bitmap_layer[6] = (UINT16*)Next; Next += 512 * 512 * sizeof(INT16); - bitmap_layer[7] = (UINT16*)Next; Next += 512 * 512 * sizeof(INT16); - - bitmap_layer[8] = (UINT16*)Next; Next += 512 * 512 * sizeof(INT16); - bitmap_layer[9] = (UINT16*)Next; Next += 512 * 256 * sizeof(INT16); - - bitmap_flags[0] = Next; Next += 1024 * 512; - bitmap_flags[1] = Next; Next += 1024 * 512; - bitmap_flags[2] = Next; Next += 1024 * 512; - bitmap_flags[3] = Next; Next += 1024 * 512; - bitmap_flags[4] = Next; Next += 512 * 512; - bitmap_flags[5] = Next; Next += 512 * 512; - bitmap_flags[6] = Next; Next += 512 * 512; - bitmap_flags[7] = Next; Next += 512 * 512; - bitmap_flags[8] = Next; Next += 512 * 512; - bitmap_flags[9] = Next; Next += 512 * 256; - - dirty_tiles = Next; Next += 0x8000 / 4; - - TaitoMemEnd = Next; - - return 0; -} - -static void DrvCalculateTransTable(INT32 sprlen, INT32 len) -{ - { - UINT8 *sprite_gfx = TaitoSpritesA; - - memset (tile_opaque_sp, 1, sprlen/0x100); - - for (INT32 i = 0; i < sprlen; i++) { - if (sprite_gfx[i] == 0) { - tile_opaque_sp[i/0x100] = 0; - i|=0xff; - } - } - } - - { - UINT8 *pf_gfx = TaitoChars; - - for (INT32 c = 0;c < len/0x100;c++) - { - INT32 x,y; - INT32 extra_planes; /* 0 = 4bpp, 1=5bpp, 2=?, 3=6bpp */ - - for (extra_planes=0; extra_planes<4; extra_planes++) - { - INT32 chk_trans_or_opa=0; - UINT8 extra_mask = ((extra_planes << 4) | 0x0f); - const UINT8 *dp = pf_gfx + c * 0x100; - - for (y = 0;y < 16;y++) - { - for (x = 0;x < 16;x++) - { - if(!(dp[x] & extra_mask)) - chk_trans_or_opa|=2; - else - chk_trans_or_opa|=1; - } - dp += 16; - } - - tile_opaque_pf[extra_planes][c]=chk_trans_or_opa; - } - } - } -} - -static void DrvGfxDecode(INT32 spr_len, INT32 tile_len) -{ - INT32 Plane0[6] = { (spr_len * 4)+0, (spr_len * 4)+1, 0, 1, 2, 3 }; // sprite - INT32 Plane1[6] = { (tile_len * 4)+2, (tile_len * 4)+3, 0, 1, 2, 3 }; // tile - INT32 XOffs0[16] = { 4, 0, 12, 8, 16+4, 16+0, 16+12, 16+8, 32+4, 32+0, 32+12, 32+8, 48+4, 48+0, 48+12, 48+8 }; - INT32 XOffs1[16] = { 4, 0, 16+4, 16+0, 8+4, 8+0, 24+4, 24+0, 32+4, 32+0, 48+4, 48+0, 40+4, 40+0, 56+4, 56+0 }; - INT32 YOffs[16] = { STEP16(0, 64) }; - - UINT8 *tmp = (UINT8*)BurnMalloc((spr_len > tile_len) ? spr_len : tile_len); - - memcpy (tmp, TaitoSpritesA, spr_len); - - GfxDecode((spr_len / 0x100), 6, 16, 16, Plane0, XOffs0, YOffs, 0x400, tmp, TaitoSpritesA); - - memcpy (tmp, TaitoChars, tile_len); - - GfxDecode((tile_len / 0x100), 6, 16, 16, Plane1, XOffs1, YOffs, 0x400, tmp, TaitoChars); - - TaitoSpriteAModulo = (spr_len / 0x100); - TaitoCharModulo = (tile_len / 0x100); - - BurnFree (tmp); -} - -static void tile_decode(INT32 spr_len, INT32 tile_len) -{ - UINT8 lsb,msb; - UINT8 *gfx = TaitoChars; - INT32 size=tile_len; - UINT32 offset = size/2; - - for (INT32 i = size/2+size/4; i>0) | ((lsb&0x02)<<4) | ((lsb&0x01)<<1); - gfx[offset+2]=((msb&0x08)<<1) | ((msb&0x04)>>2) | ((lsb&0x08)<<2) | ((lsb&0x04)>>1); - gfx[offset+1]=((msb&0x20)>>1) | ((msb&0x10)>>4) | ((lsb&0x20)<<0) | ((lsb&0x10)>>3); - gfx[offset+3]=((msb&0x80)>>3) | ((msb&0x40)>>6) | ((lsb&0x80)>>2) | ((lsb&0x40)>>5); - - offset+=4; - } - - size = spr_len; - offset = size/2; - - for (INT32 i = size/2+size/4; i> 0) & 3) << 2) | (((TaitoSpritesA[i] >> 2) & 3) << 6); - TaitoSpritesA[offset+1] = (((TaitoSpritesA[i] >> 4) & 3) << 2) | (((TaitoSpritesA[i] >> 6) & 3) << 6); - } - - DrvGfxDecode(spr_len, tile_len); - - DrvCalculateTransTable(spr_len, tile_len); -} - -static INT32 TaitoF3GetRoms(bool bLoad) -{ - if (!bLoad) TaitoF3ES5506RomSize = 0; - - char* pRomName; - struct BurnRomInfo ri; - struct BurnRomInfo pi; - - UINT8 *sprites = TaitoSpritesA; - UINT8 *tiles = TaitoChars; - UINT8 *samples = TaitoES5505Rom + ((TaitoF3ES5506RomSize == 0x1000000) ? 0x400000 : 0); - - INT32 prevsize = 0; - INT32 prevtype = 0; - INT32 tilecount = 0; - INT32 spritecount = 0; - INT32 ret = 0; - - for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) { - prevsize = ri.nLen; - prevtype = ri.nType; - - BurnDrvGetRomInfo(&ri, i); - BurnDrvGetRomInfo(&pi, i+1); - - if (ri.nType == TAITO_68KROM1_BYTESWAP32) - { - // if (bLoad) bprintf (0, _T("000000 68k1\n")); - - if (bLoad) { - ret = BurnLoadRom(Taito68KRom1 + 1, i + 0, 4); - ret |= BurnLoadRom(Taito68KRom1 + 0, i + 1, 4); - ret |= BurnLoadRom(Taito68KRom1 + 3, i + 2, 4); - ret |= BurnLoadRom(Taito68KRom1 + 2, i + 3, 4); - if (ret) return 1; - } - i += 3; - continue; - } - - if (ri.nType == TAITO_SPRITESA_BYTESWAP) - { - // if (bLoad) bprintf (0, _T("%6.6x sprite 2x\n"), sprites - TaitoSpritesA); - - if (f3_game == GSEEKER) - { - if (bLoad) { - if (BurnLoadRom(sprites + 0x000000, i + 0, 2)) return 1; - if (BurnLoadRom(sprites + 0x100001, i + 1, 2)) return 1; - if (BurnLoadRom(sprites + 0x000000, i + 2, 2)) return 1; - if (BurnLoadRom(sprites + 0x000001, i + 3, 2)) return 1; - memset (sprites + 0x200000, 0, 0x100000); - } - sprites += 0x400000; - i+=3; - } - else - { - if (bLoad) { - BurnLoadRom(sprites + 0, i + 0, 2); - BurnLoadRom(sprites + 1, i + 1, 2); - } - sprites += ri.nLen * 2; - i++; - } - continue; - } - - if (ri.nType == TAITO_SPRITESA) - { - spritecount = 1; - if (prevtype == TAITO_SPRITESA_BYTESWAP) { - sprites = TaitoSpritesA + ((sprites - TaitoSpritesA) / 2) * 3; - } - - // if (bLoad) bprintf (0, _T("%6.6x sprite 1x \n"), sprites - TaitoSpritesA); - - if (bLoad) { - BurnLoadRom(sprites + 0, i + 0, 1); - } - sprites += ri.nLen; - continue; - } - - if (ri.nType == TAITO_CHARS_BYTESWAP32) - { - // if (bLoad) bprintf (0, _T("%6.6x tiles x4\n"), tiles - TaitoChars); - - if (bLoad) { - ret = BurnLoadRom(tiles + 0, i + 0, 4); - ret |= BurnLoadRom(tiles + 1, i + 1, 4); - ret |= BurnLoadRom(tiles + 2, i + 2, 4); - ret |= BurnLoadRom(tiles + 3, i + 3, 4); - if (ret) return 1; - } - i+=3; - tiles += ri.nLen * 4; - continue; - } - - if (ri.nType == TAITO_CHARS_BYTESWAP) - { - if (prevtype == TAITO_CHARS_BYTESWAP32) { - tiles = TaitoChars + ((tiles - TaitoChars) / 2) * 3; - tilecount = 1; - } - - // if (bLoad) bprintf (0, _T("%6.6x tiles x2\n"), tiles - TaitoChars); - - if (pi.nType != TAITO_CHARS_BYTESWAP) { - if (bLoad) { - BurnLoadRom(tiles + 0, i + 0, 2); - } - } else { - if (bLoad) { - BurnLoadRom(tiles + 0, i + 0, 2); - BurnLoadRom(tiles + 1, i + 1, 2); - } - i++; - } - tiles += ri.nLen * 2; - continue; - } - - if (ri.nType == TAITO_CHARS) - { - tilecount = 1; - if (prevtype == TAITO_CHARS_BYTESWAP) { - tiles = TaitoChars + ((tiles - TaitoChars) / 2) * 3; - } - - // if (bLoad) bprintf (0, _T("%6.6x tiles x1 \n"), tiles - TaitoChars); - - if (bLoad) { - BurnLoadRom(tiles + 0, i + 0, 1); - } - tiles += ri.nLen; - // if (bLoad) bprintf (0, _T("%6.6x tiles x1b \n"), tiles - TaitoChars); - - continue; - } - - if (ri.nType == TAITO_68KROM2_BYTESWAP) - { - // if (bLoad) bprintf (0, _T("000000 68k2 x2\n")); - - if (bLoad) { - ret = BurnLoadRom(Taito68KRom2 + 1, i + 0, 2); - ret |= BurnLoadRom(Taito68KRom2 + 0, i + 1, 2); - if (ret) return 1; - } - i++; - continue; - } - - if (ri.nType == TAITO_68KROM2) // kirameki - { - // if (bLoad) bprintf (0, _T("100000, 68k1 x1\n")); - if (bLoad) { - BurnLoadRom(Taito68KRom2 + 0x100000, i, 1); - } - continue; - } - - if (ri.nType == TAITO_ES5505_BYTESWAP) - { - INT32 size = samples - TaitoES5505Rom; - - if (prevtype == TAITO_ES5505_BYTESWAP && prevsize == 0x200000 && ri.nLen == 0x100000 && size == 0x400000) { - samples += 0x200000; - } - - if (size == 0xc00000 && ri.nLen == 0x100000) { - samples += 0x200000; - } - - // if (bLoad) bprintf (0, _T("%6.6x, samples \n"), samples - TaitoES5505Rom); - - if (bLoad) { - if (BurnLoadRom(samples + 1, i, 2)) return 1; - } - samples += ri.nLen * 2; - continue; - } - - if (ri.nType == TAITO_DEFAULT_EEPROM) - { - if (bLoad) { - if (BurnLoadRom(TaitoDefaultEEProm, i, 1)) return 1; - } - continue; - } - } - - if (bLoad == false) { - INT32 spritesize = sprites - TaitoSpritesA; - INT32 tilesize = tiles - TaitoChars; - INT32 samplesize = samples - TaitoES5505Rom; - - if (samplesize >= 0xa00000) { - samplesize = 0x1000000; - } - - if (tilecount == 0) tilesize *= 2; - if (spritecount == 0) spritesize *= 2; - - for (INT32 i = 1; i < 1<<30; i<<=1) { - if (i >= samplesize) { - samplesize = i; - break; - } - } - - TaitoSpriteARomSize = spritesize; - TaitoCharRomSize = tilesize; - TaitoF3ES5506RomSize = samplesize; - // bprintf (0, _T("Load: %x, %x, %x\n"), spritesize, tilesize, samplesize); - } - - return 0; -} - - -static INT32 DrvInit(INT32 (*pRomLoadCB)(), void (*pPalUpdateCB)(UINT16), INT32 extend, INT32 kludge, INT32 spritelag, UINT32 speedhack_addr) -{ - f3_game = kludge; - - TaitoF3GetRoms(false); - - MemIndex(); - INT32 nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - { - if (TaitoF3GetRoms(true)) return 1; - - if (pRomLoadCB) { - if (pRomLoadCB()) return 1; - } - - tile_decode(TaitoSpriteARomSize, TaitoCharRomSize); - } - - SekInit(0, 0x68ec020); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x400000, 0x41ffff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x420000, 0x43ffff, MAP_RAM); // mirror - SekMapMemory(TaitoPaletteRam, 0x440000, 0x447fff, MAP_ROM); // write through handler - SekMapMemory(TaitoSpriteRam, 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(TaitoF3PfRAM, 0x610000, 0x617fff, MAP_ROM); // write through handler - SekMapMemory(TaitoF3PfRAM + 0x8000, 0x618000, 0x61bfff, MAP_RAM); - SekMapMemory(TaitoVideoRam, 0x61c000, 0x61dfff, MAP_ROM); // write through - SekMapMemory(DrvVRAMRAM, 0x61e000, 0x61ffff, MAP_ROM); // write through handler - SekMapMemory(TaitoF3LineRAM, 0x620000, 0x62ffff, MAP_RAM); - SekMapMemory(DrvPivotRAM, 0x630000, 0x63ffff, MAP_ROM); // write through handler - SekMapMemory(TaitoF3CtrlRAM, 0x660000, 0x6603ff, MAP_WRITE); // 0-1f - SekMapMemory(TaitoF3SharedRam, 0xc00000, 0xc007ff, MAP_RAM); - SekSetWriteLongHandler(0, f3_main_write_long); - SekSetWriteWordHandler(0, f3_main_write_word); - SekSetWriteByteHandler(0, f3_main_write_byte); - SekSetReadLongHandler(0, f3_main_read_long); - SekSetReadWordHandler(0, f3_main_read_word); - SekSetReadByteHandler(0, f3_main_read_byte); - - SekMapHandler(1, 0x440000, 0x447fff, MAP_WRITE); - SekSetWriteLongHandler(1, f3_palette_write_long); - SekSetWriteWordHandler(1, f3_palette_write_word); - SekSetWriteByteHandler(1, f3_palette_write_byte); - - SekMapHandler(2, 0x61c000, 0x61ffff, MAP_WRITE); // VRAM and TaitoVideoRam - SekSetWriteLongHandler(2, f3_VRAM_write_long); - SekSetWriteWordHandler(2, f3_VRAM_write_word); - SekSetWriteByteHandler(2, f3_VRAM_write_byte); - - SekMapHandler(3, 0x630000, 0x63ffff, MAP_WRITE); - SekSetWriteLongHandler(3, f3_pivot_write_long); - SekSetWriteWordHandler(3, f3_pivot_write_word); - SekSetWriteByteHandler(3, f3_pivot_write_byte); - - SekMapHandler(4, 0x610000, 0x617fff, MAP_WRITE); - SekSetWriteLongHandler(4, f3_playfield_write_long); - SekSetWriteWordHandler(4, f3_playfield_write_word); - SekSetWriteByteHandler(4, f3_playfield_write_byte); - SekClose(); - - f3_speedhack_init(speedhack_addr); - - TaitoF3SoundInit(1); - - EEPROMInit(&eeprom_interface_93C46); - EEPROMIgnoreErrMessage(1); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nScreenHeight, &nScreenWidth); - } else { - BurnDrvGetVisibleSize(&nScreenWidth, &nScreenHeight); - } - - pPaletteUpdateCallback = pPalUpdateCB; - extended_layers = extend; - sprite_lag = spritelag; - - TaitoF3VideoInit(); - - bitmap_width[0] = (extend) ? 1024 : 512; - bitmap_width[1] = (extend) ? 1024 : 512; - bitmap_width[2] = (extend) ? 1024 : 512; - bitmap_width[3] = (extend) ? 1024 : 512; - bitmap_width[4] = 512; - bitmap_width[5] = 512; - bitmap_width[6] = 512; - bitmap_width[7] = 512; - - DrvDoReset(1); - - return 0; -} - -static INT32 DrvExit() -{ - SekExit(); - TaitoF3SoundExit(); - - if (BurnDrvGetFlags() & BDF_BOOTLEG) { - MSM6295Exit(0); - } - - EEPROMExit(); - - BurnFree (TaitoMem); - - TaitoF3VideoExit(); - - TaitoClearVariables(); // from taito.cpp - - pPaletteUpdateCallback = NULL; - supercupkludge = 0; - - return 0; -} - -static void f3_12bit_palette_update(UINT16 offset) -{ - UINT32 x = *((UINT32*)(TaitoPaletteRam + (offset & ~3))); - - UINT8 r = ((x >> 28) & 0x0f) * 0x0f; - UINT8 g = ((x >> 24) & 0x0f) * 0x0f; - UINT8 b = ((x >> 20) & 0x0f) * 0x0f; - - TaitoPalette[offset/4] = r*0x10000+g*0x100+b; //BurnHighCol(r,g,b, 0); -} - -static void f3_21bit_typeA_palette_update(UINT16 offset) -{ - UINT32 x = *((UINT32*)(TaitoPaletteRam + (offset & ~3))); - - UINT8 r = x; - UINT8 g = x >> 24; - UINT8 b = x >> 16; - - if (offset < 0x400 || offset > 0x4000) { - r <<= 1; - g <<= 1; - b <<= 1; - } - - TaitoPalette[offset/4] = r*0x10000+g*0x100+b; -} - -static void f3_21bit_typeB_palette_update(UINT16 offset) -{ - UINT32 x = *((UINT32*)(TaitoPaletteRam + (offset & ~3))); - - UINT8 r = x; - UINT8 g = x >> 24; - UINT8 b = x >> 16; - - if (offset > 0x7000) { - r <<= 1; - g <<= 1; - b <<= 1; - } - - TaitoPalette[offset/4] = r*0x10000+g*0x100+b; //BurnHighCol(r,g,b, 0); -} - -static void f3_24bit_palette_update(UINT16 offset) -{ - UINT32 x = *((UINT32*)(TaitoPaletteRam + (offset & ~3))); - - UINT8 r = x; - UINT8 g = x >> 24; - UINT8 b = x >> 16; - - TaitoPalette[offset/4] = r*0x10000+g*0x100+b; //BurnHighCol(r,g,b, 0); -} - -static INT32 DrvDraw224A_Flipped() // 224A, w/ flipscreen -{ - TaitoF3DrawCommon(0x1234); - - return 0; -} - -static INT32 DrvDraw224A() -{ - TaitoF3DrawCommon(31); - - return 0; -} - -static INT32 DrvDraw224B() -{ - TaitoF3DrawCommon(32); - - return 0; -} - -static INT32 DrvDraw() -{ - TaitoF3DrawCommon(24); - - return 0; -} - -static INT32 DrvFrame() -{ - watchdog++; - if (watchdog >= 180) { - DrvDoReset(0); - } - - if (DrvReset) { - DrvDoReset(1); - } - - { - memset (DrvInputs, 0xff, 5 * sizeof(short)); - - for (INT32 i = 0; i < 16; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - - DrvInputs[1] &= ~0xff00; - DrvInputs[4] = (DrvInputs[4] & ~2) | ((DrvSrv[0]) ? 0x00 : 0x02); - - DrvInputs[4] |= 0xf0; // set all coins disabled - - INT32 cur_coin = ((DrvJoy5[4] & 1) << 4) | ((DrvJoy5[5] & 1) << 5) | ((DrvJoy5[6] & 1) << 6) | ((DrvJoy5[7] & 1) << 7); - - if (supercupkludge) { - if (cur_coin) DrvInputs[0] = 0xffff & ~0x200; - } else { - for (INT32 i = 0x10; i < 0x100; i <<= 1) { - if ((cur_coin & i) == i && (previous_coin & i) == 0) { - DrvInputs[4] &= ~i; - } - } - } - - previous_coin = cur_coin; - } - - INT32 nInterleave = 256; - nTaitoCyclesTotal[0] = 16000000 / 60; // do not touch! - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = 0; - - SekNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == 255) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - if (i == 7) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO); - SekClose(); - - if ((BurnDrvGetFlags() & BDF_BOOTLEG) == 0) { - if (sound_cpu_in_reset == 0) - TaitoF3CpuUpdate(nInterleave, i); - } - } - - if (BurnDrvGetFlags() & BDF_BOOTLEG) { - if (pBurnSoundOut) { - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - } - } else { - TaitoF3SoundUpdate(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - switch (sprite_lag) { - case 0: break; // no delay - case 2: memcpy(TaitoSpriteRamDelayed2, TaitoSpriteRamDelayed, 0x10000); // no break! - case 1: /* 1 & 2 */ memcpy(TaitoSpriteRamDelayed, TaitoSpriteRam, 0x10000); break; - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_MEMORY_ROM) { - ba.Data = Taito68KRom1; - ba.nLen = 0x0200000; - ba.nAddress = 0; - ba.szName = "Main ROM"; - BurnAcb(&ba); - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = Taito68KRam1; - ba.nLen = 0x020000; - ba.nAddress = 0x400000; - ba.szName = "F3 RAM"; - BurnAcb(&ba); - - ba.Data = TaitoPaletteRam; - ba.nLen = 0x0010000; - ba.nAddress = 0x440000; - ba.szName = "Palette RAM"; - BurnAcb(&ba); - - ba.Data = TaitoSpriteRam; - ba.nLen = 0x0010000; - ba.nAddress = 0x600000; - ba.szName = "Sprite RAM"; - BurnAcb(&ba); - - ba.Data = TaitoF3PfRAM; - ba.nLen = 0x000c000; - ba.nAddress = 0x610000; - ba.szName = "Playfield RAM"; - BurnAcb(&ba); - - ba.Data = TaitoVideoRam; - ba.nLen = 0x0002000; - ba.nAddress = 0x61c000; - ba.szName = "Video RAM"; - BurnAcb(&ba); - - ba.Data = DrvVRAMRAM; - ba.nLen = 0x0002000; - ba.nAddress = 0x61e000; - ba.szName = "VRAM"; - BurnAcb(&ba); - - ba.Data = TaitoF3LineRAM; - ba.nLen = 0x0010000; - ba.nAddress = 0x620000; - ba.szName = "Line RAM"; - BurnAcb(&ba); - - ba.Data = DrvPivotRAM; - ba.nLen = 0x0010000; - ba.nAddress = 0x620000; - ba.szName = "Pivot RAM"; - BurnAcb(&ba); - - ba.Data = TaitoF3CtrlRAM; - ba.nLen = 0x0000400; - ba.nAddress = 0x660000; - ba.szName = "Control Registers"; - BurnAcb(&ba); - - ba.Data = TaitoF3SoundRam; - ba.nLen = 0x010000; - ba.nAddress = 0x000000; - ba.szName = "F3 Sound RAM"; - BurnAcb(&ba); - - ba.Data = TaitoF3SharedRam; - ba.nLen = 0x000800; - ba.nAddress = 0x000000; - ba.szName = "F3 Shared RAM"; - BurnAcb(&ba); - - ba.Data = TaitoES5510DSPRam; - ba.nLen = 0x000200; - ba.nAddress = 0x000000; - ba.szName = "ES5510 DSP RAM"; - BurnAcb(&ba); - - ba.Data = TaitoES5510GPR; - ba.nLen = 0x0000c0 * sizeof(UINT32); - ba.nAddress = 0x000000; - ba.szName = "ES5510 GPR RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - TaitoF3SoundScan(nAction, pnMin); - SCAN_VAR(sound_cpu_in_reset); - - if (nAction & ACB_WRITE) { - for (INT32 i = 0; i < 0x2000; i+=4) { - DrvVRAMExpand(i); - } - - for (INT32 i = 0; i < 0x10000; i+=4) { - DrvPivotExpand(i); - } - - f3_reset_dirtybuffer(); - } - } - - return 0; -} - - - -// Ring Rage (Ver 2.3O 1992/08/09) - -static struct BurnRomInfo ringrageRomDesc[] = { - { "d21-23.40", 0x040000, 0x14e9ed65, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d21-22.38", 0x040000, 0x6f8b65b0, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d21-21.36", 0x040000, 0xbf7234bc, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d21-25.34", 0x040000, 0xaeff6e19, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d21-02.66", 0x200000, 0xfacd3a02, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d21-03.67", 0x200000, 0x6f653e68, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d21-04.68", 0x200000, 0x9dcdceca, TAITO_SPRITESA }, // 6 - - { "d21-06.49", 0x080000, 0x92d4a720, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d21-07.50", 0x080000, 0x6da696e9, TAITO_CHARS_BYTESWAP }, // 8 - { "d21-08.51", 0x080000, 0xa0d95be9, TAITO_CHARS } , // 9 - - { "d21-18.5", 0x020000, 0x133b55d0, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d21-19.6", 0x020000, 0x1f98908f, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d21-01.17", 0x200000, 0x1fb6f07d, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d21-05.18", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(ringrage) -STD_ROM_FN(ringrage) - -static INT32 ringrageInit() -{ - return DrvInit(NULL, f3_12bit_palette_update, 0, RINGRAGE, 2, 0); -} - -struct BurnDriver BurnDrvRingrage = { - "ringrage", NULL, NULL, NULL, "1992", - "Ring Rage (Ver 2.3O 1992/08/09)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, ringrageRomInfo, ringrageRomName, NULL, NULL, F3InputInfo, NULL, - ringrageInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Ring Rage (Ver 2.3A 1992/08/09) - -static struct BurnRomInfo ringrageuRomDesc[] = { - { "d21-23.40", 0x040000, 0x14e9ed65, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d21-22.38", 0x040000, 0x6f8b65b0, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d21-21.36", 0x040000, 0xbf7234bc, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d21-24.34", 0x040000, 0x404dee67, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d21-02.66", 0x200000, 0xfacd3a02, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d21-03.67", 0x200000, 0x6f653e68, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d21-04.68", 0x200000, 0x9dcdceca, TAITO_SPRITESA }, // 6 - - { "d21-06.49", 0x080000, 0x92d4a720, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d21-07.50", 0x080000, 0x6da696e9, TAITO_CHARS_BYTESWAP }, // 8 - { "d21-08.51", 0x080000, 0xa0d95be9, TAITO_CHARS } , // 9 - - { "d21-18.5", 0x020000, 0x133b55d0, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d21-19.6", 0x020000, 0x1f98908f, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d21-01.17", 0x200000, 0x1fb6f07d, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d21-05.18", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(ringrageu) -STD_ROM_FN(ringrageu) - -struct BurnDriver BurnDrvRingrageu = { - "ringrageu", "ringrage", NULL, NULL, "1992", - "Ring Rage (Ver 2.3A 1992/08/09)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, ringrageuRomInfo, ringrageuRomName, NULL, NULL, F3InputInfo, NULL, - ringrageInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Ring Rage (Ver 2.3J 1992/08/09) - -static struct BurnRomInfo ringragejRomDesc[] = { - { "d21-23.40", 0x040000, 0x14e9ed65, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d21-22.38", 0x040000, 0x6f8b65b0, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d21-21.36", 0x040000, 0xbf7234bc, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d21-20.34", 0x040000, 0xa8eb68a4, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d21-02.66", 0x200000, 0xfacd3a02, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d21-03.67", 0x200000, 0x6f653e68, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d21-04.68", 0x200000, 0x9dcdceca, TAITO_SPRITESA }, // 6 - - { "d21-06.49", 0x080000, 0x92d4a720, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d21-07.50", 0x080000, 0x6da696e9, TAITO_CHARS_BYTESWAP }, // 8 - { "d21-08.51", 0x080000, 0xa0d95be9, TAITO_CHARS } , // 9 - - { "d21-18.5", 0x020000, 0x133b55d0, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d21-19.6", 0x020000, 0x1f98908f, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d21-01.17", 0x200000, 0x1fb6f07d, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d21-05.18", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(ringragej) -STD_ROM_FN(ringragej) - -struct BurnDriver BurnDrvRingragej = { - "ringragej", "ringrage", NULL, NULL, "1992", - "Ring Rage (Ver 2.3J 1992/08/09)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, ringragejRomInfo, ringragejRomName, NULL, NULL, F3InputInfo, NULL, - ringrageInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - - -// Arabian Magic (Ver 1.0O 1992/07/06) - -static struct BurnRomInfo arabianmRomDesc[] = { - { "d29-23.ic40", 0x040000, 0x89a0c706, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d29-22.ic38", 0x040000, 0x4afc22a4, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d29-21.ic36", 0x040000, 0xac32eb38, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d29-25.ic34", 0x040000, 0xb9b652ed, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d29-03.ic66", 0x100000, 0xaeaff456, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d29-04.ic67", 0x100000, 0x01711cfe, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d29-05.ic68", 0x100000, 0x9b5f7a17, TAITO_SPRITESA }, // 6 - - { "d29-06.ic49", 0x080000, 0xeea07bf3, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d29-07.ic50", 0x080000, 0xdb3c094d, TAITO_CHARS_BYTESWAP }, // 8 - { "d29-08.ic51", 0x080000, 0xd7562851, TAITO_CHARS } , // 9 - - { "d29-18.ic5", 0x020000, 0xd97780df, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d29-19.ic6", 0x020000, 0xb1ad365c, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d29-01.ic17", 0x200000, 0x545ac4b3, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d29-02.ic18", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 13 - - { "D29-11.IC15.bin", 0x000157, 0x5dd5c8f9, BRF_OPT }, // 14 plds - { "pal20l8b.2", 0x000144, 0xc91437e2, BRF_OPT }, // 15 - { "D29-13.IC14.bin", 0x000157, 0x74d61d36, BRF_OPT }, // 16 - { "palce16v8h.11", 0x000117, 0x51088324, BRF_OPT }, // 17 - { "pal16l8b.22", 0x000104, 0x3e01e854, BRF_OPT }, // 18 - { "palce16v8h.31", 0x000117, 0xe0789727, BRF_OPT }, // 19 - { "pal16l8b.62", 0x000104, 0x7093e2f3, BRF_OPT }, // 20 - { "D29-14.IC28.bin", 0x000157, 0x25d205d5, BRF_OPT }, // 21 - { "pal20l8b.70", 0x000144, 0x92b5b97c, BRF_OPT }, // 22 -}; - -STD_ROM_PICK(arabianm) -STD_ROM_FN(arabianm) - -static INT32 arabianmInit() -{ - return DrvInit(NULL, f3_12bit_palette_update, 0, ARABIANM, 2, 0x408100); -} - -struct BurnDriver BurnDrvArabianm = { - "arabianm", NULL, NULL, NULL, "1992", - "Arabian Magic (Ver 1.0O 1992/07/06)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, arabianmRomInfo, arabianmRomName, NULL, NULL, F3InputInfo, NULL, - arabianmInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Arabian Magic (Ver 1.0J 1992/07/06) - -static struct BurnRomInfo arabianmjRomDesc[] = { - { "d29-23.ic40", 0x040000, 0x89a0c706, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d29-22.ic38", 0x040000, 0x4afc22a4, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d29-21.ic36", 0x040000, 0xac32eb38, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d29-20.ic34", 0x040000, 0x57b833c1, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d29-03.ic66", 0x100000, 0xaeaff456, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d29-04.ic67", 0x100000, 0x01711cfe, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d29-05.ic68", 0x100000, 0x9b5f7a17, TAITO_SPRITESA }, // 6 - - { "d29-06.ic49", 0x080000, 0xeea07bf3, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d29-07.ic50", 0x080000, 0xdb3c094d, TAITO_CHARS_BYTESWAP }, // 8 - { "d29-08.ic51", 0x080000, 0xd7562851, TAITO_CHARS } , // 9 - - { "d29-18.ic5", 0x020000, 0xd97780df, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d29-19.ic6", 0x020000, 0xb1ad365c, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d29-01.ic17", 0x200000, 0x545ac4b3, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d29-02.ic18", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 13 - - { "D29-11.IC15.bin", 0x000157, 0x5dd5c8f9, BRF_OPT }, // 14 plds - { "pal20l8b.2", 0x000144, 0xc91437e2, BRF_OPT }, // 15 - { "D29-13.IC14.bin", 0x000157, 0x74d61d36, BRF_OPT }, // 16 - { "palce16v8h.11", 0x000117, 0x51088324, BRF_OPT }, // 17 - { "pal16l8b.22", 0x000104, 0x3e01e854, BRF_OPT }, // 18 - { "palce16v8h.31", 0x000117, 0xe0789727, BRF_OPT }, // 19 - { "pal16l8b.62", 0x000104, 0x7093e2f3, BRF_OPT }, // 20 - { "D29-14.IC28.bin", 0x000157, 0x25d205d5, BRF_OPT }, // 21 - { "pal20l8b.70", 0x000144, 0x92b5b97c, BRF_OPT }, // 22 -}; - -STD_ROM_PICK(arabianmj) -STD_ROM_FN(arabianmj) - -struct BurnDriver BurnDrvArabianmj = { - "arabianmj", "arabianm", NULL, NULL, "1992", - "Arabian Magic (Ver 1.0J 1992/07/06)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, arabianmjRomInfo, arabianmjRomName, NULL, NULL, F3InputInfo, NULL, - arabianmInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Arabian Magic (Ver 1.0A 1992/07/06) - -static struct BurnRomInfo arabianmuRomDesc[] = { - { "d29-23.ic40", 0x040000, 0x89a0c706, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d29-22.ic38", 0x040000, 0x4afc22a4, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d29-21.ic36", 0x040000, 0xac32eb38, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d29-24.ic34", 0x040000, 0xceb1627b, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d29-03.ic66", 0x100000, 0xaeaff456, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d29-04.ic67", 0x100000, 0x01711cfe, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d29-05.ic68", 0x100000, 0x9b5f7a17, TAITO_SPRITESA }, // 6 - - { "d29-06.ic49", 0x080000, 0xeea07bf3, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d29-07.ic50", 0x080000, 0xdb3c094d, TAITO_CHARS_BYTESWAP }, // 8 - { "d29-08.ic51", 0x080000, 0xd7562851, TAITO_CHARS } , // 9 - - { "d29-18.ic5", 0x020000, 0xd97780df, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d29-19.ic6", 0x020000, 0xb1ad365c, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d29-01.ic17", 0x200000, 0x545ac4b3, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d29-02.ic18", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 13 - - { "D29-11.IC15.bin", 0x000157, 0x5dd5c8f9, BRF_OPT }, // 14 plds - { "pal20l8b.2", 0x000144, 0xc91437e2, BRF_OPT }, // 15 - { "D29-13.IC14.bin", 0x000157, 0x74d61d36, BRF_OPT }, // 16 - { "palce16v8h.11", 0x000117, 0x51088324, BRF_OPT }, // 17 - { "pal16l8b.22", 0x000104, 0x3e01e854, BRF_OPT }, // 18 - { "palce16v8h.31", 0x000117, 0xe0789727, BRF_OPT }, // 19 - { "pal16l8b.62", 0x000104, 0x7093e2f3, BRF_OPT }, // 20 - { "D29-14.IC28.bin", 0x000157, 0x25d205d5, BRF_OPT }, // 21 - { "pal20l8b.70", 0x000144, 0x92b5b97c, BRF_OPT }, // 22 -}; - -STD_ROM_PICK(arabianmu) -STD_ROM_FN(arabianmu) - -struct BurnDriver BurnDrvArabianmu = { - "arabianmu", "arabianm", NULL, NULL, "1992", - "Arabian Magic (Ver 1.0A 1992/07/06)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, arabianmuRomInfo, arabianmuRomName, NULL, NULL, F3InputInfo, NULL, - arabianmInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Riding Fight (Ver 1.0O) - -static struct BurnRomInfo ridingfRomDesc[] = { - { "d34-12.40", 0x040000, 0xe67e69d4, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d34-11.38", 0x040000, 0x7d240a88, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d34-10.36", 0x040000, 0x8aa3f4ac, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d34_14.34", 0x040000, 0xe000198e, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d34-01.66", 0x200000, 0x7974e6aa, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d34-02.67", 0x200000, 0xf4422370, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "d34-05.49", 0x080000, 0x72e3ee4b, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "d34-06.50", 0x080000, 0xedc9b9f3, TAITO_CHARS_BYTESWAP }, // 7 - - { "d34-07.5", 0x020000, 0x67239e2b, TAITO_68KROM2_BYTESWAP }, // 8 68k Code - { "d34-08.6", 0x020000, 0x2cf20323, TAITO_68KROM2_BYTESWAP }, // 9 - - { "d34-03.17", 0x200000, 0xe534ef74, TAITO_ES5505_BYTESWAP }, // 10 Ensoniq Samples - { "d34-04.18", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 11 -}; - -STD_ROM_PICK(ridingf) -STD_ROM_FN(ridingf) - -static INT32 ridingfInit() -{ - return DrvInit(NULL, f3_12bit_palette_update, 1, RIDINGF, 1, 0x417FE4); -} - -struct BurnDriver BurnDrvRidingf = { - "ridingf", NULL, NULL, NULL, "1992", - "Riding Fight (Ver 1.0O)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_RACING, 0, - NULL, ridingfRomInfo, ridingfRomName, NULL, NULL, F3InputInfo, NULL, - ridingfInit, DrvExit, DrvFrame, DrvDraw224B, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Riding Fight (Ver 1.0J) - -static struct BurnRomInfo ridingfjRomDesc[] = { - { "d34-12.40", 0x040000, 0xe67e69d4, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d34-11.38", 0x040000, 0x7d240a88, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d34-10.36", 0x040000, 0x8aa3f4ac, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d34-09.34", 0x040000, 0x0e0e78a2, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d34-01.66", 0x200000, 0x7974e6aa, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d34-02.67", 0x200000, 0xf4422370, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "d34-05.49", 0x080000, 0x72e3ee4b, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "d34-06.50", 0x080000, 0xedc9b9f3, TAITO_CHARS_BYTESWAP }, // 7 - - { "d34-07.5", 0x020000, 0x67239e2b, TAITO_68KROM2_BYTESWAP }, // 8 68k Code - { "d34-08.6", 0x020000, 0x2cf20323, TAITO_68KROM2_BYTESWAP }, // 9 - - { "d34-03.17", 0x200000, 0xe534ef74, TAITO_ES5505_BYTESWAP }, // 10 Ensoniq Samples - { "d34-04.18", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 11 -}; - -STD_ROM_PICK(ridingfj) -STD_ROM_FN(ridingfj) - -struct BurnDriver BurnDrvRidingfj = { - "ridingfj", "ridingf", NULL, NULL, "1992", - "Riding Fight (Ver 1.0J)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_RACING, 0, - NULL, ridingfjRomInfo, ridingfjRomName, NULL, NULL, F3InputInfo, NULL, - ridingfInit, DrvExit, DrvFrame, DrvDraw224B, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Riding Fight (Ver 1.0A) - -static struct BurnRomInfo ridingfuRomDesc[] = { - { "d34-12.40", 0x040000, 0xe67e69d4, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d34-11.38", 0x040000, 0x7d240a88, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d34-10.36", 0x040000, 0x8aa3f4ac, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d34_13.34", 0x040000, 0x97072918, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d34-01.66", 0x200000, 0x7974e6aa, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d34-02.67", 0x200000, 0xf4422370, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "d34-05.49", 0x080000, 0x72e3ee4b, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "d34-06.50", 0x080000, 0xedc9b9f3, TAITO_CHARS_BYTESWAP }, // 7 - - { "d34-07.5", 0x020000, 0x67239e2b, TAITO_68KROM2_BYTESWAP }, // 8 68k Code - { "d34-08.6", 0x020000, 0x2cf20323, TAITO_68KROM2_BYTESWAP }, // 9 - - { "d34-03.17", 0x200000, 0xe534ef74, TAITO_ES5505_BYTESWAP }, // 10 Ensoniq Samples - { "d34-04.18", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 11 -}; - -STD_ROM_PICK(ridingfu) -STD_ROM_FN(ridingfu) - -struct BurnDriver BurnDrvRidingfu = { - "ridingfu", "ridingf", NULL, NULL, "1992", - "Riding Fight (Ver 1.0A)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_RACING, 0, - NULL, ridingfuRomInfo, ridingfuRomName, NULL, NULL, F3InputInfo, NULL, - ridingfInit, DrvExit, DrvFrame, DrvDraw224B, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - - -// Grid Seeker: Project Storm Hammer (Ver 1.3O) - -static struct BurnRomInfo gseekerRomDesc[] = { - { "d40_12.rom", 0x040000, 0x884055fb, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d40_11.rom", 0x040000, 0x85e701d2, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d40_10.rom", 0x040000, 0x1e659ac5, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d40_14.rom", 0x040000, 0xd9a76bd9, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d40_03.rom", 0x100000, 0xbcd70efc, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d40_04.rom", 0x100000, 0xcd2ac666, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d40_15.rom", 0x080000, 0x50555125, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d40_16.rom", 0x080000, 0x3f9bbe1e, TAITO_SPRITESA_BYTESWAP }, // 7 - - { "d40_05.rom", 0x100000, 0xbe6eec8f, TAITO_CHARS_BYTESWAP }, // 8 Layer Tiles - { "d40_06.rom", 0x100000, 0xa822abe4, TAITO_CHARS_BYTESWAP }, // 9 - - { "d40_07.rom", 0x020000, 0x7e9b26c2, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d40_08.rom", 0x020000, 0x9c926a28, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d40_01.rom", 0x200000, 0xee312e95, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d40_02.rom", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(gseeker) -STD_ROM_FN(gseeker) - -static INT32 gseekerInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, GSEEKER, 1, 0x40A85C); -} - -struct BurnDriver BurnDrvGseeker = { - "gseeker", NULL, NULL, NULL, "1992", - "Grid Seeker: Project Storm Hammer (Ver 1.3O)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, gseekerRomInfo, gseekerRomName, NULL, NULL, F3InputInfo, gseekerDIPInfo, - gseekerInit, DrvExit, DrvFrame, DrvDraw224B, DrvScan, &TaitoF3PalRecalc, 0x2000, - 224, 320, 3, 4 -}; - - -// Grid Seeker: Project Storm Hammer (Ver 1.3J) - -static struct BurnRomInfo gseekerjRomDesc[] = { - { "d40_12.rom", 0x040000, 0x884055fb, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d40_11.rom", 0x040000, 0x85e701d2, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d40_10.rom", 0x040000, 0x1e659ac5, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d40-09.34", 0x040000, 0x37a90af5, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d40_03.rom", 0x100000, 0xbcd70efc, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d40_04.rom", 0x100000, 0xcd2ac666, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d40_15.rom", 0x080000, 0x50555125, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d40_16.rom", 0x080000, 0x3f9bbe1e, TAITO_SPRITESA_BYTESWAP }, // 7 - - { "d40_05.rom", 0x100000, 0xbe6eec8f, TAITO_CHARS_BYTESWAP }, // 8 Layer Tiles - { "d40_06.rom", 0x100000, 0xa822abe4, TAITO_CHARS_BYTESWAP }, // 9 - - { "d40_07.rom", 0x020000, 0x7e9b26c2, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d40_08.rom", 0x020000, 0x9c926a28, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d40_01.rom", 0x200000, 0xee312e95, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d40_02.rom", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(gseekerj) -STD_ROM_FN(gseekerj) - -struct BurnDriver BurnDrvGseekerj = { - "gseekerj", "gseeker", NULL, NULL, "1992", - "Grid Seeker: Project Storm Hammer (Ver 1.3J)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, gseekerjRomInfo, gseekerjRomName, NULL, NULL, F3InputInfo, gseekerDIPInfo, - gseekerInit, DrvExit, DrvFrame, DrvDraw224B, DrvScan, &TaitoF3PalRecalc, 0x2000, - 224, 320, 3, 4 -}; - - -// Grid Seeker: Project Storm Hammer (Ver 1.3A) - -static struct BurnRomInfo gseekeruRomDesc[] = { - { "d40_12.rom", 0x040000, 0x884055fb, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d40_11.rom", 0x040000, 0x85e701d2, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d40_10.rom", 0x040000, 0x1e659ac5, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d40-13.bin", 0x040000, 0xaea05b4f, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d40_03.rom", 0x100000, 0xbcd70efc, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d40_04.rom", 0x100000, 0xcd2ac666, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d40_15.rom", 0x080000, 0x50555125, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d40_16.rom", 0x080000, 0x3f9bbe1e, TAITO_SPRITESA_BYTESWAP }, // 7 - - { "d40_05.rom", 0x100000, 0xbe6eec8f, TAITO_CHARS_BYTESWAP }, // 8 Layer Tiles - { "d40_06.rom", 0x100000, 0xa822abe4, TAITO_CHARS_BYTESWAP }, // 9 - - { "d40_07.rom", 0x020000, 0x7e9b26c2, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d40_08.rom", 0x020000, 0x9c926a28, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d40_01.rom", 0x200000, 0xee312e95, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d40_02.rom", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(gseekeru) -STD_ROM_FN(gseekeru) - -struct BurnDriver BurnDrvGseekeru = { - "gseekeru", "gseeker", NULL, NULL, "1992", - "Grid Seeker: Project Storm Hammer (Ver 1.3A)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, gseekeruRomInfo, gseekeruRomName, NULL, NULL, F3InputInfo, gseekerDIPInfo, - gseekerInit, DrvExit, DrvFrame, DrvDraw224B, DrvScan, &TaitoF3PalRecalc, 0x2000, - 224, 320, 3, 4 -}; - - -// Command War - Super Special Battle & War Game (Ver 0.0J) (Prototype) - -static struct BurnRomInfo commandwRomDesc[] = { - { "cw_mpr3.bin", 0x040000, 0x636944fc, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "cw_mpr2.bin", 0x040000, 0x1151a42b, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "cw_mpr1.bin", 0x040000, 0x93669389, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "cw_mpr0.bin", 0x040000, 0x0468df52, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "cw_objl0.bin", 0x200000, 0x9822102e, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "cw_objm0.bin", 0x200000, 0xf7687684, TAITO_SPRITESA_BYTESWAP }, // 5 - { "cw_objl1.bin", 0x200000, 0xca3ad7f6, TAITO_SPRITESA_BYTESWAP }, // 6 - { "cw_objm1.bin", 0x200000, 0x504b1bf5, TAITO_SPRITESA_BYTESWAP }, // 7 - { "cw_objh0.bin", 0x200000, 0x83d7e0ae, TAITO_SPRITESA }, // 8 - { "cw_objh1.bin", 0x200000, 0x324f5832, TAITO_SPRITESA }, // 9 - - { "cw_scr_l.bin", 0x100000, 0x4d202323, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "cw_scr_m.bin", 0x100000, 0x537b1c7d, TAITO_CHARS_BYTESWAP }, // 11 - { "cw_scr_h.bin", 0x100000, 0x001f85dd, TAITO_CHARS }, // 12 - - { "cw_spr1.bin", 0x020000, 0xc8f81c25, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "cw_spr0.bin", 0x020000, 0x2aaa9dfb, TAITO_68KROM2_BYTESWAP }, // 14 - - { "cw_pcm_0.bin", 0x200000, 0xa1e26629, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "cw_pcm_1.bin", 0x200000, 0x39fc6cf4, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(commandw) -STD_ROM_FN(commandw) - -static INT32 commandwInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, COMMANDW, 1, 0x417FE4); -} - -struct BurnDriver BurnDrvCommandw = { - "commandw", NULL, NULL, NULL, "1992", - "Command War - Super Special Battle & War Game (Ver 0.0J) (Prototype)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_PROTOTYPE, 2, HARDWARE_TAITO_MISC, GBF_MISC, 0, - NULL, commandwRomInfo, commandwRomName, NULL, NULL, F3InputInfo, NULL, - commandwInit, DrvExit, DrvFrame, DrvDraw224B, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Taito Cup Finals (Ver 1.0O 1993/02/28) - -static struct BurnRomInfo cupfinalRomDesc[] = { - { "d49-13.20", 0x020000, 0xccee5e73, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d49-14.19", 0x020000, 0x2323bf2e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d49-16.18", 0x020000, 0x8e73f739, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d49-20.17", 0x020000, 0x1e9c392c, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d49-01.12", 0x200000, 0x1dc89f1c, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d49-02.8", 0x200000, 0x1e4c374f, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d49-06.11", 0x100000, 0x71ef4ee1, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d49-07.7", 0x100000, 0xe5655b8f, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d49-03.4", 0x200000, 0xcf9a8727, TAITO_SPRITESA }, // 8 - { "d49-08.3", 0x100000, 0x7d3c6536, TAITO_SPRITESA }, // 9 - - { "d49-09.47", 0x080000, 0x257ede01, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d49-10.45", 0x080000, 0xf587b787, TAITO_CHARS_BYTESWAP }, // 11 - { "d49-11.43", 0x080000, 0x11318b26, TAITO_CHARS }, // 12 - - { "d49-17.32", 0x020000, 0xf2058eba, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d49-18.33", 0x020000, 0xa0fdd270, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d49-04.38", 0x200000, 0x44b365a9, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d49-05.41", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(cupfinal) -STD_ROM_FN(cupfinal) - -static INT32 cupfinalInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, SCFINALS, 1, 0x408100); -} - -struct BurnDriver BurnDrvCupfinal = { - "cupfinal", NULL, NULL, NULL, "1993", - "Taito Cup Finals (Ver 1.0O 1993/02/28)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, cupfinalRomInfo, cupfinalRomName, NULL, NULL, F3InputInfo, NULL, - cupfinalInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Hat Trick Hero '93 (Ver 1.0J 1993/02/28) - -static struct BurnRomInfo hthero93RomDesc[] = { - { "d49-13.20", 0x020000, 0xccee5e73, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d49-14.19", 0x020000, 0x2323bf2e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d49-16.18", 0x020000, 0x8e73f739, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d49-19.17", 0x020000, 0xf0925800, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d49-01.12", 0x200000, 0x1dc89f1c, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d49-02.8", 0x200000, 0x1e4c374f, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d49-06.11", 0x100000, 0x71ef4ee1, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d49-07.7", 0x100000, 0xe5655b8f, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d49-03.4", 0x200000, 0xcf9a8727, TAITO_SPRITESA }, // 8 - { "d49-08.3", 0x100000, 0x7d3c6536, TAITO_SPRITESA }, // 9 - - { "d49-09.47", 0x080000, 0x257ede01, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d49-10.45", 0x080000, 0xf587b787, TAITO_CHARS_BYTESWAP }, // 11 - { "d49-11.43", 0x080000, 0x11318b26, TAITO_CHARS }, // 12 - - { "d49-17.32", 0x020000, 0xf2058eba, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d49-18.33", 0x020000, 0xa0fdd270, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d49-04.38", 0x200000, 0x44b365a9, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d49-05.41", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(hthero93) -STD_ROM_FN(hthero93) - -struct BurnDriver BurnDrvHthero93 = { - "hthero93", "cupfinal", NULL, NULL, "1993", - "Hat Trick Hero '93 (Ver 1.0J 1993/02/28)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, hthero93RomInfo, hthero93RomName, NULL, NULL, F3InputInfo, NULL, - cupfinalInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Hat Trick Hero '93 (Ver 1.0A 1993/02/28) - -static struct BurnRomInfo hthero93uRomDesc[] = { - { "d49-13.24", 0x020000, 0xccee5e73, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d49-14.26", 0x020000, 0x2323bf2e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d49-16.37", 0x020000, 0x8e73f739, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d49-19.35", 0x020000, 0x699b09ba, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d49-01.12", 0x200000, 0x1dc89f1c, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d49-02.8", 0x200000, 0x1e4c374f, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d49-06.11", 0x100000, 0x71ef4ee1, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d49-07.7", 0x100000, 0xe5655b8f, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d49-03.4", 0x200000, 0xcf9a8727, TAITO_SPRITESA }, // 8 - { "d49-08.3", 0x100000, 0x7d3c6536, TAITO_SPRITESA }, // 9 - - { "d49-09.47", 0x080000, 0x257ede01, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d49-10.45", 0x080000, 0xf587b787, TAITO_CHARS_BYTESWAP }, // 11 - { "d49-11.43", 0x080000, 0x11318b26, TAITO_CHARS }, // 12 - - { "d49-17.32", 0x020000, 0xf2058eba, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d49-18.33", 0x020000, 0xa0fdd270, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d49-04.38", 0x200000, 0x44b365a9, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d49-05.41", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 16 - - { "D49-12.IC60.bin", 0x000104, 0xaa4cff37, 0 | BRF_OPT }, // 17 palsgame - { "D49-21.IC17.bin", 0x000104, 0x821775d4, 0 | BRF_OPT }, // 18 - - { "D29-11.IC15.bin", 0x000157, 0x5dd5c8f9, 0 | BRF_OPT }, // 19 palsbase - { "D29-12.IC12.bin", 0x000144, 0xc872f1fd, 0 | BRF_OPT }, // 20 - { "D29-13.IC14.bin", 0x000157, 0x74d61d36, 0 | BRF_OPT }, // 21 - { "D29-14.IC28.bin", 0x000157, 0x25d205d5, 0 | BRF_OPT }, // 22 - { "D29-15.IC29.bin", 0x000157, 0x692eb582, 0 | BRF_OPT }, // 23 - { "D29-16.IC7.bin", 0x000117, 0x11875f52, 0 | BRF_OPT }, // 24 - { "D29-17.IC16.bin", 0x000117, 0xa0f74b51, 0 | BRF_OPT }, // 25 -}; - -STD_ROM_PICK(hthero93u) -STD_ROM_FN(hthero93u) - -struct BurnDriver BurnDrvHthero93u = { - "hthero93u", "cupfinal", NULL, NULL, "1993", - "Hat Trick Hero '93 (Ver 1.0A 1993/02/28)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, hthero93uRomInfo, hthero93uRomName, NULL, NULL, F3InputInfo, NULL, - cupfinalInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Top Ranking Stars (Ver 2.1O 1993/05/21) (New Version) - -static struct BurnRomInfo trstarRomDesc[] = { - { "d53-15-1.24", 0x040000, 0x098bba94, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d53-16-1.26", 0x040000, 0x4fa8b15c, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d53-18-1.37", 0x040000, 0xaa71cfcc, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d53-20-1.35", 0x040000, 0x4de1e287, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d53-03.45", 0x200000, 0x91b66145, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d53-04.46", 0x200000, 0xac3a5e80, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d53-06.64", 0x100000, 0xf4bac410, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d53-07.65", 0x100000, 0x2f4773c3, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d53-05.47", 0x200000, 0xb9b68b15, TAITO_SPRITESA }, // 8 - { "d53-08.66", 0x100000, 0xad13a1ee, TAITO_SPRITESA }, // 9 - - { "d53-09.48", 0x100000, 0x690554d3, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d53-10.49", 0x100000, 0x0ec05dc5, TAITO_CHARS_BYTESWAP }, // 11 - { "d53-11.50", 0x100000, 0x39c0a546, TAITO_CHARS }, // 12 - - { "d53-13.10", 0x020000, 0x877f0361, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d53-14.23", 0x020000, 0xa8664867, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d53-01.2", 0x200000, 0x28fd2d9b, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d53-02.3", 0x200000, 0x8bd4367a, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(trstar) -STD_ROM_FN(trstar) - -static INT32 trstarInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, TRSTAR, 0, 0x41E000); -} - -struct BurnDriver BurnDrvTrstar = { - "trstar", NULL, NULL, NULL, "1993", - "Top Ranking Stars (Ver 2.1O 1993/05/21) (New Version)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, trstarRomInfo, trstarRomName, NULL, NULL, F3InputInfo, NULL, - trstarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Top Ranking Stars (Ver 2.1J 1993/05/21) (New Version) - -static struct BurnRomInfo trstarjRomDesc[] = { - { "d53-15-1.24", 0x040000, 0x098bba94, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d53-16-1.26", 0x040000, 0x4fa8b15c, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d53-18-1.37", 0x040000, 0xaa71cfcc, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d53-17-1.35", 0x040000, 0xa3ef83ab, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d53-03.45", 0x200000, 0x91b66145, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d53-04.46", 0x200000, 0xac3a5e80, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d53-06.64", 0x100000, 0xf4bac410, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d53-07.65", 0x100000, 0x2f4773c3, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d53-05.47", 0x200000, 0xb9b68b15, TAITO_SPRITESA }, // 8 - { "d53-08.66", 0x100000, 0xad13a1ee, TAITO_SPRITESA }, // 9 - - { "d53-09.48", 0x100000, 0x690554d3, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d53-10.49", 0x100000, 0x0ec05dc5, TAITO_CHARS_BYTESWAP }, // 11 - { "d53-11.50", 0x100000, 0x39c0a546, TAITO_CHARS }, // 12 - - { "d53-13.10", 0x020000, 0x877f0361, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d53-14.23", 0x020000, 0xa8664867, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d53-01.2", 0x200000, 0x28fd2d9b, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d53-02.3", 0x200000, 0x8bd4367a, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(trstarj) -STD_ROM_FN(trstarj) - -struct BurnDriver BurnDrvTrstarj = { - "trstarj", "trstar", NULL, NULL, "1993", - "Top Ranking Stars (Ver 2.1J 1993/05/21) (New Version)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, trstarjRomInfo, trstarjRomName, NULL, NULL, F3InputInfo, NULL, - trstarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Prime Time Fighter (Ver 2.1A 1993/05/21) (New Version) - -static struct BurnRomInfo prmtmfgtRomDesc[] = { - { "d53-15-1.24", 0x040000, 0x098bba94, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d53-16-1.26", 0x040000, 0x4fa8b15c, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d53-18-1.37", 0x040000, 0xaa71cfcc, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d53-19-1.35", 0x040000, 0x3ae6d211, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d53-03.45", 0x200000, 0x91b66145, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d53-04.46", 0x200000, 0xac3a5e80, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d53-06.64", 0x100000, 0xf4bac410, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d53-07.65", 0x100000, 0x2f4773c3, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d53-05.47", 0x200000, 0xb9b68b15, TAITO_SPRITESA }, // 8 - { "d53-08.66", 0x100000, 0xad13a1ee, TAITO_SPRITESA }, // 9 - - { "d53-09.48", 0x100000, 0x690554d3, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d53-10.49", 0x100000, 0x0ec05dc5, TAITO_CHARS_BYTESWAP }, // 11 - { "d53-11.50", 0x100000, 0x39c0a546, TAITO_CHARS }, // 12 - - { "d53-13.10", 0x020000, 0x877f0361, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d53-14.23", 0x020000, 0xa8664867, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d53-01.2", 0x200000, 0x28fd2d9b, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d53-02.3", 0x200000, 0x8bd4367a, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(prmtmfgt) -STD_ROM_FN(prmtmfgt) - -struct BurnDriver BurnDrvPrmtmfgt = { - "prmtmfgt", "trstar", NULL, NULL, "1993", - "Prime Time Fighter (Ver 2.1A 1993/05/21) (New Version)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, prmtmfgtRomInfo, prmtmfgtRomName, NULL, NULL, F3InputInfo, NULL, - trstarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Top Ranking Stars (Ver 2.1O 1993/05/21) (Old Version) - -static struct BurnRomInfo trstaroRomDesc[] = { - { "d53-15.24", 0x040000, 0xf24de51b, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d53-16.26", 0x040000, 0xffc84429, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d53-18.37", 0x040000, 0xea2d6e13, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d53-20.35", 0x040000, 0x77e1f267, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d53-03.45", 0x200000, 0x91b66145, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d53-04.46", 0x200000, 0xac3a5e80, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d53-06.64", 0x100000, 0xf4bac410, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d53-07.65", 0x100000, 0x2f4773c3, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d53-05.47", 0x200000, 0xb9b68b15, TAITO_SPRITESA }, // 8 - { "d53-08.66", 0x100000, 0xad13a1ee, TAITO_SPRITESA }, // 9 - - { "d53-09.48", 0x100000, 0x690554d3, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d53-10.49", 0x100000, 0x0ec05dc5, TAITO_CHARS_BYTESWAP }, // 11 - { "d53-11.50", 0x100000, 0x39c0a546, TAITO_CHARS }, // 12 - - { "d53-13.10", 0x020000, 0x877f0361, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d53-14.23", 0x020000, 0xa8664867, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d53-01.2", 0x200000, 0x28fd2d9b, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d53-02.3", 0x200000, 0x8bd4367a, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(trstaro) -STD_ROM_FN(trstaro) - -struct BurnDriver BurnDrvTrstaro = { - "trstaro", "trstar", NULL, NULL, "1993", - "Top Ranking Stars (Ver 2.1O 1993/05/21) (Old Version)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, trstaroRomInfo, trstaroRomName, NULL, NULL, F3InputInfo, NULL, - trstarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Top Ranking Stars (Ver 2.1J 1993/05/21) (Old Version) - -static struct BurnRomInfo trstarojRomDesc[] = { - { "d53-15.24", 0x040000, 0xf24de51b, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d53-16.26", 0x040000, 0xffc84429, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d53-18.37", 0x040000, 0xea2d6e13, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d53-17.35", 0x040000, 0x99ef934b, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d53-03.45", 0x200000, 0x91b66145, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d53-04.46", 0x200000, 0xac3a5e80, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d53-06.64", 0x100000, 0xf4bac410, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d53-07.65", 0x100000, 0x2f4773c3, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d53-05.47", 0x200000, 0xb9b68b15, TAITO_SPRITESA }, // 8 - { "d53-08.66", 0x100000, 0xad13a1ee, TAITO_SPRITESA }, // 9 - - { "d53-09.48", 0x100000, 0x690554d3, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d53-10.49", 0x100000, 0x0ec05dc5, TAITO_CHARS_BYTESWAP }, // 11 - { "d53-11.50", 0x100000, 0x39c0a546, TAITO_CHARS }, // 12 - - { "d53-13.10", 0x020000, 0x877f0361, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d53-14.23", 0x020000, 0xa8664867, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d53-01.2", 0x200000, 0x28fd2d9b, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d53-02.3", 0x200000, 0x8bd4367a, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(trstaroj) -STD_ROM_FN(trstaroj) - -struct BurnDriver BurnDrvTrstaroj = { - "trstaroj", "trstar", NULL, NULL, "1993", - "Top Ranking Stars (Ver 2.1J 1993/05/21) (Old Version)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, trstarojRomInfo, trstarojRomName, NULL, NULL, F3InputInfo, NULL, - trstarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Prime Time Fighter (Ver 2.1A 1993/05/21) (Old Version) - -static struct BurnRomInfo prmtmfgtoRomDesc[] = { - { "d53-15.24", 0x040000, 0xf24de51b, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d53-16.26", 0x040000, 0xffc84429, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d53-18.37", 0x040000, 0xea2d6e13, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d53-19.35", 0x040000, 0x00e6c2f1, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d53-03.45", 0x200000, 0x91b66145, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d53-04.46", 0x200000, 0xac3a5e80, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d53-06.64", 0x100000, 0xf4bac410, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d53-07.65", 0x100000, 0x2f4773c3, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d53-05.47", 0x200000, 0xb9b68b15, TAITO_SPRITESA }, // 8 - { "d53-08.66", 0x100000, 0xad13a1ee, TAITO_SPRITESA }, // 9 - - { "d53-09.48", 0x100000, 0x690554d3, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d53-10.49", 0x100000, 0x0ec05dc5, TAITO_CHARS_BYTESWAP }, // 11 - { "d53-11.50", 0x100000, 0x39c0a546, TAITO_CHARS }, // 12 - - { "d53-13.10", 0x020000, 0x877f0361, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d53-14.23", 0x020000, 0xa8664867, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d53-01.2", 0x200000, 0x28fd2d9b, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d53-02.3", 0x200000, 0x8bd4367a, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(prmtmfgto) -STD_ROM_FN(prmtmfgto) - -struct BurnDriver BurnDrvPrmtmfgto = { - "prmtmfgto", "trstar", NULL, NULL, "1993", - "Prime Time Fighter (Ver 2.1A 1993/05/21) (Old Version)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, prmtmfgtoRomInfo, prmtmfgtoRomName, NULL, NULL, F3InputInfo, NULL, - trstarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Gunlock (Ver 2.3O 1994/01/20) - -static struct BurnRomInfo gunlockRomDesc[] = { - { "d66-18.ic24", 0x040000, 0x8418513e, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d66-19.ic26", 0x040000, 0x95731473, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d66-21.ic37", 0x040000, 0xbd0d60f2, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d66-24.ic35", 0x040000, 0x97816378, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d66-03.ic45", 0x100000, 0xe7a4a491, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d66-04.ic46", 0x100000, 0xc1c7aaa7, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d66-05.ic47", 0x100000, 0xa3cefe04, TAITO_SPRITESA }, // 6 - - { "d66-06.ic48", 0x100000, 0xb3d8126d, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d66-07.ic49", 0x100000, 0xa6da9be7, TAITO_CHARS_BYTESWAP }, // 8 - { "d66-08.ic49", 0x100000, 0x9959f30b, TAITO_CHARS }, // 9 - - { "d66-23.ic10", 0x040000, 0x57fb7c49, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d66-22.ic23", 0x040000, 0x83dd7f9b, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d66-01.ic2", 0x200000, 0x58c92efa, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d66-02.ic3", 0x200000, 0xdcdafaab, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(gunlock) -STD_ROM_FN(gunlock) - -static INT32 gunlockInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, GUNLOCK, 2, 0x400004); // speed hack isn't great for this game -} - -struct BurnDriver BurnDrvGunlock = { - "gunlock", NULL, NULL, NULL, "1993", - "Gunlock (Ver 2.3O 1994/01/20)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, gunlockRomInfo, gunlockRomName, NULL, NULL, F3InputInfo, NULL, - gunlockInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 224, 320, 3, 4 -}; - - -// Ray Force (Ver 2.3A 1994/01/20) - -static struct BurnRomInfo rayforceRomDesc[] = { - { "d66-18.ic24", 0x040000, 0x8418513e, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d66-19.ic26", 0x040000, 0x95731473, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d66-21.ic37", 0x040000, 0xbd0d60f2, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d66-25.ic35", 0x040000, 0xe08653ee, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d66-03.ic45", 0x100000, 0xe7a4a491, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d66-04.ic46", 0x100000, 0xc1c7aaa7, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d66-05.ic47", 0x100000, 0xa3cefe04, TAITO_SPRITESA }, // 6 - - { "d66-06.ic48", 0x100000, 0xb3d8126d, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d66-07.ic49", 0x100000, 0xa6da9be7, TAITO_CHARS_BYTESWAP }, // 8 - { "d66-08.ic49", 0x100000, 0x9959f30b, TAITO_CHARS }, // 9 - - { "d66-23.ic10", 0x040000, 0x57fb7c49, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d66-22.ic23", 0x040000, 0x83dd7f9b, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d66-01.ic2", 0x200000, 0x58c92efa, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d66-02.ic3", 0x200000, 0xdcdafaab, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(rayforce) -STD_ROM_FN(rayforce) - -struct BurnDriver BurnDrvRayforce = { - "rayforce", "gunlock", NULL, NULL, "1993", - "Ray Force (Ver 2.3A 1994/01/20)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, rayforceRomInfo, rayforceRomName, NULL, NULL, F3InputInfo, NULL, - gunlockInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 224, 320, 3, 4 -}; - - -// Ray Force (Ver 2.3J 1994/01/20) - -static struct BurnRomInfo rayforcejRomDesc[] = { - { "d66-18.ic24", 0x040000, 0x8418513e, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d66-19.ic26", 0x040000, 0x95731473, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d66-21.ic37", 0x040000, 0xbd0d60f2, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d66-20.ic35", 0x040000, 0x798f0254, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d66-03.ic45", 0x100000, 0xe7a4a491, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d66-04.ic46", 0x100000, 0xc1c7aaa7, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d66-05.ic47", 0x100000, 0xa3cefe04, TAITO_SPRITESA }, // 6 - - { "d66-06.ic48", 0x100000, 0xb3d8126d, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d66-07.ic49", 0x100000, 0xa6da9be7, TAITO_CHARS_BYTESWAP }, // 8 - { "d66-08.ic49", 0x100000, 0x9959f30b, TAITO_CHARS }, // 9 - - { "d66-23.ic10", 0x040000, 0x57fb7c49, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d66-22.ic23", 0x040000, 0x83dd7f9b, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d66-01.ic2", 0x200000, 0x58c92efa, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d66-02.ic3", 0x200000, 0xdcdafaab, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(rayforcej) -STD_ROM_FN(rayforcej) - -struct BurnDriver BurnDrvRayforcej = { - "rayforcej", "gunlock", NULL, NULL, "1993", - "Ray Force (Ver 2.3J 1994/01/20)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, rayforcejRomInfo, rayforcejRomName, NULL, NULL, F3InputInfo, NULL, - gunlockInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 224, 320, 3, 4 -}; - - -// Super Cup Finals (Ver 2.2O 1994/01/13) - -static struct BurnRomInfo scfinalsRomDesc[] = { - { "d68-09.ic40", 0x040000, 0x28193b3f, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d68-10.ic38", 0x040000, 0x67481bad, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d68-11.ic36", 0x040000, 0xd456c124, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d68-12.ic34", 0x040000, 0xdec41397, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d49-01.12", 0x200000, 0x1dc89f1c, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d49-02.8", 0x200000, 0x1e4c374f, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d49-06.11", 0x100000, 0x71ef4ee1, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d49-07.7", 0x100000, 0xe5655b8f, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d49-03.4", 0x200000, 0xcf9a8727, TAITO_SPRITESA }, // 8 - { "d49-08.3", 0x100000, 0x7d3c6536, TAITO_SPRITESA }, // 9 - - { "d49-09.47", 0x080000, 0x257ede01, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d49-10.45", 0x080000, 0xf587b787, TAITO_CHARS_BYTESWAP }, // 11 - { "d49-11.43", 0x080000, 0x11318b26, TAITO_CHARS }, // 12 - - { "d49-17.ic5", 0x020000, 0xf2058eba, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d49-18.ic6", 0x020000, 0xa0fdd270, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d49-04.38", 0x200000, 0x44b365a9, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d49-05.41", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 16 - - { "scfinals.nv", 0x000080, 0xf25945fc, TAITO_DEFAULT_EEPROM }, // 17 eeprom - -}; - -STD_ROM_PICK(scfinals) -STD_ROM_FN(scfinals) - -static INT32 scfinalsCallback() -{ - UINT32 *ROM = (UINT32 *)Taito68KRom1; - - ROM[0x5af0/4] = 0x4e754e71; - ROM[0xdd0/4] = 0x4e714e75; - - supercupkludge = 1; - - return 0; -} - -static INT32 scfinalsInit() -{ - return DrvInit(scfinalsCallback, f3_24bit_palette_update, 0, SCFINALS, 1, 0x408100); -} - -struct BurnDriver BurnDrvScfinals = { - "scfinals", NULL, NULL, NULL, "1993", - "Super Cup Finals (Ver 2.2O 1994/01/13)\0", "Use service coin! (game has issues)", "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, scfinalsRomInfo, scfinalsRomName, NULL, NULL, F3InputInfo, NULL, - scfinalsInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Super Cup Finals (Ver 2.1O 1993/11/19) - -static struct BurnRomInfo scfinalsoRomDesc[] = { - { "d68-01.20", 0x040000, 0xcb951856, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d68-02.19", 0x040000, 0x4f94413a, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d68-04.18", 0x040000, 0x4a4e4972, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d68-03.17", 0x040000, 0xa40be699, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d49-01.12", 0x200000, 0x1dc89f1c, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d49-02.8", 0x200000, 0x1e4c374f, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d49-06.11", 0x100000, 0x71ef4ee1, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d49-07.7", 0x100000, 0xe5655b8f, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d49-03.4", 0x200000, 0xcf9a8727, TAITO_SPRITESA }, // 8 - { "d49-08.3", 0x100000, 0x7d3c6536, TAITO_SPRITESA }, // 9 - - { "d49-09.47", 0x080000, 0x257ede01, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d49-10.45", 0x080000, 0xf587b787, TAITO_CHARS_BYTESWAP }, // 11 - { "d49-11.43", 0x080000, 0x11318b26, TAITO_CHARS }, // 12 - - { "d49-17.32", 0x020000, 0xf2058eba, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d49-18.33", 0x020000, 0xa0fdd270, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d49-04.38", 0x200000, 0x44b365a9, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d49-05.41", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 16 - - { "scfinalso.nv", 0x000080, 0x1319752e, TAITO_DEFAULT_EEPROM }, // 17 eeprom -}; - -STD_ROM_PICK(scfinalso) -STD_ROM_FN(scfinalso) - -struct BurnDriver BurnDrvScfinalso = { - "scfinalso", "scfinals", NULL, NULL, "1993", - "Super Cup Finals (Ver 2.1O 1993/11/19)\0", "Use service coin! (game has issues)", "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, scfinalsoRomInfo, scfinalsoRomName, NULL, NULL, F3InputInfo, NULL, - scfinalsInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Light Bringer (Ver 2.2O 1994/04/08) - -static struct BurnRomInfo lightbrRomDesc[] = { - { "d69-25.ic40", 0x080000, 0x27f1b8be, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d69-26.ic38", 0x080000, 0x2ff7dba6, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d69-28.ic36", 0x080000, 0xa5546162, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d69-27.ic34", 0x080000, 0xe232a949, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d69-06.bin", 0x200000, 0xcb4aac81, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d69-07.bin", 0x200000, 0xb749f984, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d69-09.bin", 0x100000, 0xa96c19b8, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d69-10.bin", 0x100000, 0x36aa80c6, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d69-08.bin", 0x200000, 0x5b68d7d8, TAITO_SPRITESA }, // 8 - { "d69-11.bin", 0x100000, 0xc11adf92, TAITO_SPRITESA }, // 9 - - { "d69-03.bin", 0x200000, 0x6999c86f, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d69-04.bin", 0x200000, 0xcc91dcb7, TAITO_CHARS_BYTESWAP }, // 11 - { "d69-05.bin", 0x200000, 0xf9f5433c, TAITO_CHARS }, // 12 - - { "d69-18.bin", 0x020000, 0x04600d7b, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d69-19.bin", 0x020000, 0x1484e853, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d69-01.bin", 0x200000, 0x9ac93ac2, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d69-02.bin", 0x200000, 0xdce28dd7, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(lightbr) -STD_ROM_FN(lightbr) - -static INT32 lightbrInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, LIGHTBR, 2, 0x400118); -} - -struct BurnDriver BurnDrvLightbr = { - "lightbr", NULL, NULL, NULL, "1993", - "Light Bringer (Ver 2.2O 1994/04/08)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, lightbrRomInfo, lightbrRomName, NULL, NULL, F3InputInfo, NULL, - lightbrInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Dungeon Magic (Ver 2.1O 1994/02/18) - -static struct BurnRomInfo dungeonmRomDesc[] = { - { "d69-20.bin", 0x080000, 0x33650fe4, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d69-13.bin", 0x080000, 0xdec2ec17, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d69-15.bin", 0x080000, 0x323e1955, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d69-22.bin", 0x080000, 0xf99e175d, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d69-06.bin", 0x200000, 0xcb4aac81, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d69-07.bin", 0x200000, 0xb749f984, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d69-09.bin", 0x100000, 0xa96c19b8, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d69-10.bin", 0x100000, 0x36aa80c6, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d69-08.bin", 0x200000, 0x5b68d7d8, TAITO_SPRITESA }, // 8 - { "d69-11.bin", 0x100000, 0xc11adf92, TAITO_SPRITESA }, // 9 - - { "d69-03.bin", 0x200000, 0x6999c86f, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d69-04.bin", 0x200000, 0xcc91dcb7, TAITO_CHARS_BYTESWAP }, // 11 - { "d69-05.bin", 0x200000, 0xf9f5433c, TAITO_CHARS }, // 12 - - { "d69-18.bin", 0x020000, 0x04600d7b, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d69-19.bin", 0x020000, 0x1484e853, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d69-01.bin", 0x200000, 0x9ac93ac2, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d69-02.bin", 0x200000, 0xdce28dd7, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(dungeonm) -STD_ROM_FN(dungeonm) - -struct BurnDriver BurnDrvDungeonm = { - "dungeonm", "lightbr", NULL, NULL, "1993", - "Dungeon Magic (Ver 2.1O 1994/02/18)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, dungeonmRomInfo, dungeonmRomName, NULL, NULL, F3InputInfo, NULL, - lightbrInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Dungeon Magic (Ver 2.1A 1994/02/18) - -static struct BurnRomInfo dungeonmuRomDesc[] = { - { "d69-20.bin", 0x080000, 0x33650fe4, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d69-13.bin", 0x080000, 0xdec2ec17, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d69-15.bin", 0x080000, 0x323e1955, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d69-21.bin", 0x080000, 0xc9d4e051, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d69-06.bin", 0x200000, 0xcb4aac81, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d69-07.bin", 0x200000, 0xb749f984, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d69-09.bin", 0x100000, 0xa96c19b8, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d69-10.bin", 0x100000, 0x36aa80c6, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d69-08.bin", 0x200000, 0x5b68d7d8, TAITO_SPRITESA }, // 8 - { "d69-11.bin", 0x100000, 0xc11adf92, TAITO_SPRITESA }, // 9 - - { "d69-03.bin", 0x200000, 0x6999c86f, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d69-04.bin", 0x200000, 0xcc91dcb7, TAITO_CHARS_BYTESWAP }, // 11 - { "d69-05.bin", 0x200000, 0xf9f5433c, TAITO_CHARS }, // 12 - - { "d69-18.bin", 0x020000, 0x04600d7b, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d69-19.bin", 0x020000, 0x1484e853, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d69-01.bin", 0x200000, 0x9ac93ac2, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d69-02.bin", 0x200000, 0xdce28dd7, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(dungeonmu) -STD_ROM_FN(dungeonmu) - -struct BurnDriver BurnDrvDungeonmu = { - "dungeonmu", "lightbr", NULL, NULL, "1993", - "Dungeon Magic (Ver 2.1A 1994/02/18)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, dungeonmuRomInfo, dungeonmuRomName, NULL, NULL, F3InputInfo, NULL, - lightbrInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Light Bringer (Ver 2.1J 1994/02/18) - -static struct BurnRomInfo lightbrjRomDesc[] = { - { "d69-20.bin", 0x080000, 0x33650fe4, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d69-13.bin", 0x080000, 0xdec2ec17, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d69-15.bin", 0x080000, 0x323e1955, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d69-14.bin", 0x080000, 0x990bf945, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d69-06.bin", 0x200000, 0xcb4aac81, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d69-07.bin", 0x200000, 0xb749f984, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d69-09.bin", 0x100000, 0xa96c19b8, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d69-10.bin", 0x100000, 0x36aa80c6, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d69-08.bin", 0x200000, 0x5b68d7d8, TAITO_SPRITESA }, // 8 - { "d69-11.bin", 0x100000, 0xc11adf92, TAITO_SPRITESA }, // 9 - - { "d69-03.bin", 0x200000, 0x6999c86f, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d69-04.bin", 0x200000, 0xcc91dcb7, TAITO_CHARS_BYTESWAP }, // 11 - { "d69-05.bin", 0x200000, 0xf9f5433c, TAITO_CHARS }, // 12 - - { "d69-18.bin", 0x020000, 0x04600d7b, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d69-19.bin", 0x020000, 0x1484e853, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d69-01.bin", 0x200000, 0x9ac93ac2, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d69-02.bin", 0x200000, 0xdce28dd7, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(lightbrj) -STD_ROM_FN(lightbrj) - -struct BurnDriver BurnDrvLightbrj = { - "lightbrj", "lightbr", NULL, NULL, "1993", - "Light Bringer (Ver 2.1J 1994/02/18)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, lightbrjRomInfo, lightbrjRomName, NULL, NULL, F3InputInfo, NULL, - lightbrInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// International Cup '94 (Ver 2.2O 1994/05/26) - -static struct BurnRomInfo intcup94RomDesc[] = { - { "d78-07.20", 0x020000, 0x8525d990, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d78-06.19", 0x020000, 0x42db1d41, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d78-05.18", 0x020000, 0x5f7fbbbc, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d78-11.17", 0x020000, 0xbb9d2987, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d49-01.12", 0x200000, 0x1dc89f1c, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d49-02.8", 0x200000, 0x1e4c374f, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d49-06.11", 0x100000, 0x71ef4ee1, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d49-07.7", 0x100000, 0xe5655b8f, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d49-03.4", 0x200000, 0xcf9a8727, TAITO_SPRITESA }, // 8 - { "d49-08.3", 0x100000, 0x7d3c6536, TAITO_SPRITESA }, // 9 - - { "d78-01.47", 0x080000, 0x543f8967, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d78-02.45", 0x080000, 0xe8289394, TAITO_CHARS_BYTESWAP }, // 11 - { "d78-03.43", 0x080000, 0xa8bc36e5, TAITO_CHARS }, // 12 - - { "d78-08.32", 0x020000, 0xa629d07c, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d78-09.33", 0x020000, 0x1f0efe01, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d49-04.38", 0x200000, 0x44b365a9, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d49-05.41", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(intcup94) -STD_ROM_FN(intcup94) - -struct BurnDriver BurnDrvIntcup94 = { - "intcup94", NULL, NULL, NULL, "1994", - "International Cup '94 (Ver 2.2O 1994/05/26)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, intcup94RomInfo, intcup94RomName, NULL, NULL, F3InputInfo, NULL, - cupfinalInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Hat Trick Hero '94 (Ver 2.2A 1994/05/26) - -static struct BurnRomInfo hthero94RomDesc[] = { - { "d78-07.20", 0x020000, 0x8525d990, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d78-06.19", 0x020000, 0x42db1d41, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d78-05.18", 0x020000, 0x5f7fbbbc, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d78-10.17", 0x020000, 0xcc9a1911, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d49-01.12", 0x200000, 0x1dc89f1c, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d49-02.8", 0x200000, 0x1e4c374f, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d49-06.11", 0x100000, 0x71ef4ee1, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d49-07.7", 0x100000, 0xe5655b8f, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d49-03.4", 0x200000, 0xcf9a8727, TAITO_SPRITESA }, // 8 - { "d49-08.3", 0x100000, 0x7d3c6536, TAITO_SPRITESA }, // 9 - - { "d78-01.47", 0x080000, 0x543f8967, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "d78-02.45", 0x080000, 0xe8289394, TAITO_CHARS_BYTESWAP }, // 11 - { "d78-03.43", 0x080000, 0xa8bc36e5, TAITO_CHARS }, // 12 - - { "d78-08.32", 0x020000, 0xa629d07c, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "d78-09.33", 0x020000, 0x1f0efe01, TAITO_68KROM2_BYTESWAP }, // 14 - - { "d49-04.38", 0x200000, 0x44b365a9, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "d49-05.41", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 16 -}; - -STD_ROM_PICK(hthero94) -STD_ROM_FN(hthero94) - -struct BurnDriver BurnDrvHthero94 = { - "hthero94", "intcup94", NULL, NULL, "1994", - "Hat Trick Hero '94 (Ver 2.2A 1994/05/26)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, hthero94RomInfo, hthero94RomName, NULL, NULL, F3InputInfo, NULL, - cupfinalInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Recalhorn (Ver 1.42J 1994/5/11) (Prototype) - -static struct BurnRomInfo recalhRomDesc[] = { - { "rh_mpr3.bin", 0x080000, 0x65202dd4, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "rh_mpr2.bin", 0x080000, 0x3eda66db, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "rh_mpr1.bin", 0x080000, 0x536e74ca, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "rh_mpr0.bin", 0x080000, 0x38025817, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "rh_objl.bin", 0x100000, 0xc1772b55, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "rh_objm.bin", 0x100000, 0xef87c0fd, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "rh_scrl.bin", 0x100000, 0x1e3f6b79, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "rh_scrm.bin", 0x100000, 0x37200968, TAITO_CHARS_BYTESWAP }, // 7 - - { "rh_spr1.bin", 0x020000, 0x504cbc1d, TAITO_68KROM2_BYTESWAP }, // 8 68k Code - { "rh_spr0.bin", 0x020000, 0x78fba467, TAITO_68KROM2_BYTESWAP }, // 9 - - { "rh_snd0.bin", 0x200000, 0x386f5e1b, TAITO_ES5505_BYTESWAP }, // 10 Ensoniq Samples - { "rh_snd1.bin", 0x100000, 0xed894fe1, TAITO_ES5505_BYTESWAP }, // 11 -}; - -STD_ROM_PICK(recalh) -STD_ROM_FN(recalh) - -static INT32 recalhInit() -{ - return DrvInit(NULL, f3_21bit_typeB_palette_update, 1, RECALH, 1, 0); -} - -struct BurnDriver BurnDrvRecalh = { - "recalh", NULL, NULL, NULL, "1994", - "Recalhorn (Ver 1.42J 1994/5/11) (Prototype)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_PROTOTYPE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, recalhRomInfo, recalhRomName, NULL, NULL, F3InputInfo, NULL, - recalhInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Kaiser Knuckle (Ver 2.1O 1994/07/29) - -static struct BurnRomInfo kaiserknRomDesc[] = { - { "d84-25.20", 0x080000, 0x2840893f, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d84-24.19", 0x080000, 0xbf20c755, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d84-23.18", 0x080000, 0x39f12a9b, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d84-29.17", 0x080000, 0x9821f17a, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d84-03.rom", 0x200000, 0xd786f552, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d84-04.rom", 0x200000, 0xd1f32b5d, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d84-06.rom", 0x200000, 0xfa924dab, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d84-07.rom", 0x200000, 0x54517a6b, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d84-09.rom", 0x200000, 0xfaa78d98, TAITO_SPRITESA_BYTESWAP }, // 8 - { "d84-10.rom", 0x200000, 0xb84b7320, TAITO_SPRITESA_BYTESWAP }, // 9 - { "d84-19.rom", 0x080000, 0x6ddf77e5, TAITO_SPRITESA_BYTESWAP }, // 10 - { "d84-20.rom", 0x080000, 0xf85041e5, TAITO_SPRITESA_BYTESWAP }, // 11 - { "d84-05.rom", 0x200000, 0x31a3c75d, TAITO_SPRITESA }, // 12 - { "d84-08.rom", 0x200000, 0x07347bf1, TAITO_SPRITESA }, // 13 - { "d84-11.rom", 0x200000, 0xa062c1d4, TAITO_SPRITESA }, // 14 - { "d84-21.rom", 0x080000, 0x89f68b66, TAITO_SPRITESA }, // 15 - - { "d84-12.rom", 0x200000, 0x66a7a9aa, TAITO_CHARS_BYTESWAP }, // 16 Layer Tiles - { "d84-13.rom", 0x200000, 0xae125516, TAITO_CHARS_BYTESWAP }, // 17 - { "d84-16.rom", 0x100000, 0xbcff9b2d, TAITO_CHARS_BYTESWAP }, // 18 - { "d84-17.rom", 0x100000, 0x0be37cc3, TAITO_CHARS_BYTESWAP }, // 19 - { "d84-14.rom", 0x200000, 0x2b2e693e, TAITO_CHARS }, // 20 - { "d84-18.rom", 0x100000, 0xe812bcc5, TAITO_CHARS }, // 21 - - { "d84-26.32", 0x040000, 0x4f5b8563, TAITO_68KROM2_BYTESWAP }, // 22 68k Code - { "d84-27.33", 0x040000, 0xfb0cb1ba, TAITO_68KROM2_BYTESWAP }, // 23 - - { "d84-01.rom", 0x200000, 0x9ad22149, TAITO_ES5505_BYTESWAP }, // 24 Ensoniq Samples - { "d84-02.rom", 0x200000, 0x9e1827e4, TAITO_ES5505_BYTESWAP }, // 25 - { "d84-15.rom", 0x100000, 0x31ceb152, TAITO_ES5505_BYTESWAP }, // 26 -}; - -STD_ROM_PICK(kaiserkn) -STD_ROM_FN(kaiserkn) - -static INT32 kaiserknInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, KAISERKN, 2, 0x408100); -} - -struct BurnDriver BurnDrvKaiserkn = { - "kaiserkn", NULL, NULL, NULL, "1994", - "Kaiser Knuckle (Ver 2.1O 1994/07/29)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, kaiserknRomInfo, kaiserknRomName, NULL, NULL, KnInputInfo, NULL, - kaiserknInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Kaiser Knuckle (Ver 2.1J 1994/07/29) - -static struct BurnRomInfo kaiserknjRomDesc[] = { - { "d84-25.20", 0x080000, 0x2840893f, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d84-24.19", 0x080000, 0xbf20c755, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d84-23.18", 0x080000, 0x39f12a9b, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d84-22.17", 0x080000, 0x762f9056, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d84-03.rom", 0x200000, 0xd786f552, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d84-04.rom", 0x200000, 0xd1f32b5d, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d84-06.rom", 0x200000, 0xfa924dab, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d84-07.rom", 0x200000, 0x54517a6b, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d84-09.rom", 0x200000, 0xfaa78d98, TAITO_SPRITESA_BYTESWAP }, // 8 - { "d84-10.rom", 0x200000, 0xb84b7320, TAITO_SPRITESA_BYTESWAP }, // 9 - { "d84-19.rom", 0x080000, 0x6ddf77e5, TAITO_SPRITESA_BYTESWAP }, // 10 - { "d84-20.rom", 0x080000, 0xf85041e5, TAITO_SPRITESA_BYTESWAP }, // 11 - { "d84-05.rom", 0x200000, 0x31a3c75d, TAITO_SPRITESA }, // 12 - { "d84-08.rom", 0x200000, 0x07347bf1, TAITO_SPRITESA }, // 13 - { "d84-11.rom", 0x200000, 0xa062c1d4, TAITO_SPRITESA }, // 14 - { "d84-21.rom", 0x080000, 0x89f68b66, TAITO_SPRITESA }, // 15 - - { "d84-12.rom", 0x200000, 0x66a7a9aa, TAITO_CHARS_BYTESWAP }, // 16 Layer Tiles - { "d84-13.rom", 0x200000, 0xae125516, TAITO_CHARS_BYTESWAP }, // 17 - { "d84-16.rom", 0x100000, 0xbcff9b2d, TAITO_CHARS_BYTESWAP }, // 18 - { "d84-17.rom", 0x100000, 0x0be37cc3, TAITO_CHARS_BYTESWAP }, // 19 - { "d84-14.rom", 0x200000, 0x2b2e693e, TAITO_CHARS }, // 20 - { "d84-18.rom", 0x100000, 0xe812bcc5, TAITO_CHARS }, // 21 - - { "d84-26.32", 0x040000, 0x4f5b8563, TAITO_68KROM2_BYTESWAP }, // 22 68k Code - { "d84-27.33", 0x040000, 0xfb0cb1ba, TAITO_68KROM2_BYTESWAP }, // 23 - - { "d84-01.rom", 0x200000, 0x9ad22149, TAITO_ES5505_BYTESWAP }, // 24 Ensoniq Samples - { "d84-02.rom", 0x200000, 0x9e1827e4, TAITO_ES5505_BYTESWAP }, // 25 - { "d84-15.rom", 0x100000, 0x31ceb152, TAITO_ES5505_BYTESWAP }, // 26 -}; - -STD_ROM_PICK(kaiserknj) -STD_ROM_FN(kaiserknj) - -struct BurnDriver BurnDrvKaiserknj = { - "kaiserknj", "kaiserkn", NULL, NULL, "1994", - "Kaiser Knuckle (Ver 2.1J 1994/07/29)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, kaiserknjRomInfo, kaiserknjRomName, NULL, NULL, KnInputInfo, NULL, - kaiserknInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Global Champion (Ver 2.1A 1994/07/29) - -static struct BurnRomInfo gblchmpRomDesc[] = { - { "d84-25.20", 0x080000, 0x2840893f, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d84-24.19", 0x080000, 0xbf20c755, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d84-23.18", 0x080000, 0x39f12a9b, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d84-28.17", 0x080000, 0xef26c1ec, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d84-03.rom", 0x200000, 0xd786f552, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d84-04.rom", 0x200000, 0xd1f32b5d, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d84-06.rom", 0x200000, 0xfa924dab, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d84-07.rom", 0x200000, 0x54517a6b, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d84-09.rom", 0x200000, 0xfaa78d98, TAITO_SPRITESA_BYTESWAP }, // 8 - { "d84-10.rom", 0x200000, 0xb84b7320, TAITO_SPRITESA_BYTESWAP }, // 9 - { "d84-19.rom", 0x080000, 0x6ddf77e5, TAITO_SPRITESA_BYTESWAP }, // 10 - { "d84-20.rom", 0x080000, 0xf85041e5, TAITO_SPRITESA_BYTESWAP }, // 11 - { "d84-05.rom", 0x200000, 0x31a3c75d, TAITO_SPRITESA }, // 12 - { "d84-08.rom", 0x200000, 0x07347bf1, TAITO_SPRITESA }, // 13 - { "d84-11.rom", 0x200000, 0xa062c1d4, TAITO_SPRITESA }, // 14 - { "d84-21.rom", 0x080000, 0x89f68b66, TAITO_SPRITESA }, // 15 - - { "d84-12.rom", 0x200000, 0x66a7a9aa, TAITO_CHARS_BYTESWAP }, // 16 Layer Tiles - { "d84-13.rom", 0x200000, 0xae125516, TAITO_CHARS_BYTESWAP }, // 17 - { "d84-16.rom", 0x100000, 0xbcff9b2d, TAITO_CHARS_BYTESWAP }, // 18 - { "d84-17.rom", 0x100000, 0x0be37cc3, TAITO_CHARS_BYTESWAP }, // 19 - { "d84-14.rom", 0x200000, 0x2b2e693e, TAITO_CHARS }, // 20 - { "d84-18.rom", 0x100000, 0xe812bcc5, TAITO_CHARS }, // 21 - - { "d84-26.32", 0x040000, 0x4f5b8563, TAITO_68KROM2_BYTESWAP }, // 22 68k Code - { "d84-27.33", 0x040000, 0xfb0cb1ba, TAITO_68KROM2_BYTESWAP }, // 23 - - { "d84-01.rom", 0x200000, 0x9ad22149, TAITO_ES5505_BYTESWAP }, // 24 Ensoniq Samples - { "d84-02.rom", 0x200000, 0x9e1827e4, TAITO_ES5505_BYTESWAP }, // 25 - { "d84-15.rom", 0x100000, 0x31ceb152, TAITO_ES5505_BYTESWAP }, // 26 -}; - -STD_ROM_PICK(gblchmp) -STD_ROM_FN(gblchmp) - -struct BurnDriver BurnDrvGblchmp = { - "gblchmp", "kaiserkn", NULL, NULL, "1994", - "Global Champion (Ver 2.1A 1994/07/29)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, gblchmpRomInfo, gblchmpRomName, NULL, NULL, KnInputInfo, NULL, - kaiserknInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Dan-Ku-Ga (Ver 0.0J 1994/12/13) (Prototype) - -static struct BurnRomInfo dankugaRomDesc[] = { - { "dkg_mpr3.20", 0x080000, 0xee1531ca, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "dkg_mpr2.19", 0x080000, 0x18a4748b, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "dkg_mpr1.18", 0x080000, 0x97566f69, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "dkg_mpr0.17", 0x080000, 0xad6ada07, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d84-03.rom", 0x200000, 0xd786f552, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d84-04.rom", 0x200000, 0xd1f32b5d, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d84-06.rom", 0x200000, 0xfa924dab, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d84-07.rom", 0x200000, 0x54517a6b, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d84-09.rom", 0x200000, 0xfaa78d98, TAITO_SPRITESA_BYTESWAP }, // 8 - { "d84-10.rom", 0x200000, 0xb84b7320, TAITO_SPRITESA_BYTESWAP }, // 9 - { "d84-19.rom", 0x080000, 0x6ddf77e5, TAITO_SPRITESA_BYTESWAP }, // 10 - { "d84-20.rom", 0x080000, 0xf85041e5, TAITO_SPRITESA_BYTESWAP }, // 11 - { "d84-05.rom", 0x200000, 0x31a3c75d, TAITO_SPRITESA }, // 12 - { "d84-08.rom", 0x200000, 0x07347bf1, TAITO_SPRITESA }, // 13 - { "d84-11.rom", 0x200000, 0xa062c1d4, TAITO_SPRITESA }, // 14 - { "d84-21.rom", 0x080000, 0x89f68b66, TAITO_SPRITESA }, // 15 - - { "d84-12.rom", 0x200000, 0x66a7a9aa, TAITO_CHARS_BYTESWAP }, // 16 Layer Tiles - { "d84-13.rom", 0x200000, 0xae125516, TAITO_CHARS_BYTESWAP }, // 17 - { "d84-16.rom", 0x100000, 0xbcff9b2d, TAITO_CHARS_BYTESWAP }, // 18 - { "d84-17.rom", 0x100000, 0x0be37cc3, TAITO_CHARS_BYTESWAP }, // 19 - { "d84-14.rom", 0x200000, 0x2b2e693e, TAITO_CHARS }, // 20 - { "d84-18.rom", 0x100000, 0xe812bcc5, TAITO_CHARS }, // 21 - - { "d84-26.32", 0x040000, 0x4f5b8563, TAITO_68KROM2_BYTESWAP }, // 22 68k Code - { "d84-27.33", 0x040000, 0xfb0cb1ba, TAITO_68KROM2_BYTESWAP }, // 23 - - { "d84-01.rom", 0x200000, 0x9ad22149, TAITO_ES5505_BYTESWAP }, // 24 Ensoniq Samples - { "d84-02.rom", 0x200000, 0x9e1827e4, TAITO_ES5505_BYTESWAP }, // 25 - { "d84-15.rom", 0x100000, 0x31ceb152, TAITO_ES5505_BYTESWAP }, // 26 -}; - -STD_ROM_PICK(dankuga) -STD_ROM_FN(dankuga) - -struct BurnDriver BurnDrvDankuga = { - "dankuga", NULL, NULL, NULL, "1994", - "Dan-Ku-Ga (Ver 0.0J 1994/12/13) (Prototype)\0", "Missing graphics are normal in this prototype", "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_PROTOTYPE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, dankugaRomInfo, dankugaRomName, NULL, NULL, KnInputInfo, NULL, - kaiserknInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Darius Gaiden - Silver Hawk (Ver 2.5O 1994/09/19) - -static struct BurnRomInfo dariusgRomDesc[] = { - { "d87-12.bin", 0x080000, 0xde78f328, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d87-11.bin", 0x080000, 0xf7bed18e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d87-10.bin", 0x080000, 0x4149f66f, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d87-16.bin", 0x080000, 0x8f7e5901, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d87-03.bin", 0x200000, 0x4be1666e, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d87-04.bin", 0x200000, 0x2616002c, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d87-05.bin", 0x200000, 0x4e5891a9, TAITO_SPRITESA }, // 6 - - { "d87-06.bin", 0x200000, 0x3b97a07c, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d87-17.bin", 0x200000, 0xe601d63e, TAITO_CHARS_BYTESWAP }, // 8 - { "d87-08.bin", 0x200000, 0x76d23602, TAITO_CHARS }, // 9 - - { "d87-13.bin", 0x040000, 0x15b1fff4, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d87-14.bin", 0x040000, 0xeecda29a, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d87-01.bin", 0x200000, 0x3848a110, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d87-02.bin", 0x200000, 0x9250abae, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(dariusg) -STD_ROM_FN(dariusg) - -static INT32 dariusgInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, DARIUSG, 1, 0x406baa); -} - -struct BurnDriver BurnDrvDariusg = { - "dariusg", NULL, NULL, NULL, "1994", - "Darius Gaiden - Silver Hawk (Ver 2.5O 1994/09/19)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, dariusgRomInfo, dariusgRomName, NULL, NULL, F3InputInfo, NULL, - dariusgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Darius Gaiden - Silver Hawk (Ver 2.5J 1994/09/19) - -static struct BurnRomInfo dariusgjRomDesc[] = { - { "d87-12.bin", 0x080000, 0xde78f328, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d87-11.bin", 0x080000, 0xf7bed18e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d87-10.bin", 0x080000, 0x4149f66f, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d87-09.bin", 0x080000, 0x6170382d, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d87-03.bin", 0x200000, 0x4be1666e, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d87-04.bin", 0x200000, 0x2616002c, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d87-05.bin", 0x200000, 0x4e5891a9, TAITO_SPRITESA }, // 6 - - { "d87-06.bin", 0x200000, 0x3b97a07c, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d87-17.bin", 0x200000, 0xe601d63e, TAITO_CHARS_BYTESWAP }, // 8 - { "d87-08.bin", 0x200000, 0x76d23602, TAITO_CHARS }, // 9 - - { "d87-13.bin", 0x040000, 0x15b1fff4, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d87-14.bin", 0x040000, 0xeecda29a, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d87-01.bin", 0x200000, 0x3848a110, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d87-02.bin", 0x200000, 0x9250abae, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(dariusgj) -STD_ROM_FN(dariusgj) - -struct BurnDriver BurnDrvDariusgj = { - "dariusgj", "dariusg", NULL, NULL, "1994", - "Darius Gaiden - Silver Hawk (Ver 2.5J 1994/09/19)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, dariusgjRomInfo, dariusgjRomName, NULL, NULL, F3InputInfo, NULL, - dariusgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Darius Gaiden - Silver Hawk (Ver 2.5A 1994/09/19) - -static struct BurnRomInfo dariusguRomDesc[] = { - { "d87-12.bin", 0x080000, 0xde78f328, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d87-11.bin", 0x080000, 0xf7bed18e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d87-10.bin", 0x080000, 0x4149f66f, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d87-15.bin", 0x080000, 0xf8796997, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d87-03.bin", 0x200000, 0x4be1666e, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d87-04.bin", 0x200000, 0x2616002c, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d87-05.bin", 0x200000, 0x4e5891a9, TAITO_SPRITESA }, // 6 - - { "d87-06.bin", 0x200000, 0x3b97a07c, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d87-17.bin", 0x200000, 0xe601d63e, TAITO_CHARS_BYTESWAP }, // 8 - { "d87-08.bin", 0x200000, 0x76d23602, TAITO_CHARS }, // 9 - - { "d87-13.bin", 0x040000, 0x15b1fff4, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d87-14.bin", 0x040000, 0xeecda29a, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d87-01.bin", 0x200000, 0x3848a110, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d87-02.bin", 0x200000, 0x9250abae, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(dariusgu) -STD_ROM_FN(dariusgu) - -struct BurnDriver BurnDrvDariusgu = { - "dariusgu", "dariusg", NULL, NULL, "1994", - "Darius Gaiden - Silver Hawk (Ver 2.5A 1994/09/19)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, dariusguRomInfo, dariusguRomName, NULL, NULL, F3InputInfo, NULL, - dariusgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Darius Gaiden - Silver Hawk Extra Version (Ver 2.7J 1995/03/06) (Official Hack) - -static struct BurnRomInfo dariusgxRomDesc[] = { - { "dge_mpr3.bin", 0x080000, 0x1c1e24a7, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "dge_mpr2.bin", 0x080000, 0x7be23e23, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "dge_mpr1.bin", 0x080000, 0xbc030f6f, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "dge_mpr0.bin", 0x080000, 0xc5bd135c, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d87-03.bin", 0x200000, 0x4be1666e, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d87-04.bin", 0x200000, 0x2616002c, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d87-05.bin", 0x200000, 0x4e5891a9, TAITO_SPRITESA }, // 6 - - { "d87-06.bin", 0x200000, 0x3b97a07c, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d87-17.bin", 0x200000, 0xe601d63e, TAITO_CHARS_BYTESWAP }, // 8 - { "d87-08.bin", 0x200000, 0x76d23602, TAITO_CHARS }, // 9 - - { "d87-13.bin", 0x040000, 0x15b1fff4, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d87-14.bin", 0x040000, 0xeecda29a, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d87-01.bin", 0x200000, 0x3848a110, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d87-02.bin", 0x200000, 0x9250abae, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(dariusgx) -STD_ROM_FN(dariusgx) - -struct BurnDriver BurnDrvDariusgx = { - "dariusgx", NULL, NULL, NULL, "1994", - "Darius Gaiden - Silver Hawk Extra Version (Ver 2.7J 1995/03/06) (Official Hack)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, dariusgxRomInfo, dariusgxRomName, NULL, NULL, F3InputInfo, NULL, - dariusgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Bubble Bobble II (Ver 2.6O 1994/12/16) - -static struct BurnRomInfo bublbob2RomDesc[] = { - { "d90-21.ic20", 0x040000, 0x2a2b771a, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d90-20.ic19", 0x040000, 0xf01f63b6, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d90-19.ic18", 0x040000, 0x86eef19a, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d90-18.ic17", 0x040000, 0xf5b8cdce, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d90-03", 0x100000, 0x6fa894a1, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d90-02", 0x100000, 0x5ab04ca2, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d90-01", 0x100000, 0x8aedb9e5, TAITO_SPRITESA }, // 6 - - { "d90-08", 0x100000, 0x25a4fb2c, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d90-07", 0x100000, 0xb436b42d, TAITO_CHARS_BYTESWAP }, // 8 - { "d90-06", 0x100000, 0x166a72b8, TAITO_CHARS }, // 9 - - { "d90-13.ic32",0x040000, 0x6762bd90, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d90-14.ic33",0x040000, 0x8e33357e, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d90-04", 0x200000, 0xfeee5fda, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d90-05", 0x200000, 0xc192331f, TAITO_ES5505_BYTESWAP }, // 13 - - { "d77-14_palce16v8q-15.ic21.bin", 0x117, 0x2c798a1c, BRF_OPT }, - { "d77-12_palce16v8q-15.ic48.bin", 0x117, 0xb1cc6195, BRF_OPT }, - { "d77-11_palce16v8q-15.ic37.bin", 0x117, 0xa733f0de, BRF_OPT }, -}; - -STD_ROM_PICK(bublbob2) -STD_ROM_FN(bublbob2) - -static INT32 bublbob2Init() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, BUBSYMPH, 1, 0x41f3fc); -} - -struct BurnDriver BurnDrvBublbob2 = { - "bublbob2", NULL, NULL, NULL, "1994", - "Bubble Bobble II (Ver 2.6O 1994/12/16)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bublbob2RomInfo, bublbob2RomName, NULL, NULL, F3InputInfo, NULL, - bublbob2Init, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Bubble Bobble II (Ver 2.5O 1994/10/05) - -static struct BurnRomInfo bublbob2oRomDesc[] = { - { "d90-12", 0x040000, 0x9e523996, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d90-11", 0x040000, 0xedfdbb7f, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d90-10", 0x040000, 0x8e957d3d, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d90-17", 0x040000, 0x711f1894, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d90-03", 0x100000, 0x6fa894a1, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d90-02", 0x100000, 0x5ab04ca2, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d90-01", 0x100000, 0x8aedb9e5, TAITO_SPRITESA }, // 6 - - { "d90-08", 0x100000, 0x25a4fb2c, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d90-07", 0x100000, 0xb436b42d, TAITO_CHARS_BYTESWAP }, // 8 - { "d90-06", 0x100000, 0x166a72b8, TAITO_CHARS }, // 9 - - { "d90-13.ic32",0x040000, 0x6762bd90, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d90-14.ic33",0x040000, 0x8e33357e, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d90-04", 0x200000, 0xfeee5fda, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d90-05", 0x200000, 0xc192331f, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(bublbob2o) -STD_ROM_FN(bublbob2o) - -struct BurnDriver BurnDrvBublbob2o = { - "bublbob2o", "bublbob2", NULL, NULL, "1994", - "Bubble Bobble II (Ver 2.5O 1994/10/05)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bublbob2oRomInfo, bublbob2oRomName, NULL, NULL, F3InputInfo, NULL, - bublbob2Init, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Bubble Symphony (Ver 2.5O 1994/10/05) - -static struct BurnRomInfo bubsympheRomDesc[] = { - { "d90-12", 0x040000, 0x9e523996, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d90-11", 0x040000, 0xedfdbb7f, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d90-10", 0x040000, 0x8e957d3d, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d90-16", 0x040000, 0xd12ef19b, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d90-03", 0x100000, 0x6fa894a1, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d90-02", 0x100000, 0x5ab04ca2, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d90-01", 0x100000, 0x8aedb9e5, TAITO_SPRITESA }, // 6 - - { "d90-08", 0x100000, 0x25a4fb2c, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d90-07", 0x100000, 0xb436b42d, TAITO_CHARS_BYTESWAP }, // 8 - { "d90-06", 0x100000, 0x166a72b8, TAITO_CHARS }, // 9 - - { "d90-13.ic32",0x040000, 0x6762bd90, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d90-14.ic33",0x040000, 0x8e33357e, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d90-04", 0x200000, 0xfeee5fda, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d90-05", 0x200000, 0xc192331f, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(bubsymphe) -STD_ROM_FN(bubsymphe) - -struct BurnDriver BurnDrvBubsymphe = { - "bubsymphe", "bublbob2", NULL, NULL, "1994", - "Bubble Symphony (Ver 2.5O 1994/10/05)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bubsympheRomInfo, bubsympheRomName, NULL, NULL, F3InputInfo, NULL, - bublbob2Init, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Bubble Symphony (Ver 2.5J 1994/10/05) - -static struct BurnRomInfo bubsymphjRomDesc[] = { - { "d90-12", 0x040000, 0x9e523996, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d90-11", 0x040000, 0xedfdbb7f, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d90-10", 0x040000, 0x8e957d3d, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d90-09", 0x040000, 0x3f2090b7, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d90-03", 0x100000, 0x6fa894a1, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d90-02", 0x100000, 0x5ab04ca2, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d90-01", 0x100000, 0x8aedb9e5, TAITO_SPRITESA }, // 6 - - { "d90-08", 0x100000, 0x25a4fb2c, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d90-07", 0x100000, 0xb436b42d, TAITO_CHARS_BYTESWAP }, // 8 - { "d90-06", 0x100000, 0x166a72b8, TAITO_CHARS }, // 9 - - { "d90-13.ic32",0x040000, 0x6762bd90, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d90-14.ic33",0x040000, 0x8e33357e, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d90-04", 0x200000, 0xfeee5fda, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d90-05", 0x200000, 0xc192331f, TAITO_ES5505_BYTESWAP }, // 13 - - { "pal16l8a-d77-09.bin", 0x000104, 0xb371532b, BRF_OPT }, // 14 plds - { "pal16l8a-d77-10.bin", 0x000104, 0x42f59227, BRF_OPT }, // 15 - { "palce16v8q-d77-11.bin", 0x000117, 0xeacc294e, BRF_OPT }, // 16 - { "palce16v8q-d77-12.bin", 0x000117, 0xe9920cfe, BRF_OPT }, // 17 - { "palce16v8q-d77-14.bin", 0x000117, 0x7427e777, BRF_OPT }, // 18 -}; - -STD_ROM_PICK(bubsymphj) -STD_ROM_FN(bubsymphj) - -struct BurnDriver BurnDrvBubsymphj = { - "bubsymphj", "bublbob2", NULL, NULL, "1994", - "Bubble Symphony (Ver 2.5J 1994/10/05)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bubsymphjRomInfo, bubsymphjRomName, NULL, NULL, F3InputInfo, NULL, - bublbob2Init, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Bubble Bobble II (Ver 0.0J 1993/12/13, prototype) - -static struct BurnRomInfo bublbob2pRomDesc[] = { - { "soft-3-8c9b.ic60", 0x40000, 0x15d0594e, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "soft-2-0587.ic61", 0x40000, 0xd1a5231f, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "soft-1-9a9c.ic62", 0x40000, 0xc11a4d26, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "soft-0-a523.ic63", 0x40000, 0x58131f9e, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "cq80-obj-0l-c166.ic8", 0x80000, 0x9bff223b, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "cq80-obj-0m-24f4.ic30", 0x80000, 0xee71f643, TAITO_SPRITESA_BYTESWAP }, // 5 - { "cq80-obj-0h-990d.ic32", 0x80000, 0x4d3a78e0, TAITO_SPRITESA }, // 6 - - { "cq80-scr0-5ba4.ic7", 0x80000, 0x044dc38b, TAITO_CHARS_BYTESWAP32 }, // 7 Layer Tiles - { "cq80-scr2-cc11.ic5", 0x80000, 0xb81aa2c7, TAITO_CHARS_BYTESWAP32 }, // 8 - { "cq80-scr1-a5f3.ic6", 0x80000, 0x3cf3a3ba, TAITO_CHARS_BYTESWAP32 }, // 9 - { "cq80-scr3-4266.ic4", 0x80000, 0xc114583f, TAITO_CHARS_BYTESWAP32 }, // 10 - { "cq80-scr4-7fe1.ic3", 0x80000, 0x2bba1728, TAITO_CHARS_BYTESWAP }, // 11 - - { "snd-h-348f.ic66", 0x20000, 0xf66e60f2, TAITO_68KROM2_BYTESWAP }, // 12 68k Code - { "snd-l-4ec1.ic65", 0x20000, 0xd302d8bc, TAITO_68KROM2_BYTESWAP }, // 13 - - { "cq80-snd-data0-7b5f.ic43", 0x80000, 0xbf8f26d3, TAITO_ES5505_BYTESWAP }, // 14 Ensoniq Samples - { "cq80-snd-data1-933b.ic44", 0x80000, 0x62b00475, TAITO_ES5505_BYTESWAP }, // 15 - { "cq80-snd3-std5-3a9c.ic10", 0x80000, 0x26312451, TAITO_ES5505_BYTESWAP }, // 16 - { "cq80-snd2-std6-a148.ic11", 0x80000, 0x2edaa9dc, TAITO_ES5505_BYTESWAP }, // 17 - - { "bb2proto-ic12.bin", 0x002e5, 0xacf20b88, 0 | BRF_OPT }, // 18 pals - { "bb2proto-ic24.bin", 0x002e5, 0xd15a4987, 0 | BRF_OPT }, // 19 - { "pal16l8b.ic57.bin", 0x00104, 0x74b4d8be, 0 | BRF_OPT }, // 20 - { "pal16l8b.ic58.bin", 0x00104, 0x17e2c9b8, 0 | BRF_OPT }, // 21 - { "pal16l8b.ic59.bin", 0x00104, 0xdc0db200, 0 | BRF_OPT }, // 22 - { "pal16l8b.ic64.bin", 0x00104, 0x3aed3d98, 0 | BRF_OPT }, // 23 -}; - -STD_ROM_PICK(bublbob2p) -STD_ROM_FN(bublbob2p) - -static INT32 bublbob2pRomCallback() -{ - memcpy (TaitoES5505Rom + 0x600000, TaitoES5505Rom + 0x200000, 0x200000); - memset (TaitoES5505Rom + 0x200000, 0, 0x200000); - - return 0; -} - -static INT32 bublbob2pInit() -{ - return DrvInit(bublbob2pRomCallback, f3_24bit_palette_update, 1, BUBSYMPH, 1, 0); -} - -struct BurnDriver BurnDrvBublbob2p = { - "bublbob2p", "bublbob2", NULL, NULL, "1994", - "Bubble Bobble II (Ver 0.0J 1993/12/13, prototype)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bublbob2pRomInfo, bublbob2pRomName, NULL, NULL, F3InputInfo, NULL, - bublbob2pInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Bubble Symphony (bootleg with OKI6295) - -static struct BurnRomInfo bubsymphbRomDesc[] = { - { "bsb_d12.bin", 0x40000, 0xd05160fc, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "bsb_d13.bin", 0x40000, 0x83fc0d2c, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "bsb_d14.bin", 0x40000, 0xe6d49bb7, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "bsb_d15.bin", 0x40000, 0x014cf8e0, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "bsb_d18.bin", 0x80000, 0x22d7eeb5, TAITO_SPRITESA }, // 4 Sprites - { "bsb_d19.bin", 0x80000, 0xd36801fd, TAITO_SPRITESA }, // 5 - { "bsb_d20.bin", 0x80000, 0x20222e15, TAITO_SPRITESA }, // 6 - { "bsb_d17.bin", 0x80000, 0xea2eadfc, TAITO_SPRITESA }, // 7 - { "bsb_d16.bin", 0x80000, 0xedccd4e0, TAITO_SPRITESA }, // 8 - - { "bsb_d13b.bin", 0x80000, 0x430af2aa, TAITO_CHARS }, // 9 Layer Tiles - { "bsb_d14b.bin", 0x80000, 0xc006e832, TAITO_CHARS }, // 10 - { "bsb_d15b.bin", 0x80000, 0x74644ad4, TAITO_CHARS }, // 11 - { "bsb_d12b.bin", 0x80000, 0xcb2e2abb, TAITO_CHARS }, // 12 - { "bsb_d11b.bin", 0x80000, 0xd0607829, TAITO_CHARS }, // 13 - - { "bsb_d11.bin", 0x80000, 0x26bdc617, TAITO_MSM6295 }, // 14 oki -}; - -STD_ROM_PICK(bubsymphb) -STD_ROM_FN(bubsymphb) - -static void bootlegpatch() -{ - Taito68KRom1[0xed9ca] = 0x6d; // 2d - Taito68KRom1[0xed9cb] = 0x4a; // 30 - Taito68KRom1[0xed9cc] = 0x00; // 8c - Taito68KRom1[0xed9cd] = 0x80; // 82 - Taito68KRom1[0xed9ce] = 0x00; // 02 - Taito68KRom1[0xed9cf] = 0x66; // 6a - Taito68KRom1[0xed9d0] = 0xcc; // 40 - Taito68KRom1[0xed9d1] = 0x00; // 44 - Taito68KRom1[0xed9d2] = 0x2d; // 40 - Taito68KRom1[0xed9d3] = 0x30; // 04 - Taito68KRom1[0xed9d4] = 0x8c; // 1a - Taito68KRom1[0xed9d5] = 0x82; // 00 - Taito68KRom1[0xed9d6] = 0x40; // c0 - Taito68KRom1[0xed9d7] = 0x06; // 33 - Taito68KRom1[0xed9d8] = 0x29; // 66 - Taito68KRom1[0xed9da] = 0xc0; // 18 - Taito68KRom1[0xed9db] = 0x33; // 00 - Taito68KRom1[0xed9dc] = 0x66; // 2d - Taito68KRom1[0xed9dd] = 0x00; // 30 - Taito68KRom1[0xed9de] = 0x18; // a0 - Taito68KRom1[0xed9df] = 0x00; // 82 - Taito68KRom1[0xed9e0] = 0x2d; // 02 - Taito68KRom1[0xed9e1] = 0x30; // 6a - Taito68KRom1[0xed9e2] = 0xa0; // 40 - Taito68KRom1[0xed9e3] = 0x82; // 44 - Taito68KRom1[0xed9e5] = 0x06; // 04 - Taito68KRom1[0xed9e6] = 0x1f; // 00 - Taito68KRom1[0xed9f4] = 0xd8; // 2c - Taito68KRom1[0xed9f5] = 0xff; // 00 - Taito68KRom1[0xeda1c] = 0xdc; // 2d - Taito68KRom1[0xeda1d] = 0xff; // 00 - Taito68KRom1[0xeda44] = 0xe0; // 30 - Taito68KRom1[0xeda45] = 0xff; // 00 - Taito68KRom1[0xeda6c] = 0xe4; // 32 - Taito68KRom1[0xeda6d] = 0xff; // 00 - Taito68KRom1[0xedaa1] = 0x06; // 04 - Taito68KRom1[0xedaa2] = 0x9e; // 10 - Taito68KRom1[0xedba8] = 0x29; // f0 - Taito68KRom1[0xedba9] = 0x00; // ff - - Taito68KRom1[0xee1d0] = 0x3e; // 00 // black backgrounds - Taito68KRom1[0xee1d2] = 0xc0; // 00 - Taito68KRom1[0xee1d3] = 0x01; // 00 - Taito68KRom1[0xee1d4] = 0xfa; // 75 - Taito68KRom1[0xee1d5] = 0x41; // 4e - - Taito68KRom1[0xf04e7] = 0x08; // 00 - demo logo -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[8] = { STEP8(0, 0x080000*8) }; - INT32 XOffs0[16] = { STEP8(7,-1), STEP8(15,-1) }; - INT32 YOffs0[16] = { STEP16(0,16) }; - - INT32 Plane1[5] = { 0x200000*8, STEP4(0,1) }; - INT32 XOffs1[16] = { 20,16,12,8, 4,0,28,24, 52,48,44,40, 36,32,60,56 }; - INT32 YOffs1[16] = { STEP16(0,64) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - { - UINT8 *gfx = TaitoChars; - - for (INT32 i=0x200000;i<0x400000; i+=4) - { - UINT8 byte = gfx[i]; - gfx[i+0] = (byte & 0x80)? 1<<7 : 0<<4; - gfx[i+0]|= (byte & 0x40)? 1<<3 : 0<<0; - gfx[i+1] = (byte & 0x20)? 1<<7 : 0<<4; - gfx[i+1]|= (byte & 0x10)? 1<<3 : 0<<0; - gfx[i+2] = (byte & 0x08)? 1<<7 : 0<<4; - gfx[i+2]|= (byte & 0x04)? 1<<3 : 0<<0; - gfx[i+3] = (byte & 0x02)? 1<<7 : 0<<4; - gfx[i+3]|= (byte & 0x01)? 1<<3 : 0<<0; - } - } - - memcpy (tmp, TaitoSpritesA, 0x400000); - - GfxDecode(0x4000, 6, 16, 16, Plane0, XOffs0, YOffs0, 0x100, tmp, TaitoSpritesA); - - memcpy (tmp, TaitoChars, 0x400000); - - GfxDecode(0x4000, 5, 16, 16, Plane1, XOffs1, YOffs1, 0x400, tmp, TaitoChars); - - UINT8 tmp2[0x8]; - - for (INT32 i = 0x200000; i < 0x400000; i+=8) { - memcpy (tmp2, TaitoChars + i, 8); - - for (INT32 j = 0; j < 8; j++) { - TaitoChars[i+j] &= 0xf; - TaitoChars[i+j] |= 0x20; - tmp2[j] &= 0x10; - } - - TaitoChars[i+0] |= tmp2[6]; - TaitoChars[i+1] |= tmp2[7]; - TaitoChars[i+2] |= tmp2[0]; - TaitoChars[i+3] |= tmp2[1]; - TaitoChars[i+4] |= tmp2[2]; - TaitoChars[i+5] |= tmp2[3]; - TaitoChars[i+6] |= tmp2[4]; - TaitoChars[i+7] |= tmp2[5]; - } - - DrvCalculateTransTable(0x400000,0x400000); - - BurnFree(tmp); - - return 0; -} - -static INT32 bubsymphbInit() -{ - f3_game = BUBSYMPH; - - TaitoSpriteARomSize = (0x300000 * 8) / 6; - TaitoCharRomSize = 0x400000; - TaitoF3ES5506RomSize = 0x80000; - TaitoSpriteAModulo = (TaitoSpriteARomSize / 0x100); - TaitoCharModulo = (TaitoCharRomSize / 0x100); - - MemIndex(); - INT32 nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(Taito68KRom1 + 0x000001, 0, 4)) return 1; - if (BurnLoadRom(Taito68KRom1 + 0x000000, 1, 4)) return 1; - if (BurnLoadRom(Taito68KRom1 + 0x000003, 2, 4)) return 1; - if (BurnLoadRom(Taito68KRom1 + 0x000002, 3, 4)) return 1; - - if (BurnLoadRom(TaitoSpritesA + 0x080000, 4, 1)) return 1; - if (BurnLoadRom(TaitoSpritesA + 0x100000, 5, 1)) return 1; - if (BurnLoadRom(TaitoSpritesA + 0x180000, 6, 1)) return 1; - if (BurnLoadRom(TaitoSpritesA + 0x200000, 7, 1)) return 1; - if (BurnLoadRom(TaitoSpritesA + 0x280000, 8, 1)) return 1; - - if (BurnLoadRom(TaitoChars + 0x000000, 9, 4)) return 1; - if (BurnLoadRom(TaitoChars + 0x000001, 10, 4)) return 1; - if (BurnLoadRom(TaitoChars + 0x000002, 11, 4)) return 1; - if (BurnLoadRom(TaitoChars + 0x000003, 12, 4)) return 1; - if (BurnLoadRom(TaitoChars + 0x200000, 13, 4)) return 1; - - if (BurnLoadRom(TaitoF3ES5506Rom, 14, 1)) return 1; - - DrvGfxDecode(); - - bootlegpatch(); - } - - SekInit(0, 0x68ec020); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x1fffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x400000, 0x41ffff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x420000, 0x43ffff, MAP_RAM); // mirror - SekMapMemory(TaitoPaletteRam, 0x440000, 0x447fff, MAP_ROM); // write through handler - SekMapMemory(TaitoSpriteRam, 0x600000, 0x60ffff, MAP_RAM); - SekMapMemory(TaitoF3PfRAM, 0x610000, 0x617fff, MAP_ROM); // write through handler - SekMapMemory(TaitoF3PfRAM + 0x8000, 0x618000, 0x61bfff, MAP_RAM); - SekMapMemory(TaitoVideoRam, 0x61c000, 0x61dfff, MAP_RAM); - SekMapMemory(DrvVRAMRAM, 0x61e000, 0x61ffff, MAP_ROM); // write through handler - SekMapMemory(TaitoF3LineRAM, 0x620000, 0x62ffff, MAP_RAM); - SekMapMemory(DrvPivotRAM, 0x630000, 0x63ffff, MAP_ROM); // write through handler - SekMapMemory(TaitoF3CtrlRAM, 0x660000, 0x6603ff, MAP_WRITE); // 0-1f - SekMapMemory(TaitoF3SharedRam, 0xc00000, 0xc007ff, MAP_RAM); - SekSetWriteLongHandler(0, f3_main_write_long); - SekSetWriteWordHandler(0, f3_main_write_word); - SekSetWriteByteHandler(0, f3_main_write_byte); - SekSetReadLongHandler(0, f3_main_read_long); - SekSetReadWordHandler(0, f3_main_read_word); - SekSetReadByteHandler(0, f3_main_read_byte); - - SekMapHandler(1, 0x440000, 0x447fff, MAP_WRITE); - SekSetWriteLongHandler(1, f3_palette_write_long); - SekSetWriteWordHandler(1, f3_palette_write_word); - SekSetWriteByteHandler(1, f3_palette_write_byte); - - SekMapHandler(2, 0x61e000, 0x61ffff, MAP_WRITE); - SekSetWriteLongHandler(2, f3_VRAM_write_long); - SekSetWriteWordHandler(2, f3_VRAM_write_word); - SekSetWriteByteHandler(2, f3_VRAM_write_byte); - - SekMapHandler(3, 0x630000, 0x63ffff, MAP_WRITE); - SekSetWriteLongHandler(3, f3_pivot_write_long); - SekSetWriteWordHandler(3, f3_pivot_write_word); - SekSetWriteByteHandler(3, f3_pivot_write_byte); - - SekMapHandler(4, 0x610000, 0x617fff, MAP_WRITE); - SekSetWriteLongHandler(4, f3_playfield_write_long); - SekSetWriteWordHandler(4, f3_playfield_write_word); - SekSetWriteByteHandler(4, f3_playfield_write_byte); - SekClose(); - - TaitoF3SoundInit(1); // keep us safe from crashes! - - MSM6295Init(0, 1000000 / 132, 0); - MSM6295SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&eeprom_interface_93C46); - EEPROMIgnoreErrMessage(1); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nScreenHeight, &nScreenWidth); - } else { - BurnDrvGetVisibleSize(&nScreenWidth, &nScreenHeight); - } - - pPaletteUpdateCallback = f3_24bit_palette_update; - extended_layers = 1; - sprite_lag = 1; - - TaitoF3VideoInit(); - - bitmap_width[0] = extended_layers ? 1024 : 512; - bitmap_width[1] = extended_layers ? 1024 : 512; - bitmap_width[2] = extended_layers ? 1024 : 512; - bitmap_width[3] = extended_layers ? 1024 : 512; - bitmap_width[4] = 512; - bitmap_width[5] = 512; - bitmap_width[6] = 512; - bitmap_width[7] = 512; - - DrvDoReset(1); - - return 0; -} - - -struct BurnDriverD BurnDrvBubsymphb = { - "bubsymphb", "bublbob2", NULL, NULL, "1994", - "Bubble Symphony (bootleg with OKI6295)\0", NULL, "bootleg", "F3 System", - NULL, NULL, NULL, NULL, - BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bubsymphbRomInfo, bubsymphbRomName, NULL, NULL, F3InputInfo, NULL, - bubsymphbInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Bubble Symphony (Ver 2.5A 1994/10/05) - -static struct BurnRomInfo bubsymphuRomDesc[] = { - { "d90-12", 0x040000, 0x9e523996, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d90-11", 0x040000, 0xedfdbb7f, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d90-10", 0x040000, 0x8e957d3d, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d90-15", 0x040000, 0x06182802, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d90-03", 0x100000, 0x6fa894a1, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d90-02", 0x100000, 0x5ab04ca2, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d90-01", 0x100000, 0x8aedb9e5, TAITO_SPRITESA }, // 6 - - { "d90-08", 0x100000, 0x25a4fb2c, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "d90-07", 0x100000, 0xb436b42d, TAITO_CHARS_BYTESWAP }, // 8 - { "d90-06", 0x100000, 0x166a72b8, TAITO_CHARS }, // 9 - - { "d90-13.ic32",0x040000, 0x6762bd90, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "d90-14.ic33",0x040000, 0x8e33357e, TAITO_68KROM2_BYTESWAP }, // 11 - - { "d90-04", 0x200000, 0xfeee5fda, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "d90-05", 0x200000, 0xc192331f, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(bubsymphu) -STD_ROM_FN(bubsymphu) - -struct BurnDriver BurnDrvBubsymphu = { - "bubsymphu", "bublbob2", NULL, NULL, "1994", - "Bubble Symphony (Ver 2.5A 1994/10/05)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bubsymphuRomInfo, bubsymphuRomName, NULL, NULL, F3InputInfo, NULL, - bublbob2Init, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Space Invaders DX (Ver 2.6J 1994/09/14) (F3 Version) - -static struct BurnRomInfo spcinvdjRomDesc[] = { - { "d93-04.bin", 0x20000, 0xcd9a4e5c, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d93-03.bin", 0x20000, 0x0174bfc1, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d93-02.bin", 0x20000, 0x01922b31, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d93-01.bin", 0x20000, 0x4a74ab1c, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d93-07.12", 0x80000, 0x8cf5b972, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d93-08.08", 0x80000, 0x4c11af2b, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "d93-09.47", 0x20000, 0x9076f663, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "d93-10.45", 0x20000, 0x8a3f531b, TAITO_CHARS_BYTESWAP }, // 7 - - { "d93-05.bin", 0x20000, 0xff365596, TAITO_68KROM2_BYTESWAP }, // 8 68k Code - { "d93-06.bin", 0x20000, 0xef7ad400, TAITO_68KROM2_BYTESWAP }, // 9 - - { "d93-11.38", 0x80000, 0xdf5853de, TAITO_ES5505_BYTESWAP }, // 10 Ensoniq Samples - { "d93-12.39", 0x80000, 0xb0f71d60, TAITO_ES5505_BYTESWAP }, // 11 - { "d93-13.40", 0x80000, 0x26312451, TAITO_ES5505_BYTESWAP }, // 12 - { "d93-14.41", 0x80000, 0x2edaa9dc, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(spcinvdj) -STD_ROM_FN(spcinvdj) - -static INT32 spcinvdjInit() -{ - return DrvInit(NULL, f3_12bit_palette_update, 1, SPCINVDX, 1, 0x400218); -} - -struct BurnDriver BurnDrvSpcinvdj = { - "spcinvdj", "spacedx", NULL, NULL, "1994", - "Space Invaders DX (Ver 2.6J 1994/09/14) (F3 Version)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, spcinvdjRomInfo, spcinvdjRomName, NULL, NULL, F3InputInfo, NULL, - spcinvdjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Taito Power Goal (Ver 2.5O 1994/11/03) - -static struct BurnRomInfo pwrgoalRomDesc[] = { - { "d94-18.bin", 0x040000, 0xb92681c3, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d94-17.bin", 0x040000, 0x6009333e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d94-16.bin", 0x040000, 0xc6dbc9c8, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d94-22.rom", 0x040000, 0xf672e487, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d94-09.bin", 0x200000, 0x425e6bec, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d94-06.bin", 0x200000, 0x0ed1df55, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d94-08.bin", 0x200000, 0xbd909caf, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d94-05.bin", 0x200000, 0x121c8542, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d94-07.bin", 0x200000, 0xc8c95e49, TAITO_SPRITESA_BYTESWAP }, // 8 - { "d94-04.bin", 0x200000, 0x24958b50, TAITO_SPRITESA_BYTESWAP }, // 9 - { "d94-03.bin", 0x200000, 0x95e32072, TAITO_SPRITESA }, // 10 - { "d94-02.bin", 0x200000, 0xf460b9ac, TAITO_SPRITESA }, // 11 - { "d94-01.bin", 0x200000, 0x410ffccd, TAITO_SPRITESA }, // 12 - - { "d94-14.bin", 0x100000, 0xb8ba5761, TAITO_CHARS_BYTESWAP }, // 13 Layer Tiles - { "d94-13.bin", 0x100000, 0xcafc68ce, TAITO_CHARS_BYTESWAP }, // 14 - { "d94-12.bin", 0x100000, 0x47064189, TAITO_CHARS }, // 15 - - { "d94-19.bin", 0x040000, 0xc93dbcf4, TAITO_68KROM2_BYTESWAP }, // 16 68k Code - { "d94-20.bin", 0x040000, 0xf232bf64, TAITO_68KROM2_BYTESWAP }, // 17 - - { "d94-10.bin", 0x200000, 0xa22563ae, TAITO_ES5505_BYTESWAP }, // 18 Ensoniq Samples - { "d94-11.bin", 0x200000, 0x61ed83fa, TAITO_ES5505_BYTESWAP }, // 19 -}; - -STD_ROM_PICK(pwrgoal) -STD_ROM_FN(pwrgoal) - -static INT32 pwrgoalInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, HTHERO95, 1, 0); -} - -struct BurnDriver BurnDrvPwrgoal = { - "pwrgoal", NULL, NULL, NULL, "1994", - "Taito Power Goal (Ver 2.5O 1994/11/03)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, pwrgoalRomInfo, pwrgoalRomName, NULL, NULL, F3InputInfo, NULL, - pwrgoalInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Hat Trick Hero '95 (Ver 2.5J 1994/11/03) - -static struct BurnRomInfo hthero95RomDesc[] = { - { "d94-18.bin", 0x040000, 0xb92681c3, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d94-17.bin", 0x040000, 0x6009333e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d94-16.bin", 0x040000, 0xc6dbc9c8, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d94-15.bin", 0x040000, 0x187c85ab, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d94-09.bin", 0x200000, 0x425e6bec, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d94-06.bin", 0x200000, 0x0ed1df55, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d94-08.bin", 0x200000, 0xbd909caf, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d94-05.bin", 0x200000, 0x121c8542, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d94-07.bin", 0x200000, 0xc8c95e49, TAITO_SPRITESA_BYTESWAP }, // 8 - { "d94-04.bin", 0x200000, 0x24958b50, TAITO_SPRITESA_BYTESWAP }, // 9 - { "d94-03.bin", 0x200000, 0x95e32072, TAITO_SPRITESA }, // 10 - { "d94-02.bin", 0x200000, 0xf460b9ac, TAITO_SPRITESA }, // 11 - { "d94-01.bin", 0x200000, 0x410ffccd, TAITO_SPRITESA }, // 12 - - { "d94-14.bin", 0x100000, 0xb8ba5761, TAITO_CHARS_BYTESWAP }, // 13 Layer Tiles - { "d94-13.bin", 0x100000, 0xcafc68ce, TAITO_CHARS_BYTESWAP }, // 14 - { "d94-12.bin", 0x100000, 0x47064189, TAITO_CHARS }, // 15 - - { "d94-19.bin", 0x040000, 0xc93dbcf4, TAITO_68KROM2_BYTESWAP }, // 16 68k Code - { "d94-20.bin", 0x040000, 0xf232bf64, TAITO_68KROM2_BYTESWAP }, // 17 - - { "d94-10.bin", 0x200000, 0xa22563ae, TAITO_ES5505_BYTESWAP }, // 18 Ensoniq Samples - { "d94-11.bin", 0x200000, 0x61ed83fa, TAITO_ES5505_BYTESWAP }, // 19 -}; - -STD_ROM_PICK(hthero95) -STD_ROM_FN(hthero95) - -struct BurnDriver BurnDrvHthero95 = { - "hthero95", "pwrgoal", NULL, NULL, "1994", - "Hat Trick Hero '95 (Ver 2.5J 1994/11/03)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, hthero95RomInfo, hthero95RomName, NULL, NULL, F3InputInfo, NULL, - pwrgoalInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Hat Trick Hero '95 (Ver 2.5A 1994/11/03) - -static struct BurnRomInfo hthero95uRomDesc[] = { - { "d94-18.bin", 0x040000, 0xb92681c3, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d94-17.bin", 0x040000, 0x6009333e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d94-16.bin", 0x040000, 0xc6dbc9c8, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d94-21.bin", 0x040000, 0x8175d411, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d94-09.bin", 0x200000, 0x425e6bec, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d94-06.bin", 0x200000, 0x0ed1df55, TAITO_SPRITESA_BYTESWAP }, // 5 - { "d94-08.bin", 0x200000, 0xbd909caf, TAITO_SPRITESA_BYTESWAP }, // 6 - { "d94-05.bin", 0x200000, 0x121c8542, TAITO_SPRITESA_BYTESWAP }, // 7 - { "d94-07.bin", 0x200000, 0xc8c95e49, TAITO_SPRITESA_BYTESWAP }, // 8 - { "d94-04.bin", 0x200000, 0x24958b50, TAITO_SPRITESA_BYTESWAP }, // 9 - { "d94-03.bin", 0x200000, 0x95e32072, TAITO_SPRITESA }, // 10 - { "d94-02.bin", 0x200000, 0xf460b9ac, TAITO_SPRITESA }, // 11 - { "d94-01.bin", 0x200000, 0x410ffccd, TAITO_SPRITESA }, // 12 - - { "d94-14.bin", 0x100000, 0xb8ba5761, TAITO_CHARS_BYTESWAP }, // 13 Layer Tiles - { "d94-13.bin", 0x100000, 0xcafc68ce, TAITO_CHARS_BYTESWAP }, // 14 - { "d94-12.bin", 0x100000, 0x47064189, TAITO_CHARS }, // 15 - - { "d94-19.bin", 0x040000, 0xc93dbcf4, TAITO_68KROM2_BYTESWAP }, // 16 68k Code - { "d94-20.bin", 0x040000, 0xf232bf64, TAITO_68KROM2_BYTESWAP }, // 17 - - { "d94-10.bin", 0x200000, 0xa22563ae, TAITO_ES5505_BYTESWAP }, // 18 Ensoniq Samples - { "d94-11.bin", 0x200000, 0x61ed83fa, TAITO_ES5505_BYTESWAP }, // 19 -}; - -STD_ROM_PICK(hthero95u) -STD_ROM_FN(hthero95u) - -struct BurnDriver BurnDrvHthero95u = { - "hthero95u", "pwrgoal", NULL, NULL, "1994", - "Hat Trick Hero '95 (Ver 2.5A 1994/11/03)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SPORTSFOOTBALL, 0, - NULL, hthero95uRomInfo, hthero95uRomName, NULL, NULL, F3InputInfo, NULL, - pwrgoalInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Quiz Theater - 3tsu no Monogatari (Ver 2.3J 1994/11/10) - -static struct BurnRomInfo qtheaterRomDesc[] = { - { "d95-12.20", 0x080000, 0xfcee76ee, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "d95-11.19", 0x080000, 0xb3c2b8d5, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "d95-10.18", 0x080000, 0x85236e40, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "d95-09.17", 0x080000, 0xf456519c, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "d95-02.12", 0x200000, 0x74ce6f3e, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "d95-01.8", 0x200000, 0x141beb7d, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "d95-06.47", 0x200000, 0x70a0dcbb, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "d95-05.45", 0x200000, 0x1a1a852b, TAITO_CHARS_BYTESWAP }, // 7 - - { "d95-07.32", 0x040000, 0x3c201d70, TAITO_68KROM2_BYTESWAP }, // 8 68k Code - { "d95-08.33", 0x040000, 0x01c23354, TAITO_68KROM2_BYTESWAP }, // 9 - - { "d95-03.38", 0x200000, 0x4149ea67, TAITO_ES5505_BYTESWAP }, // 10 Ensoniq Samples - { "d95-04.41", 0x200000, 0xe9049d16, TAITO_ES5505_BYTESWAP }, // 11 -}; - -STD_ROM_PICK(qtheater) -STD_ROM_FN(qtheater) - -static INT32 qtheaterInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, QTHEATER, 1, 0); -} - -struct BurnDriver BurnDrvQtheater = { - "qtheater", NULL, NULL, NULL, "1994", - "Quiz Theater - 3tsu no Monogatari (Ver 2.3J 1994/11/10)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_QUIZ, 0, - NULL, qtheaterRomInfo, qtheaterRomName, NULL, NULL, F3InputInfo, NULL, - qtheaterInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Space Invaders '95: The Attack Of Lunar Loonies (Ver 2.5O 1995/06/14) - -static struct BurnRomInfo spcinv95RomDesc[] = { - { "e06-14.20", 0x020000, 0x71ba7f00, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e06-13.19", 0x020000, 0xf506ba4b, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e06-12.18", 0x020000, 0x06cbd72b, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e06-16.17", 0x020000, 0xd1eb3195, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e06-03", 0x100000, 0xa24070ef, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e06-02", 0x100000, 0x8f646dea, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e06-01", 0x100000, 0x51721b15, TAITO_SPRITESA }, // 6 - - { "e06-08", 0x100000, 0x72ae2fbf, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e06-07", 0x100000, 0x4b02e8f5, TAITO_CHARS_BYTESWAP }, // 8 - { "e06-06", 0x100000, 0x9380db3c, TAITO_CHARS }, // 9 - - { "e06-09.32", 0x040000, 0x9bcafc87, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e06-10.33", 0x040000, 0xb752b61f, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e06-04", 0x200000, 0x1dac29df, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e06-05", 0x200000, 0xf370ff15, TAITO_ES5505_BYTESWAP }, // 13 - - { "pal16l8a-d77-09.bin", 0x000104, 0xb371532b, BRF_OPT }, // 14 plds - { "pal16l8a-d77-10.bin", 0x000104, 0x42f59227, BRF_OPT }, // 15 - { "palce16v8q-d77-11.bin", 0x000117, 0xeacc294e, BRF_OPT }, // 16 - { "palce16v8q-d77-12.bin", 0x000117, 0xe9920cfe, BRF_OPT }, // 17 - { "palce16v8q-d77-13.bin", 0x000117, 0x66e32e73, BRF_OPT }, // 18 -}; - -STD_ROM_PICK(spcinv95) -STD_ROM_FN(spcinv95) - -static INT32 spcinv95Init() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, SPCINV95, 1, 0x408100); -} - -struct BurnDriver BurnDrvSpcinv95 = { - "spcinv95", NULL, NULL, NULL, "1995", - "Space Invaders '95: The Attack Of Lunar Loonies (Ver 2.5O 1995/06/14)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, spcinv95RomInfo, spcinv95RomName, NULL, NULL, F3InputInfo, NULL, - spcinv95Init, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 224, 320, 3, 4 -}; - - -// Space Invaders '95: The Attack Of Lunar Loonies (Ver 2.5A 1995/06/14) - -static struct BurnRomInfo spcinv95uRomDesc[] = { - { "e06-14.20", 0x020000, 0x71ba7f00, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e06-13.19", 0x020000, 0xf506ba4b, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e06-12.18", 0x020000, 0x06cbd72b, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e06-15.17", 0x020000, 0xa6ec0103, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e06-03", 0x100000, 0xa24070ef, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e06-02", 0x100000, 0x8f646dea, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e06-01", 0x100000, 0x51721b15, TAITO_SPRITESA }, // 6 - - { "e06-08", 0x100000, 0x72ae2fbf, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e06-07", 0x100000, 0x4b02e8f5, TAITO_CHARS_BYTESWAP }, // 8 - { "e06-06", 0x100000, 0x9380db3c, TAITO_CHARS }, // 9 - - { "e06-09.32", 0x040000, 0x9bcafc87, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e06-10.33", 0x040000, 0xb752b61f, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e06-04", 0x200000, 0x1dac29df, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e06-05", 0x200000, 0xf370ff15, TAITO_ES5505_BYTESWAP }, // 13 - - { "pal16l8a-d77-09.bin", 0x000104, 0xb371532b, BRF_OPT }, // 14 plds - { "pal16l8a-d77-10.bin", 0x000104, 0x42f59227, BRF_OPT }, // 15 - { "palce16v8q-d77-11.bin", 0x000117, 0xeacc294e, BRF_OPT }, // 16 - { "palce16v8q-d77-12.bin", 0x000117, 0xe9920cfe, BRF_OPT }, // 17 - { "palce16v8q-d77-13.bin", 0x000117, 0x66e32e73, BRF_OPT }, // 18 -}; - -STD_ROM_PICK(spcinv95u) -STD_ROM_FN(spcinv95u) - -struct BurnDriver BurnDrvSpcinv95u = { - "spcinv95u", "spcinv95", NULL, NULL, "1995", - "Space Invaders '95: The Attack Of Lunar Loonies (Ver 2.5A 1995/06/14)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, spcinv95uRomInfo, spcinv95uRomName, NULL, NULL, F3InputInfo, NULL, - spcinv95Init, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 224, 320, 3, 4 -}; - - -// Akkanbeder (Ver 2.5J 1995/06/14) - -static struct BurnRomInfo akkanvdrRomDesc[] = { - { "e06-14.20", 0x020000, 0x71ba7f00, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e06-13.19", 0x020000, 0xf506ba4b, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e06-12.18", 0x020000, 0x06cbd72b, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e06-11.17", 0x020000, 0x3fe550b9, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e06-03", 0x100000, 0xa24070ef, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e06-02", 0x100000, 0x8f646dea, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e06-01", 0x100000, 0x51721b15, TAITO_SPRITESA }, // 6 - - { "e06-08", 0x100000, 0x72ae2fbf, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e06-07", 0x100000, 0x4b02e8f5, TAITO_CHARS_BYTESWAP }, // 8 - { "e06-06", 0x100000, 0x9380db3c, TAITO_CHARS }, // 9 - - { "e06-09.32", 0x040000, 0x9bcafc87, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e06-10.33", 0x040000, 0xb752b61f, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e06-04", 0x200000, 0x1dac29df, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e06-05", 0x200000, 0xf370ff15, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(akkanvdr) -STD_ROM_FN(akkanvdr) - -struct BurnDriver BurnDrvAkkanvdr = { - "akkanvdr", "spcinv95", NULL, NULL, "1995", - "Akkanbeder (Ver 2.5J 1995/06/14)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, akkanvdrRomInfo, akkanvdrRomName, NULL, NULL, F3InputInfo, NULL, - spcinv95Init, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 224, 320, 3, 4 -}; - - -// Elevator Action Returns (Ver 2.2O 1995/02/20) - -static struct BurnRomInfo elvactrRomDesc[] = { - { "e02-12.20", 0x080000, 0xea5f5a32, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e02-11.19", 0x080000, 0xbcced8ff, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e02-10.18", 0x080000, 0x72f1b952, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e02-16.17", 0x080000, 0xcd97182b, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e02-03.12", 0x200000, 0xc884ebb5, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e02-02.8", 0x200000, 0xc8e06cfb, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e02-01.4", 0x200000, 0x2ba94726, TAITO_SPRITESA }, // 6 - - { "e02-08.47", 0x200000, 0x29c9bd02, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e02-07.45", 0x200000, 0x5eeee925, TAITO_CHARS_BYTESWAP }, // 8 - { "e02-06.43", 0x200000, 0x4c8726e9, TAITO_CHARS }, // 9 - - { "e02-13.32", 0x040000, 0x80932702, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e02-14.33", 0x040000, 0x706671a5, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e02-04.38", 0x200000, 0xb74307af, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e02-05.39", 0x200000, 0xeb729855, TAITO_ES5505_BYTESWAP }, // 13 - - { "ampal20l10a.a12", 0x0000cc, 0xe719542f, BRF_OPT }, // 14 plds - { "pal20l10b.a24", 0x0000cc, 0x00000000, BRF_OPT | BRF_NODUMP }, // 15 - { "pal16l8b.b24", 0x000104, 0x0b73a7d1, BRF_OPT }, // 16 - { "pal16l8b.b57", 0x000104, 0x74b4d8be, BRF_OPT }, // 17 - { "pal16l8b.b58", 0x000104, 0x17e2c9b8, BRF_OPT }, // 18 - { "pal16l8b.b59", 0x000104, 0xdc0db200, BRF_OPT }, // 19 - { "pal16l8b.b64", 0x000104, 0x3aed3d98, BRF_OPT }, // 20 -}; - -STD_ROM_PICK(elvactr) -STD_ROM_FN(elvactr) - -static INT32 elvactrInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, EACTION2, 2, 0x4007a2); -} - -struct BurnDriver BurnDrvElvactr = { - "elvactr", NULL, NULL, NULL, "1994", - "Elevator Action Returns (Ver 2.2O 1995/02/20)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, elvactrRomInfo, elvactrRomName, NULL, NULL, F3InputInfo, NULL, - elvactrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Elevator Action Returns (Ver 2.2J 1995/02/20) - -static struct BurnRomInfo elvactrjRomDesc[] = { - { "e02-12.20", 0x080000, 0xea5f5a32, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e02-11.19", 0x080000, 0xbcced8ff, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e02-10.18", 0x080000, 0x72f1b952, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e02-09.17", 0x080000, 0x23997907, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e02-03.12", 0x200000, 0xc884ebb5, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e02-02.8", 0x200000, 0xc8e06cfb, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e02-01.4", 0x200000, 0x2ba94726, TAITO_SPRITESA }, // 6 - - { "e02-08.47", 0x200000, 0x29c9bd02, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e02-07.45", 0x200000, 0x5eeee925, TAITO_CHARS_BYTESWAP }, // 8 - { "e02-06.43", 0x200000, 0x4c8726e9, TAITO_CHARS }, // 9 - - { "e02-13.32", 0x040000, 0x80932702, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e02-14.33", 0x040000, 0x706671a5, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e02-04.38", 0x200000, 0xb74307af, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e02-05.39", 0x200000, 0xeb729855, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(elvactrj) -STD_ROM_FN(elvactrj) - -struct BurnDriver BurnDrvElvactrj = { - "elvactrj", "elvactr", NULL, NULL, "1994", - "Elevator Action Returns (Ver 2.2J 1995/02/20)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, elvactrjRomInfo, elvactrjRomName, NULL, NULL, F3InputInfo, NULL, - elvactrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Elevator Action II (Ver 2.2A 1995/02/20) - -static struct BurnRomInfo elvact2uRomDesc[] = { - { "e02-12.20", 0x080000, 0xea5f5a32, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e02-11.19", 0x080000, 0xbcced8ff, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e02-10.18", 0x080000, 0x72f1b952, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e02-15.17", 0x080000, 0xba9028bd, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e02-03.12", 0x200000, 0xc884ebb5, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e02-02.8", 0x200000, 0xc8e06cfb, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e02-01.4", 0x200000, 0x2ba94726, TAITO_SPRITESA }, // 6 - - { "e02-08.47", 0x200000, 0x29c9bd02, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e02-07.45", 0x200000, 0x5eeee925, TAITO_CHARS_BYTESWAP }, // 8 - { "e02-06.43", 0x200000, 0x4c8726e9, TAITO_CHARS }, // 9 - - { "e02-13.32", 0x040000, 0x80932702, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e02-14.33", 0x040000, 0x706671a5, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e02-04.38", 0x200000, 0xb74307af, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e02-05.39", 0x200000, 0xeb729855, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(elvact2u) -STD_ROM_FN(elvact2u) - -struct BurnDriver BurnDrvElvact2u = { - "elvact2u", "elvactr", NULL, NULL, "1994", - "Elevator Action II (Ver 2.2A 1995/02/20)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, elvact2uRomInfo, elvact2uRomName, NULL, NULL, F3InputInfo, NULL, - elvactrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Twin Qix (Ver 1.0A 1995/01/17) (Prototype) - -static struct BurnRomInfo twinqixRomDesc[] = { - { "mpr0-3.b60", 0x40000, 0x1a63d0de, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "mpr0-2.b61", 0x40000, 0x45a70987, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "mpr0-1.b62", 0x40000, 0x531f9447, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "mpr0-0.b63", 0x40000, 0xa4c44c11, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "obj0-0.a08", 0x80000, 0xc6ea845c, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "obj0-1.a20", 0x80000, 0x8c12b7fb, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "scr0-0.b07", 0x80000, 0x9a1b9b34, TAITO_CHARS_BYTESWAP32 }, // 6 Layer Tiles - { "scr0-2.b05", 0x80000, 0xcac6854b, TAITO_CHARS_BYTESWAP32 }, // 7 - { "scr0-1.b06", 0x80000, 0xe9bef879, TAITO_CHARS_BYTESWAP32 }, // 8 - { "scr0-3.b04", 0x80000, 0xce063034, TAITO_CHARS_BYTESWAP32 }, // 9 - { "scr0-4.b03", 0x80000, 0xd32280fe, TAITO_CHARS_BYTESWAP }, // 10 - { "scr0-5.b02", 0x80000, 0xfdd1a85b, TAITO_CHARS_BYTESWAP }, // 11 - - { "spr0-1.b66", 0x40000, 0x4b20e99d, TAITO_68KROM2_BYTESWAP }, // 12 68k Code - { "spr0-0.b65", 0x40000, 0x2569eb30, TAITO_68KROM2_BYTESWAP }, // 13 - - { "snd-0.b43", 0x80000, 0xad5405a9, TAITO_ES5505_BYTESWAP }, // 14 Ensoniq Samples - { "snd-1.b44", 0x80000, 0x274864af, TAITO_ES5505_BYTESWAP }, // 15 - { "snd-14.b10", 0x80000, 0x26312451, TAITO_ES5505_BYTESWAP }, // 16 - { "snd-15.b11", 0x80000, 0x2edaa9dc, TAITO_ES5505_BYTESWAP }, // 17 - - { "pal20l10a.a12", 0x0cc, 0x00000000, 0 }, // 18 plds - { "pal20l10a.a24", 0x0cc, 0x00000000, 0 }, // 19 - { "pal16l8b.b24", 0x104, 0x0b73a7d1, 0 }, // 20 - { "pal16l8b.b57", 0x104, 0x74b4d8be, 0 }, // 21 - { "pal16l8b.b58", 0x104, 0x17e2c9b8, 0 }, // 22 - { "pal16l8b.b59", 0x104, 0xdc0db200, 0 }, // 23 - { "pal16l8b.b64", 0x104, 0x3aed3d98, 0 }, // 24 -}; - -STD_ROM_PICK(twinqix) -STD_ROM_FN(twinqix) - -static INT32 twinqixInit() -{ - return DrvInit(NULL/*twinqixRomCallback*/, f3_21bit_typeB_palette_update, 1, TWINQIX, 1, 0x40011c); -} - -struct BurnDriver BurnDrvTwinqix = { - "twinqix", NULL, NULL, NULL, "1995", - "Twin Qix (Ver 1.0A 1995/01/17) (Prototype)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_PROTOTYPE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, twinqixRomInfo, twinqixRomName, NULL, NULL, F3InputInfo, NULL, - twinqixInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Moriguchi Hiroko no Quiz de Hyuu!Hyuu! (Ver 2.2J 1995/05/25) - -static struct BurnRomInfo quizhuhuRomDesc[] = { - { "e08-16.20", 0x080000, 0xfaa8f373, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e08-15.19", 0x080000, 0x23acf231, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e08-14.18", 0x080000, 0x33a4951d, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e08-13.17", 0x080000, 0x0936fd2a, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e08-06.12", 0x200000, 0x8dadc9ac, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e08-04.8", 0x200000, 0x5423721d, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e08-05.11", 0x100000, 0x79d2e516, TAITO_SPRITESA_BYTESWAP }, // 6 - { "e08-03.7", 0x100000, 0x07b9ab6a, TAITO_SPRITESA_BYTESWAP }, // 7 - { "e08-02.4", 0x200000, 0xd89eb067, TAITO_SPRITESA }, // 8 - { "e08-01.3", 0x100000, 0x90223c06, TAITO_SPRITESA }, // 9 - - { "e08-12.47", 0x100000, 0x6c711d36, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "e08-11.45", 0x100000, 0x56775a60, TAITO_CHARS_BYTESWAP }, // 11 - { "e08-10.43", 0x100000, 0x60abc71b, TAITO_CHARS }, // 12 - - { "e08-18.32", 0x020000, 0xe695497e, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "e08-17.33", 0x020000, 0xfafc7e4e, TAITO_68KROM2_BYTESWAP }, // 14 - - { "e08-07.38", 0x200000, 0xc05dc85b, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "e08-08.39", 0x200000, 0x3eb94a99, TAITO_ES5505_BYTESWAP }, // 16 - { "e08-09.41", 0x200000, 0x200b26ee, TAITO_ES5505_BYTESWAP }, // 17 -}; - -STD_ROM_PICK(quizhuhu) -STD_ROM_FN(quizhuhu) - -static INT32 quizhuhuInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, QUIZHUHU, 1, 0); -} - -struct BurnDriver BurnDrvQuizhuhu = { - "quizhuhu", NULL, NULL, NULL, "1995", - "Moriguchi Hiroko no Quiz de Hyuu!Hyuu! (Ver 2.2J 1995/05/25)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_QUIZ, 0, - NULL, quizhuhuRomInfo, quizhuhuRomName, NULL, NULL, F3InputInfo, NULL, - quizhuhuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puzzle Bobble 2 (Ver 2.3O 1995/07/31) - -static struct BurnRomInfo pbobble2RomDesc[] = { - { "e10-24.bin", 0x040000, 0xf9d0794b, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e10-23.bin", 0x040000, 0x56a66435, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e10-22.bin", 0x040000, 0x7b12105d, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e10-25.bin", 0x040000, 0xff0407d3, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e10-02.rom", 0x100000, 0xc0564490, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e10-01.rom", 0x100000, 0x8c26ff49, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e10-07.rom", 0x100000, 0xdcb3c29b, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e10-06.rom", 0x100000, 0x1b0f20e2, TAITO_CHARS_BYTESWAP }, // 7 - { "e10-05.rom", 0x100000, 0x81266151, TAITO_CHARS }, // 8 - - { "e10-12.32", 0x040000, 0xb92dc8ad, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e10-13.33", 0x040000, 0x87842c13, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e10-04.rom", 0x200000, 0x5c0862a6, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e10-03.rom", 0x200000, 0x46d68ac8, TAITO_ES5505_BYTESWAP }, // 12 - - { "e10-21.bin", 0x000117, 0x458499b7, BRF_OPT }, // 13 extra -}; - -STD_ROM_PICK(pbobble2) -STD_ROM_FN(pbobble2) - -static INT32 pbobble2Init() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, PBOBBLE2, 1, 0x40451c); -} - -static INT32 pbobble23OCallback() -{ - UINT32 *ROM = (UINT32 *)Taito68KRom1; - - ROM[0x40090/4] = 0x4e71815c; - ROM[0x40094/4] = 0x4e714e71; - - return 0; -} - -static INT32 pbobble23OInit() -{ - return DrvInit(pbobble23OCallback, f3_24bit_palette_update, 0, PBOBBLE2, 1, 0x40451c); -} - -struct BurnDriver BurnDrvPbobble2 = { - "pbobble2", NULL, NULL, NULL, "1995", - "Puzzle Bobble 2 (Ver 2.3O 1995/07/31)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble2RomInfo, pbobble2RomName, NULL, NULL, F3InputInfo, NULL, - pbobble23OInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puzzle Bobble 2 (Ver 2.2O 1995/07/20) - -static struct BurnRomInfo pbobble2oRomDesc[] = { - { "e10-11.20", 0x040000, 0xb82f81da, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e10-10.19", 0x040000, 0xf432267a, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e10-09.18", 0x040000, 0xe0b1b599, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e10-15.17", 0x040000, 0xa2c0a268, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e10-02.rom", 0x100000, 0xc0564490, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e10-01.rom", 0x100000, 0x8c26ff49, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e10-07.rom", 0x100000, 0xdcb3c29b, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e10-06.rom", 0x100000, 0x1b0f20e2, TAITO_CHARS_BYTESWAP }, // 7 - { "e10-05.rom", 0x100000, 0x81266151, TAITO_CHARS }, // 8 - - { "e10-12.32", 0x040000, 0xb92dc8ad, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e10-13.33", 0x040000, 0x87842c13, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e10-04.rom", 0x200000, 0x5c0862a6, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e10-03.rom", 0x200000, 0x46d68ac8, TAITO_ES5505_BYTESWAP }, // 12 -}; - -STD_ROM_PICK(pbobble2o) -STD_ROM_FN(pbobble2o) - -struct BurnDriver BurnDrvPbobble2o = { - "pbobble2o", "pbobble2", NULL, NULL, "1995", - "Puzzle Bobble 2 (Ver 2.2O 1995/07/20)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble2oRomInfo, pbobble2oRomName, NULL, NULL, F3InputInfo, NULL, - pbobble2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puzzle Bobble 2 (Ver 2.2J 1995/07/20) - -static struct BurnRomInfo pbobble2jRomDesc[] = { - { "e10-11.20", 0x040000, 0xb82f81da, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e10-10.19", 0x040000, 0xf432267a, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e10-09.18", 0x040000, 0xe0b1b599, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e10-08.17", 0x040000, 0x4ccec344, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e10-02.rom", 0x100000, 0xc0564490, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e10-01.rom", 0x100000, 0x8c26ff49, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e10-07.rom", 0x100000, 0xdcb3c29b, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e10-06.rom", 0x100000, 0x1b0f20e2, TAITO_CHARS_BYTESWAP }, // 7 - { "e10-05.rom", 0x100000, 0x81266151, TAITO_CHARS }, // 8 - - { "e10-12.32", 0x040000, 0xb92dc8ad, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e10-13.33", 0x040000, 0x87842c13, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e10-04.rom", 0x200000, 0x5c0862a6, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e10-03.rom", 0x200000, 0x46d68ac8, TAITO_ES5505_BYTESWAP }, // 12 -}; - -STD_ROM_PICK(pbobble2j) -STD_ROM_FN(pbobble2j) - -struct BurnDriver BurnDrvPbobble2j = { - "pbobble2j", "pbobble2", NULL, NULL, "1995", - "Puzzle Bobble 2 (Ver 2.2J 1995/07/20)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble2jRomInfo, pbobble2jRomName, NULL, NULL, F3InputInfo, NULL, - pbobble2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Bust-A-Move Again (Ver 2.3A 1995/07/31) - -static struct BurnRomInfo pbobble2uRomDesc[] = { - { "e10-20.20", 0x040000, 0x97eb15c6, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e10-19.19", 0x040000, 0x7082d796, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e10-18.18", 0x040000, 0x2ffa3ef2, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e10-14.17", 0x040000, 0x4a19ed67, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e10-02.rom", 0x100000, 0xc0564490, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e10-01.rom", 0x100000, 0x8c26ff49, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e10-07.rom", 0x100000, 0xdcb3c29b, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e10-06.rom", 0x100000, 0x1b0f20e2, TAITO_CHARS_BYTESWAP }, // 7 - { "e10-05.rom", 0x100000, 0x81266151, TAITO_CHARS }, // 8 - - { "e10-16.32", 0x040000, 0x765ce77a, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e10-17.33", 0x040000, 0x0aec3b1e, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e10-04.rom", 0x200000, 0x5c0862a6, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e10-03.rom", 0x200000, 0x46d68ac8, TAITO_ES5505_BYTESWAP }, // 12 -}; - -STD_ROM_PICK(pbobble2u) -STD_ROM_FN(pbobble2u) - -struct BurnDriver BurnDrvPbobble2u = { - "pbobble2u", "pbobble2", NULL, NULL, "1995", - "Bust-A-Move Again (Ver 2.3A 1995/07/31)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble2uRomInfo, pbobble2uRomName, NULL, NULL, F3InputInfo, NULL, - pbobble2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puzzle Bobble 2X (Ver 2.2J 1995/11/11) - -static struct BurnRomInfo pbobble2xRomDesc[] = { - { "e10-29.20", 0x040000, 0xf1e9ad3f, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e10-28.19", 0x040000, 0x412a3602, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e10-27.18", 0x040000, 0x88cc0b5c, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e10-26.17", 0x040000, 0xa5c24047, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e10-02.rom", 0x100000, 0xc0564490, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e10-01.rom", 0x100000, 0x8c26ff49, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e10-07.rom", 0x100000, 0xdcb3c29b, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e10-06.rom", 0x100000, 0x1b0f20e2, TAITO_CHARS_BYTESWAP }, // 7 - { "e10-05.rom", 0x100000, 0x81266151, TAITO_CHARS }, // 8 - - { "e10-30.32", 0x040000, 0xbb090c1e, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e10-31.33", 0x040000, 0xf4b88d65, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e10-04.rom", 0x200000, 0x5c0862a6, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e10-03.rom", 0x200000, 0x46d68ac8, TAITO_ES5505_BYTESWAP }, // 12 - - { "pal16l8a-d77-09.bin", 0x000104, 0xb371532b, BRF_OPT }, // 13 plds - { "pal16l8a-d77-10.bin", 0x000104, 0x42f59227, BRF_OPT }, // 14 - { "palce16v8q-d77-11.bin", 0x000117, 0xeacc294e, BRF_OPT }, // 15 - { "palce16v8q-d77-12.bin", 0x000117, 0xe9920cfe, BRF_OPT }, // 16 - { "palce16v8q-d77-14.bin", 0x000117, 0x7427e777, BRF_OPT }, // 17 -}; - -STD_ROM_PICK(pbobble2x) -STD_ROM_FN(pbobble2x) - -struct BurnDriver BurnDrvPbobble2x = { - "pbobble2x", "pbobble2", NULL, NULL, "1995", - "Puzzle Bobble 2X (Ver 2.2J 1995/11/11)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble2xRomInfo, pbobble2xRomName, NULL, NULL, F3InputInfo, NULL, - pbobble2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Gekirindan (Ver 2.3O 1995/09/21) - -static struct BurnRomInfo gekiridnRomDesc[] = { - { "e11-12.ic20", 0x040000, 0x6a7aaacf, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e11-11.ic19", 0x040000, 0x2284a08e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e11-10.ic18", 0x040000, 0x8795e6ba, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e11-15.ic17", 0x040000, 0x5aef1fd8, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e11-03.ic12", 0x200000, 0xf73877c5, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e11-02.ic8", 0x200000, 0x5722a83b, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e11-01.ic4", 0x200000, 0xc2cd1069, TAITO_SPRITESA }, // 6 - - { "e11-08.ic47", 0x200000, 0x907f69d3, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e11-07.ic45", 0x200000, 0xef018607, TAITO_CHARS_BYTESWAP }, // 8 - { "e11-06.ic43", 0x200000, 0x200ce305, TAITO_CHARS }, // 9 - - { "e11-13.ic32", 0x040000, 0xf5c5486a, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e11-14.ic33", 0x040000, 0x7fa10f96, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e11-04.ic38", 0x200000, 0xe0ff4fb1, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e11-05.ic41", 0x200000, 0xa4d08cf1, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(gekiridn) -STD_ROM_FN(gekiridn) - -static INT32 gekiridnInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, GEKIRIDO, 1, 0x406bb0); -} - -struct BurnDriver BurnDrvGekiridn = { - "gekiridn", NULL, NULL, NULL, "1995", - "Gekirindan (Ver 2.3O 1995/09/21)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, gekiridnRomInfo, gekiridnRomName, NULL, NULL, F3InputInfo, NULL, - gekiridnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 232, 320, 3, 4 -}; - - -// Gekirindan (Ver 2.3J 1995/09/21) - -static struct BurnRomInfo gekiridnjRomDesc[] = { - { "e11-12.ic20", 0x040000, 0x6a7aaacf, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e11-11.ic19", 0x040000, 0x2284a08e, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e11-10.ic18", 0x040000, 0x8795e6ba, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e11-09.ic17", 0x040000, 0xb4e17ef4, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e11-03.ic12", 0x200000, 0xf73877c5, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e11-02.ic8", 0x200000, 0x5722a83b, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e11-01.ic4", 0x200000, 0xc2cd1069, TAITO_SPRITESA }, // 6 - - { "e11-08.ic47", 0x200000, 0x907f69d3, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e11-07.ic45", 0x200000, 0xef018607, TAITO_CHARS_BYTESWAP }, // 8 - { "e11-06.ic43", 0x200000, 0x200ce305, TAITO_CHARS }, // 9 - - { "e11-13.ic32", 0x040000, 0xf5c5486a, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e11-14.ic33", 0x040000, 0x7fa10f96, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e11-04.ic38", 0x200000, 0xe0ff4fb1, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e11-05.ic41", 0x200000, 0xa4d08cf1, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(gekiridnj) -STD_ROM_FN(gekiridnj) - -struct BurnDriver BurnDrvGekiridnj = { - "gekiridnj", "gekiridn", NULL, NULL, "1995", - "Gekirindan (Ver 2.3J 1995/09/21)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, gekiridnjRomInfo, gekiridnjRomName, NULL, NULL, F3InputInfo, NULL, - gekiridnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 232, 320, 3, 4 -}; - - -// Twin Cobra II (Ver 2.1O 1995/11/30) - -static struct BurnRomInfo tcobra2RomDesc[] = { - { "e15-14.ic20", 0x040000, 0xb527b733, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e15-13.ic19", 0x040000, 0x0f03daf7, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e15-12.ic18", 0x040000, 0x59d832f2, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e15-18.ic17", 0x040000, 0x4908c3aa, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e15-04.ic12", 0x200000, 0x6ea8d9bd, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e15-02.ic8", 0x200000, 0xbf1232aa, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e15-03.ic11", 0x100000, 0xbe45a52f, TAITO_SPRITESA_BYTESWAP }, // 6 - { "e15-01.ic7", 0x100000, 0x85421aac, TAITO_SPRITESA_BYTESWAP }, // 7 - - { "e15-10.ic47", 0x200000, 0xd8c96b00, TAITO_CHARS_BYTESWAP }, // 8 Layer Tiles - { "e15-08.ic45", 0x200000, 0x4bdb2bf3, TAITO_CHARS_BYTESWAP }, // 9 - { "e15-09.ic46", 0x100000, 0x07c29f60, TAITO_CHARS_BYTESWAP }, // 10 - { "e15-07.ic44", 0x100000, 0x8164f7ee, TAITO_CHARS_BYTESWAP }, // 11 - - { "e15-15.ic32", 0x020000, 0x22126dfb, TAITO_68KROM2_BYTESWAP }, // 12 68k Code - { "e15-16.ic33", 0x020000, 0xf8b58ea0, TAITO_68KROM2_BYTESWAP }, // 13 - - { "e15-05.ic38", 0x200000, 0x3e5da5f6, TAITO_ES5505_BYTESWAP }, // 14 Ensoniq Samples - { "e15-06.ic41", 0x200000, 0xb182a3e1, TAITO_ES5505_BYTESWAP }, // 15 - - { "d77-12.ic48.bin", 0x117, 0x6f93a4d8, BRF_OPT }, - { "d77-14.ic21.bin", 0x117, 0xf2264f51, BRF_OPT }, - { "palce16v8.ic37.bin", 0x117, 0x6ccd8168, BRF_OPT }, - { "d77-09.ic14.bin", 0x001, 0x00000000, BRF_NODUMP }, - { "d77-10.ic28.bin", 0x001, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(tcobra2) -STD_ROM_FN(tcobra2) - -static INT32 tcobra2Init() -{ - INT32 rc = DrvInit(NULL, f3_24bit_palette_update, 0, KTIGER2, 0, 0); - - if (!rc) { - ES550X_twincobra2_pan_fix = 1; - } - - return rc; -} - -struct BurnDriver BurnDrvTcobra2 = { - "tcobra2", NULL, NULL, NULL, "1995", - "Twin Cobra II (Ver 2.1O 1995/11/30)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, tcobra2RomInfo, tcobra2RomName, NULL, NULL, F3InputInfo, NULL, - tcobra2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 232, 320, 3, 4 -}; - - -// Twin Cobra II (Ver 2.1A 1995/11/30) - -static struct BurnRomInfo tcobra2uRomDesc[] = { - { "e15-14.ic20", 0x040000, 0xb527b733, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e15-13.ic19", 0x040000, 0x0f03daf7, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e15-12.ic18", 0x040000, 0x59d832f2, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e15-17.ic17", 0x040000, 0x3e0ff33c, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e15-04.ic12", 0x200000, 0x6ea8d9bd, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e15-02.ic8", 0x200000, 0xbf1232aa, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e15-03.ic11", 0x100000, 0xbe45a52f, TAITO_SPRITESA_BYTESWAP }, // 6 - { "e15-01.ic7", 0x100000, 0x85421aac, TAITO_SPRITESA_BYTESWAP }, // 7 - - { "e15-10.ic47", 0x200000, 0xd8c96b00, TAITO_CHARS_BYTESWAP }, // 8 Layer Tiles - { "e15-08.ic45", 0x200000, 0x4bdb2bf3, TAITO_CHARS_BYTESWAP }, // 9 - { "e15-09.ic46", 0x100000, 0x07c29f60, TAITO_CHARS_BYTESWAP }, // 10 - { "e15-07.ic44", 0x100000, 0x8164f7ee, TAITO_CHARS_BYTESWAP }, // 11 - - { "e15-15.ic32", 0x020000, 0x22126dfb, TAITO_68KROM2_BYTESWAP }, // 12 68k Code - { "e15-16.ic33", 0x020000, 0xf8b58ea0, TAITO_68KROM2_BYTESWAP }, // 13 - - { "e15-05.ic38", 0x200000, 0x3e5da5f6, TAITO_ES5505_BYTESWAP }, // 14 Ensoniq Samples - { "e15-06.ic41", 0x200000, 0xb182a3e1, TAITO_ES5505_BYTESWAP }, // 15 - - { "d77-12.ic48.bin", 0x117, 0x6f93a4d8, BRF_OPT }, - { "d77-14.ic21.bin", 0x117, 0xf2264f51, BRF_OPT }, - { "palce16v8.ic37.bin", 0x117, 0x6ccd8168, BRF_OPT }, - { "d77-09.ic14.bin", 0x001, 0x00000000, BRF_NODUMP }, - { "d77-10.ic28.bin", 0x001, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(tcobra2u) -STD_ROM_FN(tcobra2u) - -struct BurnDriver BurnDrvTcobra2u = { - "tcobra2u", "tcobra2", NULL, NULL, "1995", - "Twin Cobra II (Ver 2.1A 1995/11/30)\0", NULL, "Taito America Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, tcobra2uRomInfo, tcobra2uRomName, NULL, NULL, F3InputInfo, NULL, - tcobra2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 232, 320, 3, 4 -}; - - -// Kyukyoku Tiger II (Ver 2.1J 1995/11/30) - -static struct BurnRomInfo ktiger2RomDesc[] = { - { "e15-14.ic20", 0x040000, 0xb527b733, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e15-13.ic19", 0x040000, 0x0f03daf7, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e15-12.ic18", 0x040000, 0x59d832f2, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e15-11.ic17", 0x040000, 0xa706a286, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e15-04.ic12", 0x200000, 0x6ea8d9bd, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e15-02.ic8", 0x200000, 0xbf1232aa, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e15-03.ic11", 0x100000, 0xbe45a52f, TAITO_SPRITESA_BYTESWAP }, // 6 - { "e15-01.ic7", 0x100000, 0x85421aac, TAITO_SPRITESA_BYTESWAP }, // 7 - - { "e15-10.ic47", 0x200000, 0xd8c96b00, TAITO_CHARS_BYTESWAP }, // 8 Layer Tiles - { "e15-08.ic45", 0x200000, 0x4bdb2bf3, TAITO_CHARS_BYTESWAP }, // 9 - { "e15-09.ic46", 0x100000, 0x07c29f60, TAITO_CHARS_BYTESWAP }, // 10 - { "e15-07.ic44", 0x100000, 0x8164f7ee, TAITO_CHARS_BYTESWAP }, // 11 - - { "e15-15.ic32", 0x020000, 0x22126dfb, TAITO_68KROM2_BYTESWAP }, // 12 68k Code - { "e15-16.ic33", 0x020000, 0xf8b58ea0, TAITO_68KROM2_BYTESWAP }, // 13 - - { "e15-05.ic38", 0x200000, 0x3e5da5f6, TAITO_ES5505_BYTESWAP }, // 14 Ensoniq Samples - { "e15-06.ic41", 0x200000, 0xb182a3e1, TAITO_ES5505_BYTESWAP }, // 15 - - { "d77-12.ic48.bin", 0x117, 0x6f93a4d8, BRF_OPT }, - { "d77-14.ic21.bin", 0x117, 0xf2264f51, BRF_OPT }, - { "palce16v8.ic37.bin", 0x117, 0x6ccd8168, BRF_OPT }, - { "d77-09.ic14.bin", 0x001, 0x00000000, BRF_NODUMP }, - { "d77-10.ic28.bin", 0x001, 0x00000000, BRF_NODUMP }, -}; - -STD_ROM_PICK(ktiger2) -STD_ROM_FN(ktiger2) - -struct BurnDriver BurnDrvKtiger2 = { - "ktiger2", "tcobra2", NULL, NULL, "1995", - "Kyukyoku Tiger II (Ver 2.1J 1995/11/30)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, ktiger2RomInfo, ktiger2RomName, NULL, NULL, F3InputInfo, NULL, - tcobra2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 232, 320, 3, 4 -}; - - -// Bubble Memories: The Story Of Bubble Bobble III (Ver 2.4O 1996/02/15) - -static struct BurnRomInfo bubblemRomDesc[] = { - { "e21-21.20", 0x080000, 0xcac4169c, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e21-20.19", 0x080000, 0x7727c673, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e21-19.18", 0x080000, 0xbe0b907d, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e21-18.17", 0x080000, 0xd14e313a, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e21-02.rom", 0x200000, 0xb7cb9232, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e21-01.rom", 0x200000, 0xa11f2f99, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e21-07.rom", 0x100000, 0x7789bf7c, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e21-06.rom", 0x100000, 0x997fc0d7, TAITO_CHARS_BYTESWAP }, // 7 - { "e21-05.rom", 0x100000, 0x07eab58f, TAITO_CHARS }, // 8 - - { "e21-12.32", 0x040000, 0x34093de1, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e21-13.33", 0x040000, 0x9e9ec437, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e21-03.rom", 0x200000, 0x54c5f83d, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e21-04.rom", 0x200000, 0xe5af2a2d, TAITO_ES5505_BYTESWAP }, // 12 - - { "bubblem.nv", 0x000080, 0x9a59326e, TAITO_DEFAULT_EEPROM }, // 13 eeprom -}; - -STD_ROM_PICK(bubblem) -STD_ROM_FN(bubblem) - -static INT32 bubblemInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, BUBBLEM, 1, 0x40011c); -} - -struct BurnDriver BurnDrvBubblem = { - "bubblem", NULL, NULL, NULL, "1995", - "Bubble Memories: The Story Of Bubble Bobble III (Ver 2.4O 1996/02/15)\0", NULL, "Taito Corporation Japan", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bubblemRomInfo, bubblemRomName, NULL, NULL, F3InputInfo, NULL, - bubblemInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Bubble Memories: The Story Of Bubble Bobble III (Ver 2.3J 1996/02/07) - -static struct BurnRomInfo bubblemjRomDesc[] = { - { "e21-11.20", 0x080000, 0xdf0eeae4, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e21-10.19", 0x080000, 0xcdfb58f6, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e21-09.18", 0x080000, 0x6c305f17, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e21-08.17", 0x080000, 0x27381ae2, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e21-02.rom", 0x200000, 0xb7cb9232, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e21-01.rom", 0x200000, 0xa11f2f99, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e21-07.rom", 0x100000, 0x7789bf7c, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e21-06.rom", 0x100000, 0x997fc0d7, TAITO_CHARS_BYTESWAP }, // 7 - { "e21-05.rom", 0x100000, 0x07eab58f, TAITO_CHARS }, // 8 - - { "e21-12.32", 0x040000, 0x34093de1, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e21-13.33", 0x040000, 0x9e9ec437, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e21-03.rom", 0x200000, 0x54c5f83d, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e21-04.rom", 0x200000, 0xe5af2a2d, TAITO_ES5505_BYTESWAP }, // 12 - - { "bubblemj.nv", 0x000080, 0xcb4ef35c, TAITO_DEFAULT_EEPROM }, // 13 eeprom -}; - -STD_ROM_PICK(bubblemj) -STD_ROM_FN(bubblemj) - -struct BurnDriver BurnDrvBubblemj = { - "bubblemj", "bubblem", NULL, NULL, "1995", - "Bubble Memories: The Story Of Bubble Bobble III (Ver 2.3J 1996/02/07)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, bubblemjRomInfo, bubblemjRomName, NULL, NULL, F3InputInfo, NULL, - bubblemInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Cleopatra Fortune (Ver 2.1J 1996/09/05) - -static struct BurnRomInfo cleopatrRomDesc[] = { - { "e28-10.bin", 0x080000, 0x013fbc39, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e28-09.bin", 0x080000, 0x1c48a1f9, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e28-08.bin", 0x080000, 0x7564f199, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e28-07.bin", 0x080000, 0xa507797b, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e28-02.bin", 0x080000, 0xb20d47cb, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e28-01.bin", 0x080000, 0x4440e659, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e28-06.bin", 0x100000, 0x21d0c454, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e28-05.bin", 0x100000, 0x2870dbbc, TAITO_CHARS_BYTESWAP }, // 7 - { "e28-04.bin", 0x100000, 0x57aef029, TAITO_CHARS }, // 8 - - { "e28-11.bin", 0x020000, 0x01a06950, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e28-12.bin", 0x020000, 0xdc19260f, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e28-03.bin", 0x200000, 0x15c7989d, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples -}; - -STD_ROM_PICK(cleopatr) -STD_ROM_FN(cleopatr) - -static INT32 cleopatrInit() -{ - return DrvInit(NULL, f3_21bit_typeA_palette_update, 0, CLEOPATR, 1, 0); -} - -struct BurnDriver BurnDrvCleopatr = { - "cleopatr", NULL, NULL, NULL, "1996", - "Cleopatra Fortune (Ver 2.1J 1996/09/05)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, cleopatrRomInfo, cleopatrRomName, NULL, NULL, F3InputInfo, NULL, - cleopatrInit, DrvExit, DrvFrame, DrvDraw224A_Flipped, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Puzzle Bobble 3 (Ver 2.1O 1996/09/27) - -static struct BurnRomInfo pbobble3RomDesc[] = { - { "e29-12.rom", 0x080000, 0x9eb19a00, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e29-11.rom", 0x080000, 0xe54ada97, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e29-10.rom", 0x080000, 0x1502a122, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e29-16.rom", 0x080000, 0xaac293da, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e29-02.rom", 0x100000, 0x437391d3, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e29-01.rom", 0x100000, 0x52547c77, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e29-08.rom", 0x100000, 0x7040a3d5, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e29-07.rom", 0x100000, 0xfca2ea9b, TAITO_CHARS_BYTESWAP }, // 7 - { "e29-06.rom", 0x100000, 0xc16184f8, TAITO_CHARS }, // 8 - - { "e29-13.rom", 0x040000, 0x1ef551ef, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e29-14.rom", 0x040000, 0x7ee7e688, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e29-03.rom", 0x200000, 0xa4371658, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e29-04.rom", 0x200000, 0xd1f42457, TAITO_ES5505_BYTESWAP }, // 12 - { "e29-05.rom", 0x200000, 0xe33c1234, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(pbobble3) -STD_ROM_FN(pbobble3) - -static INT32 pbobble3Init() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, PBOBBLE3, 1, 0x4055c0); -} - -struct BurnDriver BurnDrvPbobble3 = { - "pbobble3", NULL, NULL, NULL, "1996", - "Puzzle Bobble 3 (Ver 2.1O 1996/09/27)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble3RomInfo, pbobble3RomName, NULL, NULL, F3InputInfo, NULL, - pbobble3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puzzle Bobble 3 (Ver 2.1A 1996/09/27) - -static struct BurnRomInfo pbobble3uRomDesc[] = { - { "e29-12.rom", 0x080000, 0x9eb19a00, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e29-11.rom", 0x080000, 0xe54ada97, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e29-10.rom", 0x080000, 0x1502a122, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e29-15.bin", 0x080000, 0xddc5a34c, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e29-02.rom", 0x100000, 0x437391d3, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e29-01.rom", 0x100000, 0x52547c77, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e29-08.rom", 0x100000, 0x7040a3d5, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e29-07.rom", 0x100000, 0xfca2ea9b, TAITO_CHARS_BYTESWAP }, // 7 - { "e29-06.rom", 0x100000, 0xc16184f8, TAITO_CHARS }, // 8 - - { "e29-13.rom", 0x040000, 0x1ef551ef, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e29-14.rom", 0x040000, 0x7ee7e688, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e29-03.rom", 0x200000, 0xa4371658, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e29-04.rom", 0x200000, 0xd1f42457, TAITO_ES5505_BYTESWAP }, // 12 - { "e29-05.rom", 0x200000, 0xe33c1234, TAITO_ES5505_BYTESWAP }, // 13 -}; - -STD_ROM_PICK(pbobble3u) -STD_ROM_FN(pbobble3u) - -struct BurnDriver BurnDrvPbobble3u = { - "pbobble3u", "pbobble3", NULL, NULL, "1996", - "Puzzle Bobble 3 (Ver 2.1A 1996/09/27)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble3uRomInfo, pbobble3uRomName, NULL, NULL, F3InputInfo, NULL, - pbobble3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puzzle Bobble 3 (Ver 2.1J 1996/09/27) - -static struct BurnRomInfo pbobble3jRomDesc[] = { - { "e29-12.ic20", 0x080000, 0x9eb19a00, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e29-11.ic19", 0x080000, 0xe54ada97, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e29-10.ic18", 0x080000, 0x1502a122, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e29-09.ic17", 0x080000, 0x44ccf2f6, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e29-02.ic8", 0x100000, 0x437391d3, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e29-01.ic12", 0x100000, 0x52547c77, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e29-08.ic47", 0x100000, 0x7040a3d5, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e29-07.ic45", 0x100000, 0xfca2ea9b, TAITO_CHARS_BYTESWAP }, // 7 - { "e29-06.ic43", 0x100000, 0xc16184f8, TAITO_CHARS }, // 8 - - { "e29-13.ic32", 0x040000, 0x1ef551ef, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e29-14.ic33", 0x040000, 0x7ee7e688, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e29-03.ic38", 0x200000, 0xa4371658, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e29-04.ic39", 0x200000, 0xd1f42457, TAITO_ES5505_BYTESWAP }, // 12 - { "e29-05.ic41", 0x200000, 0xe33c1234, TAITO_ES5505_BYTESWAP }, // 13 - - { "d77-12.ic48.bin", 0x000001, 0x00000000, BRF_OPT }, - { "d77-14.ic21.bin", 0x000001, 0x00000000, BRF_OPT }, - { "d77-11.ic37.bin", 0x000001, 0x00000000, BRF_OPT }, - { "d77-09.ic14.bin", 0x000001, 0x00000000, BRF_OPT }, - { "d77-10.ic28.bin", 0x000001, 0x00000000, BRF_OPT }, -}; - -STD_ROM_PICK(pbobble3j) -STD_ROM_FN(pbobble3j) - -struct BurnDriver BurnDrvPbobble3j = { - "pbobble3j", "pbobble3", NULL, NULL, "1996", - "Puzzle Bobble 3 (Ver 2.1J 1996/09/27)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble3jRomInfo, pbobble3jRomName, NULL, NULL, F3InputInfo, NULL, - pbobble3Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Arkanoid Returns (Ver 2.02O 1997/02/10) - -static struct BurnRomInfo arkretrnRomDesc[] = { - { "e36-11.20", 0x040000, 0xb50cfb92, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e36-10.19", 0x040000, 0xc940dba1, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e36-09.18", 0x040000, 0xf16985e0, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e36-15.17", 0x040000, 0x4467ff37, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e36-03.12", 0x040000, 0x1ea8558b, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e36-02.8", 0x040000, 0x694eda31, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e36-01.4", 0x040000, 0x54b9b2cd, TAITO_SPRITESA }, // 6 - - { "e36-07.47", 0x080000, 0x266bf1c1, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e36-06.45", 0x080000, 0x110ab729, TAITO_CHARS_BYTESWAP }, // 8 - { "e36-05.43", 0x080000, 0xdb18bce2, TAITO_CHARS }, // 9 - - { "e36-12.32", 0x040000, 0x3bae39be, TAITO_68KROM2_BYTESWAP}, // 10 68k Code - { "e36-13.33", 0x040000, 0x94448e82, TAITO_68KROM2_BYTESWAP}, // 11 - - { "e36-04.38", 0x200000, 0x2250959b, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - - { "pal16l8a-d77-09.bin", 0x000104, 0xb371532b, 0 }, // 13 plds - { "pal16l8a-d77-10.bin", 0x000104, 0x42f59227, 0 }, // 14 - { "palce16v8-d77-11.bin", 0x000117, 0xeacc294e, 0 }, // 15 - { "palce16v8-d77-12.bin", 0x000117, 0xe9920cfe, 0 }, // 16 - { "palce16v8-d77-14.bin", 0x000117, 0x7427e777, 0 }, // 17 -}; - -STD_ROM_PICK(arkretrn) -STD_ROM_FN(arkretrn) - -static INT32 arkretrnInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, ARKRETRN, 1, 0); -} - -struct BurnDriver BurnDrvArkretrn = { - "arkretrn", NULL, NULL, NULL, "1997", - "Arkanoid Returns (Ver 2.02O 1997/02/10)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkretrnRomInfo, arkretrnRomName, NULL, NULL, F3InputInfo, NULL, - arkretrnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Arkanoid Returns (Ver 2.02A 1997/02/10) - -static struct BurnRomInfo arkretrnuRomDesc[] = { - { "e36-11.20", 0x040000, 0xb50cfb92, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e36-10.19", 0x040000, 0xc940dba1, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e36-09.18", 0x040000, 0xf16985e0, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e36-14.17", 0x040000, 0x3360cfa1, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e36-03.12", 0x040000, 0x1ea8558b, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e36-02.8", 0x040000, 0x694eda31, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e36-01.4", 0x040000, 0x54b9b2cd, TAITO_SPRITESA }, // 6 - - { "e36-07.47", 0x080000, 0x266bf1c1, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e36-06.45", 0x080000, 0x110ab729, TAITO_CHARS_BYTESWAP }, // 8 - { "e36-05.43", 0x080000, 0xdb18bce2, TAITO_CHARS }, // 9 - - { "e36-12.32", 0x040000, 0x3bae39be, TAITO_68KROM2_BYTESWAP}, // 10 68k Code - { "e36-13.33", 0x040000, 0x94448e82, TAITO_68KROM2_BYTESWAP}, // 11 - - { "e36-04.38", 0x200000, 0x2250959b, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - - { "pal16l8a-d77-09.bin", 0x000104, 0xb371532b, 0 }, // 13 plds - { "pal16l8a-d77-10.bin", 0x000104, 0x42f59227, 0 }, // 14 - { "palce16v8-d77-11.bin", 0x000117, 0xeacc294e, 0 }, // 15 - { "palce16v8-d77-12.bin", 0x000117, 0xe9920cfe, 0 }, // 16 - { "palce16v8-d77-14.bin", 0x000117, 0x7427e777, 0 }, // 17 -}; - -STD_ROM_PICK(arkretrnu) -STD_ROM_FN(arkretrnu) - -struct BurnDriver BurnDrvArkretrnu = { - "arkretrnu", "arkretrn", NULL, NULL, "1997", - "Arkanoid Returns (Ver 2.02A 1997/02/10)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkretrnuRomInfo, arkretrnuRomName, NULL, NULL, F3InputInfo, NULL, - arkretrnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Arkanoid Returns (Ver 2.02J 1997/02/10) - -static struct BurnRomInfo arkretrnjRomDesc[] = { - { "e36-11.20", 0x040000, 0xb50cfb92, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e36-10.19", 0x040000, 0xc940dba1, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e36-09.18", 0x040000, 0xf16985e0, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e36-08.17", 0x040000, 0xaa699e1b, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e36-03.12", 0x040000, 0x1ea8558b, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e36-02.8", 0x040000, 0x694eda31, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e36-01.4", 0x040000, 0x54b9b2cd, TAITO_SPRITESA }, // 6 - - { "e36-07.47", 0x080000, 0x266bf1c1, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e36-06.45", 0x080000, 0x110ab729, TAITO_CHARS_BYTESWAP }, // 8 - { "e36-05.43", 0x080000, 0xdb18bce2, TAITO_CHARS }, // 9 - - { "e36-12.32", 0x040000, 0x3bae39be, TAITO_68KROM2_BYTESWAP}, // 10 68k Code - { "e36-13.33", 0x040000, 0x94448e82, TAITO_68KROM2_BYTESWAP}, // 11 - - { "e36-04.38", 0x200000, 0x2250959b, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - - { "pal16l8a-d77-09.bin", 0x000104, 0xb371532b, 0 }, // 13 plds - { "pal16l8a-d77-10.bin", 0x000104, 0x42f59227, 0 }, // 14 - { "palce16v8-d77-11.bin", 0x000117, 0xeacc294e, 0 }, // 15 - { "palce16v8-d77-12.bin", 0x000117, 0xe9920cfe, 0 }, // 16 - { "palce16v8-d77-14.bin", 0x000117, 0x7427e777, 0 }, // 17 -}; - -STD_ROM_PICK(arkretrnj) -STD_ROM_FN(arkretrnj) - -struct BurnDriver BurnDrvArkretrnj = { - "arkretrnj", "arkretrn", NULL, NULL, "1997", - "Arkanoid Returns (Ver 2.02J 1997/02/10)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arkretrnjRomInfo, arkretrnjRomName, NULL, NULL, F3InputInfo, NULL, - arkretrnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Kirameki Star Road (Ver 2.10J 1997/08/29) - -static struct BurnRomInfo kiramekiRomDesc[] = { - { "e44-19.20", 0x080000, 0x2f3b239a, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e44-18.19", 0x080000, 0x3137c8bc, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e44-17.18", 0x080000, 0x5905cd20, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e44-16.17", 0x080000, 0x5e9ac3fd, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e44-06.12", 0x400000, 0x80526d58, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e44-04.8", 0x400000, 0x28c7c295, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e44-05.11", 0x200000, 0x0fbc2b26, TAITO_SPRITESA_BYTESWAP }, // 6 - { "e44-03.7", 0x200000, 0xd9e63fb0, TAITO_SPRITESA_BYTESWAP }, // 7 - { "e44-02.4", 0x400000, 0x5481efde, TAITO_SPRITESA }, // 8 - { "e44-01.3", 0x200000, 0xc4bdf727, TAITO_SPRITESA }, // 9 - - { "e44-14.47", 0x200000, 0x4597c034, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "e44-12.45", 0x200000, 0x7160a181, TAITO_CHARS_BYTESWAP }, // 11 - { "e44-13.46", 0x100000, 0x0b016c4e, TAITO_CHARS_BYTESWAP }, // 12 - { "e44-11.44", 0x100000, 0x34d84143, TAITO_CHARS_BYTESWAP }, // 13 - { "e44-10.43", 0x200000, 0x326f738e, TAITO_CHARS }, // 14 - { "e44-09.42", 0x100000, 0xa8e68eb7, TAITO_CHARS }, // 15 - - { "e44-20.51", 0x080000, 0x4df7e051, TAITO_68KROM2_BYTESWAP }, // 16 68k Code - { "e44-21.52", 0x080000, 0xd31b94b8, TAITO_68KROM2_BYTESWAP }, // 17 - { "e44-15.53", 0x200000, 0x5043b608, TAITO_68KROM2 }, // 18 - - { "e44-07.38", 0x400000, 0xa9e28544, TAITO_ES5505_BYTESWAP }, // 19 Ensoniq Samples - { "e44-08.39", 0x400000, 0x33ba3037, TAITO_ES5505_BYTESWAP }, // 20 -}; - -STD_ROM_PICK(kirameki) -STD_ROM_FN(kirameki) - -static INT32 kiramekiInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, KIRAMEKI, 1, 0); -} - -struct BurnDriver BurnDrvKirameki = { - "kirameki", NULL, NULL, NULL, "1997", - "Kirameki Star Road (Ver 2.10J 1997/08/29)\0", "No sound", "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_QUIZ, 0, - NULL, kiramekiRomInfo, kiramekiRomName, NULL, NULL, F3InputInfo, NULL, - kiramekiInit, DrvExit, DrvFrame, DrvDraw224A, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 224, 4, 3 -}; - - -// Puchi Carat (Ver 2.02O 1997/10/29) - -static struct BurnRomInfo puchicarRomDesc[] = { - { "e46-16", 0x080000, 0xcf2accdf, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e46-15", 0x080000, 0xc32c6ed8, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e46-14", 0x080000, 0xa154c300, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e46-18", 0x080000, 0x396e3122, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e46-06", 0x200000, 0xb74336f2, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e46-04", 0x200000, 0x463ecc4c, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e46-05", 0x200000, 0x83a32eee, TAITO_SPRITESA_BYTESWAP }, // 6 - { "e46-03", 0x200000, 0xeb768193, TAITO_SPRITESA_BYTESWAP }, // 7 - { "e46-02", 0x200000, 0xfb046018, TAITO_SPRITESA }, // 8 - { "e46-01", 0x200000, 0x34fc2103, TAITO_SPRITESA }, // 9 - - { "e46-12", 0x100000, 0x1f3a9851, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "e46-11", 0x100000, 0xe9f10bf1, TAITO_CHARS_BYTESWAP }, // 11 - { "e46-10", 0x100000, 0x1999b76a, TAITO_CHARS }, // 12 - - { "e46-21", 0x040000, 0xb466cff6, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "e46-22", 0x040000, 0xc67b767e, TAITO_68KROM2_BYTESWAP }, // 14 - - { "e46-07", 0x200000, 0xf20af91e, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "e46-08", 0x200000, 0xf7f96e1d, TAITO_ES5505_BYTESWAP }, // 16 - { "e46-09", 0x200000, 0x824135f8, TAITO_ES5505_BYTESWAP }, // 17 - - { "pal16l8a-d77-09a.bin", 0x104, 0xb371532b, BRF_OPT }, // 14 plds - { "pal16l8a-d77-10a.bin", 0x104, 0x42f59227, BRF_OPT }, // 15 - { "palce16v8q-d77-11a.bin", 0x117, 0xeacc294e, BRF_OPT }, // 16 - { "palce16v8q-d77-12a.bin", 0x117, 0xe9920cfe, BRF_OPT }, // 17 - { "palce16v8q-d77-15a.bin", 0x117, 0x0edf820a, BRF_OPT },// 18 -}; - -STD_ROM_PICK(puchicar) -STD_ROM_FN(puchicar) - -static INT32 puchicarInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, PUCHICAR, 1, 0); -} - -struct BurnDriver BurnDrvPuchicar = { - "puchicar", NULL, NULL, NULL, "1997", - "Puchi Carat (Ver 2.02O 1997/10/29)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, puchicarRomInfo, puchicarRomName, NULL, NULL, F3InputInfo, NULL, - puchicarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puchi Carat (Ver 2.02J 1997/10/29) - -static struct BurnRomInfo puchicarjRomDesc[] = { - { "e46-16", 0x080000, 0xcf2accdf, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e46-15", 0x080000, 0xc32c6ed8, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e46-14", 0x080000, 0xa154c300, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e46.13", 0x080000, 0x59fbdf3a, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e46-06", 0x200000, 0xb74336f2, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e46-04", 0x200000, 0x463ecc4c, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e46-05", 0x200000, 0x83a32eee, TAITO_SPRITESA_BYTESWAP }, // 6 - { "e46-03", 0x200000, 0xeb768193, TAITO_SPRITESA_BYTESWAP }, // 7 - { "e46-02", 0x200000, 0xfb046018, TAITO_SPRITESA }, // 8 - { "e46-01", 0x200000, 0x34fc2103, TAITO_SPRITESA }, // 9 - - { "e46-12", 0x100000, 0x1f3a9851, TAITO_CHARS_BYTESWAP }, // 10 Layer Tiles - { "e46-11", 0x100000, 0xe9f10bf1, TAITO_CHARS_BYTESWAP }, // 11 - { "e46-10", 0x100000, 0x1999b76a, TAITO_CHARS }, // 12 - - { "e46-19", 0x040000, 0x2624eba0, TAITO_68KROM2_BYTESWAP }, // 13 68k Code - { "e46-20", 0x040000, 0x065e934f, TAITO_68KROM2_BYTESWAP }, // 14 - - { "e46-07", 0x200000, 0xf20af91e, TAITO_ES5505_BYTESWAP }, // 15 Ensoniq Samples - { "e46-08", 0x200000, 0xf7f96e1d, TAITO_ES5505_BYTESWAP }, // 16 - { "e46-09", 0x200000, 0x824135f8, TAITO_ES5505_BYTESWAP }, // 17 - - { "pal16l8a-d77-09a.bin", 0x104, 0xb371532b, BRF_OPT }, // 14 plds - { "pal16l8a-d77-10a.bin", 0x104, 0x42f59227, BRF_OPT }, // 15 - { "palce16v8q-d77-11a.bin", 0x117, 0xeacc294e, BRF_OPT }, // 16 - { "palce16v8q-d77-12a.bin", 0x117, 0xe9920cfe, BRF_OPT }, // 17 - { "palce16v8q-d77-15a.bin", 0x117, 0x0edf820a, BRF_OPT },// 18 -}; - -STD_ROM_PICK(puchicarj) -STD_ROM_FN(puchicarj) - -struct BurnDriver BurnDrvPuchicarj = { - "puchicarj", "puchicar", NULL, NULL, "1997", - "Puchi Carat (Ver 2.02J 1997/10/29)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, puchicarjRomInfo, puchicarjRomName, NULL, NULL, F3InputInfo, NULL, - puchicarInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puzzle Bobble 4 (Ver 2.04O 1997/12/19) - -static struct BurnRomInfo pbobble4RomDesc[] = { - { "e49-12.20", 0x080000, 0xfffea203, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e49-11.19", 0x080000, 0xbf69a087, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e49-10.18", 0x080000, 0x0307460b, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e49-16.17", 0x080000, 0x0a021624, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e49-02", 0x100000, 0xc7d2f40b, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e49-01", 0x100000, 0xa3dd5f85, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e49-08", 0x100000, 0x87408106, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e49-07", 0x100000, 0x1e1e8e1c, TAITO_CHARS_BYTESWAP }, // 7 - { "e49-06", 0x100000, 0xec85f7ce, TAITO_CHARS }, // 8 - - { "e49-13.32", 0x040000, 0x83536f7f, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e49-14.33", 0x040000, 0x19815bdb, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e49-03", 0x200000, 0xf64303e0, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e49-04", 0x200000, 0x09be229c, TAITO_ES5505_BYTESWAP }, // 12 - { "e49-05", 0x200000, 0x5ce90ee2, TAITO_ES5505_BYTESWAP }, // 13 - - { "pal16l8a-d77-09.bin", 0x104, 0xb371532b, BRF_OPT }, // 14 plds - { "pal16l8a-d77-10.bin", 0x104, 0x42f59227, BRF_OPT }, // 15 - { "palce16v8q-d77-11.bin", 0x117, 0xeacc294e, BRF_OPT }, // 16 - { "palce16v8q-d77-12.bin", 0x117, 0xe9920cfe, BRF_OPT }, // 17 - { "palce16v8q-d77-15.bin", 0x117, 0x00000000, BRF_NODUMP },// 18 -}; - -STD_ROM_PICK(pbobble4) -STD_ROM_FN(pbobble4) - -static INT32 pbobble4Init() -{ - return DrvInit(NULL, f3_24bit_palette_update, 0, PBOBBLE4, 1, 0x4053c0); -} - -struct BurnDriver BurnDrvPbobble4 = { - "pbobble4", NULL, NULL, NULL, "1997", - "Puzzle Bobble 4 (Ver 2.04O 1997/12/19)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble4RomInfo, pbobble4RomName, NULL, NULL, F3InputInfo, NULL, - pbobble4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puzzle Bobble 4 (Ver 2.04J 1997/12/19) - -static struct BurnRomInfo pbobble4jRomDesc[] = { - { "e49-12.20", 0x080000, 0xfffea203, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e49-11.19", 0x080000, 0xbf69a087, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e49-10.18", 0x080000, 0x0307460b, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e49-09.17", 0x080000, 0xe40c7708, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e49-02", 0x100000, 0xc7d2f40b, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e49-01", 0x100000, 0xa3dd5f85, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e49-08", 0x100000, 0x87408106, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e49-07", 0x100000, 0x1e1e8e1c, TAITO_CHARS_BYTESWAP }, // 7 - { "e49-06", 0x100000, 0xec85f7ce, TAITO_CHARS }, // 8 - - { "e49-13.32", 0x040000, 0x83536f7f, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e49-14.33", 0x040000, 0x19815bdb, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e49-03", 0x200000, 0xf64303e0, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e49-04", 0x200000, 0x09be229c, TAITO_ES5505_BYTESWAP }, // 12 - { "e49-05", 0x200000, 0x5ce90ee2, TAITO_ES5505_BYTESWAP }, // 13 - - { "pal16l8a-d77-09.bin", 0x104, 0xb371532b, BRF_OPT }, // 14 plds - { "pal16l8a-d77-10.bin", 0x104, 0x42f59227, BRF_OPT }, // 15 - { "palce16v8q-d77-11.bin", 0x117, 0xeacc294e, BRF_OPT }, // 16 - { "palce16v8q-d77-12.bin", 0x117, 0xe9920cfe, BRF_OPT }, // 17 - { "palce16v8q-d77-15.bin", 0x117, 0x00000000, BRF_NODUMP },// 18 -}; - -STD_ROM_PICK(pbobble4j) -STD_ROM_FN(pbobble4j) - -struct BurnDriver BurnDrvPbobble4j = { - "pbobble4j", "pbobble4", NULL, NULL, "1997", - "Puzzle Bobble 4 (Ver 2.04J 1997/12/19)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble4jRomInfo, pbobble4jRomName, NULL, NULL, F3InputInfo, NULL, - pbobble4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Puzzle Bobble 4 (Ver 2.04A 1997/12/19) - -static struct BurnRomInfo pbobble4uRomDesc[] = { - { "e49-12.20", 0x080000, 0xfffea203, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e49-11.19", 0x080000, 0xbf69a087, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e49-10.18", 0x080000, 0x0307460b, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e49-15.17", 0x080000, 0x7d0526b2, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e49-02", 0x100000, 0xc7d2f40b, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e49-01", 0x100000, 0xa3dd5f85, TAITO_SPRITESA_BYTESWAP }, // 5 - - { "e49-08", 0x100000, 0x87408106, TAITO_CHARS_BYTESWAP }, // 6 Layer Tiles - { "e49-07", 0x100000, 0x1e1e8e1c, TAITO_CHARS_BYTESWAP }, // 7 - { "e49-06", 0x100000, 0xec85f7ce, TAITO_CHARS }, // 8 - - { "e49-13.32", 0x040000, 0x83536f7f, TAITO_68KROM2_BYTESWAP }, // 9 68k Code - { "e49-14.33", 0x040000, 0x19815bdb, TAITO_68KROM2_BYTESWAP }, // 10 - - { "e49-03", 0x200000, 0xf64303e0, TAITO_ES5505_BYTESWAP }, // 11 Ensoniq Samples - { "e49-04", 0x200000, 0x09be229c, TAITO_ES5505_BYTESWAP }, // 12 - { "e49-05", 0x200000, 0x5ce90ee2, TAITO_ES5505_BYTESWAP }, // 13 - - { "pal16l8a-d77-09.bin", 0x104, 0xb371532b, BRF_OPT }, // 14 plds - { "pal16l8a-d77-10.bin", 0x104, 0x42f59227, BRF_OPT }, // 15 - { "palce16v8q-d77-11.bin", 0x117, 0xeacc294e, BRF_OPT }, // 16 - { "palce16v8q-d77-12.bin", 0x117, 0xe9920cfe, BRF_OPT }, // 17 - { "palce16v8q-d77-15.bin", 0x117, 0x00000000, BRF_NODUMP },// 18 -}; - -STD_ROM_PICK(pbobble4u) -STD_ROM_FN(pbobble4u) - -struct BurnDriver BurnDrvPbobble4u = { - "pbobble4u", "pbobble4", NULL, NULL, "1997", - "Puzzle Bobble 4 (Ver 2.04A 1997/12/19)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, pbobble4uRomInfo, pbobble4uRomName, NULL, NULL, F3InputInfo, NULL, - pbobble4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Pop'n Pop (Ver 2.07O 1998/02/09) - -static struct BurnRomInfo popnpopRomDesc[] = { - { "e51-12.20", 0x080000, 0x86a237d5, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e51-11.19", 0x080000, 0x8a49f34f, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e51-10.18", 0x080000, 0x4bce68f8, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e51-16.17", 0x080000, 0x2a9d8e0f, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e51-03.12", 0x100000, 0xa24c4607, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e51-02.8", 0x100000, 0x6aa8b96c, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e51-01.4", 0x100000, 0x70347e24, TAITO_SPRITESA }, // 6 - - { "e51-08.47", 0x200000, 0x3ad41f02, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e51-07.45", 0x200000, 0x95873e46, TAITO_CHARS_BYTESWAP }, // 8 - { "e51-06.43", 0x200000, 0xc240d6c8, TAITO_CHARS }, // 9 - - { "e51-13.32", 0x040000, 0x3b9e3986, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e51-14.33", 0x040000, 0x1f9a5015, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e51-04.38", 0x200000, 0x66790f55, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e51-05.41", 0x200000, 0x4d08b26d, TAITO_ES5505_BYTESWAP }, // 13 - - { "pal16l8a-d77-09.ic14", 0x104, 0xb371532b, 0 }, // 14 plds - { "pal16l8a-d77-10.ic28", 0x104, 0x42f59227, 0 }, // 15 - { "palce16v8q-d77-11.ic37", 0x117, 0xeacc294e, 0 }, // 16 - { "palce16v8q-d77-12.ic48", 0x117, 0xe9920cfe, 0 }, // 17 - { "palce16v8q-d77-15.ic21", 0x117, 0x00000000, 0 | BRF_NODUMP },// 18 -}; - -STD_ROM_PICK(popnpop) -STD_ROM_FN(popnpop) - -static INT32 popnpopInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, POPNPOP, 1, 0); -} - -struct BurnDriver BurnDrvPopnpop = { - "popnpop", NULL, NULL, NULL, "1997", - "Pop'n Pop (Ver 2.07O 1998/02/09)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, popnpopRomInfo, popnpopRomName, NULL, NULL, F3InputInfo, NULL, - popnpopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Pop'n Pop (Ver 2.07J 1998/02/09) - -static struct BurnRomInfo popnpopjRomDesc[] = { - { "e51-12.20", 0x080000, 0x86a237d5, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e51-11.19", 0x080000, 0x8a49f34f, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e51-10.18", 0x080000, 0x4bce68f8, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e51-09.17", 0x080000, 0x4a086017, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e51-03.12", 0x100000, 0xa24c4607, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e51-02.8", 0x100000, 0x6aa8b96c, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e51-01.4", 0x100000, 0x70347e24, TAITO_SPRITESA }, // 6 - - { "e51-08.47", 0x200000, 0x3ad41f02, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e51-07.45", 0x200000, 0x95873e46, TAITO_CHARS_BYTESWAP }, // 8 - { "e51-06.43", 0x200000, 0xc240d6c8, TAITO_CHARS }, // 9 - - { "e51-13.32", 0x040000, 0x3b9e3986, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e51-14.33", 0x040000, 0x1f9a5015, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e51-04.38", 0x200000, 0x66790f55, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e51-05.41", 0x200000, 0x4d08b26d, TAITO_ES5505_BYTESWAP }, // 13 - - { "pal16l8a-d77-09.ic14", 0x104, 0xb371532b, 0 }, // 14 plds - { "pal16l8a-d77-10.ic28", 0x104, 0x42f59227, 0 }, // 15 - { "palce16v8q-d77-11.ic37", 0x117, 0xeacc294e, 0 }, // 16 - { "palce16v8q-d77-12.ic48", 0x117, 0xe9920cfe, 0 }, // 17 - { "palce16v8q-d77-15.ic21", 0x117, 0x00000000, 0 | BRF_NODUMP },// 18 -}; - -STD_ROM_PICK(popnpopj) -STD_ROM_FN(popnpopj) - -struct BurnDriver BurnDrvPopnpopj = { - "popnpopj", "popnpop", NULL, NULL, "1997", - "Pop'n Pop (Ver 2.07J 1998/02/09)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, popnpopjRomInfo, popnpopjRomName, NULL, NULL, F3InputInfo, NULL, - popnpopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Pop'n Pop (Ver 2.07A 1998/02/09) - -static struct BurnRomInfo popnpopuRomDesc[] = { - { "e51-12.20", 0x080000, 0x86a237d5, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e51-11.19", 0x080000, 0x8a49f34f, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e51-10.18", 0x080000, 0x4bce68f8, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e51-15.17", 0x080000, 0x1ad77903, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e51-03.12", 0x100000, 0xa24c4607, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e51-02.8", 0x100000, 0x6aa8b96c, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e51-01.4", 0x100000, 0x70347e24, TAITO_SPRITESA }, // 6 - - { "e51-08.47", 0x200000, 0x3ad41f02, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e51-07.45", 0x200000, 0x95873e46, TAITO_CHARS_BYTESWAP }, // 8 - { "e51-06.43", 0x200000, 0xc240d6c8, TAITO_CHARS }, // 9 - - { "e51-13.32", 0x040000, 0x3b9e3986, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e51-14.33", 0x040000, 0x1f9a5015, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e51-04.38", 0x200000, 0x66790f55, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e51-05.41", 0x200000, 0x4d08b26d, TAITO_ES5505_BYTESWAP }, // 13 - - { "pal16l8a-d77-09.ic14", 0x104, 0xb371532b, 0 }, // 14 plds - { "pal16l8a-d77-10.ic28", 0x104, 0x42f59227, 0 }, // 15 - { "palce16v8q-d77-11.ic37", 0x117, 0xeacc294e, 0 }, // 16 - { "palce16v8q-d77-12.ic48", 0x117, 0xe9920cfe, 0 }, // 17 - { "palce16v8q-d77-15.ic21", 0x117, 0x00000000, 0 | BRF_NODUMP },// 18 -}; - -STD_ROM_PICK(popnpopu) -STD_ROM_FN(popnpopu) - -struct BurnDriver BurnDrvPopnpopu = { - "popnpopu", "popnpop", NULL, NULL, "1997", - "Pop'n Pop (Ver 2.07A 1998/02/09)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, popnpopuRomInfo, popnpopuRomName, NULL, NULL, F3InputInfo, NULL, - popnpopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Land Maker (Ver 2.01J 1998/06/01) - -static struct BurnRomInfo landmakrRomDesc[] = { - { "e61-13.20", 0x080000, 0x0af756a2, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "e61-12.19", 0x080000, 0x636b3df9, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "e61-11.18", 0x080000, 0x279a0ee4, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "e61-10.17", 0x080000, 0xdaabf2b2, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "e61-03.12", 0x200000, 0xe8abfc46, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "e61-02.08", 0x200000, 0x1dc4a164, TAITO_SPRITESA_BYTESWAP }, // 5 - { "e61-01.04", 0x200000, 0x6cdd8311, TAITO_SPRITESA }, // 6 - - { "e61-09.47", 0x200000, 0x6ba29987, TAITO_CHARS_BYTESWAP }, // 7 Layer Tiles - { "e61-08.45", 0x200000, 0x76c98e14, TAITO_CHARS_BYTESWAP }, // 8 - { "e61-07.43", 0x200000, 0x4a57965d, TAITO_CHARS }, // 9 - - { "e61-14.32", 0x020000, 0xb905f4a7, TAITO_68KROM2_BYTESWAP }, // 10 68k Code - { "e61-15.33", 0x020000, 0x87909869, TAITO_68KROM2_BYTESWAP }, // 11 - - { "e61-04.38", 0x200000, 0xc27aec0c, TAITO_ES5505_BYTESWAP }, // 12 Ensoniq Samples - { "e61-05.39", 0x200000, 0x83920d9d, TAITO_ES5505_BYTESWAP }, // 13 - { "e61-06.40", 0x200000, 0x2e717bfe, TAITO_ES5505_BYTESWAP }, // 14 -}; - -STD_ROM_PICK(landmakr) -STD_ROM_FN(landmakr) - -static INT32 landmakrInit() -{ - return DrvInit(NULL, f3_24bit_palette_update, 1, LANDMAKR, 1, 0x400826); -} - -struct BurnDriver BurnDrvLandmakr = { - "landmakr", NULL, NULL, NULL, "1998", - "Land Maker (Ver 2.01J 1998/06/01)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, landmakrRomInfo, landmakrRomName, NULL, NULL, F3InputInfo, NULL, - landmakrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; - - -// Land Maker (Ver 2.02O 1998/06/02) (Prototype) - -static struct BurnRomInfo landmakrpRomDesc[] = { - { "mpro-3.60", 0x80000, 0xf92eccd0, TAITO_68KROM1_BYTESWAP32 }, // 0 68ec20 Code - { "mpro-2.61", 0x80000, 0x5a26c9e0, TAITO_68KROM1_BYTESWAP32 }, // 1 - { "mpro-1.62", 0x80000, 0x710776a8, TAITO_68KROM1_BYTESWAP32 }, // 2 - { "mpro-0.63", 0x80000, 0xbc71dd2f, TAITO_68KROM1_BYTESWAP32 }, // 3 - - { "obj0-0.8", 0x80000, 0x4b862c1b, TAITO_SPRITESA_BYTESWAP }, // 4 Sprites - { "obj0-1.20", 0x80000, 0x1dc6e1ae, TAITO_SPRITESA_BYTESWAP }, // 5 - { "obj1-0.7", 0x80000, 0x90502355, TAITO_SPRITESA_BYTESWAP }, // 6 - { "obj1-1.19", 0x80000, 0xa24edb24, TAITO_SPRITESA_BYTESWAP }, // 7 - { "obj2-0.6", 0x80000, 0x3bffe4b2, TAITO_SPRITESA_BYTESWAP }, // 8 - { "obj2-1.18", 0x80000, 0x1b2a87f3, TAITO_SPRITESA_BYTESWAP }, // 9 - { "obj3-0.5", 0x80000, 0x3a0e1479, TAITO_SPRITESA_BYTESWAP }, // 10 - { "obj3-1.17", 0x80000, 0xc7e91180, TAITO_SPRITESA_BYTESWAP }, // 11 - { "obj0-2.32", 0x80000, 0x94cc01d0, TAITO_SPRITESA }, // 12 - { "obj1-2.31", 0x80000, 0xc2757722, TAITO_SPRITESA }, // 13 - { "obj2-2.30", 0x80000, 0x934556ff, TAITO_SPRITESA }, // 14 - { "obj3-2.29", 0x80000, 0x97f0f777, TAITO_SPRITESA }, // 15 - - { "scr0-0.7", 0x80000, 0xda6ba562, TAITO_CHARS_BYTESWAP32 }, // 16 Layer Tiles - { "scr0-2.5", 0x80000, 0x36756b9c, TAITO_CHARS_BYTESWAP32 }, // 17 - { "scr0-1.6", 0x80000, 0x8c201d27, TAITO_CHARS_BYTESWAP32 }, // 18 - { "scr0-3.4", 0x80000, 0x4e0274f3, TAITO_CHARS_BYTESWAP32 }, // 19 - { "scr1-0.19", 0x80000, 0x2689f716, TAITO_CHARS_BYTESWAP32 }, // 20 - { "scr1-2.17", 0x80000, 0x7841468a, TAITO_CHARS_BYTESWAP32 }, // 21 - { "scr1-1.18", 0x80000, 0xf3086949, TAITO_CHARS_BYTESWAP32 }, // 22 - { "scr1-3.16", 0x80000, 0x926ad229, TAITO_CHARS_BYTESWAP32 }, // 23 - { "scr0-4.3", 0x80000, 0x5b3cf564, TAITO_CHARS_BYTESWAP }, // 24 - { "scr0-5.2", 0x80000, 0x8e1ea0fe, TAITO_CHARS_BYTESWAP }, // 25 - { "scr1-4.15", 0x80000, 0x783b6d10, TAITO_CHARS_BYTESWAP }, // 26 - { "scr1-5.14", 0x80000, 0x24aba128, TAITO_CHARS_BYTESWAP }, // 27 - - { "spro-1.66", 0x40000, 0x18961bbb, TAITO_68KROM2_BYTESWAP }, // 28 68k Code - { "spro-0.65", 0x40000, 0x2c64557a, TAITO_68KROM2_BYTESWAP }, // 29 - - { "snd-0.43", 0x80000, 0x0e5ef5c8, TAITO_ES5505_BYTESWAP }, // 30 Ensoniq Samples - { "snd-1.44", 0x80000, 0x2998fd65, TAITO_ES5505_BYTESWAP }, // 31 - { "snd-2.45", 0x80000, 0xda7477ad, TAITO_ES5505_BYTESWAP }, // 32 - { "snd-3.46", 0x80000, 0x141670b9, TAITO_ES5505_BYTESWAP }, // 33 - { "snd-4.32", 0x80000, 0xe9dc18f6, TAITO_ES5505_BYTESWAP }, // 34 - { "snd-5.33", 0x80000, 0x8af91ca8, TAITO_ES5505_BYTESWAP }, // 35 - { "snd-6.34", 0x80000, 0x6f520b82, TAITO_ES5505_BYTESWAP }, // 36 - { "snd-7.35", 0x80000, 0x69410f0f, TAITO_ES5505_BYTESWAP }, // 37 - { "snd-8.20", 0x80000, 0xd98c275e, TAITO_ES5505_BYTESWAP }, // 38 - { "snd-9.21", 0x80000, 0x82a76cfc, TAITO_ES5505_BYTESWAP }, // 39 - { "snd-10.22", 0x80000, 0x0345f585, TAITO_ES5505_BYTESWAP }, // 40 - { "snd-11.23", 0x80000, 0x4caf571a, TAITO_ES5505_BYTESWAP }, // 41 -}; - -STD_ROM_PICK(landmakrp) -STD_ROM_FN(landmakrp) - -static INT32 landmakrpRomCallback() -{ - UINT32 *ROM = (UINT32 *)Taito68KRom1; - - ROM[0x1ffff8 / 4] = 0xffffffff; - ROM[0x1ffffc / 4] = 0x0003ffff; - - return 0; -} - -static INT32 landmakrpInit() -{ - return DrvInit(landmakrpRomCallback, f3_24bit_palette_update, 1, LANDMAKR, 1, 0); -} - -struct BurnDriver BurnDrvLandmakrp = { - "landmakrp", "landmakr", NULL, NULL, "1998", - "Land Maker (Ver 2.02O 1998/06/02) (Prototype)\0", NULL, "Taito Corporation", "F3 System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, landmakrpRomInfo, landmakrpRomName, NULL, NULL, F3InputInfo, NULL, - landmakrpInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &TaitoF3PalRecalc, 0x2000, - 320, 232, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_taitoh.cpp b/jan/src/burn/drv/taito/d_taitoh.cpp deleted file mode 100644 index e1d04189a..000000000 --- a/jan/src/burn/drv/taito/d_taitoh.cpp +++ /dev/null @@ -1,2175 +0,0 @@ -// FB Alpha Taito System H driver module -// Based on MAME driver by Yochizo and Nicola Salmoria - -// Weirdness: -// DLeagueJ's sprites get covered up on the right side of the screen, see temp. -// fix in DleagueJDraw(); - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "taito.h" -#include "taito_ic.h" -#include "burn_ym2610.h" - -static UINT8 *TaitoDirtyTile; -static UINT16 *TaitoTempBitmap[2]; -static INT32 address_xor; -static UINT8 *transparent_tile_lut; -static INT32 screen_y_adjust; -static INT32 screen_x_adjust; -static UINT8 flipscreen; -static INT32 irq_config; -static UINT8 TaitoInputConfig; - -static UINT8 DrvJoy1[8]; // Syvalion synthesized digital inputs - -static INT32 syvalionpmode = 0; - -static INT32 DrvAnalogPort0 = 0; -static INT32 DrvAnalogPort1 = 0; -static INT32 DrvAnalogPort2 = 0; -static INT32 DrvAnalogPort3 = 0; - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo SyvalionInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort0 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p1 fire 1" }, - A("P1 Paddle X", BIT_ANALOG_REL, &DrvAnalogPort0, "p1 x-axis" ), - A("P1 Paddle Y", BIT_ANALOG_REL, &DrvAnalogPort1, "p1 y-axis" ), - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort0 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy1 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy1 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy1 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy1 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "p2 fire 1" }, - A("P2 Paddle X", BIT_ANALOG_REL, &DrvAnalogPort2, "p2 x-axis" ), - A("P2 Paddle Y", BIT_ANALOG_REL, &DrvAnalogPort3, "p2 y-axis" ), - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; -#undef A - -STDINPUTINFO(Syvalion) - -static struct BurnInputInfo TetristhInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Tetristh) - -static struct BurnInputInfo RecordbrInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, TC0220IOCInputPort2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Recordbr) - -static struct BurnInputInfo DleagueInputList[] = { - {"P1 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, TC0220IOCInputPort0 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, TC0220IOCInputPort1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, TC0220IOCInputPort1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, TC0220IOCInputPort1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, TC0220IOCInputPort1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, TC0220IOCInputPort2 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, TC0220IOCInputPort2 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, TC0220IOCInputPort0 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, TC0220IOCInputPort0 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, TC0220IOCInputPort1 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, TC0220IOCInputPort1 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, TC0220IOCInputPort1 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, TC0220IOCInputPort1 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, TC0220IOCInputPort2 + 2, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, TC0220IOCInputPort2 + 3, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &TaitoReset, "reset" }, - {"Service", BIT_DIGITAL, TC0220IOCInputPort0 + 0, "service" }, - {"Tilt", BIT_DIGITAL, TC0220IOCInputPort0 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, TC0220IOCDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, TC0220IOCDip + 1, "dip" }, -}; - -STDINPUTINFO(Dleague) - -static struct BurnDIPInfo SyvalionDIPList[]= -{ - {0x15, 0xff, 0xff, 0xfe, NULL }, - {0x16, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 1, "Cabinet" }, - {0x15, 0x01, 0x01, 0x00, "Upright" }, - //{0x15, 0x01, 0x01, 0x01, "Cocktail" }, //needs screen flipping for this to work - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x08, "1000k" }, - {0x16, 0x01, 0x0c, 0x0c, "1500k" }, - {0x16, 0x01, 0x0c, 0x04, "2000k" }, - {0x16, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x00, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x20, "4" }, - {0x16, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x16, 0x01, 0x40, 0x40, "Off" }, - {0x16, 0x01, 0x40, 0x00, "On" }, -}; - -STDDIPINFO(Syvalion) - -static struct BurnDIPInfo TetristhDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x11, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, -}; - -STDDIPINFO(Tetristh) - -static struct BurnDIPInfo RecordbrDIPList[]= -{ - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 0, "Flip Screen" }, - {0x0d, 0x01, 0x02, 0x02, "Off" }, - {0x0d, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0d, 0x01, 0x04, 0x04, "Off" }, - {0x0d, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x0d, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x0d, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x0d, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0d, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0e, 0x01, 0x03, 0x02, "Easy" }, - {0x0e, 0x01, 0x03, 0x03, "Medium" }, - {0x0e, 0x01, 0x03, 0x01, "Hard" }, - {0x0e, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Recordbr) - -static struct BurnDIPInfo GogoldDIPList[]= -{ - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 0, "Flip Screen" }, - {0x0d, 0x01, 0x02, 0x02, "Off" }, - {0x0d, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x0d, 0x01, 0x04, 0x04, "Off" }, - {0x0d, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 2, "Coin A" }, - {0x0d, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x0d, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x0e, 0x01, 0x03, 0x02, "Easy" }, - {0x0e, 0x01, 0x03, 0x03, "Medium" }, - {0x0e, 0x01, 0x03, 0x01, "Hard" }, - {0x0e, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Gogold) - -static struct BurnDIPInfo DleagueDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x01, 0x01, "Constant" }, - {0x13, 0x01, 0x01, 0x00, "Based on Inning" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Price to Continue" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "Same as Start" }, - - {0 , 0xfe, 0 , 0, "Extra Credit Needed" }, - {0x14, 0x01, 0x0c, 0x08, "After Inning 6" }, - {0x14, 0x01, 0x0c, 0x00, "After Innings 5 and 7" }, - {0x14, 0x01, 0x0c, 0x0c, "After Innings 3 and 6" }, - {0x14, 0x01, 0x0c, 0x04, "After Innings 3, 5 and 7" }, -}; - -STDDIPINFO(Dleague) - -static struct BurnDIPInfo DleaguejDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x13, 0x01, 0x01, 0x01, "Constant" }, - {0x13, 0x01, 0x01, 0x00, "Based on Inning" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 0, "Extra Credit Needed" }, - {0x14, 0x01, 0x0c, 0x08, "After Inning 6" }, - {0x14, 0x01, 0x0c, 0x00, "After Innings 5 and 7" }, - {0x14, 0x01, 0x0c, 0x0c, "After Innings 3 and 6" }, - {0x14, 0x01, 0x0c, 0x04, "After Innings 3, 5 and 7" }, -}; - -STDDIPINFO(Dleaguej) - -static void __fastcall syvalion_main_write_word(UINT32 address, UINT16 data) -{ - switch (address ^ address_xor) - { - case 0x200000: - case 0x200001: - TC0220IOCWrite(0, data & 0xff); - return; - - case 0x200002: - case 0x200003: - TC0220IOCHalfWordPortWrite(data & 0xff); - return; - - case 0x300000: - case 0x300001: - TC0140SYTPortWrite(data & 0xff); - return; - - case 0x300002: - case 0x300003: - TC0140SYTCommWrite(data & 0xff); - return; - } -} - -static void __fastcall syvalion_main_write_byte(UINT32 address, UINT8 data) -{ - switch (address ^ address_xor) - { - case 0x200000: - case 0x200001: - TC0220IOCWrite(0, data & 0xff); - return; - - case 0x200002: - case 0x200003: - TC0220IOCHalfWordPortWrite(data & 0xff); - return; - - case 0x300000: - case 0x300001: - TC0140SYTPortWrite(data & 0xff); - return; - - case 0x300002: - case 0x300003: - TC0140SYTCommWrite(data & 0xff); - return; - } -} - -// coord-buffers. syvalion expects each coord to return 0 if there was no -// change since the last read. -static INT32 PaddleX[2] = { 0, 0 }; -static INT32 PaddleY[2] = { 0, 0 }; -static INT32 PaddleX2[2] = { 0, 0 }; -static INT32 PaddleY2[2] = { 0, 0 }; - -static INT32 Paddle_read(INT32 PaddlePortnum, INT32 *Paddle_X) { - if (PaddlePortnum != *Paddle_X) { - *Paddle_X = PaddlePortnum; - return PaddlePortnum / 4; - } else { - return 0; - } -} - -static UINT8 syvalion_extended_read() -{ - static UINT8 DOWN_LATCH[2] = { 0, 0 }; - // Simulating digital inputs in Syvalion notes - dink aug.2016 - // when down is pressed, the body goes "down" but the head points "up". - // this is solved by latching the down button(s) and returning 0xf2 in - // the next read of the "up" port. (then, of course, clearing the latch) - - UINT8 port = TC0220IOCPortRead(); - - UINT8 ret = 0; - - INT32 AnalogPorts[2][2] = {{ DrvAnalogPort0, DrvAnalogPort1 }, { DrvAnalogPort2, DrvAnalogPort3 }}; - INT32 DigitalPorts[2][4] = {{ DrvJoy1[0], DrvJoy1[1], DrvJoy1[3], DrvJoy1[2] }, { DrvJoy1[4], DrvJoy1[5], DrvJoy1[7], DrvJoy1[6] }}; - - if (syvalionpmode) { - AnalogPorts[0][0] = DrvAnalogPort1; - AnalogPorts[0][1] = 0-DrvAnalogPort0; - AnalogPorts[1][0] = DrvAnalogPort3; - AnalogPorts[1][1] = 0-DrvAnalogPort2; - - DigitalPorts[0][0] = DrvJoy1[3]; // p1 - DigitalPorts[0][1] = DrvJoy1[2]; - DigitalPorts[0][2] = DrvJoy1[1]; - DigitalPorts[0][3] = DrvJoy1[0]; - - DigitalPorts[1][0] = DrvJoy1[5]; // p2 - DigitalPorts[1][1] = DrvJoy1[4]; - DigitalPorts[1][2] = DrvJoy1[7]; - DigitalPorts[1][3] = DrvJoy1[6]; - } - - if (port < 8) ret = TC0220IOCRead(port); - - UINT8 plrnum = ((port & 4) >> 2) ^ 1; - if (!syvalionpmode) { - switch (port & ~4) // [syvalion] Syvalion (Japan) - { - // P2 UP - case 0x08: if (DigitalPorts[plrnum][0]) return 0x10; - else if (DOWN_LATCH[plrnum]) { DOWN_LATCH[plrnum] = 0; return 0xf2; } - else { - ret = PaddleY2[plrnum]&0xff; PaddleY2[plrnum] = 0; - break; - } - // P2 DOWN - case 0x09: if (DigitalPorts[plrnum][1]) { DOWN_LATCH[plrnum] = 1; return 0xff; } - else { - PaddleY2[plrnum] = 0-Paddle_read(AnalogPorts[plrnum][1], &PaddleY[plrnum]); - ret = (PaddleY2[plrnum] & 0x3000) ? 0xff : 0x00; - break; - } - // P2 RIGHT - case 0x0a: if (DigitalPorts[plrnum][2]) return 0x10; - else { - ret = PaddleX2[plrnum]&0xff; PaddleX2[plrnum] = 0; - break; - } - // P2 LEFT - case 0x0b: if (DigitalPorts[plrnum][3]) return 0xff; - else { - PaddleX2[plrnum] = Paddle_read(AnalogPorts[plrnum][0], &PaddleX[plrnum]); - ret = (PaddleX2[plrnum] & 0x3000) ? 0xff : 0x00; - break; - } - } - } else { - switch (port & ~4) // [syvalionp] Syvalion (World, prototype) - { - // P1 RIGHT - case 0x08: if (DigitalPorts[plrnum][0]) return 0x10; - else { - ret = PaddleY2[plrnum]&0xff; PaddleY2[plrnum] = 0; - break; - } - // P1 LEFT - case 0x09: if (DigitalPorts[plrnum][1]) return 0xff; - else { - PaddleY2[plrnum] = 0-Paddle_read(AnalogPorts[plrnum][1], &PaddleY[plrnum]); - ret = (PaddleY2[plrnum] & 0x3000) ? 0xff : 0x00; - break; - } - // P1 DOWN - case 0x0a: if (DigitalPorts[plrnum][2]) return 0x10; - else if (DOWN_LATCH[plrnum]) { DOWN_LATCH[plrnum] = 0; return 0xf2; } - else { - ret = PaddleX2[plrnum]&0xff; PaddleX2[plrnum] = 0; - break; - } - // P1 UP - case 0x0b: if (DigitalPorts[plrnum][3]) { DOWN_LATCH[plrnum] = 1; return 0xff; } - else { - PaddleX2[plrnum] = Paddle_read(AnalogPorts[plrnum][0], &PaddleX[plrnum]); - ret = (PaddleX2[plrnum] & 0x3000) ? 0xff : 0x00; - break; - } - } - } - return ret; -} - -static UINT16 __fastcall syvalion_main_read_word(UINT32 address) -{ - switch (address ^ address_xor) - { - case 0x200000: - case 0x200001: - return syvalion_extended_read(); - - case 0x200002: - case 0x200003: - return TC0220IOCPortRead(); - - case 0x300002: - case 0x300003: - return TC0140SYTCommRead(); - } - - return 0; -} - -static UINT8 __fastcall syvalion_main_read_byte(UINT32 address) -{ - switch (address ^ address_xor) - { - case 0x200000: - case 0x200001: - return syvalion_extended_read(); - - case 0x200002: - case 0x200003: - return TC0220IOCPortRead(); - - case 0x300002: - case 0x300003: - return TC0140SYTCommRead(); - } - - return 0; -} - -static void __fastcall dleague_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfffff0) == 0x200000) { - TC0220IOCWrite((address / 2) & 7, data); - return; - } - - switch (address) - { - case 0x300000: - case 0x300001: - TC0140SYTPortWrite(data & 0xff); - return; - - case 0x300002: - case 0x300003: - TC0140SYTCommWrite(data & 0xff); - return; - } -} - -static void __fastcall dleague_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfffff0) == 0x200000) { - TC0220IOCWrite((address / 2) & 7, data); - return; - } - - switch (address) - { - case 0x300000: - case 0x300001: - TC0140SYTPortWrite(data & 0xff); - return; - - case 0x300002: - case 0x300003: - TC0140SYTCommWrite(data & 0xff); - return; - } -} - -static UINT16 __fastcall dleague_main_read_word(UINT32 address) -{ - if ((address & 0xfffff0) == 0x200000) { - return TC0220IOCRead((address / 2) & 7); - } - - switch (address) - { - case 0x200002: - case 0x200003: - return TC0220IOCPortRead(); - - case 0x300002: - case 0x300003: - return TC0140SYTCommRead(); - } - - return 0; -} - -static UINT8 __fastcall dleague_main_read_byte(UINT32 address) -{ - if ((address & 0xfffff0) == 0x200000) { - return TC0220IOCRead((address / 2) & 7); - } - - switch (address) - { - case 0x200002: - case 0x200003: - return TC0220IOCPortRead(); - - case 0x300002: - case 0x300003: - return TC0140SYTCommRead(); - } - - return 0; -} - -static inline void taitob_single_char_update(INT32 offset) -{ - UINT8 *dst = TaitoCharsB + (offset * 4); - UINT8 d0 = TaitoVideoRam[offset + 0x00000]; - UINT8 d1 = TaitoVideoRam[offset + 0x00001]; - UINT8 d2 = TaitoVideoRam[offset + 0x10000]; - - for (INT32 j = 0; j < 8; j++) - { - dst[j] = ((d0 >> j) & 1) | (((d1 >> j) & 1) << 1) | (((d2 >> j) & 1) << 2); - } -} - -static void __fastcall taitoh_video_write_word(UINT32 address, UINT16 data) -{ - if (address >= 0x400000 && address <= 0x420fff) { - INT32 offset = (address & 0x3fffe) / 2; - UINT16 *ram = (UINT16*)TaitoVideoRam; - UINT16 old = ram[offset]; - ram[offset] = data; - - if ((address & 0xfec000) == 0x40c000) { - if (old != data) { - TaitoDirtyTile[offset & 0x1fff] = 1; - } - } - - if ((address & 0xfef000) == 0x400000) { - taitob_single_char_update(address & 0xffe); - return; - } - - return; - } -} - -static void __fastcall taitoh_video_write_byte(UINT32 address, UINT8 data) -{ - if (address >= 0x400000 && address <= 0x420fff) { - INT32 offset = (address & 0x3ffff) ^ 1; - UINT8 old = TaitoVideoRam[offset]; - TaitoVideoRam[offset] = data; - - if ((address & 0xfec000) == 0x40c000) { - if (old != data) { - TaitoDirtyTile[offset & 0x1fff] = 1; - } - } - - if ((address & 0xfef000) == 0x400000) { - taitob_single_char_update(address & 0xffe); - } - - return; - } -} - -static void bankswitch(INT32 data) -{ - TaitoZ80Bank = data & 3; - - ZetMapMemory(TaitoZ80Rom1 + (TaitoZ80Bank * 0x4000), 0x4000, 0x7fff, MAP_ROM); -} - -static void __fastcall taitoh_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - BurnYM2610Write(address & 3, data); - return; - - case 0xe200: - TC0140SYTSlavePortWrite(data); - return; - - case 0xe201: - TC0140SYTSlaveCommWrite(data); - return; - - case 0xe400: - case 0xe401: - case 0xe402: - // pan control - return; - - case 0xee00: - case 0xf000: - return; // nop - - case 0xf200: - bankswitch(data); - return; - } -} - -static UINT8 __fastcall taitoh_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - return BurnYM2610Read(address & 3); - - case 0xe201: - return TC0140SYTSlaveCommRead(); - - case 0xea00: - return 0; // nop - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.00; -} - -static INT32 DrvDoReset(INT32 clear_mem) -{ - if (clear_mem) { - memset (TaitoRamStart, 0, TaitoRamEnd - TaitoRamStart); - } - - memset (TaitoDirtyTile, 1, 0x2000); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - bankswitch(0); - BurnYM2610Reset(); - ZetClose(); - - TaitoICReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += 0x080000; - TaitoZ80Rom1 = Next; Next += 0x010000; - - TaitoChars = Next; Next += 0x800000; - - TaitoYM2610BRom = Next; Next += 0x080000; - TaitoYM2610ARom = Next; Next += 0x080000; - - transparent_tile_lut = Next; Next += 0x800000 / 0x100; - - TaitoPalette = (UINT32*)Next; Next += 0x0220 * sizeof(UINT32); - - TaitoDirtyTile = Next; Next += 0x002000; - - TaitoTempBitmap[0] = (UINT16*)Next; Next += 1024 * 1024 * 2; - TaitoTempBitmap[1] = (UINT16*)Next; Next += 1024 * 1024 * 2; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x010000; - TaitoPaletteRam = Next; Next += 0x000800; - TaitoVideoRam = Next; Next += 0x021000; - - TaitoZ80Ram1 = Next; Next += 0x002000; - TaitoCharsB = Next; Next += 0x004000; - - TaitoRamEnd = Next; - - TaitoMemEnd = Next; - - return 0; -} - -static void DrvTransTab() -{ - for (INT32 i = 0; i < 0x800000; i+= 0x100) - { - transparent_tile_lut[i/0x100] = 1; // mark as transparent - - for (INT32 j = 0; j < 0x100; j++) - { - if (TaitoChars[i+j]) - { - transparent_tile_lut[i/0x100] = 0; // mark as not transparent - } - } - } -} - -static INT32 DrvGfxDecode() -{ - INT32 gfxlen = TaitoCharRomSize; - - INT32 Planes[4] = { STEP4(0,1) }; - INT32 XOffs[16] = { - ((gfxlen/4)*0)*8+4, ((gfxlen/4)*0)*8, ((gfxlen/4)*0)*8+12, ((gfxlen/4)*0)*8+8, - ((gfxlen/4)*1)*8+4, ((gfxlen/4)*1)*8, ((gfxlen/4)*1)*8+12, ((gfxlen/4)*1)*8+8, - ((gfxlen/4)*2)*8+4, ((gfxlen/4)*2)*8, ((gfxlen/4)*2)*8+12, ((gfxlen/4)*2)*8+8, - ((gfxlen/4)*3)*8+4, ((gfxlen/4)*3)*8, ((gfxlen/4)*3)*8+12, ((gfxlen/4)*3)*8+8 - }; - INT32 YOffs[16] = { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x400000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, TaitoChars, 0x400000); - - GfxDecode(0x8000, 4, 16, 16, Planes, XOffs, YOffs, 0x100, tmp, TaitoChars); - - BurnFree(tmp); - - DrvTransTab(); - - return 0; -} - -static INT32 CommonInit() -{ - TaitoLoadRoms(false); - - TaitoMem = NULL; - MemIndex(); - INT32 nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(true)) return 1; - - DrvGfxDecode(); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1, 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1, 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(Taito68KRam1, 0x110000, 0x11ffff, MAP_RAM); - SekMapMemory(TaitoVideoRam, 0x400000, 0x420fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam, 0x500800, 0x500fff, MAP_RAM); - SekSetWriteWordHandler(0, syvalion_main_write_word); - SekSetWriteByteHandler(0, syvalion_main_write_byte); - SekSetReadWordHandler(0, syvalion_main_read_word); - SekSetReadByteHandler(0, syvalion_main_read_byte); - - SekMapHandler(1, 0x400000, 0x420fff, MAP_WRITE); - SekSetWriteWordHandler(1, taitoh_video_write_word); - SekSetWriteByteHandler(1, taitoh_video_write_byte); - - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(TaitoZ80Rom1, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(TaitoZ80Ram1, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(taitoh_sound_write); - ZetSetReadHandler(taitoh_sound_read); - ZetClose(); - - BurnYM2610Init(8000000, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &DrvFMIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 0.50, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - TC0220IOCInit(); - TC0140SYTInit(0); - - GenericTilesInit(); - - DrvDoReset(1); - - return 0; -} - -static INT32 SyvalionInit() -{ - INT32 nRet = CommonInit(); - - irq_config = 2; - TaitoInputConfig = 0xc; - address_xor = 0; - - return nRet; -} - -static INT32 TetristhInit() -{ - INT32 nRet = CommonInit(); - - irq_config = 2; - TaitoInputConfig = 0xc; - address_xor = 0x100000; - - return nRet; -} - -static INT32 DleagueInit() -{ - INT32 nRet = CommonInit(); - - irq_config = 1; - TaitoInputConfig = 0; - address_xor = 0; - - if (nRet == 0) { - SekOpen(0); - SekSetWriteWordHandler(0, dleague_main_write_word); - SekSetWriteByteHandler(0, dleague_main_write_byte); - SekSetReadWordHandler(0, dleague_main_read_word); - SekSetReadByteHandler(0, dleague_main_read_byte); - SekClose(); - } - - return nRet; -} - -static INT32 DrvExit() -{ - SekExit(); - ZetExit(); - - BurnYM2610Exit(); - - TaitoExit(); - - TaitoInputConfig = 0x0c; - irq_config = 2; - syvalionpmode = 0; - - return 0; -} - -static void DrvPaletteUpdate() -{ - UINT16 *p = (UINT16*)TaitoPaletteRam; - - for (INT32 i = 0; i < 0x420 / 2; i++) - { - INT32 r = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 0) & 0x1f; - INT32 g = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 5) & 0x1f; - INT32 b = (BURN_ENDIAN_SWAP_INT16(p[i]) >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - TaitoPalette[i] = BurnHighCol(r, g, b, 0); - } -} - -static void copy_zoom(INT32 min_x, INT32 max_x, INT32 min_y, INT32 max_y, UINT32 startx, UINT32 starty, INT32 incxx, INT32 incyy) -{ - startx += min_x * incxx; - starty += min_y * incyy; - - INT32 numblocks = (max_x - min_x) / 4; - - for (INT32 cury = min_y; cury <= max_y; cury++) - { - UINT16 *destptr = pTransDraw + ((cury - min_y) * nScreenWidth); - INT32 srcx = startx; - INT32 srcy = starty; - - starty += incyy; - - if ((UINT32)srcy < 0x4000000) - { - UINT16 *srcptr = TaitoTempBitmap[1] + (((srcy >> 16) & 0x3ff) * 0x400); - - for (INT32 curx = 0; curx < numblocks; curx++) - { - if ((UINT32)srcx < 0x4000000) - if (srcptr[srcx >> 16]) destptr[0] = srcptr[srcx >> 16]; - - srcx += incxx; - - if ((UINT32)srcx < 0x4000000) - if (srcptr[srcx >> 16]) destptr[1] = srcptr[srcx >> 16]; - - srcx += incxx; - - if ((UINT32)srcx < 0x4000000) - if (srcptr[srcx >> 16]) destptr[2] = srcptr[srcx >> 16]; - - srcx += incxx; - - if ((UINT32)srcx < 0x4000000) - if (srcptr[srcx >> 16]) destptr[3] = srcptr[srcx >> 16]; - - srcx += incxx; - - destptr += 4; - } - } - } -} - -// Copy layer without zooming -static void copy_layer(INT32 layer, INT32 transp) -{ - UINT16 *src = TaitoTempBitmap[layer]; - UINT16 *dst = pTransDraw; - - transp = transp ? 0 : 0xff; - UINT16 *base_ram = (UINT16*)TaitoVideoRam; - - INT32 scrollx = (~base_ram[(0x20802/2) + layer] + screen_x_adjust) & 0x3ff; - INT32 scrolly = (base_ram[(0x20806/2) + layer] + screen_y_adjust) & 0x3ff; - - for (INT32 sy = 0; sy < nScreenHeight; sy++) - { - UINT32 yy = ((sy + scrolly) & 0x3ff) * 0x400; - - for (INT32 sx = 0; sx < nScreenWidth; sx++) - { - INT32 xx = (sx + scrollx) & 0x3ff; - - INT32 pxl = src[yy+xx]; - - if ((pxl & 0xf) != transp) - { - dst[sx] = pxl; - } - } - - dst += nScreenWidth; - } -} - -// Foreground layer w/zoom y -static void bg1_tilemap_draw() -{ - UINT16 *scroll_ram = (UINT16*)(TaitoVideoRam + 0x20800); - - INT32 zoomx = scroll_ram[7] >> 8; - INT32 zoomy = scroll_ram[7] & 0x00ff; - - if (zoomx == 0x3f && zoomy == 0x7f) - { - copy_layer(1, 1); - } - else - { - INT32 zx, zy, dx, dy, ex, ey, sx,sy; - - INT32 min_x = screen_x_adjust; - INT32 max_x = screen_x_adjust + (nScreenWidth) - 1; - INT32 min_y = screen_y_adjust; - INT32 max_y = screen_y_adjust + (nScreenHeight) - 1; - - if (zoomx < 63) - { - dx = 16 - (zoomx + 2) / 8; - ex = (zoomx + 2) & 7; - zx = ((dx << 3) - ex) << 10; - } - else - { - zx = 0x10000 - ((zoomx - 0x3f) * 256); - } - - if (zoomy < 127) - { - dy = 16 - (zoomy + 2) / 16; - ey = (zoomy + 2) & 0xf; - zy = ((dy * 16) - ey) << 9; - } - else - { - zy = 0x10000 - ((zoomy - 0x7f) * 512); - } - - if (!flipscreen) - { - sx = (-scroll_ram[2] - 1) << 16; - sy = ( scroll_ram[4] - 1) << 16; - } - else - { - sx = (( 0x200 + scroll_ram[2]) << 16) - (max_x + min_x) * (zx - 0x10000); - sy = (( 0x3fe - scroll_ram[4]) << 16) - (max_y + min_y) * (zy - 0x10000); - } - - copy_zoom(min_x, max_x, min_y, max_y, sx, sy, zx, zy); - } -} - -// Background layer w/zoom x -static void bg0_tilemap_draw() -{ - UINT16 *scroll_ram = (UINT16*)(TaitoVideoRam + 0x20800); - UINT16 *bgscroll_ram = (UINT16*)(TaitoVideoRam + 0x20000); - - INT32 zx = (scroll_ram[6] & 0xff00) >> 8; - INT32 zy = scroll_ram[6] & 0x00ff; - - if (zx == 0x3f && zy == 0x7f) - { - copy_layer(0, 0); - } - else - { - INT32 sx, zoomx, zoomy, dx, ex, dy, ey, y_index; - - INT32 min_x = screen_x_adjust; - INT32 max_x = screen_x_adjust + (nScreenWidth) - 1; - INT32 min_y = screen_y_adjust; - INT32 max_y = screen_y_adjust + (nScreenHeight) - 1; - INT32 screen_width = max_x + 1; - - if (zx < 63) - { - dx = 16 - (zx + 2) / 8; - ex = (zx + 2) % 8; - zoomx = ((dx << 3) - ex) << 10; - } - else - { - zoomx = 0x10000 - ((zx - 0x3f) * 256); - } - - if (zy < 127) - { - dy = 16 - (zy + 2) / 16; - ey = (zy + 2) % 16; - zoomy = ((dy << 4) - ey) << 9; - } - else - { - zoomy = 0x10000 - ((zy - 0x7f) * 512); - } - - if (!flipscreen) - { - sx = (-scroll_ram[1] - 1) << 16; - y_index = (( scroll_ram[3] - 1) << 16) + min_y * zoomy; - } - else - { - sx = (( 0x200 + scroll_ram[1]) << 16) - (max_x + min_x) * (zoomx - 0x10000); - y_index = ((-scroll_ram[3] - 2) << 16) + min_y * zoomy - (max_y + min_y) * (zoomy - 0x10000); - } - - for (int y = min_y; y <= max_y; y++) - { - INT32 src_y_index = (y_index >> 16) & 0x3ff; - - INT32 row_index = (src_y_index & 0x1ff); - - if (flipscreen) - row_index = 0x1ff - row_index; - - INT32 x_index = sx - ((bgscroll_ram[row_index] << 16)); - - UINT16 *src16 = TaitoTempBitmap[0] + (src_y_index & 0x3ff) * 1024; - - INT32 x_step = zoomx; - - { - UINT16 *dst = pTransDraw + (y - min_y) * nScreenWidth; - - int clip0 = screen_x_adjust; - int clip1 = screen_x_adjust + (nScreenWidth); - - for (int i = 0; i < screen_width; i++) - { - if (i >= clip0 && i < clip1) - dst[i - clip0] = src16[(x_index >> 16) & 0x3ff]; - x_index += x_step; - } - } - - y_index += zoomy; - } - } -} - -// Check to see if a tile has changed, if it has changed, update the tilemap -static void update_layer(INT32 layer) -{ - UINT16 *ram = (UINT16*)(TaitoVideoRam + 0xc000 + (layer * 0x2000)); - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - if (TaitoDirtyTile[offs + (layer * 0x1000)] == 0) continue; - - INT32 code = ram[offs] & 0x7fff; - - INT32 sx = (offs & 0x3f) * 16; - INT32 sy = (offs / 0x40) * 16; - - INT32 attr = ram[offs + (0x10000 / 2)]; - INT32 color = attr & 0x1f; - - INT32 flipx = attr & 0x40; - INT32 flipy = attr & 0x80; - - { - UINT8 *gfx = TaitoChars + (code * 0x100); - - INT32 flip = (flipx ? 0xf : 0) | (flipy ? 0xf0 : 0); - - color <<= 4; - - UINT16 *dst = TaitoTempBitmap[layer] + sy * 1024 + sx; - - for (INT32 y = 0; y < 16; y++) - { - for (INT32 x = 0; x < 16; x++) - { - dst[x] = gfx[((y*16)+x)^flip] + color; - } - - dst += 1024; - } - } - } - - memset (TaitoDirtyTile + layer * 0x1000, 0, 0x1000); -} - -static void draw_tx_layer() -{ - UINT16 *ram = (UINT16*)(TaitoVideoRam + 0x01000); - - for (INT32 offs = 0; offs < 64 * 50; offs++) - { - if (ram[offs/2] == 0) continue; - - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - INT32 code = (ram[offs/2] >> ((~offs & 1) * 8)) & 0xff; - - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, 0, 0, 0, 0x200, TaitoCharsB); - } -} - -static const INT32 zoomy_conv_table[0x80] = { - 0x00,0x01,0x01,0x02,0x02,0x03,0x04,0x05,0x06,0x06,0x07,0x08,0x09,0x0a,0x0a,0x0b, - 0x0b,0x0c,0x0c,0x0d,0x0e,0x0e,0x0f,0x10,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x16, - 0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x24,0x25,0x26,0x27, - 0x28,0x2a,0x2b,0x2c,0x2e,0x30,0x31,0x32,0x34,0x36,0x37,0x38,0x3a,0x3c,0x3e,0x3f, - 0x40,0x41,0x42,0x42,0x43,0x43,0x44,0x44,0x45,0x45,0x46,0x46,0x47,0x47,0x48,0x49, - 0x4a,0x4a,0x4b,0x4b,0x4c,0x4d,0x4e,0x4f,0x4f,0x50,0x51,0x51,0x52,0x53,0x54,0x55, - 0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0x60,0x61,0x62,0x63,0x64,0x66, - 0x67,0x68,0x6a,0x6b,0x6c,0x6e,0x6f,0x71,0x72,0x74,0x76,0x78,0x80,0x7b,0x7d,0x7f -}; - -static void syvalion_draw_sprites() -{ - INT32 x0, y0, x, y, dx, ex, zx; - static const int size[] = { 1, 2, 4, 4 }; - - UINT16 *base_ram = (UINT16*)TaitoVideoRam; - - for (INT32 offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) - { - x0 = base_ram[(0x20400/2) + offs + 1] & 0x3ff; - y0 = base_ram[(0x20400/2) + offs + 0] & 0x3ff; - INT32 zoomx = (base_ram[(0x20400/2) + offs + 2] & 0x7f00) >> 8; - INT32 tile_offs = (base_ram[(0x20400/2) + offs + 3] & 0x1fff) << 2; - INT32 ysize = size[(base_ram[(0x20400/2) + offs] & 0x0c00) >> 10]; - - if (tile_offs) - { - if (zoomx < 63) - { - dx = 8 + (zoomx + 2) / 8; - ex = (zoomx + 2) % 8; - zx = ((dx << 1) + ex) << 11; - } - else - { - dx = 16 + (zoomx - 63) / 4; - ex = (zoomx - 63) & 3; - zx = (dx + ex) << 12; - } - - if (x0 >= 0x200) x0 -= 0x400; - if (y0 >= 0x200) y0 -= 0x400; - - if (flipscreen) - { - x0 = 497 - x0; - y0 = 498 - y0; - dx = -dx; - } - else - { - x0 += 1; - y0 += 2; - } - - y = y0; - - for (INT32 j = 0; j < ysize; j++) - { - x = x0; - - for (INT32 k = 0; k < 4; k++) - { - if (tile_offs >= 0x1000) - { - INT32 tile = base_ram[(0x00000/2) + tile_offs] & 0x7fff; - INT32 color = base_ram[(0x10000/2) + tile_offs] & 0x001f; - INT32 flipx = base_ram[(0x10000/2) + tile_offs] & 0x0040; - INT32 flipy = base_ram[(0x10000/2) + tile_offs] & 0x0080; - - if (flipscreen) - { - flipx ^= 0x0040; - flipy ^= 0x0080; - } - - if (transparent_tile_lut[tile] == 0) - RenderZoomedTile(pTransDraw, TaitoChars, tile, color*16, 0, x - screen_x_adjust, y - screen_y_adjust, flipx, flipy, 16, 16, zx, zx); - } - - tile_offs ++; - x += dx; - } - - y += dx; - } - } - } -} - -static void recordbr_draw_sprites(INT32 priority) -{ - static const int size[] = { 1, 2, 4, 4 }; - int x0, y0, x, y, dx, dy, ex, ey, zx, zy; - int ysize; - int j, k; - int offs; - int tile_offs; - int zoomx, zoomy; - - UINT16 *base_ram = (UINT16*)TaitoVideoRam; - - for (offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) - { - if (offs < 0x01b0 && priority == 0) continue; - if (offs >= 0x01b0 && priority == 1) continue; - - x0 = base_ram[(0x20400/2) + offs + 1] & 0x3ff; - y0 = base_ram[(0x20400/2) + offs + 0] & 0x3ff; - zoomx = (base_ram[(0x20400/2) + offs + 2] & 0x7f00) >> 8; - zoomy = (base_ram[(0x20400/2) + offs + 2] & 0x007f); - tile_offs = (base_ram[(0x20400/2) + offs + 3] & 0x1fff) << 2; - ysize = size[(base_ram[(0x20400/2) + offs] & 0x0c00) >> 10]; - - if (tile_offs) - { - zoomy = zoomy_conv_table[zoomy]; - - if (zoomx < 63) - { - dx = 8 + (zoomx + 2) / 8; - ex = (zoomx + 2) % 8; - zx = ((dx << 1) + ex) << 11; - } - else - { - dx = 16 + (zoomx - 63) / 4; - ex = (zoomx - 63) % 4; - zx = (dx + ex) << 12; - } - - if (zoomy < 63) - { - dy = 8 + (zoomy + 2) / 8; - ey = (zoomy + 2) % 8; - zy = ((dy << 1) + ey) << 11; - } - else - { - dy = 16 + (zoomy - 63) / 4; - ey = (zoomy - 63) % 4; - zy = (dy + ey) << 12; - } - - if (x0 >= 0x200) x0 -= 0x400; - if (y0 >= 0x200) y0 -= 0x400; - - if (flipscreen) - { - x0 = 497 - x0; - y0 = 498 - y0; - dx = -dx; - dy = -dy; - } - else - { - x0 += 1; - y0 += 2; - } - - y = y0; - for (j = 0; j < ysize; j ++) - { - x = x0; - for (k = 0; k < 4; k ++) - { - if (tile_offs >= 0x1000) - { - INT32 tile = base_ram[(0x00000/2) + tile_offs] & 0x7fff; - INT32 color = base_ram[(0x10000/2) + tile_offs] & 0x001f; - INT32 flipx = base_ram[(0x10000/2) + tile_offs] & 0x0040; - INT32 flipy = base_ram[(0x10000/2) + tile_offs] & 0x0080; - - if (flipscreen) - { - flipx ^= 0x0040; - flipy ^= 0x0080; - } - - if (transparent_tile_lut[tile] == 0) - RenderZoomedTile(pTransDraw, TaitoChars, tile, color*16, 0, x - screen_x_adjust, y - screen_y_adjust, flipx, flipy, 16, 16, zx, zy); - } - tile_offs ++; - x += dx; - } - y += dy; - } - } - } -} - -static void dleague_draw_sprites(INT32 priority) -{ - UINT16 *base_ram = (UINT16*)TaitoVideoRam; - - static const int size[] = { 1, 2, 4, 4 }; - int x0, y0, x, y, dx, ex, zx; - int ysize; - int j, k; - int offs; - int tile_offs; - int zoomx; - int pribit; - - for (offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) - { - x0 = base_ram[(0x20400/2) + offs + 1] & 0x3ff; - y0 = base_ram[(0x20400/2) + offs + 0] & 0x3ff; - zoomx = (base_ram[(0x20400/2) + offs + 2] & 0x7f00) >> 8; - tile_offs = (base_ram[(0x20400/2) + offs + 3] & 0x1fff) << 2; - pribit = (base_ram[(0x20400/2) + offs + 0] & 0x1000) >> 12; - ysize = size[(base_ram[(0x20400/2) + offs] & 0x0c00) >> 10]; - - if (tile_offs) - { - if (zoomx < 63) - { - dx = 8 + (zoomx + 2) / 8; - ex = (zoomx + 2) % 8; - zx = ((dx << 1) + ex) << 11; - pribit = 0; - } - else - { - dx = 16 + (zoomx - 63) / 4; - ex = (zoomx - 63) % 4; - zx = (dx + ex) << 12; - } - - if (base_ram[0x20802/2] & 0x8000) - pribit = 1; - - if (x0 >= 0x200) x0 -= 0x400; - if (y0 >= 0x200) y0 -= 0x400; - - if (flipscreen) - { - x0 = 497 - x0; - y0 = 498 - y0; - dx = -dx; - } - else - { - x0 += 1; - y0 += 2; - } - - if (priority == pribit) - { - y = y0; - for (j = 0; j < ysize; j ++) - { - x = x0; - for (k = 0; k < 4; k ++ ) - { - if (tile_offs >= 0x1000) /* or pitcher gets blanked */ - { - INT32 tile = base_ram[(0x00000/2) + tile_offs] & 0x7fff; - INT32 color = base_ram[(0x10000/2) + tile_offs] & 0x001f; - INT32 flipx = base_ram[(0x10000/2) + tile_offs] & 0x0040; - INT32 flipy = base_ram[(0x10000/2) + tile_offs] & 0x0080; - - if (flipscreen) - { - flipx ^= 0x0040; - flipy ^= 0x0080; - } - - if (transparent_tile_lut[tile] == 0) - RenderZoomedTile(pTransDraw, TaitoChars, tile, color*16, 0, x - screen_x_adjust, y - screen_y_adjust, flipx, flipy, 16, 16, zx, zx); - } - tile_offs ++; - x += dx; - } - y += dx; - } - } - } - } -} - -static INT32 SyvalionDraw() -{ - screen_y_adjust = 32+16; - screen_x_adjust = 0; - - update_layer(0); - update_layer(1); - - DrvPaletteUpdate(); - - UINT16 *base_ram = (UINT16*)TaitoVideoRam; - - flipscreen = base_ram[0x20800/2] & 0x0c00; - - BurnTransferClear(); - - if (nBurnLayer & 1) bg0_tilemap_draw(); - if (nBurnLayer & 2) bg1_tilemap_draw(); - - if (nSpriteEnable & 1) syvalion_draw_sprites(); - - if (nBurnLayer & 4) draw_tx_layer(); - - BurnTransferCopy(TaitoPalette); - - return 0; -} - -static INT32 RecordbrDraw() -{ - screen_y_adjust = 32; - screen_x_adjust = 16; - - update_layer(0); - update_layer(1); - - DrvPaletteUpdate(); - - UINT16 *base_ram = (UINT16*)TaitoVideoRam; - - flipscreen = base_ram[0x20800/2] & 0x0c00; - - BurnTransferClear(); - - if (nBurnLayer & 1) bg0_tilemap_draw(); - - recordbr_draw_sprites(0); - - if (nBurnLayer & 2) bg1_tilemap_draw(); - - recordbr_draw_sprites(1); - - if (nBurnLayer & 4) draw_tx_layer(); - - BurnTransferCopy(TaitoPalette); - - return 0; -} - -static INT32 DleagueDraw() -{ - screen_y_adjust = 32; - screen_x_adjust = 16; - - update_layer(0); - update_layer(1); - - DrvPaletteUpdate(); - - UINT16 *base_ram = (UINT16*)TaitoVideoRam; - - flipscreen = base_ram[0x20800/2] & 0x0c00; - - BurnTransferClear(); - - if (nBurnLayer & 1) bg0_tilemap_draw(); - - dleague_draw_sprites(0); - - if (nBurnLayer & 2) bg1_tilemap_draw(); - - dleague_draw_sprites(1); - - if (nBurnLayer & 4) draw_tx_layer(); - - BurnTransferCopy(TaitoPalette); - - return 0; -} - -static INT32 DleagueJDraw() /* kludge */ -{ - screen_y_adjust = 32; - screen_x_adjust = 16; - - update_layer(0); - update_layer(1); - - DrvPaletteUpdate(); - - UINT16 *base_ram = (UINT16*)TaitoVideoRam; - - flipscreen = base_ram[0x20800/2] & 0x0c00; - - BurnTransferClear(); - - if (nBurnLayer & 1) bg0_tilemap_draw(); - - if (nBurnLayer & 2) bg1_tilemap_draw(); - - dleague_draw_sprites(0); - dleague_draw_sprites(1); - - if (nBurnLayer & 4) draw_tx_layer(); - - BurnTransferCopy(TaitoPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - TaitoWatchdog++; - if (TaitoWatchdog >= 180) { - DrvDoReset(0); - } - - if (TaitoReset) { - DrvDoReset(1); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (TC0220IOCInput, 0xff, sizeof ( TC0220IOCInput )); - - TC0220IOCInput[0] &= ~TaitoInputConfig; - - for (INT32 i = 0; i < 8; i++) { - TC0220IOCInput[0] ^= (TC0220IOCInputPort0[i] & 1) << i; - TC0220IOCInput[1] ^= (TC0220IOCInputPort1[i] & 1) << i; - TC0220IOCInput[2] ^= (TC0220IOCInputPort2[i] & 1) << i; - } - } - - SekOpen(0); - - INT32 SekSpeed = (INT32)((INT64)12000000 * nBurnCPUSpeedAdjust / 0x100); - INT32 ZetSpeed = (INT32)((INT64)4000000 * nBurnCPUSpeedAdjust / 0x100); - - INT32 nInterleave = 100; - INT32 nCyclesTotal[2] = { SekSpeed / 60, ZetSpeed / 60 }; - INT32 nCyclesDone[2] = { 0, 0 }; - INT32 nNext[2] = { 0, 0 }; - - for (INT32 i = 0; i < nInterleave; i++) { - nNext[0] += nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += SekRun(nNext[0] - nCyclesDone[0]); - if (i == (nInterleave / 1) - 1) SekSetIRQLine(irq_config, CPU_IRQSTATUS_AUTO); - nNext[1] += nCyclesTotal[1] / nInterleave; - - ZetOpen(0); - BurnTimerUpdate(nNext[1]); - nCyclesDone[1] += nNext[1]; - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - if (pBurnDraw) { - BurnDrvRedraw(); - } - - return 0; -} - -static void expand_tiles() -{ - for (INT32 i = 0; i < 0x1000; i+=2) - { - for (INT32 j = 0; j < 8; j++) - { - INT32 pxl; - - pxl = ((TaitoVideoRam[(i+0x00000)] >> j) & 1) << 0; - pxl |= ((TaitoVideoRam[(i+0x00001)] >> j) & 1) << 1; - pxl |= ((TaitoVideoRam[(i+0x10000)] >> j) & 1) << 2; - - TaitoCharsB[(i << 2) + j] = pxl; - } - } -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd-TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - - TaitoICScan(nAction); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(TaitoZ80Bank); - ZetClose(); - - expand_tiles(); - - memset (TaitoDirtyTile, 1, 0x2000); - } - - return 0; -} - - - -// Syvalion (Japan) - -static struct BurnRomInfo syvalionRomDesc[] = { - { "b51-20.bin", 0x20000, 0x440b6418, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b51-22.bin", 0x20000, 0xe6c61079, TAITO_68KROM1_BYTESWAP }, // 1 - { "b51-19.bin", 0x20000, 0x2abd762c, TAITO_68KROM1_BYTESWAP }, // 2 - { "b51-21.bin", 0x20000, 0xaa111f30, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b51-23.bin", 0x10000, 0x734662de, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b51-16.bin", 0x20000, 0xc0fcf7a5, TAITO_CHARS_BYTESWAP }, // 5 Background Tiles & Sprites - { "b51-12.bin", 0x20000, 0x6b36d358, TAITO_CHARS_BYTESWAP }, // 6 - { "b51-15.bin", 0x20000, 0x30b2ee02, TAITO_CHARS_BYTESWAP }, // 7 - { "b51-11.bin", 0x20000, 0xae9a9ac5, TAITO_CHARS_BYTESWAP }, // 8 - { "b51-08.bin", 0x20000, 0x9f6a535c, TAITO_CHARS_BYTESWAP }, // 9 - { "b51-04.bin", 0x20000, 0x03aea658, TAITO_CHARS_BYTESWAP }, // 10 - { "b51-07.bin", 0x20000, 0x764d4dc8, TAITO_CHARS_BYTESWAP }, // 11 - { "b51-03.bin", 0x20000, 0x8fd9b299, TAITO_CHARS_BYTESWAP }, // 12 - { "b51-14.bin", 0x20000, 0xdea7216e, TAITO_CHARS_BYTESWAP }, // 13 - { "b51-10.bin", 0x20000, 0x6aa97fbc, TAITO_CHARS_BYTESWAP }, // 14 - { "b51-13.bin", 0x20000, 0xdab28958, TAITO_CHARS_BYTESWAP }, // 15 - { "b51-09.bin", 0x20000, 0xcbb4f33d, TAITO_CHARS_BYTESWAP }, // 16 - { "b51-06.bin", 0x20000, 0x81bef4f0, TAITO_CHARS_BYTESWAP }, // 17 - { "b51-02.bin", 0x20000, 0x906ba440, TAITO_CHARS_BYTESWAP }, // 18 - { "b51-05.bin", 0x20000, 0x47976ae9, TAITO_CHARS_BYTESWAP }, // 19 - { "b51-01.bin", 0x20000, 0x8dab004a, TAITO_CHARS_BYTESWAP }, // 20 - - { "b51-17.bin", 0x80000, 0xd85096aa, TAITO_YM2610A }, // 21 YM2610 Samples - - { "b51-18.bin", 0x80000, 0x8b23ac83, TAITO_YM2610B }, // 22 YM2610 DeltaT Region - -}; - -STD_ROM_PICK(syvalion) -STD_ROM_FN(syvalion) - -struct BurnDriver BurnDrvSyvalion = { - "syvalion", NULL, NULL, NULL, "1988", - "Syvalion (Japan)\0", NULL, "Taito Corporation", "H System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, syvalionRomInfo, syvalionRomName, NULL, NULL, SyvalionInputInfo, SyvalionDIPInfo, - SyvalionInit, DrvExit, DrvFrame, SyvalionDraw, DrvScan, NULL, 0x210, - 512, 400, 4, 3 -}; - - -// Syvalion (World, prototype) - -static struct BurnRomInfo syvalionpRomDesc[] = { - { "prg-1e.ic28", 0x20000, 0xc778005b, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "prg-0e.ic31", 0x20000, 0x5a484040, TAITO_68KROM1_BYTESWAP }, // 1 - { "prg-3e.ic27", 0x20000, 0x0babb15b, TAITO_68KROM1_BYTESWAP }, // 2 - { "prg-2e.ic30", 0x20000, 0xf4aacaa9, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c69b.ic58", 0x10000, 0x07d3d789, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "chr-00.ic16", 0x20000, 0xb0c66db7, TAITO_CHARS_BYTESWAP }, // 5 Background Tiles & Sprites - { "chr-01.ic12", 0x20000, 0xdd07db12, TAITO_CHARS_BYTESWAP }, // 6 - { "chr-10.ic15", 0x20000, 0xc8942dde, TAITO_CHARS_BYTESWAP }, // 7 - { "chr-11.ic11", 0x20000, 0xfdaa72f5, TAITO_CHARS_BYTESWAP }, // 8 - { "chr-02.ic8", 0x20000, 0x323a9ad9, TAITO_CHARS_BYTESWAP }, // 9 - { "chr-03.ic4", 0x20000, 0x5ab28400, TAITO_CHARS_BYTESWAP }, // 10 - { "chr-12.ic7", 0x20000, 0x094a5e0b, TAITO_CHARS_BYTESWAP }, // 11 - { "chr-13.ic3", 0x20000, 0xcf39cf1d, TAITO_CHARS_BYTESWAP }, // 12 - { "chr-04.ic14", 0x20000, 0xdd2ea978, TAITO_CHARS_BYTESWAP }, // 13 - { "chr-05.ic10", 0x20000, 0x1c305d4e, TAITO_CHARS_BYTESWAP }, // 14 - { "chr-14.ic13", 0x20000, 0x083806c3, TAITO_CHARS_BYTESWAP }, // 15 - { "chr-15.ic9", 0x20000, 0x6afb076e, TAITO_CHARS_BYTESWAP }, // 16 - { "chr-06.ic6", 0x20000, 0x00cd0493, TAITO_CHARS_BYTESWAP }, // 17 - { "chr-07.ic2", 0x20000, 0x58fb0f65, TAITO_CHARS_BYTESWAP }, // 18 - { "chr-16.ic5", 0x20000, 0xa169194e, TAITO_CHARS_BYTESWAP }, // 19 - { "chr-17.ic7", 0x20000, 0xc259bd61, TAITO_CHARS_BYTESWAP }, // 20 - - { "sa-00.ic1", 0x20000, 0x27a97abc, TAITO_YM2610A }, // 21 YM2610 Samples - { "sa-01.ic2", 0x20000, 0x0140452b, TAITO_YM2610A }, // 22 - { "sa-02.ic3", 0x20000, 0x970cd4ee, TAITO_YM2610A }, // 23 - { "sa-03.ic4", 0x20000, 0x936cd1b5, TAITO_YM2610A }, // 24 - - { "sb-00.ic6", 0x20000, 0x5188f459, TAITO_YM2610B }, // 25 YM2610 DeltaT Region - { "sb01.ic8", 0x20000, 0x4dab7a6b, TAITO_YM2610B }, // 26 - { "sb-02.ic7", 0x20000, 0x8f5cc936, TAITO_YM2610B }, // 27 - { "sb-03-e66a.ic9", 0x20000, 0x9013b407, TAITO_YM2610B }, // 28 - - { "cpu1-pal20l10a.ic38.bin", 0x000cc, 0x2e7b5e3f, 0 }, // 29 pals - { "cpu2-pal20l8a.ic39.bin", 0x00144, 0xc0abf131, 0 }, // 30 -}; - -STD_ROM_PICK(syvalionp) -STD_ROM_FN(syvalionp) - -static INT32 SyvalionpInit() -{ - syvalionpmode = 1; - - return SyvalionInit(); -} - -struct BurnDriver BurnDrvSyvalionp = { - "syvalionp", "syvalion", NULL, NULL, "1988", - "Syvalion (World, prototype)\0", NULL, "Taito Corporation", "H System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, syvalionpRomInfo, syvalionpRomName, NULL, NULL, SyvalionInputInfo, SyvalionDIPInfo, - SyvalionpInit, DrvExit, DrvFrame, SyvalionDraw, DrvScan, NULL, 0x210, - 512, 400, 4, 3 -}; - - -// Recordbreaker (World) - -static struct BurnRomInfo recordbrRomDesc[] = { - { "b56-17.bin", 0x20000, 0x3e0a9c35, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b56-16.bin", 0x20000, 0xb447f12c, TAITO_68KROM1_BYTESWAP }, // 1 - { "b56-15.bin", 0x20000, 0xb346e282, TAITO_68KROM1_BYTESWAP }, // 2 - { "b56-21.bin", 0x20000, 0xe5f63790, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b56-19.bin", 0x10000, 0xc68085ee, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b56-04.bin", 0x20000, 0xf7afdff0, TAITO_CHARS_BYTESWAP }, // 5 Background Tiles & Sprites - { "b56-08.bin", 0x20000, 0xc9f0d38a, TAITO_CHARS_BYTESWAP }, // 6 - { "b56-03.bin", 0x20000, 0x4045fd44, TAITO_CHARS_BYTESWAP }, // 7 - { "b56-07.bin", 0x20000, 0x0c76e4c8, TAITO_CHARS_BYTESWAP }, // 8 - { "b56-02.bin", 0x20000, 0x68c604ec, TAITO_CHARS_BYTESWAP }, // 9 - { "b56-06.bin", 0x20000, 0x5fbcd302, TAITO_CHARS_BYTESWAP }, // 10 - { "b56-01.bin", 0x20000, 0x766b7260, TAITO_CHARS_BYTESWAP }, // 11 - { "b56-05.bin", 0x20000, 0xed390378, TAITO_CHARS_BYTESWAP }, // 12 - - { "b56-10.bin", 0x80000, 0xde1bce59, TAITO_YM2610A }, // 14 YM2610 Samples - - { "b56-09.bin", 0x80000, 0x7fd9ee68, TAITO_YM2610B }, // 13 YM2610 DeltaT Region - - { "b56-18.bin", 0x02000, 0xc88f0bbe, 0 }, // 15 ? -}; - -STD_ROM_PICK(recordbr) -STD_ROM_FN(recordbr) - -struct BurnDriver BurnDrvRecordbr = { - "recordbr", NULL, NULL, NULL, "1988", - "Recordbreaker (World)\0", NULL, "Taito Corporation Japan", "H System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SPORTSMISC, 0, - NULL, recordbrRomInfo, recordbrRomName, NULL, NULL, RecordbrInputInfo, RecordbrDIPInfo, - SyvalionInit, DrvExit, DrvFrame, RecordbrDraw, NULL, NULL, 0x210, - 320, 240, 4, 3 -}; - - -// Go For The Gold (Japan) - -static struct BurnRomInfo gogoldRomDesc[] = { - { "b56-17.bin", 0x20000, 0x3e0a9c35, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "b56-16.bin", 0x20000, 0xb447f12c, TAITO_68KROM1_BYTESWAP }, // 1 - { "b56-15.bin", 0x20000, 0xb346e282, TAITO_68KROM1_BYTESWAP }, // 2 - { "b56-14.bin", 0x20000, 0xb6c195b9, TAITO_68KROM1_BYTESWAP }, // 3 - - { "b56-19.bin", 0x10000, 0xc68085ee, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "b56-04.bin", 0x20000, 0xf7afdff0, TAITO_CHARS_BYTESWAP }, // 5 Background Tiles & Sprites - { "b56-08.bin", 0x20000, 0xc9f0d38a, TAITO_CHARS_BYTESWAP }, // 6 - { "b56-03.bin", 0x20000, 0x4045fd44, TAITO_CHARS_BYTESWAP }, // 7 - { "b56-07.bin", 0x20000, 0x0c76e4c8, TAITO_CHARS_BYTESWAP }, // 8 - { "b56-02.bin", 0x20000, 0x68c604ec, TAITO_CHARS_BYTESWAP }, // 9 - { "b56-06.bin", 0x20000, 0x5fbcd302, TAITO_CHARS_BYTESWAP }, // 10 - { "b56-01.bin", 0x20000, 0x766b7260, TAITO_CHARS_BYTESWAP }, // 11 - { "b56-05.bin", 0x20000, 0xed390378, TAITO_CHARS_BYTESWAP }, // 12 - - { "b56-10.bin", 0x80000, 0xde1bce59, TAITO_YM2610A }, // 13 YM2610 Samples - - { "b56-09.bin", 0x80000, 0x7fd9ee68, TAITO_YM2610B }, // 14 YM2610 DeltaT Region - - { "b56-18.bin", 0x02000, 0xc88f0bbe, 0 }, // 15 ? -}; - -STD_ROM_PICK(gogold) -STD_ROM_FN(gogold) - -struct BurnDriver BurnDrvGogold = { - "gogold", "recordbr", NULL, NULL, "1988", - "Go For The Gold (Japan)\0", NULL, "Taito Corporation", "H System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SPORTSMISC, 0, - NULL, gogoldRomInfo, gogoldRomName, NULL, NULL, RecordbrInputInfo, GogoldDIPInfo, - SyvalionInit, DrvExit, DrvFrame, RecordbrDraw, NULL, NULL, 0x210, - 320, 240, 4, 3 -}; - - -// Tetris (Japan, Taito H-System) - -static struct BurnRomInfo tetristhRomDesc[] = { - { "c26-12-1.ic36", 0x20000, 0x77e80c82, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c26-11-1.ic18", 0x20000, 0x069d77d2, TAITO_68KROM1_BYTESWAP }, // 1 - - { "c26-13.ic56", 0x10000, 0xefa89dfa, TAITO_Z80ROM1 }, // 2 Z80 Code - - { "c26-04.ic51", 0x20000, 0x23ddf00f, TAITO_CHARS_BYTESWAP }, // 3 Background Tiles & Sprites - { "c26-08.ic65", 0x20000, 0x86071824, TAITO_CHARS_BYTESWAP }, // 4 - { "c26-03.ic50", 0x20000, 0x341be9ac, TAITO_CHARS_BYTESWAP }, // 5 - { "c26-07.ic64", 0x20000, 0xc236311f, TAITO_CHARS_BYTESWAP }, // 6 - { "c26-02.ic49", 0x20000, 0x0b0bc88f, TAITO_CHARS_BYTESWAP }, // 7 - { "c26-06.ic63", 0x20000, 0xdeae0394, TAITO_CHARS_BYTESWAP }, // 8 - { "c26-01.ic48", 0x20000, 0x7efc7311, TAITO_CHARS_BYTESWAP }, // 9 - { "c26-05.ic62", 0x20000, 0x12718d97, TAITO_CHARS_BYTESWAP }, // 10 - - { "b56-10.bin", 0x80000, 0xde1bce59, TAITO_YM2610A }, // 11 YM2610 Samples - - { "b56-09.bin", 0x80000, 0x7fd9ee68, TAITO_YM2610B }, // 12 YM2610 DeltaT Region - - { "b56-18.bin", 0x02000, 0xc88f0bbe, 0 }, // 13 ? -}; - -STD_ROM_PICK(tetristh) -STD_ROM_FN(tetristh) - -struct BurnDriver BurnDrvTetristh = { - "tetristh", "tetris", NULL, NULL, "1988", - "Tetris (Japan, Taito H-System)\0", NULL, "Sega", "H System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, tetristhRomInfo, tetristhRomName, NULL, NULL, TetristhInputInfo, TetristhDIPInfo, - TetristhInit, DrvExit, DrvFrame, RecordbrDraw, NULL, NULL, 0x210, - 320, 224, 4, 3 -}; - - - -// Dynamite League (US) - -static struct BurnRomInfo dleagueRomDesc[] = { - { "c02-xx.33", 0x20000, 0xeda870a7, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c02-xx.36", 0x20000, 0xf52114af, TAITO_68KROM1_BYTESWAP }, // 1 - { "c02-20.34", 0x10000, 0xcdf593f3, TAITO_68KROM1_BYTESWAP }, // 2 - { "c02-xx.37", 0x10000, 0x820a8241, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c02-23.40", 0x10000, 0x5632ee49, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c02-02.15", 0x80000, 0xb273f854, TAITO_CHARS }, // 5 Background Tiles & Sprites - { "c02-06.6", 0x20000, 0xb8473c7b, TAITO_CHARS_BYTESWAP }, // 6 - { "c02-10.14", 0x20000, 0x50c02f0f, TAITO_CHARS_BYTESWAP }, // 7 - { "c02-03.17", 0x80000, 0xc3fd0dcd, TAITO_CHARS }, // 8 - { "c02-07.7", 0x20000, 0x8c1e3296, TAITO_CHARS_BYTESWAP }, // 9 - { "c02-11.16", 0x20000, 0xfbe548b8, TAITO_CHARS_BYTESWAP }, // 10 - { "c02-24.19", 0x80000, 0x18ef740a, TAITO_CHARS }, // 11 - { "c02-08.8", 0x20000, 0x1a3c2f93, TAITO_CHARS_BYTESWAP }, // 12 - { "c02-12.18", 0x20000, 0xb1c151c5, TAITO_CHARS_BYTESWAP }, // 13 - { "c02-05.21", 0x80000, 0xfe3a5179, TAITO_CHARS }, // 14 - { "c02-09.9", 0x20000, 0xa614d234, TAITO_CHARS_BYTESWAP }, // 15 - { "c02-13.20", 0x20000, 0x8eb3194d, TAITO_CHARS_BYTESWAP }, // 16 - - { "c02-01.31", 0x80000, 0xd5a3d1aa, TAITO_YM2610A }, // 17 YM2610 Samples - - { "c02-18.22", 0x02000, 0xc88f0bbe, 0 }, // 18 ? -}; - -STD_ROM_PICK(dleague) -STD_ROM_FN(dleague) - -struct BurnDriver BurnDrvDleague = { - "dleague", NULL, NULL, NULL, "1990", - "Dynamite League (US)\0", NULL, "Taito America Corporation", "H System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SPORTSMISC, 0, - NULL, dleagueRomInfo, dleagueRomName, NULL, NULL, DleagueInputInfo, DleagueDIPInfo, - DleagueInit, DrvExit, DrvFrame, DleagueDraw, NULL, NULL, 0x210, - 320, 240, 4, 3 -}; - - -// Dynamite League (Japan) - -static struct BurnRomInfo dleaguejRomDesc[] = { - { "c02-19a.33", 0x20000, 0x7e904e45, TAITO_68KROM1_BYTESWAP }, // 0 68k Code - { "c02-21a.36", 0x20000, 0x18c8a32b, TAITO_68KROM1_BYTESWAP }, // 1 - { "c02-20.34", 0x10000, 0xcdf593f3, TAITO_68KROM1_BYTESWAP }, // 2 - { "c02-22.37", 0x10000, 0xf50db2d7, TAITO_68KROM1_BYTESWAP }, // 3 - - { "c02-23.40", 0x10000, 0x5632ee49, TAITO_Z80ROM1 }, // 4 Z80 Code - - { "c02-02.15", 0x80000, 0xb273f854, TAITO_CHARS }, // 5 Background Tiles & Sprites - { "c02-06.6", 0x20000, 0xb8473c7b, TAITO_CHARS_BYTESWAP }, // 6 - { "c02-10.14", 0x20000, 0x50c02f0f, TAITO_CHARS_BYTESWAP }, // 7 - { "c02-03.17", 0x80000, 0xc3fd0dcd, TAITO_CHARS }, // 8 - { "c02-07.7", 0x20000, 0x8c1e3296, TAITO_CHARS_BYTESWAP }, // 9 - { "c02-11.16", 0x20000, 0xfbe548b8, TAITO_CHARS_BYTESWAP }, // 10 - { "c02-24.19", 0x80000, 0x18ef740a, TAITO_CHARS }, // 11 - { "c02-08.8", 0x20000, 0x1a3c2f93, TAITO_CHARS_BYTESWAP }, // 12 - { "c02-12.18", 0x20000, 0xb1c151c5, TAITO_CHARS_BYTESWAP }, // 13 - { "c02-05.21", 0x80000, 0xfe3a5179, TAITO_CHARS }, // 14 - { "c02-09.9", 0x20000, 0xa614d234, TAITO_CHARS_BYTESWAP }, // 15 - { "c02-13.20", 0x20000, 0x8eb3194d, TAITO_CHARS_BYTESWAP }, // 16 - - { "c02-01.31", 0x80000, 0xd5a3d1aa, TAITO_YM2610A }, // 17 YM2610 Samples - - { "c02-18.22", 0x02000, 0xc88f0bbe, 0 }, // 18 ? -}; - -STD_ROM_PICK(dleaguej) -STD_ROM_FN(dleaguej) - -struct BurnDriver BurnDrvDleaguej = { - "dleaguej", "dleague", NULL, NULL, "1990", - "Dynamite League (Japan)\0", NULL, "Taito Corporation", "H System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SPORTSMISC, 0, - NULL, dleaguejRomInfo, dleaguejRomName, NULL, NULL, DleagueInputInfo, DleaguejDIPInfo, - DleagueInit, DrvExit, DrvFrame, DleagueJDraw, NULL, NULL, 0x210, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_taitol.cpp b/jan/src/burn/drv/taito/d_taitol.cpp deleted file mode 100644 index 5a7f45195..000000000 --- a/jan/src/burn/drv/taito/d_taitol.cpp +++ /dev/null @@ -1,4384 +0,0 @@ -// FB Alpha Taito System-L driver module -// Based on MAME driver by Oliver Galibert - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "taito_ic.h" -#include "burn_ym2203.h" -#include "burn_ym2610.h" -#include "msm5205.h" -#include "bitswap.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvMcuROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvSampleROM; -static UINT8 *DrvGfxRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvShareRAM1; -static UINT8 *DrvPalRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvCharRAM; -static UINT8 *DrvBgRAM; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *cur_rombank; -static UINT8 *cur_rambank; -static UINT8 *char_banks; -static UINT8 *irq_adr_table; - -static UINT8 horshoes_bank; -static UINT8 irq_enable; -static UINT8 last_irq_level; -static UINT8 current_control; -static UINT8 flipscreen; -static UINT8 mux_control; -static UINT8 mcu_position; - -static UINT32 adpcm_pos; -static INT32 adpcm_data; - -static INT32 nGfxRomLen = 0; -static INT32 nmi_enable = 0; -static INT32 has_ym2610 = 0; -static INT32 has_adpcm = 0; -static INT32 has_track = 0; - -// trackball stuff -static INT32 DrvAnalogPort0 = 0; -static INT32 DrvAnalogPort1 = 0; -static UINT32 track_x = 0; -static UINT32 track_y = 0; -static INT32 track_x_last = 0; -static INT32 track_y_last = 0; - -static INT32 fhawkmode = 0; -static INT32 plgirls2bmode = 0; - -typedef void (*ram_function)(INT32 offset, UINT16 address, UINT8 data); -static ram_function ram_write_table[4] = { NULL, NULL, NULL, NULL }; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static struct BurnInputInfo FhawkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 6, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 1, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Fhawk) - -static struct BurnInputInfo ChampwrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 7, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 6, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 4, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 2, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 1, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 0, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 6, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Champwr) - -static struct BurnInputInfo EvilstonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy3 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy3 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy3 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy3 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 1, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Evilston) - -static struct BurnInputInfo PlottingInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 4, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 6, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 2, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 4, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 6, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Plotting) - -static struct BurnInputInfo PuzznicInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 4, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 5, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 6, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 0, "p1 fire 2" }, - - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 2, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 4, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 5, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 6, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Puzznic) - -static struct BurnInputInfo PalamedInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Palamed) - -static struct BurnInputInfo CachatInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start"} , - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Cachat) - -static struct BurnInputInfo CubybopInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Cubybop) - -static struct BurnInputInfo TubeitInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Tubeit) - -static struct BurnInputInfo PlgirlsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 4, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 5, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 4, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 5, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 6, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 7, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 0, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 1, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Plgirls) - -#define A(a, b, c, d) { a, b, (UINT8*)(c), d } -static struct BurnInputInfo HorshoesInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p1 coin" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 7, "p1 fire 2" }, - - A("P1 Trackball X", BIT_ANALOG_REL, &DrvAnalogPort0,"p1 x-axis"), - A("P1 Trackball Y", BIT_ANALOG_REL, &DrvAnalogPort1,"p1 y-axis"), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 0, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Horshoes) -#undef A - -static struct BurnDIPInfo FhawkDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0x33, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, -}; - -STDDIPINFO(Fhawk) - -static struct BurnDIPInfo FhawkjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0x33, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, -}; - -STDDIPINFO(Fhawkj) - -static struct BurnDIPInfo ChampwrDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x14, 0x01, 0x0c, 0x08, "2 minutes" }, - {0x14, 0x01, 0x0c, 0x0c, "3 minutes" }, - {0x14, 0x01, 0x0c, 0x04, "4 minutes" }, - {0x14, 0x01, 0x0c, 0x00, "5 minutes" }, - - {0 , 0xfe, 0 , 4, "'1 minute' Lasts:" }, - {0x14, 0x01, 0x30, 0x00, "30 sec" }, - {0x14, 0x01, 0x30, 0x10, "40 sec" }, - {0x14, 0x01, 0x30, 0x30, "50 sec" }, - {0x14, 0x01, 0x30, 0x20, "60 sec" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Champwr) - -static struct BurnDIPInfo ChampwruDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Price to Continue" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "Same as Start" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x14, 0x01, 0x0c, 0x08, "2 minutes" }, - {0x14, 0x01, 0x0c, 0x0c, "3 minutes" }, - {0x14, 0x01, 0x0c, 0x04, "4 minutes" }, - {0x14, 0x01, 0x0c, 0x00, "5 minutes" }, - - {0 , 0xfe, 0 , 4, "'1 minute' Lasts:" }, - {0x14, 0x01, 0x30, 0x00, "30 sec" }, - {0x14, 0x01, 0x30, 0x10, "40 sec" }, - {0x14, 0x01, 0x30, 0x30, "50 sec" }, - {0x14, 0x01, 0x30, 0x20, "60 sec" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Champwru) - -static struct BurnDIPInfo ChampwrjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x14, 0x01, 0x0c, 0x08, "2 minutes" }, - {0x14, 0x01, 0x0c, 0x0c, "3 minutes" }, - {0x14, 0x01, 0x0c, 0x04, "4 minutes" }, - {0x14, 0x01, 0x0c, 0x00, "5 minutes" }, - - {0 , 0xfe, 0 , 4, "'1 minute' Lasts:" }, - {0x14, 0x01, 0x30, 0x00, "30 sec" }, - {0x14, 0x01, 0x30, 0x10, "40 sec" }, - {0x14, 0x01, 0x30, 0x30, "50 sec" }, - {0x14, 0x01, 0x30, 0x20, "60 sec" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Champwrj) - -static struct BurnDIPInfo KurikintDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Bosses' messages" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "5 Times" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kurikint) - -static struct BurnDIPInfo KurikintjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Bosses' messages" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "5 Times" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kurikintj) - -static struct BurnDIPInfo KurikintaDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfc, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 2, "Level Select (Cheat)" }, - {0x14, 0x01, 0x01, 0x01, "Off" }, - {0x14, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x02, 0x02, "Off" }, - {0x14, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x0c, 0x08, "Easy" }, - {0x14, 0x01, 0x0c, 0x0c, "Medium" }, - {0x14, 0x01, 0x0c, 0x04, "Hard" }, - {0x14, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x10, 0x10, "Off" }, - {0x14, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Bosses' messages" }, - {0x14, 0x01, 0x20, 0x00, "Off" }, - {0x14, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Unknown" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Slow Motion (Cheat)" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kurikinta) - -static struct BurnDIPInfo EvilstonDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0x3f, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x10, "1" }, - {0x14, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 4, "Language" }, - {0x14, 0x01, 0xc0, 0x00, "English" }, - {0x14, 0x01, 0xc0, 0x80, "English" }, - {0x14, 0x01, 0xc0, 0x40, "English" }, - {0x14, 0x01, 0xc0, 0xc0, "Japanese" }, -}; - -STDDIPINFO(Evilston) - -static struct BurnDIPInfo RaimaisDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "80k and 160k" }, - {0x14, 0x01, 0x0c, 0x0c, "80k only" }, - {0x14, 0x01, 0x0c, 0x04, "160k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Raimais) - -static struct BurnDIPInfo RaimaisjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0x7f, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "80k and 160k" }, - {0x14, 0x01, 0x0c, 0x0c, "80k only" }, - {0x14, 0x01, 0x0c, 0x04, "160k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Raimaisj) - -static struct BurnDIPInfo PlottingDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Play Mode" }, - {0x11, 0x01, 0x01, 0x00, "1 Player" }, - {0x11, 0x01, 0x01, 0x01, "2 Player" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Wild Blocks" }, - {0x12, 0x01, 0x30, 0x20, "1" }, - {0x12, 0x01, 0x30, 0x30, "2" }, - {0x12, 0x01, 0x30, 0x10, "3" }, - {0x12, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Plotting) - -static struct BurnDIPInfo PlottinguDIPList[]= -{ - {0x11, 0xff, 0xff, 0xff, NULL }, - {0x12, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Play Mode" }, - {0x11, 0x01, 0x01, 0x00, "1 Player" }, - {0x11, 0x01, 0x01, 0x01, "2 Player" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Price to Continue" }, - {0x11, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0xc0, "Same as Start" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x03, 0x02, "Easy" }, - {0x12, 0x01, 0x03, 0x03, "Medium" }, - {0x12, 0x01, 0x03, 0x01, "Hard" }, - {0x12, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Wild Blocks" }, - {0x12, 0x01, 0x30, 0x20, "1" }, - {0x12, 0x01, 0x30, 0x30, "2" }, - {0x12, 0x01, 0x30, 0x10, "3" }, - {0x12, 0x01, 0x30, 0x00, "4" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Plottingu) - -static struct BurnDIPInfo PuzznicDIPList[]= -{ - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, - {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Retries" }, - {0x12, 0x01, 0x0c, 0x00, "0" }, - {0x12, 0x01, 0x0c, 0x04, "1" }, - {0x12, 0x01, 0x0c, 0x0c, "2" }, - {0x12, 0x01, 0x0c, 0x08, "3" }, - - {0 , 0xfe, 0 , 2, "Bombs" }, - {0x12, 0x01, 0x10, 0x10, "0" }, - {0x12, 0x01, 0x10, 0x00, "2" }, - - {0 , 0xfe, 0 , 2, "Girls" }, - {0x12, 0x01, 0x20, 0x00, "No" }, - {0x12, 0x01, 0x20, 0x20, "Yes" }, - - {0 , 0xfe, 0 , 3, "Terms of Replay" }, - {0x12, 0x01, 0xc0, 0x40, "One step back/Continuous" }, - {0x12, 0x01, 0xc0, 0xc0, "Reset to start/Continuous" }, - {0x12, 0x01, 0xc0, 0x80, "Reset to start/Reset to start" }, -}; - -STDDIPINFO(Puzznic) - -static struct BurnDIPInfo PalamedDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Games for VS Victory" }, - {0x14, 0x01, 0x0c, 0x08, "1 Game" }, - {0x14, 0x01, 0x0c, 0x0c, "2 Games" }, - {0x14, 0x01, 0x0c, 0x04, "3 Games" }, - {0x14, 0x01, 0x0c, 0x00, "4 Games" }, - - {0 , 0xfe, 0 , 4, "Dice Appear at" }, - {0x14, 0x01, 0x30, 0x20, "500 Lines" }, - {0x14, 0x01, 0x30, 0x30, "1000 Lines" }, - {0x14, 0x01, 0x30, 0x10, "2000 Lines" }, - {0x14, 0x01, 0x30, 0x00, "3000 Lines" }, - - {0 , 0xfe, 0 , 2, "Versus Mode" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Palamed) - -static struct BurnDIPInfo CachatDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Cachat) - -static struct BurnDIPInfo CubybopDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Cubybop) - -static struct BurnDIPInfo TubeitDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfd, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, -}; - -STDDIPINFO(Tubeit) - -static struct BurnDIPInfo PlgirlsDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Coinage" }, - {0x13, 0x01, 0x38, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x18, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x38, 0x38, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x38, 0x08, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x38, 0x28, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x38, 0x20, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "P1+P2 Start to Clear Round (Cheat)" }, - {0x13, 0x01, 0x80, 0x80, "Off" }, - {0x13, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Plgirls) - -static struct BurnDIPInfo Plgirls2DIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xfc, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Mode" }, - {0x13, 0x01, 0x08, 0x08, "Mode A" }, - {0x13, 0x01, 0x08, 0x00, "Mode B" }, - - {0 , 0xfe, 0 , 8, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "4 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "3 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - - {0 , 0xfe, 0 , 2, "Time" }, - {0x14, 0x01, 0x04, 0x04, "2 Seconds" }, - {0x14, 0x01, 0x04, 0x00, "3 Seconds" }, - - {0 , 0xfe, 0 , 4, "Lives for Joe/Lady/Jack" }, - {0x14, 0x01, 0x18, 0x10, "3/2/3" }, - {0x14, 0x01, 0x18, 0x18, "4/3/4" }, - {0x14, 0x01, 0x18, 0x08, "5/4/5" }, - {0x14, 0x01, 0x18, 0x00, "6/5/6" }, - - {0 , 0xfe, 0 , 2, "Character Speed" }, - {0x14, 0x01, 0x20, 0x20, "Normal" }, - {0x14, 0x01, 0x20, 0x00, "Fast" }, -}; - -STDDIPINFO(Plgirls2) - -static struct BurnDIPInfo HorshoesDIPList[]= -{ - {0x08, 0xff, 0xff, 0xff, NULL }, - {0x09, 0xff, 0xff, 0xff, NULL }, - - {0 , 0xfe, 0 , 2, "Beer Frame Message" }, - {0x08, 0x01, 0x01, 0x01, "Break Time" }, - {0x08, 0x01, 0x01, 0x00, "Beer Frame" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x08, 0x01, 0x02, 0x02, "Off" }, - {0x08, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x08, 0x01, 0x04, 0x04, "Off" }, - {0x08, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x08, 0x01, 0x08, 0x00, "Off" }, - {0x08, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4, "Coinage" }, - {0x08, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, - {0x08, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, - {0x08, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x08, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Price to Continue" }, - {0x08, 0x01, 0xc0, 0x00, "3 Coins 1 Credits" }, - {0x08, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x08, 0x01, 0xc0, 0x80, "1 Coin 1 Credits" }, - {0x08, 0x01, 0xc0, 0xc0, "Same as Start" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x09, 0x01, 0x03, 0x02, "Easy" }, - {0x09, 0x01, 0x03, 0x03, "Medium" }, - {0x09, 0x01, 0x03, 0x01, "Hard" }, - {0x09, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Time" }, - {0x09, 0x01, 0x0c, 0x08, "20 sec" }, - {0x09, 0x01, 0x0c, 0x0c, "30 sec" }, - {0x09, 0x01, 0x0c, 0x04, "40 sec" }, - {0x09, 0x01, 0x0c, 0x00, "60 sec" }, - - {0 , 0xfe, 0 , 2, "Innings" }, - {0x09, 0x01, 0x10, 0x10, "3 per Credit" }, - {0x09, 0x01, 0x10, 0x00, "9 per Credit" }, - - {0 , 0xfe, 0 , 2, "Bonus Advantage" }, - {0x09, 0x01, 0x20, 0x20, "Off" }, - {0x09, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Scoring Speed" }, - {0x09, 0x01, 0x40, 0x40, "Normal" }, - {0x09, 0x01, 0x40, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2, "Grip/Angle Select" }, - {0x09, 0x01, 0x80, 0x80, "2 Buttons" }, - {0x09, 0x01, 0x80, 0x00, "1 Button" }, -}; - -STDDIPINFO(Horshoes) - -// decode a single byte written to the graphics ram -static inline void graphics_deocde_one(INT32 offset, UINT8 data) -{ - offset &= 0x7fff; - INT32 k = (offset & 1) * 2; - offset = (offset & ~1) * 2; - - for (INT32 i = 0; i < 8; i++) - { - DrvGfxROM2[offset + (i & 3)] &= ~(1 << ((i >> 2) + k)); - DrvGfxROM2[offset + (i & 3)] |= ((data >> i) & 1) << ((i >> 2) + k); - } -} - -// decode one palette entry -static inline void palette_update_one(INT32 offset) -{ - if (offset >= 0x200) return; - - offset &= 0x1fe; - - UINT8 r = DrvPalRAM[offset] & 0xf; - UINT8 g = DrvPalRAM[offset] >> 4; - UINT8 b = DrvPalRAM[offset+1] & 0xf; - - DrvPalette[offset/2] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); -} - -static void chargfx_write(INT32 offset, UINT16 address, UINT8 data) -{ - INT32 ram_bank = cur_rambank[offset]; - ram_bank = ((ram_bank & 3) + ((ram_bank & 8) >> 1)) << 12; - address &= 0xfff; - INT32 prev = DrvGfxRAM[address + ram_bank]; - - if (data != prev) { - DrvGfxRAM[address + ram_bank] = data; - graphics_deocde_one(address + ram_bank, data); - } -} - -static void palette_write(INT32, UINT16 address, UINT8 data) -{ - INT32 prev = DrvPalRAM[address & 0xfff]; - - if (data != prev) { - DrvPalRAM[address & 0xfff] = data; - - palette_update_one(address & 0xffe); - } -} - -static void rambankswitch(UINT8 offset, UINT8 data) -{ - offset &= 3; - - INT32 ramaddr = 0xc000 + (offset * 0x1000); - INT32 ramaddr_end = ramaddr + ((offset == 3) ? 0xdff : 0xfff); - - cur_rambank[offset] = data; - - switch (data) - { - case 0x14: - case 0x15: - case 0x16: - case 0x17: - ram_write_table[offset] = chargfx_write; - ZetUnmapMemory(ramaddr, ramaddr_end, MAP_WRITE); - ZetMapMemory(DrvGfxRAM + ((data & 3) * 0x1000), ramaddr, ramaddr_end, MAP_ROM); - return; - - case 0x18: - case 0x19: - ZetMapMemory(DrvBgRAM + ((data & 1) * 0x1000), ramaddr, ramaddr_end, MAP_RAM); - return; - - case 0x1a: - ZetMapMemory(DrvCharRAM, ramaddr, ramaddr_end, MAP_RAM); - return; - - case 0x1b: - ZetMapMemory(DrvSprRAM, ramaddr, ramaddr_end, MAP_RAM); - return; - - case 0x1c: - case 0x1d: - case 0x1e: - case 0x1f: - ram_write_table[offset] = chargfx_write; - ZetUnmapMemory(ramaddr, ramaddr_end, MAP_WRITE); - ZetMapMemory(DrvGfxRAM + ((data & 3) * 0x1000) + 0x4000, ramaddr, ramaddr_end, MAP_ROM); - return; - - case 0x80: - ram_write_table[offset] = palette_write; - ZetUnmapMemory(ramaddr, ramaddr_end, MAP_WRITE); - ZetMapMemory(DrvPalRAM, ramaddr, ramaddr_end, MAP_ROM); - return; - - default: - ram_write_table[offset] = NULL; - ZetUnmapMemory(ramaddr, ramaddr_end, MAP_RAM); - break; - } -} - -static void rombankswitch0(UINT8 data) -{ - cur_rombank[0] = data; - - ZetMapMemory(DrvZ80ROM0 + (cur_rombank[0] * 0x2000), 0x6000, 0x7fff, MAP_ROM); -} - -static void __fastcall fhawk_main_write(UINT16 address, UINT8 data) -{ - if (address >= 0xc000 && address <= 0xfdff) { - INT32 bank_select = (address >> 12) & 3; - if (ram_write_table[bank_select]) { - ram_write_table[bank_select](bank_select, address, data); - return; - } - } - - switch (address) - { - case 0xfe00: - case 0xfe01: - case 0xfe02: - case 0xfe03: - char_banks[address & 3] = data; - return; - - case 0xfe04: - current_control = data; - flipscreen = data & 0x10; - return; - - case 0xff00: - case 0xff01: - case 0xff02: - irq_adr_table[address & 3] = data; - return; - - case 0xff03: - { - irq_enable = data; - - if ((irq_enable & (1 << last_irq_level)) == 0) { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } - } - return; - - case 0xff04: - case 0xff05: - case 0xff06: - case 0xff07: - rambankswitch(address, data); - return; - - case 0xff08: - case 0xfff8: - rombankswitch0(data); - return; - } -} - -static UINT8 __fastcall fhawk_main_read(UINT16 address) -{ - switch (address) - { - case 0xfe00: - case 0xfe01: - case 0xfe02: - case 0xfe03: - return char_banks[address & 3]; - - case 0xfe04: - return current_control; - - case 0xff00: - case 0xff01: - case 0xff02: - return irq_adr_table[address & 3]; - - case 0xff03: - return irq_enable; - - case 0xff04: - case 0xff05: - case 0xff06: - case 0xff07: - return cur_rambank[address & 3]; - - case 0xff08: - case 0xfff8: - return cur_rombank[0]; - } - - return 0; -} - -static void __fastcall evilston_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa800: - return; // nop - - case 0xa804: - return; // nop - - case 0xfe04: - current_control = data | 0x08; // hack!!! - flipscreen = data & 0x10; - return; - } - - fhawk_main_write(address,data); -} - -static UINT8 __fastcall evilston_main_read(UINT16 address) -{ - switch (address) - { - case 0xa800: - case 0xa801: - return DrvDips[address & 1]; - - case 0xa802: - case 0xa803: - return DrvInputs[address & 1]; - - case 0xa807: - return DrvInputs[2]; - } - - return fhawk_main_read(address); -} - -static UINT8 mux_read() -{ - switch (mux_control) - { - case 0: - case 1: - return DrvDips[mux_control & 1]; - - case 2: - case 3: - return DrvInputs[mux_control & 1]; - - case 7: - return DrvInputs[2] ^ 0x0c; - } - - return 0xff; -} - -static void __fastcall raimais_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0x8800: - if (mux_control == 4) { - // coin counters, coin lockout - return; - } - return; - - case 0x8801: - mux_control = data; - return; - - case 0x8c00: - TC0140SYTPortWrite(data); - return; - - case 0x8c01: - ZetClose(); - TC0140SYTCommWrite(data); - ZetOpen(0); - return; - } - - fhawk_main_write(address, data); -} - -static UINT8 __fastcall raimais_main_read(UINT16 address) -{ - switch (address) - { - case 0x8800: - return mux_read(); - - case 0x8801: - return 0; // nop - - case 0x8c01: - return TC0140SYTCommRead(); - } - - return fhawk_main_read(address); -} - - -static void __fastcall kurikint_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa800: - if (mux_control == 4) { - // coin counters, coin lockout - return; - } - return; - - case 0xa801: - mux_control = data; - return; - } - - fhawk_main_write(address,data); -} - -static UINT8 __fastcall kurikint_main_read(UINT16 address) -{ - switch (address) - { - case 0xa800: - return mux_read(); - - case 0xa801: - return 0; - } - - return fhawk_main_read(address); -} - -static void __fastcall plotting_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xa800: - case 0xb800: - return; // nop - } - - fhawk_main_write(address,data); -} - -static UINT8 __fastcall plotting_main_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - mux_control = (address / 2) & 1; - return BurnYM2203Read(0, address & 1); - } - - return fhawk_main_read(address); -} - -static void __fastcall puzznic_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xb800: // mcu data - if (data == 0x43) mcu_position = 0; - return; - - case 0xb801: - return; // mcu control - - case 0xbc00: - return; // nop - } - - fhawk_main_write(address,data); -} - -static UINT8 __fastcall puzznic_main_read(UINT16 address) -{ - static UINT8 mcu_reply[8] = { 0x50, 0x1f, 0xb6, 0xba, 0x06, 0x03, 0x47, 0x05 }; - - switch (address) - { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - mux_control = (address / 2) & 1; - return BurnYM2203Read(0, address & 1); - - case 0xa800: - return 0; // nop - - case 0xb800: - if (mcu_position >= 8) return 0; - return mcu_reply[mcu_position++]; // mcu data - - case 0xb801: - return 1; // mcu status - } - - return fhawk_main_read(address); -} - - -static void __fastcall palamed_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xa803: - case 0xb000: - return; // nop - - } - - fhawk_main_write(address,data); -} - -static UINT8 __fastcall palamed_main_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - mux_control = (address / 2) & 1; - return BurnYM2203Read(0, address & 1); - - case 0xa800: - case 0xa801: - case 0xa802: - return DrvInputs[address & 3]; - - case 0xb001: - return 0; // nop - } - - return fhawk_main_read(address); -} - -static void __fastcall horshoes_main_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xb801: - case 0xbc00: - return; // nop - - case 0xb802: - horshoes_bank = data; - return; - - } - - fhawk_main_write(address,data); -} - -// horshoes trackball stuff -static UINT32 scalerange(UINT32 x, UINT32 in_min, UINT32 in_max, UINT32 out_min, UINT32 out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -static UINT16 ananice(INT16 anaval) -{ - if (anaval > 1024) anaval = 1024; - if (anaval < -1024) anaval = -1024; // clamp huge values so don't overflow INT8 conversion - UINT8 Temp = 0x7f - (anaval >> 4); - if (Temp < 0x01) Temp = 0x01; - if (Temp > 0xfe) Temp = 0xfe; - UINT16 pad = scalerange(Temp, 0x3f, 0xc0, 0x01, 0xff); - if (pad > 0xff) pad = 0xff; - if (pad > 0x75 && pad < 0x85) pad = 0x7f; - return pad; -} - -static void trackball_tick() -{ - INT32 padx = ananice(DrvAnalogPort0) - 0x7f; - track_x -= padx/2; // (-=) reversed :) - - INT32 pady = ananice(DrvAnalogPort1) - 0x7f; - track_y += pady/2; -} - -static UINT8 __fastcall horshoes_main_read(UINT16 address) -{ - switch (address) - { - case 0xa000: - case 0xa001: - case 0xa002: - case 0xa003: - mux_control = (address / 2) & 1; - return BurnYM2203Read(0, address & 1); - - case 0xa800: - return (track_y - track_y_last) & 0xff; // tracky_lo_r - - case 0xa802: track_y_last = track_y; - return 0; // tracky_reset_r - - case 0xa803: track_x_last = track_x; - return 0; // trackx_reset_r - - case 0xa804: - return (track_y - track_y_last) >> 8; // tracky_hi_r - - case 0xa808: - return (track_x - track_x_last) & 0xff; // trackx_lo_r - - case 0xa80c: - return (track_x - track_x_last) >> 8; // trackx_hi_r - } - - return fhawk_main_read(address); -} - -static void rombankswitch1(UINT8 data) -{ - cur_rombank[1] = data & 0xf; - - ZetMapMemory(DrvZ80ROM1 + (cur_rombank[1] * 0x4000), 0x8000, 0xbfff, MAP_ROM); -} - -static void __fastcall fhawk_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xc000: - rombankswitch1(data); - return; - - case 0xc800: - TC0140SYTPortWrite(data); - return; - - case 0xc801: - ZetClose(); - TC0140SYTCommWrite(data); - ZetOpen(1); - return; - - case 0xd000: - return; - - case 0xd004: - // coin counters & lockout - return; - - case 0xd005: - return; // nop - } -} - -static UINT8 __fastcall fhawk_sub_read(UINT16 address) -{ - switch (address) - { - case 0xc000: - return cur_rombank[1]; - - case 0xc801: - return TC0140SYTCommRead(); - - case 0xd000: - case 0xd001: - return DrvDips[address & 1]; - - case 0xd002: - case 0xd003: - return DrvInputs[address & 1]; - - case 0xd007: - return DrvInputs[2]; - } - - return 0; -} - -static void __fastcall champwr_sub_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - return; // nop - - case 0xe004: - // coin counters & lockout - return; - - case 0xe800: - TC0140SYTPortWrite(data); - return; - - case 0xe801: - ZetClose(); - TC0140SYTCommWrite(data); - ZetOpen(1); - return; - - case 0xf000: - rombankswitch1(data); - return; - } -} - -static UINT8 __fastcall champwr_sub_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - case 0xe001: - return DrvDips[address & 1]; - - case 0xe002: - case 0xe003: - return DrvInputs[address & 1]; - - case 0xe007: - return DrvInputs[2]; - - case 0xe801: - return TC0140SYTCommRead(); - - case 0xf000: - return cur_rombank[1]; - } - - return 0; -} - -static void __fastcall fhawk_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - TC0140SYTSlavePortWrite(data); - return; - - case 0xe001: - TC0140SYTSlaveCommWrite(data); - return; - - case 0xf000: - case 0xf001: - BurnYM2203Write(0, address & 1, data); - return; - } -} - -static UINT8 __fastcall fhawk_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe001: - return TC0140SYTSlaveCommRead(); - - case 0xf000: - case 0xf001: - return BurnYM2203Read(0, address & 1); - } - - return 0; -} - -static void __fastcall champwr_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - TC0140SYTSlavePortWrite(data); - return; - - case 0xa001: - TC0140SYTSlaveCommWrite(data); - return; - - case 0x9000: - case 0x9001: - BurnYM2203Write(0, address & 1, data); - return; - - case 0xb000: - adpcm_pos = ((adpcm_pos & 0x00ffff) | (data << 16)) & 0x1ffff; - return; - - case 0xc000: - adpcm_pos = (adpcm_pos & 0xff00ff) | (data << 8); - return; - - case 0xd000: - MSM5205ResetWrite(0,0); - return; - - case 0xe000: - MSM5205ResetWrite(0, 1); - adpcm_pos &= 0x1ff00; - return; - } -} - -static UINT8 __fastcall champwr_sound_read(UINT16 address) -{ - switch (address) - { - case 0xa001: - return TC0140SYTSlaveCommRead(); - - case 0x9000: - case 0x9001: - return BurnYM2203Read(0, address & 1); - } - - return 0; -} - -static void __fastcall evilston_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe800: - case 0xe801: - BurnYM2203Write(0, address & 1, data); - return; - } -} - -static UINT8 __fastcall evilston_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe800: - case 0xe801: - return BurnYM2203Read(0, address & 1); - } - - return 0; -} - -static void raimais_rombankswitch2(UINT8 data) -{ - cur_rombank[2] = data & 0x3; - - ZetMapMemory(DrvZ80ROM2 + (cur_rombank[2] * 0x4000), 0x4000, 0x7fff, MAP_ROM); -} - -static void __fastcall raimais_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe003: - case 0xe002: - case 0xe001: - case 0xe000: - BurnYM2610Write(address & 3, data); - return; - - case 0xe200: - TC0140SYTSlavePortWrite(data); - return; - - case 0xe201: - TC0140SYTSlaveCommWrite(data); - return; - - case 0xe400: - case 0xe401: - case 0xe402: - case 0xe403: - case 0xe600: - case 0xee00: - case 0xf000: - return; // nop - - case 0xf200: - raimais_rombankswitch2(data); - return; - } -} - -static UINT8 __fastcall raimais_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - case 0xe001: - case 0xe002: - case 0xe003: - return BurnYM2610Read(address & 3); - - case 0xe201: - return TC0140SYTSlaveCommRead(); - } - - return 0; -} - -static void champwr_msm5205_vck() -{ - if (adpcm_data != -1) - { - MSM5205DataWrite(0, adpcm_data & 0x0f); - adpcm_data = -1; - } - else - { - adpcm_data = DrvSampleROM[adpcm_pos]; - adpcm_pos = (adpcm_pos + 1) & 0x1ffff; - MSM5205DataWrite(0, adpcm_data >> 4); - } -} - -static void rombankswitch2(INT32 data) -{ - if (ZetGetActive() == -1) return; - cur_rombank[2] = data & 0x03; - - ZetMapMemory(DrvZ80ROM2 + (cur_rombank[2] * 0x4000), 0x4000, 0x7fff, MAP_ROM); -} - -static void ym2203_write_portA(UINT32, UINT32 data) -{ - rombankswitch2(data); -} - -static void champwr_ym2203_write_portB(UINT32,UINT32 data) -{ - MSM5205SetLeftVolume(0, data / 255.0); - MSM5205SetRightVolume(0, data / 255.0); -} - -static UINT8 ym2203_read_portA(UINT32) -{ - return DrvDips[mux_control]; -} - -static UINT8 ym2203_read_portB(UINT32) -{ - return DrvInputs[mux_control]; -} - -static UINT8 ym2203_read_portA1(UINT32) -{ - return DrvDips[0]; -} - -static UINT8 ym2203_read_portB1(UINT32) -{ - return DrvDips[1]; -} - -inline static void DrvIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 4000000.0; -} - -inline static INT32 DrvSynchroniseStream2(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6665280; -} - -inline static double DrvGetTime2() -{ - return (double)ZetTotalCycles() / 6665280.0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - memset (DrvPalette, 0, 0x100 * sizeof(UINT32)); - memset (DrvGfxROM2, 0, 0x10000); - memset (cur_rombank, 0xff, 3); - - ZetOpen(0); - ZetReset(); - for (INT32 i = 0; i < 4; i++) { - rambankswitch(i, 0xff); // unmap - } - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - ZetOpen(2); - ZetReset(); - if (has_ym2610) { - BurnYM2610Reset(); - } else { - BurnYM2203Reset(); - } - if (has_adpcm) { - MSM5205Reset(); - } - ZetClose(); - - TaitoICReset(); - - horshoes_bank = 0; - irq_enable = 0; - last_irq_level = 0; - current_control = 0; - flipscreen = 0; - mux_control = 0; - mcu_position = 0; - adpcm_pos = 0; - adpcm_data = -1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x100000; - DrvZ80ROM1 = Next; Next += 0x020000; - DrvZ80ROM2 = Next; Next += 0x020000; - - DrvMcuROM = Next; Next += 0x000800; - - DrvGfxROM0 = Next; Next += nGfxRomLen * 2; - DrvGfxROM1 = Next; Next += nGfxRomLen * 2; - DrvGfxROM2 = Next; Next += 0x010000; - - DrvSampleROM = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x00100 * sizeof(UINT32); - - AllRam = Next; - - DrvGfxRAM = Next; Next += 0x008000; - - DrvZ80RAM0 = Next; Next += 0x002000; - DrvZ80RAM1 = Next; Next += 0x002000; - DrvZ80RAM2 = Next; Next += 0x002000; - DrvShareRAM1 = Next; Next += 0x002000; - - DrvPalRAM = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - DrvSprBuf = Next; Next += 0x000400; - - DrvCharRAM = Next; Next += 0x0010000; - - DrvBgRAM = Next; Next += 0x0020000; - - char_banks = Next; Next += 0x000004; - irq_adr_table = Next; Next += 0x000003; - cur_rombank = Next; Next += 0x000003; - cur_rambank = Next; Next += 0x000004; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void DrvGetGfxRomLen() -{ - char* pRomName; - struct BurnRomInfo ri; - INT32 i,nGfxLen = 0; - - for (i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) - { - BurnDrvGetRomInfo(&ri, i); - - if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 4) - { - nGfxLen += ri.nLen; - } - } - - for (i = 16; i < 28; i++) { - if (nGfxLen <= (1 << i)) { - nGfxLen = 1 << i; - break; - } - } - - nGfxRomLen = nGfxLen; -} - -static INT32 DrvGfxDecode(UINT8 *src, UINT8 *dst, UINT32 len, INT32 type) -{ - INT32 Plane[4] = { 8, 12, 0, 4 }; - INT32 XOffs[16] = { STEP4(3,-1), STEP4(19,-1), STEP4(256+3,-1), STEP4(256+19,-1) }; - INT32 YOffs[16] = { STEP8(0,32), STEP8(512,32) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return 1; - } - - INT32 size = 8 << type; // 8, 16 - - memcpy (tmp, src, len); - - GfxDecode((len * 2) / (size * size), 4, size, size, Plane, XOffs, YOffs, (type) ? 0x400 : 0x100, tmp, dst); - - BurnFree (tmp); - - return 0; -} - -static INT32 FhawkInit() -{ - DrvGetGfxRomLen(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 5, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, nGfxRomLen, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, nGfxRomLen, 0); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); -// bank1 = 0x6000-7fff - ZetMapMemory(DrvShareRAM1, 0x8000, 0x9fff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xa000, 0xbfff, MAP_RAM); -// bank2 = 0xc000-cfff -// bank3 = 0xd000-dfff -// bank4 = 0xe000-efff -// bank5 = 0xf000-fdff - ZetSetWriteHandler(fhawk_main_write); - ZetSetReadHandler(fhawk_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); -// bank6 - 0x8000-bfff - ZetMapMemory(DrvShareRAM1, 0xe000, 0xffff, MAP_RAM); - ZetSetWriteHandler(fhawk_sub_write); - ZetSetReadHandler(fhawk_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); -// bank7 - 0x4000-7fff - ZetMapMemory(DrvZ80RAM2, 0x8000, 0x9fff, MAP_RAM); - ZetSetWriteHandler(fhawk_sound_write); - ZetSetReadHandler(fhawk_sound_read); - ZetClose(); - - BurnYM2203Init(1, 3000000, &DrvIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, NULL, NULL, &ym2203_write_portA, NULL); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.20, BURN_SND_ROUTE_BOTH); - - has_adpcm = 0; - - fhawkmode = 1; - - TC0140SYTInit(2); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 ChampwrInit() -{ - DrvGetGfxRomLen(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x100000, 6, 1)) return 1; - - if (BurnLoadRom(DrvSampleROM, 7, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, nGfxRomLen, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, nGfxRomLen, 0); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); -// bank1 = 0x6000-7fff - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x9fff, MAP_RAM); - ZetMapMemory(DrvShareRAM1, 0xa000, 0xbfff, MAP_RAM); -// bank2 = 0xc000-cfff -// bank3 = 0xd000-dfff -// bank4 = 0xe000-efff -// bank5 = 0xf000-fdff - ZetSetWriteHandler(fhawk_main_write); - ZetSetReadHandler(fhawk_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); -// bank6 - 0x8000-bfff - ZetMapMemory(DrvShareRAM1, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(champwr_sub_write); - ZetSetReadHandler(champwr_sub_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); -// bank7 - 0x4000-7fff - ZetMapMemory(DrvZ80RAM2, 0x8000, 0x8fff, MAP_RAM); - ZetSetWriteHandler(champwr_sound_write); - ZetSetReadHandler(champwr_sound_read); - ZetClose(); - - BurnYM2203Init(1, 3000000, &DrvIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, NULL, NULL, &ym2203_write_portA, &champwr_ym2203_write_portB); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.20, BURN_SND_ROUTE_BOTH); - - has_adpcm = 1; - MSM5205Init(0, DrvSynchroniseStream, 384000, champwr_msm5205_vck, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.80, BURN_SND_ROUTE_BOTH); - MSM5205SetSeperateVolumes(0, 1); - - TC0140SYTInit(2); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 EvilstonInit() -{ - DrvGetGfxRomLen(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 4, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, nGfxRomLen, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, nGfxRomLen, 0); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); -// bank1 = 0x6000-7fff - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x9fff, MAP_RAM); - ZetMapMemory(DrvShareRAM1, 0xa000, 0xa7ff, MAP_RAM); -// bank2 = 0xc000-cfff -// bank3 = 0xd000-dfff -// bank4 = 0xe000-efff -// bank5 = 0xf000-fdff - ZetSetWriteHandler(evilston_main_write); - ZetSetReadHandler(evilston_main_read); - ZetClose(); - - ZetInit(1); // not used - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvShareRAM1, 0xe000, 0xe7ff, MAP_RAM); - ZetMapMemory(DrvZ80ROM2+0xf000, 0xf000, 0xf7ff, MAP_ROM); // wtf? -// bank7 - 0xf000-f7ff - ZetSetWriteHandler(evilston_sound_write); - ZetSetReadHandler(evilston_sound_read); - ZetClose(); - - BurnYM2203Init(1, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.20, BURN_SND_ROUTE_BOTH); - - nmi_enable = 1; - - TC0140SYTInit(2); // not used - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 RaimaisInit() -{ - DrvGetGfxRomLen(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 3, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 5, 1)) return 1; - - if (BurnLoadRom(DrvSampleROM, 6, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, nGfxRomLen, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, nGfxRomLen, 0); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); -// bank1 = 0x6000-7fff - ZetMapMemory(DrvShareRAM1, 0x8000, 0x87ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM0, 0xa000, 0xbfff, MAP_RAM); -// bank2 = 0xc000-cfff -// bank3 = 0xd000-dfff -// bank4 = 0xe000-efff -// bank5 = 0xf000-fdff - ZetSetWriteHandler(raimais_main_write); - ZetSetReadHandler(raimais_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvShareRAM1, 0xe000, 0xe7ff, MAP_RAM); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0x3fff, MAP_ROM); -// bank7 - 0x4000-7fff - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xdfff, MAP_RAM); - ZetSetWriteHandler(raimais_sound_write); - ZetSetReadHandler(raimais_sound_read); - ZetClose(); - - has_ym2610 = 1; - INT32 DrvSndROMLen = 0x80000; - BurnYM2610Init(8000000, DrvSampleROM, &DrvSndROMLen, DrvSampleROM, &DrvSndROMLen, &DrvIRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - TC0140SYTInit(2); - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 KurikintCommonInit(INT32 loadtype) -{ - DrvGetGfxRomLen(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (loadtype == 0) // Kurikint - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 4, 1)) return 1; - } - else // Kurikinta - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40000, 4, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 5, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xc0000, 6, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 7, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40001, 8, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80001, 9, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0xc0001, 10, 2)) return 1; - } - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, nGfxRomLen, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, nGfxRomLen, 0); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); -// bank1 = 0x6000-7fff - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x9fff, MAP_RAM); - ZetMapMemory(DrvShareRAM1, 0xa000, 0xa7ff, MAP_RAM); -// bank2 = 0xc000-cfff -// bank3 = 0xd000-dfff -// bank4 = 0xe000-efff -// bank5 = 0xf000-fdff - ZetSetWriteHandler(kurikint_main_write); - ZetSetReadHandler(kurikint_main_read); - ZetClose(); - - ZetInit(1); // not used - - ZetInit(2); - ZetOpen(2); - ZetMapMemory(DrvZ80ROM2, 0x0000, 0xbfff, MAP_ROM); - ZetMapMemory(DrvZ80RAM2, 0xc000, 0xdfff, MAP_RAM); - ZetMapMemory(DrvShareRAM1, 0xe000, 0xe7ff, MAP_RAM); - ZetSetWriteHandler(evilston_sound_write); - ZetSetReadHandler(evilston_sound_read); - ZetClose(); - - BurnYM2203Init(1, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.20, BURN_SND_ROUTE_BOTH); - - TC0140SYTInit(2); // not used - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 KurikintInit() -{ - return KurikintCommonInit(0); -} - -static INT32 KurikintaInit() -{ - return KurikintCommonInit(1); -} - -static INT32 commonSingleZ80(INT32 (*pRomLoadCallback)(), void (*write)(UINT16,UINT8), UINT8 (*read)(UINT16), INT32 type) -{ - DrvGetGfxRomLen(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (pRomLoadCallback) { - if (pRomLoadCallback()) return 1; - - DrvGfxDecode(DrvGfxROM0, DrvGfxROM1, nGfxRomLen, 1); - DrvGfxDecode(DrvGfxROM0, DrvGfxROM0, nGfxRomLen, 0); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM); -// bank1 = 0x6000-7fff - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x9fff, MAP_RAM); - // puzznic needs this - if (type & 1) ZetMapMemory(DrvShareRAM1, 0xb000, 0xb7ff, MAP_RAM); // shared w/MCU? -// bank2 = 0xc000-cfff -// bank3 = 0xd000-dfff -// bank4 = 0xe000-efff -// bank5 = 0xf000-fdff - ZetSetWriteHandler((void (__fastcall*) (UINT16,UINT8))write); - ZetSetReadHandler((UINT8 (__fastcall*) (UINT16))read); - ZetClose(); - - ZetInit(1); // not used - ZetInit(2); // not used - - BurnYM2203Init(1, 13330560/4, NULL, DrvSynchroniseStream2, DrvGetTime2, 0); - - BurnTimerAttachZet(13330560/2); - - if (type & 2) { - BurnYM2203SetPorts(0, &ym2203_read_portA1, &ym2203_read_portB1, NULL, NULL); - } else { - BurnYM2203SetPorts(0, &ym2203_read_portA, &ym2203_read_portB, NULL, NULL); - } - - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.80, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.20, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.20, BURN_SND_ROUTE_BOTH); - - TC0140SYTInit(2); // not used - - DrvDoReset(); - - GenericTilesInit(); - - return 0; -} - -static INT32 PlottingRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 2, 2)) return 1; - - return 0; -} - -static INT32 PlottingInit() -{ - return commonSingleZ80(PlottingRomLoad, (void (__cdecl *)(UINT16,UINT8))plotting_main_write, (UINT8 (__cdecl *)(UINT16))plotting_main_read, 0); -} - -static INT32 PlottingaRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 2, 2)) return 1; - - for (INT32 i = 0; i < 0x10000; i++) { - DrvZ80ROM0[i] = BITSWAP08(DrvZ80ROM0[i],0,1,2,3,4,5,6,7); - } - - return 0; -} - -static INT32 PlottingaInit() -{ - return commonSingleZ80(PlottingaRomLoad, (void (__cdecl *)(UINT16,UINT8))plotting_main_write, (UINT8 (__cdecl *)(UINT16))plotting_main_read, 0); -} - -static INT32 PuzznicInit() -{ - return commonSingleZ80(PlottingRomLoad, (void (__cdecl *)(UINT16,UINT8))puzznic_main_write, (UINT8 (__cdecl *)(UINT16))puzznic_main_read, 1); -} - -static INT32 PalamedInit() -{ - return commonSingleZ80(PlottingRomLoad, (void (__cdecl *)(UINT16,UINT8))palamed_main_write, (UINT8 (__cdecl *)(UINT16))palamed_main_read, 2); -} - -static INT32 CachatRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40000, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x40001, 4, 2)) return 1; - - return 0; -} - -static INT32 CachatInit() -{ - return commonSingleZ80(CachatRomLoad, (void (__cdecl *)(UINT16,UINT8))palamed_main_write, (UINT8 (__cdecl *)(UINT16))palamed_main_read, 2); -} - -static INT32 CubybopRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80000, 2, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 3, 2)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x80001, 4, 2)) return 1; - - return 0; -} - -static INT32 CubybopInit() -{ - return commonSingleZ80(CubybopRomLoad, (void (__cdecl *)(UINT16,UINT8))palamed_main_write, (UINT8 (__cdecl *)(UINT16))palamed_main_read, 2); -} - -static INT32 LagirlRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00003, 1, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00001, 2, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00002, 3, 4)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 4, 4)) return 1; - - return 0; -} - -static INT32 LagirlInit() -{ - return commonSingleZ80(LagirlRomLoad, (void (__cdecl *)(UINT16,UINT8))palamed_main_write, (UINT8 (__cdecl *)(UINT16))palamed_main_read, 2); -} - -static INT32 Plgirls2bInit() -{ - plgirls2bmode = 1; - - return LagirlInit(); -} - -static INT32 HorshoesRomLoad() -{ - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x80000); - if (tmp == NULL) { - return 1; - } - - if (BurnLoadRom(tmp + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(tmp + 0x40000, 2, 2)) return 1; - if (BurnLoadRom(tmp + 0x00001, 3, 2)) return 1; - if (BurnLoadRom(tmp + 0x40001, 4, 2)) return 1; - - memcpy (DrvGfxROM0 + 0x00000, tmp + 0x00000, 0x20000); - memcpy (DrvGfxROM0 + 0x20000, tmp + 0x40000, 0x20000); - memcpy (DrvGfxROM0 + 0x40000, tmp + 0x20000, 0x20000); - memcpy (DrvGfxROM0 + 0x60000, tmp + 0x60000, 0x20000); - - BurnFree (tmp); - - return 0; -} - -static INT32 HorshoesInit() -{ - has_track = 1; - return commonSingleZ80(HorshoesRomLoad, (void (__cdecl *)(UINT16,UINT8))horshoes_main_write, (UINT8 (__cdecl *)(UINT16))horshoes_main_read, 0); -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - if (has_ym2610) { - BurnYM2610Exit(); - } else { - BurnYM2203Exit(); - } - - if (has_adpcm) { - MSM5205Exit(); - } - has_adpcm = 0; - has_ym2610 = 0; - nmi_enable = 0; - has_track = 0; - - fhawkmode = 0; - plgirls2bmode = 0; - - TaitoICExit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 0x200; i+=2) - { - UINT8 r = DrvPalRAM[i+0] & 0xf; - UINT8 g = DrvPalRAM[i+0] >> 4; - UINT8 b = DrvPalRAM[i+1] & 0xf; - - DrvPalette[i/2] = BurnHighCol(r+r*16, g+g*16, b+b*16, 0); - } -} - -static void draw_layer(UINT8 *ram, UINT8 *gfx, INT32 layer, INT32 prio) // 1=bg,0=fg,2=chars -{ - INT32 scrollx = 0; - INT32 scrolly = 0; - - if (layer != 2) { - INT32 sxoffset[2] = { 28+8, 38+8 }; - UINT8 *scroll = DrvSprRAM + 0x3f0 + ((layer^1) * 8); - scrollx = ((scroll[4] + (scroll[5] << 8)) + sxoffset[layer^1]) & 0x1ff; - scrolly = scroll[6]; - - scrollx = 0 - scrollx; - scrolly *= -1; - } - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= scrollx + 8; - if (plgirls2bmode && layer==0) { - sx -= scrollx - 8; //kludge for plgirls2b bootleg bg offset - } - sy -= scrolly + 16; - if (sx >= nScreenWidth) sx -= 512; - if (sy >= nScreenHeight) sy -= 256; - if (sx < -7 || sy < -7) continue; - - INT32 attr = ram[offs * 2 + 1]; - INT32 code = ram[offs * 2 + 0]; - INT32 color = attr >> 4; - - if (layer == 2) { - code |= ((attr & 1) << 8) | ((attr & 4) << 7); - } else { - code |= ((attr & 3) << 8) | (char_banks[(attr >> 2) & 3] << 10) | (horshoes_bank << 12); - code &= ((nGfxRomLen * 2) / 0x40) - 1; - } - - if (sx >= 0 && sx < (nScreenWidth - 7) && sy >= 0 && sy < (nScreenHeight - 7)) { - if (layer) { - Render8x8Tile_Prio_Mask(pTransDraw, code, sx, sy, color, 4, 0, 0, prio, gfx); - } else { - Render8x8Tile_Prio(pTransDraw, code, sx, sy, color, 4, 0, prio, gfx); - } - } else { - if (layer) { - Render8x8Tile_Prio_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, prio, gfx); - } else { - Render8x8Tile_Prio_Clip(pTransDraw, code, sx, sy, color, 4, 0, prio, gfx); - } - } - } -} - -static void draw_sprites() -{ - for (INT32 offs = 0; offs < 0x400 - 3 * 8; offs += 8) - { - INT32 color = DrvSprBuf[offs + 2] & 0x0f; - - INT32 code = DrvSprBuf[offs] | (DrvSprBuf[offs + 1] << 8) | ((horshoes_bank & 3) << 10); - code &= ((nGfxRomLen * 2) / 0x100) - 1; - - INT32 sx = DrvSprBuf[offs + 4] | ((DrvSprBuf[offs + 5] & 1) << 8); - INT32 sy = DrvSprBuf[offs + 6]; - if (sx >= 320) sx -= 512; - - INT32 flipx = DrvSprBuf[offs + 3] & 0x01; - INT32 flipy = DrvSprBuf[offs + 3] & 0x02; - - if (flipscreen) - { - sx = 304 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy -= 16; - - RenderPrioSprite(pTransDraw, DrvGfxROM1, code, color<<4, 0, sx, sy, flipx, flipy, 16, 16, (color & 0x08) ? 0xaa : 0x00); - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteInit(); - DrvRecalc = 0; - } - - if (current_control & 0x20) - { - BurnTransferClear(); - if (nBurnLayer & 1) draw_layer(DrvBgRAM + 0x1000, DrvGfxROM0, 0, 0); // BG - - if (current_control & 0x08) { - if (nBurnLayer & 2) draw_layer(DrvBgRAM + 0x0000, DrvGfxROM0, 1, 0); // FG - } else { - if (nBurnLayer & 2) draw_layer(DrvBgRAM + 0x0000, DrvGfxROM0, 1, 1); // FG - } - - if (nSpriteEnable & 1) draw_sprites(); - - if (nBurnLayer & 4) draw_layer(DrvCharRAM, DrvGfxROM2, 2, 0); // CHARS - } - else - { - BurnTransferClear(); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void scanline_update(INT32 scanline) -{ - if (ActiveZ80GetIM() != 2) - return; - - if (scanline == 120 && (irq_enable & 1)) - { - last_irq_level = 0; - ZetSetVector(irq_adr_table[last_irq_level]); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - else if (scanline == 0 && (irq_enable & 2)) - { - last_irq_level = 1; - ZetSetVector(irq_adr_table[last_irq_level]); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - else if (scanline == 240 && (irq_enable & 4)) - { - last_irq_level = 2; - ZetSetVector(irq_adr_table[last_irq_level]); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - - if (scanline == 240) { - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x400); - } -} - -static INT32 Z80x3Frame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 6665280 / 60, ((fhawkmode) ? 6665280 : 4000000) / 60, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - if (has_adpcm) - MSM5205NewFrame(0, 4000000, nInterleave); - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nCyclesDone[0] += ZetRun(nCyclesTotal[0] / nInterleave); - scanline_update(i); - ZetClose(); - - ZetOpen(1); - nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); - if (i == 240) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - ZetOpen(2); - BurnTimerUpdate((i + 1) * (nCyclesTotal[2] / nInterleave)); - if (has_adpcm) - MSM5205UpdateScanline(i); - ZetClose(); - } - - ZetOpen(2); - - BurnTimerEndFrame(nCyclesTotal[2]); - - if (pBurnSoundOut) { - if (has_ym2610) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } else { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - if (has_adpcm) { - MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - } - } - - ZetClose(); - - return 0; -} - -static INT32 Z80x2Frame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - } - - INT32 nInterleave = 256; - INT32 nCyclesTotal[3] = { 6665280 / 60, 0, 4000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - INT32 nNext = 0; - INT32 nCyclesSegment = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[0]; - nCyclesDone[0] += ZetRun(nCyclesSegment); - scanline_update(i-15); - ZetClose(); - - ZetOpen(2); - BurnTimerUpdate((i + 1) * (nCyclesTotal[2] / nInterleave)); - if (i == (nInterleave - 4) && nmi_enable) ZetNmi(); // 60hz - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - } - - ZetOpen(2); - - BurnTimerEndFrame(nCyclesTotal[2]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x400); - - return 0; -} - -static INT32 Z80x1Frame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0xff, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - if (has_track) trackball_tick(); - } - - INT32 nInterleave = 256/4; - INT32 nCyclesTotal[1] = { 6665280 / 60 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - BurnTimerUpdate(i * (nCyclesTotal[0] / nInterleave)); - scanline_update(i*4); - ZetClose(); - } - - ZetOpen(0); - - BurnTimerEndFrame(nCyclesTotal[0]); - - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x400); - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029697; - } - - if (nAction & ACB_VOLATILE) - { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All RAM"; - BurnAcb(&ba); - - ZetScan(nAction); - ZetOpen(2); - if (has_ym2610) { - BurnYM2610Scan(nAction, pnMin); - } else { - BurnYM2203Scan(nAction, pnMin); - } - if (has_adpcm) { - MSM5205Scan(nAction, pnMin); - } - ZetClose(); - TaitoICScan(nAction); - - SCAN_VAR(flipscreen); - SCAN_VAR(irq_enable); - SCAN_VAR(current_control); - SCAN_VAR(last_irq_level); - SCAN_VAR(adpcm_pos); - SCAN_VAR(mux_control); - SCAN_VAR(mcu_position); - SCAN_VAR(horshoes_bank); - } - - if (nAction & ACB_WRITE) - { - ZetOpen(0); - rambankswitch(0, cur_rambank[0]); - rambankswitch(1, cur_rambank[1]); - rambankswitch(2, cur_rambank[2]); - rambankswitch(3, cur_rambank[3]); - if (cur_rombank[0] != 0xff) rombankswitch0(cur_rombank[0]); - ZetClose(); - - if (cur_rombank[1] != 0xff) { - ZetOpen(1); - rombankswitch1(cur_rombank[1]); - ZetClose(); - } - - if (cur_rombank[2] != 0xff) - { - ZetOpen(2); - if (has_ym2610) { - raimais_rombankswitch2(cur_rombank[2]); - } else { - rombankswitch2(cur_rombank[2]); - } - ZetClose(); - } - - DrvGfxDecode(DrvGfxRAM, DrvGfxROM2, 0x8000, 0); - } - - return 0; -} - - -// Raimais (World) - -static struct BurnRomInfo raimaisRomDesc[] = { - { "b36-11-1.bin", 0x20000, 0xf19fb0d5, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "b36-09.bin", 0x20000, 0x9c466e43, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b36-07.bin", 0x10000, 0x4f3737e6, 2 | BRF_PRG | BRF_ESS }, // 2 sub z80 code - - { "b36-06.bin", 0x10000, 0x29bbc4f8, 3 | BRF_PRG | BRF_ESS }, // 3 sound z80 code - - { "b36-01.bin", 0x80000, 0x89355cb2, 4 | BRF_GRA }, // 4 graphics data - { "b36-02.bin", 0x80000, 0xe71da5db, 4 | BRF_GRA }, // 5 - - { "b36-03.bin", 0x80000, 0x96166516, 5 | BRF_SND }, // 6 samples -}; - -STD_ROM_PICK(raimais) -STD_ROM_FN(raimais) - -struct BurnDriver BurnDrvRaimais = { - "raimais", NULL, NULL, NULL, "1988", - "Raimais (World)\0", NULL, "Taito Corporation Japan", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_MISC, 0, - NULL, raimaisRomInfo, raimaisRomName, NULL, NULL, FhawkInputInfo, RaimaisDIPInfo, - RaimaisInit, DrvExit, Z80x3Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Raimais (Japan) - -static struct BurnRomInfo raimaisjRomDesc[] = { - { "b36-08-1.bin", 0x20000, 0x6cc8f79f, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "b36-09.bin", 0x20000, 0x9c466e43, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b36-07.bin", 0x10000, 0x4f3737e6, 2 | BRF_PRG | BRF_ESS }, // 2 sub z80 code - - { "b36-06.bin", 0x10000, 0x29bbc4f8, 3 | BRF_PRG | BRF_ESS }, // 3 sound z80 code - - { "b36-01.bin", 0x80000, 0x89355cb2, 4 | BRF_GRA }, // 4 graphics data - { "b36-02.bin", 0x80000, 0xe71da5db, 4 | BRF_GRA }, // 5 - - { "b36-03.bin", 0x80000, 0x96166516, 5 | BRF_SND }, // 6 samples -}; - -STD_ROM_PICK(raimaisj) -STD_ROM_FN(raimaisj) - -struct BurnDriver BurnDrvRaimaisj = { - "raimaisj", "raimais", NULL, NULL, "1988", - "Raimais (Japan)\0", NULL, "Taito Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_MISC, 0, - NULL, raimaisjRomInfo, raimaisjRomName, NULL, NULL, FhawkInputInfo, RaimaisjDIPInfo, - RaimaisInit, DrvExit, Z80x3Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Raimais (Japan, first revision) - -static struct BurnRomInfo raimaisjoRomDesc[] = { - { "b36-08.bin", 0x20000, 0xf40b9178, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "b36-09.bin", 0x20000, 0x9c466e43, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b36-07.bin", 0x10000, 0x4f3737e6, 2 | BRF_PRG | BRF_ESS }, // 2 sub z80 code - - { "b36-06.bin", 0x10000, 0x29bbc4f8, 3 | BRF_PRG | BRF_ESS }, // 3 sound z80 code - - { "b36-01.bin", 0x80000, 0x89355cb2, 4 | BRF_GRA }, // 4 graphics data - { "b36-02.bin", 0x80000, 0xe71da5db, 4 | BRF_GRA }, // 5 - - { "b36-03.bin", 0x80000, 0x96166516, 5 | BRF_SND }, // 6 samples -}; - -STD_ROM_PICK(raimaisjo) -STD_ROM_FN(raimaisjo) - -struct BurnDriver BurnDrvRaimaisjo = { - "raimaisjo", "raimais", NULL, NULL, "1988", - "Raimais (Japan, first revision)\0", NULL, "Taito Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_MISC, 0, - NULL, raimaisjoRomInfo, raimaisjoRomName, NULL, NULL, FhawkInputInfo, RaimaisjDIPInfo, - RaimaisInit, DrvExit, Z80x3Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Fighting Hawk (World) - -static struct BurnRomInfo fhawkRomDesc[] = { - { "b70-11.ic3", 0x20000, 0x7d9f7583, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "b70-03.ic2", 0x80000, 0x42d5a9b8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b70-08.ic12", 0x20000, 0x4d795f48, 2 | BRF_PRG | BRF_ESS }, // 2 sub z80 code - - { "b70-09.ic31", 0x10000, 0x85cccaa2, 3 | BRF_PRG | BRF_ESS }, // 3 sound z80 code - - { "b70-01.ic1", 0x80000, 0xfcdf67e2, 4 | BRF_GRA }, // 4 graphics data - { "b70-02.ic2", 0x80000, 0x35f7172e, 4 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(fhawk) -STD_ROM_FN(fhawk) - -struct BurnDriver BurnDrvFhawk = { - "fhawk", NULL, NULL, NULL, "1988", - "Fighting Hawk (World)\0", NULL, "Taito Corporation Japan", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, fhawkRomInfo, fhawkRomName, NULL, NULL, FhawkInputInfo, FhawkDIPInfo, - FhawkInit, DrvExit, Z80x3Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 320, 3, 4 -}; - - -// Fighting Hawk (Japan) - -static struct BurnRomInfo fhawkjRomDesc[] = { - { "b70-07.ic3", 0x20000, 0x939114af, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "b70-03.ic2", 0x80000, 0x42d5a9b8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b70-08.ic12", 0x20000, 0x4d795f48, 2 | BRF_PRG | BRF_ESS }, // 2 sub z80 code - - { "b70-09.ic31", 0x10000, 0x85cccaa2, 3 | BRF_PRG | BRF_ESS }, // 3 sound z80 code - - { "b70-01.ic1", 0x80000, 0xfcdf67e2, 4 | BRF_GRA }, // 4 graphics data - { "b70-02.ic2", 0x80000, 0x35f7172e, 4 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(fhawkj) -STD_ROM_FN(fhawkj) - -struct BurnDriver BurnDrvFhawkj = { - "fhawkj", "fhawk", NULL, NULL, "1988", - "Fighting Hawk (Japan)\0", NULL, "Taito Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, fhawkjRomInfo, fhawkjRomName, NULL, NULL, FhawkInputInfo, FhawkjDIPInfo, - FhawkInit, DrvExit, Z80x3Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 320, 3, 4 -}; - - -// Champion Wrestler (World) - -static struct BurnRomInfo champwrRomDesc[] = { - { "c01-13.rom", 0x20000, 0x7ef47525, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "c01-04.rom", 0x20000, 0x358bd076, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "c01-07.rom", 0x20000, 0x5117c98f, 2 | BRF_PRG | BRF_ESS }, // 2 sub z80 code - - { "c01-08.rom", 0x10000, 0x810efff8, 3 | BRF_PRG | BRF_ESS }, // 3 sound z80 code - - { "c01-01.rom", 0x80000, 0xf302e6e9, 4 | BRF_GRA }, // 4 graphics data - { "c01-02.rom", 0x80000, 0x1e0476c4, 4 | BRF_GRA }, // 5 - { "c01-03.rom", 0x80000, 0x2a142dbc, 4 | BRF_GRA }, // 6 - - { "c01-05.rom", 0x20000, 0x22efad4a, 5 | BRF_SND }, // 7 samples -}; - -STD_ROM_PICK(champwr) -STD_ROM_FN(champwr) - -struct BurnDriver BurnDrvChampwr = { - "champwr", NULL, NULL, NULL, "1989", - "Champion Wrestler (World)\0", NULL, "Taito Corporation Japan", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, champwrRomInfo, champwrRomName, NULL, NULL, ChampwrInputInfo, ChampwrDIPInfo, - ChampwrInit, DrvExit, Z80x3Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Champion Wrestler (US) - -static struct BurnRomInfo champwruRomDesc[] = { - { "c01-12.rom", 0x20000, 0x09f345b3, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "c01-04.rom", 0x20000, 0x358bd076, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "c01-07.rom", 0x20000, 0x5117c98f, 2 | BRF_PRG | BRF_ESS }, // 2 sub z80 code - - { "c01-08.rom", 0x10000, 0x810efff8, 3 | BRF_PRG | BRF_ESS }, // 3 sound z80 code - - { "c01-01.rom", 0x80000, 0xf302e6e9, 4 | BRF_GRA }, // 4 graphics data - { "c01-02.rom", 0x80000, 0x1e0476c4, 4 | BRF_GRA }, // 5 - { "c01-03.rom", 0x80000, 0x2a142dbc, 4 | BRF_GRA }, // 6 - - { "c01-05.rom", 0x20000, 0x22efad4a, 5 | BRF_SND }, // 7 samples -}; - -STD_ROM_PICK(champwru) -STD_ROM_FN(champwru) - -struct BurnDriver BurnDrvChampwru = { - "champwru", "champwr", NULL, NULL, "1989", - "Champion Wrestler (US)\0", NULL, "Taito America Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, champwruRomInfo, champwruRomName, NULL, NULL, ChampwrInputInfo, ChampwruDIPInfo, - ChampwrInit, DrvExit, Z80x3Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Champion Wrestler (Japan) - -static struct BurnRomInfo champwrjRomDesc[] = { - { "c01-06.bin", 0x20000, 0x90fa1409, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "c01-04.rom", 0x20000, 0x358bd076, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "c01-07.rom", 0x20000, 0x5117c98f, 2 | BRF_PRG | BRF_ESS }, // 2 sub z80 code - - { "c01-08.rom", 0x10000, 0x810efff8, 3 | BRF_PRG | BRF_ESS }, // 3 sound z80 code - - { "c01-01.rom", 0x80000, 0xf302e6e9, 4 | BRF_GRA }, // 4 graphics data - { "c01-02.rom", 0x80000, 0x1e0476c4, 4 | BRF_GRA }, // 5 - { "c01-03.rom", 0x80000, 0x2a142dbc, 4 | BRF_GRA }, // 6 - - { "c01-05.rom", 0x20000, 0x22efad4a, 5 | BRF_SND }, // 7 samples -}; - -STD_ROM_PICK(champwrj) -STD_ROM_FN(champwrj) - -struct BurnDriver BurnDrvChampwrj = { - "champwrj", "champwr", NULL, NULL, "1989", - "Champion Wrestler (Japan)\0", NULL, "Taito Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, champwrjRomInfo, champwrjRomName, NULL, NULL, ChampwrInputInfo, ChampwrjDIPInfo, - ChampwrInit, DrvExit, Z80x3Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Kuri Kinton (World) - -static struct BurnRomInfo kurikintRomDesc[] = { - { "b42-09.ic2", 0x20000, 0xe97c4394, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "b42-06.ic6", 0x20000, 0xfa15fd65, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b42-07.ic22", 0x10000, 0x0f2719c0, 3 | BRF_PRG | BRF_ESS }, // 2 sound z80 code - - { "b42-01.ic1", 0x80000, 0x7d1a1fec, 4 | BRF_GRA }, // 3 graphics data - { "b42-02.ic5", 0x80000, 0x1a52e65c, 4 | BRF_GRA }, // 4 -}; - -STD_ROM_PICK(kurikint) -STD_ROM_FN(kurikint) - -struct BurnDriver BurnDrvKurikint = { - "kurikint", NULL, NULL, NULL, "1988", - "Kuri Kinton (World)\0", NULL, "Taito Corporation Japan", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, kurikintRomInfo, kurikintRomName, NULL, NULL, FhawkInputInfo, KurikintDIPInfo, - KurikintInit, DrvExit, Z80x2Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Kuri Kinton (US) - -static struct BurnRomInfo kurikintuRomDesc[] = { - { "b42-08.ic2", 0x20000, 0x7075122e, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "b42-06.ic6", 0x20000, 0xfa15fd65, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b42-07.ic22", 0x10000, 0x0f2719c0, 3 | BRF_PRG | BRF_ESS }, // 2 sound z80 code - - { "b42-01.ic1", 0x80000, 0x7d1a1fec, 4 | BRF_GRA }, // 3 graphics data - { "b42-02.ic5", 0x80000, 0x1a52e65c, 4 | BRF_GRA }, // 4 -}; - -STD_ROM_PICK(kurikintu) -STD_ROM_FN(kurikintu) - -struct BurnDriver BurnDrvKurikintu = { - "kurikintu", "kurikint", NULL, NULL, "1988", - "Kuri Kinton (US)\0", NULL, "Taito America Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, kurikintuRomInfo, kurikintuRomName, NULL, NULL, FhawkInputInfo, KurikintjDIPInfo, - KurikintInit, DrvExit, Z80x2Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Kuri Kinton (Japan) - -static struct BurnRomInfo kurikintjRomDesc[] = { - { "b42-05.ic2", 0x20000, 0x077222b8, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "b42-06.ic6", 0x20000, 0xfa15fd65, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b42-07.ic22", 0x10000, 0x0f2719c0, 3 | BRF_PRG | BRF_ESS }, // 2 sound z80 code - - { "b42-01.ic1", 0x80000, 0x7d1a1fec, 4 | BRF_GRA }, // 3 graphics data - { "b42-02.ic5", 0x80000, 0x1a52e65c, 4 | BRF_GRA }, // 4 -}; - -STD_ROM_PICK(kurikintj) -STD_ROM_FN(kurikintj) - -struct BurnDriver BurnDrvKurikintj = { - "kurikintj", "kurikint", NULL, NULL, "1988", - "Kuri Kinton (Japan)\0", NULL, "Taito Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, kurikintjRomInfo, kurikintjRomName, NULL, NULL, FhawkInputInfo, KurikintjDIPInfo, - KurikintInit, DrvExit, Z80x2Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Kuri Kinton (World, prototype?) - -static struct BurnRomInfo kurikintaRomDesc[] = { - { "kk_ic2.ic2", 0x20000, 0x908603f2, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "kk_ic6.ic6", 0x20000, 0xa4a957b1, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b42-07.ic22", 0x10000, 0x0f2719c0, 3 | BRF_PRG | BRF_ESS }, // 2 sound z80 code - - { "kk_1-1l.rom", 0x20000, 0xdf1d4fcd, 4 | BRF_GRA }, // 3 graphics data - { "kk_2-2l.rom", 0x20000, 0xfca7f647, 4 | BRF_GRA }, // 4 - { "kk_5-3l.rom", 0x20000, 0xd080fde1, 4 | BRF_GRA }, // 5 - { "kk_7-4l.rom", 0x20000, 0xf5bf6829, 4 | BRF_GRA }, // 6 - { "kk_3-1h.rom", 0x20000, 0x71af848e, 4 | BRF_GRA }, // 7 - { "kk_4-2h.rom", 0x20000, 0xcebb5bac, 4 | BRF_GRA }, // 8 - { "kk_6-3h.rom", 0x20000, 0x322e3752, 4 | BRF_GRA }, // 9 - { "kk_8-4h.rom", 0x20000, 0x117bde99, 4 | BRF_GRA }, // 10 -}; - -STD_ROM_PICK(kurikinta) -STD_ROM_FN(kurikinta) - -struct BurnDriver BurnDrvKurikinta = { - "kurikinta", "kurikint", NULL, NULL, "1988", - "Kuri Kinton (World, prototype?)\0", NULL, "Taito Corporation Japan", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, kurikintaRomInfo, kurikintaRomName, NULL, NULL, FhawkInputInfo, KurikintaDIPInfo, - KurikintaInit, DrvExit, Z80x2Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Plotting (World set 1) - -static struct BurnRomInfo plottingRomDesc[] = { - { "ic10", 0x10000, 0xbe240921, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "b96-07.ic9", 0x10000, 0x0713a387, 4 | BRF_GRA }, // 1 graphics data - { "b96-08.ic8", 0x10000, 0x55b8e294, 4 | BRF_GRA }, // 2 - - { "gal16v8-b86-04.bin", 0x00117, 0xbf8c0ea0, 0 | BRF_OPT }, // 3 plds -}; - -STD_ROM_PICK(plotting) -STD_ROM_FN(plotting) - -struct BurnDriver BurnDrvPlotting = { - "plotting", NULL, NULL, NULL, "1989", - "Plotting (World set 1)\0", NULL, "Taito Corporation Japan", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, plottingRomInfo, plottingRomName, NULL, NULL, PlottingInputInfo, PlottingDIPInfo, - PlottingInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Plotting (World set 2, protected) - -static struct BurnRomInfo plottingaRomDesc[] = { - { "plot01.ic10", 0x10000, 0x5b30bc25, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "b96-02.ic9", 0x10000, 0x6e0bad2a, 4 | BRF_GRA }, // 1 graphics data - { "b96-03.ic8", 0x10000, 0xfb5f3ca4, 4 | BRF_GRA }, // 2 - - { "gal16v8-b86-04.bin", 0x00117, 0xbf8c0ea0, 0 | BRF_OPT }, // 3 plds -}; - -STD_ROM_PICK(plottinga) -STD_ROM_FN(plottinga) - -struct BurnDriver BurnDrvPlottinga = { - "plottinga", "plotting", NULL, NULL, "1989", - "Plotting (World set 2, protected)\0", NULL, "Taito Corporation Japan", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, plottingaRomInfo, plottingaRomName, NULL, NULL, PlottingInputInfo, PlottingDIPInfo, - PlottingaInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Plotting (World set 3, earliest version) - -static struct BurnRomInfo plottingbRomDesc[] = { - { "b96-06.ic10", 0x10000, 0xf89a54b1, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "b96-02.ic9", 0x10000, 0x6e0bad2a, 4 | BRF_GRA }, // 1 graphics data - { "b96-03.ic8", 0x10000, 0xfb5f3ca4, 4 | BRF_GRA }, // 2 - - { "gal16v8-b86-04.bin", 0x00117, 0xbf8c0ea0, 0 | BRF_OPT }, // 3 plds -}; - -STD_ROM_PICK(plottingb) -STD_ROM_FN(plottingb) - -struct BurnDriver BurnDrvPlottingb = { - "plottingb", "plotting", NULL, NULL, "1989", - "Plotting (World set 3, earliest version)\0", NULL, "Taito Corporation Japan", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, plottingbRomInfo, plottingbRomName, NULL, NULL, PlottingInputInfo, PlottingDIPInfo, - PlottingInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Plotting (US) - -static struct BurnRomInfo plottinguRomDesc[] = { - { "b96-05.ic10", 0x10000, 0xafb99d1f, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "b96-02.ic9", 0x10000, 0x6e0bad2a, 4 | BRF_GRA }, // 1 graphics data - { "b96-03.ic8", 0x10000, 0xfb5f3ca4, 4 | BRF_GRA }, // 2 - - { "b96-04.ic12", 0x00104, 0x9390a782, 0 | BRF_OPT }, // 3 plds -}; - -STD_ROM_PICK(plottingu) -STD_ROM_FN(plottingu) - -struct BurnDriver BurnDrvPlottingu = { - "plottingu", "plotting", NULL, NULL, "1989", - "Plotting (US)\0", NULL, "Taito America Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, plottinguRomInfo, plottinguRomName, NULL, NULL, PlottingInputInfo, PlottinguDIPInfo, - PlottingInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Flipull (Japan) - -static struct BurnRomInfo flipullRomDesc[] = { - { "b96-01.ic10", 0x10000, 0x65993978, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "b96-07.ic9", 0x10000, 0x0713a387, 4 | BRF_GRA }, // 1 graphics data - { "b96-08.ic8", 0x10000, 0x55b8e294, 4 | BRF_GRA }, // 2 - - { "gal16v8-b86-04.bin", 0x00117, 0xbf8c0ea0, 0 | BRF_OPT }, // 3 plds -}; - -STD_ROM_PICK(flipull) -STD_ROM_FN(flipull) - -struct BurnDriver BurnDrvFlipull = { - "flipull", "plotting", NULL, NULL, "1989", - "Flipull (Japan)\0", NULL, "Taito Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, flipullRomInfo, flipullRomName, NULL, NULL, PlottingInputInfo, PlottingDIPInfo, - PlottingInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Puzznic (World) - -static struct BurnRomInfo puzznicRomDesc[] = { - { "c20-09.ic11", 0x20000, 0x156d6de1, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "c20-07.ic10", 0x10000, 0xbe12749a, 4 | BRF_GRA }, // 1 graphics data - { "c20-06.ic9", 0x10000, 0xac85a9c5, 4 | BRF_GRA }, // 2 - - { "c20-01.ic4", 0x00800, 0x085f68b4, 9 | BRF_PRG | BRF_ESS }, // 3 mcu code - - { "mmipal20l8.ic3", 0x00800, 0x00000000, 0 | BRF_NODUMP }, // 4 pals -}; - -STD_ROM_PICK(puzznic) -STD_ROM_FN(puzznic) - -struct BurnDriver BurnDrvPuzznic = { - "puzznic", NULL, NULL, NULL, "1989", - "Puzznic (World)\0", NULL, "Taito Corporation Japan", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, puzznicRomInfo, puzznicRomName, NULL, NULL, PuzznicInputInfo, PuzznicDIPInfo, - PuzznicInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Puzznic (US) - -static struct BurnRomInfo puzznicuRomDesc[] = { - { "c20-10.ic11", 0x20000, 0x3522d2e5, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "c20-03.ic10", 0x20000, 0x4264056c, 4 | BRF_GRA }, // 1 graphics data - { "c20-02.ic9", 0x20000, 0x3c115f8b, 4 | BRF_GRA }, // 2 - - { "c20-01.ic4", 0x00800, 0x085f68b4, 9 | BRF_PRG | BRF_ESS }, // 3 mcu code - - { "mmipal20l8.ic3", 0x00800, 0x00000000, 0 | BRF_NODUMP }, // 4 pals -}; - -STD_ROM_PICK(puzznicu) -STD_ROM_FN(puzznicu) - -struct BurnDriver BurnDrvPuzznicu = { - "puzznicu", "puzznic", NULL, NULL, "1989", - "Puzznic (US)\0", NULL, "Taito America Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, puzznicuRomInfo, puzznicuRomName, NULL, NULL, PuzznicInputInfo, PuzznicDIPInfo, - PuzznicInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Puzznic (Japan) - -static struct BurnRomInfo puzznicjRomDesc[] = { - { "c20-04.ic11", 0x20000, 0xa4150b6c, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "c20-03.ic10", 0x20000, 0x4264056c, 4 | BRF_GRA }, // 1 graphics data - { "c20-02.ic9", 0x20000, 0x3c115f8b, 4 | BRF_GRA }, // 2 - - { "c20-01.ic4", 0x00800, 0x085f68b4, 9 | BRF_PRG | BRF_ESS }, // 3 mcu code - - { "c20-05.ic3", 0x00144, 0xf90e5594, 0 | BRF_GRA }, // 4 pals -}; - -STD_ROM_PICK(puzznicj) -STD_ROM_FN(puzznicj) - -struct BurnDriver BurnDrvPuzznicj = { - "puzznicj", "puzznic", NULL, NULL, "1989", - "Puzznic (Japan)\0", NULL, "Taito Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, puzznicjRomInfo, puzznicjRomName, NULL, NULL, PuzznicInputInfo, PuzznicDIPInfo, - PuzznicInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Puzznic (Italian bootleg) - -static struct BurnRomInfo puzzniciRomDesc[] = { - { "1.ic11", 0x20000, 0x4612f5e0, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "u10.ic10", 0x20000, 0x4264056c, 4 | BRF_GRA }, // 1 graphics data - { "3.ic9", 0x20000, 0x2bf5232a, 4 | BRF_GRA }, // 2 -}; - -STD_ROM_PICK(puzznici) -STD_ROM_FN(puzznici) - -struct BurnDriver BurnDrvPuzznici = { - "puzznici", "puzznic", NULL, NULL, "1989", - "Puzznic (Italian bootleg)\0", NULL, "bootleg", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, puzzniciRomInfo, puzzniciRomName, NULL, NULL, PuzznicInputInfo, PuzznicDIPInfo, - PuzznicInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Puzznic (bootleg, set 1) - -static struct BurnRomInfo puzznicbRomDesc[] = { - { "ic11.bin", 0x20000, 0x2510df4d, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "ic10.bin", 0x10000, 0xbe12749a, 4 | BRF_GRA }, // 1 graphics data - { "ic9.bin", 0x10000, 0x0f183340, 4 | BRF_GRA }, // 2 -}; - -STD_ROM_PICK(puzznicb) -STD_ROM_FN(puzznicb) - -struct BurnDriver BurnDrvPuzznicb = { - "puzznicb", "puzznic", NULL, NULL, "1989", - "Puzznic (bootleg, set 1)\0", NULL, "bootleg", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, puzznicbRomInfo, puzznicbRomName, NULL, NULL, PuzznicInputInfo, PuzznicDIPInfo, - PuzznicInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Puzznic (bootleg, set 2) - -static struct BurnRomInfo puzznicbaRomDesc[] = { - { "18.ic10", 0x20000, 0x8349eb3b, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "19.ic9", 0x20000, 0x4264056c, 4 | BRF_GRA }, // 1 graphics data - { "20.ic8", 0x20000, 0x3c115f8b, 4 | BRF_GRA }, // 2 -}; - -STD_ROM_PICK(puzznicba) -STD_ROM_FN(puzznicba) - -struct BurnDriver BurnDrvPuzznicba = { - "puzznicba", "puzznic", NULL, NULL, "1989", - "Puzznic (bootleg, set 2)\0", NULL, "bootleg", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, puzznicbaRomInfo, puzznicbaRomName, NULL, NULL, PuzznicInputInfo, PuzznicDIPInfo, - PuzznicInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Palamedes (US) -/* Prototype or location test?? - Line 5 of notice screen says "Territory" later sets say "Territories" */ - -static struct BurnRomInfo palamedRomDesc[] = { - { "palamedes_prg_ic6.ic6", 0x20000, 0xee957b0e, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "chr-l_ic9.ic9", 0x20000, 0xc7bbe460, 4 | BRF_GRA }, // 1 graphics data - { "chr-h_ic7.ic7", 0x20000, 0xfcd86e44, 4 | BRF_GRA }, // 2 -}; - -STD_ROM_PICK(palamed) -STD_ROM_FN(palamed) - -struct BurnDriver BurnDrvPalamed = { - "palamed", NULL, NULL, NULL, "1990", - "Palamedes (US)\0", NULL, "Hot-B Co., Ltd.", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, palamedRomInfo, palamedRomName, NULL, NULL, PalamedInputInfo, PalamedDIPInfo, - PalamedInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Palamedes (Japan) - -static struct BurnRomInfo palamedjRomDesc[] = { - { "c63-02.ic6", 0x20000, 0x55a82bb2, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "c63-04.ic9", 0x20000, 0xc7bbe460, 4 | BRF_GRA }, // 1 graphics data - { "c63-03.ic7", 0x20000, 0xfcd86e44, 4 | BRF_GRA }, // 2 -}; - -STD_ROM_PICK(palamedj) -STD_ROM_FN(palamedj) - -struct BurnDriver BurnDrvPalamedj = { - "palamedj", "palamed", NULL, NULL, "1990", - "Palamedes (Japan)\0", NULL, "Taito Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, palamedjRomInfo, palamedjRomName, NULL, NULL, PalamedInputInfo, PalamedDIPInfo, - PalamedInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Cachat (Japan) - -static struct BurnRomInfo cachatRomDesc[] = { - { "cac6", 0x20000, 0x8105cf5f, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "cac9", 0x20000, 0xbc462914, 4 | BRF_GRA }, // 1 graphics data - { "cac10", 0x20000, 0xecc64b31, 4 | BRF_GRA }, // 2 - { "cac7", 0x20000, 0x7fb71578, 4 | BRF_GRA }, // 3 - { "cac8", 0x20000, 0xd2a63799, 4 | BRF_GRA }, // 4 - - { "pal20l8b-c63-01.14", 0x00144, 0x14a7dd2a, 0 | BRF_OPT }, // 5 plds -}; - -STD_ROM_PICK(cachat) -STD_ROM_FN(cachat) - -struct BurnDriver BurnDrvCachat = { - "cachat", NULL, NULL, NULL, "1993", - "Cachat (Japan)\0", NULL, "Taito Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, cachatRomInfo, cachatRomName, NULL, NULL, CachatInputInfo, CachatDIPInfo, - CachatInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Cuby Bop (location test) - -static struct BurnRomInfo cubybopRomDesc[] = { - { "cb06.6", 0x40000, 0x66b89a85, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "cb09.9", 0x40000, 0x5f831e59, 4 | BRF_GRA }, // 1 graphics data - { "cb10.10", 0x40000, 0x430510fc, 4 | BRF_GRA }, // 2 - { "cb07.7", 0x40000, 0x3582de99, 4 | BRF_GRA }, // 3 - { "cb08.8", 0x40000, 0x09e18a51, 4 | BRF_GRA }, // 4 -}; - -STD_ROM_PICK(cubybop) -STD_ROM_FN(cubybop) - -struct BurnDriver BurnDrvCubybop = { - "cubybop", NULL, NULL, NULL, "199?", - "Cuby Bop (location test)\0", NULL, "Hot-B Co., Ltd.", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, cubybopRomInfo, cubybopRomName, NULL, NULL, CubybopInputInfo, CubybopDIPInfo, - CubybopInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Tube-It - -static struct BurnRomInfo tubeitRomDesc[] = { - { "t-i_02.6", 0x20000, 0x54730669, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "t-i_04.9", 0x40000, 0xb4a6e31d, 4 | BRF_GRA }, // 1 graphics data - { "t-i_03.7", 0x40000, 0xe1c3fed0, 4 | BRF_GRA }, // 2 - - { "pal20l8b-c63-01.14", 0x00144, 0x14a7dd2a, 0 | BRF_OPT }, // 3 plds -}; - -STD_ROM_PICK(tubeit) -STD_ROM_FN(tubeit) - -struct BurnDriver BurnDrvTubeit = { - "tubeit", "cachat", NULL, NULL, "1993", - "Tube-It\0", NULL, "bootleg", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, tubeitRomInfo, tubeitRomName, NULL, NULL, TubeitInputInfo, TubeitDIPInfo, - PalamedInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 320, 224, 4, 3 -}; - - -// Play Girls - -static struct BurnRomInfo plgirlsRomDesc[] = { - { "pg03.ic6", 0x40000, 0x6ca73092, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "pg02.ic9", 0x40000, 0x3cf05ca9, 4 | BRF_GRA }, // 1 graphics data - { "pg01.ic7", 0x40000, 0x79e41e74, 4 | BRF_GRA }, // 2 -}; - -STD_ROM_PICK(plgirls) -STD_ROM_FN(plgirls) - -struct BurnDriver BurnDrvPlgirls = { - "plgirls", NULL, NULL, NULL, "1992", - "Play Girls\0", NULL, "Hot-B Co., Ltd.", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, plgirlsRomInfo, plgirlsRomName, NULL, NULL, PlgirlsInputInfo, PlgirlsDIPInfo, - PalamedInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 320, 3, 4 -}; - - -// LA Girl - -static struct BurnRomInfo lagirlRomDesc[] = { - { "rom1", 0x40000, 0xba1acfdb, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "rom2", 0x20000, 0x4c739a30, 4 | BRF_GRA }, // 1 graphics data - { "rom3", 0x20000, 0x4cf22a4b, 4 | BRF_GRA }, // 2 - { "rom4", 0x20000, 0x7dcd6696, 4 | BRF_GRA }, // 3 - { "rom5", 0x20000, 0xb1782816, 4 | BRF_GRA }, // 4 -}; - -STD_ROM_PICK(lagirl) -STD_ROM_FN(lagirl) - -struct BurnDriver BurnDrvLagirl = { - "lagirl", "plgirls", NULL, NULL, "1992", - "LA Girl\0", NULL, "bootleg", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, lagirlRomInfo, lagirlRomName, NULL, NULL, PlgirlsInputInfo, PlgirlsDIPInfo, - LagirlInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 320, 3, 4 -}; - - -// Play Girls 2 - -static struct BurnRomInfo plgirls2RomDesc[] = { - { "pg2_1j.ic6", 0x40000, 0xf924197a, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "cho-l.ic9", 0x80000, 0x956384ec, 4 | BRF_GRA }, // 1 graphics data - { "cho-h.ic7", 0x80000, 0x992f99b1, 4 | BRF_GRA }, // 2 -}; - -STD_ROM_PICK(plgirls2) -STD_ROM_FN(plgirls2) - -struct BurnDriver BurnDrvPlgirls2 = { - "plgirls2", NULL, NULL, NULL, "1993", - "Play Girls 2\0", NULL, "Hot-B Co., Ltd.", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, plgirls2RomInfo, plgirls2RomName, NULL, NULL, PlgirlsInputInfo, Plgirls2DIPInfo, - PalamedInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 320, 3, 4 -}; - - -// Play Girls 2 (bootleg) - -static struct BurnRomInfo plgirls2bRomDesc[] = { - { "playgirls2b.d1", 0x40000, 0xd58159fa, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "playgirls2b.d8", 0x40000, 0x22df48b5, 4 | BRF_GRA }, // 1 graphics data - { "playgirls2b.d4", 0x40000, 0xbc9e2192, 4 | BRF_GRA }, // 2 - { "playgirls2b.d3", 0x40000, 0x75d82fab, 4 | BRF_GRA }, // 3 - { "playgirls2b.b6", 0x40000, 0xaac6c90b, 4 | BRF_GRA }, // 4 -}; - -STD_ROM_PICK(plgirls2b) -STD_ROM_FN(plgirls2b) - -struct BurnDriver BurnDrvPlgirls2b = { - "plgirls2b", "plgirls2", NULL, NULL, "1993", - "Play Girls 2 (bootleg)\0", NULL, "bootleg", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, plgirls2bRomInfo, plgirls2bRomName, NULL, NULL, PlgirlsInputInfo, Plgirls2DIPInfo, - Plgirls2bInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 320, 3, 4 -}; - - -// American Horseshoes (US) - -static struct BurnRomInfo horshoesRomDesc[] = { - { "c47-03.ic6", 0x20000, 0x37e15b20, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - - { "c47-02.ic5", 0x20000, 0x35f96526, 4 | BRF_GRA }, // 1 graphics data - { "c47-01.ic11", 0x20000, 0x031c73d8, 4 | BRF_GRA }, // 2 - { "c47-04.ic4", 0x20000, 0xaeac7121, 4 | BRF_GRA }, // 3 - { "c47-05.ic10", 0x20000, 0xb2a3dafe, 4 | BRF_GRA }, // 4 - - { "c47-06.ic12", 0x00144, 0x4342ca6c, 0 | BRF_OPT }, // 5 plds -}; - -STD_ROM_PICK(horshoes) -STD_ROM_FN(horshoes) - -struct BurnDriver BurnDrvHorshoes = { - "horshoes", NULL, NULL, NULL, "1990", - "American Horseshoes (US)\0", NULL, "Taito America Corporation", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_SPORTSMISC, 0, - NULL, horshoesRomInfo, horshoesRomName, NULL, NULL, HorshoesInputInfo, HorshoesDIPInfo, - HorshoesInit, DrvExit, Z80x1Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 320, 3, 4 -}; - - -// Evil Stone - -static struct BurnRomInfo evilstonRomDesc[] = { - { "c67-03.ic2", 0x20000, 0x53419982, 1 | BRF_PRG | BRF_ESS }, // 0 main z80 code - { "c67-04.ic6", 0x20000, 0x55d57e19, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "c67-05.ic22", 0x20000, 0x94d3a642, 2 | BRF_PRG | BRF_ESS }, // 2 sound z80 code - - { "c67-01.ic1", 0x80000, 0x2f351bf4, 4 | BRF_GRA }, // 3 graphics data - { "c67-02.ic5", 0x80000, 0xeb4f895c, 4 | BRF_GRA }, // 4 -}; - -STD_ROM_PICK(evilston) -STD_ROM_FN(evilston) - -struct BurnDriver BurnDrvEvilston = { - "evilston", NULL, NULL, NULL, "1990", - "Evil Stone\0", NULL, "Spacy Industrial, Ltd.", "L-System", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, evilstonRomInfo, evilstonRomName, NULL, NULL, EvilstonInputInfo, EvilstonDIPInfo, - EvilstonInit, DrvExit, Z80x2Frame, DrvDraw, DrvScan, &DrvRecalc, 0x100, - 224, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/taito/d_taitomisc.cpp b/jan/src/burn/drv/taito/d_taitomisc.cpp deleted file mode 100644 index df626e10e..000000000 --- a/jan/src/burn/drv/taito/d_taitomisc.cpp +++ /dev/null @@ -1,6567 +0,0 @@ -// PC080SN & PC090OJ based games -// Based on MAME drivers by Bryan McPhail, Nicola Salmoria, Jarek Burczynski, and David Graves - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "taito.h" -#include "taito_ic.h" -#include "msm5205.h" -#include "burn_ym2151.h" -#include "burn_ym2203.h" -#include "burn_gun.h" -#include "burn_shift.h" - -static UINT32 RastanADPCMPos; -static INT32 RastanADPCMData; -static INT32 RastanADPCMInReset; -static UINT32 TopspeedADPCMPos; -static INT32 TopspeedADPCMData; -static INT32 TopspeedADPCMInReset; -static UINT8 OpwolfADPCM_B[0x08]; -static UINT8 OpwolfADPCM_C[0x08]; -static UINT32 OpwolfADPCMPos[2]; -static UINT32 OpwolfADPCMEnd[2]; -static INT32 OpwolfADPCMData[2]; -static INT32 OpWolfGunXOffset; -static INT32 OpWolfGunYOffset; -static INT32 bUseGuns = 0; -static INT32 bUseShifter = 0; - -static UINT8 DariusADPCMCommand; -static INT32 DariusNmiEnable; -static UINT16 DariusCoinWord; -static UINT32 DariusDefVol[0x10]; -static UINT8 DariusVol[8]; -static UINT8 DariusPan[5]; -static double DariusYM2203AY8910RouteMasterVol; -static double DariusYM2203RouteMasterVol; -static double DariusMSM5205RouteMasterVol; - -static UINT16 VolfiedVidCtrl; -static UINT16 VolfiedVidMask; - -static INT32 RainbowCChipVer = 0; - -static UINT8 z80ctc_load; -static INT32 z80ctc_constant; -static INT32 z80ctc_ctr; - -static UINT16 *pTopspeedTempDraw = NULL; -static UINT16 *DrvPriBmp = NULL; - -static void DariusDraw(); -static void OpwolfDraw(); -static void RbislandDraw(); -static void JumpingDraw(); -static void RastanDraw(); -static void TopspeedDraw(); -static void VolfiedDraw(); - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo DariusInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort2 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort2 + 2, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort2 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort2 + 3, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TaitoInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TaitoInputPort0 + 3, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort0 + 2, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TaitoInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TaitoInputPort1 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TaitoInputPort1 + 2, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort2 + 4, "service" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort2 + 5, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Darius) - -static struct BurnInputInfo OpwolfInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort1 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort0 + 1, "p2 coin" }, - - A("P1 Gun X" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "mouse x-axis" ), - A("P1 Gun Y" , BIT_ANALOG_REL, &TaitoAnalogPort1 , "mouse y-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 0, "mouse button 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 1, "mouse button 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort1 + 2, "service" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort1 + 3, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Opwolf) - -static struct BurnInputInfo RbislandInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort1 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , TaitoInputPort2 + 4, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort2 + 5, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort2 + 6, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort2 + 7, "p1 fire 2" }, - - {"P2 Left" , BIT_DIGITAL , TaitoInputPort3 + 4, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TaitoInputPort3 + 5, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort3 + 6, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort3 + 7, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort0 + 7, "service" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Rbisland) - -static struct BurnInputInfo JumpingInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 4, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort0 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p2 start" }, - - {"P1 Left" , BIT_DIGITAL , TaitoInputPort1 + 7, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort1 + 6, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 1, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 2, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Jumping) - -static struct BurnInputInfo RastanInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort3 + 5, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort3 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort3 + 6, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort3 + 4, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TaitoInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TaitoInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TaitoInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort0 + 3, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort0 + 4, "p1 fire 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p1 fire 2" }, - - {"P2 Up" , BIT_DIGITAL , TaitoInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TaitoInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TaitoInputPort1 + 3, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort1 + 4, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TaitoInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort3 + 0, "service" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort3 + 2, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Rastan) - -static struct BurnInputInfo TopspeedInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p2 coin" }, - - A("P1 Steering" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - {"P1 Fire 1 (Gas)" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p1 fire 1" }, - {"P1 Fire 2 (Break)" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p1 fire 2" }, - {"P1 Fire 3 (Nitro)" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p1 fire 3" }, - {"P1 Fire 4 (Gear)" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p1 fire 4" }, - {"P1 Fire 5" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p1 fire 5" }, - {"P1 Fire 6" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 fire 6" }, - {"P1 Fire 7" , BIT_DIGITAL , TC0220IOCInputPort1 + 6, "p1 fire 7" }, - {"P1 Fire 8" , BIT_DIGITAL , TC0220IOCInputPort0 + 6, "p1 fire 8" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Topspeed) - -static struct BurnInputInfo VolfiedInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TaitoInputPort1 + 0, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TaitoInputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TaitoInputPort1 + 1, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TaitoInputPort0 + 5, "p2 start" }, - - {"P1 Up" , BIT_DIGITAL , TaitoInputPort2 + 2, "p1 up" }, - {"P1 Down" , BIT_DIGITAL , TaitoInputPort2 + 3, "p1 down" }, - {"P1 Left" , BIT_DIGITAL , TaitoInputPort2 + 4, "p1 left" }, - {"P1 Right" , BIT_DIGITAL , TaitoInputPort2 + 5, "p1 right" }, - {"P1 Fire 1" , BIT_DIGITAL , TaitoInputPort2 + 6, "p1 fire 1" }, - - {"P2 Up" , BIT_DIGITAL , TaitoInputPort3 + 1, "p2 up" }, - {"P2 Down" , BIT_DIGITAL , TaitoInputPort3 + 2, "p2 down" }, - {"P2 Left" , BIT_DIGITAL , TaitoInputPort3 + 3, "p2 left" }, - {"P2 Right" , BIT_DIGITAL , TaitoInputPort3 + 4, "p2 right" }, - {"P2 Fire 1" , BIT_DIGITAL , TaitoInputPort3 + 5, "p2 fire 1" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TaitoInputPort0 + 7, "service" }, - {"Tilt" , BIT_DIGITAL , TaitoInputPort2 + 0, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Volfied) - -#undef A - -static void DariusMakeInputs() -{ - // Reset Inputs - TaitoInput[0] = 0xff; - TaitoInput[1] = 0xff; - TaitoInput[2] = 0xfc; - TaitoInput[3] = 0xff; - - if (TaitoInputPort0[0]) TaitoInput[0] -= 0x01; - if (TaitoInputPort0[1]) TaitoInput[0] -= 0x02; - if (TaitoInputPort0[2]) TaitoInput[0] -= 0x04; - if (TaitoInputPort0[3]) TaitoInput[0] -= 0x08; - if (TaitoInputPort0[4]) TaitoInput[0] -= 0x10; - if (TaitoInputPort0[5]) TaitoInput[0] -= 0x20; - if (TaitoInputPort0[6]) TaitoInput[0] -= 0x40; - if (TaitoInputPort0[7]) TaitoInput[0] -= 0x80; - - if (TaitoInputPort1[0]) TaitoInput[1] -= 0x01; - if (TaitoInputPort1[1]) TaitoInput[1] -= 0x02; - if (TaitoInputPort1[2]) TaitoInput[1] -= 0x04; - if (TaitoInputPort1[3]) TaitoInput[1] -= 0x08; - if (TaitoInputPort1[4]) TaitoInput[1] -= 0x10; - if (TaitoInputPort1[5]) TaitoInput[1] -= 0x20; - if (TaitoInputPort1[6]) TaitoInput[1] -= 0x40; - if (TaitoInputPort1[7]) TaitoInput[1] -= 0x80; - - if (TaitoInputPort2[0]) TaitoInput[2] |= 0x01; - if (TaitoInputPort2[1]) TaitoInput[2] |= 0x02; - if (TaitoInputPort2[2]) TaitoInput[2] -= 0x04; - if (TaitoInputPort2[3]) TaitoInput[2] -= 0x08; - if (TaitoInputPort2[4]) TaitoInput[2] -= 0x10; - if (TaitoInputPort2[5]) TaitoInput[2] -= 0x20; - if (TaitoInputPort2[6]) TaitoInput[2] -= 0x40; - if (TaitoInputPort2[7]) TaitoInput[2] -= 0x80; -} - -static void OpwolfMakeInputs() -{ - // Reset Inputs - TaitoInput[0] = 0xfc; - TaitoInput[1] = 0xff; - TaitoInput[2] = 0xff; - TaitoInput[3] = 0xff; - - if (TaitoInputPort0[0]) TaitoInput[0] |= 0x01; - if (TaitoInputPort0[1]) TaitoInput[0] |= 0x02; - if (TaitoInputPort0[2]) TaitoInput[0] -= 0x04; - if (TaitoInputPort0[3]) TaitoInput[0] -= 0x08; - if (TaitoInputPort0[4]) TaitoInput[0] -= 0x10; - if (TaitoInputPort0[5]) TaitoInput[0] -= 0x20; - if (TaitoInputPort0[6]) TaitoInput[0] -= 0x40; - if (TaitoInputPort0[7]) TaitoInput[0] -= 0x80; - - if (TaitoInputPort1[0]) TaitoInput[1] -= 0x01; - if (TaitoInputPort1[1]) TaitoInput[1] -= 0x02; - if (TaitoInputPort1[2]) TaitoInput[1] -= 0x04; - if (TaitoInputPort1[3]) TaitoInput[1] -= 0x08; - if (TaitoInputPort1[4]) TaitoInput[1] -= 0x10; - if (TaitoInputPort1[5]) TaitoInput[1] -= 0x20; - if (TaitoInputPort1[6]) TaitoInput[1] -= 0x40; - if (TaitoInputPort1[7]) TaitoInput[1] -= 0x80; - - BurnGunMakeInputs(0, (INT16)TaitoAnalogPort0, (INT16)TaitoAnalogPort1); - - OpwolfCChipUpdate(TaitoInput[0], TaitoInput[1]); -} - -static void OpwolfbMakeInputs() -{ - // Reset Inputs - TaitoInput[0] = 0xfc; - TaitoInput[1] = 0xff; - TaitoInput[2] = 0xff; - TaitoInput[3] = 0xff; - - if (TaitoInputPort0[0]) TaitoInput[0] |= 0x01; - if (TaitoInputPort0[1]) TaitoInput[0] |= 0x02; - if (TaitoInputPort0[2]) TaitoInput[0] -= 0x04; - if (TaitoInputPort0[3]) TaitoInput[0] -= 0x08; - if (TaitoInputPort0[4]) TaitoInput[0] -= 0x10; - if (TaitoInputPort0[5]) TaitoInput[0] -= 0x20; - if (TaitoInputPort0[6]) TaitoInput[0] -= 0x40; - if (TaitoInputPort0[7]) TaitoInput[0] -= 0x80; - - if (TaitoInputPort1[0]) TaitoInput[1] -= 0x01; - if (TaitoInputPort1[1]) TaitoInput[1] -= 0x02; - if (TaitoInputPort1[2]) TaitoInput[1] -= 0x04; - if (TaitoInputPort1[3]) TaitoInput[1] -= 0x08; - if (TaitoInputPort1[4]) TaitoInput[1] -= 0x10; - if (TaitoInputPort1[5]) TaitoInput[1] -= 0x20; - if (TaitoInputPort1[6]) TaitoInput[1] -= 0x40; - if (TaitoInputPort1[7]) TaitoInput[1] -= 0x80; - - BurnGunMakeInputs(0, (INT16)TaitoAnalogPort0, (INT16)TaitoAnalogPort1); -} - -static void RbislandMakeInputs() -{ - // Reset Inputs - TaitoInput[0] = 0xff; - TaitoInput[1] = 0xfc; - TaitoInput[2] = 0xff; - TaitoInput[3] = 0xff; - - if (TaitoInputPort0[0]) TaitoInput[0] -= 0x01; - if (TaitoInputPort0[1]) TaitoInput[0] -= 0x02; - if (TaitoInputPort0[2]) TaitoInput[0] -= 0x04; - if (TaitoInputPort0[3]) TaitoInput[0] -= 0x08; - if (TaitoInputPort0[4]) TaitoInput[0] -= 0x10; - if (TaitoInputPort0[5]) TaitoInput[0] -= 0x20; - if (TaitoInputPort0[6]) TaitoInput[0] -= 0x40; - if (TaitoInputPort0[7]) TaitoInput[0] -= 0x80; - - if (TaitoInputPort1[0]) TaitoInput[1] |= 0x01; - if (TaitoInputPort1[1]) TaitoInput[1] |= 0x02; - if (TaitoInputPort1[2]) TaitoInput[1] -= 0x04; - if (TaitoInputPort1[3]) TaitoInput[1] -= 0x08; - if (TaitoInputPort1[4]) TaitoInput[1] -= 0x10; - if (TaitoInputPort1[5]) TaitoInput[1] -= 0x20; - if (TaitoInputPort1[6]) TaitoInput[1] -= 0x40; - if (TaitoInputPort1[7]) TaitoInput[1] -= 0x80; - - if (TaitoInputPort2[0]) TaitoInput[2] -= 0x01; - if (TaitoInputPort2[1]) TaitoInput[2] -= 0x02; - if (TaitoInputPort2[2]) TaitoInput[2] -= 0x04; - if (TaitoInputPort2[3]) TaitoInput[2] -= 0x08; - if (TaitoInputPort2[4]) TaitoInput[2] -= 0x10; - if (TaitoInputPort2[5]) TaitoInput[2] -= 0x20; - if (TaitoInputPort2[6]) TaitoInput[2] -= 0x40; - if (TaitoInputPort2[7]) TaitoInput[2] -= 0x80; - - if (TaitoInputPort3[0]) TaitoInput[3] -= 0x01; - if (TaitoInputPort3[1]) TaitoInput[3] -= 0x02; - if (TaitoInputPort3[2]) TaitoInput[3] -= 0x04; - if (TaitoInputPort3[3]) TaitoInput[3] -= 0x08; - if (TaitoInputPort3[4]) TaitoInput[3] -= 0x10; - if (TaitoInputPort3[5]) TaitoInput[3] -= 0x20; - if (TaitoInputPort3[6]) TaitoInput[3] -= 0x40; - if (TaitoInputPort3[7]) TaitoInput[3] -= 0x80; - - RainbowCChipUpdate(TaitoInput[0], TaitoInput[1], TaitoInput[2], TaitoInput[3]); -} - -static void JumpingMakeInputs() -{ - // Reset Inputs - TaitoInput[0] = 0xff; - TaitoInput[1] = 0xff; - TaitoInput[2] = 0xff; - TaitoInput[3] = 0xff; - - if (TaitoInputPort0[0]) TaitoInput[0] -= 0x01; - if (TaitoInputPort0[1]) TaitoInput[0] -= 0x02; - if (TaitoInputPort0[2]) TaitoInput[0] -= 0x04; - if (TaitoInputPort0[3]) TaitoInput[0] -= 0x08; - if (TaitoInputPort0[4]) TaitoInput[0] -= 0x10; - if (TaitoInputPort0[5]) TaitoInput[0] -= 0x20; - if (TaitoInputPort0[6]) TaitoInput[0] -= 0x40; - if (TaitoInputPort0[7]) TaitoInput[0] -= 0x80; - - if (TaitoInputPort1[0]) TaitoInput[1] -= 0x01; - if (TaitoInputPort1[1]) TaitoInput[1] -= 0x02; - if (TaitoInputPort1[2]) TaitoInput[1] -= 0x04; - if (TaitoInputPort1[3]) TaitoInput[1] -= 0x08; - if (TaitoInputPort1[4]) TaitoInput[1] -= 0x10; - if (TaitoInputPort1[5]) TaitoInput[1] -= 0x20; - if (TaitoInputPort1[6]) TaitoInput[1] -= 0x40; - if (TaitoInputPort1[7]) TaitoInput[1] -= 0x80; -} - -static void RastanMakeInputs() -{ - // Reset Inputs - TaitoInput[0] = 0xff; - TaitoInput[1] = 0xff; - TaitoInput[2] = 0x8f; - TaitoInput[3] = 0x1f; - - if (TaitoInputPort0[0]) TaitoInput[0] -= 0x01; - if (TaitoInputPort0[1]) TaitoInput[0] -= 0x02; - if (TaitoInputPort0[2]) TaitoInput[0] -= 0x04; - if (TaitoInputPort0[3]) TaitoInput[0] -= 0x08; - if (TaitoInputPort0[4]) TaitoInput[0] -= 0x10; - if (TaitoInputPort0[5]) TaitoInput[0] -= 0x20; - if (TaitoInputPort0[6]) TaitoInput[0] -= 0x40; - if (TaitoInputPort0[7]) TaitoInput[0] -= 0x80; - - if (TaitoInputPort1[0]) TaitoInput[1] -= 0x01; - if (TaitoInputPort1[1]) TaitoInput[1] -= 0x02; - if (TaitoInputPort1[2]) TaitoInput[1] -= 0x04; - if (TaitoInputPort1[3]) TaitoInput[1] -= 0x08; - if (TaitoInputPort1[4]) TaitoInput[1] -= 0x10; - if (TaitoInputPort1[5]) TaitoInput[1] -= 0x20; - if (TaitoInputPort1[6]) TaitoInput[1] -= 0x40; - if (TaitoInputPort1[7]) TaitoInput[1] -= 0x80; - - if (TaitoInputPort3[0]) TaitoInput[3] -= 0x01; - if (TaitoInputPort3[1]) TaitoInput[3] -= 0x02; - if (TaitoInputPort3[2]) TaitoInput[3] -= 0x04; - if (TaitoInputPort3[3]) TaitoInput[3] -= 0x08; - if (TaitoInputPort3[4]) TaitoInput[3] -= 0x10; - if (TaitoInputPort3[5]) TaitoInput[3] |= 0x20; - if (TaitoInputPort3[6]) TaitoInput[3] |= 0x40; - if (TaitoInputPort3[7]) TaitoInput[3] |= 0x80; -} - -static void TopspeedMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0x13; - TC0220IOCInput[1] = 0x0f; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] -= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] |= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] |= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] -= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] |= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] |= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] |= 0x80; - - if (TC0220IOCInputPort1[0]) TC0220IOCInput[1] -= 0x01; - if (TC0220IOCInputPort1[1]) TC0220IOCInput[1] -= 0x02; - if (TC0220IOCInputPort1[2]) TC0220IOCInput[1] -= 0x04; - if (TC0220IOCInputPort1[3]) TC0220IOCInput[1] -= 0x08; -// if (TC0220IOCInputPort1[4]) TC0220IOCInput[1] |= 0x10; - - BurnShiftInputCheckToggle(TC0220IOCInputPort1[4]); - TC0220IOCInput[1] |= ((bBurnShiftStatus) ? 0x00 : 0x10); - if (TC0220IOCInputPort1[5]) TC0220IOCInput[1] |= 0x20; - if (TC0220IOCInputPort1[6]) TC0220IOCInput[1] |= 0x40; - if (TC0220IOCInputPort1[7]) TC0220IOCInput[1] |= 0x80; - - if (TC0220IOCInputPort2[0]) TC0220IOCInput[2] -= 0x01; - if (TC0220IOCInputPort2[1]) TC0220IOCInput[2] -= 0x02; - if (TC0220IOCInputPort2[2]) TC0220IOCInput[2] -= 0x04; - if (TC0220IOCInputPort2[3]) TC0220IOCInput[2] -= 0x08; - if (TC0220IOCInputPort2[4]) TC0220IOCInput[2] -= 0x10; - if (TC0220IOCInputPort2[5]) TC0220IOCInput[2] -= 0x20; - if (TC0220IOCInputPort2[6]) TC0220IOCInput[2] -= 0x40; - if (TC0220IOCInputPort2[7]) TC0220IOCInput[2] -= 0x80; -} - - -static void VolfiedMakeInputs() -{ - // Reset Inputs - TaitoInput[0] = 0xff; - TaitoInput[1] = 0xfc; - TaitoInput[2] = 0xff; - TaitoInput[3] = 0xff; - - if (TaitoInputPort0[0]) TaitoInput[0] -= 0x01; - if (TaitoInputPort0[1]) TaitoInput[0] -= 0x02; - if (TaitoInputPort0[2]) TaitoInput[0] -= 0x04; - if (TaitoInputPort0[3]) TaitoInput[0] -= 0x08; - if (TaitoInputPort0[4]) TaitoInput[0] -= 0x10; - if (TaitoInputPort0[5]) TaitoInput[0] -= 0x20; - if (TaitoInputPort0[6]) TaitoInput[0] -= 0x40; - if (TaitoInputPort0[7]) TaitoInput[0] -= 0x80; - - if (TaitoInputPort1[0]) TaitoInput[1] |= 0x01; - if (TaitoInputPort1[1]) TaitoInput[1] |= 0x02; - if (TaitoInputPort1[2]) TaitoInput[1] -= 0x04; - if (TaitoInputPort1[3]) TaitoInput[1] -= 0x08; - if (TaitoInputPort1[4]) TaitoInput[1] -= 0x10; - if (TaitoInputPort1[5]) TaitoInput[1] -= 0x20; - if (TaitoInputPort1[6]) TaitoInput[1] -= 0x40; - if (TaitoInputPort1[7]) TaitoInput[1] -= 0x80; - - if (TaitoInputPort2[0]) TaitoInput[2] -= 0x01; - if (TaitoInputPort2[1]) TaitoInput[2] -= 0x02; - if (TaitoInputPort2[2]) TaitoInput[2] -= 0x04; - if (TaitoInputPort2[3]) TaitoInput[2] -= 0x08; - if (TaitoInputPort2[4]) TaitoInput[2] -= 0x10; - if (TaitoInputPort2[5]) TaitoInput[2] -= 0x20; - if (TaitoInputPort2[6]) TaitoInput[2] -= 0x40; - if (TaitoInputPort2[7]) TaitoInput[2] -= 0x80; - - if (TaitoInputPort3[0]) TaitoInput[3] -= 0x01; - if (TaitoInputPort3[1]) TaitoInput[3] -= 0x02; - if (TaitoInputPort3[2]) TaitoInput[3] -= 0x04; - if (TaitoInputPort3[3]) TaitoInput[3] -= 0x08; - if (TaitoInputPort3[4]) TaitoInput[3] -= 0x10; - if (TaitoInputPort3[5]) TaitoInput[3] -= 0x20; - if (TaitoInputPort3[6]) TaitoInput[3] -= 0x40; - if (TaitoInputPort3[7]) TaitoInput[3] -= 0x80; -} - -static struct BurnDIPInfo DariusDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Unknown" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Auto Fire" }, - {0x13, 0x01, 0x02, 0x02, "Normal" }, - {0x13, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "Every 600k" }, - {0x14, 0x01, 0x0c, 0x0c, "600k only" }, - {0x14, 0x01, 0x0c, 0x04, "800k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Unknown" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Darius) - -static struct BurnDIPInfo DariusuDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Unknown" }, - {0x13, 0x01, 0x01, 0x01, "Off" }, - {0x13, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Auto Fire" }, - {0x13, 0x01, 0x02, 0x02, "Normal" }, - {0x13, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "Every 600k" }, - {0x14, 0x01, 0x0c, 0x0c, "600k only" }, - {0x14, 0x01, 0x0c, 0x04, "800k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Unknown" }, - {0x14, 0x01, 0x40, 0x40, "Off" }, - {0x14, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "yes" }, -}; - -STDDIPINFO(Dariusu) - -static struct BurnDIPInfo DariusjDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Auto Fire" }, - {0x13, 0x01, 0x02, 0x02, "Normal" }, - {0x13, 0x01, 0x02, 0x00, "Fast" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "Every 600k" }, - {0x14, 0x01, 0x0c, 0x0c, "600k only" }, - {0x14, 0x01, 0x0c, 0x04, "800k only" }, - {0x14, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Unknown" }, - {0x14, 0x01, 0x80, 0x80, "Off" }, - {0x14, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Dariusj) - -static struct BurnDIPInfo OpwolfDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xfd, NULL }, - {0x0b, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0a, 0x01, 0x02, 0x02, "Off" }, - {0x0a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x08, 0x00, "Off" }, - {0x0a, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0a, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0a, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0a, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0x03, 0x02, "Easy" }, - {0x0b, 0x01, 0x03, 0x03, "Medium" }, - {0x0b, 0x01, 0x03, 0x01, "Hard" }, - {0x0b, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Ammo Magazines at Start" }, - {0x0b, 0x01, 0x0c, 0x00, "4" }, - {0x0b, 0x01, 0x0c, 0x04, "5" }, - {0x0b, 0x01, 0x0c, 0x0c, "6" }, - {0x0b, 0x01, 0x0c, 0x08, "7" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0b, 0x01, 0x80, 0x80, "Japanese" }, - {0x0b, 0x01, 0x80, 0x00, "English" }, -}; - -STDDIPINFO(Opwolf) - -static struct BurnDIPInfo OpwolfuDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xfd, NULL }, - {0x0b, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0a, 0x01, 0x02, 0x02, "Off" }, - {0x0a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x08, 0x00, "Off" }, - {0x0a, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0a, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0a, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0a, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0a, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0a, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0a, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0x03, 0x02, "Easy" }, - {0x0b, 0x01, 0x03, 0x03, "Medium" }, - {0x0b, 0x01, 0x03, 0x01, "Hard" }, - {0x0b, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Ammo Magazines at Start" }, - {0x0b, 0x01, 0x0c, 0x00, "4" }, - {0x0b, 0x01, 0x0c, 0x04, "5" }, - {0x0b, 0x01, 0x0c, 0x0c, "6" }, - {0x0b, 0x01, 0x0c, 0x08, "7" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x0b, 0x01, 0x80, 0x80, "Japanese" }, - {0x0b, 0x01, 0x80, 0x00, "English" }, -}; - -STDDIPINFO(Opwolfu) - -static struct BurnDIPInfo OpwolfbDIPList[]= -{ - // Default Values - {0x0a, 0xff, 0xff, 0xfd, NULL }, - {0x0b, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0a, 0x01, 0x02, 0x02, "Off" }, - {0x0a, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0a, 0x01, 0x04, 0x04, "Off" }, - {0x0a, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0a, 0x01, 0x08, 0x00, "Off" }, - {0x0a, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0a, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0a, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0a, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0a, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0a, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0a, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0b, 0x01, 0x03, 0x02, "Easy" }, - {0x0b, 0x01, 0x03, 0x03, "Medium" }, - {0x0b, 0x01, 0x03, 0x01, "Hard" }, - {0x0b, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Ammo Magazines at Start" }, - {0x0b, 0x01, 0x0c, 0x00, "4" }, - {0x0b, 0x01, 0x0c, 0x04, "5" }, - {0x0b, 0x01, 0x0c, 0x0c, "6" }, - {0x0b, 0x01, 0x0c, 0x08, "7" }, -}; - -STDDIPINFO(Opwolfb) - -static struct BurnDIPInfo RbislandDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xfe, NULL }, - {0x10, 0xff, 0xff, 0xbf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0f, 0x01, 0x01, 0x00, "Upright" }, - {0x0f, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x0f, 0x01, 0x02, 0x02, "Off" }, - {0x0f, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0f, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x10, 0x01, 0x03, 0x02, "Easy" }, - {0x10, 0x01, 0x03, 0x03, "Medium" }, - {0x10, 0x01, 0x03, 0x01, "Hard" }, - {0x10, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x10, 0x01, 0x04, 0x04, "100k, 1000k" }, - {0x10, 0x01, 0x04, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Complete Bonus" }, - {0x10, 0x01, 0x08, 0x08, "1 Up" }, - {0x10, 0x01, 0x08, 0x00, "100k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x10, 0x01, 0x30, 0x10, "1" }, - {0x10, 0x01, 0x30, 0x00, "2" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x20, "4" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x10, 0x01, 0x40, 0x00, "English" }, - {0x10, 0x01, 0x40, 0x40, "Japanese" }, -}; - -STDDIPINFO(Rbisland) - -static struct BurnDIPInfo JumpingDIPList[]= -{ - // Default Values - {0x09, 0xff, 0xff, 0xfe, NULL }, - {0x0a, 0xff, 0xff, 0xbf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x09, 0x01, 0x08, 0x00, "Off" }, - {0x09, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x09, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x09, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x09, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x09, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x09, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x09, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x09, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x09, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0a, 0x01, 0x03, 0x02, "Easy" }, - {0x0a, 0x01, 0x03, 0x03, "Medium" }, - {0x0a, 0x01, 0x03, 0x01, "Hard" }, - {0x0a, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Bonus Life" }, - {0x0a, 0x01, 0x04, 0x04, "100k, 1000k" }, - {0x0a, 0x01, 0x04, 0x00, "None" }, - - {0 , 0xfe, 0 , 2 , "Complete Bonus" }, - {0x0a, 0x01, 0x08, 0x08, "1 Up" }, - {0x0a, 0x01, 0x08, 0x00, "100k" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0a, 0x01, 0x30, 0x10, "1" }, - {0x0a, 0x01, 0x30, 0x00, "2" }, - {0x0a, 0x01, 0x30, 0x30, "3" }, - {0x0a, 0x01, 0x30, 0x20, "4" }, -}; - -STDDIPINFO(Jumping) - -static struct BurnDIPInfo RastanDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "100k, 200k, 400k, 600k, 800k"}, - {0x14, 0x01, 0x0c, 0x08, "150k, 300k, 600k, 900k, 1200k"}, - {0x14, 0x01, 0x0c, 0x04, "200k, 400k, 800k, 1200k, 1600k"}, - {0x14, 0x01, 0x0c, 0x00, "250k, 500k, 1000k, 1500k, 2000k"}, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Rastan) - -static struct BurnDIPInfo RastsagaDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x13, 0x01, 0x01, 0x00, "Upright" }, - {0x13, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "100k, 200k, 400k, 600k, 800k"}, - {0x14, 0x01, 0x0c, 0x08, "150k, 300k, 600k, 900k, 1200k"}, - {0x14, 0x01, 0x0c, 0x04, "200k, 400k, 800k, 1200k, 1600k"}, - {0x14, 0x01, 0x0c, 0x00, "250k, 500k, 1000k, 1500k, 2000k"}, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - {0x14, 0x01, 0x30, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Rastsaga) - -static struct BurnDIPInfo TopspeedDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Cabinet" }, - {0x0f, 0x01, 0x03, 0x03, "Deluxe Motorized Cabinet" }, - {0x0f, 0x01, 0x03, 0x02, "Upright" }, - {0x0f, 0x01, 0x03, 0x01, "Upright (alt)" }, - {0x0f, 0x01, 0x03, 0x00, "Standard Cockpit" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0f, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0f, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0f, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0f, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0f, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Initial Time" }, - {0x10, 0x01, 0x0c, 0x00, "40 seconds" }, - {0x10, 0x01, 0x0c, 0x04, "50 seconds" }, - {0x10, 0x01, 0x0c, 0x0c, "60 seconds" }, - {0x10, 0x01, 0x0c, 0x08, "70 seconds" }, - - {0 , 0xfe, 0 , 4 , "Nitros" }, - {0x10, 0x01, 0x30, 0x20, "2" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x10, "4" }, - {0x10, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x10, 0x01, 0x40, 0x40, "Off" }, - {0x10, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Continue Price" }, - {0x10, 0x01, 0x80, 0x00, "1 Coin 1 Credit" }, - {0x10, 0x01, 0x80, 0x80, "Same as start" }, -}; - -STDDIPINFO(Topspeed) - -static struct BurnDIPInfo FullthrlDIPList[]= -{ - // Default Values - {0x0f, 0xff, 0xff, 0xff, NULL }, - {0x10, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Cabinet" }, - {0x0f, 0x01, 0x03, 0x03, "Deluxe Motorized Cabinet" }, - {0x0f, 0x01, 0x03, 0x02, "Upright" }, - {0x0f, 0x01, 0x03, 0x01, "Upright (alt)" }, - {0x0f, 0x01, 0x03, 0x00, "Standard Cockpit" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0f, 0x01, 0x04, 0x04, "Off" }, - {0x0f, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0f, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0f, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0f, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0f, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0f, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Initial Time" }, - {0x10, 0x01, 0x0c, 0x00, "40 seconds" }, - {0x10, 0x01, 0x0c, 0x04, "50 seconds" }, - {0x10, 0x01, 0x0c, 0x0c, "60 seconds" }, - {0x10, 0x01, 0x0c, 0x08, "70 seconds" }, - - {0 , 0xfe, 0 , 4 , "Nitros" }, - {0x10, 0x01, 0x30, 0x20, "2" }, - {0x10, 0x01, 0x30, 0x30, "3" }, - {0x10, 0x01, 0x30, 0x10, "4" }, - {0x10, 0x01, 0x30, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x10, 0x01, 0x40, 0x40, "Off" }, - {0x10, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Continue Price" }, - {0x10, 0x01, 0x80, 0x00, "1 Coin 1 Credit" }, - {0x10, 0x01, 0x80, 0x80, "Same as start" }, -}; - -STDDIPINFO(Fullthrl) - -static struct BurnDIPInfo VolfiedDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, - {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x11, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x11, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x12, 0x01, 0x03, 0x02, "20k 40k 120k 480k 2400k" }, - {0x12, 0x01, 0x03, 0x03, "50k 150k 600k 3000k" }, - {0x12, 0x01, 0x03, 0x01, "70k 280k 1400k" }, - {0x12, 0x01, 0x03, 0x00, "100k 500k" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Medium" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 5 , "Lives" }, - {0x12, 0x01, 0x70, 0x70, "3" }, - {0x12, 0x01, 0x70, 0x60, "4" }, - {0x12, 0x01, 0x70, 0x50, "5" }, - {0x12, 0x01, 0x70, 0x40, "6" }, - {0x12, 0x01, 0x70, 0x00, "32768" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x12, 0x01, 0x80, 0x80, "Japanese" }, - {0x12, 0x01, 0x80, 0x00, "English" }, -}; - -STDDIPINFO(Volfied) - -static struct BurnDIPInfo VolfiedjDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, - {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x11, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x11, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x11, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x11, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x11, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x11, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x12, 0x01, 0x03, 0x02, "20k 40k 120k 480k 2400k" }, - {0x12, 0x01, 0x03, 0x03, "50k 150k 600k 3000k" }, - {0x12, 0x01, 0x03, 0x01, "70k 280k 1400k" }, - {0x12, 0x01, 0x03, 0x00, "100k 500k" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Medium" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 5 , "Lives" }, - {0x12, 0x01, 0x70, 0x70, "3" }, - {0x12, 0x01, 0x70, 0x60, "4" }, - {0x12, 0x01, 0x70, 0x50, "5" }, - {0x12, 0x01, 0x70, 0x40, "6" }, - {0x12, 0x01, 0x70, 0x00, "32768" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x12, 0x01, 0x80, 0x80, "Japanese" }, - {0x12, 0x01, 0x80, 0x00, "English" }, -}; - -STDDIPINFO(Volfiedj) - -static struct BurnDIPInfo VolfieduDIPList[]= -{ - // Default Values - {0x11, 0xff, 0xff, 0xfe, NULL }, - {0x12, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x11, 0x01, 0x01, 0x00, "Upright" }, - {0x11, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x11, 0x01, 0x02, 0x02, "Off" }, - {0x11, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x11, 0x01, 0x04, 0x04, "Off" }, - {0x11, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x00, "Off" }, - {0x11, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x11, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x11, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x12, 0x01, 0x03, 0x02, "20k 40k 120k 480k 2400k" }, - {0x12, 0x01, 0x03, 0x03, "50k 150k 600k 3000k" }, - {0x12, 0x01, 0x03, 0x01, "70k 280k 1400k" }, - {0x12, 0x01, 0x03, 0x00, "100k 500k" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x12, 0x01, 0x0c, 0x08, "Easy" }, - {0x12, 0x01, 0x0c, 0x0c, "Medium" }, - {0x12, 0x01, 0x0c, 0x04, "Hard" }, - {0x12, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 5 , "Lives" }, - {0x12, 0x01, 0x70, 0x70, "3" }, - {0x12, 0x01, 0x70, 0x60, "4" }, - {0x12, 0x01, 0x70, 0x50, "5" }, - {0x12, 0x01, 0x70, 0x40, "6" }, - {0x12, 0x01, 0x70, 0x00, "32768" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x12, 0x01, 0x80, 0x80, "Japanese" }, - {0x12, 0x01, 0x80, 0x00, "English" }, -}; - -STDDIPINFO(Volfiedu) - -static struct BurnRomInfo DariusRomDesc[] = { - { "a96_59-1.186", 0x10000, 0x11aab4eb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_58-1.152", 0x10000, 0x5f71e697, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_61-2.187", 0x10000, 0x4736aa9b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_66-2.153", 0x10000, 0x4ede5f56, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_31.188", 0x10000, 0xe9bb5d89, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_30.154", 0x10000, 0x9eb5e127, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "a96_33-1.190", 0x10000, 0xff186048, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_32-1.157", 0x10000, 0xd9719de8, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_35-1.191", 0x10000, 0xb3280193, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_34-1.158", 0x10000, 0xca3b2573, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "a96_57.33", 0x10000, 0x33ceb730, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "a96_56.18", 0x10000, 0x292ef55c, BRF_ESS | BRF_PRG | TAITO_Z80ROM2 }, - - { "a96_48.24", 0x10000, 0x39c9b3aa, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_51.47", 0x10000, 0x1bf8f0d3, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_49.25", 0x10000, 0x37a7d88a, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_52.48", 0x10000, 0x2d9b2128, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_50.26", 0x10000, 0x75d738e4, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_53.49", 0x10000, 0x0173484c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "a96_54.143", 0x04000, 0x51c02ae2, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - { "a96_55.144", 0x04000, 0x771e4d98, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - - { "a96_44.179", 0x10000, 0xbbc18878, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_45.200", 0x10000, 0x616cdd8b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_46.180", 0x10000, 0xfec35418, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_47.201", 0x10000, 0x8df9286a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_40.177", 0x10000, 0xb699a51e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_41.198", 0x10000, 0x97128a3a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_42.178", 0x10000, 0x7f55ee0f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_43.199", 0x10000, 0xc7cad469, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_62.175", 0x10000, 0x9179862c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_63.196", 0x10000, 0xfa19cfff, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_64.176", 0x10000, 0x814c676f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_65.197", 0x10000, 0x14eee326, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "a96-24.163", 0x00400, 0x0fa8be7f, BRF_OPT }, - { "a96-25.164", 0x00400, 0x265508a6, BRF_OPT }, - { "a96-26.165", 0x00400, 0x4891b9c0, BRF_OPT }, -}; - -STD_ROM_PICK(Darius) -STD_ROM_FN(Darius) - -static struct BurnRomInfo DariusuRomDesc[] = { - { "a96_59-1.186", 0x10000, 0x11aab4eb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_58-1.152", 0x10000, 0x5f71e697, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_61-2.187", 0x10000, 0x4736aa9b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_60-2.153", 0x10000, 0x9bf58617, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_31.188", 0x10000, 0xe9bb5d89, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_30.154", 0x10000, 0x9eb5e127, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "a96_33-1.190", 0x10000, 0xff186048, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_32-1.157", 0x10000, 0xd9719de8, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_35-1.191", 0x10000, 0xb3280193, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_34-1.158", 0x10000, 0xca3b2573, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "a96_57.33", 0x10000, 0x33ceb730, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "a96_56.18", 0x10000, 0x292ef55c, BRF_ESS | BRF_PRG | TAITO_Z80ROM2 }, - - { "a96_48.24", 0x10000, 0x39c9b3aa, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_51.47", 0x10000, 0x1bf8f0d3, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_49.25", 0x10000, 0x37a7d88a, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_52.48", 0x10000, 0x2d9b2128, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_50.26", 0x10000, 0x75d738e4, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_53.49", 0x10000, 0x0173484c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "a96_54.143", 0x04000, 0x51c02ae2, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - { "a96_55.144", 0x04000, 0x771e4d98, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - - { "a96_44.179", 0x10000, 0xbbc18878, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_45.200", 0x10000, 0x616cdd8b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_46.180", 0x10000, 0xfec35418, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_47.201", 0x10000, 0x8df9286a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_40.177", 0x10000, 0xb699a51e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_41.198", 0x10000, 0x97128a3a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_42.178", 0x10000, 0x7f55ee0f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_43.199", 0x10000, 0xc7cad469, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_62.175", 0x10000, 0x9179862c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_63.196", 0x10000, 0xfa19cfff, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_64.176", 0x10000, 0x814c676f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_65.197", 0x10000, 0x14eee326, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "a96-24.163", 0x00400, 0x0fa8be7f, BRF_OPT }, - { "a96-25.164", 0x00400, 0x265508a6, BRF_OPT }, - { "a96-26.165", 0x00400, 0x4891b9c0, BRF_OPT }, -}; - -STD_ROM_PICK(Dariusu) -STD_ROM_FN(Dariusu) - -static struct BurnRomInfo DariusjRomDesc[] = { - { "a96_29-1.185", 0x10000, 0x75486f62, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_28-1.152", 0x10000, 0xfb34d400, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_31.187", 0x10000, 0xe9bb5d89, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_30.154", 0x10000, 0x9eb5e127, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "a96_33-1.190", 0x10000, 0xff186048, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_32-1.157", 0x10000, 0xd9719de8, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_35-1.191", 0x10000, 0xb3280193, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_34-1.158", 0x10000, 0xca3b2573, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "a96_57.33", 0x10000, 0x33ceb730, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "a96_56.18", 0x10000, 0x292ef55c, BRF_ESS | BRF_PRG | TAITO_Z80ROM2 }, - - { "a96_48.24", 0x10000, 0x39c9b3aa, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_51.47", 0x10000, 0x1bf8f0d3, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_49.25", 0x10000, 0x37a7d88a, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_52.48", 0x10000, 0x2d9b2128, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_50.26", 0x10000, 0x75d738e4, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_53.49", 0x10000, 0x0173484c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "a96_54.143", 0x04000, 0x51c02ae2, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - { "a96_55.144", 0x04000, 0x771e4d98, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - - { "a96_44.179", 0x10000, 0xbbc18878, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_45.200", 0x10000, 0x616cdd8b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_46.180", 0x10000, 0xfec35418, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_47.201", 0x10000, 0x8df9286a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_40.177", 0x10000, 0xb699a51e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_41.198", 0x10000, 0x97128a3a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_42.178", 0x10000, 0x7f55ee0f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_43.199", 0x10000, 0xc7cad469, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_36.175", 0x10000, 0xaf598141, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_37.196", 0x10000, 0xb48137c8, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_38.176", 0x10000, 0xe4f3e3a7, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_39.197", 0x10000, 0xea30920f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "a96-24.163", 0x00400, 0x0fa8be7f, BRF_OPT }, - { "a96-25.164", 0x00400, 0x265508a6, BRF_OPT }, - { "a96-26.165", 0x00400, 0x4891b9c0, BRF_OPT }, -}; - -STD_ROM_PICK(Dariusj) -STD_ROM_FN(Dariusj) - -static struct BurnRomInfo DariusoRomDesc[] = { - { "a96_29.185", 0x10000, 0xf775162b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_28.152", 0x10000, 0x4721d667, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_31.187", 0x10000, 0xe9bb5d89, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_30.154", 0x10000, 0x9eb5e127, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "a96_33.190", 0x10000, 0xd2f340d2, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_32.157", 0x10000, 0x044c9848, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_35.191", 0x10000, 0xb8ed718b, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_34.158", 0x10000, 0x7556a660, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "a96_57.33", 0x10000, 0x33ceb730, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "a96_56.18", 0x10000, 0x292ef55c, BRF_ESS | BRF_PRG | TAITO_Z80ROM2 }, - - { "a96_48.24", 0x10000, 0x39c9b3aa, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_51.47", 0x10000, 0x1bf8f0d3, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_49.25", 0x10000, 0x37a7d88a, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_52.48", 0x10000, 0x2d9b2128, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_50.26", 0x10000, 0x75d738e4, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_53.49", 0x10000, 0x0173484c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "a96_54.143", 0x04000, 0x51c02ae2, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - { "a96_55.144", 0x04000, 0x771e4d98, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - - { "a96_44.179", 0x10000, 0xbbc18878, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_45.200", 0x10000, 0x616cdd8b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_46.180", 0x10000, 0xfec35418, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_47.201", 0x10000, 0x8df9286a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_40.177", 0x10000, 0xb699a51e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_41.198", 0x10000, 0x97128a3a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_42.178", 0x10000, 0x7f55ee0f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_43.199", 0x10000, 0xc7cad469, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_36.175", 0x10000, 0xaf598141, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_37.196", 0x10000, 0xb48137c8, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_38.176", 0x10000, 0xe4f3e3a7, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_39.197", 0x10000, 0xea30920f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "a96-24.163", 0x00400, 0x0fa8be7f, BRF_OPT }, - { "a96-25.164", 0x00400, 0x265508a6, BRF_OPT }, - { "a96-26.165", 0x00400, 0x4891b9c0, BRF_OPT }, -}; - -STD_ROM_PICK(Dariuso) -STD_ROM_FN(Dariuso) - -static struct BurnRomInfo DariuseRomDesc[] = { - { "a96_68.185", 0x10000, 0xed721127, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_67.152", 0x10000, 0xb99aea8c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_70.187", 0x10000, 0x54590b31, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "a96_69.154", 0x10000, 0x9eb5e127, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // == a96_30.154 - - { "a96_72.190", 0x10000, 0x248ca2cc, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_71.157", 0x10000, 0x65dd0403, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_74.191", 0x10000, 0x0ea31f60, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "a96_73.158", 0x10000, 0x27036a4d, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "a96_57.33", 0x10000, 0x33ceb730, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "a96_56.18", 0x10000, 0x292ef55c, BRF_ESS | BRF_PRG | TAITO_Z80ROM2 }, - - { "a96_48.24", 0x10000, 0x39c9b3aa, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_51.47", 0x10000, 0x1bf8f0d3, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_49.25", 0x10000, 0x37a7d88a, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_52.48", 0x10000, 0x2d9b2128, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_50.26", 0x10000, 0x75d738e4, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "a96_53.49", 0x10000, 0x0173484c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "a96_54.143", 0x04000, 0x51c02ae2, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - { "a96_55.144", 0x04000, 0x771e4d98, BRF_GRA | TAITO_CHARSB_BYTESWAP }, - - { "a96_44.179", 0x10000, 0xbbc18878, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_45.200", 0x10000, 0x616cdd8b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_46.180", 0x10000, 0xfec35418, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_47.201", 0x10000, 0x8df9286a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_40.177", 0x10000, 0xb699a51e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_41.198", 0x10000, 0x97128a3a, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_42.178", 0x10000, 0x7f55ee0f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_43.199", 0x10000, 0xc7cad469, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_36.175", 0x10000, 0xaf598141, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_37.196", 0x10000, 0xb48137c8, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_38.176", 0x10000, 0xe4f3e3a7, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "a96_39.197", 0x10000, 0xea30920f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "a96-24.163", 0x00400, 0x0fa8be7f, BRF_OPT }, - { "a96-25.164", 0x00400, 0x265508a6, BRF_OPT }, - { "a96-26.165", 0x00400, 0x4891b9c0, BRF_OPT }, -}; - -STD_ROM_PICK(Dariuse) -STD_ROM_FN(Dariuse) - -static struct BurnRomInfo OpwolfRomDesc[] = { - { "b20-05-02.40", 0x10000, 0x3ffbfe3a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-03-02.30", 0x10000, 0xfdabd8a5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-04.39", 0x10000, 0x216b4838, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-20.29", 0x10000, 0xd244431a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b20-07.10", 0x10000, 0x45c7ace3, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b20-13.13", 0x80000, 0xf6acdab1, BRF_GRA | TAITO_CHARS }, - - { "b20-14.72", 0x80000, 0x89f889e5, BRF_GRA | TAITO_SPRITESA }, - - { "b20-08.21", 0x80000, 0xf3e19c64, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Opwolf) -STD_ROM_FN(Opwolf) - -static struct BurnRomInfo OpwolfaRomDesc[] = { - { "b20-05-02.40", 0x10000, 0x3ffbfe3a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-03-02.30", 0x10000, 0xfdabd8a5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-04.39", 0x10000, 0x216b4838, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-17.29", 0x10000, 0x6043188e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b20-07.10", 0x10000, 0x45c7ace3, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b20-13.13", 0x80000, 0xf6acdab1, BRF_GRA | TAITO_CHARS }, - - { "b20-14.72", 0x80000, 0x89f889e5, BRF_GRA | TAITO_SPRITESA }, - - { "b20-08.21", 0x80000, 0xf3e19c64, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Opwolfa) -STD_ROM_FN(Opwolfa) - -static struct BurnRomInfo OpwolfjRomDesc[] = { - { "b20-05-02.40", 0x10000, 0x3ffbfe3a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-03-02.30", 0x10000, 0xfdabd8a5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-04.39", 0x10000, 0x216b4838, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-18.29", 0x10000, 0xfd202470, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b20-07.10", 0x10000, 0x45c7ace3, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b20-13.13", 0x80000, 0xf6acdab1, BRF_GRA | TAITO_CHARS }, - - { "b20-14.72", 0x80000, 0x89f889e5, BRF_GRA | TAITO_SPRITESA }, - - { "b20-08.21", 0x80000, 0xf3e19c64, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Opwolfj) -STD_ROM_FN(Opwolfj) - -static struct BurnRomInfo OpwolfjscRomDesc[] = { - { "b20_27.ic40.27512", 0x10000, 0x6bd02046, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20_26.ic30.27512", 0x10000, 0x644dd415, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-04.39", 0x10000, 0x216b4838, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-18.29", 0x10000, 0xfd202470, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b20-07.10", 0x10000, 0x45c7ace3, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b20-13.13", 0x80000, 0xf6acdab1, BRF_GRA | TAITO_CHARS }, - - { "b20-14.72", 0x80000, 0x89f889e5, BRF_GRA | TAITO_SPRITESA }, - - { "b20-08.21", 0x80000, 0xf3e19c64, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Opwolfjsc) -STD_ROM_FN(Opwolfjsc) - -static struct BurnRomInfo OpwolfuRomDesc[] = { - { "b20-05-02.40", 0x10000, 0x3ffbfe3a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-03-02.30", 0x10000, 0xfdabd8a5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-04.39", 0x10000, 0x216b4838, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b20-19.29", 0x10000, 0xb71bc44c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b20-07.10", 0x10000, 0x45c7ace3, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b20-13.13", 0x80000, 0xf6acdab1, BRF_GRA | TAITO_CHARS }, - - { "b20-14.72", 0x80000, 0x89f889e5, BRF_GRA | TAITO_SPRITESA }, - - { "b20-08.21", 0x80000, 0xf3e19c64, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Opwolfu) -STD_ROM_FN(Opwolfu) - -static struct BurnRomInfo OpwolfbRomDesc[] = { - { "opwlfb.12", 0x10000, 0xd87e4405, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "opwlfb.10", 0x10000, 0x9ab6f75c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "opwlfb.13", 0x10000, 0x61230c6e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "opwlfb.11", 0x10000, 0x342e318d, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "opwlfb.30", 0x08000, 0x0669b94c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "opwlfb.09", 0x08000, 0xab27a3dd, BRF_ESS | BRF_PRG | TAITO_Z80ROM2 }, - - { "opwlfb.08", 0x10000, 0x134d294e, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "opwlfb.04", 0x10000, 0xde0ca98d, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "opwlfb.06", 0x10000, 0x317d0e66, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "opwlfb.02", 0x10000, 0x6231fdd0, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "opwlfb.07", 0x10000, 0xe1c4095e, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "opwlfb.03", 0x10000, 0xccf8ba80, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "opwlfb.05", 0x10000, 0xfd9e72c8, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "opwlfb.01", 0x10000, 0x0a65f256, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "opwlfb.14", 0x10000, 0x663786eb, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "opwlfb.18", 0x10000, 0xde9ab08e, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "opwlfb.15", 0x10000, 0x315b8aa9, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "opwlfb.19", 0x10000, 0x645cf85e, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "opwlfb.16", 0x10000, 0xe01099e3, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "opwlfb.20", 0x10000, 0xd80b9cc6, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "opwlfb.17", 0x10000, 0x56fbe61d, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "opwlfb.21", 0x10000, 0x97d25157, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "opwlfb.29", 0x10000, 0x05a9eac0, BRF_SND | TAITO_MSM5205_BYTESWAP }, - { "opwlfb.25", 0x10000, 0x85b87f58, BRF_SND | TAITO_MSM5205_BYTESWAP }, - { "opwlfb.28", 0x10000, 0x281b2175, BRF_SND | TAITO_MSM5205_BYTESWAP }, - { "opwlfb.24", 0x10000, 0x8efc5d4d, BRF_SND | TAITO_MSM5205_BYTESWAP }, - { "opwlfb.27", 0x10000, 0x441211a6, BRF_SND | TAITO_MSM5205_BYTESWAP }, - { "opwlfb.23", 0x10000, 0xa874c703, BRF_SND | TAITO_MSM5205_BYTESWAP }, - { "opwlfb.26", 0x10000, 0x86d1d42d, BRF_SND | TAITO_MSM5205_BYTESWAP }, - { "opwlfb.22", 0x10000, 0x9228481f, BRF_SND | TAITO_MSM5205_BYTESWAP }, - -}; - -STD_ROM_PICK(Opwolfb) -STD_ROM_FN(Opwolfb) - -static struct BurnRomInfo RbislandRomDesc[] = { - { "b22-10-1.19", 0x10000, 0xe34a50ca, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-11-1.20", 0x10000, 0x6a31a093, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-08-1.21", 0x10000, 0x15d6e17a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-09-1.22", 0x10000, 0x454e66bc, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-03.23", 0x20000, 0x3ebb0fb8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-04.24", 0x20000, 0x91625e7f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b22-14.43", 0x10000, 0x113c1a5b, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b22-01.2", 0x80000, 0xb76c9168, BRF_GRA | TAITO_CHARS }, - - { "b22-02.5", 0x80000, 0x1b87ecf0, BRF_GRA | TAITO_SPRITESA }, - { "b22-12.7", 0x10000, 0x67a76dc6, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "b22-13.6", 0x10000, 0x2fda099f, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "cchip_b22-15.53", 0x10000, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(Rbisland) -STD_ROM_FN(Rbisland) - -static struct BurnRomInfo RbislandoRomDesc[] = { - { "b22-10.19", 0x10000, 0x3b013495, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-11.20", 0x10000, 0x80041a3d, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-08.21", 0x10000, 0x962fb845, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-09.22", 0x10000, 0xf43efa27, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-03.23", 0x20000, 0x3ebb0fb8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-04.24", 0x20000, 0x91625e7f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b22-14.43", 0x10000, 0x113c1a5b, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b22-01.2", 0x80000, 0xb76c9168, BRF_GRA | TAITO_CHARS }, - - { "b22-02.5", 0x80000, 0x1b87ecf0, BRF_GRA | TAITO_SPRITESA }, - { "b22-12.7", 0x10000, 0x67a76dc6, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "b22-13.6", 0x10000, 0x2fda099f, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "cchip_b22-15.53", 0x10000, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(Rbislando) -STD_ROM_FN(Rbislando) - -static struct BurnRomInfo RbislandeRomDesc[] = { - { "b39-01.19", 0x10000, 0x50690880, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b39-02.20", 0x10000, 0x4dead71f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b39-03.21", 0x10000, 0x4a4cb785, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b39-04.22", 0x10000, 0x4caa53bd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-03.23", 0x20000, 0x3ebb0fb8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b22-04.24", 0x20000, 0x91625e7f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b22-14.43", 0x10000, 0x113c1a5b, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b22-01.2", 0x80000, 0xb76c9168, BRF_GRA | TAITO_CHARS }, - - { "b22-02.5", 0x80000, 0x1b87ecf0, BRF_GRA | TAITO_SPRITESA }, - { "b22-12.7", 0x10000, 0x67a76dc6, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "b22-13.6", 0x10000, 0x2fda099f, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "cchip_b39-05.53", 0x10000, 0x00000000, BRF_OPT | BRF_NODUMP }, -}; - -STD_ROM_PICK(Rbislande) -STD_ROM_FN(Rbislande) - -static struct BurnRomInfo JumpingRomDesc[] = { - { "6.h4", 0x10000, 0x3fab6b31, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "10.h8", 0x10000, 0x8c878827, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "5.i4", 0x10000, 0x443492cf, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "9.i8", 0x10000, 0xed33bae1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "4.bin", 0x10000, 0x00bf8a91, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // 4+3 == b22-03.23 - { "8.bin", 0x10000, 0xe3d7a844, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // 8+7 == b22-04.24 - { "3.bin", 0x10000, 0xa3ab61c6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // 4+3 == b22-03.23 - { "7.bin", 0x10000, 0xc1c4c701, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // 8+7 == b22-04.24 - { "2.f89", 0x10000, 0x0810d327, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP_JUMPING }, - - { "jb1_cd67", 0x10000, 0x8527c00e, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "17.ic8", 0x10000, 0x65b76309, BRF_GRA | TAITO_CHARS }, - { "18.ic7", 0x10000, 0x43a94283, BRF_GRA | TAITO_CHARS }, - { "15.ic10", 0x10000, 0xe61933fb, BRF_GRA | TAITO_CHARS }, - { "16.ic9", 0x10000, 0xed031eb2, BRF_GRA | TAITO_CHARS }, - { "13.ic12", 0x10000, 0x312700ca, BRF_GRA | TAITO_CHARS }, - { "14.ic11", 0x10000, 0xde3b0b88, BRF_GRA | TAITO_CHARS }, - { "11.ic14", 0x10000, 0x9fdc6c8e, BRF_GRA | TAITO_CHARS }, - { "12.ic13", 0x10000, 0x06226492, BRF_GRA | TAITO_CHARS }, - - { "jb2_ic62", 0x10000, 0x8548db6c, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic61", 0x10000, 0x37c5923b, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic60", 0x08000, 0x662a2f1e, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic78", 0x10000, 0x925865e1, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic77", 0x10000, 0xb09695d1, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic76", 0x08000, 0x41937743, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic93", 0x10000, 0xf644eeab, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic92", 0x10000, 0x3fbccd33, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic91", 0x08000, 0xd886c014, BRF_GRA | TAITO_SPRITESA }, - { "jb2_i121", 0x10000, 0x93df1e4d, BRF_GRA | TAITO_SPRITESA }, - { "jb2_i120", 0x10000, 0x7c4e893b, BRF_GRA | TAITO_SPRITESA }, - { "jb2_i119", 0x08000, 0x7e1d58d8, BRF_GRA | TAITO_SPRITESA }, - - { "jumping-pal16r6.bin", 0x00104, 0x12e9a7b8, BRF_OPT }, - { "jumping-pal20l8.bin", 0x00144, 0x76944f81, BRF_OPT }, - { "pal16l8a.ic51.bin", 0x00104, 0xc1e6cb8f, BRF_OPT }, -}; - -STD_ROM_PICK(Jumping) -STD_ROM_FN(Jumping) - -static struct BurnRomInfo JumpingaRomDesc[] = { - { "6.h4", 0x10000, 0x3fab6b31, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "10.h8", 0x10000, 0x8c878827, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "seyutu_5.i4", 0x10000, 0x25f19b71, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "seyutu_9.i8", 0x10000, 0x9c94f260, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "4.bin", 0x10000, 0x00bf8a91, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // 4+3 == b22-03.23 - { "8.bin", 0x10000, 0xe3d7a844, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // 8+7 == b22-04.24 - { "3.bin", 0x10000, 0xa3ab61c6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // 4+3 == b22-03.23 - { "7.bin", 0x10000, 0xc1c4c701, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // 8+7 == b22-04.24 - { "2.f89", 0x10000, 0x0810d327, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP_JUMPING }, - - { "jb1_cd67", 0x10000, 0x8527c00e, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "17.ic8", 0x10000, 0x65b76309, BRF_GRA | TAITO_CHARS }, - { "18.ic7", 0x10000, 0x43a94283, BRF_GRA | TAITO_CHARS }, - { "15.ic10", 0x10000, 0xe61933fb, BRF_GRA | TAITO_CHARS }, - { "16.ic9", 0x10000, 0xed031eb2, BRF_GRA | TAITO_CHARS }, - { "13.ic12", 0x10000, 0x312700ca, BRF_GRA | TAITO_CHARS }, - { "14.ic11", 0x10000, 0xde3b0b88, BRF_GRA | TAITO_CHARS }, - { "11.ic14", 0x10000, 0x9fdc6c8e, BRF_GRA | TAITO_CHARS }, - { "12.ic13", 0x10000, 0x06226492, BRF_GRA | TAITO_CHARS }, - - { "jb2_ic62", 0x10000, 0x8548db6c, BRF_GRA | TAITO_SPRITESA }, - { "20.bin", 0x10000, 0x89b3d8ee, BRF_GRA | TAITO_SPRITESA }, // dumped multiple times, always the same - { "jb2_ic60", 0x08000, 0x662a2f1e, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic78", 0x10000, 0x925865e1, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic77", 0x10000, 0xb09695d1, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic76", 0x08000, 0x41937743, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic93", 0x10000, 0xf644eeab, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic92", 0x10000, 0x3fbccd33, BRF_GRA | TAITO_SPRITESA }, - { "jb2_ic91", 0x08000, 0xd886c014, BRF_GRA | TAITO_SPRITESA }, - { "jb2_i121", 0x10000, 0x93df1e4d, BRF_GRA | TAITO_SPRITESA }, - { "jb2_i120", 0x10000, 0x7c4e893b, BRF_GRA | TAITO_SPRITESA }, - { "jb2_i119", 0x08000, 0x7e1d58d8, BRF_GRA | TAITO_SPRITESA }, - - { "jumping-pal16r6.bin", 0x00104, 0x12e9a7b8, BRF_OPT }, - { "jumping-pal20l8.bin", 0x00144, 0x76944f81, BRF_OPT }, - { "pal16l8a.ic51.bin", 0x00104, 0xc1e6cb8f, BRF_OPT }, -}; - -STD_ROM_PICK(Jumpinga) -STD_ROM_FN(Jumpinga) - -static struct BurnRomInfo JumpingiRomDesc[] = { - /* red 'Imnoe' PCB */ - { "05.IC3", 0x20000, 0x69ac4af4, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "03.IC6", 0x20000, 0x38975cdc, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "06.IC2", 0x20000, 0x3ebb0fb8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // b22-03.23 - { "04.IC5", 0x20000, 0x91625e7f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, // b22-04.24 - { "02", 0x10000, 0x0810d327, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP_JUMPING }, - - { "01.IC53", 0x10000, 0x8527c00e, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "13.IC8", 0x10000, 0x65b76309, BRF_GRA | TAITO_CHARS }, - { "14.IC7", 0x10000, 0x43a94283, BRF_GRA | TAITO_CHARS }, - { "11.IC10", 0x10000, 0xe61933fb, BRF_GRA | TAITO_CHARS }, - { "12.IC9", 0x10000, 0xed031eb2, BRF_GRA | TAITO_CHARS }, - { "09.IC12", 0x10000, 0x312700ca, BRF_GRA | TAITO_CHARS }, - { "10.IC11", 0x10000, 0xde3b0b88, BRF_GRA | TAITO_CHARS }, - { "07.IC14", 0x10000, 0x9fdc6c8e, BRF_GRA | TAITO_CHARS }, - { "08.IC13", 0x10000, 0x06226492, BRF_GRA | TAITO_CHARS }, - - { "15.IC62", 0x10000, 0x8548db6c, BRF_GRA | TAITO_SPRITESA }, - { "19.IC61", 0x10000, 0x89b3d8ee, BRF_GRA | TAITO_SPRITESA }, - { "23.IC60", 0x08000, 0x662a2f1e, BRF_GRA | TAITO_SPRITESA }, - { "16.IC78", 0x10000, 0x925865e1, BRF_GRA | TAITO_SPRITESA }, - { "20.IC77", 0x10000, 0xb09695d1, BRF_GRA | TAITO_SPRITESA }, - { "24.IC76", 0x08000, 0x41937743, BRF_GRA | TAITO_SPRITESA }, - { "17.IC93", 0x10000, 0xf644eeab, BRF_GRA | TAITO_SPRITESA }, - { "21.IC92", 0x10000, 0x16e1b0ff, BRF_GRA | TAITO_SPRITESA }, - { "25.IC91", 0x08000, 0xd886c014, BRF_GRA | TAITO_SPRITESA }, - { "18.IC121", 0x10000, 0x93df1e4d, BRF_GRA | TAITO_SPRITESA }, - { "22.IC120", 0x10000, 0x7c4e893b, BRF_GRA | TAITO_SPRITESA }, - { "26.IC119", 0x08000, 0x7e1d58d8, BRF_GRA | TAITO_SPRITESA }, - - { "JP2.IC56", 0x00104, 0x12e9a7b8, BRF_OPT }, - { "JP1.IC13", 0x00144, 0x76944f81, BRF_OPT }, - { "JP3.IC51", 0x00104, 0xc1e6cb8f, BRF_OPT }, -}; - -STD_ROM_PICK(Jumpingi) -STD_ROM_FN(Jumpingi) - -static struct BurnRomInfo RastanRomDesc[] = { - { "b04-38.19", 0x10000, 0x1c91dbb1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-37.7", 0x10000, 0xecf20bdd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-40.20", 0x10000, 0x0930d4b3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-39.8", 0x10000, 0xd95ade5e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-42.21", 0x10000, 0x1857a7cb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-43-1.9", 0x10000, 0xca4702ff, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b04-19.49", 0x10000, 0xee81fdd8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b04-01.40", 0x20000, 0xcd30de19, BRF_GRA | TAITO_CHARS }, - { "b04-03.39", 0x20000, 0xab67e064, BRF_GRA | TAITO_CHARS }, - { "b04-02.67", 0x20000, 0x54040fec, BRF_GRA | TAITO_CHARS }, - { "b04-04.66", 0x20000, 0x94737e93, BRF_GRA | TAITO_CHARS }, - - { "b04-05.15", 0x20000, 0xc22d94ac, BRF_GRA | TAITO_SPRITESA }, - { "b04-07.14", 0x20000, 0xb5632a51, BRF_GRA | TAITO_SPRITESA }, - { "b04-06.28", 0x20000, 0x002ccf39, BRF_GRA | TAITO_SPRITESA }, - { "b04-08.27", 0x20000, 0xfeafca05, BRF_GRA | TAITO_SPRITESA }, - - { "b04-20.76", 0x10000, 0xfd1a34cc, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Rastan) -STD_ROM_FN(Rastan) - -static struct BurnRomInfo RastanaRomDesc[] = { - { "b04-38.19", 0x10000, 0x1c91dbb1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-37.7", 0x10000, 0xecf20bdd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-40.20", 0x10000, 0x0930d4b3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-39.8", 0x10000, 0xd95ade5e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-42.21", 0x10000, 0x1857a7cb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-43.9", 0x10000, 0xc34b9152, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b04-19.49", 0x10000, 0xee81fdd8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b04-01.40", 0x20000, 0xcd30de19, BRF_GRA | TAITO_CHARS }, - { "b04-03.39", 0x20000, 0xab67e064, BRF_GRA | TAITO_CHARS }, - { "b04-02.67", 0x20000, 0x54040fec, BRF_GRA | TAITO_CHARS }, - { "b04-04.66", 0x20000, 0x94737e93, BRF_GRA | TAITO_CHARS }, - - { "b04-05.15", 0x20000, 0xc22d94ac, BRF_GRA | TAITO_SPRITESA }, - { "b04-07.14", 0x20000, 0xb5632a51, BRF_GRA | TAITO_SPRITESA }, - { "b04-06.28", 0x20000, 0x002ccf39, BRF_GRA | TAITO_SPRITESA }, - { "b04-08.27", 0x20000, 0xfeafca05, BRF_GRA | TAITO_SPRITESA }, - - { "b04-20.76", 0x10000, 0xfd1a34cc, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Rastana) -STD_ROM_FN(Rastana) - -static struct BurnRomInfo RastanbRomDesc[] = { - { "b04-14.19", 0x10000, 0xa38ac909, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, /* These two are from the US rastanub set below */ - { "b04-21.7", 0x10000, 0x7c8dde9a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, /* These two are from the US rastanub set below */ - { "b04-27.20", 0x10000, 0xce37694b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-26.8", 0x10000, 0xfbdb98c7, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-29.21", 0x10000, 0x90d7c6e8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-28.9", 0x10000, 0xd6440242, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b04-19.49", 0x10000, 0xee81fdd8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b04-01.40", 0x20000, 0xcd30de19, BRF_GRA | TAITO_CHARS }, - { "b04-03.39", 0x20000, 0xab67e064, BRF_GRA | TAITO_CHARS }, - { "b04-02.67", 0x20000, 0x54040fec, BRF_GRA | TAITO_CHARS }, - { "b04-04.66", 0x20000, 0x94737e93, BRF_GRA | TAITO_CHARS }, - - { "b04-05.15", 0x20000, 0xc22d94ac, BRF_GRA | TAITO_SPRITESA }, - { "b04-07.14", 0x20000, 0xb5632a51, BRF_GRA | TAITO_SPRITESA }, - { "b04-06.28", 0x20000, 0x002ccf39, BRF_GRA | TAITO_SPRITESA }, - { "b04-08.27", 0x20000, 0xfeafca05, BRF_GRA | TAITO_SPRITESA }, - - { "b04-20.76", 0x10000, 0xfd1a34cc, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Rastanb) -STD_ROM_FN(Rastanb) - - -static struct BurnRomInfo RastanuRomDesc[] = { - { "b04-38.19", 0x10000, 0x1c91dbb1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-37.7", 0x10000, 0xecf20bdd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-45.20", 0x10000, 0x362812dd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-44.8", 0x10000, 0x51cc5508, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-42.21", 0x10000, 0x1857a7cb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-41-1.9", 0x10000, 0xbd403269, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b04-19.49", 0x10000, 0xee81fdd8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b04-01.40", 0x20000, 0xcd30de19, BRF_GRA | TAITO_CHARS }, - { "b04-03.39", 0x20000, 0xab67e064, BRF_GRA | TAITO_CHARS }, - { "b04-02.67", 0x20000, 0x54040fec, BRF_GRA | TAITO_CHARS }, - { "b04-04.66", 0x20000, 0x94737e93, BRF_GRA | TAITO_CHARS }, - - { "b04-05.15", 0x20000, 0xc22d94ac, BRF_GRA | TAITO_SPRITESA }, - { "b04-07.14", 0x20000, 0xb5632a51, BRF_GRA | TAITO_SPRITESA }, - { "b04-06.28", 0x20000, 0x002ccf39, BRF_GRA | TAITO_SPRITESA }, - { "b04-08.27", 0x20000, 0xfeafca05, BRF_GRA | TAITO_SPRITESA }, - - { "b04-20.76", 0x10000, 0xfd1a34cc, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Rastanu) -STD_ROM_FN(Rastanu) - -static struct BurnRomInfo RastanuaRomDesc[] = { - { "b04-38.19", 0x10000, 0x1c91dbb1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-37.7", 0x10000, 0xecf20bdd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-45.20", 0x10000, 0x362812dd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-44.8", 0x10000, 0x51cc5508, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-42.21", 0x10000, 0x1857a7cb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-41.9", 0x10000, 0xb44ca1c4, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b04-19.49", 0x10000, 0xee81fdd8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b04-01.40", 0x20000, 0xcd30de19, BRF_GRA | TAITO_CHARS }, - { "b04-03.39", 0x20000, 0xab67e064, BRF_GRA | TAITO_CHARS }, - { "b04-02.67", 0x20000, 0x54040fec, BRF_GRA | TAITO_CHARS }, - { "b04-04.66", 0x20000, 0x94737e93, BRF_GRA | TAITO_CHARS }, - - { "b04-05.15", 0x20000, 0xc22d94ac, BRF_GRA | TAITO_SPRITESA }, - { "b04-07.14", 0x20000, 0xb5632a51, BRF_GRA | TAITO_SPRITESA }, - { "b04-06.28", 0x20000, 0x002ccf39, BRF_GRA | TAITO_SPRITESA }, - { "b04-08.27", 0x20000, 0xfeafca05, BRF_GRA | TAITO_SPRITESA }, - - { "b04-20.76", 0x10000, 0xfd1a34cc, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Rastanua) -STD_ROM_FN(Rastanua) - -static struct BurnRomInfo RastanubRomDesc[] = { - { "b04-14.19", 0x10000, 0xa38ac909, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-21.7", 0x10000, 0x7c8dde9a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-23.20", 0x10000, 0x254b3dce, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-22.8", 0x10000, 0x98e8edcf, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-25.21", 0x10000, 0xd1e5adee, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-24.9", 0x10000, 0xa3dcc106, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b04-19.49", 0x10000, 0xee81fdd8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b04-01.40", 0x20000, 0xcd30de19, BRF_GRA | TAITO_CHARS }, - { "b04-03.39", 0x20000, 0xab67e064, BRF_GRA | TAITO_CHARS }, - { "b04-02.67", 0x20000, 0x54040fec, BRF_GRA | TAITO_CHARS }, - { "b04-04.66", 0x20000, 0x94737e93, BRF_GRA | TAITO_CHARS }, - - { "b04-05.15", 0x20000, 0xc22d94ac, BRF_GRA | TAITO_SPRITESA }, - { "b04-07.14", 0x20000, 0xb5632a51, BRF_GRA | TAITO_SPRITESA }, - { "b04-06.28", 0x20000, 0x002ccf39, BRF_GRA | TAITO_SPRITESA }, - { "b04-08.27", 0x20000, 0xfeafca05, BRF_GRA | TAITO_SPRITESA }, - - { "b04-20.76", 0x10000, 0xfd1a34cc, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Rastanub) -STD_ROM_FN(Rastanub) - -static struct BurnRomInfo RastsagaRomDesc[] = { - { "b04-32.19", 0x10000, 0x1c91dbb1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-31.7", 0x10000, 0x4c62e89e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-34-1.20", 0x10000, 0x8f54dd19, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-33-1.8", 0x10000, 0x810a02a3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-36.21", 0x10000, 0x32e286c0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-35.9", 0x10000, 0xee5ec5bc, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b04-19.49", 0x10000, 0xee81fdd8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b04-01.40", 0x20000, 0xcd30de19, BRF_GRA | TAITO_CHARS }, - { "b04-03.39", 0x20000, 0xab67e064, BRF_GRA | TAITO_CHARS }, - { "b04-02.67", 0x20000, 0x54040fec, BRF_GRA | TAITO_CHARS }, - { "b04-04.66", 0x20000, 0x94737e93, BRF_GRA | TAITO_CHARS }, - - { "b04-05.15", 0x20000, 0xc22d94ac, BRF_GRA | TAITO_SPRITESA }, - { "b04-07.14", 0x20000, 0xb5632a51, BRF_GRA | TAITO_SPRITESA }, - { "b04-06.28", 0x20000, 0x002ccf39, BRF_GRA | TAITO_SPRITESA }, - { "b04-08.27", 0x20000, 0xfeafca05, BRF_GRA | TAITO_SPRITESA }, - - { "b04-20.76", 0x10000, 0xfd1a34cc, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Rastsaga) -STD_ROM_FN(Rastsaga) - -static struct BurnRomInfo RastsagaaRomDesc[] = { - { "b04-14.19", 0x10000, 0xa38ac909, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-13.7", 0x10000, 0xbad60872, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-16-1.20", 0x10000, 0x00b59e60, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-15-1.8", 0x10000, 0xff9e018a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-18-1.21", 0x10000, 0xb626c439, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-17-1.9", 0x10000, 0xc928a516, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b04-19.49", 0x10000, 0xee81fdd8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b04-01.40", 0x20000, 0xcd30de19, BRF_GRA | TAITO_CHARS }, - { "b04-03.39", 0x20000, 0xab67e064, BRF_GRA | TAITO_CHARS }, - { "b04-02.67", 0x20000, 0x54040fec, BRF_GRA | TAITO_CHARS }, - { "b04-04.66", 0x20000, 0x94737e93, BRF_GRA | TAITO_CHARS }, - - { "b04-05.15", 0x20000, 0xc22d94ac, BRF_GRA | TAITO_SPRITESA }, - { "b04-07.14", 0x20000, 0xb5632a51, BRF_GRA | TAITO_SPRITESA }, - { "b04-06.28", 0x20000, 0x002ccf39, BRF_GRA | TAITO_SPRITESA }, - { "b04-08.27", 0x20000, 0xfeafca05, BRF_GRA | TAITO_SPRITESA }, - - { "b04-20.76", 0x10000, 0xfd1a34cc, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Rastsagaa) -STD_ROM_FN(Rastsagaa) - -static struct BurnRomInfo RastsagabRomDesc[] = { - { "b04-14.19", 0x10000, 0xa38ac909, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-13.7", 0x10000, 0xbad60872, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-16.20", 0x10000, 0x6bcf70dc, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-15.8", 0x10000, 0x8838ecc5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-18-1.21", 0x10000, 0xb626c439, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b04-17-1.9", 0x10000, 0xc928a516, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b04-19.49", 0x10000, 0xee81fdd8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b04-01.40", 0x20000, 0xcd30de19, BRF_GRA | TAITO_CHARS }, - { "b04-03.39", 0x20000, 0xab67e064, BRF_GRA | TAITO_CHARS }, - { "b04-02.67", 0x20000, 0x54040fec, BRF_GRA | TAITO_CHARS }, - { "b04-04.66", 0x20000, 0x94737e93, BRF_GRA | TAITO_CHARS }, - - { "b04-05.15", 0x20000, 0xc22d94ac, BRF_GRA | TAITO_SPRITESA }, - { "b04-07.14", 0x20000, 0xb5632a51, BRF_GRA | TAITO_SPRITESA }, - { "b04-06.28", 0x20000, 0x002ccf39, BRF_GRA | TAITO_SPRITESA }, - { "b04-08.27", 0x20000, 0xfeafca05, BRF_GRA | TAITO_SPRITESA }, - - { "b04-20.76", 0x10000, 0xfd1a34cc, BRF_SND | TAITO_MSM5205 }, -}; - -STD_ROM_PICK(Rastsagab) -STD_ROM_FN(Rastsagab) - -static struct BurnRomInfo TopspeedRomDesc[] = { - { "b14-67-1.9", 0x10000, 0x23f17616, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b14-68-1.11", 0x10000, 0x835659d9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b14-54.24", 0x20000, 0x172924d5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b14-52.26", 0x20000, 0xe1b5b2a1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b14-55.23", 0x20000, 0xa1f15499, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b14-53.25", 0x20000, 0x04a04f5f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b14-69.80", 0x10000, 0xd652e300, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b14-70.81", 0x10000, 0xb720592b, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b14-25.67", 0x10000, 0x9eab28ef, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b14-07.54", 0x20000, 0xc6025fff, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "b14-06.52", 0x20000, 0xb4e2536e, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "b14-48.16", 0x20000, 0x30c7f265, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-49.12", 0x20000, 0x32ba4265, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-50.8", 0x20000, 0xec1ef311, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-51.4", 0x20000, 0x35041c5f, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-44.15", 0x20000, 0x9f6c030e, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-45.11", 0x20000, 0x63e4ce03, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-46.7", 0x20000, 0xd489adf2, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-47.3", 0x20000, 0xb3a1f75b, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-40.14", 0x20000, 0xfa2a3cb3, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-41.10", 0x20000, 0x09455a14, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-42.6", 0x20000, 0xab51f53c, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-43.2", 0x20000, 0x1e6d2b38, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-36.13", 0x20000, 0x20a7c1b8, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-37.9", 0x20000, 0x801b703b, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-38.5", 0x20000, 0xde0c213e, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - { "b14-39.1", 0x20000, 0x798c28c5, BRF_GRA | TAITO_SPRITESA_TOPSPEED }, - - { "b14-30.88" , 0x10000, 0xdccb0c7f, BRF_GRA | TAITO_SPRITEMAP }, - - { "b14-28.103", 0x10000, 0xdf11d0ae, BRF_SND | TAITO_MSM5205 }, - { "b14-29.109", 0x10000, 0x7ad983e7, BRF_SND | TAITO_MSM5205 }, - - { "b14-31.90", 0x02000, 0x5c6b013d, BRF_OPT }, -}; - -STD_ROM_PICK(Topspeed) -STD_ROM_FN(Topspeed) - -static struct BurnRomInfo TopspeeduRomDesc[] = { - { "b14-23", 0x10000, 0xdd0307fd, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b14-24", 0x10000, 0xacdf08d4, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b14-05", 0x80000, 0x6557e9d8, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "b14-26", 0x10000, 0x659dc872, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b14-56", 0x10000, 0xd165cf1b, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b14-25.67", 0x10000, 0x9eab28ef, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b14-07.54", 0x20000, 0xc6025fff, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "b14-06.52", 0x20000, 0xb4e2536e, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "b14-01", 0x80000, 0x84a56f37, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b14-02", 0x80000, 0x6889186b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b14-03", 0x80000, 0xd1ed9e71, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b14-04", 0x80000, 0xb63f0519, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b14-30.88" , 0x10000, 0xdccb0c7f, BRF_GRA | TAITO_SPRITEMAP }, - - { "b14-28.103", 0x10000, 0xdf11d0ae, BRF_SND | TAITO_MSM5205 }, - { "b14-29.109", 0x10000, 0x7ad983e7, BRF_SND | TAITO_MSM5205 }, - - { "b14-31.90", 0x02000, 0x5c6b013d, BRF_OPT }, -}; - -STD_ROM_PICK(Topspeedu) -STD_ROM_FN(Topspeedu) - -static struct BurnRomInfo FullthrlRomDesc[] = { - { "b14-67", 0x10000, 0x284c943f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b14-68", 0x10000, 0x54cf6196, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b14-05", 0x80000, 0x6557e9d8, BRF_ESS | BRF_PRG | TAITO_68KROM1 }, - - { "b14-69.80", 0x10000, 0xd652e300, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b14-71", 0x10000, 0xf7081727, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b14-25.67", 0x10000, 0x9eab28ef, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b14-07.54", 0x20000, 0xc6025fff, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "b14-06.52", 0x20000, 0xb4e2536e, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "b14-01", 0x80000, 0x84a56f37, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b14-02", 0x80000, 0x6889186b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b14-03", 0x80000, 0xd1ed9e71, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b14-04", 0x80000, 0xb63f0519, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b14-30.88" , 0x10000, 0xdccb0c7f, BRF_GRA | TAITO_SPRITEMAP }, - - { "b14-28.103", 0x10000, 0xdf11d0ae, BRF_SND | TAITO_MSM5205 }, - { "b14-29.109", 0x10000, 0x7ad983e7, BRF_SND | TAITO_MSM5205 }, - - { "b14-31.90", 0x02000, 0x5c6b013d, BRF_OPT }, -}; - -STD_ROM_PICK(Fullthrl) -STD_ROM_FN(Fullthrl) - -static struct BurnRomInfo VolfiedRomDesc[] = { - { "c04-12-1.30", 0x10000, 0xafb6a058, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-08-1.10", 0x10000, 0x19f7e66b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-11-1.29", 0x10000, 0x1aaf6e9b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-25-1.9", 0x10000, 0xb39e04f9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-20.7", 0x20000, 0x0aea651f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-22.9", 0x20000, 0xf405d465, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-19.6", 0x20000, 0x231493ae, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-21.8", 0x20000, 0x8598d38e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c04-06.71", 0x08000, 0xb70106b2, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c04-16.2", 0x20000, 0x8c2476ef, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-18.4", 0x20000, 0x7665212c, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-15.1", 0x20000, 0x7c50b978, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-17.3", 0x20000, 0xc62fdeb8, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-10.15", 0x10000, 0x429b6b49, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-09.14", 0x10000, 0xc78cf057, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-10.15", 0x10000, 0x429b6b49, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-09.14", 0x10000, 0xc78cf057, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c04-4-1.3", 0x00200, 0xab9fae65, BRF_OPT }, - { "c04-5.75", 0x00200, 0x2763ec89, BRF_OPT }, -}; - -STD_ROM_PICK(Volfied) -STD_ROM_FN(Volfied) - -static struct BurnRomInfo VolfiedjRomDesc[] = { - { "c04-12-1.30", 0x10000, 0xafb6a058, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-08-1.10", 0x10000, 0x19f7e66b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-11-1.29", 0x10000, 0x1aaf6e9b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-07-1.9", 0x10000, 0x5d9065d5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-20.7", 0x20000, 0x0aea651f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-22.9", 0x20000, 0xf405d465, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-19.6", 0x20000, 0x231493ae, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-21.8", 0x20000, 0x8598d38e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c04-06.71", 0x08000, 0xb70106b2, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c04-16.2", 0x20000, 0x8c2476ef, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-18.4", 0x20000, 0x7665212c, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-15.1", 0x20000, 0x7c50b978, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-17.3", 0x20000, 0xc62fdeb8, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-10.15", 0x10000, 0x429b6b49, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-09.14", 0x10000, 0xc78cf057, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-10.15", 0x10000, 0x429b6b49, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-09.14", 0x10000, 0xc78cf057, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c04-4-1.3", 0x00200, 0xab9fae65, BRF_OPT }, - { "c04-5.75", 0x00200, 0x2763ec89, BRF_OPT }, -}; - -STD_ROM_PICK(Volfiedj) -STD_ROM_FN(Volfiedj) - -static struct BurnRomInfo VolfiedjoRomDesc[] = { - { "c04-12.30", 0x10000, 0xe319c7ec, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-08.10", 0x10000, 0x81c6f755, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-11.29", 0x10000, 0xf05696a6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-07.9", 0x10000, 0x4eeda184, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-20.7", 0x20000, 0x0aea651f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-22.9", 0x20000, 0xf405d465, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-19.6", 0x20000, 0x231493ae, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-21.8", 0x20000, 0x8598d38e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c04-06.71", 0x08000, 0xb70106b2, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c04-16.2", 0x20000, 0x8c2476ef, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-18.4", 0x20000, 0x7665212c, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-15.1", 0x20000, 0x7c50b978, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-17.3", 0x20000, 0xc62fdeb8, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-10.15", 0x10000, 0x429b6b49, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-09.14", 0x10000, 0xc78cf057, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-10.15", 0x10000, 0x429b6b49, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-09.14", 0x10000, 0xc78cf057, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c04-4-1.3", 0x00200, 0xab9fae65, BRF_OPT }, - { "c04-5.75", 0x00200, 0x2763ec89, BRF_OPT }, -}; - -STD_ROM_PICK(Volfiedjo) -STD_ROM_FN(Volfiedjo) - -static struct BurnRomInfo VolfieduRomDesc[] = { - { "c04-12-1.30", 0x10000, 0xafb6a058, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-08-1.10", 0x10000, 0x19f7e66b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-11-1.29", 0x10000, 0x1aaf6e9b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-24-1.9", 0x10000, 0xc499346f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-20.7", 0x20000, 0x0aea651f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-22.9", 0x20000, 0xf405d465, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-19.6", 0x20000, 0x231493ae, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c04-21.8", 0x20000, 0x8598d38e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c04-06.71", 0x08000, 0xb70106b2, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c04-16.2", 0x20000, 0x8c2476ef, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-18.4", 0x20000, 0x7665212c, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-15.1", 0x20000, 0x7c50b978, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-17.3", 0x20000, 0xc62fdeb8, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-10.15", 0x10000, 0x429b6b49, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-09.14", 0x10000, 0xc78cf057, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-10.15", 0x10000, 0x429b6b49, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - { "c04-09.14", 0x10000, 0xc78cf057, BRF_GRA | TAITO_SPRITESA_BYTESWAP }, - - { "c04-4-1.3", 0x00200, 0xab9fae65, BRF_OPT }, - { "c04-5.75", 0x00200, 0x2763ec89, BRF_OPT }, -}; - -STD_ROM_PICK(Volfiedu) -STD_ROM_FN(Volfiedu) - -static int MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - Taito68KRom2 = Next; Next += Taito68KRom2Size; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - TaitoZ80Rom2 = Next; Next += TaitoZ80Rom2Size; - TaitoSpriteMapRom = Next; Next += TaitoSpriteMapRomSize; - TaitoMSM5205Rom = Next; Next += TaitoMSM5205RomSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x018000; - TaitoZ80Ram1 = Next; Next += 0x001000; - if (TaitoNumZ80s == 2) { TaitoZ80Ram2 = Next; Next += 0x000800; } - TaitoPaletteRam = Next; Next += 0x004000; - TaitoSpriteRam = Next; Next += 0x00f000; - TaitoSharedRam = Next; Next += 0x010000; - TaitoVideoRam = Next; Next += 0x080000; - Taito68KRam2 = Next; Next += 0x010000; - - TaitoRamEnd = Next; - - TaitoChars = Next; Next += TaitoNumChar * TaitoCharWidth * TaitoCharHeight; - TaitoCharsB = Next; Next += TaitoNumCharB * TaitoCharBWidth * TaitoCharBHeight; - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - TaitoPalette = (UINT32*)Next; Next += 0x04000 * sizeof(UINT32); - - DrvPriBmp = (UINT16*)Next; Next += 512 * 512; - - TaitoMemEnd = Next; - - return 0; -} - -static INT32 DariusDoReset() -{ - INT32 i; - - TaitoDoReset(); - - DariusADPCMCommand = 0; - DariusNmiEnable = 0; - DariusCoinWord = 0; - - for (i = 0; i < 8; i++) DariusVol[i] = 0x00; - - for (i = 0; i < 5; i++) DariusPan[i] = 0x80; - - for (i = 0; i < 0x10; i++) { - DariusDefVol[i] = (INT32)(100.0f / (float)pow(10.0f, (32.0f - (i * (32.0f / (float)(0xf)))) / 20.0f)); - } - - return 0; -} - -static INT32 RbislandDoReset() -{ - TaitoDoReset(); - - return 0; -} - -static INT32 OpwolfDoReset() -{ - TaitoDoReset(); - - memset(OpwolfADPCM_B, 0, 8); - memset(OpwolfADPCM_C, 0, 8); - OpwolfADPCMPos[0] = OpwolfADPCMPos[1] = 0; - OpwolfADPCMEnd[0] = OpwolfADPCMEnd[1] = 0; - OpwolfADPCMData[0] = OpwolfADPCMData[1] = -1; - - MSM5205ResetWrite(0, 1); - MSM5205ResetWrite(1, 1); - - return 0; -} - -static INT32 RastanDoReset() -{ - TaitoDoReset(); - - RastanADPCMPos = 0; - RastanADPCMData = -1; - - return 0; -} - -static INT32 VolfiedDoReset() -{ - TaitoDoReset(); - - VolfiedVidCtrl = 0; - VolfiedVidMask = 0; - - return 0; -} - -static void z80ctc_reset(); - -static INT32 TopspeedDoReset() -{ - TaitoDoReset(); - - BurnShiftReset(); - - z80ctc_reset(); - RastanADPCMPos = 0; - RastanADPCMData = -1; - RastanADPCMInReset = 1; - TopspeedADPCMPos = 0; - TopspeedADPCMData = -1; - TopspeedADPCMInReset = 1; - MSM5205SetRoute(0, 0.00, BURN_SND_ROUTE_BOTH); // set by audiocpu - MSM5205SetRoute(1, 0.00, BURN_SND_ROUTE_BOTH); // set by audiocpu - - return 0; -} - -static void TaitoMiscCpuAReset(UINT16 d) -{ - TaitoCpuACtrl = d; - if (!(TaitoCpuACtrl & 1)) { - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - } -} - -UINT8 __fastcall Darius68K1ReadByte(UINT32 a) -{ - switch (a) { - case 0xc00010: { - return TaitoDip[1]; - } - - case 0xc00011: { - return TaitoDip[0]; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius68K1WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Darius68K1ReadWord(UINT32 a) -{ - switch (a) { - case 0xc00002: { - return TC0140SYTCommRead(); - } - - case 0xc00008: { - return TaitoInput[0]; - } - - case 0xc0000a: { - return TaitoInput[1]; - } - - case 0xc0000c: { - return TaitoInput[2]; - } - - case 0xc0000e: { - return DariusCoinWord; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius68K1WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x0a0000: { - TaitoMiscCpuAReset(d); - return; - } - - case 0x0b0000: { - //watchdog - return; - } - - case 0xc00000: { - TC0140SYTPortWrite(d & 0xff); - return; - } - - case 0xc00002: { - TC0140SYTCommWrite(d & 0xff); - return; - } - - case 0xc00020: - case 0xc00022: - case 0xc00024: - case 0xc00030: - case 0xc00032: - case 0xc00034: { - //misc io writes - return; - } - - case 0xc00050: { - //nop - return; - } - - case 0xc00060: { - DariusCoinWord = d; - return; - } - - case 0xd20000: - case 0xd20002: { - PC080SNSetScrollY(0, (a - 0xd20000) >> 1, d); - return; - } - - case 0xd40000: - case 0xd40002: { - PC080SNSetScrollX(0, (a - 0xd40000) >> 1, d); - return; - } - - case 0xd50000: { - PC080SNCtrlWrite(0, (a - 0xd50000) >> 1, d); - return; - } - - case 0xdc0000: { - //??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Darius68K2ReadByte(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius68K2WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Darius68K2ReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Darius68K2WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0xc00050: { - //nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Opwolf68KReadByte(UINT32 a) -{ - if (a >= 0x0ff000 && a <= 0x0ff7ff) { - return OpwolfCChipDataRead((a - 0x0ff000) >> 1); - } - - switch (a) { - case 0x3e0002: { - return TC0140SYTCommRead(); - } - } - - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - - return 0; -} - -void __fastcall Opwolf68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x0ff000 && a <= 0x0ff7ff) { - OpwolfCChipDataWrite(Taito68KRom1, (a - 0x0ff000) >> 1, d); - return; - } - - switch (a) { - case 0x3e0000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x3e0002: { - TC0140SYTCommWrite(d); - return; - } - } - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); -} - -UINT16 __fastcall Opwolf68KReadWord(UINT32 a) -{ - if (a >= 0x0f0000 && a <= 0x0f07ff) { - return OpwolfCChipDataRead((a - 0x0f0000) >> 1); - } - - if (a >= 0x0ff000 && a <= 0x0ff7ff) { - return OpwolfCChipDataRead((a - 0x0ff000) >> 1); - } - - switch (a) { - case 0x3a0000: { - INT32 scaled = (BurnGunReturnX(0) * 320) / 256; - return scaled + 0x15 + OpWolfGunXOffset; - } - - case 0x3a0002: { - return BurnGunReturnY(0) - 0x24 + OpWolfGunYOffset; - } - - case 0x0ff802: { - return OpwolfCChipStatusRead(); - } - - case 0x380000: { - return TaitoDip[0]; - } - - case 0x380002: { - return TaitoDip[1]; - } - } - - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - - return 0; -} - -void __fastcall Opwolf68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x0ff000 && a <= 0x0ff7ff) { - OpwolfCChipDataWrite(Taito68KRom1, (a - 0x0ff000) >> 1, d); - return; - } - - switch (a) { - case 0x0ff802: { - OpwolfCChipStatusWrite(); - return; - } - - case 0x0ffc00: { - OpwolfCChipBankWrite(d); - return; - } - - case 0x380000: { - PC090OJSpriteCtrl = (d & 0xe0) >> 5; - return; - } - - case 0x3c0000: { - // nop - return; - } - - case 0xc20000: - case 0xc20002: { - PC080SNSetScrollY(0, (a - 0xc20000) >> 1, d); - return; - } - - case 0xc40000: - case 0xc40002: { - PC080SNSetScrollX(0, (a - 0xc40000) >> 1, d); - return; - } - - case 0xc50000: { - PC080SNCtrlWrite(0, (a - 0xc50000) >> 1, d); - return; - } - } - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); -} - -UINT8 __fastcall Opwolfb68KReadByte(UINT32 a) -{ - if (a >= 0x0ff000 && a <= 0x0fffff) { - return TaitoZ80Ram2[(a - 0x0ff000) >> 1]; - } - - switch (a) { - case 0x3e0002: { - return TC0140SYTCommRead(); - } - } - - return 0; -} - -void __fastcall Opwolfb68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x0ff000 && a <= 0x0fffff) { - TaitoZ80Ram2[(a - 0x0ff000) >> 1] = d ; - return; - } - - switch (a) { - case 0x3e0000: { - TC0140SYTPortWrite(d); - return; - } - - case 0x3e0002: { - TC0140SYTCommWrite(d); - return; - } - } -} - -UINT16 __fastcall Opwolfb68KReadWord(UINT32 a) -{ - if (a >= 0x0ff000 && a <= 0x0fffff) { - return TaitoZ80Ram2[(a - 0x0ff000) >> 1]; - } - - switch (a) { - case 0x0f0008: { - return TaitoInput[0]; - } - - case 0x0f000a: { - return TaitoInput[1]; - } - - case 0x380000: { - return TaitoDip[0]; - } - - case 0x380002: { - return TaitoDip[1]; - } - - case 0x3a0000: { - INT32 scaled = (BurnGunReturnX(0) * 320) / 256; - return scaled + 0x15 + OpWolfGunXOffset; - } - - case 0x3a0002: { - return BurnGunReturnY(0) - 0x24 + OpWolfGunYOffset; - } - } - - return 0; -} - -void __fastcall Opwolfb68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x0ff000 && a <= 0x0fffff) { - TaitoZ80Ram2[(a - 0x0ff000) >> 1] = d & 0xff; - return; - } - - switch (a) { - case 0x380000: { - PC090OJSpriteCtrl = (d & 0xe0) >> 5; - return; - } - - case 0x3c0000: { - // nop - return; - } - - case 0xc20000: - case 0xc20002: { - PC080SNSetScrollY(0, (a - 0xc20000) >> 1, d); - return; - } - - case 0xc40000: - case 0xc40002: { - PC080SNSetScrollX(0, (a - 0xc40000) >> 1, d); - return; - } - - case 0xc50000: { - PC080SNCtrlWrite(0, (a - 0xc50000) >> 1, d); - return; - } - } -} - -UINT8 __fastcall Rbisland68KReadByte(UINT32 a) -{ - if (a >= 0x800000 && a <= 0x8007ff) { - return RainbowCChipRamRead((a - 0x800000) >> 1); - } - - switch (a) { - case 0x800803: { - return RainbowCChipCtrlRead(); - } - } - - return 0; -} - -void __fastcall Rbisland68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x800000 && a <= 0x8007ff) { - RainbowCChipRamWrite((a - 0x800000) >> 1, d); - return; - } - - switch (a) { - case 0x3a0001: { - PC090OJSpriteCtrl = (d & 0xe0) >> 5; - return; - } - - case 0x3e0001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x3e0003: { - TC0140SYTCommWrite(d); - return; - } - - case 0x800803: { - RainbowCChipCtrlWrite(d); - return; - } - - case 0x800c01: { - RainbowCChipBankWrite(d); - return; - } - } -} - -UINT16 __fastcall Rbisland68KReadWord(UINT32 a) -{ - if (a >= 0x800000 && a <= 0x8007ff) { - return RainbowCChipRamRead((a - 0x800000) >> 1); - } - - switch (a) { - case 0x390000: { - return TaitoDip[0]; - } - - case 0x3b0000: { - return TaitoDip[1]; - } - } - - return 0; -} - -void __fastcall Rbisland68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x3c0000: { - // nop - return; - } - - case 0xc20000: - case 0xc20002: { - PC080SNSetScrollY(0, (a - 0xc20000) >> 1, d); - return; - } - - case 0xc40000: - case 0xc40002: { - PC080SNSetScrollX(0, (a - 0xc40000) >> 1, d); - return; - } - - case 0xc50000: { - PC080SNCtrlWrite(0, (a - 0xc50000) >> 1, d); - return; - } - } -} - -UINT8 __fastcall Jumping68KReadByte(UINT32 a) -{ - switch (a) { - case 0x401001: { - return TaitoInput[0]; - } - - case 0x401003: { - return TaitoInput[1]; - } - - case 0x420000: { - // nop - return 0; - } - } - - return 0; -} - -void __fastcall Jumping68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x800000 && a <= 0x80ffff) return; - - switch (a) { - case 0x3a0001: { - PC090OJSpriteCtrl = d; - return; - } - - case 0x400007: { - TaitoSoundLatch = d; - ZetOpen(0); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - return; - } - } -} - -UINT16 __fastcall Jumping68KReadWord(UINT32 a) -{ - switch (a) { - case 0x400000: { - return TaitoDip[0]; - } - - case 0x400002: { - return TaitoDip[0]; - } - } - - return 0; -} - -void __fastcall Jumping68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x3c0000: { - // nop - return; - } - - case 0x430000: - case 0x430002: { - PC080SNSetScrollY(0, (a - 0x430000) >> 1, d); - return; - } - - case 0xc20000: { - //nop - return; - } - - case 0xc50000: { - //??? - return; - } - } -} - -UINT8 __fastcall Rastan68KReadByte(UINT32 a) -{ - switch (a) { - case 0x390001: { - return TaitoInput[0]; - } - - case 0x390003: { - return TaitoInput[1]; - } - - case 0x390005: { - return TaitoInput[2]; - } - - case 0x390007: { - return TaitoInput[3]; - } - - case 0x390009: { - return TaitoDip[0]; - } - - case 0x39000b: { - return TaitoDip[1]; - } - - case 0x3e0003: { - return TC0140SYTCommRead(); - } - } - - return 0; -} - -void __fastcall Rastan68KWriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x3e0001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x3e0003: { - TC0140SYTCommWrite(d); - return; - } - } -} - -void __fastcall Rastan68KWriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x350008: { - // nop - return; - } - - case 0x380000: { - PC090OJSpriteCtrl = (d & 0xe0) >> 5; - return; - } - - case 0x3c0000: { - // watchdog - return; - } - - case 0xc20000: - case 0xc20002: { - PC080SNSetScrollY(0, (a - 0xc20000) >> 1, d); - return; - } - - case 0xc40000: - case 0xc40002: { - PC080SNSetScrollX(0, (a - 0xc40000) >> 1, d); - return; - } - - case 0xc50000: { - PC080SNCtrlWrite(0, (a - 0xc50000) >> 1, d); - return; - } - } -} - -static UINT8 TopspeedInputBypassRead() -{ - UINT8 Port = TC0220IOCPortRead(); - - INT32 Steer = (TaitoAnalogPort0 >> 4); - - switch (Port) { - case 0x0c: { - return Steer & 0xff; - } - - case 0x0d: { - return Steer >> 8; - } - - default: { - return TC0220IOCPortRegRead(); - } - } -} - -UINT8 __fastcall Topspeed68K1ReadByte(UINT32 a) -{ - switch (a) { - case 0x7e0003: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Topspeed68K1WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x7e0001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x7e0003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Topspeed68K1ReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Topspeed68K1WriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0xe10000 && a <= 0xe1ffff) { - // ??? - return; - } - - if (a >= 0x880000 && a <= 0x880007) { - // lamps - return; - } - - switch (a) { - case 0x600002: { - TaitoMiscCpuAReset(d); - return; - } - - case 0x880002: - case 0x880004: - case 0x880006: { - // ??? - return; - } - - case 0xa20000: - case 0xa20002: { - PC080SNSetScrollY(0, (a - 0xa20000) >> 1, d); - return; - } - - case 0xa40000: - case 0xa40002: { - PC080SNSetScrollX(0, (a - 0xa40000) >> 1, d); - return; - } - - case 0xa50000: { - PC080SNCtrlWrite(0, (a - 0xa50000) >> 1, d); - return; - } - - case 0xb20000: - case 0xb20002: { - PC080SNSetScrollY(1, (a - 0xb20000) >> 1, d); - return; - } - - case 0xb40000: - case 0xb40002: { - PC080SNSetScrollX(1, (a - 0xb40000) >> 1, d); - return; - } - - case 0xb50000: { - PC080SNCtrlWrite(1, (a - 0xb50000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Topspeed68K2ReadByte(UINT32 a) -{ - if (a >= 0x900000 && a <= 0x9003ff) { - INT32 Offset = (a - 0x900000) >> 1; - - switch (Offset) { - case 0x000: return rand() & 0xff; - case 0x101: return 0x55; - } - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Topspeed68K2WriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x900000 && a <= 0x9003ff) { - return; // cab motor - } - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Topspeed68K2ReadWord(UINT32 a) -{ - switch (a) { - case 0x880000: { - return TopspeedInputBypassRead(); - } - - case 0x880002: { - return TC0220IOCHalfWordPortRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Topspeed68K2WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x810000: { - // ??? - return; - } - - case 0x880000: { - TC0220IOCHalfWordPortRegWrite(d); - return; - } - - case 0x880002: { - TC0220IOCHalfWordPortWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Volfied68KReadByte(UINT32 a) -{ - if (a >= 0xf00000 && a <= 0xf007ff) { - INT32 Offset = (a - 0xf00000) >> 1; - return VolfiedCChipRamRead(Offset); - } - - switch (a) { - case 0xd00001: { - return 0x60; - } - - case 0xe00003: { - return TC0140SYTCommRead(); - } - - case 0xf00803: { - return VolfiedCChipCtrlRead() & 0xff; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Volfied68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x400000 && a <= 0x47ffff) { - INT32 Offset = (a - 0x400000); - INT32 Mask; - if (Offset & 1) { - Mask = VolfiedVidMask >> 8; - } else { - Mask = VolfiedVidMask & 0xff; - } - TaitoVideoRam[Offset ^ 1] = (TaitoVideoRam[Offset ^ 1] & ~Mask) | (d & Mask); - return; - } - - if (a >= 0xf00000 && a <= 0xf007ff) { - INT32 Offset = (a - 0xf00000) >> 1; - VolfiedCChipRamWrite(Offset, d); - return; - } - - switch (a) { - case 0x700001: { - PC090OJSpriteCtrl = (d & 0x3c) >> 2; - return; - } - - case 0xd00001: { - VolfiedVidCtrl = d; - return; - } - - case 0xf00803: { - // cchip ctrl write - ignored - return; - } - - case 0xf00c01: { - VolfiedCChipBankWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Volfied68KReadWord(UINT32 a) -{ - if (a >= 0xf00000 && a <= 0xf007ff) { - INT32 Offset = (a - 0xf00000) >> 1; - return VolfiedCChipRamRead(Offset); - } - - switch (a) { - case 0xd00000: { - return 0x60; - } - - case 0xe00002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Volfied68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x400000 && a <= 0x47ffff) { - UINT16 *Ram = (UINT16*)TaitoVideoRam; - INT32 Offset = (a - 0x400000) >> 1; - Ram[Offset] = (Ram[Offset] & ~VolfiedVidMask) | (d & VolfiedVidMask); - return; - } - - if (a >= 0xf00000 && a <= 0xf007ff) { - INT32 Offset = (a - 0xf00000) >> 1; - VolfiedCChipRamWrite(Offset, d & 0xff); - return; - } - - switch (a) { - case 0x600000: { - VolfiedVidMask = d; - return; - } - - case 0xd00000: { - VolfiedVidCtrl = d; - return; - } - - case 0xe00000: { - TC0140SYTPortWrite(d & 0xff); - return; - } - - case 0xe00002: { - TC0140SYTCommWrite(d & 0xff); - return; - } - - case 0xf00c00: { - VolfiedCChipBankWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d); - } - } -} - -static void DariusUpdateFM0() -{ - INT32 left = (DariusPan[0] * DariusVol[6]) >> 8; - INT32 right = ((0xff - DariusPan[0]) * DariusVol[6]) >> 8; - - BurnYM2203SetLeftVolume(0, BURN_SND_YM2203_YM2203_ROUTE, (left * DariusYM2203RouteMasterVol) / 100.0); - BurnYM2203SetRightVolume(0, BURN_SND_YM2203_YM2203_ROUTE, (right * DariusYM2203RouteMasterVol) / 100.0); -} - -static void DariusUpdateFM1() -{ - INT32 left = (DariusPan[1] * DariusVol[7]) >> 8; - INT32 right = ((0xff - DariusPan[1]) * DariusVol[7]) >> 8; - - BurnYM2203SetLeftVolume(1, BURN_SND_YM2203_YM2203_ROUTE, (left * DariusYM2203RouteMasterVol) / 100.0); - BurnYM2203SetRightVolume(1, BURN_SND_YM2203_YM2203_ROUTE, (right * DariusYM2203RouteMasterVol) / 100.0); -} - -static void DariusUpdatePSG0(INT32 port) -{ - INT32 left, right; - - left = (DariusPan[2] * DariusVol[port - 1]) >> 8; - right = ((0xff - DariusPan[2]) * DariusVol[port - 1]) >> 8; - - BurnYM2203SetLeftVolume(0, port, (left * DariusYM2203AY8910RouteMasterVol) / 100.0); - BurnYM2203SetRightVolume(0, port, (right * DariusYM2203AY8910RouteMasterVol) / 100.0); -} - -static void DariusUpdatePSG1(INT32 port) -{ - INT32 left, right; - - left = (DariusPan[3] * DariusVol[port + 2]) >> 8; - right = ((0xff - DariusPan[3]) * DariusVol[port + 2]) >> 8; - - BurnYM2203SetLeftVolume(1, port, (left * DariusYM2203AY8910RouteMasterVol) / 100.0); - BurnYM2203SetRightVolume(1, port, (right * DariusYM2203AY8910RouteMasterVol) / 100.0); -} - -static void DariusUpdateDa() -{ - INT32 left = DariusDefVol[(DariusPan[4] >> 4) & 0x0f]; - INT32 right = DariusDefVol[(DariusPan[4] >> 0) & 0x0f]; - - MSM5205SetLeftVolume(0, (left * DariusMSM5205RouteMasterVol) / 100.0); - MSM5205SetRightVolume(0, (right * DariusMSM5205RouteMasterVol) / 100.0); -} - -UINT8 __fastcall DariusZ80Read(UINT16 a) -{ - switch (a) { - case 0x9000: { - return BurnYM2203Read(0, 0); - } - - case 0x9001: { - return BurnYM2203Read(0, 1); - } - - case 0xa000: { - return BurnYM2203Read(1, 0); - } - - case 0xa001: { - return BurnYM2203Read(1, 1); - } - - case 0xb001: { - return TC0140SYTSlaveCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read %04X\n"), a); - } - } - - return 0; -} - -void __fastcall DariusZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x9001: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xa000: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0xa001: { - BurnYM2203Write(1, 1, d); - return; - } - - case 0xb000: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xb001: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xc000: { - DariusPan[0] = d; - DariusUpdateFM0(); - return; - } - - case 0xc400: { - DariusPan[1] = d; - DariusUpdateFM1(); - return; - } - - case 0xc800: { - DariusPan[2] = d; - DariusUpdatePSG0(BURN_SND_YM2203_AY8910_ROUTE_1); - DariusUpdatePSG0(BURN_SND_YM2203_AY8910_ROUTE_2); - DariusUpdatePSG0(BURN_SND_YM2203_AY8910_ROUTE_3); - return; - } - - case 0xcc00: { - DariusPan[3] = d; - DariusUpdatePSG1(BURN_SND_YM2203_AY8910_ROUTE_1); - DariusUpdatePSG1(BURN_SND_YM2203_AY8910_ROUTE_2); - DariusUpdatePSG1(BURN_SND_YM2203_AY8910_ROUTE_3); - return; - } - - case 0xd000: { - DariusPan[4] = d; - DariusUpdateDa(); - return; - } - - case 0xd400: { - DariusADPCMCommand = d; - return; - } - - case 0xd800: { - //??? - return; - } - - case 0xdc00: { - TaitoZ80Bank = d & 0x03; - ZetMapArea(0x0000, 0x7fff, 0, TaitoZ80Rom1 + 0x10000 + (TaitoZ80Bank * 0x8000)); - ZetMapArea(0x0000, 0x7fff, 2, TaitoZ80Rom1 + 0x10000 + (TaitoZ80Bank * 0x8000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall DariusZ802ReadPort(UINT16 a) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - return DariusADPCMCommand; - } - - case 0x02: { - //??? - return 0; - } - - case 0x03: { - //??? - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Read => %02X\n"), a); - } - } - - return 0; -} - -void __fastcall DariusZ802WritePort(UINT16 a, UINT8 d) -{ - a &= 0xff; - - switch (a) { - case 0x00: { - DariusNmiEnable = 0; - return; - } - - case 0x01: { - DariusNmiEnable = 1; - return; - } - - case 0x02: { - MSM5205DataWrite(0, d); - MSM5205ResetWrite(0, !(d & 0x20)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 #2 Port Write => %02X, %02X\n"), a, d); - } - } -} - -static void z80ctc_reset() -{ - z80ctc_load = 0; - z80ctc_constant = 0; - z80ctc_ctr = 0; -} - -static void z80ctc_scan() -{ - SCAN_VAR(z80ctc_load); - SCAN_VAR(z80ctc_constant); - SCAN_VAR(z80ctc_ctr); -} - -static void z80ctc_write(UINT8 data) -{ - if (z80ctc_load) { - z80ctc_constant = 0xb0 - data; - z80ctc_load = 0; - } - - if (data == 5) z80ctc_load = 1; -} - -static void TopspeedMSM5205Vck2(); - -static void z80ctc_execute(INT32 cyc) -{ - if (z80ctc_constant == 0) return; - // mini-z80ctc emulation - - while (z80ctc_ctr <= 0) { - INT32 remainder = 0; - if (z80ctc_ctr < 0) - remainder = -z80ctc_ctr; - - z80ctc_ctr = 4000000/16/60; // 4mhz, 16 prescale, 1 frame - z80ctc_ctr -= remainder; - TopspeedMSM5205Vck2(); - } - z80ctc_ctr -= (cyc * z80ctc_constant); -} - -void __fastcall TopspeedZ80WritePort(UINT16 a, UINT8 d) -{ - a &= 0xff; - if (a==0) { - z80ctc_write(d); - } -} - -UINT8 __fastcall OpwolfZ80Read(UINT16 a) -{ - switch (a) { - case 0x9001: { - return BurnYM2151ReadStatus(); - } - - case 0xa001: { - return TC0140SYTSlaveCommRead(); - } - } - - return 0; -} - -void __fastcall OpwolfZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x9001: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xa000: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xa001: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xb000: - case 0xb001: - case 0xb002: - case 0xb003: - case 0xb004: - case 0xb005: - case 0xb006: { - INT32 nStart; - INT32 nEnd; - INT32 Offset = a - 0xb000; - - OpwolfADPCM_B[Offset] = d; - if (Offset == 0x04) { - nStart = OpwolfADPCM_B[0] + (OpwolfADPCM_B[1] << 8); - nEnd = OpwolfADPCM_B[2] + (OpwolfADPCM_B[3] << 8); - nStart *= 16; - nEnd *= 16; - OpwolfADPCMPos[0] = nStart; - OpwolfADPCMEnd[0] = nEnd; - MSM5205ResetWrite(0, 0); - } - return; - } - - case 0xc000: - case 0xc001: - case 0xc002: - case 0xc003: - case 0xc004: - case 0xc005: - case 0xc006: { - INT32 nStart; - INT32 nEnd; - INT32 Offset = a - 0xc000; - - OpwolfADPCM_C[Offset] = d; - if (Offset == 0x04) { - nStart = OpwolfADPCM_C[0] + (OpwolfADPCM_C[1] << 8); - nEnd = OpwolfADPCM_C[2] + (OpwolfADPCM_C[3] << 8); - nStart *= 16; - nEnd *= 16; - OpwolfADPCMPos[1] = nStart; - OpwolfADPCMEnd[1] = nEnd; - MSM5205ResetWrite(1, 0); - } - return; - } - - case 0xd000: - case 0xe000: { - return; - } - } -} - -UINT8 __fastcall RbislandZ80Read(UINT16 a) -{ - switch (a) { - case 0x9001: { - return BurnYM2151ReadStatus(); - } - - case 0xa001: { - return TC0140SYTSlaveCommRead(); - } - } - - return 0; -} - -void __fastcall RbislandZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x9001: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xa000: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xa001: { - TC0140SYTSlaveCommWrite(d); - return; - } - } -} - -UINT8 __fastcall JumpingZ80Read(UINT16 a) -{ - switch (a) { - case 0xb000: { - return BurnYM2203Read(0, 0); - } - - case 0xb400: { - return BurnYM2203Read(1, 0); - } - - case 0xb800: { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return TaitoSoundLatch; - } - } - - return 0; -} - -void __fastcall JumpingZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xb000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0xb001: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0xb400: { - BurnYM2203Write(1, 0, d); - return; - } - - case 0xb401: { - BurnYM2203Write(1, 1, d); - return; - } - - case 0xbc00: { - //nop - return; - } - } -} - -UINT8 __fastcall RastanZ80Read(UINT16 a) -{ - switch (a) { - case 0x9001: { - return BurnYM2151ReadStatus(); - } - - case 0xa001: { - return TC0140SYTSlaveCommRead(); - } - } - - return 0; -} - -void __fastcall RastanZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x9001: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xa000: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xa001: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xb000: { - RastanADPCMPos = (RastanADPCMPos & 0x00ff) | (d << 8); - return; - } - - case 0xc000: { - MSM5205ResetWrite(0, 0); - return; - } - - case 0xd000: { - MSM5205ResetWrite(0, 1); - RastanADPCMPos &= 0xff00; - return; - } - } -} - -UINT8 __fastcall TopspeedZ80Read(UINT16 a) -{ - switch (a) { - case 0x9001: { - return BurnYM2151ReadStatus(); - } - - case 0xa001: { - return TC0140SYTSlaveCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read %04X\n"), a); - } - } - - return 0; -} - -void __fastcall TopspeedZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x9000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0x9001: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xa000: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xa001: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xb000: { // load - RastanADPCMPos = d << 8; - return; - } - - case 0xb400: { // play - MSM5205ResetWrite(0, 0); - RastanADPCMInReset = 0; - return; - } - - case 0xb800: { // stop - MSM5205ResetWrite(0, 1); - RastanADPCMData = -1; - RastanADPCMInReset = 1; - return; - } - - case 0xc000: { // load - TopspeedADPCMPos = d << 8; - return; - } - - case 0xc400: { // play - MSM5205ResetWrite(1, 0); - TopspeedADPCMInReset = 0; - return; - } - - case 0xc800: { // stop - MSM5205ResetWrite(1, 1); - TopspeedADPCMData = -1; - TopspeedADPCMInReset = 1; - return; - } - - case 0xd000: { - MSM5205SetRoute(0, (double)((double)d / 256), BURN_SND_ROUTE_BOTH); - return; - } - - case 0xd200: { - MSM5205SetRoute(1, (double)((double)d / 256)-0.20, BURN_SND_ROUTE_BOTH); - return; - } - - case 0xcc00: - case 0xd400: - case 0xd600: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall VolfiedZ80Read(UINT16 a) -{ - switch (a) { - case 0x8801: { - return TC0140SYTSlaveCommRead(); - } - - case 0x9000: { - return BurnYM2203Read(0, 0); - } - - case 0x9001: { - return BurnYM2203Read(0, 1); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read %04X\n"), a); - } - } - - return 0; -} - -void __fastcall VolfiedZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0x8800: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0x8801: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0x9000: { - BurnYM2203Write(0, 0, d); - return; - } - - case 0x9001: { - BurnYM2203Write(0, 1, d); - return; - } - - case 0x9800: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall OpwolfbCChipSubZ80Read(UINT16 a) -{ - switch (a) { - case 0x8800: { - return TaitoInput[0]; - } - - case 0x9800: { - return TaitoInput[0]; - } - } - - return 0; -} - -void __fastcall OpwolfbCChipSubZ80Write(UINT16 a, UINT8) -{ - switch (a) { - case 0x9000: - case 0xa000: { - //nop - return; - } - } -} - -static void TaitoYM2151IRQHandler(INT32 Irq) -{ - ZetSetIRQLine(0, (Irq) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static void TaitoYM2203IRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -inline static INT32 TaitoSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)((double)ZetTotalCycles() * nSoundRate / 4000000); -} - -inline static double TaitoGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static void RbislandBankSwitch(UINT32, UINT32 Data) -{ - if (ZetGetActive() == -1) return; - - TaitoZ80Bank = (Data - 1) & 3; - - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); -} - -static void RastanBankSwitch(UINT32, UINT32 Data) -{ - if (ZetGetActive() == -1) return; - Data &= 3; - if (Data != 0) { - TaitoZ80Bank = Data - 1; - - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - } -} - -static void DariusAdpcmInt() -{ - if (DariusNmiEnable) ZetNmi(); -} - -static void OpwolfMSM5205Vck0() -{ - if (OpwolfADPCMData[0] != -1) { - MSM5205DataWrite(0, OpwolfADPCMData[0] & 0x0f); - OpwolfADPCMData[0] = -1; - if (OpwolfADPCMPos[0] == OpwolfADPCMEnd[0]) MSM5205ResetWrite(0, 1); - } else { - OpwolfADPCMData[0] = TaitoMSM5205Rom[OpwolfADPCMPos[0]]; - OpwolfADPCMPos[0] = (OpwolfADPCMPos[0] + 1) & 0x7ffff; - MSM5205DataWrite(0, OpwolfADPCMData[0] >> 4); - } -} - -static void OpwolfMSM5205Vck1() -{ - if (OpwolfADPCMData[1] != -1) { - MSM5205DataWrite(1, OpwolfADPCMData[1] & 0x0f); - OpwolfADPCMData[1] = -1; - if (OpwolfADPCMPos[1] == OpwolfADPCMEnd[1]) MSM5205ResetWrite(1, 1); - } else { - OpwolfADPCMData[1] = TaitoMSM5205Rom[OpwolfADPCMPos[1]]; - OpwolfADPCMPos[1] = (OpwolfADPCMPos[1] + 1) & 0x7ffff; - MSM5205DataWrite(1, OpwolfADPCMData[1] >> 4); - } -} - -static void RastanMSM5205Vck() -{ - if (RastanADPCMData != -1) { - MSM5205DataWrite(0, RastanADPCMData & 0x0f); - RastanADPCMData = -1; - } else { - RastanADPCMData = TaitoMSM5205Rom[RastanADPCMPos]; - RastanADPCMPos = (RastanADPCMPos + 1) & 0xffff; - MSM5205DataWrite(0, RastanADPCMData >> 4); - } -} - -static void TopspeedBankSwitch(UINT32 /*port*/, UINT32 Data) -{ - if (ZetGetActive() == -1) return; - Data &= 3; - if (Data != 0) { - TaitoZ80Bank = Data - 1; - - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - } -} - -static void TopspeedMSM5205Vck() -{ - if (!RastanADPCMInReset) { - if (RastanADPCMData != -1) { - MSM5205DataWrite(0, RastanADPCMData & 0x0f); - RastanADPCMData = -1; - } else { - RastanADPCMData = TaitoMSM5205Rom[RastanADPCMPos]; - RastanADPCMPos = (RastanADPCMPos + 1) & 0xffff; - MSM5205DataWrite(0, RastanADPCMData >> 4); - } - } -} - -static void TopspeedMSM5205Vck2() -{ - MSM5205VCLKWrite(1, 1); - UINT16 oldpos = TopspeedADPCMPos; - - if (!TopspeedADPCMInReset) { - if (TopspeedADPCMData != -1) { - MSM5205DataWrite(1, TopspeedADPCMData & 0x0f); - TopspeedADPCMData = -1; - } else { - TopspeedADPCMData = TaitoMSM5205Rom[0x10000 + TopspeedADPCMPos]; - TopspeedADPCMPos = (TopspeedADPCMPos + 1) & 0xffff; - MSM5205DataWrite(1, (TopspeedADPCMData >> 4) & 0x0f); - } - } - - if ((oldpos >> 8) == 0x0f && ((TopspeedADPCMPos >> 8) == 0x10)) { - TopspeedADPCMPos = 0; - MSM5205ResetWrite(1, 1); - MSM5205VCLKWrite(1, 0); - MSM5205ResetWrite(1, 0); - } else { - MSM5205VCLKWrite(1, 0); - } -} - -static UINT8 VolfiedDip1Read(UINT32) -{ - return TaitoDip[0]; -} - -static UINT8 VolfiedDip2Read(UINT32) -{ - return TaitoDip[1]; -} - -static void DariusWritePortA0(UINT32, UINT32 d) -{ - d &= 0xff; - - DariusVol[0] = DariusDefVol[(d >> 4) & 0x0f]; - DariusVol[6] = DariusDefVol[(d >> 0) & 0x0f]; - DariusUpdateFM0(); - DariusUpdatePSG0(BURN_SND_YM2203_AY8910_ROUTE_1); -} - -static void DariusWritePortA1(UINT32, UINT32 d) -{ - d &= 0xff; - - DariusVol[3] = DariusDefVol[(d >> 4) & 0x0f]; - DariusVol[7] = DariusDefVol[(d >> 0) & 0x0f]; - DariusUpdateFM1(); - DariusUpdatePSG1(BURN_SND_YM2203_AY8910_ROUTE_1); -} - -static void DariusWritePortB0(UINT32, UINT32 d) -{ - d &= 0xff; - - DariusVol[1] = DariusDefVol[(d >> 4) & 0x0f]; - DariusVol[2] = DariusDefVol[(d >> 0) & 0x0f]; - DariusUpdatePSG0(BURN_SND_YM2203_AY8910_ROUTE_2); - DariusUpdatePSG0(BURN_SND_YM2203_AY8910_ROUTE_3); -} - -static void DariusWritePortB1(UINT32, UINT32 d) -{ - d &= 0xff; - - DariusVol[4] = DariusDefVol[(d >> 4) & 0x0f]; - DariusVol[5] = DariusDefVol[(d >> 0) & 0x0f]; - DariusUpdatePSG1(BURN_SND_YM2203_AY8910_ROUTE_2); - DariusUpdatePSG1(BURN_SND_YM2203_AY8910_ROUTE_3); -} - -static INT32 DariusCharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 DariusCharXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 DariusCharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 DariusCharBPlaneOffsets[2] = { 0, 8 }; -static INT32 DariusCharBXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 DariusCharBYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 DariusSpritePlaneOffsets[4] = { 24, 8, 16, 0 }; -static INT32 DariusSpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 256, 257, 258, 259, 260, 261, 262, 263 }; -static INT32 DariusSpriteYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 }; -static INT32 OpwolfbCharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 OpwolfbCharXOffsets[8] = { 0, 4, 8, 12, 16, 20, 24, 28 }; -static INT32 OpwolfbCharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 OpwolfbSpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 OpwolfbSpriteXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60 }; -static INT32 OpwolfbSpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 RbislandCharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 RbislandCharXOffsets[8] = { 8, 12, 0, 4, 24, 28, 16, 20 }; -static INT32 RbislandCharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 RbislandSpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 RbislandSpriteXOffsets[16] = { 8, 12, 0, 4, 24, 28, 16, 20, 40, 44, 32, 36, 56, 60, 48, 52 }; -static INT32 RbislandSpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 JumpingCharPlaneOffsets[4] = { 0, 0x20000*8, 0x40000*8, 0x60000*8 }; -static INT32 JumpingCharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 JumpingCharYOffsets[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; -static INT32 JumpingSpritePlaneOffsets[4] = { 0x78000*8, 0x50000*8, 0x28000*8, 0 }; -static INT32 JumpingSpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 JumpingSpriteYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }; -static INT32 RastanCharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 RastanCharXOffsets[8] = { 0, 4, 0x200000, 0x200004, 8, 12, 0x200008, 0x20000c }; -static INT32 RastanCharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; -static INT32 RastanSpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 RastanSpriteXOffsets[16] = { 0, 4, 0x200000, 0x200004, 8, 12, 0x200008, 0x20000c, 16, 20, 0x200010, 0x200014, 24, 28, 0x200018, 0x20001c }; -static INT32 RastanSpriteYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480 }; -static INT32 TopspeedCharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TopspeedCharXOffsets[8] = { 8, 12, 0, 4, 24, 28, 16, 20 }; -static INT32 TopspeedCharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 TopspeedSpritePlaneOffsets[4] = { 0, 8, 16, 24 }; -static INT32 TopspeedSpriteXOffsets[16] = { 32, 33, 34, 35, 36, 37, 38, 39, 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 TopspeedSpriteYOffsets[8] = { 0, 64, 128, 192, 256, 320, 384, 448 }; -static INT32 VolfiedSpritePlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 VolfiedSpriteXOffsets[16] = { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60 }; -static INT32 VolfiedSpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; - -static INT32 DariusInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = DariusCharPlaneOffsets; - TaitoCharXOffsets = DariusCharXOffsets; - TaitoCharYOffsets = DariusCharYOffsets; - TaitoNumChar = 0x3000; - - TaitoCharBModulo = 0x80; - TaitoCharBNumPlanes = 2; - TaitoCharBWidth = 8; - TaitoCharBHeight = 8; - TaitoCharBPlaneOffsets = DariusCharBPlaneOffsets; - TaitoCharBXOffsets = DariusCharBXOffsets; - TaitoCharBYOffsets = DariusCharBYOffsets; - TaitoNumCharB = 0x800; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = DariusSpritePlaneOffsets; - TaitoSpriteAXOffsets = DariusSpriteXOffsets; - TaitoSpriteAYOffsets = DariusSpriteYOffsets; - TaitoNumSpriteA = 0x1800; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 2; - TaitoNumYM2203 = 2; - TaitoNumMSM5205 = 1; - - TaitoLoadRoms(0); - - if (Taito68KRom1Size < 0x60000) Taito68KRom1Size = 0x60000; - TaitoZ80Rom1Size = 0x30000; - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - if (Taito68KRom1Num == 4) { - memcpy(Taito68KRom1 + 0x40000, Taito68KRom1 + 0x20000, 0x20000); - memset(Taito68KRom1 + 0x20000, 0xff, 0x20000); - } - - for (INT32 i = 3; i >= 0; i--) { - memcpy(TaitoZ80Rom1 + 0x8000 * i + 0x10000, TaitoZ80Rom1 , 0x4000); - memcpy(TaitoZ80Rom1 + 0x8000 * i + 0x14000, TaitoZ80Rom1 + 0x4000 * i, 0x4000); - } - - PC080SNInit(0, TaitoNumChar, -16, 0, 0, 1); - TC0140SYTInit(0); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x080000, 0x08ffff, MAP_RAM); - SekMapMemory(PC080SNRam[0] , 0xd00000, 0xd0ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0xd80000, 0xd80fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0xe00100, 0xe00fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0xe01000, 0xe02fff, MAP_RAM); - SekMapMemory(TaitoVideoRam , 0xe08000, 0xe0ffff, MAP_RAM); - SekMapMemory(Taito68KRam1 + 0x10000 , 0xe10000, 0xe10fff, MAP_RAM); - SekSetReadByteHandler(0, Darius68K1ReadByte); - SekSetWriteByteHandler(0, Darius68K1WriteByte); - SekSetReadWordHandler(0, Darius68K1ReadWord); - SekSetWriteWordHandler(0, Darius68K1WriteWord); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x040000, 0x04ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0xd80000, 0xd80fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0xe00100, 0xe00fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0xe01000, 0xe02fff, MAP_RAM); - SekMapMemory(TaitoVideoRam , 0xe08000, 0xe0ffff, MAP_RAM); - SekSetReadByteHandler(0, Darius68K2ReadByte); - SekSetWriteByteHandler(0, Darius68K2WriteByte); - SekSetReadWordHandler(0, Darius68K2ReadWord); - SekSetWriteWordHandler(0, Darius68K2WriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(DariusZ80Read); - ZetSetWriteHandler(DariusZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1 ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetInHandler(DariusZ802ReadPort); - ZetSetOutHandler(DariusZ802WritePort); - ZetMapArea(0x0000, 0xffff, 0, TaitoZ80Rom2 ); - ZetMapArea(0x0000, 0xffff, 2, TaitoZ80Rom2 ); - ZetClose(); - - BurnYM2203Init(2, 4000000, TaitoYM2203IRQHandler, TaitoSynchroniseStream, TaitoGetTime, 0); - BurnTimerAttachZet(8000000 / 2); - BurnYM2203SetPorts(0, NULL, NULL, &DariusWritePortA0, &DariusWritePortB0); - BurnYM2203SetPorts(1, NULL, NULL, &DariusWritePortA1, &DariusWritePortB1); - DariusYM2203AY8910RouteMasterVol = 0.08; - DariusYM2203RouteMasterVol = 0.60; - bYM2203UseSeperateVolumes = 1; - - MSM5205Init(0, TaitoSynchroniseStream, 384000, DariusAdpcmInt, MSM5205_S48_4B, 1); - DariusMSM5205RouteMasterVol = 1.00; - MSM5205SetSeperateVolumes(0, 1); - - GenericTilesInit(); - - TaitoDrawFunction = DariusDraw; - TaitoMakeInputsFunction = DariusMakeInputs; - TaitoIrqLine = 4; - - nTaitoCyclesTotal[0] = (16000000 / 2) / 60; - nTaitoCyclesTotal[1] = (16000000 / 2) / 60; - nTaitoCyclesTotal[2] = (8000000 / 2) / 60; - nTaitoCyclesTotal[3] = (8000000 / 2) / 60; - - // Reset the driver - TaitoResetFunction = DariusDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 OpwolfInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = RbislandCharPlaneOffsets; - TaitoCharXOffsets = RbislandCharXOffsets; - TaitoCharYOffsets = RbislandCharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = RbislandSpritePlaneOffsets; - TaitoSpriteAXOffsets = RbislandSpriteXOffsets; - TaitoSpriteAYOffsets = RbislandSpriteYOffsets; - TaitoNumSpriteA = 0x1000; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2151 = 1; - TaitoNumMSM5205 = 2; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - PC080SNInit(0, TaitoNumChar, 0, 8, 0, 0); - PC090OJInit(TaitoNumSpriteA, 0, 8, 0); - TC0140SYTInit(0); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x107fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(PC080SNRam[0] , 0xc00000, 0xc0ffff, MAP_RAM); - SekMapMemory(Taito68KRam1 + 0x8000 , 0xc10000, 0xc1ffff, MAP_RAM); - SekMapMemory(PC090OJRam , 0xd00000, 0xd03fff, MAP_RAM); - SekSetReadByteHandler(0, Opwolf68KReadByte); - SekSetWriteByteHandler(0, Opwolf68KWriteByte); - SekSetReadWordHandler(0, Opwolf68KReadWord); - SekSetWriteWordHandler(0, Opwolf68KWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(OpwolfZ80Read); - ZetSetWriteHandler(OpwolfZ80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&TaitoYM2151IRQHandler); - BurnYM2151SetPortHandler(&RbislandBankSwitch); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - MSM5205Init(0, TaitoSynchroniseStream, 384000, OpwolfMSM5205Vck0, MSM5205_S48_4B, 1); - MSM5205Init(1, TaitoSynchroniseStream, 384000, OpwolfMSM5205Vck1, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - MSM5205SetRoute(1, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - BurnGunInit(1, true); - bUseGuns = 1; - - TaitoDrawFunction = OpwolfDraw; - TaitoMakeInputsFunction = OpwolfMakeInputs; - TaitoIrqLine = 5; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = 4000000 / 60; - - UINT16 *Rom = (UINT16*)Taito68KRom1; - OpWolfGunXOffset = 0xec - (Rom[0x03ffb0 / 2] & 0xff); - OpWolfGunYOffset = 0x1c - (Rom[0x03ffae / 2] & 0xff); - INT32 Region = Rom[0x03fffe / 2] & 0xff; - OpwolfCChipInit(Region); - - // Reset the driver - TaitoResetFunction = OpwolfDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 OpwolfbInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = OpwolfbCharPlaneOffsets; - TaitoCharXOffsets = OpwolfbCharXOffsets; - TaitoCharYOffsets = OpwolfbCharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = OpwolfbSpritePlaneOffsets; - TaitoSpriteAXOffsets = OpwolfbSpriteXOffsets; - TaitoSpriteAYOffsets = OpwolfbSpriteYOffsets; - TaitoNumSpriteA = 0x1000; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 2; - TaitoNumYM2151 = 1; - TaitoNumMSM5205 = 2; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - PC080SNInit(0, TaitoNumChar, 0, 8, 0, 0); - PC090OJInit(TaitoNumSpriteA, 0, 8, 0); - TC0140SYTInit(0); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x107fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(PC080SNRam[0] , 0xc00000, 0xc0ffff, MAP_RAM); - SekMapMemory(Taito68KRam1 + 0x8000 , 0xc10000, 0xc1ffff, MAP_RAM); - SekMapMemory(PC090OJRam , 0xd00000, 0xd03fff, MAP_RAM); - SekSetReadByteHandler(0, Opwolfb68KReadByte); - SekSetWriteByteHandler(0, Opwolfb68KWriteByte); - SekSetReadWordHandler(0, Opwolfb68KReadWord); - SekSetWriteWordHandler(0, Opwolfb68KWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(OpwolfZ80Read); - ZetSetWriteHandler(OpwolfZ80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1 ); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetSetReadHandler(OpwolfbCChipSubZ80Read); - ZetSetWriteHandler(OpwolfbCChipSubZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, TaitoZ80Rom2 ); - ZetMapArea(0x0000, 0x7fff, 2, TaitoZ80Rom2 ); - ZetMapArea(0xc000, 0xc7ff, 0, TaitoZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 1, TaitoZ80Ram2 ); - ZetMapArea(0xc000, 0xc7ff, 2, TaitoZ80Ram2 ); - ZetClose(); - - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&TaitoYM2151IRQHandler); - BurnYM2151SetPortHandler(&RbislandBankSwitch); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.75, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.75, BURN_SND_ROUTE_RIGHT); - - MSM5205Init(0, TaitoSynchroniseStream, 384000, OpwolfMSM5205Vck0, MSM5205_S48_4B, 1); - MSM5205Init(1, TaitoSynchroniseStream, 384000, OpwolfMSM5205Vck1, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - MSM5205SetRoute(1, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - BurnGunInit(1, true); - bUseGuns = 1; - - TaitoDrawFunction = OpwolfDraw; - TaitoMakeInputsFunction = OpwolfbMakeInputs; - TaitoIrqLine = 5; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = 4000000 / 60; - nTaitoCyclesTotal[2] = 4000000 / 60; - - OpWolfGunXOffset = -2; - OpWolfGunYOffset = 17; - - // Reset the driver - TaitoResetFunction = OpwolfDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 RbislandInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = RbislandCharPlaneOffsets; - TaitoCharXOffsets = RbislandCharXOffsets; - TaitoCharYOffsets = RbislandCharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = RbislandSpritePlaneOffsets; - TaitoSpriteAXOffsets = RbislandSpriteXOffsets; - TaitoSpriteAYOffsets = RbislandSpriteYOffsets; - TaitoNumSpriteA = 0x1400; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2151 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - PC080SNInit(0, TaitoNumChar, 0, 16, 0, 0); - PC090OJInit(TaitoNumSpriteA, 0, 16, 0); - TC0140SYTInit(0); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x10c000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(Taito68KRam1 + 0x4000 , 0x201000, 0x203fff, MAP_RAM); - SekMapMemory(PC080SNRam[0] , 0xc00000, 0xc0ffff, MAP_RAM); - SekMapMemory(PC090OJRam , 0xd00000, 0xd03fff, MAP_RAM); - SekSetReadByteHandler(0, Rbisland68KReadByte); - SekSetWriteByteHandler(0, Rbisland68KWriteByte); - SekSetReadWordHandler(0, Rbisland68KReadWord); - SekSetWriteWordHandler(0, Rbisland68KWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(RbislandZ80Read); - ZetSetWriteHandler(RbislandZ80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2151Init(16000000 / 4); - BurnYM2151SetIrqHandler(&TaitoYM2151IRQHandler); - BurnYM2151SetPortHandler(&RbislandBankSwitch); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - TaitoDrawFunction = RbislandDraw; - TaitoMakeInputsFunction = RbislandMakeInputs; - TaitoIrqLine = 4; - - nTaitoCyclesTotal[0] = (16000000 / 2) / 60; - nTaitoCyclesTotal[1] = (16000000 / 4) / 60; - - RainbowCChipInit(RainbowCChipVer); - - // Reset the driver - TaitoResetFunction = RbislandDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 RbislandeInit() -{ - RainbowCChipVer = 1; - - return RbislandInit(); -} - -static INT32 JumpingInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x40; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = JumpingCharPlaneOffsets; - TaitoCharXOffsets = JumpingCharXOffsets; - TaitoCharYOffsets = JumpingCharYOffsets; - TaitoNumChar = 16384; - - TaitoSpriteAModulo = 0x100; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = JumpingSpritePlaneOffsets; - TaitoSpriteAXOffsets = JumpingSpriteXOffsets; - TaitoSpriteAYOffsets = JumpingSpriteYOffsets; - TaitoSpriteAInvertRom = 1; - TaitoNumSpriteA = 5120; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2203 = 2; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - PC080SNInit(0, TaitoNumChar, 0, 16, 1, 0); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x09ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x10c000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(Taito68KRam1 + 0x4000 , 0x201000, 0x203fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x440000, 0x4407ff, MAP_RAM); - SekMapMemory(PC080SNRam[0] , 0xc00000, 0xc0ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam + 0x800 , 0xd00000, 0xd01fff, MAP_RAM); - SekSetReadByteHandler(0, Jumping68KReadByte); - SekSetWriteByteHandler(0, Jumping68KWriteByte); - SekSetReadWordHandler(0, Jumping68KReadWord); - SekSetWriteWordHandler(0, Jumping68KWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(JumpingZ80Read); - ZetSetWriteHandler(JumpingZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xffff, 0, TaitoZ80Rom1 + 0xc000 ); - ZetMapArea(0xc000, 0xffff, 2, TaitoZ80Rom1 + 0xc000 ); - ZetClose(); - - BurnYM2203Init(2, 3579545, NULL, TaitoSynchroniseStream, TaitoGetTime, 0); - BurnTimerAttachZet(4000000); - BurnYM2203SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - BurnYM2203SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - TaitoDrawFunction = JumpingDraw; - TaitoMakeInputsFunction = JumpingMakeInputs; - TaitoIrqLine = 4; - PC080SNSetFgTransparentPen(0, 0x0f); - - nTaitoCyclesTotal[0] = 8000000 / 60; - nTaitoCyclesTotal[1] = 4000000 / 60; - - // Reset the driver - TaitoResetFunction = TaitoDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 RastanInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x80; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = RastanCharPlaneOffsets; - TaitoCharXOffsets = RastanCharXOffsets; - TaitoCharYOffsets = RastanCharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = RastanSpritePlaneOffsets; - TaitoSpriteAXOffsets = RastanSpriteXOffsets; - TaitoSpriteAYOffsets = RastanSpriteYOffsets; - TaitoNumSpriteA = 0x1000; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2151 = 1; - TaitoNumMSM5205 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - PC080SNInit(0, TaitoNumChar, 0, 8, 0, 0); - PC090OJInit(TaitoNumSpriteA, 0, 8, 0); - TC0140SYTInit(0); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x05ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x10c000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x200000, 0x200fff, MAP_RAM); - SekMapMemory(PC080SNRam[0] , 0xc00000, 0xc0ffff, MAP_RAM); - SekMapMemory(PC090OJRam , 0xd00000, 0xd03fff, MAP_RAM); - SekSetReadByteHandler(0, Rastan68KReadByte); - SekSetWriteByteHandler(0, Rastan68KWriteByte); - SekSetWriteWordHandler(0, Rastan68KWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(RastanZ80Read); - ZetSetWriteHandler(RastanZ80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2151Init(16000000 / 4); - BurnYM2151SetIrqHandler(&TaitoYM2151IRQHandler); - BurnYM2151SetPortHandler(&RastanBankSwitch); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, TaitoSynchroniseStream, 384000, RastanMSM5205Vck, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.60, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - TaitoDrawFunction = RastanDraw; - TaitoMakeInputsFunction = RastanMakeInputs; - TaitoIrqLine = 5; - - nTaitoCyclesTotal[0] = (16000000 / 2) / 60; - nTaitoCyclesTotal[1] = (16000000 / 4) / 60; - - // Reset the driver - TaitoResetFunction = RastanDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 TopspeedInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = TopspeedCharPlaneOffsets; - TaitoCharXOffsets = TopspeedCharXOffsets; - TaitoCharYOffsets = TopspeedCharYOffsets; - TaitoNumChar = 0x2000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = TopspeedSpritePlaneOffsets; - TaitoSpriteAXOffsets = TopspeedSpriteXOffsets; - TaitoSpriteAYOffsets = TopspeedSpriteYOffsets; - TaitoNumSpriteA = 0x8000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2151 = 1; - TaitoNumMSM5205 = 2; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - PC080SNInit(0, TaitoNumChar, 0, 8, 0, 0); - PC080SNInit(1, TaitoNumChar, 0, 8, 0, 0); - TC0140SYTInit(0); - TC0220IOCInit(); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x20000 , 0x080000, 0x0fffff, MAP_ROM); - SekMapMemory(TaitoSharedRam , 0x400000, 0x40ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x500000, 0x503fff, MAP_RAM); - SekMapMemory(Taito68KRam1 , 0x800000, 0x80ffff, MAP_RAM); - SekMapMemory(PC080SNRam[0] , 0xa00000, 0xa0ffff, MAP_RAM); - SekMapMemory(PC080SNRam[1] , 0xb00000, 0xb0ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0xd00000, 0xd00fff, MAP_RAM); - SekMapMemory(TaitoVideoRam , 0xe00000, 0xe0ffff, MAP_RAM); - SekSetReadByteHandler(0, Topspeed68K1ReadByte); - SekSetWriteByteHandler(0, Topspeed68K1WriteByte); - SekSetReadWordHandler(0, Topspeed68K1ReadWord); - SekSetWriteWordHandler(0, Topspeed68K1WriteWord); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(TaitoSharedRam , 0x400000, 0x40ffff, MAP_RAM); - SekSetReadByteHandler(0, Topspeed68K2ReadByte); - SekSetWriteByteHandler(0, Topspeed68K2WriteByte); - SekSetReadWordHandler(0, Topspeed68K2ReadWord); - SekSetWriteWordHandler(0, Topspeed68K2WriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(TopspeedZ80Read); - ZetSetWriteHandler(TopspeedZ80Write); - ZetSetOutHandler(TopspeedZ80WritePort); - - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - TopspeedBankSwitch(0, 1); - ZetMapArea(0x8000, 0x8fff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x8fff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2151Init(16000000 / 4); - BurnYM2151SetIrqHandler(&TaitoYM2151IRQHandler); - BurnYM2151SetPortHandler(&TopspeedBankSwitch); - BurnYM2151SetAllRoutes(0.30, BURN_SND_ROUTE_BOTH); - - MSM5205Init(0, TaitoSynchroniseStream, 384000, TopspeedMSM5205Vck, MSM5205_S48_4B, 1); - MSM5205SetRoute(0, 0.00, BURN_SND_ROUTE_BOTH); - MSM5205Init(1, TaitoSynchroniseStream, 384000, NULL, MSM5205_SEX_4B, 1); - MSM5205SetRoute(1, 0.00, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - TaitoDrawFunction = TopspeedDraw; - TaitoMakeInputsFunction = TopspeedMakeInputs; - TaitoIrqLine = 5; - - nTaitoCyclesTotal[0] = 8000000 / 60; - nTaitoCyclesTotal[1] = 8000000 / 60; - nTaitoCyclesTotal[2] = 4000000 / 60; - - BurnShiftInitDefault(); - bUseShifter = 1; - - pTopspeedTempDraw = (UINT16*)BurnMalloc(512 * 512 * sizeof(UINT16)); - - // Reset the driver - TaitoResetFunction = TopspeedDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 VolfiedInit() -{ - INT32 nLen; - - TaitoNumChar = 0; - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = VolfiedSpritePlaneOffsets; - TaitoSpriteAXOffsets = VolfiedSpriteXOffsets; - TaitoSpriteAYOffsets = VolfiedSpriteYOffsets; - TaitoNumSpriteA = 0x1800; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - TaitoNumYM2203 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - PC090OJInit(TaitoNumSpriteA, 0, 8, 0); - PC090OJSetPaletteOffset(256); - TC0140SYTInit(0); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRom1 + 0x40000 , 0x080000, 0x0fffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(PC090OJRam , 0x200000, 0x203fff, MAP_RAM); - SekMapMemory(TaitoVideoRam , 0x400000, 0x47ffff, MAP_READ); - SekMapMemory(TaitoPaletteRam , 0x500000, 0x503fff, MAP_RAM); - SekSetReadByteHandler(0, Volfied68KReadByte); - SekSetWriteByteHandler(0, Volfied68KWriteByte); - SekSetReadWordHandler(0, Volfied68KReadWord); - SekSetWriteWordHandler(0, Volfied68KWriteWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(VolfiedZ80Read); - ZetSetWriteHandler(VolfiedZ80Write); - ZetMapArea(0x0000, 0x7fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x7fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x8000, 0x87ff, 0, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x87ff, 1, TaitoZ80Ram1 ); - ZetMapArea(0x8000, 0x87ff, 2, TaitoZ80Ram1 ); - ZetClose(); - - BurnYM2203Init(1, 4000000, TaitoYM2203IRQHandler, TaitoSynchroniseStream, TaitoGetTime, 0); - BurnYM2203SetPorts(0, &VolfiedDip1Read, &VolfiedDip2Read, NULL, NULL); - BurnTimerAttachZet(4000000); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.60, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - TaitoDrawFunction = VolfiedDraw; - TaitoMakeInputsFunction = VolfiedMakeInputs; - TaitoIrqLine = 4; - - nTaitoCyclesTotal[0] = 8000000 / 60; - nTaitoCyclesTotal[1] = 4000000 / 60; - - VolfiedCChipInit(); - - // Reset the driver - TaitoResetFunction = VolfiedDoReset; - TaitoResetFunction(); - - return 0; -} - -static INT32 TaitoMiscExit() -{ - RastanADPCMPos = 0; - RastanADPCMData = 0; - memset(OpwolfADPCM_B, 0, 8); - memset(OpwolfADPCM_C, 0, 8); - OpwolfADPCMPos[0] = OpwolfADPCMPos[1] = 0; - OpwolfADPCMEnd[0] = OpwolfADPCMEnd[1] = 0; - OpwolfADPCMData[0] = OpwolfADPCMData[1] = 0; - - OpWolfGunXOffset = 0; - OpWolfGunYOffset = 0; - - DariusADPCMCommand = 0; - DariusNmiEnable = 0; - DariusCoinWord = 0; - - VolfiedVidCtrl = 0; - VolfiedVidMask = 0; - - RainbowCChipVer = 0; - bUseGuns = 0; - if (bUseShifter) - BurnShiftExit(); - bUseShifter = 0; - - BurnFree(pTopspeedTempDraw); - - return TaitoExit(); -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | bits; -} - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 0); - g = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 5); - b = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 10); - - return BurnHighCol(r, g, b, 0); -} - -inline static UINT32 OpwolfCalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 8); - g = pal4bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 4); - b = pal4bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 0); - - return BurnHighCol(r, g, b, 0); -} - -inline static UINT32 JumpingCalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal4bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 0); - g = pal4bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 4); - b = pal4bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 8); - - return BurnHighCol(r, g, b, 0); -} - -static void TaitoMiscCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)TaitoPaletteRam, pd = TaitoPalette; i < 0x2000; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void OpwolfCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)TaitoPaletteRam, pd = TaitoPalette; i < 0x0800; i++, ps++, pd++) { - *pd = OpwolfCalcCol(*ps); - } -} - -static void JumpingCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)TaitoPaletteRam, pd = TaitoPalette; i < 0x0800; i++, ps++, pd++) { - *pd = JumpingCalcCol(*ps); - } -} - -static void DariusDrawSprites(INT32 PriorityDraw) -{ - INT32 Offset, sx, sy; - UINT16 Code, Data; - UINT8 xFlip, yFlip, Colour, Priority; - - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - - for (Offset = 0xf000 / 2 - 4; Offset >= 0; Offset -= 4) - { - Code = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]) & 0x1fff; - - if (Code) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 0]); - sy = (256 - Data) & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]); - sx = Data & 0x3ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - xFlip = ((Data & 0x4000) >> 14); - yFlip = ((Data & 0x8000) >> 15); - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]); - Priority = (Data & 0x80) >> 7; - if (Priority != PriorityDraw) continue; - - Colour = (Data & 0x7f); - - if (sx > 900) sx -= 1024; - if (sy > 400) sy -= 512; - - sy -= 16; - - if (sx > 16 && sx < (nScreenWidth - 16) && sy > 16 && sy < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } - } - } -} - -static void DariusDrawCharLayer() -{ - INT32 mx, my, Code, Attr, Colour, x, y, Flip, xFlip, yFlip, TileIndex = 0; - - UINT16 *VideoRam = (UINT16*)TaitoVideoRam; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 128; mx++) { - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x2000]) & (TaitoNumCharB - 1); - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x0000]); - - Colour = (Attr & 0xff) << 2; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - if (x > 8 && x < (nScreenWidth - 8) && y > 8 && y < (nScreenHeight - 8)) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 2, 0, 0, TaitoCharsB); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 2, 0, 0, TaitoCharsB); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 2, 0, 0, TaitoCharsB); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 2, 0, 0, TaitoCharsB); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, TaitoCharsB); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, TaitoCharsB); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, TaitoCharsB); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 2, 0, 0, TaitoCharsB); - } - } - } - - TileIndex++; - } - } -} - -static void JumpingDrawSprites() -{ - INT32 SpriteColBank = (PC090OJSpriteCtrl & 0xe0) >> 1; - - for (INT32 Offs = 0x400 - 8; Offs >= 0; Offs -= 8) { - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Tile = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offs]); - if (Tile < 5120) { - INT32 sx, sy, Colour, Data1, xFlip, yFlip; - - sy = ((BURN_ENDIAN_SWAP_INT16(SpriteRam[Offs + 1]) - 0xfff1) ^ 0xffff) & 0x1ff; - if (sy > 400) sy = sy - 512; - sx = (BURN_ENDIAN_SWAP_INT16(SpriteRam[Offs + 2]) - 0x38) & 0x1ff; - if (sx > 400) sx = sx - 512; - - Data1 = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offs + 3]); - Colour = (BURN_ENDIAN_SWAP_INT16(SpriteRam[Offs + 4]) & 0x0f) | SpriteColBank; - xFlip = Data1 & 0x40; - yFlip = Data1 & 0x80; - - sy += 1; - sy -= 16; - - if (sx > 16 && sx < (nScreenWidth - 16) && sy > 16 && sy < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Tile, sx, sy, Colour, 4, 15, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Tile, sx, sy, Colour, 4, 15, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Tile, sx, sy, Colour, 4, 15, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask(pTransDraw, Tile, sx, sy, Colour, 4, 15, 0, TaitoSpritesA); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Tile, sx, sy, Colour, 4, 15, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Tile, sx, sy, Colour, 4, 15, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Tile, sx, sy, Colour, 4, 15, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Tile, sx, sy, Colour, 4, 15, 0, TaitoSpritesA); - } - } - } - } - } -} - -static void RenderSpriteZoom(INT32 Code, INT32 sx, INT32 sy, INT32 Colour, INT32 xFlip, INT32 yFlip, INT32 xScale, INT32 yScale, UINT8* pSource, UINT8 priority) -{ - UINT8 *SourceBase = pSource + ((Code % TaitoNumSpriteA) * TaitoSpriteAWidth * TaitoSpriteAHeight); - - INT32 SpriteScreenHeight = (yScale * TaitoSpriteAHeight + 0x8000) >> 16; - INT32 SpriteScreenWidth = (xScale * TaitoSpriteAWidth + 0x8000) >> 16; - static const INT32 primasks[2] = { 0xff00, 0xfffc }; /* Sprites are over bottom layer or under top layer */ - INT32 primask = primasks[priority]; - - Colour = 0x10 * (Colour % 0x100); - - if (TaitoFlipScreenX) { - xFlip = !xFlip; - sx = 320 - sx - (xScale >> 12); - } - - if (SpriteScreenWidth && SpriteScreenHeight) { - INT32 dx = (TaitoSpriteAWidth << 16) / SpriteScreenWidth; - INT32 dy = (TaitoSpriteAHeight << 16) / SpriteScreenHeight; - - INT32 ex = sx + SpriteScreenWidth; - INT32 ey = sy + SpriteScreenHeight; - - INT32 xIndexBase; - INT32 yIndex; - - if (xFlip) { - xIndexBase = (SpriteScreenWidth - 1) * dx; - dx = -dx; - } else { - xIndexBase = 0; - } - - if (yFlip) { - yIndex = (SpriteScreenHeight - 1) * dy; - dy = -dy; - } else { - yIndex = 0; - } - - if (sx < 0) { - INT32 Pixels = 0 - sx; - sx += Pixels; - xIndexBase += Pixels * dx; - } - - if (sy < 0) { - INT32 Pixels = 0 - sy; - sy += Pixels; - yIndex += Pixels * dy; - } - - if (ex > nScreenWidth) { - INT32 Pixels = ex - nScreenWidth; - ex -= Pixels; - } - - if (ey > nScreenHeight) { - INT32 Pixels = ey - nScreenHeight; - ey -= Pixels; - } - - if (ex > sx) { - INT32 y; - - for (y = sy; y < ey; y++) { - UINT8 *Source = SourceBase + ((yIndex >> 16) * TaitoSpriteAWidth); - UINT16*pPixel = pTransDraw + (y * nScreenWidth); - UINT16*pri = DrvPriBmp + (y * nScreenWidth); - - INT32 x, xIndex = xIndexBase; - for (x = sx; x < ex; x++) { - INT32 c = Source[xIndex >> 16]; - if (c != 0 && (pri[x] & primask)==0) { - pPixel[x] = c | Colour; - pri[x] = primask; - } - xIndex += dx; - } - - yIndex += dy; - } - } - } -} - -static void TopspeedDrawSprites(INT32 /*PriorityDraw*/) -{ - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Offset, MapOffset, x, y, xCur, yCur, SpriteChunk; - UINT16 *SpriteMap = (UINT16*)TaitoVideoRam; - UINT16 Data, TileNum, Code, Colour; - UINT8 xFlip, yFlip, Priority, BadChunks; - UINT8 j, k, px, py, zx, zy, xZoom, yZoom; - - //for (Offset = (0x2c0 / 2) - 4; Offset >= 0; Offset -= 4) { - for (Offset = 0; Offset < (0x2c0 / 2) - 4; Offset += 4) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - - TileNum = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]) & 0xff; - Colour = (BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]) & 0xff00) >> 8; - xFlip = (Data & 0x4000) >> 14; - yFlip = (BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]) & 0x8000) >> 15; - x = Data & 0x1ff; - y = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset]) & 0x1ff; - xZoom = (BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]) & 0x7f); - yZoom = (BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset]) & 0xfe00) >> 9; - Priority = (Data & 0x8000) >> 15; - - //if (Priority != PriorityDraw) continue; - - if (y == 0x180) continue; - - MapOffset = TileNum << 7; - - xZoom += 1; - yZoom += 1; - - y += 3 + (128 - yZoom); - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - BadChunks = 0; - - for (SpriteChunk = 0; SpriteChunk < 128; SpriteChunk++) { - k = SpriteChunk % 8; - j = SpriteChunk / 8; - - px = (xFlip) ? (7 - k) : (k); - py = (yFlip) ? (15 - j) : (j); - - Code = SpriteMap[MapOffset + (py << 3) + px]; - - if (Code & 0x8000) { - BadChunks += 1; - continue; - } - - xCur = x + ((k * xZoom) / 8); - yCur = y + ((j * yZoom) / 16); - - zx = x + (((k + 1) * xZoom) / 8) - xCur; - zy = y + (((j + 1) * yZoom) / 16) - yCur; - - RenderSpriteZoom(Code, xCur, yCur - 16, Colour, xFlip, yFlip, zx << 12, zy << 13, TaitoSpritesA, Priority); - } - } -} - -static void DariusDraw() -{ - BurnTransferClear(); - TaitoMiscCalcPalette(); - PC080SNDrawBgLayer(0, 1, TaitoChars, pTransDraw); - DariusDrawSprites(0); - PC080SNDrawFgLayer(0, 0, TaitoChars, pTransDraw); - DariusDrawSprites(1); - DariusDrawCharLayer(); - BurnTransferCopy(TaitoPalette); -} - -static void OpwolfDraw() -{ - BurnTransferClear(); - OpwolfCalcPalette(); - PC080SNDrawBgLayer(0, 1, TaitoChars, pTransDraw); - PC090OJDrawSprites(TaitoSpritesA); - PC080SNDrawFgLayer(0, 0, TaitoChars, pTransDraw); - BurnTransferCopy(TaitoPalette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } -} - -static void RbislandDraw() -{ - BurnTransferClear(); - TaitoMiscCalcPalette(); - PC080SNDrawBgLayer(0, 1, TaitoChars, pTransDraw); - PC090OJDrawSprites(TaitoSpritesA); - PC080SNDrawFgLayer(0, 0, TaitoChars, pTransDraw); - BurnTransferCopy(TaitoPalette); -} - -static void JumpingDraw() -{ - BurnTransferClear(); - JumpingCalcPalette(); - PC080SNOverrideFgScroll(0, 16, 0); - PC080SNDrawBgLayer(0, 1, TaitoChars, pTransDraw); - JumpingDrawSprites(); - PC080SNDrawFgLayer(0, 0, TaitoChars, pTransDraw); - BurnTransferCopy(TaitoPalette); -} - -static void RastanDraw() -{ - BurnTransferClear(); - TaitoMiscCalcPalette(); - PC080SNDrawBgLayer(0, 1, TaitoChars, pTransDraw); - PC080SNDrawFgLayer(0, 0, TaitoChars, pTransDraw); - PC090OJDrawSprites(TaitoSpritesA); - BurnTransferCopy(TaitoPalette); -} - -static void TopspeedDraw() -{ - BurnTransferClear(); - TaitoMiscCalcPalette(); - - memset(DrvPriBmp, 0, 512*512); - - if (nBurnLayer & 1) PC080SNDrawFgLayerPrio(1, 1, TaitoChars, pTransDraw, DrvPriBmp, 1); - if (nBurnLayer & 2) TopspeedDrawBgLayer(1, TaitoChars, pTopspeedTempDraw, (UINT16*)Taito68KRam1, DrvPriBmp, 4); - if (nBurnLayer & 4) TopspeedDrawFgLayer(0, TaitoChars, pTopspeedTempDraw, (UINT16*)(Taito68KRam1 + 0x200), DrvPriBmp, 4); - if (nSpriteEnable & 2) TopspeedDrawSprites(0); - if (nBurnLayer & 8) PC080SNDrawBgLayerPrio(0, 0, TaitoChars, pTransDraw, DrvPriBmp, 8); - BurnTransferCopy(TaitoPalette); - - BurnShiftRender(); -} - -static void VolfiedDraw() -{ - BurnTransferClear(); - TaitoMiscCalcPalette(); - - UINT16* p = (UINT16*)TaitoVideoRam; - if (VolfiedVidCtrl & 0x01) p += 0x20000; - for (INT32 y = 0; y < nScreenHeight + 8; y++) { - for (INT32 x = 1; x < nScreenWidth + 1; x++) { - INT32 Colour = (p[x] << 2) & 0x700; - - if (p[x] & 0x8000) { - Colour |= 0x800 | ((p[x] >> 9) & 0xf); - - if (p[x] & 0x2000) Colour &= ~0xf; - } else { - Colour |= p[x] & 0xf; - } - - if ((y - 8) >= 0 && (y - 8) < nScreenHeight) { - pTransDraw[((y - 8) * nScreenWidth) + x - 1] = Colour; - } - } - - p += 512; - } - - PC090OJDrawSprites(TaitoSpritesA); - BurnTransferCopy(TaitoPalette); -} - -static INT32 TaitoMiscFrame() -{ - INT32 nInterleave = 10; - if (TaitoNumMSM5205) nInterleave = MSM5205CalcInterleave(0, 8000000 / 2); - INT32 nSoundBufferPos = 0; - - if (TaitoReset) TaitoResetFunction(); - - TaitoMakeInputsFunction(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = nTaitoCyclesDone[2] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 # 1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == 9) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - if (TaitoNumZ80s >= 1) { - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesSegment = ZetRun(nTaitoCyclesSegment); - nTaitoCyclesDone[nCurrentCPU] += nTaitoCyclesSegment; - if (TaitoNumMSM5205) MSM5205Update(); - ZetClose(); - } - - if (TaitoNumZ80s == 2) { - nCurrentCPU = 2; - ZetOpen(1); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesSegment = ZetRun(nTaitoCyclesSegment); - nTaitoCyclesDone[nCurrentCPU] += nTaitoCyclesSegment; - if (i == 9) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (TaitoNumZ80s >= 1) ZetOpen(0); - if (TaitoNumYM2151) BurnYM2151Render(pSoundBuf, nSegmentLength); - if (TaitoNumZ80s >= 1) ZetClose(); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - if (TaitoNumZ80s >= 1) ZetOpen(0); - if (TaitoNumYM2151) BurnYM2151Render(pSoundBuf, nSegmentLength); - if (TaitoNumZ80s >= 1) ZetClose(); - } - } - - if (pBurnSoundOut) { - if (TaitoNumZ80s >= 1) ZetOpen(0); - if (TaitoNumMSM5205) MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - if (TaitoNumMSM5205 >= 2) MSM5205Render(1, pBurnSoundOut, nBurnSoundLen); - if (TaitoNumZ80s >= 1) ZetClose(); - } - - if (pBurnDraw) TaitoDrawFunction(); - - return 0; -} - -static INT32 DariusFrame() -{ - INT32 nInterleave = MSM5205CalcInterleave(0, 8000000 / 2); - - if (TaitoReset) TaitoResetFunction(); - - TaitoMakeInputsFunction(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = nTaitoCyclesDone[2] = nTaitoCyclesDone[3] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 # 1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == nInterleave - 1) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run 68000 # 2 - if ((TaitoCpuACtrl & 0x01)) { - nCurrentCPU = 1; - SekOpen(1); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == nInterleave - 1) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - ZetOpen(0); - BurnTimerUpdate(i * (nTaitoCyclesTotal[2] / nInterleave)); - ZetClose(); - - nCurrentCPU = 3; - ZetOpen(1); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesSegment = ZetRun(nTaitoCyclesSegment); - nTaitoCyclesDone[nCurrentCPU] += nTaitoCyclesSegment; - MSM5205Update(); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[2]); - if (pBurnSoundOut) BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - ZetOpen(1); - ZetRun(nTaitoCyclesTotal[3] - nTaitoCyclesDone[3]); - if (pBurnSoundOut) MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - if (pBurnDraw) TaitoDrawFunction(); - - return 0; -} - -static INT32 JumpingFrame() -{ - INT32 nInterleave = 100; - - if (TaitoReset) TaitoResetFunction(); - - TaitoMakeInputsFunction(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 # 1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - ZetOpen(0); - BurnTimerUpdate(i * (nTaitoCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[1]); - if (pBurnSoundOut) BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - - if (pBurnDraw) TaitoDrawFunction(); - - return 0; -} - -static INT32 TopspeedFrame() -{ - INT32 nInterleave = 133; - if (TaitoNumMSM5205) nInterleave = MSM5205CalcInterleave(0, 4000000); - INT32 nSoundBufferPos = 0; - - if (TaitoReset) TaitoResetFunction(); - - TaitoMakeInputsFunction(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = nTaitoCyclesDone[2] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 # 1 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == (nInterleave - 1) && (GetCurrentFrame > 0)) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - if (i == (nInterleave - 3)) SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run 68000 # 2 - if (TaitoCpuACtrl & 0x01) { - nCurrentCPU = 1; - SekOpen(1); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == (nInterleave - 1) && (GetCurrentFrame > 0)) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - if (i == (nInterleave - 3)) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - // Run Z80 - if (TaitoNumZ80s >= 1) { - nCurrentCPU = 2; - ZetOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesSegment = ZetRun(nTaitoCyclesSegment); - nTaitoCyclesDone[nCurrentCPU] += nTaitoCyclesSegment; - - z80ctc_execute(4000000/16/60/nInterleave); - - if (TaitoNumMSM5205) MSM5205Update(); - ZetClose(); - } - - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (TaitoNumZ80s >= 1) ZetOpen(0); - if (TaitoNumYM2151) BurnYM2151Render(pSoundBuf, nSegmentLength); - if (TaitoNumZ80s >= 1) ZetClose(); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - if (TaitoNumZ80s >= 1) ZetOpen(0); - if (TaitoNumYM2151) BurnYM2151Render(pSoundBuf, nSegmentLength); - if (TaitoNumZ80s >= 1) ZetClose(); - } - } - - if (pBurnSoundOut) { - if (TaitoNumZ80s >= 1) ZetOpen(0); - if (TaitoNumMSM5205) MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); - if (TaitoNumMSM5205&2) MSM5205Render(1, pBurnSoundOut, nBurnSoundLen); - if (TaitoNumZ80s >= 1) ZetClose(); - } - - if (pBurnDraw) TaitoDrawFunction(); - - return 0; -} - -static INT32 TaitoMiscScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029683; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd-TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - TaitoICScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - if (TaitoNumYM2151) BurnYM2151Scan(nAction); - if (TaitoNumYM2203) BurnYM2203Scan(nAction, pnMin); - if (TaitoNumMSM5205) MSM5205Scan(nAction, pnMin); - - if (bUseGuns) BurnGunScan(); - if (bUseShifter) BurnShiftScan(nAction); - - SCAN_VAR(TaitoInput); - SCAN_VAR(TaitoAnalogPort0); - SCAN_VAR(TaitoAnalogPort1); - SCAN_VAR(TaitoZ80Bank); - SCAN_VAR(TaitoSoundLatch); - SCAN_VAR(RastanADPCMPos); - SCAN_VAR(RastanADPCMData); - SCAN_VAR(RastanADPCMInReset); - SCAN_VAR(OpwolfADPCM_B); - SCAN_VAR(OpwolfADPCM_C); - SCAN_VAR(OpwolfADPCMPos); - SCAN_VAR(OpwolfADPCMEnd);; - SCAN_VAR(OpwolfADPCMData); - SCAN_VAR(TopspeedADPCMPos); - SCAN_VAR(TopspeedADPCMData); - SCAN_VAR(TopspeedADPCMInReset); - SCAN_VAR(nTaitoCyclesDone); - SCAN_VAR(nTaitoCyclesSegment); - SCAN_VAR(DariusADPCMCommand); - SCAN_VAR(DariusNmiEnable); - SCAN_VAR(DariusCoinWord); - SCAN_VAR(PC090OJSpriteCtrl); // for jumping - z80ctc_scan(); - } - - if (nAction & ACB_WRITE && TaitoZ80Bank) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetClose(); - } - - return 0; -} - -struct BurnDriver BurnDrvDarius = { - "darius", NULL, NULL, NULL, "1986", - "Darius (World)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, DariusRomInfo, DariusRomName, NULL, NULL, DariusInputInfo, DariusDIPInfo, - DariusInit, TaitoMiscExit, DariusFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 864, 224, 12, 3 -}; - -struct BurnDriver BurnDrvDariusu = { - "dariusu", "darius", NULL, NULL, "1986", - "Darius (US)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, DariusuRomInfo, DariusuRomName, NULL, NULL, DariusInputInfo, DariusuDIPInfo, - DariusInit, TaitoMiscExit, DariusFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 864, 224, 12, 3 -}; - -struct BurnDriver BurnDrvDariusj = { - "dariusj", "darius", NULL, NULL, "1986", - "Darius (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, DariusjRomInfo, DariusjRomName, NULL, NULL, DariusInputInfo, DariusjDIPInfo, - DariusInit, TaitoMiscExit, DariusFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 864, 224, 12, 3 -}; - -struct BurnDriver BurnDrvDariuso = { - "dariuso", "darius", NULL, NULL, "1986", - "Darius (Japan old version)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, DariusoRomInfo, DariusoRomName, NULL, NULL, DariusInputInfo, DariusjDIPInfo, - DariusInit, TaitoMiscExit, DariusFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 864, 224, 12, 3 -}; - -struct BurnDriver BurnDrvDariuse = { - "dariuse", "darius", NULL, NULL, "1986", - "Darius (Extra) (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, DariuseRomInfo, DariuseRomName, NULL, NULL, DariusInputInfo, DariusuDIPInfo, - DariusInit, TaitoMiscExit, DariusFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 864, 224, 12, 3 -}; - -struct BurnDriver BurnDrvOpwolf = { - "opwolf", NULL, NULL, NULL, "1987", - "Operation Wolf (World, set 1)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OpwolfRomInfo, OpwolfRomName, NULL, NULL, OpwolfInputInfo, OpwolfDIPInfo, - OpwolfInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOpwolfa = { - "opwolfa", "opwolf", NULL, NULL, "1987", - "Operation Wolf (World, set 2)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OpwolfaRomInfo, OpwolfaRomName, NULL, NULL, OpwolfInputInfo, OpwolfDIPInfo, - OpwolfInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOpwolfj = { - "opwolfj", "opwolf", NULL, NULL, "1987", - "Operation Wolf (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OpwolfjRomInfo, OpwolfjRomName, NULL, NULL, OpwolfInputInfo, OpwolfDIPInfo, - OpwolfInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOpwolfjsc = { - "opwolfjsc", "opwolf", NULL, NULL, "1987", - "Operation Wolf (Japan, SC)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OpwolfjscRomInfo, OpwolfjscRomName, NULL, NULL, OpwolfInputInfo, OpwolfDIPInfo, - OpwolfInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOpwolfu = { - "opwolfu", "opwolf", NULL, NULL, "1987", - "Operation Wolf (US)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OpwolfuRomInfo, OpwolfuRomName, NULL, NULL, OpwolfInputInfo, OpwolfuDIPInfo, - OpwolfInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvOpwolfb = { - "opwolfb", "opwolf", NULL, NULL, "1987", - "Operation Bear\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, OpwolfbRomInfo, OpwolfbRomName, NULL, NULL, OpwolfInputInfo, OpwolfbDIPInfo, - OpwolfbInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRbisland = { - "rbisland", NULL, NULL, NULL, "1987", - "Rainbow Islands (new version)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RbislandRomInfo, RbislandRomName, NULL, NULL, RbislandInputInfo, RbislandDIPInfo, - RbislandInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRbislando = { - "rbislando", "rbisland", NULL, NULL, "1987", - "Rainbow Islands (old version)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RbislandoRomInfo, RbislandoRomName, NULL, NULL, RbislandInputInfo, RbislandDIPInfo, - RbislandInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRbislande = { - "rbislande", "rbisland", NULL, NULL, "1988", - "Rainbow Islands (Extra)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RbislandeRomInfo, RbislandeRomName, NULL, NULL, RbislandInputInfo, RbislandDIPInfo, - RbislandeInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJumping = { - "jumping", "rbisland", NULL, NULL, "1989", - "Jumping (set 1)\0", NULL, "bootleg", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, JumpingRomInfo, JumpingRomName, NULL, NULL, JumpingInputInfo, JumpingDIPInfo, - JumpingInit, TaitoMiscExit, JumpingFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJumpinga = { - "jumpinga", "rbisland", NULL, NULL, "1988", - "Jumping (set 2)\0", NULL, "bootleg (Seyutu)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, JumpingaRomInfo, JumpingaRomName, NULL, NULL, JumpingInputInfo, JumpingDIPInfo, - JumpingInit, TaitoMiscExit, JumpingFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvJumpingi = { - "jumpingi", "rbisland", NULL, NULL, "1988", - "Jumping (set 3, Imnoe PCB)\0", NULL, "bootleg (Seyutu)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, JumpingiRomInfo, JumpingiRomName, NULL, NULL, JumpingInputInfo, JumpingDIPInfo, - JumpingInit, TaitoMiscExit, JumpingFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvRastan = { - "rastan", NULL, NULL, NULL, "1987", - "Rastan (World Rev 1)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RastanRomInfo, RastanRomName, NULL, NULL, RastanInputInfo, RastanDIPInfo, - RastanInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRastana = { - "rastana", "rastan", NULL, NULL, "1987", - "Rastan (World)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RastanaRomInfo, RastanaRomName, NULL, NULL, RastanInputInfo, RastanDIPInfo, - RastanInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRastanb = { - "rastanb", "rastan", NULL, NULL, "1987", - "Rastan (World, Earlier code base)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RastanbRomInfo, RastanbRomName, NULL, NULL, RastanInputInfo, RastanDIPInfo, - RastanInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRastanu = { - "rastanu", "rastan", NULL, NULL, "1987", - "Rastan (US Rev 1)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RastanuRomInfo, RastanuRomName, NULL, NULL, RastanInputInfo, RastsagaDIPInfo, - RastanInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRastanua = { - "rastanua", "rastan", NULL, NULL, "1987", - "Rastan (US)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RastanuaRomInfo, RastanuaRomName, NULL, NULL, RastanInputInfo, RastsagaDIPInfo, - RastanInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRastanub = { - "rastanub", "rastan", NULL, NULL, "1987", - "Rastan (US, Earlier code base)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RastanubRomInfo, RastanubRomName, NULL, NULL, RastanInputInfo, RastsagaDIPInfo, - RastanInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRastsaga = { - "rastsaga", "rastan", NULL, NULL, "1987", - "Rastan Saga (Japan Rev 1)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RastsagaRomInfo, RastsagaRomName, NULL, NULL, RastanInputInfo, RastsagaDIPInfo, - RastanInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRastsagaa = { - "rastsagaa", "rastan", NULL, NULL, "1987", - "Rastan Saga (Japan Rev 1, Earlier code base)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RastsagaaRomInfo, RastsagaaRomName, NULL, NULL, RastanInputInfo, RastsagaDIPInfo, - RastanInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRastsagab = { - "rastsagab", "rastan", NULL, NULL, "1987", - "Rastan Saga (Japan, Earlier code base)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, RastsagabRomInfo, RastsagabRomName, NULL, NULL, RastanInputInfo, RastsagaDIPInfo, - RastanInit, TaitoMiscExit, TaitoMiscFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvTopspeed = { - "topspeed", NULL, NULL, NULL, "1987", - "Top Speed (World)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_MISC, GBF_RACING, 0, - NULL, TopspeedRomInfo, TopspeedRomName, NULL, NULL, TopspeedInputInfo, TopspeedDIPInfo, - TopspeedInit, TaitoMiscExit, TopspeedFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvTopspeedu = { - "topspeedu", "topspeed", NULL, NULL, "1987", - "Top Speed (US)\0", NULL, "Taito America Corporation (Romstar license)", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_RACING, 0, - NULL, TopspeeduRomInfo, TopspeeduRomName, NULL, NULL, TopspeedInputInfo, FullthrlDIPInfo, - TopspeedInit, TaitoMiscExit, TopspeedFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvFullthrl = { - "fullthrl", "topspeed", NULL, NULL, "1987", - "Full Throttle (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_MISC, GBF_RACING, 0, - NULL, FullthrlRomInfo, FullthrlRomName, NULL, NULL, TopspeedInputInfo, FullthrlDIPInfo, - TopspeedInit, TaitoMiscExit, TopspeedFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvVolfied = { - "volfied", NULL, NULL, NULL, "1989", - "Volfied (World, revision 1)\0", NULL, "Taito Corporation Japan", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, VolfiedRomInfo, VolfiedRomName, NULL, NULL, VolfiedInputInfo, VolfiedDIPInfo, - VolfiedInit, TaitoMiscExit, JumpingFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvVolfiedj = { - "volfiedj", "volfied", NULL, NULL, "1989", - "Volfied (Japan, revision 1)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, VolfiedjRomInfo, VolfiedjRomName, NULL, NULL, VolfiedInputInfo, VolfiedjDIPInfo, - VolfiedInit, TaitoMiscExit, JumpingFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvVolfiedjo = { - "volfiedjo", "volfied", NULL, NULL, "1989", - "Volfied (Japan)\0", NULL, "Taito Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, VolfiedjoRomInfo, VolfiedjoRomName, NULL, NULL, VolfiedInputInfo, VolfiedjDIPInfo, - VolfiedInit, TaitoMiscExit, JumpingFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvVolfiedu = { - "volfiedu", "volfied", NULL, NULL, "1989", - "Volfied (US, revision 1)\0", NULL, "Taito America Corporation", "Taito Misc", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_PUZZLE, 0, - NULL, VolfieduRomInfo, VolfieduRomName, NULL, NULL, VolfiedInputInfo, VolfieduDIPInfo, - VolfiedInit, TaitoMiscExit, JumpingFrame, NULL, TaitoMiscScan, - NULL, 0x2000, 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/taito/d_taitox.cpp b/jan/src/burn/drv/taito/d_taitox.cpp deleted file mode 100644 index 9a6955597..000000000 --- a/jan/src/burn/drv/taito/d_taitox.cpp +++ /dev/null @@ -1,1735 +0,0 @@ -// Based on MAME drivers by Howie Cohen, Yochizo - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "taito.h" -#include "taito_ic.h" -#include "burn_ym2151.h" -#include "burn_ym2610.h" - -static struct BurnInputInfo SupermanInputList[]= -{ - {"P1 Coin" , BIT_DIGITAL, TaitoInputPort2 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL, TaitoInputPort0 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL, TaitoInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL, TaitoInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL, TaitoInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL, TaitoInputPort0 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL, TaitoInputPort0 + 4, "p1 fire 1" }, - {"P1 Button 2" , BIT_DIGITAL, TaitoInputPort0 + 5, "p1 fire 2" }, - - {"P2 Coin" , BIT_DIGITAL, TaitoInputPort2 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL, TaitoInputPort1 + 7, "p2 start" }, - {"P2 Up" , BIT_DIGITAL, TaitoInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL, TaitoInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL, TaitoInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL, TaitoInputPort1 + 3, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL, TaitoInputPort1 + 4, "p2 fire 1" }, - {"P2 Button 2" , BIT_DIGITAL, TaitoInputPort1 + 5, "p2 fire 2" }, - - {"Reset" , BIT_DIGITAL, &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL, TaitoInputPort2 + 2, "service" }, - {"Tilt" , BIT_DIGITAL, TaitoInputPort2 + 3, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Superman) - -static struct BurnInputInfo TwinhawkInputList[]= -{ - {"P1 Coin" , BIT_DIGITAL, TaitoInputPort2 + 0, "p1 coin" }, - {"P1 Start" , BIT_DIGITAL, TaitoInputPort0 + 7, "p1 start" }, - {"P1 Up" , BIT_DIGITAL, TaitoInputPort0 + 0, "p1 up" }, - {"P1 Down" , BIT_DIGITAL, TaitoInputPort0 + 1, "p1 down" }, - {"P1 Left" , BIT_DIGITAL, TaitoInputPort0 + 2, "p1 left" }, - {"P1 Right" , BIT_DIGITAL, TaitoInputPort0 + 3, "p1 right" }, - {"P1 Button 1" , BIT_DIGITAL, TaitoInputPort0 + 4, "p1 fire 1" }, - {"P1 Button 2" , BIT_DIGITAL, TaitoInputPort0 + 5, "p1 fire 2" }, - {"P1 Button 3" , BIT_DIGITAL, TaitoInputPort0 + 6, "p1 fire 3" }, - - {"P2 Coin" , BIT_DIGITAL, TaitoInputPort2 + 1, "p2 coin" }, - {"P2 Start" , BIT_DIGITAL, TaitoInputPort1 + 7, "p2 start" }, - {"P2 Up" , BIT_DIGITAL, TaitoInputPort1 + 0, "p2 up" }, - {"P2 Down" , BIT_DIGITAL, TaitoInputPort1 + 1, "p2 down" }, - {"P2 Left" , BIT_DIGITAL, TaitoInputPort1 + 2, "p2 left" }, - {"P2 Right" , BIT_DIGITAL, TaitoInputPort1 + 3, "p2 right" }, - {"P2 Button 1" , BIT_DIGITAL, TaitoInputPort1 + 4, "p2 fire 1" }, - {"P2 Button 2" , BIT_DIGITAL, TaitoInputPort1 + 5, "p2 fire 2" }, - {"P2 Button 3" , BIT_DIGITAL, TaitoInputPort1 + 6, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL, &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL, TaitoInputPort2 + 2, "service" }, - {"Tilt" , BIT_DIGITAL, TaitoInputPort2 + 3, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH, TaitoDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH, TaitoDip + 1 , "dip" }, -}; - -STDINPUTINFO(Twinhawk) - -static void TaitoXMakeInputs() -{ - TaitoInput[0] = TaitoInput[1] = TaitoInput[2] = 0xff; - - for (INT32 i = 0; i < 8; i++) { - TaitoInput[0] -= (TaitoInputPort0[i] & 1) << i; - TaitoInput[1] -= (TaitoInputPort1[i] & 1) << i; - TaitoInput[2] -= (TaitoInputPort2[i] & 1) << i; - - } -} - -static struct BurnDIPInfo BallbrosDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xdf, NULL }, - {0x16, 0xff, 0xff, 0x86, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x03, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0x0c, 0x04, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Medium" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x16, 0x01, 0x02, 0x02, "Off" }, - {0x16, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x04, 0x00, "Off" }, - {0x16, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x16, 0x01, 0x20, 0x00, "English" }, - {0x16, 0x01, 0x20, 0x20, "Japanese" }, - - {0 , 0xfe, 0 , 2 , "Colour Change" }, - {0x16, 0x01, 0x40, 0x00, "Less" }, - {0x16, 0x01, 0x40, 0x40, "More" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Ballbros) - -static struct BurnDIPInfo GigandesDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xdf, NULL }, - {0x16, 0xff, 0xff, 0x98, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x03, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0x0c, 0x04, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Medium" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Debug Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x16, 0x01, 0x02, 0x00, "Off" }, - {0x16, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x18, 0x18, "3" }, - {0x16, 0x01, 0x18, 0x10, "4" }, - {0x16, 0x01, 0x18, 0x08, "5" }, - {0x16, 0x01, 0x18, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Controls" }, - {0x16, 0x01, 0x20, 0x20, "Single" }, - {0x16, 0x01, 0x20, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x16, 0x01, 0x40, 0x00, "English" }, - {0x16, 0x01, 0x40, 0x40, "Japanese" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Gigandes) - -static struct BurnDIPInfo KyustrkrDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xdf, NULL }, - {0x16, 0xff, 0xff, 0x80, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x03, 0x01, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x03, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x03, 0x02, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0x0c, 0x04, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x0c, 0x08, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x15, 0x01, 0x60, 0x60, "Easy" }, - {0x15, 0x01, 0x60, 0x40, "Medium" }, - {0x15, 0x01, 0x60, 0x20, "Hard" }, - {0x15, 0x01, 0x60, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Debug Mode" }, - {0x15, 0x01, 0x80, 0x80, "Off" }, - {0x15, 0x01, 0x80, 0x00, "On" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x16, 0x01, 0x01, 0x01, "Off" }, - {0x16, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x16, 0x01, 0x02, 0x00, "Off" }, - {0x16, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x04, 0x04, "Off" }, - {0x16, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x18, 0x18, "3" }, - {0x16, 0x01, 0x18, 0x10, "4" }, - {0x16, 0x01, 0x18, 0x08, "5" }, - {0x16, 0x01, 0x18, 0x00, "6" }, - - {0 , 0xfe, 0 , 2 , "Controls" }, - {0x16, 0x01, 0x20, 0x20, "Single" }, - {0x16, 0x01, 0x20, 0x00, "Dual" }, - - {0 , 0xfe, 0 , 2 , "Language" }, - {0x16, 0x01, 0x40, 0x00, "English" }, - {0x16, 0x01, 0x40, 0x40, "Japanese" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Kyustrkr) - -static struct BurnDIPInfo SupermanDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - {0x14, 0x01, 0x30, 0x00, "5" }, -}; - -STDDIPINFO(Superman) - -static struct BurnDIPInfo SupermanuDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x13, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x13, 0x01, 0xc0, 0x00, "3 Coins 2 Credit" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 3 Credit" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "Same as Start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - {0x14, 0x01, 0x30, 0x00, "5" }, -}; - -STDDIPINFO(Supermanu) - -static struct BurnDIPInfo SupermanjDIPList[]= -{ - // Default Values - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x13, 0x01, 0x02, 0x02, "Off" }, - {0x13, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x13, 0x01, 0x04, 0x04, "Off" }, - {0x13, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x00, "Off" }, - {0x13, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x13, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x13, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x13, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x14, 0x01, 0x03, 0x02, "Easy" }, - {0x14, 0x01, 0x03, 0x03, "Medium" }, - {0x14, 0x01, 0x03, 0x01, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x30, "3" }, - {0x14, 0x01, 0x30, 0x10, "4" }, - {0x14, 0x01, 0x30, 0x00, "5" }, -}; - -STDDIPINFO(Supermanj) - - -static struct BurnDIPInfo TwinhawkDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x0c, "50k and every 150k" }, - {0x16, 0x01, 0x0c, 0x08, "70k and every 200k" }, - {0x16, 0x01, 0x0c, 0x04, "50k only" }, - {0x16, 0x01, 0x0c, 0x00, "100k only" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x00, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Twinhawk) - -static struct BurnDIPInfo TwinhawkuDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xff, NULL }, - {0x16, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "4 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0x40, "3 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0x80, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x0c, "50k and every 150k" }, - {0x16, 0x01, 0x0c, 0x08, "70k and every 200k" }, - {0x16, 0x01, 0x0c, 0x04, "50k only" }, - {0x16, 0x01, 0x0c, 0x00, "100k only" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x00, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Twinhawku) - -static struct BurnDIPInfo DaisenpuDIPList[]= -{ - // Default Values - {0x15, 0xff, 0xff, 0xfe, NULL }, - {0x16, 0xff, 0xff, 0x7f, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x15, 0x01, 0x01, 0x00, "Upright" }, - {0x15, 0x01, 0x01, 0x01, "Cocktail" }, - - {0 , 0xfe, 0 , 2 , "Flip Screen" }, - {0x15, 0x01, 0x02, 0x02, "Off" }, - {0x15, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x00, "Off" }, - {0x15, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x15, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x15, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x15, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x15, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x16, 0x01, 0x03, 0x02, "Easy" }, - {0x16, 0x01, 0x03, 0x03, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x08, "50k and every 150k" }, - {0x16, 0x01, 0x0c, 0x0c, "70k and every 200k" }, - {0x16, 0x01, 0x0c, 0x04, "100k only" }, - {0x16, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x16, 0x01, 0x30, 0x00, "2" }, - {0x16, 0x01, 0x30, 0x30, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x16, 0x01, 0x80, 0x80, "Off" }, - {0x16, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Daisenpu) - -static struct BurnRomInfo BallbrosRomDesc[] = { - { "10a", 0x20000, 0x4af0e858, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "5a", 0x20000, 0x0b983a69, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "8d", 0x10000, 0xd1c515af, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "3", 0x20000, 0xec3e0537, BRF_GRA | TAITO_SPRITESA }, - { "2", 0x20000, 0xbb441717, BRF_GRA | TAITO_SPRITESA }, - { "1", 0x20000, 0x8196d624, BRF_GRA | TAITO_SPRITESA }, - { "0", 0x20000, 0x1cc584e5, BRF_GRA | TAITO_SPRITESA }, - - { "east-11", 0x80000, 0x92111f96, BRF_SND | TAITO_YM2610A }, - { "east-10", 0x80000, 0xca0ac419, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Ballbros) -STD_ROM_FN(Ballbros) - -static struct BurnRomInfo GigandesRomDesc[] = { - { "east_1.10a", 0x20000, 0xae74e4e5, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "east_3.5a", 0x20000, 0x8bcf2116, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "east_2.8a", 0x20000, 0xdd94b4d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "east_4.3a", 0x20000, 0xa647310a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "east_5.17d", 0x10000, 0xb24ab5f4, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "east_8.3f", 0x80000, 0x75eece28, BRF_GRA | TAITO_SPRITESA }, - { "east_7.3h", 0x80000, 0xb179a76a, BRF_GRA | TAITO_SPRITESA }, - { "east_9.3j", 0x80000, 0x5c5e6898, BRF_GRA | TAITO_SPRITESA }, - { "east_6.3k", 0x80000, 0x52db30e9, BRF_GRA | TAITO_SPRITESA }, - - { "east-11.16f", 0x80000, 0x92111f96, BRF_SND | TAITO_YM2610A }, - { "east-10.16e", 0x80000, 0xca0ac419, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Gigandes) -STD_ROM_FN(Gigandes) - -static struct BurnRomInfo GigandesaRomDesc[] = { - { "east-1.10a", 0x20000, 0x290c50e0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "east-3.5a", 0x20000, 0x9cef82af, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "east_2.8a", 0x20000, 0xdd94b4d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "east_4.3a", 0x20000, 0xa647310a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "east_5.17d", 0x10000, 0xb24ab5f4, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "east_8.3f", 0x80000, 0x75eece28, BRF_GRA | TAITO_SPRITESA }, - { "east_7.3h", 0x80000, 0xb179a76a, BRF_GRA | TAITO_SPRITESA }, - { "east_9.3j", 0x80000, 0x5c5e6898, BRF_GRA | TAITO_SPRITESA }, - { "east_6.3k", 0x80000, 0x52db30e9, BRF_GRA | TAITO_SPRITESA }, - - { "east-11.16f", 0x80000, 0x92111f96, BRF_SND | TAITO_YM2610A }, - { "east-10.16e", 0x80000, 0xca0ac419, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Gigandesa) -STD_ROM_FN(Gigandesa) - -static struct BurnRomInfo KyustrkrRomDesc[] = { - { "pe.9a", 0x20000, 0x082b5f96, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "po.4a", 0x20000, 0x0100361e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "ic.18d", 0x10000, 0x92cfb788, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "m-8-3.u3", 0x20000, 0x1c4084e6, BRF_GRA | TAITO_SPRITESA }, - { "m-8-2.u4", 0x20000, 0xada21c4d, BRF_GRA | TAITO_SPRITESA }, - { "m-8-1.u5", 0x20000, 0x9d95aad6, BRF_GRA | TAITO_SPRITESA }, - { "m-8-0.u6", 0x20000, 0x0dfb6ed3, BRF_GRA | TAITO_SPRITESA }, - - { "m-8-5.u2", 0x20000, 0xd9d90e0a, BRF_SND | TAITO_YM2610A }, - { "m-8-4.u1", 0x20000, 0xd3f6047a, BRF_SND | TAITO_YM2610B }, -}; - -STD_ROM_PICK(Kyustrkr) -STD_ROM_FN(Kyustrkr) - -static struct BurnRomInfo SupermanRomDesc[] = { - { "b61_09.a10", 0x20000, 0x640f1d58, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b61_07.a5", 0x20000, 0xfddb9953, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b61_08.a8", 0x20000, 0x79fc028e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b61_13.a3", 0x20000, 0x9f446a44, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b61_10.d18", 0x10000, 0x6efe79e8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b61-14.f1", 0x80000, 0x89368c3e, BRF_GRA | TAITO_SPRITESA }, - { "b61-15.h1", 0x80000, 0x910cc4f9, BRF_GRA | TAITO_SPRITESA }, - { "b61-16.j1", 0x80000, 0x3622ed2f, BRF_GRA | TAITO_SPRITESA }, - { "b61-17.k1", 0x80000, 0xc34f27e0, BRF_GRA | TAITO_SPRITESA }, - - { "b61-01.e18", 0x80000, 0x3cf99786, BRF_SND | TAITO_YM2610B }, - - { "b61_11.m11", 0x10000, 0x00000000, BRF_ESS | BRF_PRG | BRF_NODUMP }, -}; - -STD_ROM_PICK(Superman) -STD_ROM_FN(Superman) - -static struct BurnRomInfo SupermanuRomDesc[] = { - { "b61_09.a10", 0x20000, 0x640f1d58, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b61_07.a5", 0x20000, 0xfddb9953, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b61_08.a8", 0x20000, 0x79fc028e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b61_12.a3", 0x20000, 0x064d3bfe, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b61_10.d18", 0x10000, 0x6efe79e8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b61-14.f1", 0x80000, 0x89368c3e, BRF_GRA | TAITO_SPRITESA }, - { "b61-15.h1", 0x80000, 0x910cc4f9, BRF_GRA | TAITO_SPRITESA }, - { "b61-16.j1", 0x80000, 0x3622ed2f, BRF_GRA | TAITO_SPRITESA }, - { "b61-17.k1", 0x80000, 0xc34f27e0, BRF_GRA | TAITO_SPRITESA }, - - { "b61-01.e18", 0x80000, 0x3cf99786, BRF_SND | TAITO_YM2610B }, - - { "b61_11.m11", 0x10000, 0x00000000, BRF_ESS | BRF_PRG | BRF_NODUMP }, -}; - -STD_ROM_PICK(Supermanu) -STD_ROM_FN(Supermanu) - -static struct BurnRomInfo SupermanjRomDesc[] = { - { "b61_09.a10", 0x20000, 0x640f1d58, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b61_07.a5", 0x20000, 0xfddb9953, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b61_08.a8", 0x20000, 0x79fc028e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b61_06.a3", 0x20000, 0x714a0b68, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b61_10.d18", 0x10000, 0x6efe79e8, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b61-14.f1", 0x80000, 0x89368c3e, BRF_GRA | TAITO_SPRITESA }, - { "b61-15.h1", 0x80000, 0x910cc4f9, BRF_GRA | TAITO_SPRITESA }, - { "b61-16.j1", 0x80000, 0x3622ed2f, BRF_GRA | TAITO_SPRITESA }, - { "b61-17.k1", 0x80000, 0xc34f27e0, BRF_GRA | TAITO_SPRITESA }, - - { "b61-01.e18", 0x80000, 0x3cf99786, BRF_SND | TAITO_YM2610B }, - - { "b61_11.m11", 0x10000, 0x00000000, BRF_ESS | BRF_PRG | BRF_NODUMP }, -}; - -STD_ROM_PICK(Supermanj) -STD_ROM_FN(Supermanj) - -static struct BurnRomInfo TwinhawkRomDesc[] = { - { "b87-11.u7", 0x20000, 0xfc84a399, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b87-10.u5", 0x20000, 0x17181706, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b87-07.13e", 0x08000, 0xe2e0efa0, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b87-02.3h", 0x80000, 0x89ad43a0, BRF_GRA | TAITO_SPRITESA }, - { "b87-01.3f", 0x80000, 0x81e82ae1, BRF_GRA | TAITO_SPRITESA }, - { "b87-04.3k", 0x80000, 0x958434b6, BRF_GRA | TAITO_SPRITESA }, - { "b87-03.3j", 0x80000, 0xce155ae0, BRF_GRA | TAITO_SPRITESA }, - -}; - -STD_ROM_PICK(Twinhawk) -STD_ROM_FN(Twinhawk) - -static struct BurnRomInfo TwinhawkuRomDesc[] = { - { "b87-09.u7", 0x20000, 0x7e6267c7, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b87-08.u5", 0x20000, 0x31d9916f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b87-07.13e", 0x08000, 0xe2e0efa0, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b87-02.3h", 0x80000, 0x89ad43a0, BRF_GRA | TAITO_SPRITESA }, - { "b87-01.3f", 0x80000, 0x81e82ae1, BRF_GRA | TAITO_SPRITESA }, - { "b87-04.3k", 0x80000, 0x958434b6, BRF_GRA | TAITO_SPRITESA }, - { "b87-03.3j", 0x80000, 0xce155ae0, BRF_GRA | TAITO_SPRITESA }, - -}; - -STD_ROM_PICK(Twinhawku) -STD_ROM_FN(Twinhawku) - -static struct BurnRomInfo DaisenpuRomDesc[] = { - { "b87-06.u7", 0x20000, 0xcf236100, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b87-05.u5", 0x20000, 0x7f15edc7, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b87-07.13e", 0x08000, 0xe2e0efa0, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b87-02.3h", 0x80000, 0x89ad43a0, BRF_GRA | TAITO_SPRITESA }, - { "b87-01.3f", 0x80000, 0x81e82ae1, BRF_GRA | TAITO_SPRITESA }, - { "b87-04.3k", 0x80000, 0x958434b6, BRF_GRA | TAITO_SPRITESA }, - { "b87-03.3j", 0x80000, 0xce155ae0, BRF_GRA | TAITO_SPRITESA }, - -}; - -STD_ROM_PICK(Daisenpu) -STD_ROM_FN(Daisenpu) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - TaitoYM2610BRom = Next; Next += TaitoYM2610BRomSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x004000; - TaitoZ80Ram1 = Next; Next += 0x002000; - TaitoPaletteRam = Next; Next += 0x001000; - TaitoSpriteRam = Next; Next += 0x000800; - TaitoSpriteRam2 = Next; Next += 0x004000; - - TaitoRamEnd = Next; - - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - TaitoPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32); - - TaitoMemEnd = Next; - - return 0; -} - -UINT8 __fastcall TaitoX68KReadByte(UINT32 a) -{ - if (TaitoIC_SupermanCChipInUse) { - if (a >= 0x900000 && a <= 0x9007ff) { - return SupermanCChipRamRead((a - 0x900000) >> 1, TaitoInput[0], TaitoInput[1], TaitoInput[2]); - } - } - - switch (a) { - case 0x500001: { - return TaitoDip[0] & 0x0f; - } - - case 0x500003: { - return (TaitoDip[0] & 0xf0) >> 4; - } - - case 0x500005: { - return TaitoDip[1] & 0x0f; - } - - case 0x500007: { - return (TaitoDip[1] & 0xf0) >> 4; - } - - case 0x800003: { - return TC0140SYTCommRead(); - } - - case 0x900001: { - return TaitoInput[0]; - } - - case 0x900003: { - return TaitoInput[1]; - } - - case 0x900005: { - return TaitoInput[2]; - } - - case 0x900803: { - if (TaitoIC_SupermanCChipInUse) return SupermanCChipCtrlRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall TaitoX68KWriteByte(UINT32 a, UINT8 d) -{ - if (TaitoIC_SupermanCChipInUse) { - if (a >= 0x900000 && a <= 0x9007ff) { - SupermanCChipRamWrite((a - 0x900000) >> 1, d); - return; - } - } - - switch (a) { - case 0x300000: - case 0x300001: { - //??? - return; - } - - case 0x400000: - case 0x400001: { - //nop - return; - } - - case 0x600000: - case 0x600001: { - //nop - return; - } - - case 0x700000: - case 0x700001: { - //nop - return; - } - - case 0x800001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x800003: { - TC0140SYTCommWrite(d); - return; - } - - case 0x900009: { - // coin write - return; - } - - case 0x900803: { - if (TaitoIC_SupermanCChipInUse) { - SupermanCChipCtrlWrite(); - return; - } - } - - case 0x900c01: { - if (TaitoIC_SupermanCChipInUse) { - SupermanCChipBankWrite(d); - return; - } - } - - case 0xc00000: - case 0xc00001: { - //??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall TaitoX68KReadWord(UINT32 a) -{ - switch (a) { - case 0x500000: { - return TaitoDip[0] & 0x0f; - } - - case 0x500002: { - return (TaitoDip[0] & 0xf0) >> 4; - } - - case 0x500004: { - return TaitoDip[1] & 0x0f; - } - - case 0x500006: { - return (TaitoDip[1] & 0xf0) >> 4; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -UINT8 __fastcall TaitoXZ80Read(UINT16 a) -{ - switch (a) { - case 0xe000: { - return BurnYM2610Read(0); - } - - case 0xe001: { - return BurnYM2610Read(1); - } - - case 0xe002: { - return BurnYM2610Read(2); - } - - case 0xe201: { - return TC0140SYTSlaveCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall TaitoXZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - BurnYM2610Write(0, d); - return; - } - - case 0xe001: { - BurnYM2610Write(1, d); - return; - } - - case 0xe002: { - BurnYM2610Write(2, d); - return; - } - - case 0xe003: { - BurnYM2610Write(3, d); - return; - } - - case 0xe200: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xe201: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xe400: - case 0xe401: - case 0xe402: - case 0xe403: { - //nop - return; - } - - case 0xe600: { - //??? - return; - } - - case 0xee00: { - //nop - return; - } - - case 0xf000: { - //nop - return; - } - - case 0xf200: { - TaitoZ80Bank = (d - 1) & 3; - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -UINT8 __fastcall TwinhawkZ80Read(UINT16 a) -{ - switch (a) { - case 0xe001: { - return BurnYM2151ReadStatus(); - } - - case 0xe201: { - return TC0140SYTSlaveCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall TwinhawkZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - BurnYM2151SelectRegister(d); - return; - } - - case 0xe001: { - BurnYM2151WriteRegister(d); - return; - } - - case 0xe200: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xe201: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xf200: { - TaitoZ80Bank = (d - 1) & 3; - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static void TaitoXFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 TaitoXSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 4000000; -} - -static double TaitoXGetTime() -{ - return (double)ZetTotalCycles() / 4000000; -} - -static void TaitoXYM2151IRQHandler(INT32 Irq) -{ - if (Irq) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 SpritePlaneOffsets[4] = { 0x800008, 0x800000, 8, 0 }; -static INT32 SpriteXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; -static INT32 SpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 256, 272, 288, 304, 320, 336, 352, 368 }; -static INT32 BallbrosPlaneOffsets[4] = { 0x300000, 0x200000, 0x100000, 0 }; -static INT32 BallbrosXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71 }; -static INT32 BallbrosYOffsets[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 128, 136, 144, 152, 160, 168, 176, 184 }; - -static INT32 TaitoXInit(INT32 nSoundType) -{ - INT32 nLen; - - TaitoNum68Ks = 1; - TaitoNumZ80s = 1; - if (nSoundType == 1) { - TaitoNumYM2151 = 1; - } else { - TaitoNumYM2610 = 1; - } - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - if (TaitoLoadRoms(1)) return 1; - - TC0140SYTInit(0); - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, Taito68KRom1Size - 1, MAP_ROM); - SekMapMemory(TaitoPaletteRam , 0xb00000, 0xb00fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0xd00000, 0xd007ff, MAP_RAM); - SekMapMemory(TaitoSpriteRam2 , 0xe00000, 0xe03fff, MAP_RAM); - SekMapMemory(Taito68KRam1 , 0xf00000, 0xf03fff, MAP_RAM); - SekSetReadByteHandler(0, TaitoX68KReadByte); - SekSetWriteByteHandler(0, TaitoX68KWriteByte); - SekSetReadWordHandler(0, TaitoX68KReadWord); - SekClose(); - - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - if (nSoundType == 1) { - ZetSetReadHandler(TwinhawkZ80Read); - ZetSetWriteHandler(TwinhawkZ80Write); - } else { - ZetSetReadHandler(TaitoXZ80Read); - ZetSetWriteHandler(TaitoXZ80Write); - } - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1 ); - ZetClose(); - - if (nSoundType == 1) { - BurnYM2151Init(4000000); - BurnYM2151SetIrqHandler(&TaitoXYM2151IRQHandler); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT); - } else { - if (nSoundType == 2) { - BurnYM2610Init(8000000, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, NULL, TaitoXSynchroniseStream, TaitoXGetTime, 0); - } else { - BurnYM2610Init(8000000, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, &TaitoXFMIRQHandler, TaitoXSynchroniseStream, TaitoXGetTime, 0); - } - BurnTimerAttachZet(4000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - } - - GenericTilesInit(); - - nTaitoCyclesTotal[0] = (8000000) / 60; - nTaitoCyclesTotal[1] = (4000000) / 60; - - if (nScreenHeight == 224) TaitoYOffset = 16; - if (nScreenHeight == 240) TaitoYOffset = 8; - TaitoIrqLine = 2; - - TaitoDoReset(); - - return 0; -} - -static INT32 BallbrosInit() -{ - TaitoSpriteAModulo = 0x100; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = BallbrosPlaneOffsets; - TaitoSpriteAXOffsets = BallbrosXOffsets; - TaitoSpriteAYOffsets = BallbrosYOffsets; - TaitoNumSpriteA = 0x1000; - - return TaitoXInit(2); -} - -static INT32 GigandesInit() -{ - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x4000; - - return TaitoXInit(2); -} - -static INT32 SupermanInit() -{ - INT32 nRet; - - SupermanCChipInit(); - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x4000; - - nRet = TaitoXInit(0); - - TaitoIrqLine = 6; - - return nRet; -} - -static INT32 TwinhawkInit() -{ - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x4000; - - return TaitoXInit(1); -} - -static INT32 TaitoXExit() -{ - return TaitoExit(); -} - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 10); - g = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 5); - b = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 0); - - return BurnHighCol(r, g, b, 0); -} - -static void TaitoXCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)TaitoPaletteRam, pd = TaitoPalette; i < 0x0800; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void TaitoXDrawBgSprites() -{ - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - UINT16 *SpriteRam2 = (UINT16*)TaitoSpriteRam2; - - INT32 Offs, Col, x, y, Code, Colour, xFlip, yFlip, sx, sy, yOffs; - - INT32 Ctrl = BURN_ENDIAN_SWAP_INT16(SpriteRam[0x300]); - INT32 Ctrl2 = BURN_ENDIAN_SWAP_INT16(SpriteRam[0x301]); - - INT32 Flip = Ctrl & 0x40; - INT32 NumCol = Ctrl2 & 0x000f; - - UINT16 *src = SpriteRam2 + (((Ctrl2 ^ (~Ctrl2 << 1)) & 0x40) ? 0x1000 : 0 ); - - INT32 Upper = (BURN_ENDIAN_SWAP_INT16(SpriteRam[0x302]) & 0xff) + (BURN_ENDIAN_SWAP_INT16(SpriteRam[0x303]) & 0xff) * 256; - INT32 Col0; - switch (Ctrl & 0x0f) { - case 0x01: Col0 = 0x4; break; - case 0x06: Col0 = 0x8; break; - - default: Col0 = 0x0; - } - - yOffs = Flip ? 1 : -1; - - if (NumCol == 1) NumCol = 16; - - for (Col = 0; Col < NumCol; Col++) { - x = BURN_ENDIAN_SWAP_INT16(SpriteRam[(Col * 0x20 + 0x08 + 0x400) / 2]) & 0xff; - y = BURN_ENDIAN_SWAP_INT16(SpriteRam[(Col * 0x20 + 0x00 + 0x400) / 2]) & 0xff; - - for (Offs = 0; Offs < 0x20; Offs++) { - Code = BURN_ENDIAN_SWAP_INT16(src[((Col + Col0) & 0x0f) * 0x20 + Offs + 0x400]); - Colour = BURN_ENDIAN_SWAP_INT16(src[((Col + Col0) & 0x0f) * 0x20 + Offs + 0x600]); - - xFlip = Code & 0x8000; - yFlip = Code & 0x4000; - - sx = x + (Offs & 1) * 16; - sy = -(y + yOffs) + (Offs / 2) * 16; - - if (Upper & (1 << Col)) sx += 256; - - if (Flip) { - sy = 0xf0 - sy; - xFlip = !xFlip; - yFlip = !yFlip; - } - - Colour = (Colour >> (16 - 5)) % 0x100; - Code &= (TaitoNumSpriteA - 1); - - sx = ((sx + 16) & 0x1ff) - 16; - sy = ((sy + 8) & 0xff) - 8; - - sy -= TaitoYOffset; - - if (sx > 16 && sx < (nScreenWidth - 16) && sy > 16 && sy < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, sx, sy, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } - } - } -} - -static void TaitoXDrawSprites() -{ - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - UINT16 *SpriteRam2 = (UINT16*)TaitoSpriteRam2; - - INT32 Offset, Code, x, y, xFlip, yFlip, Colour; - INT32 Ctrl = BURN_ENDIAN_SWAP_INT16(SpriteRam[0x300]); - INT32 Ctrl2 = BURN_ENDIAN_SWAP_INT16(SpriteRam[0x301]); - INT32 Flip = Ctrl & 0x40; - UINT16 *src = SpriteRam2 + (((Ctrl2 ^ (~Ctrl2 << 1)) & 0x40) ? 0x1000 : 0); - - for (Offset = (0x400 - 2) / 2; Offset >= 0; Offset-- ) { - Code = BURN_ENDIAN_SWAP_INT16(src[Offset]); - x = BURN_ENDIAN_SWAP_INT16(src[Offset + 0x200]); - y = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset]) & 0xff; - xFlip = Code & 0x8000; - yFlip = Code & 0x4000; - - Colour = (x >> (16 - 5) ) % 0x100; - - Code &= (TaitoNumSpriteA - 1); - - if (Flip) { - y = 0xf0 - y; - xFlip = !xFlip; - yFlip = !yFlip; - } - - y = 0xf0 - y; - x = ((x + 16) & 0x1ff) - 16; - y = ((y + 8) & 0xff) - 8; - - y -= TaitoYOffset - 2; - - if (x > 16 && x < (nScreenWidth - 16) && y > 16 && y < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TaitoSpritesA); - } - } - } - } - -} - -static void TaitoXDraw() -{ - TaitoXCalcPalette(); - - for (INT32 i = 0; i < nScreenHeight * nScreenWidth; i++) { - pTransDraw[i] = 0x1f0; - } - - TaitoXDrawBgSprites(); - TaitoXDrawSprites(); - BurnTransferCopy(TaitoPalette); -} - -static INT32 TaitoXFrame() -{ - INT32 nInterleave = 10; - - if (TaitoReset) TaitoDoReset(); - - TaitoXMakeInputs(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - nCurrentCPU = 0; - SekOpen(nCurrentCPU); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == (nInterleave - 1)) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - - nCurrentCPU = 1; - ZetOpen(0); - BurnTimerUpdate(i * (nTaitoCyclesTotal[1] / nInterleave)); - ZetClose(); - } - - ZetOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - } - ZetClose(); - - if (pBurnDraw) TaitoXDraw(); - - return 0; -} - -static INT32 TwinhawkFrame() -{ - INT32 nInterleave = 10; - INT32 nSoundBufferPos = 0; - - if (TaitoReset) TaitoDoReset(); - - TaitoXMakeInputs(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = 0; - - SekNewFrame(); - ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 - nCurrentCPU = 0; - SekOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == 9) SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run Z80 - nCurrentCPU = 1; - ZetOpen(0); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesSegment = ZetRun(nTaitoCyclesSegment); - nTaitoCyclesDone[nCurrentCPU] += nTaitoCyclesSegment; - ZetClose(); - - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - nSoundBufferPos += nSegmentLength; - } - } - - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - ZetOpen(0); - BurnYM2151Render(pSoundBuf, nSegmentLength); - ZetClose(); - } - } - - if (pBurnDraw) TaitoXDraw(); - - return 0; -} - -static INT32 TaitoXScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029683; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd-TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - TaitoICScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - ZetScan(nAction); - - if (TaitoNumYM2610) BurnYM2610Scan(nAction, pnMin); - if (TaitoNumYM2151) BurnYM2151Scan(nAction); - - SCAN_VAR(TaitoInput); - SCAN_VAR(TaitoZ80Bank); - SCAN_VAR(TaitoSoundLatch); - SCAN_VAR(nTaitoCyclesDone); - SCAN_VAR(nTaitoCyclesSegment); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetClose(); - } - - return 0; -} - -struct BurnDriver BurnDrvBallbros = { - "ballbros", NULL, NULL, NULL, "1992", - "Balloon Brothers\0", NULL, "East Technology", "Taito-X", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOX, GBF_PUZZLE, 0, - NULL, BallbrosRomInfo, BallbrosRomName, NULL, NULL, TwinhawkInputInfo, BallbrosDIPInfo, - BallbrosInit, TaitoXExit, TaitoXFrame, NULL, TaitoXScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGigandes = { - "gigandes", NULL, NULL, NULL, "1989", - "Gigandes\0", NULL, "East Technology", "Taito-X", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOX, GBF_HORSHOOT, 0, - NULL, GigandesRomInfo, GigandesRomName, NULL, NULL, TwinhawkInputInfo, GigandesDIPInfo, - GigandesInit, TaitoXExit, TaitoXFrame, NULL, TaitoXScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGigandesa = { - "gigandesa", "gigandes", NULL, NULL, "1989", - "Gigandes (earlier)\0", NULL, "East Technology", "Taito-X", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOX, GBF_HORSHOOT, 0, - NULL, GigandesaRomInfo, GigandesaRomName, NULL, NULL, TwinhawkInputInfo, GigandesDIPInfo, - GigandesInit, TaitoXExit, TaitoXFrame, NULL, TaitoXScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvKyustrkr = { - "kyustrkr", NULL, NULL, NULL, "1989", - "Last Striker / Kyuukyoku no Striker\0", NULL, "East Technology", "Taito-X", - L"Last Striker\0Final \u7A76\u6975 \u306E Striker\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_TAITO_TAITOX, GBF_SPORTSFOOTBALL, 0, - NULL, KyustrkrRomInfo, KyustrkrRomName, NULL, NULL, TwinhawkInputInfo, KyustrkrDIPInfo, - BallbrosInit, TaitoXExit, TaitoXFrame, NULL, TaitoXScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSuperman = { - "superman", NULL, NULL, NULL, "1988", - "Superman (World)\0", NULL, "Taito Corporation", "Taito-X", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOX, GBF_SCRFIGHT, 0, - NULL, SupermanRomInfo, SupermanRomName, NULL, NULL, SupermanInputInfo, SupermanDIPInfo, - SupermanInit, TaitoXExit, TaitoXFrame, NULL, TaitoXScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSupermanu = { - "supermanu", "superman", NULL, NULL, "1988", - "Superman (US)\0", NULL, "Taito Corporation", "Taito-X", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOX, GBF_SCRFIGHT, 0, - NULL, SupermanuRomInfo, SupermanuRomName, NULL, NULL, SupermanInputInfo, SupermanuDIPInfo, - SupermanInit, TaitoXExit, TaitoXFrame, NULL, TaitoXScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSupermanj = { - "supermanj", "superman", NULL, NULL, "1988", - "Superman (Japan)\0", NULL, "Taito Corporation", "Taito-X", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOX, GBF_SCRFIGHT, 0, - NULL, SupermanjRomInfo, SupermanjRomName, NULL, NULL, SupermanInputInfo, SupermanjDIPInfo, - SupermanInit, TaitoXExit, TaitoXFrame, NULL, TaitoXScan, - NULL, 0x800, 384, 240, 4, 3 -}; - -struct BurnDriver BurnDrvTwinhawk = { - "twinhawk", NULL, NULL, NULL, "1989", - "Twin Hawk (World)\0", NULL, "Taito Corporation Japan", "Taito-X", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_TAITOX, GBF_VERSHOOT, 0, - NULL, TwinhawkRomInfo, TwinhawkRomName, NULL, NULL, TwinhawkInputInfo, TwinhawkDIPInfo, - TwinhawkInit, TaitoXExit, TwinhawkFrame, NULL, TaitoXScan, - NULL, 0x800, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvTwinhawku = { - "twinhawku", "twinhawk", NULL, NULL, "1989", - "Twin Hawk (US)\0", NULL, "Taito America Corporation", "Taito-X", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_TAITOX, GBF_VERSHOOT, 0, - NULL, TwinhawkuRomInfo, TwinhawkuRomName, NULL, NULL, TwinhawkInputInfo, TwinhawkuDIPInfo, - TwinhawkInit, TaitoXExit, TwinhawkFrame, NULL, TaitoXScan, - NULL, 0x800, 224, 384, 3, 4 -}; - -struct BurnDriver BurnDrvDaisenpu = { - "daisenpu", "twinhawk", NULL, NULL, "1989", - "Daisenpu (Japan)\0", NULL, "Taito Corporation", "Taito-X", - L"\u5927\u65CB\u98A8 (Japan)\0Daisenpu\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_TAITOX, GBF_VERSHOOT, 0, - NULL, DaisenpuRomInfo, DaisenpuRomName, NULL, NULL, TwinhawkInputInfo, DaisenpuDIPInfo, - TwinhawkInit, TaitoXExit, TwinhawkFrame, NULL, TaitoXScan, - NULL, 0x800, 224, 384, 3, 4 -}; diff --git a/jan/src/burn/drv/taito/d_taitoz.cpp b/jan/src/burn/drv/taito/d_taitoz.cpp deleted file mode 100644 index fe4f91097..000000000 --- a/jan/src/burn/drv/taito/d_taitoz.cpp +++ /dev/null @@ -1,7276 +0,0 @@ -// Based on MAME driver by David Graves - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "taito.h" -#include "taito_ic.h" -#include "burn_ym2610.h" -#include "eeprom.h" -#include "burn_gun.h" -#include "burn_shift.h" - -static INT32 Sci; -static INT32 OldSteer; // Hack to centre the steering in SCI -static INT32 SciSpriteFrame; -static INT32 TaitoZINT6timer = 0; -static INT32 bUseShifter = 0; -static INT32 bUseGun = 0; - -static double TaitoZYM2610Route1MasterVol; -static double TaitoZYM2610Route2MasterVol; - -static void AquajackDraw(); -static void BsharkDraw(); -static void ChasehqDraw(); -static void ContcircDraw(); -static void DblaxleDraw(); -static void EnforceDraw(); -static void RacingbDraw(); -static void SciDraw(); -static void SpacegunDraw(); - -#ifdef BUILD_A68K -static bool bUseAsm68KCoreOldValue = false; -#endif - -#define A(a, b, c, d) {a, b, (UINT8*)(c), d} - -static struct BurnInputInfo AquajackInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p2 coin" }, - - {"Up" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p1 up" }, - {"Down" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p1 down" }, - {"Left" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p1 left" }, - {"Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p1 right" }, - {"Jump" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p1 fire 1" }, - {"Accelerate" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 fire 2" }, - {"Vulcan" , BIT_DIGITAL , TC0220IOCInputPort1 + 6, "p1 fire 3" }, - {"Missile" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p1 fire 4" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Aquajack) - -static struct BurnInputInfo BsharkInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "p2 start" }, - - A("Crosshair X" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - A("Crosshair Y" , BIT_ANALOG_REL, &TaitoAnalogPort1 , "p1 y-axis" ), - {"Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 6, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 7, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Bshark) - -static struct BurnInputInfo BsharkjjsInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "p2 start" }, - - {"Up" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "p1 up" }, - {"Down" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p1 down" }, - {"Left" , BIT_DIGITAL , TC0220IOCInputPort2 + 5, "p1 left" }, - {"Right" , BIT_DIGITAL , TC0220IOCInputPort2 + 4, "p1 right" }, - {"Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 6, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 7, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Bsharkjjs) - -static struct BurnInputInfo ChasehqInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - {"Brake" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 fire 1" }, - {"Accelerate" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p1 fire 2" }, - {"Turbo" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p1 fire 3" }, - {"Gear" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p1 fire 4" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Chasehq) - -static struct BurnInputInfo ContcircInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - {"Brake" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p1 fire 1" }, - {"Accelerate" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p1 fire 2" }, - {"Gear" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p1 fire 3" }, - {"Brake 2" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p1 fire 4" }, - {"Brake 3" , BIT_DIGITAL , TC0220IOCInputPort1 + 6, "p1 fire 5" }, - {"Accelerate 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 fire 6" }, - {"Accelerate 3" , BIT_DIGITAL , TC0220IOCInputPort0 + 6, "p1 fire 7" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Contcirc) - -static struct BurnInputInfo DblaxleInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - {"Brake" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p1 fire 1" }, - {"Accelerate" , BIT_DIGITAL , TC0510NIOInputPort1 + 5, "p1 fire 2" }, - {"Nitro" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p1 fire 3" }, - {"Gear" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 fire 4" }, - {"Reverse" , BIT_DIGITAL , TC0510NIOInputPort0 + 7, "p1 fire 5" }, - {"Centre" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p1 fire 6" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "service" }, - {"Tilt" , BIT_DIGITAL , TC0510NIOInputPort1 + 1, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Dblaxle) - -static struct BurnInputInfo EnforceInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p2 coin" }, - - {"Up" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 up" }, - {"Down" , BIT_DIGITAL , TC0220IOCInputPort0 + 6, "p1 down" }, - {"Left" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p1 left" }, - {"Right" , BIT_DIGITAL , TC0220IOCInputPort1 + 7, "p1 right" }, - {"Laser" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p1 fire 1" }, - {"Bomb" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Enforce) - -static struct BurnInputInfo NightstrInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "p2 start" }, - - A("Stick X" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - A("Stick Y" , BIT_ANALOG_REL, &TaitoAnalogPort1 , "p1 y-axis" ), - {"Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 6, "p1 fire 1" }, - {"Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 7, "p1 fire 2" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 6, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Nightstr) - -static struct BurnInputInfo RacingbInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0510NIOInputPort0 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0510NIOInputPort1 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0510NIOInputPort0 + 3, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - {"Brake" , BIT_DIGITAL , TC0510NIOInputPort0 + 5, "p1 fire 1" }, - {"Accelerate" , BIT_DIGITAL , TC0510NIOInputPort1 + 5, "p1 fire 2" }, - {"Pit In" , BIT_DIGITAL , TC0510NIOInputPort1 + 0, "p1 fire 3" }, - {"Gear" , BIT_DIGITAL , TC0510NIOInputPort0 + 1, "p1 fire 4" }, - {"Centre" , BIT_DIGITAL , TC0510NIOInputPort1 + 2, "p1 fire 5" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0510NIOInputPort0 + 4, "service" }, - {"Dip 1" , BIT_DIPSWITCH , TC0510NIODip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0510NIODip + 1 , "dip" }, -}; - -STDINPUTINFO(Racingb) - -static struct BurnInputInfo SciInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort1 + 3, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p2 coin" }, - - A("Steering" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "p1 x-axis" ), - {"Brake" , BIT_DIGITAL , TC0220IOCInputPort0 + 5, "p1 fire 1" }, - {"Accelerate" , BIT_DIGITAL , TC0220IOCInputPort1 + 5, "p1 fire 2" }, - {"Fire" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p1 fire 3" }, - {"Turbo" , BIT_DIGITAL , TC0220IOCInputPort1 + 0, "p1 fire 4" }, - {"Gear" , BIT_DIGITAL , TC0220IOCInputPort1 + 4, "p1 fire 5" }, - {"Centre" , BIT_DIGITAL , TC0220IOCInputPort1 + 2, "p1 fire 6" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "service" }, - {"Tilt" , BIT_DIGITAL , TC0220IOCInputPort1 + 1, "tilt" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Sci) - -static struct BurnInputInfo SpacegunInputList[] = -{ - {"Coin 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 3, "p1 coin" }, - {"Start 1" , BIT_DIGITAL , TC0220IOCInputPort0 + 6, "p1 start" }, - {"Coin 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 2, "p2 coin" }, - {"Start 2" , BIT_DIGITAL , TC0220IOCInputPort0 + 7, "p2 start" }, - - A("P1 Gun X" , BIT_ANALOG_REL, &TaitoAnalogPort0 , "mouse x-axis" ), - A("P1 Gun Y" , BIT_ANALOG_REL, &TaitoAnalogPort1 , "mouse y-axis" ), - {"P1 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 0, "mouse button 1" }, - {"P1 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 2, "mouse button 2" }, - {"P1 Fire 3" , BIT_DIGITAL , TC0220IOCInputPort0 + 0, "p1 fire 1" }, - - A("P2 Gun X" , BIT_ANALOG_REL, &TaitoAnalogPort2 , "p2 x-axis" ), - A("P2 Gun Y" , BIT_ANALOG_REL, &TaitoAnalogPort3 , "p2 y-axis" ), - {"P2 Fire 1" , BIT_DIGITAL , TC0220IOCInputPort2 + 1, "p2 fire 1" }, - {"P2 Fire 2" , BIT_DIGITAL , TC0220IOCInputPort2 + 3, "p2 fire 2" }, - {"P2 Fire 3" , BIT_DIGITAL , TC0220IOCInputPort0 + 1, "p2 fire 3" }, - - {"Reset" , BIT_DIGITAL , &TaitoReset , "reset" }, - {"Service" , BIT_DIGITAL , TC0220IOCInputPort0 + 4, "service" }, - {"Dip 1" , BIT_DIPSWITCH , TC0220IOCDip + 0 , "dip" }, - {"Dip 2" , BIT_DIPSWITCH , TC0220IOCDip + 1 , "dip" }, -}; - -STDINPUTINFO(Spacegun) - -#undef A - -static void AquajackMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0xff; - TC0220IOCInput[1] = 0xff; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] -= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] -= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] -= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] -= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] -= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] -= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] -= 0x80; - - if (TC0220IOCInputPort1[0]) TC0220IOCInput[1] -= 0x01; - if (TC0220IOCInputPort1[1]) TC0220IOCInput[1] -= 0x02; - if (TC0220IOCInputPort1[2]) TC0220IOCInput[1] -= 0x04; - if (TC0220IOCInputPort1[3]) TC0220IOCInput[1] -= 0x08; - if (TC0220IOCInputPort1[4]) TC0220IOCInput[1] -= 0x10; - if (TC0220IOCInputPort1[5]) TC0220IOCInput[1] -= 0x20; - if (TC0220IOCInputPort1[6]) TC0220IOCInput[1] -= 0x40; - if (TC0220IOCInputPort1[7]) TC0220IOCInput[1] -= 0x80; -} - -static void BsharkMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0xff; - TC0220IOCInput[1] = 0xff; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] -= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] -= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] -= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] -= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] -= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] -= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] -= 0x80; - - if (TC0220IOCInputPort2[0]) TC0220IOCInput[2] -= 0x01; - if (TC0220IOCInputPort2[1]) TC0220IOCInput[2] -= 0x02; - if (TC0220IOCInputPort2[2]) TC0220IOCInput[2] -= 0x04; - if (TC0220IOCInputPort2[3]) TC0220IOCInput[2] -= 0x08; - if (TC0220IOCInputPort2[4]) TC0220IOCInput[2] -= 0x10; - if (TC0220IOCInputPort2[5]) TC0220IOCInput[2] -= 0x20; - if (TC0220IOCInputPort2[6]) TC0220IOCInput[2] -= 0x40; - if (TC0220IOCInputPort2[7]) TC0220IOCInput[2] -= 0x80; -} - -static void ChasehqMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0xf3; - TC0220IOCInput[1] = 0xef; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] -= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] |= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] |= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] -= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] -= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] -= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] -= 0x80; - - if (TC0220IOCInputPort1[0]) TC0220IOCInput[1] -= 0x01; - if (TC0220IOCInputPort1[1]) TC0220IOCInput[1] -= 0x02; - if (TC0220IOCInputPort1[2]) TC0220IOCInput[1] -= 0x04; - if (TC0220IOCInputPort1[3]) TC0220IOCInput[1] -= 0x08; - TC0220IOCInput[1] |= (BurnShiftInputCheckToggle(TC0220IOCInputPort1[4]) ? 0x00 : 0x10); - if (TC0220IOCInputPort1[5]) TC0220IOCInput[1] -= 0x20; - if (TC0220IOCInputPort1[6]) TC0220IOCInput[1] -= 0x40; - if (TC0220IOCInputPort1[7]) TC0220IOCInput[1] -= 0x80; -} - -static void ContcircMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0x13; - TC0220IOCInput[1] = 0x0f; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] -= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] |= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] |= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] -= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] |= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] |= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] |= 0x80; - - if (TC0220IOCInputPort1[0]) TC0220IOCInput[1] -= 0x01; - if (TC0220IOCInputPort1[1]) TC0220IOCInput[1] -= 0x02; - if (TC0220IOCInputPort1[2]) TC0220IOCInput[1] -= 0x04; - if (TC0220IOCInputPort1[3]) TC0220IOCInput[1] -= 0x08; - TC0220IOCInput[1] |= (BurnShiftInputCheckToggle(TC0220IOCInputPort1[4]) ? 0x00 : 0x10); - if (TC0220IOCInputPort1[5]) TC0220IOCInput[1] |= 0x20; - if (TC0220IOCInputPort1[6]) TC0220IOCInput[1] |= 0x40; - if (TC0220IOCInputPort1[7]) TC0220IOCInput[1] |= 0x80; -} - -static void DblaxleMakeInputs() // and racingb -{ - // Reset Inputs - TC0510NIOInput[0] = 0xff; - TC0510NIOInput[1] = 0xff; - TC0510NIOInput[2] = 0xff; - - if (TC0510NIOInputPort0[0]) TC0510NIOInput[0] -= 0x01; - TC0510NIOInput[0] -= (BurnShiftInputCheckToggle(TC0510NIOInputPort0[1]) ? 0x00 : 0x02); - if (TC0510NIOInputPort0[2]) TC0510NIOInput[0] -= 0x04; - if (TC0510NIOInputPort0[3]) TC0510NIOInput[0] -= 0x08; - if (TC0510NIOInputPort0[4]) TC0510NIOInput[0] -= 0x10; - if (TC0510NIOInputPort0[5]) TC0510NIOInput[0] -= 0x20; - if (TC0510NIOInputPort0[6]) TC0510NIOInput[0] -= 0x40; - if (TC0510NIOInputPort0[7]) TC0510NIOInput[0] -= 0x80; - - if (TC0510NIOInputPort1[0]) TC0510NIOInput[1] -= 0x01; - if (TC0510NIOInputPort1[1]) TC0510NIOInput[1] -= 0x02; - if (TC0510NIOInputPort1[2]) TC0510NIOInput[1] -= 0x04; - if (TC0510NIOInputPort1[3]) TC0510NIOInput[1] -= 0x08; - if (TC0510NIOInputPort1[4]) TC0510NIOInput[1] -= 0x10; - if (TC0510NIOInputPort1[5]) TC0510NIOInput[1] -= 0x20; - if (TC0510NIOInputPort1[6]) TC0510NIOInput[1] -= 0x40; - if (TC0510NIOInputPort1[7]) TC0510NIOInput[1] -= 0x80; -} - -static void EnforceMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0xf3; - TC0220IOCInput[1] = 0xff; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] -= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] |= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] |= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] -= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] -= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] -= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] -= 0x80; - - if (TC0220IOCInputPort1[0]) TC0220IOCInput[1] -= 0x01; - if (TC0220IOCInputPort1[1]) TC0220IOCInput[1] -= 0x02; - if (TC0220IOCInputPort1[2]) TC0220IOCInput[1] -= 0x04; - if (TC0220IOCInputPort1[3]) TC0220IOCInput[1] -= 0x08; - if (TC0220IOCInputPort1[4]) TC0220IOCInput[1] -= 0x10; - if (TC0220IOCInputPort1[5]) TC0220IOCInput[1] -= 0x20; - if (TC0220IOCInputPort1[6]) TC0220IOCInput[1] -= 0x40; - if (TC0220IOCInputPort1[7]) TC0220IOCInput[1] -= 0x80; -} - -static void NightstrMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0xff; - TC0220IOCInput[1] = 0xff; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] -= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] -= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] -= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] -= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] -= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] -= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] -= 0x80; - - if (TC0220IOCInputPort2[0]) TC0220IOCInput[2] -= 0x01; - if (TC0220IOCInputPort2[1]) TC0220IOCInput[2] -= 0x02; - if (TC0220IOCInputPort2[2]) TC0220IOCInput[2] -= 0x04; - if (TC0220IOCInputPort2[3]) TC0220IOCInput[2] -= 0x08; - if (TC0220IOCInputPort2[4]) TC0220IOCInput[2] -= 0x10; - if (TC0220IOCInputPort2[5]) TC0220IOCInput[2] -= 0x20; - if (TC0220IOCInputPort2[6]) TC0220IOCInput[2] -= 0x40; - if (TC0220IOCInputPort2[7]) TC0220IOCInput[2] -= 0x80; -} - -static void SciMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0xff; - TC0220IOCInput[1] = 0xef; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] -= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] -= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] -= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] -= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] -= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] -= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] -= 0x80; - - if (TC0220IOCInputPort1[0]) TC0220IOCInput[1] -= 0x01; - if (TC0220IOCInputPort1[1]) TC0220IOCInput[1] -= 0x02; - if (TC0220IOCInputPort1[2]) TC0220IOCInput[1] -= 0x04; - if (TC0220IOCInputPort1[3]) TC0220IOCInput[1] -= 0x08; - TC0220IOCInput[1] |= (BurnShiftInputCheckToggle(TC0220IOCInputPort1[4]) ? 0x00 : 0x10); - if (TC0220IOCInputPort1[5]) TC0220IOCInput[1] -= 0x20; - if (TC0220IOCInputPort1[6]) TC0220IOCInput[1] -= 0x40; - if (TC0220IOCInputPort1[7]) TC0220IOCInput[1] -= 0x80; -} - -static void SpacegunMakeInputs() -{ - // Reset Inputs - TC0220IOCInput[0] = 0xff; - TC0220IOCInput[1] = 0xff; - TC0220IOCInput[2] = 0xff; - - if (TC0220IOCInputPort0[0]) TC0220IOCInput[0] -= 0x01; - if (TC0220IOCInputPort0[1]) TC0220IOCInput[0] -= 0x02; - if (TC0220IOCInputPort0[2]) TC0220IOCInput[0] -= 0x04; - if (TC0220IOCInputPort0[3]) TC0220IOCInput[0] -= 0x08; - if (TC0220IOCInputPort0[4]) TC0220IOCInput[0] -= 0x10; - if (TC0220IOCInputPort0[5]) TC0220IOCInput[0] -= 0x20; - if (TC0220IOCInputPort0[6]) TC0220IOCInput[0] -= 0x40; - if (TC0220IOCInputPort0[7]) TC0220IOCInput[0] -= 0x80; - - if (TC0220IOCInputPort2[0]) TC0220IOCInput[2] -= 0x01; - if (TC0220IOCInputPort2[1]) TC0220IOCInput[2] -= 0x02; - if (TC0220IOCInputPort2[2]) TC0220IOCInput[2] -= 0x04; - if (TC0220IOCInputPort2[3]) TC0220IOCInput[2] -= 0x08; - if (TC0220IOCInputPort2[4]) TC0220IOCInput[2] -= 0x10; - if (TC0220IOCInputPort2[5]) TC0220IOCInput[2] -= 0x20; - if (TC0220IOCInputPort2[6]) TC0220IOCInput[2] -= 0x40; - if (TC0220IOCInputPort2[7]) TC0220IOCInput[2] -= 0x80; - - BurnGunMakeInputs(0, (INT16)TaitoAnalogPort0, (INT16)TaitoAnalogPort1); - BurnGunMakeInputs(1, (INT16)TaitoAnalogPort2, (INT16)TaitoAnalogPort3); -} - -static struct BurnDIPInfo AquajackDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x7f, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x80, 0x80, "Cockpit" }, - {0x0e, 0x01, 0x80, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x20, 0x20, "Off" }, - {0x0e, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x10, 0x00, "Off" }, - {0x0e, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0e, 0x01, 0x0c, 0x00, "4 Coins 1 Credit" }, - {0x0e, 0x01, 0x0c, 0x08, "3 Coins 1 Credit" }, - {0x0e, 0x01, 0x0c, 0x04, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0e, 0x01, 0x03, 0x03, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0x03, 0x01, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0x03, 0x02, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0x03, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0f, 0x01, 0xc0, 0x40, "Easy" }, - {0x0f, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0f, 0x01, 0xc0, 0x80, "Hard" }, - {0x0f, 0x01, 0xc0, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0f, 0x01, 0x30, 0x00, "30000" }, - {0x0f, 0x01, 0x30, 0x30, "50000" }, - {0x0f, 0x01, 0x30, 0x10, "80000" }, - {0x0f, 0x01, 0x30, 0x20, "100000" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x0c, 0x08, "1" }, - {0x0f, 0x01, 0x0c, 0x04, "2" }, - {0x0f, 0x01, 0x0c, 0x0c, "3" }, - {0x0f, 0x01, 0x0c, 0x00, "5" }, -}; - -STDDIPINFO(Aquajack) - -static struct BurnDIPInfo AquajackjDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0x7f, NULL }, - {0x0f, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x80, 0x80, "Cockpit" }, - {0x0e, 0x01, 0x80, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x20, 0x20, "Off" }, - {0x0e, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x10, 0x00, "Off" }, - {0x0e, 0x01, 0x10, 0x10, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0e, 0x01, 0x0c, 0x08, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x0c, 0x0c, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0x0c, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x0c, 0x04, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0e, 0x01, 0x03, 0x02, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x03, 0x03, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0x03, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0f, 0x01, 0xc0, 0x40, "Easy" }, - {0x0f, 0x01, 0xc0, 0xc0, "Normal" }, - {0x0f, 0x01, 0xc0, 0x80, "Hard" }, - {0x0f, 0x01, 0xc0, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Life" }, - {0x0f, 0x01, 0x30, 0x00, "30000" }, - {0x0f, 0x01, 0x30, 0x30, "50000" }, - {0x0f, 0x01, 0x30, 0x10, "80000" }, - {0x0f, 0x01, 0x30, 0x20, "100000" }, - - {0 , 0xfe, 0 , 4 , "Lives" }, - {0x0f, 0x01, 0x0c, 0x08, "1" }, - {0x0f, 0x01, 0x0c, 0x04, "2" }, - {0x0f, 0x01, 0x0c, 0x0c, "3" }, - {0x0f, 0x01, 0x0c, 0x00, "5" }, -}; - -STDDIPINFO(Aquajackj) - -static struct BurnDIPInfo BsharkDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xf7, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Mirror Screen" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0b, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0b, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0b, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0b, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Speed of Sight" }, - {0x0c, 0x01, 0x0c, 0x0c, "Slow" }, - {0x0c, 0x01, 0x0c, 0x08, "Medium" }, - {0x0c, 0x01, 0x0c, 0x04, "Fast" }, - {0x0c, 0x01, 0x0c, 0x00, "Fastest" }, -}; - -STDDIPINFO(Bshark) - -static struct BurnDIPInfo BsharkjDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xf7, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Mirror Screen" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0b, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0b, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0b, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Speed of Sight" }, - {0x0c, 0x01, 0x0c, 0x0c, "Slow" }, - {0x0c, 0x01, 0x0c, 0x08, "Medium" }, - {0x0c, 0x01, 0x0c, 0x04, "Fast" }, - {0x0c, 0x01, 0x0c, 0x00, "Fastest" }, -}; - -STDDIPINFO(Bsharkj) - -static struct BurnDIPInfo BsharkjjsDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xf7, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Mirror Screen" }, - {0x0d, 0x01, 0x01, 0x01, "Off" }, - {0x0d, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0d, 0x01, 0x04, 0x04, "Off" }, - {0x0d, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0e, 0x01, 0x03, 0x02, "Easy" }, - {0x0e, 0x01, 0x03, 0x03, "Normal" }, - {0x0e, 0x01, 0x03, 0x01, "Hard" }, - {0x0e, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Speed of Sight" }, - {0x0e, 0x01, 0x0c, 0x0c, "Slow" }, - {0x0e, 0x01, 0x0c, 0x08, "Medium" }, - {0x0e, 0x01, 0x0c, 0x04, "Fast" }, - {0x0e, 0x01, 0x0c, 0x00, "Fastest" }, -}; - -STDDIPINFO(Bsharkjjs) - -static struct BurnDIPInfo BsharkuDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xf7, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Mirror Screen" }, - {0x0b, 0x01, 0x01, 0x01, "Off" }, - {0x0b, 0x01, 0x01, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0b, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x0b, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0xc0, 0xc0, "Same as Start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Speed of Sight" }, - {0x0c, 0x01, 0x0c, 0x0c, "Slow" }, - {0x0c, 0x01, 0x0c, 0x08, "Medium" }, - {0x0c, 0x01, 0x0c, 0x04, "Fast" }, - {0x0c, 0x01, 0x0c, 0x00, "Fastest" }, -}; - -STDDIPINFO(Bsharku) - -static struct BurnDIPInfo ChasehqDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Cabinet" }, - {0x0b, 0x01, 0x03, 0x03, "Upright / Steering Lock" }, - {0x0b, 0x01, 0x03, 0x02, "Upright / No Steering Lock" }, - {0x0b, 0x01, 0x03, 0x01, "Full Throttle Convert, Cockpit" }, - {0x0b, 0x01, 0x03, 0x00, "Full Throttle Convert, Deluxe" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0b, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0b, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0b, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0b, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Timer Setting" }, - {0x0c, 0x01, 0x0c, 0x08, "70 Seconds" }, - {0x0c, 0x01, 0x0c, 0x04, "65 Seconds" }, - {0x0c, 0x01, 0x0c, 0x0c, "60 Seconds" }, - {0x0c, 0x01, 0x0c, 0x00, "55 Seconds" }, - - {0 , 0xfe, 0 , 2 , "Turbos Stocked" }, - {0x0c, 0x01, 0x10, 0x10, "3" }, - {0x0c, 0x01, 0x10, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Discounted Continue Play" }, - {0x0c, 0x01, 0x20, 0x20, "Off" }, - {0x0c, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Damage Cleared at Continue" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x80, 0x00, "Off" }, - {0x0c, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Chasehq) - -static struct BurnDIPInfo ChasehqjDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 4 , "Cabinet" }, - {0x0b, 0x01, 0x03, 0x03, "Upright / Steering Lock" }, - {0x0b, 0x01, 0x03, 0x02, "Upright / No Steering Lock" }, - {0x0b, 0x01, 0x03, 0x01, "Full Throttle Convert, Cockpit" }, - {0x0b, 0x01, 0x03, 0x00, "Full Throttle Convert, Deluxe" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0b, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0b, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0b, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Timer Setting" }, - {0x0c, 0x01, 0x0c, 0x08, "70 Seconds" }, - {0x0c, 0x01, 0x0c, 0x04, "65 Seconds" }, - {0x0c, 0x01, 0x0c, 0x0c, "60 Seconds" }, - {0x0c, 0x01, 0x0c, 0x00, "55 Seconds" }, - - {0 , 0xfe, 0 , 2 , "Turbos Stocked" }, - {0x0c, 0x01, 0x10, 0x10, "3" }, - {0x0c, 0x01, 0x10, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Discounted Continue Play" }, - {0x0c, 0x01, 0x20, 0x20, "Off" }, - {0x0c, 0x01, 0x20, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Damage Cleared at Continue" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x80, 0x00, "Off" }, - {0x0c, 0x01, 0x80, 0x80, "On" }, -}; - -STDDIPINFO(Chasehqj) - -static struct BurnDIPInfo ContcircDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x01, 0x01, "Upright" }, - {0x0e, 0x01, 0x01, 0x00, "Cockpit" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x04, 0x04, "Off" }, - {0x0e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x08, 0x00, "Off" }, - {0x0e, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0e, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0e, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0e, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0e, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0e, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty 1 (time/speed)" }, - {0x0f, 0x01, 0x03, 0x02, "Easy" }, - {0x0f, 0x01, 0x03, 0x03, "Normal" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty 2 (other cars)" }, - {0x0f, 0x01, 0x0c, 0x08, "Easy" }, - {0x0f, 0x01, 0x0c, 0x0c, "Normal" }, - {0x0f, 0x01, 0x0c, 0x04, "Hard" }, - {0x0f, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Steering Wheel" }, - {0x0f, 0x01, 0x10, 0x10, "Free" }, - {0x0f, 0x01, 0x10, 0x00, "Locked" }, - - {0 , 0xfe, 0 , 2 , "3D Effects" }, - {0x0f, 0x01, 0x20, 0x00, "Off" }, - {0x0f, 0x01, 0x20, 0x20, "On" }, -}; - -STDDIPINFO(Contcirc) - -static struct BurnDIPInfo ContcircuDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x01, 0x01, "Upright" }, - {0x0e, 0x01, 0x01, 0x00, "Cockpit" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x04, 0x04, "Off" }, - {0x0e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x08, 0x00, "Off" }, - {0x0e, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0e, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0e, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty 1 (time/speed)" }, - {0x0f, 0x01, 0x03, 0x02, "Easy" }, - {0x0f, 0x01, 0x03, 0x03, "Normal" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty 2 (other cars)" }, - {0x0f, 0x01, 0x0c, 0x08, "Easy" }, - {0x0f, 0x01, 0x0c, 0x0c, "Normal" }, - {0x0f, 0x01, 0x0c, 0x04, "Hard" }, - {0x0f, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Steering Wheel" }, - {0x0f, 0x01, 0x10, 0x10, "Free" }, - {0x0f, 0x01, 0x10, 0x00, "Locked" }, - - {0 , 0xfe, 0 , 2 , "3D Effects" }, - {0x0f, 0x01, 0x20, 0x00, "Off" }, - {0x0f, 0x01, 0x20, 0x20, "On" }, -}; - -STDDIPINFO(Contcircu) - -static struct BurnDIPInfo ContcircjDIPList[]= -{ - // Default Values - {0x0e, 0xff, 0xff, 0xff, NULL }, - {0x0f, 0xff, 0xff, 0xdf, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0e, 0x01, 0x01, 0x01, "Upright" }, - {0x0e, 0x01, 0x01, 0x00, "Cockpit" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0e, 0x01, 0x04, 0x04, "Off" }, - {0x0e, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0e, 0x01, 0x08, 0x00, "Off" }, - {0x0e, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0e, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0e, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0e, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0e, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0e, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty 1 (time/speed)" }, - {0x0f, 0x01, 0x03, 0x02, "Easy" }, - {0x0f, 0x01, 0x03, 0x03, "Normal" }, - {0x0f, 0x01, 0x03, 0x01, "Hard" }, - {0x0f, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Difficulty 2 (other cars)" }, - {0x0f, 0x01, 0x0c, 0x08, "Easy" }, - {0x0f, 0x01, 0x0c, 0x0c, "Normal" }, - {0x0f, 0x01, 0x0c, 0x04, "Hard" }, - {0x0f, 0x01, 0x0c, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Steering Wheel" }, - {0x0f, 0x01, 0x10, 0x10, "Free" }, - {0x0f, 0x01, 0x10, 0x00, "Locked" }, -}; - -STDDIPINFO(Contcircj) - -static struct BurnDIPInfo DblaxleDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xfb, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Gear Shift" }, - {0x0d, 0x01, 0x02, 0x02, "Normal" }, - {0x0d, 0x01, 0x02, 0x00, "Inverted" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0d, 0x01, 0x04, 0x04, "Off" }, - {0x0d, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0e, 0x01, 0x03, 0x02, "Easy" }, - {0x0e, 0x01, 0x03, 0x03, "Normal" }, - {0x0e, 0x01, 0x03, 0x01, "Hard" }, - {0x0e, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Multi-machine hookup" }, - {0x0e, 0x01, 0x04, 0x00, "Off" }, - {0x0e, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Player Truck" }, - {0x0e, 0x01, 0x08, 0x08, "Red" }, - {0x0e, 0x01, 0x08, 0x00, "Blue" }, - - {0 , 0xfe, 0 , 2 , "Reverse" }, - {0x0e, 0x01, 0x10, 0x10, "Normal" }, - {0x0e, 0x01, 0x10, 0x00, "Inverted" }, -}; - -STDDIPINFO(Dblaxle) - -static struct BurnDIPInfo PwheelsjDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xfb, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Gear Shift" }, - {0x0d, 0x01, 0x02, 0x02, "Normal" }, - {0x0d, 0x01, 0x02, 0x00, "Inverted" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0d, 0x01, 0x04, 0x04, "Off" }, - {0x0d, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0e, 0x01, 0x03, 0x02, "Easy" }, - {0x0e, 0x01, 0x03, 0x03, "Normal" }, - {0x0e, 0x01, 0x03, 0x01, "Hard" }, - {0x0e, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Multi-machine hookup" }, - {0x0e, 0x01, 0x04, 0x00, "Off" }, - {0x0e, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2 , "Player Truck" }, - {0x0e, 0x01, 0x08, 0x08, "Red" }, - {0x0e, 0x01, 0x08, 0x00, "Blue" }, - - {0 , 0xfe, 0 , 2 , "Reverse" }, - {0x0e, 0x01, 0x10, 0x10, "Normal" }, - {0x0e, 0x01, 0x10, 0x00, "Inverted" }, -}; - -STDDIPINFO(Pwheelsj) - -static struct BurnDIPInfo EnforceDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0xef, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x08, 0x00, "Off" }, - {0x0c, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0c, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0c, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Background Scenery" }, - {0x0d, 0x01, 0x10, 0x10, "Crazy Scolling" }, - {0x0d, 0x01, 0x10, 0x00, "Normal" }, -}; - -STDDIPINFO(Enforce) - -static struct BurnDIPInfo EnforcejDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0xef, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x08, 0x00, "Off" }, - {0x0c, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0c, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0c, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Background Scenery" }, - {0x0d, 0x01, 0x10, 0x10, "Crazy Scrolling" }, - {0x0d, 0x01, 0x10, 0x00, "Normal" }, -}; - -STDDIPINFO(Enforcej) - -static struct BurnDIPInfo EnforcejaDIPList[]= -{ - // Default Values - {0x0c, 0xff, 0xff, 0xff, NULL }, - {0x0d, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0c, 0x01, 0x04, 0x04, "Off" }, - {0x0c, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0c, 0x01, 0x08, 0x00, "Off" }, - {0x0c, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0c, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0c, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0c, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0c, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0c, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "3D Effects" }, - {0x0d, 0x01, 0x30, 0x30, "Off" }, - {0x0d, 0x01, 0x30, 0x20, "On" }, - {0x0d, 0x01, 0x30, 0x10, "In Game Only" }, - {0x0d, 0x01, 0x30, 0x00, "In Game Only" }, -}; - -STDDIPINFO(Enforceja) - -static struct BurnDIPInfo NightstrDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xfe, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x01, 0x01, "Cockpit" }, - {0x0b, 0x01, 0x01, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0b, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0b, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0b, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0b, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Shields" }, - {0x0c, 0x01, 0x0c, 0x08, "3" }, - {0x0c, 0x01, 0x0c, 0x04, "2" }, - {0x0c, 0x01, 0x0c, 0x0c, "1" }, - {0x0c, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Shields" }, - {0x0c, 0x01, 0x30, 0x00, "3" }, - {0x0c, 0x01, 0x30, 0x10, "4" }, - {0x0c, 0x01, 0x30, 0x30, "5" }, - {0x0c, 0x01, 0x30, 0x20, "6" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Trigger Turbo" }, - {0x0c, 0x01, 0x80, 0x80, "7 shots / seconds" }, - {0x0c, 0x01, 0x80, 0x00, "10 shots / seconds" }, -}; - -STDDIPINFO(Nightstr) - -static struct BurnDIPInfo NightstrjDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xfe, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x01, 0x01, "Cockpit" }, - {0x0b, 0x01, 0x01, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0b, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0b, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0b, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Shields" }, - {0x0c, 0x01, 0x0c, 0x08, "3" }, - {0x0c, 0x01, 0x0c, 0x04, "2" }, - {0x0c, 0x01, 0x0c, 0x0c, "1" }, - {0x0c, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Shields" }, - {0x0c, 0x01, 0x30, 0x00, "3" }, - {0x0c, 0x01, 0x30, 0x10, "4" }, - {0x0c, 0x01, 0x30, 0x30, "5" }, - {0x0c, 0x01, 0x30, 0x20, "6" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Trigger Turbo" }, - {0x0c, 0x01, 0x80, 0x80, "7 shots / seconds" }, - {0x0c, 0x01, 0x80, 0x00, "10 shots / seconds" }, -}; - -STDDIPINFO(Nightstrj) - - -static struct BurnDIPInfo NightstruDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xfe, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x01, 0x01, "Cockpit" }, - {0x0b, 0x01, 0x01, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0b, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x0b, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x0b, 0x01, 0xc0, 0xc0, "Same as Start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0c, 0x01, 0x03, 0x02, "Easy" }, - {0x0c, 0x01, 0x03, 0x03, "Normal" }, - {0x0c, 0x01, 0x03, 0x01, "Hard" }, - {0x0c, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Bonus Shields" }, - {0x0c, 0x01, 0x0c, 0x08, "3" }, - {0x0c, 0x01, 0x0c, 0x04, "2" }, - {0x0c, 0x01, 0x0c, 0x0c, "1" }, - {0x0c, 0x01, 0x0c, 0x00, "None" }, - - {0 , 0xfe, 0 , 4 , "Shields" }, - {0x0c, 0x01, 0x30, 0x00, "3" }, - {0x0c, 0x01, 0x30, 0x10, "4" }, - {0x0c, 0x01, 0x30, 0x30, "5" }, - {0x0c, 0x01, 0x30, 0x20, "6" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x0c, 0x01, 0x40, 0x00, "Off" }, - {0x0c, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Trigger Turbo" }, - {0x0c, 0x01, 0x80, 0x80, "7 shots / seconds" }, - {0x0c, 0x01, 0x80, 0x00, "10 shots / seconds" }, -}; - -STDDIPINFO(Nightstru) - -static struct BurnDIPInfo RacingbDIPList[]= -{ - // Default Values - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0b, 0x01, 0x01, 0x00, "Type 0" }, - {0x0b, 0x01, 0x01, 0x01, "Type 1" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0b, 0x01, 0x04, 0x04, "Off" }, - {0x0b, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0b, 0x01, 0x08, 0x00, "Off" }, - {0x0b, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0b, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0b, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0b, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0b, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0b, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0b, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 2 , "Steering Wheel Range" }, - {0x0c, 0x01, 0x04, 0x04, "Normal" }, - {0x0c, 0x01, 0x04, 0x00, "High" }, - - {0 , 0xfe, 0 , 2 , "Steering Wheel Type" }, - {0x0c, 0x01, 0x08, 0x00, "Free" }, - {0x0c, 0x01, 0x08, 0x08, "Locked" }, - - {0 , 0xfe, 0 , 2 , "Network" }, - {0x0c, 0x01, 0x10, 0x10, "Off" }, - {0x0c, 0x01, 0x10, 0x00, "On" }, - - {0 , 0xfe, 0 , 4 , "Player Car" }, - {0x0c, 0x01, 0x60, 0x60, "Red" }, - {0x0c, 0x01, 0x60, 0x40, "Blue" }, - {0x0c, 0x01, 0x60, 0x20, "Green" }, - {0x0c, 0x01, 0x60, 0x00, "Yellow" }, -}; - -STDDIPINFO(Racingb) - -static struct BurnDIPInfo SciDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0xfe, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x01, 0x01, "Cockpit" }, - {0x0d, 0x01, 0x01, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0d, 0x01, 0x04, 0x04, "Off" }, - {0x0d, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x0d, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x0d, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0e, 0x01, 0x03, 0x02, "Easy" }, - {0x0e, 0x01, 0x03, 0x03, "Normal" }, - {0x0e, 0x01, 0x03, 0x01, "Hard" }, - {0x0e, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Timer Setting" }, - {0x0e, 0x01, 0x0c, 0x08, "70 Seconds" }, - {0x0e, 0x01, 0x0c, 0x04, "65 Seconds" }, - {0x0e, 0x01, 0x0c, 0x0c, "60 Seconds" }, - {0x0e, 0x01, 0x0c, 0x00, "55 Seconds" }, - - {0 , 0xfe, 0 , 2 , "Turbos Stocked" }, - {0x0e, 0x01, 0x10, 0x10, "3" }, - {0x0e, 0x01, 0x10, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Steering Radius" }, - {0x0e, 0x01, 0x20, 0x00, "270 Degree" }, - {0x0e, 0x01, 0x20, 0x20, "360 Degree" }, - - {0 , 0xfe, 0 , 2 , "Damage Cleared at Continue" }, - {0x0e, 0x01, 0x40, 0x00, "Off" }, - {0x0e, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Siren Volume" }, - {0x0e, 0x01, 0x80, 0x80, "Normal" }, - {0x0e, 0x01, 0x80, 0x00, "Low" }, -}; - -STDDIPINFO(Sci) - -static struct BurnDIPInfo ScijDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0xfe, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x01, 0x01, "Cockpit" }, - {0x0d, 0x01, 0x01, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0d, 0x01, 0x04, 0x04, "Off" }, - {0x0d, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x0d, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0e, 0x01, 0x03, 0x02, "Easy" }, - {0x0e, 0x01, 0x03, 0x03, "Normal" }, - {0x0e, 0x01, 0x03, 0x01, "Hard" }, - {0x0e, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Timer Setting" }, - {0x0e, 0x01, 0x0c, 0x08, "70 Seconds" }, - {0x0e, 0x01, 0x0c, 0x04, "65 Seconds" }, - {0x0e, 0x01, 0x0c, 0x0c, "60 Seconds" }, - {0x0e, 0x01, 0x0c, 0x00, "55 Seconds" }, - - {0 , 0xfe, 0 , 2 , "Turbos Stocked" }, - {0x0e, 0x01, 0x10, 0x10, "3" }, - {0x0e, 0x01, 0x10, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Steering Radius" }, - {0x0e, 0x01, 0x20, 0x00, "270 Degree" }, - {0x0e, 0x01, 0x20, 0x20, "360 Degree" }, - - {0 , 0xfe, 0 , 2 , "Damage Cleared at Continue" }, - {0x0e, 0x01, 0x40, 0x00, "Off" }, - {0x0e, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Siren Volume" }, - {0x0e, 0x01, 0x80, 0x80, "Normal" }, - {0x0e, 0x01, 0x80, 0x00, "Low" }, -}; - -STDDIPINFO(Scij) - -static struct BurnDIPInfo SciuDIPList[]= -{ - // Default Values - {0x0d, 0xff, 0xff, 0xfe, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Cabinet" }, - {0x0d, 0x01, 0x01, 0x01, "Cockpit" }, - {0x0d, 0x01, 0x01, 0x00, "Upright" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x0d, 0x01, 0x04, 0x04, "Off" }, - {0x0d, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x0d, 0x01, 0x08, 0x00, "Off" }, - {0x0d, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x0d, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x0d, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x0d, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x0d, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x0d, 0x01, 0xc0, 0xc0, "Same as Start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x0e, 0x01, 0x03, 0x02, "Easy" }, - {0x0e, 0x01, 0x03, 0x03, "Normal" }, - {0x0e, 0x01, 0x03, 0x01, "Hard" }, - {0x0e, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 4 , "Timer Setting" }, - {0x0e, 0x01, 0x0c, 0x08, "70 Seconds" }, - {0x0e, 0x01, 0x0c, 0x04, "65 Seconds" }, - {0x0e, 0x01, 0x0c, 0x0c, "60 Seconds" }, - {0x0e, 0x01, 0x0c, 0x00, "55 Seconds" }, - - {0 , 0xfe, 0 , 2 , "Turbos Stocked" }, - {0x0e, 0x01, 0x10, 0x10, "3" }, - {0x0e, 0x01, 0x10, 0x00, "5" }, - - {0 , 0xfe, 0 , 2 , "Steering Radius" }, - {0x0e, 0x01, 0x20, 0x00, "270 Degree" }, - {0x0e, 0x01, 0x20, 0x20, "360 Degree" }, - - {0 , 0xfe, 0 , 2 , "Damage Cleared at Continue" }, - {0x0e, 0x01, 0x40, 0x00, "Off" }, - {0x0e, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Siren Volume" }, - {0x0e, 0x01, 0x80, 0x80, "Normal" }, - {0x0e, 0x01, 0x80, 0x00, "Low" }, -}; - -STDDIPINFO(Sciu) - -static struct BurnDIPInfo SpacegunDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Always have gunsight power up" }, - {0x10, 0x01, 0x02, 0x02, "Off" }, - {0x10, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x10, 0x01, 0x04, 0x04, "Off" }, - {0x10, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x08, 0x00, "Off" }, - {0x10, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x10, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x10, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x10, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x10, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x10, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, - {0x10, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, - {0x10, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, - {0x10, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x03, 0x02, "Easy" }, - {0x11, 0x01, 0x03, 0x03, "Normal" }, - {0x11, 0x01, 0x03, 0x01, "Hard" }, - {0x11, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Disable Pedal" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Spacegun) - -static struct BurnDIPInfo SpacegunjDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Always have gunsight power up" }, - {0x10, 0x01, 0x02, 0x02, "Off" }, - {0x10, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x10, 0x01, 0x04, 0x04, "Off" }, - {0x10, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x08, 0x00, "Off" }, - {0x10, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coin A" }, - {0x10, 0x01, 0x30, 0x10, "2 Coins 1 Credit" }, - {0x10, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - {0x10, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, - {0x10, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4 , "Coin B" }, - {0x10, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x10, 0x01, 0xc0, 0xc0, "1 Coin 1 Credit" }, - {0x10, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, - {0x10, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x03, 0x02, "Easy" }, - {0x11, 0x01, 0x03, 0x03, "Normal" }, - {0x11, 0x01, 0x03, 0x01, "Hard" }, - {0x11, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Disable Pedal" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Spacegunj) - -static struct BurnDIPInfo SpacegunuDIPList[]= -{ - // Default Values - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0xff, NULL }, - - // Dip 1 - {0 , 0xfe, 0 , 2 , "Always have gunsight power up" }, - {0x10, 0x01, 0x02, 0x02, "Off" }, - {0x10, 0x01, 0x02, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Service Mode" }, - {0x10, 0x01, 0x04, 0x04, "Off" }, - {0x10, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 2 , "Demo Sounds" }, - {0x10, 0x01, 0x08, 0x00, "Off" }, - {0x10, 0x01, 0x08, 0x08, "On" }, - - {0 , 0xfe, 0 , 4 , "Coinage" }, - {0x10, 0x01, 0x30, 0x00, "4 Coins 1 Credit" }, - {0x10, 0x01, 0x30, 0x10, "3 Coins 1 Credit" }, - {0x10, 0x01, 0x30, 0x20, "2 Coins 1 Credit" }, - {0x10, 0x01, 0x30, 0x30, "1 Coin 1 Credit" }, - - {0 , 0xfe, 0 , 4 , "Price to Continue" }, - {0x10, 0x01, 0xc0, 0x00, "3 Coins 1 Credit" }, - {0x10, 0x01, 0xc0, 0x40, "2 Coins 1 Credit" }, - {0x10, 0x01, 0xc0, 0x80, "1 Coin 1 Credit" }, - {0x10, 0x01, 0xc0, 0xc0, "Same as Start" }, - - // Dip 2 - {0 , 0xfe, 0 , 4 , "Difficulty" }, - {0x11, 0x01, 0x03, 0x02, "Easy" }, - {0x11, 0x01, 0x03, 0x03, "Normal" }, - {0x11, 0x01, 0x03, 0x01, "Hard" }, - {0x11, 0x01, 0x03, 0x00, "Hardest" }, - - {0 , 0xfe, 0 , 2 , "Allow Continue" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2 , "Disable Pedal" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, -}; - -STDDIPINFO(Spacegunu) - -static struct BurnRomInfo AquajackRomDesc[] = { - { "b77-22.ic31", 0x20000, 0x67400dde, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b77-26.ic17", 0x20000, 0xcd4d0969, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b77-24.ic69", 0x20000, 0x95e643ed, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b77-23.ic67", 0x20000, 0x395a7d1c, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b77-20.ic54", 0x10000, 0x84ba54b7, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b77-05.ic105", 0x80000, 0x7238f0ff, BRF_GRA | TAITO_CHARS }, - - { "b77-04.ic16", 0x80000, 0xbed0be6c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b77-03.ic15", 0x80000, 0x9a3030a7, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b77-02.ic14", 0x80000, 0xdaea0d2e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b77-01.ic13", 0x80000, 0xcdab000d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b77-07.ic33", 0x80000, 0x7db1fc5e, BRF_GRA | TAITO_ROAD }, - - { "b77-06.ic39", 0x80000, 0xce2aed00, BRF_GRA | TAITO_SPRITEMAP }, - - { "b77-09.ic58", 0x80000, 0x948e5ad9, BRF_SND | TAITO_YM2610A }, - - { "b77-08.ic57", 0x80000, 0x119b9485, BRF_SND | TAITO_YM2610B }, - - { "b77-17.ic1", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b77-18.ic37", 0x00100, 0x7b7d8ff4, BRF_OPT }, -}; - -STD_ROM_PICK(Aquajack) -STD_ROM_FN(Aquajack) - -static struct BurnRomInfo AquajackuRomDesc[] = { - { "b77-22.ic31", 0x20000, 0x67400dde, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b77-25.ic17", 0x20000, 0xba4a39ff, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b77-24.ic69", 0x20000, 0x95e643ed, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b77-23.ic67", 0x20000, 0x395a7d1c, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b77-20.ic54", 0x10000, 0x84ba54b7, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b77-05.ic105", 0x80000, 0x7238f0ff, BRF_GRA | TAITO_CHARS }, - - { "b77-04.ic16", 0x80000, 0xbed0be6c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b77-03.ic15", 0x80000, 0x9a3030a7, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b77-02.ic14", 0x80000, 0xdaea0d2e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b77-01.ic13", 0x80000, 0xcdab000d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b77-07.ic33", 0x80000, 0x7db1fc5e, BRF_GRA | TAITO_ROAD }, - - { "b77-06.ic39", 0x80000, 0xce2aed00, BRF_GRA | TAITO_SPRITEMAP }, - - { "b77-09.ic58", 0x80000, 0x948e5ad9, BRF_SND | TAITO_YM2610A }, - - { "b77-08.ic57", 0x80000, 0x119b9485, BRF_SND | TAITO_YM2610B }, - - { "b77-17.ic1", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b77-18.ic37", 0x00100, 0x7b7d8ff4, BRF_OPT }, -}; - -STD_ROM_PICK(Aquajacku) -STD_ROM_FN(Aquajacku) - -static struct BurnRomInfo AquajackjRomDesc[] = { - { "b77-22.ic31", 0x20000, 0x67400dde, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b77-21.ic17", 0x20000, 0x23436845, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b77-24.ic69", 0x20000, 0x95e643ed, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b77-23.ic67", 0x20000, 0x395a7d1c, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b77-20.ic54", 0x10000, 0x84ba54b7, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b77-05.ic105", 0x80000, 0x7238f0ff, BRF_GRA | TAITO_CHARS }, - - { "b77-04.ic16", 0x80000, 0xbed0be6c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b77-03.ic15", 0x80000, 0x9a3030a7, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b77-02.ic14", 0x80000, 0xdaea0d2e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b77-01.ic13", 0x80000, 0xcdab000d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b77-07.ic33", 0x80000, 0x7db1fc5e, BRF_GRA | TAITO_ROAD }, - - { "b77-06.ic39", 0x80000, 0xce2aed00, BRF_GRA | TAITO_SPRITEMAP }, - - { "b77-09.ic58", 0x80000, 0x948e5ad9, BRF_SND | TAITO_YM2610A }, - - { "b77-08.ic57", 0x80000, 0x119b9485, BRF_SND | TAITO_YM2610B }, - - { "b77-17.ic1", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b77-18.ic37", 0x00100, 0x7b7d8ff4, BRF_OPT }, -}; - -STD_ROM_PICK(Aquajackj) -STD_ROM_FN(Aquajackj) - -static struct BurnRomInfo BsharkRomDesc[] = { - { "c34_71.98", 0x20000, 0xdf1fa629, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_69.75", 0x20000, 0xa54c137a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_70.97", 0x20000, 0xd77d81e2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_68.74", 0x20000, 0x4e374ce2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c34_74.128", 0x20000, 0x6869fa99, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_72.112", 0x20000, 0xc09c0f91, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_75.129", 0x20000, 0x6ba65542, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_73.113", 0x20000, 0xf2fe62b5, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c34_05.3", 0x80000, 0x596b83da, BRF_GRA | TAITO_CHARS }, - - { "c34_04.17", 0x80000, 0x2446b0da, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_03.16", 0x80000, 0xa18eab78, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_02.15", 0x80000, 0x8488ba10, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_01.14", 0x80000, 0x3ebe8c63, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c34_07.42", 0x80000, 0xedb07808, BRF_GRA | TAITO_ROAD }, - - { "c34_06.12", 0x80000, 0xd200b6eb, BRF_GRA | TAITO_SPRITEMAP }, - - { "c34_08.127", 0x80000, 0x89a30450, BRF_SND | TAITO_YM2610A }, - - { "c34_09.126", 0x80000, 0x39d12b50, BRF_SND | TAITO_YM2610B }, - - { "c34_18.22", 0x10000, 0x7245a6f6, BRF_OPT }, - { "c34_19.72", 0x00100, 0x2ee9c404, BRF_OPT }, - { "c34_20.89", 0x00100, 0xfbf81f30, BRF_OPT }, - { "c34_21.7", 0x00400, 0x10728853, BRF_OPT }, - { "c34_22.8", 0x00400, 0x643e8bfc, BRF_OPT }, -}; - -STD_ROM_PICK(Bshark) -STD_ROM_FN(Bshark) - -static struct BurnRomInfo BsharkjRomDesc[] = { - { "c34_71.98", 0x20000, 0xdf1fa629, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_69.75", 0x20000, 0xa54c137a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_70.97", 0x20000, 0xd77d81e2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_66.74", 0x20000, 0xa0392dce, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c34_74.128", 0x20000, 0x6869fa99, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_72.112", 0x20000, 0xc09c0f91, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_75.129", 0x20000, 0x6ba65542, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_73.113", 0x20000, 0xf2fe62b5, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c34_05.3", 0x80000, 0x596b83da, BRF_GRA | TAITO_CHARS }, - - { "c34_04.17", 0x80000, 0x2446b0da, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_03.16", 0x80000, 0xa18eab78, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_02.15", 0x80000, 0x8488ba10, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_01.14", 0x80000, 0x3ebe8c63, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c34_07.42", 0x80000, 0xedb07808, BRF_GRA | TAITO_ROAD }, - - { "c34_06.12", 0x80000, 0xd200b6eb, BRF_GRA | TAITO_SPRITEMAP }, - - { "c34_08.127", 0x80000, 0x89a30450, BRF_SND | TAITO_YM2610A }, - - { "c34_09.126", 0x80000, 0x39d12b50, BRF_SND | TAITO_YM2610B }, - - { "c34_18.22", 0x10000, 0x7245a6f6, BRF_OPT }, - { "c34_19.72", 0x00100, 0x2ee9c404, BRF_OPT }, - { "c34_20.89", 0x00100, 0xfbf81f30, BRF_OPT }, - { "c34_21.7", 0x00400, 0x10728853, BRF_OPT }, - { "c34_22.8", 0x00400, 0x643e8bfc, BRF_OPT }, -}; - -STD_ROM_PICK(Bsharkj) -STD_ROM_FN(Bsharkj) - -static struct BurnRomInfo BsharkjjsRomDesc[] = { - { "c34_79.98", 0x20000, 0xbc3f2e93, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_77.75", 0x20000, 0x917916d0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_78.97", 0x20000, 0xf2fcc880, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_76.74", 0x20000, 0xde97fac0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c34_82.128", 0x20000, 0x6869fa99, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_80.112", 0x20000, 0xe1783eb4, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_83.129", 0x20000, 0xeec0b364, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_81.113", 0x20000, 0x23ce6bcf, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c34_05.3", 0x80000, 0x596b83da, BRF_GRA | TAITO_CHARS }, - - { "c34_04.17", 0x80000, 0x2446b0da, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_03.16", 0x80000, 0xa18eab78, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_02.15", 0x80000, 0x8488ba10, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_01.14", 0x80000, 0x3ebe8c63, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c34_07.42", 0x80000, 0xedb07808, BRF_GRA | TAITO_ROAD }, - - { "c34_06.12", 0x80000, 0xd200b6eb, BRF_GRA | TAITO_SPRITEMAP }, - - { "c34_08.127", 0x80000, 0x89a30450, BRF_SND | TAITO_YM2610A }, - - { "c34_09.126", 0x80000, 0x39d12b50, BRF_SND | TAITO_YM2610B }, - - { "c34_18.22", 0x10000, 0x7245a6f6, BRF_OPT }, - { "c34_19.72", 0x00100, 0x2ee9c404, BRF_OPT }, - { "c34_20.89", 0x00100, 0xfbf81f30, BRF_OPT }, - { "c34_21.7", 0x00400, 0x10728853, BRF_OPT }, - { "c34_22.8", 0x00400, 0x643e8bfc, BRF_OPT }, -}; - -STD_ROM_PICK(Bsharkjjs) -STD_ROM_FN(Bsharkjjs) - -static struct BurnRomInfo BsharkuRomDesc[] = { - { "c34_71.98", 0x20000, 0xdf1fa629, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_69.75", 0x20000, 0xa54c137a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_70.97", 0x20000, 0xd77d81e2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c34_67.74", 0x20000, 0x39307c74, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c34_74.128", 0x20000, 0x6869fa99, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_72.112", 0x20000, 0xc09c0f91, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_75.129", 0x20000, 0x6ba65542, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c34_73.113", 0x20000, 0xf2fe62b5, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c34_05.3", 0x80000, 0x596b83da, BRF_GRA | TAITO_CHARS }, - - { "c34_04.17", 0x80000, 0x2446b0da, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_03.16", 0x80000, 0xa18eab78, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_02.15", 0x80000, 0x8488ba10, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c34_01.14", 0x80000, 0x3ebe8c63, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c34_07.42", 0x80000, 0xedb07808, BRF_GRA | TAITO_ROAD }, - - { "c34_06.12", 0x80000, 0xd200b6eb, BRF_GRA | TAITO_SPRITEMAP }, - - { "c34_08.127", 0x80000, 0x89a30450, BRF_SND | TAITO_YM2610A }, - - { "c34_09.126", 0x80000, 0x39d12b50, BRF_SND | TAITO_YM2610B }, - - { "c34_18.22", 0x10000, 0x7245a6f6, BRF_OPT }, - { "c34_19.72", 0x00100, 0x2ee9c404, BRF_OPT }, - { "c34_20.89", 0x00100, 0xfbf81f30, BRF_OPT }, - { "c34_21.7", 0x00400, 0x10728853, BRF_OPT }, - { "c34_22.8", 0x00400, 0x643e8bfc, BRF_OPT }, -}; - -STD_ROM_PICK(Bsharku) -STD_ROM_FN(Bsharku) - -static struct BurnRomInfo ChasehqRomDesc[] = { - { "b52-130.36", 0x20000, 0x4e7beb46, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-136.29", 0x20000, 0x2f414df0, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-131.37", 0x20000, 0xaa945d83, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-129.30", 0x20000, 0x0eaebc08, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b52-132.39", 0x10000, 0xa2f54789, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b52-133.55", 0x10000, 0x12232f95, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b52-137.51", 0x10000, 0x37abb74a, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b52-29.27", 0x80000, 0x8366d27c, BRF_GRA | TAITO_CHARS}, - - { "b52-34.5", 0x80000, 0x7d8dce36, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-35.7", 0x80000, 0x78eeec0d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-36.9", 0x80000, 0x61e89e91, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-37.11", 0x80000, 0xf02e47b9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b52-30.4", 0x80000, 0x1b8cc647, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-31.6", 0x80000, 0xf1998e20, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-32.8", 0x80000, 0x8620780c, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-33.10", 0x80000, 0xe6f4b8c4, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - - { "b52-28.4", 0x80000, 0x963bc82b, BRF_GRA | TAITO_ROAD }, - - { "b52-38.34", 0x80000, 0x5b5bf7f6, BRF_GRA | TAITO_SPRITEMAP }, - - { "b52-115.71", 0x80000, 0x4e117e93, BRF_SND | TAITO_YM2610A }, - { "b52-114.72", 0x80000, 0x3a73d6b1, BRF_SND | TAITO_YM2610A }, - { "b52-113.73", 0x80000, 0x2c6a3a05, BRF_SND | TAITO_YM2610A }, - - { "b52-116.70", 0x80000, 0xad46983c, BRF_SND | TAITO_YM2610B }, - - { "b52-01.7", 0x00100, 0x89719d17, BRF_OPT }, - { "b52-03.135", 0x00400, 0xa3f8490d, BRF_OPT }, - { "b52-06.24", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b52-18.93", 0x00100, 0x60bdaf1a, BRF_OPT }, - { "b52-18a", 0x00100, 0x6271be0d, BRF_OPT }, - { "b52-49.68", 0x02000, 0x60dd2ed1, BRF_OPT }, - { "b52-50.66", 0x10000, 0xc189781c, BRF_OPT }, - { "b52-51.65", 0x10000, 0x30cc1f79, BRF_OPT }, - { "b52-126.136", 0x00400, 0xfa2f840e, BRF_OPT }, - { "b52-127.156", 0x00400, 0x77682a4f, BRF_OPT }, - - { "pal20l8b-b52-17.ic18", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic16", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic53", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic55", 0x00144, 0x4851316d, BRF_OPT }, - { "pal16l8b-b52-19.ic33", 0x00104, 0x3ba292dc, BRF_OPT }, - { "pal16l8b-b52-20.ic35", 0x00104, 0xbd39ad73, BRF_OPT }, - { "pal16l8b-b52-21.ic51", 0x00104, 0x2fe76aa4, BRF_OPT }, - { "pal20l8b-b52-25.ic123", 0x00144, 0x372b632d, BRF_OPT }, - { "pal20l8b-b52-26.ic15", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic18", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic52", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic54", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-27.ic64", 0x00144, 0x61c2ab26, BRF_OPT }, - { "pal20l8b-b52-118.ic20", 0x00144, 0x9c5fe4af, BRF_OPT }, - { "pal20l8b-b52-119.ic21", 0x00144, 0x8b8e2106, BRF_OPT }, - { "pal16l8b-b52-120.ic56", 0x00104, 0x3e7effa0, BRF_OPT }, - { "pal20l8b-b52-121.ic57", 0x00144, 0x7056fd1d, BRF_OPT }, - { "pal16l8b-b52-122.ic124", 0x00104, 0x04c0fb04, BRF_OPT }, - { "pal16l8b-b52-123.ic125", 0x00104, 0x3865d1c8, BRF_OPT }, - { "pal16l8b-b52-124.ic180", 0x00104, 0xd448a25a, BRF_OPT }, - { "pal16l8b-b52-125.ic112", 0x00104, 0x7628c557, BRF_OPT }, -}; - -STD_ROM_PICK(Chasehq) -STD_ROM_FN(Chasehq) - -static struct BurnRomInfo ChasehqjRomDesc[] = { - { "b52-140.36", 0x20000, 0xc1298a4b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-139.29", 0x20000, 0x997f732e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-131.37", 0x20000, 0xaa945d83, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-129.30", 0x20000, 0x0eaebc08, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b52-132.39", 0x10000, 0xa2f54789, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b52-133.55", 0x10000, 0x12232f95, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b52-134.51", 0x10000, 0x91faac7f, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b52-29.27", 0x80000, 0x8366d27c, BRF_GRA | TAITO_CHARS }, - - { "b52-34.5", 0x80000, 0x7d8dce36, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-35.7", 0x80000, 0x78eeec0d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-36.9", 0x80000, 0x61e89e91, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-37.11", 0x80000, 0xf02e47b9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b52-30.4", 0x80000, 0x1b8cc647, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-31.6", 0x80000, 0xf1998e20, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-32.8", 0x80000, 0x8620780c, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-33.10", 0x80000, 0xe6f4b8c4, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - - { "b52-28.4", 0x80000, 0x963bc82b, BRF_GRA | TAITO_ROAD }, - - { "b52-38.34", 0x80000, 0x5b5bf7f6, BRF_GRA | TAITO_SPRITEMAP }, - - { "b52-41.71", 0x80000, 0x8204880c, BRF_SND | TAITO_YM2610A }, - { "b52-40.72", 0x80000, 0xf0551055, BRF_SND | TAITO_YM2610A }, - { "b52-39.73", 0x80000, 0xac9cbbd3, BRF_SND | TAITO_YM2610A }, - - { "b52-42.70", 0x80000, 0x6e617df1, BRF_SND | TAITO_YM2610B }, - - { "b52-01.7", 0x00100, 0x89719d17, BRF_OPT }, - { "b52-03.135", 0x00400, 0xa3f8490d, BRF_OPT }, - { "b52-06.24", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b52-18.93", 0x00100, 0x60bdaf1a, BRF_OPT }, - { "b52-18a", 0x00100, 0x6271be0d, BRF_OPT }, - { "b52-49.68", 0x02000, 0x60dd2ed1, BRF_OPT }, - { "b52-50.66", 0x10000, 0xc189781c, BRF_OPT }, - { "b52-51.65", 0x10000, 0x30cc1f79, BRF_OPT }, - { "b52-126.136", 0x00400, 0xfa2f840e, BRF_OPT }, - { "b52-127.156", 0x00400, 0x77682a4f, BRF_OPT }, - - { "pal20l8b-b52-17.ic18", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic16", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic53", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic55", 0x00144, 0x4851316d, BRF_OPT }, - { "pal16l8b-b52-19.ic33", 0x00104, 0x3ba292dc, BRF_OPT }, - { "pal16l8b-b52-20.ic35", 0x00104, 0xbd39ad73, BRF_OPT }, - { "pal16l8b-b52-21.ic51", 0x00104, 0x2fe76aa4, BRF_OPT }, - { "pal20l8b-b52-25.ic123", 0x00144, 0x372b632d, BRF_OPT }, - { "pal20l8b-b52-26.ic15", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic18", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic52", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic54", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-27.ic64", 0x00144, 0x61c2ab26, BRF_OPT }, - { "pal20l8b-b52-118.ic20", 0x00144, 0x9c5fe4af, BRF_OPT }, - { "pal20l8b-b52-119.ic21", 0x00144, 0x8b8e2106, BRF_OPT }, - { "pal16l8b-b52-120.ic56", 0x00104, 0x3e7effa0, BRF_OPT }, - { "pal20l8b-b52-121.ic57", 0x00144, 0x7056fd1d, BRF_OPT }, - { "pal16l8b-b52-122.ic124", 0x00104, 0x04c0fb04, BRF_OPT }, - { "pal16l8b-b52-123.ic125", 0x00104, 0x3865d1c8, BRF_OPT }, - { "pal16l8b-b52-124.ic180", 0x00104, 0xd448a25a, BRF_OPT }, - { "pal16l8b-b52-125.ic112", 0x00104, 0x7628c557, BRF_OPT }, -}; - -STD_ROM_PICK(Chasehqj) -STD_ROM_FN(Chasehqj) - -static struct BurnRomInfo ChasehqjuRomDesc[] = { - { "b52-130.36", 0x20000, 0x4e7beb46, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-128.29", 0x20000, 0xc14f2cdc, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-131.37", 0x20000, 0xaa945d83, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-129.30", 0x20000, 0x0eaebc08, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b52-132.39", 0x10000, 0xa2f54789, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b52-133.55", 0x10000, 0x12232f95, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b52-134.51", 0x10000, 0x91faac7f, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b52-29.27", 0x80000, 0x8366d27c, BRF_GRA | TAITO_CHARS }, - - { "b52-34.5", 0x80000, 0x7d8dce36, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-35.7", 0x80000, 0x78eeec0d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-36.9", 0x80000, 0x61e89e91, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-37.11", 0x80000, 0xf02e47b9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b52-30.4", 0x80000, 0x1b8cc647, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-31.6", 0x80000, 0xf1998e20, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-32.8", 0x80000, 0x8620780c, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-33.10", 0x80000, 0xe6f4b8c4, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - - { "b52-28.4", 0x80000, 0x963bc82b, BRF_GRA | TAITO_ROAD }, - - { "b52-38.34", 0x80000, 0x5b5bf7f6, BRF_GRA | TAITO_SPRITEMAP }, - - { "b52-41.71", 0x80000, 0x8204880c, BRF_SND | TAITO_YM2610A }, - { "b52-40.72", 0x80000, 0xf0551055, BRF_SND | TAITO_YM2610A }, - { "b52-39.73", 0x80000, 0xac9cbbd3, BRF_SND | TAITO_YM2610A }, - - { "b52-42.70", 0x80000, 0x6e617df1, BRF_SND | TAITO_YM2610B }, - - { "b52-01.7", 0x00100, 0x89719d17, BRF_OPT }, - { "b52-03.135", 0x00400, 0xa3f8490d, BRF_OPT }, - { "b52-06.24", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b52-18.93", 0x00100, 0x60bdaf1a, BRF_OPT }, - { "b52-18a", 0x00100, 0x6271be0d, BRF_OPT }, - { "b52-49.68", 0x02000, 0x60dd2ed1, BRF_OPT }, - { "b52-50.66", 0x10000, 0xc189781c, BRF_OPT }, - { "b52-51.65", 0x10000, 0x30cc1f79, BRF_OPT }, - { "b52-126.136", 0x00400, 0xfa2f840e, BRF_OPT }, - { "b52-127.156", 0x00400, 0x77682a4f, BRF_OPT }, - - { "pal20l8b-b52-17.ic18", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic16", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic53", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic55", 0x00144, 0x4851316d, BRF_OPT }, - { "pal16l8b-b52-19.ic33", 0x00104, 0x3ba292dc, BRF_OPT }, - { "pal16l8b-b52-20.ic35", 0x00104, 0xbd39ad73, BRF_OPT }, - { "pal16l8b-b52-21.ic51", 0x00104, 0x2fe76aa4, BRF_OPT }, - { "pal20l8b-b52-25.ic123", 0x00144, 0x372b632d, BRF_OPT }, - { "pal20l8b-b52-26.ic15", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic18", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic52", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic54", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-27.ic64", 0x00144, 0x61c2ab26, BRF_OPT }, - { "pal20l8b-b52-118.ic20", 0x00144, 0x9c5fe4af, BRF_OPT }, - { "pal20l8b-b52-119.ic21", 0x00144, 0x8b8e2106, BRF_OPT }, - { "pal16l8b-b52-120.ic56", 0x00104, 0x3e7effa0, BRF_OPT }, - { "pal20l8b-b52-121.ic57", 0x00144, 0x7056fd1d, BRF_OPT }, - { "pal16l8b-b52-122.ic124", 0x00104, 0x04c0fb04, BRF_OPT }, - { "pal16l8b-b52-123.ic125", 0x00104, 0x3865d1c8, BRF_OPT }, - { "pal16l8b-b52-124.ic180", 0x00104, 0xd448a25a, BRF_OPT }, - { "pal16l8b-b52-125.ic112", 0x00104, 0x7628c557, BRF_OPT }, -}; - -STD_ROM_PICK(Chasehqju) -STD_ROM_FN(Chasehqju) - -static struct BurnRomInfo ChasehquRomDesc[] = { - { "b52-138.36", 0x20000, 0x8b71fe51, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-135.29", 0x20000, 0x5ba56a7c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-131.37", 0x20000, 0xaa945d83, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b52-129.30", 0x20000, 0x0eaebc08, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b52-132.39", 0x10000, 0xa2f54789, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b52-133.55", 0x10000, 0x12232f95, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b52-137.51", 0x10000, 0x37abb74a, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b52-29.27", 0x80000, 0x8366d27c, BRF_GRA | TAITO_CHARS}, - - { "b52-34.5", 0x80000, 0x7d8dce36, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-35.7", 0x80000, 0x78eeec0d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-36.9", 0x80000, 0x61e89e91, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b52-37.11", 0x80000, 0xf02e47b9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b52-30.4", 0x80000, 0x1b8cc647, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-31.6", 0x80000, 0xf1998e20, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-32.8", 0x80000, 0x8620780c, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b52-33.10", 0x80000, 0xe6f4b8c4, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - - { "b52-28.4", 0x80000, 0x963bc82b, BRF_GRA | TAITO_ROAD }, - - { "b52-38.34", 0x80000, 0x5b5bf7f6, BRF_GRA | TAITO_SPRITEMAP }, - - { "b52-115.71", 0x80000, 0x4e117e93, BRF_SND | TAITO_YM2610A }, - { "b52-114.72", 0x80000, 0x3a73d6b1, BRF_SND | TAITO_YM2610A }, - { "b52-113.73", 0x80000, 0x2c6a3a05, BRF_SND | TAITO_YM2610A }, - - { "b52-116.70", 0x80000, 0xad46983c, BRF_SND | TAITO_YM2610B }, - - { "b52-01.7", 0x00100, 0x89719d17, BRF_OPT }, - { "b52-03.135", 0x00400, 0xa3f8490d, BRF_OPT }, - { "b52-06.24", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b52-18.93", 0x00100, 0x60bdaf1a, BRF_OPT }, - { "b52-18a", 0x00100, 0x6271be0d, BRF_OPT }, - { "b52-49.68", 0x02000, 0x60dd2ed1, BRF_OPT }, - { "b52-50.66", 0x10000, 0xc189781c, BRF_OPT }, - { "b52-51.65", 0x10000, 0x30cc1f79, BRF_OPT }, - { "b52-126.136", 0x00400, 0xfa2f840e, BRF_OPT }, - { "b52-127.156", 0x00400, 0x77682a4f, BRF_OPT }, - - { "pal20l8b-b52-17.ic18", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic16", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic53", 0x00144, 0x4851316d, BRF_OPT }, - { "pal20l8b-b52-17.ic55", 0x00144, 0x4851316d, BRF_OPT }, - { "pal16l8b-b52-19.ic33", 0x00104, 0x3ba292dc, BRF_OPT }, - { "pal16l8b-b52-20.ic35", 0x00104, 0xbd39ad73, BRF_OPT }, - { "pal16l8b-b52-21.ic51", 0x00104, 0x2fe76aa4, BRF_OPT }, - { "pal20l8b-b52-25.ic123", 0x00144, 0x372b632d, BRF_OPT }, - { "pal20l8b-b52-26.ic15", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic18", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic52", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-26.ic54", 0x00144, 0xd94f2bc2, BRF_OPT }, - { "pal20l8b-b52-27.ic64", 0x00144, 0x61c2ab26, BRF_OPT }, - { "pal20l8b-b52-118.ic20", 0x00144, 0x9c5fe4af, BRF_OPT }, - { "pal20l8b-b52-119.ic21", 0x00144, 0x8b8e2106, BRF_OPT }, - { "pal16l8b-b52-120.ic56", 0x00104, 0x3e7effa0, BRF_OPT }, - { "pal20l8b-b52-121.ic57", 0x00144, 0x7056fd1d, BRF_OPT }, - { "pal16l8b-b52-122.ic124", 0x00104, 0x04c0fb04, BRF_OPT }, - { "pal16l8b-b52-123.ic125", 0x00104, 0x3865d1c8, BRF_OPT }, - { "pal16l8b-b52-124.ic180", 0x00104, 0xd448a25a, BRF_OPT }, - { "pal16l8b-b52-125.ic112", 0x00104, 0x7628c557, BRF_OPT }, -}; - -STD_ROM_PICK(Chasehqu) -STD_ROM_FN(Chasehqu) - -static struct BurnRomInfo ContcircRomDesc[] = { - { "b33-ww.ic25", 0x20000, 0xf5c92e42, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b33-xx.ic26", 0x20000, 0xe7c1d1fa, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b33-yy.ic35", 0x20000, 0x16522f2d, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "cc_36.bin", 0x20000, 0xa1732ea5, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b33-30.11", 0x10000, 0xd8746234, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b33-02.57", 0x80000, 0xf6fb3ba2, BRF_GRA | TAITO_CHARS }, - - { "b33-06", 0x80000, 0x2cb40599, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-05", 0x80000, 0xbddf9eea, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-04", 0x80000, 0x8df866a2, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-03", 0x80000, 0x4f6c36d9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b33-01.3", 0x80000, 0xf11f2be8, BRF_GRA | TAITO_ROAD }, - - { "b33-07.64", 0x80000, 0x151e1f52, BRF_GRA | TAITO_SPRITEMAP }, - - { "b33-09.18", 0x80000, 0x1e6724b5, BRF_SND | TAITO_YM2610A }, - { "b33-10.17", 0x80000, 0xe9ce03ab, BRF_SND | TAITO_YM2610A }, - - { "b33-08.19", 0x80000, 0xcaa1c4c8, BRF_SND | TAITO_YM2610B }, - - { "b14-30.97", 0x10000, 0xdccb0c7f, BRF_OPT }, - { "b14-31.50", 0x02000, 0x5c6b013d, BRF_OPT }, - { "b33-17.16", 0x00100, 0x7b7d8ff4, BRF_OPT }, - { "b33-18.17", 0x00100, 0xfbf81f30, BRF_OPT }, -}; - -STD_ROM_PICK(Contcirc) -STD_ROM_FN(Contcirc) - -static struct BurnRomInfo ContcircuRomDesc[] = { - { "b33-ww.ic25", 0x20000, 0xf5c92e42, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b33-xx.ic26", 0x20000, 0xe7c1d1fa, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b33-yy.ic35", 0x20000, 0x16522f2d, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b33-zz.ic36", 0x20000, 0xd6741e33, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b33-30.11", 0x10000, 0xd8746234, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b33-02.57", 0x80000, 0xf6fb3ba2, BRF_GRA | TAITO_CHARS }, - - { "b33-06", 0x80000, 0x2cb40599, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-05", 0x80000, 0xbddf9eea, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-04", 0x80000, 0x8df866a2, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-03", 0x80000, 0x4f6c36d9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b33-01.3", 0x80000, 0xf11f2be8, BRF_GRA | TAITO_ROAD }, - - { "b33-07.64", 0x80000, 0x151e1f52, BRF_GRA | TAITO_SPRITEMAP }, - - { "b33-09.18", 0x80000, 0x1e6724b5, BRF_SND | TAITO_YM2610A }, - { "b33-10.17", 0x80000, 0xe9ce03ab, BRF_SND | TAITO_YM2610A }, - - { "b33-08.19", 0x80000, 0xcaa1c4c8, BRF_SND | TAITO_YM2610B }, - - { "b14-30.97", 0x10000, 0xdccb0c7f, BRF_OPT }, - { "b14-31.50", 0x02000, 0x5c6b013d, BRF_OPT }, - { "b33-17.16", 0x00100, 0x7b7d8ff4, BRF_OPT }, - { "b33-18.17", 0x00100, 0xfbf81f30, BRF_OPT }, -}; - -STD_ROM_PICK(Contcircu) -STD_ROM_FN(Contcircu) - -static struct BurnRomInfo ContcircuaRomDesc[] = { - { "b33-34.ic25", 0x20000, 0xe1e016c1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b33-33.ic26", 0x20000, 0xf539d44b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b33-21-2.ic35", 0x20000, 0x2723f9e3, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b33-31-1.ic36", 0x20000, 0x438431f7, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b33-30.11", 0x10000, 0xd8746234, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b33-02.57", 0x80000, 0xf6fb3ba2, BRF_GRA | TAITO_CHARS }, - - { "b33-06", 0x80000, 0x2cb40599, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-05", 0x80000, 0xbddf9eea, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-04", 0x80000, 0x8df866a2, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-03", 0x80000, 0x4f6c36d9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b33-01.3", 0x80000, 0xf11f2be8, BRF_GRA | TAITO_ROAD }, - - { "b33-07.64", 0x80000, 0x151e1f52, BRF_GRA | TAITO_SPRITEMAP }, - - { "b33-09.18", 0x80000, 0x1e6724b5, BRF_SND | TAITO_YM2610A }, - { "b33-10.17", 0x80000, 0xe9ce03ab, BRF_SND | TAITO_YM2610A }, - - { "b33-08.19", 0x80000, 0xcaa1c4c8, BRF_SND | TAITO_YM2610B }, - - { "b14-30.97", 0x10000, 0xdccb0c7f, BRF_OPT }, - { "b14-31.50", 0x02000, 0x5c6b013d, BRF_OPT }, - { "b33-17.16", 0x00100, 0x7b7d8ff4, BRF_OPT }, - { "b33-18.17", 0x00100, 0xfbf81f30, BRF_OPT }, -}; - -STD_ROM_PICK(Contcircua) -STD_ROM_FN(Contcircua) - -static struct BurnRomInfo ContcircjRomDesc[] = { - { "b33-19.ic25", 0x20000, 0xb85360c8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b33-20.ic26", 0x20000, 0x9f88378b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b33-21-2.ic35", 0x20000, 0x2723f9e3, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b33-22-2.ic36", 0x20000, 0xda8d604d, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b33-30.11", 0x10000, 0xd8746234, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b33-02.57", 0x80000, 0xf6fb3ba2, BRF_GRA | TAITO_CHARS }, - - { "b33-06", 0x80000, 0x2cb40599, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-05", 0x80000, 0xbddf9eea, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-04", 0x80000, 0x8df866a2, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b33-03", 0x80000, 0x4f6c36d9, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b33-01.3", 0x80000, 0xf11f2be8, BRF_GRA | TAITO_ROAD }, - - { "b33-07.64", 0x80000, 0x151e1f52, BRF_GRA | TAITO_SPRITEMAP }, - - { "b33-09.18", 0x80000, 0x1e6724b5, BRF_SND | TAITO_YM2610A }, - { "b33-10.17", 0x80000, 0xe9ce03ab, BRF_SND | TAITO_YM2610A }, - - { "b33-08.19", 0x80000, 0xcaa1c4c8, BRF_SND | TAITO_YM2610B }, - - { "b14-30.97", 0x10000, 0xdccb0c7f, BRF_OPT }, - { "b14-31.50", 0x02000, 0x5c6b013d, BRF_OPT }, - { "b33-17.16", 0x00100, 0x7b7d8ff4, BRF_OPT }, - { "b33-18.17", 0x00100, 0xfbf81f30, BRF_OPT }, -}; - -STD_ROM_PICK(Contcircj) -STD_ROM_FN(Contcircj) - -static struct BurnRomInfo DblaxleRomDesc[] = { - { "c78_49-1.2", 0x020000, 0xa6f0c631, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c78_51-1.4", 0x020000, 0xef24e83b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c78_50-1.3", 0x020000, 0x8b0440f4, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c78_53-1.5", 0x020000, 0x2bb91763, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c78-30-1.35", 0x020000, 0x026aac18, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c78-31-1.36", 0x020000, 0x67ce23e8, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c78-34.c42", 0x020000, 0xf2186943, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c78-10.12", 0x080000, 0x44b1897c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "c78-11.11", 0x080000, 0x7db3d4a3, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "c78-08.25", 0x100000, 0x6c725211, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c78-07.33", 0x100000, 0x9da00d5b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c78-06.23", 0x100000, 0x8309e91b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c78-05.31", 0x100000, 0x90001f68, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c78-09.12", 0x080000, 0x0dbde6f5, BRF_GRA | TAITO_ROAD }, - - { "c78-04.3", 0x080000, 0xcc1aa37c, BRF_GRA | TAITO_SPRITEMAP }, - - { "c78-12.33", 0x100000, 0xb0267404, BRF_SND | TAITO_YM2610A }, - { "c78-13.46", 0x080000, 0x1b363aa2, BRF_SND | TAITO_YM2610A }, - - { "c78-14.31", 0x080000, 0x9cad4dfb, BRF_SND | TAITO_YM2610B }, - - { "c78-25.15", 0x010000, 0x7245a6f6, BRF_OPT }, - { "c78-15.22", 0x000100, 0xfbf81f30, BRF_OPT }, - { "c78-21.74", 0x000100, 0x2926bf27, BRF_OPT }, - { "c84-10.16", 0x000400, 0x643e8bfc, BRF_OPT }, - { "c84-11.17", 0x000400, 0x10728853, BRF_OPT }, -}; - -STD_ROM_PICK(Dblaxle) -STD_ROM_FN(Dblaxle) - -static struct BurnRomInfo DblaxleuRomDesc[] = { - { "c78_41-1.2", 0x020000, 0xcf297fe4, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c78_43-1.4", 0x020000, 0x38a8bad6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c78_42-1.3", 0x020000, 0x4124ab2b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c78_44-1.5", 0x020000, 0x50a55b6e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c78-30-1.35", 0x020000, 0x026aac18, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c78-31-1.36", 0x020000, 0x67ce23e8, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c78-34.c42", 0x020000, 0xf2186943, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c78-10.12", 0x080000, 0x44b1897c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "c78-11.11", 0x080000, 0x7db3d4a3, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "c78-08.25", 0x100000, 0x6c725211, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c78-07.33", 0x100000, 0x9da00d5b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c78-06.23", 0x100000, 0x8309e91b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c78-05.31", 0x100000, 0x90001f68, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c78-09.12", 0x080000, 0x0dbde6f5, BRF_GRA | TAITO_ROAD }, - - { "c78-04.3", 0x080000, 0xcc1aa37c, BRF_GRA | TAITO_SPRITEMAP }, - - { "c78-12.33", 0x100000, 0xb0267404, BRF_SND | TAITO_YM2610A }, - { "c78-13.46", 0x080000, 0x1b363aa2, BRF_SND | TAITO_YM2610A }, - - { "c78-14.31", 0x080000, 0x9cad4dfb, BRF_SND | TAITO_YM2610B }, - - { "c78-25.15", 0x010000, 0x7245a6f6, BRF_OPT }, - { "c78-15.22", 0x000100, 0xfbf81f30, BRF_OPT }, - { "c78-21.74", 0x000100, 0x2926bf27, BRF_OPT }, - { "c84-10.16", 0x000400, 0x643e8bfc, BRF_OPT }, - { "c84-11.17", 0x000400, 0x10728853, BRF_OPT }, -}; - -STD_ROM_PICK(Dblaxleu) -STD_ROM_FN(Dblaxleu) - -static struct BurnRomInfo PwheelsjRomDesc[] = { - { "c78_26-2.2", 0x020000, 0x25c8eb2e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c78_28-2.4", 0x020000, 0xa9500eb1, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c78_27-2.3", 0x020000, 0x08d2cffb, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c78_29-2.5", 0x020000, 0xe1608004, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c78-30-1.35", 0x020000, 0x026aac18, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c78-31-1.36", 0x020000, 0x67ce23e8, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c78-32.42", 0x020000, 0x1494199c, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c78-10.12", 0x080000, 0x44b1897c, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "c78-11.11", 0x080000, 0x7db3d4a3, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "c78-08.25", 0x100000, 0x6c725211, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c78-07.33", 0x100000, 0x9da00d5b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c78-06.23", 0x100000, 0x8309e91b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c78-05.31", 0x100000, 0x90001f68, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c78-09.12", 0x080000, 0x0dbde6f5, BRF_GRA | TAITO_ROAD }, - - { "c78-04.3", 0x080000, 0xcc1aa37c, BRF_GRA | TAITO_SPRITEMAP }, - - { "c78-01.33", 0x100000, 0x90ff1e72, BRF_SND | TAITO_YM2610A }, - { "c78-02.46", 0x080000, 0x8882d2b7, BRF_SND | TAITO_YM2610A }, - - { "c78-03.31", 0x080000, 0x9b926a2f, BRF_SND | TAITO_YM2610B }, - - { "c78-25.15", 0x010000, 0x7245a6f6, BRF_OPT }, - { "c78-15.22", 0x000100, 0xfbf81f30, BRF_OPT }, - { "c78-21.74", 0x000100, 0x2926bf27, BRF_OPT }, - { "c84-10.16", 0x000400, 0x643e8bfc, BRF_OPT }, - { "c84-11.17", 0x000400, 0x10728853, BRF_OPT }, -}; - -STD_ROM_PICK(Pwheelsj) -STD_ROM_FN(Pwheelsj) - -static struct BurnRomInfo EnforceRomDesc[] = { - { "b58-38.27", 0x20000, 0xa1aa0191, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b58-36.19", 0x20000, 0x40f43da3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b58-37.26", 0x20000, 0xe823c85c, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b58-35.18", 0x20000, 0x8b3ceb12, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b58-32.41", 0x10000, 0xf3fd8eca, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b58-09.13", 0x80000, 0x9ffd5b31, BRF_GRA | TAITO_CHARS }, - - { "b58-04.7", 0x80000, 0x9482f08d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b58-03.6", 0x80000, 0x158bc440, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b58-02.2", 0x80000, 0x6a6e307c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b58-01.1", 0x80000, 0x01e9f0a8, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b58-06.116", 0x80000, 0xb3495d70, BRF_GRA | TAITO_ROAD }, - - { "b58-05.71", 0x80000, 0xd1f4991b, BRF_GRA | TAITO_SPRITEMAP }, - - { "b58-07.11", 0x80000, 0xeeb5ba08, BRF_SND | TAITO_YM2610A }, - { "b58-08.12", 0x80000, 0x049243cf, BRF_SND | TAITO_YM2610A }, - - { "b58-10.14", 0x80000, 0xedce0cc1, BRF_SND | TAITO_YM2610B }, - - { "b58-26.104", 0x10000, 0xdccb0c7f, BRF_OPT }, - { "b58-27.56", 0x02000, 0x5c6b013d, BRF_OPT }, - { "b58-23.52", 0x00100, 0x7b7d8ff4, BRF_OPT }, - { "b58-24.51", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b58-25.75", 0x00100, 0xde547342, BRF_OPT }, -}; - -STD_ROM_PICK(Enforce) -STD_ROM_FN(Enforce) - -static struct BurnRomInfo EnforcejRomDesc[] = { - { "b58-17.27", 0x20000, 0xa1aa0191, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b58-19.19", 0x20000, 0x40f43da3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b58-16.26", 0x20000, 0xe823c85c, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b58-18.18", 0x20000, 0x65328a3e, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b58-32.41", 0x10000, 0xf3fd8eca, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b58-09.13", 0x80000, 0x9ffd5b31, BRF_GRA | TAITO_CHARS }, - - { "b58-04.7", 0x80000, 0x9482f08d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b58-03.6", 0x80000, 0x158bc440, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b58-02.2", 0x80000, 0x6a6e307c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b58-01.1", 0x80000, 0x01e9f0a8, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b58-06.116", 0x80000, 0xb3495d70, BRF_GRA | TAITO_ROAD }, - - { "b58-05.71", 0x80000, 0xd1f4991b, BRF_GRA | TAITO_SPRITEMAP }, - - { "b58-07.11", 0x80000, 0xeeb5ba08, BRF_SND | TAITO_YM2610A }, - { "b58-08.12", 0x80000, 0x049243cf, BRF_SND | TAITO_YM2610A }, - - { "b58-10.14", 0x80000, 0xedce0cc1, BRF_SND | TAITO_YM2610B }, - - { "b58-26.104", 0x10000, 0xdccb0c7f, BRF_OPT }, - { "b58-27.56", 0x02000, 0x5c6b013d, BRF_OPT }, - { "b58-23.52", 0x00100, 0x7b7d8ff4, BRF_OPT }, - { "b58-24.51", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b58-25.75", 0x00100, 0xde547342, BRF_OPT }, -}; - -STD_ROM_PICK(Enforcej) -STD_ROM_FN(Enforcej) - -static struct BurnRomInfo EnforcejaRomDesc[] = { - { "b58-31.27", 0x20000, 0xd686e371, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b58-30.19", 0x20000, 0xcd73c0d8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b58-29.26", 0x20000, 0x8482a4e4, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b58-28.18", 0x20000, 0x9735e2b1, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b58-32.41", 0x10000, 0xf3fd8eca, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b58-09.13", 0x80000, 0x9ffd5b31, BRF_GRA | TAITO_CHARS }, - - { "b58-04.7", 0x80000, 0x9482f08d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b58-03.6", 0x80000, 0x158bc440, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b58-02.2", 0x80000, 0x6a6e307c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b58-01.1", 0x80000, 0x01e9f0a8, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b58-06.116", 0x80000, 0xb3495d70, BRF_GRA | TAITO_ROAD }, - - { "b58-05.71", 0x80000, 0xd1f4991b, BRF_GRA | TAITO_SPRITEMAP }, - - { "b58-07.11", 0x80000, 0xeeb5ba08, BRF_SND | TAITO_YM2610A }, - { "b58-08.12", 0x80000, 0x049243cf, BRF_SND | TAITO_YM2610A }, - - { "b58-10.14", 0x80000, 0xedce0cc1, BRF_SND | TAITO_YM2610B }, - - { "b58-26.104", 0x10000, 0xdccb0c7f, BRF_OPT }, - { "b58-27.56", 0x02000, 0x5c6b013d, BRF_OPT }, - { "b58-23.52", 0x00100, 0x7b7d8ff4, BRF_OPT }, - { "b58-24.51", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b58-25.75", 0x00100, 0xde547342, BRF_OPT }, -}; - -STD_ROM_PICK(Enforceja) -STD_ROM_FN(Enforceja) - -static struct BurnRomInfo NightstrRomDesc[] = { - { "b91-45.bin", 0x20000, 0x7ad63421, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b91-44.bin", 0x20000, 0x4bc30adf, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b91-43.bin", 0x20000, 0x3e6f727a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b91-47.bin", 0x20000, 0x9f778e03, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b91-39.bin", 0x20000, 0x725b23ae, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b91-40.bin", 0x20000, 0x81fb364d, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b91-41.bin", 0x20000, 0x2694bb42, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b91-11.bin", 0x80000, 0xfff8ce31, BRF_GRA | TAITO_CHARS }, - - { "b91-04.bin", 0x80000, 0x8ca1970d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b91-03.bin", 0x80000, 0xcd5fed39, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b91-02.bin", 0x80000, 0x457c64b8, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b91-01.bin", 0x80000, 0x3731d94f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b91-08.bin", 0x80000, 0x66f35c34, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b91-07.bin", 0x80000, 0x4d8ec6cf, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b91-06.bin", 0x80000, 0xa34dc839, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b91-05.bin", 0x80000, 0x5e72ac90, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - - { "b91-10.bin", 0x80000, 0x1d8f05b4, BRF_GRA | TAITO_ROAD }, - - { "b91-09.bin", 0x80000, 0x5f247ca2, BRF_GRA | TAITO_SPRITEMAP }, - - { "b91-13.bin", 0x80000, 0x8c7bf0f5, BRF_SND | TAITO_YM2610A }, - { "b91-12.bin", 0x80000, 0xda77c7af, BRF_SND | TAITO_YM2610A }, - - { "b91-14.bin", 0x80000, 0x6bc314d3, BRF_SND | TAITO_YM2610B }, - - { "b91-26.bin", 0x00400, 0x77682a4f, BRF_OPT }, - { "b91-27.bin", 0x00400, 0xa3f8490d, BRF_OPT }, - { "b91-28.bin", 0x00400, 0xfa2f840e, BRF_OPT }, - { "b91-29.bin", 0x02000, 0xad685be8, BRF_OPT }, - { "b91-30.bin", 0x10000, 0x30cc1f79, BRF_OPT }, - { "b91-31.bin", 0x10000, 0xc189781c, BRF_OPT }, - { "b91-32.bin", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b91-33.bin", 0x00100, 0x89719d17, BRF_OPT }, -}; - -STD_ROM_PICK(Nightstr) -STD_ROM_FN(Nightstr) - -static struct BurnRomInfo NightstrjRomDesc[] = { - { "b91-45.bin", 0x20000, 0x7ad63421, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b91-44.bin", 0x20000, 0x4bc30adf, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b91-43.bin", 0x20000, 0x3e6f727a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b91-42.bin", 0x20000, 0x7179ef2f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b91-39.bin", 0x20000, 0x725b23ae, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b91-40.bin", 0x20000, 0x81fb364d, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b91-41.bin", 0x20000, 0x2694bb42, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b91-11.bin", 0x80000, 0xfff8ce31, BRF_GRA | TAITO_CHARS }, - - { "b91-04.bin", 0x80000, 0x8ca1970d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b91-03.bin", 0x80000, 0xcd5fed39, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b91-02.bin", 0x80000, 0x457c64b8, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b91-01.bin", 0x80000, 0x3731d94f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b91-08.bin", 0x80000, 0x66f35c34, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b91-07.bin", 0x80000, 0x4d8ec6cf, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b91-06.bin", 0x80000, 0xa34dc839, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b91-05.bin", 0x80000, 0x5e72ac90, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - - { "b91-10.bin", 0x80000, 0x1d8f05b4, BRF_GRA | TAITO_ROAD }, - - { "b91-09.bin", 0x80000, 0x5f247ca2, BRF_GRA | TAITO_SPRITEMAP }, - - { "b91-13.bin", 0x80000, 0x8c7bf0f5, BRF_SND | TAITO_YM2610A }, - { "b91-12.bin", 0x80000, 0xda77c7af, BRF_SND | TAITO_YM2610A }, - - { "b91-14.bin", 0x80000, 0x6bc314d3, BRF_SND | TAITO_YM2610B }, - - { "b91-26.bin", 0x00400, 0x77682a4f, BRF_OPT }, - { "b91-27.bin", 0x00400, 0xa3f8490d, BRF_OPT }, - { "b91-28.bin", 0x00400, 0xfa2f840e, BRF_OPT }, - { "b91-29.bin", 0x02000, 0xad685be8, BRF_OPT }, - { "b91-30.bin", 0x10000, 0x30cc1f79, BRF_OPT }, - { "b91-31.bin", 0x10000, 0xc189781c, BRF_OPT }, - { "b91-32.bin", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b91-33.bin", 0x00100, 0x89719d17, BRF_OPT }, -}; - -STD_ROM_PICK(Nightstrj) -STD_ROM_FN(Nightstrj) - -static struct BurnRomInfo NightstruRomDesc[] = { - { "b91-45.bin", 0x20000, 0x7ad63421, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b91-44.bin", 0x20000, 0x4bc30adf, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b91-43.bin", 0x20000, 0x3e6f727a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "b91-46.bin", 0x20000, 0xe870be95, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "b91-39.bin", 0x20000, 0x725b23ae, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "b91-40.bin", 0x20000, 0x81fb364d, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "b91-41.bin", 0x20000, 0x2694bb42, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "b91-11.bin", 0x80000, 0xfff8ce31, BRF_GRA | TAITO_CHARS }, - - { "b91-04.bin", 0x80000, 0x8ca1970d, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b91-03.bin", 0x80000, 0xcd5fed39, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b91-02.bin", 0x80000, 0x457c64b8, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "b91-01.bin", 0x80000, 0x3731d94f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "b91-08.bin", 0x80000, 0x66f35c34, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b91-07.bin", 0x80000, 0x4d8ec6cf, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b91-06.bin", 0x80000, 0xa34dc839, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - { "b91-05.bin", 0x80000, 0x5e72ac90, BRF_GRA | TAITO_SPRITESB_BYTESWAP32 }, - - { "b91-10.bin", 0x80000, 0x1d8f05b4, BRF_GRA | TAITO_ROAD }, - - { "b91-09.bin", 0x80000, 0x5f247ca2, BRF_GRA | TAITO_SPRITEMAP }, - - { "b91-13.bin", 0x80000, 0x8c7bf0f5, BRF_SND | TAITO_YM2610A }, - { "b91-12.bin", 0x80000, 0xda77c7af, BRF_SND | TAITO_YM2610A }, - - { "b91-14.bin", 0x80000, 0x6bc314d3, BRF_SND | TAITO_YM2610B }, - - { "b91-26.bin", 0x00400, 0x77682a4f, BRF_OPT }, - { "b91-27.bin", 0x00400, 0xa3f8490d, BRF_OPT }, - { "b91-28.bin", 0x00400, 0xfa2f840e, BRF_OPT }, - { "b91-29.bin", 0x02000, 0xad685be8, BRF_OPT }, - { "b91-30.bin", 0x10000, 0x30cc1f79, BRF_OPT }, - { "b91-31.bin", 0x10000, 0xc189781c, BRF_OPT }, - { "b91-32.bin", 0x00100, 0xfbf81f30, BRF_OPT }, - { "b91-33.bin", 0x00100, 0x89719d17, BRF_OPT }, -}; - -STD_ROM_PICK(Nightstru) -STD_ROM_FN(Nightstru) - -static struct BurnRomInfo RacingbRomDesc[] = { - { "c84-110.3", 0x020000, 0x119a8d3b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c84-111.5", 0x020000, 0x1f095692, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c84-104.2", 0x020000, 0x37077fc6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c84-103.4", 0x020000, 0x4ca1d1c2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c84-99.35", 0x020000, 0x24778f40, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c84-100.36", 0x020000, 0x2b99258a, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c84-101.42", 0x020000, 0x9322106e, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c84-90.12", 0x080000, 0x83ee0e8d, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "c84-89.11", 0x080000, 0xaae43c87, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "c84-92.25", 0x100000, 0x56e8fd55, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c84-94.33", 0x100000, 0x6117c19b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c84-91.23", 0x100000, 0xb1b0146c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c84-93.31", 0x100000, 0x8837bb4e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c84-84.12", 0x080000, 0x34dc486b, BRF_GRA | TAITO_ROAD }, - - { "c84-88.3", 0x080000, 0xedd1f49c, BRF_GRA | TAITO_SPRITEMAP }, - - { "c84-86.33", 0x100000, 0x98d9771e, BRF_SND | TAITO_YM2610A }, - { "c84-87.46", 0x080000, 0x9c1dd80c, BRF_SND | TAITO_YM2610A }, - - { "c84-85.31", 0x080000, 0x24cd838d, BRF_SND | TAITO_YM2610B }, - - { "c84-19.15", 0x010000, 0x7245a6f6, BRF_OPT }, - { "c84-07.22", 0x000100, 0x95a15c77, BRF_OPT }, - { "c84-09.74", 0x000100, 0x71217472, BRF_OPT }, - { "c84-10.16", 0x000400, 0x643e8bfc, BRF_OPT }, - { "c84-11.17", 0x000400, 0x10728853, BRF_OPT }, -}; - -STD_ROM_PICK(Racingb) -STD_ROM_FN(Racingb) - -static struct BurnRomInfo RacingbjRomDesc[] = { - { "c84-107.ic3", 0x020000, 0x520aa110, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c84-109.ic5", 0x020000, 0x7ec710de, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c84-104.2", 0x020000, 0x37077fc6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c84-108.ic4", 0x020000, 0xa2afb0ee, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c84-99.35", 0x020000, 0x24778f40, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c84-100.36", 0x020000, 0x2b99258a, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c84-101.42", 0x020000, 0x9322106e, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c84-90.12", 0x080000, 0x83ee0e8d, BRF_GRA | TAITO_CHARS_BYTESWAP }, - { "c84-89.11", 0x080000, 0xaae43c87, BRF_GRA | TAITO_CHARS_BYTESWAP }, - - { "c84-92.25", 0x100000, 0x56e8fd55, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c84-94.33", 0x100000, 0x6117c19b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c84-91.23", 0x100000, 0xb1b0146c, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c84-93.31", 0x100000, 0x8837bb4e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c84-84.12", 0x080000, 0x34dc486b, BRF_GRA | TAITO_ROAD }, - - { "c84-88.3", 0x080000, 0xedd1f49c, BRF_GRA | TAITO_SPRITEMAP }, - - { "c84-86.33", 0x100000, 0x98d9771e, BRF_SND | TAITO_YM2610A }, - { "c84-87.46", 0x080000, 0x9c1dd80c, BRF_SND | TAITO_YM2610A }, - - { "c84-85.31", 0x080000, 0x24cd838d, BRF_SND | TAITO_YM2610B }, - - { "c84-19.15", 0x010000, 0x7245a6f6, BRF_OPT }, - { "c84-07.22", 0x000100, 0x95a15c77, BRF_OPT }, - { "c84-09.74", 0x000100, 0x71217472, BRF_OPT }, - { "c84-10.16", 0x000400, 0x643e8bfc, BRF_OPT }, - { "c84-11.17", 0x000400, 0x10728853, BRF_OPT }, -}; - -STD_ROM_PICK(Racingbj) -STD_ROM_FN(Racingbj) - -static struct BurnRomInfo SciRomDesc[] = { - { "c09-37.43", 0x20000, 0x0fecea17, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-38.40", 0x20000, 0xe46ebd9b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-42.38", 0x20000, 0xf4404f87, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-39.41", 0x20000, 0xde87bcb9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c09-33.6", 0x10000, 0xcf4e6c5b, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c09-32.5", 0x10000, 0xa4713719, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c09-34.31", 0x20000, 0xa21b3151, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c09-05.16", 0x80000, 0x890b38f0, BRF_GRA | TAITO_CHARS }, - - { "c09-04.52", 0x80000, 0x2cbb3c9b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-02.53", 0x80000, 0xa83a0389, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-03.54", 0x80000, 0xa31d0e80, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-01.55", 0x80000, 0x64bfea10, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c09-07.15", 0x80000, 0x963bc82b, BRF_GRA | TAITO_ROAD }, - - { "c09-06.37", 0x80000, 0x12df6d7b, BRF_GRA | TAITO_SPRITEMAP }, - - { "c09-14.42", 0x80000, 0xad78bf46, BRF_SND | TAITO_YM2610A }, - { "c09-13.43", 0x80000, 0xd57c41d3, BRF_SND | TAITO_YM2610A }, - { "c09-12.44", 0x80000, 0x56c99fa5, BRF_SND | TAITO_YM2610A }, - - { "c09-15.29", 0x80000, 0xe63b9095, BRF_SND | TAITO_YM2610B }, - - { "c09-16.17", 0x10000, 0x7245a6f6, BRF_OPT }, - { "c09-20.71", 0x00100, 0xcd8ffd80, BRF_OPT }, - { "c09-23.14", 0x00100, 0xfbf81f30, BRF_OPT }, -}; - -STD_ROM_PICK(Sci) -STD_ROM_FN(Sci) - -static struct BurnRomInfo SciaRomDesc[] = { - { "c09-28.43", 0x20000, 0x630dbaad, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-30.40", 0x20000, 0x68b1a97d, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-36.38", 0x20000, 0x59e47cba, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-31.41", 0x20000, 0x962b1fbf, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c09-33.6", 0x10000, 0xcf4e6c5b, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c09-32.5", 0x10000, 0xa4713719, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c09-34.31", 0x20000, 0xa21b3151, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c09-05.16", 0x80000, 0x890b38f0, BRF_GRA | TAITO_CHARS }, - - { "c09-04.52", 0x80000, 0x2cbb3c9b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-02.53", 0x80000, 0xa83a0389, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-03.54", 0x80000, 0xa31d0e80, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-01.55", 0x80000, 0x64bfea10, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c09-07.15", 0x80000, 0x963bc82b, BRF_GRA | TAITO_ROAD }, - - { "c09-06.37", 0x80000, 0x12df6d7b, BRF_GRA | TAITO_SPRITEMAP }, - - { "c09-14.42", 0x80000, 0xad78bf46, BRF_SND | TAITO_YM2610A }, - { "c09-13.43", 0x80000, 0xd57c41d3, BRF_SND | TAITO_YM2610A }, - { "c09-12.44", 0x80000, 0x56c99fa5, BRF_SND | TAITO_YM2610A }, - - { "c09-15.29", 0x80000, 0xe63b9095, BRF_SND | TAITO_YM2610B }, - - { "c09-16.17", 0x10000, 0x7245a6f6, BRF_OPT }, - { "c09-20.71", 0x00100, 0xcd8ffd80, BRF_OPT }, - { "c09-23.14", 0x00100, 0xfbf81f30, BRF_OPT }, -}; - -STD_ROM_PICK(Scia) -STD_ROM_FN(Scia) - -static struct BurnRomInfo ScijRomDesc[] = { - { "c09-37.43", 0x20000, 0x0fecea17, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-38.40", 0x20000, 0xe46ebd9b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-40.38", 0x20000, 0x1a4e2eab, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-39.41", 0x20000, 0xde87bcb9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c09-33.6", 0x10000, 0xcf4e6c5b, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c09-32.5", 0x10000, 0xa4713719, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c09-27.31", 0x20000, 0xcd161dca, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c09-05.16", 0x80000, 0x890b38f0, BRF_GRA | TAITO_CHARS }, - - { "c09-04.52", 0x80000, 0x2cbb3c9b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-02.53", 0x80000, 0xa83a0389, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-03.54", 0x80000, 0xa31d0e80, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-01.55", 0x80000, 0x64bfea10, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c09-07.15", 0x80000, 0x963bc82b, BRF_GRA | TAITO_ROAD }, - - { "c09-06.37", 0x80000, 0x12df6d7b, BRF_GRA | TAITO_SPRITEMAP }, - - { "c09-10.42", 0x80000, 0xad78bf46, BRF_SND | TAITO_YM2610A }, - { "c09-09.43", 0x80000, 0x6a655c00, BRF_SND | TAITO_YM2610A }, - { "c09-08.44", 0x80000, 0x7ddfc316, BRF_SND | TAITO_YM2610A }, - - { "c09-11.29", 0x80000, 0x6b1a11e1, BRF_SND | TAITO_YM2610B }, - - { "c09-16.17", 0x10000, 0x7245a6f6, BRF_OPT }, - { "c09-20.71", 0x00100, 0xcd8ffd80, BRF_OPT }, - { "c09-23.14", 0x00100, 0xfbf81f30, BRF_OPT }, -}; - -STD_ROM_PICK(Scij) -STD_ROM_FN(Scij) - -static struct BurnRomInfo SciuRomDesc[] = { - { "c09-43.43", 0x20000, 0x20a9343e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-44.40", 0x20000, 0x7524338a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-41.38", 0x20000, 0x83477f11, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c09-39.41", 0x20000, 0xde87bcb9, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c09-33.6", 0x10000, 0xcf4e6c5b, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c09-32.5", 0x10000, 0xa4713719, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c09-34.31", 0x20000, 0xa21b3151, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c09-05.16", 0x80000, 0x890b38f0, BRF_GRA | TAITO_CHARS }, - - { "c09-04.52", 0x80000, 0x2cbb3c9b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-02.53", 0x80000, 0xa83a0389, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-03.54", 0x80000, 0xa31d0e80, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-01.55", 0x80000, 0x64bfea10, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c09-07.15", 0x80000, 0x963bc82b, BRF_GRA | TAITO_ROAD }, - - { "c09-06.37", 0x80000, 0x12df6d7b, BRF_GRA | TAITO_SPRITEMAP }, - - { "c09-14.42", 0x80000, 0xad78bf46, BRF_SND | TAITO_YM2610A }, - { "c09-13.43", 0x80000, 0xd57c41d3, BRF_SND | TAITO_YM2610A }, - { "c09-12.44", 0x80000, 0x56c99fa5, BRF_SND | TAITO_YM2610A }, - - { "c09-15.29", 0x80000, 0xe63b9095, BRF_SND | TAITO_YM2610B }, - - { "c09-16.17", 0x10000, 0x7245a6f6, BRF_OPT }, - { "c09-20.71", 0x00100, 0xcd8ffd80, BRF_OPT }, - { "c09-23.14", 0x00100, 0xfbf81f30, BRF_OPT }, -}; - -STD_ROM_PICK(Sciu) -STD_ROM_FN(Sciu) - -static struct BurnRomInfo ScinegroRomDesc[] = { - { "ic37.37", 0x20000, 0x33fb159c, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "ic40.38", 0x20000, 0x657df3f2, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "ic38.42", 0x20000, 0x0a09b90b, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "ic41.39", 0x20000, 0x43167b2a, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c09-33.6", 0x10000, 0xcf4e6c5b, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c09-32.5", 0x10000, 0xa4713719, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c09-27.31", 0x20000, 0xcd161dca, BRF_ESS | BRF_PRG | TAITO_Z80ROM1 }, - - { "c09-05.16", 0x80000, 0x890b38f0, BRF_GRA | TAITO_CHARS }, - - { "c09-04.52", 0x80000, 0x2cbb3c9b, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-02.53", 0x80000, 0xa83a0389, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-03.54", 0x80000, 0xa31d0e80, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c09-01.55", 0x80000, 0x64bfea10, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c09-07.15", 0x80000, 0x963bc82b, BRF_GRA | TAITO_ROAD }, - - { "c09-06.37", 0x80000, 0x12df6d7b, BRF_GRA | TAITO_SPRITEMAP }, - - { "c09-10.42", 0x80000, 0xad78bf46, BRF_SND | TAITO_YM2610A }, - { "c09-09.43", 0x80000, 0x6a655c00, BRF_SND | TAITO_YM2610A }, - { "c09-08.44", 0x80000, 0x7ddfc316, BRF_SND | TAITO_YM2610A }, - - { "c09-11.29", 0x80000, 0x6b1a11e1, BRF_SND | TAITO_YM2610B }, - - { "c09-16.17", 0x10000, 0x7245a6f6, BRF_OPT }, - { "c09-20.71", 0x00100, 0xcd8ffd80, BRF_OPT }, - { "c09-23.14", 0x00100, 0xfbf81f30, BRF_OPT }, -}; - -STD_ROM_PICK(Scinegro) -STD_ROM_FN(Scinegro) - -static struct BurnRomInfo SpacegunRomDesc[] = { - { "c57-18.62", 0x020000, 0x19d7d52e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c57-20.74", 0x020000, 0x2e58253f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c57-17.59", 0x020000, 0xe197edb8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c57-22.73", 0x020000, 0x5855fde3, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c57-15+.27", 0x020000, 0xb36eb8f1, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c57-16+.29", 0x020000, 0xbfb5d1e7, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c57-06.52", 0x080000, 0x4ebadd5b, BRF_GRA | TAITO_CHARS }, - - { "c57-01.25", 0x100000, 0xf901b04e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c57-02.24", 0x100000, 0x21ee4633, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c57-03.12", 0x100000, 0xfafca86f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c57-04.11", 0x100000, 0xa9787090, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c57-05.36", 0x080000, 0x6a70eb2e, BRF_GRA | TAITO_SPRITEMAP }, - - { "c57-07.76", 0x080000, 0xad653dc1, BRF_SND | TAITO_YM2610A }, - - { "c57-08.75", 0x080000, 0x22593550, BRF_SND | TAITO_YM2610B }, - - { "pal16l8-c57-09.9", 0x000104, 0xea93161e, BRF_OPT }, - { "pal20l8-c57-10.47", 0x000144, 0x3ee56888, BRF_OPT }, - { "pal16l8-c57-11.48", 0x000104, 0x6bb4372e, BRF_OPT }, - { "pal20l8-c57-12.61", 0x000144, 0xdebddb13, BRF_OPT }, - { "pal16l8-c57-13.72", 0x000104, 0x1369f23e, BRF_OPT }, - { "pal16r4-c57-14.96", 0x000104, 0x75e1bf61, BRF_OPT }, - -}; - -STD_ROM_PICK(Spacegun) -STD_ROM_FN(Spacegun) - -static struct BurnRomInfo SpacegunuRomDesc[] = { - { "c57-18.62", 0x020000, 0x19d7d52e, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c57-20.74", 0x020000, 0x2e58253f, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c57-17.59", 0x020000, 0xe197edb8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c57-21.73", 0x020000, 0x2f52cd75, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c57-15+.27", 0x020000, 0xb36eb8f1, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c57-16+.29", 0x020000, 0xbfb5d1e7, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c57-06.52", 0x080000, 0x4ebadd5b, BRF_GRA | TAITO_CHARS }, - - { "c57-01.25", 0x100000, 0xf901b04e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c57-02.24", 0x100000, 0x21ee4633, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c57-03.12", 0x100000, 0xfafca86f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c57-04.11", 0x100000, 0xa9787090, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c57-05.36", 0x080000, 0x6a70eb2e, BRF_GRA | TAITO_SPRITEMAP }, - - { "c57-07.76", 0x080000, 0xad653dc1, BRF_SND | TAITO_YM2610A }, - - { "c57-08.75", 0x080000, 0x22593550, BRF_SND | TAITO_YM2610B }, - - { "pal16l8-c57-09.9", 0x000104, 0xea93161e, BRF_OPT }, - { "pal20l8-c57-10.47", 0x000144, 0x3ee56888, BRF_OPT }, - { "pal16l8-c57-11.48", 0x000104, 0x6bb4372e, BRF_OPT }, - { "pal20l8-c57-12.61", 0x000144, 0xdebddb13, BRF_OPT }, - { "pal16l8-c57-13.72", 0x000104, 0x1369f23e, BRF_OPT }, - { "pal16r4-c57-14.96", 0x000104, 0x75e1bf61, BRF_OPT }, - -}; - -STD_ROM_PICK(Spacegunu) -STD_ROM_FN(Spacegunu) - -static struct BurnRomInfo SpacegunjRomDesc[] = { - { "c57-18+.62", 0x020000, 0xc648c093, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c57-20+.74", 0x020000, 0x4de524f6, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c57-17.59", 0x020000, 0xe197edb8, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - { "c57-19.73", 0x020000, 0xc15cac59, BRF_ESS | BRF_PRG | TAITO_68KROM1_BYTESWAP }, - - { "c57-15+.27", 0x020000, 0xb36eb8f1, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - { "c57-16+.29", 0x020000, 0xbfb5d1e7, BRF_ESS | BRF_PRG | TAITO_68KROM2_BYTESWAP }, - - { "c57-06.52", 0x080000, 0x4ebadd5b, BRF_GRA | TAITO_CHARS }, - - { "c57-01.25", 0x100000, 0xf901b04e, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c57-02.24", 0x100000, 0x21ee4633, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c57-03.12", 0x100000, 0xfafca86f, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - { "c57-04.11", 0x100000, 0xa9787090, BRF_GRA | TAITO_SPRITESA_BYTESWAP32 }, - - { "c57-05.36", 0x080000, 0x6a70eb2e, BRF_GRA | TAITO_SPRITEMAP }, - - { "c57-07.76", 0x080000, 0xad653dc1, BRF_SND | TAITO_YM2610A }, - - { "c57-08.75", 0x080000, 0x22593550, BRF_SND | TAITO_YM2610B }, - - { "pal16l8-c57-09.9", 0x000104, 0xea93161e, BRF_OPT }, - { "pal20l8-c57-10.47", 0x000144, 0x3ee56888, BRF_OPT }, - { "pal16l8-c57-11.48", 0x000104, 0x6bb4372e, BRF_OPT }, - { "pal20l8-c57-12.61", 0x000144, 0xdebddb13, BRF_OPT }, - { "pal16l8-c57-13.72", 0x000104, 0x1369f23e, BRF_OPT }, - { "pal16r4-c57-14.96", 0x000104, 0x75e1bf61, BRF_OPT }, - -}; - -STD_ROM_PICK(Spacegunj) -STD_ROM_FN(Spacegunj) - -static INT32 MemIndex() -{ - UINT8 *Next; Next = TaitoMem; - - Taito68KRom1 = Next; Next += Taito68KRom1Size; - Taito68KRom2 = Next; Next += Taito68KRom2Size; - TaitoZ80Rom1 = Next; Next += TaitoZ80Rom1Size; - TaitoSpriteMapRom = Next; Next += TaitoSpriteMapRomSize; - TaitoYM2610ARom = Next; Next += TaitoYM2610ARomSize; - TaitoYM2610BRom = Next; Next += TaitoYM2610BRomSize; - - TaitoRamStart = Next; - - Taito68KRam1 = Next; Next += 0x10000; - Taito68KRam2 = Next; Next += 0x08000; - TaitoSharedRam = Next; Next += 0x10000; - TaitoZ80Ram1 = Next; Next += 0x02000; - TaitoSpriteRam = Next; Next += 0x04000; - TaitoPaletteRam = Next; Next += 0x02000; - - TaitoRamEnd = Next; - - TaitoChars = Next; Next += TaitoNumChar * TaitoCharWidth * TaitoCharHeight; - TaitoSpritesA = Next; Next += TaitoNumSpriteA * TaitoSpriteAWidth * TaitoSpriteAHeight; - TaitoSpritesB = Next; Next += TaitoNumSpriteB * TaitoSpriteBWidth * TaitoSpriteBHeight; - TaitoPalette = (UINT32*)Next; Next += 0x01000 * sizeof(UINT32); - TaitoPriorityMap = Next; Next += nScreenWidth * nScreenHeight; - - TaitoMemEnd = Next; - - return 0; -} - -static INT32 TaitoZDoReset() -{ - TaitoDoReset(); - - if (bUseShifter) - BurnShiftReset(); - - SciSpriteFrame = 0; - OldSteer = 0; - - return 0; -} - -static void TaitoZCpuAReset(UINT16 d) -{ - TaitoCpuACtrl = d; - if (!(TaitoCpuACtrl & 1)) { - SekClose(); - SekOpen(1); - SekReset(); - SekClose(); - SekOpen(0); - } -} - -void __fastcall Aquajack68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0xa00000, 0xa0ffff) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -void __fastcall Aquajack68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0xa00000, 0xa0ffff) - TC0100SCN0CtrlWordWrite_Map(0xa20000) - - switch (a) { - case 0x200000: { - TaitoZCpuAReset(d); - return; - } - - case 0x300000: - case 0x300002: { - TC0110PCRStep1WordWrite(0, (a - 0x300000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Aquajack68K2ReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x200000) - - switch (a) { - case 0x300003: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read byte => %06X\n"), a); - } - } - - return 0; -} - -UINT16 __fastcall Aquajack68K2ReadWord(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x200000) - - switch (a) { - case 0x900000: - case 0x900002: - case 0x900004: - case 0x900006: { - // nop - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Aquajack68K2WriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x200000) - - switch (a) { - case 0x300000: { - TC0140SYTPortWrite(d & 0xff); - return; - } - - case 0x300002: { - TC0140SYTCommWrite(d & 0xff); - return; - } - - case 0x900000: - case 0x900002: - case 0x900004: - case 0x900006: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write word => %06X, %04X\n"), a, d); - } - } -} - -static UINT8 BsharkStickRead(INT32 Offset) -{ - switch (Offset) { - case 0x00: { - INT32 Temp = (TaitoAnalogPort0 >> 4) & 0xfff; - Temp = 0xfff - Temp; - Temp += 1; - if (Temp == 0x1000) Temp = 0; - return Temp; - } - - case 0x01: { - return 0xff; - } - - case 0x02: { - return TaitoAnalogPort1 >> 4; - } - - case 0x03: { - return 0xff; - } - } - - return 0; -} - -UINT8 __fastcall Bshark68K1ReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x400000) - - switch (a) { - case 0x800001: - case 0x800003: - case 0x800005: - case 0x800007: { - return BsharkStickRead((a - 0x800000) >> 1); - } - - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Bshark68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x400000) - TC0100SCN0ByteWrite_Map(0xd00000, 0xd0ffff) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -void __fastcall Bshark68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x400000) - TC0100SCN0WordWrite_Map(0xd00000, 0xd0ffff) - TC0100SCN0CtrlWordWrite_Map(0xd20000) - - switch (a) { - case 0x600000: { - TaitoZCpuAReset(d); - return; - } - - case 0x800000: - case 0x800002: - case 0x800004: - case 0x800006: { - TaitoZINT6timer = SekTotalCycles(); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT16 __fastcall Bshark68K2ReadWord(UINT32 a) -{ - switch (a) { - case 0x40000a: { - // ??? - return 0; - } - - case 0x600000: { - return BurnYM2610Read(0); - } - - case 0x600004: { - return BurnYM2610Read(2); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Bshark68K2WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x400000: - case 0x400002: - case 0x400004: - case 0x400006: - case 0x400008: { - // nop - return; - } - - case 0x600000: { - BurnYM2610Write(0, d & 0xff); - return; - } - - case 0x600002: { - BurnYM2610Write(1, d & 0xff); - return; - } - - case 0x600004: { - BurnYM2610Write(2, d & 0xff); - return; - } - - case 0x600006: { - BurnYM2610Write(3, d & 0xff); - return; - } - - case 0x60000c: - case 0x60000e: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write word => %06X, %04X\n"), a, d); - } - } -} - -static UINT8 ChasehqInputBypassRead() -{ - UINT8 Port = TC0220IOCPortRead(); - - INT32 Steer = (TaitoAnalogPort0 >> 4); - - switch (Port) { - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: { - return 0xff; - } - - case 0x0c: { - return Steer & 0xff; - } - - case 0x0d: { - return Steer >> 8; - } - - default: { - return TC0220IOCPortRegRead(); - } - } -} - -UINT8 __fastcall Chasehq68K1ReadByte(UINT32 a) -{ - switch (a) { - case 0x400001: { - return ChasehqInputBypassRead(); - } - - case 0x820003: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Chasehq68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0xc00000, 0xc0ffff) - - switch (a) { - case 0x400001: { - TC0220IOCHalfWordPortRegWrite(d); - return; - } - - case 0x400003: { - TC0220IOCHalfWordPortWrite(d); - return; - } - - case 0x800001: { - TaitoZCpuAReset(d); - return; - } - - case 0x820001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x820003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Chasehq68K1ReadWord(UINT32 a) -{ - switch (a) { - case 0x400002: { - return TC0220IOCHalfWordPortRead(); - } - - case 0xa00002: { - return TC0110PCRWordRead(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Chasehq68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0xc00000, 0xc0ffff) - TC0100SCN0CtrlWordWrite_Map(0xc20000) - - switch (a) { - case 0x400000: { - TC0220IOCHalfWordPortRegWrite(d); - return; - } - - case 0x400002: { - TC0220IOCHalfWordPortWrite(d); - return; - } - - case 0xa00000: - case 0xa00002: { - TC0110PCRStep1WordWrite(0, (a - 0xa00000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -static UINT8 ContcircInputBypassRead() -{ - UINT8 Port = TC0220IOCPortRead(); - - INT32 Steer = (TaitoAnalogPort0 >> 4) & 0xfff; - Steer = 0xfff - Steer; - if (Steer == 0xfff) Steer = 0; - if (Steer > 0x5f && Steer < 0x80) Steer = 0x5f; - if (Steer > 0xf7f && Steer < 0xfa0) Steer = 0xfa0; - if (Steer > 0xf7f) Steer |= 0xf000; - - switch (Port) { - case 0x08: { - return Steer & 0xff; - } - - case 0x09: { - return Steer >> 8; - } - - default: { - return TC0220IOCPortRegRead(); - } - } -} - -void __fastcall Contcirc68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x200000, 0x20ffff) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -void __fastcall Contcirc68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x200000, 0x20ffff) - TC0100SCN0CtrlWordWrite_Map(0x220000) - - switch (a) { - case 0x090000: { - TaitoRoadPalBank = (d & 0xc0) >> 6; - TaitoZCpuAReset(d); - return; - } - - case 0x100000: - case 0x100002: { - TC0110PCRStep1RBSwapWordWrite(0, (a - 0x100000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Contcirc68K2ReadByte(UINT32 a) -{ - switch (a) { - case 0x100001: { - return ContcircInputBypassRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Contcirc68K2WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x100001: { - TC0220IOCHalfWordPortRegWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Contcirc68K2ReadWord(UINT32 a) -{ - switch (a) { - case 0x100000: { - return ContcircInputBypassRead(); - } - - case 0x100002: { - return TC0220IOCHalfWordPortRead(); - } - - case 0x200002: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Contcirc68K2WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x100000: { - TC0220IOCHalfWordPortRegWrite(d); - return; - } - - case 0x100002: { - TC0220IOCHalfWordPortWrite(d); - return; - } - - case 0x200000: { - TC0140SYTPortWrite(d & 0xff); - return; - } - - case 0x200002: { - TC0140SYTCommWrite(d & 0xff); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write word => %06X, %04X\n"), a, d); - } - } -} - -static UINT16 DblaxleSteerRead(INT32 Offset) -{ - int Steer = TaitoAnalogPort0 >> 5; - if (Steer > 0x3f) Steer |= 0xf800; - - switch (Offset) { - case 0x04: { - return Steer >> 8; - } - - case 0x05: { - return Steer & 0xff; - } - } - - return 0x00; -} - -UINT8 __fastcall Dblaxle68K1ReadByte(UINT32 a) -{ - TC0510NIOHalfWordSwapRead_Map(0x400000) - - switch (a) { - case 0x620003: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Dblaxle68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordSwapWrite_Map(0x400000) - - switch (a) { - case 0x600001: { - TaitoZCpuAReset(d); - return; - } - - case 0x620001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x620003: { - TC0140SYTCommWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Dblaxle68K1ReadWord(UINT32 a) -{ - TC0510NIOHalfWordSwapRead_Map(0x400000) - - switch (a) { - case 0x400018: - case 0x40001a: { - return DblaxleSteerRead((a - 0x400010) >> 1); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Dblaxle68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0510NIOHalfWordSwapWrite_Map(0x400000) - TC0480SCPCtrlWordWrite_Map(0xa30000) - - switch (a) { - case 0xc08000: { - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -void __fastcall Enforce68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x600000, 0x60ffff) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Enforce68K1ReadWord(UINT32 a) -{ - switch (a) { - case 0x500002: { - return TC0110PCRWordRead(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Enforce68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x600000, 0x60ffff) - TC0100SCN0CtrlWordWrite_Map(0x620000) - - switch (a) { - case 0x200000: { - TaitoZCpuAReset(d); - return; - } - - case 0x500000: - case 0x500002: { - TC0110PCRStep1RBSwapWordWrite(0, (a - 0x500000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Enforce68K2ReadByte(UINT32 a) -{ - switch (a) { - case 0x300001: { - return TC0220IOCPortRegRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Enforce68K2WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x300001: { - TC0220IOCHalfWordPortRegWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Enforce68K2ReadWord(UINT32 a) -{ - switch (a) { - case 0x200002: { - return TC0140SYTCommRead(); - } - - case 0x300000: { - return TC0220IOCPortRegRead(); - } - - case 0x300002: { - return TC0220IOCHalfWordPortRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Enforce68K2WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x200000: { - TC0140SYTPortWrite(d & 0xff); - return; - } - - case 0x200002: { - TC0140SYTCommWrite(d & 0xff); - return; - } - - case 0x300000: { - TC0220IOCHalfWordPortRegWrite(d); - return; - } - - case 0x300002: { - TC0220IOCHalfWordPortWrite(d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write word => %06X, %04X\n"), a, d); - } - } -} - -static const UINT8 nightstr_stick[128]= -{ - 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7, - 0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7, - 0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7, - 0xe8,0x00,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25, - 0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,0x34,0x35, - 0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,0x40,0x41,0x42,0x43,0x44,0x45, - 0x46,0x47,0x48,0x49,0xb8 -}; - -UINT32 scalerange(UINT32 x, UINT32 in_min, UINT32 in_max, UINT32 out_min, UINT32 out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -static UINT8 NightstrStickRead(INT32 Offset) -{ - switch (Offset) { // p0: 3f - be p1: bf - 40 - case 0x00: { - UINT8 Temp = 0x7f + (TaitoAnalogPort0 >> 4); - UINT8 Temp2 = 0; - if (Temp < 0x01) Temp = 0x01; - if (Temp > 0xfe) Temp = 0xfe; - Temp2 = scalerange(Temp, 0x3f, 0xbe, 0x01, 0xfe); - //bprintf(0, _T("Port0-temp[%X] scaled[%X]\n"), Temp, Temp2); - return nightstr_stick[(Temp2 * 0x64) / 0x100]; - } - - case 0x01: { - UINT8 Temp = 0x7f - (TaitoAnalogPort1 >> 4); - UINT8 Temp2 = 0; - if (Temp < 0x01) Temp = 0x01; - if (Temp > 0xfe) Temp = 0xfe; - Temp2 = scalerange(Temp, 0x40, 0xbf, 0x01, 0xfe); - //bprintf(0, _T("Port1-temp[%X]\n"), Temp); - return nightstr_stick[(Temp2 * 0x64) / 0x100]; - } - - case 0x02: { - return 0xff; - } - - case 0x03: { - return 0xff; - } - } - - return 0xff; -} - -UINT8 __fastcall Nightstr68K1ReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x400000) - - switch (a) { - case 0xe40001: - case 0xe40003: - case 0xe40005: - case 0xe40007: { - return NightstrStickRead((a - 0xe40000) >> 1); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Nightstr68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x400000) - TC0100SCN0ByteWrite_Map(0xc00000, 0xc0ffff) - - switch (a) { - case 0xe00000: - case 0xe00008: - case 0xe00010: { - // nop - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Nightstr68K1ReadWord(UINT32 a) -{ - switch (a) { - case 0x820002: { - return TC0140SYTCommRead(); - } - - case 0xa00002: { - return TC0110PCRWordRead(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Nightstr68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0220IOCHalfWordWrite_Map(0x400000) - TC0100SCN0WordWrite_Map(0xc00000, 0xc0ffff) - TC0100SCN0CtrlWordWrite_Map(0xc20000) - - switch (a) { - case 0x800000: { - TaitoZCpuAReset(d); - return; - } - - case 0x820000: { - TC0140SYTPortWrite(d & 0xff); - return; - } - - case 0x820002: { - TC0140SYTCommWrite(d & 0xff); - return; - } - - case 0xa00000: - case 0xa00002: { - TC0110PCRStep1WordWrite(0, (a - 0xa00000) >> 1, d); - return; - } - - case 0xe00000: - case 0xe00008: - case 0xe00010: { - // nop - return; - } - - case 0xe40000: - case 0xe40002: - case 0xe40004: - case 0xe40006: - case 0xe40008: - case 0xe4000a: - case 0xe4000c: - case 0xe4000e: { - TaitoZINT6timer = SekTotalCycles(); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Racingb68K1ReadByte(UINT32 a) -{ - TC0510NIOHalfWordSwapRead_Map(0x300000) - - switch (a) { - case 0x300019: - case 0x30001b: { - return DblaxleSteerRead((a - 0x300010) >> 1); - } - - case 0x520003: { - return TC0140SYTCommRead(); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Racingb68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0510NIOHalfWordSwapWrite_Map(0x300000) - - switch (a) { - case 0x500002: { - TaitoZCpuAReset(d); - return; - } - - case 0x520001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x520003: { - TC0140SYTCommWrite(d); - return; - } - - case 0xb08000: { - SciSpriteFrame = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Racingb68K1ReadWord(UINT32 a) -{ - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Racingb68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0510NIOHalfWordSwapWrite_Map(0x300000) - TC0480SCPCtrlWordWrite_Map(0x930000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -static UINT8 SciSteerRead(INT32 Offset) -{ - INT32 Steer = TaitoAnalogPort0 >> 4; - if (Steer > 0x5f && Steer < 0x80) Steer = 0x5f; - if (Steer > 0xf80 && Steer < 0xfa0) Steer = 0xfa0; - if ((OldSteer < Steer) && (Steer > 0xfc0)) Steer = 0; - OldSteer = Steer; - - switch (Offset) { - case 0x04: { - return Steer & 0xff; - } - - case 0x05: { - return (Steer & 0xff00) >> 8; - } - } - - return 0xff; -} - -UINT8 __fastcall Sci68K1ReadByte(UINT32 a) -{ - TC0220IOCHalfWordRead_Map(0x200000) - - switch (a) { - case 0x200019: - case 0x20001b: { - return SciSteerRead((a - 0x200010) >> 1); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Sci68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0220IOCHalfWordWrite_Map(0x200000) - TC0100SCN0ByteWrite_Map(0xa00000, 0xa0ffff) - - switch (a) { - case 0x400001: { - TaitoZCpuAReset(d); - return; - } - - case 0x420001: { - TC0140SYTPortWrite(d); - return; - } - - case 0x420003: { - TC0140SYTCommWrite(d); - return; - } - - case 0xc08000: { - SciSpriteFrame = d; - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -void __fastcall Sci68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0xa00000, 0xa0ffff) - TC0100SCN0CtrlWordWrite_Map(0xa20000) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -static const UINT8 spacegun_default_eeprom[128]= -{ - 0x00,0x00,0x00,0xff,0x00,0x01,0x41,0x41,0x00,0x00,0x00,0xff,0x00,0x00,0xf0,0xf0, - 0x00,0x00,0x00,0xff,0x00,0x01,0x41,0x41,0x00,0x00,0x00,0xff,0x00,0x00,0xf0,0xf0, - 0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x01,0x40,0x00,0x00,0x00,0xf0,0x00, - 0x00,0x01,0x42,0x85,0x00,0x00,0xf1,0xe3,0x00,0x01,0x40,0x00,0x00,0x00,0xf0,0x00, - 0x00,0x01,0x42,0x85,0x00,0x00,0xf1,0xe3,0xcc,0xcb,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -}; - -static const eeprom_interface spacegun_eeprom_intf = -{ - 6, /* address bits */ - 16, /* data bits */ - "0110", /* read command */ - "0101", /* write command */ - "0111", /* erase command */ - "0100000000", /* lock command */ - "0100111111", /* unlock command */ - 0, /* multi-read disabled */ - 1 /* reset delay */ -}; - -static UINT8 SpacegunInputBypassRead(INT32 Offset) -{ - switch (Offset) { - case 0x03: { - return (EEPROMRead() & 1) << 7; - } - - default: { - return TC0220IOCRead(Offset); - } - } - - return 0; -} - -static void SpacegunInputBypassWrite(INT32 Offset, UINT16 Data) -{ - switch (Offset) { - case 0x03: { - EEPROMWrite(Data & 0x20, Data & 0x10, Data & 0x40); - return; - } - - default: { - TC0220IOCWrite(Offset, Data & 0xff); - } - } -} - -void __fastcall Spacegun68K1WriteByte(UINT32 a, UINT8 d) -{ - TC0100SCN0ByteWrite_Map(0x900000, 0x90ffff) - - switch (a) { - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Spacegun68K1ReadWord(UINT32 a) -{ - switch (a) { - case 0xb00002: { - return TC0110PCRWordRead(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Spacegun68K1WriteWord(UINT32 a, UINT16 d) -{ - TC0100SCN0WordWrite_Map(0x900000, 0x90ffff) - TC0100SCN0CtrlWordWrite_Map(0x920000) - - switch (a) { - case 0xb00000: - case 0xb00002: { - TC0110PCRStep1RBSwapWordWrite(0, (a - 0xb00000) >> 1, d); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #1 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall Spacegun68K2ReadByte(UINT32 a) -{ - switch (a) { - case 0xc0000d: { - // nop - return 0; - } - - case 0xf00001: { - return ~BurnGunReturnX(0); - } - - case 0xf00003: { - return BurnGunReturnY(0); - } - - case 0xf00005: { - return ~BurnGunReturnX(1); - } - - case 0xf00007: { - return BurnGunReturnY(1); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read byte => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Spacegun68K2WriteByte(UINT32 a, UINT8 d) -{ - switch (a) { - case 0x800008: { - SpacegunInputBypassWrite((a - 0x800000) >> 1, d); - return; - } - - case 0xc0000d: { - // nop - return; - } - - case 0xe00001: { - // ??? - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write byte => %06X, %02X\n"), a, d); - } - } -} - -UINT16 __fastcall Spacegun68K2ReadWord(UINT32 a) -{ - switch (a) { - case 0x800000: - case 0x800002: - case 0x800004: - case 0x800006: - case 0x800008: - case 0x80000a: - case 0x80000c: - case 0x80000e: { - return SpacegunInputBypassRead((a - 0x800000) >> 1); - } - - case 0xc00000: { - return BurnYM2610Read(0); - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Read word => %06X\n"), a); - } - } - - return 0; -} - -void __fastcall Spacegun68K2WriteWord(UINT32 a, UINT16 d) -{ - switch (a) { - case 0x800000: - case 0x800002: - case 0x800004: - case 0x800006: - case 0x800008: - case 0x80000a: - case 0x80000c: - case 0x80000e: { - SpacegunInputBypassWrite((a - 0x800000) >> 1, d); - return; - } - - case 0xc00000: { - BurnYM2610Write(0, d & 0xff); - return; - } - - case 0xc00002: { - BurnYM2610Write(1, d & 0xff); - return; - } - - case 0xc00004: { - BurnYM2610Write(2, d & 0xff); - return; - } - - case 0xc00006: { - BurnYM2610Write(3, d & 0xff); - return; - } - - case 0xc20000: - case 0xc20002: - case 0xc20004: - case 0xc20006: { - // ??? - return; - } - - case 0xf00000: - case 0xf00002: - case 0xf00004: - case 0xf00006: { - SekSetIRQLine(5, CPU_IRQSTATUS_AUTO); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("68K #2 Write word => %06X, %04X\n"), a, d); - } - } -} - -UINT8 __fastcall TaitoZZ80Read(UINT16 a) -{ - switch (a) { - case 0xe000: { - return BurnYM2610Read(0); - } - - case 0xe001: { - return BurnYM2610Read(1); - } - - case 0xe002: { - return BurnYM2610Read(2); - } - - case 0xe200: { - // NOP - return 0; - } - - case 0xe201: { - return TC0140SYTSlaveCommRead(); - } - - case 0xea00: { - // NOP - return 0; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a); - } - } - - return 0; -} - -void __fastcall TaitoZZ80Write(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xe000: { - BurnYM2610Write(0, d); - return; - } - - case 0xe001: { - BurnYM2610Write(1, d); - return; - } - - case 0xe002: { - BurnYM2610Write(2, d); - return; - } - - case 0xe003: { - BurnYM2610Write(3, d); - return; - } - - case 0xe200: { - TC0140SYTSlavePortWrite(d); - return; - } - - case 0xe201: { - TC0140SYTSlaveCommWrite(d); - return; - } - - case 0xe400: { - BurnYM2610SetRightVolume(BURN_SND_YM2610_YM2610_ROUTE_1, TaitoZYM2610Route1MasterVol * d / 255.0); - return; - } - - case 0xe401: { - BurnYM2610SetLeftVolume(BURN_SND_YM2610_YM2610_ROUTE_1, TaitoZYM2610Route1MasterVol * d / 255.0); - return; - } - - case 0xe402: { - BurnYM2610SetRightVolume(BURN_SND_YM2610_YM2610_ROUTE_2, TaitoZYM2610Route1MasterVol * d / 255.0); - return; - } - - case 0xe403: { - BurnYM2610SetLeftVolume(BURN_SND_YM2610_YM2610_ROUTE_2, TaitoZYM2610Route1MasterVol * d / 255.0); - return; - } - - case 0xe600: { - return; - } - - case 0xee00: { - return; - } - - case 0xf000: { - return; - } - - case 0xf200: { - TaitoZ80Bank = (d - 1) & 7; - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - return; - } - - default: { - bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d); - } - } -} - -static INT32 CharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 CharXOffsets[8] = { 8, 12, 0, 4, 24, 28, 16, 20 }; -static INT32 CharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; -static INT32 DblaxleCharPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 DblaxleCharXOffsets[16] = { 4, 0, 20, 16, 12, 8, 28, 24, 36, 32, 52, 48, 44, 40, 60, 56 }; -static INT32 DblaxleCharYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 SpritePlaneOffsets[4] = { 0, 8, 16, 24 }; -static INT32 SpriteXOffsets[16] = { 32, 33, 34, 35, 36, 37, 38, 39, 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 SpriteYOffsets[16] = { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }; -static INT32 Sprite16x8YOffsets[8] = { 0, 64, 128, 192, 256, 320, 384, 448 }; - -static void TaitoZFMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus & 1) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -static INT32 TaitoZSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / (16000000 / 4); -} - -static double TaitoZGetTime() -{ - return (double)ZetTotalCycles() / (16000000 / 4); -} - -static INT32 TaitoZ68KSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)SekTotalCycles() * nSoundRate / (nTaitoCyclesTotal[0] * 60); -} - -static double TaitoZ68KGetTime() -{ - return (double)SekTotalCycles() / (nTaitoCyclesTotal[0] * 60); -} - -static void TaitoZZ80Init() -{ - // Setup the Z80 emulation - ZetInit(0); - ZetOpen(0); - ZetSetReadHandler(TaitoZZ80Read); - ZetSetWriteHandler(TaitoZZ80Write); - ZetMapArea(0x0000, 0x3fff, 0, TaitoZ80Rom1 ); - ZetMapArea(0x0000, 0x3fff, 2, TaitoZ80Rom1 ); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 ); - ZetMapArea(0xc000, 0xdfff, 0, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 1, TaitoZ80Ram1 ); - ZetMapArea(0xc000, 0xdfff, 2, TaitoZ80Ram1 ); - ZetClose(); - - TaitoNumZ80s = 1; -} - -#ifdef BUILD_A68K -static void SwitchToMusashi() -{ - if (bBurnUseASMCPUEmulation) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching to Musashi 68000 core\n")); -#endif - bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation; - bBurnUseASMCPUEmulation = false; - } -} -#endif - -static INT32 AquajackInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = Sprite16x8YOffsets; - TaitoNumSpriteA = 0x8000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - GenericTilesInit(); - - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, NULL); - TC0110PCRInit(1, 0x1000); - TC0150RODInit(TaitoRoadRomSize, 0); - TC0140SYTInit(0); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x104000, 0x107fff, MAP_RAM); - SekMapMemory(TC0150RODRam , 0x800000, 0x801fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0xa00000, 0xa0ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0xc40000, 0xc403ff, MAP_RAM); - SekSetWriteByteHandler(0, Aquajack68K1WriteByte); - SekSetWriteWordHandler(0, Aquajack68K1WriteWord); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x104000, 0x107fff, MAP_RAM); - SekSetReadWordHandler(0, Aquajack68K2ReadWord); - SekSetWriteWordHandler(0, Aquajack68K2WriteWord); - SekSetReadByteHandler(0, Aquajack68K2ReadByte); - SekClose(); - - TaitoZZ80Init(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &TaitoZFMIRQHandler, TaitoZSynchroniseStream, TaitoZGetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - TaitoZYM2610Route1MasterVol = 2.00; - TaitoZYM2610Route2MasterVol = 2.00; - bYM2610UseSeperateVolumes = 1; - - TaitoMakeInputsFunction = AquajackMakeInputs; - TaitoDrawFunction = AquajackDraw; - TaitoIrqLine = 4; - TaitoFrameInterleave = 500; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = 12000000 / 60; - nTaitoCyclesTotal[2] = (16000000 / 4) / 60; - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static INT32 BsharkInit() -{ - INT32 nLen; - - Sci = 1; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = Sprite16x8YOffsets; - TaitoNumSpriteA = 0x8000; - - TaitoNum68Ks = 2; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - GenericTilesInit(); - - TC0100SCNInit(0, TaitoNumChar, 0, 8, 1, NULL); - TC0150RODInit(TaitoRoadRomSize, 1); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x110000, 0x113fff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0xa00000, 0xa01fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0xc00000, 0xc00fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0xd00000, 0xd0ffff, MAP_READ); - SekSetWriteWordHandler(0, Bshark68K1WriteWord); - SekSetReadByteHandler(0, Bshark68K1ReadByte); - SekSetWriteByteHandler(0, Bshark68K1WriteByte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x108000, 0x10bfff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x110000, 0x113fff, MAP_RAM); - SekMapMemory(TC0150RODRam , 0x800000, 0x801fff, MAP_RAM); - SekSetReadWordHandler(0, Bshark68K2ReadWord); - SekSetWriteWordHandler(0, Bshark68K2WriteWord); - SekClose(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, NULL, TaitoZ68KSynchroniseStream, TaitoZ68KGetTime, 0); - BurnTimerAttachSek(12000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - TaitoMakeInputsFunction = BsharkMakeInputs; - TaitoDrawFunction = BsharkDraw; - TaitoIrqLine = 4; - TaitoFrameInterleave = 271; - TaitoFlipScreenX = 1; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = 12000000 / 60; - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static void TaitoZSetupShifter() -{ - bUseShifter = 1; - BurnShiftInitDefault(); -} - -static INT32 ChasehqInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x4000; - - TaitoSpriteBModulo = 0x400; - TaitoSpriteBNumPlanes = 4; - TaitoSpriteBWidth = 16; - TaitoSpriteBHeight = 16; - TaitoSpriteBPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteBXOffsets = SpriteXOffsets; - TaitoSpriteBYOffsets = SpriteYOffsets; - TaitoNumSpriteB = 0x4000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - GenericTilesInit(); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - // This block must be before TaitoLoadRoms(1) - or else! - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, TaitoPriorityMap); - TC0110PCRInit(1, 0x1000); - TC0150RODInit(TaitoRoadRomSize, 0); - TC0150RODSetPriMap(TaitoPriorityMap); - TC0140SYTInit(0); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x107fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x108000, 0x10bfff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0xc00000, 0xc0ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0xd00000, 0xd007ff, MAP_RAM); - SekSetReadWordHandler(0, Chasehq68K1ReadWord); - SekSetWriteWordHandler(0, Chasehq68K1WriteWord); - SekSetReadByteHandler(0, Chasehq68K1ReadByte); - SekSetWriteByteHandler(0, Chasehq68K1WriteByte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x108000, 0x10bfff, MAP_RAM); - SekMapMemory(TC0150RODRam , 0x800000, 0x801fff, MAP_RAM); - SekClose(); - - TaitoZZ80Init(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &TaitoZFMIRQHandler, TaitoZSynchroniseStream, TaitoZGetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.20); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.20); - TaitoZYM2610Route1MasterVol = 1.00; - TaitoZYM2610Route2MasterVol = 1.00; - bYM2610UseSeperateVolumes = 1; - - TaitoMakeInputsFunction = ChasehqMakeInputs; - TaitoDrawFunction = ChasehqDraw; - TaitoIrqLine = 4; - TaitoFrameInterleave = 100; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = 12000000 / 60; - nTaitoCyclesTotal[2] = (16000000 / 4) / 60; - - TaitoZSetupShifter(); - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static INT32 ContcircInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = Sprite16x8YOffsets; - TaitoNumSpriteA = 0x8000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - GenericTilesInit(); - - TC0100SCNInit(0, TaitoNumChar, 0, 16, 0, NULL); - TC0110PCRInit(1, 0x1000); - TC0150RODInit(TaitoRoadRomSize, 0); - TC0140SYTInit(0); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x080000, 0x083fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x084000, 0x087fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x200000, 0x20ffff, MAP_READ); - SekMapMemory(TC0150RODRam , 0x300000, 0x301fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x400000, 0x4006ff, MAP_RAM); - SekSetWriteByteHandler(0, Contcirc68K1WriteByte); - SekSetWriteWordHandler(0, Contcirc68K1WriteWord); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x080000, 0x083fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x084000, 0x087fff, MAP_RAM); - SekSetReadWordHandler(0, Contcirc68K2ReadWord); - SekSetWriteWordHandler(0, Contcirc68K2WriteWord); - SekSetReadByteHandler(0, Contcirc68K2ReadByte); - SekSetWriteByteHandler(0, Contcirc68K2WriteByte); - SekClose(); - - TaitoZZ80Init(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &TaitoZFMIRQHandler, TaitoZSynchroniseStream, TaitoZGetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.18); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.18); - TaitoZYM2610Route1MasterVol = 2.00; - TaitoZYM2610Route2MasterVol = 2.00; - bYM2610UseSeperateVolumes = 1; - - TaitoMakeInputsFunction = ContcircMakeInputs; - TaitoDrawFunction = ContcircDraw; - TaitoIrqLine = 6; - TaitoFrameInterleave = 100; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = 12000000 / 60; - nTaitoCyclesTotal[2] = (16000000 / 4) / 60; - - TaitoZSetupShifter(); - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static INT32 DblaxleInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x400; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 16; - TaitoCharHeight = 16; - TaitoCharPlaneOffsets = DblaxleCharPlaneOffsets; - TaitoCharXOffsets = DblaxleCharXOffsets; - TaitoCharYOffsets = DblaxleCharYOffsets; - TaitoNumChar = 0x2000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = Sprite16x8YOffsets; - TaitoNumSpriteA = 0x10000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - TC0150RODInit(TaitoRoadRomSize, 0); - TC0480SCPInit(TaitoNumChar, 0, 0x21, 8, 4, 0, 0); - TC0140SYTInit(0); - TC0510NIOInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x200000, 0x203fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x210000, 0x21ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x800000, 0x801fff, MAP_RAM); - SekMapMemory(TC0480SCPRam , 0x900000, 0x90ffff, MAP_RAM); - SekMapMemory(TC0480SCPRam , 0xa00000, 0xa0ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0xc00000, 0xc03fff, MAP_RAM); - SekSetReadWordHandler(0, Dblaxle68K1ReadWord); - SekSetWriteWordHandler(0, Dblaxle68K1WriteWord); - SekSetReadByteHandler(0, Dblaxle68K1ReadByte); - SekSetWriteByteHandler(0, Dblaxle68K1WriteByte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x110000, 0x11ffff, MAP_RAM); - SekMapMemory(TC0150RODRam , 0x300000, 0x301fff, MAP_RAM); - SekClose(); - - TaitoZZ80Init(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &TaitoZFMIRQHandler, TaitoZSynchroniseStream, TaitoZGetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - TaitoZYM2610Route1MasterVol = 8.00; - TaitoZYM2610Route2MasterVol = 8.00; - bYM2610UseSeperateVolumes = 1; - - TaitoMakeInputsFunction = DblaxleMakeInputs; - TaitoDrawFunction = DblaxleDraw; - TaitoIrqLine = 4; - TaitoFrameInterleave = 100; - - nTaitoCyclesTotal[0] = 16000000 / 60; - nTaitoCyclesTotal[1] = 16000000 / 60; - nTaitoCyclesTotal[2] = (16000000 / 4) / 60; - - GenericTilesInit(); - - TaitoZSetupShifter(); - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static INT32 EnforceInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = Sprite16x8YOffsets; - TaitoNumSpriteA = 0x8000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - GenericTilesInit(); - - TC0100SCNInit(0, TaitoNumChar, 0, 16, 0, NULL); - TC0110PCRInit(1, 0x1000); - TC0150RODInit(TaitoRoadRomSize, 0); - TC0140SYTInit(0); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x104000, 0x107fff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x300000, 0x3006ff, MAP_RAM); - SekMapMemory(TC0150RODRam , 0x400000, 0x401fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x600000, 0x60ffff, MAP_READ); - SekSetWriteByteHandler(0, Enforce68K1WriteByte); - SekSetReadWordHandler(0, Enforce68K1ReadWord); - SekSetWriteWordHandler(0, Enforce68K1WriteWord); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x104000, 0x107fff, MAP_RAM); - SekSetReadWordHandler(0, Enforce68K2ReadWord); - SekSetWriteWordHandler(0, Enforce68K2WriteWord); - SekSetReadByteHandler(0, Enforce68K2ReadByte); - SekSetWriteByteHandler(0, Enforce68K2WriteByte); - SekClose(); - - TaitoZZ80Init(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &TaitoZFMIRQHandler, TaitoZSynchroniseStream, TaitoZGetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.20); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.20); - TaitoZYM2610Route1MasterVol = 20.00; - TaitoZYM2610Route2MasterVol = 20.00; - bYM2610UseSeperateVolumes = 1; - - TaitoMakeInputsFunction = EnforceMakeInputs; - TaitoDrawFunction = EnforceDraw; - TaitoIrqLine = 6; - TaitoFrameInterleave = 100; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = 12000000 / 60; - nTaitoCyclesTotal[2] = (16000000 / 4) / 60; - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static INT32 NightstrInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x400; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 16; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = SpriteYOffsets; - TaitoNumSpriteA = 0x4000; - - TaitoSpriteBModulo = 0x400; - TaitoSpriteBNumPlanes = 4; - TaitoSpriteBWidth = 16; - TaitoSpriteBHeight = 16; - TaitoSpriteBPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteBXOffsets = SpriteXOffsets; - TaitoSpriteBYOffsets = SpriteYOffsets; - TaitoNumSpriteB = 0x4000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - GenericTilesInit(); - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, TaitoPriorityMap); - TC0110PCRInit(1, 0x1000); - TC0150RODInit(TaitoRoadRomSize, 0); - TC0150RODSetPriMap(TaitoPriorityMap); - TC0140SYTInit(0); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x10ffff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x110000, 0x113fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0xc00000, 0xc0ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0xd00000, 0xd007ff, MAP_RAM); - SekSetReadWordHandler(0, Nightstr68K1ReadWord); - SekSetWriteWordHandler(0, Nightstr68K1WriteWord); - SekSetReadByteHandler(0, Nightstr68K1ReadByte); - SekSetWriteByteHandler(0, Nightstr68K1WriteByte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x104000, 0x107fff, MAP_RAM); - SekMapMemory(TC0150RODRam , 0x800000, 0x801fff, MAP_RAM); - SekClose(); - - TaitoZZ80Init(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &TaitoZFMIRQHandler, TaitoZSynchroniseStream, TaitoZGetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.20); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.20); - TaitoZYM2610Route1MasterVol = 1.00; - TaitoZYM2610Route2MasterVol = 1.00; - bYM2610UseSeperateVolumes = 1; - - TaitoMakeInputsFunction = NightstrMakeInputs; - TaitoDrawFunction = ChasehqDraw; - TaitoIrqLine = 4; - TaitoFrameInterleave = 100; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = 12000000 / 60; - nTaitoCyclesTotal[2] = (16000000 / 4) / 60; - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static INT32 RacingbInit() -{ - INT32 nLen; - - Sci = 1; - - TaitoCharModulo = 0x400; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 16; - TaitoCharHeight = 16; - TaitoCharPlaneOffsets = DblaxleCharPlaneOffsets; - TaitoCharXOffsets = DblaxleCharXOffsets; - TaitoCharYOffsets = DblaxleCharYOffsets; - TaitoNumChar = 0x2000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = Sprite16x8YOffsets; - TaitoNumSpriteA = 0x10000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - TC0150RODInit(TaitoRoadRomSize, 0); - TC0480SCPInit(TaitoNumChar, 0, 0x1f, 8, 4, 0, 0); - TC0140SYTInit(0); - TC0510NIOInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x103fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x110000, 0x11ffff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x700000, 0x701fff, MAP_RAM); - SekMapMemory(TC0480SCPRam , 0x900000, 0x90ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0xb00000, 0xb03fff, MAP_RAM); - SekSetReadWordHandler(0, Racingb68K1ReadWord); - SekSetWriteWordHandler(0, Racingb68K1WriteWord); - SekSetReadByteHandler(0, Racingb68K1ReadByte); - SekSetWriteByteHandler(0, Racingb68K1WriteByte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x400000, 0x403fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x410000, 0x41ffff, MAP_RAM); - SekMapMemory(TC0150RODRam , 0xa00000, 0xa01fff, MAP_RAM); - SekClose(); - - TaitoZZ80Init(); - - BurnYM2610Init(32000000 / 4, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &TaitoZFMIRQHandler, TaitoZSynchroniseStream, TaitoZGetTime, 0); - BurnTimerAttachZet(32000000 / 8); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - TaitoZYM2610Route1MasterVol = 8.00; - TaitoZYM2610Route2MasterVol = 8.00; - bYM2610UseSeperateVolumes = 1; - - TaitoMakeInputsFunction = DblaxleMakeInputs; - TaitoDrawFunction = RacingbDraw; - TaitoIrqLine = 4; - TaitoFrameInterleave = 100; - - nTaitoCyclesTotal[0] = 16000000 / 60; - nTaitoCyclesTotal[1] = 16000000 / 60; - nTaitoCyclesTotal[2] = (16000000 / 4) / 60; - - GenericTilesInit(); - - TaitoZSetupShifter(); - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static INT32 SciInit() -{ - INT32 nLen; - - Sci = 1; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = Sprite16x8YOffsets; - TaitoNumSpriteA = 0x8000; - - TaitoNum68Ks = 2; - TaitoNumZ80s = 1; - TaitoNumYM2610 = 1; - - GenericTilesInit(); - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - TC0100SCNInit(0, TaitoNumChar, 0, 8, 0, TaitoPriorityMap); - TC0150RODInit(TaitoRoadRomSize, 0); - TC0150RODSetPriMap(TaitoPriorityMap); - TC0140SYTInit(0); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x100000, 0x107fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x108000, 0x10bfff, MAP_RAM); - SekMapMemory(TaitoPaletteRam , 0x800000, 0x801fff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0xa00000, 0xa0ffff, MAP_READ); - SekMapMemory(TaitoSpriteRam , 0xc00000, 0xc03fff, MAP_RAM); - SekSetWriteWordHandler(0, Sci68K1WriteWord); - SekSetReadByteHandler(0, Sci68K1ReadByte); - SekSetWriteByteHandler(0, Sci68K1WriteByte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x01ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x200000, 0x203fff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x208000, 0x20bfff, MAP_RAM); - SekMapMemory(TC0150RODRam , 0xa00000, 0xa01fff, MAP_RAM); - SekClose(); - - TaitoZZ80Init(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, &TaitoZFMIRQHandler, TaitoZSynchroniseStream, TaitoZGetTime, 0); - BurnTimerAttachZet(16000000 / 4); - BurnYM2610SetLeftVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - BurnYM2610SetRightVolume(BURN_SND_YM2610_AY8910_ROUTE, 0.25); - TaitoZYM2610Route1MasterVol = 1.00; - TaitoZYM2610Route2MasterVol = 1.00; - bYM2610UseSeperateVolumes = 1; - - TaitoMakeInputsFunction = SciMakeInputs; - TaitoDrawFunction = SciDraw; - TaitoIrqLine = 4; - TaitoFrameInterleave = 100; - - nTaitoCyclesTotal[0] = 12000000 / 60; - nTaitoCyclesTotal[1] = 12000000 / 60; - nTaitoCyclesTotal[2] = (16000000 / 4) / 60; - - TaitoZSetupShifter(); - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static INT32 SpacegunInit() -{ - INT32 nLen; - - TaitoCharModulo = 0x100; - TaitoCharNumPlanes = 4; - TaitoCharWidth = 8; - TaitoCharHeight = 8; - TaitoCharPlaneOffsets = CharPlaneOffsets; - TaitoCharXOffsets = CharXOffsets; - TaitoCharYOffsets = CharYOffsets; - TaitoNumChar = 0x4000; - - TaitoSpriteAModulo = 0x200; - TaitoSpriteANumPlanes = 4; - TaitoSpriteAWidth = 16; - TaitoSpriteAHeight = 8; - TaitoSpriteAPlaneOffsets = SpritePlaneOffsets; - TaitoSpriteAXOffsets = SpriteXOffsets; - TaitoSpriteAYOffsets = Sprite16x8YOffsets; - TaitoNumSpriteA = 0x10000; - - TaitoNum68Ks = 2; - TaitoNumYM2610 = 1; - - TaitoLoadRoms(0); - - // Allocate and Blank all required memory - TaitoMem = NULL; - MemIndex(); - nLen = TaitoMemEnd - (UINT8 *)0; - if ((TaitoMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(TaitoMem, 0, nLen); - MemIndex(); - - GenericTilesInit(); - - TC0100SCNInit(0, TaitoNumChar, 4, 8, 1, NULL); - TC0110PCRInit(1, 0x1000); - TC0220IOCInit(); - - if (TaitoLoadRoms(1)) return 1; - -#ifdef BUILD_A68K - SwitchToMusashi(); -#endif - - // Setup the 68000 emulation - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Taito68KRom1 , 0x000000, 0x07ffff, MAP_ROM); - SekMapMemory(Taito68KRam1 , 0x30c000, 0x30ffff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x310000, 0x31ffff, MAP_RAM); - SekMapMemory(TaitoSpriteRam , 0x500000, 0x5005ff, MAP_RAM); - SekMapMemory(TC0100SCNRam[0] , 0x900000, 0x90ffff, MAP_READ); - SekSetReadWordHandler(0, Spacegun68K1ReadWord); - SekSetWriteWordHandler(0, Spacegun68K1WriteWord); - SekSetWriteByteHandler(0, Spacegun68K1WriteByte); - SekClose(); - - SekInit(1, 0x68000); - SekOpen(1); - SekMapMemory(Taito68KRom2 , 0x000000, 0x03ffff, MAP_ROM); - SekMapMemory(Taito68KRam2 , 0x20c000, 0x20ffff, MAP_RAM); - SekMapMemory(TaitoSharedRam , 0x210000, 0x21ffff, MAP_RAM); - SekSetReadWordHandler(0, Spacegun68K2ReadWord); - SekSetWriteWordHandler(0, Spacegun68K2WriteWord); - SekSetReadByteHandler(0, Spacegun68K2ReadByte); - SekSetWriteByteHandler(0, Spacegun68K2WriteByte); - SekClose(); - - BurnYM2610Init(16000000 / 2, TaitoYM2610ARom, (INT32*)&TaitoYM2610ARomSize, TaitoYM2610BRom, (INT32*)&TaitoYM2610BRomSize, NULL, TaitoZ68KSynchroniseStream, TaitoZ68KGetTime, 0); - BurnTimerAttachSek(16000000); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE, 0.25, BURN_SND_ROUTE_BOTH); - - EEPROMInit(&spacegun_eeprom_intf); - if (!EEPROMAvailable()) EEPROMFill(spacegun_default_eeprom, 0, 128); - - TaitoMakeInputsFunction = SpacegunMakeInputs; - TaitoDrawFunction = SpacegunDraw; - TaitoIrqLine = 4; - TaitoFrameInterleave = 100; - TaitoFlipScreenX = 1; - TaitoNumEEPROM = 1; - - nTaitoCyclesTotal[0] = 16000000 / 60; - nTaitoCyclesTotal[1] = 16000000 / 60; - - BurnGunInit(2, true); - bUseGun = 1; - - // Reset the driver - TaitoZDoReset(); - - return 0; -} - -static INT32 TaitoZExit() -{ - TaitoExit(); - - SciSpriteFrame = 0; - OldSteer = 0; - Sci = 0; - TaitoZINT6timer = 0; - - if (bUseGun) - BurnGunExit(); - bUseGun = 0; - - if (bUseShifter) - BurnShiftExit(); - bUseShifter = 0; - -#ifdef BUILD_A68K - // Switch back CPU core if needed - if (bUseAsm68KCoreOldValue) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching back to A68K core\n")); -#endif - bUseAsm68KCoreOldValue = false; - bBurnUseASMCPUEmulation = true; - } -#endif - - return 0; -} - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 0); - g = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 5); - b = pal5bit(BURN_ENDIAN_SWAP_INT16(nColour) >> 10); - - return BurnHighCol(r, g, b, 0); -} - -static void TaitoZCalcPalette() -{ - INT32 i; - UINT16* ps; - UINT32* pd; - - for (i = 0, ps = (UINT16*)TaitoPaletteRam, pd = TaitoPalette; i < 0x1000; i++, ps++, pd++) { - *pd = CalcCol(*ps); - } -} - -static void RenderSpriteZoom(INT32 Code, INT32 sx, INT32 sy, INT32 Colour, INT32 xFlip, INT32 yFlip, INT32 xScale, INT32 yScale, UINT8* pSource) -{ - // We can use sprite A for sizes, etc. as only Chase HQ uses sprite B and it has the same sizes and count - - UINT8 *SourceBase = pSource + ((Code % TaitoNumSpriteA) * TaitoSpriteAWidth * TaitoSpriteAHeight); - - INT32 SpriteScreenHeight = (yScale * TaitoSpriteAHeight + 0x8000) >> 16; - INT32 SpriteScreenWidth = (xScale * TaitoSpriteAWidth + 0x8000) >> 16; - - Colour = 0x10 * (Colour % 0x100); - - if (TaitoFlipScreenX) { - xFlip = !xFlip; - sx = 320 - sx - (xScale >> 12); - } - - if (SpriteScreenWidth && SpriteScreenHeight) { - INT32 dx = (TaitoSpriteAWidth << 16) / SpriteScreenWidth; - INT32 dy = (TaitoSpriteAHeight << 16) / SpriteScreenHeight; - - INT32 ex = sx + SpriteScreenWidth; - INT32 ey = sy + SpriteScreenHeight; - - INT32 xIndexBase; - INT32 yIndex; - - if (xFlip) { - xIndexBase = (SpriteScreenWidth - 1) * dx; - dx = -dx; - } else { - xIndexBase = 0; - } - - if (yFlip) { - yIndex = (SpriteScreenHeight - 1) * dy; - dy = -dy; - } else { - yIndex = 0; - } - - if (sx < 0) { - INT32 Pixels = 0 - sx; - sx += Pixels; - xIndexBase += Pixels * dx; - } - - if (sy < 0) { - INT32 Pixels = 0 - sy; - sy += Pixels; - yIndex += Pixels * dy; - } - - if (ex > nScreenWidth) { - INT32 Pixels = ex - nScreenWidth; - ex -= Pixels; - } - - if (ey > nScreenHeight) { - INT32 Pixels = ey - nScreenHeight; - ey -= Pixels; - } - - if (ex > sx) { - INT32 y; - - for (y = sy; y < ey; y++) { - UINT8 *Source = SourceBase + ((yIndex >> 16) * TaitoSpriteAWidth); - UINT16* pPixel = pTransDraw + (y * nScreenWidth); - - INT32 x, xIndex = xIndexBase; - for (x = sx; x < ex; x++) { - INT32 c = Source[xIndex >> 16]; - if (c != 0) { - pPixel[x] = c | Colour; - } - xIndex += dx; - } - - yIndex += dy; - } - } - } -} - -static void RenderSpriteZoomPri(INT32 Code, INT32 sx, INT32 sy, INT32 Colour, INT32 xFlip, INT32 yFlip, INT32 xScale, INT32 yScale, UINT8* pSource, INT32 Priority) -{ - // We can use sprite A for sizes, etc. as only Chase HQ uses sprite B and it has the same sizes and count - - UINT8 *SourceBase = pSource + ((Code % TaitoNumSpriteA) * TaitoSpriteAWidth * TaitoSpriteAHeight); - - INT32 SpriteScreenHeight = (yScale * TaitoSpriteAHeight + 0x8000) >> 16; - INT32 SpriteScreenWidth = (xScale * TaitoSpriteAWidth + 0x8000) >> 16; - - Colour = 0x10 * (Colour % 0x100); - - Priority |= 1 << 31; - - if (TaitoFlipScreenX) { - xFlip = !xFlip; - sx = 320 - sx - (xScale >> 12); - } - - if (SpriteScreenWidth && SpriteScreenHeight) { - INT32 dx = (TaitoSpriteAWidth << 16) / SpriteScreenWidth; - INT32 dy = (TaitoSpriteAHeight << 16) / SpriteScreenHeight; - - INT32 ex = sx + SpriteScreenWidth; - INT32 ey = sy + SpriteScreenHeight; - - INT32 xIndexBase; - INT32 yIndex; - - if (xFlip) { - xIndexBase = (SpriteScreenWidth - 1) * dx; - dx = -dx; - } else { - xIndexBase = 0; - } - - if (yFlip) { - yIndex = (SpriteScreenHeight - 1) * dy; - dy = -dy; - } else { - yIndex = 0; - } - - if (sx < 0) { - INT32 Pixels = 0 - sx; - sx += Pixels; - xIndexBase += Pixels * dx; - } - - if (sy < 0) { - INT32 Pixels = 0 - sy; - sy += Pixels; - yIndex += Pixels * dy; - } - - if (ex > nScreenWidth) { - INT32 Pixels = ex - nScreenWidth; - ex -= Pixels; - } - - if (ey > nScreenHeight) { - INT32 Pixels = ey - nScreenHeight; - ey -= Pixels; - } - - if (ex > sx) { - INT32 y; - - for (y = sy; y < ey; y++) { - UINT8 *Source = SourceBase + ((yIndex >> 16) * TaitoSpriteAWidth); - UINT16* pPixel = pTransDraw + (y * nScreenWidth); - UINT8 *pPri = TaitoPriorityMap + (y * nScreenWidth); - - INT32 x, xIndex = xIndexBase; - for (x = sx; x < ex; x++) { - INT32 c = Source[xIndex >> 16]; - if (c != 0) { - if ((Priority & (1 << pPri[x])) == 0) { - pPixel[x] = c | Colour; - } - pPri[x] = 0x1f; - } - xIndex += dx; - } - - yIndex += dy; - } - } - } -} - -static void AquajackRenderSprites(INT32 PriorityDraw) -{ - UINT16 *SpriteMap = (UINT16*)TaitoSpriteMapRom; - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Offset, Data, Tile, Colour, xFlip, yFlip; - INT32 x, y, Priority, xCur, yCur; - INT32 xZoom, yZoom, zx, zy; - INT32 SpriteChunk, MapOffset, Code, j, k, px, py; - - for (Offset = 0x200 - 4; Offset >= 0; Offset -= 4) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]); - Priority = (Data & 0x8000) >> 15; - - if (Priority != 0 && Priority != 1) bprintf(PRINT_NORMAL, _T("Unused Priority %x\n"), Priority); - if (Priority != PriorityDraw) continue; - - xFlip = (Data & 0x4000) >> 14; - x = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]); - yFlip = (Data & 0x8000) >> 15; - Tile = Data & 0x1fff; - if (!Tile) continue; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 0]); - yZoom = (Data & 0x7e00) >> 9; - y = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - Colour = (Data & 0xff00) >> 8; - xZoom = (Data & 0x3f); - - MapOffset = Tile << 5; - - xZoom += 1; - yZoom += 1; - - y += 3; - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - for (SpriteChunk = 0; SpriteChunk < 32; SpriteChunk++) { - k = SpriteChunk % 4; - j = SpriteChunk / 4; - - px = xFlip ? (3 - k) : k; - py = yFlip ? (7 - j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 2)]); - Code &= (TaitoNumSpriteA - 1); - - xCur = x + ((k * xZoom) / 4); - yCur = y + ((j * yZoom) / 8); - - zx = x + (((k + 1) * xZoom) / 4) - xCur; - zy = y + (((j + 1) * yZoom) / 8) - yCur; - - yCur -= 16; - - RenderSpriteZoom(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 13, TaitoSpritesA); - } - - - } -} - -static void BsharkRenderSprites(INT32 PriorityDraw, INT32 yOffset, INT32 SpriteRamSize) -{ - UINT16 *SpriteMap = (UINT16*)TaitoSpriteMapRom; - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Offset, Data, Tile, Colour, xFlip, yFlip; - INT32 x, y, Priority, xCur, yCur; - INT32 xZoom, yZoom, zx, zy; - INT32 SpriteChunk, MapOffset, Code, j, k, px, py; - - for (Offset = 0; Offset < SpriteRamSize - 4; Offset += 4) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]); - Priority = (Data & 0x8000) >> 15; - - if (Priority != 0 && Priority != 1) bprintf(PRINT_NORMAL, _T("Unused Priority %x\n"), Priority); - if (Priority != PriorityDraw) continue; - - Colour = (Data & 0x7f80) >> 7; - xZoom = (Data & 0x3f); - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]); - Tile = Data & 0x1fff; - if (!Tile) continue; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 0]); - yZoom = (Data & 0x7e00) >> 9; - y = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - yFlip = (Data & 0x8000) >> 15; - xFlip = (Data & 0x4000) >> 14; - x = Data & 0x1ff; - - MapOffset = Tile << 5; - - xZoom += 1; - yZoom += 1; - - y += yOffset; - y += (64 - yZoom); - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - for (SpriteChunk = 0; SpriteChunk < 32; SpriteChunk++) { - k = SpriteChunk % 4; - j = SpriteChunk / 4; - - px = xFlip ? (3 - k) : k; - py = yFlip ? (7 - j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 2)]); - Code &= (TaitoNumSpriteA - 1); - - xCur = x + ((k * xZoom) / 4); - yCur = y + ((j * yZoom) / 8); - - zx = x + (((k + 1) * xZoom) / 4) - xCur; - zy = y + (((j + 1) * yZoom) / 8) - yCur; - - yCur -= 16; - - RenderSpriteZoom(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 13, TaitoSpritesA); - } - - } -} - -static void ChasehqRenderSprites() -{ - UINT16 *SpriteMap = (UINT16*)TaitoSpriteMapRom; - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Offset, Data, Tile, Colour, xFlip, yFlip; - INT32 x, y, Priority, xCur, yCur; - INT32 xZoom, yZoom, zx, zy; - INT32 SpriteChunk, MapOffset, Code, j, k, px, py; - const INT32 primasks[2] = { 0xf0, 0xfc }; - - for (Offset = 0x400-4; Offset >= 0; Offset -= 4) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]); - Priority = (Data & 0x8000) >> 15; - - Colour = (Data & 0x7f80) >> 7; - xZoom = (Data & 0x7f); - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]); - Tile = Data & 0x7ff; - if (!Tile) continue; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 0]); - yZoom = (Data & 0xfe00) >> 9; - y = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - yFlip = (Data & 0x8000) >> 15; - xFlip = (Data & 0x4000) >> 14; - x = Data & 0x1ff; - - xZoom += 1; - yZoom += 1; - - y += 7; - y += (128 - yZoom); - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - if ((xZoom - 1) & 0x40) { - MapOffset = Tile << 6; - - for (SpriteChunk = 0; SpriteChunk < 64; SpriteChunk++) { - j = SpriteChunk / 8; - k = SpriteChunk % 8; - - px = xFlip ? (7 - k) : k; - py = yFlip ? (7 - j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 3)]); - Code &= (TaitoNumSpriteA - 1); - - xCur = x + ((k * xZoom) / 8); - yCur = y + ((j * yZoom) / 8); - - zx = x + (((k + 1) * xZoom) / 8) - xCur; - zy = y + (((j + 1) * yZoom) / 8) - yCur; - - yCur -= 16; - - RenderSpriteZoomPri(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 12, TaitoSpritesA, primasks[Priority]); - } - } else if ((xZoom - 1) & 0x20) { - MapOffset = (Tile << 5) + 0x20000; - - for (SpriteChunk = 0; SpriteChunk < 32; SpriteChunk++) { - j = SpriteChunk / 4; - k = SpriteChunk % 4; - - px = xFlip ? (3 - k) : k; - py = yFlip ? (7 - j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 2)]); - Code &= (TaitoNumSpriteB - 1); - - xCur = x + ((k * xZoom) / 4); - yCur = y + ((j * yZoom) / 8); - - zx = x + (((k + 1) * xZoom) / 4) - xCur; - zy = y + (((j + 1) * yZoom) / 8) - yCur; - - yCur -= 16; - - RenderSpriteZoomPri(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 12, TaitoSpritesB, primasks[Priority]); - } - } else if (!((xZoom - 1) & 0x60)) { - MapOffset = (Tile << 4) + 0x30000; - - for (SpriteChunk = 0; SpriteChunk < 16; SpriteChunk++) { - j = SpriteChunk / 2; - k = SpriteChunk % 2; - - px = xFlip ? (1 - k) : k; - py = yFlip ? (7 - j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 1)]); - Code &= (TaitoNumSpriteB - 1); - - xCur = x + ((k * xZoom) / 2); - yCur = y + ((j * yZoom) / 8); - - zx = x + (((k + 1) * xZoom) / 2) - xCur; - zy = y + (((j + 1) * yZoom) / 8) - yCur; - - yCur -= 16; - - RenderSpriteZoomPri(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 12, TaitoSpritesB, primasks[Priority]); - } - } - } -} - -static void ContcircRenderSprites(INT32 PriorityDraw, INT32 VisibleYOffset) -{ - UINT16 *SpriteMap = (UINT16*)TaitoSpriteMapRom; - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Offset, Data, Tile, Colour, xFlip, yFlip; - INT32 x, y, Priority, xCur, yCur; - INT32 xZoom, yZoom, zx, zy; - INT32 SpriteChunk, MapOffset, Code, j, k, px, py; - - for (Offset = 0x380 - 4; Offset >= 0; Offset -= 4) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - Priority = (Data & 0x8000) >> 15; - - if (Priority != 0 && Priority != 1) bprintf(PRINT_NORMAL, _T("Unused Priority %x\n"), Priority); - if (Priority != PriorityDraw) continue; - - xFlip = (Data & 0x4000) >> 14; - yFlip = (Data & 0x2000) >> 13; - x = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]); - Tile = Data & 0x7ff; - if (!Tile) continue; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 0]); - yZoom = (Data & 0xfe00) >> 9; - y = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]); - Colour = (Data & 0xff00) >> 8; - xZoom = (Data & 0x7f); - - MapOffset = Tile << 7; - - xZoom += 1; - yZoom += 1; - - y += 5; - y += ( 128 - yZoom); - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - for (SpriteChunk = 0; SpriteChunk < 128; SpriteChunk++) { - k = SpriteChunk % 8; - j = SpriteChunk / 8; - - px = xFlip ? (7 - k) : k; - py = yFlip ? (15 - j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 3)]); - Code &= (TaitoNumSpriteA - 1); - - xCur = x + ((k * xZoom) / 8); - yCur = y + ((j * yZoom) / 16); - - zx = x + (((k + 1) * xZoom) / 8) - xCur; - zy = y + (((j + 1) * yZoom) / 16) - yCur; - - yCur -= VisibleYOffset; - - RenderSpriteZoom(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 13, TaitoSpritesA); - } - } -} - -static void SciRenderSprites(INT32 PriorityDraw, INT32 yOffs) -{ - UINT16 *SpriteMap = (UINT16*)TaitoSpriteMapRom; - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Offset, StartOffs, Data, Tile, Colour, xFlip, yFlip; - INT32 x, y, Priority, xCur, yCur; - INT32 xZoom, yZoom, zx, zy; - INT32 SpriteChunk, MapOffset, Code, j, k, px, py; - - StartOffs = (SciSpriteFrame & 1) ? 0x800 : 0; - - for (Offset = StartOffs; Offset < StartOffs + 0x800; Offset += 4) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]); - Priority = (Data & 0x8000) >> 15; - - if (Priority != 0 && Priority != 1) bprintf(PRINT_NORMAL, _T("Unused Priority %x\n"), Priority); - if (Priority != PriorityDraw) continue; - - Colour = (Data & 0x7f80) >> 7; - xZoom = (Data & 0x3f); - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]); - Tile = Data & 0x1fff; - if (!Tile) continue; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 0]); - yZoom = (Data & 0x7e00) >> 9; - y = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - yFlip = (Data & 0x8000) >> 15; - xFlip = (Data & 0x4000) >> 14; - x = Data & 0x1ff; - - MapOffset = Tile << 5; - - xZoom += 1; - yZoom += 1; - - y += yOffs; - y += (64 - yZoom); - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - for (SpriteChunk = 0; SpriteChunk < 32; SpriteChunk++) { - k = SpriteChunk % 4; - j = SpriteChunk / 4; - - px = xFlip ? (3-k) : k; - py = yFlip ? (7-j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 2)]); - Code &= (TaitoNumSpriteA - 1); - - xCur = x + ((k * xZoom) / 4); - yCur = y + ((j * yZoom) / 8); - - zx = x + (((k + 1) * xZoom) / 4) - xCur; - zy = y + (((j + 1) * yZoom) / 8) - yCur; - - yCur -= 16; - - RenderSpriteZoom(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 13, TaitoSpritesA); - } - } -} - -static void SciRenderSpritesPrio(INT32 yOffs) -{ - UINT16 *SpriteMap = (UINT16*)TaitoSpriteMapRom; - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Offset, StartOffs, Data, Tile, Colour, xFlip, yFlip; - INT32 x, y, Priority, xCur, yCur; - INT32 xZoom, yZoom, zx, zy; - INT32 SpriteChunk, MapOffset, Code, j, k, px, py; - const INT32 primasks[2] = { 0xf0, 0xfc }; - - StartOffs = (SciSpriteFrame & 1) ? 0x800 : 0; - //StartOffs = 0x800 - StartOffs; - - for (Offset = (StartOffs + 0x800 - 4); Offset >= StartOffs; Offset -= 4) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]); - Priority = (Data & 0x8000) >> 15; - - Colour = (Data & 0x7f80) >> 7; - xZoom = (Data & 0x3f); - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]); - Tile = Data & 0x1fff; - if (!Tile) continue; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 0]); - yZoom = (Data & 0x7e00) >> 9; - y = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - yFlip = (Data & 0x8000) >> 15; - xFlip = (Data & 0x4000) >> 14; - x = Data & 0x1ff; - - MapOffset = Tile << 5; - - xZoom += 1; - yZoom += 1; - - y += yOffs; - y += (64 - yZoom); - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - for (SpriteChunk = 0; SpriteChunk < 32; SpriteChunk++) { - k = SpriteChunk % 4; - j = SpriteChunk / 4; - - px = xFlip ? (3-k) : k; - py = yFlip ? (7-j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 2)]); - Code &= (TaitoNumSpriteA - 1); - - xCur = x + ((k * xZoom) / 4); - yCur = y + ((j * yZoom) / 8); - - zx = x + (((k + 1) * xZoom) / 4) - xCur; - zy = y + (((j + 1) * yZoom) / 8) - yCur; - - yCur -= 16; - - RenderSpriteZoomPri(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 13, TaitoSpritesA, primasks[Priority]); - } - } -} - -static void SpacegunRenderSprites(INT32 PriorityDraw) -{ - UINT16 *SpriteMap = (UINT16*)TaitoSpriteMapRom; - UINT16 *SpriteRam = (UINT16*)TaitoSpriteRam; - INT32 Offset, Data, Tile, Colour, xFlip, yFlip; - INT32 x, y, Priority, xCur, yCur; - INT32 xZoom, yZoom, zx, zy; - INT32 SpriteChunk, MapOffset, Code, j, k, px, py; - - for (Offset = 0x300 - 4; Offset >= 0; Offset -= 4) { - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 1]); - Priority = (Data & 0x8000) >> 15; - - if (Priority != 0 && Priority != 1) bprintf(PRINT_NORMAL, _T("Unused Priority %x\n"), Priority); - if (Priority != PriorityDraw) continue; - - xFlip = (Data & 0x4000) >> 14; - x = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 3]); - yFlip = (Data & 0x8000) >> 15; - Tile = Data & 0x1fff; - if (!Tile) continue; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 0]); - yZoom = (Data & 0xfe00) >> 9; - y = Data & 0x1ff; - - Data = BURN_ENDIAN_SWAP_INT16(SpriteRam[Offset + 2]); - Colour = (Data & 0xff00) >> 8; - xZoom = (Data & 0x7f); - - MapOffset = Tile << 5; - - xZoom += 1; - yZoom += 1; - - y += 4; - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - for (SpriteChunk = 0; SpriteChunk < 32; SpriteChunk++) { - k = SpriteChunk % 4; - j = SpriteChunk / 4; - - px = xFlip ? (3 - k) : k; - py = yFlip ? (7 - j) : j; - - Code = BURN_ENDIAN_SWAP_INT16(SpriteMap[MapOffset + px + (py << 2)]); - Code &= (TaitoNumSpriteA - 1); - - xCur = x + ((k * xZoom) / 4); - yCur = y + ((j * yZoom) / 8); - - zx = x + (((k + 1) * xZoom) / 4) - xCur; - zy = y + (((j + 1) * yZoom) / 8) - yCur; - - yCur -= 16; - - RenderSpriteZoom(Code, xCur, yCur, Colour, xFlip, yFlip, zx << 12, zy << 13, TaitoSpritesA); - } - - } -} - -static void AquajackDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 1, TaitoChars); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 1, TaitoChars); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - AquajackRenderSprites(1); - - TC0150RODDraw(-1, 0, 2, 1, 1, 2); - - AquajackRenderSprites(0); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TC0110PCRPalette); -} - -static void BsharkDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - TaitoZCalcPalette(); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 1, TaitoChars); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 1, TaitoChars); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - BsharkRenderSprites(1, 8, 0x800); - - TC0150RODDraw(-1, 0xc0, 0, 1, 1, 2); - - BsharkRenderSprites(0, 8, 0x800); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TaitoPalette); -} - -static void ChasehqDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - - memset(TaitoPriorityMap, 0, nScreenWidth * nScreenHeight); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) if (nBurnLayer & 1) TC0100SCNRenderFgLayer(0, 1, TaitoChars, 0); - if (!(Disable & 0x01)) if (nBurnLayer & 2) TC0100SCNRenderBgLayer(0, 0, TaitoChars, 1); - } else { - if (!(Disable & 0x01)) if (nBurnLayer & 1) TC0100SCNRenderBgLayer(0, 1, TaitoChars, 0); - if (!(Disable & 0x02)) if (nBurnLayer & 2) TC0100SCNRenderFgLayer(0, 0, TaitoChars, 1); - } - if (nBurnLayer & 4) TC0150RODDraw(-1, 0xc0, 0, 0, 1, 2); - - if (nBurnLayer & 8) if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - - if (nSpriteEnable & 1) ChasehqRenderSprites(); - - BurnTransferCopy(TC0110PCRPalette); - if (bUseShifter) BurnShiftRender(); -} - -static void ContcircDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - ContcircRenderSprites(1, 24); - - TC0150RODDraw(-3 + 8, TaitoRoadPalBank << 6, 1, 0, 1, 2); - - ContcircRenderSprites(0, 24); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TC0110PCRPalette); - BurnShiftRender(); -} - -static void EnforceDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - ContcircRenderSprites(1, 24); - - TC0150RODDraw(-3 + 8, 0xc0, 1, 0, 1, 2); - - ContcircRenderSprites(0, 24); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TC0110PCRPalette); -} - -static void DblaxleDraw() -{ - UINT8 Layer[4]; - UINT16 Priority = TC0480SCPGetBgPriority(); - - Layer[0] = (Priority & 0xf000) >> 12; - Layer[1] = (Priority & 0x0f00) >> 8; - Layer[2] = (Priority & 0x00f0) >> 4; - Layer[3] = (Priority & 0x000f) >> 0; - - BurnTransferClear(); - TaitoZCalcPalette(); - - TC0480SCPTilemapRender(Layer[0], 1, TaitoChars); - TC0480SCPTilemapRender(Layer[1], 0, TaitoChars); - TC0480SCPTilemapRender(Layer[2], 0, TaitoChars); - - BsharkRenderSprites(1, 7, 0x2000); - - TC0150RODDraw(-1, 0xc0, 0, 0, 1, 2); - - BsharkRenderSprites(0, 7, 0x2000); - - TC0480SCPTilemapRender(Layer[3], 0, TaitoChars); - - TC0480SCPRenderCharLayer(); - BurnTransferCopy(TaitoPalette); - BurnShiftRender(); -} - -static void RacingbDraw() -{ - UINT8 Layer[4]; - UINT16 Priority = TC0480SCPGetBgPriority(); - - Layer[0] = (Priority & 0xf000) >> 12; - Layer[1] = (Priority & 0x0f00) >> 8; - Layer[2] = (Priority & 0x00f0) >> 4; - Layer[3] = (Priority & 0x000f) >> 0; - - BurnTransferClear(); - TaitoZCalcPalette(); - - TC0480SCPTilemapRender(Layer[0], 1, TaitoChars); - TC0480SCPTilemapRender(Layer[1], 0, TaitoChars); - SciRenderSprites(1, 7); - TC0480SCPTilemapRender(Layer[2], 0, TaitoChars); - TC0480SCPTilemapRender(Layer[3], 0, TaitoChars); - TC0150RODDraw(-1, 0xc0, 0, 0, 1, 2); - SciRenderSprites(0, 7); - TC0480SCPRenderCharLayer(); - BurnTransferCopy(TaitoPalette); - BurnShiftRender(); -} - -static void SciDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - TaitoZCalcPalette(); - - memset(TaitoPriorityMap, 0, nScreenWidth * nScreenHeight); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 1, TaitoChars, 0); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars, 1); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 1, TaitoChars, 0); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars, 1); - } - - TC0150RODDraw(-1, 0xc0, 0, 0, 1, 2); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - - SciRenderSpritesPrio(6); - - BurnTransferCopy(TaitoPalette); - BurnShiftRender(); -} - -static void SpacegunDraw() -{ - INT32 Disable = TC0100SCNCtrl[0][6] & 0xf7; - - BurnTransferClear(); - - if (TC0100SCNBottomLayer(0)) { - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 1, TaitoChars); - SpacegunRenderSprites(1); - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 0, TaitoChars); - } else { - if (!(Disable & 0x01)) TC0100SCNRenderBgLayer(0, 1, TaitoChars); - SpacegunRenderSprites(1); - if (!(Disable & 0x02)) TC0100SCNRenderFgLayer(0, 0, TaitoChars); - } - - SpacegunRenderSprites(0); - - if (!(Disable & 0x04)) TC0100SCNRenderCharLayer(0); - BurnTransferCopy(TC0110PCRPalette); - - for (INT32 i = 0; i < nBurnGunNumPlayers; i++) { - BurnGunDrawTarget(i, BurnGunX[i] >> 8, BurnGunY[i] >> 8); - } -} - -static INT32 TaitoZFrame() -{ - INT32 nInterleave = TaitoFrameInterleave; - INT32 nVBlankIRQFire = (INT32)(((double)270 / 271) * TaitoFrameInterleave); - - if (TaitoReset) TaitoZDoReset(); - - TaitoMakeInputsFunction(); - - nTaitoCyclesDone[0] = nTaitoCyclesDone[1] = nTaitoCyclesDone[2] = 0; - - SekNewFrame(); - if (TaitoNumZ80s) ZetNewFrame(); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU, nNext; - - // Run 68000 #1 - nCurrentCPU = 0; - SekOpen(0); - if (TaitoNumZ80s) { - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - } else { - BurnTimerUpdate((i + 1) * (nTaitoCyclesTotal[nCurrentCPU] / nInterleave)); - } - if (i == 10 && Sci && ((GetCurrentFrame() & 1) == 0)) SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - if (TaitoZINT6timer && (SekTotalCycles() >= (TaitoZINT6timer + 10000))) { - SekSetIRQLine(6, CPU_IRQSTATUS_AUTO); - TaitoZINT6timer = 0; - } - if (i == nVBlankIRQFire) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - - // Run 68000 #2 - if (TaitoCpuACtrl & 0x01) { - nCurrentCPU = 1; - SekOpen(1); - nNext = (i + 1) * nTaitoCyclesTotal[nCurrentCPU] / nInterleave; - nTaitoCyclesSegment = nNext - nTaitoCyclesDone[nCurrentCPU]; - nTaitoCyclesDone[nCurrentCPU] += SekRun(nTaitoCyclesSegment); - if (i == nVBlankIRQFire) SekSetIRQLine(TaitoIrqLine, CPU_IRQSTATUS_AUTO); - SekClose(); - } - - if (TaitoNumZ80s) { - ZetOpen(0); - BurnTimerUpdate((i + 1) * (nTaitoCyclesTotal[2] / nInterleave)); - ZetClose(); - } - } - - if (TaitoNumZ80s) { - ZetOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[2]); - if (pBurnSoundOut) BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - ZetClose(); - } else { - SekOpen(0); - BurnTimerEndFrame(nTaitoCyclesTotal[0]); - if (pBurnSoundOut) BurnYM2610Update(pBurnSoundOut, nBurnSoundLen); - SekClose(); - } - - if (pBurnDraw) TaitoDrawFunction(); - - return 0; -} - -static INT32 TaitoZScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029674; - } - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TaitoRamStart; - ba.nLen = TaitoRamEnd-TaitoRamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - TaitoICScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SekScan(nAction); - if (TaitoNumZ80s) ZetScan(nAction); - - BurnYM2610Scan(nAction, pnMin); - - if (bUseGun) - BurnGunScan(); - - if (bUseShifter) - BurnShiftScan(nAction); - - SCAN_VAR(TaitoAnalogPort0); - SCAN_VAR(TaitoAnalogPort1); - SCAN_VAR(TaitoAnalogPort2); - SCAN_VAR(TaitoAnalogPort3); - SCAN_VAR(TaitoInput); - SCAN_VAR(OldSteer); - SCAN_VAR(TaitoCpuACtrl); - SCAN_VAR(TaitoZ80Bank); - SCAN_VAR(SciSpriteFrame); - SCAN_VAR(TaitoRoadPalBank); - SCAN_VAR(nTaitoCyclesDone); - SCAN_VAR(nTaitoCyclesSegment); - } - - if (nAction & ACB_WRITE) { - if (TaitoNumZ80s) { - ZetOpen(0); - ZetMapArea(0x4000, 0x7fff, 0, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetMapArea(0x4000, 0x7fff, 2, TaitoZ80Rom1 + 0x4000 + (TaitoZ80Bank * 0x4000)); - ZetClose(); - } - } - - return 0; -} - -struct BurnDriver BurnDrvAquajack = { - "aquajack", NULL, NULL, NULL, "1990", - "Aquajack (World)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, AquajackRomInfo, AquajackRomName, NULL, NULL, AquajackInputInfo, AquajackDIPInfo, - AquajackInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvAquajackj = { - "aquajackj", "aquajack", NULL, NULL, "1990", - "Aquajack (Japan)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, AquajackjRomInfo, AquajackjRomName, NULL, NULL, AquajackInputInfo, AquajackjDIPInfo, - AquajackInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvAquajacku = { - "aquajacku", "aquajack", NULL, NULL, "1990", - "Aquajack (US)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, AquajackuRomInfo, AquajackuRomName, NULL, NULL, AquajackInputInfo, AquajackjDIPInfo, - AquajackInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBshark = { - "bshark", NULL, NULL, NULL, "1989", - "Battle Shark (World)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, BsharkRomInfo, BsharkRomName, NULL, NULL, BsharkInputInfo, BsharkDIPInfo, - BsharkInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBsharkj = { - "bsharkj", "bshark", NULL, NULL, "1989", - "Battle Shark (Japan)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, BsharkjRomInfo, BsharkjRomName, NULL, NULL, BsharkInputInfo, BsharkjDIPInfo, - BsharkInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBsharkjjs = { - "bsharkjjs", "bshark", NULL, NULL, "1989", - "Battle Shark (Japan, Joystick)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, BsharkjjsRomInfo, BsharkjjsRomName, NULL, NULL, BsharkjjsInputInfo, BsharkjjsDIPInfo, - BsharkInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvBsharku = { - "bsharku", "bshark", NULL, NULL, "1989", - "Battle Shark (US)\0", NULL, "Taito America Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, BsharkuRomInfo, BsharkuRomName, NULL, NULL, BsharkInputInfo, BsharkuDIPInfo, - BsharkInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvChasehq = { - "chasehq", NULL, NULL, NULL, "1988", - "Chase H.Q. (World)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ChasehqRomInfo, ChasehqRomName, NULL, NULL, ChasehqInputInfo, ChasehqDIPInfo, - ChasehqInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvChasehqj = { - "chasehqj", "chasehq", NULL, NULL, "1988", - "Chase H.Q. (Japan)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ChasehqjRomInfo, ChasehqjRomName, NULL, NULL, ChasehqInputInfo, ChasehqjDIPInfo, - ChasehqInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvChasehqju = { - "chasehqju", "chasehq", NULL, NULL, "1988", - "Chase H.Q. (Japan UP)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ChasehqjuRomInfo, ChasehqjuRomName, NULL, NULL, ChasehqInputInfo, ChasehqjDIPInfo, - ChasehqInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvChasehqu = { - "chasehqu", "chasehq", NULL, NULL, "1988", - "Chase H.Q. (US)\0", NULL, "Taito America Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ChasehquRomInfo, ChasehquRomName, NULL, NULL, ChasehqInputInfo, ChasehqDIPInfo, - ChasehqInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvContcirc = { - "contcirc", NULL, NULL, NULL, "1987", - "Continental Circus (World)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ContcircRomInfo, ContcircRomName, NULL, NULL, ContcircInputInfo, ContcircDIPInfo, - ContcircInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvContcircu = { - "contcircu", "contcirc", NULL, NULL, "1987", - "Continental Circus (US set 1)\0", NULL, "Taito America Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ContcircuRomInfo, ContcircuRomName, NULL, NULL, ContcircInputInfo, ContcircuDIPInfo, - ContcircInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvContcircua = { - "contcircua", "contcirc", NULL, NULL, "1987", - "Continental Circus (US set 2)\0", "3D Effect cannot be disabled, use US Set 1 instead!", "Taito America Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ContcircuaRomInfo, ContcircuaRomName, NULL, NULL, ContcircInputInfo, ContcircjDIPInfo, - ContcircInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvContcircj = { - "contcircj", "contcirc", NULL, NULL, "1987", - "Continental Circus (Japan)\0", "3D Effect cannot be disabled, use World romset instead!", "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ContcircjRomInfo, ContcircjRomName, NULL, NULL, ContcircInputInfo, ContcircjDIPInfo, - ContcircInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvDblaxle = { - "dblaxle", NULL, NULL, NULL, "1991", - "Double Axle (US)\0", NULL, "Taito America Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, DblaxleRomInfo, DblaxleRomName, NULL, NULL, DblaxleInputInfo, DblaxleDIPInfo, - DblaxleInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvDblaxleu = { - "dblaxleu", "dblaxle", NULL, NULL, "1991", - "Double Axle (US earlier)\0", NULL, "Taito America Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, DblaxleuRomInfo, DblaxleuRomName, NULL, NULL, DblaxleInputInfo, DblaxleDIPInfo, - DblaxleInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvPwheelsj = { - "pwheelsj", "dblaxle", NULL, NULL, "1991", - "Power Wheels (Japan)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, PwheelsjRomInfo, PwheelsjRomName, NULL, NULL, DblaxleInputInfo, PwheelsjDIPInfo, - DblaxleInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvEnforce = { - "enforce", NULL, NULL, NULL, "1988", - "Enforce (World)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, EnforceRomInfo, EnforceRomName, NULL, NULL, EnforceInputInfo, EnforceDIPInfo, - EnforceInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEnforcej = { - "enforcej", "enforce", NULL, NULL, "1988", - "Enforce (Japan)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, EnforcejRomInfo, EnforcejRomName, NULL, NULL, EnforceInputInfo, EnforcejDIPInfo, - EnforceInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvEnforceja = { - "enforceja", "enforce", NULL, NULL, "1988", - "Enforce (Japan, Analog Controls)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, EnforcejaRomInfo, EnforcejaRomName, NULL, NULL, EnforceInputInfo, EnforcejaDIPInfo, - EnforceInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 224, 4, 3 -}; - -struct BurnDriver BurnDrvNightstr = { - "nightstr", NULL, NULL, NULL, "1989", - "Night Striker (World)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, NightstrRomInfo, NightstrRomName, NULL, NULL, NightstrInputInfo, NightstrDIPInfo, - NightstrInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvNightstrj = { - "nightstrj", "nightstr", NULL, NULL, "1989", - "Night Striker (Japan)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, NightstrjRomInfo, NightstrjRomName, NULL, NULL, NightstrInputInfo, NightstrjDIPInfo, - NightstrInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvNightstru = { - "nightstru", "nightstr", NULL, NULL, "1989", - "Night Striker (US)\0", NULL, "Taito America Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, NightstruRomInfo, NightstruRomName, NULL, NULL, NightstrInputInfo, NightstruDIPInfo, - NightstrInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRacingb = { - "racingb", NULL, NULL, NULL, "1991", - "Racing Beat (World)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, RacingbRomInfo, RacingbRomName, NULL, NULL, RacingbInputInfo, RacingbDIPInfo, - RacingbInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvRacingbj = { - "racingbj", "racingb", NULL, NULL, "1991", - "Racing Beat (Japan)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, RacingbjRomInfo, RacingbjRomName, NULL, NULL, RacingbInputInfo, RacingbDIPInfo, - RacingbInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSci = { - "sci", NULL, NULL, NULL, "1989", - "Special Criminal Investigation (World set 1)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, SciRomInfo, SciRomName, NULL, NULL, SciInputInfo, SciDIPInfo, - SciInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvScia = { - "scia", "sci", NULL, NULL, "1989", - "Special Criminal Investigation (World set 2)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, SciaRomInfo, SciaRomName, NULL, NULL, SciInputInfo, SciDIPInfo, - SciInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvScij = { - "scij", "sci", NULL, NULL, "1989", - "Special Criminal Investigation (Japan)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ScijRomInfo, ScijRomName, NULL, NULL, SciInputInfo, ScijDIPInfo, - SciInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSciu = { - "sciu", "sci", NULL, NULL, "1989", - "Special Criminal Investigation (US)\0", NULL, "Taito America Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, SciuRomInfo, SciuRomName, NULL, NULL, SciInputInfo, SciuDIPInfo, - SciInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvScinegro = { - "scinegro", "sci", NULL, NULL, "1989", - "Special Criminal Investigation (Negro bootleg)\0", NULL, "Negro", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TAITO_TAITOZ, GBF_RACING, 0, - NULL, ScinegroRomInfo, ScinegroRomName, NULL, NULL, SciInputInfo, SciDIPInfo, - SciInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSpacegun = { - "spacegun", NULL, NULL, NULL, "1990", - "Space Gun (World)\0", NULL, "Taito Corporation Japan", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, SpacegunRomInfo, SpacegunRomName, NULL, NULL, SpacegunInputInfo, SpacegunDIPInfo, - SpacegunInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSpacegunj = { - "spacegunj", "spacegun", NULL, NULL, "1990", - "Space Gun (Japan)\0", NULL, "Taito Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, SpacegunjRomInfo, SpacegunjRomName, NULL, NULL, SpacegunInputInfo, SpacegunjDIPInfo, - SpacegunInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvSpacegunu = { - "spacegunu", "spacegun", NULL, NULL, "1990", - "Space Gun (US)\0", NULL, "Taito America Corporation", "Taito-Z", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TAITO_TAITOZ, GBF_SHOOT, 0, - NULL, SpacegunuRomInfo, SpacegunuRomName, NULL, NULL, SpacegunInputInfo, SpacegunuDIPInfo, - SpacegunInit, TaitoZExit, TaitoZFrame, NULL, TaitoZScan, - NULL, 0x1000, 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_tnzs.cpp b/jan/src/burn/drv/taito/d_tnzs.cpp deleted file mode 100644 index 329a63877..000000000 --- a/jan/src/burn/drv/taito/d_tnzs.cpp +++ /dev/null @@ -1,3166 +0,0 @@ -// FB Alpha The NewZealand Story driver module -// Based on MAME driver by Chris Moore, Brad Oliver, Nicola Salmoria, and many others - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "burn_ym2203.h" -#include "burn_ym2151.h" -#include "tnzs_prot.h" -#include "dac.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvZ80ROM2; -static UINT8 *DrvGfxROM; -static UINT8 *DrvColPROM; -static UINT8 *DrvSndROM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvScrollRAM; -static UINT8 *DrvVidRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvZ80RAM2; -static UINT8 *DrvObjCtrl; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 *coin_lockout; -static UINT8 *soundlatch; -static UINT8 *tnzs_bg_flag; - -static INT32 kageki_csport_sel; -static double kageki_sample_pos; -static INT32 kageki_sample_select; -static INT16 *kageki_sample_data[0x30]; -static INT32 kageki_sample_size[0x30]; -static double kageki_sample_gain; -static INT32 kageki_sample_output_dir; -static INT32 game_kabukiz = 0; - -static INT32 cpu1_reset; -static INT32 tnzs_banks[3]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[3]; -static UINT8 DrvReset; - -static UINT16 DrvAxis[2]; -static INT32 nAnalogAxis[2] = {0,0}; - -static INT16 *SampleBuffer = NULL; - -#define A(a, b, c, d) { a, b, (UINT8*)(c), d } - -static struct BurnInputInfo CommonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Common) - -static struct BurnInputInfo InsectxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 2, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 3, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 2, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 3, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Insectx) - -static struct BurnInputInfo Arknoid2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - - A("P1 Right / left", BIT_ANALOG_REL, DrvAxis + 0, "p1 x-axis" ), - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy1 + 0, "p2 fire 1" }, - - A("P2 Right / left", BIT_ANALOG_REL, DrvAxis + 1, "p2 x-axis" ), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy2 + 5, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy2 + 7, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Arknoid2) - -static struct BurnInputInfo PlumppopInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - A("P1 Right / left", BIT_ANALOG_REL, DrvAxis + 0, "p1 x-axis" ), - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - A("P2 Right / left", BIT_ANALOG_REL, DrvAxis + 1, "p2 x-axis" ), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Plumppop) - -static struct BurnInputInfo JpopnicsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - A("P1 Right / left", BIT_ANALOG_REL, DrvAxis + 0, "p1 x-axis" ), - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 6, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - A("P2 Right / left", BIT_ANALOG_REL, DrvAxis + 1, "p2 x-axis" ), - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Jpopnics) - -static struct BurnDIPInfo ExtrmatnDIPList[]= -{ - {0x13, 0xff, 0xff, 0xff, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_COINAGE_JAPAN_OLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Damage Multiplier" }, - {0x14, 0x01, 0xc0, 0xc0, "*1" }, - {0x14, 0x01, 0xc0, 0x80, "*1.5" }, - {0x14, 0x01, 0xc0, 0x40, "*2" }, - {0x14, 0x01, 0xc0, 0x00, "*3" }, -}; - -STDDIPINFO(Extrmatn) - -static struct BurnDIPInfo DrtoppelDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_DEMOSOUNDS_DIPSETTING(0x13) - - TNZS_COINAGE_WORLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "30k 100k 200k 100k+" }, - {0x14, 0x01, 0x0c, 0x00, "50k 100k 200k 200k+" }, - {0x14, 0x01, 0x0c, 0x04, "30k 100k" }, - {0x14, 0x01, 0x0c, 0x08, "30k only" }, - - TNZS_LIVES_DIPSETTING(0x14) -}; - -STDDIPINFO(Drtoppel) - -static struct BurnDIPInfo DrtoppluDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_DEMOSOUNDS_DIPSETTING(0x13) - - TNZS_COINAGE_JAPAN_OLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "30k 100k 200k 100k+" }, - {0x14, 0x01, 0x0c, 0x00, "50k 100k 200k 200k+" }, - {0x14, 0x01, 0x0c, 0x04, "30k 100k" }, - {0x14, 0x01, 0x0c, 0x08, "30k only" }, - - TNZS_LIVES_DIPSETTING(0x14) -}; - -STDDIPINFO(Drtopplu) - -static struct BurnDIPInfo ChukataiDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_DEMOSOUNDS_DIPSETTING(0x13) - - TNZS_COINAGE_WORLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "100k 300k 440k" }, - {0x14, 0x01, 0x0c, 0x00, "100k 300k 500k" }, - {0x14, 0x01, 0x0c, 0x0c, "100k 400k" }, - {0x14, 0x01, 0x0c, 0x04, "100k 500k" }, - - TNZS_LIVES_DIPSETTING(0x14) -}; - -STDDIPINFO(Chukatai) - -static struct BurnDIPInfo ChukatauDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_DEMOSOUNDS_DIPSETTING(0x13) - - TNZS_COINAGE_JAPAN_OLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "100k 300k 440k" }, - {0x14, 0x01, 0x0c, 0x00, "100k 300k 500k" }, - {0x14, 0x01, 0x0c, 0x0c, "100k 400k" }, - {0x14, 0x01, 0x0c, 0x04, "100k 500k" }, - - TNZS_LIVES_DIPSETTING(0x14) -}; - -STDDIPINFO(Chukatau) - -static struct BurnDIPInfo TnzsDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_COINAGE_WORLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "50k 150k 150k+" }, - {0x14, 0x01, 0x0c, 0x0c, "70k 200k 200k+" }, - {0x14, 0x01, 0x0c, 0x04, "100k 250k 250k+" }, - {0x14, 0x01, 0x0c, 0x08, "200k 300k 300k+" }, - - TNZS_LIVES_DIPSETTING(0x14) - - TNZS_ALLOWCONTINUE_DIPSETTING(0x14, 0x40) -}; - -STDDIPINFO(Tnzs) - -static struct BurnDIPInfo TnzsjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_COINAGE_JAPAN_OLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "50k 150k 150k+" }, - {0x14, 0x01, 0x0c, 0x0c, "70k 200k 200k+" }, - {0x14, 0x01, 0x0c, 0x04, "100k 250k 250k+" }, - {0x14, 0x01, 0x0c, 0x08, "200k 300k 300k+" }, - - TNZS_LIVES_DIPSETTING(0x14) - - TNZS_ALLOWCONTINUE_DIPSETTING(0x14, 0x40) -}; - -STDDIPINFO(Tnzsj) - -static struct BurnDIPInfo TnzsjoDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - {0 , 0xfe, 0 , 2, "Invulnerability (Debug)" }, - {0x14, 0x01, 0x08, 0x08, "Off" }, - {0x14, 0x01, 0x08, 0x00, "On" }, - - TNZS_COINAGE_JAPAN_OLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "50k 150k 150k+" }, - {0x14, 0x01, 0x0c, 0x0c, "70k 200k 200k+" }, - {0x14, 0x01, 0x0c, 0x04, "100k 250k 250k+" }, - {0x14, 0x01, 0x0c, 0x08, "200k 300k 300k+" }, - - TNZS_LIVES_DIPSETTING(0x14) - - TNZS_ALLOWCONTINUE_DIPSETTING(0x14, 0x40) -}; - -STDDIPINFO(Tnzsjo) - -static struct BurnDIPInfo TnzsopDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_COINAGE_WORLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "10k 100k 100k+" }, - {0x14, 0x01, 0x0c, 0x0c, "10k 150k 150k+" }, - {0x14, 0x01, 0x0c, 0x04, "10k 200k 200k+" }, - {0x14, 0x01, 0x0c, 0x08, "10k 300k 300k+" }, - - TNZS_LIVES_DIPSETTING(0x14) - - TNZS_ALLOWCONTINUE_DIPSETTING(0x14, 0x40) -}; - -STDDIPINFO(Tnzsop) - -static struct BurnDIPInfo InsectxDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_DEMOSOUNDS_DIPSETTING(0x13) - - TNZS_COINAGE_WORLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "100k 200k 300k 440k" }, - {0x14, 0x01, 0x0c, 0x0c, "100k 400k" }, - {0x14, 0x01, 0x0c, 0x04, "100k 500k" }, - {0x14, 0x01, 0x0c, 0x00, "150000 Only" }, - - TNZS_LIVES_DIPSETTING(0x14) -}; - -STDDIPINFO(Insectx) - -static struct BurnDIPInfo InsectxjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_DEMOSOUNDS_DIPSETTING(0x13) - - TNZS_COINAGE_JAPAN_OLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x08, "100k 200k 300k 440k" }, - {0x14, 0x01, 0x0c, 0x0c, "100k 400k" }, - {0x14, 0x01, 0x0c, 0x04, "100k 500k" }, - {0x14, 0x01, 0x0c, 0x00, "150000 Only" }, - - TNZS_LIVES_DIPSETTING(0x14) -}; - -STDDIPINFO(Insectxj) - -static struct BurnDIPInfo KagekiDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - // Cabinet type in Japan set only - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_DEMOSOUNDS_DIPSETTING(0x13) - - TNZS_COINAGE_JAPAN_OLD(0x13) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - TNZS_ALLOWCONTINUE_DIPSETTING(0x14, 0x80) -}; - -STDDIPINFO(Kageki) - -static struct BurnDIPInfo Arknoid2DIPList[]= -{ - {0x0b, 0xff, 0xff, 0xfe, NULL }, - {0x0c, 0xff, 0xff, 0x7f, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x0b) - - TNZS_DEMOSOUNDS_DIPSETTING(0x0b) - - TNZS_COINAGE_WORLD(0x0b) - - TNZS_DIFFICULTY_DIPSETTING(0x0c) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "50k 150k" }, - {0x0c, 0x01, 0x0c, 0x0c, "100k 200k" }, - {0x0c, 0x01, 0x0c, 0x04, "50k Only" }, - {0x0c, 0x01, 0x0c, 0x08, "100k Only" }, - - TNZS_LIVES_DIPSETTING(0x0c) - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0c, 0x01, 0x80, 0x80, "No" }, - {0x0c, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Arknoid2) - -static struct BurnDIPInfo Arknid2uDIPList[]= -{ - {0x0b, 0xff, 0xff, 0xfe, NULL }, - {0x0c, 0xff, 0xff, 0x7f, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x0b) - - TNZS_DEMOSOUNDS_DIPSETTING(0x0b) - - TNZS_COINAGE_JAPAN_OLD(0x0b) - - TNZS_DIFFICULTY_DIPSETTING(0x0c) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x00, "50k 150k" }, - {0x0c, 0x01, 0x0c, 0x0c, "100k 200k" }, - {0x0c, 0x01, 0x0c, 0x04, "50k Only" }, - {0x0c, 0x01, 0x0c, 0x08, "100k Only" }, - - TNZS_LIVES_DIPSETTING(0x0c) - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x0c, 0x01, 0x80, 0x80, "No" }, - {0x0c, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Arknid2u) - -static struct BurnDIPInfo PlumppopDIPList[]= -{ - {0x0d, 0xff, 0xff, 0xff, NULL }, - {0x0e, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x0d) - - TNZS_DEMOSOUNDS_DIPSETTING(0x0d) - - TNZS_COINAGE_JAPAN_OLD(0x0d) - - TNZS_DIFFICULTY_DIPSETTING(0x0e) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0e, 0x01, 0x0c, 0x08, "50k 200k 150k+" }, - {0x0e, 0x01, 0x0c, 0x0c, "50k 250k 200k+" }, - {0x0e, 0x01, 0x0c, 0x04, "100k 300k 200k+" }, - {0x0e, 0x01, 0x0c, 0x00, "100k 400k 300k+" }, - - TNZS_LIVES_DIPSETTING(0x0e) - - TNZS_ALLOWCONTINUE_DIPSETTING(0x0c, 0x80) -}; - -STDDIPINFO(Plumppop) - -static struct BurnDIPInfo JpopnicsDIPList[]= -{ - {0x0b, 0xff, 0xff, 0xff, NULL }, - {0x0c, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x0b) - - TNZS_DEMOSOUNDS_DIPSETTING(0x0b) - - TNZS_DIFFICULTY_DIPSETTING(0x0c) - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x0c, 0x01, 0x0c, 0x08, "50k 200k 150k+" }, - {0x0c, 0x01, 0x0c, 0x0c, "50k 250k 200k+" }, - {0x0c, 0x01, 0x0c, 0x04, "100k 300k 200k+" }, - {0x0c, 0x01, 0x0c, 0x00, "100k 400k 300k+" }, - - TNZS_LIVES_DIPSETTING(0x0c) - - TNZS_ALLOWCONTINUE_DIPSETTING(0x0c, 0x80) -}; - -STDDIPINFO(Jpopnics) - -static struct BurnDIPInfo KabukizDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_DEMOSOUNDS_DIPSETTING(0x13) - - TNZS_ALLOWCONTINUE_DIPSETTING(0x13, 0x80) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - TNZS_COINAGE_WORLD(0x14) -}; - -STDDIPINFO(Kabukiz) - -static struct BurnDIPInfo KabukizjDIPList[]= -{ - {0x13, 0xff, 0xff, 0xfe, NULL }, - {0x14, 0xff, 0xff, 0xff, NULL }, - - TNZS_CABINET_FLIP_SERVICE_DIPSETTING(0x13) - - TNZS_DEMOSOUNDS_DIPSETTING(0x13) - - TNZS_ALLOWCONTINUE_DIPSETTING(0x13, 0x80) - - TNZS_DIFFICULTY_DIPSETTING(0x14) - - TNZS_COINAGE_JAPAN_OLD(0x14) -}; - -STDDIPINFO(Kabukizj) - -void __fastcall bankswitch0(UINT8 data) -{ - // CPU #0 expects CPU #1 to be stopped while reset line is triggered. - if ((~data & 0x10) != cpu1_reset) { - INT32 cycles = ZetTotalCycles(); - ZetClose(); - ZetOpen(1); - cycles -= ZetTotalCycles(); - ZetIdle(cycles); - if (~data & 0x10) ZetReset(); - ZetClose(); - ZetOpen(0); - } - - cpu1_reset = ~data & 0x10; - - tnzs_banks[0] = data; - - INT32 bank = (data & 7) * 0x4000; - - // Low banks are RAM regions high ones are ROM. - if ((data & 6) == 0) { - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80RAM0 + bank); - ZetMapArea(0x8000, 0xbfff, 1, DrvZ80RAM0 + bank); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80RAM0 + bank); - } else { - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + 0x10000 + bank); - ZetMapArea(0x8000, 0xbfff, 1, DrvZ80ROM0 + 0x10000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM0 + 0x10000 + bank); - } -} - -void __fastcall bankswitch1(UINT8 data) -{ - tnzs_banks[1] = data & ~0x04; - - if (data & 0x04) { - tnzs_mcu_reset(); - } - - *coin_lockout = ~data & 0x30; - - ZetMapArea(0x8000, 0x9fff, 0, DrvZ80ROM1 + 0x08000 + 0x2000 * (data & 3)); - ZetMapArea(0x8000, 0x9fff, 2, DrvZ80ROM1 + 0x08000 + 0x2000 * (data & 3)); -} - -void __fastcall tnzs_cpu0_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xf400: - *tnzs_bg_flag = data; - break; - - case 0xf600: - bankswitch0(data); - break; - } - - if ((address & 0xff00) == 0xf300) { - DrvObjCtrl[address & 3] = data; - return; - } -} - -UINT8 __fastcall tnzs_cpu0_read(UINT16 address) -{ - // This is a hack to keep tnzs & clones from freezing. The sub cpu - // writes back 0xff to shared ram as an acknowledge and the main - // cpu doesn't expect it so soon. This can be fixed by an extremely - // high sync, but this hack is much less costly. - if ((address & 0xf000) == 0xe000) { - if (address == 0xef10 && DrvShareRAM[0x0f10] == 0xff) { - return 0; - } - return DrvShareRAM[address & 0xfff]; - } - - return 0; -} - -void __fastcall tnzsb_cpu1_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - bankswitch1(data); - break; - - case 0xb004: - *soundlatch = data; - ZetClose(); - ZetOpen(2); - ZetSetVector(0xff); - ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); - ZetClose(); - ZetOpen(1); - break; - } -} - -UINT8 __fastcall tnzsb_cpu1_read(UINT16 address) -{ - switch (address) - { - case 0xb002: - return DrvDips[0]; - - case 0xb003: - return DrvDips[1]; - - case 0xc000: - case 0xc001: - return DrvInputs[address & 1]; - - case 0xc002: - return DrvInputs[2] | *coin_lockout; - } - - if (address >= 0xf000 && address <= 0xf003) { - return DrvPalRAM[address & 0x0003]; - } - - return 0; -} - -void __fastcall tnzs_cpu1_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xa000: - bankswitch1(data); - break; - - case 0xb000: - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) { - BurnYM2151SelectRegister(data); - } else { - BurnYM2203Write(0, 0, data); - } - break; - - case 0xb001: - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) { - BurnYM2151WriteRegister(data); - } else { - BurnYM2203Write(0, 1, data); - } - break; - - case 0xc000: - case 0xc001: - tnzs_mcu_write(address, data); - break; - } -} - -UINT8 __fastcall tnzs_cpu1_read(UINT16 address) -{ - switch (address) - { - case 0xb000: - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) - return 0; - return BurnYM2203Read(0, 0); - - case 0xb001: - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) - return BurnYM2151ReadStatus(); - return BurnYM2203Read(0, 1); - - case 0xc000: - case 0xc001: - return tnzs_mcu_read(address); - - case 0xc002: - return DrvInputs[2]; - - case 0xc600: - return DrvDips[0]; - - case 0xc601: - return DrvDips[1]; - - case 0xf000: - return (~nAnalogAxis[0] >> 12) & 0xff; - - case 0xf001: - return (~nAnalogAxis[0] >> 20) & 0x0f; - - case 0xf002: - return (~nAnalogAxis[1] >> 12) & 0xff; - - case 0xf003: - return (~nAnalogAxis[1] >> 20) & 0x0f; - } - - return 0; -} - -void __fastcall tnzs_cpu2_out(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - BurnYM2203Write(0, 0, data); - break; - - case 0x01: - BurnYM2203Write(0, 1, data); - break; - } -} - -UINT8 __fastcall tnzs_cpu2_in(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - return BurnYM2203Read(0, 0); - - case 0x02: - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - return *soundlatch; - } - - return 0; -} - -static void kabukiz_sound_bankswitch(UINT32, UINT32 data) -{ - if (data != 0xff) { - tnzs_banks[2] = data; - - if (ZetGetActive() == -1) return; - - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM2 + 0x8000 + 0x4000 * (data & 0x07)); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM2 + 0x8000 + 0x4000 * (data & 0x07)); - } -} - -static void kabukiz_dac_write(UINT32, UINT32 data) -{ - if (data != 0xff) { - DACWrite(0, data); - } -} - -static UINT8 tnzs_ym2203_portA(UINT32 ) -{ - return DrvDips[0]; -} - -static UINT8 tnzs_ym2203_portB(UINT32 ) -{ - return DrvDips[1]; -} - -static UINT8 kageki_ym2203_portA(UINT32) -{ - INT32 dsw1 = DrvDips[0]; - INT32 dsw2 = DrvDips[1]; - UINT8 dsw = 0x0f; - - switch (kageki_csport_sel & 3) - { - case 0x00: - dsw = (((dsw2 & 0x10) >> 1) | ((dsw2 & 0x01) << 2) | ((dsw1 & 0x10) >> 3) | ((dsw1 & 0x01) >> 0)); - break; - - case 0x01: - dsw = (((dsw2 & 0x40) >> 3) | ((dsw2 & 0x04) >> 0) | ((dsw1 & 0x40) >> 5) | ((dsw1 & 0x04) >> 2)); - break; - - case 0x02: - dsw = (((dsw2 & 0x20) >> 2) | ((dsw2 & 0x02) << 1) | ((dsw1 & 0x20) >> 4) | ((dsw1 & 0x02) >> 1)); - break; - - case 0x03: - dsw = (((dsw2 & 0x80) >> 4) | ((dsw2 & 0x08) >> 1) | ((dsw1 & 0x80) >> 6) | ((dsw1 & 0x08) >> 3)); - break; - } - - return dsw; -} - -static void kageki_ym2203_write_portB(UINT32, UINT32 data) -{ - if (data > 0x3f) { - kageki_csport_sel = data; - } else { - if (data > 0x2f) { - kageki_sample_select = -1; - } else { - kageki_sample_select = data; - kageki_sample_pos = 0; - } - } -} - -inline static void DrvYM2203IRQHandler(INT32, INT32 nStatus) -{ - Z80SetIrqLine(Z80_INPUT_LINE_NMI, nStatus & 1); -} - -inline static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 6000000; -} - -inline static double DrvGetTime() -{ - return (double)ZetTotalCycles() / 6000000; -} - -static INT32 kabukizSyncDAC() -{ - return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (6000000.000 / (nBurnFPS / 100.000)))); -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - memcpy (DrvPalRAM, DrvColPROM, 0x400); - - cpu1_reset = 0; - - for (INT32 i = 0; i < 3; i++) { - ZetOpen(i); - ZetReset(); - if (i == 0) bankswitch0(0x12); - if (i == 1) bankswitch1(0); - if (i == 2) kabukiz_sound_bankswitch(0, 0); - ZetClose(); - } - - tnzs_mcu_reset(); - - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) { - BurnYM2151Reset(); - } else { - BurnYM2203Reset(); - } - - DACReset(); - - kageki_sample_pos = 0; - kageki_sample_select = -1; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x040000; - DrvZ80ROM1 = Next; Next += 0x020000; - DrvZ80ROM2 = Next; Next += 0x020000; - - DrvGfxROM = Next; Next += 0x400000; - - DrvColPROM = Next; Next += 0x000400; - - DrvSndROM = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - SampleBuffer = (INT16*)Next; Next += nBurnSoundLen * 2 * sizeof(INT16); - - AllRam = Next; - - DrvObjCtrl = Next; Next += 0x000004; - - DrvPalRAM = Next; Next += 0x000400; - DrvSprRAM = Next; Next += 0x002000; - DrvShareRAM = Next; Next += 0x001000; - DrvScrollRAM = Next; Next += 0x000100; - DrvVidRAM = Next; Next += 0x000200; - - DrvZ80RAM0 = Next; Next += 0x008000; - DrvZ80RAM1 = Next; Next += 0x001000; - DrvZ80RAM2 = Next; Next += 0x002000; - - coin_lockout = Next; Next += 0x000001; - soundlatch = Next; Next += 0x000001; - tnzs_bg_flag = Next; Next += 0x000001; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static void kageki_sample_init() -{ - UINT8 *src = DrvSndROM + 0x0090; - - for (INT32 i = 0; i < 0x2f; i++) - { - INT32 start = (src[(i * 2) + 1] << 8) + src[(i * 2)]; - UINT8 *scan = &src[start]; - INT32 size = 0; - - while (1) { - if (*scan++ == 0x00) { - break; - } else { - size++; - } - } - - kageki_sample_data[i] = (INT16*)BurnMalloc(size * sizeof(INT16)); - kageki_sample_size[i] = size; - - if (start < 0x100) start = size = 0; - - INT16 *dest = kageki_sample_data[i]; - scan = &src[start]; - for (INT32 n = 0; n < size; n++) - { - *dest++ = ((*scan++) ^ 0x80) << 8; - } - } - - kageki_sample_gain = 0.45; - kageki_sample_output_dir = BURN_SND_ROUTE_BOTH; -} - -void kageki_sample_set_route(double nVolume, INT32 nRouteDir) -{ - kageki_sample_gain = nVolume; - kageki_sample_output_dir = nRouteDir; -} - -static void kageki_sample_exit() -{ - for (INT32 i = 0; i < 0x2f; i++) { - BurnFree (kageki_sample_data[i]); - } - kageki_sample_select = -1; -} - -static INT32 tnzs_gfx_decode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM, 0x200000); - - static INT32 Plane[4] = { 0xc00000, 0x800000, 0x400000, 0x000000 }; - static INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71 }; - static INT32 YOffs[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 128, 136, 144, 152, 160, 168, 176, 184 }; - - GfxDecode(0x4000, 4, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM); - - // the drawing routines allow for 0x4000 tiles, but some (most) games - // only have 0x2000. Mirroring the second half is cheaper and easier than - // masking the tile code. - if (memcmp (DrvGfxROM + 0x200000, DrvGfxROM + 0x300000, 0x100000) == 0) { - memcpy (DrvGfxROM + 0x200000, DrvGfxROM + 0x000000, 0x200000); - } - - BurnFree (tmp); - - return 0; -} - -static INT32 insectx_gfx_decode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x100000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM, 0x100000); - - static INT32 Plane[4] = { 0x000008, 0x000000, 0x400008, 0x400000 }; - static INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 }; - static INT32 YOffs[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 256, 272, 288, 304, 320, 336, 352, 368 }; - - GfxDecode(0x2000, 4, 16, 16, Plane, XOffs, YOffs, 0x200, tmp, DrvGfxROM); - - memcpy (DrvGfxROM + 0x200000, DrvGfxROM + 0x000000, 0x200000); - - BurnFree (tmp); - - return 0; -} - -static INT32 Type1Init(INT32 mcutype) -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - switch (mcutype) - { - case MCU_CHUKATAI: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x00000, DrvZ80ROM0 + 0x10000, 0x08000); - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x020000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0a0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x120000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1a0000, 11, 1)) return 1; - - if (tnzs_gfx_decode()) return 1; - } - break; - - case MCU_TNZS: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x00000, DrvZ80ROM0 + 0x10000, 0x08000); - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x020000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0a0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x120000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1a0000, 10, 1)) return 1; - - if (tnzs_gfx_decode()) return 1; - } - break; - - case MCU_DRTOPPEL: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x00000, DrvZ80ROM0 + 0x10000, 0x08000); - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x020000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0a0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x120000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1a0000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00001, 12, 2)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00000, 13, 2)) return 1; - - if (tnzs_gfx_decode()) return 1; - } - break; - - case MCU_EXTRMATN: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x00000, DrvZ80ROM0 + 0x10000, 0x08000); - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 7, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00001, 8, 2)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00000, 9, 2)) return 1; - - if (tnzs_gfx_decode()) return 1; - } - break; - - case MCU_NONE_INSECTX: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x00000, DrvZ80ROM0 + 0x10000, 0x08000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 2, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 3, 1)) return 1; - - insectx_gfx_decode(); - } - break; - - case MCU_ARKANOID: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x00000, DrvZ80ROM0 + 0x10000, 0x08000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 6, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00001, 7, 2)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00000, 8, 2)) return 1; - - if (tnzs_gfx_decode()) return 1; - } - break; - - case MCU_PLUMPOP: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x00000, DrvZ80ROM0 + 0x10000, 0x08000); - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x010000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x020000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x030000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x090000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0a0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0b0000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x110000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x120000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x130000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x190000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1a0000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1b0000, 11, 1)) return 1; - - if (BurnLoadRom(DrvColPROM + 0x00001, 12, 2)) return 1; - if (BurnLoadRom(DrvColPROM + 0x00000, 13, 2)) return 1; - - if (tnzs_gfx_decode()) return 1; - } - break; - - case MCU_NONE_KAGEKI: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x00000, DrvZ80ROM0 + 0x10000, 0x08000); - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x020000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0a0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x120000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1a0000, 10, 1)) return 1; - - if (BurnLoadRom(DrvSndROM + 0x000000, 11, 1)) return 1; - - if (tnzs_gfx_decode()) return 1; - - kageki_sample_init(); - } - break; - - case MCU_NONE_JPOPNICS: - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0 + 0x00000, DrvZ80ROM0 + 0x10000, 0x08000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 1, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM + 0x000000, 2, 1)) return 1; - memcpy (DrvGfxROM + 0x020000, DrvGfxROM + 0x010000, 0x010000); - if (BurnLoadRom(DrvGfxROM + 0x080000, 3, 1)) return 1; - memcpy (DrvGfxROM + 0x0a0000, DrvGfxROM + 0x090000, 0x010000); - if (BurnLoadRom(DrvGfxROM + 0x100000, 4, 1)) return 1; - memcpy (DrvGfxROM + 0x120000, DrvGfxROM + 0x110000, 0x010000); - if (BurnLoadRom(DrvGfxROM + 0x180000, 5, 1)) return 1; - memcpy (DrvGfxROM + 0x1a0000, DrvGfxROM + 0x190000, 0x010000); - - if (tnzs_gfx_decode()) return 1; - } - break; - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + 0x18000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM0 + 0x18000); - ZetMapArea(0xc000, 0xdfff, 0, DrvSprRAM); - ZetMapArea(0xc000, 0xdfff, 1, DrvSprRAM); - ZetMapArea(0xe000, 0xeeff, 0, DrvShareRAM); - if (mcutype != MCU_TNZS) { - ZetMapArea(0xef00, 0xefff, 0, DrvShareRAM + 0x0f00); - } - ZetMapArea(0xe000, 0xefff, 1, DrvShareRAM); - ZetMapArea(0xe000, 0xefff, 2, DrvShareRAM); - ZetMapArea(0xf000, 0xf1ff, 0, DrvVidRAM); - ZetMapArea(0xf000, 0xf1ff, 1, DrvVidRAM); - ZetMapArea(0xf200, 0xf2ff, 1, DrvScrollRAM); - if (mcutype != MCU_DRTOPPEL) { - ZetMapArea(0xf800, 0xfbff, 0, DrvPalRAM); - ZetMapArea(0xf800, 0xfbff, 1, DrvPalRAM); - } - ZetSetWriteHandler(tnzs_cpu0_write); - ZetSetReadHandler(tnzs_cpu0_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x9fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x9fff, 2, DrvZ80ROM1); - ZetMapArea(0xd000, 0xdfff, 0, DrvZ80RAM1); - ZetMapArea(0xd000, 0xdfff, 1, DrvZ80RAM1); - ZetMapArea(0xd000, 0xdfff, 2, DrvZ80RAM1); - ZetMapArea(0xe000, 0xefff, 0, DrvShareRAM); - ZetMapArea(0xe000, 0xefff, 1, DrvShareRAM); - ZetMapArea(0xe000, 0xefff, 2, DrvShareRAM); - ZetSetWriteHandler(tnzs_cpu1_write); - ZetSetReadHandler(tnzs_cpu1_read); - ZetClose(); - - ZetInit(2); // For common reset routine - - tnzs_mcu_init(mcutype); - - if (mcutype == MCU_NONE_JPOPNICS) { - BurnYM2151Init(3000000); // jpopnics - BurnYM2151SetAllRoutes(0.30, BURN_SND_ROUTE_BOTH); - } else { - BurnYM2203Init(1, 3000000, NULL, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - if (mcutype == MCU_EXTRMATN || mcutype == MCU_DRTOPPEL) { - BurnYM2203SetPSGVolume(0, 0.10); - } - - if (mcutype == MCU_NONE_KAGEKI) { - BurnYM2203SetPorts(0, &kageki_ym2203_portA, NULL, NULL, &kageki_ym2203_write_portB); - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 0.35, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 0.15, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 0.15, BURN_SND_ROUTE_BOTH); - } else { - BurnYM2203SetPorts(0, &tnzs_ym2203_portA, &tnzs_ym2203_portB, NULL, NULL); - } - } - - DACInit(0, 0, 1, kabukizSyncDAC); // kabukiz - DACSetRoute(0, 0.10, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 Type2Init() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - game_kabukiz = (strncmp(BurnDrvGetTextA(DRV_NAME), "kabukiz", 7) == 0); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 0, 1)) return 1; - memcpy (DrvZ80ROM0, DrvZ80ROM0 + 0x10000, 0x08000); - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 1, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM2 + 0x00000, 2, 1)) return 1; - - if (game_kabukiz) { - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 6, 1)) return 1; - } else { - if (BurnLoadRom(DrvGfxROM + 0x000000, 3, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x020000, 4, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x080000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x0a0000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x100000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x120000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x180000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM + 0x1a0000, 10, 1)) return 1; - } - - if (tnzs_gfx_decode()) return 1; - } - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + 0x18000); - ZetMapArea(0x8000, 0xbfff, 1, DrvZ80ROM0 + 0x18000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM0 + 0x18000); - ZetMapArea(0xc000, 0xdfff, 0, DrvSprRAM); - ZetMapArea(0xc000, 0xdfff, 1, DrvSprRAM); - ZetMapArea(0xc000, 0xdfff, 2, DrvSprRAM); - ZetMapArea(0xe000, 0xeeff, 0, DrvShareRAM); - if (game_kabukiz) { - ZetMapArea(0xef00, 0xefff, 0, DrvShareRAM + 0x0f00); - } - ZetMapArea(0xe000, 0xefff, 1, DrvShareRAM); - ZetMapArea(0xe000, 0xefff, 2, DrvShareRAM); - ZetMapArea(0xf000, 0xf1ff, 0, DrvVidRAM); - ZetMapArea(0xf000, 0xf1ff, 1, DrvVidRAM); - ZetMapArea(0xf000, 0xf1ff, 2, DrvVidRAM); - ZetMapArea(0xf200, 0xf2ff, 0, DrvScrollRAM); - ZetMapArea(0xf200, 0xf2ff, 1, DrvScrollRAM); - ZetSetWriteHandler(tnzs_cpu0_write); - ZetSetReadHandler(tnzs_cpu0_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapArea(0x0000, 0x9fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x9fff, 2, DrvZ80ROM1); - ZetMapArea(0xd000, 0xdfff, 0, DrvZ80RAM1); - ZetMapArea(0xd000, 0xdfff, 1, DrvZ80RAM1); - ZetMapArea(0xd000, 0xdfff, 2, DrvZ80RAM1); - ZetMapArea(0xe000, 0xefff, 0, DrvShareRAM); - ZetMapArea(0xe000, 0xefff, 1, DrvShareRAM); - ZetMapArea(0xe000, 0xefff, 2, DrvShareRAM); - ZetMapArea(0xf000, 0xf3ff, 1, DrvPalRAM); // tnzsb - ZetMapArea(0xf800, 0xfbff, 1, DrvPalRAM); // kabukiz - ZetSetWriteHandler(tnzsb_cpu1_write); - ZetSetReadHandler(tnzsb_cpu1_read); - ZetClose(); - - ZetInit(2); - ZetOpen(2); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM2 + 0x0000); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM2 + 0x0000); - ZetMapArea(0xc000, 0xdfff, 0, DrvZ80RAM2); // tnzsb - ZetMapArea(0xc000, 0xdfff, 1, DrvZ80RAM2); - ZetMapArea(0xc000, 0xdfff, 2, DrvZ80RAM2); - ZetMapArea(0xe000, 0xffff, 0, DrvZ80RAM2); // kabukiz - ZetMapArea(0xe000, 0xffff, 1, DrvZ80RAM2); - ZetMapArea(0xe000, 0xffff, 2, DrvZ80RAM2); - ZetSetOutHandler(tnzs_cpu2_out); - ZetSetInHandler(tnzs_cpu2_in); - ZetClose(); - - BurnYM2203Init(1, 3000000, &DrvYM2203IRQHandler, DrvSynchroniseStream, DrvGetTime, 0); - BurnYM2203SetPorts(0, NULL, NULL, &kabukiz_sound_bankswitch, &kabukiz_dac_write); - BurnTimerAttachZet(6000000); - BurnYM2203SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); - - if (game_kabukiz || strncmp(BurnDrvGetTextA(DRV_NAME), "tnzs", 5) == 0) { - BurnYM2203SetRoute(0, BURN_SND_YM2203_YM2203_ROUTE, 2.00, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_1, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_2, 1.00, BURN_SND_ROUTE_BOTH); - BurnYM2203SetRoute(0, BURN_SND_YM2203_AY8910_ROUTE_3, 1.00, BURN_SND_ROUTE_BOTH); - } - - DACInit(0, 0, 1, kabukizSyncDAC); // kabukiz - DACSetRoute(0, 0.10, BURN_SND_ROUTE_BOTH); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - if (tnzs_mcu_type() != MCU_NONE_JPOPNICS) BurnYM2203Exit(); - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) BurnYM2151Exit(); - DACExit(); - - BurnFree (AllMem); - - if (tnzs_mcu_type() == MCU_NONE_KAGEKI) { - kageki_sample_exit(); - } - - tnzs_mcu_init(0); - game_kabukiz = 0; - - return 0; -} - -// Stolen from TMNT. Thanks to Barry. :) -static void kageki_sample_render(INT16 *pSoundBuf, INT32 nLength) -{ - memset(pSoundBuf, 0, nLength * sizeof(INT16) * 2); - if (kageki_sample_select == -1) return; - - double Addr = kageki_sample_pos; - double Step = (double)7000 / nBurnSoundRate; - - double size = kageki_sample_size[kageki_sample_select]; - INT16 *ptr = kageki_sample_data[kageki_sample_select]; - - for (INT32 i = 0; i < nLength; i += 2) { - if (Addr >= size) break; - INT16 Sample = ptr[(INT32)Addr]; - INT16 nLeftSample = 0, nRightSample = 0; - - if ((kageki_sample_output_dir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Sample * kageki_sample_gain); - } - if ((kageki_sample_output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Sample * kageki_sample_gain); - } - - pSoundBuf[i + 0] += nLeftSample; - pSoundBuf[i + 1] += nRightSample; - - Addr += Step; - } - - kageki_sample_pos = Addr; - if (Addr >= size) kageki_sample_select = -1; -} - -static void draw_16x16(INT32 sx, INT32 sy, INT32 code, INT32 color, INT32 flipx, INT32 flipy, INT32 transp) -{ - if (transp) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM); - } - } - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, DrvGfxROM); - } - } - } -} - -static void draw_background(INT32 ctrl, INT32 flipscreen) -{ - INT32 scrollx, scrolly; - UINT8 *m = DrvSprRAM + 0x400; - - if ((ctrl ^ (ctrl << 1)) & 0x40) - { - m += 0x800; - } - - INT32 transpen = (*tnzs_bg_flag & 0x80) ^ 0x80; - - INT32 tot = DrvObjCtrl[1] & 0x1f; - if (tot == 1) tot = 16; - - UINT32 upperbits = DrvObjCtrl[2] | (DrvObjCtrl[3] << 8); - - for (INT32 column = 0; column < tot; column++) - { - scrollx = DrvScrollRAM[(column << 4) | 4] - ((upperbits & 0x01) << 8); - if (flipscreen) - scrolly = DrvScrollRAM[column << 4] + 1 - 256; - else - scrolly = -DrvScrollRAM[column << 4] + 1; - - for (INT32 y = 0; y < 16; y++) - { - for (INT32 x = 0; x < 2; x++) - { - INT32 i = ((column ^ 8) << 5) | (y << 1) | x; - - INT32 code = m[i + 0x0000] | ((m[i + 0x1000] & 0x3f) << 8); - INT32 color = m[i + 0x1200] >> 3; - INT32 flipx = m[i + 0x1000] & 0x80; - INT32 flipy = m[i + 0x1000] & 0x40; - INT32 sx = x << 4; - INT32 sy = y << 4; - if (flipscreen) - { - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - sy = (sy + scrolly) & 0xff; - sx += scrollx; - - if (sx >= nScreenWidth || sx < -15 || sy >= nScreenHeight + 16 || sy < 1) continue; - - draw_16x16(sx, sy - 16, code, color, flipx, flipy, transpen); - } - } - - upperbits >>= 1; - } -} - -static void draw_foreground(INT32 ctrl, INT32 flipscreen) -{ - UINT8 *char_pointer = DrvSprRAM + 0x0000; - UINT8 *x_pointer = DrvSprRAM + 0x0200; - UINT8 *y_pointer = DrvVidRAM + 0x0000; - UINT8 *ctrl_pointer = DrvSprRAM + 0x1000; - UINT8 *color_pointer = DrvSprRAM + 0x1200; - - if ((ctrl ^ (ctrl << 1)) & 0x40) - { - char_pointer += 0x800; - x_pointer += 0x800; - ctrl_pointer += 0x800; - color_pointer += 0x800; - } - - for (INT32 i = 0x1ff; i >= 0; i--) - { - INT32 code = char_pointer[i] + ((ctrl_pointer[i] & 0x3f) << 8); - INT32 color = (color_pointer[i] & 0xf8) >> 3; - INT32 sx = x_pointer[i] - ((color_pointer[i] & 1) << 8); - INT32 sy = 240 - y_pointer[i]; - INT32 flipx = ctrl_pointer[i] & 0x80; - INT32 flipy = ctrl_pointer[i] & 0x40; - if (flipscreen) - { - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - if ((sy == 0) && (code == 0)) sy += 240; - } - - if (sx >= nScreenWidth || sx < -15) continue; - - draw_16x16(sx, sy - 14, code, color, flipx, flipy, 1); - } -} - -static inline void DrvRecalcPalette() -{ - UINT8 r,g,b; - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) { - for (INT32 i = 0; i < 0x400; i+=2) { - UINT16 pal = (DrvPalRAM[i] << 8) | DrvPalRAM[i | 1]; - - r = (pal >> 4) & 0x0f; - g = (pal >> 12) & 0x0f; - b = (pal >> 8) & 0x0f; - - r |= r << 4; - g |= g << 4; - b |= b << 4; - - DrvPalette[i / 2] = BurnHighCol(r, g, b, 0); - } - } else { - for (INT32 i = 0; i < 0x400; i+=2) { - UINT16 pal = (DrvPalRAM[i | 1] << 8) | DrvPalRAM[i]; - - r = (pal >> 10) & 0x1f; - g = (pal >> 5) & 0x1f; - b = (pal >> 0) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i / 2] = BurnHighCol(r, g, b, 0); - } - } -} - -static void sprite_buffer(INT32 ctrl) -{ - if (~ctrl & 0x20) - { - if (ctrl & 0x40) { - memcpy (DrvSprRAM + 0x0000, DrvSprRAM + 0x0800, 0x0400); - memcpy (DrvSprRAM + 0x1000, DrvSprRAM + 0x1800, 0x0400); - } else { - memcpy (DrvSprRAM + 0x0800, DrvSprRAM + 0x0000, 0x0400); - memcpy (DrvSprRAM + 0x1800, DrvSprRAM + 0x1000, 0x0400); - } - - memcpy (DrvSprRAM + 0x0400, DrvSprRAM + 0x0c00, 0x0400); - memcpy (DrvSprRAM + 0x1400, DrvSprRAM + 0x1c00, 0x0400); - } -} - -static void bgsprite_buffer_kabukiz(INT32 ctrl) -{ - if (~ctrl & 0x20) - { - memcpy (DrvSprRAM + 0x0400, DrvSprRAM + 0x0c00, 0x0400); - memcpy (DrvSprRAM + 0x1400, DrvSprRAM + 0x1c00, 0x0400); - } -} - -static INT32 DrvDraw() -{ - DrvRecalcPalette(); - - INT32 flip = DrvObjCtrl[0] & 0x40; - INT32 ctrl = (DrvObjCtrl[1] & 0x60) ^ 0x20; - - for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) { - pTransDraw[i] = 0x1f0; - } - - draw_background(ctrl, flip); - draw_foreground(ctrl, flip); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static void assemble_inputs() -{ - tnzs_mcu_inputs = DrvInputs; - memset (DrvInputs, 0xff, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= DrvJoy1[i] << i; - DrvInputs[1] ^= DrvJoy2[i] << i; - DrvInputs[2] ^= DrvJoy3[i] << i; - } - - nAnalogAxis[0] -= DrvAxis[0] << 7; - nAnalogAxis[1] -= DrvAxis[1] << 7; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - assemble_inputs(); - - INT32 nInterleave = 256; - if (tnzs_mcu_type() == MCU_NONE_KAGEKI) nInterleave = nBurnSoundLen; - INT32 nSoundBufferPos = 0; - - INT32 nCyclesTotal[3]; - - nCyclesTotal[0] = 6000000 / 60; - nCyclesTotal[1] = 6000000 / 60; - nCyclesTotal[2] = 6000000 / 60; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - - if (game_kabukiz && i == 1) - bgsprite_buffer_kabukiz(DrvObjCtrl[1]); - - // Run Z80 #0 - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - ZetRun(nCyclesTotal[nCurrentCPU] / nInterleave); - if (i == nInterleave - 1) { - tnzs_mcu_interrupt(); - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - } - ZetClose(); - - // Run Z80 #1 - nCurrentCPU = 1; - ZetOpen(nCurrentCPU); - if (!cpu1_reset) - ZetRun(nCyclesTotal[nCurrentCPU] / nInterleave); - if (i == nInterleave - 1) - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); - ZetClose(); - - // Run Z80 #2 - if (tnzs_mcu_type() == MCU_NONE) - { - nCurrentCPU = 2; - ZetOpen(nCurrentCPU); - BurnTimerUpdate((i + 1) * (nCyclesTotal[nCurrentCPU] / nInterleave)); - ZetClose(); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - INT16* pSoundBuf2 = SampleBuffer + (nSoundBufferPos << 1); - ZetOpen(2); - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - kageki_sample_render(pSoundBuf2, nSegmentLength); - ZetClose(); - nSoundBufferPos += nSegmentLength; - } - } - - ZetOpen(2); - if (tnzs_mcu_type() == MCU_NONE) { - BurnTimerEndFrame(nCyclesTotal[2]); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - INT16* pSoundBuf2 = SampleBuffer + (nSoundBufferPos << 1); - if (nSegmentLength) { - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - kageki_sample_render(pSoundBuf2, nSegmentLength); - } - } - - if (tnzs_mcu_type() != MCU_NONE_JPOPNICS) { - if (pBurnSoundOut) { - BurnYM2203Update(pBurnSoundOut, nBurnSoundLen); - DACUpdate(pBurnSoundOut, nBurnSoundLen); - for (INT32 i = 0; i < nBurnSoundLen; i++) { - pBurnSoundOut[(i << 1) + 0] += SampleBuffer[(i << 1) + 0]; - pBurnSoundOut[(i << 1) + 1] += SampleBuffer[(i << 1) + 1]; - } - } - } - - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); - } - - sprite_buffer(DrvObjCtrl[1]); - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029730; - } - - if (nAction & ACB_VOLATILE) { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - if (tnzs_mcu_type() == MCU_NONE_JPOPNICS) { - BurnYM2151Scan(nAction); - } else { - BurnYM2203Scan(nAction, pnMin); - } - - DACScan(nAction, pnMin); - - tnzs_mcu_scan(); - - SCAN_VAR(tnzs_banks); - SCAN_VAR(cpu1_reset); - - SCAN_VAR(nAnalogAxis); - - SCAN_VAR(kageki_csport_sel); - SCAN_VAR(kageki_sample_pos); - SCAN_VAR(kageki_sample_select); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch0(tnzs_banks[0]); - ZetClose(); - - ZetOpen(1); - bankswitch1(tnzs_banks[1]); - ZetClose(); - - if (game_kabukiz) { - ZetOpen(2); - kabukiz_sound_bankswitch(0, tnzs_banks[2]); - ZetClose(); - } - } - - return 0; -} - - -// Plump Pop (Japan) - -static struct BurnRomInfo plumppopRomDesc[] = { - { "a98__09.11c", 0x10000, 0x107f9e06, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a98__10.9c", 0x10000, 0xdf6e6af2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "a98__11.4e", 0x10000, 0xbc56775c, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b06__14.1g", 0x00800, 0x28907072, 3 }, // 3 I8742 MCU - - { "a98__01.mbm27c512.13a", 0x10000, 0xf3033dca, 4 | BRF_GRA }, // 4 Graphics - { "a98__02.mbm27c512.12a", 0x10000, 0xf2d17b0c, 4 | BRF_GRA }, // 5 - { "a98__03.mbm27c512.10a", 0x10000, 0x1a519b0a, 4 | BRF_GRA }, // 6 - { "a98__04.mbm27c512.8a", 0x10000, 0xb64501a1, 4 | BRF_GRA }, // 7 - { "a98__05.mbm27c512.7a", 0x10000, 0x45c36963, 4 | BRF_GRA }, // 8 - { "a98__06.mbm27c512.5a", 0x10000, 0xe075341b, 4 | BRF_GRA }, // 9 - { "a98__07.mbm27c512.4a", 0x10000, 0x8e16cd81, 4 | BRF_GRA }, // 10 - { "a98__08.mbm27c512.2a", 0x10000, 0xbfa7609a, 4 | BRF_GRA }, // 11 - - { "a98-13.15f", 0x00200, 0x7cde2da5, 5 | BRF_GRA }, // 12 Color PROMs - { "a98-12.17f", 0x00200, 0x90dc9da7, 5 | BRF_GRA }, // 13 - - /* pals on plumppop are the same set as arkanoid2/extrmatn/drtoppel/chukataio/etc with the exception of d9? */ - { "b06-10-1.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 14 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 15 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 16 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 17 -}; - -STD_ROM_PICK(plumppop) -STD_ROM_FN(plumppop) - -static INT32 PlumppopInit() -{ - return Type1Init(MCU_PLUMPOP); -} - -struct BurnDriver BurnDrvPlumppop = { - "plumppop", NULL, NULL, NULL, "1987", - "Plump Pop (Japan)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, plumppopRomInfo, plumppopRomName, NULL, NULL, PlumppopInputInfo, PlumppopDIPInfo, - PlumppopInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Extermination (World) - -static struct BurnRomInfo extrmatnRomDesc[] = { - { "b06-05.11c", 0x10000, 0x918e1fe3, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b06-06.9c", 0x10000, 0x8842e105, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b06-19.4e", 0x10000, 0x8de43ed9, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b06__14.1g", 0x00800, 0x28907072, 3 }, // 3 I8742 MCU - - { "b06-01.13a", 0x20000, 0xd2afbf7e, 4 | BRF_GRA }, // 4 Graphics - { "b06-02.10a", 0x20000, 0xe0c2757a, 4 | BRF_GRA }, // 5 - { "b06-03.7a", 0x20000, 0xee80ab9d, 4 | BRF_GRA }, // 6 - { "b06-04.4a", 0x20000, 0x3697ace4, 4 | BRF_GRA }, // 7 - - { "b06-09.15f", 0x00200, 0xf388b361, 5 | BRF_GRA }, // 8 Color PROMs - { "b06-08.17f", 0x00200, 0x10c9aac3, 5 | BRF_GRA }, // 9 - - /* these are shared with several other games on this hardware */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 10 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 11 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 12 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 13 -}; - -STD_ROM_PICK(extrmatn) -STD_ROM_FN(extrmatn) - -static INT32 ExtrmatnInit() -{ - return Type1Init(MCU_EXTRMATN); -} - -struct BurnDriver BurnDrvExtrmatn = { - "extrmatn", NULL, NULL, NULL, "1987", - "Extermination (World)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, extrmatnRomInfo, extrmatnRomName, NULL, NULL, CommonInputInfo, ExtrmatnDIPInfo, - ExtrmatnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Extermination (US, set 1) - -static struct BurnRomInfo extrmatuRomDesc[] = { - { "b06-20.11c", 0x10000, 0x04e3fc1f, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b06-21.9c", 0x10000, 0x1614d6a2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b06-22.4e", 0x10000, 0x744f2c84, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b06__14.1g", 0x00800, 0x28907072, 3 }, // 3 I8742 MCU - - { "b06-01.13a", 0x20000, 0xd2afbf7e, 4 | BRF_GRA }, // 4 Graphics - { "b06-02.10a", 0x20000, 0xe0c2757a, 4 | BRF_GRA }, // 5 - { "b06-03.7a", 0x20000, 0xee80ab9d, 4 | BRF_GRA }, // 6 - { "b06-04.4a", 0x20000, 0x3697ace4, 4 | BRF_GRA }, // 7 - - { "b06-09.15f", 0x00200, 0xf388b361, 5 | BRF_GRA }, // 8 Color PROMs - { "b06-08.17f", 0x00200, 0x10c9aac3, 5 | BRF_GRA }, // 9 - - /* these are shared with several other games on this hardware */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 10 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 11 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 12 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 13 -}; - -STD_ROM_PICK(extrmatu) -STD_ROM_FN(extrmatu) - -struct BurnDriver BurnDrvExtrmatu = { - "extrmatnu", "extrmatn", NULL, NULL, "1987", - "Extermination (US, set 1)\0", NULL, "Taito (World Games license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, extrmatuRomInfo, extrmatuRomName, NULL, NULL, CommonInputInfo, ExtrmatnDIPInfo, - ExtrmatnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Extermination (US, Romstar) - -static struct BurnRomInfo extrmaturRomDesc[] = { - { "b06_15", 0x10000, 0x4b3ee597, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b06_16", 0x10000, 0x86175ea4, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b06_17", 0x10000, 0x744f2c84, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b06__14.1g", 0x00800, 0x28907072, 3 }, // 3 I8742 MCU - - { "b06-01.13a", 0x20000, 0xd2afbf7e, 4 | BRF_GRA }, // 4 Graphics - { "b06-02.10a", 0x20000, 0xe0c2757a, 4 | BRF_GRA }, // 5 - { "b06-03.7a", 0x20000, 0xee80ab9d, 4 | BRF_GRA }, // 6 - { "b06-04.4a", 0x20000, 0x3697ace4, 4 | BRF_GRA }, // 7 - - { "b06-09.15f", 0x00200, 0xf388b361, 5 | BRF_GRA }, // 8 Color PROMs - { "b06-08.17f", 0x00200, 0x10c9aac3, 5 | BRF_GRA }, // 9 - - /* these are shared with several other games on this hardware */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 10 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 11 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 12 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 13 -}; - -STD_ROM_PICK(extrmatur) -STD_ROM_FN(extrmatur) - -struct BurnDriver BurnDrvExtrmatur = { - "extrmatnur", "extrmatn", NULL, NULL, "1987", - "Extermination (US, Romstar)\0", NULL, "Taito America Corporation (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, extrmaturRomInfo, extrmaturRomName, NULL, NULL, CommonInputInfo, ExtrmatnDIPInfo, - ExtrmatnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Extermination (Japan) - -static struct BurnRomInfo extrmatjRomDesc[] = { - { "b06-05.11c", 0x10000, 0x918e1fe3, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b06-06.9c", 0x10000, 0x8842e105, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b06-07.4e", 0x10000, 0xb37fb8b3, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b06__14.1g", 0x00800, 0x28907072, 3 }, // 3 I8742 MCU - - { "b06-01.13a", 0x20000, 0xd2afbf7e, 4 | BRF_GRA }, // 4 Graphics - { "b06-02.10a", 0x20000, 0xe0c2757a, 4 | BRF_GRA }, // 5 - { "b06-03.7a", 0x20000, 0xee80ab9d, 4 | BRF_GRA }, // 6 - { "b06-04.4a", 0x20000, 0x3697ace4, 4 | BRF_GRA }, // 7 - - { "b06-09.15f", 0x00200, 0xf388b361, 5 | BRF_GRA }, // 8 Color PROMs - { "b06-08.17f", 0x00200, 0x10c9aac3, 5 | BRF_GRA }, // 9 - - /* these are shared with several other games on this hardware */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 10 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 11 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 12 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 13 -}; - -STD_ROM_PICK(extrmatj) -STD_ROM_FN(extrmatj) - -struct BurnDriver BurnDrvExtrmatj = { - "extrmatnj", "extrmatn", NULL, NULL, "1987", - "Extermination (Japan)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_SHOOT, 0, - NULL, extrmatjRomInfo, extrmatjRomName, NULL, NULL, CommonInputInfo, ExtrmatnDIPInfo, - ExtrmatnInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid - Revenge of DOH (World) - -static struct BurnRomInfo arknoid2RomDesc[] = { - { "b08__05.11c", 0x10000, 0x136edf9d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b08__13.3e", 0x10000, 0xe8035ef1, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b08__09.3g", 0x00800, 0x00000000, 3 | BRF_NODUMP }, // 2 I8742 MCU - - { "b08-01.13a", 0x20000, 0x2ccc86b4, 4 | BRF_GRA }, // 3 Graphics - { "b08-02.10a", 0x20000, 0x056a985f, 4 | BRF_GRA }, // 4 - { "b08-03.7a", 0x20000, 0x274a795f, 4 | BRF_GRA }, // 5 - { "b08-04.4a", 0x20000, 0x9754f703, 4 | BRF_GRA }, // 6 - - { "b08-08.15f", 0x00200, 0xa4f7ebd9, 5 | BRF_GRA }, // 7 Color PROMs - { "b08-07.16f", 0x00200, 0xea34d9f7, 5 | BRF_GRA }, // 8 - - /* these are shared with extermination */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 9 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 10 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 11 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 12 -}; - -STD_ROM_PICK(arknoid2) -STD_ROM_FN(arknoid2) - -static INT32 Arknoid2Init() -{ - return Type1Init(MCU_ARKANOID); -} - -struct BurnDriver BurnDrvArknoid2 = { - "arknoid2", NULL, NULL, NULL, "1987", - "Arkanoid - Revenge of DOH (World)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arknoid2RomInfo, arknoid2RomName, NULL, NULL, Arknoid2InputInfo, Arknoid2DIPInfo, - Arknoid2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid - Revenge of DOH (US) - -static struct BurnRomInfo arknid2uRomDesc[] = { - { "b08__11.11c", 0x10000, 0x99555231, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b08__12.3e", 0x10000, 0xdc84e27d, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b08__09.3g", 0x00800, 0x00000000, 3 | BRF_NODUMP }, // 2 I8742 MCU - - { "b08-01.13a", 0x20000, 0x2ccc86b4, 4 | BRF_GRA }, // 3 Graphics - { "b08-02.10a", 0x20000, 0x056a985f, 4 | BRF_GRA }, // 4 - { "b08-03.7a", 0x20000, 0x274a795f, 4 | BRF_GRA }, // 5 - { "b08-04.4a", 0x20000, 0x9754f703, 4 | BRF_GRA }, // 6 - - { "b08-08.15f", 0x00200, 0xa4f7ebd9, 5 | BRF_GRA }, // 7 Color PROMs - { "b08-07.16f", 0x00200, 0xea34d9f7, 5 | BRF_GRA }, // 8 - - /* these are shared with extermination */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 9 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 10 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 11 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 12 -}; - -STD_ROM_PICK(arknid2u) -STD_ROM_FN(arknid2u) - -struct BurnDriver BurnDrvArknid2u = { - "arknoid2u", "arknoid2", NULL, NULL, "1987", - "Arkanoid - Revenge of DOH (US)\0", NULL, "Taito America Corporation (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arknid2uRomInfo, arknid2uRomName, NULL, NULL, Arknoid2InputInfo, Arknid2uDIPInfo, - Arknoid2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid - Revenge of DOH (Japan) - -static struct BurnRomInfo arknid2jRomDesc[] = { - { "b08_05.11c", 0x10000, 0x136edf9d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b08_06.3e", 0x10000, 0xadfcd40c, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b08__09.3g", 0x00800, 0x00000000, 3 | BRF_NODUMP }, // 2 I8742 MCU - - { "b08-01.13a", 0x20000, 0x2ccc86b4, 4 | BRF_GRA }, // 3 Graphics - { "b08-02.10a", 0x20000, 0x056a985f, 4 | BRF_GRA }, // 4 - { "b08-03.7a", 0x20000, 0x274a795f, 4 | BRF_GRA }, // 5 - { "b08-04.4a", 0x20000, 0x9754f703, 4 | BRF_GRA }, // 6 - - { "b08-08.15f", 0x00200, 0xa4f7ebd9, 5 | BRF_GRA }, // 7 Color PROMs - { "b08-07.16f", 0x00200, 0xea34d9f7, 5 | BRF_GRA }, // 8 - - /* these are shared with extermination */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 9 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 10 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 11 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 12 -}; - -STD_ROM_PICK(arknid2j) -STD_ROM_FN(arknid2j) - -struct BurnDriver BurnDrvArknid2j = { - "arknoid2j", "arknoid2", NULL, NULL, "1987", - "Arkanoid - Revenge of DOH (Japan)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arknid2jRomInfo, arknid2jRomName, NULL, NULL, Arknoid2InputInfo, Arknid2uDIPInfo, - Arknoid2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Arkanoid - Revenge of DOH (Japan bootleg) - -static struct BurnRomInfo arknid2bRomDesc[] = { - { "boot.11c", 0x10000, 0x3847dfb0, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b08_13.3e", 0x10000, 0xe8035ef1, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - /* Labeled B08 // 09 and under printed label "?Taito M-009?", is a mask 8042... does the bootleg set even HAVE the mcu? */ - { "ark28742.3g", 0x00800, 0x00000000, 3 | BRF_NODUMP }, // 2 I8742 MCU - - { "b08-01.13a", 0x20000, 0x2ccc86b4, 4 | BRF_GRA }, // 3 Graphics - { "b08-02.10a", 0x20000, 0x056a985f, 4 | BRF_GRA }, // 4 - { "b08-03.7a", 0x20000, 0x274a795f, 4 | BRF_GRA }, // 5 - { "b08-04.4a", 0x20000, 0x9754f703, 4 | BRF_GRA }, // 6 - - { "b08-08.15f", 0x00200, 0xa4f7ebd9, 5 | BRF_GRA }, // 7 Color PROMs - { "b08-07.16f", 0x00200, 0xea34d9f7, 5 | BRF_GRA }, // 8 - - /* these are shared with extermination */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 9 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 10 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 11 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 12 -}; - -STD_ROM_PICK(arknid2b) -STD_ROM_FN(arknid2b) - -struct BurnDriver BurnDrvArknid2b = { - "arknoid2b", "arknoid2", NULL, NULL, "1987", - "Arkanoid - Revenge of DOH (Japan bootleg)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, arknid2bRomInfo, arknid2bRomName, NULL, NULL, Arknoid2InputInfo, Arknid2uDIPInfo, - Arknoid2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Dr. Toppel's Adventure (World) - -static struct BurnRomInfo drtoppelRomDesc[] = { - { "b19__09.11c", 0x10000, 0x3e654f82, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b19__10.9c", 0x10000, 0x7e72fd25, 1 | BRF_PRG | BRF_ESS }, // 1 - - /* Region-Hacked??, need correct Taito rom number */ - { "b19__15.3e", 0x10000, 0x37a0d3fb, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b06__14.1g", 0x00800, 0x28907072, 3 | BRF_PRG | BRF_OPT }, // 3 I8742 MCU - - { "b19-01.23c1000.13a", 0x20000, 0xa7e8a0c1, 4 | BRF_GRA }, // 4 Graphics - { "b19-02.23c1000.12a", 0x20000, 0x790ae654, 4 | BRF_GRA }, // 5 - { "b19-03.23c1000.10a", 0x20000, 0x495c4c5a, 4 | BRF_GRA }, // 6 - { "b19-04.23c1000.8a", 0x20000, 0x647007a0, 4 | BRF_GRA }, // 7 - { "b19-05.23c1000.7a", 0x20000, 0x49f2b1a5, 4 | BRF_GRA }, // 8 - { "b19-06.23c1000.5a", 0x20000, 0x2d39f1d0, 4 | BRF_GRA }, // 9 - { "b19-07.23c1000.4a", 0x20000, 0x8bb06f41, 4 | BRF_GRA }, // 10 - { "b19-08.23c1000.2a", 0x20000, 0x3584b491, 4 | BRF_GRA }, // 11 - - { "b19-13.am27s29.15f", 0x00200, 0x6a547980, 5 | BRF_GRA }, // 12 Color PROMs - { "b19-12.am27s29.16f", 0x00200, 0x5754e9d8, 5 | BRF_GRA }, // 13 - - /* these are shared with extermination */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 14 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 15 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 16 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 17 -}; - -STD_ROM_PICK(drtoppel) -STD_ROM_FN(drtoppel) - -static INT32 DrtoppelInit() -{ - return Type1Init(MCU_DRTOPPEL); -} - -struct BurnDriver BurnDrvDrtoppel = { - "drtoppel", NULL, NULL, NULL, "1987", - "Dr. Toppel's Adventure (World)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, drtoppelRomInfo, drtoppelRomName, NULL, NULL, CommonInputInfo, DrtoppelDIPInfo, - DrtoppelInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Dr. Toppel's Adventure (World, alt?) -// one byte different (db8f : 39 instead of 37) - possible of bad and/or hacked rom - -static struct BurnRomInfo drtoppelaRomDesc[] = { - { "b19_09.bin", 0x10000, 0x6364a970, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b19-10.9c", 0x10000, 0x7e72fd25, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b19-15.3e", 0x10000, 0x37a0d3fb, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "drt8742.3g", 0x00800, 0x00000000, 3 | BRF_NODUMP }, // 3 I8742 MCU - - { "b19-01.23c1000.13a", 0x20000, 0xa7e8a0c1, 4 | BRF_GRA }, // 4 Graphics - { "b19-02.23c1000.12a", 0x20000, 0x790ae654, 4 | BRF_GRA }, // 5 - { "b19-03.23c1000.10a", 0x20000, 0x495c4c5a, 4 | BRF_GRA }, // 6 - { "b19-04.23c1000.8a", 0x20000, 0x647007a0, 4 | BRF_GRA }, // 7 - { "b19-05.23c1000.7a", 0x20000, 0x49f2b1a5, 4 | BRF_GRA }, // 8 - { "b19-06.23c1000.5a", 0x20000, 0x2d39f1d0, 4 | BRF_GRA }, // 9 - { "b19-07.23c1000.4a", 0x20000, 0x8bb06f41, 4 | BRF_GRA }, // 10 - { "b19-08.23c1000.2a", 0x20000, 0x3584b491, 4 | BRF_GRA }, // 11 - - { "b19-13.15f", 0x00200, 0x6a547980, 5 | BRF_GRA }, // 12 Color PROMs - { "b19-12.16f", 0x00200, 0x5754e9d8, 5 | BRF_GRA }, // 13 -}; - -STD_ROM_PICK(drtoppela) -STD_ROM_FN(drtoppela) - -struct BurnDriver BurnDrvDrtoppela = { - "drtoppela", "drtoppel", NULL, NULL, "1987", - "Dr. Toppel's Adventure (World, alt?)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, drtoppelaRomInfo, drtoppelaRomName, NULL, NULL, CommonInputInfo, DrtoppelDIPInfo, - DrtoppelInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Dr. Toppel's Adventure (US) - -static struct BurnRomInfo drtoppluRomDesc[] = { - { "b19__09.11c", 0x10000, 0x3e654f82, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b19__10.9c", 0x10000, 0x7e72fd25, 1 | BRF_PRG | BRF_ESS }, // 1 - - /* Region-Hacked??, need correct Taito rom number */ - { "b19__14.3e", 0x10000, 0x05565b22, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b06__14.1g", 0x00800, 0x28907072, 3 | BRF_PRG | BRF_OPT }, // 3 I8742 MCU - - { "b19-01.23c1000.13a", 0x20000, 0xa7e8a0c1, 4 | BRF_GRA }, // 4 Graphics - { "b19-02.23c1000.12a", 0x20000, 0x790ae654, 4 | BRF_GRA }, // 5 - { "b19-03.23c1000.10a", 0x20000, 0x495c4c5a, 4 | BRF_GRA }, // 6 - { "b19-04.23c1000.8a", 0x20000, 0x647007a0, 4 | BRF_GRA }, // 7 - { "b19-05.23c1000.7a", 0x20000, 0x49f2b1a5, 4 | BRF_GRA }, // 8 - { "b19-06.23c1000.5a", 0x20000, 0x2d39f1d0, 4 | BRF_GRA }, // 9 - { "b19-07.23c1000.4a", 0x20000, 0x8bb06f41, 4 | BRF_GRA }, // 10 - { "b19-08.23c1000.2a", 0x20000, 0x3584b491, 4 | BRF_GRA }, // 11 - - { "b19-13.am27s29.15f", 0x00200, 0x6a547980, 5 | BRF_GRA }, // 12 Color PROMs - { "b19-12.am27s29.16f", 0x00200, 0x5754e9d8, 5 | BRF_GRA }, // 13 - - /* these are shared with extermination */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 14 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 15 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 16 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 17 -}; - -STD_ROM_PICK(drtopplu) -STD_ROM_FN(drtopplu) - -struct BurnDriver BurnDrvDrtopplu = { - "drtoppelu", "drtoppel", NULL, NULL, "1987", - "Dr. Toppel's Adventure (US)\0", NULL, "Taito America Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, drtoppluRomInfo, drtoppluRomName, NULL, NULL, CommonInputInfo, DrtoppluDIPInfo, - DrtoppelInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Dr. Toppel's Tankentai (Japan) - -static struct BurnRomInfo drtoppljRomDesc[] = { - { "b19__09.11c", 0x10000, 0x3e654f82, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b19__10.9c", 0x10000, 0x7e72fd25, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b19__11.3e", 0x10000, 0x524dc249, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b06__14.1g", 0x00800, 0x28907072, 3 | BRF_PRG | BRF_OPT }, // 3 I8742 MCU - - { "b19-01.23c1000.13a", 0x20000, 0xa7e8a0c1, 4 | BRF_GRA }, // 4 Graphics - { "b19-02.23c1000.12a", 0x20000, 0x790ae654, 4 | BRF_GRA }, // 5 - { "b19-03.23c1000.10a", 0x20000, 0x495c4c5a, 4 | BRF_GRA }, // 6 - { "b19-04.23c1000.8a", 0x20000, 0x647007a0, 4 | BRF_GRA }, // 7 - { "b19-05.23c1000.7a", 0x20000, 0x49f2b1a5, 4 | BRF_GRA }, // 8 - { "b19-06.23c1000.5a", 0x20000, 0x2d39f1d0, 4 | BRF_GRA }, // 9 - { "b19-07.23c1000.4a", 0x20000, 0x8bb06f41, 4 | BRF_GRA }, // 10 - { "b19-08.23c1000.2a", 0x20000, 0x3584b491, 4 | BRF_GRA }, // 11 - - { "b19-13.am27s29.15f", 0x00200, 0x6a547980, 5 | BRF_GRA }, // 12 Color PROMs - { "b19-12.am27s29.16f", 0x00200, 0x5754e9d8, 5 | BRF_GRA }, // 13 - - /* these are shared with extermination */ - { "b06-10.pal16l8a.d9.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 14 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 15 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 16 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 6 | BRF_OPT | BRF_NODUMP }, // 17 -}; - -STD_ROM_PICK(drtopplj) -STD_ROM_FN(drtopplj) - -struct BurnDriver BurnDrvDrtopplj = { - "drtoppelj", "drtoppel", NULL, NULL, "1987", - "Dr. Toppel's Tankentai (Japan)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, drtoppljRomInfo, drtoppljRomName, NULL, NULL, CommonInputInfo, DrtoppluDIPInfo, - DrtoppelInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Kageki (US) - -static struct BurnRomInfo kagekiRomDesc[] = { - { "b35-16.11c", 0x10000, 0xa4e6fd58, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b35-10.9c", 0x10000, 0xb150457d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b35-17.43e", 0x10000, 0xfdd9c246, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b35__01.13a", 0x20000, 0x01d83a69, 4 | BRF_GRA }, // 3 Graphics - { "b35__02.12a", 0x20000, 0xd8af47ac, 4 | BRF_GRA }, // 4 - { "b35__03.10a", 0x20000, 0x3cb68797, 4 | BRF_GRA }, // 5 - { "b35__04.8a", 0x20000, 0x71c03f91, 4 | BRF_GRA }, // 6 - { "b35__05.7a", 0x20000, 0xa4e20c08, 4 | BRF_GRA }, // 7 - { "b35__06.5a", 0x20000, 0x3f8ab658, 4 | BRF_GRA }, // 8 - { "b35__07.4a", 0x20000, 0x1b4af049, 4 | BRF_GRA }, // 9 - { "b35__08.2a", 0x20000, 0xdeb2268c, 4 | BRF_GRA }, // 10 - - { "b35-15.98g", 0x10000, 0xe6212a0f, 6 | BRF_SND }, // 11 Samples - - /* these are shared with extermination except d9 */ - { "b06-101.pal16l8a.d9.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 12 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 14 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 15 -}; - -STD_ROM_PICK(kageki) -STD_ROM_FN(kageki) - -static INT32 KagekiInit() -{ - return Type1Init(MCU_NONE_KAGEKI); -} - -struct BurnDriver BurnDrvKageki = { - "kageki", NULL, NULL, NULL, "1988", - "Kageki (US)\0", NULL, "Taito America Corporation (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, kagekiRomInfo, kagekiRomName, NULL, NULL, CommonInputInfo, KagekiDIPInfo, - KagekiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Kageki (Japan) - -static struct BurnRomInfo kagekijRomDesc[] = { - { "b35-09.11c", 0x10000, 0x829637d5, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b35-10.9c", 0x10000, 0xb150457d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b35-11.43e", 0x10000, 0x64d093fc, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b35-01.13a", 0x20000, 0x01d83a69, 4 | BRF_GRA }, // 3 Graphics - { "b35-02.12a", 0x20000, 0xd8af47ac, 4 | BRF_GRA }, // 4 - { "b35-03.10a", 0x20000, 0x3cb68797, 4 | BRF_GRA }, // 5 - { "b35-04.8a", 0x20000, 0x71c03f91, 4 | BRF_GRA }, // 6 - { "b35-05.7a", 0x20000, 0xa4e20c08, 4 | BRF_GRA }, // 7 - { "b35-06.5a", 0x20000, 0x3f8ab658, 4 | BRF_GRA }, // 8 - { "b35-07.4a", 0x20000, 0x1b4af049, 4 | BRF_GRA }, // 9 - { "b35-08.2a", 0x20000, 0xdeb2268c, 4 | BRF_GRA }, // 10 - - { "b35-12.98g", 0x10000, 0x184409f1, 6 | BRF_SND }, // 11 Samples - - /* these are shared with extermination except d9 */ - { "b06-101.pal16l8a.d9.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 12 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 14 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 15 -}; - -STD_ROM_PICK(kagekij) -STD_ROM_FN(kagekij) - -struct BurnDriver BurnDrvKagekij = { - "kagekij", "kageki", NULL, NULL, "1988", - "Kageki (Japan)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, kagekijRomInfo, kagekijRomName, NULL, NULL, CommonInputInfo, KagekiDIPInfo, - KagekiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Kageki (hack) - -static struct BurnRomInfo kagekihRomDesc[] = { - { "b35_16.11c", 0x10000, 0x1cf67603, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b35-10.9c", 0x10000, 0xb150457d, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b35-11.43e", 0x10000, 0x64d093fc, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - { "b35-01.13a", 0x20000, 0x01d83a69, 4 | BRF_GRA }, // 3 Graphics - { "b35-02.12a", 0x20000, 0xd8af47ac, 4 | BRF_GRA }, // 4 - { "b35-03.10a", 0x20000, 0x3cb68797, 4 | BRF_GRA }, // 5 - { "b35-04.8a", 0x20000, 0x71c03f91, 4 | BRF_GRA }, // 6 - { "b35-05.7a", 0x20000, 0xa4e20c08, 4 | BRF_GRA }, // 7 - { "b35-06.5a", 0x20000, 0x3f8ab658, 4 | BRF_GRA }, // 8 - { "b35-07.4a", 0x20000, 0x1b4af049, 4 | BRF_GRA }, // 9 - { "b35-08.2a", 0x20000, 0xdeb2268c, 4 | BRF_GRA }, // 10 - - { "b35-12.98g", 0x10000, 0x184409f1, 6 | BRF_SND }, // 11 Samples - - /* these are shared with extermination except d9 */ - { "b06-101.pal16l8a.d9.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 12 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 14 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 7 | BRF_OPT | BRF_NODUMP }, // 15 -}; - -STD_ROM_PICK(kagekih) -STD_ROM_FN(kagekih) - -struct BurnDriver BurnDrvKagekih = { - "kagekih", "kageki", NULL, NULL, "1992", - "Kageki (hack)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_VSFIGHT, 0, - NULL, kagekihRomInfo, kagekihRomName, NULL, NULL, CommonInputInfo, KagekiDIPInfo, - KagekiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; - - -// Chuka Taisen (World) - -static struct BurnRomInfo chukataiRomDesc[] = { - { "b44-10", 0x10000, 0x8c69e008, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b44-11", 0x10000, 0x32484094, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b44-12w", 0x10000, 0xe80ecdca, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - /* B44 // 09 is the label? what is the mask number under the label? maybe Taito M-011? last digit is definitely 1 */ - { "b44-8742.mcu", 0x00800, 0x7dff3f9f, 3 | BRF_PRG | BRF_OPT }, // 3 I8742 MCU - - { "b44-01.a13", 0x20000, 0xaae7b3d5, 4 | BRF_GRA }, // 4 Graphics - { "b44-02.a12", 0x20000, 0x7f0b9568, 4 | BRF_GRA }, // 5 - { "b44-03.a10", 0x20000, 0x5a54a3b9, 4 | BRF_GRA }, // 6 - { "b44-04.a08", 0x20000, 0x3c5f544b, 4 | BRF_GRA }, // 7 - { "b44-05.a07", 0x20000, 0xd1b7e314, 4 | BRF_GRA }, // 8 - { "b44-06.a05", 0x20000, 0x269978a8, 4 | BRF_GRA }, // 9 - { "b44-07.a04", 0x20000, 0x3e0e737e, 4 | BRF_GRA }, // 10 - { "b44-08.a02", 0x20000, 0x6cb1e8fc, 4 | BRF_GRA }, // 11 - - /* these are shared with extermination except d9 */ - { "b06-101.pal16l8a.d9.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 14 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 15 -}; - -STD_ROM_PICK(chukatai) -STD_ROM_FN(chukatai) - -static INT32 ChukataiInit() -{ - return Type1Init(MCU_CHUKATAI); -} - -struct BurnDriver BurnDrvChukatai = { - "chukatai", NULL, NULL, NULL, "1988", - "Chuka Taisen (World)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, chukataiRomInfo, chukataiRomName, NULL, NULL, CommonInputInfo, ChukataiDIPInfo, - ChukataiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Chuka Taisen (US) - -static struct BurnRomInfo chukatauRomDesc[] = { - { "b44-10", 0x10000, 0x8c69e008, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b44-11", 0x10000, 0x32484094, 1 | BRF_PRG | BRF_ESS }, // 1 - - /* Hacked??, need correct Taito rom number */ - { "b44-12u", 0x10000, 0x9f09fd5c, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - /* B44 // 09 is the label? what is the mask number under the label? maybe Taito M-011? last digit is definitely 1 */ - { "b44-8742.mcu", 0x00800, 0x7dff3f9f, 3 | BRF_PRG | BRF_OPT }, // 3 I8742 MCU - - { "b44-01.a13", 0x20000, 0xaae7b3d5, 4 | BRF_GRA }, // 4 Graphics - { "b44-02.a12", 0x20000, 0x7f0b9568, 4 | BRF_GRA }, // 5 - { "b44-03.a10", 0x20000, 0x5a54a3b9, 4 | BRF_GRA }, // 6 - { "b44-04.a08", 0x20000, 0x3c5f544b, 4 | BRF_GRA }, // 7 - { "b44-05.a07", 0x20000, 0xd1b7e314, 4 | BRF_GRA }, // 8 - { "b44-06.a05", 0x20000, 0x269978a8, 4 | BRF_GRA }, // 9 - { "b44-07.a04", 0x20000, 0x3e0e737e, 4 | BRF_GRA }, // 10 - { "b44-08.a02", 0x20000, 0x6cb1e8fc, 4 | BRF_GRA }, // 11 - - /* these are shared with extermination except d9 */ - { "b06-101.pal16l8a.d9.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 14 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 15 -}; - -STD_ROM_PICK(chukatau) -STD_ROM_FN(chukatau) - -struct BurnDriver BurnDrvChukatau = { - "chukataiu", "chukatai", NULL, NULL, "1988", - "Chuka Taisen (US)\0", NULL, "Taito America Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, chukatauRomInfo, chukatauRomName, NULL, NULL, CommonInputInfo, ChukatauDIPInfo, - ChukataiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Chuka Taisen (Japan) - -static struct BurnRomInfo chukatajRomDesc[] = { - { "b44-10", 0x10000, 0x8c69e008, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "b44-11", 0x10000, 0x32484094, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b44-12", 0x10000, 0x0600ace6, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 #1 Code - - /* B44 // 09 is the label? what is the mask number under the label? maybe Taito M-011? last digit is definitely 1 */ - { "b44-8742.mcu", 0x00800, 0x7dff3f9f, 3 | BRF_PRG | BRF_OPT }, // 3 I8742 MCU - - { "b44-01.a13", 0x20000, 0xaae7b3d5, 4 | BRF_GRA }, // 4 Graphics - { "b44-02.a12", 0x20000, 0x7f0b9568, 4 | BRF_GRA }, // 5 - { "b44-03.a10", 0x20000, 0x5a54a3b9, 4 | BRF_GRA }, // 6 - { "b44-04.a08", 0x20000, 0x3c5f544b, 4 | BRF_GRA }, // 7 - { "b44-05.a07", 0x20000, 0xd1b7e314, 4 | BRF_GRA }, // 8 - { "b44-06.a05", 0x20000, 0x269978a8, 4 | BRF_GRA }, // 9 - { "b44-07.a04", 0x20000, 0x3e0e737e, 4 | BRF_GRA }, // 10 - { "b44-08.a02", 0x20000, 0x6cb1e8fc, 4 | BRF_GRA }, // 11 - - /* these are shared with extermination except d9 */ - { "b06-101.pal16l8a.d9.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 Pal - { "b06-11.pal16l8a.d6.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-12.pal16l8a.c3.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 14 - { "b06-13.pal16l8a.c2.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 15 -}; - -STD_ROM_PICK(chukataj) -STD_ROM_FN(chukataj) - -struct BurnDriver BurnDrvChukataj = { - "chukataij", "chukatai", NULL, NULL, "1988", - "Chuka Taisen (Japan)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, chukatajRomInfo, chukatajRomName, NULL, NULL, CommonInputInfo, ChukatauDIPInfo, - ChukataiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// The NewZealand Story (World, newer) - -static struct BurnRomInfo tnzsRomDesc[] = { - { "b53-24.u1", 0x20000, 0xd66824c6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b53-25.u3", 0x10000, 0xd6ac4e71, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b53-26.u34", 0x10000, 0xcfd5649c, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "b53-16.ic7", 0x20000, 0xc3519c2a, 4 | BRF_GRA }, // 3 Graphics - { "b53-17.ic8", 0x20000, 0x2bf199e8, 4 | BRF_GRA }, // 4 - { "b53-18.ic9", 0x20000, 0x92f35ed9, 4 | BRF_GRA }, // 5 - { "b53-19.ic10", 0x20000, 0xedbb9581, 4 | BRF_GRA }, // 6 - { "b53-22.ic11", 0x20000, 0x59d2aef6, 4 | BRF_GRA }, // 7 - { "b53-23.ic13", 0x20000, 0x74acfb9b, 4 | BRF_GRA }, // 8 - { "b53-20.ic12", 0x20000, 0x095d0dc0, 4 | BRF_GRA }, // 9 - { "b53-21.ic14", 0x20000, 0x9800c54d, 4 | BRF_GRA }, // 10 - - /* these are shared with extermination except for the subpcb pal */ - { "b06-13.pal16l8a.f2.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 11 Pal - { "b06-101.pal16l8a.i2.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 - { "b53-15.pal16l8a.subpcb.ic6.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 on sub pcb -}; - -STD_ROM_PICK(tnzs) -STD_ROM_FN(tnzs) - -struct BurnDriver BurnDrvtnzs = { - "tnzs", NULL, NULL, NULL, "1988", - "The NewZealand Story (World, newer)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, tnzsRomInfo, tnzsRomName, NULL, NULL, CommonInputInfo, TnzsDIPInfo, - Type2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// The NewZealand Story (Japan, newer) - -static struct BurnRomInfo tnzsjRomDesc[] = { - { "b53-24.u1", 0x20000, 0xd66824c6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b53-27.u3", 0x10000, 0xb3415fc3, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b53-26.u34", 0x10000, 0xcfd5649c, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "b53-16.ic7", 0x20000, 0xc3519c2a, 4 | BRF_GRA }, // 3 Graphics - { "b53-17.ic8", 0x20000, 0x2bf199e8, 4 | BRF_GRA }, // 4 - { "b53-18.ic9", 0x20000, 0x92f35ed9, 4 | BRF_GRA }, // 5 - { "b53-19.ic10", 0x20000, 0xedbb9581, 4 | BRF_GRA }, // 6 - { "b53-22.ic11", 0x20000, 0x59d2aef6, 4 | BRF_GRA }, // 7 - { "b53-23.ic13", 0x20000, 0x74acfb9b, 4 | BRF_GRA }, // 8 - { "b53-20.ic12", 0x20000, 0x095d0dc0, 4 | BRF_GRA }, // 9 - { "b53-21.ic14", 0x20000, 0x9800c54d, 4 | BRF_GRA }, // 10 - - /* these are shared with extermination except for the subpcb pal */ - { "b06-13.pal16l8a.f2.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 11 Pal - { "b06-101.pal16l8a.i2.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 - { "b53-15.pal16l8a.subpcb.ic6.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 on sub pcb -}; - -STD_ROM_PICK(tnzsj) -STD_ROM_FN(tnzsj) - -struct BurnDriver BurnDrvtnzsj = { - "tnzsj", "tnzs", NULL, NULL, "1988", - "The NewZealand Story (Japan, new version, newer PCB)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, tnzsjRomInfo, tnzsjRomName, NULL, NULL, CommonInputInfo, TnzsjDIPInfo, - Type2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// The NewZealand Story (Japan, old version) (older PCB) - -static struct BurnRomInfo tnzsjoRomDesc[] = { - { "b53-10.27c1001d.u32", 0x20000, 0xa73745c6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b53-11.27c512.u38", 0x10000, 0x9784d443, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b53-09.u46", 0x00800, 0xa4bfce19, 3 | BRF_PRG | BRF_OPT }, // 2 I8742 MCU - - { "b53-08.u8", 0x20000, 0xc3519c2a, 4 | BRF_GRA }, // 3 Graphics - { "b53-07.u7", 0x20000, 0x2bf199e8, 4 | BRF_GRA }, // 4 - { "b53-06.u6", 0x20000, 0x92f35ed9, 4 | BRF_GRA }, // 5 - { "b53-05.u5", 0x20000, 0xedbb9581, 4 | BRF_GRA }, // 6 - { "b53-04.u4", 0x20000, 0x59d2aef6, 4 | BRF_GRA }, // 7 - { "b53-03.u3", 0x20000, 0x74acfb9b, 4 | BRF_GRA }, // 8 - { "b53-02.u2", 0x20000, 0x095d0dc0, 4 | BRF_GRA }, // 9 - { "b53-01.u1", 0x20000, 0x9800c54d, 4 | BRF_GRA }, // 10 - - /* these are probably shared with extermination except for u35 */ - { "b06-12.pal16l8a.u26.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 11 Pal - { "b06-13.pal16l8a.u25.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 - { "b53-12.pal16l8a.u35.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-101.pal16l8a.u36.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 14 -}; - -STD_ROM_PICK(tnzsjo) -STD_ROM_FN(tnzsjo) - -static INT32 TnzsoInit() -{ - return Type1Init(MCU_TNZS); -} - -struct BurnDriver BurnDrvTnzsjo = { - "tnzsjo", "tnzs", NULL, NULL, "1988", - "The NewZealand Story (Japan, old version) (older PCB)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, tnzsjoRomInfo, tnzsjoRomName, NULL, NULL, CommonInputInfo, TnzsjoDIPInfo, - TnzsoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// The NewZealand Story (US, old version) (older PCB) - -static struct BurnRomInfo tnzsuoRomDesc[] = { - { "b53-10.27c1001d.u32", 0x20000, 0xa73745c6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b53-13.27c512.u38", 0x10000, 0xc09f4d28, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b53-09.u46", 0x00800, 0xa4bfce19, 3 | BRF_PRG | BRF_OPT }, // 2 I8742 MCU - - { "b53-08.u8", 0x20000, 0xc3519c2a, 4 | BRF_GRA }, // 3 Graphics - { "b53-07.u7", 0x20000, 0x2bf199e8, 4 | BRF_GRA }, // 4 - { "b53-06.u6", 0x20000, 0x92f35ed9, 4 | BRF_GRA }, // 5 - { "b53-05.u5", 0x20000, 0xedbb9581, 4 | BRF_GRA }, // 6 - { "b53-04.u4", 0x20000, 0x59d2aef6, 4 | BRF_GRA }, // 7 - { "b53-03.u3", 0x20000, 0x74acfb9b, 4 | BRF_GRA }, // 8 - { "b53-02.u2", 0x20000, 0x095d0dc0, 4 | BRF_GRA }, // 9 - { "b53-01.u1", 0x20000, 0x9800c54d, 4 | BRF_GRA }, // 10 - - /* these are probably shared with extermination except for u35 */ - { "b06-12.pal16l8a.u26.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 11 Pal - { "b06-13.pal16l8a.u25.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 - { "b53-12.pal16l8a.u35.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-101.pal16l8a.u36.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 14 -}; - -STD_ROM_PICK(tnzsuo) -STD_ROM_FN(tnzsuo) - -struct BurnDriver BurnDrvTnzsuo = { - "tnzsuo", "tnzs", NULL, NULL, "1988", - "The NewZealand Story (US, old version) (older PCB)\0", NULL, "Taito America Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, tnzsuoRomInfo, tnzsuoRomName, NULL, NULL, CommonInputInfo, TnzsjoDIPInfo, - TnzsoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// The NewZealand Story (World, old version) (older PCB) - -static struct BurnRomInfo tnzsoRomDesc[] = { - { "b53-10.27c1001d.u32", 0x20000, 0xa73745c6, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b53-14.u38", 0x10000, 0xf269c5f1, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b53-09.u46", 0x00800, 0xa4bfce19, 3 | BRF_PRG | BRF_OPT }, // 2 I8742 MCU - - { "b53-08.u8", 0x20000, 0xc3519c2a, 4 | BRF_GRA }, // 3 Graphics - { "b53-07.u7", 0x20000, 0x2bf199e8, 4 | BRF_GRA }, // 4 - { "b53-06.u6", 0x20000, 0x92f35ed9, 4 | BRF_GRA }, // 5 - { "b53-05.u5", 0x20000, 0xedbb9581, 4 | BRF_GRA }, // 6 - { "b53-04.u4", 0x20000, 0x59d2aef6, 4 | BRF_GRA }, // 7 - { "b53-03.u3", 0x20000, 0x74acfb9b, 4 | BRF_GRA }, // 8 - { "b53-02.u2", 0x20000, 0x095d0dc0, 4 | BRF_GRA }, // 9 - { "b53-01.u1", 0x20000, 0x9800c54d, 4 | BRF_GRA }, // 10 - - /* these are probably shared with extermination except for u35 */ - { "b06-12.pal16l8a.u26.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 11 Pal - { "b06-13.pal16l8a.u25.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 - { "b53-12.pal16l8a.u35.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-101.pal16l8a.u36.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 14 -}; - -STD_ROM_PICK(tnzso) -STD_ROM_FN(tnzso) - -struct BurnDriver BurnDrvTnzso = { - "tnzso", "tnzs", NULL, NULL, "1988", - "The NewZealand Story (World, old version) (older PCB)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, tnzsoRomInfo, tnzsoRomName, NULL, NULL, CommonInputInfo, TnzsopDIPInfo, - TnzsoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - -// The NewZealand Story (World, unknown version) (older PCB) -// is this a legit set, or a hack, or a near-final (later than tnzsop below) prototype? - -static struct BurnRomInfo tnzsoaRomDesc[] = { - { "b53-unknown.27c1001d.u32", 0x20000, 0xedf3b39e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b53-unknown.27c512.u38", 0x10000, 0x60340d63, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b53-09.u46", 0x00800, 0xa4bfce19, 3 | BRF_PRG | BRF_OPT }, // 2 I8742 MCU - - { "b53-08.u8", 0x20000, 0xc3519c2a, 4 | BRF_GRA }, // 3 Graphics - { "b53-07.u7", 0x20000, 0x2bf199e8, 4 | BRF_GRA }, // 4 - { "b53-06.u6", 0x20000, 0x92f35ed9, 4 | BRF_GRA }, // 5 - { "b53-05.u5", 0x20000, 0xedbb9581, 4 | BRF_GRA }, // 6 - { "b53-04.u4", 0x20000, 0x59d2aef6, 4 | BRF_GRA }, // 7 - { "b53-03.u3", 0x20000, 0x74acfb9b, 4 | BRF_GRA }, // 8 - { "b53-02.u2", 0x20000, 0x095d0dc0, 4 | BRF_GRA }, // 9 - { "b53-01.u1", 0x20000, 0x9800c54d, 4 | BRF_GRA }, // 10 - - /* PALS not directly observed on this board but assumed to exist */ - /* these are probably shared with extermination except for u35 */ - { "b06-12.pal16l8a.u26.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 11 Pal - { "b06-13.pal16l8a.u25.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 - { "b53-12.pal16l8a.u35.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 - { "b06-101.pal16l8a.u36.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 14 -}; - -STD_ROM_PICK(tnzsoa) -STD_ROM_FN(tnzsoa) - -struct BurnDriver BurnDrvTnzsoa = { - "tnzsoa", "tnzs", NULL, NULL, "1988", - "The NewZealand Story (World, unknown version) (older PCB)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, tnzsoaRomInfo, tnzsoaRomName, NULL, NULL, CommonInputInfo, TnzsopDIPInfo, - TnzsoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - -/* This is a prototype CA403001A PCB (Seta: P0-041-1), and is ALMOST but not exactly the same as the K1100356A/J1100156A (Seta: P0-041A) 'tnzsuo/tnzsjo/arkanoid2/etc' pcb above: -This pcb uses 32-pin 27c1000d eproms for the 8 gfx roms, and the final K1100356A/J1100156A pcb uses 28 pin 23c1000 mask roms instead. Some capacitors near the jamma connector were moved as well. -No other obviously evident routing/wiring changes are present. -This type of pcb might have been used for in-house testing of all the games on this hardware. -*/ - -// The NewZealand Story (World, prototype) (older PCB) -// prototype (location test?) version; has different rom labels, and the Seta X1-001 chip has prototype markings revealing it was fabbed by Yamaha, as 'YM3906' - -static struct BurnRomInfo tnzsopRomDesc[] = { - { "c-11__6-24__1959h.d27c1000d-15.u32", 0x20000, 0x3c1dae7b, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "e-3__6-24__c4ach.tmm27512d-20.u38", 0x10000, 0xc7662e96, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b8042h__'88-6-22__0fcc.d8742.u46", 0x00800, 0xa4bfce19, 3 | BRF_PRG | BRF_OPT }, // 2 I8742 MCU - - { "a13__03e8.d27c1000d-15.a13", 0x20000, 0x7e0bd5bb, 4 | BRF_GRA }, // 3 Graphics - { "a12__f4ec.d27c1000d-15.a12", 0x20000, 0x95880726, 4 | BRF_GRA }, // 4 - { "a10__f2b5.d27c1000d-15.a10", 0x20000, 0x2bc4c053, 4 | BRF_GRA }, // 5 - { "a08__bd49.d27c1000d-15.a8", 0x20000, 0x8ff8d88c, 4 | BRF_GRA }, // 6 - { "a07__d5f3.d27c1000d-15.a7", 0x20000, 0x291bcaca, 4 | BRF_GRA }, // 7 - { "a05__662a.d27c1000d-15.a5", 0x20000, 0x6e762e20, 4 | BRF_GRA }, // 8 - { "a04__0c21.d27c1000d-15.a4", 0x20000, 0xe1fd1b9d, 4 | BRF_GRA }, // 9 - { "a02__904f.d27c1000d-15.a2", 0x20000, 0x2ab06bda, 4 | BRF_GRA }, // 10 - - /* these are probably shared with extermination except for u35 */ - { "b06-12.pal16l8a.u26.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 11 Pal - { "b06-13.pal16l8a.u25.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 12 - { "st-6.pal16l8a.u35.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 13 // likely has a different name on the proto pcb... - { "b06-101.pal16l8a.u36.jed", 0x01000, 0x00000000, 5 | BRF_OPT | BRF_NODUMP }, // 14 -}; - -STD_ROM_PICK(tnzsop) -STD_ROM_FN(tnzsop) - -struct BurnDriver BurnDrvTnzsop = { - "tnzsop", "tnzs", NULL, NULL, "1988", - "The NewZealand Story (World, prototype) (older PCB)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_PLATFORM, 0, - NULL, tnzsopRomInfo, tnzsopRomName, NULL, NULL, CommonInputInfo, TnzsopDIPInfo, - TnzsoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Kabuki-Z (World) - -static struct BurnRomInfo kabukizRomDesc[] = { - { "b50-05.u1", 0x20000, 0x9cccb129, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b50-08.1e", 0x10000, 0xcb92d34c, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b50-07.u34", 0x20000, 0xbf7fc2ed, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "b50-04.u35", 0x80000, 0x04829aa9, 4 | BRF_GRA }, // 3 Graphics - { "b50-03.u39", 0x80000, 0x31489a4c, 4 | BRF_GRA }, // 4 - { "b50-02.u43", 0x80000, 0x90b8a8e7, 4 | BRF_GRA }, // 5 - { "b50-01.u46", 0x80000, 0xf4277751, 4 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(kabukiz) -STD_ROM_FN(kabukiz) - -struct BurnDriverD BurnDrvKabukiz = { - "kabukiz", NULL, NULL, NULL, "1988", - "Kabuki-Z (World)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, kabukizRomInfo, kabukizRomName, NULL, NULL, CommonInputInfo, KabukizDIPInfo, - Type2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Kabuki-Z (Japan) - -static struct BurnRomInfo kabukizjRomDesc[] = { - { "b50-05.u1", 0x20000, 0x9cccb129, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "b50-06.u3", 0x10000, 0x45650aab, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b50-07.u34", 0x20000, 0xbf7fc2ed, 3 | BRF_PRG | BRF_ESS }, // 2 Z80 #2 Code - - { "b50-04.u35", 0x80000, 0x04829aa9, 4 | BRF_GRA }, // 3 Graphics - { "b50-03.u39", 0x80000, 0x31489a4c, 4 | BRF_GRA }, // 4 - { "b50-02.u43", 0x80000, 0x90b8a8e7, 4 | BRF_GRA }, // 5 - { "b50-01.u46", 0x80000, 0xf4277751, 4 | BRF_GRA }, // 6 -}; - -STD_ROM_PICK(kabukizj) -STD_ROM_FN(kabukizj) - -struct BurnDriverD BurnDrvKabukizj = { - "kabukizj", "kabukiz", NULL, NULL, "1988", - "Kabuki-Z (Japan)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_SCRFIGHT, 0, - NULL, kabukizjRomInfo, kabukizjRomName, NULL, NULL, CommonInputInfo, KabukizjDIPInfo, - Type2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Insector X (World) - -static struct BurnRomInfo insectxRomDesc[] = { - { "b97__03.u32", 0x20000, 0x18eef387, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - /* Label is B97 07* with an asterisk */ - { "b97__07.u38", 0x10000, 0x324b28c9, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b97__01.u1", 0x80000, 0xd00294b1, 4 | BRF_GRA }, // 2 Graphics - { "b97__02.u2", 0x80000, 0xdb5a7434, 4 | BRF_GRA }, // 3 -}; - -STD_ROM_PICK(insectx) -STD_ROM_FN(insectx) - -static INT32 InsectxInit() -{ - return Type1Init(MCU_NONE_INSECTX); -} - -struct BurnDriver BurnDrvInsectx = { - "insectx", NULL, NULL, NULL, "1989", - "Insector X (World)\0", NULL, "Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, insectxRomInfo, insectxRomName, NULL, NULL, InsectxInputInfo, InsectxDIPInfo, - InsectxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Insector X (Japan) - -static struct BurnRomInfo insectxjRomDesc[] = { - { "b97__03.u32", 0x20000, 0x18eef387, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - /* Label is B97 04* with an asterisk */ - { "b97__04.u38", 0x10000, 0xdc4549e5, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "b97__01.u1", 0x80000, 0xd00294b1, 4 | BRF_GRA }, // 2 Graphics - { "b97__02.u2", 0x80000, 0xdb5a7434, 4 | BRF_GRA }, // 3 -}; - -STD_ROM_PICK(insectxj) -STD_ROM_FN(insectxj) - -struct BurnDriver BurnDrvInsectxj = { - "insectxj", "insectx", NULL, NULL, "1989", - "Insector X (Japan)\0", NULL, "Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_HORSHOOT, 0, - NULL, insectxjRomInfo, insectxjRomName, NULL, NULL, InsectxInputInfo, InsectxjDIPInfo, - InsectxInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; - - -// Jumping Pop (Nics, Korean bootleg of Plump Pop) - -static struct BurnRomInfo jpopnicsRomDesc[] = { - { "u96cpu2", 0x20000, 0x649e951c, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - - { "u124cpu1", 0x10000, 0x8453e8e4, 2 | BRF_PRG | BRF_ESS }, // 1 Z80 #1 Code - - { "u94gfx", 0x20000, 0xe49f2fdd, 4 | BRF_GRA }, // 2 Graphics - { "u93gfx", 0x20000, 0xa7791b5b, 4 | BRF_GRA }, // 3 - { "u92gfx", 0x20000, 0xb30caac7, 4 | BRF_GRA }, // 4 - { "u91gfx", 0x20000, 0x18ada5f2, 4 | BRF_GRA }, // 5 -}; - -STD_ROM_PICK(jpopnics) -STD_ROM_FN(jpopnics) - -static INT32 JpopnicsInit() -{ - return Type1Init(MCU_NONE_JPOPNICS); -} - -struct BurnDriver BurnDrvJpopnics = { - "jpopnics", NULL, NULL, NULL, "1992", - "Jumping Pop (Nics, Korean bootleg of Plump Pop)\0", NULL, "Nics", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TAITO_MISC, GBF_BREAKOUT, 0, - NULL, jpopnicsRomInfo, jpopnicsRomName, NULL, NULL, JpopnicsInputInfo, JpopnicsDIPInfo, - JpopnicsInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 256, 224, 4, 3 -}; diff --git a/jan/src/burn/drv/taito/d_wyvernf0.cpp b/jan/src/burn/drv/taito/d_wyvernf0.cpp deleted file mode 100644 index 4cd309fda..000000000 --- a/jan/src/burn/drv/taito/d_wyvernf0.cpp +++ /dev/null @@ -1,756 +0,0 @@ -// FB Alpha Wyvern F-0 driver module -// Based on MAME driver by Luca Elia - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "driver.h" -extern "C" { -#include "ay8910.h" -} -#include "msm5232.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvFgRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvObjRAM; -static UINT8 *DrvZ80RAM1; - -static UINT8 *soundlatch; -static UINT8 *flipscreen; -static UINT8 *coin_lockout; -static UINT8 *scroll; -static UINT8 *pending_nmi; -static UINT8 *nmi_enable; -static UINT8 *DrvZ80ROMBank; -static UINT8 *DrvZ80RAMBank; -static UINT8 *mcu_value; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvJoy5[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvInputs[5]; -static UINT8 DrvReset; - -static struct BurnInputInfo Wyvernf0InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 0, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy2 + 5, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy2 + 4, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 5, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy3 + 3, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 5, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy4 + 5, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy4 + 4, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy4 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy4 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy5 + 5, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy5 + 4, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy5 + 3, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy1 + 3, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Wyvernf0) - -static struct BurnDIPInfo Wyvernf0DIPList[]= -{ - {0x15, 0xff, 0xff, 0x6f, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0xdc, NULL }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x15, 0x01, 0x03, 0x00, "?? 0" }, - {0x15, 0x01, 0x03, 0x01, "?? 1" }, - {0x15, 0x01, 0x03, 0x02, "?? 2" }, - {0x15, 0x01, 0x03, 0x03, "?? 3" }, - - {0 , 0xfe, 0 , 2, "Free Play" }, - {0x15, 0x01, 0x04, 0x04, "Off" }, - {0x15, 0x01, 0x04, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x15, 0x01, 0x18, 0x00, "2" }, - {0x15, 0x01, 0x18, 0x08, "3" }, - {0x15, 0x01, 0x18, 0x10, "4" }, - {0x15, 0x01, 0x18, 0x18, "5" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x40, 0x40, "Off" }, - {0x15, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x80, 0x00, "Upright" }, - {0x15, 0x01, 0x80, 0x80, "Cocktail" }, - - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x16, 0x01, 0x0f, 0x0f, "9 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x0e, "8 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x0d, "7 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x0c, "6 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x0b, "5 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x0a, "4 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x09, "3 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x08, "2 Coins 1 Credits" }, - {0x16, 0x01, 0x0f, 0x00, "1 Coin 1 Credits" }, - {0x16, 0x01, 0x0f, 0x01, "1 Coin 2 Credits" }, - {0x16, 0x01, 0x0f, 0x02, "1 Coin 3 Credits" }, - {0x16, 0x01, 0x0f, 0x03, "1 Coin 4 Credits" }, - {0x16, 0x01, 0x0f, 0x04, "1 Coin 5 Credits" }, - {0x16, 0x01, 0x0f, 0x05, "1 Coin 6 Credits" }, - {0x16, 0x01, 0x0f, 0x06, "1 Coin 7 Credits" }, - {0x16, 0x01, 0x0f, 0x07, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x16, 0x01, 0xf0, 0xf0, "9 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xe0, "8 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xd0, "7 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xc0, "6 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0xa0, "4 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x90, "3 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x80, "2 Coins 1 Credits" }, - {0x16, 0x01, 0xf0, 0x00, "1 Coin 1 Credits" }, - {0x16, 0x01, 0xf0, 0x10, "1 Coin 2 Credits" }, - {0x16, 0x01, 0xf0, 0x20, "1 Coin 3 Credits" }, - {0x16, 0x01, 0xf0, 0x30, "1 Coin 4 Credits" }, - {0x16, 0x01, 0xf0, 0x40, "1 Coin 5 Credits" }, - {0x16, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, - {0x16, 0x01, 0xf0, 0x60, "1 Coin 7 Credits" }, - {0x16, 0x01, 0xf0, 0x70, "1 Coin 8 Credits" }, - - {0 , 0xfe, 0 , 2, "Coinage Display" }, - {0x17, 0x01, 0x10, 0x00, "No" }, - {0x17, 0x01, 0x10, 0x10, "Yes" }, - - {0 , 0xfe, 0 , 2, "Copyright" }, - {0x17, 0x01, 0x20, 0x00, "Taito Corporation" }, - {0x17, 0x01, 0x20, 0x20, "Taito Corp. 1985" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x17, 0x01, 0x40, 0x40, "Off" }, - {0x17, 0x01, 0x40, 0x00, "On" }, - - {0 , 0xfe, 0 , 2, "Coin Slots" }, - {0x17, 0x01, 0x80, 0x00, "1" }, - {0x17, 0x01, 0x80, 0x80, "2" }, -}; - -STDDIPINFO(Wyvernf0) - -static inline void palette_update(INT32 i) -{ - INT32 r = DrvPalRAM[i+0] & 0x0f; - INT32 g = DrvPalRAM[i+1] >> 4; - INT32 b = DrvPalRAM[i+1] & 0x0f; - - DrvPalette[i/2] = BurnHighCol(r | (r << 4), g | (g << 4) ,b | (b << 4), 0); -} - -static void rambankswitch(INT32 data) -{ - INT32 bank = (data & 0x80) ? 0x1000 : 0; - - *DrvZ80RAMBank = data; - - *coin_lockout = (~data & 0x40) ? 0xcf : 0xff; - - *flipscreen = data & 0x03; - - ZetMapMemory(DrvObjRAM + bank, 0x9000, 0x9fff, MAP_RAM); -} - -static void rombankswitch(INT32 data) -{ - INT32 bank = 0x10000 + (data & 0x07) * 0x2000; - - *DrvZ80ROMBank = data; - - ZetMapMemory(DrvZ80ROM0 + bank, 0xa000, 0xbfff, MAP_ROM); -} - -static void __fastcall wyvernf0_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfc00) == 0xd800) { - DrvPalRAM[address & 0x3ff] = data; - palette_update(address & 0x3fe); - return; - } - - switch (address) - { - case 0xd000: - return; // nop - - case 0xd100: - rambankswitch(data); - return; - - case 0xd200: - rombankswitch(data); - return; - - case 0xd300: - case 0xd301: - case 0xd302: - case 0xd303: - scroll[address & 0x03] = data; - return; - - case 0xd400: - *mcu_value = data; - return; - - case 0xd610: - { - *soundlatch = data; - if (*nmi_enable) { - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - } else { - *pending_nmi = 1; - } - } - return; - - case 0xdc00: - return; // nop - } -} - -static UINT8 __fastcall wyvernf0_main_read(UINT16 address) -{ - switch (address) - { - case 0xd400: - return ((*mcu_value & 0x73) == 0x73) ? 0x42: 0; - - case 0xd401: - return 0x03; // mcu status - - case 0xd600: - case 0xd601: - case 0xd602: - return DrvDips[address - 0xd600]; - - case 0xd603: - case 0xd604: - case 0xd605: - case 0xd606: - case 0xd607: - return DrvInputs[address - 0xd603]; - - case 0xd610: - return *soundlatch; - } - - return 0; -} - -static void __fastcall wyvernf0_sound_write(UINT16 address, UINT8 data) -{ - if ((address & 0xfff0) == 0xc900) { - MSM5232Write(address & 0x0f, data); - return; - } - - switch (address) - { - case 0xc800: - case 0xc801: - case 0xc802: - case 0xc803: - AY8910Write((address/2) & 1, address & 1, data); - if (data==0x88) { // end of sound command, turn off all channels to get rid of unwanted high pitched noises - AY8910Write((address/2) & 1, 0, 0x08); - AY8910Write((address/2) & 1, 1, 0x00); - AY8910Write((address/2) & 1, 0, 0x09); - AY8910Write((address/2) & 1, 1, 0x00); - AY8910Write((address/2) & 1, 0, 0x0A); - AY8910Write((address/2) & 1, 1, 0x00); - } - return; - - case 0xd000: - *soundlatch = data; - return; - - case 0xd200: - { - *nmi_enable = 1; - - if (*pending_nmi) - { - ZetNmi(); - *pending_nmi = 0; - } - } - return; - - case 0xd400: - *nmi_enable = 0; - return; - - case 0xd600: - return; // ?? - } -} - -static UINT8 __fastcall wyvernf0_sound_read(UINT16 address) -{ - switch (address) - { - case 0xd000: - return *soundlatch; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - rombankswitch(0); - rambankswitch(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - AY8910Reset(0); - AY8910Reset(1); - - MSM5232Reset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x020000; - DrvZ80ROM1 = Next; Next += 0x010000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x010000; - - DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - - AllRam = Next; - - DrvZ80RAM0 = Next; Next += 0x001000; - DrvFgRAM = Next; Next += 0x000800; - DrvBgRAM = Next; Next += 0x000800; - DrvSprRAM = Next; Next += 0x000100; - DrvPalRAM = Next; Next += 0x000400; - DrvObjRAM = Next; Next += 0x002000; - - DrvZ80RAM1 = Next; Next += 0x000800; - - soundlatch = Next; Next += 0x000001; - flipscreen = Next; Next += 0x000001; - coin_lockout = Next; Next += 0x000001; - pending_nmi = Next; Next += 0x000001; - nmi_enable = Next; Next += 0x000001; - scroll = Next; Next += 0x000004; - DrvZ80ROMBank = Next; Next += 0x000001; - DrvZ80RAMBank = Next; Next += 0x000001; - mcu_value = Next; Next += 0x000001; - - RamEnd = Next; - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; - - return 0; -} - -static void DrvGfxDecode(UINT8 *rom, INT32 len) -{ - INT32 Planes[4] = { RGN_FRAC(len,0,4), RGN_FRAC(len,1,4), RGN_FRAC(len,2,4), RGN_FRAC(len,3,4) }; - INT32 XOffs[8] = { STEP8(7,-1) }; - INT32 YOffs[8] = { STEP8(0,8) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(len); - if (tmp == NULL) { - return; - } - - memcpy (tmp, rom, len); - - GfxDecode(((len/4)*8)/(8*8), 4, 8, 8, Planes, XOffs, YOffs, 0x040, tmp, rom); - - BurnFree(tmp); -} - -static INT32 DrvInit() -{ - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x04000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x14000, 3, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x18000, 4, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x1c000, 5, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 6, 1)) return 1; - memset (DrvZ80ROM1 + 0xe000, 0xff, 0x2000); - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x0c000, 10, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x02000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x04000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x06000, 14, 1)) return 1; - - DrvGfxDecode(DrvGfxROM0, 0x10000); - DrvGfxDecode(DrvGfxROM1, 0x08000); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x8000, 0x8fff, MAP_RAM); - ZetMapMemory(DrvFgRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvBgRAM, 0xc800, 0xcfff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0xd500, 0xd5ff, MAP_RAM); - ZetMapMemory(DrvPalRAM, 0xd800, 0xdbff, MAP_ROM); - ZetSetWriteHandler(wyvernf0_main_write); - ZetSetReadHandler(wyvernf0_main_read); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x3fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvZ80ROM1 + 0xe000, 0xe000, 0xefff, MAP_ROM); - ZetSetWriteHandler(wyvernf0_sound_write); - ZetSetReadHandler(wyvernf0_sound_read); - ZetClose(); - - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.14, BURN_SND_ROUTE_BOTH); - - AY8910Init(1, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(1, 0.14, BURN_SND_ROUTE_BOTH); - - MSM5232Init(2000000, 1); - MSM5232SetCapacitors(0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6); - MSM5232SetRoute(0.50, BURN_SND_MSM5232_ROUTE_0); - MSM5232SetRoute(0.50, BURN_SND_MSM5232_ROUTE_1); - MSM5232SetRoute(0.50, BURN_SND_MSM5232_ROUTE_2); - MSM5232SetRoute(0.50, BURN_SND_MSM5232_ROUTE_3); - MSM5232SetRoute(0.50, BURN_SND_MSM5232_ROUTE_4); - MSM5232SetRoute(0.50, BURN_SND_MSM5232_ROUTE_5); - MSM5232SetRoute(0.50, BURN_SND_MSM5232_ROUTE_6); - MSM5232SetRoute(0.50, BURN_SND_MSM5232_ROUTE_7); - - GenericTilesInit(); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - ZetExit(); - - AY8910Exit(0); - AY8910Exit(1); - - MSM5232Exit(); - - BurnFree(AllMem); - - return 0; -} - -static void draw_layer(UINT8 *ram, INT32 color_offset, UINT8 scrollx, UINT8 scrolly) -{ - for (INT32 offs = 0; offs < 32 * 32; offs++) - { - INT32 sx = (offs & 0x1f) * 8; - INT32 sy = (offs / 0x20) * 8; - - sx -= scrollx; - if (sx < -7) sx += 256; - sy -= scrolly; - if (sy < -7) sy += 256; - - if (sy >= 224) continue; - - INT32 code = ((ram[offs * 2 + 1] & 0x03) << 8) + ram[offs * 2]; - - INT32 color = (code >> 12) & 0x07; - INT32 flipx = (code >> 15) & 0x01; - INT32 flipy = (code >> 14) & 0x01; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code & 0x3ff, sx, sy, color, 4, 0, color_offset, DrvGfxROM1); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code & 0x3ff, sx, sy, color, 4, 0, color_offset, DrvGfxROM1); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code & 0x3ff, sx, sy, color, 4, 0, color_offset, DrvGfxROM1); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code & 0x3ff, sx, sy, color, 4, 0, color_offset, DrvGfxROM1); - } - } - } -} - -static void draw_sprites(INT32 is_foreground) -{ - UINT8 *RAM = DrvSprRAM + (is_foreground ? 0x80 : 0); - - for (INT32 offs = 0; offs < 0x100 / 2; offs += 4) - { - INT32 sx = RAM[offs + 3] - ((RAM[offs + 2] & 0x80) << 1); - INT32 sy = 256 - 8 - RAM[offs + 0] - 23; - - INT32 flipx = RAM[offs + 2] & 0x40; - INT32 flipy = RAM[offs + 1] & 0x80; - - if (*flipscreen & 0x01) - { - flipx = !flipx; - sx = 256 - 8 - sx - 3 * 8; - } - if (*flipscreen & 0x02) - { - flipy = !flipy; - sy = 256 - 8 - sy - 3 * 8; - } - - INT32 code = (RAM[offs + 1] & 0x7f) + (is_foreground ? 0x80 : 0); - INT32 color = (RAM[offs + 2] & 0x0f) + (is_foreground ? 0x10 : 0); - - for (INT32 y = 0; y < 4; y++) - { - for (INT32 x = 0; x < 4; x++) - { - INT32 objoffs = code * 0x20 + (x + y * 4) * 2; - - INT32 sxx = sx + (flipx ? 3-x : x) * 8; - INT32 syy = sy + (flipy ? 3-y : y) * 8; - - INT32 code1 = ((DrvObjRAM[objoffs + 1] & 0x07) << 8) + DrvObjRAM[objoffs]; - - if (flipy) { - if (flipx) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code1, sxx, syy - 16, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, code1, sxx, syy - 16, color, 4, 0, 0, DrvGfxROM0); - } - } else { - if (flipx) { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, code1, sxx, syy - 16, color, 4, 0, 0, DrvGfxROM0); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code1, sxx, syy - 16, color, 4, 0, 0, DrvGfxROM0); - } - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - for (INT32 i = 0; i < 0x400; i+=2) { - palette_update(i); - } - DrvRecalc = 0; - } - - BurnTransferClear(); - - draw_layer(DrvBgRAM, 0x00, scroll[2] - 0x12, scroll[3] + 0x10); - draw_sprites(0); - draw_sprites(1); - draw_layer(DrvFgRAM, 0x80, scroll[0] - 0x10, scroll[1] + 0x10); - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - { - memset (DrvInputs, 0, 5); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; - } - - DrvInputs[0] = (DrvInputs[0] & *coin_lockout);// | 0xc0; - } - - INT32 nInterleave = 10; - INT32 nCyclesTotal[2] = { 6000000 / 60, 4000000 / 60 }; - INT32 nCyclesDone[2] = { 0 , 0 }; - - for (INT32 i = 0; i < nInterleave; i++) - { - ZetOpen(0); - INT32 nSegment = nCyclesTotal[0] / nInterleave; - nCyclesDone[0] += ZetRun(nSegment); - if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - - ZetOpen(1); - nSegment = nCyclesTotal[1] / nInterleave; - nCyclesDone[1] += ZetRun(nSegment); - if (i == (nInterleave - 1) || i == (nInterleave / 2) - 1) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO); - ZetClose(); - } - - if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); - MSM5232Update(pBurnSoundOut, nBurnSoundLen); - } - - if (pBurnDraw) { - DrvDraw(); - } - - return 0; -} - -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); - - AY8910Scan(nAction, pnMin); - MSM5232Scan(nAction, pnMin); - } - - if (nAction & ACB_WRITE) { - ZetOpen(0); - rambankswitch(*DrvZ80RAMBank); - rombankswitch(*DrvZ80ROMBank); - ZetClose(); - - DrvRecalc = 1; - } - - return 0; -} - - -// Wyvern F-0 - -static struct BurnRomInfo wyvernf0RomDesc[] = { - { "a39_01-1.ic37", 0x4000, 0xa94887ec, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code - { "a39_02-1.ic36", 0x4000, 0x171cfdbe, 1 | BRF_PRG | BRF_ESS }, // 1 - { "a39_03.ic35", 0x4000, 0x50314281, 1 | BRF_PRG | BRF_ESS }, // 2 - { "a39_04.ic34", 0x4000, 0x7a225bf9, 1 | BRF_PRG | BRF_ESS }, // 3 - { "a39_05.ic33", 0x4000, 0x41f21a67, 1 | BRF_PRG | BRF_ESS }, // 4 - { "a39_06.ic32", 0x4000, 0xdeb2d850, 1 | BRF_PRG | BRF_ESS }, // 5 - - { "a39_16.ic26", 0x4000, 0x5a681fb4, 2 | BRF_PRG | BRF_ESS }, // 6 Z80 #0 Code - - { "a39_11.ic99", 0x4000, 0xaf70e1dc, 3 | BRF_GRA }, // 7 Sprites - { "a39_10.ic78", 0x4000, 0xa84380fb, 3 | BRF_GRA }, // 8 - { "a39_09.ic96", 0x4000, 0xc0cee243, 3 | BRF_GRA }, // 9 - { "a39_08.ic75", 0x4000, 0x0ad69501, 3 | BRF_GRA }, // 10 - - { "a39_14.ic99", 0x2000, 0x90a66147, 4 | BRF_GRA }, // 11 Tiles - { "a39_14.ic73", 0x2000, 0xa31f3507, 4 | BRF_GRA }, // 12 - { "a39_13.ic100", 0x2000, 0xbe708238, 4 | BRF_GRA }, // 13 - { "a39_12.ic74", 0x2000, 0x1cc389de, 4 | BRF_GRA }, // 14 - - { "a39_mcu.icxx", 0x0800, 0x00000000, 4 | BRF_OPT | BRF_PRG | BRF_NODUMP }, // 15 MCU Code (not dumped) -}; - -STD_ROM_PICK(wyvernf0) -STD_ROM_FN(wyvernf0) - -struct BurnDriver BurnDrvWyvernf0 = { - "wyvernf0", NULL, NULL, NULL, "1985", - "Wyvern F-0\0", NULL, "Taito", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TAITO_MISC, GBF_VERSHOOT, 0, - NULL, wyvernf0RomInfo, wyvernf0RomName, NULL, NULL, Wyvernf0InputInfo, Wyvernf0DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200, - 224, 256, 3, 4 -}; diff --git a/jan/src/burn/drv/taito/pc080sn.cpp b/jan/src/burn/drv/taito/pc080sn.cpp deleted file mode 100644 index 41dc4323e..000000000 --- a/jan/src/burn/drv/taito/pc080sn.cpp +++ /dev/null @@ -1,1027 +0,0 @@ -// PC080SN -// Based on MAME sources by Nicola Salmoria - -#include "tiles_generic.h" -#include "taito_ic.h" - -UINT8 *PC080SNRam[PC080SN_MAX_CHIPS] = { NULL, NULL }; -static UINT16 PC080SNCtrl[PC080SN_MAX_CHIPS][8]; -static INT32 BgScrollX[PC080SN_MAX_CHIPS]; -static INT32 BgScrollY[PC080SN_MAX_CHIPS]; -static INT32 FgScrollX[PC080SN_MAX_CHIPS]; -static INT32 FgScrollY[PC080SN_MAX_CHIPS]; -static INT32 PC080SNNumTiles[PC080SN_MAX_CHIPS]; -static INT32 PC080SNXOffset[PC080SN_MAX_CHIPS]; -static INT32 PC080SNYOffset[PC080SN_MAX_CHIPS]; -static INT32 PC080SNFgTransparentPen[PC080SN_MAX_CHIPS]; -static INT32 PC080SNYInvert[PC080SN_MAX_CHIPS]; -static INT32 PC080SNDblWidth[PC080SN_MAX_CHIPS]; -static INT32 PC080SNCols[PC080SN_MAX_CHIPS]; -static INT32 PC080SNNum = 0; - -void PC080SNDrawBgLayer(INT32 Chip, INT32 Opaque, UINT8 *pSrc, UINT16 *pDest) -{ - INT32 mx, my, Offset, Attr, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)PC080SNRam[Chip] + 0x0000; - UINT16 *BgScrollRam = NULL; - - if (!PC080SNDblWidth[Chip]) BgScrollRam = (UINT16*)PC080SNRam[Chip] + 0x2000; - - INT32 BgScrollActive = 0; - if (BgScrollRam) { - for (INT32 i = 0; i < 512; i++) { - if (BURN_ENDIAN_SWAP_INT16(BgScrollRam[i])) { - BgScrollActive = 1; - break; - } - } - } - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < PC080SNCols[Chip]; mx++) { - Offset = 2 * TileIndex; - if (!PC080SNDblWidth[Chip]) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 0]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & (PC080SNNumTiles[Chip] - 1); - } else { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x0000]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x2000]) & 0x3fff; - } - Colour = Attr & 0x1ff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - x -= 16; - - x -= PC080SNXOffset[Chip]; - y -= PC080SNYOffset[Chip]; - - if (BgScrollActive) { - INT32 px, py; - - UINT32 nPalette = (Colour << 4); - - for (py = 0; py < 8; py++) { - for (px = 0; px < 8; px++) { - UINT8 c = pSrc[(Code * 64) + (py * 8) + px]; - if (xFlip) c = pSrc[(Code * 64) + (py * 8) + (7 - px)]; - if (yFlip) c = pSrc[(Code * 64) + ((7 - py) * 8) + px]; - if (xFlip && yFlip) c = pSrc[(Code * 64) + ((7 - py) * 8) + (7 - px)]; - - if (c || Opaque) { - INT32 xPos = x + px; - INT32 yPos = y + py; - yPos -= BgScrollY[Chip] & 0x1ff; - - if (yPos < -8) yPos += 512; - if (yPos >= 512) yPos -= 512; - - if (yPos >= 0 && yPos < nScreenHeight) { - if (!PC080SNDblWidth[Chip]) { - xPos -= ((BgScrollX[Chip] - BURN_ENDIAN_SWAP_INT16(BgScrollRam[yPos + PC080SNYOffset[Chip]])) & 0x1ff); - if (xPos < -8) xPos += 512; - if (xPos >= 512) xPos -= 512; - } else { - xPos -= BgScrollX[Chip] & 0x3ff; - if (xPos < -8) xPos += 1024; - if (xPos >= 1024) xPos -= 1024; - } - - UINT16* pPixel = pDest + (yPos * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette; - } - } - } - } - } - } else { - if (!PC080SNDblWidth[Chip]) { - x -= BgScrollX[Chip] & 0x1ff; - if (x < -8) x += 512; - if (x >= 512) x -= 512; - } else { - x -= BgScrollX[Chip] & 0x3ff; - if (x < -8) x += 1024; - if (x >= 1024) x -= 1024; - } - - y -= BgScrollY[Chip] & 0x1ff; - if (y < -8) y += 512; - if (y >= 512) y -= 512; - - if (Opaque) { - if (x > 8 && x < (nScreenWidth - 8) && y > 8 && y < (nScreenHeight - 8)) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_FlipXY(pDest, Code, x , y, Colour, 4, 0, pSrc); - } else { - Render8x8Tile_FlipX(pDest, Code, x , y, Colour, 4, 0, pSrc); - } - } else { - if (yFlip) { - Render8x8Tile_FlipY(pDest, Code, x , y, Colour, 4, 0, pSrc); - } else { - Render8x8Tile(pDest, Code, x , y, Colour, 4, 0, pSrc); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_FlipXY_Clip(pDest, Code, x , y, Colour, 4, 0, pSrc); - } else { - Render8x8Tile_FlipX_Clip(pDest, Code, x , y, Colour, 4, 0, pSrc); - } - } else { - if (yFlip) { - Render8x8Tile_FlipY_Clip(pDest, Code, x , y, Colour, 4, 0, pSrc); - } else { - Render8x8Tile_Clip(pDest, Code, x , y, Colour, 4, 0, pSrc); - } - } - } - } else { - if (x > 8 && x < (nScreenWidth - 8) && y > 8 && y < (nScreenHeight - 8)) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } else { - Render8x8Tile_Mask_FlipX(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } else { - Render8x8Tile_Mask(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } else { - Render8x8Tile_Mask_FlipX_Clip(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } else { - Render8x8Tile_Mask_Clip(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } - } - } - } - } - - TileIndex++; - } - } -} - -void PC080SNDrawFgLayer(INT32 Chip, INT32 Opaque, UINT8 *pSrc, UINT16 *pDest) -{ - INT32 mx, my, Offset, Attr, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)PC080SNRam[Chip] + 0x4000; - UINT16 *FgScrollRam = NULL; - - if (!PC080SNDblWidth[Chip]) FgScrollRam = (UINT16*)PC080SNRam[Chip] + 0x6000; - - INT32 FgScrollActive = 0; - if (FgScrollRam) { - for (INT32 i = 0; i < 512; i++) { - if (BURN_ENDIAN_SWAP_INT16(FgScrollRam[i])) { - FgScrollActive = 1; - break; - } - } - } - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < PC080SNCols[Chip]; mx++) { - Offset = 2 * TileIndex; - if (!PC080SNDblWidth[Chip]) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 0]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & (PC080SNNumTiles[Chip] - 1); - } else { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x0000]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x2000]) & 0x3fff; - } - Colour = Attr & 0x1ff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - x -= 16; - - x -= PC080SNXOffset[Chip]; - y -= PC080SNYOffset[Chip]; - - if (FgScrollActive) { - INT32 px, py; - - UINT32 nPalette = (Colour << 4); - - for (py = 0; py < 8; py++) { - for (px = 0; px < 8; px++) { - UINT8 c = pSrc[(Code * 64) + (py * 8) + px]; - if (xFlip) c = pSrc[(Code * 64) + (py * 8) + (7 - px)]; - if (yFlip) c = pSrc[(Code * 64) + ((7 - py) * 8) + px]; - if (xFlip && yFlip) c = pSrc[(Code * 64) + ((7 - py) * 8) + (7 - px)]; - - if (c != PC080SNFgTransparentPen[Chip] || Opaque) { - INT32 xPos = x + px; - INT32 yPos = y + py; - yPos -= FgScrollY[Chip] & 0x1ff; - - if (yPos < -8) yPos += 512; - if (yPos >= 512) yPos -= 512; - - if (yPos >= 0 && yPos < nScreenHeight) { - if (!PC080SNDblWidth[Chip]) { - xPos -= ((FgScrollX[Chip] - BURN_ENDIAN_SWAP_INT16(FgScrollRam[yPos + PC080SNYOffset[Chip]])) & 0x1ff); - if (xPos < -8) xPos += 512; - if (xPos >= 512) xPos -= 512; - } else { - xPos -= FgScrollX[Chip] & 0x3ff; - if (xPos < -8) xPos += 1024; - if (xPos >= 1024) xPos -= 1024; - } - - UINT16* pPixel = pDest + (yPos * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette; - } - } - } - } - } - } else { - if (!PC080SNDblWidth[Chip]) { - x -= FgScrollX[Chip] & 0x1ff; - if (x < -8) x += 512; - if (x >= 512) x -= 512; - } else { - x -= FgScrollX[Chip] & 0x3ff; - if (x < -8) x += 1024; - if (x >= 1024) x -= 1024; - } - - y -= FgScrollY[Chip] & 0x1ff; - if (y < -8) y += 512; - if (y >= 512) y -= 512; - - if (Opaque) { - if (x > 8 && x < (nScreenWidth - 8) && y > 8 && y < (nScreenHeight - 8)) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_FlipXY(pDest, Code, x , y, Colour, 4, 0, pSrc); - } else { - Render8x8Tile_FlipX(pDest, Code, x , y, Colour, 4, 0, pSrc); - } - } else { - if (yFlip) { - Render8x8Tile_FlipY(pDest, Code, x , y, Colour, 4, 0, pSrc); - } else { - Render8x8Tile(pDest, Code, x , y, Colour, 4, 0, pSrc); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_FlipXY_Clip(pDest, Code, x , y, Colour, 4, 0, pSrc); - } else { - Render8x8Tile_FlipX_Clip(pDest, Code, x , y, Colour, 4, 0, pSrc); - } - } else { - if (yFlip) { - Render8x8Tile_FlipY_Clip(pDest, Code, x , y, Colour, 4, 0, pSrc); - } else { - Render8x8Tile_Clip(pDest, Code, x , y, Colour, 4, 0, pSrc); - } - } - } - } else { - if (x > 8 && x < (nScreenWidth - 8) && y > 8 && y < (nScreenHeight - 8)) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pDest, Code, x , y, Colour, 4, PC080SNFgTransparentPen[Chip], 0, pSrc); - } else { - Render8x8Tile_Mask_FlipX(pDest, Code, x , y, Colour, 4, PC080SNFgTransparentPen[Chip], 0, pSrc); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pDest, Code, x , y, Colour, 4, PC080SNFgTransparentPen[Chip], 0, pSrc); - } else { - Render8x8Tile_Mask(pDest, Code, x , y, Colour, 4, PC080SNFgTransparentPen[Chip], 0, pSrc); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pDest, Code, x , y, Colour, 4, PC080SNFgTransparentPen[Chip], 0, pSrc); - } else { - Render8x8Tile_Mask_FlipX_Clip(pDest, Code, x , y, Colour, 4, PC080SNFgTransparentPen[Chip], 0, pSrc); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pDest, Code, x , y, Colour, 4, PC080SNFgTransparentPen[Chip], 0, pSrc); - } else { - Render8x8Tile_Mask_Clip(pDest, Code, x , y, Colour, 4, PC080SNFgTransparentPen[Chip], 0, pSrc); - } - } - } - } - } - - TileIndex++; - } - } -} - -void PC080SNDrawBgLayerPrio(INT32 Chip, INT32 Opaque, UINT8 *pSrc, UINT16 *pDest, UINT16 *PriBuf, UINT16 Prio) -{ - INT32 mx, my, Offset, Attr, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)PC080SNRam[Chip] + 0x0000; - UINT16 *BgScrollRam = NULL; - - if (!PC080SNDblWidth[Chip]) BgScrollRam = (UINT16*)PC080SNRam[Chip] + 0x2000; - - INT32 BgScrollActive = 1; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < PC080SNCols[Chip]; mx++) { - Offset = 2 * TileIndex; - if (!PC080SNDblWidth[Chip]) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 0]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & (PC080SNNumTiles[Chip] - 1); - } else { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x0000]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x2000]) & 0x3fff; - } - Colour = Attr & 0x1ff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - x -= 16; - - x -= PC080SNXOffset[Chip]; - y -= PC080SNYOffset[Chip]; - - if (BgScrollActive) { - INT32 px, py; - - UINT32 nPalette = (Colour << 4); - - for (py = 0; py < 8; py++) { - for (px = 0; px < 8; px++) { - UINT8 c = pSrc[(Code * 64) + (py * 8) + px]; - if (xFlip) c = pSrc[(Code * 64) + (py * 8) + (7 - px)]; - if (yFlip) c = pSrc[(Code * 64) + ((7 - py) * 8) + px]; - if (xFlip && yFlip) c = pSrc[(Code * 64) + ((7 - py) * 8) + (7 - px)]; - - if (c || Opaque) { - INT32 xPos = x + px; - INT32 yPos = y + py; - yPos -= BgScrollY[Chip] & 0x1ff; - - if (yPos < -8) yPos += 512; - if (yPos >= 512) yPos -= 512; - - if (yPos >= 0 && yPos < nScreenHeight) { - if (!PC080SNDblWidth[Chip]) { - xPos -= ((BgScrollX[Chip] - BURN_ENDIAN_SWAP_INT16(BgScrollRam[yPos + PC080SNYOffset[Chip]])) & 0x1ff); - if (xPos < -8) xPos += 512; - if (xPos >= 512) xPos -= 512; - } else { - xPos -= BgScrollX[Chip] & 0x3ff; - if (xPos < -8) xPos += 1024; - if (xPos >= 1024) xPos -= 1024; - } - - UINT16* pPixel = pDest + (yPos * nScreenWidth); - UINT16* pri = PriBuf + (yPos * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette; - pri[xPos] = Prio; - - } - } - } - } - } - } - - TileIndex++; - } - } -} - -void PC080SNDrawFgLayerPrio(INT32 Chip, INT32 Opaque, UINT8 *pSrc, UINT16 *pDest, UINT16 *PriBuf, UINT16 Prio) -{ - INT32 mx, my, Offset, Attr, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)PC080SNRam[Chip] + 0x4000; - UINT16 *FgScrollRam = NULL; - - if (!PC080SNDblWidth[Chip]) FgScrollRam = (UINT16*)PC080SNRam[Chip] + 0x6000; - - INT32 FgScrollActive = 1; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < PC080SNCols[Chip]; mx++) { - Offset = 2 * TileIndex; - if (!PC080SNDblWidth[Chip]) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 0]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & (PC080SNNumTiles[Chip] - 1); - } else { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x0000]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x2000]) & 0x3fff; - } - Colour = Attr & 0x1ff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - x -= 16; - - x -= PC080SNXOffset[Chip]; - y -= PC080SNYOffset[Chip]; - - if (FgScrollActive) { - INT32 px, py; - - UINT32 nPalette = (Colour << 4); - - for (py = 0; py < 8; py++) { - for (px = 0; px < 8; px++) { - UINT8 c = pSrc[(Code * 64) + (py * 8) + px]; - if (xFlip) c = pSrc[(Code * 64) + (py * 8) + (7 - px)]; - if (yFlip) c = pSrc[(Code * 64) + ((7 - py) * 8) + px]; - if (xFlip && yFlip) c = pSrc[(Code * 64) + ((7 - py) * 8) + (7 - px)]; - - if (c != PC080SNFgTransparentPen[Chip] || Opaque) { - INT32 xPos = x + px; - INT32 yPos = y + py; - yPos -= FgScrollY[Chip] & 0x1ff; - - if (yPos < -8) yPos += 512; - if (yPos >= 512) yPos -= 512; - - if (yPos >= 0 && yPos < nScreenHeight) { - if (!PC080SNDblWidth[Chip]) { - xPos -= ((FgScrollX[Chip] - BURN_ENDIAN_SWAP_INT16(FgScrollRam[yPos + PC080SNYOffset[Chip]])) & 0x1ff); - if (xPos < -8) xPos += 512; - if (xPos >= 512) xPos -= 512; - } else { - xPos -= FgScrollX[Chip] & 0x3ff; - if (xPos < -8) xPos += 1024; - if (xPos >= 1024) xPos -= 1024; - } - - UINT16* pPixel = pDest + (yPos * nScreenWidth); - UINT16* pri = PriBuf + (yPos * nScreenWidth); - - if (xPos >= 0 && xPos < nScreenWidth) { - pPixel[xPos] = c | nPalette; - pri[xPos] = Prio; - } - } - } - } - } - } - - TileIndex++; - } - } -} - -void PC080SNSetScrollX(INT32 Chip, UINT32 Offset, UINT16 Data) -{ - PC080SNCtrl[Chip][Offset] = Data; - - switch (Offset) { - case 0: { - BgScrollX[Chip] = -Data; - break; - } - - case 1: { - FgScrollX[Chip] = -Data; - break; - } - } -} - -void PC080SNSetScrollY(INT32 Chip, UINT32 Offset, UINT16 Data) -{ - PC080SNCtrl[Chip][Offset + 2] = Data; - - if (PC080SNYInvert[Chip]) Data = -Data; - - switch (Offset) { - case 0: { - BgScrollY[Chip] = -Data; - break; - } - - case 1: { - FgScrollY[Chip] = -Data; - break; - } - } -} - -void PC080SNCtrlWrite(INT32 Chip, UINT32 Offset, UINT16 Data) -{ - PC080SNCtrl[Chip][Offset + 4] = Data; - - switch (Offset) { - case 0: { - if (Data & 1) bprintf(PRINT_NORMAL, _T("PC080SN Flipped\n")); - return; - } - } -} - -void PC080SNOverrideFgScroll(INT32 Chip, INT32 xScroll, INT32 yScroll) -{ - FgScrollX[Chip] = xScroll; - FgScrollY[Chip] = yScroll; -} - -void PC080SNReset() -{ - for (INT32 i = 0; i < PC080SNNum; i++) { - memset(PC080SNCtrl[i], 0, 8 * sizeof(UINT16)); - BgScrollX[i] = 0; - BgScrollY[i] = 0; - FgScrollX[i] = 0; - FgScrollY[i] = 0; - } -} - -void PC080SNInit(INT32 Chip, INT32 nNumTiles, INT32 xOffset, INT32 yOffset, INT32 yInvert, INT32 DblWidth) -{ - PC080SNRam[Chip] = (UINT8*)BurnMalloc(0x10000); - memset(PC080SNRam[Chip], 0, 0x10000); - - PC080SNNumTiles[Chip] = nNumTiles; - - PC080SNXOffset[Chip] = xOffset; - PC080SNYOffset[Chip] = yOffset; - - PC080SNFgTransparentPen[Chip] = 0; - PC080SNYInvert[Chip] = yInvert; - - TaitoIC_PC080SNInUse = 1; - - PC080SNCols[Chip] = 64; - if (DblWidth) PC080SNCols[Chip] = 128; - - PC080SNDblWidth[Chip] = DblWidth; - PC080SNNum++; -} - -void PC080SNSetFgTransparentPen(INT32 Chip, INT32 Pen) -{ - PC080SNFgTransparentPen[Chip] = Pen; -} - -void PC080SNExit() -{ - for (INT32 i = 0; i < PC080SNNum; i++) { - BurnFree(PC080SNRam[i]); - - memset(PC080SNCtrl[i], 0, 8 * sizeof(UINT16)); - BgScrollX[i] = 0; - BgScrollY[i] = 0; - FgScrollX[i] = 0; - FgScrollY[i] = 0; - - PC080SNNumTiles[i] = 0; - PC080SNXOffset[i] = 0; - PC080SNYOffset[i] = 0; - PC080SNFgTransparentPen[i] = 0; - PC080SNYInvert[i] = 0; - PC080SNDblWidth[i] = 0; - PC080SNCols[i] = 0; - } - - PC080SNNum = 0; -} - -void PC080SNScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - for (INT32 i = 0; i < PC080SNNum; i++) { - memset(&ba, 0, sizeof(ba)); - ba.Data = PC080SNRam[i]; - ba.nLen = 0x10000; - ba.szName = "PC080SN Ram"; - BurnAcb(&ba); - } - } - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i < PC080SNNum; i++) { - SCAN_VAR(PC080SNCtrl[i]); - SCAN_VAR(BgScrollX[i]); - SCAN_VAR(BgScrollY[i]); - SCAN_VAR(FgScrollX[i]); - SCAN_VAR(FgScrollY[i]); - } - } -} - -// Top Speed Custom support - -#define PLOTPIXEL_MASK(x, mc, po) if (pTileData[x] != mc) {pPixel[x] = nPalette | pTileData[x] | po;} -#define PLOTPIXEL_MASK_FLIPX(x, a, mc, po) if (pTileData[a] != mc) {pPixel[x] = nPalette | pTileData[a] | po;} - -static void RenderTile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * 512) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += 512, pTileData += 8) { - PLOTPIXEL_MASK( 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 7, nMaskColour, nPaletteOffset); - } -} - -static void RenderTile_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * 512) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += 512, pTileData += 8) { - PLOTPIXEL_MASK_FLIPX( 7, 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 6, 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 5, 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 4, 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 3, 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 2, 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 1, 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 0, 7, nMaskColour, nPaletteOffset); - } -} - -static void RenderTile_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * 512) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= 512, pTileData += 8) { - PLOTPIXEL_MASK( 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 7, nMaskColour, nPaletteOffset); - } -} - -static void RenderTile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * 512) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= 512, pTileData += 8) { - PLOTPIXEL_MASK_FLIPX( 7, 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 6, 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 5, 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 4, 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 3, 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 2, 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 1, 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 0, 7, nMaskColour, nPaletteOffset); - } -} - -#undef PLOTPIXEL_MASK -#undef PLOTPIXEL_MASK_FLIPX - -void TopspeedPC080SNDrawBgLayer(INT32 Chip, UINT8 *pSrc, UINT16 *pDest) -{ - INT32 mx, my, Offset, Attr, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)PC080SNRam[Chip] + 0x0000; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < PC080SNCols[Chip]; mx++) { - Offset = 2 * TileIndex; - if (!PC080SNDblWidth[Chip]) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 0]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & (PC080SNNumTiles[Chip] - 1); - } else { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x0000]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x2000]) & 0x3fff; - } - Colour = Attr & 0x1ff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - if (xFlip) { - if (yFlip) { - RenderTile_Mask_FlipXY(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } else { - RenderTile_Mask_FlipX(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } - } else { - if (yFlip) { - RenderTile_Mask_FlipY(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } else { - RenderTile_Mask(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } - } - - TileIndex++; - } - } -} - -void TopspeedPC080SNDrawFgLayer(INT32 Chip, UINT8 *pSrc, UINT16 *pDest) -{ - INT32 mx, my, Offset, Attr, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)PC080SNRam[Chip] + 0x4000; - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < PC080SNCols[Chip]; mx++) { - Offset = 2 * TileIndex; - if (!PC080SNDblWidth[Chip]) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 0]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & (PC080SNNumTiles[Chip] - 1); - } else { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x0000]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex + 0x2000]) & 0x3fff; - } - Colour = Attr & 0x1ff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - if (xFlip) { - if (yFlip) { - RenderTile_Mask_FlipXY(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } else { - RenderTile_Mask_FlipX(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } - } else { - if (yFlip) { - RenderTile_Mask_FlipY(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } else { - RenderTile_Mask(pDest, Code, x , y, Colour, 4, 0, 0, pSrc); - } - } - - TileIndex++; - } - } -} - -static inline void DrawScanLine(INT32 y, const UINT16 *src, INT32 Transparent, UINT16 *PriBuf, UINT16 Prio) -{ - UINT16* pPixel; - INT32 Length; - - pPixel = pTransDraw + (y * nScreenWidth); - UINT16 *pPrio = PriBuf + (y * nScreenWidth); - Length = nScreenWidth; - - if (Transparent) { - while (Length--) { - UINT16 sPixel = *src++; - if (sPixel < 0x7fff) { - *pPixel = sPixel; - *pPrio = Prio; - } - pPixel++; - pPrio++; - } - } else { - while (Length--) { - *pPixel++ = *src++; - *pPrio++ = Prio; - } - } -} - -static UINT16 TopspeedGetRoadPixelColour(UINT16 Pixel, UINT16 Colour) -{ - UINT16 RoadBodyColour, OffRoadColour, PixelType; - - PixelType = (Pixel % 0x10); - RoadBodyColour = (Pixel & 0x7ff0) + 4; - OffRoadColour = RoadBodyColour + 1; - - if ((Colour & 0xffe0) == 0xffe0) { - Pixel += 10; - RoadBodyColour += 10; - OffRoadColour += 10; - } else { - if (Colour & 0x10) RoadBodyColour += 5; - if (Colour & 0x02) OffRoadColour += 5; - } - - switch (PixelType) { - case 0x01: { - if (Colour & 0x08) Pixel = RoadBodyColour; - break; - } - - case 0x02: { - if (Colour & 0x08) Pixel = RoadBodyColour; - break; - } - - case 0x03: { - if (Colour & 0x04) Pixel = RoadBodyColour; - break; - } - - case 0x04: { - Pixel = RoadBodyColour; - break; - } - - case 0x05: { - Pixel = OffRoadColour; - break; - } - } - - return Pixel; -} - -void TopspeedDrawBgLayer(INT32 Chip, UINT8 *pSrc, UINT16 *pDest, UINT16 *ColourCtrlRam, UINT16 *PriBuf, UINT16 Prio) -{ - memset(pDest, 0, 512 * 512 * sizeof(UINT16)); - TopspeedPC080SNDrawBgLayer(Chip, pSrc, pDest); - - UINT16 *BgScrollRam = NULL; - - if (!PC080SNDblWidth[Chip]) BgScrollRam = (UINT16*)PC080SNRam[Chip] + 0x2000; - - UINT16 *Dst16, *Src16; - UINT16 ScanLine[512]; - - UINT16 a, Colour; - INT32 sx, xIndex; - INT32 i, y, yIndex, ySrcIndex, RowIndex; - - INT32 min_x = 0; - INT32 max_x = nScreenWidth - 1; - INT32 min_y = 0; - INT32 max_y = nScreenHeight - 1; - INT32 ScreenWidth = max_x - min_x + 1; - INT32 WidthMask = 0x1ff; - - sx = (BgScrollX[Chip] & 0x1ff) + 16 - PC080SNXOffset[Chip]; - yIndex = (BgScrollY[Chip] & 0x1ff) + min_y + PC080SNYOffset[Chip]; - - y = min_y; - - do { - ySrcIndex = yIndex & 0x1ff; - RowIndex = (ySrcIndex - (BgScrollY[Chip] & 0x1ff)) & 0x1ff; - Colour = ColourCtrlRam[(RowIndex + PC080SNYOffset[Chip] - 2) & 0xff]; - - if (!PC080SNDblWidth[Chip]) { - xIndex = sx - (BURN_ENDIAN_SWAP_INT16(BgScrollRam[RowIndex]) & 0x1ff); - } else { - xIndex = sx; - } - - Src16 = pDest + (ySrcIndex * 512); - Dst16 = ScanLine; - - for (i = 0; i < ScreenWidth; i++) { - if ((Src16[xIndex & WidthMask] & 0x0f) != 0) { - a = Src16[xIndex & WidthMask]; - a = TopspeedGetRoadPixelColour(a, Colour); - - *Dst16++ = a; - } else { - *Dst16++ = 0x8000; - } - - xIndex++; - } - - DrawScanLine(y, ScanLine, 1, PriBuf, Prio); - - yIndex++; - y++; - } - while (y <= max_y); -} - -void TopspeedDrawFgLayer(INT32 Chip, UINT8 *pSrc, UINT16 *pDest, UINT16 *ColourCtrlRam, UINT16 *PriBuf, UINT16 Prio) -{ - memset(pDest, 0, 512 * 512 * sizeof(UINT16)); - TopspeedPC080SNDrawFgLayer(Chip, pSrc, pDest); - - UINT16 *FgScrollRam = NULL; - - if (!PC080SNDblWidth[Chip]) FgScrollRam = (UINT16*)PC080SNRam[Chip] + 0x6000; - - UINT16 *Dst16, *Src16; - UINT16 ScanLine[512]; - - UINT16 a, Colour; - INT32 sx, xIndex; - INT32 i, y, yIndex, ySrcIndex, RowIndex; - - INT32 min_x = 0; - INT32 max_x = nScreenWidth - 1; - INT32 min_y = 0; - INT32 max_y = nScreenHeight - 1; - INT32 ScreenWidth = max_x - min_x + 1; - INT32 WidthMask = 0x1ff; - - sx = (FgScrollX[Chip] & 0x1ff) + 16 - PC080SNXOffset[Chip]; - yIndex = (FgScrollY[Chip] & 0x1ff) + min_y + PC080SNYOffset[Chip]; - - y = min_y; - - do { - ySrcIndex = yIndex & 0x1ff; - RowIndex = (ySrcIndex - (FgScrollY[Chip] & 0x1ff)) & 0x1ff; - Colour = ColourCtrlRam[(RowIndex + PC080SNYOffset[Chip] - 2) & 0xff]; - - if (!PC080SNDblWidth[Chip]) { - xIndex = sx - (BURN_ENDIAN_SWAP_INT16(FgScrollRam[RowIndex]) & 0x1ff); - } else { - xIndex = sx; - } - - Src16 = pDest + (ySrcIndex * 512); - Dst16 = ScanLine; - - for (i = 0; i < ScreenWidth; i++) { - if ((Src16[xIndex & WidthMask] & 0x0f) != 0) { - a = Src16[xIndex & WidthMask]; - a = TopspeedGetRoadPixelColour(a, Colour); - - *Dst16++ = a; - } else { - *Dst16++ = 0x8000; - } - - xIndex++; - } - - DrawScanLine(y, ScanLine, 1, PriBuf, Prio); - - yIndex++; - y++; - } - while (y <= max_y); -} diff --git a/jan/src/burn/drv/taito/pc090oj.cpp b/jan/src/burn/drv/taito/pc090oj.cpp deleted file mode 100644 index 2337a7b87..000000000 --- a/jan/src/burn/drv/taito/pc090oj.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// PC090OJ -// Based on MAME sources by Nicola Salmoria - -#include "tiles_generic.h" -#include "taito_ic.h" - -UINT8 *PC090OJRam = NULL; -static INT32 PC090OJNumTiles; -static INT32 PC090OJXOffset; -static INT32 PC090OJYOffset; -static INT32 PC090OJUseBuffer; -static INT32 PC090OJPaletteOffset; -INT32 PC090OJSpriteCtrl; - -void PC090OJDrawSprites(UINT8 *pSrc) -{ - UINT16 *VideoRam = (UINT16*)PC090OJRam; - - INT32 PC090OJCtrl = BURN_ENDIAN_SWAP_INT16(VideoRam[0xdff]); - - INT32 Offset; - INT32 SpriteColBank = (PC090OJSpriteCtrl & 0x0f) << 4; - - for (Offset = 0x400 - 4; Offset >= 0; Offset -= 4) - { - INT32 xFlip, yFlip; - INT32 x, y; - INT32 Data, Code, Colour; - - Data = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 0]); - yFlip = (Data & 0x8000) >> 15; - xFlip = (Data & 0x4000) >> 14; - Colour = (Data & 0x000f) | SpriteColBank | PC090OJPaletteOffset; - - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 2]) & 0x1fff; - if (Code >= PC090OJNumTiles) { - Code %= PC090OJNumTiles; // ok? Mod seems to work fine for bonze. - } - - x = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 3]) & 0x1ff; - y = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & 0x1ff; - - if (x > 0x140) x -= 0x200; - if (y > 0x140) y -= 0x200; - - if (!(PC090OJCtrl & 1)) { - x = 320 - x - 16; - y = 256 - y - 16; - xFlip = !xFlip; - yFlip = !yFlip; - } - - x -= PC090OJXOffset; - y -= PC090OJYOffset; - - if (x > 16 && x < (nScreenWidth - 16) && y > 16 && y < (nScreenHeight - 16)) { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } else { - Render16x16Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } else { - Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } - } else { - if (yFlip) { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } - } - } - } -} - -void PC090OJReset() -{ - PC090OJSpriteCtrl = 0; -} - -void PC090OJInit(INT32 nNumTiles, INT32 xOffset, INT32 yOffset, INT32 UseBuffer) -{ - PC090OJRam = (UINT8*)BurnMalloc(0x4000); - memset(PC090OJRam, 0, 0x4000); - - PC090OJNumTiles = nNumTiles; - - PC090OJXOffset = xOffset; - PC090OJYOffset = yOffset; - PC090OJUseBuffer = UseBuffer; - PC090OJPaletteOffset = 0; - - TaitoIC_PC090OJInUse = 1; -} - -void PC090OJSetPaletteOffset(INT32 Offset) -{ - PC090OJPaletteOffset = Offset; -} - -void PC090OJExit() -{ - BurnFree(PC090OJRam); - - PC090OJNumTiles = 0; - PC090OJXOffset = 0; - PC090OJYOffset = 0; - PC090OJUseBuffer = 0; - PC090OJPaletteOffset = 0; - - PC090OJSpriteCtrl = 0; -} - -void PC090OJScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = PC090OJRam; - ba.nLen = 0x4000; - ba.szName = "PC090OJ Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(PC090OJSpriteCtrl); - } -} diff --git a/jan/src/burn/drv/taito/taito.cpp b/jan/src/burn/drv/taito/taito.cpp deleted file mode 100644 index f9d443f5f..000000000 --- a/jan/src/burn/drv/taito/taito.cpp +++ /dev/null @@ -1,987 +0,0 @@ -#include "tiles_generic.h" -#include "taito.h" -#include "taito_ic.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "burn_ym2151.h" -#include "burn_ym2610.h" -#include "burn_ym2203.h" -#include "msm5205.h" -#include "msm6295.h" -#include "eeprom.h" -#include "burn_gun.h" - -UINT8 TaitoInputPort0[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TaitoInputPort1[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TaitoInputPort2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TaitoInputPort3[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TaitoInputPort4[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - -UINT8 TaitoInputPort5[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TaitoDip[2] = { 0, 0 }; -UINT8 TaitoInput[6] = { 0, 0, 0, 0, 0, 0 }; -UINT8 TaitoReset = 0; - -UINT8 TaitoCoinLockout[4] = { 0, 0, 0, 0 }; - -INT32 TaitoAnalogPort0 = 0; -INT32 TaitoAnalogPort1 = 0; -INT32 TaitoAnalogPort2 = 0; -INT32 TaitoAnalogPort3 = 0; - -UINT8 *TaitoMem = NULL; -UINT8 *TaitoMemEnd = NULL; -UINT8 *TaitoRamStart = NULL; -UINT8 *TaitoRamEnd = NULL; -UINT8 *Taito68KRam1 = NULL; -UINT8 *Taito68KRam2 = NULL; -UINT8 *Taito68KRam3 = NULL; -UINT8 *TaitoSharedRam = NULL; -UINT8 *TaitoZ80Ram1 = NULL; -UINT8 *TaitoZ80Ram2 = NULL; -UINT8 *TaitoPaletteRam = NULL; -UINT8 *TaitoSpriteRam = NULL; -UINT8 *TaitoSpriteRam2 = NULL; -UINT8 *TaitoSpriteRamBuffered = NULL; -UINT8 *TaitoSpriteRamDelayed = NULL; -UINT8 *TaitoSpriteRamDelayed2 = NULL; -UINT8 *TaitoSpriteExtension = NULL; -UINT8 *TaitoVideoRam = NULL; -UINT32 *TaitoPalette = NULL; -UINT8 *TaitoPriorityMap = NULL; - -UINT8 TaitoZ80Bank = 0; -UINT8 TaitoSoundLatch = 0; -UINT16 TaitoCpuACtrl = 0; -INT32 TaitoRoadPalBank = 0; - -INT32 TaitoXOffset = 0; -INT32 TaitoYOffset = 0; -INT32 TaitoIrqLine = 0; -INT32 TaitoFrameInterleave = 0; -INT32 TaitoFlipScreenX = 0; - -INT32 TaitoNum68Ks = 0; -INT32 TaitoNumZ80s = 0; -INT32 TaitoNumYM2610 = 0; -INT32 TaitoNumYM2151 = 0; -INT32 TaitoNumYM2203 = 0; -INT32 TaitoNumMSM5205 = 0; -INT32 TaitoNumMSM6295 = 0; -INT32 TaitoNumES5505 = 0; -INT32 TaitoNumEEPROM = 0; - -INT32 nTaitoCyclesDone[4], nTaitoCyclesTotal[4]; -INT32 nTaitoCyclesSegment; - -TaitoRender TaitoDrawFunction; -TaitoMakeInputs TaitoMakeInputsFunction; -TaitoResetFunc TaitoResetFunction; - -INT32 TaitoDoReset() -{ - INT32 i; - - for (i = 0; i < TaitoNum68Ks; i++) { - SekOpen(i); - SekReset(); - SekClose(); - } - - for (i = 0; i < TaitoNumZ80s; i++) { - ZetOpen(i); - ZetReset(); - ZetClose(); - } - - if (TaitoNumYM2610) BurnYM2610Reset(); - if (TaitoNumYM2151) BurnYM2151Reset(); - if (TaitoNumYM2203) BurnYM2203Reset(); - - if (TaitoNumMSM5205) MSM5205Reset(); - - for (i = 0; i < TaitoNumMSM6295; i++) { - MSM6295Reset(i); - } - - if (TaitoNumEEPROM) EEPROMReset(); - - TaitoICReset(); - - TaitoZ80Bank = 0; - TaitoSoundLatch = 0; - TaitoRoadPalBank = 0; - TaitoCpuACtrl = 0xff; - - memset (TaitoCoinLockout, 0, 4); - - return 0; -} - -UINT8 *Taito68KRom1 = NULL; -UINT8 *Taito68KRom2 = NULL; -UINT8 *Taito68KRom3 = NULL; -UINT8 *TaitoZ80Rom1 = NULL; -UINT8 *TaitoZ80Rom2 = NULL; -UINT8 *TaitoChars = NULL; -UINT8 *TaitoCharsB = NULL; -UINT8 *TaitoCharsPivot = NULL; -UINT8 *TaitoSpritesA = NULL; -UINT8 *TaitoSpritesB = NULL; -UINT8 *TaitoSpriteMapRom = NULL; -UINT8 *TaitoYM2610ARom = NULL; -UINT8 *TaitoYM2610BRom = NULL; -UINT8 *TaitoMSM5205Rom = NULL; -UINT8 *TaitoMSM6295Rom = NULL; -UINT8 *TaitoES5505Rom = NULL; -UINT8 *TaitoDefaultEEProm = NULL; - -UINT32 Taito68KRom1Num = 0; -UINT32 Taito68KRom2Num = 0; -UINT32 Taito68KRom3Num = 0; -UINT32 TaitoZ80Rom1Num = 0; -UINT32 TaitoZ80Rom2Num = 0; -UINT32 TaitoCharRomNum = 0; -UINT32 TaitoCharBRomNum = 0; -UINT32 TaitoCharPivotRomNum = 0; -UINT32 TaitoSpriteARomNum = 0; -UINT32 TaitoSpriteBRomNum = 0; -UINT32 TaitoRoadRomNum = 0; -UINT32 TaitoSpriteMapRomNum = 0; -UINT32 TaitoYM2610ARomNum = 0; -UINT32 TaitoYM2610BRomNum = 0; -UINT32 TaitoMSM5205RomNum = 0; -UINT32 TaitoMSM6295RomNum = 0; -UINT32 TaitoES5505RomNum = 0; -UINT32 TaitoDefaultEEPromNum = 0; - -UINT32 Taito68KRom1Size = 0; -UINT32 Taito68KRom2Size = 0; -UINT32 Taito68KRom3Size = 0; -UINT32 TaitoZ80Rom1Size = 0; -UINT32 TaitoZ80Rom2Size = 0; -UINT32 TaitoCharRomSize = 0; -UINT32 TaitoCharBRomSize = 0; -UINT32 TaitoCharPivotRomSize = 0; -UINT32 TaitoSpriteARomSize = 0; -UINT32 TaitoSpriteBRomSize = 0; -UINT32 TaitoRoadRomSize = 0; -UINT32 TaitoSpriteMapRomSize = 0; -UINT32 TaitoYM2610ARomSize = 0; -UINT32 TaitoYM2610BRomSize = 0; -UINT32 TaitoMSM5205RomSize = 0; -UINT32 TaitoMSM6295RomSize = 0; -UINT32 TaitoES5505RomSize = 0; -UINT32 TaitoDefaultEEPromSize = 0; - -UINT32 TaitoCharModulo = 0; -UINT32 TaitoCharNumPlanes = 0; -UINT32 TaitoCharWidth = 0; -UINT32 TaitoCharHeight = 0; -UINT32 TaitoNumChar = 0; -INT32 *TaitoCharPlaneOffsets = NULL; -INT32 *TaitoCharXOffsets = NULL; -INT32 *TaitoCharYOffsets = NULL; - -UINT32 TaitoCharBModulo = 0; -UINT32 TaitoCharBNumPlanes = 0; -UINT32 TaitoCharBWidth = 0; -UINT32 TaitoCharBHeight = 0; -UINT32 TaitoNumCharB = 0; -INT32 *TaitoCharBPlaneOffsets = NULL; -INT32 *TaitoCharBXOffsets = NULL; -INT32 *TaitoCharBYOffsets = NULL; - -UINT32 TaitoCharPivotModulo = 0; -UINT32 TaitoCharPivotNumPlanes = 0; -UINT32 TaitoCharPivotWidth = 0; -UINT32 TaitoCharPivotHeight = 0; -UINT32 TaitoNumCharPivot = 0; -INT32 *TaitoCharPivotPlaneOffsets = NULL; -INT32 *TaitoCharPivotXOffsets = NULL; -INT32 *TaitoCharPivotYOffsets = NULL; - -UINT32 TaitoSpriteAModulo = 0; -UINT32 TaitoSpriteANumPlanes = 0; -UINT32 TaitoSpriteAWidth = 0; -UINT32 TaitoSpriteAHeight = 0; -UINT32 TaitoNumSpriteA = 0; -INT32 *TaitoSpriteAPlaneOffsets = NULL; -INT32 *TaitoSpriteAXOffsets = NULL; -INT32 *TaitoSpriteAYOffsets = NULL; -INT32 TaitoSpriteAInvertRom = 0; - -UINT32 TaitoSpriteBModulo = 0; -UINT32 TaitoSpriteBNumPlanes = 0; -UINT32 TaitoSpriteBWidth = 0; -UINT32 TaitoSpriteBHeight = 0; -UINT32 TaitoNumSpriteB = 0; -INT32 *TaitoSpriteBPlaneOffsets = NULL; -INT32 *TaitoSpriteBXOffsets = NULL; -INT32 *TaitoSpriteBYOffsets = NULL; - -INT32 TaitoLoadRoms(INT32 bLoad) -{ - struct BurnRomInfo ri; - ri.nType = 0; - ri.nLen = 0; - INT32 nOffset = -1; - UINT32 i = 0; - INT32 nRet = 0; - - if (!bLoad) { - do { - ri.nLen = 0; - ri.nType = 0; - BurnDrvGetRomInfo(&ri, ++nOffset); - if ((ri.nType & 0xff) == TAITO_68KROM1 || (ri.nType & 0xff) == TAITO_68KROM1_BYTESWAP || (ri.nType & 0xff) == TAITO_68KROM1_BYTESWAP_JUMPING || (ri.nType & 0xff) == TAITO_68KROM1_BYTESWAP32) { - Taito68KRom1Size += ri.nLen; - Taito68KRom1Num++; - } - if ((ri.nType & 0xff) == TAITO_68KROM2 || (ri.nType & 0xff) == TAITO_68KROM2_BYTESWAP) { - Taito68KRom2Size += ri.nLen; - Taito68KRom2Num++; - } - if ((ri.nType & 0xff) == TAITO_68KROM3 || (ri.nType & 0xff) == TAITO_68KROM3_BYTESWAP) { - Taito68KRom3Size += ri.nLen; - Taito68KRom3Num++; - } - if ((ri.nType & 0xff) == TAITO_Z80ROM1) { - TaitoZ80Rom1Size += ri.nLen; - TaitoZ80Rom1Num++; - } - if ((ri.nType & 0xff) == TAITO_Z80ROM2) { - TaitoZ80Rom2Size += ri.nLen; - TaitoZ80Rom2Num++; - } - if ((ri.nType & 0xff) == TAITO_CHARS || (ri.nType & 0xff) == TAITO_CHARS_BYTESWAP) { - TaitoCharRomSize += ri.nLen; - TaitoCharRomNum++; - } - if ((ri.nType & 0xff) == TAITO_CHARSB || (ri.nType & 0xff) == TAITO_CHARSB_BYTESWAP) { - TaitoCharBRomSize += ri.nLen; - TaitoCharBRomNum++; - } - if ((ri.nType & 0xff) == TAITO_SPRITESA || (ri.nType & 0xff) == TAITO_SPRITESA_BYTESWAP || (ri.nType & 0xff) == TAITO_SPRITESA_BYTESWAP32 || (ri.nType & 0xff) == TAITO_SPRITESA_TOPSPEED) { - TaitoSpriteARomSize += ri.nLen; - TaitoSpriteARomNum++; - } - if ((ri.nType & 0xff) == TAITO_SPRITESB || (ri.nType & 0xff) == TAITO_SPRITESB_BYTESWAP || (ri.nType & 0xff) == TAITO_SPRITESB_BYTESWAP32) { - TaitoSpriteBRomSize += ri.nLen; - TaitoSpriteBRomNum++; - } - if ((ri.nType & 0xff) == TAITO_ROAD) { - TaitoRoadRomSize += ri.nLen; - TaitoRoadRomNum++; - } - if ((ri.nType & 0xff) == TAITO_SPRITEMAP) { - TaitoSpriteMapRomSize += ri.nLen; - TaitoSpriteMapRomNum++; - } - if ((ri.nType & 0xff) == TAITO_YM2610A) { - TaitoYM2610ARomSize += ri.nLen; - TaitoYM2610ARomNum++; - } - if ((ri.nType & 0xff) == TAITO_YM2610B) { - TaitoYM2610BRomSize += ri.nLen; - TaitoYM2610BRomNum++; - } - if ((ri.nType & 0xff) == TAITO_MSM5205 || (ri.nType & 0xff) == TAITO_MSM5205_BYTESWAP) { - TaitoMSM5205RomSize += ri.nLen; - TaitoMSM5205RomNum++; - } - if ((ri.nType & 0xff) == TAITO_CHARS_PIVOT) { - TaitoCharPivotRomSize += ri.nLen; - TaitoCharPivotRomNum++; - } - if ((ri.nType & 0xff) == TAITO_MSM6295) { - TaitoMSM6295RomSize += ri.nLen; - TaitoMSM6295RomNum++; - } - if ((ri.nType & 0xff) == TAITO_ES5505 || (ri.nType & 0xff) == TAITO_ES5505_BYTESWAP) { - TaitoES5505RomSize += ri.nLen; - TaitoES5505RomNum++; - } - if ((ri.nType & 0xff) == TAITO_DEFAULT_EEPROM) { - TaitoDefaultEEPromSize += ri.nLen; - TaitoDefaultEEPromNum++; - } - } while (ri.nLen); - -#if 1 && defined FBA_DEBUG - if (Taito68KRom1Size) bprintf(PRINT_IMPORTANT, _T("68K #1 Rom Length %06X, (%i roms)\n"), Taito68KRom1Size, Taito68KRom1Num); - if (Taito68KRom2Size) bprintf(PRINT_IMPORTANT, _T("68K #2 Rom Length %06X, (%i roms)\n"), Taito68KRom2Size, Taito68KRom2Num); - if (Taito68KRom3Size) bprintf(PRINT_IMPORTANT, _T("68K #3 Rom Length %06X, (%i roms)\n"), Taito68KRom3Size, Taito68KRom3Num); - if (TaitoZ80Rom1Size) bprintf(PRINT_IMPORTANT, _T("Z80 #1 Rom Length %06X, (%i roms)\n"), TaitoZ80Rom1Size, TaitoZ80Rom1Num); - if (TaitoZ80Rom2Size) bprintf(PRINT_IMPORTANT, _T("Z80 #2 Rom Length %06X, (%i roms)\n"), TaitoZ80Rom2Size, TaitoZ80Rom2Num); - if (TaitoCharRomSize) bprintf(PRINT_IMPORTANT, _T("Char Rom Length %08X, (%i roms, 0x%06X tiles)\n"), TaitoCharRomSize, TaitoCharRomNum, TaitoNumChar); - if (TaitoCharBRomSize) bprintf(PRINT_IMPORTANT, _T("Char B Rom Length %08X, (%i roms, 0x%06X tiles)\n"), TaitoCharBRomSize, TaitoCharBRomNum, TaitoNumCharB); - if (TaitoSpriteARomSize) bprintf(PRINT_IMPORTANT, _T("Sprite A Rom Length %08X, (%i roms, 0x%06X tiles)\n"), TaitoSpriteARomSize, TaitoSpriteARomNum, TaitoNumSpriteA); - if (TaitoSpriteBRomSize) bprintf(PRINT_IMPORTANT, _T("Sprite B Rom Length %08X, (%i roms, 0x%06X tiles)\n"), TaitoSpriteBRomSize, TaitoSpriteBRomNum, TaitoNumSpriteB); - if (TaitoRoadRomSize) bprintf(PRINT_IMPORTANT, _T("Road Rom Length %08X, (%i roms)\n"), TaitoRoadRomSize, TaitoRoadRomNum); - if (TaitoSpriteMapRomSize) bprintf(PRINT_IMPORTANT, _T("Sprite Map Rom Length %08X, (%i roms)\n"), TaitoSpriteMapRomSize, TaitoSpriteMapRomNum); - if (TaitoYM2610ARomSize) bprintf(PRINT_IMPORTANT, _T("YM2610 Samples Rom Length %08X, (%i roms)\n"), TaitoYM2610ARomSize, TaitoYM2610ARomNum); - if (TaitoYM2610BRomSize) bprintf(PRINT_IMPORTANT, _T("YM2610 Delta-T Rom Length %08X, (%i roms)\n"), TaitoYM2610BRomSize, TaitoYM2610BRomNum); - if (TaitoMSM5205RomSize) bprintf(PRINT_IMPORTANT, _T("MSM5205 Rom Length %08X, (%i roms)\n"), TaitoMSM5205RomSize, TaitoMSM5205RomNum); - if (TaitoCharPivotRomSize) bprintf(PRINT_IMPORTANT, _T("Pivot Char Rom Length %08X, (%i roms, 0x%06X tiles)\n"), TaitoCharPivotRomSize, TaitoCharPivotRomNum, TaitoNumCharPivot); - if (TaitoMSM6295RomSize) bprintf(PRINT_IMPORTANT, _T("MSM6295 Rom Length %08X, (%i roms)\n"), TaitoMSM6295RomSize, TaitoMSM6295RomNum); - if (TaitoES5505RomSize) bprintf(PRINT_IMPORTANT, _T("ES5505 Rom Length %08X, (%i roms)\n"), TaitoES5505RomSize, TaitoES5505RomNum); - if (TaitoDefaultEEPromSize) bprintf(PRINT_IMPORTANT, _T("Default EEPROM Length %08X, (%i roms)\n"), TaitoDefaultEEPromSize, TaitoDefaultEEPromNum); -#endif - } - - if (bLoad) { - INT32 Offset = 0; - - i = 0; - while (i < Taito68KRom1Num) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_68KROM1_BYTESWAP) { - nRet = BurnLoadRom(Taito68KRom1 + Offset + 1, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(Taito68KRom1 + Offset + 0, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - - i += 2; - } - - if ((ri.nType & 0xff) == TAITO_68KROM1_BYTESWAP32) { - nRet = BurnLoadRom(Taito68KRom1 + Offset + 1, i + 0, 4); if (nRet) return 1; - nRet = BurnLoadRom(Taito68KRom1 + Offset + 0, i + 1, 4); if (nRet) return 1; - nRet = BurnLoadRom(Taito68KRom1 + Offset + 3, i + 2, 4); if (nRet) return 1; - nRet = BurnLoadRom(Taito68KRom1 + Offset + 2, i + 3, 4); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 2); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 3); - Offset += ri.nLen; - - i += 4; - } - - if ((ri.nType & 0xff) == TAITO_68KROM1_BYTESWAP_JUMPING) { - nRet = BurnLoadRom(Taito68KRom1 + Offset + 0, i + 0, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - - i++; - } - - if ((ri.nType & 0xff) == TAITO_68KROM1) { - nRet = BurnLoadRom(Taito68KRom1 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - } - - if (Taito68KRom2Size) { - Offset = 0; - i = Taito68KRom1Num; - - while (i < Taito68KRom1Num + Taito68KRom2Num) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_68KROM2_BYTESWAP) { - nRet = BurnLoadRom(Taito68KRom2 + Offset + 1, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(Taito68KRom2 + Offset + 0, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - - i += 2; - } - - if ((ri.nType & 0xff) == TAITO_68KROM2) { - nRet = BurnLoadRom(Taito68KRom2 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - } - } - - if (Taito68KRom3Size) { - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_68KROM3_BYTESWAP) { - nRet = BurnLoadRom(Taito68KRom3 + Offset + 1, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(Taito68KRom3 + Offset + 0, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - - i += 2; - } - - if ((ri.nType & 0xff) == TAITO_68KROM3) { - nRet = BurnLoadRom(Taito68KRom3 + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - } - } - - if (TaitoZ80Rom1Size) { - Offset = 0; - for (i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num; i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num; i++) { - BurnLoadRom(TaitoZ80Rom1 + Offset, i, 1); - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - } - } - - if (TaitoZ80Rom2Size) { - Offset = 0; - for (i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num; i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num; i++) { - BurnLoadRom(TaitoZ80Rom2 + Offset, i, 1); - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - } - } - - if (TaitoCharRomSize) { - UINT8 *TempRom = (UINT8*)BurnMalloc(TaitoCharRomSize); - memset(TempRom, 0, TaitoCharRomSize); - - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_CHARS) { - nRet = BurnLoadRom(TempRom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - - if ((ri.nType & 0xff) == TAITO_CHARS_BYTESWAP) { - nRet = BurnLoadRom(TempRom + Offset + 0, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 1, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - - i += 2; - } - } - - if (TaitoNumChar) { - GfxDecode(TaitoNumChar, TaitoCharNumPlanes, TaitoCharWidth, TaitoCharHeight, TaitoCharPlaneOffsets, TaitoCharXOffsets, TaitoCharYOffsets, TaitoCharModulo, TempRom, TaitoChars); - } else { - memcpy (TaitoChars, TempRom, Offset); - } - - BurnFree(TempRom); - } - - if (TaitoCharBRomSize) { - UINT8 *TempRom = (UINT8*)BurnMalloc(TaitoCharBRomSize); - memset(TempRom, 0, TaitoCharBRomSize); - - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_CHARSB) { - nRet = BurnLoadRom(TempRom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - - if ((ri.nType & 0xff) == TAITO_CHARSB_BYTESWAP) { - nRet = BurnLoadRom(TempRom + Offset + 0, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 1, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - - i += 2; - } - } - - GfxDecode(TaitoNumCharB, TaitoCharBNumPlanes, TaitoCharBWidth, TaitoCharBHeight, TaitoCharBPlaneOffsets, TaitoCharBXOffsets, TaitoCharBYOffsets, TaitoCharBModulo, TempRom, TaitoCharsB); - - BurnFree(TempRom); - } - - if (TaitoSpriteARomSize) { - UINT8 *TempRom = (UINT8*)BurnMalloc(TaitoSpriteARomSize); - memset(TempRom, 0, TaitoSpriteARomSize); - - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_SPRITESA) { - nRet = BurnLoadRom(TempRom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - - if ((ri.nType & 0xff) == TAITO_SPRITESA_BYTESWAP) { - nRet = BurnLoadRom(TempRom + Offset + 0, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 1, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - - i += 2; - } - - if ((ri.nType & 0xff) == TAITO_SPRITESA_BYTESWAP32) { - nRet = BurnLoadRom(TempRom + Offset + 0, i + 0, 4); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 1, i + 1, 4); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 2, i + 2, 4); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 3, i + 3, 4); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 2); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 3); - Offset += ri.nLen; - - i += 4; - } - - if ((ri.nType & 0xff) == TAITO_SPRITESA_TOPSPEED) { - nRet = BurnLoadRom(TempRom + 0x000003, i + 0, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x100003, i + 1, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x000007, i + 2, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x100007, i + 3, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x000002, i + 4, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x100002, i + 5, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x000006, i + 6, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x100006, i + 7, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x000001, i + 8, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x100001, i + 9, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x000005, i + 10, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x100005, i + 11, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x000000, i + 12, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x100000, i + 13, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x000004, i + 14, 8); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + 0x100004, i + 15, 8); if (nRet) return 1; - - i += 16; - } - } - - if (TaitoSpriteAInvertRom) { - for (UINT32 j = 0; j < TaitoSpriteARomSize; j++) { - TempRom[j] ^= 0xff; - } - } - - if (TaitoNumSpriteA) { - GfxDecode(TaitoNumSpriteA, TaitoSpriteANumPlanes, TaitoSpriteAWidth, TaitoSpriteAHeight, TaitoSpriteAPlaneOffsets, TaitoSpriteAXOffsets, TaitoSpriteAYOffsets, TaitoSpriteAModulo, TempRom, TaitoSpritesA); - } else { - memcpy (TaitoSpritesA, TempRom, Offset); - } - - BurnFree(TempRom); - } - - if (TaitoSpriteBRomSize) { - UINT8 *TempRom = (UINT8*)BurnMalloc(TaitoSpriteBRomSize); - memset(TempRom, 0, TaitoSpriteBRomSize); - - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_SPRITESB) { - nRet = BurnLoadRom(TempRom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - - if ((ri.nType & 0xff) == TAITO_SPRITESB_BYTESWAP) { - nRet = BurnLoadRom(TempRom + Offset + 0, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 1, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - - i += 2; - } - - if ((ri.nType & 0xff) == TAITO_SPRITESB_BYTESWAP32) { - nRet = BurnLoadRom(TempRom + Offset + 0, i + 0, 4); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 1, i + 1, 4); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 2, i + 2, 4); if (nRet) return 1; - nRet = BurnLoadRom(TempRom + Offset + 3, i + 3, 4); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 2); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 3); - Offset += ri.nLen; - - i += 4; - } - } - - GfxDecode(TaitoNumSpriteB, TaitoSpriteBNumPlanes, TaitoSpriteBWidth, TaitoSpriteBHeight, TaitoSpriteBPlaneOffsets, TaitoSpriteBXOffsets, TaitoSpriteBYOffsets, TaitoSpriteBModulo, TempRom, TaitoSpritesB); - - BurnFree(TempRom); - } - - if (TaitoRoadRomSize) { - Offset = 0; - for (i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum; i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum; i++) { - BurnLoadRom(TC0150RODRom + Offset, i, 1); - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - } - } - - if (TaitoSpriteMapRomSize) { - Offset = 0; - for (i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum; i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum; i++) { - BurnLoadRom(TaitoSpriteMapRom + Offset, i, 1); - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - } - } - - if (TaitoYM2610ARomSize) { - Offset = 0; - for (i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum; i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum; i++) { - BurnLoadRom(TaitoYM2610ARom + Offset, i, 1); - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - } - } - - if (TaitoYM2610BRomSize) { - Offset = 0; - for (i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum; i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum; i++) { - BurnLoadRom(TaitoYM2610BRom + Offset, i, 1); - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - } - } - - if (TaitoMSM5205RomSize) { - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum + TaitoMSM5205RomNum) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_MSM5205) { - nRet = BurnLoadRom(TaitoMSM5205Rom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - - if ((ri.nType & 0xff) == TAITO_MSM5205_BYTESWAP) { - nRet = BurnLoadRom(TaitoMSM5205Rom + Offset + 0, i + 0, 2); if (nRet) return 1; - nRet = BurnLoadRom(TaitoMSM5205Rom + Offset + 1, i + 1, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i + 0); - Offset += ri.nLen; - BurnDrvGetRomInfo(&ri, i + 1); - Offset += ri.nLen; - - i += 2; - } - } - } - - if (TaitoCharPivotRomSize) { - UINT8 *TempRom = (UINT8*)BurnMalloc(TaitoCharPivotRomSize); - memset(TempRom, 0, TaitoCharPivotRomSize); - - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum + TaitoMSM5205RomNum; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum + TaitoMSM5205RomNum + TaitoCharPivotRomNum) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_CHARS_PIVOT) { - nRet = BurnLoadRom(TempRom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - } - - GfxDecode(TaitoNumCharPivot, TaitoCharPivotNumPlanes, TaitoCharPivotWidth, TaitoCharPivotHeight, TaitoCharPivotPlaneOffsets, TaitoCharPivotXOffsets, TaitoCharPivotYOffsets, TaitoCharPivotModulo, TempRom, TaitoCharsPivot); - - BurnFree(TempRom); - } - - if (TaitoMSM6295RomSize) { - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum + TaitoMSM5205RomNum + TaitoCharPivotRomNum; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum + TaitoMSM5205RomNum + TaitoCharPivotRomNum + TaitoMSM6295RomNum) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_MSM6295) { - nRet = BurnLoadRom(TaitoMSM6295Rom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - } - } - - if (TaitoES5505RomSize) { - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum + TaitoMSM5205RomNum + TaitoCharPivotRomNum + TaitoMSM6295RomNum; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum + TaitoMSM5205RomNum + TaitoCharPivotRomNum + TaitoMSM6295RomNum + TaitoES5505RomNum) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_ES5505) { - nRet = BurnLoadRom(TaitoES5505Rom + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - - if ((ri.nType & 0xff) == TAITO_ES5505_BYTESWAP) { - nRet = BurnLoadRom(TaitoES5505Rom + (Offset * 2), i, 2); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - } - } - - if (TaitoDefaultEEPromSize) { - Offset = 0; - i = Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum + TaitoMSM5205RomNum + TaitoCharPivotRomNum + TaitoMSM6295RomNum + TaitoES5505RomNum; - - while (i < Taito68KRom1Num + Taito68KRom2Num + Taito68KRom3Num + TaitoZ80Rom1Num + TaitoZ80Rom2Num + TaitoCharRomNum + TaitoCharBRomNum + TaitoSpriteARomNum + TaitoSpriteBRomNum + TaitoRoadRomNum + TaitoSpriteMapRomNum + TaitoYM2610ARomNum + TaitoYM2610BRomNum + TaitoMSM5205RomNum + TaitoCharPivotRomNum + TaitoMSM6295RomNum + TaitoES5505RomNum + TaitoDefaultEEPromNum) { - BurnDrvGetRomInfo(&ri, i + 0); - - if ((ri.nType & 0xff) == TAITO_DEFAULT_EEPROM) { - nRet = BurnLoadRom(TaitoDefaultEEProm + Offset, i, 1); if (nRet) return 1; - - BurnDrvGetRomInfo(&ri, i); - Offset += ri.nLen; - - i++; - } - } - } - } - - return 0; -} - -void TaitoClearVariables() -{ - Taito68KRom1Num = 0; - Taito68KRom2Num = 0; - Taito68KRom3Num = 0; - TaitoZ80Rom1Num = 0; - TaitoZ80Rom2Num = 0; - TaitoCharRomNum = 0; - TaitoCharBRomNum = 0; - TaitoCharPivotRomNum = 0; - TaitoSpriteARomNum = 0; - TaitoSpriteBRomNum = 0; - TaitoRoadRomNum = 0; - TaitoSpriteMapRomNum = 0; - TaitoYM2610ARomNum = 0; - TaitoYM2610BRomNum = 0; - TaitoMSM5205RomNum = 0; - TaitoMSM6295RomNum = 0; - TaitoES5505RomNum = 0; - TaitoDefaultEEPromNum = 0; - - Taito68KRom1Size = 0; - Taito68KRom2Size = 0; - Taito68KRom3Size = 0; - TaitoZ80Rom1Size = 0; - TaitoZ80Rom2Size = 0; - TaitoCharRomSize = 0; - TaitoCharBRomSize = 0; - TaitoCharPivotRomSize = 0; - TaitoSpriteARomSize = 0; - TaitoSpriteBRomSize = 0; - TaitoRoadRomSize = 0; - TaitoSpriteMapRomSize = 0; - TaitoYM2610ARomSize = 0; - TaitoYM2610BRomSize = 0; - TaitoMSM5205RomSize = 0; - TaitoMSM6295RomSize = 0; - TaitoES5505RomSize = 0; - TaitoDefaultEEPromSize = 0; - - TaitoCharModulo = 0; - TaitoCharNumPlanes = 0; - TaitoCharWidth = 0; - TaitoCharHeight = 0; - TaitoNumChar = 0; - TaitoCharPlaneOffsets = NULL; - TaitoCharXOffsets = NULL; - TaitoCharYOffsets = NULL; - - TaitoCharBModulo = 0; - TaitoCharBNumPlanes = 0; - TaitoCharBWidth = 0; - TaitoCharBHeight = 0; - TaitoNumCharB = 0; - TaitoCharBPlaneOffsets = NULL; - TaitoCharBXOffsets = NULL; - TaitoCharBYOffsets = NULL; - - TaitoCharPivotModulo = 0; - TaitoCharPivotNumPlanes = 0; - TaitoCharPivotWidth = 0; - TaitoCharPivotHeight = 0; - TaitoNumCharPivot = 0; - TaitoCharPivotPlaneOffsets = NULL; - TaitoCharPivotXOffsets = NULL; - TaitoCharPivotYOffsets = NULL; - - TaitoSpriteAModulo = 0; - TaitoSpriteANumPlanes = 0; - TaitoSpriteAWidth = 0; - TaitoSpriteAHeight = 0; - TaitoNumSpriteA = 0; - TaitoSpriteAPlaneOffsets = NULL; - TaitoSpriteAXOffsets = NULL; - TaitoSpriteAYOffsets = NULL; - TaitoSpriteAInvertRom = 0; - - TaitoSpriteBModulo = 0; - TaitoSpriteBNumPlanes = 0; - TaitoSpriteBWidth = 0; - TaitoSpriteBHeight = 0; - TaitoNumSpriteB = 0; - TaitoSpriteBPlaneOffsets = NULL; - TaitoSpriteBXOffsets = NULL; - TaitoSpriteBYOffsets = NULL; - - TaitoZ80Bank = 0; - TaitoSoundLatch = 0; - TaitoRoadPalBank = 0; - TaitoCpuACtrl = 0; - - TaitoXOffset = 0; - TaitoYOffset = 0; - TaitoIrqLine = 0; - TaitoFrameInterleave = 0; - TaitoFlipScreenX = 0; - - TaitoNum68Ks = 0; - TaitoNumZ80s = 0; - TaitoNumYM2610 = 0; - TaitoNumYM2151 = 0; - TaitoNumYM2203 = 0; - TaitoNumMSM5205 = 0; - TaitoNumMSM6295 = 0; - TaitoNumES5505 = 0; - TaitoNumEEPROM = 0; - - TaitoDrawFunction = NULL; - TaitoMakeInputsFunction = NULL; - TaitoResetFunction = NULL; -} - -INT32 TaitoExit() -{ - INT32 i; - - if (TaitoNum68Ks) SekExit(); - if (TaitoNumZ80s) ZetExit(); - if (TaitoNumYM2610) BurnYM2610Exit(); - if (TaitoNumYM2151) BurnYM2151Exit(); - if (TaitoNumYM2203) BurnYM2203Exit(); - if (TaitoNumMSM5205) MSM5205Exit(); - for (i = 0; i < TaitoNumMSM6295; i++) { - MSM6295Exit(i); - } - if (TaitoNumEEPROM) EEPROMExit(); - - TaitoICExit(); - - GenericTilesExit(); - if (nBurnGunNumPlayers) BurnGunExit(); - - BurnFree(TaitoMem); - - TaitoClearVariables(); - - return 0; -} diff --git a/jan/src/burn/drv/taito/taito.h b/jan/src/burn/drv/taito/taito.h deleted file mode 100644 index 1340ef329..000000000 --- a/jan/src/burn/drv/taito/taito.h +++ /dev/null @@ -1,246 +0,0 @@ -extern UINT8 TaitoInputPort0[8]; -extern UINT8 TaitoInputPort1[8]; -extern UINT8 TaitoInputPort2[8]; -extern UINT8 TaitoInputPort3[8]; -extern UINT8 TaitoInputPort4[8]; -extern UINT8 TaitoInputPort5[16]; -extern UINT8 TaitoDip[2]; -extern UINT8 TaitoInput[6]; -extern UINT8 TaitoReset; -extern UINT8 TaitoCoinLockout[4]; - -extern INT32 TaitoAnalogPort0; -extern INT32 TaitoAnalogPort1; -extern INT32 TaitoAnalogPort2; -extern INT32 TaitoAnalogPort3; - -extern UINT8 *TaitoMem; -extern UINT8 *TaitoMemEnd; -extern UINT8 *TaitoRamStart; -extern UINT8 *TaitoRamEnd; -extern UINT8 *Taito68KRam1; -extern UINT8 *Taito68KRam2; -extern UINT8 *Taito68KRam3; -extern UINT8 *TaitoSharedRam; -extern UINT8 *TaitoZ80Ram1; -extern UINT8 *TaitoZ80Ram2; -extern UINT8 *TaitoPaletteRam; -extern UINT8 *TaitoSpriteRam; -extern UINT8 *TaitoSpriteRam2; -extern UINT8 *TaitoSpriteRamBuffered; -extern UINT8 *TaitoSpriteRamDelayed; -extern UINT8 *TaitoSpriteRamDelayed2; -extern UINT8 *TaitoSpriteExtension; -extern UINT8 *TaitoVideoRam; -extern UINT32 *TaitoPalette; -extern UINT8 *TaitoPriorityMap; - -extern UINT8 TaitoZ80Bank; -extern UINT8 TaitoSoundLatch; -extern UINT16 TaitoCpuACtrl; -extern INT32 TaitoRoadPalBank; - -extern INT32 TaitoXOffset; -extern INT32 TaitoYOffset; -extern INT32 TaitoIrqLine; -extern INT32 TaitoFrameInterleave; -extern INT32 TaitoNumEEPROM; -extern INT32 TaitoFlipScreenX; - -extern INT32 TaitoNum68Ks; -extern INT32 TaitoNumZ80s; -extern INT32 TaitoNumYM2610; -extern INT32 TaitoNumYM2151; -extern INT32 TaitoNumYM2203; -extern INT32 TaitoNumMSM5205; -extern INT32 TaitoNumMSM6295; -extern INT32 TaitoNumES5505; - -extern INT32 nTaitoCyclesDone[4], nTaitoCyclesTotal[4]; -extern INT32 nTaitoCyclesSegment; - -typedef void (*TaitoRender)(); -extern TaitoRender TaitoDrawFunction; -typedef void (*TaitoMakeInputs)(); -extern TaitoMakeInputs TaitoMakeInputsFunction; -typedef INT32 (*TaitoResetFunc)(); -extern TaitoResetFunc TaitoResetFunction; - -extern INT32 TaitoDoReset(); - -#define TAITO_68KROM1 1 -#define TAITO_68KROM1_BYTESWAP 2 -#define TAITO_68KROM1_BYTESWAP_JUMPING 3 -#define TAITO_68KROM1_BYTESWAP32 4 -#define TAITO_68KROM2 5 -#define TAITO_68KROM2_BYTESWAP 6 -#define TAITO_68KROM3 7 -#define TAITO_68KROM3_BYTESWAP 8 -#define TAITO_Z80ROM1 9 -#define TAITO_Z80ROM2 10 -#define TAITO_CHARS 11 -#define TAITO_CHARS_BYTESWAP 12 -#define TAITO_CHARSB 13 -#define TAITO_CHARSB_BYTESWAP 14 -#define TAITO_SPRITESA 15 -#define TAITO_SPRITESA_BYTESWAP 16 -#define TAITO_SPRITESA_BYTESWAP32 17 -#define TAITO_SPRITESA_TOPSPEED 18 -#define TAITO_SPRITESB 19 -#define TAITO_SPRITESB_BYTESWAP 20 -#define TAITO_SPRITESB_BYTESWAP32 21 -#define TAITO_ROAD 22 -#define TAITO_SPRITEMAP 23 -#define TAITO_YM2610A 24 -#define TAITO_YM2610B 25 -#define TAITO_MSM5205 26 -#define TAITO_MSM5205_BYTESWAP 27 -#define TAITO_CHARS_PIVOT 28 -#define TAITO_MSM6295 29 -#define TAITO_ES5505 30 -#define TAITO_ES5505_BYTESWAP 31 -#define TAITO_DEFAULT_EEPROM 32 -#define TAITO_CHARS_BYTESWAP32 33 - -extern UINT8 *Taito68KRom1; -extern UINT8 *Taito68KRom2; -extern UINT8 *Taito68KRom3; -extern UINT8 *TaitoZ80Rom1; -extern UINT8 *TaitoZ80Rom2; -extern UINT8 *TaitoChars; -extern UINT8 *TaitoCharsB; -extern UINT8 *TaitoCharsPivot; -extern UINT8 *TaitoSpritesA; -extern UINT8 *TaitoSpritesB; -extern UINT8 *TaitoSpriteMapRom; -extern UINT8 *TaitoYM2610ARom; -extern UINT8 *TaitoYM2610BRom; -extern UINT8 *TaitoMSM5205Rom; -extern UINT8 *TaitoMSM6295Rom; -extern UINT8 *TaitoES5505Rom; -extern UINT8 *TaitoDefaultEEProm; - -extern UINT32 Taito68KRom1Num; -extern UINT32 Taito68KRom2Num; -extern UINT32 Taito68KRom3Num; -extern UINT32 TaitoZ80Rom1Num; -extern UINT32 TaitoZ80Rom2Num; -extern UINT32 TaitoCharRomNum; -extern UINT32 TaitoCharBRomNum; -extern UINT32 TaitoCharPivotRomNum; -extern UINT32 TaitoSpriteARomNum; -extern UINT32 TaitoSpriteBRomNum; -extern UINT32 TaitoRoadRomNum; -extern UINT32 TaitoSpriteMapRomNum; -extern UINT32 TaitoYM2610ARomNum; -extern UINT32 TaitoYM2610BRomNum; -extern UINT32 TaitoMSM5205RomNum; -extern UINT32 TaitoMSM6295RomNum; -extern UINT32 TaitoES5505RomNum; -extern UINT32 TaitoDefaultEEPromNum; - -extern UINT32 Taito68KRom1Size; -extern UINT32 Taito68KRom2Size; -extern UINT32 Taito68KRom3Size; -extern UINT32 TaitoZ80Rom1Size; -extern UINT32 TaitoZ80Rom2Size; -extern UINT32 TaitoCharRomSize; -extern UINT32 TaitoCharRomBSize; -extern UINT32 TaitoCharPivotRomSize; -extern UINT32 TaitoSpriteARomSize; -extern UINT32 TaitoSpriteBRomSize; -extern UINT32 TaitoRoadRomSize; -extern UINT32 TaitoSpriteMapRomSize; -extern UINT32 TaitoYM2610ARomSize; -extern UINT32 TaitoYM2610BRomSize; -extern UINT32 TaitoMSM5205RomSize; -extern UINT32 TaitoMSM6295RomSize; -extern UINT32 TaitoES5505RomSize; -extern UINT32 TaitoDefaultEEPromSize; - -extern UINT32 TaitoCharModulo; -extern UINT32 TaitoCharNumPlanes; -extern UINT32 TaitoCharWidth; -extern UINT32 TaitoCharHeight; -extern UINT32 TaitoNumChar; -extern INT32 *TaitoCharPlaneOffsets; -extern INT32 *TaitoCharXOffsets; -extern INT32 *TaitoCharYOffsets; - -extern UINT32 TaitoCharBModulo; -extern UINT32 TaitoCharBNumPlanes; -extern UINT32 TaitoCharBWidth; -extern UINT32 TaitoCharBHeight; -extern UINT32 TaitoNumCharB; -extern INT32 *TaitoCharBPlaneOffsets; -extern INT32 *TaitoCharBXOffsets; -extern INT32 *TaitoCharBYOffsets; - -extern UINT32 TaitoCharPivotModulo; -extern UINT32 TaitoCharPivotNumPlanes; -extern UINT32 TaitoCharPivotWidth; -extern UINT32 TaitoCharPivotHeight; -extern UINT32 TaitoNumCharPivot; -extern INT32 *TaitoCharPivotPlaneOffsets; -extern INT32 *TaitoCharPivotXOffsets; -extern INT32 *TaitoCharPivotYOffsets; - -extern UINT32 TaitoSpriteAModulo; -extern UINT32 TaitoSpriteANumPlanes; -extern UINT32 TaitoSpriteAWidth; -extern UINT32 TaitoSpriteAHeight; -extern UINT32 TaitoNumSpriteA; -extern INT32 *TaitoSpriteAPlaneOffsets; -extern INT32 *TaitoSpriteAXOffsets; -extern INT32 *TaitoSpriteAYOffsets; -extern INT32 TaitoSpriteAInvertRom; - -extern UINT32 TaitoSpriteBModulo; -extern UINT32 TaitoSpriteBNumPlanes; -extern UINT32 TaitoSpriteBWidth; -extern UINT32 TaitoSpriteBHeight; -extern UINT32 TaitoNumSpriteB; -extern INT32 *TaitoSpriteBPlaneOffsets; -extern INT32 *TaitoSpriteBXOffsets; -extern INT32 *TaitoSpriteBYOffsets; - -extern INT32 TaitoLoadRoms(INT32 bLoad); -extern INT32 TaitoExit(); -extern void TaitoClearVariables(); - -// Taito F2 Sprites -struct TaitoF2SpriteEntry { - INT32 Code; - INT32 x; - INT32 y; - INT32 Colour; - INT32 xFlip; - INT32 yFlip; - INT32 xZoom; - INT32 yZoom; - INT32 Priority; - INT32 Priority_Raw; -}; -extern struct TaitoF2SpriteEntry *TaitoF2SpriteList; - -extern INT32 TaitoF2SpriteType; -extern INT32 TaitoF2SpritesFlipScreen; -extern INT32 TaitoF2PrepareSprites; -extern INT32 TaitoF2SpritesDisabled, TaitoF2SpritesActiveArea, TaitoF2SpritesMasterScrollX, TaitoF2SpritesMasterScrollY; -extern INT32 TaitoF2SpriteBlendMode; -extern UINT16 TaitoF2SpriteBank[8]; -extern UINT16 TaitoF2SpriteBankBuffered[8]; -extern UINT8 TaitoF2TilePriority[5]; -extern UINT8 TaitoF2SpritePriority[4]; - -typedef void (*TaitoF2SpriteBufferUpdate)(); -void TaitoF2NoBuffer(); -void TaitoF2PartialBufferDelayed(); -void TaitoF2PartialBufferDelayedQzchikyu(); -void TaitoF2PartialBufferDelayedThundfox(); -void TaitoF2FullBufferDelayed(); - -void TaitoF2MakeSpriteList(); -void TaitoF2RenderSpriteList(INT32 TaitoF2SpritePriorityLevel); -void TaitoF2RenderSpriteListPriMasks(INT32 *primasks); -void TaitoF2HandleSpriteBuffering(); diff --git a/jan/src/burn/drv/taito/taito_ic.cpp b/jan/src/burn/drv/taito/taito_ic.cpp deleted file mode 100644 index 3ed2b151d..000000000 --- a/jan/src/burn/drv/taito/taito_ic.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include "burnint.h" -#include "taito_ic.h" - -INT32 TaitoIC_SupermanCChipInUse = 0; -INT32 TaitoIC_MegabCChipInUse = 0; -INT32 TaitoIC_RainbowCChipInUse = 0; -INT32 TaitoIC_OpwolfCChipInUse = 0; -INT32 TaitoIC_VolfiedCChipInUse = 0; - -INT32 TaitoIC_PC080SNInUse = 0; -INT32 TaitoIC_PC090OJInUse = 0; -INT32 TaitoIC_TC0100SCNInUse = 0; -INT32 TaitoIC_TC0110PCRInUse = 0; -INT32 TaitoIC_TC0140SYTInUse = 0; -INT32 TaitoIC_TC0150RODInUse = 0; -INT32 TaitoIC_TC0180VCUInUse = 0; -INT32 TaitoIC_TC0220IOCInUse = 0; -INT32 TaitoIC_TC0280GRDInUse = 0; -INT32 TaitoIC_TC0360PRIInUse = 0; -INT32 TaitoIC_TC0430GRWInUse = 0; -INT32 TaitoIC_TC0480SCPInUse = 0; -INT32 TaitoIC_TC0510NIOInUse = 0; -INT32 TaitoIC_TC0640FIOInUse = 0; - -INT32 TaitoWatchdog; - -void TaitoICReset() -{ - if (TaitoIC_SupermanCChipInUse) SupermanCChipReset(); - if (TaitoIC_MegabCChipInUse) MegabCChipReset(); - if (TaitoIC_RainbowCChipInUse) RainbowCChipReset(); - if (TaitoIC_OpwolfCChipInUse) OpwolfCChipReset(); - if (TaitoIC_VolfiedCChipInUse) VolfiedCChipReset(); - - if (TaitoIC_PC080SNInUse) PC080SNReset(); - if (TaitoIC_PC090OJInUse) PC090OJReset(); - if (TaitoIC_TC0100SCNInUse) TC0100SCNReset(); - if (TaitoIC_TC0110PCRInUse) TC0110PCRReset(); - if (TaitoIC_TC0140SYTInUse) TC0140SYTReset(); - if (TaitoIC_TC0150RODInUse) TC0150RODReset(); - if (TaitoIC_TC0180VCUInUse) TC0180VCUReset(); - if (TaitoIC_TC0220IOCInUse) TC0220IOCReset(); - if (TaitoIC_TC0280GRDInUse) TC0280GRDReset(); - if (TaitoIC_TC0360PRIInUse) TC0360PRIReset(); - if (TaitoIC_TC0430GRWInUse) TC0430GRWReset(); - if (TaitoIC_TC0480SCPInUse) TC0480SCPReset(); - if (TaitoIC_TC0510NIOInUse) TC0510NIOReset(); - if (TaitoIC_TC0640FIOInUse) TC0640FIOReset(); - - TaitoWatchdog = 0; -} - -void TaitoICExit() -{ - if (TaitoIC_SupermanCChipInUse) SupermanCChipExit(); - if (TaitoIC_MegabCChipInUse) MegabCChipExit(); - if (TaitoIC_RainbowCChipInUse) RainbowCChipExit(); - if (TaitoIC_OpwolfCChipInUse) OpwolfCChipExit(); - if (TaitoIC_VolfiedCChipInUse) VolfiedCChipExit(); - - if (TaitoIC_PC080SNInUse) PC080SNExit(); - if (TaitoIC_PC090OJInUse) PC090OJExit(); - if (TaitoIC_TC0100SCNInUse) TC0100SCNExit(); - if (TaitoIC_TC0110PCRInUse) TC0110PCRExit(); - if (TaitoIC_TC0140SYTInUse) TC0140SYTExit(); - if (TaitoIC_TC0150RODInUse) TC0150RODExit(); - if (TaitoIC_TC0180VCUInUse) TC0180VCUExit(); - if (TaitoIC_TC0220IOCInUse) TC0220IOCExit(); - if (TaitoIC_TC0280GRDInUse) TC0280GRDExit(); - if (TaitoIC_TC0360PRIInUse) TC0360PRIExit(); - if (TaitoIC_TC0430GRWInUse) TC0430GRWExit(); - if (TaitoIC_TC0480SCPInUse) TC0480SCPExit(); - if (TaitoIC_TC0510NIOInUse) TC0510NIOExit(); - if (TaitoIC_TC0640FIOInUse) TC0640FIOExit(); - - TaitoIC_SupermanCChipInUse = 0; - TaitoIC_MegabCChipInUse = 0; - TaitoIC_RainbowCChipInUse = 0; - TaitoIC_OpwolfCChipInUse = 0; - TaitoIC_VolfiedCChipInUse = 0; - - TaitoIC_PC080SNInUse = 0; - TaitoIC_PC090OJInUse = 0; - TaitoIC_TC0100SCNInUse = 0; - TaitoIC_TC0110PCRInUse = 0; - TaitoIC_TC0140SYTInUse = 0; - TaitoIC_TC0150RODInUse = 0; - TaitoIC_TC0180VCUInUse = 0; - TaitoIC_TC0220IOCInUse = 0; - TaitoIC_TC0280GRDInUse = 0; - TaitoIC_TC0360PRIInUse = 0; - TaitoIC_TC0430GRWInUse = 0; - TaitoIC_TC0480SCPInUse = 0; - TaitoIC_TC0510NIOInUse = 0; - TaitoIC_TC0640FIOInUse = 0; - - TaitoWatchdog = 0; -} - -void TaitoICScan(INT32 nAction) -{ - if (TaitoIC_SupermanCChipInUse) SupermanCChipScan(nAction); - if (TaitoIC_MegabCChipInUse) MegabCChipScan(nAction); - if (TaitoIC_RainbowCChipInUse) RainbowCChipScan(nAction); - if (TaitoIC_OpwolfCChipInUse) OpwolfCChipScan(nAction); - if (TaitoIC_VolfiedCChipInUse) VolfiedCChipScan(nAction); - - if (TaitoIC_PC080SNInUse) PC080SNScan(nAction); - if (TaitoIC_PC090OJInUse) PC090OJScan(nAction); - if (TaitoIC_TC0100SCNInUse) TC0100SCNScan(nAction); - if (TaitoIC_TC0110PCRInUse) TC0110PCRScan(nAction); - if (TaitoIC_TC0140SYTInUse) TC0140SYTScan(nAction); - if (TaitoIC_TC0150RODInUse) TC0150RODScan(nAction); - if (TaitoIC_TC0180VCUInUse) TC0180VCUScan(nAction); - if (TaitoIC_TC0220IOCInUse) TC0220IOCScan(nAction); - if (TaitoIC_TC0280GRDInUse) TC0280GRDScan(nAction); - if (TaitoIC_TC0360PRIInUse) TC0360PRIScan(nAction); - if (TaitoIC_TC0430GRWInUse) TC0430GRWScan(nAction); - if (TaitoIC_TC0480SCPInUse) TC0480SCPScan(nAction); - if (TaitoIC_TC0510NIOInUse) TC0510NIOScan(nAction); - if (TaitoIC_TC0640FIOInUse) TC0640FIOScan(nAction); - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(TaitoWatchdog); - } -} diff --git a/jan/src/burn/drv/taito/taito_ic.h b/jan/src/burn/drv/taito/taito_ic.h deleted file mode 100644 index 55a94c9e9..000000000 --- a/jan/src/burn/drv/taito/taito_ic.h +++ /dev/null @@ -1,661 +0,0 @@ -extern INT32 TaitoIC_SupermanCChipInUse; -extern INT32 TaitoIC_MegabCChipInUse; -extern INT32 TaitoIC_RainbowCChipInUse; -extern INT32 TaitoIC_OpwolfCChipInUse; -extern INT32 TaitoIC_VolfiedCChipInUse; - -extern INT32 TaitoIC_PC080SNInUse; -extern INT32 TaitoIC_PC090OJInUse; -extern INT32 TaitoIC_TC0100SCNInUse; -extern INT32 TaitoIC_TC0110PCRInUse; -extern INT32 TaitoIC_TC0140SYTInUse; -extern INT32 TaitoIC_TC0150RODInUse; -extern INT32 TaitoIC_TC0180VCUInUse; -extern INT32 TaitoIC_TC0220IOCInUse; -extern INT32 TaitoIC_TC0280GRDInUse; -extern INT32 TaitoIC_TC0360PRIInUse; -extern INT32 TaitoIC_TC0430GRWInUse; -extern INT32 TaitoIC_TC0480SCPInUse; -extern INT32 TaitoIC_TC0510NIOInUse; -extern INT32 TaitoIC_TC0640FIOInUse; - -extern INT32 TaitoWatchdog; - -void TaitoICReset(); -void TaitoICExit(); -void TaitoICScan(INT32 nAction); - -// C-Chip -UINT16 SupermanCChipCtrlRead(); -UINT16 SupermanCChipRamRead(UINT32 Offset, UINT8 Input1, UINT8 Input2, UINT8 Input3); -void SupermanCChipCtrlWrite(); -void SupermanCChipBankWrite(UINT16 Data); -void SupermanCChipRamWrite(UINT32 Offset, UINT16 Data); -void SupermanCChipReset(); -void SupermanCChipInit(); -void SupermanCChipExit(); -void SupermanCChipScan(INT32 nAction); - -UINT16 MegabCChipRead(UINT32 Offset); -void MegabCChipWrite(UINT32 Offset, UINT16 Data); -void MegabCChipReset(); -void MegabCChipInit(); -void MegabCChipExit(); -void MegabCChipScan(INT32 nAction); - -void RainbowCChipUpdate(UINT8 Input1, UINT8 Input2, UINT8 Input3, UINT8 Input4); -UINT16 RainbowCChipCtrlRead(); -UINT16 RainbowCChipRamRead(UINT32 Offset); -void RainbowCChipCtrlWrite(UINT16); -void RainbowCChipBankWrite(UINT16 Data); -void RainbowCChipRamWrite(UINT32 Offset, UINT16 Data); -void RainbowCChipReset(); -void RainbowCChipInit(INT32 Version); -void RainbowCChipExit(); -void RainbowCChipScan(INT32 nAction); - -void OpwolfCChipUpdate(UINT8 Input1, UINT8 Input2); -UINT16 OpwolfCChipStatusRead(); -UINT16 OpwolfCChipDataRead(UINT32 Offset); -void OpwolfCChipStatusWrite(); -void OpwolfCChipBankWrite(UINT16 Data); -void OpwolfCChipDataWrite(UINT8 *p68kRom, UINT32 Offset, UINT16 Data ); -void OpwolfCChipReset(); -void OpwolfCChipInit(INT32 Region); -void OpwolfCChipExit(); -void OpwolfCChipScan(INT32 nAction); - -void BonzeWriteCChipRam(INT32 offset, INT32 data); -void BonzeWriteCChipBank(INT32 data); -UINT16 BonzeReadCChipRam(INT32 offset); -void BonzeCChipReset(); -void BonzeCChipScan(INT32 nAction); - -void VolfiedCChipBankWrite(UINT16 data); -void VolfiedCChipRamWrite(INT32 offset, UINT8 data); -UINT8 VolfiedCChipCtrlRead(); -UINT8 VolfiedCChipRamRead(INT32 offset); -void VolfiedCChipInit(); -void VolfiedCChipReset(); -void VolfiedCChipExit(); -void VolfiedCChipScan(INT32 nAction); - -// PC080SN -#define PC080SN_MAX_CHIPS 2 - -extern UINT8 *PC080SNRam[PC080SN_MAX_CHIPS]; - -void PC080SNDrawBgLayer(INT32 Chip, INT32 Opaque, UINT8 *pSrc, UINT16 *pDest); -void PC080SNDrawFgLayer(INT32 Chip, INT32 Opaque, UINT8 *pSrc, UINT16 *pDest); -void PC080SNDrawBgLayerPrio(INT32 Chip, INT32 Opaque, UINT8 *pSrc, UINT16 *pDest, UINT16 *PriBuf, UINT16 Prio); -void PC080SNDrawFgLayerPrio(INT32 Chip, INT32 Opaque, UINT8 *pSrc, UINT16 *pDest, UINT16 *PriBuf, UINT16 Prio); -void PC080SNSetScrollX(INT32 Chip, UINT32 Offset, UINT16 Data); -void PC080SNSetScrollY(INT32 Chip, UINT32 Offset, UINT16 Data); -void PC080SNCtrlWrite(INT32 Chip, UINT32 Offset, UINT16 Data); -void PC080SNOverrideFgScroll(INT32 Chip, INT32 xScroll, INT32 yScroll); -void PC080SNReset(); -void PC080SNInit(INT32 Chip, INT32 nNumTiles, INT32 xOffset, INT32 yOffset, INT32 yInvert, INT32 DblWidth); -void PC080SNSetFgTransparentPen(INT32 Chip, INT32 Pen); -void PC080SNExit(); -void PC080SNScan(INT32 nAction); -void TopspeedDrawBgLayer(INT32 Chip, UINT8 *pSrc, UINT16 *pDest, UINT16 *ColourCtrlRam, UINT16 *PriBuf, UINT16 Prio); -void TopspeedDrawFgLayer(INT32 Chip, UINT8 *pSrc, UINT16 *pDest, UINT16 *ColourCtrlRam, UINT16 *PriBuf, UINT16 Prio); - -// PC090OJ -extern UINT8 *PC090OJRam; -extern INT32 PC090OJSpriteCtrl; - -void PC090OJDrawSprites(UINT8 *pSrc); -void PC090OJReset(); -void PC090OJInit(INT32 nNumTiles, INT32 xOffset, INT32 yOffset, INT32 UseBuffer); -void PC090OJSetPaletteOffset(INT32 Offset); -void PC090OJExit(); -void PC090OJScan(INT32 nAction); - -// TC0100SCN -#define TC0100SCN_MAX_CHIPS 3 - -extern UINT8 *TC0100SCNRam[TC0100SCN_MAX_CHIPS]; -extern UINT16 TC0100SCNCtrl[TC0100SCN_MAX_CHIPS][8]; -extern UINT8 TC0100SCNBgLayerUpdate[TC0100SCN_MAX_CHIPS]; -extern UINT8 TC0100SCNFgLayerUpdate[TC0100SCN_MAX_CHIPS]; -extern UINT8 TC0100SCNCharLayerUpdate[TC0100SCN_MAX_CHIPS]; -extern UINT8 TC0100SCNCharRamUpdate[TC0100SCN_MAX_CHIPS]; -extern INT32 TC0100SCNDblWidth[TC0100SCN_MAX_CHIPS]; - -void TC0100SCNCtrlWordWrite(INT32 Chip, UINT32 Offset, UINT16 Data); -INT32 TC0100SCNBottomLayer(INT32 Chip); -void TC0100SCNRenderBgLayer(INT32 Chip, INT32 Opaque, UINT8 *pSrc, INT32 Priority = 1); -void TC0100SCNRenderFgLayer(INT32 Chip, INT32 Opaque, UINT8 *pSrc, INT32 Priority = 2); -void TC0100SCNRenderCharLayer(INT32 Chip); -void TC0100SCNReset(); -void TC0100SCNInit(INT32 Chip, INT32 nNumTiles, INT32 xOffset, INT32 yOffset, INT32 xFlip, UINT8 *PriorityMap); -void TC0100SCNSetColourDepth(INT32 Chip, INT32 ColourDepth); -void TC0100SCNSetGfxMask(INT32 Chip, INT32 Mask); -void TC0100SCNSetGfxBank(INT32 Chip, INT32 Bank); -void TC0100SCNSetClipArea(INT32 Chip, INT32 ClipWidth, INT32 ClipHeight, INT32 ClipStartX); -void TC0100SCNSetPaletteOffset(INT32 Chip, INT32 PaletteOffset); -void TC0100SCNExit(); -void TC0100SCNScan(INT32 nAction); - -// TC0110PCR -extern UINT32 *TC0110PCRPalette; -extern INT32 TC0110PCRTotalColours; - -UINT16 TC0110PCRWordRead(INT32 Chip); -void TC0110PCRWordWrite(INT32 Chip, INT32 Offset, UINT16 Data); -void TC0110PCRStep1WordWrite(INT32 Chip, INT32 Offset, UINT16 Data); -void TC0110PCRStep1RBSwapWordWrite(INT32 Chip, INT32 Offset, UINT16 Data); -void TC0110PCRStep14rbgWordWrite(INT32 Chip, INT32 Offset, UINT16 Data); -void TC0110PCRReset(); -void TC0110PCRInit(INT32 Num, INT32 nNumColours); -void TC0110PCRExit(); -void TC0110PCRScan(INT32 nAction); - -// TC0140SYT -void TC0140SYTPortWrite(UINT8 Data); -UINT8 TC0140SYTCommRead(); -void TC0140SYTCommWrite(UINT8 Data); -void TC0140SYTSlavePortWrite(UINT8 Data); -UINT8 TC0140SYTSlaveCommRead(); -void TC0140SYTSlaveCommWrite(UINT8 Data); -void TC0140SYTReset(); -void TC0140SYTInit(INT32 nCpu); -void TC0140SYTExit(); -void TC0140SYTScan(INT32 nAction); - -// TC0150ROD -extern UINT8 *TC0150RODRom; -extern UINT8 *TC0150RODRam; - -void TC0150RODDraw(INT32 yOffs, INT32 pOffs, INT32 Type, INT32 RoadTrans, INT32 LowPriority, INT32 HighPriority); -void TC0150RODReset(); -void TC0150RODInit(INT32 nRomSize, INT32 xFlip); -void TC0150RODSetPriMap(UINT8 *PriMap); -void TC0150RODExit(); -void TC0150RODScan(INT32 nAction); - -// TC0180VCU -extern UINT8 *TC0180VCURAM; -extern UINT8 *TC0180VCUScrollRAM; -extern UINT8 *TC0180VCUFbRAM; - -void TC0180VCUInit(UINT8 *gfx0, INT32 mask0, UINT8 *gfx1, INT32 mask1, INT32 global_x, INT32 global_y); -void TC0180VCUReset(); -void TC0180VCUExit(); -void TC0180VCUScan(INT32 nAction); - -void TC0180VCUDrawCharLayer(INT32 colorbase); -void TC0180VCUDrawLayer(INT32 colorbase, INT32 ctrl_offset, INT32 transparent); - -void TC0180VCUFramebufferDraw(INT32 priority, INT32 color_base); -void TC0180VCUDrawSprite(UINT16 *dest); -void TC0180VCUBufferSprites(); - -UINT16 TC0180VCUFramebufferRead(INT32 offset); -void TC0180VCUFramebufferWrite(INT32 offset); - -UINT8 TC0180VCUReadRegs(INT32 offset); -void TC0180VCUWriteRegs(INT32 offset, INT32 data); -UINT8 TC0180VCUReadControl(); - -// TC0220IOC -extern UINT8 TC0220IOCInputPort0[8]; -extern UINT8 TC0220IOCInputPort1[8]; -extern UINT8 TC0220IOCInputPort2[8]; -extern UINT8 TC0220IOCDip[2]; -extern UINT8 TC0220IOCInput[6]; - -UINT8 TC0220IOCPortRead(); -UINT8 TC0220IOCHalfWordPortRead(); -UINT8 TC0220IOCPortRegRead(); -UINT8 TC0220IOCHalfWordRead(INT32 Offset); -UINT8 TC0220IOCRead(UINT8 Port); -void TC0220IOCWrite(UINT8 Port, UINT8 Data); -void TC0220IOCHalfWordPortRegWrite(UINT16 Data); -void TC0220IOCHalfWordPortWrite(UINT16 Data); -void TC0220IOCHalfWordWrite(INT32 Offset, UINT16 Data); -void TC0220IOCReset(); -void TC0220IOCInit(); -void TC0220IOCExit(); -void TC0220IOCScan(INT32 nAction); - -// TC0280GRD -extern UINT8 *TC0280GRDRam; -extern INT32 TC0280GRDBaseColour; - -void TC0280GRDRenderLayer(); -void TC0280GRDCtrlWordWrite(UINT32 Offset, UINT16 Data); -void TC0280GRDReset(); -void TC0280GRDInit(INT32 xOffs, INT32 yOffs, UINT8 *pSrc); -void TC0430GRWInit(INT32 xOffs, INT32 yOffs, UINT8 *pSrc); -void TC0280GRDExit(); -void TC0280GRDScan(INT32 nAction); - -#define TC0430GRWRam TC0280GRDRam -#define TC0430GRWRenderLayer TC0280GRDRenderLayer -#define TC0430GRWCtrlWordWrite TC0280GRDCtrlWordWrite -#define TC0430GRWReset TC0280GRDReset -#define TC0430GRWExit TC0280GRDExit -#define TC0430GRWScan TC0280GRDScan - -// TC0360PRI -extern UINT8 TC0360PRIRegs[16]; - -void TC0360PRIWrite(UINT32 Offset, UINT8 Data); -void TC0360PRIHalfWordWrite(UINT32 Offset, UINT16 Data); -void TC0360PRIHalfWordSwapWrite(UINT32 Offset, UINT16 Data); -void TC0360PRIReset(); -void TC0360PRIInit(); -void TC0360PRIExit(); -void TC0360PRIScan(INT32 nAction); - -// TC0480SCP -extern UINT8 *TC0480SCPRam; -extern UINT16 TC0480SCPCtrl[0x18]; - -void TC0480SCPCtrlWordWrite(INT32 Offset, UINT16 Data); -void TC0480SCPTilemapRender(INT32 Layer, INT32 Opaque, UINT8 *pSrc); -void TC0480SCPTilemapRenderPrio(INT32 Layer, INT32 Opaque, INT32 Prio, UINT8 *pSrc); -void TC0480SCPRenderCharLayer(); -void TC0480SCPReset(); -INT32 TC0480SCPGetBgPriority(); -void TC0480SCPSetPriMap(UINT8 *PriMap); -void TC0480SCPInit(INT32 nNumTiles, INT32 Pixels, INT32 xOffset, INT32 yOffset, INT32 xTextOffset, INT32 yTextOffset, INT32 VisYOffset); -void TC0480SCPSetColourBase(INT32 Base); -void TC0480SCPExit(); -void TC0480SCPScan(INT32 nAction); - -// TC0510NIO -extern UINT8 TC0510NIOInputPort0[8]; -extern UINT8 TC0510NIOInputPort1[8]; -extern UINT8 TC0510NIOInputPort2[8]; -extern UINT8 TC0510NIODip[2]; -extern UINT8 TC0510NIOInput[3]; - -UINT16 TC0510NIOHalfWordRead(INT32 Offset); -UINT16 TC0510NIOHalfWordSwapRead(INT32 Offset); -void TC0510NIOHalfWordWrite(INT32 Offset, UINT16 Data); -void TC0510NIOHalfWordSwapWrite(INT32 Offset, UINT16 Data); -void TC0510NIOReset(); -void TC0510NIOInit(); -void TC0510NIOExit(); -void TC0510NIOScan(INT32 nAction); - -// TC0640FIO -extern UINT8 TC0640FIOInputPort0[8]; -extern UINT8 TC0640FIOInputPort1[8]; -extern UINT8 TC0640FIOInputPort2[8]; -extern UINT8 TC0640FIOInputPort3[8]; -extern UINT8 TC0640FIOInputPort4[8]; -extern UINT8 TC0640FIOInput[5]; - -UINT8 TC0640FIORead(UINT32 Offset); -void TC0640FIOWrite(UINT32 Offset, UINT8 Data); -UINT16 TC0640FIOHalfWordRead(UINT32 Offset); -void TC0640FIOHalfWordWrite(UINT32 Offset, UINT16 Data); -UINT16 TC0640FIOHalfWordByteswapRead(UINT32 Offset); -void TC0640FIOHalfWordByteswapWrite(UINT32 Offset, UINT16 Data); -void TC0640FIOReset(); -void TC0640FIOInit(); -void TC0640FIOExit(); -void TC0640FIOScan(INT32 nAction); - -#define TC0100SCN0CtrlWordWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - TC0100SCNCtrlWordWrite(0, (a - base_address) >> 1, d); \ - return; \ - } - -#define TC0100SCN1CtrlWordWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - TC0100SCNCtrlWordWrite(1, (a - base_address) >> 1, d); \ - return; \ - } - -#define TC0100SCN2CtrlWordWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - TC0100SCNCtrlWordWrite(2, (a - base_address) >> 1, d); \ - return; \ - } - -#define TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_BYTE(chip_num) \ - if (TC0100SCNDblWidth[chip_num]) { \ - if (Offset >= 0x0000 && Offset < 0x8000) { \ - TC0100SCNBgLayerUpdate[chip_num] = 1; \ - } \ - } else { \ - if (Offset >= 0x0000 && Offset < 0x4000) { \ - TC0100SCNBgLayerUpdate[chip_num] = 1; \ - } \ - } - -#define TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_WORD(chip_num) \ - if (TC0100SCNDblWidth[chip_num]) { \ - if (Offset >= 0x0000/2 && Offset < 0x8000/2) { \ - TC0100SCNBgLayerUpdate[chip_num] = 1; \ - } \ - } else { \ - if (Offset >= 0x0000/2 && Offset < 0x4000/2) { \ - TC0100SCNBgLayerUpdate[chip_num] = 1; \ - } \ - } - -#define TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_BYTE(chip_num) \ - if (TC0100SCNDblWidth[chip_num]) { \ - if (Offset >= 0x8000 && Offset < 0x10000) { \ - TC0100SCNFgLayerUpdate[chip_num] = 1; \ - } \ - } else { \ - if (Offset >= 0x0000 && Offset < 0x8000) { \ - TC0100SCNFgLayerUpdate[chip_num] = 1; \ - } \ - } - -#define TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_WORD(chip_num) \ - if (TC0100SCNDblWidth[chip_num]) { \ - if (Offset >= 0x8000/2 && Offset < 0x10000/2) { \ - TC0100SCNFgLayerUpdate[chip_num] = 1; \ - } \ - } else { \ - if (Offset >= 0x8000/2 && Offset < 0xc000/2) { \ - TC0100SCNFgLayerUpdate[chip_num] = 1; \ - } \ - } - -#define TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_BYTE(chip_num) \ - if (TC0100SCNDblWidth[chip_num]) { \ - if (Offset >= 0x12000 && Offset < 0x14000) { \ - TC0100SCNCharLayerUpdate[chip_num] = 1; \ - } \ - if (Offset >= 0x11000 && Offset < 0x12000) { \ - TC0100SCNCharRamUpdate[chip_num] = 1; \ - } \ - } else { \ - if (Offset >= 0x4000 && Offset < 0x6000) { \ - TC0100SCNCharLayerUpdate[chip_num] = 1; \ - } \ - if (Offset >= 0x6000 && Offset < 0x7000) { \ - TC0100SCNCharRamUpdate[chip_num] = 1; \ - } \ - } - -#define TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_WORD(chip_num) \ - if (TC0100SCNDblWidth[chip_num]) { \ - if (Offset >= 0x12000/2 && Offset < 0x14000/2) { \ - TC0100SCNCharLayerUpdate[chip_num] = 1; \ - } \ - if (Offset >= 0x11000/2 && Offset < 0x12000/2) { \ - TC0100SCNCharRamUpdate[chip_num] = 1; \ - } \ - } else { \ - if (Offset >= 0x4000/2 && Offset < 0x6000/2) { \ - TC0100SCNCharLayerUpdate[chip_num] = 1; \ - } \ - if (Offset >= 0x6000/2 && Offset < 0x7000/2) { \ - TC0100SCNCharRamUpdate[chip_num] = 1; \ - } \ - } - -#define TC0100SCN0ByteWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - INT32 Offset = (a - start) ^ 1; \ - if (TC0100SCNRam[0][Offset] != d) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_BYTE(0) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_BYTE(0) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_BYTE(0) \ - } \ - TC0100SCNRam[0][Offset] = d; \ - return; \ - } - -#define TC0100SCN0WordWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - UINT16 *Ram = (UINT16*)TC0100SCNRam[0]; \ - INT32 Offset = (a - start) >> 1; \ - if (Ram[Offset] != BURN_ENDIAN_SWAP_INT16(d)) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_WORD(0) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_WORD(0) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_WORD(0) \ - } \ - Ram[Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - return; \ - } - -#define TC0100SCN1ByteWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - INT32 Offset = (a - start) ^ 1; \ - if (TC0100SCNRam[1][Offset] != d) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_BYTE(1) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_BYTE(1) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_BYTE(1) \ - } \ - TC0100SCNRam[1][Offset] = d; \ - return; \ - } - -#define TC0100SCN1WordWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - UINT16 *Ram = (UINT16*)TC0100SCNRam[1]; \ - INT32 Offset = (a - start) >> 1; \ - if (Ram[Offset] != BURN_ENDIAN_SWAP_INT16(d)) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_WORD(1) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_WORD(1) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_WORD(1) \ - } \ - Ram[Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - return; \ - } - -#define TC0100SCN2ByteWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - INT32 Offset = (a - start) ^ 1; \ - if (TC0100SCNRam[2][Offset] != d) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_BYTE(2) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_BYTE(2) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_BYTE(2) \ - } \ - TC0100SCNRam[2][Offset] = d; \ - return; \ - } - -#define TC0100SCN2WordWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - UINT16 *Ram = (UINT16*)TC0100SCNRam[2]; \ - INT32 Offset = (a - start) >> 1; \ - if (Ram[Offset] != BURN_ENDIAN_SWAP_INT16(d)) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_WORD(2) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_WORD(2) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_WORD(2) \ - } \ - Ram[Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - return; \ - } - -#define TC0100SCNDualScreenByteWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - INT32 Offset = (a - start) ^ 1; \ - if (TC0100SCNRam[0][Offset] != d) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_BYTE(0) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_BYTE(0) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_BYTE(0) \ - } \ - if (TC0100SCNRam[1][Offset] != d) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_BYTE(1) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_BYTE(1) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_BYTE(1) \ - } \ - TC0100SCNRam[0][Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - TC0100SCNRam[1][Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - return; \ - } - -#define TC0100SCNDualScreenWordWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - UINT16 *Ram0 = (UINT16*)TC0100SCNRam[0]; \ - UINT16 *Ram1 = (UINT16*)TC0100SCNRam[1]; \ - INT32 Offset = (a - start) >> 1; \ - if (Ram0[Offset] != BURN_ENDIAN_SWAP_INT16(d)) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_WORD(0) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_WORD(0) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_WORD(0) \ - } \ - if (Ram1[Offset] != BURN_ENDIAN_SWAP_INT16(d)) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_WORD(1) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_WORD(1) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_WORD(1) \ - } \ - Ram0[Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - Ram1[Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - return; \ - } - -#define TC0100SCNTripleScreenByteWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - INT32 Offset = (a - start) ^ 1; \ - if (TC0100SCNRam[0][Offset] != d) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_BYTE(0) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_BYTE(0) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_BYTE(0) \ - } \ - if (TC0100SCNRam[1][Offset] != d) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_BYTE(1) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_BYTE(1) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_BYTE(1) \ - } \ - if (TC0100SCNRam[2][Offset] != d) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_BYTE(2) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_BYTE(2) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_BYTE(2) \ - } \ - TC0100SCNRam[0][Offset] = d; \ - TC0100SCNRam[1][Offset] = d; \ - TC0100SCNRam[2][Offset] = d; \ - return; \ - } - -#define TC0100SCNTripleScreenWordWrite_Map(start, end) \ - if (a >= start && a <= end) { \ - UINT16 *Ram0 = (UINT16*)TC0100SCNRam[0]; \ - UINT16 *Ram1 = (UINT16*)TC0100SCNRam[1]; \ - UINT16 *Ram2 = (UINT16*)TC0100SCNRam[2]; \ - INT32 Offset = (a - start) >> 1; \ - if (Ram0[Offset] != BURN_ENDIAN_SWAP_INT16(d)) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_WORD(0) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_WORD(0) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_WORD(0) \ - } \ - if (Ram1[Offset] != BURN_ENDIAN_SWAP_INT16(d)) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_WORD(1) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_WORD(1) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_WORD(1) \ - } \ - if (Ram2[Offset] != BURN_ENDIAN_SWAP_INT16(d)) { \ - TC0100SCN_CHECK_BG_LAYER_NEED_UPDATE_WORD(2) \ - TC0100SCN_CHECK_FG_LAYER_NEED_UPDATE_WORD(2) \ - TC0100SCN_CHECK_CHAR_LAYER_NEED_UPDATE_WORD(2) \ - } \ - Ram0[Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - Ram1[Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - Ram2[Offset] = BURN_ENDIAN_SWAP_INT16(d); \ - return; \ - } - -#define TC0220IOCHalfWordRead_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - return TC0220IOCHalfWordRead((a - base_address) >> 1); \ - } - -#define TC0220IOCHalfWordWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - TC0220IOCHalfWordWrite((a - base_address) >> 1, d); \ - return; \ - } - -#define TC0280GRDCtrlWordWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - TC0280GRDCtrlWordWrite((a - base_address) >> 1, d); \ - return; \ - } - -#define TC0360PRIHalfWordWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x1f) { \ - TC0360PRIHalfWordWrite((a - base_address) >> 1, d); \ - return; \ - } - -#define TC0360PRIHalfWordSwapWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x1f) { \ - TC0360PRIHalfWordSwapWrite((a - base_address) >> 1, d); \ - return; \ - } - -#define TC0430GRWCtrlWordWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - TC0430GRWCtrlWordWrite((a - base_address) >> 1, d); \ - return; \ - } - -#define TC0480SCPCtrlWordWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x2f) { \ - TC0480SCPCtrlWordWrite((a - base_address) >> 1, d); \ - return; \ - } - -#define TC0510NIOHalfWordRead_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - return TC0510NIOHalfWordRead((a - base_address) >> 1); \ - } - -#define TC0510NIOHalfWordSwapRead_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - return TC0510NIOHalfWordSwapRead((a - base_address) >> 1); \ - } - -#define TC0510NIOHalfWordWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - TC0510NIOHalfWordWrite((a - base_address) >> 1, d); \ - return; \ - } - -#define TC0510NIOHalfWordSwapWrite_Map(base_address) \ - if (a >= base_address && a <= base_address + 0x0f) { \ - TC0510NIOHalfWordSwapWrite((a - base_address) >> 1, d); \ - return; \ - } - -#define TC0180VCUHalfWordWrite_Map(base_address) \ - if (a >= (base_address + 0x40000) && a <= (base_address+0x7ffff)) { \ - TC0180VCUFbRAM[(a & 0x3ffff)^1] = d; \ - TC0180VCUFramebufferWrite(a); \ - return; \ - } \ - \ - if (a >= (base_address + 0x18000) && a <= (base_address+0x1801f)) { \ - TC0180VCUWriteRegs(a, d); \ - return; \ - } - -#define TC0180VCUWordWrite_Map(base_address) \ - if (a >= (base_address + 0x40000) && a <= (base_address+0x7ffff)) { \ - *((UINT16*)(TC0180VCUFbRAM + (a & 0x3fffe))) = d; \ - TC0180VCUFramebufferWrite(a); \ - return; \ - } \ - \ - if (a >= (base_address + 0x18000) && a <= (base_address+0x1801f)) { \ - TC0180VCUWriteRegs(a, d >> 8); \ - return; \ - } - -#define TC0180VCUHalfWordRead_Map(base_address) \ - if (a >= (base_address + 0x40000) && a <= (base_address+0x7ffff)) { \ - if (a & 1) return TC0180VCUFramebufferRead(a) >> 8; \ - return TC0180VCUFramebufferRead(a); \ - } \ - \ - if (a >= (base_address + 0x18000) && a <= (base_address+0x1801f)) { \ - return TC0180VCUReadRegs(a); \ - } - -// TC0180VCU doesn't seem to use word access at all diff --git a/jan/src/burn/drv/taito/taito_m68705.cpp b/jan/src/burn/drv/taito/taito_m68705.cpp deleted file mode 100644 index 5d97a8b90..000000000 --- a/jan/src/burn/drv/taito/taito_m68705.cpp +++ /dev/null @@ -1,226 +0,0 @@ -// Based on MAME sources copied to and from various drivers -// who is the original author? - -#include "burnint.h" -#include "taito_m68705.h" - -// taito m68705 protection - -UINT8 portA_in; -UINT8 portA_out; -UINT8 ddrA; -UINT8 portB_in; -UINT8 portB_out; -UINT8 ddrB; -UINT8 portC_in; -UINT8 portC_out; -UINT8 ddrC; - -UINT8 from_main; -UINT8 from_mcu; -INT32 mcu_sent; -INT32 main_sent; - -static struct m68705_interface *ptr; - -void m67805_mcu_write(UINT16 address, UINT8 data) -{ - switch (address & 0x7ff) - { - case 0x0000: - if (ptr->portA_out) { - ptr->portA_out(&data); - } - portA_out = data; - return; - - case 0x0001: - if (ptr->portB_out) { - ptr->portB_out(&data); - } - portB_out = data; - return; - - case 0x0002: - if (ptr->portC_out) { - ptr->portC_out(&data); - } - portC_out = data; - return; - - case 0x0004: - if (ptr->ddrA_out) { - ptr->ddrA_out(&data); - } - ddrA = data; - return; - - case 0x0005: - if (ptr->ddrB_out) { - ptr->ddrB_out(&data); - } - ddrB = data; - return; - - case 0x0006: - if (ptr->ddrC_out) { - ptr->ddrC_out(&data); - } - ddrC = data; - return; - } -} - -UINT8 m67805_mcu_read(UINT16 address) -{ - switch (address & 0x7ff) - { - case 0x0000: - if (ptr->portA_in) { - ptr->portA_in(); - } - return (portA_out & ddrA) | (portA_in & ~ddrA); - - case 0x0001: - if (ptr->portB_in) { - ptr->portB_in(); - } - return (portB_out & ddrB) | (portB_in & ~ddrB); - - case 0x0002: - if (ptr->portC_in) { - ptr->portC_in(); - } - return (portC_out & ddrC) | (portC_in & ~ddrC); - } - - return 0; -} - -void m67805_taito_reset() -{ - m6805Open(0); - m68705Reset(); - m6805Close(); - - portA_in = 0; - portA_out = 0; - ddrA = 0; - portB_in = 0; - portB_out = 0; - ddrB = 0; - portC_in = 0; - portC_out = 0; - ddrC = 0; - - from_main = 0; - from_mcu = 0; - mcu_sent = 0; - main_sent = 0; -} - -void m67805_taito_init(UINT8 *rom, UINT8 *ram, m68705_interface *interface) -{ - ptr = interface; - - m6805Init(1, 0x800 /*max memory range - page size is max range / 0x100*/); - m6805Open(0); - m6805MapMemory(ram, 0x0010, 0x007f, MAP_RAM); - m6805MapMemory(rom + 0x80, 0x0080, 0x07ff, MAP_ROM); - m6805SetWriteHandler(m67805_mcu_write); - m6805SetReadHandler(m67805_mcu_read); - m6805Close(); -} - -void m67805_taito_exit() -{ - portA_in = 0; - portA_out = 0; - ddrA = 0; - portB_in = 0; - portB_out = 0; - ddrB = 0; - portC_in = 0; - portC_out = 0; - ddrC = 0; - - from_main = 0; - from_mcu = 0; - mcu_sent = 0; - main_sent = 0; - - ptr = NULL; - - m6805Exit(); -} - -INT32 m68705_taito_scan(INT32 nAction) -{ - if (nAction & ACB_VOLATILE) { - m6805Scan(nAction); - - SCAN_VAR(portA_in); - SCAN_VAR(portB_in); - SCAN_VAR(portC_in); - SCAN_VAR(ddrA); - SCAN_VAR(ddrB); - SCAN_VAR(ddrC); - SCAN_VAR(portA_out); - SCAN_VAR(portB_out); - SCAN_VAR(portC_out); - - SCAN_VAR(from_main); - SCAN_VAR(from_mcu); - SCAN_VAR(mcu_sent); - SCAN_VAR(main_sent); - } - - return 0; -} - - - - - -void standard_taito_mcu_write(INT32 data) -{ - from_main = data; - main_sent = 1; - m68705SetIrqLine(0, 1 /*ASSERT_LINE*/); -} - -INT32 standard_taito_mcu_read() -{ - mcu_sent = 0; - return from_mcu; -} - -void standard_m68705_portB_out(UINT8 *data) -{ - if ((ddrB & 0x02) && (~*data & 0x02) && (portB_out & 0x02)) - { - portA_in = from_main; - if (main_sent) - m68705SetIrqLine(0, 0 /*CLEAR_LINE*/); - main_sent = 0; - } - if ((ddrB & 0x04) && (*data & 0x04) && (~portB_out & 0x04)) - { - from_mcu = portA_out; - mcu_sent = 1; - } -} - -void standard_m68705_portC_in() -{ - portC_in = 0; - if (main_sent) portC_in |= 0x01; - if (!mcu_sent) portC_in |= 0x02; -} - -m68705_interface standard_m68705_interface = { - NULL /* portA */, standard_m68705_portB_out /* portB */, NULL /* portC */, - NULL /* ddrA */, NULL /* ddrB */, NULL /* ddrC */, - NULL /* portA */, NULL /* portB */, standard_m68705_portC_in /* portC */ -}; - diff --git a/jan/src/burn/drv/taito/taito_m68705.h b/jan/src/burn/drv/taito/taito_m68705.h deleted file mode 100644 index e9b34a923..000000000 --- a/jan/src/burn/drv/taito/taito_m68705.h +++ /dev/null @@ -1,40 +0,0 @@ -#include "m6805_intf.h" - -struct m68705_interface { - void (*portA_out)(UINT8 *data); - void (*portB_out)(UINT8 *data); - void (*portC_out)(UINT8 *data); - void (*ddrA_out)(UINT8 *data); - void (*ddrB_out)(UINT8 *data); - void (*ddrC_out)(UINT8 *data); - void (*portA_in)(); - void (*portB_in)(); - void (*portC_in)(); -}; - -extern UINT8 portA_in; -extern UINT8 portA_out; -extern UINT8 ddrA; -extern UINT8 portB_in; -extern UINT8 portB_out; -extern UINT8 ddrB; -extern UINT8 portC_in; -extern UINT8 portC_out; -extern UINT8 ddrC; - -extern UINT8 from_main; -extern UINT8 from_mcu; -extern INT32 mcu_sent; -extern INT32 main_sent; - -void m67805_taito_reset(); -void m67805_taito_init(UINT8 *rom, UINT8 *ram, m68705_interface *interface); -void m67805_taito_exit(); -INT32 m68705_taito_scan(INT32 nAction); - -void standard_taito_mcu_write(INT32 data); -INT32 standard_taito_mcu_read(); -void standard_m68705_portB_out(UINT8 *data); -void standard_m68705_portC_in(); - -extern m68705_interface standard_m68705_interface; diff --git a/jan/src/burn/drv/taito/taitof3_snd.cpp b/jan/src/burn/drv/taito/taitof3_snd.cpp deleted file mode 100644 index 0672f6213..000000000 --- a/jan/src/burn/drv/taito/taitof3_snd.cpp +++ /dev/null @@ -1,424 +0,0 @@ -// FB Alpha Taito En / F3 sound core -// Based on MAME sources by Bryan McPhail, Aaron Giles, R. Belmont, hap, Philip Bennett - -#include "burnint.h" -#include "m68000_intf.h" -#include "es5506.h" -#include "mb87078.h" -#include "taito.h" - -// Allocate these externally! -UINT8 *TaitoF3SoundRom = NULL; -UINT8 *TaitoF3SoundRam = NULL; -UINT8 *TaitoF3ES5506Rom = NULL; -INT32 TaitoF3ES5506RomSize = 0; -UINT8 *TaitoF3SharedRam = NULL; -UINT8 *TaitoES5510DSPRam = NULL; -UINT32 *TaitoES5510GPR = NULL; -UINT16 *TaitoES5510DRAM = NULL; -double TaitoF3VolumeOffset = 0.0; - -static INT32 TaitoF3Counter; -static INT32 TaitoF3VectorReg; -static INT32 M68681IMR; -static INT32 IMRStatus; -static UINT32 TaitoF3SoundTriggerIRQCycles; -static UINT32 TaitoF3SoundTriggerIRQPulseCycles; -static UINT32 TaitoF3SoundTriggerIRQCycleCounter; -static UINT32 TaitoF3SoundTriggerIRQPulseCycleCounter; -static INT32 TaitoF3SoundTriggerIRQCyclesMode = 0; - -static UINT32 TaitoES5510GPRLatch; -static UINT32 TaitoES5510DOLLatch; -static UINT32 TaitoES5510DILLatch; -static UINT32 TaitoES5510DADRLatch; -static UINT8 TaitoES5510RAMSelect; - -#define IRQ_TRIGGER_OFF 0 -#define IRQ_TRIGGER_ONCE 1 -#define IRQ_TRIGGER_PULSE 2 - -static INT32 TaitoF3CpuNum = 2; - -static INT32 __fastcall TaitoF3SoundIRQCallback(INT32 /*irq*/) -{ - return TaitoF3VectorReg; -} - -static UINT8 __fastcall TaitoF3Sound68KReadByte(UINT32 a) -{ - if (a >= 0x140000 && a <= 0x140fff) { - INT32 Offset = (a & 0xfff) >> 1; - UINT8 *Ram = (UINT8*)TaitoF3SharedRam; - return Ram[Offset^1]; - } - - if (a >= 0x260000 && a <= 0x2601ff) { - INT32 Offset = (a & 0x1ff); - - switch (Offset>>1) - { - case (0x09): return (TaitoES5510DILLatch >> 16) & 0xff; - case (0x0a): return (TaitoES5510DILLatch >> 8) & 0xff; - case (0x0b): return (TaitoES5510DILLatch >> 0) & 0xff; - case (0x12): return 0; - case (0x16): return 0x27; - default: break; - } - - return TaitoES5510DSPRam[Offset]; - } - - if (a >= 0x280000 && a <= 0x28001f) { - INT32 Offset = (a & 0x1f) >> 1; - if (Offset == 0x05) { - INT32 Ret = IMRStatus; - IMRStatus = 0; - return Ret; - } - - if (Offset == 0x0e) return 0x01; - - if (Offset == 0x0f) { - SekSetIRQLine(6, CPU_IRQSTATUS_NONE); - return 0x00; - } - - return 0xff; - } - - if (a >= 0x200000 && a <= 0x20001f) { - INT32 Offset = ((a & 0x1f) >> 1); - INT16 rc = ES5505Read(Offset); - if (Offset&1) rc >>=8; - - return rc&0xff; - } - - bprintf(PRINT_NORMAL, _T("Sound 68K Read byte => %06X\n"), a); - - return 0; -} - -static void __fastcall TaitoF3Sound68KWriteByte(UINT32 a, UINT8 d) -{ - if (a >= 0x140000 && a <= 0x140fff) { - INT32 Offset = (a & 0xfff) >> 1; - UINT8 *Ram = (UINT8*)TaitoF3SharedRam; - Ram[Offset^1] = d; - return; - } - - if (a >= 0x260000 && a <= 0x2601ff) { - INT32 Offset = (a & 0x1ff); - - TaitoES5510DSPRam[Offset] = d; - - switch (Offset>>1) { - case 0x00: TaitoES5510GPRLatch = (TaitoES5510GPRLatch & 0x00ffff) | ((d & 0xff) <<16); return; - case 0x01: TaitoES5510GPRLatch = (TaitoES5510GPRLatch & 0xff00ff) | ((d & 0xff) << 8); return; - case 0x02: TaitoES5510GPRLatch = (TaitoES5510GPRLatch & 0xffff00) | ((d & 0xff) << 0); return; - - case 0x0c: TaitoES5510DOLLatch = (TaitoES5510DOLLatch & 0x00ffff) | ((d & 0xff) <<16); return; - case 0x0d: TaitoES5510DOLLatch = (TaitoES5510DOLLatch & 0xff00ff) | ((d & 0xff) << 8); return; - case 0x0e: TaitoES5510DOLLatch = (TaitoES5510DOLLatch & 0xffff00) | ((d & 0xff) << 0); return; - case 0x0f: { - TaitoES5510DADRLatch = (TaitoES5510DADRLatch & 0x00ffff) | ((d & 0xff) << 16); - if (TaitoES5510DADRLatch > 0x1fffff) { - bprintf(0, _T("Taito F3SND-error: DRAM OVERFLOW! Addr = %X\n"), TaitoES5510DADRLatch); - TaitoES5510DADRLatch &= 0x1fffff; - } - if(TaitoES5510RAMSelect) - TaitoES5510DILLatch = ((UINT32)TaitoES5510DRAM[TaitoES5510DADRLatch] << 8); - else - TaitoES5510DRAM[TaitoES5510DADRLatch] = (TaitoES5510DOLLatch >> 8); - return; - } - case 0x10: TaitoES5510DADRLatch = (TaitoES5510DADRLatch & 0xff00ff) | ((d & 0xff) << 8); return; - case 0x11: TaitoES5510DADRLatch = (TaitoES5510DADRLatch & 0xffff00) | ((d & 0xff) << 0); return; - case 0x14: TaitoES5510RAMSelect = d & 0x80; return; - - case 0x80: if (d < 0xc0) { TaitoES5510GPRLatch = TaitoES5510GPR[d]; return; } - - case 0xa0: if (d < 0xc0) { TaitoES5510GPR[d] = TaitoF3ES5506Rom[(TaitoES5510GPRLatch >> 8) & (TaitoF3ES5506RomSize - 1)]; return; } - - default: return; - } - return; - } - - if (a >= 0x280000 && a <= 0x28001f) { - INT32 Offset = (a & 0x1f) >> 1; - - switch (Offset) { - case 0x04: { - switch ((d >> 4) & 0x07) { - case 0x0: { - return; - } - - case 0x01: { - return; - } - - case 0x02: { - return; - } - - case 0x03: { - //bprintf(PRINT_NORMAL, _T("counter is %04x (/16), so interrupt once in %d cycles\n"), TaitoF3Counter, (16000000 / 2000000) * TaitoF3Counter * 16); - TaitoF3SoundTriggerIRQCyclesMode = IRQ_TRIGGER_ONCE; - TaitoF3SoundTriggerIRQCycleCounter = 0; - TaitoF3SoundTriggerIRQCycles = (16000000 / 2000000) * TaitoF3Counter * 16; - return; - } - - case 0x04: { - return; - } - - case 0x05: { - return; - } - - case 0x06: { - //bprintf(PRINT_NORMAL, _T("counter is %04x, so interrupt every %d cycles\n"), TaitoF3Counter, (16000000 / 2000000) * TaitoF3Counter); - TaitoF3SoundTriggerIRQCyclesMode = IRQ_TRIGGER_PULSE; - TaitoF3SoundTriggerIRQPulseCycleCounter = 0; - TaitoF3SoundTriggerIRQPulseCycles = (16000000 / 2000000) * TaitoF3Counter; - return; - } - - case 0x07: { - return; - } - } - } - - case 0x05: { - M68681IMR = d & 0xff; - return; - } - - case 0x06: { - TaitoF3Counter = ((d & 0xff) << 8) | (TaitoF3Counter & 0xff); - return; - } - - case 0x07: { - TaitoF3Counter = (TaitoF3Counter & 0xff00) | (d & 0xff); - return; - } - - case 0x08: return; - case 0x09: return; - case 0x0a: return; - case 0x0b: return; - - case 0x0c: { - TaitoF3VectorReg = d & 0xff; - return; - } - - default: { -// bprintf(PRINT_NORMAL,_T("f3_68681_w byte %x -> %x\n"), Offset, d); - return; - } - } - } - - if (a >= 0x300000 && a <= 0x30003f) { - UINT32 MaxBanks = (TaitoF3ES5506RomSize / 0x200000) - 1; - INT32 Offset = (a & 0x3f) >> 1; - - d &= MaxBanks; - es5505_voice_bank_w(Offset, d << 20); - return; - } - - if (a >= 0x340000 && a <= 0x340003) { - INT32 Offset = (a & 3) >> 1; - - mb87078_write(Offset^1, d); - return; - } - - bprintf(PRINT_NORMAL, _T("Sound 68K Write byte => %06X, %02X\n"), a, d); -} - -static UINT16 __fastcall TaitoF3Sound68KReadWord(UINT32 a) -{ - if (a >= 0x200000 && a <= 0x20001f) { - INT32 Offset = (a & 0x1f) >> 1; - - return ES5505Read(Offset); - } - - bprintf(PRINT_NORMAL, _T("Sound 68K Read word => %06X\n"), a); - - return 0; -} - -static void __fastcall TaitoF3Sound68KWriteWord(UINT32 a, UINT16 d) -{ - if (a >= 0x200000 && a <= 0x20001f) { - INT32 Offset = (a & 0x1f) >> 1; - ES5505Write(Offset, d); - return; - } - - bprintf(PRINT_NORMAL, _T("Sound 68K Write word => %06X, %04X\n"), a, d); -} - -void TaitoF3VolumeCallback(INT32 offset, INT32 data) -{ - if (offset > 1) { - offset = (offset & 1) ? BURN_SND_ES5506_ROUTE_RIGHT : BURN_SND_ES5506_ROUTE_LEFT; - ES5506SetRoute(0, (double)(data / 100.00) + TaitoF3VolumeOffset, offset); - } -} - -void TaitoF3SoundReset() -{ - memcpy(TaitoF3SoundRam, TaitoF3SoundRom, 8); // copy vectors - -// taito system resets these, but SekReset() is needed to latch the vectors. - { - SekOpen(TaitoF3CpuNum); - SekReset(); - ES5506Reset(); - SekClose(); - } - - TaitoF3Counter = 0; - TaitoF3VectorReg = 0; - TaitoES5510GPRLatch = 0; - TaitoES5510DOLLatch = 0; - TaitoES5510DILLatch = 0; - TaitoES5510DADRLatch = 0; - TaitoES5510RAMSelect = 0; - - M68681IMR = 0; - IMRStatus = 0; - TaitoF3SoundTriggerIRQCycles = 0; - TaitoF3SoundTriggerIRQPulseCycles = 0; - TaitoF3SoundTriggerIRQCycleCounter = 0; - TaitoF3SoundTriggerIRQPulseCycleCounter = 0; - TaitoF3SoundTriggerIRQCyclesMode = 0; - mb87078_reset(); -} - -void TaitoF3SoundExit() -{ - // do not exit Sek here! All known F3 sound drivers have m68ec020 as main! - - TaitoF3SoundRom = NULL; - TaitoF3SoundRam = NULL; - TaitoF3ES5506Rom = NULL; - TaitoF3SharedRam = NULL; - TaitoES5510DSPRam = NULL; - TaitoES5510GPR = NULL; - TaitoF3VolumeOffset = 0.0; - - TaitoF3ES5506RomSize = 0; - - ES5506Exit(); - - mb87078_exit(); -} - -void TaitoF3SoundInit(INT32 cpunum) -{ - TaitoF3CpuNum = cpunum; - - SekInit(TaitoF3CpuNum, 0x68000); - SekOpen(TaitoF3CpuNum); - SekMapMemory(TaitoF3SoundRam , 0x000000, 0x00ffff, MAP_RAM); - SekMapMemory(TaitoF3SoundRam , 0x010000, 0x01ffff, MAP_RAM); - SekMapMemory(TaitoF3SoundRam , 0x020000, 0x02ffff, MAP_RAM); - SekMapMemory(TaitoF3SoundRam , 0x030000, 0x03ffff, MAP_RAM); - SekMapMemory(TaitoF3SoundRom , 0xc00000, 0xcfffff, MAP_ROM); - SekMapMemory(TaitoF3SoundRam , 0xff0000, 0xffffff, MAP_RAM); - SekSetReadByteHandler(0, TaitoF3Sound68KReadByte); - SekSetWriteByteHandler(0, TaitoF3Sound68KWriteByte); - SekSetReadWordHandler(0, TaitoF3Sound68KReadWord); - SekSetWriteWordHandler(0, TaitoF3Sound68KWriteWord); - SekSetIrqCallback(TaitoF3SoundIRQCallback); - SekClose(); - - ES5505Init(30476100/2, TaitoF3ES5506Rom, TaitoF3ES5506Rom, NULL); - - mb87078_init(TaitoF3VolumeCallback); -} - -void TaitoF3CpuUpdate(INT32 nInterleave, INT32 nCurrentSlice) -{ - static INT32 nCyclesDone = 0; - - if (nCurrentSlice == 0) { - nCyclesDone = 0; - } - - INT32 nTotalCycles = (30476100 / 2) / (nBurnFPS / 100); - - SekOpen(TaitoF3CpuNum); - - INT32 nNext = (nCurrentSlice + 1) * nTotalCycles / nInterleave; - INT32 nSegment = nNext - nCyclesDone; - - nCyclesDone += SekRun(nSegment); - - if (TaitoF3SoundTriggerIRQCyclesMode == IRQ_TRIGGER_ONCE) { - TaitoF3SoundTriggerIRQCycleCounter += nSegment; - if (TaitoF3SoundTriggerIRQCycleCounter >= TaitoF3SoundTriggerIRQCycles) { - TaitoF3SoundTriggerIRQCyclesMode = IRQ_TRIGGER_OFF; - if (M68681IMR & 0x08) { - SekSetIRQLine(6, CPU_IRQSTATUS_ACK); - IMRStatus |= 0x08; - } - } - } - - if (TaitoF3SoundTriggerIRQCyclesMode == IRQ_TRIGGER_PULSE) { - TaitoF3SoundTriggerIRQPulseCycleCounter += nSegment; - if (TaitoF3SoundTriggerIRQPulseCycleCounter >= TaitoF3SoundTriggerIRQPulseCycles) { - if (M68681IMR & 0x08) { - SekSetIRQLine(6, CPU_IRQSTATUS_ACK); - IMRStatus |= 0x08; - } - TaitoF3SoundTriggerIRQPulseCycleCounter = 0; - } - } - - SekClose(); -} - -void TaitoF3SoundUpdate(INT16 *pDest, INT32 nLen) -{ - if (pBurnSoundOut) { - ES5505Update(pDest, nLen); - } -} - -INT32 TaitoF3SoundScan(INT32 nAction, INT32 *pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - // SekScan(nAction); // call in driver! - ES5506ScanRoutes(nAction, pnMin); // F3 games change the volume levels in-game - - mb87078_scan(); - - SCAN_VAR(TaitoF3Counter); - SCAN_VAR(TaitoF3VectorReg); - SCAN_VAR(TaitoES5510GPRLatch); - SCAN_VAR(M68681IMR); - SCAN_VAR(IMRStatus); - SCAN_VAR(TaitoF3SoundTriggerIRQCycles); - SCAN_VAR(TaitoF3SoundTriggerIRQPulseCycles); - SCAN_VAR(TaitoF3SoundTriggerIRQCycleCounter); - SCAN_VAR(TaitoF3SoundTriggerIRQPulseCycleCounter); - SCAN_VAR(TaitoF3SoundTriggerIRQCyclesMode); - } - - return 0; -} diff --git a/jan/src/burn/drv/taito/taitof3_snd.h b/jan/src/burn/drv/taito/taitof3_snd.h deleted file mode 100644 index fca6367aa..000000000 --- a/jan/src/burn/drv/taito/taitof3_snd.h +++ /dev/null @@ -1,18 +0,0 @@ -extern UINT8 *TaitoF3SoundRom; // 1 MB -extern UINT8 *TaitoF3SoundRam; // 64 KB -extern UINT8 *TaitoF3ES5506Rom; // variable... -extern UINT8 *TaitoF3SharedRam; // 2 KB -extern UINT8 *TaitoES5510DSPRam; // 512 Bytes -extern UINT32 *TaitoES5510GPR; // 192x4 Bytes -extern UINT16 *TaitoES5510DRAM; // 4 MB -extern INT32 TaitoF3ES5506RomSize; // -extern double TaitoF3VolumeOffset; // Games set their own volume (mb87078), but sometimes it is too low (superchs). - -void TaitoF3SoundReset(); -void TaitoF3SoundExit(); -void TaitoF3SoundInit(INT32 cpunum); // which cpu? - -void TaitoF3CpuUpdate(INT32 nInterleave, INT32 nCurrentSlice); -void TaitoF3SoundUpdate(INT16 *pDest, INT32 nLen); - -INT32 TaitoF3SoundScan(INT32 nAction, INT32 *pnMin); diff --git a/jan/src/burn/drv/taito/taitof3_video.cpp b/jan/src/burn/drv/taito/taitof3_video.cpp deleted file mode 100644 index f05422888..000000000 --- a/jan/src/burn/drv/taito/taitof3_video.cpp +++ /dev/null @@ -1,2891 +0,0 @@ -// see tait_f3.cpp for credits - -#include "tiles_generic.h" -#include "taitof3_video.h" -#include "taito.h" - -UINT32 sprite_lag; -UINT32 extended_layers; - -UINT8 *TaitoF3CtrlRAM; -UINT8 *TaitoF3PfRAM; -UINT8 *TaitoF3LineRAM; - -void (*pPaletteUpdateCallback)(UINT16) = NULL; -UINT8 TaitoF3PalRecalc; - -static UINT16 *pal16 = NULL; // fast palette for 16bpp video emulation - -UINT16 *bitmap_layer[10]; -UINT8 *bitmap_flags[10]; -INT32 bitmap_width[8]; -UINT32 *output_bitmap; - -UINT8 *tile_opaque_sp; -UINT8 *tile_opaque_pf[8]; -UINT8 *dirty_tiles; -UINT8 dirty_tile_count[10]; - -static INT32 flipscreen = 0; -// set each frame -static UINT32 sprite_pen_mask; -static UINT32 sprite_pri_usage; -static INT32 sprite_extra_planes = 0; - -struct tempsprite -{ - INT32 code, color; - INT32 flipx, flipy; - INT32 x, y; - INT32 zoomx, zoomy; - INT32 pri; - INT32 rampos; -}; - -static struct tempsprite *m_spritelist; -static const struct tempsprite *m_sprite_end; - -void TaitoF3VideoReset() -{ - flipscreen = 0; - - sprite_pen_mask = 0; - sprite_pri_usage = 0; - sprite_extra_planes = 0; -} - - -static INT32 min_x = 0; -static INT32 max_x = 512; -static INT32 min_y = 0; -static INT32 max_y = 256; - - -static INT32 m_width_mask=0x3ff; -static INT32 m_twidth_mask=0x7f; -static INT32 m_twidth_mask_bit=7; - -#define ORIENTATION_FLIP_Y 1 - - -static UINT16 *m_src0; -static UINT16 *m_src_s0; -static UINT16 *m_src_e0; -static UINT16 m_clip_al0; -static UINT16 m_clip_ar0; -static UINT16 m_clip_bl0; -static UINT16 m_clip_br0; -static UINT8 *m_tsrc0; -static UINT8 *m_tsrc_s0; -static UINT32 m_x_count0; -static UINT32 m_x_zoom0; -static UINT16 *m_src1; -static UINT16 *m_src_s1; -static UINT16 *m_src_e1; -static UINT16 m_clip_al1; -static UINT16 m_clip_ar1; -static UINT16 m_clip_bl1; -static UINT16 m_clip_br1; -static UINT8 *m_tsrc1; -static UINT8 *m_tsrc_s1; -static UINT32 m_x_count1; -static UINT32 m_x_zoom1; -static UINT16 *m_src2; -static UINT16 *m_src_s2; -static UINT16 *m_src_e2; -static UINT16 m_clip_al2; -static UINT16 m_clip_ar2; -static UINT16 m_clip_bl2; -static UINT16 m_clip_br2; -static UINT8 *m_tsrc2; -static UINT8 *m_tsrc_s2; -static UINT32 m_x_count2; -static UINT32 m_x_zoom2; -static UINT16 *m_src3; -static UINT16 *m_src_s3; -static UINT16 *m_src_e3; -static UINT16 m_clip_al3; -static UINT16 m_clip_ar3; -static UINT16 m_clip_bl3; -static UINT16 m_clip_br3; -static UINT8 *m_tsrc3; -static UINT8 *m_tsrc_s3; -static UINT32 m_x_count3; -static UINT32 m_x_zoom3; -static UINT16 *m_src4; -static UINT16 *m_src_s4; -static UINT16 *m_src_e4; -static UINT16 m_clip_al4; -static UINT16 m_clip_ar4; -static UINT16 m_clip_bl4; -static UINT16 m_clip_br4; -static UINT8 *m_tsrc4; -static UINT8 *m_tsrc_s4; -static UINT32 m_x_count4; -static UINT32 m_x_zoom4; - -static UINT8 m_add_sat[256][256]; - -static INT32 m_f3_alpha_level_2as; -static INT32 m_f3_alpha_level_2ad; -static INT32 m_f3_alpha_level_3as; -static INT32 m_f3_alpha_level_3ad; -static INT32 m_f3_alpha_level_2bs; -static INT32 m_f3_alpha_level_2bd; -static INT32 m_f3_alpha_level_3bs; -static INT32 m_f3_alpha_level_3bd; -static INT32 m_alpha_level_last; - -static INT32 m_alpha_s_1_1; -static INT32 m_alpha_s_1_2; -static INT32 m_alpha_s_1_4; -static INT32 m_alpha_s_1_5; -static INT32 m_alpha_s_1_6; -static INT32 m_alpha_s_1_8; -static INT32 m_alpha_s_1_9; -static INT32 m_alpha_s_1_a; -static INT32 m_alpha_s_2a_0; -static INT32 m_alpha_s_2a_4; -static INT32 m_alpha_s_2a_8; -static INT32 m_alpha_s_2b_0; -static INT32 m_alpha_s_2b_4; -static INT32 m_alpha_s_2b_8; -static INT32 m_alpha_s_3a_0; -static INT32 m_alpha_s_3a_1; -static INT32 m_alpha_s_3a_2; -static INT32 m_alpha_s_3b_0; -static INT32 m_alpha_s_3b_1; -static INT32 m_alpha_s_3b_2; -static UINT32 m_dval; -static UINT8 m_pval; -static UINT8 m_tval; -static UINT8 m_pdest_2a; -static UINT8 m_pdest_2b; -static INT32 m_tr_2a; -static INT32 m_tr_2b; -static UINT8 m_pdest_3a; -static UINT8 m_pdest_3b; -static INT32 m_tr_3a; -static INT32 m_tr_3b; - -#define BYTE4_XOR_LE(x) x - - -struct f3_playfield_line_inf -{ - INT32 alpha_mode[256]; - INT32 pri[256]; - - /* use for draw_scanlines */ - UINT16 *src[256],*src_s[256],*src_e[256]; - UINT8 *tsrc[256],*tsrc_s[256]; - INT32 x_count[256]; - UINT32 x_zoom[256]; - UINT32 clip0[256]; - UINT32 clip1[256]; -}; - -struct f3_spritealpha_line_inf -{ - UINT16 alpha_level[256]; - UINT16 spri[256]; - UINT16 sprite_alpha[256]; - UINT32 sprite_clip0[256]; - UINT32 sprite_clip1[256]; - INT16 clip0_l[256]; - INT16 clip0_r[256]; - INT16 clip1_l[256]; - INT16 clip1_r[256]; -}; - - -static struct f3_playfield_line_inf m_pf_line_inf[5]; -static struct f3_spritealpha_line_inf m_sa_line_inf[1]; - - -static void clear_f3_stuff() -{ - memset(&m_pf_line_inf, 0, sizeof(m_pf_line_inf)); - memset(&m_sa_line_inf, 0, sizeof(m_sa_line_inf)); -} - - -static INT32 (*m_dpix_n[8][16])(UINT32 s_pix); -static INT32 (**m_dpix_lp[5])(UINT32 s_pix); -static INT32 (**m_dpix_sp[9])(UINT32 s_pix); - - -static void draw_pf_layer(INT32 layer) -{ - INT32 offset = (layer * (0x1000 << extended_layers)); - - UINT16 *ram = (UINT16*)(TaitoF3PfRAM + offset); - - INT32 width = extended_layers ? 1024 : 512; - INT32 wide = width / 16; - - // was this layer written at all? skip! - if (extended_layers) { - if (dirty_tile_count[layer*2+0] == 0 && dirty_tile_count[layer*2+1] == 0) { - return; - } - dirty_tile_count[layer*2+0] = dirty_tile_count[layer*2+1] = 0; - } else { - if (dirty_tile_count[layer] == 0) { - return; - } - dirty_tile_count[layer] = 0; - } - - for (INT32 offs = 0; offs < wide * 32; offs++) - { - if (dirty_tiles[((offs * 4) + offset) / 4] == 0) continue; - dirty_tiles[((offs * 4) + offset) / 4] = 0; - - INT32 sx = (offs % wide) * 16; - INT32 sy = (offs / wide) * 16; - - UINT16 tile = ram[offs * 2 + 0]; - UINT16 code = (ram[offs * 2 + 1] & 0xffff) % TaitoCharModulo; - - UINT8 category = (tile >> 9) & 1; - - INT32 explane = (tile >> 10) & 3; - INT32 flipx = (tile >> 14) & 1; - INT32 flipy = (tile >> 15) & 1; - INT32 color = ((tile & 0x1ff) & (~explane)) << 4; - - INT32 penmask = (explane << 4) | 0x0f; - - if (flipscreen) { - sx = (width - 16) - sx; - sy = (512 - 16) - sy; - flipy ^= 1; - flipx ^= 1; - } - - { - INT32 flip = (flipy * 0xf0) + (flipx * 0x0f); - - UINT8 *gfx = TaitoChars + (code * 0x100); - UINT16 *dst = bitmap_layer[layer] + (sy * width) + sx; - UINT8 *flagptr = bitmap_flags[layer] + (sy * width) + sx; - - for (INT32 y = 0; y < 16; y++, sy++, dst += width, flagptr += width) - { - for (INT32 x = 0; x < 16; x++) - { - INT32 pxl = gfx[((y*16)+x)^flip] & penmask; - - dst[x] = pxl + color; - - if (pxl == 0) { - flagptr[x] = category; - } else { - flagptr[x] = category | 0x10; - } - } - } - } - } -} - -static void draw_vram_layer() -{ - UINT16 *ram = (UINT16*)TaitoVideoRam; - - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - INT32 tile = ram[offs] & 0xffff; - - INT32 code = tile & 0x00ff; - - INT32 flipx = tile & 0x0100; - INT32 flipy = tile & 0x8000; - - if (flipscreen) { - sx = (512 - 8) - sx; - sy = (512 - 8) - sy; - flipx ^= 0x100; - flipy ^= 0x8000; - } - - INT32 color = (tile >> 9) & 0x3f; - - { - color *= 16; - UINT8 *gfx = TaitoCharsB + (code * 8 * 8); - - INT32 flip = ((flipy ? 0x38 : 0) | (flipx ? 7 : 0)); - - UINT16 *dst = bitmap_layer[8] + (sy * 512) + sx; - UINT8 *flagptr = bitmap_flags[8] + (sy * 512) + sx; - - for (INT32 y = 0; y < 8; y++) - { - for (INT32 x = 0; x < 8; x++) - { - INT32 pxl = gfx[((y*8)+x)^flip]; - - dst[x] = pxl + color; - - if (pxl == 0) { - flagptr[x] = /*category | */ 0; - } else { - flagptr[x] = /*category | */0x10; - } - } - - dst += 512; - flagptr += 512; - } - } - } -} - -static void draw_pixel_layer() -{ - // was this written? skip! - if (dirty_tile_count[9] == 0) { - // bprintf (0, _T("Skip pixel layer!\n")); - return; - } - dirty_tile_count[9] = 0; - - UINT16 *ram = (UINT16*)TaitoVideoRam; - - UINT16 y_offs = *((UINT16*)(TaitoF3CtrlRAM + 0x1a)) & 0x1ff; - if (flipscreen) y_offs += 0x100; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs / 0x20) * 8; - INT32 sy = (offs & 0x1f) * 8; - - INT32 col_off = ((offs & 0x1f) * 0x40) + ((offs & 0xfe0) >> 5); - - if ((((offs & 0x1f) * 8 + y_offs) & 0x1ff) > 0xff) - col_off += 0x800; - - INT32 tile = ram[col_off]; - - INT32 code = offs; - - INT32 flipx = tile & 0x0100; - INT32 flipy = tile & 0x8000; - - INT32 color = (tile >> 9) & 0x3f; - - if (flipscreen) - { - flipx ^= 0x0100; - flipy ^= 0x8000; - sy = (256 - 8) - sy; - sx = (512 - 8) - sx; - } - - { - color *= 16; - UINT8 *gfx = TaitoCharsPivot + (code * 8 * 8); - - INT32 flip = ((flipy ? 0x38 : 0) | (flipx ? 7 : 0)); - - UINT16 *dst = bitmap_layer[9] + (sy * 512) + sx; - UINT8 *flagptr = bitmap_flags[9] + (sy * 512) + sx; - - for (INT32 y = 0; y < 8; y++) - { - for (INT32 x = 0; x < 8; x++) - { - INT32 pxl = gfx[((y*8)+x)^flip]; - - dst[x] = pxl + color; - - if (pxl == 0) { - flagptr[x] = /*category | */ 0; - } else { - flagptr[x] = /*category | */0x10; - } - } - - dst += 512; - flagptr += 512; - } - } - } -} - - -#define PSET_T \ - c = *source & sprite_pen_mask; \ - if(c) \ - { \ - p=*pri; \ - if(!p || p==0xff) \ - { \ - *dest = pal[c]; \ - *pri = pri_dst; \ - } \ - } - -#define PSET_O \ - p=*pri; \ - if(!p || p==0xff) \ - { \ - *dest = pal[(*source & sprite_pen_mask)]; \ - *pri = pri_dst; \ - } - -#define NEXT_P \ - source += dx; \ - dest++; \ - pri++; - -static void f3_drawgfx( - INT32 code, - INT32 color, - INT32 flipx,INT32 flipy, - INT32 sx,INT32 sy, - UINT8 pri_dst) -{ - pri_dst=1< max_x+1 ) - { /* clip right */ - INT32 pixels = ex-max_x-1; - ex -= pixels; - } - if( ey > max_y+1 ) - { /* clip bottom */ - INT32 pixels = ey-max_y-1; - ey -= pixels; - } - - if( ex>sx && ey>sy) - { /* skip if inner loop doesn't draw anything */ - { - INT32 y=ey-sy; - INT32 x=(ex-sx-1)|(tile_opaque_sp[code]<<4); - const UINT8 *source0 = code_base + y_index * 16 + x_index_base; - UINT32 *dest0 = output_bitmap + sy * 512 + sx; - UINT8 *pri0 = TaitoPriorityMap + sy * 1024 + sx; - - INT32 yadv = 512; - INT32 yadvp = 1024; - - dy=dy*16; - - while(1) - { - const UINT8 *source = source0; - UINT32 *dest = dest0; - UINT8 *pri = pri0; - - switch(x) - { - INT32 c; - UINT8 p; - case 31: PSET_O NEXT_P - case 30: PSET_O NEXT_P - case 29: PSET_O NEXT_P - case 28: PSET_O NEXT_P - case 27: PSET_O NEXT_P - case 26: PSET_O NEXT_P - case 25: PSET_O NEXT_P - case 24: PSET_O NEXT_P - case 23: PSET_O NEXT_P - case 22: PSET_O NEXT_P - case 21: PSET_O NEXT_P - case 20: PSET_O NEXT_P - case 19: PSET_O NEXT_P - case 18: PSET_O NEXT_P - case 17: PSET_O NEXT_P - case 16: PSET_O break; - - case 15: PSET_T NEXT_P - case 14: PSET_T NEXT_P - case 13: PSET_T NEXT_P - case 12: PSET_T NEXT_P - case 11: PSET_T NEXT_P - case 10: PSET_T NEXT_P - case 9: PSET_T NEXT_P - case 8: PSET_T NEXT_P - case 7: PSET_T NEXT_P - case 6: PSET_T NEXT_P - case 5: PSET_T NEXT_P - case 4: PSET_T NEXT_P - case 3: PSET_T NEXT_P - case 2: PSET_T NEXT_P - case 1: PSET_T NEXT_P - case 0: PSET_T - } - - if(!(--y)) break; - source0 += dy; - dest0+=yadv; - pri0+=yadvp; - } - } - } - } - } -} -#undef PSET_T -#undef PSET_O -#undef NEXT_P - - -static void f3_drawgfxzoom( - INT32 code, - INT32 color, - INT32 flipx,INT32 flipy, - INT32 sx,INT32 sy, - INT32 scalex, INT32 scaley, - UINT8 pri_dst) -{ - pri_dst=1< max_x+1 ) - { /* clip right */ - INT32 pixels = ex-max_x-1; - ex -= pixels; - } - if( ey > max_y+1 ) - { /* clip bottom */ - INT32 pixels = ey-max_y-1; - ey -= pixels; - } - - if( ex>sx ) - { /* skip if inner loop doesn't draw anything */ - { - INT32 y; - for( y=sy; y>16) * 16; - UINT32 *dest = output_bitmap + y * 512; - UINT8 *pri = TaitoPriorityMap + y * 1024; - - INT32 x, x_index = x_index_base; - for( x=sx; x>16] & sprite_pen_mask; - if(c) - { - UINT8 p=pri[x]; - if (p == 0 || p == 0xff) - { - dest[x] = pal[c]; - pri[x] = pri_dst; - } - } - x_index += dx; - } - y_index += dy; - } - } - } - } - } -} - - -#define CALC_ZOOM(p) { \ - p##_addition = 0x100 - block_zoom_##p + p##_addition_left; \ - p##_addition_left = p##_addition & 0xf; \ - p##_addition = p##_addition >> 4; \ - /*zoom##p = p##_addition << 12;*/ \ -} - -static void get_sprite_info(UINT16 *spriteram16_ptr) -{ -#define DARIUSG_KLUDGE - - INT32 offs,spritecont,flipx,flipy,/*old_x,*/color,x,y; - INT32 sprite,global_x=0,global_y=0,subglobal_x=0,subglobal_y=0; - INT32 block_x=0, block_y=0; - INT32 last_color=0,last_x=0,last_y=0,block_zoom_x=0,block_zoom_y=0; - INT32 this_x,this_y; - INT32 y_addition=16, x_addition=16; - INT32 multi=0; - INT32 sprite_top; - - INT32 x_addition_left = 8, y_addition_left = 8; - - struct tempsprite *sprite_ptr = m_spritelist; - - INT32 total_sprites=0; - INT32 jumpcnt = 0; - - color=0; - flipx=flipy=0; - //old_x=0; - y=x=0; - - sprite_top=0x2000; - for (offs = 0; offs < sprite_top && (total_sprites < 0x400); offs += 8) - { - const INT32 current_offs=offs; /* Offs can change during loop, current_offs cannot */ - - /* Check if the sprite list jump command bit is set */ - if ((spriteram16_ptr[current_offs+6+0]) & 0x8000) { - UINT32 jump = (spriteram16_ptr[current_offs+6+0])&0x3ff; - - INT32 new_offs=((offs&0x4000)|((jump<<4)/2)); - if (new_offs==offs || jumpcnt > 250) - break; - offs=new_offs - 8; - jumpcnt++; - } - - /* Check if special command bit is set */ - if (spriteram16_ptr[current_offs+2+1] & 0x8000) { - UINT32 cntrl=(spriteram16_ptr[current_offs+4+1])&0xffff; - flipscreen=cntrl&0x2000; - - /* cntrl&0x1000 = disabled? (From F2 driver, doesn't seem used anywhere) - cntrl&0x0010 = ??? - cntrl&0x0020 = ??? - */ - - sprite_extra_planes = (cntrl & 0x0300) >> 8; // 0 = 4bpp, 1 = 5bpp, 2 = unused?, 3 = 6bpp - sprite_pen_mask = (sprite_extra_planes << 4) | 0x0f; - - /* Sprite bank select */ - if (cntrl&1) { - offs=offs|0x4000; - sprite_top=sprite_top|0x4000; - } - } - - /* Set global sprite scroll */ - if (((spriteram16_ptr[current_offs+2+0]) & 0xf000) == 0xa000) { - global_x = (spriteram16_ptr[current_offs+2+0]) & 0xfff; - if (global_x >= 0x800) global_x -= 0x1000; - global_y = spriteram16_ptr[current_offs+2+1] & 0xfff; - if (global_y >= 0x800) global_y -= 0x1000; - } - - /* And sub-global sprite scroll */ - if (((spriteram16_ptr[current_offs+2+0]) & 0xf000) == 0x5000) { - subglobal_x = (spriteram16_ptr[current_offs+2+0]) & 0xfff; - if (subglobal_x >= 0x800) subglobal_x -= 0x1000; - subglobal_y = spriteram16_ptr[current_offs+2+1] & 0xfff; - if (subglobal_y >= 0x800) subglobal_y -= 0x1000; - } - - if (((spriteram16_ptr[current_offs+2+0]) & 0xf000) == 0xb000) { - subglobal_x = (spriteram16_ptr[current_offs+2+0]) & 0xfff; - if (subglobal_x >= 0x800) subglobal_x -= 0x1000; - subglobal_y = spriteram16_ptr[current_offs+2+1] & 0xfff; - if (subglobal_y >= 0x800) subglobal_y -= 0x1000; - global_y=subglobal_y; - global_x=subglobal_x; - } - - /* A real sprite to process! */ - sprite = (spriteram16_ptr[current_offs+0+0]) | ((spriteram16_ptr[current_offs+4+1]&1)<<16); - spritecont = spriteram16_ptr[current_offs+4+0]>>8; - -/* These games either don't set the XY control bits properly (68020 bug?), or - have some different mode from the others */ -#ifdef DARIUSG_KLUDGE - if (f3_game==DARIUSG || f3_game==GEKIRIDO || f3_game==CLEOPATR || f3_game==RECALH) - multi=spritecont&0xf0; -#endif - - /* Check if this sprite is part of a continued block */ - if (multi) { - /* Bit 0x4 is 'use previous colour' for this block part */ - if (spritecont&0x4) color=last_color; - else color=(spriteram16_ptr[current_offs+4+0])&0xff; - -#ifdef DARIUSG_KLUDGE - if (f3_game==DARIUSG || f3_game==GEKIRIDO || f3_game==CLEOPATR || f3_game==RECALH) { - /* Adjust X Position */ - if ((spritecont & 0x40) == 0) { - if (spritecont & 0x4) { - x = block_x; - } else { - this_x = spriteram16_ptr[current_offs+2+0]; - if (this_x&0x800) this_x= 0 - (0x800 - (this_x&0x7ff)); else this_x&=0x7ff; - - if ((spriteram16_ptr[current_offs+2+0])&0x8000) { - this_x+=0; - } else if ((spriteram16_ptr[current_offs+2+0])&0x4000) { - /* Ignore subglobal (but apply global) */ - this_x+=global_x; - } else { /* Apply both scroll offsets */ - this_x+=global_x+subglobal_x; - } - - x = block_x = this_x; - } - x_addition_left = 8; - CALC_ZOOM(x) - } - else if ((spritecont & 0x80) != 0) { - x = last_x+x_addition; - CALC_ZOOM(x) - } - - /* Adjust Y Position */ - if ((spritecont & 0x10) == 0) { - if (spritecont & 0x4) { - y = block_y; - } else { - this_y = spriteram16_ptr[current_offs+2+1]&0xffff; - if (this_y&0x800) this_y= 0 - (0x800 - (this_y&0x7ff)); else this_y&=0x7ff; - - if ((spriteram16_ptr[current_offs+2+0])&0x8000) { - this_y+=0; - } else if ((spriteram16_ptr[current_offs+2+0])&0x4000) { - /* Ignore subglobal (but apply global) */ - this_y+=global_y; - } else { /* Apply both scroll offsets */ - this_y+=global_y+subglobal_y; - } - - y = block_y = this_y; - } - y_addition_left = 8; - CALC_ZOOM(y) - } - else if ((spritecont & 0x20) != 0) { - y = last_y+y_addition; - CALC_ZOOM(y) - } - } else -#endif - { - /* Adjust X Position */ - if ((spritecont & 0x40) == 0) { - x = block_x; - x_addition_left = 8; - CALC_ZOOM(x) - } - else if ((spritecont & 0x80) != 0) { - x = last_x+x_addition; - CALC_ZOOM(x) - } - /* Adjust Y Position */ - if ((spritecont & 0x10) == 0) { - y = block_y; - y_addition_left = 8; - CALC_ZOOM(y) - } - else if ((spritecont & 0x20) != 0) { - y = last_y+y_addition; - CALC_ZOOM(y) - } - /* Both zero = reread block latch? */ - } - } - /* Else this sprite is the possible start of a block */ - else { - color = (spriteram16_ptr[current_offs+4+0])&0xff; - last_color=color; - - /* Sprite positioning */ - this_y = spriteram16_ptr[current_offs+2+1]&0xffff; - this_x = spriteram16_ptr[current_offs+2+0]&0xffff; - if (this_y&0x800) this_y= 0 - (0x800 - (this_y&0x7ff)); else this_y&=0x7ff; - if (this_x&0x800) this_x= 0 - (0x800 - (this_x&0x7ff)); else this_x&=0x7ff; - - /* Ignore both scroll offsets for this block */ - if ((spriteram16_ptr[current_offs+2+0])&0x8000) { - this_x+=0; - this_y+=0; - } else if ((spriteram16_ptr[current_offs+2+0])&0x4000) { - /* Ignore subglobal (but apply global) */ - this_x+=global_x; - this_y+=global_y; - } else { /* Apply both scroll offsets */ - this_x+=global_x+subglobal_x; - this_y+=global_y+subglobal_y; - } - - block_y = y = this_y; - block_x = x = this_x; - - block_zoom_x=spriteram16_ptr[current_offs+0+1]; - block_zoom_y=(block_zoom_x>>8)&0xff; - block_zoom_x&=0xff; - - x_addition_left = 8; - CALC_ZOOM(x) - - y_addition_left = 8; - CALC_ZOOM(y) - } - - /* These features are common to sprite and block parts */ - flipx = spritecont&0x1; - flipy = spritecont&0x2; - multi = spritecont&0x8; - last_x=x; - last_y=y; - - if (!sprite) continue; - if (!x_addition || !y_addition) continue; - - if (flipscreen) - { - INT32 tx,ty; - - tx = 512-x_addition-x; - ty = y; //256-y_addition-y; - - if (tx+x_addition<=min_x || tx>max_x || ty+y_addition<=min_y || ty>max_y) continue; - sprite_ptr->x = tx; - sprite_ptr->y = ty; - sprite_ptr->flipx = !flipx; - sprite_ptr->flipy = flipy; - } - else - { - if (x+x_addition<=min_x || x>max_x || y+y_addition<=min_y || y>max_y) continue; - sprite_ptr->x = x; - sprite_ptr->y = y; - sprite_ptr->flipx = flipx; - sprite_ptr->flipy = flipy; - } - - sprite_ptr->code = sprite % TaitoSpriteAModulo; - sprite_ptr->color = color; - sprite_ptr->zoomx = x_addition; - sprite_ptr->zoomy = y_addition; - sprite_ptr->pri = (color & 0xc0) >> 6; - sprite_ptr->rampos = current_offs & 0x1fff; - //bprintf(0, _T("%X, "), current_offs); - sprite_ptr++; - total_sprites++; - } - - if (f3_game == GSEEKER && TaitoDip[0] & 1) - { // gseeker st.5 boss spriteram overflow corruption fix. - if (total_sprites > 1) { - sprite_ptr--; - INT32 i = 0x1ff8; - while ((sprite_ptr->rampos == i || sprite_ptr->rampos >= i-0x400) && sprite_ptr != m_spritelist) { - i -= 8; - sprite_ptr--; - } - //bprintf(0, _T("last good: %X."), sprite_ptr->rampos); - if (sprite_ptr != m_spritelist) sprite_ptr++; // always one empty sprite at the end. - } - } - - //bprintf(0, _T("\n")); - if (jumpcnt>150) bprintf(0, _T("Sprite Jumps: %d. \n"), jumpcnt); - m_sprite_end = sprite_ptr; -} -#undef CALC_ZOOM - - -static void draw_sprites() -{ - const struct tempsprite *sprite_ptr; - sprite_ptr = m_sprite_end; - sprite_pri_usage=0; - - // if sprites use more than 4bpp, the bottom bits of the color code must be masked out. - // This fixes (at least) stage 1 battle ships and attract mode explosions in Ray Force. - - while (sprite_ptr != m_spritelist) - { - INT32 pri; - sprite_ptr--; - - pri=sprite_ptr->pri; - sprite_pri_usage|=1<zoomx==16 && sprite_ptr->zoomy==16) - f3_drawgfx( - sprite_ptr->code, - sprite_ptr->color & (~sprite_extra_planes), - sprite_ptr->flipx,sprite_ptr->flipy, - sprite_ptr->x,sprite_ptr->y, - pri); - else - f3_drawgfxzoom( - sprite_ptr->code, - sprite_ptr->color & (~sprite_extra_planes), - sprite_ptr->flipx,sprite_ptr->flipy, - sprite_ptr->x,sprite_ptr->y, - sprite_ptr->zoomx,sprite_ptr->zoomy, - pri); - } -} - - -/*============================================================================*/ - -#define SET_ALPHA_LEVEL(d,s) \ -{ \ - INT32 level = s; \ - if(level == 0) level = -1; \ - d = level+1; \ -} - -static inline void f3_alpha_set_level() -{ -// SET_ALPHA_LEVEL(m_alpha_s_1_1, m_f3_alpha_level_2ad) - SET_ALPHA_LEVEL(m_alpha_s_1_1, 255-m_f3_alpha_level_2as) -// SET_ALPHA_LEVEL(m_alpha_s_1_2, m_f3_alpha_level_2bd) - SET_ALPHA_LEVEL(m_alpha_s_1_2, 255-m_f3_alpha_level_2bs) - SET_ALPHA_LEVEL(m_alpha_s_1_4, m_f3_alpha_level_3ad) -// SET_ALPHA_LEVEL(m_alpha_s_1_5, m_f3_alpha_level_3ad*m_f3_alpha_level_2ad/255) - SET_ALPHA_LEVEL(m_alpha_s_1_5, m_f3_alpha_level_3ad*(255-m_f3_alpha_level_2as)/255) -// SET_ALPHA_LEVEL(m_alpha_s_1_6, m_f3_alpha_level_3ad*m_f3_alpha_level_2bd/255) - SET_ALPHA_LEVEL(m_alpha_s_1_6, m_f3_alpha_level_3ad*(255-m_f3_alpha_level_2bs)/255) - SET_ALPHA_LEVEL(m_alpha_s_1_8, m_f3_alpha_level_3bd) -// SET_ALPHA_LEVEL(m_alpha_s_1_9, m_f3_alpha_level_3bd*m_f3_alpha_level_2ad/255) - SET_ALPHA_LEVEL(m_alpha_s_1_9, m_f3_alpha_level_3bd*(255-m_f3_alpha_level_2as)/255) -// SET_ALPHA_LEVEL(m_alpha_s_1_a, m_f3_alpha_level_3bd*m_f3_alpha_level_2bd/255) - SET_ALPHA_LEVEL(m_alpha_s_1_a, m_f3_alpha_level_3bd*(255-m_f3_alpha_level_2bs)/255) - - SET_ALPHA_LEVEL(m_alpha_s_2a_0, m_f3_alpha_level_2as) - SET_ALPHA_LEVEL(m_alpha_s_2a_4, m_f3_alpha_level_2as*m_f3_alpha_level_3ad/255) - SET_ALPHA_LEVEL(m_alpha_s_2a_8, m_f3_alpha_level_2as*m_f3_alpha_level_3bd/255) - - SET_ALPHA_LEVEL(m_alpha_s_2b_0, m_f3_alpha_level_2bs) - SET_ALPHA_LEVEL(m_alpha_s_2b_4, m_f3_alpha_level_2bs*m_f3_alpha_level_3ad/255) - SET_ALPHA_LEVEL(m_alpha_s_2b_8, m_f3_alpha_level_2bs*m_f3_alpha_level_3bd/255) - - SET_ALPHA_LEVEL(m_alpha_s_3a_0, m_f3_alpha_level_3as) - SET_ALPHA_LEVEL(m_alpha_s_3a_1, m_f3_alpha_level_3as*m_f3_alpha_level_2ad/255) - SET_ALPHA_LEVEL(m_alpha_s_3a_2, m_f3_alpha_level_3as*m_f3_alpha_level_2bd/255) - - SET_ALPHA_LEVEL(m_alpha_s_3b_0, m_f3_alpha_level_3bs) - SET_ALPHA_LEVEL(m_alpha_s_3b_1, m_f3_alpha_level_3bs*m_f3_alpha_level_2ad/255) - SET_ALPHA_LEVEL(m_alpha_s_3b_2, m_f3_alpha_level_3bs*m_f3_alpha_level_2bd/255) -} -#undef SET_ALPHA_LEVEL - -#define COLOR1 BYTE4_XOR_LE(0) -#define COLOR2 BYTE4_XOR_LE(1) -#define COLOR3 BYTE4_XOR_LE(2) - -static inline void f3_alpha_blend32_s(INT32 alphas, UINT32 s) -{ - UINT8 *sc = (UINT8 *)&s; - UINT8 *dc = (UINT8 *)&m_dval; - dc[COLOR1] = (alphas * sc[COLOR1]) >> 8; - dc[COLOR2] = (alphas * sc[COLOR2]) >> 8; - dc[COLOR3] = (alphas * sc[COLOR3]) >> 8; -} - -static inline void f3_alpha_blend32_d(INT32 alphas, UINT32 s) -{ - UINT8 *sc = (UINT8 *)&s; - UINT8 *dc = (UINT8 *)&m_dval; - dc[COLOR1] = m_add_sat[dc[COLOR1]][(alphas * sc[COLOR1]) >> 8]; - dc[COLOR2] = m_add_sat[dc[COLOR2]][(alphas * sc[COLOR2]) >> 8]; - dc[COLOR3] = m_add_sat[dc[COLOR3]][(alphas * sc[COLOR3]) >> 8]; -} - -/*============================================================================*/ - -static inline void f3_alpha_blend_1_1(UINT32 s){f3_alpha_blend32_d(m_alpha_s_1_1,s);} -static inline void f3_alpha_blend_1_2(UINT32 s){f3_alpha_blend32_d(m_alpha_s_1_2,s);} -static inline void f3_alpha_blend_1_4(UINT32 s){f3_alpha_blend32_d(m_alpha_s_1_4,s);} -static inline void f3_alpha_blend_1_5(UINT32 s){f3_alpha_blend32_d(m_alpha_s_1_5,s);} -static inline void f3_alpha_blend_1_6(UINT32 s){f3_alpha_blend32_d(m_alpha_s_1_6,s);} -static inline void f3_alpha_blend_1_8(UINT32 s){f3_alpha_blend32_d(m_alpha_s_1_8,s);} -static inline void f3_alpha_blend_1_9(UINT32 s){f3_alpha_blend32_d(m_alpha_s_1_9,s);} -static inline void f3_alpha_blend_1_a(UINT32 s){f3_alpha_blend32_d(m_alpha_s_1_a,s);} - -static inline void f3_alpha_blend_2a_0(UINT32 s){f3_alpha_blend32_s(m_alpha_s_2a_0,s);} -static inline void f3_alpha_blend_2a_4(UINT32 s){f3_alpha_blend32_d(m_alpha_s_2a_4,s);} -static inline void f3_alpha_blend_2a_8(UINT32 s){f3_alpha_blend32_d(m_alpha_s_2a_8,s);} - -static inline void f3_alpha_blend_2b_0(UINT32 s){f3_alpha_blend32_s(m_alpha_s_2b_0,s);} -static inline void f3_alpha_blend_2b_4(UINT32 s){f3_alpha_blend32_d(m_alpha_s_2b_4,s);} -static inline void f3_alpha_blend_2b_8(UINT32 s){f3_alpha_blend32_d(m_alpha_s_2b_8,s);} - -static inline void f3_alpha_blend_3a_0(UINT32 s){f3_alpha_blend32_s(m_alpha_s_3a_0,s);} -static inline void f3_alpha_blend_3a_1(UINT32 s){f3_alpha_blend32_d(m_alpha_s_3a_1,s);} -static inline void f3_alpha_blend_3a_2(UINT32 s){f3_alpha_blend32_d(m_alpha_s_3a_2,s);} - -static inline void f3_alpha_blend_3b_0(UINT32 s){f3_alpha_blend32_s(m_alpha_s_3b_0,s);} -static inline void f3_alpha_blend_3b_1(UINT32 s){f3_alpha_blend32_d(m_alpha_s_3b_1,s);} -static inline void f3_alpha_blend_3b_2(UINT32 s){f3_alpha_blend32_d(m_alpha_s_3b_2,s);} - -/*============================================================================*/ - -static INT32 dpix_1_noalpha(UINT32 s_pix) {m_dval = s_pix; return 1;} -static INT32 dpix_ret1(UINT32 /*s_pix*/) {return 1;} -static INT32 dpix_ret0(UINT32 /*s_pix*/) {return 0;} -static INT32 dpix_1_1(UINT32 s_pix) {if(s_pix) f3_alpha_blend_1_1(s_pix); return 1;} -static INT32 dpix_1_2(UINT32 s_pix) {if(s_pix) f3_alpha_blend_1_2(s_pix); return 1;} -static INT32 dpix_1_4(UINT32 s_pix) {if(s_pix) f3_alpha_blend_1_4(s_pix); return 1;} -static INT32 dpix_1_5(UINT32 s_pix) {if(s_pix) f3_alpha_blend_1_5(s_pix); return 1;} -static INT32 dpix_1_6(UINT32 s_pix) {if(s_pix) f3_alpha_blend_1_6(s_pix); return 1;} -static INT32 dpix_1_8(UINT32 s_pix) {if(s_pix) f3_alpha_blend_1_8(s_pix); return 1;} -static INT32 dpix_1_9(UINT32 s_pix) {if(s_pix) f3_alpha_blend_1_9(s_pix); return 1;} -static INT32 dpix_1_a(UINT32 s_pix) {if(s_pix) f3_alpha_blend_1_a(s_pix); return 1;} - -static INT32 dpix_2a_0(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_2a_0(s_pix); - else m_dval = 0; - if(m_pdest_2a) {m_pval |= m_pdest_2a;return 0;} - return 1; -} -static INT32 dpix_2a_4(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_2a_4(s_pix); - if(m_pdest_2a) {m_pval |= m_pdest_2a;return 0;} - return 1; -} -static INT32 dpix_2a_8(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_2a_8(s_pix); - if(m_pdest_2a) {m_pval |= m_pdest_2a;return 0;} - return 1; -} - -static INT32 dpix_3a_0(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_3a_0(s_pix); - else m_dval = 0; - if(m_pdest_3a) {m_pval |= m_pdest_3a;return 0;} - return 1; -} -static INT32 dpix_3a_1(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_3a_1(s_pix); - if(m_pdest_3a) {m_pval |= m_pdest_3a;return 0;} - return 1; -} -static INT32 dpix_3a_2(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_3a_2(s_pix); - if(m_pdest_3a) {m_pval |= m_pdest_3a;return 0;} - return 1; -} - -static INT32 dpix_2b_0(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_2b_0(s_pix); - else m_dval = 0; - if(m_pdest_2b) {m_pval |= m_pdest_2b;return 0;} - return 1; -} -static INT32 dpix_2b_4(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_2b_4(s_pix); - if(m_pdest_2b) {m_pval |= m_pdest_2b;return 0;} - return 1; -} -static INT32 dpix_2b_8(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_2b_8(s_pix); - if(m_pdest_2b) {m_pval |= m_pdest_2b;return 0;} - return 1; -} - -static INT32 dpix_3b_0(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_3b_0(s_pix); - else m_dval = 0; - if(m_pdest_3b) {m_pval |= m_pdest_3b;return 0;} - return 1; -} -static INT32 dpix_3b_1(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_3b_1(s_pix); - if(m_pdest_3b) {m_pval |= m_pdest_3b;return 0;} - return 1; -} -static INT32 dpix_3b_2(UINT32 s_pix) -{ - if(s_pix) f3_alpha_blend_3b_2(s_pix); - if(m_pdest_3b) {m_pval |= m_pdest_3b;return 0;} - return 1; -} - -static INT32 dpix_2_0(UINT32 s_pix) -{ - UINT8 tr2=m_tval&1; - if(s_pix) - { - if(tr2==m_tr_2b) {f3_alpha_blend_2b_0(s_pix);if(m_pdest_2b) m_pval |= m_pdest_2b;else return 1;} - else if(tr2==m_tr_2a) {f3_alpha_blend_2a_0(s_pix);if(m_pdest_2a) m_pval |= m_pdest_2a;else return 1;} - } - else - { - if(tr2==m_tr_2b) {m_dval = 0;if(m_pdest_2b) m_pval |= m_pdest_2b;else return 1;} - else if(tr2==m_tr_2a) {m_dval = 0;if(m_pdest_2a) m_pval |= m_pdest_2a;else return 1;} - } - return 0; -} -static INT32 dpix_2_4(UINT32 s_pix) -{ - UINT8 tr2=m_tval&1; - if(s_pix) - { - if(tr2==m_tr_2b) {f3_alpha_blend_2b_4(s_pix);if(m_pdest_2b) m_pval |= m_pdest_2b;else return 1;} - else if(tr2==m_tr_2a) {f3_alpha_blend_2a_4(s_pix);if(m_pdest_2a) m_pval |= m_pdest_2a;else return 1;} - } - else - { - if(tr2==m_tr_2b) {if(m_pdest_2b) m_pval |= m_pdest_2b;else return 1;} - else if(tr2==m_tr_2a) {if(m_pdest_2a) m_pval |= m_pdest_2a;else return 1;} - } - return 0; -} -static INT32 dpix_2_8(UINT32 s_pix) -{ - UINT8 tr2=m_tval&1; - if(s_pix) - { - if(tr2==m_tr_2b) {f3_alpha_blend_2b_8(s_pix);if(m_pdest_2b) m_pval |= m_pdest_2b;else return 1;} - else if(tr2==m_tr_2a) {f3_alpha_blend_2a_8(s_pix);if(m_pdest_2a) m_pval |= m_pdest_2a;else return 1;} - } - else - { - if(tr2==m_tr_2b) {if(m_pdest_2b) m_pval |= m_pdest_2b;else return 1;} - else if(tr2==m_tr_2a) {if(m_pdest_2a) m_pval |= m_pdest_2a;else return 1;} - } - return 0; -} - -static INT32 dpix_3_0(UINT32 s_pix) -{ - UINT8 tr2=m_tval&1; - if(s_pix) - { - if(tr2==m_tr_3b) {f3_alpha_blend_3b_0(s_pix);if(m_pdest_3b) m_pval |= m_pdest_3b;else return 1;} - else if(tr2==m_tr_3a) {f3_alpha_blend_3a_0(s_pix);if(m_pdest_3a) m_pval |= m_pdest_3a;else return 1;} - } - else - { - if(tr2==m_tr_3b) {m_dval = 0;if(m_pdest_3b) m_pval |= m_pdest_3b;else return 1;} - else if(tr2==m_tr_3a) {m_dval = 0;if(m_pdest_3a) m_pval |= m_pdest_3a;else return 1;} - } - return 0; -} -static INT32 dpix_3_1(UINT32 s_pix) -{ - UINT8 tr2=m_tval&1; - if(s_pix) - { - if(tr2==m_tr_3b) {f3_alpha_blend_3b_1(s_pix);if(m_pdest_3b) m_pval |= m_pdest_3b;else return 1;} - else if(tr2==m_tr_3a) {f3_alpha_blend_3a_1(s_pix);if(m_pdest_3a) m_pval |= m_pdest_3a;else return 1;} - } - else - { - if(tr2==m_tr_3b) {if(m_pdest_3b) m_pval |= m_pdest_3b;else return 1;} - else if(tr2==m_tr_3a) {if(m_pdest_3a) m_pval |= m_pdest_3a;else return 1;} - } - return 0; -} -static INT32 dpix_3_2(UINT32 s_pix) -{ - UINT8 tr2=m_tval&1; - if(s_pix) - { - if(tr2==m_tr_3b) {f3_alpha_blend_3b_2(s_pix);if(m_pdest_3b) m_pval |= m_pdest_3b;else return 1;} - else if(tr2==m_tr_3a) {f3_alpha_blend_3a_2(s_pix);if(m_pdest_3a) m_pval |= m_pdest_3a;else return 1;} - } - else - { - if(tr2==m_tr_3b) {if(m_pdest_3b) m_pval |= m_pdest_3b;else return 1;} - else if(tr2==m_tr_3a) {if(m_pdest_3a) m_pval |= m_pdest_3a;else return 1;} - } - return 0; -} - -static inline void dpix_1_sprite(UINT32 s_pix) -{ - if(s_pix) - { - UINT8 p1 = m_pval&0xf0; - if (p1==0x10) f3_alpha_blend_1_1(s_pix); - else if(p1==0x20) f3_alpha_blend_1_2(s_pix); - else if(p1==0x40) f3_alpha_blend_1_4(s_pix); - else if(p1==0x50) f3_alpha_blend_1_5(s_pix); - else if(p1==0x60) f3_alpha_blend_1_6(s_pix); - else if(p1==0x80) f3_alpha_blend_1_8(s_pix); - else if(p1==0x90) f3_alpha_blend_1_9(s_pix); - else if(p1==0xa0) f3_alpha_blend_1_a(s_pix); - } -} - -static inline void dpix_bg(UINT32 bgcolor) -{ - UINT8 p1 = m_pval&0xf0; - if(!p1) m_dval = bgcolor; - else if(p1==0x10) f3_alpha_blend_1_1(bgcolor); - else if(p1==0x20) f3_alpha_blend_1_2(bgcolor); - else if(p1==0x40) f3_alpha_blend_1_4(bgcolor); - else if(p1==0x50) f3_alpha_blend_1_5(bgcolor); - else if(p1==0x60) f3_alpha_blend_1_6(bgcolor); - else if(p1==0x80) f3_alpha_blend_1_8(bgcolor); - else if(p1==0x90) f3_alpha_blend_1_9(bgcolor); - else if(p1==0xa0) f3_alpha_blend_1_a(bgcolor); -} - -/******************************************************************************/ - -static INT32 alpha_blend_inited = 0; - -static void init_alpha_blend_func() -{ - alpha_blend_inited = 1; - - m_dpix_n[0][0x0]=&dpix_1_noalpha; - m_dpix_n[0][0x1]=&dpix_1_noalpha; - m_dpix_n[0][0x2]=&dpix_1_noalpha; - m_dpix_n[0][0x3]=&dpix_1_noalpha; - m_dpix_n[0][0x4]=&dpix_1_noalpha; - m_dpix_n[0][0x5]=&dpix_1_noalpha; - m_dpix_n[0][0x6]=&dpix_1_noalpha; - m_dpix_n[0][0x7]=&dpix_1_noalpha; - m_dpix_n[0][0x8]=&dpix_1_noalpha; - m_dpix_n[0][0x9]=&dpix_1_noalpha; - m_dpix_n[0][0xa]=&dpix_1_noalpha; - m_dpix_n[0][0xb]=&dpix_1_noalpha; - m_dpix_n[0][0xc]=&dpix_1_noalpha; - m_dpix_n[0][0xd]=&dpix_1_noalpha; - m_dpix_n[0][0xe]=&dpix_1_noalpha; - m_dpix_n[0][0xf]=&dpix_1_noalpha; - - m_dpix_n[1][0x0]=&dpix_1_noalpha; - m_dpix_n[1][0x1]=&dpix_1_1; - m_dpix_n[1][0x2]=&dpix_1_2; - m_dpix_n[1][0x3]=&dpix_ret1; - m_dpix_n[1][0x4]=&dpix_1_4; - m_dpix_n[1][0x5]=&dpix_1_5; - m_dpix_n[1][0x6]=&dpix_1_6; - m_dpix_n[1][0x7]=&dpix_ret1; - m_dpix_n[1][0x8]=&dpix_1_8; - m_dpix_n[1][0x9]=&dpix_1_9; - m_dpix_n[1][0xa]=&dpix_1_a; - m_dpix_n[1][0xb]=&dpix_ret1; - m_dpix_n[1][0xc]=&dpix_ret1; - m_dpix_n[1][0xd]=&dpix_ret1; - m_dpix_n[1][0xe]=&dpix_ret1; - m_dpix_n[1][0xf]=&dpix_ret1; - - m_dpix_n[2][0x0]=&dpix_2a_0; - m_dpix_n[2][0x1]=&dpix_ret0; - m_dpix_n[2][0x2]=&dpix_ret0; - m_dpix_n[2][0x3]=&dpix_ret0; - m_dpix_n[2][0x4]=&dpix_2a_4; - m_dpix_n[2][0x5]=&dpix_ret0; - m_dpix_n[2][0x6]=&dpix_ret0; - m_dpix_n[2][0x7]=&dpix_ret0; - m_dpix_n[2][0x8]=&dpix_2a_8; - m_dpix_n[2][0x9]=&dpix_ret0; - m_dpix_n[2][0xa]=&dpix_ret0; - m_dpix_n[2][0xb]=&dpix_ret0; - m_dpix_n[2][0xc]=&dpix_ret0; - m_dpix_n[2][0xd]=&dpix_ret0; - m_dpix_n[2][0xe]=&dpix_ret0; - m_dpix_n[2][0xf]=&dpix_ret0; - - m_dpix_n[3][0x0]=&dpix_3a_0; - m_dpix_n[3][0x1]=&dpix_3a_1; - m_dpix_n[3][0x2]=&dpix_3a_2; - m_dpix_n[3][0x3]=&dpix_ret0; - m_dpix_n[3][0x4]=&dpix_ret0; - m_dpix_n[3][0x5]=&dpix_ret0; - m_dpix_n[3][0x6]=&dpix_ret0; - m_dpix_n[3][0x7]=&dpix_ret0; - m_dpix_n[3][0x8]=&dpix_ret0; - m_dpix_n[3][0x9]=&dpix_ret0; - m_dpix_n[3][0xa]=&dpix_ret0; - m_dpix_n[3][0xb]=&dpix_ret0; - m_dpix_n[3][0xc]=&dpix_ret0; - m_dpix_n[3][0xd]=&dpix_ret0; - m_dpix_n[3][0xe]=&dpix_ret0; - m_dpix_n[3][0xf]=&dpix_ret0; - - m_dpix_n[4][0x0]=&dpix_2b_0; - m_dpix_n[4][0x1]=&dpix_ret0; - m_dpix_n[4][0x2]=&dpix_ret0; - m_dpix_n[4][0x3]=&dpix_ret0; - m_dpix_n[4][0x4]=&dpix_2b_4; - m_dpix_n[4][0x5]=&dpix_ret0; - m_dpix_n[4][0x6]=&dpix_ret0; - m_dpix_n[4][0x7]=&dpix_ret0; - m_dpix_n[4][0x8]=&dpix_2b_8; - m_dpix_n[4][0x9]=&dpix_ret0; - m_dpix_n[4][0xa]=&dpix_ret0; - m_dpix_n[4][0xb]=&dpix_ret0; - m_dpix_n[4][0xc]=&dpix_ret0; - m_dpix_n[4][0xd]=&dpix_ret0; - m_dpix_n[4][0xe]=&dpix_ret0; - m_dpix_n[4][0xf]=&dpix_ret0; - - m_dpix_n[5][0x0]=&dpix_3b_0; - m_dpix_n[5][0x1]=&dpix_3b_1; - m_dpix_n[5][0x2]=&dpix_3b_2; - m_dpix_n[5][0x3]=&dpix_ret0; - m_dpix_n[5][0x4]=&dpix_ret0; - m_dpix_n[5][0x5]=&dpix_ret0; - m_dpix_n[5][0x6]=&dpix_ret0; - m_dpix_n[5][0x7]=&dpix_ret0; - m_dpix_n[5][0x8]=&dpix_ret0; - m_dpix_n[5][0x9]=&dpix_ret0; - m_dpix_n[5][0xa]=&dpix_ret0; - m_dpix_n[5][0xb]=&dpix_ret0; - m_dpix_n[5][0xc]=&dpix_ret0; - m_dpix_n[5][0xd]=&dpix_ret0; - m_dpix_n[5][0xe]=&dpix_ret0; - m_dpix_n[5][0xf]=&dpix_ret0; - - m_dpix_n[6][0x0]=&dpix_2_0; - m_dpix_n[6][0x1]=&dpix_ret0; - m_dpix_n[6][0x2]=&dpix_ret0; - m_dpix_n[6][0x3]=&dpix_ret0; - m_dpix_n[6][0x4]=&dpix_2_4; - m_dpix_n[6][0x5]=&dpix_ret0; - m_dpix_n[6][0x6]=&dpix_ret0; - m_dpix_n[6][0x7]=&dpix_ret0; - m_dpix_n[6][0x8]=&dpix_2_8; - m_dpix_n[6][0x9]=&dpix_ret0; - m_dpix_n[6][0xa]=&dpix_ret0; - m_dpix_n[6][0xb]=&dpix_ret0; - m_dpix_n[6][0xc]=&dpix_ret0; - m_dpix_n[6][0xd]=&dpix_ret0; - m_dpix_n[6][0xe]=&dpix_ret0; - m_dpix_n[6][0xf]=&dpix_ret0; - - m_dpix_n[7][0x0]=&dpix_3_0; - m_dpix_n[7][0x1]=&dpix_3_1; - m_dpix_n[7][0x2]=&dpix_3_2; - m_dpix_n[7][0x3]=&dpix_ret0; - m_dpix_n[7][0x4]=&dpix_ret0; - m_dpix_n[7][0x5]=&dpix_ret0; - m_dpix_n[7][0x6]=&dpix_ret0; - m_dpix_n[7][0x7]=&dpix_ret0; - m_dpix_n[7][0x8]=&dpix_ret0; - m_dpix_n[7][0x9]=&dpix_ret0; - m_dpix_n[7][0xa]=&dpix_ret0; - m_dpix_n[7][0xb]=&dpix_ret0; - m_dpix_n[7][0xc]=&dpix_ret0; - m_dpix_n[7][0xd]=&dpix_ret0; - m_dpix_n[7][0xe]=&dpix_ret0; - m_dpix_n[7][0xf]=&dpix_ret0; - - for(INT32 i = 0; i < 256; i++) - for(INT32 j = 0; j < 256; j++) - m_add_sat[i][j] = (i + j < 256) ? i + j : 255; -} - -/******************************************************************************/ - -#define GET_PIXMAP_POINTER(pf_num) \ -{ \ - const struct f3_playfield_line_inf *line_tmp=line_t[pf_num]; \ - m_src##pf_num=line_tmp->src[y]; \ - m_src_s##pf_num=line_tmp->src_s[y]; \ - m_src_e##pf_num=line_tmp->src_e[y]; \ - m_tsrc##pf_num=line_tmp->tsrc[y]; \ - m_tsrc_s##pf_num=line_tmp->tsrc_s[y]; \ - m_x_count##pf_num=line_tmp->x_count[y]; \ - m_x_zoom##pf_num=line_tmp->x_zoom[y]; \ - m_clip_al##pf_num=line_tmp->clip0[y]&0xffff; \ - m_clip_ar##pf_num=line_tmp->clip0[y]>>16; \ - m_clip_bl##pf_num=line_tmp->clip1[y]&0xffff; \ - m_clip_br##pf_num=line_tmp->clip1[y]>>16; \ -} - -#define CULC_PIXMAP_POINTER(pf_num) \ -{ \ - m_x_count##pf_num += m_x_zoom##pf_num; \ - if(m_x_count##pf_num>>16) \ - { \ - m_x_count##pf_num &= 0xffff; \ - m_src##pf_num++; \ - m_tsrc##pf_num++; \ - if(m_src##pf_num==m_src_e##pf_num) {m_src##pf_num=m_src_s##pf_num; m_tsrc##pf_num=m_tsrc_s##pf_num;} \ - } \ -} - -#define UPDATE_PIXMAP_SP(pf_num) \ -if(cx>=clip_als && cx=clip_bls && cx>4])(*dsti)) {*dsti=m_dval;break;} \ - } \ - } - -#define UPDATE_PIXMAP_LP(pf_num) \ - if (cx>=m_clip_al##pf_num && cx=m_clip_bl##pf_num && cx>4])(clut[*m_src##pf_num])) {*dsti=m_dval;break;} \ - } - - -static void draw_scanlines(INT32 xsize,INT16 *draw_line_num, - const struct f3_playfield_line_inf **line_t, - const INT32 *sprite, - UINT32 orient, - INT32 skip_layer_num) -{ - UINT32 *clut = TaitoPalette; - UINT32 bgcolor=clut[0]; - INT32 length; - - const INT32 x=46; - - UINT16 clip_als=0, clip_ars=0, clip_bls=0, clip_brs=0; - - UINT8 *dstp0,*dstp; - - INT32 yadv = 512; - INT32 yadvp = 1024; - INT32 i=0,y=draw_line_num[0]; - INT32 ty = y; - -#if 1 - if (orient & ORIENTATION_FLIP_Y) - { - ty = 512 - 1 - ty; - yadv = -yadv; - yadvp = -yadvp; - } -#endif - - dstp0 = TaitoPriorityMap + (ty * 1024) + x; - - m_pdest_2a = m_f3_alpha_level_2ad ? 0x10 : 0; - m_pdest_2b = m_f3_alpha_level_2bd ? 0x20 : 0; - m_tr_2a =(m_f3_alpha_level_2as==0 && m_f3_alpha_level_2ad==255) ? -1 : 0; - m_tr_2b =(m_f3_alpha_level_2bs==0 && m_f3_alpha_level_2bd==255) ? -1 : 1; - m_pdest_3a = m_f3_alpha_level_3ad ? 0x40 : 0; - m_pdest_3b = m_f3_alpha_level_3bd ? 0x80 : 0; - m_tr_3a =(m_f3_alpha_level_3as==0 && m_f3_alpha_level_3ad==255) ? -1 : 0; - m_tr_3b =(m_f3_alpha_level_3bs==0 && m_f3_alpha_level_3bd==255) ? -1 : 1; - - { - UINT32 *dsti0,*dsti; - dsti0 = output_bitmap + (ty * 512) + x; - while(1) - { - INT32 cx=0; - - clip_als=m_sa_line_inf[0].sprite_clip0[y]&0xffff; - clip_ars=m_sa_line_inf[0].sprite_clip0[y]>>16; - clip_bls=m_sa_line_inf[0].sprite_clip1[y]&0xffff; - clip_brs=m_sa_line_inf[0].sprite_clip1[y]>>16; - - length=xsize; - dsti = dsti0; - dstp = dstp0; - - switch(skip_layer_num) - { - case 0: GET_PIXMAP_POINTER(0) - case 1: GET_PIXMAP_POINTER(1) - case 2: GET_PIXMAP_POINTER(2) - case 3: GET_PIXMAP_POINTER(3) - case 4: GET_PIXMAP_POINTER(4) - } - - while (1) - { - m_pval=*dstp; - if (m_pval!=0xff) - { - UINT8 sprite_pri; - switch(skip_layer_num) - { - case 0: UPDATE_PIXMAP_SP(0) UPDATE_PIXMAP_LP(0) - case 1: UPDATE_PIXMAP_SP(1) UPDATE_PIXMAP_LP(1) - case 2: UPDATE_PIXMAP_SP(2) UPDATE_PIXMAP_LP(2) - case 3: UPDATE_PIXMAP_SP(3) UPDATE_PIXMAP_LP(3) - case 4: UPDATE_PIXMAP_SP(4) UPDATE_PIXMAP_LP(4) - case 5: UPDATE_PIXMAP_SP(5) - if(!bgcolor) {if(!(m_pval&0xf0)) {*dsti=0;break;}} - else dpix_bg(bgcolor); - *dsti=m_dval; - } - } - - if(!(--length)) break; - dsti++; - dstp++; - cx++; - - switch(skip_layer_num) - { - case 0: CULC_PIXMAP_POINTER(0) - case 1: CULC_PIXMAP_POINTER(1) - case 2: CULC_PIXMAP_POINTER(2) - case 3: CULC_PIXMAP_POINTER(3) - case 4: CULC_PIXMAP_POINTER(4) - } - } - - i++; - if(draw_line_num[i]<0) break; - if(draw_line_num[i]==y+1) - { - dsti0 += yadv; - dstp0 += yadvp; - y++; - continue; - } - else - { - dsti0 += (draw_line_num[i]-y)*yadv; - dstp0 += (draw_line_num[i]-y)*yadvp; - y=draw_line_num[i]; - } - } - } -} -#undef GET_PIXMAP_POINTER -#undef CULC_PIXMAP_POINTER - -static void visible_tile_check( - struct f3_playfield_line_inf *line_t, - INT32 line, - UINT32 x_index_fx,UINT32 y_index, - UINT16 *f3_pf_data_n) -{ - UINT16 *pf_base; - INT32 i,trans_all,tile_index,tile_num; - INT32 alpha_type,alpha_mode; - INT32 opaque_all; - INT32 total_elements; - - alpha_mode=line_t->alpha_mode[line]; - if(!alpha_mode) return; - - total_elements = TaitoCharModulo; // iq_132 - - tile_index=x_index_fx>>16; - tile_num=(((line_t->x_zoom[line]*320+(x_index_fx & 0xffff)+0xffff)>>16)+(tile_index%16)+15)/16; - tile_index/=16; - - if (flipscreen) - { - pf_base=f3_pf_data_n+((31-(y_index/16))<>(16+10)) & 3; - if(tile&0xffff) - { - trans_all=0; - if(opaque_all) - { - if(tile_opaque_pf[extra_planes][(tile&0xffff)%total_elements]!=1) opaque_all=0; - } - - if(alpha_mode==1) - { - if(!opaque_all) return; - } - else - { - if(alpha_type!=3) - { - if((tile>>(16+9))&1) alpha_type|=2; - else alpha_type|=1; - } - else if(!opaque_all) break; - } - } - else if(opaque_all) opaque_all=0; - - tile_index++; - } - - if(trans_all) {line_t->alpha_mode[line]=0;return;} - - if(alpha_mode>1) - { - line_t->alpha_mode[line]|=alpha_type<<4; - } - - if(opaque_all) - line_t->alpha_mode[line]|=0x80; -} - -static void calculate_clip(INT32 y, UINT16 pri, UINT32* clip0, UINT32* clip1, int* line_enable) -{ - const struct f3_spritealpha_line_inf *sa_line_t=&m_sa_line_inf[0]; - - switch (pri) - { - case 0x0100: /* Clip plane 1 enable */ - { - if (sa_line_t->clip0_l[y] > sa_line_t->clip0_r[y]) - *line_enable=0; - else - *clip0=(sa_line_t->clip0_l[y]) | (sa_line_t->clip0_r[y]<<16); - *clip1=0; - } - break; - case 0x0110: /* Clip plane 1 enable, inverted */ - { - *clip1=(sa_line_t->clip0_l[y]) | (sa_line_t->clip0_r[y]<<16); - *clip0=0x7fff0000; - } - break; - case 0x0200: /* Clip plane 2 enable */ - { - if (sa_line_t->clip1_l[y] > sa_line_t->clip1_r[y]) - *line_enable=0; - else - *clip0=(sa_line_t->clip1_l[y]) | (sa_line_t->clip1_r[y]<<16); - *clip1=0; - } - break; - case 0x0220: /* Clip plane 2 enable, inverted */ - { - *clip1=(sa_line_t->clip1_l[y]) | (sa_line_t->clip1_r[y]<<16); - *clip0=0x7fff0000; - } - break; - case 0x0300: /* Clip plane 1 & 2 enable */ - { - INT32 clipl=0,clipr=0; - - if (sa_line_t->clip1_l[y] > sa_line_t->clip0_l[y]) - clipl=sa_line_t->clip1_l[y]; - else - clipl=sa_line_t->clip0_l[y]; - - if (sa_line_t->clip1_r[y] < sa_line_t->clip0_r[y]) - clipr=sa_line_t->clip1_r[y]; - else - clipr=sa_line_t->clip0_r[y]; - - if (clipl > clipr) - *line_enable=0; - else - *clip0=(clipl) | (clipr<<16); - *clip1=0; - } - break; - case 0x0310: /* Clip plane 1 & 2 enable, plane 1 inverted */ - { - if (sa_line_t->clip1_l[y] > sa_line_t->clip1_r[y]) - line_enable=NULL; - else - *clip0=(sa_line_t->clip1_l[y]) | (sa_line_t->clip1_r[y]<<16); - - *clip1=(sa_line_t->clip0_l[y]) | (sa_line_t->clip0_r[y]<<16); - } - break; - case 0x0320: /* Clip plane 1 & 2 enable, plane 2 inverted */ - { - if (sa_line_t->clip0_l[y] > sa_line_t->clip0_r[y]) - line_enable=NULL; - else - *clip0=(sa_line_t->clip0_l[y]) | (sa_line_t->clip0_r[y]<<16); - - *clip1=(sa_line_t->clip1_l[y]) | (sa_line_t->clip1_r[y]<<16); - } - break; - case 0x0330: /* Clip plane 1 & 2 enable, both inverted */ - { - INT32 clipl=0,clipr=0; - - if (sa_line_t->clip1_l[y] < sa_line_t->clip0_l[y]) - clipl=sa_line_t->clip1_l[y]; - else - clipl=sa_line_t->clip0_l[y]; - - if (sa_line_t->clip1_r[y] > sa_line_t->clip0_r[y]) - clipr=sa_line_t->clip1_r[y]; - else - clipr=sa_line_t->clip0_r[y]; - - if (clipl > clipr) - *line_enable=0; - else - *clip1=(clipl) | (clipr<<16); - *clip0=0x7fff0000; - } - break; - default: - // Illegal clip mode - break; - } -} - -static void get_line_ram_info(INT32 which_map, INT32 sx, INT32 sy, INT32 pos, UINT16 *f3_pf_data_n) -{ - UINT16 *m_f3_line_ram = (UINT16*)TaitoF3LineRAM; - struct f3_playfield_line_inf *line_t=&m_pf_line_inf[pos]; - - INT32 y,y_start,y_end,y_inc; - INT32 line_base,zoom_base,col_base,pri_base,inc; - - INT32 line_enable; - INT32 colscroll=0,x_offset=0,line_zoom=0; - UINT32 _y_zoom[256]; - UINT16 pri=0; - INT32 bit_select=1<=2 && m_f3_line_ram[0x000+(y)]&bit_select) - colscroll=(m_f3_line_ram[col_base/2]>> 0)&0x3ff; - } - - if (!pri || (!flipscreen && y<24) || (flipscreen && y>231) || - (pri&0xc000)==0xc000 || !(pri&0x2000)/**/) - line_enable=0; - else if(pri&0x4000) //alpha1 - line_enable=2; - else if(pri&0x8000) //alpha2 - line_enable=3; - else - line_enable=1; - - _colscroll[y]=colscroll; - _x_offset[y]=(x_offset&0xffff0000) - (x_offset&0x0000ffff); - _y_zoom[y] = (line_zoom&0xff) << 9; - - /* Evaluate clipping */ - /* Notes: - kludge: line-disable breaks quizhuhu text & landmakr "you win / you lose" text. [april 23, 2017 -dink] - somehow I think 0x0800 has nothing to do with line-disable. - although tcobra2 uses this to clip the sides of the playfield - */ - - if (pri&0x0800 && f3_game != QUIZHUHU && f3_game != LANDMAKR) - { - line_enable=0; - } - else if (pri&0x0330 && f3_game != PBOBBLE4) // kludge: clipping breaks win/lose animation [april 23, 2017 -dink] - { - //fast path todo - remove line enable - calculate_clip(y, pri&0x0330, &line_t->clip0[y], &line_t->clip1[y], &line_enable); - } - else - { - /* No clipping */ - line_t->clip0[y]=0x7fff0000; - line_t->clip1[y]=0; - } - - line_t->x_zoom[y]=0x10000 - (line_zoom&0xff00); - line_t->alpha_mode[y]=line_enable; - line_t->pri[y]=pri; - - zoom_base+=inc; - line_base+=inc; - col_base +=inc; - pri_base +=inc; - y +=y_inc; - } - - UINT8 *pmap = bitmap_flags[which_map]; - UINT16 * tm = bitmap_layer[which_map]; - UINT16 * tmap = bitmap_layer[which_map]; - INT32 map_width = bitmap_width[which_map]; - - y=y_start; - while(y!=y_end) - { - UINT32 x_index_fx; - UINT32 y_index; - - /* The football games use values in the range 0x200-0x3ff where the crowd should be drawn - !? - - This appears to cause it to reference outside of the normal tilemap RAM area into the unused - area on the 32x32 tilemap configuration.. but exactly how isn't understood - - Until this is understood we're creating additional tilemaps for the otherwise unused area of - RAM and forcing it to look up there. - - the crowd area still seems to 'lag' behind the pitch area however.. but these are the values - in ram?? - */ - INT32 cs = _colscroll[y]; - - if (cs&0x200) - { - if (extended_layers == 0) - { - if (which_map == 2) { - tmap = bitmap_layer[4]; - } - if (which_map == 3) { - tmap = bitmap_layer[5]; - } - } - } - else - { - tmap = tm; - map_width = bitmap_width[which_map]; - } - - /* set pixmap pointer */ - UINT16 *srcbitmap = tmap; - UINT8 *flagsbitmap = pmap; - - if(line_t->alpha_mode[y]!=0) - { - UINT16 *src_s; - UINT8 *tsrc_s; - - x_index_fx = (sx+_x_offset[y]-(10*0x10000)+(10*line_t->x_zoom[y]))&((m_width_mask<<16)|0xffff); - y_index = ((y_index_fx>>16)+_colscroll[y])&0x1ff; - - /* check tile status */ - visible_tile_check(line_t,y,x_index_fx,y_index,f3_pf_data_n); - - /* If clipping enabled for this line have to disable 'all opaque' optimisation */ - if (line_t->clip0[y]!=0x7fff0000 || line_t->clip1[y]!=0) - line_t->alpha_mode[y]&=~0x80; - - /* set pixmap index */ - line_t->x_count[y]=x_index_fx & 0xffff; // Fractional part - line_t->src_s[y]=src_s=srcbitmap + (y_index * map_width); - line_t->src_e[y]=&src_s[m_width_mask+1]; - line_t->src[y]=&src_s[x_index_fx>>16]; - - line_t->tsrc_s[y]=tsrc_s=flagsbitmap + (y_index * map_width); - line_t->tsrc[y]=&tsrc_s[x_index_fx>>16]; - } - - y_index_fx += _y_zoom[y]; - y +=y_inc; - } -} - -static void get_vram_info(INT32 sx, INT32 sy) -{ - UINT16 *m_f3_line_ram = (UINT16*)TaitoF3LineRAM; - - const struct f3_spritealpha_line_inf *sprite_alpha_line_t=&m_sa_line_inf[0]; - struct f3_playfield_line_inf *line_t=&m_pf_line_inf[4]; - - INT32 y,y_start,y_end,y_inc; - INT32 pri_base,inc; - - INT32 line_enable; - - UINT16 pri=0; - - const INT32 vram_width_mask=0x3ff; - - if (flipscreen) - { - pri_base =0x73fe; - inc=-2; - y_start=255; - y_end=-1; - y_inc=-1; - } - else - { - pri_base =0x7200; - inc=2; - y_start=0; - y_end=256; - y_inc=1; - } - - y=y_start; - while(y!=y_end) - { - /* The zoom, column and row values can latch according to control ram */ - { - if (m_f3_line_ram[(0x0600/2)+(y)]&0x2) - pri=(m_f3_line_ram[pri_base/2]&0xffff); - } - - if (!pri || (!flipscreen && y<24) || (flipscreen && y>231) || - (pri&0xc000)==0xc000 || !(pri&0x2000)/**/) - line_enable=0; - else if(pri&0x4000) //alpha1 - line_enable=2; - else if(pri&0x8000) //alpha2 - line_enable=3; - else - line_enable=1; - - if ((f3_game == ARABIANM || f3_game == GSEEKER) && line_enable) - { // force opaque vram & pixel kludge: fixes arabianm missing cutscene text, gseeker missing continue screen april.21&28.2017_dink - line_enable = 1; - } - - line_t->pri[y]=pri; - - /* Evaluate clipping */ - if (pri&0x0800) - line_enable=0; - else if (pri&0x0330) - { - //fast path todo - remove line enable - calculate_clip(y, pri&0x0330, &line_t->clip0[y], &line_t->clip1[y], &line_enable); - } - else - { - /* No clipping */ - line_t->clip0[y]=0x7fff0000; - line_t->clip1[y]=0; - } - - line_t->x_zoom[y]=0x10000; - line_t->alpha_mode[y]=line_enable; - if (line_t->alpha_mode[y]>1) - line_t->alpha_mode[y]|=0x10; - - pri_base +=inc; - y +=y_inc; - } - - sx&=0x1ff; - - /* set pixmap pointer */ - UINT16 *srcbitmap_pixel = bitmap_layer[9]; - UINT8 *flagsbitmap_pixel = bitmap_flags[9]; - UINT16 *srcbitmap_vram = bitmap_layer[8]; - UINT8 *flagsbitmap_vram = bitmap_flags[8]; - - y=y_start; - while(y!=y_end) - { - if(line_t->alpha_mode[y]!=0) - { - UINT16 *src_s; - UINT8 *tsrc_s; - - // These bits in control ram indicate whether the line is taken from - // the VRAM tilemap layer or pixel layer. - const INT32 usePixelLayer=((sprite_alpha_line_t->sprite_alpha[y]&0xa000)==0xa000); - - /* set pixmap index */ - line_t->x_count[y]=0xffff; - if (usePixelLayer) - line_t->src_s[y]=src_s=srcbitmap_pixel + (sy&0xff) * 512; - else - line_t->src_s[y]=src_s=srcbitmap_vram + (sy&0x1ff) * 512; - line_t->src_e[y]=&src_s[vram_width_mask+1]; - line_t->src[y]=&src_s[sx]; - - if (usePixelLayer) - line_t->tsrc_s[y]=tsrc_s=flagsbitmap_pixel + (sy&0xff) * 512; - else - line_t->tsrc_s[y]=tsrc_s=flagsbitmap_vram + (sy&0x1ff) * 512; - line_t->tsrc[y]=&tsrc_s[sx]; - } - - sy++; - y += y_inc; - } -} - - -static void scanline_draw() -{ - INT32 i,j,y,ys,ye; - INT32 y_start,y_end,y_start_next,y_end_next; - UINT8 draw_line[256]; - INT16 draw_line_num[256]; - - UINT32 rot=0; - - if (flipscreen) - { - rot=0;//ORIENTATION_FLIP_Y; - ys=0; - ye=232; - } - else - { - ys=24; - ye=256; - } - - y_start=ys; - y_end=ye; - memset(draw_line,0,256); - - while(1) - { - INT32 pos; - INT32 pri[5],alpha_mode[5],alpha_mode_flag[5],alpha_level; - UINT16 sprite_alpha; - UINT8 sprite_alpha_check; - UINT8 sprite_alpha_all_2a; - INT32 spri; - INT32 alpha; - INT32 layer_tmp[5]; - struct f3_playfield_line_inf *pf_line_inf = m_pf_line_inf; - struct f3_spritealpha_line_inf *sa_line_inf = m_sa_line_inf; - INT32 count_skip_layer=0; - INT32 sprite[6]={0,0,0,0,0,0}; - const struct f3_playfield_line_inf *line_t[5]; - - - /* find same status of scanlines */ - pri[0]=pf_line_inf[0].pri[y_start]; - pri[1]=pf_line_inf[1].pri[y_start]; - pri[2]=pf_line_inf[2].pri[y_start]; - pri[3]=pf_line_inf[3].pri[y_start]; - pri[4]=pf_line_inf[4].pri[y_start]; - alpha_mode[0]=pf_line_inf[0].alpha_mode[y_start]; - alpha_mode[1]=pf_line_inf[1].alpha_mode[y_start]; - alpha_mode[2]=pf_line_inf[2].alpha_mode[y_start]; - alpha_mode[3]=pf_line_inf[3].alpha_mode[y_start]; - alpha_mode[4]=pf_line_inf[4].alpha_mode[y_start]; - alpha_level=sa_line_inf[0].alpha_level[y_start]; - spri=sa_line_inf[0].spri[y_start]; - sprite_alpha=sa_line_inf[0].sprite_alpha[y_start]; - - draw_line[y_start]=1; - draw_line_num[i=0]=y_start; - y_start_next=-1; - y_end_next=-1; - for(y=y_start+1;y1 || - alpha_mode[1]>1 || - alpha_mode[2]>1 || - alpha_mode[3]>1 || - alpha_mode[4]>1 || - (sprite_alpha&0xff) != 0xff ) - { - /* set alpha level */ - if(alpha_level!=m_alpha_level_last) - { - INT32 al_s,al_d; - INT32 a=alpha_level; - INT32 b=(a>>8)&0xf; - INT32 c=(a>>4)&0xf; - INT32 d=(a>>0)&0xf; - a>>=12; - - /* b000 7000 */ - al_s = ( (15-d)*256) / 8; - al_d = ( (15-b)*256) / 8; - if(al_s>255) al_s = 255; - if(al_d>255) al_d = 255; - m_f3_alpha_level_3as = al_s; - m_f3_alpha_level_3ad = al_d; - m_f3_alpha_level_2as = al_d; - m_f3_alpha_level_2ad = al_s; - - al_s = ( (15-c)*256) / 8; - al_d = ( (15-a)*256) / 8; - if(al_s>255) al_s = 255; - if(al_d>255) al_d = 255; - m_f3_alpha_level_3bs = al_s; - m_f3_alpha_level_3bd = al_d; - m_f3_alpha_level_2bs = al_d; - m_f3_alpha_level_2bd = al_s; - - f3_alpha_set_level(); - m_alpha_level_last=alpha_level; - } - - /* set sprite alpha mode */ - sprite_alpha_check=0; - sprite_alpha_all_2a=1; - m_dpix_sp[1]=NULL; - m_dpix_sp[2]=NULL; - m_dpix_sp[4]=NULL; - m_dpix_sp[8]=NULL; - for(i=0;i<4;i++) /* i = sprite priority offset */ - { - UINT8 sprite_alpha_mode=(sprite_alpha>>(i*2))&3; - UINT8 sftbit=1<>4)&3; - - if(alpha_mode[i]==2) - { - if(alpha_type==1) - { - //if (m_f3_alpha_level_2as==0 && m_f3_alpha_level_2ad==255 && f3_game == GSEEKER) { - // alpha_mode[i]=3; alpha_mode_flag[i] |= 0x80;} /* will display continue screen in gseeker (mt 00026) */ - //else - if (m_f3_alpha_level_2as==0 && m_f3_alpha_level_2ad==255) alpha_mode[i]=0; - else if(m_f3_alpha_level_2as==255 && m_f3_alpha_level_2ad==0 ) alpha_mode[i]=1; - } - else if(alpha_type==2) - { - if (m_f3_alpha_level_2bs==0 && m_f3_alpha_level_2bd==255) alpha_mode[i]=0; - else if(m_f3_alpha_level_2as==255 && m_f3_alpha_level_2ad==0 && - m_f3_alpha_level_2bs==255 && m_f3_alpha_level_2bd==0 ) alpha_mode[i]=1; - } - else if(alpha_type==3) - { - if (m_f3_alpha_level_2as==0 && m_f3_alpha_level_2ad==255 && - m_f3_alpha_level_2bs==0 && m_f3_alpha_level_2bd==255) alpha_mode[i]=0; - else if(m_f3_alpha_level_2as==255 && m_f3_alpha_level_2ad==0 && - m_f3_alpha_level_2bs==255 && m_f3_alpha_level_2bd==0 ) alpha_mode[i]=1; - } - } - else if(alpha_mode[i]==3) - { - if(alpha_type==1) - { - if (m_f3_alpha_level_3as==0 && m_f3_alpha_level_3ad==255) alpha_mode[i]=0; - else if(m_f3_alpha_level_3as==255 && m_f3_alpha_level_3ad==0 ) alpha_mode[i]=1; - } - else if(alpha_type==2) - { - if (m_f3_alpha_level_3bs==0 && m_f3_alpha_level_3bd==255) alpha_mode[i]=0; - else if(m_f3_alpha_level_3as==255 && m_f3_alpha_level_3ad==0 && - m_f3_alpha_level_3bs==255 && m_f3_alpha_level_3bd==0 ) alpha_mode[i]=1; - } - else if(alpha_type==3) - { - if (m_f3_alpha_level_3as==0 && m_f3_alpha_level_3ad==255 && - m_f3_alpha_level_3bs==0 && m_f3_alpha_level_3bd==255) alpha_mode[i]=0; - else if(m_f3_alpha_level_3as==255 && m_f3_alpha_level_3ad==0 && - m_f3_alpha_level_3bs==255 && m_f3_alpha_level_3bd==0 ) alpha_mode[i]=1; - } - } - } - - if ( (alpha_mode[0]==1 || alpha_mode[0]==2 || !alpha_mode[0]) && - (alpha_mode[1]==1 || alpha_mode[1]==2 || !alpha_mode[1]) && - (alpha_mode[2]==1 || alpha_mode[2]==2 || !alpha_mode[2]) && - (alpha_mode[3]==1 || alpha_mode[3]==2 || !alpha_mode[3]) && - (alpha_mode[4]==1 || alpha_mode[4]==2 || !alpha_mode[4]) && - sprite_alpha_all_2a ) - { - INT32 alpha_type = (alpha_mode_flag[0] | alpha_mode_flag[1] | alpha_mode_flag[2] | alpha_mode_flag[3])&0x30; - if( (alpha_type==0x10 && m_f3_alpha_level_2as==255) || - (alpha_type==0x20 && m_f3_alpha_level_2as==255 && m_f3_alpha_level_2bs==255) || - (alpha_type==0x30 && m_f3_alpha_level_2as==255 && m_f3_alpha_level_2bs==255) ) - { - if(alpha_mode[0]>1) alpha_mode[0]=1; - if(alpha_mode[1]>1) alpha_mode[1]=1; - if(alpha_mode[2]>1) alpha_mode[2]=1; - if(alpha_mode[3]>1) alpha_mode[3]=1; - if(alpha_mode[4]>1) alpha_mode[4]=1; - sprite_alpha_check=0; - m_dpix_sp[1]=NULL; - m_dpix_sp[2]=NULL; - m_dpix_sp[4]=NULL; - m_dpix_sp[8]=NULL; - } - } - } - else - { - sprite_alpha_check=0; - m_dpix_sp[1]=NULL; - m_dpix_sp[2]=NULL; - m_dpix_sp[4]=NULL; - m_dpix_sp[8]=NULL; - } - - - - /* set scanline priority */ - { - INT32 pri_max_opa=-1; - for(i=0;i<5;i++) /* i = playfield num (pos) */ - { - INT32 p0=pri[i]; - INT32 pri_sl1=p0&0x0f; - - layer_tmp[i]=i + (pri_sl1<<3); - - if(!alpha_mode[i]) - { - layer_tmp[i]|=0x80; - count_skip_layer++; - } - else if(alpha_mode[i]==1 && (alpha_mode_flag[i]&0x80)) - { - if(layer_tmp[i]>pri_max_opa) pri_max_opa=layer_tmp[i]; - } - } - - if(pri_max_opa!=-1) - { - if(pri_max_opa>layer_tmp[0]) {layer_tmp[0]|=0x80;count_skip_layer++;} - if(pri_max_opa>layer_tmp[1]) {layer_tmp[1]|=0x80;count_skip_layer++;} - if(pri_max_opa>layer_tmp[2]) {layer_tmp[2]|=0x80;count_skip_layer++;} - if(pri_max_opa>layer_tmp[3]) {layer_tmp[3]|=0x80;count_skip_layer++;} - if(pri_max_opa>layer_tmp[4]) {layer_tmp[4]|=0x80;count_skip_layer++;} - } - } - - - /* sort layer_tmp */ - for(i=0;i<4;i++) - { - for(j=i+1;j<5;j++) - { - if(layer_tmp[i]>3; - l1=layer_tmp[1]>>3; - l2=layer_tmp[2]>>3; - l3=layer_tmp[3]>>3; - l4=layer_tmp[4]>>3; - - pri_sp[0]=spri&0xf; - pri_sp[1]=(spri>>4)&0xf; - pri_sp[2]=(spri>>8)&0xf; - pri_sp[3]=spri>>12; - - for(i=0;i<4;i++) /* i = sprite priority offset */ - { - INT32 sp,sflg=1< sprite - BUBSYMPH (title) ---> sprite - DARIUSG (ZONE V' BOSS) ---> playfield - */ - - if (f3_game == BUBSYMPH ) sp++; //BUBSYMPH (title) - if (f3_game == GSEEKER ) sp++; //GSEEKER (plane leaving hangar) - - if( sp>l0) sprite[0]|=sflg; - else if(sp<=l0 && sp>l1) sprite[1]|=sflg; - else if(sp<=l1 && sp>l2) sprite[2]|=sflg; - else if(sp<=l2 && sp>l3) sprite[3]|=sflg; - else if(sp<=l3 && sp>l4) sprite[4]|=sflg; - else if(sp<=l4 ) sprite[5]|=sflg; - } - } - - - /* draw scanlines */ - alpha=0; - for(i=count_skip_layer;i<5;i++) - { - pos=layer_tmp[i]&7; - line_t[i]=&pf_line_inf[pos]; - - if(sprite[i]&sprite_alpha_check) alpha=1; - else if(!alpha) sprite[i]|=0x100; - - if(alpha_mode[pos]>1) - { - INT32 alpha_type=(((alpha_mode_flag[pos]>>4)&3)-1)*2; - m_dpix_lp[i]=m_dpix_n[alpha_mode[pos]+alpha_type]; - alpha=1; - } - else - { - if(alpha) m_dpix_lp[i]=m_dpix_n[1]; - else m_dpix_lp[i]=m_dpix_n[0]; - } - } - if(sprite[5]&sprite_alpha_check) alpha=1; - else if(!alpha) sprite[5]|=0x100; - - draw_scanlines(320,draw_line_num,line_t,sprite,rot,count_skip_layer); - if(y_start<0) break; - } -} - - -static void get_spritealphaclip_info() -{ - UINT16 *m_f3_line_ram = (UINT16*)TaitoF3LineRAM; - struct f3_spritealpha_line_inf *line_t=&m_sa_line_inf[0]; - - INT32 y,y_end,y_inc; - - INT32 spri_base,clip_base_low,clip_base_high,inc; - - UINT16 spri=0; - UINT16 sprite_clip=0; - UINT16 clip0_low=0, clip0_high=0, clip1_low=0; - INT32 alpha_level=0; - UINT16 sprite_alpha=0; - - if (flipscreen) - { - spri_base=0x77fe; - clip_base_low=0x51fe; - clip_base_high=0x45fe; - inc=-2; - y=255; - y_end=-1; - y_inc=-1; - - } - else - { - spri_base=0x7600; - clip_base_low=0x5000; - clip_base_high=0x4400; - inc=2; - y=0; - y_end=256; - y_inc=1; - } - - while(y!=y_end) - { - /* The zoom, column and row values can latch according to control ram */ - { - if (m_f3_line_ram[0x100+(y)]&1) - clip0_low=(m_f3_line_ram[clip_base_low/2]>> 0)&0xffff; - if (m_f3_line_ram[0x000+(y)]&4) - clip0_high=(m_f3_line_ram[clip_base_high/2]>> 0)&0xffff; - if (m_f3_line_ram[0x100+(y)]&2) - clip1_low=(m_f3_line_ram[(clip_base_low+0x200)/2]>> 0)&0xffff; - - if (m_f3_line_ram[(0x0600/2)+(y)]&0x8) - spri=m_f3_line_ram[spri_base/2]&0xffff; - if (m_f3_line_ram[(0x0600/2)+(y)]&0x4) - sprite_clip=m_f3_line_ram[(spri_base-0x200)/2]&0xffff; - if (m_f3_line_ram[(0x0400/2)+(y)]&0x1) - sprite_alpha=m_f3_line_ram[(spri_base-0x1600)/2]&0xffff; - if (m_f3_line_ram[(0x0400/2)+(y)]&0x2) - alpha_level=m_f3_line_ram[(spri_base-0x1400)/2]&0xffff; - } - - - line_t->alpha_level[y]=alpha_level; - line_t->spri[y]=spri; - line_t->sprite_alpha[y]=sprite_alpha; - line_t->clip0_l[y]=((clip0_low&0xff)|((clip0_high&0x1000)>>4)) - 47; - line_t->clip0_r[y]=(((clip0_low&0xff00)>>8)|((clip0_high&0x2000)>>5)) - 47; - line_t->clip1_l[y]=((clip1_low&0xff)|((clip0_high&0x4000)>>6)) - 47; - line_t->clip1_r[y]=(((clip1_low&0xff00)>>8)|((clip0_high&0x8000)>>7)) - 47; - if (line_t->clip0_l[y]<0) line_t->clip0_l[y]=0; - if (line_t->clip0_r[y]<0) line_t->clip0_r[y]=0; - if (line_t->clip1_l[y]<0) line_t->clip1_l[y]=0; - if (line_t->clip1_r[y]<0) line_t->clip1_r[y]=0; - - /* Evaluate sprite clipping */ - if (sprite_clip&0x080) - { - line_t->sprite_clip0[y]=0x7fff7fff; - line_t->sprite_clip1[y]=0; - } - else if (sprite_clip&0x33) - { - INT32 line_enable=1; - calculate_clip(y, ((sprite_clip&0x33)<<4), &line_t->sprite_clip0[y], &line_t->sprite_clip1[y], &line_enable); - if (line_enable==0) - line_t->sprite_clip0[y]=0x7fff7fff; - } - else - { - line_t->sprite_clip0[y]=0x7fff0000; - line_t->sprite_clip1[y]=0; - } - - spri_base+=inc; - clip_base_low+=inc; - clip_base_high+=inc; - y +=y_inc; - } -} - -void TaitoF3VideoInit() -{ - clear_f3_stuff(); - m_f3_alpha_level_2as=127; - m_f3_alpha_level_2ad=127; - m_f3_alpha_level_3as=127; - m_f3_alpha_level_3ad=127; - m_f3_alpha_level_2bs=127; - m_f3_alpha_level_2bd=127; - m_f3_alpha_level_3bs=127; - m_f3_alpha_level_3bd=127; - m_alpha_level_last = -1; - - m_pdest_2a = 0x10; - m_pdest_2b = 0x20; - m_tr_2a = 0; - m_tr_2b = 1; - m_pdest_3a = 0x40; - m_pdest_3b = 0x80; - m_tr_3a = 0; - m_tr_3b = 1; - - m_width_mask=(extended_layers) ? 0x3ff : 0x1ff; - m_twidth_mask=(extended_layers) ? 0x7f : 0x3f; - m_twidth_mask_bit=(extended_layers) ? 7 : 6; - - m_spritelist = (struct tempsprite*)BurnMalloc(0x400 * sizeof(struct tempsprite)); - m_sprite_end = m_spritelist; - - - init_alpha_blend_func(); -} - -static void pal16_check_init() -{ - if (nBurnBpp < 3 && !pal16) { - pal16 = (UINT16 *)BurnMalloc((1 << 24) * sizeof (UINT16)); - - for (INT32 i = 0; i < (1 << 24); i++) { - pal16[i] = BurnHighCol(i / 0x10000, (i / 0x100) & 0xff, i & 0xff, 0); - } - } -} - -void TaitoF3VideoExit() -{ - BurnFree (m_spritelist); - - if (pal16) { - BurnFree(pal16); - pal16 = NULL; - } -} - -void TaitoF3DrawCommon(INT32 scanline_start) -{ - if (TaitoF3PalRecalc) { - pal16_check_init(); - - for (INT32 i = 0; i < 0x8000; i+=4) { - pPaletteUpdateCallback(i); - } - TaitoF3PalRecalc = 0; - } - - UINT16 *m_f3_control_0 = (UINT16*)TaitoF3CtrlRAM; - UINT16 *m_f3_control_1 = (UINT16*)(TaitoF3CtrlRAM + 0x10); - - UINT32 sy_fix[5],sx_fix[5]; - - /* Setup scroll */ - sy_fix[0]=((m_f3_control_0[4]&0xffff)<< 9) + (1<<16); - sy_fix[1]=((m_f3_control_0[5]&0xffff)<< 9) + ((f3_game==LANDMAKR) ? 0 : 1<<16); - sy_fix[2]=((m_f3_control_0[6]&0xffff)<< 9) + ((f3_game==LANDMAKR) ? 0 : 1<<16); - sy_fix[3]=((m_f3_control_0[7]&0xffff)<< 9) + (1<<16); - sx_fix[0]=((m_f3_control_0[0]&0xffc0)<<10) - (6<<16); - sx_fix[1]=((m_f3_control_0[1]&0xffc0)<<10) - (10<<16); - sx_fix[2]=((m_f3_control_0[2]&0xffc0)<<10) - (14<<16); - sx_fix[3]=((m_f3_control_0[3]&0xffc0)<<10) - (18<<16); - sx_fix[4]=-(m_f3_control_1[4])+41; - sy_fix[4]=-(m_f3_control_1[5]&0x1ff); - - sx_fix[0]-=((m_f3_control_0[0]&0x003f)<<10)+0x0400-0x10000; - sx_fix[1]-=((m_f3_control_0[1]&0x003f)<<10)+0x0400-0x10000; - sx_fix[2]-=((m_f3_control_0[2]&0x003f)<<10)+0x0400-0x10000; - sx_fix[3]-=((m_f3_control_0[3]&0x003f)<<10)+0x0400-0x10000; - - if (flipscreen) - { - sy_fix[0]= 0x3000000-sy_fix[0]; - sy_fix[1]= 0x3000000-sy_fix[1]; - sy_fix[2]= 0x3000000-sy_fix[2]; - sy_fix[3]= 0x3000000-sy_fix[3]; - - sx_fix[0]=-0x1a00000-sx_fix[0]; - sx_fix[1]=-0x1a00000-sx_fix[1]; - sx_fix[2]=-0x1a00000-sx_fix[2]; - sx_fix[3]=-0x1a00000-sx_fix[3]; - - sx_fix[4]=-sx_fix[4] + 75; - sy_fix[4]=-sy_fix[4]; - } - - memset (TaitoPriorityMap, 0, 1024 * 512); - memset (output_bitmap, 0, 512 * 512 * sizeof(UINT32)); - - switch (sprite_lag) { - case 2: get_sprite_info((UINT16*)TaitoSpriteRamDelayed2); break; - case 1: get_sprite_info((UINT16*)TaitoSpriteRamDelayed); break; - default: get_sprite_info((UINT16*)TaitoSpriteRam); break; - } - - if (nSpriteEnable & 1) draw_sprites(); - - get_spritealphaclip_info(); - - for (INT32 i = 0; i < (8 >> extended_layers); i++) { - if (nBurnLayer & 1) draw_pf_layer(i); - } - - if (nBurnLayer & 2) draw_pixel_layer(); - if (nBurnLayer & 4) draw_vram_layer(); - - { - get_line_ram_info(0,sx_fix[0],sy_fix[0],0,(UINT16*)(TaitoF3PfRAM + (extended_layers ? 0x0000 : 0x0000))); - - get_line_ram_info(1,sx_fix[1],sy_fix[1],1,(UINT16*)(TaitoF3PfRAM + (extended_layers ? 0x2000 : 0x1000))); - - get_line_ram_info(2,sx_fix[2],sy_fix[2],2,(UINT16*)(TaitoF3PfRAM + (extended_layers ? 0x4000 : 0x2000))); - - get_line_ram_info(3,sx_fix[3],sy_fix[3],3,(UINT16*)(TaitoF3PfRAM + (extended_layers ? 0x6000 : 0x3000))); - - get_vram_info(sx_fix[4],sy_fix[4]); - - if (nBurnLayer & 8) scanline_draw(); - } - - // copy video to draw surface - { - if (flipscreen) - { - scanline_start = (scanline_start == 0x1234) ? 1 : 0; // super-kludge for gunlock. -dink - - UINT32 *src = output_bitmap + ((nScreenHeight + scanline_start - 1) * 512) + 46; - UINT8 *dst = pBurnDraw; - - for (INT32 y = 0, i = 0; y < nScreenHeight; y++) - { - if (nBurnBpp == 2) { // 16bpp - for (INT32 x = 0; x < nScreenWidth; x++, i++, dst += nBurnBpp) - { - //UINT32 pixel = src[x]; - PutPix(dst, pal16[src[x]]); - } - - src -= 512; - } else if (nBurnBpp == 4) { // quad block-32bit (fast) - for (INT32 x = 0; x < nScreenWidth; x+=4, i++, dst += (nBurnBpp*4)) - { - *((UINT32*)(dst + 0)) = src[x + 0]; - *((UINT32*)(dst + 4)) = src[x + 1]; - *((UINT32*)(dst + 8)) = src[x + 2]; - *((UINT32*)(dst + 12))= src[x + 3]; - } - - src -= 512; - } else { // 24bit - for (INT32 x = 0; x < nScreenWidth; x++, i++, dst += nBurnBpp) - { - PutPix(dst, src[x]); - } - - src -= 512; - } - } - } - else - { - UINT32 *src = output_bitmap + (scanline_start * 512) + 46; - UINT8 *dst = pBurnDraw; - - for (INT32 y = 0, i = 0; y < nScreenHeight; y++) - { - if (nBurnBpp == 2) { // 16bpp - for (INT32 x = 0; x < nScreenWidth; x++, i++, dst += nBurnBpp) - { - PutPix(dst, pal16[src[x]]); - } - - src += 512; - } else if (nBurnBpp == 4) { // quad block-32bit (fast) - for (INT32 x = 0; x < nScreenWidth; x+=4, i++, dst += (nBurnBpp*4)) - { - *((UINT32*)(dst + 0)) = src[x + 0]; - *((UINT32*)(dst + 4)) = src[x + 1]; - *((UINT32*)(dst + 8)) = src[x + 2]; - *((UINT32*)(dst + 12))= src[x + 3]; - } - - src += 512; - } else { // 24bpp - for (INT32 x = 0; x < nScreenWidth; x++, i++, dst += nBurnBpp) - { - PutPix(dst, src[x]); - } - - src += 512; - } - } - } - } -} diff --git a/jan/src/burn/drv/taito/taitof3_video.h b/jan/src/burn/drv/taito/taitof3_video.h deleted file mode 100644 index b30abf3f7..000000000 --- a/jan/src/burn/drv/taito/taitof3_video.h +++ /dev/null @@ -1,62 +0,0 @@ -extern void TaitoF3DrawCommon(INT32 scanline_start); -extern void TaitoF3VideoInit(); -extern void TaitoF3VideoExit(); -extern void TaitoF3VideoReset(); - -extern INT32 f3_game; -extern UINT32 extended_layers; -extern UINT32 sprite_lag; - -extern UINT8 *TaitoF3CtrlRAM; -extern UINT8 *TaitoF3PfRAM; -extern UINT8 *TaitoF3LineRAM; - -extern UINT16 *bitmap_layer[10]; -extern UINT8 *bitmap_flags[10]; -extern INT32 bitmap_width[8]; -extern UINT32 *output_bitmap; - -extern UINT8 *tile_opaque_sp; -extern UINT8 *tile_opaque_pf[8]; -extern UINT8 *dirty_tiles; -extern UINT8 dirty_tile_count[10]; - -extern void (*pPaletteUpdateCallback)(UINT16); -extern UINT8 TaitoF3PalRecalc; - -enum { - RINGRAGE = 0, - ARABIANM, - RIDINGF, - GSEEKER, - TRSTAR, - GUNLOCK, - TWINQIX, - UNDRFIRE, - SCFINALS, // - coin inputs don't work, service coin ok. - LIGHTBR, - KAISERKN, - DARIUSG, - BUBSYMPH, - SPCINVDX, - HTHERO95, - QTHEATER, - EACTION2, - SPCINV95, - QUIZHUHU, // - missing text is normal. - PBOBBLE2, - GEKIRIDO, - KTIGER2, - BUBBLEM, - CLEOPATR, - PBOBBLE3, - ARKRETRN, - KIRAMEKI, // - has extra 68k rom that is banked for sound, not hooked up yet, - PUCHICAR, - PBOBBLE4, - POPNPOP, - LANDMAKR, - RECALH, - COMMANDW, - TMDRILL -}; diff --git a/jan/src/burn/drv/taito/tc0100scn.cpp b/jan/src/burn/drv/taito/tc0100scn.cpp deleted file mode 100644 index 2ae5c1c9c..000000000 --- a/jan/src/burn/drv/taito/tc0100scn.cpp +++ /dev/null @@ -1,646 +0,0 @@ -// TC0100SCN -// Based on MAME sources by Nicola Salmoria - -#include "tiles_generic.h" -#include "taito_ic.h" - -UINT8 *TC0100SCNRam[TC0100SCN_MAX_CHIPS]; -UINT16 TC0100SCNCtrl[TC0100SCN_MAX_CHIPS][8]; -UINT8 TC0100SCNBgLayerUpdate[TC0100SCN_MAX_CHIPS]; -UINT8 TC0100SCNFgLayerUpdate[TC0100SCN_MAX_CHIPS]; -UINT8 TC0100SCNCharLayerUpdate[TC0100SCN_MAX_CHIPS]; -UINT8 TC0100SCNCharRamUpdate[TC0100SCN_MAX_CHIPS]; -INT32 TC0100SCNDblWidth[TC0100SCN_MAX_CHIPS]; -static UINT8 *TC0100SCNChars[TC0100SCN_MAX_CHIPS]; -static INT32 BgScrollX[TC0100SCN_MAX_CHIPS]; -static INT32 BgScrollY[TC0100SCN_MAX_CHIPS]; -static INT32 FgScrollX[TC0100SCN_MAX_CHIPS]; -static INT32 FgScrollY[TC0100SCN_MAX_CHIPS]; -static INT32 CharScrollX[TC0100SCN_MAX_CHIPS]; -static INT32 CharScrollY[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNXOffset[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNYOffset[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNFlipScreenX[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNFlip[TC0100SCN_MAX_CHIPS]; -static UINT8 *TC0100SCNPriorityMap[TC0100SCN_MAX_CHIPS] = { NULL, }; -static INT32 TC0100SCNColourDepth[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNGfxBank[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNGfxMask[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNClipWidth[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNClipHeight[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNClipStartX[TC0100SCN_MAX_CHIPS]; -static INT32 TC0100SCNPaletteOffset[TC0100SCN_MAX_CHIPS]; -static UINT16 *pTC0100SCNBgTempDraw[TC0100SCN_MAX_CHIPS] = { NULL, }; -static UINT16 *pTC0100SCNFgTempDraw[TC0100SCN_MAX_CHIPS] = { NULL, }; -static INT32 TC0100SCNNum = 0; - -#define PLOTPIXEL(x, po) pPixel[x] = nPalette | pTileData[x] | po; -#define PLOTPIXEL_FLIPX(x, a, po) pPixel[x] = nPalette | pTileData[a] | po; - -static void RenderTile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nTilemapWidth, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nTilemapWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nTilemapWidth, pTileData += 8) { - PLOTPIXEL( 0, nPaletteOffset); - PLOTPIXEL( 1, nPaletteOffset); - PLOTPIXEL( 2, nPaletteOffset); - PLOTPIXEL( 3, nPaletteOffset); - PLOTPIXEL( 4, nPaletteOffset); - PLOTPIXEL( 5, nPaletteOffset); - PLOTPIXEL( 6, nPaletteOffset); - PLOTPIXEL( 7, nPaletteOffset); - } -} - -static void RenderTile_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nTilemapWidth, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nTilemapWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nTilemapWidth, pTileData += 8) { - PLOTPIXEL_FLIPX( 7, 0, nPaletteOffset); - PLOTPIXEL_FLIPX( 6, 1, nPaletteOffset); - PLOTPIXEL_FLIPX( 5, 2, nPaletteOffset); - PLOTPIXEL_FLIPX( 4, 3, nPaletteOffset); - PLOTPIXEL_FLIPX( 3, 4, nPaletteOffset); - PLOTPIXEL_FLIPX( 2, 5, nPaletteOffset); - PLOTPIXEL_FLIPX( 1, 6, nPaletteOffset); - PLOTPIXEL_FLIPX( 0, 7, nPaletteOffset); - } -} - -static void RenderTile_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nTilemapWidth, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nTilemapWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nTilemapWidth, pTileData += 8) { - PLOTPIXEL( 0, nPaletteOffset); - PLOTPIXEL( 1, nPaletteOffset); - PLOTPIXEL( 2, nPaletteOffset); - PLOTPIXEL( 3, nPaletteOffset); - PLOTPIXEL( 4, nPaletteOffset); - PLOTPIXEL( 5, nPaletteOffset); - PLOTPIXEL( 6, nPaletteOffset); - PLOTPIXEL( 7, nPaletteOffset); - } -} - -static void RenderTile_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nTilemapWidth, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nTilemapWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nTilemapWidth, pTileData += 8) { - PLOTPIXEL_FLIPX( 7, 0, nPaletteOffset); - PLOTPIXEL_FLIPX( 6, 1, nPaletteOffset); - PLOTPIXEL_FLIPX( 5, 2, nPaletteOffset); - PLOTPIXEL_FLIPX( 4, 3, nPaletteOffset); - PLOTPIXEL_FLIPX( 3, 4, nPaletteOffset); - PLOTPIXEL_FLIPX( 2, 5, nPaletteOffset); - PLOTPIXEL_FLIPX( 1, 6, nPaletteOffset); - PLOTPIXEL_FLIPX( 0, 7, nPaletteOffset); - } -} - -#undef PLOTPIXEL -#undef PLOTPIXEL_FLIPX - -void TC0100SCNCtrlWordWrite(INT32 Chip, UINT32 Offset, UINT16 Data) -{ - TC0100SCNCtrl[Chip][Offset] = Data; - - switch (Offset) { - case 0x00: { - BgScrollX[Chip] = -Data; - return; - } - - case 0x01: { - FgScrollX[Chip] = -Data; - return; - } - - case 0x02: { - CharScrollX[Chip] = -Data; - return; - } - - case 0x03: { - BgScrollY[Chip] = -Data; - return; - } - - case 0x04: { - FgScrollY[Chip] = -Data; - return; - } - - case 0x05: { - CharScrollY[Chip] = -Data; - return; - } - - case 0x06: { - TC0100SCNDblWidth[Chip] = (Data & 0x10) >> 4; - if (TC0100SCNFlip[Chip]) bprintf(PRINT_NORMAL, _T("Double\n")); - return; - } - - case 0x07: { - TC0100SCNFlip[Chip] = (Data & 0x01) ? 1: 0; - if (TC0100SCNFlip[Chip]) bprintf(PRINT_NORMAL, _T("Flipped\n")); - return; - } - } - - bprintf(PRINT_IMPORTANT, _T("TC0100 Ctrl Word Write %02X, %04X\n"), Offset, Data); -} - -INT32 TC0100SCNBottomLayer(INT32 Chip) -{ - return (TC0100SCNCtrl[Chip][6] & 0x08) >> 3; -} - -void TC0100SCNRenderBgLayer(INT32 Chip, INT32 Opaque, UINT8 *pSrc, INT32 Priority) -{ - INT32 mx, my, Attr, Code, Colour, x, y, xSrc = 0, ySrc = 0, TileIndex = 0, Offset, Flip, xFlip, yFlip, p, dxScroll, dyScroll; - - UINT16 *VideoRam = (UINT16*)TC0100SCNRam[Chip]; - UINT16 *ScrollRam = (UINT16*)TC0100SCNRam[Chip] + (0xc000 / 2); - INT32 Columns = 64; - INT32 WidthMask = 0x1ff; - INT32 HeightMask = 0x1ff; - - if (TC0100SCNDblWidth[Chip]) { - VideoRam = (UINT16*)TC0100SCNRam[Chip]; - ScrollRam = (UINT16*)TC0100SCNRam[Chip] + (0x10000 / 2); - Columns = 128; - WidthMask = 0x3ff; - } - - // Render the tilemap to a buffer - if (TC0100SCNBgLayerUpdate[Chip]) { - memset(pTC0100SCNBgTempDraw[Chip], 0, Columns * 8 * 512 * sizeof(UINT16)); - for (my = 0; my < 64; my++) { - for (mx = 0; mx < Columns; mx++) { - Offset = 2 * TileIndex; - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset]); - Code = (BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & TC0100SCNGfxMask[Chip]) + (TC0100SCNGfxBank[Chip] << 15); - Colour = Attr & 0xff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - if (TC0100SCNFlipScreenX[Chip]) { - xFlip = !xFlip; - x = (Columns * 8) - 8 - x; - } - - if (TC0100SCNFlip[Chip]) { - xFlip = !xFlip; - x = (Columns * 8) - 8 - x; - yFlip = !yFlip; - y = 512 - 8 - y; - } - - if (xFlip) { - if (yFlip) { - RenderTile_FlipXY(pTC0100SCNBgTempDraw[Chip], Code, x, y, Colour, TC0100SCNColourDepth[Chip], TC0100SCNPaletteOffset[Chip], Columns * 8, pSrc); - } else { - RenderTile_FlipX(pTC0100SCNBgTempDraw[Chip], Code, x, y, Colour, TC0100SCNColourDepth[Chip], TC0100SCNPaletteOffset[Chip], Columns * 8, pSrc); - } - } else { - if (yFlip) { - RenderTile_FlipY(pTC0100SCNBgTempDraw[Chip], Code, x, y, Colour, TC0100SCNColourDepth[Chip], TC0100SCNPaletteOffset[Chip], Columns * 8, pSrc); - } else { - RenderTile(pTC0100SCNBgTempDraw[Chip], Code, x, y, Colour, TC0100SCNColourDepth[Chip], TC0100SCNPaletteOffset[Chip], Columns * 8, pSrc); - } - } - - TileIndex++; - } - } - - TC0100SCNBgLayerUpdate[Chip] = 0; - } - - dxScroll = TC0100SCNXOffset[Chip] + 16 - TC0100SCNClipStartX[Chip]; - dyScroll = TC0100SCNYOffset[Chip]; - - ySrc = (BgScrollY[Chip] + dyScroll) & HeightMask; - if (TC0100SCNFlip[Chip]) ySrc = (256 + 16 - ySrc) & HeightMask; - - for (y = 0; y < TC0100SCNClipHeight[Chip]; y++) { - xSrc = (BgScrollX[Chip] - BURN_ENDIAN_SWAP_INT16(ScrollRam[(y + dyScroll) & 0x1ff]) + dxScroll + TC0100SCNClipStartX[Chip]) & WidthMask; - if(TC0100SCNFlip[Chip]) xSrc = (256 - 58 - xSrc) & WidthMask; - if (TC0100SCNFlipScreenX[Chip]) xSrc = (256 - 64 - xSrc) & WidthMask; - - for (x = TC0100SCNClipStartX[Chip]; x < TC0100SCNClipStartX[Chip] + TC0100SCNClipWidth[Chip]; x++) { - p = pTC0100SCNBgTempDraw[Chip][((ySrc & HeightMask) * Columns * 8) + xSrc]; - - if ((p & 0x0f) != 0 || Opaque) { - pTransDraw[(y * nScreenWidth) + x] = p; - - if (TC0100SCNPriorityMap[Chip]) { - TC0100SCNPriorityMap[Chip][(y * nScreenWidth) + x] = Priority; - } - } - xSrc = (xSrc + 1); - xSrc &= WidthMask; - } - ySrc = (ySrc + 1); - ySrc &= HeightMask; - } -} - -void TC0100SCNRenderFgLayer(INT32 Chip, INT32 Opaque, UINT8 *pSrc, INT32 Priority) -{ - INT32 mx, my, Attr, Code, Colour, x, y, xSrc = 0, ySrc = 0, TileIndex = 0, Offset, Flip, xFlip, yFlip, p, ColumnOffset, dxScroll, dyScroll; - - UINT16 *VideoRam = (UINT16*)TC0100SCNRam[Chip] + (0x8000 / 2); - UINT16 *ScrollRam = (UINT16*)TC0100SCNRam[Chip] + (0xc400 / 2); - UINT16 *ColumnRam = (UINT16*)TC0100SCNRam[Chip] + (0xe000 / 2); - INT32 Columns = 64; - INT32 WidthMask = 0x1ff; - INT32 HeightMask = 0x1ff; - - if (TC0100SCNDblWidth[Chip]) { - VideoRam = (UINT16*)TC0100SCNRam[Chip] + (0x8000 / 2); - ScrollRam = (UINT16*)TC0100SCNRam[Chip] + (0x10400 / 2); - ColumnRam = (UINT16*)TC0100SCNRam[Chip] + (0x10800 / 2); - Columns = 128; - WidthMask = 0x3ff; - } - - // Render the tilemap to a buffer - if (TC0100SCNFgLayerUpdate[Chip]) { - memset(pTC0100SCNFgTempDraw[Chip], 0, Columns * 8 * 512 * sizeof(UINT16)); - for (my = 0; my < 64; my++) { - for (mx = 0; mx < Columns; mx++) { - Offset = 2 * TileIndex; - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset]); - Code = (BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & TC0100SCNGfxMask[Chip]) + (TC0100SCNGfxBank[Chip] << 15); - Colour = Attr & 0xff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - if (TC0100SCNFlipScreenX[Chip]) { - xFlip = !xFlip; - x = (Columns * 8) - 8 - x; - } - - if (TC0100SCNFlip[Chip]) { - xFlip = !xFlip; - x = (Columns * 8) - 8 - x; - yFlip = !yFlip; - y = 512 - 8 -y; - } - - if (xFlip) { - if (yFlip) { - RenderTile_FlipXY(pTC0100SCNFgTempDraw[Chip], Code, x, y, Colour, TC0100SCNColourDepth[Chip], TC0100SCNPaletteOffset[Chip], Columns * 8, pSrc); - } else { - RenderTile_FlipX(pTC0100SCNFgTempDraw[Chip], Code, x, y, Colour, TC0100SCNColourDepth[Chip], TC0100SCNPaletteOffset[Chip], Columns * 8, pSrc); - } - } else { - if (yFlip) { - RenderTile_FlipY(pTC0100SCNFgTempDraw[Chip], Code, x, y, Colour, TC0100SCNColourDepth[Chip], TC0100SCNPaletteOffset[Chip], Columns * 8, pSrc); - } else { - RenderTile(pTC0100SCNFgTempDraw[Chip], Code, x, y, Colour, TC0100SCNColourDepth[Chip], TC0100SCNPaletteOffset[Chip], Columns * 8, pSrc); - } - } - - TileIndex++; - } - } - - TC0100SCNFgLayerUpdate[Chip] = 0; - } - - dxScroll = TC0100SCNXOffset[Chip] + 16 - TC0100SCNClipStartX[Chip]; - dyScroll = TC0100SCNYOffset[Chip]; - - ySrc = (FgScrollY[Chip] + dyScroll) & HeightMask; - if (TC0100SCNFlip[Chip]) ySrc = (256 + 16 - ySrc) & HeightMask; - - for (y = 0; y < TC0100SCNClipHeight[Chip]; y++) { - xSrc = (FgScrollX[Chip] - BURN_ENDIAN_SWAP_INT16(ScrollRam[(y + dyScroll) & 0x1ff]) + dxScroll + TC0100SCNClipStartX[Chip]) & WidthMask; - if (TC0100SCNFlip[Chip]) xSrc = (256 - 58 - xSrc) & WidthMask; - if (TC0100SCNFlipScreenX[Chip]) xSrc = (256 - 64 - xSrc) & WidthMask; - - for (x = TC0100SCNClipStartX[Chip]; x < TC0100SCNClipStartX[Chip] + TC0100SCNClipWidth[Chip]; x++) { - ColumnOffset = BURN_ENDIAN_SWAP_INT16(ColumnRam[(xSrc & 0x3ff) / 8]); - p = pTC0100SCNFgTempDraw[Chip][(((ySrc - ColumnOffset) & HeightMask) * Columns * 8) + xSrc]; - - if ((p & 0x0f) != 0 || Opaque) { - pTransDraw[(y * nScreenWidth) + x] = p; - - if (TC0100SCNPriorityMap[Chip]) { - TC0100SCNPriorityMap[Chip][(y * nScreenWidth) + x] = Priority; - } - } - xSrc = (xSrc + 1); - xSrc &= WidthMask; - } - ySrc = (ySrc + 1); - ySrc &= HeightMask; - } -} - -static INT32 TC0100SCNPlaneOffsets[2] = { 8, 0 }; -static INT32 TC0100SCNXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static INT32 TC0100SCNYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; - -void TC0100SCNRenderCharLayer(INT32 Chip) -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)TC0100SCNRam[Chip] + (0x4000 / 2); - UINT16 *CharRam = (UINT16*)TC0100SCNRam[Chip] + (0x6000 / 2); - INT32 Columns = 64; - INT32 Rows = 64; - - if (TC0100SCNDblWidth[Chip]) { - VideoRam = (UINT16*)TC0100SCNRam[Chip] + (0x12000 / 2); - CharRam = (UINT16*)TC0100SCNRam[Chip] + (0x11000 / 2); - Columns = 128; - Rows = 32; - } - - if (TC0100SCNCharRamUpdate[Chip]) { - GfxDecode(256, 2, 8, 8, TC0100SCNPlaneOffsets, TC0100SCNXOffsets, TC0100SCNYOffsets, 0x80, (UINT8*)CharRam, TC0100SCNChars[Chip]); - TC0100SCNCharRamUpdate[Chip] = 0; - } - - // we could use TC0100SCNCharLayerUpdate to render to a temp buffer, but since there is no row/col scroll here, it would probably be slower - for (my = 0; my < Rows; my++) { - for (mx = 0; mx < Columns; mx++) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Code = Attr & 0xff; - Colour = (Attr >> 6) & 0xfc; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - x = 8 * mx; - y = 8 * my; - - x -= 16; - if (!TC0100SCNFlip[Chip] && !TC0100SCNFlipScreenX[Chip]) x -= TC0100SCNXOffset[Chip]; - if (TC0100SCNFlip[Chip] || TC0100SCNFlipScreenX[Chip]) x += TC0100SCNXOffset[Chip]; - y -= TC0100SCNYOffset[Chip]; - - if (TC0100SCNFlipScreenX[Chip]) { - xFlip = !xFlip; - x = TC0100SCNClipWidth[Chip] - x; - } - - if (TC0100SCNFlip[Chip]) { - xFlip = !xFlip; - x = TC0100SCNClipWidth[Chip] - x; - yFlip = !yFlip; - y = TC0100SCNClipHeight[Chip] + 8 - y; - } - - if (!TC0100SCNDblWidth[Chip]) { - if (!TC0100SCNFlip[Chip] && !TC0100SCNFlipScreenX[Chip]) x -= CharScrollX[Chip] & 0x1ff; - if (TC0100SCNFlip[Chip] || TC0100SCNFlipScreenX[Chip]) x += CharScrollX[Chip] & 0x1ff; - - if (x < -8) x += 512; - if (x >= 512) x -= 512; - - if (!TC0100SCNFlip[Chip]) y -= CharScrollY[Chip] & 0x1ff; - if (TC0100SCNFlip[Chip]) y += CharScrollY[Chip] & 0x1ff; - - if (y < -8) y += 512; - if (y >= 512) y -= 512; - } else { - if (!TC0100SCNFlip[Chip] && !TC0100SCNFlipScreenX[Chip]) x -= CharScrollX[Chip] & 0x3ff; - if (TC0100SCNFlip[Chip] || TC0100SCNFlipScreenX[Chip]) x += CharScrollX[Chip] & 0x3ff; - - if (x < -8) x += 1024; - if (x >= 1024) x -= 1024; - - if (!TC0100SCNFlip[Chip]) y -= CharScrollY[Chip] & 0xff; - if (TC0100SCNFlip[Chip]) y += CharScrollY[Chip] & 0xff; - - if (y < -8) y += 256; - if (y >= 256) y -= 256; - } - - INT32 px, py; - - UINT32 nPalette = Colour << 2; - - for (py = 0; py < 8; py++) { - for (px = 0; px < 8; px++) { - UINT8 c = TC0100SCNChars[Chip][(Code * 64) + (py * 8) + px]; - if (xFlip) c = TC0100SCNChars[Chip][(Code * 64) + (py * 8) + (7 - px)]; - if (yFlip) c = TC0100SCNChars[Chip][(Code * 64) + ((7 - py) * 8) + px]; - if (xFlip && yFlip) c = TC0100SCNChars[Chip][(Code * 64) + ((7 - py) * 8) + (7 - px)]; - - if (c) { - INT32 xPos = x + px + TC0100SCNClipStartX[Chip]; - INT32 yPos = y + py; - - if (yPos >= 0 && yPos < TC0100SCNClipHeight[Chip]) { - UINT16* pPixel = pTransDraw + (yPos * nScreenWidth); - - if (xPos >= TC0100SCNClipStartX[Chip] && xPos < TC0100SCNClipStartX[Chip] + TC0100SCNClipWidth[Chip]) { - pPixel[xPos] = c | nPalette | TC0100SCNPaletteOffset[Chip]; -// if (TC0100SCNPriorityMap[Chip]) TC0100SCNPriorityMap[Chip][(yPos * TC0100SCNClipWidth[Chip]) + xPos - TC0100SCNClipStartX[Chip]] = 4; - if (TC0100SCNPriorityMap[Chip]) TC0100SCNPriorityMap[Chip][(yPos * nScreenWidth) + xPos] = 4; - } - } - } - } - } - - TileIndex++; - } - } - - TC0100SCNCharLayerUpdate[Chip] = 0; -} - -void TC0100SCNReset() -{ - for (INT32 i = 0;i < TC0100SCNNum; i++) { - memset(TC0100SCNCtrl[i], 0, 8); - memset(TC0100SCNChars[i], 0, 256 * 8 * 8); - - BgScrollX[i] = 0; - BgScrollY[i] = 0; - FgScrollX[i] = 0; - FgScrollY[i] = 0; - CharScrollX[i] = 0; - CharScrollY[i] = 0; - TC0100SCNFlip[i] = 0; - TC0100SCNGfxBank[i] = 0; - TC0100SCNDblWidth[i] = 0; - TC0100SCNBgLayerUpdate[i] = 1; - TC0100SCNFgLayerUpdate[i] = 1; - TC0100SCNCharLayerUpdate[i] = 1; - TC0100SCNCharRamUpdate[i] = 1; - } -} - -void TC0100SCNInit(INT32 Chip, INT32 nNumTiles, INT32 xOffset, INT32 yOffset, INT32 xFlip, UINT8 *PriorityMap) -{ - TC0100SCNRam[Chip] = (UINT8*)BurnMalloc(0x14000); - memset(TC0100SCNRam[Chip], 0, 0x14000); - - TC0100SCNChars[Chip] = (UINT8*)BurnMalloc(256 * 8 * 8); - memset(TC0100SCNChars[Chip], 0, 256 * 8 * 8); - - pTC0100SCNBgTempDraw[Chip] = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - memset(pTC0100SCNBgTempDraw[Chip], 0, 1024 * 512 * sizeof(UINT16)); - - pTC0100SCNFgTempDraw[Chip] = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - memset(pTC0100SCNFgTempDraw[Chip], 0, 1024 * 512 * sizeof(UINT16)); - - TC0100SCNXOffset[Chip] = xOffset; - TC0100SCNYOffset[Chip] = yOffset; - TC0100SCNFlipScreenX[Chip] = xFlip; - TC0100SCNPriorityMap[Chip] = PriorityMap; - TC0100SCNColourDepth[Chip] = 4; - TC0100SCNGfxMask[Chip] = nNumTiles - 1; - TC0100SCNDblWidth[Chip] = 0; - TC0100SCNClipWidth[Chip] = nScreenWidth; - TC0100SCNClipHeight[Chip] = nScreenHeight; - TC0100SCNClipStartX[Chip] = 0; - TC0100SCNPaletteOffset[Chip] = 0; - TC0100SCNFgLayerUpdate[Chip] = 1; - TC0100SCNBgLayerUpdate[Chip] = 1; - TC0100SCNCharLayerUpdate[Chip] = 1; - TC0100SCNCharRamUpdate[Chip] = 1; - - if (!TC0100SCNClipWidth[Chip] || !TC0100SCNClipHeight[Chip]) bprintf(PRINT_IMPORTANT, _T("TC0100SCNInit called before GenericTilesInit\n")); - - TaitoIC_TC0100SCNInUse = 1; - TC0100SCNNum++; -} - -void TC0100SCNSetColourDepth(INT32 Chip, INT32 ColourDepth) -{ - TC0100SCNColourDepth[Chip] = ColourDepth; -} - -void TC0100SCNSetGfxMask(INT32 Chip, INT32 Mask) -{ - TC0100SCNGfxMask[Chip] = Mask; -} - -void TC0100SCNSetGfxBank(INT32 Chip, INT32 Bank) -{ - TC0100SCNGfxBank[Chip] = Bank & 0x01; -} - -void TC0100SCNSetClipArea(INT32 Chip, INT32 ClipWidth, INT32 ClipHeight, INT32 ClipStartX) -{ - TC0100SCNClipWidth[Chip] = ClipWidth; - TC0100SCNClipHeight[Chip] = ClipHeight; - TC0100SCNClipStartX[Chip] = ClipStartX; -} - -void TC0100SCNSetPaletteOffset(INT32 Chip, INT32 PaletteOffset) -{ - TC0100SCNPaletteOffset[Chip] = PaletteOffset; -} - -void TC0100SCNExit() -{ - for (INT32 i = 0; i < TC0100SCNNum; i++) { - BurnFree(TC0100SCNRam[i]); - BurnFree(TC0100SCNChars[i]); - BurnFree(pTC0100SCNBgTempDraw[i]); - BurnFree(pTC0100SCNFgTempDraw[i]); - - memset(TC0100SCNCtrl[i], 0, 8); - - BgScrollX[i] = 0; - BgScrollY[i] = 0; - FgScrollX[i] = 0; - FgScrollY[i] = 0; - CharScrollX[i] = 0; - CharScrollY[i] = 0; - TC0100SCNXOffset[i] = 0; - TC0100SCNYOffset[i] = 0; - TC0100SCNFlipScreenX[i] = 0; - TC0100SCNFlip[i] = 0; - TC0100SCNPriorityMap[i] = NULL; - TC0100SCNColourDepth[i] = 0; - TC0100SCNGfxBank[i] = 0; - TC0100SCNGfxMask[i] = 0; - TC0100SCNDblWidth[i] = 0; - TC0100SCNClipWidth[i] = 0; - TC0100SCNClipHeight[i] = 0; - TC0100SCNClipStartX[i] = 0; - TC0100SCNPaletteOffset[i] = 0; - TC0100SCNBgLayerUpdate[i] = 0; - TC0100SCNFgLayerUpdate[i] = 0; - TC0100SCNCharLayerUpdate[i] = 0; - TC0100SCNCharRamUpdate[i] = 0; - } - - TC0100SCNNum = 0; -} - -void TC0100SCNScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0;i < TC0100SCNNum; i++) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TC0100SCNRam[i]; - ba.nLen = 0x14000; - ba.szName = "TC0100SCN Ram"; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - ba.Data = TC0100SCNChars[i]; - ba.nLen = 256 * 8 * 8; - ba.szName = "TC0100SCN CharsRam"; - BurnAcb(&ba); - } - - SCAN_VAR(TC0100SCNCtrl); - SCAN_VAR(BgScrollX); - SCAN_VAR(BgScrollY); - SCAN_VAR(FgScrollX); - SCAN_VAR(FgScrollY); - SCAN_VAR(CharScrollX); - SCAN_VAR(CharScrollY); - SCAN_VAR(TC0100SCNFlip); - SCAN_VAR(TC0100SCNGfxBank); - SCAN_VAR(TC0100SCNDblWidth); - if (nAction & ACB_WRITE) { - for (INT32 i = 0;i < TC0100SCNNum; i++) { - // re-draw the the screen after loading the savestate - TC0100SCNBgLayerUpdate[i] = 1; - TC0100SCNFgLayerUpdate[i] = 1; - TC0100SCNCharLayerUpdate[i] = 1; - TC0100SCNCharRamUpdate[i] = 1; - } - } - } -} diff --git a/jan/src/burn/drv/taito/tc0110pcr.cpp b/jan/src/burn/drv/taito/tc0110pcr.cpp deleted file mode 100644 index 709becdc8..000000000 --- a/jan/src/burn/drv/taito/tc0110pcr.cpp +++ /dev/null @@ -1,194 +0,0 @@ -// TC0110PCR -// Based on MAME sources by Nicola Salmoria - -#include "burnint.h" -#include "taito_ic.h" - -#define MAX_TC0110PCR 3 - -static UINT8 *TC0110PCRRam[MAX_TC0110PCR]; -UINT32 *TC0110PCRPalette = NULL; -static INT32 TC0110PCRAddr[MAX_TC0110PCR]; -INT32 TC0110PCRTotalColours; -INT32 TC0110PCRCount = 0; - -static inline UINT8 pal5bit(UINT8 bits) -{ - bits &= 0x1f; - return (bits << 3) | (bits >> 2); -} - -static inline UINT8 pal4bit(UINT8 bits) -{ - bits &= 0x0f; - return (bits << 4) | (bits); -} - -UINT16 TC0110PCRWordRead(INT32 Chip) -{ - UINT16 *PalRam = (UINT16*)TC0110PCRRam[Chip]; - return PalRam[TC0110PCRAddr[Chip]]; -} - -void TC0110PCRWordWrite(INT32 Chip, INT32 Offset, UINT16 Data) -{ - INT32 PaletteOffset = Chip * 0x1000; - - switch (Offset) { - case 0: { - TC0110PCRAddr[Chip] = (Data >> 1) & 0xfff; - return; - } - - case 1: { - UINT16 *PalRam = (UINT16*)TC0110PCRRam[Chip]; - INT32 r, g, b; - - PalRam[TC0110PCRAddr[Chip]] = Data; - - r = pal5bit(Data >> 0); - g = pal5bit(Data >> 5); - b = pal5bit(Data >> 10); - - TC0110PCRPalette[TC0110PCRAddr[Chip] | PaletteOffset] = BurnHighCol(r, g, b, 0); - return; - } - } -} - -void TC0110PCRStep1WordWrite(INT32 Chip, INT32 Offset, UINT16 Data) -{ - INT32 PaletteOffset = Chip * 0x1000; - - switch (Offset) { - case 0: { - TC0110PCRAddr[Chip] = Data & 0xfff; - return; - } - - case 1: { - UINT16 *PalRam = (UINT16*)TC0110PCRRam[Chip]; - INT32 r, g, b; - - PalRam[TC0110PCRAddr[Chip]] = Data; - - r = pal5bit(Data >> 0); - g = pal5bit(Data >> 5); - b = pal5bit(Data >> 10); - - TC0110PCRPalette[TC0110PCRAddr[Chip] | PaletteOffset] = BurnHighCol(r, g, b, 0); - return; - } - } -} - -void TC0110PCRStep14rbgWordWrite(INT32 Chip, INT32 Offset, UINT16 Data) -{ - INT32 PaletteOffset = Chip * 0x1000; - - switch (Offset) { - case 0: { - TC0110PCRAddr[Chip] = Data & 0xfff; - return; - } - - case 1: { - UINT16 *PalRam = (UINT16*)TC0110PCRRam[Chip]; - INT32 r, g, b; - - PalRam[TC0110PCRAddr[Chip]] = Data; - - r = pal4bit(Data >> 0); - g = pal4bit(Data >> 4); - b = pal4bit(Data >> 8); - - TC0110PCRPalette[TC0110PCRAddr[Chip] | PaletteOffset] = BurnHighCol(r, g, b, 0); - return; - } - } -} - -void TC0110PCRStep1RBSwapWordWrite(INT32 Chip, INT32 Offset, UINT16 Data) -{ - INT32 PaletteOffset = Chip * 0x1000; - - switch (Offset) { - case 0: { - TC0110PCRAddr[Chip] = Data & 0xfff; - return; - } - - case 1: { - UINT16 *PalRam = (UINT16*)TC0110PCRRam[Chip]; - INT32 r, g, b; - - PalRam[TC0110PCRAddr[Chip]] = Data; - - r = pal5bit(Data >> 10); - g = pal5bit(Data >> 5); - b = pal5bit(Data >> 0); - - TC0110PCRPalette[TC0110PCRAddr[Chip] | PaletteOffset] = BurnHighCol(r, g, b, 0); - return; - } - } -} - -void TC0110PCRReset() -{ - TC0110PCRAddr[0] = 0; -} - -void TC0110PCRInit(INT32 Num, INT32 nNumColours) -{ - for (INT32 i = 0; i < Num; i++) { - TC0110PCRRam[i] = (UINT8*)BurnMalloc(0x4000); - memset(TC0110PCRRam[i], 0, 0x4000); - } - - TC0110PCRPalette = (UINT32*)BurnMalloc(nNumColours * sizeof(UINT32)); - memset(TC0110PCRPalette, 0, nNumColours); - - TC0110PCRTotalColours = nNumColours; - - TC0110PCRCount = Num; // dink - - TaitoIC_TC0110PCRInUse = 1; -} - -void TC0110PCRExit() -{ - for (INT32 i = 0; i < MAX_TC0110PCR; i++) { - BurnFree(TC0110PCRRam[i]); - TC0110PCRAddr[i] = 0; - } - - BurnFree(TC0110PCRPalette); - - TC0110PCRTotalColours = 0; - TC0110PCRCount = 0; // dink -} - -void TC0110PCRScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - for (INT32 i = 0; i < TC0110PCRCount; i++) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TC0110PCRRam[i]; - ba.nLen = 0x4000; - ba.szName = "TC0110PCR Ram"; - BurnAcb(&ba); - } - memset(&ba, 0, sizeof(ba)); - ba.Data = TC0110PCRPalette; - ba.nLen = TC0110PCRTotalColours * sizeof(UINT32); - ba.szName = "TC0110PCR Palette"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(TC0110PCRAddr); - } -} diff --git a/jan/src/burn/drv/taito/tc0140syt.cpp b/jan/src/burn/drv/taito/tc0140syt.cpp deleted file mode 100644 index e179fa2ac..000000000 --- a/jan/src/burn/drv/taito/tc0140syt.cpp +++ /dev/null @@ -1,247 +0,0 @@ -// TC0140SYT -// Based on MAME sources by Philip Bennett - -#include "burnint.h" -#include "z80_intf.h" -#include "taito_ic.h" - -#define TC0140SYT_PORT01_FULL (0x01) -#define TC0140SYT_PORT23_FULL (0x02) -#define TC0140SYT_PORT01_FULL_MASTER (0x04) -#define TC0140SYT_PORT23_FULL_MASTER (0x08) - -typedef struct TC0140SYT -{ - UINT8 SlaveData[4]; - UINT8 MasterData[4]; - UINT8 MainMode; - UINT8 SubMode; - UINT8 Status; - UINT8 NmiEnabled; - UINT8 NmiReq; -} TC0140SYT; - -static INT32 TC0140SYT_Z80_SELECT = 0; - -static struct TC0140SYT tc0140syt; - -static void InterruptController(void) -{ - tc0140syt.NmiReq = tc0140syt.Status & (TC0140SYT_PORT23_FULL | TC0140SYT_PORT01_FULL); - - ZetSetIRQLine(0x20, (tc0140syt.NmiReq && tc0140syt.NmiEnabled) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -void TC0140SYTPortWrite(UINT8 Data) -{ - Data &= 0x0f; - - tc0140syt.MainMode = Data; -} - -UINT8 TC0140SYTCommRead() -{ - switch (tc0140syt.MainMode) { - case 0x00: { - return tc0140syt.MasterData[tc0140syt.MainMode++]; - } - - case 0x01: { - tc0140syt.Status &= ~TC0140SYT_PORT01_FULL_MASTER; - return tc0140syt.MasterData[tc0140syt.MainMode++]; - } - - case 0x02: { - return tc0140syt.MasterData[tc0140syt.MainMode++]; - } - - case 0x03: { - tc0140syt.Status &= ~TC0140SYT_PORT23_FULL_MASTER; - return tc0140syt.MasterData[tc0140syt.MainMode++]; - } - - case 0x04: { - return tc0140syt.Status; - } - } - - return 0; -} - -void TC0140SYTCommWrite(UINT8 Data) -{ - Data &= 0x0f; - - switch (tc0140syt.MainMode) { - case 0x00: { - tc0140syt.SlaveData[tc0140syt.MainMode++] = Data; - return; - } - - case 0x01: { - tc0140syt.SlaveData[tc0140syt.MainMode++] = Data; - tc0140syt.Status |= TC0140SYT_PORT01_FULL; - ZetOpen(TC0140SYT_Z80_SELECT); - InterruptController(); - ZetClose(); - return; - } - - case 0x02: { - tc0140syt.SlaveData[tc0140syt.MainMode++] = Data; - return; - } - - case 0x03: { - tc0140syt.SlaveData[tc0140syt.MainMode++] = Data; - tc0140syt.Status |= TC0140SYT_PORT23_FULL; - ZetOpen(TC0140SYT_Z80_SELECT); - InterruptController(); - ZetClose(); - return; - } - - case 0x04: { - if (Data) { - ZetOpen(TC0140SYT_Z80_SELECT); - ZetReset(); - ZetClose(); - } - return; - } - } -} - -void TC0140SYTSlavePortWrite(UINT8 Data) -{ - Data &= 0x0f; - tc0140syt.SubMode = Data; -} - -UINT8 TC0140SYTSlaveCommRead() -{ - UINT8 nRet = 0; - - switch (tc0140syt.SubMode) { - case 0x00: { - nRet = tc0140syt.SlaveData[tc0140syt.SubMode++]; - break; - } - - case 0x01: { - tc0140syt.Status &= ~TC0140SYT_PORT01_FULL; - nRet = tc0140syt.SlaveData[tc0140syt.SubMode++]; - InterruptController(); - break; - } - - case 0x02: { - nRet = tc0140syt.SlaveData[tc0140syt.SubMode++]; - break; - } - - case 0x03: { - tc0140syt.Status &= ~TC0140SYT_PORT23_FULL; - nRet = tc0140syt.SlaveData[tc0140syt.SubMode++]; - InterruptController(); - break; - } - - case 0x04: { - nRet = tc0140syt.Status; - break; - } - } - - return nRet; -} - -void TC0140SYTSlaveCommWrite(UINT8 Data) -{ - Data &= 0x0f; - - switch (tc0140syt.SubMode) { - case 0x00: { - tc0140syt.MasterData[tc0140syt.SubMode++]= Data; - break; - } - - case 0x01: { - tc0140syt.MasterData[tc0140syt.SubMode++]= Data; - tc0140syt.Status |= TC0140SYT_PORT01_FULL_MASTER; - break; - } - - case 0x02: { - tc0140syt.MasterData[tc0140syt.SubMode++]= Data; - break; - } - - case 0x03: { - tc0140syt.MasterData[tc0140syt.SubMode++]= Data; - tc0140syt.Status |= TC0140SYT_PORT23_FULL_MASTER; - break; - } - - case 0x05: { - tc0140syt.NmiEnabled = 0; - InterruptController(); - break; - } - - case 0x06: { - tc0140syt.NmiEnabled = 1; - InterruptController(); - break; - } - } -} - -void TC0140SYTReset() -{ - for (INT32 i = 0; i < 4; i++) { - tc0140syt.SlaveData[i] = 0; - tc0140syt.MasterData[i] = 0; - } - - tc0140syt.MainMode = 0; - tc0140syt.SubMode = 0; - tc0140syt.Status = 0; - tc0140syt.NmiEnabled = 0; - tc0140syt.NmiReq = 0; -} - -void TC0140SYTInit(INT32 nCpu) -{ - TaitoIC_TC0140SYTInUse = 1; - TC0140SYT_Z80_SELECT = nCpu; -} - -void TC0140SYTExit() -{ - INT32 i; - - for (i = 0; i < 4; i++) { - tc0140syt.SlaveData[i] = 0; - tc0140syt.MasterData[i] = 0; - } - - tc0140syt.MainMode = 0; - tc0140syt.SubMode = 0; - tc0140syt.Status = 0; - tc0140syt.NmiEnabled = 0; - tc0140syt.NmiReq = 0; - TC0140SYT_Z80_SELECT = 0; -} - -void TC0140SYTScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(tc0140syt); - } -} - -#undef TC0140SYT_PORT01_FULL -#undef TC0140SYT_PORT23_FULL -#undef TC0140SYT_PORT01_FULL_MASTER -#undef TC0140SYT_PORT23_FULL_MASTER diff --git a/jan/src/burn/drv/taito/tc0150rod.cpp b/jan/src/burn/drv/taito/tc0150rod.cpp deleted file mode 100644 index db3703319..000000000 --- a/jan/src/burn/drv/taito/tc0150rod.cpp +++ /dev/null @@ -1,470 +0,0 @@ -// TC0150ROD -// Based on MAME sources by Nicola Salmoria - -#include "tiles_generic.h" -#include "taito_ic.h" - -UINT8 *TC0150RODRom = NULL; -UINT8 *TC0150RODRam = NULL; -static UINT8 *TC0150RODPriMap = NULL; - -static INT32 TC0150RODFlipScreenX; - -static void DrawScanLine(INT32 y, const UINT16 *src, INT32 Transparent, INT32 Pri) -{ - UINT16 *pPixel; - UINT8 *pPri; - INT32 Length; - - if (!TC0150RODFlipScreenX) { - pPixel = pTransDraw + (y * nScreenWidth); - pPri = TC0150RODPriMap + (y * nScreenWidth); - Length = nScreenWidth; - - if (Transparent) { - while (Length--) { - UINT16 sPixel = *src++; - if (sPixel < 0x7fff) { - *pPixel = sPixel; - if (TC0150RODPriMap) *pPri = Pri; - } - pPixel++; - if (TC0150RODPriMap) pPri++; - } - } else { - while (Length--) { - *pPixel++ = *src++; - if (TC0150RODPriMap) *pPri++ = Pri; - } - } - } else { - pPixel = pTransDraw + (y * nScreenWidth) + (nScreenWidth - 1); - pPri = TC0150RODPriMap + (y * nScreenWidth) + (nScreenWidth - 1); - Length = nScreenWidth; - - if (Transparent) { - while (Length--) { - UINT16 sPixel = *src++; - if (sPixel < 0x7fff) { - *pPixel = sPixel; - if (TC0150RODPriMap) *pPri = Pri; - } - pPixel--; - if (TC0150RODPriMap) pPri--; - } - } else { - while (Length--) { - *pPixel-- = *src++; - if (TC0150RODPriMap) *pPri-- = Pri; - } - } - } -} - -void TC0150RODDraw(INT32 yOffs, INT32 pOffs, INT32 Type, INT32 RoadTrans, INT32 LowPriority, INT32 HighPriority) -{ - INT32 xOffs = 0xa7; - yOffs += 16; - - UINT16* RoadRam = (UINT16*)TC0150RODRam; - - UINT16 ScanLine[512]; - UINT16 RoadALine[512]; - UINT16 RoadBLine[512]; - UINT16 *Dst16; - UINT16 *RoadA; - UINT16 *RoadB; - UINT16 *RoadGfx = (UINT16*)TC0150RODRom; - - UINT16 Pixel, Colour, GfxWord; - UINT16 RoadAClipL, RoadAClipR, RoadABodyCtrl; - UINT16 RoadBClipL, RoadBClipR, RoadBBodyCtrl;; - UINT16 Pri, PixPri; - UINT8 Priorities[6]; - INT32 xIndex, RoadRamIndex, RoadRam2Index, i; - INT32 xOffset, PalOffs, PalLOffs, PalROffs; - INT32 RoadGfxTileNum, ColBank, RoadCentre; - INT32 RoadCtrl = BURN_ENDIAN_SWAP_INT16(RoadRam[0xfff]); - INT32 LeftEdge, RightEdge, Begin, End, RightOver, LeftOver; - INT32 LineNeedsDrawing, DrawTopRoadLine, BackgroundOnly; - - INT32 y = 0; - - INT32 RoadAAddress = yOffs * 4 + ((RoadCtrl & 0x0300) << 2); - INT32 RoadBAddress = yOffs * 4 + ((RoadCtrl & 0x0c00) << 0); - - INT32 PrioritySwitchLine = (RoadCtrl & 0x00ff) - yOffs; - - do { - LineNeedsDrawing = 0; - RoadRamIndex = RoadAAddress + (y * 4); - RoadRam2Index = RoadBAddress + (y * 4); - - RoadA = RoadALine; - RoadB = RoadBLine; - - for (i = 0; i < nScreenWidth; i++) { - *RoadA++ = 0x8000; - *RoadB++ = 0x8000; - } - - Priorities[0] = 1; - Priorities[1] = 1; - Priorities[2] = 2; - Priorities[3] = 3; - Priorities[4] = 3; - Priorities[5] = 1; - - RoadAClipR = BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRamIndex + 0]); - RoadAClipL = BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRamIndex + 1]); - RoadABodyCtrl = BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRamIndex + 2]); - RoadBClipR = BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRam2Index + 0]); - RoadBClipL = BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRam2Index + 1]); - RoadBBodyCtrl = BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRam2Index + 2]); - - if (RoadABodyCtrl & 0x2000) Priorities[2] += 2; - if (RoadBBodyCtrl & 0x2000) Priorities[2] += 1; - if (RoadAClipL & 0x2000) Priorities[3] -= 1; - if (RoadBClipL & 0x2000) Priorities[3] -= 2; - if (RoadAClipR & 0x2000) Priorities[4] -= 1; - if (RoadBClipR & 0x2000) Priorities[4] -= 2; - - if (Priorities[4] == 0) Priorities[4]++; - - // Road A - PalROffs = (RoadAClipR & 0x1000) >> 11; - PalLOffs = (RoadAClipL & 0x1000) >> 11; - - xOffset = RoadABodyCtrl & 0x7ff; - PalOffs = (RoadABodyCtrl & 0x1800) >> 11; - ColBank = (BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRamIndex + 3]) & 0xf000) >> 10; - RoadGfxTileNum = BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRamIndex + 3]) & 0x3ff; - RightOver = 0; - LeftOver = 0; - - RoadCentre = 0x5ff - ((-xOffset + xOffs) & 0x7ff); - LeftEdge = RoadCentre - (RoadAClipL & 0x3ff); - RightEdge = RoadCentre + 1 + (RoadAClipR & 0x3ff); - - if (RoadAClipL || RoadAClipR) LineNeedsDrawing = 1; - - Begin = LeftEdge + 1; - if (Begin < 0) Begin = 0; - - End = RightEdge; - if (End > nScreenWidth) End = nScreenWidth; - - if (RightEdge < 0) { - RightOver = -RightEdge; - RightEdge = 0; - } - - if (LeftEdge >= nScreenWidth) - { - LeftOver = LeftEdge - nScreenWidth + 1; - LeftEdge = nScreenWidth - 1; - } - - BackgroundOnly = (RoadCentre > (nScreenWidth - 2 + (1024 / 2))) ? 1 : 0; - - Colour = ((pOffs + ColBank + PalOffs) << 4) + ((Type) ? (1) : (4)); - Pri = Priorities[2] << 12; - - xIndex = (-xOffset + xOffs + Begin) & 0x7ff; - RoadA = RoadALine + nScreenWidth - 1 - Begin; - - if ((LineNeedsDrawing) && (Begin < End)) { - for (i = Begin; i < End; i++) { - if (RoadGfxTileNum) { - GfxWord = BURN_ENDIAN_SWAP_INT16(RoadGfx[(RoadGfxTileNum << 8) + (xIndex >> 3)]); - Pixel = ((GfxWord >> (7 - (xIndex % 8) + 8)) & 1) * 2 + ((GfxWord >> (7 - (xIndex % 8))) & 1); - - if ((Pixel) || !(RoadTrans)) { - if (Type) Pixel = (Pixel - 1) & 3; - *RoadA-- = (Colour + Pixel) | Pri; - } - else *RoadA-- = 0xf000; - } - else RoadA--; - - xIndex++; - xIndex &= 0x7ff; - } - } - - // Left Edge of Road A - Colour = ((pOffs + ColBank + PalLOffs) << 4) + ((Type) ? (1) : (4)); - Pri = Priorities[0] << 12; - - if (BackgroundOnly) { - if (RoadAClipL & 0x8000) { - RoadA = RoadALine; - for (i = 0; i < nScreenWidth; i++) { - *RoadA++ = (Colour + (Type ? (3) : (0))); - } - } - } else { - if ((LeftEdge >= 0) && (LeftEdge < nScreenWidth)) { - xIndex = ((1024 / 2) - 1 - LeftOver) & 0x7ff; - - RoadA = RoadALine + nScreenWidth - 1 - LeftEdge; - - if (LineNeedsDrawing) { - for (i = LeftEdge; i >= 0; i--) { - GfxWord = BURN_ENDIAN_SWAP_INT16(RoadGfx[(RoadGfxTileNum << 8) + (xIndex >> 3)]); - Pixel = ((GfxWord >> (7 - (xIndex % 8) + 8)) & 1) * 2 + ((GfxWord >> (7 - (xIndex % 8))) & 1); - - PixPri = (Pixel == 0) ? (0) : (Pri); - - if ((Pixel == 0) && !(RoadAClipL & 0x8000)) { - RoadA++; - } else { - if (Type) Pixel = (Pixel - 1) & 3; - *RoadA++ = (Colour + Pixel) | PixPri; - } - - xIndex--; - xIndex &= 0x7ff; - } - } - } - } - - // Right Edge of Road A - Colour = ((pOffs + ColBank + PalROffs) << 4) + ((Type) ? (1) : (4)); - Pri = Priorities[1] << 12; - - if ((RightEdge < nScreenWidth) && (RightEdge >= 0)) { - xIndex = ((1024 / 2) + RightOver) & 0x7ff; - - RoadA = RoadALine + nScreenWidth - 1 - RightEdge; - - if (LineNeedsDrawing) { - for (i = RightEdge; i < nScreenWidth; i++) { - GfxWord = BURN_ENDIAN_SWAP_INT16(RoadGfx[(RoadGfxTileNum << 8) + (xIndex >> 3)]); - Pixel = ((GfxWord >> (7 - (xIndex % 8) + 8)) & 1) * 2 + ((GfxWord >> (7 - (xIndex % 8))) & 1); - - PixPri = (Pixel == 0) ? (0) : (Pri); - - if ((Pixel == 0) && !(RoadAClipR & 0x8000)) { - RoadA--; - } else { - if (Type) Pixel = (Pixel - 1) & 3; - *RoadA-- = (Colour + Pixel) | PixPri; - } - - xIndex++; - xIndex &= 0x7ff; - } - } - } - - // Road B - PalROffs = (RoadBClipR & 0x1000) >> 11; - PalLOffs = (RoadBClipL & 0x1000) >> 11; - xOffset = RoadBBodyCtrl & 0x7ff; - PalOffs = (RoadBBodyCtrl & 0x1800) >> 11; - ColBank = (BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRam2Index + 3]) & 0xf000) >> 10; - RoadGfxTileNum = BURN_ENDIAN_SWAP_INT16(RoadRam[RoadRam2Index + 3]) & 0x3ff; - RightOver = 0; - LeftOver = 0; - - RoadCentre = 0x5ff - ((-xOffset + xOffs) & 0x7ff); - - LeftEdge = RoadCentre - (RoadBClipL & 0x3ff); - RightEdge = RoadCentre + 1 + (RoadBClipR & 0x3ff); - - if (((RoadBClipL) || (RoadBClipR)) && ((RoadCtrl & 0x800) || (Type == 2))) { - DrawTopRoadLine = 1; - LineNeedsDrawing = 1; - } - else { - DrawTopRoadLine = 0; - } - - Begin = LeftEdge + 1; - if (Begin < 0) Begin = 0; - - End = RightEdge; - if (End > nScreenWidth) { - End = nScreenWidth; - } - - if (RightEdge < 0) { - RightOver = -RightEdge; - RightEdge = 0; - } - - if (LeftEdge >= nScreenWidth) - { - LeftOver = LeftEdge - nScreenWidth + 1; - LeftEdge = nScreenWidth - 1; - } - - BackgroundOnly = (RoadCentre > (nScreenWidth - 2 + (1024 / 2))) ? 1 : 0; - - Colour = ((pOffs + ColBank + PalOffs) << 4) + ((Type) ? (1) : (4)); - Pri = Priorities[5] << 12; - - xIndex = (-xOffset + xOffs + Begin) & 0x7ff; - - if (xIndex > 0x3ff) { - RoadB = RoadBLine + nScreenWidth - 1 - Begin; - - if (DrawTopRoadLine && RoadGfxTileNum && (Begin < End)) { - for (i = Begin; i < End; i++) { - GfxWord = BURN_ENDIAN_SWAP_INT16(RoadGfx[(RoadGfxTileNum << 8) + (xIndex >> 3)]); - Pixel = ((GfxWord >> (7 - (xIndex % 8) + 8)) & 1) * 2 + ((GfxWord >> (7 - (xIndex % 8))) & 1); - - if ((Pixel) || !(RoadTrans)) { - if (Type) Pixel = (Pixel - 1) & 3; - *RoadB-- = (Colour + Pixel) | Pri; - } - else *RoadB-- = 0xf000; - - xIndex++; - xIndex &= 0x7ff; - } - } - } - - // Left Edge of Road B - Colour = ((pOffs + ColBank + PalLOffs) << 4) + ((Type) ? (1) : (4)); - Pri = Priorities[3] << 12; - - if (BackgroundOnly) { - if ((RoadBClipL & 0x8000) && DrawTopRoadLine) { - RoadB = RoadBLine; - for (i = 0; i < nScreenWidth; i++) { - *RoadB++ = (Colour + (Type ? (3) : (0))); - } - } - } else { - if ((LeftEdge >= 0) && (LeftEdge < nScreenWidth)) { - xIndex = ((1024 / 2) - 1 - LeftOver) & 0x7ff; - - RoadB = RoadBLine + nScreenWidth - 1 - LeftEdge; - - if (LineNeedsDrawing) { - for (i = LeftEdge; i >= 0; i--) { - GfxWord = BURN_ENDIAN_SWAP_INT16(RoadGfx[(RoadGfxTileNum << 8) + (xIndex >> 3)]); - Pixel = ((GfxWord >> (7 - (xIndex % 8) + 8)) & 1) * 2 + ((GfxWord >> (7 - (xIndex % 8))) & 1); - - PixPri = (Pixel == 0) ? (0) : (Pri); - - if ((Pixel == 0) && !(RoadBClipL & 0x8000)) { - RoadB++; - } else { - if (Type) Pixel = (Pixel - 1) & 3; - *RoadB++ = (Colour + Pixel) | PixPri; - } - - xIndex--; - if (xIndex < 0) break; - } - } - } - } - - // Right Edge of Road B - Colour = ((pOffs + ColBank + PalROffs) << 4) + ((Type) ? (1) : (4)); - Pri = Priorities[4] << 12; - - if ((RightEdge < nScreenWidth) && (RightEdge >= 0)) { - xIndex = ((1024 / 2) + RightOver) & 0x7ff; - - RoadB = RoadBLine + nScreenWidth - 1 - RightEdge; - - if (DrawTopRoadLine) { - for (i = RightEdge; i < nScreenWidth; i++) { - GfxWord = BURN_ENDIAN_SWAP_INT16(RoadGfx[(RoadGfxTileNum << 8) + (xIndex >> 3)]); - Pixel = ((GfxWord >> (7 - (xIndex % 8) + 8)) & 1) * 2 + ((GfxWord >> (7 - (xIndex % 8))) & 1); - - PixPri = (Pixel == 0) ? (0) : (Pri); - - if ((Pixel == 0) && !(RoadBClipR & 0x8000)) { - RoadB--; - } else { - if (Type) Pixel = (Pixel - 1) & 3; - *RoadB-- = (Colour + Pixel) | PixPri; - } - - xIndex++; - if (xIndex > 0x3ff) break; - } - } - } - - if (LineNeedsDrawing) { - Dst16 = ScanLine; - - for (i = 0; i < nScreenWidth; i++) { - if (RoadALine[i] == 0x8000) { - *Dst16++ = RoadBLine[i] & 0x8fff; - } - else if (RoadBLine[i] == 0x8000) { - *Dst16++ = RoadALine[i] & 0x8fff; - } - else { - if ((RoadBLine[i] & 0x7000) > (RoadALine[i] & 0x7000)) { - *Dst16++ = RoadBLine[i] & 0x8fff; - } else { - *Dst16++ = RoadALine[i] & 0x8fff; - } - } - } - - if (y > PrioritySwitchLine) { - DrawScanLine(y, ScanLine, 1, HighPriority); - } else { - DrawScanLine(y, ScanLine, 1, LowPriority); - } - } - - y++; - } while (y < nScreenHeight); -} - -void TC0150RODReset() -{ - -} - -void TC0150RODSetPriMap(UINT8 *PriMap) -{ - TC0150RODPriMap = PriMap; -} - -void TC0150RODInit(INT32 nRomSize, INT32 xFlip) -{ - TC0150RODRom = (UINT8*)BurnMalloc(nRomSize); - memset(TC0150RODRom, 0, nRomSize); - TC0150RODRam = (UINT8*)BurnMalloc(0x2000); - memset(TC0150RODRam, 0, 0x2000); - - TC0150RODFlipScreenX = xFlip; - - TaitoIC_TC0150RODInUse = 1; -} - -void TC0150RODExit() -{ - BurnFree(TC0150RODRom); - BurnFree(TC0150RODRam); - - TC0150RODPriMap = NULL; - TC0150RODFlipScreenX = 0; -} - -void TC0150RODScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TC0150RODRam; - ba.nLen = 0x2000; - ba.szName = "TC0150ROD Ram"; - BurnAcb(&ba); - } -} diff --git a/jan/src/burn/drv/taito/tc0180vcu.cpp b/jan/src/burn/drv/taito/tc0180vcu.cpp deleted file mode 100644 index 850049054..000000000 --- a/jan/src/burn/drv/taito/tc0180vcu.cpp +++ /dev/null @@ -1,689 +0,0 @@ -// Based on MAME sources by Nicola Salmoria - -#include "tiles_generic.h" -#include "taito_ic.h" -#include "taito.h" - -UINT8 *TC0180VCURAM; -UINT8 *TC0180VCUScrollRAM; -UINT8 *TC0180VCUFbRAM; // framebuffer ram - -static UINT16 *TC0180VCUFramebuffer[2]; - -static INT32 TC0180VCU_y_offset; -static INT32 TC0180VCU_x_offset; - -static UINT8 TC0180VCUControl[0x10]; - -static UINT8 *tiledata[2]; -static UINT32 tilemask[2]; -static UINT8 *transtiletab[2]; - -static UINT8 *dummy_tile = NULL; - -static INT32 *TC0180VCU_scrollx[2]; -static INT32 *TC0180VCU_scrolly[2]; - -static INT32 flipscreen; -static INT32 framebuffer_page; - -void TC0180VCUFramebufferWrite(INT32 offset) -{ - offset &= 0x3fffe; - INT32 data = *((UINT16*)(TC0180VCUFbRAM + offset)); - - INT32 fb = (offset >> 17) & 1; - - offset &= 0x1fffe; - - TC0180VCUFramebuffer[fb][offset + 0] = data >> 8; - TC0180VCUFramebuffer[fb][offset + 1] = data & 0xff; -} - -UINT16 TC0180VCUFramebufferRead(INT32 offset) -{ - offset &= 0x3fffe; - - INT32 fb = (offset >> 17) & 1; - - offset &= 0x1fffe; - - return (TC0180VCUFramebuffer[fb][offset + 0] << 8) | (TC0180VCUFramebuffer[fb][offset + 1] & 0xff); -} - -UINT8 TC0180VCUReadControl() -{ - return TC0180VCUControl[7]; -} - -UINT8 TC0180VCUReadRegs(INT32 offset) -{ - offset >>= 1; - offset &= 0x0f; - - return TC0180VCUControl[offset]; -} - -void TC0180VCUWriteRegs(INT32 offset, INT32 data) -{ - offset >>= 1; - offset &= 0x0f; - - TC0180VCUControl[offset] = data; - - if (offset == 7) { - if (data & 0x80) { - framebuffer_page = (data & 0x40) ? 0 : 1; - } - } -} - -void TC0180VCUReset() -{ - for (INT32 i = 0; i < 2; i++) { - - memset (TC0180VCUFramebuffer[i], 0, 512 * 256 * sizeof(UINT16)); - memset (TC0180VCU_scrollx[i], 0, 256 * sizeof(INT32)); - memset (TC0180VCU_scrolly[i], 0, 256 * sizeof(INT32)); - } - - memset (TC0180VCUControl, 0, 16); - memset (TC0180VCURAM, 0, 0x010000); - memset (TC0180VCUScrollRAM, 0, 0x000800); - memset (TC0180VCUFbRAM, 0, 0x040000); - - flipscreen = 0; - framebuffer_page = 0; -} - -static void create_transtile_table(INT32 tile) -{ - INT32 size = (tile) ? (16 * 16) : (8 * 8); - - if (tilemask[tile]) { - INT32 len = (tilemask[tile] + 1); - - transtiletab[tile] = (UINT8*)BurnMalloc(len); - - memset (transtiletab[tile], 1, len); - - for (INT32 i = 0; i < len * size; i++) - { - if (tiledata[tile][i]) { - transtiletab[tile][i / size] = 0; - i|=(size-1); - } - } - } -} - -void TC0180VCUInit(UINT8 *gfx0, INT32 mask0, UINT8 *gfx1, INT32 mask1, INT32 global_x, INT32 global_y) -{ - TaitoIC_TC0180VCUInUse = 1; - - for (INT32 i = 0; i < 2; i++) - { - TC0180VCUFramebuffer[i] = (UINT16*)BurnMalloc(512 * 256 * sizeof(UINT16)); - TC0180VCU_scrollx[i] = (INT32*)BurnMalloc(257 * sizeof(INT32)); - TC0180VCU_scrolly[i] = (INT32*)BurnMalloc(257 * sizeof(INT32)); - } - - TC0180VCURAM = (UINT8*)BurnMalloc(0x010000); - TC0180VCUScrollRAM = (UINT8*)BurnMalloc(0x000800); - TC0180VCUFbRAM = (UINT8*)BurnMalloc(0x040000); - - tilemask[0] = mask0; - tilemask[1] = mask1; - tiledata[0] = gfx0; - tiledata[1] = gfx1; - - if (mask0) create_transtile_table(0); - if (mask1) create_transtile_table(1); - - if (mask0 == 0) { - dummy_tile = (UINT8*)BurnMalloc(0x100); - transtiletab[1] = (UINT8*)BurnMalloc(1); - tiledata[1] = dummy_tile; - } - - TC0180VCU_y_offset = global_y; - TC0180VCU_x_offset = global_x; - - TC0180VCUReset(); -} - -void TC0180VCUExit() -{ - for (INT32 i = 0; i < 2; i++) - { - BurnFree (TC0180VCU_scrollx[i]); - BurnFree (TC0180VCU_scrolly[i]); - - tilemask[i] = ~0; - tiledata[i] = NULL; - - BurnFree (TC0180VCUFramebuffer[i]); - BurnFree (transtiletab[i]); - } - - BurnFree (dummy_tile); - BurnFree (TC0180VCURAM); - BurnFree (TC0180VCUScrollRAM); - BurnFree (TC0180VCUFbRAM); - - TC0180VCU_y_offset = 0; - TC0180VCU_x_offset = 0; -} - -static void update_scroll(INT32 plane) -{ - flipscreen = TC0180VCUReadControl() & 0x10; - - UINT16 *scrollram = (UINT16*)TC0180VCUScrollRAM; - - INT32 lines_per_block = 256 - TC0180VCUControl[2 + plane]; - INT32 number_of_blocks = 256 / lines_per_block; - - for (INT32 i = 0; i < number_of_blocks; i++) - { - INT32 scrollx = BURN_ENDIAN_SWAP_INT16(scrollram[plane * 0x200 + i * 2 * lines_per_block + 0]); - INT32 scrolly = BURN_ENDIAN_SWAP_INT16(scrollram[plane * 0x200 + i * 2 * lines_per_block + 1]); - - INT32 min_y = (i + 0) * lines_per_block - 0; - INT32 max_y = (i + 1) * lines_per_block - 1; - - if (min_y <= max_y) - { - for (INT32 y = min_y; y <= max_y; y++) { - TC0180VCU_scrollx[plane][y] = -(scrollx & 0x3ff); - TC0180VCU_scrolly[plane][y] = -(scrolly & 0x3ff); - } - } - } -} - -void TC0180VCUDrawLayer(INT32 colorbase, INT32 ctrl_offset, INT32 transparent) // 0, -1 -{ - update_scroll(ctrl_offset); - - UINT16 *ram = (UINT16*)TC0180VCURAM; - - INT32 bank0 = (TC0180VCUControl[ctrl_offset] << 12) & 0xf000; // tile bank - INT32 bank1 = (TC0180VCUControl[ctrl_offset] << 8) & 0xf000; // color bank - - INT32 *scroll_x = TC0180VCU_scrollx[ctrl_offset]; - INT32 *scroll_y = TC0180VCU_scrolly[ctrl_offset]; - - INT32 lines = TC0180VCUControl[2 + ctrl_offset]; - - if (lines) - { - INT32 screen_width = nScreenWidth - 1; - INT32 screen_height = nScreenHeight - 1; - - UINT16 *dest; - - for (INT32 sy = 0; sy < nScreenHeight; sy++) - { - if (flipscreen) { - dest = pTransDraw + (screen_height - sy) * nScreenWidth; - } else { - dest = pTransDraw + sy * nScreenWidth; - } - - INT32 scly = (sy + scroll_y[(sy + TC0180VCU_y_offset) & 0xff] + TC0180VCU_y_offset) & 0x3ff; - - INT32 scly_off = (scly >> 4) << 6; - INT32 scly_ts = (scly & 0x0f) << 4; - - INT32 sclx_base = scroll_x[(sy + TC0180VCU_y_offset) & 0xff] + TC0180VCU_x_offset; - - for (INT32 sx = 0; sx < nScreenWidth + 16; sx+=16) - { - INT32 sclx = (sx + sclx_base) & 0x3ff; - - INT32 offs = scly_off | (sclx >> 4); - - INT32 attr = BURN_ENDIAN_SWAP_INT16(ram[offs + bank1]); - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs + bank0]); - INT32 color = (attr & 0x003f) + colorbase; - code &= tilemask[1]; - - if (!transparent) { - if (transtiletab[1][code]) continue; - } - - { - INT32 sx4 = sx - (sclx & 0x0f); - - color <<= 4; - UINT8 *src = tiledata[1] + code * 256; - - if (attr & 0x80) { // flipy - src += (scly_ts ^ 0xf0); - } else { - src += (scly_ts); - } - - INT32 flipx = ((attr & 0x40) >> 6) * 0x0f; - - if (flipscreen) { - if (!transparent) { // transparency - for (INT32 sxx = 0; sxx < 16; sxx++, sx4++) { - if (sx4 >= nScreenWidth || sx4 < 0) continue; - - INT32 pxl = src[sxx ^ flipx]; - - if (pxl != transparent) { - dest[(screen_width - sx4)] = pxl | color; - } - } - } else { - for (INT32 sxx = 0; sxx < 16; sxx++, sx4++) { - if (sx4 >= nScreenWidth || sx4 < 0) continue; - - dest[(screen_width - sx4)] = src[sxx ^ flipx] | color; - } - } - } else { - if (!transparent) { // transparency - for (INT32 sxx = 0; sxx < 16; sxx++, sx4++) { - if (sx4 >= nScreenWidth || sx4 < 0) continue; - - INT32 pxl = src[sxx ^ flipx]; - - if (pxl != transparent) { - dest[sx4] = pxl | color; - } - } - } else { - for (INT32 sxx = 0; sxx < 16; sxx++, sx4++) { - if (sx4 >= nScreenWidth || sx4 < 0) continue; - - dest[sx4] = src[sxx ^ flipx] | color; - } - } - } - } - } - } - } - else - { - for (INT32 offs = 0; offs < 64 * 64; offs++) - { - INT32 sx = (offs & 0x3f) << 4; - INT32 sy = (offs >> 6) << 4; - - sy -= scroll_y[(sy + TC0180VCU_y_offset) & 0xff]; - if (sy >= 0x400-15) sy -= 0x400; - - sx -= scroll_x[(sy + TC0180VCU_y_offset) & 0xff]; - if (sx >= 0x400-15) sx -= 0x400; - - INT32 attr = BURN_ENDIAN_SWAP_INT16(ram[offs + bank1]); - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs + bank0]); - - INT32 color = (attr & 0x003f) + colorbase; - INT32 flipx = (attr & 0x0040); - INT32 flipy = (attr & 0x0080); - - code &= tilemask[1]; - - if (flipscreen) { - sx = (nScreenWidth - 16) - sx; - sy = 240 - sy; - flipx ^= 0x40; - flipy ^= 0x80; - } - - sx -= TC0180VCU_x_offset; - sy -= TC0180VCU_y_offset; - - if (!transparent) { - if (transtiletab[1][code]) continue; - - if (sy >= 0 && sy < (nScreenHeight - 15) && sx >= 0 && sx < (nScreenWidth - 15)) { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, 0, tiledata[1]); - } else { - Render16x16Tile_Mask_FlipY(pTransDraw, code, sx, sy, color, 4, 0, 0, tiledata[1]); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX(pTransDraw, code, sx, sy, color, 4, 0, 0, tiledata[1]); - } else { - Render16x16Tile_Mask(pTransDraw, code, sx, sy, color, 4, 0, 0, tiledata[1]); - } - } - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, tiledata[1]); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, tiledata[1]); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, tiledata[1]); - } else { - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, tiledata[1]); - } - } - } - } else { - if (sy >= 0 && sy < (nScreenHeight - 15) && sx >= 0 && sx < (nScreenWidth - 15)) { - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY(pTransDraw, code, sx, sy, color, 4, 0, tiledata[1]); - } else { - Render16x16Tile_FlipY(pTransDraw, code, sx, sy, color, 4, 0, tiledata[1]); - } - } else { - if (flipx) { - Render16x16Tile_FlipX(pTransDraw, code, sx, sy, color, 4, 0, tiledata[1]); - } else { - Render16x16Tile(pTransDraw, code, sx, sy, color, 4, 0, tiledata[1]); - } - } - } else { - if (flipy) { - if (flipx) { - Render16x16Tile_FlipXY_Clip(pTransDraw, code, sx, sy, color, 4, 0, tiledata[1]); - } else { - Render16x16Tile_FlipY_Clip(pTransDraw, code, sx, sy, color, 4, 0, tiledata[1]); - } - } else { - if (flipx) { - Render16x16Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 4, 0, tiledata[1]); - } else { - Render16x16Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, tiledata[1]); - } - } - } - } - } - } -} - -void TC0180VCUDrawCharLayer(INT32 colorbase) -{ - if (tilemask[0] == 0) return; - - UINT16 *ram = (UINT16*)TC0180VCURAM; - - INT32 bank0 = (TC0180VCUControl[6] & 0x0f) << 11; // tile bank - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) << 3; - INT32 sy = (offs >> 6) << 3; - - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs + bank0]); - INT32 color = (code >> 12) + colorbase; - - code = (code & 0x07ff) | (TC0180VCUControl[4 + ((code & 0x800) >> 11)] << 11); - - code &= tilemask[0]; - - if (transtiletab[0][code]) continue; - - if (flipscreen) { - sx = (nScreenWidth - 8) - sx; - sy = 248 - sy; - - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, code, sx - TC0180VCU_x_offset, sy - TC0180VCU_y_offset, color, 4, 0, 0, tiledata[0]); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx - TC0180VCU_x_offset, sy - TC0180VCU_y_offset, color, 4, 0, 0, tiledata[0]); - } - } -} - -void TC0180VCUFramebufferDraw(INT32 priority, INT32 color_base) -{ - priority <<= 4; - - INT32 ctrl = TC0180VCUReadControl(); - - if (ctrl & 0x08) - { - if (ctrl & 0x10) // flip screen - { - for (INT32 y = 0; y < nScreenHeight; y++) - { - UINT16 *src = TC0180VCUFramebuffer[framebuffer_page & 1] + (y + TC0180VCU_y_offset) * 512 + TC0180VCU_x_offset; - UINT16 *dst = pTransDraw + ((nScreenHeight - 1) - y) * nScreenWidth + (nScreenWidth - 1); - - for (INT32 x = 0; x < nScreenWidth; x++) - { - INT32 c = *src++; - - if (c != 0) *dst = color_base + c; - dst--; - } - } - } - else - { - for (INT32 y = 0; y < nScreenHeight; y++) - { - UINT16 *src = TC0180VCUFramebuffer[framebuffer_page & 1] + (y + TC0180VCU_y_offset) * 512 + TC0180VCU_x_offset; - UINT16 *dst = pTransDraw + y * nScreenWidth; - - for (INT32 x = 0; x < nScreenWidth; x++) - { - INT32 c = *src++; - - if (c != 0) *dst = color_base + c; - dst++; - } - } - } - } - else - { - if (ctrl & 0x10) // flip screen - { - for (INT32 y = 0; y < nScreenHeight; y++) - { - UINT16 *src = TC0180VCUFramebuffer[framebuffer_page & 1] + (y + TC0180VCU_y_offset) * 512 + TC0180VCU_x_offset; - UINT16 *dst = pTransDraw + ((nScreenHeight - 1) - y) * nScreenWidth + (nScreenWidth - 1); - - for (INT32 x = 0; x < nScreenWidth; x++) - { - INT32 c = *src++; - - if (c != 0 && (c & 0x10) == priority) - *dst = color_base + c; - dst--; - } - } - } - else - { - for (INT32 y = 0; y < nScreenHeight; y++) - { - UINT16 *src = TC0180VCUFramebuffer[framebuffer_page & 1] + (y + TC0180VCU_y_offset) * 512 + TC0180VCU_x_offset; - UINT16 *dst = pTransDraw + y * nScreenWidth; - - for (INT32 x = 0; x < nScreenWidth; x++) - { - INT32 c = *src++; - - if (c != 0 && (c & 0x10) == priority) - *dst = color_base + c; - dst++; - } - } - } - } -} - -void TC0180VCUDrawSprite(UINT16 *dest) -{ - //INT32 t_swide = nScreenWidth; nScreenWidth = 512; // hack to allow use of generic tile routines - //INT32 t_shigh = nScreenHeight; nScreenHeight = 256; - // The above method can no longer be used, instead, use this below: (Keep for reference!) - - GenericTilesSetClipRaw(0, 512, 0, 256); - - INT32 xlatch = 0; - INT32 ylatch = 0; - INT32 x_no = 0; - INT32 y_no = 0; - INT32 x_num = 0; - INT32 y_num = 0; - INT32 big_sprite = 0; - UINT32 zoomx; - UINT32 zoomy; - UINT32 zx; - UINT32 zy; - UINT32 zoomxlatch = 0; - UINT32 zoomylatch = 0; - - UINT16 *ram = (UINT16*)TaitoSpriteRam; - - for (INT32 offs = (0x1980 - 16) / 2; offs >=0; offs -= 8) - { - INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs + 0]) & tilemask[1]; - INT32 color = BURN_ENDIAN_SWAP_INT16(ram[offs + 1]); - INT32 x = BURN_ENDIAN_SWAP_INT16(ram[offs + 2]) & 0x03ff; - INT32 y = BURN_ENDIAN_SWAP_INT16(ram[offs + 3]) & 0x03ff; - - INT32 data = BURN_ENDIAN_SWAP_INT16(ram[offs + 5]); - - INT32 flipx = color & 0x4000; - INT32 flipy = color & 0x8000; - - if (x >= 0x200) x -= 0x400; - if (y >= 0x200) y -= 0x400; - - if (data) - { - if (!big_sprite) - { - x_num = (data >> 8) & 0xff; - y_num = (data >> 0) & 0xff; - x_no = 0; - y_no = 0; - xlatch = x; - ylatch = y; - data = BURN_ENDIAN_SWAP_INT16(ram[offs + 4]); - zoomxlatch = (data >> 8) & 0xff; - zoomylatch = (data >> 0) & 0xff; - big_sprite = 1; - } - } - - data = BURN_ENDIAN_SWAP_INT16(ram[offs + 4]); - zoomx = (data >> 8) & 0xff; - zoomy = (data >> 0) & 0xff; - zx = (0x100 - zoomx) / 16; - zy = (0x100 - zoomy) / 16; - - if (big_sprite) - { - zoomx = zoomxlatch; - zoomy = zoomylatch; - - x = xlatch + x_no * (0x100 - zoomx) / 16; - y = ylatch + y_no * (0x100 - zoomy) / 16; - zx = xlatch + (x_no + 1) * (0x100 - zoomx) / 16 - x; - zy = ylatch + (y_no + 1) * (0x100 - zoomy) / 16 - y; - y_no++; - - if (y_no > y_num) - { - y_no = 0; - x_no++; - - if (x_no > x_num) big_sprite = 0; - } - } - - if (zoomx || zoomy ) - { - RenderZoomedTile(dest, tiledata[1], code, (color & 0x3f) << 4, 0, x, y, flipx, flipy, 16, 16, zx << 12, zy << 12); - } - else - { - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(dest, code, x, y, color & 0x3f, 4, 0, 0, tiledata[1]); - } else { - Render16x16Tile_Mask_FlipY_Clip(dest, code, x, y, color & 0x3f, 4, 0, 0, tiledata[1]); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(dest, code, x, y, color & 0x3f, 4, 0,0, tiledata[1]); - } else { - Render16x16Tile_Mask_Clip(dest, code, x, y, color & 0x3f, 4, 0, 0, tiledata[1]); - } - } - } - } - - //nScreenWidth = t_swide; - //nScreenHeight = t_shigh; - // Like above, use this to revert the ClipRaw() changes, instead of setting the nScreenWidth/Height directly. - GenericTilesClearClipRaw(); -} - -void TC0180VCUBufferSprites() -{ - INT32 ctrl = TC0180VCUReadControl(); - - if (~ctrl & 0x01) { - memset (TC0180VCUFbRAM + framebuffer_page * 0x20000, 0, 512 * 256); - memset (TC0180VCUFramebuffer[framebuffer_page], 0, 512 * 256 * sizeof(UINT16)); - } - - if (~ctrl & 0x80) { - framebuffer_page ^= 1; - } - - if (tilemask[1]) { - TC0180VCUDrawSprite(TC0180VCUFramebuffer[framebuffer_page]); - } -} - -void TC0180VCUScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_VOLATILE) - { - ba.Data = (UINT8*)TC0180VCUFramebuffer[0]; - ba.nLen = 512 * 256 * sizeof(UINT16); - ba.szName = "Framebuffer 0"; - BurnAcb(&ba); - - ba.Data = (UINT8*)TC0180VCUFramebuffer[1]; - ba.nLen = 512 * 256 * sizeof(UINT16); - ba.szName = "Framebuffer 1"; - BurnAcb(&ba); - - ba.Data = TC0180VCURAM; - ba.nLen = 0x10000; - ba.szName = "Tilemap RAM"; - BurnAcb(&ba); - - ba.Data = TC0180VCUScrollRAM; - ba.nLen = 0x00800; - ba.szName = "Scroll RAM"; - BurnAcb(&ba); - - ba.Data = TC0180VCUFbRAM; - ba.nLen = 0x00800; - ba.szName = "Framebuffer RAM"; - BurnAcb(&ba); - - ba.Data = TC0180VCUControl; - ba.nLen = 0x00010; - ba.szName = "Control RAM"; - BurnAcb(&ba); - - SCAN_VAR(framebuffer_page); - } -} diff --git a/jan/src/burn/drv/taito/tc0220ioc.cpp b/jan/src/burn/drv/taito/tc0220ioc.cpp deleted file mode 100644 index e6eb68b39..000000000 --- a/jan/src/burn/drv/taito/tc0220ioc.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// TC0220IOC -// Based on MAME sources by Nicola Salmoria - -#include "burnint.h" -#include "taito_ic.h" - -UINT8 TC0220IOCInputPort0[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0220IOCInputPort1[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0220IOCInputPort2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0220IOCDip[2] = { 0, 0 }; - -UINT8 TC0220IOCInput[6] = { 0, 0, 0, 0, 0, 0 }; - -static UINT8 TC0220IOCRegs[8]; -static UINT8 TC0220IOCPort; - -extern UINT8 TaitoCoinLockout[4]; - -UINT8 TC0220IOCPortRead() -{ - return TC0220IOCPort; -} - -UINT8 TC0220IOCHalfWordPortRead() -{ - return TC0220IOCPortRead(); -} - -UINT8 TC0220IOCRead(UINT8 Port) -{ - switch (Port) { - case 0x00: { - return TC0220IOCDip[0]; - } - - case 0x01: { - return TC0220IOCDip[1]; - } - - case 0x02: { - return TC0220IOCInput[0]; - } - - case 0x03: { - return TC0220IOCInput[1]; - } - - case 0x04: { - return TC0220IOCRegs[4]; - } - - case 0x07: { - return TC0220IOCInput[2]; - } - } - - bprintf(PRINT_IMPORTANT, _T("Unmapped TC0220IOC Read at %x\n"), Port); - - return 0; -} - -UINT8 TC0220IOCPortRegRead() -{ - return TC0220IOCRead(TC0220IOCPort); -} - -UINT8 TC0220IOCHalfWordRead(INT32 Offset) -{ - return TC0220IOCRead(Offset); -} - -void TC0220IOCWrite(UINT8 Port, UINT8 Data) -{ - TC0220IOCRegs[Port] = Data; - - if (Port == 0) { - TaitoWatchdog = 0; - } - - if (Port == 4) { - TaitoCoinLockout[0] = ~Data & 0x01; - TaitoCoinLockout[1] = ~Data & 0x02; - // coin counters 0x04 & 0x08 - } -} - -void TC0220IOCHalfWordPortRegWrite(UINT16 Data) -{ - TC0220IOCWrite(TC0220IOCPort, Data & 0xff); -} - -static void TC0220IOCPortWrite(UINT8 Data) -{ - TC0220IOCPort = Data; -} - -void TC0220IOCHalfWordPortWrite(UINT16 Data) -{ - TC0220IOCPortWrite(Data & 0xff); -} - -void TC0220IOCHalfWordWrite(INT32 Offset, UINT16 Data) -{ - TC0220IOCWrite(Offset, Data & 0xff); -} - -void TC0220IOCReset() -{ - memset(TC0220IOCRegs, 0, 8); - TC0220IOCPort = 0; -} - -void TC0220IOCInit() -{ - TaitoIC_TC0220IOCInUse = 1; -} - -void TC0220IOCExit() -{ - memset(TC0220IOCRegs, 0, 8); - TC0220IOCPort = 0; -} - -void TC0220IOCScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(TC0220IOCInputPort0); - SCAN_VAR(TC0220IOCInputPort1); - SCAN_VAR(TC0220IOCInputPort2); - SCAN_VAR(TC0220IOCDip); - SCAN_VAR(TC0220IOCInput); - SCAN_VAR(TC0220IOCRegs); - SCAN_VAR(TC0220IOCPort); - } -} diff --git a/jan/src/burn/drv/taito/tc0280grd.cpp b/jan/src/burn/drv/taito/tc0280grd.cpp deleted file mode 100644 index d2885987e..000000000 --- a/jan/src/burn/drv/taito/tc0280grd.cpp +++ /dev/null @@ -1,216 +0,0 @@ -// TC0280GRD -// Based on MAME sources by Nicola Salmoria - -#include "tiles_generic.h" -#include "taito_ic.h" - -UINT8 *TC0280GRDRam; -static UINT16 TC0280GRDCtrl[8]; -INT32 TC0280GRDBaseColour; -static INT32 TC0280GRDxMultiply; -static INT32 TC0280GRDXOffset; -static INT32 TC0280GRDYOffset; -static UINT8 *pTC0280GRDSrc = NULL; - -static UINT16 *pRozTileMapData = NULL; - -#define PLOTPIXEL_MASK(x, mc, po) if (pTileData[x] != mc) {pPixel[x] = nPalette | pTileData[x] | po;} - -static void RenderTile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * 512) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += 512, pTileData += 8) { - PLOTPIXEL_MASK( 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 7, nMaskColour, nPaletteOffset); - } -} - -#undef PLOTPIXEL_MASK - -static void RozRender(UINT32 xStart, UINT32 yStart, INT32 xxInc, INT32 xyInc, INT32 yxInc, INT32 yyInc) -{ - UINT32 cx; - UINT32 cy; - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, Pix; - UINT16 *Dest = NULL; - UINT16 *VideoRam = (UINT16*)TC0280GRDRam; - - if (xxInc == (1 << 16) && xyInc == 0 && yxInc == 0 && yyInc == (1 << 16)) { - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Code = (Attr & 0x3fff); - Colour = ((Attr & 0xc000) >> 14) + TC0280GRDBaseColour; - - x = 8 * mx; - y = 8 * my; - - x -= (xStart >> 16) & 0x1ff; - y -= (yStart >> 16) & 0x1ff; - - if (x < -8) x += 512; - if (y < -8) y += 512; - - if (x >= 0 && x < (nScreenWidth - 8) && y >= 0 && y < (nScreenHeight - 8)) { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, pTC0280GRDSrc); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, pTC0280GRDSrc); - } - - TileIndex++; - } - } - - return; - } - - memset(pRozTileMapData, 0, 512 * 512 * sizeof(UINT16)); - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Code = (Attr & 0x3fff); - Colour = ((Attr & 0xc000) >> 14) + TC0280GRDBaseColour; - - x = 8 * mx; - y = 8 * my; - - RenderTile_Mask(pRozTileMapData, Code, x, y, Colour, 4, 0, 0, pTC0280GRDSrc); - - TileIndex++; - } - } - - y = 0; - while (y < nScreenHeight) { - x = 0; - cx = xStart; - cy = yStart; - - Dest = pTransDraw + (y * nScreenWidth); - - while (x < nScreenWidth) { - Pix = pRozTileMapData[(((cy >> 16) & 0x1ff) * 512) + ((cx >> 16) & 0x1ff)]; - if (Pix) { - *Dest++ = Pix; - } else { - Dest++; - } - - cx += xxInc; - cy += xyInc; - x++; - } - - xStart += yxInc; - yStart += yyInc; - y++; - } -} - -void TC0280GRDRenderLayer() -{ - UINT32 xStart, yStart; - INT32 xxInc, xyInc, yxInc, yyInc; - - xStart = ((TC0280GRDCtrl[0] & 0xff) << 16) + TC0280GRDCtrl[1]; - if (xStart & 0x800000) xStart -= 0x1000000; - xxInc = (INT16)TC0280GRDCtrl[2]; - xxInc *= TC0280GRDxMultiply; - yxInc = (INT16)TC0280GRDCtrl[3]; - - yStart = ((TC0280GRDCtrl[4] & 0xff) << 16) + TC0280GRDCtrl[5]; - if (yStart & 0x800000) yStart -= 0x1000000; - xyInc = (INT16)TC0280GRDCtrl[6]; - xyInc *= TC0280GRDxMultiply; - yyInc = (INT16)TC0280GRDCtrl[7]; - - xStart -= TC0280GRDXOffset * xxInc + TC0280GRDYOffset * yxInc; - yStart -= TC0280GRDXOffset * xyInc + TC0280GRDYOffset * yyInc; - - RozRender(xStart << 4, yStart << 4, xxInc << 4, xyInc << 4, yxInc << 4, yyInc << 4); -} - -void TC0280GRDCtrlWordWrite(UINT32 Offset, UINT16 Data) -{ - TC0280GRDCtrl[Offset] = Data; -} - -void TC0280GRDReset() -{ - memset(TC0280GRDCtrl, 0, 8); - - TC0280GRDBaseColour = 0; -} - -void TC0280GRDInit(INT32 xOffs, INT32 yOffs, UINT8 *pSrc) -{ - TC0280GRDRam = (UINT8*)BurnMalloc(0x2000); - memset(TC0280GRDRam, 0, 0x2000); - - pRozTileMapData = (UINT16*)BurnMalloc(512 * 512 * sizeof(UINT16)); - memset(pRozTileMapData, 0, 512 * 512 * sizeof(UINT16)); - - TC0280GRDXOffset = xOffs; - TC0280GRDYOffset = yOffs; - - pTC0280GRDSrc = pSrc; - - TC0280GRDxMultiply = 2; - - TaitoIC_TC0280GRDInUse = 1; -} - -void TC0430GRWInit(INT32 xOffs, INT32 yOffs, UINT8 *pSrc) -{ - TC0280GRDInit(xOffs, yOffs, pSrc); - - TC0280GRDxMultiply = 1; - - TaitoIC_TC0280GRDInUse = 0; - TaitoIC_TC0430GRWInUse = 1; -} - -void TC0280GRDExit() -{ - BurnFree(TC0280GRDRam); - BurnFree(pRozTileMapData); - - memset(TC0280GRDCtrl, 0, 8); - - TC0280GRDBaseColour = 0; - - TC0280GRDxMultiply = 0; - TC0280GRDXOffset = 0; - TC0280GRDYOffset = 0; - - pTC0280GRDSrc = NULL; -} - -void TC0280GRDScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TC0280GRDRam; - ba.nLen = 0x2000; - ba.szName = "TC0280GRD Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(TC0280GRDCtrl); - SCAN_VAR(TC0280GRDBaseColour); - } -} diff --git a/jan/src/burn/drv/taito/tc0360pri.cpp b/jan/src/burn/drv/taito/tc0360pri.cpp deleted file mode 100644 index a4502c808..000000000 --- a/jan/src/burn/drv/taito/tc0360pri.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// TC0360PRI -// Based on MAME sources by Nicola Salmoria - -#include "burnint.h" -#include "taito_ic.h" - -UINT8 TC0360PRIRegs[16]; - -void TC0360PRIWrite(UINT32 Offset, UINT8 Data) -{ - TC0360PRIRegs[Offset] = Data; -} - -void TC0360PRIHalfWordWrite(UINT32 Offset, UINT16 Data) -{ - TC0360PRIWrite(Offset, Data & 0xff); -} - -void TC0360PRIHalfWordSwapWrite(UINT32 Offset, UINT16 Data) -{ - if (Data & 0xff00) TC0360PRIWrite(Offset, (Data >> 8) & 0xff); -} - -void TC0360PRIReset() -{ - memset(TC0360PRIRegs, 0, 16); -} - -void TC0360PRIInit() -{ - TaitoIC_TC0360PRIInUse = 1; -} - -void TC0360PRIExit() -{ - memset(TC0360PRIRegs, 0, 16); -} - -void TC0360PRIScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(TC0360PRIRegs); - } -} diff --git a/jan/src/burn/drv/taito/tc0480scp.cpp b/jan/src/burn/drv/taito/tc0480scp.cpp deleted file mode 100644 index 3199bcc3c..000000000 --- a/jan/src/burn/drv/taito/tc0480scp.cpp +++ /dev/null @@ -1,923 +0,0 @@ -// TC0480SCP -// Based on MAME sources by Nicola Salmoria - -#include "tiles_generic.h" -#include "taito_ic.h" - -UINT8 *TC0480SCPRam = NULL; -static UINT8 *TC0480SCPChars; -UINT16 TC0480SCPCtrl[0x18]; -static INT32 BgScrollX[4]; -static INT32 BgScrollY[4]; -static INT32 CharScrollX; -static INT32 CharScrollY; -static INT32 TC0480SCPTilesNum; -static INT32 TC0480SCPPriReg; -static INT32 TC0480SCPXOffset; -static INT32 TC0480SCPYOffset; -static INT32 TC0480SCPTextXOffset; -static INT32 TC0480SCPTextYOffset; -static UINT16 *pTC0480SCPTempDraw = NULL; -static INT32 TC0480SCPColBase; -static INT32 TC0480SCPDblWidth; -static UINT8 *TC0480SCPPriMap = NULL; -static INT32 TC0480SCPYVisOffset; - -static const UINT16 TC0480SCPBgPriLookup[8] = -{ - 0x0123, - 0x1230, - 0x2301, - 0x3012, - 0x3210, - 0x2103, - 0x1032, - 0x0321 -}; - -#define PLOTPIXEL(x, po) pPixel[x] = nPalette | pTileData[x] | po; -#define PLOTPIXEL_FLIPX(x, a, po) pPixel[x] = nPalette | pTileData[a] | po; -#define PLOTPIXEL_MASK(x, mc, po) if (pTileData[x] != mc) {pPixel[x] = nPalette | pTileData[x] | po;} -#define PLOTPIXEL_MASK_FLIPX(x, a, mc, po) if (pTileData[a] != mc) {pPixel[x] = nPalette | pTileData[a] | po;} -#define CLIPPIXEL(x, sx, mx, a) if ((sx + x) >= 0 && (sx + x) < mx) { a; }; - -static void RenderTile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - INT32 TileMapWidth = 512; - if (TC0480SCPDblWidth) TileMapWidth = 1024; - - UINT16* pPixel = pDestDraw + (StartY * TileMapWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += TileMapWidth, pTileData += 16) { - PLOTPIXEL( 0, nPaletteOffset); - PLOTPIXEL( 1, nPaletteOffset); - PLOTPIXEL( 2, nPaletteOffset); - PLOTPIXEL( 3, nPaletteOffset); - PLOTPIXEL( 4, nPaletteOffset); - PLOTPIXEL( 5, nPaletteOffset); - PLOTPIXEL( 6, nPaletteOffset); - PLOTPIXEL( 7, nPaletteOffset); - PLOTPIXEL( 8, nPaletteOffset); - PLOTPIXEL( 9, nPaletteOffset); - PLOTPIXEL(10, nPaletteOffset); - PLOTPIXEL(11, nPaletteOffset); - PLOTPIXEL(12, nPaletteOffset); - PLOTPIXEL(13, nPaletteOffset); - PLOTPIXEL(14, nPaletteOffset); - PLOTPIXEL(15, nPaletteOffset); - } -} - -static void RenderTile_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - INT32 TileMapWidth = 512; - if (TC0480SCPDblWidth) TileMapWidth = 1024; - - UINT16* pPixel = pDestDraw + (StartY * TileMapWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += TileMapWidth, pTileData += 16) { - PLOTPIXEL_FLIPX(15, 0, nPaletteOffset); - PLOTPIXEL_FLIPX(14, 1, nPaletteOffset); - PLOTPIXEL_FLIPX(13, 2, nPaletteOffset); - PLOTPIXEL_FLIPX(12, 3, nPaletteOffset); - PLOTPIXEL_FLIPX(11, 4, nPaletteOffset); - PLOTPIXEL_FLIPX(10, 5, nPaletteOffset); - PLOTPIXEL_FLIPX( 9, 6, nPaletteOffset); - PLOTPIXEL_FLIPX( 8, 7, nPaletteOffset); - PLOTPIXEL_FLIPX( 7, 8, nPaletteOffset); - PLOTPIXEL_FLIPX( 6, 9, nPaletteOffset); - PLOTPIXEL_FLIPX( 5, 10, nPaletteOffset); - PLOTPIXEL_FLIPX( 4, 11, nPaletteOffset); - PLOTPIXEL_FLIPX( 3, 12, nPaletteOffset); - PLOTPIXEL_FLIPX( 2, 13, nPaletteOffset); - PLOTPIXEL_FLIPX( 1, 14, nPaletteOffset); - PLOTPIXEL_FLIPX( 0, 15, nPaletteOffset); - } -} - -static void RenderTile_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - INT32 TileMapWidth = 512; - if (TC0480SCPDblWidth) TileMapWidth = 1024; - - UINT16* pPixel = pDestDraw + ((StartY + 15) * TileMapWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= TileMapWidth, pTileData += 16) { - PLOTPIXEL( 0, nPaletteOffset); - PLOTPIXEL( 1, nPaletteOffset); - PLOTPIXEL( 2, nPaletteOffset); - PLOTPIXEL( 3, nPaletteOffset); - PLOTPIXEL( 4, nPaletteOffset); - PLOTPIXEL( 5, nPaletteOffset); - PLOTPIXEL( 6, nPaletteOffset); - PLOTPIXEL( 7, nPaletteOffset); - PLOTPIXEL( 8, nPaletteOffset); - PLOTPIXEL( 9, nPaletteOffset); - PLOTPIXEL(10, nPaletteOffset); - PLOTPIXEL(11, nPaletteOffset); - PLOTPIXEL(12, nPaletteOffset); - PLOTPIXEL(13, nPaletteOffset); - PLOTPIXEL(14, nPaletteOffset); - PLOTPIXEL(15, nPaletteOffset); - } -} - -static void RenderTile_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - INT32 TileMapWidth = 512; - if (TC0480SCPDblWidth) TileMapWidth = 1024; - - UINT16* pPixel = pDestDraw + ((StartY + 15) * TileMapWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= TileMapWidth, pTileData += 16) { - PLOTPIXEL_FLIPX(15, 0, nPaletteOffset); - PLOTPIXEL_FLIPX(14, 1, nPaletteOffset); - PLOTPIXEL_FLIPX(13, 2, nPaletteOffset); - PLOTPIXEL_FLIPX(12, 3, nPaletteOffset); - PLOTPIXEL_FLIPX(11, 4, nPaletteOffset); - PLOTPIXEL_FLIPX(10, 5, nPaletteOffset); - PLOTPIXEL_FLIPX( 9, 6, nPaletteOffset); - PLOTPIXEL_FLIPX( 8, 7, nPaletteOffset); - PLOTPIXEL_FLIPX( 7, 8, nPaletteOffset); - PLOTPIXEL_FLIPX( 6, 9, nPaletteOffset); - PLOTPIXEL_FLIPX( 5, 10, nPaletteOffset); - PLOTPIXEL_FLIPX( 4, 11, nPaletteOffset); - PLOTPIXEL_FLIPX( 3, 12, nPaletteOffset); - PLOTPIXEL_FLIPX( 2, 13, nPaletteOffset); - PLOTPIXEL_FLIPX( 1, 14, nPaletteOffset); - PLOTPIXEL_FLIPX( 0, 15, nPaletteOffset); - } -} - -static void RenderTile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - INT32 TileMapWidth = 512; - if (TC0480SCPDblWidth) TileMapWidth = 1024; - - UINT16* pPixel = pDestDraw + (StartY * TileMapWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += TileMapWidth, pTileData += 16) { - PLOTPIXEL_MASK( 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 7, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 8, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 9, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(10, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(11, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(12, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(13, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(14, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(15, nMaskColour, nPaletteOffset); - } -} - -static void RenderTile_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - INT32 TileMapWidth = 512; - if (TC0480SCPDblWidth) TileMapWidth = 1024; - - UINT16* pPixel = pDestDraw + (StartY * TileMapWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += TileMapWidth, pTileData += 16) { - PLOTPIXEL_MASK_FLIPX(15, 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(14, 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(13, 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(12, 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(11, 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(10, 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 9, 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 8, 7, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 7, 8, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 6, 9, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 5, 10, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 4, 11, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 3, 12, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 2, 13, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 1, 14, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 0, 15, nMaskColour, nPaletteOffset); - } -} - -static void RenderTile_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - INT32 TileMapWidth = 512; - if (TC0480SCPDblWidth) TileMapWidth = 1024; - - UINT16* pPixel = pDestDraw + ((StartY + 15) * TileMapWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= TileMapWidth, pTileData += 16) { - PLOTPIXEL_MASK( 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 7, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 8, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK( 9, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(10, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(11, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(12, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(13, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(14, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK(15, nMaskColour, nPaletteOffset); - } -} - -static void RenderTile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ - UINT32 nPalette = nTilePalette << nColourDepth; - pTileData = pTile + (nTileNumber << 8); - - INT32 TileMapWidth = 512; - if (TC0480SCPDblWidth) TileMapWidth = 1024; - - UINT16* pPixel = pDestDraw + ((StartY + 15) * TileMapWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= TileMapWidth, pTileData += 16) { - PLOTPIXEL_MASK_FLIPX(15, 0, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(14, 1, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(13, 2, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(12, 3, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(11, 4, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX(10, 5, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 9, 6, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 8, 7, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 7, 8, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 6, 9, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 5, 10, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 4, 11, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 3, 12, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 2, 13, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 1, 14, nMaskColour, nPaletteOffset); - PLOTPIXEL_MASK_FLIPX( 0, 15, nMaskColour, nPaletteOffset); - } -} - -#undef PLOTPIXEL -#undef PLOTPIXEL_FLIPX -#undef PLOTPIXEL_MASK -#undef CLIPPIXEL - -void TC0480SCPCtrlWordWrite(INT32 Offset, UINT16 Data) -{ - INT32 Flip = TC0480SCPPriReg & 0x40; - - TC0480SCPCtrl[Offset] = Data; - - switch (Offset) { - case 0x00: { - if (!Flip) Data = -Data; - BgScrollX[0] = Data; - break; - } - - case 0x01: { - Data += 4; - if (!Flip) Data = -Data; - BgScrollX[1] = Data; - break; - } - - case 0x02: { - Data += 8; - if (!Flip) Data = -Data; - BgScrollX[2] = Data; - break; - } - - case 0x03: { - Data += 12; - if (!Flip) Data = -Data; - BgScrollX[3] = Data; - break; - } - - case 0x04: { - if (Flip) Data = -Data; - BgScrollY[0] = Data; - break; - } - - case 0x05: { - if (Flip) Data = -Data; - BgScrollY[1] = Data; - break; - } - - case 0x06: { - if (Flip) Data = -Data; - BgScrollY[2] = Data; - break; - } - - case 0x07: { - if (Flip) Data = -Data; - BgScrollY[3] = Data; - break; - } - - case 0x08: // bg0 zoom - case 0x09: // bg1 zoom - case 0x0a: // bg2 zoom - case 0x0b: { // bg3 zoom - break; - } - - case 0x0c: { - if (!Flip) Data -= TC0480SCPTextXOffset; - if (Flip) Data += TC0480SCPTextXOffset; - CharScrollX = -Data; - break; - } - - case 0x0d: { - if (!Flip) Data -= TC0480SCPTextYOffset + TC0480SCPYVisOffset; - if (Flip) Data += TC0480SCPTextYOffset + TC0480SCPYVisOffset; - CharScrollY = -Data; - break; - } - - case 0x0f: { - TC0480SCPPriReg = Data; - TC0480SCPDblWidth = (TC0480SCPPriReg & 0x80) >> 7; - if (Data & 0x40) bprintf(PRINT_NORMAL, _T("Flip\n")); - break; - } - } -} - -static inline void DrawScanLine(INT32 y, const UINT16 *src, INT32 Transparent, INT32 Prio) -{ - UINT16 *pPixel = pTransDraw + (y * nScreenWidth); - INT32 Length = nScreenWidth; - - if (TC0480SCPPriMap) { - UINT8 *pPrio = TC0480SCPPriMap + (y * nScreenWidth); - if (Transparent) { - while (Length--) { - UINT16 sPixel = *src++; - if (sPixel < 0x7fff) { - *pPixel = sPixel; - *pPrio = Prio; - } - pPixel++; - pPrio++; - } - } else { - while (Length--) { - *pPixel++ = *src++; - *pPrio++ = Prio; - } - } - } else { // no-priority buffer version - if (Transparent) { - while (Length--) { - UINT16 sPixel = *src++; - if (sPixel < 0x7fff) { - *pPixel = sPixel; - } - pPixel++; - } - } else { - while (Length--) { - *pPixel++ = *src++; - } - } - } -} - -static void TC0480SCPRenderLayer01(INT32 Layer, INT32 Opaque, UINT8 *pSrc, UINT32 Prio) -{ - INT32 mx, my, Attr, Code, Colour, x, y, sx, TileIndex = 0, Offset, Flip, xFlip, yFlip, xZoom, yZoom, i, yIndex, ySrcIndex, RowIndex, xIndex, xStep, Columns, WidthMask; - - UINT16 *Dst16, *Src16; - UINT16 ScanLine[512]; - UINT16 *pSrcTileMap = pTC0480SCPTempDraw; - - UINT16 *VideoRam = (UINT16*)TC0480SCPRam + 0x0000; - UINT16 *ScrollRam = (UINT16*)TC0480SCPRam + 0x2000; - - if (TC0480SCPDblWidth) { - VideoRam = (UINT16*)TC0480SCPRam + 0x0000; - ScrollRam = (UINT16*)TC0480SCPRam + 0x4000; - } - - if (Layer == 1) { - VideoRam = (UINT16*)TC0480SCPRam + 0x0800; - ScrollRam = (UINT16*)TC0480SCPRam + 0x2200; - - if (TC0480SCPDblWidth) { - VideoRam = (UINT16*)TC0480SCPRam + 0x1000; - ScrollRam = (UINT16*)TC0480SCPRam + 0x4200; - } - } - - Columns = 32; - WidthMask = 0x1ff; - if (TC0480SCPDblWidth) { - Columns = 64; - WidthMask = 0x3ff; - } - - xZoom = 0x10000 - (TC0480SCPCtrl[0x08 + Layer] & 0xff00); - yZoom = 0x10000 - (((TC0480SCPCtrl[0x08 + Layer] & 0xff) - 0x7f) * 512); - - // Render the tilemap to a buffer - memset(pTC0480SCPTempDraw, 0, 1024 * 512 * sizeof(UINT16)); - for (my = 0; my < 32; my++) { - for (mx = 0; mx < Columns; mx++) { - Offset = 2 * TileIndex; - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & (TC0480SCPTilesNum - 1); - Colour = Attr & 0xff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - Colour += TC0480SCPColBase; - - x = 16 * mx; - y = 16 * my; - - if (Opaque) { - if (xFlip) { - if (yFlip) { - RenderTile_FlipXY(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, pSrc); - } else { - RenderTile_FlipX(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, pSrc); - } - } else { - if (yFlip) { - RenderTile_FlipY(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, pSrc); - } else { - RenderTile(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, pSrc); - } - } - } else { - if (xFlip) { - if (yFlip) { - RenderTile_Mask_FlipXY(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } else { - RenderTile_Mask_FlipX(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } - } else { - if (yFlip) { - RenderTile_Mask_FlipY(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } else { - RenderTile_Mask(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } - } - } - - TileIndex++; - } - } - - sx = ((BgScrollX[Layer] + 15 + Layer * 4) << 16) + ((255 - (TC0480SCPCtrl[0x10 + Layer] & 0xff)) << 8); - sx += (-TC0480SCPXOffset - 15 - Layer * 4) * xZoom; - - yIndex = (BgScrollY[Layer] << 16) + ((TC0480SCPCtrl[0x14 + Layer] & 0xff) << 8); - yIndex -= (-TC0480SCPYOffset - TC0480SCPYVisOffset) * yZoom; - - y = 0; - - do { - ySrcIndex = (yIndex >> 16) & 0x1ff; - - RowIndex = ySrcIndex; - - xIndex = sx - ((BURN_ENDIAN_SWAP_INT16(ScrollRam[RowIndex]) << 16)) - ((BURN_ENDIAN_SWAP_INT16(ScrollRam[RowIndex + 0x800]) << 8) & 0xffff); - - Src16 = pSrcTileMap + (ySrcIndex * Columns * 16); - Dst16 = ScanLine; - - xStep = xZoom; - - if (Opaque) { - for (i = 0; i < 512; i++) { - *Dst16++ = Src16[(xIndex >> 16) & WidthMask]; - xIndex += xStep; - } - } else { - for (i = 0; i < 512; i++) { - INT32 Pix = Src16[(xIndex >> 16) & WidthMask]; - - if ((Pix & 0x0f) != 0) { - *Dst16++ = Pix; - } else { - *Dst16++ = 0x8000; - } - xIndex += xStep; - } - } - - if (Opaque) { - DrawScanLine(y, ScanLine, 0, Prio); - } else { - DrawScanLine(y, ScanLine, 1, Prio); - } - - yIndex += yZoom; - y++; - } while (y < nScreenHeight); -} - -static void TC0480SCPRenderLayer23(INT32 Layer, INT32 Opaque, UINT8 *pSrc, INT32 Prio) -{ - INT32 mx, my, Attr, Code, Colour, x, y, sx, TileIndex = 0, Offset, Flip, xFlip, yFlip, xZoom, yZoom, i, yIndex, ySrcIndex, RowIndex, RowZoom, xIndex, xStep, Columns, WidthMask; - - UINT16 *Dst16, *Src16; - UINT16 ScanLine[512]; - UINT16 *pSrcTileMap = pTC0480SCPTempDraw; - - xZoom = 0x10000 - (TC0480SCPCtrl[0x08 + Layer] & 0xff00); - yZoom = 0x10000 - (((TC0480SCPCtrl[0x08 + Layer] & 0xff) - 0x7f) * 512); - - UINT16 *VideoRam = (UINT16*)TC0480SCPRam + 0x1000; - UINT16 *ScrollRam = (UINT16*)TC0480SCPRam + 0x2400; - UINT16 *RowZoomRam = (UINT16*)TC0480SCPRam + 0x3000; - UINT16 *ColumnRam = (UINT16*)TC0480SCPRam + 0x3400; - - if (TC0480SCPDblWidth) { - VideoRam = (UINT16*)TC0480SCPRam + 0x2000; - ScrollRam = (UINT16*)TC0480SCPRam + 0x4400; - RowZoomRam = (UINT16*)TC0480SCPRam + 0x5000; - ColumnRam = (UINT16*)TC0480SCPRam + 0x5400; - } - - if (Layer == 3) { - VideoRam = (UINT16*)TC0480SCPRam + 0x1800; - ScrollRam = (UINT16*)TC0480SCPRam + 0x2600; - RowZoomRam = (UINT16*)TC0480SCPRam + 0x3200; - ColumnRam = (UINT16*)TC0480SCPRam + 0x3600; - - if (TC0480SCPDblWidth) { - VideoRam = (UINT16*)TC0480SCPRam + 0x3000; - ScrollRam = (UINT16*)TC0480SCPRam + 0x4600; - RowZoomRam = (UINT16*)TC0480SCPRam + 0x5200; - ColumnRam = (UINT16*)TC0480SCPRam + 0x5600; - } - } - - Columns = 32; - WidthMask = 0x1ff; - if (TC0480SCPDblWidth) { - Columns = 64; - WidthMask = 0x3ff; - } - - // Render the tilemap to a buffer - memset(pTC0480SCPTempDraw, 0, 1024 * 512 * sizeof(UINT16)); - for (my = 0; my < 32; my++) { - for (mx = 0; mx < Columns; mx++) { - Offset = 2 * TileIndex; - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset]); - Code = BURN_ENDIAN_SWAP_INT16(VideoRam[Offset + 1]) & (TC0480SCPTilesNum - 1); - Colour = Attr & 0xff; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - Colour += TC0480SCPColBase; - - x = 16 * mx; - y = 16 * my; - - if (Opaque) { - if (xFlip) { - if (yFlip) { - RenderTile_FlipXY(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, pSrc); - } else { - RenderTile_FlipX(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, pSrc); - } - } else { - if (yFlip) { - RenderTile_FlipY(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, pSrc); - } else { - RenderTile(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, pSrc); - } - } - } else { - if (xFlip) { - if (yFlip) { - RenderTile_Mask_FlipXY(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } else { - RenderTile_Mask_FlipX(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } - } else { - if (yFlip) { - RenderTile_Mask_FlipY(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } else { - RenderTile_Mask(pTC0480SCPTempDraw, Code, x, y, Colour, 4, 0, 0, pSrc); - } - } - } - - TileIndex++; - } - } - - sx = ((BgScrollX[Layer] + 15 + Layer * 4) << 16) + ((255 - (TC0480SCPCtrl[0x10 + Layer] & 0xff)) << 8); - sx += (-TC0480SCPXOffset - 15 - Layer * 4) * xZoom; - - yIndex = (BgScrollY[Layer] << 16) + ((TC0480SCPCtrl[0x14 + Layer] & 0xff) << 8); - yIndex -= (-TC0480SCPYOffset - TC0480SCPYVisOffset) * yZoom; - - y = 0; - - do { - ySrcIndex = ((yIndex >> 16) + BURN_ENDIAN_SWAP_INT16(ColumnRam[(y + TC0480SCPYOffset + TC0480SCPYVisOffset) & 0x1ff])) & 0x1ff; - - RowIndex = ySrcIndex; - - if (TC0480SCPPriReg & (Layer - 1)) { - RowZoom = BURN_ENDIAN_SWAP_INT16(RowZoomRam[RowIndex]); - } else { - RowZoom = 0; - } - - xIndex = sx - ((BURN_ENDIAN_SWAP_INT16(ScrollRam[RowIndex]) << 16)) - ((BURN_ENDIAN_SWAP_INT16(ScrollRam[RowIndex + 0x800]) << 8) & 0xffff); - xIndex -= (-TC0480SCPXOffset - 0x1f + Layer * 4) * ((RowZoom & 0xff) << 8); - - xStep = xZoom; - if (RowZoom) { - if (!(RowZoom & 0xff00)) { - xStep -= ((RowZoom * 256) & 0xffff); - } else { - xStep -= (((RowZoom & 0xff) * 256) & 0xffff); - } - } - - Src16 = pSrcTileMap + (ySrcIndex * Columns * 16); - Dst16 = ScanLine; - - if (Opaque) { - for (i = 0; i < 512; i++) { - *Dst16++ = Src16[(xIndex >> 16) & WidthMask]; - xIndex += xStep; - } - } else { - for (i = 0; i < 512; i++) { - INT32 Pix = Src16[(xIndex >> 16) & WidthMask]; - - if ((Pix & 0x0f) != 0) { - *Dst16++ = Pix; - } else { - *Dst16++ = 0x8000; - } - xIndex += xStep; - } - } - - if (Opaque) { - DrawScanLine(y, ScanLine, 0, Prio); - } else { - DrawScanLine(y, ScanLine, 1, Prio); - } - - yIndex += yZoom; - y++; - } while (y < nScreenHeight); -} - -void TC0480SCPTilemapRender(INT32 Layer, INT32 Opaque, UINT8 *pSrc) -{ - switch (Layer) { - case 0: { - TC0480SCPRenderLayer01(0, Opaque, pSrc, 0); - break; - } - - case 1: { - TC0480SCPRenderLayer01(1, Opaque, pSrc, 0); - break; - } - - case 2: { - TC0480SCPRenderLayer23(2, Opaque, pSrc, 0); - break; - } - - case 3: { - TC0480SCPRenderLayer23(3, Opaque, pSrc, 0); - break; - } - } -} - -void TC0480SCPTilemapRenderPrio(INT32 Layer, INT32 Opaque, INT32 Prio, UINT8 *pSrc) -{ - switch (Layer) { - case 0: { - TC0480SCPRenderLayer01(0, Opaque, pSrc, Prio); - break; - } - - case 1: { - TC0480SCPRenderLayer01(1, Opaque, pSrc, Prio); - break; - } - - case 2: { - TC0480SCPRenderLayer23(2, Opaque, pSrc, Prio); - break; - } - - case 3: { - TC0480SCPRenderLayer23(3, Opaque, pSrc, Prio); - break; - } - } -} - -static INT32 TC0480SCPPlaneOffsets[4] = { 0, 1, 2, 3 }; -static INT32 TC0480SCPXOffsets[8] = { 4, 0, 12, 8, 20, 16, 28, 24 }; -static INT32 TC0480SCPYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 }; - -void TC0480SCPRenderCharLayer() -{ - INT32 mx, my, Attr, Code, Colour, x, y, TileIndex = 0, Flip, xFlip, yFlip; - - UINT16 *VideoRam = (UINT16*)TC0480SCPRam + 0x6000; - UINT16 *CharRam = (UINT16*)TC0480SCPRam + 0x7000; - - GfxDecode(256, 4, 8, 8, TC0480SCPPlaneOffsets, TC0480SCPXOffsets, TC0480SCPYOffsets, 0x100, (UINT8*)CharRam, TC0480SCPChars); - - for (my = 0; my < 64; my++) { - for (mx = 0; mx < 64; mx++) { - Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]); - Code = Attr & 0xff; - Colour = (Attr & 0x3f00) >> 8; - Flip = (Attr & 0xc000) >> 14; - xFlip = (Flip >> 0) & 0x01; - yFlip = (Flip >> 1) & 0x01; - - Colour += TC0480SCPColBase; - - x = 8 * mx; - y = 8 * my; - - x -= CharScrollX & 0x1ff; - y -= CharScrollY & 0x1ff; - if (x < -8) x += 512; - if (y < -8) y += 512; - - if (x >= 8 && x < (nScreenWidth - 8) && y >= 8 && y < (nScreenHeight - 8)) { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY(pTransDraw, Code, x, y, Colour, 4, 0, 0, TC0480SCPChars); - } else { - Render8x8Tile_Mask_FlipX(pTransDraw, Code, x, y, Colour, 4, 0, 0, TC0480SCPChars); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY(pTransDraw, Code, x, y, Colour, 4, 0, 0, TC0480SCPChars); - } else { - Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 0, TC0480SCPChars); - } - } - } else { - if (xFlip) { - if (yFlip) { - Render8x8Tile_Mask_FlipXY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TC0480SCPChars); - } else { - Render8x8Tile_Mask_FlipX_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TC0480SCPChars); - } - } else { - if (yFlip) { - Render8x8Tile_Mask_FlipY_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TC0480SCPChars); - } else { - Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 0, TC0480SCPChars); - } - } - } - - TileIndex++; - } - } -} - -void TC0480SCPReset() -{ - memset(TC0480SCPChars, 0, 256 * 8 * 8); - memset(TC0480SCPCtrl, 0, 0x18); - BgScrollX[0] = BgScrollX[1] = BgScrollX[2] = BgScrollX[3] = 0; - BgScrollY[0] = BgScrollY[1] = BgScrollY[2] = BgScrollY[3] = 0; - CharScrollX = 0; - CharScrollY = 0; - TC0480SCPPriReg = 0; - TC0480SCPDblWidth = 0; -} - -void TC0480SCPSetPriMap(UINT8 *PriMap) -{ - TC0480SCPPriMap = PriMap; -} - -INT32 TC0480SCPGetBgPriority() -{ - return TC0480SCPBgPriLookup[(TC0480SCPPriReg & 0x1c) >> 2]; -} - -void TC0480SCPInit(INT32 nNumTiles, INT32 Pixels, INT32 xOffset, INT32 yOffset, INT32 xTextOffset, INT32 yTextOffset, INT32 VisYOffset) -{ - TC0480SCPRam = (UINT8*)BurnMalloc(0x10000); - memset(TC0480SCPRam, 0, 0x10000); - TC0480SCPChars = (UINT8*)BurnMalloc(256 * 8 * 8); - memset(TC0480SCPChars, 0, 256 * 8 * 8); - - TC0480SCPTilesNum = nNumTiles; - - TC0480SCPXOffset = -(xOffset + Pixels); - TC0480SCPYOffset = yOffset; - TC0480SCPTextXOffset = xTextOffset - TC0480SCPXOffset + 3; - TC0480SCPTextYOffset = yTextOffset + TC0480SCPYOffset; - - pTC0480SCPTempDraw = (UINT16*)BurnMalloc(1024 * 512 * sizeof(UINT16)); - memset(pTC0480SCPTempDraw, 0, 1024 * 512 * sizeof(UINT16)); - - TC0480SCPColBase = 0; - TC0480SCPYVisOffset = VisYOffset; - - TaitoIC_TC0480SCPInUse = 1; -} - -void TC0480SCPSetColourBase(INT32 Base) -{ - TC0480SCPColBase = Base; -} - -void TC0480SCPExit() -{ - BurnFree(TC0480SCPRam); - BurnFree(TC0480SCPChars); - BurnFree(pTC0480SCPTempDraw); - - memset(TC0480SCPCtrl, 0, 0x18); - BgScrollX[0] = BgScrollX[1] = BgScrollX[2] = BgScrollX[3] = 0; - BgScrollY[0] = BgScrollY[1] = BgScrollY[2] = BgScrollY[3] = 0; - CharScrollX = 0; - CharScrollY = 0; - TC0480SCPPriReg = 0; - TC0480SCPDblWidth = 0; - - TC0480SCPTilesNum = 0; - TC0480SCPXOffset = 0; - TC0480SCPYOffset = 0; - TC0480SCPTextXOffset = 0; - TC0480SCPTextYOffset = 0; - TC0480SCPColBase = 0; - TC0480SCPYVisOffset = 0; - - TC0480SCPPriMap = NULL; -} - -void TC0480SCPScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_MEMORY_RAM) { - memset(&ba, 0, sizeof(ba)); - ba.Data = TC0480SCPRam; - ba.nLen = 0x10000; - ba.szName = "TC0480SCP Ram"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(TC0480SCPCtrl); - SCAN_VAR(BgScrollX); - SCAN_VAR(BgScrollY); - SCAN_VAR(CharScrollX); - SCAN_VAR(CharScrollY); - SCAN_VAR(TC0480SCPPriReg); - } -} diff --git a/jan/src/burn/drv/taito/tc0510nio.cpp b/jan/src/burn/drv/taito/tc0510nio.cpp deleted file mode 100644 index de1339812..000000000 --- a/jan/src/burn/drv/taito/tc0510nio.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// TC0510NIO -// Based on MAME sources by Nicola Salmoria - -#include "burnint.h" -#include "taito_ic.h" - -UINT8 TC0510NIOInputPort0[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0510NIOInputPort1[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0510NIOInputPort2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0510NIODip[2] = { 0, 0 }; -UINT8 TC0510NIOInput[3] = { 0, 0, 0 }; -static UINT8 TC0510NIORegs[8]; - -extern UINT8 TaitoCoinLockout[4]; - -static UINT8 TC0510NIORead(INT32 Offset) -{ - switch (Offset) { - case 0x00: return TC0510NIODip[0]; - case 0x01: return TC0510NIODip[1]; - case 0x02: return TC0510NIOInput[0]; - case 0x03: return TC0510NIOInput[1]; - case 0x04: return TC0510NIORegs[4]; - case 0x07: return TC0510NIOInput[2]; - - default: { - return 0xff; - } - } -} - -static void TC0510NIOWrite(INT32 Offset, UINT16 Data) -{ - TC0510NIORegs[Offset] = Data; - - if (Offset == 0) { - TaitoWatchdog = 0; - } - - if (Offset == 4) { - TaitoCoinLockout[0] = ~Data & 0x01; - TaitoCoinLockout[1] = ~Data & 0x02; - // coin counters 0x04 & 0x08 - } -} - -UINT16 TC0510NIOHalfWordRead(INT32 Offset) -{ - return TC0510NIORead(Offset); -} - -UINT16 TC0510NIOHalfWordSwapRead(INT32 Offset) -{ - return TC0510NIOHalfWordRead(Offset ^ 1); -} - -void TC0510NIOHalfWordWrite(INT32 Offset, UINT16 Data) -{ - TC0510NIOWrite(Offset, Data & 0xff); -} - -void TC0510NIOHalfWordSwapWrite(INT32 Offset, UINT16 Data) -{ - TC0510NIOWrite(Offset ^ 1, Data); -} - -void TC0510NIOReset() -{ - memset(TC0510NIORegs, 0, 8); -} - -void TC0510NIOInit() -{ - TaitoIC_TC0510NIOInUse = 1; -} - -void TC0510NIOExit() -{ - memset(TC0510NIORegs, 0, 8); -} - -void TC0510NIOScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(TC0510NIOInputPort0); - SCAN_VAR(TC0510NIOInputPort1); - SCAN_VAR(TC0510NIOInputPort2); - SCAN_VAR(TC0510NIODip); - SCAN_VAR(TC0510NIOInput); - SCAN_VAR(TC0510NIORegs); - } -} diff --git a/jan/src/burn/drv/taito/tc0640fio.cpp b/jan/src/burn/drv/taito/tc0640fio.cpp deleted file mode 100644 index 0e23b2d24..000000000 --- a/jan/src/burn/drv/taito/tc0640fio.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// TC0640FIO -// Based on MAME sources by Nicola Salmoria - -#include "burnint.h" -#include "taito_ic.h" - -UINT8 TC0640FIOInputPort0[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0640FIOInputPort1[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0640FIOInputPort2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0640FIOInputPort3[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0640FIOInputPort4[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -UINT8 TC0640FIOInput[5] = { 0, 0, 0, 0, 0 }; - -static UINT8 TC0640FIORegs[8]; - -UINT8 TC0640FIORead(UINT32 Offset) -{ - switch (Offset) { - case 0x00: { - return TC0640FIOInput[0]; - } - - case 0x01: { - return TC0640FIOInput[1]; - } - - case 0x02: { - return TC0640FIOInput[2]; - } - - case 0x03: { - return TC0640FIOInput[3]; - } - - case 0x04: { - return TC0640FIORegs[4]; - } - - case 0x07: { - return TC0640FIOInput[4]; - } - } - - return 0xff; -} - -void TC0640FIOWrite(UINT32 Offset, UINT8 Data) -{ - TC0640FIORegs[Offset] = Data; - - switch (Offset) { - case 0x00: { - TaitoWatchdog = 0; - return; - } - - case 0x04: { - // coin lockout and counters - return; - } - } -} - -UINT16 TC0640FIOHalfWordRead(UINT32 Offset) -{ - return TC0640FIORead(Offset); -} - -void TC0640FIOHalfWordWrite(UINT32 Offset, UINT16 Data) -{ - if ((Data & 0xff00) == 0) { - TC0640FIOWrite(Offset, Data & 0xff); - } else { - TC0640FIOWrite(Offset, (Data >> 8) & 0xff); - } -} - -UINT16 TC0640FIOHalfWordByteswapRead(UINT32 Offset) -{ - return TC0640FIOHalfWordRead(Offset) << 8; -} - -void TC0640FIOHalfWordByteswapWrite(UINT32 Offset, UINT16 Data) -{ - if ((Data & 0xff00) == 0) { - TC0640FIOWrite(Offset, (Data >> 8) & 0xff); - } else { - TC0640FIOWrite(Offset, Data & 0xff); - } -} - -void TC0640FIOReset() -{ - memset(TC0640FIORegs, 0, 8); -} - -void TC0640FIOInit() -{ - TaitoIC_TC0640FIOInUse = 1; -} - -void TC0640FIOExit() -{ - memset(TC0640FIORegs, 0, 8); -} - -void TC0640FIOScan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(TC0640FIOInputPort0); - SCAN_VAR(TC0640FIOInputPort1); - SCAN_VAR(TC0640FIOInputPort2); - SCAN_VAR(TC0640FIOInputPort3); - SCAN_VAR(TC0640FIOInputPort4); - SCAN_VAR(TC0640FIOInput); - SCAN_VAR(TC0640FIORegs); - } -} diff --git a/jan/src/burn/drv/taito/tnzs_prot.cpp b/jan/src/burn/drv/taito/tnzs_prot.cpp deleted file mode 100644 index 609757785..000000000 --- a/jan/src/burn/drv/taito/tnzs_prot.cpp +++ /dev/null @@ -1,465 +0,0 @@ -// The New Zealand Story protection module -// Based on MAME version 0.67 mcu simulation - -#include "burnint.h" -#include "tnzs_prot.h" - -#define UNLOCK 0x0f -#define LOCK 0x0c - -static INT32 mcu_type; - -static INT32 mcu_initializing; -static INT32 mcu_coinage_init; -static INT32 mcu_command,mcu_readcredits; -static INT32 mcu_reportcoin; -static UINT8 mcu_coinage[4]; -static UINT8 mcu_coinsA; -static UINT8 mcu_coinsB; -static UINT8 mcu_credits; -static UINT8 mcu_coin_lockout; - -UINT8 *tnzs_mcu_inputs; - -void tnzs_mcu_reset() -{ - mcu_initializing = 3; - mcu_coinage_init = 0; - mcu_coinage[0] = 1; - mcu_coinage[1] = 1; - mcu_coinage[2] = 1; - mcu_coinage[3] = 1; - mcu_coinsA = 0; - mcu_coinsB = 0; - mcu_credits = 0; - mcu_reportcoin = 0; - mcu_command = 0; - mcu_coin_lockout = LOCK; -} - -void tnzs_mcu_init(INT32 type) -{ - tnzs_mcu_reset(); - mcu_type = type; -} - -static void mcu_handle_coins(INT32 coin) -{ - static INT32 insertcoin; - - if (coin & 0x08) - mcu_reportcoin = coin; - else if (coin && coin != insertcoin) - { - if (coin & 0x01) - { - mcu_coinsA++; - if (mcu_coinsA >= mcu_coinage[0]) - { - mcu_coinsA -= mcu_coinage[0]; - mcu_credits += mcu_coinage[1]; - if (mcu_credits >= 9) - { - mcu_credits = 9; - mcu_coin_lockout = LOCK; - } - else - { - mcu_coin_lockout = UNLOCK; - } - } - } - if (coin & 0x02) - { - mcu_coinsB++; - if (mcu_coinsB >= mcu_coinage[2]) - { - mcu_coinsB -= mcu_coinage[2]; - mcu_credits += mcu_coinage[3]; - if (mcu_credits >= 9) - { - mcu_credits = 9; - mcu_coin_lockout = LOCK; - } - else - { - mcu_coin_lockout = UNLOCK; - } - } - } - if (coin & 0x04) - { - mcu_credits++; - } - mcu_reportcoin = coin; - } - else - { - if (mcu_credits < 9) - mcu_coin_lockout = UNLOCK; - mcu_reportcoin = 0; - } - insertcoin = coin; -} - -static UINT8 mcu_arknoid2_r(INT32 offset) -{ - const char *mcu_startup = "\x55\xaa\x5a"; - - if (offset == 0) - { - if (mcu_initializing) - { - mcu_initializing--; - return mcu_startup[2 - mcu_initializing]; - } - - switch (mcu_command) - { - case 0x41: - return mcu_credits; - - case 0xc1: - if (mcu_readcredits == 0) - { - mcu_readcredits = 1; - if (mcu_reportcoin & 0x08) - { - mcu_initializing = 3; - return 0xee; - } - else return mcu_credits; - } - else return tnzs_mcu_inputs[0]; - - default: - return 0xff; - break; - } - } - else - { - if (mcu_reportcoin & 0x08) return 0xe1; - if (mcu_reportcoin & 0x01) return 0x11; - if (mcu_reportcoin & 0x02) return 0x21; - if (mcu_reportcoin & 0x04) return 0x31; - return 0x01; - } -} - -static void mcu_arknoid2_w(INT32 offset, INT32 data) -{ - if (offset == 0) - { - if (mcu_command == 0x41) - { - mcu_credits = (mcu_credits + data) & 0xff; - } - } - else - { - if (mcu_initializing) - { - mcu_coinage[mcu_coinage_init++] = data; - if (mcu_coinage_init == 4) mcu_coinage_init = 0; - } - - if (data == 0xc1) - mcu_readcredits = 0; - - if (data == 0x15) - mcu_credits = (mcu_credits - 1) & 0xff; - - mcu_command = data; - } -} - -static UINT8 mcu_chukatai_r(INT32 offset) -{ - const char *mcu_startup = "\xa5\x5a\xaa"; - - if (offset == 0) - { - if (mcu_initializing) - { - mcu_initializing--; - return mcu_startup[2 - mcu_initializing]; - } - - switch (mcu_command) - { - case 0x1f: - return (tnzs_mcu_inputs[2] >> 4) ^ 0x0f; - - case 0x03: - return tnzs_mcu_inputs[2] & 0x0f; - - case 0x41: - return mcu_credits; - - case 0x93: - if (mcu_readcredits == 0) - { - mcu_readcredits += 1; - if (mcu_reportcoin & 0x08) - { - mcu_initializing = 3; - return 0xee; - } - else return mcu_credits; - } - - if (mcu_readcredits == 1) - { - mcu_readcredits += 1; - return tnzs_mcu_inputs[0]; - } - - if (mcu_readcredits == 2) - { - return tnzs_mcu_inputs[1]; - } - - default: - return 0xff; - break; - } - } - else - { - if (mcu_reportcoin & 0x08) return 0xe1; - if (mcu_reportcoin & 0x01) return 0x11; - if (mcu_reportcoin & 0x02) return 0x21; - if (mcu_reportcoin & 0x04) return 0x31; - return 0x01; - } -} - -static void mcu_chukatai_w(INT32 offset, INT32 data) -{ - if (offset == 0) - { - if (mcu_command == 0x41) - { - mcu_credits = (mcu_credits + data) & 0xff; - } - } - else - { - if (mcu_initializing) - { - mcu_coinage[mcu_coinage_init++] = data; - if (mcu_coinage_init == 4) mcu_coinage_init = 0; - } - - if (data == 0x93) - mcu_readcredits = 0; - - mcu_command = data; - } -} - -static UINT8 mcu_tnzs_r(INT32 offset) -{ - const char *mcu_startup = "\x5a\xa5\x55"; - - if (offset == 0) - { - if (mcu_initializing) - { - mcu_initializing--; - return mcu_startup[2 - mcu_initializing]; - } - - switch (mcu_command) - { - case 0x01: - return ~tnzs_mcu_inputs[0]; - - case 0x02: - return ~tnzs_mcu_inputs[1]; - - case 0x1a: - if (mcu_type == MCU_DRTOPPEL) return (tnzs_mcu_inputs[2] >> 2) ^ 0x03; - return tnzs_mcu_inputs[2] >> 4; - - case 0x21: - return tnzs_mcu_inputs[2] & 0x0f; - - case 0x41: - return mcu_credits; - - case 0xa0: - if (mcu_reportcoin & 0x08) - { - mcu_initializing = 3; - return 0xee; - } - else return mcu_credits; - - case 0xa1: - if (mcu_readcredits == 0) - { - mcu_readcredits = 1; - if (mcu_reportcoin & 0x08) - { - mcu_initializing = 3; - return 0xee; - } - else return mcu_credits; - } - else - return ~((tnzs_mcu_inputs[0] & 0xf0) | (tnzs_mcu_inputs[1] & 0x0f)); - - default: - return 0xff; - break; - } - } - else - { - if (mcu_reportcoin & 0x08) return 0xe1; - - if (mcu_type == MCU_TNZS) - { - if (mcu_reportcoin & 0x01) return 0x31; - if (mcu_reportcoin & 0x02) return 0x21; - if (mcu_reportcoin & 0x04) return 0x11; - } - else - { - if (mcu_reportcoin & 0x01) return 0x11; - if (mcu_reportcoin & 0x02) return 0x21; - if (mcu_reportcoin & 0x04) return 0x31; - } - return 0x01; - } -} - -static void mcu_tnzs_w(INT32 offset, INT32 data) -{ - if (offset == 0) { - if (mcu_command == 0x41) { - mcu_credits = (mcu_credits + data) & 0xff; - } - } - else - { - if (mcu_initializing) - { - mcu_coinage[mcu_coinage_init++] = data; - if (mcu_coinage_init == 4) mcu_coinage_init = 0; - } - - if (data == 0xa1) - mcu_readcredits = 0; - - if ((data == 0x09) && (mcu_type == MCU_DRTOPPEL || mcu_type == MCU_PLUMPOP)) - mcu_credits = (mcu_credits - 1) & 0xff; - - if ((data == 0x18) && (mcu_type == MCU_DRTOPPEL || mcu_type == MCU_PLUMPOP)) - mcu_credits = (mcu_credits - 2) & 0xff; - - mcu_command = data; - } -} - -UINT8 tnzs_mcu_read(INT32 offset) -{ - switch (mcu_type) - { - case MCU_ARKANOID: - return mcu_arknoid2_r(offset & 1); - break; - - case MCU_CHUKATAI: - return mcu_chukatai_r(offset & 1); - break; - - case MCU_EXTRMATN: - case MCU_DRTOPPEL: - case MCU_TNZS: - case MCU_PLUMPOP: - return mcu_tnzs_r(offset & 1); - break; - - case MCU_NONE_INSECTX: - case MCU_NONE_KAGEKI: - case MCU_NONE_JPOPNICS: - case MCU_NONE: - return tnzs_mcu_inputs[offset & 1]; - break; - } - - return 0xff; -} - -void tnzs_mcu_write(INT32 offset, INT32 data) -{ - switch (mcu_type) - { - case MCU_ARKANOID: - mcu_arknoid2_w(offset & 1, data); - break; - - case MCU_CHUKATAI: - mcu_chukatai_w(offset & 1, data); - break; - - case MCU_EXTRMATN: - case MCU_DRTOPPEL: - case MCU_TNZS: - case MCU_PLUMPOP: - mcu_tnzs_w(offset & 1, data); - break; - } -} - -void tnzs_mcu_interrupt() -{ - INT32 coin; - - switch (mcu_type) - { - case MCU_ARKANOID: - coin = (~tnzs_mcu_inputs[1] >> 4) & 0x0f; - coin = (coin & 0x08) | ((coin & 0x03) << 1) | ((coin & 0x04) >> 2); - coin &= mcu_coin_lockout; - mcu_handle_coins(coin); - break; - - case MCU_EXTRMATN: - case MCU_DRTOPPEL: - case MCU_PLUMPOP: - case MCU_CHUKATAI: - case MCU_TNZS: - coin = (((~tnzs_mcu_inputs[2] & 0x30) >> 4) | ((~tnzs_mcu_inputs[2] & 0x03) << 2)); - coin &= mcu_coin_lockout; - mcu_handle_coins(coin); - break; - - case MCU_NONE: - break; - } -} - -INT32 tnzs_mcu_type() -{ - return mcu_type; -} - -void tnzs_mcu_scan() -{ - SCAN_VAR(mcu_initializing); - SCAN_VAR(mcu_coinage_init); - SCAN_VAR(mcu_coinage[0]); - SCAN_VAR(mcu_coinage[1]); - SCAN_VAR(mcu_coinage[2]); - SCAN_VAR(mcu_coinage[3]); - SCAN_VAR(mcu_coinsA); - SCAN_VAR(mcu_coinsB); - SCAN_VAR(mcu_credits); - SCAN_VAR(mcu_reportcoin); - SCAN_VAR(mcu_command); - SCAN_VAR(mcu_coin_lockout); -} diff --git a/jan/src/burn/drv/taito/tnzs_prot.h b/jan/src/burn/drv/taito/tnzs_prot.h deleted file mode 100644 index 4ccc28387..000000000 --- a/jan/src/burn/drv/taito/tnzs_prot.h +++ /dev/null @@ -1,100 +0,0 @@ -enum -{ - MCU_NONE, - MCU_EXTRMATN, - MCU_ARKANOID, - MCU_DRTOPPEL, - MCU_CHUKATAI, - MCU_PLUMPOP, - MCU_TNZS, - MCU_NONE_INSECTX, - MCU_NONE_KAGEKI, - MCU_NONE_JPOPNICS -}; - -INT32 tnzs_mcu_type(); -void tnzs_mcu_reset(); -void tnzs_mcu_init(INT32 type); -void tnzs_mcu_interrupt(); -void tnzs_mcu_scan(); - -UINT8 tnzs_mcu_read(INT32 offset); -void tnzs_mcu_write(INT32 offset, INT32 data); - -extern UINT8 *tnzs_mcu_inputs; - -#define TNZS_DIFFICULTY_DIPSETTING(dip) \ - {0 , 0xfe, 0 , 4, "Difficulty" }, \ - {dip, 0x01, 0x03, 0x02, "Easy" }, \ - {dip, 0x01, 0x03, 0x03, "Medium" }, \ - {dip, 0x01, 0x03, 0x01, "Hard" }, \ - {dip, 0x01, 0x03, 0x00, "Hardest" }, \ - -#define TNZS_LIVES_DIPSETTING(dip) \ - {0 , 0xfe, 0 , 0, "Lives" }, \ - {dip, 0x01, 0x30, 0x20, "2" }, \ - {dip, 0x01, 0x30, 0x30, "3" }, \ - {dip, 0x01, 0x30, 0x10, "4" }, \ - {dip, 0x01, 0x30, 0x00, "5" }, \ - -#define TNZS_CABINET_FLIP_SERVICE_DIPSETTING(dip) \ - {0 , 0xfe, 0 , 2, "Cabinet" }, \ - {dip, 0x01, 0x01, 0x00, "Upright" }, \ - {dip, 0x01, 0x01, 0x01, "Cocktail" }, \ - \ - {0 , 0xfe, 0 , 2, "Flip Screen" }, \ - {dip, 0x01, 0x02, 0x02, "Off" }, \ - {dip, 0x01, 0x02, 0x00, "On" }, \ - \ - {0 , 0xfe, 0 , 2, "Service Mode" }, \ - {dip, 0x01, 0x04, 0x04, "Off" }, \ - {dip, 0x01, 0x04, 0x00, "On" }, \ - -#define TNZS_DEMOSOUNDS_DIPSETTING(dip) \ - {0 , 0xfe, 0 , 2, "Demo Sounds" }, \ - {dip, 0x01, 0x08, 0x00, "Off" }, \ - {dip, 0x01, 0x08, 0x08, "On" }, \ - -#define TNZS_ALLOWCONTINUE_DIPSETTING(dip, val) \ - {0 , 0xfe, 0 , 2, "Allow Continue" }, \ - {dip, 0x01, val, 0x00, "No" }, \ - {dip, 0x01, val, val, "Yes" }, \ - -// Type 1 is old-style -#define TNZS_COINA_TYPE1_DIPSETTING(dip) \ - {0 , 0xfe, 0 , 4, "Coin A" }, \ - {dip, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, \ - {dip, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, \ - {dip, 0x01, 0x30, 0x00, "2 Coins 3 Credits" }, \ - {dip, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, \ - -#define TNZS_COINB_TYPE1_DIPSETTING(dip) \ - {0 , 0xfe, 0 , 4, "Coin B" }, \ - {dip, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, \ - {dip, 0x01, 0xc0, 0xc0, "1 Coin 1 Credits" }, \ - {dip, 0x01, 0xc0, 0x00, "2 Coins 3 Credits" }, \ - {dip, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, \ - -// Type 2 is new-style -#define TNZS_COINA_TYPE2_DIPSETTING(dip) \ - {0 , 0xfe, 0 , 4, "Coin A" }, \ - {dip, 0x01, 0x30, 0x00, "4 Coins 1 Credits" }, \ - {dip, 0x01, 0x30, 0x10, "3 Coins 1 Credits" }, \ - {dip, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, \ - {dip, 0x01, 0x30, 0x30, "1 Coin 1 Credits" }, \ - -#define TNZS_COINB_TYPE2_DIPSETTING(dip) \ - {0 , 0xfe, 0 , 4, "Coin B" }, \ - {dip, 0x01, 0xc0, 0xc0, "1 Coin 2 Credits" }, \ - {dip, 0x01, 0xc0, 0x80, "1 Coin 3 Credits" }, \ - {dip, 0x01, 0xc0, 0x40, "1 Coin 4 Credits" }, \ - {dip, 0x01, 0xc0, 0x00, "1 Coin 6 Credits" }, \ - - -#define TNZS_COINAGE_WORLD(dip) \ - TNZS_COINA_TYPE2_DIPSETTING(dip) \ - TNZS_COINB_TYPE2_DIPSETTING(dip) - -#define TNZS_COINAGE_JAPAN_OLD(dip) \ - TNZS_COINA_TYPE1_DIPSETTING(dip) \ - TNZS_COINB_TYPE1_DIPSETTING(dip) diff --git a/jan/src/burn/drv/toaplan/d_batrider.cpp b/jan/src/burn/drv/toaplan/d_batrider.cpp deleted file mode 100644 index c6af1af9f..000000000 --- a/jan/src/burn/drv/toaplan/d_batrider.cpp +++ /dev/null @@ -1,1241 +0,0 @@ -// FB Alpha Batrider driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -#include "nmk112.h" -// Batrider - -static UINT8 drvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 drvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 drvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 drvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -static UINT8 drvRegion = 0; -static UINT8 drvReset = 0; -static UINT8 bDrawScreen; - -static UINT8 nIRQPending; -static bool bVBlank; - -static INT32 nData; - -static INT32 nCurrentBank; -static INT32 nTextROMStatus; - -static void Map68KTextROM(bool bMapTextROM); - -static struct BurnInputInfo batriderInputList[] = { - {"P1 Coin", BIT_DIGITAL, drvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, drvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, drvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, drvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, drvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, drvJoy1 + 3, "p1 right"}, - {"P1 Shoot 1", BIT_DIGITAL, drvJoy1 + 4, "p1 fire 1"}, - {"P1 Shoot 2", BIT_DIGITAL, drvJoy1 + 5, "p1 fire 2"}, - {"P1 Shoot 3", BIT_DIGITAL, drvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, drvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, drvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, drvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, drvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, drvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, drvJoy2 + 3, "p2 right"}, - {"P2 Shoot 1", BIT_DIGITAL, drvJoy2 + 4, "p2 fire 1"}, - {"P2 Shoot 2", BIT_DIGITAL, drvJoy2 + 5, "p2 fire 2"}, - {"P2 Shoot 3", BIT_DIGITAL, drvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &drvReset, "reset"}, - {"Test", BIT_DIGITAL, drvButton + 2, "diag"}, - {"Service", BIT_DIGITAL, drvButton + 0, "service"}, - {"Dip 1", BIT_DIPSWITCH, drvInput + 3, "dip"}, - {"Dip 2", BIT_DIPSWITCH, drvInput + 4, "dip"}, - {"Dip 3", BIT_DIPSWITCH, drvInput + 5, "dip"}, - {"Region", BIT_DIPSWITCH, &drvRegion , "dip"}, -}; - -STDINPUTINFO(batrider) - - -static struct BurnDIPInfo batriderDIPList[] = { - // Defaults - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x00, NULL}, - {0x17, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Test mode"}, - {0x15, 0x01, 0x01, 0x00, "Normal"}, - {0x15, 0x01, 0x01, 0x01, "Test"}, - // Normal - {0, 0xFE, 0, 2, "Starting coin"}, - {0x15, 0x82, 0x02, 0x00, "1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0x02, 0x02, "2 credits"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - // Free play - {0, 0xFE, 0, 2, "Stick mode"}, - {0x15, 0x02, 0x02, 0x00, "Normal"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x02, 0x02, 0x02, "Special"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - // Both - {0, 0xFE, 0, 8, "Coin 1"}, - {0x15, 0x01, 0x1C, 0x00, "1 coin 1 credit"}, - {0x15, 0x01, 0x1C, 0x04, "1 coin 2 credits"}, - {0x15, 0x01, 0x1C, 0x08, "1 coin 3 credits"}, - {0x15, 0x01, 0x1C, 0x0C, "1 coin 4 credits"}, - {0x15, 0x01, 0x1C, 0x10, "2 coins 1 credit"}, - {0x15, 0x01, 0x1C, 0x14, "3 coins 1 credit"}, - {0x15, 0x01, 0x1C, 0x18, "4 coins 1 credit"}, - {0x15, 0x01, 0x1C, 0x1C, "Free Play"}, - // 0x1C: Free play settings active - // Normal - {0, 0xFE, 0, 7, "Coin 2"}, - {0x15, 0x82, 0xE0, 0x00, "1 coin 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0x20, "1 coin 2 credits"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0x40, "1 coin 3 credits"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0x60, "1 coin 4 credits"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0x80, "2 coins 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0xA0, "3 coins 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0xC0, "4 coins 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0xE0, "1 coin 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - // Free play - {0, 0xFE, 0, 2, "Hit score"}, - {0x15, 0x02, 0x20, 0x00, "Off"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x02, 0x20, 0x20, "On"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0, 0xFE, 0, 2, "Sound effect"}, - {0x15, 0x02, 0x40, 0x00, "Off"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x02, 0x40, 0x40, "On"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0, 0xFE, 0, 2, "Music"}, - {0x15, 0x02, 0x80, 0x00, "Off"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x02, 0x80, 0x80, "On"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - - // DIP 2 - {0, 0xFE, 0, 4, "Start rank"}, - {0x16, 0x01, 0x03, 0x00, "Normal"}, - {0x16, 0x01, 0x03, 0x01, "Easy"}, - {0x16, 0x01, 0x03, 0x02, "Hard"}, - {0x16, 0x01, 0x03, 0x03, "Very hard"}, - {0, 0xFE, 0, 4, "Timer rank"}, - {0x16, 0x01, 0x0C, 0x00, "Normal"}, - {0x16, 0x01, 0x0C, 0x04, "Low"}, - {0x16, 0x01, 0x0C, 0x08, "High"}, - {0x16, 0x01, 0x0C, 0x0C, "Highest"}, - {0, 0xFE, 0, 4, "Player counts"}, - {0x16, 0x01, 0x30, 0x00, "3"}, - {0x16, 0x01, 0x30, 0x10, "4"}, - {0x16, 0x01, 0x30, 0x20, "2"}, - {0x16, 0x01, 0x30, 0x30, "1"}, - {0, 0xFE, 0, 4, "Extra player"}, - {0x16, 0x01, 0xC0, 0x00, "1500000 each"}, - {0x16, 0x01, 0xC0, 0x40, "1000000 each"}, - {0x16, 0x01, 0xC0, 0x80, "2000000 each"}, - {0x16, 0x01, 0xC0, 0xC0, "No extra player"}, - - // DIP 3 - {0, 0xFE, 0, 2, "Screen flip"}, - {0x17, 0x01, 0x01, 0x00, "Off"}, - {0x17, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x17, 0x01, 0x02, 0x00, "On"}, - {0x17, 0x01, 0x02, 0x02, "Off"}, - {0, 0xFE, 0, 2, "Stage edit"}, - {0x17, 0x01, 0x04, 0x00, "Disable"}, - {0x17, 0x01, 0x04, 0x04, "Enable"}, - {0, 0xFE, 0, 2, "Continue play"}, - {0x17, 0x01, 0x08, 0x00, "Enable"}, - {0x17, 0x01, 0x08, 0x08, "Disable"}, - {0, 0xFE, 0, 2, "Invincible"}, - {0x17, 0x01, 0x10, 0x00, "Off"}, - {0x17, 0x01, 0x10, 0x10, "On"}, - // Free play - {0, 0xFE, 0, 2, "Guest Players"}, - {0x17, 0x02, 0x20, 0x20, "Disable"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x17, 0x02, 0x20, 0x00, "Enable"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0, 0xFE, 0, 2, "Player select"}, - {0x17, 0x02, 0x40, 0x40, "Disable"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x17, 0x02, 0x40, 0x00, "Enable"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0, 0xFE, 0, 2, "Special Course"}, - {0x17, 0x02, 0x80, 0x80, "Disable"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x17, 0x02, 0x80, 0x00, "Enable"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - - // Region - {0, 0xFD, 0, 26, "Region"}, - {0x18, 0x01, 0x1F, 0x00, "Nippon"}, - {0x18, 0x01, 0x1F, 0x01, "U.S.A."}, - {0x18, 0x01, 0x1F, 0x02, "Europe"}, - {0x18, 0x01, 0x1F, 0x03, "Asia"}, - {0x18, 0x01, 0x1F, 0x04, "German"}, - {0x18, 0x01, 0x1F, 0x05, "Austria"}, - {0x18, 0x01, 0x1F, 0x06, "Belgium"}, - {0x18, 0x01, 0x1F, 0x07, "Denmark"}, - {0x18, 0x01, 0x1F, 0x08, "Finland"}, - {0x18, 0x01, 0x1F, 0x09, "France"}, - {0x18, 0x01, 0x1F, 0x0A, "Great Britain"}, - {0x18, 0x01, 0x1F, 0x0B, "Greece"}, - {0x18, 0x01, 0x1F, 0x0C, "Holland"}, - {0x18, 0x01, 0x1F, 0x0D, "Italy"}, - {0x18, 0x01, 0x1F, 0x0E, "Norway"}, - {0x18, 0x01, 0x1F, 0x0F, "Portugal"}, - {0x18, 0x01, 0x1F, 0x10, "Spain"}, - {0x18, 0x01, 0x1F, 0x11, "Sweden"}, - {0x18, 0x01, 0x1F, 0x12, "Switzerland"}, - {0x18, 0x01, 0x1F, 0x13, "Australia"}, - {0x18, 0x01, 0x1F, 0x14, "New Zealand"}, - {0x18, 0x01, 0x1F, 0x15, "Taiwan"}, - {0x18, 0x01, 0x1F, 0x16, "HongKong"}, - {0x18, 0x01, 0x1F, 0x17, "Korea"}, - {0x18, 0x01, 0x1F, 0x18, "China"}, - {0x18, 0x01, 0x1F, 0x19, "World"}, -}; - -static struct BurnDIPInfo batriderRegionDIPList[] = { - // Defaults - {0x18, 0xFF, 0xFF, 0x00, NULL}, -}; - -static struct BurnDIPInfo batridRegionDIPList[] = { - // Defaults - {0x18, 0xFF, 0xFF, 0x02, NULL}, -}; - -static struct BurnDIPInfo batriduRegionDIPList[] = { - // Defaults - {0x18, 0xFF, 0xFF, 0x01, NULL}, -}; - -static struct BurnDIPInfo batridcRegionDIPList[] = { - // Defaults - {0x18, 0xFF, 0xFF, 0x18, NULL}, -}; - -static struct BurnDIPInfo batridhkRegionDIPList[] = { - // Defaults - {0x18, 0xFF, 0xFF, 0x16, NULL}, -}; - -static struct BurnDIPInfo batridkRegionDIPList[] = { - // Defaults - {0x18, 0xFF, 0xFF, 0x17, NULL}, -}; - -static struct BurnDIPInfo batridtaRegionDIPList[] = { - // Defaults - {0x18, 0xFF, 0xFF, 0x15, NULL}, -}; - -STDDIPINFOEXT(batrider, batriderRegion, batrider) -STDDIPINFOEXT(batrid, batridRegion, batrider) -STDDIPINFOEXT(batridu, batriduRegion, batrider) -STDDIPINFOEXT(batridc, batridcRegion, batrider) -STDDIPINFOEXT(batridk, batridkRegion, batrider) -STDDIPINFOEXT(batridhk, batridhkRegion, batrider) -STDDIPINFOEXT(batridta, batridtaRegion, batrider) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *Ram02, *RamPal; -UINT8 *RamShared; -static INT32 nColCount = 0x0800; - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x200000; // 68000 ROM - RomZ80 = Next; Next += 0x040000; // Z80 ROM - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // Tile data - MSM6295ROM = Next; Next += 0x200000; // MSM6295 ADPCM data - RamStart = Next; - ExtraTRAM = Next; Next += 0x002000; // Extra text layer - Ram01 = Next; Next += 0x005000; // RAM + Extra text layer scroll/offset - ExtraTROM = Next; Next += 0x008000; // Extra text layer tile data - Ram02 = Next; Next += 0x008000; // CPU #0 work RAM - RamPal = Next; Next += 0x001000; // Palette - RamZ80 = Next; Next += 0x004000; // Z80 RAM - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamShared = Next; Next += 0x000008; // Shared data - RamEnd = Next; - ToaPalette = (UINT32*)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - ExtraTSelect= Ram01; // Extra text layer scroll - ExtraTScroll= Ram01 + 0x000200; // Extra text layer offset - - return 0; -} - -static void DrvZ80Sync() -{ - INT32 todo = ((SekTotalCycles() / 4) - nCyclesDone[1]); - if (todo > 0) nCyclesDone[1] += ZetRun(todo); -} - - -static void drvZ80Bankswitch(INT32 nBank) -{ - nBank &= 0x0F; - if (nBank != nCurrentBank) { - UINT8* nStartAddress = RomZ80 + (nBank << 14); - ZetMapArea(0x8000, 0xBFFF, 0, nStartAddress); - ZetMapArea(0x8000, 0xBFFF, 2, nStartAddress); - - nCurrentBank = nBank; - } -} - -// Scan ram -static INT32 drvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029496; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // Scan 68000 - ZetScan(nAction); // Scan Z80 - SCAN_VAR(nCurrentBank); - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - BurnYM2151Scan(nAction); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(nIRQPending); - SCAN_VAR(nTextROMStatus); - - SCAN_VAR(drvInput); - - if (nAction & ACB_WRITE) { - INT32 n = nTextROMStatus; - nTextROMStatus = -1; - SekOpen(0); - Map68KTextROM(n); - SekClose(); - - n = nCurrentBank; - nCurrentBank = -1; - ZetOpen(0); - drvZ80Bankswitch(n); - ZetClose(); - } - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROMs - if (ToaLoadCode(Rom01, 0, 4)) { - return 1; - } - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 4, 4, nGP9001ROMSize[0]); - - // Load the Z80 ROM - if (BurnLoadRom(RomZ80, 8, 1)) { - return 1; - } - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROM + 0x000000, 9, 1); - BurnLoadRom(MSM6295ROM + 0x100000, 10, 1); - - return 0; -} - -UINT8 __fastcall batriderZIn(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - - // The sound commands sent by the 68000 are read from these locations - case 0x48: - return RamShared[0]; - case 0x4A: - return RamShared[1]; - - case 0x81: - return BurnYM2151ReadStatus(); - case 0x82: - return MSM6295ReadStatus(0); - case 0x84: - return MSM6295ReadStatus(1); - } - - return 0; -} - -void __fastcall batriderZOut(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - - // The 68000 expects to read back the sound command it sent - case 0x40: - RamShared[4] = nValue; - break; - case 0x42: - RamShared[5] = nValue; - break; - - case 0x44: // ??? - case 0x46: // Acknowledge interrupt - break; - - case 0x80: - BurnYM2151SelectRegister(nValue); - break; - case 0x81: - BurnYM2151WriteRegister(nValue); - break; - - case 0x82: - MSM6295Command(0, nValue); - break; - case 0x84: - MSM6295Command(1, nValue); - break; - - case 0x88: { - drvZ80Bankswitch(nValue); - break; - - case 0xC0: - case 0xC2: - case 0xC4: - case 0xC6: - NMK112_okibank_write((nAddress & 6) + 0, nValue & 0xf); - NMK112_okibank_write((nAddress & 6) + 1, nValue >> 4); - break; - } - } -} - -static INT32 drvZInit() -{ - // Init the Z80 - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(batriderZIn); - ZetSetOutHandler(batriderZOut); - - // ROM bank 1 - ZetMapArea(0x0000, 0x7FFF, 0, RomZ80 + 0x0000); // Direct Read from ROM - ZetMapArea(0x0000, 0x7FFF, 2, RomZ80 + 0x0000); // Direct Fetch from ROM - // ROM bank 2 - ZetMapArea(0x8000, 0xBFFF, 0, RomZ80 + 0x8000); // Direct Read from ROM - ZetMapArea(0x8000, 0xBFFF, 2, RomZ80 + 0x8000); // - // RAM - ZetMapArea(0xC000, 0xDFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea(0xC000, 0xDFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea(0xC000, 0xDFFF, 2, RamZ80); // - - ZetClose(); - - nCurrentBank = 2; - - return 0; -} - -UINT8 __fastcall batriderReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x500000: // Player 2 inputs - return drvInput[1]; - case 0x500001: // Player 1 inputs - return drvInput[0]; - case 0x500002: // Dipswitch 3 - return drvInput[5]; - case 0x500003: // Other inputs - return drvInput[2]; - case 0x500004: // Dipswitch 2 - return drvInput[4]; - case 0x500005: // Dipswitch 1 - return drvInput[3]; - - default: { -// printf("Attempt to read %06X (byte).\n", sekAddress); - - if ((sekAddress & 0x00F80000) == 0x00300000) { - return RomZ80[(sekAddress & 0x7FFFF) >> 1]; - } - } - } - - return 0; -} - -UINT16 __fastcall batriderReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x500006: - return ToaScanlineRegister(); - - // These addresses contain the response of the Z80 to the sound commands - case 0x500008: - return RamShared[4]; - case 0x50000A: - return RamShared[5]; - - case 0x50000C: - // This address echos the value written to 0x500060 - return nData; - - default: { -// printf("Attempt to read %06X (word).\n", sekAddress); - } - } - - return 0; -} - -void __fastcall batriderWriteByte(UINT32 sekAddress, UINT8) // UINT8 byteValue -{ - switch (sekAddress) { - - case 0x500011: // Coin control - break; - -// default: -// printf("Attempt to write %06X (byte) -> %04X.\n", sekAddress, byteValue); - } -} - -void __fastcall batriderWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x500020: { - DrvZ80Sync(); - RamShared[0] = wordValue; - - // The 68K program normally writes 0x500020/0x500022 as a single longword, - // except during the communications test. - if (wordValue == 0x55) { - ZetNmi(); - } - break; - } - case 0x500022: - DrvZ80Sync(); - RamShared[1] = wordValue; - - // Sound commands are processed by the Z80 using an NMI - // So, trigger a Z80 NMI and execute it - ZetNmi(); - break; - - case 0x500024: - // Writes to this address only occur in situations where the program sets - // 0x20FA19 (Ram02[0x7A18]) to 0xFF, and then sits in a loop waiting for it to become 0x00 - // Interrupt 4 does this (the same code is also conditionally called from interrupt 2) - - nIRQPending = 1; - SekSetIRQLine(4, CPU_IRQSTATUS_ACK); - break; - - case 0x500060: - // Bit 0 of the value written to this location must be echod at 0x50000C - nData = wordValue; - break; - - case 0x500080: - Map68KTextROM(false); - break; - - case 0x500082: // Acknowledge interrupt - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - nIRQPending = 0; - break; - - case 0x5000C0: - case 0x5000C1: - case 0x5000C2: - case 0x5000C3: - case 0x5000C4: - case 0x5000C5: - case 0x5000C6: - case 0x5000C7: - case 0x5000C8: - case 0x5000C9: - case 0x5000CA: - case 0x5000CB: - case 0x5000CC: - case 0x5000CD: - case 0x5000CE: - GP9001TileBank[(sekAddress & 0x0F) >> 1] = ((wordValue & 0x0F) << 15); - break; - -// default: -// printf("Attempt to write %06X (word) -> %04X.\n", sekAddress, wordValue); - } -} - -UINT16 __fastcall batriderReadWordGP9001(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x400008: - return ToaGP9001ReadRAM_Hi(0); - case 0x40000A: - return ToaGP9001ReadRAM_Lo(0); - - } - - return 0; -} - -void __fastcall batriderWriteWordGP9001(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x400000: - ToaGP9001WriteRegister(wordValue); - break; - - case 0x400004: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x400008: - case 0x40000A: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x40000C: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - } -} - -UINT8 __fastcall batriderReadByteZ80ROM(UINT32 sekAddress) -{ - return RomZ80[(sekAddress & 0x7FFFF) >> 1]; -} - -UINT16 __fastcall batriderReadWordZ80ROM(UINT32 sekAddress) -{ - return RomZ80[(sekAddress & 0x7FFFF) >> 1]; -} - -static void Map68KTextROM(bool bMapTextROM) -{ - if (bMapTextROM) { - if (nTextROMStatus != 1) { - SekMapMemory(ExtraTROM, 0x200000, 0x207FFF, MAP_RAM); // Extra text tile memory - - nTextROMStatus = 1; - } - } else { - if (nTextROMStatus != 0) { - SekMapMemory(ExtraTRAM, 0x200000, 0x201FFF, MAP_RAM); // Extra text tilemap RAM - SekMapMemory(RamPal, 0x202000, 0x202FFF, MAP_RAM); // Palette RAM - SekMapMemory(Ram01, 0x203000, 0x207FFF, MAP_RAM); // Extra text Scroll & offset; RAM - - nTextROMStatus = 0; - } - } -} - -static INT32 drvDoReset() -{ - // Insert region code into 68K ROM, code by BisonSAS - UINT8 nRegion = drvRegion & 0x1F; - - if (nRegion<=25) { - Rom01[0x00000^1]=(UINT8)(nRegion<<13) | (drvRegion & 0x1F); - } - - SekOpen(0); - - nIRQPending = 0; - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - - Map68KTextROM(true); - - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - MSM6295Reset(1); - BurnYM2151Reset(); - NMK112Reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 drvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x01000000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8*)0; - if ((Mem = (UINT8*)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // Zero memory - MemIndex(); // Index the allocated memory - - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram02, 0x208000, 0x20FFFF, MAP_RAM); - - Map68KTextROM(true); - - SekSetReadWordHandler(0, batriderReadWord); - SekSetReadByteHandler(0, batriderReadByte); - SekSetWriteWordHandler(0, batriderWriteWord); - SekSetWriteByteHandler(0, batriderWriteByte); - - SekMapHandler(1, 0x400000, 0x400400, MAP_RAM); // GP9001 addresses - - SekSetReadWordHandler(1, batriderReadWordGP9001); - SekSetWriteWordHandler(1, batriderWriteWordGP9001); - - SekMapHandler(2, 0x300000, 0x37FFFF, MAP_ROM); // Z80 ROM - - SekSetReadByteHandler(2, batriderReadByteZ80ROM); - SekSetReadWordHandler(2, batriderReadWordZ80ROM); - - SekClose(); - } - - nSpriteYOffset = 0x0001; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(); - - nExtraTXOffset = 0x2C; - ToaExtraTextInit(); - - drvZInit(); // Initialize Z80 - - BurnYM2151Init(32000000 / 8); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - MSM6295Init(0, 32000000 / 10 / 132, 1); - MSM6295Init(1, 32000000 / 10 / 165, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - NMK112_init(0, MSM6295ROM, MSM6295ROM + 0x100000, 0x100000, 0x100000); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - nTextROMStatus = -1; - bDrawScreen = true; - - drvDoReset(); // Reset machine - return 0; -} - -static INT32 drvExit() -{ - MSM6295Exit(0); - MSM6295Exit(1); - BurnYM2151Exit(); - - ToaPalExit(); - ToaExitGP9001(); - ToaExtraTextExit(); - ToaZExit(); // Z80 exit - SekExit(); // Deallocate 68000 - - BurnFree(Mem); - - return 0; -} - -static INT32 drvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - ToaExtraTextLayer(); // Render extra text layer - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -static INT32 drvFrame() -{ - INT32 nInterleave = 8; - - if (drvReset) { // Reset machine - drvDoReset(); - } - - // Compile digital inputs - drvInput[0] = 0x00; // Buttons - drvInput[1] = 0x00; // Player 1 - drvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - drvInput[0] |= (drvJoy1[i] & 1) << i; - drvInput[1] |= (drvJoy2[i] & 1) << i; - drvInput[2] |= (drvButton[i] & 1) << i; - } - ToaClearOpposites(&drvInput[0]); - ToaClearOpposites(&drvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = TOA_Z80_SPEED / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - ZetOpen(0); - for (INT32 i = 1; i <= nInterleave; i++) { - // Run 68000 - INT32 nCurrentCPU = 0; - INT32 nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - ToaBufferGP9001Sprites(); - if (pBurnDraw) { // Draw screen if needed - drvDraw(); - } - - nIRQPending = 1; - SekSetIRQLine(2, CPU_IRQSTATUS_ACK); - - bVBlank = true; - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - - // Run Z80 - nCurrentCPU = 1; - nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = (nBurnSoundLen * i / nInterleave) - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekClose(); - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - MSM6295Render(1, pSoundBuf, nSegmentLength); - } - } - } - - ZetClose(); - - return 0; -} - -// Rom information -/* -The region of Batrider is controlled by the first byte of rom prg0.u22 -only sets which have been dumped from original PCBs are supported - -original ROM labels have no indication of the region. - -valid values are: - ( * denotes that this set has been found on an original PCB ) - - 00 : Nippon * - 01 : USA * - 02 : Europe * - 03 : Asia - 04 : German (sic) - 05 : Austria - 06 : Belgium - 07 : Denmark - 08 : Finland - 09 : France - 0A : Great Britain - 0B : Greece - 0C : Holland - 0D : Italy - 0E : Norway - 0F : Portugal - 10 : Spain - 11 : Sweden - 12 : Switzerland - 13 : Australia - 14 : New Zealand - 15 : Taiwan - 16 : Hong Kong - 17 : Korea * - 18 : China * - 19 : No Region? - 1A+: Invalid - - For future reference, that would mean the following - - { "prg0_nippon.u22", 0x080000, 0x4f3fc729, BRF_ESS | BRF_PRG }, - { "prg0_usa.u22", 0x080000, 0x2049d007, BRF_ESS | BRF_PRG }, - { "prg0_europe.u22", 0x080000, 0x91d3e975, BRF_ESS | BRF_PRG }, - { "prg0_asia.u22", 0x080000, 0xfea5fe5b, BRF_ESS | BRF_PRG }, - { "prg0_german.u22", 0x080000, 0x29969dd0, BRF_ESS | BRF_PRG }, - { "prg0_austria.u22", 0x080000, 0x46e08afe, BRF_ESS | BRF_PRG }, - { "prg0_belgium.u22", 0x080000, 0xf77ab38c, BRF_ESS | BRF_PRG }, - { "prg0_denmark.u22", 0x080000, 0x980ca4a2, BRF_ESS | BRF_PRG }, - { "prg0_finland.u22", 0x080000, 0x826d72db, BRF_ESS | BRF_PRG }, - { "prg0_france.u22", 0x080000, 0xed1b65f5, BRF_ESS | BRF_PRG }, - { "prg0_greatbritain.u22", 0x080000, 0x5c815c87, BRF_ESS | BRF_PRG }, - { "prg0_greece.u22", 0x080000, 0x33f74ba9, BRF_ESS | BRF_PRG }, - { "prg0_holland.u22", 0x080000, 0xe4c42822, BRF_ESS | BRF_PRG }, - { "prg0_italy.u22", 0x080000, 0x8bb23f0c, BRF_ESS | BRF_PRG }, - { "prg0_norway.u22", 0x080000, 0x3a28067e, BRF_ESS | BRF_PRG }, - { "prg0_portugal.u22", 0x080000, 0x555e1150, BRF_ESS | BRF_PRG }, - { "prg0_spain.u22", 0x080000, 0x0eebaa8c, BRF_ESS | BRF_PRG }, - { "prg0_sweden.u22", 0x080000, 0x619dbda2, BRF_ESS | BRF_PRG }, - { "prg0_switzerland.u22", 0x080000, 0xd00784d0, BRF_ESS | BRF_PRG }, - { "prg0_australia.u22", 0x080000, 0xbf7193fe, BRF_ESS | BRF_PRG }, - { "prg0_newzealand.u22", 0x080000, 0x6842f075, BRF_ESS | BRF_PRG }, - { "prg0_taiwan.u22", 0x080000, 0x0734e75b, BRF_ESS | BRF_PRG }, - { "prg0_hongkong.u22", 0x080000, 0xb6aede29, BRF_ESS | BRF_PRG }, - { "prg0_korea.u22", 0x080000, 0xd9d8c907, BRF_ESS | BRF_PRG }, - { "prg0_china.u22", 0x080000, 0xc3b91f7e, BRF_ESS | BRF_PRG }, - { "prg0_none.u22", 0x080000, 0xaccf0850, BRF_ESS | BRF_PRG }, - */ - -static struct BurnRomInfo batridRomDesc[] = { - { "prg0_europe.u22", 0x080000, 0x91d3e975, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2.u21", 0x080000, 0xbdaa5fbf, BRF_ESS | BRF_PRG }, // 1 - { "prg1b.u23", 0x080000, 0x8e70b492, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3.u24", 0x080000, 0x7aa9f941, BRF_ESS | BRF_PRG }, // 3 - - { "rom-1.bin", 0x400000, 0x0df69ca2, BRF_GRA }, // 4 GP9001 Tile data - { "rom-3.bin", 0x400000, 0x60167d38, BRF_GRA }, // 5 - { "rom-2.bin", 0x400000, 0x1bfea593, BRF_GRA }, // 6 - { "rom-4.bin", 0x400000, 0xbee03c94, BRF_GRA }, // 7 - - { "snd.u77", 0x040000, 0x56682696, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom-5.bin", 0x100000, 0x4274daf6, BRF_SND }, // 9 MSM6295 #1 ADPCM data - { "rom-6.bin", 0x100000, 0x2a1c2426, BRF_SND }, // 10 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(batrid) -STD_ROM_FN(batrid) - -static struct BurnRomInfo batriduRomDesc[] = { - { "prg0_usa.u22", 0x080000, 0x2049d007, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2.u21", 0x080000, 0xbdaa5fbf, BRF_ESS | BRF_PRG }, // 1 - { "prg1b.u23", 0x080000, 0x8e70b492, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3.u24", 0x080000, 0x7aa9f941, BRF_ESS | BRF_PRG }, // 3 - - { "rom-1.bin", 0x400000, 0x0df69ca2, BRF_GRA }, // 4 GP9001 Tile data - { "rom-3.bin", 0x400000, 0x60167d38, BRF_GRA }, // 5 - { "rom-2.bin", 0x400000, 0x1bfea593, BRF_GRA }, // 6 - { "rom-4.bin", 0x400000, 0xbee03c94, BRF_GRA }, // 7 - - { "snd.u77", 0x040000, 0x56682696, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom-5.bin", 0x100000, 0x4274daf6, BRF_SND }, // 9 MSM6295 #1 ADPCM data - { "rom-6.bin", 0x100000, 0x2a1c2426, BRF_SND }, // 10 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(batridu) -STD_ROM_FN(batridu) - -static struct BurnRomInfo batridcRomDesc[] = { - { "prg0_china.u22", 0x080000, 0xc3b91f7e, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2.u21", 0x080000, 0xbdaa5fbf, BRF_ESS | BRF_PRG }, // 1 - { "prg1b.u23", 0x080000, 0x8e70b492, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3.u24", 0x080000, 0x7aa9f941, BRF_ESS | BRF_PRG }, // 3 - - { "rom-1.bin", 0x400000, 0x0df69ca2, BRF_GRA }, // 4 GP9001 Tile data - { "rom-3.bin", 0x400000, 0x60167d38, BRF_GRA }, // 5 - { "rom-2.bin", 0x400000, 0x1bfea593, BRF_GRA }, // 6 - { "rom-4.bin", 0x400000, 0xbee03c94, BRF_GRA }, // 7 - - { "snd.u77", 0x040000, 0x56682696, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom-5.bin", 0x100000, 0x4274daf6, BRF_SND }, // 9 MSM6295 #1 ADPCM data - { "rom-6.bin", 0x100000, 0x2a1c2426, BRF_SND }, // 10 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(batridc) -STD_ROM_FN(batridc) - -static struct BurnRomInfo batridhkRomDesc[] = { - { "prg0.u22", 0x080000, 0x00afbb7c, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2.u21", 0x080000, 0xbdaa5fbf, BRF_ESS | BRF_PRG }, // 1 - { "prg1.u23", 0x080000, 0x8ae7f592, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3.u24", 0x080000, 0x7aa9f941, BRF_ESS | BRF_PRG }, // 3 - - { "rom-1.bin", 0x400000, 0x0df69ca2, BRF_GRA }, // 4 GP9001 Tile data - { "rom-3.bin", 0x400000, 0x60167d38, BRF_GRA }, // 5 - { "rom-2.bin", 0x400000, 0x1bfea593, BRF_GRA }, // 6 - { "rom-4.bin", 0x400000, 0xbee03c94, BRF_GRA }, // 7 - - { "snd.u77", 0x040000, 0x56682696, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom-5.bin", 0x100000, 0x4274daf6, BRF_SND }, // 9 MSM6295 #1 ADPCM data - { "rom-6.bin", 0x100000, 0x2a1c2426, BRF_SND }, // 10 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(batridhk) -STD_ROM_FN(batridhk) - -static struct BurnRomInfo batridjRomDesc[] = { - { "prg0b.u22", 0x080000, 0x4f3fc729, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2.u21", 0x080000, 0xbdaa5fbf, BRF_ESS | BRF_PRG }, // 1 - { "prg1b.u23", 0x080000, 0x8e70b492, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3.u24", 0x080000, 0x7aa9f941, BRF_ESS | BRF_PRG }, // 3 - - { "rom-1.bin", 0x400000, 0x0df69ca2, BRF_GRA }, // 4 GP9001 Tile data - { "rom-3.bin", 0x400000, 0x60167d38, BRF_GRA }, // 5 - { "rom-2.bin", 0x400000, 0x1bfea593, BRF_GRA }, // 6 - { "rom-4.bin", 0x400000, 0xbee03c94, BRF_GRA }, // 7 - - { "snd.u77", 0x040000, 0x56682696, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom-5.bin", 0x100000, 0x4274daf6, BRF_SND }, // 9 MSM6295 #1 ADPCM data - { "rom-6.bin", 0x100000, 0x2a1c2426, BRF_SND }, // 10 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(batridj) -STD_ROM_FN(batridj) - -static struct BurnRomInfo batridkRomDesc[] = { - { "prg0_korea.u22", 0x080000, 0xd9d8c907, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2.u21", 0x080000, 0xbdaa5fbf, BRF_ESS | BRF_PRG }, // 1 - { "prg1b.u23", 0x080000, 0x8e70b492, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3.u24", 0x080000, 0x7aa9f941, BRF_ESS | BRF_PRG }, // 3 - - { "rom-1.bin", 0x400000, 0x0df69ca2, BRF_GRA }, // 4 GP9001 Tile data - { "rom-3.bin", 0x400000, 0x60167d38, BRF_GRA }, // 5 - { "rom-2.bin", 0x400000, 0x1bfea593, BRF_GRA }, // 6 - { "rom-4.bin", 0x400000, 0xbee03c94, BRF_GRA }, // 7 - - { "snd.u77", 0x040000, 0x56682696, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom-5.bin", 0x100000, 0x4274daf6, BRF_SND }, // 9 MSM6295 #1 ADPCM data - { "rom-6.bin", 0x100000, 0x2a1c2426, BRF_SND }, // 10 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(batridk) -STD_ROM_FN(batridk) - -static struct BurnRomInfo batridjaRomDesc[] = { - { "prg0.bin", 0x080000, 0xf93ea27c, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2.u21", 0x080000, 0xbdaa5fbf, BRF_ESS | BRF_PRG }, // 1 - { "prg1.u23", 0x080000, 0x8ae7f592, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3.u24", 0x080000, 0x7aa9f941, BRF_ESS | BRF_PRG }, // 3 - - { "rom-1.bin", 0x400000, 0x0df69ca2, BRF_GRA }, // 4 GP9001 Tile data - { "rom-3.bin", 0x400000, 0x60167d38, BRF_GRA }, // 5 - { "rom-2.bin", 0x400000, 0x1bfea593, BRF_GRA }, // 6 - { "rom-4.bin", 0x400000, 0xbee03c94, BRF_GRA }, // 7 - - { "snd.u77", 0x040000, 0x56682696, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom-5.bin", 0x100000, 0x4274daf6, BRF_SND }, // 9 MSM6295 #1 ADPCM data - { "rom-6.bin", 0x100000, 0x2a1c2426, BRF_SND }, // 10 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(batridja) -STD_ROM_FN(batridja) - -static struct BurnRomInfo batridtaRomDesc[] = { - { "u22.bin", 0x080000, 0xb135820e, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2.u21", 0x080000, 0xbdaa5fbf, BRF_ESS | BRF_PRG }, // 1 - { "prg1.u23", 0x080000, 0x8ae7f592, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3.u24", 0x080000, 0x7aa9f941, BRF_ESS | BRF_PRG }, // 3 - - { "rom-1.bin", 0x400000, 0x0df69ca2, BRF_GRA }, // 4 GP9001 Tile data - { "rom-3.bin", 0x400000, 0x60167d38, BRF_GRA }, // 5 - { "rom-2.bin", 0x400000, 0x1bfea593, BRF_GRA }, // 6 - { "rom-4.bin", 0x400000, 0xbee03c94, BRF_GRA }, // 7 - - { "snd.u77", 0x040000, 0x56682696, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom-5.bin", 0x100000, 0x4274daf6, BRF_SND }, // 9 MSM6295 #1 ADPCM data - { "rom-6.bin", 0x100000, 0x2a1c2426, BRF_SND }, // 10 MSM6295 #2 ADPCM data -}; - - -STD_ROM_PICK(batridta) -STD_ROM_FN(batridta) - -struct BurnDriver BurnDrvBatrid = { - "batrider", NULL, NULL, NULL, "1998", - "Armed Police Batrider (Europe) (Fri Feb 13 1998)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, batridRomInfo, batridRomName, NULL, NULL, batriderInputInfo, batridDIPInfo, - drvInit, drvExit, drvFrame, drvDraw, drvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatridu = { - "batrideru", "batrider", NULL, NULL, "1998", - "Armed Police Batrider (U.S.A.) (Fri Feb 13 1998)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, batriduRomInfo, batriduRomName, NULL, NULL, batriderInputInfo, batriduDIPInfo, - drvInit, drvExit, drvFrame, drvDraw, drvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatridc = { - "batriderc", "batrider", NULL, NULL, "1998", - "Armed Police Batrider (China) (Fri Feb 13 1998)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, batridcRomInfo, batridcRomName, NULL, NULL, batriderInputInfo, batridcDIPInfo, - drvInit, drvExit, drvFrame, drvDraw, drvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatridhk = { - "batriderhk", "batrider", NULL, NULL, "1998", - "Armed Police Batrider - A Version (Hong Kong) (Mon Dec 22 1997)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, batridhkRomInfo, batridhkRomName, NULL, NULL, batriderInputInfo, batridhkDIPInfo, - drvInit, drvExit, drvFrame, drvDraw, drvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatridj = { - "batriderj", "batrider", NULL, NULL, "1998", - "Armed Police Batrider - B Version (Japan) (Fri Feb 13 1998)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, batridjRomInfo, batridjRomName, NULL, NULL, batriderInputInfo, batriderDIPInfo, - drvInit, drvExit, drvFrame, drvDraw, drvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatridk = { - "batriderk", "batrider", NULL, NULL, "1998", - "Armed Police Batrider (Korea) (Fri Feb 13 1998)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, batridkRomInfo, batridkRomName, NULL, NULL, batriderInputInfo, batridkDIPInfo, - drvInit, drvExit, drvFrame, drvDraw, drvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatridja = { - "batriderja", "batrider", NULL, NULL, "1998", - "Armed Police Batrider - A Version (Japan) (Mon Dec 22 1997)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, batridjaRomInfo, batridjaRomName, NULL, NULL, batriderInputInfo, batriderDIPInfo, - drvInit, drvExit, drvFrame, drvDraw, drvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatridta = { - "batridert", "batrider", NULL, NULL, "1998", - "Armed Police Batrider - A Version (Taiwan) (Mon Dec 22 1997)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, batridtaRomInfo, batridtaRomName, NULL, NULL, batriderInputInfo, batridtaDIPInfo, - drvInit, drvExit, drvFrame, drvDraw, drvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_batsugun.cpp b/jan/src/burn/drv/toaplan/d_batsugun.cpp deleted file mode 100644 index 3bf4c3488..000000000 --- a/jan/src/burn/drv/toaplan/d_batsugun.cpp +++ /dev/null @@ -1,830 +0,0 @@ -// FB Alpha Batsugun driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -#include "nec_intf.h" -// Batsugun & Batsugun Special Version - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT32 v25_reset = 0; - -// Rom information -static struct BurnRomInfo batsugunRomDesc[] = { - { "tp030_1a.bin", 0x080000, 0xcb1d4554, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp030_3l.bin", 0x100000, 0x3024b793, BRF_GRA }, // 1 GP9001 #1 Tile data - { "tp030_3h.bin", 0x100000, 0xed75730b, BRF_GRA }, // 2 - { "tp030_4l.bin", 0x100000, 0xfedb9861, BRF_GRA }, // 3 - { "tp030_4h.bin", 0x100000, 0xd482948b, BRF_GRA }, // 4 - - { "tp030_5.bin", 0x100000, 0xbcf5ba05, BRF_GRA }, // 5 - { "tp030_6.bin", 0x100000, 0x0666fecd, BRF_GRA }, // 6 - - { "tp030_2.bin", 0x040000, 0x276146f5, BRF_SND }, // 7 ADPCM data - - { "tp030_u19_gal16v8b-15.bin", 0x000117, 0xf71669e8, BRF_OPT }, // 8 Logic for mixing output of both GP9001 GFX controllers -// { "tp030_u19_gal16v8b-15.jed", 0x000991, 0x31be54a2, BRF_OPT }, -}; - -STD_ROM_PICK(batsugun) -STD_ROM_FN(batsugun) - -static struct BurnRomInfo batsugnaRomDesc[] = { - { "tp030_01.bin", 0x080000, 0x3873d7dd, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp030_3l.bin", 0x100000, 0x3024b793, BRF_GRA }, // 1 GP9001 #1 Tile data - { "tp030_3h.bin", 0x100000, 0xed75730b, BRF_GRA }, // 2 - { "tp030_4l.bin", 0x100000, 0xfedb9861, BRF_GRA }, // 3 - { "tp030_4h.bin", 0x100000, 0xd482948b, BRF_GRA }, // 4 - - { "tp030_5.bin", 0x100000, 0xbcf5ba05, BRF_GRA }, // 5 - { "tp030_6.bin", 0x100000, 0x0666fecd, BRF_GRA }, // 6 - - { "tp030_2.bin", 0x040000, 0x276146f5, BRF_SND }, // 7 ADPCM data - - { "tp030_u19_gal16v8b-15.bin", 0x000117, 0xf71669e8, BRF_OPT }, // 8 Logic for mixing output of both GP9001 GFX controllers -}; - -STD_ROM_PICK(batsugna) -STD_ROM_FN(batsugna) - -static struct BurnRomInfo batugnspRomDesc[] = { - { "tp030-sp.u69", 0x080000, 0x8072a0cd, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp030_3l.bin", 0x100000, 0x3024b793, BRF_GRA }, // 1 GP9001 #1 Tile data - { "tp030_3h.bin", 0x100000, 0xed75730b, BRF_GRA }, // 2 - { "tp030_4l.bin", 0x100000, 0xfedb9861, BRF_GRA }, // 3 - { "tp030_4h.bin", 0x100000, 0xd482948b, BRF_GRA }, // 4 - - { "tp030_5.bin", 0x100000, 0xbcf5ba05, BRF_GRA }, // 5 - { "tp030_6.bin", 0x100000, 0x0666fecd, BRF_GRA }, // 6 - - { "tp030_2.bin", 0x040000, 0x276146f5, BRF_SND }, // 7 ADPCM data - - { "tp030_u19_gal16v8b-15.bin", 0x000117, 0xf71669e8, BRF_OPT }, // 8 Logic for mixing output of both GP9001 GFX controllers -}; - -STD_ROM_PICK(batugnsp) -STD_ROM_FN(batugnsp) - - -static struct BurnRomInfo batsugunbRomDesc[] = { - { "large_rom1.bin", 0x80000, 0xc9de8ed8, 1 | BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "rom12.bin", 0x80000, 0xd25affc6, 2 | BRF_GRA }, // 1 GP9001 #1 Tile data - { "rom6.bin", 0x80000, 0xddd6df60, 2 | BRF_GRA }, // 2 - { "rom11.bin", 0x80000, 0xed72fe3e, 2 | BRF_GRA }, // 3 - { "rom5.bin", 0x80000, 0xfd44b33b, 2 | BRF_GRA }, // 4 - { "rom10.bin", 0x80000, 0x86b2c6a9, 2 | BRF_GRA }, // 5 - { "rom4.bin", 0x80000, 0xe7c1c623, 2 | BRF_GRA }, // 6 - { "rom9.bin", 0x80000, 0xfda8ee00, 2 | BRF_GRA }, // 7 - { "rom3.bin", 0x80000, 0xa7c4dee8, 2 | BRF_GRA }, // 8 - - { "rom8.bin", 0x80000, 0xa2c6a170, 3 | BRF_GRA }, // 9 - { "rom2.bin", 0x80000, 0xa457e202, 3 | BRF_GRA }, // 10 - { "rom7.bin", 0x80000, 0x8644518f, 3 | BRF_GRA }, // 11 - { "rom1.bin", 0x80000, 0x8e339897, 3 | BRF_GRA }, // 12 - - { "rom13.bin", 0x40000, 0x276146f5, 4 | BRF_SND }, // 13 ADPCM data - - { "tp030_u19_gal16v8b-15.bin", 0x00117, 0xf71669e8, 5 | BRF_OPT }, // 14 Logic for mixing output of both GP9001 GFX controllers -}; - -STD_ROM_PICK(batsugunb) -STD_ROM_FN(batsugunb) - -static struct BurnInputInfo batsugunInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(batsugun) - -static struct BurnDIPInfo batsugunDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0x0F, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Continue mode"}, - {0x14, 0x01, 0x01, 0x00, "Normal continue"}, - {0x14, 0x01, 0x01, 0x01, "Discount continue"}, - {0, 0xFE, 0, 2, "Screen type"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - - // Normal coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x82, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0x30, 0x10, "1 coin 2 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0x30, 0x20, "2 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0x30, 0x30, "2 coins 3 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x82, 0xC0, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0xC0, 0x40, "1 coin 2 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0xC0, 0x80, "2 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0xC0, 0xC0, "2 coins 3 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - - // European coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x02, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0x30, 0x10, "2 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0x30, 0x20, "3 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0x30, 0x30, "3 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x02, 0xC0, 0x00, "1 coin 2 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0xC0, 0x40, "1 coin 3 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0xC0, 0x80, "1 coin 4 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0xC0, 0xC0, "1 coin 6 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B (normal)"}, - {0x15, 0x01, 0x03, 0x01, "A (easy)"}, - {0x15, 0x01, 0x03, 0x02, "C (hard)"}, - {0x15, 0x01, 0x03, 0x03, "D (very hard)"}, - {0, 0xFE, 0, 4, "Extend"}, - {0x15, 0x01, 0x0C, 0x00, "1,000,000pts only"}, - {0x15, 0x01, 0x0C, 0x04, "500,000 600,000 every"}, - {0x15, 0x01, 0x0C, 0x08, "1,500,000pts only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Hero counts"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x01, "5"}, - {0x15, 0x01, 0x30, 0x02, "2"}, - {0x15, 0x01, 0x30, 0x03, "1"}, - {0, 0xFE, 0, 2, "Cheating"}, - {0x15, 0x01, 0x40, 0x00, "Normal game"}, - {0x15, 0x01, 0x40, 0x40, "No-death & stop mode"}, - {0, 0xFE, 0, 2, "Continue"}, - {0x15, 0x01, 0x80, 0x00, "On"}, - {0x15, 0x01, 0x80, 0x80, "Off"}, - - // Region - {0, 0xFE, 0, 14, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Korea (Unite Trading license)"}, - {0x16, 0x01, 0x0F, 0x01, "Korea"}, - {0x16, 0x01, 0x0F, 0x02, "Hong Kong (Taito Corp license)"}, - {0x16, 0x01, 0x0F, 0x03, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x04, "Taiwan (Taito Corp license)"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "South East Asia (Taito Corp license)"}, - {0x16, 0x01, 0x0F, 0x07, "South East Asia"}, - {0x16, 0x01, 0x0F, 0x08, "Europe (Taito Corp license)"}, - {0x16, 0x01, 0x0F, 0x09, "Europe"}, - {0x16, 0x01, 0x0F, 0x0A, "U.S.A (Taito Corp license)"}, - {0x16, 0x01, 0x0F, 0x0B, "U.S.A"}, -// {0x16, 0x01, 0x0F, 0x0C, "Japan (Taito Corp license)"}, - {0x16, 0x01, 0x0F, 0x0D, "Japan (Taito Corp license"}, -// {0x16, 0x01, 0x0F, 0x0E, "Japan"}, - {0x16, 0x01, 0x0F, 0x0F, "Japan"}, -}; - -STDDIPINFO(batsugun) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal; -static UINT8 *ShareRAM; - -static INT32 nColCount = 0x0800; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - GP9001ROM[1]= Next; Next += nGP9001ROMSize[1]; // GP9001 tile data - MSM6295ROM = Next; Next += 0x040000; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - ShareRAM = Next; Next += 0x010000; - RamPal = Next; Next += 0x001000; // palette - GP9001RAM[0]= Next; Next += 0x004000; - GP9001RAM[1]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - GP9001Reg[1]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020997; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - VezScan(nAction); - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - ToaScanGP9001(nAction, pnMin); - } - - return 0; -} - -static INT32 NormalLoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 4, nGP9001ROMSize[0]); - ToaLoadGP9001Tiles(GP9001ROM[1], 5, 2, nGP9001ROMSize[1]); - - BurnLoadRom(MSM6295ROM, 7, 1); - - return 0; -} - -static void DecodeTiles(UINT8 *pDest, INT32 nROMSize, INT32 nSwap) -{ - UINT8* pTile; - - for (pTile = pDest; pTile < (pDest + nROMSize); pTile += 4) { - UINT8 data[4]; - for (INT32 n = 0; n < 4; n++) { - INT32 m = 7 - (n << 1); - UINT8 nPixels = ((pTile[0 ^ nSwap] >> m) & 1) << 0; - nPixels |= ((pTile[2 ^ nSwap] >> m) & 1) << 1; - nPixels |= ((pTile[1 ^ nSwap] >> m) & 1) << 2; - nPixels |= ((pTile[3 ^ nSwap] >> m) & 1) << 3; - nPixels |= ((pTile[0 ^ nSwap] >> (m - 1)) & 1) << 4; - nPixels |= ((pTile[2 ^ nSwap] >> (m - 1)) & 1) << 5; - nPixels |= ((pTile[1 ^ nSwap] >> (m - 1)) & 1) << 6; - nPixels |= ((pTile[3 ^ nSwap] >> (m - 1)) & 1) << 7; - - data[n] = nPixels; - } - - for (INT32 n = 0; n < 4; n++) { - pTile[n] = data[n]; - } - } -} - -static INT32 KoreaLoadRoms() -{ - BurnLoadRom(Rom01, 0, 1); - - BurnLoadRom(GP9001ROM[0] + 0x000000, 1, 4); - BurnLoadRom(GP9001ROM[0] + 0x000002, 2, 4); - BurnLoadRom(GP9001ROM[0] + 0x200000, 3, 4); - BurnLoadRom(GP9001ROM[0] + 0x200002, 4, 4); - BurnLoadRom(GP9001ROM[0] + 0x000001, 5, 4); - BurnLoadRom(GP9001ROM[0] + 0x000003, 6, 4); - BurnLoadRom(GP9001ROM[0] + 0x200001, 7, 4); - BurnLoadRom(GP9001ROM[0] + 0x200003, 8, 4); - - BurnLoadRom(GP9001ROM[1] + 0x000000, 9, 4); - BurnLoadRom(GP9001ROM[1] + 0x000002, 10, 4); - BurnLoadRom(GP9001ROM[1] + 0x000001, 11, 4); - BurnLoadRom(GP9001ROM[1] + 0x000003, 12, 4); - - BurnUpdateProgress(0.0, _T("Decoding graphics..."), 0); - - DecodeTiles(GP9001ROM[0], nGP9001ROMSize[0], 0); - DecodeTiles(GP9001ROM[1], nGP9001ROMSize[1], 0); - - BurnLoadRom(MSM6295ROM, 13, 1); - - return 0; -} - -UINT8 __fastcall batsugunReadByte(UINT32 sekAddress) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - return ShareRAM[(sekAddress / 2) & 0x7fff]; - } - - switch (sekAddress) { - case 0x200011: // Player 1 inputs - return DrvInput[0]; - case 0x200015: // Player 2 inputs - return DrvInput[1]; - case 0x200019: // Other inputs - return DrvInput[2]; - - case 0x30000D: - return ToaVBlankRegister(); - -// default: -// printf("Attempt to read %06X (byte).\n", sekAddress); - } - return 0; -} - -UINT16 __fastcall batsugunReadWord(UINT32 sekAddress) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - return ShareRAM[(sekAddress / 2) & 0x7fff]; - } - - switch (sekAddress) { - - case 0x200010: // Player 1 inputs - return DrvInput[0]; - case 0x200014: // Player 2 inputs - return DrvInput[1]; - case 0x200018: // Other inputs - return DrvInput[2]; - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x500004: - return ToaGP9001ReadRAM_Hi(1); - case 0x500006: - return ToaGP9001ReadRAM_Lo(1); - - case 0x700000: { -// int nCurrentScanline = (nCyclesDone[0] + nCyclesSegment - m68k_ICount) / ((16000000 / 60) / 0x0106); - return 0; - } - -// default: -// printf("Attempt to read %06X (word).\n", sekAddress); - } - return 0; -} - -void __fastcall batsugunWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - ShareRAM[(sekAddress / 2) & 0x7fff] = byteValue; - return; - } - - switch (sekAddress) { - case 0x20001c: - case 0x20001d: - if (!v25_reset && (~byteValue & 0x20)) VezReset(); - v25_reset = (~byteValue & 0x20); - break; - - default: { -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall batsugunWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - ShareRAM[(sekAddress / 2) & 0x7fff] = wordValue; - return; - } - - switch (sekAddress) { - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: - ToaGP9001WriteRegister(wordValue); - break; - - case 0x500000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue, 1); - break; - - case 0x500004: - case 0x500006: - ToaGP9001WriteRAM(wordValue, 1); - break; - - case 0x500008: - ToaGP9001SelectRegister(wordValue, 1); - break; - - case 0x50000C: - ToaGP9001WriteRegister(wordValue, 1); - break; - -// default: -// printf("Attempt to write %06X (word) -> %04X.\n", sekAddress, wordValue); - } -} - -void __fastcall batsugun_v25_write(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x00000: - BurnYM2151SelectRegister(data); - return; - - case 0x00001: - BurnYM2151WriteRegister(data); - return; - - case 0x00004: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall batsugun_v25_read(UINT32 address) -{ - switch (address) - { - case 0x00001: - return BurnYM2151ReadStatus(); - - case 0x00004: - return MSM6295ReadStatus(0); - } - - return 0; -} - -UINT8 __fastcall batsugun_v25_read_port(UINT32 port) -{ - switch (port) - { - case V25_PORT_PT: - return DrvInput[3]^0xff; - - case V25_PORT_P0: - return DrvInput[4]^0xff; - - case V25_PORT_P1: - return DrvInput[5]^0xff; - } - - return 0; -} - - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - VezOpen(0); - VezReset(); - VezClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - - v25_reset = 1; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit(INT32 (*pRomLoad)()) -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x400000; - nGP9001ROMSize[1] = 0x200000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (pRomLoad()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); // Palette RAM - SekSetReadWordHandler(0, batsugunReadWord); - SekSetReadByteHandler(0, batsugunReadByte); - SekSetWriteWordHandler(0, batsugunWriteWord); - SekSetWriteByteHandler(0, batsugunWriteByte); - SekClose(); - - VezInit(0, V25_TYPE, 16000000 /*before divider*/); - VezOpen(0); - for (INT32 i = 0x80000; i < 0x100000; i += 0x8000) { - VezMapArea(i, i + 0x7fff, 0, ShareRAM); - VezMapArea(i, i + 0x7fff, 1, ShareRAM); - VezMapArea(i, i + 0x7fff, 2, ShareRAM); - } - VezSetReadHandler(batsugun_v25_read); - VezSetWriteHandler(batsugun_v25_write); - VezSetReadPort(batsugun_v25_read_port); - VezClose(); - } - - BurnYM2151Init(3375000); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 4000000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - nSpriteYOffset = 0x0001; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(3); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -static INT32 BatsugunInit() -{ - return DrvInit(NormalLoadRoms); -} - -static INT32 BatsugunbInit() -{ - return DrvInit(KoreaLoadRoms); -} - -static INT32 DrvExit() -{ - ToaPalExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - VezExit(); - - BurnFree(Mem); - - MSM6295ROM = NULL; - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 10; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - VezNewFrame(); - - INT32 nSoundBufferPos = 0; - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)8000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesDone[0] = 0; - nCyclesDone[1] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - VezOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - bVBlank = true; - - ToaBufferGP9001Sprites(); - -#if 0 - // The VBlank interrupt isn't actually used - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); -#endif - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - // sound! (increase interleave?) - if (v25_reset) { - nCyclesDone[1] += nCyclesTotal[1] / nInterleave; - } else { - nCyclesDone[1] += VezRun(nCyclesTotal[1] / nInterleave); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - - } - } - - VezClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -struct BurnDriver BurnDrvBatsugun = { - "batsugun", NULL, NULL, NULL, "1993", - "Batsugun (set 1)\0", NULL, "Toaplan", "Dual Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, batsugunRomInfo, batsugunRomName, NULL, NULL, batsugunInputInfo, batsugunDIPInfo, - BatsugunInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatsugunSP = { - "batsugunsp", "batsugun", NULL, NULL, "1993", - "Batsugun (Special Ver.)\0", NULL, "Toaplan", "Dual Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, batugnspRomInfo, batugnspRomName, NULL, NULL, batsugunInputInfo, batsugunDIPInfo, - BatsugunInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatsugna = { - "batsuguna", "batsugun", NULL, NULL, "1993", - "Batsugun (set 2)\0", NULL, "Toaplan", "Dual Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, batsugnaRomInfo, batsugnaRomName, NULL, NULL, batsugunInputInfo, batsugunDIPInfo, - BatsugunInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBatsugunb = { - "batsugunb", "batsugun", NULL, NULL, "1993", - "Batsugun (Korean PCB)\0", NULL, "Toaplan", "Dual Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, batsugunbRomInfo, batsugunbRomName, NULL, NULL, batsugunInputInfo, batsugunDIPInfo, - BatsugunbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_battleg.cpp b/jan/src/burn/drv/toaplan/d_battleg.cpp deleted file mode 100644 index dfb7568db..000000000 --- a/jan/src/burn/drv/toaplan/d_battleg.cpp +++ /dev/null @@ -1,1091 +0,0 @@ -// FB Alpha Battle Garegga driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -#include "nmk112.h" -// Battle Garegga - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static UINT8 nIRQPending; - -static INT32 nSoundCommand; - -// Z80 ROM bank -static INT32 nCurrentBank; - -INT32 Bgareggabl = 0; -static INT32 Bgareggabla = 0; - -// Rom information -static struct BurnRomInfo bgareggaRomDesc[] = { - { "prg0.bin", 0x080000, 0xF80C2FC2, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg1.bin", 0x080000, 0x2CCFDD1E, BRF_ESS | BRF_PRG }, // 1 (odd) - - { "rom4.bin", 0x200000, 0xB333D81F, BRF_GRA }, // 2 GP9001 Tile data - { "rom3.bin", 0x200000, 0x51B9EBFB, BRF_GRA }, // 3 - { "rom2.bin", 0x200000, 0xB330E5E2, BRF_GRA }, // 4 - { "rom1.bin", 0x200000, 0x7EAFDD70, BRF_GRA }, // 5 - - { "text.u81", 0x008000, 0xE67FD534, BRF_GRA }, // 6 Extra text layer tile data - - { "snd.bin", 0x020000, 0x68632952, BRF_ESS | BRF_PRG }, // 7 Z80 program - - { "rom5.bin", 0x100000, 0xF6D49863, BRF_SND }, // 8 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(bgaregga) -STD_ROM_FN(bgaregga) - -static struct BurnRomInfo bgareggazRomDesc[] = { - { "garegga-prg0.bin", 0x080000, 0x6F4AF466, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "garegga-prg1.bin", 0x080000, 0xB4DC9A48, BRF_ESS | BRF_PRG }, // 1 (odd) - - { "rom4.bin", 0x200000, 0xB333D81F, BRF_GRA }, // 2 GP9001 Tile data - { "rom3.bin", 0x200000, 0x51B9EBFB, BRF_GRA }, // 3 - { "rom2.bin", 0x200000, 0xB330E5E2, BRF_GRA }, // 4 - { "rom1.bin", 0x200000, 0x7EAFDD70, BRF_GRA }, // 5 - - { "text.u81", 0x008000, 0xE67FD534, BRF_GRA }, // 6 Extra text layer tile data - - { "snd.bin", 0x020000, 0x68632952, BRF_ESS | BRF_PRG }, // 7 Z80 program - - { "rom5.bin", 0x100000, 0xF6D49863, BRF_SND }, // 8 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(bgareggaz) -STD_ROM_FN(bgareggaz) - -static struct BurnRomInfo bgareghkRomDesc[] = { - { "prg_0.rom", 0x080000, 0x26E0019E, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg_1.rom", 0x080000, 0x2CCFDD1E, BRF_ESS | BRF_PRG }, // 1 (odd) - - { "rom4.bin", 0x200000, 0xB333D81F, BRF_GRA }, // 2 GP9001 Tile data - { "rom3.bin", 0x200000, 0x51B9EBFB, BRF_GRA }, // 3 - { "rom2.bin", 0x200000, 0xB330E5E2, BRF_GRA }, // 4 - { "rom1.bin", 0x200000, 0x7EAFDD70, BRF_GRA }, // 5 - - { "text.u81", 0x008000, 0xE67FD534, BRF_GRA }, // 6 Extra text layer tile data - - { "snd.bin", 0x020000, 0x68632952, BRF_ESS | BRF_PRG }, // 7 Z80 program - - { "rom5.bin", 0x100000, 0xF6D49863, BRF_SND }, // 8 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(bgareghk) -STD_ROM_FN(bgareghk) - -static struct BurnRomInfo bgaregnvRomDesc[] = { - { "prg_0.bin", 0x080000, 0x951ECC07, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg_1.bin", 0x080000, 0x729A60C6, BRF_ESS | BRF_PRG }, // 1 (odd) - - { "rom4.bin", 0x200000, 0xB333D81F, BRF_GRA }, // 2 GP9001 Tile data - { "rom3.bin", 0x200000, 0x51B9EBFB, BRF_GRA }, // 3 - { "rom2.bin", 0x200000, 0xB330E5E2, BRF_GRA }, // 4 - { "rom1.bin", 0x200000, 0x7EAFDD70, BRF_GRA }, // 5 - - { "text.u81", 0x008000, 0xE67FD534, BRF_GRA }, // 6 Extra text layer tile data - - { "snd.bin", 0x020000, 0x68632952, BRF_ESS | BRF_PRG }, // 7 Z80 program - - { "rom5.bin", 0x100000, 0xF6D49863, BRF_SND }, // 8 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(bgaregnv) -STD_ROM_FN(bgaregnv) - -static struct BurnRomInfo bgaregt2RomDesc[] = { - { "prg0", 0x080000, 0x84094099, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg1", 0x080000, 0x46f92fe4, BRF_ESS | BRF_PRG }, // 1 (odd) - - { "rom4.bin", 0x200000, 0xB333D81F, BRF_GRA }, // 2 GP9001 Tile data - { "rom3.bin", 0x200000, 0x51B9EBFB, BRF_GRA }, // 3 - { "rom2.bin", 0x200000, 0xB330E5E2, BRF_GRA }, // 4 - { "rom1.bin", 0x200000, 0x7EAFDD70, BRF_GRA }, // 5 - - { "text.u81", 0x008000, 0xE67FD534, BRF_GRA }, // 6 Extra text layer tile data - - { "snd.bin", 0x020000, 0x68632952, BRF_ESS | BRF_PRG }, // 7 Z80 program - - { "rom5.bin", 0x100000, 0xF6D49863, BRF_SND }, // 8 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(bgaregt2) -STD_ROM_FN(bgaregt2) - -static struct BurnRomInfo bgaregcnRomDesc[] = { - { "u123", 0x080000, 0x88A4E66A, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "u65", 0x080000, 0x5DEA32A3, BRF_ESS | BRF_PRG }, // 1 (odd) - - { "rom4.bin", 0x200000, 0xB333D81F, BRF_GRA }, // 2 GP9001 Tile data - { "rom3.bin", 0x200000, 0x51B9EBFB, BRF_GRA }, // 3 - { "rom2.bin", 0x200000, 0xB330E5E2, BRF_GRA }, // 4 - { "rom1.bin", 0x200000, 0x7EAFDD70, BRF_GRA }, // 5 - - { "text.u81", 0x008000, 0xE67FD534, BRF_GRA }, // 6 Extra text layer tile data - - { "snd.bin", 0x020000, 0x68632952, BRF_ESS | BRF_PRG }, // 7 Z80 program - - { "rom5.bin", 0x100000, 0xF6D49863, BRF_SND }, // 8 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(bgaregcn) -STD_ROM_FN(bgaregcn) - -static struct BurnRomInfo bgaregtwRomDesc[] = { - { "garegga_prg0.u123",0x080000, 0x235b7405, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "garegga_prg1.u65", 0x080000, 0xc29ccf6a, BRF_ESS | BRF_PRG }, // 1 (odd) - - { "rom4.bin", 0x200000, 0xB333D81F, BRF_GRA }, // 2 GP9001 Tile data - { "rom3.bin", 0x200000, 0x51B9EBFB, BRF_GRA }, // 3 - { "rom2.bin", 0x200000, 0xB330E5E2, BRF_GRA }, // 4 - { "rom1.bin", 0x200000, 0x7EAFDD70, BRF_GRA }, // 5 - - { "text.u81", 0x008000, 0xE67FD534, BRF_GRA }, // 6 Extra text layer tile data - - { "snd.bin", 0x020000, 0x68632952, BRF_ESS | BRF_PRG }, // 7 Z80 program - - { "rom5.bin", 0x100000, 0xF6D49863, BRF_SND }, // 8 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(bgaregtw) -STD_ROM_FN(bgaregtw) - - -static struct BurnRomInfo bgareggablRomDesc[] = { - { "xt-8m.bin", 0x100000, 0x4a6657cb, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "6#-322", 0x400000, 0x37fe48ed, BRF_GRA }, // 1 GP9001 Tile data // rom4.bin + rom3.bin - { "5#-322", 0x400000, 0x5a06c031, BRF_GRA }, // 2 // rom2.bin + rom1.bin - - { "1#-256", 0x008000, 0x760dcd14, BRF_GRA }, // 3 Extra text layer tile data - - { "snd.bin", 0x020000, 0x68632952, BRF_ESS | BRF_PRG }, // 4 Z80 program - - { "rom5.bin", 0x100000, 0xF6D49863, BRF_SND }, // 5 MSM6295 ADPCM data - - { "2#-256", 0x008000, 0x456dd16e, BRF_GRA }, // 6 (looks like garbage) -}; - - -STD_ROM_PICK(bgareggabl) -STD_ROM_FN(bgareggabl) - - -static struct BurnRomInfo bgareggablaRomDesc[] = { - { "27c8100.mon-sys", 0x100000, 0xD334E5AA, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "rom4.bin", 0x200000, 0xB333D81F, BRF_GRA }, // 1 GP9001 Tile data - { "rom3.bin", 0x200000, 0x51B9EBFB, BRF_GRA }, // 2 - { "rom2.bin", 0x200000, 0xB330E5E2, BRF_GRA }, // 3 - { "rom1.bin", 0x200000, 0x7EAFDD70, BRF_GRA }, // 4 - - { "text.bin", 0x008000, 0x00D100BD, BRF_GRA }, // 5 Extra text layer tile data - - { "snd.bin", 0x020000, 0x68632952, BRF_ESS | BRF_PRG }, // 6 Z80 program - - { "rom5.bin", 0x100000, 0xF6D49863, BRF_SND }, // 7 MSM6295 ADPCM data - - { "base.bin", 0x008000, 0x456dd16e, BRF_GRA }, // 8 (looks like garbage) -}; - - -STD_ROM_PICK(bgareggabla) -STD_ROM_FN(bgareggabla) - -static struct BurnInputInfo battlegInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(battleg) - -static struct BurnDIPInfo bgareggaDIPList[] = { - - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Test mode"}, - {0x14, 0x01, 0x01, 0x00, "Normal"}, - {0x14, 0x01, 0x01, 0x01, "Test"}, - {0, 0xFE, 0, 2, "Starting coin"}, - {0x14, 0x01, 0x02, 0x00, "1 credit"}, - {0x14, 0x01, 0x02, 0x02, "2 credits"}, - {0, 0xFE, 0, 8, "Coin 1"}, - {0x14, 0x01, 0x1C, 0x00, "1 coin 1 credit"}, - {0x14, 0x01, 0x1C, 0x04, "1 coin 2 credits"}, - {0x14, 0x01, 0x1C, 0x08, "1 coin 3 credits"}, - {0x14, 0x01, 0x1C, 0x0C, "1 coin 3 credits"}, - {0x14, 0x01, 0x1C, 0x10, "2 coins 1 credit"}, - {0x14, 0x01, 0x1C, 0x14, "3 coins 1 credit"}, - {0x14, 0x01, 0x1C, 0x18, "4 coins 1 credit"}, - {0x14, 0x01, 0x1C, 0x1C, "Free Play"}, - // 0x1C: Free play settings active - // Normal - {0, 0xFE, 0, 7, "Coin 2"}, - {0x14, 0x82, 0xE0, 0x00, "1 coin 1 credit"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x82, 0xE0, 0x20, "1 coin 2 credits"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x82, 0xE0, 0x40, "1 coin 3 credits"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x82, 0xE0, 0x60, "1 coin 3 credits"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x82, 0xE0, 0x80, "2 coins 1 credit"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x82, 0xE0, 0xA0, "3 coins 1 credit"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x82, 0xE0, 0xC0, "4 coins 1 credit"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x82, 0xE0, 0x04, "1 coin 1 credit"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - // Free play - {0, 0xFE, 0, 2, "Stick mode"}, - {0x14, 0x02, 0x20, 0x00, "Special"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x02, 0x20, 0x20, "Normal"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0, 0xFE, 0, 2, "Effect"}, - {0x14, 0x02, 0x40, 0x00, "Off"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x02, 0x40, 0x40, "On"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0, 0xFE, 0, 2, "Music"}, - {0x14, 0x02, 0x80, 0x00, "Off"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - {0x14, 0x02, 0x80, 0x80, "On"}, - {0x14, 0x00, 0x1C, 0x1C, NULL}, - - // DIP 2 - {0, 0xFE, 0, 4, "Difficulty"}, - {0x15, 0x01, 0x03, 0x00, "Normal"}, - {0x15, 0x01, 0x03, 0x01, "Easy"}, - {0x15, 0x01, 0x03, 0x02, "Hard"}, - {0x15, 0x01, 0x03, 0x03, "Very hard"}, - {0, 0xFE, 0, 2, "Screen flip"}, - {0x15, 0x01, 0x04, 0x00, "Off"}, - {0x15, 0x01, 0x04, 0x04, "On"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x15, 0x01, 0x08, 0x00, "On"}, - {0x15, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 8, "Player counts"}, - {0x15, 0x01, 0x70, 0x00, "3"}, - {0x15, 0x01, 0x70, 0x10, "4"}, - {0x15, 0x01, 0x70, 0x20, "2"}, - {0x15, 0x01, 0x70, 0x30, "1"}, - {0x15, 0x01, 0x70, 0x40, "5"}, - {0x15, 0x01, 0x70, 0x50, "6"}, - {0x15, 0x01, 0x70, 0x60, "Multiple"}, - {0x15, 0x01, 0x70, 0x70, "Invincible"}, - // Nippon and U.S.A. regions - {0, 0xFE, 0, 2, "Extra player"}, - {0x15, 0x02, 0x80, 0x00, "1000000 each"}, - {0x16, 0x00, 0x01, 0x00, NULL}, - {0x15, 0x02, 0x80, 0x80, "1000000 2000000"}, - {0x16, 0x00, 0x01, 0x00, NULL}, - // Europe/Denmark and Asia regions - {0, 0xFE, 0, 2, "Extra player"}, - {0x15, 0x02, 0x80, 0x80, "2000000 each"}, - {0x16, 0x00, 0x01, 0x01, NULL}, - {0x15, 0x02, 0x80, 0x00, "No extra"}, - {0x16, 0x00, 0x01, 0x01, NULL}, - - // DIP 3 - {0, 0xFE, 0, 2, "Continue play"}, - {0x16, 0x01, 0x04, 0x00, "On"}, - {0x16, 0x01, 0x04, 0x04, "Off"}, -}; - -static struct BurnDIPInfo bgaregcnRegionDIPList[] = { - // DIP 3 - {0, 0xFE, 0, 2, "Stage edit"}, - {0x16, 0x01, 0x08, 0x00, "Disable"}, - {0x16, 0x01, 0x08, 0x08, "Enable"}, - - // Region - {0x16, 0xFF, 0x0F, 0x01, NULL}, - {0, 0xFE, 0, 2, "Region"}, - {0x16, 0x01, 0x03, 0x01, "Denmark (German Tuning license)"}, - {0x16, 0x01, 0x03, 0x03, "China"}, - {0x16, 0x01, 0x03, 0x00, "Japan [illegal setting]"}, - {0x16, 0x01, 0x03, 0x02, "U.S.A. (Fabtek license) [illegal setting]"}, -}; - -static struct BurnDIPInfo bgareggaRegionDIPList[] = { - // DIP 3 - {0, 0xFE, 0, 2, "Stage edit"}, - {0x16, 0x01, 0x08, 0x00, "Disable"}, - {0x16, 0x01, 0x08, 0x08, "Enable"}, - - // Region - {0x16, 0xFF, 0x0F, 0x00, NULL}, - {0, 0xFE, 0, 4, "Region"}, - {0x16, 0x01, 0x03, 0x00, "Japan"}, - {0x16, 0x01, 0x03, 0x01, "Europe (German Tuning license"}, - {0x16, 0x01, 0x03, 0x02, "U.S.A. (Fabtek license)"}, - {0x16, 0x01, 0x03, 0x03, "Asia"}, -}; - -static struct BurnDIPInfo bgareghkRegionDIPList[] = { - // DIP 3 - {0, 0xFE, 0, 2, "Stage edit"}, - {0x16, 0x01, 0x08, 0x00, "Disable"}, - {0x16, 0x01, 0x08, 0x08, "Enable"}, - - // Region - {0x16, 0xFF, 0x0F, 0x01, NULL}, - {0, 0xFE, 0, 2, "Region"}, - {0x16, 0x01, 0x03, 0x01, "Austria (German Tuning license"}, - {0x16, 0x01, 0x03, 0x03, "Hong Kong (metrotainment license"}, - {0x16, 0x01, 0x03, 0x00, "Japan [illegal setting]"}, - {0x16, 0x01, 0x03, 0x02, "U.S.A. (Fabtek license) [illegal setting]"}, -}; - -static struct BurnDIPInfo bgaregtwRegionDIPList[] = { - // DIP 3 - {0, 0xFE, 0, 2, "Stage edit"}, - {0x16, 0x01, 0x08, 0x00, "Disable"}, - {0x16, 0x01, 0x08, 0x08, "Enable"}, - - // Region - {0x16, 0xFF, 0x0F, 0x01, NULL}, - {0, 0xFE, 0, 2, "Region"}, - {0x16, 0x01, 0x03, 0x01, "Germany (German Tuning license)"}, - {0x16, 0x01, 0x03, 0x03, "Taiwan (Liang Hwa license)"}, - {0x16, 0x01, 0x03, 0x00, "Japan [illegal setting]"}, - {0x16, 0x01, 0x03, 0x02, "U.S.A. (Fabtek license) [illegal setting]"}, -}; - -STDDIPINFOEXT(bgaregga, bgaregga, bgareggaRegion) -STDDIPINFOEXT(bgaregcn, bgaregga, bgaregcnRegion) -STDDIPINFOEXT(bgareghk, bgaregga, bgareghkRegion) -STDDIPINFOEXT(bgaregtw, bgaregga, bgaregtwRegion) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *Ram02, *RamPal; - -static INT32 nColCount = 0x0800; -static INT32 nMSM6295ROMSize = 0x100000; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // - RomZ80 = Next; Next += 0x020000; // Z80 ROM - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - ExtraTROM = Next; Next += 0x010000; // Extra Text layer tile data - MSM6295ROM = Next; Next += nMSM6295ROMSize; // ADPCM data - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - Ram02 = Next; Next += 0x000800; // - ExtraTRAM = Next; Next += 0x002000; // Extra tile layer - ExtraTScroll= Next; Next += 0x001000; // - ExtraTSelect= Next; Next += 0x001000; // - RamPal = Next; Next += 0x001000; // palette - RamZ80 = Next; Next += 0x004000; // Z80 RAM - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static void drvZ80Bankswitch(INT32 nBank) -{ - nBank &= 0x07; - if (nBank != nCurrentBank) { - UINT8* nStartAddress = RomZ80 + (nBank << 14); - ZetMapArea(0x8000, 0xBFFF, 0, nStartAddress); - ZetMapArea(0x8000, 0xBFFF, 2, nStartAddress); - - nCurrentBank = nBank; - } -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029497; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile data - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - ZetScan(nAction); // Scan Z80 - SCAN_VAR(nCurrentBank); - - MSM6295Scan(0, nAction); - BurnYM2151Scan(nAction); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(DrvInput); - SCAN_VAR(nSoundCommand); - SCAN_VAR(nIRQPending); - - if (nAction & ACB_WRITE) { - INT32 nBank = nCurrentBank; - nCurrentBank = -1; - ZetOpen(0); - drvZ80Bankswitch(nBank); - ZetClose(); - } - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - if (ToaLoadCode(Rom01, 0, 2)) { - return 1; - } - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 2, 4, nGP9001ROMSize[0]); - - // Load Extra text layer tile data - BurnLoadRom(ExtraTROM, 6, 1); - - // Load the Z80 ROM - BurnLoadRom(RomZ80, 7, 1); - - // Load ADPCM data - BurnLoadRom(MSM6295ROM, 8, 1); - - return 0; -} - -static INT32 LoadRomsBl() -{ - // Load 68000 ROM - if (BurnLoadRom(Rom01, 0, 1)) { - return 1; - } - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 2, nGP9001ROMSize[0]); - - // Load Extra text layer tile data - BurnLoadRom(ExtraTROM, 3, 1); - - // Load the Z80 ROM - BurnLoadRom(RomZ80, 4, 1); - - // Load ADPCM data - BurnLoadRom(MSM6295ROM, 5, 1); - - return 0; -} - -static INT32 LoadRomsBla() -{ - // Load 68000 ROM - if (BurnLoadRom(Rom01, 0, 1)) { - return 1; - } - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 4, nGP9001ROMSize[0]); - - // Load Extra text layer tile data - BurnLoadRom(ExtraTROM, 5, 1); - - // Load the Z80 ROM - BurnLoadRom(RomZ80, 6, 1); - - // Load ADPCM data - BurnLoadRom(MSM6295ROM, 7, 1); - - return 0; -} - -UINT8 __fastcall battlegZ80Read(UINT16 nAddress) -{ -// bprintf(0, _T("z80 read %4X\n"), nAddress); - switch (nAddress) { - case 0xE001: - return BurnYM2151ReadStatus(); - - case 0xE004: - return MSM6295ReadStatus(0); - - case 0xE01C: - return nSoundCommand; - - case 0xE01D: - // Bit 0 enables/disables interrupt processing (0 = enabled) - return 0; - } - return 0; -} - -void __fastcall battlegZ80Write(UINT16 nAddress, UINT8 nValue) -{ -// bprintf(0, _T("z80 wrote %4X with %2X\n"), nAddress, nValue); - switch (nAddress) { - case 0xE000: - BurnYM2151SelectRegister(nValue); - break; - case 0xE001: - BurnYM2151WriteRegister(nValue); - break; - - case 0xE004: - MSM6295Command(0, nValue); - break; - - case 0xE006: - case 0xE008: - NMK112_okibank_write((nAddress - 0xe006) + 0, nValue & 0xf); - NMK112_okibank_write((nAddress - 0xe006) + 1, nValue >> 4); - break; - - case 0xE00A: { - drvZ80Bankswitch(nValue); - break; - } - - case 0xE00C: - // Once a sound command is processed, it is written to this address - // bprintf(0, _T("z80 wrote %4X -> %2X\n"), nAddress, nValue); - break; - - } -} - -static INT32 DrvZ80Init() -{ - ZetInit(0); - ZetOpen(0); - - ZetSetReadHandler(battlegZ80Read); - ZetSetWriteHandler(battlegZ80Write); - - // ROM bank 1 - ZetMapArea (0x0000, 0x7FFF, 0, RomZ80 + 0x0000); // Direct Read from ROM - ZetMapArea (0x0000, 0x7FFF, 2, RomZ80 + 0x0000); // Direct Fetch from ROM - // ROM bank 2 - ZetMapArea (0x8000, 0xBFFF, 0, RomZ80 + 0x8000); // Direct Read from ROM - ZetMapArea (0x8000, 0xBFFF, 2, RomZ80 + 0x8000); // Direct Fetch from ROM - // RAM - ZetMapArea (0xC000, 0xDFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0xC000, 0xDFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0xC000, 0xDFFF, 2, RamZ80); // - // Ports - ZetMemCallback(0xE000, 0xE0FF, 0); // Read - ZetMemCallback(0xE000, 0xE0FF, 1); // Write - - ZetClose(); - - nCurrentBank = 2; - - return 0; -} - -UINT8 __fastcall battlegReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x218021: // The 68K has access to the Z80 RAM - return RamZ80[0x10]; // Only these addresses are used, however - case 0x218023: // - return RamZ80[0x11]; // - - case 0x21C021: // Player 1 inputs - return DrvInput[0]; - case 0x21C025: // Player 2 inputs - return DrvInput[1]; - case 0x21C029: // Other inputs - return DrvInput[2]; - case 0x21C02D: // Dipswitch A - return DrvInput[3]; - case 0x21C031: // Dipswitch B - return DrvInput[4]; - case 0x21C035: // Dipswitch C - Territory - return DrvInput[5]; - -// default: -// bprintf(0, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -UINT16 __fastcall battlegReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x21C03C: - return ToaScanlineRegister(); - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - -// default: -// bprintf(0, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall battlegWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - case 0x218021: // The 68K has access to the Z80 RAM - RamZ80[0x10] = byteValue; // Only these addresses are used, however - break; - - case 0x21C01D: // Coin control - break; - - case 0x600001: - nSoundCommand = byteValue; - - // Trigger Z80 interrupt, and allow the Z80 to process it - ZetSetIRQLine(0xff, CPU_IRQSTATUS_AUTO); - nCyclesDone[1] += ZetRun(0x0200); - break; - -// default: -// bprintf(0, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall battlegWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: { - ToaGP9001WriteRegister(wordValue); - break; - } - -// default: -// bprintf(0, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - nIRQPending = 0; - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - NMK112Reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 battlegInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x800000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (Bgareggabla) { - if (LoadRomsBla()) { - return 1; - } - } else { - if (Bgareggabl) { - if (LoadRomsBl()) { - return 1; - } - } else { - if (LoadRoms()) { - return 1; - } - } - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); // Palette RAM - SekMapMemory(Ram02, 0x401000, 0x4017FF, MAP_RAM); // Unused - SekMapMemory(ExtraTRAM, 0x500000, 0x501FFF, MAP_RAM); - SekMapMemory(ExtraTSelect, 0x502000, 0x502FFF, MAP_RAM); // 0x502000 - Scroll; 0x502200 - RAM - SekMapMemory(ExtraTScroll, 0x503000, 0x503FFF, MAP_RAM); // 0x203000 - Offset; 0x503200 - RAM - - SekSetReadWordHandler(0, battlegReadWord); - SekSetReadByteHandler(0, battlegReadByte); - SekSetWriteWordHandler(0, battlegWriteWord); - SekSetWriteByteHandler(0, battlegWriteByte); - - SekClose(); - } - - nSpriteXOffset = 0x0024; - nSpriteYOffset = 0x0001; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(); - - nExtraTXOffset = 0x2C; - ToaExtraTextInit(); - - if (Bgareggabl) nExtraTXOffset = 0; - - DrvZ80Init(); // Initialize Z80 - - BurnYM2151Init(32000000 / 8); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 32000000 / 16 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - NMK112_init(0, MSM6295ROM, NULL, 0x100000, 0); // only 1 - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - bDrawScreen = true; - - // mar 2 1996 & apr 2 1996 ver: 0x0009AC - 0x0009B8 & 0x001F5E - 0x001F64 & 0x003A1C - 0x003A22 - // feb 2 1996 ver: 0x0009AC - 0x0009B8 & 0x001F2E - 0x001F34 & 0x0039EC - 0x0039F2 - - DrvDoReset(); // Reset machine - - return 0; -} - -static INT32 BgareggablInit() -{ - Bgareggabl = 1; - - return battlegInit(); -} - -static INT32 BgareggablaInit() -{ - Bgareggabl = 1; - Bgareggabla = 1; - - return battlegInit(); -} - -static INT32 DrvExit() -{ - MSM6295Exit(0); - BurnYM2151Exit(); - - ToaPalExit(); - ToaExitGP9001(); - ToaExtraTextExit(); - ToaZExit(); // Z80 exit - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - Bgareggabl = 0; - Bgareggabla = 0; - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - ToaExtraTextLayer(); // Render extra text layer - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = TOA_Z80_SPEED / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); // 0 - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - ZetOpen(0); - for (INT32 i = 1; i <= nInterleave; i++) { - // Run 68000 - INT32 nCurrentCPU = 0; - INT32 nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - nIRQPending = 1; - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - ToaBufferGP9001Sprites(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - bVBlank = true; - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - nIRQPending = 0; - - // Run Z80 - nCurrentCPU = 1; - nNext = i * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = (nBurnSoundLen * i / nInterleave) - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - SekClose(); - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - } - - ZetClose(); - - return 0; -} - -struct BurnDriver BurnDrvBgaregga = { - "bgaregga", NULL, NULL, NULL, "1996", - "Battle Garegga (Europe / USA / Japan / Asia) (Sat Feb 3 1996)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bgareggaRomInfo, bgareggaRomName, NULL, NULL, battlegInputInfo, bgareggaDIPInfo, - battlegInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBgareggaz = { - "bgareggaz", "bgaregga", NULL, NULL, "2008", - "Battle Garegga Zakk version (Europe / USA / Japan / Asia) (Sat Feb 3 1996)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bgareggazRomInfo, bgareggazRomName, NULL, NULL, battlegInputInfo, bgareggaDIPInfo, - battlegInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBgaregcn = { - "bgareggacn", "bgaregga", NULL, NULL, "1996", - "Battle Garegga - Type 2 (Denmark / China) (Tue Apr 2 1996)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bgaregcnRomInfo, bgaregcnRomName, NULL, NULL, battlegInputInfo, bgaregcnDIPInfo, - battlegInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBgaregt2 = { - "bgareggat2", "bgaregga", NULL, NULL, "1996", - "Battle Garegga - Type 2 (Europe / USA / Japan / Asia) (Sat Mar 2 1996)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bgaregt2RomInfo, bgaregt2RomName, NULL, NULL, battlegInputInfo, bgareggaDIPInfo, - battlegInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBgaregnv = { - "bgaregganv", "bgaregga", NULL, NULL, "1996", - "Battle Garegga - New Version (Austria / Hong Kong) (Sat Mar 2 1996)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bgaregnvRomInfo, bgaregnvRomName, NULL, NULL, battlegInputInfo, bgareghkDIPInfo, - battlegInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBgareghk = { - "bgareggahk", "bgaregga", NULL, NULL, "1996", - "Battle Garegga (Austria / Hong Kong) (Sat Feb 3 1996)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bgareghkRomInfo, bgareghkRomName, NULL, NULL, battlegInputInfo, bgareghkDIPInfo, - battlegInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBgaregtw = { - "bgareggatw", "bgaregga", NULL, NULL, "1996", - "Battle Garegga (Taiwan / Germany) (Thu Feb 1 1996)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bgaregtwRomInfo, bgaregtwRomName, NULL, NULL, battlegInputInfo, bgaregtwDIPInfo, - battlegInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBgareggabl = { - "bgareggabl", "bgaregga", NULL, NULL, "1996", - "1945 Part 2 (Chinese hack of Battle Garegga)\0", NULL, "hack", "Toaplan GP9001 based", - L"1945 Part 2\0\uFF11\uFF19\uFF14\uFF15\u4E8C\u4EE3 (Chinese hack of Battle Garegga)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HACK | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bgareggablRomInfo, bgareggablRomName, NULL, NULL, battlegInputInfo, bgareggaDIPInfo, - BgareggablInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBgareggabla = { - "bgareggabla", "bgaregga", NULL, NULL, "1996", - "Lei Shen Zhuan Thunder Deity Biography (Chinese hack of Battle Garegga)\0", NULL, "hack", "Toaplan GP9001 based", - L"\u96F7\u795E\u50B3\0Lei Shen Zhuan Thunder Deity Biography (Chinese hack of Battle Garegga)\0" , NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HACK | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bgareggablaRomInfo, bgareggablaRomName, NULL, NULL, battlegInputInfo, bgareggaDIPInfo, - BgareggablaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_bbakraid.cpp b/jan/src/burn/drv/toaplan/d_bbakraid.cpp deleted file mode 100644 index e87adee49..000000000 --- a/jan/src/burn/drv/toaplan/d_bbakraid.cpp +++ /dev/null @@ -1,1125 +0,0 @@ -// FB Alpha Battle Bakraid driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -#include "ymz280b.h" -#include "eeprom.h" -#include "timer.h" - -// Battle Bakraid. - -// #define ADJUST_Z80_SPEED - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 *DefaultEEPROM = NULL; - -static UINT8 DrvRegion = 0; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static UINT8 nIRQPending; - -static INT32 nSoundData[4]; -static UINT8 nSoundlatchAck; - -static INT32 Z80BusRQ = 0; - -static INT32 nCycles68KSync; - -static INT32 nTextROMStatus; - -#ifdef BUILD_A68K -static bool bUseAsm68KCoreOldValue = false; -#endif - -// Rom information -static struct BurnRomInfo bkraiduRomDesc[] = { - { "prg0u022_usa.bin", 0x080000, 0x95fb2ffd, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2u021.bin", 0x080000, 0xffba8656, BRF_ESS | BRF_PRG }, // 1 - { "prg1u023.new", 0x080000, 0x4ae9aa64, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3u024.bin", 0x080000, 0x834b8ad6, BRF_ESS | BRF_PRG }, // 3 - - { "gfxu0510.bin", 0x400000, 0x9cca3446, BRF_GRA }, // 4 GP9001 Tile data - { "gfxu0512.bin", 0x400000, 0xa2a281d5, BRF_GRA }, // 5 - { "gfxu0511.bin", 0x400000, 0xe16472c0, BRF_GRA }, // 6 - { "gfxu0513.bin", 0x400000, 0x8bb635a0, BRF_GRA }, // 7 - - { "sndu0720.bin", 0x020000, 0xe62ab246, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom6.829", 0x400000, 0x8848b4a0, BRF_SND }, // 9 YMZ280B (AD)PCM data - { "rom7.830", 0x400000, 0xd6224267, BRF_SND }, // 10 - { "rom8.831", 0x400000, 0xa101dfb0, BRF_SND }, // 11 - - { "eeprom-bbakraid-new.bin", 0x00200, 0x35c9275a, BRF_PRG }, -}; - - -STD_ROM_PICK(bkraidu) -STD_ROM_FN(bkraidu) - -static struct BurnRomInfo bkraidjRomDesc[] = { - { "prg0u022.bin", 0x080000, 0x0dd59512, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2u021.bin", 0x080000, 0xffba8656, BRF_ESS | BRF_PRG }, // 1 - { "prg1u023.bin", 0x080000, 0xfecde223, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3u024.bin", 0x080000, 0x834b8ad6, BRF_ESS | BRF_PRG }, // 3 - - { "gfxu0510.bin", 0x400000, 0x9cca3446, BRF_GRA }, // 4 GP9001 Tile data - { "gfxu0512.bin", 0x400000, 0xa2a281d5, BRF_GRA }, // 5 - { "gfxu0511.bin", 0x400000, 0xe16472c0, BRF_GRA }, // 6 - { "gfxu0513.bin", 0x400000, 0x8bb635a0, BRF_GRA }, // 7 - - { "sndu0720.bin", 0x020000, 0xe62ab246, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom6.829", 0x400000, 0x8848b4a0, BRF_SND }, // 9 YMZ280B (AD)PCM data - { "rom7.830", 0x400000, 0xd6224267, BRF_SND }, // 10 - { "rom8.831", 0x400000, 0xa101dfb0, BRF_SND }, // 11 - - { "eeprom-bbakraid.bin", 0x00200, 0x7f97d347, BRF_PRG }, -}; - - -STD_ROM_PICK(bkraidj) -STD_ROM_FN(bkraidj) - -static struct BurnRomInfo bkraidcRomDesc[] = { - { "prg0u022_china.bin", 0x080000, 0x760be084, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2u021.bin", 0x080000, 0xffba8656, BRF_ESS | BRF_PRG }, // 1 - { "prg1u023.new", 0x080000, 0x4ae9aa64, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3u024.bin", 0x080000, 0x834b8ad6, BRF_ESS | BRF_PRG }, // 3 - - { "gfxu0510.bin", 0x400000, 0x9cca3446, BRF_GRA }, // 4 GP9001 Tile data - { "gfxu0512.bin", 0x400000, 0xa2a281d5, BRF_GRA }, // 5 - { "gfxu0511.bin", 0x400000, 0xe16472c0, BRF_GRA }, // 6 - { "gfxu0513.bin", 0x400000, 0x8bb635a0, BRF_GRA }, // 7 - - { "sndu0720.bin", 0x020000, 0xe62ab246, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom6.829", 0x400000, 0x8848b4a0, BRF_SND }, // 9 YMZ280B (AD)PCM data - { "rom7.830", 0x400000, 0xd6224267, BRF_SND }, // 10 - { "rom8.831", 0x400000, 0xa101dfb0, BRF_SND }, // 11 - - { "eeprom-bbakraid-new.bin", 0x00200, 0x35c9275a, BRF_PRG }, -}; - - -STD_ROM_PICK(bkraidc) -STD_ROM_FN(bkraidc) - -static struct BurnRomInfo bkraidujRomDesc[] = { - { "prg0u022.new", 0x080000, 0xfa8d38d3, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "prg2u021.bin", 0x080000, 0xffba8656, BRF_ESS | BRF_PRG }, // 1 - { "prg1u023.new", 0x080000, 0x4ae9aa64, BRF_ESS | BRF_PRG }, // 2 (odd) - { "prg3u024.bin", 0x080000, 0x834b8ad6, BRF_ESS | BRF_PRG }, // 3 - - { "gfxu0510.bin", 0x400000, 0x9cca3446, BRF_GRA }, // 4 GP9001 Tile data - { "gfxu0512.bin", 0x400000, 0xa2a281d5, BRF_GRA }, // 5 - { "gfxu0511.bin", 0x400000, 0xe16472c0, BRF_GRA }, // 6 - { "gfxu0513.bin", 0x400000, 0x8bb635a0, BRF_GRA }, // 7 - - { "sndu0720.bin", 0x020000, 0xe62ab246, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "rom6.829", 0x400000, 0x8848b4a0, BRF_SND }, // 9 YMZ280B (AD)PCM data - { "rom7.830", 0x400000, 0xd6224267, BRF_SND }, // 10 - { "rom8.831", 0x400000, 0xa101dfb0, BRF_SND }, // 11 - - { "eeprom-bbakraid-new.bin", 0x00200, 0x35c9275a, BRF_PRG }, -}; - - -STD_ROM_PICK(bkraiduj) -STD_ROM_FN(bkraiduj) - -static struct BurnInputInfo bbakraidInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Shoot 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Shoot 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Shoot 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Shoot 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Shoot 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Shoot 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Test", BIT_DIGITAL, DrvButton + 2, "diag"}, - {"Service", BIT_DIGITAL, DrvButton + 0, "service"}, - {"Dip 1", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip 2", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip 3", BIT_DIPSWITCH, DrvInput + 5, "dip"}, - {"Region", BIT_DIPSWITCH, &DrvRegion , "dip"}, -}; - -STDINPUTINFO(bbakraid) - -static struct BurnDIPInfo bbakraidDIPList[] = { - - // Defaults - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x00, NULL}, - {0x17, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Test mode"}, - {0x15, 0x01, 0x01, 0x00, "Normal"}, - {0x15, 0x01, 0x01, 0x01, "Test"}, - // Normal - {0, 0xFE, 0, 2, "Starting coin"}, - {0x15, 0x82, 0x02, 0x00, "1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0x02, 0x02, "2 credits"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - // Free play - {0, 0xFE, 0, 2, "Stick mode"}, - {0x15, 0x02, 0x02, 0x00, "Normal"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x02, 0x02, 0x02, "Special"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - // Normal - {0, 0xFE, 0, 8, "Coin 1"}, - {0x15, 0x01, 0x1C, 0x00, "1 coin 1 credit"}, - {0x15, 0x01, 0x1C, 0x04, "1 coin 2 credits"}, - {0x15, 0x01, 0x1C, 0x08, "1 coin 3 credits"}, - {0x15, 0x01, 0x1C, 0x0C, "1 coin 4 credits"}, - {0x15, 0x01, 0x1C, 0x10, "2 coins 1 credit"}, - {0x15, 0x01, 0x1C, 0x14, "3 coins 1 credit"}, - {0x15, 0x01, 0x1C, 0x18, "4 coins 1 credit"}, - {0x15, 0x01, 0x1C, 0x1C, "Free Play"}, - // 0x1C: Free play settings active - // Normal - {0, 0xFE, 0, 7, "Coin 2"}, - {0x15, 0x82, 0xE0, 0x00, "1 coin 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0x20, "1 coin 2 credits"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0x40, "1 coin 3 credits"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0x60, "1 coin 4 credits"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0x80, "2 coins 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0xA0, "3 coins 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0xC0, "4 coins 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x82, 0xE0, 0x04, "1 coin 1 credit"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - // Free play - {0, 0xFE, 0, 2, "Hit score"}, - {0x15, 0x02, 0x20, 0x00, "Off"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x02, 0x20, 0x20, "On"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0, 0xFE, 0, 2, "Sound effect"}, - {0x15, 0x02, 0x40, 0x00, "Off"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x02, 0x40, 0x40, "On"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0, 0xFE, 0, 2, "Music"}, - {0x15, 0x02, 0x80, 0x00, "Off"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - {0x15, 0x02, 0x80, 0x80, "On"}, - {0x15, 0x00, 0x1C, 0x1C, NULL}, - - // DIP 2 - {0, 0xFE, 0, 4, "Start rank"}, - {0x16, 0x01, 0x03, 0x00, "Normal"}, - {0x16, 0x01, 0x03, 0x01, "Easy"}, - {0x16, 0x01, 0x03, 0x02, "Hard"}, - {0x16, 0x01, 0x03, 0x03, "Very hard"}, - {0, 0xFE, 0, 4, "Timer rank"}, - {0x16, 0x01, 0x0C, 0x00, "Normal"}, - {0x16, 0x01, 0x0C, 0x04, "Low"}, - {0x16, 0x01, 0x0C, 0x08, "High"}, - {0x16, 0x01, 0x0C, 0x0C, "Highest"}, - {0, 0xFE, 0, 4, "Player counts"}, - {0x16, 0x01, 0x30, 0x00, "3"}, - {0x16, 0x01, 0x30, 0x10, "4"}, - {0x16, 0x01, 0x30, 0x20, "2"}, - {0x16, 0x01, 0x30, 0x30, "1"}, - {0, 0xFE, 0, 4, "Extra player"}, - {0x16, 0x01, 0xC0, 0x00, "2000000 each"}, - {0x16, 0x01, 0xC0, 0x40, "3000000 each"}, - {0x16, 0x01, 0xC0, 0x80, "4000000 each"}, - {0x16, 0x01, 0xC0, 0xC0, "No extra player"}, - - // DIP 3 - {0, 0xFE, 0, 2, "Screen flip"}, - {0x17, 0x01, 0x01, 0x00, "Off"}, - {0x17, 0x01, 0x01, 0x01, "On"}, - {0, 0xFE, 0, 2, "Demo sound"}, - {0x17, 0x01, 0x02, 0x00, "On"}, - {0x17, 0x01, 0x02, 0x02, "Off"}, - {0, 0xFE, 0, 2, "Stage edit"}, - {0x17, 0x01, 0x04, 0x00, "Disable"}, - {0x17, 0x01, 0x04, 0x04, "Enable"}, - {0, 0xFE, 0, 2, "Continue play"}, - {0x17, 0x01, 0x08, 0x00, "Enable"}, - {0x17, 0x01, 0x08, 0x08, "Disable"}, - {0, 0xFE, 0, 2, "Invincible"}, - {0x17, 0x01, 0x10, 0x00, "Off"}, - {0x17, 0x01, 0x10, 0x10, "On"}, - {0, 0xFE, 0, 2, "Score ranking"}, - {0x17, 0x01, 0x20, 0x00, "Save"}, - {0x17, 0x01, 0x20, 0x20, "No save"}, -}; - -static struct BurnDIPInfo bbakraidRegionDIPList[] = { - - // Region - {0x18, 0xFF, 0xFF, 0x00, NULL}, - {0, 0xFD, 0, 26, "Region"}, - {0x18, 0x01, 0x1F, 0x00, "Nippon"}, - {0x18, 0x01, 0x1F, 0x01, "U.S.A."}, - {0x18, 0x01, 0x1F, 0x02, "Europe"}, - {0x18, 0x01, 0x1F, 0x03, "Asia"}, - {0x18, 0x01, 0x1F, 0x04, "German"}, - {0x18, 0x01, 0x1F, 0x05, "Austria"}, - {0x18, 0x01, 0x1F, 0x06, "Belgium"}, - {0x18, 0x01, 0x1F, 0x07, "Denmark"}, - {0x18, 0x01, 0x1F, 0x08, "Finland"}, - {0x18, 0x01, 0x1F, 0x09, "France"}, - {0x18, 0x01, 0x1F, 0x0A, "Great Britain"}, - {0x18, 0x01, 0x1F, 0x0B, "Greece"}, - {0x18, 0x01, 0x1F, 0x0C, "Holland"}, - {0x18, 0x01, 0x1F, 0x0D, "Italy"}, - {0x18, 0x01, 0x1F, 0x0E, "Norway"}, - {0x18, 0x01, 0x1F, 0x0F, "Portugal"}, - {0x18, 0x01, 0x1F, 0x10, "Spain"}, - {0x18, 0x01, 0x1F, 0x11, "Sweden"}, - {0x18, 0x01, 0x1F, 0x12, "Switzerland"}, - {0x18, 0x01, 0x1F, 0x13, "Australia"}, - {0x18, 0x01, 0x1F, 0x14, "New Zealand"}, - {0x18, 0x01, 0x1F, 0x15, "Taiwan"}, - {0x18, 0x01, 0x1F, 0x16, "HongKong"}, - {0x18, 0x01, 0x1F, 0x17, "Korea"}, - {0x18, 0x01, 0x1F, 0x18, "China"}, - {0x18, 0x01, 0x1F, 0x19, "World"}, -}; - -STDDIPINFOEXT(bbakraid, bbakraid, bbakraidRegion) - -static struct BurnDIPInfo bkraiduRegionDIPList[] = { - - // Region - {0x18, 0xFF, 0xFF, 0x01, NULL}, - {0, 0xFD, 0, 26, "Region"}, - {0x18, 0x01, 0x1F, 0x00, "Nippon"}, - {0x18, 0x01, 0x1F, 0x01, "U.S.A."}, - {0x18, 0x01, 0x1F, 0x02, "Europe"}, - {0x18, 0x01, 0x1F, 0x03, "Asia"}, - {0x18, 0x01, 0x1F, 0x04, "German"}, - {0x18, 0x01, 0x1F, 0x05, "Austria"}, - {0x18, 0x01, 0x1F, 0x06, "Belgium"}, - {0x18, 0x01, 0x1F, 0x07, "Denmark"}, - {0x18, 0x01, 0x1F, 0x08, "Finland"}, - {0x18, 0x01, 0x1F, 0x09, "France"}, - {0x18, 0x01, 0x1F, 0x0A, "Great Britain"}, - {0x18, 0x01, 0x1F, 0x0B, "Greece"}, - {0x18, 0x01, 0x1F, 0x0C, "Holland"}, - {0x18, 0x01, 0x1F, 0x0D, "Italy"}, - {0x18, 0x01, 0x1F, 0x0E, "Norway"}, - {0x18, 0x01, 0x1F, 0x0F, "Portugal"}, - {0x18, 0x01, 0x1F, 0x10, "Spain"}, - {0x18, 0x01, 0x1F, 0x11, "Sweden"}, - {0x18, 0x01, 0x1F, 0x12, "Switzerland"}, - {0x18, 0x01, 0x1F, 0x13, "Australia"}, - {0x18, 0x01, 0x1F, 0x14, "New Zealand"}, - {0x18, 0x01, 0x1F, 0x15, "Taiwan"}, - {0x18, 0x01, 0x1F, 0x16, "HongKong"}, - {0x18, 0x01, 0x1F, 0x17, "Korea"}, - {0x18, 0x01, 0x1F, 0x18, "China"}, - {0x18, 0x01, 0x1F, 0x19, "World"}, -}; - -STDDIPINFOEXT(bkraidu, bbakraid, bkraiduRegion) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *Ram02, *RamPal; - -static INT32 nColCount = 0x0800; - -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x200000; // - RomZ80 = Next; Next += 0x020000; // Z80 ROM - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - YMZ280BROM = Next; Next += 0xC00000; - DefaultEEPROM = Next; Next += 0x000200; - - RamStart = Next; - ExtraTROM = Next; Next += 0x008000; // Extra Text layer tile data - ExtraTRAM = Next; Next += 0x002000; // Extra tile layer - Ram01 = Next; Next += 0x005000; // RAM + Extra text layer scroll/offset - Ram02 = Next; Next += 0x008000; // - RamPal = Next; Next += 0x001000; // palette - RamZ80 = Next; Next += 0x004000; // Z80 RAM - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - ExtraTSelect= Ram01; // Extra text layer scroll - ExtraTScroll= Ram01 + 0x000200; // Extra text layer offset - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - if (ToaLoadCode(Rom01, 0, 4)) { - return 1; - } - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 4, 4, nGP9001ROMSize[0]); - - // Load the z80 Rom - BurnLoadRom(RomZ80, 8, 1); - - // Load YMZ280B (AD)PCM data - BurnLoadRom(YMZ280BROM + 0x000000, 9, 1); - BurnLoadRom(YMZ280BROM + 0x400000, 10, 1); - BurnLoadRom(YMZ280BROM + 0x800000, 11, 1); - - BurnLoadRom(DefaultEEPROM, 12, 1); - - return 0; -} - -static inline void bbakraidSynchroniseZ80(INT32 nExtraCycles) -{ -#ifdef ADJUST_Z80_SPEED - INT32 nCycles = SekTotalCycles() / 4 + nExtraCycles; -#else - INT32 nCycles = ((INT64)SekTotalCycles() * nCyclesTotal[1] / nCyclesTotal[0]) + nExtraCycles; -#endif - - if (nCycles <= ZetTotalCycles()) { - return; - } - - nCycles68KSync = nCycles - nExtraCycles; - - BurnTimerUpdate(nCycles); -} - -static INT32 bbakraidTimerOver(INT32, INT32) -{ -// bprintf(PRINT_NORMAL, _T(" - IRQ -> 1.\n")); - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_AUTO); - - return 0; -} - -UINT8 __fastcall bbakraidZIn(UINT16 nAddress) -{ - nAddress &= 0xFF; - switch (nAddress) { - case 0x48: - return nSoundData[0]; - case 0x4A: - return nSoundData[1]; - - case 0x81: - // YMZ280B status port. - return YMZ280BReadStatus(); - -// default: -// printf("Z80 read port #%02X\n", nAddress & 0xFF); - } - return 0; -} - -void __fastcall bbakraidZOut(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - switch (nAddress) { - case 0x40: - if (!(nSoundlatchAck & 1) && ZetTotalCycles() > nCycles68KSync) { - BurnTimerUpdateEnd(); - } - nSoundlatchAck |= 1; - nSoundData[2] = nValue; - break; - case 0x42: - if (!(nSoundlatchAck & 2) && ZetTotalCycles() > nCycles68KSync) { - BurnTimerUpdateEnd(); - } - nSoundlatchAck |= 2; - nSoundData[3] = nValue; - break; - -// case 0x44: // ??? -// case 0x46: // Acknowledge interrupt -// break; - - case 0x80: - // YMZ280B register select - YMZ280BSelectRegister(nValue); - break; - case 0x81: - // YMZ280B register write - YMZ280BWriteRegister(nValue); - break; - -// default: -// printf("Z80 wrote value %02X to port #%02x.\n", nValue, nAddress); - } -} - -static INT32 DrvZ80Init() -{ - // Init the Z80 - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(bbakraidZIn); - ZetSetOutHandler(bbakraidZOut); - - // ROM - ZetMapArea(0x0000, 0xBFFF, 0, RomZ80); // Direct Read from ROM - ZetMapArea(0x0000, 0xBFFF, 2, RomZ80); // Direct Fetch from ROM - // RAM - ZetMapArea(0xC000, 0xFFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea(0xC000, 0xFFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea(0xC000, 0xFFFF, 2, RamZ80); // - - ZetClose(); - - return 0; -} - -static void Map68KTextROM(bool bMapTextROM) -{ - if (bMapTextROM) { - if (nTextROMStatus != 1) { - SekMapMemory(ExtraTROM, 0x200000, 0x207FFF, MAP_RAM); // Extra text tile memory - - nTextROMStatus = 1; - } - } else { - if (nTextROMStatus != 0) { - SekMapMemory(ExtraTRAM, 0x200000, 0x201FFF, MAP_RAM); // Extra text tilemap RAM - SekMapMemory(RamPal, 0x202000, 0x202FFF, MAP_RAM); // Palette RAM - SekMapMemory(Ram01, 0x203000, 0x207FFF, MAP_RAM); // Extra text Scroll & offset; RAM - - nTextROMStatus = 0; - } - } -} - -UINT8 __fastcall bbakraidReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x500000: // Player 2 Inputs - return DrvInput[1]; - case 0x500001: // Player 1 Inputs - return DrvInput[0]; - case 0x500002: // Other inputs - return DrvInput[5]; - case 0x500003: // Dipswitch 3 - return DrvInput[2]; - case 0x500004: // Dipswitch 2 - return DrvInput[4]; - case 0x500005: // Dipswitch 1 - return DrvInput[3]; - - // These addresses contain the response of the Z80 to the (sound) commands - case 0x500011: - return nSoundData[2]; - case 0x500013: - return nSoundData[3]; - - case 0x500019: - return ((EEPROMRead() & 0x01) << 4) | (Z80BusRQ >> 4); - - default: { -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - } - - return 0; -} - -UINT16 __fastcall bbakraidReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - // Video status register - case 0x500006: - return ToaScanlineRegister(); - - // These addresses contain the response of the Z80 to the (sound) commands - case 0x500010: -// bbakraidSynchroniseZ80(0); - if (!(nSoundlatchAck & 1)) { - bbakraidSynchroniseZ80(0x0100); - } - return nSoundData[2]; - case 0x500012: -// bbakraidSynchroniseZ80(0); - if (!(nSoundlatchAck & 2)) { - bbakraidSynchroniseZ80(0x0100); - } - return nSoundData[3]; - - case 0x500018: - return ((EEPROMRead() & 0x01) << 4) | (Z80BusRQ >> 4); - - default: { -// printf("Attempt to read word value of location %x\n", sekAddress); - } - } - - return 0; -} - -void __fastcall bbakraidWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - case 0x500009: // Coin control - return; - - case 0x50001F: - Z80BusRQ = byteValue & 0x10; - EEPROMWrite(byteValue & 8, byteValue & 1, byteValue & 4); - return; - -// default: -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } -} - -void __fastcall bbakraidWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x500014: - nSoundlatchAck &= ~1; - nSoundData[0] = wordValue; - return; - case 0x500016: - nSoundlatchAck &= ~2; - nSoundData[1] = wordValue; - return; - - // This register is always written to after writing (sound) commands for the Z80 - case 0x50001A: - bbakraidSynchroniseZ80(0); - ZetNmi(); - return; - - // Serial EEPROM command - case 0x50001E: - Z80BusRQ = wordValue & 0x10; - EEPROMWrite(wordValue & 8, wordValue & 1, wordValue & 4); - return; - - case 0x500080: - Map68KTextROM(false); - return; - - case 0x50001C: // ??? - return; - - case 0x500082: // Acknowledge interrupt - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - nIRQPending = 0; - return; - - case 0x5000C0: - case 0x5000C1: - case 0x5000C2: - case 0x5000C3: - case 0x5000C4: - case 0x5000C5: - case 0x5000C6: - case 0x5000C7: - case 0x5000C8: - case 0x5000C9: - case 0x5000CA: - case 0x5000CB: - case 0x5000CC: - case 0x5000CD: - case 0x5000CE: - GP9001TileBank[(sekAddress & 0x0F) >> 1] = ((wordValue & 0x0F) << 15); - return; - -// default: -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -UINT16 __fastcall bbakraidReadWordGP9001(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x400008: - return ToaGP9001ReadRAM_Hi(0); - case 0x40000A: - return ToaGP9001ReadRAM_Lo(0); - - } - - return 0; -} - -void __fastcall bbakraidWriteWordGP9001(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x400000: - ToaGP9001WriteRegister(wordValue); - break; - - case 0x400004: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x400008: - case 0x40000A: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x40000C: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - } -} - -UINT8 __fastcall bbakraidReadByteZ80ROM(UINT32 sekAddress) -{ - return RomZ80[(sekAddress & 0x7FFFF) >> 1]; -} - -UINT16 __fastcall bbakraidReadWordZ80ROM(UINT32 sekAddress) -{ - return RomZ80[(sekAddress & 0x7FFFF) >> 1]; -} - -static INT32 DrvDoReset() -{ - // Insert region code into 68K ROM, code by BisonSAS - UINT8 nRegion = DrvRegion & 0x1F; - if (nRegion<=25) { - Rom01[0x00000^1]=(UINT8)(nRegion<<13) | (DrvRegion & 0x1F); - } - - SekOpen(0); - nIRQPending = 0; - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - EEPROMReset(); - - Z80BusRQ = 0; - - memset(nSoundData, 0, sizeof(nSoundData)); - nSoundlatchAck = 0; - - YMZ280BReset(); - - nCyclesDone[0] = nCyclesDone[1] = 0; - - BurnTimerReset(); - ZetOpen(0); - BurnTimerSetRetrig(0, 1.0 / 445.0); - ZetClose(); - - HiscoreReset(); - - return 0; -} - -static const eeprom_interface eeprom_interface_93C66 = -{ - 9, // address bits - 8, // data bits - "*110", // read 110 aaaaaaaaa - "*101", // write 101 aaaaaaaaa dddddddd - "*111", // erase 111 aaaaaaaaa - "*10000xxxxxxx",// lock 100x 00xxxx - "*10011xxxxxxx",// unlock 100x 11xxxx - 0, - 0 -}; - -static INT32 bbakraidInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x1000000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - EEPROMInit(&eeprom_interface_93C66); - -#ifdef BUILD_A68K - // Make sure we use Musashi - if (bBurnUseASMCPUEmulation) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching to Musashi 68000 core\n")); -#endif - bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation; - bBurnUseASMCPUEmulation = false; - } -#endif - -// if (strcmp("bbakraid", BurnDrvGetTextA(DRV_NAME)) == 0 || strcmp("bbakraidj", BurnDrvGetTextA(DRV_NAME)) == 0) { -// if (!EEPROMAvailable()) EEPROMFill(bbakraid_unlimited_nvram, 0, sizeof(bbakraid_unlimited_nvram)); -// } - - if (!EEPROMAvailable()) EEPROMFill(DefaultEEPROM, 0, 0x200); - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x1FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram02, 0x208000, 0x20FFFF, MAP_RAM); - - Map68KTextROM(true); - - SekSetReadWordHandler(0, bbakraidReadWord); - SekSetReadByteHandler(0, bbakraidReadByte); - SekSetWriteWordHandler(0, bbakraidWriteWord); - SekSetWriteByteHandler(0, bbakraidWriteByte); - - SekMapHandler(1, 0x400000, 0x400400, MAP_RAM); // GP9001 addresses - - SekSetReadWordHandler(1, bbakraidReadWordGP9001); - SekSetWriteWordHandler(1, bbakraidWriteWordGP9001); - - SekMapHandler(2, 0x300000, 0x37FFFF, MAP_ROM); // Z80 ROM - - SekSetReadByteHandler(2, bbakraidReadByteZ80ROM); - SekSetReadWordHandler(2, bbakraidReadWordZ80ROM); - - SekClose(); - } - - nSpriteYOffset = 0x0001; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(); - - nExtraTXOffset = 0x2C; - ToaExtraTextInit(); - - DrvZ80Init(); // Initialize Z80 - - YMZ280BInit(16934400, NULL, 0xC00000); - YMZ280BSetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - BurnTimerInit(bbakraidTimerOver, NULL); - BurnTimerAttachZet(TOA_Z80_SPEED); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - nTextROMStatus = -1; - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -static INT32 DrvExit() -{ - ToaPalExit(); - BurnTimerExit(); - YMZ280BExit(); - ToaExitGP9001(); - ToaExtraTextExit(); - ToaZExit(); // Z80 exit - SekExit(); // Deallocate 68000s - - EEPROMExit(); - -#ifdef BUILD_A68K - if (bUseAsm68KCoreOldValue) { -#if 1 && defined FBA_DEBUG - bprintf(PRINT_NORMAL, _T("Switching back to A68K core\n")); -#endif - bUseAsm68KCoreOldValue = false; - bBurnUseASMCPUEmulation = true; - } -#endif - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - ToaExtraTextLayer(); // Render extra text layer - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - ZetNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); -#ifdef ADJUST_Z80_SPEED - nCyclesTotal[1] = nCyclesTotal[0] / 4; -#else - nCyclesTotal[1] = TOA_Z80_SPEED / 60; -#endif - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - for (INT32 i = 1; i <= nInterleave; i++) { - INT32 nNext; - - // Run 68000 - - nNext = i * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - if (!CheckSleep(0)) { - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - } - - nIRQPending = 1; - SekSetIRQLine(3, CPU_IRQSTATUS_ACK); - - ToaBufferGP9001Sprites(); - - if (pBurnDraw) { // Draw screen if needed - DrvDraw(); - } - - bVBlank = true; - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (!CheckSleep(0)) { // See if this CPU is busywaiting - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - - if ((i & 1) == 0) { - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentEnd = nBurnSoundLen * i / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - YMZ280BRender(pSoundBuf, nSegmentEnd - nSoundBufferPos); - nSoundBufferPos = nSegmentEnd; - } - } - } - - nCycles68KSync = SekTotalCycles(); - BurnTimerEndFrame(nCyclesTotal[1]); - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesDone[1] = ZetTotalCycles() - nCyclesTotal[1]; - - SekClose(); - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - YMZ280BRender(pSoundBuf, nSegmentLength); - } - } - } - - ZetClose(); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029521; - } - - EEPROMScan(nAction, pnMin); // Scan EEPROM - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - ZetScan(nAction); // Scan Z80 - - YMZ280BScan(); - BurnTimerScan(nAction, pnMin); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(DrvInput); - SCAN_VAR(nSoundData); - SCAN_VAR(nSoundlatchAck); - SCAN_VAR(nCyclesDone); - SCAN_VAR(Z80BusRQ); - SCAN_VAR(nIRQPending); - SCAN_VAR(nTextROMStatus); - - if (nAction & ACB_WRITE) { - INT32 n = nTextROMStatus; - nTextROMStatus = -1; - SekOpen(0); - Map68KTextROM(n); - SekClose(); - } - } - - return 0; -} - -struct BurnDriver BurnDrvBattleBkraidu = { - "bbakraid", NULL, NULL, NULL, "1999", - "Battle Bakraid - Unlimited Version (U.S.A.) (Tue Jun 8 1999)\0", NULL, "Eighting", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bkraiduRomInfo, bkraiduRomName, NULL, NULL, bbakraidInputInfo, bkraiduDIPInfo, - bbakraidInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBattleBkraidc = { - "bbakraidc", "bbakraid", NULL, NULL, "1999", - "Battle Bakraid - Unlimited Version (China) (Tue Jun 8 1999)\0", NULL, "Eighting", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bkraidcRomInfo, bkraidcRomName, NULL, NULL, bbakraidInputInfo, bbakraidDIPInfo, - bbakraidInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBattleBkraiduj = { - "bbakraidj", "bbakraid", NULL, NULL, "1999", - "Battle Bakraid - Unlimited Version (Japan) (Tue Jun 8 1999)\0", NULL, "Eighting", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bkraidujRomInfo, bkraidujRomName, NULL, NULL, bbakraidInputInfo, bbakraidDIPInfo, - bbakraidInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvBattleBkraidj = { - "bbakraidja", "bbakraid", NULL, NULL, "1999", - "Battle Bakraid (Japan) (Wed Apr 7 1999)\0", NULL, "Eighting", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, bkraidjRomInfo, bkraidjRomName, NULL, NULL, bbakraidInputInfo, bbakraidDIPInfo, - bbakraidInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_demonwld.cpp b/jan/src/burn/drv/toaplan/d_demonwld.cpp deleted file mode 100644 index 21837d9bc..000000000 --- a/jan/src/burn/drv/toaplan/d_demonwld.cpp +++ /dev/null @@ -1,1104 +0,0 @@ -// Based on MAME driver by Darren Olafson, Quench,Stephane Humbert - -#include "toaplan.h" - -#define USE_DSP // use the dsp or hack it out. - -#ifdef USE_DSP -#include "tms32010.h" -#endif - -#define REFRESHRATE 60 -#define VBLANK_LINES (32) - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvPalRAM2; -static UINT8 *DrvMCUROM; -static UINT8 *DrvMCURAM; -static UINT8 *DrvShareRAM; - -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvReset; - -static INT32 nColCount = 0x0800; - -static UINT8 bDrawScreen; -static bool bVBlank; - -static bool bEnableInterrupts; - -static INT32 m68k_halt; - -#ifdef USE_DSP - -static UINT32 main_ram_seg; -static UINT16 dsp_addr_w; -static INT32 dsp_execute; -static INT32 dsp_BIO; -static INT32 dsp_on; - -#else - -static bool bUseAsm68KCoreOldValue = false; -static INT32 demonwld_hack; - -#endif - -static struct BurnInputInfo DemonwldInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Demonwld) - -static struct BurnDIPInfo DemonwldDIPList[]= -{ - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x01, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x01, "Easy" }, - {0x16, 0x01, 0x03, 0x00, "Medium" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x00, "30K, every 100K" }, - {0x16, 0x01, 0x0c, 0x04, "50K and 100K" }, - {0x16, 0x01, 0x0c, 0x08, "100K only" }, - {0x16, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "1" }, - {0x16, 0x01, 0x30, 0x20, "2" }, - {0x16, 0x01, 0x30, 0x00, "3" }, - {0x16, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x16, 0x01, 0x80, 0x00, "Off" }, - {0x16, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 2, "Territory/Copyright" }, - {0x17, 0x01, 0x01, 0x01, "Toaplan" }, - {0x17, 0x01, 0x01, 0x00, "Japan/Taito Corp" }, -}; - -STDDIPINFO(Demonwld) - -static struct BurnDIPInfo Demonwl1DIPList[]= -{ - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x01, "Easy" }, - {0x16, 0x01, 0x03, 0x00, "Medium" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x00, "30K, every 100K" }, - {0x16, 0x01, 0x0c, 0x04, "50K and 100K" }, - {0x16, 0x01, 0x0c, 0x08, "100K only" }, - {0x16, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "1" }, - {0x16, 0x01, 0x30, 0x20, "2" }, - {0x16, 0x01, 0x30, 0x00, "3" }, - {0x16, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x16, 0x01, 0x80, 0x00, "Off" }, - {0x16, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 4, "Territory/Copyright" }, - {0x17, 0x01, 0x03, 0x02, "World/Taito Japan" }, - {0x17, 0x01, 0x03, 0x03, "US/Toaplan" }, - {0x17, 0x01, 0x03, 0x01, "US/Taito America" }, - {0x17, 0x01, 0x03, 0x00, "Japan/Taito Corp" }, -}; - -STDDIPINFO(Demonwl1) - -#ifdef USE_DSP - -static void demonwld_dsp_addrsel_w(UINT16 data) -{ - main_ram_seg = ((data & 0xe000) << 9); - dsp_addr_w = ((data & 0x1fff) << 1); -} - -static UINT16 demonwld_dsp_r() -{ - switch (main_ram_seg) { - case 0xc00000: return SekReadWord(main_ram_seg + dsp_addr_w); - } - - return 0; -} - -static void demonwld_dsp_w(UINT16 data) -{ - dsp_execute = 0; - - switch (main_ram_seg) { - case 0xc00000: { - if ((dsp_addr_w < 3) && (data == 0)) dsp_execute = 1; - SekWriteWord(main_ram_seg + dsp_addr_w, data); - } - break; - } -} - -static void demonwld_dsp_bio_w(UINT16 data) -{ - if (data & 0x8000) { - dsp_BIO = 0; - } - if (data == 0) { - if (dsp_execute) { - m68k_halt = 0; - dsp_execute = 0; - } - dsp_BIO = 1; - } -} - -static UINT16 demonwld_BIO_r() -{ - return dsp_BIO; -} - -static void demonwld_dsp(INT32 enable) -{ - enable ^= 1; - dsp_on = enable; - - if (enable) - { - tms32010_set_irq_line(0, CPU_IRQSTATUS_ACK); /* TMS32010 INT */ - m68k_halt = 1; - SekRunEnd(); - } - else - { - tms32010_set_irq_line(0, CPU_IRQSTATUS_NONE); /* TMS32010 INT */ - tms32010RunEnd(); - } -} - -static void demonwld_dsp_ctrl_w(UINT16 data) -{ - //if (ACCESSING_BITS_0_7) - { - switch (data) - { - case 0x00: - case 0x01: demonwld_dsp(data); break; - } - } -} - -static void dsp_write(INT32 port, UINT16 data) -{ - switch (port) - { - case 0x00: demonwld_dsp_addrsel_w(data); return; - case 0x01: demonwld_dsp_w(data); return; - case 0x03: demonwld_dsp_bio_w(data); return; - } -} - -static UINT16 dsp_read(INT32 port) -{ - switch (port) - { - case 0x01: return demonwld_dsp_r(); - case 0x10: return demonwld_BIO_r(); - } - - return 0; -} -#endif - -static void __fastcall demonwldWriteWord(UINT32 a, UINT16 d) -{ - switch (a) - { - case 0x400000: - return; // nop - - case 0x400002: - bEnableInterrupts = d & 0xff; - return; - - case 0x400008: - case 0x40000a: - case 0x40000c: - case 0x40000e: - // toaplan1_bcu_control_w - return; - - case 0x800000: - // toaplan1_bcu_flipscreen_w - return; - - case 0x800002: - ToaBCU2SetRAMPointer(d); - return; - - case 0x800004: - case 0x800006: - ToaBCU2WriteRAM(d); - return; - - case 0x800010: - case 0x800012: - case 0x800014: - case 0x800016: - case 0x800018: - case 0x80001a: - case 0x80001c: - case 0x80001e: - BCU2Reg[(a & 0x0f) >> 1] = d; - return; - - case 0xa00000: - return; // nop - - case 0xa00002: - ToaFCU2SetRAMPointer(d); - return; - - case 0xa00004: - ToaFCU2WriteRAM(d); - return; - - case 0xa00006: - ToaFCU2WriteRAMSize(d); - return; - - case 0xe00000: - nBCU2TileXOffset = d; - return; - - case 0xe00002: - nBCU2TileYOffset = d - 16; - return; - - case 0xe00006: - // toaplan1_fcu_flipscreen_w - return; - - case 0xe00008: - if (d == 0) { - ZetReset(); - } - return; - - case 0xe0000a: -#ifdef USE_DSP - if (d < 2) demonwld_dsp_ctrl_w(d & 1); -#endif - return; - } -} - -static void __fastcall demonwldWriteByte(UINT32 , UINT8 ) -{ - return; -} - -static UINT16 __fastcall demonwldReadWord(UINT32 a) -{ - switch (a) - { - case 0x800002: - return ToaBCU2GetRAMPointer(); - - case 0x800004: - return ToaBCU2ReadRAM_Hi(); - - case 0x800006: - return ToaBCU2ReadRAM_Lo(); - - case 0x800010: - case 0x800012: - case 0x800014: - case 0x800016: - case 0x800018: - case 0x80001a: - case 0x80001c: - case 0x80001e: - return BCU2Reg[(a & 0x0f) >> 1]; - - case 0xa00002: - return ToaFCU2GetRAMPointer(); - - case 0xa00004: - return ToaFCU2ReadRAM(); - - case 0xa00006: - return ToaFCU2ReadRAMSize(); -#ifndef USE_DSP - case 0xe0000e: // hack - { - demonwld_hack++; - if (demonwld_hack & 4) - return 0x76; - else - return 0; - } -#endif - } - - return 0; -} - -static UINT8 __fastcall demonwldReadByte(UINT32 a) -{ - switch (a) - { - case 0x400001: - case 0xa00001: - return ToaVBlankRegister(); - } - - return 0; -} - -static void __fastcall demonwld_sound_write_port(UINT16 p, UINT8 d) -{ - switch (p & 0xff) - { - case 0x00: { - BurnYM3812Write(0, 0, d); - return; - } - - case 0x01: { - BurnYM3812Write(0, 1, d); - return; - } - - case 0x40: // toaplan1_coin_w - return; - } -} - -static UINT8 __fastcall demonwld_sound_read_port(UINT16 p) -{ - switch (p & 0xff) - { - case 0x00: - case 0x01: - return BurnYM3812Read(0, p & 1); - - case 0x20: - return DrvDips[2]; - - case 0x60: - return DrvInputs[2]; - - case 0x80: - return DrvInputs[0]; - - case 0xa0: - return DrvDips[1]; - - case 0xc0: - return DrvInputs[1]; - - case 0xe0: - return DrvDips[0]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - - bEnableInterrupts = false; - - HiscoreReset(); - - m68k_halt = 0; - -#ifdef USE_DSP - tms32010_reset(); - - main_ram_seg = 0; - dsp_addr_w = 0; - dsp_execute = 0; - dsp_BIO = 0; - dsp_on = 0; -#else - demonwld_hack = 0; -#endif - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000 + 0x400; - DrvMCUROM = Next; Next += 0x001000; - DrvZ80ROM = Next; Next += 0x010000; - BCU2ROM = Next; Next += nBCU2ROMSize; - FCU2ROM = Next; Next += nFCU2ROMSize; - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x000800; - DrvPalRAM2 = Next; Next += 0x000800; - - RamZ80 = Next; - DrvShareRAM = Next; Next += 0x008000; - - DrvMCURAM = Next; Next += 0x000400; - BCU2RAM = Next; Next += 0x010000; - FCU2RAM = Next; Next += 0x000800; - FCU2RAMSize = Next; Next += 0x000080; - - RamEnd = Next; - - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - ToaPalette2 = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ -#ifndef USE_DSP - if (bBurnUseASMCPUEmulation) { - bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation; - bBurnUseASMCPUEmulation = false; - } -#endif - - INT32 nLen; - -// bToaRotateScreen = true; - - BurnSetRefreshRate(REFRESHRATE); - - nBCU2ROMSize = 0x080000; - nFCU2ROMSize = 0x080000; - - // Find out how much memory is needed - AllMem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(AllMem, 0, nLen); - MemIndex(); - - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; - - if (BurnLoadRom(DrvMCUROM + 0x000000, 3, 2)) return 1; - if (BurnLoadRom(DrvMCUROM + 0x000001, 4, 2)) return 1; - - ToaLoadTiles(BCU2ROM, 5, nBCU2ROMSize); - ToaLoadTiles(FCU2ROM, 9, nFCU2ROMSize); - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03FFFF, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x404000, 0x4047FF, MAP_RAM); - SekMapMemory(DrvPalRAM2, 0x406000, 0x4067FF, MAP_RAM); - SekMapMemory(Drv68KRAM, 0xc00000, 0xc03FFF, MAP_RAM); - SekSetReadWordHandler(0, demonwldReadWord); - SekSetReadByteHandler(0, demonwldReadByte); - SekSetWriteWordHandler(0, demonwldWriteWord); - SekSetWriteByteHandler(0, demonwldWriteByte); - - SekMapHandler(1, 0x600000, 0x600FFF, MAP_RAM); - SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM); - SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM); - SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM); - SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0xffff, 0, DrvShareRAM); - ZetMapArea(0x8000, 0xffff, 1, DrvShareRAM); - ZetMapArea(0x8000, 0xffff, 2, DrvShareRAM); - ZetSetOutHandler(demonwld_sound_write_port); - ZetSetInHandler(demonwld_sound_read_port); - ZetClose(); - -#ifdef USE_DSP - tms32010_init(); - tms32010_set_write_port_handler(dsp_write); - tms32010_set_read_port_handler(dsp_read); - tms32010_ram = (UINT16*)DrvMCURAM; - tms32010_rom = (UINT16*)DrvMCUROM; -#endif - } - - ToaInitBCU2(); - nFCU2SpriteYOffset = -16; - - nToaPalLen = nColCount; - ToaPalSrc = DrvPalRAM; - ToaPalSrc2 = DrvPalRAM2; - ToaPalInit(); - - ToaOpaquePriority = 2; - - BurnYM3812Init(1, 28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0); - BurnTimerAttachZetYM3812(28000000 / 8); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - ToaPalExit(); - - ToaExitBCU2(); - ToaZExit(); - SekExit(); - -#ifdef USE_DSP - tms32010_exit(); -#endif - - BurnFree(AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderBCU2(); - } - - ToaPalUpdate(); - ToaPal2Update(); - -#ifndef USE_DSP - if (bUseAsm68KCoreOldValue) { - bUseAsm68KCoreOldValue = false; - bBurnUseASMCPUEmulation = true; - } -#endif - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] |= (DrvJoy1[i] & 1) << i; - DrvInputs[1] |= (DrvJoy2[i] & 1) << i; - DrvInputs[2] |= (DrvJoy3[i] & 1) << i; - } - ToaClearOpposites(&DrvInputs[0]); - ToaClearOpposites(&DrvInputs[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - nCyclesTotal[1] = INT32(28000000.0 / 8 / REFRESHRATE); -#ifdef USE_DSP - INT32 nCyclesMCU = (INT32)((INT64)14000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); -#endif - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - if (!m68k_halt) { - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - } - - if (pBurnDraw) { - DrvDraw(); - } - - ToaBufferFCU2Sprites(); - - bVBlank = true; - if (bEnableInterrupts) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - nCyclesSegment = nNext - SekTotalCycles(); - if ((bVBlank || (!CheckSleep(0))) && !m68k_halt) { - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - -#ifdef USE_DSP - if (dsp_on) tms32010_execute(nCyclesMCU / nInterleave); -#endif - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - nToa1Cycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - -// bprintf(PRINT_NORMAL, _T(" %i\n"), nCyclesDone[0]); - -// ToaBufferFCU2Sprites(); - - SekClose(); - ZetClose(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - ToaScanBCU2(nAction, pnMin); - - SCAN_VAR(nCyclesDone); -#ifndef USE_DSP - SCAN_VAR(demonwld_hack); -#else - tms32010_scan(nAction); - - SCAN_VAR(m68k_halt); - SCAN_VAR(main_ram_seg); - SCAN_VAR(dsp_addr_w); - SCAN_VAR(dsp_execute); - SCAN_VAR(dsp_BIO); - SCAN_VAR(dsp_on); -#endif - } - - return 0; -} - -#ifndef USE_DSP -// Hack to bypass the missing sub-cpu. All games except the taito -// set check the crc and rather than dealing with that, I'm seperating -// the opcodes and data and just patching the opcodes. -// Taito set patches from MAME 0.36b10. -static void map_hack(INT32 hack_off) -{ - INT32 cpy_off = hack_off & ~0x3ff; - - memcpy (Drv68KROM + 0x40000, Drv68KROM + cpy_off, 0x400); - - hack_off -= cpy_off; - hack_off += 0x40000; - - *((UINT16*)(Drv68KROM + hack_off + 0)) = 0x4e71; - *((UINT16*)(Drv68KROM + hack_off + 8)) = 0x600a; - - SekOpen(0); - SekMapMemory(Drv68KROM + 0x40000, cpy_off, cpy_off + 0x3ff, MAP_FETCH); - SekClose(); -} -#endif - -// Demon's World / Horror Story (set 1) - -static struct BurnRomInfo demonwldRomDesc[] = { - { "o16-10.v2", 0x20000, 0xca8194f3, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o16-09.v2", 0x20000, 0x7baea7ba, BRF_PRG | BRF_ESS }, // 1 - - { "rom11.v2", 0x08000, 0xdbe08c85, BRF_PRG | BRF_ESS }, // 2 CPU #1 code - - { "dsp_21.bin", 0x00800, 0x2d135376, BRF_PRG | BRF_ESS }, // 3 MCU code - { "dsp_22.bin", 0x00800, 0x79389a71, BRF_PRG | BRF_ESS }, // 4 - - { "rom05", 0x20000, 0x6506c982, BRF_GRA }, // 5 Tile data - { "rom07", 0x20000, 0xa3a0d993, BRF_GRA }, // 6 - { "rom06", 0x20000, 0x4fc5e5f3, BRF_GRA }, // 7 - { "rom08", 0x20000, 0xeb53ab09, BRF_GRA }, // 8 - - { "rom01", 0x20000, 0x1b3724e9, BRF_GRA }, // 9 - { "rom02", 0x20000, 0x7b20a44d, BRF_GRA }, // 10 - { "rom03", 0x20000, 0x2cacdcd0, BRF_GRA }, // 11 - { "rom04", 0x20000, 0x76fd3201, BRF_GRA }, // 12 - - { "prom12.bpr", 0x00020, 0xbc88cced, BRF_GRA }, // 13 Sprite attribute PROM - { "prom13.bpr", 0x00020, 0xa1e17492, BRF_GRA }, // 14 -}; - -STD_ROM_PICK(demonwld) -STD_ROM_FN(demonwld) - -static INT32 demonwldInit() -{ - INT32 nRet = DrvInit(); - -#ifndef USE_DSP - if (nRet == 0) { - map_hack(0x1430); - } -#endif - - return nRet; -} - -struct BurnDriver BurnDrvDemonwld = { - "demonwld", NULL, NULL, NULL, "1990", - "Demon's World / Horror Story (set 1)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 1)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_PLATFORM, 0, - NULL, demonwldRomInfo, demonwldRomName, NULL, NULL, DemonwldInputInfo, DemonwldDIPInfo, - demonwldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Demon's World / Horror Story (set 2) - -static struct BurnRomInfo demonwld1RomDesc[] = { - { "o16n-10.bin", 0x20000, 0xfc38aeaa, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o16n-09.bin", 0x20000, 0x74f66643, BRF_PRG | BRF_ESS }, // 1 - - { "o16-11.bin", 0x08000, 0xdbe08c85, BRF_PRG | BRF_ESS }, // 2 CPU #1 code - - { "dsp_21.bin", 0x00800, 0x2d135376, BRF_PRG | BRF_ESS }, // 3 MCU code - { "dsp_22.bin", 0x00800, 0x79389a71, BRF_PRG | BRF_ESS }, // 4 - - { "rom05", 0x20000, 0x6506c982, BRF_GRA }, // 5 Tile data - { "rom07", 0x20000, 0xa3a0d993, BRF_GRA }, // 6 - { "rom06", 0x20000, 0x4fc5e5f3, BRF_GRA }, // 7 - { "rom08", 0x20000, 0xeb53ab09, BRF_GRA }, // 8 - - { "rom01", 0x20000, 0x1b3724e9, BRF_GRA }, // 9 - { "rom02", 0x20000, 0x7b20a44d, BRF_GRA }, // 10 - { "rom03", 0x20000, 0x2cacdcd0, BRF_GRA }, // 11 - { "rom04", 0x20000, 0x76fd3201, BRF_GRA }, // 12 - - { "prom12.bpr", 0x00020, 0xbc88cced, BRF_GRA }, // 13 Sprite attribute PROM - { "prom13.bpr", 0x00020, 0xa1e17492, BRF_GRA }, // 14 -}; - -STD_ROM_PICK(demonwld1) -STD_ROM_FN(demonwld1) - -struct BurnDriver BurnDrvDemonwld1 = { - "demonwld1", "demonwld", NULL, NULL, "1989", - "Demon's World / Horror Story (set 2)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 2)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_PLATFORM, 0, - NULL, demonwld1RomInfo, demonwld1RomName, NULL, NULL, DemonwldInputInfo, DemonwldDIPInfo, - demonwldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Demon's World / Horror Story (set 3) - -static struct BurnRomInfo demonwld2RomDesc[] = { - { "o16-10.rom", 0x20000, 0x036ee46c, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o16-09.rom", 0x20000, 0xbed746e3, BRF_PRG | BRF_ESS }, // 1 - - { "rom11", 0x08000, 0x397eca1b, BRF_PRG | BRF_ESS }, // 2 CPU #1 code - - { "dsp_21.bin", 0x00800, 0x2d135376, BRF_PRG | BRF_ESS }, // 3 MCU code - { "dsp_22.bin", 0x00800, 0x79389a71, BRF_PRG | BRF_ESS }, // 4 - - { "rom05", 0x20000, 0x6506c982, BRF_GRA }, // 5 Tile data - { "rom07", 0x20000, 0xa3a0d993, BRF_GRA }, // 6 - { "rom06", 0x20000, 0x4fc5e5f3, BRF_GRA }, // 7 - { "rom08", 0x20000, 0xeb53ab09, BRF_GRA }, // 8 - - { "rom01", 0x20000, 0x1b3724e9, BRF_GRA }, // 9 - { "rom02", 0x20000, 0x7b20a44d, BRF_GRA }, // 10 - { "rom03", 0x20000, 0x2cacdcd0, BRF_GRA }, // 11 - { "rom04", 0x20000, 0x76fd3201, BRF_GRA }, // 12 - - { "prom12.bpr", 0x00020, 0xbc88cced, BRF_GRA }, // 13 Sprite attribute PROM - { "prom13.bpr", 0x00020, 0xa1e17492, BRF_GRA }, // 14 -}; - -STD_ROM_PICK(demonwld2) -STD_ROM_FN(demonwld2) - -static INT32 demonwld2Init() -{ - INT32 nRet = DrvInit(); - -#ifndef USE_DSP - if (nRet == 0) { - map_hack(0x181c); - } -#endif - - return nRet; -} - -struct BurnDriver BurnDrvDemonwld2 = { - "demonwld2", "demonwld", NULL, NULL, "1989", - "Demon's World / Horror Story (set 3)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 3)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_PLATFORM, 0, - NULL, demonwld2RomInfo, demonwld2RomName, NULL, NULL, DemonwldInputInfo, Demonwl1DIPInfo, - demonwld2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Demon's World / Horror Story (set 4) - -static struct BurnRomInfo demonwld3RomDesc[] = { - { "o16-10-2.bin", 0x20000, 0x84ee5218, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o16-09-2.bin", 0x20000, 0xcf474cb2, BRF_PRG | BRF_ESS }, // 1 - - { "rom11", 0x08000, 0x397eca1b, BRF_PRG | BRF_ESS }, // 2 CPU #1 code - - { "dsp_21.bin", 0x00800, 0x2d135376, BRF_PRG | BRF_ESS }, // 3 MCU code - { "dsp_22.bin", 0x00800, 0x79389a71, BRF_PRG | BRF_ESS }, // 4 - - { "rom05", 0x20000, 0x6506c982, BRF_GRA }, // 5 Tile data - { "rom07", 0x20000, 0xa3a0d993, BRF_GRA }, // 6 - { "rom06", 0x20000, 0x4fc5e5f3, BRF_GRA }, // 7 - { "rom08", 0x20000, 0xeb53ab09, BRF_GRA }, // 8 - - { "rom01", 0x20000, 0x1b3724e9, BRF_GRA }, // 9 - { "rom02", 0x20000, 0x7b20a44d, BRF_GRA }, // 10 - { "rom03", 0x20000, 0x2cacdcd0, BRF_GRA }, // 11 - { "rom04", 0x20000, 0x76fd3201, BRF_GRA }, // 12 - - { "prom12.bpr", 0x00020, 0xbc88cced, BRF_GRA }, // 13 Sprite attribute PROM - { "prom13.bpr", 0x00020, 0xa1e17492, BRF_GRA }, // 14 -}; - -STD_ROM_PICK(demonwld3) -STD_ROM_FN(demonwld3) - -struct BurnDriver BurnDrvDemonwld3 = { - "demonwld3", "demonwld", NULL, NULL, "1989", - "Demon's World / Horror Story (set 4)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 4)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_PLATFORM, 0, - NULL, demonwld3RomInfo, demonwld3RomName, NULL, NULL, DemonwldInputInfo, Demonwl1DIPInfo, - demonwld2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Demon's World / Horror Story (set 5) - -static struct BurnRomInfo demonwld4RomDesc[] = { - { "o16-10.bin", 0x20000, 0x6f7468e0, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o16-09.bin", 0x20000, 0xa572f5f7, BRF_PRG | BRF_ESS }, // 1 - - { "rom11", 0x08000, 0x397eca1b, BRF_PRG | BRF_ESS }, // 2 CPU #1 code - - { "dsp_21.bin", 0x00800, 0x2d135376, BRF_PRG | BRF_ESS }, // 3 MCU code - { "dsp_22.bin", 0x00800, 0x79389a71, BRF_PRG | BRF_ESS }, // 4 - - { "rom05", 0x20000, 0x6506c982, BRF_GRA }, // 5 Tile data - { "rom07", 0x20000, 0xa3a0d993, BRF_GRA }, // 6 - { "rom06", 0x20000, 0x4fc5e5f3, BRF_GRA }, // 7 - { "rom08", 0x20000, 0xeb53ab09, BRF_GRA }, // 8 - - { "rom01", 0x20000, 0x1b3724e9, BRF_GRA }, // 9 - { "rom02", 0x20000, 0x7b20a44d, BRF_GRA }, // 10 - { "rom03", 0x20000, 0x2cacdcd0, BRF_GRA }, // 11 - { "rom04", 0x20000, 0x76fd3201, BRF_GRA }, // 12 - - { "prom12.bpr", 0x00020, 0xbc88cced, BRF_GRA }, // 13 Sprite attribute PROM - { "prom13.bpr", 0x00020, 0xa1e17492, BRF_GRA }, // 14 -}; - -STD_ROM_PICK(demonwld4) -STD_ROM_FN(demonwld4) - -static INT32 demonwld4Init() -{ - INT32 nRet = DrvInit(); - -#ifndef USE_DSP - if (nRet == 0) { - map_hack(0x1828); - } -#endif - - return nRet; -} - -struct BurnDriver BurnDrvDemonwld4 = { - "demonwld4", "demonwld", NULL, NULL, "1989", - "Demon's World / Horror Story (set 5)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 5)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_PLATFORM, 0, - NULL, demonwld4RomInfo, demonwld4RomName, NULL, NULL, DemonwldInputInfo, Demonwl1DIPInfo, - demonwld4Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/toaplan/d_dogyuun.cpp b/jan/src/burn/drv/toaplan/d_dogyuun.cpp deleted file mode 100644 index 3a9ef60b0..000000000 --- a/jan/src/burn/drv/toaplan/d_dogyuun.cpp +++ /dev/null @@ -1,797 +0,0 @@ -// FB Alpha Battle Dogyuun driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -#include "nec_intf.h" -// Dogyuun - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT32 v25_reset = 0; - -// Rom information -static struct BurnRomInfo dogyuunRomDesc[] = { - { "tp022_01.r16", 0x080000, 0x79EB2429, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp022_3.w92", 0x100000, 0x191B595F, BRF_GRA }, // 1 GP9001 #1 Tile data - { "tp022_4.w93", 0x100000, 0xD58D29CA, BRF_GRA }, // 2 - - { "tp022_5.w16", 0x200000, 0xD4C1DB45, BRF_GRA }, // 3 GP9001 #2 Tile data - { "tp022_6.w17", 0x200000, 0xD48DC74F, BRF_GRA }, // 4 - - { "tp022_2.w30", 0x040000, 0x043271B3, BRF_SND }, // 5 ADPCM data -}; - - -STD_ROM_PICK(dogyuun) -STD_ROM_FN(dogyuun) - -static struct BurnRomInfo dogyuunkRomDesc[] = { - { "01.u64", 0x080000, 0xfe5bd7f4, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp022_3.w92", 0x100000, 0x191B595F, BRF_GRA }, // 1 GP9001 #1 Tile data - { "tp022_4.w93", 0x100000, 0xD58D29CA, BRF_GRA }, // 2 - - { "tp022_5.w16", 0x200000, 0xD4C1DB45, BRF_GRA }, // 3 GP9001 #2 Tile data - { "tp022_6.w17", 0x200000, 0xD48DC74F, BRF_GRA }, // 4 - - { "tp022_2.w30", 0x040000, 0x043271B3, BRF_SND }, // 5 ADPCM data -}; - - -STD_ROM_PICK(dogyuunk) -STD_ROM_FN(dogyuunk) - -static struct BurnRomInfo dogyuuntRomDesc[] = { - { "sample10.9.u64.bin", 0x080000, 0x585f5016, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp022_3.w92", 0x100000, 0x191B595F, BRF_GRA }, // 1 GP9001 #1 Tile data - { "tp022_4.w93", 0x100000, 0xD58D29CA, BRF_GRA }, // 2 - - { "tp022_5.w16", 0x200000, 0xD4C1DB45, BRF_GRA }, // 3 GP9001 #2 Tile data - { "tp022_6.w17", 0x200000, 0xD48DC74F, BRF_GRA }, // 4 - - { "tp022_2.w30", 0x040000, 0x043271B3, BRF_SND }, // 5 ADPCM data -}; - - -STD_ROM_PICK(dogyuunt) -STD_ROM_FN(dogyuunt) - -static struct BurnInputInfo dogyuunInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(dogyuun) - -static struct BurnDIPInfo dogyuunDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Coin/Free play"}, - {0x14, 0x01, 0x01, 0x00, "Coin play"}, - {0x14, 0x01, 0x01, 0x01, "Free play"}, - {0, 0xFE, 0, 2, "Screen Type"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - - // Normal coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x82, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x82, 0x30, 0x10, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x82, 0x30, 0x20, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x82, 0x30, 0x30, "2 coins 3 plays"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x82, 0xC0, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x82, 0xC0, 0x40, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x82, 0xC0, 0x80, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x82, 0xC0, 0xC0, "2 coins 3 plays"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - - // European coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x02, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x02, 0x30, 0x10, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x02, 0x30, 0x20, "3 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x02, 0x30, 0x30, "3 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x02, 0xC0, 0x00, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x02, 0xC0, 0x40, "1 coin 3 plays"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x02, 0xC0, 0x80, "1 coin 4 play"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - {0x14, 0x02, 0xC0, 0xC0, "1 coin 6 plays"}, - {0x16, 0x00, 0x0F, 0x03, NULL}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B (normal)"}, - {0x15, 0x01, 0x03, 0x01, "A (easy)"}, - {0x15, 0x01, 0x03, 0x02, "C (hard)"}, - {0x15, 0x01, 0x03, 0x03, "D (very hard)"}, - {0, 0xFE, 0, 4, "Extend"}, - {0x15, 0x01, 0x0C, 0x00, "200,000pts only"}, - {0x15, 0x01, 0x0C, 0x04, "200,000 every max 3"}, - {0x15, 0x01, 0x0C, 0x08, "400,000pts only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Hero counts"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x01, "5"}, - {0x15, 0x01, 0x30, 0x02, "2"}, - {0x15, 0x01, 0x30, 0x03, "1"}, - {0, 0xFE, 0, 2, "Cheating"}, - {0x15, 0x01, 0x40, 0x00, "Normal game"}, - {0x15, 0x01, 0x40, 0x40, "No-death & stop mode"}, - {0, 0xFE, 0, 2, "Continue play"}, - {0x15, 0x01, 0x80, 0x00, "On"}, - {0x15, 0x01, 0x80, 0x80, "Off"}, -}; - -static struct BurnDIPInfo dogyuunRegionDIPList[] = { - // Region - {0x16, 0xFF, 0x0F, 0x03, NULL}, - {0, 0xFE, 0, 9, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x02, "U.S.A. (Atari Games Corp.)"}, - {0x16, 0x01, 0x0F, 0x03, "Europe"}, - {0x16, 0x01, 0x0F, 0x04, "Hong Kong (Charterfield)"}, - {0x16, 0x01, 0x0F, 0x05, "Korea (Unite Trading)"}, - {0x16, 0x01, 0x0F, 0x06, "Taiwan"}, -// {0x16, 0x01, 0x0F, 0x07, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x08, "South East Asia (Charterfield)"}, -// {0x16, 0x01, 0x0F, 0x09, "Hong Kong (Charterfield)"}, -// {0x16, 0x01, 0x0F, 0x0A, "Korea (Unite Trading)"}, -// {0x16, 0x01, 0x0F, 0x0B, "Taiwan"}, -// {0x16, 0x01, 0x0F, 0x0C, "U.S.A. (Atari Games Corp.)"}, -// {0x16, 0x01, 0x0F, 0x0D, "South East Asia (Charterfield)"}, - {0x16, 0x01, 0x0F, 0x0F, "Japan (Taito Corp license)"}, -}; - -STDDIPINFOEXT(dogyuun, dogyuunRegion, dogyuun) - -static struct BurnDIPInfo dogyuunkRegionDIPList[] = { - // Region - {0x16, 0xFF, 0x0F, 0x05, NULL}, - {0, 0xFE, 0, 9, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x02, "U.S.A. (Atari Games Corp.)"}, - {0x16, 0x01, 0x0F, 0x03, "Europe"}, - {0x16, 0x01, 0x0F, 0x04, "Hong Kong (Charterfield)"}, - {0x16, 0x01, 0x0F, 0x05, "Korea (Unite Trading)"}, - {0x16, 0x01, 0x0F, 0x06, "Taiwan"}, -// {0x16, 0x01, 0x0F, 0x07, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x08, "South East Asia (Charterfield)"}, -// {0x16, 0x01, 0x0F, 0x09, "Hong Kong (Charterfield)"}, -// {0x16, 0x01, 0x0F, 0x0A, "Korea (Unite Trading)"}, -// {0x16, 0x01, 0x0F, 0x0B, "Taiwan"}, -// {0x16, 0x01, 0x0F, 0x0C, "U.S.A. (Atari Games Corp.)"}, -// {0x16, 0x01, 0x0F, 0x0D, "South East Asia (Charterfield)"}, - {0x16, 0x01, 0x0F, 0x0F, "Japan (Taito Corp license)"}, -}; - -STDDIPINFOEXT(dogyuunk, dogyuunkRegion, dogyuun) - -static struct BurnDIPInfo dogyuuntRegionDIPList[] = { - // Region - {0x16, 0xFF, 0x0F, 0x00, NULL}, - {0, 0xFE, 0, 12, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x02, "Europe"}, - {0x16, 0x01, 0x0F, 0x03, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x04, "Korea"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "South East Asia (Charterfield license)"}, - {0x16, 0x01, 0x0F, 0x07, "USA (Romstar license)"}, - {0x16, 0x01, 0x0F, 0x08, "Hong Kong and China (Honest Trading Co. license)"}, - {0x16, 0x01, 0x0F, 0x09, "Korea (JC Trading Corp. license)"}, - {0x16, 0x01, 0x0F, 0x0A, "USA (Fabtek license)"}, - {0x16, 0x01, 0x0F, 0x0F, "Japan (Taito Corp license)"}, - }; - -STDDIPINFOEXT(dogyuunt, dogyuuntRegion, dogyuun) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal; -static UINT8 *ShareRAM; - -static INT32 nColCount = 0x0800; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - GP9001ROM[1]= Next; Next += nGP9001ROMSize[1]; // GP9001 tile data - MSM6295ROM = Next; Next += 0x040000; - RamStart = Next; - Ram01 = Next; Next += 0x004000; // CPU #0 work RAM - ShareRAM = Next; Next += 0x010000; - RamPal = Next; Next += 0x001000; // palette - GP9001RAM[0]= Next; Next += 0x004000; - GP9001RAM[1]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - GP9001Reg[1]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020997; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - VezScan(nAction); - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - ToaScanGP9001(nAction, pnMin); - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 2, nGP9001ROMSize[0], true); - ToaLoadGP9001Tiles(GP9001ROM[1], 3, 2, nGP9001ROMSize[1], true); - - BurnLoadRom(MSM6295ROM, 5, 1); - - return 0; -} - -UINT8 __fastcall dogyuunReadByte(UINT32 sekAddress) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - return ShareRAM[(sekAddress / 2) & 0x7fff]; - } - - switch (sekAddress) { - case 0x200011: // Player 1 inputs - return DrvInput[0]; - case 0x200015: // Player 2 inputs - return DrvInput[1]; - case 0x200019: // Other inputs - return DrvInput[2]; - - case 0x30000D: - return ToaVBlankRegister(); - -// default: -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - - return 0; - -} - -UINT16 __fastcall dogyuunReadWord(UINT32 sekAddress) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - return ShareRAM[(sekAddress / 2) & 0x7fff]; - } - - switch (sekAddress) { - - case 0x200010: // Player 1 inputs - return DrvInput[0]; - case 0x200014: // Player 2 inputs - return DrvInput[1]; - case 0x200018: // Other inputs - return DrvInput[2]; - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x30000C: - return ToaVBlankRegister(); - - case 0x500004: - return ToaGP9001ReadRAM_Hi(1); - case 0x500006: - return ToaGP9001ReadRAM_Lo(1); - - case 0x700000: { - static INT32 i; - UINT16 nStatus; - - i++; - nStatus = 0xFFFF - (i & 0xFF); - if (i & 1) { - nStatus &= 0x00FF; - } - return nStatus; - - } - -// default: -// printf("Attempt to read word value of location %x\n", sekAddress); - } - - return 0; -} - -void __fastcall dogyuunWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - ShareRAM[(sekAddress / 2) & 0x7fff] = byteValue; - return; - } - - switch (sekAddress) { - case 0x20001c: - case 0x20001d: - if (!v25_reset && (~byteValue & 0x20)) VezReset(); - v25_reset = (~byteValue & 0x20); - break; - - default: { -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall dogyuunWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - ShareRAM[(sekAddress / 2) & 0x7fff] = wordValue; - return; - } - - switch (sekAddress) { - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - ToaGP9001WriteRAM(wordValue, 0); - break; - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: - ToaGP9001WriteRegister(wordValue); - break; - - case 0x500000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue, 1); - break; - - case 0x500004: - ToaGP9001WriteRAM(wordValue, 1); - break; - case 0x500006: - ToaGP9001WriteRAM(wordValue, 1); - break; - - case 0x500008: - ToaGP9001SelectRegister(wordValue, 1); - break; - - case 0x50000C: - ToaGP9001WriteRegister(wordValue, 1); - break; - - default: { - printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } - } -} - -void __fastcall dogyuun_v25_write(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x00000: - BurnYM2151SelectRegister(data); - return; - - case 0x00001: - BurnYM2151WriteRegister(data); - return; - - case 0x00004: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall dogyuun_v25_read(UINT32 address) -{ - switch (address) - { - case 0x00001: - return BurnYM2151ReadStatus(); - - case 0x00004: - return MSM6295ReadStatus(0); - } - - return 0; -} - -UINT8 __fastcall dogyuun_v25_read_port(UINT32 port) -{ - switch (port) - { - case V25_PORT_PT: - return DrvInput[4]^0xff; - - case V25_PORT_P0: - return DrvInput[3]^0xff; - - case V25_PORT_P1: - return DrvInput[5]^0xff; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - VezOpen(0); - VezReset(); - VezClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - - v25_reset = 1; - - HiscoreReset(); - - return 0; -} - -static UINT8 nitro_decryption_table[256] = { - 0x1b,0x56,0x75,0x88,0x8c,0x06,0x58,0x72, 0x83,0x86,0x36,0x1a,0x5f,0xd3,0x8c,0xe9, /* 00 */ - 0x22,0x0f,0x03,0x2a,0xeb,0x2a,0xf9,0x0f, 0xa4,0xbd,0x75,0xf3,0x4f,0x53,0x8e,0xfe, /* 10 */ - 0x87,0xe8,0xb1,0x8d,0x36,0xb5,0x43,0x73, 0x2a,0x5b,0xf9,0x02,0x24,0x8a,0x03,0x80, /* 20 */ - 0x86,0x8b,0xd1,0x3e,0x8d,0x3e,0x58,0xfb, 0xc3,0x79,0xbd,0xb7,0x8a,0xe8,0x0f,0x81, /* 30 */ - 0xb7,0xd0,0x8b,0xeb,0xff,0xb8,0x90,0x8b, 0x5e,0xa2,0x90,0x90,0xab,0xb4,0x80,0x59, /* 40 */ - 0x87,0x72,0xb5,0xbd,0xb0,0x88,0x50,0x0f, 0xfe,0xd2,0xc3,0x90,0x8a,0x90,0xf9,0x75, /* 50 */ - 0x1a,0xb3,0x74,0x0a,0x68,0x24,0xbb,0x90, 0x75,0x47,0xfe,0x2c,0xbe,0xc3,0x88,0xd2, /* 60 */ - 0x3e,0xc1,0x8c,0x33,0x0f,0x90,0x8b,0x90, 0xb9,0x1e,0xff,0xa2,0x3e,0x22,0xbe,0x57, /* 70 */ - 0x81,0x3a,0xf6,0x88,0xeb,0xb1,0x89,0x8a, 0x32,0x80,0x0f,0xb1,0x48,0xc3,0x68,0x72, /* 80 */ - 0x53,0x02,0xc0,0x02,0xe8,0xb4,0x74,0xbc, 0x90,0x58,0x0a,0xf3,0x75,0xc6,0x90,0xe8, /* 90 */ - 0x26,0x50,0xfc,0x8c,0x90,0xb1,0xc3,0xd1, 0xeb,0x83,0xa4,0xbf,0x26,0x4b,0x46,0xfe, /* a0 */ - 0xe2,0x89,0xb3,0x88,0x03,0x56,0x0f,0x38, 0xbb,0x0c,0x90,0x0f,0x07,0x8a,0x8a,0x33, /* b0 */ - 0xfe,0xf9,0xb1,0xa0,0x45,0x36,0x22,0x5e, 0x8a,0xbe,0xc6,0xea,0x3c,0xb2,0x1e,0xe8, /* c0 */ - 0x90,0xeb,0x55,0xf6,0x8a,0xb0,0x5d,0xc0, 0xbb,0x8d,0xf6,0xd0,0xd1,0x88,0x4d,0x90, /* d0 */ - 0x51,0x51,0x74,0xbd,0x32,0xd1,0x90,0xd2, 0x53,0xc7,0xab,0x36,0x50,0xe9,0x33,0xb3, /* e0 */ - 0x2e,0x05,0x88,0x59,0x74,0x74,0x22,0x8e, 0x8a,0x8a,0x36,0x08,0x0f,0x45,0x90,0x2e, /* f0 */ -}; - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x200000; - nGP9001ROMSize[1] = 0x400000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x103FFF, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); // Palette RAM - SekSetReadWordHandler(0, dogyuunReadWord); - SekSetReadByteHandler(0, dogyuunReadByte); - SekSetWriteWordHandler(0, dogyuunWriteWord); - SekSetWriteByteHandler(0, dogyuunWriteByte); - SekClose(); - - VezInit(0, V25_TYPE, 12500000 /*before divider*/); - VezOpen(0); - for (INT32 i = 0x80000; i < 0x100000; i += 0x8000) { - VezMapArea(i, i + 0x7fff, 0, ShareRAM); - VezMapArea(i, i + 0x7fff, 1, ShareRAM); - VezMapArea(i, i + 0x7fff, 2, ShareRAM); - } - VezSetReadHandler(dogyuun_v25_read); - VezSetWriteHandler(dogyuun_v25_write); - VezSetReadPort(dogyuun_v25_read_port); - VezSetDecode(nitro_decryption_table); - VezClose(); - } - - BurnYM2151Init(3375000); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 1041667 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - nSpriteXOffset = 0x0024; - nSpriteYOffset = 0x0001; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(2); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - ToaPalExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - VezExit(); - - BurnFree(Mem); - - MSM6295ROM = NULL; - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 10; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - VezNewFrame(); - - INT32 nSoundBufferPos = 0; - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)6250000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesDone[0] = 0; - nCyclesDone[1] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - VezOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - ToaBufferGP9001Sprites(); - - bVBlank = true; - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - // sound! (increase interleave?) - if (v25_reset) { - nCyclesDone[1] += nCyclesTotal[1] / nInterleave; - } else { - nCyclesDone[1] += VezRun(nCyclesTotal[1] / nInterleave); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - VezClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -struct BurnDriver BurnDrvDogyuun = { - "dogyuun", NULL, NULL, NULL, "1992", - "Dogyuun\0", NULL, "Toaplan", "Dual Toaplan GP9001 based", - L"Dogyuun\0Dogyuun \u30C9\u30AD\u30E5\u30FC\u30F3\uFF01\uFF01\0", NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, dogyuunRomInfo, dogyuunRomName, NULL, NULL, dogyuunInputInfo, dogyuunDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDogyuunk = { - "dogyuuna", "dogyuun", NULL, NULL, "1992", - "Dogyuun (Licensed to Unite Trading For Korea)\0", NULL, "Toaplan", "Dual Toaplan GP9001 based", - L"Dogyuun (Licensed to Unite Trading For Korea)\0Dogyuun \u30C9\u30AD\u30E5\u30FC\u30F3\uFF01\uFF01\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, dogyuunkRomInfo, dogyuunkRomName, NULL, NULL, dogyuunInputInfo, dogyuunkDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvDogyuunt = { - "dogyuunt", "dogyuun", NULL, NULL, "1992", - "Dogyuun (test location version)\0", NULL, "Toaplan", "Dual Toaplan GP9001 based", - L"Dogyuun (test location version)\0Dogyuun \u30C9\u30AD\u30E5\u30FC\u30F3\uFF01\uFF01\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, dogyuuntRomInfo, dogyuuntRomName, NULL, NULL, dogyuunInputInfo, dogyuuntDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_fixeight.cpp b/jan/src/burn/drv/toaplan/d_fixeight.cpp deleted file mode 100644 index b082778a2..000000000 --- a/jan/src/burn/drv/toaplan/d_fixeight.cpp +++ /dev/null @@ -1,1047 +0,0 @@ -// Based on MAME driver by Quench, Yochizo, David Haywood - -#include "toaplan.h" -#include "eeprom.h" -#include "nec_intf.h" - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[5] = {0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal; -static UINT8 *ShareRAM, *EEPROM; - -static const INT32 nColCount = 0x0800; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT32 v25_reset = 0; -static INT32 set_region = 0; - -static struct BurnInputInfo FixeightInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"P3 Coin", BIT_DIGITAL, DrvButton + 0, "p3 coin" }, - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 6, "p3 start" }, - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 0, "p3 up" }, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down" }, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 2, "p3 left" }, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 3, "p3 right" }, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" }, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Tilt", BIT_DIGITAL, DrvButton + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvInput + 4, "dip" }, -}; - -STDINPUTINFO(Fixeight) - -static struct BurnDIPInfo FixeightDIPList[]= -{ - {0x1a, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x1a, 0x01, 0x04, 0x00, "Off" }, - {0x1a, 0x01, 0x04, 0x04, "On" }, -}; - -STDDIPINFO(Fixeight) - -UINT8 __fastcall fixeightReadByte(UINT32 sekAddress) -{ - if ((sekAddress & 0xff0000) == 0x280000) { - return ShareRAM[(sekAddress >> 1) & 0x7fff]; - } - - if ((sekAddress & 0xff0000) == 0x600000) { - return ExtraTROM[(sekAddress & 0xFFFF) >> 1]; - } - - switch (sekAddress) { - - case 0x200001: // Player 1 inputs - return DrvInput[0]; - case 0x200005: // Player 2 inputs - return DrvInput[1]; - case 0x200009: // Player 3 inputs - return DrvInput[2]; - case 0x200011: // Other inputs - return (DrvInput[3] & ~0x04) | (DrvInput[4] & 0x04); - - case 0x30000d: - return ToaVBlankRegister(); - - //default: - // bprintf(0, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - return 0; -} - -UINT16 __fastcall fixeightReadWord(UINT32 sekAddress) -{ - if ((sekAddress & 0xff0000) == 0x280000) { - return ShareRAM[(sekAddress >> 1) & 0x7fff]; - } - - if ((sekAddress & 0xff0000) == 0x600000) { - return ExtraTROM[(sekAddress & 0xFFFF) >> 1] | (ExtraTROM[0x8000 + ((sekAddress & 0xFFFF) >> 1)] << 8); - } - - switch (sekAddress) { - - case 0x200000: // Player 1 inputs - return DrvInput[0]; - case 0x200004: // Player 2 inputs - return DrvInput[1]; - case 0x200008: // Player 3 inputs - return DrvInput[2]; - case 0x200010: // Other inputs - return (DrvInput[3] & ~0x04) | (DrvInput[4] & 0x04); - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x30000C: - return ToaVBlankRegister(); - - case 0x800000: - return ToaScanlineRegister(); - - //default: - // bprintf(0, _T("Attempt to read word value of location %x\n"), sekAddress); - } - return 0; -} - -void __fastcall fixeightWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if ((sekAddress & 0xff0000) == 0x280000) { - ShareRAM[(sekAddress >> 1) & 0x7fff] = byteValue; - return; - } - - if ((sekAddress & 0xff0000) == 0x600000) { - ExtraTROM[(sekAddress & 0xFFFF) >> 1] = byteValue; - return; - } - - switch (sekAddress) { - case 0x200019: // nop? - break; - - case 0x20001d: // coin counter - break; - - case 0x700000: - case 0x700001: - if (!v25_reset && (~byteValue & 0x08)) VezReset(); - v25_reset = (~byteValue & 0x08); - break; - - //default: - // bprintf(0, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); - } -} - -void __fastcall fixeightWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if ((sekAddress & 0xff0000) == 0x280000) { - ShareRAM[(sekAddress >> 1) & 0x7fff] = wordValue; - return; - } - - if ((sekAddress & 0xff0000) == 0x600000) { - ExtraTROM[(sekAddress & 0xFFFF) >> 1] = wordValue & 0xFF; - ExtraTROM[0x8000 + ((sekAddress & 0xFFFF) >> 1)] = wordValue << 8; - return; - } - - switch (sekAddress) { - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: - ToaGP9001WriteRegister(wordValue); - break; - - case 0x700000: - if (!v25_reset && (~wordValue & 0x08)) VezReset(); - v25_reset = (~wordValue & 0x08); - break; - - //default: - // bprintf(0, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -void __fastcall fixeight_v25_write(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x0000a: - BurnYM2151SelectRegister(data); - return; - - case 0x0000b: - BurnYM2151WriteRegister(data); - return; - - case 0x0000c: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall fixeight_v25_read(UINT32 address) -{ - switch (address) - { - case 0x00004: - return set_region; - - case 0x0000b: - return BurnYM2151ReadStatus(); - - case 0x0000c: - return MSM6295ReadStatus(0); - } - - return 0; -} - -UINT8 __fastcall fixeight_v25_read_port(UINT32 port) -{ - switch (port) - { - case V25_PORT_P0: - return EEPROMRead() ? 0x80 : 0x00; - } - - return 0; -} - -void __fastcall fixeight_v25_write_port(UINT32 port, UINT8 data) -{ - switch (port) - { - case V25_PORT_P0: - EEPROMWrite(data & 0x20, data & 0x10, data & 0x40); - return; - } -} - -static INT32 DrvExit() -{ - MSM6295Exit(0); - BurnYM2151Exit(); - - ToaPalExit(); - - ToaExtraTextExit(); - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - VezExit(); - - EEPROMExit(); - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - VezOpen(0); - VezReset(); - VezClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - EEPROMReset(); - if (!EEPROMAvailable()) { - EEPROMFill(EEPROM, 0, 0x80); - } - - v25_reset = 1; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - ToaExtraTextLayer(); // Render extra text layer - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 100; - INT32 nSoundBufferPos = 0; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - DrvInput[3] = 0x00; // Player 3 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvJoy3[i] & 1) << i; - DrvInput[3] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - VezNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)8000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesDone[0] = 0; - nCyclesDone[1] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - VezOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - - ToaBufferGP9001Sprites(); - - bVBlank = true; - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - // sound! (increase interleave?) - if (v25_reset) { - nCyclesDone[1] += nCyclesTotal[1] / nInterleave; - } else { - nCyclesDone[1] += VezRun(nCyclesTotal[1] / nInterleave); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - VezClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // - GP9001ROM[0] = Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - MSM6295ROM = Next; Next += 0x040000; - EEPROM = Next; Next += 0x000080; - RamStart = Next; - Ram01 = Next; Next += 0x004000; // CPU #0 work RAM - ExtraTROM = Next; Next += 0x010000; // Extra tile layer - ExtraTRAM = Next; Next += 0x002000; // Extra tile layer - ShareRAM = Next; Next += 0x010000; - ExtraTScroll = Next; Next += 0x001000; // - ExtraTSelect = Next; Next += 0x001000; // - RamPal = Next; Next += 0x001000; // palette - GP9001RAM[0] = Next; Next += 0x004000; - GP9001Reg[0] = (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 2, nGP9001ROMSize[0]); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROM, 3, 1); - -// BurnLoadRom(EEPROM, 4, 1); // dumped version - BurnLoadRom(EEPROM, 4, 1); // load over dumped version - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029497; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile data - struct BurnArea ba; - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - ba.Data = ShareRAM; - ba.nLen = 0x8000; - ba.szName = "Shared RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - VezScan(nAction); - - EEPROMScan(nAction, pnMin); - - MSM6295Scan(0, nAction); - BurnYM2151Scan(nAction); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(v25_reset); // level 2.5 savestate hung on load, - SCAN_VAR(set_region); // hoping this might fix it.. -dink - - bDrawScreen = true; - } - - return 0; -} - -static UINT8 ts001turbo_decryption_table[256] = { - 0x90,0x05,0x57,0x5f,0xfe,0x4f,0xbd,0x36, 0x80,0x8b,0x8a,0x0a,0x89,0x90,0x47,0x80, /* 00 */ - 0x22,0x90,0x90,0x5d,0x81,0x3c,0xb5,0x83, 0x68,0xff,0x75,0x75,0x8d,0x5b,0x8a,0x38, /* 10 */ - 0x8b,0xeb,0xd2,0x0a,0xb4,0xc7,0x46,0xd1, 0x0a,0x53,0xbd,0x90,0x22,0xff,0x1f,0x03, /* 20 */ - 0xfb,0x45,0xc3,0x02,0x90,0x0f,0x90,0x02, 0x0f,0xb7,0x90,0x24,0xc6,0xeb,0x1b,0x32, /* 30 */ - 0x8d,0xb9,0xfe,0x08,0x88,0x90,0x8a,0x8a, 0x75,0x8a,0xbd,0x58,0xfe,0x51,0x1e,0x8b, /* 40 */ - 0x0f,0x22,0xf6,0x90,0xc3,0x36,0x03,0x8d, 0xbb,0x16,0xbc,0x90,0x0f,0x5e,0xf9,0x2e, /* 50 */ - 0x90,0x90,0x59,0x90,0xbb,0x1a,0x0c,0x8d, 0x89,0x72,0x83,0xa4,0xc3,0xb3,0x8b,0xe9, /* 60 */ - 0x81,0x43,0xa0,0x2c,0x0f,0x55,0xf3,0x36, 0xb0,0x59,0xe8,0x03,0x26,0xe9,0x22,0xb0, /* 70 */ - 0x90,0x8e,0x24,0x8a,0xd0,0x3e,0xc3,0x3a, 0x90,0x79,0x57,0x16,0x88,0x86,0x24,0x74, /* 80 */ - 0x33,0xc3,0x53,0xb8,0xab,0x75,0x90,0x90, 0x8e,0xb1,0xe9,0x5d,0xf9,0x02,0x3c,0x90, /* 90 */ - 0x80,0xd3,0x89,0xe8,0x90,0x90,0x2a,0x74, 0x90,0x5f,0xf6,0x88,0x4f,0x56,0x8c,0x03, /* a0 */ - 0x47,0x90,0x88,0x90,0x03,0xfe,0x90,0xfc, 0x2a,0x90,0x33,0x07,0xb1,0x50,0x0f,0x3e, /* b0 */ - 0xbd,0x4d,0xf3,0xbf,0x59,0xd2,0xea,0xc6, 0x2a,0x74,0x72,0xe2,0x3e,0x2e,0x90,0x2e, /* c0 */ - 0x2e,0x73,0x88,0x72,0x45,0x5d,0xc1,0xb9, 0x32,0x38,0x88,0xc1,0xa0,0x06,0x45,0x90, /* d0 */ - 0x90,0x86,0x4b,0x87,0x90,0x8a,0x3b,0xab, 0x33,0xbe,0x90,0x32,0xbd,0xc7,0xb2,0x80, /* e0 */ - 0x0f,0x75,0xc0,0xb9,0x07,0x74,0x3e,0xa2, 0x8a,0x48,0x3e,0x8d,0xeb,0x90,0xfe,0x90, /* f0 */ -}; - -static INT32 DrvInit(INT32 region) -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x400000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x103FFF, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); // Palette RAM - SekMapMemory(ExtraTRAM, 0x500000, 0x501FFF, MAP_RAM); - SekMapMemory(ExtraTSelect, 0x502000, 0x502FFF, MAP_RAM); // 0x502000 - Scroll; 0x502200 - RAM - SekMapMemory(ExtraTScroll, 0x503000, 0x503FFF, MAP_RAM); // 0x203000 - Offset; 0x503200 - RAM - SekSetReadWordHandler(0, fixeightReadWord); - SekSetReadByteHandler(0, fixeightReadByte); - SekSetWriteWordHandler(0, fixeightWriteWord); - SekSetWriteByteHandler(0, fixeightWriteByte); - SekClose(); - - VezInit(0, V25_TYPE, 16000000 /*before divider*/); - VezOpen(0); - for (INT32 i = 0x80000; i < 0x100000; i += 0x8000) { - VezMapArea(i, i + 0x7fff, 0, ShareRAM); - VezMapArea(i, i + 0x7fff, 1, ShareRAM); - VezMapArea(i, i + 0x7fff, 2, ShareRAM); - } - VezSetReadHandler(fixeight_v25_read); - VezSetWriteHandler(fixeight_v25_write); - VezSetReadPort(fixeight_v25_read_port); - VezSetWritePort(fixeight_v25_write_port); - VezSetDecode(ts001turbo_decryption_table); - VezClose(); - } - - EEPROMInit(&eeprom_interface_93C46); - - set_region = region; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - nSpriteYOffset = 0x0001; - ToaInitGP9001(); - - ToaExtraTextInit(); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - BurnYM2151Init(27000000 / 8); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - - -// FixEight (Europe) - -static struct BurnRomInfo fixeightRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeight.nv", 0x000080, 0x02e925d0, BRF_PRG | BRF_ESS }, // 5 EEPROM -}; - -STD_ROM_PICK(fixeight) -STD_ROM_FN(fixeight) - -static INT32 fixeightInit() { return DrvInit(0x00); } - -struct BurnDriver BurnDrvFixeight = { - "fixeight", NULL, NULL, NULL, "1992", - "FixEight (Europe)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeightRomInfo, fixeightRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeightInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Korea, Taito license) - -static struct BurnRomInfo fixeightktRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeightkt.nv", 0x000080, 0x08fa73ba, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeightkt) -STD_ROM_FN(fixeightkt) - -static INT32 fixeightktInit() { return DrvInit(0x00); } - -struct BurnDriver BurnDrvFixeightkt = { - "fixeightkt", "fixeight", NULL, NULL, "1992", - "FixEight (Korea, Taito license)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeightktRomInfo, fixeightktRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeightktInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Korea) - -static struct BurnRomInfo fixeightkRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeightk.nv", 0x000080, 0xcac91c6f, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeightk) -STD_ROM_FN(fixeightk) - -static INT32 fixeightkInit() { return DrvInit(0x01); } - -struct BurnDriver BurnDrvFixeightk = { - "fixeightk", "fixeight", NULL, NULL, "1992", - "FixEight (Korea)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeightkRomInfo, fixeightkRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeightkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Hong Kong, Taito license) - -static struct BurnRomInfo fixeighthtRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeightht.nv", 0x000080, 0x57edaa51, BRF_PRG | BRF_ESS }, // 5 EEPROM -}; - -STD_ROM_PICK(fixeightht) -STD_ROM_FN(fixeightht) - -static INT32 fixeighthtInit() { return DrvInit(0x02); } - -struct BurnDriver BurnDrvFixeightht = { - "fixeightht", "fixeight", NULL, NULL, "1992", - "FixEight (Hong Kong, Taito license)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeighthtRomInfo, fixeighthtRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeighthtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Hong Kong) - -static struct BurnRomInfo fixeighthRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeighth.nv", 0x000080, 0x95dec584, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeighth) -STD_ROM_FN(fixeighth) - -static INT32 fixeighthInit() { return DrvInit(0x03); } - -struct BurnDriver BurnDrvFixeighth = { - "fixeighth", "fixeight", NULL, NULL, "1992", - "FixEight (Hong Kong)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeighthRomInfo, fixeighthRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeighthInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Taiwan, Taito license) - -static struct BurnRomInfo fixeighttwtRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeighttwt.nv", 0x000080, 0xb6d5c06c, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeighttwt) -STD_ROM_FN(fixeighttwt) - -static INT32 fixeighttwtInit() { return DrvInit(0x04); } - -struct BurnDriver BurnDrvFixeighttwt = { - "fixeighttwt", "fixeight", NULL, NULL, "1992", - "FixEight (Taiwan, Taito license)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeighttwtRomInfo, fixeighttwtRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeighttwtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Taiwan) - -static struct BurnRomInfo fixeighttwRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeighttw.nv", 0x000080, 0x74e6afb9, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeighttw) -STD_ROM_FN(fixeighttw) - -static INT32 fixeighttwInit() { return DrvInit(0x05); } - -struct BurnDriver BurnDrvFixeighttw = { - "fixeighttw", "fixeight", NULL, NULL, "1992", - "FixEight (Taiwan)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeighttwRomInfo, fixeighttwRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeighttwInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - - -// FixEight (Southeast Asia, Taito license) - -static struct BurnRomInfo fixeightatRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeightat.nv", 0x000080, 0xe9c21987, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeightat) -STD_ROM_FN(fixeightat) - -static INT32 fixeightatInit() { return DrvInit(0x06); } - -struct BurnDriver BurnDrvFixeightat = { - "fixeightat", "fixeight", NULL, NULL, "1992", - "FixEight (Southeast Asia, Taito license)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeightatRomInfo, fixeightatRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeightatInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Southeast Asia) - -static struct BurnRomInfo fixeightaRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeighta.nv", 0x000080, 0x2bf17652, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeighta) -STD_ROM_FN(fixeighta) - -static INT32 fixeightaInit() { return DrvInit(0x07); } - -struct BurnDriver BurnDrvFixeighta = { - "fixeighta", "fixeight", NULL, NULL, "1992", - "FixEight (Southeast Asia)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeightaRomInfo, fixeightaRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeightaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Europe, Taito license) - -static struct BurnRomInfo fixeighttRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeightt.nv", 0x000080, 0xc0da4a05, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeightt) -STD_ROM_FN(fixeightt) - -static INT32 fixeighttInit() { return DrvInit(0x08); } - -struct BurnDriver BurnDrvFixeightt = { - "fixeightt", "fixeight", NULL, NULL, "1992", - "FixEight (Europe, Taito license)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeighttRomInfo, fixeighttRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeighttInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (USA, Taito license) - -static struct BurnRomInfo fixeightutRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeightut.nv", 0x000080, 0x9fcd93ee, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeightut) -STD_ROM_FN(fixeightut) - -static INT32 fixeightutInit() { return DrvInit(0x0a); } - -struct BurnDriver BurnDrvFixeightut = { - "fixeightut", "fixeight", NULL, NULL, "1992", - "FixEight (USA, Taito license)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeightutRomInfo, fixeightutRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeightutInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (USA) - -static struct BurnRomInfo fixeightuRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeightu.nv", 0x000080, 0x5dfefc3b, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeightu) -STD_ROM_FN(fixeightu) - -static INT32 fixeightuInit() { return DrvInit(0x0b); } - -struct BurnDriver BurnDrvFixeightu = { - "fixeightu", "fixeight", NULL, NULL, "1992", - "FixEight (USA)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeightuRomInfo, fixeightuRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeightuInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Japan, Taito license) - -static struct BurnRomInfo fixeightjtRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeightjt.nv", 0x000080, 0xe3d14fed, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeightjt) -STD_ROM_FN(fixeightjt) - -static INT32 fixeightjtInit() { return DrvInit(0x0e); } - -struct BurnDriver BurnDrvFixeightjt = { - "fixeightjt", "fixeight", NULL, NULL, "1992", - "FixEight (Japan, Taito license)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeightjtRomInfo, fixeightjtRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeightjtInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// FixEight (Japan) - -static struct BurnRomInfo fixeightjRomDesc[] = { - { "tp-026-1", 0x080000, 0xf7b1746a, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - - { "tp-026-3", 0x200000, 0xe5578d98, BRF_GRA }, // 1 GP9001 Tile data - { "tp-026-4", 0x200000, 0xb760cb53, BRF_GRA }, // 2 - - { "tp-026-2", 0x040000, 0x85063f1f, BRF_SND }, // 3 MSM6295 ADPCM data - -// { "93c45.u23", 0x000080, 0xea419312, BRF_PRG | BRF_ESS }, // 4 EEPROM (dumped) - { "fixeightj.nv", 0x000080, 0x21e22038, BRF_PRG | BRF_ESS }, // 5 -}; - -STD_ROM_PICK(fixeightj) -STD_ROM_FN(fixeightj) - -static INT32 fixeightjInit() { return DrvInit(0x0f); } - -struct BurnDriver BurnDrvFixeightj = { - "fixeightj", "fixeight", NULL, NULL, "1992", - "FixEight (Japan)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 3, HARDWARE_TOAPLAN_68K_Zx80, GBF_SHOOT, 0, - NULL, fixeightjRomInfo, fixeightjRomName, NULL, NULL, FixeightInputInfo, FixeightDIPInfo, - fixeightjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - diff --git a/jan/src/burn/drv/toaplan/d_ghox.cpp b/jan/src/burn/drv/toaplan/d_ghox.cpp deleted file mode 100644 index 8c78b98fb..000000000 --- a/jan/src/burn/drv/toaplan/d_ghox.cpp +++ /dev/null @@ -1,889 +0,0 @@ -// Based on MAME driver by Quench, Yochizo, David Haywood - -#include "toaplan.h" -#include "samples.h" - -#define REFRESHRATE 60 -#define VBLANK_LINES (32) - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0, 0, 0, 0, 0, 0}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal; -static UINT8 *ShareRAM; - -static INT8 Paddle[2]; -static INT8 PaddleOld[2]; - -static INT32 nColCount = 0x0800; - -static struct BurnInputInfo GhoxInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvButton + 0, "service"}, - {"Tilt", BIT_DIGITAL, DrvButton + 1, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(Ghox) - -static struct BurnDIPInfo GhoxDIPList[]= -{ - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0xf2, NULL }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x13, 0x01, 0x01, 0x00, "Off" }, - {0x13, 0x01, 0x01, 0x01, "On" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Coin A" }, - {0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Hardest" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - {0x14, 0x01, 0x0c, 0x08, "100k only" }, - {0x14, 0x01, 0x0c, 0x04, "100k and 300k" }, - {0x14, 0x01, 0x0c, 0x00, "100k and every 200k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "1" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Unused" }, - {0x14, 0x01, 0x80, 0x00, "Off" }, - {0x14, 0x01, 0x80, 0x80, "On" }, - - {0 , 0xfe, 0 , 14, "Region" }, - {0x15, 0x01, 0x0f, 0x02, "Europe" }, - {0x15, 0x01, 0x0f, 0x0a, "Europe (Nova Apparate GMBH & Co)" }, - {0x15, 0x01, 0x0f, 0x0d, "Europe (Taito Corporation Japan)" }, - {0x15, 0x01, 0x0f, 0x01, "USA" }, - {0x15, 0x01, 0x0f, 0x09, "USA (Romstar)" }, - {0x15, 0x01, 0x0f, 0x0b, "USA (Taito America Corporation)" }, - {0x15, 0x01, 0x0f, 0x0c, "USA (Taito Corporation Japan)" }, - {0x15, 0x01, 0x0f, 0x00, "Japan" }, - {0x15, 0x01, 0x0f, 0x04, "Korea" }, - {0x15, 0x01, 0x0f, 0x03, "Hong Kong (Honest Trading Co.)" }, - {0x15, 0x01, 0x0f, 0x05, "Taiwan" }, - {0x15, 0x01, 0x0f, 0x06, "Spain & Portugal (APM Electronics SA)" }, - {0x15, 0x01, 0x0f, 0x07, "Italy (Star Electronica SRL)" }, - {0x15, 0x01, 0x0f, 0x08, "UK (JP Leisure Ltd)" }, -}; - -STDDIPINFO(Ghox) - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x040000; // 68000 ROM - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - RamStart = Next; - Ram01 = Next; Next += 0x004000; // CPU #0 work RAM - ShareRAM = Next; Next += 0x001000; - RamPal = Next; Next += 0x001000; // palette - GP9001RAM[0]= Next; Next += 0x008000; // Double size, as the game tests too much memory during POST - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020997; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - ToaScanGP9001(nAction, pnMin); -#ifdef TOAPLAN_SOUND_SAMPLES_HACK - BurnSampleScan(nAction, pnMin); -#endif - ToaRecalcPalette = 1; - bDrawScreen = true; // get background back ? - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - ToaLoadCode(Rom01, 0, 2); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 2, 2, nGP9001ROMSize[0]); - - return 0; -} - -#ifdef TOAPLAN_SOUND_SAMPLES_HACK -static void StopAllSamples() -{ - for (INT32 i = 0x00; i <= 79; i++) { - BurnSampleStop(i); - } -} - -static void StopSamplesChannel0() -{ - BurnSampleStop(0x00); - BurnSampleSetLoop(0x00, 0); - BurnSampleStop(0x42); - BurnSampleSetLoop(0x42, 0); - BurnSampleStop(0x44); - BurnSampleSetLoop(0x44, 0); - BurnSampleStop(0x45); - BurnSampleSetLoop(0x45, 0); - BurnSampleStop(0x47); - BurnSampleSetLoop(0x47, 0); - BurnSampleStop(0x48); - BurnSampleSetLoop(0x48, 0); - BurnSampleStop(0x49); - BurnSampleSetLoop(0x49, 0); - BurnSampleStop(0x4c); - BurnSampleSetLoop(0x4c, 0); - BurnSampleStop(0x4d); - BurnSampleSetLoop(0x4d, 0); - BurnSampleStop(0x4e); - BurnSampleSetLoop(0x4e, 0); - BurnSampleStop(0x4f); - BurnSampleSetLoop(0x4f, 0); -} - -static void StopSamplesChannel1() -{ - for (INT32 i = 0x02; i <= 0x0f; i++) { - BurnSampleStop(i); - } -} - -static void StopSamplesChannel2() -{ - for (INT32 i = 0x10; i <= 0x17; i++) { - BurnSampleStop(i); - } -} - -static void StopSamplesChannel3() -{ - for (INT32 i = 0x18; i <= 0x1f; i++) { - BurnSampleStop(i); - } -} - -static void StopSamplesChannel4() -{ - for (INT32 i = 0x20; i <= 0x27; i++) { - BurnSampleStop(i); - } -} - -static void StopSamplesChannel5() -{ - for (INT32 i = 0x28; i <= 0x2f; i++) { - BurnSampleStop(i); - } -} - -static void StopSamplesChannel6() -{ - for (INT32 i = 0x30; i <= 0x38; i++) { - BurnSampleStop(i); - } -} - -static void StopSamplesChannel7() -{ - for (INT32 i = 0x3a; i <= 0x3f; i++) { - BurnSampleStop(i); - } -} - -static void StopSamplesChannel8() -{ - BurnSampleStop(0x01); - BurnSampleStop(0x39); -} - -static void ghoxSoundCmd(UINT16 d) -{ - if (d == 0xfe) { - StopSamplesChannel0(); - } - - if (d == 0x42 || d == 0x44 || d == 0x45 || d == 0x47 || d == 0x48 || d == 0x4c || d == 0x4d || d == 0x4e) { - StopSamplesChannel0(); - BurnSampleSetLoop(d, 1); - BurnSamplePlay(d); - } - - if (d == 0xd0) { - StopSamplesChannel0(); - BurnSampleSetLoop(0, 1); - BurnSamplePlay(0); - } - - if (d == 0x49) { - StopSamplesChannel0(); - BurnSamplePlay(d); - } - - if (d >= 0x02 && d <= 0x0f) { - StopSamplesChannel1(); - BurnSamplePlay(d); - } - - if (d >= 0x10 && d <= 0x17) { - StopSamplesChannel2(); - BurnSamplePlay(d); - } - - if (d >= 0x18 && d <= 0x1f) { - StopSamplesChannel3(); - BurnSamplePlay(d); - } - - if (d >= 0x20 && d <= 0x27) { - StopSamplesChannel4(); - BurnSamplePlay(d); - } - - if (d >= 0x28 && d <= 0x2f) { - StopSamplesChannel5(); - BurnSamplePlay(d); - } - - if (d >= 0x30 && d <= 0x38) { - StopSamplesChannel6(); - BurnSamplePlay(d); - } - - if (d == 0x39) { - StopSamplesChannel8(); - BurnSamplePlay(d); - } - - if (d >= 0x3a && d <= 0x3f) { - StopSamplesChannel7(); - BurnSamplePlay(d); - } - - if (d == 0x01) { - StopSamplesChannel8(); - BurnSamplePlay(d); - } - - if (d == 0x4b) { - StopSamplesChannel0(); - BurnSamplePlay(0x4f); - } -} -#endif - -UINT8 PaddleRead(UINT8 Num) -{ - INT8 Value; - - if (Paddle[Num] == PaddleOld[Num]) return 0; - - Value = Paddle[Num] - PaddleOld[Num]; - PaddleOld[Num] = Paddle[Num]; - return Value; -} - -UINT8 __fastcall ghoxReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x18000d: // Player 1 inputs - return DrvInput[0]; - case 0x18000f: // Player 2 inputs - return DrvInput[1]; - case 0x180011: // Other inputs - return DrvInput[2]; - - case 0x180007: // Dipswitch 1 - return DrvInput[3]; - case 0x180009: // Dipswitch 2 - return DrvInput[4]; - case 0x18100d: // Dipswitch 3 - Territory - return DrvInput[5]&0x0f; - - case 0x14000D: // VBlank - return ToaVBlankRegister(); - - case 0x040000: - case 0x040001: - return PaddleRead(1); - - case 0x100000: - case 0x100001: - return PaddleRead(0); - - case 0x180000: - case 0x180001: - return 0xff; - -// default: -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - - if ((sekAddress & 0xfff000) == 0x180000) { - return ShareRAM[(sekAddress >> 1) & 0x7ff]; - } - - return 0; -} - -UINT16 __fastcall ghoxReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x18000c: // Player 1 inputs - return DrvInput[0]; - case 0x18000e: // Player 2 inputs - return DrvInput[1]; - case 0x180010: // Other inputs - return DrvInput[2]; - - case 0x180006: // Dipswitch 1 - return DrvInput[3]; - case 0x180008: // Dipswitch 2 - return DrvInput[4]; - case 0x18100c: // Dipswitch 3 - Territory - return DrvInput[5]&0x0f; - - case 0x140004: - return ToaGP9001ReadRAM_Hi(0); - case 0x140006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x14000C: - return ToaVBlankRegister(); - - case 0x040000: - return PaddleRead(1); - - case 0x100000: - return PaddleRead(0); - - case 0x180000: - case 0x180001: - return 0xffff; - -// default: -// printf("Attempt to read word value of location %x\n", sekAddress); - } - - if ((sekAddress & 0xfff000) == 0x180000) { - return ShareRAM[(sekAddress >> 1) & 0x7ff]; - } - - return 0; -} - -static void ghox_mcu_write(INT32 data) -{ -#ifdef TOAPLAN_SOUND_SAMPLES_HACK - ghoxSoundCmd(data); -#endif - - if ((data >= 0xd0) && (data < 0xe0)) - { - INT32 offset = ((data & 0x0f) * 2) + (0x38 / 2); - ShareRAM[(0x500 / 2) + offset ] = 0x05; // Return address for - ShareRAM[(0x500 / 2) + offset-1] = 0x56; // RTS instruction - } - if (data == 0xd3) { - static const UINT8 prot_data[0x10] = { - 0x3a, 0x01, 0x08, 0x85, 0x00, 0x00, 0xcb, 0xfc, - 0x00, 0x03, 0x90, 0x45, 0xe5, 0x09, 0x4e, 0x75 - }; - - memcpy (ShareRAM + (0x556 / 2), prot_data, 0x10); - } else { - ShareRAM[0x556 / 2] = 0x4e; // Return an RTS instruction - ShareRAM[0x558 / 2] = 0x75; - } -} - -void __fastcall ghoxWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x180001: - ghox_mcu_write(byteValue); - break; - - // default: - // printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - - if ((sekAddress & 0xfff000) == 0x180000) { - ShareRAM[(sekAddress >> 1) & 0x7ff] = byteValue; - return; - } -} - -void __fastcall ghoxWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x140000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x140004: - ToaGP9001WriteRAM(wordValue, 0); - break; - case 0x140006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x140008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x14000C: - ToaGP9001WriteRegister(wordValue); - break; - - case 0x180000: - ghox_mcu_write(wordValue); - break; - -// default: -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } - - if ((sekAddress & 0xfff000) == 0x180000) { - ShareRAM[(sekAddress >> 1) & 0x7ff] = wordValue; - return; - } -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - BurnSampleReset(); -#ifdef TOAPLAN_SOUND_SAMPLES_HACK - StopAllSamples(); -#endif - - Paddle[0] = 0; - PaddleOld[0] = 0; - Paddle[1] = 0; - PaddleOld[1] = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = false; -#endif - - BurnSetRefreshRate(REFRESHRATE); - - nGP9001ROMSize[0] = 0x100000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x03FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x080000, 0x083FFF, MAP_RAM); - SekMapMemory(RamPal, 0x0c0000, 0x0c0FFF, MAP_RAM); // Palette RAM - SekSetReadWordHandler(0, ghoxReadWord); - SekSetReadByteHandler(0, ghoxReadByte); - SekSetWriteWordHandler(0, ghoxWriteWord); - SekSetWriteByteHandler(0, ghoxWriteByte); - SekClose(); - } - - nToa1Cycles68KSync = 0; - - nSpriteYOffset = 0x0001; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - -#ifdef TOAPLAN_SOUND_SAMPLES_HACK - BurnUpdateProgress(0.0, _T("Loading samples..."), 0); - - BurnSampleInit(0); - BurnSampleSetAllRoutesAllSamples(1.00, BURN_SND_ROUTE_BOTH); -#endif - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - ToaPalExit(); - - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - BurnSampleExit(); - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInput, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - if (DrvJoy1[2]) Paddle[0] -= 0x04; - if (DrvJoy1[3]) Paddle[0] += 0x04; - if (DrvJoy2[2]) Paddle[1] -= 0x04; - if (DrvJoy2[3]) Paddle[1] += 0x04; - - SekNewFrame(); - - SekOpen(0); - - SekIdle(nCyclesDone[0]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); - } - - ToaBufferGP9001Sprites(); - - bVBlank = true; - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (bVBlank || (!CheckSleep(0))) { - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - } - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - - if (pBurnSoundOut) { - BurnSampleRender(pBurnSoundOut, nBurnSoundLen); - } - -// bprintf(PRINT_NORMAL, _T(" %i\n"), nCyclesDone[0]); - -// ToaBufferFCU2Sprites(); - - SekClose(); - - return 0; -} - -static struct BurnSampleInfo ghoxSampleDesc[] = { -#ifdef TOAPLAN_SOUND_SAMPLES_HACK -#if !defined ROM_VERIFY - { "d0", SAMPLE_NOLOOP }, - { "01", SAMPLE_NOLOOP }, - { "02", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "04", SAMPLE_NOLOOP }, - { "05", SAMPLE_NOLOOP }, - { "06", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "08", SAMPLE_NOLOOP }, - { "09", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "0b", SAMPLE_NOLOOP }, - { "0c", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "0f", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "11", SAMPLE_NOLOOP }, - { "12", SAMPLE_NOLOOP }, - { "12", SAMPLE_NOLOOP }, - { "14", SAMPLE_NOLOOP }, - { "15", SAMPLE_NOLOOP }, - { "16", SAMPLE_NOLOOP }, - { "17", SAMPLE_NOLOOP }, - { "18", SAMPLE_NOLOOP }, - { "19", SAMPLE_NOLOOP }, - { "1a", SAMPLE_NOLOOP }, - { "1b", SAMPLE_NOLOOP }, - { "1c", SAMPLE_NOLOOP }, - { "1c", SAMPLE_NOLOOP }, - { "1c", SAMPLE_NOLOOP }, - { "1f", SAMPLE_NOLOOP }, - { "20", SAMPLE_NOLOOP }, - { "21", SAMPLE_NOLOOP }, - { "22", SAMPLE_NOLOOP }, - { "23", SAMPLE_NOLOOP }, - { "24", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "27", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "2a", SAMPLE_NOLOOP }, - { "2b", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "2d", SAMPLE_NOLOOP }, - { "2e", SAMPLE_NOLOOP }, - { "2f", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "33", SAMPLE_NOLOOP }, - { "34", SAMPLE_NOLOOP }, - { "35", SAMPLE_NOLOOP }, - { "36", SAMPLE_NOLOOP }, - { "37", SAMPLE_NOLOOP }, - { "38", SAMPLE_NOLOOP }, - { "39", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "3c", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "3e", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "42", SAMPLE_NOLOOP }, - { "43", SAMPLE_NOLOOP }, - { "44", SAMPLE_NOLOOP }, - { "45", SAMPLE_NOLOOP }, - { "43", SAMPLE_NOLOOP }, - { "47", SAMPLE_NOLOOP }, - { "48", SAMPLE_NOLOOP }, - { "49", SAMPLE_NOLOOP }, - { "43", SAMPLE_NOLOOP }, - { "dm", SAMPLE_NOLOOP }, - { "4c", SAMPLE_NOLOOP }, - { "4d", SAMPLE_NOLOOP }, - { "4e", SAMPLE_NOLOOP }, - { "d1", SAMPLE_NOLOOP }, -#endif -#endif - { "", 0 } -}; - -STD_SAMPLE_PICK(ghox) -STD_SAMPLE_FN(ghox) - - -// Ghox (spinner) - -static struct BurnRomInfo ghoxRomDesc[] = { - { "tp021-01.u10", 0x20000, 0x9e56ac67, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "tp021-02.u11", 0x20000, 0x15cac60f, BRF_PRG | BRF_ESS }, // 1 - - { "tp021-03.u36", 0x80000, 0xa15d8e9d, BRF_GRA }, // 2 GP9001 Tile data - { "tp021-04.u37", 0x80000, 0x26ed1c9a, BRF_GRA }, // 3 - - { "hd647180.021", 0x08000, 0x00000000, BRF_NODUMP }, // 4 CPU #1 code -}; - -STD_ROM_PICK(ghox) -STD_ROM_FN(ghox) - -struct BurnDriver BurnDrvGhox = { - "ghox", NULL, NULL, "ghox", "1991", - "Ghox (spinner)\0", "No Sound (undumped MCU)", "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_BREAKOUT, 0, - NULL, ghoxRomInfo, ghoxRomName, ghoxSampleInfo, ghoxSampleName, GhoxInputInfo, GhoxDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Ghox (joystick) - -static struct BurnRomInfo ghoxjRomDesc[] = { - { "tp021-01a.u10", 0x20000, 0xc11b13c8, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "tp021-02a.u11", 0x20000, 0x8d426767, BRF_PRG | BRF_ESS }, // 1 - - { "tp021-03.u36", 0x80000, 0xa15d8e9d, BRF_GRA }, // 2 GP9001 Tile data - { "tp021-04.u37", 0x80000, 0x26ed1c9a, BRF_GRA }, // 3 - - { "hd647180.021", 0x08000, 0x00000000, BRF_NODUMP }, // 4 CPU #1 code -}; - -STD_ROM_PICK(ghoxj) -STD_ROM_FN(ghoxj) - -struct BurnDriver BurnDrvGhoxj = { - "ghoxj", "ghox", NULL, "ghox", "1991", - "Ghox (joystick)\0", "No Sound (undumped MCU)", "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_BREAKOUT, 0, - NULL, ghoxjRomInfo, ghoxjRomName, ghoxSampleInfo, ghoxSampleName, GhoxInputInfo, GhoxDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_hellfire.cpp b/jan/src/burn/drv/toaplan/d_hellfire.cpp deleted file mode 100644 index 27e21b5f4..000000000 --- a/jan/src/burn/drv/toaplan/d_hellfire.cpp +++ /dev/null @@ -1,828 +0,0 @@ -// Hell Fire -// Based on MAME driver by Darren Olafson, Quench,Stephane Humbert - -#include "toaplan.h" - -#define REFRESHRATE 60 -#define VBLANK_LINES (32) - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static bool bEnableInterrupts; - -// Rom information -static struct BurnRomInfo hellfireRomDesc[] = { - { "b90_14.0", 0x020000, 0x101df9f5, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "b90_15.1", 0x020000, 0xe67fd452, BRF_ESS | BRF_PRG }, // 1 - - { "b90_04.3", 0x020000, 0xea6150fc, BRF_GRA }, // 6 - { "b90_05.4", 0x020000, 0xbb52c507, BRF_GRA }, // 7 - { "b90_06.5", 0x020000, 0xcf5b0252, BRF_GRA }, // 8 - { "b90_07.6", 0x020000, 0xb98af263, BRF_GRA }, // 9 - - { "b90_11.10", 0x020000, 0xc33e543c, BRF_GRA }, // 2 - { "b90_10.9", 0x020000, 0x35fd1092, BRF_GRA }, // 3 - { "b90_09.8", 0x020000, 0xcf01009e, BRF_GRA }, // 4 - { "b90_08.7", 0x020000, 0x3404a5e3, BRF_GRA }, // 5 - - { "b90_03.2", 0x008000, 0x4058fa67, BRF_ESS | BRF_PRG }, // 10 Z80 program - - { "13.3w", 0x000020, 0xbc88cced, BRF_SND }, // 11 Sprite attribute PROM - { "12.6b", 0x000020, 0xa1e17492, BRF_SND }, // 12 ??? -}; - -STD_ROM_PICK(hellfire) -STD_ROM_FN(hellfire) - -static struct BurnRomInfo hellfir1RomDesc[] = { - { "b90_14x.0", 0x020000, 0xa3141ea5, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "b90_15x.1", 0x020000, 0xe864daf4, BRF_ESS | BRF_PRG }, // 1 - - { "b90_04.3", 0x020000, 0xea6150fc, BRF_GRA }, // 6 - { "b90_05.4", 0x020000, 0xbb52c507, BRF_GRA }, // 7 - { "b90_06.5", 0x020000, 0xcf5b0252, BRF_GRA }, // 8 - { "b90_07.6", 0x020000, 0xb98af263, BRF_GRA }, // 9 - - { "b90_11.10", 0x020000, 0xc33e543c, BRF_GRA }, // 2 - { "b90_10.9", 0x020000, 0x35fd1092, BRF_GRA }, // 3 - { "b90_09.8", 0x020000, 0xcf01009e, BRF_GRA }, // 4 - { "b90_08.7", 0x020000, 0x3404a5e3, BRF_GRA }, // 5 - - { "b90_03x.2", 0x008000, 0xf58c368f, BRF_ESS | BRF_PRG }, // 10 Z80 program - - { "13.3w", 0x000020, 0xbc88cced, BRF_SND }, // 11 Sprite attribute PROM - { "12.6b", 0x000020, 0xa1e17492, BRF_SND }, // 12 ??? -}; - -STD_ROM_PICK(hellfir1) -STD_ROM_FN(hellfir1) - -static struct BurnRomInfo hellfir2RomDesc[] = { - { "b90_01.0", 0x020000, 0xc94acf53, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "b90_02.1", 0x020000, 0xd17f03c3, BRF_ESS | BRF_PRG }, // 1 - - { "b90_04.3", 0x020000, 0xea6150fc, BRF_GRA }, // 6 - { "b90_05.4", 0x020000, 0xbb52c507, BRF_GRA }, // 7 - { "b90_06.5", 0x020000, 0xcf5b0252, BRF_GRA }, // 8 - { "b90_07.6", 0x020000, 0xb98af263, BRF_GRA }, // 9 - - { "b90_11.10", 0x020000, 0xc33e543c, BRF_GRA }, // 2 - { "b90_10.9", 0x020000, 0x35fd1092, BRF_GRA }, // 3 - { "b90_09.8", 0x020000, 0xcf01009e, BRF_GRA }, // 4 - { "b90_08.7", 0x020000, 0x3404a5e3, BRF_GRA }, // 5 - - { "b90_03x.2", 0x008000, 0xf58c368f, BRF_ESS | BRF_PRG }, // 10 Z80 program - - { "13.3w", 0x000020, 0xbc88cced, BRF_SND }, // 11 Sprite attribute PROM - { "12.6b", 0x000020, 0xa1e17492, BRF_SND }, // 12 ??? -}; - -STD_ROM_PICK(hellfir2) -STD_ROM_FN(hellfir2) - -static struct BurnRomInfo hellfir3RomDesc[] = { - { "b90_01.10m", 0x020000, 0x034966d3, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "b90_02.9m", 0x020000, 0x06dd24c7, BRF_ESS | BRF_PRG }, // 1 - - { "b90_04.3", 0x020000, 0xea6150fc, BRF_GRA }, // 6 - { "b90_05.4", 0x020000, 0xbb52c507, BRF_GRA }, // 7 - { "b90_06.5", 0x020000, 0xcf5b0252, BRF_GRA }, // 8 - { "b90_07.6", 0x020000, 0xb98af263, BRF_GRA }, // 9 - - { "b90_11.10", 0x020000, 0xc33e543c, BRF_GRA }, // 2 - { "b90_10.9", 0x020000, 0x35fd1092, BRF_GRA }, // 3 - { "b90_09.8", 0x020000, 0xcf01009e, BRF_GRA }, // 4 - { "b90_08.7", 0x020000, 0x3404a5e3, BRF_GRA }, // 5 - - { "b90_03.2", 0x008000, 0x4058fa67, BRF_ESS | BRF_PRG }, // 10 Z80 program - - { "13.3w", 0x000020, 0xbc88cced, BRF_SND }, // 11 Sprite attribute PROM - { "12.6b", 0x000020, 0xa1e17492, BRF_SND }, // 12 ??? -}; - -STD_ROM_PICK(hellfir3) -STD_ROM_FN(hellfir3) - -static struct BurnInputInfo hellfireInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 2, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(hellfire) - -static struct BurnDIPInfo hellfireDIPList[] = { - // Defaults - {0x12, 0xFF, 0xFF, 0x00, NULL}, - {0x13, 0xFF, 0xFF, 0x00, NULL}, - {0x14, 0xFF, 0xFF, 0x02, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Screen type"}, - {0x12, 0x01, 0x02, 0x00, "Normal screen"}, - {0x12, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x12, 0x01, 0x04, 0x00, "Normal mode"}, - {0x12, 0x01, 0x04, 0x04, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x12, 0x01, 0x08, 0x00, "On"}, - {0x12, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x12, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x12, 0x01, 0x30, 0x10, "2 coin 1 play"}, - {0x12, 0x01, 0x30, 0x20, "3 coin 1 play"}, - {0x12, 0x01, 0x30, 0x30, "4 coin 1 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x12, 0x01, 0xC0, 0x00, "1 coin 2 play"}, - {0x12, 0x01, 0xC0, 0x40, "1 coin 3 play"}, - {0x12, 0x01, 0xC0, 0x80, "1 coin 4 play"}, - {0x12, 0x01, 0xC0, 0xC0, "1 coin 6 play"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x13, 0x01, 0x03, 0x00, "B"}, - {0x13, 0x01, 0x03, 0x01, "A"}, - {0x13, 0x01, 0x03, 0x02, "C"}, - {0x13, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x13, 0x01, 0x0C, 0x00, "70000, every 200000"}, - {0x13, 0x01, 0x0C, 0x04, "100000, every 250000"}, - {0x13, 0x01, 0x0C, 0x08, "100000 only"}, - {0x13, 0x01, 0x0C, 0x0C, "200000 only"}, - {0, 0xFE, 0, 4, "Hero counts"}, - {0x13, 0x01, 0x30, 0x30, "2"}, - {0x13, 0x01, 0x30, 0x00, "3"}, - {0x13, 0x01, 0x30, 0x20, "4"}, - {0x13, 0x01, 0x30, 0x10, "5"}, - {0, 0xFE, 0, 2, "Cheating"}, - {0x13, 0x01, 0x40, 0x00, "Normal Game"}, - {0x13, 0x01, 0x40, 0x40, "No death & stop mode"}, - - // Region - {0, 0xFE, 0, 3, "Region"}, - {0x14, 0x01, 0x03, 0x00, "Japan"}, - {0x14, 0x01, 0x03, 0x01, "US"}, - {0x14, 0x01, 0x03, 0x02, "Europe"}, -}; - -STDDIPINFO(hellfire) - -static struct BurnDIPInfo hellfir1DIPList[] = { - // Defaults - {0x12, 0xFF, 0xFF, 0x01, NULL}, - {0x13, 0xFF, 0xFF, 0x00, NULL}, - {0x14, 0xFF, 0xFF, 0x02, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Cabinet"}, - {0x12, 0x01, 0x01, 0x01, "Upright"}, - {0x12, 0x01, 0x01, 0x00, "Cocktail"}, - {0, 0xFE, 0, 2, "Screen type"}, - {0x12, 0x01, 0x02, 0x00, "Normal screen"}, - {0x12, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x12, 0x01, 0x04, 0x00, "Normal mode"}, - {0x12, 0x01, 0x04, 0x04, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x12, 0x01, 0x08, 0x00, "On"}, - {0x12, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x12, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x12, 0x01, 0x30, 0x10, "2 coin 1 play"}, - {0x12, 0x01, 0x30, 0x20, "3 coin 1 play"}, - {0x12, 0x01, 0x30, 0x30, "4 coin 1 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x12, 0x01, 0xC0, 0x00, "1 coin 2 play"}, - {0x12, 0x01, 0xC0, 0x40, "1 coin 3 play"}, - {0x12, 0x01, 0xC0, 0x80, "1 coin 4 play"}, - {0x12, 0x01, 0xC0, 0xC0, "1 coin 6 play"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x13, 0x01, 0x03, 0x00, "B"}, - {0x13, 0x01, 0x03, 0x01, "A"}, - {0x13, 0x01, 0x03, 0x02, "C"}, - {0x13, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x13, 0x01, 0x0C, 0x00, "70000, every 200000"}, - {0x13, 0x01, 0x0C, 0x04, "100000, every 250000"}, - {0x13, 0x01, 0x0C, 0x08, "100000 only"}, - {0x13, 0x01, 0x0C, 0x0C, "200000 only"}, - {0, 0xFE, 0, 4, "Hero counts"}, - {0x13, 0x01, 0x30, 0x30, "2"}, - {0x13, 0x01, 0x30, 0x00, "3"}, - {0x13, 0x01, 0x30, 0x20, "4"}, - {0x13, 0x01, 0x30, 0x10, "5"}, - {0, 0xFE, 0, 2, "Cheating"}, - {0x13, 0x01, 0x40, 0x00, "Normal Game"}, - {0x13, 0x01, 0x40, 0x40, "No death & stop mode"}, - {0, 0xFE, 0, 2, "Allow Continue"}, - {0x13, 0x01, 0x80, 0x00, "Yes"}, - {0x13, 0x01, 0x80, 0x80, "No"}, - - // Region - {0, 0xFE, 0, 3, "Region"}, - {0x14, 0x01, 0x03, 0x00, "Japan"}, - {0x14, 0x01, 0x03, 0x01, "US"}, - {0x14, 0x01, 0x03, 0x02, "Europe"}, -}; - -STDDIPINFO(hellfir1) - -static INT32 __fastcall DrvResetCallback() -{ - // Reset instruction on 68000 - - ZetReset(); // Reset Z80 (CPU #1) - BurnYM3812Reset(); - return 0; -} - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal, *RamPal2; - -static INT32 nColCount = 0x0400; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x040000; // - RomZ80 = Next; Next += 0x008000; // Z80 ROM - BCU2ROM = Next; Next += nBCU2ROMSize; // BCU-2 tile data - FCU2ROM = Next; Next += nFCU2ROMSize; // FCU-2 tile data - RamStart = Next; - Ram01 = Next; Next += 0x008000; // CPU #0 work RAM - RamPal = Next; Next += 0x001000; // palette - RamPal2 = Next; Next += 0x001000; // palette - RamZ80 = Next; Next += 0x008000; // Z80 RAM - BCU2RAM = Next; Next += 0x010000; - FCU2RAM = Next; Next += 0x000800; - FCU2RAMSize = Next; Next += 0x000080; - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - ToaPalette2 = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029402; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - ZetScan(nAction); // Scan Z80 - - BurnYM3812Scan(nAction, pnMin); - ToaScanBCU2(nAction, pnMin); - - SCAN_VAR(DrvInput); - SCAN_VAR(nCyclesDone); - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - ToaLoadCode(Rom01, 0, 2); - - // Load BCU-2 tile data - ToaLoadTiles(BCU2ROM, 2, nBCU2ROMSize); - - // Load FCU-2 tile data - ToaLoadTiles(FCU2ROM, 6, nFCU2ROMSize); - - // Load the Z80 ROM - BurnLoadRom(RomZ80, 10, 1); - - return 0; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall hellfireZ80In(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x70: - return BurnYM3812Read(0, 0); - case 0x00: // DIP A - return DrvInput[2]; - case 0x10: // DIP B - return DrvInput[3]; - case 0x60: // Sysytem inputs - return DrvInput[4] | (ToaVBlankRegister() << 7); - case 0x40: // Player 1 - return DrvInput[0]; - case 0x50: // Player 2 - return DrvInput[1]; - case 0x20: // Region - return DrvInput[5]; - - } - -// bprintf(PRINT_NORMAL, _T("z80 read %4X\n"), nAddress); - - return 0; -} - -void __fastcall hellfireZ80Out(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x70: - BurnYM3812Write(0, 0, nValue); - break; - case 0x71: - BurnYM3812Write(0, 1, nValue); - break; - - case 0x30: // Coin counter - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Z80 attempted to write address %04X with value %02X.\n"), nAddress, nValue); - } -} - -static INT32 DrvZ80Init() -{ - // Init the Z80 - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(hellfireZ80In); - ZetSetOutHandler(hellfireZ80Out); - - // ROM - ZetMapArea (0x0000, 0x7FFF, 0, RomZ80); // Direct Read from ROM - ZetMapArea (0x0000, 0x7FFF, 2, RomZ80); // Direct Fetch from ROM - // RAM - ZetMapArea (0x8000, 0xFFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0x8000, 0xFFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0x8000, 0xFFFF, 2, RamZ80); // - - - ZetClose(); - - return 0; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall hellfireReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x080001: - case 0x140001: - return ToaVBlankRegister(); - - default: { -// bprintf(PRINT_NORMAL, _T("Read Byte %06X.\n"), sekAddress); - } - } - - return 0; -} - -UINT16 __fastcall hellfireReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x140002: - return ToaFCU2GetRAMPointer(); - case 0x140004: - return ToaFCU2ReadRAM(); - case 0x140006: - return ToaFCU2ReadRAMSize(); - - case 0x100002: - return ToaBCU2GetRAMPointer(); - case 0x100004: - return ToaBCU2ReadRAM_Hi(); - case 0x100006: - return ToaBCU2ReadRAM_Lo(); - - case 0x100010: - case 0x100011: - case 0x100012: - case 0x100013: - case 0x100014: - case 0x100015: - case 0x100016: - case 0x100017: - case 0x100018: - case 0x100019: - case 0x10001A: - case 0x10001B: - case 0x10001C: - case 0x10001D: - case 0x10001E: - case 0x10001F: - return BCU2Reg[(sekAddress & 15) >> 1]; - - case 0x080000: - case 0x140000: - return ToaVBlankRegister(); - - default: { -// bprintf(PRINT_NORMAL, _T("Read Word %06X.\n"), sekAddress); - } - } - - return 0; -} - -void __fastcall hellfireWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - case 0x080003: - bEnableInterrupts = byteValue; - break; - - case 0x140006: - ToaFCU2WriteRAMSize(byteValue); - break; - - default: { -// bprintf(PRINT_NORMAL, _T("Write byte %06X, %02X.\n"), sekAddress, byteValue); - } - } -} - -void __fastcall hellfireWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x140002: // FCU-2 set VRAM address-pointer - ToaFCU2SetRAMPointer(wordValue); - break; - case 0x140004: - ToaFCU2WriteRAM(wordValue); - break; - case 0x140006: - ToaFCU2WriteRAMSize(wordValue); - break; - - case 0x100000: // BCU-2 flip - break; - case 0x100002: // BCU-2 set VRAM address-pointer - ToaBCU2SetRAMPointer(wordValue); - break; - case 0x100004: - ToaBCU2WriteRAM(wordValue); - break; - case 0x100006: - ToaBCU2WriteRAM(wordValue); - break; - - case 0x100010: - case 0x100011: - case 0x100012: - case 0x100013: - case 0x100014: - case 0x100015: - case 0x100016: - case 0x100017: - case 0x100018: - case 0x100019: - case 0x10001A: - case 0x10001B: - case 0x10001C: - case 0x10001D: - case 0x10001E: - case 0x10001F: - BCU2Reg[(sekAddress & 15) >> 1] = wordValue; - break; - - case 0x080002: - bEnableInterrupts = (wordValue & 0xFF); - break; - - case 0x180000: - nBCU2TileXOffset = wordValue; - break; - case 0x180002: - nBCU2TileYOffset = wordValue; - break; - - case 0x180006: // FCU-2 flip - break; - - case 0x180008: - if (wordValue == 0) DrvResetCallback(); - break; - - default: { -// bprintf(PRINT_NORMAL, _T("Write word %06X, %04X.\n"), sekAddress, wordValue); - } - } -} - -// ---------------------------------------------------------------------------- - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - - bEnableInterrupts = false; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - Hellfire = 1; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - BurnSetRefreshRate(REFRESHRATE); - - nBCU2ROMSize = 0x080000; - nFCU2ROMSize = 0x080000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x03FFFF, MAP_ROM); // 68K ROM - SekMapMemory(Ram01, 0x040000, 0x047FFF, MAP_RAM); // 68K RAM - SekMapMemory(RamPal, 0x084000, 0x0847FF, MAP_RAM); // BCU-2 palette RAM - SekMapMemory(RamPal2, 0x086000, 0x0867FF, MAP_RAM); // FCU-2 palette RAM - - SekSetReadWordHandler(0, hellfireReadWord); - SekSetReadByteHandler(0, hellfireReadByte); - SekSetWriteWordHandler(0, hellfireWriteWord); - SekSetWriteByteHandler(0, hellfireWriteByte); - - SekMapHandler(1, 0x0c0000, 0x0c0FFF, MAP_RAM); // Z80 RAM - - SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM); - SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM); - SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM); - SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM); - - SekClose(); - } - - ToaInitBCU2(); - - DrvZ80Init(); // Initialize Z80 - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalSrc2 = RamPal2; - ToaPalInit(); - - BurnYM3812Init(1, 28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0); - BurnTimerAttachZetYM3812(28000000 / 8); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - ToaPalExit(); - - ToaExitBCU2(); - ToaZExit(); // Z80 exit - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - Hellfire = 0; - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); -// BurnClearScreen(); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderBCU2(); // Render BCU2 graphics - } - - ToaPalUpdate(); // Update the palette - ToaPal2Update(); - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[4] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[4] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - nCyclesTotal[1] = INT32(28000000.0 / 8 / REFRESHRATE); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - ToaBufferFCU2Sprites(); - - bVBlank = true; - if (bEnableInterrupts) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (bVBlank || (!CheckSleep(0))) { // See if this CPU is busywaiting - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - nToa1Cycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesDone[1] = ZetTotalCycles() - nCyclesTotal[1]; - -// bprintf(PRINT_NORMAL, _T(" %i\n"), nCyclesDone[0]); - - ZetClose(); - SekClose(); - -// ToaBufferFCU2Sprites(); - - return 0; -} - -struct BurnDriver BurnDrvHellfire = { - "hellfire", NULL, NULL, NULL, "1989", - "Hellfire (2P Ver.)\0", NULL, "Toaplan (Taito License)", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TOAPLAN_RAIZING, GBF_HORSHOOT, 0, - NULL, hellfireRomInfo, hellfireRomName, NULL, NULL, hellfireInputInfo, hellfireDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvHellfir1 = { - "hellfire1a", "hellfire", NULL, NULL, "1989", - "Hellfire (1P Ver., older)\0", NULL, "Toaplan (Taito License)", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TOAPLAN_RAIZING, GBF_HORSHOOT, 0, - NULL, hellfir1RomInfo, hellfir1RomName, NULL, NULL, hellfireInputInfo, hellfir1DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvHellfir2 = { - "hellfire2", "hellfire", NULL, NULL, "1989", - "Hellfire (2P Ver., first edition)\0", NULL, "Toaplan (Taito License)", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TOAPLAN_RAIZING, GBF_HORSHOOT, 0, - NULL, hellfir2RomInfo, hellfir2RomName, NULL, NULL, hellfireInputInfo, hellfireDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvHellfir3 = { - "hellfire1", "hellfire", NULL, NULL, "1989", - "Hellfire (1P Ver.)\0", NULL, "Toaplan (Taito License)", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TOAPLAN_RAIZING, GBF_HORSHOOT, 0, - NULL, hellfir3RomInfo, hellfir3RomName, NULL, NULL, hellfireInputInfo, hellfireDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/toaplan/d_kbash.cpp b/jan/src/burn/drv/toaplan/d_kbash.cpp deleted file mode 100644 index 2c55434bc..000000000 --- a/jan/src/burn/drv/toaplan/d_kbash.cpp +++ /dev/null @@ -1,725 +0,0 @@ -// FB Alpha Knuckle Bash driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -#include "nec_intf.h" -// Knuckle Bash - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -// Rom information -static struct BurnRomInfo drvRomDesc[] = { - { "tp023_01.bin", 0x080000, 0x2965f81d, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp023_3.bin", 0x200000, 0x32ad508b, BRF_GRA }, // 1 GP9001 Tile data - { "tp023_5.bin", 0x200000, 0xb84c90eb, BRF_GRA }, // 2 - { "tp023_4.bin", 0x200000, 0xe493c077, BRF_GRA }, // 3 - { "tp023_6.bin", 0x200000, 0x9084b50a, BRF_GRA }, // 4 - - { "tp023_02.bin", 0x008000, 0x4cd882a1, BRF_ESS | BRF_PRG }, // 5 Sound CPU - { "tp023_7.bin", 0x040000, 0x3732318f, BRF_SND }, // 6 ADPCM data -}; - - -STD_ROM_PICK(drv) -STD_ROM_FN(drv) - -static struct BurnRomInfo drvkRomDesc[] = { - { "tp023_01.u52", 0x080000, 0x099aefbc, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp023_3.bin", 0x200000, 0x32ad508b, BRF_GRA }, // 1 GP9001 Tile data - { "tp023_5.bin", 0x200000, 0xb84c90eb, BRF_GRA }, // 2 - { "tp023_4.bin", 0x200000, 0xe493c077, BRF_GRA }, // 3 - { "tp023_6.bin", 0x200000, 0x9084b50a, BRF_GRA }, // 4 - - { "tp023_02.bin", 0x008000, 0x4cd882a1, BRF_ESS | BRF_PRG }, // 5 Sound CPU - { "tp023_7.bin", 0x040000, 0x3732318f, BRF_SND }, // 6 ADPCM data -}; - - -STD_ROM_PICK(drvk) -STD_ROM_FN(drvk) - -static struct BurnInputInfo kbashInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(kbash) - -static struct BurnDIPInfo kbashDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0x0F, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Continue Price"}, - {0x14, 0x01, 0x01, 0x00, "Normal"}, - {0x14, 0x01, 0x01, 0x01, "Discount"}, - {0, 0xFE, 0, 2, "Screen Type"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "1 coin 2 plays"}, - {0x14, 0x01, 0x30, 0x20, "2 coins 1 play"}, - {0x14, 0x01, 0x30, 0x30, "2 coins 3 plays"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 2 plays"}, - {0x14, 0x01, 0xC0, 0x80, "2 coins 1 play"}, - {0x14, 0x01, 0xC0, 0xC0, "2 coins 3 plays"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B"}, - {0x15, 0x01, 0x03, 0x01, "A"}, - {0x15, 0x01, 0x03, 0x02, "C"}, - {0x15, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend"}, - {0x15, 0x01, 0x0C, 0x00, "100000, 400000"}, - {0x15, 0x01, 0x0C, 0x04, "100000 only"}, - {0x15, 0x01, 0x0C, 0x08, "200000 only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Lives"}, - {0x15, 0x01, 0x30, 0x00, "2"}, - {0x15, 0x01, 0x30, 0x01, "4"}, - {0x15, 0x01, 0x30, 0x02, "3"}, - {0x15, 0x01, 0x30, 0x03, "1"}, - {0, 0xFE, 0, 2, "Invulnerability (Cheat)"}, - {0x15, 0x01, 0x40, 0x00, "Off"}, - {0x15, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Allow Continue"}, - {0x15, 0x01, 0x80, 0x00, "Yes"}, - {0x15, 0x01, 0x80, 0x80, "No"}, - - // DIP 3 - {0, 0xFE, 0, 7, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "USA, Europe (Atari Games)"}, - {0x16, 0x01, 0x0F, 0x02, "Europe, USA (Atari Games)"}, - {0x16, 0x01, 0x0F, 0x03, "Korea"}, - {0x16, 0x01, 0x0F, 0x04, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "Southeast Asia"}, - {0x16, 0x01, 0x0F, 0x07, "Unused"}, - {0x16, 0x01, 0x0F, 0x08, "Unused"}, - {0x16, 0x01, 0x0F, 0x09, "USA"}, - {0x16, 0x01, 0x0F, 0x0A, "Europe"}, - {0x16, 0x01, 0x0F, 0x0B, "Unused"}, - {0x16, 0x01, 0x0F, 0x0C, "Unused"}, - {0x16, 0x01, 0x0F, 0x0D, "Unused"}, - {0x16, 0x01, 0x0F, 0x0E, "Unused"}, - {0x16, 0x01, 0x0F, 0x0F, "Unused"}, -}; - -STDDIPINFO(kbash) - -static struct BurnDIPInfo kbashkDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0x0F, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Continue Price"}, - {0x14, 0x01, 0x01, 0x00, "Normal"}, - {0x14, 0x01, 0x01, 0x01, "Discount"}, - {0, 0xFE, 0, 2, "Screen Type"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "1 coin 2 plays"}, - {0x14, 0x01, 0x30, 0x20, "2 coins 1 play"}, - {0x14, 0x01, 0x30, 0x30, "2 coins 3 plays"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 2 plays"}, - {0x14, 0x01, 0xC0, 0x80, "2 coins 1 play"}, - {0x14, 0x01, 0xC0, 0xC0, "2 coins 3 plays"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B"}, - {0x15, 0x01, 0x03, 0x01, "A"}, - {0x15, 0x01, 0x03, 0x02, "C"}, - {0x15, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend"}, - {0x15, 0x01, 0x0C, 0x00, "100000, 400000"}, - {0x15, 0x01, 0x0C, 0x04, "100000 only"}, - {0x15, 0x01, 0x0C, 0x08, "200000 only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Lives"}, - {0x15, 0x01, 0x30, 0x00, "2"}, - {0x15, 0x01, 0x30, 0x01, "4"}, - {0x15, 0x01, 0x30, 0x02, "3"}, - {0x15, 0x01, 0x30, 0x03, "1"}, - {0, 0xFE, 0, 2, "Invulnerability (Cheat)"}, - {0x15, 0x01, 0x40, 0x00, "Off"}, - {0x15, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Allow Continue"}, - {0x15, 0x01, 0x80, 0x00, "Yes"}, - {0x15, 0x01, 0x80, 0x80, "No"}, - - // DIP 3 - {0, 0xFE, 0, 7, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Japan (Taito license"}, - {0x16, 0x01, 0x0F, 0x01, "Unused"}, - {0x16, 0x01, 0x0F, 0x02, "Unused"}, - {0x16, 0x01, 0x0F, 0x03, "Korea"}, - {0x16, 0x01, 0x0F, 0x04, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "Southeast Asia"}, - {0x16, 0x01, 0x0F, 0x07, "Unused"}, - {0x16, 0x01, 0x0F, 0x08, "Japan"}, - {0x16, 0x01, 0x0F, 0x09, "Unused"}, - {0x16, 0x01, 0x0F, 0x0A, "Unused"}, - {0x16, 0x01, 0x0F, 0x0B, "Korea"}, - {0x16, 0x01, 0x0F, 0x0C, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x0D, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x0E, "Southeast Asia"}, - {0x16, 0x01, 0x0F, 0x0F, "Unused"}, -}; - -STDDIPINFO(kbashk) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01, *Rom02; -static UINT8 *Ram01, *RamPal; -static UINT8 *ShareRAM; - -static INT32 nColCount = 0x0800; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // 68000 ROM - Rom02 = Next; Next += 0x008000; - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - MSM6295ROM = Next; Next += 0x040000; - RamStart = Next; - Ram01 = Next; Next += 0x004000; // CPU #0 work RAM - RamPal = Next; Next += 0x001000; // palette - ShareRAM = Next; Next += 0x001000; - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020997; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - VezScan(nAction); - BurnYM2151Scan(nAction); - MSM6295Scan(0, nAction); - - ToaScanGP9001(nAction, pnMin); - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 4, nGP9001ROMSize[0]); - - BurnLoadRom(Rom02, 5, 1); - BurnLoadRom(MSM6295ROM, 6, 1); - - return 0; -} - -UINT8 __fastcall kbashReadByte(UINT32 sekAddress) -{ - if ((sekAddress & 0xfff000) == 0x200000) { - return ShareRAM[(sekAddress / 2) & 0x07ff]; - } - - switch (sekAddress) { - case 0x208011: // Player 1 inputs - return DrvInput[0]; - case 0x208015: // Player 2 inputs - return DrvInput[1]; - case 0x208019: // Other inputs - return DrvInput[2]; - - case 0x30000D: // VBlank - return ToaVBlankRegister(); - -// default: -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - - return 0; -} - -UINT16 __fastcall kbashReadWord(UINT32 sekAddress) -{ - if ((sekAddress & 0xfff000) == 0x200000) { - return ShareRAM[(sekAddress / 2) & 0x07ff]; - } - - switch (sekAddress) { - - case 0x208010: // Player 1 inputs - return DrvInput[0]; - case 0x208014: // Player 2 inputs - return DrvInput[1]; - case 0x208018: // Other inputs - return DrvInput[2]; - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x30000C: - return ToaVBlankRegister(); - - case 0x700000: - return ToaScanlineRegister(); - -// default: -// printf("Attempt to read word value of location %x\n", sekAddress); - } - - return 0; -} - -void __fastcall kbashWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - if ((sekAddress & 0xfff000) == 0x200000) { - ShareRAM[(sekAddress / 2) & 0x07ff] = byteValue; - return; - } - - switch (sekAddress) { - //case 0x20801c: - //case 0x20801d: - // break; - - default: { -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall kbashWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if ((sekAddress & 0xfff000) == 0x200000) { - ShareRAM[(sekAddress / 2) & 0x07ff] = wordValue; - return; - } - - switch (sekAddress) { - - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - ToaGP9001WriteRAM(wordValue, 0); - break; - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: - ToaGP9001WriteRegister(wordValue); - break; - -// default: -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -void __fastcall kbash_v25_write(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x04000: - BurnYM2151SelectRegister(data); - return; - - case 0x04001: - BurnYM2151WriteRegister(data); - return; - - case 0x04002: - MSM6295Command(0, data); - return; - } -} - -UINT8 __fastcall kbash_v25_read(UINT32 address) -{ - switch (address) - { - case 0x04001: - return BurnYM2151ReadStatus(); - - case 0x04002: - return MSM6295ReadStatus(0); - } - - return 0; -} - -UINT8 __fastcall kbash_v25_read_port(UINT32 port) -{ - switch (port) - { - case V25_PORT_PT: - return DrvInput[3]^0xff; - - case V25_PORT_P0: - return DrvInput[4]^0xff; - - case V25_PORT_P1: - return DrvInput[5]^0xff; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - VezOpen(0); - VezReset(); - VezClose(); - - BurnYM2151Reset(); - MSM6295Reset(0); - - return 0; -} - -static UINT8 nitro_decryption_table[256] = { - 0x1b,0x56,0x75,0x88,0x8c,0x06,0x58,0x72, 0x83,0x86,0x36,0x1a,0x5f,0xd3,0x8c,0xe9, /* 00 */ - 0x22,0x0f,0x03,0x2a,0xeb,0x2a,0xf9,0x0f, 0xa4,0xbd,0x75,0xf3,0x4f,0x53,0x8e,0xfe, /* 10 */ - 0x87,0xe8,0xb1,0x8d,0x36,0xb5,0x43,0x73, 0x2a,0x5b,0xf9,0x02,0x24,0x8a,0x03,0x80, /* 20 */ - 0x86,0x8b,0xd1,0x3e,0x8d,0x3e,0x58,0xfb, 0xc3,0x79,0xbd,0xb7,0x8a,0xe8,0x0f,0x81, /* 30 */ - 0xb7,0xd0,0x8b,0xeb,0xff,0xb8,0x90,0x8b, 0x5e,0xa2,0x90,0x90,0xab,0xb4,0x80,0x59, /* 40 */ - 0x87,0x72,0xb5,0xbd,0xb0,0x88,0x50,0x0f, 0xfe,0xd2,0xc3,0x90,0x8a,0x90,0xf9,0x75, /* 50 */ - 0x1a,0xb3,0x74,0x0a,0x68,0x24,0xbb,0x90, 0x75,0x47,0xfe,0x2c,0xbe,0xc3,0x88,0xd2, /* 60 */ - 0x3e,0xc1,0x8c,0x33,0x0f,0x90,0x8b,0x90, 0xb9,0x1e,0xff,0xa2,0x3e,0x22,0xbe,0x57, /* 70 */ - 0x81,0x3a,0xf6,0x88,0xeb,0xb1,0x89,0x8a, 0x32,0x80,0x0f,0xb1,0x48,0xc3,0x68,0x72, /* 80 */ - 0x53,0x02,0xc0,0x02,0xe8,0xb4,0x74,0xbc, 0x90,0x58,0x0a,0xf3,0x75,0xc6,0x90,0xe8, /* 90 */ - 0x26,0x50,0xfc,0x8c,0x90,0xb1,0xc3,0xd1, 0xeb,0x83,0xa4,0xbf,0x26,0x4b,0x46,0xfe, /* a0 */ - 0xe2,0x89,0xb3,0x88,0x03,0x56,0x0f,0x38, 0xbb,0x0c,0x90,0x0f,0x07,0x8a,0x8a,0x33, /* b0 */ - 0xfe,0xf9,0xb1,0xa0,0x45,0x36,0x22,0x5e, 0x8a,0xbe,0xc6,0xea,0x3c,0xb2,0x1e,0xe8, /* c0 */ - 0x90,0xeb,0x55,0xf6,0x8a,0xb0,0x5d,0xc0, 0xbb,0x8d,0xf6,0xd0,0xd1,0x88,0x4d,0x90, /* d0 */ - 0x51,0x51,0x74,0xbd,0x32,0xd1,0x90,0xd2, 0x53,0xc7,0xab,0x36,0x50,0xe9,0x33,0xb3, /* e0 */ - 0x2e,0x05,0x88,0x59,0x74,0x74,0x22,0x8e, 0x8a,0x8a,0x36,0x08,0x0f,0x45,0x90,0x2e, /* f0 */ -}; - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = false; -#endif - - nGP9001ROMSize[0] = 0x800000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x103FFF, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); // Palette RAM - SekSetReadWordHandler(0, kbashReadWord); - SekSetReadByteHandler(0, kbashReadByte); - SekSetWriteWordHandler(0, kbashWriteWord); - SekSetWriteByteHandler(0, kbashWriteByte); - SekClose(); - - VezInit(0, V25_TYPE, 16000000 /*before divider*/); - VezOpen(0); - VezMapArea(0x00000, 0x007ff, 0, ShareRAM); - VezMapArea(0x00000, 0x007ff, 1, ShareRAM); - VezMapArea(0x00000, 0x007ff, 2, ShareRAM); - for (INT32 i = 0x80000; i < 0x100000; i += 0x8000) { - VezMapArea(i, i + 0x7fff, 0, Rom02); - VezMapArea(i, i + 0x7fff, 1, Rom02); - VezMapArea(i, i + 0x7fff, 2, Rom02); - } - VezSetReadHandler(kbash_v25_read); - VezSetWriteHandler(kbash_v25_write); - VezSetReadPort(kbash_v25_read_port); - VezSetDecode(nitro_decryption_table); - VezClose(); - } - - BurnYM2151Init(3375000); - BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 1000000 / 132, 1); - MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - - nSpriteYOffset = 0x0011; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - ToaPalExit(); - - BurnYM2151Exit(); - MSM6295Exit(0); - - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - VezExit(); - - BurnFree(Mem); - - MSM6295ROM = NULL; - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 10; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - VezNewFrame(); - - INT32 nSoundBufferPos = 0; - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)8000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesDone[0] = 0; - nCyclesDone[1] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - VezOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - bVBlank = true; - - ToaBufferGP9001Sprites(); - - // Trigger VBlank interrupt - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - nCyclesDone[1] += VezRun(nCyclesTotal[1] / nInterleave); - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - - VezClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -struct BurnDriver BurnDrvKBash = { - "kbash", NULL, NULL, NULL, "1993", - "Knuckle Bash\0", NULL, "Toaplan / Atari", "Toaplan GP9001 based", - L"Knuckle Bash\0Knuckle Bash \u30CA\u30C3\u30AF\u30EB\u30D0\u30C3\u30B7\u30E5\0", NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_SCRFIGHT, 0, - NULL, drvRomInfo, drvRomName, NULL, NULL, kbashInputInfo,kbashDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvKBashk = { - "kbashk", "kbash", NULL, NULL, "1993", - "Knuckle Bash (Korean PCB)\0", NULL, "Toaplan / Taito", "Toaplan GP9001 based", - L"Knuckle Bash\0Knuckle Bash \u30CA\u30C3\u30AF\u30EB\u30D0\u30C3\u30B7\u30E5 (Korean PCB)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_SCRFIGHT, 0, - NULL, drvkRomInfo, drvkRomName, NULL, NULL, kbashInputInfo,kbashkDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/toaplan/d_kbash2.cpp b/jan/src/burn/drv/toaplan/d_kbash2.cpp deleted file mode 100644 index e9afc4189..000000000 --- a/jan/src/burn/drv/toaplan/d_kbash2.cpp +++ /dev/null @@ -1,557 +0,0 @@ -// FB Alpha Knuckle Bash 2 driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -// Knuckle Bash 2 - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT32 nPreviousOkiBank; - -static struct BurnRomInfo kbash2RomDesc[] = { - { "mecat-m", 0x080000, 0xbd2263c6, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "mecat-34", 0x400000, 0x6be7b37e, BRF_GRA }, // 1 GP9001 Tile data - { "mecat-12", 0x400000, 0x49e46b1f, BRF_GRA }, // 2 - - { "mecat-s", 0x080000, 0x3eb7adf4, BRF_SND }, // 3 oki1 - - { "eprom", 0x040000, 0x31115cb9, BRF_SND }, // 4 oki2 - - { "050917-10", 0x010000, 0x6b213183, BRF_OPT }, // 5 WTF is this? -}; - -STD_ROM_PICK(kbash2) -STD_ROM_FN(kbash2) - -static struct BurnInputInfo Kbash2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvButton + 0, "service"}, - {"Tilt", BIT_DIGITAL, DrvButton + 1, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(Kbash2) - -static struct BurnDIPInfo Kbash2DIPList[]= -{ - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x06, NULL }, - - {0 , 0xfe, 0 , 2, "Continue Mode" }, - {0x15, 0x01, 0x01, 0x00, "Normal" }, - {0x15, 0x01, 0x01, 0x01, "Discount" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Coin A" }, - {0x15, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x15, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x03, "Hardest" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x00, "Medium" }, - {0x16, 0x01, 0x03, 0x01, "Easy" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x0c, "None" }, - {0x16, 0x01, 0x0c, 0x08, "200k only" }, - {0x16, 0x01, 0x0c, 0x04, "100k only" }, - {0x16, 0x01, 0x0c, 0x00, "100k and 400k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "1" }, - {0x16, 0x01, 0x30, 0x00, "2" }, - {0x16, 0x01, 0x30, 0x20, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x80, 0x80, "No" }, - {0x16, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 7, "Territory" }, - {0x17, 0x01, 0x0f, 0x00, "Japan (Taito Corp license)" }, - {0x17, 0x01, 0x0f, 0x0e, "South East Asia" }, - {0x17, 0x01, 0x0f, 0x06, "South East Asia (Charterfield license)" }, - {0x17, 0x01, 0x0f, 0x0b, "Korea" }, - {0x17, 0x01, 0x0f, 0x03, "Korea (Unite license)" }, - {0x17, 0x01, 0x0f, 0x04, "Hong Kong" }, - {0x17, 0x01, 0x0f, 0x05, "Taiwan" }, -}; - -STDDIPINFO(Kbash2) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal, *RamSnd; -static UINT8 *RomSnd; - -static INT32 nColCount = 0x0800; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // 68000 ROM - MSM6295ROM = Next; - RomSnd = Next; Next += 0x140000; - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - RamStart = Next; - Ram01 = Next; Next += 0x004000; // CPU #0 work RAM - RamPal = Next; Next += 0x001000; // palette - RamSnd = Next; Next += 0x000100; // sound work-ram - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static void oki_set_bank(INT32 bank) -{ - bank &= 1; - if (nPreviousOkiBank != bank) { - nPreviousOkiBank = bank; - memcpy (RomSnd + 0x000000, RomSnd + 0x40000 + (bank * 0x40000), 0x40000); - } -} - -// Scan ram -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020997; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - MSM6295Scan(0, nAction); - MSM6295Scan(1, nAction); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(nPreviousOkiBank); - } - - if (nAction & ACB_WRITE) { - INT32 nBank = nPreviousOkiBank; - nPreviousOkiBank = -1; - oki_set_bank(nBank); - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 2, nGP9001ROMSize[0]); - - if (BurnLoadRom(RomSnd + 0x040000, 3, 1)) return 1; - if (BurnLoadRom(RomSnd + 0x100000, 4, 1)) return 1; - - return 0; -} - -static UINT8 __fastcall kbash2ReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x200005: // Dipswitch 1 - return DrvInput[3]; - case 0x200009: // Dipswitch 2 - return DrvInput[4]; - case 0x20000d: // Dipswitch 3 - Territory - return DrvInput[5]; - - case 0x200011: // Player 1 Input - return DrvInput[0]; - case 0x200015: // Player 2 Input - return DrvInput[1]; - case 0x200019: // System... - return DrvInput[2]; - - case 0x200021: - return MSM6295ReadStatus(1); - - case 0x200025: - return MSM6295ReadStatus(0); - - case 0x20002D: - return ToaScanlineRegister(); - - case 0x30000d: // VBlank - return ToaVBlankRegister(); - -// default: -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - - return 0; -} - -static UINT16 __fastcall kbash2ReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x200004: // Dipswitch 1 - return DrvInput[3]; - case 0x200008: // Dipswitch 2 - return DrvInput[4]; - case 0x20000c: // Dipswitch 3 - Territory - return DrvInput[5]; - - case 0x200010: // Player 1 Input - return DrvInput[0]; - case 0x200014: // Player 2 Input - return DrvInput[1]; - case 0x200018: // System... - return DrvInput[2]; - - case 0x200020: - return MSM6295ReadStatus(1); - - case 0x200024: - return MSM6295ReadStatus(0); - - case 0x20002c: - return ToaScanlineRegister(); - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x30000C: // VBlank - return ToaVBlankRegister(); - -// default: -// printf("Attempt to read word value of location %x\n", sekAddress); - } - - return 0; -} - -static void __fastcall kbash2WriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x200021: - MSM6295Command(1, byteValue); - return; - - case 0x200025: - MSM6295Command(0, byteValue); - return; - - case 0x200029: - oki_set_bank(byteValue); - return; - -// default: -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } -} - -static void __fastcall kbash2WriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - ToaGP9001WriteRAM(wordValue, 0); - break; - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: - ToaGP9001WriteRegister(wordValue); - break; - -// default: -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - MSM6295Reset(1); - - nPreviousOkiBank = -1; - oki_set_bank(0); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = false; -#endif - - nGP9001ROMSize[0] = 0x800000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); - SekMapMemory(Ram01, 0x100000, 0x103FFF, MAP_RAM); - SekMapMemory(RamSnd, 0x104000, 0x1040FF, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); - SekSetReadWordHandler(0, kbash2ReadWord); - SekSetReadByteHandler(0, kbash2ReadByte); - SekSetWriteWordHandler(0, kbash2WriteWord); - SekSetWriteByteHandler(0, kbash2WriteByte); - - SekClose(); - } - - MSM6295Init(0, 1000000 / 132, 1); - MSM6295Init(1, 1000000 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH); - - nSpriteYOffset = 0x0011; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - ToaPalExit(); - - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - - MSM6295Exit(0); - MSM6295Exit(1); - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesDone[0] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - bVBlank = true; - - ToaBufferGP9001Sprites(); - - // Trigger VBlank interrupt - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - } - - if (pBurnSoundOut) { - memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); - MSM6295Render(0, pBurnSoundOut, nBurnSoundLen); - MSM6295Render(1, pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -struct BurnDriver BurnDrvKbash2 = { - "kbash2", NULL, NULL, NULL, "1999", - "Knuckle Bash 2 (bootleg)\0", NULL, "bootleg", "Toaplan GP9001 based", - L"Knuckle Bash 2\0Knuckle Bash \u30CA\u30C3\u30AF\u30EB\u30D0\u30C3\u30B7\u30E5 \uFF12 (bootleg)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_BOOTLEG, 2, HARDWARE_TOAPLAN_68K_ONLY, GBF_SCRFIGHT, 0, - NULL, kbash2RomInfo, kbash2RomName, NULL, NULL, Kbash2InputInfo, Kbash2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/toaplan/d_mahoudai.cpp b/jan/src/burn/drv/toaplan/d_mahoudai.cpp deleted file mode 100644 index 73489144a..000000000 --- a/jan/src/burn/drv/toaplan/d_mahoudai.cpp +++ /dev/null @@ -1,699 +0,0 @@ -// FB Alpha Mahou Daisakusen driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -// Mahou Daisakusen - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -// Rom information -static struct BurnRomInfo mahoudaiRomDesc[] = { - { "ra_ma_01_01.u65", 0x080000, 0x970CCC5C, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "ra-ma01-rom2.u2", 0x100000, 0x54E2BD95, BRF_GRA }, // 1 GP9001 Tile data - { "ra-ma01-rom3.u1", 0x100000, 0x21CD378F, BRF_GRA }, // 2 - - { "ra_ma_01_05.u81", 0x008000, 0xC00D1E80, BRF_GRA }, // 3 Extra text layer tile data - - { "ra-ma-01_02.u66", 0x010000, 0xEABFA46D, BRF_ESS | BRF_PRG }, // 4 Z80 program - - { "ra-ma01-rom1.u57", 0x040000, 0x6EDB2AB8, BRF_SND }, // 5 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(mahoudai) -STD_ROM_FN(mahoudai) - -static struct BurnRomInfo sstrikerRomDesc[] = { - { "ra-ma_01_01.u65", 0x080000, 0x708FD51D, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "ra-ma01-rom2.u2", 0x100000, 0x54E2BD95, BRF_GRA }, // 1 GP9001 Tile data - { "ra-ma01-rom3.u1", 0x100000, 0x21CD378F, BRF_GRA }, // 2 - - { "ra-ma-01_05.u81", 0x008000, 0x88B58841, BRF_GRA }, // 3 Extra text layer tile data - - { "ra-ma-01_02.u66", 0x010000, 0xEABFA46D, BRF_ESS | BRF_PRG }, // 4 Z80 program - - { "ra-ma01-rom1.u57", 0x040000, 0x6EDB2AB8, BRF_SND }, // 5 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(sstriker) -STD_ROM_FN(sstriker) - -static struct BurnRomInfo sstrikraRomDesc[] = { - { "ra-ma-01_01.u65", 0x080000, 0x92259F84, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "ra-ma01-rom2.u2", 0x100000, 0x54E2BD95, BRF_GRA }, // 1 GP9001 Tile data - { "ra-ma01-rom3.u1", 0x100000, 0x21CD378F, BRF_GRA }, // 2 - - { "ra-ma-01_05.u81", 0x008000, 0x88B58841, BRF_GRA }, // 3 Extra text layer tile data - - { "ra-ma-01_02.u66", 0x010000, 0xEABFA46D, BRF_ESS | BRF_PRG }, // 4 Z80 program - - { "ra-ma01-rom1.u57", 0x040000, 0x6EDB2AB8, BRF_SND }, // 5 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(sstrikra) -STD_ROM_FN(sstrikra) - -static struct BurnInputInfo mahoudaiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(mahoudai) - -static struct BurnDIPInfo mahoudaiDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Coin mode"}, - {0x14, 0x01, 0x01, 0x00, "Coin play"}, - {0x14, 0x01, 0x01, 0x01, "Free play"}, - {0, 0xFE, 0, 2, "Screen"}, - {0x14, 0x01, 0x02, 0x00, "Normal"}, - {0x14, 0x01, 0x02, 0x02, "Invert"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "1 coin 2 plays"}, - {0x14, 0x01, 0x30, 0x20, "2 coins 1 play"}, - {0x14, 0x01, 0x30, 0x30, "2 coins 3 plays"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 2 plays"}, - {0x14, 0x01, 0xC0, 0x80, "2 coins 1 play"}, - {0x14, 0x01, 0xC0, 0xC0, "2 coins 3 plays"}, - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B (normal)"}, - {0x15, 0x01, 0x03, 0x01, "A (easy)"}, - {0x15, 0x01, 0x03, 0x02, "C (hard)"}, - {0x15, 0x01, 0x03, 0x03, "D (more hard)"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x15, 0x01, 0x0C, 0x00, "300000 pts every"}, - {0x15, 0x01, 0x0C, 0x04, "200000 & 500000 pts"}, - {0x15, 0x01, 0x0C, 0x08, "200000 only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Number of heroes"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x10, "5"}, - {0x15, 0x01, 0x30, 0x20, "2"}, - {0x15, 0x01, 0x30, 0x30, "1"}, - {0, 0xFE, 0, 2, "No death & stop mode"}, - {0x15, 0x01, 0x40, 0x00, "Off"}, - {0x15, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Continue mode"}, - {0x15, 0x01, 0x80, 0x00, "Continue play"}, - {0x15, 0x01, 0x80, 0x80, "Continue impossible"}, -}; - -static struct BurnDIPInfo mahoudaiRegionDIPList[] = { - // Defaults - {0x16, 0xFF, 0x0E, 0x00, NULL}, - - // Region - {0, 0xFE, 0, 1, "Region"}, - {0x16, 0x01, 0x0E, 0x00, "Japan"}, - {0x16, 0x01, 0x0E, 0x02, "U.S.A."}, - {0x16, 0x01, 0x0E, 0x04, "Europe"}, - {0x16, 0x01, 0x0E, 0x06, "South East Asia"}, - {0x16, 0x01, 0x0E, 0x08, "China"}, - {0x16, 0x01, 0x0E, 0x0A, "Korea"}, - {0x16, 0x01, 0x0E, 0x0C, "Hong Kong"}, - {0x16, 0x01, 0x0E, 0x0E, "Taiwan"}, -}; - -static struct BurnDIPInfo sstrikerRegionDIPList[] = { - // Defaults - {0x16, 0xFF, 0x0E, 0x04, NULL}, - - // Region - {0, 0xFE, 0, 7, "Region"}, - {0x16, 0x01, 0x0E, 0x02, "U.S.A."}, - {0x16, 0x01, 0x0E, 0x04, "Europe"}, - {0x16, 0x01, 0x0E, 0x06, "South East Asia"}, - {0x16, 0x01, 0x0E, 0x08, "China"}, - {0x16, 0x01, 0x0E, 0x0A, "Korea"}, - {0x16, 0x01, 0x0E, 0x0C, "Hong Kong"}, - {0x16, 0x01, 0x0E, 0x0E, "Taiwan"}, - {0x16, 0x01, 0x0E, 0x00, "Japan"}, -}; - -STDDIPINFOEXT(mahoudai, mahoudai, mahoudaiRegion) -STDDIPINFOEXT(sstriker, mahoudai, sstrikerRegion) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *Ram02, *RamPal; - -static INT32 nColCount = 0x0800; -static INT32 nRomADPCMSize = 0x040000; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // - RomZ80 = Next; Next += 0x010000; // Z80 ROM - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - ExtraTROM = Next; Next += 0x008000; // Extra Text layer tile data - MSM6295ROM = Next; Next += nRomADPCMSize; // ADPCM data - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - Ram02 = Next; Next += 0x000800; // - ExtraTRAM = Next; Next += 0x002000; // Extra tile layer - ExtraTScroll= Next; Next += 0x001000; // - ExtraTSelect= Next; Next += 0x001000; // - RamPal = Next; Next += 0x001000; // palette - RamZ80 = Next; Next += 0x004000; // Z80 RAM - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029497; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - ZetScan(nAction); // Scan Z80 - - MSM6295Scan(0, nAction); - BurnYM2151Scan(nAction); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(DrvInput); - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 2, nGP9001ROMSize[0]); - - // Load Extra text layer tile data - BurnLoadRom(ExtraTROM, 3, 1); - - // Load the Z80 ROM - BurnLoadRom(RomZ80, 4, 1); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROM, 5, 1); - - return 0; -} - -UINT8 __fastcall mahoudaiZ80Read(UINT16 nAddress) -{ -// bprintf(PRINT_NORMAL, "z80 read %4X\n", nAddress); - if (nAddress == 0xE001) { - return BurnYM2151ReadStatus(); - } - if (nAddress == 0xE004) { - return MSM6295ReadStatus(0); - } - return 0; -} - -void __fastcall mahoudaiZ80Write(UINT16 nAddress, UINT8 nValue) -{ -// bprintf(PRINT_NORMAL, "Z80 attempted to write address %04X with value %02X.\n", nAddress, nValue); - - switch (nAddress) { - case 0xE000: - BurnYM2151SelectRegister(nValue); - break; - case 0xE001: - BurnYM2151WriteRegister(nValue); - break; - case 0xE004: - MSM6295Command(0, nValue); -// bprintf(PRINT_NORMAL, "OKI M6295 command %02X sent\n", nValue); - break; - } -} - -static INT32 DrvZ80Init() -{ - // Init the Z80 - ZetInit(0); - ZetOpen(0); - - ZetSetReadHandler(mahoudaiZ80Read); - ZetSetWriteHandler(mahoudaiZ80Write); - - // ROM - ZetMapArea (0x0000, 0xBFFF, 0, RomZ80); // Direct Read from ROM - ZetMapArea (0x0000, 0xBFFF, 2, RomZ80); // Direct Fetch from ROM - // RAM - ZetMapArea (0xC000, 0xDFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0xC000, 0xDFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0xC000, 0xDFFF, 2, RamZ80); // - // Callbacks - ZetMemCallback(0xE000, 0xE0FF, 0); // Read - ZetMemCallback(0xE000, 0xE0FF, 1); // Write - - ZetClose(); - - return 0; -} - -UINT8 __fastcall mahoudaiReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x21C021: // Player 1 inputs - return DrvInput[0]; - case 0x21C025: // Player 2 inputs - return DrvInput[1]; - case 0x21C029: // Other inputs - return DrvInput[2]; - case 0x21C02D: // Dipswitch A - return DrvInput[3]; - case 0x21C031: // Dipswitch B - return DrvInput[4]; - case 0x21C035: // Dipswitch C - Territory - return DrvInput[5]; - - case 0x30000D: - return ToaVBlankRegister(); - - default: { - if ((sekAddress & 0x00FFC000) == 0x00218000) { - return RamZ80[(sekAddress & 0x3FFF) >> 1]; - } - -// bprintf(PRINT_NORMAL, "Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -UINT16 __fastcall mahoudaiReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x21C020: // Player 1 inputs - return DrvInput[0]; - case 0x21C024: // Player 2 inputs - return DrvInput[1]; - case 0x21C028: // Other inputs - return DrvInput[2]; - case 0x21C02C: // Dipswitch A - return DrvInput[3]; - case 0x21C030: // Dipswitch B - return DrvInput[4]; - case 0x21C034: // Dipswitch C - Territory - return DrvInput[5]; - - case 0x21C03C: - return ToaScanlineRegister(); - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x30000C: - return ToaVBlankRegister(); - - default: { - if ((sekAddress & 0x00FFC000) == 0x00218000) { - return RamZ80[(sekAddress & 0x3FFF) >> 1]; - } - -// bprintf(PRINT_NORMAL, "Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall mahoudaiWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ -// switch (sekAddress) { - -// default: { -// bprintf(PRINT_NORMAL, "Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - - if ((sekAddress & 0x00FFC000) == 0x00218000) { - RamZ80[(sekAddress & 0x3FFF) >> 1] = byteValue; - } -// } -// } -} - -void __fastcall mahoudaiWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - ToaGP9001WriteRAM(wordValue, 0); - break; - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: - ToaGP9001WriteRegister(wordValue); - break; - - default: { -// bprintf(PRINT_NORMAL, "Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - if ((sekAddress & 0x00FFC000) == 0x00218000) { - RamZ80[(sekAddress & 0x3FFF) >> 1] = wordValue; - } - } - } -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x200000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); // Palette RAM - SekMapMemory(Ram02, 0x401000, 0x4017FF, MAP_RAM); // Unused - SekMapMemory(ExtraTRAM, 0x500000, 0x502FFF, MAP_RAM); - SekMapMemory(ExtraTSelect, 0x502000, 0x502FFF, MAP_RAM); // 0x502000 - Scroll; 0x502200 - RAM - SekMapMemory(ExtraTScroll, 0x503000, 0x503FFF, MAP_RAM); // 0x203000 - Offset; 0x503200 - RAM - - SekSetReadWordHandler(0, mahoudaiReadWord); - SekSetReadByteHandler(0, mahoudaiReadByte); - SekSetWriteWordHandler(0, mahoudaiWriteWord); - SekSetWriteByteHandler(0, mahoudaiWriteByte); - - SekClose(); - } - - nSpritePriority = 1; - ToaInitGP9001(); - - ToaExtraTextInit(); - - DrvZ80Init(); // Initialize Z80 - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - BurnYM2151Init(27000000 / 8); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 32000000 / 32 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - MSM6295Exit(0); - BurnYM2151Exit(); - - ToaPalExit(); - - ToaExitGP9001(); - ToaExtraTextExit(); - ToaZExit(); // Z80 exit - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - ToaExtraTextLayer(); // Render extra text layer - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = TOA_Z80_SPEED / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - ToaBufferGP9001Sprites(); - - bVBlank = true; - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - - { - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - } - - SekClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -struct BurnDriver BurnDrvMahouDai = { - "mahoudai", "sstriker", NULL, NULL, "1993", - "Mahou Daisakusen (Japan)\0", NULL, "Raizing", "Toaplan GP9001 based", - L"\u9B54\u6CD5\u5927\u4F5C\u6226 (Mahou Daisakusen Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, mahoudaiRomInfo, mahoudaiRomName, NULL, NULL, mahoudaiInputInfo, mahoudaiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvSStriker = { - "sstriker", NULL, NULL, NULL, "1993", - "Sorcer Striker (World)\0", NULL, "Raizing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, sstrikerRomInfo, sstrikerRomName, NULL, NULL, mahoudaiInputInfo, sstrikerDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvSStrikrA = { - "sstrikera", "sstriker", NULL, NULL, "1993", - "Sorcer Striker (World, alt)\0", NULL, "Raizing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, sstrikraRomInfo, sstrikraRomName, NULL, NULL, mahoudaiInputInfo, sstrikerDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - diff --git a/jan/src/burn/drv/toaplan/d_outzone.cpp b/jan/src/burn/drv/toaplan/d_outzone.cpp deleted file mode 100644 index 438b92511..000000000 --- a/jan/src/burn/drv/toaplan/d_outzone.cpp +++ /dev/null @@ -1,1025 +0,0 @@ -// FB Alpha Out Zone driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" - -#define REFRESHRATE ((28000000.0 / 4.0) / (450.0 * 282.0)) -#define VBLANK_LINES (32) - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static bool bEnableInterrupts; - -// Rom information -static struct BurnRomInfo outzoneRomDesc[] = { - { "tp018_7.bin", 0x020000, 0x0c2ac02d, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "tp018_8.bin", 0x020000, 0xca7e48aa, BRF_ESS | BRF_PRG }, // 1 - - { "rom5.bin", 0x080000, 0xC64EC7B6, BRF_GRA }, // 2 Tile data - { "rom6.bin", 0x080000, 0x64B6C5AC, BRF_GRA }, // 3 - - { "rom2.bin", 0x020000, 0x6BB72D16, BRF_GRA }, // 4 - { "rom1.bin", 0x020000, 0x0934782D, BRF_GRA }, // 5 - { "rom3.bin", 0x020000, 0xEC903C07, BRF_GRA }, // 6 - { "rom4.bin", 0x020000, 0x50CBF1A8, BRF_GRA }, // 7 - - { "rom9.bin", 0x008000, 0x73D8E235, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "tp018_10.bpr", 0x000020, 0xBC88CCED, BRF_SND }, // 9 Sprite attribute PROM - { "tp018_11.bpr", 0x000020, 0xA1E17492, BRF_SND }, // 10 ??? -}; - - -STD_ROM_PICK(outzone) -STD_ROM_FN(outzone) - -static struct BurnRomInfo outzonebRomDesc[] = { - { "rom7.bin", 0x020000, 0x936E25D8, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "rom8.bin", 0x020000, 0xD19B3ECF, BRF_ESS | BRF_PRG }, // 1 - - { "rom5.bin", 0x080000, 0xC64EC7B6, BRF_GRA }, // 2 Tile data - { "rom6.bin", 0x080000, 0x64B6C5AC, BRF_GRA }, // 3 - - { "rom2.bin", 0x020000, 0x6BB72D16, BRF_GRA }, // 4 - { "rom1.bin", 0x020000, 0x0934782D, BRF_GRA }, // 5 - { "rom3.bin", 0x020000, 0xEC903C07, BRF_GRA }, // 6 - { "rom4.bin", 0x020000, 0x50CBF1A8, BRF_GRA }, // 7 - - { "rom9.bin", 0x008000, 0x73D8E235, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "tp018_10.bpr", 0x000020, 0xBC88CCED, BRF_SND }, // 9 Sprite attribute PROM - { "tp018_11.bpr", 0x000020, 0xA1E17492, BRF_SND }, // 10 ??? -}; - - -STD_ROM_PICK(outzoneb) -STD_ROM_FN(outzoneb) - -static struct BurnRomInfo outzoneaRomDesc[] = { - { "18.bin", 0x020000, 0x31A171BB, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "19.bin", 0x020000, 0x804ECFD1, BRF_ESS | BRF_PRG }, // 1 - - { "rom5.bin", 0x080000, 0xC64EC7B6, BRF_GRA }, // 2 Tile data - { "rom6.bin", 0x080000, 0x64B6C5AC, BRF_GRA }, // 3 - - { "rom2.bin", 0x020000, 0x6BB72D16, BRF_GRA }, // 4 - { "rom1.bin", 0x020000, 0x0934782D, BRF_GRA }, // 5 - { "rom3.bin", 0x020000, 0xEC903C07, BRF_GRA }, // 6 - { "rom4.bin", 0x020000, 0x50CBF1A8, BRF_GRA }, // 7 - - { "rom9.bin", 0x008000, 0x73D8E235, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "tp018_10.bpr", 0x000020, 0xBC88CCED, BRF_SND }, // 9 Sprite attribute PROM - { "tp018_11.bpr", 0x000020, 0xA1E17492, BRF_SND }, // 10 ??? -}; - - -STD_ROM_PICK(outzonea) -STD_ROM_FN(outzonea) - -static struct BurnRomInfo outzonecRomDesc[] = { - { "prg1.bin", 0x020000, 0x127a38d7, BRF_ESS | BRF_PRG }, // 1 - { "prg2.bin", 0x020000, 0x9704db16, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "rom5.bin", 0x080000, 0xC64EC7B6, BRF_GRA }, // 2 Tile data - { "rom6.bin", 0x080000, 0x64B6C5AC, BRF_GRA }, // 3 - - { "rom2.bin", 0x020000, 0x6BB72D16, BRF_GRA }, // 4 - { "rom1.bin", 0x020000, 0x0934782D, BRF_GRA }, // 5 - { "rom3.bin", 0x020000, 0xEC903C07, BRF_GRA }, // 6 - { "rom4.bin", 0x020000, 0x50CBF1A8, BRF_GRA }, // 7 - - { "rom9.bin", 0x008000, 0x73D8E235, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "tp018_10.bpr", 0x000020, 0xBC88CCED, BRF_SND }, // 9 Sprite attribute PROM - { "tp018_11.bpr", 0x000020, 0xA1E17492, BRF_SND }, // 10 ??? -}; - - -STD_ROM_PICK(outzonec) -STD_ROM_FN(outzonec) - -static struct BurnRomInfo outzonedRomDesc[] = { - { "tp07.bin", 0x020000, 0xa85a1d48, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "tp08.bin", 0x020000, 0xd8cc44af, BRF_ESS | BRF_PRG }, // 1 - - { "rom5.bin", 0x080000, 0xC64EC7B6, BRF_GRA }, // 2 Tile data - { "rom6.bin", 0x080000, 0x64B6C5AC, BRF_GRA }, // 3 - - { "rom2.bin", 0x020000, 0x6BB72D16, BRF_GRA }, // 4 - { "rom1.bin", 0x020000, 0x0934782D, BRF_GRA }, // 5 - { "rom3.bin", 0x020000, 0xEC903C07, BRF_GRA }, // 6 - { "rom4.bin", 0x020000, 0x50CBF1A8, BRF_GRA }, // 7 - - { "tp09.bin", 0x008000, 0xdd56041f, BRF_ESS | BRF_PRG }, // 8 Z80 program - - { "tp018_10.bpr", 0x000020, 0xBC88CCED, BRF_SND }, // 9 Sprite attribute PROM - { "tp018_11.bpr", 0x000020, 0xA1E17492, BRF_SND }, // 10 ??? -}; - - -STD_ROM_PICK(outzoned) -STD_ROM_FN(outzoned) - -static struct BurnInputInfo outzoneInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 2, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(outzone) - -static struct BurnDIPInfo outzoneDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x02, NULL}, - // DIP 1 - {0, 0xFE, 0, 2, "Screen mode"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, -#if 1 - // Coinage for Europe - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "2 coin 1 play"}, - {0x14, 0x01, 0x30, 0x20, "3 coin 1 play"}, - {0x14, 0x01, 0x30, 0x30, "4 coin 1 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 3 play"}, - {0x14, 0x01, 0xC0, 0x80, "1 coin 4 play"}, - {0x14, 0x01, 0xC0, 0xC0, "1 coin 6 play"}, -#else - // Coinage for Japan - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "1 coin 2 play"}, - {0x14, 0x01, 0x30, 0x20, "2 coin 1 play"}, - {0x14, 0x01, 0x30, 0x30, "3 coin 2 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 2 play"}, - {0x14, 0x01, 0xC0, 0x80, "2 coin 1 play"}, - {0x14, 0x01, 0xC0, 0xC0, "3 coin 2 play"}, -#endif - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B"}, - {0x15, 0x01, 0x03, 0x01, "A"}, - {0x15, 0x01, 0x03, 0x02, "C"}, - {0x15, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x15, 0x01, 0x0C, 0x00, "300000 pts every"}, - {0x15, 0x01, 0x0C, 0x04, "200000 & 500000 pts"}, - {0x15, 0x01, 0x0C, 0x08, "300000 only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Number of heros"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x10, "5"}, - {0x15, 0x01, 0x30, 0x20, "2"}, - {0x15, 0x01, 0x30, 0x30, "1"}, - {0, 0xFE, 0, 2, "No death & stop mode"}, - {0x15, 0x01, 0x40, 0x00, "Off"}, - {0x15, 0x01, 0x40, 0x40, "On"}, - - // Region - {0, 0xFE, 0, 9, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x02, "Europe"}, - {0x16, 0x01, 0x0F, 0x03, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x04, "Korea"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "Taiwan (Spacy License)"}, - {0x16, 0x01, 0x0F, 0x07, "US (Romstar License)"}, - {0x16, 0x01, 0x0F, 0x08, "Hong Kong (Honest Trading License)"}, - -}; - -STDDIPINFO(outzone) - -static struct BurnDIPInfo outzonebDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x02, NULL}, - // DIP 1 - {0, 0xFE, 0, 2, "Screen mode"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, -#if 1 - // Coinage for Europe - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "2 coin 1 play"}, - {0x14, 0x01, 0x30, 0x20, "3 coin 1 play"}, - {0x14, 0x01, 0x30, 0x30, "4 coin 1 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 3 play"}, - {0x14, 0x01, 0xC0, 0x80, "1 coin 4 play"}, - {0x14, 0x01, 0xC0, 0xC0, "1 coin 6 play"}, -#else - // Coinage for Japan - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "1 coin 2 play"}, - {0x14, 0x01, 0x30, 0x20, "2 coin 1 play"}, - {0x14, 0x01, 0x30, 0x30, "3 coin 2 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 2 play"}, - {0x14, 0x01, 0xC0, 0x80, "2 coin 1 play"}, - {0x14, 0x01, 0xC0, 0xC0, "3 coin 2 play"}, -#endif - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B"}, - {0x15, 0x01, 0x03, 0x01, "A"}, - {0x15, 0x01, 0x03, 0x02, "C"}, - {0x15, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x15, 0x01, 0x0C, 0x00, "300000 pts every"}, - {0x15, 0x01, 0x0C, 0x04, "200000 & 500000 pts"}, - {0x15, 0x01, 0x0C, 0x08, "300000 only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Number of heros"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x10, "5"}, - {0x15, 0x01, 0x30, 0x20, "2"}, - {0x15, 0x01, 0x30, 0x30, "1"}, - {0, 0xFE, 0, 2, "No death & stop mode"}, - {0x15, 0x01, 0x40, 0x00, "Off"}, - {0x15, 0x01, 0x40, 0x40, "On"}, - - // Region - {0, 0xFE, 0, 8, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x02, "Europe"}, - {0x16, 0x01, 0x0F, 0x03, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x04, "Korea"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "No Warning screen"}, - {0x16, 0x01, 0x0F, 0x07, "No Warning screen"}, - - -}; - -STDDIPINFO(outzoneb) - -static struct BurnDIPInfo outzonecDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x02, NULL}, - // DIP 1 - {0, 0xFE, 0, 2, "Screen mode"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, -#if 1 - // Coinage for Europe - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "2 coin 1 play"}, - {0x14, 0x01, 0x30, 0x20, "3 coin 1 play"}, - {0x14, 0x01, 0x30, 0x30, "4 coin 1 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 3 play"}, - {0x14, 0x01, 0xC0, 0x80, "1 coin 4 play"}, - {0x14, 0x01, 0xC0, 0xC0, "1 coin 6 play"}, -#else - // Coinage for Japan - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "1 coin 2 play"}, - {0x14, 0x01, 0x30, 0x20, "2 coin 1 play"}, - {0x14, 0x01, 0x30, 0x30, "3 coin 2 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 2 play"}, - {0x14, 0x01, 0xC0, 0x80, "2 coin 1 play"}, - {0x14, 0x01, 0xC0, 0xC0, "3 coin 2 play"}, -#endif - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B"}, - {0x15, 0x01, 0x03, 0x01, "A"}, - {0x15, 0x01, 0x03, 0x02, "C"}, - {0x15, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x15, 0x01, 0x0C, 0x00, "300000 pts every"}, - {0x15, 0x01, 0x0C, 0x04, "200000 & 500000 pts"}, - {0x15, 0x01, 0x0C, 0x08, "300000 only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Number of heros"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x10, "5"}, - {0x15, 0x01, 0x30, 0x20, "2"}, - {0x15, 0x01, 0x30, 0x30, "1"}, - {0, 0xFE, 0, 2, "No death & stop mode"}, - {0x15, 0x01, 0x40, 0x00, "Off"}, - {0x15, 0x01, 0x40, 0x40, "On"}, - - // Region - {0, 0xFE, 0, 9, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x02, "Europe"}, - {0x16, 0x01, 0x0F, 0x03, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x04, "Korea"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "Taiwan (Spacy Co License)"}, - {0x16, 0x01, 0x0F, 0x07, "US (Romstar License)"}, - {0x16, 0x01, 0x0F, 0x08, "Hong Kong & China (Honest Trading License)"}, - -}; - -STDDIPINFO(outzonec) - -static struct BurnDIPInfo outzonedDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0xFF, 0x02, NULL}, - // DIP 1 - {0, 0xFE, 0, 2, "Screen mode"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, -#if 1 - // Coinage for Europe - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "2 coin 1 play"}, - {0x14, 0x01, 0x30, 0x20, "3 coin 1 play"}, - {0x14, 0x01, 0x30, 0x30, "4 coin 1 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 2 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 3 play"}, - {0x14, 0x01, 0xC0, 0x80, "1 coin 4 play"}, - {0x14, 0x01, 0xC0, 0xC0, "1 coin 6 play"}, -#else - // Coinage for Japan - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "1 coin 2 play"}, - {0x14, 0x01, 0x30, 0x20, "2 coin 1 play"}, - {0x14, 0x01, 0x30, 0x30, "3 coin 2 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 2 play"}, - {0x14, 0x01, 0xC0, 0x80, "2 coin 1 play"}, - {0x14, 0x01, 0xC0, 0xC0, "3 coin 2 play"}, -#endif - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B"}, - {0x15, 0x01, 0x03, 0x01, "A"}, - {0x15, 0x01, 0x03, 0x02, "C"}, - {0x15, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x15, 0x01, 0x0C, 0x00, "300000 pts every"}, - {0x15, 0x01, 0x0C, 0x04, "200000 & 500000 pts"}, - {0x15, 0x01, 0x0C, 0x08, "300000 only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Number of heros"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x10, "5"}, - {0x15, 0x01, 0x30, 0x20, "2"}, - {0x15, 0x01, 0x30, 0x30, "1"}, - {0, 0xFE, 0, 2, "No death & stop mode"}, - {0x15, 0x01, 0x40, 0x00, "Off"}, - {0x15, 0x01, 0x40, 0x40, "On"}, - - // Region - {0, 0xFE, 0, 9, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x02, "Europe"}, - {0x16, 0x01, 0x0F, 0x03, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x04, "Korea"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "Taiwan (Spacy Co License)"}, - {0x16, 0x01, 0x0F, 0x07, "US (Romstar License)"}, - {0x16, 0x01, 0x0F, 0x08, "Hong Kong & China (Honest Trading License)"}, - -}; - -STDDIPINFO(outzoned) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal, *RamPal2; - -static INT32 nColCount = 0x0400; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x040000; // - RomZ80 = Next; Next += 0x008000; // Z80 ROM - BCU2ROM = Next; Next += nBCU2ROMSize; // BCU-2 tile data - FCU2ROM = Next; Next += nFCU2ROMSize; // FCU-2 tile data - RamStart = Next; - Ram01 = Next; Next += 0x004000; // CPU #0 work RAM - RamPal = Next; Next += 0x001000; // palette - RamPal2 = Next; Next += 0x001000; // palette - RamZ80 = Next; Next += 0x008000; // Z80 RAM - BCU2RAM = Next; Next += 0x010000; - FCU2RAM = Next; Next += 0x000800; - FCU2RAMSize = Next; Next += 0x000080; - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - ToaPalette2 = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029402; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - ZetScan(nAction); // Scan Z80 - - BurnYM3812Scan(nAction, pnMin); - ToaScanBCU2(nAction, pnMin); - - SCAN_VAR(DrvInput); - SCAN_VAR(nCyclesDone); - SCAN_VAR(DrvReset); - SCAN_VAR(bDrawScreen); - SCAN_VAR(bVBlank); - SCAN_VAR(bEnableInterrupts); - bDrawScreen = true; - ToaRecalcPalette = 1; - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - ToaLoadCode(Rom01, 0, 2); - - // Load BCU-2 tile data - ToaLoadGP9001Tiles(BCU2ROM, 2, 2, nBCU2ROMSize); - - // Load FCU-2 tile data - ToaLoadTiles(FCU2ROM, 4, nFCU2ROMSize); - - // Load the Z80 ROM - BurnLoadRom(RomZ80, 8, 1); - - return 0; -} - -UINT8 __fastcall outzoneZ80In(UINT16 nAddress) -{ -// bprintf(PRINT_NORMAL, _T("z80 read %4X\n"), nAddress); - - nAddress &= 0xFF; - - switch (nAddress) { - case 0x00: - return BurnYM3812Read(0, 0); - case 0x08: // DIP A - return DrvInput[2]; - case 0x0C: // DIP B - return DrvInput[3]; - case 0x10: // Sysytem inputs - return DrvInput[4] | (ToaVBlankRegister() << 7); - case 0x14: // Player 1 - return DrvInput[0]; - case 0x18: // Player 2 - return DrvInput[1]; - case 0x1C: // Region - return DrvInput[5]; - - } - - return 0; -} - -void __fastcall outzoneZ80Out(UINT16 nAddress, UINT8 nValue) -{ -// bprintf(PRINT_NORMAL, _T("Z80 attempted to write address %04X with value %02X.\n"), nAddress, nValue); - - nAddress &= 0xFF; - - switch (nAddress) { - case 0x00: - BurnYM3812Write(0, 0, nValue); - break; - case 0x01: - BurnYM3812Write(0, 1, nValue); - break; - - case 0x04: // Coin counter - break; - } -} - -static INT32 DrvZ80Init() -{ - // Init the Z80 - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(outzoneZ80In); - ZetSetOutHandler(outzoneZ80Out); - - // ROM - ZetMapArea (0x0000, 0x7FFF, 0, RomZ80); // Direct Read from ROM - ZetMapArea (0x0000, 0x7FFF, 2, RomZ80); // Direct Fetch from ROM - // RAM - ZetMapArea (0x8000, 0xFFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0x8000, 0xFFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0x8000, 0xFFFF, 2, RamZ80); // - - - ZetClose(); - - return 0; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall outzoneReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x100001: - case 0x300001: - return ToaVBlankRegister(); - - default: { -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - } - - return 0; -} - -UINT16 __fastcall outzoneReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x100002: - return ToaFCU2GetRAMPointer(); - case 0x100004: - return ToaFCU2ReadRAM(); - case 0x100006: - return ToaFCU2ReadRAMSize(); - - case 0x200002: - return ToaBCU2GetRAMPointer(); - case 0x200004: - return ToaBCU2ReadRAM_Hi(); - case 0x200006: - return ToaBCU2ReadRAM_Lo(); - - case 0x200010: - case 0x200011: - case 0x200012: - case 0x200013: - case 0x200014: - case 0x200015: - case 0x200016: - case 0x200017: - case 0x200018: - case 0x200019: - case 0x20001A: - case 0x20001B: - case 0x20001C: - case 0x20001D: - case 0x20001E: - case 0x20001F: - return BCU2Reg[(sekAddress & 15) >> 1]; - - case 0x100000: - case 0x300000: - return ToaVBlankRegister(); - - default: { -// printf("Attempt to read word value of location %x\n", sekAddress); - } - } - - return 0; -} - -void __fastcall outzoneWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - case 0x300003: - bEnableInterrupts = byteValue; - break; - - case 0x100006: - ToaFCU2WriteRAMSize(byteValue); - break; - - default: { -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall outzoneWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x100002: // FCU-2 set VRAM address-pointer - ToaFCU2SetRAMPointer(wordValue); - break; - case 0x100004: - ToaFCU2WriteRAM(wordValue); - break; - case 0x100006: - ToaFCU2WriteRAMSize(wordValue); - break; - - case 0x200000: // BCU-2 flip - break; - case 0x200002: // BCU-2 set VRAM address-pointer - ToaBCU2SetRAMPointer(wordValue); - break; - case 0x200004: - ToaBCU2WriteRAM(wordValue); - break; - case 0x200006: - ToaBCU2WriteRAM(wordValue); - break; - - case 0x200010: - case 0x200011: - case 0x200012: - case 0x200013: - case 0x200014: - case 0x200015: - case 0x200016: - case 0x200017: - case 0x200018: - case 0x200019: - case 0x20001A: - case 0x20001B: - case 0x20001C: - case 0x20001D: - case 0x20001E: - case 0x20001F: - BCU2Reg[(sekAddress & 15) >> 1] = wordValue; - break; - - case 0x300002: - bEnableInterrupts = (wordValue & 0xFF); - break; - - case 0x340000: - nBCU2TileXOffset = wordValue; - break; - case 0x340002: - nBCU2TileYOffset = wordValue; - break; - - case 0x340006: // FCU-2 flip - break; - - default: { -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } - } -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - - HiscoreReset(); - - bEnableInterrupts = false; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - BurnSetRefreshRate(REFRESHRATE); - - nBCU2ROMSize = 0x100000; - nFCU2ROMSize = 0x080000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x03FFFF, MAP_ROM); // 68K ROM - SekMapMemory(Ram01, 0x240000, 0x243FFF, MAP_RAM); // 68K RAM - SekMapMemory(RamPal, 0x304000, 0x3047FF, MAP_RAM); // BCU-2 palette RAM - SekMapMemory(RamPal2, 0x306000, 0x3067FF, MAP_RAM); // FCU-2 palette RAM - - SekSetReadWordHandler(0, outzoneReadWord); - SekSetReadByteHandler(0, outzoneReadByte); - SekSetWriteWordHandler(0, outzoneWriteWord); - SekSetWriteByteHandler(0, outzoneWriteByte); - - SekMapHandler(1, 0x140000, 0x140FFF, MAP_RAM); // Z80 RAM - - SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM); - SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM); - SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM); - SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM); - - SekClose(); - } - - ToaInitBCU2(); - - DrvZ80Init(); // Initialize Z80 - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalSrc2 = RamPal2; - ToaPalInit(); - - BurnYM3812Init(1, 28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0); - BurnTimerAttachZetYM3812(28000000 / 8); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - ToaPalExit(); - - ToaExitBCU2(); - ToaZExit(); // Z80 exit - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderBCU2(); // Render BCU2 graphics - } - - ToaPalUpdate(); // Update the palette - ToaPal2Update(); - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[4] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[4] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekOpen(0); - ZetOpen(0); - - SekNewFrame(); - ZetNewFrame(); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - nCyclesTotal[1] = INT32(28000000.0 / 8 / REFRESHRATE); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - ToaBufferFCU2Sprites(); - - bVBlank = true; - if (bEnableInterrupts) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (bVBlank || (!CheckSleep(0))) { // See if this CPU is busywaiting - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - nToa1Cycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesDone[1] = ZetTotalCycles() - nCyclesTotal[1]; - -// bprintf(PRINT_NORMAL, _T(" %i\n"), nCyclesDone[0]); - - ZetClose(); - SekClose(); - -// ToaBufferFCU2Sprites(); - - return 0; -} - -struct BurnDriver BurnDrvOutZone = { - "outzoneh", "outzone", NULL, NULL, "1990", - "Out Zone (harder)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, outzoneRomInfo, outzoneRomName, NULL, NULL, outzoneInputInfo, outzoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvOutZonea = { - "outzonea", "outzone", NULL, NULL, "1990", - "Out Zone (set 2)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, outzoneaRomInfo, outzoneaRomName, NULL, NULL, outzoneInputInfo, outzoneDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvOutZoneb = { - "outzonec", "outzone", NULL, NULL, "1990", - "Out Zone (oldest set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, outzonebRomInfo, outzonebRomName, NULL, NULL, outzoneInputInfo, outzonebDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvOutZonec = { - "outzone", NULL, NULL, NULL, "1990", - "Out Zone\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, outzonecRomInfo, outzonecRomName, NULL, NULL, outzoneInputInfo, outzonecDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvOutZoned = { - "outzoneb", "outzone", NULL, NULL, "1990", - "Out Zone (older set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, outzonedRomInfo, outzonedRomName, NULL, NULL, outzoneInputInfo, outzonedDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_pipibibs.cpp b/jan/src/burn/drv/toaplan/d_pipibibs.cpp deleted file mode 100644 index 80d2e9f92..000000000 --- a/jan/src/burn/drv/toaplan/d_pipibibs.cpp +++ /dev/null @@ -1,617 +0,0 @@ -#include "toaplan.h" -// Pipi & Bibis / Whoopee!! -// Based on MAME driver by Quench, Yochizo, David Haywood - -#define REFRESHRATE 60 -#define VBLANK_LINES (32) - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static struct BurnInputInfo PipibibsInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvButton + 0, "service"}, - {"Tilt", BIT_DIGITAL, DrvButton + 1, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(Pipibibs) - -static struct BurnDIPInfo PipibibsDIPList[]= -{ - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0xf6, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Coin A" }, - {0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Hardest" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - {0x14, 0x01, 0x0c, 0x08, "200k only" }, - {0x14, 0x01, 0x0c, 0x00, "200k and every 300k" }, - {0x14, 0x01, 0x0c, 0x04, "150k and every 200k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "1" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 8, "Region" }, - {0x15, 0x01, 0x07, 0x06, "Europe" }, - {0x15, 0x01, 0x07, 0x07, "Europe (Nova Apparate GMBH & Co)" }, - {0x15, 0x01, 0x07, 0x04, "USA" }, - {0x15, 0x01, 0x07, 0x05, "USA (Romstar)" }, - {0x15, 0x01, 0x07, 0x00, "Japan" }, - {0x15, 0x01, 0x07, 0x01, "Asia" }, - {0x15, 0x01, 0x07, 0x02, "Hong Kong (Honest Trading Co.)" }, - {0x15, 0x01, 0x07, 0x03, "Taiwan" }, - - {0 , 0xfe, 0 , 2, "Nudity" }, - {0x15, 0x01, 0x08, 0x08, "Low" }, - {0x15, 0x01, 0x08, 0x00, "High, but censored" }, -}; - -STDDIPINFO(Pipibibs) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal; - -static INT32 nColCount = 0x0800; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x040000; // 68000 ROM - RomZ80 = Next; Next += 0x010000; // Z80 ROM - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - RamStart = Next; - Ram01 = Next; Next += 0x003000; // CPU #0 work RAM - RamZ80 = Next; Next += 0x001000; - RamPal = Next; Next += 0x001000; // palette - GP9001RAM[0]= Next; Next += 0x008000; // Double size, as the game tests too much memory during POST - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020997; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - ToaScanGP9001(nAction, pnMin); - } - - return 0; -} - -static INT32 LoadRoms() -{ - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "pipibibsp")) { - // Load 68000 ROM - ToaLoadCode(Rom01, 0, 2); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 2, 4, nGP9001ROMSize[0]); - - BurnLoadRom(RomZ80, 6, 1); - } else { - // Load 68000 ROM - ToaLoadCode(Rom01, 0, 2); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 2, 2, nGP9001ROMSize[0]); - - BurnLoadRom(RomZ80, 4, 1); - } - - return 0; -} - -UINT8 __fastcall pipibibsReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x19c031: // Player 1 inputs - return DrvInput[0]; - case 0x19c035: // Player 2 inputs - return DrvInput[1]; - case 0x19c02d: // Other inputs - return DrvInput[2]; - - case 0x19c021: // Dipswitch 1 - return DrvInput[3]; - case 0x19c025: // Dipswitch 2 - return DrvInput[4]; - case 0x19c029: // Dipswitch 3 - Territory - return DrvInput[5]&0x0f; - - case 0x14000D: // VBlank - return ToaVBlankRegister(); - -// default: -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - - return 0; -} - -UINT16 __fastcall pipibibsReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x19c030: // Player 1 inputs - return DrvInput[0]; - case 0x19c034: // Player 2 inputs - return DrvInput[1]; - case 0x19c02c: // Other inputs - return DrvInput[2]; - - case 0x19c020: // Dipswitch 1 - return DrvInput[3]; - case 0x19c024: // Dipswitch 2 - return DrvInput[4]; - case 0x19c028: // Dipswitch 3 - Territory - return DrvInput[5]&0x0f; - - case 0x140004: - return ToaGP9001ReadRAM_Hi(0); - case 0x140006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x14000C: - return ToaVBlankRegister(); - -// default: -// printf("Attempt to read word value of location %x\n", sekAddress); - } - - return 0; -} - -void __fastcall pipibibsWriteByte(UINT32 /*sekAddress*/, UINT8 /*byteValue*/) -{ -// switch (sekAddress) { -// default: -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); -// } -} - -void __fastcall pipibibsWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x140000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x140004: - ToaGP9001WriteRAM(wordValue, 0); - break; - case 0x140006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x140008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x14000C: - ToaGP9001WriteRegister(wordValue); - break; - -// default: -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -void __fastcall pipibibs_sound_write(UINT16 address, UINT8 data) -{ - switch (address) - { - case 0xe000: - BurnYM3812Write(0, 0, data); - return; - - case 0xe001: - BurnYM3812Write(0, 1, data); - return; - } -} - -UINT8 __fastcall pipibibs_sound_read(UINT16 address) -{ - switch (address) - { - case 0xe000: - case 0xe001: - return BurnYM3812Read(0, 0); - } - - return 0; -} - -inline static INT32 pipibibsSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3375000; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = false; -#endif - - BurnSetRefreshRate(REFRESHRATE); - - nGP9001ROMSize[0] = 0x200000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x03FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x080000, 0x082FFF, MAP_RAM); - SekMapMemory(RamPal, 0x0c0000, 0x0c0FFF, MAP_RAM); // Palette RAM - SekSetReadWordHandler(0, pipibibsReadWord); - SekSetReadByteHandler(0, pipibibsReadByte); - SekSetWriteWordHandler(0, pipibibsWriteWord); - SekSetWriteByteHandler(0, pipibibsWriteByte); - - SekMapHandler(1, 0x190000, 0x190FFF, MAP_RAM); - SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM); - SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM); - SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM); - SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, RomZ80); - ZetMapArea(0x0000, 0x7fff, 2, RomZ80); - ZetMapArea(0x8000, 0x87ff, 0, RamZ80); - ZetMapArea(0x8000, 0x87ff, 1, RamZ80); - ZetMapArea(0x8000, 0x87ff, 2, RamZ80); - ZetSetWriteHandler(pipibibs_sound_write); - ZetSetReadHandler(pipibibs_sound_read); - ZetClose(); - } - - nToa1Cycles68KSync = 0; - BurnYM3812Init(1, 3375000, &toaplan1FMIRQHandler, pipibibsSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3375000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - nSpriteYOffset = 0x0001; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - ToaPalExit(); - - BurnYM3812Exit(); - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - ZetExit(); - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInput, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - nCyclesTotal[1] = (INT32)(27000000.0 / 8 / REFRESHRATE); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); - } - - ToaBufferGP9001Sprites(); - - bVBlank = true; - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (bVBlank || (!CheckSleep(0))) { - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - nToa1Cycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - -// bprintf(PRINT_NORMAL, _T(" %i\n"), nCyclesDone[0]); - -// ToaBufferFCU2Sprites(); - - SekClose(); - ZetClose(); - - return 0; -} - - -// Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 1) - -static struct BurnRomInfo pipibibsRomDesc[] = { - { "tp025-1.bin", 0x020000, 0xb2ea8659, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "tp025-2.bin", 0x020000, 0xdc53b939, BRF_ESS | BRF_PRG }, // 1 - - { "tp025-4.bin", 0x100000, 0xab97f744, BRF_GRA }, // 2 GP9001 Tile data - { "tp025-3.bin", 0x100000, 0x7b16101e, BRF_GRA }, // 3 - - { "tp025-5.bin", 0x008000, 0xbf8ffde5, BRF_ESS | BRF_PRG }, // 4 CPU #1 code -}; - -STD_ROM_PICK(pipibibs) -STD_ROM_FN(pipibibs) - -struct BurnDriver BurnDrvPipibibs = { - "pipibibs", NULL, NULL, NULL, "1991", - "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 1)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_PLATFORM, 0, - NULL, pipibibsRomInfo, pipibibsRomName, NULL, NULL, PipibibsInputInfo, PipibibsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 2) - -static struct BurnRomInfo pipibibsaRomDesc[] = { - { "tp025-1.alt.bin", 0x020000, 0x3e522d98, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "tp025-2.alt.bin", 0x020000, 0x48370485, BRF_ESS | BRF_PRG }, // 1 - - { "tp025-4.bin", 0x100000, 0xab97f744, BRF_GRA }, // 2 GP9001 Tile data - { "tp025-3.bin", 0x100000, 0x7b16101e, BRF_GRA }, // 3 - - { "tp025-5.bin", 0x008000, 0xbf8ffde5, BRF_ESS | BRF_PRG }, // 4 CPU #1 code -}; - -STD_ROM_PICK(pipibibsa) -STD_ROM_FN(pipibibsa) - -struct BurnDriver BurnDrvPipibibsa = { - "pipibibsa", "pipibibs", NULL, NULL, "1991", - "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 2)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_PLATFORM, 0, - NULL, pipibibsaRomInfo, pipibibsaRomName, NULL, NULL, PipibibsInputInfo, PipibibsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - - -// Pipi & Bibis / Whoopee!! (prototype) - -static struct BurnRomInfo pipibibspRomDesc[] = { - { "pip_cpu_e", 0x020000, 0xae3205bd, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "pip_cpu_o", 0x020000, 0x241669a9, BRF_ESS | BRF_PRG }, // 1 - - { "cg_01_l", 0x080000, 0x21d1ef46, BRF_GRA }, // 2 GP9001 Tile data - { "cg_01_h", 0x080000, 0xd5726328, BRF_GRA }, // 3 - { "cg_23_l", 0x080000, 0x114d41d0, BRF_GRA }, // 4 - { "cg_23_h", 0x080000, 0xe0468152, BRF_GRA }, // 5 - - { "pip_snd", 0x008000, 0x8ebf183b, BRF_ESS | BRF_PRG }, // 6 CPU #1 code -}; - -STD_ROM_PICK(pipibibsp) -STD_ROM_FN(pipibibsp) - -struct BurnDriver BurnDrvPipibibsp = { - "pipibibsp", "pipibibs", NULL, NULL, "1991", - "Pipi & Bibis / Whoopee!! (prototype)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_PROTOTYPE, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_PLATFORM, 0, - NULL, pipibibspRomInfo, pipibibspRomName, NULL, NULL, PipibibsInputInfo, PipibibsDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/toaplan/d_rallybik.cpp b/jan/src/burn/drv/toaplan/d_rallybik.cpp deleted file mode 100644 index 6bb53a80e..000000000 --- a/jan/src/burn/drv/toaplan/d_rallybik.cpp +++ /dev/null @@ -1,620 +0,0 @@ -// Based on MAME driver by Darren Olafson, Quench,Stephane Humbert -#include "toaplan.h" - -#define REFRESHRATE 55.14 -#define VBLANK_LINES (32) - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvSprRAM; -static UINT8 *DrvSprBuf; -static UINT8 *DrvPalRAM; -static UINT8 *DrvPalRAM2; -static UINT8 *DrvShareRAM; - -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvReset; - -static INT32 nColCount = 0x0800; - -static UINT8 bDrawScreen; -static bool bVBlank; - -static bool bEnableInterrupts; - -static struct BurnInputInfo RallybikInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Rallybik) - -static struct BurnDIPInfo RallybikDIPList[]= -{ - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x20, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Medium" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Territory/Copyright" }, - {0x14, 0x01, 0x30, 0x20, "World/Taito Corp Japan" }, - {0x14, 0x01, 0x30, 0x10, "USA/Taito America" }, - {0x14, 0x01, 0x30, 0x00, "Japan/Taito Corp" }, - {0x14, 0x01, 0x30, 0x30, "USA/Taito America (Romstar)" }, - - {0 , 0xfe, 0 , 2, "Dip Switch Display" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "No" }, - {0x14, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Rallybik) - -void __fastcall rallybikWriteWord(UINT32 a, UINT16 d) -{ - switch (a) - { - case 0x100000: - // rallybik_bcu_flipscreen_w - return; - - case 0x100002: - ToaBCU2SetRAMPointer(d); - return; - - case 0x100004: - case 0x100006: - ToaBCU2WriteRAM(d); - return; - - case 0x100010: - case 0x100012: - case 0x100014: - case 0x100016: - case 0x100018: - case 0x10001a: - case 0x10001c: - case 0x10001e: - BCU2Reg[(a & 0x0f) >> 1] = d; - return; - - case 0x140002: - bEnableInterrupts = d & 0xff; - return; - - case 0x140008: - case 0x14000a: - case 0x14000c: - case 0x14000e: - // toaplan1_bcu_control_w - return; - - case 0x1c0000: - nBCU2TileXOffset = d; - return; - - case 0x1c0002: - nBCU2TileYOffset = d; - return; - - case 0x1c8000: - if (d == 0) { - ZetReset(); - } - return; - } -} - -void __fastcall rallybikWriteByte(UINT32 , UINT8 ) -{ - return; -} - -UINT16 __fastcall rallybikReadWord(UINT32 a) -{ - switch (a) - { - case 0x100002: - return ToaBCU2GetRAMPointer(); - - case 0x100004: // ok? - { - INT32 data = ToaBCU2ReadRAM_Hi(); - data |= ((data & 0xf000) >> 4) | ((data & 0x0030) << 2); - return data; - } - - case 0x100006: - return ToaBCU2ReadRAM_Lo(); - - case 0x100010: - case 0x100012: - case 0x100014: - case 0x100016: - case 0x100018: - case 0x10001a: - case 0x10001c: - case 0x10001e: - return BCU2Reg[(a & 0x0f) >> 1]; - } - - return 0; -} - -UINT8 __fastcall rallybikReadByte(UINT32 a) -{ - switch (a) - { - case 0x140001: - return ToaVBlankRegister(); - } - - return 0; -} - -void __fastcall rallybik_sound_write_port(UINT16 p, UINT8 d) -{ - switch (p & 0xff) - { - case 0x30: // toaplan1_coin_w - return; - - case 0x60: - BurnYM3812Write(0, 0, d); - return; - - case 0x61: - BurnYM3812Write(0, 1, d); - return; - } -} - -UINT8 __fastcall rallybik_sound_read_port(UINT16 p) -{ - switch (p & 0xff) - { - case 0x00: - return DrvInputs[0]; - - case 0x10: - return DrvInputs[1]; - - case 0x20: - return DrvInputs[2]; - - case 0x40: - return DrvDips[0]; - - case 0x50: - return DrvDips[1]; - - case 0x60: - case 0x61: - return BurnYM3812Read(0, p & 1); - - case 0x70: - return DrvDips[2]; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - - bEnableInterrupts = false; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x010000; - BCU2ROM = Next; Next += nBCU2ROMSize; - FCU2ROM = Next; Next += nFCU2ROMSize; - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvPalRAM = Next; Next += 0x000800; - DrvPalRAM2 = Next; Next += 0x000800; - - RamZ80 = Next; - DrvShareRAM = Next; Next += 0x008000; - - DrvSprRAM = Next; Next += 0x001000; - - BCU2RAM = Next; Next += 0x010000; - DrvSprBuf = Next; - FCU2RAM = Next; Next += 0x001000; - FCU2RAMSize = Next; Next += 0x000080; - - RamEnd = Next; - - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - ToaPalette2 = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static void DrvSpriteDecode() -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return; - } - - memcpy (tmp, FCU2ROM, 0x40000); - memset (FCU2ROM, 0, 0x80000); - - for (INT32 i = 0; i < (0x40000 / 4) * 8; i++) { - for (INT32 j = 0; j < 4; j++) { - FCU2ROM[i] |= ((tmp[(j * 0x10000) + (i/8)] >> (~i & 7)) & 1) << (3 - j); - } - } - - BurnFree (tmp); -} - -static INT32 DrvInit() -{ - INT32 nLen; - - Rallybik = 1; - -// bToaRotateScreen = true; - - BurnSetRefreshRate(REFRESHRATE); - - nBCU2ROMSize = 0x080000; - nFCU2ROMSize = 0x080000; - - // Find out how much memory is needed - AllMem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(AllMem, 0, nLen); - MemIndex(); - - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM, 4, 1)) return 1; - - ToaLoadTiles(BCU2ROM, 5, nBCU2ROMSize); -// ToaLoadTiles(FCU2ROM, 9, nFCU2ROMSize); - - if (BurnLoadRom(FCU2ROM + 0x000000, 9, 1)) return 1; - if (BurnLoadRom(FCU2ROM + 0x010000, 10, 1)) return 1; - if (BurnLoadRom(FCU2ROM + 0x020000, 11, 1)) return 1; - if (BurnLoadRom(FCU2ROM + 0x030000, 12, 1)) return 1; - - DrvSpriteDecode(); - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x00FFFF, MAP_ROM); - SekMapMemory(Drv68KROM + 0x40000, 0x040000, 0x07FFFF, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x080000, 0x083FFF, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x0c0000, 0x0C0FFF, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x144000, 0x1447FF, MAP_RAM); - SekMapMemory(DrvPalRAM2, 0x146000, 0x1467FF, MAP_RAM); - SekSetReadWordHandler(0, rallybikReadWord); - SekSetReadByteHandler(0, rallybikReadByte); - SekSetWriteWordHandler(0, rallybikWriteWord); - SekSetWriteByteHandler(0, rallybikWriteByte); - - SekMapHandler(1, 0x180000, 0x180FFF, MAP_RAM); - SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM); - SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM); - SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM); - SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0xffff, 0, DrvShareRAM); - ZetMapArea(0x8000, 0xffff, 1, DrvShareRAM); - ZetMapArea(0x8000, 0xffff, 2, DrvShareRAM); - ZetSetOutHandler(rallybik_sound_write_port); - ZetSetInHandler(rallybik_sound_read_port); - ZetClose(); - } - - nLayer0XOffset = 0x0d + 6; - nLayer1XOffset = 0x0d + 4; - nLayer2XOffset = 0x0d + 2; - nLayer3XOffset = 0x0d + 0; - nLayer0YOffset = nLayer1YOffset = nLayer2YOffset = nLayer3YOffset = 0x111; - - ToaInitBCU2(); - - ToaOpaquePriority = 0; - - nToaPalLen = nColCount; - ToaPalSrc = DrvPalRAM; - ToaPalSrc2 = DrvPalRAM2; - ToaPalInit(); - - BurnYM3812Init(1, 28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0); - BurnTimerAttachZetYM3812(28000000 / 8); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - ToaPalExit(); - - ToaExitBCU2(); - ToaZExit(); - SekExit(); - - BurnFree(AllMem); - - Rallybik = 0; - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderBCU2(); - } - - ToaPalUpdate(); - ToaPal2Update(); - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] |= (DrvJoy1[i] & 1) << i; - DrvInputs[1] |= (DrvJoy2[i] & 1) << i; - DrvInputs[2] |= (DrvJoy3[i] & 1) << i; - } - ToaClearOpposites(&DrvInputs[0]); - ToaClearOpposites(&DrvInputs[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - nCyclesTotal[1] = INT32(28000000.0 / 8 / REFRESHRATE); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - - bVBlank = true; - if (bEnableInterrupts) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (bVBlank || (!CheckSleep(0))) { - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - nToa1Cycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - - SekClose(); - ZetClose(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - SCAN_VAR(nCyclesDone); - } - - return 0; -} - - -// Rally Bike / Dash Yarou - -static struct BurnRomInfo rallybikRomDesc[] = { - { "b45-02.rom", 0x08000, 0x383386d7, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "b45-01.rom", 0x08000, 0x7602f6a7, BRF_PRG | BRF_ESS }, // 1 - { "b45-04.rom", 0x20000, 0xe9b005b1, BRF_PRG | BRF_ESS }, // 2 - { "b45-03.rom", 0x20000, 0x555344ce, BRF_PRG | BRF_ESS }, // 3 - - { "b45-05.rom", 0x04000, 0x10814601, BRF_PRG | BRF_ESS }, // 4 CPU #1 code - - { "b45-09.bin", 0x20000, 0x1dc7b010, BRF_GRA }, // 5 Tile data - { "b45-08.bin", 0x20000, 0xfab661ba, BRF_GRA }, // 6 - { "b45-07.bin", 0x20000, 0xcd3748b4, BRF_GRA }, // 7 - { "b45-06.bin", 0x20000, 0x144b085c, BRF_GRA }, // 8 - - { "b45-11.rom", 0x10000, 0x0d56e8bb, BRF_GRA }, // 9 - { "b45-10.rom", 0x10000, 0xdbb7c57e, BRF_GRA }, // 10 - { "b45-12.rom", 0x10000, 0xcf5aae4e, BRF_GRA }, // 11 - { "b45-13.rom", 0x10000, 0x1683b07c, BRF_GRA }, // 12 - - { "b45-15.bpr", 0x00100, 0x24e7d62f, BRF_OPT }, // 13 - { "b45-16.bpr", 0x00100, 0xa50cef09, BRF_OPT }, // 14 - { "b45-14.bpr", 0x00020, 0xf72482db, BRF_OPT }, // 15 - { "b45-17.bpr", 0x00020, 0xbc88cced, BRF_OPT }, // 16 Sprite attribute PROM? -}; - -STD_ROM_PICK(rallybik) -STD_ROM_FN(rallybik) - -struct BurnDriver BurnDrvRallybik = { - "rallybik", NULL, NULL, NULL, "1988", - "Rally Bike / Dash Yarou\0", NULL, "[Toaplan] Taito Corporation", "Toaplan BCU-2 / FCU-2 based", - L"Rally Bike\0\u30C0\u30C3\u30B7\u30E5\u91CE\u90CE\0", NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RACING, 0, - NULL, rallybikRomInfo, rallybikRomName, NULL, NULL, RallybikInputInfo, RallybikDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_samesame.cpp b/jan/src/burn/drv/toaplan/d_samesame.cpp deleted file mode 100644 index c2a320feb..000000000 --- a/jan/src/burn/drv/toaplan/d_samesame.cpp +++ /dev/null @@ -1,1065 +0,0 @@ -// Based on MAME driver by Darren Olafson, Quench,Stephane Humbert -#include "toaplan.h" - -#define REFRESHRATE 60 -#define VBLANK_LINES (32) - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvPalRAM2; - -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvReset; - -static INT32 nColCount = 0x0800; - -static UINT8 bDrawScreen; -static bool bVBlank; - -static bool bEnableInterrupts; - -static UINT8 to_mcu; -static UINT8 z80cmdavailable; - -static struct BurnInputInfo SamesameInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Samesame) - -static struct BurnDIPInfo SamesameDIPList[]= -{ - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Medium" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x04, "50K, every 150K" }, - {0x14, 0x01, 0x0c, 0x00, "70K, every 200K" }, - {0x14, 0x01, 0x0c, 0x08, "100K" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "No" }, - {0x14, 0x01, 0x80, 0x00, "Yes" }, -}; - -STDDIPINFO(Samesame) - -static struct BurnDIPInfo Samesam2DIPList[]= -{ - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Medium" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x04, "50K, every 150K" }, - {0x14, 0x01, 0x0c, 0x00, "70K, every 200K" }, - {0x14, 0x01, 0x0c, 0x08, "100K" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "No" }, - {0x14, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 2, "Show Territory Notice"}, - {0x15, 0x01, 0x01, 0x01, "No" }, - {0x15, 0x01, 0x01, 0x00, "Yes" }, -}; - -STDDIPINFO(Samesam2) - -static struct BurnDIPInfo FireshrkDIPList[]= -{ - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Medium" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x04, "50K, every 150K" }, - {0x14, 0x01, 0x0c, 0x00, "70K, every 200K" }, - {0x14, 0x01, 0x0c, 0x08, "100K" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "No" }, - {0x14, 0x01, 0x80, 0x00, "Yes" }, - - - {0 , 0xfe, 0 , 3, "Territory" }, - {0x15, 0x01, 0x06, 0x02, "Europe" }, - {0x15, 0x01, 0x06, 0x04, "USA" }, - {0x15, 0x01, 0x06, 0x00, "USA (Romstar)" }, -}; - -STDDIPINFO(Fireshrk) - -static struct BurnDIPInfo FireshrkaDIPList[]= -{ - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0x03, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Medium" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x04, "50K, every 150K" }, - {0x14, 0x01, 0x0c, 0x00, "70K, every 200K" }, - {0x14, 0x01, 0x0c, 0x08, "100K" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x80, "No" }, - {0x14, 0x01, 0x80, 0x00, "Yes" }, - - - {0 , 0xfe, 0 , 2, "Territory" }, - {0x15, 0x01, 0x03, 0x03, "Europe" }, - {0x15, 0x01, 0x03, 0x00, "USA" }, -}; - -STDDIPINFO(Fireshrka) - -static void __fastcall samesameWriteWord(UINT32 a, UINT16 d) -{ - switch (a) - { - case 0x080000: - nBCU2TileXOffset = d; - return; - - case 0x080002: - nBCU2TileYOffset = d; - return; - - case 0x080006: - // toaplan1_fcu_flipscreen_w - return; - - case 0x100000: - return; // nop - - case 0x100002: - bEnableInterrupts = (d & 0xFF); - return; - - case 0x100008: - case 0x10000a: - case 0x10000c: - case 0x10000e: - // toaplan1_bcu_control_w - return; - - case 0x14000c: - // samesame_coin_w - return; - - case 0x14000e: - to_mcu = d & 0xff; - z80cmdavailable = 1; - return; - - case 0x180000: - // toaplan1_bcu_flipscreen_w - return; - - case 0x180002: - ToaBCU2SetRAMPointer(d); - return; - - case 0x180004: - case 0x180006: - ToaBCU2WriteRAM(d); - return; - - case 0x180010: - case 0x180012: - case 0x180014: - case 0x180016: - case 0x180018: - case 0x18001a: - case 0x18001c: - case 0x18001e: - BCU2Reg[(a & 0x0f) >> 1] = d; - return; - - case 0x1c0000: - return; // nop - - case 0x1c0002: - ToaFCU2SetRAMPointer(d); - return; - - case 0x1c0004: - ToaFCU2WriteRAM(d); - return; - - case 0x1c0006: - ToaFCU2WriteRAMSize(d); - return; - } -} - -static void __fastcall samesameWriteByte(UINT32 , UINT8 ) -{ - return; -} - -static UINT16 __fastcall samesameReadWord(UINT32 a) -{ - switch (a) - { - case 0x140000: - return DrvInputs[0]; - - case 0x140002: - return DrvInputs[1]; - - case 0x140004: - return DrvDips[0]; - - case 0x140006: - return DrvDips[1]; - - case 0x140008: - return DrvInputs[2]; - - case 0x14000a: - return (0x80 | DrvDips[2]); - - case 0x14000e: - return 0; // mcu reads... - - case 0x180002: - return ToaBCU2GetRAMPointer(); - - case 0x180004: - return ToaBCU2ReadRAM_Hi(); - - case 0x180006: - return ToaBCU2ReadRAM_Lo(); - - case 0x180010: - case 0x180012: - case 0x180014: - case 0x180016: - case 0x180018: - case 0x18001a: - case 0x18001c: - case 0x18001e: - return BCU2Reg[(a & 0x0f) >> 1]; - - case 0x1c0002: - return ToaFCU2GetRAMPointer(); - - case 0x1c0004: - return ToaFCU2ReadRAM(); - - case 0x1c0006: - return ToaFCU2ReadRAMSize(); - } - - return 0; -} - -static UINT8 __fastcall samesameReadByte(UINT32 a) -{ - switch (a) - { - case 0x100001: - case 0x1c0001: - return ToaVBlankRegister(); - - case 0x140001: - return DrvInputs[0]; - - case 0x140003: - return DrvInputs[1]; - - case 0x140005: - return DrvDips[0]; - - case 0x140007: - return DrvDips[1]; - - case 0x140009: - return DrvInputs[2]; - - case 0x14000b: - return (0x80 | DrvDips[2]); - } - - return 0; -} - -static UINT8 __fastcall samesameZ80In(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x63: { - return (z80cmdavailable) ? 0xff : 0x00; - } - - case 0xa0: { - return to_mcu; - } - - case 0x80: - return BurnYM3812Read(0, 0); - } - - return 0; -} - -static void __fastcall samesameZ80Out(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x80: - BurnYM3812Write(0, 0, nValue); - break; - case 0x81: - BurnYM3812Write(0, 1, nValue); - break; - - case 0xb0: { - to_mcu = nValue; - z80cmdavailable = 0; - } - } -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM3812Reset(); - ZetClose(); - - to_mcu = 0; - z80cmdavailable = 0; - - HiscoreReset(); - - bEnableInterrupts = false; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x080000; - DrvZ80ROM = Next; Next += 0x008000; - - BCU2ROM = Next; Next += nBCU2ROMSize; - FCU2ROM = Next; Next += nFCU2ROMSize; - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x004000; - DrvZ80RAM = Next; Next += 0x000200; - DrvPalRAM = Next; Next += 0x000800; - DrvPalRAM2 = Next; Next += 0x000800; - - BCU2RAM = Next; Next += 0x010000; - FCU2RAM = Next; Next += 0x000800; - FCU2RAMSize = Next; Next += 0x000080; - - RamEnd = Next; - - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - ToaPalette2 = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -// bToaRotateScreen = true; - - BurnSetRefreshRate(REFRESHRATE); - - nBCU2ROMSize = 0x080000; - nFCU2ROMSize = 0x080000; - - // Find out how much memory is needed - AllMem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(AllMem, 0, nLen); - MemIndex(); - - if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1; - if (BurnLoadRom(DrvZ80ROM + 0x000000, 14, 1)) return 1; - - ToaLoadTiles(BCU2ROM, 4, nBCU2ROMSize); - ToaLoadTiles(FCU2ROM, 8, nFCU2ROMSize); - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x07FFFF, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x0c0000, 0x0c3FFF, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x104000, 0x1047FF, MAP_RAM); - SekMapMemory(DrvPalRAM2, 0x106000, 0x1067FF, MAP_RAM); - SekSetReadWordHandler(0, samesameReadWord); - SekSetReadByteHandler(0, samesameReadByte); - SekSetWriteWordHandler(0, samesameWriteWord); - SekSetWriteByteHandler(0, samesameWriteByte); - SekClose(); - } - - { - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(samesameZ80In); - ZetSetOutHandler(samesameZ80Out); - - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3FFF, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xfe00, 0xFFFF, MAP_RAM); - - ZetClose(); - } - - ToaInitBCU2(); - - nToaPalLen = nColCount; - ToaPalSrc = DrvPalRAM; - ToaPalSrc2 = DrvPalRAM2; - ToaPalInit(); - - BurnYM3812Init(1, 28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0); - BurnTimerAttachZetYM3812(28000000 / 8); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - ToaPalExit(); - - ToaExitBCU2(); - SekExit(); - ZetExit(); - - BurnFree(AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderBCU2(); - } - - ToaPalUpdate(); - ToaPal2Update(); - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] |= (DrvJoy1[i] & 1) << i; - DrvInputs[1] |= (DrvJoy2[i] & 1) << i; - DrvInputs[2] |= (DrvJoy3[i] & 1) << i; - } - ToaClearOpposites(&DrvInputs[0]); - ToaClearOpposites(&DrvInputs[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - nCyclesTotal[1] = INT32(28000000.0 / 8 / REFRESHRATE); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); - } - - ToaBufferFCU2Sprites(); - - bVBlank = true; - if (bEnableInterrupts) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (bVBlank || (!CheckSleep(0))) { - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - nToa1Cycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesDone[1] = ZetTotalCycles() - nCyclesTotal[1]; - -// bprintf(PRINT_NORMAL, _T(" %i\n"), nCyclesDone[0]); - - ToaBufferFCU2Sprites(); - - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); // sprite buffer finished... - - SekClose(); - ZetClose(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - ToaScanBCU2(nAction, pnMin); - - SCAN_VAR(nCyclesDone); - SCAN_VAR(to_mcu); - SCAN_VAR(z80cmdavailable); - - ToaRecalcPalette = 1; - bDrawScreen = true; // get background back ? - } - - return 0; -} - -// Fire Shark - -static struct BurnRomInfo fireshrkRomDesc[] = { - { "09.8j", 0x08000, 0xf0c70e6f, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "10.8l", 0x08000, 0x9d253d77, BRF_PRG | BRF_ESS }, // 1 - { "o17_11ii.7j", 0x20000, 0x6beac378, BRF_PRG | BRF_ESS }, // 2 - { "o17_12ii.7l", 0x20000, 0x6adb6eb5, BRF_PRG | BRF_ESS }, // 3 - - { "o17_05.12j", 0x20000, 0x565315f8, BRF_GRA }, // 4 Tile data - { "o17_06.13j", 0x20000, 0x95262d4c, BRF_GRA }, // 5 - { "o17_07.12l", 0x20000, 0x4c4b735c, BRF_GRA }, // 6 - { "o17_08.13l", 0x20000, 0x95c6586c, BRF_GRA }, // 7 - - { "o17_01.1d", 0x20000, 0xea12e491, BRF_GRA }, // 8 - { "o17_02.3d", 0x20000, 0x32a13a9f, BRF_GRA }, // 9 - { "o17_03.5d", 0x20000, 0x68723dc9, BRF_GRA }, // 10 - { "o17_04.7d", 0x20000, 0xfe0ecb13, BRF_GRA }, // 12 - - { "prom14.25b", 0x00020, 0xbc88cced, BRF_GRA }, // 12 Sprite attribute PROM - { "prom15.20c", 0x00020, 0xa1e17492, BRF_GRA }, // 13 - - { "hd647180.017", 0x08000, 0x43523032, BRF_PRG }, // 14 Sound HD647180 code -}; - -STD_ROM_PICK(fireshrk) -STD_ROM_FN(fireshrk) - -struct BurnDriver BurnDrvFireshrk = { - "fireshrk", NULL, NULL, NULL, "1990", - "Fire Shark\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, fireshrkRomInfo, fireshrkRomName, NULL, NULL, SamesameInputInfo, FireshrkDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Fire Shark (Earlier) - -static struct BurnRomInfo fireshrkaRomDesc[] = { - { "o17_09ii.8j", 0x08000, 0xb60541ee, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o17_10ii.8l", 0x08000, 0x96f5045e, BRF_PRG | BRF_ESS }, // 1 - { "o17_11ii.7j", 0x20000, 0x6beac378, BRF_PRG | BRF_ESS }, // 2 - { "o17_12ii.7l", 0x20000, 0x6adb6eb5, BRF_PRG | BRF_ESS }, // 3 - - { "o17_05.12j", 0x20000, 0x565315f8, BRF_GRA }, // 4 Tile data - { "o17_06.13j", 0x20000, 0x95262d4c, BRF_GRA }, // 5 - { "o17_07.12l", 0x20000, 0x4c4b735c, BRF_GRA }, // 6 - { "o17_08.13l", 0x20000, 0x95c6586c, BRF_GRA }, // 7 - - { "o17_01.1d", 0x20000, 0xea12e491, BRF_GRA }, // 8 - { "o17_02.3d", 0x20000, 0x32a13a9f, BRF_GRA }, // 9 - { "o17_03.5d", 0x20000, 0x68723dc9, BRF_GRA }, // 10 - { "o17_04.7d", 0x20000, 0xfe0ecb13, BRF_GRA }, // 12 - - { "prom14.25b", 0x00020, 0xbc88cced, BRF_GRA }, // 12 Sprite attribute PROM - { "prom15.20c", 0x00020, 0xa1e17492, BRF_GRA }, // 13 - - { "hd647180.017", 0x08000, 0x43523032, BRF_PRG }, // 14 Sound HD647180 code -}; - -STD_ROM_PICK(fireshrka) -STD_ROM_FN(fireshrka) - -struct BurnDriver BurnDrvFireshrka = { - "fireshrka", "fireshrk", NULL, NULL, "1989", - "Fire Shark (Earlier)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, fireshrkaRomInfo, fireshrkaRomName, NULL, NULL, SamesameInputInfo, FireshrkaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Fire Shark (Korea, set 1, easier) - -static struct BurnRomInfo fireshrkdRomDesc[] = { - { "o17_09dyn.8j", 0x10000, 0xe25eee27, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o17_10dyn.8l", 0x10000, 0xc4c58cf6, BRF_PRG | BRF_ESS }, // 1 - { "o17_11ii.7j", 0x20000, 0x6beac378, BRF_PRG | BRF_ESS }, // 2 - { "o17_12ii.7l", 0x20000, 0x6adb6eb5, BRF_PRG | BRF_ESS }, // 3 - - { "o17_05.12j", 0x20000, 0x565315f8, BRF_GRA }, // 4 Tile data - { "o17_06.13j", 0x20000, 0x95262d4c, BRF_GRA }, // 5 - { "o17_07.12l", 0x20000, 0x4c4b735c, BRF_GRA }, // 6 - { "o17_08.13l", 0x20000, 0x95c6586c, BRF_GRA }, // 7 - - { "o17_01.1d", 0x20000, 0xea12e491, BRF_GRA }, // 8 - { "o17_02.3d", 0x20000, 0x32a13a9f, BRF_GRA }, // 9 - { "o17_03.5d", 0x20000, 0x68723dc9, BRF_GRA }, // 10 - { "o17_04.7d", 0x20000, 0xfe0ecb13, BRF_GRA }, // 12 - - { "prom14.25b", 0x00020, 0xbc88cced, BRF_GRA }, // 12 Sprite attribute PROM - { "prom15.20c", 0x00020, 0xa1e17492, BRF_GRA }, // 13 - - { "hd647180.017", 0x08000, 0x43523032, BRF_PRG }, // 14 Sound HD647180 code -}; - -STD_ROM_PICK(fireshrkd) -STD_ROM_FN(fireshrkd) - -struct BurnDriver BurnDrvFireshrkd = { - "fireshrkd", "fireshrk", NULL, NULL, "1990", - "Fire Shark (Korea, set 1, easier)\0", NULL, "Toaplan (Dooyong license)", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, fireshrkdRomInfo, fireshrkdRomName, NULL, NULL, SamesameInputInfo, Samesam2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Fire Shark (Korea, set 2, harder) - -static struct BurnRomInfo fireshrkdhRomDesc[] = { - { "o17_09dyh.8j", 0x10000, 0x7b4c14dd, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o17_10dyh.8l", 0x10000, 0xa3f159f9, BRF_PRG | BRF_ESS }, // 1 - { "o17_11ii.7j", 0x20000, 0x6beac378, BRF_PRG | BRF_ESS }, // 2 - { "o17_12ii.7l", 0x20000, 0x6adb6eb5, BRF_PRG | BRF_ESS }, // 3 - - { "o17_05.12j", 0x20000, 0x565315f8, BRF_GRA }, // 4 Tile data - { "o17_06.13j", 0x20000, 0x95262d4c, BRF_GRA }, // 5 - { "o17_07.12l", 0x20000, 0x4c4b735c, BRF_GRA }, // 6 - { "o17_08.13l", 0x20000, 0x95c6586c, BRF_GRA }, // 7 - - { "o17_01.1d", 0x20000, 0xea12e491, BRF_GRA }, // 8 - { "o17_02.3d", 0x20000, 0x32a13a9f, BRF_GRA }, // 9 - { "o17_03.5d", 0x20000, 0x68723dc9, BRF_GRA }, // 10 - { "o17_04.7d", 0x20000, 0xfe0ecb13, BRF_GRA }, // 12 - - { "prom14.25b", 0x00020, 0xbc88cced, BRF_GRA }, // 12 Sprite attribute PROM - { "prom15.20c", 0x00020, 0xa1e17492, BRF_GRA }, // 13 - - { "hd647180.017", 0x08000, 0x43523032, BRF_PRG }, // 14 Sound HD647180 code -}; - -STD_ROM_PICK(fireshrkdh) -STD_ROM_FN(fireshrkdh) - -struct BurnDriver BurnDrvFireshrkdh = { - "fireshrkdh", "fireshrk", NULL, NULL, "1990", - "Fire Shark (Korea, set 2, harder)\0", NULL, "Toaplan (Dooyong license)", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, fireshrkdhRomInfo, fireshrkdhRomName, NULL, NULL, SamesameInputInfo, Samesam2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Same! Same! Same! (2 player alternating ver.) - -static struct BurnRomInfo samesameRomDesc[] = { - { "o17_09.8j", 0x08000, 0x3f69e437, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o17_10.8l", 0x08000, 0x4e723e0a, BRF_PRG | BRF_ESS }, // 1 - { "o17_11.7j", 0x20000, 0xbe07d101, BRF_PRG | BRF_ESS }, // 2 - { "o17_12.7l", 0x20000, 0xef698811, BRF_PRG | BRF_ESS }, // 3 - - { "o17_05.12j", 0x20000, 0x565315f8, BRF_GRA }, // 4 Tile data - { "o17_06.13j", 0x20000, 0x95262d4c, BRF_GRA }, // 5 - { "o17_07.12l", 0x20000, 0x4c4b735c, BRF_GRA }, // 6 - { "o17_08.13l", 0x20000, 0x95c6586c, BRF_GRA }, // 7 - - { "o17_01.1d", 0x20000, 0xea12e491, BRF_GRA }, // 8 - { "o17_02.3d", 0x20000, 0x32a13a9f, BRF_GRA }, // 9 - { "o17_03.5d", 0x20000, 0x68723dc9, BRF_GRA }, // 10 - { "o17_04.7d", 0x20000, 0xfe0ecb13, BRF_GRA }, // 12 - - { "prom14.25b", 0x00020, 0xbc88cced, BRF_GRA }, // 12 Sprite attribute PROM - { "prom15.20c", 0x00020, 0xa1e17492, BRF_GRA }, // 13 - - { "hd647180.017", 0x08000, 0x43523032, BRF_PRG }, // 14 Sound HD647180 code -}; - -STD_ROM_PICK(samesame) -STD_ROM_FN(samesame) - -struct BurnDriver BurnDrvSamesame = { - "samesame", "fireshrk", NULL, NULL, "1989", - "Same! Same! Same! (2 player alternating ver.)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - L"\u9BAB!\u9BAB!\u9BAB!\0Same! Same! Same! (2 player alternating ver.)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, samesameRomInfo, samesameRomName, NULL, NULL, SamesameInputInfo, SamesameDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Same! Same! Same! - -static struct BurnRomInfo samesame2RomDesc[] = { - { "o17_09x.8j", 0x08000, 0x3472e03e, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o17_10x.8l", 0x08000, 0xa3ac49b5, BRF_PRG | BRF_ESS }, // 1 - { "o17_11ii.7j", 0x20000, 0x6beac378, BRF_PRG | BRF_ESS }, // 2 - { "o17_12ii.7l", 0x20000, 0x6adb6eb5, BRF_PRG | BRF_ESS }, // 3 - - { "o17_05.12j", 0x20000, 0x565315f8, BRF_GRA }, // 4 Tile data - { "o17_06.13j", 0x20000, 0x95262d4c, BRF_GRA }, // 5 - { "o17_07.12l", 0x20000, 0x4c4b735c, BRF_GRA }, // 6 - { "o17_08.13l", 0x20000, 0x95c6586c, BRF_GRA }, // 7 - - { "o17_01.1d", 0x20000, 0xea12e491, BRF_GRA }, // 8 - { "o17_02.3d", 0x20000, 0x32a13a9f, BRF_GRA }, // 9 - { "o17_03.5d", 0x20000, 0x68723dc9, BRF_GRA }, // 10 - { "o17_04.7d", 0x20000, 0xfe0ecb13, BRF_GRA }, // 12 - - { "prom14.25b", 0x00020, 0xbc88cced, BRF_GRA }, // 12 Sprite attribute PROM - { "prom15.20c", 0x00020, 0xa1e17492, BRF_GRA }, // 13 - - { "hd647180.017", 0x08000, 0x43523032, BRF_PRG }, // 14 Sound HD647180 code -}; - -STD_ROM_PICK(samesame2) -STD_ROM_FN(samesame2) - -struct BurnDriver BurnDrvSamesame2 = { - "samesame2", "fireshrk", NULL, NULL, "1989", - "Same! Same! Same!\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - L"\u9BAB!\u9BAB!\u9BAB!\0Same! Same! Same!\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, samesame2RomInfo, samesame2RomName, NULL, NULL, SamesameInputInfo, Samesam2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Same! Same! Same! NEW VER! (v1.00, hack by Trap15) - -static struct BurnRomInfo samesamenhRomDesc[] = { - { "o17_09_nv.8j", 0x08000, 0xf60af2f9, BRF_PRG | BRF_ESS }, // 0 CPU #0 code - { "o17_10_nv.8l", 0x08000, 0x023bcb95, BRF_PRG | BRF_ESS }, // 1 - { "o17_11.7j", 0x20000, 0xbe07d101, BRF_PRG | BRF_ESS }, // 2 - { "o17_12.7l", 0x20000, 0xef698811, BRF_PRG | BRF_ESS }, // 3 - - { "o17_05.12j", 0x20000, 0x565315f8, BRF_GRA }, // 4 Tile data - { "o17_06.13j", 0x20000, 0x95262d4c, BRF_GRA }, // 5 - { "o17_07.12l", 0x20000, 0x4c4b735c, BRF_GRA }, // 6 - { "o17_08.13l", 0x20000, 0x95c6586c, BRF_GRA }, // 7 - - { "o17_01.1d", 0x20000, 0xea12e491, BRF_GRA }, // 8 - { "o17_02.3d", 0x20000, 0x32a13a9f, BRF_GRA }, // 9 - { "o17_03.5d", 0x20000, 0x68723dc9, BRF_GRA }, // 10 - { "o17_04.7d", 0x20000, 0xfe0ecb13, BRF_GRA }, // 12 - - { "prom14.25b", 0x00020, 0xbc88cced, BRF_GRA }, // 12 Sprite attribute PROM - { "prom15.20c", 0x00020, 0xa1e17492, BRF_GRA }, // 13 - - { "hd647180.017", 0x08000, 0x43523032, BRF_PRG }, // 14 Sound HD647180 code -}; - -STD_ROM_PICK(samesamenh) -STD_ROM_FN(samesamenh) - -struct BurnDriver BurnDrvSamenew = { - "samesamenh", "fireshrk", NULL, NULL, "1989", - "Same! Same! Same! NEW VER! (v1.00, hack by Trap15)\0", NULL, "Hack / Trap15", "Toaplan BCU-2 / FCU-2 based", - L"\u9BAB!\u9BAB!\u9BAB!\0Same! Same! Same! NEW VER! (v1.00, hack by Trap15)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, samesamenhRomInfo, samesamenhRomName, NULL, NULL, SamesameInputInfo, SamesameDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_shippumd.cpp b/jan/src/burn/drv/toaplan/d_shippumd.cpp deleted file mode 100644 index ba6c6c63a..000000000 --- a/jan/src/burn/drv/toaplan/d_shippumd.cpp +++ /dev/null @@ -1,681 +0,0 @@ -// FB Alpha Shippu Mahou Daisakusen driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -// Shippu Mahou Daisakusen - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -// Rom information -static struct BurnRomInfo shippumdRomDesc[] = { - { "ma02rom1.bin", 0x080000, 0xA678B149, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "ma02rom0.bin", 0x080000, 0xF226A212, BRF_ESS | BRF_PRG }, // 1 (odd) - - { "ma02rom3.bin", 0x200000, 0x0E797142, BRF_GRA }, // 2 GP9001 Tile data - { "ma02rom4.bin", 0x200000, 0x72A6FA53, BRF_GRA }, // 3 - - { "ma02rom5.bin", 0x008000, 0x116AE559, BRF_GRA }, // 4 Extra text layer tile data - - { "ma02rom2.bin", 0x010000, 0xDDE8A57E, BRF_ESS | BRF_PRG }, // 5 Z80 program - - { "ma02rom6.bin", 0x080000, 0x199E7CAE, BRF_SND }, // 6 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(shippumd) -STD_ROM_FN(shippumd) - -static struct BurnRomInfo kingdmgpRomDesc[] = { - { "ma02rom1.bin", 0x080000, 0xA678B149, BRF_ESS | BRF_PRG }, // 0 CPU #0 code (even) - { "ma02rom0.bin", 0x080000, 0xF226A212, BRF_ESS | BRF_PRG }, // 1 (odd) - - { "ma02rom3.bin", 0x200000, 0x0E797142, BRF_GRA }, // 2 GP9001 Tile data - { "ma02rom4.bin", 0x200000, 0x72A6FA53, BRF_GRA }, // 3 - - { "ma02rom5.eng", 0x008000, 0x8C28460B, BRF_GRA }, // 4 Extra text layer tile data - - { "ma02rom2.bin", 0x010000, 0xDDE8A57E, BRF_ESS | BRF_PRG }, // 5 Z80 program - - { "ma02rom6.bin", 0x080000, 0x199E7CAE, BRF_SND }, // 6 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(kingdmgp) -STD_ROM_FN(kingdmgp) - -static struct BurnInputInfo shippumdInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(shippumd) - -static struct BurnDIPInfo shippumdDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Coin mode"}, - {0x14, 0x01, 0x01, 0x00, "Coin play"}, - {0x14, 0x01, 0x01, 0x01, "Free play"}, - {0, 0xFE, 0, 2, "Screen"}, - {0x14, 0x01, 0x02, 0x00, "Normal"}, - {0x14, 0x01, 0x02, 0x02, "Invert"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0x30, 0x10, "1 coin 2 plays"}, - {0x14, 0x01, 0x30, 0x20, "2 coins 1 play"}, - {0x14, 0x01, 0x30, 0x30, "2 coins 3 plays"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x14, 0x01, 0xC0, 0x40, "1 coin 2 plays"}, - {0x14, 0x01, 0xC0, 0x80, "2 coins 1 play"}, - {0x14, 0x01, 0xC0, 0xC0, "2 coins 3 plays"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B (normal)"}, - {0x15, 0x01, 0x03, 0x01, "A (easy)"}, - {0x15, 0x01, 0x03, 0x02, "C (hard)"}, - {0x15, 0x01, 0x03, 0x03, "D (more hard)"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x15, 0x01, 0x0C, 0x00, "300000 pts every"}, - {0x15, 0x01, 0x0C, 0x04, "200000 & 500000 pts"}, - {0x15, 0x01, 0x0C, 0x08, "200000 only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Number of heroes"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x10, "5"}, - {0x15, 0x01, 0x30, 0x20, "2"}, - {0x15, 0x01, 0x30, 0x30, "1"}, - {0, 0xFE, 0, 2, "No death & stop mode"}, - {0x15, 0x01, 0x40, 0x00, "Off"}, - {0x15, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Continue mode"}, - {0x15, 0x01, 0x80, 0x00, "Continue play"}, - {0x15, 0x01, 0x80, 0x80, "Continue impossible"}, -}; - -static struct BurnDIPInfo shippumdRegionDIPList[] = { - // Defaults - {0x16, 0xFF, 0x0E, 0x00, NULL}, - - // Region - {0, 0xFE, 0, 1, "Region"}, - {0x16, 0x01, 0x0E, 0x00, "Japan"}, - {0x16, 0x01, 0x0E, 0x02, "U.S.A."}, - {0x16, 0x01, 0x0E, 0x04, "Europe"}, - {0x16, 0x01, 0x0E, 0x06, "South East Asia"}, - {0x16, 0x01, 0x0E, 0x08, "China"}, - {0x16, 0x01, 0x0E, 0x0A, "Korea"}, - {0x16, 0x01, 0x0E, 0x0C, "Hong Kong"}, - {0x16, 0x01, 0x0E, 0x0E, "Taiwan"}, -}; - -static struct BurnDIPInfo kingdmgpRegionDIPList[] = { - // Defaults - {0x16, 0xFF, 0x0E, 0x04, NULL}, - - // Region - {0, 0xFE, 0, 7, "Region"}, - {0x16, 0x01, 0x0E, 0x02, "U.S.A."}, - {0x16, 0x01, 0x0E, 0x04, "Europe"}, - {0x16, 0x01, 0x0E, 0x06, "South East Asia"}, - {0x16, 0x01, 0x0E, 0x08, "China"}, - {0x16, 0x01, 0x0E, 0x0A, "Korea"}, - {0x16, 0x01, 0x0E, 0x0C, "Hong Kong"}, - {0x16, 0x01, 0x0E, 0x0E, "Taiwan"}, - {0x16, 0x01, 0x0E, 0x00, "Japan"}, -}; - -STDDIPINFOEXT(shippumd, shippumd, shippumdRegion) -STDDIPINFOEXT(kingdmgp, shippumd, kingdmgpRegion) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *Ram02, *RamPal; - -static INT32 nColCount = 0x0800; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x100000; // - RomZ80 = Next; Next += 0x010000; // Z80 ROM - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - ExtraTROM = Next; Next += 0x008000; // Extra Text layer tile data - MSM6295ROM = Next; Next += 0x080000; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - Ram02 = Next; Next += 0x000800; // - ExtraTRAM = Next; Next += 0x002000; // Extra tile layer - ExtraTScroll= Next; Next += 0x001000; // - ExtraTSelect= Next; Next += 0x001000; // - RamPal = Next; Next += 0x001000; // palette - RamZ80 = Next; Next += 0x004000; // Z80 RAM - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029497; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // Scan 68000 - ZetScan(nAction); // Scan Z80 - - MSM6295Scan(0, nAction); - BurnYM2151Scan(nAction); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(DrvInput); - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - if (ToaLoadCode(Rom01, 0, 2)) { - return 1; - } - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 2, 2, nGP9001ROMSize[0]); - - // Load Extra text layer tile data - BurnLoadRom(ExtraTROM, 4, 1); - - // Load Z80 ROM - BurnLoadRom(RomZ80, 5, 1); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROM, 6, 1); - - return 0; -} - -UINT8 __fastcall shippumdZ80Read(UINT16 nAddress) -{ - if (nAddress == 0xE001) { - return BurnYM2151ReadStatus(); - } - if (nAddress == 0xE004) { - return MSM6295ReadStatus(0); - } - return 0; -} - -void __fastcall shippumdZ80Write(UINT16 nAddress, UINT8 nValue) -{ - switch (nAddress) { - case 0xE000: - BurnYM2151SelectRegister(nValue); - break; - case 0xE001: - BurnYM2151WriteRegister(nValue); - break; - case 0xE004: - MSM6295Command(0, nValue); - break; - } -} - -static INT32 DrvZ80Init() -{ - // Init the Z80 - ZetInit(0); - ZetOpen(0); - - ZetSetReadHandler(shippumdZ80Read); - ZetSetWriteHandler(shippumdZ80Write); - - // ROM - ZetMapArea (0x0000, 0xFFFF, 0, RomZ80); // Direct Read from ROM - ZetMapArea (0x0000, 0xFFFF, 2, RomZ80); // Direct Fetch from ROM - // RAM - ZetMapArea (0xC000, 0xDFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0xC000, 0xDFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0xC000, 0xDFFF, 2, RamZ80); // - // Callbacks - ZetMemCallback(0xE000, 0xE0FF, 0); // Read - ZetMemCallback(0xE000, 0xE0FF, 1); // Write - - ZetClose(); - - return 0; -} - -UINT8 __fastcall shippumdReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x21C021: // Player 1 inputs - return DrvInput[0]; - case 0x21C025: // Player 2 inputs - return DrvInput[1]; - case 0x21C029: // Other inputs - return DrvInput[2]; - case 0x21C02D: // Dipswitch A - return DrvInput[3]; - case 0x21C031: // Dipswitch B - return DrvInput[4]; - case 0x21C035: // Dipswitch C - Territory - return DrvInput[5]; - - case 0x30000D: - return ToaVBlankRegister(); - - default: { -// printf("Attempt to read byte value of location %x\n", sekAddress); - - if ((sekAddress & 0x00FFC000) == 0x00218000) { - return RamZ80[(sekAddress & 0x3FFF) >> 1]; - } - } - } - return 0; -} - -UINT16 __fastcall shippumdReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x21C020: // Player 1 inputs - return DrvInput[0]; - case 0x21C024: // Player 2 inputs - return DrvInput[1]; - case 0x21C028: // Other inputs - return DrvInput[2]; - case 0x21C02C: // Dipswitch A - return DrvInput[3]; - case 0x21C030: // Dipswitch B - return DrvInput[4]; - case 0x21C034: // Dipswitch C - Territory - return DrvInput[5]; - - case 0x21C03C: - return ToaScanlineRegister(); - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x30000C: - return ToaVBlankRegister(); - - default: { - if ((sekAddress & 0x00FFC000) == 0x00218000) { - return RamZ80[(sekAddress & 0x3FFF) >> 1]; - } - -// printf("Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall shippumdWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x21C01D: { - MSM6295SetBank(0, MSM6295ROM + ((byteValue & 0x10) << 14), 0x00000, 0x3ffff); - break; - } - - default: { - if ((sekAddress & 0x00FFC000) == 0x00218000) { - RamZ80[(sekAddress & 0x3FFF) >> 1] = byteValue; - } - -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall shippumdWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x21C01C: { - MSM6295SetBank(0, MSM6295ROM + ((wordValue & 0x10) << 14), 0x00000, 0x3ffff); - break; - } - - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: - ToaGP9001WriteRegister(wordValue); - break; - - default: { -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - if ((sekAddress & 0x00FFC000) == 0x00218000) { - RamZ80[(sekAddress & 0x3FFF) >> 1] = wordValue; - } - } - } -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - ZetClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x400000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x0FFFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); // Palette RAM - SekMapMemory(Ram02, 0x401000, 0x4017FF, MAP_RAM); // Unused - SekMapMemory(ExtraTRAM, 0x500000, 0x502FFF, MAP_RAM); - SekMapMemory(ExtraTSelect, 0x502000, 0x502FFF, MAP_RAM); // 0x502000 - Scroll; 0x502200 - RAM - SekMapMemory(ExtraTScroll, 0x503000, 0x503FFF, MAP_RAM); // 0x203000 - Offset; 0x503200 - RAM - - SekSetReadWordHandler(0, shippumdReadWord); - SekSetReadByteHandler(0, shippumdReadByte); - SekSetWriteWordHandler(0, shippumdWriteWord); - SekSetWriteByteHandler(0, shippumdWriteByte); - - SekClose(); - } - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - ToaInitGP9001(); - - nExtraTXOffset = 0x2C; - ToaExtraTextInit(); - - DrvZ80Init(); // Initialize Z80 - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - BurnYM2151Init(27000000 / 8); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 32000000 / 32 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - MSM6295Exit(0); - BurnYM2151Exit(); - - ToaPalExit(); - - ToaExitGP9001(); - ToaExtraTextExit(); - ToaZExit(); // Z80 exit - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - ToaExtraTextLayer(); // Render extra text layer - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = TOA_Z80_SPEED / 60; - nCyclesDone[0] = nCyclesDone[1] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - ZetOpen(0); - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - ToaBufferGP9001Sprites(); - - bVBlank = true; - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - // Run Z80 - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - - { - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - } - - SekClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -struct BurnDriver BurnDrvShippuMD = { - "shippumd", "kingdmgp", NULL, NULL, "1994", - "Shippu Mahou Daisakusen - Kingdom Grandprix\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - L"\u75BE\u98A8\u9B54\u6CD5\u5927\u4F5C\u6226 (Shippu Mahou Daisakusen - Kingdom Grandprix Japan)\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, shippumdRomInfo, shippumdRomName, NULL, NULL, shippumdInputInfo, shippumdDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvKingdmGP = { - "kingdmgp", NULL, NULL, NULL, "1994", - "Kingdom Grandprix (World)\0", NULL, "Raizing / 8ing", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, kingdmgpRomInfo, kingdmgpRomName, NULL, NULL, shippumdInputInfo, kingdmgpDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_slapfght.cpp b/jan/src/burn/drv/toaplan/d_slapfght.cpp deleted file mode 100644 index f5885578e..000000000 --- a/jan/src/burn/drv/toaplan/d_slapfght.cpp +++ /dev/null @@ -1,2567 +0,0 @@ -// Tiger Heli, Get Star / Guardian, & Slap Fight -// Based on MAME sources by K.Wilkins,Stephane Humbert - -#include "tiles_generic.h" -#include "z80_intf.h" -#include "taito_m68705.h" -#include "bitswap.h" -#include "driver.h" -extern "C" { - #include "ay8910.h" -} - -static INT32 nWhichGame; - -static bool bInterruptEnable; -static bool bSoundCPUEnable; -static bool bSoundNMIEnable; -static bool bVBlank; - -static INT32 nStatusIndex; -static INT32 nProtectIndex; - -static UINT8 GetStarType = 0; -#define GETSTAR 1 -#define GETSTARB1 3 -#define GETSTARB2 4 - -static UINT8 getstar_e803_r(); -static void getstar_e803_w(); - -// --------------------------------------------------------------------------- -// Inputs - -static UINT8 tigerhInput[4] = {0,0,0,0}; -static UINT8 tigerhInpJoy1[8]; -static UINT8 tigerhInpMisc[8]; -static UINT8 tigerhReset = 0; - -// Dip Switch and Input Definitions -static struct BurnInputInfo tigerhInputList[] = { - {"P1 Coin", BIT_DIGITAL, tigerhInpMisc + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, tigerhInpMisc + 4, "p1 start"}, - {"P1 Up", BIT_DIGITAL, tigerhInpJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, tigerhInpJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, tigerhInpJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, tigerhInpJoy1 + 2, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, tigerhInpMisc + 1, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, tigerhInpMisc + 0, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, tigerhInpMisc + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, tigerhInpMisc + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, tigerhInpJoy1 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, tigerhInpJoy1 + 5, "p2 down"}, - {"P2 Left", BIT_DIGITAL, tigerhInpJoy1 + 7, "p2 left"}, - {"P2 Right", BIT_DIGITAL, tigerhInpJoy1 + 6, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, tigerhInpMisc + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, tigerhInpMisc + 2, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &tigerhReset, "reset"}, - - {"Dip A", BIT_DIPSWITCH, tigerhInput + 2, "dip"}, - {"Dip B", BIT_DIPSWITCH, tigerhInput + 3, "dip"}, -}; - -STDINPUTINFO(tigerh) - -static struct BurnInputInfo getstarInputList[] = { - {"P1 Coin", BIT_DIGITAL, tigerhInpMisc + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, tigerhInpMisc + 4, "p1 start"}, - {"P1 Up", BIT_DIGITAL, tigerhInpJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, tigerhInpJoy1 + 2, "p1 down"}, - {"P1 Left", BIT_DIGITAL, tigerhInpJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, tigerhInpJoy1 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, tigerhInpMisc + 1, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, tigerhInpMisc + 0, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, tigerhInpMisc + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, tigerhInpMisc + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, tigerhInpJoy1 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, tigerhInpJoy1 + 6, "p2 down"}, - {"P2 Left", BIT_DIGITAL, tigerhInpJoy1 + 7, "p2 left"}, - {"P2 Right", BIT_DIGITAL, tigerhInpJoy1 + 5, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, tigerhInpMisc + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, tigerhInpMisc + 2, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &tigerhReset, "reset"}, - - {"Dip A", BIT_DIPSWITCH, tigerhInput + 2, "dip"}, - {"Dip B", BIT_DIPSWITCH, tigerhInput + 3, "dip"}, -}; - -STDINPUTINFO(getstar) - -static struct BurnInputInfo performanInputList[] = { - {"P1 Coin", BIT_DIGITAL, tigerhInpMisc + 6, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, tigerhInpMisc + 4, "p1 start"}, - {"P1 Up", BIT_DIGITAL, tigerhInpJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, tigerhInpJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, tigerhInpJoy1 + 3, "p1 left"}, - {"P1 Right", BIT_DIGITAL, tigerhInpJoy1 + 2, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, tigerhInpMisc + 1, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, tigerhInpMisc + 0, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, tigerhInpMisc + 7, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, tigerhInpMisc + 5, "p2 start"}, - {"P2 Up", BIT_DIGITAL, tigerhInpJoy1 + 4, "p2 up"}, - {"P2 Down", BIT_DIGITAL, tigerhInpJoy1 + 5, "p2 down"}, - {"P2 Left", BIT_DIGITAL, tigerhInpJoy1 + 7, "p2 left"}, - {"P2 Right", BIT_DIGITAL, tigerhInpJoy1 + 6, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, tigerhInpMisc + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, tigerhInpMisc + 2, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &tigerhReset, "reset"}, - - {"Dip A", BIT_DIPSWITCH, tigerhInput + 2, "dip"}, - {"Dip B", BIT_DIPSWITCH, tigerhInput + 3, "dip"}, -}; - -STDINPUTINFO(performan) - -static struct BurnDIPInfo tigerhDIPList[] = { - // Defaults - {0x11, 0xFF, 0xFF, 0x10, NULL}, - {0x12, 0xFF, 0xFF, 0x00, NULL}, - - // DIP A - {0, 0xFE, 0, 2, "Hero speed"}, - {0x11, 0x01, 0x80, 0x00, "Normal"}, - {0x11, 0x01, 0x80, 0x80, "Fast"}, - {0, 0xFE, 0, 2, "Service"}, - {0x11, 0x01, 0x40, 0x00, "Normal game"}, - {0x11, 0x01, 0x40, 0x40, "DIP switch test"}, - {0, 0xFE, 0, 2, "Screen mode"}, - {0x11, 0x01, 0x20, 0x00, "Normal screen"}, - {0x11, 0x01, 0x20, 0x20, "Invert screen"}, - {0, 0xFE, 0, 2, "Cabinet"}, - {0x11, 0x01, 0x10, 0x10, "Upright"}, - {0x11, 0x01, 0x10, 0x00, "Table"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x11, 0x01, 0x08, 0x00, "On"}, - {0x11, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 7, "Coinage"}, - {0x11, 0x01, 0x07, 0x00, "1 coin 1 credit"}, - {0x11, 0x01, 0x07, 0x01, "1 coin 2 credits"}, - {0x11, 0x01, 0x07, 0x02, "1 coin 3 credits"}, - {0x11, 0x01, 0x07, 0x03, "2 coins 1 credit"}, - {0x11, 0x01, 0x07, 0x04, "2 coins 3 credits"}, - {0x11, 0x01, 0x07, 0x05, "3 coins 1 credit"}, - {0x11, 0x01, 0x07, 0x07, "Free play"}, - {0x11, 0x01, 0x07, 0x06, "3 coins 1 credit"}, - - // DIP B - {0, 0xFE, 0, 2, "Extend"}, - {0x12, 0x01, 0x10, 0x00, "20000 & 80000"}, - {0x12, 0x01, 0x10, 0x10, "50000 & 120000"}, - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x12, 0x01, 0x0C, 0x00, "0"}, - {0x12, 0x01, 0x0C, 0x04, "1"}, - {0x12, 0x01, 0x0C, 0x08, "2"}, - {0x12, 0x01, 0x0C, 0x0C, "3"}, - {0, 0xFE, 0, 4, "Number of heroes"}, - {0x12, 0x01, 0x03, 0x00, "3"}, - {0x12, 0x01, 0x03, 0x01, "5"}, - {0x12, 0x01, 0x03, 0x02, "1"}, - {0x12, 0x01, 0x03, 0x03, "2"}, -}; - -STDDIPINFO(tigerh) - -static struct BurnDIPInfo getstarDIPList[] = { - // Defaults - {0x11, 0xFF, 0xFF, 0x10, NULL}, - - // DIP A - {0, 0xFE, 0, 2, "Service"}, - {0x11, 0x01, 0x40, 0x00, "Normal game"}, - {0x11, 0x01, 0x40, 0x40, "DIP switch test"}, - {0, 0xFE, 0, 2, "Screen mode"}, - {0x11, 0x01, 0x20, 0x00, "Normal screen"}, - {0x11, 0x01, 0x20, 0x20, "Invert screen"}, - {0, 0xFE, 0, 2, "Cabinet"}, - {0x11, 0x01, 0x10, 0x10, "Upright"}, - {0x11, 0x01, 0x10, 0x00, "Table"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x11, 0x01, 0x08, 0x00, "On"}, - {0x11, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 7, "Coinage"}, - {0x11, 0x01, 0x07, 0x00, "1 coin 1 credit"}, - {0x11, 0x01, 0x07, 0x01, "1 coin 2 credits"}, - {0x11, 0x01, 0x07, 0x02, "1 coin 3 credits"}, - {0x11, 0x01, 0x07, 0x03, "2 coins 1 credit"}, - {0x11, 0x01, 0x07, 0x04, "2 coins 3 credits"}, - {0x11, 0x01, 0x07, 0x05, "3 coins 1 credit"}, - {0x11, 0x01, 0x07, 0x07, "Free play"}, - {0x11, 0x01, 0x07, 0x06, "3 coins 1 credit"}, - - // DIP B - {0, 0xFE, 0, 2, "Extend"}, - {0x12, 0x01, 0x10, 0x00, "30000 & 100000"}, - {0x12, 0x01, 0x10, 0x10, "50000 & 150000"}, - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x12, 0x01, 0x0C, 0x00, "0"}, - {0x12, 0x01, 0x0C, 0x04, "1"}, - {0x12, 0x01, 0x0C, 0x08, "2"}, - {0x12, 0x01, 0x0C, 0x0C, "3"}, -}; - -static struct BurnDIPInfo getstarHeroesDIPList[] = -{ - // Defaults - {0x12, 0xFF, 0xFF, 0x00, NULL}, - - // DIP B - {0, 0xFE, 0, 4, "Number of heroes"}, - {0x12, 0x01, 0x03, 0x02, "1"}, - {0x12, 0x01, 0x03, 0x03, "2"}, - {0x12, 0x01, 0x03, 0x00, "3"}, - {0x12, 0x01, 0x03, 0x01, "5"}, -}; - -static struct BurnDIPInfo getstarb2HeroesDIPList[] = -{ - // Defaults - {0x12, 0xFF, 0xFF, 0x01, NULL}, - - // DIP B - {0, 0xFE, 0, 4, "Number of heroes"}, - {0x12, 0x01, 0x03, 0x01, "3"}, - {0x12, 0x01, 0x03, 0x02, "4"}, - {0x12, 0x01, 0x03, 0x03, "5"}, - {0x12, 0x01, 0x03, 0x00, "240 (cheat)"}, -}; - -STDDIPINFOEXT(getstar, getstar, getstarHeroes) -STDDIPINFOEXT(getstarb2, getstar, getstarb2Heroes) - -static struct BurnDIPInfo slapfighDIPList[] = { - // Defaults - {0x11, 0xFF, 0xFF, 0x80, NULL}, - {0x12, 0xFF, 0xFF, 0x00, NULL}, - - // DIP A - {0, 0xFE, 0, 2, "Cabinet"}, - {0x11, 0x01, 0x80, 0x80, "Up-right type"}, - {0x11, 0x01, 0x80, 0x00, "Table type"}, - {0, 0xFE, 0, 2, "Screen type"}, - {0x11, 0x01, 0x40, 0x00, "Normal screen"}, - {0x11, 0x01, 0x40, 0x40, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x11, 0x01, 0x20, 0x00, "Normal game"}, - {0x11, 0x01, 0x20, 0x20, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x11, 0x01, 0x10, 0x00, "On"}, - {0x11, 0x01, 0x10, 0x10, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x11, 0x01, 0x0C, 0x00, "1 coin 1 play"}, - {0x11, 0x01, 0x0C, 0x08, "1 coin 2 plays"}, - {0x11, 0x01, 0x0C, 0x04, "2 coins 1 play"}, - {0x11, 0x01, 0x0C, 0x0C, "2 coins 3 plays"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x11, 0x01, 0x03, 0x00, "1 coin 1 play"}, - {0x11, 0x01, 0x03, 0x02, "1 coin 2 plays"}, - {0x11, 0x01, 0x03, 0x01, "2 coins 1 play"}, - {0x11, 0x01, 0x03, 0x03, "2 coins 3 plays"}, - - // DIP B - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x12, 0x01, 0xC0, 0x00, "B"}, - {0x12, 0x01, 0xC0, 0x80, "A"}, - {0x12, 0x01, 0xC0, 0x40, "C"}, - {0x12, 0x01, 0xC0, 0xC0, "D"}, - {0, 0xFE, 0, 4, "Extend"}, - {0x12, 0x01, 0x30, 0x00, "30000, 100000"}, - {0x12, 0x01, 0x30, 0x20, "50000, 200000"}, - {0x12, 0x01, 0x30, 0x10, "50000 only"}, - {0x12, 0x01, 0x30, 0x30, "100000 only"}, - {0, 0xFE, 0, 4, "Fighter counts"}, - {0x12, 0x01, 0x0C, 0x00, "3"}, - {0x12, 0x01, 0x0C, 0x08, "5"}, - {0x12, 0x01, 0x0C, 0x04, "1"}, - {0x12, 0x01, 0x0C, 0x0C, "2"}, - {0, 0xFE, 0, 2, NULL}, - {0x12, 0x01, 0x02, 0x00, "Normal game"}, - {0x12, 0x01, 0x02, 0x02, "DIP-switch display"}, -}; - -STDDIPINFO(slapfigh) - -static struct BurnDIPInfo PerfrmanDIPList[]= -{ - {0x11, 0xff, 0xff, 0x10, NULL }, - {0x12, 0xff, 0xff, 0x88, NULL }, - - {0 , 0xfe, 0 , 7, "Coinage" }, - {0x11, 0x01, 0x07, 0x05, "3 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x03, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x07, 0x00, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x07, 0x04, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, - {0x11, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, - {0x11, 0x01, 0x07, 0x07, "Free Play" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x08, 0x08, "Off" }, - {0x11, 0x01, 0x08, 0x00, "On" }, - -// {0 , 0xfe, 0 , 2, "Cabinet" }, -// {0x11, 0x01, 0x10, 0x10, "Upright" }, -// {0x11, 0x01, 0x10, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Intermissions" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x11, 0x01, 0x40, 0x00, "Off" }, - {0x11, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x02, "1" }, - {0x12, 0x01, 0x03, 0x03, "2" }, - {0x12, 0x01, 0x03, 0x00, "3" }, - {0x12, 0x01, 0x03, 0x01, "5" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x12, 0x01, 0x0c, 0x00, "Easy" }, - {0x12, 0x01, 0x0c, 0x04, "Medium" }, - {0x12, 0x01, 0x0c, 0x08, "Hard" }, - {0x12, 0x01, 0x0c, 0x0c, "Hardest" }, - - {0 , 0xfe, 0 , 16, "Bonus Life" }, - {0x12, 0x01, 0xf0, 0x40, "20k, 120k, then every 100k" }, - {0x12, 0x01, 0xf0, 0x50, "40k, 120k, then every 100k" }, - {0x12, 0x01, 0xf0, 0x60, "60k, 160k, then every 100k" }, - {0x12, 0x01, 0xf0, 0x70, "Every 100k" }, - {0x12, 0x01, 0xf0, 0x80, "20k, 220k, then every 200k" }, - {0x12, 0x01, 0xf0, 0x90, "40k, 240k, then every 200k" }, - {0x12, 0x01, 0xf0, 0xa0, "60k, 260k, then every 200k" }, - {0x12, 0x01, 0xf0, 0xb0, "Every 200k" }, - {0x12, 0x01, 0xf0, 0xc0, "20k, 320k, then every 300k" }, - {0x12, 0x01, 0xf0, 0xd0, "40k, 340k, then every 300k" }, - {0x12, 0x01, 0xf0, 0xe0, "60k, 360k, then every 300k" }, - {0x12, 0x01, 0xf0, 0xf0, "Every 300k" }, - {0x12, 0x01, 0xf0, 0x00, "20k only" }, - {0x12, 0x01, 0xf0, 0x10, "40k only" }, - {0x12, 0x01, 0xf0, 0x20, "60k only" }, - {0x12, 0x01, 0xf0, 0x30, "None" }, -}; - -STDDIPINFO(Perfrman) - -// --------------------------------------------------------------------------- - -static UINT8 *Mem, *MemEnd, *RamStart, *RamEnd; - -static UINT8 *Rom01, *Rom02, *Rom03; -static UINT8 *TigerHeliTileROM, *TigerHeliSpriteROM, *TigerHeliTextROM; - -static UINT8 *Ram01, *RamShared, *Ram03; -static UINT8 *TigerHeliTileRAM, *TigerHeliSpriteRAM, *TigerHeliSpriteBuf, *TigerHeliTextRAM; - -static UINT8* TigerHeliPaletteROM; -static UINT32* TigerHeliPalette; - -static UINT8 nPalettebank; -static UINT8 nFlipscreen; - -static INT16* pFMBuffer; -static INT16* pAY8910Buffer[6]; - -static INT32 use_mcu = 0; - -static INT32 MemIndex() -{ - UINT8* Next; Next = Mem; - Rom01 = Next; Next += 0x012000; // Z80 main program - Rom02 = Next; Next += 0x002000; // Z80 sound program - Rom03 = Next; Next += 0x000800; // m68705 mcu program - TigerHeliTextROM = Next; Next += 0x010000; - TigerHeliSpriteROM = Next; Next += 0x040000; - TigerHeliTileROM = Next; Next += 0x040000; - RamStart = Next; - Ram01 = Next; Next += 0x000800; // Z80 main work RAM - RamShared = Next; Next += 0x000800; // Shared RAM - TigerHeliTextRAM = Next; Next += 0x001000; - TigerHeliSpriteRAM = Next; Next += 0x000800; - TigerHeliSpriteBuf = Next; Next += 0x000800; - TigerHeliTileRAM = Next; Next += 0x001000; - Ram03 = Next; Next += 0x000080; - RamEnd = Next; - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 6 * sizeof(INT16); - TigerHeliPaletteROM = Next; Next += 0x000300; - TigerHeliPalette = (UINT32*)Next; Next += 0x000100 * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// --------------------------------------------------------------------------- -// Graphics - -static INT32 nTigerHeliTileXPosLo, nTigerHeliTileXPosHi, nTigerHeliTileYPosLo; -static INT32 nTigerHeliTileMask, nTigerHeliSpriteMask; - -static UINT8 tigerhRecalcPalette = 0; - -static void TigerHeliPaletteInit() -{ - for (INT32 i = 0; i < 0x0100; i++) { - INT32 r, g, b; - - r = TigerHeliPaletteROM[i + 0x0000]; // Red - r |= r << 4; - g = TigerHeliPaletteROM[i + 0x0100]; // Green - g |= g << 4; - b = TigerHeliPaletteROM[i + 0x0200]; // Blue - b |= b << 4; - - TigerHeliPalette[i] = BurnHighCol(r, g, b, 0); - } - - return; -} - -// --------------------------------------------------------------------------- - -static inline void sync_mcu() -{ - INT32 cycles = (ZetTotalCycles() / 2) - m6805TotalCycles(); - if (cycles > 0) { - // bprintf (0, _T("mcu %d\n"), cycles); - m6805Run(cycles); - } -} - -UINT8 __fastcall tigerhReadCPU0(UINT16 a) -{ - if (a >= 0xc800 && a <= 0xcfff) { - if (ZetGetPC(-1) == 0x6d34) return 0xff; - return RamShared[a - 0xc800]; - } - - switch (a) { - case 0xE803: { - if (use_mcu) { - sync_mcu(); - return standard_taito_mcu_read(); - } - - if (GetStarType == GETSTARB1 || GetStarType == GETSTARB2) return getstar_e803_r(); - - UINT8 nProtectSequence[3] = { 0, 1, (0 + 5) ^ 0x56 }; - - //if (nProtectIndex == 3) { - // nProtectIndex = 0; - //} - -// bprintf(PRINT_NORMAL, "Protection read (%02X) PC: %04X.\n", nProtectSequence[nProtectIndex], ZetGetPC(-1)); - //return nProtectSequence[nProtectIndex++]; - - UINT8 val = nProtectSequence[nProtectIndex]; - nProtectIndex = (nProtectIndex + 1) % 3; - return val; - } - -// default: -// bprintf(PRINT_NORMAL, _T("Attempt by CPU0 to read address %04X.\n"), a); - } - - return 0; -} - -UINT8 __fastcall tigerhReadCPU0_tigerhb1(UINT16 a) -{ - if (a >= 0xc800 && a <= 0xcfff) { - if (ZetGetPC(-1) == 0x6d34) return 0xff; - return RamShared[a - 0xc800]; - } - - switch (a) { - case 0xE803: { - return 0x83; - } - } - - return 0; -} - - -void __fastcall tigerhWriteCPU0(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xE800: - nTigerHeliTileXPosLo = d; - break; - case 0xE801: - nTigerHeliTileXPosHi = d; - break; - case 0xE802: - nTigerHeliTileYPosLo = d; - break; - - case 0xe803: - if (use_mcu) { - sync_mcu(); - from_main = d; - main_sent = 1; - if (nWhichGame == 0) mcu_sent = 0; - m68705SetIrqLine(0, 1 /*ASSERT_LINE*/); - } - if (GetStarType == GETSTARB1 || GetStarType == GETSTARB2) getstar_e803_w(); - break; - -// default: -// bprintf(PRINT_NORMAL, "Attempt by CPU0 to write address %04X -> %02X.\n", a, d); - } -} - -void __fastcall tigerhWriteCPU0_slapbtuk(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xE800: - nTigerHeliTileXPosHi = d; - break; - case 0xE802: - nTigerHeliTileYPosLo = d; - break; - case 0xE803: - nTigerHeliTileXPosLo = d; - break; -// default: -// bprintf(PRINT_NORMAL, "Attempt by CPU0 to write address %04X -> %02X.\n", a, d); - } -} - -UINT8 __fastcall tigerhInCPU0(UINT16 a) -{ - a &= 0xFF; - - switch (a) { - case 0x00: { - - UINT8 nStatusSequence[3] = { 0xC7, 0x55, 0x00 }; - - //if (nStatusIndex == 3) { - // nStatusIndex = 0; - //} - -// bprintf(PRINT_NORMAL, "Status read (%02X) PC: %04X.\n", nStatusSequence[nStatusIndex], ZetGetPC(-1)); - //return nStatusSequence[nStatusIndex++]; - - UINT8 nStatus = nStatusSequence[nStatusIndex]; - nStatusIndex++; - if (nStatusIndex > 2) nStatusIndex = 0; - - if (use_mcu) { - sync_mcu(); - nStatus &= 0xf9; - if (!main_sent) nStatus |= 0x02; - if (!mcu_sent) nStatus |= 0x04; - } - - return nStatus; - - } - -// default: -// bprintf(PRINT_NORMAL, "Attempt by CPU0 to read port %02X.\n", a); - } - - return 0; -} - -UINT8 __fastcall perfrmanhInCPU0(UINT16 a) -{ - a &= 0xFF; - - switch (a) { - case 0x00: - return bVBlank ? 1 : 0; - -// default: -// bprintf(PRINT_NORMAL, "Attempt by CPU0 to read port %02X.\n", a); - } - - return 0; -} - -UINT8 __fastcall tigerhInCPU0_gtstarba(UINT16 a) -{ - a &= 0xFF; - - switch (a) { - case 0x00: { - if (ZetGetPC(-1) == 0x6d1e) return 0; - if (ZetGetPC(-1) == 0x6d24) return 6; - if (ZetGetPC(-1) == 0x6d2c) return 2; - if (ZetGetPC(-1) == 0x6d34) return 4; - return 0; - } - -// default: -// bprintf(PRINT_NORMAL, "Attempt by CPU0 to read port %02X.\n", a); - } - - return 0; -} - -void __fastcall tigerhOutCPU0(UINT16 a, UINT8 /* d */) -{ - a &= 0xFF; - - switch (a) { - case 0x00: // Assert reset line on sound CPU -// bprintf(PRINT_NORMAL, "Sound CPU disabled.\n"); - - if (bSoundCPUEnable) { - ZetClose(); - ZetOpen(1); - ZetReset(); - ZetClose(); - ZetOpen(0); - - bSoundCPUEnable = false; - } - - break; - case 0x01: // Release reset line on sound CPU -// bprintf(PRINT_NORMAL, "Sound CPU enabled.\n"); - - bSoundCPUEnable = true; - break; - - case 0x02: - case 0x03: - nFlipscreen = ~a & 1; - break; - -// case 0x05: -// bprintf(PRINT_NORMAL, "Sound NMI triggered.\n"); -/* - if (bSoundNMIEnable) { - ZetClose(); - ZetOpen(1); - ZetNmi(); - ZetClose(); - ZetOpen(0); - } -*/ -// break; - - case 0x06: // Disable interrupts -// bprintf(PRINT_NORMAL, "Interrupts disabled.\n"); - - bInterruptEnable = false; - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - break; - case 0x07: // Enable interrupts -// bprintf(PRINT_NORMAL, "Interrupts enabled.\n"); - - bInterruptEnable = true; - break; - - case 0x08: -// bprintf(PRINT_NORMAL, "ROM bank 0 selected.\n"); - - // ROM bank 0 selected - ZetMapArea(0x8000, 0xBFFF, 0, Rom01 + 0x8000); - ZetMapArea(0x8000, 0xBFFF, 2, Rom01 + 0x8000); - break; - case 0x09: -// bprintf(PRINT_NORMAL, "ROM bank 1 selected.\n"); - - // ROM bank 1 selected - ZetMapArea(0x8000, 0xBFFF, 0, Rom01 + 0xC000); - ZetMapArea(0x8000, 0xBFFF, 2, Rom01 + 0xC000); - break; - - case 0x0c: - case 0x0d: - nPalettebank = a & 1; - break;; - -// default: -// bprintf(PRINT_NORMAL, "Attempt by CPU0 to write port %02X -> %02X.\n", a, d); - } -} - -UINT8 __fastcall tigerhReadCPU1(UINT16 a) -{ - switch (a) { - case 0xA081: -// bprintf(PRINT_NORMAL, "AY8910 0 read (%02X).\n", AY8910Read(0)); - return AY8910Read(0); - case 0xA091: -// bprintf(PRINT_NORMAL, "AY8910 1 read (%02X).\n", AY8910Read(1)); - return AY8910Read(1); - -// default: -// bprintf(PRINT_NORMAL, "Attempt by CPU1 to read address %04X.\n", a); - } - - return 0; -} - -void __fastcall tigerhWriteCPU1(UINT16 a, UINT8 d) -{ - switch (a) { - case 0xA080: -// bprintf(PRINT_NORMAL, "AY8910 0 Register select (%02X).\n", d); - AY8910Write(0, 0, d); - break; - case 0xA082: -// bprintf(PRINT_NORMAL, "AY8910 0 Register Write (%02X).\n", d); - AY8910Write(0, 1, d); - break; - case 0xA090: -// bprintf(PRINT_NORMAL, "AY8910 1 Register select (%02X).\n", d); - AY8910Write(1, 0, d); - break; - case 0xA092: -// bprintf(PRINT_NORMAL, "AY8910 1 Register Write (%02X).\n", d); - AY8910Write(1, 1, d); - break; - - case 0xA0E0: -// bprintf(PRINT_NORMAL, "Sound NMI enabled.\n"); - bSoundNMIEnable = true; - break; - -// default: -// bprintf(PRINT_NORMAL, "Attempt by CPU1 to write address %04X -> %02X.\n", a, d); - } -} - -UINT8 __fastcall tigerhInCPU1(UINT16 /* a */) -{ -// bprintf(PRINT_NORMAL, "Attempt by CPU1 to read port %02X.\n", a); - - return 0; -} - -void __fastcall tigerhOutCPU1(UINT16 /* a */, UINT8 /* d */) -{ -// bprintf(PRINT_NORMAL, _T("Attempt by CPU1 to write port %02X -> %02X.\n"), a, d); -} - -static UINT8 tigerhReadPort0(UINT32) -{ - return ~tigerhInput[0]; -} -static UINT8 tigerhReadPort1(UINT32) -{ - return ~tigerhInput[1]; -} -static UINT8 tigerhReadPort2(UINT32) -{ - return ~tigerhInput[2]; -} -static UINT8 tigerhReadPort3(UINT32) -{ - return ~tigerhInput[3]; -} - -//---------------------------------------------------------------------------- -// MCU Handling - -void tigerh_m68705_portA_write(UINT8 *data) -{ - from_mcu = *data; - mcu_sent = 1; -} - -void tigerh_m68705_portC_read() -{ - portC_in = 0; - if (!main_sent) portC_in |= 0x01; - if ( mcu_sent) portC_in |= 0x02; -} - -static m68705_interface tigerh_m68705_interface = { - tigerh_m68705_portA_write, standard_m68705_portB_out, NULL, - NULL, NULL, NULL, - NULL, NULL, tigerh_m68705_portC_read -}; - -void slapfigh_m68705_portA_write(UINT8 *data) -{ - from_mcu = *data; -} - -void slapfigh_m68705_portB_out(UINT8 *data) -{ - if ((ddrB & 0x02) && (~*data & 0x02) && (portB_out & 0x02)) - { - portA_in = from_main; - if (main_sent) - m68705SetIrqLine(0, 0 /*CLEAR_LINE*/); - main_sent = 0; - } - if ((ddrB & 0x04) && (*data & 0x04) && (~portB_out & 0x04)) - { - from_mcu = portA_out; - mcu_sent = 1; - } - - if ((ddrB & 0x08) && (~*data & 0x08) && (portB_out & 0x08)) - { - nTigerHeliTileXPosLo = portA_out; - } - if ((ddrB & 0x10) && (~*data & 0x10) && (portB_out & 0x10)) - { - nTigerHeliTileXPosHi = portA_out; - } -} - -void slapfigh_m68705_portC_read() -{ - portC_in = 0; - if (main_sent) portC_in |= 0x01; - if (!mcu_sent) portC_in |= 0x02; -} - -static m68705_interface slapfigh_m68705_interface = { - slapfigh_m68705_portA_write, slapfigh_m68705_portB_out, NULL, - NULL, NULL, NULL, - NULL, NULL, slapfigh_m68705_portC_read -}; - -//---------------------------------------------------------------------------- -// Get Star MCU Simulation - -static UINT8 GSa = 0; -static UINT8 GSd = 0; -static UINT8 GSe = 0; -static UINT8 GSCommand = 0; - -#define GS_SAVE_REGS GSa = ZetBc(-1) >> 0; \ - GSd = ZetDe(-1) >> 8; \ - GSe = ZetDe(-1) >> 0; - -#define GS_RESET_REGS GSa = 0; \ - GSd = 0; \ - GSe = 0; - -static UINT8 getstar_e803_r() -{ - UINT8 getstar_val = 0; - UINT8 lives_lookup_table[] = {0x03, 0x05, 0x01, 0x02}; /* table at 0x0e62 in 'gtstarb1' */ - UINT8 lgsb2_lookup_table[] = {0x00, 0x03, 0x04, 0x05}; /* fake tanle for "test mode" in 'gtstarb2' */ - - switch (GetStarType) { - case GETSTARB1: { - /* value isn't computed by the bootleg but we want to please the "test mode" */ - if (ZetGetPC(-1) == 0x6b04) return (lives_lookup_table[GSa]); - break; - } - - case GETSTARB2: { - /* - 056B: 21 03 E8 ld hl,$E803 - 056E: 7E ld a,(hl) - 056F: BE cp (hl) - 0570: 28 FD jr z,$056F - 0572: C6 05 add a,$05 - 0574: EE 56 xor $56 - 0576: BE cp (hl) - 0577: C2 6E 05 jp nz,$056E - */ - if (ZetGetPC(-1) == 0x056e) return (getstar_val); - if (ZetGetPC(-1) == 0x0570) return (getstar_val+1); - if (ZetGetPC(-1) == 0x0577) return ((getstar_val+0x05) ^ 0x56); - /* value isn't computed by the bootleg but we want to please the "test mode" */ - if (ZetGetPC(-1) == 0x6b04) return (lgsb2_lookup_table[GSa]); - break; - } - } - - return getstar_val; -} - -static void getstar_e803_w() -{ - switch (GetStarType) { - case GETSTARB1: { - /* "Test mode" doesn't compute the lives value : - 6ADA: 3E 23 ld a,$23 - 6ADC: CD 52 11 call $1152 - 6ADF: 32 03 E8 ld ($E803),a - 6AE2: DB 00 in a,($00) - 6AE4: CB 4F bit 1,a - 6AE6: 28 FA jr z,$6AE2 - 6AE8: 3A 0A C8 ld a,($C80A) - 6AEB: E6 03 and $03 - 6AED: CD 52 11 call $1152 - 6AF0: 32 03 E8 ld ($E803),a - 6AF3: DB 00 in a,($00) - 6AF5: CB 57 bit 2,a - 6AF7: 20 FA jr nz,$6AF3 - 6AF9: 00 nop - 6AFA: 00 nop - 6AFB: 00 nop - 6AFC: 00 nop - 6AFD: 00 nop - 6AFE: 00 nop - 6AFF: 00 nop - 6B00: 00 nop - 6B01: 3A 03 E8 ld a,($E803) - We save the regs though to hack it in 'getstar_e803_r' read handler. - */ - if (ZetGetPC(-1) == 0x6ae2) - { - GSCommand = 0x00; - GS_RESET_REGS - } - if (ZetGetPC(-1) == 0x6af3) - { - GSCommand = 0x00; - GS_SAVE_REGS - } - break; - } - - case GETSTARB2: { - /* "Test mode" doesn't compute the lives value : - 6ADA: 3E 23 ld a,$23 - 6ADC: CD 52 11 call $1152 - 6ADF: 32 03 E8 ld ($E803),a - 6AE2: DB 00 in a,($00) - 6AE4: CB 4F bit 1,a - 6AE6: 00 nop - 6AE7: 00 nop - 6AE8: 3A 0A C8 ld a,($C80A) - 6AEB: E6 03 and $03 - 6AED: CD 52 11 call $1152 - 6AF0: 32 03 E8 ld ($E803),a - 6AF3: DB 00 in a,($00) - 6AF5: CB 57 bit 2,a - 6AF7: 00 nop - 6AF8: 00 nop - 6AF9: 00 nop - 6AFA: 00 nop - 6AFB: 00 nop - 6AFC: 00 nop - 6AFD: 00 nop - 6AFE: 00 nop - 6AFF: 00 nop - 6B00: 00 nop - 6B01: 3A 03 E8 ld a,($E803) - We save the regs though to hack it in 'getstar_e803_r' read handler. - */ - if (ZetGetPC(-1) == 0x6ae2) - { - GSCommand = 0x00; - GS_RESET_REGS - } - if (ZetGetPC(-1) == 0x6af3) - { - GSCommand = 0x00; - GS_SAVE_REGS - } - break; - } - } -} - -// --------------------------------------------------------------------------- - -static INT32 tigerhLoadROMs() -{ - INT32 nRomOffset = 0; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb2")) nRomOffset = 1; - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb3")) nRomOffset = 2; - - // Z80 main program - switch (nWhichGame) { - case 0: // Tiger Heli - if (BurnLoadRom(Rom01 + 0x0000, 0, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x4000, 1, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x8000, 2, 1)) { - return 1; - } - break; - case 1: // Get Star - if (BurnLoadRom(Rom01 + 0x0000, 0, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x4000, 1, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x8000, 2, 1)) { - return 1; - } - break; - case 2: { // Slap Fight - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb2")) { - if (BurnLoadRom(Rom01 + 0x0000, 0, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x4000, 1, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x8000, 2, 1)) { - return 1; - } - break; - } else { - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb3")) { - if (BurnLoadRom(Rom01 + 0x0000, 0, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x4000, 1, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x10000, 2, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x8000, 3, 1)) { - return 1; - } - break; - } else { - if (BurnLoadRom(Rom01 + 0x0000, 0, 1)) { - return 1; - } - if (BurnLoadRom(Rom01 + 0x8000, 1, 1)) { - return 1; - } - break; - } - } - } - } - - // Sprites - { - INT32 nRet = 0, nBaseROM = 0; - switch (nWhichGame) { - case 0: // Tiger Heli - nBaseROM = 3; - break; - case 1: // Get Star - nBaseROM = 3; - break; - case 2: // Slap Fight - nBaseROM = 2 + nRomOffset; - break; - } - - INT32 nSize; - - { - struct BurnRomInfo ri; - - ri.nType = 0; - ri.nLen = 0; - - BurnDrvGetRomInfo(&ri, nBaseROM); - - nSize = ri.nLen; - } - - UINT8* pTemp = (UINT8*)BurnMalloc(nSize * 4); - - for (INT32 i = 0; i < 4; i++) { - nRet |= BurnLoadRom(pTemp + nSize * i, nBaseROM + i, 1); - } - - for (INT32 i = 0; i < nSize; i++) { - for (INT32 j = 0; j < 8; j++) { - TigerHeliSpriteROM[(i << 3) + j] = ((pTemp[i + nSize * 0] >> (7 - j)) & 1) << 3; - TigerHeliSpriteROM[(i << 3) + j] |= ((pTemp[i + nSize * 1] >> (7 - j)) & 1) << 2; - TigerHeliSpriteROM[(i << 3) + j] |= ((pTemp[i + nSize * 2] >> (7 - j)) & 1) << 1; - TigerHeliSpriteROM[(i << 3) + j] |= ((pTemp[i + nSize * 3] >> (7 - j)) & 1) << 0; - } - } - - BurnFree(pTemp); - - nTigerHeliSpriteMask = (nSize >> 5) - 1; - - if (nRet) { - return 1; - } - } - - // Text layer - { - INT32 nBaseROM = 0; - switch (nWhichGame) { - case 0: // Tiger Heli - nBaseROM = 7; - break; - case 1: // Get Star - nBaseROM = 7; - break; - case 2: // Slap Fight - nBaseROM = 6 + nRomOffset; - break; - } - - UINT8* pTemp = (UINT8*)BurnMalloc(0x4000); - - if (BurnLoadRom(pTemp + 0x0000, nBaseROM + 0, 1)) { - return 1; - } - if (BurnLoadRom(pTemp + 0x2000, nBaseROM + 1, 1)) { - return 1; - } - - for (INT32 i = 0; i < 0x02000; i++) { - for (INT32 j = 0; j < 8; j++) { - TigerHeliTextROM[(i << 3) + j] = ((pTemp[i + 0x0000] >> (7 - j)) & 1) << 1; - TigerHeliTextROM[(i << 3) + j] |= ((pTemp[i + 0x2000] >> (7 - j)) & 1) << 0; - } - } - - BurnFree(pTemp); - } - - // Tile layer - { - INT32 nRet = 0, nBaseROM = 0; - switch (nWhichGame) { - case 0: // Tiger Heli - nBaseROM = 9; - break; - case 1: // Get Star - nBaseROM = 9; - break; - case 2: // Slap Fight - nBaseROM = 8 + nRomOffset; - break; - } - - INT32 nSize; - - { - struct BurnRomInfo ri; - - ri.nType = 0; - ri.nLen = 0; - - BurnDrvGetRomInfo(&ri, nBaseROM); - - nSize = ri.nLen; - } - - UINT8* pTemp = (UINT8*)BurnMalloc(nSize * 4); - - for (INT32 i = 0; i < 4; i++) { - nRet |= BurnLoadRom(pTemp + nSize * i, nBaseROM + i, 1); - } - - for (INT32 i = 0; i < nSize; i++) { - for (INT32 j = 0; j < 8; j++) { - TigerHeliTileROM[(i << 3) + j] = ((pTemp[i + nSize * 0] >> (7 - j)) & 1) << 3; - TigerHeliTileROM[(i << 3) + j] |= ((pTemp[i + nSize * 1] >> (7 - j)) & 1) << 2; - TigerHeliTileROM[(i << 3) + j] |= ((pTemp[i + nSize * 2] >> (7 - j)) & 1) << 1; - TigerHeliTileROM[(i << 3) + j] |= ((pTemp[i + nSize * 3] >> (7 - j)) & 1) << 0; - } - } - - BurnFree(pTemp); - - nTigerHeliTileMask = (nSize >> 3) - 1; - - if (nRet) { - return 1; - } - } - - // Colour PROMs - { - INT32 nBaseROM = 0; - switch (nWhichGame) { - case 0: // Tiger Heli - nBaseROM = 13; - break; - case 1: // Get Star - nBaseROM = 13; - break; - case 2: // Slap Fight - nBaseROM = 12 + nRomOffset; - break; - } - - if (BurnLoadRom(TigerHeliPaletteROM + 0x0000, nBaseROM + 0, 1)) { - return 1; - } - if (BurnLoadRom(TigerHeliPaletteROM + 0x0100, nBaseROM + 1, 1)) { - return 1; - } - if (BurnLoadRom(TigerHeliPaletteROM + 0x0200, nBaseROM + 2, 1)) { - return 1; - } - } - - // Z80 program - { - INT32 nBaseROM = 0; - switch (nWhichGame) { - case 0: // Tiger Heli - nBaseROM = 16; - break; - case 1: // Get Star - nBaseROM = 16; - break; - case 2: // Slap Fight - nBaseROM = 15 + nRomOffset; - break; - } - - if (BurnLoadRom(Rom02, nBaseROM, 1)) { - return 1; - } - } - - // MCU program - { - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "tigerh") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "tigerhj") == 0) { - if (BurnLoadRom(Rom03, 17, 1)) { - return 1; - } - - use_mcu = 1; - } - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "alcon") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "slapfigh") == 0) { - if (BurnLoadRom(Rom03, 16, 1)) { - return 1; - } - - use_mcu = 1; - } - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "grdian") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "getstarj") == 0) { - if (BurnLoadRom(Rom03, 17, 1)) { - return 1; - } - - use_mcu = 1; - } - - } - - return 0; -} - -static INT32 tigerhExit() -{ - GenericTilesExit(); - - ZetExit(); - AY8910Exit(0); - AY8910Exit(1); - - if (use_mcu) { - use_mcu = 0; - m67805_taito_exit(); - } - - // Deallocate all used memory - BurnFree(Mem); - - GetStarType = 0; - - return 0; -} - -static void tigerhDoReset() -{ - bInterruptEnable = false; - bSoundNMIEnable = false; - bSoundCPUEnable = true; - - nStatusIndex = 0; - nProtectIndex = 0; - nPalettebank = 0; - nFlipscreen = 0; - - ZetOpen(0); - ZetReset(); - ZetClose(); - - ZetOpen(1); - ZetReset(); - ZetClose(); - - if (use_mcu) { - m67805_taito_reset(); - } - - return; -} - -static INT32 tigerhInit() -{ - INT32 nLen; - - nWhichGame = -1; - - if (strcmp(BurnDrvGetTextA(DRV_NAME), "tigerh") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "tigerhj") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "tigerhb1") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "tigerhb2") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "tigerhb3") == 0) { - nWhichGame = 0; - } - if (strcmp(BurnDrvGetTextA(DRV_NAME), "grdian") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "getstarj") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "getstarb1") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "getstarb2") == 0) { - nWhichGame = 1; - if (strcmp(BurnDrvGetTextA(DRV_NAME), "grdian") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "getstarj") == 0) GetStarType = GETSTAR; - if (strcmp(BurnDrvGetTextA(DRV_NAME), "getstarb1") == 0) GetStarType = GETSTARB1; - if (strcmp(BurnDrvGetTextA(DRV_NAME), "getstarb2") == 0) GetStarType = GETSTARB2; - } - if (strcmp(BurnDrvGetTextA(DRV_NAME), "alcon") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "slapfigh") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb1") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb2") == 0 || strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb3") == 0) { - nWhichGame = 2; - } - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8*)0; - if ((Mem = (UINT8*)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (tigerhLoadROMs()) { - return 1; - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "getstarb1")) Rom01[0x6d56] = 0xc3; - - { - ZetInit(0); - - // Main CPU setup - ZetOpen(0); - - // Program ROM - ZetMapArea(0x0000, 0x7FFF, 0, Rom01); - ZetMapArea(0x0000, 0x7FFF, 2, Rom01); - // Banked ROM - ZetMapArea(0x8000, 0xBFFF, 0, Rom01 + 0x8000); - ZetMapArea(0x8000, 0xBFFF, 2, Rom01 + 0x8000); - - // Work RAM - ZetMapArea(0xC000, 0xC7FF, 0, Ram01); - ZetMapArea(0xC000, 0xC7FF, 1, Ram01); - ZetMapArea(0xC000, 0xC7FF, 2, Ram01); - - // Shared RAM - if (strcmp(BurnDrvGetTextA(DRV_NAME), "getstarb1")) { - ZetMapArea(0xC800, 0xCFFF, 0, RamShared); - } - ZetMapArea(0xC800, 0xCFFF, 1, RamShared); - ZetMapArea(0xC800, 0xCFFF, 2, RamShared); - - // Tile RAM - ZetMapArea(0xD000, 0xDFFF, 0, TigerHeliTileRAM); - ZetMapArea(0xD000, 0xDFFF, 1, TigerHeliTileRAM); - ZetMapArea(0xD000, 0xDFFF, 2, TigerHeliTileRAM); - // Sprite RAM - ZetMapArea(0xE000, 0xE7FF, 0, TigerHeliSpriteRAM); - ZetMapArea(0xE000, 0xE7FF, 1, TigerHeliSpriteRAM); - ZetMapArea(0xE000, 0xE7FF, 2, TigerHeliSpriteRAM); - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb2") || !strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb3")) { - ZetMapArea(0xec00, 0xeFFF, 0, Rom01 + 0x10c00); - ZetMapArea(0xec00, 0xeFFF, 2, Rom01 + 0x10c00); - } - - // Text RAM - ZetMapArea(0xF000, 0xFFFF, 0, TigerHeliTextRAM); - ZetMapArea(0xF000, 0xFFFF, 1, TigerHeliTextRAM); - ZetMapArea(0xF000, 0xFFFF, 2, TigerHeliTextRAM); - - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "tigerhb1")) { - ZetSetReadHandler(tigerhReadCPU0_tigerhb1); - } else { - ZetSetReadHandler(tigerhReadCPU0); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb2") || !strcmp(BurnDrvGetTextA(DRV_NAME), "slapfighb3")) { - ZetSetWriteHandler(tigerhWriteCPU0_slapbtuk); - } else { - ZetSetWriteHandler(tigerhWriteCPU0); - } - - if (!strcmp(BurnDrvGetTextA(DRV_NAME), "getstarb1")) { - ZetSetInHandler(tigerhInCPU0_gtstarba); - } else { - ZetSetInHandler(tigerhInCPU0); - } - - ZetSetOutHandler(tigerhOutCPU0); - - ZetClose(); - - ZetInit(1); - - // Sound CPU setup - ZetOpen(1); - - // Program ROM - ZetMapArea(0x0000, 0x1FFF, 0, Rom02); - ZetMapArea(0x0000, 0x1FFF, 2, Rom02); - - // Work RAM - ZetMapArea(0xC800, 0xCFFF, 0, RamShared); - ZetMapArea(0xC800, 0xCFFF, 1, RamShared); - ZetMapArea(0xC800, 0xCFFF, 2, RamShared); - - - ZetSetReadHandler(tigerhReadCPU1); - ZetSetWriteHandler(tigerhWriteCPU1); - ZetSetInHandler(tigerhInCPU1); - ZetSetOutHandler(tigerhOutCPU1); - - ZetClose(); - - if (use_mcu) { - if (nWhichGame == 0) m67805_taito_init(Rom03, Ram03, &tigerh_m68705_interface); - if (nWhichGame == 1 && GetStarType == GETSTAR) m67805_taito_init(Rom03, Ram03, &slapfigh_m68705_interface); - if (nWhichGame == 2) m67805_taito_init(Rom03, Ram03, &slapfigh_m68705_interface); - } - } - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - AY8910Init(0, 1500000, nBurnSoundRate, &tigerhReadPort0, &tigerhReadPort1, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, &tigerhReadPort2, &tigerhReadPort3, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - TigerHeliPaletteInit(); - - GenericTilesInit(); - - tigerhDoReset(); - - return 0; -} - -static INT32 perfrmanLoadGfx(UINT8 *dst, INT32 offset) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); - if (tmp == NULL) { - return 1; - } - - if (BurnLoadRom(tmp + 0x0000, offset+0, 1)) return 1; - if (BurnLoadRom(tmp + 0x2000, offset+1, 1)) return 1; - if (BurnLoadRom(tmp + 0x4000, offset+2, 1)) return 1; - - memset (dst, 0, (0x6000 / 3) * 8); - - for (INT32 i = 0; i < (0x6000 / 3) * 8; i++) - { - dst[i] = ((tmp[0x0000 + (i / 8)] >> (~i & 7)) & 1) << 2; - dst[i] |= ((tmp[0x2000 + (i / 8)] >> (~i & 7)) & 1) << 1; - dst[i] |= ((tmp[0x4000 + (i / 8)] >> (~i & 7)) & 1) << 0; - } - - BurnFree (tmp); - - return 0; -} - -static INT32 perfrmanInit() -{ - nWhichGame = 9; // ?? - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8*)0; - if ((Mem = (UINT8*)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - { - if (BurnLoadRom(Rom01 + 0x0000, 0, 1)) return 1; - if (BurnLoadRom(Rom01 + 0x4000, 1, 1)) return 1; - - if (BurnLoadRom(Rom02 + 0x0000, 2, 1)) return 1; - - perfrmanLoadGfx(TigerHeliTileROM, 3); - perfrmanLoadGfx(TigerHeliSpriteROM, 6); - - if (BurnLoadRom(TigerHeliPaletteROM + 0x0000, 9, 1)) return 1; - if (BurnLoadRom(TigerHeliPaletteROM + 0x0100, 10, 1)) return 1; - if (BurnLoadRom(TigerHeliPaletteROM + 0x0200, 11, 1)) return 1; - } - - { - ZetInit(0); - - // Main CPU setup - ZetOpen(0); - - // Program ROM - ZetMapArea(0x0000, 0x7FFF, 0, Rom01); - ZetMapArea(0x0000, 0x7FFF, 2, Rom01); - - // Work RAM - ZetMapArea(0x8000, 0x87FF, 0, Ram01); - ZetMapArea(0x8000, 0x87FF, 1, Ram01); - ZetMapArea(0x8000, 0x87FF, 2, Ram01); - - // Shared RAM - ZetMapArea(0x8800, 0x8FFF, 0, RamShared); - ZetMapArea(0x8800, 0x8FFF, 1, RamShared); - ZetMapArea(0x8800, 0x8FFF, 2, RamShared); - - // Tile RAM - ZetMapArea(0x9000, 0x9FFF, 0, TigerHeliTileRAM); - ZetMapArea(0x9000, 0x9FFF, 1, TigerHeliTileRAM); - ZetMapArea(0x9000, 0x9FFF, 2, TigerHeliTileRAM); - - // Sprite RAM - ZetMapArea(0xA000, 0xA7FF, 0, TigerHeliSpriteRAM); - ZetMapArea(0xA000, 0xA7FF, 1, TigerHeliSpriteRAM); - ZetMapArea(0xA000, 0xA7FF, 2, TigerHeliSpriteRAM); - - ZetSetInHandler(perfrmanhInCPU0); - ZetSetOutHandler(tigerhOutCPU0); - - ZetClose(); - - ZetInit(1); - - // Sound CPU setup - ZetOpen(1); - - // Program ROM - ZetMapArea(0x0000, 0x1FFF, 0, Rom02); - ZetMapArea(0x0000, 0x1FFF, 2, Rom02); - - // Work RAM - ZetMapArea(0x8800, 0x8FFF, 0, RamShared); - ZetMapArea(0x8800, 0x8FFF, 1, RamShared); - ZetMapArea(0x8800, 0x8FFF, 2, RamShared); - - ZetSetReadHandler(tigerhReadCPU1); - ZetSetWriteHandler(tigerhWriteCPU1); - ZetSetInHandler(tigerhInCPU1); - ZetSetOutHandler(tigerhOutCPU1); - - ZetClose(); - } - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - - AY8910Init(0, 2000000, nBurnSoundRate, &tigerhReadPort0, &tigerhReadPort1, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, &tigerhReadPort2, &tigerhReadPort3, NULL, NULL); - AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); - - TigerHeliPaletteInit(); - - GenericTilesInit(); - - tigerhDoReset(); - - return 0; -} - -static INT32 tigerhScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029521; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - ZetScan(nAction); // Scan Z80 - - // Scan critical driver variables - SCAN_VAR(bInterruptEnable); - SCAN_VAR(bSoundCPUEnable); - SCAN_VAR(bSoundNMIEnable); - SCAN_VAR(nStatusIndex); - SCAN_VAR(nProtectIndex); - SCAN_VAR(tigerhInput); - SCAN_VAR(nPalettebank); - SCAN_VAR(nFlipscreen); - SCAN_VAR(GSa); - SCAN_VAR(GSd); - SCAN_VAR(GSe); - SCAN_VAR(GSCommand); - } - - return 0; -} - -static void TigerHeliBufferSprites() -{ - memcpy(TigerHeliSpriteBuf, TigerHeliSpriteRAM, 0x0800); -} - -static void draw_bg_layer() -{ - INT32 scrollx = (((nTigerHeliTileXPosHi * 256) + nTigerHeliTileXPosLo) + 8) & 0x1ff; - INT32 scrolly = (nTigerHeliTileYPosLo + 15) & 0xff; - - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= scrollx; - if (sx < -7) sx += 512; - sy -= scrolly; - if (sy < -7) sy += 256; - - if (sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 attr = TigerHeliTileRAM[offs] + (TigerHeliTileRAM[0x800 + offs] * 0x100); - INT32 code = (attr & 0x0fff) & nTigerHeliTileMask; - INT32 color = (attr & 0xf000) >> 12; - - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 4, 0, TigerHeliTileROM); - } -} - -static void draw_txt_layer() -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = ((offs & 0x3f) * 8) - 8; - INT32 sy = ((offs / 0x40) * 8) - 15; - - if (sy < -7 || sx < -7 || sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 attr = TigerHeliTextRAM[offs] + (TigerHeliTextRAM[0x800 + offs] * 0x100); - INT32 code = attr & 0x03ff; - INT32 color = (attr & 0xfc00) >> 10; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 2, 0, 0, TigerHeliTextROM); - } -} - -static void draw_sprites() -{ - UINT8 *ram = TigerHeliSpriteBuf; - - for (INT32 offs = 0; offs < 0x800; offs += 4) - { - INT32 attr = ram[offs + 2]; - INT32 code = (ram[offs + 0] | ((attr & 0xc0) << 2)) & nTigerHeliSpriteMask; - INT32 sx = (ram[offs + 1] | (attr << 8 & 0x100)) - (13 + 8); - INT32 sy = ram[offs + 3] - 15; - INT32 color = attr >> 1 & 0xf; - - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 4, 0, 0, TigerHeliSpriteROM); - } -} - -static INT32 tigerhDraw() -{ - if (tigerhRecalcPalette) { - TigerHeliPaletteInit(); - tigerhRecalcPalette = 0; - } - - if (!(nBurnLayer & 1)) BurnTransferClear(); - - if (nBurnLayer & 1) draw_bg_layer(); - if (nBurnLayer & 2) draw_sprites(); - if (nBurnLayer & 4) draw_txt_layer(); - - BurnTransferCopy(TigerHeliPalette); - - return 0; -} - -static void draw_perfrman_bg_layer(INT32 transp) -{ - for (INT32 offs = 0; offs < 64 * 32; offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = ((offs / 0x40) * 8) - 16; - - if (sy < -7 || sx < -7 || sy >= nScreenHeight || sx >= nScreenWidth) continue; - - INT32 attr = TigerHeliTileRAM[offs] + (TigerHeliTileRAM[0x800 + offs] * 0x100); - INT32 code = (attr & 0x03ff); - INT32 color = (attr & 0x7800) >> 11; - - if (transp) { - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0, TigerHeliTileROM); - } else { - Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 3, 0, TigerHeliTileROM); - } - } -} - -static void draw_perfrman_sprites(INT32 layer) -{ - UINT8 *ram = TigerHeliSpriteBuf; - - for (INT32 offs = 0; offs < 0x800; offs += 4) - { - INT32 code = ram[offs + 0]; - INT32 sy = ram[offs + 3] - (1 + 16); - INT32 sx = ram[offs + 1] - 13; - INT32 pri = ram[offs + 2] >> 6 & 3; - INT32 color = (ram[offs + 2] >> 1 & 3) | (ram[offs + 2] << 2 & 4) | (nPalettebank << 3); - - if (layer == pri) - Render16x16Tile_Mask_Clip(pTransDraw, code, sx, sy, color, 3, 0, 0x80, TigerHeliSpriteROM); - } -} - -static INT32 perfrmanDraw() -{ - if (tigerhRecalcPalette) { - TigerHeliPaletteInit(); - tigerhRecalcPalette = 0; - } - - if (!(nBurnLayer & 1)) BurnTransferClear(); - - if (nBurnLayer & 1) draw_perfrman_bg_layer(0); - if (nSpriteEnable & 1) draw_perfrman_sprites(0); - if (nSpriteEnable & 2) draw_perfrman_sprites(1); - if (nBurnLayer & 2) draw_perfrman_bg_layer(1); - if (nSpriteEnable & 4) draw_perfrman_sprites(2); - if (nSpriteEnable & 8) draw_perfrman_sprites(3); - - BurnTransferCopy(TigerHeliPalette); - - return 0; -} - -static inline INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 tigerhFrame() -{ - INT32 nCyclesTotal[3], nCyclesDone[3]; - - if (tigerhReset) { // Reset machine - tigerhDoReset(); - } - - ZetNewFrame(); - if (use_mcu) m6805NewFrame(); - - // Compile digital inputs - tigerhInput[0] = 0x00; - tigerhInput[1] = 0x00; - for (INT32 i = 0; i < 8; i++) { - tigerhInput[0] |= (tigerhInpJoy1[i] & 1) << i; - if (nWhichGame == 0 && i < 4) { - tigerhInput[1] |= (tigerhInpMisc[i] & 1) << (i ^ 1); - } else { - tigerhInput[1] |= (tigerhInpMisc[i] & 1) << i; - } - } - - if (nWhichGame == 1) { // getstar / guardian - tigerhInput[0] = (tigerhInput[0] & 0x99) | ((tigerhInput[0] << 1) & 0x44) | ((tigerhInput[0] >> 1) & 0x22); - } else { - if ((tigerhInput[0] & 0x03) == 0x03) { - tigerhInput[0] &= ~0x03; - } - if ((tigerhInput[0] & 0x0C) == 0x0C) { - tigerhInput[0] &= ~0x0C; - } - if ((tigerhInput[0] & 0x30) == 0x30) { - tigerhInput[0] &= ~0x30; - } - if ((tigerhInput[0] & 0xC0) == 0xC0) { - tigerhInput[0] &= ~0xC0; - } - } - - nCyclesTotal[0] = nCyclesTotal[1] = 6000000 / 60; - nCyclesDone[0] = nCyclesDone[1] = nCyclesDone[2] = 0; - nCyclesTotal[2] = 3000000 / 60; - - INT32 nVBlankCycles = 248 * 6000000 / 60 / 262; - const INT32 nInterleave = 12; - - if (nWhichGame == 9) - { - nCyclesTotal[0] = 4000000 / 60; - nCyclesTotal[1] = 2000000 / 60; - nVBlankCycles = 248 * 4000000 / 60 / 262; - } - - INT32 nSoundBufferPos = 0; - INT32 nSoundNMIMask = 0; - switch (nWhichGame) { - case 0: - nSoundNMIMask = 1; - break; - case 1: - nSoundNMIMask = 3; - break; - case 2: - nSoundNMIMask = 3; - break; - - case 9: - nSoundNMIMask = 3; //?? - break; - } - - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext, nCyclesSegment; - - nCurrentCPU = 0; - ZetOpen(nCurrentCPU); - - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - if (nNext > nVBlankCycles && !bVBlank) { - nCyclesDone[nCurrentCPU] += ZetRun(nNext - nVBlankCycles); - - if (pBurnDraw != NULL) { - BurnDrvRedraw(); // Draw screen if needed - } - - TigerHeliBufferSprites(); - - bVBlank = true; - - if (bInterruptEnable) { - ZetSetIRQLine(0xff, CPU_IRQSTATUS_ACK); -#if 0 - ZetClose(); - ZetOpen(1); - ZetSetIRQLine(0xff, CPU_IRQSTATUS_AUTO); - ZetClose(); - ZetOpen(0); -#endif - } - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += nCyclesSegment; - } - - ZetClose(); - - if (use_mcu) { - m6805Open(0); - nCyclesSegment = (nCyclesTotal[2] * (i + 1)) / nInterleave; - nCyclesSegment -= m6805TotalCycles(); - if (nCyclesSegment > 0) { - nCyclesDone[2] += m6805Run(nCyclesSegment); - } - m6805Close(); - } - - nCurrentCPU = 1; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - - if (bSoundCPUEnable) { - ZetOpen(nCurrentCPU); - - if ((i & nSoundNMIMask) == 0) { - if (bSoundNMIEnable) { - ZetNmi(); - } - } - - nCyclesDone[nCurrentCPU] += ZetRun(nCyclesSegment); - ZetClose(); - } else { - nCyclesDone[nCurrentCPU] += nCyclesSegment; - } - - { - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - nSoundBufferPos += nSegmentLength; - } - } - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - } - } - } - - return 0; -} - -// --------------------------------------------------------------------------- -// Rom information - - -static struct BurnRomInfo perfrmanRomDesc[] = { - { "ci07.0", 0x4000, 0x7ad32eea, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "ci08.1", 0x4000, 0x90a02d5f, BRF_ESS | BRF_PRG }, // 1 - - { "ci06.4", 0x2000, 0xdf891ad0, BRF_ESS | BRF_PRG }, // 2 - - { "ci02.7", 0x2000, 0x8efa960a, BRF_GRA }, // 3 Background layer - { "ci01.6", 0x2000, 0x2e8e69df, BRF_GRA }, // 4 - { "ci00.5", 0x2000, 0x79e191f8, BRF_GRA }, // 5 - - { "ci05.10", 0x2000, 0x809a4ccc, BRF_GRA }, // 6 Sprite data - { "ci04.9", 0x2000, 0x026f27b3, BRF_GRA }, // 7 - { "ci03.8", 0x2000, 0x6410d9eb, BRF_GRA }, // 8 - - { "ci14.16", 0x0100, 0x515f8a3b, BRF_GRA }, // 9 - { "ci13.15", 0x0100, 0xa9a397eb, BRF_GRA }, // 10 - { "ci12.14", 0x0100, 0x67f86e3d, BRF_GRA }, // 11 - - { "ci11.11", 0x0100, 0xd492e6c2, BRF_OPT }, // 12 - { "ci10.12", 0x0100, 0x59490887, BRF_OPT }, // 13 - { "ci09.13", 0x0020, 0xaa0ca5a5, BRF_OPT }, // 14 -}; - -STD_ROM_PICK(perfrman) -STD_ROM_FN(perfrman) - -static struct BurnRomInfo perfrmanuRomDesc[] = { - { "ci07.0", 0x4000, 0x7ad32eea, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "ci108r5.1", 0x4000, 0x9d373efa, BRF_ESS | BRF_PRG }, // 1 - - { "ci06.4", 0x2000, 0xdf891ad0, BRF_ESS | BRF_PRG }, // 2 - - { "ci02.7", 0x2000, 0x8efa960a, BRF_GRA }, // 3 Background layer - { "ci01.6", 0x2000, 0x2e8e69df, BRF_GRA }, // 4 - { "ci00.5", 0x2000, 0x79e191f8, BRF_GRA }, // 5 - - { "ci05.10", 0x2000, 0x809a4ccc, BRF_GRA }, // 6 Sprite data - { "ci04.9", 0x2000, 0x026f27b3, BRF_GRA }, // 7 - { "ci03.8", 0x2000, 0x6410d9eb, BRF_GRA }, // 8 - - { "ci14.16", 0x0100, 0x515f8a3b, BRF_GRA }, // 9 - { "ci13.15", 0x0100, 0xa9a397eb, BRF_GRA }, // 10 - { "ci12.14", 0x0100, 0x67f86e3d, BRF_GRA }, // 11 - - { "ci11.11", 0x0100, 0xd492e6c2, BRF_OPT }, // 12 - { "ci10.12", 0x0100, 0x59490887, BRF_OPT }, // 13 - { "ci09r1.13", 0x0020, 0xd9e92f6f, BRF_OPT }, // 14 -}; - -STD_ROM_PICK(perfrmanu) -STD_ROM_FN(perfrmanu) - -static struct BurnRomInfo tigerhRomDesc[] = { - { "0.4", 0x004000, 0x4be73246, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "1.4", 0x004000, 0xaad04867, BRF_ESS | BRF_PRG }, // 1 - { "2.4", 0x004000, 0x4843f15c, BRF_ESS | BRF_PRG }, // 2 - - { "a47_13.8j", 0x004000, 0x739a7e7e, BRF_GRA }, // 3 Sprite data - { "a47_12.6j", 0x004000, 0xc064ecdb, BRF_GRA }, // 4 - { "a47_11.8h", 0x004000, 0x744fae9b, BRF_GRA }, // 5 - { "a47_10.6h", 0x004000, 0xe1cf844e, BRF_GRA }, // 6 - - { "a47_05.6f", 0x002000, 0xc5325b49, BRF_GRA }, // 7 Text layer - { "a47_04.6g", 0x002000, 0xcd59628e, BRF_GRA }, // 8 - - { "a47_09.4m", 0x004000, 0x31fae8a8, BRF_GRA }, // 9 Background layer - { "a47_08.6m", 0x004000, 0xe539af2b, BRF_GRA }, // 10 - { "a47_07.6n", 0x004000, 0x02fdd429, BRF_GRA }, // 11 - { "a47_06.6p", 0x004000, 0x11fbcc8c, BRF_GRA }, // 12 - - { "82s129.12q", 0x000100, 0x2c69350d, BRF_GRA }, // 13 - { "82s129.12m", 0x000100, 0x7142e972, BRF_GRA }, // 14 - { "82s129.12n", 0x000100, 0x25f273f2, BRF_GRA }, // 15 - - { "a47_03.12d", 0x002000, 0xd105260f, BRF_ESS | BRF_PRG }, // 16 - - { "a47_14.6a", 0x000800, 0x4042489f, BRF_ESS | BRF_PRG }, // 17 MCU - - { "pal16r4a.2e", 260, 0x00000000, BRF_NODUMP }, -}; - - -STD_ROM_PICK(tigerh) -STD_ROM_FN(tigerh) - -static struct BurnRomInfo tigerhjRomDesc[] = { - { "a47_00.8p", 0x004000, 0xcbdbe3cc, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "a47_01.8n", 0x004000, 0x65df2152, BRF_ESS | BRF_PRG }, // 1 - { "a47_02.8k", 0x004000, 0x633d324b, BRF_ESS | BRF_PRG }, // 2 - - { "a47_13.8j", 0x004000, 0x739a7e7e, BRF_GRA }, // 3 Sprite data - { "a47_12.6j", 0x004000, 0xc064ecdb, BRF_GRA }, // 4 - { "a47_11.8h", 0x004000, 0x744fae9b, BRF_GRA }, // 5 - { "a47_10.6h", 0x004000, 0xe1cf844e, BRF_GRA }, // 6 - - { "a47_05.6f", 0x002000, 0xc5325b49, BRF_GRA }, // 7 Text layer - { "a47_04.6g", 0x002000, 0xcd59628e, BRF_GRA }, // 8 - - { "a47_09.4m", 0x004000, 0x31fae8a8, BRF_GRA }, // 9 Background layer - { "a47_08.6m", 0x004000, 0xe539af2b, BRF_GRA }, // 10 - { "a47_07.6n", 0x004000, 0x02fdd429, BRF_GRA }, // 11 - { "a47_06.6p", 0x004000, 0x11fbcc8c, BRF_GRA }, // 12 - - { "82s129.12q", 0x000100, 0x2c69350d, BRF_GRA }, // 13 - { "82s129.12m", 0x000100, 0x7142e972, BRF_GRA }, // 14 - { "82s129.12n", 0x000100, 0x25f273f2, BRF_GRA }, // 15 - - { "a47_03.12d", 0x002000, 0xd105260f, BRF_ESS | BRF_PRG }, // 16 - - { "a47_14.6a", 0x000800, 0x4042489f, BRF_ESS | BRF_PRG }, // 17 MCU -}; - - -STD_ROM_PICK(tigerhj) -STD_ROM_FN(tigerhj) - -static struct BurnRomInfo tigerhb1RomDesc[] = { - { "b0.5", 0x004000, 0x6ae7e13c, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "a47_01.8n", 0x004000, 0x65df2152, BRF_ESS | BRF_PRG }, // 1 - { "a47_02.8k", 0x004000, 0x633d324b, BRF_ESS | BRF_PRG }, // 2 - - { "a47_13.8j", 0x004000, 0x739a7e7e, BRF_GRA }, // 3 Sprite data - { "a47_12.6j", 0x004000, 0xc064ecdb, BRF_GRA }, // 4 - { "a47_11.8h", 0x004000, 0x744fae9b, BRF_GRA }, // 5 - { "a47_10.6h", 0x004000, 0xe1cf844e, BRF_GRA }, // 6 - - { "a47_05.6f", 0x002000, 0xc5325b49, BRF_GRA }, // 7 Text layer - { "a47_04.6g", 0x002000, 0xcd59628e, BRF_GRA }, // 8 - - { "a47_09.4m", 0x004000, 0x31fae8a8, BRF_GRA }, // 9 Background layer - { "a47_08.6m", 0x004000, 0xe539af2b, BRF_GRA }, // 10 - { "a47_07.6n", 0x004000, 0x02fdd429, BRF_GRA }, // 11 - { "a47_06.6p", 0x004000, 0x11fbcc8c, BRF_GRA }, // 12 - - { "82s129.12q", 0x000100, 0x2c69350d, BRF_GRA }, // 13 - { "82s129.12m", 0x000100, 0x7142e972, BRF_GRA }, // 14 - { "82s129.12n", 0x000100, 0x25f273f2, BRF_GRA }, // 15 - - { "a47_03.12d", 0x002000, 0xd105260f, BRF_ESS | BRF_PRG }, // 16 -}; - - -STD_ROM_PICK(tigerhb1) -STD_ROM_FN(tigerhb1) - -static struct BurnRomInfo tigerhb2RomDesc[] = { - { "rom00_09.bin", 0x004000, 0xef738c68, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "a47_01.8n", 0x004000, 0x65df2152, BRF_ESS | BRF_PRG }, // 1 - { "rom02_07.bin", 0x004000, 0x36e250b9, BRF_ESS | BRF_PRG }, // 2 - - { "a47_13.8j", 0x004000, 0x739a7e7e, BRF_GRA }, // 3 Sprite data - { "a47_12.6j", 0x004000, 0xc064ecdb, BRF_GRA }, // 4 - { "a47_11.8h", 0x004000, 0x744fae9b, BRF_GRA }, // 5 - { "a47_10.6h", 0x004000, 0xe1cf844e, BRF_GRA }, // 6 - - { "a47_05.6f", 0x002000, 0xc5325b49, BRF_GRA }, // 7 Text layer - { "a47_04.6g", 0x002000, 0xcd59628e, BRF_GRA }, // 8 - - { "a47_09.4m", 0x004000, 0x31fae8a8, BRF_GRA }, // 9 Background layer - { "a47_08.6m", 0x004000, 0xe539af2b, BRF_GRA }, // 10 - { "a47_07.6n", 0x004000, 0x02fdd429, BRF_GRA }, // 11 - { "a47_06.6p", 0x004000, 0x11fbcc8c, BRF_GRA }, // 12 - - { "82s129.12q", 0x000100, 0x2c69350d, BRF_GRA }, // 13 - { "82s129.12m", 0x000100, 0x7142e972, BRF_GRA }, // 14 - { "82s129.12n", 0x000100, 0x25f273f2, BRF_GRA }, // 15 - - { "a47_03.12d", 0x002000, 0xd105260f, BRF_ESS | BRF_PRG }, // 16 -}; - - -STD_ROM_PICK(tigerhb2) -STD_ROM_FN(tigerhb2) - -static struct BurnRomInfo tigerhb3RomDesc[] = { - { "14", 0x004000, 0xca59dd73, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "13", 0x004000, 0x38bd54db, BRF_ESS | BRF_PRG }, // 1 - { "a47_02.8k", 0x004000, 0x633d324b, BRF_ESS | BRF_PRG }, // 2 - - { "a47_13.8j", 0x004000, 0x739a7e7e, BRF_GRA }, // 3 Sprite data - { "a47_12.6j", 0x004000, 0xc064ecdb, BRF_GRA }, // 4 - { "a47_11.8h", 0x004000, 0x744fae9b, BRF_GRA }, // 5 - { "a47_10.6h", 0x004000, 0xe1cf844e, BRF_GRA }, // 6 - - { "a47_05.6f", 0x002000, 0xc5325b49, BRF_GRA }, // 7 Text layer - { "a47_04.6g", 0x002000, 0xcd59628e, BRF_GRA }, // 8 - - { "a47_09.4m", 0x004000, 0x31fae8a8, BRF_GRA }, // 9 Background layer - { "a47_08.6m", 0x004000, 0xe539af2b, BRF_GRA }, // 10 - { "a47_07.6n", 0x004000, 0x02fdd429, BRF_GRA }, // 11 - { "a47_06.6p", 0x004000, 0x11fbcc8c, BRF_GRA }, // 12 - - { "82s129.12q", 0x000100, 0x2c69350d, BRF_GRA }, // 13 - { "82s129.12m", 0x000100, 0x7142e972, BRF_GRA }, // 14 - { "82s129.12n", 0x000100, 0x25f273f2, BRF_GRA }, // 15 - - { "a47_03.12d", 0x002000, 0xd105260f, BRF_ESS | BRF_PRG }, // 16 -}; - - -STD_ROM_PICK(tigerhb3) -STD_ROM_FN(tigerhb3) - -static struct BurnRomInfo getstarRomDesc[] = { - { "a68_00-1.8p", 0x004000, 0x6a8bdc6c, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "a68_01-1.8n", 0x004000, 0xebe8db3c, BRF_ESS | BRF_PRG }, // 1 - { "a68_02-1.8k", 0x008000, 0x343e8415, BRF_ESS | BRF_PRG }, // 2 - - { "a68-13.8j", 0x008000, 0x643fb282, BRF_GRA }, // 3 Sprite data - { "a68-12.6j", 0x008000, 0x11f74e32, BRF_GRA }, // 4 - { "a68-11.8h", 0x008000, 0xf24158cf, BRF_GRA }, // 5 - { "a68-10.6h", 0x008000, 0x83161ed0, BRF_GRA }, // 6 - - { "a68_05-1.6f", 0x002000, 0x06f60107, BRF_GRA }, // 7 Text layer - { "a68_04-1.6g", 0x002000, 0x1fc8f277, BRF_GRA }, // 8 - - { "a68_09.4m", 0x008000, 0xa293cc2e, BRF_GRA }, // 9 Background layer - { "a68_08.6m", 0x008000, 0x37662375, BRF_GRA }, // 10 - { "a68_07.6n", 0x008000, 0xcf1a964c, BRF_GRA }, // 11 - { "a68_06.6p", 0x008000, 0x05f9eb9a, BRF_GRA }, // 12 - - { "rom21.12q", 0x000100, 0xd6360b4d, BRF_GRA }, // 13 - { "rom20.12m", 0x000100, 0x4ca01887, BRF_GRA }, // 14 - { "rom19.12p", 0x000100, 0x513224f0, BRF_GRA }, // 15 - - { "a68-03.12d", 0x002000, 0x18daa44c, BRF_ESS | BRF_PRG }, // 16 - - { "a68_14.6a", 0x000800, 0x87c4ca48, BRF_ESS | BRF_PRG }, // 17 MCU ROM -}; - - -STD_ROM_PICK(getstar) -STD_ROM_FN(getstar) - -static struct BurnRomInfo getstarjRomDesc[] = { - { "a68_00.8p", 0x004000, 0xad1a0143, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "a68_01.8n", 0x004000, 0x3426eb7c, BRF_ESS | BRF_PRG }, // 1 - { "a68_02.8k", 0x008000, 0x3567da17, BRF_ESS | BRF_PRG }, // 2 - - { "a68-13.8j", 0x008000, 0x643fb282, BRF_GRA }, // 3 Sprite data - { "a68-12.6j", 0x008000, 0x11f74e32, BRF_GRA }, // 4 - { "a68-11.8h", 0x008000, 0xf24158cf, BRF_GRA }, // 5 - { "a68-10.6h", 0x008000, 0x83161ed0, BRF_GRA }, // 6 - - { "a68_05.6f", 0x002000, 0xe3d409e7, BRF_GRA }, // 7 Text layer - { "a68_04.6g", 0x002000, 0x6e5ac9d4, BRF_GRA }, // 8 - - { "a68_09.4m", 0x008000, 0xa293cc2e, BRF_GRA }, // 9 Background layer - { "a68_08.6m", 0x008000, 0x37662375, BRF_GRA }, // 10 - { "a68_07.6n", 0x008000, 0xcf1a964c, BRF_GRA }, // 11 - { "a68_06.6p", 0x008000, 0x05f9eb9a, BRF_GRA }, // 12 - - { "rom21.12q", 0x000100, 0xd6360b4d, BRF_GRA }, // 13 - { "rom20.12m", 0x000100, 0x4ca01887, BRF_GRA }, // 14 - { "rom19.12p", 0x000100, 0x513224f0, BRF_GRA }, // 15 - - { "a68-03.12d", 0x002000, 0x18daa44c, BRF_ESS | BRF_PRG }, // 16 - - { "a68_14.6a", 0x000800, 0x87c4ca48, BRF_ESS | BRF_PRG }, // 17 MCU ROM -}; - - -STD_ROM_PICK(getstarj) -STD_ROM_FN(getstarj) - -static struct BurnRomInfo gtstarb2RomDesc[] = { - { "gs_14.rom", 0x004000, 0x1a57a920, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "gs_13.rom", 0x004000, 0x805f8e77, BRF_ESS | BRF_PRG }, // 1 - { "a68_02.bin", 0x008000, 0x3567da17, BRF_ESS | BRF_PRG }, // 2 - - { "a68-13", 0x008000, 0x643fb282, BRF_GRA }, // 3 Sprite data - { "a68-12", 0x008000, 0x11f74e32, BRF_GRA }, // 4 - { "a68-11", 0x008000, 0xf24158cf, BRF_GRA }, // 5 - { "a68-10", 0x008000, 0x83161ed0, BRF_GRA }, // 6 - - { "a68_05.bin", 0x002000, 0xe3d409e7, BRF_GRA }, // 7 Text layer - { "a68_04.bin", 0x002000, 0x6e5ac9d4, BRF_GRA }, // 8 - - { "a68_09", 0x008000, 0xa293cc2e, BRF_GRA }, // 9 Background layer - { "a68_08", 0x008000, 0x37662375, BRF_GRA }, // 10 - { "a68_07", 0x008000, 0xcf1a964c, BRF_GRA }, // 11 - { "a68_06", 0x008000, 0x05f9eb9a, BRF_GRA }, // 12 - - { "rom21", 0x000100, 0xd6360b4d, BRF_GRA }, // 13 - { "rom20", 0x000100, 0x4ca01887, BRF_GRA }, // 14 - { "rom19", 0x000100, 0x513224f0, BRF_GRA }, // 15 - - { "a68-03", 0x002000, 0x18daa44c, BRF_ESS | BRF_PRG }, // 16 -}; - - -STD_ROM_PICK(gtstarb2) -STD_ROM_FN(gtstarb2) - -static struct BurnRomInfo gtstarb1RomDesc[] = { - { "gs_rb_1.bin", 0x004000, 0x9afad7e0, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "gs_rb_2.bin", 0x004000, 0x5feb0a60, BRF_ESS | BRF_PRG }, // 1 - { "gs_rb_3.bin", 0x008000, 0xe3cfb1ba, BRF_ESS | BRF_PRG }, // 2 - - { "a68-13", 0x008000, 0x643fb282, BRF_GRA }, // 3 Sprite data - { "a68-12", 0x008000, 0x11f74e32, BRF_GRA }, // 4 - { "a68-11", 0x008000, 0xf24158cf, BRF_GRA }, // 5 - { "a68-10", 0x008000, 0x83161ed0, BRF_GRA }, // 6 - - { "a68_05.bin", 0x002000, 0xe3d409e7, BRF_GRA }, // 7 Text layer - { "a68_04.bin", 0x002000, 0x6e5ac9d4, BRF_GRA }, // 8 - - { "a68_09", 0x008000, 0xa293cc2e, BRF_GRA }, // 9 Background layer - { "a68_08", 0x008000, 0x37662375, BRF_GRA }, // 10 - { "a68_07", 0x008000, 0xcf1a964c, BRF_GRA }, // 11 - { "a68_06", 0x008000, 0x05f9eb9a, BRF_GRA }, // 12 - - { "rom21", 0x000100, 0xd6360b4d, BRF_GRA }, // 13 - { "rom20", 0x000100, 0x4ca01887, BRF_GRA }, // 14 - { "rom19", 0x000100, 0x513224f0, BRF_GRA }, // 15 - - { "a68-03", 0x002000, 0x18daa44c, BRF_ESS | BRF_PRG }, // 16 -}; - - -STD_ROM_PICK(gtstarb1) -STD_ROM_FN(gtstarb1) - -static struct BurnRomInfo alconRomDesc[] = { - { "a77_00-1.8p", 0x008000, 0x2ba82d60, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "a77_01-1.8n", 0x008000, 0x18bb2f12, BRF_ESS | BRF_PRG }, // 1 - - { "a77_12.8j", 0x008000, 0x8545d397, BRF_GRA }, // 2 Sprite data - { "a77_11.7j", 0x008000, 0xb1b7b925, BRF_GRA }, // 3 - { "a77_10.8h", 0x008000, 0x422d946b, BRF_GRA }, // 4 - { "a77_09.7h", 0x008000, 0x587113ae, BRF_GRA }, // 5 - - { "a77_04-1.6f", 0x002000, 0x31003483, BRF_GRA }, // 6 Text layer - { "a77_03-1.6g", 0x002000, 0x404152c0, BRF_GRA }, // 7 - - { "a77_08.6k", 0x008000, 0xb6358305, BRF_GRA }, // 8 Background layer - { "a77_07.6m", 0x008000, 0xe92d9d60, BRF_GRA }, // 9 - { "a77_06.6n", 0x008000, 0x5faeeea3, BRF_GRA }, // 10 - { "a77_05.6p", 0x008000, 0x974e2ea9, BRF_GRA }, // 11 - - { "21_82s129.12q",0x000100, 0xa0efaf99, BRF_GRA }, // 12 - { "20_82s129.12m",0x000100, 0xa56d57e5, BRF_GRA }, // 13 - { "19_82s129.12n",0x000100, 0x5cbf9fbf, BRF_GRA }, // 14 - - { "a77_02.12d", 0x002000, 0x87f4705a, BRF_ESS | BRF_PRG }, // 15 - - { "a77_13.6a", 0x000800, 0xa70c81d9, BRF_ESS | BRF_PRG }, // 16 MCU ROM -}; - - -STD_ROM_PICK(alcon) -STD_ROM_FN(alcon) - -static struct BurnRomInfo slapfighRomDesc[] = { - { "a77_00.8p", 0x008000, 0x674c0e0f, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "a77_01.8n", 0x008000, 0x3c42e4a7, BRF_ESS | BRF_PRG }, // 1 - - { "a77_12.8j", 0x008000, 0x8545d397, BRF_GRA }, // 2 Sprite data - { "a77_11.7j", 0x008000, 0xb1b7b925, BRF_GRA }, // 3 - { "a77_10.8h", 0x008000, 0x422d946b, BRF_GRA }, // 4 - { "a77_09.7h", 0x008000, 0x587113ae, BRF_GRA }, // 5 - - { "a77_04.6f", 0x002000, 0x2ac7b943, BRF_GRA }, // 6 Text layer - { "a77_03.6g", 0x002000, 0x33cadc93, BRF_GRA }, // 7 - - { "a77_08.6k", 0x008000, 0xb6358305, BRF_GRA }, // 8 Background layer - { "a77_07.6m", 0x008000, 0xe92d9d60, BRF_GRA }, // 9 - { "a77_06.6n", 0x008000, 0x5faeeea3, BRF_GRA }, // 10 - { "a77_05.6p", 0x008000, 0x974e2ea9, BRF_GRA }, // 11 - - { "21_82s129.12q",0x000100, 0xa0efaf99, BRF_GRA }, // 12 - { "20_82s129.12m",0x000100, 0xa56d57e5, BRF_GRA }, // 13 - { "19_82s129.12n",0x000100, 0x5cbf9fbf, BRF_GRA }, // 14 - - { "a77_02.12d", 0x002000, 0x87f4705a, BRF_ESS | BRF_PRG }, // 15 - - { "a77_13.6a", 0x000800, 0xa70c81d9, BRF_ESS | BRF_PRG }, // 16 MCU ROM -}; - - -STD_ROM_PICK(slapfigh) -STD_ROM_FN(slapfigh) - -static struct BurnRomInfo slapbtjpRomDesc[] = { - { "sf_r19jb.bin", 0x008000, 0x9a7ac8b3, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "sf_rh.bin", 0x008000, 0x3c42e4a7, BRF_ESS | BRF_PRG }, // 1 - - { "sf_r03.bin", 0x008000, 0x8545d397, BRF_GRA }, // 2 Sprite data - { "sf_r01.bin", 0x008000, 0xb1b7b925, BRF_GRA }, // 3 - { "sf_r04.bin", 0x008000, 0x422d946b, BRF_GRA }, // 4 - { "sf_r02.bin", 0x008000, 0x587113ae, BRF_GRA }, // 5 - - { "sf_r11.bin", 0x002000, 0x2ac7b943, BRF_GRA }, // 6 Text layer - { "sf_r10.bin", 0x002000, 0x33cadc93, BRF_GRA }, // 7 - - { "sf_r06.bin", 0x008000, 0xb6358305, BRF_GRA }, // 8 Background layer - { "sf_r09.bin", 0x008000, 0xe92d9d60, BRF_GRA }, // 9 - { "sf_r08.bin", 0x008000, 0x5faeeea3, BRF_GRA }, // 10 - { "sf_r07.bin", 0x008000, 0x974e2ea9, BRF_GRA }, // 11 - - { "sf_col21.bin", 0x000100, 0xa0efaf99, BRF_GRA }, // 12 - { "sf_col20.bin", 0x000100, 0xa56d57e5, BRF_GRA }, // 13 - { "sf_col19.bin", 0x000100, 0x5cbf9fbf, BRF_GRA }, // 14 - - { "sf_r05.bin", 0x002000, 0x87f4705a, BRF_ESS | BRF_PRG }, // 15 -}; - - -STD_ROM_PICK(slapbtjp) -STD_ROM_FN(slapbtjp) - -static struct BurnRomInfo slapbtukRomDesc[] = { - { "sf_r19eb.bin", 0x004000, 0x2efe47af, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "sf_r20eb.bin", 0x004000, 0xf42c7951, BRF_ESS | BRF_PRG }, // 1 - { "sf_rh.bin", 0x008000, 0x3c42e4a7, BRF_ESS | BRF_PRG }, // 1 - - { "sf_r03.bin", 0x008000, 0x8545d397, BRF_GRA }, // 2 Sprite data - { "sf_r01.bin", 0x008000, 0xb1b7b925, BRF_GRA }, // 3 - { "sf_r04.bin", 0x008000, 0x422d946b, BRF_GRA }, // 4 - { "sf_r02.bin", 0x008000, 0x587113ae, BRF_GRA }, // 5 - - { "sf_r11.bin", 0x002000, 0x2ac7b943, BRF_GRA }, // 6 Text layer - { "sf_r10.bin", 0x002000, 0x33cadc93, BRF_GRA }, // 7 - - { "sf_r06.bin", 0x008000, 0xb6358305, BRF_GRA }, // 8 Background layer - { "sf_r09.bin", 0x008000, 0xe92d9d60, BRF_GRA }, // 9 - { "sf_r08.bin", 0x008000, 0x5faeeea3, BRF_GRA }, // 10 - { "sf_r07.bin", 0x008000, 0x974e2ea9, BRF_GRA }, // 11 - - { "sf_col21.bin", 0x000100, 0xa0efaf99, BRF_GRA }, // 12 - { "sf_col20.bin", 0x000100, 0xa56d57e5, BRF_GRA }, // 13 - { "sf_col19.bin", 0x000100, 0x5cbf9fbf, BRF_GRA }, // 14 - - { "sf_r05.bin", 0x002000, 0x87f4705a, BRF_ESS | BRF_PRG }, // 15 -}; - - -STD_ROM_PICK(slapbtuk) -STD_ROM_FN(slapbtuk) - -static struct BurnRomInfo slapfgtrRomDesc[] = { - { "k1-10.u90", 0x004000, 0x2efe47af, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "k1-09.u89", 0x004000, 0x17c187c5, BRF_ESS | BRF_PRG }, // 1 - { "k1-08.u88", 0x002000, 0x945af97f, BRF_ESS | BRF_PRG }, // 1 - { "k1-07.u87", 0x008000, 0x3c42e4a7, BRF_ESS | BRF_PRG }, // 1 - - { "k1-15.u60", 0x008000, 0x8545d397, BRF_GRA }, // 2 Sprite data - { "k1-13.u50", 0x008000, 0xb1b7b925, BRF_GRA }, // 3 - { "k1-14.u59", 0x008000, 0x422d946b, BRF_GRA }, // 4 - { "k1-12.u49", 0x008000, 0x587113ae, BRF_GRA }, // 5 - - { "k1-02.u57" , 0x002000, 0x2ac7b943, BRF_GRA }, // 6 Text layer - { "k1-03.u58", 0x002000, 0x33cadc93, BRF_GRA }, // 7 - - { "k1-01.u49" , 0x008000, 0xb6358305, BRF_GRA }, // 8 Background layer - { "k1-04.u62", 0x008000, 0xe92d9d60, BRF_GRA }, // 9 - { "k1-05.u63", 0x008000, 0x5faeeea3, BRF_GRA }, // 10 - { "k1-06.u64", 0x008000, 0x974e2ea9, BRF_GRA }, // 11 - - { "sf_col21.bin", 0x000100, 0xa0efaf99, BRF_GRA }, // 12 - { "sf_col20.bin", 0x000100, 0xa56d57e5, BRF_GRA }, // 13 - { "sf_col19.bin", 0x000100, 0x5cbf9fbf, BRF_GRA }, // 14 - - { "k1-11.u89", 0x002000, 0x87f4705a, BRF_ESS | BRF_PRG }, // 15 -}; - -STD_ROM_PICK(slapfgtr) -STD_ROM_FN(slapfgtr) - -struct BurnDriver BurnDrvPerfrman = { - "perfrman", NULL, NULL, NULL, "1985", - "Performan (Japan)\0", NULL, "Toaplan / Data East Corporation", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_SHOOT, 0, - NULL, perfrmanRomInfo, perfrmanRomName, NULL, NULL, performanInputInfo, PerfrmanDIPInfo, - perfrmanInit, tigerhExit, tigerhFrame, perfrmanDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 256, 3, 4 -}; - -struct BurnDriver BurnDrvPerfrmanu = { - "perfrmanu", "perfrman", NULL, NULL, "1985", - "Performan (US)\0", NULL, "Toaplan / Data East USA", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_SHOOT, 0, - NULL, perfrmanuRomInfo, perfrmanuRomName, NULL, NULL, getstarInputInfo, PerfrmanDIPInfo, - perfrmanInit, tigerhExit, tigerhFrame, perfrmanDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 256, 3, 4 -}; - -struct BurnDriver BurnDrvTigerH = { - "tigerh", NULL, NULL, NULL, "1985", - "Tiger Heli (US)\0", NULL, "Toaplan / Taito America Corp.", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, tigerhRomInfo, tigerhRomName, NULL, NULL, tigerhInputInfo, tigerhDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; - -struct BurnDriver BurnDrvTigerhJ = { - "tigerhj", "tigerh", NULL, NULL, "1985", - "Tiger Heli (Japan)\0", NULL, "Toaplan / Taito", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, tigerhjRomInfo, tigerhjRomName, NULL, NULL, tigerhInputInfo, tigerhDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; - -struct BurnDriver BurnDrvTigerHB1 = { - "tigerhb1", "tigerh", NULL, NULL, "1985", - "Tiger Heli (bootleg, set 1)\0", NULL, "bootleg", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, tigerhb1RomInfo, tigerhb1RomName, NULL, NULL, tigerhInputInfo, tigerhDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; - -struct BurnDriver BurnDrvTigerHB2 = { - "tigerhb2", "tigerh", NULL, NULL, "1985", - "Tiger Heli (bootleg, set 2)\0", NULL, "bootleg", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, tigerhb2RomInfo, tigerhb2RomName, NULL, NULL, tigerhInputInfo, tigerhDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; - -struct BurnDriver BurnDrvTigerHB3 = { - "tigerhb3", "tigerh", NULL, NULL, "1985", - "Tiger Heli (bootleg, set 3)\0", NULL, "bootleg", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, tigerhb3RomInfo, tigerhb3RomName, NULL, NULL, tigerhInputInfo, tigerhDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; - -struct BurnDriver BurnDrvGetStar = { - "grdian", NULL, NULL, NULL, "1986", - "Guardian\0", NULL, "Toaplan / Taito America Corporation (Kitkorp license)", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TOAPLAN_MISC, GBF_SCRFIGHT, 0, - NULL, getstarRomInfo, getstarRomName, NULL, NULL, getstarInputInfo, getstarDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 280, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGetStarj = { - "getstarj", "grdian", NULL, NULL, "1986", - "Get Star (Japan)\0", NULL, "Toaplan / Taito", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TOAPLAN_MISC, GBF_SCRFIGHT, 0, - NULL, getstarjRomInfo, getstarjRomName, NULL, NULL, getstarInputInfo, getstarDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 280, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGetStarb2 = { - "getstarb2", "grdian", NULL, NULL, "1986", - "Get Star (bootleg, set 2)\0", NULL, "bootleg", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TOAPLAN_MISC, GBF_SCRFIGHT, 0, - NULL, gtstarb2RomInfo, gtstarb2RomName, NULL, NULL, tigerhInputInfo, getstarb2DIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 280, 240, 4, 3 -}; - -struct BurnDriver BurnDrvGetStarb1 = { - "getstarb1", "grdian", NULL, NULL, "1986", - "Get Star (bootleg, set 1)\0", NULL, "bootleg", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TOAPLAN_MISC, GBF_SCRFIGHT, 0, - NULL, gtstarb1RomInfo, gtstarb1RomName, NULL, NULL, getstarInputInfo, getstarDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 280, 240, 4, 3 -}; - -struct BurnDriver BurnDrvAlcon = { - "alcon", NULL, NULL, NULL, "1986", - "Alcon (US)\0", NULL, "Toaplan / Taito America Corp.", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, alconRomInfo, alconRomName, NULL, NULL, tigerhInputInfo, slapfighDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; - -struct BurnDriver BurnDrvSlapFigh = { - "slapfigh", "alcon", NULL, NULL, "1986", - "Slap Fight (Japan set 1)\0", NULL, "Toaplan / Taito", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_CLONE, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, slapfighRomInfo, slapfighRomName, NULL, NULL, tigerhInputInfo, slapfighDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; - -struct BurnDriver BurnDrvSlapBtJP = { - "slapfighb1", "alcon", NULL, NULL, "1986", - "Slap Fight (bootleg set 1)\0", NULL, "bootleg", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, slapbtjpRomInfo, slapbtjpRomName, NULL, NULL, tigerhInputInfo, slapfighDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; - -struct BurnDriver BurnDrvSlapBtUK = { - "slapfighb2", "alcon", NULL, NULL, "1986", - "Slap Fight (bootleg set 2)\0", NULL, "bootleg", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, slapbtukRomInfo, slapbtukRomName, NULL, NULL, tigerhInputInfo, slapfighDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; - -struct BurnDriver BurnDrvSlapFghtr = { - "slapfighb3", "alcon", NULL, NULL, "1986", - "Slap Fight (bootleg set 3)\0", NULL, "bootleg", "Early Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, slapfgtrRomInfo, slapfgtrRomName, NULL, NULL, tigerhInputInfo, slapfighDIPInfo, - tigerhInit, tigerhExit, tigerhFrame, tigerhDraw, tigerhScan, &tigerhRecalcPalette, 0x100, - 240, 280, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_snowbro2.cpp b/jan/src/burn/drv/toaplan/d_snowbro2.cpp deleted file mode 100644 index 02bf921a7..000000000 --- a/jan/src/burn/drv/toaplan/d_snowbro2.cpp +++ /dev/null @@ -1,618 +0,0 @@ -// FB Alpha Snow Bros. 2 driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -// Snow Bros. 2 - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy3[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy4[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal; - -static INT32 nColCount = 0x0800; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static struct BurnInputInfo snowbro2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy3 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy3 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy3 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2"}, - - {"P3 Start", BIT_DIGITAL, DrvJoy3 + 6, "p3 start"}, - - {"P3 Up", BIT_DIGITAL, DrvJoy3 + 0, "p3 up"}, - {"P3 Down", BIT_DIGITAL, DrvJoy3 + 1, "p3 down"}, - {"P3 Left", BIT_DIGITAL, DrvJoy3 + 2, "p3 left"}, - {"P3 Right", BIT_DIGITAL, DrvJoy3 + 3, "p3 right"}, - {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1"}, - {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2"}, - - {"P4 Start", BIT_DIGITAL, DrvJoy4 + 6, "p4 start"}, - - {"P4 Up", BIT_DIGITAL, DrvJoy4 + 0, "p4 up"}, - {"P4 Down", BIT_DIGITAL, DrvJoy4 + 1, "p4 down"}, - {"P4 Left", BIT_DIGITAL, DrvJoy4 + 2, "p4 left"}, - {"P4 Right", BIT_DIGITAL, DrvJoy4 + 3, "p4 right"}, - {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p4 fire 1"}, - {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(snowbro2) - -static struct BurnDIPInfo snowbro2DIPList[] = { - // Defaults - {0x20, 0xFF, 0xFF, 0x00, NULL}, - {0x21, 0xFF, 0xFF, 0x00, NULL}, - {0x22, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0 , 0xFE, 0 , 2 , "Continue Mode" }, - {0x20, 0x01, 0x01, 0x00, "Normal" }, - {0x20, 0x01, 0x01, 0x01, "Discount" }, - - {0 , 0xFE, 0 , 2 , "Flip Screen" }, - {0x20, 0x01, 0x02, 0x00, "Off" }, - {0x20, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xFE, 0 , 2 , "Service Mode" }, - {0x20, 0x01, 0x04, 0x00, "Off" }, - {0x20, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xFE, 0 , 2 , "Demo Sounds" }, - {0x20, 0x01, 0x08, 0x08, "Off" }, - {0x20, 0x01, 0x08, 0x00, "On" }, - - // Normal coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x82, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x82, 0x30, 0x10, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x82, 0x30, 0x20, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x82, 0x30, 0x30, "2 coins 3 plays"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x82, 0xC0, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x82, 0xC0, 0x40, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x82, 0xC0, 0x80, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x82, 0xC0, 0xC0, "2 coins 3 plays"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - - // European coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x02, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x02, 0x30, 0x10, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x02, 0x30, 0x20, "3 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x02, 0x30, 0x30, "3 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x02, 0xC0, 0x00, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x02, 0xC0, 0x40, "1 coin 3 plays"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x02, 0xC0, 0x80, "1 coin 4 play"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - {0x14, 0x02, 0xC0, 0xC0, "1 coin 6 plays"}, - {0x16, 0x00, 0x0F, 0x08, NULL}, - - // DIP 2 - {0 , 0xFE, 0 , 4 , "Difficulty" }, - {0x21, 0x01, 0x03, 0x01, "Easy" }, - {0x21, 0x01, 0x03, 0x00, "Normal" }, - {0x21, 0x01, 0x03, 0x02, "Hard" }, - {0x21, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xFE, 0 , 4 , "Bonus Life" }, - {0x21, 0x01, 0x0C, 0x04, "100000 / 500000" }, - {0x21, 0x01, 0x0C, 0x00, "100000 only" }, - {0x21, 0x01, 0x0C, 0x08, "200000 only" }, - {0x21, 0x01, 0x0C, 0x0C, "None" }, - - {0 , 0xFE, 0 , 4 , "Lives" }, - {0x21, 0x01, 0x30, 0x30, "1" }, - {0x21, 0x01, 0x30, 0x20, "2" }, - {0x21, 0x01, 0x30, 0x00, "3" }, - {0x21, 0x01, 0x30, 0x10, "4" }, - - {0 , 0xFE, 0 , 2 , "Game Type" }, - {0x21, 0x01, 0x40, 0x00, "Normal" }, - {0x21, 0x01, 0x40, 0x40, "No Death & Stop Mode" }, - - {0 , 0xFE, 0 , 2 , "Max Players" }, - {0x21, 0x01, 0x80, 0x80, "2" }, - {0x21, 0x01, 0x80, 0x00, "4" }, - - // Dip 3 - {0 , 0xFE, 0 , 7 , "Territory" }, - {0x22, 0x01, 0x1C, 0x08, "Europe" }, - {0x22, 0x01, 0x1C, 0x10, "Hong Kong" }, - {0x22, 0x01, 0x1C, 0x00, "Japan" }, - {0x22, 0x01, 0x1C, 0x0c, "Korea" }, - {0x22, 0x01, 0x1C, 0x18, "South East Asia" }, - {0x22, 0x01, 0x1C, 0x14, "Taiwan" }, - {0x22, 0x01, 0x1C, 0x04, "USA" }, - - {0 , 0xFE, 0 , 2 , "Show All Rights Reserved" }, - {0x22, 0x01, 0x20, 0x00, "No" }, - {0x22, 0x01, 0x20, 0x20, "Yes" }, -}; - -STDDIPINFO(snowbro2) - -UINT8 __fastcall snowbro2ReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x30000D: - return ToaVBlankRegister(); - - case 0x70000D: // Player 1 inputs - return DrvInput[0]; - case 0x700011: // Player 2 inputs - return DrvInput[1]; - case 0x700015: // Player 3 inputs - return DrvInput[6]; - case 0x700019: // Player 4 inputs - return DrvInput[7]; - case 0x70001D: // Other inputs - return DrvInput[2]; - case 0x700005: // Dipswitch A - return DrvInput[3]; - case 0x700009: // Dipswitch B - return DrvInput[4]; - case 0x700000: // Dipswitch C - Territory - return DrvInput[5]; - - case 0x600001: - return MSM6295ReadStatus(0); - case 0x500003: - return BurnYM2151ReadStatus(); - - default: { -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - } - return 0; -} - -UINT16 __fastcall snowbro2ReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x30000C: - return ToaVBlankRegister(); - - case 0x70000C: // Player 1 inputs - return DrvInput[0]; - case 0x700010: // Player 2 inputs - return DrvInput[1]; - case 0x700014: // Player 3 inputs - return DrvInput[6]; - case 0x700018: // Player 4 inputs - return DrvInput[7]; - case 0x70001C: // Other inputs - return DrvInput[2]; - case 0x700004: // Dipswitch A - return DrvInput[3]; - case 0x700008: // Dipswitch B - return DrvInput[4]; - - case 0x600000: - return MSM6295ReadStatus(0); - case 0x500002: - return BurnYM2151ReadStatus(); - - default: { -// printf("Attempt to read word value of location %x\n", sekAddress); - } - } - return 0; -} - -void __fastcall snowbro2WriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x600001: - MSM6295Command(0, byteValue); - break; - - case 0x500001: - BurnYM2151SelectRegister(byteValue); - break; - case 0x500003: - BurnYM2151WriteRegister(byteValue); - break; - - default: { -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } - } -} - -void __fastcall snowbro2WriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: - ToaGP9001WriteRegister(wordValue); - break; - - case 0x600000: - MSM6295Command(0, wordValue & 0xFF); - break; - case 0x700030: { - MSM6295SetBank(0, MSM6295ROM + ((wordValue & 0x01) << 18), 0x00000, 0x3ffff); - break; - } - - case 0x500000: - BurnYM2151SelectRegister(wordValue); - break; - case 0x500002: - BurnYM2151WriteRegister(wordValue); - break; - - default: { -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } - } -} - -static INT32 DrvExit() -{ - MSM6295Exit(0); - BurnYM2151Exit(); - - ToaPalExit(); - - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - DrvInput[6] = 0x00; - DrvInput[7] = 0x00; - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - DrvInput[6] |= (DrvJoy3[i] & 1) << i; - DrvInput[7] |= (DrvJoy4[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - ToaClearOpposites(&DrvInput[6]); - ToaClearOpposites(&DrvInput[7]); - - SekNewFrame(); - - nCyclesTotal[0] = (int)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesDone[0] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - bVBlank = true; - - ToaBufferGP9001Sprites(); - - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - { - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - } - - SekClose(); - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - MSM6295ROM = Next; Next += 0x080000; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - RamPal = Next; Next += 0x001000; // palette - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 4, nGP9001ROMSize[0]); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROM, 5, 1); - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020997; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - MSM6295Scan(0, nAction); - BurnYM2151Scan(nAction); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(DrvInput); - } - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = false; -#endif - - nGP9001ROMSize[0] = 0x400000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); // Palette RAM - - SekSetReadWordHandler(0, snowbro2ReadWord); - SekSetReadByteHandler(0, snowbro2ReadByte); - SekSetWriteWordHandler(0, snowbro2WriteWord); - SekSetWriteByteHandler(0, snowbro2WriteByte); - - SekClose(); - } - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - nSpriteYOffset = 0x0011; - ToaInitGP9001(); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - BurnYM2151Init(27000000 / 8); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - MSM6295Init(0, 27000000 / 10 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -// Rom information -static struct BurnRomInfo snowbro2RomDesc[] = { - { "pro-4", 0x080000, 0x4c7ee341, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "rom2-l", 0x100000, 0xe9d366a9, BRF_GRA }, // 1 GP9001 Tile data - { "rom2-h", 0x080000, 0x9aab7a62, BRF_GRA }, // 2 - { "rom3-l", 0x100000, 0xeb06e332, BRF_GRA }, // 3 - { "rom3-h", 0x080000, 0xdf4a952a, BRF_GRA }, // 4 - - { "rom4", 0x080000, 0x638f341e, BRF_SND }, // 5 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(snowbro2) -STD_ROM_FN(snowbro2) - - -struct BurnDriver BurnDrvSnowbro2 = { - "snowbro2", NULL, NULL, NULL, "1994", - "Snow Bros. 2 - with new elves\0", NULL, "[Toaplan] Hanafram", "Toaplan GP9001 based", - L"Snow Bros. 2 - with new elves\0\u304A\u3066\u3093\u304D\u30D1\u30E9\u30C0\u30A4\u30B9\0\u96EA\u4EBA\u5144\u5F1F\uFF12\0\uB208\uC0AC\uB78C\uD615\uC81C\uFF12\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 4, HARDWARE_TOAPLAN_68K_ONLY, GBF_PLATFORM, 0, - NULL, snowbro2RomInfo, snowbro2RomName, NULL, NULL, snowbro2InputInfo, snowbro2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - diff --git a/jan/src/burn/drv/toaplan/d_tekipaki.cpp b/jan/src/burn/drv/toaplan/d_tekipaki.cpp deleted file mode 100644 index 5ce031c79..000000000 --- a/jan/src/burn/drv/toaplan/d_tekipaki.cpp +++ /dev/null @@ -1,735 +0,0 @@ -// FB Alpha Teki Paki driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" - -// Teki Paki - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static UINT8 to_mcu; -static UINT8 z80cmdavailable; - -// Rom information -static struct BurnRomInfo drvRomDesc[] = { - { "tp020-1.bin", 0x010000, 0xD8420BD5, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "tp020-2.bin", 0x010000, 0x7222DE8E, BRF_ESS | BRF_PRG }, // 1 - - { "tp020-4.bin", 0x080000, 0x3EBBE41E, BRF_GRA }, // 2 GP9001 Tile data - { "tp020-3.bin", 0x080000, 0x2D5E2201, BRF_GRA }, // 3 - - { "hd647180.020", 0x008000, 0xd5157c12, BRF_PRG }, // 4 Sound CPU -}; - -STD_ROM_PICK(drv) -STD_ROM_FN(drv) - - -// Rom information -static struct BurnRomInfo whoopeeRomDesc[] = { - { "whoopee.1", 0x020000, 0x28882e7e, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "whoopee.2", 0x020000, 0x6796f133, BRF_ESS | BRF_PRG }, // 1 - - { "tp025-4.bin", 0x100000, 0xab97f744, BRF_GRA }, // 2 GP9001 Tile data - { "tp025-3.bin", 0x100000, 0x7b16101e, BRF_GRA }, // 3 - - { "hd647180.025", 0x008000, 0x00000000, 0x10 | BRF_NODUMP }, // 4 Sound CPU -}; - -STD_ROM_PICK(whoopee) -STD_ROM_FN(whoopee) - -static struct BurnInputInfo tekipakiInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(tekipaki) - -static struct BurnDIPInfo tekipakiDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFE, 0x00, NULL}, - {0x15, 0xFF, 0x43, 0x00, NULL}, - {0x16, 0xFF, 0x0F, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Screen type"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - - // Normal coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x82, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0x30, 0x10, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0x30, 0x20, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0x30, 0x30, "2 coins 3 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x82, 0xC0, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0xC0, 0x40, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0xC0, 0x80, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0xC0, 0xC0, "2 coins 3 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - - // European coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x02, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0x30, 0x10, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0x30, 0x20, "3 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0x30, 0x30, "3 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x02, 0xC0, 0x00, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0xC0, 0x40, "1 coin 3 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0xC0, 0x80, "1 coin 4 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0xC0, 0xC0, "1 coin 6 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B"}, - {0x15, 0x01, 0x03, 0x01, "A"}, - {0x15, 0x01, 0x03, 0x02, "C"}, - {0x15, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 2, NULL}, - {0x15, 0x01, 0x40, 0x00, "Normal game"}, - {0x15, 0x01, 0x40, 0x40, "Stop mode"}, - - // Region - {0, 0xFE, 0, 9, "Game difficulty"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x02, "Europe"}, - {0x16, 0x01, 0x0F, 0x03, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x04, "Korea"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "Taiwan (Spacey Co, ltd.)"}, - {0x16, 0x01, 0x0F, 0x07, "U.S.A. (Romstar inc.)"}, - {0x16, 0x01, 0x0F, 0x08, "Hong Kong (Honest Trading Co.)"}, - {0x16, 0x01, 0x0F, 0x09, "Japan"}, - {0x16, 0x01, 0x0F, 0x0A, "Japan"}, - {0x16, 0x01, 0x0F, 0x0B, "Japan"}, - {0x16, 0x01, 0x0F, 0x0C, "Japan"}, - {0x16, 0x01, 0x0F, 0x0D, "Japan"}, - {0x16, 0x01, 0x0F, 0x0E, "Japan"}, - {0x16, 0x01, 0x0F, 0x0F, "Japan"}, -}; - -STDDIPINFO(tekipaki) - -static struct BurnInputInfo whoopeeInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Service", BIT_DIGITAL, DrvButton + 0, "service"}, - {"Tilt", BIT_DIGITAL, DrvButton + 1, "tilt"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(whoopee) - -static struct BurnDIPInfo whoopeeDIPList[]= -{ - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - {0x15, 0xff, 0xff, 0xf6, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 7, "Coin A" }, - {0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 8, "Coin B" }, - {0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x03, "Hardest" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x00, "Normal" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - {0x14, 0x01, 0x0c, 0x08, "200k only" }, - {0x14, 0x01, 0x0c, 0x00, "200k and every 300k" }, - {0x14, 0x01, 0x0c, 0x04, "150k and every 200k" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "1" }, - {0x14, 0x01, 0x30, 0x20, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 8, "Region" }, - {0x15, 0x01, 0x07, 0x06, "Europe" }, - {0x15, 0x01, 0x07, 0x07, "Europe (Nova Apparate GMBH & Co)" }, - {0x15, 0x01, 0x07, 0x04, "USA" }, - {0x15, 0x01, 0x07, 0x05, "USA (Romstar)" }, - {0x15, 0x01, 0x07, 0x00, "Japan" }, - {0x15, 0x01, 0x07, 0x01, "Asia" }, - {0x15, 0x01, 0x07, 0x02, "Hong Kong (Honest Trading Co.)" }, - {0x15, 0x01, 0x07, 0x03, "Taiwan" }, - - {0 , 0xfe, 0 , 2, "Nudity" }, - {0x15, 0x01, 0x08, 0x08, "Low" }, - {0x15, 0x01, 0x08, 0x00, "High, but censored" }, -}; - -STDDIPINFO(whoopee) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal; - -static UINT8 *DrvZ80ROM; -static UINT8 *DrvZ80RAM; - -static INT32 nColCount = 0x0800; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x040000; // 68000 ROM - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - DrvZ80ROM = Next; Next += 0x008000; - - RamStart = Next; - Ram01 = Next; Next += 0x003000; // CPU #0 work RAM - DrvZ80RAM = Next; Next += 0x000200; - RamPal = Next; Next += 0x001000; // palette - GP9001RAM[0]= Next; Next += 0x008000; // Double size, as the game tests too much memory during POST - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - ToaLoadCode(Rom01, 0, 2); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 2, 2, nGP9001ROMSize[0]); - - return 0; -} - -static UINT8 __fastcall tekipakiReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x180051: // Player 1 inputs - return DrvInput[0]; - case 0x180061: // Player 2 inputs - return DrvInput[1]; - case 0x180021: // Other inputs - return DrvInput[2]; - - case 0x180001: // Dipswitch 1 - return DrvInput[3]; - case 0x180011: // Dipswitch 2 - return DrvInput[4]; - case 0x180031: // Dipswitch 3 - Territory - return (DrvInput[5] & 0x0F) | (z80cmdavailable) ? 0x00 : 0x10; - - case 0x14000D: // VBlank - return ToaVBlankRegister(); - - default: - bprintf(PRINT_NORMAL, _T("Attempt to read byte value of location %x\n"), sekAddress); - } - - return 0; -} - -static UINT16 __fastcall tekipakiReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x180050: // Player 1 inputs - return DrvInput[0]; - case 0x180060: // Player 2 inputs - return DrvInput[1]; - case 0x180020: // Other inputs - return DrvInput[2]; - - case 0x180000: // Dipswitch 1 - return DrvInput[3]; - case 0x180010: // Dipswitch 2 - return DrvInput[4]; - case 0x180030: // Dipswitch 3 - Territory - return (DrvInput[5] & 0x0F) | (z80cmdavailable) ? 0x00 : 0x10; - - case 0x140004: - return ToaGP9001ReadRAM_Hi(0); - case 0x140006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x14000C: - return ToaVBlankRegister(); - - default: - bprintf(PRINT_NORMAL, _T("Attempt to read word value of location %x\n"), sekAddress); - } - - return 0; -} - -static void __fastcall tekipakiWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ -// switch (sekAddress) { -// -// default: -// bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress); -// } -} - -static void __fastcall tekipakiWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x140000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x140004: - ToaGP9001WriteRAM(wordValue, 0); - break; - case 0x140006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x140008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x14000C: - ToaGP9001WriteRegister(wordValue); - break; - - case 0x180070: - to_mcu = wordValue & 0xff; - z80cmdavailable = 1; - break; - - case 0x180040: // coin ctr stuff - break; - - default: - bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress); - } -} - -static UINT8 __fastcall tekipakiZ80In(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x60: { - return (z80cmdavailable) ? 0xff : 0x00; - } - - case 0x84: { - z80cmdavailable = 0; - return to_mcu; - } - - case 0x82: - return BurnYM3812Read(0, 0); - - case 0x83: - return BurnYM3812Read(0, 1); - } - - return 0; -} - -static void __fastcall tekipakiZ80Out(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x82: - BurnYM3812Write(0, 0, nValue); - break; - - case 0x83: - BurnYM3812Write(0, 1, nValue); - break; - } -} - -INT32 tekipakiSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 10000000; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM3812Reset(); - ZetClose(); - - to_mcu = 0; - z80cmdavailable = 0; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = false; -#endif - - nGP9001ROMSize[0] = 0x800000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - if (BurnLoadRom(DrvZ80ROM + 0x000000, 4, 1)) return 1; - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x03FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x080000, 0x082FFF, MAP_RAM); - SekMapMemory(RamPal, 0x0c0000, 0x0c0FFF, MAP_RAM); // Palette RAM - - SekSetReadWordHandler(0, tekipakiReadWord); - SekSetReadByteHandler(0, tekipakiReadByte); - SekSetWriteWordHandler(0, tekipakiWriteWord); - SekSetWriteByteHandler(0, tekipakiWriteByte); - - SekClose(); - } - - { - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(tekipakiZ80In); - ZetSetOutHandler(tekipakiZ80Out); - - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3FFF, MAP_ROM); - ZetMapMemory(DrvZ80RAM, 0xfe00, 0xFFFF, MAP_RAM); - - ZetClose(); - } - - nSpriteYOffset = 0x0011; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - BurnYM3812Init(1, 27000000 / 8, &toaplan1FMIRQHandler, &tekipakiSynchroniseStream, 0); - BurnTimerAttachZetYM3812(10000000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - ToaPalExit(); - - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - ZetExit(); - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - ZetNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = INT32(10000000 / 60); - nCyclesDone[0] = 0; - nCyclesDone[1] = 0; - - SekOpen(0); - ZetOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - bVBlank = true; - - ToaBufferGP9001Sprites(); - - // Trigger VBlank interrupt - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - SekClose(); - ZetClose(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020997; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(to_mcu); - SCAN_VAR(z80cmdavailable); - - ToaRecalcPalette = 1; - bDrawScreen = true; // get background back ? - } - - return 0; -} - -struct BurnDriver BurnDrvTekiPaki = { - "tekipaki", NULL, NULL, NULL, "1991", - "Teki Paki\0", NULL, "Toaplan", "Toaplan GP9001 based", - L"Teki Paki\0\u6D17\u8133\u30B2\u30FC\u30E0\0", NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_PUZZLE, 0, - NULL, drvRomInfo, drvRomName, NULL, NULL, tekipakiInputInfo, tekipakiDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvWhoopee = { - "whoopee", "pipibibs", NULL, NULL, "1991", - "Pipi & Bibis / Whoopee!! (Teki Paki hardware)\0", "No sound (sound MCU not dumped)", "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_PLATFORM, 0, - NULL, whoopeeRomInfo, whoopeeRomName, NULL, NULL, whoopeeInputInfo, whoopeeDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/toaplan/d_truxton.cpp b/jan/src/burn/drv/toaplan/d_truxton.cpp deleted file mode 100644 index 426266f30..000000000 --- a/jan/src/burn/drv/toaplan/d_truxton.cpp +++ /dev/null @@ -1,685 +0,0 @@ -// Truxton -// Based on MAME driver by Darren Olafson, Quench,Stephane Humbert - -#include "toaplan.h" - -#define REFRESHRATE ((28000000.0 / 4.0) / (450.0 * 270.0)) -#define VBLANK_LINES (32) - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static bool bEnableInterrupts; - -// Rom information -static struct BurnRomInfo truxtonRomDesc[] = { - { "b65_11.bin", 0x020000, 0x1a62379a, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "b65_10.bin", 0x020000, 0xaff5195d, BRF_ESS | BRF_PRG }, // 1 - - { "b65_08.bin", 0x020000, 0xd2315b37, BRF_GRA }, // 2 Tile data - { "b65_07.bin", 0x020000, 0xfb83252a, BRF_GRA }, // 3 - { "b65_06.bin", 0x020000, 0x36cedcbe, BRF_GRA }, // 4 - { "b65_05.bin", 0x020000, 0x81cd95f1, BRF_GRA }, // 5 - - { "b65_04.bin", 0x020000, 0x8c6ff461, BRF_GRA }, // 6 - { "b65_03.bin", 0x020000, 0x58b1350b, BRF_GRA }, // 7 - { "b65_02.bin", 0x020000, 0x1dd55161, BRF_GRA }, // 8 - { "b65_01.bin", 0x020000, 0xe974937f, BRF_GRA }, // 9 - - { "b65_09.bin", 0x004000, 0x1bdd4ddc, BRF_ESS | BRF_PRG }, // 10 Z80 program - - { "b65_12.bpr", 0x000020, 0xbc88cced, BRF_SND }, // 11 Sprite attribute PROM - { "b65_13.bpr", 0x000020, 0xa1e17492, BRF_SND }, // 12 ??? -}; - -STD_ROM_PICK(truxton) -STD_ROM_FN(truxton) - -static struct BurnInputInfo truxtonInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 2, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(truxton) - -static struct BurnDIPInfo truxtonDIPList[] = { - // Defaults - {0x12, 0xFF, 0xFF, 0x01, NULL}, - {0x13, 0xFF, 0xFF, 0x00, NULL}, - {0x14, 0xFF, 0xFF, 0x02, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Cabinet"}, - {0x12, 0x01, 0x01, 0x01, "Upright"}, - {0x12, 0x01, 0x01, 0x00, "Cocktail"}, - {0, 0xFE, 0, 2, "Screen type"}, - {0x12, 0x01, 0x02, 0x00, "Normal screen"}, - {0x12, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x12, 0x01, 0x04, 0x00, "Normal mode"}, - {0x12, 0x01, 0x04, 0x04, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x12, 0x01, 0x08, 0x00, "On"}, - {0x12, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, -#if 1 - // Coinage for Europe - {0x12, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x12, 0x01, 0x30, 0x10, "1 coin 2 play"}, - {0x12, 0x01, 0x30, 0x20, "2 coin 1 play"}, - {0x12, 0x01, 0x30, 0x30, "2 coin 3 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x12, 0x01, 0xC0, 0x00, "1 coin 1 play"}, - {0x12, 0x01, 0xC0, 0x40, "1 coin 2 play"}, - {0x12, 0x01, 0xC0, 0x80, "2 coin 1 play"}, - {0x12, 0x01, 0xC0, 0xC0, "2 coin 3 play"}, -#else - // Coinage for Japan - {0x12, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x12, 0x01, 0x30, 0x10, "2 coin 1 play"}, - {0x12, 0x01, 0x30, 0x20, "3 coin 1 play"}, - {0x12, 0x01, 0x30, 0x30, "4 coin 1 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x12, 0x01, 0xC0, 0x00, "1 coin 2 play"}, - {0x12, 0x01, 0xC0, 0x40, "1 coin 3 play"}, - {0x12, 0x01, 0xC0, 0x80, "1 coin 4 play"}, - {0x12, 0x01, 0xC0, 0xC0, "1 coin 6 play"}, -#endif - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x13, 0x01, 0x03, 0x00, "B"}, - {0x13, 0x01, 0x03, 0x01, "A"}, - {0x13, 0x01, 0x03, 0x02, "C"}, - {0x13, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x13, 0x01, 0x0C, 0x00, "70000, every 200000"}, - {0x13, 0x01, 0x0C, 0x04, "50000, every 150000"}, - {0x13, 0x01, 0x0C, 0x08, "100000 only"}, - {0x13, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Number of heros"}, - {0x13, 0x01, 0x30, 0x30, "2"}, - {0x13, 0x01, 0x30, 0x00, "3"}, - {0x13, 0x01, 0x30, 0x20, "4"}, - {0x13, 0x01, 0x30, 0x10, "5"}, - {0, 0xFE, 0, 2, "Dip Switch Display"}, - {0x13, 0x01, 0x40, 0x00, "Off"}, - {0x13, 0x01, 0x40, 0x40, "On"}, - {0, 0xFE, 0, 2, "Allow Continue"}, - {0x13, 0x01, 0x80, 0x00, "Yes"}, - {0x13, 0x01, 0x80, 0x80, "No"}, - - // Region - {0, 0xFE, 0, 5, "Region"}, - {0x14, 0x01, 0x07, 0x00, "Japan/Taito Corp"}, - {0x14, 0x01, 0x07, 0x01, "US/Romstar"}, - {0x14, 0x01, 0x07, 0x02, "World/Taito Corp"}, - {0x14, 0x01, 0x07, 0x04, "US/Taito America"}, - {0x14, 0x01, 0x07, 0x06, "World/Taito America"}, -}; - -STDDIPINFO(truxton) - -static INT32 __fastcall DrvResetCallback() -{ - // Reset instruction on 68000 - - ZetReset(); // Reset Z80 (CPU #1) - BurnYM3812Reset(); - return 0; -} - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal, *RamPal2; - -static INT32 nColCount = 0x0400; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x040000; // - RomZ80 = Next; Next += 0x008000; // Z80 ROM - BCU2ROM = Next; Next += nBCU2ROMSize; // BCU-2 tile data - FCU2ROM = Next; Next += nFCU2ROMSize; // FCU-2 tile data - RamStart = Next; - Ram01 = Next; Next += 0x004000; // CPU #0 work RAM - RamPal = Next; Next += 0x001000; // palette - RamPal2 = Next; Next += 0x001000; // palette - RamZ80 = Next; Next += 0x008000; // Z80 RAM - BCU2RAM = Next; Next += 0x010000; - FCU2RAM = Next; Next += 0x000800; - FCU2RAMSize = Next; Next += 0x000080; - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - ToaPalette2 = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029402; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - ZetScan(nAction); // Scan Z80 - - BurnYM3812Scan(nAction, pnMin); - ToaScanBCU2(nAction, pnMin); - - SCAN_VAR(DrvInput); - SCAN_VAR(nCyclesDone); - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - ToaLoadCode(Rom01, 0, 2); - - // Load BCU-2 tile data - ToaLoadTiles(BCU2ROM, 2, nBCU2ROMSize); - - // Load FCU-2 tile data - ToaLoadTiles(FCU2ROM, 6, nFCU2ROMSize); - - // Load the Z80 ROM - BurnLoadRom(RomZ80, 10, 1); - - return 0; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall truxtonZ80In(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x60: - return BurnYM3812Read(0, 0); - case 0x40: // DIP A - return DrvInput[2]; - case 0x50: // DIP B - return DrvInput[3]; - case 0x20: // Sysytem inputs - return DrvInput[4] | (ToaVBlankRegister() << 7); - case 0x00: // Player 1 - return DrvInput[0]; - case 0x10: // Player 2 - return DrvInput[1]; - case 0x70: // Region - return DrvInput[5]; - - } - -// bprintf(PRINT_NORMAL, _T("z80 read %4X\n"), nAddress); - - return 0; -} - -void __fastcall truxtonZ80Out(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x60: - BurnYM3812Write(0, 0, nValue); - break; - case 0x61: - BurnYM3812Write(0, 1, nValue); - break; - - case 0x30: // Coin counter - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Z80 attempted to write address %04X with value %02X.\n"), nAddress, nValue); - } -} - -static INT32 DrvZ80Init() -{ - // Init the Z80 - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(truxtonZ80In); - ZetSetOutHandler(truxtonZ80Out); - - // ROM - ZetMapArea (0x0000, 0x7FFF, 0, RomZ80); // Direct Read from ROM - ZetMapArea (0x0000, 0x7FFF, 2, RomZ80); // Direct Fetch from ROM - // RAM - ZetMapArea (0x8000, 0xFFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0x8000, 0xFFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0x8000, 0xFFFF, 2, RamZ80); // - - - ZetClose(); - - return 0; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall truxtonReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x0c0001: - case 0x140001: - return ToaVBlankRegister(); - - default: { -// bprintf(PRINT_NORMAL, _T("Read Byte %06X.\n"), sekAddress); - } - } - - return 0; -} - -UINT16 __fastcall truxtonReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x0c0002: - return ToaFCU2GetRAMPointer(); - case 0x0c0004: - return ToaFCU2ReadRAM(); - case 0x0c0006: - return ToaFCU2ReadRAMSize(); - - case 0x100002: - return ToaBCU2GetRAMPointer(); - case 0x100004: - return ToaBCU2ReadRAM_Hi(); - case 0x100006: - return ToaBCU2ReadRAM_Lo(); - - case 0x100010: - case 0x100011: - case 0x100012: - case 0x100013: - case 0x100014: - case 0x100015: - case 0x100016: - case 0x100017: - case 0x100018: - case 0x100019: - case 0x10001A: - case 0x10001B: - case 0x10001C: - case 0x10001D: - case 0x10001E: - case 0x10001F: - return BCU2Reg[(sekAddress & 15) >> 1]; - - case 0x0c0000: - case 0x140000: - return ToaVBlankRegister(); - - default: { -// bprintf(PRINT_NORMAL, _T("Read Word %06X.\n"), sekAddress); - } - } - - return 0; -} - -void __fastcall truxtonWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - case 0x140003: - bEnableInterrupts = byteValue; - break; - - case 0x0c0006: - ToaFCU2WriteRAMSize(byteValue); - break; - - default: { -// bprintf(PRINT_NORMAL, _T("Write byte %06X, %02X.\n"), sekAddress, byteValue); - } - } -} - -void __fastcall truxtonWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x0c0002: // FCU-2 set VRAM address-pointer - ToaFCU2SetRAMPointer(wordValue); - break; - case 0x0c0004: - ToaFCU2WriteRAM(wordValue); - break; - case 0x0c0006: - ToaFCU2WriteRAMSize(wordValue); - break; - - case 0x100000: // BCU-2 flip - break; - case 0x100002: // BCU-2 set VRAM address-pointer - ToaBCU2SetRAMPointer(wordValue); - break; - case 0x100004: - ToaBCU2WriteRAM(wordValue); - break; - case 0x100006: - ToaBCU2WriteRAM(wordValue); - break; - - case 0x100010: - case 0x100011: - case 0x100012: - case 0x100013: - case 0x100014: - case 0x100015: - case 0x100016: - case 0x100017: - case 0x100018: - case 0x100019: - case 0x10001A: - case 0x10001B: - case 0x10001C: - case 0x10001D: - case 0x10001E: - case 0x10001F: - BCU2Reg[(sekAddress & 15) >> 1] = wordValue; - break; - - case 0x140002: - bEnableInterrupts = (wordValue & 0xFF); - break; - - case 0x1c0000: - nBCU2TileXOffset = wordValue; - break; - case 0x1c0002: - nBCU2TileYOffset = wordValue; - break; - - case 0x1c0006: // FCU-2 flip - break; - - case 0x1d0000: - if (wordValue == 0) DrvResetCallback(); - break; - - default: { -// bprintf(PRINT_NORMAL, _T("Write word %06X, %04X.\n"), sekAddress, wordValue); - } - } -} - -// ---------------------------------------------------------------------------- - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - - bEnableInterrupts = false; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - BurnSetRefreshRate(REFRESHRATE); - - nBCU2ROMSize = 0x080000; - nFCU2ROMSize = 0x080000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x03FFFF, MAP_ROM); // 68K ROM - SekMapMemory(Ram01, 0x080000, 0x083FFF, MAP_RAM); // 68K RAM - SekMapMemory(RamPal, 0x144000, 0x1447FF, MAP_RAM); // BCU-2 palette RAM - SekMapMemory(RamPal2, 0x146000, 0x1467FF, MAP_RAM); // FCU-2 palette RAM - - SekSetReadWordHandler(0, truxtonReadWord); - SekSetReadByteHandler(0, truxtonReadByte); - SekSetWriteWordHandler(0, truxtonWriteWord); - SekSetWriteByteHandler(0, truxtonWriteByte); - - SekMapHandler(1, 0x180000, 0x180FFF, MAP_RAM); // Z80 RAM - - SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM); - SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM); - SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM); - SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM); - - SekClose(); - } - - ToaInitBCU2(); - - DrvZ80Init(); // Initialize Z80 - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalSrc2 = RamPal2; - ToaPalInit(); - - BurnYM3812Init(1, 28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0); - BurnTimerAttachZetYM3812(28000000 / 8); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - ToaPalExit(); - - ToaExitBCU2(); - ToaZExit(); // Z80 exit - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderBCU2(); // Render BCU2 graphics - } - - ToaPalUpdate(); // Update the palette - ToaPal2Update(); - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[4] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[4] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - nCyclesTotal[1] = INT32(28000000.0 / 8 / REFRESHRATE); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - ToaBufferFCU2Sprites(); - - bVBlank = true; - if (bEnableInterrupts) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (bVBlank || (!CheckSleep(0))) { // See if this CPU is busywaiting - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - nToa1Cycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesDone[1] = ZetTotalCycles() - nCyclesTotal[1]; - -// bprintf(PRINT_NORMAL, _T(" %i\n"), nCyclesDone[0]); - - ZetClose(); - SekClose(); - -// ToaBufferFCU2Sprites(); - - return 0; -} - -struct BurnDriver BurnDrvTruxton = { - "truxton", NULL, NULL, NULL, "1988", - "Truxton\0Tatsujin\0", NULL, "[Toaplan] Taito Corporation", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, truxtonRomInfo, truxtonRomName, NULL, NULL, truxtonInputInfo, truxtonDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_truxton2.cpp b/jan/src/burn/drv/toaplan/d_truxton2.cpp deleted file mode 100644 index 206813f83..000000000 --- a/jan/src/burn/drv/toaplan/d_truxton2.cpp +++ /dev/null @@ -1,619 +0,0 @@ -// FB Alpha Truxton 2 driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -// Truxton 2 - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal; - -static const INT32 nColCount = 0x0800; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static UINT8 nIRQPending; - -static struct BurnInputInfo truxton2InputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(truxton2) - -static struct BurnDIPInfo truxton2DIPList[] = { - // Defaults - {0x14, 0xFF, 0xFE, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - {0x16, 0xFF, 0x0F, 0x02, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Screen type"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - - // Normal coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x82, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0x30, 0x10, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0x30, 0x20, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0x30, 0x30, "2 coins 3 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x82, 0xC0, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0xC0, 0x40, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0xC0, 0x80, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x82, 0xC0, 0xC0, "2 coins 3 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - - // European coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x02, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0x30, 0x10, "2 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0x30, 0x20, "3 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0x30, 0x30, "3 coins 1 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x02, 0xC0, 0x00, "1 coin 2 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0xC0, 0x40, "1 coin 3 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0xC0, 0x80, "1 coin 4 play"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - {0x14, 0x02, 0xC0, 0xC0, "1 coin 6 plays"}, - {0x16, 0x00, 0x0F, 0x02, NULL}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B"}, - {0x15, 0x01, 0x03, 0x01, "A"}, - {0x15, 0x01, 0x03, 0x02, "C"}, - {0x15, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend"}, - {0x15, 0x01, 0x0C, 0x00, "70000, 200000"}, - {0x15, 0x01, 0x0C, 0x04, "100000, 250000"}, - {0x15, 0x01, 0x0C, 0x08, "100000"}, - {0x15, 0x01, 0x0C, 0x0C, "200000"}, - {0, 0xFE, 0, 4, "Hero counts"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x01, "5"}, - {0x15, 0x01, 0x30, 0x02, "4"}, - {0x15, 0x01, 0x30, 0x03, "2"}, - {0, 0xFE, 0, 2, "Cheating"}, - {0x15, 0x01, 0x40, 0x00, "Normal game"}, - {0x15, 0x01, 0x40, 0x40, "No-death & stop mode"}, - {0, 0xFE, 0, 2, "Continue play"}, - {0x15, 0x01, 0x80, 0x00, "On"}, - {0x15, 0x01, 0x80, 0x80, "Off"}, - - // DIP 3 - {0, 0xFE, 0, 7, "For"}, - {0x16, 0x01, 0x0F, 0x00, "Japan"}, - {0x16, 0x01, 0x0F, 0x01, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x02, "Europe"}, - {0x16, 0x01, 0x0F, 0x03, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x04, "Korea"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "South East Asia"}, - {0x16, 0x01, 0x0F, 0x07, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x08, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x09, "Korea"}, - {0x16, 0x01, 0x0F, 0x0A, "U.S.A."}, - {0x16, 0x01, 0x0F, 0x0B, ""}, - {0x16, 0x01, 0x0F, 0x0C, ""}, - {0x16, 0x01, 0x0F, 0x0D, ""}, - {0x16, 0x01, 0x0F, 0x0E, ""}, - {0x16, 0x01, 0x0F, 0x0F, "Japan"}, -}; - -STDDIPINFO(truxton2) - -UINT8 __fastcall truxton2ReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x700007: // Player 1 inputs - return DrvInput[0]; - case 0x700009: // Player 2 inputs - return DrvInput[1]; - case 0x70000B: // Other inputs - return DrvInput[2]; - case 0x700001: // Dipswitch A - return DrvInput[3]; - case 0x700003: // Dipswitch B - return DrvInput[4]; - case 0x700005: // Dipswitch C - Territory - return DrvInput[5]; - - case 0x700011: - return MSM6295ReadStatus(0); - case 0x700017: - return BurnYM2151ReadStatus(); - - default: { -// printf("Attempt to read byte value of location %x\n", sekAddress); - - if ((sekAddress & 0x00FF0000) == 0x00500000) { - return ExtraTROM[(sekAddress & 0xFFFF) >> 1]; - } - } - } - return 0; -} - -UINT16 __fastcall truxton2ReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x200004: - return ToaGP9001ReadRAM_Hi(0); - case 0x200006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x20000C: - return ToaVBlankRegister(); - - case 0x600000: - return ToaScanlineRegister(); - - case 0x700006: // Player 1 inputs - return DrvInput[0]; - case 0x700008: // Player 2 inputs - return DrvInput[1]; - case 0x70000A: // Other inputs - return DrvInput[2]; - case 0x700000: // Dipswitch A - return DrvInput[3]; - case 0x700002: // Dipswitch B - return DrvInput[4]; - case 0x700004: // Dipswitch C - Territory - return DrvInput[5]; - - case 0x700010: - return MSM6295ReadStatus(0); - case 0x700016: - return BurnYM2151ReadStatus(); - - default: { -// printf("Attempt to read word value of location %x\n", sekAddress); - - if ((sekAddress & 0x00FF0000) == 0x00500000) { - return ExtraTROM[(sekAddress & 0xFFFF) >> 1] | (ExtraTROM[0x8000 + ((sekAddress & 0xFFFF) >> 1)] << 8); - } - } - } - return 0; -} - -void __fastcall truxton2WriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - case 0x700011: - MSM6295Command(0, byteValue); - break; - - case 0x700015: - BurnYM2151SelectRegister(byteValue); - break; - case 0x700017: - BurnYM2151WriteRegister(byteValue); - break; - - default: { -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - - if ((sekAddress & 0x00FF0000) == 0x00500000) { - ExtraTROM[(sekAddress & 0xFFFF) >> 1] = byteValue; - } - } - } -} - -void __fastcall truxton2WriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - case 0x200000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x200004: - case 0x200006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x200008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x20000C: - ToaGP9001WriteRegister(wordValue); - break; - - case 0x700010: - MSM6295Command(0, wordValue & 0xFF); - break; - case 0x700014: - BurnYM2151SelectRegister(wordValue); - break; - case 0x700016: - BurnYM2151WriteRegister(wordValue); - break; - - default: { -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - - if ((sekAddress & 0x00FF0000) == 0x00500000) { - ExtraTROM[(sekAddress & 0xFFFF) >> 1] = wordValue & 0xFF; - ExtraTROM[0x8000 + ((sekAddress & 0xFFFF) >> 1)] = wordValue << 8; - } - } - } -} - -static INT32 DrvExit() -{ - MSM6295Exit(0); - BurnYM2151Exit(); - - ToaPalExit(); - - ToaExtraTextExit(); - ToaExitGP9001(); - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - nIRQPending = 0; - SekSetIRQLine(0, CPU_IRQSTATUS_NONE); - SekReset(); - SekClose(); - - MSM6295Reset(0); - BurnYM2151Reset(); - - HiscoreReset(); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - ToaExtraTextLayer(); // Render extra text layer - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 8; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesDone[0] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - INT32 nSoundBufferPos = 0; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - if (!CheckSleep(nCurrentCPU)) { - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - } - - nIRQPending = 1; - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - - ToaBufferGP9001Sprites(); - - bVBlank = true; - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nIRQPending = 0; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - if ((i & 1) == 0) { - // Render sound segment - if (pBurnSoundOut) { - INT32 nSegmentLength = (nBurnSoundLen * i / nInterleave) - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - } - - { - // Make sure the buffer is entirely filled. - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - if (nSegmentLength) { - BurnYM2151Render(pSoundBuf, nSegmentLength); - MSM6295Render(0, pSoundBuf, nSegmentLength); - } - } - } - - SekClose(); - - if (pBurnDraw != NULL) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - MSM6295ROM = Next; Next += 0x080000; - RamStart = Next; - Ram01 = Next; Next += 0x010000; // CPU #0 work RAM - ExtraTROM = Next; Next += 0x010000; // Extra tile layer - ExtraTRAM = Next; Next += 0x002000; // Extra tile layer - ExtraTScroll= Next; Next += 0x001000; // - ExtraTSelect= Next; Next += 0x001000; // - RamPal = Next; Next += 0x001000; // palette - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - BurnByteswap(Rom01, 0x80000); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 2, nGP9001ROMSize[0]); - - // Load MSM6295 ADPCM data - BurnLoadRom(MSM6295ROM, 3, 1); - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - if (pnMin) { // Return minimum compatible version - *pnMin = 0x029497; - } - - if (nAction & ACB_VOLATILE) { // Scan volatile data - struct BurnArea ba; - - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - - MSM6295Scan(0, nAction); - BurnYM2151Scan(nAction); - - ToaScanGP9001(nAction, pnMin); - - SCAN_VAR(DrvInput); - SCAN_VAR(nIRQPending); - } - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x200000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x10FFFF, MAP_RAM); - SekMapMemory(RamPal, 0x300000, 0x300FFF, MAP_RAM); // Palette RAM - SekMapMemory(ExtraTRAM, 0x400000, 0x401FFF, MAP_RAM); - SekMapMemory(ExtraTSelect, 0x402000, 0x402FFF, MAP_RAM); // 0x502000 - Scroll; 0x502200 - RAM - SekMapMemory(ExtraTScroll, 0x403000, 0x403FFF, MAP_RAM); // 0x203000 - Offset; 0x503200 - RAM - - SekSetReadWordHandler(0, truxton2ReadWord); - SekSetReadByteHandler(0, truxton2ReadByte); - SekSetWriteWordHandler(0, truxton2WriteWord); - SekSetWriteByteHandler(0, truxton2WriteByte); - - SekClose(); - } - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - nSpriteYOffset = 0x0001; - ToaInitGP9001(); - - ToaExtraTextInit(); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - BurnYM2151Init(27000000 / 8); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT); - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT); - MSM6295Init(0, 27000000 / 10 / 132, 1); - MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - - return 0; -} - -// Rom information -static struct BurnRomInfo truxton2RomDesc[] = { - { "tp024_1.bin", 0x080000, 0xf5cfe6ee, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp024_4.bin", 0x100000, 0x805C449E, BRF_GRA }, // 1 GP9001 Tile data - { "tp024_3.bin", 0x100000, 0x47587164, BRF_GRA }, // 2 - - { "tp024_2.bin", 0x080000, 0xF2F6CAE4, BRF_SND }, // 3 MSM6295 ADPCM data -}; - - -STD_ROM_PICK(truxton2) -STD_ROM_FN(truxton2) - - -struct BurnDriver BurnDrvTruxton2 = { - "truxton2", NULL, NULL, NULL, "1992", - "Truxton II\0Tatsujin Oh\0", NULL, "Toaplan", "Toaplan GP9001 based", - L"Truxton II\0\u9054\u4EBA\u738B\0", NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_ONLY, GBF_VERSHOOT, 0, - NULL, truxton2RomInfo, truxton2RomName, NULL, NULL, truxton2InputInfo, truxton2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - diff --git a/jan/src/burn/drv/toaplan/d_twincobr.cpp b/jan/src/burn/drv/toaplan/d_twincobr.cpp deleted file mode 100644 index 3bf0614a6..000000000 --- a/jan/src/burn/drv/toaplan/d_twincobr.cpp +++ /dev/null @@ -1,1989 +0,0 @@ -// FB Alpha Twin Cobra driver module -// Based on MAME driver by Quench - -#include "tiles_generic.h" -#include "m68000_intf.h" -#include "tms32010.h" -#include "z80_intf.h" -#include "burn_ym3812.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvMCUROM; -static UINT8 *DrvZ80ROM; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSprRAM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvMCURAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvTxRAM; -static UINT8 *DrvSprBuf; - -static UINT16 *pTempDraw; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvJoy4[8]; -static UINT8 DrvDips[3]; -static UINT8 DrvReset; -static UINT8 DrvInputs[4]; - -static UINT16 scrollx[4]; -static UINT16 scrolly[4]; -static UINT16 vidramoffs[4]; -static INT32 vblank; - -static UINT16 golfwar = 0; - -static INT32 m68k_halt = 0; -static INT32 irq_enable; -static INT32 flipscreen; -static INT32 bgrambank; -static INT32 fgrombank; -static INT32 displayenable; -static INT32 fsharkbt_8741; - -static UINT32 main_ram_seg; -static UINT16 dsp_addr_w; -static INT32 dsp_execute; -static INT32 dsp_BIO; -static INT32 dsp_on; - -static struct BurnInputInfo TwincobrInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Twincobr) - -static struct BurnInputInfo FsharkInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy4 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy4 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy4 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy4 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy4 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy4 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Fshark) - -static struct BurnDIPInfo TwincobrDIPList[]= -{ - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+" }, - {0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+" }, - {0x14, 0x01, 0x0c, 0x08, "50k Only" }, - {0x14, 0x01, 0x0c, 0x0c, "100k Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Dip Switch Display" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Twincobr) - -static struct BurnDIPInfo TwincobruDIPList[]= -{ - {0x13, 0xff, 0xff, 0x00, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+" }, - {0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+" }, - {0x14, 0x01, 0x0c, 0x08, "50k Only" }, - {0x14, 0x01, 0x0c, 0x0c, "100k Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Dip Switch Display" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, -}; - -STDDIPINFO(Twincobru) - - -static struct BurnDIPInfo KtigerDIPList[]= -{ - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x04, "50k 200k 150k+" }, - {0x14, 0x01, 0x0c, 0x00, "70k 270k 200k+" }, - {0x14, 0x01, 0x0c, 0x08, "100k Only" }, - {0x14, 0x01, 0x0c, 0x0c, "None" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x20, "4" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Dip Switch Display" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Ktiger) - - -static struct BurnDIPInfo FsharkDIPList[]= -{ - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+" }, - {0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+" }, - {0x14, 0x01, 0x0c, 0x08, "50k Only" }, - {0x14, 0x01, 0x0c, 0x0c, "100k Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x20, "1" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Dip Switch Display" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Fshark) - -static struct BurnDIPInfo SkysharkDIPList[]= -{ - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x80, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 3, "Coin A" }, - {0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x20, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 3, "Coin B" }, - {0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0x80, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+" }, - {0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+" }, - {0x14, 0x01, 0x0c, 0x08, "50k Only" }, - {0x14, 0x01, 0x0c, 0x0c, "100k Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x20, "1" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Dip Switch Display" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Skyshark) - - -static struct BurnDIPInfo HishouzaDIPList[]= -{ - {0x13, 0xff, 0xff, 0x01, NULL }, - {0x14, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x13, 0x01, 0x01, 0x01, "Upright" }, - {0x13, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x13, 0x01, 0x02, 0x00, "Off" }, - {0x13, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x13, 0x01, 0x04, 0x00, "Off" }, - {0x13, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x13, 0x01, 0x08, 0x08, "Off" }, - {0x13, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x13, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x13, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x13, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x13, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x14, 0x01, 0x03, 0x01, "Easy" }, - {0x14, 0x01, 0x03, 0x00, "Normal" }, - {0x14, 0x01, 0x03, 0x02, "Hard" }, - {0x14, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+" }, - {0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+" }, - {0x14, 0x01, 0x0c, 0x08, "50k Only" }, - {0x14, 0x01, 0x0c, 0x0c, "100k Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x14, 0x01, 0x30, 0x20, "1" }, - {0x14, 0x01, 0x30, 0x30, "2" }, - {0x14, 0x01, 0x30, 0x00, "3" }, - {0x14, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Dip Switch Display" }, - {0x14, 0x01, 0x40, 0x00, "Off" }, - {0x14, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x14, 0x01, 0x80, 0x00, "No" }, - {0x14, 0x01, 0x80, 0x80, "Yes" }, -}; - -STDDIPINFO(Hishouza) - -static void palette_write(INT32 offset) -{ - offset &= 0xffe; - - INT32 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (p >> 0) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r,g,b,0); -} - -static void twincobr_dsp(INT32 enable) -{ - enable ^= 1; - dsp_on = enable; - - if (enable) - { - tms32010_set_irq_line(0, CPU_IRQSTATUS_ACK); /* TMS32010 INT */ - m68k_halt = 1; - SekRunEnd(); - } - else - { - tms32010_set_irq_line(0, CPU_IRQSTATUS_NONE); /* TMS32010 INT */ - } -} - -static void control_write(UINT16 data) -{ - switch (data) - { - case 0x0004: - case 0x0005: - irq_enable = data & 1; - break; - - case 0x0006: - case 0x0007: - flipscreen = data & 1; - break; - - case 0x0008: - case 0x0009: - bgrambank = ((data & 1) << 13); - break; - - case 0x000a: - case 0x000b: - fgrombank = ((data & 1) << 12); - break; - - case 0x000c: - case 0x000d: - twincobr_dsp(data & 1); - break; - - case 0x000e: - case 0x000f: - displayenable = data & 1; - break; - } -} - -static void __fastcall twincobr_main_write_word(UINT32 address, UINT16 data) -{ - if ((address & 0xfff000) == 0x07a000) { - DrvShareRAM[(address / 2) & 0x7ff] = data & 0xff; - return; - } - - if ((address & 0xfff000) == 0x050000) { - *((UINT16*)(DrvPalRAM + (address & 0xffe))) = data; - palette_write(address); - return; - } - - switch (address) - { - case 0x060000: - // mc6845 address_w - return; - - case 0x060002: - // mc6845 register_w - return; - - case 0x070000: - scrollx[0] = data; - return; - - case 0x070002: - scrolly[0] = data; - return; - - case 0x070004: - vidramoffs[0] = data<<1; - return; - - case 0x072000: - scrollx[1] = data; - return; - - case 0x072002: - scrolly[1] = data; - return; - - case 0x072004: - vidramoffs[1] = data<<1; - return; - - case 0x074000: - scrollx[2] = data; - return; - - case 0x074002: - scrolly[2] = data; - return; - - case 0x074004: - vidramoffs[2] = data<<1; - return; - - case 0x076000: - case 0x076002: // exscroll (not used) - return; - - case 0x07800a: - if (data < 2) twincobr_dsp(data); - return; - - case 0x07800c: - control_write(data & 0xff); - return; - - case 0x07e000: - *((UINT16*)(DrvTxRAM + (vidramoffs[0] & 0x0ffe))) = data; - return; - - case 0x07e002: - *((UINT16*)(DrvBgRAM + (vidramoffs[1] & 0x1ffe) + bgrambank)) = data; - return; - - case 0x07e004: - *((UINT16*)(DrvFgRAM + (vidramoffs[2] & 0x1ffe))) = data; - return; - } -} - -static void __fastcall twincobr_main_write_byte(UINT32 address, UINT8 data) -{ - if ((address & 0xfff000) == 0x050000) { - DrvPalRAM[(address & 0xfff)^1] = data; - palette_write(address); - return; - } - - bprintf (0, _T("MWB %5.5x, %2.2x\n"), address, data); -} - -static UINT16 __fastcall twincobr_main_read_word(UINT32 address) -{ - if ((address & 0xfff000) == 0x07a000) { - return DrvShareRAM[(address / 2) & 0x7ff] & 0xff; - } - - switch (address) - { - case 0x07e000: - return *((UINT16*)(DrvTxRAM + (vidramoffs[0] & 0x0ffe))); - - case 0x07e002: - return *((UINT16*)(DrvBgRAM + (vidramoffs[1] & 0x1ffe) + bgrambank)); - - case 0x07e004: - return *((UINT16*)(DrvFgRAM + (vidramoffs[2] & 0x1ffe))); - - case 0x078000: - return DrvDips[0]; - - case 0x078002: - return DrvDips[1]; - - case 0x078004: - return DrvInputs[0]; - - case 0x078006: - return DrvInputs[1]; - - case 0x078008: - return ((DrvInputs[3] & 0x7f) | (vblank ? 0x80 : 0)) ^ golfwar; - } - - return 0; -} - -static UINT8 __fastcall twincobr_main_read_byte(UINT32 address) -{ - if ((address & 0xfff000) == 0x07a000) { - return DrvShareRAM[(address / 2) & 0x7ff] & 0xff; - } - - switch (address) - { - case 0x078001: - return DrvDips[0]; - - case 0x078003: - return DrvDips[1]; - - case 0x078009: - return ((vblank ? 0x80 : 0) | (DrvInputs[3] & 0x7f)) ^ golfwar; - } - - bprintf (0, _T("MRB %5.5x\n"), address); - - return 0; -} - -static void __fastcall twincobr_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - BurnYM3812Write(0, port & 1, data); - return; - - case 0x20: - if (data < 2) twincobr_dsp(data); - return; - } -} - -static UINT8 __fastcall twincobr_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM3812Read(0, port & 1); - - case 0x10: - return DrvInputs[2]; - - case 0x40: - return DrvDips[0]; - - case 0x50: - return DrvDips[1]; - } - - return 0; -} - -static void twincobr_dsp_addrsel_w(UINT16 data) -{ - main_ram_seg = ((data & 0xe000) << 3); - dsp_addr_w = ((data & 0x1fff) << 1); -} - -static UINT16 twincobr_dsp_r() -{ - switch (main_ram_seg) - { - case 0x30000: - case 0x40000: - case 0x50000: - return SekReadWord(main_ram_seg + dsp_addr_w); - } - - return 0; -} - -static void twincobr_dsp_w(UINT16 data) -{ - dsp_execute = 0; - - switch (main_ram_seg) - { - case 0x30000: if ((dsp_addr_w < 3) && (data == 0)) dsp_execute = 1; - case 0x40000: - case 0x50000: - SekWriteWord(main_ram_seg + dsp_addr_w, data); - break; - } -} - -static void twincobr_dsp_bio_w(UINT16 data) -{ - if (data & 0x8000) { - dsp_BIO = 0; - } - - if (data == 0) { - if (dsp_execute) { - m68k_halt = 0; - dsp_execute = 0; - tms32010RunEnd(); - } - - dsp_BIO = 1; - } -} - -static UINT8 twincobr_BIO_r() -{ - return dsp_BIO; -} - -static void dsp_write(INT32 port, UINT16 data) -{ - switch (port) - { - case 0x00: twincobr_dsp_addrsel_w(data); return; - case 0x01: twincobr_dsp_w(data); return; - case 0x02: return; // bootleg - case 0x03: twincobr_dsp_bio_w(data); return; - } -} - -static UINT16 dsp_read(INT32 port) -{ - switch (port) - { - case 0x01: return twincobr_dsp_r(); - case 0x02: fsharkbt_8741 += 1; return (fsharkbt_8741 & 1); - case 0x10: return twincobr_BIO_r(); - } - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(double)ZetTotalCycles() * nSoundRate / 3500000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM3812Reset(); - ZetClose(); - - tms32010_reset(); - - irq_enable = 0; - flipscreen = 0; - bgrambank = 0; - fgrombank = 0; - displayenable = 0; - - main_ram_seg = 0; - dsp_addr_w = 0; - dsp_execute = 0; - dsp_BIO = 0; - dsp_on = 0; - - fsharkbt_8741 = -1; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvMCUROM = Next; Next += 0x004000; - DrvZ80ROM = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x040000; - DrvGfxROM3 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0700 * sizeof(UINT32); - - pTempDraw = (UINT16*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT16); - - AllRam = Next; - - DrvSprBuf = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - Drv68KRAM = Next; Next += 0x010000; - DrvMCURAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x000e00; - DrvShareRAM = Next; Next += 0x000800; - - DrvBgRAM = Next; Next += 0x004000; - DrvFgRAM = Next; Next += 0x002000; - DrvTxRAM = Next; Next += 0x001000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { (0x4000*8*0), (0x4000*8*1), (0x4000*8*2) }; - INT32 Plane1[4] = { (0x8000*8*0), (0x8000*8*1), (0x8000*8*2), (0x8000*8*3) }; - INT32 Plane2[4] = { (0x10000*8*0), (0x10000*8*1), (0x10000*8*2), (0x10000*8*3) }; - INT32 XOffs[16] = { STEP16(0,1) }; - INT32 YOffs[8] = { STEP8(0,8) }; - INT32 YOffs1[16] = { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0xc000); - - GfxDecode(0x0800, 3, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x40000); - - GfxDecode(0x2000, 4, 8, 8, Plane2, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - - memcpy (tmp, DrvGfxROM2, 0x20000); - - GfxDecode(0x1000, 4, 8, 8, Plane1, XOffs, YOffs, 0x040, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane2, XOffs, YOffs1, 0x100, tmp, DrvGfxROM3); - - BurnFree(tmp); - - return 0; -} - -static INT32 LoadNibbles(UINT8 *dst, INT32 idx, INT32 len) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(len*2); - - if (BurnLoadRom(dst + 0, idx + 1, 2)) return 1; - if (BurnLoadRom(dst + 1, idx + 3, 2)) return 1; - if (BurnLoadRom(tmp + 0, idx + 0, 2)) return 1; - if (BurnLoadRom(tmp + 1, idx + 2, 2)) return 1; - - for (INT32 i = 0; i < len * 2; i++) { - dst[i] = (dst[i] & 0xf) | (tmp[i] << 4); - } - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit(INT32 game_select) -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - if (game_select == 0) // Twin Cobra - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x20001, 2, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x20000, 3, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 4, 1)) return 1; - - if (BurnLoadRom(DrvMCUROM + 0x00001, 5, 2)) return 1; - if (BurnLoadRom(DrvMCUROM + 0x00000, 6, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 7, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 9, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 17, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x10000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x30000, 21, 1)) return 1; - } - else if (game_select == 1) // Flying Shark - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (LoadNibbles(DrvMCUROM + 0x00000, 3, 0x0400)) return 1; - if (LoadNibbles(DrvMCUROM + 0x00800, 7, 0x0400)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 11, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 13, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 15, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 17, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 19, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 21, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x10000, 23, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x30000, 25, 1)) return 1; - } - else if (game_select == 2 || game_select == 3) // gulfwar2 - { - if (BurnLoadRom(Drv68KROM + 0x00001, 0, 2)) return 1; - if (BurnLoadRom(Drv68KROM + 0x00000, 1, 2)) return 1; - - if (BurnLoadRom(DrvZ80ROM + 0x00000, 2, 1)) return 1; - - if (BurnLoadRom(DrvMCUROM + 0x00001, 3, 2)) return 1; - if (BurnLoadRom(DrvMCUROM + 0x00000, 4, 2)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 6, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 7, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 8, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 9, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x20000, 10, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x30000, 11, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x10000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x30000, 19, 1)) return 1; - - golfwar = (game_select == 2) ? 0xff : 0; - } - - DrvGfxDecode(); - - BurnSetRefreshRate(54.877858); - - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x02ffff, MAP_ROM); - SekMapMemory(Drv68KRAM, 0x030000, 0x033fff, MAP_RAM); - SekMapMemory(DrvSprRAM, 0x040000, 0x040fff, MAP_RAM); - SekMapMemory(DrvPalRAM, 0x050000, 0x050dff, MAP_ROM); -// SekMapMemory(DrvShareRAM, 0x07a000, 0x07afff, MAP_RAM); - SekSetWriteWordHandler(0, twincobr_main_write_word); - SekSetWriteByteHandler(0, twincobr_main_write_byte); - SekSetReadWordHandler(0, twincobr_main_read_word); - SekSetReadByteHandler(0, twincobr_main_read_byte); - SekClose(); - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0x8000, 0x87ff, MAP_RAM); - ZetSetOutHandler(twincobr_sound_write_port); - ZetSetInHandler(twincobr_sound_read_port); - ZetClose(); - - tms32010_init(); - tms32010_set_write_port_handler(dsp_write); - tms32010_set_read_port_handler(dsp_read); - tms32010_ram = (UINT16*)DrvMCURAM; - tms32010_rom = (UINT16*)DrvMCUROM; - - BurnYM3812Init(1, 3500000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3500000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM3812Exit(); - - ZetExit(); - SekExit(); - tms32010_exit(); - - BurnFree (AllMem); - - golfwar = 0; - - return 0; -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 0xe00; i+=2) { - INT32 p = *((UINT16*)(DrvPalRAM + i)); - - INT32 r = (p >> 0) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i/2] = BurnHighCol(r,g,b,0); - } -} - -static void draw_layer(INT32 layer, INT32 rambank, INT32 rombank) -{ - UINT16 *ram[3] = { (UINT16*)DrvTxRAM, (UINT16*)DrvBgRAM, (UINT16*)DrvFgRAM }; - UINT8 *gfx[3] = { DrvGfxROM0, DrvGfxROM2, DrvGfxROM1 }; - INT32 colbank[3] = { 0x600, 0x400, 0x500 }; - INT32 colshift[3] = { 11, 12, 12 }; - INT32 depth = colshift[layer] - 8; - - INT32 transp = (layer & 1) ? 0xff : 0; - - INT32 height = (layer ? 64 : 32) * 8; - - INT32 xscroll = (scrollx[layer] + 55 ) & 0x1ff; - INT32 yscroll = (scrolly[layer] + 30) & (height - 1); - - for (INT32 offs = 0; offs < 64 * (height/8); offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= xscroll; - if (sx < -7) sx += 512; - sy -= yscroll; - if (sy < -7) sy += height; - - INT32 attr = ram[layer][offs + (rambank/2)]; - INT32 color = attr >> colshift[layer]; - INT32 code = (attr & ((1 << colshift[layer])-1)) + rombank; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, depth, transp, colbank[layer], gfx[layer]); - } -} - -static void predraw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprBuf; - - INT32 xoffs = 31; - INT32 xoffs_flipped = 14; - - memset (pTempDraw, 0, nScreenWidth * nScreenHeight * sizeof(short)); - - for (INT32 offs = 0; offs < 0x1000/2; offs += 4) - { - INT32 attr = ram[offs + 1]; - INT32 prio = (attr >> 10) & 3; - if (prio == 0) continue; - - INT32 sy = ram[offs + 3] >> 7; - - if (sy != 0x0100) - { - INT32 code = ram[offs] & 0x7ff; - INT32 color = (attr & 0x3f) | ((attr >> 4) & 0xc0); - - INT32 sx = ram[offs + 2] >> 7; - INT32 flipx = attr & 0x100; - if (flipx) sx -= xoffs_flipped; - - INT32 flipy = attr & 0x200; - - sx -= xoffs; - sy -= 16; - - if (flipx) { - if (flipy) { - Render16x16Tile_Mask_FlipXY_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipX_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3); - } - } else { - if (flipy) { - Render16x16Tile_Mask_FlipY_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3); - } - } - } - } -} - -static void draw_sprites(INT32 priority) -{ - priority <<= 10; - - for (INT32 y = 0;y < nScreenHeight; y++) - { - UINT16* src = pTempDraw + y * nScreenWidth; - UINT16* dst = pTransDraw + y * nScreenWidth; - - for (INT32 x = 0;x < nScreenWidth; x++) - { - UINT16 pix = src[x]; - - if (pix & 0xf) - { - if ((pix & 0xc00) == priority) - { - dst[x] = pix & 0x3ff; - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (displayenable) - { - predraw_sprites(); - - if (nBurnLayer & 1) draw_layer(1, bgrambank, 0); - if (nSpriteEnable & 1) draw_sprites(1); - if (nBurnLayer & 2) draw_layer(2, 0, fgrombank); - if (nSpriteEnable & 2) draw_sprites(2); - if (nBurnLayer & 4) draw_layer(0, 0, 0); - if (nSpriteEnable & 4) draw_sprites(3); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - SekNewFrame(); - ZetNewFrame(); - - { - memset (DrvInputs, 0, 4); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; - } - } - - INT32 nInterleave = 286; - INT32 nCyclesTotal[3] = { (INT32)(double)(7000000 / 54.877858), (INT32)(double)(3500000 / 54.877858), (INT32)(double)(14000000 / 54.877858) }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - SekOpen(0); - ZetOpen(0); - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - if (m68k_halt) { - nCyclesDone[0] += nSegment; - SekIdle(nSegment); - } else { - nCyclesDone[0] += SekRun(nSegment); - - if (i == 240 && irq_enable) { - irq_enable = 0; - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - if (dsp_on) tms32010_execute(nCyclesTotal[2] / nInterleave); - - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - - if (i == 240) { - if (pBurnDraw) { - DrvDraw(); - } - vblank = 1; - } - } - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - SekClose(); - - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) - { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) - { - SekScan(nAction); - ZetScan(nAction); - tms32010_scan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - SCAN_VAR(m68k_halt); - SCAN_VAR(irq_enable); - SCAN_VAR(flipscreen); - SCAN_VAR(bgrambank); - SCAN_VAR(fgrombank); - SCAN_VAR(displayenable); - SCAN_VAR(main_ram_seg); - SCAN_VAR(dsp_addr_w); - SCAN_VAR(dsp_execute); - SCAN_VAR(dsp_BIO); - SCAN_VAR(dsp_on); - SCAN_VAR(scrollx); - SCAN_VAR(scrolly); - SCAN_VAR(vidramoffs); - - SCAN_VAR(fsharkbt_8741); - } - - return 0; -} - - -// Twin Cobra (World) - -static struct BurnRomInfo twincobrRomDesc[] = { - { "b30_01.7j", 0x10000, 0x07f64d13, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "b30_03.7h", 0x10000, 0x41be6978, 1 | BRF_PRG | BRF_ESS }, // 1 - { "b30_26_ii.8j", 0x08000, 0x3a646618, 1 | BRF_PRG | BRF_ESS }, // 2 - { "b30_27_ii.8h", 0x08000, 0xd7d1e317, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "b30_05_ii.4f", 0x08000, 0xe37b3c44, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "dsp_22.bin", 0x00800, 0x79389a71, 3 | BRF_PRG | BRF_ESS }, // 5 TMS32010 code - { "dsp_21.bin", 0x00800, 0x2d135376, 3 | BRF_PRG | BRF_ESS }, // 6 - - { "b30_08.8c", 0x04000, 0x0a254133, 4 | BRF_GRA }, // 7 Text characters - { "b30_07.10b", 0x04000, 0xe9e2d4b1, 4 | BRF_GRA }, // 8 - { "b30_06.8b", 0x04000, 0xa599d845, 4 | BRF_GRA }, // 9 - - { "b30_16.20b", 0x10000, 0x15b3991d, 5 | BRF_GRA }, // 10 Background tiles - { "b30_15.18b", 0x10000, 0xd9e2e55d, 5 | BRF_GRA }, // 11 - { "b30_13.18c", 0x10000, 0x13daeac8, 5 | BRF_GRA }, // 12 - { "b30_14.20c", 0x10000, 0x8cc79357, 5 | BRF_GRA }, // 13 - - { "b30_12.16c", 0x08000, 0xb5d48389, 6 | BRF_GRA }, // 14 Foreground tiles - { "b30_11.14c", 0x08000, 0x97f20fdc, 6 | BRF_GRA }, // 15 - { "b30_10.12c", 0x08000, 0x170c01db, 6 | BRF_GRA }, // 16 - { "b30_09.10c", 0x08000, 0x44f5accd, 6 | BRF_GRA }, // 17 - - { "b30_20.12d", 0x10000, 0xcb4092b8, 7 | BRF_GRA }, // 18 Sprites - { "b30_19.14d", 0x10000, 0x9cb8675e, 7 | BRF_GRA }, // 19 - { "b30_18.15d", 0x10000, 0x806fb374, 7 | BRF_GRA }, // 20 - { "b30_17.16d", 0x10000, 0x4264bff8, 7 | BRF_GRA }, // 21 - - { "82s129.d3", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 22 Proms (not used) - { "82s129.d4", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 23 - { "82s123.d2", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 24 - { "82s123.e18", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 25 - { "82s123.b24", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(twincobr) -STD_ROM_FN(twincobr) - -static INT32 twincobrInit() -{ - return DrvInit(0); -} - -struct BurnDriver BurnDrvTwincobr = { - "twincobr", NULL, NULL, NULL, "1987", - "Twin Cobra (World)\0", NULL, "Toaplan / Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, twincobrRomInfo, twincobrRomName, NULL, NULL, TwincobrInputInfo, TwincobrDIPInfo, - twincobrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Twin Cobra (US) - -static struct BurnRomInfo twincobruRomDesc[] = { - { "b30_01.7j", 0x10000, 0x07f64d13, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "b30_03.7h", 0x10000, 0x41be6978, 1 | BRF_PRG | BRF_ESS }, // 1 - { "b30_26_i.8j", 0x08000, 0xbdd00ba4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "b30_27_i.8h", 0x08000, 0xed600907, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "b30_05.4f", 0x08000, 0x1a8f1e10, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "dsp_22.bin", 0x00800, 0x79389a71, 3 | BRF_PRG | BRF_ESS }, // 5 TMS32010 code - { "dsp_21.bin", 0x00800, 0x2d135376, 3 | BRF_PRG | BRF_ESS }, // 6 - - { "b30_08.8c", 0x04000, 0x0a254133, 4 | BRF_GRA }, // 7 Text characters - { "b30_07.10b", 0x04000, 0xe9e2d4b1, 4 | BRF_GRA }, // 8 - { "b30_06.8b", 0x04000, 0xa599d845, 4 | BRF_GRA }, // 9 - - { "b30_16.20b", 0x10000, 0x15b3991d, 5 | BRF_GRA }, // 10 Background tiles - { "b30_15.18b", 0x10000, 0xd9e2e55d, 5 | BRF_GRA }, // 11 - { "b30_13.18c", 0x10000, 0x13daeac8, 5 | BRF_GRA }, // 12 - { "b30_14.20c", 0x10000, 0x8cc79357, 5 | BRF_GRA }, // 13 - - { "b30_12.16c", 0x08000, 0xb5d48389, 6 | BRF_GRA }, // 14 Foreground tiles - { "b30_11.14c", 0x08000, 0x97f20fdc, 6 | BRF_GRA }, // 15 - { "b30_10.12c", 0x08000, 0x170c01db, 6 | BRF_GRA }, // 16 - { "b30_09.10c", 0x08000, 0x44f5accd, 6 | BRF_GRA }, // 17 - - { "b30_20.12d", 0x10000, 0xcb4092b8, 7 | BRF_GRA }, // 18 Sprites - { "b30_19.14d", 0x10000, 0x9cb8675e, 7 | BRF_GRA }, // 19 - { "b30_18.15d", 0x10000, 0x806fb374, 7 | BRF_GRA }, // 20 - { "b30_17.16d", 0x10000, 0x4264bff8, 7 | BRF_GRA }, // 21 - - { "82s129.d3", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 22 Proms (not used) - { "82s129.d4", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 23 - { "82s123.d2", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 24 - { "82s123.e18", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 25 - { "82s123.b24", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(twincobru) -STD_ROM_FN(twincobru) - -struct BurnDriver BurnDrvTwincobru = { - "twincobru", "twincobr", NULL, NULL, "1987", - "Twin Cobra (US)\0", NULL, "Toaplan / Taito America Corporation (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, twincobruRomInfo, twincobruRomName, NULL, NULL, TwincobrInputInfo, TwincobruDIPInfo, - twincobrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Kyukyoku Tiger (Japan) - -static struct BurnRomInfo ktigerRomDesc[] = { - { "b30_01.7j", 0x10000, 0x07f64d13, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "b30_03.7h", 0x10000, 0x41be6978, 1 | BRF_PRG | BRF_ESS }, // 1 - { "b30_02.8j", 0x08000, 0x1d63e9c4, 1 | BRF_PRG | BRF_ESS }, // 2 - { "b30_04.8h", 0x08000, 0x03957a30, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "b30_05.4f", 0x08000, 0x1a8f1e10, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 code - - { "dsp-22", 0x00800, 0x8a1d48d9, 3 | BRF_PRG | BRF_ESS }, // 5 TMS32010 code - { "dsp-21", 0x00800, 0x33d99bc2, 3 | BRF_PRG | BRF_ESS }, // 6 - - { "b30_08.8c", 0x04000, 0x0a254133, 4 | BRF_GRA }, // 7 Text characters - { "b30_07.10b", 0x04000, 0xe9e2d4b1, 4 | BRF_GRA }, // 8 - { "b30_06.8b", 0x04000, 0xa599d845, 4 | BRF_GRA }, // 9 - - { "b30_16.20b", 0x10000, 0x15b3991d, 5 | BRF_GRA }, // 10 Background tiles - { "b30_15.18b", 0x10000, 0xd9e2e55d, 5 | BRF_GRA }, // 11 - { "b30_13.18c", 0x10000, 0x13daeac8, 5 | BRF_GRA }, // 12 - { "b30_14.20c", 0x10000, 0x8cc79357, 5 | BRF_GRA }, // 13 - - { "b30_12.16c", 0x08000, 0xb5d48389, 6 | BRF_GRA }, // 14 Foreground tiles - { "b30_11.14c", 0x08000, 0x97f20fdc, 6 | BRF_GRA }, // 15 - { "b30_10.12c", 0x08000, 0x170c01db, 6 | BRF_GRA }, // 16 - { "b30_09.10c", 0x08000, 0x44f5accd, 6 | BRF_GRA }, // 17 - - { "b30_20.12d", 0x10000, 0xcb4092b8, 7 | BRF_GRA }, // 18 Sprites - { "b30_19.14d", 0x10000, 0x9cb8675e, 7 | BRF_GRA }, // 19 - { "b30_18.15d", 0x10000, 0x806fb374, 7 | BRF_GRA }, // 20 - { "b30_17.16d", 0x10000, 0x4264bff8, 7 | BRF_GRA }, // 21 - - { "82s129.d3", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 22 Proms (not used) - { "82s129.d4", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 23 - { "82s123.d2", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 24 - { "82s123.e18", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 25 - { "82s123.b24", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 26 -}; - -STD_ROM_PICK(ktiger) -STD_ROM_FN(ktiger) - -struct BurnDriver BurnDrvKtiger = { - "ktiger", "twincobr", NULL, NULL, "1987", - "Kyukyoku Tiger (Japan)\0", NULL, "Toaplan / Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, ktigerRomInfo, ktigerRomName, NULL, NULL, TwincobrInputInfo, KtigerDIPInfo, - twincobrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Flying Shark (World) - -static struct BurnRomInfo fsharkRomDesc[] = { - { "b02_18-1.m8", 0x10000, 0x04739e02, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "b02_17-1.p8", 0x10000, 0xfd6ef7a8, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b02_16.l5", 0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "82s137-1.mcu", 0x00400, 0xcc5b3f53, 3 | BRF_PRG | BRF_ESS }, // 3 TMS32010 code - { "82s137-2.mcu", 0x00400, 0x47351d55, 3 | BRF_PRG | BRF_ESS }, // 4 - { "82s137-3.mcu", 0x00400, 0x70b537b9, 3 | BRF_PRG | BRF_ESS }, // 5 - { "82s137-4.mcu", 0x00400, 0x6edb2de8, 3 | BRF_PRG | BRF_ESS }, // 6 - { "82s137-5.mcu", 0x00400, 0xf35b978a, 3 | BRF_PRG | BRF_ESS }, // 7 - { "82s137-6.mcu", 0x00400, 0x0459e51b, 3 | BRF_PRG | BRF_ESS }, // 8 - { "82s137-7.mcu", 0x00400, 0xcbf3184b, 3 | BRF_PRG | BRF_ESS }, // 9 - { "82s137-8.mcu", 0x00400, 0x8246a05c, 3 | BRF_PRG | BRF_ESS }, // 10 - - { "b02_07-1.h11", 0x04000, 0xe669f80e, 4 | BRF_GRA }, // 11 Text characters - { "b02_06-1.h10", 0x04000, 0x5e53ae47, 4 | BRF_GRA }, // 12 - { "b02_05-1.h8", 0x04000, 0xa8b05bd0, 4 | BRF_GRA }, // 13 - - { "b02_12.h20", 0x08000, 0x733b9997, 5 | BRF_GRA }, // 14 Background tiles - { "b02_15.h24", 0x08000, 0x8b70ef32, 5 | BRF_GRA }, // 15 - { "b02_14.h23", 0x08000, 0xf711ba7d, 5 | BRF_GRA }, // 16 - { "b02_13.h21", 0x08000, 0x62532cd3, 5 | BRF_GRA }, // 17 - - { "b02_08.h13", 0x08000, 0xef0cf49c, 6 | BRF_GRA }, // 18 Foreground tiles - { "b02_11.h18", 0x08000, 0xf5799422, 6 | BRF_GRA }, // 19 - { "b02_10.h16", 0x08000, 0x4bd099ff, 6 | BRF_GRA }, // 20 - { "b02_09.h15", 0x08000, 0x230f1582, 6 | BRF_GRA }, // 21 - - { "b02_01.d15", 0x10000, 0x2234b424, 7 | BRF_GRA }, // 22 Sprites - { "b02_02.d16", 0x10000, 0x30d4c9a8, 7 | BRF_GRA }, // 23 - { "b02_03.d17", 0x10000, 0x64f3d88f, 7 | BRF_GRA }, // 24 - { "b02_04.d20", 0x10000, 0x3b23a9fc, 7 | BRF_GRA }, // 25 - - { "b02-20.b4", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 26 Proms (not used) - { "b02-21.b5", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 27 - { "b02-19.b2", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 28 - { "b02-22.c21", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 29 - { "b02-23.f28", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 30 -}; - -STD_ROM_PICK(fshark) -STD_ROM_FN(fshark) - -static INT32 fsharkInit() -{ - return DrvInit(1); -} - -struct BurnDriver BurnDrvFshark = { - "fshark", NULL, NULL, NULL, "1987", - "Flying Shark (World)\0", NULL, "Toaplan / Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, fsharkRomInfo, fsharkRomName, NULL, NULL, FsharkInputInfo, FsharkDIPInfo, - fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Sky Shark (US, set 1) - -static struct BurnRomInfo skysharkRomDesc[] = { - { "b02_18-2.m8", 0x10000, 0x888e90f3, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "b02_17-2.p8", 0x10000, 0x066d67be, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b02_16.l5", 0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "82s137-1.mcu", 0x00400, 0xcc5b3f53, 3 | BRF_PRG | BRF_ESS }, // 3 TMS32010 code - { "82s137-2.mcu", 0x00400, 0x47351d55, 3 | BRF_PRG | BRF_ESS }, // 4 - { "82s137-3.mcu", 0x00400, 0x70b537b9, 3 | BRF_PRG | BRF_ESS }, // 5 - { "82s137-4.mcu", 0x00400, 0x6edb2de8, 3 | BRF_PRG | BRF_ESS }, // 6 - { "82s137-5.mcu", 0x00400, 0xf35b978a, 3 | BRF_PRG | BRF_ESS }, // 7 - { "82s137-6.mcu", 0x00400, 0x0459e51b, 3 | BRF_PRG | BRF_ESS }, // 8 - { "82s137-7.mcu", 0x00400, 0xcbf3184b, 3 | BRF_PRG | BRF_ESS }, // 9 - { "82s137-8.mcu", 0x00400, 0x8246a05c, 3 | BRF_PRG | BRF_ESS }, // 10 - - { "b02_7-2.h11", 0x04000, 0xaf48c4e6, 4 | BRF_GRA }, // 11 Text characters - { "b02_6-2.h10", 0x04000, 0x9a29a862, 4 | BRF_GRA }, // 12 - { "b02_5-2.h8", 0x04000, 0xfb7cad55, 4 | BRF_GRA }, // 13 - - { "b02_12.h20", 0x08000, 0x733b9997, 5 | BRF_GRA }, // 14 Background tiles - { "b02_15.h24", 0x08000, 0x8b70ef32, 5 | BRF_GRA }, // 15 - { "b02_14.h23", 0x08000, 0xf711ba7d, 5 | BRF_GRA }, // 16 - { "b02_13.h21", 0x08000, 0x62532cd3, 5 | BRF_GRA }, // 17 - - { "b02_08.h13", 0x08000, 0xef0cf49c, 6 | BRF_GRA }, // 18 Foreground tiles - { "b02_11.h18", 0x08000, 0xf5799422, 6 | BRF_GRA }, // 19 - { "b02_10.h16", 0x08000, 0x4bd099ff, 6 | BRF_GRA }, // 20 - { "b02_09.h15", 0x08000, 0x230f1582, 6 | BRF_GRA }, // 21 - - { "b02_01.d15", 0x10000, 0x2234b424, 7 | BRF_GRA }, // 22 Sprites - { "b02_02.d16", 0x10000, 0x30d4c9a8, 7 | BRF_GRA }, // 23 - { "b02_03.d17", 0x10000, 0x64f3d88f, 7 | BRF_GRA }, // 24 - { "b02_04.d20", 0x10000, 0x3b23a9fc, 7 | BRF_GRA }, // 25 - - { "b02-20.b4", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 26 Proms (not used) - { "b02-21.b5", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 27 - { "b02-19.b2", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 28 - { "b02-22.c21", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 29 - { "b02-23.f28", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 30 -}; - -STD_ROM_PICK(skyshark) -STD_ROM_FN(skyshark) - -struct BurnDriver BurnDrvSkyshark = { - "skyshark", "fshark", NULL, NULL, "1987", - "Sky Shark (US, set 1)\0", NULL, "Toaplan / Taito America Corporation (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, skysharkRomInfo, skysharkRomName, NULL, NULL, FsharkInputInfo, SkysharkDIPInfo, - fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Sky Shark (US, set 2) - -static struct BurnRomInfo skysharkaRomDesc[] = { - { "b02_18-2.m8", 0x10000, 0x341deaac, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "b02_17-2.p8", 0x10000, 0xec3b5a2c, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b02_16.l5", 0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "82s137-1.mcu", 0x00400, 0xcc5b3f53, 3 | BRF_PRG | BRF_ESS }, // 3 TMS32010 code - { "82s137-2.mcu", 0x00400, 0x47351d55, 3 | BRF_PRG | BRF_ESS }, // 4 - { "82s137-3.mcu", 0x00400, 0x70b537b9, 3 | BRF_PRG | BRF_ESS }, // 5 - { "82s137-4.mcu", 0x00400, 0x6edb2de8, 3 | BRF_PRG | BRF_ESS }, // 6 - { "82s137-5.mcu", 0x00400, 0xf35b978a, 3 | BRF_PRG | BRF_ESS }, // 7 - { "82s137-6.mcu", 0x00400, 0x0459e51b, 3 | BRF_PRG | BRF_ESS }, // 8 - { "82s137-7.mcu", 0x00400, 0xcbf3184b, 3 | BRF_PRG | BRF_ESS }, // 9 - { "82s137-8.mcu", 0x00400, 0x8246a05c, 3 | BRF_PRG | BRF_ESS }, // 10 - - { "b02_7-2.h11", 0x04000, 0xaf48c4e6, 4 | BRF_GRA }, // 11 Text characters - { "b02_6-2.h10", 0x04000, 0x9a29a862, 4 | BRF_GRA }, // 12 - { "b02_5-2.h8", 0x04000, 0xfb7cad55, 4 | BRF_GRA }, // 13 - - { "b02_12.h20", 0x08000, 0x733b9997, 5 | BRF_GRA }, // 14 Background tiles - { "b02_15.h24", 0x08000, 0x8b70ef32, 5 | BRF_GRA }, // 15 - { "b02_14.h23", 0x08000, 0xf711ba7d, 5 | BRF_GRA }, // 16 - { "b02_13.h21", 0x08000, 0x62532cd3, 5 | BRF_GRA }, // 17 - - { "b02_08.h13", 0x08000, 0xef0cf49c, 6 | BRF_GRA }, // 18 Foreground tiles - { "b02_11.h18", 0x08000, 0xf5799422, 6 | BRF_GRA }, // 19 - { "b02_10.h16", 0x08000, 0x4bd099ff, 6 | BRF_GRA }, // 20 - { "b02_09.h15", 0x08000, 0x230f1582, 6 | BRF_GRA }, // 21 - - { "b02_01.d15", 0x10000, 0x2234b424, 7 | BRF_GRA }, // 22 Sprites - { "b02_02.d16", 0x10000, 0x30d4c9a8, 7 | BRF_GRA }, // 23 - { "b02_03.d17", 0x10000, 0x64f3d88f, 7 | BRF_GRA }, // 24 - { "b02_04.d20", 0x10000, 0x3b23a9fc, 7 | BRF_GRA }, // 25 - - { "b02-20.b4", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 26 Proms (not used) - { "b02-21.b5", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 27 - { "b02-19.b2", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 28 - { "b02-22.c21", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 29 - { "b02-23.f28", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 30 -}; - -STD_ROM_PICK(skysharka) -STD_ROM_FN(skysharka) - -struct BurnDriver BurnDrvSkysharka = { - "skysharka", "fshark", NULL, NULL, "1987", - "Sky Shark (US, set 2)\0", NULL, "Toaplan / Taito America Corporation (Romstar license)", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, skysharkaRomInfo, skysharkaRomName, NULL, NULL, FsharkInputInfo, SkysharkDIPInfo, - fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Hishou Zame (Japan) - -static struct BurnRomInfo hishouzaRomDesc[] = { - { "b02_18.m8", 0x10000, 0x4444bb94, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "b02_17.p8", 0x10000, 0xcdac7228, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b02_16.l5", 0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "dsp-a1.bpr", 0x00400, 0x45d4d1b1, 3 | BRF_PRG | BRF_ESS }, // 3 TMS32010 code - { "dsp-a2.bpr", 0x00400, 0xedd227fa, 3 | BRF_PRG | BRF_ESS }, // 4 - { "dsp-a3.bpr", 0x00400, 0xdf88e79b, 3 | BRF_PRG | BRF_ESS }, // 5 - { "dsp-a4.bpr", 0x00400, 0xa2094a7f, 3 | BRF_PRG | BRF_ESS }, // 6 - { "dsp-b5.bpr", 0x00400, 0x85ca5d47, 3 | BRF_PRG | BRF_ESS }, // 7 - { "dsp-b6.bpr", 0x00400, 0x81816b2c, 3 | BRF_PRG | BRF_ESS }, // 8 - { "dsp-b7.bpr", 0x00400, 0xe87540cd, 3 | BRF_PRG | BRF_ESS }, // 9 - { "dsp-b8.bpr", 0x00400, 0xd3c16c5c, 3 | BRF_PRG | BRF_ESS }, // 10 - - { "b02-07.h11", 0x04000, 0xc13a775e, 4 | BRF_GRA }, // 11 Text characters - { "b02-06.h10", 0x04000, 0xad5f1371, 4 | BRF_GRA }, // 12 - { "b02-05.h8", 0x04000, 0x85a7bff6, 4 | BRF_GRA }, // 13 - - { "b02_12.h20", 0x08000, 0x733b9997, 5 | BRF_GRA }, // 14 Background tiles - { "b02_15.h24", 0x08000, 0x8b70ef32, 5 | BRF_GRA }, // 15 - { "b02_14.h23", 0x08000, 0xf711ba7d, 5 | BRF_GRA }, // 16 - { "b02_13.h21", 0x08000, 0x62532cd3, 5 | BRF_GRA }, // 17 - - { "b02_08.h13", 0x08000, 0xef0cf49c, 6 | BRF_GRA }, // 18 Foreground tiles - { "b02_11.h18", 0x08000, 0xf5799422, 6 | BRF_GRA }, // 19 - { "b02_10.h16", 0x08000, 0x4bd099ff, 6 | BRF_GRA }, // 20 - { "b02_09.h15", 0x08000, 0x230f1582, 6 | BRF_GRA }, // 21 - - { "b02_01.d15", 0x10000, 0x2234b424, 7 | BRF_GRA }, // 22 Sprites - { "b02_02.d16", 0x10000, 0x30d4c9a8, 7 | BRF_GRA }, // 23 - { "b02_03.d17", 0x10000, 0x64f3d88f, 7 | BRF_GRA }, // 24 - { "b02_04.d20", 0x10000, 0x3b23a9fc, 7 | BRF_GRA }, // 25 - - { "b02-20.b4", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 26 Proms (not used) - { "b02-21.b5", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 27 - { "b02-19.b2", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 28 - { "b02-22.c21", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 29 - { "b02-23.f28", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 30 -}; - -STD_ROM_PICK(hishouza) -STD_ROM_FN(hishouza) - -struct BurnDriver BurnDrvHishouza = { - "hishouza", "fshark", NULL, NULL, "1987", - "Hishou Zame (Japan)\0", NULL, "Toaplan / Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, hishouzaRomInfo, hishouzaRomName, NULL, NULL, FsharkInputInfo, HishouzaDIPInfo, - fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Flying Shark (bootleg with 8741) - -static struct BurnRomInfo fsharkbtRomDesc[] = { - { "r18", 0x10000, 0xef30f563, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "r17", 0x10000, 0x0e18d25f, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "b02_16.l5", 0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "mcu-1.bpr", 0x00400, 0x45d4d1b1, 3 | BRF_PRG | BRF_ESS }, // 3 TMS32010 code - { "mcu-2.bpr", 0x00400, 0x651336d1, 3 | BRF_PRG | BRF_ESS }, // 4 - { "mcu-3.bpr", 0x00400, 0xdf88e79b, 3 | BRF_PRG | BRF_ESS }, // 5 - { "mcu-4.bpr", 0x00400, 0xa2094a7f, 3 | BRF_PRG | BRF_ESS }, // 6 - { "mcu-5.bpr", 0x00400, 0xf97a58da, 3 | BRF_PRG | BRF_ESS }, // 7 - { "mcu-6.bpr", 0x00400, 0xffcc422d, 3 | BRF_PRG | BRF_ESS }, // 8 - { "mcu-7.bpr", 0x00400, 0x0cd30d49, 3 | BRF_PRG | BRF_ESS }, // 9 - { "mcu-8.bpr", 0x00400, 0x3379bbff, 3 | BRF_PRG | BRF_ESS }, // 10 - - { "b02_07-1.h11", 0x04000, 0xe669f80e, 4 | BRF_GRA }, // 11 Text characters - { "b02_06-1.h10", 0x04000, 0x5e53ae47, 4 | BRF_GRA }, // 12 - { "b02_05-1.h8", 0x04000, 0xa8b05bd0, 4 | BRF_GRA }, // 13 - - { "b02_12.h20", 0x08000, 0x733b9997, 5 | BRF_GRA }, // 14 Background tiles - { "b02_15.h24", 0x08000, 0x8b70ef32, 5 | BRF_GRA }, // 15 - { "b02_14.h23", 0x08000, 0xf711ba7d, 5 | BRF_GRA }, // 16 - { "b02_13.h21", 0x08000, 0x62532cd3, 5 | BRF_GRA }, // 17 - - { "b02_08.h13", 0x08000, 0xef0cf49c, 6 | BRF_GRA }, // 18 Foreground tiles - { "b02_11.h18", 0x08000, 0xf5799422, 6 | BRF_GRA }, // 19 - { "b02_10.h16", 0x08000, 0x4bd099ff, 6 | BRF_GRA }, // 20 - { "b02_09.h15", 0x08000, 0x230f1582, 6 | BRF_GRA }, // 21 - - { "b02_01.d15", 0x10000, 0x2234b424, 7 | BRF_GRA }, // 22 Sprites - { "b02_02.d16", 0x10000, 0x30d4c9a8, 7 | BRF_GRA }, // 23 - { "b02_03.d17", 0x10000, 0x64f3d88f, 7 | BRF_GRA }, // 24 - { "b02_04.d20", 0x10000, 0x3b23a9fc, 7 | BRF_GRA }, // 25 - - { "clr2.bpr", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 26 Proms (not used) - { "clr1.bpr", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 27 - { "clr3.bpr", 0x00100, 0x016fe2f7, 0 | BRF_OPT }, // 28 - - { "fsb_8741.mcu", 0x00400, 0x00000000, 9 | BRF_NODUMP | BRF_OPT},// 29 MCU -}; - -STD_ROM_PICK(fsharkbt) -STD_ROM_FN(fsharkbt) - -struct BurnDriver BurnDrvFsharkbt = { - "fsharkbt", "fshark", NULL, NULL, "1987", - "Flying Shark (bootleg with 8741)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, fsharkbtRomInfo, fsharkbtRomName, NULL, NULL, FsharkInputInfo, SkysharkDIPInfo, - fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Flyin' Shark (bootleg of Hishou Zame) - -static struct BurnRomInfo fnsharkRomDesc[] = { - { "h.ic226", 0x10000, 0xea4bcb43, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "g.ic202", 0x10000, 0xd1f39ed2, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "f.ic170", 0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "82s191_r.bin", 0x00800, 0x5b96ae3f, 7 | BRF_PRG | BRF_ESS }, // 3 TMS32010 code - { "82s191_l.bin", 0x00800, 0xd5dfc8dd, 7 | BRF_PRG | BRF_ESS }, // 4 - - { "7.ic119", 0x04000, 0xa0f8890d, 3 | BRF_GRA }, // 5 Text characters - { "6.ic120", 0x04000, 0xc5bfca95, 3 | BRF_GRA }, // 6 - { "5.ic121", 0x04000, 0xb8c370bc, 3 | BRF_GRA }, // 7 - - { "b.ic114", 0x08000, 0x733b9997, 4 | BRF_GRA }, // 8 Background tiles - { "e.ic111", 0x08000, 0x8b70ef32, 4 | BRF_GRA }, // 9 - { "d.ic112", 0x08000, 0xf711ba7d, 4 | BRF_GRA }, // 10 - { "c.ic113", 0x08000, 0x62532cd3, 4 | BRF_GRA }, // 11 - - { "8.ic118", 0x08000, 0xef0cf49c, 5 | BRF_GRA }, // 12 Foreground tiles - { "a.ic115", 0x08000, 0xf5799422, 5 | BRF_GRA }, // 13 - { "10.ic116", 0x08000, 0x4bd099ff, 5 | BRF_GRA }, // 14 - { "9.ic117", 0x08000, 0x230f1582, 5 | BRF_GRA }, // 15 - - { "1.ic54", 0x10000, 0x2234b424, 6 | BRF_GRA }, // 16 Sprites - { "2.ic53", 0x10000, 0x30d4c9a8, 6 | BRF_GRA }, // 17 - { "3.ic52", 0x10000, 0x64f3d88f, 6 | BRF_GRA }, // 18 - { "4.ic51", 0x10000, 0x3b23a9fc, 6 | BRF_GRA }, // 19 - - { "82s129.ic41", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 20 Proms (not used) - { "82s129.ic40", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 21 - { "82s123.ic42", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 22 - { "82s123.ic50", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 23 - { "82s123.ic99", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(fnshark) -STD_ROM_FN(fnshark) - -static INT32 bootInit() -{ - return DrvInit(3); -} - -struct BurnDriver BurnDrvFnshark = { - "fnshark", "fshark", NULL, NULL, "1987", - "Flyin' Shark (bootleg of Hishou Zame)\0", NULL, "bootleg", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, fnsharkRomInfo, fnsharkRomName, NULL, NULL, FsharkInputInfo, HishouzaDIPInfo, - bootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Gulf War II (set 1) - -static struct BurnRomInfo gulfwar2RomDesc[] = { - { "08-u119.bin", 0x20000, 0x41ebf9c0, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "07-u92.bin", 0x20000, 0xb73e6b25, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "06-u51.bin", 0x08000, 0x75504f95, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "02-u1.rom", 0x02000, 0xabefe4ca, 3 | BRF_PRG | BRF_ESS }, // 3 TMS32010 code - { "01-u2.rom", 0x02000, 0x01399b65, 3 | BRF_PRG | BRF_ESS }, // 4 - - { "03-u9.bin", 0x04000, 0x1b7934b3, 4 | BRF_GRA }, // 5 Text characters - { "04-u10.bin", 0x04000, 0x6f7bfb58, 4 | BRF_GRA }, // 6 - { "05-u11.bin", 0x04000, 0x31814724, 4 | BRF_GRA }, // 7 - - { "16-u202.bin", 0x10000, 0xd815d175, 5 | BRF_GRA }, // 8 Background tiles - { "13-u199.bin", 0x10000, 0xd949b0d9, 5 | BRF_GRA }, // 9 - { "14-u200.bin", 0x10000, 0xc109a6ac, 5 | BRF_GRA }, // 10 - { "15-u201.bin", 0x10000, 0xad21f2ab, 5 | BRF_GRA }, // 11 - - { "09-u195.bin", 0x08000, 0xb7be3a6d, 6 | BRF_GRA }, // 12 Foreground tiles - { "12-u198.bin", 0x08000, 0xfd7032a6, 6 | BRF_GRA }, // 13 - { "11-u197.bin", 0x08000, 0x7b721ed3, 6 | BRF_GRA }, // 14 - { "10-u196.rom", 0x08000, 0x160f38ab, 6 | BRF_GRA }, // 15 - - { "20-u262.bin", 0x10000, 0x10665ca0, 7 | BRF_GRA }, // 16 Sprites - { "19-u261.bin", 0x10000, 0xcfa6d417, 7 | BRF_GRA }, // 17 - { "18-u260.bin", 0x10000, 0x2e6a0c49, 7 | BRF_GRA }, // 18 - { "17-u259.bin", 0x10000, 0x66c1b0e6, 7 | BRF_GRA }, // 19 - - { "82s129.d3", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 20 Proms (not used) - { "82s129.d4", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 21 - { "82s123.d2", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 22 - { "82s123.e18", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 23 - { "82s123.b24", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(gulfwar2) -STD_ROM_FN(gulfwar2) - -static INT32 gulfwar2Init() -{ - return DrvInit(2); -} - -struct BurnDriver BurnDrvGulfwar2 = { - "gulfwar2", NULL, NULL, NULL, "1991", - "Gulf War II (set 1)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, gulfwar2RomInfo, gulfwar2RomName, NULL, NULL, TwincobrInputInfo, TwincobrDIPInfo, - gulfwar2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; - - -// Gulf War II (set 2) - -static struct BurnRomInfo gulfwar2aRomDesc[] = { - { "gw2_28.u119", 0x20000, 0xb9118660, 1 | BRF_PRG | BRF_ESS }, // 0 68k code - { "gw2_27.u92", 0x20000, 0x3494f1aa, 1 | BRF_PRG | BRF_ESS }, // 1 - - { "06-u51.bin", 0x08000, 0x75504f95, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 code - - { "gw2_22.udsp1", 0x01000, 0x3a97b0db, 3 | BRF_PRG | BRF_ESS }, // 3 TMS32010 code - { "gw2_21.udsp2", 0x01000, 0x87a473af, 3 | BRF_PRG | BRF_ESS }, // 4 - - { "gw2_23.u9", 0x08000, 0xa2aee4c8, 4 | BRF_GRA }, // 5 Text characters - { "gw2_24.u10", 0x08000, 0xfb3f71cd, 4 | BRF_GRA }, // 6 - { "gw2_25.u11", 0x08000, 0x90eeb0a0, 4 | BRF_GRA }, // 7 - - { "16-u202.bin", 0x10000, 0xd815d175, 5 | BRF_GRA }, // 8 Background tiles - { "13-u199.bin", 0x10000, 0xd949b0d9, 5 | BRF_GRA }, // 9 - { "14-u200.bin", 0x10000, 0xc109a6ac, 5 | BRF_GRA }, // 10 - { "15-u201.bin", 0x10000, 0xad21f2ab, 5 | BRF_GRA }, // 11 - - { "09-u195.bin", 0x08000, 0xb7be3a6d, 6 | BRF_GRA }, // 12 Foreground tiles - { "12-u198.bin", 0x08000, 0xfd7032a6, 6 | BRF_GRA }, // 13 - { "11-u197.bin", 0x08000, 0x7b721ed3, 6 | BRF_GRA }, // 14 - { "10-u196.rom", 0x08000, 0x160f38ab, 6 | BRF_GRA }, // 15 - - { "20-u262.bin", 0x10000, 0x10665ca0, 7 | BRF_GRA }, // 16 Sprites - { "19-u261.bin", 0x10000, 0xcfa6d417, 7 | BRF_GRA }, // 17 - { "18-u260.bin", 0x10000, 0x2e6a0c49, 7 | BRF_GRA }, // 18 - { "17-u259.bin", 0x10000, 0x66c1b0e6, 7 | BRF_GRA }, // 19 - - { "82s129.d3", 0x00100, 0x24e7d62f, 0 | BRF_OPT }, // 20 Proms (not used) - { "82s129.d4", 0x00100, 0xa50cef09, 0 | BRF_OPT }, // 21 - { "82s123.d2", 0x00020, 0xf72482db, 0 | BRF_OPT }, // 22 - { "82s123.e18", 0x00020, 0xbc88cced, 0 | BRF_OPT }, // 23 - { "82s123.b24", 0x00020, 0x4fb5df2a, 0 | BRF_OPT }, // 24 -}; - -STD_ROM_PICK(gulfwar2a) -STD_ROM_FN(gulfwar2a) - -struct BurnDriver BurnDrvGulfwar2a = { - "gulfwar2a", "gulfwar2", NULL, NULL, "1991", - "Gulf War II (set 2)\0", NULL, "Comad", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0, - NULL, gulfwar2aRomInfo, gulfwar2aRomName, NULL, NULL, TwincobrInputInfo, TwincobrDIPInfo, - gulfwar2Init, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x700, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_vfive.cpp b/jan/src/burn/drv/toaplan/d_vfive.cpp deleted file mode 100644 index 2da320d59..000000000 --- a/jan/src/burn/drv/toaplan/d_vfive.cpp +++ /dev/null @@ -1,688 +0,0 @@ -// FB Alpha V-Five & Grind Stormer driver module -// Driver and emulation by Jan Klaassen - -#include "toaplan.h" -#include "nec_intf.h" - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static INT32 v25_reset = 0; - -// Rom information -static struct BurnRomInfo vfiveRomDesc[] = { - { "tp027_01.bin", 0x080000, 0x731D50F4, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp027_02.bin", 0x100000, 0x877B45E8, BRF_GRA }, // 1 GP9001 Tile data - { "tp027_03.bin", 0x100000, 0xB1FC6362, BRF_GRA }, // 2 -}; - - -STD_ROM_PICK(vfive) -STD_ROM_FN(vfive) - -static struct BurnRomInfo grindstmRomDesc[] = { - { "01.bin", 0x080000, 0x4923F790, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp027_02.bin", 0x100000, 0x877B45E8, BRF_GRA }, // 1 GP9001 Tile data - { "tp027_03.bin", 0x100000, 0xB1FC6362, BRF_GRA }, // 2 -}; - - -STD_ROM_PICK(grindstm) -STD_ROM_FN(grindstm) - -static struct BurnRomInfo grindstaRomDesc[] = { - { "tp027-01.rom", 0x080000, 0x8D8C0392, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - - { "tp027_02.bin", 0x100000, 0x877B45E8, BRF_GRA }, // 1 GP9001 Tile data - { "tp027_03.bin", 0x100000, 0xB1FC6362, BRF_GRA }, // 2 -}; - - -STD_ROM_PICK(grindsta) -STD_ROM_FN(grindsta) - -static struct BurnInputInfo vfiveInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 4, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(vfive) - -static struct BurnDIPInfo vfiveDIPList[] = { - // Defaults - {0x14, 0xFF, 0xFF, 0x00, NULL}, - {0x15, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Cabinet"}, - {0x14, 0x01, 0x01, 0x00, "Upright"}, - {0x14, 0x01, 0x01, 0x01, "Table type"}, - {0, 0xFE, 0, 2, "Screen type"}, - {0x14, 0x01, 0x02, 0x00, "Normal screen"}, - {0x14, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x14, 0x01, 0x04, 0x00, "Normal mode"}, - {0x14, 0x01, 0x04, 0x04, "Test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x14, 0x01, 0x08, 0x00, "On"}, - {0x14, 0x01, 0x08, 0x08, "Off"}, - - // Normal coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x82, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0x30, 0x10, "1 coin 2 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0x30, 0x20, "2 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0x30, 0x30, "2 coins 3 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x82, 0xC0, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0xC0, 0x40, "1 coin 2 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0xC0, 0x80, "2 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x82, 0xC0, 0xC0, "2 coins 3 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - - // European coin settings - {0, 0xFE, 0, 4, "Coin A"}, - {0x14, 0x02, 0x30, 0x00, "1 coin 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0x30, 0x10, "2 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0x30, 0x20, "3 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0x30, 0x30, "3 coins 1 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x14, 0x02, 0xC0, 0x00, "1 coin 2 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0xC0, 0x40, "1 coin 3 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0xC0, 0x80, "1 coin 4 play"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - {0x14, 0x02, 0xC0, 0xC0, "1 coin 6 plays"}, - {0x16, 0x00, 0x0E, 0x08, NULL}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x15, 0x01, 0x03, 0x00, "B (normal)"}, - {0x15, 0x01, 0x03, 0x01, "A (easy)"}, - {0x15, 0x01, 0x03, 0x02, "C (hard)"}, - {0x15, 0x01, 0x03, 0x03, "D (very hard)"}, - {0, 0xFE, 0, 4, "Extend"}, - {0x15, 0x01, 0x0C, 0x00, "300,000pts 800,000pts"}, - {0x15, 0x01, 0x0C, 0x04, "300,000 800,000 every"}, - {0x15, 0x01, 0x0C, 0x08, "200,000pts only"}, - {0x15, 0x01, 0x0C, 0x0C, "No extend"}, - {0, 0xFE, 0, 4, "Hero counts"}, - {0x15, 0x01, 0x30, 0x00, "3"}, - {0x15, 0x01, 0x30, 0x01, "5"}, - {0x15, 0x01, 0x30, 0x02, "2"}, - {0x15, 0x01, 0x30, 0x03, "1"}, - {0, 0xFE, 0, 2, "Cheating"}, - {0x15, 0x01, 0x40, 0x00, "Normal game"}, - {0x15, 0x01, 0x40, 0x40, "No-death & stop mode"}, - {0, 0xFE, 0, 2, "Continue"}, - {0x15, 0x01, 0x80, 0x00, "On"}, - {0x15, 0x01, 0x80, 0x80, "Off"}, -}; - -static struct BurnDIPInfo grindstmRegionDIPList[] = { - - {0x16, 0xFF, 0x0F, 0x00, NULL}, - {0, 0xFE, 0, 11, "Region"}, - {0x16, 0x01, 0x0F, 0x00, "Korea (Unite Trading)"}, - {0x16, 0x01, 0x0F, 0x01, "Korea"}, - {0x16, 0x01, 0x0F, 0x02, "Hong Kong (Charterfield)"}, - {0x16, 0x01, 0x0F, 0x03, "Hong Kong"}, - {0x16, 0x01, 0x0F, 0x04, "Taiwan (Anamoto International inc.)"}, - {0x16, 0x01, 0x0F, 0x05, "Taiwan"}, - {0x16, 0x01, 0x0F, 0x06, "South East Asia (Charterfield)"}, - {0x16, 0x01, 0x0F, 0x07, "South East Asia"}, - {0x16, 0x01, 0x0F, 0x08, "Europe"}, - {0x16, 0x01, 0x0F, 0x0A, "U.S.A (American Sammy corp.)"}, - {0x16, 0x01, 0x0F, 0x0B, "U.S.A"}, - {0x16, 0x01, 0x0F, 0x09, "Europe"}, - {0x16, 0x01, 0x0F, 0x0C, "U.S.A (American Sammy corp.)"}, - {0x16, 0x01, 0x0F, 0x0D, "U.S.A"}, - {0x16, 0x01, 0x0F, 0x0E, "Korea"}, - {0x16, 0x01, 0x0F, 0x0F, "Korea"}, - -}; - -STDDIPINFO(vfive) -STDDIPINFOEXT(grindstm, vfive, grindstmRegion) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal; -static UINT8 *ShareRAM; - -static INT32 nColCount = 0x0800; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // - GP9001ROM[0]= Next; Next += nGP9001ROMSize[0]; // GP9001 tile data - RamStart = Next; - Ram01 = Next; Next += 0x004000; // CPU #0 work RAM - ShareRAM = Next; Next += 0x010000; - RamPal = Next; Next += 0x001000; // palette - GP9001RAM[0]= Next; Next += 0x004000; - GP9001Reg[0]= (UINT16*)Next; Next += 0x0100 * sizeof(UINT16); - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin) { // Return minimum compatible version - *pnMin = 0x020997; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd-RamStart; - ba.szName = "All Ram"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - VezScan(nAction); - BurnYM2151Scan(nAction); - - ToaScanGP9001(nAction, pnMin); - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - BurnLoadRom(Rom01, 0, 1); - - // Load GP9001 tile data - ToaLoadGP9001Tiles(GP9001ROM[0], 1, 2, nGP9001ROMSize[0]); - - return 0; -} - -UINT8 __fastcall vfiveReadByte(UINT32 sekAddress) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - return ShareRAM[(sekAddress / 2) & 0x7fff]; - } - - switch (sekAddress) - { - case 0x200011: // Player 1 inputs - return DrvInput[0]; - case 0x200015: // Player 2 inputs - return DrvInput[1]; - case 0x200019: // Other inputs - return DrvInput[2]; - - case 0x30000D: // VBlank - return ToaVBlankRegister(); - -// default: -// printf("Attempt to read byte value of location %x\n", sekAddress); - } - - return 0; -} - -UINT16 __fastcall vfiveReadWord(UINT32 sekAddress) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - return ShareRAM[(sekAddress / 2) & 0x7fff]; - } - - switch (sekAddress) - { - case 0x200010: // Player 1 inputs - return DrvInput[0]; - case 0x200014: // Player 2 inputs - return DrvInput[1]; - case 0x200018: // Other inputs - return DrvInput[2]; - - case 0x300004: - return ToaGP9001ReadRAM_Hi(0); - case 0x300006: - return ToaGP9001ReadRAM_Lo(0); - - case 0x30000C: - return ToaVBlankRegister(); - - case 0x700000: - return ToaScanlineRegister(); - -// default: -// printf("Attempt to read word value of location %x\n", sekAddress); - } - - return 0; -} - -void __fastcall vfiveWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ -//printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - - if ((sekAddress & 0xff0000) == 0x210000) { - ShareRAM[(sekAddress / 2) & 0x7fff] = byteValue; - return; - } - - switch (sekAddress) - { - case 0x20001c: - case 0x20001d: - if (!v25_reset && (~byteValue & 0x10)) VezReset(); - v25_reset = (~byteValue & 0x10); - break; - -// default: -// printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress); - } -} - -void __fastcall vfiveWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - if ((sekAddress & 0xff0000) == 0x210000) { - ShareRAM[(sekAddress / 2) & 0x7fff] = wordValue; - return; - } - - switch (sekAddress) - { - case 0x300000: // Set GP9001 VRAM address-pointer - ToaGP9001SetRAMPointer(wordValue); - break; - - case 0x300004: - ToaGP9001WriteRAM(wordValue, 0); - break; - case 0x300006: - ToaGP9001WriteRAM(wordValue, 0); - break; - - case 0x300008: - ToaGP9001SelectRegister(wordValue); - break; - - case 0x30000C: - ToaGP9001WriteRegister(wordValue); - break; - -// default: -// printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress); - } -} - -void __fastcall vfive_v25_write(UINT32 address, UINT8 data) -{ - switch (address) - { - case 0x00000: - BurnYM2151SelectRegister(data); - return; - - case 0x00001: - BurnYM2151WriteRegister(data); - return; - } -} - -UINT8 __fastcall vfive_v25_read(UINT32 address) -{ - switch (address) - { - case 0x00001: - return BurnYM2151ReadStatus(); - } - - return 0; -} - -UINT8 __fastcall vfive_v25_read_port(UINT32 port) -{ - switch (port) - { - case V25_PORT_PT: - return DrvInput[3]^0xff; - - case V25_PORT_P0: - return DrvInput[4]^0xff; - - case V25_PORT_P1: - return DrvInput[5]^0xff; - } - - return 0; -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - VezOpen(0); - VezReset(); - VezClose(); - - BurnYM2151Reset(); - - HiscoreReset(); - - v25_reset = 1; - - return 0; -} - -static UINT8 nitro_decryption_table[256] = { - 0x1b,0x56,0x75,0x88,0x8c,0x06,0x58,0x72, 0x83,0x86,0x36,0x1a,0x5f,0xd3,0x8c,0xe9, /* 00 */ - 0x22,0x0f,0x03,0x2a,0xeb,0x2a,0xf9,0x0f, 0xa4,0xbd,0x75,0xf3,0x4f,0x53,0x8e,0xfe, /* 10 */ - 0x87,0xe8,0xb1,0x8d,0x36,0xb5,0x43,0x73, 0x2a,0x5b,0xf9,0x02,0x24,0x8a,0x03,0x80, /* 20 */ - 0x86,0x8b,0xd1,0x3e,0x8d,0x3e,0x58,0xfb, 0xc3,0x79,0xbd,0xb7,0x8a,0xe8,0x0f,0x81, /* 30 */ - 0xb7,0xd0,0x8b,0xeb,0xff,0xb8,0x90,0x8b, 0x5e,0xa2,0x90,0x90,0xab,0xb4,0x80,0x59, /* 40 */ - 0x87,0x72,0xb5,0xbd,0xb0,0x88,0x50,0x0f, 0xfe,0xd2,0xc3,0x90,0x8a,0x90,0xf9,0x75, /* 50 */ - 0x1a,0xb3,0x74,0x0a,0x68,0x24,0xbb,0x90, 0x75,0x47,0xfe,0x2c,0xbe,0xc3,0x88,0xd2, /* 60 */ - 0x3e,0xc1,0x8c,0x33,0x0f,0x90,0x8b,0x90, 0xb9,0x1e,0xff,0xa2,0x3e,0x22,0xbe,0x57, /* 70 */ - 0x81,0x3a,0xf6,0x88,0xeb,0xb1,0x89,0x8a, 0x32,0x80,0x0f,0xb1,0x48,0xc3,0x68,0x72, /* 80 */ - 0x53,0x02,0xc0,0x02,0xe8,0xb4,0x74,0xbc, 0x90,0x58,0x0a,0xf3,0x75,0xc6,0x90,0xe8, /* 90 */ - 0x26,0x50,0xfc,0x8c,0x90,0xb1,0xc3,0xd1, 0xeb,0x83,0xa4,0xbf,0x26,0x4b,0x46,0xfe, /* a0 */ - 0xe2,0x89,0xb3,0x88,0x03,0x56,0x0f,0x38, 0xbb,0x0c,0x90,0x0f,0x07,0x8a,0x8a,0x33, /* b0 */ - 0xfe,0xf9,0xb1,0xa0,0x45,0x36,0x22,0x5e, 0x8a,0xbe,0xc6,0xea,0x3c,0xb2,0x1e,0xe8, /* c0 */ - 0x90,0xeb,0x55,0xf6,0x8a,0xb0,0x5d,0xc0, 0xbb,0x8d,0xf6,0xd0,0xd1,0x88,0x4d,0x90, /* d0 */ - 0x51,0x51,0x74,0xbd,0x32,0xd1,0x90,0xd2, 0x53,0xc7,0xab,0x36,0x50,0xe9,0x33,0xb3, /* e0 */ - 0x2e,0x05,0x88,0x59,0x74,0x74,0x22,0x8e, 0x8a,0x8a,0x36,0x08,0x0f,0x45,0x90,0x2e, /* f0 */ -}; - -static INT32 DrvInit() -{ - INT32 nLen; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - nGP9001ROMSize[0] = 0x200000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - SekMapMemory(Rom01, 0x000000, 0x07FFFF, MAP_ROM); // CPU 0 ROM - SekMapMemory(Ram01, 0x100000, 0x103FFF, MAP_RAM); - // SekMapMemory(ShareRAM, 0x210000, 0x21ffff, MAP_RAM); - SekMapMemory(RamPal, 0x400000, 0x400FFF, MAP_RAM); // Palette RAM - SekSetReadWordHandler(0, vfiveReadWord); - SekSetReadByteHandler(0, vfiveReadByte); - SekSetWriteWordHandler(0, vfiveWriteWord); - SekSetWriteByteHandler(0, vfiveWriteByte); - SekClose(); - - VezInit(0, V25_TYPE, 10000000 /*before divider*/); - VezOpen(0); - for (INT32 i = 0x80000; i < 0x100000; i += 0x8000) { - VezMapArea(i, i + 0x7fff, 0, ShareRAM); - VezMapArea(i, i + 0x7fff, 1, ShareRAM); - VezMapArea(i, i + 0x7fff, 2, ShareRAM); - } - VezSetReadHandler(vfive_v25_read); - VezSetWriteHandler(vfive_v25_write); - VezSetReadPort(vfive_v25_read_port); - VezSetDecode(nitro_decryption_table); - VezClose(); - } - - BurnYM2151Init(3375000); - BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH); - - nSpriteYOffset = 0x0001; - - nLayer0XOffset = -0x01D6; - nLayer1XOffset = -0x01D8; - nLayer2XOffset = -0x01DA; - - ToaInitGP9001(); - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalInit(); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - ToaPalExit(); - - ToaExitGP9001(); - BurnYM2151Exit(); - SekExit(); // Deallocate 68000s - VezExit(); - - BurnFree(Mem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderGP9001(); // Render GP9001 graphics - } - - ToaPalUpdate(); // Update the palette - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 10; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[2] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[2] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekNewFrame(); - VezNewFrame(); - - INT32 nSoundBufferPos = 0; - - nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesTotal[1] = (INT32)((INT64)5000000 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - nCyclesDone[0] = 0; - nCyclesDone[1] = 0; - - SekOpen(0); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - VezOpen(0); - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nCurrentCPU; - INT32 nNext; - - // Run 68000 - nCurrentCPU = 0; - nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; - - - // Trigger VBlank interrupt - if (!bVBlank && nNext > nToaCyclesVBlankStart) { - if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU]; - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } - - bVBlank = true; - - ToaBufferGP9001Sprites(); - - // Trigger VBlank interrupt - SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); - } - - nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; - if (bVBlank || (!CheckSleep(nCurrentCPU))) { // See if this CPU is busywaiting - nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment); - } else { - nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment); - } - - // sound! (increase interleave?) - if (v25_reset) { - nCyclesDone[1] += nCyclesTotal[1] / nInterleave; - } else { - nCyclesDone[1] += VezRun(nCyclesTotal[1] / nInterleave); - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen / nInterleave; - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - nSoundBufferPos += nSegmentLength; - } - } - - if (pBurnSoundOut) { - INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; - if (nSegmentLength) { - INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - BurnYM2151Render(pSoundBuf, nSegmentLength); - } - } - - VezClose(); - SekClose(); - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - return 0; -} - -struct BurnDriver BurnDrvVFive = { - "vfive", "grindstm", NULL, NULL, "1993", - "V-Five (Japan)\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, vfiveRomInfo, vfiveRomName, NULL, NULL, vfiveInputInfo, vfiveDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvGrindStormer = { - "grindstm", NULL, NULL, NULL, "1992", - "Grind Stormer\0", NULL, "Toaplan", "Toaplan GP9001 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, grindstmRomInfo, grindstmRomName, NULL, NULL, vfiveInputInfo, grindstmDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - -struct BurnDriver BurnDrvGrindStormerA = { - "grindstma", "grindstm", NULL, NULL, "1992", - "Grind Stormer (older set)\0", NULL, "Toaplan GP9001 based", "Toaplan", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_68K_Zx80, GBF_VERSHOOT, 0, - NULL, grindstaRomInfo, grindstaRomName, NULL, NULL, vfiveInputInfo, grindstmDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - diff --git a/jan/src/burn/drv/toaplan/d_vimana.cpp b/jan/src/burn/drv/toaplan/d_vimana.cpp deleted file mode 100644 index b4c6b43f7..000000000 --- a/jan/src/burn/drv/toaplan/d_vimana.cpp +++ /dev/null @@ -1,734 +0,0 @@ -#include "toaplan.h" - -// Based on MAME driver by Darren Olafson, Quench,Stephane Humbert - -#define REFRESHRATE 57.59 -#define VBLANK_LINES (32) - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *Drv68KROM; -static UINT8 *DrvZ80ROM; -static UINT8 *Drv68KRAM; -static UINT8 *DrvZ80RAM; -static UINT8 *DrvShareRAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvPalRAM2; - -static INT32 nColCount = 0x0800; - -static UINT8 DrvInputs[3]; -static UINT8 DrvDips[3]; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvReset; - -static UINT8 bDrawScreen; -static bool bVBlank; - -static bool bEnableInterrupts; - -static struct BurnInputInfo VimanaInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, - {"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" }, -}; - -STDINPUTINFO(Vimana) - -static struct BurnDIPInfo VimanaDIPList[]= -{ - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x01, "Easy" }, - {0x16, 0x01, 0x03, 0x00, "Medium" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x00, "70k 270k 200k+" }, - {0x16, 0x01, 0x0c, 0x04, "100k 350k 250k+" }, - {0x16, 0x01, 0x0c, 0x08, "100k Only" }, - {0x16, 0x01, 0x0c, 0x0c, "200k Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "2" }, - {0x16, 0x01, 0x30, 0x00, "3" }, - {0x16, 0x01, 0x30, 0x20, "4" }, - {0x16, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x80, 0x80, "No" }, - {0x16, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 10, "Territory / License" }, - {0x17, 0x01, 0x0f, 0x00, "Japan (Distributed by Tecmo)" }, - {0x17, 0x01, 0x0f, 0x01, "US" }, - {0x17, 0x01, 0x0f, 0x02, "Europe" }, - {0x17, 0x01, 0x0f, 0x03, "Hong Kong" }, - {0x17, 0x01, 0x0f, 0x04, "Korea" }, - {0x17, 0x01, 0x0f, 0x05, "Taiwan" }, - {0x17, 0x01, 0x0f, 0x06, "Taiwan (Spacy License)" }, - {0x17, 0x01, 0x0f, 0x07, "US (Romstar License)" }, - {0x17, 0x01, 0x0f, 0x08, "Hong Kong (Honest Trading Co. License)" }, - {0x17, 0x01, 0x0f, 0x0f, "Japan (Distributed by Tecmo)" }, -}; - -STDDIPINFO(Vimana) - -static struct BurnDIPInfo VimananDIPList[]= -{ - {0x15, 0xff, 0xff, 0x00, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - {0x17, 0xff, 0xff, 0x02, NULL }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x01, "Easy" }, - {0x16, 0x01, 0x03, 0x00, "Medium" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x03, "Hardest" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x00, "70K and 200K" }, - {0x16, 0x01, 0x0c, 0x04, "100K and 250K" }, - {0x16, 0x01, 0x0c, 0x08, "100K" }, - {0x16, 0x01, 0x0c, 0x0c, "200K" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "2" }, - {0x16, 0x01, 0x30, 0x00, "3" }, - {0x16, 0x01, 0x30, 0x20, "4" }, - {0x16, 0x01, 0x30, 0x10, "5" }, - - {0 , 0xfe, 0 , 2, "Invulnerability" }, - {0x16, 0x01, 0x40, 0x00, "Off" }, - {0x16, 0x01, 0x40, 0x40, "On" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x80, 0x80, "No" }, - {0x16, 0x01, 0x80, 0x00, "Yes" }, - - {0 , 0xfe, 0 , 9, "Territory / License" }, - {0x17, 0x01, 0x0f, 0x00, "Japan (Distributed by Tecmo)" }, - {0x17, 0x01, 0x0f, 0x01, "US" }, - {0x17, 0x01, 0x0f, 0x02, "Europe (Nova Apparate GMBH License)" }, - {0x17, 0x01, 0x0f, 0x03, "Hong Kong" }, - {0x17, 0x01, 0x0f, 0x04, "Korea" }, - {0x17, 0x01, 0x0f, 0x05, "Taiwan" }, - {0x17, 0x01, 0x0f, 0x06, "Taiwan (Spacy License)" }, - {0x17, 0x01, 0x0f, 0x07, "US (Romstar License)" }, - {0x17, 0x01, 0x0f, 0x08, "Hong Kong (Honest Trading Co. License)" }, -}; - -STDDIPINFO(Vimanan) - -void __fastcall vimanaWriteWord(UINT32 a, UINT16 d) -{ - switch (a) - { - case 0x080000: - nBCU2TileXOffset = d; - return; - - case 0x080002: - nBCU2TileYOffset = d; - return; - - case 0x080006: - // toaplan1_fcu_flipscreen_w - return; - - case 0x0c0000: - return; // nop - - case 0x0c0002: - ToaFCU2SetRAMPointer(d); - return; - - case 0x0c0004: - ToaFCU2WriteRAM(d); - return; - - case 0x0c0006: - ToaFCU2WriteRAMSize(d); - return; - - case 0x400000: - return; // nop - - case 0x400002: - bEnableInterrupts = (d & 0xFF); - return; - - case 0x400008: - case 0x40000a: - case 0x40000c: - case 0x40000e: - // toaplan1_bcu_control_w - return; - - case 0x4c0000: - // toaplan1_bcu_flipscreen_w - return; - - case 0x4c0002: - ToaBCU2SetRAMPointer(d); - return; - - case 0x4c0004: - case 0x4c0006: - ToaBCU2WriteRAM(d); - return; - - case 0x4c0010: - case 0x4c0012: - case 0x4c0014: - case 0x4c0016: - case 0x4c0018: - case 0x4c001a: - case 0x4c001c: - case 0x4c001e: - BCU2Reg[(a & 0x0f) >> 1] = d; - return; - } - - bprintf (0, _T("%5.5x %4.4x ww\n"), a, d); -} - -void __fastcall vimanaWriteByte(UINT32, UINT8) -{ -} - -UINT16 __fastcall vimanaReadWord(UINT32 a) -{ - switch (a) - { - case 0x0c0002: - return ToaFCU2GetRAMPointer(); - - case 0x0c0004: - return ToaFCU2ReadRAM(); - - case 0x0c0006: - return ToaFCU2ReadRAMSize(); - - case 0x4c0002: - return ToaBCU2GetRAMPointer(); - - case 0x4c0004: - return ToaBCU2ReadRAM_Hi(); - - case 0x4c0006: - return ToaBCU2ReadRAM_Lo(); - - case 0x4c0010: - case 0x4c0012: - case 0x4c0014: - case 0x4c0016: - case 0x4c0018: - case 0x4c001a: - case 0x4c001c: - case 0x4c001e: - return BCU2Reg[(a & 0x0f) >> 1]; - } - - return 0; -} - -UINT8 __fastcall vimanaReadByte(UINT32 a) -{ - switch (a) - { - case 0x0c0001: - case 0x400001: - return ToaVBlankRegister(); - } - - return 0; -} - -static UINT8 __fastcall vimanaZ80In(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x60: return (DrvDips[1] ^ 0xff); - - case 0x66: return (DrvDips[2] ^ 0xff) | 0xc0; - - case 0x80: return DrvInputs[0]; - - case 0x81: return DrvInputs[1]; - - case 0x82: return DrvDips[0]; - - case 0x83: return DrvInputs[2]; - - case 0x87: return BurnYM3812Read(0, 0); - - case 0x8f: return BurnYM3812Read(0, 1); - } - - return 0; -} - -static void __fastcall vimanaZ80Out(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0x87: - BurnYM3812Write(0, 0, nValue); - break; - - case 0x8f: - BurnYM3812Write(0, 1, nValue); - break; - } -} - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - - ZetOpen(0); - ZetReset(); - BurnYM3812Reset(); - ZetClose(); - - bEnableInterrupts = false; - - HiscoreReset(); - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - Drv68KROM = Next; Next += 0x040000; - DrvZ80ROM = Next; Next += 0x008000; - - BCU2ROM = Next; Next += nBCU2ROMSize; - FCU2ROM = Next; Next += nFCU2ROMSize; - - AllRam = Next; - - Drv68KRAM = Next; Next += 0x008000; - DrvZ80RAM = Next; Next += 0x000200; - RamZ80 = Next; // this is really shared ram between cpus. - DrvShareRAM = Next; Next += 0x000800; - DrvPalRAM = Next; Next += 0x000800; - DrvPalRAM2 = Next; Next += 0x000800; - - BCU2RAM = Next; Next += 0x010000; - FCU2RAM = Next; Next += 0x000800; - FCU2RAMSize = Next; Next += 0x000080; - - RamEnd = Next; - - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - ToaPalette2 = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - - MemEnd = Next; - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - -// bToaRotateScreen = true; - - BurnSetRefreshRate(REFRESHRATE); - - nBCU2ROMSize = 0x080000; - nFCU2ROMSize = 0x100000; - - // Find out how much memory is needed - AllMem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(AllMem, 0, nLen); - MemIndex(); - - ToaLoadCode(Drv68KROM, 0, 2); - ToaLoadTiles(BCU2ROM, 2, nBCU2ROMSize); - ToaLoadGP9001Tiles(FCU2ROM, 6, 3, nFCU2ROMSize); - if (BurnLoadRom(DrvZ80ROM + 0x000000, 10, 1)) return 1; - - { - SekInit(0, 0x68000); - SekOpen(0); - SekMapMemory(Drv68KROM, 0x000000, 0x03FFFF, MAP_ROM); - SekMapMemory(DrvPalRAM, 0x404000, 0x4047FF, MAP_RAM); - SekMapMemory(DrvPalRAM2, 0x406000, 0x4067FF, MAP_RAM); - SekMapMemory(Drv68KRAM, 0x480000, 0x487FFF, MAP_RAM); - SekSetReadWordHandler(0, vimanaReadWord); - SekSetReadByteHandler(0, vimanaReadByte); - SekSetWriteWordHandler(0, vimanaWriteWord); - SekSetWriteByteHandler(0, vimanaWriteByte); - - SekMapHandler(1, 0x440000, 0x440FFF, MAP_RAM); // Shared RAM between cpu's - SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM); - SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM); - SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM); - SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM); - SekClose(); - } - - { - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(vimanaZ80In); - ZetSetOutHandler(vimanaZ80Out); - - ZetMapMemory(DrvZ80ROM, 0x0000, 0x3FFF, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0x8000, 0x87FF, MAP_RAM); - ZetMapMemory(DrvZ80RAM, 0xFE00, 0xFFFF, MAP_RAM); - - ZetClose(); - } - - ToaInitBCU2(); - - nToaPalLen = nColCount; - ToaPalSrc = DrvPalRAM; - ToaPalSrc2 = DrvPalRAM2; - ToaPalInit(); - - BurnYM3812Init(1, 28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0); - BurnTimerAttachZetYM3812(28000000 / 8); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - ToaPalExit(); - - ToaExitBCU2(); - SekExit(); - ZetExit(); - - BurnFree(AllMem); - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderBCU2(); - } - - ToaPalUpdate(); - ToaPal2Update(); - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { - DrvDoReset(); - } - - memset (DrvInputs, 0, 3); - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] |= (DrvJoy1[i] & 1) << i; - DrvInputs[1] |= (DrvJoy2[i] & 1) << i; - DrvInputs[2] |= (DrvJoy3[i] & 1) << i; - } - ToaClearOpposites(&DrvInputs[0]); - ToaClearOpposites(&DrvInputs[1]); - - SekNewFrame(); - ZetNewFrame(); - - SekOpen(0); - ZetOpen(0); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - nCyclesTotal[1] = INT32(28000000.0 / 8 / REFRESHRATE); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); - } - - ToaBufferFCU2Sprites(); - - bVBlank = true; - if (bEnableInterrupts) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (bVBlank || (!CheckSleep(0))) { - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - } - - nToa1Cycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesDone[1] = ZetTotalCycles() - nCyclesTotal[1]; - - SekClose(); - ZetClose(); - -// ToaBufferFCU2Sprites(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); - ZetScan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - ToaScanBCU2(nAction, pnMin); - - SCAN_VAR(nCyclesDone); - - ToaRecalcPalette = 1; - bDrawScreen = true; // get background back ? - } - - return 0; -} - -// Vimana (World, set 1) - -static struct BurnRomInfo vimanaRomDesc[] = { - { "tp019-7a.bin", 0x20000, 0x5a4bf73e, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "tp019-8a.bin", 0x20000, 0x03ba27e8, BRF_ESS | BRF_PRG }, // 1 - - { "vim6.bin", 0x20000, 0x2886878d, BRF_GRA }, // 2 Tile data - { "vim5.bin", 0x20000, 0x61a63d7a, BRF_GRA }, // 3 - { "vim4.bin", 0x20000, 0xb0515768, BRF_GRA }, // 4 - { "vim3.bin", 0x20000, 0x0b539131, BRF_GRA }, // 5 - - { "vim1.bin", 0x80000, 0xcdde26cd, BRF_GRA }, // 6 - { "vim2.bin", 0x80000, 0x1dbfc118, BRF_GRA }, // 7 - - { "tp019-09.bpr", 0x00020, 0xbc88cced, BRF_GRA }, // 8 Sprite attribute PROM - { "tp019-10.bpr", 0x00020, 0xa1e17492, BRF_GRA }, // 9 - - { "hd647180.019", 0x08000, 0x41a97ebe, BRF_PRG }, // 10 Sound HD647180 code -}; - -STD_ROM_PICK(vimana) -STD_ROM_FN(vimana) - -struct BurnDriver BurnDrvVimana = { - "vimana", NULL, NULL, NULL, "1991", - "Vimana (World, set 1)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, vimanaRomInfo, vimanaRomName, NULL, NULL, VimanaInputInfo, VimanaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Vimana (World, set 2) - -static struct BurnRomInfo vimananRomDesc[] = { - { "tp019-07.rom", 0x20000, 0x78888ff2, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "tp019-08.rom", 0x20000, 0x6cd2dc3c, BRF_ESS | BRF_PRG }, // 1 - - { "vim6.bin", 0x20000, 0x2886878d, BRF_GRA }, // 2 Tile data - { "vim5.bin", 0x20000, 0x61a63d7a, BRF_GRA }, // 3 - { "vim4.bin", 0x20000, 0xb0515768, BRF_GRA }, // 4 - { "vim3.bin", 0x20000, 0x0b539131, BRF_GRA }, // 5 - - { "vim1.bin", 0x80000, 0xcdde26cd, BRF_GRA }, // 6 - { "vim2.bin", 0x80000, 0x1dbfc118, BRF_GRA }, // 7 - - { "tp019-09.bpr", 0x00020, 0xbc88cced, BRF_GRA }, // 8 Sprite attribute PROM - { "tp019-10.bpr", 0x00020, 0xa1e17492, BRF_GRA }, // 9 - - { "hd647180.019", 0x08000, 0x41a97ebe, BRF_PRG }, // 10 Sound HD647180 code -}; - -STD_ROM_PICK(vimanan) -STD_ROM_FN(vimanan) - -struct BurnDriver BurnDrvVimanan = { - "vimanan", "vimana", NULL, NULL, "1991", - "Vimana (World, set 2)\0", NULL, "Toaplan (Nova Apparate GMBH & Co license)", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, vimananRomInfo, vimananRomName, NULL, NULL, VimanaInputInfo, VimananDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; - - -// Vimana (Japan) - -static struct BurnRomInfo vimanajRomDesc[] = { - { "vim07.bin", 0x20000, 0x1efaea84, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "vim08.bin", 0x20000, 0xe45b7def, BRF_ESS | BRF_PRG }, // 1 - - { "vim6.bin", 0x20000, 0x2886878d, BRF_GRA }, // 2 Tile data - { "vim5.bin", 0x20000, 0x61a63d7a, BRF_GRA }, // 3 - { "vim4.bin", 0x20000, 0xb0515768, BRF_GRA }, // 4 - { "vim3.bin", 0x20000, 0x0b539131, BRF_GRA }, // 5 - - { "vim1.bin", 0x80000, 0xcdde26cd, BRF_GRA }, // 6 - { "vim2.bin", 0x80000, 0x1dbfc118, BRF_GRA }, // 7 - - { "tp019-09.bpr", 0x00020, 0xbc88cced, BRF_GRA }, // 8 Sprite attribute PROM - { "tp019-10.bpr", 0x00020, 0xa1e17492, BRF_GRA }, // 9 - - { "hd647180.019", 0x08000, 0x41a97ebe, BRF_PRG }, // 10 Sound HD647180 code -}; - -STD_ROM_PICK(vimanaj) -STD_ROM_FN(vimanaj) - -struct BurnDriver BurnDrvVimanaj = { - "vimanaj", "vimana", NULL, NULL, "1991", - "Vimana (Japan)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | TOA_ROTATE_GRAPHICS_CCW | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0, - NULL, vimanajRomInfo, vimanajRomName, NULL, NULL, VimanaInputInfo, VimanaDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x800, - 240, 320, 3, 4 -}; diff --git a/jan/src/burn/drv/toaplan/d_wardner.cpp b/jan/src/burn/drv/toaplan/d_wardner.cpp deleted file mode 100644 index 16149cc36..000000000 --- a/jan/src/burn/drv/toaplan/d_wardner.cpp +++ /dev/null @@ -1,1274 +0,0 @@ -// FB Alpha Wardner driver module -// Based on MAME driver by Quench - -#include "tiles_generic.h" -#include "tms32010.h" -#include "z80_intf.h" -#include "burn_ym3812.h" - -static UINT8 *AllMem; -static UINT8 *MemEnd; -static UINT8 *AllRam; -static UINT8 *RamEnd; -static UINT8 *DrvZ80ROM0; -static UINT8 *DrvMCUROM; -static UINT8 *DrvZ80ROM1; -static UINT8 *DrvGfxROM0; -static UINT8 *DrvGfxROM1; -static UINT8 *DrvGfxROM2; -static UINT8 *DrvGfxROM3; -static UINT8 *DrvSprRAM; -static UINT8 *DrvMCURAM; -static UINT8 *DrvPalRAM; -static UINT8 *DrvZ80RAM0; -static UINT8 *DrvZ80RAM1; -static UINT8 *DrvShareRAM; -static UINT8 *DrvBgRAM; -static UINT8 *DrvFgRAM; -static UINT8 *DrvTxRAM; -static UINT8 *DrvSprBuf; - -static UINT16 *pTempDraw; - -static UINT32 *DrvPalette; -static UINT8 DrvRecalc; - -static INT32 irq_enable; -static INT32 flipscreen; -static INT32 bgrambank; -static INT32 fgrombank; -static INT32 displayenable; - -static INT32 z80_halt; -static UINT32 main_ram_seg; -static UINT16 dsp_addr_w; -static INT32 dsp_execute; -static INT32 dsp_BIO; -static INT32 dsp_on; - -static UINT16 scrollx[4]; -static UINT16 scrolly[4]; -static UINT16 vidramoffs[4]; - -static INT32 vblank; -static UINT8 main_bank; -static INT32 coin_lockout; -static INT32 previous_coin; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvReset; -static UINT8 DrvInputs[3]; - -static struct BurnInputInfo WardnerInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 5, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 4, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 6, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy3 + 0, "service" }, - {"Service Mode", BIT_DIGITAL, DrvJoy3 + 2, "service" }, - {"Skip RAM Test", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" }, - {"Tilt", BIT_DIGITAL, DrvJoy3 + 1, "tilt" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Wardner) - -static struct BurnDIPInfo WardnerDIPList[]= -{ - {0x15, 0xff, 0xff, 0x01, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x01, 0x01, "Upright" }, - {0x15, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x30, "4 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x20, "3 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x10, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 2 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 3 Credits" }, - {0x15, 0x01, 0xc0, 0x80, "1 Coin 4 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "1 Coin 6 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x01, "Easy" }, - {0x16, 0x01, 0x03, 0x00, "Normal" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x00, "30k 80k 50k+" }, - {0x16, 0x01, 0x0c, 0x04, "50k 100k 50k+" }, - {0x16, 0x01, 0x0c, 0x08, "30k Only" }, - {0x16, 0x01, 0x0c, 0x0c, "50k Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "1" }, - {0x16, 0x01, 0x30, 0x00, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x20, "5" }, -}; - -STDDIPINFO(Wardner) - -static struct BurnDIPInfo WardnerjDIPList[]= -{ - {0x15, 0xff, 0xff, 0x01, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x01, 0x01, "Upright" }, - {0x15, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x01, "Easy" }, - {0x16, 0x01, 0x03, 0x00, "Normal" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x00, "30k 80k 50k+" }, - {0x16, 0x01, 0x0c, 0x04, "50k 100k 50k+" }, - {0x16, 0x01, 0x0c, 0x08, "30k Only" }, - {0x16, 0x01, 0x0c, 0x0c, "50k Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "1" }, - {0x16, 0x01, 0x30, 0x00, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x20, "5" }, -}; - -STDDIPINFO(Wardnerj) - -static struct BurnDIPInfo PyrosDIPList[]= -{ - {0x15, 0xff, 0xff, 0x01, NULL }, - {0x16, 0xff, 0xff, 0x00, NULL }, - - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x15, 0x01, 0x01, 0x01, "Upright" }, - {0x15, 0x01, 0x01, 0x00, "Cocktail" }, - - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x15, 0x01, 0x02, 0x00, "Off" }, - {0x15, 0x01, 0x02, 0x02, "On" }, - - {0 , 0xfe, 0 , 2, "Service Mode" }, - {0x15, 0x01, 0x04, 0x00, "Off" }, - {0x15, 0x01, 0x04, 0x04, "On" }, - - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x15, 0x01, 0x08, 0x08, "Off" }, - {0x15, 0x01, 0x08, 0x00, "On" }, - - {0 , 0xfe, 0 , 4, "Coin A" }, - {0x15, 0x01, 0x30, 0x20, "2 Coins 1 Credits" }, - {0x15, 0x01, 0x30, 0x00, "1 Coin 1 Credits" }, - {0x15, 0x01, 0x30, 0x30, "2 Coins 3 Credits" }, - {0x15, 0x01, 0x30, 0x10, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Coin B" }, - {0x15, 0x01, 0xc0, 0x80, "2 Coins 1 Credits" }, - {0x15, 0x01, 0xc0, 0x00, "1 Coin 1 Credits" }, - {0x15, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits" }, - {0x15, 0x01, 0xc0, 0x40, "1 Coin 2 Credits" }, - - {0 , 0xfe, 0 , 4, "Difficulty" }, - {0x16, 0x01, 0x03, 0x01, "Easy" }, - {0x16, 0x01, 0x03, 0x00, "Normal" }, - {0x16, 0x01, 0x03, 0x02, "Hard" }, - {0x16, 0x01, 0x03, 0x03, "Very Hard" }, - - {0 , 0xfe, 0 , 4, "Bonus Life" }, - {0x16, 0x01, 0x0c, 0x00, "30k 80k 50k+" }, - {0x16, 0x01, 0x0c, 0x04, "50k 100k 50k+" }, - {0x16, 0x01, 0x0c, 0x08, "50k Only" }, - {0x16, 0x01, 0x0c, 0x0c, "100k Only" }, - - {0 , 0xfe, 0 , 4, "Lives" }, - {0x16, 0x01, 0x30, 0x30, "1" }, - {0x16, 0x01, 0x30, 0x00, "3" }, - {0x16, 0x01, 0x30, 0x10, "4" }, - {0x16, 0x01, 0x30, 0x20, "5" }, - - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x16, 0x01, 0x40, 0x40, "No" }, - {0x16, 0x01, 0x40, 0x00, "Yes" }, -}; - -STDDIPINFO(Pyros) - -static void palette_write(INT32 offset) -{ - offset &= 0xffe; - - INT32 p = *((UINT16*)(DrvPalRAM + offset)); - - INT32 r = (p >> 0) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[offset/2] = BurnHighCol(r,g,b,0); -} - -static void wardner_dsp(INT32 enable) -{ - enable ^= 1; - dsp_on = enable; - - if (enable) - { - tms32010_set_irq_line(0, CPU_IRQSTATUS_ACK); /* TMS32010 INT */ - z80_halt = 1; - z80_ICount = 0; - } - else - { - tms32010_set_irq_line(0, CPU_IRQSTATUS_NONE); /* TMS32010 INT */ - } -} - -static void wardner_coin_write(UINT8 data) -{ - switch (data) - { - case 0x00: - case 0x01: - wardner_dsp(data); - return; - case 0x0c: coin_lockout = 0x08; break; - case 0x0d: coin_lockout = 0x00; break; - case 0x0e: coin_lockout = 0x10; break; - case 0x0f: coin_lockout = 0x00; break; - } -} - -static void control_write(UINT8 data) -{ - switch (data) - { - case 0x04: - case 0x05: - irq_enable = data & 1; - break; - - case 0x06: - case 0x07: - flipscreen = data & 1; - break; - - case 0x08: - case 0x09: - bgrambank = ((data & 1) << 13); - break; - - case 0x0a: - case 0x0b: - fgrombank = ((data & 1) << 12); - break; - - case 0x0c: - case 0x0d: // not for z80 cpus, only 68k! -dink - //wardner_dsp(data & 1); - break; - - case 0x0e: - case 0x0f: - displayenable = data & 1; - break; - } -} - -static void bankswitch(INT32 data) -{ - main_bank = data; - INT32 bank = (data & 0x07) * 0x8000; - - ZetMapMemory(DrvZ80ROM0 + bank, 0x8000, 0xffff, MAP_ROM); - - if (bank == 0) { - ZetMapMemory(DrvSprRAM, 0x8000, 0x8fff, MAP_ROM); - ZetMapMemory(DrvPalRAM, 0xa000, 0xafff, MAP_ROM); - ZetMapMemory(DrvShareRAM, 0xc000, 0xc7ff, MAP_ROM); - } -} - -static void __fastcall wardner_main_write(UINT16 address, UINT8 data) -{ - if ((address & 0xf000) == 0xa000) { - DrvPalRAM[address & 0xfff] = data; - palette_write(address); - return; - } -} - -static void __fastcall wardner_main_write_port(UINT16 port, UINT8 data) -{ - INT32 offs = ((port/0x10)-1)&3; - - switch (port & 0xff) - { - case 0x00: - case 0x02: - // mc6845 - return; - - case 0x10: - case 0x20: - case 0x30: - scrollx[offs] = (scrollx[offs] & 0x100) | (data); - return; - - case 0x11: - case 0x21: - case 0x31: - scrollx[offs] = (scrollx[offs] & 0x0ff) | (data << 8); - return; - - case 0x12: - case 0x22: - case 0x32: - scrolly[offs] = (scrolly[offs] & 0x100) | (data); - return; - - case 0x13: - case 0x23: - case 0x33: - scrolly[offs] = (scrolly[offs] & 0x0ff) | (data << 8); - return; - - case 0x14: - case 0x24: - case 0x34: - vidramoffs[offs] = (vidramoffs[offs] & 0xff00) | (data); - return; - - case 0x15: - case 0x25: - case 0x35: - vidramoffs[offs] = (vidramoffs[offs] & 0x00ff) | (data << 8); - return; - - case 0x40: - case 0x41: - case 0x42: - case 0x43: // exscroll - return; - - case 0x5a: - wardner_coin_write(data); - return; - - case 0x5c: - control_write(data); - return; - - case 0x60: - case 0x61: - DrvTxRAM[(((vidramoffs[0]*2)+(port & 1)) & 0x0fff)] = data; - return; - - case 0x62: - case 0x63: - DrvBgRAM[(((vidramoffs[1]*2)+(port & 1)) & 0x1fff) + bgrambank] = data; - return; - - case 0x64: - case 0x65: - DrvFgRAM[(((vidramoffs[2]*2)+(port & 1)) & 0x1fff)] = data; - return; - - case 0x70: - bankswitch(data); - return; - } -} - -static UINT8 __fastcall wardner_main_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x50: - return DrvDips[0]; - - case 0x52: - return DrvDips[1]; - - case 0x54: - return DrvInputs[0]; - - case 0x56: - return DrvInputs[1]; - - case 0x58: - return ((DrvInputs[2] & 0x7f) & ~coin_lockout) | (vblank ? 0x80 : 0); - - case 0x60: - case 0x61: - return DrvTxRAM[(((vidramoffs[0]*2)+(port & 1)) & 0x0fff)]; - - case 0x62: - case 0x63: - return DrvBgRAM[(((vidramoffs[1]*2)+(port & 1)) & 0x1fff) + bgrambank]; - - case 0x64: - case 0x65: - return DrvFgRAM[(((vidramoffs[2]*2)+(port & 1)) & 0x1fff)]; - } - - return 0; -} - -static void __fastcall wardner_sound_write_port(UINT16 port, UINT8 data) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - BurnYM3812Write(0, port & 1, data); - return; - } -} - -static UINT8 __fastcall wardner_sound_read_port(UINT16 port) -{ - switch (port & 0xff) - { - case 0x00: - case 0x01: - return BurnYM3812Read(0, port & 1); - } - - return 0; -} - -static void twincobr_dsp_bio_w(UINT16 data) -{ - if (data & 0x8000) { - dsp_BIO = 0; - } - - if (data == 0) { - if (dsp_execute) { - z80_halt = 0; - dsp_execute = 0; - //tms32010RunEnd(); - } - - dsp_BIO = 1; - } -} - -static UINT8 twincobr_BIO_r() -{ - return dsp_BIO; -} - -static void wardner_dsp_addrsel_w(UINT16 data) -{ - main_ram_seg = (data & 0xe000); - dsp_addr_w = ((data & 0x07ff) << 1); - - if (main_ram_seg == 0x6000) main_ram_seg = 0x7000; -} - -static UINT16 wardner_dsp_r() -{ - switch (main_ram_seg) - { - case 0x7000: - case 0x8000: - case 0xa000: - return ZetReadByte(main_ram_seg + dsp_addr_w) | (ZetReadByte(main_ram_seg + dsp_addr_w + 1) << 8); - } - - return 0; -} - -static void wardner_dsp_w(UINT16 data) -{ - dsp_execute = 0; - - switch (main_ram_seg) - { - case 0x7000: if ((dsp_addr_w < 3) && (data == 0)) dsp_execute = 1; - case 0x8000: - case 0xa000: - ZetWriteByte(main_ram_seg + dsp_addr_w + 0, data & 0xff); - ZetWriteByte(main_ram_seg + dsp_addr_w + 1, data >> 8); - return; - } -} - -static void dsp_write(INT32 port, UINT16 data) -{ - switch (port) - { - case 0x00: wardner_dsp_addrsel_w(data); return; - case 0x01: wardner_dsp_w(data); return; - case 0x03: twincobr_dsp_bio_w(data); return; - } - //bprintf (0, _T("DSPWP: %2.2x, %4.4x\n"), port&0xff, data); -} - -static UINT16 dsp_read(INT32 port) -{ - switch (port) - { - case 0x01: return wardner_dsp_r(); - case 0x10: return twincobr_BIO_r(); - } - //bprintf (0, _T("DSPRP: %2.2x\n"), port&0xff); - - return 0; -} - -static void DrvFMIRQHandler(INT32, INT32 nStatus) -{ - ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -static INT32 DrvSynchroniseStream(INT32 nSoundRate) -{ - return (INT64)(double)ZetTotalCycles() * nSoundRate / 3500000; -} - -static INT32 DrvDoReset() -{ - memset (AllRam, 0, RamEnd - AllRam); - - ZetOpen(0); - ZetReset(); - bankswitch(0); - ZetClose(); - - ZetOpen(1); - ZetReset(); - BurnYM3812Reset(); - ZetClose(); - - tms32010_reset(); - - z80_halt = 0; - - coin_lockout = 0; - previous_coin = 0; - - irq_enable = 0; - flipscreen = 0; - bgrambank = 0; - fgrombank = 0; - displayenable = 1; - - main_ram_seg = 0; - dsp_addr_w = 0; - dsp_execute = 0; - dsp_BIO = 0; - dsp_on = 0; - - return 0; -} - -static INT32 MemIndex() -{ - UINT8 *Next; Next = AllMem; - - DrvZ80ROM0 = Next; Next += 0x040000; - DrvMCUROM = Next; Next += 0x004000; - DrvZ80ROM1 = Next; Next += 0x008000; - - DrvGfxROM0 = Next; Next += 0x020000; - DrvGfxROM1 = Next; Next += 0x080000; - DrvGfxROM2 = Next; Next += 0x040000; - DrvGfxROM3 = Next; Next += 0x080000; - - DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32); - - pTempDraw = (UINT16*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT16); - - AllRam = Next; - - DrvSprBuf = Next; Next += 0x001000; - DrvSprRAM = Next; Next += 0x001000; - DrvZ80RAM0 = Next; Next += 0x001000; - DrvZ80RAM1 = Next; Next += 0x001000; - DrvMCURAM = Next; Next += 0x010000; - DrvPalRAM = Next; Next += 0x001000; - DrvShareRAM = Next; Next += 0x000800; - - DrvBgRAM = Next; Next += 0x004000; - DrvFgRAM = Next; Next += 0x002000; - DrvTxRAM = Next; Next += 0x001000; - - RamEnd = Next; - - MemEnd = Next; - - return 0; -} - -static INT32 DrvGfxDecode() -{ - INT32 Plane0[3] = { (0x4000*8*0), (0x4000*8*1), (0x4000*8*2) }; - INT32 Plane1[4] = { (0x8000*8*0), (0x8000*8*1), (0x8000*8*2), (0x8000*8*3) }; - INT32 Plane2[4] = { (0x10000*8*0), (0x10000*8*1), (0x10000*8*2), (0x10000*8*3) }; - INT32 XOffs[16] = { STEP16(0,1) }; - INT32 YOffs[8] = { STEP8(0,8) }; - INT32 YOffs1[16] = { STEP16(0,16) }; - - UINT8 *tmp = (UINT8*)BurnMalloc(0x40000); - if (tmp == NULL) { - return 1; - } - - memcpy (tmp, DrvGfxROM0, 0xc000); - - GfxDecode(0x0800, 3, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); - - memcpy (tmp, DrvGfxROM1, 0x20000); - - GfxDecode(0x1000, 4, 8, 8, Plane1, XOffs, YOffs, 0x040, tmp, DrvGfxROM1); - memcpy (DrvGfxROM1 + 0x40000, DrvGfxROM1, 0x40000); // mirror - - memcpy (tmp, DrvGfxROM2, 0x20000); - - GfxDecode(0x1000, 4, 8, 8, Plane1, XOffs, YOffs, 0x040, tmp, DrvGfxROM2); - - memcpy (tmp, DrvGfxROM3, 0x40000); - - GfxDecode(0x0800, 4, 16, 16, Plane2, XOffs, YOffs1, 0x100, tmp, DrvGfxROM3); - - BurnFree(tmp); - - return 0; -} - -static INT32 LoadNibbles(UINT8 *dst, INT32 idx, INT32 len) -{ - UINT8 *tmp = (UINT8*)BurnMalloc(len*2); - - if (BurnLoadRom(dst + 0, idx + 1, 2)) return 1; - if (BurnLoadRom(dst + 1, idx + 3, 2)) return 1; - if (BurnLoadRom(tmp + 0, idx + 0, 2)) return 1; - if (BurnLoadRom(tmp + 1, idx + 2, 2)) return 1; - - for (INT32 i = 0; i < len * 2; i++) { - dst[i] = (dst[i] & 0xf) | (tmp[i] << 4); - } - - BurnFree(tmp); - - return 0; -} - -static INT32 DrvInit() -{ - GenericTilesInit(); - - AllMem = NULL; - MemIndex(); - INT32 nLen = MemEnd - (UINT8 *)0; - if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; - memset(AllMem, 0, nLen); - MemIndex(); - - { - memset (DrvZ80ROM0, 0xff, 0x40000); - if (BurnLoadRom(DrvZ80ROM0 + 0x00000, 0, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x10000, 1, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x20000, 2, 1)) return 1; - if (BurnLoadRom(DrvZ80ROM0 + 0x38000, 3, 1)) return 1; - - if (BurnLoadRom(DrvZ80ROM1 + 0x00000, 4, 1)) return 1; - - if (LoadNibbles(DrvMCUROM + 0x00000, 5, 0x0400)) return 1; - if (LoadNibbles(DrvMCUROM + 0x00800, 9, 0x0400)) return 1; - - if (BurnLoadRom(DrvGfxROM0 + 0x00000, 13, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x04000, 14, 1)) return 1; - if (BurnLoadRom(DrvGfxROM0 + 0x08000, 15, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM1 + 0x00000, 16, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x08000, 17, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x10000, 18, 1)) return 1; - if (BurnLoadRom(DrvGfxROM1 + 0x18000, 19, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM2 + 0x00000, 20, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x08000, 21, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x10000, 22, 1)) return 1; - if (BurnLoadRom(DrvGfxROM2 + 0x18000, 23, 1)) return 1; - - if (BurnLoadRom(DrvGfxROM3 + 0x00000, 24, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x10000, 25, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x20000, 26, 1)) return 1; - if (BurnLoadRom(DrvGfxROM3 + 0x30000, 27, 1)) return 1; - - DrvGfxDecode(); - } - - ZetInit(0); - ZetOpen(0); - ZetMapMemory(DrvZ80ROM0, 0x0000, 0x6fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM0, 0x7000, 0x7fff, MAP_RAM); - ZetMapMemory(DrvSprRAM, 0x8000, 0x8fff, MAP_WRITE); -// ZetMapMemory(DrvPalRAM, 0xa000, 0xafff, MAP_WRITE); - ZetMapMemory(DrvShareRAM, 0xc000, 0xc7ff, MAP_WRITE); - ZetSetWriteHandler(wardner_main_write); - ZetSetOutHandler(wardner_main_write_port); - ZetSetInHandler(wardner_main_read_port); - ZetClose(); - - ZetInit(1); - ZetOpen(1); - ZetMapMemory(DrvZ80ROM1, 0x0000, 0x7fff, MAP_ROM); - ZetMapMemory(DrvZ80RAM1, 0x8000, 0x80ff, MAP_RAM); - ZetMapMemory(DrvShareRAM, 0xc000, 0xc7ff, MAP_RAM); - ZetMapMemory(DrvZ80RAM1 + 0x100,0xc800, 0xcfff, MAP_RAM); - ZetSetOutHandler(wardner_sound_write_port); - ZetSetInHandler(wardner_sound_read_port); - ZetClose(); - - tms32010_init(); - tms32010_set_write_port_handler(dsp_write); - tms32010_set_read_port_handler(dsp_read); - tms32010_ram = (UINT16*)DrvMCURAM; - tms32010_rom = (UINT16*)DrvMCUROM; - - BurnYM3812Init(1, 3500000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0); - BurnTimerAttachZetYM3812(3500000); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - DrvDoReset(); - - return 0; -} - -static INT32 DrvExit() -{ - GenericTilesExit(); - - BurnYM3812Exit(); - - ZetExit(); - - tms32010_exit(); - - BurnFree (AllMem); - - return 0; -} - -static void DrvPaletteUpdate() -{ - for (INT32 i = 0; i < 0xe00; i+=2) { - INT32 p = *((UINT16*)(DrvPalRAM + i)); - - INT32 r = (p >> 0) & 0x1f; - INT32 g = (p >> 5) & 0x1f; - INT32 b = (p >> 10) & 0x1f; - - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - - DrvPalette[i/2] = BurnHighCol(r,g,b,0); - } -} - -static void draw_layer(INT32 layer, INT32 rambank, INT32 rombank) -{ - UINT16 *ram[3] = { (UINT16*)DrvTxRAM, (UINT16*)DrvBgRAM, (UINT16*)DrvFgRAM }; - UINT8 *gfx[3] = { DrvGfxROM0, DrvGfxROM2, DrvGfxROM1 }; - INT32 colbank[3] = { 0x600, 0x400, 0x500 }; - INT32 colshift[3] = { 11, 12, 12 }; - INT32 depth = colshift[layer] - 8; - - INT32 transp = (layer & 1) ? 0xff : 0; - - INT32 height = (layer ? 64 : 32) * 8; - - INT32 xscroll = (scrollx[layer] + 55 ) & 0x1ff; - INT32 yscroll = (scrolly[layer] + 30) & (height - 1); - - for (INT32 offs = 0; offs < 64 * (height/8); offs++) - { - INT32 sx = (offs & 0x3f) * 8; - INT32 sy = (offs / 0x40) * 8; - - sx -= xscroll; - if (sx < -7) sx += 512; - sy -= yscroll; - if (sy < -7) sy += height; - - INT32 attr = ram[layer][offs + (rambank/2)]; - INT32 color = attr >> colshift[layer]; - INT32 code = (attr & ((1 << colshift[layer])-1)) + rombank; - - Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, depth, transp, colbank[layer], gfx[layer]); - } -} - -static void predraw_sprites() -{ - UINT16 *ram = (UINT16*)DrvSprBuf; - - INT32 xoffs = 31; - INT32 xoffs_flipped = 15; - - memset (pTempDraw, 0, nScreenWidth * nScreenHeight * sizeof(UINT16)); - - for (INT32 offs = 0; offs < 0x1000/2; offs += 4) - { - INT32 attr = ram[offs + 1]; - INT32 prio = (attr >> 10) & 3; - if (prio == 0) continue; - - INT32 sy = ram[offs + 3] >> 7; - - if (sy != 0x0100) - { - INT32 code = ram[offs] & 0x7ff; - INT32 color = (attr & 0x3f) | ((attr >> 4) & 0xc0); - - INT32 sx = ram[offs + 2] >> 7; - INT32 flipx = attr & 0x100; - if (flipx) sx -= xoffs_flipped; - - INT32 flipy = attr & 0x200; - - sx -= xoffs; - sy -= 16; - - if (flipy) { - if (flipx) { - Render16x16Tile_Mask_FlipXY_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_FlipY_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3); - } - } else { - if (flipx) { - Render16x16Tile_Mask_FlipX_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3); - } else { - Render16x16Tile_Mask_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3); - } - } - } - } -} - -static void draw_sprites(INT32 priority) -{ - priority <<= 10; - - for (INT32 y = 0;y < nScreenHeight; y++) - { - UINT16* src = pTempDraw + y * nScreenWidth; - UINT16* dst = pTransDraw + y * nScreenWidth; - - for (INT32 x = 0;x < nScreenWidth; x++) - { - UINT16 pix = src[x]; - - if (pix & 0xf) - { - if ((pix & 0xc00) == priority) - { - dst[x] = pix & 0x3ff; - } - } - } - } -} - -static INT32 DrvDraw() -{ - if (DrvRecalc) { - DrvPaletteUpdate(); - DrvRecalc = 0; - } - - BurnTransferClear(); - - if (displayenable) - { - predraw_sprites(); - - draw_layer(1, bgrambank, 0); - draw_sprites(1); - draw_layer(2, 0, fgrombank); - draw_sprites(2); - draw_layer(0, 0, 0); - draw_sprites(3); - } - - BurnTransferCopy(DrvPalette); - - return 0; -} - -static INT32 DrvFrame() -{ - if (DrvReset) { - DrvDoReset(); - } - - ZetNewFrame(); - - { - memset (DrvInputs, 0, 3); - - for (INT32 i = 0; i < 8; i++) { - DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; - DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; - DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; - } - - // 1 coin per frame. - if (DrvInputs[2] & 0x18 && previous_coin & 0x18) { - DrvInputs[2] &= ~0x18; - } else previous_coin = DrvInputs[2]; - } - - INT32 nInterleave = 286; - INT32 nCyclesTotal[3] = { 6000000 / 60, 3500000 / 60, 14000000 / 60 }; - INT32 nCyclesDone[3] = { 0, 0, 0 }; - - vblank = 0; - - for (INT32 i = 0; i < nInterleave; i++) - { - INT32 nSegment = nCyclesTotal[0] / nInterleave; - - ZetOpen(0); - if (z80_halt) { - nCyclesDone[0] += nSegment; - ZetIdle(nSegment); - } else { - nCyclesDone[0] += ZetRun(nSegment); - - if (i == 240 && irq_enable) { - irq_enable = 0; - ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD); // or hold? - } - } - - nSegment = nCyclesTotal[2] / nInterleave; - if (dsp_on) tms32010_execute(nSegment); - - ZetClose(); - - ZetOpen(1); - BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave)); - ZetClose(); - - if (i == 240) { - if (pBurnDraw) { - DrvDraw(); - } - - memcpy (DrvSprBuf, DrvSprRAM, 0x1000); - - vblank = 1; - } - } - - ZetOpen(1); - - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - - if (pBurnSoundOut) { - BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - } - - ZetClose(); - - return 0; -} - -static INT32 DrvScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_MEMORY_RAM) - { - ba.Data = AllRam; - ba.nLen = RamEnd - AllRam; - ba.nAddress = 0; - ba.szName = "All RAM"; - BurnAcb(&ba); - } - - if (nAction & ACB_DRIVER_DATA) - { - ZetScan(nAction); - tms32010_scan(nAction); - - BurnYM3812Scan(nAction, pnMin); - - SCAN_VAR(z80_halt); - SCAN_VAR(irq_enable); - SCAN_VAR(flipscreen); - SCAN_VAR(bgrambank); - SCAN_VAR(fgrombank); - SCAN_VAR(displayenable); - SCAN_VAR(main_ram_seg); - SCAN_VAR(dsp_addr_w); - SCAN_VAR(dsp_execute); - SCAN_VAR(dsp_BIO); - SCAN_VAR(main_bank); - - if (nAction & ACB_WRITE) { - ZetOpen(0); - bankswitch(main_bank); - ZetClose(); - } - - } - - return 0; -} - - -// Wardner (World) - -static struct BurnRomInfo wardnerRomDesc[] = { - { "wardner.17", 0x08000, 0xc5dd56fd, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 code - { "b25-18.rom", 0x10000, 0x9aab8ee2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "b25-19.rom", 0x10000, 0x95b68813, 1 | BRF_PRG | BRF_ESS }, // 2 - { "wardner.20", 0x08000, 0x347f411b, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "b25-16.rom", 0x08000, 0xe5202ff8, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 code - - { "82s137.1d", 0x00400, 0xcc5b3f53, 3 | BRF_PRG | BRF_ESS }, // 5 tms32010 code - { "82s137.1e", 0x00400, 0x47351d55, 3 | BRF_PRG | BRF_ESS }, // 6 - { "82s137.3d", 0x00400, 0x70b537b9, 3 | BRF_PRG | BRF_ESS }, // 7 - { "82s137.3e", 0x00400, 0x6edb2de8, 3 | BRF_PRG | BRF_ESS }, // 8 - { "82s131.3b", 0x00200, 0x9dfffaff, 3 | BRF_PRG | BRF_ESS }, // 9 - { "82s131.3a", 0x00200, 0x712bad47, 3 | BRF_PRG | BRF_ESS }, // 10 - { "82s131.2a", 0x00200, 0xac843ca6, 3 | BRF_PRG | BRF_ESS }, // 11 - { "82s131.1a", 0x00200, 0x50452ff8, 3 | BRF_PRG | BRF_ESS }, // 12 - - { "wardner.07", 0x04000, 0x1392b60d, 4 | BRF_GRA }, // 13 Text characters - { "wardner.06", 0x04000, 0x0ed848da, 4 | BRF_GRA }, // 14 - { "wardner.05", 0x04000, 0x79792c86, 4 | BRF_GRA }, // 15 - - { "b25-12.rom", 0x08000, 0x15d08848, 5 | BRF_GRA }, // 16 Background tiles - { "b25-15.rom", 0x08000, 0xcdd2d408, 5 | BRF_GRA }, // 17 - { "b25-14.rom", 0x08000, 0x5a2aef4f, 5 | BRF_GRA }, // 18 - { "b25-13.rom", 0x08000, 0xbe21db2b, 5 | BRF_GRA }, // 19 - - { "b25-08.rom", 0x08000, 0x883ccaa3, 6 | BRF_GRA }, // 20 Foreground tiles - { "b25-11.rom", 0x08000, 0xd6ebd510, 6 | BRF_GRA }, // 21 - { "b25-10.rom", 0x08000, 0xb9a61e81, 6 | BRF_GRA }, // 22 - { "b25-09.rom", 0x08000, 0x585411b7, 6 | BRF_GRA }, // 23 - - { "b25-01.rom", 0x10000, 0x42ec01fb, 7 | BRF_GRA }, // 24 Sprites - { "b25-02.rom", 0x10000, 0x6c0130b7, 7 | BRF_GRA }, // 25 - { "b25-03.rom", 0x10000, 0xb923db99, 7 | BRF_GRA }, // 26 - { "b25-04.rom", 0x10000, 0x8059573c, 7 | BRF_GRA }, // 27 - - { "82s129.b19", 0x00100, 0x24e7d62f, 8 | BRF_GRA }, // 28 Proms (not used) - { "82s129.b18", 0x00100, 0xa50cef09, 8 | BRF_GRA }, // 29 - { "82s123.b21", 0x00020, 0xf72482db, 8 | BRF_GRA }, // 30 - { "82s123.c6", 0x00020, 0xbc88cced, 8 | BRF_GRA }, // 31 - { "82s123.f1", 0x00020, 0x4fb5df2a, 8 | BRF_GRA }, // 32 -}; - -STD_ROM_PICK(wardner) -STD_ROM_FN(wardner) - -struct BurnDriver BurnDrvWardner = { - "wardner", NULL, NULL, NULL, "1987", - "Wardner (World)\0", NULL, "Toaplan / Taito Corporation Japan", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING, 2, HARDWARE_TOAPLAN_MISC, GBF_PLATFORM, 0, - NULL, wardnerRomInfo, wardnerRomName, NULL, NULL, WardnerInputInfo, WardnerDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 320, 240, 4, 3 -}; - - -// Pyros (US) - -static struct BurnRomInfo pyrosRomDesc[] = { - { "b25-29.rom", 0x08000, 0xb568294d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 code - { "b25-18.rom", 0x10000, 0x9aab8ee2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "b25-19.rom", 0x10000, 0x95b68813, 1 | BRF_PRG | BRF_ESS }, // 2 - { "b25-30.rom", 0x08000, 0x5056c799, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "b25-16.rom", 0x08000, 0xe5202ff8, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 code - - { "82s137.1d", 0x00400, 0xcc5b3f53, 3 | BRF_PRG | BRF_ESS }, // 5 tms32010 code - { "82s137.1e", 0x00400, 0x47351d55, 3 | BRF_PRG | BRF_ESS }, // 6 - { "82s137.3d", 0x00400, 0x70b537b9, 3 | BRF_PRG | BRF_ESS }, // 7 - { "82s137.3e", 0x00400, 0x6edb2de8, 3 | BRF_PRG | BRF_ESS }, // 8 - { "82s131.3b", 0x00200, 0x9dfffaff, 3 | BRF_PRG | BRF_ESS }, // 9 - { "82s131.3a", 0x00200, 0x712bad47, 3 | BRF_PRG | BRF_ESS }, // 10 - { "82s131.2a", 0x00200, 0xac843ca6, 3 | BRF_PRG | BRF_ESS }, // 11 - { "82s131.1a", 0x00200, 0x50452ff8, 3 | BRF_PRG | BRF_ESS }, // 12 - - { "b25-35.rom", 0x04000, 0xfec6f0c0, 4 | BRF_GRA }, // 13 Text characters - { "b25-34.rom", 0x04000, 0x02505dad, 4 | BRF_GRA }, // 14 - { "b25-33.rom", 0x04000, 0x9a55fcb9, 4 | BRF_GRA }, // 15 - - { "b25-12.rom", 0x08000, 0x15d08848, 5 | BRF_GRA }, // 16 Background tiles - { "b25-15.rom", 0x08000, 0xcdd2d408, 5 | BRF_GRA }, // 17 - { "b25-14.rom", 0x08000, 0x5a2aef4f, 5 | BRF_GRA }, // 18 - { "b25-13.rom", 0x08000, 0xbe21db2b, 5 | BRF_GRA }, // 19 - - { "b25-08.rom", 0x08000, 0x883ccaa3, 6 | BRF_GRA }, // 20 Foreground tiles - { "b25-11.rom", 0x08000, 0xd6ebd510, 6 | BRF_GRA }, // 21 - { "b25-10.rom", 0x08000, 0xb9a61e81, 6 | BRF_GRA }, // 22 - { "b25-09.rom", 0x08000, 0x585411b7, 6 | BRF_GRA }, // 23 - - { "b25-01.rom", 0x10000, 0x42ec01fb, 7 | BRF_GRA }, // 24 Sprites - { "b25-02.rom", 0x10000, 0x6c0130b7, 7 | BRF_GRA }, // 25 - { "b25-03.rom", 0x10000, 0xb923db99, 7 | BRF_GRA }, // 26 - { "b25-04.rom", 0x10000, 0x8059573c, 7 | BRF_GRA }, // 27 - - { "82s129.b19", 0x00100, 0x24e7d62f, 8 | BRF_GRA }, // 28 Proms (not used) - { "82s129.b18", 0x00100, 0xa50cef09, 8 | BRF_GRA }, // 29 - { "82s123.b21", 0x00020, 0xf72482db, 8 | BRF_GRA }, // 30 - { "82s123.c6", 0x00020, 0xbc88cced, 8 | BRF_GRA }, // 31 - { "82s123.f1", 0x00020, 0x4fb5df2a, 8 | BRF_GRA }, // 32 -}; - -STD_ROM_PICK(pyros) -STD_ROM_FN(pyros) - -struct BurnDriver BurnDrvPyros = { - "pyros", "wardner", NULL, NULL, "1987", - "Pyros (US)\0", NULL, "Toaplan / Taito America Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TOAPLAN_MISC, GBF_PLATFORM, 0, - NULL, pyrosRomInfo, pyrosRomName, NULL, NULL, WardnerInputInfo, PyrosDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 320, 240, 4, 3 -}; - - -// Wardner no Mori (Japan) - -static struct BurnRomInfo wardnerjRomDesc[] = { - { "b25-17.bin", 0x08000, 0x4164dca9, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 code - { "b25-18.rom", 0x10000, 0x9aab8ee2, 1 | BRF_PRG | BRF_ESS }, // 1 - { "b25-19.rom", 0x10000, 0x95b68813, 1 | BRF_PRG | BRF_ESS }, // 2 - { "b25-20.bin", 0x08000, 0x1113ad38, 1 | BRF_PRG | BRF_ESS }, // 3 - - { "b25-16.rom", 0x08000, 0xe5202ff8, 2 | BRF_PRG | BRF_ESS }, // 4 Z80 #1 code - - { "82s137.1d", 0x00400, 0xcc5b3f53, 3 | BRF_PRG | BRF_ESS }, // 5 tms32010 code - { "82s137.1e", 0x00400, 0x47351d55, 3 | BRF_PRG | BRF_ESS }, // 6 - { "82s137.3d", 0x00400, 0x70b537b9, 3 | BRF_PRG | BRF_ESS }, // 7 - { "82s137.3e", 0x00400, 0x6edb2de8, 3 | BRF_PRG | BRF_ESS }, // 8 - { "82s131.3b", 0x00200, 0x9dfffaff, 3 | BRF_PRG | BRF_ESS }, // 9 - { "82s131.3a", 0x00200, 0x712bad47, 3 | BRF_PRG | BRF_ESS }, // 10 - { "82s131.2a", 0x00200, 0xac843ca6, 3 | BRF_PRG | BRF_ESS }, // 11 - { "82s131.1a", 0x00200, 0x50452ff8, 3 | BRF_PRG | BRF_ESS }, // 12 - - { "b25-07.bin", 0x04000, 0x50e329e0, 4 | BRF_GRA }, // 13 Text characters - { "b25-06.bin", 0x04000, 0x3bfeb6ae, 4 | BRF_GRA }, // 14 - { "b25-05.bin", 0x04000, 0xbe36a53e, 4 | BRF_GRA }, // 15 - - { "b25-12.rom", 0x08000, 0x15d08848, 5 | BRF_GRA }, // 16 Background tiles - { "b25-15.rom", 0x08000, 0xcdd2d408, 5 | BRF_GRA }, // 17 - { "b25-14.rom", 0x08000, 0x5a2aef4f, 5 | BRF_GRA }, // 18 - { "b25-13.rom", 0x08000, 0xbe21db2b, 5 | BRF_GRA }, // 19 - - { "b25-08.rom", 0x08000, 0x883ccaa3, 6 | BRF_GRA }, // 20 Foreground tiles - { "b25-11.rom", 0x08000, 0xd6ebd510, 6 | BRF_GRA }, // 21 - { "b25-10.rom", 0x08000, 0xb9a61e81, 6 | BRF_GRA }, // 22 - { "b25-09.rom", 0x08000, 0x585411b7, 6 | BRF_GRA }, // 23 - - { "b25-01.rom", 0x10000, 0x42ec01fb, 7 | BRF_GRA }, // 24 Sprites - { "b25-02.rom", 0x10000, 0x6c0130b7, 7 | BRF_GRA }, // 25 - { "b25-03.rom", 0x10000, 0xb923db99, 7 | BRF_GRA }, // 26 - { "b25-04.rom", 0x10000, 0x8059573c, 7 | BRF_GRA }, // 27 - - { "82s129.b19", 0x00100, 0x24e7d62f, 8 | BRF_GRA }, // 28 Proms (not used) - { "82s129.b18", 0x00100, 0xa50cef09, 8 | BRF_GRA }, // 29 - { "82s123.b21", 0x00020, 0xf72482db, 8 | BRF_GRA }, // 30 - { "82s123.c6", 0x00020, 0xbc88cced, 8 | BRF_GRA }, // 31 - { "82s123.f1", 0x00020, 0x4fb5df2a, 8 | BRF_GRA }, // 32 -}; - -STD_ROM_PICK(wardnerj) -STD_ROM_FN(wardnerj) - -struct BurnDriver BurnDrvWardnerj = { - "wardnerj", "wardner", NULL, NULL, "1987", - "Wardner no Mori (Japan)\0", NULL, "Toaplan / Taito Corporation", "Miscellaneous", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_TOAPLAN_MISC, GBF_PLATFORM, 0, - NULL, wardnerjRomInfo, wardnerjRomName, NULL, NULL, WardnerInputInfo, WardnerjDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/toaplan/d_zerowing.cpp b/jan/src/burn/drv/toaplan/d_zerowing.cpp deleted file mode 100644 index 713c84d79..000000000 --- a/jan/src/burn/drv/toaplan/d_zerowing.cpp +++ /dev/null @@ -1,794 +0,0 @@ -// Zero Wing -// Based on MAME driver by Darren Olafson, Quench,Stephane Humbert -#include "toaplan.h" - -#define REFRESHRATE 60 -#define VBLANK_LINES (32) - -static UINT8 DrvButton[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy1[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvJoy2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static UINT8 DrvReset = 0; -static UINT8 bDrawScreen; -static bool bVBlank; - -static bool bEnableInterrupts; - -// Rom information -static struct BurnRomInfo zerowingRomDesc[] = { - { "o15-11ii.bin", 0x008000, 0xe697ecb9, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "o15-12ii.bin", 0x008000, 0xb29ee3ad, BRF_ESS | BRF_PRG }, // 1 - { "o15-09.rom", 0x020000, 0x13764e95, BRF_ESS | BRF_PRG }, // 1 - { "o15-10.rom", 0x020000, 0x351ba71a, BRF_ESS | BRF_PRG }, // 1 - - { "o15-05.rom", 0x020000, 0x4e5dd246, BRF_GRA }, // 6 - { "o15-06.rom", 0x020000, 0xc8c6d428, BRF_GRA }, // 7 - { "o15-07.rom", 0x020000, 0xefc40e99, BRF_GRA }, // 8 - { "o15-08.rom", 0x020000, 0x1b019eab, BRF_GRA }, // 9 - - { "o15-03.rom", 0x020000, 0x7f245fd3, BRF_GRA }, // 2 - { "o15-04.rom", 0x020000, 0x0b1a1289, BRF_GRA }, // 3 - { "o15-01.rom", 0x020000, 0x70570e43, BRF_GRA }, // 4 - { "o15-02.rom", 0x020000, 0x724b487f, BRF_GRA }, // 5 - - { "o15-13.rom", 0x008000, 0xe7b72383, BRF_ESS | BRF_PRG }, // 10 Z80 program - - { "tp015_14.bpr", 0x000020, 0xbc88cced, BRF_SND }, // 11 Sprite attribute PROM - { "tp015_15.bpr", 0x000020, 0xa1e17492, BRF_SND }, // 12 ??? -}; - - -STD_ROM_PICK(zerowing) -STD_ROM_FN(zerowing) - -static struct BurnRomInfo zerowing1RomDesc[] = { - { "o15-11.rom", 0x008000, 0x6ff2b9a0, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "o15-12.rom", 0x008000, 0x9773e60b, BRF_ESS | BRF_PRG }, // 1 - { "o15-09.rom", 0x020000, 0x13764e95, BRF_ESS | BRF_PRG }, // 1 - { "o15-10.rom", 0x020000, 0x351ba71a, BRF_ESS | BRF_PRG }, // 1 - - { "o15-05.rom", 0x020000, 0x4e5dd246, BRF_GRA }, // 6 - { "o15-06.rom", 0x020000, 0xc8c6d428, BRF_GRA }, // 7 - { "o15-07.rom", 0x020000, 0xefc40e99, BRF_GRA }, // 8 - { "o15-08.rom", 0x020000, 0x1b019eab, BRF_GRA }, // 9 - - { "o15-03.rom", 0x020000, 0x7f245fd3, BRF_GRA }, // 2 - { "o15-04.rom", 0x020000, 0x0b1a1289, BRF_GRA }, // 3 - { "o15-01.rom", 0x020000, 0x70570e43, BRF_GRA }, // 4 - { "o15-02.rom", 0x020000, 0x724b487f, BRF_GRA }, // 5 - - { "o15-13.rom", 0x008000, 0xe7b72383, BRF_ESS | BRF_PRG }, // 10 Z80 program - - { "tp015_14.bpr", 0x000020, 0xbc88cced, BRF_SND }, // 11 Sprite attribute PROM - { "tp015_15.bpr", 0x000020, 0xa1e17492, BRF_SND }, // 12 ??? -}; - - -STD_ROM_PICK(zerowing1) -STD_ROM_FN(zerowing1) - -static struct BurnRomInfo zerowingwRomDesc[] = { - { "o15-11iiw.bin",0x008000, 0x38b0bb5b, BRF_ESS | BRF_PRG }, // 0 CPU #0 code - { "o15-12iiw.bin",0x008000, 0x74c91e6f, BRF_ESS | BRF_PRG }, // 1 - { "o15-09.rom", 0x020000, 0x13764e95, BRF_ESS | BRF_PRG }, // 1 - { "o15-10.rom", 0x020000, 0x351ba71a, BRF_ESS | BRF_PRG }, // 1 - - { "o15-05.rom", 0x020000, 0x4e5dd246, BRF_GRA }, // 6 - { "o15-06.rom", 0x020000, 0xc8c6d428, BRF_GRA }, // 7 - { "o15-07.rom", 0x020000, 0xefc40e99, BRF_GRA }, // 8 - { "o15-08.rom", 0x020000, 0x1b019eab, BRF_GRA }, // 9 - - { "o15-03.rom", 0x020000, 0x7f245fd3, BRF_GRA }, // 2 - { "o15-04.rom", 0x020000, 0x0b1a1289, BRF_GRA }, // 3 - { "o15-01.rom", 0x020000, 0x70570e43, BRF_GRA }, // 4 - { "o15-02.rom", 0x020000, 0x724b487f, BRF_GRA }, // 5 - - { "o15-13.rom", 0x008000, 0xe7b72383, BRF_ESS | BRF_PRG }, // 10 Z80 program - - { "tp015_14.bpr", 0x000020, 0xbc88cced, BRF_SND }, // 11 Sprite attribute PROM - { "tp015_15.bpr", 0x000020, 0xa1e17492, BRF_SND }, // 12 ??? -}; - - -STD_ROM_PICK(zerowingw) -STD_ROM_FN(zerowingw) - -static struct BurnInputInfo zerowingInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvButton + 3, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvButton + 5, "p1 start"}, - - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvButton + 4, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvButton + 6, "p2 start"}, - - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Diagnostics", BIT_DIGITAL, DrvButton + 0, "diag"}, - {"Dip A", BIT_DIPSWITCH, DrvInput + 2, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvInput + 3, "dip"}, - {"Dip C", BIT_DIPSWITCH, DrvInput + 5, "dip"}, -}; - -STDINPUTINFO(zerowing) - -static struct BurnDIPInfo zerowingDIPList[] = { - // Defaults - {0x12, 0xFF, 0xFF, 0x01, NULL}, - {0x13, 0xFF, 0xFF, 0x00, NULL}, - {0x14, 0xFF, 0xFF, 0x02, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Cabinet type"}, - {0x12, 0x01, 0x01, 0x01, "Upright"}, - {0x12, 0x01, 0x01, 0x00, "Cocktail"}, - {0, 0xFE, 0, 2, "Screen type"}, - {0x12, 0x01, 0x02, 0x00, "Normal screen"}, - {0x12, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x12, 0x01, 0x04, 0x00, "Normal mode"}, - {0x12, 0x01, 0x04, 0x04, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x12, 0x01, 0x08, 0x00, "On"}, - {0x12, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x12, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x12, 0x01, 0x30, 0x10, "2 coin 1 play"}, - {0x12, 0x01, 0x30, 0x20, "3 coin 1 play"}, - {0x12, 0x01, 0x30, 0x30, "4 coin 1 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x12, 0x01, 0xC0, 0x00, "1 coin 2 play"}, - {0x12, 0x01, 0xC0, 0x40, "1 coin 3 play"}, - {0x12, 0x01, 0xC0, 0x80, "1 coin 4 play"}, - {0x12, 0x01, 0xC0, 0xC0, "1 coin 6 play"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x13, 0x01, 0x03, 0x00, "B"}, - {0x13, 0x01, 0x03, 0x01, "A"}, - {0x13, 0x01, 0x03, 0x02, "C"}, - {0x13, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x13, 0x01, 0x0C, 0x00, "200000, every 500000"}, - {0x13, 0x01, 0x0C, 0x04, "500000, every 1000000"}, - {0x13, 0x01, 0x0C, 0x08, "500000 only"}, - {0x13, 0x01, 0x0C, 0x0C, "Never"}, - {0, 0xFE, 0, 4, "Hero counts"}, - {0x13, 0x01, 0x30, 0x30, "2"}, - {0x13, 0x01, 0x30, 0x00, "3"}, - {0x13, 0x01, 0x30, 0x20, "4"}, - {0x13, 0x01, 0x30, 0x10, "5"}, - {0, 0xFE, 0, 2, "Cheating"}, - {0x13, 0x01, 0x40, 0x00, "Normal Game"}, - {0x13, 0x01, 0x40, 0x40, "No death & stop mode"}, - {0, 0xFE, 0, 2, "Allow Continue"}, - {0x13, 0x01, 0x80, 0x00, "Yes"}, - {0x13, 0x01, 0x80, 0x80, "No"}, - - // Region - {0, 0xFE, 0, 3, "Region"}, - {0x14, 0x01, 0x03, 0x00, "Japan"}, - {0x14, 0x01, 0x03, 0x01, "US"}, - {0x14, 0x01, 0x03, 0x02, "Europe"}, -}; - -STDDIPINFO(zerowing) - -static struct BurnDIPInfo zerowing2DIPList[] = { - // Defaults - {0x12, 0xFF, 0xFF, 0x01, NULL}, - {0x13, 0xFF, 0xFF, 0x00, NULL}, - {0x14, 0xFF, 0xFF, 0x00, NULL}, - - // DIP 1 - {0, 0xFE, 0, 2, "Cabinet type"}, - {0x12, 0x01, 0x01, 0x01, "Upright"}, - {0x12, 0x01, 0x01, 0x00, "Cocktail"}, - {0, 0xFE, 0, 2, "Screen type"}, - {0x12, 0x01, 0x02, 0x00, "Normal screen"}, - {0x12, 0x01, 0x02, 0x02, "Invert screen"}, - {0, 0xFE, 0, 2, "Service"}, - {0x12, 0x01, 0x04, 0x00, "Normal mode"}, - {0x12, 0x01, 0x04, 0x04, "Screen test mode"}, - {0, 0xFE, 0, 2, "Advertise sound"}, - {0x12, 0x01, 0x08, 0x00, "On"}, - {0x12, 0x01, 0x08, 0x08, "Off"}, - {0, 0xFE, 0, 4, "Coin A"}, - {0x12, 0x01, 0x30, 0x00, "1 coin 1 play"}, - {0x12, 0x01, 0x30, 0x10, "2 coin 1 play"}, - {0x12, 0x01, 0x30, 0x20, "3 coin 1 play"}, - {0x12, 0x01, 0x30, 0x30, "4 coin 1 play"}, - {0, 0xFE, 0, 4, "Coin B"}, - {0x12, 0x01, 0xC0, 0x00, "1 coin 2 play"}, - {0x12, 0x01, 0xC0, 0x40, "1 coin 3 play"}, - {0x12, 0x01, 0xC0, 0x80, "1 coin 4 play"}, - {0x12, 0x01, 0xC0, 0xC0, "1 coin 6 play"}, - - // DIP 2 - {0, 0xFE, 0, 4, "Game difficulty"}, - {0x13, 0x01, 0x03, 0x00, "B"}, - {0x13, 0x01, 0x03, 0x01, "A"}, - {0x13, 0x01, 0x03, 0x02, "C"}, - {0x13, 0x01, 0x03, 0x03, "D"}, - {0, 0xFE, 0, 4, "Extend bonus"}, - {0x13, 0x01, 0x0C, 0x00, "200000, every 500000"}, - {0x13, 0x01, 0x0C, 0x04, "500000, every 1000000"}, - {0x13, 0x01, 0x0C, 0x08, "500000 only"}, - {0x13, 0x01, 0x0C, 0x0C, "Never"}, - {0, 0xFE, 0, 4, "Hero counts"}, - {0x13, 0x01, 0x30, 0x30, "2"}, - {0x13, 0x01, 0x30, 0x00, "3"}, - {0x13, 0x01, 0x30, 0x20, "4"}, - {0x13, 0x01, 0x30, 0x10, "5"}, - {0, 0xFE, 0, 2, "Cheating"}, - {0x13, 0x01, 0x40, 0x00, "Normal Game"}, - {0x13, 0x01, 0x40, 0x40, "No death & stop mode"}, - {0, 0xFE, 0, 2, "Allow Continue"}, - {0x13, 0x01, 0x80, 0x00, "Yes"}, - {0x13, 0x01, 0x80, 0x80, "No"}, -}; - -STDDIPINFO(zerowing2) - -static UINT8 *Mem = NULL, *MemEnd = NULL; -static UINT8 *RamStart, *RamEnd; -static UINT8 *Rom01; -static UINT8 *Ram01, *RamPal, *RamPal2; - -static INT32 nColCount = 0x0400; - -// This routine is called first to determine how much memory is needed (MemEnd-(UINT8 *)0), -// and then afterwards to set up all the pointers -static INT32 MemIndex() -{ - UINT8 *Next; Next = Mem; - Rom01 = Next; Next += 0x080000; // - RomZ80 = Next; Next += 0x008000; // Z80 ROM - BCU2ROM = Next; Next += nBCU2ROMSize; // BCU-2 tile data - FCU2ROM = Next; Next += nFCU2ROMSize; // FCU-2 tile data - RamStart = Next; - Ram01 = Next; Next += 0x008000; // CPU #0 work RAM - RamPal = Next; Next += 0x001000; // palette - RamPal2 = Next; Next += 0x001000; // palette - RamZ80 = Next; Next += 0x008000; // Z80 RAM - BCU2RAM = Next; Next += 0x010000; - FCU2RAM = Next; Next += 0x000800; - FCU2RAMSize = Next; Next += 0x000080; - RamEnd = Next; - ToaPalette = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - ToaPalette2 = (UINT32 *)Next; Next += nColCount * sizeof(UINT32); - MemEnd = Next; - - return 0; -} - -// Scan ram -static INT32 DrvScan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - - if (pnMin != NULL) { // Return minimum compatible version - *pnMin = 0x029402; - } - if (nAction & ACB_VOLATILE) { // Scan volatile ram - memset(&ba, 0, sizeof(ba)); - ba.Data = RamStart; - ba.nLen = RamEnd - RamStart; - ba.szName = "RAM"; - BurnAcb(&ba); - - SekScan(nAction); // scan 68000 states - ZetScan(nAction); // Scan Z80 - - BurnYM3812Scan(nAction, pnMin); - - SCAN_VAR(DrvInput); - SCAN_VAR(nCyclesDone); - } - - return 0; -} - -static INT32 LoadRoms() -{ - // Load 68000 ROM - ToaLoadCode(Rom01, 0, 2); - BurnLoadRom(Rom01 + 0x40001, 2, 2); - BurnLoadRom(Rom01 + 0x40000, 3, 2); - - // Load BCU-2 tile data - ToaLoadTiles(BCU2ROM, 4, nBCU2ROMSize); - - // Load FCU-2 tile data - ToaLoadTiles(FCU2ROM, 8, nFCU2ROMSize); - - // Load the Z80 ROM - BurnLoadRom(RomZ80, 12, 1); - - return 0; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall zerowingZ80In(UINT16 nAddress) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0xa8: - return BurnYM3812Read(0, 0); - case 0x20: // DIP A - return DrvInput[2]; - case 0x28: // DIP B - return DrvInput[3]; - case 0x80: // Sysytem inputs - return DrvInput[4] | (ToaVBlankRegister() << 7); - case 0x00: // Player 1 - return DrvInput[0]; - case 0x08: // Player 2 - return DrvInput[1]; - case 0x88: // Region - return DrvInput[5]; - - } - -// bprintf(PRINT_NORMAL, _T("z80 read %4X\n"), nAddress); - - return 0; -} - -void __fastcall zerowingZ80Out(UINT16 nAddress, UINT8 nValue) -{ - nAddress &= 0xFF; - - switch (nAddress) { - case 0xa8: - BurnYM3812Write(0, 0, nValue); - break; - case 0xa9: - BurnYM3812Write(0, 1, nValue); - break; - - case 0xa0: // Coin counter - break; - -// default: -// bprintf(PRINT_NORMAL, _T("Z80 attempted to write address %04X with value %02X.\n"), nAddress, nValue); - } -} - -static INT32 DrvZ80Init() -{ - // Init the Z80 - ZetInit(0); - ZetOpen(0); - - ZetSetInHandler(zerowingZ80In); - ZetSetOutHandler(zerowingZ80Out); - - // ROM - ZetMapArea (0x0000, 0x7FFF, 0, RomZ80); // Direct Read from ROM - ZetMapArea (0x0000, 0x7FFF, 2, RomZ80); // Direct Fetch from ROM - // RAM - ZetMapArea (0x8000, 0xFFFF, 0, RamZ80); // Direct Read from RAM - ZetMapArea (0x8000, 0xFFFF, 1, RamZ80); // Direct Write to RAM - ZetMapArea (0x8000, 0xFFFF, 2, RamZ80); // - - - ZetClose(); - - return 0; -} - -// ---------------------------------------------------------------------------- - -UINT8 __fastcall zerowingReadByte(UINT32 sekAddress) -{ - switch (sekAddress) { - case 0x400001: - case 0x4c0001: - return ToaVBlankRegister(); - - default: { -// bprintf(PRINT_NORMAL, _T("Read Byte %06X.\n"), sekAddress); - } - } - - return 0; -} - -UINT16 __fastcall zerowingReadWord(UINT32 sekAddress) -{ - switch (sekAddress) { - - case 0x4c0002: - return ToaFCU2GetRAMPointer(); - case 0x4c0004: - return ToaFCU2ReadRAM(); - case 0x4c0006: - return ToaFCU2ReadRAMSize(); - - case 0x480002: - return ToaBCU2GetRAMPointer(); - case 0x480004: - return ToaBCU2ReadRAM_Hi(); - case 0x480006: - return ToaBCU2ReadRAM_Lo(); - - case 0x480010: - case 0x480011: - case 0x480012: - case 0x480013: - case 0x480014: - case 0x480015: - case 0x480016: - case 0x480017: - case 0x480018: - case 0x480019: - case 0x48001A: - case 0x48001B: - case 0x48001C: - case 0x48001D: - case 0x48001E: - case 0x48001F: - return BCU2Reg[(sekAddress & 15) >> 1]; - - case 0x400000: - case 0x4c0000: - return ToaVBlankRegister(); - - default: { -// bprintf(PRINT_NORMAL, _T("Read Word %06X.\n"), sekAddress); - } - } - - return 0; -} - -void __fastcall zerowingWriteByte(UINT32 sekAddress, UINT8 byteValue) -{ - switch (sekAddress) { - - case 0x400003: - bEnableInterrupts = byteValue; - break; - - case 0x4c0006: - ToaFCU2WriteRAMSize(byteValue); - break; - - default: { -// bprintf(PRINT_NORMAL, _T("Write byte %06X, %02X.\n"), sekAddress, byteValue); - } - } -} - -void __fastcall zerowingWriteWord(UINT32 sekAddress, UINT16 wordValue) -{ - switch (sekAddress) { - - case 0x4c0002: // FCU-2 set VRAM address-pointer - ToaFCU2SetRAMPointer(wordValue); - break; - case 0x4c0004: - ToaFCU2WriteRAM(wordValue); - break; - case 0x4c0006: - ToaFCU2WriteRAMSize(wordValue); - break; - - case 0x480000: // BCU-2 flip - break; - case 0x480002: // BCU-2 set VRAM address-pointer - ToaBCU2SetRAMPointer(wordValue); - break; - case 0x480004: - ToaBCU2WriteRAM(wordValue); - break; - case 0x480006: - ToaBCU2WriteRAM(wordValue); - break; - - case 0x480010: - case 0x480011: - case 0x480012: - case 0x480013: - case 0x480014: - case 0x480015: - case 0x480016: - case 0x480017: - case 0x480018: - case 0x480019: - case 0x48001A: - case 0x48001B: - case 0x48001C: - case 0x48001D: - case 0x48001E: - case 0x48001F: - BCU2Reg[(sekAddress & 15) >> 1] = wordValue; - break; - - case 0x400002: - bEnableInterrupts = (wordValue & 0xFF); - break; - - case 0x0c0000: - nBCU2TileXOffset = wordValue; - break; - case 0x0c0002: - nBCU2TileYOffset = wordValue; - break; - - case 0x0c0006: // FCU-2 flip - break; - - default: { -// bprintf(PRINT_NORMAL, _T("Write word %06X, %04X.\n"), sekAddress, wordValue); - } - } -} - -// ---------------------------------------------------------------------------- - -static INT32 DrvDoReset() -{ - SekOpen(0); - SekReset(); - SekClose(); - ZetOpen(0); - ZetReset(); - ZetClose(); - - BurnYM3812Reset(); - - bEnableInterrupts = false; - - HiscoreReset(); - - return 0; -} - -static INT32 DrvInit() -{ - INT32 nLen; - - Hellfire = 1; - -#ifdef DRIVER_ROTATION - bToaRotateScreen = true; -#endif - - BurnSetRefreshRate(REFRESHRATE); - - nBCU2ROMSize = 0x080000; - nFCU2ROMSize = 0x080000; - - // Find out how much memory is needed - Mem = NULL; - MemIndex(); - nLen = MemEnd - (UINT8 *)0; - if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) { - return 1; - } - memset(Mem, 0, nLen); // blank all memory - MemIndex(); // Index the allocated memory - - // Load the roms into memory - if (LoadRoms()) { - return 1; - } - - { - SekInit(0, 0x68000); // Allocate 68000 - SekOpen(0); - - // Map 68000 memory: - SekMapMemory(Rom01, 0x000000, 0x00FFFF, MAP_ROM); // 68K ROM - SekMapMemory(Rom01 + 0x040000, 0x040000, 0x07FFFF, MAP_ROM); // 68K ROM - SekMapMemory(Ram01, 0x080000, 0x087FFF, MAP_RAM); // 68K RAM - SekMapMemory(RamPal, 0x404000, 0x4047FF, MAP_RAM); // BCU-2 palette RAM - SekMapMemory(RamPal2, 0x406000, 0x4067FF, MAP_RAM); // FCU-2 palette RAM - - SekSetReadWordHandler(0, zerowingReadWord); - SekSetReadByteHandler(0, zerowingReadByte); - SekSetWriteWordHandler(0, zerowingWriteWord); - SekSetWriteByteHandler(0, zerowingWriteByte); - - SekMapHandler(1, 0x440000, 0x440FFF, MAP_RAM); // Z80 RAM - - SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM); - SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM); - SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM); - SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM); - - SekClose(); - } - - ToaInitBCU2(); - - DrvZ80Init(); // Initialize Z80 - - nToaPalLen = nColCount; - ToaPalSrc = RamPal; - ToaPalSrc2 = RamPal2; - ToaPalInit(); - - BurnYM3812Init(1, 28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0); - BurnTimerAttachZetYM3812(28000000 / 8); - BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - - bDrawScreen = true; - - DrvDoReset(); // Reset machine - return 0; -} - -static INT32 DrvExit() -{ - BurnYM3812Exit(); - ToaPalExit(); - - ToaExitBCU2(); - ToaZExit(); // Z80 exit - SekExit(); // Deallocate 68000s - - BurnFree(Mem); - - Hellfire = 0; - - return 0; -} - -static INT32 DrvDraw() -{ - ToaClearScreen(0x120); -// BurnClearScreen(); - - if (bDrawScreen) { - ToaGetBitmap(); - ToaRenderBCU2(); // Render BCU2 graphics - } - - ToaPalUpdate(); // Update the palette - ToaPal2Update(); - - return 0; -} - -inline static INT32 CheckSleep(INT32) -{ - return 0; -} - -static INT32 DrvFrame() -{ - INT32 nInterleave = 4; - - if (DrvReset) { // Reset machine - DrvDoReset(); - } - - // Compile digital inputs - DrvInput[0] = 0x00; // Buttons - DrvInput[1] = 0x00; // Player 1 - DrvInput[4] = 0x00; // Player 2 - for (INT32 i = 0; i < 8; i++) { - DrvInput[0] |= (DrvJoy1[i] & 1) << i; - DrvInput[1] |= (DrvJoy2[i] & 1) << i; - DrvInput[4] |= (DrvButton[i] & 1) << i; - } - ToaClearOpposites(&DrvInput[0]); - ToaClearOpposites(&DrvInput[1]); - - SekOpen(0); - ZetOpen(0); - - SekNewFrame(); - ZetNewFrame(); - - SekIdle(nCyclesDone[0]); - ZetIdle(nCyclesDone[1]); - - nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE)); - nCyclesTotal[1] = INT32(28000000.0 / 8 / REFRESHRATE); - - SekSetCyclesScanline(nCyclesTotal[0] / 262); - nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262); - nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262); - bVBlank = false; - - for (INT32 i = 0; i < nInterleave; i++) { - INT32 nNext; - - // Run 68000 - - nNext = (i + 1) * nCyclesTotal[0] / nInterleave; - - // Trigger VBlank interrupt - if (nNext > nToaCyclesVBlankStart) { - if (SekTotalCycles() < nToaCyclesVBlankStart) { - nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles(); - SekRun(nCyclesSegment); - } - - if (pBurnDraw) { - DrvDraw(); // Draw screen if needed - } - - ToaBufferFCU2Sprites(); - - bVBlank = true; - if (bEnableInterrupts) { - SekSetIRQLine(4, CPU_IRQSTATUS_AUTO); - } - } - - nCyclesSegment = nNext - SekTotalCycles(); - if (bVBlank || (!CheckSleep(0))) { // See if this CPU is busywaiting - SekRun(nCyclesSegment); - } else { - SekIdle(nCyclesSegment); - } - - BurnTimerUpdateYM3812(i * (nCyclesTotal[1] / nInterleave)); - } - - nToa1Cycles68KSync = SekTotalCycles(); - BurnTimerEndFrameYM3812(nCyclesTotal[1]); - if (pBurnSoundOut) BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - - nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0]; - nCyclesDone[1] = ZetTotalCycles() - nCyclesTotal[1]; - -// bprintf(PRINT_NORMAL, _T(" %i\n"), nCyclesDone[0]); - - ZetClose(); - SekClose(); - -// ToaBufferFCU2Sprites(); - - return 0; -} - -struct BurnDriver BurnDrvZerowing = { - "zerowing", NULL, NULL, NULL, "1989", - "Zero Wing (2P set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_HORSHOOT, 0, - NULL, zerowingRomInfo, zerowingRomName, NULL, NULL, zerowingInputInfo, zerowing2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvZerowing1 = { - "zerowing1", "zerowing", NULL, NULL, "1989", - "Zero Wing (1P set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_HORSHOOT, 0, - NULL, zerowing1RomInfo, zerowing1RomName, NULL, NULL, zerowingInputInfo, zerowingDIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 320, 240, 4, 3 -}; - -struct BurnDriver BurnDrvZerowingw = { - "zerowingw", "zerowing", NULL, NULL, "1989", - "Zero Wing (2P set, Williams Electronics)\0", NULL, "Toaplan / Williams Electronics", "Toaplan BCU-2 / FCU-2 based", - NULL, NULL, NULL, NULL, - BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_HORSHOOT, 0, - NULL, zerowingwRomInfo, zerowingwRomName, NULL, NULL, zerowingInputInfo, zerowing2DIPInfo, - DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &ToaRecalcPalette, 0x400, - 320, 240, 4, 3 -}; diff --git a/jan/src/burn/drv/toaplan/toa_bcu2.cpp b/jan/src/burn/drv/toaplan/toa_bcu2.cpp deleted file mode 100644 index 57c7f47f4..000000000 --- a/jan/src/burn/drv/toaplan/toa_bcu2.cpp +++ /dev/null @@ -1,473 +0,0 @@ -#include "toaplan.h" - -INT32 ToaOpaquePriority; - -static UINT8* pTile; -static UINT32* pTileData; -static UINT32* pTilePalette; - -INT32 Rallybik = 0; -INT32 Hellfire = 0; - -typedef void (*RenderTileFunction)(); -static RenderTileFunction* RenderTile; - -static INT32 nTileXPos, nTileYPos; - -// Include the tile rendering functions -#include "toa_gp9001_func.h" - -static INT32 nLastBPP = 0; - -struct ToaTile { - UINT32 nTileAttrib; - INT16 nTileXPos; - INT16 nTileYPos; -}; - -extern UINT32* ToaPalette2; - -// ---------------------------------------------------------------------------- -// Rally Bike custom sprite function - -static void rallybik_draw_sprites(INT32 priority) -{ - UINT16 *sprite = (UINT16*)FCU2RAM; - - for (INT32 offs = 0; offs < (0x1000/2); offs += 4) - { - INT32 attrib = sprite[offs + 1]; - - if ((attrib & 0x0c00) == priority) - { - INT32 sy = (sprite[offs + 3] >> 7) & 0x1ff; - - if (sy != 0x0100) - { - INT32 code = sprite[offs] & 0x7ff; - INT32 color = attrib & 0x3f; - INT32 sx = (sprite[offs + 2] >> 7) & 0x1ff; - INT32 flipx = attrib & 0x100; - INT32 flipy = attrib & 0x200; - if (flipx) sx -= 15; - - sx -= 31; - sy -= 16; - - if (sy < -15 || sx < -15 || sy >= 240 || sx >= 320) continue; - - { - INT32 flip = 0; - if (flipx) flip |= 0x0f; - if (flipy) flip |= 0xf0; - UINT8 *gfx = FCU2ROM + (code * 0x100); - - pTilePalette = &ToaPalette2[color << 4]; - - for (INT32 y = 0; y < 16; y++, sy++) { - if (sy < 0 || sy >= 240) continue; - - for (INT32 x = 0; x < 16; x++, sx++) { - if (sx < 0 || sx >= 320) continue; - - INT32 pxl = gfx[((y * 16) + x) ^ flip]; - - if (pxl) { - PutPix(pBurnDraw + ((sy * 320) + sx) * nBurnBpp, pTilePalette[pxl]); - } - } - sx -= 16; - } - } - } - } - } -} - - -// ---------------------------------------------------------------------------- -// FCU-2 functions - -UINT8* FCU2ROM; -UINT32 nFCU2ROMSize; -static UINT8* FCU2TileAttrib; - -static UINT32 nFCU2MaxSprite; - -UINT8* FCU2RAM; -UINT8* FCU2RAMSize; -UINT32 FCU2Pointer; - -static UINT8* pFCU2SpriteBuffer; - -static UINT16** pFCU2SpriteQueue[16]; -static UINT16** pFCU2SpriteQueueData = NULL; - -INT32 nFCU2SpriteXOffset = 0, nFCU2SpriteYOffset = 0; - -static void FCU2PrepareSprites() -{ - UINT16* pSpriteInfo; - INT32 nSprite; - - for (INT32 nPriority = 0; nPriority < 16; nPriority++) { - pFCU2SpriteQueue[nPriority] = &pFCU2SpriteQueueData[(nPriority << 8) + nPriority]; - } - - for (nSprite = 0, pSpriteInfo = (UINT16*)pFCU2SpriteBuffer; nSprite < 0x0100; nSprite++, pSpriteInfo += 4) { - if (!(pSpriteInfo[0] & 0x8000)) { // Sprite is enabled - *pFCU2SpriteQueue[pSpriteInfo[1] >> 12]++ = pSpriteInfo; - } - } -} - -static void FCU2RenderSpriteQueue(INT32 nPriority) -{ - UINT16* pSpriteInfo; - UINT8* pSpriteData; - INT32 nSpriteXPos, nSpriteYPos; - INT32 nSpriteXSize, nSpriteYSize; - UINT32 nSpriteNumber; - INT32 x, y, s; - - *pFCU2SpriteQueue[nPriority] = NULL; - pFCU2SpriteQueue[nPriority] = &pFCU2SpriteQueueData[(nPriority << 8) + nPriority]; - - while ((pSpriteInfo = *pFCU2SpriteQueue[nPriority]++) != NULL) { - - pTilePalette = &ToaPalette2[(pSpriteInfo[1] & 0x3F) << 4]; - nSpriteNumber = pSpriteInfo[0] & nFCU2MaxSprite; - - pSpriteData = FCU2ROM + (nSpriteNumber << 5); - - s = (pSpriteInfo[1] & 0x0FC0) >> 6; - - nSpriteXSize = ((((UINT16*)FCU2RAMSize)[s] >> 0) & 0x0F); - nSpriteYSize = ((((UINT16*)FCU2RAMSize)[s] >> 4) & 0x0F); - - nSpriteXPos = (pSpriteInfo[2] >> 7) + nFCU2SpriteXOffset; - nSpriteXPos &= 0x01FF; - nSpriteYPos = (pSpriteInfo[3] >> 7) + nFCU2SpriteYOffset; - nSpriteYPos &= 0x01FF; - - if (Hellfire) nSpriteYPos -= 16; - - if (nSpriteXPos > 384) { - nSpriteXPos -= 0x0200; - } - if (nSpriteYPos > 384) { - nSpriteYPos -= 0x0200; - } - -// if (nSpriteNumber) { -// printf("Sprite\t0x%04X\n", nSpriteNumber); -// printf("xp: %4i, yp: %4i\n", nSpriteXPos, nSpriteYPos); -// printf("xs: %4i, ys: %4i\n", nSpriteXSize, nSpriteYSize); -// } - - for (y = 0, nTileYPos = nSpriteYPos; y < nSpriteYSize; y++, nTileYPos += 8) { - for (x = 0, nTileXPos = nSpriteXPos; x < nSpriteXSize; x++, nTileXPos += 8, nSpriteNumber++, pSpriteData += 32) { - if (nSpriteNumber > nFCU2MaxSprite) { - break; - } - if (FCU2TileAttrib[nSpriteNumber]) { - // Skip tile if it's completely off the screen - if (!(nTileXPos <= -8 || nTileXPos >= 320 || nTileYPos <= -8 || nTileYPos >= 240)) { - pTileData = (UINT32*)pSpriteData; - pTile = pBurnBitmap + (nTileXPos * nBurnColumn) + (nTileYPos * nBurnRow); - if (nTileXPos < 0 || nTileXPos > 312 || nTileYPos < 0 || nTileYPos > 232) { - RenderTile[1](); - } else { - RenderTile[0](); - } - } - } - } - } - } -} - -// ---------------------------------------------------------------------------- -// BCU-2 functions - -UINT8* BCU2ROM; -UINT32 nBCU2ROMSize; -static UINT8* BCU2TileAttrib; - -static UINT32 nBCU2MaxTile; - -UINT8* BCU2RAM; - -UINT16 BCU2Reg[8]; - -UINT32 BCU2Pointer; - -static ToaTile* pBCU2TileQueue[16]; -static ToaTile* pBCU2TileQueueData = NULL; - -INT32 nBCU2TileXOffset = 0, nBCU2TileYOffset = 0; - -static void BCU2QueueLayer(UINT16* pTilemap, INT32 nXPos, INT32 nYPos) -{ - if (Hellfire) nYPos += 16; - - INT32 x, y; - INT32 nTileRow, nTileColumn; - UINT32 nTileNumber, nTileAttrib; - - for (y = 0; y < 31; y++) { - - nTileRow = (((nYPos >> 3) + y) << 7) & 0x1F80; - - for (x = 0; x < 41; x++) { - nTileColumn = (((nXPos >> 3) + x) << 1) & 0x7E; - nTileNumber = pTilemap[nTileRow + nTileColumn + 1]; - nTileAttrib = pTilemap[nTileRow + nTileColumn]; - - // Rallybik uses hidden tiles to do the background fades on the titlescreen. - if ((!(nTileNumber & 0x8000) && (nTileAttrib & 0xF000)) || Rallybik) { - pBCU2TileQueue[nTileAttrib >> 12]->nTileAttrib = (nTileAttrib << 16) | nTileNumber; - pBCU2TileQueue[nTileAttrib >> 12]->nTileXPos = (x << 3) - (nXPos & 7); - pBCU2TileQueue[nTileAttrib >> 12]->nTileYPos = (y << 3) - (nYPos & 7); - pBCU2TileQueue[nTileAttrib >> 12]++; - } - } - } -} - -static void BCU2PrepareTiles() -{ - for (INT32 nPriority = 0; nPriority < 16; nPriority++) { - pBCU2TileQueue[nPriority] = &pBCU2TileQueueData[nPriority * 1280 * 4]; - } - - BCU2QueueLayer((UINT16*)(BCU2RAM + 0xC000), (BCU2Reg[6] >> 7) - nBCU2TileXOffset + nLayer3XOffset, (BCU2Reg[7] >> 7) - nBCU2TileYOffset + nLayer3YOffset); - BCU2QueueLayer((UINT16*)(BCU2RAM + 0x8000), (BCU2Reg[4] >> 7) - nBCU2TileXOffset + nLayer2XOffset, (BCU2Reg[5] >> 7) - nBCU2TileYOffset + nLayer2YOffset); - BCU2QueueLayer((UINT16*)(BCU2RAM + 0x4000), (BCU2Reg[2] >> 7) - nBCU2TileXOffset + nLayer1XOffset, (BCU2Reg[3] >> 7) - nBCU2TileYOffset + nLayer1YOffset); - BCU2QueueLayer((UINT16*)(BCU2RAM + 0x0000), (BCU2Reg[0] >> 7) - nBCU2TileXOffset + nLayer0XOffset, (BCU2Reg[1] >> 7) - nBCU2TileYOffset + nLayer0YOffset); -} - -static void BCU2RenderTileQueue(INT32 nPriority) -{ - UINT32 nTileNumber, nTileAttrib; - UINT8* pTileStart; - UINT8 nOpacity; - - pBCU2TileQueue[nPriority]->nTileAttrib = 0; - pBCU2TileQueue[nPriority] = &pBCU2TileQueueData[nPriority * 1280 * 4]; - - while ((nTileAttrib = pBCU2TileQueue[nPriority]->nTileAttrib) != 0) { - nTileXPos = pBCU2TileQueue[nPriority]->nTileXPos; - nTileYPos = pBCU2TileQueue[nPriority]->nTileYPos; - pBCU2TileQueue[nPriority]++; - - nTileNumber = nTileAttrib & nBCU2MaxTile; - - pTileStart = BCU2ROM + (nTileNumber << 5); - pTilePalette = &ToaPalette[(nTileAttrib >> 12) & 0x03F0]; - - pTile = pBurnBitmap + (nTileXPos * nBurnColumn) + (nTileYPos * nBurnRow); - - if ((nOpacity = BCU2TileAttrib[nTileNumber]) != 0 || nPriority < ToaOpaquePriority) { - if (nPriority < ToaOpaquePriority) nOpacity = 9; - - pTileData = (UINT32*)pTileStart; - if (nTileXPos >= 0 && nTileXPos < 312 && nTileYPos >= 0 && nTileYPos < 232) { - RenderTile[nOpacity - 1](); - } else { - if (nTileXPos > -8 && nTileXPos < 320 && nTileYPos > -8 && nTileYPos < 240) { - RenderTile[nOpacity](); - } - } - } - } -} - -void ToaBufferFCU2Sprites() -{ - memcpy(pFCU2SpriteBuffer, FCU2RAM, 0x0800); -} - -INT32 ToaRenderBCU2() -{ - if (nLastBPP != nBurnBpp ) { - nLastBPP = nBurnBpp; - -#ifdef DRIVER_ROTATION - if (bRotatedScreen) { - RenderTile = RenderTile_ROT270[nBurnBpp - 2]; - } else { - RenderTile = RenderTile_ROT0[nBurnBpp - 2]; - } -#else - RenderTile = RenderTile_ROT0[nBurnBpp - 2]; -#endif - } - - BCU2PrepareTiles(); - if (!Rallybik) { - FCU2PrepareSprites(); - } - - for (INT32 nPriority = 0; nPriority < 16; nPriority++) { - if (Rallybik) { - rallybik_draw_sprites(nPriority << 8); - } else { - FCU2RenderSpriteQueue(nPriority); - } - BCU2RenderTileQueue(nPriority); - } - - return 0; -} - -INT32 ToaInitBCU2() -{ - INT32 nSize; - - nLastBPP = 0; - - nBCU2MaxTile = (nBCU2ROMSize - 1) >> 5; - - nSize = 1280 * 4 * 0x10 * sizeof(ToaTile); - pBCU2TileQueueData = (ToaTile*)BurnMalloc(nSize); - memset(pBCU2TileQueueData, 0, nSize); - - BCU2TileAttrib = (UINT8*)BurnMalloc(32768); - memset(BCU2TileAttrib, 0, 32768); - for (UINT32 j = 0; j < (nBCU2ROMSize >> 5); j++) { - bool bTransparent = true, bSolid = true; - INT32 nTwoPixels; - for (UINT32 k = (j << 5); k < ((j << 5) + 32); k++) { - if ((nTwoPixels = BCU2ROM[k]) != 0) { - bTransparent = false; - } - if ((nTwoPixels & 0xF0) == 0 || (nTwoPixels & 0x0F) == 0) { - bSolid = false; - } - } - if (bTransparent) { - BCU2TileAttrib[j] = 0; - } else { - if (bSolid) { - BCU2TileAttrib[j] = 9; - } else { - BCU2TileAttrib[j] = 1; - } - } - } - - nFCU2MaxSprite = (nFCU2ROMSize - 1) >> 5; - - nSize = 0x10 * 0x101 * sizeof(UINT16*); - pFCU2SpriteQueueData = (UINT16**)BurnMalloc(nSize); - memset(pFCU2SpriteQueueData, 0, nSize); - - pFCU2SpriteBuffer = (UINT8*)BurnMalloc(0x0800); - - FCU2TileAttrib = (UINT8*)BurnMalloc(32768); - memset(FCU2TileAttrib, 0, 32768); - for (UINT32 j = 0; j < (nFCU2ROMSize >> 5); j++) { - bool bTransparent = true, bSolid = true; - INT32 nTwoPixels; - for (UINT32 k = (j << 5); k < ((j << 5) + 32); k++) { - if ((nTwoPixels = FCU2ROM[k]) != 0) { - bTransparent = false; - } - if ((nTwoPixels & 0xF0) == 0 || (nTwoPixels & 0x0F) == 0) { - bSolid = false; - } - } - if (bTransparent) { - FCU2TileAttrib[j] = 0; - } else { - if (bSolid) { - FCU2TileAttrib[j] = 9; - } else { - FCU2TileAttrib[j] = 1; - } - } - } - - if (!nLayer0XOffset) { - nLayer0XOffset = 0x01EF + 6; - } - if (!nLayer1XOffset) { - nLayer1XOffset = 0x01EF + 4; - } - if (!nLayer2XOffset) { - nLayer2XOffset = 0x01EF + 2; - } - if (!nLayer3XOffset) { - nLayer3XOffset = 0x01EF + 0; - } - - if (!nLayer0YOffset) { - nLayer0YOffset = 0x0101; - } - if (!nLayer1YOffset) { - nLayer1YOffset = 0x0101; - } - if (!nLayer2YOffset) { - nLayer2YOffset = 0x0101; - } - if (!nLayer3YOffset) { - nLayer3YOffset = 0x0101; - } - - ToaOpaquePriority = 0; - - return 0; -} - -INT32 ToaExitBCU2() -{ - nLayer0XOffset = 0; - nLayer1XOffset = 0; - nLayer2XOffset = 0; - nLayer3XOffset = 0; - nLayer0YOffset = 0; - nLayer1YOffset = 0; - nLayer2YOffset = 0; - nLayer3YOffset = 0; - - nFCU2SpriteXOffset = 0; - nFCU2SpriteYOffset = 0; - - BurnFree(pBCU2TileQueueData); - BurnFree(BCU2TileAttrib); - BurnFree(pFCU2SpriteQueueData); - BurnFree(pFCU2SpriteBuffer); - BurnFree(FCU2TileAttrib); - - return 0; -} - -INT32 ToaScanBCU2(INT32 nAction, INT32* pnMin) -{ - if (nAction & ACB_VOLATILE) { // Scan volatile data - if (pnMin) { - *pnMin = 0x029496; - } - - SCAN_VAR(BCU2Pointer); - SCAN_VAR(FCU2Pointer); - SCAN_VAR(BCU2Reg); - SCAN_VAR(ToaOpaquePriority); - SCAN_VAR(nLayer0XOffset); - SCAN_VAR(nLayer1XOffset); - SCAN_VAR(nLayer2XOffset); - SCAN_VAR(nLayer3XOffset); - SCAN_VAR(nLayer0YOffset); - SCAN_VAR(nLayer1YOffset); - SCAN_VAR(nLayer2YOffset); - SCAN_VAR(nLayer3YOffset); - SCAN_VAR(nBCU2TileXOffset); - SCAN_VAR(nBCU2TileYOffset); - SCAN_VAR(nSpriteXOffset); - SCAN_VAR(nSpriteYOffset); - SCAN_VAR(nSpritePriority); - } - - return 0; -} diff --git a/jan/src/burn/drv/toaplan/toa_extratext.cpp b/jan/src/burn/drv/toaplan/toa_extratext.cpp deleted file mode 100644 index df0e40657..000000000 --- a/jan/src/burn/drv/toaplan/toa_extratext.cpp +++ /dev/null @@ -1,342 +0,0 @@ -#include "toaplan.h" - -UINT8* ExtraTROM; -UINT8* ExtraTRAM; -UINT8* ExtraTScroll; -UINT8* ExtraTSelect; - -INT32 nExtraTXOffset = 0x9999; -INT32 nTileXPos; - -static UINT8* pTile; -static UINT8* pTileData; -static UINT32* pTilePalette; - -typedef void (*RenderTileFunction)(); -static RenderTileFunction RenderTile[4]; - -static INT32 nLastBPP = 0; - -#define ROT 0 - -#define ROWMODE 0 - -#define DOCLIP 0 - -#define BPP 16 -#include "toa_extratext.h" -#undef BPP -#define BPP 24 -#include "toa_extratext.h" -#undef BPP -#define BPP 32 -#include "toa_extratext.h" -#undef BPP - -#undef DOCLIP -#define DOCLIP 1 - -#define BPP 16 -#include "toa_extratext.h" -#undef BPP -#define BPP 24 -#include "toa_extratext.h" -#undef BPP -#define BPP 32 -#include "toa_extratext.h" -#undef BPP - -#undef DOCLIP - -#undef ROWMODE -#define ROWMODE 1 - -#define DOCLIP 0 - -#define BPP 16 -#include "toa_extratext.h" -#undef BPP -#define BPP 24 -#include "toa_extratext.h" -#undef BPP -#define BPP 32 -#include "toa_extratext.h" -#undef BPP - -#undef DOCLIP -#define DOCLIP 1 - -#define BPP 16 -#include "toa_extratext.h" -#undef BPP -#define BPP 24 -#include "toa_extratext.h" -#undef BPP -#define BPP 32 -#include "toa_extratext.h" -#undef BPP - -#undef DOCLIP - -#undef ROWMODE - -#undef ROT - -#ifdef DRIVER_ROTATION - #define ROT 270 - - #define ROWMODE 0 - - #define DOCLIP 0 - - #define BPP 16 - #include "toa_extratext.h" - #undef BPP - #define BPP 24 - #include "toa_extratext.h" - #undef BPP - #define BPP 32 - #include "toa_extratext.h" - #undef BPP - - #undef DOCLIP - #define DOCLIP 1 - - #define BPP 16 - #include "toa_extratext.h" - #undef BPP - #define BPP 24 - #include "toa_extratext.h" - #undef BPP - #define BPP 32 - #include "toa_extratext.h" - #undef BPP - - #undef DOCLIP - - #undef ROWMODE - #define ROWMODE 1 - - #define DOCLIP 0 - - #define BPP 16 - #include "toa_extratext.h" - #undef BPP - #define BPP 24 - #include "toa_extratext.h" - #undef BPP - #define BPP 32 - #include "toa_extratext.h" - #undef BPP - - #undef DOCLIP - #define DOCLIP 1 - - #define BPP 16 - #include "toa_extratext.h" - #undef BPP - #define BPP 24 - #include "toa_extratext.h" - #undef BPP - #define BPP 32 - #include "toa_extratext.h" - #undef BPP - - #undef DOCLIP - - #undef ROWMODE - - #undef ROT -#endif - -INT32 ToaExtraTextLayer() -{ - if (nLastBPP != nBurnBpp ) { - nLastBPP = nBurnBpp; - -#ifdef DRIVER_ROTATION - switch (nBurnBpp) { - case 2: - if (bRotatedScreen) { - RenderTile[0] = *RenderTile16_ROT270_NOCLIP_NORMAL; - RenderTile[1] = *RenderTile16_ROT270_CLIP_NORMAL; - RenderTile[2] = *RenderTile16_ROT270_NOCLIP_ROWSEL; - RenderTile[3] = *RenderTile16_ROT270_CLIP_ROWSEL; - } else { - RenderTile[0] = *RenderTile16_ROT0_NOCLIP_NORMAL; - RenderTile[1] = *RenderTile16_ROT0_CLIP_NORMAL; - RenderTile[2] = *RenderTile16_ROT0_NOCLIP_ROWSEL; - RenderTile[3] = *RenderTile16_ROT0_CLIP_ROWSEL; - } - break; - case 3: - if (bRotatedScreen) { - RenderTile[0] = *RenderTile24_ROT270_NOCLIP_NORMAL; - RenderTile[1] = *RenderTile24_ROT270_CLIP_NORMAL; - RenderTile[2] = *RenderTile24_ROT270_NOCLIP_ROWSEL; - RenderTile[3] = *RenderTile24_ROT270_CLIP_ROWSEL; - } else { - RenderTile[0] = *RenderTile24_ROT0_NOCLIP_NORMAL; - RenderTile[1] = *RenderTile24_ROT0_CLIP_NORMAL; - RenderTile[2] = *RenderTile24_ROT0_NOCLIP_ROWSEL; - RenderTile[3] = *RenderTile24_ROT0_CLIP_ROWSEL; - } - break; - case 4: - if (bRotatedScreen) { - RenderTile[0] = *RenderTile32_ROT270_NOCLIP_NORMAL; - RenderTile[1] = *RenderTile32_ROT270_CLIP_NORMAL; - RenderTile[2] = *RenderTile32_ROT270_NOCLIP_ROWSEL; - RenderTile[3] = *RenderTile32_ROT270_CLIP_ROWSEL; - } else { - RenderTile[0] = *RenderTile32_ROT0_NOCLIP_NORMAL; - RenderTile[1] = *RenderTile32_ROT0_CLIP_NORMAL; - RenderTile[2] = *RenderTile32_ROT0_NOCLIP_ROWSEL; - RenderTile[3] = *RenderTile32_ROT0_CLIP_ROWSEL; - } - break; - default: - return 1; - } -#else - switch (nBurnBpp) { - case 2: - RenderTile[0] = *RenderTile16_ROT0_NOCLIP_NORMAL; - RenderTile[1] = *RenderTile16_ROT0_CLIP_NORMAL; - RenderTile[2] = *RenderTile16_ROT0_NOCLIP_ROWSEL; - RenderTile[3] = *RenderTile16_ROT0_CLIP_ROWSEL; - break; - case 3: - RenderTile[0] = *RenderTile24_ROT0_NOCLIP_NORMAL; - RenderTile[1] = *RenderTile24_ROT0_CLIP_NORMAL; - RenderTile[2] = *RenderTile24_ROT0_NOCLIP_ROWSEL; - RenderTile[3] = *RenderTile24_ROT0_CLIP_ROWSEL; - break; - case 4: - RenderTile[0] = *RenderTile32_ROT0_NOCLIP_NORMAL; - RenderTile[1] = *RenderTile32_ROT0_CLIP_NORMAL; - RenderTile[2] = *RenderTile32_ROT0_NOCLIP_ROWSEL; - RenderTile[3] = *RenderTile32_ROT0_CLIP_ROWSEL; - break; - default: - return 1; - } -#endif - } - - UINT32* pTextPalette = &ToaPalette[0x0400]; - UINT8* pCurrentRow = pBurnBitmap; - - INT32 nTileLeft = nBurnColumn << 3; - INT32 nTileDown = nBurnRow << 3; - UINT16* pTileRow; - - INT32 nOffset, nLine, nStartX; - INT32 x, y, i; - -#if 1 - y = 0; - do { - nLine = BURN_ENDIAN_SWAP_INT16(((UINT16*)ExtraTSelect)[y]); - nOffset = BURN_ENDIAN_SWAP_INT16(((UINT16*)ExtraTScroll)[y]); - - if (Bgareggabl) nLine = y; - - if (y < 233) { - for (i = 1; i < 8 && BURN_ENDIAN_SWAP_INT16(((UINT16*)ExtraTSelect)[y + i]) == (nLine + i) && BURN_ENDIAN_SWAP_INT16(((UINT16*)ExtraTScroll)[y + i]) == nOffset; i++) { } - - // draw whole tiles in one go - if (i == 8) { - - nOffset += nExtraTXOffset; - nStartX = (nOffset >> 3) & 0x3F; - pTileRow = ((UINT16*)ExtraTRAM) + ((nLine & (0x1F << 3)) << 3); - nOffset &= 7; - - for (x = 0, pTile = pCurrentRow - nOffset * nBurnColumn; x < 41; x++, pTile += nTileLeft) { - UINT32 nTile = BURN_ENDIAN_SWAP_INT16(pTileRow[(x + nStartX) & 0x3F]); - { // nTile (0) is usually Black/Opaque for mosaic tile effects in FixEight. 0x20 needs to be drawn, too, otherwise certain tiles of the HUD will become transparent during gameplay. - pTileData = ExtraTROM + ((nTile & 0x3FF) << 5); - pTilePalette = &pTextPalette[((nTile >> 6) & 0x03F0)]; - if (x == 0 || x == 40) { - nTileXPos = 0 - nOffset + (x << 3); - RenderTile[1](); - } else { - RenderTile[0](); - } - } - } - - pCurrentRow += nTileDown; - y += 8; - continue; - } - } - - // Draw each line seperately - - nOffset += nExtraTXOffset; - nStartX = (nOffset >> 3) & 0x3F; - pTileRow = ((UINT16*)ExtraTRAM) + ((nLine & (0x1F << 3)) << 3); - nOffset &= 7; - - for (x = 0, pTile = pCurrentRow - nOffset * nBurnColumn; x < 41; x++, pTile += nTileLeft) { - UINT32 nTile = BURN_ENDIAN_SWAP_INT16(pTileRow[(x + nStartX) & 0x3F]); - { - pTileData = ExtraTROM + ((nTile & 0x3FF) << 5) + ((nLine & 7) << 2); - pTilePalette = &pTextPalette[((nTile >> 6) & 0x03F0)]; - if (x == 0 || x == 40) { - nTileXPos = 0 - nOffset + (x << 3); - RenderTile[3](); - } else { - RenderTile[2](); - } - } - } - - pCurrentRow += nBurnRow; - y++; - - } while (y < 240); -#else - pTileRow = (UINT16*)(ExtraTRAM + ((nOffset >> 3) << 1)); - pCurrentRow = pBurnBitmap - (nOffset & 7) * nBurnColumn; - - nOffset = ((UINT16*)(ExtraTScroll + nExtraTXOffset))[y]; - nStartX = nOffset >> 3; - nOffset &= 7; - - for (y = 0; y < 30; y++, pCurrentRow += nTileDown, pTileRow += 0x40) { - for (x = 0, pTile = pCurrentRow; x < 41; x++, pTile += nTileLeft) { - UINT32 nTile = pTileRow[(x + nStartX) & 0x3F]; - if (nTile && nTile != 0x20) { - pTileData = ExtraTROM + ((nTile & 0x3FF) << 5); - pTilePalette = &pTextPalette[((nTile >> 6) & 0x03F0)]; - if (x == 0 || x == 40) { - nTileXPos = 0 - nOffset + (x << 3); - RenderTile[1](); - } else { - RenderTile[0](); - } - } - } - } -#endif - - return 0; -} - -INT32 ToaExtraTextInit() -{ - if (nExtraTXOffset == 0x9999) { - nExtraTXOffset = 0x2B; - } - - return 0; -} - -void ToaExtraTextExit() -{ - nExtraTXOffset = 0x9999; -} - diff --git a/jan/src/burn/drv/toaplan/toa_extratext.h b/jan/src/burn/drv/toaplan/toa_extratext.h deleted file mode 100644 index 7c8c43014..000000000 --- a/jan/src/burn/drv/toaplan/toa_extratext.h +++ /dev/null @@ -1,115 +0,0 @@ -#define FN(a,b,c,d) RenderTile ## a ## _ROT ## b ## c ## d -#define FUNCTIONNAME(a,b,c,d) FN(a,b,c,d) - -#define ISOPAQUE 0 - -#if ROT == 0 - #define ADVANCECOLUMN pPixel += (BPP >> 3) - #define ADVANCEROW pTileRow += ((BPP >> 3) * 320) -#elif ROT == 270 - #define ADVANCECOLUMN pPixel -= ((BPP >> 3) * 240) - #define ADVANCEROW pTileRow += (BPP >> 3) -#else - #error unsupported rotation angle specified. -#endif - -#if DOCLIP == 0 - #define CLIP _NOCLIP - #define TESTCLIP(x) 1 -#elif DOCLIP == 1 - #define CLIP _CLIP - #define TESTCLIP(x) (nTileXPos + x) >= 0 && (nTileXPos + x) < 320 -#else - #error illegal doclip value. -#endif - -#if ISOPAQUE == 0 - #define OPACITY _TRANS - #define TESTCOLOUR(x) x -#elif ISOPAQUE == 1 - #define OPACITY _OPAQUE - #define TESTCOLOUR(x) 1 -#else - #error illegal isopaque value -#endif - -#if BPP == 16 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTCLIP(a)) { \ - *((UINT16 *)pPixel) = (UINT16)pTilePalette[b]; \ - } -#elif BPP == 24 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTCLIP(a)) { \ - UINT32 nRGB = pTilePalette[b]; \ - pPixel[0] = (UINT8)nRGB; \ - pPixel[1] = (UINT8)(nRGB >> 8); \ - pPixel[2] = (UINT8)(nRGB >> 16); \ - } -#elif BPP == 32 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTCLIP(a)) { \ - *((UINT32 *)pPixel) = (UINT32)pTilePalette[b]; \ - } -#else - #error unsupported bitdepth specified. -#endif - -#if ROWMODE == 0 - #define MODE _NORMAL -#elif ROWMODE == 1 - #define MODE _ROWSEL -#else - #error unsupported rowmode specified. -#endif - -static void FUNCTIONNAME(BPP,ROT,CLIP,MODE)() -{ -#if ROWMODE == 0 - UINT8 *pTileRow, *pPixel; - INT32 y, nColour; - - for (y = 0, pTileRow = pTile; y < 8; y++, ADVANCEROW) { - pPixel = pTileRow; -#else - UINT8 *pPixel = pTile; - INT32 nColour; -#endif - - nColour = *pTileData++; - PLOTPIXEL(0,nColour >> 4); - ADVANCECOLUMN; - PLOTPIXEL(1,nColour & 0x0F); - ADVANCECOLUMN; - - nColour = *pTileData++; - PLOTPIXEL(2,nColour >> 4); - ADVANCECOLUMN; - PLOTPIXEL(3,nColour & 0x0F); - ADVANCECOLUMN; - - nColour = *pTileData++; - PLOTPIXEL(4,nColour >> 4); - ADVANCECOLUMN; - PLOTPIXEL(5,nColour & 0x0F); - ADVANCECOLUMN; - -#if ROWMODE == 0 - nColour = *pTileData++; -#else - nColour = *pTileData; -#endif - PLOTPIXEL(6,nColour >> 4); - ADVANCECOLUMN; - PLOTPIXEL(7,nColour & 0x0F); -#if ROWMODE == 0 - } -#endif -} - -#undef MODE -#undef PLOTPIXEL -#undef TESTCLIP -#undef TESTCOLOUR -#undef ADVANCEROW -#undef ADVANCECOLUMN -#undef CLIP -#undef FUNCTIONNAME -#undef FN diff --git a/jan/src/burn/drv/toaplan/toa_gp9001.cpp b/jan/src/burn/drv/toaplan/toa_gp9001.cpp deleted file mode 100644 index 9748e5579..000000000 --- a/jan/src/burn/drv/toaplan/toa_gp9001.cpp +++ /dev/null @@ -1,618 +0,0 @@ -#include "toaplan.h" - -/* - * Some games write to addresses outside of VRAM. It looks like the hardware masks bit 15-12. - * Note that they only seem to set the VRAM pointer too high (tekipaki does read/write too far - * during POST -- 0x3800 = 2 * 0x1C00). Batsugun in particular sets the pointer too high often. - * - * Some games need 1 to be added to the sprite priorities (e.g the 2nd level boss in mahoudai). - * This is clearly wrong for some other games. - * - * For batsugun, controller 1 has higher priority then controller 0. - * Tiles with priority 0 are special -- they are always in the background. - * How to determine which controller has the highest priority is unknown. - * The code to accomplish this for Batsugun is a hack that checks the X positions of the layers. - * - */ - -UINT8* GP9001ROM[2]; -UINT32 nGP9001ROMSize[2]; -static UINT8* GP9001TileAttrib[2]; - -static UINT32 nMaxTile[2]; -static UINT32 nMaxSprite[2]; - -static INT32 nControllers; -static INT32 nMode; - -UINT32 GP9001TileBank[8]; - -UINT8* GP9001RAM[2]; -UINT16* GP9001Reg[2]; - -UINT8* GP9001Pointer[2]; -UINT32 GP9001PointerCfg[2]; -INT32 GP9001Regnum[2]; - -static UINT32* pTileQueue[32]; -static UINT32* pTileQueueData[2] = {NULL, }; - -static UINT8** pSpriteQueue[32]; -static UINT8** pSpriteQueueData[2] = {NULL, }; - -static UINT8* pSpriteBuffer[2]; -static UINT8* pSpriteBufferData[2] = {NULL, }; - -static INT32 nSpriteBuffer = 0; - -INT32 nSpriteXOffset = 0, nSpriteYOffset = 0, nSpritePriority = 0; - -INT32 nLayer0XOffset = 0, nLayer0YOffset = 0; -INT32 nLayer1XOffset = 0, nLayer1YOffset = 0; -INT32 nLayer2XOffset = 0, nLayer2YOffset = 0; -INT32 nLayer3XOffset = 0, nLayer3YOffset = 0; - -static UINT8* pTile; -static UINT32* pTileData; -static UINT32* pTilePalette; - -typedef void (*RenderTileFunction)(); -static RenderTileFunction* RenderTile; - -static INT32 nTileXPos, nTileYPos; - -static INT32 nLastBPP = 0; - -// Include the tile rendering functions -#include "toa_gp9001_func.h" - -static void PrepareSprites() -{ - UINT8* pSpriteInfo; - INT32 nSprite, nAttrib; - - for (INT32 i = 0; i < nControllers; i++) { - UINT8*** pMySpriteQueue = &pSpriteQueue[i << 4]; - - for (INT32 nPriority = 0; nPriority < 16; nPriority++) { - pMySpriteQueue[nPriority] = &pSpriteQueueData[i][(nPriority << 8) + nPriority]; - } - - for (nSprite = 0, pSpriteInfo = pSpriteBuffer[i]; nSprite < 0x0100; nSprite++, pSpriteInfo += 8) { - nAttrib = pSpriteInfo[1]; - if (nAttrib & 0x80) { // Sprite is enabled - *pMySpriteQueue[nAttrib & 0x0F]++ = pSpriteInfo; - } - } - } -} - -static void RenderSpriteQueue(INT32 i, INT32 nPriority) -{ - UINT8* pSpriteInfo; - UINT8* pSpriteData; - INT32 nSpriteXPos, nSpriteYPos; - INT32 nSpriteXSize, nSpriteYSize; - UINT32 nSpriteNumber; - INT32 x, y, xoff, yoff; - INT32 nFlip; - - UINT8*** pMySpriteQueue = &pSpriteQueue[i << 4]; - - *pMySpriteQueue[nPriority] = NULL; - pMySpriteQueue[nPriority] = &pSpriteQueueData[i][(nPriority << 8) + nPriority]; - - while ((pSpriteInfo = *pMySpriteQueue[nPriority]++) != NULL) { - nFlip = ((pSpriteInfo[1] & 0x30) >> 3); - - pTilePalette = &ToaPalette[((pSpriteInfo[0] & 0xFC) << 2)]; - nSpriteNumber = (((pSpriteInfo[3] << 8) | pSpriteInfo[2]) & 0x7FFF); - nSpriteNumber += GP9001TileBank[(((pSpriteInfo[0] & 3) << 1) | (pSpriteInfo[3] >> 7))]; - - pSpriteData = GP9001ROM[i] + (nSpriteNumber << 5); - - nSpriteXSize = pSpriteInfo[4] & 0x0F; - nSpriteXPos = ((pSpriteInfo[5] << 1) | (pSpriteInfo[4] >> 7)) + GP9001Reg[i][6] + nSpriteXOffset; - nSpriteXPos &= 0x01FF; - nSpriteYSize = pSpriteInfo[6] & 0x0F; - nSpriteYPos = ((pSpriteInfo[7] << 1) | (pSpriteInfo[6] >> 7)) + GP9001Reg[i][7] + nSpriteYOffset; - nSpriteYPos &= 0x01FF; - - if (nFlip & 2) { - xoff = -8; - nSpriteXPos -= 7; - if (nSpriteXPos > (320 + 128)) { - nSpriteXPos -= 0x0200; - } - } else { - xoff = 8; - if (nSpriteXPos > (512 - 128)) { - nSpriteXPos -= 0x0200; - } - } - if (nFlip & 4) { - yoff = -8; - nSpriteYPos -= 7; - } else { - yoff = 8; - } - - if (nSpriteYPos > 384) { - nSpriteYPos -= 0x0200; - } - - for (y = 0, nTileYPos = nSpriteYPos; y <= nSpriteYSize; y++, nTileYPos += yoff) { - for (x = 0, nTileXPos = nSpriteXPos; x <= nSpriteXSize; x++, nTileXPos += xoff, nSpriteNumber++, pSpriteData += 32) { - if (nSpriteNumber > nMaxSprite[i]) { - break; - } - if (GP9001TileAttrib[i][nSpriteNumber]) { - // Skip tile if it's completely off the screen - if (!(nTileXPos <= -8 || nTileXPos >= 320 || nTileYPos <= -8 || nTileYPos >= 240)) { - pTileData = (UINT32*)pSpriteData; - pTile = pBurnBitmap + (nTileXPos * nBurnColumn) + (nTileYPos * nBurnRow); - if (nTileXPos < 0 || nTileXPos > 312 || nTileYPos < 0 || nTileYPos > 232) { - RenderTile[nFlip + 1](); - } else { - RenderTile[nFlip](); - } - } - } - } - } - } -} - -static void QueueLayer(INT32 i, UINT16* pTilemap, INT32 nXPos, INT32 nYPos) -{ - INT32 x, y; - INT32 nTileRow, nTileColumn; - UINT32 nTileNumber, nTileAttrib; - - UINT32** pMyTileQueue = &pTileQueue[i << 4]; - - for (y = 0; y < 16; y++) { - - nTileRow = (((nYPos >> 4) + y) << 6) & 0x7C0; - - for (x = 0; x < 21; x++) { - nTileColumn = (((nXPos >> 4) + x) << 1) & 0x3E; - nTileNumber = BURN_ENDIAN_SWAP_INT16(pTilemap[nTileRow + nTileColumn + 1]); - - if (nTileNumber > 0 && nTileNumber <= nMaxTile[i]) { - nTileAttrib = BURN_ENDIAN_SWAP_INT16(pTilemap[nTileRow + nTileColumn]); - *pMyTileQueue[(nTileAttrib >> 8) & 0x0F]++ = (nTileAttrib << 16) | nTileNumber; - nTileXPos = (x << 4) - (nXPos & 15); - nTileYPos = (y << 4) - (nYPos & 15); - *pMyTileQueue[(nTileAttrib >> 8) & 0x0F]++ = (nTileXPos << 16) | (nTileYPos & 0xFFFF); -#if 0 - printf("%X ", nTileAttrib >> 8); -#endif - } - } - } -} - -static void QueueLayer2(INT32 i, UINT16* pTilemap, INT32 nXPos, INT32 nYPos) -{ - INT32 x, y; - INT32 nTileRow, nTileColumn; - UINT32 nTileNumber, nTileAttrib; - - UINT32** pMyTileQueue = &pTileQueue[i << 4]; - - for (y = 0; y < 16; y++) { - - nTileRow = (((nYPos >> 4) + y) << 6) & 0x7C0; - - for (x = 0; x < 21; x++) { - nTileColumn = (((nXPos >> 4) + x) << 1) & 0x3E; - nTileNumber = BURN_ENDIAN_SWAP_INT16(pTilemap[nTileRow + nTileColumn + 1]); - - if (nTileNumber > 0 && nTileNumber <= nMaxTile[i]) { - nTileAttrib = BURN_ENDIAN_SWAP_INT16(pTilemap[nTileRow + nTileColumn]); - if ((nTileAttrib & 0x0F00) == 0) { - nTileAttrib |= 0x0100; - } - *pMyTileQueue[(nTileAttrib >> 8) & 0x0F]++ = (nTileAttrib << 16) | nTileNumber; - nTileXPos = (x << 4) - (nXPos & 15); - nTileYPos = (y << 4) - (nYPos & 15); - *pMyTileQueue[(nTileAttrib >> 8) & 0x0F]++ = (nTileXPos << 16) | (nTileYPos & 0xFFFF); - } - } - } -} - -static void PrepareTiles() -{ - for (INT32 i = 0; i < nControllers; i++) { - UINT32** pMyTileQueue = &pTileQueue[i << 4]; - - for (INT32 nPriority = 0; nPriority < 16; nPriority++) { - pMyTileQueue[nPriority] = &pTileQueueData[i][nPriority * 512 * 3 * 2]; - } - } - - if (nControllers == 1) { - QueueLayer(0, (UINT16*)(GP9001RAM[0] + 0x0000), GP9001Reg[0][0] + nLayer0XOffset, GP9001Reg[0][1] + nLayer0YOffset); - QueueLayer(0, (UINT16*)(GP9001RAM[0] + 0x1000), GP9001Reg[0][2] + nLayer1XOffset, GP9001Reg[0][3] + nLayer1YOffset); - QueueLayer(0, (UINT16*)(GP9001RAM[0] + 0x2000), GP9001Reg[0][4] + nLayer2XOffset, GP9001Reg[0][5] + nLayer2YOffset); - } else { - if (nMode == 2) { - QueueLayer(0, (UINT16*)(GP9001RAM[0] + 0x0000), GP9001Reg[0][0] + nLayer0XOffset, GP9001Reg[0][1] + nLayer0YOffset); - QueueLayer(0, (UINT16*)(GP9001RAM[0] + 0x1000), GP9001Reg[0][2] + nLayer1XOffset, GP9001Reg[0][3] + nLayer1YOffset); - QueueLayer(0, (UINT16*)(GP9001RAM[0] + 0x2000), GP9001Reg[0][4] + nLayer2XOffset, GP9001Reg[0][5] + nLayer2YOffset); - QueueLayer(1, (UINT16*)(GP9001RAM[1] + 0x0000), GP9001Reg[1][0] + nLayer0XOffset, GP9001Reg[1][1] + nLayer0YOffset); - QueueLayer(1, (UINT16*)(GP9001RAM[1] + 0x1000), GP9001Reg[1][2] + nLayer1XOffset, GP9001Reg[1][3] + nLayer1YOffset); - QueueLayer(1, (UINT16*)(GP9001RAM[1] + 0x2000), GP9001Reg[1][4] + nLayer2XOffset, GP9001Reg[1][5] + nLayer2YOffset); - } else { - QueueLayer(0, (UINT16*)(GP9001RAM[0] + 0x0000), GP9001Reg[0][0] + nLayer0XOffset, GP9001Reg[0][1] + nLayer0YOffset); - QueueLayer(0, (UINT16*)(GP9001RAM[0] + 0x1000), GP9001Reg[0][2] + nLayer1XOffset, GP9001Reg[0][3] + nLayer1YOffset); - if (GP9001Reg[0][4] + nLayer2XOffset == 0) { - QueueLayer(0, (UINT16*)(GP9001RAM[0] + 0x2000), GP9001Reg[0][4] + nLayer2XOffset, GP9001Reg[0][5] + nLayer2YOffset); - } else { - QueueLayer2(0, (UINT16*)(GP9001RAM[0] + 0x2000), GP9001Reg[0][4] + nLayer2XOffset, GP9001Reg[0][5] + nLayer2YOffset); - } - QueueLayer(1, (UINT16*)(GP9001RAM[1] + 0x0000), GP9001Reg[1][0] + nLayer0XOffset, GP9001Reg[1][1] + nLayer0YOffset); - QueueLayer(1, (UINT16*)(GP9001RAM[1] + 0x1000), GP9001Reg[1][2] + nLayer1XOffset, GP9001Reg[1][3] + nLayer1YOffset); - QueueLayer(1, (UINT16*)(GP9001RAM[1] + 0x2000), GP9001Reg[1][4] + nLayer2XOffset, GP9001Reg[1][5] + nLayer2YOffset); - } - } -} - -static void RenderTileQueue(INT32 i, INT32 nPriority) -{ - UINT32 nTileNumber, nTileAttrib; - UINT8* pTileStart; - UINT8 nOpacity; - - UINT32** pMyTileQueue = &pTileQueue[i << 4]; - - *pMyTileQueue[nPriority] = 0; - pMyTileQueue[nPriority] = &pTileQueueData[i][nPriority * 512 * 3 * 2]; - - while ((nTileNumber = *pMyTileQueue[nPriority]++) != 0) { - nTileXPos = (INT16)(*pMyTileQueue[nPriority] >> 16); - nTileYPos = (INT16)(*pMyTileQueue[nPriority]++ & 0xFFFF); - nTileAttrib = nTileNumber; - nTileNumber = ((nTileNumber & 0x1FFF) << 2) + GP9001TileBank[(nTileNumber >> 13) & 7]; - - pTileStart = GP9001ROM[i] + (nTileNumber << 5); - pTilePalette = &ToaPalette[(nTileAttrib >> 12) & 0x07F0]; - - if (nTileXPos >= 0 && nTileXPos < 304 && nTileYPos >= 0 && nTileYPos < 224) { - INT32 nTileWidth = 8 * nBurnColumn; - pTile = pBurnBitmap + (nTileXPos * nBurnColumn) + (nTileYPos * nBurnRow); - - if ((nOpacity = GP9001TileAttrib[i][nTileNumber]) != 0) { - pTileData = (UINT32*)pTileStart; - RenderTile[nOpacity - 1](); - } - if ((nOpacity = GP9001TileAttrib[i][nTileNumber + 1]) != 0) { - pTile += nTileWidth; - pTileData = (UINT32*)(pTileStart + 32); - RenderTile[nOpacity - 1](); - pTile -= nTileWidth; - } - pTile += 8 * nBurnRow; - if ((nOpacity = GP9001TileAttrib[i][nTileNumber + 2]) != 0) { - pTileData = (UINT32*)(pTileStart + 64); - RenderTile[nOpacity - 1](); - } - if ((nOpacity = GP9001TileAttrib[i][nTileNumber + 3]) != 0) { - pTile += nTileWidth; - pTileData = (UINT32*)(pTileStart + 96); - RenderTile[nOpacity - 1](); - } - } else { - INT32 nTileWidth = 8 * nBurnColumn; - pTile = pBurnBitmap + (nTileXPos * nBurnColumn) + (nTileYPos * nBurnRow); - - if ((nOpacity = GP9001TileAttrib[i][nTileNumber]) != 0) { - if (nTileXPos > -8 && nTileXPos < 320 && nTileYPos > -8 && nTileYPos < 240) { - pTileData = (UINT32*)pTileStart; - if (nTileXPos > 0 && nTileXPos <= 312 && nTileYPos > 0 && nTileYPos <= 232) { - RenderTile[nOpacity - 1](); - } else { - RenderTile[nOpacity](); - } - } - } - if ((nOpacity = GP9001TileAttrib[i][nTileNumber + 1]) != 0) { - pTile += nTileWidth; - nTileXPos += 8; - if (nTileXPos > -8 && nTileXPos < 320 && nTileYPos > -8 && nTileYPos < 240) { - pTileData = (UINT32*)(pTileStart + 32); - if (nTileXPos > 0 && nTileXPos <= 312 && nTileYPos > 0 && nTileYPos <= 232) { - RenderTile[nOpacity - 1](); - } else { - RenderTile[nOpacity](); - } - } - nTileXPos -= 8; - pTile -= nTileWidth; - } - nTileYPos += 8; - pTile += 8 * nBurnRow; - if ((nOpacity = GP9001TileAttrib[i][nTileNumber + 2]) != 0) { - if (nTileXPos > -8 && nTileXPos < 320 && nTileYPos > -8 && nTileYPos < 240) { - pTileData = (UINT32*)(pTileStart + 64); - if (nTileXPos > 0 && nTileXPos <= 312 && nTileYPos > 0 && nTileYPos <= 232) { - RenderTile[nOpacity - 1](); - } else { - RenderTile[nOpacity](); - } - } - } - if ((nOpacity = GP9001TileAttrib[i][nTileNumber + 3]) != 0) { - nTileXPos += 8; - pTile += nTileWidth; - if (nTileXPos > -8 && nTileXPos < 320 && nTileYPos > -8 && nTileYPos < 240) { - pTileData = (UINT32*)(pTileStart + 96); - if (nTileXPos > 0 && nTileXPos <= 312 && nTileYPos > 0 && nTileYPos <= 232) { - RenderTile[nOpacity - 1](); - } else { - RenderTile[nOpacity](); - } - } - } - } - } -} - -INT32 ToaBufferGP9001Sprites() -{ - -#if 0 - pSpriteBuffer[0] = GP9001RAM[0] + 0x3000; - if (nControllers > 1) { - pSpriteBuffer[1] = GP9001RAM[1] + 0x3000; - } -#else - - pSpriteBuffer[0] = pSpriteBufferData[0] + 0x0800 * nSpriteBuffer; - if (nControllers > 1) { - pSpriteBuffer[1] = pSpriteBufferData[1] + 0x0800 * nSpriteBuffer; - } - - nSpriteBuffer ^= 1; - - memcpy(pSpriteBufferData[0] + 0x0800 * nSpriteBuffer, GP9001RAM[0] + 0x3000, 0x0800); - if (nControllers > 1) { - memcpy(pSpriteBufferData[1] + 0x0800 * nSpriteBuffer, GP9001RAM[1] + 0x3000, 0x0800); - } -#endif - - return 0; -} - -INT32 ToaRenderGP9001() -{ - if (nLastBPP != nBurnBpp ) { - nLastBPP = nBurnBpp; - -#ifdef DRIVER_ROTATION - if (bRotatedScreen) { - RenderTile = RenderTile_ROT270[nBurnBpp - 2]; - } else { - RenderTile = RenderTile_ROT0[nBurnBpp - 2]; - } -#else - RenderTile = RenderTile_ROT0[nBurnBpp - 2]; -#endif - } - - PrepareTiles(); - PrepareSprites(); - - if (nControllers > 1) { - if (nMode == 2) { // Dogyuun - for (INT32 nPriority = 0; nPriority < 16; nPriority++) { - RenderTileQueue(1, nPriority); - RenderSpriteQueue(1, nPriority); - - } - for (INT32 nPriority = 0; nPriority < 16; nPriority++) { - RenderTileQueue(0, nPriority); - RenderSpriteQueue(0, nPriority); - - } - } else { // Batsugun -// printf("%04X %04X %04X\n", GP9001Reg[1][0], GP9001Reg[1][2], GP9001Reg[1][4]); - - if ((((GP9001Reg[1][0] + nLayer0XOffset) && (GP9001Reg[1][2] + nLayer1XOffset)) || (GP9001Reg[0][4] + nLayer1XOffset < 0)) && (GP9001Reg[1][4] + nLayer2XOffset == 0)) { - RenderTileQueue(0, 0); - RenderTileQueue(1, 0); - } else { - RenderTileQueue(1, 0); - RenderTileQueue(0, 0); - } - - for (INT32 nPriority = 1; nPriority < 16; nPriority++) { - RenderTileQueue(0, nPriority); - if (nPriority < 4) { - RenderTileQueue(1, nPriority); - } - RenderSpriteQueue(0, nPriority - 1); - } - RenderSpriteQueue(0, 15); - - RenderSpriteQueue(1, 0); - for (INT32 nPriority = 1; nPriority < 16; nPriority++) { - if (nPriority >= 4) { - RenderTileQueue(1, nPriority); - } - RenderSpriteQueue(1, nPriority); - } - } - } else { - if (nSpritePriority) { - for (INT32 nPriority = 0; nPriority < nSpritePriority; nPriority++) { - RenderTileQueue(0, nPriority); - } - } - for (INT32 nPriority = nSpritePriority; nPriority < 16; nPriority++) { - RenderTileQueue(0, nPriority ); - RenderSpriteQueue(0, nPriority - nSpritePriority); - } - if (nSpritePriority) { - for (INT32 nPriority = 16 - nSpritePriority; nPriority < 16; nPriority++) { - RenderSpriteQueue(0, nPriority); - } - } - } - - return 0; -} - -INT32 ToaInitGP9001(INT32 n) -{ - INT32 nSize; - - if (n < 1 || n > 3) { - return 1; - } else { - nMode = n; - } - - if (n > 1) { - nControllers = 2; - } else { - nControllers = 1; - } - - nLastBPP = 0; - - for (INT32 i = 0; i < nControllers; i++) { - - nMaxTile[i] = (nGP9001ROMSize[i] - 1) >> 7; - nMaxSprite[i] = (nGP9001ROMSize[i] - 1) >> 5; - - nSize = 512 * 3 * 0x10 * 2 * sizeof(INT32); - pTileQueueData[i] = (UINT32*)BurnMalloc(nSize); - memset(pTileQueueData[i], 0, nSize); - - nSize = 0x10 * 0x101 * sizeof(UINT8*); - pSpriteQueueData[i] = (UINT8**)BurnMalloc(nSize); - memset(pSpriteQueueData[i], 0, nSize); - - nSize = 0x0800 * 2; - pSpriteBufferData[i] = (UINT8*)BurnMalloc(nSize); - memset(pSpriteBufferData[i], 0, nSize); - - GP9001TileAttrib[i] = (UINT8*)BurnMalloc(nGP9001ROMSize[i] >> 5); - for (UINT32 j = 0; j < (nGP9001ROMSize[i] >> 5); j++) { - bool bTransparent = true, bSolid = true; - INT32 nTwoPixels; - for (UINT32 k = (j << 5); k < ((j << 5) + 32); k++) { - if ((nTwoPixels = GP9001ROM[i][k]) != 0) { - bTransparent = false; - } - if ((nTwoPixels & 0xF0) == 0 || (nTwoPixels & 0x0F) == 0) { - bSolid = false; - } - } - if (bTransparent) { - GP9001TileAttrib[i][j] = 0; - } else { - if (bSolid) { - GP9001TileAttrib[i][j] = 9; - } else { - GP9001TileAttrib[i][j] = 1; - } - } - } - } - - // Mark the rubbish tiles that appear on level 1 of Batsugun transparent - if (nMode == 3) { - for (INT32 i = 0; i < 16; i++) { - GP9001TileAttrib[1][(0x225C << 2) + i] = 0; - } - } - - for (INT32 i = 0; i < 8; i++) { - GP9001TileBank[i] = i << 15; - } - - nSpriteBuffer = 0; - - ToaBufferGP9001Sprites(); - ToaBufferGP9001Sprites(); - - if (!nSpriteXOffset){ - nSpriteXOffset = 0x024; - } - if (!nSpriteYOffset){ - nSpriteYOffset = -0x01; - } - - if (!nLayer0XOffset) { - nLayer0XOffset = -0x01D5; - } - if (!nLayer1XOffset) { - nLayer1XOffset = -0x01D7; - } - if (!nLayer2XOffset) { - nLayer2XOffset = -0x01D9; - } - - if (!nLayer0YOffset) { - nLayer0YOffset = -0x01EF; - } - if (!nLayer1YOffset) { - nLayer1YOffset = -0x01EF; - } - if (!nLayer2YOffset) { - nLayer2YOffset = -0x01EF; - } - - return 0; -} - -INT32 ToaExitGP9001() -{ - nSpriteXOffset = 0; - nSpriteYOffset = 0; - nSpritePriority = 0; - - nLayer0XOffset = 0; - nLayer1XOffset = 0; - nLayer2XOffset = 0; - nLayer0YOffset = 0; - nLayer1YOffset = 0; - nLayer2YOffset = 0; - - for (INT32 i = 0; i < nControllers; i++) { - BurnFree(pSpriteBufferData[i]); - BurnFree(pSpriteQueueData[i]); - BurnFree(pTileQueueData[i]); - BurnFree(GP9001TileAttrib[i]); - } - - return 0; -} - -INT32 ToaScanGP9001(INT32 nAction, INT32* pnMin) -{ - if (nAction & ACB_VOLATILE) { // Scan volatile data - - if (pnMin) { - *pnMin = 0x029496; - } - - SCAN_VAR(nSpriteBuffer); - - SCAN_VAR(GP9001PointerCfg); - SCAN_VAR(GP9001Regnum); - SCAN_VAR(GP9001TileBank); - if (nAction & ACB_WRITE) { - for (INT32 i = 0; i < nControllers; i++) { - //bprintf(0, _T("ncontrgp9001: %X\n"), i); - ToaGP9001SetRAMPointer(GP9001PointerCfg[i], i); - } - } - } - - return 0; -} diff --git a/jan/src/burn/drv/toaplan/toa_gp9001_render.h b/jan/src/burn/drv/toaplan/toa_gp9001_render.h deleted file mode 100644 index b6f380c6f..000000000 --- a/jan/src/burn/drv/toaplan/toa_gp9001_render.h +++ /dev/null @@ -1,185 +0,0 @@ -// Graphics format: 8 8 pixel tiles, 4 bits/pixel. - -// Create a unique name for each of the functions -#define FN(a,b,c,d,e) RenderTile ## a ## _ROT ## b ## c ## d ## e -#define FUNCTIONNAME(a,b,c,d,e) FN(a,b,c,d,e) - -#if ROT == 0 - - #if XFLIP == 0 - #define ADVANCECOLUMN pPixel += (BPP >> 3) - #elif XFLIP == 1 - #define ADVANCECOLUMN pPixel -= (BPP >> 3) - #else - #error illegal XFLIP value - #endif - - #if YFLIP == 0 - #define ADVANCEROW pTileRow += ((BPP >> 3) * 320) - #elif YFLIP == 1 - #define ADVANCEROW pTileRow -= ((BPP >> 3) * 320) - #else - #error illegal YFLIP value - #endif - -#elif ROT == 270 - - #if XFLIP == 0 - #define ADVANCECOLUMN pPixel -= ((BPP >> 3) * 240) - #elif XFLIP == 1 - #define ADVANCECOLUMN pPixel += ((BPP >> 3) * 240) - #else - #error illegal XFLIP value - #endif - - #if YFLIP == 0 - #define ADVANCEROW pTileRow += (BPP >> 3) - #elif YFLIP == 1 - #define ADVANCEROW pTileRow -= (BPP >> 3) - #else - #error illegal YFLIP value - #endif - -#else - #error unsupported rotation angle specified -#endif - -#if DOCLIP == 0 - #define CLIP _NOCLIP - #define TESTCLIP(x) (1) -#elif DOCLIP == 1 - #define CLIP _CLIP - #define TESTCLIP(x) (nTileXPos >= -(x) && nTileXPos < (320 - (x))) -#else - #error illegal doclip value. -#endif - -#if ISOPAQUE == 0 - #define OPACITY _TRANS - #define TESTCOLOUR(x) (x) -#elif ISOPAQUE == 1 - #define OPACITY _OPAQUE - #define TESTCOLOUR(x) (1) -#else - #error illegal isopaque value -#endif - -#if BPP == 16 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTCLIP(a)) { \ - *((UINT16*)pPixel) = (UINT16)pTilePalette[b]; \ - } -#elif BPP == 24 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTCLIP(a)) { \ - UINT32 nRGB = pTilePalette[b]; \ - pPixel[0] = (UINT8)nRGB; \ - pPixel[1] = (UINT8)(nRGB >> 8); \ - pPixel[2] = (UINT8)(nRGB >> 16); \ - } -#elif BPP == 32 - #define PLOTPIXEL(a,b) if (TESTCOLOUR(b) && TESTCLIP(a)) { \ - *((UINT32*)pPixel) = (UINT32)pTilePalette[b]; \ - } -#else - #error unsupported bitdepth specified. -#endif - -// For decorating the function name -#if XFLIP == 1 - #if YFLIP == 1 - #define FLIP _FLIPXY - #else - #define FLIP _FLIPX - #endif -#elif YFLIP == 1 - #define FLIP _FLIPY -#else - #define FLIP _NOFLIP -#endif - -static void FUNCTIONNAME(BPP,ROT,FLIP,CLIP,OPACITY)() -{ - UINT8 *pTileRow, *pPixel; - INT32 y, nColour; - - #if ROT == 0 - #if YFLIP == 0 - for (y = 0, pTileRow = pTile; y < 8; y++, ADVANCEROW) { - #else - for (y = 7, pTileRow = pTile + ((BPP >> 3) * 320 * 7); y >= 0; y--, ADVANCEROW) { - #endif - #else - #if YFLIP == 0 - for (y = 0, pTileRow = pTile; y < 8; y++, ADVANCEROW) { - #else - for (y = 7, pTileRow = pTile + ((BPP >> 3) * 7); y >= 0; y--, ADVANCEROW) { - #endif - #endif - - #if DOCLIP == 1 - if (nTileYPos + y < 0 || nTileYPos + y >= 240) { - pTileData++; - continue; - } - #endif - - #if ROT == 0 - #if XFLIP == 0 - #define OFFSET(a) a - pPixel = pTileRow; - #else - #define OFFSET(a) (7 - a) - pPixel = pTileRow + ((BPP >> 3) * 7); - #endif - #else - #if XFLIP == 0 - #define OFFSET(a) a - pPixel = pTileRow; - #else - #define OFFSET(a) (7 - a) - pPixel = pTileRow - ((BPP >> 3) * 240 * 7); - #endif - #endif - - nColour = BURN_ENDIAN_SWAP_INT32(*pTileData++); - PLOTPIXEL(OFFSET(0), nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - PLOTPIXEL(OFFSET(1), nColour & 0x0F); - ADVANCECOLUMN; - - nColour >>= 4; - PLOTPIXEL(OFFSET(2), nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - PLOTPIXEL(OFFSET(3), nColour & 0x0F); - ADVANCECOLUMN; - - nColour >>= 4; - PLOTPIXEL(OFFSET(4), nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - PLOTPIXEL(OFFSET(5), nColour & 0x0F); - ADVANCECOLUMN; - - nColour >>= 4; - PLOTPIXEL(OFFSET(6), nColour & 0x0F); - ADVANCECOLUMN; - nColour >>= 4; - PLOTPIXEL(OFFSET(7), nColour & 0x0F); - - #undef OFFSET - - } -} - -#undef FLIP -#undef CLIP -#undef PLOTPIXEL -#undef TESTCLIP -#undef TESTCOLOUR -#undef ADVANCEROW -#undef ADVANCECOLUMN -#undef OPACITY -#undef FUNCTIONNAME -#undef FN - diff --git a/jan/src/burn/drv/toaplan/toa_palette.cpp b/jan/src/burn/drv/toaplan/toa_palette.cpp deleted file mode 100644 index 08c5dcf26..000000000 --- a/jan/src/burn/drv/toaplan/toa_palette.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "toaplan.h" -// Toaplan -- palette functions - -UINT8* ToaPalSrc; // Pointer to input palette -UINT8* ToaPalSrc2; -UINT32* ToaPalette; -UINT32* ToaPalette2; -INT32 nToaPalLen; - -UINT8 ToaRecalcPalette; // Set to 1 to force recalculation of the entire palette (not needed now) - -INT32 ToaPalInit() -{ - return 0; -} - -INT32 ToaPalExit() -{ - return 0; -} - -inline static UINT32 CalcCol(UINT16 nColour) -{ - INT32 r, g, b; - - r = (BURN_ENDIAN_SWAP_INT16(nColour) & 0x001F) << 3; // Red - r |= r >> 5; - g = (BURN_ENDIAN_SWAP_INT16(nColour) & 0x03E0) >> 2; // Green - g |= g >> 5; - b = (BURN_ENDIAN_SWAP_INT16(nColour) & 0x7C00) >> 7; // Blue - b |= b >> 5; - - return BurnHighCol(r, g, b, 0); -} - -INT32 ToaPalUpdate() -{ - UINT16* ps = (UINT16*)ToaPalSrc; - UINT32* pd = ToaPalette; - - pBurnDrvPalette = ToaPalette; - - for (INT32 i = 0; i < nToaPalLen; i++) { - pd[i] = CalcCol(ps[i]); - } - return 0; -} - -INT32 ToaPal2Update() -{ - UINT16* ps = (UINT16*)ToaPalSrc2; - UINT32* pd = ToaPalette2; - -// pBurnDrvPalette = ToaPalette2; - - for (INT32 i = 0; i < nToaPalLen; i++) { - pd[i] = CalcCol(ps[i]); - } - return 0; -} diff --git a/jan/src/burn/drv/toaplan/toaplan.cpp b/jan/src/burn/drv/toaplan/toaplan.cpp deleted file mode 100644 index 957a56386..000000000 --- a/jan/src/burn/drv/toaplan/toaplan.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include "toaplan.h" - -UINT8* RomZ80; -UINT8* RamZ80; - -// Used to keep track of emulated CPU cycles -INT32 nCyclesDone[2], nCyclesTotal[2]; -INT32 nCyclesSegment; - -INT32 nToaCyclesScanline; -INT32 nToaCyclesDisplayStart; -INT32 nToaCyclesVBlankStart; - -// Variables for the graphics drawing -bool bRotatedScreen; -UINT8* pBurnBitmap; -INT32 nBurnColumn; -INT32 nBurnRow; - -// This function loads interleaved code ROMs. -// All even roms should be first, followed by all odd ROMs. -INT32 ToaLoadCode(UINT8* pROM, INT32 nStart, INT32 nCount) -{ - nCount >>= 1; - - for (INT32 nOdd = 0; nOdd < 2; nOdd++) { - UINT8* pLoad = pROM + (nOdd ^ 1); // ^1 for byteswapped - - for (INT32 i = 0; i < nCount; i++) { - struct BurnRomInfo ri; - // Load these even/odd bytes - if (BurnLoadRom(pLoad, nStart + i, 2)) { - return 1; - } - - // Increment position by the length of the rom * 2 - ri.nLen = 0; - BurnDrvGetRomInfo(&ri, nStart + i); - pLoad += ri.nLen << 1; - } - nStart += nCount; - } - return 0; -} - -// This function decodes the tile data for the GP9001 chip in place. -INT32 ToaLoadGP9001Tiles(UINT8* pDest, INT32 nStart, INT32 nNumFiles, INT32 nROMSize, bool bSwap) // bSwap = false -{ - UINT8* pTile; - INT32 nSwap; - - for (INT32 i = 0; i < (nNumFiles >> 1); i++) { - BurnLoadRom(pDest + (i * 2 * nROMSize / nNumFiles), nStart + i, 2); - BurnLoadRom(pDest + (i * 2 * nROMSize / nNumFiles) + 1, nStart + (nNumFiles >> 1) + i, 2); - } - - BurnUpdateProgress(0.0, _T("Decoding graphics..."), 0); - - if (bSwap) { - nSwap = 2; - } else { - nSwap = 0; - } - - for (pTile = pDest; pTile < (pDest + nROMSize); pTile += 4) { - UINT8 data[4]; - for (INT32 n = 0; n < 4; n++) { - INT32 m = 7 - (n << 1); - UINT8 nPixels = ((pTile[0 ^ nSwap] >> m) & 1) << 0; - nPixels |= ((pTile[2 ^ nSwap] >> m) & 1) << 1; - nPixels |= ((pTile[1 ^ nSwap] >> m) & 1) << 2; - nPixels |= ((pTile[3 ^ nSwap] >> m) & 1) << 3; - nPixels |= ((pTile[0 ^ nSwap] >> (m - 1)) & 1) << 4; - nPixels |= ((pTile[2 ^ nSwap] >> (m - 1)) & 1) << 5; - nPixels |= ((pTile[1 ^ nSwap] >> (m - 1)) & 1) << 6; - nPixels |= ((pTile[3 ^ nSwap] >> (m - 1)) & 1) << 7; - - data[n] = nPixels; - } - - for (INT32 n = 0; n < 4; n++) { - pTile[n] = data[n]; - } - } - return 0; -} - -// This function fills the screen with the first palette entry -void ToaClearScreen(INT32 PalOffset) -{ - if (*ToaPalette) { - switch (nBurnBpp) { - case 4: { - UINT32* pClear = (UINT32*)pBurnDraw; - UINT32 nColour = ToaPalette[PalOffset]; - for (INT32 i = 0; i < 320 * 240 / 8; i++) { - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - } - break; - } - - case 3: { - UINT8* pClear = pBurnDraw; - UINT32 nColour = ToaPalette[PalOffset]; - UINT8 r = nColour & 0xFF; - UINT8 g = (nColour >> 8) & 0xFF; - UINT8 b = (nColour >> 16) & 0xFF; - r &= 0xFF; - for (INT32 i = 0; i < 320 * 240; i++) { - *pClear++ = r; - *pClear++ = g; - *pClear++ = b; - } - break; - } - - case 2: { - UINT32* pClear = (UINT32*)pBurnDraw; - UINT32 nColour = ToaPalette[PalOffset] | ToaPalette[PalOffset] << 16; - for (INT32 i = 0; i < 320 * 240 / 16; i++) { - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - *pClear++ = nColour; - } - break; - } - } - } else { - memset(pBurnDraw, 0, 320 * 240 * nBurnBpp); - } -} - -void ToaZExit() -{ - ZetExit(); -} diff --git a/jan/src/burn/drv/toaplan/toaplan.h b/jan/src/burn/drv/toaplan/toaplan.h deleted file mode 100644 index 8facad190..000000000 --- a/jan/src/burn/drv/toaplan/toaplan.h +++ /dev/null @@ -1,304 +0,0 @@ -#include "burnint.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "msm6295.h" -#include "burn_ym2151.h" -#include "burn_ym3812.h" - -// Uncomment to have the driver perform the screen rotation (faster unless 3D hardware is used for blitting). -// #undef DRIVER_ROTATION -// #define DRIVER_ROTATION - -const INT32 TOA_68K_SPEED = 16000000; -const INT32 TOA_Z80_SPEED = 4000000; -const INT32 TOA_VBLANK_LINES = 22; - -extern INT32 Hellfire; -extern INT32 Rallybik; - -// toaplan.cpp -extern INT32 nToaCyclesScanline; -extern INT32 nToaCyclesDisplayStart; -extern INT32 nToaCyclesVBlankStart; - -INT32 ToaLoadCode(UINT8 *Rom, INT32 nStart, INT32 nCount); -INT32 ToaLoadGP9001Tiles(UINT8* pDest, INT32 nStart, INT32 nNumFiles, INT32 nROMSize, bool bSwap = false); - -void ToaClearScreen(INT32 PalOffset); - -void ToaZExit(); - -extern UINT8* RomZ80; -extern UINT8* RamZ80; - -extern INT32 nCyclesDone[2], nCyclesTotal[2]; -extern INT32 nCyclesSegment; - -#ifdef DRIVER_ROTATION - extern bool bToaRotateScreen; - #define TOA_ROTATE_GRAPHICS_CCW 0 -#else - const bool bToaRotateScreen = false; - #define TOA_ROTATE_GRAPHICS_CCW BDF_ORIENTATION_VERTICAL -#endif - -extern UINT8* pBurnBitmap; -extern INT32 nBurnColumn; -extern INT32 nBurnRow; - -inline void ToaGetBitmap() -{ - if (bToaRotateScreen) { - pBurnBitmap = pBurnDraw + 319 * nBurnPitch; - nBurnColumn = -nBurnPitch; - nBurnRow = nBurnBpp; - } else { - pBurnBitmap = pBurnDraw; - nBurnColumn = nBurnBpp; - nBurnRow = nBurnPitch; - } -} - -inline void ToaClearOpposites(UINT8* nJoystickInputs) -{ - if ((*nJoystickInputs & 0x03) == 0x03) { - *nJoystickInputs &= ~0x03; - } - if ((*nJoystickInputs & 0x0C) == 0x0C) { - *nJoystickInputs &= ~0x0C; - } -} - -// toa_pal.cpp -extern UINT8 *ToaPalSrc; -extern UINT32* ToaPalette; -extern UINT8 ToaRecalcPalette; -extern INT32 nToaPalLen; - -INT32 ToaPalInit(); -INT32 ToaPalExit(); -INT32 ToaPalUpdate(); - -// toa_gp9001.cpp -extern UINT8* GP9001ROM[2]; -extern UINT32 nGP9001ROMSize[2]; - -extern UINT32 GP9001TileBank[8]; - -extern UINT8* GP9001RAM[2]; -extern UINT16* GP9001Reg[2]; - -extern INT32 nSpriteXOffset, nSpriteYOffset, nSpritePriority; - -extern INT32 nLayer0XOffset, nLayer0YOffset, nLayer0Priority; -extern INT32 nLayer1XOffset, nLayer1YOffset, nLayer1Priority; -extern INT32 nLayer2XOffset, nLayer2YOffset, nLayer2Priority; -extern INT32 nLayer3XOffset, nLayer3YOffset; - -INT32 ToaBufferGP9001Sprites(); -INT32 ToaRenderGP9001(); -INT32 ToaInitGP9001(INT32 n = 1); -INT32 ToaExitGP9001(); -INT32 ToaScanGP9001(INT32 nAction, INT32* pnMin); -INT32 ToaScanBCU2(INT32 nAction, INT32* pnMin); - -inline static void ToaGP9001SetRAMPointer(UINT32 wordValue, const INT32 nController = 0) -{ - extern UINT8* GP9001Pointer[2]; - extern UINT32 GP9001PointerCfg[2]; - - wordValue &= 0x1FFF; - GP9001PointerCfg[nController] = wordValue; // for reconfig @ state load - GP9001Pointer[nController] = GP9001RAM[nController] + (wordValue << 1); -} - -inline static void ToaGP9001WriteRAM(const UINT16 wordValue, const INT32 nController) -{ - extern UINT8* GP9001Pointer[2]; - extern UINT32 GP9001PointerCfg[2]; - - *((UINT16*)(GP9001Pointer[nController])) = BURN_ENDIAN_SWAP_INT16(wordValue); - GP9001Pointer[nController] += 2; - GP9001PointerCfg[nController] += 1; // +1 because (wordValue << 1) in ToaGP9001SetRAMPointer() -} - -inline static UINT16 ToaGP9001ReadRAM_Hi(const INT32 nController) -{ - extern UINT8* GP9001Pointer[2]; - - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(GP9001Pointer[nController]))); -} - -inline static UINT16 ToaGP9001ReadRAM_Lo(const INT32 nController) -{ - extern UINT8* GP9001Pointer[2]; - - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(GP9001Pointer[nController] + 2))); -} - -inline static void ToaGP9001SelectRegister(const UINT16 wordValue, const INT32 nController = 0) -{ - extern INT32 GP9001Regnum[2]; - - GP9001Regnum[nController] = wordValue & 0xFF; -} - -inline static void ToaGP9001WriteRegister(const UINT16 wordValue, const INT32 nController = 0) -{ - extern INT32 GP9001Regnum[2]; - - GP9001Reg[nController][GP9001Regnum[nController]] = wordValue; -} - -inline static UINT16 ToaVBlankRegister() -{ - INT32 nCycles = SekTotalCycles(); - - if (nCycles >= nToaCyclesVBlankStart) { - return 1; - } else { - if (nCycles < nToaCyclesDisplayStart) { - return 1; - } - } - return 0; -} - -inline static UINT16 ToaScanlineRegister() -{ - static INT32 nPreviousScanline; - UINT16 nFlags = 0xFE00; - INT32 nCurrentScanline = SekCurrentScanline(); - -#if 0 - // None of the games actually use this - INT32 nCurrentBeamPosition = SekTotalCycles() % nToaCyclesScanline; - if (nCurrentBeamPosition < 64) { - nFlags &= ~0x4000; - } -#endif - - if (nCurrentScanline != nPreviousScanline) { - nPreviousScanline = nCurrentScanline; - nFlags &= ~0x8000; - -// bprintf(PRINT_NORMAL, _T(" - line %3i, PC 0x%08X\n"), nCurrentScanline, SekGetPC(-1)); - - } - - return nFlags | nCurrentScanline; -} - -// toa_extratext.cpp -extern UINT8* ExtraTROM; -extern UINT8* ExtraTRAM; -extern UINT8* ExtraTScroll; -extern UINT8* ExtraTSelect; -extern INT32 nExtraTXOffset; - -INT32 ToaExtraTextLayer(); -INT32 ToaExtraTextInit(); -void ToaExtraTextExit(); - -// toa_bcu2.cpp -extern INT32 ToaOpaquePriority; -extern UINT8* ToaPalSrc2; -extern UINT32* ToaPalette2; - -extern UINT8* BCU2ROM; -extern UINT8* FCU2ROM; - -extern UINT8* BCU2RAM; -extern UINT8* FCU2RAM; -extern UINT8* FCU2RAMSize; - -extern UINT32 BCU2Pointer; -extern UINT32 FCU2Pointer; - -extern UINT32 nBCU2ROMSize; -extern UINT32 nFCU2ROMSize; - -extern UINT16 BCU2Reg[8]; - -extern INT32 nBCU2TileXOffset; -extern INT32 nBCU2TileYOffset; -extern INT32 nFCU2SpriteXOffset; -extern INT32 nFCU2SpriteYOffset; - -INT32 ToaPal2Update(); -INT32 ToaInitBCU2(); -INT32 ToaExitBCU2(); -void ToaBufferFCU2Sprites(); -INT32 ToaRenderBCU2(); - -// toaplan1.cpp -extern INT32 nToa1Cycles68KSync; - -INT32 ToaLoadTiles(UINT8* pDest, INT32 nStart, INT32 nROMSize); -void toaplan1FMIRQHandler(INT32, INT32 nStatus); -INT32 toaplan1SynchroniseStream(INT32 nSoundRate); -UINT8 __fastcall toaplan1ReadByteZ80RAM(UINT32 sekAddress); -UINT16 __fastcall toaplan1ReadWordZ80RAM(UINT32 sekAddress); -void __fastcall toaplan1WriteByteZ80RAM(UINT32 sekAddress, UINT8 byteValue); -void __fastcall toaplan1WriteWordZ80RAM(UINT32 sekAddress, UINT16 wordValue); - -inline void ToaBCU2SetRAMPointer(UINT32 wordValue) -{ - BCU2Pointer = (wordValue & 0x3FFF) << 1; -} - -inline UINT16 ToaBCU2GetRAMPointer() -{ - return (BCU2Pointer >> 1) & 0x3FFF; -} - -inline void ToaBCU2WriteRAM(const UINT16 wordValue) -{ - ((UINT16*)BCU2RAM)[BCU2Pointer & 0x7FFF] = wordValue; - BCU2Pointer++; -} - -inline UINT16 ToaBCU2ReadRAM_Hi() -{ - return ((UINT16*)BCU2RAM)[BCU2Pointer & 0x7FFF]; -} - -inline UINT16 ToaBCU2ReadRAM_Lo() -{ - return ((UINT16*)BCU2RAM)[(BCU2Pointer & 0x7FFF) + 1]; -} - -inline void ToaFCU2SetRAMPointer(UINT32 wordValue) -{ - FCU2Pointer = wordValue & 0x03FF; -} - -inline UINT16 ToaFCU2GetRAMPointer() -{ - return FCU2Pointer & 0x03FF; -} - -inline void ToaFCU2WriteRAM(const UINT16 wordValue) -{ - ((UINT16*)FCU2RAM)[FCU2Pointer & 0x03FF] = wordValue; - FCU2Pointer++; -} - -inline void ToaFCU2WriteRAMSize(const UINT16 wordValue) -{ - ((UINT16*)FCU2RAMSize)[FCU2Pointer & 0x003F] = wordValue; - FCU2Pointer++; -} - -inline UINT16 ToaFCU2ReadRAM() -{ - return ((UINT16*)FCU2RAM)[FCU2Pointer & 0x03FF]; -} - -inline UINT16 ToaFCU2ReadRAMSize() -{ - return ((UINT16*)FCU2RAMSize)[FCU2Pointer & 0x003F]; -} - -// d_battleg.cpp -extern INT32 Bgareggabl; diff --git a/jan/src/burn/drv/toaplan/toaplan1.cpp b/jan/src/burn/drv/toaplan/toaplan1.cpp deleted file mode 100644 index cc63fd575..000000000 --- a/jan/src/burn/drv/toaplan/toaplan1.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "toaplan.h" - -// This function decodes the tile data for the GP9001 chip in place. -INT32 ToaLoadTiles(UINT8* pDest, INT32 nStart, INT32 nROMSize) -{ - UINT8* pTile; - INT32 nSwap = 3; - - BurnLoadRom(pDest + 3, nStart + 0, 4); - BurnLoadRom(pDest + 1, nStart + 1, 4); - BurnLoadRom(pDest + 2, nStart + 2, 4); - BurnLoadRom(pDest + 0, nStart + 3, 4); - - for (pTile = pDest; pTile < (pDest + nROMSize); pTile += 4) { - UINT8 data[4]; - for (INT32 n = 0; n < 4; n++) { - INT32 m = 7 - (n << 1); - UINT8 nPixels = ((pTile[0 ^ nSwap] >> m) & 1) << 0; - nPixels |= ((pTile[2 ^ nSwap] >> m) & 1) << 1; - nPixels |= ((pTile[1 ^ nSwap] >> m) & 1) << 2; - nPixels |= ((pTile[3 ^ nSwap] >> m) & 1) << 3; - nPixels |= ((pTile[0 ^ nSwap] >> (m - 1)) & 1) << 4; - nPixels |= ((pTile[2 ^ nSwap] >> (m - 1)) & 1) << 5; - nPixels |= ((pTile[1 ^ nSwap] >> (m - 1)) & 1) << 6; - nPixels |= ((pTile[3 ^ nSwap] >> (m - 1)) & 1) << 7; - - data[n] = nPixels; - } - - for (INT32 n = 0; n < 4; n++) { - pTile[n] = data[n]; - } - } - return 0; -} - -// ---------------------------------------------------------------------------- -// CPU synchronisation - -INT32 nToa1Cycles68KSync; - -// Callbacks for the FM chip - -void toaplan1FMIRQHandler(INT32, INT32 nStatus) -{ - if (nStatus) { - ZetSetIRQLine(0xFF, CPU_IRQSTATUS_ACK); - } else { - ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); - } -} - -INT32 toaplan1SynchroniseStream(INT32 nSoundRate) -{ - return (INT64)ZetTotalCycles() * nSoundRate / 3500000; -} - -// ---------------------------------------------------------------------------- - -inline void toaplan1SynchroniseZ80(INT32 nExtraCycles) -{ - INT32 nCycles = ((INT64)SekTotalCycles() * nCyclesTotal[1] / nCyclesTotal[0]) + nExtraCycles; - - if (nCycles <= ZetTotalCycles()) { - return; - } - - nToa1Cycles68KSync = nCycles - nExtraCycles; - - BurnTimerUpdateYM3812(nCycles); -} - -UINT8 __fastcall toaplan1ReadByteZ80RAM(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, _T(" Z80 %04X read\n"), sekAddress & 0x0FFF); - - toaplan1SynchroniseZ80(0); - return RamZ80[(sekAddress & 0x0FFF) >> 1]; -} - -UINT16 __fastcall toaplan1ReadWordZ80RAM(UINT32 sekAddress) -{ -// bprintf(PRINT_NORMAL, _T(" Z80 %04X read\n"), sekAddress & 0x0FFF); - - toaplan1SynchroniseZ80(0); - return RamZ80[(sekAddress & 0x0FFF) >> 1]; -} - -void __fastcall toaplan1WriteByteZ80RAM(UINT32 sekAddress, UINT8 byteValue) -{ -// bprintf(PRINT_NORMAL, _T(" Z80 %04X -> %02X\n"), sekAddress & 0x0FFF, byteValue); - - toaplan1SynchroniseZ80(0); - RamZ80[(sekAddress & 0x0FFF) >> 1] = byteValue; -} - -void __fastcall toaplan1WriteWordZ80RAM(UINT32 sekAddress, UINT16 wordValue) -{ -// bprintf(PRINT_NORMAL, _T(" Z80 %04X -> %04X\n"), sekAddress & 0x0FFF, wordValue); - - toaplan1SynchroniseZ80(0); - RamZ80[(sekAddress & 0x0FFF) >> 1] = wordValue & 0xFF; -} - -// ---------------------------------------------------------------------------- diff --git a/jan/src/burn/hiscore.cpp b/jan/src/burn/hiscore.cpp deleted file mode 100644 index cd3b67bd0..000000000 --- a/jan/src/burn/hiscore.cpp +++ /dev/null @@ -1,761 +0,0 @@ -#include "burnint.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "nec_intf.h" -#include "sh2_intf.h" -#include "m6502_intf.h" -#include "m6809_intf.h" -#include "hd6309_intf.h" -#include "m6800_intf.h" -#include "s2650_intf.h" - -// A hiscore.dat support module for FBA - written by Treble Winner, Feb 2009 -// At some point we really need a CPU interface to track CPU types and numbers, -// to make this module and the cheat engine foolproof - -#define MAX_CONFIG_LINE_SIZE 48 - -#define HISCORE_MAX_RANGES 20 - -UINT32 nHiscoreNumRanges; - -#define APPLIED_STATE_NONE 0 -#define APPLIED_STATE_ATTEMPTED 1 -#define APPLIED_STATE_CONFIRMED 2 - -struct _HiscoreMemRange -{ - UINT32 Loaded, nCpu, Address, NumBytes, StartValue, EndValue, ApplyNextFrame, Applied; - UINT8 *Data; -}; - -_HiscoreMemRange HiscoreMemRange[HISCORE_MAX_RANGES]; - -INT32 EnableHiscores; -static INT32 HiscoresInUse; -static INT32 WriteCheck1; - -static INT32 nCpuType; -extern INT32 nSekCount; - -static void set_cpu_type() -{ - if (nSekCount > -1) - { - nCpuType = 1; // Motorola 68000 - } - else if (nVezCount) - { - nCpuType = 2; // NEC V30 / V33 - } - else if (has_sh2) - { - nCpuType = 3; // Hitachi SH2 - } - else if (nHD6309Count) - { - nCpuType = 7; // HD6309 - } - else if (nM6809Count) - { - nCpuType = 6; // M6809 - } - else if (nHasZet > -1) - { - nCpuType = 5; // Zilog Z80 - } - else if (nM6502Count) - { - nCpuType = 4; // MOS 6502 - } - else if (nM6800Count) - { - nCpuType = 8; // M6800 & Family - } - else if (s2650Count) - { - nCpuType = 9; // S2650 - } - else - { - nCpuType = 0; // Unknown (don't use cheats) - } -} - -static void cpu_open(INT32 nCpu) -{ - switch (nCpuType) - { - case 1: - SekOpen(nCpu); - break; - - case 2: - VezOpen(nCpu); - break; - - case 3: - Sh2Open(nCpu); - break; - - case 4: - M6502Open(nCpu); - break; - - case 5: - ZetOpen(nCpu); - break; - - case 6: - M6809Open(nCpu); - break; - - case 7: - HD6309Open(nCpu); - break; - - case 8: - break; - - case 9: - s2650Open(nCpu); - break; - } -} - -static void cpu_close() -{ - switch (nCpuType) - { - case 1: - SekClose(); - break; - - case 2: - VezClose(); - break; - - case 3: - Sh2Close(); - break; - - case 4: - M6502Close(); - break; - - case 5: - ZetClose(); - break; - - case 6: - M6809Close(); - break; - - case 7: - HD6309Close(); - break; - - case 8: - break; - - case 9: - s2650Close(); - break; - } -} - -/*static INT32 cpu_get_active() -{ - switch (nCpuType) { - case 1: { - return SekGetActive(); - } - - case 2: { - return VezGetActive(); - } - - case 3: { - return Sh2GetActive(); - } - - case 4: { - return m6502GetActive(); - } - - case 5: { - return ZetGetActive(); - } - - case 6: { - return M6809GetActive(); - } - - case 7: { - return HD6309GetActive(); - } - - case 8: { - return -1; - } - - case 9: { - return nActiveS2650; - } - } -} -*/ -static UINT8 cpu_read_byte(UINT32 a) -{ - switch (nCpuType) - { - case 1: - return SekReadByte(a); - - case 2: - return cpu_readmem20(a); - - case 3: - return Sh2ReadByte(a); - - case 4: - return M6502ReadByte(a); - - case 5: - return ZetReadByte(a); - - case 6: - return M6809ReadByte(a); - - case 7: - return HD6309ReadByte(a); - - case 8: - return M6800ReadByte(a); - - case 9: - return s2650Read(a); - } - - return 0; -} - -static void cpu_write_byte(UINT32 a, UINT8 d) -{ - switch (nCpuType) - { - case 1: - SekWriteByteROM(a, d); - break; - - case 2: - cpu_writemem20(a, d); - break; - - case 3: - Sh2WriteByte(a, d); - break; - - case 4: - M6502WriteByte(a, d); - break; - - case 5: - ZetWriteByte(a, d); - break; - - case 6: - M6809WriteByte(a, d); - break; - - case 7: - HD6309WriteByte(a, d); - break; - - case 8: - M6800WriteByte(a, d); - break; - - case 9: - s2650Write(a, d); - break; - } -} - -static UINT32 hexstr2num (const char **pString) -{ - const char *string = *pString; - UINT32 result = 0; - if (string) - { - for(;;) - { - char c = *string++; - INT32 digit; - - if (c>='0' && c<='9') - { - digit = c-'0'; - } - else if (c>='a' && c<='f') - { - digit = 10+c-'a'; - } - else if (c>='A' && c<='F') - { - digit = 10+c-'A'; - } - else - { - if (!c) string = NULL; - break; - } - result = result*16 + digit; - } - *pString = string; - } - return result; -} - -static INT32 is_mem_range (const char *pBuf) -{ - char c; - for(;;) - { - c = *pBuf++; - if (c == 0) return 0; /* premature EOL */ - if (c == ':') break; - } - c = *pBuf; /* character following first ':' */ - - return (c>='0' && c<='9') || - (c>='a' && c<='f') || - (c>='A' && c<='F'); -} - -static INT32 is_mem_range_new (const char *pBuf) -{ - char c; - for(;;) - { - c = *pBuf++; - if (c == 0) return 0; /* premature EOL */ - if (c == ':') break; - } - c = *pBuf; /* character following first ':' */ - - // cpu id - ignore for now - for(;;) - { - c = *pBuf++; - if (c == 0) return 0; /* premature EOL */ - if (c == ',') break; - } - c = *pBuf; /* character following first ',' */ - - // address space - ignore for now - for(;;) - { - c = *pBuf++; - if (c == 0) return 0; /* premature EOL */ - if (c == ',') break; - } - c = *pBuf; /* character following second ',' */ - - return (c>='0' && c<='9') || - (c>='a' && c<='f') || - (c>='A' && c<='F'); -} - -static INT32 cpustr2num(char *pCpu) -{ // all known versions of the first cpu as of May 15, 2017 - return (strstr(pCpu, "maincpu") || - strstr(pCpu, "cpu1") || - strstr(pCpu, "master") || - strstr(pCpu, "fgcpu") || - strstr(pCpu, "cpua") || - strstr(pCpu, "master_cpu")) ? 0 : 1; -} - -static INT32 matching_game_name (const char *pBuf, const char *name) -{ - while (*name) - { - if (*name++ != *pBuf++) return 0; - } - return (*pBuf == ':'); -} - -static INT32 CheckHiscoreAllowed() -{ - INT32 Allowed = 1; - - if (!EnableHiscores) Allowed = 0; - if (!(BurnDrvGetFlags() & BDF_HISCORE_SUPPORTED)) Allowed = 0; - - return Allowed; -} - -void HiscoreInit() -{ - Debug_HiscoreInitted = 1; - - if (!CheckHiscoreAllowed()) return; - - HiscoresInUse = 0; - - TCHAR szDatFilename[MAX_PATH]; - _stprintf(szDatFilename, _T("%shiscore.dat"), szAppHiscorePath); - - FILE *fp = _tfopen(szDatFilename, _T("r")); - if (fp) { - char buffer[MAX_CONFIG_LINE_SIZE]; - enum { FIND_NAME, FIND_DATA, FETCH_DATA } mode; - mode = FIND_NAME; - - while (fgets(buffer, MAX_CONFIG_LINE_SIZE, fp)) { - if (mode == FIND_NAME) { - if (matching_game_name(buffer, BurnDrvGetTextA(DRV_NAME))) { - mode = FIND_DATA; - } - } else { - if (buffer[0] == '@' && buffer[1] == ':') { - if (is_mem_range_new(buffer)) { - if (nHiscoreNumRanges < HISCORE_MAX_RANGES) { - const char *pBuf = buffer; - char cCpu[80]; - char *pCpu = &cCpu[0]; - - // increment pBuf to the address - char c; - - for (;;) { - c = *pBuf++; - if (c == ':') break; - } - - c = *pBuf; /* character following first ':' */ - - // cpu id -> cCpu - for(;;) - { - c = *pBuf++; - if (c == ',') { *pCpu++ = '\0'; break; } - else *pCpu++ = c; - } - c = *pBuf; /* character following first ',' */ - - // address space - ignore for now - for(;;) - { - c = *pBuf++; - if (c == ',') break; - } - c = *pBuf; /* character following second ',' */ - - // now set the high score data - HiscoreMemRange[nHiscoreNumRanges].Loaded = 0; - HiscoreMemRange[nHiscoreNumRanges].nCpu = cpustr2num(&cCpu[0]); - HiscoreMemRange[nHiscoreNumRanges].Address = hexstr2num(&pBuf); - HiscoreMemRange[nHiscoreNumRanges].NumBytes = hexstr2num(&pBuf); - HiscoreMemRange[nHiscoreNumRanges].StartValue = hexstr2num(&pBuf); - HiscoreMemRange[nHiscoreNumRanges].EndValue = hexstr2num(&pBuf); - HiscoreMemRange[nHiscoreNumRanges].ApplyNextFrame = 0; - HiscoreMemRange[nHiscoreNumRanges].Applied = 0; - HiscoreMemRange[nHiscoreNumRanges].Data = (UINT8*)BurnMalloc(HiscoreMemRange[nHiscoreNumRanges].NumBytes); - memset(HiscoreMemRange[nHiscoreNumRanges].Data, 0, HiscoreMemRange[nHiscoreNumRanges].NumBytes); - -#if 1 && defined FBA_DEBUG - bprintf(PRINT_IMPORTANT, _T("Hi Score Memory Range %i Loaded (New Format) - CPU %i (%S), Address %x, Bytes %02x, Start Val %x, End Val %x\n"), nHiscoreNumRanges, HiscoreMemRange[nHiscoreNumRanges].nCpu, cCpu, HiscoreMemRange[nHiscoreNumRanges].Address, HiscoreMemRange[nHiscoreNumRanges].NumBytes, HiscoreMemRange[nHiscoreNumRanges].StartValue, HiscoreMemRange[nHiscoreNumRanges].EndValue); -#endif - - nHiscoreNumRanges++; - - mode = FETCH_DATA; - } else { - break; - } - } else { - if (mode == FETCH_DATA) break; - } - } else { - if (is_mem_range(buffer)) { - if (nHiscoreNumRanges < HISCORE_MAX_RANGES) { - const char *pBuf = buffer; - - HiscoreMemRange[nHiscoreNumRanges].Loaded = 0; - HiscoreMemRange[nHiscoreNumRanges].nCpu = hexstr2num(&pBuf); - HiscoreMemRange[nHiscoreNumRanges].Address = hexstr2num(&pBuf); - HiscoreMemRange[nHiscoreNumRanges].NumBytes = hexstr2num(&pBuf); - HiscoreMemRange[nHiscoreNumRanges].StartValue = hexstr2num(&pBuf); - HiscoreMemRange[nHiscoreNumRanges].EndValue = hexstr2num(&pBuf); - HiscoreMemRange[nHiscoreNumRanges].ApplyNextFrame = 0; - HiscoreMemRange[nHiscoreNumRanges].Applied = 0; - HiscoreMemRange[nHiscoreNumRanges].Data = (UINT8*)BurnMalloc(HiscoreMemRange[nHiscoreNumRanges].NumBytes); - memset(HiscoreMemRange[nHiscoreNumRanges].Data, 0, HiscoreMemRange[nHiscoreNumRanges].NumBytes); - -#if 1 && defined FBA_DEBUG - bprintf(PRINT_IMPORTANT, _T("Hi Score Memory Range %i Loaded - CPU %i, Address %x, Bytes %02x, Start Val %x, End Val %x\n"), nHiscoreNumRanges, HiscoreMemRange[nHiscoreNumRanges].nCpu, HiscoreMemRange[nHiscoreNumRanges].Address, HiscoreMemRange[nHiscoreNumRanges].NumBytes, HiscoreMemRange[nHiscoreNumRanges].StartValue, HiscoreMemRange[nHiscoreNumRanges].EndValue); -#endif - - nHiscoreNumRanges++; - - mode = FETCH_DATA; - } else { - break; - } - } else { - if (mode == FETCH_DATA) break; - } - } - } - } - - fclose(fp); - } - - if (nHiscoreNumRanges) HiscoresInUse = 1; - - TCHAR szFilename[MAX_PATH]; - _stprintf(szFilename, _T("%s%s.hi"), szAppHiscorePath, BurnDrvGetText(DRV_NAME)); - - fp = _tfopen(szFilename, _T("rb")); - INT32 Offset = 0; - if (fp) { - UINT32 nSize = 0; - - while (!feof(fp)) { - fgetc(fp); - nSize++; - } - - UINT8 *Buffer = (UINT8*)BurnMalloc(nSize); - rewind(fp); - - fread((char *)Buffer, 1, nSize, fp); - - for (UINT32 i = 0; i < nHiscoreNumRanges; i++) { - for (UINT32 j = 0; j < HiscoreMemRange[i].NumBytes; j++) { - HiscoreMemRange[i].Data[j] = Buffer[j + Offset]; - } - Offset += HiscoreMemRange[i].NumBytes; - - HiscoreMemRange[i].Loaded = 1; - -#if 1 && defined FBA_DEBUG - bprintf(PRINT_IMPORTANT, _T("Hi Score Memory Range %i Loaded from file\n"), i); -#endif - } - - BurnFree(Buffer); - - fclose(fp); - } - - WriteCheck1 = 0; - nCpuType = -1; -} - -void HiscoreReset() -{ -#if defined FBA_DEBUG - if (!Debug_HiscoreInitted) bprintf(PRINT_ERROR, _T("HiscoreReset called without init\n")); -#endif - - if (!CheckHiscoreAllowed() || !HiscoresInUse) return; - - if (nCpuType == -1) set_cpu_type(); - - WriteCheck1 = 0; - - for (UINT32 i = 0; i < nHiscoreNumRanges; i++) { - HiscoreMemRange[i].ApplyNextFrame = 0; - HiscoreMemRange[i].Applied = APPLIED_STATE_NONE; - - /*if (HiscoreMemRange[i].Loaded)*/ { - cpu_open(HiscoreMemRange[i].nCpu); - cpu_write_byte(HiscoreMemRange[i].Address, (UINT8)~HiscoreMemRange[i].StartValue); - if (HiscoreMemRange[i].NumBytes > 1) cpu_write_byte(HiscoreMemRange[i].Address + HiscoreMemRange[i].NumBytes - 1, (UINT8)~HiscoreMemRange[i].EndValue); - cpu_close(); - -#if 1 && defined FBA_DEBUG - bprintf(PRINT_IMPORTANT, _T("Hi Score Memory Range %i Initted\n"), i); -#endif - } - } -} - -INT32 HiscoreOkToWrite() -{ // Check if it is ok to write the hiscore data aka. did we apply it at least? - INT32 Ok = 1; - - for (UINT32 i = 0; i < nHiscoreNumRanges; i++) { - if (!(HiscoreMemRange[i].Loaded && HiscoreMemRange[i].Applied == APPLIED_STATE_CONFIRMED)) { - Ok = 0; - } - } - -#if 1 && defined FBA_DEBUG - bprintf(0, _T("Hiscore Write-Check #1 - Applied data: %X\n"), Ok); -#endif - - if (Ok) - return 1; // Passed check #1 - already applied hiscore? - - // Check #2 - didn't apply high score, but verified the memory locations -#if 1 && defined FBA_DEBUG - bprintf(0, _T("Hiscore Write-Check #2 - Memory verified: %X\n"), WriteCheck1); -#endif - - return WriteCheck1; -} - -INT32 HiscoreOkToApplyAll() -{ // All of the memory locations in the game's entry must be verfied, then applied when they _all_ match up - INT32 Ok = 1; - - for (UINT32 i = 0; i < nHiscoreNumRanges; i++) { - if (!(HiscoreMemRange[i].Loaded && HiscoreMemRange[i].Applied == APPLIED_STATE_NONE && HiscoreMemRange[i].ApplyNextFrame)) { - Ok = 0; - } - } - - return Ok; -} - -void HiscoreApply() -{ -#if defined FBA_DEBUG - if (!Debug_HiscoreInitted) bprintf(PRINT_ERROR, _T("HiscoreApply called without init\n")); -#endif - - if (!CheckHiscoreAllowed() || !HiscoresInUse) return; - - if (nCpuType == -1) set_cpu_type(); - - UINT8 WriteCheckOk = 0; - - for (UINT32 i = 0; i < nHiscoreNumRanges; i++) { - if (HiscoreMemRange[i].Loaded && HiscoreMemRange[i].Applied == APPLIED_STATE_ATTEMPTED) { - INT32 Confirmed = 1; - cpu_open(HiscoreMemRange[i].nCpu); - for (UINT32 j = 0; j < HiscoreMemRange[i].NumBytes; j++) { - if (cpu_read_byte(HiscoreMemRange[i].Address + j) != HiscoreMemRange[i].Data[j]) { - Confirmed = 0; - } - } - cpu_close(); - - if (Confirmed == 1) { - HiscoreMemRange[i].Applied = APPLIED_STATE_CONFIRMED; -#if 1 && defined FBA_DEBUG - bprintf(PRINT_IMPORTANT, _T("Applied Hi Score Memory Range %i on frame number %i\n"), i, GetCurrentFrame()); -#endif - } else { - HiscoreMemRange[i].Applied = APPLIED_STATE_NONE; - HiscoreMemRange[i].ApplyNextFrame = 1; -#if 1 && defined FBA_DEBUG - bprintf(PRINT_IMPORTANT, _T("Failed attempt to apply Hi Score Memory Range %i on frame number %i\n"), i, GetCurrentFrame()); -#endif - } - } - - if (HiscoreMemRange[i].Loaded && HiscoreMemRange[i].Applied == APPLIED_STATE_NONE) { - cpu_open(HiscoreMemRange[i].nCpu); - if (cpu_read_byte(HiscoreMemRange[i].Address) == HiscoreMemRange[i].StartValue && cpu_read_byte(HiscoreMemRange[i].Address + HiscoreMemRange[i].NumBytes - 1) == HiscoreMemRange[i].EndValue) { - HiscoreMemRange[i].ApplyNextFrame = 1; - } - cpu_close(); - } - - if (!HiscoreMemRange[i].Loaded && !WriteCheck1) { - cpu_open(HiscoreMemRange[i].nCpu); - if (cpu_read_byte(HiscoreMemRange[i].Address) == HiscoreMemRange[i].StartValue && cpu_read_byte(HiscoreMemRange[i].Address + HiscoreMemRange[i].NumBytes - 1) == HiscoreMemRange[i].EndValue) { - WriteCheckOk++; - } - cpu_close(); - } - } - - if (WriteCheckOk == nHiscoreNumRanges) { -#if 1 && defined FBA_DEBUG - bprintf(0, _T("Memory Verified - OK to write Hiscore data!\n")); -#endif - WriteCheck1 = 1; // It's OK to write hi-score data for the first time. - } - - if (HiscoreOkToApplyAll()) { - for (UINT32 i = 0; i < nHiscoreNumRanges; i++) { - cpu_open(HiscoreMemRange[i].nCpu); - for (UINT32 j = 0; j < HiscoreMemRange[i].NumBytes; j++) { - cpu_write_byte(HiscoreMemRange[i].Address + j, HiscoreMemRange[i].Data[j]); - } - cpu_close(); - - HiscoreMemRange[i].Applied = APPLIED_STATE_ATTEMPTED; - HiscoreMemRange[i].ApplyNextFrame = 0; - } - } - -} - -void HiscoreExit() -{ -#if defined FBA_DEBUG - if (!Debug_HiscoreInitted) bprintf(PRINT_ERROR, _T("HiscoreExit called without init\n")); -#endif - - if (!CheckHiscoreAllowed() || !HiscoresInUse) { - Debug_HiscoreInitted = 0; - return; - } - - if (HiscoreOkToWrite()) { - if (nCpuType == -1) set_cpu_type(); - - TCHAR szFilename[MAX_PATH]; - _stprintf(szFilename, _T("%s%s.hi"), szAppHiscorePath, BurnDrvGetText(DRV_NAME)); - - FILE *fp = _tfopen(szFilename, _T("wb")); - if (fp) { - for (UINT32 i = 0; i < nHiscoreNumRanges; i++) { - UINT8 *Buffer = (UINT8*)BurnMalloc(HiscoreMemRange[i].NumBytes + 10); - memset(Buffer, 0, HiscoreMemRange[i].NumBytes + 10); - - cpu_open(HiscoreMemRange[i].nCpu); - for (UINT32 j = 0; j < HiscoreMemRange[i].NumBytes; j++) { - Buffer[j] = cpu_read_byte(HiscoreMemRange[i].Address + j); - } - cpu_close(); - - fwrite(Buffer, 1, HiscoreMemRange[i].NumBytes, fp); - - BurnFree(Buffer); - } - } - fclose(fp); - } else { -#if 1 && defined FBA_DEBUG - bprintf(0, _T("HiscoreExit(): -NOT- ok to write Hiscore data!\n")); -#endif - } - - nCpuType = -1; - nHiscoreNumRanges = 0; - WriteCheck1 = 0; - - for (UINT32 i = 0; i < HISCORE_MAX_RANGES; i++) { - HiscoreMemRange[i].Loaded = 0; - HiscoreMemRange[i].nCpu = 0; - HiscoreMemRange[i].Address = 0; - HiscoreMemRange[i].NumBytes = 0; - HiscoreMemRange[i].StartValue = 0; - HiscoreMemRange[i].EndValue = 0; - HiscoreMemRange[i].ApplyNextFrame = 0; - HiscoreMemRange[i].Applied = 0; - - BurnFree(HiscoreMemRange[i].Data); - } - - Debug_HiscoreInitted = 0; -} diff --git a/jan/src/burn/hiscore.h b/jan/src/burn/hiscore.h deleted file mode 100644 index e6b3991c5..000000000 --- a/jan/src/burn/hiscore.h +++ /dev/null @@ -1,6 +0,0 @@ -extern INT32 EnableHiscores; - -void HiscoreInit(); -void HiscoreReset(); -void HiscoreApply(); -void HiscoreExit(); diff --git a/jan/src/burn/load.cpp b/jan/src/burn/load.cpp deleted file mode 100644 index 47df3dede..000000000 --- a/jan/src/burn/load.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// Burn - Rom Loading module -#include "burnint.h" - -// Load a rom and separate out the bytes by nGap -// Dest is the memory block to insert the rom into -INT32 BurnLoadRomExt(UINT8 *Dest, INT32 i, INT32 nGap, INT32 nFlags) -{ - INT32 nRet = 0, nLen = 0; - if (BurnExtLoadRom == NULL) return 1; // Load function was not defined by the application - - // Find the length of the rom (as given by the current driver) - { - struct BurnRomInfo ri; - ri.nType=0; - ri.nLen=0; - BurnDrvGetRomInfo(&ri,i); - if (ri.nType==0) return 0; // Empty rom slot - don't load anything and return success - nLen=ri.nLen; - } - - char* RomName = ""; //added by emufan - BurnDrvGetRomName(&RomName, i, 0); - - if (nLen <= 0) return 1; - - if ((nGap>1) || (nFlags & LD_NIBBLES) || (nFlags & LD_XOR)) - { - INT32 nLoadLen=0; - UINT8 *Load=(UINT8 *)BurnMalloc(nLen); - if (Load==NULL) return 1; - memset(Load,0,nLen); - - // Load in the file - nRet=BurnExtLoadRom(Load,&nLoadLen,i); - if (bDoIpsPatch) IpsApplyPatches(Load, RomName); - if (nRet!=0) { if (Load) { BurnFree(Load); Load = NULL; } return 1; } - - if (nLoadLen<0) nLoadLen=0; - if (nLoadLen>nLen) nLoadLen=nLen; - - INT32 nGroup = (LD_GROUP(nFlags) > 0) ? LD_GROUP(nFlags) : 1; - INT32 nInvert = (nFlags & LD_INVERT) ? 0xff : 0; - INT32 nByteswap = (nFlags & LD_BYTESWAP) ? 1 : 0; - INT32 nReverse = (nGroup > 1) ? (nFlags & LD_REVERSE) : 0; - INT32 nXor = (nFlags & LD_XOR) ? 1 : 0; - INT32 nNibbles = (nFlags & LD_NIBBLES) ? 1 : 0; - UINT8 *Src = Load; - - if (nNibbles) { nGroup = 1; nGap = 2; } - - for (INT32 n = 0, z = 0; n < nLoadLen; n += nGroup, z += nGap) { - if (nNibbles) { - Dest[z+0] = (Src[n^nByteswap] ^ nInvert) & 0xf; - Dest[z+1] = (Src[n^nByteswap] ^ nInvert) >> 4; - } else { - if (nReverse) { - for (INT32 j = 0; j < nGroup; j++) { - INT32 nXorData = nInvert; - if (nXor) nXorData ^= Dest[z + j]; - Dest[z + j] = Src[(n + ((nGroup - 1) - j)) ^ nByteswap] ^ nXorData; - } - } else { - for (INT32 j = 0; j < nGroup; j++) { - INT32 nXorData = nInvert; - if (nXor) nXorData ^= Dest[z + j]; - Dest[z + j] = Src[(n + j) ^ nByteswap] ^ nXorData; - } - } - } - } - - if (Load) { - BurnFree(Load); - Load = NULL; - } - } - else - { - // If no XOR, and gap of 1, just copy straight in - nRet=BurnExtLoadRom(Dest,NULL,i); - if (bDoIpsPatch) IpsApplyPatches(Dest, RomName); - if (nRet!=0) return 1; - - if (nFlags & LD_INVERT) { - for (INT32 n = 0; n < nLen; n++) { - Dest[n] ^= 0xff; - } - } - - if (nFlags & LD_BYTESWAP) { - BurnByteswap(Dest, nLen); - } - } - - return 0; -} - -INT32 BurnLoadRom(UINT8 *Dest, INT32 i, INT32 nGap) -{ - return BurnLoadRomExt(Dest,i,nGap,0); -} - -INT32 BurnXorRom(UINT8 *Dest, INT32 i, INT32 nGap) -{ - return BurnLoadRomExt(Dest,i,nGap,LD_XOR); -} - -// Separate out a bitfield into Bit number 'nField' of each nibble in pDest -// (end result: each dword in memory carries the 8 pixels of a tile line). -INT32 BurnLoadBitField(UINT8 *pDest, UINT8 *pSrc, INT32 nField, INT32 nSrcLen) -{ - INT32 nPix=0; - - for (nPix=0; nPix<(nSrcLen<<3); nPix++) - { - INT32 nBit; - // Get the bitplane pixel value (on or off) - nBit=(*pSrc)>>(7-(nPix&7)); nBit&=1; - nBit<<=nField; // Move to correct bit for this field - - // use low nibble for each even pixel - if ((nPix&1)==1) nBit<<=4; // use high nibble for each odd pixel - - *pDest|=nBit; // OR into destination - if ((nPix&1)==1) pDest++; - if ((nPix&7)==7) pSrc++; - } - - return 0; -} - diff --git a/jan/src/burn/snd/ay8910.c b/jan/src/burn/snd/ay8910.c deleted file mode 100644 index 0b2261b60..000000000 --- a/jan/src/burn/snd/ay8910.c +++ /dev/null @@ -1,974 +0,0 @@ -/*************************************************************************** - - Modified from ay8910.c from MAME - - - Emulation of the AY-3-8910 / YM2149 sound chip. - - Based on various code snippets by Ville Hallik, Michael Cuddy, - Tatsuyuki Satoh, Fabrice Frances, Nicola Salmoria. - - June 07, 2016 - Added Burgertime Mode [dink] - This feature eliminates the horrible hissing noise - present in the game. Note: no longer used! Code moved to - driver-level. Keeping this just in-case it might be usefull - for something else. - -***************************************************************************/ - -#include "driver.h" -#include "state.h" -#include "ay8910.h" - -#if defined FBA_DEBUG -#ifdef __GNUC__ - // MSVC doesn't like this - this module only supports debug tracking with GCC only - #include - extern UINT8 DebugSnd_AY8910Initted; - extern INT32 (__cdecl *bprintf) (INT32 nStatus, TCHAR* szFormat, ...); - #define PRINT_ERROR (3) -#endif -#endif - -#define MAX_OUTPUT 0x7fff - -#define STEP 0x8000 - -#define BURN_SND_CLIP(A) ((A) < -0x8000 ? -0x8000 : (A) > 0x7fff ? 0x7fff : (A)) -#define BURN_SND_ROUTE_LEFT 1 -#define BURN_SND_ROUTE_RIGHT 2 -#define BURN_SND_ROUTE_BOTH (BURN_SND_ROUTE_LEFT | BURN_SND_ROUTE_RIGHT) - -static void (*AYStreamUpdate)(void); - -INT32 ay8910_index_ym = 0; -static INT32 num = 0, ym_num = 0; - -static double AY8910Volumes[3 * 6]; -static INT32 AY8910RouteDirs[3 * 6]; - -INT32 ay8910burgertime_mode = 0; - -struct AY8910 -{ - INT32 Channel; - INT32 SampleRate; - ALIGN_VAR(8) read8_handler PortAread; - ALIGN_VAR(8) read8_handler PortBread; - ALIGN_VAR(8) write8_handler PortAwrite; - ALIGN_VAR(8) write8_handler PortBwrite; - INT32 register_latch; - UINT8 Regs[16]; - INT32 lastEnable; - UINT32 UpdateStep; - INT32 PeriodA,PeriodB,PeriodC,PeriodN,PeriodE; - INT32 CountA,CountB,CountC,CountN,CountE; - UINT32 VolA,VolB,VolC,VolE; - UINT8 EnvelopeA,EnvelopeB,EnvelopeC; - UINT8 OutputA,OutputB,OutputC,OutputN; - INT8 CountEnv; - UINT8 Hold,Alternate,Attack,Holding; - INT32 RNG; - UINT32 VolTable[32]; -}; - -/* register id's */ -#define AY_AFINE (0) -#define AY_ACOARSE (1) -#define AY_BFINE (2) -#define AY_BCOARSE (3) -#define AY_CFINE (4) -#define AY_CCOARSE (5) -#define AY_NOISEPER (6) -#define AY_ENABLE (7) -#define AY_AVOL (8) -#define AY_BVOL (9) -#define AY_CVOL (10) -#define AY_EFINE (11) -#define AY_ECOARSE (12) -#define AY_ESHAPE (13) - -#define AY_PORTA (14) -#define AY_PORTB (15) - - -static struct AY8910 AYPSG[MAX_8910]; /* array of PSG's */ - - - -static void _AYWriteReg(INT32 n, INT32 r, INT32 v) -{ - struct AY8910 *PSG = &AYPSG[n]; - INT32 old; - - - PSG->Regs[r] = v; - - /* A note about the period of tones, noise and envelope: for speed reasons,*/ - /* we count down from the period to 0, but careful studies of the chip */ - /* output prove that it instead counts up from 0 until the counter becomes */ - /* greater or equal to the period. This is an important difference when the*/ - /* program is rapidly changing the period to modulate the sound. */ - /* To compensate for the difference, when the period is changed we adjust */ - /* our internal counter. */ - /* Also, note that period = 0 is the same as period = 1. This is mentioned */ - /* in the YM2203 data sheets. However, this does NOT apply to the Envelope */ - /* period. In that case, period = 0 is half as period = 1. */ - switch( r ) - { - case AY_AFINE: - case AY_ACOARSE: - PSG->Regs[AY_ACOARSE] &= 0x0f; - old = PSG->PeriodA; - PSG->PeriodA = (PSG->Regs[AY_AFINE] + 256 * PSG->Regs[AY_ACOARSE]) * PSG->UpdateStep; - if (PSG->PeriodA == 0) PSG->PeriodA = PSG->UpdateStep; - PSG->CountA += PSG->PeriodA - old; - if (PSG->CountA <= 0) PSG->CountA = 1; - break; - case AY_BFINE: - case AY_BCOARSE: - PSG->Regs[AY_BCOARSE] &= 0x0f; - old = PSG->PeriodB; - PSG->PeriodB = (PSG->Regs[AY_BFINE] + 256 * PSG->Regs[AY_BCOARSE]) * PSG->UpdateStep; - if (PSG->PeriodB == 0) PSG->PeriodB = PSG->UpdateStep; - PSG->CountB += PSG->PeriodB - old; - if (PSG->CountB <= 0) PSG->CountB = 1; - break; - case AY_CFINE: - case AY_CCOARSE: - PSG->Regs[AY_CCOARSE] &= 0x0f; - old = PSG->PeriodC; - PSG->PeriodC = (PSG->Regs[AY_CFINE] + 256 * PSG->Regs[AY_CCOARSE]) * PSG->UpdateStep; - if (PSG->PeriodC == 0) PSG->PeriodC = PSG->UpdateStep; - PSG->CountC += PSG->PeriodC - old; - if (PSG->CountC <= 0) PSG->CountC = 1; - break; - case AY_NOISEPER: - PSG->Regs[AY_NOISEPER] &= 0x1f; - old = PSG->PeriodN; - PSG->PeriodN = PSG->Regs[AY_NOISEPER] * PSG->UpdateStep; - if (PSG->PeriodN == 0) PSG->PeriodN = PSG->UpdateStep; - PSG->CountN += PSG->PeriodN - old; - if (PSG->CountN <= 0) PSG->CountN = 1; - break; - case AY_ENABLE: - if ((PSG->lastEnable == -1) || - ((PSG->lastEnable & 0x40) != (PSG->Regs[AY_ENABLE] & 0x40))) - { - /* write out 0xff if port set to input */ - if (PSG->PortAwrite) - (*PSG->PortAwrite)(0, (PSG->Regs[AY_ENABLE] & 0x40) ? PSG->Regs[AY_PORTA] : 0xff); - } - - if ((PSG->lastEnable == -1) || - ((PSG->lastEnable & 0x80) != (PSG->Regs[AY_ENABLE] & 0x80))) - { - /* write out 0xff if port set to input */ - if (PSG->PortBwrite) - (*PSG->PortBwrite)(0, (PSG->Regs[AY_ENABLE] & 0x80) ? PSG->Regs[AY_PORTB] : 0xff); - } - - PSG->lastEnable = PSG->Regs[AY_ENABLE]; - break; - case AY_AVOL: - PSG->Regs[AY_AVOL] &= 0x1f; - PSG->EnvelopeA = PSG->Regs[AY_AVOL] & 0x10; - PSG->VolA = PSG->EnvelopeA ? PSG->VolE : PSG->VolTable[PSG->Regs[AY_AVOL] ? PSG->Regs[AY_AVOL]*2+1 : 0]; - if (ay8910burgertime_mode && PSG->PeriodA == PSG->UpdateStep && n == 0) PSG->VolA = 0; - break; - case AY_BVOL: - PSG->Regs[AY_BVOL] &= 0x1f; - PSG->EnvelopeB = PSG->Regs[AY_BVOL] & 0x10; - PSG->VolB = PSG->EnvelopeB ? PSG->VolE : PSG->VolTable[PSG->Regs[AY_BVOL] ? PSG->Regs[AY_BVOL]*2+1 : 0]; - if (ay8910burgertime_mode && PSG->PeriodB == PSG->UpdateStep && n == 0) PSG->VolB = 0; - break; - case AY_CVOL: - PSG->Regs[AY_CVOL] &= 0x1f; - PSG->EnvelopeC = PSG->Regs[AY_CVOL] & 0x10; - PSG->VolC = PSG->EnvelopeC ? PSG->VolE : PSG->VolTable[PSG->Regs[AY_CVOL] ? PSG->Regs[AY_CVOL]*2+1 : 0]; - if (ay8910burgertime_mode && PSG->PeriodC == PSG->UpdateStep && n == 0) PSG->VolC = 0; - break; - case AY_EFINE: - case AY_ECOARSE: - old = PSG->PeriodE; - PSG->PeriodE = ((PSG->Regs[AY_EFINE] + 256 * PSG->Regs[AY_ECOARSE])) * PSG->UpdateStep; - if (PSG->PeriodE == 0) PSG->PeriodE = PSG->UpdateStep / 2; - PSG->CountE += PSG->PeriodE - old; - if (PSG->CountE <= 0) PSG->CountE = 1; - break; - case AY_ESHAPE: - /* envelope shapes: - C AtAlH - 0 0 x x \___ - - 0 1 x x /___ - - 1 0 0 0 \\\\ - - 1 0 0 1 \___ - - 1 0 1 0 \/\/ - ___ - 1 0 1 1 \ - - 1 1 0 0 //// - ___ - 1 1 0 1 / - - 1 1 1 0 /\/\ - - 1 1 1 1 /___ - - The envelope counter on the AY-3-8910 has 16 steps. On the YM2149 it - has twice the steps, happening twice as fast. Since the end result is - just a smoother curve, we always use the YM2149 behaviour. - */ - PSG->Regs[AY_ESHAPE] &= 0x0f; - PSG->Attack = (PSG->Regs[AY_ESHAPE] & 0x04) ? 0x1f : 0x00; - if ((PSG->Regs[AY_ESHAPE] & 0x08) == 0) - { - /* if Continue = 0, map the shape to the equivalent one which has Continue = 1 */ - PSG->Hold = 1; - PSG->Alternate = PSG->Attack; - } - else - { - PSG->Hold = PSG->Regs[AY_ESHAPE] & 0x01; - PSG->Alternate = PSG->Regs[AY_ESHAPE] & 0x02; - } - PSG->CountE = PSG->PeriodE; - PSG->CountEnv = 0x1f; - PSG->Holding = 0; - PSG->VolE = PSG->VolTable[PSG->CountEnv ^ PSG->Attack]; - if (PSG->EnvelopeA) PSG->VolA = PSG->VolE; - if (PSG->EnvelopeB) PSG->VolB = PSG->VolE; - if (PSG->EnvelopeC) PSG->VolC = PSG->VolE; - break; - case AY_PORTA: - if (PSG->Regs[AY_ENABLE] & 0x40) - { - if (PSG->PortAwrite) - (*PSG->PortAwrite)(0, PSG->Regs[AY_PORTA]); -// else -// logerror("PC %04x: warning - write %02x to 8910 #%d Port A\n",activecpu_get_pc(),PSG->Regs[AY_PORTA],n); - } -// else -// { -// logerror("warning: write to 8910 #%d Port A set as input - ignored\n",n); -// } - break; - case AY_PORTB: - if (PSG->Regs[AY_ENABLE] & 0x80) - { - if (PSG->PortBwrite) - (*PSG->PortBwrite)(0, PSG->Regs[AY_PORTB]); -// else -// logerror("PC %04x: warning - write %02x to 8910 #%d Port B\n",activecpu_get_pc(),PSG->Regs[AY_PORTB],n); - } -// else -// { -// logerror("warning: write to 8910 #%d Port B set as input - ignored\n",n); -// } - break; - } -} - - -/* write a register on AY8910 chip number 'n' */ -static void AYWriteReg(INT32 chip, INT32 r, INT32 v) -{ - if (r > 15) return; - if (r < 14) - { - struct AY8910 *PSG = &AYPSG[chip]; - - if (r == AY_ESHAPE || PSG->Regs[r] != v) - { -// /* update the output buffer before changing the register */ -// stream_update(PSG->Channel,0); - AYStreamUpdate(); - } - } - - _AYWriteReg(chip,r,v); -} - - - -static UINT8 AYReadReg(INT32 n, INT32 r) -{ - struct AY8910 *PSG = &AYPSG[n]; - - - if (r > 15) return 0; - - switch (r) - { - case AY_PORTA: -// if ((PSG->Regs[AY_ENABLE] & 0x40) != 0) -// logerror("warning: read from 8910 #%d Port A set as output\n",n); - /* - even if the port is set as output, we still need to return the external - data. Some games, like kidniki, need this to work. - */ - if (PSG->PortAread) PSG->Regs[AY_PORTA] = (*PSG->PortAread)(0); -// else logerror("PC %04x: warning - read 8910 #%d Port A\n",activecpu_get_pc(),n); - break; - case AY_PORTB: -// if ((PSG->Regs[AY_ENABLE] & 0x80) != 0) -// logerror("warning: read from 8910 #%d Port B set as output\n",n); - if (PSG->PortBread) PSG->Regs[AY_PORTB] = (*PSG->PortBread)(0); -// else logerror("PC %04x: warning - read 8910 #%d Port B\n",activecpu_get_pc(),n); - break; - } - return PSG->Regs[r]; -} - -void AY8910Write(INT32 chip, INT32 a, INT32 data) -{ - struct AY8910 *PSG = &AYPSG[chip]; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("AY8910Write called without init\n")); - if (chip > num) bprintf(PRINT_ERROR, _T("AY8910Write called with invalid chip number %x\n"), chip); -#endif -#endif - - if (a & 1) - { /* Data port */ - AYWriteReg(chip,PSG->register_latch,data); - } - else - { /* Register port */ - PSG->register_latch = data & 0x0f; - } -} - -INT32 AY8910Read(INT32 chip) -{ - struct AY8910 *PSG = &AYPSG[chip]; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("AY8910Read called without init\n")); - if (chip > num) bprintf(PRINT_ERROR, _T("AY8910Read called with invalid chip number %x\n"), chip); -#endif -#endif - - return AYReadReg(chip,PSG->register_latch); -} - -void AY8910Update(INT32 chip, INT16 **buffer, INT32 length) -{ - struct AY8910 *PSG = &AYPSG[chip]; - INT16 *buf1,*buf2,*buf3; - INT32 outn; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("AY8910Update called without init\n")); - if (chip > num) bprintf(PRINT_ERROR, _T("AY8910Update called with invalid chip number %x\n"), chip); -#endif -#endif - - buf1 = buffer[0]; - buf2 = buffer[1]; - buf3 = buffer[2]; - - /* The 8910 has three outputs, each output is the mix of one of the three */ - /* tone generators and of the (single) noise generator. The two are mixed */ - /* BEFORE going into the DAC. The formula to mix each channel is: */ - /* (ToneOn | ToneDisable) & (NoiseOn | NoiseDisable). */ - /* Note that this means that if both tone and noise are disabled, the output */ - /* is 1, not 0, and can be modulated changing the volume. */ - - - /* If the channels are disabled, set their output to 1, and increase the */ - /* counter, if necessary, so they will not be inverted during this update. */ - /* Setting the output to 1 is necessary because a disabled channel is locked */ - /* into the ON state (see above); and it has no effect if the volume is 0. */ - /* If the volume is 0, increase the counter, but don't touch the output. */ - if (PSG->Regs[AY_ENABLE] & 0x01) - { - if (PSG->CountA <= length*STEP) PSG->CountA += length*STEP; - PSG->OutputA = 1; - } - else if (PSG->Regs[AY_AVOL] == 0) - { - /* note that I do count += length, NOT count = length + 1. You might think */ - /* it's the same since the volume is 0, but doing the latter could cause */ - /* interferencies when the program is rapidly modulating the volume. */ - if (PSG->CountA <= length*STEP) PSG->CountA += length*STEP; - } - if (PSG->Regs[AY_ENABLE] & 0x02) - { - if (PSG->CountB <= length*STEP) PSG->CountB += length*STEP; - PSG->OutputB = 1; - } - else if (PSG->Regs[AY_BVOL] == 0) - { - if (PSG->CountB <= length*STEP) PSG->CountB += length*STEP; - } - if (PSG->Regs[AY_ENABLE] & 0x04) - { - if (PSG->CountC <= length*STEP) PSG->CountC += length*STEP; - PSG->OutputC = 1; - } - else if (PSG->Regs[AY_CVOL] == 0) - { - if (PSG->CountC <= length*STEP) PSG->CountC += length*STEP; - } - - /* for the noise channel we must not touch OutputN - it's also not necessary */ - /* since we use outn. */ - if ((PSG->Regs[AY_ENABLE] & 0x38) == 0x38) /* all off */ - if (PSG->CountN <= length*STEP) PSG->CountN += length*STEP; - - outn = (PSG->OutputN | PSG->Regs[AY_ENABLE]); - - - /* buffering loop */ - while (length) - { - INT32 vola,volb,volc; - INT32 left; - - /* vola, volb and volc keep track of how long each square wave stays */ - /* in the 1 position during the sample period. */ - vola = volb = volc = 0; - - left = STEP; - do - { - INT32 nextevent; - - if (PSG->CountN < left) nextevent = PSG->CountN; - else nextevent = left; - - if (outn & 0x08) - { - if (PSG->OutputA) vola += PSG->CountA; - PSG->CountA -= nextevent; - /* PeriodA is the half period of the square wave. Here, in each */ - /* loop I add PeriodA twice, so that at the end of the loop the */ - /* square wave is in the same status (0 or 1) it was at the start. */ - /* vola is also incremented by PeriodA, since the wave has been 1 */ - /* exactly half of the time, regardless of the initial position. */ - /* If we exit the loop in the middle, OutputA has to be inverted */ - /* and vola incremented only if the exit status of the square */ - /* wave is 1. */ - while (PSG->CountA <= 0) - { - PSG->CountA += PSG->PeriodA; - if (PSG->CountA > 0) - { - PSG->OutputA ^= 1; - if (PSG->OutputA) vola += PSG->PeriodA; - break; - } - PSG->CountA += PSG->PeriodA; - vola += PSG->PeriodA; - } - if (PSG->OutputA) vola -= PSG->CountA; - } - else - { - PSG->CountA -= nextevent; - while (PSG->CountA <= 0) - { - PSG->CountA += PSG->PeriodA; - if (PSG->CountA > 0) - { - PSG->OutputA ^= 1; - break; - } - PSG->CountA += PSG->PeriodA; - } - } - - if (outn & 0x10) - { - if (PSG->OutputB) volb += PSG->CountB; - PSG->CountB -= nextevent; - while (PSG->CountB <= 0) - { - PSG->CountB += PSG->PeriodB; - if (PSG->CountB > 0) - { - PSG->OutputB ^= 1; - if (PSG->OutputB) volb += PSG->PeriodB; - break; - } - PSG->CountB += PSG->PeriodB; - volb += PSG->PeriodB; - } - if (PSG->OutputB) volb -= PSG->CountB; - } - else - { - PSG->CountB -= nextevent; - while (PSG->CountB <= 0) - { - PSG->CountB += PSG->PeriodB; - if (PSG->CountB > 0) - { - PSG->OutputB ^= 1; - break; - } - PSG->CountB += PSG->PeriodB; - } - } - - if (outn & 0x20) - { - if (PSG->OutputC) volc += PSG->CountC; - PSG->CountC -= nextevent; - while (PSG->CountC <= 0) - { - PSG->CountC += PSG->PeriodC; - if (PSG->CountC > 0) - { - PSG->OutputC ^= 1; - if (PSG->OutputC) volc += PSG->PeriodC; - break; - } - PSG->CountC += PSG->PeriodC; - volc += PSG->PeriodC; - } - if (PSG->OutputC) volc -= PSG->CountC; - } - else - { - PSG->CountC -= nextevent; - while (PSG->CountC <= 0) - { - PSG->CountC += PSG->PeriodC; - if (PSG->CountC > 0) - { - PSG->OutputC ^= 1; - break; - } - PSG->CountC += PSG->PeriodC; - } - } - - PSG->CountN -= nextevent; - if (PSG->CountN <= 0) - { - /* Is noise output going to change? */ - if ((PSG->RNG + 1) & 2) /* (bit0^bit1)? */ - { - PSG->OutputN = ~PSG->OutputN; - outn = (PSG->OutputN | PSG->Regs[AY_ENABLE]); - } - - /* The Random Number Generator of the 8910 is a 17-bit shift */ - /* register. The input to the shift register is bit0 XOR bit2 */ - /* (bit0 is the output). */ - - /* The following is a fast way to compute bit17 = bit0^bit2. */ - /* Instead of doing all the logic operations, we only check */ - /* bit0, relying on the fact that after two shifts of the */ - /* register, what now is bit2 will become bit0, and will */ - /* invert, if necessary, bit15, which previously was bit17. */ - if (PSG->RNG & 1) PSG->RNG ^= 0x24000; - PSG->RNG >>= 1; - PSG->CountN += PSG->PeriodN; - } - - left -= nextevent; - } while (left > 0); - - /* update envelope */ - if (PSG->Holding == 0) - { - PSG->CountE -= STEP; - if (PSG->CountE <= 0) - { - do - { - PSG->CountEnv--; - PSG->CountE += PSG->PeriodE; - } while (PSG->CountE <= 0); - - /* check envelope current position */ - if (PSG->CountEnv < 0) - { - if (PSG->Hold) - { - if (PSG->Alternate) - PSG->Attack ^= 0x1f; - PSG->Holding = 1; - PSG->CountEnv = 0; - } - else - { - /* if CountEnv has looped an odd number of times (usually 1), */ - /* invert the output. */ - if (PSG->Alternate && (PSG->CountEnv & 0x20)) - PSG->Attack ^= 0x1f; - - PSG->CountEnv &= 0x1f; - } - } - - PSG->VolE = PSG->VolTable[PSG->CountEnv ^ PSG->Attack]; - /* reload volume */ - if (PSG->EnvelopeA) PSG->VolA = PSG->VolE; - if (PSG->EnvelopeB) PSG->VolB = PSG->VolE; - if (PSG->EnvelopeC) PSG->VolC = PSG->VolE; - } - } - - *(buf1++) = (vola * PSG->VolA) / STEP; - *(buf2++) = (volb * PSG->VolB) / STEP; - *(buf3++) = (volc * PSG->VolC) / STEP; - - length--; - } -} - - -void AY8910_set_clock(INT32 chip, INT32 clock) -{ - struct AY8910 *PSG = &AYPSG[chip]; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("AY8910_set_clock called without init\n")); - if (chip > num) bprintf(PRINT_ERROR, _T("AY8910_set_clock called with invalid chip number %x\n"), chip); -#endif -#endif - - /* the step clock for the tone and noise generators is the chip clock */ - /* divided by 8; for the envelope generator of the AY-3-8910, it is half */ - /* that much (clock/16), but the envelope of the YM2149 goes twice as */ - /* fast, therefore again clock/8. */ - /* Here we calculate the number of steps which happen during one sample */ - /* at the given sample rate. No. of events = sample rate / (clock/8). */ - /* STEP is a multiplier used to turn the fraction into a fixed point */ - /* number. */ - PSG->UpdateStep = ((double)STEP * PSG->SampleRate * 8 + clock/2) / clock; -} - - -static void build_mixer_table(INT32 chip) -{ - struct AY8910 *PSG = &AYPSG[chip]; - INT32 i; - double out; - - - /* calculate the volume->voltage conversion table */ - /* The AY-3-8910 has 16 levels, in a logarithmic scale (3dB per step) */ - /* The YM2149 still has 16 levels for the tone generators, but 32 for */ - /* the envelope generator (1.5dB per step). */ - out = MAX_OUTPUT; - for (i = 31;i > 0;i--) - { - PSG->VolTable[i] = out + 0.5; /* round to nearest */ - - out /= 1.188502227; /* = 10 ^ (1.5/20) = 1.5dB */ - } - PSG->VolTable[0] = 0; -} - - - -void AY8910Reset(INT32 chip) -{ - INT32 i; - struct AY8910 *PSG = &AYPSG[chip]; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("AY8910Reset called without init\n")); - if (chip > num) bprintf(PRINT_ERROR, _T("AY8910Reset called with invalid chip number %x\n"), chip); -#endif -#endif - - PSG->register_latch = 0; - PSG->RNG = 1; - PSG->OutputA = 0; - PSG->OutputB = 0; - PSG->OutputC = 0; - PSG->OutputN = 0xff; - PSG->lastEnable = -1; /* force a write */ - for (i = 0;i < AY_PORTA;i++) - _AYWriteReg(chip,i,0); /* AYWriteReg() uses the timer system; we cannot */ - /* call it at this time because the timer system */ - /* has not been initialized. */ -} - -void AY8910Exit(INT32 chip) -{ - (void)chip; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted && !chip) bprintf(PRINT_ERROR, _T("AY8910Exit called without init\n")); -#endif -#endif - - num = 0; - ym_num = 0; - - ay8910_index_ym = 0; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - DebugSnd_AY8910Initted = 0; -#endif -#endif -} - -static void dummy_callback(void) -{ - return; -} - -INT32 AY8910Init(INT32 chip, INT32 clock, INT32 sample_rate, - read8_handler portAread, read8_handler portBread, - write8_handler portAwrite, write8_handler portBwrite) -{ - struct AY8910 *PSG = &AYPSG[chip]; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - DebugSnd_AY8910Initted = 1; -#endif -#endif - - AYStreamUpdate = dummy_callback; - - if (chip != num) { - return 1; - } - - memset(PSG, 0, sizeof(struct AY8910)); - PSG->SampleRate = sample_rate; - PSG->PortAread = portAread; - PSG->PortBread = portBread; - PSG->PortAwrite = portAwrite; - PSG->PortBwrite = portBwrite; - - AY8910_set_clock(chip, clock); - - build_mixer_table(chip); - - // default routes - AY8910Volumes[(chip * 3) + BURN_SND_AY8910_ROUTE_1] = 1.00; - AY8910Volumes[(chip * 3) + BURN_SND_AY8910_ROUTE_2] = 1.00; - AY8910Volumes[(chip * 3) + BURN_SND_AY8910_ROUTE_3] = 1.00; - AY8910RouteDirs[(chip * 3) + BURN_SND_AY8910_ROUTE_1] = BURN_SND_ROUTE_BOTH; - AY8910RouteDirs[(chip * 3) + BURN_SND_AY8910_ROUTE_2] = BURN_SND_ROUTE_BOTH; - AY8910RouteDirs[(chip * 3) + BURN_SND_AY8910_ROUTE_3] = BURN_SND_ROUTE_BOTH; - - AY8910Reset(chip); - - num++; - - return 0; -} - -INT32 AY8910InitYM(INT32 chip, INT32 clock, INT32 sample_rate, - read8_handler portAread, read8_handler portBread, - write8_handler portAwrite, write8_handler portBwrite, - void (*update_callback)(void)) -{ - INT32 val = AY8910Init(ay8910_index_ym + chip, clock, sample_rate, portAread, portBread, portAwrite, portBwrite); - - AYStreamUpdate = update_callback; - - if (val == 0) { - ym_num++; - } - - ay8910_index_ym = num - ym_num; - - return val; -} - -// Useful for YM2203, etc games needing read/write ports -INT32 AY8910SetPorts(INT32 chip, read8_handler portAread, read8_handler portBread, - write8_handler portAwrite, write8_handler portBwrite) -{ - struct AY8910 *PSG = &AYPSG[chip]; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("AY8910SetPorts called without init\n")); -#endif -#endif - - PSG->PortAread = portAread; - PSG->PortBread = portBread; - PSG->PortAwrite = portAwrite; - PSG->PortBwrite = portBwrite; - - return 0; -} - -INT32 AY8910Scan(INT32 nAction, INT32* pnMin) -{ - struct BurnArea ba; - INT32 i; - -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("AY8910Scan called without init\n")); -#endif -#endif - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - if (pnMin && *pnMin < 0x029496) { // Return minimum compatible version - *pnMin = 0x029496; - } - - for (i = 0; i < num; i++) { - struct AY8910 *PSG = &AYPSG[i]; - read8_handler tempPortAread = PSG->PortAread; // preserve the port handler pointers! - read8_handler tempPortBread = PSG->PortBread; - write8_handler tempPortAwrite = PSG->PortAwrite; - write8_handler tempPortBwrite = PSG->PortBwrite; - char szName[16]; - - sprintf(szName, "AY8910 #%d", i); - - ba.Data = &AYPSG[i]; - ba.nLen = sizeof(struct AY8910); - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - - PSG->PortAread = tempPortAread; - PSG->PortBread = tempPortBread; - PSG->PortAwrite = tempPortAwrite; - PSG->PortBwrite = tempPortBwrite; - - } - - return 0; -} - -#define AY8910_ADD_SOUND(route, output) \ - if ((AY8910RouteDirs[route] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { \ - nLeftSample += (INT32)(output[n] * AY8910Volumes[route]); \ - } \ - if ((AY8910RouteDirs[route] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { \ - nRightSample += (INT32)(output[n] * AY8910Volumes[route]); \ - } - -void AY8910Render(INT16** buffer, INT16* dest, INT32 length, INT32 bAddSignal) -{ -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("AY8910Render called without init\n")); - if (num >= 7) bprintf(PRINT_ERROR, _T("AY8910Render called with invalid number of chips %i (max is 6)\n"), num); -#endif -#endif - - INT32 i; - INT16 *buf0 = buffer[0]; - INT16 *buf1 = buffer[1]; - INT16 *buf2 = buffer[2]; - INT16 *buf3, *buf4, *buf5, *buf6, *buf7, *buf8, *buf9, *buf10, *buf11, *buf12, *buf13, *buf14, *buf15, *buf16, *buf17; - INT32 n; - - for (i = 0; i < num; i++) { - AY8910Update(i, buffer + (i * 3), length); - } - - if (num >= 2) { - buf3 = buffer[3]; - buf4 = buffer[4]; - buf5 = buffer[5]; - } - if (num >= 3) { - buf6 = buffer[6]; - buf7 = buffer[7]; - buf8 = buffer[8]; - } - if (num >= 4) { - buf9 = buffer[9]; - buf10 = buffer[10]; - buf11 = buffer[11]; - } - if (num >= 5) { - buf12 = buffer[12]; - buf13 = buffer[13]; - buf14 = buffer[14]; - } - if (num >= 6) { - buf15 = buffer[15]; - buf16 = buffer[16]; - buf17 = buffer[17]; - } - - for (n = 0; n < length; n++) { - INT32 nLeftSample = 0, nRightSample = 0; - - AY8910_ADD_SOUND(BURN_SND_AY8910_ROUTE_1, buf0) - AY8910_ADD_SOUND(BURN_SND_AY8910_ROUTE_2, buf1) - AY8910_ADD_SOUND(BURN_SND_AY8910_ROUTE_3, buf2) - - if (num >= 2) { - AY8910_ADD_SOUND(3 + BURN_SND_AY8910_ROUTE_1, buf3) - AY8910_ADD_SOUND(3 + BURN_SND_AY8910_ROUTE_2, buf4) - AY8910_ADD_SOUND(3 + BURN_SND_AY8910_ROUTE_3, buf5) - } - - if (num >= 3) { - AY8910_ADD_SOUND(6 + BURN_SND_AY8910_ROUTE_1, buf6) - AY8910_ADD_SOUND(6 + BURN_SND_AY8910_ROUTE_2, buf7) - AY8910_ADD_SOUND(6 + BURN_SND_AY8910_ROUTE_3, buf8) - } - - if (num >= 4) { - AY8910_ADD_SOUND(9 + BURN_SND_AY8910_ROUTE_1, buf9) - AY8910_ADD_SOUND(9 + BURN_SND_AY8910_ROUTE_2, buf10) - AY8910_ADD_SOUND(9 + BURN_SND_AY8910_ROUTE_3, buf11) - } - - if (num >= 5) { - AY8910_ADD_SOUND(12 + BURN_SND_AY8910_ROUTE_1, buf12) - AY8910_ADD_SOUND(12 + BURN_SND_AY8910_ROUTE_2, buf13) - AY8910_ADD_SOUND(12 + BURN_SND_AY8910_ROUTE_3, buf14) - } - - if (num >= 6) { - AY8910_ADD_SOUND(15 + BURN_SND_AY8910_ROUTE_1, buf15) - AY8910_ADD_SOUND(15 + BURN_SND_AY8910_ROUTE_2, buf16) - AY8910_ADD_SOUND(15 + BURN_SND_AY8910_ROUTE_3, buf17) - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (bAddSignal) { - dest[(n << 1) + 0] = BURN_SND_CLIP(dest[(n << 1) + 0] + nLeftSample); - dest[(n << 1) + 1] = BURN_SND_CLIP(dest[(n << 1) + 1] + nRightSample); - } else { - dest[(n << 1) + 0] = nLeftSample; - dest[(n << 1) + 1] = nRightSample; - } - } -} - -void AY8910SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG -#ifdef __GNUC__ - if (!DebugSnd_AY8910Initted) bprintf(PRINT_ERROR, _T("AY8910SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 2) bprintf(PRINT_ERROR, _T("AY8910SetRoute called with invalid index %i\n"), nIndex); - if (chip >= num) bprintf(PRINT_ERROR, _T("AY8910SetRoute called with invalid chip %i\n"), chip); -#endif -#endif - - AY8910Volumes[(chip * 3) + nIndex] = nVolume; - AY8910RouteDirs[(chip * 3) + nIndex] = nRouteDir; -} diff --git a/jan/src/burn/snd/ay8910.h b/jan/src/burn/snd/ay8910.h deleted file mode 100644 index 589295f1c..000000000 --- a/jan/src/burn/snd/ay8910.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef AY8910_H -#define AY8910_H - -#define MAX_8910 5 -#define ALL_8910_CHANNELS -1 - -struct AY8910interface -{ - INT32 num; /* total number of 8910 in the machine */ - INT32 baseclock; - INT32 mixing_level[MAX_8910]; - read8_handler portAread[MAX_8910]; - read8_handler portBread[MAX_8910]; - write8_handler portAwrite[MAX_8910]; - write8_handler portBwrite[MAX_8910]; - void (*handler[MAX_8910])(INT32 irq); /* IRQ handler for the YM2203 */ -}; - -extern INT32 ay8910burgertime_mode; - -extern INT32 ay8910_index_ym; - -void AY8910_set_clock(INT32 chip, INT32 clock); -void AY8910Reset(INT32 chip); - -void AY8910Update(INT32 chip, INT16** buffer, INT32 length); - -void AY8910Write(INT32 chip, INT32 a, INT32 data); -INT32 AY8910Read(INT32 chip); - -void AY8910Reset(INT32 chip); -void AY8910Exit(INT32 chip); -INT32 AY8910Init(INT32 chip, INT32 clock, INT32 sample_rate, - read8_handler portAread, read8_handler portBread, - write8_handler portAwrite, write8_handler portBwrite); - -INT32 AY8910InitYM(INT32 chip, INT32 clock, INT32 sample_rate, - read8_handler portAread, read8_handler portBread, - write8_handler portAwrite, write8_handler portBwrite, - void (*update_callback)(void)); - -INT32 AY8910Scan(INT32 nAction, INT32* pnMin); - -INT32 AY8910SetPorts(INT32 chip, read8_handler portAread, read8_handler portBread, - write8_handler portAwrite, write8_handler portBwrite); - -void AY8910Render(INT16** buffer, INT16* dest, INT32 length, INT32 bAddSignal); -void AY8910SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir); - -#define BURN_SND_AY8910_ROUTE_1 0 -#define BURN_SND_AY8910_ROUTE_2 1 -#define BURN_SND_AY8910_ROUTE_3 2 - -#define AY8910SetAllRoutes(i, v, d) \ - AY8910SetRoute(i, BURN_SND_AY8910_ROUTE_1, v, d); \ - AY8910SetRoute(i, BURN_SND_AY8910_ROUTE_2, v, d); \ - AY8910SetRoute(i, BURN_SND_AY8910_ROUTE_3, v, d); - -#endif diff --git a/jan/src/burn/snd/burn_y8950.cpp b/jan/src/burn/snd/burn_y8950.cpp deleted file mode 100644 index c0933e24f..000000000 --- a/jan/src/burn/snd/burn_y8950.cpp +++ /dev/null @@ -1,659 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "burn_y8950.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "hd6309_intf.h" -#include "m6800_intf.h" -#include "m6502_intf.h" - -// Timer Related - -#define MAX_TIMER_VALUE ((1 << 30) - 65536) - -static double dTimeY8950; // Time elapsed since the emulated machine was started - -static INT32 nTimerCount[2], nTimerStart[2]; - -// Callbacks -static INT32 (*pTimerOverCallback)(INT32, INT32); -static double (*pTimerTimeCallback)(); - -static INT32 nCPUClockspeed = 0; -static INT32 (*pCPUTotalCycles)() = NULL; -static INT32 (*pCPURun)(INT32) = NULL; -static void (*pCPURunEnd)() = NULL; - -// --------------------------------------------------------------------------- -// Running time - -static double BurnTimerTimeCallbackDummy() -{ - return 0.0; -} - -extern "C" double BurnTimerGetTimeY8950() -{ - return dTimeY8950 + pTimerTimeCallback(); -} - -// --------------------------------------------------------------------------- -// Update timers - -static INT32 nTicksTotal, nTicksDone, nTicksExtra; - -INT32 BurnTimerUpdateY8950(INT32 nCycles) -{ - INT32 nIRQStatus = 0; - - nTicksTotal = MAKE_TIMER_TICKS(nCycles, nCPUClockspeed); - - while (nTicksDone < nTicksTotal) { - INT32 nTimer, nCyclesSegment, nTicksSegment; - - // Determine which timer fires first - if (nTimerCount[0] <= nTimerCount[1]) { - nTicksSegment = nTimerCount[0]; - } else { - nTicksSegment = nTimerCount[1]; - } - if (nTicksSegment > nTicksTotal) { - nTicksSegment = nTicksTotal; - } - - nCyclesSegment = MAKE_CPU_CYLES(nTicksSegment + nTicksExtra, nCPUClockspeed); - - pCPURun(nCyclesSegment - pCPUTotalCycles()); - - nTicksDone = MAKE_TIMER_TICKS(pCPUTotalCycles() + 1, nCPUClockspeed) - 1; - - nTimer = 0; - if (nTicksDone >= nTimerCount[0]) { - if (nTimerStart[0] == MAX_TIMER_VALUE) { - nTimerCount[0] = MAX_TIMER_VALUE; - } else { - nTimerCount[0] += nTimerStart[0]; - } - nTimer |= 1; - } - if (nTicksDone >= nTimerCount[1]) { - if (nTimerStart[1] == MAX_TIMER_VALUE) { - nTimerCount[1] = MAX_TIMER_VALUE; - } else { - nTimerCount[1] += nTimerStart[1]; - } - nTimer |= 2; - } - if (nTimer & 1) { - nIRQStatus |= pTimerOverCallback(0, 0); - } - if (nTimer & 2) { - nIRQStatus |= pTimerOverCallback(0, 1); - } - } - - return nIRQStatus; -} - -void BurnTimerEndFrameY8950(INT32 nCycles) -{ - INT32 nTicks = MAKE_TIMER_TICKS(nCycles, nCPUClockspeed); - - BurnTimerUpdateY8950(nCycles); - - if (nTimerCount[0] < MAX_TIMER_VALUE) { - nTimerCount[0] -= nTicks; - } - if (nTimerCount[1] < MAX_TIMER_VALUE) { - nTimerCount[1] -= nTicks; - } - - nTicksDone -= nTicks; - if (nTicksDone < 0) { - nTicksDone = 0; - } -} - -void BurnTimerUpdateEndY8950() -{ - pCPURunEnd(); - - nTicksTotal = 0; -} - -void BurnOPLTimerCallbackY8950(INT32 c, double period) -{ - pCPURunEnd(); - - if (period == 0.0) { - nTimerCount[c] = MAX_TIMER_VALUE; - return; - } - - nTimerCount[c] = (INT32)(period * (double)TIMER_TICKS_PER_SECOND); - nTimerCount[c] += MAKE_TIMER_TICKS(pCPUTotalCycles(), nCPUClockspeed); -} - -void BurnTimerScanY8950(INT32 nAction, INT32* pnMin) -{ - if (pnMin && *pnMin < 0x029521) { - *pnMin = 0x029521; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nTimerCount); - SCAN_VAR(nTimerStart); - SCAN_VAR(dTimeY8950); - - SCAN_VAR(nTicksDone); - } -} - -void BurnTimerExitY8950() -{ - nCPUClockspeed = 0; - pCPUTotalCycles = NULL; - pCPURun = NULL; - pCPURunEnd = NULL; - - return; -} - -void BurnTimerResetY8950() -{ - nTimerCount[0] = nTimerCount[1] = MAX_TIMER_VALUE; - nTimerStart[0] = nTimerStart[1] = MAX_TIMER_VALUE; - - dTimeY8950 = 0.0; - - nTicksDone = 0; -} - -INT32 BurnTimerInitY8950(INT32 (*pOverCallback)(INT32, INT32), double (*pTimeCallback)()) -{ - BurnTimerExitY8950(); - - pTimerOverCallback = pOverCallback; - pTimerTimeCallback = pTimeCallback ? pTimeCallback : BurnTimerTimeCallbackDummy; - - BurnTimerResetY8950(); - - return 0; -} - -INT32 BurnTimerAttachSekY8950(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = SekTotalCycles; - pCPURun = SekRun; - pCPURunEnd = SekRunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachZetY8950(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = ZetTotalCycles; - pCPURun = ZetRun; - pCPURunEnd = ZetRunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6809Y8950(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6809TotalCycles; - pCPURun = M6809Run; - pCPURunEnd = M6809RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachHD6309Y8950(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = HD6309TotalCycles; - pCPURun = HD6309Run; - pCPURunEnd = HD6309RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6800Y8950(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = M6800Run; - pCPURunEnd = M6800RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachHD63701Y8950(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = HD63701Run; - pCPURunEnd = HD63701RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6803Y8950(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = M6803Run; - pCPURunEnd = M6803RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6502Y8950(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6502TotalCycles; - pCPURun = M6502Run; - pCPURunEnd = M6502RunEnd; // doesn't do anything... - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -// Sound Related - -#define MAX_Y8950 2 - -void (*BurnY8950Update)(INT16* pSoundBuf, INT32 nSegmentEnd); - -static INT32 (*BurnY8950StreamCallback)(INT32 nSoundRate); - -static INT32 nBurnY8950SoundRate; - -static INT16* pBuffer; -static INT16* pY8950Buffer[MAX_Y8950]; - -static INT32 nY8950Position; - -static UINT32 nSampleSize; -static INT32 nFractionalPosition; - -static INT32 nNumChips = 0; - -static INT32 bY8950AddSignal; - -static double Y8950Volumes[1 * MAX_Y8950]; -static INT32 Y8950RouteDirs[1 * MAX_Y8950]; - -// ---------------------------------------------------------------------------- -// Dummy functions - -static void Y8950UpdateDummy(INT16* , INT32) -{ - return; -} - -static int Y8950StreamCallbackDummy(INT32) -{ - return 0; -} - -// ---------------------------------------------------------------------------- -// Execute Y8950 for part of a frame - -static void Y8950Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("Y8950Render called without init\n")); -#endif - - if (nY8950Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nY8950Position; - - Y8950UpdateOne(0, pBuffer + 0 * 4096 + 4 + nY8950Position, nSegmentLength); - - if (nNumChips > 1) { - Y8950UpdateOne(1, pBuffer + 1 * 4096 + 4 + nY8950Position, nSegmentLength); - } - - nY8950Position += nSegmentLength; -} - -// ---------------------------------------------------------------------------- -// Update the sound buffer - -static void Y8950UpdateResample(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("Y8950UpdateResample called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - INT32 nSamplesNeeded = nSegmentEnd * nBurnY8950SoundRate / nBurnSoundRate + 1; - - - if (nSamplesNeeded < nY8950Position) { - nSamplesNeeded = nY8950Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - nSegmentLength <<= 1; - - Y8950Render(nSamplesNeeded); - - pY8950Buffer[0] = pBuffer + 0 * 4096 + 4; - - if (nNumChips > 1) { - pY8950Buffer[1] = pBuffer + 1 * 4096 + 4; - } - - for (INT32 i = (nFractionalPosition & 0xFFFF0000) >> 15; i < nSegmentLength; i += 2, nFractionalPosition += nSampleSize) { - INT32 nLeftSample[4] = {0, 0, 0, 0}; - INT32 nRightSample[4] = {0, 0, 0, 0}; - INT32 nTotalLeftSample, nTotalRightSample; - - if ((Y8950RouteDirs[BURN_SND_Y8950_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pY8950Buffer[0][(nFractionalPosition >> 16) - 3] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - nLeftSample[1] += (INT32)(pY8950Buffer[0][(nFractionalPosition >> 16) - 2] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - nLeftSample[2] += (INT32)(pY8950Buffer[0][(nFractionalPosition >> 16) - 1] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - nLeftSample[3] += (INT32)(pY8950Buffer[0][(nFractionalPosition >> 16) - 0] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - } - if ((Y8950RouteDirs[BURN_SND_Y8950_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pY8950Buffer[0][(nFractionalPosition >> 16) - 3] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - nRightSample[1] += (INT32)(pY8950Buffer[0][(nFractionalPosition >> 16) - 2] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - nRightSample[2] += (INT32)(pY8950Buffer[0][(nFractionalPosition >> 16) - 1] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - nRightSample[3] += (INT32)(pY8950Buffer[0][(nFractionalPosition >> 16) - 0] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - } - - if (nNumChips > 1) { - if ((Y8950RouteDirs[1 + BURN_SND_Y8950_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pY8950Buffer[1][(nFractionalPosition >> 16) - 3] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - nLeftSample[1] += (INT32)(pY8950Buffer[1][(nFractionalPosition >> 16) - 2] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - nLeftSample[2] += (INT32)(pY8950Buffer[1][(nFractionalPosition >> 16) - 1] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - nLeftSample[3] += (INT32)(pY8950Buffer[1][(nFractionalPosition >> 16) - 0] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - } - if ((Y8950RouteDirs[1 + BURN_SND_Y8950_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pY8950Buffer[1][(nFractionalPosition >> 16) - 3] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - nRightSample[1] += (INT32)(pY8950Buffer[1][(nFractionalPosition >> 16) - 2] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - nRightSample[2] += (INT32)(pY8950Buffer[1][(nFractionalPosition >> 16) - 1] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - nRightSample[3] += (INT32)(pY8950Buffer[1][(nFractionalPosition >> 16) - 0] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - } - } - - nTotalLeftSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nLeftSample[0], nLeftSample[1], nLeftSample[2], nLeftSample[3]); - nTotalRightSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nRightSample[0], nRightSample[1], nRightSample[2], nRightSample[3]); - - nTotalLeftSample = BURN_SND_CLIP(nTotalLeftSample); - nTotalRightSample = BURN_SND_CLIP(nTotalRightSample); - - if (bY8950AddSignal) { - pSoundBuf[i + 0] += nTotalLeftSample; - pSoundBuf[i + 1] += nTotalRightSample; - } else { - pSoundBuf[i + 0] = nTotalLeftSample; - pSoundBuf[i + 1] = nTotalRightSample; - } - } - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSamplesNeeded - (nFractionalPosition >> 16); - - for (INT32 i = -4; i < nExtraSamples; i++) { - pY8950Buffer[0][i] = pY8950Buffer[0][(nFractionalPosition >> 16) + i]; - - if (nNumChips > 1) { - pY8950Buffer[1][i] = pY8950Buffer[1][(nFractionalPosition >> 16) + i]; - } - } - - nFractionalPosition &= 0xFFFF; - - nY8950Position = nExtraSamples; - } -} - -static void Y8950UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("Y8950UpdateNormal called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - - if (nSegmentEnd < nY8950Position) { - nSegmentEnd = nY8950Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - - Y8950Render(nSegmentEnd); - - pY8950Buffer[0] = pBuffer + 4 + 0 * 4096; - - if (nNumChips > 1) { - pY8950Buffer[1] = pBuffer + 4 + 1 * 4096; - } - - for (INT32 n = nFractionalPosition; n < nSegmentLength; n++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((Y8950RouteDirs[BURN_SND_Y8950_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pY8950Buffer[0][n] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - } - if ((Y8950RouteDirs[BURN_SND_Y8950_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pY8950Buffer[0][n] * Y8950Volumes[BURN_SND_Y8950_ROUTE]); - } - - if (nNumChips > 1) { - if ((Y8950RouteDirs[1 + BURN_SND_Y8950_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pY8950Buffer[1][n] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - } - if ((Y8950RouteDirs[1 + BURN_SND_Y8950_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pY8950Buffer[1][n] * Y8950Volumes[1 + BURN_SND_Y8950_ROUTE]); - } - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (bY8950AddSignal) { - pSoundBuf[(n << 1) + 0] += nLeftSample; - pSoundBuf[(n << 1) + 1] += nRightSample; - } else { - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } - } - - nFractionalPosition = nSegmentLength; - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSegmentEnd - nBurnSoundLen; - - for (INT32 i = 0; i < nExtraSamples; i++) { - pY8950Buffer[i] = pY8950Buffer[nBurnSoundLen + i]; - } - - nFractionalPosition = 0; - - nY8950Position = nExtraSamples; - - } -} - -// ---------------------------------------------------------------------------- -// Callbacks for Y8950 core - -void BurnY8950UpdateRequest(INT32, INT32) -{ -#if defined FBA_DEBUG - if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("BurnY8950UpdateRequest called without init\n")); -#endif - - Y8950Render(BurnY8950StreamCallback(nBurnY8950SoundRate)); -} - -// ---------------------------------------------------------------------------- -// Initialisation, etc. - -void BurnY8950Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("BurnY8950Reset called without init\n")); -#endif - - BurnTimerResetY8950(); - - for (INT32 i = 0; i < nNumChips; i++) { - Y8950ResetChip(i); - } -} - -void BurnY8950Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("BurnY8950Exit called without init\n")); -#endif - - // Crash prevention. - if (!DebugSnd_Y8950Initted) return; - - Y8950Shutdown(); - - BurnTimerExitY8950(); - - BurnFree(pBuffer); - - nNumChips = 0; - bY8950AddSignal = 0; - - DebugSnd_Y8950Initted = 0; -} - -INT32 BurnY8950Init(INT32 num, INT32 nClockFrequency, UINT8* Y8950ADPCM0ROM, INT32 nY8950ADPCM0Size, UINT8* Y8950ADPCM1ROM, INT32 nY8950ADPCM1Size, OPL_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), INT32 bAddSignal) -{ - BurnTimerInitY8950(&Y8950TimerOver, NULL); - - if (nBurnSoundRate <= 0) { - BurnY8950StreamCallback = Y8950StreamCallbackDummy; - - BurnY8950Update = Y8950UpdateDummy; - - Y8950Init(num, nClockFrequency, 11025); - return 0; - } - - BurnY8950StreamCallback = StreamCallback; - - if (nFMInterpolation == 3) { - // Set Y8950 core samplerate to match the hardware - nBurnY8950SoundRate = nClockFrequency / 72; - // Bring Y8950 core samplerate within usable range - while (nBurnY8950SoundRate > nBurnSoundRate * 3) { - nBurnY8950SoundRate >>= 1; - } - - BurnY8950Update = Y8950UpdateResample; - - nSampleSize = (UINT32)nBurnY8950SoundRate * (1 << 16) / nBurnSoundRate; - nFractionalPosition = 0; - } else { - nBurnY8950SoundRate = nBurnSoundRate; - - BurnY8950Update = Y8950UpdateNormal; - } - - Y8950Init(num, nClockFrequency, nBurnY8950SoundRate); - Y8950SetIRQHandler(0, IRQCallback, 0); - Y8950SetTimerHandler(0, &BurnOPLTimerCallbackY8950, 0); - Y8950SetUpdateHandler(0, &BurnY8950UpdateRequest, 0); - Y8950SetDeltaTMemory(0, Y8950ADPCM0ROM, nY8950ADPCM0Size); - if (num > 1) { -// Y8950SetIRQHandler(1, IRQCallback, 0); // ?? - Y8950SetTimerHandler(1, &BurnOPLTimerCallbackY8950, 0); - Y8950SetUpdateHandler(1, &BurnY8950UpdateRequest, 0); - Y8950SetDeltaTMemory(1, Y8950ADPCM1ROM, nY8950ADPCM1Size); - } - - pBuffer = (INT16*)BurnMalloc(4096 * num * sizeof(INT16)); - memset(pBuffer, 0, 4096 * num * sizeof(INT16)); - - nY8950Position = 0; - - nFractionalPosition = 0; - - nNumChips = num; - bY8950AddSignal = bAddSignal; - - // default routes - Y8950Volumes[BURN_SND_Y8950_ROUTE] = 1.00; - Y8950RouteDirs[BURN_SND_Y8950_ROUTE] = BURN_SND_ROUTE_BOTH; - if (nNumChips > 1) { - Y8950Volumes[1 + BURN_SND_Y8950_ROUTE] = 1.00; - Y8950RouteDirs[1 + BURN_SND_Y8950_ROUTE] = BURN_SND_ROUTE_BOTH; - } - - DebugSnd_Y8950Initted = 1; - - return 0; -} - -void BurnY8950SetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("BurnY8950SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnY8950SetRoute called with invalid index %i\n"), nIndex); - if (nChip >= nNumChips) bprintf(PRINT_ERROR, _T("BurnY8950SetRoute called with invalid chip %i\n"), nChip); -#endif - - if (nChip == 0) { - Y8950Volumes[nIndex] = nVolume; - Y8950RouteDirs[nIndex] = nRouteDir; - } - - if (nChip == 1) { - Y8950Volumes[1 + nIndex] = nVolume; - Y8950RouteDirs[1 + nIndex] = nRouteDir; - } -} - -void BurnY8950Scan(INT32 nAction, INT32* pnMin) -{ - #if defined FBA_DEBUG - if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("BurnY8950Scan called without init\n")); -#endif - - BurnTimerScanY8950(nAction, pnMin); - FMOPLScan(FM_OPL_SAVESTATE_Y8950, 0, nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nY8950Position); - } -} - -#undef MAX_Y8950 diff --git a/jan/src/burn/snd/burn_y8950.h b/jan/src/burn/snd/burn_y8950.h deleted file mode 100644 index fdd3cf456..000000000 --- a/jan/src/burn/snd/burn_y8950.h +++ /dev/null @@ -1,36 +0,0 @@ -#include "driver.h" -extern "C" { - #include "fmopl.h" -} -#include "timer.h" - -INT32 BurnTimerUpdateY8950(INT32 nCycles); -void BurnTimerEndFrameY8950(INT32 nCycles); -void BurnTimerUpdateEndY8950(); -INT32 BurnTimerAttachSekY8950(INT32 nClockspeed); -INT32 BurnTimerAttachZetY8950(INT32 nClockspeed); -INT32 BurnTimerAttachM6809Y8950(INT32 nClockspeed); -INT32 BurnTimerAttachHD6309Y8950(INT32 nClockspeed); -INT32 BurnTimerAttachM6800Y8950(INT32 nClockspeed); -INT32 BurnTimerAttachHD63701Y8950(INT32 nClockspeed); -INT32 BurnTimerAttachM6803Y8950(INT32 nClockspeed); -INT32 BurnTimerAttachM6502Y8950(INT32 nClockspeed); - -extern "C" void BurnY8950UpdateRequest(); - -INT32 BurnY8950Init(INT32 num, INT32 nClockFrequency, UINT8* Y8950ADPCM0ROM, INT32 nY8950ADPCM0Size, UINT8* Y8950ADPCM1ROM, INT32 nY8950ADPCM1Size, OPL_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), INT32 bAddSignal); -void BurnY8950SetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnY8950Reset(); -void BurnY8950Exit(); -extern void (*BurnY8950Update)(INT16* pSoundBuf, INT32 nSegmentEnd); -void BurnY8950Scan(INT32 nAction, INT32* pnMin); - -#define BURN_SND_Y8950_ROUTE 0 - -#define BurnY8950Read(i, a) Y8950Read(i, a) - -#if defined FBA_DEBUG - #define BurnY8950Write(i, a, n) if (!DebugSnd_Y8950Initted) bprintf(PRINT_ERROR, _T("BurnY8950Write called without init\n")); Y8950Write(i, a, n) -#else - #define BurnY8950Write(i, a, n) Y8950Write(i, a, n) -#endif diff --git a/jan/src/burn/snd/burn_ym2151.cpp b/jan/src/burn/snd/burn_ym2151.cpp deleted file mode 100644 index 6c877f6c4..000000000 --- a/jan/src/burn/snd/burn_ym2151.cpp +++ /dev/null @@ -1,248 +0,0 @@ -// FBAlpha YM-2151 sound core interface -#include "burnint.h" -#include "burn_sound.h" -#include "burn_ym2151.h" - -// Irq Callback timing notes.. -// Due to the way the internal timing of the ym2151 works, BurnYM2151Render() -// should not be called more than ~65 times per frame. See DrvFrame() in -// drv/konami/d_surpratk.cpp for a simple and effective work-around. - -void (*BurnYM2151Render)(INT16* pSoundBuf, INT32 nSegmentLength); - -UINT8 BurnYM2151Registers[0x0100]; -UINT32 nBurnCurrentYM2151Register; - -static INT32 nBurnYM2151SoundRate; - -static INT16* pBuffer; -static INT16* pYM2151Buffer[2]; - -static INT32 nBurnPosition; -static UINT32 nSampleSize; -static UINT32 nFractionalPosition; -static UINT32 nSamplesRendered; - -static double YM2151Volumes[2]; -static INT32 YM2151RouteDirs[2]; - -static void YM2151RenderResample(INT16* pSoundBuf, INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("YM2151RenderResample called without init\n")); -#endif - - nBurnPosition += nSegmentLength; - - if (nBurnPosition >= nBurnSoundRate) { - nBurnPosition = nSegmentLength; - - pYM2151Buffer[0][1] = pYM2151Buffer[0][(nFractionalPosition >> 16) - 3]; - pYM2151Buffer[0][2] = pYM2151Buffer[0][(nFractionalPosition >> 16) - 2]; - pYM2151Buffer[0][3] = pYM2151Buffer[0][(nFractionalPosition >> 16) - 1]; - - pYM2151Buffer[1][1] = pYM2151Buffer[1][(nFractionalPosition >> 16) - 3]; - pYM2151Buffer[1][2] = pYM2151Buffer[1][(nFractionalPosition >> 16) - 2]; - pYM2151Buffer[1][3] = pYM2151Buffer[1][(nFractionalPosition >> 16) - 1]; - - nSamplesRendered -= (nFractionalPosition >> 16) - 4; - - for (UINT32 i = 0; i <= nSamplesRendered; i++) { - pYM2151Buffer[0][4 + i] = pYM2151Buffer[0][(nFractionalPosition >> 16) + i]; - pYM2151Buffer[1][4 + i] = pYM2151Buffer[1][(nFractionalPosition >> 16) + i]; - } - - nFractionalPosition &= 0x0000FFFF; - nFractionalPosition |= 4 << 16; - } - - pYM2151Buffer[0] = pBuffer + 4 + nSamplesRendered; - pYM2151Buffer[1] = pBuffer + 4 + nSamplesRendered + 65536; - - YM2151UpdateOne(0, pYM2151Buffer, (UINT32)(nBurnPosition + 1) * nBurnYM2151SoundRate / nBurnSoundRate - nSamplesRendered); - nSamplesRendered += (UINT32)(nBurnPosition + 1) * nBurnYM2151SoundRate / nBurnSoundRate - nSamplesRendered; - - pYM2151Buffer[0] = pBuffer; - pYM2151Buffer[1] = pBuffer + 65536; - - nSegmentLength <<= 1; - - for (INT32 i = 0; i < nSegmentLength; i += 2, nFractionalPosition += nSampleSize) { - INT32 nLeftSample[4] = {0, 0, 0, 0}; - INT32 nRightSample[4] = {0, 0, 0, 0}; - INT32 nTotalLeftSample, nTotalRightSample; - - if ((YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM2151Buffer[0][(nFractionalPosition >> 16) - 3] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - nLeftSample[1] += (INT32)(pYM2151Buffer[0][(nFractionalPosition >> 16) - 2] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - nLeftSample[2] += (INT32)(pYM2151Buffer[0][(nFractionalPosition >> 16) - 1] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - nLeftSample[3] += (INT32)(pYM2151Buffer[0][(nFractionalPosition >> 16) - 0] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - } - if ((YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM2151Buffer[0][(nFractionalPosition >> 16) - 3] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - nRightSample[1] += (INT32)(pYM2151Buffer[0][(nFractionalPosition >> 16) - 2] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - nRightSample[2] += (INT32)(pYM2151Buffer[0][(nFractionalPosition >> 16) - 1] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - nRightSample[3] += (INT32)(pYM2151Buffer[0][(nFractionalPosition >> 16) - 0] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - } - - if ((YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM2151Buffer[1][(nFractionalPosition >> 16) - 3] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - nLeftSample[1] += (INT32)(pYM2151Buffer[1][(nFractionalPosition >> 16) - 2] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - nLeftSample[2] += (INT32)(pYM2151Buffer[1][(nFractionalPosition >> 16) - 1] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - nLeftSample[3] += (INT32)(pYM2151Buffer[1][(nFractionalPosition >> 16) - 0] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - } - if ((YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM2151Buffer[1][(nFractionalPosition >> 16) - 3] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - nRightSample[1] += (INT32)(pYM2151Buffer[1][(nFractionalPosition >> 16) - 2] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - nRightSample[2] += (INT32)(pYM2151Buffer[1][(nFractionalPosition >> 16) - 1] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - nRightSample[3] += (INT32)(pYM2151Buffer[1][(nFractionalPosition >> 16) - 0] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - } - - nTotalLeftSample = INTERPOLATE4PS_CUSTOM((nFractionalPosition >> 4) & 0x0fff, nLeftSample[0], nLeftSample[1], nLeftSample[2], nLeftSample[3], 16384.0); - nTotalRightSample = INTERPOLATE4PS_CUSTOM((nFractionalPosition >> 4) & 0x0fff, nRightSample[0], nRightSample[1], nRightSample[2], nRightSample[3], 16384.0); - - nTotalLeftSample = BURN_SND_CLIP(nTotalLeftSample); - nTotalRightSample = BURN_SND_CLIP(nTotalRightSample); - - pSoundBuf[i + 0] = nTotalLeftSample; - pSoundBuf[i + 1] = nTotalRightSample; - } -} - -static void YM2151RenderNormal(INT16* pSoundBuf, INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("YM2151RenderNormal called without init\n")); -#endif - - nBurnPosition += nSegmentLength; - - pYM2151Buffer[0] = pBuffer; - pYM2151Buffer[1] = pBuffer + nSegmentLength; - - YM2151UpdateOne(0, pYM2151Buffer, nSegmentLength); - - for (INT32 n = 0; n < nSegmentLength; n++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2151Buffer[0][n] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - } - if ((YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2151Buffer[0][n] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1]); - } - - if ((YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2151Buffer[1][n] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - } - if ((YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2151Buffer[1][n] * YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } -} - -void BurnYM2151Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("BurnYM2151Reset called without init\n")); -#endif - - memset(&BurnYM2151Registers, 0, sizeof(BurnYM2151Registers)); - YM2151ResetChip(0); -} - -void BurnYM2151Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("BurnYM2151Exit called without init\n")); -#endif - - if (!DebugSnd_YM2151Initted) return; - - BurnYM2151SetIrqHandler(NULL); - BurnYM2151SetPortHandler(NULL); - - YM2151Shutdown(); - - BurnFree(pBuffer); - - DebugSnd_YM2151Initted = 0; -} - -INT32 BurnYM2151Init(INT32 nClockFrequency) -{ - DebugSnd_YM2151Initted = 1; - - if (nBurnSoundRate <= 0) { - YM2151Init(1, nClockFrequency, 11025); - return 0; - } - - if (nFMInterpolation == 3) { - // Set YM2151 core samplerate to match the hardware - nBurnYM2151SoundRate = nClockFrequency >> 6; - // Bring YM2151 core samplerate within usable range - while (nBurnYM2151SoundRate > nBurnSoundRate * 3) { - nBurnYM2151SoundRate >>= 1; - } - - BurnYM2151Render = YM2151RenderResample; - } else { - nBurnYM2151SoundRate = nBurnSoundRate; - BurnYM2151Render = YM2151RenderNormal; - } - - YM2151Init(1, nClockFrequency, nBurnYM2151SoundRate); - - pBuffer = (INT16*)BurnMalloc(65536 * 2 * sizeof(INT16)); - memset(pBuffer, 0, 65536 * 2 * sizeof(INT16)); - - nSampleSize = (UINT32)nBurnYM2151SoundRate * (1 << 16) / nBurnSoundRate; - nFractionalPosition = 4 << 16; - nSamplesRendered = 0; - nBurnPosition = 0; - memset(&BurnYM2151Registers, 0, sizeof(BurnYM2151Registers)); - - // default routes - YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1] = 1.00; - YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_2] = 1.00; - YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_1] = BURN_SND_ROUTE_BOTH; - YM2151RouteDirs[BURN_SND_YM2151_YM2151_ROUTE_2] = BURN_SND_ROUTE_BOTH; - - return 0; -} - -void BurnYM2151SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("BurnYM2151SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnYM2151SetRoute called with invalid index %i\n"), nIndex); -#endif - - YM2151Volumes[nIndex] = nVolume; - YM2151RouteDirs[nIndex] = nRouteDir; -} - -void BurnYM2151Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("BurnYM2151Scan called without init\n")); -#endif - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return; - } - - { - SCAN_VAR(nBurnCurrentYM2151Register); - SCAN_VAR(BurnYM2151Registers); - } - - BurnYM2151Scan_int(nAction); // Scan the YM2151's internal registers -} diff --git a/jan/src/burn/snd/burn_ym2151.h b/jan/src/burn/snd/burn_ym2151.h deleted file mode 100644 index ef14b15ac..000000000 --- a/jan/src/burn/snd/burn_ym2151.h +++ /dev/null @@ -1,56 +0,0 @@ -// burn_ym2151.h -#include "driver.h" -extern "C" { - #include "ym2151.h" -} - -INT32 BurnYM2151Init(INT32 nClockFrequency); -void BurnYM2151SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnYM2151Reset(); -void BurnYM2151Exit(); -extern void (*BurnYM2151Render)(INT16* pSoundBuf, INT32 nSegmentLength); -void BurnYM2151Scan(INT32 nAction); - -static inline void BurnYM2151SelectRegister(const UINT8 nRegister) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("BurnYM2151SelectRegister called without init\n")); -#endif - - extern UINT32 nBurnCurrentYM2151Register; - - nBurnCurrentYM2151Register = nRegister; -} - -static inline void BurnYM2151WriteRegister(const UINT8 nValue) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("BurnYM2151WriteRegister called without init\n")); -#endif - - extern UINT32 nBurnCurrentYM2151Register; - /*extern UINT8 BurnYM2151Registers[0x0100]; - - if (nBurnCurrentYM2151Register >= 0x20 && // this is no longer necessary. June 24, 2014 - dink - nBurnCurrentYM2151Register <= 0x3F) { // only(!) remember oper connections - BurnYM2151Registers[nBurnCurrentYM2151Register] = nValue; - }*/ - YM2151WriteReg(0, nBurnCurrentYM2151Register, nValue); -} - -#define BurnYM2151ReadStatus() YM2151ReadStatus(0) - -#if defined FBA_DEBUG - #define BurnYM2151SetIrqHandler(h) if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("BurnYM2151SetIrqHandler called without init\n")); YM2151SetIrqHandler(0, h) - #define BurnYM2151SetPortHandler(h) if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("BurnYM2151SetPortHandler called without init\n")); YM2151SetPortWriteHandler(0, h) -#else - #define BurnYM2151SetIrqHandler(h) YM2151SetIrqHandler(0, h) - #define BurnYM2151SetPortHandler(h) YM2151SetPortWriteHandler(0, h) -#endif - -#define BURN_SND_YM2151_YM2151_ROUTE_1 0 -#define BURN_SND_YM2151_YM2151_ROUTE_2 1 - -#define BurnYM2151SetAllRoutes(v, d) \ - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, v, d); \ - BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/burn_ym2203.cpp b/jan/src/burn/snd/burn_ym2203.cpp deleted file mode 100644 index 8d637ad72..000000000 --- a/jan/src/burn/snd/burn_ym2203.cpp +++ /dev/null @@ -1,776 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "burn_ym2203.h" - -#define MAX_YM2203 3 - -void (*BurnYM2203Update)(INT16* pSoundBuf, INT32 nSegmentEnd); - -static INT32 (*BurnYM2203StreamCallback)(INT32 nSoundRate); - -static INT32 nBurnYM2203SoundRate; - -static INT16* pBuffer; -static INT16* pYM2203Buffer[4 * MAX_YM2203]; - -static INT32 nYM2203Position; -static INT32 nAY8910Position; - -static UINT32 nSampleSize; -static INT32 nFractionalPosition; - -static INT32 nNumChips = 0; - -static INT32 bYM2203AddSignal; - -static double YM2203Volumes[4 * MAX_YM2203]; -static INT32 YM2203RouteDirs[4 * MAX_YM2203]; - -static double YM2203LeftVolumes[4 * MAX_YM2203]; -static double YM2203RightVolumes[4 * MAX_YM2203]; - -INT32 bYM2203UseSeperateVolumes; // support custom Taito panning hardware - -// ---------------------------------------------------------------------------- -// Dummy functions - -static void YM2203UpdateDummy(INT16*, INT32) -{ - return; -} - -static INT32 YM2203StreamCallbackDummy(INT32) -{ - return 0; -} - -// ---------------------------------------------------------------------------- -// Execute YM2203 for part of a frame - -static void AY8910Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203 AY8910Render called without init\n")); -#endif - - if (nAY8910Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nAY8910Position; - - pYM2203Buffer[1] = pBuffer + 1 * 4096 + 4 + nAY8910Position; - pYM2203Buffer[2] = pBuffer + 2 * 4096 + 4 + nAY8910Position; - pYM2203Buffer[3] = pBuffer + 3 * 4096 + 4 + nAY8910Position; - - AY8910Update(0, &pYM2203Buffer[1], nSegmentLength); - - if (nNumChips > 1) { - pYM2203Buffer[5] = pBuffer + 5 * 4096 + 4 + nAY8910Position; - pYM2203Buffer[6] = pBuffer + 6 * 4096 + 4 + nAY8910Position; - pYM2203Buffer[7] = pBuffer + 7 * 4096 + 4 + nAY8910Position; - - AY8910Update(1, &pYM2203Buffer[5], nSegmentLength); - } - - if (nNumChips > 2) { - pYM2203Buffer[9] = pBuffer + 9 * 4096 + 4 + nAY8910Position; - pYM2203Buffer[10] = pBuffer + 10 * 4096 + 4 + nAY8910Position; - pYM2203Buffer[11] = pBuffer + 11 * 4096 + 4 + nAY8910Position; - - AY8910Update(2, &pYM2203Buffer[9], nSegmentLength); - } - - nAY8910Position += nSegmentLength; -} - -static void YM2203Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("YM2203Render called without init\n")); -#endif - - if (nYM2203Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nYM2203Position; - - pYM2203Buffer[0] = pBuffer + 0 * 4096 + 4 + nYM2203Position; - - YM2203UpdateOne(0, pYM2203Buffer[0], nSegmentLength); - - if (nNumChips > 1) { - pYM2203Buffer[4] = pBuffer + 4 * 4096 + 4 + nYM2203Position; - - YM2203UpdateOne(1, pYM2203Buffer[4], nSegmentLength); - } - - if (nNumChips > 2) { - pYM2203Buffer[8] = pBuffer + 8 * 4096 + 4 + nYM2203Position; - - YM2203UpdateOne(2, pYM2203Buffer[8], nSegmentLength); - } - - nYM2203Position += nSegmentLength; -} - -// ---------------------------------------------------------------------------- -// Update the sound buffer - -#define INTERPOLATE_ADD_SOUND_LEFT(route, buffer) \ - if ((YM2203RouteDirs[route] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { \ - nLeftSample[0] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 3] * YM2203Volumes[route]); \ - nLeftSample[1] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 2] * YM2203Volumes[route]); \ - nLeftSample[2] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 1] * YM2203Volumes[route]); \ - nLeftSample[3] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 0] * YM2203Volumes[route]); \ - } - -#define INTERPOLATE_ADD_SOUND_RIGHT(route, buffer) \ - if ((YM2203RouteDirs[route] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { \ - nRightSample[0] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 3] * YM2203Volumes[route]); \ - nRightSample[1] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 2] * YM2203Volumes[route]); \ - nRightSample[2] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 1] * YM2203Volumes[route]); \ - nRightSample[3] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 0] * YM2203Volumes[route]); \ - } - -#define SPLIT_INTERPOLATE_ADD_SOUND_LEFT(route, buffer) \ - nLeftSample[0] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 3] * YM2203LeftVolumes[route]); \ - nLeftSample[1] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 2] * YM2203LeftVolumes[route]); \ - nLeftSample[2] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 1] * YM2203LeftVolumes[route]); \ - nLeftSample[3] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 0] * YM2203LeftVolumes[route]); - -#define SPLIT_INTERPOLATE_ADD_SOUND_RIGHT(route, buffer) \ - nRightSample[0] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 3] * YM2203RightVolumes[route]); \ - nRightSample[1] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 2] * YM2203RightVolumes[route]); \ - nRightSample[2] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 1] * YM2203RightVolumes[route]); \ - nRightSample[3] += (INT32)(pYM2203Buffer[buffer][(nFractionalPosition >> 16) - 0] * YM2203RightVolumes[route]); - -static void YM2203UpdateResample(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("YM2203UpdateResample called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - INT32 nSamplesNeeded = nSegmentEnd * nBurnYM2203SoundRate / nBurnSoundRate + 1; - - if (nSamplesNeeded < nAY8910Position) { - nSamplesNeeded = nAY8910Position; - } - if (nSamplesNeeded < nYM2203Position) { - nSamplesNeeded = nYM2203Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - nSegmentLength <<= 1; - - YM2203Render(nSamplesNeeded); - AY8910Render(nSamplesNeeded); - - pYM2203Buffer[0] = pBuffer + 0 * 4096 + 4; - pYM2203Buffer[1] = pBuffer + 1 * 4096 + 4; - pYM2203Buffer[2] = pBuffer + 2 * 4096 + 4; - pYM2203Buffer[3] = pBuffer + 3 * 4096 + 4; - - if (nNumChips > 1) { - pYM2203Buffer[4] = pBuffer + 4 * 4096 + 4; - pYM2203Buffer[5] = pBuffer + 5 * 4096 + 4; - pYM2203Buffer[6] = pBuffer + 6 * 4096 + 4; - pYM2203Buffer[7] = pBuffer + 7 * 4096 + 4; - } - - if (nNumChips > 2) { - pYM2203Buffer[8] = pBuffer + 8 * 4096 + 4; - pYM2203Buffer[9] = pBuffer + 9 * 4096 + 4; - pYM2203Buffer[10] = pBuffer + 10 * 4096 + 4; - pYM2203Buffer[11] = pBuffer + 11 * 4096 + 4; - } - - for (INT32 i = (nFractionalPosition & 0xFFFF0000) >> 15; i < nSegmentLength; i += 2, nFractionalPosition += nSampleSize) { - INT32 nLeftSample[4] = {0, 0, 0, 0}; - INT32 nRightSample[4] = {0, 0, 0, 0}; - INT32 nTotalLeftSample, nTotalRightSample; - - if (bYM2203UseSeperateVolumes) { - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2203_AY8910_ROUTE_1, 1) - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2203_AY8910_ROUTE_2, 2) - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2203_AY8910_ROUTE_3, 3) - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2203_YM2203_ROUTE , 0) - - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2203_AY8910_ROUTE_1, 1) - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2203_AY8910_ROUTE_2, 2) - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2203_AY8910_ROUTE_3, 3) - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2203_YM2203_ROUTE , 0) - - if (nNumChips > 1) { - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (4 + BURN_SND_YM2203_AY8910_ROUTE_1, 5) - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (4 + BURN_SND_YM2203_AY8910_ROUTE_2, 6) - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (4 + BURN_SND_YM2203_AY8910_ROUTE_3, 7) - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (4 + BURN_SND_YM2203_YM2203_ROUTE , 4) - - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (4 + BURN_SND_YM2203_AY8910_ROUTE_1, 5) - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (4 + BURN_SND_YM2203_AY8910_ROUTE_2, 6) - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (4 + BURN_SND_YM2203_AY8910_ROUTE_3, 7) - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (4 + BURN_SND_YM2203_YM2203_ROUTE , 4) - } - - if (nNumChips > 2) { - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (8 + BURN_SND_YM2203_AY8910_ROUTE_1, 9) - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (8 + BURN_SND_YM2203_AY8910_ROUTE_2, 10) - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (8 + BURN_SND_YM2203_AY8910_ROUTE_3, 11) - SPLIT_INTERPOLATE_ADD_SOUND_LEFT (8 + BURN_SND_YM2203_YM2203_ROUTE , 8) - - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (8 + BURN_SND_YM2203_AY8910_ROUTE_1, 9) - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (8 + BURN_SND_YM2203_AY8910_ROUTE_2, 10) - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (8 + BURN_SND_YM2203_AY8910_ROUTE_3, 11) - SPLIT_INTERPOLATE_ADD_SOUND_RIGHT (8 + BURN_SND_YM2203_YM2203_ROUTE , 8) - } - } else { - INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2203_AY8910_ROUTE_1, 1) - INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2203_AY8910_ROUTE_1, 1) - INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2203_AY8910_ROUTE_2, 2) - INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2203_AY8910_ROUTE_2, 2) - INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2203_AY8910_ROUTE_3, 3) - INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2203_AY8910_ROUTE_3, 3) - INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2203_YM2203_ROUTE , 0) - INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2203_YM2203_ROUTE , 0) - - if (nNumChips > 1) { - INTERPOLATE_ADD_SOUND_LEFT (4 + BURN_SND_YM2203_AY8910_ROUTE_1, 5) - INTERPOLATE_ADD_SOUND_RIGHT (4 + BURN_SND_YM2203_AY8910_ROUTE_1, 5) - INTERPOLATE_ADD_SOUND_LEFT (4 + BURN_SND_YM2203_AY8910_ROUTE_2, 6) - INTERPOLATE_ADD_SOUND_RIGHT (4 + BURN_SND_YM2203_AY8910_ROUTE_2, 6) - INTERPOLATE_ADD_SOUND_LEFT (4 + BURN_SND_YM2203_AY8910_ROUTE_3, 7) - INTERPOLATE_ADD_SOUND_RIGHT (4 + BURN_SND_YM2203_AY8910_ROUTE_3, 7) - INTERPOLATE_ADD_SOUND_LEFT (4 + BURN_SND_YM2203_YM2203_ROUTE , 4) - INTERPOLATE_ADD_SOUND_RIGHT (4 + BURN_SND_YM2203_YM2203_ROUTE , 4) - } - - if (nNumChips > 2) { - INTERPOLATE_ADD_SOUND_LEFT (8 + BURN_SND_YM2203_AY8910_ROUTE_1, 9) - INTERPOLATE_ADD_SOUND_RIGHT (8 + BURN_SND_YM2203_AY8910_ROUTE_1, 9) - INTERPOLATE_ADD_SOUND_LEFT (8 + BURN_SND_YM2203_AY8910_ROUTE_2, 10) - INTERPOLATE_ADD_SOUND_RIGHT (8 + BURN_SND_YM2203_AY8910_ROUTE_2, 10) - INTERPOLATE_ADD_SOUND_LEFT (8 + BURN_SND_YM2203_AY8910_ROUTE_3, 11) - INTERPOLATE_ADD_SOUND_RIGHT (8 + BURN_SND_YM2203_AY8910_ROUTE_3, 11) - INTERPOLATE_ADD_SOUND_LEFT (8 + BURN_SND_YM2203_YM2203_ROUTE , 8) - INTERPOLATE_ADD_SOUND_RIGHT (8 + BURN_SND_YM2203_YM2203_ROUTE , 8) - } - } - - nTotalLeftSample = INTERPOLATE4PS_CUSTOM((nFractionalPosition >> 4) & 0x0fff, nLeftSample[0], nLeftSample[1], nLeftSample[2], nLeftSample[3], 16384.0); - nTotalRightSample = INTERPOLATE4PS_CUSTOM((nFractionalPosition >> 4) & 0x0fff, nRightSample[0], nRightSample[1], nRightSample[2], nRightSample[3], 16384.0); - - nTotalLeftSample = BURN_SND_CLIP(nTotalLeftSample); - nTotalRightSample = BURN_SND_CLIP(nTotalRightSample); - - if (bYM2203AddSignal) { - //pSoundBuf[i + 0] += nTotalLeftSample; - //pSoundBuf[i + 1] += nTotalRightSample; - pSoundBuf[i + 0] = BURN_SND_CLIP(pSoundBuf[i + 0] + nTotalLeftSample); - pSoundBuf[i + 1] = BURN_SND_CLIP(pSoundBuf[i + 1] + nTotalRightSample); - } else { - pSoundBuf[i + 0] = nTotalLeftSample; - pSoundBuf[i + 1] = nTotalRightSample; - } - - } - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSamplesNeeded - (nFractionalPosition >> 16); - - for (INT32 i = -4; i < nExtraSamples; i++) { - pYM2203Buffer[0][i] = pYM2203Buffer[0][(nFractionalPosition >> 16) + i]; - pYM2203Buffer[1][i] = pYM2203Buffer[1][(nFractionalPosition >> 16) + i]; - pYM2203Buffer[2][i] = pYM2203Buffer[2][(nFractionalPosition >> 16) + i]; - pYM2203Buffer[3][i] = pYM2203Buffer[3][(nFractionalPosition >> 16) + i]; - - if (nNumChips > 1) { - pYM2203Buffer[4][i] = pYM2203Buffer[4][(nFractionalPosition >> 16) + i]; - pYM2203Buffer[5][i] = pYM2203Buffer[5][(nFractionalPosition >> 16) + i]; - pYM2203Buffer[6][i] = pYM2203Buffer[6][(nFractionalPosition >> 16) + i]; - pYM2203Buffer[7][i] = pYM2203Buffer[7][(nFractionalPosition >> 16) + i]; - } - - if (nNumChips > 2) { - pYM2203Buffer[8][i] = pYM2203Buffer[8][(nFractionalPosition >> 16) + i]; - pYM2203Buffer[9][i] = pYM2203Buffer[9][(nFractionalPosition >> 16) + i]; - pYM2203Buffer[10][i] = pYM2203Buffer[10][(nFractionalPosition >> 16) + i]; - pYM2203Buffer[11][i] = pYM2203Buffer[11][(nFractionalPosition >> 16) + i]; - } - } - - nFractionalPosition &= 0xFFFF; - - nYM2203Position = nExtraSamples; - nAY8910Position = nExtraSamples; - - dTime += 100.0 / nBurnFPS; - } -} - -static void YM2203UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("YM2203UpdateNormal called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - INT32 i; - - if (nSegmentEnd < nAY8910Position) { - nSegmentEnd = nAY8910Position; - } - if (nSegmentEnd < nYM2203Position) { - nSegmentEnd = nYM2203Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - - YM2203Render(nSegmentEnd); - AY8910Render(nSegmentEnd); - - pYM2203Buffer[0] = pBuffer + 4 + 0 * 4096; - pYM2203Buffer[1] = pBuffer + 4 + 1 * 4096; - pYM2203Buffer[2] = pBuffer + 4 + 2 * 4096; - pYM2203Buffer[3] = pBuffer + 4 + 3 * 4096; - if (nNumChips > 1) { - pYM2203Buffer[4] = pBuffer + 4 + 4 * 4096; - pYM2203Buffer[5] = pBuffer + 4 + 5 * 4096; - pYM2203Buffer[6] = pBuffer + 4 + 6 * 4096; - pYM2203Buffer[7] = pBuffer + 4 + 7 * 4096; - } - if (nNumChips > 2) { - pYM2203Buffer[8] = pBuffer + 4 + 8 * 4096; - pYM2203Buffer[9] = pBuffer + 4 + 9 * 4096; - pYM2203Buffer[10] = pBuffer + 4 + 10 * 4096; - pYM2203Buffer[11] = pBuffer + 4 + 11 * 4096; - } - - for (INT32 n = nFractionalPosition; n < nSegmentLength; n++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if (bYM2203UseSeperateVolumes) { - nLeftSample += (INT32)(pYM2203Buffer[1][n] * YM2203LeftVolumes[BURN_SND_YM2203_AY8910_ROUTE_1]); - nLeftSample += (INT32)(pYM2203Buffer[2][n] * YM2203LeftVolumes[BURN_SND_YM2203_AY8910_ROUTE_2]); - nLeftSample += (INT32)(pYM2203Buffer[3][n] * YM2203LeftVolumes[BURN_SND_YM2203_AY8910_ROUTE_3]); - nLeftSample += (INT32)(pYM2203Buffer[0][n] * YM2203LeftVolumes[BURN_SND_YM2203_YM2203_ROUTE]); - - nRightSample += (INT32)(pYM2203Buffer[1][n] * YM2203RightVolumes[BURN_SND_YM2203_AY8910_ROUTE_1]); - nRightSample += (INT32)(pYM2203Buffer[2][n] * YM2203RightVolumes[BURN_SND_YM2203_AY8910_ROUTE_2]); - nRightSample += (INT32)(pYM2203Buffer[3][n] * YM2203RightVolumes[BURN_SND_YM2203_AY8910_ROUTE_3]); - nRightSample += (INT32)(pYM2203Buffer[0][n] * YM2203RightVolumes[BURN_SND_YM2203_YM2203_ROUTE]); - - if (nNumChips > 1) { - nLeftSample += (INT32)(pYM2203Buffer[5][n] * YM2203LeftVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_1]); - nLeftSample += (INT32)(pYM2203Buffer[6][n] * YM2203LeftVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_2]); - nLeftSample += (INT32)(pYM2203Buffer[7][n] * YM2203LeftVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_3]); - nLeftSample += (INT32)(pYM2203Buffer[4][n] * YM2203LeftVolumes[4 + BURN_SND_YM2203_YM2203_ROUTE]); - - nRightSample += (INT32)(pYM2203Buffer[5][n] * YM2203RightVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_1]); - nRightSample += (INT32)(pYM2203Buffer[6][n] * YM2203RightVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_2]); - nRightSample += (INT32)(pYM2203Buffer[7][n] * YM2203RightVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_3]); - nRightSample += (INT32)(pYM2203Buffer[4][n] * YM2203RightVolumes[4 + BURN_SND_YM2203_YM2203_ROUTE]); - } - - if (nNumChips > 2) { - nLeftSample += (INT32)(pYM2203Buffer[9][n] * YM2203LeftVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_1]); - nLeftSample += (INT32)(pYM2203Buffer[10][n] * YM2203LeftVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_2]); - nLeftSample += (INT32)(pYM2203Buffer[11][n] * YM2203LeftVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_3]); - nLeftSample += (INT32)(pYM2203Buffer[8][n] * YM2203LeftVolumes[8 + BURN_SND_YM2203_YM2203_ROUTE]); - - nRightSample += (INT32)(pYM2203Buffer[9][n] * YM2203RightVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_1]); - nRightSample += (INT32)(pYM2203Buffer[10][n] * YM2203RightVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_2]); - nRightSample += (INT32)(pYM2203Buffer[11][n] * YM2203RightVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_3]); - nRightSample += (INT32)(pYM2203Buffer[8][n] * YM2203RightVolumes[8 + BURN_SND_YM2203_YM2203_ROUTE]); - } - } else { - if ((YM2203RouteDirs[BURN_SND_YM2203_AY8910_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[1][n] * YM2203Volumes[BURN_SND_YM2203_AY8910_ROUTE_1]); - } - if ((YM2203RouteDirs[BURN_SND_YM2203_AY8910_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[1][n] * YM2203Volumes[BURN_SND_YM2203_AY8910_ROUTE_1]); - } - - if ((YM2203RouteDirs[BURN_SND_YM2203_AY8910_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[2][n] * YM2203Volumes[BURN_SND_YM2203_AY8910_ROUTE_2]); - } - if ((YM2203RouteDirs[BURN_SND_YM2203_AY8910_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[2][n] * YM2203Volumes[BURN_SND_YM2203_AY8910_ROUTE_2]); - } - - if ((YM2203RouteDirs[BURN_SND_YM2203_AY8910_ROUTE_3] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[3][n] * YM2203Volumes[BURN_SND_YM2203_AY8910_ROUTE_3]); - } - if ((YM2203RouteDirs[BURN_SND_YM2203_AY8910_ROUTE_3] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[3][n] * YM2203Volumes[BURN_SND_YM2203_AY8910_ROUTE_3]); - } - - if ((YM2203RouteDirs[BURN_SND_YM2203_YM2203_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[0][n] * YM2203Volumes[BURN_SND_YM2203_YM2203_ROUTE]); - } - if ((YM2203RouteDirs[BURN_SND_YM2203_YM2203_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[0][n] * YM2203Volumes[BURN_SND_YM2203_YM2203_ROUTE]); - } - - if (nNumChips > 1) { - if ((YM2203RouteDirs[4 + BURN_SND_YM2203_AY8910_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[5][n] * YM2203Volumes[4 + BURN_SND_YM2203_AY8910_ROUTE_1]); - } - if ((YM2203RouteDirs[4 + BURN_SND_YM2203_AY8910_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[5][n] * YM2203Volumes[4 + BURN_SND_YM2203_AY8910_ROUTE_1]); - } - - if ((YM2203RouteDirs[4 + BURN_SND_YM2203_AY8910_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[6][n] * YM2203Volumes[4 + BURN_SND_YM2203_AY8910_ROUTE_2]); - } - if ((YM2203RouteDirs[4 + BURN_SND_YM2203_AY8910_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[6][n] * YM2203Volumes[4 + BURN_SND_YM2203_AY8910_ROUTE_2]); - } - - if ((YM2203RouteDirs[4 + BURN_SND_YM2203_AY8910_ROUTE_3] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[7][n] * YM2203Volumes[4 + BURN_SND_YM2203_AY8910_ROUTE_3]); - } - if ((YM2203RouteDirs[4 + BURN_SND_YM2203_AY8910_ROUTE_3] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[7][n] * YM2203Volumes[4 + BURN_SND_YM2203_AY8910_ROUTE_3]); - } - - if ((YM2203RouteDirs[4 + BURN_SND_YM2203_YM2203_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[4][n] * YM2203Volumes[4 + BURN_SND_YM2203_YM2203_ROUTE]); - } - if ((YM2203RouteDirs[4 + BURN_SND_YM2203_YM2203_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[4][n] * YM2203Volumes[4 + BURN_SND_YM2203_YM2203_ROUTE]); - } - } - - if (nNumChips > 2) { - if ((YM2203RouteDirs[8 + BURN_SND_YM2203_AY8910_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[9][n] * YM2203Volumes[8 + BURN_SND_YM2203_AY8910_ROUTE_1]); - } - if ((YM2203RouteDirs[8 + BURN_SND_YM2203_AY8910_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[9][n] * YM2203Volumes[8 + BURN_SND_YM2203_AY8910_ROUTE_1]); - } - - if ((YM2203RouteDirs[8 + BURN_SND_YM2203_AY8910_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[10][n] * YM2203Volumes[8 + BURN_SND_YM2203_AY8910_ROUTE_2]); - } - if ((YM2203RouteDirs[8 + BURN_SND_YM2203_AY8910_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[10][n] * YM2203Volumes[8 + BURN_SND_YM2203_AY8910_ROUTE_2]); - } - - if ((YM2203RouteDirs[8 + BURN_SND_YM2203_AY8910_ROUTE_3] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[11][n] * YM2203Volumes[8 + BURN_SND_YM2203_AY8910_ROUTE_3]); - } - if ((YM2203RouteDirs[8 + BURN_SND_YM2203_AY8910_ROUTE_3] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[11][n] * YM2203Volumes[8 + BURN_SND_YM2203_AY8910_ROUTE_3]); - } - - if ((YM2203RouteDirs[8 + BURN_SND_YM2203_YM2203_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2203Buffer[8][n] * YM2203Volumes[8 + BURN_SND_YM2203_YM2203_ROUTE]); - } - if ((YM2203RouteDirs[8 + BURN_SND_YM2203_YM2203_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2203Buffer[8][n] * YM2203Volumes[8 + BURN_SND_YM2203_YM2203_ROUTE]); - } - } - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (bYM2203AddSignal) { - //pSoundBuf[(n << 1) + 0] += nLeftSample; - //pSoundBuf[(n << 1) + 1] += nRightSample; - pSoundBuf[(n << 1) + 0] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 0] + nLeftSample); - pSoundBuf[(n << 1) + 1] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 1] + nRightSample); - } else { - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } - } - - nFractionalPosition = nSegmentLength; - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSegmentEnd - nBurnSoundLen; - - for (i = 0; i < nExtraSamples; i++) { - pYM2203Buffer[0][i] = pYM2203Buffer[0][nBurnSoundLen + i]; - pYM2203Buffer[1][i] = pYM2203Buffer[1][nBurnSoundLen + i]; - pYM2203Buffer[2][i] = pYM2203Buffer[2][nBurnSoundLen + i]; - pYM2203Buffer[3][i] = pYM2203Buffer[3][nBurnSoundLen + i]; - if (nNumChips > 1) { - pYM2203Buffer[4][i] = pYM2203Buffer[4][nBurnSoundLen + i]; - pYM2203Buffer[5][i] = pYM2203Buffer[5][nBurnSoundLen + i]; - pYM2203Buffer[6][i] = pYM2203Buffer[6][nBurnSoundLen + i]; - pYM2203Buffer[7][i] = pYM2203Buffer[7][nBurnSoundLen + i]; - } - if (nNumChips > 2) { - pYM2203Buffer[8][i] = pYM2203Buffer[8][nBurnSoundLen + i]; - pYM2203Buffer[9][i] = pYM2203Buffer[9][nBurnSoundLen + i]; - pYM2203Buffer[10][i] = pYM2203Buffer[10][nBurnSoundLen + i]; - pYM2203Buffer[11][i] = pYM2203Buffer[11][nBurnSoundLen + i]; - } - } - - nFractionalPosition = 0; - - nYM2203Position = nExtraSamples; - nAY8910Position = nExtraSamples; - - dTime += 100.0 / nBurnFPS; - } -} - -// ---------------------------------------------------------------------------- -// Callbacks for YM2203 core - -void BurnYM2203UpdateRequest() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203UpdateRequest called without init\n")); -#endif - - YM2203Render(BurnYM2203StreamCallback(nBurnYM2203SoundRate)); -} - -static void BurnAY8910UpdateRequest() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203 BurnAY8910UpdateRequest called without init\n")); -#endif - - AY8910Render(BurnYM2203StreamCallback(nBurnYM2203SoundRate)); -} - -// ---------------------------------------------------------------------------- -// Initialisation, etc. - -void BurnYM2203Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203Reset called without init\n")); -#endif - - BurnTimerReset(); - - for (INT32 i = 0; i < nNumChips; i++) { - YM2203ResetChip(i); - AY8910Reset(i); - } -} - -void BurnYM2203Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203Exit called without init\n")); -#endif - - if (!DebugSnd_YM2203Initted) return; - - YM2203Shutdown(); - - for (INT32 i = 0; i < nNumChips; i++) { - AY8910Exit(i); - } - - BurnTimerExit(); - - BurnFree(pBuffer); - - nNumChips = 0; - bYM2203AddSignal = 0; - bYM2203UseSeperateVolumes = 0; - - DebugSnd_YM2203Initted = 0; -} - -INT32 BurnYM2203Init(INT32 num, INT32 nClockFrequency, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal) -{ - DebugSnd_YM2203Initted = 1; - - if (num > MAX_YM2203) num = MAX_YM2203; - - BurnTimerInit(&YM2203TimerOver, GetTimeCallback); - if (nBurnSoundRate <= 0) { - BurnYM2203StreamCallback = YM2203StreamCallbackDummy; - - BurnYM2203Update = YM2203UpdateDummy; - - for (INT32 i = 0; i < num; i++) { - AY8910InitYM(i, nClockFrequency, 11025, NULL, NULL, NULL, NULL, BurnAY8910UpdateRequest); - } - YM2203Init(num, nClockFrequency, 11025, &BurnOPNTimerCallback, IRQCallback); - return 0; - } - - BurnYM2203StreamCallback = StreamCallback; - - if (nFMInterpolation == 3) { - // Set YM2203 core samplerate to match the hardware - nBurnYM2203SoundRate = nClockFrequency >> 6; - // Bring YM2203 core samplerate within usable range - while (nBurnYM2203SoundRate > nBurnSoundRate * 3) { - nBurnYM2203SoundRate >>= 1; - } - - if (nBurnYM2203SoundRate < nBurnSoundRate) - nBurnYM2203SoundRate = nBurnSoundRate; - - BurnYM2203Update = YM2203UpdateResample; - nSampleSize = (UINT32)nBurnYM2203SoundRate * (1 << 16) / nBurnSoundRate; - - } else { - nBurnYM2203SoundRate = nBurnSoundRate; - BurnYM2203Update = YM2203UpdateNormal; - } - - for (INT32 i = 0; i < num; i++) { - AY8910InitYM(i, nClockFrequency, nBurnYM2203SoundRate, NULL, NULL, NULL, NULL, BurnAY8910UpdateRequest); - } - - YM2203Init(num, nClockFrequency, nBurnYM2203SoundRate, &BurnOPNTimerCallback, IRQCallback); - - pBuffer = (INT16*)BurnMalloc(4096 * 4 * num * sizeof(INT16)); - memset(pBuffer, 0, 4096 * 4 * num * sizeof(INT16)); - - nYM2203Position = 0; - nAY8910Position = 0; - nFractionalPosition = 0; - - nNumChips = num; - bYM2203AddSignal = bAddSignal; - - // default routes - YM2203Volumes[BURN_SND_YM2203_YM2203_ROUTE] = 1.00; - YM2203Volumes[BURN_SND_YM2203_AY8910_ROUTE_1] = 1.00; - YM2203Volumes[BURN_SND_YM2203_AY8910_ROUTE_2] = 1.00; - YM2203Volumes[BURN_SND_YM2203_AY8910_ROUTE_3] = 1.00; - YM2203RouteDirs[BURN_SND_YM2203_YM2203_ROUTE] = BURN_SND_ROUTE_BOTH; - YM2203RouteDirs[BURN_SND_YM2203_AY8910_ROUTE_1] = BURN_SND_ROUTE_BOTH; - YM2203RouteDirs[BURN_SND_YM2203_AY8910_ROUTE_2] = BURN_SND_ROUTE_BOTH; - YM2203RouteDirs[BURN_SND_YM2203_AY8910_ROUTE_3] = BURN_SND_ROUTE_BOTH; - - bYM2203UseSeperateVolumes = 0; - YM2203LeftVolumes[BURN_SND_YM2203_YM2203_ROUTE] = 1.00; - YM2203LeftVolumes[BURN_SND_YM2203_AY8910_ROUTE_1] = 1.00; - YM2203LeftVolumes[BURN_SND_YM2203_AY8910_ROUTE_2] = 1.00; - YM2203LeftVolumes[BURN_SND_YM2203_AY8910_ROUTE_3] = 1.00; - YM2203RightVolumes[BURN_SND_YM2203_YM2203_ROUTE] = 1.00; - YM2203RightVolumes[BURN_SND_YM2203_AY8910_ROUTE_1] = 1.00; - YM2203RightVolumes[BURN_SND_YM2203_AY8910_ROUTE_2] = 1.00; - YM2203RightVolumes[BURN_SND_YM2203_AY8910_ROUTE_3] = 1.00; - - if (nNumChips > 1) { - YM2203Volumes[4 + BURN_SND_YM2203_YM2203_ROUTE] = 1.00; - YM2203Volumes[4 + BURN_SND_YM2203_AY8910_ROUTE_1] = 1.00; - YM2203Volumes[4 + BURN_SND_YM2203_AY8910_ROUTE_2] = 1.00; - YM2203Volumes[4 + BURN_SND_YM2203_AY8910_ROUTE_3] = 1.00; - YM2203RouteDirs[4 + BURN_SND_YM2203_YM2203_ROUTE] = BURN_SND_ROUTE_BOTH; - YM2203RouteDirs[4 + BURN_SND_YM2203_AY8910_ROUTE_1] = BURN_SND_ROUTE_BOTH; - YM2203RouteDirs[4 + BURN_SND_YM2203_AY8910_ROUTE_2] = BURN_SND_ROUTE_BOTH; - YM2203RouteDirs[4 + BURN_SND_YM2203_AY8910_ROUTE_3] = BURN_SND_ROUTE_BOTH; - - YM2203LeftVolumes[4 + BURN_SND_YM2203_YM2203_ROUTE] = 1.00; - YM2203LeftVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_1] = 1.00; - YM2203LeftVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_2] = 1.00; - YM2203LeftVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_3] = 1.00; - YM2203RightVolumes[4 + BURN_SND_YM2203_YM2203_ROUTE] = 1.00; - YM2203RightVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_1] = 1.00; - YM2203RightVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_2] = 1.00; - YM2203RightVolumes[4 + BURN_SND_YM2203_AY8910_ROUTE_3] = 1.00; - } - - if (nNumChips > 2) { - YM2203Volumes[8 + BURN_SND_YM2203_YM2203_ROUTE] = 1.00; - YM2203Volumes[8 + BURN_SND_YM2203_AY8910_ROUTE_1] = 1.00; - YM2203Volumes[8 + BURN_SND_YM2203_AY8910_ROUTE_2] = 1.00; - YM2203Volumes[8 + BURN_SND_YM2203_AY8910_ROUTE_3] = 1.00; - YM2203RouteDirs[8 + BURN_SND_YM2203_YM2203_ROUTE] = BURN_SND_ROUTE_BOTH; - YM2203RouteDirs[8 + BURN_SND_YM2203_AY8910_ROUTE_1] = BURN_SND_ROUTE_BOTH; - YM2203RouteDirs[8 + BURN_SND_YM2203_AY8910_ROUTE_2] = BURN_SND_ROUTE_BOTH; - YM2203RouteDirs[8 + BURN_SND_YM2203_AY8910_ROUTE_3] = BURN_SND_ROUTE_BOTH; - - YM2203LeftVolumes[8 + BURN_SND_YM2203_YM2203_ROUTE] = 1.00; - YM2203LeftVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_1] = 1.00; - YM2203LeftVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_2] = 1.00; - YM2203LeftVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_3] = 1.00; - YM2203RightVolumes[8 + BURN_SND_YM2203_YM2203_ROUTE] = 1.00; - YM2203RightVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_1] = 1.00; - YM2203RightVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_2] = 1.00; - YM2203RightVolumes[8 + BURN_SND_YM2203_AY8910_ROUTE_3] = 1.00; - } - - return 0; -} - -void BurnYM2203SetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 3) bprintf(PRINT_ERROR, _T("BurnYM2203SetRoute called with invalid index %i\n"), nIndex); - if (nChip >= nNumChips) bprintf(PRINT_ERROR, _T("BurnYM2203SetRoute called with invalid chip %i\n"), nChip); -#endif - - if (nChip == 0) { - YM2203Volumes[nIndex] = nVolume; - YM2203RouteDirs[nIndex] = nRouteDir; - } - - if (nChip == 1) { - YM2203Volumes[4 + nIndex] = nVolume; - YM2203RouteDirs[4 + nIndex] = nRouteDir; - } - - if (nChip == 2) { - YM2203Volumes[8 + nIndex] = nVolume; - YM2203RouteDirs[8 + nIndex] = nRouteDir; - } -} - -void BurnYM2203SetLeftVolume(INT32 nChip, INT32 nIndex, double nLeftVolume) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203SetLeftVolume called without init\n")); - if (nIndex < 0 || nIndex > 3) bprintf(PRINT_ERROR, _T("BurnYM2203SetLeftVolume called with invalid index %i\n"), nIndex); - if (nChip >= nNumChips) bprintf(PRINT_ERROR, _T("BurnYM2203SetLeftVolume called with invalid chip %i\n"), nChip); -#endif - - if (nChip == 0) YM2203LeftVolumes[nIndex] = nLeftVolume; - if (nChip == 1) YM2203LeftVolumes[4 + nIndex] = nLeftVolume; - if (nChip == 2) YM2203LeftVolumes[8 + nIndex] = nLeftVolume; -} - -void BurnYM2203SetRightVolume(INT32 nChip, INT32 nIndex, double nRightVolume) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203SetRightVolume called without init\n")); - if (nIndex < 0 || nIndex > 3) bprintf(PRINT_ERROR, _T("BurnYM2203SetRightVolume called with invalid index %i\n"), nIndex); - if (nChip >= nNumChips) bprintf(PRINT_ERROR, _T("BurnYM2203SetRightVolume called with invalid chip %i\n"), nChip); -#endif - - if (nChip == 0) YM2203RightVolumes[nIndex] = nRightVolume; - if (nChip == 1) YM2203RightVolumes[4 + nIndex] = nRightVolume; - if (nChip == 2) YM2203RightVolumes[8 + nIndex] = nRightVolume; -} - -void BurnYM2203Scan(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203Scan called without init\n")); -#endif - - BurnTimerScan(nAction, pnMin); - AY8910Scan(nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nYM2203Position); - SCAN_VAR(nAY8910Position); - } -} - -#undef MAX_YM2203 diff --git a/jan/src/burn/snd/burn_ym2203.h b/jan/src/burn/snd/burn_ym2203.h deleted file mode 100644 index b8051660e..000000000 --- a/jan/src/burn/snd/burn_ym2203.h +++ /dev/null @@ -1,46 +0,0 @@ -// burn_ym2203.h -#include "driver.h" -extern "C" { - #include "ay8910.h" - #include "fm.h" -} -#include "timer.h" - -extern "C" void BurnYM2203UpdateRequest(); - -INT32 BurnYM2203Init(INT32 num, INT32 nClockFrequency, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal); -void BurnYM2203SetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnYM2203SetLeftVolume(INT32 nChip, INT32 nIndex, double nLeftVolume); -void BurnYM2203SetRightVolume(INT32 nChip, INT32 nIndex, double nRightVolume); -void BurnYM2203Reset(); -void BurnYM2203Exit(); -extern void (*BurnYM2203Update)(INT16* pSoundBuf, INT32 nSegmentEnd); -void BurnYM2203Scan(INT32 nAction, INT32* pnMin); - -extern INT32 bYM2203UseSeperateVolumes; - -#define BURN_SND_YM2203_YM2203_ROUTE 0 -#define BURN_SND_YM2203_AY8910_ROUTE_1 1 -#define BURN_SND_YM2203_AY8910_ROUTE_2 2 -#define BURN_SND_YM2203_AY8910_ROUTE_3 3 - -#define BurnYM2203SetAllRoutes(i, v, d) \ - BurnYM2203SetRoute(i, BURN_SND_YM2203_YM2203_ROUTE , v, d); \ - BurnYM2203SetRoute(i, BURN_SND_YM2203_AY8910_ROUTE_1, v, d); \ - BurnYM2203SetRoute(i, BURN_SND_YM2203_AY8910_ROUTE_2, v, d); \ - BurnYM2203SetRoute(i, BURN_SND_YM2203_AY8910_ROUTE_3, v, d) - -#define BurnYM2203SetPSGVolume(i, v) \ - BurnYM2203SetRoute(i, BURN_SND_YM2203_AY8910_ROUTE_1, v, BURN_SND_ROUTE_BOTH); \ - BurnYM2203SetRoute(i, BURN_SND_YM2203_AY8910_ROUTE_2, v, BURN_SND_ROUTE_BOTH); \ - BurnYM2203SetRoute(i, BURN_SND_YM2203_AY8910_ROUTE_3, v, BURN_SND_ROUTE_BOTH); - -#define BurnYM2203Read(i, a) YM2203Read(i, a) - -#if defined FBA_DEBUG - #define BurnYM2203Write(i, a, n) if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203Write called without init\n")); YM2203Write(i, a, n) - #define BurnYM2203SetPorts(c, read0, read1, write0, write1) if (!DebugSnd_YM2203Initted) bprintf(PRINT_ERROR, _T("BurnYM2203SetPorts called without init\n")); AY8910SetPorts(c, read0, read1, write0, write1) -#else - #define BurnYM2203Write(i, a, n) YM2203Write(i, a, n) - #define BurnYM2203SetPorts(c, read0, read1, write0, write1) AY8910SetPorts(c, read0, read1, write0, write1) -#endif diff --git a/jan/src/burn/snd/burn_ym2413.cpp b/jan/src/burn/snd/burn_ym2413.cpp deleted file mode 100644 index fd76030b1..000000000 --- a/jan/src/burn/snd/burn_ym2413.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "burn_ym2413.h" - -void (*BurnYM2413Render)(INT16* pSoundBuf, INT32 nSegmentLength); - -static INT32 nBurnYM2413SoundRate; - -static INT16* pBuffer; -static INT16* pYM2413Buffer[2]; - -static INT32 nBurnPosition; -static UINT32 nSampleSize; -static INT32 nFractionalPosition; -static UINT32 nSamplesRendered; - -static double YM2413Volumes[2]; -static INT32 YM2413RouteDirs[2]; - -#if 0 -static void YM2413RenderResample(INT16* pSoundBuf, INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2413Initted) bprintf(PRINT_ERROR, _T("YM2413RenderResample called without init\n")); -#endif - - // not currently supported (old code crashed) -} -#endif - -static void YM2413RenderNormal(INT16* pSoundBuf, INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2413Initted) bprintf(PRINT_ERROR, _T("YM2413RenderNormal called without init\n")); -#endif - - nBurnPosition += nSegmentLength; - - pYM2413Buffer[0] = pBuffer; - pYM2413Buffer[1] = pBuffer + nSegmentLength; - - YM2413UpdateOne(0, pYM2413Buffer, nSegmentLength); - - for (INT32 n = 0; n < nSegmentLength; n++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((YM2413RouteDirs[BURN_SND_YM2413_YM2413_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2413Buffer[0][n] * YM2413Volumes[BURN_SND_YM2413_YM2413_ROUTE_1]); - } - if ((YM2413RouteDirs[BURN_SND_YM2413_YM2413_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2413Buffer[0][n] * YM2413Volumes[BURN_SND_YM2413_YM2413_ROUTE_1]); - } - - if ((YM2413RouteDirs[BURN_SND_YM2413_YM2413_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2413Buffer[1][n] * YM2413Volumes[BURN_SND_YM2413_YM2413_ROUTE_2]); - } - if ((YM2413RouteDirs[BURN_SND_YM2413_YM2413_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2413Buffer[1][n] * YM2413Volumes[BURN_SND_YM2413_YM2413_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } -} - -void BurnYM2413Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2413Initted) bprintf(PRINT_ERROR, _T("BurnYM2413Reset called without init\n")); -#endif - - YM2413ResetChip(0); -} - -void BurnYM2413Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2413Initted) bprintf(PRINT_ERROR, _T("BurnYM2413Exit called without init\n")); -#endif - - if (!DebugSnd_YM2413Initted) return; - - YM2413Shutdown(); - - BurnFree(pBuffer); - - DebugSnd_YM2413Initted = 0; -} - -INT32 BurnYM2413Init(INT32 nClockFrequency) -{ - DebugSnd_YM2413Initted = 1; - - if (nBurnSoundRate <= 0) { - YM2413Init(1, nClockFrequency, 11025); - return 0; - } - -#if 0 - if (nFMInterpolation == 3) { - // Set YM2413 core samplerate to match the hardware - nBurnYM2413SoundRate = nClockFrequency >> 6; - // Bring YM2413 core samplerate within usable range - while (nBurnYM2413SoundRate > nBurnSoundRate * 3) { - nBurnYM2413SoundRate >>= 1; - } - - BurnYM2413Render = YM2413RenderResample; - } else { - nBurnYM2413SoundRate = nBurnSoundRate; - BurnYM2413Render = YM2413RenderNormal; - } -#else - nBurnYM2413SoundRate = nBurnSoundRate; - BurnYM2413Render = YM2413RenderNormal; -#endif - - YM2413Init(1, nClockFrequency, nBurnYM2413SoundRate); - - pBuffer = (INT16*)BurnMalloc(65536 * 2 * sizeof(INT16)); - memset(pBuffer, 0, 65536 * 2 * sizeof(INT16)); - - nSampleSize = (UINT32)nBurnYM2413SoundRate * (1 << 16) / nBurnSoundRate; - nFractionalPosition = 4 << 16; - nSamplesRendered = 0; - nBurnPosition = 0; - - // default routes - YM2413Volumes[BURN_SND_YM2413_YM2413_ROUTE_1] = 1.00; - YM2413Volumes[BURN_SND_YM2413_YM2413_ROUTE_2] = 1.00; - YM2413RouteDirs[BURN_SND_YM2413_YM2413_ROUTE_1] = BURN_SND_ROUTE_BOTH; - YM2413RouteDirs[BURN_SND_YM2413_YM2413_ROUTE_2] = BURN_SND_ROUTE_BOTH; - - return 0; -} - -void BurnYM2413SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2413Initted) bprintf(PRINT_ERROR, _T("BurnYM2413SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnYM2413SetRoute called with invalid index %i\n"), nIndex); -#endif - - YM2413Volumes[nIndex] = nVolume; - YM2413RouteDirs[nIndex] = nRouteDir; -} - -void BurnYM2413Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2413Initted) bprintf(PRINT_ERROR, _T("BurnYM2413Scan called without init\n")); -#endif - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return; - } - - YM2413Scan(0, nAction); -} diff --git a/jan/src/burn/snd/burn_ym2413.h b/jan/src/burn/snd/burn_ym2413.h deleted file mode 100644 index 8d19b771b..000000000 --- a/jan/src/burn/snd/burn_ym2413.h +++ /dev/null @@ -1,30 +0,0 @@ -// burn_ym2413.h -#include "driver.h" -extern "C" { - #include "ym2413.h" -} - -INT32 BurnYM2413Init(INT32 nClockFrequency); -void BurnYM2413SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnYM2413Reset(); -void BurnYM2413Exit(); -extern void (*BurnYM2413Render)(INT16* pSoundBuf, INT32 nSegmentLength); -void BurnYM2413Scan(INT32 nAction); - -#define BurnYM2413Read(a) YM2413Read(0, a) - -static inline void BurnYM2413Write(INT32 Address, const UINT8 nValue) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2413Initted) bprintf(PRINT_ERROR, _T("BurnYM2413Write called without init\n")); -#endif - - YM2413Write(0, Address, nValue); -} - -#define BURN_SND_YM2413_YM2413_ROUTE_1 0 -#define BURN_SND_YM2413_YM2413_ROUTE_2 1 - -#define BurnYM2413SetAllRoutes(v, d) \ - BurnYM2413SetRoute(BURN_SND_YM2413_YM2413_ROUTE_1, v, d); \ - BurnYM2413SetRoute(BURN_SND_YM2413_YM2413_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/burn_ym2608.cpp b/jan/src/burn/snd/burn_ym2608.cpp deleted file mode 100644 index cdb303705..000000000 --- a/jan/src/burn/snd/burn_ym2608.cpp +++ /dev/null @@ -1,432 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "burn_ym2608.h" - -void (*BurnYM2608Update)(INT16* pSoundBuf, INT32 nSegmentEnd); - -static INT32 (*BurnYM2608StreamCallback)(INT32 nSoundRate); - -static INT32 nBurnYM2608SoundRate; - -static INT16* pBuffer; -static INT16* pYM2608Buffer[6]; - -static INT32* pAYBuffer; - -static INT32 nYM2608Position; -static INT32 nAY8910Position; - -static UINT32 nSampleSize; -static INT32 nFractionalPosition; - -static INT32 bYM2608AddSignal; - -static double YM2608Volumes[3]; -static INT32 YM2608RouteDirs[3]; - -// ---------------------------------------------------------------------------- -// Dummy functions - -static void YM2608UpdateDummy(INT16*, INT32) -{ - return; -} - -static INT32 YM2608StreamCallbackDummy(INT32) -{ - return 0; -} - -// ---------------------------------------------------------------------------- -// Execute YM2608 for part of a frame - -static void AY8910Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("BurnYM2608 AY8910Render called without init\n")); -#endif - - if (nAY8910Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nAY8910Position; - - pYM2608Buffer[2] = pBuffer + 2 * 4096 + 4 + nAY8910Position; - pYM2608Buffer[3] = pBuffer + 3 * 4096 + 4 + nAY8910Position; - pYM2608Buffer[4] = pBuffer + 4 * 4096 + 4 + nAY8910Position; - - AY8910Update(0, &pYM2608Buffer[2], nSegmentLength); - - nAY8910Position += nSegmentLength; -} - -static void YM2608Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("YM2608Render called without init\n")); -#endif - - if (nYM2608Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nYM2608Position; - - pYM2608Buffer[0] = pBuffer + 0 * 4096 + 4 + nYM2608Position; - pYM2608Buffer[1] = pBuffer + 1 * 4096 + 4 + nYM2608Position; - - YM2608UpdateOne(0, &pYM2608Buffer[0], nSegmentLength); - - nYM2608Position += nSegmentLength; -} - -// ---------------------------------------------------------------------------- -// Update the sound buffer - -static void YM2608UpdateResample(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("YM2608UpdateResample called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - INT32 nSamplesNeeded = nSegmentEnd * nBurnYM2608SoundRate / nBurnSoundRate + 1; - - if (nSamplesNeeded < nAY8910Position) { - nSamplesNeeded = nAY8910Position; - } - if (nSamplesNeeded < nYM2608Position) { - nSamplesNeeded = nYM2608Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - nSegmentLength <<= 1; - - YM2608Render(nSamplesNeeded); - AY8910Render(nSamplesNeeded); - - pYM2608Buffer[0] = pBuffer + 0 * 4096 + 4; - pYM2608Buffer[1] = pBuffer + 1 * 4096 + 4; - pYM2608Buffer[2] = pBuffer + 2 * 4096 + 4; - pYM2608Buffer[3] = pBuffer + 3 * 4096 + 4; - pYM2608Buffer[4] = pBuffer + 4 * 4096 + 4; - pYM2608Buffer[5] = pBuffer + 5 * 4096 + 4; - - for (INT32 i = (nFractionalPosition >> 16) - 4; i < nSamplesNeeded; i++) { - pYM2608Buffer[5][i] = (INT32)((pYM2608Buffer[2][i] + pYM2608Buffer[3][i] + pYM2608Buffer[4][i]) * YM2608Volumes[BURN_SND_YM2608_AY8910_ROUTE]); - } - - for (INT32 i = (nFractionalPosition & 0xFFFF0000) >> 15; i < nSegmentLength; i += 2, nFractionalPosition += nSampleSize) { - INT32 nLeftSample[4] = {0, 0, 0, 0}; - INT32 nRightSample[4] = {0, 0, 0, 0}; - INT32 nTotalLeftSample, nTotalRightSample; - - if ((YM2608RouteDirs[BURN_SND_YM2608_AY8910_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += pYM2608Buffer[5][(nFractionalPosition >> 16) - 3]; - nLeftSample[1] += pYM2608Buffer[5][(nFractionalPosition >> 16) - 2]; - nLeftSample[2] += pYM2608Buffer[5][(nFractionalPosition >> 16) - 1]; - nLeftSample[3] += pYM2608Buffer[5][(nFractionalPosition >> 16) - 0]; - } - if ((YM2608RouteDirs[BURN_SND_YM2608_AY8910_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += pYM2608Buffer[5][(nFractionalPosition >> 16) - 3]; - nRightSample[1] += pYM2608Buffer[5][(nFractionalPosition >> 16) - 2]; - nRightSample[2] += pYM2608Buffer[5][(nFractionalPosition >> 16) - 1]; - nRightSample[3] += pYM2608Buffer[5][(nFractionalPosition >> 16) - 0]; - } - - if ((YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM2608Buffer[0][(nFractionalPosition >> 16) - 3] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - nLeftSample[1] += (INT32)(pYM2608Buffer[0][(nFractionalPosition >> 16) - 2] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - nLeftSample[2] += (INT32)(pYM2608Buffer[0][(nFractionalPosition >> 16) - 1] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - nLeftSample[3] += (INT32)(pYM2608Buffer[0][(nFractionalPosition >> 16) - 0] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - } - if ((YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM2608Buffer[0][(nFractionalPosition >> 16) - 3] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - nRightSample[1] += (INT32)(pYM2608Buffer[0][(nFractionalPosition >> 16) - 2] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - nRightSample[2] += (INT32)(pYM2608Buffer[0][(nFractionalPosition >> 16) - 1] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - nRightSample[3] += (INT32)(pYM2608Buffer[0][(nFractionalPosition >> 16) - 0] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - } - - if ((YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM2608Buffer[1][(nFractionalPosition >> 16) - 3] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - nLeftSample[1] += (INT32)(pYM2608Buffer[1][(nFractionalPosition >> 16) - 2] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - nLeftSample[2] += (INT32)(pYM2608Buffer[1][(nFractionalPosition >> 16) - 1] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - nLeftSample[3] += (INT32)(pYM2608Buffer[1][(nFractionalPosition >> 16) - 0] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - } - if ((YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM2608Buffer[1][(nFractionalPosition >> 16) - 3] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - nRightSample[1] += (INT32)(pYM2608Buffer[1][(nFractionalPosition >> 16) - 2] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - nRightSample[2] += (INT32)(pYM2608Buffer[1][(nFractionalPosition >> 16) - 1] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - nRightSample[3] += (INT32)(pYM2608Buffer[1][(nFractionalPosition >> 16) - 0] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - } - - nTotalLeftSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nLeftSample[0], nLeftSample[1], nLeftSample[2], nLeftSample[3]); - nTotalRightSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nRightSample[0], nRightSample[1], nRightSample[2], nRightSample[3]); - - nTotalLeftSample = BURN_SND_CLIP(nTotalLeftSample); - nTotalRightSample = BURN_SND_CLIP(nTotalRightSample); - - if (bYM2608AddSignal) { - pSoundBuf[i + 0] += nTotalLeftSample; - pSoundBuf[i + 1] += nTotalRightSample; - } else { - pSoundBuf[i + 0] = nTotalLeftSample; - pSoundBuf[i + 1] = nTotalRightSample; - } - } - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSamplesNeeded - (nFractionalPosition >> 16); - - for (INT32 i = -4; i < nExtraSamples; i++) { - pYM2608Buffer[0][i] = pYM2608Buffer[0][(nFractionalPosition >> 16) + i]; - pYM2608Buffer[1][i] = pYM2608Buffer[1][(nFractionalPosition >> 16) + i]; - pYM2608Buffer[2][i] = pYM2608Buffer[2][(nFractionalPosition >> 16) + i]; - pYM2608Buffer[3][i] = pYM2608Buffer[3][(nFractionalPosition >> 16) + i]; - pYM2608Buffer[4][i] = pYM2608Buffer[4][(nFractionalPosition >> 16) + i]; - } - - nFractionalPosition &= 0xFFFF; - - nYM2608Position = nExtraSamples; - nAY8910Position = nExtraSamples; - - dTime += 100.0 / nBurnFPS; - } -} - -static void YM2608UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("YM2608UpdateNormal called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - - if (nSegmentEnd < nAY8910Position) { - nSegmentEnd = nAY8910Position; - } - if (nSegmentEnd < nYM2608Position) { - nSegmentEnd = nYM2608Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - - YM2608Render(nSegmentEnd); - AY8910Render(nSegmentEnd); - - pYM2608Buffer[0] = pBuffer + 4 + 0 * 4096; - pYM2608Buffer[1] = pBuffer + 4 + 1 * 4096; - pYM2608Buffer[2] = pBuffer + 4 + 2 * 4096; - pYM2608Buffer[3] = pBuffer + 4 + 3 * 4096; - pYM2608Buffer[4] = pBuffer + 4 + 4 * 4096; - - for (INT32 n = nFractionalPosition; n < nSegmentLength; n++) { - INT32 nAYSample, nLeftSample = 0, nRightSample = 0; - - nAYSample = pYM2608Buffer[2][n]; - nAYSample += pYM2608Buffer[3][n]; - nAYSample += pYM2608Buffer[4][n]; - - if ((YM2608RouteDirs[BURN_SND_YM2608_AY8910_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(nAYSample * YM2608Volumes[BURN_SND_YM2608_AY8910_ROUTE]); - } - if ((YM2608RouteDirs[BURN_SND_YM2608_AY8910_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(nAYSample * YM2608Volumes[BURN_SND_YM2608_AY8910_ROUTE]); - } - - if ((YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2608Buffer[0][n] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - } - if ((YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2608Buffer[0][n] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1]); - } - - if ((YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2608Buffer[1][n] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - } - if ((YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2608Buffer[1][n] * YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (bYM2608AddSignal) { - pSoundBuf[(n << 1) + 0] += nLeftSample; - pSoundBuf[(n << 1) + 1] += nRightSample; - } else { - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } - } - - nFractionalPosition = nSegmentLength; - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSegmentEnd - nBurnSoundLen; - - for (INT32 i = 0; i < nExtraSamples; i++) { - pYM2608Buffer[0][i] = pYM2608Buffer[0][nBurnSoundLen + i]; - pYM2608Buffer[1][i] = pYM2608Buffer[1][nBurnSoundLen + i]; - pYM2608Buffer[2][i] = pYM2608Buffer[2][nBurnSoundLen + i]; - pYM2608Buffer[3][i] = pYM2608Buffer[3][nBurnSoundLen + i]; - pYM2608Buffer[4][i] = pYM2608Buffer[4][nBurnSoundLen + i]; - } - - nFractionalPosition = 0; - - nYM2608Position = nExtraSamples; - nAY8910Position = nExtraSamples; - - dTime += 100.0 / nBurnFPS; - } -} - -// ---------------------------------------------------------------------------- -// Callbacks for YM2608 core - -void BurnYM2608UpdateRequest() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("BurnYM2608UpdateRequest called without init\n")); -#endif - - YM2608Render(BurnYM2608StreamCallback(nBurnYM2608SoundRate)); -} - -static void BurnAY8910UpdateRequest() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("BurnYM2608 BurnAY8910UpdateRequest called without init\n")); -#endif - - AY8910Render(BurnYM2608StreamCallback(nBurnYM2608SoundRate)); -} - -// ---------------------------------------------------------------------------- -// Initialisation, etc. - -void BurnYM2608Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("BurnYM2608Reset called without init\n")); -#endif - - BurnTimerReset(); - - YM2608ResetChip(0); -} - -void BurnYM2608Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("BurnYM2608Exit called without init\n")); -#endif - - if (!DebugSnd_YM2608Initted) return; - - YM2608Shutdown(); - AY8910Exit(0); - - BurnTimerExit(); - - BurnFree(pBuffer); - BurnFree(pAYBuffer); - - bYM2608AddSignal = 0; - - DebugSnd_YM2608Initted = 0; -} - -INT32 BurnYM2608Init(INT32 nClockFrequency, UINT8* YM2608ADPCMROM, INT32* nYM2608ADPCMSize, UINT8* YM2608IROM, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal) -{ - DebugSnd_YM2608Initted = 1; - - BurnTimerInit(&YM2608TimerOver, GetTimeCallback); - - if (nBurnSoundRate <= 0) { - BurnYM2608StreamCallback = YM2608StreamCallbackDummy; - - BurnYM2608Update = YM2608UpdateDummy; - - AY8910InitYM(0, nClockFrequency, 11025, NULL, NULL, NULL, NULL, BurnAY8910UpdateRequest); - YM2608Init(1, nClockFrequency, 11025, (void**)(&YM2608ADPCMROM), nYM2608ADPCMSize, YM2608IROM, &BurnOPNTimerCallback, IRQCallback); - return 0; - } - - BurnYM2608StreamCallback = StreamCallback; - - if (nFMInterpolation == 3) { - // Set YM2608 core samplerate to match the hardware - nBurnYM2608SoundRate = nClockFrequency / 144; - // Bring YM2608 core samplerate within usable range - while (nBurnYM2608SoundRate > nBurnSoundRate * 3) { - nBurnYM2608SoundRate >>= 1; - } - - BurnYM2608Update = YM2608UpdateResample; - - nSampleSize = (UINT32)nBurnYM2608SoundRate * (1 << 16) / nBurnSoundRate; - nFractionalPosition = 0; - } else { - nBurnYM2608SoundRate = nBurnSoundRate; - - BurnYM2608Update = YM2608UpdateNormal; - } - - AY8910InitYM(0, nClockFrequency, nBurnYM2608SoundRate, NULL, NULL, NULL, NULL, BurnAY8910UpdateRequest); - YM2608Init(1, nClockFrequency, nBurnYM2608SoundRate, (void**)(&YM2608ADPCMROM), nYM2608ADPCMSize, YM2608IROM, &BurnOPNTimerCallback, IRQCallback); - - pBuffer = (INT16*)BurnMalloc(4096 * 6 * sizeof(INT16)); - memset(pBuffer, 0, 4096 * 6 * sizeof(INT16)); - - pAYBuffer = (INT32*)BurnMalloc(4096 * sizeof(INT32)); - memset(pAYBuffer, 0, 4096 * sizeof(INT32)); - - nYM2608Position = 0; - nAY8910Position = 0; - - bYM2608AddSignal = bAddSignal; - - // default routes - YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_1] = 1.00; - YM2608Volumes[BURN_SND_YM2608_YM2608_ROUTE_2] = 1.00; - YM2608Volumes[BURN_SND_YM2608_AY8910_ROUTE] = 1.00; - YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_1] = BURN_SND_ROUTE_LEFT; - YM2608RouteDirs[BURN_SND_YM2608_YM2608_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - YM2608RouteDirs[BURN_SND_YM2608_AY8910_ROUTE] = BURN_SND_ROUTE_BOTH; - - return 0; -} - -void BurnYM2608SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("BurnYM2608SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 2) bprintf(PRINT_ERROR, _T("BurnYM2608SetRoute called with invalid index %i\n"), nIndex); -#endif - - YM2608Volumes[nIndex] = nVolume; - YM2608RouteDirs[nIndex] = nRouteDir; -} - -void BurnYM2608Scan(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("BurnYM2608Scan called without init\n")); -#endif - - BurnTimerScan(nAction, pnMin); - AY8910Scan(nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nYM2608Position); - SCAN_VAR(nAY8910Position); - } -} diff --git a/jan/src/burn/snd/burn_ym2608.h b/jan/src/burn/snd/burn_ym2608.h deleted file mode 100644 index 34c2f031b..000000000 --- a/jan/src/burn/snd/burn_ym2608.h +++ /dev/null @@ -1,33 +0,0 @@ -// burn_ym2608.h -#include "driver.h" -extern "C" { - #include "ay8910.h" - #include "fm.h" -} -#include "timer.h" - -extern "C" void BurnYM2608UpdateRequest(); - -INT32 BurnYM2608Init(INT32 nClockFrequency, UINT8* YM2608ADPCMROM, INT32* nYM2608ADPCMSize, UINT8* YM2608IROM, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal); -void BurnYM2608SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnYM2608Reset(); -void BurnYM2608Exit(); -extern void (*BurnYM2608Update)(INT16* pSoundBuf, INT32 nSegmentEnd); -void BurnYM2608Scan(INT32 nAction, INT32* pnMin); - -#define BURN_SND_YM2608_YM2608_ROUTE_1 0 -#define BURN_SND_YM2608_YM2608_ROUTE_2 1 -#define BURN_SND_YM2608_AY8910_ROUTE 2 - -#define BurnYM2608SetAllRoutes(v, d) \ - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_1, v, d); \ - BurnYM2608SetRoute(BURN_SND_YM2608_YM2608_ROUTE_2, v, d); \ - BurnYM2608SetRoute(BURN_SND_YM2608_AY8910_ROUTE , v, d); - -#define BurnYM2608Read(a) YM2608Read(0, a) - -#if defined FBA_DEBUG - #define BurnYM2608Write(a, n) if (!DebugSnd_YM2608Initted) bprintf(PRINT_ERROR, _T("BurnYM2608Write called without init\n")); YM2608Write(0, a, n) -#else - #define BurnYM2608Write(a, n) YM2608Write(0, a, n) -#endif diff --git a/jan/src/burn/snd/burn_ym2610.cpp b/jan/src/burn/snd/burn_ym2610.cpp deleted file mode 100644 index 743f7bbf2..000000000 --- a/jan/src/burn/snd/burn_ym2610.cpp +++ /dev/null @@ -1,521 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "burn_ym2610.h" - -void (*BurnYM2610Update)(INT16* pSoundBuf, INT32 nSegmentEnd); - -static INT32 (*BurnYM2610StreamCallback)(INT32 nSoundRate); - -static INT32 nBurnYM2610SoundRate; - -static INT16* pBuffer; -static INT16* pYM2610Buffer[6]; - -static INT32* pAYBuffer; - -static INT32 nYM2610Position; -static INT32 nAY8910Position; - -static UINT32 nSampleSize; -static INT32 nFractionalPosition; - -static INT32 bYM2610AddSignal; - -static double YM2610Volumes[3]; -static INT32 YM2610RouteDirs[3]; - -static double YM2610LeftVolumes[3]; -static double YM2610RightVolumes[3]; - -INT32 bYM2610UseSeperateVolumes; // support custom Taito panning hardware - -// ---------------------------------------------------------------------------- -// Dummy functions - -static void YM2610UpdateDummy(INT16*, INT32) -{ - return; -} - -static INT32 YM2610StreamCallbackDummy(INT32) -{ - return 0; -} - -// ---------------------------------------------------------------------------- -// Execute YM2610 for part of a frame - -static void AY8910Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610 AY8910Render called without init\n")); -#endif - - if (nAY8910Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nAY8910Position; - - pYM2610Buffer[2] = pBuffer + 2 * 4096 + 4 + nAY8910Position; - pYM2610Buffer[3] = pBuffer + 3 * 4096 + 4 + nAY8910Position; - pYM2610Buffer[4] = pBuffer + 4 * 4096 + 4 + nAY8910Position; - - AY8910Update(0, &pYM2610Buffer[2], nSegmentLength); - - nAY8910Position += nSegmentLength; -} - -static void YM2610Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("YM2610Render called without init\n")); -#endif - - if (nYM2610Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nYM2610Position; - - pYM2610Buffer[0] = pBuffer + 0 * 4096 + 4 + nYM2610Position; - pYM2610Buffer[1] = pBuffer + 1 * 4096 + 4 + nYM2610Position; - - YM2610UpdateOne(0, &pYM2610Buffer[0], nSegmentLength); - - nYM2610Position += nSegmentLength; -} - -// ---------------------------------------------------------------------------- -// Update the sound buffer - -static void YM2610UpdateResample(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("YM2610UpdateResample called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - INT32 nSamplesNeeded = nSegmentEnd * nBurnYM2610SoundRate / nBurnSoundRate + 1; - - if (nSamplesNeeded < nAY8910Position) { - nSamplesNeeded = nAY8910Position; - } - if (nSamplesNeeded < nYM2610Position) { - nSamplesNeeded = nYM2610Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - nSegmentLength <<= 1; - - YM2610Render(nSamplesNeeded); - AY8910Render(nSamplesNeeded); - - pYM2610Buffer[0] = pBuffer + 0 * 4096 + 4; - pYM2610Buffer[1] = pBuffer + 1 * 4096 + 4; - pYM2610Buffer[2] = pBuffer + 2 * 4096 + 4; - pYM2610Buffer[3] = pBuffer + 3 * 4096 + 4; - pYM2610Buffer[4] = pBuffer + 4 * 4096 + 4; - pYM2610Buffer[5] = pBuffer + 5 * 4096 + 4; - - for (INT32 i = (nFractionalPosition >> 16) - 4; i < nSamplesNeeded; i++) { - pYM2610Buffer[5][i] = BURN_SND_CLIP(pYM2610Buffer[2][i] + pYM2610Buffer[3][i] + pYM2610Buffer[4][i]); - } - - for (INT32 i = (nFractionalPosition & 0xFFFF0000) >> 15; i < nSegmentLength; i += 2, nFractionalPosition += nSampleSize) { - INT32 nLeftSample[4] = {0, 0, 0, 0}; - INT32 nRightSample[4] = {0, 0, 0, 0}; - INT32 nTotalLeftSample, nTotalRightSample; - - if (bYM2610UseSeperateVolumes) { - nLeftSample[0] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 3] * YM2610LeftVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - nLeftSample[1] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 2] * YM2610LeftVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - nLeftSample[2] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 1] * YM2610LeftVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - nLeftSample[3] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 0] * YM2610LeftVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - - nLeftSample[0] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 3] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nLeftSample[1] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 2] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nLeftSample[2] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 1] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nLeftSample[3] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 0] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - - nLeftSample[0] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 3] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nLeftSample[1] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 2] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nLeftSample[2] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 1] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nLeftSample[3] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 0] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - - nRightSample[0] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 3] * YM2610RightVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - nRightSample[1] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 2] * YM2610RightVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - nRightSample[2] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 1] * YM2610RightVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - nRightSample[3] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 0] * YM2610RightVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - - nRightSample[0] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 3] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nRightSample[1] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 2] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nRightSample[2] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 1] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nRightSample[3] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 0] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - - nRightSample[0] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 3] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nRightSample[1] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 2] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nRightSample[2] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 1] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nRightSample[3] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 0] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - } else { - if ((YM2610RouteDirs[BURN_SND_YM2610_AY8910_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 3] * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - nLeftSample[1] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 2] * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - nLeftSample[2] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 1] * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - nLeftSample[3] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 0] * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - } - if ((YM2610RouteDirs[BURN_SND_YM2610_AY8910_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 3] * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - nRightSample[1] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 2] * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - nRightSample[2] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 1] * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - nRightSample[3] += (INT32)(pYM2610Buffer[5][(nFractionalPosition >> 16) - 0] * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - } - - if ((YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 3] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nLeftSample[1] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 2] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nLeftSample[2] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 1] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nLeftSample[3] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 0] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - } - if ((YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 3] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nRightSample[1] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 2] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nRightSample[2] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 1] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nRightSample[3] += (INT32)(pYM2610Buffer[0][(nFractionalPosition >> 16) - 0] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - } - - if ((YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 3] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nLeftSample[1] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 2] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nLeftSample[2] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 1] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nLeftSample[3] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 0] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - } - if ((YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 3] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nRightSample[1] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 2] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nRightSample[2] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 1] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - nRightSample[3] += (INT32)(pYM2610Buffer[1][(nFractionalPosition >> 16) - 0] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - } - } - - nTotalLeftSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nLeftSample[0], nLeftSample[1], nLeftSample[2], nLeftSample[3]); - nTotalRightSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nRightSample[0], nRightSample[1], nRightSample[2], nRightSample[3]); - - nTotalLeftSample = BURN_SND_CLIP(nTotalLeftSample); - nTotalRightSample = BURN_SND_CLIP(nTotalRightSample); - - if (bYM2610AddSignal) { -// pSoundBuf[i + 0] += nTotalLeftSample; -// pSoundBuf[i + 1] += nTotalRightSample; - pSoundBuf[i + 0] = BURN_SND_CLIP(pSoundBuf[i + 0] + nTotalLeftSample); - pSoundBuf[i + 1] = BURN_SND_CLIP(pSoundBuf[i + 1] + nTotalRightSample); - } else { - pSoundBuf[i + 0] = nTotalLeftSample; - pSoundBuf[i + 1] = nTotalRightSample; - } - } - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSamplesNeeded - (nFractionalPosition >> 16); - - for (INT32 i = -4; i < nExtraSamples; i++) { - pYM2610Buffer[0][i] = pYM2610Buffer[0][(nFractionalPosition >> 16) + i]; - pYM2610Buffer[1][i] = pYM2610Buffer[1][(nFractionalPosition >> 16) + i]; - pYM2610Buffer[2][i] = pYM2610Buffer[2][(nFractionalPosition >> 16) + i]; - pYM2610Buffer[3][i] = pYM2610Buffer[3][(nFractionalPosition >> 16) + i]; - pYM2610Buffer[4][i] = pYM2610Buffer[4][(nFractionalPosition >> 16) + i]; - } - - nFractionalPosition &= 0xFFFF; - - nYM2610Position = nExtraSamples; - nAY8910Position = nExtraSamples; - - dTime += 100.0 / nBurnFPS; - } -} - -static void YM2610UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("YM2610UpdateNormal called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - - if (nSegmentEnd < nAY8910Position) { - nSegmentEnd = nAY8910Position; - } - if (nSegmentEnd < nYM2610Position) { - nSegmentEnd = nYM2610Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - - YM2610Render(nSegmentEnd); - AY8910Render(nSegmentEnd); - - pYM2610Buffer[0] = pBuffer + 4 + 0 * 4096; - pYM2610Buffer[1] = pBuffer + 4 + 1 * 4096; - pYM2610Buffer[2] = pBuffer + 4 + 2 * 4096; - pYM2610Buffer[3] = pBuffer + 4 + 3 * 4096; - pYM2610Buffer[4] = pBuffer + 4 + 4 * 4096; - - for (INT32 n = nFractionalPosition; n < nSegmentLength; n++) { - INT32 nAYSample, nLeftSample = 0, nRightSample = 0; - - nAYSample = pYM2610Buffer[2][n]; - nAYSample += pYM2610Buffer[3][n]; - nAYSample += pYM2610Buffer[4][n]; - - if (bYM2610UseSeperateVolumes) { - nLeftSample += (INT32)(nAYSample * YM2610LeftVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - nLeftSample += (INT32)(pYM2610Buffer[0][n] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nLeftSample += (INT32)(pYM2610Buffer[1][n] * YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - - nRightSample += (INT32)(nAYSample * YM2610RightVolumes[BURN_SND_YM2610_AY8910_ROUTE]); - nRightSample += (INT32)(pYM2610Buffer[0][n] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - nRightSample += (INT32)(pYM2610Buffer[1][n] * YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - } else { - if ((YM2610RouteDirs[BURN_SND_YM2610_AY8910_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(nAYSample * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - } - if ((YM2610RouteDirs[BURN_SND_YM2610_AY8910_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(nAYSample * YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE]); - } - - if ((YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2610Buffer[0][n] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - } - if ((YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2610Buffer[0][n] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1]); - } - - if ((YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2610Buffer[1][n] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - } - if ((YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2610Buffer[1][n] * YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2]); - } - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (bYM2610AddSignal) { - //pSoundBuf[(n << 1) + 0] += nLeftSample; - //pSoundBuf[(n << 1) + 1] += nRightSample; - pSoundBuf[(n << 1) + 0] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 0] + nLeftSample); - pSoundBuf[(n << 1) + 1] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 1] + nRightSample); - } else { - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } - } - - nFractionalPosition = nSegmentLength; - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSegmentEnd - nBurnSoundLen; - - for (INT32 i = 0; i < nExtraSamples; i++) { - pYM2610Buffer[0][i] = pYM2610Buffer[0][nBurnSoundLen + i]; - pYM2610Buffer[1][i] = pYM2610Buffer[1][nBurnSoundLen + i]; - pYM2610Buffer[2][i] = pYM2610Buffer[2][nBurnSoundLen + i]; - pYM2610Buffer[3][i] = pYM2610Buffer[3][nBurnSoundLen + i]; - pYM2610Buffer[4][i] = pYM2610Buffer[4][nBurnSoundLen + i]; - } - - nFractionalPosition = 0; - - nYM2610Position = nExtraSamples; - nAY8910Position = nExtraSamples; - - dTime += 100.0 / nBurnFPS; - } -} - -// ---------------------------------------------------------------------------- -// Callbacks for YM2610 core - -void BurnYM2610UpdateRequest() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("YM2610UpdateRequest called without init\n")); -#endif - - YM2610Render(BurnYM2610StreamCallback(nBurnYM2610SoundRate)); -} - -static void BurnAY8910UpdateRequest() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610 BurnAY8910UpdateRequest called without init\n")); -#endif - - AY8910Render(BurnYM2610StreamCallback(nBurnYM2610SoundRate)); -} - -// ---------------------------------------------------------------------------- -// Initialisation, etc. - -void BurnYM2610Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610Reset called without init\n")); -#endif - - BurnTimerReset(); - - YM2610ResetChip(0); -} - -void BurnYM2610Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610Exit called without init\n")); -#endif - - if (!DebugSnd_YM2610Initted) return; - - YM2610Shutdown(); - AY8910Exit(0); - - BurnTimerExit(); - - BurnFree(pBuffer); - BurnFree(pAYBuffer); - - bYM2610AddSignal = 0; - bYM2610UseSeperateVolumes = 0; - - DebugSnd_YM2610Initted = 0; -} - -void BurnYM2610MapADPCMROM(UINT8* YM2610ADPCMAROM, INT32 nYM2610ADPCMASize, UINT8* YM2610ADPCMBROM, INT32 nYM2610ADPCMBSize) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610MapADPCMROM called without init\n")); -#endif - - YM2610SetRom(0, YM2610ADPCMAROM, nYM2610ADPCMASize, YM2610ADPCMBROM, nYM2610ADPCMBSize); -} - -INT32 BurnYM2610Init(INT32 nClockFrequency, UINT8* YM2610ADPCMAROM, INT32* nYM2610ADPCMASize, UINT8* YM2610ADPCMBROM, INT32* nYM2610ADPCMBSize, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal) -{ - DebugSnd_YM2610Initted = 1; - - BurnTimerInit(&YM2610TimerOver, GetTimeCallback); - - if (nBurnSoundRate <= 0) { - BurnYM2610StreamCallback = YM2610StreamCallbackDummy; - - BurnYM2610Update = YM2610UpdateDummy; - - AY8910InitYM(0, nClockFrequency, 11025, NULL, NULL, NULL, NULL, BurnAY8910UpdateRequest); - YM2610Init(1, nClockFrequency, 11025, (void**)(&YM2610ADPCMAROM), nYM2610ADPCMASize, (void**)(&YM2610ADPCMBROM), nYM2610ADPCMBSize, &BurnOPNTimerCallback, IRQCallback); - return 0; - } - - BurnYM2610StreamCallback = StreamCallback; - - if (nFMInterpolation == 3) { - // Set YM2610 core samplerate to match the hardware - nBurnYM2610SoundRate = nClockFrequency / 144; - // Bring YM2610 core samplerate within usable range - while (nBurnYM2610SoundRate > nBurnSoundRate * 3) { - nBurnYM2610SoundRate >>= 1; - } - - BurnYM2610Update = YM2610UpdateResample; - - nSampleSize = (UINT32)nBurnYM2610SoundRate * (1 << 16) / nBurnSoundRate; - } else { - nBurnYM2610SoundRate = nBurnSoundRate; - - BurnYM2610Update = YM2610UpdateNormal; - } - - AY8910InitYM(0, nClockFrequency, nBurnYM2610SoundRate, NULL, NULL, NULL, NULL, BurnAY8910UpdateRequest); - YM2610Init(1, nClockFrequency, nBurnYM2610SoundRate, (void**)(&YM2610ADPCMAROM), nYM2610ADPCMASize, (void**)(&YM2610ADPCMBROM), nYM2610ADPCMBSize, &BurnOPNTimerCallback, IRQCallback); - - pBuffer = (INT16*)BurnMalloc(4096 * 6 * sizeof(INT16)); - memset(pBuffer, 0, 4096 * 6 * sizeof(INT16)); - - pAYBuffer = (INT32*)BurnMalloc(4096 * sizeof(INT32)); - memset(pAYBuffer, 0, 4096 * sizeof(INT32)); - - nYM2610Position = 0; - nAY8910Position = 0; - - nFractionalPosition = 0; - bYM2610AddSignal = bAddSignal; - - // default routes - YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1] = 1.00; - YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2] = 1.00; - YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE] = 1.00; - YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_1] = BURN_SND_ROUTE_LEFT; - YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - YM2610RouteDirs[BURN_SND_YM2610_AY8910_ROUTE] = BURN_SND_ROUTE_BOTH; - - bYM2610UseSeperateVolumes = 0; - YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_1] = 1.00; - YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_2] = 1.00; - YM2610LeftVolumes[BURN_SND_YM2610_AY8910_ROUTE] = 1.00; - YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_1] = 1.00; - YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_2] = 1.00; - YM2610RightVolumes[BURN_SND_YM2610_AY8910_ROUTE] = 1.00; - - return 0; -} - -void BurnYM2610SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 2) bprintf(PRINT_ERROR, _T("BurnYM2610SetRoute called with invalid index %i\n"), nIndex); -#endif - - YM2610Volumes[nIndex] = nVolume; - YM2610RouteDirs[nIndex] = nRouteDir; -} - -void BurnYM2610SetLeftVolume(INT32 nIndex, double nLeftVolume) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610SetLeftVolume called without init\n")); - if (nIndex < 0 || nIndex > 2) bprintf(PRINT_ERROR, _T("BurnYM2610SetLeftVolume called with invalid index %i\n"), nIndex); -#endif - - YM2610LeftVolumes[nIndex] = nLeftVolume; -} - -void BurnYM2610SetRightVolume(INT32 nIndex, double nRightVolume) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610SetRightVolume called without init\n")); - if (nIndex < 0 || nIndex > 2) bprintf(PRINT_ERROR, _T("BurnYM2610SetRightVolume called with invalid index %i\n"), nIndex); -#endif - - YM2610RightVolumes[nIndex] = nRightVolume; -} - -void BurnYM2610Scan(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610Scan called without init\n")); -#endif - - BurnTimerScan(nAction, pnMin); - AY8910Scan(nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nYM2610Position); - SCAN_VAR(nAY8910Position); - } -} diff --git a/jan/src/burn/snd/burn_ym2610.h b/jan/src/burn/snd/burn_ym2610.h deleted file mode 100644 index ef9a30a58..000000000 --- a/jan/src/burn/snd/burn_ym2610.h +++ /dev/null @@ -1,38 +0,0 @@ -// burn_ym2610.h -#include "driver.h" -extern "C" { - #include "ay8910.h" - #include "fm.h" -} -#include "timer.h" - -extern "C" void BurnYM2610UpdateRequest(); - -void BurnYM2610MapADPCMROM(UINT8* YM2610ADPCMAROM, INT32 nYM2610ADPCMASize, UINT8* YM2610ADPCMBROM, INT32 nYM2610ADPCMBSize); -INT32 BurnYM2610Init(INT32 nClockFrequency, UINT8* YM2610ADPCMAROM, INT32* nYM2610ADPCMASize, UINT8* YM2610ADPCMBROM, INT32* nYM2610ADPCMBSize, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal); -void BurnYM2610SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnYM2610SetLeftVolume(INT32 nIndex, double nLeftVolume); -void BurnYM2610SetRightVolume(INT32 nIndex, double nRightVolume); -void BurnYM2610Reset(); -void BurnYM2610Exit(); -extern void (*BurnYM2610Update)(INT16* pSoundBuf, INT32 nSegmentEnd); -void BurnYM2610Scan(INT32 nAction, INT32* pnMin); - -extern INT32 bYM2610UseSeperateVolumes; - -#define BURN_SND_YM2610_YM2610_ROUTE_1 0 -#define BURN_SND_YM2610_YM2610_ROUTE_2 1 -#define BURN_SND_YM2610_AY8910_ROUTE 2 - -#define BurnYM2610SetAllRoutes(v, d) \ - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_1, v, d); \ - BurnYM2610SetRoute(BURN_SND_YM2610_YM2610_ROUTE_2, v, d); \ - BurnYM2610SetRoute(BURN_SND_YM2610_AY8910_ROUTE , v, d); - -#define BurnYM2610Read(a) YM2610Read(0, a) - -#if defined FBA_DEBUG - #define BurnYM2610Write(a, n) if (!DebugSnd_YM2610Initted) bprintf(PRINT_ERROR, _T("BurnYM2610Write called without init\n")); YM2610Write(0, a, n) -#else - #define BurnYM2610Write(a, n) YM2610Write(0, a, n) -#endif diff --git a/jan/src/burn/snd/burn_ym2612.cpp b/jan/src/burn/snd/burn_ym2612.cpp deleted file mode 100644 index f5b734b9f..000000000 --- a/jan/src/burn/snd/burn_ym2612.cpp +++ /dev/null @@ -1,408 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "burn_ym2612.h" - -#define MAX_YM2612 2 - -void (*BurnYM2612Update)(INT16* pSoundBuf, INT32 nSegmentEnd); - -static INT32 (*BurnYM2612StreamCallback)(INT32 nSoundRate); - -static INT32 nBurnYM2612SoundRate; - -static INT16* pBuffer; -static INT16* pYM2612Buffer[2 * MAX_YM2612]; - -static INT32 nYM2612Position; - -static UINT32 nSampleSize; -static INT32 nFractionalPosition; - -static INT32 nNumChips = 0; -static INT32 bYM2612AddSignal; - -static double YM2612Volumes[2 * MAX_YM2612]; -static INT32 YM2612RouteDirs[2 * MAX_YM2612]; - -// ---------------------------------------------------------------------------- -// Dummy functions - -static void YM2612UpdateDummy(INT16*, INT32) -{ - return; -} - -static INT32 YM2612StreamCallbackDummy(INT32) -{ - return 0; -} - -// ---------------------------------------------------------------------------- -// Execute YM2612 for part of a frame - -static void YM2612Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("YM2612Render called without init\n")); -#endif - - if (nYM2612Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nYM2612Position; - - pYM2612Buffer[0] = pBuffer + 0 * 4096 + 4 + nYM2612Position; - pYM2612Buffer[1] = pBuffer + 1 * 4096 + 4 + nYM2612Position; - - YM2612UpdateOne(0, &pYM2612Buffer[0], nSegmentLength); - - if (nNumChips > 1) { - pYM2612Buffer[2] = pBuffer + 2 * 4096 + 4 + nYM2612Position; - pYM2612Buffer[3] = pBuffer + 3 * 4096 + 4 + nYM2612Position; - - YM2612UpdateOne(1, &pYM2612Buffer[2], nSegmentLength); - } - - nYM2612Position += nSegmentLength; -} - -// ---------------------------------------------------------------------------- - -// Update the sound buffer - -#define INTERPOLATE_ADD_SOUND_LEFT(route, buffer) \ - if ((YM2612RouteDirs[route] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { \ - nLeftSample[0] += (INT32)(pYM2612Buffer[buffer][(nFractionalPosition >> 16) - 3] * YM2612Volumes[route]); \ - nLeftSample[1] += (INT32)(pYM2612Buffer[buffer][(nFractionalPosition >> 16) - 2] * YM2612Volumes[route]); \ - nLeftSample[2] += (INT32)(pYM2612Buffer[buffer][(nFractionalPosition >> 16) - 1] * YM2612Volumes[route]); \ - nLeftSample[3] += (INT32)(pYM2612Buffer[buffer][(nFractionalPosition >> 16) - 0] * YM2612Volumes[route]); \ - } - -#define INTERPOLATE_ADD_SOUND_RIGHT(route, buffer) \ - if ((YM2612RouteDirs[route] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { \ - nRightSample[0] += (INT32)(pYM2612Buffer[buffer][(nFractionalPosition >> 16) - 3] * YM2612Volumes[route]); \ - nRightSample[1] += (INT32)(pYM2612Buffer[buffer][(nFractionalPosition >> 16) - 2] * YM2612Volumes[route]); \ - nRightSample[2] += (INT32)(pYM2612Buffer[buffer][(nFractionalPosition >> 16) - 1] * YM2612Volumes[route]); \ - nRightSample[3] += (INT32)(pYM2612Buffer[buffer][(nFractionalPosition >> 16) - 0] * YM2612Volumes[route]); \ - } - -static void YM2612UpdateResample(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("YM2612UpdateResample called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - INT32 nSamplesNeeded = nSegmentEnd * nBurnYM2612SoundRate / nBurnSoundRate + 1; - - if (nSamplesNeeded < nYM2612Position) { - nSamplesNeeded = nYM2612Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - nSegmentLength <<= 1; - - YM2612Render(nSamplesNeeded); - - pYM2612Buffer[0] = pBuffer + 0 * 4096 + 4; - pYM2612Buffer[1] = pBuffer + 1 * 4096 + 4; - if (nNumChips > 1) { - pYM2612Buffer[2] = pBuffer + 2 * 4096 + 4; - pYM2612Buffer[3] = pBuffer + 3 * 4096 + 4; - } - - for (INT32 i = (nFractionalPosition & 0xFFFF0000) >> 15; i < nSegmentLength; i += 2, nFractionalPosition += nSampleSize) { - INT32 nLeftSample[4] = {0, 0, 0, 0}; - INT32 nRightSample[4] = {0, 0, 0, 0}; - INT32 nTotalLeftSample, nTotalRightSample; - - INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2612_YM2612_ROUTE_1, 0) - INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2612_YM2612_ROUTE_1, 0) - INTERPOLATE_ADD_SOUND_LEFT (BURN_SND_YM2612_YM2612_ROUTE_2, 1) - INTERPOLATE_ADD_SOUND_RIGHT (BURN_SND_YM2612_YM2612_ROUTE_2, 1) - - if (nNumChips > 1) { - INTERPOLATE_ADD_SOUND_LEFT (2 + BURN_SND_YM2612_YM2612_ROUTE_1, 2) - INTERPOLATE_ADD_SOUND_RIGHT (2 + BURN_SND_YM2612_YM2612_ROUTE_1, 2) - INTERPOLATE_ADD_SOUND_LEFT (2 + BURN_SND_YM2612_YM2612_ROUTE_2, 3) - INTERPOLATE_ADD_SOUND_RIGHT (2 + BURN_SND_YM2612_YM2612_ROUTE_2, 3) - } - - nTotalLeftSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nLeftSample[0], nLeftSample[1], nLeftSample[2], nLeftSample[3]); - nTotalRightSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nRightSample[0], nRightSample[1], nRightSample[2], nRightSample[3]); - - nTotalLeftSample = BURN_SND_CLIP(nTotalLeftSample); - nTotalRightSample = BURN_SND_CLIP(nTotalRightSample); - - if (bYM2612AddSignal) { - pSoundBuf[i + 0] = BURN_SND_CLIP(pSoundBuf[i + 0] + nTotalLeftSample); - pSoundBuf[i + 1] = BURN_SND_CLIP(pSoundBuf[i + 1] + nTotalRightSample); - } else { - pSoundBuf[i + 0] = nTotalLeftSample; - pSoundBuf[i + 1] = nTotalRightSample; - } - } - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSamplesNeeded - (nFractionalPosition >> 16); - - for (INT32 i = -4; i < nExtraSamples; i++) { - pYM2612Buffer[0][i] = pYM2612Buffer[0][(nFractionalPosition >> 16) + i]; - pYM2612Buffer[1][i] = pYM2612Buffer[1][(nFractionalPosition >> 16) + i]; - if (nNumChips > 1) { - pYM2612Buffer[2][i] = pYM2612Buffer[2][(nFractionalPosition >> 16) + i]; - pYM2612Buffer[3][i] = pYM2612Buffer[3][(nFractionalPosition >> 16) + i]; - } - } - - nFractionalPosition &= 0xFFFF; - - nYM2612Position = nExtraSamples; - - dTime += 100.0 / nBurnFPS; - } -} - -static void YM2612UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("YM2612UpdateNormal called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - INT32 i; - - if (nSegmentEnd < nYM2612Position) { - nSegmentEnd = nYM2612Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - - YM2612Render(nSegmentEnd); - - pYM2612Buffer[0] = pBuffer + 4 + 0 * 4096; - pYM2612Buffer[1] = pBuffer + 4 + 1 * 4096; - if (nNumChips > 1) { - pYM2612Buffer[2] = pBuffer + 4 + 2 * 4096; - pYM2612Buffer[3] = pBuffer + 4 + 3 * 4096; - } - - for (INT32 n = nFractionalPosition; n < nSegmentLength; n++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((YM2612RouteDirs[BURN_SND_YM2612_YM2612_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2612Buffer[0][n] * YM2612Volumes[BURN_SND_YM2612_YM2612_ROUTE_1]); - } - if ((YM2612RouteDirs[BURN_SND_YM2612_YM2612_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2612Buffer[0][n] * YM2612Volumes[BURN_SND_YM2612_YM2612_ROUTE_1]); - } - - if ((YM2612RouteDirs[BURN_SND_YM2612_YM2612_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2612Buffer[1][n] * YM2612Volumes[BURN_SND_YM2612_YM2612_ROUTE_2]); - } - if ((YM2612RouteDirs[BURN_SND_YM2612_YM2612_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2612Buffer[1][n] * YM2612Volumes[BURN_SND_YM2612_YM2612_ROUTE_2]); - } - - if (nNumChips > 1) { - if ((YM2612RouteDirs[2 + BURN_SND_YM2612_YM2612_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2612Buffer[2][n] * YM2612Volumes[2 + BURN_SND_YM2612_YM2612_ROUTE_1]); - } - if ((YM2612RouteDirs[2 + BURN_SND_YM2612_YM2612_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2612Buffer[2][n] * YM2612Volumes[2 + BURN_SND_YM2612_YM2612_ROUTE_1]); - } - - if ((YM2612RouteDirs[2 + BURN_SND_YM2612_YM2612_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM2612Buffer[3][n] * YM2612Volumes[2 + BURN_SND_YM2612_YM2612_ROUTE_2]); - } - if ((YM2612RouteDirs[2 + BURN_SND_YM2612_YM2612_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM2612Buffer[3][n] * YM2612Volumes[2 + BURN_SND_YM2612_YM2612_ROUTE_2]); - } - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (bYM2612AddSignal) { - pSoundBuf[(n << 1) + 0] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 0] + nLeftSample); - pSoundBuf[(n << 1) + 1] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 1] + nRightSample); - } else { - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } - } - - nFractionalPosition = nSegmentLength; - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSegmentEnd - nBurnSoundLen; - - for (i = 0; i < nExtraSamples; i++) { - pYM2612Buffer[0][i] = pYM2612Buffer[0][nBurnSoundLen + i]; - pYM2612Buffer[1][i] = pYM2612Buffer[1][nBurnSoundLen + i]; - if (nNumChips > 1) { - pYM2612Buffer[2][i] = pYM2612Buffer[2][nBurnSoundLen + i]; - pYM2612Buffer[3][i] = pYM2612Buffer[3][nBurnSoundLen + i]; - } - } - - nFractionalPosition = 0; - - nYM2612Position = nExtraSamples; - - dTime += 100.0 / nBurnFPS; - } -} - -// ---------------------------------------------------------------------------- -// Callbacks for YM2612 core - -void BurnYM2612UpdateRequest() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("YM2612UpdateRequest called without init\n")); -#endif - - YM2612Render(BurnYM2612StreamCallback(nBurnYM2612SoundRate)); -} - -// ---------------------------------------------------------------------------- -// Initialisation, etc. - -void BurnYM2612Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("BurnYM2612Reset called without init\n")); -#endif - - BurnTimerReset(); - - for (INT32 i = 0; i < nNumChips; i++) { - YM2612ResetChip(i); - } -} - -void BurnYM2612Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("BurnYM2612Exit called without init\n")); -#endif - - if (!DebugSnd_YM2612Initted) return; - - YM2612Shutdown(); - - BurnTimerExit(); - - BurnFree(pBuffer); - - nNumChips = 0; - bYM2612AddSignal = 0; - - DebugSnd_YM2612Initted = 0; -} - -void BurnStateExit(); - -INT32 BurnYM2612Init(INT32 num, INT32 nClockFrequency, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal) -{ - DebugSnd_YM2612Initted = 1; - - BurnStateExit(); // prevent crash (in fm.c, bottom of YM2612Init()) if the postload function is double-called (e.g.after a reset) Aug 4, 2014 - dink - - if (num > MAX_YM2612) num = MAX_YM2612; - - BurnTimerInit(&YM2612TimerOver, GetTimeCallback); - - if (nBurnSoundRate <= 0) { - BurnYM2612StreamCallback = YM2612StreamCallbackDummy; - - BurnYM2612Update = YM2612UpdateDummy; - - YM2612Init(num, nClockFrequency, 11025, &BurnOPNTimerCallback, IRQCallback); - return 0; - } - - BurnYM2612StreamCallback = StreamCallback; - - if (nFMInterpolation == 3) { - // Set YM2612 core samplerate to match the hardware - nBurnYM2612SoundRate = nClockFrequency / 144; - // Bring YM2612 core samplerate within usable range - while (nBurnYM2612SoundRate > nBurnSoundRate * 3) { - nBurnYM2612SoundRate >>= 1; - } - - BurnYM2612Update = YM2612UpdateResample; - - nSampleSize = (UINT32)nBurnYM2612SoundRate * (1 << 16) / nBurnSoundRate; - } else { - nBurnYM2612SoundRate = nBurnSoundRate; - - BurnYM2612Update = YM2612UpdateNormal; - } - - YM2612Init(num, nClockFrequency, nBurnYM2612SoundRate, &BurnOPNTimerCallback, IRQCallback); - - pBuffer = (INT16*)BurnMalloc(4096 * 2 * num * sizeof(INT16)); - memset(pBuffer, 0, 4096 * 2 * num * sizeof(INT16)); - - nYM2612Position = 0; - nFractionalPosition = 0; - - nNumChips = num; - bYM2612AddSignal = bAddSignal; - - // default routes - YM2612Volumes[BURN_SND_YM2612_YM2612_ROUTE_1] = 1.00; - YM2612Volumes[BURN_SND_YM2612_YM2612_ROUTE_2] = 1.00; - YM2612RouteDirs[BURN_SND_YM2612_YM2612_ROUTE_1] = BURN_SND_ROUTE_LEFT; - YM2612RouteDirs[BURN_SND_YM2612_YM2612_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - - if (nNumChips > 0) { - YM2612Volumes[2 + BURN_SND_YM2612_YM2612_ROUTE_1] = 1.00; - YM2612Volumes[2 + BURN_SND_YM2612_YM2612_ROUTE_2] = 1.00; - YM2612RouteDirs[2 + BURN_SND_YM2612_YM2612_ROUTE_1] = BURN_SND_ROUTE_LEFT; - YM2612RouteDirs[2 + BURN_SND_YM2612_YM2612_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - } - - return 0; -} - -void BurnYM2612SetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("BurnYM2612SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnYM2612SetRoute called with invalid index %i\n"), nIndex); - if (nChip >= nNumChips) bprintf(PRINT_ERROR, _T("BurnYM2612SetRoute called with invalid chip %i\n"), nChip); -#endif - - if (nChip == 0) { - YM2612Volumes[nIndex] = nVolume; - YM2612RouteDirs[nIndex] = nRouteDir; - } - - if (nChip == 1) { - YM2612Volumes[2 + nIndex] = nVolume; - YM2612RouteDirs[2 + nIndex] = nRouteDir; - } -} - -void BurnYM2612Scan(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("BurnYM2612Scan called without init\n")); -#endif - - if (nAction & ACB_DRIVER_DATA) { - BurnTimerScan(nAction, pnMin); - SCAN_VAR(nYM2612Position); - } -} - -#undef MAX_YM2612 diff --git a/jan/src/burn/snd/burn_ym2612.h b/jan/src/burn/snd/burn_ym2612.h deleted file mode 100644 index 6fe750f37..000000000 --- a/jan/src/burn/snd/burn_ym2612.h +++ /dev/null @@ -1,52 +0,0 @@ -// burn_ym2612.h -#include "driver.h" -extern "C" { - #include "fm.h" -} -#include "timer.h" - -extern "C" void BurnYM2612UpdateRequest(); - -INT32 BurnYM2612Init(INT32 num, INT32 nClockFrequency, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal); -void BurnYM2612SetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnYM2612Reset(); -void BurnYM2612Exit(); -extern void (*BurnYM2612Update)(INT16* pSoundBuf, INT32 nSegmentEnd); -void BurnYM2612Scan(INT32 nAction, INT32* pnMin); - -#define BURN_SND_YM2612_YM2612_ROUTE_1 0 -#define BURN_SND_YM2612_YM2612_ROUTE_2 1 - -#define BurnYM2612SetAllRoutes(i, v, d) \ - BurnYM2612SetRoute(i, BURN_SND_YM2612_YM2612_ROUTE_1, v, d); \ - BurnYM2612SetRoute(i, BURN_SND_YM2612_YM2612_ROUTE_2, v, d); - -#define BurnYM2612Read(i, a) YM2612Read(i, a) - -#if defined FBA_DEBUG - #define BurnYM2612Write(i, a, n) if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("BurnYM2612Write called without init\n")); YM2612Write(i, a, n) -#else - #define BurnYM2612Write(i, a, n) YM2612Write(i, a, n) -#endif - -#define BURN_SND_YM3438_YM3438_ROUTE_1 BURN_SND_YM2612_YM2612_ROUTE_1 -#define BURN_SND_YM3438_YM3438_ROUTE_2 BURN_SND_YM2612_YM2612_ROUTE_2 - -#define BurnYM3438SetAllRoutes(i, v, d) \ - BurnYM3438SetRoute(i, BURN_SND_YM3438_YM3438_ROUTE_1, v, d); \ - BurnYM3438SetRoute(i, BURN_SND_YM3438_YM3438_ROUTE_2, v, d); - -#define BurnYM3438Init(i, n, a, b, c, d) BurnYM2612Init(i, n, a, b, c, d) -#define BurnYM3438SetRoute(i, n, v, d) BurnYM2612SetRoute(i, n, v, d) -#define BurnYM3438Reset() BurnYM2612Reset() -#define BurnYM3438Exit() BurnYM2612Exit() -#define BurnYM3438Update(p, i) BurnYM2612Update(p, i) -#define BurnYM3438Scan(n, i) BurnYM2612Scan(n, i) - -#define BurnYM3438Read(i, a) YM2612Read(i, a) - -#if defined FBA_DEBUG - #define BurnYM3438Write(i, a, n) if (!DebugSnd_YM2612Initted) bprintf(PRINT_ERROR, _T("BurnYM3438Write called without init\n")); YM2612Write(i, a, n) -#else - #define BurnYM3438Write(i, a, n) YM2612Write(i, a, n) -#endif diff --git a/jan/src/burn/snd/burn_ym3526.cpp b/jan/src/burn/snd/burn_ym3526.cpp deleted file mode 100644 index 61eb124d1..000000000 --- a/jan/src/burn/snd/burn_ym3526.cpp +++ /dev/null @@ -1,588 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "burn_ym3526.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "hd6309_intf.h" -#include "m6800_intf.h" -#include "m6502_intf.h" - -// Timer Related - -#define MAX_TIMER_VALUE ((1 << 30) - 65536) - -static double dTimeYM3526; // Time elapsed since the emulated machine was started - -static INT32 nTimerCount[2], nTimerStart[2]; - -// Callbacks -static INT32 (*pTimerOverCallback)(INT32, INT32); -static double (*pTimerTimeCallback)(); - -static INT32 nCPUClockspeed = 0; -static INT32 (*pCPUTotalCycles)() = NULL; -static INT32 (*pCPURun)(INT32) = NULL; -static void (*pCPURunEnd)() = NULL; - -// --------------------------------------------------------------------------- -// Running time - -static double BurnTimerTimeCallbackDummy() -{ - return 0.0; -} - -extern "C" double BurnTimerGetTimeYM3526() -{ - return dTimeYM3526 + pTimerTimeCallback(); -} - -// --------------------------------------------------------------------------- -// Update timers - -static INT32 nTicksTotal, nTicksDone, nTicksExtra; - -INT32 BurnTimerUpdateYM3526(INT32 nCycles) -{ - INT32 nIRQStatus = 0; - - nTicksTotal = MAKE_TIMER_TICKS(nCycles, nCPUClockspeed); - - while (nTicksDone < nTicksTotal) { - INT32 nTimer, nCyclesSegment, nTicksSegment; - - // Determine which timer fires first - if (nTimerCount[0] <= nTimerCount[1]) { - nTicksSegment = nTimerCount[0]; - } else { - nTicksSegment = nTimerCount[1]; - } - if (nTicksSegment > nTicksTotal) { - nTicksSegment = nTicksTotal; - } - - nCyclesSegment = MAKE_CPU_CYLES(nTicksSegment + nTicksExtra, nCPUClockspeed); - - pCPURun(nCyclesSegment - pCPUTotalCycles()); - - nTicksDone = MAKE_TIMER_TICKS(pCPUTotalCycles() + 1, nCPUClockspeed) - 1; - - nTimer = 0; - if (nTicksDone >= nTimerCount[0]) { - if (nTimerStart[0] == MAX_TIMER_VALUE) { - nTimerCount[0] = MAX_TIMER_VALUE; - } else { - nTimerCount[0] += nTimerStart[0]; - } - nTimer |= 1; - } - if (nTicksDone >= nTimerCount[1]) { - if (nTimerStart[1] == MAX_TIMER_VALUE) { - nTimerCount[1] = MAX_TIMER_VALUE; - } else { - nTimerCount[1] += nTimerStart[1]; - } - nTimer |= 2; - } - if (nTimer & 1) { - nIRQStatus |= pTimerOverCallback(0, 0); - } - if (nTimer & 2) { - nIRQStatus |= pTimerOverCallback(0, 1); - } - } - - return nIRQStatus; -} - -void BurnTimerEndFrameYM3526(INT32 nCycles) -{ - int nTicks = MAKE_TIMER_TICKS(nCycles, nCPUClockspeed); - - BurnTimerUpdateYM3526(nCycles); - - if (nTimerCount[0] < MAX_TIMER_VALUE) { - nTimerCount[0] -= nTicks; - } - if (nTimerCount[1] < MAX_TIMER_VALUE) { - nTimerCount[1] -= nTicks; - } - - nTicksDone -= nTicks; - if (nTicksDone < 0) { - nTicksDone = 0; - } -} - -void BurnTimerUpdateEndYM3526() -{ - pCPURunEnd(); - - nTicksTotal = 0; -} - -void BurnOPLTimerCallbackYM3526(INT32 c, double period) -{ - pCPURunEnd(); - - if (period == 0.0) { - nTimerCount[c] = MAX_TIMER_VALUE; - return; - } - - nTimerCount[c] = (INT32)(period * (double)TIMER_TICKS_PER_SECOND); - nTimerCount[c] += MAKE_TIMER_TICKS(pCPUTotalCycles(), nCPUClockspeed); -} - -void BurnTimerScanYM3526(INT32 nAction, INT32* pnMin) -{ - if (pnMin && *pnMin < 0x029521) { - *pnMin = 0x029521; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nTimerCount); - SCAN_VAR(nTimerStart); - SCAN_VAR(dTimeYM3526); - - SCAN_VAR(nTicksDone); - } -} - -void BurnTimerExitYM3526() -{ - nCPUClockspeed = 0; - pCPUTotalCycles = NULL; - pCPURun = NULL; - pCPURunEnd = NULL; - - return; -} - -void BurnTimerResetYM3526() -{ - nTimerCount[0] = nTimerCount[1] = MAX_TIMER_VALUE; - nTimerStart[0] = nTimerStart[1] = MAX_TIMER_VALUE; - - dTimeYM3526 = 0.0; - - nTicksDone = 0; -} - -INT32 BurnTimerInitYM3526(INT32 (*pOverCallback)(INT32, INT32), double (*pTimeCallback)()) -{ - BurnTimerExitYM3526(); - - pTimerOverCallback = pOverCallback; - pTimerTimeCallback = pTimeCallback ? pTimeCallback : BurnTimerTimeCallbackDummy; - - BurnTimerResetYM3526(); - - return 0; -} - -INT32 BurnTimerAttachSekYM3526(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = SekTotalCycles; - pCPURun = SekRun; - pCPURunEnd = SekRunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachZetYM3526(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = ZetTotalCycles; - pCPURun = ZetRun; - pCPURunEnd = ZetRunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6809YM3526(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6809TotalCycles; - pCPURun = M6809Run; - pCPURunEnd = M6809RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachHD6309YM3526(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = HD6309TotalCycles; - pCPURun = HD6309Run; - pCPURunEnd = HD6309RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6800YM3526(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = M6800Run; - pCPURunEnd = M6800RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachHD63701YM3526(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = HD63701Run; - pCPURunEnd = HD63701RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6803YM3526(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = M6803Run; - pCPURunEnd = M6803RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6502YM3526(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6502TotalCycles; - pCPURun = M6502Run; - pCPURunEnd = M6502RunEnd; // doesn't do anything... - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -// Sound Related - -void (*BurnYM3526Update)(INT16* pSoundBuf, INT32 nSegmentEnd); - -static INT32 (*BurnYM3526StreamCallback)(INT32 nSoundRate); - -static INT32 nBurnYM3526SoundRate; - -static INT16* pBuffer; -static INT16* pYM3526Buffer; - -static INT32 nYM3526Position; - -static UINT32 nSampleSize; -static INT32 nFractionalPosition; - -static INT32 bYM3526AddSignal; - -static double YM3526Volumes[1]; -static INT32 YM3526RouteDirs[1]; - -// ---------------------------------------------------------------------------- -// Dummy functions - -static void YM3526UpdateDummy(INT16* , INT32) -{ - return; -} - -static INT32 YM3526StreamCallbackDummy(INT32) -{ - return 0; -} - -// ---------------------------------------------------------------------------- -// Execute YM3526 for part of a frame - -static void YM3526Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("YM3526Render called without init\n")); -#endif - - if (nYM3526Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nYM3526Position; - - YM3526UpdateOne(0, pBuffer + 0 * 4096 + 4 + nYM3526Position, nSegmentLength); - - nYM3526Position += nSegmentLength; -} - -// ---------------------------------------------------------------------------- -// Update the sound buffer - -static void YM3526UpdateResample(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("YM3526UpdateResample called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - INT32 nSamplesNeeded = nSegmentEnd * nBurnYM3526SoundRate / nBurnSoundRate + 1; - - if (nSamplesNeeded < nYM3526Position) { - nSamplesNeeded = nYM3526Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - nSegmentLength <<= 1; - - YM3526Render(nSamplesNeeded); - - pYM3526Buffer = pBuffer + 0 * 4096 + 4; - - for (INT32 i = (nFractionalPosition & 0xFFFF0000) >> 15; i < nSegmentLength; i += 2, nFractionalPosition += nSampleSize) { - INT32 nLeftSample[4] = {0, 0, 0, 0}; - INT32 nRightSample[4] = {0, 0, 0, 0}; - INT32 nTotalLeftSample, nTotalRightSample; - - if ((YM3526RouteDirs[BURN_SND_YM3526_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM3526Buffer[(nFractionalPosition >> 16) - 3] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - nLeftSample[1] += (INT32)(pYM3526Buffer[(nFractionalPosition >> 16) - 2] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - nLeftSample[2] += (INT32)(pYM3526Buffer[(nFractionalPosition >> 16) - 1] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - nLeftSample[3] += (INT32)(pYM3526Buffer[(nFractionalPosition >> 16) - 0] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - } - if ((YM3526RouteDirs[BURN_SND_YM3526_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM3526Buffer[(nFractionalPosition >> 16) - 3] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - nRightSample[1] += (INT32)(pYM3526Buffer[(nFractionalPosition >> 16) - 2] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - nRightSample[2] += (INT32)(pYM3526Buffer[(nFractionalPosition >> 16) - 1] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - nRightSample[3] += (INT32)(pYM3526Buffer[(nFractionalPosition >> 16) - 0] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - } - - nTotalLeftSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nLeftSample[0], nLeftSample[1], nLeftSample[2], nLeftSample[3]); - nTotalRightSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nRightSample[0], nRightSample[1], nRightSample[2], nRightSample[3]); - - nTotalLeftSample = BURN_SND_CLIP(nTotalLeftSample); - nTotalRightSample = BURN_SND_CLIP(nTotalRightSample); - - if (bYM3526AddSignal) { - pSoundBuf[i + 0] += nTotalLeftSample; - pSoundBuf[i + 1] += nTotalRightSample; - } else { - pSoundBuf[i + 0] = nTotalLeftSample; - pSoundBuf[i + 1] = nTotalRightSample; - } - } - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSamplesNeeded - (nFractionalPosition >> 16); - - for (INT32 i = -4; i < nExtraSamples; i++) { - pYM3526Buffer[i] = pYM3526Buffer[(nFractionalPosition >> 16) + i]; - } - - nFractionalPosition &= 0xFFFF; - - nYM3526Position = nExtraSamples; - } -} - -static void YM3526UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("YM3526UpdateNormal called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - - if (nSegmentEnd < nYM3526Position) { - nSegmentEnd = nYM3526Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - - YM3526Render(nSegmentEnd); - - pYM3526Buffer = pBuffer + 4 + 0 * 4096; - - for (INT32 n = nFractionalPosition; n < nSegmentLength; n++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((YM3526RouteDirs[BURN_SND_YM3526_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM3526Buffer[n] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - } - if ((YM3526RouteDirs[BURN_SND_YM3526_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM3526Buffer[n] * YM3526Volumes[BURN_SND_YM3526_ROUTE]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (bYM3526AddSignal) { - pSoundBuf[(n << 1) + 0] += nLeftSample; - pSoundBuf[(n << 1) + 1] += nRightSample; - } else { - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } - } - - nFractionalPosition = nSegmentLength; - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSegmentEnd - nBurnSoundLen; - - for (INT32 i = 0; i < nExtraSamples; i++) { - pYM3526Buffer[i] = pYM3526Buffer[nBurnSoundLen + i]; - } - - nFractionalPosition = 0; - - nYM3526Position = nExtraSamples; - - } -} - -// ---------------------------------------------------------------------------- -// Callbacks for YM3526 core - -void BurnYM3526UpdateRequest(int, int) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("BurnYM3526UpdateRequest called without init\n")); -#endif - - YM3526Render(BurnYM3526StreamCallback(nBurnYM3526SoundRate)); -} - -// ---------------------------------------------------------------------------- -// Initialisation, etc. - -void BurnYM3526Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("BurnYM3526Reset called without init\n")); -#endif - - BurnTimerResetYM3526(); - - YM3526ResetChip(0); -} - -void BurnYM3526Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("BurnYM3526Exit called without init\n")); -#endif - - if (!DebugSnd_YM3526Initted) return; - - YM3526Shutdown(); - - BurnTimerExitYM3526(); - - BurnFree(pBuffer); - - bYM3526AddSignal = 0; - - DebugSnd_YM3526Initted = 0; -} - -INT32 BurnYM3526Init(INT32 nClockFrequency, OPL_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), INT32 bAddSignal) -{ - DebugSnd_YM3526Initted = 1; - - BurnTimerInitYM3526(&YM3526TimerOver, NULL); - - if (nBurnSoundRate <= 0) { - BurnYM3526StreamCallback = YM3526StreamCallbackDummy; - - BurnYM3526Update = YM3526UpdateDummy; - - YM3526Init(1, nClockFrequency, 11025); - return 0; - } - - BurnYM3526StreamCallback = StreamCallback; - - if (nFMInterpolation == 3) { - // Set YM3526 core samplerate to match the hardware - nBurnYM3526SoundRate = nClockFrequency / 72; - // Bring YM3526 core samplerate within usable range - while (nBurnYM3526SoundRate > nBurnSoundRate * 3) { - nBurnYM3526SoundRate >>= 1; - } - - BurnYM3526Update = YM3526UpdateResample; - - nSampleSize = (UINT32)nBurnYM3526SoundRate * (1 << 16) / nBurnSoundRate; - nFractionalPosition = 0; - } else { - nBurnYM3526SoundRate = nBurnSoundRate; - - BurnYM3526Update = YM3526UpdateNormal; - } - - YM3526Init(1, nClockFrequency, nBurnYM3526SoundRate); - YM3526SetIRQHandler(0, IRQCallback, 0); - YM3526SetTimerHandler(0, &BurnOPLTimerCallbackYM3526, 0); - YM3526SetUpdateHandler(0, &BurnYM3526UpdateRequest, 0); - - pBuffer = (INT16*)BurnMalloc(4096 * sizeof(INT16)); - memset(pBuffer, 0, 4096 * sizeof(INT16)); - - nYM3526Position = 0; - - nFractionalPosition = 0; - - bYM3526AddSignal = bAddSignal; - - // default routes - YM3526Volumes[BURN_SND_YM3526_ROUTE] = 1.00; - YM3526RouteDirs[BURN_SND_YM3526_ROUTE] = BURN_SND_ROUTE_BOTH; - - return 0; -} - -void BurnYM3526SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("BurnYM3526SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnYM3526SetRoute called with invalid index %i\n"), nIndex); -#endif - - YM3526Volumes[nIndex] = nVolume; - YM3526RouteDirs[nIndex] = nRouteDir; -} - -void BurnYM3526Scan(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("BurnYM3526Scan called without init\n")); -#endif - - BurnTimerScanYM3526(nAction, pnMin); - FMOPLScan(FM_OPL_SAVESTATE_YM3526, 0, nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nYM3526Position); - } -} diff --git a/jan/src/burn/snd/burn_ym3526.h b/jan/src/burn/snd/burn_ym3526.h deleted file mode 100644 index d7df9bd30..000000000 --- a/jan/src/burn/snd/burn_ym3526.h +++ /dev/null @@ -1,35 +0,0 @@ -#include "driver.h" -extern "C" { - #include "fmopl.h" -} -#include "timer.h" - -INT32 BurnTimerUpdateYM3526(INT32 nCycles); -void BurnTimerEndFrameYM3526(INT32 nCycles); -INT32 BurnTimerAttachSekYM3526(INT32 nClockspeed); -INT32 BurnTimerAttachZetYM3526(INT32 nClockspeed); -INT32 BurnTimerAttachM6809YM3526(INT32 nClockspeed); -INT32 BurnTimerAttachHD6309YM3526(INT32 nClockspeed); -INT32 BurnTimerAttachM6800YM3526(INT32 nClockspeed); -INT32 BurnTimerAttachHD63701YM3526(INT32 nClockspeed); -INT32 BurnTimerAttachM6803YM3526(INT32 nClockspeed); -INT32 BurnTimerAttachM6502YM3526(INT32 nClockspeed); - -extern "C" void BurnYM3526UpdateRequest(); - -INT32 BurnYM3526Init(INT32 nClockFrequency, OPL_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), INT32 bAddSignal); -void BurnYM3526SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnYM3526Reset(); -void BurnYM3526Exit(); -extern void (*BurnYM3526Update)(INT16* pSoundBuf, INT32 nSegmentEnd); -void BurnYM3526Scan(INT32 nAction, INT32* pnMin); - -#define BURN_SND_YM3526_ROUTE 0 - -#define BurnYM3526Read(a) YM3526Read(0, a) - -#if defined FBA_DEBUG - #define BurnYM3526Write(a, n) if (!DebugSnd_YM3526Initted) bprintf(PRINT_ERROR, _T("BurnYM3526Write called without init\n")); YM3526Write(0, a, n) -#else - #define BurnYM3526Write(a, n) YM3526Write(0, a, n) -#endif diff --git a/jan/src/burn/snd/burn_ym3812.cpp b/jan/src/burn/snd/burn_ym3812.cpp deleted file mode 100644 index b00a8450a..000000000 --- a/jan/src/burn/snd/burn_ym3812.cpp +++ /dev/null @@ -1,661 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "burn_ym3812.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "hd6309_intf.h" -#include "m6800_intf.h" -#include "m6502_intf.h" -#include "h6280_intf.h" - -#define MAX_YM3812 2 - -// Timer Related - -#define MAX_TIMER_VALUE ((1 << 30) - 65536) - -static double dTimeYM3812; // Time elapsed since the emulated machine was started - -static INT32 nTimerCount[2], nTimerStart[2]; - -// Callbacks -static INT32 (*pTimerOverCallback)(INT32, INT32); -static double (*pTimerTimeCallback)(); - -static INT32 nCPUClockspeed = 0; -static INT32 (*pCPUTotalCycles)() = NULL; -static INT32 (*pCPURun)(INT32) = NULL; -static void (*pCPURunEnd)() = NULL; - -// --------------------------------------------------------------------------- -// Running time - -static double BurnTimerTimeCallbackDummy() -{ - return 0.0; -} - -extern "C" double BurnTimerGetTimeYM3812() -{ - return dTimeYM3812 + pTimerTimeCallback(); -} - -// --------------------------------------------------------------------------- -// Update timers - -static INT32 nTicksTotal, nTicksDone, nTicksExtra; - -INT32 BurnTimerUpdateYM3812(INT32 nCycles) -{ - INT32 nIRQStatus = 0; - - nTicksTotal = MAKE_TIMER_TICKS(nCycles, nCPUClockspeed); - - while (nTicksDone < nTicksTotal) { - INT32 nTimer, nCyclesSegment, nTicksSegment; - - // Determine which timer fires first - if (nTimerCount[0] <= nTimerCount[1]) { - nTicksSegment = nTimerCount[0]; - } else { - nTicksSegment = nTimerCount[1]; - } - if (nTicksSegment > nTicksTotal) { - nTicksSegment = nTicksTotal; - } - - nCyclesSegment = MAKE_CPU_CYLES(nTicksSegment + nTicksExtra, nCPUClockspeed); - - pCPURun(nCyclesSegment - pCPUTotalCycles()); - - nTicksDone = MAKE_TIMER_TICKS(pCPUTotalCycles() + 1, nCPUClockspeed) - 1; - - nTimer = 0; - if (nTicksDone >= nTimerCount[0]) { - if (nTimerStart[0] == MAX_TIMER_VALUE) { - nTimerCount[0] = MAX_TIMER_VALUE; - } else { - nTimerCount[0] += nTimerStart[0]; - } - nTimer |= 1; - } - if (nTicksDone >= nTimerCount[1]) { - if (nTimerStart[1] == MAX_TIMER_VALUE) { - nTimerCount[1] = MAX_TIMER_VALUE; - } else { - nTimerCount[1] += nTimerStart[1]; - } - nTimer |= 2; - } - if (nTimer & 1) { - nIRQStatus |= pTimerOverCallback(0, 0); - } - if (nTimer & 2) { - nIRQStatus |= pTimerOverCallback(0, 1); - } - } - - return nIRQStatus; -} - -void BurnTimerEndFrameYM3812(INT32 nCycles) -{ - INT32 nTicks = MAKE_TIMER_TICKS(nCycles, nCPUClockspeed); - - BurnTimerUpdateYM3812(nCycles); - - if (nTimerCount[0] < MAX_TIMER_VALUE) { - nTimerCount[0] -= nTicks; - } - if (nTimerCount[1] < MAX_TIMER_VALUE) { - nTimerCount[1] -= nTicks; - } - - nTicksDone -= nTicks; - if (nTicksDone < 0) { - nTicksDone = 0; - } -} - -void BurnTimerUpdateEndYM3812() -{ - pCPURunEnd(); - - nTicksTotal = 0; -} - -void BurnOPLTimerCallbackYM3812(INT32 c, double period) -{ - pCPURunEnd(); - - if (period == 0.0) { - nTimerCount[c] = MAX_TIMER_VALUE; - return; - } - - nTimerCount[c] = (INT32)(period * (double)TIMER_TICKS_PER_SECOND); - nTimerCount[c] += MAKE_TIMER_TICKS(pCPUTotalCycles(), nCPUClockspeed); -} - -void BurnTimerScanYM3812(INT32 nAction, INT32* pnMin) -{ - if (pnMin && *pnMin < 0x029521) { - *pnMin = 0x029521; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nTimerCount); - SCAN_VAR(nTimerStart); - SCAN_VAR(dTimeYM3812); - - SCAN_VAR(nTicksDone); - } -} - -void BurnTimerExitYM3812() -{ - nCPUClockspeed = 0; - pCPUTotalCycles = NULL; - pCPURun = NULL; - pCPURunEnd = NULL; - - return; -} - -void BurnTimerResetYM3812() -{ - nTimerCount[0] = nTimerCount[1] = MAX_TIMER_VALUE; - nTimerStart[0] = nTimerStart[1] = MAX_TIMER_VALUE; - - dTimeYM3812 = 0.0; - - nTicksDone = 0; -} - -INT32 BurnTimerInitYM3812(INT32 (*pOverCallback)(INT32, INT32), double (*pTimeCallback)()) -{ - BurnTimerExitYM3812(); - - pTimerOverCallback = pOverCallback; - pTimerTimeCallback = pTimeCallback ? pTimeCallback : BurnTimerTimeCallbackDummy; - - BurnTimerResetYM3812(); - - return 0; -} - -INT32 BurnTimerAttachSekYM3812(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = SekTotalCycles; - pCPURun = SekRun; - pCPURunEnd = SekRunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachZetYM3812(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = ZetTotalCycles; - pCPURun = ZetRun; - pCPURunEnd = ZetRunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6809YM3812(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6809TotalCycles; - pCPURun = M6809Run; - pCPURunEnd = M6809RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachHD6309YM3812(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = HD6309TotalCycles; - pCPURun = HD6309Run; - pCPURunEnd = HD6309RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6800YM3812(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = M6800Run; - pCPURunEnd = M6800RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachHD63701YM3812(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = HD63701Run; - pCPURunEnd = HD63701RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6803YM3812(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = M6803Run; - pCPURunEnd = M6803RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachM6502YM3812(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6502TotalCycles; - pCPURun = M6502Run; - pCPURunEnd = M6502RunEnd; // doesn't do anything... - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -INT32 BurnTimerAttachH6280YM3812(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = h6280TotalCycles; - pCPURun = h6280Run; - pCPURunEnd = h6280RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - - return 0; -} - -// Sound Related - -void (*BurnYM3812Update)(INT16* pSoundBuf, INT32 nSegmentEnd); - -static INT32 (*BurnYM3812StreamCallback)(INT32 nSoundRate); - -static INT32 nBurnYM3812SoundRate; - -static INT16* pBuffer; -static INT16* pYM3812Buffer[2 * MAX_YM3812]; - -static INT32 nYM3812Position; - -static UINT32 nSampleSize; -static INT32 nFractionalPosition; - -static INT32 nNumChips = 0; -static INT32 bYM3812AddSignal; - -static double YM3812Volumes[1 * MAX_YM3812]; -static INT32 YM3812RouteDirs[1 * MAX_YM3812]; - -// ---------------------------------------------------------------------------- -// Dummy functions - -static void YM3812UpdateDummy(INT16* , INT32) -{ - return; -} - -static INT32 YM3812StreamCallbackDummy(INT32) -{ - return 0; -} - -// ---------------------------------------------------------------------------- -// Execute YM3812 for part of a frame - -static void YM3812Render(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("YM3812Render called without init\n")); -#endif - - if (nYM3812Position >= nSegmentLength) { - return; - } - - nSegmentLength -= nYM3812Position; - - YM3812UpdateOne(0, pBuffer + 0 * 4096 + 4 + nYM3812Position, nSegmentLength); - - if (nNumChips > 1) { - YM3812UpdateOne(1, pBuffer + 1 * 4096 + 4 + nYM3812Position, nSegmentLength); - } - - nYM3812Position += nSegmentLength; -} - -// ---------------------------------------------------------------------------- -// Update the sound buffer - -static void YM3812UpdateResample(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("YM3812UpdateResample called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - INT32 nSamplesNeeded = nSegmentEnd * nBurnYM3812SoundRate / nBurnSoundRate + 1; - - if (nSamplesNeeded < nYM3812Position) { - nSamplesNeeded = nYM3812Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - nSegmentLength <<= 1; - - YM3812Render(nSamplesNeeded); - - pYM3812Buffer[0] = pBuffer + 0 * 4096 + 4; - if (nNumChips > 1) { - pYM3812Buffer[1] = pBuffer + 1 * 4096 + 4; - } - - for (INT32 i = (nFractionalPosition & 0xFFFF0000) >> 15; i < nSegmentLength; i += 2, nFractionalPosition += nSampleSize) { - INT32 nLeftSample[4] = {0, 0, 0, 0}; - INT32 nRightSample[4] = {0, 0, 0, 0}; - INT32 nTotalLeftSample, nTotalRightSample; - - if ((YM3812RouteDirs[0 + BURN_SND_YM3812_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM3812Buffer[0][(nFractionalPosition >> 16) - 3] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - nLeftSample[1] += (INT32)(pYM3812Buffer[0][(nFractionalPosition >> 16) - 2] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - nLeftSample[2] += (INT32)(pYM3812Buffer[0][(nFractionalPosition >> 16) - 1] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - nLeftSample[3] += (INT32)(pYM3812Buffer[0][(nFractionalPosition >> 16) - 0] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - } - if ((YM3812RouteDirs[0 + BURN_SND_YM3812_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM3812Buffer[0][(nFractionalPosition >> 16) - 3] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - nRightSample[1] += (INT32)(pYM3812Buffer[0][(nFractionalPosition >> 16) - 2] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - nRightSample[2] += (INT32)(pYM3812Buffer[0][(nFractionalPosition >> 16) - 1] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - nRightSample[3] += (INT32)(pYM3812Buffer[0][(nFractionalPosition >> 16) - 0] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - } - - if (nNumChips > 1) { - if ((YM3812RouteDirs[1 + BURN_SND_YM3812_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample[0] += (INT32)(pYM3812Buffer[1][(nFractionalPosition >> 16) - 3] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - nLeftSample[1] += (INT32)(pYM3812Buffer[1][(nFractionalPosition >> 16) - 2] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - nLeftSample[2] += (INT32)(pYM3812Buffer[1][(nFractionalPosition >> 16) - 1] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - nLeftSample[3] += (INT32)(pYM3812Buffer[1][(nFractionalPosition >> 16) - 0] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - } - if ((YM3812RouteDirs[1 + BURN_SND_YM3812_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample[0] += (INT32)(pYM3812Buffer[1][(nFractionalPosition >> 16) - 3] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - nRightSample[1] += (INT32)(pYM3812Buffer[1][(nFractionalPosition >> 16) - 2] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - nRightSample[2] += (INT32)(pYM3812Buffer[1][(nFractionalPosition >> 16) - 1] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - nRightSample[3] += (INT32)(pYM3812Buffer[1][(nFractionalPosition >> 16) - 0] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - } - } - - nTotalLeftSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nLeftSample[0], nLeftSample[1], nLeftSample[2], nLeftSample[3]); - nTotalRightSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0fff, nRightSample[0], nRightSample[1], nRightSample[2], nRightSample[3]); - - nTotalLeftSample = BURN_SND_CLIP(nTotalLeftSample); - nTotalRightSample = BURN_SND_CLIP(nTotalRightSample); - - if (bYM3812AddSignal) { - pSoundBuf[i + 0] = BURN_SND_CLIP(pSoundBuf[i + 0] + nTotalLeftSample); - pSoundBuf[i + 1] = BURN_SND_CLIP(pSoundBuf[i + 1] + nTotalRightSample); - } else { - pSoundBuf[i + 0] = nTotalLeftSample; - pSoundBuf[i + 1] = nTotalRightSample; - } - } - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSamplesNeeded - (nFractionalPosition >> 16); - - for (INT32 i = -4; i < nExtraSamples; i++) { - pYM3812Buffer[0][i] = pYM3812Buffer[0][(nFractionalPosition >> 16) + i]; - if (nNumChips > 1) { - pYM3812Buffer[1][i] = pYM3812Buffer[1][(nFractionalPosition >> 16) + i]; - } - } - - nFractionalPosition &= 0xFFFF; - - nYM3812Position = nExtraSamples; - } -} - -static void YM3812UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("YM3812UpdateNormal called without init\n")); -#endif - - INT32 nSegmentLength = nSegmentEnd; - - if (nSegmentEnd < nYM3812Position) { - nSegmentEnd = nYM3812Position; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - - YM3812Render(nSegmentEnd); - - pYM3812Buffer[0] = pBuffer + 4 + 0 * 4096; - pYM3812Buffer[1] = pBuffer + 4 + 1 * 4096; - - for (INT32 n = nFractionalPosition; n < nSegmentLength; n++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((YM3812RouteDirs[0 + BURN_SND_YM3812_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM3812Buffer[0][n] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - } - if ((YM3812RouteDirs[0 + BURN_SND_YM3812_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM3812Buffer[0][n] * YM3812Volumes[0 + BURN_SND_YM3812_ROUTE]); - } - - if (nNumChips > 1) { - if ((YM3812RouteDirs[1 + BURN_SND_YM3812_ROUTE] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYM3812Buffer[1][n] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - } - if ((YM3812RouteDirs[1 + BURN_SND_YM3812_ROUTE] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYM3812Buffer[1][n] * YM3812Volumes[1 + BURN_SND_YM3812_ROUTE]); - } - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (bYM3812AddSignal) { - pSoundBuf[(n << 1) + 0] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 0] + nLeftSample); - pSoundBuf[(n << 1) + 1] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 1] + nRightSample); - } else { - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } - } - - nFractionalPosition = nSegmentLength; - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSegmentEnd - nBurnSoundLen; - - for (INT32 i = 0; i < nExtraSamples; i++) { - pYM3812Buffer[0][i] = pYM3812Buffer[0][nBurnSoundLen + i]; - if (nNumChips > 1) { - pYM3812Buffer[1][i] = pYM3812Buffer[1][nBurnSoundLen + i]; - } - } - - nFractionalPosition = 0; - - nYM3812Position = nExtraSamples; - - } -} - -// ---------------------------------------------------------------------------- -// Callbacks for YM3812 core - -void BurnYM3812UpdateRequest(INT32, INT32) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("BurnYM3812UpdateRequest called without init\n")); -#endif - - YM3812Render(BurnYM3812StreamCallback(nBurnYM3812SoundRate)); -} - -// ---------------------------------------------------------------------------- -// Initialisation, etc. - -void BurnYM3812Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("BurnYM3812Reset called without init\n")); -#endif - - BurnTimerResetYM3812(); - - for (INT32 i = 0; i < nNumChips; i++) { - YM3812ResetChip(i); - } -} - -void BurnYM3812Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("BurnYM3812Exit called without init\n")); -#endif - - if (!DebugSnd_YM3812Initted) return; - - YM3812Shutdown(); - - BurnTimerExitYM3812(); - - BurnFree(pBuffer); - - nNumChips = 0; - bYM3812AddSignal = 0; - - DebugSnd_YM3812Initted = 0; -} - -INT32 BurnYM3812Init(INT32 num, INT32 nClockFrequency, OPL_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), INT32 bAddSignal) -{ - DebugSnd_YM3812Initted = 1; - - if (num > MAX_YM3812) num = MAX_YM3812; - - BurnTimerInitYM3812(&YM3812TimerOver, NULL); - - if (nBurnSoundRate <= 0) { - BurnYM3812StreamCallback = YM3812StreamCallbackDummy; - - BurnYM3812Update = YM3812UpdateDummy; - - YM3812Init(num, nClockFrequency, 11025); - return 0; - } - - BurnYM3812StreamCallback = StreamCallback; - - if (nFMInterpolation == 3) { - // Set YM3812 core samplerate to match the hardware - nBurnYM3812SoundRate = nClockFrequency / 72; - // Bring YM3812 core samplerate within usable range - while (nBurnYM3812SoundRate > nBurnSoundRate * 3) { - nBurnYM3812SoundRate >>= 1; - } - - BurnYM3812Update = YM3812UpdateResample; - - nSampleSize = (UINT32)nBurnYM3812SoundRate * (1 << 16) / nBurnSoundRate; - nFractionalPosition = 0; - } else { - nBurnYM3812SoundRate = nBurnSoundRate; - - BurnYM3812Update = YM3812UpdateNormal; - } - - YM3812Init(num, nClockFrequency, nBurnYM3812SoundRate); - YM3812SetIRQHandler(0, IRQCallback, 0); - YM3812SetTimerHandler(0, &BurnOPLTimerCallbackYM3812, 0); - YM3812SetUpdateHandler(0, &BurnYM3812UpdateRequest, 0); - - pBuffer = (INT16*)BurnMalloc(4096 * num * sizeof(INT16)); - memset(pBuffer, 0, 4096 * num * sizeof(INT16)); - - nYM3812Position = 0; - - nFractionalPosition = 0; - - nNumChips = num; - bYM3812AddSignal = bAddSignal; - - // default routes - YM3812Volumes[BURN_SND_YM3812_ROUTE] = 1.00; - YM3812RouteDirs[BURN_SND_YM3812_ROUTE] = BURN_SND_ROUTE_BOTH; - - if (nNumChips > 0) { - YM3812Volumes[1 + BURN_SND_YM3812_ROUTE] = 1.00; - YM3812RouteDirs[1 + BURN_SND_YM3812_ROUTE] = BURN_SND_ROUTE_BOTH; - } - - return 0; -} - -void BurnYM3812SetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("BurnYM3812SetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnYM3812SetRoute called with invalid index %i\n"), nIndex); - if (nChip >= nNumChips) bprintf(PRINT_ERROR, _T("BurnYM3812SetRoute called with invalid chip %i\n"), nChip); -#endif - - if (nChip == 0) { - YM3812Volumes[nIndex] = nVolume; - YM3812RouteDirs[nIndex] = nRouteDir; - } - - if (nChip == 1) { - YM3812Volumes[1 + nIndex] = nVolume; - YM3812RouteDirs[1 + nIndex] = nRouteDir; - } -} - -void BurnYM3812Scan(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("BurnYM3812Scan called without init\n")); -#endif - - BurnTimerScanYM3812(nAction, pnMin); - FMOPLScan(FM_OPL_SAVESTATE_YM3812, 0, nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nYM3812Position); - } -} diff --git a/jan/src/burn/snd/burn_ym3812.h b/jan/src/burn/snd/burn_ym3812.h deleted file mode 100644 index a9e59a78e..000000000 --- a/jan/src/burn/snd/burn_ym3812.h +++ /dev/null @@ -1,37 +0,0 @@ -#include "driver.h" -extern "C" { - #include "fmopl.h" -} -#include "timer.h" - -INT32 BurnTimerUpdateYM3812(INT32 nCycles); -void BurnTimerEndFrameYM3812(INT32 nCycles); -void BurnTimerUpdateEndYM3812(); -INT32 BurnTimerAttachSekYM3812(INT32 nClockspeed); -INT32 BurnTimerAttachZetYM3812(INT32 nClockspeed); -INT32 BurnTimerAttachM6809YM3812(INT32 nClockspeed); -INT32 BurnTimerAttachHD6309YM3812(INT32 nClockspeed); -INT32 BurnTimerAttachM6800YM3812(INT32 nClockspeed); -INT32 BurnTimerAttachHD63701YM3812(INT32 nClockspeed); -INT32 BurnTimerAttachM6803YM3812(INT32 nClockspeed); -INT32 BurnTimerAttachM6502YM3812(INT32 nClockspeed); -INT32 BurnTimerAttachH6280YM3812(INT32 nClockspeed); - -extern "C" void BurnYM3812UpdateRequest(); - -INT32 BurnYM3812Init(INT32 num, INT32 nClockFrequency, OPL_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), INT32 bAddSignal); -void BurnYM3812SetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnYM3812Reset(); -void BurnYM3812Exit(); -extern void (*BurnYM3812Update)(INT16* pSoundBuf, INT32 nSegmentEnd); -void BurnYM3812Scan(INT32 nAction, INT32* pnMin); - -#define BURN_SND_YM3812_ROUTE 0 - -#define BurnYM3812Read(i, a) YM3812Read(i, a) - -#if defined FBA_DEBUG - #define BurnYM3812Write(i, a, n) if (!DebugSnd_YM3812Initted) bprintf(PRINT_ERROR, _T("BurnYM3812Write called without init\n")); YM3812Write(i, a, n) -#else - #define BurnYM3812Write(i, a, n) YM3812Write(i, a, n) -#endif diff --git a/jan/src/burn/snd/burn_ymf278b.cpp b/jan/src/burn/snd/burn_ymf278b.cpp deleted file mode 100644 index 4a631fc56..000000000 --- a/jan/src/burn/snd/burn_ymf278b.cpp +++ /dev/null @@ -1,264 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "burn_ymf278b.h" - -static INT32 (*BurnYMF278BStreamCallback)(INT32 nSoundRate); - -static INT16* pBuffer; -static INT16* pYMF278BBuffer[2]; - -static INT32 nYMF278BPosition; -static INT32 nFractionalPosition; - -static double YMF278BVolumes[2]; -static INT32 YMF278BRouteDirs[2]; - -// ---------------------------------------------------------------------------- -// Dummy functions - -static INT32 YMF278BStreamCallbackDummy(INT32 /* nSoundRate */) -{ - return 0; -} - - -// ---------------------------------------------------------------------------- -// Execute YMF278B for part of a frame - -static void YMF278BRender(INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("YMF278BRender called without init\n")); -#endif - - if (nYMF278BPosition >= nSegmentLength) { - return; - } - -// bprintf(PRINT_NORMAL, _T(" YMF278B render %6i -> %6i\n"), nYMF278BPosition, nSegmentLength); - - nSegmentLength -= nYMF278BPosition; - - pYMF278BBuffer[0] = pBuffer + 0 * 4096 + 4 + nYMF278BPosition; - pYMF278BBuffer[1] = pBuffer + 1 * 4096 + 4 + nYMF278BPosition; - - ymf278b_pcm_update(0, pYMF278BBuffer, nSegmentLength); - - nYMF278BPosition += nSegmentLength; -} - -// ---------------------------------------------------------------------------- -// Update the sound buffer - -void BurnYMF278BUpdate(INT32 nSegmentEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("BurnYMF278BUpdate called without init\n")); -#endif - - INT16* pSoundBuf = pBurnSoundOut; - INT32 nSegmentLength = nSegmentEnd; - -// bprintf(PRINT_NORMAL, _T(" YMF278B render %6i -> %6i\n"), nYMF278BPosition, nSegmentEnd); - - if (nBurnSoundRate == 0) { - return; - } - - if (nSegmentEnd < nYMF278BPosition) { - nSegmentEnd = nYMF278BPosition; - } - - if (nSegmentLength > nBurnSoundLen) { - nSegmentLength = nBurnSoundLen; - } - - YMF278BRender(nSegmentEnd); - - pYMF278BBuffer[0] = pBuffer + 0 * 4096 + 4; - pYMF278BBuffer[1] = pBuffer + 1 * 4096 + 4; - - for (INT32 n = nFractionalPosition; n < nSegmentLength; n++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((YMF278BRouteDirs[BURN_SND_YMF278B_YMF278B_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYMF278BBuffer[0][n] * YMF278BVolumes[BURN_SND_YMF278B_YMF278B_ROUTE_1]); - } - if ((YMF278BRouteDirs[BURN_SND_YMF278B_YMF278B_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYMF278BBuffer[0][n] * YMF278BVolumes[BURN_SND_YMF278B_YMF278B_ROUTE_1]); - } - - if ((YMF278BRouteDirs[BURN_SND_YMF278B_YMF278B_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(pYMF278BBuffer[1][n] * YMF278BVolumes[BURN_SND_YMF278B_YMF278B_ROUTE_2]); - } - if ((YMF278BRouteDirs[BURN_SND_YMF278B_YMF278B_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(pYMF278BBuffer[1][n] * YMF278BVolumes[BURN_SND_YMF278B_YMF278B_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[(n << 1) + 0] = nLeftSample; - pSoundBuf[(n << 1) + 1] = nRightSample; - } - - nFractionalPosition = nSegmentLength; - - if (nSegmentEnd >= nBurnSoundLen) { - INT32 nExtraSamples = nSegmentEnd - nBurnSoundLen; - - for (INT32 i = 0; i < nExtraSamples; i++) { - pYMF278BBuffer[0][i] = pYMF278BBuffer[0][nBurnSoundLen + i]; - pYMF278BBuffer[1][i] = pYMF278BBuffer[1][nBurnSoundLen + i]; - } - - nFractionalPosition = 0; - - nYMF278BPosition = nExtraSamples; - - } -} - -// ---------------------------------------------------------------------------- - -void BurnYMF278BSelectRegister(INT32 nRegister, UINT8 nValue) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("BurnYMF278BSelectRegister called without init\n")); -#endif - - switch (nRegister) { - case 0: -// bprintf(PRINT_NORMAL, _T(" YMF278B register A -> %i\n"), nValue); - YMF278B_control_port_0_A_w(nValue); - break; - case 1: - YMF278B_control_port_0_B_w(nValue); - break; - case 2: -// bprintf(PRINT_NORMAL, _T(" YMF278B register C -> %i\n"), nValue); - YMF278B_control_port_0_C_w(nValue); - break; - } -} -void BurnYMF278BWriteRegister(INT32 nRegister, UINT8 nValue) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("BurnYMF278BWriteRegister called without init\n")); -#endif - - switch (nRegister) { - case 0: - BurnYMF278BUpdate(BurnYMF278BStreamCallback(nBurnSoundRate)); - YMF278B_data_port_0_A_w(nValue); - break; - case 1: - YMF278B_data_port_0_B_w(nValue); - break; - case 2: - BurnYMF278BUpdate(BurnYMF278BStreamCallback(nBurnSoundRate)); - YMF278B_data_port_0_C_w(nValue); - break; - } -} - -UINT8 BurnYMF278BReadStatus() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("BurnYMF278BReadStatus called without init\n")); -#endif - - BurnYMF278BUpdate(BurnYMF278BStreamCallback(nBurnSoundRate)); - return YMF278B_status_port_0_r(); -} - -UINT8 BurnYMF278BReadData() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("BurnYMF278BReadData called without init\n")); -#endif - - return YMF278B_data_port_0_r(); -} - -// ---------------------------------------------------------------------------- - -void BurnYMF278BReset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("BurnYMF278BReset called without init\n")); -#endif - - BurnTimerReset(); - ymf278b_reset(); -} - -void BurnYMF278BExit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("BurnYMF278BExit called without init\n")); -#endif - - if (!DebugSnd_YMF278BInitted) return; - - YMF278B_sh_stop(); - - BurnTimerExit(); - - BurnFree(pBuffer); - - DebugSnd_YMF278BInitted = 0; -} - -INT32 BurnYMF278BInit(INT32 nClockFrequency, UINT8* YMF278BROM, INT32 YMF278BROMSize, void (*IRQCallback)(INT32, INT32), INT32 (*StreamCallback)(INT32)) -{ - DebugSnd_YMF278BInitted = 1; - - BurnYMF278BStreamCallback = YMF278BStreamCallbackDummy; - if (StreamCallback) { - BurnYMF278BStreamCallback = StreamCallback; - } - - if (!nClockFrequency) { - nClockFrequency = YMF278B_STD_CLOCK; - } - - ymf278b_start(0, YMF278BROM, YMF278BROMSize, IRQCallback, BurnYMFTimerCallback, nClockFrequency, nBurnSoundRate); - BurnTimerInit(ymf278b_timer_over, NULL); - - pBuffer = (INT16*)BurnMalloc(4096 * 2 * sizeof(INT16)); - memset(pBuffer, 0, 4096 * 2 * sizeof(INT16)); - - nYMF278BPosition = 0; - - nFractionalPosition = 0; - - // default routes - YMF278BVolumes[BURN_SND_YMF278B_YMF278B_ROUTE_1] = 1.00; - YMF278BVolumes[BURN_SND_YMF278B_YMF278B_ROUTE_2] = 1.00; - YMF278BRouteDirs[BURN_SND_YMF278B_YMF278B_ROUTE_1] = BURN_SND_ROUTE_LEFT; - YMF278BRouteDirs[BURN_SND_YMF278B_YMF278B_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - - return 0; -} - -void BurnYMF278BSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("BurnYMF278BSetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnYMF278BSetRoute called with invalid index %i\n"), nIndex); -#endif - - YMF278BVolumes[nIndex] = nVolume; - YMF278BRouteDirs[nIndex] = nRouteDir; -} - -void BurnYMF278BScan(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMF278BInitted) bprintf(PRINT_ERROR, _T("BurnYMF278BScan called without init\n")); -#endif - - BurnTimerScan(nAction, pnMin); - ymf278b_scan(nAction, pnMin); -} diff --git a/jan/src/burn/snd/burn_ymf278b.h b/jan/src/burn/snd/burn_ymf278b.h deleted file mode 100644 index 9a629fdd5..000000000 --- a/jan/src/burn/snd/burn_ymf278b.h +++ /dev/null @@ -1,25 +0,0 @@ -#include "driver.h" -extern "C" { - #include "ymf278b.h" -} - -#include "timer.h" - -void BurnYMF278BSelectRegister(INT32 nRegister, UINT8 nValue); -void BurnYMF278BWriteRegister(INT32 nRegister, UINT8 nValue); -UINT8 BurnYMF278BReadStatus(); -UINT8 BurnYMF278BReadData(); - -INT32 BurnYMF278BInit(INT32 nClockFrequency, UINT8* YMF278BROM, INT32 YMF278BROMSize, void (*IRQCallback)(INT32, INT32), INT32 (*StreamCallback)(INT32)); -void BurnYMF278BSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnYMF278BReset(); -void BurnYMF278BExit(); -void BurnYMF278BUpdate(INT32 nSegmentEnd); -void BurnYMF278BScan(INT32 nAction, INT32* pnMin); - -#define BURN_SND_YMF278B_YMF278B_ROUTE_1 0 -#define BURN_SND_YMF278B_YMF278B_ROUTE_2 1 - -#define BurnYMF278BSetAllRoutes(v, d) \ - BurnYMF278BSetRoute(BURN_SND_YMF278B_YMF278B_ROUTE_1, v, d); \ - BurnYMF278BSetRoute(BURN_SND_YMF278B_YMF278B_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/c140.cpp b/jan/src/burn/snd/c140.cpp deleted file mode 100644 index f58dc2bc8..000000000 --- a/jan/src/burn/snd/c140.cpp +++ /dev/null @@ -1,479 +0,0 @@ -/* -C140.c - -Simulator based on AMUSE sources. -The C140 sound chip is used by Namco System 2 and System 21 -The 219 ASIC (which incorporates a modified C140) is used by Namco NA-1 and NA-2 -This chip controls 24 channels (C140) or 16 (219) of PCM. -16 bytes are associated with each channel. -Channels can be 8 bit signed PCM, or 12 bit signed PCM. - -Timer behavior is not yet handled. - -Unmapped registers: - 0x1f8:timer interval? (Nx0.1 ms) - 0x1fa:irq ack? timer restart? - 0x1fe:timer switch?(0:off 1:on) - --------------- - - ASIC "219" notes - - On the 219 ASIC used on NA-1 and NA-2, the high registers have the following - meaning instead: - 0x1f7: bank for voices 0-3 - 0x1f1: bank for voices 4-7 - 0x1f3: bank for voices 8-11 - 0x1f5: bank for voices 12-15 - - Some games (bkrtmaq, xday2) write to 0x1fd for voices 12-15 instead. Probably the bank registers - mirror at 1f8, in which case 1ff is also 0-3, 1f9 is also 4-7, 1fb is also 8-11, and 1fd is also 12-15. - - Each bank is 0x20000 (128k), and the voice addresses on the 219 are all multiplied by 2. - Additionally, the 219's base pitch is the same as the C352's (42667). But these changes - are IMO not sufficient to make this a separate file - all the other registers are - fully compatible. - - Finally, the 219 only has 16 voices. -*/ -/* - 2000.06.26 CAB fixed compressed pcm playback - 2002.07.20 R.Belmont added support for multiple banking types - 2006.01.08 R.Belmont added support for NA-1/2 "219" derivative -*/ - - -#include "burnint.h" -#include "c140.h" - -// --- Future NOTE: if asic219 DOES NOT WORK, this is why!! (line below) -dink -#define BYTE_XOR_BE(x) (x) - -struct voice_registers -{ - UINT8 volume_right; - UINT8 volume_left; - UINT8 frequency_msb; - UINT8 frequency_lsb; - UINT8 bank; - UINT8 mode; - UINT8 start_msb; - UINT8 start_lsb; - UINT8 end_msb; - UINT8 end_lsb; - UINT8 loop_msb; - UINT8 loop_lsb; - UINT8 reserved[4]; -}; - -static INT32 m_sample_rate; -static INT32 m_banking_type; - -/* internal buffers */ -static INT16 *m_mixer_buffer_left; -static INT16 *m_mixer_buffer_right; - -static INT32 m_baserate; -static INT8 *m_pRom; -static UINT8 m_REG[0x200]; - -static INT16 m_pcmtbl[8]; //2000.06.26 CAB - -static C140_VOICE m_voi[C140_MAX_VOICE]; - -//************************************************************************** -// LIVE DEVICE -//************************************************************************** - -static INT32 limit(INT32 in) -{ - if(in>0x7fff) return 0x7fff; - else if(in<-0x8000) return -0x8000; - return in; -} - -static void init_voice( C140_VOICE *v ) -{ - v->key=0; - v->ptoffset=0; - v->rvol=0; - v->lvol=0; - v->frequency=0; - v->bank=0; - v->mode=0; - v->sample_start=0; - v->sample_end=0; - v->sample_loop=0; -} - -/* - find_sample: compute the actual address of a sample given it's - address and banking registers, as well as the board type. - - I suspect in "real life" this works like the Sega MultiPCM where the banking - is done by a small PAL or GAL external to the sound chip, which can be switched - per-game or at least per-PCB revision as addressing range needs grow. -*/ -static long find_sample(long adrs, long bank, int voice) -{ - long newadr = 0; - - static const INT16 asic219banks[4] = { 0x1f7, 0x1f1, 0x1f3, 0x1f5 }; - - adrs=(bank<<16)+adrs; - - switch (m_banking_type) - { - case C140_TYPE_SYSTEM2: - // System 2 banking - newadr = ((adrs&0x200000)>>2)|(adrs&0x7ffff); - break; - - case C140_TYPE_SYSTEM21: - // System 21 banking. - // similar to System 2's. - newadr = ((adrs&0x300000)>>1)+(adrs&0x7ffff); - break; - - case C140_TYPE_ASIC219: - // ASIC219's banking is fairly simple - newadr = ((m_REG[asic219banks[voice/4]]&0x3) * 0x20000) + adrs; - break; - } - - return (newadr); -} - - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void c140_init(INT32 clock, INT32 devtype, UINT8 *c140_rom) -{ - m_sample_rate = m_baserate = clock; - - m_banking_type = devtype; - - m_pRom = (INT8 *)c140_rom; - - /* make decompress pcm table */ //2000.06.26 CAB - { - memset(m_pcmtbl, 0, sizeof(m_pcmtbl)); - - INT32 segbase=0; - for(INT32 i = 0; i < 8; i++) - { - m_pcmtbl[i] = segbase; //segment base value - segbase += 16<m_sample_rate) samples=m_sample_rate; - - /* zap the contents of the mixer buffer */ - //memset(m_mixer_buffer_left, 0, samples * sizeof(INT16)); - //memset(m_mixer_buffer_right, 0, samples * sizeof(INT16)); - memset(m_mixer_buffer_left, 0, 2 * sizeof(INT16) * m_sample_rate); // full thing. - - /* get the number of voices to update */ - voicecnt = (m_banking_type == C140_TYPE_ASIC219) ? 16 : 24; - - //--- audio update - for (INT32 i = 0; i < voicecnt; i++) - { - C140_VOICE *v = &m_voi[i]; - const struct voice_registers *vreg = (struct voice_registers *)&m_REG[i*16]; - - if( v->key ) - { - frequency = vreg->frequency_msb*256 + vreg->frequency_lsb; - - /* Abort voice if no frequency value set */ - if(frequency==0) continue; - - /* Delta = frequency * ((8MHz/374)*2 / sample rate) */ - delta=(long)((float)frequency * pbase); - - /* Calculate left/right channel volumes */ - lvol=(vreg->volume_left*32)/C140_MAX_VOICE; //32ch -> 24ch - rvol=(vreg->volume_right*32)/C140_MAX_VOICE; - - /* Set mixer outputs base pointers */ - lmix = m_mixer_buffer_left; - rmix = m_mixer_buffer_right; - - /* Retrieve sample start/end and calculate size */ - st=v->sample_start; - ed=v->sample_end; - sz=ed-st; - - /* Retrieve base pointer to the sample data */ - pSampleData = m_pRom + find_sample(st, v->bank, i); - - /* Fetch back previous data pointers */ - offset=v->ptoffset; - pos=v->pos; - lastdt=v->lastdt; - prevdt=v->prevdt; - dltdt=v->dltdt; - - /* Switch on data type - compressed PCM is only for C140 */ - if ((v->mode&8) && (m_banking_type != C140_TYPE_ASIC219)) - { - //compressed PCM (maybe correct...) - /* Loop for enough to fill sample buffer as requested */ - for(INT32 j=0;j>16)&0x7fff; - offset &= 0xffff; - pos+=cnt; - //for(;cnt>0;cnt--) - { - /* Check for the end of the sample */ - if(pos >= sz) - { - /* Check if its a looping sample, either stop or loop */ - if(v->mode&0x10) - { - pos = (v->sample_loop - st); - } - else - { - v->key=0; - break; - } - } - - /* Read the chosen sample byte */ - dt=pSampleData[pos]; - - /* decompress to 13bit range */ //2000.06.26 CAB - sdt=dt>>3; //signed - if(sdt<0) sdt = (sdt<<(dt&7)) - m_pcmtbl[dt&7]; - else sdt = (sdt<<(dt&7)) + m_pcmtbl[dt&7]; - - prevdt=lastdt; - lastdt=sdt; - dltdt=(lastdt - prevdt); - } - - /* Caclulate the sample value */ - dt=((dltdt*offset)>>16)+prevdt; - - /* Write the data to the sample buffers */ - *lmix++ +=(dt*lvol)>>(5+5); - *rmix++ +=(dt*rvol)>>(5+5); - } - } - else - { - /* linear 8bit signed PCM */ - for(INT32 j=0;j>16)&0x7fff; - offset &= 0xffff; - pos += cnt; - /* Check for the end of the sample */ - if(pos >= sz) - { - /* Check if its a looping sample, either stop or loop */ - if( v->mode&0x10 ) - { - pos = (v->sample_loop - st); - } - else - { - v->key=0; - break; - } - } - - if( cnt ) - { - prevdt=lastdt; - - if (m_banking_type == C140_TYPE_ASIC219) - { - lastdt = pSampleData[BYTE_XOR_BE(pos)]; - - // Sign + magnitude format - if ((v->mode & 0x01) && (lastdt & 0x80)) - lastdt = -(lastdt & 0x7f); - - // Sign flip - if (v->mode & 0x40) - lastdt = -lastdt; - } - else - { - lastdt=pSampleData[pos]; - } - - dltdt = (lastdt - prevdt); - } - - /* Caclulate the sample value */ - dt=((dltdt*offset)>>16)+prevdt; - - /* Write the data to the sample buffers */ - *lmix++ +=(dt*lvol)>>5; - *rmix++ +=(dt*rvol)>>5; - } - } - - /* Save positional data for next callback */ - v->ptoffset=offset; - v->pos=pos; - v->lastdt=lastdt; - v->prevdt=prevdt; - v->dltdt=dltdt; - } - } - - /* render to MAME's stream buffer */ - lmix = m_mixer_buffer_left; - rmix = m_mixer_buffer_right; - - for (INT32 j = 0; j < samples_len; j++) - { - INT32 k = (((((m_sample_rate*1000) / nBurnFPS) * (j & ~2)) / nBurnSoundLen)) / 10; - - INT32 l = 8 * lmix[k]; - INT32 r = 8 * rmix[k]; - outputs[0] = BURN_SND_CLIP(outputs[0] + limit(l)); - outputs[1] = BURN_SND_CLIP(outputs[1] + limit(r)); - outputs += 2; - } - -} - - -UINT8 c140_read(UINT16 offset) -{ - offset &= 0x1ff; - return m_REG[offset]; -} - - -void c140_write(UINT16 offset, UINT8 data) -{ - offset &= 0x1ff; - - // mirror the bank registers on the 219, fixes bkrtmaq (and probably xday2 based on notes in the HLE) - if ((offset >= 0x1f8) && (m_banking_type == C140_TYPE_ASIC219)) - { - offset -= 8; - } - - m_REG[offset]=data; - - if (offset < 0x180) - { - C140_VOICE *v = &m_voi[offset>>4]; - - if ((offset&0xf) == 0x5) - { - if (data&0x80) - { - const struct voice_registers *vreg = (struct voice_registers *) &m_REG[offset&0x1f0]; - v->key=1; - v->ptoffset=0; - v->pos=0; - v->lastdt=0; - v->prevdt=0; - v->dltdt=0; - v->bank = vreg->bank; - v->mode = data; - - // on the 219 asic, addresses are in words - if (m_banking_type == C140_TYPE_ASIC219) - { - v->sample_loop = (vreg->loop_msb*256 + vreg->loop_lsb)*2; - v->sample_start = (vreg->start_msb*256 + vreg->start_lsb)*2; - v->sample_end = (vreg->end_msb*256 + vreg->end_lsb)*2; - - #if 0 - logerror("219: play v %d mode %02x start %x loop %x end %x\n", - offset>>4, v->mode, - find_sample(v->sample_start, v->bank, offset>>4), - find_sample(v->sample_loop, v->bank, offset>>4), - find_sample(v->sample_end, v->bank, offset>>4)); - #endif - } - else - { - v->sample_loop = vreg->loop_msb*256 + vreg->loop_lsb; - v->sample_start = vreg->start_msb*256 + vreg->start_lsb; - v->sample_end = vreg->end_msb*256 + vreg->end_lsb; - } - } - else - { - v->key=0; - } - } - } -} - - -void c140_set_base(void *base) -{ - m_pRom = (INT8 *)base; -} - diff --git a/jan/src/burn/snd/c140.h b/jan/src/burn/snd/c140.h deleted file mode 100644 index e777f5352..000000000 --- a/jan/src/burn/snd/c140.h +++ /dev/null @@ -1,52 +0,0 @@ -/* C140.h */ - -#define C140_MAX_VOICE 24 - -enum -{ - C140_TYPE_SYSTEM2, - C140_TYPE_SYSTEM21, - C140_TYPE_ASIC219 -}; - - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -struct C140_VOICE -{ - long ptoffset; - long pos; - long key; - //--work - long lastdt; - long prevdt; - long dltdt; - //--reg - long rvol; - long lvol; - long frequency; - long bank; - long mode; - - long sample_start; - long sample_end; - long sample_loop; -}; - - -// ======================> c140_device - -void c140_init(INT32 clock, INT32 devtype, UINT8 *c140_rom); -void c140_exit(); -void c140_reset(); -void c140_scan(); - -void c140_update(INT16 *outputs, int samples_len); - -UINT8 c140_read(UINT16 offset); -void c140_write(UINT16 offset, UINT8 data); - -void c140_set_base(void *base); - diff --git a/jan/src/burn/snd/c6280.cpp b/jan/src/burn/snd/c6280.cpp deleted file mode 100644 index 67d60dbe2..000000000 --- a/jan/src/burn/snd/c6280.cpp +++ /dev/null @@ -1,477 +0,0 @@ -/* - HuC6280 sound chip emulator - by Charles MacDonald - E-mail: cgfm2@hotmail.com - WWW: http://cgfm2.emuviews.com - - Thanks to: - - - Paul Clifford for his PSG documentation. - - Richard Bannister for the TGEmu-specific sound updating code. - - http://www.uspto.gov for the PSG patents. - - All contributors to the tghack-list. - - Changes: - - (03/30/2003) - - Removed TGEmu specific code and added support functions for MAME. - - Modified setup code to handle multiple chips with different clock and - volume settings. - - Missing features / things to do: - - - Add LFO support. But do any games actually use it? - - - Add shared index for waveform playback and sample writes. Almost every - game will reset the index prior to playback so this isn't an issue. - - - While the noise emulation is complete, the data for the pseudo-random - bitstream is calculated by machine.rand() and is not a representation of what - the actual hardware does. - - For some background on Hudson Soft's C62 chipset: - - - http://www.hudsonsoft.net/ww/about/about.html - - http://www.hudson.co.jp/corp/eng/coinfo/history.html - - Legal information: - - Copyright Charles MacDonald - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Ported from MAME 0.144u6 - 18/1/12 -*/ - -#include "burnint.h" -#include "h6280_intf.h" -#include "c6280.h" -#include "math.h" - -typedef struct { - UINT16 frequency; - UINT8 control; - UINT8 balance; - UINT8 waveform[32]; - UINT8 index; - INT16 dda; - UINT8 noise_control; - UINT32 noise_counter; - UINT32 counter; -} t_channel; - -typedef struct { - UINT8 select; - UINT8 balance; - UINT8 lfo_frequency; - UINT8 lfo_control; - t_channel channel[8]; - INT16 volume_table[32]; - UINT32 noise_freq_tab[32]; - UINT32 wave_freq_tab[4096]; - INT32 bAdd; - double gain[2]; - INT32 output_dir[2]; -} c6280_t; - -static INT16 *stream_buffer = NULL; -static INT32 c6280_previous_offset = 0; - -static c6280_t chip[1]; - -INT32 c6280_sync_get_offset_end() -{ -#if defined FBA_DEBUG - if (!DebugSnd_C6280Initted) bprintf(PRINT_ERROR, _T("c6280_sync_get_offset_end called without init\n")); -#endif - - // should we get these externally? The c6280 *should* only ever be used with - // the h6280 and should use the same clocks. - INT32 cycles = (INT32)((INT64)7159090 * nBurnCPUSpeedAdjust / (0x0100 * 60)); - INT64 ret = (nBurnSoundLen * h6280TotalCycles()) / cycles; - - if (ret >= nBurnSoundLen) { - ret = nBurnSoundLen; - } - - return (INT32)ret; -} - -void c6280_reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_C6280Initted) bprintf(PRINT_ERROR, _T("c6280_reset called without init\n")); -#endif - - c6280_t *p = &chip[0]; - - p->select = 0; - p->balance = 0; - p->lfo_frequency = 0; - p->lfo_control = 0; - memset (p->channel, 0, 8 * sizeof(t_channel)); - - c6280_previous_offset = 0; -} - -void c6280_init(double clk, INT32 bAdd) -{ - DebugSnd_C6280Initted = 1; - - INT32 i; - double step; - c6280_t *p = &chip[0]; - - /* Loudest volume level for table */ - double level = 65535.0 / 6.0 / 32.0; - - /* Clear context */ - memset(p, 0, sizeof(c6280_t)); - - /* Make waveform frequency table */ - for(i = 0; i < 4096; i += 1) - { - step = ((clk / (nBurnSoundRate * 1.0000)) * 4096) / (i+1); - p->wave_freq_tab[(1 + i) & 0xFFF] = (UINT32)step; - } - - /* Make noise frequency table */ - for(i = 0; i < 32; i += 1) - { - step = ((clk / (nBurnSoundRate * 1.0000)) * 32) / (i+1); - p->noise_freq_tab[i] = (UINT32)step; - } - - /* Make volume table */ - /* PSG has 48dB volume range spread over 32 steps */ - step = 48.0 / 32.0; - for(i = 0; i < 31; i++) - { - p->volume_table[i] = (UINT16)level; - level /= pow(10.0, step / 20.0); - } - p->volume_table[31] = 0; - - p->bAdd = bAdd; - p->gain[BURN_SND_C6280_ROUTE_1] = 1.00; - p->gain[BURN_SND_C6280_ROUTE_2] = 1.00; - p->output_dir[BURN_SND_C6280_ROUTE_1] = BURN_SND_ROUTE_LEFT; - p->output_dir[BURN_SND_C6280_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - - stream_buffer = (INT16*)BurnMalloc(nBurnSoundLen * 2 * sizeof(INT16)); - - if (stream_buffer == NULL) { -#if defined FBA_DEBUG - bprintf (0, _T("Stream buffer allocation failed!\n")); -#endif - return; - } -} - -void c6280_set_route(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_C6280Initted) bprintf(PRINT_ERROR, _T("c6280_set_route called without init\n")); -#endif - - c6280_t *p = &chip[0]; - - p->gain[nIndex] = nVolume; - p->output_dir[nIndex] = nRouteDir; -} - -void c6280_exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_C6280Initted) bprintf(PRINT_ERROR, _T("c6280_exit called without init\n")); -#endif - - if (stream_buffer) { - BurnFree(stream_buffer); - } - - DebugSnd_C6280Initted = 0; -} - -static void c6280_stream_update() -{ - c6280_t *p = &chip[0]; - -#if 1 - INT32 end = c6280_sync_get_offset_end(); - INT32 start = c6280_previous_offset; - - INT32 samples = end - start; - if (samples<=0) return; // don't update if length is 0 - - INT16 *pBuffer = stream_buffer + start * 2; - - c6280_previous_offset = end; - /* if (end >= nBurnSoundLen) { // this is always true, so //'d -dink - c6280_previous_offset = 0; // c6280_previous_offset reset to 0 at the bottom of c6280_update(); - } else { - c6280_previous_offset = end; - }*/ -#endif - - static const INT32 scale_tab[] = { - 0x00, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, - 0x10, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F - }; - INT32 ch; - INT32 i; - - INT32 lmal = (p->balance >> 4) & 0x0F; - INT32 rmal = (p->balance >> 0) & 0x0F; - INT32 vll, vlr; - - lmal = scale_tab[lmal]; - rmal = scale_tab[rmal]; - - /* Clear buffer */ - memset (pBuffer, 0, samples * sizeof(short) * 2); // 16-bit * 2 channels - - for(ch = 0; ch < 6; ch++) - { - /* Only look at enabled channels */ - if(p->channel[ch].control & 0x80) - { - INT32 lal = (p->channel[ch].balance >> 4) & 0x0F; - INT32 ral = (p->channel[ch].balance >> 0) & 0x0F; - INT32 al = p->channel[ch].control & 0x1F; - - lal = scale_tab[lal]; - ral = scale_tab[ral]; - - /* Calculate volume just as the patent says */ - vll = (0x1F - lal) + (0x1F - al) + (0x1F - lmal); - if(vll > 0x1F) vll = 0x1F; - - vlr = (0x1F - ral) + (0x1F - al) + (0x1F - rmal); - if(vlr > 0x1F) vlr = 0x1F; - - vll = p->volume_table[vll]; - vlr = p->volume_table[vlr]; - - INT16 *pBuf = pBuffer; - - /* Check channel mode */ - if((ch >= 4) && (p->channel[ch].noise_control & 0x80)) - { - /* Noise mode */ - UINT32 step = p->noise_freq_tab[(p->channel[ch].noise_control & 0x1F) ^ 0x1F]; - for(i = 0; i < samples; i++, pBuf+=2) - { - static int data = 0; - p->channel[ch].noise_counter += step; - if(p->channel[ch].noise_counter >= 0x800) - { - data = (rand() & 1) ? 0x1F : 0; - } - p->channel[ch].noise_counter &= 0x7FF; - pBuf[0] += (INT16)(vll * (data - 16)); - pBuf[1] += (INT16)(vlr * (data - 16)); - } - } - else - if(p->channel[ch].control & 0x40) - { - /* DDA mode */ - for(i = 0; i < samples; i++, pBuf+=2) - { - pBuf[0] += (INT16)(vll * (p->channel[ch].dda - 16)); - pBuf[1] += (INT16)(vlr * (p->channel[ch].dda - 16)); - } - } - else - { - /* Waveform mode */ - UINT32 step = p->wave_freq_tab[p->channel[ch].frequency]; - for(i = 0; i < samples; i++, pBuf+=2) - { - INT32 offset = (p->channel[ch].counter >> 12) & 0x1F; - p->channel[ch].counter += step; - p->channel[ch].counter &= 0x1FFFF; - INT16 data = p->channel[ch].waveform[offset]; - pBuf[0] += (INT16)(vll * (data - 16)); - pBuf[1] += (INT16)(vlr * (data - 16)); - } - } - } - } -} - -static void c6280_write_internal(INT32 offset, INT32 data) -{ - c6280_t *p = &chip[0]; - t_channel *q = &p->channel[p->select]; - - c6280_stream_update(); - - switch(offset & 0x0F) - { - case 0x00: /* Channel select */ - p->select = data & 0x07; - break; - - case 0x01: /* Global balance */ - p->balance = data; - break; - - case 0x02: /* Channel frequency (LSB) */ - q->frequency = (q->frequency & 0x0F00) | data; - q->frequency &= 0x0FFF; - break; - - case 0x03: /* Channel frequency (MSB) */ - q->frequency = (q->frequency & 0x00FF) | (data << 8); - q->frequency &= 0x0FFF; - break; - - case 0x04: /* Channel control (key-on, DDA mode, volume) */ - - /* 1-to-0 transition of DDA bit resets waveform index */ - if((q->control & 0x40) && ((data & 0x40) == 0)) - { - q->index = 0; - } - q->control = data; - break; - - case 0x05: /* Channel balance */ - q->balance = data; - break; - - case 0x06: /* Channel waveform data */ - - switch(q->control & 0xC0) - { - case 0x00: - q->waveform[q->index & 0x1F] = data & 0x1F; - q->index = (q->index + 1) & 0x1F; - break; - - case 0x40: - break; - - case 0x80: - q->waveform[q->index & 0x1F] = data & 0x1F; - q->index = (q->index + 1) & 0x1F; - break; - - case 0xC0: - q->dda = data & 0x1F; - break; - } - - break; - - case 0x07: /* Noise control (enable, frequency) */ - q->noise_control = data; - break; - - case 0x08: /* LFO frequency */ - p->lfo_frequency = data; - break; - - case 0x09: /* LFO control (enable, mode) */ - p->lfo_control = data; - break; - - default: - break; - } -} - -void c6280_update(INT16 *pBuffer, INT32 samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_C6280Initted) bprintf(PRINT_ERROR, _T("c6280_update called without init\n")); -#endif - - c6280_t *p = &chip[0]; - - c6280_stream_update(); - - if (!p->bAdd) { - memset (pBuffer, 0, samples * sizeof(INT16) * 2); // 16-bit * 2 channels - } - - for (INT32 i = 0; i < samples; i++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((p->output_dir[BURN_SND_C6280_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(stream_buffer[(i << 1) + 0] * p->gain[BURN_SND_C6280_ROUTE_1]); - } - if ((p->output_dir[BURN_SND_C6280_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(stream_buffer[(i << 1) + 0] * p->gain[BURN_SND_C6280_ROUTE_1]); - } - - if ((p->output_dir[BURN_SND_C6280_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(stream_buffer[(i << 1) + 1] * p->gain[BURN_SND_C6280_ROUTE_2]); - } - if ((p->output_dir[BURN_SND_C6280_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(stream_buffer[(i << 1) + 1] * p->gain[BURN_SND_C6280_ROUTE_2]); - } - - pBuffer[(i << 1) + 0] = BURN_SND_CLIP(nLeftSample); - pBuffer[(i << 1) + 1] = BURN_SND_CLIP(nRightSample); - } - c6280_previous_offset = 0; -} - -UINT8 c6280_read() -{ -#if defined FBA_DEBUG - if (!DebugSnd_C6280Initted) bprintf(PRINT_ERROR, _T("c6280_read called without init\n")); -#endif - - return h6280io_get_buffer(); -} - -void c6280_write(UINT8 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_C6280Initted) bprintf(PRINT_ERROR, _T("c6280_write called without init\n")); -#endif - - h6280io_set_buffer(data); - c6280_write_internal(offset, data); -} - -INT32 c6280_scan(INT32 nAction, INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_C6280Initted) bprintf(PRINT_ERROR, _T("c6280_scan called without init\n")); -#endif - - struct BurnArea ba; - - if (pnMin) { - *pnMin = 0x029702; - } - - if (nAction & ACB_DRIVER_DATA) { - c6280_t *p = &chip[0]; - - ba.Data = p; - ba.nLen = sizeof(c6280_t); - ba.nAddress = 0; - ba.szName = "c6280 Chip #0"; - BurnAcb(&ba); - } - - return 0; -} diff --git a/jan/src/burn/snd/c6280.h b/jan/src/burn/snd/c6280.h deleted file mode 100644 index fd787573c..000000000 --- a/jan/src/burn/snd/c6280.h +++ /dev/null @@ -1,20 +0,0 @@ - -void c6280_init(double clk, INT32 bAdd); -void c6280_set_route(INT32 nIndex, double nVolume, INT32 nRouteDir); -void c6280_exit(); - -void c6280_reset(); - -void c6280_update(INT16 *pBuf, INT32 samples); - -void c6280_write(UINT8 offset, UINT8 data); -UINT8 c6280_read(); - -INT32 c6280_scan(INT32 nAction, INT32 *pnMin); - -#define BURN_SND_C6280_ROUTE_1 0 -#define BURN_SND_C6280_ROUTE_2 1 - -#define c6280_set_all_routes(v, d) \ - c6280_set_route(BURN_SND_C6280_ROUTE_1, v, d); \ - c6280_set_route(BURN_SND_C6280_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/dac.cpp b/jan/src/burn/snd/dac.cpp deleted file mode 100644 index 33166ab61..000000000 --- a/jan/src/burn/snd/dac.cpp +++ /dev/null @@ -1,279 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" - -#define DAC_NUM (8) // Maximum DAC chips - -struct dac_info -{ - INT16 Output; - double nVolume; - INT32 nCurrentPosition; - INT32 Initialized; - INT32 OutputDir; - INT32 (*pSyncCallback)(); -}; - -static struct dac_info dac_table[DAC_NUM]; - -static INT16 UnsignedVolTable[256]; -static INT16 SignedVolTable[256]; - -static INT16 *lBuffer = NULL; -static INT16 *rBuffer = NULL; - -static INT32 NumChips; - -static INT32 bAddSignal; - -static void UpdateStream(INT32 chip, INT32 length) -{ - struct dac_info *ptr; - - if (lBuffer == NULL) { // delay buffer allocation for cases when fps is not 60 - lBuffer = (INT16*)BurnMalloc(nBurnSoundLen * sizeof(INT16)); - memset (lBuffer, 0, nBurnSoundLen * sizeof(INT16)); - } - if (rBuffer == NULL) { // delay buffer allocation for cases when fps is not 60 - rBuffer = (INT16*)BurnMalloc(nBurnSoundLen * sizeof(INT16)); - memset (rBuffer, 0, nBurnSoundLen * sizeof(INT16)); - } - - ptr = &dac_table[chip]; - if (ptr->Initialized == 0) return; - - if (length > nBurnSoundLen) length = nBurnSoundLen; - length -= ptr->nCurrentPosition; - if (length <= 0) return; - - INT16 *lbuf = lBuffer + ptr->nCurrentPosition; - INT16 *rbuf = rBuffer + ptr->nCurrentPosition; - - INT16 lOut = ((ptr->OutputDir & BURN_SND_ROUTE_LEFT ) == BURN_SND_ROUTE_LEFT ) ? ptr->Output : 0; - INT16 rOut = ((ptr->OutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) ? ptr->Output : 0; - - ptr->nCurrentPosition += length; - - if (rOut && lOut) { - while (length--) { - *lbuf = BURN_SND_CLIP((INT32)(*lbuf + lOut)); - *rbuf = BURN_SND_CLIP((INT32)(*rbuf + rOut)); - lbuf++,rbuf++; - } - } else if (lOut) { - while (length--) { - *lbuf = BURN_SND_CLIP((INT32)(*lbuf + lOut)); - lbuf++; - } - } else if (rOut) { - while (length--) { - *rbuf = BURN_SND_CLIP((INT32)(*rbuf + rOut)); - rbuf++; - } - } -} - -void DACUpdate(INT16* Buffer, INT32 Length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_DACInitted) bprintf(PRINT_ERROR, _T("DACUpdate called without init\n")); -#endif - - struct dac_info *ptr; - - for (INT32 i = 0; i < NumChips; i++) { - UpdateStream(i, nBurnSoundLen); - } - - INT16 *lbuf = lBuffer; - INT16 *rbuf = rBuffer; - - if (bAddSignal) { - while (Length--) { - Buffer[0] = BURN_SND_CLIP((INT32)(lbuf[0] + Buffer[0])); - Buffer[1] = BURN_SND_CLIP((INT32)(rbuf[0] + Buffer[1])); - Buffer += 2; - lbuf[0] = 0; // clear buffer - rbuf[0] = 0; // clear buffer - lbuf++; - rbuf++; - } - } else { - while (Length--) { - Buffer[0] = lbuf[0]; - Buffer[1] = rbuf[0]; - Buffer += 2; - lbuf[0] = 0; // clear buffer - rbuf[0] = 0; // clear buffer - lbuf++; - rbuf++; - } - } - - for (INT32 i = 0; i < NumChips; i++) { - ptr = &dac_table[i]; - ptr->nCurrentPosition = 0; - } -} - -void DACWrite(INT32 Chip, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_DACInitted) bprintf(PRINT_ERROR, _T("DACWrite called without init\n")); - if (Chip > NumChips) bprintf(PRINT_ERROR, _T("DACWrite called with invalid chip number %x\n"), Chip); -#endif - - struct dac_info *ptr; - - ptr = &dac_table[Chip]; - - UpdateStream(Chip, ptr->pSyncCallback()); - - ptr->Output = (INT32)(UnsignedVolTable[Data] * ptr->nVolume); -} - -void DACWrite16(INT32 Chip, INT16 Data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_DACInitted) bprintf(PRINT_ERROR, _T("DACWrite16 called without init\n")); - if (Chip > NumChips) bprintf(PRINT_ERROR, _T("DACWrite16 called with invalid chip number %x\n"), Chip); -#endif - - struct dac_info *ptr; - - ptr = &dac_table[Chip]; - - if (Data != ptr->Output) { - UpdateStream(Chip, ptr->pSyncCallback()); - ptr->Output = Data; - } -} - -void DACSignedWrite(INT32 Chip, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_DACInitted) bprintf(PRINT_ERROR, _T("DACSignedWrite called without init\n")); - if (Chip > NumChips) bprintf(PRINT_ERROR, _T("DACSignedWrite called with invalid chip number %x\n"), Chip); -#endif - struct dac_info *ptr; - - ptr = &dac_table[Chip]; - - UpdateStream(Chip, ptr->pSyncCallback()); - - ptr->Output = (INT32)(SignedVolTable[Data] * ptr->nVolume); -} - -static void DACBuildVolTables() -{ - for (INT32 i = 0;i < 256;i++) { - UnsignedVolTable[i] = i * 0x101 / 2; - SignedVolTable[i] = i * 0x101 - 0x8000; - } -} - -void DACInit(INT32 Num, UINT32 /*Clock*/, INT32 bAdd, INT32 (*pSyncCB)()) -{ -#if defined FBA_DEBUG - if (Num >= DAC_NUM) bprintf (PRINT_ERROR, _T("DACInit called for too many chips (%d)! Change DAC_NUM (%d)!\n"), Num, DAC_NUM); - if (pSyncCB == NULL) bprintf (PRINT_ERROR, _T("DACInit called with NULL callback!\n")); -#endif - - struct dac_info *ptr; - - DebugSnd_DACInitted = 1; - - NumChips = Num + 1; - - ptr = &dac_table[Num]; - - memset (ptr, 0, sizeof(dac_info)); - - ptr->Initialized = 1; - ptr->nVolume = 1.00; - ptr->OutputDir = BURN_SND_ROUTE_BOTH; - ptr->pSyncCallback = pSyncCB; - - DACBuildVolTables(); // necessary to build for every chip? - - bAddSignal = bAdd; -} - -void DACSetRoute(INT32 Chip, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_DACInitted) bprintf(PRINT_ERROR, _T("DACSetRoute called without init\n")); - if (Chip > NumChips) bprintf(PRINT_ERROR, _T("DACSetRoute called with invalid chip %i\n"), Chip); -#endif - - struct dac_info *ptr; - - ptr = &dac_table[Chip]; - ptr->nVolume = nVolume; - ptr->OutputDir = nRouteDir; -} - -void DACReset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_DACInitted) bprintf(PRINT_ERROR, _T("DACReset called without init\n")); -#endif - - struct dac_info *ptr; - - for (INT32 i = 0; i < NumChips; i++) { - ptr = &dac_table[i]; - - ptr->nCurrentPosition = 0; - ptr->Output = 0; - } -} - -void DACExit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_DACInitted) bprintf(PRINT_ERROR, _T("DACExit called without init\n")); -#endif - - if (!DebugSnd_DACInitted) return; - - struct dac_info *ptr; - - for (INT32 i = 0; i < DAC_NUM; i++) { - ptr = &dac_table[i]; - - ptr->Initialized = 0; - ptr->pSyncCallback = NULL; - } - - NumChips = 0; - - DebugSnd_DACInitted = 0; - - BurnFree (lBuffer); - BurnFree (rBuffer); - lBuffer = NULL; - rBuffer = NULL; -} - -INT32 DACScan(INT32 nAction,INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_DACInitted) bprintf(PRINT_ERROR, _T("DACScan called without init\n")); -#endif - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - struct dac_info *ptr; - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i < NumChips; i++) { - ptr = &dac_table[i]; - - SCAN_VAR(ptr->Output); - } - } - - return 0; -} diff --git a/jan/src/burn/snd/dac.h b/jan/src/burn/snd/dac.h deleted file mode 100644 index a6fbe0de1..000000000 --- a/jan/src/burn/snd/dac.h +++ /dev/null @@ -1,9 +0,0 @@ -void DACUpdate(INT16* Buffer, INT32 Length); -void DACWrite(INT32 Chip, UINT8 Data); -void DACWrite16(INT32 Chip, INT16 Data); -void DACSignedWrite(INT32 Chip, UINT8 Data); -void DACInit(INT32 Num, UINT32 Clock, INT32 bAdd, INT32 (*pSyncCB)()); -void DACSetRoute(INT32 Chip, double nVolume, INT32 nRouteDir); -void DACReset(); -void DACExit(); -INT32 DACScan(INT32 nAction,INT32 *pnMin); diff --git a/jan/src/burn/snd/es5506.cpp b/jan/src/burn/snd/es5506.cpp deleted file mode 100644 index 131f852a5..000000000 --- a/jan/src/burn/snd/es5506.cpp +++ /dev/null @@ -1,2241 +0,0 @@ -/********************************************************************************************** - - Ensoniq ES5505/6 driver - by Aaron Giles - -Ensoniq OTIS - ES5505 Ensoniq OTTO - ES5506 - - OTIS is a VLSI device designed in a 2 micron double metal OTTO is a VLSI device designed in a 1.5 micron double metal - CMOS process. The device is the next generation of audio CMOS process. The device is the next generation of audio - technology from ENSONIQ. This new chip achieves a new technology from ENSONIQ. All calculations in the device are - level of audio fidelity performance. These improvements made with at least 18-bit accuracy. - are achieved through the use of frequency interpolation - and on board real time digital filters. All calculations The major features of OTTO are: - in the device are made with at least 16 bit accuracy. - 68 pin PLCC package - - On chip real time digital filters - The major features of OTIS are: - Frequency interpolation - - 48 Pin dual in line package - 32 independent voices - - On chip real time digital filters - Loop start and stop posistions for each voice - - Frequency interpolation - Bidirectional and reverse looping - - 32 independent voices (up from 25 in DOCII) - 68000 compatibility for asynchronous bus communication - - Loop start and stop positions for each voice - Seperate host and sound memory interface - - Bidirectional and reverse looping - 6 channel stereo serial communication port - - 68000 compatibility for asynchronous bus communication - Programmable clocks for defining serial protocol - - On board pulse width modulation D to A - Internal volume multiplication and stereo panning - - 4 channel stereo serial communication port - A to D input for pots and wheels - - Internal volume multiplication and stereo panning - Hardware support for envelopes - - A to D input for pots and wheels - Support for dual OTTO systems - - Up to 10MHz operation - Optional compressed data format for sample data - - Up to 16MHz operation - ______ ______ - _|o \__/ |_ - A17/D13 - |_|1 48|_| - VSS A A A A A A - _| |_ 2 1 1 1 1 1 A - A18/D14 - |_|2 47|_| - A16/D12 0 9 8 7 6 5 1 - _| |_ / / / / / / 4 - A19/D15 - |_|3 46|_| - A15/D11 H H H H H H H V V H D D D D D D / - _| |_ D D D D D D D S D D 1 1 1 1 1 1 D - BS - |_|4 45|_| - A14/D10 0 1 2 3 4 5 6 S D 7 5 4 3 2 1 0 9 - _| |_ ------------------------------------+ - PWZERO - |_|5 44|_| - A13/D9 / 9 8 7 6 5 4 3 2 1 6 6 6 6 6 6 6 6 | - _| |_ / 8 7 6 5 4 3 2 1 | - SER0 - |_|6 43|_| - A12/D8 | | - _| E |_ SER0|10 60|A13/D8 - SER1 - |_|7 N 42|_| - A11/D7 SER1|11 59|A12/D7 - _| S |_ SER2|12 58|A11/D6 - SER2 - |_|8 O 41|_| - A10/D6 SER3|13 ENSONIQ 57|A10/D5 - _| N |_ SER4|14 56|A9/D4 - SER3 - |_|9 I 40|_| - A9/D5 SER5|15 55|A8/D3 - _| Q |_ WCLK|16 54|A7/D2 - SERWCLK - |_|10 39|_| - A8/D4 LRCLK|17 ES5506 53|A6/D1 - _| |_ BCLK|18 52|A5/D0 - SERLR - |_|11 38|_| - A7/D3 RESB|19 51|A4 - _| |_ HA5|20 50|A3 - SERBCLK - |_|12 E 37|_| - A6/D2 HA4|21 OTTO 49|A2 - _| S |_ HA3|22 48|A1 - RLO - |_|13 5 36|_| - A5/D1 HA2|23 47|A0 - _| 5 |_ HA1|24 46|BS1 - RHI - |_|14 0 35|_| - A4/D0 HA0|25 45|BS0 - _| 5 |_ POT_IN|26 44|DTACKB - LLO - |_|15 34|_| - CLKIN | 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 | - _| |_ | 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 | - LHI - |_|16 33|_| - CAS +--------------------------------------+ - _| |_ B E E B E B B D S B B B E K B W W - POT - |_|17 O 32|_| - AMUX S B L N L S S D S S X S L Q / / - _| T |_ E E R E H M C V V A U A C R R R - DTACK - |_|18 I 31|_| - RAS R R D H R M C I M - _| S |_ _ D A - R/W - |_|19 30|_| - E T - _| |_ O - MS - |_|20 29|_| - IRQ P - _| |_ - CS - |_|21 28|_| - A3 - _| |_ - RES - |_|22 27|_| - A2 - _| |_ - VSS - |_|23 26|_| - A1 - _| |_ - VDD - |_|24 25|_| - A0 - |________________| - -***********************************************************************************************/ - -// -// FBAlpha notes: (Nov.21.2016) -// -// ES5505Write() only supports 16bit writes. -// - -#include "burnint.h" -#include "es5506.h" - - -/********************************************************************************************** - - CONSTANTS - -***********************************************************************************************/ - -#define LOG_COMMANDS 0 -#define RAINE_CHECK 0 -#define MAKE_WAVS 0 - -#if MAKE_WAVS -#include "wavwrite.h" -#endif - -#define ES5506_INLINE static -#define ES5506 1 -#define ES5505 2 - -#define MAX_SAMPLE_CHUNK 10000 -#define ULAW_MAXBITS 8 - -#define CONTROL_BS1 0x8000 -#define CONTROL_BS0 0x4000 -#define CONTROL_CMPD 0x2000 -#define CONTROL_CA2 0x1000 -#define CONTROL_CA1 0x0800 -#define CONTROL_CA0 0x0400 -#define CONTROL_LP4 0x0200 -#define CONTROL_LP3 0x0100 -#define CONTROL_IRQ 0x0080 -#define CONTROL_DIR 0x0040 -#define CONTROL_IRQE 0x0020 -#define CONTROL_BLE 0x0010 -#define CONTROL_LPE 0x0008 -#define CONTROL_LEI 0x0004 -#define CONTROL_STOP1 0x0002 -#define CONTROL_STOP0 0x0001 - -#define CONTROL_BSMASK (CONTROL_BS1 | CONTROL_BS0) -#define CONTROL_CAMASK (CONTROL_CA2 | CONTROL_CA1 | CONTROL_CA0) -#define CONTROL_LPMASK (CONTROL_LP4 | CONTROL_LP3) -#define CONTROL_LOOPMASK (CONTROL_BLE | CONTROL_LPE) -#define CONTROL_STOPMASK (CONTROL_STOP1 | CONTROL_STOP0) - - - -/********************************************************************************************** - - INTERNAL DATA STRUCTURES - -***********************************************************************************************/ - -/* struct describing a single playing voice */ -typedef struct _es5506_voice es5506_voice; -struct _es5506_voice -{ - /* external state */ - UINT32 control; /* control register */ - UINT32 freqcount; /* frequency count register */ - UINT32 start; /* start register */ - UINT32 lvol; /* left volume register */ - UINT32 end; /* end register */ - UINT32 lvramp; /* left volume ramp register */ - UINT32 accum; /* accumulator register */ - UINT32 rvol; /* right volume register */ - UINT32 rvramp; /* right volume ramp register */ - UINT32 ecount; /* envelope count register */ - UINT32 k2; /* k2 register */ - UINT32 k2ramp; /* k2 ramp register */ - UINT32 k1; /* k1 register */ - UINT32 k1ramp; /* k1 ramp register */ - INT32 o4n1; /* filter storage O4(n-1) */ - INT32 o3n1; /* filter storage O3(n-1) */ - INT32 o3n2; /* filter storage O3(n-2) */ - INT32 o2n1; /* filter storage O2(n-1) */ - INT32 o2n2; /* filter storage O2(n-2) */ - INT32 o1n1; /* filter storage O1(n-1) */ - UINT32 exbank; /* external address bank */ - - /* internal state */ - UINT8 index; /* index of this voice */ - UINT8 filtcount; /* filter count */ - UINT32 accum_mask; -}; - -//typedef struct _es5506_state es5506_state; -struct _es5506_state -{ - INT32 chiptype; // 5505 or 5506? - INT32 sample_rate; /* current sample rate */ - UINT16 * region_base[4]; /* pointer to the base of the region */ - UINT32 write_latch; /* currently accumulated data for write */ - UINT32 read_latch; /* currently accumulated data for read */ - UINT32 master_clock; /* master clock frequency */ - void (*irq_callback)(INT32); /* IRQ callback */ - UINT16 (*port_read)(void); /* input port read */ - - UINT8 current_page; /* current register page */ - UINT8 active_voices; /* number of active voices */ - UINT8 mode; /* MODE register */ - UINT8 wst; /* W_ST register */ - UINT8 wend; /* W_END register */ - UINT8 lrend; /* LR_END register */ - UINT8 irqv; /* IRQV register */ - - es5506_voice voice[32]; /* the 32 voices */ - - INT32 * scratch; - - INT16 * ulaw_lookup; - UINT16 * volume_lookup; -// device_t *device; - - double volume[2]; /* set gain */ - -#if MAKE_WAVS - void * wavraw; /* raw waveform */ -#endif -}; - -static struct _es5506_state *chip = NULL; - -INT32 ES550X_twincobra2_pan_fix = 0; - - -/********************************************************************************************** - - GLOBAL VARIABLES - -***********************************************************************************************/ - -static FILE *eslog; - - - -/********************************************************************************************** - - update_irq_state -- update the IRQ state - -***********************************************************************************************/ - -static void update_irq_state() -{ - /* ES5505/6 irq line has been set high - inform the host */ - if (chip->irq_callback) - (*chip->irq_callback)(1); /* IRQB set high */ -} - -static void update_internal_irq_state() -{ - /* Host (cpu) has just read the voice interrupt vector (voice IRQ ack). - - Reset the voice vector to show the IRQB line is low (top bit set). - If we have any stacked interrupts (other voices waiting to be - processed - with their IRQ bit set) then they will be moved into - the vector next time the voice is processed. In emulation - terms they get updated next time generate_samples() is called. - */ - - chip->irqv=0x80; - if (chip->irq_callback) - (*chip->irq_callback)(0); /* IRQB set low */ -} - -/********************************************************************************************** - - compute_tables -- compute static tables - -***********************************************************************************************/ - -static void compute_tables() -{ - INT32 i; - - /* allocate ulaw lookup table */ - //chip->ulaw_lookup = auto_alloc_array(chip->device->machine, INT16, 1 << ULAW_MAXBITS); - chip->ulaw_lookup = (INT16*)BurnMalloc((1 << ULAW_MAXBITS) * sizeof(INT16)); - - /* generate ulaw lookup table */ - for (i = 0; i < (1 << ULAW_MAXBITS); i++) - { - UINT16 rawval = (i << (16 - ULAW_MAXBITS)) | (1 << (15 - ULAW_MAXBITS)); - UINT8 exponent = rawval >> 13; - UINT32 mantissa = (rawval << 3) & 0xffff; - - if (exponent == 0) - chip->ulaw_lookup[i] = (INT16)mantissa >> 7; - else - { - mantissa = (mantissa >> 1) | (~mantissa & 0x8000); - chip->ulaw_lookup[i] = (INT16)mantissa >> (7 - exponent); - } - } - - /* allocate volume lookup table */ - //chip->volume_lookup = auto_alloc_array(chip->device->machine, UINT16, 4096); - chip->volume_lookup = (UINT16*)BurnMalloc(4096 * sizeof(UINT16)); - - /* generate volume lookup table */ - for (i = 0; i < 4096; i++) - { - UINT8 exponent = i >> 8; - UINT32 mantissa = (i & 0xff) | 0x100; - - chip->volume_lookup[i] = (mantissa << 11) >> (20 - exponent); - } -} - - - -/********************************************************************************************** - - interpolate -- interpolate between two samples - -***********************************************************************************************/ - -#define interpolate(sample1, sample2, accum) \ - (sample1 * (INT32)(0x800 - (accum & 0x7ff)) + \ - sample2 * (INT32)(accum & 0x7ff)) >> 11; - - - -/********************************************************************************************** - - apply_filters -- apply the 4-pole digital filter to the sample - -***********************************************************************************************/ - -#define apply_filters(voice, sample) \ -do \ -{ \ - /* pole 1 is always low-pass using K1 */ \ - sample = ((INT32)(voice->k1 >> 2) * (sample - voice->o1n1) / 16384) + voice->o1n1; \ - voice->o1n1 = sample; \ - \ - /* pole 2 is always low-pass using K1 */ \ - sample = ((INT32)(voice->k1 >> 2) * (sample - voice->o2n1) / 16384) + voice->o2n1; \ - voice->o2n2 = voice->o2n1; \ - voice->o2n1 = sample; \ - \ - /* remaining poles depend on the current filter setting */ \ - switch (voice->control & CONTROL_LPMASK) \ - { \ - case 0: \ - /* pole 3 is high-pass using K2 */ \ - sample = sample - voice->o2n2 + ((INT32)(voice->k2 >> 2) * voice->o3n1) / 32768 + voice->o3n1 / 2; \ - voice->o3n2 = voice->o3n1; \ - voice->o3n1 = sample; \ - \ - /* pole 4 is high-pass using K2 */ \ - sample = sample - voice->o3n2 + ((INT32)(voice->k2 >> 2) * voice->o4n1) / 32768 + voice->o4n1 / 2; \ - voice->o4n1 = sample; \ - break; \ - \ - case CONTROL_LP3: \ - /* pole 3 is low-pass using K1 */ \ - sample = ((INT32)(voice->k1 >> 2) * (sample - voice->o3n1) / 16384) + voice->o3n1; \ - voice->o3n2 = voice->o3n1; \ - voice->o3n1 = sample; \ - \ - /* pole 4 is high-pass using K2 */ \ - sample = sample - voice->o3n2 + ((INT32)(voice->k2 >> 2) * voice->o4n1) / 32768 + voice->o4n1 / 2; \ - voice->o4n1 = sample; \ - break; \ - \ - case CONTROL_LP4: \ - /* pole 3 is low-pass using K2 */ \ - sample = ((INT32)(voice->k2 >> 2) * (sample - voice->o3n1) / 16384) + voice->o3n1; \ - voice->o3n2 = voice->o3n1; \ - voice->o3n1 = sample; \ - \ - /* pole 4 is low-pass using K2 */ \ - sample = ((INT32)(voice->k2 >> 2) * (sample - voice->o4n1) / 16384) + voice->o4n1; \ - voice->o4n1 = sample; \ - break; \ - \ - case CONTROL_LP4 | CONTROL_LP3: \ - /* pole 3 is low-pass using K1 */ \ - sample = ((INT32)(voice->k1 >> 2) * (sample - voice->o3n1) / 16384) + voice->o3n1; \ - voice->o3n2 = voice->o3n1; \ - voice->o3n1 = sample; \ - \ - /* pole 4 is low-pass using K2 */ \ - sample = ((INT32)(voice->k2 >> 2) * (sample - voice->o4n1) / 16384) + voice->o4n1; \ - voice->o4n1 = sample; \ - break; \ - } \ -} while (0) - - - -/********************************************************************************************** - - update_envelopes -- update the envelopes - -***********************************************************************************************/ - -#define update_envelopes(voice, samples) \ -do \ -{ \ - INT32 count = (samples > 1 && samples > (INT32)voice->ecount) ? voice->ecount : samples; \ - \ - /* decrement the envelope counter */ \ - voice->ecount -= count; \ - \ - /* ramp left volume */ \ - if (voice->lvramp) \ - { \ - voice->lvol += (INT8)voice->lvramp * count; \ - if ((INT32)voice->lvol < 0) voice->lvol = 0; \ - else if (voice->lvol > 0xffff) voice->lvol = 0xffff; \ - } \ - \ - /* ramp right volume */ \ - if (voice->rvramp) \ - { \ - voice->rvol += (INT8)voice->rvramp * count; \ - if ((INT32)voice->rvol < 0) voice->rvol = 0; \ - else if (voice->rvol > 0xffff) voice->rvol = 0xffff; \ - } \ - \ - /* ramp k1 filter constant */ \ - if (voice->k1ramp && ((INT32)voice->k1ramp >= 0 || !(voice->filtcount & 7))) \ - { \ - voice->k1 += (INT8)voice->k1ramp * count; \ - if ((INT32)voice->k1 < 0) voice->k1 = 0; \ - else if (voice->k1 > 0xffff) voice->k1 = 0xffff; \ - } \ - \ - /* ramp k2 filter constant */ \ - if (voice->k2ramp && ((INT32)voice->k2ramp >= 0 || !(voice->filtcount & 7))) \ - { \ - voice->k2 += (INT8)voice->k2ramp * count; \ - if ((INT32)voice->k2 < 0) voice->k2 = 0; \ - else if (voice->k2 > 0xffff) voice->k2 = 0xffff; \ - } \ - \ - /* update the filter constant counter */ \ - voice->filtcount += count; \ - \ -} while (0) - - - -/********************************************************************************************** - - check_for_end_forward - check_for_end_reverse -- check for loop end and loop appropriately - -***********************************************************************************************/ - -#define check_for_end_forward(voice, accum) \ -do \ -{ \ - /* are we past the end? */ \ - if (accum > voice->end && !(voice->control & CONTROL_LEI)) \ - { \ - /* generate interrupt if required */ \ - if (voice->control&CONTROL_IRQE) \ - voice->control |= CONTROL_IRQ; \ - \ - /* handle the different types of looping */ \ - switch (voice->control & CONTROL_LOOPMASK) \ - { \ - /* non-looping */ \ - case 0: \ - voice->control |= CONTROL_STOP0; \ - goto alldone; \ - \ - /* uni-directional looping */ \ - case CONTROL_LPE: \ - accum = (voice->start + (accum - voice->end)) & voice->accum_mask; \ - break; \ - \ - /* trans-wave looping */ \ - case CONTROL_BLE: \ - accum = (voice->start + (accum - voice->end)) & voice->accum_mask; \ - voice->control = (voice->control & ~CONTROL_LOOPMASK) | CONTROL_LEI;\ - break; \ - \ - /* bi-directional looping */ \ - case CONTROL_LPE | CONTROL_BLE: \ - accum = (voice->end - (accum - voice->end)) & voice->accum_mask; \ - voice->control ^= CONTROL_DIR; \ - goto reverse; \ - } \ - } \ -} while (0) - - -#define check_for_end_reverse(voice, accum) \ -do \ -{ \ - /* are we past the end? */ \ - if (accum < voice->start && !(voice->control & CONTROL_LEI)) \ - { \ - /* generate interrupt if required */ \ - if (voice->control&CONTROL_IRQE) \ - voice->control |= CONTROL_IRQ; \ - \ - /* handle the different types of looping */ \ - switch (voice->control & CONTROL_LOOPMASK) \ - { \ - /* non-looping */ \ - case 0: \ - voice->control |= CONTROL_STOP0; \ - goto alldone; \ - \ - /* uni-directional looping */ \ - case CONTROL_LPE: \ - accum = (voice->end - (voice->start - accum)) & voice->accum_mask; \ - break; \ - \ - /* trans-wave looping */ \ - case CONTROL_BLE: \ - accum = (voice->end - (voice->start - accum)) & voice->accum_mask; \ - voice->control = (voice->control & ~CONTROL_LOOPMASK) | CONTROL_LEI;\ - break; \ - \ - /* bi-directional looping */ \ - case CONTROL_LPE | CONTROL_BLE: \ - accum = (voice->start + (voice->start - accum)) & voice->accum_mask;\ - voice->control ^= CONTROL_DIR; \ - goto reverse; \ - } \ - } \ -} while (0) - - - -/********************************************************************************************** - - generate_dummy -- generate nothing, just apply envelopes - -***********************************************************************************************/ - -static void generate_dummy(es5506_voice *voice, UINT16 *, INT32 *, INT32 *, INT32 samples) -{ - UINT32 freqcount = voice->freqcount; - UINT32 accum = voice->accum & voice->accum_mask; - - /* outer loop, in case we switch directions */ - while (samples > 0 && !(voice->control & CONTROL_STOPMASK)) - { -reverse: - /* two cases: first case is forward direction */ - if (!(voice->control & CONTROL_DIR)) - { - /* loop while we still have samples to generate */ - while (samples--) - { - /* fetch two samples */ - accum = (accum + freqcount) & voice->accum_mask; - - /* update filters/volumes */ - if (voice->ecount != 0) - update_envelopes(voice, 1); - - /* check for loop end */ - check_for_end_forward(voice, accum); - } - } - - /* two cases: second case is backward direction */ - else - { - /* loop while we still have samples to generate */ - while (samples--) - { - /* fetch two samples */ - accum = (accum - freqcount) & voice->accum_mask; - - /* update filters/volumes */ - if (voice->ecount != 0) - update_envelopes(voice, 1); - - /* check for loop end */ - check_for_end_reverse(voice, accum); - } - } - } - - /* if we stopped, process any additional envelope */ -alldone: - voice->accum = accum; - if (samples > 0) - update_envelopes(voice, samples); -} - - - -/********************************************************************************************** - - generate_ulaw -- general u-law decoding routine - -***********************************************************************************************/ - -static void generate_ulaw(es5506_voice *voice, UINT16 *base, INT32 *lbuffer, INT32 *rbuffer, INT32 samples) -{ - UINT32 freqcount = voice->freqcount; - UINT32 accum = voice->accum & voice->accum_mask; - INT32 lvol = chip->volume_lookup[voice->lvol >> 4]; - INT32 rvol = chip->volume_lookup[voice->rvol >> 4]; - - //bprintf(PRINT_NORMAL, _T("ULAW\n")); - - /* pre-add the bank offset */ - base += voice->exbank; - - /* outer loop, in case we switch directions */ - while (samples > 0 && !(voice->control & CONTROL_STOPMASK)) - { -reverse: - /* two cases: first case is forward direction */ - if (!(voice->control & CONTROL_DIR)) - { - /* loop while we still have samples to generate */ - while (samples--) - { - /* fetch two samples */ - INT32 val1 = base[accum >> 11]; - INT32 val2 = base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; - - /* decompress u-law */ - val1 = chip->ulaw_lookup[val1 >> (16 - ULAW_MAXBITS)]; - val2 = chip->ulaw_lookup[val2 >> (16 - ULAW_MAXBITS)]; - - /* interpolate */ - val1 = interpolate(val1, val2, accum); - accum = (accum + freqcount) & voice->accum_mask; - - /* apply filters */ - apply_filters(voice, val1); - - /* update filters/volumes */ - if (voice->ecount != 0) - { - update_envelopes(voice, 1); - lvol = chip->volume_lookup[voice->lvol >> 4]; - rvol = chip->volume_lookup[voice->rvol >> 4]; - } - - /* apply volumes and add */ - *lbuffer++ += (val1 * lvol) >> 11; - *rbuffer++ += (val1 * rvol) >> 11; - - /* check for loop end */ - check_for_end_forward(voice, accum); - } - } - - /* two cases: second case is backward direction */ - else - { - /* loop while we still have samples to generate */ - while (samples--) - { - /* fetch two samples */ - INT32 val1 = base[accum >> 11]; - INT32 val2 = base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; - - /* decompress u-law */ - val1 = chip->ulaw_lookup[val1 >> (16 - ULAW_MAXBITS)]; - val2 = chip->ulaw_lookup[val2 >> (16 - ULAW_MAXBITS)]; - - /* interpolate */ - val1 = interpolate(val1, val2, accum); - accum = (accum - freqcount) & voice->accum_mask; - - /* apply filters */ - apply_filters(voice, val1); - - /* update filters/volumes */ - if (voice->ecount != 0) - { - update_envelopes(voice, 1); - lvol = chip->volume_lookup[voice->lvol >> 4]; - rvol = chip->volume_lookup[voice->rvol >> 4]; - } - - /* apply volumes and add */ - *lbuffer++ += (val1 * lvol) >> 11; - *rbuffer++ += (val1 * rvol) >> 11; - - /* check for loop end */ - check_for_end_reverse(voice, accum); - } - } - } - - /* if we stopped, process any additional envelope */ -alldone: - voice->accum = accum; - if (samples > 0) - update_envelopes(voice, samples); -} - - - -/********************************************************************************************** - - generate_pcm -- general PCM decoding routine - -***********************************************************************************************/ - -#define twincobra2_check() { \ - if (ES550X_twincobra2_pan_fix && lvol > 0x100 && rvol < 7) \ - rvol = lvol; \ - } - -static void generate_pcm(es5506_voice *voice, UINT16 *base, INT32 *lbuffer, INT32 *rbuffer, INT32 samples) -{ - UINT32 freqcount = voice->freqcount; - UINT32 accum = voice->accum & voice->accum_mask; - INT32 lvol = chip->volume_lookup[voice->lvol >> 4]; - INT32 rvol = chip->volume_lookup[voice->rvol >> 4]; - - //bprintf(PRINT_NORMAL, _T("PCM, %x, %x, %x\n"), lvol, rvol, voice->control & CONTROL_STOPMASK); - - twincobra2_check(); - - /* pre-add the bank offset */ - base += voice->exbank; - - /* outer loop, in case we switch directions */ - while (samples > 0 && !(voice->control & CONTROL_STOPMASK)) - { -reverse: - /* two cases: first case is forward direction */ - if (!(voice->control & CONTROL_DIR)) - { - /* loop while we still have samples to generate */ - while (samples--) - { - /* fetch two samples */ - INT32 val1 = (INT16)base[accum >> 11]; - INT32 val2 = (INT16)base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; - - /* interpolate */ - val1 = interpolate(val1, val2, accum); - accum = (accum + freqcount) & voice->accum_mask; - - /* apply filters */ - apply_filters(voice, val1); - - /* update filters/volumes */ - if (voice->ecount != 0) - { - update_envelopes(voice, 1); - lvol = chip->volume_lookup[voice->lvol >> 4]; - rvol = chip->volume_lookup[voice->rvol >> 4]; - twincobra2_check(); - } - - /* apply volumes and add */ - *lbuffer++ += (val1 * lvol) >> 11; - *rbuffer++ += (val1 * rvol) >> 11; - - /* check for loop end */ - check_for_end_forward(voice, accum); - } - } - - /* two cases: second case is backward direction */ - else - { - /* loop while we still have samples to generate */ - while (samples--) - { - /* fetch two samples */ - INT32 val1 = (INT16)base[accum >> 11]; - INT32 val2 = (INT16)base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; - - /* interpolate */ - val1 = interpolate(val1, val2, accum); - accum = (accum - freqcount) & voice->accum_mask; - - /* apply filters */ - apply_filters(voice, val1); - - /* update filters/volumes */ - if (voice->ecount != 0) - { - update_envelopes(voice, 1); - lvol = chip->volume_lookup[voice->lvol >> 4]; - rvol = chip->volume_lookup[voice->rvol >> 4]; - twincobra2_check(); - } - - /* apply volumes and add */ - *lbuffer++ += (val1 * lvol) >> 11; - *rbuffer++ += (val1 * rvol) >> 11; - - /* check for loop end */ - check_for_end_reverse(voice, accum); - } - } - } - - /* if we stopped, process any additional envelope */ -alldone: - voice->accum = accum; - if (samples > 0) - update_envelopes(voice, samples); -} - - - -/********************************************************************************************** - - generate_samples -- tell each voice to generate samples - -***********************************************************************************************/ - -static void generate_samples(INT32 *left, INT32 *right, INT32 samples) -{ - INT32 v; - - /* skip if nothing to do */ - if (!samples) - return; - - /* clear out the accumulator */ - memset(left, 0, samples * sizeof(left[0])); - memset(right, 0, samples * sizeof(right[0])); - - /* loop over voices */ - for (v = 0; v <= chip->active_voices; v++) - { - es5506_voice *voice = &chip->voice[v]; - UINT16 *base = chip->region_base[voice->control >> 14]; - - /* special case: if end == start, stop the voice */ - if (voice->start == voice->end) - voice->control |= CONTROL_STOP0; - - /* generate from the appropriate source */ - if (!base) - { - //logerror("NULL region base %d\n",voice->control >> 14); - generate_dummy(voice, base, left, right, samples); - } - else if (voice->control & 0x2000) - generate_ulaw(voice, base, left, right, samples); - else - generate_pcm(voice, base, left, right, samples); - - /* does this voice have it's IRQ bit raised? */ - if (voice->control&CONTROL_IRQ) - { - //logerror("IRQ raised on voice %d!!\n",v); - /* only update voice vector if existing IRQ is acked by host */ - if (chip->irqv&0x80) - { - /* latch voice number into vector, and set high bit low */ - chip->irqv=v&0x7f; - - /* take down IRQ bit on voice */ - voice->control&=~CONTROL_IRQ; - - /* inform host of irq */ - update_irq_state(); - } - } - } -} - - -/********************************************************************************************** - - es5506_update -- update the sound chip so that it is in sync with CPU execution - -***********************************************************************************************/ - -void ES5506Update(INT16 *pBuffer, INT32 samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5506Update called without init\n")); -#endif - - INT32 *lsrc = chip->scratch, *rsrc = chip->scratch; - -#if MAKE_WAVS - /* start the logging once we have a sample rate */ - if (chip->sample_rate) - { - if (!chip->wavraw) - chip->wavraw = wav_open("raw.wav", chip->sample_rate, 2); - } -#endif - - INT32 rate = (chip->sample_rate * 100) / nBurnFPS; - samples = rate; - - /* loop until all samples are output */ - while (samples) - { - INT32 length = (samples > MAX_SAMPLE_CHUNK) ? MAX_SAMPLE_CHUNK : samples; - INT32 samp; - - /* determine left/right source data */ - lsrc = chip->scratch; - rsrc = chip->scratch + length; - generate_samples(lsrc, rsrc, length); - - /* copy the data */ - INT32 len = (length * nBurnSoundLen) / rate; - - for (samp = 0; samp < len; samp++) - { - INT32 k = (samp * rate) / nBurnSoundLen; - - pBuffer[0] = BURN_SND_CLIP((INT32)((lsrc[k] >> 4) * chip->volume[0])); - pBuffer[1] = BURN_SND_CLIP((INT32)((rsrc[k] >> 4) * chip->volume[1])); - pBuffer += 2; - } - -#if MAKE_WAVS - /* log the raw data */ - if (chip->wavraw) - wav_add_data_32lr(chip->wavraw, lsrc, rsrc, length, 4); -#endif - - /* account for these samples */ - samples -= length; - } -} - - -/********************************************************************************************** - - DEVICE_START( es5506 ) -- start emulation of the ES5506 - -***********************************************************************************************/ - -static void init_voices() -{ - /* init the voices */ - UINT32 accum_mask = (chip->chiptype == ES5506) ? 0xffffffff : 0x7fffffff; - - for (INT32 j = 0; j < 32; j++) - { - chip->voice[j].index = j; - chip->voice[j].control = CONTROL_STOPMASK; - chip->voice[j].lvol = 0xffff; - chip->voice[j].rvol = 0xffff; - chip->voice[j].exbank = 0; - chip->voice[j].accum_mask = accum_mask; - } -} - -static void es5506_start_common(INT32 clock, UINT8* region0, UINT8* region1, UINT8* region2, UINT8* region3, irq_callback callback, INT32 sndtype) -{ - DebugSnd_ES5506Initted = 1; - - /* debugging */ - if (LOG_COMMANDS && !eslog) - eslog = fopen("es.log", "w"); - - /* create the struct */ - chip = (struct _es5506_state*)BurnMalloc(sizeof(_es5506_state)); - memset(chip, 0, sizeof(_es5506_state)); - - chip->chiptype = sndtype; - - /* initialize the regions */ - chip->region_base[0] = region0 ? (UINT16 *)region0 : NULL; - chip->region_base[1] = region1 ? (UINT16 *)region1 : NULL; - chip->region_base[2] = region2 ? (UINT16 *)region2 : NULL; - chip->region_base[3] = region3 ? (UINT16 *)region3 : NULL; - - /* initialize the rest of the structure */ - chip->master_clock = clock; - chip->irq_callback = callback; - chip->irqv = 0x80; - - /* compute the tables */ - compute_tables(); - - // init voices. also used in reset()! - init_voices(); - - /* allocate memory */ - chip->scratch = (INT32*)BurnMalloc(2 * MAX_SAMPLE_CHUNK * sizeof(INT32)); - - /* set volume */ - chip->volume[0] = 1.00; - chip->volume[1] = 1.00; - - ES550X_twincobra2_pan_fix = 0; // this can be set after init. - - /* success */ -} - - -void ES5506Init(INT32 clock, UINT8* region0, UINT8* region1, UINT8* region2, UINT8* region3, irq_callback callback) -{ - es5506_start_common(clock, region0, region1, region2, region3, callback, ES5506); -} - -void ES5506Scan(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5506Scan called without init\n")); -#endif - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(chip->sample_rate); - SCAN_VAR(chip->write_latch); - SCAN_VAR(chip->read_latch); - SCAN_VAR(chip->current_page); - SCAN_VAR(chip->active_voices); - SCAN_VAR(chip->mode); - SCAN_VAR(chip->wst); - SCAN_VAR(chip->wend); - SCAN_VAR(chip->lrend); - SCAN_VAR(chip->irqv); - SCAN_VAR(chip->voice); - } -} - -// Some games (Taito F3) change the l/r volume in-game, this is for them -void ES5506ScanRoutes(INT32 nAction, INT32* pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5506ScanRoutes called without init\n")); -#endif - - ES5506Scan(nAction, pnMin); - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(chip->volume); - } -} - -void ES5506SetRoute(INT32, double nVolume, INT32 nRouteDir) -{ - if (nRouteDir & 1) { // left - chip->volume[0] = nVolume; - } - - if (nRouteDir & 2) { // right - chip->volume[1] = nVolume; - } -} - - -/********************************************************************************************** - - DEVICE_STOP( es5506 ) -- stop emulation of the ES5506 - -***********************************************************************************************/ - -void ES5506Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5506Exit called without init\n")); -#endif - - if (!DebugSnd_ES5506Initted) return; - - /* debugging */ - if (LOG_COMMANDS && eslog) - { - fclose(eslog); - eslog = NULL; - } - -#if MAKE_WAVS - { - INT32 i; - - for (i = 0; i < MAX_ES5506; i++) - { - if (es5506[i].wavraw) - wav_close(es5506[i].wavraw); - } - } -#endif - - BurnFree(chip->ulaw_lookup); - BurnFree(chip->volume_lookup); - BurnFree(chip->scratch); - BurnFree(chip); - chip = NULL; - - ES550X_twincobra2_pan_fix = 0; - - DebugSnd_ES5506Initted = 0; -} - - -void ES5506Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5506Reset called without init\n")); -#endif - - init_voices(); -} - - -/********************************************************************************************** - - es5506_reg_write -- handle a write to the selected ES5506 register - -***********************************************************************************************/ - -ES5506_INLINE void es5506_reg_write_low(es5506_voice *voice, UINT32 offset, UINT32 data) -{ - switch (offset) - { - case 0x00/8: /* CR */ - voice->control = data & 0xffff; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, control=%04x\n", chip->current_page & 0x1f, voice->control); - break; - - case 0x08/8: /* FC */ - voice->freqcount = data & 0x1ffff; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, freq count=%08x\n", chip->current_page & 0x1f, voice->freqcount); - break; - - case 0x10/8: /* LVOL */ - voice->lvol = data & 0xffff; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, left vol=%04x\n", chip->current_page & 0x1f, voice->lvol); - break; - - case 0x18/8: /* LVRAMP */ - voice->lvramp = (data & 0xff00) >> 8; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, left vol ramp=%04x\n", chip->current_page & 0x1f, voice->lvramp); - break; - - case 0x20/8: /* RVOL */ - voice->rvol = data & 0xffff; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, right vol=%04x\n", chip->current_page & 0x1f, voice->rvol); - break; - - case 0x28/8: /* RVRAMP */ - voice->rvramp = (data & 0xff00) >> 8; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, right vol ramp=%04x\n", chip->current_page & 0x1f, voice->rvramp); - break; - - case 0x30/8: /* ECOUNT */ - voice->ecount = data & 0x1ff; - voice->filtcount = 0; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, envelope count=%04x\n", chip->current_page & 0x1f, voice->ecount); - break; - - case 0x38/8: /* K2 */ - voice->k2 = data & 0xffff; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, K2=%04x\n", chip->current_page & 0x1f, voice->k2); - break; - - case 0x40/8: /* K2RAMP */ - voice->k2ramp = ((data & 0xff00) >> 8) | ((data & 0x0001) << 31); - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, K2 ramp=%04x\n", chip->current_page & 0x1f, voice->k2ramp); - break; - - case 0x48/8: /* K1 */ - voice->k1 = data & 0xffff; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, K1=%04x\n", chip->current_page & 0x1f, voice->k1); - break; - - case 0x50/8: /* K1RAMP */ - voice->k1ramp = ((data & 0xff00) >> 8) | ((data & 0x0001) << 31); - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, K1 ramp=%04x\n", chip->current_page & 0x1f, voice->k1ramp); - break; - - case 0x58/8: /* ACTV */ - { - chip->active_voices = data & 0x1f; - chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1)); - - if (LOG_COMMANDS && eslog) - fprintf(eslog, "active voices=%d, sample_rate=%d\n", chip->active_voices, chip->sample_rate); - break; - } - - case 0x60/8: /* MODE */ - chip->mode = data & 0x1f; - break; - - case 0x68/8: /* PAR - read only */ - case 0x70/8: /* IRQV - read only */ - break; - - case 0x78/8: /* PAGE */ - chip->current_page = data & 0x7f; - break; - } -} - - -ES5506_INLINE void es5506_reg_write_high(es5506_voice *voice, UINT32 offset, UINT32 data) -{ - switch (offset) - { - case 0x00/8: /* CR */ - voice->control = data & 0xffff; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, control=%04x\n", chip->current_page & 0x1f, voice->control); - break; - - case 0x08/8: /* START */ - voice->start = data & 0xfffff800; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, loop start=%08x\n", chip->current_page & 0x1f, voice->start); - break; - - case 0x10/8: /* END */ - voice->end = data & 0xffffff80; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, loop end=%08x\n", chip->current_page & 0x1f, voice->end); - break; - - case 0x18/8: /* ACCUM */ - voice->accum = data; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, accum=%08x\n", chip->current_page & 0x1f, voice->accum); - break; - - case 0x20/8: /* O4(n-1) */ - voice->o4n1 = (INT32)(data << 14) >> 14; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, O4(n-1)=%05x\n", chip->current_page & 0x1f, voice->o4n1 & 0x3ffff); - break; - - case 0x28/8: /* O3(n-1) */ - voice->o3n1 = (INT32)(data << 14) >> 14; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, O3(n-1)=%05x\n", chip->current_page & 0x1f, voice->o3n1 & 0x3ffff); - break; - - case 0x30/8: /* O3(n-2) */ - voice->o3n2 = (INT32)(data << 14) >> 14; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, O3(n-2)=%05x\n", chip->current_page & 0x1f, voice->o3n2 & 0x3ffff); - break; - - case 0x38/8: /* O2(n-1) */ - voice->o2n1 = (INT32)(data << 14) >> 14; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, O2(n-1)=%05x\n", chip->current_page & 0x1f, voice->o2n1 & 0x3ffff); - break; - - case 0x40/8: /* O2(n-2) */ - voice->o2n2 = (INT32)(data << 14) >> 14; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, O2(n-2)=%05x\n", chip->current_page & 0x1f, voice->o2n2 & 0x3ffff); - break; - - case 0x48/8: /* O1(n-1) */ - voice->o1n1 = (INT32)(data << 14) >> 14; - if (LOG_COMMANDS && eslog) - fprintf(eslog, "voice %d, O1(n-1)=%05x\n", chip->current_page & 0x1f, voice->o1n1 & 0x3ffff); - break; - - case 0x50/8: /* W_ST */ - chip->wst = data & 0x7f; - break; - - case 0x58/8: /* W_END */ - chip->wend = data & 0x7f; - break; - - case 0x60/8: /* LR_END */ - chip->lrend = data & 0x7f; - break; - - case 0x68/8: /* PAR - read only */ - case 0x70/8: /* IRQV - read only */ - break; - - case 0x78/8: /* PAGE */ - chip->current_page = data & 0x7f; - break; - } -} - -ES5506_INLINE void es5506_reg_write_test(UINT32 offset, UINT32 data) -{ - switch (offset) - { - case 0x00/8: /* CHANNEL 0 LEFT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 0 left test write %08x\n", data); - break; - - case 0x08/8: /* CHANNEL 0 RIGHT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 0 right test write %08x\n", data); - break; - - case 0x10/8: /* CHANNEL 1 LEFT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 1 left test write %08x\n", data); - break; - - case 0x18/8: /* CHANNEL 1 RIGHT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 1 right test write %08x\n", data); - break; - - case 0x20/8: /* CHANNEL 2 LEFT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 2 left test write %08x\n", data); - break; - - case 0x28/8: /* CHANNEL 2 RIGHT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 2 right test write %08x\n", data); - break; - - case 0x30/8: /* CHANNEL 3 LEFT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 3 left test write %08x\n", data); - break; - - case 0x38/8: /* CHANNEL 3 RIGHT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 3 right test write %08x\n", data); - break; - - case 0x40/8: /* CHANNEL 4 LEFT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 4 left test write %08x\n", data); - break; - - case 0x48/8: /* CHANNEL 4 RIGHT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 4 right test write %08x\n", data); - break; - - case 0x50/8: /* CHANNEL 5 LEFT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 5 left test write %08x\n", data); - break; - - case 0x58/8: /* CHANNEL 6 RIGHT */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Channel 5 right test write %08x\n", data); - break; - - case 0x60/8: /* EMPTY */ - if (LOG_COMMANDS && eslog) - fprintf(eslog, "Test write EMPTY %08x\n", data); - break; - - case 0x68/8: /* PAR - read only */ - case 0x70/8: /* IRQV - read only */ - break; - - case 0x78/8: /* PAGE */ - chip->current_page = data & 0x7f; - break; - } -} - -void ES5506Write(UINT32 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5506Write called without init\n")); -#endif - - es5506_voice *voice = &chip->voice[chip->current_page & 0x1f]; - INT32 shift = 8 * (offset & 3); - - /* accumulate the data */ - chip->write_latch = (chip->write_latch & ~(0xff000000 >> shift)) | (data << (24 - shift)); - - /* wait for a write to complete */ - if (shift != 24) - return; - - /* switch off the page and register */ - if (chip->current_page < 0x20) - es5506_reg_write_low(voice, offset / 4, chip->write_latch); - else if (chip->current_page < 0x40) - es5506_reg_write_high(voice, offset / 4, chip->write_latch); - else - es5506_reg_write_test(offset / 4, chip->write_latch); - - /* clear the write latch when done */ - chip->write_latch = 0; -} - - -/********************************************************************************************** - - es5506_reg_read -- read from the specified ES5506 register - -***********************************************************************************************/ - -ES5506_INLINE UINT32 es5506_reg_read_low(es5506_voice *voice, UINT32 offset) -{ - UINT32 result = 0; - - switch (offset) - { - case 0x00/8: /* CR */ - result = voice->control; - break; - - case 0x08/8: /* FC */ - result = voice->freqcount; - break; - - case 0x10/8: /* LVOL */ - result = voice->lvol; - break; - - case 0x18/8: /* LVRAMP */ - result = voice->lvramp << 8; - break; - - case 0x20/8: /* RVOL */ - result = voice->rvol; - break; - - case 0x28/8: /* RVRAMP */ - result = voice->rvramp << 8; - break; - - case 0x30/8: /* ECOUNT */ - result = voice->ecount; - break; - - case 0x38/8: /* K2 */ - result = voice->k2; - break; - - case 0x40/8: /* K2RAMP */ - result = (voice->k2ramp << 8) | (voice->k2ramp >> 31); - break; - - case 0x48/8: /* K1 */ - result = voice->k1; - break; - - case 0x50/8: /* K1RAMP */ - result = (voice->k1ramp << 8) | (voice->k1ramp >> 31); - break; - - case 0x58/8: /* ACTV */ - result = chip->active_voices; - break; - - case 0x60/8: /* MODE */ - result = chip->mode; - break; - - case 0x68/8: /* PAR */ - if (chip->port_read) - result = (*chip->port_read)(); - break; - - case 0x70/8: /* IRQV */ - result = chip->irqv; - update_internal_irq_state(); - break; - - case 0x78/8: /* PAGE */ - result = chip->current_page; - break; - } - return result; -} - - -ES5506_INLINE UINT32 es5506_reg_read_high(es5506_voice *voice, UINT32 offset) -{ - UINT32 result = 0; - - switch (offset) - { - case 0x00/8: /* CR */ - result = voice->control; - break; - - case 0x08/8: /* START */ - result = voice->start; - break; - - case 0x10/8: /* END */ - result = voice->end; - break; - - case 0x18/8: /* ACCUM */ - result = voice->accum; - break; - - case 0x20/8: /* O4(n-1) */ - result = voice->o4n1 & 0x3ffff; - break; - - case 0x28/8: /* O3(n-1) */ - result = voice->o3n1 & 0x3ffff; - break; - - case 0x30/8: /* O3(n-2) */ - result = voice->o3n2 & 0x3ffff; - break; - - case 0x38/8: /* O2(n-1) */ - result = voice->o2n1 & 0x3ffff; - break; - - case 0x40/8: /* O2(n-2) */ - result = voice->o2n2 & 0x3ffff; - break; - - case 0x48/8: /* O1(n-1) */ - result = voice->o1n1 & 0x3ffff; - break; - - case 0x50/8: /* W_ST */ - result = chip->wst; - break; - - case 0x58/8: /* W_END */ - result = chip->wend; - break; - - case 0x60/8: /* LR_END */ - result = chip->lrend; - break; - - case 0x68/8: /* PAR */ - if (chip->port_read) - result = (*chip->port_read)(); - break; - - case 0x70/8: /* IRQV */ - result = chip->irqv; - update_internal_irq_state(); - break; - - case 0x78/8: /* PAGE */ - result = chip->current_page; - break; - } - return result; -} - -ES5506_INLINE UINT32 es5506_reg_read_test(UINT32 offset) -{ - UINT32 result = 0; - - switch (offset) - { - case 0x68/8: /* PAR */ - if (chip->port_read) - result = (*chip->port_read)(); - break; - - case 0x70/8: /* IRQV */ - result = chip->irqv; - break; - - case 0x78/8: /* PAGE */ - result = chip->current_page; - break; - } - return result; -} - -UINT8 ES5506Read(UINT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5506Read called without init\n")); -#endif - - es5506_voice *voice = &chip->voice[chip->current_page & 0x1f]; - INT32 shift = 8 * (offset & 3); - - /* only read on offset 0 */ - if (shift != 0) - return chip->read_latch >> (24 - shift); - - if (LOG_COMMANDS && eslog) - fprintf(eslog, "read from %02x/%02x -> ", chip->current_page, offset / 4 * 8); - - /* switch off the page and register */ - if (chip->current_page < 0x20) - chip->read_latch = es5506_reg_read_low(voice, offset / 4); - else if (chip->current_page < 0x40) - chip->read_latch = es5506_reg_read_high(voice, offset / 4); - else - chip->read_latch = es5506_reg_read_test(offset / 4); - - if (LOG_COMMANDS && eslog) - fprintf(eslog, "%08x\n", chip->read_latch); - - /* return the high byte */ - return chip->read_latch >> 24; -} - -void es5506_voice_bank_w(INT32 voice, INT32 bank) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("es5506_voice_bank_w called without init\n")); -#endif - - chip->voice[voice].exbank=bank; -} - - -/********************************************************************************************** - - DEVICE_START( es5505 ) -- start emulation of the ES5505 - -***********************************************************************************************/ - -void ES5505Init(INT32 clock, UINT8* region0, UINT8* region1, irq_callback callback) -{ - es5506_start_common(clock, region0, region1, NULL, NULL, callback, ES5505); -} - -/********************************************************************************************** - - es5505_reg_write -- handle a write to the selected ES5505 register - -***********************************************************************************************/ - -ES5506_INLINE void es5505_reg_write_low(es5506_voice *voice, UINT32 offset, UINT16 data) -{ - switch (offset) - { - case 0x00: /* CR */ -// if (ACCESSING_BITS_0_7) - { -#if RAINE_CHECK - voice->control &= ~(CONTROL_STOPMASK | CONTROL_LOOPMASK | CONTROL_DIR); -#else - voice->control &= ~(CONTROL_STOPMASK | CONTROL_BS0 | CONTROL_LOOPMASK | CONTROL_IRQE | CONTROL_DIR | CONTROL_IRQ); -#endif - voice->control |= (data & (CONTROL_STOPMASK | CONTROL_LOOPMASK | CONTROL_IRQE | CONTROL_DIR | CONTROL_IRQ)) | - ((data << 12) & CONTROL_BS0); - } -// if (ACCESSING_BITS_8_15) - { - voice->control &= ~(CONTROL_CA0 | CONTROL_CA1 | CONTROL_LPMASK); - voice->control |= ((data >> 2) & CONTROL_LPMASK) | - ((data << 2) & (CONTROL_CA0 | CONTROL_CA1)); - } - -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff); - break; - - case 0x01: /* FC */ -// if (ACCESSING_BITS_0_7) - voice->freqcount = (voice->freqcount & ~0x001fe) | ((data & 0x00ff) << 1); -// if (ACCESSING_BITS_8_15) - voice->freqcount = (voice->freqcount & ~0x1fe00) | ((data & 0xff00) << 1); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, freq count=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->freqcount); - break; - - case 0x02: /* STRT (hi) */ -// if (ACCESSING_BITS_0_7) - voice->start = (voice->start & ~0x03fc0000) | ((data & 0x00ff) << 18); -// if (ACCESSING_BITS_8_15) - voice->start = (voice->start & ~0x7c000000) | ((data & 0x1f00) << 18); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->start); - break; - - case 0x03: /* STRT (lo) */ -// if (ACCESSING_BITS_0_7) - if (data & 0xff) - voice->start = (voice->start & ~0x00000380) | ((data & 0x00e0) << 2); -// if (ACCESSING_BITS_8_15) - if (data & 0xff00) - voice->start = (voice->start & ~0x0003fc00) | ((data & 0xff00) << 2); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->start); - break; - - case 0x04: /* END (hi) */ -// if (ACCESSING_BITS_0_7) - voice->end = (voice->end & ~0x03fc0000) | ((data & 0x00ff) << 18); -// if (ACCESSING_BITS_8_15) - voice->end = (voice->end & ~0x7c000000) | ((data & 0x1f00) << 18); -#if RAINE_CHECK - voice->control |= CONTROL_STOP0; -#endif -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->end); - break; - - case 0x05: /* END (lo) */ -// if (ACCESSING_BITS_0_7) - voice->end = (voice->end & ~0x00000380) | ((data & 0x00e0) << 2); -// if (ACCESSING_BITS_8_15) - voice->end = (voice->end & ~0x0003fc00) | ((data & 0xff00) << 2); -#if RAINE_CHECK - voice->control |= CONTROL_STOP0; -#endif -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->end); - break; - - case 0x06: /* K2 */ -// if (ACCESSING_BITS_0_7) - voice->k2 = (voice->k2 & ~0x00f0) | (data & 0x00f0); -// if (ACCESSING_BITS_8_15) - voice->k2 = (voice->k2 & ~0xff00) | (data & 0xff00); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, K2=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->k2); - break; - - case 0x07: /* K1 */ -// if (ACCESSING_BITS_0_7) - voice->k1 = (voice->k1 & ~0x00f0) | (data & 0x00f0); -// if (ACCESSING_BITS_8_15) - voice->k1 = (voice->k1 & ~0xff00) | (data & 0xff00); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, K1=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->k1); - break; - - case 0x08: /* LVOL */ -// if (ACCESSING_BITS_8_15) - voice->lvol = (voice->lvol & ~0xff00) | (data & 0xff00); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, left vol=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->lvol); - break; - - case 0x09: /* RVOL */ -// if (ACCESSING_BITS_8_15) - voice->rvol = (voice->rvol & ~0xff00) | (data & 0xff00); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, right vol=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->rvol); - break; - - case 0x0a: /* ACC (hi) */ -// if (ACCESSING_BITS_0_7) - voice->accum = (voice->accum & ~0x03fc0000) | ((data & 0x00ff) << 18); -// if (ACCESSING_BITS_8_15) - voice->accum = (voice->accum & ~0x7c000000) | ((data & 0x1f00) << 18); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, accum=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->accum); - break; - - case 0x0b: /* ACC (lo) */ -// if (ACCESSING_BITS_0_7) - voice->accum = (voice->accum & ~0x000003fc) | ((data & 0x00ff) << 2); -// if (ACCESSING_BITS_8_15) - voice->accum = (voice->accum & ~0x0003fc00) | ((data & 0xff00) << 2); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, accum=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->accum); - break; - - case 0x0c: /* unused */ - break; - - case 0x0d: /* ACT */ -// if (ACCESSING_BITS_0_7) - { - chip->active_voices = data & 0x1f; - chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1)); -// chip->stream->set_sample_rate(chip->sample_rate); - -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "active voices=%d, sample_rate=%d\n", chip->active_voices, chip->sample_rate); - } - break; - - case 0x0e: /* IRQV - read only */ - break; - - case 0x0f: /* PAGE */ -// if (ACCESSING_BITS_0_7) - chip->current_page = data & 0x7f; - break; - } -} - - -ES5506_INLINE void es5505_reg_write_high(es5506_voice *voice, UINT32 offset, UINT16 data) -{ - switch (offset) - { - case 0x00: /* CR */ -// if (ACCESSING_BITS_0_7) - { - voice->control &= ~(CONTROL_STOPMASK | CONTROL_BS0 | CONTROL_LOOPMASK | CONTROL_IRQE | CONTROL_DIR | CONTROL_IRQ); - voice->control |= (data & (CONTROL_STOPMASK | CONTROL_LOOPMASK | CONTROL_IRQE | CONTROL_DIR | CONTROL_IRQ)) | - ((data << 12) & CONTROL_BS0); - } -// if (ACCESSING_BITS_8_15) - { - voice->control &= ~(CONTROL_CA0 | CONTROL_CA1 | CONTROL_LPMASK); - voice->control |= ((data >> 2) & CONTROL_LPMASK) | - ((data << 2) & (CONTROL_CA0 | CONTROL_CA1)); - } -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask); - break; - - case 0x01: /* O4(n-1) */ -// if (ACCESSING_BITS_0_7) - voice->o4n1 = (voice->o4n1 & ~0x00ff) | (data & 0x00ff); -// if (ACCESSING_BITS_8_15) - voice->o4n1 = (INT16)((voice->o4n1 & ~0xff00) | (data & 0xff00)); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, O4(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff); - break; - - case 0x02: /* O3(n-1) */ -// if (ACCESSING_BITS_0_7) - voice->o3n1 = (voice->o3n1 & ~0x00ff) | (data & 0x00ff); -// if (ACCESSING_BITS_8_15) - voice->o3n1 = (INT16)((voice->o3n1 & ~0xff00) | (data & 0xff00)); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, O3(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff); - break; - - case 0x03: /* O3(n-2) */ -// if (ACCESSING_BITS_0_7) - voice->o3n2 = (voice->o3n2 & ~0x00ff) | (data & 0x00ff); -// if (ACCESSING_BITS_8_15) - voice->o3n2 = (INT16)((voice->o3n2 & ~0xff00) | (data & 0xff00)); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, O3(n-2)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff); - break; - - case 0x04: /* O2(n-1) */ -// if (ACCESSING_BITS_0_7) - voice->o2n1 = (voice->o2n1 & ~0x00ff) | (data & 0x00ff); -// if (ACCESSING_BITS_8_15) - voice->o2n1 = (INT16)((voice->o2n1 & ~0xff00) | (data & 0xff00)); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, O2(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff); - break; - - case 0x05: /* O2(n-2) */ -// if (ACCESSING_BITS_0_7) - voice->o2n2 = (voice->o2n2 & ~0x00ff) | (data & 0x00ff); -// if (ACCESSING_BITS_8_15) - voice->o2n2 = (INT16)((voice->o2n2 & ~0xff00) | (data & 0xff00)); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, O2(n-2)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff); - break; - - case 0x06: /* O1(n-1) */ -// if (ACCESSING_BITS_0_7) - voice->o1n1 = (voice->o1n1 & ~0x00ff) | (data & 0x00ff); -// if (ACCESSING_BITS_8_15) - voice->o1n1 = (INT16)((voice->o1n1 & ~0xff00) | (data & 0xff00)); -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum); - break; - - case 0x07: - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: - case 0x0c: /* unused */ - break; - - case 0x0d: /* ACT */ -// if (ACCESSING_BITS_0_7) - { - chip->active_voices = data & 0x1f; - chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1)); -// chip->stream->set_sample_rate(chip->sample_rate); - -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "active voices=%d, sample_rate=%d\n", chip->active_voices, chip->sample_rate); - } - break; - - case 0x0e: /* IRQV - read only */ - break; - - case 0x0f: /* PAGE */ -// if (ACCESSING_BITS_0_7) - chip->current_page = data & 0x7f; - break; - } -} - - -ES5506_INLINE void es5505_reg_write_test(UINT32 offset, UINT16 data) -{ - switch (offset) - { - case 0x00: /* CH0L */ - case 0x01: /* CH0R */ - case 0x02: /* CH1L */ - case 0x03: /* CH1R */ - case 0x04: /* CH2L */ - case 0x05: /* CH2R */ - case 0x06: /* CH3L */ - case 0x07: /* CH3R */ - break; - - case 0x08: /* SERMODE */ - chip->mode = data & 0x0007; - break; - - case 0x09: /* PAR */ - break; - - case 0x0d: /* ACT */ -// if (ACCESSING_BITS_0_7) - { - chip->active_voices = data & 0x1f; - chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1)); - -// if (LOG_COMMANDS && eslog) -// fprintf(eslog, "active voices=%d, sample_rate=%d\n", chip->active_voices, chip->sample_rate); - } - break; - - case 0x0e: /* IRQV - read only */ - break; - - case 0x0f: /* PAGE */ -// if (ACCESSING_BITS_0_7) - chip->current_page = data & 0x7f; - break; - } -} - - -void ES5505Write(UINT32 offset, UINT16 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5505Write called without init\n")); -#endif - - es5506_voice *voice = &chip->voice[chip->current_page & 0x1f]; - -// logerror("%s:ES5505 write %02x/%02x = %04x & %04x\n", machine->describe_context(), chip->current_page, offset, data, mem_mask); - - /* switch off the page and register */ - if (chip->current_page < 0x20) - es5505_reg_write_low(voice, offset, data); - else if (chip->current_page < 0x40) - es5505_reg_write_high(voice, offset, data); - else - es5505_reg_write_test(offset, data); -} - - - -/********************************************************************************************** - - es5505_reg_read -- read from the specified ES5505 register - -***********************************************************************************************/ - -ES5506_INLINE UINT16 es5505_reg_read_low(es5506_voice *voice, UINT32 offset) -{ - UINT16 result = 0; - - switch (offset) - { - case 0x00: /* CR */ - result = (voice->control & (CONTROL_STOPMASK | CONTROL_LOOPMASK | CONTROL_IRQE | CONTROL_DIR | CONTROL_IRQ)) | - ((voice->control & CONTROL_BS0) >> 12) | - ((voice->control & CONTROL_LPMASK) << 2) | - ((voice->control & (CONTROL_CA0 | CONTROL_CA1)) >> 2) | - 0xf000; - break; - - case 0x01: /* FC */ - result = voice->freqcount >> 1; - break; - - case 0x02: /* STRT (hi) */ - result = voice->start >> 18; - break; - - case 0x03: /* STRT (lo) */ - result = voice->start >> 2; - break; - - case 0x04: /* END (hi) */ - result = voice->end >> 18; - break; - - case 0x05: /* END (lo) */ - result = voice->end >> 2; - break; - - case 0x06: /* K2 */ - result = voice->k2; - break; - - case 0x07: /* K1 */ - result = voice->k1; - break; - - case 0x08: /* LVOL */ - result = voice->lvol; - break; - - case 0x09: /* RVOL */ - result = voice->rvol; - break; - - case 0x0a: /* ACC (hi) */ - result = voice->accum >> 18; - break; - - case 0x0b: /* ACC (lo) */ - result = voice->accum >> 2; - break; - - case 0x0c: /* unused */ - break; - - case 0x0d: /* ACT */ - result = chip->active_voices; - break; - - case 0x0e: /* IRQV */ - result = chip->irqv; - update_internal_irq_state(); - break; - - case 0x0f: /* PAGE */ - result = chip->current_page; - break; - } - return result; -} - - -ES5506_INLINE UINT16 es5505_reg_read_high(es5506_voice *voice, UINT32 offset) -{ - UINT16 result = 0; - - switch (offset) - { - case 0x00: /* CR */ - result = (voice->control & (CONTROL_STOPMASK | CONTROL_LOOPMASK | CONTROL_IRQE | CONTROL_DIR | CONTROL_IRQ)) | - ((voice->control & CONTROL_BS0) >> 12) | - ((voice->control & CONTROL_LPMASK) << 2) | - ((voice->control & (CONTROL_CA0 | CONTROL_CA1)) >> 2) | - 0xf000; - break; - - case 0x01: /* O4(n-1) */ - result = voice->o4n1; - break; - - case 0x02: /* O3(n-1) */ - result = voice->o3n1; - break; - - case 0x03: /* O3(n-2) */ - result = voice->o3n2; - break; - - case 0x04: /* O2(n-1) */ - result = voice->o2n1; - break; - - case 0x05: /* O2(n-2) */ - result = voice->o2n2; - break; - - case 0x06: /* O1(n-1) */ - /* special case for the Taito F3 games: they set the accumulator on a stopped */ - /* voice and assume the filters continue to process the data. They then read */ - /* the O1(n-1) in order to extract raw data from the sound ROMs. Since we don't */ - /* want to waste time filtering stopped channels, we just look for a read from */ - /* this register on a stopped voice, and return the raw sample data at the */ - /* accumulator */ - if ((voice->control & CONTROL_STOPMASK) && chip->region_base[voice->control >> 14]) { - voice->o1n1 = chip->region_base[voice->control >> 14][voice->exbank + (voice->accum >> 11)]; -// logerror("%02x %08x ==> %08x\n",voice->o1n1,voice->control >> 14,voice->exbank + (voice->accum >> 11)); - } - result = voice->o1n1; - break; - - case 0x07: - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: - case 0x0c: /* unused */ - break; - - case 0x0d: /* ACT */ - result = chip->active_voices; - break; - - case 0x0e: /* IRQV */ - result = chip->irqv; - update_internal_irq_state(); - break; - - case 0x0f: /* PAGE */ - result = chip->current_page; - break; - } - return result; -} - - -ES5506_INLINE UINT16 es5505_reg_read_test(UINT32 offset) -{ - UINT16 result = 0; - - switch (offset) - { - case 0x00: /* CH0L */ - case 0x01: /* CH0R */ - case 0x02: /* CH1L */ - case 0x03: /* CH1R */ - case 0x04: /* CH2L */ - case 0x05: /* CH2R */ - case 0x06: /* CH3L */ - case 0x07: /* CH3R */ - break; - - case 0x08: /* SERMODE */ - result = chip->mode; - break; - - case 0x09: /* PAR */ - if (chip->port_read) - result = (*chip->port_read)(); - break; - - case 0x0f: /* PAGE */ - result = chip->current_page; - break; - } - return result; -} - - -UINT16 ES5505Read(UINT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("ES5505Read called without init\n")); -#endif - - es5506_voice *voice = &chip->voice[chip->current_page & 0x1f]; - UINT16 result = 0; - - if (LOG_COMMANDS && eslog) - fprintf(eslog, "read from %02x/%02x -> ", chip->current_page, offset); - - /* switch off the page and register */ - if (chip->current_page < 0x20) - result = es5505_reg_read_low(voice, offset); - else if (chip->current_page < 0x40) - result = es5505_reg_read_high(voice, offset); - else - result = es5505_reg_read_test(offset); - - if (LOG_COMMANDS && eslog) - fprintf(eslog, "%04x (accum=%08x)\n", result, voice->accum); - - /* return the high byte */ - return result; -} - - - -void es5505_voice_bank_w(INT32 voice, INT32 bank) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES5506Initted) bprintf(PRINT_ERROR, _T("es5505_voice_bank_w called without init\n")); -#endif - -#if RAINE_CHECK - chip->voice[voice].control = CONTROL_STOPMASK; -#endif - chip->voice[voice].exbank=bank; -} - - -#if 0 - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -DEVICE_GET_INFO( es5505 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(es5506_state); break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( es5505 ); break; - case DEVINFO_FCT_STOP: info->stop = DEVICE_STOP_NAME( es5505 ); break; - case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME( es5505 ); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "ES5505"); break; - case DEVINFO_STR_FAMILY: strcpy(info->s, "Ensoniq Wavetable"); break; - case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; - case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; - case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; - } -} - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -DEVICE_GET_INFO( es5506 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(es5506_state); break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( es5506 ); break; - case DEVINFO_FCT_STOP: info->stop = DEVICE_STOP_NAME( es5506 ); break; - case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME( es5506 ); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "ES5506"); break; - case DEVINFO_STR_FAMILY: strcpy(info->s, "Ensoniq Wavetable"); break; - case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; - case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; - case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; - } -} - - -DEFINE_LEGACY_SOUND_DEVICE(ES5505, es5505); -DEFINE_LEGACY_SOUND_DEVICE(ES5506, es5506); -#endif diff --git a/jan/src/burn/snd/es5506.h b/jan/src/burn/snd/es5506.h deleted file mode 100644 index d0ddf7834..000000000 --- a/jan/src/burn/snd/es5506.h +++ /dev/null @@ -1,58 +0,0 @@ -/********************************************************************************************** - * - * Ensoniq ES5505/6 driver - * by Aaron Giles - * - **********************************************************************************************/ - -#ifndef __ES5506_H__ -#define __ES5506_H__ - -typedef void (*irq_callback)(INT32 param); -typedef UINT16(port_read)(); - -typedef struct _es5505_interface es5505_interface; -struct _es5505_interface -{ - const INT8 * region0; /* memory region where the sample ROM lives */ - const INT8 * region1; /* memory region where the sample ROM lives */ - void (*irq_callback)(INT32 state); /* irq callback */ - UINT16 (*read_port)(); /* input port read */ -}; - -typedef struct _es5506_interface es5506_interface; -struct _es5506_interface -{ - const INT8 * region0; /* memory region where the sample ROM lives */ - const INT8 * region1; /* memory region where the sample ROM lives */ - const INT8 * region2; /* memory region where the sample ROM lives */ - const INT8 * region3; /* memory region where the sample ROM lives */ - void (*irq_callback)(INT32 state); /* irq callback */ - UINT16 (*read_port)(); /* input port read */ -}; - -extern INT32 ES550X_twincobra2_pan_fix; - -void ES5506Update(INT16 *pBuffer, INT32 samples); -#define ES5505Update ES5506Update -void ES5506Init(INT32 clock, UINT8 *region0, UINT8 *region1, UINT8 *region2, UINT8 *region3, irq_callback callback); -void ES5506Exit(); -void ES5506Reset(); -void ES5506Write(UINT32 offset, UINT8 data); -UINT8 ES5506Read(UINT32 offset); -void es5506_voice_bank_w(INT32 voice, INT32 bank); -void ES5505Init(INT32 clock, UINT8 *region0, UINT8* region1, irq_callback callback); -#define ES5505Reset ES5506Reset -#define ES5505Exit ES5506Exit -void ES5505Write(UINT32 offset, UINT16 data); -UINT16 ES5505Read(UINT32 offset); -void es5505_voice_bank_w(INT32 voice, INT32 bank); -void ES5506Scan(INT32 nAction, INT32* pnMin); -void ES5506ScanRoutes(INT32 nAction, INT32* pnMin); - -void ES5506SetRoute(INT32 chip /*always 0*/, double nVolume, INT32 nRoute); -#define BURN_SND_ES5506_ROUTE_LEFT 1 -#define BURN_SND_ES5506_ROUTE_RIGHT 2 -#define BURN_SND_ES5506_ROUTE_BOTH 3 - -#endif /* __ES5506_H__ */ diff --git a/jan/src/burn/snd/es8712.cpp b/jan/src/burn/snd/es8712.cpp deleted file mode 100644 index dc88bd30d..000000000 --- a/jan/src/burn/snd/es8712.cpp +++ /dev/null @@ -1,474 +0,0 @@ -/********************************************************************************************** - * - * Streaming singe channel ADPCM core for the ES8712 chip - * Chip is branded by Excellent Systems, probably OEM'd. - * - * Samples are currently looped, but whether they should and how, is unknown. - * Interface to the chip is also not 100% clear. - * Should there be any status signals signifying busy, end of sample - etc? - * - * Heavily borrowed from the OKI M6295 source - * - * Excellent Systems ADPCM Emulation - * Copyright Nicola Salmoria and the MAME Team - * - * From MAME 0.139u1. Modified for use in FBA Aug 23, 2010. - * - **********************************************************************************************/ - -#include "burnint.h" -#include "math.h" -#include "es8712.h" - -#define MAX_ES8712_CHIPS 1 - -#define MAX_SAMPLE_CHUNK 10000 - -/* struct describing a playing ADPCM chip */ -typedef struct _es8712_state es8712_state; -struct _es8712_state -{ - UINT8 playing; /* 1 if we're actively playing */ - - UINT32 base_offset; /* pointer to the base memory location */ - UINT32 sample; /* current sample number */ - UINT32 count; /* total samples to play */ - - UINT32 signal; /* current ADPCM signal */ - UINT32 step; /* current ADPCM step */ - - UINT32 start; /* starting address for the next loop */ - UINT32 end; /* ending address for the next loop */ - UINT8 repeat; /* Repeat current sample when 1 */ - - INT32 bank_offset; - -// non volatile - UINT8 *region_base; /* pointer to the base of the region */ - - INT32 sample_rate; /* samples per frame */ - double volume; /* set gain */ - INT32 output_dir; - INT32 addSignal; /* add signal to stream? */ -}; - -static INT16 *tbuf[MAX_ES8712_CHIPS] = { NULL }; - -static _es8712_state chips[MAX_ES8712_CHIPS]; -static _es8712_state *chip; - -static const INT32 index_shift[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; -static INT32 diff_lookup[49*16]; - -/********************************************************************************************** - - compute_tables -- compute the difference tables - -***********************************************************************************************/ - -static void compute_tables() -{ - /* nibble to bit map */ - static const INT32 nbl2bit[16][4] = - { - { 1, 0, 0, 0}, { 1, 0, 0, 1}, { 1, 0, 1, 0}, { 1, 0, 1, 1}, - { 1, 1, 0, 0}, { 1, 1, 0, 1}, { 1, 1, 1, 0}, { 1, 1, 1, 1}, - {-1, 0, 0, 0}, {-1, 0, 0, 1}, {-1, 0, 1, 0}, {-1, 0, 1, 1}, - {-1, 1, 0, 0}, {-1, 1, 0, 1}, {-1, 1, 1, 0}, {-1, 1, 1, 1} - }; - - INT32 step, nib; - - /* loop over all possible steps */ - for (step = 0; step <= 48; step++) - { - /* compute the step value */ - INT32 stepval = (INT32)(floor(16.0 * pow(11.0 / 10.0, (double)step))); - - /* loop over all nibbles and compute the difference */ - for (nib = 0; nib < 16; nib++) - { - diff_lookup[step*16 + nib] = nbl2bit[nib][0] * - (stepval * nbl2bit[nib][1] + - stepval/2 * nbl2bit[nib][2] + - stepval/4 * nbl2bit[nib][3] + - stepval/8); - } - } -} - - -/********************************************************************************************** - - generate_adpcm -- general ADPCM decoding routine - -***********************************************************************************************/ - -static void generate_adpcm(INT16 *buffer, INT32 samples) -{ - /* if this chip is active */ - if (chip->playing) - { - UINT8 *base = chip->region_base + chip->bank_offset + chip->base_offset; - INT32 sample = chip->sample; - INT32 signal = chip->signal; - INT32 count = chip->count; - INT32 step = chip->step; - double volume = chip->volume; - INT32 val; - - /* loop while we still have samples to generate */ - while (samples) - { - /* compute the new amplitude and update the current step */ - val = base[sample / 2] >> (((sample & 1) << 2) ^ 4); - signal += diff_lookup[step * 16 + (val & 15)]; - - /* clamp to the maximum */ - if (signal > 2047) - signal = 2047; - else if (signal < -2048) - signal = -2048; - - /* adjust the step size and clamp */ - step += index_shift[val & 7]; - if (step > 48) - step = 48; - else if (step < 0) - step = 0; - - /* output to the buffer */ - *buffer++ = (INT32)(signal * 16 * volume); - samples--; - - /* next! */ - if (++sample >= count) - { - if (chip->repeat) - { - sample = 0; - signal = -2; - step = 0; - } - else - { - chip->playing = 0; - break; - } - } - } - - /* update the parameters */ - chip->sample = sample; - chip->signal = signal; - chip->step = step; - } - - /* fill the rest with silence */ - while (samples--) - *buffer++ = 0; -} - - -/********************************************************************************************** - - es8712Update -- update the sound chip so that it is in sync with CPU execution - -***********************************************************************************************/ - -void es8712Update(INT32 device, INT16 *buffer, INT32 samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES8712Initted) bprintf(PRINT_ERROR, _T("es8712Update called without init\n")); -#endif - - if (device >= MAX_ES8712_CHIPS) return; - - chip = &chips[device]; - - INT32 sample_num = (INT32)((float)(((samples / nBurnSoundLen) * 1.0000) * chip->sample_rate)); - - float step = ((chip->sample_rate * 1.00000) / nBurnSoundLen); - - INT16 *buf = tbuf[device]; - - generate_adpcm(buf, sample_num); - - float r = 0; - for (INT32 i = 0; i < samples; i++, r += step, buffer+=2) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((chip->output_dir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(buf[(INT32)r] * chip->volume); - } - if ((chip->output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(buf[(INT32)r] * chip->volume); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (chip->addSignal) { - buffer[0] += nLeftSample; - buffer[1] += nRightSample; - } else { - buffer[0] = nLeftSample; - buffer[1] = nRightSample; - } - } - -} - - -/********************************************************************************************** - - es8712Init -- start emulation of an ES8712 chip - -***********************************************************************************************/ - -void es8712Init(INT32 device, UINT8 *rom, INT32 sample_rate, INT32 addSignal) -{ - DebugSnd_ES8712Initted = 1; - - if (device >= MAX_ES8712_CHIPS) return; - - chip = &chips[device]; - - compute_tables(); - - chip->start = 0; - chip->end = 0; - chip->repeat = 0; - - chip->bank_offset = 0; - chip->region_base = (UINT8*)rom; - - /* initialize the rest of the structure */ - chip->signal = (UINT32)-2; - - chip->sample_rate = sample_rate; - - chip->volume = 1.00; - chip->output_dir = BURN_SND_ROUTE_BOTH; - chip->addSignal = addSignal; - - if (tbuf[device] == NULL) { - tbuf[device] = (INT16*)BurnMalloc(sample_rate * sizeof(INT16)); - } -} - -void es8712SetRoute(INT32 device, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES8712Initted) bprintf(PRINT_ERROR, _T("es8712SetRoute called without init\n")); -#endif - - if (device >= MAX_ES8712_CHIPS) return; - - chip = &chips[device]; - chip->volume = nVolume; - chip->output_dir = nRouteDir; -} - -/********************************************************************************************** - - es8712Exit -- stop emulation of an ES8712 chip - -***********************************************************************************************/ - -void es8712Exit(INT32 device) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES8712Initted) bprintf(PRINT_ERROR, _T("es8712Exit called without init\n")); -#endif - - if (!DebugSnd_ES8712Initted) return; - - if (device >= MAX_ES8712_CHIPS) return; - - chip = &chips[device]; - - memset (chip, 0, sizeof(_es8712_state)); - - BurnFree (tbuf[device]); - - DebugSnd_ES8712Initted = 0; -} - -/************************************************************************************* - - es8712Reset -- stop emulation of an ES8712-compatible chip - -**************************************************************************************/ - -void es8712Reset(INT32 device) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES8712Initted) bprintf(PRINT_ERROR, _T("es8712Reset called without init\n")); -#endif - - if (device >= MAX_ES8712_CHIPS) return; - - chip = &chips[device]; - - if (chip->playing) - { - /* update the stream, then turn it off */ - chip->playing = 0; - chip->repeat = 0; - } -} - - -/**************************************************************************** - - es8712_set_bank_base -- set the base of the bank on a given chip - -*****************************************************************************/ - -void es8712SetBankBase(INT32 device, INT32 base) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES8712Initted) bprintf(PRINT_ERROR, _T("es8712SetBankBase called without init\n")); -#endif - - if (device >= MAX_ES8712_CHIPS) return; - - chip = &chips[device]; - - chip->bank_offset = base; -} - - -/********************************************************************************************** - - es8712Play -- Begin playing the addressed sample - -***********************************************************************************************/ - -void es8712Play(INT32 device) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES8712Initted) bprintf(PRINT_ERROR, _T("es8712Play called without init\n")); -#endif - - if (device >= MAX_ES8712_CHIPS) return; - - chip = &chips[device]; - - if (chip->start < chip->end) - { - if (!chip->playing) - { - chip->playing = 1; - chip->base_offset = chip->start; - chip->sample = 0; - chip->count = 2 * (chip->end - chip->start + 1); - chip->repeat = 0;//1; - - /* also reset the ADPCM parameters */ - chip->signal = (UINT32)-2; - chip->step = 0; - } - } - /* invalid samples go here */ - else - { - if (chip->playing) - { - /* update the stream */ - chip->playing = 0; - } - } -} - - -/********************************************************************************************** - - es8712Write -- generic data write function - -***********************************************************************************************/ - -/********************************************************************************************** - * - * offset Start End - * 0hmmll - 0HMMLL - * 00 ----ll - * 01 --mm-- - * 02 0h---- - * 03 ----LL - * 04 --MM-- - * 05 0H---- - * 06 Go! - * - * Offsets are written in the order -> 00, 02, 01, 03, 05, 04, 06 - * Offset 06 is written with the same value as offset 04. - * -***********************************************************************************************/ - -void es8712Write(INT32 device, INT32 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES8712Initted) bprintf(PRINT_ERROR, _T("es8712Write called without init\n")); -#endif - - if (device >= MAX_ES8712_CHIPS) return; - - chip = &chips[device]; - - switch (offset) - { - case 00: chip->start &= 0x000fff00; - chip->start |= ((data & 0xff) << 0); break; - case 01: chip->start &= 0x000f00ff; - chip->start |= ((data & 0xff) << 8); break; - case 02: chip->start &= 0x0000ffff; - chip->start |= ((data & 0x0f) << 16); break; - case 03: chip->end &= 0x000fff00; - chip->end |= ((data & 0xff) << 0); break; - case 04: chip->end &= 0x000f00ff; - chip->end |= ((data & 0xff) << 8); break; - case 05: chip->end &= 0x0000ffff; - chip->end |= ((data & 0x0f) << 16); break; - case 06: - es8712Play(device); - break; - default: break; - } - - chip->start &= 0xfffff; - chip->end &= 0xfffff; -} - - -/********************************************************************************************** - - es8712Scan -- save state function - -***********************************************************************************************/ - -INT32 es8712Scan(INT32 device, INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ES8712Initted) bprintf(PRINT_ERROR, _T("es8712Scan called without init\n")); -#endif - - if (device >= MAX_ES8712_CHIPS) return 1; - - if (nAction & ACB_DRIVER_DATA) { - chip = &chips[device]; - - SCAN_VAR(chip->playing); - SCAN_VAR(chip->base_offset); - SCAN_VAR(chip->sample); - SCAN_VAR(chip->count); - SCAN_VAR(chip->signal); - SCAN_VAR(chip->step); - SCAN_VAR(chip->start); - SCAN_VAR(chip->end); - SCAN_VAR(chip->repeat); - SCAN_VAR(chip->bank_offset); - } - - return 0; -} diff --git a/jan/src/burn/snd/es8712.h b/jan/src/burn/snd/es8712.h deleted file mode 100644 index b75d2166e..000000000 --- a/jan/src/burn/snd/es8712.h +++ /dev/null @@ -1,12 +0,0 @@ -void es8712Write(INT32 device, INT32 offset, UINT8 data); -void es8712Play(INT32 device); - -void es8712SetBankBase(INT32 device, INT32 base); - -void es8712Init(INT32 device, UINT8 *rom, INT32 sample_rate, INT32 addSignal); -void es8712SetRoute(INT32 device, double nVolume, INT32 nRouteDir); -void es8712Reset(INT32 device); -void es8712Update(INT32 device, INT16 *buffer, INT32 samples); -void es8712Exit(INT32 device); - -INT32 es8712Scan(INT32 device, INT32 nAction); diff --git a/jan/src/burn/snd/flt_rc.cpp b/jan/src/burn/snd/flt_rc.cpp deleted file mode 100644 index 1fce89379..000000000 --- a/jan/src/burn/snd/flt_rc.cpp +++ /dev/null @@ -1,275 +0,0 @@ -// Based on MAME driver by Derrick Renaud, Couriersud - -#include "burnint.h" -#include "burn_sound.h" -#include "flt_rc.h" - -#include - -#define FLT_RC_NUM 16 - -struct flt_rc_info -{ - INT32 type; - double R1; - double R2; - double R3; - double C; - - struct { - INT32 k; - INT32 memory; - INT32 type; - } state; - - double src_gain; - double gain; - INT32 src_stereo; - INT32 output_dir; - INT32 add_signal; -}; - -static struct flt_rc_info flt_rc_table[FLT_RC_NUM]; - -static INT32 num_filters; - -void filter_rc_update(INT32 num, INT16 *src, INT16 *pSoundBuf, INT32 length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_FilterRCInitted) bprintf(PRINT_ERROR, _T("filter_rc_update called without init\n")); - if (num > num_filters) bprintf(PRINT_ERROR, _T("filter_rc_update called with invalid num %i\n"), num); -#endif - - struct flt_rc_info *ptr; - - ptr = &flt_rc_table[num]; - - INT32 memory = ptr->state.memory; - INT16 value; - - switch (ptr->state.type) { - case FLT_RC_LOWPASS: { - while (length--) { - if (ptr->state.k == 0x10000) { - memory = (INT32)(*src++ * ptr->src_gain); // filter disabled - } else { - memory += (((INT32)((*src++ * ptr->src_gain)) - memory) * ptr->state.k) / 0x10000; // enabled - } - - if (ptr->src_stereo) src++; - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((ptr->output_dir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(memory * ptr->gain); - } - - if ((ptr->output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(memory * ptr->gain); - } - - if (ptr->output_dir & (FLT_RC_PANNEDLEFT + FLT_RC_PANNEDRIGHT)) { // panned slightly right or left (used in gyruss) - nLeftSample += (INT32)(memory * ((ptr->output_dir & FLT_RC_PANNEDRIGHT) ? (ptr->gain / 3) : (ptr->gain))); - nRightSample += (INT32)(memory * ((ptr->output_dir & FLT_RC_PANNEDLEFT ) ? (ptr->gain / 3) : (ptr->gain))); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (ptr->add_signal) { - // March 28, 2014: Clipping is still possible when using pSoundBuf[x] += n[l/r]Sample; - dink - pSoundBuf[0] = BURN_SND_CLIP(pSoundBuf[0] + nLeftSample); - pSoundBuf[1] = BURN_SND_CLIP(pSoundBuf[1] + nRightSample); - } else { - pSoundBuf[0] = nLeftSample; - pSoundBuf[1] = nRightSample; - } - pSoundBuf += 2; - } - break; - } - - case FLT_RC_HIGHPASS: - case FLT_RC_AC: { - while (length--) { - if (ptr->state.k == 0x0) { - value = (INT32)(*src * ptr->src_gain); // filter disabled - } else { - value = (INT32)(*src * ptr->src_gain) - memory; // enabled - } - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((ptr->output_dir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(value * ptr->gain); - } - - if ((ptr->output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(value * ptr->gain); - } - - if (ptr->output_dir & (FLT_RC_PANNEDLEFT + FLT_RC_PANNEDRIGHT)) { // panned slightly right or left (used in gyruss) - nLeftSample += (INT32)(value * ((ptr->output_dir & FLT_RC_PANNEDRIGHT) ? (ptr->gain / 3) : (ptr->gain))); - nRightSample += (INT32)(value * ((ptr->output_dir & FLT_RC_PANNEDLEFT ) ? (ptr->gain / 3) : (ptr->gain))); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (ptr->add_signal) { - // March 28, 2014: Clipping is still possible when using pSoundBuf[x] += n[l/r]Sample; - dink - pSoundBuf[0] = BURN_SND_CLIP(pSoundBuf[0] + nLeftSample); - pSoundBuf[1] = BURN_SND_CLIP(pSoundBuf[1] + nRightSample); - } else { - pSoundBuf[0] = nLeftSample; - pSoundBuf[1] = nRightSample; - } - pSoundBuf += 2; - memory += (((INT32)(*src++ * ptr->src_gain) - memory) * ptr->state.k) / 0x10000; - if (ptr->src_stereo) src++; - } - break; - } - } - - ptr->state.memory = memory; -} - -static void set_RC_info(INT32 num, INT32 type, double R1, double R2, double R3, double C) -{ - double Req = 0.00; - - struct flt_rc_info *ptr; - - ptr = &flt_rc_table[num]; - - ptr->state.type = type; - - switch (ptr->state.type) { - case FLT_RC_LOWPASS: { - if (C == 0.0) { - /* filter disabled */ - ptr->state.k = 0x10000; - return; - } - Req = (R1 * (R2 + R3)) / (R1 + R2 + R3); - break; - } - - case FLT_RC_HIGHPASS: - case FLT_RC_AC: { - if (C == 0.0) { - /* filter disabled */ - ptr->state.k = 0x0; - ptr->state.memory = 0x0; - return; - } - Req = R1; - break; - } - - default: - bprintf(PRINT_IMPORTANT, _T("filter_rc_setRC: Wrong filter type %d\n"), ptr->state.type); - } - - /* Cut Frequency = 1/(2*Pi*Req*C) */ - /* k = (1-(EXP(-TIMEDELTA/RC))) */ - ptr->state.k = (INT32)(0x10000 - 0x10000 * (exp(-1 / (Req * C) / nBurnSoundRate))); -} - -void filter_rc_set_RC(INT32 num, INT32 type, double R1, double R2, double R3, double C) -{ -#if defined FBA_DEBUG - if (!DebugSnd_FilterRCInitted) bprintf(PRINT_ERROR, _T("filter_rc_set_RC called without init\n")); - if (num > num_filters) bprintf(PRINT_ERROR, _T("filter_rc_set_RC called with invalid num %i\n"), num); -#endif - - set_RC_info(num, type, R1, R2, R3, C); -} - -void filter_rc_init(INT32 num, INT32 type, double R1, double R2, double R3, double C, INT32 add_signal) -{ -#if defined FBA_DEBUG - if (num >= FLT_RC_NUM) bprintf (PRINT_ERROR, _T("filter_rc_init called for too many chips (%d)! Change FLT_RC_NUM (%d)!\n"), num, FLT_RC_NUM); -#endif - - DebugSnd_FilterRCInitted = 1; - - num_filters = num + 1; - - set_RC_info(num, type, R1, R2, R3, C); - - struct flt_rc_info *ptr; - - ptr = &flt_rc_table[num]; - - ptr->src_gain = 1.00; - ptr->src_stereo = 0; // mostly used with ay8910 mono input, so default to off for stereo - ptr->gain = 1.00; - ptr->output_dir = BURN_SND_ROUTE_BOTH; - ptr->add_signal = add_signal; -} - -void filter_rc_set_src_gain(INT32 num, double gain) -{ -#if defined FBA_DEBUG - if (!DebugSnd_FilterRCInitted) bprintf(PRINT_ERROR, _T("filter_rc_set_src_gain called without init\n")); - if (num > num_filters) bprintf(PRINT_ERROR, _T("filter_rc_set_src_gain called with invalid num %i\n"), num); -#endif - - struct flt_rc_info *ptr; - - ptr = &flt_rc_table[num]; - - ptr->src_gain = gain; -} - -void filter_rc_set_src_stereo(INT32 num) -{ // allows for processing a mono (but stereo) stream -#if defined FBA_DEBUG - if (!DebugSnd_FilterRCInitted) bprintf(PRINT_ERROR, _T("filter_rc_set_src_stereo called without init\n")); - if (num > num_filters) bprintf(PRINT_ERROR, _T("filter_rc_set_src_stereo called with invalid num %i\n"), num); -#endif - - struct flt_rc_info *ptr; - - ptr = &flt_rc_table[num]; - - ptr->src_stereo = 1; -} - -void filter_rc_set_route(INT32 num, double nVolume, INT32 nRouteDir) -{ - #if defined FBA_DEBUG - if (!DebugSnd_FilterRCInitted) bprintf(PRINT_ERROR, _T("filter_rc_set_route called without init\n")); - if (num > num_filters) bprintf(PRINT_ERROR, _T("filter_rc_set_route called with invalid num %i\n"), num); -#endif - - struct flt_rc_info *ptr; - - ptr = &flt_rc_table[num]; - - ptr->gain = nVolume; - ptr->output_dir = nRouteDir; -} - -void filter_rc_exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_FilterRCInitted) bprintf(PRINT_ERROR, _T("filter_rc_exit called without init\n")); -#endif - - if (!DebugSnd_FilterRCInitted) return; - - for (INT32 i = 0; i < FLT_RC_NUM; i++) { - struct flt_rc_info *ptr; - - ptr = &flt_rc_table[i]; - - memset(ptr, 0, sizeof(flt_rc_info)); - } - - num_filters = 0; - - DebugSnd_FilterRCInitted = 0; -} diff --git a/jan/src/burn/snd/flt_rc.h b/jan/src/burn/snd/flt_rc.h deleted file mode 100644 index f905ae912..000000000 --- a/jan/src/burn/snd/flt_rc.h +++ /dev/null @@ -1,15 +0,0 @@ -#include "rescap.h" - -#define FLT_RC_LOWPASS 0 -#define FLT_RC_HIGHPASS 1 -#define FLT_RC_AC 2 -#define FLT_RC_PANNEDLEFT 4 -#define FLT_RC_PANNEDRIGHT 8 - -void filter_rc_update(INT32 num, INT16 *src, INT16 *pSoundBuf, INT32 length); -void filter_rc_set_RC(INT32 num, INT32 type, double R1, double R2, double R3, double C); -void filter_rc_init(INT32 num, INT32 type, double R1, double R2, double R3, double C, INT32 add_signal); -void filter_rc_set_src_gain(INT32 num, double gain); -void filter_rc_set_src_stereo(INT32 num); -void filter_rc_set_route(INT32 num, double nVolume, INT32 nRouteDir); -void filter_rc_exit(); diff --git a/jan/src/burn/snd/fm.c b/jan/src/burn/snd/fm.c deleted file mode 100644 index 619aa441c..000000000 --- a/jan/src/burn/snd/fm.c +++ /dev/null @@ -1,4600 +0,0 @@ -#define YM2610B_WARNING - -/* -** -** File: fm.c -- software implementation of Yamaha FM sound generator -** -** Copyright (C) 2001, 2002, 2003 Jarek Burczynski (bujar at mame dot net) -** Copyright (C) 1998 Tatsuyuki Satoh , MultiArcadeMachineEmulator development -** -** Version 1.4 (final beta) -** -*/ - -/* -** History: -** -** 03-08-2003 Jarek Burczynski: -** - fixed YM2608 initial values (after the reset) -** - fixed flag and irqmask handling (YM2608) -** - fixed BUFRDY flag handling (YM2608) -** -** 14-06-2003 Jarek Burczynski: -** - implemented all of the YM2608 status register flags -** - implemented support for external memory read/write via YM2608 -** - implemented support for deltat memory limit register in YM2608 emulation -** -** 22-05-2003 Jarek Burczynski: -** - fixed LFO PM calculations (copy&paste bugfix) -** -** 08-05-2003 Jarek Burczynski: -** - fixed SSG support -** -** 22-04-2003 Jarek Burczynski: -** - implemented 100% correct LFO generator (verified on real YM2610 and YM2608) -** -** 15-04-2003 Jarek Burczynski: -** - added support for YM2608's register 0x110 - status mask -** -** 01-12-2002 Jarek Burczynski: -** - fixed register addressing in YM2608, YM2610, YM2610B chips. (verified on real YM2608) -** The addressing patch used for early Neo-Geo games can be removed now. -** -** 26-11-2002 Jarek Burczynski, Nicola Salmoria: -** - recreated YM2608 ADPCM ROM using data from real YM2608's output which leads to: -** - added emulation of YM2608 drums. -** - output of YM2608 is two times lower now - same as YM2610 (verified on real YM2608) -** -** 16-08-2002 Jarek Burczynski: -** - binary exact Envelope Generator (verified on real YM2203); -** identical to YM2151 -** - corrected 'off by one' error in feedback calculations (when feedback is off) -** - corrected connection (algorithm) calculation (verified on real YM2203 and YM2610) -** -** 18-12-2001 Jarek Burczynski: -** - added SSG-EG support (verified on real YM2203) -** -** 12-08-2001 Jarek Burczynski: -** - corrected sin_tab and tl_tab data (verified on real chip) -** - corrected feedback calculations (verified on real chip) -** - corrected phase generator calculations (verified on real chip) -** - corrected envelope generator calculations (verified on real chip) -** - corrected FM volume level (YM2610 and YM2610B). -** - changed YMxxxUpdateOne() functions (YM2203, YM2608, YM2610, YM2610B, YM2612) : -** this was needed to calculate YM2610 FM channels output correctly. -** (Each FM channel is calculated as in other chips, but the output of the channel -** gets shifted right by one *before* sending to accumulator. That was impossible to do -** with previous implementation). -** -** 23-07-2001 Jarek Burczynski, Nicola Salmoria: -** - corrected YM2610 ADPCM type A algorithm and tables (verified on real chip) -** -** 11-06-2001 Jarek Burczynski: -** - corrected end of sample bug in ADPCMA_calc_cha(). -** Real YM2610 checks for equality between current and end addresses (only 20 LSB bits). -** -** 08-12-98 hiro-shi: -** rename ADPCMA -> ADPCMB, ADPCMB -> ADPCMA -** move ROM limit check.(CALC_CH? -> 2610Write1/2) -** test program (ADPCMB_TEST) -** move ADPCM A/B end check. -** ADPCMB repeat flag(no check) -** change ADPCM volume rate (8->16) (32->48). -** -** 09-12-98 hiro-shi: -** change ADPCM volume. (8->16, 48->64) -** replace ym2610 ch0/3 (YM-2610B) -** init cur_chip (restart bug fix) -** change ADPCM_SHIFT (10->8) missing bank change 0x4000-0xffff. -** add ADPCM_SHIFT_MASK -** change ADPCMA_DECODE_MIN/MAX. -*/ - - - - -/************************************************************************/ -/* comment of hiro-shi(Hiromitsu Shioya) */ -/* YM2610(B) = OPN-B */ -/* YM2610 : PSG:3ch FM:4ch ADPCM(18.5KHz):6ch DeltaT ADPCM:1ch */ -/* YM2610B : PSG:3ch FM:6ch ADPCM(18.5KHz):6ch DeltaT ADPCM:1ch */ -/************************************************************************/ - -#include -#include -#include -#include -#include - -#ifndef __RAINE__ -#include "driver.h" /* use M.A.M.E. */ -#include "state.h" -#else -#include "deftypes.h" /* use RAINE */ -#include "support.h" /* use RAINE */ -#endif - -#include "ay8910.h" -#include "fm.h" - - -#ifndef PI -#define PI 3.14159265358979323846 -#endif - - -/* include external DELTA-T unit (when needed) */ -#if (BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B) - #include "ymdeltat.h" -#endif - -/* shared function building option */ -#define BUILD_OPN (BUILD_YM2203||BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B||BUILD_YM2612) -#define BUILD_OPN_PRESCALER (BUILD_YM2203||BUILD_YM2608) - - -/* globals */ -#define TYPE_SSG 0x01 /* SSG support */ -#define TYPE_LFOPAN 0x02 /* OPN type LFO and PAN */ -#define TYPE_6CH 0x04 /* FM 6CH / 3CH */ -#define TYPE_DAC 0x08 /* YM2612's DAC device */ -#define TYPE_ADPCM 0x10 /* two ADPCM units */ -#define TYPE_2610 0x20 /* bogus flag to differentiate 2608 from 2610 */ - -#define TYPE_YM2203 (TYPE_SSG) -#define TYPE_YM2608 (TYPE_SSG |TYPE_LFOPAN |TYPE_6CH |TYPE_ADPCM) -#define TYPE_YM2610 (TYPE_SSG |TYPE_LFOPAN |TYPE_6CH |TYPE_ADPCM |TYPE_2610) -#define TYPE_YM2612 (TYPE_DAC |TYPE_LFOPAN |TYPE_6CH) - - - -#define FREQ_SH 16 /* 16.16 fixed point (frequency calculations) */ -#define EG_SH 16 /* 16.16 fixed point (envelope generator timing) */ -#define LFO_SH 24 /* 8.24 fixed point (LFO calculations) */ -#define TIMER_SH 16 /* 16.16 fixed point (timers calculations) */ - -#define FREQ_MASK ((1<>3) - -/* sin waveform table in 'decibel' scale */ -static unsigned int sin_tab[SIN_LEN]; - -/* sustain level table (3dB per step) */ -/* bit0, bit1, bit2, bit3, bit4, bit5, bit6 */ -/* 1, 2, 4, 8, 16, 32, 64 (value)*/ -/* 0.75, 1.5, 3, 6, 12, 24, 48 (dB)*/ - -/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/ -#define SC(db) (UINT32) ( db * (4.0/ENV_STEP) ) -static const UINT32 sl_table[16]={ - SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7), - SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31) -}; -#undef SC - - -#define RATE_STEPS (8) -static const UINT8 eg_inc[19*RATE_STEPS]={ - -/*cycle:0 1 2 3 4 5 6 7*/ - -/* 0 */ 0,1, 0,1, 0,1, 0,1, /* rates 00..11 0 (increment by 0 or 1) */ -/* 1 */ 0,1, 0,1, 1,1, 0,1, /* rates 00..11 1 */ -/* 2 */ 0,1, 1,1, 0,1, 1,1, /* rates 00..11 2 */ -/* 3 */ 0,1, 1,1, 1,1, 1,1, /* rates 00..11 3 */ - -/* 4 */ 1,1, 1,1, 1,1, 1,1, /* rate 12 0 (increment by 1) */ -/* 5 */ 1,1, 1,2, 1,1, 1,2, /* rate 12 1 */ -/* 6 */ 1,2, 1,2, 1,2, 1,2, /* rate 12 2 */ -/* 7 */ 1,2, 2,2, 1,2, 2,2, /* rate 12 3 */ - -/* 8 */ 2,2, 2,2, 2,2, 2,2, /* rate 13 0 (increment by 2) */ -/* 9 */ 2,2, 2,4, 2,2, 2,4, /* rate 13 1 */ -/*10 */ 2,4, 2,4, 2,4, 2,4, /* rate 13 2 */ -/*11 */ 2,4, 4,4, 2,4, 4,4, /* rate 13 3 */ - -/*12 */ 4,4, 4,4, 4,4, 4,4, /* rate 14 0 (increment by 4) */ -/*13 */ 4,4, 4,8, 4,4, 4,8, /* rate 14 1 */ -/*14 */ 4,8, 4,8, 4,8, 4,8, /* rate 14 2 */ -/*15 */ 4,8, 8,8, 4,8, 8,8, /* rate 14 3 */ - -/*16 */ 8,8, 8,8, 8,8, 8,8, /* rates 15 0, 15 1, 15 2, 15 3 (increment by 8) */ -/*17 */ 16,16,16,16,16,16,16,16, /* rates 15 2, 15 3 for attack */ -/*18 */ 0,0, 0,0, 0,0, 0,0, /* infinity rates for attack and decay(s) */ -}; - - -#define O(a) (a*RATE_STEPS) - -/*note that there is no O(17) in this table - it's directly in the code */ -static const UINT8 eg_rate_select[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ -/* 32 infinite time rates */ -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), - -/* rates 00-11 */ -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), - -/* rate 12 */ -O( 4),O( 5),O( 6),O( 7), - -/* rate 13 */ -O( 8),O( 9),O(10),O(11), - -/* rate 14 */ -O(12),O(13),O(14),O(15), - -/* rate 15 */ -O(16),O(16),O(16),O(16), - -/* 32 dummy rates (same as 15 3) */ -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16) - -}; - -static const UINT8 eg_rate_select2612[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ -/* 32 infinite time rates */ -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), - -/* rates 00-11 */ -O( 18),O( 18),O( 0),O( 0), -O( 0),O( 0),O( 2),O( 2), // Nemesis's tests - -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), - -/* rate 12 */ -O( 4),O( 5),O( 6),O( 7), - -/* rate 13 */ -O( 8),O( 9),O(10),O(11), - -/* rate 14 */ -O(12),O(13),O(14),O(15), - -/* rate 15 */ -O(16),O(16),O(16),O(16), - -/* 32 dummy rates (same as 15 3) */ -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16) - -}; -#undef O - -/*rate 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15*/ -/*shift 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0 */ -/*mask 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0, 0, 0, 0, 0 */ - -#define O(a) (a*1) -static const UINT8 eg_rate_shift[32+64+32]={ /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */ -/* 32 infinite time rates */ -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), - -/* rates 00-11 */ -O(11),O(11),O(11),O(11), -O(10),O(10),O(10),O(10), -O( 9),O( 9),O( 9),O( 9), -O( 8),O( 8),O( 8),O( 8), -O( 7),O( 7),O( 7),O( 7), -O( 6),O( 6),O( 6),O( 6), -O( 5),O( 5),O( 5),O( 5), -O( 4),O( 4),O( 4),O( 4), -O( 3),O( 3),O( 3),O( 3), -O( 2),O( 2),O( 2),O( 2), -O( 1),O( 1),O( 1),O( 1), -O( 0),O( 0),O( 0),O( 0), - -/* rate 12 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 13 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 14 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 15 */ -O( 0),O( 0),O( 0),O( 0), - -/* 32 dummy rates (same as 15 3) */ -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0) - -}; -#undef O - -static const UINT8 dt_tab[4 * 32]={ -/* this is YM2151 and YM2612 phase increment data (in 10.10 fixed point format)*/ -/* FD=0 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* FD=1 */ - 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8, 8, 8, 8, -/* FD=2 */ - 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, - 5, 6, 6, 7, 8, 8, 9,10,11,12,13,14,16,16,16,16, -/* FD=3 */ - 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, - 8 , 8, 9,10,11,12,13,14,16,17,19,20,22,22,22,22 -}; - - -/* OPN key frequency number -> key code follow table */ -/* fnum higher 4bit -> keycode lower 2bit */ -static const UINT8 opn_fktable[16] = {0,0,0,0,0,0,0,1,2,3,3,3,3,3,3,3}; - - -/* 8 LFO speed parameters */ -/* each value represents number of samples that one LFO level will last for */ -static const UINT32 lfo_samples_per_step[8] = {108, 77, 71, 67, 62, 44, 8, 5}; - - - -/*There are 4 different LFO AM depths available, they are: - 0 dB, 1.4 dB, 5.9 dB, 11.8 dB - Here is how it is generated (in EG steps): - - 11.8 dB = 0, 2, 4, 6, 8, 10,12,14,16...126,126,124,122,120,118,....4,2,0 - 5.9 dB = 0, 1, 2, 3, 4, 5, 6, 7, 8....63, 63, 62, 61, 60, 59,.....2,1,0 - 1.4 dB = 0, 0, 0, 0, 1, 1, 1, 1, 2,...15, 15, 15, 15, 14, 14,.....0,0,0 - - (1.4 dB is loosing precision as you can see) - - It's implemented as generator from 0..126 with step 2 then a shift - right N times, where N is: - 8 for 0 dB - 3 for 1.4 dB - 1 for 5.9 dB - 0 for 11.8 dB -*/ -static const UINT8 lfo_ams_depth_shift[4] = {8, 3, 1, 0}; - - - -/*There are 8 different LFO PM depths available, they are: - 0, 3.4, 6.7, 10, 14, 20, 40, 80 (cents) - - Modulation level at each depth depends on F-NUMBER bits: 4,5,6,7,8,9,10 - (bits 8,9,10 = FNUM MSB from OCT/FNUM register) - - Here we store only first quarter (positive one) of full waveform. - Full table (lfo_pm_table) containing all 128 waveforms is build - at run (init) time. - - One value in table below represents 4 (four) basic LFO steps - (1 PM step = 4 AM steps). - - For example: - at LFO SPEED=0 (which is 108 samples per basic LFO step) - one value from "lfo_pm_output" table lasts for 432 consecutive - samples (4*108=432) and one full LFO waveform cycle lasts for 13824 - samples (32*432=13824; 32 because we store only a quarter of whole - waveform in the table below) -*/ -static const UINT8 lfo_pm_output[7*8][8]={ /* 7 bits meaningful (of F-NUMBER), 8 LFO output levels per one depth (out of 32), 8 LFO depths */ -/* FNUM BIT 4: 000 0001xxxx */ -/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 2 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 3 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 4 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 5 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 6 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 7 */ {0, 0, 0, 0, 1, 1, 1, 1}, - -/* FNUM BIT 5: 000 0010xxxx */ -/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 2 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 3 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 4 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 5 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 6 */ {0, 0, 0, 0, 1, 1, 1, 1}, -/* DEPTH 7 */ {0, 0, 1, 1, 2, 2, 2, 3}, - -/* FNUM BIT 6: 000 0100xxxx */ -/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 2 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 3 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 4 */ {0, 0, 0, 0, 0, 0, 0, 1}, -/* DEPTH 5 */ {0, 0, 0, 0, 1, 1, 1, 1}, -/* DEPTH 6 */ {0, 0, 1, 1, 2, 2, 2, 3}, -/* DEPTH 7 */ {0, 0, 2, 3, 4, 4, 5, 6}, - -/* FNUM BIT 7: 000 1000xxxx */ -/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 2 */ {0, 0, 0, 0, 0, 0, 1, 1}, -/* DEPTH 3 */ {0, 0, 0, 0, 1, 1, 1, 1}, -/* DEPTH 4 */ {0, 0, 0, 1, 1, 1, 1, 2}, -/* DEPTH 5 */ {0, 0, 1, 1, 2, 2, 2, 3}, -/* DEPTH 6 */ {0, 0, 2, 3, 4, 4, 5, 6}, -/* DEPTH 7 */ {0, 0, 4, 6, 8, 8, 0xa, 0xc}, - -/* FNUM BIT 8: 001 0000xxxx */ -/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 1 */ {0, 0, 0, 0, 1, 1, 1, 1}, -/* DEPTH 2 */ {0, 0, 0, 1, 1, 1, 2, 2}, -/* DEPTH 3 */ {0, 0, 1, 1, 2, 2, 3, 3}, -/* DEPTH 4 */ {0, 0, 1, 2, 2, 2, 3, 4}, -/* DEPTH 5 */ {0, 0, 2, 3, 4, 4, 5, 6}, -/* DEPTH 6 */ {0, 0, 4, 6, 8, 8, 0xa, 0xc}, -/* DEPTH 7 */ {0, 0, 8, 0xc,0x10,0x10,0x14,0x18}, - -/* FNUM BIT 9: 010 0000xxxx */ -/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 1 */ {0, 0, 0, 0, 2, 2, 2, 2}, -/* DEPTH 2 */ {0, 0, 0, 2, 2, 2, 4, 4}, -/* DEPTH 3 */ {0, 0, 2, 2, 4, 4, 6, 6}, -/* DEPTH 4 */ {0, 0, 2, 4, 4, 4, 6, 8}, -/* DEPTH 5 */ {0, 0, 4, 6, 8, 8, 0xa, 0xc}, -/* DEPTH 6 */ {0, 0, 8, 0xc,0x10,0x10,0x14,0x18}, -/* DEPTH 7 */ {0, 0,0x10,0x18,0x20,0x20,0x28,0x30}, - -/* FNUM BIT10: 100 0000xxxx */ -/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, -/* DEPTH 1 */ {0, 0, 0, 0, 4, 4, 4, 4}, -/* DEPTH 2 */ {0, 0, 0, 4, 4, 4, 8, 8}, -/* DEPTH 3 */ {0, 0, 4, 4, 8, 8, 0xc, 0xc}, -/* DEPTH 4 */ {0, 0, 4, 8, 8, 8, 0xc,0x10}, -/* DEPTH 5 */ {0, 0, 8, 0xc,0x10,0x10,0x14,0x18}, -/* DEPTH 6 */ {0, 0,0x10,0x18,0x20,0x20,0x28,0x30}, -/* DEPTH 7 */ {0, 0,0x20,0x30,0x40,0x40,0x50,0x60}, - -}; - -/* all 128 LFO PM waveforms */ -static INT32 lfo_pm_table[128*8*32]; /* 128 combinations of 7 bits meaningful (of F-NUMBER), 8 LFO depths, 32 LFO output levels per one depth */ - - - - - -/* register number to channel number , slot offset */ -#define OPN_CHAN(N) (N&3) -#define OPN_SLOT(N) ((N>>2)&3) - -/* slot number */ -#define SLOT1 0 -#define SLOT2 2 -#define SLOT3 1 -#define SLOT4 3 - -/* bit0 = Right enable , bit1 = Left enable */ -#define OUTD_RIGHT 1 -#define OUTD_LEFT 2 -#define OUTD_CENTER 3 - - -/* save output as raw 16-bit sample */ -/* #define SAVE_SAMPLE */ - -#ifdef SAVE_SAMPLE -static FILE *sample[1]; - #if 1 /*save to MONO file */ - #define SAVE_ALL_CHANNELS \ - { signed int pom = lt; \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - } - #else /*save to STEREO file */ - #define SAVE_ALL_CHANNELS \ - { signed int pom = lt; \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - pom = rt; \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - } - #endif -#endif - - -/* struct describing a single operator (SLOT) */ -typedef struct -{ - INT32 *DT; /* detune :dt_tab[DT] */ - UINT8 KSR; /* key scale rate :3-KSR */ - UINT32 ar; /* attack rate */ - UINT32 d1r; /* decay rate */ - UINT32 d2r; /* sustain rate */ - UINT32 rr; /* release rate */ - UINT8 ksr; /* key scale rate :kcode>>(3-KSR) */ - UINT32 mul; /* multiple :ML_TABLE[ML] */ - - /* Phase Generator */ - UINT32 phase; /* phase counter */ - INT32 Incr; /* phase step */ - - /* Envelope Generator */ - UINT8 state; /* phase type */ - UINT32 tl; /* total level: TL << 3 */ - INT32 volume; /* envelope counter */ - UINT32 sl; /* sustain level:sl_table[SL] */ - UINT32 vol_out; /* current output from EG circuit (without AM from LFO) */ - - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT8 eg_sh_d1r; /* (decay state) */ - UINT8 eg_sel_d1r; /* (decay state) */ - UINT8 eg_sh_d2r; /* (sustain state) */ - UINT8 eg_sel_d2r; /* (sustain state) */ - UINT8 eg_sh_rr; /* (release state) */ - UINT8 eg_sel_rr; /* (release state) */ - - UINT8 ssg; /* SSG-EG waveform */ - UINT8 ssgn; /* SSG-EG negated output */ - - UINT32 key; /* 0=last key was KEY OFF, 1=KEY ON */ - - /* LFO */ - UINT32 AMmask; /* AM enable flag */ - -} FM_SLOT; - -typedef struct -{ - FM_SLOT SLOT[4]; /* four SLOTs (operators) */ - - UINT8 ALGO; /* algorithm */ - UINT8 FB; /* feedback shift */ - INT32 op1_out[2]; /* op1 output for feedback */ - - INT32 *connect1; /* SLOT1 output pointer */ - INT32 *connect3; /* SLOT3 output pointer */ - INT32 *connect2; /* SLOT2 output pointer */ - INT32 *connect4; /* SLOT4 output pointer */ - - INT32 *mem_connect;/* where to put the delayed sample (MEM) */ - INT32 mem_value; /* delayed sample (MEM) value */ - - INT32 pms; /* channel PMS */ - UINT8 ams; /* channel AMS */ - - UINT32 fc; /* fnum,blk:adjusted to sample rate */ - UINT8 kcode; /* key code: */ - UINT32 block_fnum; /* current blk/fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ -} FM_CH; - - -typedef struct -{ - UINT8 index; /* this chip index (number of chip) */ - int clock; /* master clock (Hz) */ - int rate; /* sampling rate (Hz) */ - double freqbase; /* frequency base */ - double TimerBase; /* Timer base time */ -#if FM_BUSY_FLAG_SUPPORT - double BusyExpire; /* ExpireTime of Busy clear */ -#endif - UINT8 address; /* address register */ - UINT8 irq; /* interrupt level */ - UINT8 irqmask; /* irq mask */ - UINT8 status; /* status flag */ - UINT32 mode; /* mode CSM / 3SLOT */ - UINT8 prescaler_sel;/* prescaler selector */ - UINT8 fn_h; /* freq latch */ - int TA; /* timer a */ - int TAC; /* timer a counter */ - UINT8 TB; /* timer b */ - int TBC; /* timer b counter */ - /* local time tables */ - INT32 dt_tab[8][32];/* DeTune table */ - /* Extention Timer and IRQ handler */ - FM_TIMERHANDLER Timer_Handler; - FM_IRQHANDLER IRQ_Handler; -} FM_ST; - - - -/***********************************************************/ -/* OPN unit */ -/***********************************************************/ - -/* OPN 3slot struct */ -typedef struct -{ - UINT32 fc[3]; /* fnum3,blk3: calculated */ - UINT8 fn_h; /* freq3 latch */ - UINT8 kcode[3]; /* key code */ - UINT32 block_fnum[3]; /* current fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ -} FM_3SLOT; - -/* OPN/A/B common state */ -typedef struct -{ - UINT8 type; /* chip type */ - FM_ST ST; /* general state */ - FM_3SLOT SL3; /* 3 slot mode state */ - FM_CH *P_CH; /* pointer of CH */ - unsigned int pan[6*2]; /* fm channels output masks (0xffffffff = enable) */ - - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/64/3 */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow;/* envelope generator timer overlfows every 3 samples (on real chip) */ - - - /* there are 2048 FNUMs that can be generated using FNUM/BLK registers - but LFO works with one more bit of a precision so we really need 4096 elements */ - - UINT32 fn_table[4096]; /* fnumber->increment counter */ - UINT32 fn_max; - - /* LFO */ - UINT32 lfo_cnt; - UINT32 lfo_inc; - - UINT32 lfo_freq[8]; /* LFO FREQ table */ -} FM_OPN; - - - -/* current chip state */ -static void *cur_chip = 0; /* pointer of current chip struct */ -static FM_ST *State; /* basic status */ -static FM_CH *cch[8]; /* pointer of FM channels */ - - -static INT32 m2,c1,c2; /* Phase Modulation input for operators 2,3,4 */ -static INT32 mem; /* one sample delay memory */ - -static INT32 out_fm[8]; /* outputs of working channels */ - -#if (BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B) -static INT32 out_adpcm[4]; /* channel output NONE,LEFT,RIGHT or CENTER for YM2608/YM2610 ADPCM */ -static INT32 out_delta[4]; /* channel output NONE,LEFT,RIGHT or CENTER for YM2608/YM2610 DELTAT*/ -#endif - -static UINT32 LFO_AM; /* runtime LFO calculations helper */ -static INT32 LFO_PM; /* runtime LFO calculations helper */ - -/* log output level */ -#define LOG_ERR 3 /* ERROR */ -#define LOG_WAR 2 /* WARNING */ -#define LOG_INF 1 /* INFORMATION */ -#define LOG_LEVEL LOG_INF - -#ifndef __RAINE__ -#define LOG(n,x) if( (n)>=LOG_LEVEL ) logerror x -#endif - -/* limitter */ -#define Limit(val, max,min) { \ - if ( val > max ) val = max; \ - else if ( val < min ) val = min; \ -} - - -/* status set and IRQ handling */ -INLINE void FM_STATUS_SET(FM_ST *ST,int flag) -{ - /* set status flag */ - ST->status |= flag; - if ( !(ST->irq) && (ST->status & ST->irqmask) ) - { - ST->irq = 1; - /* callback user interrupt handler (IRQ is OFF to ON) */ - if(ST->IRQ_Handler) (ST->IRQ_Handler)(ST->index,1); - } -} - -/* status reset and IRQ handling */ -INLINE void FM_STATUS_RESET(FM_ST *ST,int flag) -{ - /* reset status flag */ - ST->status &=~flag; - if ( (ST->irq) && !(ST->status & ST->irqmask) ) - { - ST->irq = 0; - /* callback user interrupt handler (IRQ is ON to OFF) */ - if(ST->IRQ_Handler) (ST->IRQ_Handler)(ST->index,0); - } -} - -/* IRQ mask set */ -INLINE void FM_IRQMASK_SET(FM_ST *ST,int flag) -{ - ST->irqmask = flag; - /* IRQ handling check */ - FM_STATUS_SET(ST,0); - FM_STATUS_RESET(ST,0); -} - -/* OPN Mode Register Write */ -INLINE void set_timers( FM_ST *ST, int n, int v ) -{ - /* b7 = CSM MODE */ - /* b6 = 3 slot mode */ - /* b5 = reset b */ - /* b4 = reset a */ - /* b3 = timer enable b */ - /* b2 = timer enable a */ - /* b1 = load b */ - /* b0 = load a */ - ST->mode = v; - - /* reset Timer b flag */ - if( v & 0x20 ) - FM_STATUS_RESET(ST,0x02); - /* reset Timer a flag */ - if( v & 0x10 ) - FM_STATUS_RESET(ST,0x01); - /* load b */ - if( v & 0x02 ) - { - if( ST->TBC == 0 ) - { - ST->TBC = ( 256-ST->TB)<<4; - /* External timer handler */ - if (ST->Timer_Handler) (ST->Timer_Handler)(n,1,ST->TBC,ST->TimerBase); - } - } - else - { /* stop timer b */ - if( ST->TBC != 0 ) - { - ST->TBC = 0; - if (ST->Timer_Handler) (ST->Timer_Handler)(n,1,0,ST->TimerBase); - } - } - /* load a */ - if( v & 0x01 ) - { - if( ST->TAC == 0 ) - { - ST->TAC = (1024-ST->TA); - /* External timer handler */ - if (ST->Timer_Handler) (ST->Timer_Handler)(n,0,ST->TAC,ST->TimerBase); - } - } - else - { /* stop timer a */ - if( ST->TAC != 0 ) - { - ST->TAC = 0; - if (ST->Timer_Handler) (ST->Timer_Handler)(n,0,0,ST->TimerBase); - } - } -} - - -/* Timer A Overflow */ -INLINE void TimerAOver(FM_ST *ST) -{ - /* set status (if enabled) */ - if(ST->mode & 0x04) FM_STATUS_SET(ST,0x01); - /* clear or reload the counter */ - ST->TAC = (1024-ST->TA); - if (ST->Timer_Handler) (ST->Timer_Handler)(ST->index,0,ST->TAC,ST->TimerBase); -} -/* Timer B Overflow */ -INLINE void TimerBOver(FM_ST *ST) -{ - /* set status (if enabled) */ - if(ST->mode & 0x08) FM_STATUS_SET(ST,0x02); - /* clear or reload the counter */ - ST->TBC = ( 256-ST->TB)<<4; - if (ST->Timer_Handler) (ST->Timer_Handler)(ST->index,1,ST->TBC,ST->TimerBase); -} - - -#if FM_INTERNAL_TIMER -/* ----- internal timer mode , update timer */ - -/* ---------- calculate timer A ---------- */ - #define INTERNAL_TIMER_A(ST,CSM_CH) \ - { \ - if( ST->TAC && (ST->Timer_Handler==0) ) \ - if( (ST->TAC -= (int)(ST->freqbase*4096)) <= 0 ) \ - { \ - TimerAOver( ST ); \ - /* CSM mode total level latch and auto key on */ \ - if( ST->mode & 0x80 ) \ - CSMKeyControll( CSM_CH ); \ - } \ - } -/* ---------- calculate timer B ---------- */ - #define INTERNAL_TIMER_B(ST,step) \ - { \ - if( ST->TBC && (ST->Timer_Handler==0) ) \ - if( (ST->TBC -= (int)(ST->freqbase*4096*step)) <= 0 ) \ - TimerBOver( ST ); \ - } -#else /* FM_INTERNAL_TIMER */ -/* external timer mode */ -#define INTERNAL_TIMER_A(ST,CSM_CH) -#define INTERNAL_TIMER_B(ST,step) -#endif /* FM_INTERNAL_TIMER */ - - - -#if FM_BUSY_FLAG_SUPPORT -INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST) -{ - if( ST->BusyExpire ) - { - if( (ST->BusyExpire - FM_GET_TIME_NOW()) > 0) - return ST->status | 0x80; /* with busy */ - /* expire */ - ST->BusyExpire = 0; - } - return ST->status; -} -INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock ) -{ - ST->BusyExpire = FM_GET_TIME_NOW() + (ST->TimerBase * busyclock); -} -#define FM_BUSY_CLEAR(ST) ((ST)->BusyExpire = 0) -#else -#define FM_STATUS_FLAG(ST) ((ST)->status) -#define FM_BUSY_SET(ST,bclock) {} -#define FM_BUSY_CLEAR(ST) {} -#endif - - - - -INLINE void FM_KEYON(UINT8 type, FM_CH *CH , int s ) -{ - FM_SLOT *SLOT = &CH->SLOT[s]; - if( !SLOT->key ) - { - SLOT->key = 1; - SLOT->phase = 0; /* restart Phase Generator */ - SLOT->ssgn = (SLOT->ssg & 0x04) >> 1; - - if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) - { - if( (SLOT->ar + SLOT->ksr) < 32+62 ) - { - SLOT->state = EG_ATT; /* phase -> Attack */ - } - else - { - /* directly switch to Decay */ - SLOT->volume = MIN_ATT_INDEX; - SLOT->state = EG_DEC; - } - } - else - { - SLOT->state = EG_ATT; - } - } -} - -INLINE void FM_KEYOFF(FM_CH *CH , int s ) -{ - FM_SLOT *SLOT = &CH->SLOT[s]; - if( SLOT->key ) - { - SLOT->key = 0; - if (SLOT->state>EG_REL) - SLOT->state = EG_REL;/* phase -> Release */ - } -} - -/* set algorithm connection */ -static void setup_connection( FM_CH *CH, int ch ) -{ - INT32 *carrier = &out_fm[ch]; - - INT32 **om1 = &CH->connect1; - INT32 **om2 = &CH->connect3; - INT32 **oc1 = &CH->connect2; - - INT32 **memc = &CH->mem_connect; - - switch( CH->ALGO ){ - case 0: - /* M1---C1---MEM---M2---C2---OUT */ - *om1 = &c1; - *oc1 = &mem; - *om2 = &c2; - *memc= &m2; - break; - case 1: - /* M1------+-MEM---M2---C2---OUT */ - /* C1-+ */ - *om1 = &mem; - *oc1 = &mem; - *om2 = &c2; - *memc= &m2; - break; - case 2: - /* M1-----------------+-C2---OUT */ - /* C1---MEM---M2-+ */ - *om1 = &c2; - *oc1 = &mem; - *om2 = &c2; - *memc= &m2; - break; - case 3: - /* M1---C1---MEM------+-C2---OUT */ - /* M2-+ */ - *om1 = &c1; - *oc1 = &mem; - *om2 = &c2; - *memc= &c2; - break; - case 4: - /* M1---C1-+-OUT */ - /* M2---C2-+ */ - /* MEM: not used */ - *om1 = &c1; - *oc1 = carrier; - *om2 = &c2; - *memc= &mem; /* store it anywhere where it will not be used */ - break; - case 5: - /* +----C1----+ */ - /* M1-+-MEM---M2-+-OUT */ - /* +----C2----+ */ - *om1 = 0; /* special mark */ - *oc1 = carrier; - *om2 = carrier; - *memc= &m2; - break; - case 6: - /* M1---C1-+ */ - /* M2-+-OUT */ - /* C2-+ */ - /* MEM: not used */ - *om1 = &c1; - *oc1 = carrier; - *om2 = carrier; - *memc= &mem; /* store it anywhere where it will not be used */ - break; - case 7: - /* M1-+ */ - /* C1-+-OUT */ - /* M2-+ */ - /* C2-+ */ - /* MEM: not used*/ - *om1 = carrier; - *oc1 = carrier; - *om2 = carrier; - *memc= &mem; /* store it anywhere where it will not be used */ - break; - } - - CH->connect4 = carrier; -} - -/* set detune & multiple */ -INLINE void set_det_mul(FM_ST *ST,FM_CH *CH,FM_SLOT *SLOT,int v) -{ - SLOT->mul = (v&0x0f)? (v&0x0f)*2 : 1; - SLOT->DT = ST->dt_tab[(v>>4)&7]; - CH->SLOT[SLOT1].Incr=-1; -} - -/* set total level */ -INLINE void set_tl(FM_CH *CH,FM_SLOT *SLOT , int v) -{ - SLOT->tl = (v&0x7f)<<(ENV_BITS-7); /* 7bit TL */ -} - -/* set attack rate & key scale */ -INLINE void set_ar_ksr(UINT8 type, FM_CH *CH,FM_SLOT *SLOT,int v) -{ - UINT8 old_KSR = SLOT->KSR; - - SLOT->ar = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; - - SLOT->KSR = 3-(v>>6); - if (SLOT->KSR != old_KSR) - { - CH->SLOT[SLOT1].Incr=-1; - } - - /* refresh Attack rate */ - if ((SLOT->ar + SLOT->ksr) < 32+62) - { - SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; - if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) - { - SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; - SLOT->eg_sel_ar = eg_rate_select2612[SLOT->ar + SLOT->ksr ]; - } - else - { - SLOT->eg_sel_ar = eg_rate_select[SLOT->ar + SLOT->ksr ]; - } - } - else - { - SLOT->eg_sh_ar = 0; - SLOT->eg_sel_ar = 17*RATE_STEPS; - } -} - -/* set decay rate */ -INLINE void set_dr(UINT8 type, FM_SLOT *SLOT,int v) -{ - SLOT->d1r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; - - SLOT->eg_sh_d1r = eg_rate_shift [SLOT->d1r + SLOT->ksr]; - if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) - { - SLOT->eg_sel_d1r= eg_rate_select2612[SLOT->d1r + SLOT->ksr]; - } - else - { - SLOT->eg_sel_d1r= eg_rate_select[SLOT->d1r + SLOT->ksr]; - } - -} - -/* set sustain rate */ -INLINE void set_sr(UINT8 type, FM_SLOT *SLOT,int v) -{ - SLOT->d2r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; - - SLOT->eg_sh_d2r = eg_rate_shift [SLOT->d2r + SLOT->ksr]; - if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) - { - SLOT->eg_sel_d2r= eg_rate_select2612[SLOT->d2r + SLOT->ksr]; - } - else - { - SLOT->eg_sel_d2r= eg_rate_select[SLOT->d2r + SLOT->ksr]; - } -} - -/* set release rate */ -INLINE void set_sl_rr(UINT8 type, FM_SLOT *SLOT,int v) -{ - SLOT->sl = sl_table[ v>>4 ]; - - SLOT->rr = 34 + ((v&0x0f)<<2); - - SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr]; - if ((type == TYPE_YM2612) || (type == TYPE_YM2608)) - { - SLOT->eg_sel_rr = eg_rate_select2612[SLOT->rr + SLOT->ksr]; - } - else - { - SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr]; - } -} - - - -INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm) -{ - UINT32 p; - - p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + (pm<<15))) >> FREQ_SH ) & SIN_MASK ]; - - if (p >= TL_TAB_LEN) - return 0; - return tl_tab[p]; -} - -INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) -{ - UINT32 p; - - p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + pm )) >> FREQ_SH ) & SIN_MASK ]; - - if (p >= TL_TAB_LEN) - return 0; - return tl_tab[p]; -} - -/* advance LFO to next sample */ -INLINE void advance_lfo(FM_OPN *OPN) -{ - UINT8 pos; - - if (OPN->lfo_inc) /* LFO enabled ? */ - { - OPN->lfo_cnt += OPN->lfo_inc; - - pos = (OPN->lfo_cnt >> LFO_SH) & 127; - - - /* update AM when LFO output changes */ - - /* actually I can't optimize is this way without rewritting chan_calc() - to use chip->lfo_am instead of global lfo_am */ - { - - /* triangle */ - /* AM: 0 to 126 step +2, 126 to 0 step -2 */ - if (pos<64) - LFO_AM = (pos&63) * 2; - else - LFO_AM = 126 - ((pos&63) * 2); - } - - /* PM works with 4 times slower clock */ - pos >>= 2; - /* update PM when LFO output changes */ - /*if (prev_pos != pos)*/ /* can't use global lfo_pm for this optimization, must be chip->lfo_pm instead*/ - { - LFO_PM = pos; - } - - } - else - { - LFO_AM = 0; - LFO_PM = 0; - } -} - -INLINE void advance_eg_channel(FM_OPN *OPN, FM_SLOT *SLOT) -{ - unsigned int out; - unsigned int swap_flag = 0; - unsigned int i; - - - i = 4; /* four operators per channel */ - do - { - /* reset SSG-EG swap flag */ - swap_flag = 0; - - switch(SLOT->state) - { - case EG_ATT: /* attack phase */ - if ( !(OPN->eg_cnt & ((1<eg_sh_ar)-1) ) ) - { - SLOT->volume += (~SLOT->volume * - (eg_inc[SLOT->eg_sel_ar + ((OPN->eg_cnt>>SLOT->eg_sh_ar)&7)]) - ) >>4; - - if (SLOT->volume <= MIN_ATT_INDEX) - { - SLOT->volume = MIN_ATT_INDEX; - SLOT->state = EG_DEC; - } - } - break; - - case EG_DEC: /* decay phase */ - if ((OPN->type == TYPE_YM2612) || (OPN->type == TYPE_YM2608)) - { - if ( !(OPN->eg_cnt & ((1<eg_sh_d1r)-1) ) ) - { - if (SLOT->ssg&0x08) /* SSG EG type envelope selected */ - { - SLOT->volume += 6 * eg_inc[SLOT->eg_sel_d1r + ((OPN->eg_cnt>>SLOT->eg_sh_d1r)&7)]; - } - else - { - SLOT->volume += eg_inc[SLOT->eg_sel_d1r + ((OPN->eg_cnt>>SLOT->eg_sh_d1r)&7)]; - } - } - - /* check transition even if no volume update: this fixes the case when SL = MIN_ATT_INDEX */ - if ( SLOT->volume >= (INT32)(SLOT->sl) ) - { - SLOT->volume = (INT32)(SLOT->sl); - SLOT->state = EG_SUS; - } - } - else - { - if (SLOT->ssg&0x08) /* SSG EG type envelope selected */ - { - if ( !(OPN->eg_cnt & ((1<eg_sh_d1r)-1) ) ) - { - SLOT->volume += 4 * eg_inc[SLOT->eg_sel_d1r + ((OPN->eg_cnt>>SLOT->eg_sh_d1r)&7)]; - - if ( SLOT->volume >= (INT32)(SLOT->sl) ) - SLOT->state = EG_SUS; - } - } - else - { - if ( !(OPN->eg_cnt & ((1<eg_sh_d1r)-1) ) ) - { - SLOT->volume += eg_inc[SLOT->eg_sel_d1r + ((OPN->eg_cnt>>SLOT->eg_sh_d1r)&7)]; - - if ( SLOT->volume >= (INT32)(SLOT->sl) ) - SLOT->state = EG_SUS; - } - } - } - break; - - case EG_SUS: /* sustain phase */ - if (SLOT->ssg&0x08) /* SSG EG type envelope selected */ - { - if ( !(OPN->eg_cnt & ((1<eg_sh_d2r)-1) ) ) - { - if ((OPN->type == TYPE_YM2612) || (OPN->type == TYPE_YM2608)) - { - SLOT->volume += 6 * eg_inc[SLOT->eg_sel_d2r + ((OPN->eg_cnt>>SLOT->eg_sh_d2r)&7)]; - } - else - { - SLOT->volume += 4 * eg_inc[SLOT->eg_sel_d2r + ((OPN->eg_cnt>>SLOT->eg_sh_d2r)&7)]; - } - - if ( SLOT->volume >= ENV_QUIET ) - { - if ((OPN->type != TYPE_YM2612) && (OPN->type != TYPE_YM2608)) - { - SLOT->volume = MAX_ATT_INDEX; - } - - if (SLOT->ssg&0x01) /* bit 0 = hold */ - { - if (SLOT->ssgn&1) /* have we swapped once ??? */ - { - /* yes, so do nothing, just hold current level */ - } - else - swap_flag = (SLOT->ssg&0x02) | 1 ; /* bit 1 = alternate */ - - } - else - { - /* same as KEY-ON operation */ - - /* restart of the Phase Generator should be here */ - SLOT->phase = 0; - - if ((OPN->type == TYPE_YM2612) || (OPN->type == TYPE_YM2608)) - { - if ((SLOT->ar + SLOT->ksr) < 94 /*32+62*/) - { - SLOT->state = EG_ATT; /* phase -> Attack */ - } - else - { - /* Attack Rate is maximal: directly switch to Decay (or Substain) */ - SLOT->volume = MIN_ATT_INDEX; - SLOT->state = (SLOT->sl == MIN_ATT_INDEX) ? EG_SUS : EG_DEC; - } - } - else - { - /* phase -> Attack */ - SLOT->volume = 511; - SLOT->state = EG_ATT; - } - - swap_flag = (SLOT->ssg&0x02); /* bit 1 = alternate */ - } - } - } - } - else - { - if ( !(OPN->eg_cnt & ((1<eg_sh_d2r)-1) ) ) - { - SLOT->volume += eg_inc[SLOT->eg_sel_d2r + ((OPN->eg_cnt>>SLOT->eg_sh_d2r)&7)]; - - if ( SLOT->volume >= MAX_ATT_INDEX ) - { - SLOT->volume = MAX_ATT_INDEX; - /* do not change SLOT->state (verified on real chip) */ - } - } - - } - break; - - case EG_REL: /* release phase */ - if ( !(OPN->eg_cnt & ((1<eg_sh_rr)-1) ) ) - { - /* SSG-EG affects Release phase also (Nemesis) */ - if ((SLOT->ssg&0x08) && ((OPN->type = TYPE_YM2612) || (OPN->type = TYPE_YM2608))) - { - SLOT->volume += 6 * eg_inc[SLOT->eg_sel_rr + ((OPN->eg_cnt>>SLOT->eg_sh_rr)&7)]; - } - else - { - SLOT->volume += eg_inc[SLOT->eg_sel_rr + ((OPN->eg_cnt>>SLOT->eg_sh_rr)&7)]; - } - - if ( SLOT->volume >= MAX_ATT_INDEX ) - { - SLOT->volume = MAX_ATT_INDEX; - SLOT->state = EG_OFF; - } - } - break; - - } - - out = ((UINT32)SLOT->volume); - - /* negate output (changes come from alternate bit, init comes from attack bit) */ - if ((SLOT->ssg&0x08) && (SLOT->ssgn&2) && (SLOT->state > EG_REL)) - out ^= MAX_ATT_INDEX; - - /* we need to store the result here because we are going to change ssgn - in next instruction */ - SLOT->vol_out = out + SLOT->tl; - - /* reverse SLOT inversion flag */ - SLOT->ssgn ^= swap_flag; - - SLOT++; - i--; - }while (i); - -} - - - -#define volume_calc(OP) ((OP)->vol_out + (AM & (OP)->AMmask)) - -INLINE void update_phase_lfo_slot(FM_OPN *OPN, FM_SLOT *SLOT, INT32 pms, UINT32 block_fnum) -{ - UINT32 fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; - INT32 lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + pms + LFO_PM ]; - - if (lfo_fn_table_index_offset) /* LFO phase modulation active */ - { - UINT8 blk; - UINT32 fn; - int kc, fc; - - block_fnum = block_fnum*2 + lfo_fn_table_index_offset; - - blk = (block_fnum&0x7000) >> 12; - fn = block_fnum & 0xfff; - - /* keyscale code */ - kc = (blk<<2) | opn_fktable[fn >> 8]; - - /* phase increment counter */ - fc = (OPN->fn_table[fn]>>(7-blk)) + SLOT->DT[kc]; - - /* detects frequency overflow (credits to Nemesis) */ - if (fc < 0) fc += OPN->fn_max; - - /* update phase */ - SLOT->phase += (fc * SLOT->mul) >> 1; - } - else /* LFO phase modulation = zero */ - { - SLOT->phase += SLOT->Incr; - } -} - -INLINE void update_phase_lfo_channel(FM_OPN *OPN, FM_CH *CH) -{ - UINT32 block_fnum = CH->block_fnum; - - UINT32 fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; - INT32 lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + CH->pms + LFO_PM ]; - - if (lfo_fn_table_index_offset) /* LFO phase modulation active */ - { - UINT8 blk; - UINT32 fn; - int kc, fc, finc; - - block_fnum = block_fnum*2 + lfo_fn_table_index_offset; - - blk = (block_fnum&0x7000) >> 12; - fn = block_fnum & 0xfff; - - /* keyscale code */ - kc = (blk<<2) | opn_fktable[fn >> 8]; - - /* phase increment counter */ - fc = (OPN->fn_table[fn]>>(7-blk)); - - /* detects frequency overflow (credits to Nemesis) */ - finc = fc + CH->SLOT[SLOT1].DT[kc]; - - if (finc < 0) finc += OPN->fn_max; - CH->SLOT[SLOT1].phase += (finc*CH->SLOT[SLOT1].mul) >> 1; - - finc = fc + CH->SLOT[SLOT2].DT[kc]; - if (finc < 0) finc += OPN->fn_max; - CH->SLOT[SLOT2].phase += (finc*CH->SLOT[SLOT2].mul) >> 1; - - finc = fc + CH->SLOT[SLOT3].DT[kc]; - if (finc < 0) finc += OPN->fn_max; - CH->SLOT[SLOT3].phase += (finc*CH->SLOT[SLOT3].mul) >> 1; - - finc = fc + CH->SLOT[SLOT4].DT[kc]; - if (finc < 0) finc += OPN->fn_max; - CH->SLOT[SLOT4].phase += (finc*CH->SLOT[SLOT4].mul) >> 1; - } - else /* LFO phase modulation = zero */ - { - CH->SLOT[SLOT1].phase += CH->SLOT[SLOT1].Incr; - CH->SLOT[SLOT2].phase += CH->SLOT[SLOT2].Incr; - CH->SLOT[SLOT3].phase += CH->SLOT[SLOT3].Incr; - CH->SLOT[SLOT4].phase += CH->SLOT[SLOT4].Incr; - } -} - -INLINE void chan_calc(FM_OPN *OPN, FM_CH *CH, int chnum) -{ - unsigned int eg_out; - - UINT32 AM = LFO_AM >> CH->ams; - - - m2 = c1 = c2 = mem = 0; - - *CH->mem_connect = CH->mem_value; /* restore delayed sample (MEM) value to m2 or c2 */ - - eg_out = volume_calc(&CH->SLOT[SLOT1]); - { - INT32 out = CH->op1_out[0] + CH->op1_out[1]; - CH->op1_out[0] = CH->op1_out[1]; - - if( !CH->connect1 ){ - /* algorithm 5 */ - mem = c1 = c2 = CH->op1_out[0]; - } - else - { - /* other algorithms */ - *CH->connect1 += CH->op1_out[0]; - } - - CH->op1_out[1] = 0; - if( eg_out < ENV_QUIET ) /* SLOT 1 */ - { - if (!CH->FB) - out=0; - - CH->op1_out[1] = op_calc1(CH->SLOT[SLOT1].phase, eg_out, (out<FB) ); - } - } - - eg_out = volume_calc(&CH->SLOT[SLOT3]); - if( eg_out < ENV_QUIET ) /* SLOT 3 */ - *CH->connect3 += op_calc(CH->SLOT[SLOT3].phase, eg_out, m2); - - eg_out = volume_calc(&CH->SLOT[SLOT2]); - if( eg_out < ENV_QUIET ) /* SLOT 2 */ - *CH->connect2 += op_calc(CH->SLOT[SLOT2].phase, eg_out, c1); - - eg_out = volume_calc(&CH->SLOT[SLOT4]); - if( eg_out < ENV_QUIET ) /* SLOT 4 */ - *CH->connect4 += op_calc(CH->SLOT[SLOT4].phase, eg_out, c2); - - - /* store current MEM */ - CH->mem_value = mem; - - /* update phase counters AFTER output calculations */ - if(CH->pms) - { - /* add support for 3 slot mode */ - if ((OPN->ST.mode & 0xC0) && (chnum == 2)) - { - update_phase_lfo_slot(OPN, &CH->SLOT[SLOT1], CH->pms, OPN->SL3.block_fnum[1]); - update_phase_lfo_slot(OPN, &CH->SLOT[SLOT2], CH->pms, OPN->SL3.block_fnum[2]); - update_phase_lfo_slot(OPN, &CH->SLOT[SLOT3], CH->pms, OPN->SL3.block_fnum[0]); - update_phase_lfo_slot(OPN, &CH->SLOT[SLOT4], CH->pms, CH->block_fnum); - } - else update_phase_lfo_channel(OPN, CH); - } - else /* no LFO phase modulation */ - { - CH->SLOT[SLOT1].phase += CH->SLOT[SLOT1].Incr; - CH->SLOT[SLOT2].phase += CH->SLOT[SLOT2].Incr; - CH->SLOT[SLOT3].phase += CH->SLOT[SLOT3].Incr; - CH->SLOT[SLOT4].phase += CH->SLOT[SLOT4].Incr; - } -} - -/* update phase increment and envelope generator */ -INLINE void refresh_fc_eg_slot(FM_OPN *OPN, FM_SLOT *SLOT , int fc , int kc ) -{ - int ksr = kc >> SLOT->KSR; - - fc += SLOT->DT[kc]; - - /* detects frequency overflow (credits to Nemesis) */ - if (fc < 0) fc += OPN->fn_max; - - /* (frequency) phase increment counter */ - SLOT->Incr = (fc * SLOT->mul) >> 1; - - if( SLOT->ksr != ksr ) - { - SLOT->ksr = ksr; - - /* calculate envelope generator rates */ - if ((SLOT->ar + SLOT->ksr) < 32+62) - { - SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; - if ((OPN->type == TYPE_YM2612) || (OPN->type == TYPE_YM2608)) - { - SLOT->eg_sel_ar = eg_rate_select2612[SLOT->ar + SLOT->ksr ]; - } - else - { - SLOT->eg_sel_ar = eg_rate_select[SLOT->ar + SLOT->ksr ]; - } - } - else - { - SLOT->eg_sh_ar = 0; - SLOT->eg_sel_ar = 17*RATE_STEPS; - } - - SLOT->eg_sh_d1r = eg_rate_shift [SLOT->d1r + SLOT->ksr]; - SLOT->eg_sh_d2r = eg_rate_shift [SLOT->d2r + SLOT->ksr]; - SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr]; - - if ((OPN->type == TYPE_YM2612) || (OPN->type == TYPE_YM2608)) - { - SLOT->eg_sel_d1r= eg_rate_select2612[SLOT->d1r + SLOT->ksr]; - SLOT->eg_sel_d2r= eg_rate_select2612[SLOT->d2r + SLOT->ksr]; - SLOT->eg_sel_rr = eg_rate_select2612[SLOT->rr + SLOT->ksr]; - } - else - { - SLOT->eg_sel_d1r= eg_rate_select[SLOT->d1r + SLOT->ksr]; - SLOT->eg_sel_d2r= eg_rate_select[SLOT->d2r + SLOT->ksr]; - SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr]; - } - } -} - -/* update phase increment counters */ -/* Changed from INLINE to static to work around gcc 4.2.1 codegen bug */ -static void refresh_fc_eg_chan(FM_OPN *OPN, FM_CH *CH ) -{ - if( CH->SLOT[SLOT1].Incr==-1){ - int fc = CH->fc; - int kc = CH->kcode; - refresh_fc_eg_slot(OPN, &CH->SLOT[SLOT1] , fc , kc ); - refresh_fc_eg_slot(OPN, &CH->SLOT[SLOT2] , fc , kc ); - refresh_fc_eg_slot(OPN, &CH->SLOT[SLOT3] , fc , kc ); - refresh_fc_eg_slot(OPN, &CH->SLOT[SLOT4] , fc , kc ); - } -} - -/* initialize time tables */ -static void init_timetables( FM_ST *ST , const UINT8 *dttable ) -{ - int i,d; - double rate; - -#if 0 - logerror("FM.C: samplerate=%8i chip clock=%8i freqbase=%f \n", - ST->rate, ST->clock, ST->freqbase ); -#endif - - /* DeTune table */ - for (d = 0;d <= 3;d++){ - for (i = 0;i <= 31;i++){ - rate = ((double)dttable[d*32 + i]) * SIN_LEN * ST->freqbase * (1<dt_tab[d][i] = (INT32) rate; - ST->dt_tab[d+4][i] = -ST->dt_tab[d][i]; -#if 0 - logerror("FM.C: DT [%2i %2i] = %8x \n", d, i, ST->dt_tab[d][i] ); -#endif - } - } - -} - - -static void reset_channels( FM_ST *ST , FM_CH *CH , int num ) -{ - int c,s; - - ST->mode = 0; /* normal mode */ - ST->TA = 0; - ST->TAC = 0; - ST->TB = 0; - ST->TBC = 0; - - for( c = 0 ; c < num ; c++ ) - { - CH[c].fc = 0; - for(s = 0 ; s < 4 ; s++ ) - { - CH[c].SLOT[s].ssg = 0; - CH[c].SLOT[s].ssgn = 0; - CH[c].SLOT[s].state= EG_OFF; - CH[c].SLOT[s].volume = MAX_ATT_INDEX; - CH[c].SLOT[s].vol_out= MAX_ATT_INDEX; - } - } -} - -/* initialize generic tables */ -static int init_tables(void) -{ - signed int i,x; - signed int n; - double o,m; - - for (x=0; x>= 4; /* 12 bits here */ - if (n&1) /* round to nearest */ - n = (n>>1)+1; - else - n = n>>1; - /* 11 bits here (rounded) */ - n <<= 2; /* 13 bits here (as in real chip) */ - tl_tab[ x*2 + 0 ] = n; - tl_tab[ x*2 + 1 ] = -tl_tab[ x*2 + 0 ]; - - for (i=1; i<13; i++) - { - tl_tab[ x*2+0 + i*2*TL_RES_LEN ] = tl_tab[ x*2+0 ]>>i; - tl_tab[ x*2+1 + i*2*TL_RES_LEN ] = -tl_tab[ x*2+0 + i*2*TL_RES_LEN ]; - } - #if 0 - logerror("tl %04i", x); - for (i=0; i<13; i++) - logerror(", [%02i] %4x", i*2, tl_tab[ x*2 /*+1*/ + i*2*TL_RES_LEN ]); - logerror("\n"); - } - #endif - } - /*logerror("FM.C: TL_TAB_LEN = %i elements (%i bytes)\n",TL_TAB_LEN, (int)sizeof(tl_tab));*/ - - - for (i=0; i0.0) - o = 8*log(1.0/m)/log(2.0); /* convert to 'decibels' */ - else - o = 8*log(-1.0/m)/log(2.0); /* convert to 'decibels' */ - - o = o / (ENV_STEP/4); - - n = (int)(2.0*o); - if (n&1) /* round to nearest */ - n = (n>>1)+1; - else - n = n>>1; - - sin_tab[ i ] = n*2 + (m>=0.0? 0: 1 ); - /*logerror("FM.C: sin [%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[i],tl_tab[sin_tab[i]]);*/ - } - - /*logerror("FM.C: ENV_QUIET= %08x\n",ENV_QUIET );*/ - - - /* build LFO PM modulation table */ - for(i = 0; i < 8; i++) /* 8 PM depths */ - { - UINT8 fnum; - for (fnum=0; fnum<128; fnum++) /* 7 bits meaningful of F-NUMBER */ - { - UINT8 value; - UINT8 step; - UINT32 offset_depth = i; - UINT32 offset_fnum_bit; - UINT32 bit_tmp; - - for (step=0; step<8; step++) - { - value = 0; - for (bit_tmp=0; bit_tmp<7; bit_tmp++) /* 7 bits */ - { - if (fnum & (1<SLOT[SLOT1].key) - { - FM_KEYON(type, CH,SLOT1); - FM_KEYOFF(CH, SLOT1); - } - if (!CH->SLOT[SLOT2].key) - { - FM_KEYON(type, CH,SLOT2); - FM_KEYOFF(CH, SLOT2); - } - if (!CH->SLOT[SLOT3].key) - { - FM_KEYON(type, CH,SLOT3); - FM_KEYOFF(CH, SLOT3); - } - if (!CH->SLOT[SLOT4].key) - { - FM_KEYON(type, CH,SLOT4); - FM_KEYOFF(CH, SLOT4); - } -} - -#ifdef _STATE_H -/* FM channel save , internal state only */ -static void FMsave_state_channel(const char *name,int num,FM_CH *CH,int num_ch) -{ - int slot , ch; - char state_name[20]; - const char slot_array[4] = { 1 , 3 , 2 , 4 }; - - for(ch=0;chop1_out , 2); - state_save_register_UINT32(state_name, num, "phasestep" , &CH->fc , 1); - /* slots */ - for(slot=0;slot<4;slot++) - { - FM_SLOT *SLOT = &CH->SLOT[slot]; - - sprintf(state_name,"%s.CH%d.SLOT%d",name,ch,slot_array[slot]); - state_save_register_UINT32(state_name, num, "phasecount" , &SLOT->phase, 1); - state_save_register_UINT8 (state_name, num, "state" , &SLOT->state, 1); - state_save_register_INT32 (state_name, num, "volume" , &SLOT->volume, 1); - } - } -} - -static void FMsave_state_st(const char *state_name,int num,FM_ST *ST) -{ -#if FM_BUSY_FLAG_SUPPORT - state_save_register_double(state_name, num, "BusyExpire", &ST->BusyExpire , 1); -#endif - state_save_register_UINT8 (state_name, num, "address" , &ST->address , 1); - state_save_register_UINT8 (state_name, num, "IRQ" , &ST->irq , 1); - state_save_register_UINT8 (state_name, num, "IRQ MASK" , &ST->irqmask , 1); - state_save_register_UINT8 (state_name, num, "status" , &ST->status , 1); - state_save_register_UINT32(state_name, num, "mode" , &ST->mode , 1); - state_save_register_UINT8 (state_name, num, "prescaler" , &ST->prescaler_sel , 1); - state_save_register_UINT8 (state_name, num, "freq latch", &ST->fn_h , 1); - state_save_register_int (state_name, num, "TIMER A" , &ST->TA ); - state_save_register_int (state_name, num, "TIMER Acnt", &ST->TAC ); - state_save_register_UINT8 (state_name, num, "TIMER B" , &ST->TB , 1); - state_save_register_int (state_name, num, "TIMER Bcnt", &ST->TBC ); -} -#endif /* _STATE_H */ - -#if BUILD_OPN - - - -/* prescaler set (and make time tables) */ -static void OPNSetPres(FM_OPN *OPN , int pres , int TimerPres, int SSGpres) -{ - int i; - - /* frequency base */ - OPN->ST.freqbase = (OPN->ST.rate) ? ((double)OPN->ST.clock / OPN->ST.rate) / pres : 0; - -#if 0 - OPN->ST.rate = (double)OPN->ST.clock / pres; - OPN->ST.freqbase = 1.0; -#endif - - OPN->eg_timer_add = (1<ST.freqbase; - OPN->eg_timer_overflow = ( 3 ) * (1<ST.TimerBase = 1.0/((double)OPN->ST.clock / (double)TimerPres); - - /* SSG part prescaler set */ - if( SSGpres ) SSGClk( OPN->ST.index, OPN->ST.clock * 2 / SSGpres ); - - /* make time tables */ - init_timetables( &OPN->ST, dt_tab ); - - /* there are 2048 FNUMs that can be generated using FNUM/BLK registers - but LFO works with one more bit of a precision so we really need 4096 elements */ - /* calculate fnumber -> increment counter table */ - for(i = 0; i < 4096; i++) - { - /* freq table for octave 7 */ - /* OPN phase increment counter = 20bit */ - OPN->fn_table[i] = (UINT32)( (double)i * 32 * OPN->ST.freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ -#if 0 - logerror("FM.C: fn_table[%4i] = %08x (dec=%8i)\n", - i, OPN->fn_table[i]>>6,OPN->fn_table[i]>>6 ); -#endif - } - - /* maximal frequency is required for Phase overflow calculation, register size is 17 bits (Nemesis) */ - OPN->fn_max = (UINT32)( (double)0x20000 * OPN->ST.freqbase * (1<<(FREQ_SH-10)) ); - - /* LFO freq. table */ - for(i = 0; i < 8; i++) - { - /* Amplitude modulation: 64 output levels (triangle waveform); 1 level lasts for one of "lfo_samples_per_step" samples */ - /* Phase modulation: one entry from lfo_pm_output lasts for one of 4 * "lfo_samples_per_step" samples */ - OPN->lfo_freq[i] = (1.0 / lfo_samples_per_step[i]) * (1<ST.freqbase; -#if 0 - logerror("FM.C: lfo_freq[%i] = %08x (dec=%8i)\n", - i, OPN->lfo_freq[i],OPN->lfo_freq[i] ); -#endif - } -} - - - -/* write a OPN mode register 0x20-0x2f */ -static void OPNWriteMode(FM_OPN *OPN, int r, int v) -{ - UINT8 c; - FM_CH *CH; - - switch(r){ - case 0x21: /* Test */ - break; - case 0x22: /* LFO FREQ (YM2608/YM2610/YM2610B/YM2612) */ - if( OPN->type & TYPE_LFOPAN ) - { - if (v&0x08) /* LFO enabled ? */ - { - OPN->lfo_inc = OPN->lfo_freq[v&7]; - } - else - { - OPN->lfo_inc = 0; - } - } - break; - case 0x24: /* timer A High 8*/ - OPN->ST.TA = (OPN->ST.TA & 0x03)|(((int)v)<<2); - break; - case 0x25: /* timer A Low 2*/ - OPN->ST.TA = (OPN->ST.TA & 0x3fc)|(v&3); - break; - case 0x26: /* timer B */ - OPN->ST.TB = v; - break; - case 0x27: /* mode, timer control */ - set_timers( &(OPN->ST),OPN->ST.index,v ); - break; - case 0x28: /* key on / off */ - c = v & 0x03; - if( c == 3 ) break; - if( (v&0x04) && (OPN->type & TYPE_6CH) ) c+=3; - CH = OPN->P_CH; - CH = &CH[c]; - if(v&0x10) FM_KEYON(OPN->type, CH,SLOT1); else FM_KEYOFF(CH,SLOT1); - if(v&0x20) FM_KEYON(OPN->type, CH,SLOT2); else FM_KEYOFF(CH,SLOT2); - if(v&0x40) FM_KEYON(OPN->type, CH,SLOT3); else FM_KEYOFF(CH,SLOT3); - if(v&0x80) FM_KEYON(OPN->type, CH,SLOT4); else FM_KEYOFF(CH,SLOT4); - break; - } -} - -/* write a OPN register (0x30-0xff) */ -static void OPNWriteReg(FM_OPN *OPN, int r, int v) -{ - FM_CH *CH; - FM_SLOT *SLOT; - - UINT8 c = OPN_CHAN(r); - - if (c == 3) return; /* 0xX3,0xX7,0xXB,0xXF */ - - if (r >= 0x100) c+=3; - - CH = OPN->P_CH; - CH = &CH[c]; - - SLOT = &(CH->SLOT[OPN_SLOT(r)]); - - switch( r & 0xf0 ) { - case 0x30: /* DET , MUL */ - set_det_mul(&OPN->ST,CH,SLOT,v); - break; - - case 0x40: /* TL */ - set_tl(CH,SLOT,v); - break; - - case 0x50: /* KS, AR */ - set_ar_ksr(OPN->type, CH,SLOT,v); - break; - - case 0x60: /* bit7 = AM ENABLE, DR */ - set_dr(OPN->type, SLOT,v); - - if(OPN->type & TYPE_LFOPAN) /* YM2608/2610/2610B/2612 */ - { - SLOT->AMmask = (v&0x80) ? ~0 : 0; - } - break; - - case 0x70: /* SR */ - set_sr(OPN->type, SLOT,v); - break; - - case 0x80: /* SL, RR */ - set_sl_rr(OPN->type, SLOT,v); - break; - - case 0x90: /* SSG-EG */ - SLOT->ssg = v&0x0f; - SLOT->ssgn = (v&0x04)>>1; /* bit 1 in ssgn = attack */ - - /* SSG-EG envelope shapes : - - E AtAlH - 1 0 0 0 \\\\ - - 1 0 0 1 \___ - - 1 0 1 0 \/\/ - ___ - 1 0 1 1 \ - - 1 1 0 0 //// - ___ - 1 1 0 1 / - - 1 1 1 0 /\/\ - - 1 1 1 1 /___ - - - E = SSG-EG enable - - - The shapes are generated using Attack, Decay and Sustain phases. - - Each single character in the diagrams above represents this whole - sequence: - - - when KEY-ON = 1, normal Attack phase is generated (*without* any - difference when compared to normal mode), - - - later, when envelope level reaches minimum level (max volume), - the EG switches to Decay phase (which works with bigger steps - when compared to normal mode - see below), - - - later when envelope level passes the SL level, - the EG swithes to Sustain phase (which works with bigger steps - when compared to normal mode - see below), - - - finally when envelope level reaches maximum level (min volume), - the EG switches to Attack phase again (depends on actual waveform). - - Important is that when switch to Attack phase occurs, the phase counter - of that operator will be zeroed-out (as in normal KEY-ON) but not always. - (I havent found the rule for that - perhaps only when the output level is low) - - The difference (when compared to normal Envelope Generator mode) is - that the resolution in Decay and Sustain phases is 4 times lower; - this results in only 256 steps instead of normal 1024. - In other words: - when SSG-EG is disabled, the step inside of the EG is one, - when SSG-EG is enabled, the step is four (in Decay and Sustain phases). - - Times between the level changes are the same in both modes. - - - Important: - Decay 1 Level (so called SL) is compared to actual SSG-EG output, so - it is the same in both SSG and no-SSG modes, with this exception: - - when the SSG-EG is enabled and is generating raising levels - (when the EG output is inverted) the SL will be found at wrong level !!! - For example, when SL=02: - 0 -6 = -6dB in non-inverted EG output - 96-6 = -90dB in inverted EG output - Which means that EG compares its level to SL as usual, and that the - output is simply inverted afterall. - - - The Yamaha's manuals say that AR should be set to 0x1f (max speed). - That is not necessary, but then EG will be generating Attack phase. - - */ - - - break; - - case 0xa0: - switch( OPN_SLOT(r) ){ - case 0: /* 0xa0-0xa2 : FNUM1 */ - { - UINT32 fn = (((UINT32)( (OPN->ST.fn_h)&7))<<8) + v; - UINT8 blk = OPN->ST.fn_h>>3; - /* keyscale code */ - CH->kcode = (blk<<2) | opn_fktable[fn >> 7]; - /* phase increment counter */ - CH->fc = OPN->fn_table[fn*2]>>(7-blk); - - /* store fnum in clear form for LFO PM calculations */ - CH->block_fnum = (blk<<11) | fn; - - CH->SLOT[SLOT1].Incr=-1; - } - break; - case 1: /* 0xa4-0xa6 : FNUM2,BLK */ - OPN->ST.fn_h = v&0x3f; - break; - case 2: /* 0xa8-0xaa : 3CH FNUM1 */ - if(r < 0x100) - { - UINT32 fn = (((UINT32)(OPN->SL3.fn_h&7))<<8) + v; - UINT8 blk = OPN->SL3.fn_h>>3; - /* keyscale code */ - OPN->SL3.kcode[c]= (blk<<2) | opn_fktable[fn >> 7]; - /* phase increment counter */ - OPN->SL3.fc[c] = OPN->fn_table[fn*2]>>(7-blk); - OPN->SL3.block_fnum[c] = (blk<<11) | fn; - (OPN->P_CH)[2].SLOT[SLOT1].Incr=-1; - } - break; - case 3: /* 0xac-0xae : 3CH FNUM2,BLK */ - if(r < 0x100) - OPN->SL3.fn_h = v&0x3f; - break; - } - break; - - case 0xb0: - switch( OPN_SLOT(r) ){ - case 0: /* 0xb0-0xb2 : FB,ALGO */ - { - int feedback = (v>>3)&7; - CH->ALGO = v&7; - CH->FB = feedback ? feedback+6 : 0; - setup_connection( CH, c ); - } - break; - case 1: /* 0xb4-0xb6 : L , R , AMS , PMS (YM2612/YM2610B/YM2610/YM2608) */ - if( OPN->type & TYPE_LFOPAN) - { - /* b0-2 PMS */ - CH->pms = (v & 7) * 32; /* CH->pms = PM depth * 32 (index in lfo_pm_table) */ - - /* b4-5 AMS */ - CH->ams = lfo_ams_depth_shift[(v>>4) & 0x03]; - - /* PAN : b7 = L, b6 = R */ - OPN->pan[ c*2 ] = (v & 0x80) ? ~0 : 0; - OPN->pan[ c*2+1 ] = (v & 0x40) ? ~0 : 0; - - } - break; - } - break; - } -} - -#endif /* BUILD_OPN */ - -#if BUILD_OPN_PRESCALER -/* - prescaler circuit (best guess to verified chip behaviour) - - +--------------+ +-sel2-+ - | +--|in20 | - +---+ | +-sel1-+ | | -M-CLK -+-|1/2|-+--|in10 | +---+ | out|--INT_CLOCK - | +---+ | out|-|1/3|-|in21 | - +----------|in11 | +---+ +------+ - +------+ - -reg.2d : sel2 = in21 (select sel2) -reg.2e : sel1 = in11 (select sel1) -reg.2f : sel1 = in10 , sel2 = in20 (clear selector) -reset : sel1 = in11 , sel2 = in21 (clear both) - -*/ -void OPNPrescaler_w(FM_OPN *OPN , int addr, int pre_divider) -{ - static const int opn_pres[4] = { 2*12 , 2*12 , 6*12 , 3*12 }; - static const int ssg_pres[4] = { 1 , 1 , 4 , 2 }; - int sel; - - switch(addr) - { - case 0: /* when reset */ - OPN->ST.prescaler_sel = 2; - break; - case 1: /* when postload */ - break; - case 0x2d: /* divider sel : select 1/1 for 1/3line */ - OPN->ST.prescaler_sel |= 0x02; - break; - case 0x2e: /* divider sel , select 1/3line for output */ - OPN->ST.prescaler_sel |= 0x01; - break; - case 0x2f: /* divider sel , clear both selector to 1/2,1/2 */ - OPN->ST.prescaler_sel = 0; - break; - } - sel = OPN->ST.prescaler_sel & 3; - /* update prescaler */ - OPNSetPres( OPN, opn_pres[sel]*pre_divider, - opn_pres[sel]*pre_divider, - ssg_pres[sel]*pre_divider ); -} -#endif /* BUILD_OPN_PRESCALER */ - -#if BUILD_YM2203 -/*****************************************************************************/ -/* YM2203 local section */ -/*****************************************************************************/ - -/* here's the virtual YM2203(OPN) */ -typedef struct -{ -#ifdef _STATE_H - UINT8 REGS[256]; /* registers */ -#endif - FM_OPN OPN; /* OPN state */ - FM_CH CH[3]; /* channel state */ -} YM2203; - -static YM2203 *FM2203=NULL; /* array of YM2203's */ -static int YM2203NumChips; /* number of chips */ - -/* Generate samples for one of the YM2203s */ -void YM2203UpdateOne(int num, INT16 *buffer, int length) -{ - YM2203 *F2203 = &(FM2203[num]); - FM_OPN *OPN = &(FM2203[num].OPN); - int i; - FMSAMPLE *buf = buffer; - - cur_chip = (void *)F2203; - State = &F2203->OPN.ST; - cch[0] = &F2203->CH[0]; - cch[1] = &F2203->CH[1]; - cch[2] = &F2203->CH[2]; - - - /* refresh PG and EG */ - refresh_fc_eg_chan( OPN, cch[0] ); - refresh_fc_eg_chan( OPN, cch[1] ); - if( (State->mode & 0xc0) ) - { - /* 3SLOT MODE */ - if( cch[2]->SLOT[SLOT1].Incr==-1) - { - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT4] , cch[2]->fc , cch[2]->kcode ); - } - }else refresh_fc_eg_chan( OPN, cch[2] ); - - - /* YM2203 doesn't have LFO so we must keep these globals at 0 level */ - LFO_AM = 0; - LFO_PM = 0; - - /* buffering */ - for (i=0; i < length ; i++) - { - /* clear outputs */ - out_fm[0] = 0; - out_fm[1] = 0; - out_fm[2] = 0; - - /* advance envelope generator */ - OPN->eg_timer += OPN->eg_timer_add; - while (OPN->eg_timer >= OPN->eg_timer_overflow) - { - OPN->eg_timer -= OPN->eg_timer_overflow; - OPN->eg_cnt++; - - advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); - } - - /* calculate FM */ - chan_calc(OPN, cch[0], 0 ); - chan_calc(OPN, cch[1], 1 ); - chan_calc(OPN, cch[2], 2 ); - - /* buffering */ - { - int lt; - - lt = out_fm[0] + out_fm[1] + out_fm[2]; - - lt >>= FINAL_SH; - - Limit( lt , MAXOUT, MINOUT ); - - #ifdef SAVE_SAMPLE - SAVE_ALL_CHANNELS - #endif - - /* buffering */ - buf[i] = lt; - } - - /* timer A control */ - INTERNAL_TIMER_A( State , cch[2] ) - } - INTERNAL_TIMER_B(State,length) -} - -/* ---------- reset one of chip ---------- */ -void YM2203ResetChip(int num) -{ - int i; - FM_OPN *OPN = &(FM2203[num].OPN); - - /* Reset Prescaler */ - OPNPrescaler_w(OPN, 0 , 1 ); - /* reset SSG section */ - SSGReset(OPN->ST.index); - /* status clear */ - FM_IRQMASK_SET(&OPN->ST,0x03); - FM_BUSY_CLEAR(&OPN->ST); - OPNWriteMode(OPN,0x27,0x30); /* mode 0 , timer reset */ - - OPN->eg_timer = 0; - OPN->eg_cnt = 0; - - FM_STATUS_RESET(&OPN->ST, 0xff); - - reset_channels( &OPN->ST , FM2203[num].CH , 3 ); - /* reset OPerator paramater */ - for(i = 0xb2 ; i >= 0x30 ; i-- ) OPNWriteReg(OPN,i,0); - for(i = 0x26 ; i >= 0x20 ; i-- ) OPNWriteReg(OPN,i,0); -} - -#ifdef _STATE_H -static void YM2203_postload(void) -{ - int num , r; - - for(num=0;numST.address = (v &= 0xff); - - /* Write register to SSG emulator */ - if( v < 16 ) SSGWrite(n,0,v); - - /* prescaler select : 2d,2e,2f */ - if( v >= 0x2d && v <= 0x2f ) - OPNPrescaler_w(OPN , v , 1); - } - else - { /* data port */ - int addr = OPN->ST.address; -#ifdef _STATE_H - FM2203[n].REGS[addr] = v; -#endif - switch( addr & 0xf0 ) - { - case 0x00: /* 0x00-0x0f : SSG section */ - /* Write data to SSG emulator */ - SSGWrite(n,a,v); - break; - case 0x20: /* 0x20-0x2f : Mode section */ - YM2203UpdateReq(n); - /* write register */ - OPNWriteMode(OPN,addr,v); - break; - default: /* 0x30-0xff : OPN section */ - YM2203UpdateReq(n); - /* write register */ - OPNWriteReg(OPN,addr,v); - } - FM_BUSY_SET(&OPN->ST,1); - } - return OPN->ST.irq; -} - -UINT8 YM2203Read(int n,int a) -{ - YM2203 *F2203 = &(FM2203[n]); - int addr = F2203->OPN.ST.address; - UINT8 ret = 0; - - if( !(a&1) ) - { /* status port */ - ret = FM_STATUS_FLAG(&F2203->OPN.ST); - } - else - { /* data port (only SSG) */ - if( addr < 16 ) ret = SSGRead(n); - } - return ret; -} - -int YM2203TimerOver(int n,int c) -{ - YM2203 *F2203 = &(FM2203[n]); - - if( c ) - { /* Timer B */ - TimerBOver( &(F2203->OPN.ST) ); - } - else - { /* Timer A */ - YM2203UpdateReq(n); - /* timer update */ - TimerAOver( &(F2203->OPN.ST) ); - /* CSM mode key,TL control */ - if( F2203->OPN.ST.mode & 0x80 ) - { /* CSM mode auto key on */ - CSMKeyControll( F2203->OPN.type, &(F2203->CH[2]) ); - } - } - return F2203->OPN.ST.irq; -} -#endif /* BUILD_YM2203 */ - - - -#if (BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B) - -/* ADPCM type A channel struct */ -typedef struct -{ - UINT8 flag; /* port state */ - UINT8 flagMask; /* arrived flag mask */ - UINT8 now_data; /* current ROM data */ - UINT32 now_addr; /* current ROM address */ - UINT32 now_step; - UINT32 step; - UINT32 start; /* sample data start address*/ - UINT32 end; /* sample data end address */ - UINT8 IL; /* Instrument Level */ - INT32 adpcm_acc; /* accumulator */ - INT32 adpcm_step; /* step */ - INT32 adpcm_out; /* (speedup) hiro-shi!! */ - INT8 vol_mul; /* volume in "0.75dB" steps */ - UINT8 vol_shift; /* volume in "-6dB" steps */ - INT32 *pan; /* &out_adpcm[OPN_xxxx] */ -} ADPCM_CH; - -/* here's the virtual YM2610 */ -typedef struct -{ -#ifdef _STATE_H - UINT8 REGS[512]; /* registers */ -#endif - FM_OPN OPN; /* OPN state */ - FM_CH CH[6]; /* channel state */ - UINT8 addr_A1; /* address line A1 */ - - /* ADPCM-A unit */ - UINT8 *pcmbuf; /* pcm rom buffer */ - UINT32 pcm_size; /* size of pcm rom */ - UINT8 adpcmTL; /* adpcmA total level */ - ADPCM_CH adpcm[6]; /* adpcm channels */ - UINT32 adpcmreg[0x30]; /* registers */ - UINT8 adpcm_arrivedEndAddress; - YM_DELTAT deltaT; /* Delta-T ADPCM unit */ - - UINT8 flagmask; /* YM2608 only */ - UINT8 irqmask; /* YM2608 only */ -} YM2610; - -/* here is the virtual YM2608 */ -typedef YM2610 YM2608; - - -/**** YM2610 ADPCM defines ****/ -#define ADPCM_SHIFT (16) /* frequency step rate */ -#define ADPCMA_ADDRESS_SHIFT 8 /* adpcm A address shift */ - -static UINT8 *pcmbufA; -static UINT32 pcmsizeA; - - -/* Algorithm and tables verified on real YM2608 and YM2610 */ - -/* usual ADPCM table (16 * 1.1^N) */ -static int steps[49] = -{ - 16, 17, 19, 21, 23, 25, 28, - 31, 34, 37, 41, 45, 50, 55, - 60, 66, 73, 80, 88, 97, 107, - 118, 130, 143, 157, 173, 190, 209, - 230, 253, 279, 307, 337, 371, 408, - 449, 494, 544, 598, 658, 724, 796, - 876, 963, 1060, 1166, 1282, 1411, 1552 -}; - -/* different from the usual ADPCM table */ -static int step_inc[8] = { -1*16, -1*16, -1*16, -1*16, 2*16, 5*16, 7*16, 9*16 }; - -/* speedup purposes only */ -static int jedi_table[ 49*16 ]; - - -static void Init_ADPCMATable(void){ - - int step, nib; - - for (step = 0; step < 49; step++) - { - /* loop over all nibbles and compute the difference */ - for (nib = 0; nib < 16; nib++) - { - int value = (2*(nib & 0x07) + 1) * steps[step] / 8; - jedi_table[step*16 + nib] = (nib&0x08) ? -value : value; - } - } -} - -/* ADPCM A (Non control type) : calculate one channel output */ -INLINE void ADPCMA_calc_chan( YM2610 *F2610, ADPCM_CH *ch ) -{ - UINT32 step; - UINT8 data; - - - ch->now_step += ch->step; - if ( ch->now_step >= (1<now_step >> ADPCM_SHIFT; - ch->now_step &= (1< instead of == */ - /* YM2610 checks lower 20 bits only, the 4 MSB bits are sample bank */ - /* Here we use 1<<21 to compensate for nibble calculations */ - - if ( (ch->now_addr & ((1<<21)-1)) == ((ch->end<<1) & ((1<<21)-1)) ) - { - ch->flag = 0; - F2610->adpcm_arrivedEndAddress |= ch->flagMask; - return; - } -#if 0 - if ( ch->now_addr > (pcmsizeA<<1) ) { - LOG(LOG_WAR,("YM2610: Attempting to play past adpcm rom size!\n" )); - return; - } -#endif - if ( ch->now_addr&1 ) - data = ch->now_data & 0x0f; - else - { - ch->now_data = *(pcmbufA+(ch->now_addr>>1)); - data = (ch->now_data >> 4) & 0x0f; - } - - ch->now_addr++; - - ch->adpcm_acc += jedi_table[ch->adpcm_step + data]; - - /* extend 12-bit signed int */ - if (ch->adpcm_acc & 0x800) - ch->adpcm_acc |= ~0xfff; - else - ch->adpcm_acc &= 0xfff; - - ch->adpcm_step += step_inc[data & 7]; - Limit( ch->adpcm_step, 48*16, 0*16 ); - - }while(--step); - - /* calc pcm * volume data */ - ch->adpcm_out = ((ch->adpcm_acc * ch->vol_mul) >> ch->vol_shift) & ~3; /* multiply, shift and mask out 2 LSB bits */ - } - - /* output for work of output channels (out_adpcm[OPNxxxx])*/ - *(ch->pan) += ch->adpcm_out; -} - -/* ADPCM type A Write */ -static void FM_ADPCMAWrite(YM2610 *F2610,int r,int v) -{ - ADPCM_CH *adpcm = F2610->adpcm; - UINT8 c = r&0x07; - - F2610->adpcmreg[r] = v&0xff; /* stock data */ - switch( r ){ - case 0x00: /* DM,--,C5,C4,C3,C2,C1,C0 */ - if( !(v&0x80) ) - { - /* KEY ON */ - for( c = 0; c < 6; c++ ) - { - if( (v>>c)&1 ) - { - /**** start adpcm ****/ - adpcm[c].step = (UINT32)((float)(1<OPN.ST.freqbase)/3.0); - adpcm[c].now_addr = adpcm[c].start<<1; - adpcm[c].now_step = 0; - adpcm[c].adpcm_acc = 0; - adpcm[c].adpcm_step= 0; - adpcm[c].adpcm_out = 0; - adpcm[c].flag = 1; - - if(F2610->pcmbuf==NULL){ /* Check ROM Mapped */ - logerror("YM2608-YM2610: ADPCM-A rom not mapped\n"); - adpcm[c].flag = 0; - } else{ - if(adpcm[c].end >= F2610->pcm_size){ /* Check End in Range */ - logerror("YM2610: ADPCM-A end out of range: $%08x\n",adpcm[c].end); - /*adpcm[c].end = F2610->pcm_size-1;*/ /* JB: DO NOT uncomment this, otherwise you will break the comparison in the ADPCM_CALC_CHA() */ - } - if(adpcm[c].start >= F2610->pcm_size) /* Check Start in Range */ - { - logerror("YM2608-YM2610: ADPCM-A start out of range: $%08x\n",adpcm[c].start); - adpcm[c].flag = 0; - } - } - } - } - } - else - { - /* KEY OFF */ - for( c = 0; c < 6; c++ ) - if( (v>>c)&1 ) - adpcm[c].flag = 0; - } - break; - case 0x01: /* B0-5 = TL */ - F2610->adpcmTL = (v & 0x3f) ^ 0x3f; - for( c = 0; c < 6; c++ ) - { - int volume = F2610->adpcmTL + adpcm[c].IL; - - if ( volume >= 63 ) /* This is correct, 63 = quiet */ - { - adpcm[c].vol_mul = 0; - adpcm[c].vol_shift = 0; - } - else - { - adpcm[c].vol_mul = 15 - (volume & 7); /* so called 0.75 dB */ - adpcm[c].vol_shift = 1 + (volume >> 3); /* Yamaha engineers used the approximation: each -6 dB is close to divide by two (shift right) */ - } - - /* calc pcm * volume data */ - adpcm[c].adpcm_out = ((adpcm[c].adpcm_acc * adpcm[c].vol_mul) >> adpcm[c].vol_shift) & ~3; /* multiply, shift and mask out low 2 bits */ - } - break; - default: - c = r&0x07; - if( c >= 0x06 ) return; - switch( r&0x38 ){ - case 0x08: /* B7=L,B6=R, B4-0=IL */ - { - int volume; - - adpcm[c].IL = (v & 0x1f) ^ 0x1f; - - volume = F2610->adpcmTL + adpcm[c].IL; - - if ( volume >= 63 ) /* This is correct, 63 = quiet */ - { - adpcm[c].vol_mul = 0; - adpcm[c].vol_shift = 0; - } - else - { - adpcm[c].vol_mul = 15 - (volume & 7); /* so called 0.75 dB */ - adpcm[c].vol_shift = 1 + (volume >> 3); /* Yamaha engineers used the approximation: each -6 dB is close to divide by two (shift right) */ - } - - adpcm[c].pan = &out_adpcm[(v>>6)&0x03]; - - /* calc pcm * volume data */ - adpcm[c].adpcm_out = ((adpcm[c].adpcm_acc * adpcm[c].vol_mul) >> adpcm[c].vol_shift) & ~3; /* multiply, shift and mask out low 2 bits */ - } - break; - case 0x10: - case 0x18: - adpcm[c].start = ( (F2610->adpcmreg[0x18 + c]*0x0100 | F2610->adpcmreg[0x10 + c]) << ADPCMA_ADDRESS_SHIFT); - if ( pcmsizeA > 0x1000000 ) // KOF98AE sample banking support - { - if ( F2610->adpcmreg[0x08 + c] >= 0xf0 ) - { - adpcm[c].start += 0x1000000; - } - } - break; - case 0x20: - case 0x28: - adpcm[c].end = ( (F2610->adpcmreg[0x28 + c]*0x0100 | F2610->adpcmreg[0x20 + c]) << ADPCMA_ADDRESS_SHIFT); - adpcm[c].end += (1< 0x1000000 ) // KOF98AE sample banking support - { - if ( F2610->adpcmreg[0x08 + c] >= 0xf0 ) - { - adpcm[c].end += 0x1000000; - } - } - break; - } - } -} - -#ifdef _STATE_H -/* FM channel save , internal state only */ -static void FMsave_state_adpcma(const char *name,int num,ADPCM_CH *adpcm) -{ - int ch; - char state_name[20]; - - for(ch=0;ch<6;ch++,adpcm++) - { - sprintf(state_name,"%s.CH%d",name,ch); - - state_save_register_UINT8 (state_name, num, "flag" , &adpcm->flag , 1); - state_save_register_UINT8 (state_name, num, "data" , &adpcm->now_data , 1); - state_save_register_UINT32(state_name, num, "addr" , &adpcm->now_addr , 1); - state_save_register_UINT32(state_name, num, "step" , &adpcm->now_step , 1); - state_save_register_INT32 (state_name, num, "a_acc" , &adpcm->adpcm_acc , 1); - state_save_register_INT32 (state_name, num, "a_step" , &adpcm->adpcm_step, 1); - state_save_register_INT32 (state_name, num, "a_out" , &adpcm->adpcm_out , 1); - } -} -#endif /* _STATE_H */ - -#endif /* (BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B) */ - - -#if BUILD_YM2608 -/*****************************************************************************/ -/* YM2608 local section */ -/*****************************************************************************/ -static YM2608 *FM2608=NULL; /* array of YM2608's */ -static int YM2608NumChips; /* total chip */ - - - - - -static unsigned int YM2608_ADPCM_ROM_addr[2*6] = { -0x0000, 0x01bf, /* bass drum */ -0x01c0, 0x043f, /* snare drum */ -0x0440, 0x1b7f, /* top cymbal */ -0x1b80, 0x1cff, /* high hat */ -0x1d00, 0x1f7f, /* tom tom */ -0x1f80, 0x1fff /* rim shot */ -}; - - -/* - This data is derived from the chip's output - internal ROM can't be read. - It was verified, using real YM2608, that this ADPCM stream produces 100% correct output signal. -*/ - -static unsigned char *YM2608_ADPCM_ROM = NULL; - -/* flag enable control 0x110 */ -INLINE void YM2608IRQFlagWrite(FM_OPN *OPN, int n, int v) -{ - YM2608 *F2608 = &(FM2608[n]); - - if( v & 0x80 ) - { /* Reset IRQ flag */ - FM_STATUS_RESET(&OPN->ST, 0xf7); /* don't touch BUFRDY flag otherwise we'd have to call ymdeltat module to set the flag back */ - } - else - { /* Set status flag mask */ - F2608->flagmask = (~(v&0x1f)); - FM_IRQMASK_SET(&OPN->ST, (F2608->irqmask & F2608->flagmask) ); - } -} - -/* compatible mode & IRQ enable control 0x29 */ -INLINE void YM2608IRQMaskWrite(FM_OPN *OPN, int n, int v) -{ - YM2608 *F2608 = &(FM2608[n]); - /* SCH,xx,xxx,EN_ZERO,EN_BRDY,EN_EOS,EN_TB,EN_TA */ - - /* extend 3ch. enable/disable */ - if(v&0x80) - OPN->type |= TYPE_6CH; /* OPNA mode - 6 FM channels */ - else - OPN->type &= ~TYPE_6CH; /* OPN mode - 3 FM channels */ - - /* IRQ MASK store and set */ - F2608->irqmask = v&0x1f; - FM_IRQMASK_SET(&OPN->ST, (F2608->irqmask & F2608->flagmask) ); -} - -/* Generate samples for one of the YM2608s */ -void YM2608UpdateOne(int num, INT16 **buffer, int length) -{ - YM2608 *F2608 = &(FM2608[num]); - FM_OPN *OPN = &(FM2608[num].OPN); - YM_DELTAT *DELTAT = &(F2608[num].deltaT); - int i,j; - FMSAMPLE *bufL,*bufR; - - /* set bufer */ - bufL = buffer[0]; - bufR = buffer[1]; - - if( (void *)F2608 != cur_chip ){ - cur_chip = (void *)F2608; - - State = &OPN->ST; - cch[0] = &F2608->CH[0]; - cch[1] = &F2608->CH[1]; - cch[2] = &F2608->CH[2]; - cch[3] = &F2608->CH[3]; - cch[4] = &F2608->CH[4]; - cch[5] = &F2608->CH[5]; - /* setup adpcm rom address */ - pcmbufA = F2608->pcmbuf; - pcmsizeA = F2608->pcm_size; - - } - - /* refresh PG and EG */ - refresh_fc_eg_chan( OPN, cch[0] ); - refresh_fc_eg_chan( OPN, cch[1] ); - if( (State->mode & 0xc0) ) - { - /* 3SLOT MODE */ - if( cch[2]->SLOT[SLOT1].Incr==-1) - { - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT4] , cch[2]->fc , cch[2]->kcode ); - } - }else refresh_fc_eg_chan( OPN, cch[2] ); - refresh_fc_eg_chan( OPN, cch[3] ); - refresh_fc_eg_chan( OPN, cch[4] ); - refresh_fc_eg_chan( OPN, cch[5] ); - - - /* buffering */ - for(i=0; i < length ; i++) - { - - advance_lfo(OPN); - - /* clear output acc. */ - out_adpcm[OUTD_LEFT] = out_adpcm[OUTD_RIGHT]= out_adpcm[OUTD_CENTER] = 0; - out_delta[OUTD_LEFT] = out_delta[OUTD_RIGHT]= out_delta[OUTD_CENTER] = 0; - /* clear outputs */ - out_fm[0] = 0; - out_fm[1] = 0; - out_fm[2] = 0; - out_fm[3] = 0; - out_fm[4] = 0; - out_fm[5] = 0; - - /* advance envelope generator */ - OPN->eg_timer += OPN->eg_timer_add; - while (OPN->eg_timer >= OPN->eg_timer_overflow) - { - OPN->eg_timer -= OPN->eg_timer_overflow; - OPN->eg_cnt++; - - advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[3]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[4]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[5]->SLOT[SLOT1]); - } - - /* calculate FM */ - chan_calc(OPN, cch[0], 0 ); - chan_calc(OPN, cch[1], 1 ); - chan_calc(OPN, cch[2], 2 ); - chan_calc(OPN, cch[3], 3 ); - chan_calc(OPN, cch[4], 4 ); - chan_calc(OPN, cch[5], 5 ); - - /* deltaT ADPCM */ - if( DELTAT->portstate&0x80 ) - YM_DELTAT_ADPCM_CALC(DELTAT); - - /* ADPCMA */ - for( j = 0; j < 6; j++ ) - { - if( F2608->adpcm[j].flag ) - ADPCMA_calc_chan( F2608, &F2608->adpcm[j]); - } - - /* buffering */ - { - int lt,rt; - - lt = out_adpcm[OUTD_LEFT] + out_adpcm[OUTD_CENTER]; - rt = out_adpcm[OUTD_RIGHT] + out_adpcm[OUTD_CENTER]; - lt += (out_delta[OUTD_LEFT] + out_delta[OUTD_CENTER])>>9; - rt += (out_delta[OUTD_RIGHT] + out_delta[OUTD_CENTER])>>9; - lt += ((out_fm[0]>>1) & OPN->pan[0]); /* shift right verified on real YM2608 */ - rt += ((out_fm[0]>>1) & OPN->pan[1]); - lt += ((out_fm[1]>>1) & OPN->pan[2]); - rt += ((out_fm[1]>>1) & OPN->pan[3]); - lt += ((out_fm[2]>>1) & OPN->pan[4]); - rt += ((out_fm[2]>>1) & OPN->pan[5]); - lt += ((out_fm[3]>>1) & OPN->pan[6]); - rt += ((out_fm[3]>>1) & OPN->pan[7]); - lt += ((out_fm[4]>>1) & OPN->pan[8]); - rt += ((out_fm[4]>>1) & OPN->pan[9]); - lt += ((out_fm[5]>>1) & OPN->pan[10]); - rt += ((out_fm[5]>>1) & OPN->pan[11]); - - lt >>= FINAL_SH; - rt >>= FINAL_SH; - - Limit( lt, MAXOUT, MINOUT ); - Limit( rt, MAXOUT, MINOUT ); - /* buffering */ - bufL[i] = lt; - bufR[i] = rt; - - #ifdef SAVE_SAMPLE - SAVE_ALL_CHANNELS - #endif - - } - - /* timer A control */ - INTERNAL_TIMER_A( State , cch[2] ) - } - INTERNAL_TIMER_B(State,length) - - - /* check IRQ for DELTA-T EOS */ - FM_STATUS_SET(State, 0); - -} -#ifdef _STATE_H -static void YM2608_postload(void) -{ - int num , r; - - for(num=0;numOPN,1,2); - F2608->deltaT.freqbase = F2608->OPN.ST.freqbase; - /* IRQ mask / mode */ - YM2608IRQMaskWrite(&F2608->OPN, num, F2608->REGS[0x29]); - /* SSG registers */ - for(r=0;r<16;r++) - { - SSGWrite(num,0,r); - SSGWrite(num,1,F2608->REGS[r]); - } - - /* OPN registers */ - /* DT / MULTI , TL , KS / AR , AMON / DR , SR , SL / RR , SSG-EG */ - for(r=0x30;r<0x9e;r++) - if((r&3) != 3) - { - OPNWriteReg(&F2608->OPN,r,F2608->REGS[r]); - OPNWriteReg(&F2608->OPN,r|0x100,F2608->REGS[r|0x100]); - } - /* FB / CONNECT , L / R / AMS / PMS */ - for(r=0xb0;r<0xb6;r++) - if((r&3) != 3) - { - OPNWriteReg(&F2608->OPN,r,F2608->REGS[r]); - OPNWriteReg(&F2608->OPN,r|0x100,F2608->REGS[r|0x100]); - } - /* FM channels */ - /*FM_channel_postload(F2608->CH,6);*/ - /* rhythm(ADPCMA) */ - FM_ADPCMAWrite(F2608,1,F2608->REGS[0x111]); - for( r=0x08 ; r<0x0c ; r++) - FM_ADPCMAWrite(F2608,r,F2608->REGS[r+0x110]); - /* Delta-T ADPCM unit */ - YM_DELTAT_postload(&F2608->deltaT , &F2608->REGS[0x100] ); - } - cur_chip = NULL; -} - -static void YM2608_save_state(void) -{ - int num; - const char statename[] = "YM2608"; - - for(num=0;numREGS , 512); - FMsave_state_st(statename,num,&FM2608[num].OPN.ST); - FMsave_state_channel(statename,num,FM2608[num].CH,6); - /* 3slots */ - state_save_register_UINT32(statename, num, "slot3fc" , F2608->OPN.SL3.fc , 3); - state_save_register_UINT8 (statename, num, "slot3fh" , &F2608->OPN.SL3.fn_h, 1); - state_save_register_UINT8 (statename, num, "slot3kc" , F2608->OPN.SL3.kcode, 3); - /* address register1 */ - state_save_register_UINT8 (statename, num, "addr_A1" , &F2608->addr_A1 ,1); - /* rythm(ADPCMA) */ - FMsave_state_adpcma(statename,num,F2608->adpcm); - /* Delta-T ADPCM unit */ - YM_DELTAT_savestate(statename,num,&FM2608[num].deltaT); - } - state_save_register_func_postload(YM2608_postload); -} -#endif /* _STATE_H */ - -static void YM2608_deltat_status_set(UINT8 which, UINT8 changebits) -{ - FM_STATUS_SET(&(FM2608[which].OPN.ST), changebits); -} -static void YM2608_deltat_status_reset(UINT8 which, UINT8 changebits) -{ - FM_STATUS_RESET(&(FM2608[which].OPN.ST), changebits); -} -/* YM2608(OPNA) */ -int YM2608Init(int num, int clock, int rate, - void **pcmrom,int *pcmsize, unsigned char *irom, - FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler) -{ - int i; - - if (FM2608) return (-1); /* duplicate init. */ - cur_chip = NULL; - - YM2608NumChips = num; - - YM2608_ADPCM_ROM = irom; - - /* allocate extend state space */ - if( (FM2608 = (YM2608 *)malloc(sizeof(YM2608) * YM2608NumChips))==NULL) - return (-1); - /* clear */ - memset(FM2608,0,sizeof(YM2608) * YM2608NumChips); - /* allocate total level table (128kb space) */ - if( !init_tables() ) - { - if (FM2608) { - free( FM2608 ); - FM2608 = NULL; - } - return (-1); - } - - for ( i = 0 ; i < YM2608NumChips; i++ ) { - FM2608[i].OPN.ST.index = i; - FM2608[i].OPN.type = TYPE_YM2608; - FM2608[i].OPN.P_CH = FM2608[i].CH; - FM2608[i].OPN.ST.clock = clock; - FM2608[i].OPN.ST.rate = rate; - - /* External handlers */ - FM2608[i].OPN.ST.Timer_Handler = TimerHandler; - FM2608[i].OPN.ST.IRQ_Handler = IRQHandler; - - /* DELTA-T */ - FM2608[i].deltaT.memory = (UINT8 *)(pcmrom[i]); - FM2608[i].deltaT.memory_size = pcmsize[i]; - - /*FM2608[i].deltaT.write_time = 20.0 / clock;*/ /* a single byte write takes 20 cycles of main clock */ - /*FM2608[i].deltaT.read_time = 18.0 / clock;*/ /* a single byte read takes 18 cycles of main clock */ - - FM2608[i].deltaT.status_set_handler = YM2608_deltat_status_set; - FM2608[i].deltaT.status_reset_handler = YM2608_deltat_status_reset; - FM2608[i].deltaT.status_change_which_chip = i; - FM2608[i].deltaT.status_change_EOS_bit = 0x04; /* status flag: set bit2 on End Of Sample */ - FM2608[i].deltaT.status_change_BRDY_bit = 0x08; /* status flag: set bit3 on BRDY */ - FM2608[i].deltaT.status_change_ZERO_bit = 0x10; /* status flag: set bit4 if silence continues for more than 290 miliseconds while recording the ADPCM */ - - /* ADPCM Rhythm */ - FM2608[i].pcmbuf = YM2608_ADPCM_ROM; - FM2608[i].pcm_size = 0x2000; - - YM2608ResetChip(i); - } - - Init_ADPCMATable(); - -#ifdef _STATE_H - YM2608_save_state(); -#endif - return 0; -} - -/* shut down emulator */ -void YM2608Shutdown() -{ - if (!FM2608) return; - - FMCloseTable(); - if (FM2608) { - free(FM2608); - FM2608 = NULL; - } - - YM2608_ADPCM_ROM = NULL; -} - -/* reset one of chips */ -void YM2608ResetChip(int num) -{ - int i; - YM2608 *F2608 = &(FM2608[num]); - FM_OPN *OPN = &(FM2608[num].OPN); - YM_DELTAT *DELTAT = &(F2608[num].deltaT); - - /* Reset Prescaler */ - OPNPrescaler_w(OPN , 0 , 2); - F2608->deltaT.freqbase = OPN->ST.freqbase; - /* reset SSG section */ - SSGReset(OPN->ST.index); - - /* status clear */ - FM_BUSY_CLEAR(&OPN->ST); - - /* register 0x29 - default value after reset is: - enable only 3 FM channels and enable all the status flags */ - YM2608IRQMaskWrite(OPN, num, 0x1f ); /* default value for D4-D0 is 1 */ - - /* register 0x10, A1=1 - default value is 1 for D4, D3, D2, 0 for the rest */ - YM2608IRQFlagWrite(OPN, num, 0x1c ); /* default: enable timer A and B, disable EOS, BRDY and ZERO */ - - OPNWriteMode(OPN,0x27,0x30); /* mode 0 , timer reset */ - - OPN->eg_timer = 0; - OPN->eg_cnt = 0; - - FM_STATUS_RESET(&OPN->ST, 0xff); - - reset_channels( &OPN->ST , F2608->CH , 6 ); - /* reset OPerator paramater */ - for(i = 0xb6 ; i >= 0xb4 ; i-- ) - { - OPNWriteReg(OPN,i ,0xc0); - OPNWriteReg(OPN,i|0x100,0xc0); - } - for(i = 0xb2 ; i >= 0x30 ; i-- ) - { - OPNWriteReg(OPN,i ,0); - OPNWriteReg(OPN,i|0x100,0); - } - for(i = 0x26 ; i >= 0x20 ; i-- ) OPNWriteReg(OPN,i,0); - - /* ADPCM - percussion sounds */ - for( i = 0; i < 6; i++ ) - { - if (i<=3) /* channels 0,1,2,3 */ - F2608->adpcm[i].step = (UINT32)((float)(1<OPN.ST.freqbase)/3.0); - else /* channels 4 and 5 work with slower clock */ - F2608->adpcm[i].step = (UINT32)((float)(1<OPN.ST.freqbase)/6.0); - - F2608->adpcm[i].start = YM2608_ADPCM_ROM_addr[i*2]; - F2608->adpcm[i].end = YM2608_ADPCM_ROM_addr[i*2+1]; - - F2608->adpcm[i].now_addr = 0; - F2608->adpcm[i].now_step = 0; - /* F2608->adpcm[i].delta = 21866; */ - F2608->adpcm[i].vol_mul = 0; - F2608->adpcm[i].pan = &out_adpcm[OUTD_CENTER]; /* default center */ - F2608->adpcm[i].flagMask = 0; - F2608->adpcm[i].flag = 0; - F2608->adpcm[i].adpcm_acc = 0; - F2608->adpcm[i].adpcm_step= 0; - F2608->adpcm[i].adpcm_out = 0; - } - F2608->adpcmTL = 0x3f; - - F2608->adpcm_arrivedEndAddress = 0; /* not used */ - - /* DELTA-T unit */ - DELTAT->freqbase = OPN->ST.freqbase; - DELTAT->output_pointer = out_delta; - DELTAT->portshift = 5; /* always 5bits shift */ /* ASG */ - DELTAT->output_range = 1<<23; - YM_DELTAT_ADPCM_Reset(DELTAT,OUTD_CENTER,YM_DELTAT_EMULATION_MODE_NORMAL); -} - -/* YM2608 write */ -/* n = number */ -/* a = address */ -/* v = value */ -int YM2608Write(int n, int a,UINT8 v) -{ - YM2608 *F2608 = &(FM2608[n]); - FM_OPN *OPN = &(FM2608[n].OPN); - int addr; - - v &= 0xff; /*adjust to 8 bit bus */ - - - switch(a&3) - { - case 0: /* address port 0 */ - OPN->ST.address = v; - F2608->addr_A1 = 0; - - /* Write register to SSG emulator */ - if( v < 16 ) SSGWrite(n,0,v); - /* prescaler selecter : 2d,2e,2f */ - if( v >= 0x2d && v <= 0x2f ) - { - OPNPrescaler_w(OPN , v , 2); - F2608->deltaT.freqbase = OPN->ST.freqbase; - } - break; - - case 1: /* data port 0 */ - if (F2608->addr_A1 != 0) - break; /* verified on real YM2608 */ - - addr = OPN->ST.address; -#ifdef _STATE_H - F2608->REGS[addr] = v; -#endif - switch(addr & 0xf0) - { - case 0x00: /* SSG section */ - /* Write data to SSG emulator */ - SSGWrite(n,a,v); - break; - case 0x10: /* 0x10-0x1f : Rhythm section */ - YM2608UpdateReq(n); - FM_ADPCMAWrite(F2608,addr-0x10,v); - break; - case 0x20: /* Mode Register */ - switch(addr) - { - case 0x29: /* SCH,xx,xxx,EN_ZERO,EN_BRDY,EN_EOS,EN_TB,EN_TA */ - YM2608IRQMaskWrite(OPN, n, v); - break; - default: - YM2608UpdateReq(n); - OPNWriteMode(OPN,addr,v); - } - break; - default: /* OPN section */ - YM2608UpdateReq(n); - OPNWriteReg(OPN,addr,v); - } - break; - - case 2: /* address port 1 */ - OPN->ST.address = v; - F2608->addr_A1 = 1; - break; - - case 3: /* data port 1 */ - if (F2608->addr_A1 != 1) - break; /* verified on real YM2608 */ - - addr = OPN->ST.address; -#ifdef _STATE_H - F2608->REGS[addr | 0x100] = v; -#endif - YM2608UpdateReq(n); - switch( addr & 0xf0 ) - { - case 0x00: /* DELTAT PORT */ - switch( addr ) - { - case 0x0e: /* DAC data */ - logerror("YM2608: write to DAC data (unimplemented) value=%02x\n",v); - break; - default: - /* 0x00-0x0d */ - YM_DELTAT_ADPCM_Write(&F2608->deltaT,addr,v); - } - break; - case 0x10: /* IRQ Flag control */ - if( addr == 0x10 ) - { - YM2608IRQFlagWrite(OPN, n, v); - } - break; - default: - OPNWriteReg(OPN,addr | 0x100,v); - } - } - return OPN->ST.irq; -} - -UINT8 YM2608Read(int n,int a) -{ - YM2608 *F2608 = &(FM2608[n]); - int addr = F2608->OPN.ST.address; - UINT8 ret = 0; - - switch( a&3 ){ - case 0: /* status 0 : YM2203 compatible */ - /* BUSY:x:x:x:x:x:FLAGB:FLAGA */ - ret = FM_STATUS_FLAG(&F2608->OPN.ST) & 0x83; - break; - - case 1: /* status 0, ID */ - if( addr < 16 ) ret = SSGRead(n); - else if(addr == 0xff) ret = 0x01; /* ID code */ - break; - - case 2: /* status 1 : status 0 + ADPCM status */ - /* BUSY : x : PCMBUSY : ZERO : BRDY : EOS : FLAGB : FLAGA */ - ret = (FM_STATUS_FLAG(&F2608->OPN.ST) & (F2608->flagmask|0x80)) | ((F2608->deltaT.PCM_BSY & 1)<<5) ; - break; - - case 3: - if(addr == 0x08) - { - ret = YM_DELTAT_ADPCM_Read(&F2608->deltaT); - } - else - { - if(addr == 0x0f) - { - logerror("YM2608 A/D convertion is accessed but not implemented !\n"); - ret = 0x80; /* 2's complement PCM data - result from A/D convertion */ - } - } - break; - } - return ret; -} - -int YM2608TimerOver(int n,int c) -{ - YM2608 *F2608 = &(FM2608[n]); - - switch(c) - { -#if 0 - case 2: - { /* BUFRDY flag */ - YM_DELTAT_BRDY_callback( &F2608->deltaT ); - } - break; -#endif - case 1: - { /* Timer B */ - TimerBOver( &(F2608->OPN.ST) ); - } - break; - case 0: - { /* Timer A */ - YM2608UpdateReq(n); - /* timer update */ - TimerAOver( &(F2608->OPN.ST) ); - /* CSM mode key,TL controll */ - if( F2608->OPN.ST.mode & 0x80 ) - { /* CSM mode total level latch and auto key on */ - CSMKeyControll( F2608->OPN.type, &(F2608->CH[2]) ); - } - } - break; - default: - break; - } - - return FM2608->OPN.ST.irq; -} - -#endif /* BUILD_YM2608 */ - - - -#if (BUILD_YM2610||BUILD_YM2610B) -/* YM2610(OPNB) */ -static YM2610 *FM2610=NULL; /* array of YM2610's */ -static int YM2610NumChips; - -/* Generate samples for one of the YM2610s */ -void YM2610UpdateOne(int num, INT16 **buffer, int length) -{ - YM2610 *F2610 = &(FM2610[num]); - FM_OPN *OPN = &(FM2610[num].OPN); - YM_DELTAT *DELTAT = &(F2610[num].deltaT); - int i,j; - FMSAMPLE *bufL,*bufR; - - /* buffer setup */ - bufL = buffer[0]; - bufR = buffer[1]; - - if( (void *)F2610 != cur_chip ){ - cur_chip = (void *)F2610; - State = &OPN->ST; - cch[0] = &F2610->CH[1]; - cch[1] = &F2610->CH[2]; - cch[2] = &F2610->CH[4]; - cch[3] = &F2610->CH[5]; - /* setup adpcm rom address */ - pcmbufA = F2610->pcmbuf; - pcmsizeA = F2610->pcm_size; - - } -#ifdef YM2610B_WARNING -#define FM_KEY_IS(SLOT) ((SLOT)->key) -#define FM_MSG_YM2610B "YM2610-%d.CH%d is playing,Check whether the type of the chip is YM2610B\n" - /* Check YM2610B warning message */ - if( FM_KEY_IS(&F2610->CH[0].SLOT[3]) ) - LOG(LOG_WAR,(FM_MSG_YM2610B,num,0)); - if( FM_KEY_IS(&F2610->CH[3].SLOT[3]) ) - LOG(LOG_WAR,(FM_MSG_YM2610B,num,3)); -#endif - - /* refresh PG and EG */ - refresh_fc_eg_chan( OPN, cch[0] ); - if( (State->mode & 0xc0) ) - { - /* 3SLOT MODE */ - if( cch[1]->SLOT[SLOT1].Incr==-1) - { - refresh_fc_eg_slot(OPN, &cch[1]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); - refresh_fc_eg_slot(OPN, &cch[1]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); - refresh_fc_eg_slot(OPN, &cch[1]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); - refresh_fc_eg_slot(OPN, &cch[1]->SLOT[SLOT4] , cch[1]->fc , cch[1]->kcode ); - } - }else refresh_fc_eg_chan( OPN, cch[1] ); - refresh_fc_eg_chan( OPN, cch[2] ); - refresh_fc_eg_chan( OPN, cch[3] ); - - /* buffering */ - for(i=0; i < length ; i++) - { - - advance_lfo(OPN); - - /* clear output acc. */ - out_adpcm[OUTD_LEFT] = out_adpcm[OUTD_RIGHT]= out_adpcm[OUTD_CENTER] = 0; - out_delta[OUTD_LEFT] = out_delta[OUTD_RIGHT]= out_delta[OUTD_CENTER] = 0; - /* clear outputs */ - out_fm[1] = 0; - out_fm[2] = 0; - out_fm[4] = 0; - out_fm[5] = 0; - - /* advance envelope generator */ - OPN->eg_timer += OPN->eg_timer_add; - while (OPN->eg_timer >= OPN->eg_timer_overflow) - { - OPN->eg_timer -= OPN->eg_timer_overflow; - OPN->eg_cnt++; - - advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[3]->SLOT[SLOT1]); - } - - /* calculate FM */ - chan_calc(OPN, cch[0], 1 ); /*remapped to 1*/ - chan_calc(OPN, cch[1], 2 ); /*remapped to 2*/ - chan_calc(OPN, cch[2], 4 ); /*remapped to 4*/ - chan_calc(OPN, cch[3], 5 ); /*remapped to 5*/ - - /* deltaT ADPCM */ - if( DELTAT->portstate&0x80 ) - YM_DELTAT_ADPCM_CALC(DELTAT); - - /* ADPCMA */ - for( j = 0; j < 6; j++ ) - { - if( F2610->adpcm[j].flag ) - ADPCMA_calc_chan( F2610, &F2610->adpcm[j]); - } - - /* buffering */ - { - int lt,rt; - - lt = out_adpcm[OUTD_LEFT] + out_adpcm[OUTD_CENTER]; - rt = out_adpcm[OUTD_RIGHT] + out_adpcm[OUTD_CENTER]; - lt += (out_delta[OUTD_LEFT] + out_delta[OUTD_CENTER])>>9; - rt += (out_delta[OUTD_RIGHT] + out_delta[OUTD_CENTER])>>9; - - - lt += ((out_fm[1]>>1) & OPN->pan[2]); /* the shift right was verified on real chip */ - rt += ((out_fm[1]>>1) & OPN->pan[3]); - lt += ((out_fm[2]>>1) & OPN->pan[4]); - rt += ((out_fm[2]>>1) & OPN->pan[5]); - - lt += ((out_fm[4]>>1) & OPN->pan[8]); - rt += ((out_fm[4]>>1) & OPN->pan[9]); - lt += ((out_fm[5]>>1) & OPN->pan[10]); - rt += ((out_fm[5]>>1) & OPN->pan[11]); - - - lt >>= FINAL_SH; - rt >>= FINAL_SH; - - Limit( lt, MAXOUT, MINOUT ); - Limit( rt, MAXOUT, MINOUT ); - - #ifdef SAVE_SAMPLE - SAVE_ALL_CHANNELS - #endif - - /* buffering */ - bufL[i] = lt; - bufR[i] = rt; - } - - /* timer A control */ - INTERNAL_TIMER_A( State , cch[1] ) - } - INTERNAL_TIMER_B(State,length) - -} - -#if BUILD_YM2610B -/* Generate samples for one of the YM2610Bs */ -void YM2610BUpdateOne(int num, INT16 **buffer, int length) -{ - YM2610 *F2610 = &(FM2610[num]); - FM_OPN *OPN = &(FM2610[num].OPN); - YM_DELTAT *DELTAT = &(FM2610[num].deltaT); - int i,j; - FMSAMPLE *bufL,*bufR; - - /* buffer setup */ - bufL = buffer[0]; - bufR = buffer[1]; - - if( (void *)F2610 != cur_chip ){ - cur_chip = (void *)F2610; - State = &OPN->ST; - cch[0] = &F2610->CH[0]; - cch[1] = &F2610->CH[1]; - cch[2] = &F2610->CH[2]; - cch[3] = &F2610->CH[3]; - cch[4] = &F2610->CH[4]; - cch[5] = &F2610->CH[5]; - /* setup adpcm rom address */ - pcmbufA = F2610->pcmbuf; - pcmsizeA = F2610->pcm_size; - - } - - /* refresh PG and EG */ - refresh_fc_eg_chan( OPN, cch[0] ); - refresh_fc_eg_chan( OPN, cch[1] ); - if( (State->mode & 0xc0) ) - { - /* 3SLOT MODE */ - if( cch[2]->SLOT[SLOT1].Incr==-1) - { - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT4] , cch[2]->fc , cch[2]->kcode ); - } - }else refresh_fc_eg_chan( OPN, cch[2] ); - refresh_fc_eg_chan( OPN, cch[3] ); - refresh_fc_eg_chan( OPN, cch[4] ); - refresh_fc_eg_chan( OPN, cch[5] ); - - /* buffering */ - for(i=0; i < length ; i++) - { - - advance_lfo(OPN); - - /* clear output acc. */ - out_adpcm[OUTD_LEFT] = out_adpcm[OUTD_RIGHT]= out_adpcm[OUTD_CENTER] = 0; - out_delta[OUTD_LEFT] = out_delta[OUTD_RIGHT]= out_delta[OUTD_CENTER] = 0; - /* clear outputs */ - out_fm[0] = 0; - out_fm[1] = 0; - out_fm[2] = 0; - out_fm[3] = 0; - out_fm[4] = 0; - out_fm[5] = 0; - - /* advance envelope generator */ - OPN->eg_timer += OPN->eg_timer_add; - while (OPN->eg_timer >= OPN->eg_timer_overflow) - { - OPN->eg_timer -= OPN->eg_timer_overflow; - OPN->eg_cnt++; - - advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[3]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[4]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[5]->SLOT[SLOT1]); - } - - /* calculate FM */ - chan_calc(OPN, cch[0], 0 ); - chan_calc(OPN, cch[1], 1 ); - chan_calc(OPN, cch[2], 2 ); - chan_calc(OPN, cch[3], 3 ); - chan_calc(OPN, cch[4], 4 ); - chan_calc(OPN, cch[5], 5 ); - - /* deltaT ADPCM */ - if( DELTAT->portstate&0x80 ) - YM_DELTAT_ADPCM_CALC(DELTAT); - - /* ADPCMA */ - for( j = 0; j < 6; j++ ) - { - if( F2610->adpcm[j].flag ) - ADPCMA_calc_chan( F2610, &F2610->adpcm[j]); - } - - /* buffering */ - { - int lt,rt; - - lt = out_adpcm[OUTD_LEFT] + out_adpcm[OUTD_CENTER]; - rt = out_adpcm[OUTD_RIGHT] + out_adpcm[OUTD_CENTER]; - lt += (out_delta[OUTD_LEFT] + out_delta[OUTD_CENTER])>>9; - rt += (out_delta[OUTD_RIGHT] + out_delta[OUTD_CENTER])>>9; - - lt += ((out_fm[0]>>1) & OPN->pan[0]); /* the shift right is verified on YM2610 */ - rt += ((out_fm[0]>>1) & OPN->pan[1]); - lt += ((out_fm[1]>>1) & OPN->pan[2]); - rt += ((out_fm[1]>>1) & OPN->pan[3]); - lt += ((out_fm[2]>>1) & OPN->pan[4]); - rt += ((out_fm[2]>>1) & OPN->pan[5]); - lt += ((out_fm[3]>>1) & OPN->pan[6]); - rt += ((out_fm[3]>>1) & OPN->pan[7]); - lt += ((out_fm[4]>>1) & OPN->pan[8]); - rt += ((out_fm[4]>>1) & OPN->pan[9]); - lt += ((out_fm[5]>>1) & OPN->pan[10]); - rt += ((out_fm[5]>>1) & OPN->pan[11]); - - - lt >>= FINAL_SH; - rt >>= FINAL_SH; - - Limit( lt, MAXOUT, MINOUT ); - Limit( rt, MAXOUT, MINOUT ); - - #ifdef SAVE_SAMPLE - SAVE_ALL_CHANNELS - #endif - - /* buffering */ - bufL[i] = lt; - bufR[i] = rt; - } - - /* timer A control */ - INTERNAL_TIMER_A( State , cch[2] ) - } - INTERNAL_TIMER_B(State,length) - -} -#endif /* BUILD_YM2610B */ - - -#ifdef _STATE_H -static void YM2610_postload(void) -{ - int num , r; - - for(num=0;numREGS[r]); - } - - /* OPN registers */ - /* DT / MULTI , TL , KS / AR , AMON / DR , SR , SL / RR , SSG-EG */ - for(r=0x30;r<0x9e;r++) - if((r&3) != 3) - { - OPNWriteReg(&F2610->OPN,r,F2610->REGS[r]); - OPNWriteReg(&F2610->OPN,r|0x100,F2610->REGS[r|0x100]); - } - /* FB / CONNECT , L / R / AMS / PMS */ - for(r=0xb0;r<0xb6;r++) - if((r&3) != 3) - { - OPNWriteReg(&F2610->OPN,r,F2610->REGS[r]); - OPNWriteReg(&F2610->OPN,r|0x100,F2610->REGS[r|0x100]); - } - /* FM channels */ - /*FM_channel_postload(F2610->CH,6);*/ - - /* rhythm(ADPCMA) */ - FM_ADPCMAWrite(F2610,1,F2610->REGS[0x101]); - for( r=0 ; r<6 ; r++) - { - FM_ADPCMAWrite(F2610,r+0x08,F2610->REGS[r+0x108]); - FM_ADPCMAWrite(F2610,r+0x10,F2610->REGS[r+0x110]); - FM_ADPCMAWrite(F2610,r+0x18,F2610->REGS[r+0x118]); - FM_ADPCMAWrite(F2610,r+0x20,F2610->REGS[r+0x120]); - FM_ADPCMAWrite(F2610,r+0x28,F2610->REGS[r+0x128]); - } - /* Delta-T ADPCM unit */ - YM_DELTAT_postload(&F2610->deltaT , &F2610->REGS[0x010] ); - } - cur_chip = NULL; -} - -static void YM2610_save_state(void) -{ - int num; - const char statename[] = "YM2610"; - - for(num=0;numREGS , 512); - FMsave_state_st(statename,num,&FM2610[num].OPN.ST); - FMsave_state_channel(statename,num,FM2610[num].CH,6); - /* 3slots */ - state_save_register_UINT32(statename, num, "slot3fc" , F2610->OPN.SL3.fc , 3); - state_save_register_UINT8 (statename, num, "slot3fh" , &F2610->OPN.SL3.fn_h, 1); - state_save_register_UINT8 (statename, num, "slot3kc" , F2610->OPN.SL3.kcode, 3); - /* address register1 */ - state_save_register_UINT8 (statename, num, "addr_A1" , &F2610->addr_A1, 1); - - state_save_register_UINT8 (statename, num, "arrivedFlag", &F2610->adpcm_arrivedEndAddress , 1); - /* rythm(ADPCMA) */ - FMsave_state_adpcma(statename,num,F2610->adpcm); - /* Delta-T ADPCM unit */ - YM_DELTAT_savestate(statename,num,&FM2610[num].deltaT); - } - state_save_register_func_postload(YM2610_postload); -} -#endif /* _STATE_H */ - -static void YM2610_deltat_status_set(UINT8 which, UINT8 changebits) -{ - FM2610[which].adpcm_arrivedEndAddress |= changebits; -} -static void YM2610_deltat_status_reset(UINT8 which, UINT8 changebits) -{ - FM2610[which].adpcm_arrivedEndAddress &= (~changebits); -} - -int YM2610Init(int num, int clock, int rate, - void **pcmroma,int *pcmsizea,void **pcmromb,int *pcmsizeb, - FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler) - -{ - int i; - - if (FM2610) return (-1); /* duplicate init. */ - cur_chip = NULL; /* hiro-shi!! */ - - YM2610NumChips = num; - - /* allocate extend state space */ - if( (FM2610 = (YM2610 *)malloc(sizeof(YM2610) * YM2610NumChips))==NULL) - return (-1); - /* clear */ - memset(FM2610,0,sizeof(YM2610) * YM2610NumChips); - /* allocate total level table (128kb space) */ - if( !init_tables() ) - { - if (FM2610) { - free( FM2610 ); - FM2610 = NULL; - } - return (-1); - } - - for ( i = 0 ; i < YM2610NumChips; i++ ) { - YM2610 *F2610 = &(FM2610[i]); - /* FM */ - F2610->OPN.ST.index = i; - F2610->OPN.type = TYPE_YM2610; - F2610->OPN.P_CH = FM2610[i].CH; - F2610->OPN.ST.clock = clock; - F2610->OPN.ST.rate = rate; - /* Extend handler */ - F2610->OPN.ST.Timer_Handler = TimerHandler; - F2610->OPN.ST.IRQ_Handler = IRQHandler; - /* ADPCM */ - F2610->pcmbuf = (UINT8 *)(pcmroma[i]); - F2610->pcm_size = pcmsizea[i]; - /* DELTA-T */ - F2610->deltaT.memory = (UINT8 *)(pcmromb[i]); - F2610->deltaT.memory_size = pcmsizeb[i]; - - FM2610[i].deltaT.status_set_handler = YM2610_deltat_status_set; - FM2610[i].deltaT.status_reset_handler = YM2610_deltat_status_reset; - FM2610[i].deltaT.status_change_which_chip = i; - FM2610[i].deltaT.status_change_EOS_bit = 0x80; /* status flag: set bit7 on End Of Sample */ - - YM2610ResetChip(i); - } - Init_ADPCMATable(); -#ifdef _STATE_H - YM2610_save_state(); -#endif - return 0; -} - -/* remap sample memory of chip */ -void YM2610SetRom(int num, void *pcmroma,int pcmsizea,void *pcmromb,int pcmsizeb) -{ - YM2610 *F2610 = &(FM2610[num]); - - /* ADPCM */ - F2610->pcmbuf = (UINT8 *)pcmroma; - F2610->pcm_size = pcmsizea; - /* DELTA-T */ - F2610->deltaT.memory = (UINT8 *)pcmromb; - F2610->deltaT.memory_size = pcmsizeb; - - if( (void *)F2610 == cur_chip ){ - pcmbufA = F2610->pcmbuf; - pcmsizeA = F2610->pcm_size; - } -} - -/* shut down emulator */ -void YM2610Shutdown() -{ - if (!FM2610) return; - - FMCloseTable(); - if (FM2610) { - free(FM2610); - FM2610 = NULL; - } -} - -/* reset one of chip */ -void YM2610ResetChip(int num) -{ - int i; - YM2610 *F2610 = &(FM2610[num]); - FM_OPN *OPN = &(FM2610[num].OPN); - YM_DELTAT *DELTAT = &(FM2610[num].deltaT); - - /* Reset Prescaler */ - OPNSetPres( OPN, 6*24, 6*24, 4*2); /* OPN 1/6 , SSG 1/4 */ - /* reset SSG section */ - SSGReset(OPN->ST.index); - /* status clear */ - FM_IRQMASK_SET(&OPN->ST,0x03); - FM_BUSY_CLEAR(&OPN->ST); - OPNWriteMode(OPN,0x27,0x30); /* mode 0 , timer reset */ - - OPN->eg_timer = 0; - OPN->eg_cnt = 0; - - FM_STATUS_RESET(&OPN->ST, 0xff); - - reset_channels( &OPN->ST , F2610->CH , 6 ); - /* reset OPerator paramater */ - for(i = 0xb6 ; i >= 0xb4 ; i-- ) - { - OPNWriteReg(OPN,i ,0xc0); - OPNWriteReg(OPN,i|0x100,0xc0); - } - for(i = 0xb2 ; i >= 0x30 ; i-- ) - { - OPNWriteReg(OPN,i ,0); - OPNWriteReg(OPN,i|0x100,0); - } - for(i = 0x26 ; i >= 0x20 ; i-- ) OPNWriteReg(OPN,i,0); - /**** ADPCM work initial ****/ - for( i = 0; i < 6 ; i++ ){ - F2610->adpcm[i].step = (UINT32)((float)(1<OPN.ST.freqbase)/3.0); - F2610->adpcm[i].now_addr = 0; - F2610->adpcm[i].now_step = 0; - F2610->adpcm[i].start = 0; - F2610->adpcm[i].end = 0; - /* F2610->adpcm[i].delta = 21866; */ - F2610->adpcm[i].vol_mul = 0; - F2610->adpcm[i].pan = &out_adpcm[OUTD_CENTER]; /* default center */ - F2610->adpcm[i].flagMask = 1<adpcm[i].flag = 0; - F2610->adpcm[i].adpcm_acc = 0; - F2610->adpcm[i].adpcm_step= 0; - F2610->adpcm[i].adpcm_out = 0; - } - F2610->adpcmTL = 0x3f; - - F2610->adpcm_arrivedEndAddress = 0; - - /* DELTA-T unit */ - DELTAT->freqbase = OPN->ST.freqbase; - DELTAT->output_pointer = out_delta; - DELTAT->portshift = 8; /* allways 8bits shift */ - DELTAT->output_range = 1<<23; - YM_DELTAT_ADPCM_Reset(DELTAT,OUTD_CENTER,YM_DELTAT_EMULATION_MODE_YM2610); -} - -/* YM2610 write */ -/* n = number */ -/* a = address */ -/* v = value */ -int YM2610Write(int n, int a, UINT8 v) -{ - YM2610 *F2610 = &(FM2610[n]); - FM_OPN *OPN = &(FM2610[n].OPN); - int addr; - int ch; - - v &= 0xff; /* adjust to 8 bit bus */ - - switch( a&3 ){ - case 0: /* address port 0 */ - OPN->ST.address = v; - F2610->addr_A1 = 0; - - /* Write register to SSG emulator */ - if( v < 16 ) SSGWrite(n,0,v); - break; - - case 1: /* data port 0 */ - if (F2610->addr_A1 != 0) - break; /* verified on real YM2608 */ - - addr = OPN->ST.address; -#ifdef _STATE_H - F2610->REGS[addr] = v; -#endif - switch(addr & 0xf0) - { - case 0x00: /* SSG section */ - /* Write data to SSG emulator */ - SSGWrite(n,a,v); - break; - case 0x10: /* DeltaT ADPCM */ - YM2610UpdateReq(n); - - switch(addr) - { - case 0x10: /* control 1 */ - case 0x11: /* control 2 */ - case 0x12: /* start address L */ - case 0x13: /* start address H */ - case 0x14: /* stop address L */ - case 0x15: /* stop address H */ - - case 0x19: /* delta-n L */ - case 0x1a: /* delta-n H */ - case 0x1b: /* volume */ - { - YM_DELTAT_ADPCM_Write(&F2610->deltaT,addr-0x10,v); - } - break; - - case 0x1c: /* FLAG CONTROL : Extend Status Clear/Mask */ - { - UINT8 statusmask = ~v; - /* set arrived flag mask */ - for(ch=0;ch<6;ch++) - F2610->adpcm[ch].flagMask = statusmask&(1<deltaT.status_change_EOS_bit = statusmask & 0x80; /* status flag: set bit7 on End Of Sample */ - - /* clear arrived flag */ - F2610->adpcm_arrivedEndAddress &= statusmask; - } - break; - - default: - logerror("YM2610: write to unknown deltat register %02x val=%02x\n",addr,v); - break; - } - - break; - case 0x20: /* Mode Register */ - YM2610UpdateReq(n); - OPNWriteMode(OPN,addr,v); - break; - default: /* OPN section */ - YM2610UpdateReq(n); - /* write register */ - OPNWriteReg(OPN,addr,v); - } - break; - - case 2: /* address port 1 */ - OPN->ST.address = v; - F2610->addr_A1 = 1; - break; - - case 3: /* data port 1 */ - if (F2610->addr_A1 != 1) - break; /* verified on real YM2608 */ - - YM2610UpdateReq(n); - addr = OPN->ST.address; -#ifdef _STATE_H - F2610->REGS[addr | 0x100] = v; -#endif - if( addr < 0x30 ) - /* 100-12f : ADPCM A section */ - FM_ADPCMAWrite(F2610,addr,v); - else - OPNWriteReg(OPN,addr | 0x100,v); - } - return OPN->ST.irq; -} - -UINT8 YM2610Read(int n,int a) -{ - YM2610 *F2610 = &(FM2610[n]); - int addr = F2610->OPN.ST.address; - UINT8 ret = 0; - - switch( a&3){ - case 0: /* status 0 : YM2203 compatible */ - ret = FM_STATUS_FLAG(&F2610->OPN.ST) & 0x83; - break; - case 1: /* data 0 */ - if( addr < 16 ) ret = SSGRead(n); - if( addr == 0xff ) ret = 0x01; - break; - case 2: /* status 1 : ADPCM status */ - /* ADPCM STATUS (arrived End Address) */ - /* B,--,A5,A4,A3,A2,A1,A0 */ - /* B = ADPCM-B(DELTA-T) arrived end address */ - /* A0-A5 = ADPCM-A arrived end address */ - ret = F2610->adpcm_arrivedEndAddress; - break; - case 3: - ret = 0; - break; - } - return ret; -} - -int YM2610TimerOver(int n,int c) -{ - YM2610 *F2610 = &(FM2610[n]); - - if( c ) - { /* Timer B */ - TimerBOver( &(F2610->OPN.ST) ); - } - else - { /* Timer A */ - YM2610UpdateReq(n); - /* timer update */ - TimerAOver( &(F2610->OPN.ST) ); - /* CSM mode key,TL controll */ - if( F2610->OPN.ST.mode & 0x80 ) - { /* CSM mode total level latch and auto key on */ - CSMKeyControll( F2610->OPN.type, &(F2610->CH[2]) ); - } - } - return F2610->OPN.ST.irq; -} - -#endif /* (BUILD_YM2610||BUILD_YM2610B) */ - - - -#if BUILD_YM2612 -/*******************************************************************************/ -/* YM2612 local section */ -/*******************************************************************************/ -/* here's the virtual YM2612 */ -typedef struct -{ - UINT8 REGS[512]; /* registers */ - FM_OPN OPN; /* OPN state */ - FM_CH CH[6]; /* channel state */ - UINT8 addr_A1; /* address line A1 */ - - /* dac output (YM2612) */ - int dacen; - INT32 dacout; -} YM2612; - -static int YM2612NumChips; /* total chip */ -static YM2612 *FM2612=NULL; /* array of YM2612's */ - -static int dacen; - -/* Generate samples for one of the YM2612s */ -void YM2612UpdateOne(int num, INT16 **buffer, int length) -{ - YM2612 *F2612 = &(FM2612[num]); - FM_OPN *OPN = &(FM2612[num].OPN); - int i; - FMSAMPLE *bufL,*bufR; - INT32 dacout = F2612->dacout; - - /* set bufer */ - bufL = buffer[0]; - bufR = buffer[1]; - - if( (void *)F2612 != cur_chip ){ - cur_chip = (void *)F2612; - State = &OPN->ST; - cch[0] = &F2612->CH[0]; - cch[1] = &F2612->CH[1]; - cch[2] = &F2612->CH[2]; - cch[3] = &F2612->CH[3]; - cch[4] = &F2612->CH[4]; - cch[5] = &F2612->CH[5]; - /* DAC mode */ - dacen = F2612->dacen; - - } - - /* refresh PG and EG */ - refresh_fc_eg_chan( OPN, cch[0] ); - refresh_fc_eg_chan( OPN, cch[1] ); - if( (State->mode & 0xc0) ) - { - /* 3SLOT MODE */ - if( cch[2]->SLOT[SLOT1].Incr==-1) - { - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); - refresh_fc_eg_slot(OPN, &cch[2]->SLOT[SLOT4] , cch[2]->fc , cch[2]->kcode ); - } - }else refresh_fc_eg_chan( OPN, cch[2] ); - refresh_fc_eg_chan( OPN, cch[3] ); - refresh_fc_eg_chan( OPN, cch[4] ); - refresh_fc_eg_chan( OPN, cch[5] ); - - /* buffering */ - for(i=0; i < length ; i++) - { - - advance_lfo(OPN); - - /* clear outputs */ - out_fm[0] = 0; - out_fm[1] = 0; - out_fm[2] = 0; - out_fm[3] = 0; - out_fm[4] = 0; - out_fm[5] = 0; - - /* calculate FM */ - chan_calc(OPN, cch[0], 0 ); - chan_calc(OPN, cch[1], 1 ); - chan_calc(OPN, cch[2], 2 ); - chan_calc(OPN, cch[3], 3 ); - chan_calc(OPN, cch[4], 4 ); - if( dacen ) - *cch[5]->connect4 += dacout; - else - chan_calc(OPN, cch[5], 5 ); - - /* advance envelope generator */ - OPN->eg_timer += OPN->eg_timer_add; - while (OPN->eg_timer >= OPN->eg_timer_overflow) - { - OPN->eg_timer -= OPN->eg_timer_overflow; - OPN->eg_cnt++; - - advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[3]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[4]->SLOT[SLOT1]); - advance_eg_channel(OPN, &cch[5]->SLOT[SLOT1]); - } - - { - int lt,rt; - - lt = ((out_fm[0]>>0) & OPN->pan[0]); - rt = ((out_fm[0]>>0) & OPN->pan[1]); - lt += ((out_fm[1]>>0) & OPN->pan[2]); - rt += ((out_fm[1]>>0) & OPN->pan[3]); - lt += ((out_fm[2]>>0) & OPN->pan[4]); - rt += ((out_fm[2]>>0) & OPN->pan[5]); - lt += ((out_fm[3]>>0) & OPN->pan[6]); - rt += ((out_fm[3]>>0) & OPN->pan[7]); - lt += ((out_fm[4]>>0) & OPN->pan[8]); - rt += ((out_fm[4]>>0) & OPN->pan[9]); - lt += ((out_fm[5]>>0) & OPN->pan[10]); - rt += ((out_fm[5]>>0) & OPN->pan[11]); - - lt >>= FINAL_SH; - rt >>= FINAL_SH; - - Limit( lt, MAXOUT, MINOUT ); - Limit( rt, MAXOUT, MINOUT ); - - #ifdef SAVE_SAMPLE - SAVE_ALL_CHANNELS - #endif - - /* buffering */ - bufL[i] = lt; - bufR[i] = rt; - } - - /* timer A control */ - INTERNAL_TIMER_A( State , cch[2] ) - } - INTERNAL_TIMER_B(State,length) - -} - -#ifdef _STATE_H -static void YM2612_postload(void) -{ - int num , r; - - for(num=0;numST,0x03); - FM_BUSY_CLEAR(&OPN->ST); - OPNWriteMode(OPN,0x27,0x30); /* mode 0 , timer reset */ - - OPN->eg_timer = 0; - OPN->eg_cnt = 0; - - FM_STATUS_RESET(&OPN->ST, 0xff); - - reset_channels( &OPN->ST , &F2612->CH[0] , 6 ); - for(i = 0xb6 ; i >= 0xb4 ; i-- ) - { - OPNWriteReg(OPN,i ,0xc0); - OPNWriteReg(OPN,i|0x100,0xc0); - } - for(i = 0xb2 ; i >= 0x30 ; i-- ) - { - OPNWriteReg(OPN,i ,0); - OPNWriteReg(OPN,i|0x100,0); - } - for(i = 0x26 ; i >= 0x20 ; i-- ) OPNWriteReg(OPN,i,0); - /* DAC mode clear */ - F2612->dacen = 0; -} - -/* YM2612 write */ -/* n = number */ -/* a = address */ -/* v = value */ -int YM2612Write(int n, int a, UINT8 v) -{ - YM2612 *F2612 = &(FM2612[n]); - int addr; - - v &= 0xff; /* adjust to 8 bit bus */ - - switch( a&3){ - case 0: /* address port 0 */ - F2612->OPN.ST.address = v; - F2612->addr_A1 = 0; - break; - - case 1: /* data port 0 */ - if (F2612->addr_A1 != 0) - break; /* verified on real YM2608 */ - - addr = F2612->OPN.ST.address; -#ifdef _STATE_H - F2612->REGS[addr] = v; -#endif - switch( addr & 0xf0 ) - { - case 0x20: /* 0x20-0x2f Mode */ - switch( addr ) - { - case 0x2a: /* DAC data (YM2612) */ - YM2612UpdateReq(n); - F2612->dacout = ((int)v - 0x80) << 6; /* level unknown */ - break; - case 0x2b: /* DAC Sel (YM2612) */ - /* b7 = dac enable */ - F2612->dacen = v & 0x80; - cur_chip = NULL; - break; - default: /* OPN section */ - YM2612UpdateReq(n); - /* write register */ - OPNWriteMode(&(F2612->OPN),addr,v); - } - break; - default: /* 0x30-0xff OPN section */ - YM2612UpdateReq(n); - /* write register */ - OPNWriteReg(&(F2612->OPN),addr,v); - } - break; - - case 2: /* address port 1 */ - F2612->OPN.ST.address = v; - F2612->addr_A1 = 1; - break; - - case 3: /* data port 1 */ - if (F2612->addr_A1 != 1) - break; /* verified on real YM2608 */ - - addr = F2612->OPN.ST.address; -#ifdef _STATE_H - F2612->REGS[addr | 0x100] = v; -#endif - YM2612UpdateReq(n); - OPNWriteReg(&(F2612->OPN),addr | 0x100,v); - break; - } - return F2612->OPN.ST.irq; -} - -UINT8 YM2612Read(int n,int a) -{ - YM2612 *F2612 = &(FM2612[n]); - - switch( a&3){ - case 0: /* status 0 */ - return FM_STATUS_FLAG(&F2612->OPN.ST); - case 1: - case 2: - case 3: - LOG(LOG_WAR,("YM2612 #%d:A=%d read unmapped area\n",n,a)); - return FM_STATUS_FLAG(&F2612->OPN.ST); - } - return 0; -} - -int YM2612TimerOver(int n,int c) -{ - YM2612 *F2612 = &(FM2612[n]); - - if( c ) - { /* Timer B */ - TimerBOver( &(F2612->OPN.ST) ); - } - else - { /* Timer A */ - YM2612UpdateReq(n); - /* timer update */ - TimerAOver( &(F2612->OPN.ST) ); - /* CSM mode key,TL controll */ - if( F2612->OPN.ST.mode & 0x80 ) - { /* CSM mode total level latch and auto key on */ - CSMKeyControll( F2612->OPN.type, &(F2612->CH[2]) ); - } - } - return F2612->OPN.ST.irq; -} - -#endif /* BUILD_YM2612 */ diff --git a/jan/src/burn/snd/fm.h b/jan/src/burn/snd/fm.h deleted file mode 100644 index 70d0c0400..000000000 --- a/jan/src/burn/snd/fm.h +++ /dev/null @@ -1,241 +0,0 @@ -/* - File: fm.h -- header file for software emulation for FM sound generator - -*/ -#ifndef _H_FM_FM_ -#define _H_FM_FM_ - -/* --- select emulation chips --- */ -#define BUILD_YM2203 (HAS_YM2203) /* build YM2203(OPN) emulator */ -#define BUILD_YM2608 (HAS_YM2608) /* build YM2608(OPNA) emulator */ -#define BUILD_YM2610 (HAS_YM2610) /* build YM2610(OPNB) emulator */ -#define BUILD_YM2610B (HAS_YM2610B) /* build YM2610B(OPNB?)emulator */ -#define BUILD_YM2612 (HAS_YM2612 || HAS_YM3438) /* build YM2612(OPN2) emulator */ - -//#define BUILD_YM2151 (HAS_YM2151) /* build YM2151(OPM) emulator */ - -/* select bit size of output : 8 or 16 */ -#define FM_SAMPLE_BITS 16 - -/* select timer system internal or external */ -#define FM_INTERNAL_TIMER 0 - -/* --- speedup optimize --- */ -/* busy flag enulation , The definition of FM_GET_TIME_NOW() is necessary. */ -#define FM_BUSY_FLAG_SUPPORT 1 - -/* --- external SSG(YM2149/AY-3-8910)emulator interface port */ -/* used by YM2203,YM2608,and YM2610 */ - -/* SSGClk : Set SSG Clock */ -/* int n = chip number */ -/* int clk = MasterClock(Hz) */ -/* int rate = sample rate(Hz) */ -#define SSGClk(chip,clock) AY8910_set_clock((chip)+ay8910_index_ym,clock) - -/* SSGWrite : Write SSG port */ -/* int n = chip number */ -/* int a = address */ -/* int v = data */ -#define SSGWrite(n,a,v) AY8910Write((n)+ay8910_index_ym,a,v) - -/* SSGRead : Read SSG port */ -/* int n = chip number */ -/* return = Read data */ -#define SSGRead(n) AY8910Read((n)+ay8910_index_ym) - -/* SSGReset : Reset SSG chip */ -/* int n = chip number */ -#define SSGReset(chip) AY8910Reset((chip)+ay8910_index_ym) - - -/* --- external callback funstions for realtime update --- */ - -/* for busy flag emulation , function FM_GET_TIME_NOW() should */ -/* return present time in seconds with "double" precision */ - /* in timer.c */ - #define FM_GET_TIME_NOW() timer_get_time() - -#if BUILD_YM2203 - /* in 2203intf.c */ -void BurnYM2203UpdateRequest(void); - #define YM2203UpdateReq(chip) BurnYM2203UpdateRequest() -#endif -#if BUILD_YM2608 - /* in 2608intf.c */ -void BurnYM2608UpdateRequest(void); - #define YM2608UpdateReq(chip) BurnYM2608UpdateRequest() -#endif -#if BUILD_YM2610 - /* in 2610intf.c */ -void BurnYM2610UpdateRequest(void); -#define YM2610UpdateReq(chip) BurnYM2610UpdateRequest() -#endif -#if BUILD_YM2612 - /* in 2612intf.c */ -void BurnYM2612UpdateRequest(void); - #define YM2612UpdateReq(chip) BurnYM2612UpdateRequest() -#endif -#if 0 //BUILD_YM2151 - /* in 2151intf.c */ - #define YM2151UpdateReq(chip) YM2151UpdateRequest(chip); -#endif - -/* compiler dependence */ -#if 0 -#ifndef OSD_CPU_H -#define OSD_CPU_H -typedef unsigned char UINT8; /* unsigned 8bit */ -typedef unsigned short UINT16; /* unsigned 16bit */ -typedef unsigned int UINT32; /* unsigned 32bit */ -typedef signed char INT8; /* signed 8bit */ -typedef signed short INT16; /* signed 16bit */ -typedef signed int INT32; /* signed 32bit */ -#endif -#endif - -#ifndef INLINE -#define INLINE static __inline__ -#endif - - - - - -#if (FM_SAMPLE_BITS==16) -typedef INT16 FMSAMPLE; -#endif -#if (FM_SAMPLE_BITS==8) -typedef unsigned char FMSAMPLE; -#endif - -typedef void (*FM_TIMERHANDLER)(int n,int c,int cnt,double stepTime); -typedef void (*FM_IRQHANDLER)(int n,int irq); -/* FM_TIMERHANDLER : Stop or Start timer */ -/* int n = chip number */ -/* int c = Channel 0=TimerA,1=TimerB */ -/* int count = timer count (0=stop) */ -/* doube stepTime = step time of one count (sec.)*/ - -/* FM_IRQHHANDLER : IRQ level changing sense */ -/* int n = chip number */ -/* int irq = IRQ level 0=OFF,1=ON */ - -//#if BUILD_YM2203 -#if 1 -/* -------------------- YM2203(OPN) Interface -------------------- */ - -/* -** Initialize YM2203 emulator(s). -** -** 'num' is the number of virtual YM2203's to allocate -** 'baseclock' -** 'rate' is sampling rate -** 'TimerHandler' timer callback handler when timer start and clear -** 'IRQHandler' IRQ callback handler when changed IRQ level -** return 0 = success -*/ -int YM2203Init(int num, int baseclock, int rate, - FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler); - -/* -** shutdown the YM2203 emulators -*/ -void YM2203Shutdown(void); - -/* -** reset all chip registers for YM2203 number 'num' -*/ -void YM2203ResetChip(int num); - -/* -** update one of chip -*/ -void YM2203UpdateOne(int num, INT16 *buffer, int length); - -/* -** Write -** return : InterruptLevel -*/ -int YM2203Write(int n,int a,unsigned char v); - -/* -** Read -** return : InterruptLevel -*/ -unsigned char YM2203Read(int n,int a); - -/* -** Timer OverFlow -*/ -int YM2203TimerOver(int n, int c); - -#endif /* BUILD_YM2203 */ - -#if BUILD_YM2608 -/* -------------------- YM2608(OPNA) Interface -------------------- */ -int YM2608Init(int num, int baseclock, int rate, - void **pcmroma,int *pcmsizea, unsigned char *irom, - FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler); -void YM2608Shutdown(void); -void YM2608ResetChip(int num); -void YM2608UpdateOne(int num, INT16 **buffer, int length); - -int YM2608Write(int n, int a,unsigned char v); -unsigned char YM2608Read(int n,int a); -int YM2608TimerOver(int n, int c ); -#endif /* BUILD_YM2608 */ - -#if (BUILD_YM2610||BUILD_YM2610B) -/* -------------------- YM2610(OPNB) Interface -------------------- */ -int YM2610Init(int num, int baseclock, int rate, - void **pcmroma,int *pcmasize,void **pcmromb,int *pcmbsize, - FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler); -void YM2610SetRom(int num, - void *pcmroma,int pcmsizea,void *pcmromb,int pcmsizeb); -void YM2610Shutdown(void); -void YM2610ResetChip(int num); -void YM2610UpdateOne(int num, INT16 **buffer, int length); -#if BUILD_YM2610B -void YM2610BUpdateOne(int num, INT16 **buffer, int length); -#endif - -int YM2610Write(int n, int a,unsigned char v); -unsigned char YM2610Read(int n,int a); -int YM2610TimerOver(int n, int c ); -#endif /* BUILD_YM2610 */ - -#if BUILD_YM2612 -int YM2612Init(int num, int baseclock, int rate, - FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler); -void YM2612Shutdown(void); -void YM2612ResetChip(int num); -void YM2612UpdateOne(int num, INT16 **buffer, int length); - -int YM2612Write(int n, int a,unsigned char v); -unsigned char YM2612Read(int n,int a); -int YM2612TimerOver(int n, int c ); -#endif /* BUILD_YM2612 */ - -#if 0 //BUILD_YM2151 -/* -------------------- YM2151(OPM) Interface -------------------- */ -int OPMInit(int num, int baseclock, int rate, - FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler); -void OPMShutdown(void); -void OPMResetChip(int num); - -void OPMUpdateOne(int num, INT16 **buffer, int length ); -/* ---- set callback hander when port CT0/1 write ----- */ -/* CT.bit0 = CT0 , CT.bit1 = CT1 */ -/* -typedef void (*write8_handler)(int offset,int data); -*/ -void OPMSetPortHander(int n,write8_handler PortWrite); -/* JB 981119 - so it will match MAME's memory write functions scheme*/ - -int YM2151Write(int n,int a,unsigned char v); -unsigned char YM2151Read(int n,int a); -int YM2151TimerOver(int n,int c); -#endif /* BUILD_YM2151 */ - -#endif /* _H_FM_FM_ */ diff --git a/jan/src/burn/snd/fmopl.c b/jan/src/burn/snd/fmopl.c deleted file mode 100644 index 002e3e83f..000000000 --- a/jan/src/burn/snd/fmopl.c +++ /dev/null @@ -1,2671 +0,0 @@ -/* -** -** File: fmopl.c - software implementation of FM sound generator -** types OPL and OPL2 -** -** Copyright (C) 2002,2003 Jarek Burczynski (bujar at mame dot net) -** Copyright (C) 1999,2000 Tatsuyuki Satoh , MultiArcadeMachineEmulator development -** -** Version 0.72 -** - -Revision History: - -04-08-2003 Jarek Burczynski: - - removed BFRDY hack. BFRDY is busy flag, and it should be 0 only when the chip - handles memory read/write or during the adpcm synthesis when the chip - requests another byte of ADPCM data. - -24-07-2003 Jarek Burczynski: - - added a small hack for Y8950 status BFRDY flag (bit 3 should be set after - some (unknown) delay). Right now it's always set. - -14-06-2003 Jarek Burczynski: - - implemented all of the status register flags in Y8950 emulation - - renamed Y8950SetDeltaTMemory() parameters from _rom_ to _mem_ since - they can be either RAM or ROM - -08-10-2002 Jarek Burczynski (thanks to Dox for the YM3526 chip) - - corrected YM3526Read() to always set bit 2 and bit 1 - to HIGH state - identical to YM3812Read (verified on real YM3526) - -04-28-2002 Jarek Burczynski: - - binary exact Envelope Generator (verified on real YM3812); - compared to YM2151: the EG clock is equal to internal_clock, - rates are 2 times slower and volume resolution is one bit less - - modified interface functions (they no longer return pointer - - that's internal to the emulator now): - - new wrapper functions for OPLCreate: YM3526Init(), YM3812Init() and Y8950Init() - - corrected 'off by one' error in feedback calculations (when feedback is off) - - enabled waveform usage (credit goes to Vlad Romascanu and zazzal22) - - speeded up noise generator calculations (Nicola Salmoria) - -03-24-2002 Jarek Burczynski (thanks to Dox for the YM3812 chip) - Complete rewrite (all verified on real YM3812): - - corrected sin_tab and tl_tab data - - corrected operator output calculations - - corrected waveform_select_enable register; - simply: ignore all writes to waveform_select register when - waveform_select_enable == 0 and do not change the waveform previously selected. - - corrected KSR handling - - corrected Envelope Generator: attack shape, Sustain mode and - Percussive/Non-percussive modes handling - - Envelope Generator rates are two times slower now - - LFO amplitude (tremolo) and phase modulation (vibrato) - - rhythm sounds phase generation - - white noise generator (big thanks to Olivier Galibert for mentioning Berlekamp-Massey algorithm) - - corrected key on/off handling (the 'key' signal is ORed from three sources: FM, rhythm and CSM) - - funky details (like ignoring output of operator 1 in BD rhythm sound when connect == 1) - -12-28-2001 Acho A. Tang - - reflected Delta-T EOS status on Y8950 status port. - - fixed subscription range of attack/decay tables - - - To do: - add delay before key off in CSM mode (see CSMKeyControll) - verify volume of the FM part on the Y8950 -*/ - -#include -#include -#include - -#include "driver.h" /* use M.A.M.E. */ -#include "state.h" - -#include "ymdeltat.h" - -#include "fmopl.h" - -#ifndef PI -#define PI 3.14159265358979323846 -#endif - - - -/* output final shift */ -#if (OPL_SAMPLE_BITS==16) - #define FINAL_SH (0) - #define MAXOUT (+32767) - #define MINOUT (-32768) -#else - #define FINAL_SH (8) - #define MAXOUT (+127) - #define MINOUT (-128) -#endif - - -#define FREQ_SH 16 /* 16.16 fixed point (frequency calculations) */ -#define EG_SH 16 /* 16.16 fixed point (EG timing) */ -#define LFO_SH 24 /* 8.24 fixed point (LFO calculations) */ -#define TIMER_SH 16 /* 16.16 fixed point (timers calculations) */ - -#define FREQ_MASK ((1<=0) - { - if (value < 0x0200) - return (value & ~0); - if (value < 0x0400) - return (value & ~1); - if (value < 0x0800) - return (value & ~3); - if (value < 0x1000) - return (value & ~7); - if (value < 0x2000) - return (value & ~15); - if (value < 0x4000) - return (value & ~31); - return (value & ~63); - } - /*else value < 0*/ - if (value > -0x0200) - return (~abs(value) & ~0); - if (value > -0x0400) - return (~abs(value) & ~1); - if (value > -0x0800) - return (~abs(value) & ~3); - if (value > -0x1000) - return (~abs(value) & ~7); - if (value > -0x2000) - return (~abs(value) & ~15); - if (value > -0x4000) - return (~abs(value) & ~31); - return (~abs(value) & ~63); -} - - -static FILE *sample[1]; - #if 1 /*save to MONO file */ - #define SAVE_ALL_CHANNELS \ - { signed int pom = acc_calc(lt); \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - } - #else /*save to STEREO file */ - #define SAVE_ALL_CHANNELS \ - { signed int pom = lt; \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - pom = rt; \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - } - #endif -#endif - -/* #define LOG_CYM_FILE */ -#ifdef LOG_CYM_FILE - FILE * cymfile = NULL; -#endif - - - -#define OPL_TYPE_WAVESEL 0x01 /* waveform select */ -#define OPL_TYPE_ADPCM 0x02 /* DELTA-T ADPCM unit */ -#define OPL_TYPE_KEYBOARD 0x04 /* keyboard interface */ -#define OPL_TYPE_IO 0x08 /* I/O port */ - -/* ---------- Generic interface section ---------- */ -#define OPL_TYPE_YM3526 (0) -#define OPL_TYPE_YM3812 (OPL_TYPE_WAVESEL) -#define OPL_TYPE_Y8950 (OPL_TYPE_ADPCM|OPL_TYPE_KEYBOARD|OPL_TYPE_IO) - - - -typedef struct{ - UINT32 ar; /* attack rate: AR<<2 */ - UINT32 dr; /* decay rate: DR<<2 */ - UINT32 rr; /* release rate:RR<<2 */ - UINT8 KSR; /* key scale rate */ - UINT8 ksl; /* keyscale level */ - UINT8 ksr; /* key scale rate: kcode>>KSR */ - UINT8 mul; /* multiple: mul_tab[ML] */ - - /* Phase Generator */ - UINT32 Cnt; /* frequency counter */ - UINT32 Incr; /* frequency counter step */ - UINT8 FB; /* feedback shift value */ - INT32 *connect1; /* slot1 output pointer */ - INT32 op1_out[2]; /* slot1 output for feedback */ - UINT8 CON; /* connection (algorithm) type */ - - /* Envelope Generator */ - UINT8 eg_type; /* percussive/non-percussive mode */ - UINT8 state; /* phase type */ - UINT32 TL; /* total level: TL << 2 */ - INT32 TLL; /* adjusted now TL */ - INT32 volume; /* envelope counter */ - UINT32 sl; /* sustain level: sl_tab[SL] */ - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT8 eg_sh_dr; /* (decay state) */ - UINT8 eg_sel_dr; /* (decay state) */ - UINT8 eg_sh_rr; /* (release state) */ - UINT8 eg_sel_rr; /* (release state) */ - UINT32 key; /* 0 = KEY OFF, >0 = KEY ON */ - - /* LFO */ - UINT32 AMmask; /* LFO Amplitude Modulation enable mask */ - UINT8 vib; /* LFO Phase Modulation enable flag (active high)*/ - - /* waveform select */ - unsigned int wavetable; -} OPL_SLOT; - -typedef struct{ - OPL_SLOT SLOT[2]; - /* phase generator state */ - UINT32 block_fnum; /* block+fnum */ - UINT32 fc; /* Freq. Increment base */ - UINT32 ksl_base; /* KeyScaleLevel Base step */ - UINT8 kcode; /* key code (for key scaling) */ -} OPL_CH; - -/* OPL state */ -typedef struct fm_opl_f { - /* FM channel slots */ - OPL_CH P_CH[9]; /* OPL/OPL2 chips have 9 channels*/ - - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/72 */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow; /* envelope generator timer overlfows every 1 sample (on real chip) */ - - UINT8 rhythm; /* Rhythm mode */ - - UINT32 fn_tab[1024]; /* fnumber->increment counter */ - - /* LFO */ - UINT32 LFO_AM; - INT32 LFO_PM; - - UINT8 lfo_am_depth; - UINT8 lfo_pm_depth_range; - UINT32 lfo_am_cnt; - UINT32 lfo_am_inc; - UINT32 lfo_pm_cnt; - UINT32 lfo_pm_inc; - - UINT32 noise_rng; /* 23 bit noise shift register */ - UINT32 noise_p; /* current noise 'phase' */ - UINT32 noise_f; /* current noise period */ - - UINT8 wavesel; /* waveform select enable flag */ - - int T[2]; /* timer counters */ - UINT8 st[2]; /* timer enable */ - -#if BUILD_Y8950 - /* Delta-T ADPCM unit (Y8950) */ - - YM_DELTAT *deltat; - - /* Keyboard and I/O ports interface */ - UINT8 portDirection; - UINT8 portLatch; - OPL_PORTHANDLER_R porthandler_r; - OPL_PORTHANDLER_W porthandler_w; - int port_param; - OPL_PORTHANDLER_R keyboardhandler_r; - OPL_PORTHANDLER_W keyboardhandler_w; - int keyboard_param; -#endif - - /* external event callback handlers */ - OPL_TIMERHANDLER TimerHandler; /* TIMER handler */ - int TimerParam; /* TIMER parameter */ - OPL_IRQHANDLER IRQHandler; /* IRQ handler */ - int IRQParam; /* IRQ parameter */ - OPL_UPDATEHANDLER UpdateHandler;/* stream update handler */ - int UpdateParam; /* stream update parameter */ - - UINT8 type; /* chip type */ - UINT8 address; /* address register */ - UINT8 status; /* status flag */ - UINT8 statusmask; /* status mask */ - UINT8 mode; /* Reg.08 : CSM,notesel,etc. */ - - int clock; /* master clock (Hz) */ - int rate; /* sampling rate (Hz) */ - double freqbase; /* frequency base */ - double TimerBase; /* Timer base time (==sampling time)*/ - - signed int phase_modulation; /* phase modulation input (SLOT 2) */ - signed int output[1]; - -#if BUILD_Y8950 - INT32 output_deltat[4]; /* for Y8950 DELTA-T, chip is mono, that 4 here is just for safety */ -#endif -} FM_OPL; - - - -/* mapping of register number (offset) to slot number used by the emulator */ -static const int slot_array[32]= -{ - 0, 2, 4, 1, 3, 5,-1,-1, - 6, 8,10, 7, 9,11,-1,-1, - 12,14,16,13,15,17,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1 -}; - -/* key scale level */ -/* table is 3dB/octave , DV converts this into 6dB/octave */ -/* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */ -#define DV (0.1875/2.0) -static const UINT32 ksl_tab[8*16]= -{ - /* OCT 0 */ - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - /* OCT 1 */ - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.750/DV, 1.125/DV, 1.500/DV, - 1.875/DV, 2.250/DV, 2.625/DV, 3.000/DV, - /* OCT 2 */ - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 1.125/DV, 1.875/DV, 2.625/DV, - 3.000/DV, 3.750/DV, 4.125/DV, 4.500/DV, - 4.875/DV, 5.250/DV, 5.625/DV, 6.000/DV, - /* OCT 3 */ - 0.000/DV, 0.000/DV, 0.000/DV, 1.875/DV, - 3.000/DV, 4.125/DV, 4.875/DV, 5.625/DV, - 6.000/DV, 6.750/DV, 7.125/DV, 7.500/DV, - 7.875/DV, 8.250/DV, 8.625/DV, 9.000/DV, - /* OCT 4 */ - 0.000/DV, 0.000/DV, 3.000/DV, 4.875/DV, - 6.000/DV, 7.125/DV, 7.875/DV, 8.625/DV, - 9.000/DV, 9.750/DV,10.125/DV,10.500/DV, - 10.875/DV,11.250/DV,11.625/DV,12.000/DV, - /* OCT 5 */ - 0.000/DV, 3.000/DV, 6.000/DV, 7.875/DV, - 9.000/DV,10.125/DV,10.875/DV,11.625/DV, - 12.000/DV,12.750/DV,13.125/DV,13.500/DV, - 13.875/DV,14.250/DV,14.625/DV,15.000/DV, - /* OCT 6 */ - 0.000/DV, 6.000/DV, 9.000/DV,10.875/DV, - 12.000/DV,13.125/DV,13.875/DV,14.625/DV, - 15.000/DV,15.750/DV,16.125/DV,16.500/DV, - 16.875/DV,17.250/DV,17.625/DV,18.000/DV, - /* OCT 7 */ - 0.000/DV, 9.000/DV,12.000/DV,13.875/DV, - 15.000/DV,16.125/DV,16.875/DV,17.625/DV, - 18.000/DV,18.750/DV,19.125/DV,19.500/DV, - 19.875/DV,20.250/DV,20.625/DV,21.000/DV -}; -#undef DV - -/* sustain level table (3dB per step) */ -/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/ -#define SC(db) (UINT32) ( db * (2.0/ENV_STEP) ) -static const UINT32 sl_tab[16]={ - SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7), - SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31) -}; -#undef SC - - -#define RATE_STEPS (8) -static const unsigned char eg_inc[15*RATE_STEPS]={ - -/*cycle:0 1 2 3 4 5 6 7*/ - -/* 0 */ 0,1, 0,1, 0,1, 0,1, /* rates 00..12 0 (increment by 0 or 1) */ -/* 1 */ 0,1, 0,1, 1,1, 0,1, /* rates 00..12 1 */ -/* 2 */ 0,1, 1,1, 0,1, 1,1, /* rates 00..12 2 */ -/* 3 */ 0,1, 1,1, 1,1, 1,1, /* rates 00..12 3 */ - -/* 4 */ 1,1, 1,1, 1,1, 1,1, /* rate 13 0 (increment by 1) */ -/* 5 */ 1,1, 1,2, 1,1, 1,2, /* rate 13 1 */ -/* 6 */ 1,2, 1,2, 1,2, 1,2, /* rate 13 2 */ -/* 7 */ 1,2, 2,2, 1,2, 2,2, /* rate 13 3 */ - -/* 8 */ 2,2, 2,2, 2,2, 2,2, /* rate 14 0 (increment by 2) */ -/* 9 */ 2,2, 2,4, 2,2, 2,4, /* rate 14 1 */ -/*10 */ 2,4, 2,4, 2,4, 2,4, /* rate 14 2 */ -/*11 */ 2,4, 4,4, 2,4, 4,4, /* rate 14 3 */ - -/*12 */ 4,4, 4,4, 4,4, 4,4, /* rates 15 0, 15 1, 15 2, 15 3 (increment by 4) */ -/*13 */ 8,8, 8,8, 8,8, 8,8, /* rates 15 2, 15 3 for attack */ -/*14 */ 0,0, 0,0, 0,0, 0,0, /* infinity rates for attack and decay(s) */ -}; - - -#define O(a) (a*RATE_STEPS) - -/*note that there is no O(13) in this table - it's directly in the code */ -static const unsigned char eg_rate_select[16+64+16]={ /* Envelope Generator rates (16 + 64 rates + 16 RKS) */ -/* 16 infinite time rates */ -O(14),O(14),O(14),O(14),O(14),O(14),O(14),O(14), -O(14),O(14),O(14),O(14),O(14),O(14),O(14),O(14), - -/* rates 00-12 */ -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), - -/* rate 13 */ -O( 4),O( 5),O( 6),O( 7), - -/* rate 14 */ -O( 8),O( 9),O(10),O(11), - -/* rate 15 */ -O(12),O(12),O(12),O(12), - -/* 16 dummy rates (same as 15 3) */ -O(12),O(12),O(12),O(12),O(12),O(12),O(12),O(12), -O(12),O(12),O(12),O(12),O(12),O(12),O(12),O(12), - -}; -#undef O - -/*rate 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 */ -/*shift 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 */ -/*mask 4095, 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0, 0, 0, 0 */ - -#define O(a) (a*1) -static const unsigned char eg_rate_shift[16+64+16]={ /* Envelope Generator counter shifts (16 + 64 rates + 16 RKS) */ -/* 16 infinite time rates */ -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), - -/* rates 00-12 */ -O(12),O(12),O(12),O(12), -O(11),O(11),O(11),O(11), -O(10),O(10),O(10),O(10), -O( 9),O( 9),O( 9),O( 9), -O( 8),O( 8),O( 8),O( 8), -O( 7),O( 7),O( 7),O( 7), -O( 6),O( 6),O( 6),O( 6), -O( 5),O( 5),O( 5),O( 5), -O( 4),O( 4),O( 4),O( 4), -O( 3),O( 3),O( 3),O( 3), -O( 2),O( 2),O( 2),O( 2), -O( 1),O( 1),O( 1),O( 1), -O( 0),O( 0),O( 0),O( 0), - -/* rate 13 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 14 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 15 */ -O( 0),O( 0),O( 0),O( 0), - -/* 16 dummy rates (same as 15 3) */ -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), - -}; -#undef O - - -/* multiple table */ -#define ML 2 -static const UINT8 mul_tab[16]= { -/* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */ - 0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML, - 8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML -}; -#undef ML - -/* TL_TAB_LEN is calculated as: -* 12 - sinus amplitude bits (Y axis) -* 2 - sinus sign bit (Y axis) -* TL_RES_LEN - sinus resolution (X axis) -*/ -#define TL_TAB_LEN (12*2*TL_RES_LEN) -static signed int tl_tab[TL_TAB_LEN]; - -#define ENV_QUIET (TL_TAB_LEN>>4) - -/* sin waveform table in 'decibel' scale */ -/* four waveforms on OPL2 type chips */ -static unsigned int sin_tab[SIN_LEN * 4]; - - -/* LFO Amplitude Modulation table (verified on real YM3812) - 27 output levels (triangle waveform); 1 level takes one of: 192, 256 or 448 samples - - Length: 210 elements. - - Each of the elements has to be repeated - exactly 64 times (on 64 consecutive samples). - The whole table takes: 64 * 210 = 13440 samples. - - When AM = 1 data is used directly - When AM = 0 data is divided by 4 before being used (loosing precision is important) -*/ - -#define LFO_AM_TAB_ELEMENTS 210 - -static const UINT8 lfo_am_table[LFO_AM_TAB_ELEMENTS] = { -0,0,0,0,0,0,0, -1,1,1,1, -2,2,2,2, -3,3,3,3, -4,4,4,4, -5,5,5,5, -6,6,6,6, -7,7,7,7, -8,8,8,8, -9,9,9,9, -10,10,10,10, -11,11,11,11, -12,12,12,12, -13,13,13,13, -14,14,14,14, -15,15,15,15, -16,16,16,16, -17,17,17,17, -18,18,18,18, -19,19,19,19, -20,20,20,20, -21,21,21,21, -22,22,22,22, -23,23,23,23, -24,24,24,24, -25,25,25,25, -26,26,26, -25,25,25,25, -24,24,24,24, -23,23,23,23, -22,22,22,22, -21,21,21,21, -20,20,20,20, -19,19,19,19, -18,18,18,18, -17,17,17,17, -16,16,16,16, -15,15,15,15, -14,14,14,14, -13,13,13,13, -12,12,12,12, -11,11,11,11, -10,10,10,10, -9,9,9,9, -8,8,8,8, -7,7,7,7, -6,6,6,6, -5,5,5,5, -4,4,4,4, -3,3,3,3, -2,2,2,2, -1,1,1,1 -}; - -/* LFO Phase Modulation table (verified on real YM3812) */ -static const INT8 lfo_pm_table[8*8*2] = { - -/* FNUM2/FNUM = 00 0xxxxxxx (0x0000) */ -0, 0, 0, 0, 0, 0, 0, 0, /*LFO PM depth = 0*/ -0, 0, 0, 0, 0, 0, 0, 0, /*LFO PM depth = 1*/ - -/* FNUM2/FNUM = 00 1xxxxxxx (0x0080) */ -0, 0, 0, 0, 0, 0, 0, 0, /*LFO PM depth = 0*/ -1, 0, 0, 0,-1, 0, 0, 0, /*LFO PM depth = 1*/ - -/* FNUM2/FNUM = 01 0xxxxxxx (0x0100) */ -1, 0, 0, 0,-1, 0, 0, 0, /*LFO PM depth = 0*/ -2, 1, 0,-1,-2,-1, 0, 1, /*LFO PM depth = 1*/ - -/* FNUM2/FNUM = 01 1xxxxxxx (0x0180) */ -1, 0, 0, 0,-1, 0, 0, 0, /*LFO PM depth = 0*/ -3, 1, 0,-1,-3,-1, 0, 1, /*LFO PM depth = 1*/ - -/* FNUM2/FNUM = 10 0xxxxxxx (0x0200) */ -2, 1, 0,-1,-2,-1, 0, 1, /*LFO PM depth = 0*/ -4, 2, 0,-2,-4,-2, 0, 2, /*LFO PM depth = 1*/ - -/* FNUM2/FNUM = 10 1xxxxxxx (0x0280) */ -2, 1, 0,-1,-2,-1, 0, 1, /*LFO PM depth = 0*/ -5, 2, 0,-2,-5,-2, 0, 2, /*LFO PM depth = 1*/ - -/* FNUM2/FNUM = 11 0xxxxxxx (0x0300) */ -3, 1, 0,-1,-3,-1, 0, 1, /*LFO PM depth = 0*/ -6, 3, 0,-3,-6,-3, 0, 3, /*LFO PM depth = 1*/ - -/* FNUM2/FNUM = 11 1xxxxxxx (0x0380) */ -3, 1, 0,-1,-3,-1, 0, 1, /*LFO PM depth = 0*/ -7, 3, 0,-3,-7,-3, 0, 3 /*LFO PM depth = 1*/ -}; - - -/* lock level of common table */ -static int num_lock = 0; - - -static void *cur_chip = NULL; /* current chip pointer */ -static OPL_SLOT *SLOT7_1, *SLOT7_2, *SLOT8_1, *SLOT8_2; - - -INLINE int limit( int val, int max, int min ) { - if ( val > max ) - val = max; - else if ( val < min ) - val = min; - - return val; -} - - -/* status set and IRQ handling */ -INLINE void OPL_STATUS_SET(FM_OPL *OPL,int flag) -{ - /* set status flag */ - OPL->status |= flag; - if(!(OPL->status & 0x80)) - { - if(OPL->status & OPL->statusmask) - { /* IRQ on */ - OPL->status |= 0x80; - /* callback user interrupt handler (IRQ is OFF to ON) */ - if(OPL->IRQHandler) (OPL->IRQHandler)(OPL->IRQParam,1); - } - } -} - -/* status reset and IRQ handling */ -INLINE void OPL_STATUS_RESET(FM_OPL *OPL,int flag) -{ - /* reset status flag */ - OPL->status &=~flag; - if((OPL->status & 0x80)) - { - if (!(OPL->status & OPL->statusmask) ) - { - OPL->status &= 0x7f; - /* callback user interrupt handler (IRQ is ON to OFF) */ - if(OPL->IRQHandler) (OPL->IRQHandler)(OPL->IRQParam,0); - } - } -} - -/* IRQ mask set */ -INLINE void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag) -{ - OPL->statusmask = flag; - /* IRQ handling check */ - OPL_STATUS_SET(OPL,0); - OPL_STATUS_RESET(OPL,0); -} - - -/* advance LFO to next sample */ -INLINE void advance_lfo(FM_OPL *OPL) -{ - UINT8 tmp; - - /* LFO */ - OPL->lfo_am_cnt += OPL->lfo_am_inc; - if (OPL->lfo_am_cnt >= (LFO_AM_TAB_ELEMENTS<lfo_am_cnt -= (LFO_AM_TAB_ELEMENTS<lfo_am_cnt >> LFO_SH ]; - - if (OPL->lfo_am_depth) - OPL->LFO_AM = tmp; - else - OPL->LFO_AM = tmp>>2; - - OPL->lfo_pm_cnt += OPL->lfo_pm_inc; - OPL->LFO_PM = ((OPL->lfo_pm_cnt>>LFO_SH) & 7) | OPL->lfo_pm_depth_range; -} - -/* advance to next sample */ -INLINE void advance(FM_OPL *OPL) -{ - OPL_CH *CH; - OPL_SLOT *op; - int i; - - OPL->eg_timer += OPL->eg_timer_add; - - while (OPL->eg_timer >= OPL->eg_timer_overflow) - { - OPL->eg_timer -= OPL->eg_timer_overflow; - - OPL->eg_cnt++; - - for (i=0; i<9*2; i++) - { - CH = &OPL->P_CH[i/2]; - op = &CH->SLOT[i&1]; - - /* Envelope Generator */ - switch(op->state) - { - case EG_ATT: /* attack phase */ - if ( !(OPL->eg_cnt & ((1<eg_sh_ar)-1) ) ) - { - op->volume += (~op->volume * - (eg_inc[op->eg_sel_ar + ((OPL->eg_cnt>>op->eg_sh_ar)&7)]) - ) >>3; - - if (op->volume <= MIN_ATT_INDEX) - { - op->volume = MIN_ATT_INDEX; - op->state = EG_DEC; - } - - } - break; - - case EG_DEC: /* decay phase */ - if ( !(OPL->eg_cnt & ((1<eg_sh_dr)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_dr + ((OPL->eg_cnt>>op->eg_sh_dr)&7)]; - - if ( op->volume >= op->sl ) - op->state = EG_SUS; - - } - break; - - case EG_SUS: /* sustain phase */ - - /* this is important behaviour: - one can change percusive/non-percussive modes on the fly and - the chip will remain in sustain phase - verified on real YM3812 */ - - if(op->eg_type) /* non-percussive mode */ - { - /* do nothing */ - } - else /* percussive mode */ - { - /* during sustain phase chip adds Release Rate (in percussive mode) */ - if ( !(OPL->eg_cnt & ((1<eg_sh_rr)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_rr + ((OPL->eg_cnt>>op->eg_sh_rr)&7)]; - - if ( op->volume >= MAX_ATT_INDEX ) - op->volume = MAX_ATT_INDEX; - } - /* else do nothing in sustain phase */ - } - break; - - case EG_REL: /* release phase */ - if ( !(OPL->eg_cnt & ((1<eg_sh_rr)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_rr + ((OPL->eg_cnt>>op->eg_sh_rr)&7)]; - - if ( op->volume >= MAX_ATT_INDEX ) - { - op->volume = MAX_ATT_INDEX; - op->state = EG_OFF; - } - - } - break; - - default: - break; - } - } - } - - for (i=0; i<9*2; i++) - { - CH = &OPL->P_CH[i/2]; - op = &CH->SLOT[i&1]; - - /* Phase Generator */ - if(op->vib) - { - UINT8 block; - unsigned int block_fnum = CH->block_fnum; - - unsigned int fnum_lfo = (block_fnum&0x0380) >> 7; - - signed int lfo_fn_table_index_offset = lfo_pm_table[OPL->LFO_PM + 16*fnum_lfo ]; - - if (lfo_fn_table_index_offset) /* LFO phase modulation active */ - { - block_fnum += lfo_fn_table_index_offset; - block = (block_fnum&0x1c00) >> 10; - op->Cnt += (OPL->fn_tab[block_fnum&0x03ff] >> (7-block)) * op->mul; - } - else /* LFO phase modulation = zero */ - { - op->Cnt += op->Incr; - } - } - else /* LFO phase modulation disabled for this operator */ - { - op->Cnt += op->Incr; - } - } - - /* The Noise Generator of the YM3812 is 23-bit shift register. - * Period is equal to 2^23-2 samples. - * Register works at sampling frequency of the chip, so output - * can change on every sample. - * - * Output of the register and input to the bit 22 is: - * bit0 XOR bit14 XOR bit15 XOR bit22 - * - * Simply use bit 22 as the noise output. - */ - - OPL->noise_p += OPL->noise_f; - i = OPL->noise_p >> FREQ_SH; /* number of events (shifts of the shift register) */ - OPL->noise_p &= FREQ_MASK; - while (i) - { - /* - UINT32 j; - j = ( (OPL->noise_rng) ^ (OPL->noise_rng>>14) ^ (OPL->noise_rng>>15) ^ (OPL->noise_rng>>22) ) & 1; - OPL->noise_rng = (j<<22) | (OPL->noise_rng>>1); - */ - - /* - Instead of doing all the logic operations above, we - use a trick here (and use bit 0 as the noise output). - The difference is only that the noise bit changes one - step ahead. This doesn't matter since we don't know - what is real state of the noise_rng after the reset. - */ - - if (OPL->noise_rng & 1) OPL->noise_rng ^= 0x800302; - OPL->noise_rng >>= 1; - - i--; - } -} - - -INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) -{ - UINT32 p; - - p = (env<<4) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + (pm<<16))) >> FREQ_SH ) & SIN_MASK) ]; - - if (p >= TL_TAB_LEN) - return 0; - return tl_tab[p]; -} - -INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) -{ - UINT32 p; - - p = (env<<4) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + pm )) >> FREQ_SH ) & SIN_MASK) ]; - - if (p >= TL_TAB_LEN) - return 0; - return tl_tab[p]; -} - - -#define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (OPL->LFO_AM & (OP)->AMmask)) - -/* calculate output */ -INLINE void OPL_CALC_CH( FM_OPL *OPL, OPL_CH *CH ) -{ - OPL_SLOT *SLOT; - unsigned int env; - signed int out; - - OPL->phase_modulation = 0; - - /* SLOT 1 */ - SLOT = &CH->SLOT[SLOT1]; - env = volume_calc(SLOT); - out = SLOT->op1_out[0] + SLOT->op1_out[1]; - SLOT->op1_out[0] = SLOT->op1_out[1]; - *SLOT->connect1 += SLOT->op1_out[0]; - SLOT->op1_out[1] = 0; - if( env < ENV_QUIET ) - { - if (!SLOT->FB) - out = 0; - SLOT->op1_out[1] = op_calc1(SLOT->Cnt, env, (out<FB), SLOT->wavetable ); - } - - /* SLOT 2 */ - SLOT++; - env = volume_calc(SLOT); - if( env < ENV_QUIET ) - OPL->output[0] += op_calc(SLOT->Cnt, env, OPL->phase_modulation, SLOT->wavetable); -} - -/* - operators used in the rhythm sounds generation process: - - Envelope Generator: - -channel operator register number Bass High Snare Tom Top -/ slot number TL ARDR SLRR Wave Drum Hat Drum Tom Cymbal - 6 / 0 12 50 70 90 f0 + - 6 / 1 15 53 73 93 f3 + - 7 / 0 13 51 71 91 f1 + - 7 / 1 16 54 74 94 f4 + - 8 / 0 14 52 72 92 f2 + - 8 / 1 17 55 75 95 f5 + - - Phase Generator: - -channel operator register number Bass High Snare Tom Top -/ slot number MULTIPLE Drum Hat Drum Tom Cymbal - 6 / 0 12 30 + - 6 / 1 15 33 + - 7 / 0 13 31 + + + - 7 / 1 16 34 ----- n o t u s e d ----- - 8 / 0 14 32 + - 8 / 1 17 35 + + - -channel operator register number Bass High Snare Tom Top -number number BLK/FNUM2 FNUM Drum Hat Drum Tom Cymbal - 6 12,15 B6 A6 + - - 7 13,16 B7 A7 + + + - - 8 14,17 B8 A8 + + + - -*/ - -/* calculate rhythm */ - -INLINE void OPL_CALC_RH( FM_OPL *OPL, OPL_CH *CH, unsigned int noise ) -{ - OPL_SLOT *SLOT; - signed int out; - unsigned int env; - - - /* Bass Drum (verified on real YM3812): - - depends on the channel 6 'connect' register: - when connect = 0 it works the same as in normal (non-rhythm) mode (op1->op2->out) - when connect = 1 _only_ operator 2 is present on output (op2->out), operator 1 is ignored - - output sample always is multiplied by 2 - */ - - OPL->phase_modulation = 0; - /* SLOT 1 */ - SLOT = &CH[6].SLOT[SLOT1]; - env = volume_calc(SLOT); - - out = SLOT->op1_out[0] + SLOT->op1_out[1]; - SLOT->op1_out[0] = SLOT->op1_out[1]; - - if (!SLOT->CON) - OPL->phase_modulation = SLOT->op1_out[0]; - /* else ignore output of operator 1 */ - - SLOT->op1_out[1] = 0; - if( env < ENV_QUIET ) - { - if (!SLOT->FB) - out = 0; - SLOT->op1_out[1] = op_calc1(SLOT->Cnt, env, (out<FB), SLOT->wavetable ); - } - - /* SLOT 2 */ - SLOT++; - env = volume_calc(SLOT); - if( env < ENV_QUIET ) - OPL->output[0] += op_calc(SLOT->Cnt, env, OPL->phase_modulation, SLOT->wavetable) * 2; - - - /* Phase generation is based on: */ - /* HH (13) channel 7->slot 1 combined with channel 8->slot 2 (same combination as TOP CYMBAL but different output phases) */ - /* SD (16) channel 7->slot 1 */ - /* TOM (14) channel 8->slot 1 */ - /* TOP (17) channel 7->slot 1 combined with channel 8->slot 2 (same combination as HIGH HAT but different output phases) */ - - /* Envelope generation based on: */ - /* HH channel 7->slot1 */ - /* SD channel 7->slot2 */ - /* TOM channel 8->slot1 */ - /* TOP channel 8->slot2 */ - - - /* The following formulas can be well optimized. - I leave them in direct form for now (in case I've missed something). - */ - - /* High Hat (verified on real YM3812) */ - env = volume_calc(SLOT7_1); - if( env < ENV_QUIET ) - { - - /* high hat phase generation: - phase = d0 or 234 (based on frequency only) - phase = 34 or 2d0 (based on noise) - */ - - /* base frequency derived from operator 1 in channel 7 */ - unsigned char bit7 = ((SLOT7_1->Cnt>>FREQ_SH)>>7)&1; - unsigned char bit3 = ((SLOT7_1->Cnt>>FREQ_SH)>>3)&1; - unsigned char bit2 = ((SLOT7_1->Cnt>>FREQ_SH)>>2)&1; - - unsigned char res1 = (bit2 ^ bit7) | bit3; - - /* when res1 = 0 phase = 0x000 | 0xd0; */ - /* when res1 = 1 phase = 0x200 | (0xd0>>2); */ - UINT32 phase = res1 ? (0x200|(0xd0>>2)) : 0xd0; - - /* enable gate based on frequency of operator 2 in channel 8 */ - unsigned char bit5e= ((SLOT8_2->Cnt>>FREQ_SH)>>5)&1; - unsigned char bit3e= ((SLOT8_2->Cnt>>FREQ_SH)>>3)&1; - - unsigned char res2 = (bit3e ^ bit5e); - - /* when res2 = 0 pass the phase from calculation above (res1); */ - /* when res2 = 1 phase = 0x200 | (0xd0>>2); */ - if (res2) - phase = (0x200|(0xd0>>2)); - - - /* when phase & 0x200 is set and noise=1 then phase = 0x200|0xd0 */ - /* when phase & 0x200 is set and noise=0 then phase = 0x200|(0xd0>>2), ie no change */ - if (phase&0x200) - { - if (noise) - phase = 0x200|0xd0; - } - else - /* when phase & 0x200 is clear and noise=1 then phase = 0xd0>>2 */ - /* when phase & 0x200 is clear and noise=0 then phase = 0xd0, ie no change */ - { - if (noise) - phase = 0xd0>>2; - } - - OPL->output[0] += op_calc(phase<wavetable) * 2; - } - - /* Snare Drum (verified on real YM3812) */ - env = volume_calc(SLOT7_2); - if( env < ENV_QUIET ) - { - /* base frequency derived from operator 1 in channel 7 */ - unsigned char bit8 = ((SLOT7_1->Cnt>>FREQ_SH)>>8)&1; - - /* when bit8 = 0 phase = 0x100; */ - /* when bit8 = 1 phase = 0x200; */ - UINT32 phase = bit8 ? 0x200 : 0x100; - - /* Noise bit XOR'es phase by 0x100 */ - /* when noisebit = 0 pass the phase from calculation above */ - /* when noisebit = 1 phase ^= 0x100; */ - /* in other words: phase ^= (noisebit<<8); */ - if (noise) - phase ^= 0x100; - - OPL->output[0] += op_calc(phase<wavetable) * 2; - } - - /* Tom Tom (verified on real YM3812) */ - env = volume_calc(SLOT8_1); - if( env < ENV_QUIET ) - OPL->output[0] += op_calc(SLOT8_1->Cnt, env, 0, SLOT8_1->wavetable) * 2; - - /* Top Cymbal (verified on real YM3812) */ - env = volume_calc(SLOT8_2); - if( env < ENV_QUIET ) - { - /* base frequency derived from operator 1 in channel 7 */ - unsigned char bit7 = ((SLOT7_1->Cnt>>FREQ_SH)>>7)&1; - unsigned char bit3 = ((SLOT7_1->Cnt>>FREQ_SH)>>3)&1; - unsigned char bit2 = ((SLOT7_1->Cnt>>FREQ_SH)>>2)&1; - - unsigned char res1 = (bit2 ^ bit7) | bit3; - - /* when res1 = 0 phase = 0x000 | 0x100; */ - /* when res1 = 1 phase = 0x200 | 0x100; */ - UINT32 phase = res1 ? 0x300 : 0x100; - - /* enable gate based on frequency of operator 2 in channel 8 */ - unsigned char bit5e= ((SLOT8_2->Cnt>>FREQ_SH)>>5)&1; - unsigned char bit3e= ((SLOT8_2->Cnt>>FREQ_SH)>>3)&1; - - unsigned char res2 = (bit3e ^ bit5e); - /* when res2 = 0 pass the phase from calculation above (res1); */ - /* when res2 = 1 phase = 0x200 | 0x100; */ - if (res2) - phase = 0x300; - - OPL->output[0] += op_calc(phase<wavetable) * 2; - } - -} - - -/* generic table initialize */ -static int init_tables(void) -{ - signed int i,x; - signed int n; - double o,m; - - - for (x=0; x>= 4; /* 12 bits here */ - if (n&1) /* round to nearest */ - n = (n>>1)+1; - else - n = n>>1; - /* 11 bits here (rounded) */ - n <<= 1; /* 12 bits here (as in real chip) */ - tl_tab[ x*2 + 0 ] = n; - tl_tab[ x*2 + 1 ] = -tl_tab[ x*2 + 0 ]; - - for (i=1; i<12; i++) - { - tl_tab[ x*2+0 + i*2*TL_RES_LEN ] = tl_tab[ x*2+0 ]>>i; - tl_tab[ x*2+1 + i*2*TL_RES_LEN ] = -tl_tab[ x*2+0 + i*2*TL_RES_LEN ]; - } - #if 0 - logerror("tl %04i", x*2); - for (i=0; i<12; i++) - logerror(", [%02i] %5i", i*2, tl_tab[ x*2 /*+1*/ + i*2*TL_RES_LEN ] ); - logerror("\n"); - #endif - } - /*logerror("FMOPL.C: TL_TAB_LEN = %i elements (%i bytes)\n",TL_TAB_LEN, (int)sizeof(tl_tab));*/ - - - for (i=0; i0.0) - o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */ - else - o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */ - - o = o / (ENV_STEP/4); - - n = (int)(2.0*o); - if (n&1) /* round to nearest */ - n = (n>>1)+1; - else - n = n>>1; - - sin_tab[ i ] = n*2 + (m>=0.0? 0: 1 ); - - /*logerror("FMOPL.C: sin [%4i (hex=%03x)]= %4i (tl_tab value=%5i)\n", i, i, sin_tab[i], tl_tab[sin_tab[i]] );*/ - } - - for (i=0; i>1) ]; - - /* waveform 3: _ _ _ _ */ - /* / |_/ |_/ |_/ |_*/ - /* abs(output only first quarter of the sinus waveform) */ - - if (i & (1<<(SIN_BITS-2)) ) - sin_tab[3*SIN_LEN+i] = TL_TAB_LEN; - else - sin_tab[3*SIN_LEN+i] = sin_tab[i & (SIN_MASK>>2)]; - - /*logerror("FMOPL.C: sin1[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[1*SIN_LEN+i], tl_tab[sin_tab[1*SIN_LEN+i]] ); - logerror("FMOPL.C: sin2[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[2*SIN_LEN+i], tl_tab[sin_tab[2*SIN_LEN+i]] ); - logerror("FMOPL.C: sin3[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[3*SIN_LEN+i], tl_tab[sin_tab[3*SIN_LEN+i]] );*/ - } - /*logerror("FMOPL.C: ENV_QUIET= %08x (dec*8=%i)\n", ENV_QUIET, ENV_QUIET*8 );*/ - - -#ifdef SAVE_SAMPLE - sample[0]=fopen("sampsum.pcm","wb"); -#endif - - return 1; -} - -static void OPLCloseTable( void ) -{ -#ifdef SAVE_SAMPLE - fclose(sample[0]); -#endif -} - - - -static void OPL_initalize(FM_OPL *OPL) -{ - int i; - - /* frequency base */ - OPL->freqbase = (OPL->rate) ? ((double)OPL->clock / 72.0) / OPL->rate : 0; -#if 0 - OPL->rate = (double)OPL->clock / 72.0; - OPL->freqbase = 1.0; -#endif - - /*logerror("freqbase=%f\n", OPL->freqbase);*/ - - /* Timer base time */ - OPL->TimerBase = 1.0 / ((double)OPL->clock / 72.0 ); - - /* make fnumber -> increment counter table */ - for( i=0 ; i < 1024 ; i++ ) - { - /* opn phase increment counter = 20bit */ - OPL->fn_tab[i] = (UINT32)( (double)i * 64 * OPL->freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ -#if 0 - logerror("FMOPL.C: fn_tab[%4i] = %08x (dec=%8i)\n", - i, OPL->fn_tab[i]>>6, OPL->fn_tab[i]>>6 ); -#endif - } - -#if 0 - for( i=0 ; i < 16 ; i++ ) - { - logerror("FMOPL.C: sl_tab[%i] = %08x\n", - i, sl_tab[i] ); - } - for( i=0 ; i < 8 ; i++ ) - { - int j; - logerror("FMOPL.C: ksl_tab[oct=%2i] =",i); - for (j=0; j<16; j++) - { - logerror("%08x ", ksl_tab[i*16+j] ); - } - logerror("\n"); - } -#endif - - - /* Amplitude modulation: 27 output levels (triangle waveform); 1 level takes one of: 192, 256 or 448 samples */ - /* One entry from LFO_AM_TABLE lasts for 64 samples */ - OPL->lfo_am_inc = (1.0 / 64.0 ) * (1<freqbase; - - /* Vibrato: 8 output levels (triangle waveform); 1 level takes 1024 samples */ - OPL->lfo_pm_inc = (1.0 / 1024.0) * (1<freqbase; - - /*logerror ("OPL->lfo_am_inc = %8x ; OPL->lfo_pm_inc = %8x\n", OPL->lfo_am_inc, OPL->lfo_pm_inc);*/ - - /* Noise generator: a step takes 1 sample */ - OPL->noise_f = (1.0 / 1.0) * (1<freqbase; - - OPL->eg_timer_add = (1<freqbase; - OPL->eg_timer_overflow = ( 1 ) * (1<eg_timer_add, OPL->eg_timer_overflow);*/ - -} - -INLINE void FM_KEYON(OPL_SLOT *SLOT, UINT32 key_set) -{ - if( !SLOT->key ) - { - /* restart Phase Generator */ - SLOT->Cnt = 0; - /* phase -> Attack */ - SLOT->state = EG_ATT; - } - SLOT->key |= key_set; -} - -INLINE void FM_KEYOFF(OPL_SLOT *SLOT, UINT32 key_clr) -{ - if( SLOT->key ) - { - SLOT->key &= key_clr; - - if( !SLOT->key ) - { - /* phase -> Release */ - if (SLOT->state>EG_REL) - SLOT->state = EG_REL; - } - } -} - -/* update phase increment counter of operator (also update the EG rates if necessary) */ -INLINE void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT) -{ - int ksr; - - /* (frequency) phase increment counter */ - SLOT->Incr = CH->fc * SLOT->mul; - ksr = CH->kcode >> SLOT->KSR; - - if( SLOT->ksr != ksr ) - { - SLOT->ksr = ksr; - - /* calculate envelope generator rates */ - if ((SLOT->ar + SLOT->ksr) < 16+62) - { - SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; - SLOT->eg_sel_ar = eg_rate_select[SLOT->ar + SLOT->ksr ]; - } - else - { - SLOT->eg_sh_ar = 0; - SLOT->eg_sel_ar = 13*RATE_STEPS; - } - SLOT->eg_sh_dr = eg_rate_shift [SLOT->dr + SLOT->ksr ]; - SLOT->eg_sel_dr = eg_rate_select[SLOT->dr + SLOT->ksr ]; - SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr ]; - SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr ]; - } -} - -/* set multi,am,vib,EG-TYP,KSR,mul */ -INLINE void set_mul(FM_OPL *OPL,int slot,int v) -{ - OPL_CH *CH = &OPL->P_CH[slot/2]; - OPL_SLOT *SLOT = &CH->SLOT[slot&1]; - - SLOT->mul = mul_tab[v&0x0f]; - SLOT->KSR = (v&0x10) ? 0 : 2; - SLOT->eg_type = (v&0x20); - SLOT->vib = (v&0x40); - SLOT->AMmask = (v&0x80) ? ~0 : 0; - CALC_FCSLOT(CH,SLOT); -} - -/* set ksl & tl */ -INLINE void set_ksl_tl(FM_OPL *OPL,int slot,int v) -{ - OPL_CH *CH = &OPL->P_CH[slot/2]; - OPL_SLOT *SLOT = &CH->SLOT[slot&1]; - int ksl = v>>6; /* 0 / 1.5 / 3.0 / 6.0 dB/OCT */ - - SLOT->ksl = ksl ? 3-ksl : 31; - SLOT->TL = (v&0x3f)<<(ENV_BITS-1-7); /* 7 bits TL (bit 6 = always 0) */ - - SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl); -} - -/* set attack rate & decay rate */ -INLINE void set_ar_dr(FM_OPL *OPL,int slot,int v) -{ - OPL_CH *CH = &OPL->P_CH[slot/2]; - OPL_SLOT *SLOT = &CH->SLOT[slot&1]; - - SLOT->ar = (v>>4) ? 16 + ((v>>4) <<2) : 0; - - if ((SLOT->ar + SLOT->ksr) < 16+62) - { - SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; - SLOT->eg_sel_ar = eg_rate_select[SLOT->ar + SLOT->ksr ]; - } - else - { - SLOT->eg_sh_ar = 0; - SLOT->eg_sel_ar = 13*RATE_STEPS; - } - - SLOT->dr = (v&0x0f)? 16 + ((v&0x0f)<<2) : 0; - SLOT->eg_sh_dr = eg_rate_shift [SLOT->dr + SLOT->ksr ]; - SLOT->eg_sel_dr = eg_rate_select[SLOT->dr + SLOT->ksr ]; -} - -/* set sustain level & release rate */ -INLINE void set_sl_rr(FM_OPL *OPL,int slot,int v) -{ - OPL_CH *CH = &OPL->P_CH[slot/2]; - OPL_SLOT *SLOT = &CH->SLOT[slot&1]; - - SLOT->sl = sl_tab[ v>>4 ]; - - SLOT->rr = (v&0x0f)? 16 + ((v&0x0f)<<2) : 0; - SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr ]; - SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr ]; -} - - -/* write a value v to register r on OPL chip */ -static void OPLWriteReg(FM_OPL *OPL, int r, int v) -{ - OPL_CH *CH; - int slot; - int block_fnum; - - - /* adjust bus to 8 bits */ - r &= 0xff; - v &= 0xff; - -#ifdef LOG_CYM_FILE - if ((cymfile) && (r!=0) ) - { - fputc( (unsigned char)r, cymfile ); - fputc( (unsigned char)v, cymfile ); - } -#endif - - - switch(r&0xe0) - { - case 0x00: /* 00-1f:control */ - switch(r&0x1f) - { - case 0x01: /* waveform select enable */ - if(OPL->type&OPL_TYPE_WAVESEL) - { - OPL->wavesel = v&0x20; - /* do not change the waveform previously selected */ - } - break; - case 0x02: /* Timer 1 */ - OPL->T[0] = (256-v)*4; - break; - case 0x03: /* Timer 2 */ - OPL->T[1] = (256-v)*16; - break; - case 0x04: /* IRQ clear / mask and Timer enable */ - if(v&0x80) - { /* IRQ flag clear */ - OPL_STATUS_RESET(OPL,0x7f-0x08); /* don't reset BFRDY flag or we will have to call deltat module to set the flag */ - } - else - { /* set IRQ mask ,timer enable*/ - UINT8 st1 = v&1; - UINT8 st2 = (v>>1)&1; - - /* IRQRST,T1MSK,t2MSK,EOSMSK,BRMSK,x,ST2,ST1 */ - OPL_STATUS_RESET(OPL, v & (0x78-0x08) ); - OPL_STATUSMASK_SET(OPL, (~v) & 0x78 ); - - /* timer 2 */ - if(OPL->st[1] != st2) - { - double interval = st2 ? (double)OPL->T[1]*OPL->TimerBase : 0.0; - OPL->st[1] = st2; - if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+1,interval); - } - /* timer 1 */ - if(OPL->st[0] != st1) - { - double interval = st1 ? (double)OPL->T[0]*OPL->TimerBase : 0.0; - OPL->st[0] = st1; - if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+0,interval); - } - } - break; -#if BUILD_Y8950 - case 0x06: /* Key Board OUT */ - if(OPL->type&OPL_TYPE_KEYBOARD) - { - if(OPL->keyboardhandler_w) - OPL->keyboardhandler_w(OPL->keyboard_param,v); - else - logerror("Y8950: write unmapped KEYBOARD port\n"); - } - break; - case 0x07: /* DELTA-T control 1 : START,REC,MEMDATA,REPT,SPOFF,x,x,RST */ - if(OPL->type&OPL_TYPE_ADPCM) - YM_DELTAT_ADPCM_Write(OPL->deltat,r-0x07,v); - break; -#endif - case 0x08: /* MODE,DELTA-T control 2 : CSM,NOTESEL,x,x,smpl,da/ad,64k,rom */ - OPL->mode = v; -#if BUILD_Y8950 - if(OPL->type&OPL_TYPE_ADPCM) - YM_DELTAT_ADPCM_Write(OPL->deltat,r-0x07,v&0x0f); /* mask 4 LSBs in register 08 for DELTA-T unit */ -#endif - break; - -#if BUILD_Y8950 - case 0x09: /* START ADD */ - case 0x0a: - case 0x0b: /* STOP ADD */ - case 0x0c: - case 0x0d: /* PRESCALE */ - case 0x0e: - case 0x0f: /* ADPCM data write */ - case 0x10: /* DELTA-N */ - case 0x11: /* DELTA-N */ - case 0x12: /* ADPCM volume */ - if(OPL->type&OPL_TYPE_ADPCM) - YM_DELTAT_ADPCM_Write(OPL->deltat,r-0x07,v); - break; - - case 0x15: /* DAC data high 8 bits (F7,F6...F2) */ - case 0x16: /* DAC data low 2 bits (F1, F0 in bits 7,6) */ - case 0x17: /* DAC data shift (S2,S1,S0 in bits 2,1,0) */ - logerror("FMOPL.C: DAC data register written, but not implemented reg=%02x val=%02x\n",r,v); - break; - - case 0x18: /* I/O CTRL (Direction) */ - if(OPL->type&OPL_TYPE_IO) - OPL->portDirection = v&0x0f; - break; - case 0x19: /* I/O DATA */ - if(OPL->type&OPL_TYPE_IO) - { - OPL->portLatch = v; - if(OPL->porthandler_w) - OPL->porthandler_w(OPL->port_param,v&OPL->portDirection); - } - break; -#endif - default: - logerror("FMOPL.C: write to unknown register: %02x\n",r); - break; - } - break; - case 0x20: /* am ON, vib ON, ksr, eg_type, mul */ - slot = slot_array[r&0x1f]; - if(slot < 0) return; - set_mul(OPL,slot,v); - break; - case 0x40: - slot = slot_array[r&0x1f]; - if(slot < 0) return; - set_ksl_tl(OPL,slot,v); - break; - case 0x60: - slot = slot_array[r&0x1f]; - if(slot < 0) return; - set_ar_dr(OPL,slot,v); - break; - case 0x80: - slot = slot_array[r&0x1f]; - if(slot < 0) return; - set_sl_rr(OPL,slot,v); - break; - case 0xa0: - if (r == 0xbd) /* am depth, vibrato depth, r,bd,sd,tom,tc,hh */ - { - OPL->lfo_am_depth = v & 0x80; - OPL->lfo_pm_depth_range = (v&0x40) ? 8 : 0; - - OPL->rhythm = v&0x3f; - - if(OPL->rhythm&0x20) - { - /* BD key on/off */ - if(v&0x10) - { - FM_KEYON (&OPL->P_CH[6].SLOT[SLOT1], 2); - FM_KEYON (&OPL->P_CH[6].SLOT[SLOT2], 2); - } - else - { - FM_KEYOFF(&OPL->P_CH[6].SLOT[SLOT1],~2); - FM_KEYOFF(&OPL->P_CH[6].SLOT[SLOT2],~2); - } - /* HH key on/off */ - if(v&0x01) FM_KEYON (&OPL->P_CH[7].SLOT[SLOT1], 2); - else FM_KEYOFF(&OPL->P_CH[7].SLOT[SLOT1],~2); - /* SD key on/off */ - if(v&0x08) FM_KEYON (&OPL->P_CH[7].SLOT[SLOT2], 2); - else FM_KEYOFF(&OPL->P_CH[7].SLOT[SLOT2],~2); - /* TOM key on/off */ - if(v&0x04) FM_KEYON (&OPL->P_CH[8].SLOT[SLOT1], 2); - else FM_KEYOFF(&OPL->P_CH[8].SLOT[SLOT1],~2); - /* TOP-CY key on/off */ - if(v&0x02) FM_KEYON (&OPL->P_CH[8].SLOT[SLOT2], 2); - else FM_KEYOFF(&OPL->P_CH[8].SLOT[SLOT2],~2); - } - else - { - /* BD key off */ - FM_KEYOFF(&OPL->P_CH[6].SLOT[SLOT1],~2); - FM_KEYOFF(&OPL->P_CH[6].SLOT[SLOT2],~2); - /* HH key off */ - FM_KEYOFF(&OPL->P_CH[7].SLOT[SLOT1],~2); - /* SD key off */ - FM_KEYOFF(&OPL->P_CH[7].SLOT[SLOT2],~2); - /* TOM key off */ - FM_KEYOFF(&OPL->P_CH[8].SLOT[SLOT1],~2); - /* TOP-CY off */ - FM_KEYOFF(&OPL->P_CH[8].SLOT[SLOT2],~2); - } - return; - } - /* keyon,block,fnum */ - if( (r&0x0f) > 8) return; - CH = &OPL->P_CH[r&0x0f]; - if(!(r&0x10)) - { /* a0-a8 */ - block_fnum = (CH->block_fnum&0x1f00) | v; - } - else - { /* b0-b8 */ - block_fnum = ((v&0x1f)<<8) | (CH->block_fnum&0xff); - - if(v&0x20) - { - FM_KEYON (&CH->SLOT[SLOT1], 1); - FM_KEYON (&CH->SLOT[SLOT2], 1); - } - else - { - FM_KEYOFF(&CH->SLOT[SLOT1],~1); - FM_KEYOFF(&CH->SLOT[SLOT2],~1); - } - } - /* update */ - if(CH->block_fnum != block_fnum) - { - UINT8 block = block_fnum >> 10; - - CH->block_fnum = block_fnum; - - CH->ksl_base = ksl_tab[block_fnum>>6]; - CH->fc = OPL->fn_tab[block_fnum&0x03ff] >> (7-block); - - /* BLK 2,1,0 bits -> bits 3,2,1 of kcode */ - CH->kcode = (CH->block_fnum&0x1c00)>>9; - - /* the info below is actually opposite to what is stated in the Manuals (verifed on real YM3812) */ - /* if notesel == 0 -> lsb of kcode is bit 10 (MSB) of fnum */ - /* if notesel == 1 -> lsb of kcode is bit 9 (MSB-1) of fnum */ - if (OPL->mode&0x40) - CH->kcode |= (CH->block_fnum&0x100)>>8; /* notesel == 1 */ - else - CH->kcode |= (CH->block_fnum&0x200)>>9; /* notesel == 0 */ - - /* refresh Total Level in both SLOTs of this channel */ - CH->SLOT[SLOT1].TLL = CH->SLOT[SLOT1].TL + (CH->ksl_base>>CH->SLOT[SLOT1].ksl); - CH->SLOT[SLOT2].TLL = CH->SLOT[SLOT2].TL + (CH->ksl_base>>CH->SLOT[SLOT2].ksl); - - /* refresh frequency counter in both SLOTs of this channel */ - CALC_FCSLOT(CH,&CH->SLOT[SLOT1]); - CALC_FCSLOT(CH,&CH->SLOT[SLOT2]); - } - break; - case 0xc0: - /* FB,C */ - if( (r&0x0f) > 8) return; - CH = &OPL->P_CH[r&0x0f]; - CH->SLOT[SLOT1].FB = (v>>1)&7 ? ((v>>1)&7) + 7 : 0; - CH->SLOT[SLOT1].CON = v&1; - CH->SLOT[SLOT1].connect1 = CH->SLOT[SLOT1].CON ? &OPL->output[0] : &OPL->phase_modulation; - break; - case 0xe0: /* waveform select */ - /* simply ignore write to the waveform select register if selecting not enabled in test register */ - if(OPL->wavesel) - { - slot = slot_array[r&0x1f]; - if(slot < 0) return; - CH = &OPL->P_CH[slot/2]; - - CH->SLOT[slot&1].wavetable = (v&0x03)*SIN_LEN; - } - break; - } -} - -#ifdef LOG_CYM_FILE -static void cymfile_callback (int n) -{ - if (cymfile) - { - fputc( (unsigned char)0, cymfile ); - } -} -#endif - -/* lock/unlock for common table */ -static int OPL_LockTable(void) -{ - num_lock++; - if(num_lock>1) return 0; - - /* first time */ - - cur_chip = NULL; - /* allocate total level table (128kb space) */ - if( !init_tables() ) - { - num_lock--; - return -1; - } - -#ifdef LOG_CYM_FILE - cymfile = fopen("3812_.cym","wb"); - if (cymfile) - timer_pulse ( TIME_IN_HZ(110), 0, cymfile_callback); /*110 Hz pulse timer*/ - else - logerror("Could not create file 3812_.cym\n"); -#endif - - return 0; -} - -static void OPL_UnLockTable(void) -{ - if(num_lock) num_lock--; - if(num_lock) return; - - /* last time */ - - cur_chip = NULL; - OPLCloseTable(); - -#ifdef LOG_CYM_FILE - fclose (cymfile); - cymfile = NULL; -#endif - -} - -static void OPLResetChip(FM_OPL *OPL) -{ - int c,s; - int i; - - OPL->eg_timer = 0; - OPL->eg_cnt = 0; - - OPL->noise_rng = 1; /* noise shift register */ - OPL->mode = 0; /* normal mode */ - OPL_STATUS_RESET(OPL,0x7f); - - /* reset with register write */ - OPLWriteReg(OPL,0x01,0); /* wavesel disable */ - OPLWriteReg(OPL,0x02,0); /* Timer1 */ - OPLWriteReg(OPL,0x03,0); /* Timer2 */ - OPLWriteReg(OPL,0x04,0); /* IRQ mask clear */ - for(i = 0xff ; i >= 0x20 ; i-- ) OPLWriteReg(OPL,i,0); - - /* reset operator parameters */ - for( c = 0 ; c < 9 ; c++ ) - { - OPL_CH *CH = &OPL->P_CH[c]; - for(s = 0 ; s < 2 ; s++ ) - { - /* wave table */ - CH->SLOT[s].wavetable = 0; - CH->SLOT[s].state = EG_OFF; - CH->SLOT[s].volume = MAX_ATT_INDEX; - } - } -#if BUILD_Y8950 - if(OPL->type&OPL_TYPE_ADPCM) - { - YM_DELTAT *DELTAT = OPL->deltat; - - DELTAT->freqbase = OPL->freqbase; - DELTAT->output_pointer = &OPL->output_deltat[0]; - DELTAT->portshift = 5; - DELTAT->output_range = 1<<23; - YM_DELTAT_ADPCM_Reset(DELTAT,0,YM_DELTAT_EMULATION_MODE_NORMAL); - } -#endif -} - -/* Create one of virtual YM3812/YM3526/Y8950 */ -/* 'clock' is chip clock in Hz */ -/* 'rate' is sampling rate */ -static FM_OPL *OPLCreate(int type, int clock, int rate) -{ - char *ptr; - FM_OPL *OPL; - int state_size; - - if (OPL_LockTable() ==-1) return NULL; - - /* calculate OPL state size */ - state_size = sizeof(FM_OPL); - -#if BUILD_Y8950 - if (type&OPL_TYPE_ADPCM) state_size+= sizeof(YM_DELTAT); -#endif - - /* allocate memory block */ - ptr = malloc(state_size); - - if (ptr==NULL) - return NULL; - - /* clear */ - memset(ptr,0,state_size); - - OPL = (FM_OPL *)ptr; - - ptr += sizeof(FM_OPL); - -#if BUILD_Y8950 - if (type&OPL_TYPE_ADPCM) - { - OPL->deltat = (YM_DELTAT *)ptr; - } - ptr += sizeof(YM_DELTAT); -#endif - - OPL->type = type; - OPL->clock = clock; - OPL->rate = rate; - - /* init global tables */ - OPL_initalize(OPL); - - return OPL; -} - -/* Destroy one of virtual YM3812 */ -static void OPLDestroy(FM_OPL *OPL) -{ - OPL_UnLockTable(); - if (OPL) { - free(OPL); - OPL = NULL; - } -} - -/* Optional handlers */ - -static void OPLSetTimerHandler(FM_OPL *OPL,OPL_TIMERHANDLER TimerHandler,int channelOffset) -{ - OPL->TimerHandler = TimerHandler; - OPL->TimerParam = channelOffset; -} -static void OPLSetIRQHandler(FM_OPL *OPL,OPL_IRQHANDLER IRQHandler,int param) -{ - OPL->IRQHandler = IRQHandler; - OPL->IRQParam = param; -} -static void OPLSetUpdateHandler(FM_OPL *OPL,OPL_UPDATEHANDLER UpdateHandler,int param) -{ - OPL->UpdateHandler = UpdateHandler; - OPL->UpdateParam = param; -} - -static int OPLWrite(FM_OPL *OPL,int a,int v) -{ - if( !(a&1) ) - { /* address port */ - OPL->address = v & 0xff; - } - else - { /* data port */ - if(OPL->UpdateHandler) OPL->UpdateHandler(OPL->UpdateParam,0); - OPLWriteReg(OPL,OPL->address,v); - } - return OPL->status>>7; -} - -static unsigned char OPLRead(FM_OPL *OPL,int a) -{ - if( !(a&1) ) - { - /* status port */ - - #if BUILD_Y8950 - - if(OPL->type&OPL_TYPE_ADPCM) /* Y8950 */ - { - return (OPL->status & (OPL->statusmask|0x80)) | (OPL->deltat->PCM_BSY&1); - } - - #endif - - /* OPL and OPL2 */ - return OPL->status & (OPL->statusmask|0x80); - } - -#if BUILD_Y8950 - /* data port */ - switch(OPL->address) - { - case 0x05: /* KeyBoard IN */ - if(OPL->type&OPL_TYPE_KEYBOARD) - { - if(OPL->keyboardhandler_r) - return OPL->keyboardhandler_r(OPL->keyboard_param); - else - logerror("Y8950: read unmapped KEYBOARD port\n"); - } - return 0; - - case 0x0f: /* ADPCM-DATA */ - if(OPL->type&OPL_TYPE_ADPCM) - { - UINT8 val; - - val = YM_DELTAT_ADPCM_Read(OPL->deltat); - /*logerror("Y8950: read ADPCM value read=%02x\n",val);*/ - return val; - } - return 0; - - case 0x19: /* I/O DATA */ - if(OPL->type&OPL_TYPE_IO) - { - if(OPL->porthandler_r) - return OPL->porthandler_r(OPL->port_param); - else - logerror("Y8950:read unmapped I/O port\n"); - } - return 0; - case 0x1a: /* PCM-DATA */ - if(OPL->type&OPL_TYPE_ADPCM) - { - logerror("Y8950 A/D convertion is accessed but not implemented !\n"); - return 0x80; /* 2's complement PCM data - result from A/D convertion */ - } - return 0; - } -#endif - - return 0xff; -} - -/* CSM Key Controll */ -INLINE void CSMKeyControll(OPL_CH *CH) -{ - FM_KEYON (&CH->SLOT[SLOT1], 4); - FM_KEYON (&CH->SLOT[SLOT2], 4); - - /* The key off should happen exactly one sample later - not implemented correctly yet */ - - FM_KEYOFF(&CH->SLOT[SLOT1], ~4); - FM_KEYOFF(&CH->SLOT[SLOT2], ~4); -} - - -static int OPLTimerOver(FM_OPL *OPL,int c) -{ - if( c ) - { /* Timer B */ - OPL_STATUS_SET(OPL,0x20); - } - else - { /* Timer A */ - OPL_STATUS_SET(OPL,0x40); - /* CSM mode key,TL controll */ - if( OPL->mode & 0x80 ) - { /* CSM mode total level latch and auto key on */ - int ch; - if(OPL->UpdateHandler) OPL->UpdateHandler(OPL->UpdateParam,0); - for(ch=0; ch<9; ch++) - CSMKeyControll( &OPL->P_CH[ch] ); - } - } - /* reload timer */ - if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+c,(double)OPL->T[c]*OPL->TimerBase); - return OPL->status>>7; -} - - -#define MAX_OPL_CHIPS 2 - - -#if (BUILD_YM3812) - -static FM_OPL *OPL_YM3812[MAX_OPL_CHIPS]; /* array of pointers to the YM3812's */ -static int YM3812NumChips = 0; /* number of chips */ - -int YM3812Init(int num, int clock, int rate) -{ - int i; - - if (YM3812NumChips) - return -1; /* duplicate init. */ - - YM3812NumChips = num; - - for (i = 0;i < YM3812NumChips; i++) - { - /* emulator create */ - OPL_YM3812[i] = OPLCreate(OPL_TYPE_YM3812,clock,rate); - if(OPL_YM3812[i] == NULL) - { - /* it's really bad - we run out of memeory */ - YM3812NumChips = 0; - return -1; - } - /* reset */ - YM3812ResetChip(i); - } - - return 0; -} - -void YM3812Shutdown(void) -{ - int i; - - for (i = 0;i < YM3812NumChips; i++) - { - /* emulator shutdown */ - OPLDestroy(OPL_YM3812[i]); - OPL_YM3812[i] = NULL; - } - YM3812NumChips = 0; -} -void YM3812ResetChip(int which) -{ - OPLResetChip(OPL_YM3812[which]); -} - -int YM3812Write(int which, int a, int v) -{ - return OPLWrite(OPL_YM3812[which], a, v); -} - -unsigned char YM3812Read(int which, int a) -{ - /* YM3812 always returns bit2 and bit1 in HIGH state */ - return OPLRead(OPL_YM3812[which], a) | 0x06 ; -} -int YM3812TimerOver(int which, int c) -{ - return OPLTimerOver(OPL_YM3812[which], c); -} - -void YM3812SetTimerHandler(int which, OPL_TIMERHANDLER TimerHandler, int channelOffset) -{ - OPLSetTimerHandler(OPL_YM3812[which], TimerHandler, channelOffset); -} -void YM3812SetIRQHandler(int which,OPL_IRQHANDLER IRQHandler,int param) -{ - OPLSetIRQHandler(OPL_YM3812[which], IRQHandler, param); -} -void YM3812SetUpdateHandler(int which,OPL_UPDATEHANDLER UpdateHandler,int param) -{ - OPLSetUpdateHandler(OPL_YM3812[which], UpdateHandler, param); -} - - -/* -** Generate samples for one of the YM3812's -** -** 'which' is the virtual YM3812 number -** '*buffer' is the output buffer pointer -** 'length' is the number of samples that should be generated -*/ -void YM3812UpdateOne(int which, INT16 *buffer, int length) -{ - FM_OPL *OPL = OPL_YM3812[which]; - UINT8 rhythm = OPL->rhythm&0x20; - OPLSAMPLE *buf = buffer; - int i; - - if( (void *)OPL != cur_chip ){ - cur_chip = (void *)OPL; - /* rhythm slots */ - SLOT7_1 = &OPL->P_CH[7].SLOT[SLOT1]; - SLOT7_2 = &OPL->P_CH[7].SLOT[SLOT2]; - SLOT8_1 = &OPL->P_CH[8].SLOT[SLOT1]; - SLOT8_2 = &OPL->P_CH[8].SLOT[SLOT2]; - } - for( i=0; i < length ; i++ ) - { - int lt; - - OPL->output[0] = 0; - - advance_lfo(OPL); - - /* FM part */ - OPL_CALC_CH(OPL, &OPL->P_CH[0]); - OPL_CALC_CH(OPL, &OPL->P_CH[1]); - OPL_CALC_CH(OPL, &OPL->P_CH[2]); - OPL_CALC_CH(OPL, &OPL->P_CH[3]); - OPL_CALC_CH(OPL, &OPL->P_CH[4]); - OPL_CALC_CH(OPL, &OPL->P_CH[5]); - - if(!rhythm) - { - OPL_CALC_CH(OPL, &OPL->P_CH[6]); - OPL_CALC_CH(OPL, &OPL->P_CH[7]); - OPL_CALC_CH(OPL, &OPL->P_CH[8]); - } - else /* Rhythm part */ - { - OPL_CALC_RH(OPL, &OPL->P_CH[0], (OPL->noise_rng>>0)&1 ); - } - - lt = OPL->output[0]; - - lt >>= FINAL_SH; - - /* limit check */ - lt = limit( lt , MAXOUT, MINOUT ); - - #ifdef SAVE_SAMPLE - if (which==0) - { - SAVE_ALL_CHANNELS - } - #endif - - /* store to sound buffer */ - buf[i] = lt; - - advance(OPL); - } - -} -#endif /* BUILD_YM3812 */ - - - -#if (BUILD_YM3526) - -static FM_OPL *OPL_YM3526[MAX_OPL_CHIPS]; /* array of pointers to the YM3526's */ -static int YM3526NumChips = 0; /* number of chips */ - -int YM3526Init(int num, int clock, int rate) -{ - int i; - - if (YM3526NumChips) - return -1; /* duplicate init. */ - - YM3526NumChips = num; - - for (i = 0;i < YM3526NumChips; i++) - { - /* emulator create */ - OPL_YM3526[i] = OPLCreate(OPL_TYPE_YM3526,clock,rate); - if(OPL_YM3526[i] == NULL) - { - /* it's really bad - we run out of memeory */ - YM3526NumChips = 0; - return -1; - } - /* reset */ - YM3526ResetChip(i); - } - - return 0; -} - -void YM3526Shutdown(void) -{ - int i; - - for (i = 0;i < YM3526NumChips; i++) - { - /* emulator shutdown */ - OPLDestroy(OPL_YM3526[i]); - OPL_YM3526[i] = NULL; - } - YM3526NumChips = 0; -} -void YM3526ResetChip(int which) -{ - OPLResetChip(OPL_YM3526[which]); -} - -int YM3526Write(int which, int a, int v) -{ - return OPLWrite(OPL_YM3526[which], a, v); -} - -unsigned char YM3526Read(int which, int a) -{ - /* YM3526 always returns bit2 and bit1 in HIGH state */ - return OPLRead(OPL_YM3526[which], a) | 0x06 ; -} -int YM3526TimerOver(int which, int c) -{ - return OPLTimerOver(OPL_YM3526[which], c); -} - -void YM3526SetTimerHandler(int which, OPL_TIMERHANDLER TimerHandler, int channelOffset) -{ - OPLSetTimerHandler(OPL_YM3526[which], TimerHandler, channelOffset); -} -void YM3526SetIRQHandler(int which,OPL_IRQHANDLER IRQHandler,int param) -{ - OPLSetIRQHandler(OPL_YM3526[which], IRQHandler, param); -} -void YM3526SetUpdateHandler(int which,OPL_UPDATEHANDLER UpdateHandler,int param) -{ - OPLSetUpdateHandler(OPL_YM3526[which], UpdateHandler, param); -} - - -/* -** Generate samples for one of the YM3526's -** -** 'which' is the virtual YM3526 number -** '*buffer' is the output buffer pointer -** 'length' is the number of samples that should be generated -*/ -void YM3526UpdateOne(int which, INT16 *buffer, int length) -{ - FM_OPL *OPL = OPL_YM3526[which]; - UINT8 rhythm = OPL->rhythm&0x20; - OPLSAMPLE *buf = buffer; - int i; - - if( (void *)OPL != cur_chip ){ - cur_chip = (void *)OPL; - /* rhythm slots */ - SLOT7_1 = &OPL->P_CH[7].SLOT[SLOT1]; - SLOT7_2 = &OPL->P_CH[7].SLOT[SLOT2]; - SLOT8_1 = &OPL->P_CH[8].SLOT[SLOT1]; - SLOT8_2 = &OPL->P_CH[8].SLOT[SLOT2]; - } - for( i=0; i < length ; i++ ) - { - int lt; - - OPL->output[0] = 0; - - advance_lfo(OPL); - - /* FM part */ - OPL_CALC_CH(OPL, &OPL->P_CH[0]); - OPL_CALC_CH(OPL, &OPL->P_CH[1]); - OPL_CALC_CH(OPL, &OPL->P_CH[2]); - OPL_CALC_CH(OPL, &OPL->P_CH[3]); - OPL_CALC_CH(OPL, &OPL->P_CH[4]); - OPL_CALC_CH(OPL, &OPL->P_CH[5]); - - if(!rhythm) - { - OPL_CALC_CH(OPL, &OPL->P_CH[6]); - OPL_CALC_CH(OPL, &OPL->P_CH[7]); - OPL_CALC_CH(OPL, &OPL->P_CH[8]); - } - else /* Rhythm part */ - { - OPL_CALC_RH(OPL, &OPL->P_CH[0], (OPL->noise_rng>>0)&1 ); - } - - lt = OPL->output[0]; - - lt >>= FINAL_SH; - - /* limit check */ - lt = limit( lt , MAXOUT, MINOUT ); - - #ifdef SAVE_SAMPLE - if (which==0) - { - SAVE_ALL_CHANNELS - } - #endif - - /* store to sound buffer */ - buf[i] = lt; - - advance(OPL); - } - -} -#endif /* BUILD_YM3526 */ - - - - -#if BUILD_Y8950 - -static FM_OPL *OPL_Y8950[MAX_OPL_CHIPS]; /* array of pointers to the Y8950's */ -static int Y8950NumChips = 0; /* number of chips */ - -static void Y8950_deltat_status_set(UINT8 which, UINT8 changebits) -{ - OPL_STATUS_SET(OPL_Y8950[which], changebits); -} -static void Y8950_deltat_status_reset(UINT8 which, UINT8 changebits) -{ - OPL_STATUS_RESET(OPL_Y8950[which], changebits); -} - -int Y8950Init(int num, int clock, int rate) -{ - int i; - - if (Y8950NumChips) - return -1; /* duplicate init. */ - - Y8950NumChips = num; - - for (i = 0;i < Y8950NumChips; i++) - { - /* emulator create */ - OPL_Y8950[i] = OPLCreate(OPL_TYPE_Y8950,clock,rate); - if(OPL_Y8950[i] == NULL) - { - /* it's really bad - we run out of memeory */ - Y8950NumChips = 0; - return -1; - } - OPL_Y8950[i]->deltat->status_set_handler = Y8950_deltat_status_set; - OPL_Y8950[i]->deltat->status_reset_handler = Y8950_deltat_status_reset; - OPL_Y8950[i]->deltat->status_change_which_chip = i; - OPL_Y8950[i]->deltat->status_change_EOS_bit = 0x10; /* status flag: set bit4 on End Of Sample */ - OPL_Y8950[i]->deltat->status_change_BRDY_bit = 0x08; /* status flag: set bit3 on BRDY (End Of: ADPCM analysis/synthesis, memory reading/writing) */ - - /*OPL_Y8950[i]->deltat->write_time = 10.0 / clock;*/ /* a single byte write takes 10 cycles of main clock */ - /*OPL_Y8950[i]->deltat->read_time = 8.0 / clock;*/ /* a single byte read takes 8 cycles of main clock */ - /* reset */ - Y8950ResetChip(i); - } - - return 0; -} - -void Y8950Shutdown(void) -{ - int i; - - for (i = 0;i < Y8950NumChips; i++) - { - /* emulator shutdown */ - OPLDestroy(OPL_Y8950[i]); - OPL_Y8950[i] = NULL; - } - Y8950NumChips = 0; -} -void Y8950ResetChip(int which) -{ - OPLResetChip(OPL_Y8950[which]); -} - -int Y8950Write(int which, int a, int v) -{ - return OPLWrite(OPL_Y8950[which], a, v); -} - -unsigned char Y8950Read(int which, int a) -{ - return OPLRead(OPL_Y8950[which], a); -} -int Y8950TimerOver(int which, int c) -{ - return OPLTimerOver(OPL_Y8950[which], c); -} - -void Y8950SetTimerHandler(int which, OPL_TIMERHANDLER TimerHandler, int channelOffset) -{ - OPLSetTimerHandler(OPL_Y8950[which], TimerHandler, channelOffset); -} -void Y8950SetIRQHandler(int which,OPL_IRQHANDLER IRQHandler,int param) -{ - OPLSetIRQHandler(OPL_Y8950[which], IRQHandler, param); -} -void Y8950SetUpdateHandler(int which,OPL_UPDATEHANDLER UpdateHandler,int param) -{ - OPLSetUpdateHandler(OPL_Y8950[which], UpdateHandler, param); -} - -void Y8950SetDeltaTMemory(int which, void * deltat_mem_ptr, int deltat_mem_size ) -{ - FM_OPL *OPL = OPL_Y8950[which]; - OPL->deltat->memory = (UINT8 *)(deltat_mem_ptr); - OPL->deltat->memory_size = deltat_mem_size; -} - -/* -** Generate samples for one of the Y8950's -** -** 'which' is the virtual Y8950 number -** '*buffer' is the output buffer pointer -** 'length' is the number of samples that should be generated -*/ -void Y8950UpdateOne(int which, INT16 *buffer, int length) -{ - int i; - FM_OPL *OPL = OPL_Y8950[which]; - UINT8 rhythm = OPL->rhythm&0x20; - YM_DELTAT *DELTAT = OPL->deltat; - OPLSAMPLE *buf = buffer; - - if( (void *)OPL != cur_chip ){ - cur_chip = (void *)OPL; - /* rhythm slots */ - SLOT7_1 = &OPL->P_CH[7].SLOT[SLOT1]; - SLOT7_2 = &OPL->P_CH[7].SLOT[SLOT2]; - SLOT8_1 = &OPL->P_CH[8].SLOT[SLOT1]; - SLOT8_2 = &OPL->P_CH[8].SLOT[SLOT2]; - - } - for( i=0; i < length ; i++ ) - { - int lt; - - OPL->output[0] = 0; - OPL->output_deltat[0] = 0; - - advance_lfo(OPL); - - /* deltaT ADPCM */ - if( DELTAT->portstate&0x80 ) - YM_DELTAT_ADPCM_CALC(DELTAT); - - /* FM part */ - OPL_CALC_CH(OPL, &OPL->P_CH[0]); - OPL_CALC_CH(OPL, &OPL->P_CH[1]); - OPL_CALC_CH(OPL, &OPL->P_CH[2]); - OPL_CALC_CH(OPL, &OPL->P_CH[3]); - OPL_CALC_CH(OPL, &OPL->P_CH[4]); - OPL_CALC_CH(OPL, &OPL->P_CH[5]); - - if(!rhythm) - { - OPL_CALC_CH(OPL, &OPL->P_CH[6]); - OPL_CALC_CH(OPL, &OPL->P_CH[7]); - OPL_CALC_CH(OPL, &OPL->P_CH[8]); - } - else /* Rhythm part */ - { - OPL_CALC_RH(OPL, &OPL->P_CH[0], (OPL->noise_rng>>0)&1 ); - } - - lt = OPL->output[0] + (OPL->output_deltat[0]>>11); - - lt >>= FINAL_SH; - - /* limit check */ - lt = limit( lt , MAXOUT, MINOUT ); - - #ifdef SAVE_SAMPLE - if (which==0) - { - SAVE_ALL_CHANNELS - } - #endif - - /* store to sound buffer */ - buf[i] = lt; - - advance(OPL); - } - -} - -void Y8950SetPortHandler(int which,OPL_PORTHANDLER_W PortHandler_w,OPL_PORTHANDLER_R PortHandler_r,int param) -{ - FM_OPL *OPL = OPL_Y8950[which]; - OPL->porthandler_w = PortHandler_w; - OPL->porthandler_r = PortHandler_r; - OPL->port_param = param; -} - -void Y8950SetKeyboardHandler(int which,OPL_PORTHANDLER_W KeyboardHandler_w,OPL_PORTHANDLER_R KeyboardHandler_r,int param) -{ - FM_OPL *OPL = OPL_Y8950[which]; - OPL->keyboardhandler_w = KeyboardHandler_w; - OPL->keyboardhandler_r = KeyboardHandler_r; - OPL->keyboard_param = param; -} - -#endif - -void FMOPLScan(INT32 nType, INT32 which, INT32 nAction, INT32 *pnMin) -{ - FM_OPL *OPL = OPL_YM3812[which]; - - if (nType == FM_OPL_SAVESTATE_YM3526) { - OPL = OPL_YM3526[which]; - } - - if (nType == FM_OPL_SAVESTATE_Y8950) { - OPL = OPL_Y8950[which]; - } - - if (nAction & ACB_DRIVER_DATA) { - INT32 ch; - INT32 slot; - for (ch = 0; ch < 9; ch++) { - OPL_CH *CH = &OPL->P_CH[ch]; - - SCAN_VAR(CH->block_fnum); - SCAN_VAR(CH->kcode); - - for (slot = 0; slot < 2; slot++) { - OPL_SLOT *SLOT = &CH->SLOT[slot]; - - SCAN_VAR(SLOT->ar); - SCAN_VAR(SLOT->dr); - SCAN_VAR(SLOT->rr); - SCAN_VAR(SLOT->KSR); - SCAN_VAR(SLOT->ksl); - SCAN_VAR(SLOT->mul); - - SCAN_VAR(SLOT->Cnt); - SCAN_VAR(SLOT->FB); - SCAN_VAR(SLOT->op1_out); - SCAN_VAR(SLOT->CON); - - SCAN_VAR(SLOT->eg_type); - SCAN_VAR(SLOT->state); - SCAN_VAR(SLOT->TL); - SCAN_VAR(SLOT->volume); - SCAN_VAR(SLOT->sl); - SCAN_VAR(SLOT->key); - - SCAN_VAR(SLOT->AMmask); - SCAN_VAR(SLOT->vib); - - SCAN_VAR(SLOT->wavetable); - } - } - - SCAN_VAR(OPL->eg_cnt); - SCAN_VAR(OPL->eg_timer); - - SCAN_VAR(OPL->rhythm); - - SCAN_VAR(OPL->lfo_am_depth); - SCAN_VAR(OPL->lfo_pm_depth_range); - SCAN_VAR(OPL->lfo_am_cnt); - SCAN_VAR(OPL->lfo_pm_cnt); - - SCAN_VAR(OPL->noise_rng); - SCAN_VAR(OPL->noise_p); - - if (OPL->type & OPL_TYPE_WAVESEL) { - SCAN_VAR(OPL->wavesel); - } - - SCAN_VAR(OPL->T); - SCAN_VAR(OPL->st); - -#if BUILD_Y8950 - if ((OPL->type & OPL_TYPE_ADPCM) && (OPL->deltat)) { - SCAN_VAR(OPL->deltat->portstate); - SCAN_VAR(OPL->deltat->now_addr); - SCAN_VAR(OPL->deltat->now_step); - SCAN_VAR(OPL->deltat->acc); - SCAN_VAR(OPL->deltat->prev_acc); - SCAN_VAR(OPL->deltat->adpcmd); - SCAN_VAR(OPL->deltat->adpcml); - } - - if (OPL->type & OPL_TYPE_IO) { - SCAN_VAR(OPL->portDirection); - SCAN_VAR(OPL->portLatch); - } -#endif - - SCAN_VAR(OPL->address); - SCAN_VAR(OPL->status); - SCAN_VAR(OPL->statusmask); - SCAN_VAR(OPL->mode); - -#if BUILD_Y8950 - if ((OPL->type & OPL_TYPE_ADPCM) && (OPL->deltat)) { - YM_DELTAT *DELTAT = OPL->deltat; - SCAN_VAR(DELTAT->portstate); - SCAN_VAR(DELTAT->now_addr); - SCAN_VAR(DELTAT->now_step); - SCAN_VAR(DELTAT->acc); - SCAN_VAR(DELTAT->prev_acc); - SCAN_VAR(DELTAT->adpcmd); - SCAN_VAR(DELTAT->adpcml); - } -#endif - - if (nAction & ACB_WRITE) { - INT32 ch; - INT32 slot; - for (ch = 0; ch < 9; ch++) { - OPL_CH *CH = &OPL->P_CH[ch]; - - UINT32 block_fnum = CH->block_fnum; - CH->ksl_base = ksl_tab[block_fnum >> 6]; - CH->fc = OPL->fn_tab[block_fnum & 0x03ff] >> (7 - (block_fnum >> 10)); - - for (slot = 0; slot < 2; slot++) { - OPL_SLOT *SLOT = &CH->SLOT[slot]; - - SLOT->ksr = CH->kcode >> SLOT->KSR; - - if ((SLOT->ar + SLOT->ksr) < 16 + 62) { - SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; - SLOT->eg_sel_ar = eg_rate_select[SLOT->ar + SLOT->ksr ]; - } else { - SLOT->eg_sh_ar = 0; - SLOT->eg_sel_ar = 13*RATE_STEPS; - } - SLOT->eg_sh_dr = eg_rate_shift [SLOT->dr + SLOT->ksr ]; - SLOT->eg_sel_dr = eg_rate_select[SLOT->dr + SLOT->ksr ]; - SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr ]; - SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr ]; - - SLOT->Incr = CH->fc * SLOT->mul; - - SLOT->TLL = SLOT->TL + (CH->ksl_base >> SLOT->ksl); - - SLOT->connect1 = SLOT->CON ? &OPL->output[0] : &OPL->phase_modulation; - } - } -#if BUILD_Y8950 - if ((OPL->type & OPL_TYPE_ADPCM) && (OPL->deltat)) { - // We really should call the postlod function for the YM_DELTAT, but it's hard without registers - // (see the way the YM2610 does it) - //YM_DELTAT_postload(OPL->deltat, REGS); - } -#endif - } - } -} diff --git a/jan/src/burn/snd/fmopl.h b/jan/src/burn/snd/fmopl.h deleted file mode 100644 index 2d7d95604..000000000 --- a/jan/src/burn/snd/fmopl.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef __FMOPL_H_ -#define __FMOPL_H_ - -/* --- select emulation chips --- */ -#define BUILD_YM3812 (HAS_YM3812) -#define BUILD_YM3526 (HAS_YM3526) -#define BUILD_Y8950 (HAS_Y8950) - -/* select output bits size of output : 8 or 16 */ -#define OPL_SAMPLE_BITS 16 - -/* compiler dependence */ -#ifndef OSD_CPU_H -#define OSD_CPU_H -typedef unsigned char UINT8; /* unsigned 8bit */ -typedef unsigned short UINT16; /* unsigned 16bit */ -typedef unsigned int UINT32; /* unsigned 32bit */ -typedef signed char INT8; /* signed 8bit */ -typedef signed short INT16; /* signed 16bit */ -typedef signed int INT32; /* signed 32bit */ -#endif - -#if (OPL_SAMPLE_BITS==16) -typedef INT16 OPLSAMPLE; -#endif -#if (OPL_SAMPLE_BITS==8) -typedef INT8 OPLSAMPLE; -#endif - - -typedef void (*OPL_TIMERHANDLER)(int channel,double interval_Sec); -typedef void (*OPL_IRQHANDLER)(int param,int irq); -typedef void (*OPL_UPDATEHANDLER)(int param,int min_interval_us); -typedef void (*OPL_PORTHANDLER_W)(int param,unsigned char data); -typedef unsigned char (*OPL_PORTHANDLER_R)(int param); - - -#if BUILD_YM3812 - -int YM3812Init(int num, int clock, int rate); -void YM3812Shutdown(void); -void YM3812ResetChip(int which); -int YM3812Write(int which, int a, int v); -unsigned char YM3812Read(int which, int a); -int YM3812TimerOver(int which, int c); -void YM3812UpdateOne(int which, INT16 *buffer, int length); - -void YM3812SetTimerHandler(int which, OPL_TIMERHANDLER TimerHandler, int channelOffset); -void YM3812SetIRQHandler(int which, OPL_IRQHANDLER IRQHandler, int param); -void YM3812SetUpdateHandler(int which, OPL_UPDATEHANDLER UpdateHandler, int param); - -#endif - - -#if BUILD_YM3526 - -/* -** Initialize YM3526 emulator(s). -** -** 'num' is the number of virtual YM3526's to allocate -** 'clock' is the chip clock in Hz -** 'rate' is sampling rate -*/ -int YM3526Init(int num, int clock, int rate); -/* shutdown the YM3526 emulators*/ -void YM3526Shutdown(void); -void YM3526ResetChip(int which); -int YM3526Write(int which, int a, int v); -unsigned char YM3526Read(int which, int a); -int YM3526TimerOver(int which, int c); -/* -** Generate samples for one of the YM3526's -** -** 'which' is the virtual YM3526 number -** '*buffer' is the output buffer pointer -** 'length' is the number of samples that should be generated -*/ -void YM3526UpdateOne(int which, INT16 *buffer, int length); - -void YM3526SetTimerHandler(int which, OPL_TIMERHANDLER TimerHandler, int channelOffset); -void YM3526SetIRQHandler(int which, OPL_IRQHANDLER IRQHandler, int param); -void YM3526SetUpdateHandler(int which, OPL_UPDATEHANDLER UpdateHandler, int param); - -#endif - - -#if BUILD_Y8950 - -/* Y8950 port handlers */ -void Y8950SetPortHandler(int which, OPL_PORTHANDLER_W PortHandler_w, OPL_PORTHANDLER_R PortHandler_r, int param); -void Y8950SetKeyboardHandler(int which, OPL_PORTHANDLER_W KeyboardHandler_w, OPL_PORTHANDLER_R KeyboardHandler_r, int param); -void Y8950SetDeltaTMemory(int which, void * deltat_mem_ptr, int deltat_mem_size ); - -int Y8950Init (int num, int clock, int rate); -void Y8950Shutdown (void); -void Y8950ResetChip (int which); -int Y8950Write (int which, int a, int v); -unsigned char Y8950Read (int which, int a); -int Y8950TimerOver (int which, int c); -void Y8950UpdateOne (int which, INT16 *buffer, int length); - -void Y8950SetTimerHandler (int which, OPL_TIMERHANDLER TimerHandler, int channelOffset); -void Y8950SetIRQHandler (int which, OPL_IRQHANDLER IRQHandler, int param); -void Y8950SetUpdateHandler (int which, OPL_UPDATEHANDLER UpdateHandler, int param); - -#endif - -#define FM_OPL_SAVESTATE_YM3812 1 -#define FM_OPL_SAVESTATE_YM3526 2 -#define FM_OPL_SAVESTATE_Y8950 3 - -void FMOPLScan(INT32 nType, INT32 which, INT32 nAction, INT32 *pnMin); - -#endif /* __FMOPL_H_ */ diff --git a/jan/src/burn/snd/gaelco.cpp b/jan/src/burn/snd/gaelco.cpp deleted file mode 100644 index 589e0d152..000000000 --- a/jan/src/burn/snd/gaelco.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/*************************************************************************** - Gaelco Sound Hardware - - By Manuel Abadia - -CG-1V/GAE1 (Gaelco custom GFX & Sound chip): - The CG-1V/GAE1 can handle up to 7 stereo channels. - The chip output is connected to a TDA1543 (16 bit DAC). - -Registers per channel: -====================== - Word | Bit(s) | Description - -----+-FEDCBA98-76543210-+-------------------------- - 0 | xxxxxxxx xxxxxxxx | not used? - 1 | xxxx---- -------- | left channel volume (0x00..0x0f) - 1 | ----xxxx -------- | right channel volume (0x00..0x0f) - 1 | -------- xxxx---- | sample type (0x0c = PCM 8 bits mono, 0x08 = PCM 8 bits stereo) - 1 | -------- ----xxxx | ROM Bank - 2 | xxxxxxxx xxxxxxxx | sample end position - 3 | xxxxxxxx xxxxxxxx | remaining bytes to play - - the following are used only when looping (usually used for music) - - 4 | xxxxxxxx xxxxxxxx | not used? - 5 | xxxx---- -------- | left channel volume (0x00..0x0f) - 5 | ----xxxx -------- | right channel volume (0x00..0x0f) - 5 | -------- xxxx---- | sample type (0x0c = PCM 8 bits mono, 0x08 = PCM 8 bits stereo) - 5 | -------- ----xxxx | ROM Bank - 6 | xxxxxxxx xxxxxxxx | sample end position - 7 | xxxxxxxx xxxxxxxx | remaining bytes to play - - The samples are played from (end position + length) to (end position)! - -***************************************************************************/ - -#include "burnint.h" -#include "burn_sound.h" -#include "gaelco.h" - -#define GAELCO_NUM_CHANNELS 0x07 -#define GAELCO_VOLUME_LEVELS 0x10 - -struct gaelco_sound_channel -{ - INT32 active; // is it playing? - INT32 loop; // = 0 no looping, = 1 looping - INT32 chunkNum; // current chunk if looping -}; - -//sound_stream *m_stream; /* our stream */ -static UINT8 *m_snd_data; /* PCM data */ -static INT32 m_banks[4]; /* start of each ROM bank */ -static gaelco_sound_channel m_channel[GAELCO_NUM_CHANNELS]; /* 7 stereo channels */ -static UINT16 m_sndregs[0x38]; - -static INT32 gaelcosnd_initted = 0; - -static INT16 *sample_buffer; - -// Table for converting from 8 to 16 bits with volume control -static INT16 m_volume_table[GAELCO_VOLUME_LEVELS][256]; - -static void gaelco_set_bank_offsets(INT32 offs1, INT32 offs2, INT32 offs3, INT32 offs4) -{ - m_banks[0] = offs1; - m_banks[1] = offs2; - m_banks[2] = offs3; - m_banks[3] = offs4; -} - -/*============================================================================ - CG-1V/GAE1 Sound Update - - Writes length bytes to the sound buffer - ============================================================================*/ - -void gaelcosnd_update(INT16 *outputs, INT32 samples) -{ - INT32 samples_mod = ((((8000000 / nBurnFPS) * samples) / nBurnSoundLen)) / 10; // + 5 to round - - /* fill all data needed */ - for(INT32 j = 0; j < samples_mod; j++){ - INT32 output_l = 0, output_r = 0; - - /* for each channel */ - for (INT32 ch = 0; ch < GAELCO_NUM_CHANNELS; ch ++){ - INT32 ch_data_l = 0, ch_data_r = 0; - gaelco_sound_channel *channel = &m_channel[ch]; - - /* if the channel is playing */ - if (channel->active == 1){ - INT32 data, chunkNum = 0; - INT32 base_offset, type, bank, vol_r, vol_l, end_pos; - - /* if the channel is looping, get current chunk to play */ - if (channel->loop == 1){ - chunkNum = channel->chunkNum; - } - - base_offset = ch*8 + chunkNum*4; - - /* get channel parameters */ - type = ((m_sndregs[base_offset + 1] >> 4) & 0x0f); - bank = m_banks[((m_sndregs[base_offset + 1] >> 0) & 0x03)]; - vol_l = ((m_sndregs[base_offset + 1] >> 12) & 0x0f); - vol_r = ((m_sndregs[base_offset + 1] >> 8) & 0x0f); - end_pos = m_sndregs[base_offset + 2] << 8; - - /* generates output data (range 0x00000..0xffff) */ - if (type == 0x08){ - /* PCM, 8 bits mono */ - data = m_snd_data[bank + end_pos + m_sndregs[base_offset + 3]]; - ch_data_l = m_volume_table[vol_l][data]; - ch_data_r = m_volume_table[vol_r][data]; - - m_sndregs[base_offset + 3]--; - } else if (type == 0x0c){ - /* PCM, 8 bits stereo */ - data = m_snd_data[bank + end_pos + m_sndregs[base_offset + 3]]; - ch_data_l = m_volume_table[vol_l][data]; - - m_sndregs[base_offset + 3]--; - - if (m_sndregs[base_offset + 3] > 0){ - data = m_snd_data[bank + end_pos + m_sndregs[base_offset + 3]]; - ch_data_r = m_volume_table[vol_r][data]; - - m_sndregs[base_offset + 3]--; - } - } else { - //LOG_SOUND(("(GAE1) Playing unknown sample format in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", ch, type, bank, end_pos, m_sndregs[base_offset + 3])); - channel->active = 0; - } - - /* check if the current sample has finished playing */ - if (m_sndregs[base_offset + 3] == 0){ - if (channel->loop == 0){ /* if no looping, we're done */ - channel->active = 0; - } else { /* if we're looping, swap chunks */ - channel->chunkNum = (channel->chunkNum + 1) & 0x01; - - /* if the length of the next chunk is 0, we're done */ - if (m_sndregs[ch*8 + channel->chunkNum*4 + 3] == 0){ - channel->active = 0; - } - } - } - } - - /* add the contribution of this channel to the current data output */ - output_l = BURN_SND_CLIP(output_l + ch_data_l); - output_r = BURN_SND_CLIP(output_r + ch_data_r); - } - - sample_buffer[j*2+0] = BURN_SND_CLIP(output_l); - sample_buffer[j*2+1] = BURN_SND_CLIP(output_r); - } - - for (INT32 j = 0; j < samples; j++) - { - INT32 k = ((((8000000 / nBurnFPS) * (j & ~2)) / nBurnSoundLen)) / 10; - - outputs[0] = sample_buffer[k*2+0]; - outputs[1] = sample_buffer[k*2+1]; - outputs += 2; - } -} - -/*============================================================================ - CG-1V/GAE1 Read Handler - ============================================================================*/ - -UINT16 gaelcosnd_r(INT32 offset) -{ - //LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", machine().describe_context(), offset)); - - return m_sndregs[offset]; -} - -/*============================================================================ - CG-1V/GAE1 Write Handler - ============================================================================*/ - -void gaelcosnd_w(INT32 offset, UINT16 data) -{ - gaelco_sound_channel *channel = &m_channel[offset >> 3]; - - m_sndregs[offset] = data; - - switch(offset & 0x07){ - case 0x03: - /* trigger sound */ - if ((m_sndregs[offset - 1] != 0) && (data != 0)){ - if (!channel->active){ - channel->active = 1; - channel->chunkNum = 0; - channel->loop = 0; - //bprintf(0, _T("(GAE1) Playing sample channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n"), offset >> 3, (m_sndregs[offset - 2] >> 4) & 0x0f, m_sndregs[offset - 2] & 0x03, m_sndregs[offset - 1] << 8, data); - } - } else { - channel->active = 0; - } - - break; - - case 0x07: /* enable/disable looping */ - if ((m_sndregs[offset - 1] != 0) && (data != 0)){ - //bprintf(0, _T("(GAE1) Looping in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n"), offset >> 3, (m_sndregs[offset - 2] >> 4) & 0x0f, m_sndregs[offset - 2] & 0x03, m_sndregs[offset - 1] << 8, data); - channel->loop = 1; - } else { - channel->loop = 0; - } - - break; - } -} - -/*============================================================================ - CG-1V/GAE1 Init / Close - ============================================================================*/ - -void gaelcosnd_start(UINT8 *soundrom, INT32 offs1, INT32 offs2, INT32 offs3, INT32 offs4) -{ - m_snd_data = soundrom; - - sample_buffer = (INT16 *)BurnMalloc(((8000 / 60)+1) * 4); - gaelco_set_bank_offsets(offs1, offs2, offs3, offs4); - - /* init volume table */ - for (INT32 vol = 0; vol < GAELCO_VOLUME_LEVELS; vol++){ - for (INT32 j = -128; j <= 127; j++){ - m_volume_table[vol][(j ^ 0x80) & 0xff] = (vol*j*256)/(GAELCO_VOLUME_LEVELS - 1); - } - } - - gaelcosnd_reset(); - - gaelcosnd_initted = 1; -} - -void gaelcosnd_exit() -{ - if (!gaelcosnd_initted) return; - - BurnFree(sample_buffer); - sample_buffer = NULL; - m_snd_data = NULL; -} - -void gaelcosnd_scan() -{ - SCAN_VAR(m_channel); - SCAN_VAR(m_sndregs); -} - -void gaelcosnd_reset() -{ - memset(&m_channel, 0, sizeof(m_channel)); - memset(&m_sndregs, 0, sizeof(m_sndregs)); -} diff --git a/jan/src/burn/snd/gaelco.h b/jan/src/burn/snd/gaelco.h deleted file mode 100644 index aa333cf83..000000000 --- a/jan/src/burn/snd/gaelco.h +++ /dev/null @@ -1,8 +0,0 @@ -// gaelco sound -void gaelcosnd_update(INT16 *outputs, INT32 samples); -UINT16 gaelcosnd_r(INT32 offset); -void gaelcosnd_w(INT32 offset, UINT16 data); -void gaelcosnd_start(UINT8 *soundrom, int offs1, int offs2, int offs3, int offs4); -void gaelcosnd_exit(); -void gaelcosnd_scan(); -void gaelcosnd_reset(); diff --git a/jan/src/burn/snd/ics2115.cpp b/jan/src/burn/snd/ics2115.cpp deleted file mode 100644 index e4ec60cc7..000000000 --- a/jan/src/burn/snd/ics2115.cpp +++ /dev/null @@ -1,910 +0,0 @@ -// license:??? -// copyright-holders:Alex Marshall,nimitz,austere -//ICS2115 by Raiden II team (c) 2010 -//members: austere, nimitz, Alex Marshal -// -//Original driver by O. Galibert, ElSemi -// -//Use tab size = 4 for your viewing pleasure. - -//Ported from MAME git, 13/07/2015 - -#include "burnint.h" -#include - -static UINT8 *m_rom = NULL; // ics2115 rom -static INT32 m_rom_len; -static void (*m_irq_cb)(INT32) = NULL; // cpu irq callback -static INT32 sound_cpu_clock = 0; -static INT16 *stream = NULL; - -INT32 ICS2115_ddp2beestormmode = 0; // hack to fix volume fadeouts in ddp2 bee storm - -struct ics2115_voice { - struct { - INT32 left; - UINT32 acc, start, end; - UINT16 fc; - UINT8 ctl, saddr; - } osc; - - struct { - INT32 left; - UINT32 add; - UINT32 start, end; - UINT32 acc; - UINT16 regacc; - UINT8 incr; - UINT8 pan, mode; - } vol; - - union { - struct { - UINT8 ulaw : 1; - UINT8 stop : 1; //stops wave + vol envelope - UINT8 eightbit : 1; - UINT8 loop : 1; - UINT8 loop_bidir : 1; - UINT8 irq : 1; - UINT8 invert : 1; - UINT8 irq_pending: 1; - //IRQ on variable? - } bitflags; - UINT8 value; - } osc_conf; - - union { - struct { - UINT8 done : 1; //indicates ramp has stopped - UINT8 stop : 1; //stops the ramp - UINT8 rollover : 1; //rollover (TODO) - UINT8 loop : 1; - UINT8 loop_bidir : 1; - UINT8 irq : 1; //enable IRQ generation - UINT8 invert : 1; //invert direction - UINT8 irq_pending: 1; //(read only) IRQ pending - //noenvelope == (done | disable) - } bitflags; - UINT8 value; - } vol_ctrl; - - //Possibly redundant state. => improvements of wavetable logic - //may lead to its elimination. - union { - struct { - UINT8 on : 1; - UINT8 ramp : 7; // 100 0000 = 0x40 maximum - } bitflags; - UINT8 value; - } state; - - bool playing(); - int update_volume_envelope(); - int update_oscillator(); - void update_ramp(); -}; - -static const UINT16 revision = 0x1; - -static INT16 m_ulaw[256]; -static UINT16 m_volume[4096]; -static const int volume_bits = 15; - -static ics2115_voice m_voice[32]; -struct timer_struct { - UINT8 scale, preset; - INT32 timer_enable; - INT32 cycles_left; - INT32 cycles_total; - void (*timer_cb)(INT32); - UINT64 period; /* in nsec */ -}; -static timer_struct m_timer[2]; - -static UINT8 m_active_osc; -static UINT8 m_osc_select; -static UINT8 m_reg_select; -static UINT8 m_irq_enabled, m_irq_pending; -static bool m_irq_on; -static UINT8 m_vmode; - -//internal register helper functions -void ics2115_recalc_timer(int timer); -void ics2115_keyon(); -void ics2115_recalc_irq(); -void ics2115_timer_cb_0(INT32 param); -void ics2115_timer_cb_1(INT32 param); - - -void ics2115_init(INT32 cpu_clock, void (*cpu_irq_cb)(INT32), UINT8 *sample_rom, INT32 sample_rom_size) -{ - DebugSnd_ICS2115Initted = 1; - - m_timer[0].timer_cb = ics2115_timer_cb_0; - m_timer[1].timer_cb = ics2115_timer_cb_1; - - m_irq_cb = cpu_irq_cb; - m_rom = sample_rom; - m_rom_len = sample_rom_size; - sound_cpu_clock = cpu_clock; - - for (int i = 0; i<4096; i++) { - m_volume[i] = ((0x100 | (i & 0xff)) << (volume_bits-9)) >> (15 - (i>>8)); - } - - //u-Law table as per MIL-STD-188-113 - UINT16 lut[8]; - UINT16 lut_initial = 33 << 2; //shift up 2-bits for 16-bit range. - for(int i = 0; i < 8; i++) - lut[i] = (lut_initial << i) - lut_initial; - for(int i = 0; i < 256; i++) { - UINT8 exponent = (~i >> 4) & 0x07; - UINT8 mantissa = ~i & 0x0f; - INT16 value = lut[exponent] + (mantissa << (exponent + 3)); - m_ulaw[i] = (i & 0x80) ? -value : value; - } -} - -void ics2115_exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_ICS2115Initted) bprintf(PRINT_ERROR, _T("ics2115_exit called without init\n")); -#endif - - if (!DebugSnd_ICS2115Initted) return; - - if (stream) { - BurnFree(stream); - stream = NULL; - } - - m_rom = NULL; - m_rom_len = 0; - m_irq_cb= NULL; - sound_cpu_clock = 0; - ICS2115_ddp2beestormmode = 0; - - DebugSnd_ICS2115Initted = 0; -} - -void ics2115_reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_ICS2115Initted) bprintf(PRINT_ERROR, _T("ics2115_reset called without init\n")); -#endif - - m_irq_enabled = 0; - m_irq_pending = 0; - //possible re-suss - m_active_osc = 31; - m_osc_select = 0; - m_reg_select = 0; - m_vmode = 0; - m_irq_on = false; - memset(m_voice, 0, sizeof(m_voice)); - for(int i = 0; i < 2; ++i) - { - m_timer[i].timer_enable = 0; - m_timer[i].cycles_left = 0; - m_timer[i].cycles_total = 0; - m_timer[i].period = 0; - m_timer[i].scale = 0; - m_timer[i].preset = 0; - } - for(int i = 0; i < 32; i++) { - m_voice[i].osc_conf.value = 2; - m_voice[i].osc.fc = 0; - m_voice[i].osc.acc = 0; - m_voice[i].osc.start = 0; - m_voice[i].osc.end = 0; - m_voice[i].osc.ctl = 0; - m_voice[i].osc.saddr = 0; - m_voice[i].vol.acc = 0; - m_voice[i].vol.incr = 0; - m_voice[i].vol.start = 0; - m_voice[i].vol.end = 0; - m_voice[i].vol.pan = 0x7F; - m_voice[i].vol_ctrl.value = 1; - m_voice[i].vol.mode = 0; - m_voice[i].state.value = 0; - } -} - -//TODO: improve using next-state logic from column 126 of patent 5809466 -int ics2115_voice::update_volume_envelope() -{ - int ret = 0; - - if(vol_ctrl.bitflags.done || vol_ctrl.bitflags.stop) - return ret; - - if(vol_ctrl.bitflags.invert) { - vol.acc -= vol.add; - vol.left = vol.acc - vol.start; - } else { - vol.acc += vol.add; - vol.left = vol.end - vol.acc; - } - - if(vol.left > 0) - return ret; - - if(vol_ctrl.bitflags.irq) { - vol_ctrl.bitflags.irq_pending = true; - ret = 1; - } - - if(osc_conf.bitflags.eightbit) - return ret; - - if(vol_ctrl.bitflags.loop) { - if(vol_ctrl.bitflags.loop_bidir) - vol_ctrl.bitflags.invert = !vol_ctrl.bitflags.invert; - - if(vol_ctrl.bitflags.invert) - vol.acc = vol.end + vol.left; - else - vol.acc = vol.start - vol.left; - } else { - state.bitflags.on = false; - vol_ctrl.bitflags.done = true; - if(vol_ctrl.bitflags.invert) - vol.acc = vol.end; - else - vol.acc = vol.start; - } - - return ret; -} - -int ics2115_voice::update_oscillator() -{ - int ret = 0; - if(osc_conf.bitflags.stop) - return ret; - if(osc_conf.bitflags.invert) { - osc.acc -= osc.fc << 2; - osc.left = osc.acc - osc.start; - } else { - osc.acc += osc.fc << 2; - osc.left = osc.end - osc.acc; - } - // > instead of >= to stop crackling? - if(osc.left > 0) - return ret; - if(osc_conf.bitflags.irq) { - osc_conf.bitflags.irq_pending = true; - ret = 1; - } - if(osc_conf.bitflags.loop) { - if(osc_conf.bitflags.loop_bidir) - osc_conf.bitflags.invert = !osc_conf.bitflags.invert; - - if(osc_conf.bitflags.invert) { - osc.acc = osc.end + osc.left; - osc.left = osc.acc - osc.start; - } - else { - osc.acc = osc.start - osc.left; - osc.left = osc.end - osc.acc; - } - } else { - state.bitflags.on = false; - osc_conf.bitflags.stop = true; - if(!osc_conf.bitflags.invert) - osc.acc = osc.end; - else - osc.acc = osc.start; - } - return ret; -} - -static INT32 get_sample(ics2115_voice& voice) -{ - UINT32 curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12); - UINT32 nextaddr; - - if (voice.state.bitflags.on && voice.osc_conf.bitflags.loop && !voice.osc_conf.bitflags.loop_bidir && - (voice.osc.left < (voice.osc.fc <<2))) { - nextaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.start >> 12); - } - else - nextaddr = curaddr + 2; - - - INT16 sample1, sample2; - if (voice.osc_conf.bitflags.eightbit) { - sample1 = ((INT8)m_rom[curaddr]) << 8; - sample2 = ((INT8)m_rom[curaddr + 1]) << 8; - } - else { - sample1 = m_rom[curaddr + 0] | (((INT8)m_rom[curaddr + 1]) << 8); - sample2 = m_rom[nextaddr+ 0] | (((INT8)m_rom[nextaddr+ 1]) << 8); - //sample2 = m_rom[curaddr + 2] | (((INT8)m_rom[curaddr + 3]) << 8); - } - - INT32 sample, diff; - UINT16 fract; - diff = sample2 - sample1; - fract = (voice.osc.acc >> 3) & 0x1ff; - - sample = (((INT32)sample1 << 9) + diff * fract) >> 9; - - return sample; -} - -bool ics2115_voice::playing() -{ - return state.bitflags.on && !((vol_ctrl.bitflags.done || vol_ctrl.bitflags.stop) && osc_conf.bitflags.stop); -} - -void ics2115_voice::update_ramp() { - //slow attack - if (state.bitflags.on && !osc_conf.bitflags.stop) { - if (state.bitflags.ramp < 0x40) - state.bitflags.ramp += 0x1; - else - state.bitflags.ramp = 0x40; - } - //slow release - else { - if (state.bitflags.ramp) - state.bitflags.ramp -= 0x1; - } -} - -static int ics2115_fill_output(ics2115_voice& voice, INT16 *outputs, int samples) -{ - bool irq_invalid = false; - UINT16 fine = 1 << (3*(voice.vol.incr >> 6)); - voice.vol.add = (voice.vol.incr & 0x3F)<< (10 - fine); - - for (int i = 0; i < samples; i++) { - UINT32 volacc = (voice.vol.acc >> 10) & 0xffff; - UINT32 volume = (m_volume[volacc >> 4] * voice.state.bitflags.ramp) >> 6; - UINT16 vleft = volume; //* (255 - voice.vol.pan) / 0x80]; - UINT16 vright = volume; //* (voice.vol.pan + 1) / 0x80]; - - INT32 sample; - if(voice.osc_conf.bitflags.ulaw) { - UINT32 curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12); - sample = m_ulaw[m_rom[curaddr]]; - } - else - sample = get_sample(voice); - - if (!m_vmode || voice.playing()) { - outputs[0] = BURN_SND_CLIP((INT32)(outputs[0] + (((sample * vleft) >> (5 + volume_bits - 16)) >> 16))); - outputs[1] = BURN_SND_CLIP((INT32)(outputs[1] + (((sample * vright) >> (5 + volume_bits - 16)) >> 16))); - outputs += 2; - } - - voice.update_ramp(); - if (voice.playing()) { - if (voice.update_oscillator()) - irq_invalid = true; - if (ICS2115_ddp2beestormmode == 0) { - if (voice.update_volume_envelope()) - irq_invalid = true; - } - } - } - return irq_invalid; -} - -void ics2115_update(INT16 *outputs, int samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ICS2115Initted) bprintf(PRINT_ERROR, _T("ics2115_update called without init\n")); -#endif - - INT32 sample_per_frame = (33075 * 100) / nBurnFPS; - - if (stream == NULL) { - stream = (INT16*)BurnMalloc(sample_per_frame * 4); // * 4 -> (16 bits, 2 channels) - } - -// memset(outputs, 0, samples * sizeof(INT16) * 2); - memset(stream, 0, sample_per_frame * 4); - - bool irq_invalid = false; - for(int osc = 0; osc <= m_active_osc; osc++) { - ics2115_voice& voice = m_voice[osc]; - - if(ics2115_fill_output(voice, stream, (33075 * 100) / nBurnFPS)) - irq_invalid = true; - } - - //rescale - for (int i = 0; i < samples; i++) { - - INT32 offset = ((i * sample_per_frame) / nBurnSoundLen) * 2; - outputs[0] = (INT32)(stream[offset+0] * 5); // volume for pgm is 5.0 - outputs[1] = (INT32)(stream[offset+1] * 5); - outputs += 2; - } - - if(irq_invalid) - ics2115_recalc_irq(); - -} - -static UINT16 ics2115_reg_read() { - UINT16 ret; - ics2115_voice& voice = m_voice[m_osc_select]; - - switch(m_reg_select) { - case 0x00: // [osc] Oscillator Configuration - ret = voice.osc_conf.value; - ret <<= 8; - break; - - case 0x01: // [osc] Wavesample frequency - ret = voice.osc.fc; - break; - - case 0x02: // [osc] Wavesample loop start high - //TODO: are these returns valid? might be 0x00ff for this one... - ret = (voice.osc.start >> 16) & 0xffff; - break; - - case 0x03: // [osc] Wavesample loop start low - ret = (voice.osc.start >> 0) & 0xff00; - break; - - case 0x04: // [osc] Wavesample loop end high - ret = (voice.osc.end >> 16) & 0xffff; - break; - - case 0x05: // [osc] Wavesample loop end low - ret = (voice.osc.end >> 0) & 0xff00; - break; - - case 0x06: // [osc] Volume Increment - ret = voice.vol.incr; - break; - - case 0x07: // [osc] Volume Start - ret = voice.vol.start >> (10+8); - break; - - case 0x08: // [osc] Volume End - ret = voice.vol.end >> (10+8); - break; - - case 0x09: // [osc] Volume accumulator - //ret = v->Vol.Acc; - ret = voice.vol.acc >> (10); - break; - - case 0x0A: // [osc] Wavesample address - ret = (voice.osc.acc >> 16) & 0xffff; - break; - - case 0x0B: // [osc] Wavesample address - ret = (voice.osc.acc >> 0) & 0xfff8; - break; - - - case 0x0C: // [osc] Pan - ret = voice.vol.pan << 8; - break; - - case 0x0D: // [osc] Volume Envelope Control - if (!m_vmode) - ret = voice.vol_ctrl.bitflags.irq ? 0x81 : 0x01; - else - ret = 0x01; - ret <<= 8; - break; - - case 0x0E: // Active Voices - ret = m_active_osc; - break; - - case 0x0F:{// [osc] Interrupt source/oscillator - ret = 0xff; - for (int i = 0; i <= m_active_osc; i++) { - ics2115_voice& v = m_voice[i]; - if (v.osc_conf.bitflags.irq_pending || v.vol_ctrl.bitflags.irq_pending) { - ret = i | 0xe0; - ret &= v.vol_ctrl.bitflags.irq_pending ? (~0x40) : 0xff; - ret &= v.osc_conf.bitflags.irq_pending ? (~0x80) : 0xff; - ics2115_recalc_irq(); - if (v.osc_conf.bitflags.irq_pending) { - v.osc_conf.bitflags.irq_pending = 0; - ret &= ~0x80; - } - if (v.vol_ctrl.bitflags.irq_pending) { - v.vol_ctrl.bitflags.irq_pending = 0; - ret &= ~0x40; - } - break; - } - } - ret <<= 8; - break;} - - case 0x10: // [osc] Oscillator Control - ret = voice.osc.ctl << 8; - break; - - case 0x11: // [osc] Wavesample static address 27-20 - ret = voice.osc.saddr << 8; - break; - - case 0x40: // Timer 0 clear irq - case 0x41: // Timer 1 clear irq - //TODO: examine this suspect code - ret = m_timer[m_reg_select & 0x1].preset; - m_irq_pending &= ~(1 << (m_reg_select & 0x1)); - ics2115_recalc_irq(); - break; - - case 0x43: // Timer status - ret = m_irq_pending & 3; - break; - - case 0x4A: // IRQ Pending - ret = m_irq_pending; - break; - - case 0x4B: // Address of Interrupting Oscillator - ret = 0x80; - break; - - case 0x4C: // Chip Revision - ret = revision; - break; - - default: - ret = 0; - break; - } - return ret; -} - -static void ics2115_reg_write(UINT8 data, bool msb) { - ics2115_voice& voice = m_voice[m_osc_select]; - - switch(m_reg_select) { - case 0x00: // [osc] Oscillator Configuration - if(msb) { - voice.osc_conf.value &= 0x80; - voice.osc_conf.value |= data & 0x7f; - } - break; - - case 0x01: // [osc] Wavesample frequency - // freq = fc*33075/1024 in 32 voices mode, fc*44100/1024 in 24 voices mode - if(msb) - voice.osc.fc = (voice.osc.fc & 0x00ff) | (data << 8); - else - //last bit not used! - voice.osc.fc = (voice.osc.fc & 0xff00) | (data & 0xfe); - break; - - case 0x02: // [osc] Wavesample loop start high - if(msb) - voice.osc.start = (voice.osc.start & 0x00ffffff) | (data << 24); - else - voice.osc.start = (voice.osc.start & 0xff00ffff) | (data << 16); - break; - - case 0x03: // [osc] Wavesample loop start low - if(msb) - voice.osc.start = (voice.osc.start & 0xffff00ff) | (data << 8); - // This is unused? - //else - //voice.osc.start = (voice.osc.start & 0xffffff00) | (data & 0); - break; - - case 0x04: // [osc] Wavesample loop end high - if(msb) - voice.osc.end = (voice.osc.end & 0x00ffffff) | (data << 24); - else - voice.osc.end = (voice.osc.end & 0xff00ffff) | (data << 16); - break; - - case 0x05: // [osc] Wavesample loop end low - if(msb) - voice.osc.end = (voice.osc.end & 0xffff00ff) | (data << 8); - // lsb is unused? - break; - - case 0x06: // [osc] Volume Increment - if(msb) - voice.vol.incr = data; - break; - - case 0x07: // [osc] Volume Start - if (!msb) - voice.vol.start = data << (10+8); - break; - - case 0x08: // [osc] Volume End - if (!msb) - voice.vol.end = data << (10+8); - break; - - case 0x09: // [osc] Volume accumulator - if(msb) - voice.vol.regacc = (voice.vol.regacc & 0x00ff) | (data << 8); - else - voice.vol.regacc = (voice.vol.regacc & 0xff00) | data; - voice.vol.acc = voice.vol.regacc << 10; - break; - - case 0x0A: // [osc] Wavesample address high - if(msb) - voice.osc.acc = (voice.osc.acc & 0x00ffffff) | (data << 24); - else - voice.osc.acc = (voice.osc.acc & 0xff00ffff) | (data << 16); - break; - - case 0x0B: // [osc] Wavesample address low - if(msb) - voice.osc.acc = (voice.osc.acc & 0xffff00ff) | (data << 8); - else - voice.osc.acc = (voice.osc.acc & 0xffffff00) | (data & 0xF8); - break; - - case 0x0C: // [osc] Pan - if(msb) - voice.vol.pan = data; - break; - - case 0x0D: // [osc] Volume Envelope Control - if(msb) { - voice.vol_ctrl.value &= 0x80; - voice.vol_ctrl.value |= data & 0x7F; - } - break; - - case 0x0E: // Active Voices - //Does this value get added to 1? Not sure. Could trace for writes of 32. - if(msb) { - m_active_osc = data & 0x1F; // & 0x1F ? (Guessing) - } - break; - //2X8 ? - case 0x10: // [osc] Oscillator Control - //Could this be 2X9? - //[7 R | 6 M2 | 5 M1 | 4-2 Reserve | 1 - Timer 2 Strt | 0 - Timer 1 Strt] - - if (msb) { - voice.osc.ctl = data; - if (!data) - ics2115_keyon(); - //guessing here - else if(data == 0xf) { - if (!m_vmode) { - voice.osc_conf.bitflags.stop = true; - voice.vol_ctrl.bitflags.stop = true; - //try to key it off as well! - voice.state.bitflags.on = false; - } - } - } - break; - - case 0x11: // [osc] Wavesample static address 27-20 - if(msb) - //v->Osc.SAddr = data; - voice.osc.saddr = data; - break; - case 0x12: - //Could be per voice! -- investigate. - if (msb) - m_vmode = data; - break; - case 0x40: // Timer 1 Preset - case 0x41: // Timer 2 Preset - if(!msb) { - m_timer[m_reg_select & 0x1].preset = data; - ics2115_recalc_timer(m_reg_select & 0x1); - } - break; - - case 0x42: // Timer 1 Prescale - case 0x43: // Timer 2 Prescale - if(!msb) { - m_timer[m_reg_select & 0x1].scale = data; - ics2115_recalc_timer(m_reg_select & 0x1); - } - break; - - case 0x4A: // IRQ Enable - if(!msb) { - m_irq_enabled = data; - ics2115_recalc_irq(); - } - break; - - case 0x4F: // Oscillator Address being Programmed - if(!msb) { - m_osc_select = data % (1+m_active_osc); - } - break; - default: - break; - } -} - -UINT8 ics2115read(UINT8 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ICS2115Initted) bprintf(PRINT_ERROR, _T("ics2115read called without init\n")); -#endif - - UINT8 ret = 0; - - switch(offset & 3) { - case 0: - //TODO: check this suspect code - if (m_irq_on) { - ret |= 0x80; - if (m_irq_enabled && (m_irq_pending & 3)) - ret |= 1; - for (int i = 0; i <= m_active_osc; i++) { - if (m_voice[i].osc_conf.bitflags.irq_pending) { - ret |= 2; - break; - } - } - } - - break; - case 1: - ret = m_reg_select; - break; - case 2: - ret = (UINT8)(ics2115_reg_read()); - break; - case 3: - ret = ics2115_reg_read() >> 8; - break; - default: - break; - } - return ret; -} - -void ics2115write(UINT8 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ICS2115Initted) bprintf(PRINT_ERROR, _T("ics2115write called without init\n")); -#endif - - switch(offset & 3) { - case 1: - m_reg_select = data; - break; - case 2: - ics2115_reg_write(data,0); - break; - case 3: - ics2115_reg_write(data,1); - break; - default: - break; - } -} - -void ics2115_keyon() -{ - //set initial condition (may need to invert?) -- does NOT work since these are set to zero even - m_voice[m_osc_select].state.bitflags.on = true; - //no ramp up... - m_voice[m_osc_select].state.bitflags.ramp = 0x40; -} - -void ics2115_recalc_irq() -{ - //Suspect - bool irq = (m_irq_pending & m_irq_enabled); - for(int i = 0; (!irq) && (i < 32); i++) - irq |= m_voice[i].vol_ctrl.bitflags.irq_pending && m_voice[i].osc_conf.bitflags.irq_pending; - m_irq_on = irq; - if(m_irq_cb) - m_irq_cb(irq ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE); -} - -void ics2115_timer_cb_0(INT32 /*param*/) -{ - m_irq_pending |= 1 << 0; - ics2115_recalc_irq(); -} - -void ics2115_timer_cb_1(INT32 /*param*/) -{ - m_irq_pending |= 1 << 1; - ics2115_recalc_irq(); -} - -void ics2115_recalc_timer(int timer) -{ - UINT64 period = ((m_timer[timer].scale & 0x1f) + 1) * (m_timer[timer].preset + 1); - period = (period << (4 + (m_timer[timer].scale >> 5)))*78125/2646; - - if(m_timer[timer].period != period) { - m_timer[timer].period = period; - - if(period) // Reset the length - { - m_timer[timer].timer_enable = 1; - - float cycles_until_irq = sound_cpu_clock * ((period * 1.0000) / 1000000000.0000); - - m_timer[timer].cycles_left = (INT32)cycles_until_irq; - m_timer[timer].cycles_total = m_timer[timer].cycles_left; - - // m_timer[timer].timer->adjust(attotime::from_nsec(period), 0, attotime::from_nsec(period)); - } - else // Kill the timer if length == 0 - m_timer[timer].timer_enable = 0; //timer->adjust(attotime::never); - } -} - -// add-on function to deal with timer. -void ics2115_adjust_timer(INT32 ticks) -{ - for (INT32 i = 0; i < 2; i++) { - if (m_timer[i].timer_enable) { - m_timer[i].cycles_left -= ticks; - if (m_timer[i].cycles_left <= 0) { - m_timer[i].timer_cb(0); - m_timer[i].cycles_left = m_timer[i].cycles_total; - } - } - } -} - - -void ics2115_scan(INT32 nAction,INT32 * /*pnMin*/) -{ -#if defined FBA_DEBUG - if (!DebugSnd_ICS2115Initted) bprintf(PRINT_ERROR, _T("ics2115_scan called without init\n")); -#endif - - if ( nAction & ACB_DRIVER_DATA ) { - - SCAN_VAR(m_irq_enabled); - SCAN_VAR(m_irq_pending); - SCAN_VAR(m_active_osc); - SCAN_VAR(m_osc_select); - SCAN_VAR(m_reg_select); - SCAN_VAR(m_vmode); - SCAN_VAR(m_irq_on); - - SCAN_VAR(m_voice); - - for(int i = 0; i < 2; ++i) - { - SCAN_VAR(m_timer[i].timer_enable); - SCAN_VAR(m_timer[i].cycles_left); - SCAN_VAR(m_timer[i].cycles_total); - SCAN_VAR(m_timer[i].period); - SCAN_VAR(m_timer[i].scale); - SCAN_VAR(m_timer[i].preset); - } - - for(int i = 0; i < 32; i++) { - SCAN_VAR(m_voice[i].osc_conf.value); - SCAN_VAR(m_voice[i].osc.fc); - SCAN_VAR(m_voice[i].osc.acc); - SCAN_VAR(m_voice[i].osc.start); - SCAN_VAR(m_voice[i].osc.end); - SCAN_VAR(m_voice[i].osc.ctl); - SCAN_VAR(m_voice[i].osc.saddr); - SCAN_VAR(m_voice[i].vol.acc); - SCAN_VAR(m_voice[i].vol.incr); - SCAN_VAR(m_voice[i].vol.start); - SCAN_VAR(m_voice[i].vol.end); - SCAN_VAR(m_voice[i].vol.pan); - SCAN_VAR(m_voice[i].vol_ctrl.value); - SCAN_VAR(m_voice[i].vol.mode); - SCAN_VAR(m_voice[i].state.value); - } - } -} diff --git a/jan/src/burn/snd/ics2115.h b/jan/src/burn/snd/ics2115.h deleted file mode 100644 index 2c20950be..000000000 --- a/jan/src/burn/snd/ics2115.h +++ /dev/null @@ -1,10 +0,0 @@ -void ics2115_init(INT32 cpu_clock, void (*cpu_irq_cb)(INT32), UINT8 *sample_rom, INT32 sample_rom_size); -void ics2115_reset(); -UINT8 ics2115read(UINT8 offset); -void ics2115write(UINT8 offset, UINT8 data); -void ics2115_adjust_timer(INT32 ticks); -void ics2115_update(INT16 *outputs, int samples); -void ics2115_exit(); -void ics2115_scan(INT32 nAction,INT32 * /*pnMin*/); - -extern INT32 ICS2115_ddp2beestormmode; // hack to fix volume fadeouts in ddp2 bee storm diff --git a/jan/src/burn/snd/iremga20.cpp b/jan/src/burn/snd/iremga20.cpp deleted file mode 100644 index ffbfd6a69..000000000 --- a/jan/src/burn/snd/iremga20.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/********************************************************* - -Irem GA20 PCM Sound Chip - -Based on MAME sources by Acho A. Tang,R. Belmont - -It's not currently known whether this chip is stereo. - - -Revisions: - -04-15-2002 Acho A. Tang -- rewrote channel mixing -- added prelimenary volume and sample rate emulation - -05-30-2002 Acho A. Tang -- applied hyperbolic gain control to volume and used - a musical-note style progression in sample rate - calculation(still very inaccurate) - -02-18-2004 R. Belmont -- sample rate calculation reverse-engineered. - Thanks to Fujix, Yasuhiro Ogawa, the Guru, and Tormod - for real PCB samples that made this possible. - -02-03-2007 R. Belmont -- Cleaned up faux x86 assembly. - -*********************************************************/ - -#include "burnint.h" -#include "iremga20.h" - -#define MAX_GA20 1 -#define MAX_VOL 256 - -struct IremGA20_channel_def -{ - UINT32 rate; - UINT32 size; - UINT32 start; - UINT32 pos; - UINT32 frac; - UINT32 end; - UINT32 volume; - UINT32 pan; - UINT32 effect; - UINT32 play; -}; - -typedef struct _ga20_state ga20_state; -struct _ga20_state -{ - UINT8 *rom; - INT32 rom_size; - UINT16 regs[0x40]; - struct IremGA20_channel_def channel[4]; - INT32 frequency; - double gain; - INT32 output_dir; -}; - -static struct _ga20_state chips[MAX_GA20]; -static struct _ga20_state *chip; - -static UINT32 computed_steps; - -// 14318180/4 -> 3579545/4 -> 894886/60 -> 14915 -// 44100 / 60 -> 735 - -static INT32 nNumChips; - -void iremga20_update(INT32 device, INT16 *buffer, INT32 length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_IremGA20Initted) bprintf(PRINT_ERROR, _T("iremga20_update called without init\n")); - if (device > nNumChips) bprintf(PRINT_ERROR, _T("iremga20_update called with invalid chip %x\n"), device); -#endif - - chip = &chips[device]; - UINT32 rate[4], pos[4], frac[4], end[4], vol[4], play[4]; - UINT8 *pSamples; - INT32 i, sampleout; - - /* precache some values */ - for (i=0; i < 4; i++) - { - rate[i] = chip->channel[i].rate; - pos[i] = chip->channel[i].pos; - frac[i] = chip->channel[i].frac; - end[i] = chip->channel[i].end - 0x20; - vol[i] = chip->channel[i].volume; - play[i] = chip->channel[i].play; - } - - pSamples = chip->rom; - - for (i = 0; i < length; i++, buffer+=2) - { - sampleout = 0; - - // update the 4 channels inline - if (play[0]) - { - sampleout += (pSamples[pos[0]] - 0x80) * vol[0]; - frac[0] += rate[0] * computed_steps; - pos[0] += frac[0] >> 24; - frac[0] &= 0xffffff; - play[0] = (pos[0] < end[0]); - } - if (play[1]) - { - sampleout += (pSamples[pos[1]] - 0x80) * vol[1]; - frac[1] += rate[1] * computed_steps; - pos[1] += frac[1] >> 24; - frac[1] &= 0xffffff; - play[1] = (pos[1] < end[1]); - } - if (play[2]) - { - sampleout += (pSamples[pos[2]] - 0x80) * vol[2]; - frac[2] += rate[2] * computed_steps; - pos[2] += frac[2] >> 24; - frac[2] &= 0xffffff; - play[2] = (pos[2] < end[2]); - } - if (play[3]) - { - sampleout += (pSamples[pos[3]] - 0x80) * vol[3]; - frac[3] += rate[3] * computed_steps; - pos[3] += frac[3] >> 24; - frac[3] &= 0xffffff; - play[3] = (pos[3] < end[3]); - } - - sampleout >>= 2; - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((chip->output_dir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(sampleout * chip->gain); - } - if ((chip->output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(sampleout * chip->gain); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - buffer[0] = BURN_SND_CLIP(buffer[0] + nLeftSample); - buffer[1] = BURN_SND_CLIP(buffer[1] + nRightSample); - } - - /* update the regs now */ - for (i=0; i < 4; i++) - { - chip->channel[i].pos = pos[i]; - chip->channel[i].frac = frac[i]; - chip->channel[i].play = play[i]; - } -} - -void iremga20_write(INT32 device, INT32 offset, INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_IremGA20Initted) bprintf(PRINT_ERROR, _T("iremga20_write called without init\n")); - if (device > nNumChips) bprintf(PRINT_ERROR, _T("iremga20_write called with invalid chip %x\n"), device); -#endif - - chip = &chips[device]; - - INT32 channel = offset >> 3; - - chip->regs[offset] = data; - - switch (offset & 0x7) - { - case 0: /* start address low */ - chip->channel[channel].start = ((chip->channel[channel].start)&0xff000) | (data<<4); - break; - - case 1: /* start address high */ - chip->channel[channel].start = ((chip->channel[channel].start)&0x00ff0) | (data<<12); - break; - - case 2: /* end address low */ - chip->channel[channel].end = ((chip->channel[channel].end)&0xff000) | (data<<4); - break; - - case 3: /* end address high */ - chip->channel[channel].end = ((chip->channel[channel].end)&0x00ff0) | (data<<12); - break; - - case 4: - chip->channel[channel].rate = 0x1000000 / (256 - data); - break; - - case 5: //AT: gain control - chip->channel[channel].volume = (data * MAX_VOL) / (data + 10); - break; - - case 6: //AT: this is always written 2(enabling both channels?) - chip->channel[channel].play = data; - chip->channel[channel].pos = chip->channel[channel].start; - chip->channel[channel].frac = 0; - break; - } -} - -UINT8 iremga20_read(INT32 device, INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_IremGA20Initted) bprintf(PRINT_ERROR, _T("iremga20_read called without init\n")); - if (device > nNumChips) bprintf(PRINT_ERROR, _T("iremga20_read called with invalid chip %x\n"), device); -#endif - - chip = &chips[device]; - - switch (offset & 0x7) - { - case 7: // voice status. bit 0 is 1 if active. (routine around 0xccc in rtypeleo) - return chip->channel[offset >> 3].play ? 1 : 0; - - default: - break; - } - - return 0; -} - -void iremga20_reset(INT32 device) -{ -#if defined FBA_DEBUG - if (!DebugSnd_IremGA20Initted) bprintf(PRINT_ERROR, _T("iremga20_reset called without init\n")); - if (device > nNumChips) bprintf(PRINT_ERROR, _T("iremga20_reset called with invalid chip %x\n"), device); -#endif - - chip = &chips[device]; - - for(INT32 i = 0; i < 4; i++ ) { - chip->channel[i].rate = 0; - chip->channel[i].size = 0; - chip->channel[i].start = 0; - chip->channel[i].pos = 0; - chip->channel[i].frac = 0; - chip->channel[i].end = 0; - chip->channel[i].volume = 0; - chip->channel[i].pan = 0; - chip->channel[i].effect = 0; - chip->channel[i].play = 0; - } - - for ( INT32 i = 0; i < 0x40; i++ ) - chip->regs[i] = 0; -} - -void iremga20_init(INT32 device, UINT8 *rom, INT32 rom_size, INT32 frequency) -{ - DebugSnd_IremGA20Initted = 1; - - chip = &chips[device]; - - /* Initialize our chip structure */ - chip->rom = rom; - chip->rom_size = rom_size; - chip->frequency = (frequency / 4) / 60; - - chip->gain = 1.00; - chip->output_dir = BURN_SND_ROUTE_BOTH; - - iremga20_reset(device); - - computed_steps = (UINT32)((float)(chip->frequency / (1.00000 * nBurnSoundLen))); - - nNumChips = device; -} - -void itemga20_set_route(INT32 device, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_IremGA20Initted) bprintf(PRINT_ERROR, _T("itemga20_set_route called without init\n")); - if (device > nNumChips) bprintf(PRINT_ERROR, _T("itemga20_set_route called with invalid chip %x\n"), device); -#endif - - chip = &chips[device]; - - chip->gain = nVolume; - chip->output_dir = nRouteDir; -} - -void iremga20_exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_IremGA20Initted) bprintf(PRINT_ERROR, _T("iremga20_exit called without init\n")); -#endif - - DebugSnd_IremGA20Initted = 0; - nNumChips = 0; -} - -INT32 iremga20_scan(INT32 device, INT32 nAction, INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_IremGA20Initted) bprintf(PRINT_ERROR, _T("iremga20_scan called without init\n")); - if (device > nNumChips) bprintf(PRINT_ERROR, _T("iremga20_scan called with invalid chip %x\n"), device); -#endif - - if (pnMin != NULL) { - *pnMin = 0x029678; - } - - chip = &chips[device]; - - if ((nAction & ACB_DRIVER_DATA)) { - SCAN_VAR(chip->channel); - SCAN_VAR(chip->regs); - SCAN_VAR(chip->frequency); - SCAN_VAR(chip->gain); - SCAN_VAR(chip->output_dir); - } - - return 0; -} diff --git a/jan/src/burn/snd/iremga20.h b/jan/src/burn/snd/iremga20.h deleted file mode 100644 index 0d45885d8..000000000 --- a/jan/src/burn/snd/iremga20.h +++ /dev/null @@ -1,10 +0,0 @@ -void iremga20_write(INT32 device, INT32 offset, INT32 data); -UINT8 iremga20_read(INT32 device, INT32 offset); - -void iremga20_reset(INT32 device); -void iremga20_init(INT32 device, UINT8 *rom, INT32 rom_size, INT32 frequency); -void itemga20_set_route(INT32 device, double nVolume, INT32 nRouteDir); -void iremga20_update(INT32 device, INT16 *buffer, INT32 length); -void iremga20_exit(); - -INT32 iremga20_scan(INT32 device, INT32 nAction, INT32 *pnMin); diff --git a/jan/src/burn/snd/k005289.cpp b/jan/src/burn/snd/k005289.cpp deleted file mode 100644 index 36921ca4f..000000000 --- a/jan/src/burn/snd/k005289.cpp +++ /dev/null @@ -1,300 +0,0 @@ -/*************************************************************************** - - Konami 005289 - SCC sound as used in Bubblesystem - - This file is pieced together by Bryan McPhail from a combination of - Namco Sound, Amuse by Cab, Nemesis schematics and whoever first - figured out SCC! - - The 005289 is a 2 channel sound generator. Each channel gets its - waveform from a prom (4 bits wide). - - (From Nemesis schematics) - - Address lines A0-A4 of the prom run to the 005289, giving 32 bytes - per waveform. Address lines A5-A7 of the prom run to PA5-PA7 of - the AY8910 control port A, giving 8 different waveforms. PA0-PA3 - of the AY8910 control volume. - - The second channel is the same as above except port B is used. - - The 005289 has 12 address inputs and 4 control inputs: LD1, LD2, TG1, TG2. - It has no data bus, so data values written don't matter. - When LD1 or LD2 is asserted, the 12 bit value on the address bus is - latched. Each of the two channels has its own latch. - When TG1 or TG2 is asserted, the frequency of the respective channel is - set to the previously latched value. - - The 005289 itself is nothing but an address generator. Digital to analog - conversion, volume control and mixing of the channels is all done - externally via resistor networks and 4066 switches and is only implemented - here for convenience. - - Ported from MAME SVN 27/05/2014 - -***************************************************************************/ - -#include "burnint.h" -#include "k005289.h" - -// is this an actual hardware limit? or just an arbitrary divider -// to bring the output frequency down to a reasonable value for MAME? -#define CLOCK_DIVIDER 32 - -static const UINT8 *sound_prom; -static INT32 rate; - -static INT16 *mixer_table; -static INT16 *mixer_lookup; -static INT16 *mixer_buffer; -static double gain[2]; -static INT32 output_dir[2]; - -static UINT32 counter[2]; -static UINT16 frequency[2]; -static UINT16 freq_latch[2]; -static UINT16 waveform[2]; -static UINT8 volume[2]; - -/* build a table to divide by the number of voices */ -static void make_mixer_table(INT32 voices) -{ - INT32 count = voices * 128; - INT32 i; - INT32 ngain = 16; - - /* allocate memory */ - mixer_table = (INT16*)BurnMalloc(256 * voices * sizeof(INT16)); - - /* find the middle of the table */ - mixer_lookup = mixer_table + (128 * voices); - - /* fill in the table - 16 bit case */ - for (i = 0; i < count; i++) - { - INT32 val = i * ngain * 16 / voices; - if (val > 32767) val = 32767; - mixer_lookup[ i] = val; - mixer_lookup[-i] = -val; - } -} - -void K005289Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289Reset called without init\n")); -#endif - - /* reset all the voices */ - for (INT32 i = 0; i < 2; i++) - { - counter[i] = 0; - frequency[i] = 0; - freq_latch[i] = 0; - waveform[i] = i * 0x100; - volume[i] = 0; - } -} - -void K005289Init(INT32 clock, UINT8 *prom) -{ - /* get stream channels */ - rate = ((clock / CLOCK_DIVIDER) * 100) / nBurnFPS; - - /* allocate a pair of buffers to mix into - 1 frame's worth should be more than enough */ - mixer_buffer = (INT16*)BurnMalloc(rate * sizeof(INT16)); - - /* build the mixer table */ - make_mixer_table(2); - - sound_prom = prom; - - DebugSnd_K005289Initted = 1; -} - -void K005289SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289SetRoute called without init\n")); -#endif - - gain[nIndex] = nVolume; - output_dir[nIndex] = nRouteDir; -} - -void K005289Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289Exit called without init\n")); -#endif - - if (!DebugSnd_K005289Initted) return; - - BurnFree (mixer_buffer); - BurnFree (mixer_table); - mixer_buffer = NULL; - mixer_table = NULL; - - DebugSnd_K005289Initted = 0; -} - -void K005289Update(INT16 *buffer, INT32 samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289Update called without init\n")); -#endif - - INT16 *mix; - INT32 i,v,f; - - /* zap the contents of the mixer buffer */ - memset(mixer_buffer, 0, rate * sizeof(INT16)); - - v=volume[0]; - f=frequency[0]; - if (v && f) - { - const UINT8 *w = sound_prom + waveform[0]; - INT32 c = counter[0]; - - mix = mixer_buffer; - - /* add our contribution */ - for (i = 0; i < rate; i++) - { - INT32 offs; - - c += CLOCK_DIVIDER; - offs = (c / f) & 0x1f; - *mix++ += ((w[offs] & 0x0f) - 8) * v; - } - - /* update the counter for this voice */ - counter[0] = c % (f * 0x20); - } - - v=volume[1]; - f=frequency[1]; - if (v && f) - { - const UINT8 *w = sound_prom + waveform[1]; - INT32 c = counter[1]; - - mix = mixer_buffer; - - /* add our contribution */ - for (i = 0; i < rate; i++) - { - INT32 offs; - - c += CLOCK_DIVIDER; - offs = (c / f) & 0x1f; - *mix++ += ((w[offs] & 0x0f) - 8) * v; - } - - /* update the counter for this voice */ - counter[1] = c % (f * 0x20); - } - - /* mix it down */ - mix = mixer_buffer; - for (i = 0; i < samples; i++) - { - INT32 nLeftSample = mixer_lookup[mix[(i * rate) / nBurnSoundLen]]; - INT32 nRightSample = nLeftSample; - - if ((output_dir[BURN_SND_K005289_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample = (INT32)(nLeftSample * gain[BURN_SND_K005289_ROUTE_1]); - } - if ((output_dir[BURN_SND_K005289_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample = (INT32)(nRightSample * gain[BURN_SND_K005289_ROUTE_1]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - buffer[0] = BURN_SND_CLIP(buffer[0] + nLeftSample); - buffer[1] = BURN_SND_CLIP(buffer[1] + nRightSample); - buffer+=2; - } -} - -void K005289ControlAWrite(UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289ControlAWrite called without init\n")); -#endif - - volume[0] = data & 0xf; - waveform[0] = data & 0xe0; -} - -void K005289ControlBWrite(UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289ControlBWrite called without init\n")); -#endif - - volume[1] = data & 0xf; - waveform[1] = (data & 0xe0) + 0x100; -} - -void K005289Ld1Write(INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289Ld1 called without init\n")); -#endif - - offset &= 0xfff; - freq_latch[0] = 0xfff - offset; -} - -void K005289Ld2Write(INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289Ld2 called without init\n")); -#endif - - offset &= 0xfff; - freq_latch[1] = 0xfff - offset; -} - -void K005289Tg1Write() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289Tg1 called without init\n")); -#endif - - frequency[0] = freq_latch[0]; -} - -void K005289Tg2Write() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289Tg2 called without init\n")); -#endif - - frequency[1] = freq_latch[1]; -} - -INT32 K005289Scan(INT32 nAction, INT32 *) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K005289Initted) bprintf(PRINT_ERROR, _T("K005289Scan called without init\n")); -#endif - - if (nAction & ACB_DRIVER_DATA) - { - for (INT32 i = 0; i < 2; i++) { - SCAN_VAR(counter[i]); - SCAN_VAR(frequency[i]); - SCAN_VAR(freq_latch[i]); - SCAN_VAR(waveform[i]); - SCAN_VAR(volume[i]); - } - - return 0; - } - - return 0; -} diff --git a/jan/src/burn/snd/k005289.h b/jan/src/burn/snd/k005289.h deleted file mode 100644 index 94e6279b1..000000000 --- a/jan/src/burn/snd/k005289.h +++ /dev/null @@ -1,17 +0,0 @@ -void K005289Reset(); -void K005289Init(INT32 clock, UINT8 *prom); -void K005289Exit(); - -#define BURN_SND_K005289_ROUTE_1 0 - -void K005289SetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); - -INT32 K005289Scan(INT32 nAction, INT32 *pnMin); - -void K005289Update(INT16 *buffer, INT32 samples); -void K005289ControlAWrite(UINT8 data); -void K005289ControlBWrite(UINT8 data); -void K005289Ld1Write(INT32 offset); -void K005289Ld2Write(INT32 offset); -void K005289Tg1Write(); -void K005289Tg2Write(); diff --git a/jan/src/burn/snd/k007232.cpp b/jan/src/burn/snd/k007232.cpp deleted file mode 100644 index 544ab02ef..000000000 --- a/jan/src/burn/snd/k007232.cpp +++ /dev/null @@ -1,386 +0,0 @@ -// copyright-holders:Nicola Salmoria,Hiromitsu Shioya -/*********************************************************/ -/* Konami PCM controller */ -/*********************************************************/ - -/* - Changelog, Hiromitsu Shioya 02/05/2002 - fix start address decode timing. (sample loop bug.) - - Changelog, Mish, August 1999: - Removed interface support for different memory regions per channel. - Removed interface support for differing channel volume. - - Added bankswitching. - Added support for multiple chips. - - (Nb: Should different memory regions per channel be needed - the bankswitching function can set this up). - -NS990821 -support for the k007232_VOL() macro. -added external port callback, and functions to set the volume of the channels - -*/ - - -#include "burnint.h" -#include "burn_sound.h" -#include "k007232.h" - -#define KDAC_A_PCM_MAX (2) -#define BASE_SHIFT (12) - -typedef void (*K07232_PortWrite)(INT32 v); - -static UINT32 fncode[0x200]; - -struct kdacApcm -{ - UINT8 vol[KDAC_A_PCM_MAX][2]; - UINT32 addr[KDAC_A_PCM_MAX]; - UINT32 start[KDAC_A_PCM_MAX]; - UINT32 step[KDAC_A_PCM_MAX]; - UINT32 bank[KDAC_A_PCM_MAX]; - INT32 play[KDAC_A_PCM_MAX]; - - UINT8 wreg[0x10]; - - INT32 UpdateStep; -}; - -// stuff that doesn't need to be saved.. -struct kdacPointers -{ - UINT32 clock; - UINT8 *pcmbuf[2]; - UINT32 pcmlimit; - K07232_PortWrite K07232PortWriteHandler; - - double gain[2]; - INT32 output_dir[2]; -}; - -static struct kdacApcm Chips[2]; -static struct kdacPointers Pointers[2]; -static struct kdacApcm *Chip = NULL; -static struct kdacPointers *Ptr = NULL; -static INT32 *Left = NULL; -static INT32 *Right = NULL; - -static INT32 nNumChips = 0; - -void K007232Update(INT32 chip, INT16* pSoundBuf, INT32 nLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("K007232Update called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("K007232Update called with invalid chip %x\n"), chip); -#endif - - INT32 i; - - Chip = &Chips[chip]; - Ptr = &Pointers[chip]; - - memset(Left, 0, nLength * sizeof(INT32)); - memset(Right, 0, nLength * sizeof(INT32)); - - for (i = 0; i < KDAC_A_PCM_MAX; i++) { - if (Chip->play[i]) { - INT32 volA,volB,j,out; - UINT32 addr, old_addr; - - addr = Chip->start[i] + ((Chip->addr[i]>>BASE_SHIFT)&0x000fffff); - volA = Chip->vol[i][0] * 2; - volB = Chip->vol[i][1] * 2; - - for( j = 0; j < nLength; j++) { - old_addr = addr; - addr = Chip->start[i] + ((Chip->addr[i]>>BASE_SHIFT)&0x000fffff); - while (old_addr <= addr) { - if( (Ptr->pcmbuf[i][old_addr] & 0x80) || old_addr >= Ptr->pcmlimit ) { - if( Chip->wreg[0x0d]&(1<start[i] = ((((UINT32)Chip->wreg[i*0x06 + 0x04]<<16)&0x00010000) | (((UINT32)Chip->wreg[i*0x06 + 0x03]<< 8)&0x0000ff00) | (((UINT32)Chip->wreg[i*0x06 + 0x02] )&0x000000ff) | Chip->bank[i]); - addr = Chip->start[i]; - Chip->addr[i] = 0; - old_addr = addr; - } else { - Chip->play[i] = 0; - } - break; - } - - old_addr++; - } - - if (Chip->play[i] == 0) break; - - Chip->addr[i] += (Chip->step[i] * Chip->UpdateStep) >> 16; - - out = (Ptr->pcmbuf[i][addr] & 0x7f) - 0x40; - - Left[j] += out * volA; - Right[j] += out * volB; - } - } - } - - for (i = 0; i < nLength; i++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((Ptr->output_dir[BURN_SND_K007232_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Left[i] * Ptr->gain[BURN_SND_K007232_ROUTE_1]); - } - if ((Ptr->output_dir[BURN_SND_K007232_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Left[i] * Ptr->gain[BURN_SND_K007232_ROUTE_1]); - } - - if ((Ptr->output_dir[BURN_SND_K007232_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Right[i] * Ptr->gain[BURN_SND_K007232_ROUTE_2]); - } - if ((Ptr->output_dir[BURN_SND_K007232_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Right[i] * Ptr->gain[BURN_SND_K007232_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[0] = BURN_SND_CLIP(pSoundBuf[0] + nLeftSample); - pSoundBuf[1] = BURN_SND_CLIP(pSoundBuf[1] + nRightSample); - pSoundBuf += 2; - } -} - -UINT8 K007232ReadReg(INT32 chip, INT32 r) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("K007232ReadReg called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("K007232ReadReg called with invalid chip %x\n"), chip); -#endif - - INT32 ch = 0; - - Chip = &Chips[chip]; - Ptr = &Pointers[chip]; - - if (r == 0x0005 || r == 0x000b) { - ch = r / 0x0006; - r = ch * 0x0006; - - Chip->start[ch] = ((((UINT32)Chip->wreg[r + 0x04]<<16)&0x00010000) | (((UINT32)Chip->wreg[r + 0x03]<< 8)&0x0000ff00) | (((UINT32)Chip->wreg[r + 0x02] )&0x000000ff) | Chip->bank[ch]); - - if (Chip->start[ch] < Ptr->pcmlimit) { - Chip->play[ch] = 1; - Chip->addr[ch] = 0; - } - } - - return 0; -} - -void K007232WriteReg(INT32 chip, INT32 r, INT32 v) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("K007232WriteReg called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("K007232WriteReg called with invalid chip %x\n"), chip); -#endif - - INT32 Data; - - Chip = &Chips[chip]; - Ptr = &Pointers[chip]; - - Chip->wreg[r] = v; - - if (r == 0x0c) { - if (Ptr->K07232PortWriteHandler) Ptr->K07232PortWriteHandler(v); - return; - } - else if( r == 0x0d ){ - // loopflag - return; - } - else { - INT32 RegPort; - - RegPort = 0; - if (r >= 0x06) { - RegPort = 1; - r -= 0x06; - } - - switch (r) { - case 0x00: - case 0x01: - Data = (((((UINT32)Chip->wreg[RegPort*0x06 + 0x01])<<8)&0x0100) | (((UINT32)Chip->wreg[RegPort*0x06 + 0x00])&0x00ff)); - Chip->step[RegPort] = fncode[Data]; - break; - - case 0x02: - case 0x03: - case 0x04: - break; - - case 0x05: - Chip->start[RegPort] = ((((UINT32)Chip->wreg[RegPort*0x06 + 0x04]<<16)&0x00010000) | (((UINT32)Chip->wreg[RegPort*0x06 + 0x03]<< 8)&0x0000ff00) | (((UINT32)Chip->wreg[RegPort*0x06 + 0x02] )&0x000000ff) | Chip->bank[RegPort]); - if (Chip->start[RegPort] < Ptr->pcmlimit ) { - Chip->play[RegPort] = 1; - Chip->addr[RegPort] = 0; - } - break; - } - } -} - -void K007232SetPortWriteHandler(INT32 chip, void (*Handler)(INT32 v)) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("K007232SetPortWriteHandler called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("K007232SetPortWriteHandler called with invalid chip %x\n"), chip); -#endif - - Chip = &Chips[chip]; - Ptr = &Pointers[chip]; - - Ptr->K07232PortWriteHandler = Handler; -} - -static void KDAC_A_make_fncode() -{ - for (INT32 i = 0; i < 0x200; i++) fncode[i] = (32 << BASE_SHIFT) / (0x200 - i); -} - -void K007232Init(INT32 chip, INT32 clock, UINT8 *pPCMData, INT32 PCMDataSize) -{ - DebugSnd_K007232Initted = 1; - - Chip = &Chips[chip]; - Ptr = &Pointers[chip]; - - memset(Chip, 0, sizeof(kdacApcm)); - memset(Ptr, 0, sizeof(kdacPointers)); - - if (Left == NULL) { - Left = (INT32*)BurnMalloc(nBurnSoundLen * sizeof(INT32)); - } - - if (Right == NULL) { - Right = (INT32*)BurnMalloc(nBurnSoundLen * sizeof(INT32)); - } - - Ptr->pcmbuf[0] = pPCMData; - Ptr->pcmbuf[1] = pPCMData; - Ptr->pcmlimit = PCMDataSize; - - Ptr->clock = clock; - - for (INT32 i = 0; i < KDAC_A_PCM_MAX; i++) { - Chip->start[i] = 0; - Chip->step[i] = 0; - Chip->play[i] = 0; - Chip->bank[i] = 0; - } - Chip->vol[0][0] = 255; - Chip->vol[0][1] = 0; - Chip->vol[1][0] = 0; - Chip->vol[1][1] = 255; - - for (INT32 i = 0; i < 0x10; i++) Chip->wreg[i] = 0; - - KDAC_A_make_fncode(); - - double Rate = (double)clock / 128 / nBurnSoundRate; - Chip->UpdateStep = (INT32)(Rate * 0x10000); - - Ptr->gain[BURN_SND_K007232_ROUTE_1] = 1.00; - Ptr->gain[BURN_SND_K007232_ROUTE_2] = 1.00; - Ptr->output_dir[BURN_SND_K007232_ROUTE_1] = BURN_SND_ROUTE_BOTH; - Ptr->output_dir[BURN_SND_K007232_ROUTE_2] = BURN_SND_ROUTE_BOTH; - - nNumChips = chip; -} - -void K007232SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("K007232SetRoute called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("K007232SetRoute called with invalid chip %x\n"), chip); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("K007232SetRoute called with invalid index %i\n"), nIndex); -#endif - - Ptr = &Pointers[chip]; - - Ptr->gain[nIndex] = nVolume; - Ptr->output_dir[nIndex] = nRouteDir; -} - -void K007232Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("K007232Exit called without init\n")); -#endif - - BurnFree(Left); - BurnFree(Right); - - DebugSnd_K007232Initted = 0; - nNumChips = 0; -} - -INT32 K007232Scan(INT32 nAction, INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("K007232Scan called without init\n")); -#endif - - if (pnMin != NULL) { - *pnMin = 0x029693; - } - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - SCAN_VAR(Chips); - - return 0; -} - -void K007232SetVolume(INT32 chip, INT32 channel,INT32 volumeA,INT32 volumeB) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("K007232SetVolume called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("K007232SetVolume called with invalid chip %x\n"), chip); -#endif - - Chip = &Chips[chip]; - if (volumeA) - Chip->vol[channel][0] = volumeA; - if (volumeB) - Chip->vol[channel][1] = volumeB; -} - -void K007232SetVolumeF(INT32 chip, INT32 channel,INT32 volumeA,INT32 volumeB) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("K007232SetVolumeF called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("K007232SetVolumeF called with invalid chip %x\n"), chip); -#endif - - Chip = &Chips[chip]; - Chip->vol[channel][0] = volumeA; - Chip->vol[channel][1] = volumeB; -} - -void k007232_set_bank(INT32 chip, INT32 chABank, INT32 chBBank ) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K007232Initted) bprintf(PRINT_ERROR, _T("k007232_set_bank called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("k007232_set_bank called with invalid chip %x\n"), chip); -#endif - - Chip = &Chips[chip]; - - Chip->bank[0] = chABank<<17; - Chip->bank[1] = chBBank<<17; -} diff --git a/jan/src/burn/snd/k007232.h b/jan/src/burn/snd/k007232.h deleted file mode 100644 index 5a31267b0..000000000 --- a/jan/src/burn/snd/k007232.h +++ /dev/null @@ -1,18 +0,0 @@ -void K007232Update(INT32 chip, INT16* pSoundBuf, INT32 nLength); -UINT8 K007232ReadReg(INT32 chip, INT32 r); -void K007232WriteReg(INT32 chip, INT32 r, INT32 v); -void K007232SetPortWriteHandler(INT32 chip, void (*Handler)(INT32 v)); -void K007232Init(INT32 chip, INT32 clock, UINT8 *pPCMData, INT32 PCMDataSize); -void K007232SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void K007232Exit(); -INT32 K007232Scan(INT32 nAction, INT32 *pnMin); -void K007232SetVolume(INT32 chip, INT32 channel,INT32 volumeA,INT32 volumeB); -void K007232SetVolumeF(INT32 chip, INT32 channel,INT32 volumeA,INT32 volumeB); -void k007232_set_bank( INT32 chip, INT32 chABank, INT32 chBBank ); - -#define BURN_SND_K007232_ROUTE_1 0 -#define BURN_SND_K007232_ROUTE_2 1 - -#define K007232PCMSetAllRoutes(i, v, d) \ - K007232SetRoute(i, BURN_SND_K007232_ROUTE_1, v, d); \ - K007232SetRoute(i, BURN_SND_K007232_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/k051649.cpp b/jan/src/burn/snd/k051649.cpp deleted file mode 100644 index e0b5a4c11..000000000 --- a/jan/src/burn/snd/k051649.cpp +++ /dev/null @@ -1,326 +0,0 @@ -/*************************************************************************** - - Konami 051649 - SCC1 sound as used in Haunted Castle, City Bomber - - This file is pieced together by Bryan McPhail from a combination of - Namco Sound, Amuse by Cab, Haunted Castle schematics and whoever first - figured out SCC! - - The 051649 is a 5 channel sound generator, each channel gets it's - waveform from RAM (32 bytes per waveform, 8 bit signed data). - - This sound chip is the same as the sound chip in some Konami - megaROM cartridges for the MSX. It is actually well researched - and documented: - - http://www.msxnet.org/tech/scc - - Thanks to Sean Young (sean@mess.org) for some bugfixes. - - K052539 is equivalent to this chip except channel 5 does not share - waveforms with channel 4. - -***************************************************************************/ - -#include "burnint.h" -#include "k051649.h" - -#define FREQBASEBITS 16 - -static UINT32 nUpdateStep; - -/* this structure defines the parameters for a channel */ -typedef struct -{ - UINT64 counter; - INT32 frequency; - INT32 volume; - INT32 key; - INT8 waveform[32]; /* 19991207.CAB */ -} k051649_sound_channel; - -typedef struct _k051649_state k051649_state; -struct _k051649_state -{ - k051649_sound_channel channel_list[5]; - - /* global sound parameters */ - INT32 mclock,rate; - double gain; - INT32 output_dir; - - /* mixer tables and internal buffers */ - INT16 *mixer_table; - INT16 *mixer_lookup; - INT16 *mixer_buffer; -}; - -static k051649_state Chips[1]; // ok? (one is good enough) -static k051649_state *info; - -/* build a table to divide by the number of voices */ -static void make_mixer_table(INT32 voices) -{ - INT32 count = voices * 256; - INT32 i; - INT32 gain = 8; - - /* allocate memory */ - info->mixer_table = (INT16 *)BurnMalloc(512 * voices * sizeof(INT16)); - - /* find the middle of the table */ - info->mixer_lookup = info->mixer_table + (256 * voices); - - /* fill in the table - 16 bit case */ - for (i = 0; i < count; i++) - { - INT32 val = i * gain * 16 / voices; - if (val > 32767) val = 32767; - info->mixer_lookup[ i] = val; - info->mixer_lookup[-i] = -val; - } -} - - -/* generate sound to the mix buffer */ -void K051649Update(INT16 *pBuf, INT32 samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K051649Update called without init\n")); -#endif - - info = &Chips[0]; - k051649_sound_channel *voice=info->channel_list; - INT16 *mix; - INT32 i,v,j; - double gain = info->gain; - - /* zap the contents of the mixer buffer */ - memset(info->mixer_buffer, 0, samples * sizeof(INT16)); - - for (j=0; j<5; j++) - { - // channel is halted for freq < 9 - if (voice[j].frequency > 8) - { - const INT8 *w = voice[j].waveform; /* 19991207.CAB */ - v=voice[j].volume * voice[j].key; - INT32 c=voice[j].counter; - INT32 step = (INT32)((((((float)info->mclock / (float)((voice[j].frequency+1) * 16))*(float)(1<rate / 32)) * nUpdateStep) / 32768); - mix = info->mixer_buffer; - - /* add our contribution */ - for (i = 0; i < samples; i++) - { - INT32 offs; - - c+= step; - offs = (c >> 16) & 0x1f; - *mix++ += ((w[offs] * v)>>3); - } - - /* update the counter for this voice */ - voice[j].counter = c; - } - } - - /* mix it down */ - mix = info->mixer_buffer; - for (i = 0; i < samples; i++) { - INT32 output = info->mixer_lookup[*mix++]; - - output = BURN_SND_CLIP(output); - output = (INT32)(output * gain); - output = BURN_SND_CLIP(output); - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((info->output_dir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += output; - } - if ((info->output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += output; - } - - pBuf[0] = BURN_SND_CLIP(pBuf[0] + nLeftSample); - pBuf[1] = BURN_SND_CLIP(pBuf[1] + nRightSample); - pBuf += 2; - } -} - -void K051649Init(INT32 clock) -{ - DebugSnd_K051649Initted = 1; - - info = &Chips[0]; - - /* get stream channels */ - info->rate = clock/16; - info->mclock = clock; - info->gain = 1.00; - info->output_dir = BURN_SND_ROUTE_BOTH; - - nUpdateStep = (INT32)(((float)info->rate / nBurnSoundRate) * 32768); - - /* allocate a buffer to mix into - 1 second's worth should be more than enough */ - info->mixer_buffer = (INT16 *)BurnMalloc(2 * sizeof(INT16) * info->rate); - memset(info->mixer_buffer, 0, 2 * sizeof(INT16) * info->rate); - - /* build the mixer table */ - make_mixer_table(5); - - K051649Reset(); // clear things on init. -} - -void K051649SetRoute(double nVolume, INT32 nRouteDir) -{ - info = &Chips[0]; - - info->gain = nVolume; - info->output_dir = nRouteDir; -} - -void K051649Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K051649Exit called without init\n")); -#endif - - if (!DebugSnd_K051649Initted) return; - - info = &Chips[0]; - - BurnFree (info->mixer_buffer); - BurnFree (info->mixer_table); - - nUpdateStep = 0; - - DebugSnd_K051649Initted = 0; -} - -void K051649Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K051649Reset called without init\n")); -#endif - - info = &Chips[0]; - k051649_sound_channel *voice = info->channel_list; - INT32 i; - - /* reset all the voices */ - for (i = 0; i < 5; i++) { - voice[i].frequency = 0; - voice[i].volume = 0; - voice[i].key = 0; - voice[i].counter = 0; - memset(&voice[i].waveform, 0, 32); - } -} - -INT32 K051649Scan(INT32 nAction, INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K051649Scan called without init\n")); -#endif - - struct BurnArea ba; - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - if (pnMin != NULL) { - *pnMin = 0x029705; - } - - ba.Data = &info->channel_list; - ba.nLen = sizeof(k051649_sound_channel) * 5; - ba.nAddress = 0; - ba.szName = "K051649 Channel list"; - BurnAcb(&ba); - - return 0; -} - -/********************************************************************************/ - -void K051649WaveformWrite(INT32 offset, INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K051649WaveformWrite called without init\n")); -#endif - - info = &Chips[0]; - info->channel_list[offset>>5].waveform[offset&0x1f]=data; - /* SY 20001114: Channel 5 shares the waveform with channel 4 */ - if (offset >= 0x60) - info->channel_list[4].waveform[offset&0x1f]=data; -} - -UINT8 K051649WaveformRead(INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K051649WaveformRead called without init\n")); -#endif - - info = &Chips[0]; - return info->channel_list[offset>>5].waveform[offset&0x1f]; -} - -/* SY 20001114: Channel 5 doesn't share the waveform with channel 4 on this chip */ -void K052539WaveformWrite(INT32 offset, INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K052539WaveformWrite called without init\n")); -#endif - - info = &Chips[0]; - - info->channel_list[offset>>5].waveform[offset&0x1f]=data; -} - -void K051649VolumeWrite(INT32 offset, INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K051649VolumeWrite called without init\n")); -#endif - - info = &Chips[0]; - - info->channel_list[offset&0x7].volume=data&0xf; -} - -void K051649FrequencyWrite(INT32 offset, INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K051649FrequencyWrite called without init\n")); -#endif - INT32 freq_hi = offset & 1; - - info = &Chips[0]; - - if (info->channel_list[offset>>1].frequency < 9) - info->channel_list[offset>>1].counter |= ((1 << FREQBASEBITS) - 1); - - // update frequency - if (freq_hi) - info->channel_list[offset>>1].frequency = (info->channel_list[offset>>1].frequency & 0x0ff) | (data << 8 & 0xf00); - else - info->channel_list[offset>>1].frequency = (info->channel_list[offset>>1].frequency & 0xf00) | data; -} - -void K051649KeyonoffWrite(INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K051649Initted) bprintf(PRINT_ERROR, _T("K051649KeyonoffWrite called without init\n")); -#endif - - info = &Chips[0]; - info->channel_list[0].key=(data&1) ? 1 : 0; - info->channel_list[1].key=(data&2) ? 1 : 0; - info->channel_list[2].key=(data&4) ? 1 : 0; - info->channel_list[3].key=(data&8) ? 1 : 0; - info->channel_list[4].key=(data&16) ? 1 : 0; -} - diff --git a/jan/src/burn/snd/k051649.h b/jan/src/burn/snd/k051649.h deleted file mode 100644 index 9958a439d..000000000 --- a/jan/src/burn/snd/k051649.h +++ /dev/null @@ -1,16 +0,0 @@ -void K051649Update(INT16 *pBuf, INT32 samples); -void K051649Init(INT32 clock); -void K051649SetRoute(double nVolume, INT32 nRouteDir); -void K051649Reset(); -void K051649Exit(); - -INT32 K051649Scan(INT32 nAction, INT32 *pnMin); - -void K051649WaveformWrite(INT32 offset, INT32 data); -UINT8 K051649WaveformRead(INT32 offset); - -void K052539WaveformWrite(INT32 offset, INT32 data); - -void K051649VolumeWrite(INT32 offset, INT32 data); -void K051649FrequencyWrite(INT32 offset, INT32 data); -void K051649KeyonoffWrite(INT32 data); diff --git a/jan/src/burn/snd/k053260.cpp b/jan/src/burn/snd/k053260.cpp deleted file mode 100644 index 537987a65..000000000 --- a/jan/src/burn/snd/k053260.cpp +++ /dev/null @@ -1,560 +0,0 @@ -// copyright-holders:Ernesto Corvi, Alex W. Jackson -/********************************************************* - - Konami 053260 KDSC - - The 053260 is a four voice PCM/ADPCM sound chip that - also incorporates four 8-bit ports for communication - between a main CPU and audio CPU. The chip's output - is compatible with a YM3012 DAC, and it has a digital - auxiliary input compatible with the output of a YM2151. - Some games (e.g. Simpsons) only connect one channel of - the YM2151, but others (e.g. Thunder Cross II) connect - both channels for stereo mixing. - - The 053260 has a 21-bit address bus and 8-bit data bus - to ROM, allowing it to access up to 2 megabytes of - sample data. Sample data can be either signed 8-bit - PCM or a custom 4-bit ADPCM format. It is possible for - two 053260 chips to share access to the same ROMs - (used by Over Drive) - - The 053260 has separate address and data buses to the - audio CPU controlling it and to the main CPU. Both data - buses are 8 bit. The audio CPU address bus has 6 lines - (64 addressable registers, but fewer than 48 are - actually used) while the main CPU "bus" has only 1 line - (2 addressable registers). All registers on the audio - CPU side seem to be either read-only or write-only, - although some games write 0 to all the registers in a - loop at startup (including otherwise read-only or - entirely unused registers). - On the main CPU side, reads and writes to the same - address access different communication ports. - - The sound data ROMs of Simpsons and Vendetta have - "headers" listing all the samples in the ROM, their - formats ("PCM" or "KADPCM"), start and end addresses. - The header data doesn't seem to be used by the hardware - (none of the other games have headers) but provides - useful information about the chip. - - 2004-02-28 (Oliver Achten) - Fixed ADPCM decoding. Games sound much better now. - - 2014-10-06 (Alex W. Jackson) - Rewrote from scratch in C++; implemented communication - ports properly; used the actual up counters instead of - converting to fractional sample position; fixed ADPCM - decoding bugs; added documentation. - - -*********************************************************/ - -#include "burnint.h" -#include "k053260.h" - -/* 2004-02-28: Fixed ppcm decoding. Games sound much better now.*/ - -#define BASE_SHIFT 16 - -#define K053260_INLINE static inline - -static UINT32 nUpdateStep; - -struct k053260_channel_def { - UINT32 rate; - UINT32 size; - UINT32 start; - UINT32 bank; - UINT32 volume; - INT32 play; - UINT32 pan; - UINT32 pos; - INT32 loop; - INT32 ppcm; /* packed PCM ( 4 bit signed ) */ - INT32 ppcm_data; -}; -struct k053260_chip_def { - INT32 mode; - INT32 regs[0x30]; - UINT8 *rom; - INT32 rom_size; - UINT32 *delta_table; - k053260_channel_def channels[4]; - - double gain[2]; - INT32 output_dir[2]; -}; - -static k053260_chip_def Chips[2]; -static k053260_chip_def *ic; - -static INT32 nNumChips = 0; - -static void InitDeltaTable(INT32 rate, INT32 clock ) { - INT32 i; - double base = ( double )rate; - double max = (double)(clock); /* Hz */ - UINT32 val; - - for( i = 0; i < 0x1000; i++ ) { - double v = ( double )( 0x1000 - i ); - double target = (max) / v; - double fixed = ( double )( 1 << BASE_SHIFT ); - - if ( target && base ) { - target = fixed / ( base / target ); - val = (UINT32)target; - if ( val == 0 ) - val = 1; - } else - val = 1; - - ic->delta_table[i] = val; - } -} - -void K053260Reset(INT32 chip) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K053260Initted) bprintf(PRINT_ERROR, _T("K053260Reset called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K053260Reset called with invalid chip %x\n"), chip); -#endif - - ic = &Chips[chip]; - - for(INT32 i = 0; i < 4; i++ ) { - ic->channels[i].rate = 0; - ic->channels[i].size = 0; - ic->channels[i].start = 0; - ic->channels[i].bank = 0; - ic->channels[i].volume = 0; - ic->channels[i].play = 0; - ic->channels[i].pan = 0; - ic->channels[i].pos = 0; - ic->channels[i].loop = 0; - ic->channels[i].ppcm = 0; - ic->channels[i].ppcm_data = 0; - } -} - -K053260_INLINE INT32 limit( INT32 val, INT32 max, INT32 min ) { - if ( val > max ) - val = max; - else if ( val < min ) - val = min; - - return val; -} - -#define MAXOUT 0x3fff -#define MINOUT -0x4000 - -void K053260Update(INT32 chip, INT16 *pBuf, INT32 length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K053260Initted) bprintf(PRINT_ERROR, _T("K053260Update called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K053260Update called with invalid chip %x\n"), chip); -#endif - - static const INT8 dpcmcnv[] = { 0,1,2,4,8,16,32,64, -128, -64, -32, -16, -8, -4, -2, -1}; - - INT32 lvol[4], rvol[4], play[4], loop[4], ppcm[4]; - UINT8 *rom[4]; - UINT32 delta[4], end[4], pos[4]; - INT32 dataL, dataR; - INT8 ppcm_data[4]; - INT8 d; - ic = &Chips[chip]; - - /* precache some values */ - for ( int i = 0; i < 4; i++ ) { - rom[i]= &ic->rom[ic->channels[i].start + ( ic->channels[i].bank << 16 ) + 1]; - delta[i] = (ic->delta_table[ic->channels[i].rate] * nUpdateStep) >> 15; - lvol[i] = ic->channels[i].volume * ic->channels[i].pan; - rvol[i] = ic->channels[i].volume * ( 8 - ic->channels[i].pan ); - end[i] = ic->channels[i].size - 1; - pos[i] = ic->channels[i].pos; - play[i] = ic->channels[i].play; - loop[i] = ic->channels[i].loop; - ppcm[i] = ic->channels[i].ppcm; - ppcm_data[i] = ic->channels[i].ppcm_data; - if ( ppcm[i] ) - delta[i] /= 2; - } - - for ( int j = 0; j < length; j++ ) { - - dataL = dataR = 0; - - for ( int i = 0; i < 4; i++ ) { - /* see if the voice is on */ - if ( play[i] ) { - /* see if we're done */ - if ( ( pos[i] >> BASE_SHIFT ) >= end[i] ) { - - ppcm_data[i] = 0; - if ( loop[i] ) - pos[i] = 0; - else { - play[i] = 0; - continue; - } - } - - if ( ppcm[i] ) { /* Packed PCM */ - /* we only update the signal if we're starting or a real sound sample has gone by */ - /* this is all due to the dynamic sample rate convertion */ - if ( pos[i] == 0 || ( ( pos[i] ^ ( pos[i] - delta[i] ) ) & 0x8000 ) == 0x8000 ) - - { - INT32 newdata; - if ( pos[i] & 0x8000 ){ - - newdata = ((rom[i][pos[i] >> BASE_SHIFT]) >> 4) & 0x0f; /*high nybble*/ - } - else{ - newdata = ( ( rom[i][pos[i] >> BASE_SHIFT] ) ) & 0x0f; /*low nybble*/ - } - - ppcm_data[i] += dpcmcnv[newdata]; - } - - d = ppcm_data[i]; - - pos[i] += delta[i]; - } else { /* PCM */ - d = rom[i][pos[i] >> BASE_SHIFT]; - - pos[i] += delta[i]; - } - - if ( ic->mode & 2 ) { - dataL += ( d * lvol[i] ) >> 2; - dataR += ( d * rvol[i] ) >> 2; - } - } - } - - dataL = limit(dataL, MAXOUT, MINOUT); - dataR = limit(dataR, MAXOUT, MINOUT); - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((ic->output_dir[BURN_SND_K053260_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dataL * ic->gain[BURN_SND_K053260_ROUTE_1]); - } - if ((ic->output_dir[BURN_SND_K053260_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dataL * ic->gain[BURN_SND_K053260_ROUTE_1]); - } - - if ((ic->output_dir[BURN_SND_K053260_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dataR * ic->gain[BURN_SND_K053260_ROUTE_2]); - } - if ((ic->output_dir[BURN_SND_K053260_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dataR * ic->gain[BURN_SND_K053260_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - -// pBuf[0] += nLeftSample; -// pBuf[1] += nRightSample; - pBuf[0] = BURN_SND_CLIP(pBuf[0] + nLeftSample); - pBuf[1] = BURN_SND_CLIP(pBuf[1] + nRightSample); - pBuf += 2; - } - - /* update the regs now */ - for ( int i = 0; i < 4; i++ ) { - ic->channels[i].pos = pos[i]; - ic->channels[i].play = play[i]; - ic->channels[i].ppcm_data = ppcm_data[i]; - } -} - -void K053260Init(INT32 chip, INT32 clock, UINT8 *rom, INT32 nLen) -{ - DebugSnd_K053260Initted = 1; - - ic = &Chips[chip]; - memset (ic, 0, sizeof(k053260_chip_def)); - - INT32 rate = clock / 32; - INT32 i; - - nUpdateStep = (INT32)(((float)rate / nBurnSoundRate) * 32768); - - ic->mode = 0; - ic->rom = rom; - ic->rom_size = nLen - 1; - - K053260Reset(chip); - - for ( i = 0; i < 0x30; i++ ) - ic->regs[i] = 0; - - ic->delta_table = (UINT32* )BurnMalloc( 0x1000 * sizeof(UINT32) ); - - InitDeltaTable( rate, clock ); - - ic->gain[BURN_SND_K053260_ROUTE_1] = 1.00; - ic->gain[BURN_SND_K053260_ROUTE_2] = 1.00; - ic->output_dir[BURN_SND_K053260_ROUTE_1] = BURN_SND_ROUTE_BOTH; - ic->output_dir[BURN_SND_K053260_ROUTE_2] = BURN_SND_ROUTE_BOTH; - - nNumChips = chip; - - /* setup SH1 timer if necessary */ -// if ( ic->intf->irq ) -// timer_pulse( attotime_mul(ATTOTIME_IN_HZ(clock), 32), NULL, 0, ic->intf->irq ); -} - -void K053260SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K053260Initted) bprintf(PRINT_ERROR, _T("K053260SetRoute called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("K053260SetRoute called with invalid chip %x\n"), chip); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("K053260SetRoute called with invalid index %i\n"), nIndex); -#endif - - ic = &Chips[chip]; - - ic->gain[nIndex] = nVolume; - ic->output_dir[nIndex] = nRouteDir; -} - -void K053260Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K053260Initted) bprintf(PRINT_ERROR, _T("K053260Exit called without init\n")); -#endif - - if (!DebugSnd_K053260Initted) return; - - for (INT32 i = 0; i < 2; i++) { - ic = &Chips[i]; - - BurnFree (ic->delta_table); - } - - nUpdateStep = 0; - - DebugSnd_K053260Initted = 0; - - nNumChips = 0; -} - -K053260_INLINE void check_bounds(INT32 channel ) { - - INT32 channel_start = ( ic->channels[channel].bank << 16 ) + ic->channels[channel].start; - INT32 channel_end = channel_start + ic->channels[channel].size - 1; - - if ( channel_start > ic->rom_size ) { - ic->channels[channel].play = 0; - - return; - } - - if ( channel_end > ic->rom_size ) { - ic->channels[channel].size = ic->rom_size - channel_start; - } -} - -void K053260Write(INT32 chip, INT32 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K053260Initted) bprintf(PRINT_ERROR, _T("K053260Write called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K053260Write called with invalid chip %x\n"), chip); -#endif - - INT32 i, t; - INT32 r = offset; - INT32 v = data; - - ic = &Chips[chip]; - - if ( r > 0x2f ) { - return; - } - - /* before we update the regs, we need to check for a latched reg */ - if ( r == 0x28 ) { - t = ic->regs[r] ^ v; - - for ( i = 0; i < 4; i++ ) { - if ( t & ( 1 << i ) ) { - if ( v & ( 1 << i ) ) { - ic->channels[i].play = 1; - ic->channels[i].pos = 0; - ic->channels[i].ppcm_data = 0; - check_bounds( i ); - } else - ic->channels[i].play = 0; - } - } - - ic->regs[r] = v; - return; - } - - /* update regs */ - ic->regs[r] = v; - - /* communication registers */ - if ( r < 8 ) - return; - - /* channel setup */ - if ( r < 0x28 ) { - INT32 channel = ( r - 8 ) / 8; - - switch ( ( r - 8 ) & 0x07 ) { - case 0: /* sample rate low */ - ic->channels[channel].rate &= 0x0f00; - ic->channels[channel].rate |= v; - break; - - case 1: /* sample rate high */ - ic->channels[channel].rate &= 0x00ff; - ic->channels[channel].rate |= ( v & 0x0f ) << 8; - break; - - case 2: /* size low */ - ic->channels[channel].size &= 0xff00; - ic->channels[channel].size |= v; - break; - - case 3: /* size high */ - ic->channels[channel].size &= 0x00ff; - ic->channels[channel].size |= v << 8; - break; - - case 4: /* start low */ - ic->channels[channel].start &= 0xff00; - ic->channels[channel].start |= v; - break; - - case 5: /* start high */ - ic->channels[channel].start &= 0x00ff; - ic->channels[channel].start |= v << 8; - break; - - case 6: /* bank */ - ic->channels[channel].bank = v & 0xff; - break; - - case 7: /* volume is 7 bits. Convert to 8 bits now. */ - ic->channels[channel].volume = ( ( v & 0x7f ) << 1 ) | ( v & 1 ); - break; - } - - return; - } - - switch( r ) { - case 0x2a: /* loop, ppcm */ - for ( i = 0; i < 4; i++ ) - ic->channels[i].loop = ( v & ( 1 << i ) ) != 0; - - for ( i = 4; i < 8; i++ ) - ic->channels[i-4].ppcm = ( v & ( 1 << i ) ) != 0; - break; - - case 0x2c: /* pan */ - ic->channels[0].pan = v & 7; - ic->channels[1].pan = ( v >> 3 ) & 7; - break; - - case 0x2d: /* more pan */ - ic->channels[2].pan = v & 7; - ic->channels[3].pan = ( v >> 3 ) & 7; - break; - - case 0x2f: /* control */ - ic->mode = v & 7; - /* bit 0 = read ROM */ - /* bit 1 = enable sound output */ - /* bit 2 = unknown */ - break; - } -} - -UINT8 K053260Read(INT32 chip, INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K053260Initted) bprintf(PRINT_ERROR, _T("K053260Read called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K053260Read called with invalid chip %x\n"), chip); -#endif - - ic = & Chips[chip]; - - switch ( offset ) { - case 0x29: /* channel status */ - { - INT32 i, status = 0; - - for ( i = 0; i < 4; i++ ) - status |= ic->channels[i].play << i; - - return status; - } - break; - - case 0x2e: /* read rom */ - if ( ic->mode & 1 ) { - UINT32 offs = ic->channels[0].start + ( ic->channels[0].pos >> BASE_SHIFT ) + ( ic->channels[0].bank << 16 ); - - ic->channels[0].pos += ( 1 << 16 ); - - if ( offs > (UINT32)ic->rom_size ) { - - return 0; - } - - return ic->rom[offs]; - } - break; - } - - return ic->regs[offset]; -} - -INT32 K053260Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K053260Initted) bprintf(PRINT_ERROR, _T("K053260Scan called without init\n")); -#endif - - struct BurnArea ba; - char szName[32]; - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - for (INT32 i = 0; i < 2; i++) { - ic = &Chips[i]; - - sprintf(szName, "k053260 regs %d", 0); - ba.Data = ic->regs; - ba.nLen = 0x30 * sizeof(INT32); - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - - sprintf(szName, "k053260 channels # %d", 0); - ba.Data = ic->channels; - ba.nLen = 4 * sizeof(k053260_channel_def); - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - - SCAN_VAR(ic->mode); - } - - return 0; -} - -#undef K053260_INLINE diff --git a/jan/src/burn/snd/k053260.h b/jan/src/burn/snd/k053260.h deleted file mode 100644 index 043afae9f..000000000 --- a/jan/src/burn/snd/k053260.h +++ /dev/null @@ -1,16 +0,0 @@ -void K053260Reset(INT32 chip); -void K053260Update(INT32 chip, INT16 *pBuf, INT32 length); -void K053260Init(INT32 chip, INT32 clock, UINT8 *rom, INT32 nLen); -void K053260SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void K053260Exit(); -void K053260Write(INT32 chip, INT32 offset, UINT8 data); -UINT8 K053260Read(INT32 chip, INT32 offset); - -INT32 K053260Scan(INT32 nAction); - -#define BURN_SND_K053260_ROUTE_1 0 -#define BURN_SND_K053260_ROUTE_2 1 - -#define K053260PCMSetAllRoutes(i, v, d) \ - K053260SetRoute(i, BURN_SND_K053260_ROUTE_1, v, d); \ - K053260SetRoute(i, BURN_SND_K053260_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/k054539.cpp b/jan/src/burn/snd/k054539.cpp deleted file mode 100644 index 2d0994edc..000000000 --- a/jan/src/burn/snd/k054539.cpp +++ /dev/null @@ -1,945 +0,0 @@ -// copyright-holders:Aaron Giles -/********************************************************* - - Konami 054539 (TOP) PCM Sound Chip - - A lot of information comes from Amuse. - Big thanks to them. - -*********************************************************/ - -// IRQ handling is disabled for now... - -#include "burnint.h" -#include "math.h" -#include "k054539.h" - -static UINT32 nUpdateStep; -static INT32 nNumChips = 0; - -typedef struct _k054539_interface k054539_interface; -struct _k054539_interface -{ - const char *rgnoverride; - void (*apan)(double, double); -// void (*irq)(running_machine *); -}; - -struct k054539_channel { - UINT32 pos; - UINT32 pfrac; - INT32 val; - INT32 pval; -}; - -struct k054539_info { - k054539_interface intf; - double voltab[256]; - double pantab[0xf]; - - double k054539_gain[8]; - UINT8 k054539_posreg_latch[8][3]; - INT32 k054539_flags; - - UINT8 regs[0x230]; - UINT8 *ram; - INT32 reverb_pos; - - INT32 cur_ptr; - INT32 cur_limit; - UINT8 *cur_zone; - UINT8 *rom; - UINT32 rom_size; - UINT32 rom_mask; - - INT32 clock; - - double volume[2]; - INT32 output_dir[2]; - - k054539_channel channels[8]; -}; - -static k054539_info Chips[2]; -static k054539_info *info; - -static INT32 *soundbuf[2] = { NULL, NULL }; -static INT16 *mixerbuf = NULL; // for native -> nBurnSoundRate conversion - -void K054539_init_flags(INT32 chip, INT32 flags) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539_init_flags called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K054539_init_flags called with invalid chip %x\n"), chip); -#endif - - info = &Chips[chip]; - info->k054539_flags = flags; -} - -void K054539_set_gain(INT32 chip, INT32 channel, double gain) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539_set_gain called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K054539_set_gain called with invalid chip %x\n"), chip); -#endif - - info = &Chips[chip]; - if (gain >= 0) info->k054539_gain[channel] = gain; -} - -static INT32 k054539_regupdate() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539_regupdate called without init\n")); -#endif - - return !(info->regs[0x22f] & 0x80); -} - -static void k054539_keyon(INT32 channel) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539_keyon called without init\n")); -#endif - - if(k054539_regupdate()) - info->regs[0x22c] |= 1 << channel; -} - -static void k054539_keyoff(INT32 channel) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539_keyoff called without init\n")); -#endif - - if(k054539_regupdate()) - info->regs[0x22c] &= ~(1 << channel); -} - -void K054539Write(INT32 chip, INT32 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539Write called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K054539Write called with invalid chip %x\n"), chip); -#endif - - info = &Chips[chip]; - - INT32 latch, offs, ch, pan; - UINT8 *regbase, *regptr, *posptr; - - regbase = info->regs; - latch = (info->k054539_flags & K054539_UPDATE_AT_KEYON) && (regbase[0x22f] & 1); - - if (latch && offset < 0x100) - { - offs = (offset & 0x1f) - 0xc; - ch = offset >> 5; - - if (offs >= 0 && offs <= 2) - { - // latch writes to the position index registers - info->k054539_posreg_latch[ch][offs] = data; - return; - } - } - - else switch(offset) - { - case 0x13f: - pan = data >= 0x11 && data <= 0x1f ? data - 0x11 : 0x18 - 0x11; - if(info->intf.apan) - info->intf.apan(info->pantab[pan], info->pantab[0xe - pan]); - break; - - case 0x214: - if (latch) - { - for(ch=0; ch<8; ch++) - { - if(data & (1<k054539_posreg_latch[ch][0]; - regptr = regbase + (ch<<5) + 0xc; - - // update the chip at key-on - regptr[0] = posptr[0]; - regptr[1] = posptr[1]; - regptr[2] = posptr[2]; - - k054539_keyon(ch); - } - } - } - else - { - for(ch=0; ch<8; ch++) - if(data & (1<cur_zone[info->cur_ptr] = data; - info->cur_ptr++; - if(info->cur_ptr == info->cur_limit) - info->cur_ptr = 0; - break; - - case 0x22e: - info->cur_zone = - data == 0x80 ? info->ram : - info->rom + 0x20000*data; - info->cur_limit = data == 0x80 ? 0x4000 : 0x20000; - info->cur_ptr = 0; - break; - - default: - break; - } - - regbase[offset] = data; -} - -UINT8 K054539Read(INT32 chip, INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539Read called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K054539Read called with invalid chip %x\n"), chip); -#endif - - info = &Chips[chip]; - - switch(offset) { - case 0x22d: - if(info->regs[0x22f] & 0x10) { - UINT8 res = info->cur_zone[info->cur_ptr]; - info->cur_ptr++; - if(info->cur_ptr == info->cur_limit) - info->cur_ptr = 0; - return res; - } else - return 0; - - case 0x22c: - break; - - default: - break; - } - - return info->regs[offset]; -} - -void K054539Reset(INT32 chip) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539Reset called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K054539Reset called with invalid chip %x\n"), chip); -#endif - - info = &Chips[chip]; - INT32 data = info->regs[0x22e]; - info->cur_zone = - data == 0x80 ? info->ram : - info->rom + 0x20000*data; - info->cur_limit = data == 0x80 ? 0x4000 : 0x20000; -} - -static void k054539_init_chip(INT32 clock, UINT8 *rom, INT32 nLen) -{ - memset(info->regs, 0, sizeof(info->regs)); - memset(info->k054539_posreg_latch, 0, sizeof(info->k054539_posreg_latch)); - info->k054539_flags |= K054539_UPDATE_AT_KEYON; // make it default until proven otherwise - - // Real size of 0x4000, the addon is to simplify the reverb buffer computations - info->ram = (UINT8*)BurnMalloc(0x4000*2+clock/50*2); - info->reverb_pos = 0; - info->cur_ptr = 0; - memset(info->ram, 0, 0x4000*2+clock/50*2); - - info->rom = rom; - info->rom_size = nLen; - info->rom_mask = 0xffffffffU; - for (INT32 i = 0; i < 32; i++) { - if((1U<= info->rom_size) { - info->rom_mask = (1U<volume[BURN_SND_K054539_ROUTE_1] = 1.00; - info->volume[BURN_SND_K054539_ROUTE_2] = 1.00; - info->output_dir[BURN_SND_K054539_ROUTE_1] = BURN_SND_ROUTE_BOTH; - info->output_dir[BURN_SND_K054539_ROUTE_2] = BURN_SND_ROUTE_BOTH; - -// if(info->intf->irq) -// timer_pulse(ATTOTIME_IN_HZ(480), info, 0, k054539_irq); // 10% of usual clock... -} - -void K054539SetApanCallback(INT32 chip, void (*ApanCB)(double, double)) -{ - info = &Chips[chip]; - info->intf.apan = ApanCB; -} - -void K054539Init(INT32 chip, INT32 clock, UINT8 *rom, INT32 nLen) -{ - DebugSnd_K054539Initted = 1; - - INT32 i; - - memset(&Chips[chip], 0, sizeof(k054539_info)); - - info = &Chips[chip]; - - info->clock = clock; - - nUpdateStep = (INT32)(((float)clock / nBurnSoundRate) * 32768); - - for (i = 0; i < 8; i++) - info->k054539_gain[i] = 1.0; - - info->k054539_flags = K054539_RESET_FLAGS; - - for(i=0; i<256; i++) - info->voltab[i] = pow(10.0, (-36.0 * (double)i / (double)0x40) / 20.0) / 4.0; - - for(i=0; i<0xf; i++) - info->pantab[i] = sqrt((double)i) / sqrt((double)0xe); - - k054539_init_chip(clock, rom, nLen); - - if (soundbuf[0] == NULL) soundbuf[0] = (INT32*)BurnMalloc(nBurnSoundLen * sizeof(INT32)); - if (soundbuf[1] == NULL) soundbuf[1] = (INT32*)BurnMalloc(nBurnSoundLen * sizeof(INT32)); - - if (mixerbuf == NULL) mixerbuf = (INT16 *)BurnMalloc(clock * 2 * sizeof(INT16)); - - nNumChips = chip; -} - -void K054539SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539SetRoute called without init\n")); - if (chip >nNumChips) bprintf(PRINT_ERROR, _T("K054539SetRoute called with invalid chip %x\n"), chip); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("K054539SetRoute called with invalid index %i\n"), nIndex); -#endif - - info = &Chips[chip]; - - info->volume[nIndex] = nVolume; - info->output_dir[nIndex] = nRouteDir; -} - -void K054539Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539Exit called without init\n")); -#endif - - if (!DebugSnd_K054539Initted) return; - - BurnFree (soundbuf[0]); - BurnFree (soundbuf[1]); - soundbuf[0] = NULL; - soundbuf[1] = NULL; - - BurnFree (mixerbuf); - mixerbuf = NULL; - - for (INT32 i = 0; i < 2; i++) { - info = &Chips[i]; - BurnFree (info->ram); - } - - DebugSnd_K054539Initted = 0; - nNumChips = 0; -} - -void K054539Update(INT32 chip, INT16 *outputs, INT32 samples_len) //INT16 *pBuf, INT32 length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539Update called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K054539Update called with invalid chip %x\n"), chip); -#endif - - info = &Chips[chip]; -#define VOL_CAP 1.80 - - static const INT16 dpcm[16] = { - 0<<8, 1<<8, 4<<8, 9<<8, 16<<8, 25<<8, 36<<8, 49<<8, - -64<<8, -49<<8, -36<<8, -25<<8, -16<<8, -9<<8, -4<<8, -1<<8 - }; - - INT16 *rbase = (INT16 *)(info->ram); - INT32 reverb_pos = info->reverb_pos; - UINT8 *rom = info->rom; - UINT32 rom_mask = info->rom_mask; - - if(!(info->regs[0x22f] & 1)) - return; - - // re-sampleizer pt.1 - INT32 length = (((((48000 * 1000) / nBurnFPS) * samples_len) / nBurnSoundLen)) / 10; - INT16 *pBuf = mixerbuf; - - memset(mixerbuf, 0, nBurnSoundLen * 2 * sizeof(INT16)); - if (length > (info->clock * 100) / nBurnFPS) length = (info->clock * 100) / nBurnFPS; - - for(int sample = 0; sample < length; sample++) { - double lval, rval; - /*if(!(info->k054539_flags & K054539_DISABLE_REVERB)) - lval = rval = rbase[reverb_pos]; - else reverb broke, didn't work anyways. :dink:WILLFIX*/ - lval = rval = 0; - rbase[reverb_pos] = 0; - - for(int ch=0; ch<8; ch++) - if(info->regs[0x22c] & (1<regs + 0x20*ch; - unsigned char *base2 = info->regs + 0x200 + 0x2*ch; - struct k054539_channel *chan = info->channels + ch; - - int delta = base1[0x00] | (base1[0x01] << 8) | (base1[0x02] << 16); - - int vol = base1[0x03]; - - int bval = vol + base1[0x04]; - if (bval > 255) - bval = 255; - - int pan = base1[0x05]; - // DJ Main: 81-87 right, 88 middle, 89-8f left - if (pan >= 0x81 && pan <= 0x8f) - pan -= 0x81; - else if (pan >= 0x11 && pan <= 0x1f) - pan -= 0x11; - else - pan = 0x18 - 0x11; - - double cur_gain = info->k054539_gain[ch]; - - double lvol = info->voltab[vol] * info->pantab[pan] * cur_gain; - if (lvol > VOL_CAP) - lvol = VOL_CAP; - - double rvol = info->voltab[vol] * info->pantab[0xe - pan] * cur_gain; - if (rvol > VOL_CAP) - rvol = VOL_CAP; - - double rbvol= info->voltab[bval] * cur_gain / 2; - if (rbvol > VOL_CAP) - rbvol = VOL_CAP; - - int rdelta = (base1[6] | (base1[7] << 8)) >> 3; - rdelta = (rdelta + reverb_pos) & 0x3fff; - - int cur_pos = (base1[0x0c] | (base1[0x0d] << 8) | (base1[0x0e] << 16)) & rom_mask; - - int fdelta, pdelta; - if(base2[0] & 0x20) { - delta = -delta; - fdelta = +0x10000; - pdelta = -1; - } else { - fdelta = -0x10000; - pdelta = +1; - } - - int cur_pfrac, cur_val, cur_pval; - if(cur_pos != (INT32)chan->pos) { - chan->pos = cur_pos; - cur_pfrac = 0; - cur_val = 0; - cur_pval = 0; - } else { - cur_pfrac = chan->pfrac; - cur_val = chan->val; - cur_pval = chan->pval; - } - - switch(base2[0] & 0xc) { - case 0x0: { // 8bit pcm - cur_pfrac += delta; - while(cur_pfrac & ~0xffff) { - cur_pfrac += fdelta; - cur_pos += pdelta; - - cur_pval = cur_val; - cur_val = (INT16)(rom[cur_pos] << 8); - if(cur_val == (INT16)0x8000 && (base2[1] & 1)) { - cur_pos = (base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask; - cur_val = (INT16)(rom[cur_pos] << 8); - } - if(cur_val == (INT16)0x8000) { - k054539_keyoff(ch); - cur_val = 0; - break; - } - } - break; - } - - case 0x4: { // 16bit pcm lsb first - pdelta <<= 1; - - cur_pfrac += delta; - while(cur_pfrac & ~0xffff) { - cur_pfrac += fdelta; - cur_pos += pdelta; - - cur_pval = cur_val; - cur_val = (INT16)(rom[cur_pos] | rom[cur_pos+1]<<8); - if(cur_val == (INT16)0x8000 && (base2[1] & 1)) { - cur_pos = (base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask; - cur_val = (INT16)(rom[cur_pos] | rom[cur_pos+1]<<8); - } - if(cur_val == (INT16)0x8000) { - k054539_keyoff(ch); - cur_val = 0; - break; - } - } - break; - } - - case 0x8: { // 4bit dpcm - cur_pos <<= 1; - cur_pfrac <<= 1; - if(cur_pfrac & 0x10000) { - cur_pfrac &= 0xffff; - cur_pos |= 1; - } - - cur_pfrac += delta; - while(cur_pfrac & ~0xffff) { - cur_pfrac += fdelta; - cur_pos += pdelta; - - cur_pval = cur_val; - cur_val = rom[cur_pos>>1]; - if(cur_val == 0x88 && (base2[1] & 1)) { - cur_pos = ((base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask) << 1; - cur_val = rom[cur_pos>>1]; - } - if(cur_val == 0x88) { - k054539_keyoff(ch); - cur_val = 0; - break; - } - if(cur_pos & 1) - cur_val >>= 4; - else - cur_val &= 15; - cur_val = cur_pval + dpcm[cur_val]; - if(cur_val < -32768) - cur_val = -32768; - else if(cur_val > 32767) - cur_val = 32767; - } - - cur_pfrac >>= 1; - if(cur_pos & 1) - cur_pfrac |= 0x8000; - cur_pos >>= 1; - break; - } - default: - //LOG(("Unknown sample type %x for channel %d\n", base2[0] & 0xc, ch)); - break; - } - lval += cur_val * lvol; - rval += cur_val * rvol; - rbase[(rdelta + reverb_pos) & 0x1fff] += INT16(cur_val*rbvol); - - chan->pos = cur_pos; - chan->pfrac = cur_pfrac; - chan->pval = cur_pval; - chan->val = cur_val; - - if(k054539_regupdate()) { - base1[0x0c] = cur_pos & 0xff; - base1[0x0d] = cur_pos>> 8 & 0xff; - base1[0x0e] = cur_pos>>16 & 0xff; - } - } - reverb_pos = (reverb_pos + 1) & 0x1fff; - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((info->output_dir[BURN_SND_K054539_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(lval * info->volume[BURN_SND_K054539_ROUTE_1]); - } - if ((info->output_dir[BURN_SND_K054539_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(rval * info->volume[BURN_SND_K054539_ROUTE_1]); - } - - if ((info->output_dir[BURN_SND_K054539_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(lval * info->volume[BURN_SND_K054539_ROUTE_2]); - } - if ((info->output_dir[BURN_SND_K054539_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(rval * info->volume[BURN_SND_K054539_ROUTE_2]); - } - - pBuf[0] = BURN_SND_CLIP(nLeftSample); - pBuf[1] = BURN_SND_CLIP(nRightSample); - pBuf += 2; - } - - // re-sampleizer pt.2 - for (INT32 j = 0; j < samples_len; j++) - { - INT32 k = ((((48000000 / nBurnFPS) * j) / nBurnSoundLen)) / 10; - - outputs[0] = BURN_SND_CLIP(mixerbuf[k*2+0] + outputs[0]); - outputs[1] = BURN_SND_CLIP(mixerbuf[k*2+1] + outputs[1]); - outputs += 2; - } -} - -#if 0 -// OLD version. saving this incase I ever try to resurrect the broken "reverb" feature -dink -void K054539UpdateOLD(INT32 chip, INT16 *pBuf, INT32 length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539Update called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("K054539Update called with invalid chip %x\n"), chip); -#endif - - info = &Chips[chip]; -#define VOL_CAP 1.80 - - static const INT16 dpcm[16] = { - 0<<8, 1<<8, 4<<8, 9<<8, 16<<8, 25<<8, 36<<8, 49<<8, - -64<<8, -49<<8, -36<<8, -25<<8, -16<<8, -9<<8, -4<<8, -1<<8 - }; - - INT32 ch, reverb_pos; - INT16 *rbase; - UINT8 *samples; - UINT32 rom_mask; - - UINT8 *base1, *base2; - struct k054539_channel *chan; - INT32 *bufl, *bufr; - INT32 cur_pos, cur_pfrac, cur_val, cur_pval; - INT32 delta, rdelta, fdelta, pdelta; - INT32 vol, bval, pan, i; - - double gain, lvol, rvol, rbvol; - - reverb_pos = info->reverb_pos; - rbase = (INT16 *)(info->ram); - - INT32 **buffer = soundbuf; - - memset(buffer[0], 0, length*sizeof(*buffer[0])); - memset(buffer[1], 0, length*sizeof(*buffer[1])); - - samples = info->rom; - rom_mask = info->rom_mask; - - if(!(info->regs[0x22f] & 1)) return; - - info->reverb_pos = (reverb_pos + length) & 0x3fff; - - for(ch=0; ch<8; ch++) - if(info->regs[0x22c] & (1<regs + 0x20*ch; - base2 = info->regs + 0x200 + 0x2*ch; - chan = info->channels + ch; - delta = base1[0x00] | (base1[0x01] << 8) | (base1[0x02] << 16); - - vol = base1[0x03]; - - bval = vol + base1[0x04]; - if (bval > 255) bval = 255; - - pan = base1[0x05]; - // DJ Main: 81-87 right, 88 middle, 89-8f left - if (pan >= 0x81 && pan <= 0x8f) - pan -= 0x81; - else if (pan >= 0x11 && pan <= 0x1f) - pan -= 0x11; - else - pan = 0x18 - 0x11; - - gain = info->k054539_gain[ch]; - - lvol = info->voltab[vol] * info->pantab[pan] * gain; - if (lvol > VOL_CAP) lvol = VOL_CAP; - - rvol = info->voltab[vol] * info->pantab[0xe - pan] * gain; - if (rvol > VOL_CAP) rvol = VOL_CAP; - - rbvol= info->voltab[bval] * gain / 2; - if (rbvol > VOL_CAP) rbvol = VOL_CAP; - - rdelta = (base1[6] | (base1[7] << 8)) >> 3; -// rdelta = (reverb_pos + (int)((rdelta - 0x2000) * info->freq_ratio)) & 0x3fff; - rdelta = (INT32)(rdelta + reverb_pos) & 0x3fff; - - cur_pos = (base1[0x0c] | (base1[0x0d] << 8) | (base1[0x0e] << 16)) & rom_mask; - - bufl = buffer[0]; - bufr = buffer[1]; - - if(base2[0] & 0x20) { - delta = -delta; - fdelta = +0x10000; - pdelta = -1; - } else { - fdelta = -0x10000; - pdelta = +1; - } - - if(cur_pos != (INT32)chan->pos) { - chan->pos = cur_pos; - cur_pfrac = 0; - cur_val = 0; - cur_pval = 0; - } else { - cur_pfrac = chan->pfrac; - cur_val = chan->val; - cur_pval = chan->pval; - } - -#define UPDATE_CHANNELS \ - { \ - *bufl++ += (INT16)(cur_val*lvol); \ - *bufr++ += (INT16)(cur_val*rvol); \ - rbase[rdelta++] += (INT16)(cur_val*rbvol); \ - rdelta &= 0x3fff; \ - } - - switch(base2[0] & 0xc) { - case 0x0: { // 8bit pcm - for(i=0; i> 15; - - cur_pval = cur_val; - if (cur_pos > (INT32)info->rom_size) { - continue; - } - cur_val = (INT16)(samples[cur_pos] << 8); - if(cur_val == (INT16)0x8000) { - if(base2[1] & 1) { - cur_pos = (base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask; - cur_val = (INT16)(samples[cur_pos] << 8); - if(cur_val != (INT16)0x8000) - continue; - } - k054539_keyoff(ch); - goto end_channel_0; - } - } - - UPDATE_CHANNELS; - } - end_channel_0: - break; - } - case 0x4: { // 16bit pcm lsb first - pdelta <<= 1; - - for(i=0; i> 15; - - cur_pval = cur_val; - if (cur_pos+1 > (INT32)info->rom_size) { - continue; - } - cur_val = (INT16)(samples[cur_pos] | samples[cur_pos+1]<<8); - if(cur_val == (INT16)0x8000) { - if(base2[1] & 1) { - cur_pos = (base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask; - cur_val = (INT16)(samples[cur_pos] | samples[cur_pos+1]<<8); - if(cur_val != (INT16)0x8000) - continue; - } - k054539_keyoff(ch); - goto end_channel_4; - } - } - - UPDATE_CHANNELS; - } - end_channel_4: - break; - } - case 0x8: { // 4bit dpcm - cur_pos <<= 1; - cur_pfrac <<= 1; - if(cur_pfrac & 0x10000) { - cur_pfrac &= 0xffff; - cur_pos |= 1; - } - - for(i=0; i> 15; - - cur_pval = cur_val; - if (cur_pos > (INT32)info->rom_size) { - continue; - } - cur_val = samples[cur_pos>>1]; - if(cur_val == 0x88) { - if(base2[1] & 1) { - cur_pos = ((base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask) << 1; - cur_val = samples[cur_pos>>1]; - if(cur_val != 0x88) - goto next_iter; - } - k054539_keyoff(ch); - goto end_channel_8; - } - next_iter: - if(cur_pos & 1) - cur_val >>= 4; - else - cur_val &= 15; - cur_val = cur_pval + dpcm[cur_val]; - if(cur_val < -32768) - cur_val = -32768; - else if(cur_val > 32767) - cur_val = 32767; - } - - UPDATE_CHANNELS; - } - end_channel_8: - cur_pfrac >>= 1; - if(cur_pos & 1) - cur_pfrac |= 0x8000; - cur_pos >>= 1; - break; - } - default: - break; - } - chan->pos = cur_pos; - chan->pfrac = cur_pfrac; - chan->pval = cur_pval; - chan->val = cur_val; - if(k054539_regupdate()) { - base1[0x0c] = cur_pos & 0xff; - base1[0x0d] = cur_pos>> 8 & 0xff; - base1[0x0e] = cur_pos>>16 & 0xff; - } - } - - //* drivers should be given the option to disable reverb when things go terribly wrong - if(!(info->k054539_flags & K054539_DISABLE_REVERB)) - { - for(i=0; ioutput_dir[BURN_SND_K054539_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(buffer[0][f] * info->volume[BURN_SND_K054539_ROUTE_1]); - } - if ((info->output_dir[BURN_SND_K054539_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(buffer[0][f] * info->volume[BURN_SND_K054539_ROUTE_1]); - } - - if ((info->output_dir[BURN_SND_K054539_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(buffer[1][f] * info->volume[BURN_SND_K054539_ROUTE_2]); - } - if ((info->output_dir[BURN_SND_K054539_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(buffer[1][f] * info->volume[BURN_SND_K054539_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pBuf[0] = BURN_SND_CLIP(pBuf[0] + nLeftSample); - pBuf[1] = BURN_SND_CLIP(pBuf[1] + nRightSample); - pBuf += 2; - } - - if(reverb_pos + length > 0x4000) { - i = 0x4000 - reverb_pos; - memset(rbase + reverb_pos, 0, i*2); - memset(rbase, 0, (length-i)*2); - } else - memset(rbase + reverb_pos, 0, length*2); -} -#endif - -INT32 K054539Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugSnd_K054539Initted) bprintf(PRINT_ERROR, _T("K054539Scan called without init\n")); -#endif - - struct BurnArea ba; - char szName[32]; - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - for (INT32 i = 0; i < nNumChips+1; i++) { - info = &Chips[i]; - - sprintf(szName, "K054539 Latch %d", 0); - ba.Data = info->k054539_posreg_latch; - ba.nLen = 8*3; - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - - sprintf(szName, "K054539 Regs # %d", 0); - ba.Data = info->regs; - ba.nLen = 0x230; - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - - sprintf(szName, "K054539 Ram # %d", 0); - ba.Data = info->ram; - ba.nLen = 0x4000*2+info->clock/50*2; - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - - ba.Data = &info->channels; - ba.nLen = sizeof(k054539_channel) * 8; - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - - SCAN_VAR(info->k054539_flags); - SCAN_VAR(info->reverb_pos); - SCAN_VAR(info->cur_ptr); - SCAN_VAR(info->cur_limit); - - K054539Write(i, 0x22e, K054539Read(0, 0x22e)); - } - - return 0; -} diff --git a/jan/src/burn/snd/k054539.h b/jan/src/burn/snd/k054539.h deleted file mode 100644 index 984071681..000000000 --- a/jan/src/burn/snd/k054539.h +++ /dev/null @@ -1,27 +0,0 @@ -#define K054539_RESET_FLAGS 0 -#define K054539_REVERSE_STEREO 1 -#define K054539_DISABLE_REVERB 2 -#define K054539_UPDATE_AT_KEYON 4 - -void K054539_init_flags(INT32 chip, INT32 flags); -void K054539_set_gain(INT32 chip, INT32 channel, double gain); - -void K054539Update(INT32 chip, INT16 *pBuf, INT32 length); - -void K054539Write(INT32 chip, INT32 offset, UINT8 data); -UINT8 K054539Read(INT32 chip, INT32 offset); - -void K054539Reset(INT32 chip); -void K054539Init(INT32 chip, INT32 clock, UINT8 *rom, INT32 nLen); -void K054539SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void K054539SetApanCallback(INT32 chip, void (*ApanCB)(double, double)); -void K054539Exit(); - -INT32 K054539Scan(INT32 nAction); - -#define BURN_SND_K054539_ROUTE_1 0 -#define BURN_SND_K054539_ROUTE_2 1 - -#define K054539PCMSetAllRoutes(i, v, d) \ - K054539SetRoute(i, BURN_SND_K054539_ROUTE_1, v, d); \ - K054539SetRoute(i, BURN_SND_K054539_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/msm5205.cpp b/jan/src/burn/snd/msm5205.cpp deleted file mode 100644 index c0cc83673..000000000 --- a/jan/src/burn/snd/msm5205.cpp +++ /dev/null @@ -1,521 +0,0 @@ -// copyright-holders:Aaron Giles -/* - * streaming ADPCM driver - * by Aaron Giles - * - * Library to transcode from an ADPCM source to raw PCM. - * Written by Buffoni Mirko in 08/06/97 - * References: various sources and documents. - * - * HJB 08/31/98 - * modified to use an automatically selected oversampling factor - * for the current sample rate - * - * 01/06/99 - * separate MSM5205 emulator form adpcm.c and some fix - * - * 07/29/12 - * added basic support for the MSM6585 - */ - -#include "burnint.h" -#include "msm5205.h" -#include "math.h" - -#define MAX_MSM5205 2 - -static INT32 nNumChips = 0; - -struct _MSM5205_state -{ - INT32 data; /* next adpcm data */ - INT32 vclk; /* vclk signal (external mode) */ - INT32 reset; /* reset pin signal */ - INT32 prescaler; /* prescaler selector S1 and S2 */ - INT32 bitwidth; /* bit width selector -3B/4B */ - INT32 signal; /* current ADPCM signal */ - INT32 step; /* current ADPCM step */ - double volume; - INT32 output_dir; - - INT32 use_seperate_vols; /* support custom Taito panning hardware */ - double left_volume; - double right_volume; - - INT32 clock; /* clock rate */ - - void (*vclk_callback)(); /* VCLK callback */ - INT32 (*stream_sync)(INT32); - INT32 select; /* prescaler / bit width selector */ - INT32 bAdd; - INT32 streampos; - - INT32 diff_lookup[49*16]; -}; - -static INT16 *stream[MAX_MSM5205]; -static struct _MSM5205_state chips[MAX_MSM5205]; -static struct _MSM5205_state *voice; - -static void MSM5205_playmode(INT32 chip, INT32 select); - -static const INT32 index_shift[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; - -static UINT8 *scanline_table = NULL; - -static void ComputeTables(INT32 chip) -{ - voice = &chips[chip]; - - /* nibble to bit map */ - static const INT32 nbl2bit[16][4] = - { - { 1, 0, 0, 0}, { 1, 0, 0, 1}, { 1, 0, 1, 0}, { 1, 0, 1, 1}, - { 1, 1, 0, 0}, { 1, 1, 0, 1}, { 1, 1, 1, 0}, { 1, 1, 1, 1}, - {-1, 0, 0, 0}, {-1, 0, 0, 1}, {-1, 0, 1, 0}, {-1, 0, 1, 1}, - {-1, 1, 0, 0}, {-1, 1, 0, 1}, {-1, 1, 1, 0}, {-1, 1, 1, 1} - }; - - INT32 step, nib; - - /* loop over all possible steps */ - for (step = 0; step <= 48; step++) - { - /* compute the step value */ - INT32 stepval = (INT32)(floor (16.0 * pow (11.0 / 10.0, (double)step))); - - /* loop over all nibbles and compute the difference */ - for (nib = 0; nib < 16; nib++) - { - voice->diff_lookup[step*16 + nib] = nbl2bit[nib][0] * - (stepval * nbl2bit[nib][1] + - stepval/2 * nbl2bit[nib][2] + - stepval/4 * nbl2bit[nib][3] + - stepval/8); - } - } -} - -static void MSM5205_playmode(INT32 , INT32 select) -{ - static const INT32 prescaler_table[2][4] = { {96,48,64,0}, {160, 40, 80, 20} }; - INT32 prescaler = prescaler_table[(select >> 3) & 1][select & 3]; - INT32 bitwidth = (select & 4) ? 4 : 3; - - if( voice->prescaler != prescaler ) - { - voice->prescaler = prescaler; - - if( prescaler ) - { -// clock * prescaler -// 384000 / 48 -> 8000 - -// if cpu is 4000000 (4mhz) -// check MSM5205 every 4000000 / 8000 -> 500 cycles - -// attotime period = attotime_mul(ATTOTIME_IN_HZ(voice->clock), prescaler); -// timer_adjust_periodic(voice->timer, period, 0, period); - } - } - - if( voice->bitwidth != bitwidth ) - { - voice->bitwidth = bitwidth; - } -} - -static void MSM5205StreamUpdate(INT32 chip) -{ - voice = &chips[chip]; - - UINT32 len = voice->stream_sync((nBurnSoundLen * nBurnFPS) / 100); - if (len > (UINT32)nBurnSoundLen) len = nBurnSoundLen; - UINT32 pos = voice->streampos; - - if (pos >= len) return; - - len -= pos; - voice->streampos = pos + len; - - if (pos == 0) { - memset (stream[chip], 0, nBurnSoundLen * sizeof(INT16)); - } - - { - INT16 *buffer = stream[chip]; - buffer += pos; - - if(voice->signal) - { - INT32 i = 0; - - INT32 volval = (INT32)((voice->signal * 16) * voice->volume); - INT16 val = volval; - while (len) - { - buffer[i] = val; - len--; i++; - } - } else { - memset (buffer, 0, sizeof(INT16) * len); - } - } -} - -static void MSM5205_vclk_callback(INT32 chip) -{ - voice = &chips[chip]; - - if(voice->vclk_callback)(*voice->vclk_callback)(); - - INT32 new_signal; - - if(voice->reset) - { - new_signal = 0; - voice->step = 0; - } - else - { - INT32 val = voice->data; - new_signal = voice->signal + voice->diff_lookup[voice->step * 16 + (val & 15)]; - if (new_signal > 2047) new_signal = 2047; - else if (new_signal < -2048) new_signal = -2048; - voice->step += index_shift[val & 7]; - if (voice->step > 48) voice->step = 48; - else if (voice->step < 0) voice->step = 0; - } - /* update when signal changed */ - if( voice->signal != new_signal) - { - MSM5205StreamUpdate(chip); - voice->signal = new_signal; - } -} - -void MSM5205Render(INT32 chip, INT16 *buffer, INT32 len) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205Render called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205Render called with invalid chip %x\n"), chip); -#endif - - voice = &chips[chip]; - INT16 *source = stream[chip]; - - MSM5205StreamUpdate(chip); - - voice->streampos = 0; - - for (INT32 i = 0; i < len; i++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if (voice->use_seperate_vols) { - nLeftSample += (INT32)(source[i] * voice->left_volume); - nRightSample += (INT32)(source[i] * voice->right_volume); - } else { - if ((voice->output_dir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += source[i]; - } - if ((voice->output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += source[i]; - } - } - - source[i] = 0; // clear dac - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (voice->bAdd) { - buffer[0] = BURN_SND_CLIP(buffer[0] + nLeftSample); - buffer[1] = BURN_SND_CLIP(buffer[1] + nRightSample); - } else { - buffer[0] = nLeftSample; - buffer[1] = nRightSample; - } - buffer += 2; - } -} - -void MSM5205Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205Reset called without init\n")); -#endif - - for (INT32 chip = 0; chip < MAX_MSM5205; chip++) - { - voice = &chips[chip]; - - if (stream[chip] == NULL) continue; - - voice->data = 0; - voice->vclk = 0; - voice->reset = 0; - voice->signal = 0; - voice->step = 0; - - MSM5205_playmode(chip,voice->select); - voice->streampos = 0; - } -} - -void MSM5205Init(INT32 chip, INT32 (*stream_sync)(INT32), INT32 clock, void (*vclk_callback)(), INT32 select, INT32 bAdd) -{ - DebugSnd_MSM5205Initted = 1; - - voice = &chips[chip]; - - memset (voice, 0, sizeof(_MSM5205_state)); - - voice->stream_sync = stream_sync; - voice->vclk_callback = vclk_callback; - voice->select = select; - voice->clock = clock; - voice->bAdd = bAdd; - voice->volume = 1.00; - voice->output_dir = BURN_SND_ROUTE_BOTH; - - voice->left_volume = 1.00; - voice->right_volume = 1.00; - voice->use_seperate_vols = 0; - - float FPSRatio = (float)(6000 - nBurnFPS) / 6000; - INT32 nSoundLen = nBurnSoundLen + (INT32)((float)nBurnSoundLen * FPSRatio) + 1; - stream[chip] = (INT16*)BurnMalloc(nSoundLen * sizeof(INT16)); - - if (chip == 0) - scanline_table = (UINT8*)BurnMalloc(256 * 2); // just incase. - - ComputeTables (chip); - - nNumChips = chip; -} - -void MSM5205SetRoute(INT32 chip, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205SetRoute called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205SetRoute called with invalid chip %x\n"), chip); -#endif - - voice = &chips[chip]; - voice->volume = nVolume; - voice->output_dir = nRouteDir; -} - -void MSM5205SetLeftVolume(INT32 chip, double nLeftVolume) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205SetLeftVolume called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205SetLeftVolume called with invalid chip %x\n"), chip); -#endif - - voice = &chips[chip]; - voice->left_volume = nLeftVolume; -} - -void MSM5205SetRightVolume(INT32 chip, double nRightVolume) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205SetRightVolume called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205SetRightVolume called with invalid chip %x\n"), chip); -#endif - - voice = &chips[chip]; - voice->left_volume = nRightVolume; -} - -void MSM5205SetSeperateVolumes(INT32 chip, INT32 state) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205SetSeperateVolumes called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205SetSeperateVolumes called with invalid chip %x\n"), chip); -#endif - - voice = &chips[chip]; - voice->use_seperate_vols = state; -} - -void MSM5205Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205Exit called without init\n")); -#endif - - if (!DebugSnd_MSM5205Initted) return; - - for (INT32 chip = 0; chip < MAX_MSM5205; chip++) - { - voice = &chips[chip]; - - if (stream[chip] == NULL) continue; - - memset (voice, 0, sizeof(_MSM5205_state)); - - BurnFree (stream[chip]); - } - - BurnFree(scanline_table); - scanline_table = NULL; - - DebugSnd_MSM5205Initted = 0; - nNumChips = 0; -} - -void MSM5205VCLKWrite(INT32 chip, INT32 vclk) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205VCLKWrite called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205VCLKWrite called with invalid chip %x\n"), chip); -#endif - - voice = &chips[chip]; - - if (voice->prescaler == 0) - { - if( voice->vclk != vclk) - { - voice->vclk = vclk; - if( !vclk ) MSM5205_vclk_callback(chip); - } - } -} - -void MSM5205ResetWrite(INT32 chip, INT32 reset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205ResetWrite called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205ResetWrite called with invalid chip %x\n"), chip); -#endif - - voice = &chips[chip]; - voice->reset = reset; -} - -void MSM5205DataWrite(INT32 chip, INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205DataWrite called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205DataWrite called with invalid chip %x\n"), chip); -#endif - - voice = &chips[chip]; - - if( voice->bitwidth == 4) - voice->data = data & 0x0f; - else - voice->data = (data & 0x07)<<1; -} - -void MSM5205PlaymodeWrite(INT32 chip, INT32 select) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205PlaymodeWrite called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205PlaymodeWrite called with invalid chip %x\n"), chip); -#endif - - voice = &chips[chip]; - MSM5205_playmode(chip,select); -} - - -void MSM5205NewFrame(INT32 chip, INT32 cpu_speed, INT32 interleave) -{ - INT32 MSMCalcdInterleave = MSM5205CalcInterleave(chip, cpu_speed); - INT32 LastIdx = -1; - INT32 Idx = 0; - - for (INT32 i = 0; i < interleave; i++) - { - Idx = (INT32)round(((double)MSMCalcdInterleave / (double)interleave) * (double)i); - - if (Idx != LastIdx) { - scanline_table[i] = 1; - } else scanline_table[i] = 0; - LastIdx = Idx; - } -} - -void MSM5205UpdateScanline(INT32 scanline) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205UpdateScanline called without init\n")); -#endif - if (scanline_table[scanline]) { - MSM5205Update(); - } -} - -void MSM5205Update() -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205Update called without init\n")); -#endif - - for (INT32 chip = 0; chip < MAX_MSM5205; chip++) - { - voice = &chips[chip]; - - if (voice->prescaler) { - MSM5205_vclk_callback(chip); - } else { - if (stream[chip]) { - MSM5205StreamUpdate(chip); - } - } - } -} - -// see MSM5205_playmode for a more in-depth explanation of this -INT32 MSM5205CalcInterleave(INT32 chip, INT32 cpu_speed) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205CalcInterleave called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("MSM5205CalcInterleave called with invalid chip %x\n"), chip); -#endif - - static const INT32 table[2][4] = { {96, 48, 64, 0}, {160, 40, 80, 20} }; - - voice = &chips[chip]; - - if ((voice->select & 3) == 3) { - return 133; // (usually...) - } - - INT32 ret = cpu_speed / (cpu_speed / (voice->clock / table[(voice->select >> 3) & 1][voice->select & 3])); - - return ret / (nBurnFPS / 100); -} - -void MSM5205Scan(INT32 nAction, INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5205Initted) bprintf(PRINT_ERROR, _T("MSM5205Scan called without init\n")); -#endif - - if (pnMin != NULL) { - *pnMin = 0x029708; - } - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 chip = 0; chip < MAX_MSM5205; chip++) { - voice = &chips[chip]; - - SCAN_VAR(voice->data); - - SCAN_VAR(voice->vclk); - SCAN_VAR(voice->reset); - SCAN_VAR(voice->prescaler); - SCAN_VAR(voice->bitwidth); - SCAN_VAR(voice->signal); - SCAN_VAR(voice->step); - SCAN_VAR(voice->volume); - SCAN_VAR(voice->clock); - SCAN_VAR(voice->select); - SCAN_VAR(voice->streampos); - } - } -} diff --git a/jan/src/burn/snd/msm5205.h b/jan/src/burn/snd/msm5205.h deleted file mode 100644 index ef2974174..000000000 --- a/jan/src/burn/snd/msm5205.h +++ /dev/null @@ -1,52 +0,0 @@ - -#define MSM5205_S96_3B 0 /* prescaler 1/96(4KHz) , data 3bit */ -#define MSM5205_S48_3B 1 /* prescaler 1/48(8KHz) , data 3bit */ -#define MSM5205_S64_3B 2 /* prescaler 1/64(6KHz) , data 3bit */ -#define MSM5205_SEX_3B 3 /* VCLK slave mode , data 3bit */ - -#define MSM5205_S96_4B 4 /* prescaler 1/96(4KHz) , data 4bit */ -#define MSM5205_S48_4B 5 /* prescaler 1/48(8KHz) , data 4bit */ -#define MSM5205_S64_4B 6 /* prescaler 1/64(6KHz) , data 4bit */ -#define MSM5205_SEX_4B 7 /* VCLK slave mode , data 4bit */ - -#define MSM6585_S160 (4+8) /* prescaler 1/160(4KHz), data 4bit */ -#define MSM6585_S40 (5+8) /* prescaler 1/40(16KHz), data 4bit */ -#define MSM6585_S80 (6+8) /* prescaler 1/80 (8KHz), data 4bit */ -#define MSM6585_S20 (7+8) /* prescaler 1/20(32KHz), data 4bit */ - -void MSM5205ResetWrite(INT32 chip, INT32 reset); -void MSM5205DataWrite(INT32 chip, INT32 data); -void MSM5205VCLKWrite(INT32 chip, INT32 reset); -void MSM5205PlaymodeWrite(INT32 chip, INT32 select); - -void MSM5205Init(INT32 chip, INT32 (*stream_sync)(INT32), INT32 clock, void (*vclk_callback)(), INT32 select, INT32 bAdd); -void MSM5205SetRoute(INT32 chip, double nVolume, INT32 nRouteDir); -void MSM5205SetLeftVolume(INT32 chip, double nLeftVolume); -void MSM5205SetRightVolume(INT32 chip, double nRightVolume); -void MSM5205SetSeperateVolumes(INT32 chip, INT32 state); -void MSM5205Reset(); - -/* - All MSM5205 sounds need to be rendered in one call - or the data will likely be output badly -*/ - -void MSM5205Render(INT32 chip, INT16 *buffer, INT32 len); -void MSM5205Exit(); - -void MSM5205Scan(INT32 nAction, INT32 *pnMin); - -/* - MSM5205CalcInterleave is used to calculate after how - many cycles that the sound cpu has ran does - MSM5205Update need to be called. It returns how many - slices must be made of the sound cpu's cycles -*/ - -INT32 MSM5205CalcInterleave(INT32 chip, INT32 cpu_speed); -void MSM5205Update(); - -// 2016 version of the above. see d_taitol.cpp for example -void MSM5205NewFrame(INT32 chip, INT32 cpu_speed, INT32 interleave); -void MSM5205UpdateScanline(INT32 scanline); - diff --git a/jan/src/burn/snd/msm5232.cpp b/jan/src/burn/snd/msm5232.cpp deleted file mode 100644 index 9900fae51..000000000 --- a/jan/src/burn/snd/msm5232.cpp +++ /dev/null @@ -1,814 +0,0 @@ -// Based on MAME sources by Jarek Burczynski, Hiromitsu Shioya - -#include "burnint.h" -#include "msm5232.h" - -/* - OKI MSM5232RS - 8 channel tone generator -*/ - -#define CLOCK_RATE_DIVIDER 16 - -struct VOICE { - UINT8 mode; - - INT32 TG_count_period; - INT32 TG_count; - - UINT8 TG_cnt; /* 7 bits binary counter (frequency output) */ - UINT8 TG_out16; /* bit number (of TG_cnt) for 16' output */ - UINT8 TG_out8; /* bit number (of TG_cnt) for 8' output */ - UINT8 TG_out4; /* bit number (of TG_cnt) for 4' output */ - UINT8 TG_out2; /* bit number (of TG_cnt) for 2' output */ - - INT32 egvol; - INT32 eg_sect; - INT32 counter; - INT32 eg; - - UINT8 eg_arm; /* attack/release mode */ - - double ar_rate; - double dr_rate; - double rr_rate; - - INT32 pitch; /* current pitch data */ - - INT32 GF; -}; - -static VOICE m_voi[8]; -static UINT32 m_EN_out16[2]; /* enable 16' output masks for both groups (0-disabled ; ~0 -enabled) */ -static UINT32 m_EN_out8[2]; /* enable 8' output masks */ -static UINT32 m_EN_out4[2]; /* enable 4' output masks */ -static UINT32 m_EN_out2[2]; /* enable 2' output masks */ -static INT32 m_noise_cnt; -static INT32 m_noise_step; -static INT32 m_noise_rng; -static INT32 m_noise_clocks; /* number of the noise_rng (output) level changes */ -static UINT32 m_UpdateStep; - -static double volume[11]; - -/* rate tables */ -static double m_ar_tbl[8]; -static double m_dr_tbl[16]; - -static UINT8 m_control1; -static UINT8 m_control2; - -static INT32 m_gate; /* current state of the GATE output */ - -static INT32 m_add; -static INT32 m_chip_clock; /* chip clock in Hz */ -static INT32 m_rate; /* sample rate in Hz */ - -static double m_external_capacity[8]; /* in Farads, eg 0.39e-6 = 0.36 uF (microFarads) */ -static void (*m_gate_handler_cb)(INT32 state) = NULL;/* callback called when the GATE output pin changes state */ - -static INT32 *sound_buffer[11]; - -//------------------------------------------------- -// set gate handler -//------------------------------------------------- - -static void gate_update() -{ - INT32 new_state = (m_control2 & 0x20) ? m_voi[7].GF : 0; - - if (m_gate != new_state && m_gate_handler_cb) - { - m_gate = new_state; - m_gate_handler_cb(new_state); - } -} - -void MSM5232SetGateCallback(void (*callback)(INT32)) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5232Initted) bprintf(PRINT_ERROR, _T("MSM5232SetGateCallback called without init\n")); -#endif - - m_gate_handler_cb = callback; -} - - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void MSM5232Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5232Initted) bprintf(PRINT_ERROR, _T("MSM5232Reset called without init\n")); -#endif - - INT32 i; - - for (i=0; i<8; i++) - { - MSM5232Write(i,0x80); - MSM5232Write(i,0x00); - } - m_noise_cnt = 0; - m_noise_rng = 1; - m_noise_clocks = 0; - - m_control1 = 0; - m_EN_out16[0] = 0; - m_EN_out8[0] = 0; - m_EN_out4[0] = 0; - m_EN_out2[0] = 0; - - m_control2 = 0; - m_EN_out16[1] = 0; - m_EN_out8[1] = 0; - m_EN_out4[1] = 0; - m_EN_out2[1] = 0; - - gate_update(); -} - -//------------------------------------------------- - -void MSM5232SetCapacitors(double cap1, double cap2, double cap3, double cap4, double cap5, double cap6, double cap7, double cap8) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5232Initted) bprintf(PRINT_ERROR, _T("MSM5232SetCapacitors called without init\n")); -#endif - - m_external_capacity[0] = cap1; - m_external_capacity[1] = cap2; - m_external_capacity[2] = cap3; - m_external_capacity[3] = cap4; - m_external_capacity[4] = cap5; - m_external_capacity[5] = cap6; - m_external_capacity[6] = cap7; - m_external_capacity[7] = cap8; -} - - -/* Default chip clock is 2119040 Hz */ -/* At this clock chip generates exactly 440.0 Hz signal on 8' output when pitch data=0x21 */ - -/* ROM table to convert from pitch data into data for programmable counter and binary counter */ -/* Chip has 88x12bits ROM (addressing (in hex) from 0x00 to 0x57) */ -#define ROM(counter,bindiv) (counter|(bindiv<<9)) - -static const UINT16 MSM5232_ROM[88]={ -/* higher values are Programmable Counter data (9 bits) */ -/* lesser values are Binary Counter shift data (3 bits) */ - -/* 0 */ ROM (506, 7), - -/* 1 */ ROM (478, 7),/* 2 */ ROM (451, 7),/* 3 */ ROM (426, 7),/* 4 */ ROM (402, 7), -/* 5 */ ROM (379, 7),/* 6 */ ROM (358, 7),/* 7 */ ROM (338, 7),/* 8 */ ROM (319, 7), -/* 9 */ ROM (301, 7),/* A */ ROM (284, 7),/* B */ ROM (268, 7),/* C */ ROM (253, 7), - -/* D */ ROM (478, 6),/* E */ ROM (451, 6),/* F */ ROM (426, 6),/*10 */ ROM (402, 6), -/*11 */ ROM (379, 6),/*12 */ ROM (358, 6),/*13 */ ROM (338, 6),/*14 */ ROM (319, 6), -/*15 */ ROM (301, 6),/*16 */ ROM (284, 6),/*17 */ ROM (268, 6),/*18 */ ROM (253, 6), - -/*19 */ ROM (478, 5),/*1A */ ROM (451, 5),/*1B */ ROM (426, 5),/*1C */ ROM (402, 5), -/*1D */ ROM (379, 5),/*1E */ ROM (358, 5),/*1F */ ROM (338, 5),/*20 */ ROM (319, 5), -/*21 */ ROM (301, 5),/*22 */ ROM (284, 5),/*23 */ ROM (268, 5),/*24 */ ROM (253, 5), - -/*25 */ ROM (478, 4),/*26 */ ROM (451, 4),/*27 */ ROM (426, 4),/*28 */ ROM (402, 4), -/*29 */ ROM (379, 4),/*2A */ ROM (358, 4),/*2B */ ROM (338, 4),/*2C */ ROM (319, 4), -/*2D */ ROM (301, 4),/*2E */ ROM (284, 4),/*2F */ ROM (268, 4),/*30 */ ROM (253, 4), - -/*31 */ ROM (478, 3),/*32 */ ROM (451, 3),/*33 */ ROM (426, 3),/*34 */ ROM (402, 3), -/*35 */ ROM (379, 3),/*36 */ ROM (358, 3),/*37 */ ROM (338, 3),/*38 */ ROM (319, 3), -/*39 */ ROM (301, 3),/*3A */ ROM (284, 3),/*3B */ ROM (268, 3),/*3C */ ROM (253, 3), - -/*3D */ ROM (478, 2),/*3E */ ROM (451, 2),/*3F */ ROM (426, 2),/*40 */ ROM (402, 2), -/*41 */ ROM (379, 2),/*42 */ ROM (358, 2),/*43 */ ROM (338, 2),/*44 */ ROM (319, 2), -/*45 */ ROM (301, 2),/*46 */ ROM (284, 2),/*47 */ ROM (268, 2),/*48 */ ROM (253, 2), - -/*49 */ ROM (478, 1),/*4A */ ROM (451, 1),/*4B */ ROM (426, 1),/*4C */ ROM (402, 1), -/*4D */ ROM (379, 1),/*4E */ ROM (358, 1),/*4F */ ROM (338, 1),/*50 */ ROM (319, 1), -/*51 */ ROM (301, 1),/*52 */ ROM (284, 1),/*53 */ ROM (268, 1),/*54 */ ROM (253, 1), - -/*55 */ ROM (253, 1),/*56 */ ROM (253, 1), - -/*57 */ ROM (13, 7) -}; -#undef ROM - - -#define STEP_SH (16) /* step calculations accuracy */ - -/* - * resistance values are guesswork, default capacity is mentioned in the datasheets - * - * charges external capacitor (default is 0.39uF) via R51 - * in approx. 5*1400 * 0.39e-6 - * - * external capacitor is discharged through R52 - * in approx. 5*28750 * 0.39e-6 - */ - - -#define R51 1400 /* charge resistance */ -#define R52 28750 /* discharge resistance */ - -static void init_tables() -{ - INT32 i; - double scale; - - /* sample rate = chip clock !!! But : */ - /* highest possible frequency is chipclock/13/16 (pitch data=0x57) */ - /* at 2MHz : 2000000/13/16 = 9615 Hz */ - - i = (INT32)(((double)(1< 0x0d) - return; - - if (offset < 0x08) /* pitch */ - { - int ch = offset&7; - - m_voi[ch].GF = ((data&0x80)>>7); - if (ch == 7) - gate_update(); - - if(data&0x80) - { - if(data >= 0xd8) - { - /*if ((data&0x7f) != 0x5f) logerror("MSM5232: WRONG PITCH CODE = %2x\n",data&0x7f);*/ - m_voi[ch].mode = 1; /* noise mode */ - m_voi[ch].eg_sect = 0; /* Key On */ - } - else - { - if ( m_voi[ch].pitch != (data&0x7f) ) - { - int n; - UINT16 pg; - - m_voi[ch].pitch = data&0x7f; - - pg = MSM5232_ROM[ data&0x7f ]; - - m_voi[ch].TG_count_period = (pg & 0x1ff) * m_UpdateStep / 2; - - n = (pg>>9) & 7; /* n = bit number for 16' output */ - m_voi[ch].TG_out16 = 1<0)? n-1: 0; - m_voi[ch].TG_out8 = 1<0)? n-1: 0; - m_voi[ch].TG_out4 = 1<0)? n-1: 0; - m_voi[ch].TG_out2 = 1< go to release */ - else /* arm = 1 */ - m_voi[ch].eg_sect = 1; /* Key Off -> go to decay */ - } - } - else - { - INT32 i; - switch(offset) - { - case 0x08: /* group1 attack */ - for (i=0; i<4; i++) - m_voi[i].ar_rate = m_ar_tbl[data&0x7] * m_external_capacity[i]; - break; - - case 0x09: /* group2 attack */ - for (i=0; i<4; i++) - m_voi[i+4].ar_rate = m_ar_tbl[data&0x7] * m_external_capacity[i+4]; - break; - - case 0x0a: /* group1 decay */ - for (i=0; i<4; i++) - m_voi[i].dr_rate = m_dr_tbl[data&0xf] * m_external_capacity[i]; - break; - - case 0x0b: /* group2 decay */ - for (i=0; i<4; i++) - m_voi[i+4].dr_rate = m_dr_tbl[data&0xf] * m_external_capacity[i+4]; - break; - - case 0x0c: /* group1 control */ - m_control1 = data; - - for (i=0; i<4; i++) - m_voi[i].eg_arm = data&0x10; - - m_EN_out16[0] = (data&1) ? ~0:0; - m_EN_out8[0] = (data&2) ? ~0:0; - m_EN_out4[0] = (data&4) ? ~0:0; - m_EN_out2[0] = (data&8) ? ~0:0; - - break; - - case 0x0d: /* group2 control */ - m_control2 = data; - gate_update(); - - for (i=0; i<4; i++) - m_voi[i+4].eg_arm = data&0x10; - - m_EN_out16[1] = (data&1) ? ~0:0; - m_EN_out8[1] = (data&2) ? ~0:0; - m_EN_out4[1] = (data&4) ? ~0:0; - m_EN_out2[1] = (data&8) ? ~0:0; - - break; - } - } -} - - - -#define VMIN 0 -#define VMAX 32768 - -static void EG_voices_advance() -{ - VOICE *voi = &m_voi[0]; - INT32 samplerate = m_rate; - INT32 i; - - i = 8; - do - { - switch(voi->eg_sect) - { - case 0: /* attack */ - - /* capacitor charge */ - if (voi->eg < VMAX) - { - voi->counter -= (INT32)((VMAX - voi->eg) / voi->ar_rate); - if ( voi->counter <= 0 ) - { - INT32 n = -voi->counter / samplerate + 1; - voi->counter += n * samplerate; - if ( (voi->eg += n) > VMAX ) - voi->eg = VMAX; - } - } - - /* when ARM=0, EG switches to decay as soon as cap is charged to VT (EG inversion voltage; about 80% of MAX) */ - if (!voi->eg_arm) - { - if(voi->eg >= VMAX * 80/100 ) - { - voi->eg_sect = 1; - } - } - else - /* ARM=1 */ - { - /* when ARM=1, EG stays at maximum until key off */ - } - - voi->egvol = voi->eg / 16; /*32768/16 = 2048 max*/ - - break; - - case 1: /* decay */ - - /* capacitor discharge */ - if (voi->eg > VMIN) - { - voi->counter -= (INT32)((voi->eg - VMIN) / voi->dr_rate); - if ( voi->counter <= 0 ) - { - INT32 n = -voi->counter / samplerate + 1; - voi->counter += n * samplerate; - if ( (voi->eg -= n) < VMIN ) - voi->eg = VMIN; - } - } - else /* voi->eg <= VMIN */ - { - voi->eg_sect =-1; - } - - voi->egvol = voi->eg / 16; /*32768/16 = 2048 max*/ - - break; - - case 2: /* release */ - - /* capacitor discharge */ - if (voi->eg > VMIN) - { - voi->counter -= (INT32)((voi->eg - VMIN) / voi->rr_rate); - if ( voi->counter <= 0 ) - { - INT32 n = -voi->counter / samplerate + 1; - voi->counter += n * samplerate; - if ( (voi->eg -= n) < VMIN ) - voi->eg = VMIN; - } - } - else /* voi->eg <= VMIN */ - { - voi->eg_sect =-1; - } - - voi->egvol = voi->eg / 16; /*32768/16 = 2048 max*/ - - break; - - default: - break; - } - - voi++; - i--; - } while (i>0); - -} - -static INT32 o2,o4,o8,o16,solo8,solo16; - -static void TG_group_advance(INT32 groupidx) -{ - VOICE *voi = &m_voi[groupidx*4]; - INT32 i; - - o2 = o4 = o8 = o16 = solo8 = solo16 = 0; - - i=4; - do - { - INT32 out2, out4, out8, out16; - - out2 = out4 = out8 = out16 = 0; - - if (voi->mode==0) /* generate square tone */ - { - INT32 left = 1<TG_cnt&voi->TG_out16) out16+=voi->TG_count; - if (voi->TG_cnt&voi->TG_out8) out8 +=voi->TG_count; - if (voi->TG_cnt&voi->TG_out4) out4 +=voi->TG_count; - if (voi->TG_cnt&voi->TG_out2) out2 +=voi->TG_count; - - voi->TG_count -= nextevent; - - while (voi->TG_count <= 0) - { - voi->TG_count += voi->TG_count_period; - voi->TG_cnt++; - if (voi->TG_cnt&voi->TG_out16) out16+=voi->TG_count_period; - if (voi->TG_cnt&voi->TG_out8 ) out8 +=voi->TG_count_period; - if (voi->TG_cnt&voi->TG_out4 ) out4 +=voi->TG_count_period; - if (voi->TG_cnt&voi->TG_out2 ) out2 +=voi->TG_count_period; - - if (voi->TG_count > 0) - break; - - voi->TG_count += voi->TG_count_period; - voi->TG_cnt++; - if (voi->TG_cnt&voi->TG_out16) out16+=voi->TG_count_period; - if (voi->TG_cnt&voi->TG_out8 ) out8 +=voi->TG_count_period; - if (voi->TG_cnt&voi->TG_out4 ) out4 +=voi->TG_count_period; - if (voi->TG_cnt&voi->TG_out2 ) out2 +=voi->TG_count_period; - } - if (voi->TG_cnt&voi->TG_out16) out16-=voi->TG_count; - if (voi->TG_cnt&voi->TG_out8 ) out8 -=voi->TG_count; - if (voi->TG_cnt&voi->TG_out4 ) out4 -=voi->TG_count; - if (voi->TG_cnt&voi->TG_out2 ) out2 -=voi->TG_count; - - left -=nextevent; - - }while (left>0); - } - else /* generate noise */ - { - if (m_noise_clocks&8) out16+=(1<egvol) >> STEP_SH; - o8 += ( (out8 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH; - o4 += ( (out4 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH; - o2 += ( (out2 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH; - - if (i == 1 && groupidx == 1) - { - solo16 += ( (out16-(1<<(STEP_SH-1))) << 11) >> STEP_SH; - solo8 += ( (out8 -(1<<(STEP_SH-1))) << 11) >> STEP_SH; - } - - voi++; - i--; - }while (i>0); - - /* cut off disabled output lines */ - o16 &= m_EN_out16[groupidx]; - o8 &= m_EN_out8 [groupidx]; - o4 &= m_EN_out4 [groupidx]; - o2 &= m_EN_out2 [groupidx]; -} - -void MSM5232SetClock(INT32 clock) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5232Initted) bprintf(PRINT_ERROR, _T("MSM5232SetClock called without init\n")); -#endif - - if (m_chip_clock != clock) - { - m_rate = ((clock/CLOCK_RATE_DIVIDER) * 100) / nBurnFPS; - m_chip_clock = (clock * 100) / nBurnFPS; - init_tables(); - for (INT32 j = 0; j < 11; j++) { - if (sound_buffer[j]) { - BurnFree(sound_buffer[j]); - } - sound_buffer[j] = (INT32*)BurnMalloc(m_rate * 2); - } - } -} - - -//------------------------------------------------- -// sound_stream_update - handle a stream update -//------------------------------------------------- - -void MSM5232Update(INT16 *buffer, INT32 samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5232Initted) bprintf(PRINT_ERROR, _T("MSM5232Update called without init\n")); -#endif - - INT32 *buf1 = sound_buffer[0]; - INT32 *buf2 = sound_buffer[1]; - INT32 *buf3 = sound_buffer[2]; - INT32 *buf4 = sound_buffer[3]; - INT32 *buf5 = sound_buffer[4]; - INT32 *buf6 = sound_buffer[5]; - INT32 *buf7 = sound_buffer[6]; - INT32 *buf8 = sound_buffer[7]; - INT32 *bufsolo1 = sound_buffer[8]; - INT32 *bufsolo2 = sound_buffer[9]; - INT32 *bufnoise = sound_buffer[10]; - INT32 i; - - for (i = 0; i < m_rate; i++) - { - /* calculate all voices' envelopes */ - EG_voices_advance(); - - TG_group_advance(0); /* calculate tones group 1 */ - buf1[i] = o2; - buf2[i] = o4; - buf3[i] = o8; - buf4[i] = o16; - - TG_group_advance(1); /* calculate tones group 2 */ - buf5[i] = o2; - buf6[i] = o4; - buf7[i] = o8; - buf8[i] = o16; - - bufsolo1[i] = solo8; - bufsolo2[i] = solo16; - - /* update noise generator */ - { - INT32 cnt = (m_noise_cnt+=m_noise_step) >> STEP_SH; - m_noise_cnt &= ((1< 0) - { - INT32 tmp = m_noise_rng & (1<<16); /* store current level */ - - if (m_noise_rng&1) - m_noise_rng ^= 0x24000; - m_noise_rng>>=1; - - if ( (m_noise_rng & (1<<16)) != tmp ) /* level change detect */ - m_noise_clocks++; - - cnt--; - } - } - - bufnoise[i] = (m_noise_rng & (1<<16)) ? 32767 : 0; - } - - if (!m_add) - { - for (i = 0; i < samples; i++) { - INT32 offs = (i * m_rate) / samples; - if (offs >= m_rate) offs = m_rate - 1; - - INT32 sample = (INT32)(double)(BURN_SND_CLIP(sound_buffer[0][offs]) * volume[0]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[1][offs]) * volume[1]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[2][offs]) * volume[2]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[3][offs]) * volume[3]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[4][offs]) * volume[4]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[5][offs]) * volume[5]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[6][offs]) * volume[6]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[7][offs]) * volume[7]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[8][offs]) * volume[8]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[9][offs]) * volume[9]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[10][offs]) * volume[10]); - - sample = BURN_SND_CLIP(sample); - - buffer[0] = sample; - buffer[1] = sample; - buffer += 2; - } - } else { - for (i = 0; i < samples; i++) { - INT32 offs = (i * m_rate) / samples; - if (offs >= m_rate) offs = m_rate - 1; - - INT32 sample = (INT32)(double)(BURN_SND_CLIP(sound_buffer[0][offs]) * volume[0]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[1][offs]) * volume[1]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[2][offs]) * volume[2]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[3][offs]) * volume[3]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[4][offs]) * volume[4]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[5][offs]) * volume[5]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[6][offs]) * volume[6]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[7][offs]) * volume[7]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[8][offs]) * volume[8]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[9][offs]) * volume[9]); - sample += (INT32)(double)(BURN_SND_CLIP(sound_buffer[10][offs]) * volume[10]); - - sample = BURN_SND_CLIP(sample); - - buffer[0] += BURN_SND_CLIP(buffer[0]+sample); - buffer[1] += BURN_SND_CLIP(buffer[1]+sample); - buffer += 2; - } - } -} - -INT32 MSM5232Scan(INT32 nAction, INT32 *) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM5232Initted) bprintf(PRINT_ERROR, _T("MSM5232Scan called without init\n")); -#endif - - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = m_voi; - ba.nLen = sizeof(VOICE) * 8; - ba.szName = "Voice data"; - BurnAcb(&ba); - - SCAN_VAR(m_EN_out16[0]); - SCAN_VAR(m_EN_out16[1]); - SCAN_VAR(m_EN_out8[0]); - SCAN_VAR(m_EN_out8[1]); - SCAN_VAR(m_EN_out4[0]); - SCAN_VAR(m_EN_out4[1]); - SCAN_VAR(m_EN_out2[0]); - SCAN_VAR(m_EN_out2[1]); - SCAN_VAR(m_noise_cnt); - SCAN_VAR(m_noise_step); - SCAN_VAR(m_noise_rng); - SCAN_VAR(m_noise_clocks); - SCAN_VAR(m_control1); - SCAN_VAR(m_control2); - SCAN_VAR(m_gate); - SCAN_VAR(m_chip_clock); - SCAN_VAR(m_rate); - } - - if (nAction & ACB_WRITE) { - init_tables(); - } - - return 0; -} diff --git a/jan/src/burn/snd/msm5232.h b/jan/src/burn/snd/msm5232.h deleted file mode 100644 index fa1605c00..000000000 --- a/jan/src/burn/snd/msm5232.h +++ /dev/null @@ -1,23 +0,0 @@ -void MSM5232Write(INT32 offset, UINT8 data); -void MSM5232Reset(); -void MSM5232SetCapacitors(double cap1, double cap2, double cap3, double cap4, double cap5, double cap6, double cap7, double cap8); -void MSM5232SetGateCallback(void (*callback)(INT32)); -void MSM5232Init(INT32 clock, INT32 bAdd); -void MSM5232SetClock(INT32 clock); -void MSM5232Update(INT16 *buffer, INT32 samples); -void MSM5232Exit(); -INT32 MSM5232Scan(INT32 nAction, INT32 *); - -void MSM5232SetRoute(double volume, INT32 route); - -#define BURN_SND_MSM5232_ROUTE_0 0 -#define BURN_SND_MSM5232_ROUTE_1 1 -#define BURN_SND_MSM5232_ROUTE_2 2 -#define BURN_SND_MSM5232_ROUTE_3 3 -#define BURN_SND_MSM5232_ROUTE_4 4 -#define BURN_SND_MSM5232_ROUTE_5 5 -#define BURN_SND_MSM5232_ROUTE_6 6 -#define BURN_SND_MSM5232_ROUTE_7 7 -#define BURN_SND_MSM5232_ROUTE_SOLO8 8 -#define BURN_SND_MSM5232_ROUTE_SOLO16 9 -#define BURN_SND_MSM5232_ROUTE_NOISE 10 diff --git a/jan/src/burn/snd/msm6295.cpp b/jan/src/burn/snd/msm6295.cpp deleted file mode 100644 index c45b06070..000000000 --- a/jan/src/burn/snd/msm6295.cpp +++ /dev/null @@ -1,576 +0,0 @@ -// OKI MSM6295 module -// Emulation by Jan Klaassen - -#include -#include "burnint.h" -#include "msm6295.h" -#include "burn_sound.h" - -UINT8* MSM6295ROM; - -UINT32 nMSM6295Status[MAX_MSM6295]; - -struct MSM6295ChannelInfo { - INT32 nOutput; - INT32 nVolume; - INT32 nPosition; - INT32 nSampleCount; - INT32 nSample; - INT32 nStep; - INT32 nDelta; - - INT32 nBufPos; - INT32 nPlaying; -}; - -static struct { - INT32 nVolume; - INT32 nSampleRate; - INT32 nSampleSize; - INT32 nFractionalPosition; - - // All current settings for each channel - MSM6295ChannelInfo ChannelInfo[4]; - - // Used for sending commands - bool bIsCommand; - INT32 nSampleInfo; - - INT32 nOutputDir; - -} MSM6295[MAX_MSM6295]; - -static UINT8 *pBankPointer[MAX_MSM6295][0x40000/0x100]; -INT32 nLastMSM6295Chip; - -void MSM6295SetBank(INT32 nChip, UINT8 *pRomData, INT32 nStart, INT32 nEnd) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM6295Initted) bprintf(PRINT_ERROR, _T("MSM6295SetBank called without init\n")); - if (nChip > nLastMSM6295Chip) bprintf(PRINT_ERROR, _T("MSM6295SetBank called with invalid chip number %x\n"), nChip); - if (nStart >= nEnd || nStart < 0 || nStart >= 0x40000) bprintf(PRINT_ERROR, _T("MSM6295SetBank (Chip %d) called with invalid nStart %x\n"), nChip, nStart); - if (nStart >= nEnd || nEnd < 0 || nEnd >= 0x40000) bprintf(PRINT_ERROR, _T("MSM6295SetBank (Chip %d) called with invalid nEnd %x\n"), nChip, nEnd); -#endif - - if (pRomData == NULL) return; - -// if (nEnd >= nStart) return; -// if (nEnd >= 0x40000) nEnd = 0x40000; - - for (INT32 i = 0; i < ((nEnd - nStart) >> 8) + 1; i++) - { - pBankPointer[nChip][(nStart >> 8) + i] = pRomData + (i << 8); - } -} - -#if defined FBA_DEBUG -static inline UINT8 MSM6295ReadData(INT32 nChip, UINT32 nAddress) -{ - nAddress &= 0x3ffff; - - if (pBankPointer[nChip][(nAddress >> 8)]) { - return pBankPointer[nChip][(nAddress >> 8)][(nAddress & 0xff)]; - } else { - return 0; - } -} -#else -#define MSM6295ReadData(chip, addr) \ - pBankPointer[chip][((addr) >> 8) & 0x3ff][((addr) & 0xff)] -#endif - -static UINT32 MSM6295VolumeTable[16]; -static INT32 MSM6295DeltaTable[49 * 16]; -static INT32 MSM6295StepShift[8] = {-1, -1, -1, -1, 2, 4, 6, 8}; - -static INT32* MSM6295ChannelData[MAX_MSM6295][4]; - -static INT32* pLeftBuffer = NULL; -static INT32* pRightBuffer = NULL; - -static bool bAdd; - -void MSM6295Reset(INT32 nChip) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM6295Initted) bprintf(PRINT_ERROR, _T("MSM6295Reset called without init\n")); - if (nChip > nLastMSM6295Chip) bprintf(PRINT_ERROR, _T("MSM6295Reset called with invalid chip number %x\n"), nChip); -#endif - - nMSM6295Status[nChip] = 0; - MSM6295[nChip].bIsCommand = false; - - MSM6295[nChip].nFractionalPosition = 0; - - for (INT32 nChannel = 0; nChannel < 4; nChannel++) { - MSM6295[nChip].ChannelInfo[nChannel].nPlaying = 0; - memset(MSM6295ChannelData[nChip][nChannel], 0, 0x1000 * sizeof(INT32)); - MSM6295[nChip].ChannelInfo[nChannel].nBufPos = 4; - } - - // set bank data only if DataPointer has not already been set - if (pBankPointer[nChip][0] == NULL) { - MSM6295SetBank(nChip, MSM6295ROM + (nChip * 0x0100000), 0, 0x3ffff); // set initial bank (compatibility) - } -} - -INT32 MSM6295Scan(INT32 nChip, INT32 ) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM6295Initted) bprintf(PRINT_ERROR, _T("MSM6295Scan called without init\n")); - if (nChip > nLastMSM6295Chip) bprintf(PRINT_ERROR, _T("MSM6295Scan called with invalid chip number %x\n"), nChip); -#endif - - INT32 nSampleSize = MSM6295[nChip].nSampleSize; - SCAN_VAR(MSM6295[nChip]); - MSM6295[nChip].nSampleSize = nSampleSize; - - SCAN_VAR(nMSM6295Status[nChip]); - - for (INT32 i = 0; i < 4; i++) { - SCAN_VAR(MSM6295[nChip].ChannelInfo[i].nPlaying); - } - - return 0; -} - -static void MSM6295Render_Linear(INT32 nChip, INT32* pLeftBuf, INT32 *pRightBuf, INT32 nSegmentLength) -{ - static INT32 nPreviousSample[MAX_MSM6295], nCurrentSample[MAX_MSM6295]; - INT32 nVolume = MSM6295[nChip].nVolume; - INT32 nFractionalPosition = MSM6295[nChip].nFractionalPosition; - - INT32 nChannel, nDelta, nSample; - MSM6295ChannelInfo* pChannelInfo; - - while (nSegmentLength--) { - if (nFractionalPosition >= 0x1000) { - - nPreviousSample[nChip] = nCurrentSample[nChip]; - - do { - nCurrentSample[nChip] = 0; - - for (nChannel = 0; nChannel < 4; nChannel++) { - if (nMSM6295Status[nChip] & (1 << nChannel)) { - pChannelInfo = &MSM6295[nChip].ChannelInfo[nChannel]; - - // Check for end of sample - if (pChannelInfo->nSampleCount-- == 0) { - nMSM6295Status[nChip] &= ~(1 << nChannel); - MSM6295[nChip].ChannelInfo[nChannel].nPlaying = 0; - continue; - } - - // Get new delta from ROM - if (pChannelInfo->nPosition & 1) { - nDelta = pChannelInfo->nDelta & 0x0F; - } else { - pChannelInfo->nDelta = MSM6295ReadData(nChip, (pChannelInfo->nPosition >> 1) & 0x3ffff); - nDelta = pChannelInfo->nDelta >> 4; - } - - // Compute new sample - nSample = pChannelInfo->nSample + MSM6295DeltaTable[(pChannelInfo->nStep << 4) + nDelta]; - if (nSample > 2047) { - nSample = 2047; - } else { - if (nSample < -2048) { - nSample = -2048; - } - } - pChannelInfo->nSample = nSample; - pChannelInfo->nOutput = (nSample * pChannelInfo->nVolume); - - // Update step value - pChannelInfo->nStep = pChannelInfo->nStep + MSM6295StepShift[nDelta & 7]; - if (pChannelInfo->nStep > 48) { - pChannelInfo->nStep = 48; - } else { - if (pChannelInfo->nStep < 0) { - pChannelInfo->nStep = 0; - } - } - - nCurrentSample[nChip] += pChannelInfo->nOutput / 16; - - // Advance sample position - pChannelInfo->nPosition++; - } - } - - nFractionalPosition -= 0x1000; - - } while (nFractionalPosition >= 0x1000); - } - - // Compute linearly interpolated sample - nSample = nPreviousSample[nChip] + (((nCurrentSample[nChip] - nPreviousSample[nChip]) * nFractionalPosition) >> 12); - - // Scale all 4 channels - nSample *= nVolume; - - if ((MSM6295[nChip].nOutputDir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - *pLeftBuf++ += nSample; - } - if ((MSM6295[nChip].nOutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - *pRightBuf++ += nSample; - } - - nFractionalPosition += MSM6295[nChip].nSampleSize; - } - - MSM6295[nChip].nFractionalPosition = nFractionalPosition; -} - -static void MSM6295Render_Cubic(INT32 nChip, INT32* pLeftBuf, INT32 *pRightBuf, INT32 nSegmentLength) -{ - INT32 nVolume = MSM6295[nChip].nVolume; - INT32 nFractionalPosition; - - INT32 nChannel, nDelta, nSample, nOutput; - MSM6295ChannelInfo* pChannelInfo; - - while (nSegmentLength--) { - - nOutput = 0; - - for (nChannel = 0; nChannel < 4; nChannel++) { - pChannelInfo = &MSM6295[nChip].ChannelInfo[nChannel]; - nFractionalPosition = MSM6295[nChip].nFractionalPosition; - - if (nMSM6295Status[nChip] & (1 << nChannel)) { - - while (nFractionalPosition >= 0x1000) { - - // Check for end of sample - if (pChannelInfo->nSampleCount-- <= 0) { - if (pChannelInfo->nSampleCount <= -2) { - nMSM6295Status[nChip] &= ~(1 << nChannel); - MSM6295[nChip].ChannelInfo[nChannel].nPlaying = 0; - } - - MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos++] = pChannelInfo->nOutput / 16; - - break; - - } else { - // Get new delta from ROM - if (pChannelInfo->nPosition & 1) { - nDelta = pChannelInfo->nDelta & 0x0F; - } else { - pChannelInfo->nDelta = MSM6295ReadData(nChip, (pChannelInfo->nPosition >> 1) & 0x3ffff); - nDelta = pChannelInfo->nDelta >> 4; - } - - // Compute new sample - nSample = pChannelInfo->nSample + MSM6295DeltaTable[(pChannelInfo->nStep << 4) + nDelta]; - if (nSample > 2047) { - nSample = 2047; - } else { - if (nSample < -2048) { - nSample = -2048; - } - } - pChannelInfo->nSample = nSample; - pChannelInfo->nOutput = nSample * pChannelInfo->nVolume; - - // Update step value - pChannelInfo->nStep = pChannelInfo->nStep + MSM6295StepShift[nDelta & 7]; - if (pChannelInfo->nStep > 48) { - pChannelInfo->nStep = 48; - } else { - if (pChannelInfo->nStep < 0) { - pChannelInfo->nStep = 0; - } - } - - // The interpolator needs a 16-bit sample, pChannelInfo->nOutput is now a 20-bit number - MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos++] = pChannelInfo->nOutput / 16; - - // Advance sample position - pChannelInfo->nPosition++; - nFractionalPosition -= 0x1000; - } - } - - if (pChannelInfo->nBufPos > 0x0FF0) { - MSM6295ChannelData[nChip][nChannel][0] = MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 4]; - MSM6295ChannelData[nChip][nChannel][1] = MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 3]; - MSM6295ChannelData[nChip][nChannel][2] = MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 2]; - MSM6295ChannelData[nChip][nChannel][3] = MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 1]; - pChannelInfo->nBufPos = 4; - } - - nOutput += INTERPOLATE4PS_16BIT(nFractionalPosition, - MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 4], - MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 3], - MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 2], - MSM6295ChannelData[nChip][nChannel][pChannelInfo->nBufPos - 1]); - } else { - // Ramp channel output to 0 - if (pChannelInfo->nOutput != 0) { - INT32 nRamp = 2048 * 256 * 256 / nBurnSoundRate; - if (pChannelInfo->nOutput > 0) { - if (pChannelInfo->nOutput > nRamp) { - pChannelInfo->nOutput -= nRamp; - } else { - pChannelInfo->nOutput = 0; - } - } else { - if (pChannelInfo->nOutput < -nRamp) { - pChannelInfo->nOutput += nRamp; - } else { - pChannelInfo->nOutput = 0; - } - } - nOutput += pChannelInfo->nOutput / 16; - } - } - } - - nOutput *= nVolume; - - //*pLeftBuf++ += nOutput; - if ((MSM6295[nChip].nOutputDir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - *pLeftBuf++ += nOutput; - } - if ((MSM6295[nChip].nOutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - *pRightBuf++ += nOutput; - } - - MSM6295[nChip].nFractionalPosition = (MSM6295[nChip].nFractionalPosition & 0x0FFF) + MSM6295[nChip].nSampleSize; - } -} - -INT32 MSM6295Render(INT32 nChip, INT16* pSoundBuf, INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM6295Initted) bprintf(PRINT_ERROR, _T("MSM6295Render called without init\n")); - if (nChip > nLastMSM6295Chip) bprintf(PRINT_ERROR, _T("MSM6295Render called with invalid chip number %x\n"), nChip); -#endif - - if (nChip == 0) { - memset(pLeftBuffer, 0, nSegmentLength * sizeof(INT32)); - memset(pRightBuffer, 0, nSegmentLength * sizeof(INT32)); - } - - if (nInterpolation >= 3) { - MSM6295Render_Cubic(nChip, pLeftBuffer, pRightBuffer, nSegmentLength); - } else { - MSM6295Render_Linear(nChip, pLeftBuffer, pRightBuffer, nSegmentLength); - } - - if (nChip == nLastMSM6295Chip) { - for (INT32 i = 0; i < nSegmentLength; i++) { - if (bAdd) { - pSoundBuf[0] = BURN_SND_CLIP(pSoundBuf[0] + (pLeftBuffer[i] >> 8)); - pSoundBuf[1] = BURN_SND_CLIP(pSoundBuf[1] + (pRightBuffer[i] >> 8)); - } else { - pSoundBuf[0] = BURN_SND_CLIP(pLeftBuffer[i] >> 8); - pSoundBuf[1] = BURN_SND_CLIP(pRightBuffer[i] >> 8); - } - pSoundBuf += 2; - } - } - - return 0; -} - -void MSM6295Command(INT32 nChip, UINT8 nCommand) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM6295Initted) bprintf(PRINT_ERROR, _T("MSM6295Command called without init\n")); - if (nChip > nLastMSM6295Chip) bprintf(PRINT_ERROR, _T("MSM6295Command called with invalid chip number %x\n"), nChip); -#endif - - if (MSM6295[nChip].bIsCommand) { - // Process second half of command - INT32 nChannel, nSampleStart, nSampleCount; - INT32 nVolume = nCommand & 0x0F; - nCommand >>= 4; - - MSM6295[nChip].bIsCommand = false; - - for (nChannel = 0; nChannel < 4; nChannel++) { - if (nCommand & (0x01 << nChannel)) { - if (MSM6295[nChip].ChannelInfo[nChannel].nPlaying == 0) { - - nSampleStart = MSM6295ReadData(nChip, (MSM6295[nChip].nSampleInfo & 0x03ff) + 0) << 17; - nSampleStart |= MSM6295ReadData(nChip, (MSM6295[nChip].nSampleInfo & 0x03ff) + 1) << 9; - nSampleStart |= MSM6295ReadData(nChip, (MSM6295[nChip].nSampleInfo & 0x03ff) + 2) << 1; - - nSampleCount = MSM6295ReadData(nChip, (MSM6295[nChip].nSampleInfo & 0x03ff) + 3) << 17; - nSampleCount |= MSM6295ReadData(nChip, (MSM6295[nChip].nSampleInfo & 0x03ff) + 4) << 9; - nSampleCount |= MSM6295ReadData(nChip, (MSM6295[nChip].nSampleInfo & 0x03ff) + 5) << 1; - - MSM6295[nChip].nSampleInfo &= 0xFF; - - nSampleCount -= nSampleStart; - - if (nSampleCount < 0x80000) { - // Start playing channel - MSM6295[nChip].ChannelInfo[nChannel].nVolume = MSM6295VolumeTable[nVolume]; - MSM6295[nChip].ChannelInfo[nChannel].nPosition = nSampleStart; - MSM6295[nChip].ChannelInfo[nChannel].nSampleCount = nSampleCount; - MSM6295[nChip].ChannelInfo[nChannel].nStep = 0; - MSM6295[nChip].ChannelInfo[nChannel].nSample = -1; - MSM6295[nChip].ChannelInfo[nChannel].nPlaying = 1; - MSM6295[nChip].ChannelInfo[nChannel].nOutput = 0; - - nMSM6295Status[nChip] |= nCommand; - - if (nInterpolation >= 3) { - MSM6295ChannelData[nChip][nChannel][0] = 0; - MSM6295ChannelData[nChip][nChannel][1] = 0; - MSM6295ChannelData[nChip][nChannel][2] = 0; - MSM6295ChannelData[nChip][nChannel][3] = 0; - MSM6295[nChip].ChannelInfo[nChannel].nBufPos = 4; - } - } - } - } - } - - } else { - // Process command - if (nCommand & 0x80) { - MSM6295[nChip].nSampleInfo = (nCommand & 0x7F) << 3; - MSM6295[nChip].bIsCommand = true; - } else { - // Stop playing samples - INT32 nChannel; - nCommand >>= 3; - nMSM6295Status[nChip] &= ~nCommand; - - for (nChannel = 0; nChannel < 4; nChannel++, nCommand>>=1) { - if (nCommand & 1) { - MSM6295[nChip].ChannelInfo[nChannel].nPlaying = 0; - } - } - } - } -} - -void MSM6295Exit(INT32 nChip) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM6295Initted) bprintf(PRINT_ERROR, _T("MSM6295Exit called without init\n")); - if (nChip > nLastMSM6295Chip) bprintf(PRINT_ERROR, _T("MSM6295Exit called with invalid chip number %x\n"), nChip); -#endif - - if (!DebugSnd_MSM6295Initted) return; - - if (pLeftBuffer) BurnFree(pLeftBuffer); - if (pRightBuffer) BurnFree(pRightBuffer); - pLeftBuffer = NULL; - pRightBuffer = NULL; - - for (INT32 nChannel = 0; nChannel < 4; nChannel++) { - BurnFree(MSM6295ChannelData[nChip][nChannel]); - } - - if (nChip == nLastMSM6295Chip) DebugSnd_MSM6295Initted = 0; -} - -void MSM6295SetSamplerate(INT32 nChip, INT32 nSamplerate) -{ - MSM6295[nChip].nSampleRate = nSamplerate; - if (nBurnSoundRate > 0) { - MSM6295[nChip].nSampleSize = (nSamplerate << 12) / nBurnSoundRate; - } else { - MSM6295[nChip].nSampleSize = (nSamplerate << 12) / 11025; - } -} - -INT32 MSM6295Init(INT32 nChip, INT32 nSamplerate, bool bAddSignal) -{ - DebugSnd_MSM6295Initted = 1; - - if (nBurnSoundRate > 0) { - if (pLeftBuffer == NULL) { - pLeftBuffer = (INT32*)BurnMalloc(nBurnSoundRate * sizeof(INT32)); - } - if (pRightBuffer == NULL) { - pRightBuffer = (INT32*)BurnMalloc(nBurnSoundRate * sizeof(INT32)); - } - } - - bAdd = bAddSignal; - - // Convert volume from percentage - MSM6295[nChip].nVolume = INT32(100.0 * 256.0 / 100.0 + 0.5); - - MSM6295[nChip].nSampleRate = nSamplerate; - if (nBurnSoundRate > 0) { - MSM6295[nChip].nSampleSize = (nSamplerate << 12) / nBurnSoundRate; - } else { - MSM6295[nChip].nSampleSize = (nSamplerate << 12) / 11025; - } - - MSM6295[nChip].nFractionalPosition = 0; - - nMSM6295Status[nChip] = 0; - MSM6295[nChip].bIsCommand = false; - - if (nChip == 0) { - nLastMSM6295Chip = 0; - } else { - if (nLastMSM6295Chip < nChip) { - nLastMSM6295Chip = nChip; - } - } - - // Compute sample deltas - for (INT32 i = 0; i < 49; i++) { - INT32 nStep = (INT32)(pow(1.1, (double)i) * 16.0); - for (INT32 n = 0; n < 16; n++) { - INT32 nDelta = nStep >> 3; - if (n & 1) { - nDelta += nStep >> 2; - } - if (n & 2) { - nDelta += nStep >> 1; - } - if (n & 4) { - nDelta += nStep; - } - if (n & 8) { - nDelta = -nDelta; - } - MSM6295DeltaTable[(i << 4) + n] = nDelta; - } - } - - // Compute volume levels - for (INT32 i = 0; i < 16; i++) { - double nVolume = 256.0; - for (INT32 n = i; n > 0; n--) { - nVolume /= 1.412537545; - } - MSM6295VolumeTable[i] = (UINT32)(nVolume + 0.5); - } - - for (INT32 nChannel = 0; nChannel < 4; nChannel++) { - MSM6295ChannelData[nChip][nChannel] = (INT32*)BurnMalloc(0x1000 * sizeof(INT32)); - } - - MSM6295[nChip].nOutputDir = BURN_SND_ROUTE_BOTH; - - memset (pBankPointer[nChip], 0, (0x40000/0x100) * sizeof(UINT8*)); - - MSM6295Reset(nChip); - - return 0; -} - -void MSM6295SetRoute(INT32 nChip, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_MSM6295Initted) bprintf(PRINT_ERROR, _T("MSM6295SetRoute called without init\n")); - if (nChip > nLastMSM6295Chip) bprintf(PRINT_ERROR, _T("MSM6295SetRoute called with invalid chip %i\n"), nChip); -#endif - - MSM6295[nChip].nVolume = INT32(nVolume * 256.0 + 0.5); - MSM6295[nChip].nOutputDir = nRouteDir; -} diff --git a/jan/src/burn/snd/msm6295.h b/jan/src/burn/snd/msm6295.h deleted file mode 100644 index 1dac12c24..000000000 --- a/jan/src/burn/snd/msm6295.h +++ /dev/null @@ -1,35 +0,0 @@ -// MSM6295 module header - -#define MAX_MSM6295 (2) -#define MSM6295_PIN7_HIGH (132) -#define MSM6295_PIN7_LOW (165) - -INT32 MSM6295Init(INT32 nChip, INT32 nSamplerate, bool bAddSignal); -void MSM6295SetSamplerate(INT32 nChip, INT32 nSamplerate); -void MSM6295SetRoute(INT32 nChip, double nVolume, INT32 nRouteDir); -void MSM6295Reset(INT32 nChip); -void MSM6295Exit(INT32 nChip); - -INT32 MSM6295Render(INT32 nChip, INT16* pSoundBuf, INT32 nSegmenLength); -void MSM6295Command(INT32 nChip, UINT8 nCommand); -INT32 MSM6295Scan(INT32 nChip, INT32 nAction); - -// for backwards compatibility. Remove when done configuring all banks -extern UINT8* MSM6295ROM; - -// Call this in the driver to set the bank -void MSM6295SetBank(INT32 nChip, UINT8 *pRomData, INT32 nStart, INT32 nEnd); - -inline static UINT32 MSM6295ReadStatus(const INT32 nChip) -{ -#if defined FBA_DEBUG - extern INT32 nLastMSM6295Chip; - if (!DebugSnd_MSM6295Initted) bprintf(PRINT_ERROR, _T("MSM6295ReadStatus called without init\n")); - if (nChip > nLastMSM6295Chip) bprintf(PRINT_ERROR, _T("MSM6295ReadStatus called with invalid chip %x\n"), nChip); -#endif - - extern UINT32 nMSM6295Status[MAX_MSM6295]; - - return nMSM6295Status[nChip]; -} - diff --git a/jan/src/burn/snd/namco_snd.cpp b/jan/src/burn/snd/namco_snd.cpp deleted file mode 100644 index 7d7655685..000000000 --- a/jan/src/burn/snd/namco_snd.cpp +++ /dev/null @@ -1,741 +0,0 @@ -#include "burnint.h" -#include "burn_sound.h" -#include "namco_snd.h" - -#define MAX_VOICES 8 -#define MAX_VOLUME 16 -#define INTERNAL_RATE 192000 -#define MIXLEVEL (1 << (16 - 4 - 4)) -#define OUTPUT_LEVEL(n) ((n) * MIXLEVEL / chip->num_voices) -#define WAVEFORM_POSITION(n) (((n) >> chip->f_fracbits) & 0x1f) - -static INT32 enable_ram = 0; // allocate RAM? -UINT8* NamcoSoundProm = NULL; - -typedef struct -{ - UINT32 frequency; - UINT32 counter; - INT32 volume[2]; - INT32 noise_sw; - INT32 noise_state; - INT32 noise_seed; - UINT32 noise_counter; - INT32 noise_hold; - INT32 waveform_select; -} sound_channel; - -static UINT8 *namco_soundregs = NULL; -static UINT8 *namco_wavedata = NULL; -static UINT8 *namco_waveformdata = NULL; -static INT32 namco_waveformdatasize = 0; - -struct namco_sound -{ - sound_channel channel_list[MAX_VOICES]; - sound_channel *last_channel; - - INT32 wave_size; - INT32 num_voices; - INT32 sound_enable; - INT32 namco_clock; - INT32 sample_rate; - INT32 f_fracbits; - INT32 stereo; - - INT16 *waveform[MAX_VOLUME]; - - double update_step; - - double gain[2]; - INT32 output_dir[2]; - INT32 bAdd; -}; - -static struct namco_sound *chip = NULL; - -static void update_namco_waveform(INT32 offset, UINT8 data) -{ - if (chip->wave_size == 1) - { - INT16 wdata; - INT32 v; - - /* use full byte, first 4 high bits, then low 4 bits */ - for (v = 0; v < MAX_VOLUME; v++) - { - wdata = ((data >> 4) & 0x0f) - 8; - chip->waveform[v][offset * 2] = OUTPUT_LEVEL(wdata * v); - wdata = (data & 0x0f) - 8; - chip->waveform[v][offset * 2 + 1] = OUTPUT_LEVEL(wdata * v); - } - } - else - { - INT32 v; - - /* use only low 4 bits */ - for (v = 0; v < MAX_VOLUME; v++) - chip->waveform[v][offset] = OUTPUT_LEVEL(((data & 0x0f) - 8) * v); - } -} - -static inline UINT32 namco_update_one(INT16 *buffer, INT32 length, const INT16 *wave, UINT32 counter, UINT32 freq) -{ // accumulator. - while (length-- > 0) - { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((chip->output_dir[BURN_SND_NAMCOSND_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(wave[WAVEFORM_POSITION(counter)] * chip->gain[BURN_SND_NAMCOSND_ROUTE_1]); - } - if ((chip->output_dir[BURN_SND_NAMCOSND_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(wave[WAVEFORM_POSITION(counter)] * chip->gain[BURN_SND_NAMCOSND_ROUTE_1]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - *buffer = BURN_SND_CLIP(*buffer + nLeftSample); buffer++; - *buffer = BURN_SND_CLIP(*buffer + nRightSample); buffer++; - - counter += (UINT32)((double)freq * chip->update_step); - } - - return counter; -} - -static inline UINT32 namco_stereo_update_one(INT16 *buffer, INT32 length, const INT16 *wave, UINT32 counter, UINT32 freq) -{ // stereo accumulator. confused? it does 2 passes of this, one for left, one for right, hence the buffer += 2. - while (length-- > 0) - { - INT32 nSample = 0; - - // no route support here - no games use this currently (just volume/gain) - nSample = (INT32)(wave[WAVEFORM_POSITION(counter)] * chip->gain[BURN_SND_NAMCOSND_ROUTE_1]); - - *buffer = BURN_SND_CLIP(*buffer + BURN_SND_CLIP(nSample)); - - counter += (UINT32)((double)freq * chip->update_step); - buffer += 2; - } - - return counter; -} - -void NamcoSoundUpdate(INT16* buffer, INT32 length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NamcoSndInitted) bprintf(PRINT_ERROR, _T("NamcoSoundUpdate called without init\n")); -#endif - - sound_channel *voice; - - INT32 add_stream = chip->bAdd; - - /* zap the contents of the buffers */ - if (add_stream == 0) { - memset(buffer, 0, length * 2 * sizeof(INT16)); - } - /* if no sound, we're done */ - if (chip->sound_enable == 0) - return; - - /* loop over each voice and add its contribution */ - for (voice = chip->channel_list; voice < chip->last_channel; voice++) - { - INT16 *mix = buffer; - INT32 v = voice->volume[0]; - - if (voice->noise_sw) - { - INT32 f = voice->frequency & 0xff; - - /* only update if we have non-zero volume and frequency */ - if (v && f) - { - INT32 hold_time = 1 << (chip->f_fracbits - 16); - INT32 hold = voice->noise_hold; - UINT32 delta = f << 4; - UINT32 c = voice->noise_counter; - INT16 noise_data = OUTPUT_LEVEL(0x07 * (v >> 1)); - INT32 i; - - /* add our contribution */ - for (i = 0; i < length; i++) - { - INT32 cnt; - - if (voice->noise_state) { - *mix = BURN_SND_CLIP(*mix + noise_data); - mix++; - *mix = BURN_SND_CLIP(*mix + noise_data); - mix++; - } else { - *mix = BURN_SND_CLIP(*mix - noise_data); - mix++; - *mix = BURN_SND_CLIP(*mix - noise_data); - mix++; - } - - if (hold) - { - hold--; - continue; - } - - hold = hold_time; - - c += delta; - cnt = (c >> 12); - c &= (1 << 12) - 1; - for( ;cnt > 0; cnt--) - { - if ((voice->noise_seed + 1) & 2) voice->noise_state ^= 1; - if (voice->noise_seed & 1) voice->noise_seed ^= 0x28000; - voice->noise_seed >>= 1; - } - } - - /* update the counter and hold time for this voice */ - voice->noise_counter = c; - voice->noise_hold = hold; - } - } - else - { - /* only update if we have non-zero volume and frequency */ - if (v && voice->frequency) - { - const INT16 *w = &chip->waveform[v][voice->waveform_select * 32]; - - /* generate sound into buffer and update the counter for this voice */ - voice->counter = namco_update_one(mix, length, w, voice->counter, voice->frequency); - } - } - } -} - -void NamcoSoundUpdateStereo(INT16* buffer, INT32 length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NamcoSndInitted) bprintf(PRINT_ERROR, _T("NamcoSoundUpdateStereo called without init\n")); -#endif - - sound_channel *voice; - - INT32 add_stream = chip->bAdd; - - /* zap the contents of the buffers */ - if (add_stream == 0) { - memset(buffer, 0, length * 2 * sizeof(INT16)); - } - - /* if no sound, we're done */ - if (chip->sound_enable == 0) - return; - - /* loop over each voice and add its contribution */ - for (voice = chip->channel_list; voice < chip->last_channel; voice++) - { - INT16 *lrmix = buffer; - INT32 lv = voice->volume[0]; - INT32 rv = voice->volume[1]; - - if (voice->noise_sw) - { - INT32 f = voice->frequency & 0xff; - - /* only update if we have non-zero volume and frequency */ - if ((lv || rv) && f) - { - INT32 hold_time = 1 << (chip->f_fracbits - 16); - INT32 hold = voice->noise_hold; - UINT32 delta = f << 4; - UINT32 c = voice->noise_counter; - INT16 l_noise_data = OUTPUT_LEVEL(0x07 * (lv >> 1)); - INT16 r_noise_data = OUTPUT_LEVEL(0x07 * (rv >> 1)); - INT32 i; - - /* add our contribution */ - for (i = 0; i < length; i++) - { - INT32 cnt; - - if (voice->noise_state) - { - *lrmix = BURN_SND_CLIP(*lrmix + l_noise_data); - lrmix++; - *lrmix = BURN_SND_CLIP(*lrmix + r_noise_data); - lrmix++; - } - else - { - *lrmix = BURN_SND_CLIP(*lrmix - l_noise_data); - lrmix++; - *lrmix = BURN_SND_CLIP(*lrmix - r_noise_data); - lrmix++; - } - - if (hold) - { - hold--; - continue; - } - - hold = hold_time; - - c += delta; - cnt = (c >> 12); - c &= (1 << 12) - 1; - for( ;cnt > 0; cnt--) - { - if ((voice->noise_seed + 1) & 2) voice->noise_state ^= 1; - if (voice->noise_seed & 1) voice->noise_seed ^= 0x28000; - voice->noise_seed >>= 1; - } - } - - /* update the counter and hold time for this voice */ - voice->noise_counter = c; - voice->noise_hold = hold; - } - } - else - { - /* only update if we have non-zero frequency */ - if (voice->frequency) - { - /* save the counter for this voice */ - UINT32 c = voice->counter; - - /* only update if we have non-zero left volume */ - if (lv) - { - const INT16 *lw = &chip->waveform[lv][voice->waveform_select * 32]; - - /* generate sound into the buffer */ - c = namco_stereo_update_one(lrmix + 0, length, lw, voice->counter, voice->frequency); - } - - /* only update if we have non-zero right volume */ - if (rv) - { - const INT16 *rw = &chip->waveform[rv][voice->waveform_select * 32]; - - /* generate sound into the buffer */ - c = namco_stereo_update_one(lrmix + 1, length, rw, voice->counter, voice->frequency); - } - - /* update the counter for this voice */ - voice->counter = c; - } - } - } -} - -void NamcoSoundWrite(UINT32 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NamcoSndInitted) bprintf(PRINT_ERROR, _T("NamcoSoundWrite called without init\n")); -#endif - - sound_channel *voice; - INT32 ch; - - data &= 0x0f; - if (namco_soundregs[offset] == data) - return; - - /* set the register */ - namco_soundregs[offset] = data; - - if (offset < 0x10) - ch = (offset - 5) / 5; - else if (offset == 0x10) - ch = 0; - else - ch = (offset - 0x11) / 5; - - if (ch >= chip->num_voices) - return; - - /* recompute the voice parameters */ - voice = chip->channel_list + ch; - switch (offset - ch * 5) - { - case 0x05: - voice->waveform_select = data & 7; - break; - - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: - /* the frequency has 20 bits */ - /* the first voice has extra frequency bits */ - voice->frequency = (ch == 0) ? namco_soundregs[0x10] : 0; - voice->frequency += (namco_soundregs[ch * 5 + 0x11] << 4); - voice->frequency += (namco_soundregs[ch * 5 + 0x12] << 8); - voice->frequency += (namco_soundregs[ch * 5 + 0x13] << 12); - voice->frequency += (namco_soundregs[ch * 5 + 0x14] << 16); /* always 0 */ - break; - - case 0x15: - voice->volume[0] = data; - break; - } -} - -static void namcos1_sound_write(INT32 offset, INT32 data) -{ - /* verify the offset */ - if (offset > 63) - { - // logerror("NAMCOS1 sound: Attempting to write past the 64 registers segment\n"); - return; - } - - if (namco_soundregs[offset] == data) - return; - - /* set the register */ - namco_soundregs[offset] = data; - - INT32 ch = offset / 8; - if (ch >= chip->num_voices) - return; - - /* recompute the voice parameters */ - sound_channel *voice = chip->channel_list + ch; - - switch (offset - ch * 8) - { - case 0x00: - voice->volume[0] = data & 0x0f; - break; - - case 0x01: - voice->waveform_select = (data >> 4) & 15; - case 0x02: - case 0x03: - /* the frequency has 20 bits */ - voice->frequency = (namco_soundregs[ch * 8 + 0x01] & 15) << 16; /* high bits are from here */ - voice->frequency += namco_soundregs[ch * 8 + 0x02] << 8; - voice->frequency += namco_soundregs[ch * 8 + 0x03]; - break; - - case 0x04: - voice->volume[1] = data & 0x0f; - - INT32 nssw = ((data & 0x80) >> 7); - if (++voice == chip->last_channel) - voice = chip->channel_list; - voice->noise_sw = nssw; - break; - } -} - -void namco_15xx_write(INT32 offset, UINT8 data) -{ - if (offset > 63) - { - // logerror("NAMCO 15XX sound: Attempting to write past the 64 registers segment\n"); - return; - } - - if (namco_soundregs[offset] == data) - return; - - /* set the register */ - namco_soundregs[offset] = data; - - INT32 ch = offset / 8; - if (ch >= chip->num_voices) - return; - - /* recompute the voice parameters */ - sound_channel *voice = chip->channel_list + ch; - switch (offset - ch * 8) - { - case 0x03: - voice->volume[0] = data & 0x0f; - break; - - case 0x06: - voice->waveform_select = (data >> 4) & 7; - case 0x04: - case 0x05: - /* the frequency has 20 bits */ - voice->frequency = namco_soundregs[ch * 8 + 0x04]; - voice->frequency += namco_soundregs[ch * 8 + 0x05] << 8; - voice->frequency += (namco_soundregs[ch * 8 + 0x06] & 15) << 16; /* high bits are from here */ - break; - } -} - -void namco_15xx_sharedram_write(INT32 offset, UINT8 data) -{ - offset &= 0x3ff; - - if (offset < 0x40) { - namco_15xx_write(offset, data); - } else { - namco_soundregs[offset] = data; - } -} - -UINT8 namco_15xx_sharedram_read(INT32 offset) -{ - return namco_soundregs[offset & 0x3ff]; -} - -void namco_15xx_sound_enable(INT32 value) -{ - chip->sound_enable = (value) ? 1 : 0; -} - -void namcos1_custom30_write(INT32 offset, INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NamcoSndInitted) bprintf(PRINT_ERROR, _T("namcos1_custom30_write called without init\n")); -#endif - - if (offset < 0x100) - { - if (namco_wavedata[offset] != data) - { - namco_wavedata[offset] = data; - - /* update the decoded waveform table */ - update_namco_waveform(offset, data); - } - } - else if (offset < 0x140) { - namco_wavedata[offset] = data; - namcos1_sound_write(offset - 0x100, data); - } else - namco_wavedata[offset] = data; -} - -UINT8 namcos1_custom30_read(INT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NamcoSndInitted) bprintf(PRINT_ERROR, _T("namcos1_custom30_read called without init\n")); -#endif - - return namco_wavedata[offset]; -} - -static INT32 build_decoded_waveform() -{ - INT16 *p; - INT32 size; - INT32 offset; - INT32 v; - - if (NamcoSoundProm != NULL) - namco_wavedata = NamcoSoundProm; - - /* 20pacgal has waves in RAM but old sound system */ - if (NamcoSoundProm == NULL && chip->num_voices != 3) - { - chip->wave_size = 1; - size = 32 * 16; /* 32 samples, 16 waveforms */ - } - else - { - chip->wave_size = 0; - size = 32 * 8; /* 32 samples, 8 waveforms */ - } - - namco_waveformdatasize = size * MAX_VOLUME * sizeof (INT16); - - p = (INT16*)BurnMalloc(namco_waveformdatasize); - namco_waveformdata = (UINT8*)p; //strictly for savestates. - - memset(p, 0, namco_waveformdatasize); - - for (v = 0; v < MAX_VOLUME; v++) - { - chip->waveform[v] = p; - p += size; - } - - if (namco_wavedata == NULL) { - enable_ram = 1; - namco_wavedata = (UINT8*)BurnMalloc(0x400); - memset(namco_wavedata, 0, 0x400); - } - - /* We need waveform data. It fails if region is not specified. */ - if (namco_wavedata) - { - for (offset = 0; offset < 256; offset++) - update_namco_waveform(offset, namco_wavedata[offset]); - } - - return 0; -} - -void NamcoSoundReset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_NamcoSndInitted) bprintf(PRINT_ERROR, _T("NamcoSoundReset called without init\n")); -#endif - - sound_channel *voice; - - /* reset all the voices */ - for (voice = chip->channel_list; voice < chip->last_channel; voice++) - { - voice->frequency = 0; - voice->volume[0] = voice->volume[1] = 0; - voice->waveform_select = 0; - voice->counter = 0; - voice->noise_sw = 0; - voice->noise_state = 0; - voice->noise_seed = 1; - voice->noise_counter = 0; - voice->noise_hold = 0; - } -} - -void NamcoSoundInit(INT32 clock, INT32 num_voices, INT32 bAdd) -{ - DebugSnd_NamcoSndInitted = 1; - - INT32 clock_multiple; - sound_channel *voice; - - chip = (struct namco_sound*)BurnMalloc(sizeof(*chip)); - memset(chip, 0, sizeof(*chip)); - - namco_soundregs = (UINT8*)BurnMalloc(0x400); - memset(namco_soundregs, 0, 0x400); - - chip->num_voices = num_voices; - chip->last_channel = chip->channel_list + chip->num_voices; - chip->stereo = 0; - - chip->bAdd = bAdd; - - /* adjust internal clock */ - chip->namco_clock = clock; - for (clock_multiple = 0; chip->namco_clock < INTERNAL_RATE; clock_multiple++) - chip->namco_clock *= 2; - - chip->f_fracbits = clock_multiple + 15; - - /* adjust output clock */ - chip->sample_rate = chip->namco_clock; - - /* build the waveform table */ - if (build_decoded_waveform()) return; - - /* start with sound enabled, many games don't have a sound enable register */ - chip->sound_enable = 1; - - /* reset all the voices */ - for (voice = chip->channel_list; voice < chip->last_channel; voice++) - { - voice->frequency = 0; - voice->volume[0] = voice->volume[1] = 0; - voice->waveform_select = 0; - voice->counter = 0; - voice->noise_sw = 0; - voice->noise_state = 0; - voice->noise_seed = 1; - voice->noise_counter = 0; - voice->noise_hold = 0; - } - - chip->update_step = ((double)INTERNAL_RATE / nBurnSoundRate); - - chip->gain[BURN_SND_NAMCOSND_ROUTE_1] = 1.00; - chip->gain[BURN_SND_NAMCOSND_ROUTE_2] = 1.00; - chip->output_dir[BURN_SND_NAMCOSND_ROUTE_1] = BURN_SND_ROUTE_BOTH; - chip->output_dir[BURN_SND_NAMCOSND_ROUTE_2] = BURN_SND_ROUTE_BOTH; -} - -void NacmoSoundSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NamcoSndInitted) bprintf(PRINT_ERROR, _T("NacmoSoundSetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("NacmoSoundSetRoute called with invalid index %i\n"), nIndex); -#endif - - chip->gain[nIndex] = nVolume; - chip->output_dir[nIndex] = nRouteDir; -} - -void NamcoSoundExit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_NamcoSndInitted) bprintf(PRINT_ERROR, _T("NamcoSoundExit called without init\n")); -#endif - - if (!DebugSnd_NamcoSndInitted) return; - - BurnFree(chip); - BurnFree(namco_soundregs); - if (enable_ram) { - BurnFree(namco_wavedata); - } - BurnFree(namco_waveformdata); - - NamcoSoundProm = NULL; - namco_wavedata = NULL; // this is important. - - enable_ram = 0; - DebugSnd_NamcoSndInitted = 0; -} - -void NamcoSoundScan(INT32 nAction, INT32 *pnMin) -{ - struct BurnArea ba; - char szName[30]; - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return; - } - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - memset(&ba, 0, sizeof(ba)); - sprintf(szName, "NamcoSound"); - ba.Data = &chip->channel_list; - ba.nLen = sizeof(chip->channel_list); - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - - memset(&ba, 0, sizeof(ba)); - sprintf(szName, "NamcoSoundWaveFormData"); - ba.Data = namco_waveformdata; - ba.nLen = namco_waveformdatasize; - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - - if (enable_ram) { - memset(&ba, 0, sizeof(ba)); - sprintf(szName, "NamcoSoundWaveData"); - ba.Data = namco_wavedata; - ba.nLen = 0x400; - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); - } - - memset(&ba, 0, sizeof(ba)); - sprintf(szName, "NamcoSoundRegs"); - ba.Data = namco_soundregs; - ba.nLen = 0x400; - ba.nAddress = 0; - ba.szName = szName; - BurnAcb(&ba); -} diff --git a/jan/src/burn/snd/namco_snd.h b/jan/src/burn/snd/namco_snd.h deleted file mode 100644 index 1c837b7b7..000000000 --- a/jan/src/burn/snd/namco_snd.h +++ /dev/null @@ -1,24 +0,0 @@ -extern UINT8* NamcoSoundProm; -void NamcoSoundUpdate(INT16* buffer, INT32 length); -void NamcoSoundUpdateStereo(INT16* buffer, INT32 length); -void NamcoSoundWrite(UINT32 offset, UINT8 data); -void NamcoSoundInit(INT32 clock, INT32 num_voices, INT32 bAdd); -void NacmoSoundSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void NamcoSoundExit(); -void NamcoSoundScan(INT32 nAction,INT32 *pnMin); -void NamcoSoundReset(); - -void namcos1_custom30_write(INT32 offset, INT32 data); -UINT8 namcos1_custom30_read(INT32 offset); - -void namco_15xx_write(INT32 offset, UINT8 data); -void namco_15xx_sharedram_write(INT32 offset, UINT8 data); -UINT8 namco_15xx_sharedram_read(INT32 offset); -void namco_15xx_sound_enable(INT32 value); - -#define BURN_SND_NAMCOSND_ROUTE_1 0 -#define BURN_SND_NAMCOSND_ROUTE_2 1 - -#define NacmoSoundSetAllRoutes(v, d) \ - NacmoSoundSetRoute(BURN_SND_NAMCOSND_ROUTE_1, v, d); \ - NacmoSoundSetRoute(BURN_SND_NAMCOSND_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/nes_apu.cpp b/jan/src/burn/snd/nes_apu.cpp deleted file mode 100644 index 5979b2a7d..000000000 --- a/jan/src/burn/snd/nes_apu.cpp +++ /dev/null @@ -1,984 +0,0 @@ -/***************************************************************************** - - MAME/MESS NES APU CORE - - Based on the Nofrendo/Nosefart NES N2A03 sound emulation core written by - Matthew Conte (matt@conte.com) and redesigned for use in MAME/MESS by - Who Wants to Know? (wwtk@mail.com) - - This core is written with the advise and consent of Matthew Conte and is - released under the GNU Public License. This core is freely avaiable for - use in any freeware project, subject to the following terms: - - Any modifications to this code must be duly noted in the source and - approved by Matthew Conte and myself prior to public submission. - - timing notes: - master = 21477270 - 2A03 clock = master/12 - sequencer = master/89490 or CPU/7457 - - ***************************************************************************** - - NES_APU.C - - Actual NES APU interface. - - LAST MODIFIED 02/29/2004 - - - Based on Matthew Conte's Nofrendo/Nosefart core and redesigned to - use MAME system calls and to enable multiple APUs. Sound at this - point should be just about 100% accurate, though I cannot tell for - certain as yet. - - A queue interface is also available for additional speed. However, - the implementation is not yet 100% (DPCM sounds are inaccurate), - so it is disabled by default. - - ***************************************************************************** - - BUGFIXES: - - - Various bugs concerning the DPCM channel fixed. (Oliver Achten) - - Fixed $4015 read behaviour. (Oliver Achten) - - *****************************************************************************/ - -/* - Ported from MAME 0.120 - 01/02/14 -*/ - -#include "burnint.h" -#include "m6502_intf.h" -#include "nes_apu.h" -#include "nes_defs.h" - -#define CHIP_NUM 2 - -#define LEFT 0 -#define RIGHT 1 - -/* GLOBAL CONSTANTS */ -#define SYNCS_MAX1 0x20 -#define SYNCS_MAX2 0x80 - -/* GLOBAL VARIABLES */ -struct nesapu_info -{ - apu_t APU; /* Actual APUs */ - float apu_incsize; /* Adjustment increment */ - UINT32 samps_per_sync; /* Number of samples per vsync */ - UINT32 buffer_size; /* Actual buffer size in bytes */ - UINT32 real_rate; /* Actual playback rate */ - UINT8 noise_lut[NOISE_LONG]; /* Noise sample lookup table */ - UINT32 vbl_times[0x20]; /* VBL durations in samples */ - UINT32 sync_times1[SYNCS_MAX1]; /* Samples per sync table */ - UINT32 sync_times2[SYNCS_MAX2]; /* Samples per sync table */ - - // FBA-specific variables - INT16 *stream; - INT32 samples_per_frame; - UINT32 (*pSyncCallback)(INT32 samples_per_frame); - INT32 current_position; - INT32 fill_buffer_hack; - double gain[2]; - INT32 output_dir[2]; - INT32 bAdd; -}; - -static nesapu_info nesapu_chips[CHIP_NUM]; - -/* INTERNAL FUNCTIONS */ - -/* INITIALIZE WAVE TIMES RELATIVE TO SAMPLE RATE */ -static void create_vbltimes(UINT32* table,const UINT8 *vbl,UINT32 rate) -{ - INT32 i; - - for (i=0;i<0x20;i++) - table[i]=vbl[i]*rate; -} - -/* INITIALIZE SAMPLE TIMES IN TERMS OF VSYNCS */ -static void create_syncs(struct nesapu_info *info, UINT64 sps) -{ - INT32 i; - UINT64 val=sps; - - for (i=0;isync_times1[i]=val; - val+=sps; - } - - val=0; - for (i=0;isync_times2[i]=val; - info->sync_times2[i]>>=2; - val+=sps; - } -} - -/* INITIALIZE NOISE LOOKUP TABLE */ -static void create_noise(UINT8 *buf, const INT32 bits, INT32 size) -{ - static INT32 m = 0x0011; - INT32 xor_val, i; - - for (i = 0; i < size; i++) - { - xor_val = m & 1; - m >>= 1; - xor_val ^= (m & 1); - m |= xor_val << (bits - 1); - - buf[i] = m; - } -} - -/* TODO: sound channels should *ALL* have DC volume decay */ - -/* OUTPUT SQUARE WAVE SAMPLE (VALUES FROM -16 to +15) */ -static int8 apu_square(struct nesapu_info *info, square_t *chan) -{ - INT32 env_delay; - INT32 sweep_delay; - int8 output; - - /* reg0: 0-3=volume, 4=envelope, 5=hold, 6-7=duty cycle - ** reg1: 0-2=sweep shifts, 3=sweep inc/dec, 4-6=sweep length, 7=sweep on - ** reg2: 8 bits of freq - ** reg3: 0-2=high freq, 7-4=vbl length counter - */ - - if (false == chan->enabled) - return 0; - - /* enveloping */ - env_delay = info->sync_times1[chan->regs[0] & 0x0F]; - - /* decay is at a rate of (env_regs + 1) / 240 secs */ - chan->env_phase -= 4; - while (chan->env_phase < 0) - { - chan->env_phase += env_delay; - if (chan->regs[0] & 0x20) - chan->env_vol = (chan->env_vol + 1) & 15; - else if (chan->env_vol < 15) - chan->env_vol++; - } - - /* vbl length counter */ - if (chan->vbl_length > 0 && 0 == (chan->regs [0] & 0x20)) - chan->vbl_length--; - - if (0 == chan->vbl_length) - return 0; - - /* freqsweeps */ - if ((chan->regs[1] & 0x80) && (chan->regs[1] & 7)) - { - sweep_delay = info->sync_times1[(chan->regs[1] >> 4) & 7]; - chan->sweep_phase -= 2; - while (chan->sweep_phase < 0) - { - chan->sweep_phase += sweep_delay; - if (chan->regs[1] & 8) - chan->freq -= chan->freq >> (chan->regs[1] & 7); - else - chan->freq += chan->freq >> (chan->regs[1] & 7); - } - } - - if ((0 == (chan->regs[1] & 8) && (chan->freq >> 16) > freq_limit[chan->regs[1] & 7]) - || (chan->freq >> 16) < 4) - return 0; - - chan->phaseacc -= (float) info->apu_incsize; /* # of cycles per sample */ - - while (chan->phaseacc < 0) - { - chan->phaseacc += (chan->freq >> 16); - chan->adder = (chan->adder + 1) & 0x0F; - } - - if (chan->regs[0] & 0x10) /* fixed volume */ - output = chan->regs[0] & 0x0F; - else - output = 0x0F - chan->env_vol; - - if (chan->adder < (duty_lut[chan->regs[0] >> 6])) - output = -output; - - return (int8) output; -} - -/* OUTPUT TRIANGLE WAVE SAMPLE (VALUES FROM -16 to +15) */ -static int8 apu_triangle(struct nesapu_info *info, triangle_t *chan) -{ - INT32 freq; - int8 output; - /* reg0: 7=holdnote, 6-0=linear length counter - ** reg2: low 8 bits of frequency - ** reg3: 7-3=length counter, 2-0=high 3 bits of frequency - */ - - if (false == chan->enabled) - return 0; - - if (false == chan->counter_started && 0 == (chan->regs[0] & 0x80)) - { - if (chan->write_latency) - chan->write_latency--; - if (0 == chan->write_latency) - chan->counter_started = TRUE; - } - - if (chan->counter_started) - { - if (chan->linear_length > 0) - chan->linear_length--; - if (chan->vbl_length && 0 == (chan->regs[0] & 0x80)) - chan->vbl_length--; - - if (0 == chan->vbl_length) - return 0; - } - - if (0 == chan->linear_length) - return 0; - - freq = (((chan->regs[3] & 7) << 8) + chan->regs[2]) + 1; - - if (freq < 4) /* inaudible */ - return 0; - - chan->phaseacc -= (float) info->apu_incsize; /* # of cycles per sample */ - while (chan->phaseacc < 0) - { - chan->phaseacc += freq; - chan->adder = (chan->adder + 1) & 0x1F; - - output = (chan->adder & 7) << 1; - if (chan->adder & 8) - output = 0x10 - output; - if (chan->adder & 0x10) - output = -output; - - chan->output_vol = output; - } - - return (int8) chan->output_vol; -} - -/* OUTPUT NOISE WAVE SAMPLE (VALUES FROM -16 to +15) */ -static int8 apu_noise(struct nesapu_info *info, noise_t *chan) -{ - INT32 freq, env_delay; - UINT8 outvol; - UINT8 output; - - /* reg0: 0-3=volume, 4=envelope, 5=hold - ** reg2: 7=small(93 byte) sample,3-0=freq lookup - ** reg3: 7-4=vbl length counter - */ - - if (false == chan->enabled) - return 0; - - /* enveloping */ - env_delay = info->sync_times1[chan->regs[0] & 0x0F]; - - /* decay is at a rate of (env_regs + 1) / 240 secs */ - chan->env_phase -= 4; - while (chan->env_phase < 0) - { - chan->env_phase += env_delay; - if (chan->regs[0] & 0x20) - chan->env_vol = (chan->env_vol + 1) & 15; - else if (chan->env_vol < 15) - chan->env_vol++; - } - - /* length counter */ - if (0 == (chan->regs[0] & 0x20)) - { - if (chan->vbl_length > 0) - chan->vbl_length--; - } - - if (0 == chan->vbl_length) - return 0; - - freq = noise_freq[chan->regs[2] & 0x0F]; - chan->phaseacc -= (float) info->apu_incsize; /* # of cycles per sample */ - while (chan->phaseacc < 0) - { - chan->phaseacc += freq; - - chan->cur_pos++; - if (NOISE_SHORT == chan->cur_pos && (chan->regs[2] & 0x80)) - chan->cur_pos = 0; - else if (NOISE_LONG == chan->cur_pos) - chan->cur_pos = 0; - } - - if (chan->regs[0] & 0x10) /* fixed volume */ - outvol = chan->regs[0] & 0x0F; - else - outvol = 0x0F - chan->env_vol; - - output = info->noise_lut[chan->cur_pos]; - if (output > outvol) - output = outvol; - - if (info->noise_lut[chan->cur_pos] & 0x80) /* make it negative */ - output = -output; - - return (int8) output; -} - -/* RESET DPCM PARAMETERS */ -static inline void apu_dpcmreset(dpcm_t *chan) -{ - chan->address = 0xC000 + (uint16) (chan->regs[2] << 6); - chan->length = (uint16) (chan->regs[3] << 4) + 1; - chan->bits_left = chan->length << 3; - chan->irq_occurred = false; - chan->enabled = TRUE; /* Fixed * Proper DPCM channel ENABLE/DISABLE flag behaviour*/ - chan->vol = 0; /* Fixed * DPCM DAC resets itself when restarted */ -} - -/* OUTPUT DPCM WAVE SAMPLE (VALUES FROM -64 to +63) */ -/* TODO: centerline naughtiness */ -static int8 apu_dpcm(struct nesapu_info *info, dpcm_t *chan) -{ - INT32 freq, bit_pos; - - /* reg0: 7=irq gen, 6=looping, 3-0=pointer to clock table - ** reg1: output dc level, 7 bits unsigned - ** reg2: 8 bits of 64-byte aligned address offset : $C000 + (value * 64) - ** reg3: length, (value * 16) + 1 - */ - - if (chan->enabled) - { - freq = dpcm_clocks[chan->regs[0] & 0x0F]; - chan->phaseacc -= (float) info->apu_incsize; /* # of cycles per sample */ - - while (chan->phaseacc < 0) - { - chan->phaseacc += freq; - - if (0 == chan->length) - { - chan->enabled = false; /* Fixed * Proper DPCM channel ENABLE/DISABLE flag behaviour*/ - chan->vol=0; /* Fixed * DPCM DAC resets itself when restarted */ - if (chan->regs[0] & 0x40) - apu_dpcmreset(chan); - else - { - if (chan->regs[0] & 0x80) /* IRQ Generator */ - { - chan->irq_occurred = TRUE; - n2a03_irq(); - } - break; - } - } - - - chan->bits_left--; - bit_pos = 7 - (chan->bits_left & 7); - if (7 == bit_pos) - { - chan->cur_byte = M6502ReadByte(chan->address); //memory_read_byte(info->APU.dpcm.memory, chan->address); - chan->address++; - chan->length--; - } - - if (chan->cur_byte & (1 << bit_pos)) -// chan->regs[1]++; - chan->vol+=2; /* FIXED * DPCM channel only uses the upper 6 bits of the DAC */ - else -// chan->regs[1]--; - chan->vol-=2; - } - } - - if (chan->vol > 63) - chan->vol = 63; - else if (chan->vol < -64) - chan->vol = -64; - - return (int8) (chan->vol); -} - -/* WRITE REGISTER VALUE */ -static inline void apu_regwrite(struct nesapu_info *info,INT32 address, UINT8 value) -{ - INT32 chan = (address & 4) ? 1 : 0; - - switch (address) - { - /* squares */ - case APU_WRA0: - case APU_WRB0: - info->APU.squ[chan].regs[0] = value; - break; - - case APU_WRA1: - case APU_WRB1: - info->APU.squ[chan].regs[1] = value; - break; - - case APU_WRA2: - case APU_WRB2: - info->APU.squ[chan].regs[2] = value; - if (info->APU.squ[chan].enabled) - info->APU.squ[chan].freq = ((((info->APU.squ[chan].regs[3] & 7) << 8) + value) + 1) << 16; - break; - - case APU_WRA3: - case APU_WRB3: - info->APU.squ[chan].regs[3] = value; - - if (info->APU.squ[chan].enabled) - { - info->APU.squ[chan].vbl_length = info->vbl_times[value >> 3]; - info->APU.squ[chan].env_vol = 0; - info->APU.squ[chan].freq = ((((value & 7) << 8) + info->APU.squ[chan].regs[2]) + 1) << 16; - } - - break; - - /* triangle */ - case APU_WRC0: - info->APU.tri.regs[0] = value; - - if (info->APU.tri.enabled) - { /* ??? */ - if (false == info->APU.tri.counter_started) - info->APU.tri.linear_length = info->sync_times2[value & 0x7F]; - } - - break; - - case 0x4009: - /* unused */ - info->APU.tri.regs[1] = value; - break; - - case APU_WRC2: - info->APU.tri.regs[2] = value; - break; - - case APU_WRC3: - info->APU.tri.regs[3] = value; - - /* this is somewhat of a hack. there is some latency on the Real - ** Thing between when trireg0 is written to and when the linear - ** length counter actually begins its countdown. we want to prevent - ** the case where the program writes to the freq regs first, then - ** to reg 0, and the counter accidentally starts running because of - ** the sound queue's timestamp processing. - ** - ** set to a few NES sample -- should be sufficient - ** - ** 3 * (1789772.727 / 44100) = ~122 cycles, just around one scanline - ** - ** should be plenty of time for the 6502 code to do a couple of table - ** dereferences and load up the other triregs - */ - - /* used to be 3, but now we run the clock faster, so base it on samples/sync */ - info->APU.tri.write_latency = (info->samps_per_sync + 239) / 240; - - if (info->APU.tri.enabled) - { - info->APU.tri.counter_started = false; - info->APU.tri.vbl_length = info->vbl_times[value >> 3]; - info->APU.tri.linear_length = info->sync_times2[info->APU.tri.regs[0] & 0x7F]; - } - - break; - - /* noise */ - case APU_WRD0: - info->APU.noi.regs[0] = value; - break; - - case 0x400D: - /* unused */ - info->APU.noi.regs[1] = value; - break; - - case APU_WRD2: - info->APU.noi.regs[2] = value; - break; - - case APU_WRD3: - info->APU.noi.regs[3] = value; - - if (info->APU.noi.enabled) - { - info->APU.noi.vbl_length = info->vbl_times[value >> 3]; - info->APU.noi.env_vol = 0; /* reset envelope */ - } - break; - - /* DMC */ - case APU_WRE0: - info->APU.dpcm.regs[0] = value; - if (0 == (value & 0x80)) - info->APU.dpcm.irq_occurred = false; - break; - - case APU_WRE1: /* 7-bit DAC */ - //info->APU.dpcm.regs[1] = value - 0x40; - info->APU.dpcm.regs[1] = value & 0x7F; - info->APU.dpcm.vol = (info->APU.dpcm.regs[1]-64); - break; - - case APU_WRE2: - info->APU.dpcm.regs[2] = value; - //apu_dpcmreset(info->APU.dpcm); - break; - - case APU_WRE3: - info->APU.dpcm.regs[3] = value; - break; - - case APU_IRQCTRL: - break; - - case APU_SMASK: - if (value & 0x01) - info->APU.squ[0].enabled = TRUE; - else - { - info->APU.squ[0].enabled = false; - info->APU.squ[0].vbl_length = 0; - } - - if (value & 0x02) - info->APU.squ[1].enabled = TRUE; - else - { - info->APU.squ[1].enabled = false; - info->APU.squ[1].vbl_length = 0; - } - - if (value & 0x04) - info->APU.tri.enabled = TRUE; - else - { - info->APU.tri.enabled = false; - info->APU.tri.vbl_length = 0; - info->APU.tri.linear_length = 0; - info->APU.tri.counter_started = false; - info->APU.tri.write_latency = 0; - } - - if (value & 0x08) - info->APU.noi.enabled = TRUE; - else - { - info->APU.noi.enabled = false; - info->APU.noi.vbl_length = 0; - } - - if (value & 0x10) - { - /* only reset dpcm values if DMA is finished */ - if (false == info->APU.dpcm.enabled) - { - info->APU.dpcm.enabled = TRUE; - apu_dpcmreset(&info->APU.dpcm); - } - } - else - info->APU.dpcm.enabled = false; - - info->APU.dpcm.irq_occurred = false; - - break; - default: -#ifdef MAME_DEBUG -logerror("invalid apu write: $%02X at $%04X\n", value, address); -#endif - break; - } -} - -/* UPDATE SOUND BUFFER USING CURRENT DATA */ -static inline void apu_update(struct nesapu_info *info) -{ - INT32 accum; - -//------------------------------------------------------------------------------------------------------ - if (info->pSyncCallback == NULL) return; - INT32 position; - - if (info->fill_buffer_hack) { - position = info->samples_per_frame; - info->fill_buffer_hack = 0; - } else { - position = info->pSyncCallback(info->samples_per_frame); - } - - if (position > info->samples_per_frame) position = info->samples_per_frame; - if (position == info->current_position) return; - - INT16 *buffer16 = info->stream + info->current_position; - - INT32 samples = position - info->current_position; - - info->current_position = position; - - if (samples <= 0) return; -//------------------------------------------------------------------------------------------------------ - - while (samples--) - { - accum = apu_square(info, &info->APU.squ[0]); - accum += apu_square(info, &info->APU.squ[1]); - accum += apu_triangle(info, &info->APU.tri); - accum += apu_noise(info, &info->APU.noi); - accum += apu_dpcm(info, &info->APU.dpcm); - - /* 8-bit clamps */ - if (accum > 127) - accum = 127; - else if (accum < -128) - accum = -128; - - *(buffer16++)=accum<<8; - } -} - -/* READ VALUES FROM REGISTERS */ -UINT8 nesapuRead(INT32 chip, INT32 address) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NESAPUSndInitted) bprintf(PRINT_ERROR, _T("nesapuRead called without init\n")); -#endif - - struct nesapu_info *info = &nesapu_chips[chip]; - if (address == 0x0f) /*FIXED* Address $4015 has different behaviour*/ - { - INT32 readval = 0; - if (info->APU.squ[0].vbl_length > 0) - readval |= 0x01; - - if (info->APU.squ[1].vbl_length > 0) - readval |= 0x02; - - if (info->APU.tri.vbl_length > 0) - readval |= 0x04; - - if (info->APU.noi.vbl_length > 0) - readval |= 0x08; - - if (info->APU.dpcm.enabled == TRUE) - readval |= 0x10; - - if (info->APU.dpcm.irq_occurred == TRUE) - readval |= 0x80; - - return readval; - } else { - return info->APU.regs[address]; - } -} - -/* WRITE VALUE TO TEMP REGISTRY AND QUEUE EVENT */ -void nesapuWrite(INT32 chip, INT32 address, UINT8 value) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NESAPUSndInitted) bprintf(PRINT_ERROR, _T("nesapuWrite called without init\n")); -#endif - - struct nesapu_info *info = &nesapu_chips[chip]; //sndti_token(SOUND_NES, chip); - - if (address > 0x17) return; - - info->APU.regs[address]=value; - apu_update(info); - apu_regwrite(info,address,value); -} - -/* EXTERNAL INTERFACE FUNCTIONS */ - -/* UPDATE APU SYSTEM */ -void nesapuUpdate(INT32 chip, INT16 *buf, INT32 samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NESAPUSndInitted) bprintf(PRINT_ERROR, _T("nesapuUpdate called without init\n")); -#endif - - struct nesapu_info *info = &nesapu_chips[chip]; - - if (pBurnSoundOut == NULL) { - info->current_position = 0; - return; - } - - info->fill_buffer_hack = 1; - apu_update(info); - - INT32 nAdd = info->bAdd; - INT16 *stream = info->stream; - - UINT32 step = (info->samples_per_frame << 12) / nBurnSoundLen; - INT32 pos = 0; - - for (INT32 i = 0; i < samples; i++) { - if ((pos>>12) >= info->samples_per_frame) pos = (info->samples_per_frame-1) << 12; - - INT16 output = stream[pos>>12]; - - /* write sound data to the buffer */ - INT32 nLeftSample = 0, nRightSample = 0; - - if ((info->output_dir[BURN_SND_NESAPU_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((output / 6) * info->gain[BURN_SND_NESAPU_ROUTE_1]); - } - if ((info->output_dir[BURN_SND_NESAPU_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((output / 6) * info->gain[BURN_SND_NESAPU_ROUTE_1]); - } - if ((info->output_dir[BURN_SND_NESAPU_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((output / 6) * info->gain[BURN_SND_NESAPU_ROUTE_2]); - } - if ((info->output_dir[BURN_SND_NESAPU_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((output / 6) * info->gain[BURN_SND_NESAPU_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (nAdd) { - buf[LEFT] += nLeftSample; - buf[RIGHT] += nRightSample; - } else { - buf[LEFT] = nLeftSample; - buf[RIGHT] = nRightSample; - } - - buf += 2; - pos += step; - } - - info->current_position = 0; - memset (info->stream, 0, info->samples_per_frame * sizeof(INT16)); -} - -void nesapuReset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_NESAPUSndInitted) bprintf(PRINT_ERROR, _T("nesapuReset called without init\n")); -#endif - - for (INT32 i = 0; i < CHIP_NUM; i++) { - struct nesapu_info *info = &nesapu_chips[i]; - - info->current_position = 0; - info->fill_buffer_hack = 0; - - for (INT32 j = 0; j < 2; j++) - { - for (INT32 k = 0; k < 4; k++) { - info->APU.squ[j].regs[k] = 0; - } - info->APU.squ[j].vbl_length = 0; - info->APU.squ[j].freq = 0; - info->APU.squ[j].phaseacc = 0; - info->APU.squ[j].output_vol = 0; - info->APU.squ[j].env_phase = 0; - info->APU.squ[j].sweep_phase = 0; - info->APU.squ[j].adder = 0; - info->APU.squ[j].env_vol = 0; - info->APU.squ[j].enabled = 0; - } - - for (INT32 k = 0; k < 4; k++) { - info->APU.tri.regs[k] = 0; - } - info->APU.tri.linear_length = 0; - info->APU.tri.vbl_length = 0; - info->APU.tri.write_latency = 0; - info->APU.tri.phaseacc = 0; - info->APU.tri.output_vol = 0; - info->APU.tri.adder = 0; - info->APU.tri.counter_started = 0; - info->APU.tri.enabled = 0; - for (INT32 k = 0; k < 4; k++) { - info->APU.noi.regs[k] = 0; - } - info->APU.noi.cur_pos = 0; - info->APU.noi.vbl_length = 0; - info->APU.noi.phaseacc = 0; - info->APU.noi.output_vol = 0; - info->APU.noi.env_phase = 0; - info->APU.noi.env_vol = 0; - info->APU.noi.enabled = 0; - for (INT32 k = 0; k < 4; k++) { - info->APU.dpcm.regs[k] = 0; - } - info->APU.dpcm.address = 0; - info->APU.dpcm.length = 0; - info->APU.dpcm.bits_left = 0; - info->APU.dpcm.phaseacc = 0; - info->APU.dpcm.output_vol = 0; - info->APU.dpcm.cur_byte = 0; - info->APU.dpcm.enabled = 0; - info->APU.dpcm.irq_occurred = 0; - info->APU.dpcm.vol = 0; - for (INT32 k = 0; k < 17; k++) { - info->APU.regs[k] = 0; - } - info->APU.buf_pos = 0; - } -} - -/* INITIALIZE APU SYSTEM */ -void nesapuInit(INT32 chip, INT32 clock, UINT32 (*pSyncCallback)(INT32 samples_per_frame), INT32 bAdd) -{ - DebugSnd_NESAPUSndInitted = 1; - - struct nesapu_info *info = &nesapu_chips[chip]; - INT32 rate = clock / 4; - - memset(info, 0, sizeof(nesapu_info)); - - /* Initialize global variables */ - info->samps_per_sync = (rate * 100) / nBurnFPS; - info->buffer_size = info->samps_per_sync; - info->real_rate = (info->samps_per_sync * nBurnFPS) / 100; - info->apu_incsize = (float) (clock / (float) info->real_rate); - - /* Use initializer calls */ - create_noise(info->noise_lut, 13, NOISE_LONG); - create_vbltimes(info->vbl_times,vbl_length,info->samps_per_sync); - create_syncs(info, info->samps_per_sync); - - /* Adjust buffer size if 16 bits */ - info->buffer_size+=info->samps_per_sync; - - info->samples_per_frame = (clock * 100) / 4 / nBurnFPS; - - info->pSyncCallback = pSyncCallback; - - info->bAdd = bAdd; - - info->stream = NULL; - info->stream = (INT16*)BurnMalloc(info->samples_per_frame * sizeof(INT16)); - info->gain[BURN_SND_NESAPU_ROUTE_1] = 1.00; - info->gain[BURN_SND_NESAPU_ROUTE_2] = 1.00; - info->output_dir[BURN_SND_NESAPU_ROUTE_1] = BURN_SND_ROUTE_BOTH; - info->output_dir[BURN_SND_NESAPU_ROUTE_2] = BURN_SND_ROUTE_BOTH; -} - -void nesapuSetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NESAPUSndInitted) bprintf(PRINT_ERROR, _T("nesapuSetRoute called without init\n")); -#endif - - struct nesapu_info *info = &nesapu_chips[nChip]; - - info->gain[nIndex] = nVolume; - info->output_dir[nIndex] = nRouteDir; -} - -void nesapuExit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_NESAPUSndInitted) bprintf(PRINT_ERROR, _T("nesapuExit called without init\n")); -#endif - - if (!DebugSnd_NESAPUSndInitted) return; - - struct nesapu_info *info; - for (INT32 i = 0; i < CHIP_NUM; i++) - { - info = &nesapu_chips[i]; - if (info->stream) - BurnFree(info->stream); - } - - DebugSnd_NESAPUSndInitted = 0; -} - -INT32 nesapuScan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugSnd_NESAPUSndInitted) bprintf(PRINT_ERROR, _T("nesapuScan called without init\n")); -#endif - - if (nAction & ACB_DRIVER_DATA) - { - for (INT32 i = 0; i < CHIP_NUM; i++) - { - struct nesapu_info *info = &nesapu_chips[i]; - - for (INT32 j = 0; j < 2; j++) - { - for (INT32 k = 0; k < 4; k++) { - SCAN_VAR(info->APU.squ[j].regs[k]); // array[4] - } - SCAN_VAR(info->APU.squ[j].vbl_length); - SCAN_VAR(info->APU.squ[j].freq); - SCAN_VAR(info->APU.squ[j].phaseacc); - SCAN_VAR(info->APU.squ[j].output_vol); - SCAN_VAR(info->APU.squ[j].env_phase); - SCAN_VAR(info->APU.squ[j].sweep_phase); - SCAN_VAR(info->APU.squ[j].adder); - SCAN_VAR(info->APU.squ[j].env_vol); - SCAN_VAR(info->APU.squ[j].enabled); - } - - for (INT32 k = 0; k < 4; k++) { - SCAN_VAR(info->APU.tri.regs[k]); // array [4] - } - SCAN_VAR(info->APU.tri.linear_length); - SCAN_VAR(info->APU.tri.vbl_length); - SCAN_VAR(info->APU.tri.write_latency); - SCAN_VAR(info->APU.tri.phaseacc); - SCAN_VAR(info->APU.tri.output_vol); - SCAN_VAR(info->APU.tri.adder); - SCAN_VAR(info->APU.tri.counter_started); - SCAN_VAR(info->APU.tri.enabled); - for (INT32 k = 0; k < 4; k++) { - SCAN_VAR(info->APU.noi.regs[k]); // array [4] - } - SCAN_VAR(info->APU.noi.cur_pos); - SCAN_VAR(info->APU.noi.vbl_length); - SCAN_VAR(info->APU.noi.phaseacc); - SCAN_VAR(info->APU.noi.output_vol); - SCAN_VAR(info->APU.noi.env_phase); - SCAN_VAR(info->APU.noi.env_vol); - SCAN_VAR(info->APU.noi.enabled); - for (INT32 k = 0; k < 4; k++) { - SCAN_VAR(info->APU.dpcm.regs[k]); // array [4] - } - SCAN_VAR(info->APU.dpcm.address); - SCAN_VAR(info->APU.dpcm.length); - SCAN_VAR(info->APU.dpcm.bits_left); - SCAN_VAR(info->APU.dpcm.phaseacc); - SCAN_VAR(info->APU.dpcm.output_vol); - SCAN_VAR(info->APU.dpcm.cur_byte); - SCAN_VAR(info->APU.dpcm.enabled); - SCAN_VAR(info->APU.dpcm.irq_occurred); - SCAN_VAR(info->APU.dpcm.vol); - for (INT32 k = 0; k < 17; k++) { - SCAN_VAR(info->APU.regs[k]); // array [17] - } - SCAN_VAR(info->APU.buf_pos); - } - } - - return 0; -} diff --git a/jan/src/burn/snd/nes_apu.h b/jan/src/burn/snd/nes_apu.h deleted file mode 100644 index fb2aaba11..000000000 --- a/jan/src/burn/snd/nes_apu.h +++ /dev/null @@ -1,17 +0,0 @@ -void nesapuInit(INT32 chip, INT32 clock, UINT32 (*pSyncCallback)(INT32 samples_per_frame), INT32 nAdd); -void nesapuUpdate(INT32 chip, INT16 *buffer, INT32 samples); -void nesapuSetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void nesapuExit(); -void nesapuReset(); - -INT32 nesapuScan(INT32 nAction); - -void nesapuWrite(INT32 chip,INT32 address, UINT8 value); -UINT8 nesapuRead(INT32 chip,INT32 address); - -#define BURN_SND_NESAPU_ROUTE_1 0 -#define BURN_SND_NESAPU_ROUTE_2 1 - -#define nesapuSetAllRoutes(i, v, d) \ - nesapuSetRoute(i, BURN_SND_NESAPU_ROUTE_1, v, d); \ - nesapuSetRoute(i, BURN_SND_NESAPU_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/nes_defs.h b/jan/src/burn/snd/nes_defs.h deleted file mode 100644 index f6def1e41..000000000 --- a/jan/src/burn/snd/nes_defs.h +++ /dev/null @@ -1,206 +0,0 @@ -/***************************************************************************** - - MAME/MESS NES APU CORE - - Based on the Nofrendo/Nosefart NES N2A03 sound emulation core written by - Matthew Conte (matt@conte.com) and redesigned for use in MAME/MESS by - Who Wants to Know? (wwtk@mail.com) - - This core is written with the advise and consent of Matthew Conte and is - released under the GNU Public License. This core is freely avaiable for - use in any freeware project, subject to the following terms: - - Any modifications to this code must be duly noted in the source and - approved by Matthew Conte and myself prior to public submission. - - ***************************************************************************** - - NES_DEFS.H - - NES APU internal type definitions and constants. - - *****************************************************************************/ - -#pragma once - -#ifndef __NES_DEFS_H__ -#define __NES_DEFS_H__ - -/* BOOLEAN CONSTANTS */ -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -/* REGULAR TYPE DEFINITIONS */ -typedef INT8 int8; -typedef INT16 int16; -typedef INT32 int32; -typedef UINT8 uint8; -typedef UINT16 uint16; -typedef UINT32 uint32; -typedef UINT8 boolean; - - -/* QUEUE TYPES */ -#ifdef USE_QUEUE - -#define QUEUE_SIZE 0x2000 -#define QUEUE_MAX (QUEUE_SIZE-1) - -typedef struct queue_s -{ - INT32 pos; - UINT8 reg,val; -} queue_t; - -#endif - -/* REGISTER DEFINITIONS */ -#define APU_WRA0 0x00 -#define APU_WRA1 0x01 -#define APU_WRA2 0x02 -#define APU_WRA3 0x03 -#define APU_WRB0 0x04 -#define APU_WRB1 0x05 -#define APU_WRB2 0x06 -#define APU_WRB3 0x07 -#define APU_WRC0 0x08 -#define APU_WRC2 0x0A -#define APU_WRC3 0x0B -#define APU_WRD0 0x0C -#define APU_WRD2 0x0E -#define APU_WRD3 0x0F -#define APU_WRE0 0x10 -#define APU_WRE1 0x11 -#define APU_WRE2 0x12 -#define APU_WRE3 0x13 -#define APU_SMASK 0x15 -#define APU_IRQCTRL 0x17 - -#define NOISE_LONG 0x4000 -#define NOISE_SHORT 93 - -/* CHANNEL TYPE DEFINITIONS */ - -/* Square Wave */ -typedef struct square_s -{ - uint8 regs[4]; - INT32 vbl_length; - INT32 freq; - float phaseacc; - float output_vol; - float env_phase; - float sweep_phase; - uint8 adder; - uint8 env_vol; - boolean enabled; -} square_t; - -/* Triangle Wave */ -typedef struct triangle_s -{ - uint8 regs[4]; /* regs[1] unused */ - INT32 linear_length; - INT32 vbl_length; - INT32 write_latency; - float phaseacc; - float output_vol; - uint8 adder; - boolean counter_started; - boolean enabled; -} triangle_t; - -/* Noise Wave */ -typedef struct noise_s -{ - uint8 regs[4]; /* regs[1] unused */ - INT32 cur_pos; - INT32 vbl_length; - float phaseacc; - float output_vol; - float env_phase; - uint8 env_vol; - boolean enabled; -} noise_t; - -/* DPCM Wave */ -typedef struct dpcm_s -{ - uint8 regs[4]; - uint32 address; - uint32 length; - INT32 bits_left; - float phaseacc; - float output_vol; - uint8 cur_byte; - boolean enabled; - boolean irq_occurred; - INT8 vol; -} dpcm_t; - -/* APU type */ -typedef struct apu -{ - /* Sound channels */ - square_t squ[2]; - triangle_t tri; - noise_t noi; - dpcm_t dpcm; - - /* APU registers */ - UINT8 regs[0x18]; - - /* Sound pointers */ - void *buffer; - -#ifdef USE_QUEUE - - /* Event queue */ - queue_t queue[QUEUE_SIZE]; - INT32 head,tail; - -#else - - INT32 buf_pos; - -#endif - -} apu_t; - -/* CONSTANTS */ - -/* vblank length table used for squares, triangle, noise */ -static const uint8 vbl_length[32] = -{ - 5, 127, 10, 1, 19, 2, 40, 3, 80, 4, 30, 5, 7, 6, 13, 7, - 6, 8, 12, 9, 24, 10, 48, 11, 96, 12, 36, 13, 8, 14, 16, 15 -}; - -/* frequency limit of square channels */ -static const INT32 freq_limit[8] = -{ - 0x3FF, 0x555, 0x666, 0x71C, 0x787, 0x7C1, 0x7E0, 0x7F0, -}; - -/* table of noise frequencies */ -static const INT32 noise_freq[16] = -{ - 4, 8, 16, 32, 64, 96, 128, 160, 202, 254, 380, 508, 762, 1016, 2034, 2046 -}; - -/* dpcm transfer freqs */ -static const INT32 dpcm_clocks[16] = -{ - 428, 380, 340, 320, 286, 254, 226, 214, 190, 160, 142, 128, 106, 85, 72, 54 -}; - -/* ratios of pos/neg pulse for square waves */ -/* 2/16 = 12.5%, 4/16 = 25%, 8/16 = 50%, 12/16 = 75% */ -static const INT32 duty_lut[4] = -{ - 2, 4, 8, 12 -}; - -#endif /* __NES_DEFS_H__ */ diff --git a/jan/src/burn/snd/phoenixsound.cpp b/jan/src/burn/snd/phoenixsound.cpp deleted file mode 100644 index 15c2f746f..000000000 --- a/jan/src/burn/snd/phoenixsound.cpp +++ /dev/null @@ -1,646 +0,0 @@ -/**************************************************************************** - * - * Phoenix sound hardware simulation - still very ALPHA! - * - * If you find errors or have suggestions, please mail me. - * Juergen Buchmueller - * - ****************************************************************************/ - - -#include -#include "burnint.h" -#include "tms36xx.h" - -/**************************************************************************** - * 4006 - * Dual 4-bit and dual 5-bit serial-in serial-out shift registers. - * - * +----------+ - * 1D5 |1 +--+ 14| VCC - * /1Q4 |2 13| 1Q1 - * CLK |3 12| 2Q0 - * 2D4 |4 4006 11| 2Q0 - * 3D4 |5 10| 3Q0 - * 4D5 |6 9| 4Q0 - * GND |7 8| 4Q1 - * +----------+ - * - * [This information is part of the GIICM] - * - * Pin 8 and 9 are connected to an EXOR gate and the inverted - * output (EXNOR) is fed back to pin 1 (and the pseudo polynome output). - * - * 1D5 1Q1 2D4 2Q0 3D4 3Q0 4D5 4Q1 4Q0 - * +--+--+--+--+--+ +--+--+--+--+ +--+--+--+--+ +--+--+--+--+--+ - * +->| 0| 1| 2| 3| 4|->| 5| 6| 7| 8|->| 9|10|11|12|->|13|14|15|16|17| - * | +--+--+--+--+--+ +--+--+--+--+ +--+--+--+--+ +--+--+--+--+--+ - * | ____ | | - * | / |------------+ | - * +-----------------------------------------|EXNOR| | - * \____|---------------+ - * - ****************************************************************************/ - -#define VMIN 0 -#define VMAX 32767 - -static int sound_latch_a; -static int sound_latch_b; - -static int tone1_vco1_cap; -static int tone1_level; -static int tone2_level; - -static UINT32 *poly18 = NULL; - -static INT32 phoenixsnd_initted = 0; - -static int tone1_vco1(int samplerate) -{ - static int output, counter, level; - /* - * L447 (NE555): Ra=47k, Rb=100k, C = 0.01uF, 0.48uF, 1.01uF or 1.48uF - * charge times = 0.639*(Ra+Rb)*C = 0.0092s, 0.0451s, 0.0949s, 0.1390s - * discharge times = 0.639*Rb*C = 0.0064s, 0.0307s, 0.0645s, 0.0946s - */ - #define C18a 0.01e-6 - #define C18b 0.48e-6 - #define C18c 1.01e-6 - #define C18d 1.48e-6 - #define R40 47000 - #define R41 100000 - static int rate[2][4] = { - { - (int)(double)(VMAX*2/3/(0.693*(R40+R41)*C18a)), - (int)(double)(VMAX*2/3/(0.693*(R40+R41)*C18b)), - (int)(double)(VMAX*2/3/(0.693*(R40+R41)*C18c)), - (int)(double)(VMAX*2/3/(0.693*(R40+R41)*C18d)) - }, - { - (int)(double)(VMAX*2/3/(0.693*R41*C18a)), - (int)(double)(VMAX*2/3/(0.693*R41*C18b)), - (int)(double)(VMAX*2/3/(0.693*R41*C18c)), - (int)(double)(VMAX*2/3/(0.693*R41*C18d)) - } - }; - if( output ) - { - if (level > VMAX*1/3) - { - counter -= rate[1][tone1_vco1_cap]; - if( counter <= 0 ) - { - int steps = -counter / samplerate + 1; - counter += steps * samplerate; - if( (level -= steps) <= VMAX*1/3 ) - { - level = VMAX*1/3; - output = 0; - } - } - } - } - else - { - if (level < VMAX*2/3) - { - counter -= rate[0][tone1_vco1_cap]; - if( counter <= 0 ) - { - int steps = -counter / samplerate + 1; - counter += steps * samplerate; - if( (level += steps) >= VMAX*2/3 ) - { - level = VMAX*2/3; - output = 1; - } - } - } - } - return output; -} - -static int tone1_vco2(int samplerate) -{ - static int output, counter, level; - - /* - * L517 (NE555): Ra=570k, Rb=570k, C=10uF - * charge time = 0.639*(Ra+Rb)*C = 7.9002s - * discharge time = 0.639*Rb*C = 3.9501s - */ - #define C20 10.0e-6 - #define R43 570000 - #define R44 570000 - - if( output ) - { - if (level > VMIN) - { - counter -= (int)(VMAX*2/3 / (0.693 * R44 * C20)); - if( counter <= 0 ) - { - int steps = -counter / samplerate + 1; - counter += steps * samplerate; - if( (level -= steps) <= VMAX*1/3 ) - { - level = VMAX*1/3; - output = 0; - } - } - } - } - else - { - if (level < VMAX) - { - counter -= (int)(VMAX*2/3 / (0.693 * (R43 + R44) * C20)); - if( counter <= 0 ) - { - int steps = -counter / samplerate + 1; - counter += steps * samplerate; - if( (level += steps) >= VMAX*2/3 ) - { - level = VMAX*2/3; - output = 1; - } - } - } - } - - return output; -} - -static int tone1_vco(int samplerate, int vco1, int vco2) -{ - static int counter, level, rate, charge; - int voltage; - - if (level != charge) - { - /* charge or discharge C22 */ - counter -= rate; - while( counter <= 0 ) - { - counter += samplerate; - if( level < charge ) - { - if( ++level == charge ) - break; - } - else - { - if( --level == charge ) - break; - } - } - } - - if( vco2 ) - { - #define C22 100.0e-6 - #define R42 10000 - #define R45 51000 - #define R46 51000 - #define RP 27777 /* R42+R46 parallel with R45 */ - if( vco1 ) - { - /* R42 10k - * +5V -/\/\/------------+ - * 5V | - * +5V -/\/\/--+--/\/\/--+--> V/C - * R45 51k | R46 51k - * --- - * --- 100u - * | - * 0V - */ - charge = VMAX; - rate = (int)((charge - level) / (RP * C22)); - voltage = level + (VMAX-level) * R46 / (R46 + R42); - } - else - { - /* R42 10k - * 0V -/\/\/------------+ - * 2.7V | - * +5V -/\/\/--+--/\/\/--+--> V/C - * R45 51k | R46 51k - * --- - * --- 100u - * | - * 0V - */ - /* simplification: charge = (R42 + R46) / (R42 + R45 + R46); */ - charge = VMAX * 27 / 50; - if (charge >= level) - rate = (int)((charge - level) / (R45 * C22)); - else - rate = (int)((level - charge) / ((R46+R42) * C22)); - voltage = level * R42 / (R46 + R42); - } - } - else - { - if( vco1 ) - { - /* R42 10k - * +5V -/\/\/------------+ - * 2.3V | - * 0V -/\/\/--+--/\/\/--+--> V/C - * R45 51k | R46 51k - * --- - * --- 100u - * | - * 0V - */ - /* simplification: charge = VMAX * R45 / (R42 + R45 + R46); */ - charge = VMAX * 23 / 50; - if (charge >= level) - rate = (int)((charge - level) / ((R42 + R46) * C22)); - else - rate = (int)((level - charge) / (R45 * C22)); - voltage = level + (VMAX - level) * R46 / (R42 + R46); - } - else - { - /* R42 10k - * 0V -/\/\/------------+ - * 0V | - * 0V -/\/\/--+--/\/\/--+--> V/C - * R45 51k | R46 51k - * --- - * --- 100u - * | - * 0V - */ - charge = VMIN; - rate = (int)((level - charge) / (RP * C22)); - voltage = level * R42 / (R46 + R42); - } - } - - /* L507 (NE555): Ra=20k, Rb=20k, C=0.001uF - * frequency 1.44/((Ra+2*Rb)*C) = 24kHz - */ - return 24000*1/3 + 24000*2/3 * voltage / 32768; -} - -static int tone1(int samplerate) -{ - static int counter, divisor, output; - int vco1 = tone1_vco1(samplerate); - int vco2 = tone1_vco2(samplerate); - int frequency = tone1_vco(samplerate, vco1, vco2); - - if( (sound_latch_a & 15) != 15 ) - { - counter -= frequency; - while( counter <= 0 ) - { - counter += samplerate; - if( ++divisor == 16 ) - { - divisor = sound_latch_a & 15; - output ^= 1; - } - } - } - - return output ? tone1_level : -tone1_level; -} - -static int tone2_vco(int samplerate) -{ - static int counter, level; - - /* - * This is how the tone2 part of the circuit looks like. - * I was having a hard time to guesstimate the results - * and they might still be wrong :( - * - * +12V - * | - * / R23 - * \ 100k - * / - * !bit4 | /| R22 | - * 0V/5V >--|< |---/\/\/-----+-------+---> V C7 - * | \| 47k | | - * D4 | _|_ - * 6.8u --- \ / D5 - * C7 --- --- - * | | - * | | - * 0V >-------------------+-/\/\/-+ - * R24 33k - * - * V C7 min: - * 0.7V + (12V - 0.7V) * 19388 / (100000 + 19388) = 2.54V - * V C7 max: - * 0.7V + (12V - 0.7V) * 33000 / (100000 + 33000) + - * (12V - 5.7V) * 47000 / (100000 + 47000) = 5.51V - */ - - #define C7 6.8e-6 - #define R23 100000 - #define R22 47000 - #define R24 33000 - #define R22pR24 19388 - - #define C7_MIN (VMAX * 254 / 500) - #define C7_MAX (VMAX * 551 / 500) - #define C7_DIFF (C7_MAX - C7_MIN) - - if( (sound_latch_b & 0x10) == 0 ) - { - counter -= (C7_MAX - level) * 12 / (R23 * C7) / 5; - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level += n) > C7_MAX) - level = C7_MAX; - } - } - else - { - counter -= (level - C7_MIN) * 12 / (R22pR24 * C7) / 5; - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level -= n) < C7_MIN) - level = C7_MIN; - } - } - /* - * L487 (NE555): - * Ra = R25 (47k), Rb = R26 (47k), C = C8 (0.001uF) - * frequency 1.44/((Ra+2*Rb)*C) = 10212 Hz - */ - return 10212 * level / 32768; -} - -static int tone2(int samplerate) -{ - static int counter, divisor, output; - int frequency = tone2_vco(samplerate); - - if( (sound_latch_b & 15) != 15 ) - { - counter -= frequency; - while( counter <= 0 ) - { - counter += samplerate; - if( ++divisor == 16 ) - { - divisor = sound_latch_b & 15; - output ^= 1; - } - } - } - return output ? tone2_level : -tone2_level; -} - -static int update_c24(int samplerate) -{ - static int counter, level; - /* - * Noise frequency control (Port B): - * Bit 6 lo charges C24 (6.8u) via R51 (330) and when - * bit 6 is hi, C24 is discharged through R52 (20k) - * in approx. 20000 * 6.8e-6 = 0.136 seconds - */ - #define C24 6.8e-6 - #define R49 1000 - #define R51 330 - #define R52 20000 - if( sound_latch_a & 0x40 ) - { - if (level > VMIN) - { - counter -= (int)((level - VMIN) / (R52 * C24)); - if( counter <= 0 ) - { - int n = -counter / samplerate + 1; - counter += n * samplerate; - if( (level -= n) < VMIN) - level = VMIN; - } - } - } - else - { - if (level < VMAX) - { - counter -= (int)((VMAX - level) / ((R51+R49) * C24)); - if( counter <= 0 ) - { - int n = -counter / samplerate + 1; - counter += n * samplerate; - if( (level += n) > VMAX) - level = VMAX; - } - } - } - return VMAX - level; -} - -static int update_c25(int samplerate) -{ - static int counter, level; - /* - * Bit 7 hi charges C25 (6.8u) over a R50 (1k) and R53 (330) and when - * bit 7 is lo, C25 is discharged through R54 (47k) - * in about 47000 * 6.8e-6 = 0.3196 seconds - */ - #define C25 6.8e-6 - #define R50 1000 - #define R53 330 - #define R54 47000 - - if( sound_latch_a & 0x80 ) - { - if (level < VMAX) - { - counter -= (int)((VMAX - level) / ((R50+R53) * C25)); - if( counter <= 0 ) - { - int n = -counter / samplerate + 1; - counter += n * samplerate; - if( (level += n) > VMAX ) - level = VMAX; - } - } - } - else - { - if (level > VMIN) - { - counter -= (int)((level - VMIN) / (R54 * C25)); - if( counter <= 0 ) - { - int n = -counter / samplerate + 1; - counter += n * samplerate; - if( (level -= n) < VMIN ) - level = VMIN; - } - } - } - return level; -} - - -static int noise(int samplerate) -{ - static int counter, polyoffs, polybit, lowpass_counter, lowpass_polybit; - int vc24 = update_c24(samplerate); - int vc25 = update_c25(samplerate); - int sum = 0, level, frequency; - - /* - * The voltage levels are added and control I(CE) of transistor TR1 - * (NPN) which then controls the noise clock frequency (linearily?). - * level = voltage at the output of the op-amp controlling the noise rate. - */ - if( vc24 < vc25 ) - level = vc24 + (vc25 - vc24) / 2; - else - level = vc25 + (vc24 - vc25) / 2; - - frequency = 588 + 6325 * level / 32768; - - /* - * NE555: Ra=47k, Rb=1k, C=0.05uF - * minfreq = 1.44 / ((47000+2*1000) * 0.05e-6) = approx. 588 Hz - * R71 (2700 Ohms) parallel to R73 (47k Ohms) = approx. 2553 Ohms - * maxfreq = 1.44 / ((2553+2*1000) * 0.05e-6) = approx. 6325 Hz - */ - counter -= frequency; - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - polyoffs = (polyoffs + n) & 0x3ffff; - polybit = (poly18[polyoffs>>5] >> (polyoffs & 31)) & 1; - } - if (!polybit) - sum += vc24; - - /* 400Hz crude low pass filter: this is only a guess!! */ - lowpass_counter -= 400; - if( lowpass_counter <= 0 ) - { - lowpass_counter += samplerate; - lowpass_polybit = polybit; - } - if (!lowpass_polybit) - sum += vc25; - - return sum; -} - -void phoenix_sound_update(INT16 *buffer, int length) -{ - int samplerate = nBurnSoundRate; - - INT16 *buffer2 = buffer; - INT32 length2 = length; - - memset(buffer, 0, length * 2 * 2); - - while( length-- > 0 ) - { - INT32 sum = (tone1(samplerate) + tone2(samplerate) + noise(samplerate)) / 4; - INT16 sam = BURN_SND_CLIP(sum * 0.60); - *buffer++ = sam; //r - *buffer++ = sam; //l - } - - tms36xx_sound_update(buffer2, length2); -} - -void phoenix_sound_control_a_w(INT32 address, UINT8 data) -{ - if( data == sound_latch_a ) - return; - - sound_latch_a = data; - - tone1_vco1_cap = (sound_latch_a >> 4) & 3; - if( sound_latch_a & 0x20 ) - tone1_level = VMAX * 10000 / (10000+10000); - else - tone1_level = VMAX; -} - -void phoenix_sound_control_b_w(INT32 address, UINT8 data) -{ - if( data == sound_latch_b ) - return; - - sound_latch_b = data; - - if( sound_latch_b & 0x20 ) - tone2_level = VMAX * 10 / 11; - else - tone2_level = VMAX; - - /* eventually change the tune that the MM6221AA is playing */ - mm6221aa_tune_w(sound_latch_b >> 6); -} - -void phoenix_sound_reset() -{ - sound_latch_a = sound_latch_b = 0; - tone1_vco1_cap = 0; - tone1_level = VMAX; - tone2_level = VMAX; - tms36xx_reset(); -} - -void phoenix_sound_init() -{ - int i, j; - UINT32 shiftreg; - - poly18 = (UINT32 *)BurnMalloc((1ul << (18-5)) * sizeof(UINT32)); - - if( !poly18 ) - return; - - shiftreg = 0; - for( i = 0; i < (1ul << (18-5)); i++ ) - { - UINT32 bits = 0; - for( j = 0; j < 32; j++ ) - { - bits = (bits >> 1) | (shiftreg << 31); - if( ((shiftreg >> 16) & 1) == ((shiftreg >> 17) & 1) ) - shiftreg = (shiftreg << 1) | 1; - else - shiftreg <<= 1; - } - poly18[i] = bits; - } - - double decays[6] = {0.50,0,0,1.05,0,0}; - tms36xx_init(372, MM6221AA, &decays[0], 0.21); - - phoenix_sound_reset(); - - phoenixsnd_initted = 1; -} - -void phoenix_sound_deinit() -{ - if (!phoenixsnd_initted) return; - - phoenixsnd_initted = 0; - - BurnFree(poly18); - - tms36xx_deinit(); -} diff --git a/jan/src/burn/snd/phoenixsound.h b/jan/src/burn/snd/phoenixsound.h deleted file mode 100644 index 68f885ed2..000000000 --- a/jan/src/burn/snd/phoenixsound.h +++ /dev/null @@ -1,7 +0,0 @@ -void phoenix_sound_update(INT16 *buffer, int length); -void phoenix_sound_control_a_w(INT32 address, UINT8 data); -void phoenix_sound_control_b_w(INT32 address, UINT8 data); -void phoenix_sound_reset(); -void phoenix_sound_init(); -void phoenix_sound_deinit(); - diff --git a/jan/src/burn/snd/pleiadssound.cpp b/jan/src/burn/snd/pleiadssound.cpp deleted file mode 100644 index 49371ffc6..000000000 --- a/jan/src/burn/snd/pleiadssound.cpp +++ /dev/null @@ -1,694 +0,0 @@ -/**************************************************************************** - * - * Sound hardware for Pleiades, Naughty Boy and Pop Flamer. - * - * If you find errors or have suggestions, please mail me. - * Juergen Buchmueller - * - ****************************************************************************/ -#include "burnint.h" -#include "tms36xx.h" - -#define VMIN 0 -#define VMAX 32767 - -//static int channel; - -static int sound_latch_a; -static int sound_latch_b; -static int sound_latch_c; /* part of the videoreg_w latch */ - -static UINT32 *poly18 = NULL; -static int polybit; -static double custom_volume = 1.00; - -static INT32 pleiadssound_initted = 0; - -/* fixed 8kHz clock */ -#define TONE1_CLOCK 8000 - -/* some resistor and capacitor dependent values which - vary between the (otherwise identical) boards. */ -static double pa5_charge_time; -static double pa5_discharge_time; - -static double pa6_charge_time; -static double pa6_discharge_time; - -static double pb4_charge_time; -static double pb4_discharge_time; - -static double pc4_charge_time; -static double pc4_discharge_time; - -static double pc5_charge_time; -static double pc5_discharge_time; - -static int pa5_resistor; -static int pc5_resistor; - -static int tone2_max_freq; -static int tone3_max_freq; -static int tone4_max_freq; -static int noise_freq; -static int polybit_resistor; -static int opamp_resistor; - -/***************************************************************************** - * Tone #1 is a fixed 8 kHz signal divided by 1 to 15. - *****************************************************************************/ -static int tone1(int samplerate) -{ - static int counter, divisor, output; - - if( (sound_latch_a & 15) != 15 ) - { - counter -= TONE1_CLOCK; - while( counter <= 0 ) - { - counter += samplerate; - if( ++divisor == 16 ) - { - divisor = sound_latch_a & 15; - output ^= 1; - } - } - } - return output ? VMAX : -VMAX; -} - -/***************************************************************************** - * Tones #2 and #3 are coming from the upper 556 chip - * It's labelled IC96 in Pop Flamer, 4D(??) in Naughty Boy. - * C68 controls the frequencies of tones #2 and #3 (V/C inputs) - *****************************************************************************/ -static int update_pb4(int samplerate) -{ - static int counter, level; - - /* bit 4 of latch B: charge 10uF (C28/C68) through 10k (R19/R25) */ - if( sound_latch_b & 0x10 ) - { - if( level < VMAX ) - { - counter -= (int)((VMAX - level) / pb4_charge_time); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level += n) > VMAX ) - level = VMAX; - } - } - } - else - { - if( level > VMIN ) - { - counter -= (int)((level - VMIN) / pb4_discharge_time); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level -= n) < VMIN) - level = VMIN; - } - } - } - return level; -} - -static int tone23(int samplerate) -{ - static int counter2, output2, counter3, output3; - int level = VMAX - update_pb4(samplerate); - int sum = 0; - - /* bit 5 = low: tone23 disabled */ - if( (sound_latch_b & 0x20) == 0 ) - return sum; - - /* modulate timers from the upper 556 with the voltage on Cxx on PB4. */ - if( level < VMAX ) - { - counter2 -= tone2_max_freq * level / 32768; - if( counter2 <= 0 ) - { - int n = (-counter2 / samplerate) + 1; - counter2 += n * samplerate; - output2 = (output2 + n) & 1; - } - - counter3 -= tone3_max_freq*1/3 + tone3_max_freq*2/3 * level / 33768; - if( counter3 <= 0 ) - { - int n = (-counter2 / samplerate) + 1; - counter3 += samplerate; - output3 = (output3 + n) & 1; - } - } - - sum += (output2) ? VMAX : -VMAX; - sum += (output3) ? VMAX : -VMAX; - - return sum / 2; -} - -/***************************************************************************** - * Tone #4 comes from upper half of the lower 556 (IC98 in Pop Flamer) - * It's modulated by the voltage at C49, which is then divided between - * 0V or 5V, depending on the polynome output bit. - * The tone signal gates two signals (bits 5 of latches A and C), but - * these are also swept between two levels (C52 and C53 in Pop Flamer). - *****************************************************************************/ -static int update_c_pc4(int samplerate) -{ - #define PC4_MIN (int)(VMAX * 7 / 50) - - static int counter, level = PC4_MIN; - - /* bit 4 of latch C: (part of videoreg_w) hi? */ - if (sound_latch_c & 0x10) - { - if (level < VMAX) - { - counter -= (int)((VMAX - level) / pc4_charge_time); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level += n) > VMAX ) - level = VMAX; - } - } - } - else - { - if (level > PC4_MIN) - { - counter -= (int)((level - PC4_MIN) / pc4_discharge_time); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level -= n) < PC4_MIN ) - level = PC4_MIN; - } - } - } - return level; -} - -static int update_c_pc5(int samplerate) -{ - static int counter, level; - - /* bit 5 of latch C: charge or discharge C52 */ - if (sound_latch_c & 0x20) - { - if (level < VMAX) - { - counter -= (int)((VMAX - level) / pc5_charge_time); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level += n) > VMAX ) - level = VMAX; - } - } - } - else - { - if (level > VMIN) - { - counter -= (int)((level - VMIN) / pc5_discharge_time); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += samplerate; - if( (level -= n) < VMIN ) - level = VMIN; - } - } - } - return level; -} - -static int update_c_pa5(int samplerate) -{ - static int counter, level; - - /* bit 5 of latch A: charge or discharge C63 */ - if (sound_latch_a & 0x20) - { - if (level < VMAX) - { - counter -= (int)((VMAX - level) / pa5_charge_time); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level += n) > VMAX ) - level = VMAX; - } - } - } - else - { - if (level > VMIN) - { - counter -= (int)((level - VMIN) / pa5_discharge_time); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += samplerate; - if( (level -= n) < VMIN ) - level = VMIN; - } - } - } - return level; -} - -static int tone4(int samplerate) -{ - static int counter, output; - int level = update_c_pc4(samplerate); - int vpc5 = update_c_pc5(samplerate); - int vpa5 = update_c_pa5(samplerate); - int sum; - - /* Two resistors divide the output voltage of the op-amp between - * polybit = 0: 0V and level: x * opamp_resistor / (opamp_resistor + polybit_resistor) - * polybit = 1: level and 5V: x * polybit_resistor / (opamp_resistor + polybit_resistor) - */ - if (polybit) - level = level + (VMAX - level) * opamp_resistor / (opamp_resistor + polybit_resistor); - else - level = level * polybit_resistor / (opamp_resistor + polybit_resistor); - - counter -= tone4_max_freq * level / 32768; - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - output = (output + n) & 1; - } - - /* mix the two signals */ - sum = vpc5 * pa5_resistor / (pa5_resistor + pc5_resistor) + - vpa5 * pc5_resistor / (pa5_resistor + pc5_resistor); - - return (output) ? sum : -sum; -} - -/***************************************************************************** - * Noise comes from a shift register (4006) hooked up just like in Phoenix. - * Difference: the clock frequecy is toggled between two values only by - * bit 4 of latch A. The output of the first shift register can be zapped(?) - * by some control line (IC87 in Pop Flamer: not yet implemented) - *****************************************************************************/ -static int update_c_pa6(int samplerate) -{ - static int counter, level; - - /* bit 6 of latch A: charge or discharge C63 */ - if (sound_latch_a & 0x40) - { - if (level < VMAX) - { - counter -= (int)((VMAX - level) / pa6_charge_time); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level += n) > VMAX ) - level = VMAX; - } - } - } - else - { - /* only discharge of poly bit is active */ - if (polybit && level > VMIN) - { - /* discharge 10uF through 10k -> 0.1s */ - counter -= (int)((level - VMIN) / 0.1); - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - if( (level -= n) < VMIN ) - level = VMIN; - } - } - } - return level; -} - - -static int noise(int samplerate) -{ - static int counter, polyoffs; - int c_pa6_level = update_c_pa6(samplerate); - int sum = 0; - - /* - * bit 4 of latch A: noise counter rate modulation? - * CV2 input of lower 556 is connected via 2k resistor - */ - if ( sound_latch_a & 0x10 ) - counter -= noise_freq * 2 / 3; /* ????? */ - else - counter -= noise_freq * 1 / 3; /* ????? */ - - if( counter <= 0 ) - { - int n = (-counter / samplerate) + 1; - counter += n * samplerate; - polyoffs = (polyoffs + n) & 0x3ffff; - polybit = (poly18[polyoffs>>5] >> (polyoffs & 31)) & 1; - } - - /* The polynome output bit is used to gate bits 6 + 7 of - * sound latch A through the upper half of a 4066 chip. - * Bit 6 is sweeping a capacitor between 0V and 4.7V - * while bit 7 is connected directly to the 4066. - * Both outputs are then filtered, bit 7 even twice, - * but it's beyond me what the filters there are doing... - */ - if (polybit) - { - sum += c_pa6_level; - /* bit 7 is connected directly */ - if (sound_latch_a & 0x80) - sum += VMAX; - } - else - { - sum -= c_pa6_level; - /* bit 7 is connected directly */ - if (sound_latch_a & 0x80) - sum -= VMAX; - } - - return sum / 2; -} - -void pleiads_sound_update(INT16 *buffer, int length) -{ - int rate = nBurnSoundRate; - - INT16 *buffer2 = buffer; - INT32 length2 = length; - - memset(buffer, 0, length * 2 * 2); - - while( length-- > 0 ) - { - INT32 sum = tone1(rate)/2 + tone23(rate)/2 + tone4(rate) + noise(rate); - INT16 sam = BURN_SND_CLIP(sum * custom_volume); - *buffer++ = sam; //r - *buffer++ = sam; //l - } - - tms36xx_sound_update(buffer2, length2); -} - -void pleiads_sound_control_a_w(INT32 address, UINT8 data) -{ - if (data == sound_latch_a) - return; - - //logerror("pleiads_sound_control_b_w $%02x\n", data); - - sound_latch_a = data; -} - -void pleiads_sound_control_b_w(INT32 address, UINT8 data) -{ - /* - * pitch selects one of 4 possible clock inputs - * (actually 3, because IC2 and IC3 are tied together) - * write note value to TMS3615; voice b1 & b2 - */ - int note = data & 15; - int pitch = (data >> 6) & 3; - - if (data == sound_latch_b) - return; - - //bprintf(0, _T("b_w %x sl %x."), data, sound_latch_b); - - if (note==0) return; // this is a hack added by dink, sound wont work without this. what gives?? - - if (pitch == 3) - pitch = 2; /* 2 and 3 are the same */ - - tms36xx_note_w(pitch, note); - - sound_latch_b = data; -} - -/* two bits (4 + 5) from the videoreg_w latch go here */ -void pleiads_sound_control_c_w(INT32 address, UINT8 data) -{ - if (data == sound_latch_c) - return; - - sound_latch_c = data; -} - -void pleiads_sound_init(int naughtybpopflamer) -{ - UINT32 shiftreg; - - poly18 = (UINT32 *)BurnMalloc((1ul << (18-5)) * sizeof(UINT32)); - - if( !poly18 ) - return; - - shiftreg = 0; - for(int i = 0; i < (1ul << (18-5)); i++ ) - { - UINT32 bits = 0; - for(int j = 0; j < 32; j++ ) - { - bits = (bits >> 1) | (shiftreg << 31); - if( ((shiftreg >> 16) & 1) == ((shiftreg >> 17) & 1) ) - shiftreg = (shiftreg << 1) | 1; - else - shiftreg <<= 1; - } - poly18[i] = bits; - } - - if (naughtybpopflamer) { - double decays[6] = {0.15, 0.20, 0, 0, 0, 0}; - tms36xx_init(350, TMS3615, &decays[0], 0.00); - } else { - double decays[6] = {0.33,0.33,0,0.33,0,0.33}; - tms36xx_init(247, TMS3615, &decays[0], 0.00); - } - pleiadssound_initted = 1; -} - -void pleiads_sound_deinit() -{ - if (!pleiadssound_initted) return; - - BurnFree(poly18); - - tms36xx_deinit(); - pleiadssound_initted = 0; -} - -static void internal_reset() -{ - sound_latch_a = sound_latch_b = sound_latch_c = 0; - tms36xx_reset(); -} - -void pleiads_sound_reset() -{ - /* The real values are _unknown_! - * I took the ones from Naughty Boy / Pop Flamer - */ - - /* charge 10u?? (C??) through 330K?? (R??) -> 3.3s */ - pa5_charge_time = 3.3; - - /* discharge 10u?? (C??) through 220k?? (R??) -> 2.2s */ - pa5_discharge_time = 2.2; - - /* charge 2.2uF?? through 330?? -> 0.000726s */ - pa6_charge_time = 0.000726; - - /* discharge 2.2uF?? through 10k?? -> 0.22s */ - pa6_discharge_time = 0.022; - - /* 10k and 10uF */ - pb4_charge_time = 0.1; - pb4_discharge_time = 0.1; - - /* charge C49 (22u?) via R47 (2k?) and R48 (1k) - * time constant (1000+2000) * 22e-6 = 0.066s */ - pc4_charge_time = 0.066; - - /* discharge C49 (22u?) via R48 (1k) and diode D1 - * time constant 1000 * 22e-6 = 0.022s */ - pc4_discharge_time = 0.022; - - /* charge 10u?? through 330 -> 0.0033s */ - pc5_charge_time = 0.0033; - - /* discharge 10u?? through ??k (R??) -> 0.1s */ - pc5_discharge_time = 0.1; - - /* both in K */ - pa5_resistor = 33; - pc5_resistor = 47; - - /* upper 556 upper half: Ra=10k??, Rb=200k??, C=0.01uF?? -> 351Hz */ - tone2_max_freq = 351; - - /* upper 556 lower half: Ra=47k??, Rb=100k??, C=0.01uF?? -> 582Hz */ - tone3_max_freq = 582; - - /* lower 556 upper half: Ra=33k??, Rb=100k??, C=0.0047uF?? - freq = 1.44 / ((33000+2*100000) * 0.0047e-6) = approx. 1315 Hz */ - tone4_max_freq = 1315; - - /* how to divide the V/C voltage for tone #4 */ - polybit_resistor = 47; - opamp_resistor = 20; - - /* lower 556 lower half: Ra=100k??, Rb=1k??, C=0.01uF?? - freq = 1.44 / ((100000+2*1000) * 0.01e-6) = approx. 1412 Hz */ - noise_freq = 1412; /* higher noise rate than popflame/naughtyb??? */ - - custom_volume = 0.60; - - internal_reset(); - //return common_sh_start(msound, "Custom (Pleiads)"); -} - -void naughtyb_sound_reset() -{ - /* charge 10u??? through 330K (R??) -> 3.3s */ - pa5_charge_time = 3.3; - - /* discharge 10u through 220k (R??) -> 2.1s */ - pa5_discharge_time = 2.2; - - /* charge 2.2uF through 330 -> 0.000726s */ - pa6_charge_time = 0.000726; - - /* discharge 2.2uF through 10K -> 0.022s */ - pa6_discharge_time = 0.022; - - /* 10k and 10uF */ - pb4_charge_time = 0.1; - pb4_discharge_time = 0.1; - - /* charge 10uF? (C??) via 3k?? (R??) and 2k?? (R28?) - * time constant (3000+2000) * 10e-6 = 0.05s */ - pc4_charge_time = 0.05 * 10; - - /* discharge 10uF? (C??) via 2k?? R28?? and diode D? - * time constant 2000 * 10e-6 = 0.02s */ - pc4_discharge_time = 0.02 * 10; - - /* charge 10u through 330 -> 0.0033s */ - pc5_charge_time = 0.0033; - - /* discharge 10u through ??k (R??) -> 0.1s */ - pc5_discharge_time = 0.1; - - /* both in K */ - pa5_resistor = 100; - pc5_resistor = 78; - - /* upper 556 upper half: 10k, 200k, 0.01uF -> 351Hz */ - tone2_max_freq = 351; - - /* upper 556 lower half: 47k, 200k, 0.01uF -> 322Hz */ - tone3_max_freq = 322; - - /* lower 556 upper half: Ra=33k, Rb=100k, C=0.0047uF - freq = 1.44 / ((33000+2*100000) * 0.0047e-6) = approx. 1315 Hz */ - tone4_max_freq = 1315; - - /* how to divide the V/C voltage for tone #4 */ - polybit_resistor = 47; - opamp_resistor = 20; - - /* lower 556 lower half: Ra=200k, Rb=1k, C=0.01uF - freq = 1.44 / ((200000+2*1000) * 0.01e-6) = approx. 713 Hz */ - noise_freq = 713; - - custom_volume = 0.40; - - internal_reset(); -// return common_sh_start(msound, "Custom (Naughty Boy)"); -} - -void popflame_sound_reset() -{ - /* charge 10u (C63 in Pop Flamer) through 330K -> 3.3s */ - pa5_charge_time = 3.3; - - /* discharge 10u (C63 in Pop Flamer) through 220k -> 2.2s */ - pa5_discharge_time = 2.2; - - /* charge 2.2uF through 330 -> 0.000726s */ - pa6_charge_time = 0.000726; - - /* discharge 2.2uF through 10K -> 0.022s */ - pa6_discharge_time = 0.022; - - /* 2k and 10uF */ - pb4_charge_time = 0.02; - pb4_discharge_time = 0.02; - - /* charge 2.2uF (C49?) via R47 (100) and R48 (1k) - * time constant (100+1000) * 2.2e-6 = 0.00242 */ - pc4_charge_time = 0.000242; - - /* discharge 2.2uF (C49?) via R48 (1k) and diode D1 - * time constant 1000 * 22e-6 = 0.0022s */ - pc4_discharge_time = 0.00022; - - /* charge 22u (C52 in Pop Flamer) through 10k -> 0.22s */ - pc5_charge_time = 0.22; - - /* discharge 22u (C52 in Pop Flamer) through ??k (R??) -> 0.1s */ - pc5_discharge_time = 0.1; - - /* both in K */ - pa5_resistor = 33; - pc5_resistor = 47; - - /* upper 556 upper half: Ra=10k, Rb=100k, C=0.01uF -> 1309Hz */ - tone2_max_freq = 1309; - - /* upper 556 lower half: Ra=10k??, Rb=120k??, C=0.01uF -> 1108Hz */ - tone3_max_freq = 1108; - - /* lower 556 upper half: Ra=33k, Rb=100k, C=0.0047uF - freq = 1.44 / ((33000+2*100000) * 0.0047e-6) = approx. 1315 Hz */ - tone4_max_freq = 1315; - - /* how to divide the V/C voltage for tone #4 */ - polybit_resistor = 20; - opamp_resistor = 20; - - /* lower 556 lower half: Ra=200k, Rb=1k, C=0.01uF - freq = 1.44 / ((200000+2*1000) * 0.01e-6) = approx. 713 Hz */ - noise_freq = 713; - - custom_volume = 0.40; - - internal_reset(); -} diff --git a/jan/src/burn/snd/pleiadssound.h b/jan/src/burn/snd/pleiadssound.h deleted file mode 100644 index ecb0c8287..000000000 --- a/jan/src/burn/snd/pleiadssound.h +++ /dev/null @@ -1,10 +0,0 @@ -void pleiads_sound_update(INT16 *buffer, int length); -void pleiads_sound_control_a_w(INT32 address, UINT8 data); -void pleiads_sound_control_b_w(INT32 address, UINT8 data); -void pleiads_sound_control_c_w(INT32 address, UINT8 data); -void pleiads_sound_reset(); -void naughtyb_sound_reset(); -void popflame_sound_reset(); -void pleiads_sound_init(int naughtybpopflamer); -void pleiads_sound_deinit(); - diff --git a/jan/src/burn/snd/pokey.cpp b/jan/src/burn/snd/pokey.cpp deleted file mode 100644 index d015960d2..000000000 --- a/jan/src/burn/snd/pokey.cpp +++ /dev/null @@ -1,1529 +0,0 @@ -/***************************************************************************** - * - * POKEY chip emulator 4.3 - * Copyright (c) 2000 by The MAME Team - * - * Based on original info found in Ron Fries' Pokey emulator, - * with additions by Brad Oliver, Eric Smith and Juergen Buchmueller, - * paddle (a/d conversion) details from the Atari 400/800 Hardware Manual. - * Polynome algorithms according to info supplied by Perry McFarlane. - * - * This code is subject to the MAME license, which besides other - * things means it is distributed as is, no warranties whatsoever. - * For more details read the readme.txt that comes with MAME. - * - * 4.3: - * - for POT inputs returning zero, immediately assert the ALLPOT - * bit after POTGO is written, otherwise start trigger timer - * depending on SK_PADDLE mode, either 1-228 scanlines or 1-2 - * scanlines, depending on the SK_PADDLE bit of SKCTL. - * 4.2: - * - half volume for channels which are inaudible (this should be - * close to the real thing). - * 4.1: - * - default gain increased to closely match the old code. - * - random numbers repeat rate depends on POLY9 flag too! - * - verified sound output with many, many Atari 800 games, - * including the SUPPRESS_INAUDIBLE optimizations. - * 4.0: - * - rewritten from scratch. - * - 16bit stream interface. - * - serout ready/complete delayed interrupts. - * - reworked pot analog/digital conversion timing. - * - optional non-indexing pokey update functions. - * - *****************************************************************************/ - -#include "burnint.h" -#include "pokey.h" - -/* - * Defining this produces much more (about twice as much) - * but also more efficient code. Ideally this should be set - * for processors with big code cache and for healthy compilers :) - */ -#define HEAVY_MACRO_USAGE 0 - -#define SUPPRESS_INAUDIBLE 1 - -/* Four channels with a range of 0..32767 and volume 0..15 */ -//#define POKEY_DEFAULT_GAIN (32767/15/4) - -/* - * But we raise the gain and risk clipping, the old Pokey did - * this too. It defined POKEY_DEFAULT_GAIN 6 and this was - * 6 * 15 * 4 = 360, 360/256 = 1.40625 - * I use 15/11 = 1.3636, so this is a little lower. - */ -#define POKEY_DEFAULT_GAIN (32767/11/4) -static double pokey_mastervol = 1.0; -static INT32 nLeftSample = 0, nRightSample = 0; - -#define VERBOSE 0 -#define VERBOSE_SOUND 0 -#define VERBOSE_TIMER 0 -#define VERBOSE_POLY 0 -#define VERBOSE_RAND 0 - -#if VERBOSE -#define LOG(x) if( errorlog ) fprintf x -#else -#define LOG(x) -#endif - -#if VERBOSE_SOUND -#define LOG_SOUND(x) if( errorlog ) fprintf x -#else -#define LOG_SOUND(x) -#endif - -#if VERBOSE_TIMER -#define LOG_TIMER(x) if( errorlog ) fprintf x -#else -#define LOG_TIMER(x) -#endif - -#if VERBOSE_POLY -#define LOG_POLY(x) if( errorlog ) fprintf x -#else -#define LOG_POLY(x) -#endif - -#if VERBOSE_RAND -#define LOG_RAND(x) if( errorlog ) fprintf x -#else -#define LOG_RAND(x) -#endif - -#define CHAN1 0 -#define CHAN2 1 -#define CHAN3 2 -#define CHAN4 3 - -#define TIMER1 0 -#define TIMER2 1 -#define TIMER4 2 - -/* values to add to the divisors for the different modes */ -#define DIVADD_LOCLK 1 -#define DIVADD_HICLK 4 -#define DIVADD_HICLK_JOINED 7 - -/* AUDCx */ -#define NOTPOLY5 0x80 /* selects POLY5 or direct CLOCK */ -#define POLY4 0x40 /* selects POLY4 or POLY17 */ -#define PURE 0x20 /* selects POLY4/17 or PURE tone */ -#define VOLUME_ONLY 0x10 /* selects VOLUME OUTPUT ONLY */ -#define VOLUME_MASK 0x0f /* volume mask */ - -/* AUDCTL */ -#define POLY9 0x80 /* selects POLY9 or POLY17 */ -#define CH1_HICLK 0x40 /* selects 1.78979 MHz for Ch 1 */ -#define CH3_HICLK 0x20 /* selects 1.78979 MHz for Ch 3 */ -#define CH12_JOINED 0x10 /* clocks channel 1 w/channel 2 */ -#define CH34_JOINED 0x08 /* clocks channel 3 w/channel 4 */ -#define CH1_FILTER 0x04 /* selects channel 1 high pass filter */ -#define CH2_FILTER 0x02 /* selects channel 2 high pass filter */ -#define CLK_15KHZ 0x01 /* selects 15.6999 kHz or 63.9211 kHz */ - -/* IRQEN (D20E) */ -#define IRQ_BREAK 0x80 /* BREAK key pressed interrupt */ -#define IRQ_KEYBD 0x40 /* keyboard data ready interrupt */ -#define IRQ_SERIN 0x20 /* serial input data ready interrupt */ -#define IRQ_SEROR 0x10 /* serial output register ready interrupt */ -#define IRQ_SEROC 0x08 /* serial output complete interrupt */ -#define IRQ_TIMR4 0x04 /* timer channel #4 interrupt */ -#define IRQ_TIMR2 0x02 /* timer channel #2 interrupt */ -#define IRQ_TIMR1 0x01 /* timer channel #1 interrupt */ - -/* SKSTAT (R/D20F) */ -#define SK_FRAME 0x80 /* serial framing error */ -#define SK_OVERRUN 0x40 /* serial overrun error */ -#define SK_KBERR 0x20 /* keyboard overrun error */ -#define SK_SERIN 0x10 /* serial input high */ -#define SK_SHIFT 0x08 /* shift key pressed */ -#define SK_KEYBD 0x04 /* keyboard key pressed */ -#define SK_SEROUT 0x02 /* serial output active */ - -/* SKCTL (W/D20F) */ -#define SK_BREAK 0x80 /* serial out break signal */ -#define SK_BPS 0x70 /* bits per second */ -#define SK_FM 0x08 /* FM mode */ -#define SK_PADDLE 0x04 /* fast paddle a/d conversion */ -#define SK_RESET 0x03 /* reset serial/keyboard interface */ - -#define DIV_64 28 /* divisor for 1.78979 MHz clock to 63.9211 kHz */ -#define DIV_15 114 /* divisor for 1.78979 MHz clock to 15.6999 kHz */ - -struct POKEYregisters { - INT32 counter[4]; /* channel counter */ - INT32 divisor[4]; /* channel divisor (modulo value) */ - UINT32 volume[4]; /* channel volume - derived */ - UINT8 output[4]; /* channel output signal (1 active, 0 inactive) */ - UINT8 audible[4]; /* channel plays an audible tone/effect */ - UINT32 samplerate_24_8; /* sample rate in 24.8 format */ - UINT32 samplepos_fract; /* sample position fractional part */ - UINT32 samplepos_whole; /* sample position whole part */ - UINT32 polyadjust; /* polynome adjustment */ - UINT32 p4; /* poly4 index */ - UINT32 p5; /* poly5 index */ - UINT32 p9; /* poly9 index */ - UINT32 p17; /* poly17 index */ - UINT32 r9; /* rand9 index */ - UINT32 r17; /* rand17 index */ - UINT32 clockmult; /* clock multiplier */ - int channel; /* streams channel */ - void *timer[3]; /* timers for channel 1,2 and 4 events */ - void *rtimer; /* timer for calculating the random offset */ - void *ptimer[8]; /* pot timers */ - int (*pot_r[8])(int offs); - int (*allpot_r)(int offs); - int (*serin_r)(int offs); - void (*serout_w)(int offs, int data); - void (*interrupt_cb)(int mask); - UINT8 AUDF[4]; /* AUDFx (D200, D202, D204, D206) */ - UINT8 AUDC[4]; /* AUDCx (D201, D203, D205, D207) */ - UINT8 POTx[8]; /* POTx (R/D200-D207) */ - UINT8 AUDCTL; /* AUDCTL (W/D208) */ - UINT8 ALLPOT; /* ALLPOT (R/D208) */ - UINT8 KBCODE; /* KBCODE (R/D209) */ - UINT8 RANDOM; /* RANDOM (R/D20A) */ - UINT8 SERIN; /* SERIN (R/D20D) */ - UINT8 SEROUT; /* SEROUT (W/D20D) */ - UINT8 IRQST; /* IRQST (R/D20E) */ - UINT8 IRQEN; /* IRQEN (W/D20E) */ - UINT8 SKSTAT; /* SKSTAT (R/D20F) */ - UINT8 SKCTL; /* SKCTL (W/D20F) */ -}; - -static struct POKEYinterface intf; -static struct POKEYregisters pokey[MAXPOKEYS]; - -void pokey_scan(INT32 nAction, INT32* pnMin) -{ - if (pnMin && *pnMin < 0x029521) { - *pnMin = 0x029521; - } - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i < MAXPOKEYS; i++) - { - // save pointers. - void *timer[3] = { pokey[i].timer[0], pokey[i].timer[1], pokey[i].timer[2] }; - void *rtimer = pokey[i].rtimer; - void *ptimer[8] = { pokey[i].ptimer[0],pokey[i].ptimer[1],pokey[i].ptimer[2],pokey[i].ptimer[3],pokey[i].ptimer[4],pokey[i].ptimer[5],pokey[i].ptimer[6],pokey[i].ptimer[7] }; - int (*pot_r[8])(int offs) = { pokey[i].pot_r[0], pokey[i].pot_r[1], pokey[i].pot_r[2], pokey[i].pot_r[3], pokey[i].pot_r[4], pokey[i].pot_r[5], pokey[i].pot_r[6], pokey[i].pot_r[7] }; - int (*allpot_r)(int offs) = pokey[i].allpot_r; - int (*serin_r)(int offs) = pokey[i].serin_r; - void (*serout_w)(int offs, int data) = pokey[i].serout_w; - void (*interrupt_cb)(int mask) = pokey[i].interrupt_cb; - - SCAN_VAR(pokey[i]); - - // restore pointers. - pokey[i].timer[0] = timer[0]; pokey[i].timer[1] = timer[1]; pokey[i].timer[2] = timer[2]; - pokey[i].rtimer = rtimer; - pokey[i].ptimer[0] = ptimer[0]; pokey[i].ptimer[1] = ptimer[1]; pokey[i].ptimer[2] = ptimer[2]; pokey[i].ptimer[3] = ptimer[3]; pokey[i].ptimer[4] = ptimer[4]; pokey[i].ptimer[5] = ptimer[5]; pokey[i].ptimer[6] = ptimer[6]; pokey[i].ptimer[7] = ptimer[7]; - pokey[i].pot_r[0] = pot_r[0]; pokey[i].pot_r[1] = pot_r[1]; pokey[i].pot_r[2] = pot_r[2]; pokey[i].pot_r[3] = pot_r[3]; pokey[i].pot_r[4] = pot_r[4]; pokey[i].pot_r[5] = pot_r[5]; pokey[i].pot_r[6] = pot_r[6]; pokey[i].pot_r[7] = pot_r[7]; - pokey[i].allpot_r = allpot_r; - pokey[i].serin_r = serin_r; - pokey[i].serout_w = serout_w; - pokey[i].interrupt_cb = interrupt_cb; - } - - BurnRandomScan(nAction); - } -} - -static UINT8 poly4[0x0f]; -static UINT8 poly5[0x1f]; -static UINT8 *poly9; -static UINT8 *poly17; - -#define P4(chip) poly4[pokey[chip].p4] -#define P5(chip) poly5[pokey[chip].p5] -#define P9(chip) poly9[pokey[chip].p9] -#define P17(chip) poly17[pokey[chip].p17] - -/* 128K random values derived from the 17bit polynome */ -static UINT8 *rand9; -static UINT8 *rand17; - -#define SAMPLE -1 - -#define ADJUST_EVENT(chip) \ - pokey[chip].counter[CHAN1] -= event; \ - pokey[chip].counter[CHAN2] -= event; \ - pokey[chip].counter[CHAN3] -= event; \ - pokey[chip].counter[CHAN4] -= event; \ - pokey[chip].samplepos_whole -= event; \ - pokey[chip].polyadjust += event - -#if SUPPRESS_INAUDIBLE - -#define PROCESS_CHANNEL(chip,ch) \ - int toggle = 0; \ - ADJUST_EVENT(chip); \ - /* reset the channel counter */ \ - if( pokey[chip].audible[ch] ) \ - pokey[chip].counter[ch] = pokey[chip].divisor[ch]; \ - else \ - pokey[chip].counter[ch] = 0x7fffffff; \ - pokey[chip].p4 = (pokey[chip].p4+pokey[chip].polyadjust)%0x0000f; \ - pokey[chip].p5 = (pokey[chip].p5+pokey[chip].polyadjust)%0x0001f; \ - pokey[chip].p9 = (pokey[chip].p9+pokey[chip].polyadjust)%0x001ff; \ - pokey[chip].p17 = (pokey[chip].p17+pokey[chip].polyadjust)%0x1ffff; \ - pokey[chip].polyadjust = 0; \ - if( (pokey[chip].AUDC[ch] & NOTPOLY5) || P5(chip) ) \ - { \ - if( pokey[chip].AUDC[ch] & PURE ) \ - toggle = 1; \ - else \ - if( pokey[chip].AUDC[ch] & POLY4 ) \ - toggle = pokey[chip].output[ch] == !P4(chip); \ - else \ - if( pokey[chip].AUDCTL & POLY9 ) \ - toggle = pokey[chip].output[ch] == !P9(chip); \ - else \ - toggle = pokey[chip].output[ch] == !P17(chip); \ - } \ - if( toggle ) \ - { \ - if( pokey[chip].audible[ch] ) \ - { \ - if( pokey[chip].output[ch] ) \ - sum -= pokey[chip].volume[ch]; \ - else \ - sum += pokey[chip].volume[ch]; \ - } \ - pokey[chip].output[ch] ^= 1; \ - } \ - /* is this a filtering channel (3/4) and is the filter active? */ \ - if( pokey[chip].AUDCTL & ((CH1_FILTER|CH2_FILTER) & (0x10 >> ch)) ) \ - { \ - if( pokey[chip].output[ch-2] ) \ - { \ - pokey[chip].output[ch-2] = 0; \ - if( pokey[chip].audible[ch] ) \ - sum -= pokey[chip].volume[ch-2]; \ - } \ - } \ - -#else - -#define PROCESS_CHANNEL(chip,ch) \ - int toggle = 0; \ - ADJUST_EVENT(chip); \ - /* reset the channel counter */ \ - pokey[chip].counter[ch] = p[chip].divisor[ch]; \ - pokey[chip].p4 = (pokey[chip].p4+pokey[chip].polyadjust)%0x0000f; \ - pokey[chip].p5 = (pokey[chip].p5+pokey[chip].polyadjust)%0x0001f; \ - pokey[chip].p9 = (pokey[chip].p9+pokey[chip].polyadjust)%0x001ff; \ - pokey[chip].p17 = (pokey[chip].p17+pokey[chip].polyadjust)%0x1ffff; \ - pokey[chip].polyadjust = 0; \ - if( (pokey[chip].AUDC[ch] & NOTPOLY5) || P5(chip) ) \ - { \ - if( pokey[chip].AUDC[ch] & PURE ) \ - toggle = 1; \ - else \ - if( pokey[chip].AUDC[ch] & POLY4 ) \ - toggle = pokey[chip].output[ch] == !P4(chip); \ - else \ - if( pokey[chip].AUDCTL & POLY9 ) \ - toggle = pokey[chip].output[ch] == !P9(chip); \ - else \ - toggle = pokey[chip].output[ch] == !P17(chip); \ - } \ - if( toggle ) \ - { \ - if( pokey[chip].output[ch] ) \ - sum -= pokey[chip].volume[ch]; \ - else \ - sum += pokey[chip].volume[ch]; \ - pokey[chip].output[ch] ^= 1; \ - } \ - /* is this a filtering channel (3/4) and is the filter active? */ \ - if( pokey[chip].AUDCTL & ((CH1_FILTER|CH2_FILTER) & (0x10 >> ch)) ) \ - { \ - if( pokey[chip].output[ch-2] ) \ - { \ - pokey[chip].output[ch-2] = 0; \ - sum -= pokey[chip].volume[ch-2]; \ - } \ - } \ - -#endif - -#define PROCESS_SAMPLE(chip) \ - ADJUST_EVENT(chip); \ - /* adjust the sample position */ \ - pokey[chip].samplepos_fract += pokey[chip].samplerate_24_8; \ - if( pokey[chip].samplepos_fract & 0xffffff00 ) \ - { \ - pokey[chip].samplepos_whole += pokey[chip].samplepos_fract>>8; \ - pokey[chip].samplepos_fract &= 0x000000ff; \ - } \ - /* store sum of output signals into the buffer */ \ - nLeftSample = buffer[0] + (INT32)(sum * pokey_mastervol); \ - nRightSample = buffer[1] + (INT32)(sum * pokey_mastervol); \ - buffer[0] = BURN_SND_CLIP(nLeftSample); \ - buffer[1] = BURN_SND_CLIP(nRightSample); \ - buffer++; buffer++; \ - length--; - -#if HEAVY_MACRO_USAGE - -/* - * This version of PROCESS_POKEY repeats the search for the minimum - * event value without using an index to the channel. That way the - * PROCESS_CHANNEL macros can be called with fixed values and expand - * to much more efficient code - */ - -#define PROCESS_POKEY(chip) \ - UINT32 sum = 0; \ - if( pokey[chip].output[CHAN1] ) \ - sum += pokey[chip].volume[CHAN1]; \ - if( pokey[chip].output[CHAN2] ) \ - sum += pokey[chip].volume[CHAN2]; \ - if( pokey[chip].output[CHAN3] ) \ - sum += pokey[chip].volume[CHAN3]; \ - if( pokey[chip].output[CHAN4] ) \ - sum += pokey[chip].volume[CHAN4]; \ - while( length > 0 ) \ - { \ - if( pokey[chip].counter[CHAN1] < pokey[chip].samplepos_whole ) \ - { \ - if( pokey[chip].counter[CHAN2] < pokey[chip].counter[CHAN1] ) \ - { \ - if( pokey[chip].counter[CHAN3] < pokey[chip].counter[CHAN2] ) \ - { \ - if( pokey[chip].counter[CHAN4] < pokey[chip].counter[CHAN3] ) \ - { \ - UINT32 event = pokey[chip].counter[CHAN4]; \ - PROCESS_CHANNEL(chip,CHAN4); \ - } \ - else \ - { \ - UINT32 event = pokey[chip].counter[CHAN3]; \ - PROCESS_CHANNEL(chip,CHAN3); \ - } \ - } \ - else \ - if( pokey[chip].counter[CHAN4] < pokey[chip].counter[CHAN2] ) \ - { \ - UINT32 event = pokey[chip].counter[CHAN4]; \ - PROCESS_CHANNEL(chip,CHAN4); \ - } \ - else \ - { \ - UINT32 event = pokey[chip].counter[CHAN2]; \ - PROCESS_CHANNEL(chip,CHAN2); \ - } \ - } \ - else \ - if( pokey[chip].counter[CHAN3] < pokey[chip].counter[CHAN1] ) \ - { \ - if( pokey[chip].counter[CHAN4] < pokey[chip].counter[CHAN3] ) \ - { \ - UINT32 event = pokey[chip].counter[CHAN4]; \ - PROCESS_CHANNEL(chip,CHAN4); \ - } \ - else \ - { \ - UINT32 event = pokey[chip].counter[CHAN3]; \ - PROCESS_CHANNEL(chip,CHAN3); \ - } \ - } \ - else \ - if( pokey[chip].counter[CHAN4] < pokey[chip].counter[CHAN1] ) \ - { \ - UINT32 event = pokey[chip].counter[CHAN4]; \ - PROCESS_CHANNEL(chip,CHAN4); \ - } \ - else \ - { \ - UINT32 event = pokey[chip].counter[CHAN1]; \ - PROCESS_CHANNEL(chip,CHAN1); \ - } \ - } \ - else \ - if( pokey[chip].counter[CHAN2] < pokey[chip].samplepos_whole ) \ - { \ - if( pokey[chip].counter[CHAN3] < pokey[chip].counter[CHAN2] ) \ - { \ - if( pokey[chip].counter[CHAN4] < pokey[chip].counter[CHAN3] ) \ - { \ - UINT32 event = pokey[chip].counter[CHAN4]; \ - PROCESS_CHANNEL(chip,CHAN4); \ - } \ - else \ - { \ - UINT32 event = pokey[chip].counter[CHAN3]; \ - PROCESS_CHANNEL(chip,CHAN3); \ - } \ - } \ - else \ - if( pokey[chip].counter[CHAN4] < pokey[chip].counter[CHAN2] ) \ - { \ - UINT32 event = pokey[chip].counter[CHAN4]; \ - PROCESS_CHANNEL(chip,CHAN4); \ - } \ - else \ - { \ - UINT32 event = pokey[chip].counter[CHAN2]; \ - PROCESS_CHANNEL(chip,CHAN2); \ - } \ - } \ - else \ - if( pokey[chip].counter[CHAN3] < pokey[chip].samplepos_whole ) \ - { \ - if( pokey[chip].counter[CHAN4] < pokey[chip].counter[CHAN3] ) \ - { \ - UINT32 event = pokey[chip].counter[CHAN4]; \ - PROCESS_CHANNEL(chip,CHAN4); \ - } \ - else \ - { \ - UINT32 event = pokey[chip].counter[CHAN3]; \ - PROCESS_CHANNEL(chip,CHAN3); \ - } \ - } \ - else \ - if( pokey[chip].counter[CHAN4] < pokey[chip].samplepos_whole ) \ - { \ - UINT32 event = pokey[chip].counter[CHAN4]; \ - PROCESS_CHANNEL(chip,CHAN4); \ - } \ - else \ - { \ - UINT32 event = pokey[chip].samplepos_whole; \ - PROCESS_SAMPLE(chip); \ - } \ - } - //timer_reset(pokey[chip].rtimer, TIME_NEVER) - -void pokey0_update(int param, INT16 *buffer, int length) { PROCESS_POKEY(0); } -void pokey1_update(int param, INT16 *buffer, int length) { PROCESS_POKEY(1); } -void pokey2_update(int param, INT16 *buffer, int length) { PROCESS_POKEY(2); } -void pokey3_update(int param, INT16 *buffer, int length) { PROCESS_POKEY(3); } -void (*update[MAXPOKEYS])(int,INT16*,int) = - { pokey0_update,pokey1_update,pokey2_update,pokey3_update }; - -#else /* no HEAVY_MACRO_USAGE */ -/* - * And this version of PROCESS_POKEY uses event and channel variables - * so that the PROCESS_CHANNEL macro needs to index memory at runtime. - */ - -#define PROCESS_POKEY(chip) \ - UINT32 sum = 0; \ - if( pokey[chip].output[CHAN1] ) \ - sum += pokey[chip].volume[CHAN1]; \ - if( pokey[chip].output[CHAN2] ) \ - sum += pokey[chip].volume[CHAN2]; \ - if( pokey[chip].output[CHAN3] ) \ - sum += pokey[chip].volume[CHAN3]; \ - if( pokey[chip].output[CHAN4] ) \ - sum += pokey[chip].volume[CHAN4]; \ - while( length > 0 ) \ - { \ - UINT32 event = pokey[chip].samplepos_whole; \ - UINT32 channel = (UINT32)SAMPLE; \ - if( pokey[chip].counter[CHAN1] < (INT32)event ) \ - { \ - event = pokey[chip].counter[CHAN1]; \ - channel = CHAN1; \ - } \ - if( pokey[chip].counter[CHAN2] < (INT32)event ) \ - { \ - event = pokey[chip].counter[CHAN2]; \ - channel = CHAN2; \ - } \ - if( pokey[chip].counter[CHAN3] < (INT32)event ) \ - { \ - event = pokey[chip].counter[CHAN3]; \ - channel = CHAN3; \ - } \ - if( pokey[chip].counter[CHAN4] < (INT32)event ) \ - { \ - event = pokey[chip].counter[CHAN4]; \ - channel = CHAN4; \ - } \ - if( channel == (UINT32)SAMPLE ) \ - { \ - PROCESS_SAMPLE(chip); \ - } \ - else \ - { \ - PROCESS_CHANNEL(chip,channel); \ - } \ - } - //timer_reset(pokey[chip].rtimer, TIME_NEVER) - -void pokey_update(int num, INT16 *buffer, int length) { - if (!intf.addtostream && num == 0) - memset(buffer, 0, length * 4); - PROCESS_POKEY(num); -} - -void (*update[MAXPOKEYS])(int,INT16*,int) = - { pokey_update,pokey_update,pokey_update,pokey_update }; - -#endif - -void pokey_sh_update(void) -{ -// int chip; - -// for( chip = 0; chip < intf.num; chip++ ) -// stream_update(pokey[chip].channel, 0); -} - -static void poly_init(UINT8 *poly, int size, int left, int right, int add) -{ - int mask = (1 << size) - 1; - int i, x = 0; - - LOG_POLY((errorlog,"poly %d\n", size)); - for( i = 0; i < mask; i++ ) - { - *poly++ = x & 1; - LOG_POLY((errorlog,"%05x: %d\n", x, x&1)); - /* calculate next bit */ - x = ((x << left) + (x >> right) + add) & mask; - } -} - -static void rand_init(UINT8 *rng, int size, int left, int right, int add) -{ - int mask = (1 << size) - 1; - int i, x = 0; - - LOG_RAND((errorlog,"rand %d\n", size)); - for( i = 0; i < mask; i++ ) - { - *rng = x >> (size - 8); /* use the upper 8 bits */ - LOG_RAND((errorlog, "%05x: %02x\n", x, *rng)); - rng++; - /* calculate next bit */ - x = ((x << left) + (x >> right) + add) & mask; - } -} - -int PokeyInit(int clock, int num, double vol, int addtostream) -{ - int chip, sample_rate; - - memset(&intf, 0, sizeof(intf)); - sample_rate = nBurnSoundRate; - intf.num = num; - //intf.mixing_level[0] = vol; - pokey_mastervol = vol; - intf.baseclock = (clock) ? clock : FREQ_17_EXACT; - intf.addtostream = addtostream; - - poly9 = (UINT8 *)BurnMalloc(0x1ff+1); - rand9 = (UINT8 *)BurnMalloc(0x1ff+1); - poly17 = (UINT8 *)BurnMalloc(0x1ffff+1); - rand17 = (UINT8 *)BurnMalloc(0x1ffff+1); - if( !poly9 || !rand9 || !poly17 || !rand17 ) - { - PokeyExit(); /* free any allocated memory again */ - return 1; - } - - /* initialize the poly counters */ - poly_init(poly4, 4, 3, 1, 0x00004); - poly_init(poly5, 5, 3, 2, 0x00008); - poly_init(poly9, 9, 2, 7, 0x00080); - poly_init(poly17, 17, 7,10, 0x18000); - - /* initialize the random arrays */ - rand_init(rand9, 9, 2, 7, 0x00080); - rand_init(rand17, 17, 7,10, 0x18000); - - for( chip = 0; chip < intf.num; chip++ ) - { - struct POKEYregisters *p = &pokey[chip]; - char name[40]; - - memset(p, 0, sizeof(struct POKEYregisters)); - - p->samplerate_24_8 = (sample_rate) ? (intf.baseclock << 8) / sample_rate : 1; - p->divisor[CHAN1] = 4; - p->divisor[CHAN2] = 4; - p->divisor[CHAN3] = 4; - p->divisor[CHAN4] = 4; - p->clockmult = DIV_64; - p->KBCODE = 0x09; /* Atari 800 'no key' */ - p->SKCTL = SK_RESET; /* let the RNG run after reset */ - //p->rtimer = timer_set(TIME_NEVER, chip, NULL); - - p->pot_r[0] = intf.pot0_r[chip]; - p->pot_r[1] = intf.pot1_r[chip]; - p->pot_r[2] = intf.pot2_r[chip]; - p->pot_r[3] = intf.pot3_r[chip]; - p->pot_r[4] = intf.pot4_r[chip]; - p->pot_r[5] = intf.pot5_r[chip]; - p->pot_r[6] = intf.pot6_r[chip]; - p->pot_r[7] = intf.pot7_r[chip]; - p->allpot_r = intf.allpot_r[chip]; - p->serin_r = intf.serin_r[chip]; - p->serout_w = intf.serout_w[chip]; - p->interrupt_cb = intf.interrupt_cb[chip]; - - sprintf(name, "Pokey #%d", chip); -// p->channel = stream_init(name, intf.mixing_level[chip], Machine->sample_rate, chip, update[chip]); - - if( p->channel == -1 ) - { - //perror("failed to initialize sound channel"); - return 1; - } - } - - return 0; -} - -void PokeyExit(void) -{ - BurnFree(rand17); - BurnFree(poly17); - BurnFree(rand9); - BurnFree(poly9); -} - -/*static void pokey_timer_expire(int param) -{ - int chip = param >> 3; - int timers = param & 7; - struct POKEYregisters *p = &pokey[chip]; - - LOG_TIMER((errorlog, "POKEY #%d timer %d with IRQEN $%02x\n", chip, param, p->IRQEN)); - - // check if some of the requested timer interrupts are enabled - timers &= p->IRQEN; - - if( timers ) - { - // set the enabled timer irq status bits - p->IRQST |= timers; - // call back an application supplied function to handle the interrupt - if( p->interrupt_cb ) - (*p->interrupt_cb)(timers); - } -}*/ - -#if VERBOSE_SOUND -static char *audc2str(int val) -{ - static char buff[80]; - if( val & NOTPOLY5 ) - { - if( val & PURE ) - strcpy(buff,"pure"); - else - if( val & POLY4 ) - strcpy(buff,"poly4"); - else - strcpy(buff,"poly9/17"); - } - else - { - if( val & PURE ) - strcpy(buff,"poly5"); - else - if( val & POLY4 ) - strcpy(buff,"poly4+poly5"); - else - strcpy(buff,"poly9/17+poly5"); - } - return buff; -} - -static char *audctl2str(int val) -{ - static char buff[80]; - if( val & POLY9 ) - strcpy(buff,"poly9"); - else - strcpy(buff,"poly17"); - if( val & CH1_HICLK ) - strcat(buff,"+ch1hi"); - if( val & CH3_HICLK ) - strcat(buff,"+ch3hi"); - if( val & CH12_JOINED ) - strcat(buff,"+ch1/2"); - if( val & CH34_JOINED ) - strcat(buff,"+ch3/4"); - if( val & CH1_FILTER ) - strcat(buff,"+ch1filter"); - if( val & CH2_FILTER ) - strcat(buff,"+ch2filter"); - if( val & CLK_15KHZ ) - strcat(buff,"+clk15"); - return buff; -} -#endif - -/*static void pokey_serin_ready(int chip) -{ - struct POKEYregisters *p = &pokey[chip]; - if( p->IRQEN & IRQ_SERIN ) - { - // set the enabled timer irq status bits - p->IRQST |= IRQ_SERIN; - // call back an application supplied function to handle the interrupt - if( p->interrupt_cb ) - (*p->interrupt_cb)(IRQ_SERIN); - } -} - -static void pokey_serout_ready(int chip) -{ - struct POKEYregisters *p = &pokey[chip]; - if( p->IRQEN & IRQ_SEROR ) - { - p->IRQST |= IRQ_SEROR; - if( p->interrupt_cb ) - (*p->interrupt_cb)(IRQ_SEROR); - } -} - -static void pokey_serout_complete(int chip) -{ - struct POKEYregisters *p = &pokey[chip]; - if( p->IRQEN & IRQ_SEROC ) - { - p->IRQST |= IRQ_SEROC; - if( p->interrupt_cb ) - (*p->interrupt_cb)(IRQ_SEROC); - } -} - -static void pokey_pot_trigger(int param) -{ - int chip = param >> 3; - int pot = param & 7; - struct POKEYregisters *p = &pokey[chip]; - - LOG((errorlog, "POKEY #%d POT%d triggers after %dus\n", chip, pot, (int)(1000000ul*timer_timeelapsed(p->ptimer[pot])))); - p->ptimer[pot] = NULL; - p->ALLPOT &= ~(1 << pot); // set the enabled timer irq status bits -}*/ - -/* A/D conversion time: - * In normal, slow mode (SKCTL bit SK_PADDLE is clear) the conversion - * takes N scanlines, where N is the paddle value. A single scanline - * takes approximately 64us to finish (1.78979MHz clock). - * In quick mode (SK_PADDLE set) the conversion is done very fast - * (takes two scalines) but the result is not as accurate. - */ -#define AD_TIME (double)(((p->SKCTL & SK_PADDLE) ? 64.0*2/228 : 64.0) * FREQ_17_EXACT / intf.baseclock) - -static void pokey_potgo(int chip) -{ - struct POKEYregisters *p = &pokey[chip]; - int pot; - - LOG((errorlog, "POKEY #%d pokey_potgo\n", chip)); - - p->ALLPOT = 0xff; - - for( pot = 0; pot < 8; pot++ ) - { - if( p->ptimer[pot] ) - { - //timer_remove(p->ptimer[pot]); - p->ptimer[pot] = NULL; - p->POTx[pot] = 0xff; - } - if( p->pot_r[pot] ) - { - int r = (*p->pot_r[pot])(pot); - LOG((errorlog, "POKEY #%d pot_r(%d) returned $%02x\n", chip, pot, r)); - if( r != -1 ) - { - if (r > 228) - r = 228; - /* final value */ - p->POTx[pot] = r; - //p->ptimer[pot] = timer_set(TIME_IN_USEC(r * AD_TIME), (chip<<3)|pot, pokey_pot_trigger); - } - } - } -} - -int pokey_register_r(int chip, int offs) -{ - struct POKEYregisters *p = &pokey[chip]; - int data = 0, pot; - -#ifdef MAME_DEBUG - if( chip >= intf.num ) - { - if( errorlog ) fprintf(errorlog, "POKEY #%d is >= number of Pokeys!\n", chip); - return data; - } -#endif - - switch (offs & 15) - { - case POT0_C: case POT1_C: case POT2_C: case POT3_C: - case POT4_C: case POT5_C: case POT6_C: case POT7_C: - pot = offs & 7; - if( p->pot_r[pot] ) - { - /* - * If the conversion is not yet finished (ptimer running), - * get the current value by the linear interpolation of - * the final value using the elapsed time. - */ - if( p->ALLPOT & (1 << pot) ) - { - data = (UINT8)(/*timer_timeelapsed(p->ptimer[pot])*/1234 / AD_TIME); - LOG((errorlog,"POKEY #%d read POT%d (interpolated) $%02x\n", chip, pot, data)); - } - else - { - data = p->POTx[pot]; - LOG((errorlog,"POKEY #%d read POT%d (final value) $%02x\n", chip, pot, data)); - } - } - else - break; - - case ALLPOT_C: - if( p->allpot_r ) - { - data = (*p->allpot_r)(offs); - LOG((errorlog,"POKEY #%d ALLPOT callback $%02x\n", chip, data)); - } - else - { - data = p->ALLPOT; - LOG((errorlog,"POKEY #%d ALLPOT internal $%02x\n", chip, data)); - } - break; - - case KBCODE_C: - data = p->KBCODE; - break; - - case RANDOM_C: - /**************************************************************** - * If the 2 least significant bits of SKCTL are 0, the random - * number generator is disabled (SKRESET). Thanks to Eric Smith - * for pointing out this critical bit of info! If the random - * number generator is enabled, get a new random number. Take - * the time gone since the last read into account and read the - * new value from an appropriate offset in the rand17 table. - ****************************************************************/ - if( p->SKCTL & SK_RESET ) - { - UINT32 adjust = (UINT32)(/*timer_timeelapsed(p->rtimer)*/BurnRandom() /*dink*/ * intf.baseclock); - p->r9 = (p->r9 + adjust) % 0x001ff; - p->r17 = (p->r17 + adjust) % 0x1ffff; - if( p->AUDCTL & POLY9 ) - { - p->RANDOM = rand9[p->r9]; - LOG_RAND((errorlog, "POKEY #%d adjust %u rand9[$%05x]: $%02x\n", chip, adjust, p->r9, p->RANDOM)); - } - else - { - p->RANDOM = rand17[p->r17]; - LOG_RAND((errorlog, "POKEY #%d adjust %u rand17[$%05x]: $%02x\n", chip, adjust, p->r17, p->RANDOM)); - } - } - else - { - LOG_RAND((errorlog, "POKEY #%d rand17 freezed (SKCTL): $%02x\n", chip, p->RANDOM)); - } - //timer_reset(p->rtimer, TIME_NEVER); - data = p->RANDOM; - break; - - case SERIN_C: - if( p->serin_r ) - p->SERIN = (*p->serin_r)(offs); - data = p->SERIN; - LOG((errorlog, "POKEY #%d SERIN $%02x\n", chip, data)); - break; - - case IRQST_C: - /* IRQST is an active low input port; we keep it active high */ - /* internally to ease the (un-)masking of bits */ - data = p->IRQST ^ 0xff; - LOG((errorlog, "POKEY #%d IRQST $%02x\n", chip, data)); - break; - - case SKSTAT_C: - /* SKSTAT is also an active low input port */ - data = p->SKSTAT ^ 0xff; - LOG((errorlog, "POKEY #%d SKSTAT $%02x\n", chip, data)); - break; - - default: - LOG((errorlog, "POKEY #%d register $%02x\n", chip, offs)); - break; - } - return data; -} - -int pokey1_r (int offset) -{ - return pokey_register_r(0, offset); -} - -int pokey2_r (int offset) -{ - return pokey_register_r(1, offset); -} - -int pokey3_r (int offset) -{ - return pokey_register_r(2, offset); -} - -int pokey4_r (int offset) -{ - return pokey_register_r(3, offset); -} - -int quad_pokey_r (int offset) -{ - int pokey_num = (offset >> 3) & ~0x04; - int control = (offset & 0x20) >> 2; - int pokey_reg = (offset % 8) | control; - - return pokey_register_r(pokey_num, pokey_reg); -} - - -void pokey_register_w(int chip, int offs, int data) -{ - struct POKEYregisters *p = &pokey[chip]; - int ch_mask = 0, new_val; - -#ifdef MAME_DEBUG - if( chip >= intf.num ) - { - if( errorlog ) fprintf(errorlog, "POKEY #%d is >= number of Pokeys!\n", chip); - return; - } -#endif - //stream_update(p->channel, 0); - - /* determine which address was changed */ - switch (offs & 15) - { - case AUDF1_C: - if( data == p->AUDF[CHAN1] ) - return; - LOG_SOUND((errorlog, "POKEY #%d AUDF1 $%02x\n", chip, data)); - p->AUDF[CHAN1] = data; - ch_mask = 1 << CHAN1; - if( p->AUDCTL & CH12_JOINED ) /* if ch 1&2 tied together */ - ch_mask |= 1 << CHAN2; /* then also change on ch2 */ - break; - - case AUDC1_C: - if( data == p->AUDC[CHAN1] ) - return; - LOG_SOUND((errorlog, "POKEY #%d AUDC1 $%02x (%s)\n", chip, data, audc2str(data))); - p->AUDC[CHAN1] = data; - ch_mask = 1 << CHAN1; - break; - - case AUDF2_C: - if( data == p->AUDF[CHAN2] ) - return; - LOG_SOUND((errorlog, "POKEY #%d AUDF2 $%02x\n", chip, data)); - p->AUDF[CHAN2] = data; - ch_mask = 1 << CHAN2; - break; - - case AUDC2_C: - if( data == p->AUDC[CHAN2] ) - return; - LOG_SOUND((errorlog, "POKEY #%d AUDC2 $%02x (%s)\n", chip, data, audc2str(data))); - p->AUDC[CHAN2] = data; - ch_mask = 1 << CHAN2; - break; - - case AUDF3_C: - if( data == p->AUDF[CHAN3] ) - return; - LOG_SOUND((errorlog, "POKEY #%d AUDF3 $%02x\n", chip, data)); - p->AUDF[CHAN3] = data; - ch_mask = 1 << CHAN3; - - if( p->AUDCTL & CH34_JOINED ) /* if ch 3&4 tied together */ - ch_mask |= 1 << CHAN4; /* then also change on ch4 */ - break; - - case AUDC3_C: - if( data == p->AUDC[CHAN3] ) - return; - LOG_SOUND((errorlog, "POKEY #%d AUDC3 $%02x (%s)\n", chip, data, audc2str(data))); - p->AUDC[CHAN3] = data; - ch_mask = 1 << CHAN3; - break; - - case AUDF4_C: - if( data == p->AUDF[CHAN4] ) - return; - LOG_SOUND((errorlog, "POKEY #%d AUDF4 $%02x\n", chip, data)); - p->AUDF[CHAN4] = data; - ch_mask = 1 << CHAN4; - break; - - case AUDC4_C: - if( data == p->AUDC[CHAN4] ) - return; - LOG_SOUND((errorlog, "POKEY #%d AUDC4 $%02x (%s)\n", chip, data, audc2str(data))); - p->AUDC[CHAN4] = data; - ch_mask = 1 << CHAN4; - break; - - case AUDCTL_C: - if( data == p->AUDCTL ) - return; - LOG_SOUND((errorlog, "POKEY #%d AUDCTL $%02x (%s)\n", chip, data, audctl2str(data))); - p->AUDCTL = data; - ch_mask = 15; /* all channels */ - /* determine the base multiplier for the 'div by n' calculations */ - p->clockmult = (p->AUDCTL & CLK_15KHZ) ? DIV_15 : DIV_64; - break; - - case STIMER_C: - /* first remove any existing timers */ - LOG_TIMER((errorlog, "POKEY #%d STIMER $%02x\n", chip, data)); - /*if( p->timer[TIMER1] ) - timer_remove(p->timer[TIMER1]); - if( p->timer[TIMER2] ) - timer_remove(p->timer[TIMER2]); - if( p->timer[TIMER4] ) - timer_remove(p->timer[TIMER4]); - p->timer[TIMER1] = NULL; - p->timer[TIMER2] = NULL; - p->timer[TIMER4] = NULL;*/ - - /* reset all counters to zero (side effect) */ - p->polyadjust = 0; - p->counter[CHAN1] = 0; - p->counter[CHAN2] = 0; - p->counter[CHAN3] = 0; - p->counter[CHAN4] = 0; - - /* joined chan#1 and chan#2 ? */ - if( p->AUDCTL & CH12_JOINED ) - { - if( p->divisor[CHAN2] > 4 ) - { - LOG_TIMER((errorlog, "POKEY #%d timer1+2 after %d clocks\n", chip, p->divisor[CHAN2])); - /* set timer #1 _and_ #2 event after timer_div clocks of joined CHAN1+CHAN2 */ - /*p->timer[TIMER2] = - timer_pulse(1.0 * p->divisor[CHAN2] / intf.baseclock, - (chip<<3)|IRQ_TIMR2|IRQ_TIMR1, pokey_timer_expire);*/ - } - } - else - { - if( p->divisor[CHAN1] > 4 ) - { - LOG_TIMER((errorlog, "POKEY #%d timer1 after %d clocks\n", chip, p->divisor[CHAN1])); - /* set timer #1 event after timer_div clocks of CHAN1 */ - /*p->timer[TIMER1] = - timer_pulse(1.0 * p->divisor[CHAN1] / intf.baseclock, - (chip<<3)|IRQ_TIMR1, pokey_timer_expire);*/ - } - - if( p->divisor[CHAN2] > 4 ) - { - LOG_TIMER((errorlog, "POKEY #%d timer2 after %d clocks\n", chip, p->divisor[CHAN2])); - /* set timer #2 event after timer_div clocks of CHAN2 */ - /*p->timer[TIMER2] = - timer_pulse(1.0 * p->divisor[CHAN2] / intf.baseclock, - (chip<<3)|IRQ_TIMR2, pokey_timer_expire);*/ - } - } - - /* Note: p[chip] does not have a timer #3 */ - - if( p->AUDCTL & CH34_JOINED ) - { - /* not sure about this: if audc4 == 0000xxxx don't start timer 4 ? */ - if( p->AUDC[CHAN4] & 0xf0 ) - { - if( p->divisor[CHAN4] > 4 ) - { - LOG_TIMER((errorlog, "POKEY #%d timer4 after %d clocks\n", chip, p->divisor[CHAN4])); - /* set timer #4 event after timer_div clocks of CHAN4 */ - /*p->timer[TIMER4] = - timer_pulse(1.0 * p->divisor[CHAN4] / intf.baseclock, - (chip<<3)|IRQ_TIMR4, pokey_timer_expire);*/ - } - } - } - else - { - if( p->divisor[CHAN4] > 4 ) - { - LOG_TIMER((errorlog, "POKEY #%d timer4 after %d clocks\n", chip, p->divisor[CHAN4])); - /* set timer #4 event after timer_div clocks of CHAN4 */ - /*p->timer[TIMER4] = - timer_pulse(1.0 * p->divisor[CHAN4] / intf.baseclock, - (chip<<3)|IRQ_TIMR4, pokey_timer_expire);*/ - } - } - /*if( p->timer[TIMER1] ) - timer_enable(p->timer[TIMER1], p->IRQEN & IRQ_TIMR1); - if( p->timer[TIMER2] ) - timer_enable(p->timer[TIMER2], p->IRQEN & IRQ_TIMR2); - if( p->timer[TIMER4] ) - timer_enable(p->timer[TIMER4], p->IRQEN & IRQ_TIMR4);*/ - break; - - case SKREST_C: - /* reset SKSTAT */ - LOG((errorlog, "POKEY #%d SKREST $%02x\n", chip, data)); - p->SKSTAT &= ~(SK_FRAME|SK_OVERRUN|SK_KBERR); - break; - - case POTGO_C: - LOG((errorlog, "POKEY #%d POTGO $%02x\n", chip, data)); - pokey_potgo(chip); - break; - - case SEROUT_C: - LOG((errorlog, "POKEY #%d SEROUT $%02x\n", chip, data)); - if (p->serout_w) - (*p->serout_w)(offs, data); - p->SKSTAT |= SK_SEROUT; - /* - * These are arbitrary values, tested with some custom boot - * loaders from Ballblazer and Escape from Fractalus - * The real times are unknown - */ - //timer_set(TIME_IN_USEC(200), chip, pokey_serout_ready); - /* 10 bits (assumption 1 start, 8 data and 1 stop bit) take how long? */ - //timer_set(TIME_IN_USEC(2000), chip, pokey_serout_complete); - break; - - case IRQEN_C: - LOG((errorlog, "POKEY #%d IRQEN $%02x\n", chip, data)); - - /* acknowledge one or more IRQST bits ? */ - if( p->IRQST & ~data ) - { - /* reset IRQST bits that are masked now */ - p->IRQST &= data; - } - else - { - /* enable/disable timers now to avoid unneeded - breaking of the CPU cores for masked timers */ - /*if( p->timer[TIMER1] && ((p->IRQEN^data) & IRQ_TIMR1) ) - timer_enable(p->timer[TIMER1], data & IRQ_TIMR1); - if( p->timer[TIMER2] && ((p->IRQEN^data) & IRQ_TIMR2) ) - timer_enable(p->timer[TIMER2], data & IRQ_TIMR2); - if( p->timer[TIMER4] && ((p->IRQEN^data) & IRQ_TIMR4) ) - timer_enable(p->timer[TIMER4], data & IRQ_TIMR4);*/ - } - /* store irq enable */ - p->IRQEN = data; - break; - - case SKCTL_C: - if( data == p->SKCTL ) - return; - LOG((errorlog, "POKEY #%d SKCTL $%02x\n", chip, data)); - p->SKCTL = data; - if( !(data & SK_RESET) ) - { - pokey_register_w(chip, IRQEN_C, 0); - pokey_register_w(chip, SKREST_C, 0); - } - break; - } - - /************************************************************ - * As defined in the manual, the exact counter values are - * different depending on the frequency and resolution: - * 64 kHz or 15 kHz - AUDF + 1 - * 1.79 MHz, 8-bit - AUDF + 4 - * 1.79 MHz, 16-bit - AUDF[CHAN1]+256*AUDF[CHAN2] + 7 - ************************************************************/ - - /* only reset the channels that have changed */ - - if( ch_mask & (1 << CHAN1) ) - { - /* process channel 1 frequency */ - if( p->AUDCTL & CH1_HICLK ) - new_val = p->AUDF[CHAN1] + DIVADD_HICLK; - else - new_val = (p->AUDF[CHAN1] + DIVADD_LOCLK) * p->clockmult; - - LOG_SOUND((errorlog, "POKEY #%d chan1 %d\n", chip, new_val)); - - p->volume[CHAN1] = (p->AUDC[CHAN1] & VOLUME_MASK) * POKEY_DEFAULT_GAIN; - p->divisor[CHAN1] = new_val; - if( new_val < p->counter[CHAN1] ) - p->counter[CHAN1] = new_val; - /*if( p->interrupt_cb && p->timer[TIMER1] ) - timer_reset(p->timer[TIMER1], 1.0 * new_val / intf.baseclock);*/ - p->audible[CHAN1] = !( - (p->AUDC[CHAN1] & VOLUME_ONLY) || - (p->AUDC[CHAN1] & VOLUME_MASK) == 0 || - ((p->AUDC[CHAN1] & PURE) && new_val < ((INT32)p->samplerate_24_8 >> 8))); - if( !p->audible[CHAN1] ) - { - p->output[CHAN1] = 1; - p->counter[CHAN1] = 0x7fffffff; - /* 50% duty cycle should result in half volume */ - p->volume[CHAN1] >>= 1; - } - } - - if( ch_mask & (1 << CHAN2) ) - { - /* process channel 2 frequency */ - if( p->AUDCTL & CH12_JOINED ) - { - if( p->AUDCTL & CH1_HICLK ) - new_val = p->AUDF[CHAN2] * 256 + p->AUDF[CHAN1] + DIVADD_HICLK_JOINED; - else - new_val = (p->AUDF[CHAN2] * 256 + p->AUDF[CHAN1] + DIVADD_LOCLK) * p->clockmult; - LOG_SOUND((errorlog, "POKEY #%d chan1+2 %d\n", chip, new_val)); - } - else - { - new_val = (p->AUDF[CHAN2] + DIVADD_LOCLK) * p->clockmult; - LOG_SOUND((errorlog, "POKEY #%d chan2 %d\n", chip, new_val)); - } - - p->volume[CHAN2] = (p->AUDC[CHAN2] & VOLUME_MASK) * POKEY_DEFAULT_GAIN; - p->divisor[CHAN2] = new_val; - if( new_val < p->counter[CHAN2] ) - p->counter[CHAN2] = new_val; - /*if( p->interrupt_cb && p->timer[TIMER2] ) - timer_reset(p->timer[TIMER2], 1.0 * new_val / intf.baseclock);*/ - p->audible[CHAN2] = !( - (p->AUDC[CHAN2] & VOLUME_ONLY) || - (p->AUDC[CHAN2] & VOLUME_MASK) == 0 || - ((p->AUDC[CHAN2] & PURE) && new_val < ((INT32)p->samplerate_24_8 >> 8))); - if( !p->audible[CHAN2] ) - { - p->output[CHAN2] = 1; - p->counter[CHAN2] = 0x7fffffff; - /* 50% duty cycle should result in half volume */ - p->volume[CHAN2] >>= 1; - } - } - - if( ch_mask & (1 << CHAN3) ) - { - /* process channel 3 frequency */ - if( p->AUDCTL & CH3_HICLK ) - new_val = p->AUDF[CHAN3] + DIVADD_HICLK; - else - new_val = (p->AUDF[CHAN3] + DIVADD_LOCLK) * p->clockmult; - - LOG_SOUND((errorlog, "POKEY #%d chan3 %d\n", chip, new_val)); - - p->volume[CHAN3] = (p->AUDC[CHAN3] & VOLUME_MASK) * POKEY_DEFAULT_GAIN; - p->divisor[CHAN3] = new_val; - if( new_val < p->counter[CHAN3] ) - p->counter[CHAN3] = new_val; - /* channel 3 does not have a timer associated */ - p->audible[CHAN3] = !( - (p->AUDC[CHAN3] & VOLUME_ONLY) || - (p->AUDC[CHAN3] & VOLUME_MASK) == 0 || - ((p->AUDC[CHAN3] & PURE) && new_val < ((INT32)p->samplerate_24_8 >> 8))) || - (p->AUDCTL & CH1_FILTER); - if( !p->audible[CHAN3] ) - { - p->output[CHAN3] = 1; - p->counter[CHAN3] = 0x7fffffff; - /* 50% duty cycle should result in half volume */ - p->volume[CHAN3] >>= 1; - } - } - - if( ch_mask & (1 << CHAN4) ) - { - /* process channel 4 frequency */ - if( p->AUDCTL & CH34_JOINED ) - { - if( p->AUDCTL & CH3_HICLK ) - new_val = p->AUDF[CHAN4] * 256 + p->AUDF[CHAN3] + DIVADD_HICLK_JOINED; - else - new_val = (p->AUDF[CHAN4] * 256 + p->AUDF[CHAN3] + DIVADD_LOCLK) * p->clockmult; - LOG_SOUND((errorlog, "POKEY #%d chan3+4 %d\n", chip, new_val)); - } - else - { - new_val = (p->AUDF[CHAN4] + DIVADD_LOCLK) * p->clockmult; - LOG_SOUND((errorlog, "POKEY #%d chan4 %d\n", chip, new_val)); - } - - p->volume[CHAN4] = (p->AUDC[CHAN4] & VOLUME_MASK) * POKEY_DEFAULT_GAIN; - p->divisor[CHAN4] = new_val; - if( new_val < p->counter[CHAN4] ) - p->counter[CHAN4] = new_val; - /*if( p->interrupt_cb && p->timer[TIMER4] ) - timer_reset(p->timer[TIMER4], 1.0 * new_val / intf.baseclock);*/ - p->audible[CHAN4] = !( - (p->AUDC[CHAN4] & VOLUME_ONLY) || - (p->AUDC[CHAN4] & VOLUME_MASK) == 0 || - ((p->AUDC[CHAN4] & PURE) && new_val < ((INT32)p->samplerate_24_8 >> 8))) || - (p->AUDCTL & CH2_FILTER); - if( !p->audible[CHAN4] ) - { - p->output[CHAN4] = 1; - p->counter[CHAN4] = 0x7fffffff; - /* 50% duty cycle should result in half volume */ - p->volume[CHAN4] >>= 1; - } - } -} - -void pokey1_w (int offset,int data) -{ - pokey_register_w(0,offset,data); -} - -void pokey2_w (int offset,int data) -{ - pokey_register_w(1,offset,data); -} - -void pokey3_w (int offset,int data) -{ - pokey_register_w(2,offset,data); -} - -void pokey4_w (int offset,int data) -{ - pokey_register_w(3,offset,data); -} - -void quad_pokey_w (int offset,int data) -{ - int pokey_num = (offset >> 3) & ~0x04; - int control = (offset & 0x20) >> 2; - int pokey_reg = (offset % 8) | control; - - pokey_register_w(pokey_num, pokey_reg, data); -} - -void pokey1_serin_ready(int /*after*/) -{ - //timer_set(1.0 * after / intf.baseclock, 0, pokey_serin_ready); -} - -void pokey2_serin_ready(int /*after*/) -{ - //timer_set(1.0 * after / intf.baseclock, 1, pokey_serin_ready); -} - -void pokey3_serin_ready(int /*after*/) -{ - //timer_set(1.0 * after / intf.baseclock, 2, pokey_serin_ready); -} - -void pokey4_serin_ready(int /*after*/) -{ - //timer_set(1.0 * after / intf.baseclock, 3, pokey_serin_ready); -} - -void pokey_break_w(int chip, int shift) -{ - struct POKEYregisters *p = &pokey[chip]; - if( shift ) /* shift code ? */ - p->SKSTAT |= SK_SHIFT; - else - p->SKSTAT &= ~SK_SHIFT; - /* check if the break IRQ is enabled */ - if( p->IRQEN & IRQ_BREAK ) - { - /* set break IRQ status and call back the interrupt handler */ - p->IRQST |= IRQ_BREAK; - if( p->interrupt_cb ) - (*p->interrupt_cb)(IRQ_BREAK); - } -} - -void pokey1_break_w(int shift) -{ - pokey_break_w(0, shift); -} - -void pokey2_break_w(int shift) -{ - pokey_break_w(1, shift); -} - -void pokey3_break_w(int shift) -{ - pokey_break_w(2, shift); -} - -void pokey4_break_w(int shift) -{ - pokey_break_w(3, shift); -} - -void pokey_kbcode_w(int chip, int kbcode, int make) -{ - struct POKEYregisters *p = &pokey[chip]; - /* make code ? */ - if( make ) - { - p->KBCODE = kbcode; - p->SKSTAT |= SK_KEYBD; - if( kbcode & 0x40 ) /* shift code ? */ - p->SKSTAT |= SK_SHIFT; - else - p->SKSTAT &= ~SK_SHIFT; - - if( p->IRQEN & IRQ_KEYBD ) - { - /* last interrupt not acknowledged ? */ - if( p->IRQST & IRQ_KEYBD ) - p->SKSTAT |= SK_KBERR; - p->IRQST |= IRQ_KEYBD; - if( p->interrupt_cb ) - (*p->interrupt_cb)(IRQ_KEYBD); - } - } - else - { - p->KBCODE = kbcode; - p->SKSTAT &= ~SK_KEYBD; - } -} - -void pokey1_kbcode_w(int kbcode, int make) -{ - pokey_kbcode_w(0, kbcode, make); -} - -void pokey2_kbcode_w(int kbcode, int make) -{ - pokey_kbcode_w(1, kbcode, make); -} - -void pokey3_kbcode_w(int kbcode, int make) -{ - pokey_kbcode_w(2, kbcode, make); -} - -void pokey4_kbcode_w(int kbcode, int make) -{ - pokey_kbcode_w(3, kbcode, make); -} - diff --git a/jan/src/burn/snd/pokey.h b/jan/src/burn/snd/pokey.h deleted file mode 100644 index c863c52c5..000000000 --- a/jan/src/burn/snd/pokey.h +++ /dev/null @@ -1,139 +0,0 @@ -/***************************************************************************** - * - * POKEY chip emulator 4.3 - * Copyright (c) 2000 by The MAME Team - * - * Based on original info found in Ron Fries' Pokey emulator, - * with additions by Brad Oliver, Eric Smith and Juergen Buchmueller. - * paddle (a/d conversion) details from the Atari 400/800 Hardware Manual. - * Polynome algorithms according to info supplied by Perry McFarlane. - * - * This code is subject to the MAME license, which besides other - * things means it is distributed as is, no warranties whatsoever. - * For more details read the readme.txt that comes with MAME. - * - *****************************************************************************/ - -#ifndef _POKEYSOUND_H -#define _POKEYSOUND_H - -#include "driver.h" - -/* CONSTANT DEFINITIONS */ - -/* POKEY WRITE LOGICALS */ -#define AUDF1_C 0x00 -#define AUDC1_C 0x01 -#define AUDF2_C 0x02 -#define AUDC2_C 0x03 -#define AUDF3_C 0x04 -#define AUDC3_C 0x05 -#define AUDF4_C 0x06 -#define AUDC4_C 0x07 -#define AUDCTL_C 0x08 -#define STIMER_C 0x09 -#define SKREST_C 0x0A -#define POTGO_C 0x0B -#define SEROUT_C 0x0D -#define IRQEN_C 0x0E -#define SKCTL_C 0x0F - -/* POKEY READ LOGICALS */ -#define POT0_C 0x00 -#define POT1_C 0x01 -#define POT2_C 0x02 -#define POT3_C 0x03 -#define POT4_C 0x04 -#define POT5_C 0x05 -#define POT6_C 0x06 -#define POT7_C 0x07 -#define ALLPOT_C 0x08 -#define KBCODE_C 0x09 -#define RANDOM_C 0x0A -#define SERIN_C 0x0D -#define IRQST_C 0x0E -#define SKSTAT_C 0x0F - -/* exact 1.79 MHz clock freq (of the Atari 800 that is) */ -#define FREQ_17_EXACT 1789790 - -/* - * We can now handle the exact frequency as well as any other, - * because aliasing effects are suppressed for pure tones. - */ -#define FREQ_17_APPROX FREQ_17_EXACT - -#define MAXPOKEYS 4 /* max number of emulated chips */ - - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************************************************************** - * pot0_r to pot7_r: - * Handlers for reading the pot values. Some Atari games use - * ALLPOT to return dipswitch settings and other things. - * serin_r, serout_w, interrupt_cb: - * New function pointers for serial input/output and a interrupt callback. - *****************************************************************************/ - -struct POKEYinterface { - int num; /* total number of pokeys in the machine */ - int addtostream; /* 0 = clear stream 1 = mix previous stream w/ pokey_update */ - int baseclock; - int mixing_level[MAXPOKEYS]; - int (*pot0_r[MAXPOKEYS])(int offset); - int (*pot1_r[MAXPOKEYS])(int offset); - int (*pot2_r[MAXPOKEYS])(int offset); - int (*pot3_r[MAXPOKEYS])(int offset); - int (*pot4_r[MAXPOKEYS])(int offset); - int (*pot5_r[MAXPOKEYS])(int offset); - int (*pot6_r[MAXPOKEYS])(int offset); - int (*pot7_r[MAXPOKEYS])(int offset); - int (*allpot_r[MAXPOKEYS])(int offset); - int (*serin_r[MAXPOKEYS])(int offset); - void (*serout_w[MAXPOKEYS])(int offset, int data); - void (*interrupt_cb[MAXPOKEYS])(int mask); -}; - - -int PokeyInit (int clock, int num, double vol, int addtostream); -void PokeyExit (void); - -void pokey_update(int num, INT16 *buffer, int length); - -void pokey_scan(INT32 nAction, INT32* pnMin); - -int pokey1_r (int offset); -int pokey2_r (int offset); -int pokey3_r (int offset); -int pokey4_r (int offset); -int quad_pokey_r (int offset); - -void pokey1_w (int offset,int data); -void pokey2_w (int offset,int data); -void pokey3_w (int offset,int data); -void pokey4_w (int offset,int data); -void quad_pokey_w (int offset,int data); - -void pokey1_serin_ready (int after); -void pokey2_serin_ready (int after); -void pokey3_serin_ready (int after); -void pokey4_serin_ready (int after); - -void pokey1_break_w (int shift); -void pokey2_break_w (int shift); -void pokey3_break_w (int shift); -void pokey4_break_w (int shift); - -void pokey1_kbcode_w (int kbcode, int make); -void pokey2_kbcode_w (int kbcode, int make); -void pokey3_kbcode_w (int kbcode, int make); -void pokey4_kbcode_w (int kbcode, int make); - -#ifdef __cplusplus -} -#endif - -#endif /* POKEYSOUND_H */ diff --git a/jan/src/burn/snd/rescap.h b/jan/src/burn/snd/rescap.h deleted file mode 100644 index afac4713f..000000000 --- a/jan/src/burn/snd/rescap.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef RC_MACROS_H -#define RC_MACROS_H - -/* Little helpers for magnitude conversions */ -#define RES_R(res) ((double)(res)) -#define RES_K(res) ((double)(res) * 1e3) -#define RES_M(res) ((double)(res) * 1e6) -#define CAP_U(cap) ((double)(cap) * 1e-6) -#define CAP_N(cap) ((double)(cap) * 1e-9) -#define CAP_P(cap) ((double)(cap) * 1e-12) - -/* vin --/\r1/\-- out --/\r2/\-- gnd */ -#define RES_VOLTAGE_DIVIDER(r1, r2) ((double)(r2) / ((double)(r1) + (double)(r2))) - -#define RES_2_PARALLEL(r1, r2) (((r1) * (r2)) / ((r1) + (r2))) -#define RES_3_PARALLEL(r1, r2, r3) (1.0 / (1.0 / (r1) + 1.0 / (r2) + 1.0 / (r3))) -#define RES_4_PARALLEL(r1, r2, r3, r4) (1.0 / (1.0 / (r1) + 1.0 / (r2) + 1.0 / (r3) + 1.0 / (r4))) -#define RES_5_PARALLEL(r1, r2, r3, r4, r5) (1.0 / (1.0 / (r1) + 1.0 / (r2) + 1.0 / (r3) + 1.0 / (r4) + 1.0 / (r5))) -#define RES_6_PARALLEL(r1, r2, r3, r4, r5, r6) (1.0 / (1.0 / (r1) + 1.0 / (r2) + 1.0 / (r3) + 1.0 / (r4) + 1.0 / (r5) + 1.0 / (r6))) - -#define RES_2_SERIAL(r1,r2) ((r1)+(r2)) - -#endif diff --git a/jan/src/burn/snd/rf5c68.cpp b/jan/src/burn/snd/rf5c68.cpp deleted file mode 100644 index faa3d420c..000000000 --- a/jan/src/burn/snd/rf5c68.cpp +++ /dev/null @@ -1,285 +0,0 @@ -// Based on MAME sources by Olivier Galibert,Aaron Giles -/*********************************************************/ -/* ricoh RF5C68(or clone) PCM controller */ -/*********************************************************/ - -#include "burnint.h" -#include "rf5c68.h" -#include "burn_sound.h" - -#define NUM_CHANNELS (8) - -static UINT32 nUpdateStep; - -struct pcm_channel -{ - UINT8 enable; - UINT8 env; - UINT8 pan; - UINT8 start; - UINT32 addr; - UINT16 step; - UINT16 loopst; -}; - -struct rf5c68pcm -{ - struct pcm_channel chan[NUM_CHANNELS]; - UINT8 cbank; - UINT8 wbank; - UINT8 enable; - UINT8 data[0x10000]; - double volume[2]; - INT32 output_dir[2]; -}; - -static struct rf5c68pcm *chip = NULL; - -static INT32 *left = NULL; -static INT32 *right = NULL; - -void RF5C68PCMUpdate(INT16* pSoundBuf, INT32 length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_RF5C68Initted) bprintf(PRINT_ERROR, _T("RF5C68PCMUpdate called without init\n")); -#endif - - if (!chip->enable) return; - - INT32 i, j; - - memset(left, 0, length * sizeof(INT32)); - memset(right, 0, length * sizeof(INT32)); - - for (i = 0; i < NUM_CHANNELS; i++) { - pcm_channel *chan = &chip->chan[i]; - - if (chan->enable) { - INT32 lv = (chan->pan & 0xf) * chan->env; - INT32 rv = ((chan->pan >> 4) & 0xf) * chan->env; - - for (j = 0; j < length; j++) { - INT32 sample; - - sample = chip->data[(chan->addr >> 11) & 0xffff]; - if (sample == 0xff) { - chan->addr = chan->loopst << 11; - sample = chip->data[(chan->addr >> 11) & 0xffff]; - if (sample == 0xff) break; - } - - chan->addr += (chan->step * nUpdateStep) >> 15; - - if (sample & 0x80) { - sample &= 0x7f; - left[j] += (sample * lv) >> 5; - right[j] += (sample * rv) >> 5; - } else { - left[j] -= (sample * lv) >> 5; - right[j] -= (sample * rv) >> 5; - } - } - } - } - - for (i = 0; i < length; i++) { - INT32 nLeftSample = 0; - INT32 nRightSample = 0; - - left[i] = BURN_SND_CLIP(left[i]); - left[i] = left[i] & ~0x3f; - right[i] = BURN_SND_CLIP(right[i]); - right[i] = right[i] & ~0x3f; - - if ((chip->output_dir[BURN_SND_RF5C68PCM_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(left[i] * chip->volume[BURN_SND_RF5C68PCM_ROUTE_1]); - } - if ((chip->output_dir[BURN_SND_RF5C68PCM_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(left[i] * chip->volume[BURN_SND_RF5C68PCM_ROUTE_1]); - } - - if ((chip->output_dir[BURN_SND_RF5C68PCM_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(right[i] * chip->volume[BURN_SND_RF5C68PCM_ROUTE_2]); - } - if ((chip->output_dir[BURN_SND_RF5C68PCM_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(right[i] * chip->volume[BURN_SND_RF5C68PCM_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[0] = nLeftSample; - pSoundBuf[1] = nRightSample; - pSoundBuf += 2; - } -} - -void RF5C68PCMReset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_RF5C68Initted) bprintf(PRINT_ERROR, _T("RF5C68PCMReset called without init\n")); -#endif - - memset(chip->data, 0xff, sizeof(chip->data)); -} - -void RF5C68PCMInit(INT32 clock) -{ - chip = (struct rf5c68pcm*)BurnMalloc(sizeof(struct rf5c68pcm)); - - INT32 Rate = clock / 384; - - nUpdateStep = (INT32)(((float)Rate / nBurnSoundRate) * 32768); - - left = (INT32*)BurnMalloc(nBurnSoundLen * sizeof(INT32)); - right = (INT32*)BurnMalloc(nBurnSoundLen * sizeof(INT32)); - - chip->volume[BURN_SND_RF5C68PCM_ROUTE_1] = 1.00; - chip->volume[BURN_SND_RF5C68PCM_ROUTE_2] = 1.00; - chip->output_dir[BURN_SND_RF5C68PCM_ROUTE_1] = BURN_SND_ROUTE_LEFT; - chip->output_dir[BURN_SND_RF5C68PCM_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - - DebugSnd_RF5C68Initted = 1; -} - -void RF5C68PCMSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_RF5C68Initted) bprintf(PRINT_ERROR, _T("RF5C68PCMSetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("RF5C68PCMSetRoute called with invalid index %i\n"), nIndex); -#endif - - chip->volume[nIndex] = nVolume; - chip->output_dir[nIndex] = nRouteDir; -} - -void RF5C68PCMExit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_RF5C68Initted) bprintf(PRINT_ERROR, _T("RF5C68PCMExit called without init\n")); -#endif - - BurnFree(left); - BurnFree(right); - BurnFree(chip); - - DebugSnd_RF5C68Initted = 0; -} - -void RF5C68PCMScan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - ba.Data = chip->data; - ba.nLen = 0x10000; - ba.szName = "RF5C68PCMData"; - BurnAcb(&ba); - - SCAN_VAR(chip->cbank); - SCAN_VAR(chip->wbank); - SCAN_VAR(chip->enable); - - for (INT32 i = 0; i < NUM_CHANNELS; i++) { - pcm_channel *Chan = &chip->chan[i]; - - SCAN_VAR(Chan->enable); - SCAN_VAR(Chan->env); - SCAN_VAR(Chan->pan); - SCAN_VAR(Chan->start); - SCAN_VAR(Chan->addr); - SCAN_VAR(Chan->step); - SCAN_VAR(Chan->loopst); - } - } -} - -void RF5C68PCMRegWrite(UINT8 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_RF5C68Initted) bprintf(PRINT_ERROR, _T("RF5C68PCMReqWrite called without init\n")); -#endif - - struct pcm_channel *chan = &chip->chan[chip->cbank]; - INT32 i; - - /* force the stream to update first */ -// stream_update(chip->stream); - - switch (offset) { - case 0x00: { - chan->env = data; - break; - } - - case 0x01: { - chan->pan = data; - break; - } - - case 0x02: { - chan->step = (chan->step & 0xff00) | (data & 0xff); - break; - } - - case 0x03: { - chan->step = (chan->step & 0xff) | ((data << 8) & 0xff00); - break; - } - - case 0x04: { - chan->loopst = (chan->loopst & 0xff00) | (data & 0xff); - break; - } - - case 0x05: { - chan->loopst = (chan->loopst & 0xff) | ((data << 8) & 0xff00); - break; - } - - case 0x06: { - chan->start = data; - if (!chan->enable) chan->addr = chan->start << (8 + 11); - break; - } - - case 0x07: { - chip->enable = (data >> 7) & 1; - if (data & 0x40) { - chip->cbank = data & 7; - } else { - chip->wbank = data & 15; - } - break; - } - - case 0x08: { - for (i = 0; i < 8; i++) { - chip->chan[i].enable = (~data >> i) & 1; - if (!chip->chan[i].enable) chip->chan[i].addr = chip->chan[i].start << (8 + 11); - } - break; - } - } -} - -UINT8 RF5C68PCMRead(UINT16 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_RF5C68Initted) bprintf(PRINT_ERROR, _T("RF5C68PCMRead called without init\n")); -#endif - - return chip->data[chip->wbank * 0x1000 + offset]; -} - -void RF5C68PCMWrite(UINT16 offset, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_RF5C68Initted) bprintf(PRINT_ERROR, _T("RF5C68PCMWrite called without init\n")); -#endif - - chip->data[(chip->wbank * 0x1000) + offset] = data; -} - -#undef NUM_CHANNELS diff --git a/jan/src/burn/snd/rf5c68.h b/jan/src/burn/snd/rf5c68.h deleted file mode 100644 index 61e6bd704..000000000 --- a/jan/src/burn/snd/rf5c68.h +++ /dev/null @@ -1,16 +0,0 @@ -void RF5C68PCMUpdate(INT16* pSoundBuf, INT32 length); -void RF5C68PCMReset(); -void RF5C68PCMInit(INT32 clock); -void RF5C68PCMSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void RF5C68PCMExit(); -void RF5C68PCMScan(INT32 nAction); -void RF5C68PCMRegWrite(UINT8 offset, UINT8 data); -UINT8 RF5C68PCMRead(UINT16 offset); -void RF5C68PCMWrite(UINT16 offset, UINT8 data); - -#define BURN_SND_RF5C68PCM_ROUTE_1 0 -#define BURN_SND_RF5C68PCM_ROUTE_2 1 - -#define RF5C68PCMSetAllRoutes(v, d) \ - RF5C68PCMSetRoute(BURN_SND_RF5C68PCM_ROUTE_1, v, d); \ - RF5C68PCMSetRoute(BURN_SND_RF5C68PCM_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/saa1099.cpp b/jan/src/burn/snd/saa1099.cpp deleted file mode 100644 index 5a545f7af..000000000 --- a/jan/src/burn/snd/saa1099.cpp +++ /dev/null @@ -1,522 +0,0 @@ -/*************************************************************************** - - Philips SAA1099 Sound driver - - By Juergen Buchmueller and Manuel Abadia - - SAA1099 register layout: - ======================== - - offs | 7654 3210 | description - -----+-----------+--------------------------- - 0x00 | ---- xxxx | Amplitude channel 0 (left) - 0x00 | xxxx ---- | Amplitude channel 0 (right) - 0x01 | ---- xxxx | Amplitude channel 1 (left) - 0x01 | xxxx ---- | Amplitude channel 1 (right) - 0x02 | ---- xxxx | Amplitude channel 2 (left) - 0x02 | xxxx ---- | Amplitude channel 2 (right) - 0x03 | ---- xxxx | Amplitude channel 3 (left) - 0x03 | xxxx ---- | Amplitude channel 3 (right) - 0x04 | ---- xxxx | Amplitude channel 4 (left) - 0x04 | xxxx ---- | Amplitude channel 4 (right) - 0x05 | ---- xxxx | Amplitude channel 5 (left) - 0x05 | xxxx ---- | Amplitude channel 5 (right) - | | - 0x08 | xxxx xxxx | Frequency channel 0 - 0x09 | xxxx xxxx | Frequency channel 1 - 0x0a | xxxx xxxx | Frequency channel 2 - 0x0b | xxxx xxxx | Frequency channel 3 - 0x0c | xxxx xxxx | Frequency channel 4 - 0x0d | xxxx xxxx | Frequency channel 5 - | | - 0x10 | ---- -xxx | Channel 0 octave select - 0x10 | -xxx ---- | Channel 1 octave select - 0x11 | ---- -xxx | Channel 2 octave select - 0x11 | -xxx ---- | Channel 3 octave select - 0x12 | ---- -xxx | Channel 4 octave select - 0x12 | -xxx ---- | Channel 5 octave select - | | - 0x14 | ---- ---x | Channel 0 frequency enable (0 = off, 1 = on) - 0x14 | ---- --x- | Channel 1 frequency enable (0 = off, 1 = on) - 0x14 | ---- -x-- | Channel 2 frequency enable (0 = off, 1 = on) - 0x14 | ---- x--- | Channel 3 frequency enable (0 = off, 1 = on) - 0x14 | ---x ---- | Channel 4 frequency enable (0 = off, 1 = on) - 0x14 | --x- ---- | Channel 5 frequency enable (0 = off, 1 = on) - | | - 0x15 | ---- ---x | Channel 0 noise enable (0 = off, 1 = on) - 0x15 | ---- --x- | Channel 1 noise enable (0 = off, 1 = on) - 0x15 | ---- -x-- | Channel 2 noise enable (0 = off, 1 = on) - 0x15 | ---- x--- | Channel 3 noise enable (0 = off, 1 = on) - 0x15 | ---x ---- | Channel 4 noise enable (0 = off, 1 = on) - 0x15 | --x- ---- | Channel 5 noise enable (0 = off, 1 = on) - | | - 0x16 | ---- --xx | Noise generator parameters 0 - 0x16 | --xx ---- | Noise generator parameters 1 - | | - 0x18 | --xx xxxx | Envelope generator 0 parameters - 0x18 | x--- ---- | Envelope generator 0 control enable (0 = off, 1 = on) - 0x19 | --xx xxxx | Envelope generator 1 parameters - 0x19 | x--- ---- | Envelope generator 1 control enable (0 = off, 1 = on) - | | - 0x1c | ---- ---x | All channels enable (0 = off, 1 = on) - 0x1c | ---- --x- | Synch & Reset generators - -***************************************************************************/ - -#include "burnint.h" -#include "saa1099.h" - -#define LEFT 0x00 -#define RIGHT 0x01 - -/* this structure defines a channel */ -struct saa1099_channel -{ - INT32 frequency; /* frequency (0x00..0xff) */ - INT32 freq_enable; /* frequency enable */ - INT32 noise_enable; /* noise enable */ - INT32 octave; /* octave (0x00..0x07) */ - INT32 amplitude[2]; /* amplitude (0x00..0x0f) */ - INT32 envelope[2]; /* envelope (0x00..0x0f or 0x10 == off) */ - - /* vars to simulate the square wave */ - double counter; - double freq; - INT32 level; -}; - -/* this structure defines a noise channel */ -struct saa1099_noise -{ - /* vars to simulate the noise generator output */ - double counter; - double freq; - INT32 level; /* noise polynomal shifter */ -}; - -/* this structure defines a SAA1099 chip */ -struct saa1099_state -{ - INT32 noise_params[2]; /* noise generators parameters */ - INT32 env_enable[2]; /* envelope generators enable */ - INT32 env_reverse_right[2]; /* envelope reversed for right channel */ - INT32 env_mode[2]; /* envelope generators mode */ - INT32 env_bits[2]; /* non zero = 3 bits resolution */ - INT32 env_clock[2]; /* envelope clock mode (non-zero external) */ - INT32 env_step[2]; /* current envelope step */ - INT32 all_ch_enable; /* all channels enable */ - INT32 sync_state; /* sync all channels */ - INT32 selected_reg; /* selected register */ - struct saa1099_channel channels[6]; /* channels */ - struct saa1099_noise noise[2]; /* noise generators */ - double sample_rate; - INT32 bAdd; - double gain[2]; - INT32 output_dir[2]; -}; - -static saa1099_state chips[2]; -static INT32 nNumChips = 0; - -static const INT32 amplitude_lookup[16] = { - 0*32767/16, 1*32767/16, 2*32767/16, 3*32767/16, - 4*32767/16, 5*32767/16, 6*32767/16, 7*32767/16, - 8*32767/16, 9*32767/16, 10*32767/16, 11*32767/16, - 12*32767/16, 13*32767/16, 14*32767/16, 15*32767/16 -}; - -static const UINT8 envelope[8][64] = { - /* zero amplitude */ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - /* maximum amplitude */ - {15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, }, - /* single decay */ - {15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - /* repetitive decay */ - {15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, - 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, - 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, - 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, - /* single triangular */ - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, - 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - /* repetitive triangular */ - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, - 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, - 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, - /* single attack */ - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - /* repetitive attack */ - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15 } -}; - -static void saa1099_envelope(saa1099_state *saa, INT32 ch) -{ - if (saa->env_enable[ch]) - { - INT32 step, mode, mask; - mode = saa->env_mode[ch]; - /* step from 0..63 and then loop in steps 32..63 */ - step = saa->env_step[ch] = - ((saa->env_step[ch] + 1) & 0x3f) | (saa->env_step[ch] & 0x20); - - mask = 15; - if (saa->env_bits[ch]) - mask &= ~1; /* 3 bit resolution, mask LSB */ - - saa->channels[ch*3+0].envelope[ LEFT] = - saa->channels[ch*3+1].envelope[ LEFT] = - saa->channels[ch*3+2].envelope[ LEFT] = envelope[mode][step] & mask; - if (saa->env_reverse_right[ch] & 0x01) - { - saa->channels[ch*3+0].envelope[RIGHT] = - saa->channels[ch*3+1].envelope[RIGHT] = - saa->channels[ch*3+2].envelope[RIGHT] = (15 - envelope[mode][step]) & mask; - } - else - { - saa->channels[ch*3+0].envelope[RIGHT] = - saa->channels[ch*3+1].envelope[RIGHT] = - saa->channels[ch*3+2].envelope[RIGHT] = envelope[mode][step] & mask; - } - } - else - { - /* envelope mode off, set all envelope factors to 16 */ - saa->channels[ch*3+0].envelope[ LEFT] = - saa->channels[ch*3+1].envelope[ LEFT] = - saa->channels[ch*3+2].envelope[ LEFT] = - saa->channels[ch*3+0].envelope[RIGHT] = - saa->channels[ch*3+1].envelope[RIGHT] = - saa->channels[ch*3+2].envelope[RIGHT] = 16; - } -} - -void saa1099Update(INT32 chip, INT16 *output, INT32 samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SAA1099Initted) bprintf(PRINT_ERROR, _T("saa1099Update called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("saa1099Update called with invalid chip %x\n"), chip); -#endif - - saa1099_state *saa = &chips[chip]; - INT32 j, ch; - - /* if the channels are disabled we're done */ - if (!saa->all_ch_enable) - { - /* init output data */ - memset (output, 0, samples * sizeof(INT16) * 2); - return; - } - - for (ch = 0; ch < 2; ch++) - { - switch (saa->noise_params[ch]) - { - case 0: saa->noise[ch].freq = 31250.0 * 2; break; - case 1: saa->noise[ch].freq = 15625.0 * 2; break; - case 2: saa->noise[ch].freq = 7812.5 * 2; break; - case 3: saa->noise[ch].freq = saa->channels[ch * 3].freq; break; - } - } - - /* fill all data needed */ - for( j = 0; j < samples; j++, output+=2) - { - INT32 output_l = 0, output_r = 0; - - /* for each channel */ - for (ch = 0; ch < 6; ch++) - { - if (saa->channels[ch].freq == 0.0) - saa->channels[ch].freq = (double)((2 * 15625) << saa->channels[ch].octave) / (511.0 - (double)saa->channels[ch].frequency); - - /* check the actual position in the square wave */ - saa->channels[ch].counter -= saa->channels[ch].freq; - - while (saa->channels[ch].counter < 0) - { - /* calculate new frequency now after the half wave is updated */ - saa->channels[ch].freq = (double)((2 * 15625) << saa->channels[ch].octave) / - (511.0 - (double)saa->channels[ch].frequency); - - saa->channels[ch].counter += saa->sample_rate; - saa->channels[ch].level ^= 1; - - /* eventually clock the envelope counters */ - if (ch == 1 && saa->env_clock[0] == 0) - saa1099_envelope(saa, 0); - if (ch == 4 && saa->env_clock[1] == 0) - saa1099_envelope(saa, 1); - } - - /* if the noise is enabled */ - if (saa->channels[ch].noise_enable) - { - /* if the noise level is high (noise 0: chan 0-2, noise 1: chan 3-5) */ - if (saa->noise[ch/3].level & 1) - { - /* subtract to avoid overflows, also use only half amplitude */ - output_l -= saa->channels[ch].amplitude[ LEFT] * saa->channels[ch].envelope[ LEFT] / 16 / 2; - output_r -= saa->channels[ch].amplitude[RIGHT] * saa->channels[ch].envelope[RIGHT] / 16 / 2; - } - } - - /* if the square wave is enabled */ - if (saa->channels[ch].freq_enable) - { - /* if the channel level is high */ - if (saa->channels[ch].level & 1) - { - output_l += saa->channels[ch].amplitude[ LEFT] * saa->channels[ch].envelope[ LEFT] / 16; - output_r += saa->channels[ch].amplitude[RIGHT] * saa->channels[ch].envelope[RIGHT] / 16; - } - } - } - - for (ch = 0; ch < 2; ch++) - { - /* check the actual position in noise generator */ - saa->noise[ch].counter -= saa->noise[ch].freq; - while (saa->noise[ch].counter < 0) - { - saa->noise[ch].counter += saa->sample_rate; - if( ((saa->noise[ch].level & 0x4000) == 0) == ((saa->noise[ch].level & 0x0040) == 0) ) - saa->noise[ch].level = (saa->noise[ch].level << 1) | 1; - else - saa->noise[ch].level <<= 1; - } - } - /* write sound data to the buffer */ - INT32 nLeftSample = 0, nRightSample = 0; - - if ((saa->output_dir[BURN_SND_SAA1099_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((output_l / 6) * saa->gain[BURN_SND_SAA1099_ROUTE_1]); - } - if ((saa->output_dir[BURN_SND_SAA1099_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((output_l / 6) * saa->gain[BURN_SND_SAA1099_ROUTE_1]); - } - - if ((saa->output_dir[BURN_SND_SAA1099_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((output_r / 6) * saa->gain[BURN_SND_SAA1099_ROUTE_2]); - } - if ((saa->output_dir[BURN_SND_SAA1099_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((output_r / 6) * saa->gain[BURN_SND_SAA1099_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - output[LEFT] = nLeftSample; - output[RIGHT] = nRightSample; - } -} - -void saa1099Reset(INT32 chip) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SAA1099Initted) bprintf(PRINT_ERROR, _T("saa1099Reset called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("saa1099Reset called with invalid chip %x\n"), chip); -#endif - - saa1099_state *saa = &chips[chip]; - - double sample_rate = saa->sample_rate; - INT32 bAdd = saa->bAdd; - double gain0 = saa->gain[BURN_SND_SAA1099_ROUTE_1]; - double gain1 = saa->gain[BURN_SND_SAA1099_ROUTE_2]; - INT32 dir0 = saa->output_dir[BURN_SND_SAA1099_ROUTE_1]; - INT32 dir1 = saa->output_dir[BURN_SND_SAA1099_ROUTE_2]; - - memset (saa, 0, sizeof(saa1099_state)); - - saa->sample_rate = sample_rate; - saa->bAdd = bAdd; - saa->gain[BURN_SND_SAA1099_ROUTE_1] = gain0; - saa->gain[BURN_SND_SAA1099_ROUTE_2] = gain1; - saa->output_dir[BURN_SND_SAA1099_ROUTE_1] = dir0; - saa->output_dir[BURN_SND_SAA1099_ROUTE_2] = dir1; -} - -void saa1099Init(INT32 chip, INT32 clock, INT32 bAdd) -{ - DebugSnd_SAA1099Initted = 1; - - saa1099_state *saa = &chips[chip]; - - saa->sample_rate = clock / 256; - saa->bAdd = bAdd; - saa->gain[BURN_SND_SAA1099_ROUTE_1] = 1.00; - saa->gain[BURN_SND_SAA1099_ROUTE_2] = 1.00; - saa->output_dir[BURN_SND_SAA1099_ROUTE_1] = BURN_SND_ROUTE_BOTH; - saa->output_dir[BURN_SND_SAA1099_ROUTE_2] = BURN_SND_ROUTE_BOTH; - - nNumChips = chip; -} - -void saa1099SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SAA1099Initted) bprintf(PRINT_ERROR, _T("saa1099SetRoute called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("saa1099SetRoute called with invalid chip %x\n"), chip); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("saa1099SetRoute called with invalid index %i\n"), nIndex); -#endif - - saa1099_state *saa = &chips[chip]; - - saa->gain[nIndex] = nVolume; - saa->output_dir[nIndex] = nRouteDir; -} - -void saa1099Exit(INT32 ) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SAA1099Initted) bprintf(PRINT_ERROR, _T("saa1099Exit called without init\n")); -#endif - - DebugSnd_SAA1099Initted = 0; - nNumChips = 0; -} - -void saa1099ControlWrite(INT32 chip, INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SAA1099Initted) bprintf(PRINT_ERROR, _T("saa1099ControlWrite called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("saa1099ControlWrite called with invalid chip %x\n"), chip); -#endif - - saa1099_state *saa = &chips[chip]; - - saa->selected_reg = data & 0x1f; - - if (saa->selected_reg == 0x18 || saa->selected_reg == 0x19) - { - /* clock the envelope channels */ - if (saa->env_clock[0]) - saa1099_envelope(saa,0); - if (saa->env_clock[1]) - saa1099_envelope(saa,1); - } -} - -void saa1099DataWrite(INT32 chip, INT32 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SAA1099Initted) bprintf(PRINT_ERROR, _T("saa1099DataWrite called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("saa1099DataWrite called with invalid chip %x\n"), chip); -#endif - - saa1099_state *saa = &chips[chip]; - INT32 reg = saa->selected_reg; - INT32 ch; - - switch (reg) - { - /* channel i amplitude */ - case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: - ch = reg & 7; - saa->channels[ch].amplitude[LEFT] = amplitude_lookup[data & 0x0f]; - saa->channels[ch].amplitude[RIGHT] = amplitude_lookup[(data >> 4) & 0x0f]; - break; - /* channel i frequency */ - case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: - ch = reg & 7; - saa->channels[ch].frequency = data & 0xff; - break; - /* channel i octave */ - case 0x10: case 0x11: case 0x12: - ch = (reg - 0x10) << 1; - saa->channels[ch + 0].octave = data & 0x07; - saa->channels[ch + 1].octave = (data >> 4) & 0x07; - break; - /* channel i frequency enable */ - case 0x14: - saa->channels[0].freq_enable = data & 0x01; - saa->channels[1].freq_enable = data & 0x02; - saa->channels[2].freq_enable = data & 0x04; - saa->channels[3].freq_enable = data & 0x08; - saa->channels[4].freq_enable = data & 0x10; - saa->channels[5].freq_enable = data & 0x20; - break; - /* channel i noise enable */ - case 0x15: - saa->channels[0].noise_enable = data & 0x01; - saa->channels[1].noise_enable = data & 0x02; - saa->channels[2].noise_enable = data & 0x04; - saa->channels[3].noise_enable = data & 0x08; - saa->channels[4].noise_enable = data & 0x10; - saa->channels[5].noise_enable = data & 0x20; - break; - /* noise generators parameters */ - case 0x16: - saa->noise_params[0] = data & 0x03; - saa->noise_params[1] = (data >> 4) & 0x03; - break; - /* envelope generators parameters */ - case 0x18: case 0x19: - ch = reg - 0x18; - saa->env_reverse_right[ch] = data & 0x01; - saa->env_mode[ch] = (data >> 1) & 0x07; - saa->env_bits[ch] = data & 0x10; - saa->env_clock[ch] = data & 0x20; - saa->env_enable[ch] = data & 0x80; - /* reset the envelope */ - saa->env_step[ch] = 0; - break; - /* channels enable & reset generators */ - case 0x1c: - saa->all_ch_enable = data & 0x01; - saa->sync_state = data & 0x02; - if (data & 0x02) - { - INT32 i; - - /* Synch & Reset generators */ - for (i = 0; i < 6; i++) - { - saa->channels[i].level = 0; - saa->channels[i].counter = 0.0; - } - } - break; - default: break; /* Error! */ - } -} - -void saa1099Scan(INT32 chip, INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SAA1099Initted) bprintf(PRINT_ERROR, _T("saa1099Scan called without init\n")); -#endif - - struct BurnArea ba; - saa1099_state *saa = &chips[chip]; - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = (UINT8*)saa; - ba.nLen = sizeof(saa1099_state); - ba.szName = "SAA data"; - BurnAcb(&ba); - } -} diff --git a/jan/src/burn/snd/saa1099.h b/jan/src/burn/snd/saa1099.h deleted file mode 100644 index 306987812..000000000 --- a/jan/src/burn/snd/saa1099.h +++ /dev/null @@ -1,15 +0,0 @@ -void saa1099Update(INT32 chip, INT16 *output, INT32 samples); -void saa1099Reset(INT32 chip); -void saa1099Init(INT32 chip, INT32 clock, INT32 bAdd); -void saa1099SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void saa1099ControlWrite(INT32 chip, INT32 data); -void saa1099DataWrite(INT32 chip, INT32 data); -void saa1099Scan(INT32 chip, INT32 nAction); -void saa1099Exit(INT32 chip); - -#define BURN_SND_SAA1099_ROUTE_1 0 -#define BURN_SND_SAA1099_ROUTE_2 1 - -#define saa1099SetAllRoutes(i, v, d) \ - saa1099SetRoute(i, BURN_SND_SAA1099_ROUTE_1, v, d); \ - saa1099SetRoute(i, BURN_SND_SAA1099_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/samples.cpp b/jan/src/burn/snd/samples.cpp deleted file mode 100644 index 0e6f28800..000000000 --- a/jan/src/burn/snd/samples.cpp +++ /dev/null @@ -1,643 +0,0 @@ -// FB Alpha sample player module - -#include "burnint.h" -//#include "direct.h" -#include "samples.h" - -#define SAMPLE_DIRECTORY szAppSamplesPath - -#define get_long() ((ptr[3] << 24) | (ptr[2] << 16) | (ptr[1] << 8) | (ptr[0] << 0)) -#define get_short() ((ptr[1] << 8) | (ptr[0] << 0)) - -static INT32 bAddToStream = 0; -static INT32 nTotalSamples = 0; -INT32 bBurnSampleTrimSampleEnd = 0; - -struct sample_format -{ - UINT8 *data; - UINT32 length; - UINT32 position; - UINT8 playing; - UINT8 loop; - UINT8 flags; - double gain[2]; - INT32 output_dir[2]; -}; - -static struct sample_format *samples = NULL; // store samples -static struct sample_format *sample_ptr = NULL; // generic pointer for sample - -static void make_raw(UINT8 *src, UINT32 len) -{ - UINT8 *ptr = src; - - if (ptr[0] != 'R' || ptr[1] != 'I' || ptr[2] != 'F' || ptr[3] != 'F') return; - ptr += 4; // skip RIFF - - UINT32 length = get_long(); ptr += 4; // total length of file - if (len < length) length = len - 8; // first 8 bytes (RIFF + Len) - - /* "WAVEfmt " */ ptr += 8; // WAVEfmt + 1 space - UINT32 length2 = get_long(); ptr += 4; // Wavefmt length -/* unsigned short format = get_short(); */ptr += 2; // format? - UINT16 channels = get_short(); ptr += 2; // channels - UINT32 sample_rate = get_long(); ptr += 4; // sample rate -/* unsigned int speed = get_long(); */ptr += 4; // speed - should equal (bits * channels * sample_rate) -/* unsigned short align = get_short(); */ptr += 2; // block align should be ((bits / 8) * channels) - UINT16 bits = get_short() / 8; ptr += 2; // bits per sample (0010) - ptr += length2 - 16; // get past the wave format chunk - - // are we in the 'data' chunk? if not, skip this chunk. - if (ptr[0] != 'd' || ptr[1] != 'a' || ptr[2] != 't' || ptr[3] != 'a') { - ptr += 4; // skip tag - - UINT32 length3 = get_long(); ptr += 4; - ptr += length3; - } - - /* "data" */ ptr += 4; // "data" - UINT32 data_length = get_long(); ptr += 4; // should be up to the data... - - if ((len - (ptr - src)) < data_length) data_length = len - (ptr - src); - - UINT32 converted_len = (UINT32)((float)(data_length * (nBurnSoundRate * 1.00000 / sample_rate) / (bits * channels))); - if (converted_len == 0) return; - - sample_ptr->data = (UINT8*)BurnMalloc(converted_len * 4); - -// up/down sample everything and convert to raw 16 bit stereo - { - INT16 *data = (INT16*)sample_ptr->data; - INT16 *poin = (INT16*)ptr; - UINT8 *poib = ptr; - - for (UINT32 i = 0; i < converted_len; i++) - { - UINT32 x = (UINT32)((float)(i * (sample_rate * 1.00000 / nBurnSoundRate))); - - if (bits == 2) { // signed 16 bit, stereo & mono - data[i * 2 + 0] = poin[x * channels + 0 ]; - data[i * 2 + 1] = poin[x * channels + (channels / 2)]; - } - - if (bits == 1) { // unsigned 8 bit, stereo & mono - data[i * 2 + 0] = (poib[x * channels + 0 ] - 128) << 8; - data[i * 2 + 1] = (poib[x * channels + (channels / 2)] - 128) << 8; - } - } - - // now go through and set the gain - for (UINT32 i = 0; i < converted_len * 2; i++) - { - INT32 d = data[i]; - if (d > 0x7fff) d = 0x7fff; - if (d < -0x7fff) d = -0x7fff; - data[i] = (INT16)d; - } - - //bprintf(0, _T("converted_len before: %X [%d]\n"), converted_len, converted_len); - if (bBurnSampleTrimSampleEnd) { // trim silence off the end of the sample, bBurnSampleTrimSampleEnd must be set before init! - while (data[converted_len * 2] == 0) converted_len -= 2; - } - //bprintf(0, _T("converted_len after : %X [%d]\n"), converted_len, converted_len); - } - - sample_ptr->length = converted_len; - sample_ptr->playing = 0; - sample_ptr->position = 0; -} - -void BurnSampleInitOne(INT32); // below... - -void BurnSamplePlay(INT32 sample) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSamplePlay called without init\n")); -#endif - - if (sample >= nTotalSamples) return; - - sample_ptr = &samples[sample]; - - if (sample_ptr->flags & SAMPLE_IGNORE) return; - - if (sample_ptr->flags & SAMPLE_NOSTORE) { - BurnSampleInitOne(sample); - } - - sample_ptr->playing = 1; - sample_ptr->position = 0; -} - -void BurnSamplePause(INT32 sample) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSamplePause called without init\n")); -#endif - - if (sample >= nTotalSamples) return; - - sample_ptr = &samples[sample]; - sample_ptr->playing = 0; -} - -void BurnSampleResume(INT32 sample) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleResume called without init\n")); -#endif - - if (sample >= nTotalSamples) return; - - sample_ptr = &samples[sample]; - sample_ptr->playing = 1; -} - -void BurnSampleStop(INT32 sample) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleStop called without init\n")); -#endif - - if (sample >= nTotalSamples) return; - - sample_ptr = &samples[sample]; - sample_ptr->playing = 0; - sample_ptr->position = 0; -} - -void BurnSampleSetLoop(INT32 sample, bool dothis) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleSetLoop called without init\n")); -#endif - - if (sample >= nTotalSamples) return; - - sample_ptr = &samples[sample]; - - sample_ptr->loop = (dothis ? 1 : 0); -} - -INT32 BurnSampleGetStatus(INT32 sample) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleGetStatus called without init\n")); -#endif - - if (sample >= nTotalSamples) return -1; - - sample_ptr = &samples[sample]; - return (sample_ptr->playing); -} - -INT32 BurnSampleGetPosition(INT32 sample) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleGetPosition called without init\n")); -#endif - - if (sample >= nTotalSamples) return -1; - - sample_ptr = &samples[sample]; - return (sample_ptr->position); -} - -void BurnSampleSetPosition(INT32 sample, UINT32 position) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleSetPosition called without init\n")); -#endif - - if (sample >= nTotalSamples) return; - - sample_ptr = &samples[sample]; - sample_ptr->position = position; -} - -void BurnSampleReset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleReset called without init\n")); -#endif - - for (INT32 i = 0; i < nTotalSamples; i++) { - BurnSampleStop(i); - - if (sample_ptr->flags & SAMPLE_AUTOLOOP) { - //bprintf(0, _T("set loop #%X\n"), i); - BurnSampleSetLoop(i, true); // this sets the loop flag, from the driver. - } - } -} - -INT32 __cdecl ZipLoadOneFile(char* arcName, const char* fileName, void** Dest, INT32* pnWrote); -char* TCHARToANSI(const TCHAR* pszInString, char* pszOutString, INT32 nOutSize); -#define _TtoA(a) TCHARToANSI(a, NULL, 0) - -void BurnSampleInit(INT32 bAdd /*add sample to stream?*/) -{ - DebugSnd_SamplesInitted = 1; - - if (nBurnSoundRate == 0) { - nTotalSamples = 0; - return; - } - - INT32 length; - char path[256]; - char setname[128]; - void *destination = NULL; - char szTempPath[MAX_PATH]; - sprintf(szTempPath, _TtoA(SAMPLE_DIRECTORY)); - - // test to see if file exists - INT32 nEnableSamples = 0; - - if (BurnDrvGetTextA(DRV_SAMPLENAME) == NULL) { // called with no samples - nTotalSamples = 0; - return; - } - - strcpy(setname, BurnDrvGetTextA(DRV_SAMPLENAME)); - sprintf(path, "%s%s.zip", szTempPath, setname); - - FILE *test = fopen(path, "rb"); - if (test) - { - nEnableSamples = 1; - fclose(test); - } - -#ifdef INCLUDE_7Z_SUPPORT - sprintf(path, "%s%s.7z", szTempPath, setname); - - test = fopen(path, "rb"); - if (test) - { - nEnableSamples = 1; - fclose(test); - } -#endif - - bAddToStream = bAdd; - nTotalSamples = 0; - - if (!nEnableSamples) return; - - struct BurnSampleInfo si; - INT32 nSampleOffset = -1; - do { - BurnDrvGetSampleInfo(&si, ++nSampleOffset); - if (si.nFlags) nTotalSamples++; - } while (si.nFlags); - - samples = (sample_format*)BurnMalloc(sizeof(sample_format) * nTotalSamples); - memset (samples, 0, sizeof(sample_format) * nTotalSamples); - - for (INT32 i = 0; i < nTotalSamples; i++) { - BurnDrvGetSampleInfo(&si, i); - char *szSampleNameTmp = NULL; - BurnDrvGetSampleName(&szSampleNameTmp, i, 0); - - sample_ptr = &samples[i]; - - // append .wav to filename - char szSampleName[1024]; - memset(&szSampleName, 0, sizeof(szSampleName)); - strncpy(&szSampleName[0], szSampleNameTmp, sizeof(szSampleName) - 5); // leave space for ".wav" + null, just incase! - strcat(&szSampleName[0], ".wav"); - - if (si.nFlags == 0) break; - - if (si.nFlags & SAMPLE_NOSTORE) { - sample_ptr->flags = si.nFlags; - sample_ptr->data = NULL; - continue; - } - - sprintf (path, "%s%s", szTempPath, setname); - - destination = NULL; - length = 0; - ZipLoadOneFile((char*)path, (const char*)szSampleName, &destination, &length); - - if (length) { - sample_ptr->flags = si.nFlags; - make_raw((UINT8*)destination, length); - } else { - sample_ptr->flags = SAMPLE_IGNORE; - } - - sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_1] = 1.00; - sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_2] = 1.00; - sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_1] = BURN_SND_ROUTE_BOTH; - sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_2] = BURN_SND_ROUTE_BOTH; - - BurnFree (destination); - - BurnSetProgressRange(1.0 / nTotalSamples); - BurnUpdateProgress((double)1.0 / i * nTotalSamples, _T("Loading samples..."), 0); - } -} - -void BurnSampleInitOne(INT32 sample) -{ - if (sample >= nTotalSamples) { - return; - } - - { - struct sample_format *clr_ptr = &samples[0]; - - int i = 0; - while (i < nTotalSamples) { - - if (clr_ptr->data != NULL && i != sample && (clr_ptr->flags & SAMPLE_NOSTORE)) { - BurnFree(clr_ptr->data); - clr_ptr->playing = 0; - clr_ptr->data = NULL; - } - - clr_ptr++, i++; - } - } - - if ((sample_ptr->flags & SAMPLE_NOSTORE) == 0) { - return; - } - - INT32 length; - char path[256]; - char setname[128]; - void *destination = NULL; - char szTempPath[MAX_PATH]; - sprintf(szTempPath, _TtoA(SAMPLE_DIRECTORY)); - - strcpy(setname, BurnDrvGetTextA(DRV_SAMPLENAME)); - sprintf(path, "%s%s.zip", szTempPath, setname); - - struct BurnSampleInfo si; - BurnDrvGetSampleInfo(&si, sample); - char *szSampleNameTmp = NULL; - BurnDrvGetSampleName(&szSampleNameTmp, sample, 0); - - sample_ptr = &samples[sample]; - - // append .wav to filename - char szSampleName[1024]; - memset(&szSampleName, 0, sizeof(szSampleName)); - strncpy(&szSampleName[0], szSampleNameTmp, sizeof(szSampleName) - 5); // leave space for ".wav" + null, just incase! - strcat(&szSampleName[0], ".wav"); - - if (sample_ptr->playing || sample_ptr->data != NULL || sample_ptr->flags == SAMPLE_IGNORE) { - return; - } - - sprintf (path, "%s%s", szTempPath, setname); - - destination = NULL; - length = 0; - ZipLoadOneFile((char*)path, (const char*)szSampleName, &destination, &length); - - if (length) { - make_raw((UINT8*)destination, length); - } - - BurnFree (destination); -} - -void BurnSampleSetRoute(INT32 sample, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleSetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnSampleSetRoute called with invalid index %i\n"), nIndex); -#endif - - if (sample >= nTotalSamples) return; - - sample_ptr = &samples[sample]; - sample_ptr->gain[nIndex] = nVolume; - sample_ptr->output_dir[nIndex] = nRouteDir; -} - -void BurnSampleSetRouteAllSamples(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleSetRouteAllSamples called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnSampleSetRouteAllSamples called with invalid index %i\n"), nIndex); -#endif - - for (INT32 i = 0; i < nTotalSamples; i++) { - sample_ptr = &samples[i]; - sample_ptr->gain[nIndex] = nVolume; - sample_ptr->output_dir[nIndex] = nRouteDir; - } -} - -void BurnSampleExit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleExit called without init\n")); -#endif - - if (!DebugSnd_SamplesInitted) return; - - for (INT32 i = 0; i < nTotalSamples; i++) { - sample_ptr = &samples[i]; - BurnFree (sample_ptr->data); - } - - BurnFree (samples); - - sample_ptr = NULL; - nTotalSamples = 0; - bAddToStream = 0; - bBurnSampleTrimSampleEnd = 0; - - DebugSnd_SamplesInitted = 0; -} - -void BurnSampleRender(INT16 *pDest, UINT32 pLen) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleRender called without init\n")); -#endif - - if (pBurnSoundOut == NULL) return; - - INT32 nFirstSample = 0; - UINT32 *dest = (UINT32*)pDest; - - if (bAddToStream == 0) { - memset(dest, 0, pLen * 4); // clear buffer - } - - for (INT32 i = 0; i < nTotalSamples; i++) - { - sample_ptr = &samples[i]; - if (sample_ptr->playing == 0) continue; - - INT32 playlen = pLen; - INT32 loop = sample_ptr->loop; - INT32 length = sample_ptr->length; - INT32 position = sample_ptr->position; - - UINT32 *data = (UINT32*)sample_ptr->data; - - if (loop) { - if (bAddToStream == 0 && nFirstSample == 0) { - position *= 2; - length *= 2; - INT16 *dst = (INT16*)dest; - INT16 *dat = (INT16*)data; - - for (INT32 j = 0; j < playlen; j++, position+=2, dst += 2) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dat[(position + 0) % length] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_1]); - } - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dat[(position + 0) % length] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_1]); - } - - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dat[(position + 1) % length] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_2]); - } - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dat[(position + 1) % length] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - dst[0] = nLeftSample; - dst[1] = nRightSample; - } - } else { - position *= 2; - length *= 2; - INT16 *dst = (INT16*)dest; - INT16 *dat = (INT16*)data; - - for (INT32 j = 0; j < playlen; j++, position+=2, dst += 2) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dat[(position + 0) % length] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_1]); - } - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dat[(position + 0) % length] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_1]); - } - - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dat[(position + 1) % length] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_2]); - } - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dat[(position + 1) % length] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample + dst[0]); - nRightSample = BURN_SND_CLIP(nRightSample + dst[1]); - - dst[0] = nLeftSample; - dst[1] = nRightSample; - } - } - } else { - length = length - position; - - if (length <= 0) { - if (loop == 0) { - sample_ptr->playing = 0; - continue; - } - } - - data += position; - if (playlen > length) playlen = length; - if (bAddToStream == 0 && nFirstSample == 0) { - INT16 *dst = (INT16*)dest; - INT16 *dat = (INT16*)data; - - for (INT32 j = 0; j < playlen; j++, dst +=2, dat+=2) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dat[0] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_1]); - } - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dat[0] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_1]); - } - - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dat[1] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_2]); - } - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dat[1] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - dst[0] = nLeftSample; - dst[1] = nRightSample; - } - } else { - INT16 *dst = (INT16*)dest; - INT16 *dat = (INT16*)data; - - for (INT32 j = 0; j < playlen; j++, dst +=2, dat+=2) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dat[0] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_1]); - } - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dat[0] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_1]); - } - - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(dat[1] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_2]); - } - if ((sample_ptr->output_dir[BURN_SND_SAMPLE_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(dat[1] * sample_ptr->gain[BURN_SND_SAMPLE_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample + dst[0]); - nRightSample = BURN_SND_CLIP(nRightSample + dst[1]); - - dst[0] = nLeftSample; - dst[1] = nRightSample; - } - } - } - - sample_ptr->position += playlen; - nFirstSample++; - } -} - -INT32 BurnSampleScan(INT32 nAction, INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SamplesInitted) bprintf(PRINT_ERROR, _T("BurnSampleScan called without init\n")); -#endif - - if (pnMin != NULL) { - *pnMin = 0x029707; - } - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i < nTotalSamples; i++) { - sample_ptr = &samples[i]; - SCAN_VAR(sample_ptr->playing); - SCAN_VAR(sample_ptr->loop); - SCAN_VAR(sample_ptr->position); - } - } - - return 0; -} diff --git a/jan/src/burn/snd/samples.h b/jan/src/burn/snd/samples.h deleted file mode 100644 index abce5050d..000000000 --- a/jan/src/burn/snd/samples.h +++ /dev/null @@ -1,43 +0,0 @@ -#define SAMPLE_IGNORE (1<<0) // don't ever play this sample -#define SAMPLE_AUTOLOOP (1<<1) // start the looping on start -#define SAMPLE_NOLOOP (1<<2) // don't allow this to loop - -// Change this to 0 to 1 if using samples in a low-ram environment. -// May cause momentary stutter while sample loads. -#define SAMPLE_NOSTORE (0<<3) // only keep in memory while playing - -void BurnSamplePlay(INT32 sample); -void BurnSamplePause(INT32 sample); -void BurnSampleResume(INT32 sample); -void BurnSampleStop(INT32 sample); - -void BurnSampleSetLoop(INT32 sample, bool dothis); - -INT32 BurnSampleGetStatus(INT32 sample); - -INT32 BurnSampleGetPosition(INT32 sample); -void BurnSampleSetPosition(INT32 sample, UINT32 position); - -void BurnSampleReset(); - -void BurnSampleInit(INT32 bAdd); -void BurnSampleSetRoute(INT32 sample, INT32 nIndex, double nVolume, INT32 nRouteDir); -void BurnSampleSetRouteAllSamples(INT32 nIndex, double nVolume, INT32 nRouteDir); - -INT32 BurnSampleScan(INT32 nAction, INT32 *pnMin); - -void BurnSampleRender(INT16 *pDest, UINT32 pLen); -void BurnSampleExit(); - -extern INT32 bBurnSampleTrimSampleEnd; // set before BurnSampleInit(); - -#define BURN_SND_SAMPLE_ROUTE_1 0 -#define BURN_SND_SAMPLE_ROUTE_2 1 - -#define BurnSampleSetAllRoutes(i, v, d) \ - BurnSampleSetRoute(i, BURN_SND_SAMPLE_ROUTE_1, v, d); \ - BurnSampleSetRoute(i, BURN_SND_SAMPLE_ROUTE_2, v, d); - -#define BurnSampleSetAllRoutesAllSamples(v, d) \ - BurnSampleSetRouteAllSamples(BURN_SND_SAMPLE_ROUTE_1, v, d); \ - BurnSampleSetRouteAllSamples(BURN_SND_SAMPLE_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/segapcm.cpp b/jan/src/burn/snd/segapcm.cpp deleted file mode 100644 index 7f111e201..000000000 --- a/jan/src/burn/snd/segapcm.cpp +++ /dev/null @@ -1,241 +0,0 @@ -// Based on MAME sources by Hiromitsu Shioya, Olivier Galibert -/*********************************************************/ -/* SEGA 16ch 8bit PCM */ -/*********************************************************/ - -#include "burnint.h" -#include "burn_sound.h" -#include "segapcm.h" - -#define MAX_CHIPS 2 - -struct segapcm -{ - UINT8 ram[0x800]; - UINT8 low[16]; - const UINT8 *rom; - INT32 bankshift; - INT32 bankmask; - INT32 UpdateStep; - double Volume[2]; - INT32 OutputDir[2]; -}; - -static struct segapcm *Chip[MAX_CHIPS] = { NULL, }; -static INT32 *Left[MAX_CHIPS] = { NULL, }; -static INT32 *Right[MAX_CHIPS] = { NULL, }; - -static INT32 nNumChips = 0; - -static void SegaPCMUpdateOne(INT32 nChip, INT32 nLength) -{ - INT32 Channel; - - memset(Left[nChip], 0, nLength * sizeof(INT32)); - memset(Right[nChip], 0, nLength * sizeof(INT32)); - - for (Channel = 0; Channel < 16; Channel++) { - UINT8 *Regs = Chip[nChip]->ram + 8 * Channel; - if (!(Regs[0x86] & 1)) { - const UINT8 *Rom = Chip[nChip]->rom + ((Regs[0x86] & Chip[nChip]->bankmask) << Chip[nChip]->bankshift); - UINT32 Addr = (Regs[0x85] << 16) | (Regs[0x84] << 8) | Chip[nChip]->low[Channel]; - UINT32 Loop = (Regs[0x05] << 16) | (Regs[0x04] << 8); - UINT8 End = Regs[6] + 1; - INT32 i; - - for (i = 0; i < nLength; i++) { - INT8 v = 0; - - if ((Addr >> 16) == End) { - if (Regs[0x86] & 2) { - Regs[0x86] |= 1; - break; - } else { - Addr = Loop; - } - } - - v = Rom[Addr >> 8] - 0x80; - - Left[nChip][i] += v * Regs[2]; - Right[nChip][i] += v * Regs[3]; - Addr = (Addr + ((Regs[7] * Chip[nChip]->UpdateStep) >> 16)) & 0xffffff; - } - - Regs[0x84] = Addr >> 8; - Regs[0x85] = Addr >> 16; - Chip[nChip]->low[Channel] = Regs[0x86] & 1 ? 0 : Addr; - } - } -} - -void SegaPCMUpdate(INT16* pSoundBuf, INT32 nLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SegaPCMInitted) bprintf(PRINT_ERROR, _T("SegaPCMUpdate called without init\n")); -#endif - - for (INT32 i = 0; i < nNumChips + 1; i++) { - SegaPCMUpdateOne(i, nLength); - } - - for (INT32 i = 0; i < nLength; i++) { - INT32 nLeftSample = 0; - INT32 nRightSample = 0; - - if ((Chip[0]->OutputDir[BURN_SND_SEGAPCM_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Left[0][i] * Chip[0]->Volume[BURN_SND_SEGAPCM_ROUTE_1]); - } - if ((Chip[0]->OutputDir[BURN_SND_SEGAPCM_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Left[0][i] * Chip[0]->Volume[BURN_SND_SEGAPCM_ROUTE_1]); - } - - if ((Chip[0]->OutputDir[BURN_SND_SEGAPCM_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Right[0][i] * Chip[0]->Volume[BURN_SND_SEGAPCM_ROUTE_2]); - } - if ((Chip[0]->OutputDir[BURN_SND_SEGAPCM_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Right[0][i] * Chip[0]->Volume[BURN_SND_SEGAPCM_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (nNumChips >= 1) { - if ((Chip[1]->OutputDir[BURN_SND_SEGAPCM_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Left[1][i] * Chip[1]->Volume[BURN_SND_SEGAPCM_ROUTE_1]); - } - if ((Chip[1]->OutputDir[BURN_SND_SEGAPCM_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Left[1][i] * Chip[1]->Volume[BURN_SND_SEGAPCM_ROUTE_1]); - } - - if ((Chip[1]->OutputDir[BURN_SND_SEGAPCM_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Right[1][i] * Chip[1]->Volume[BURN_SND_SEGAPCM_ROUTE_2]); - } - if ((Chip[1]->OutputDir[BURN_SND_SEGAPCM_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)(Right[1][i] * Chip[1]->Volume[BURN_SND_SEGAPCM_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - } - - pSoundBuf[0] = BURN_SND_CLIP(pSoundBuf[0] + nLeftSample); - pSoundBuf[1] = BURN_SND_CLIP(pSoundBuf[1] + nRightSample); - pSoundBuf += 2; - } -} - -void SegaPCMInit(INT32 nChip, INT32 clock, INT32 bank, UINT8 *pPCMData, INT32 PCMDataSize) -{ - INT32 Mask, RomMask; - - Chip[nChip] = (struct segapcm*)BurnMalloc(sizeof(*Chip[nChip])); - memset(Chip[nChip], 0, sizeof(*Chip[nChip])); - - Chip[nChip]->rom = pPCMData; - - memset(Chip[nChip]->ram, 0xff, 0x800); - - Left[nChip] = (INT32*)BurnMalloc(nBurnSoundLen * sizeof(INT32)); - Right[nChip] = (INT32*)BurnMalloc(nBurnSoundLen * sizeof(INT32)); - - Chip[nChip]->bankshift = bank; - Mask = bank >> 16; - if(!Mask) - Mask = BANK_MASK7 >> 16; - - for (RomMask = 1; RomMask < PCMDataSize; RomMask *= 2) {} - RomMask--; - - Chip[nChip]->bankmask = Mask & (RomMask >> Chip[nChip]->bankshift); - - double Rate = (double)clock / 128 / nBurnSoundRate; - Chip[nChip]->UpdateStep = (INT32)(Rate * 0x10000); - - Chip[nChip]->Volume[BURN_SND_SEGAPCM_ROUTE_1] = 1.00; - Chip[nChip]->Volume[BURN_SND_SEGAPCM_ROUTE_2] = 1.00; - Chip[nChip]->OutputDir[BURN_SND_SEGAPCM_ROUTE_1] = BURN_SND_ROUTE_LEFT; - Chip[nChip]->OutputDir[BURN_SND_SEGAPCM_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - - nNumChips = nChip; - - DebugSnd_SegaPCMInitted = 1; -} - -void SegaPCMSetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SegaPCMInitted) bprintf(PRINT_ERROR, _T("SegaPCMSetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("SegaPCMSetRoute called with invalid index %i\n"), nIndex); - if (nChip > nNumChips) bprintf(PRINT_ERROR, _T("SegaPCMSetRoute called with invalid chip %i\n"), nChip); -#endif - - Chip[nChip]->Volume[nIndex] = nVolume; - Chip[nChip]->OutputDir[nIndex] = nRouteDir; -} - -void SegaPCMExit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_SegaPCMInitted) bprintf(PRINT_ERROR, _T("SegaPCMExit called without init\n")); -#endif - - if (!DebugSnd_SegaPCMInitted) return; - - for (INT32 i = 0; i < nNumChips + 1; i++) { - BurnFree(Chip[i]); - BurnFree(Left[i]); - BurnFree(Right[i]); - } - - nNumChips = 0; - - DebugSnd_SegaPCMInitted = 0; -} - -INT32 SegaPCMScan(INT32 nAction,INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SegaPCMInitted) bprintf(PRINT_ERROR, _T("SegaPCMScan called without init\n")); -#endif - - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - for (INT32 i = 0; i < nNumChips + 1; i++) { - if (nAction & ACB_DRIVER_DATA) { - ScanVar(Chip[i]->low, 16 * sizeof(UINT8), "SegaPCMlow"); - - memset(&ba, 0, sizeof(ba)); - ba.Data = Chip[i]->ram; - ba.nLen = 0x800; - ba.szName = "SegaPCMRAM"; - BurnAcb(&ba); - } - } - - return 0; -} - -UINT8 SegaPCMRead(INT32 nChip, UINT32 Offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SegaPCMInitted) bprintf(PRINT_ERROR, _T("SegaPCMRead called without init\n")); - if (nChip > nNumChips) bprintf(PRINT_ERROR, _T("SegaPCMRead called with invalid chip %i\n"), nChip); -#endif - - return Chip[nChip]->ram[Offset & 0x07ff]; -} - -void SegaPCMWrite(INT32 nChip, UINT32 Offset, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SegaPCMInitted) bprintf(PRINT_ERROR, _T("SegaPCMWrite called without init\n")); - if (nChip > nNumChips) bprintf(PRINT_ERROR, _T("SegaPCMWrite called with invalid chip %i\n"), nChip); -#endif - - Chip[nChip]->ram[Offset & 0x07ff] = Data; -} diff --git a/jan/src/burn/snd/segapcm.h b/jan/src/burn/snd/segapcm.h deleted file mode 100644 index 30beb0b3d..000000000 --- a/jan/src/burn/snd/segapcm.h +++ /dev/null @@ -1,21 +0,0 @@ -#define BANK_256 (11) -#define BANK_512 (12) -#define BANK_12M (13) -#define BANK_MASK7 (0x70<<16) -#define BANK_MASKF (0xf0<<16) -#define BANK_MASKF8 (0xf8<<16) - -void SegaPCMUpdate(INT16* pSoundBuf, INT32 nLength); -void SegaPCMInit(INT32 nChip, INT32 clock, INT32 bank, UINT8 *pPCMData, INT32 PCMDataSize); -void SegaPCMSetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void SegaPCMExit(); -INT32 SegaPCMScan(INT32 nAction,INT32 *pnMin); -UINT8 SegaPCMRead(INT32 nChip, UINT32 Offset); -void SegaPCMWrite(INT32 nChip, UINT32 Offset, UINT8 Data); - -#define BURN_SND_SEGAPCM_ROUTE_1 0 -#define BURN_SND_SEGAPCM_ROUTE_2 1 - -#define SegaPCMSetAllRoutes(n, v, d) \ - SegaPCMSetRoute(n, BURN_SND_SEGAPCM_ROUTE_1, v, d); \ - SegaPCMSetRoute(n, BURN_SND_SEGAPCM_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/sn76477.cpp b/jan/src/burn/snd/sn76477.cpp deleted file mode 100644 index 493ba0c67..000000000 --- a/jan/src/burn/snd/sn76477.cpp +++ /dev/null @@ -1,984 +0,0 @@ -// Based on MAME sources by Zsolt Vasvari -/***************************************************************************** - - Texas Instruments SN76477 emulator - - authors: Derrick Renaud - info - Zsolt Vasvari - software - - (see sn76477.h for details) - - Notes: - * All formulas were derived by taking measurements of a real device, - then running the data sets through the numerical analysis - application at http://zunzun.com to come up with the functions. - - Known issues/to-do's: - * VCO - * confirm value of VCO_MAX_EXT_VOLTAGE, VCO_TO_SLF_VOLTAGE_DIFF - VCO_CAP_VOLTAGE_MIN and VCO_CAP_VOLTAGE_MAX - * confirm value of VCO_MIN_DUTY_CYCLE - * get real formulas for VCO cap charging and discharging - * get real formula for VCO duty cycle - * what happens if no vco_res - * what happens if no vco_cap - - * Attack/Decay - * get real formulas for a/d cap charging and discharging - - *****************************************************************************/ - -#include "burnint.h" -#include "sn76477.h" - -#define VERBOSE 0 - -#if VERBOSE >= 0 -#define LOG(n,x) //if( VERBOSE >= (n) ) logerror x -#else -#define LOG(n,x) -#endif - -#define VMIN 0x0000 -#define VMAX 0x7fff - -struct SN76477 { - double mastervol; - int samplerate; /* from Machine->sample_rate */ - int vol; /* current volume (attack/decay) */ - int vol_count; /* volume adjustment counter */ - int vol_rate; /* volume adjustment rate - dervied from attack/decay */ - int vol_step; /* volume adjustment step */ - - double slf_count; /* SLF emulation */ - double slf_freq; /* frequency - derived */ - double slf_level; /* triangular wave level */ - int slf_dir; /* triangular wave direction */ - int slf_out; /* rectangular output signal state */ - - double vco_count; /* VCO emulation */ - double vco_freq; /* frequency - derived */ - double vco_step; /* modulated frequency - derived */ - int vco_out; /* rectangular output signal state */ - - int noise_count; /* NOISE emulation */ - int noise_clock; /* external clock signal */ - int noise_freq; /* filter frequency - derived */ - int noise_poly; /* polynome */ - int noise_out; /* rectangular output signal state */ - - double envelope_timer; /* ENVELOPE timer */ - int envelope_state; /* attack / decay toggle */ - - double attack_time; /* ATTACK time (time until vol reaches 100%) */ - double decay_time; /* DECAY time (time until vol reaches 0%) */ - double oneshot_time; /* ONE-SHOT time */ - double oneshot_timer; /* ONE-SHOT timer */ - - int envelope; /* pin 1, pin 28 */ - double noise_res; /* pin 4 */ - double filter_res; /* pin 5 */ - double filter_cap; /* pin 6 */ - double decay_res; /* pin 7 */ - double attack_decay_cap;/* pin 8 */ - int enable; /* pin 9 */ - double attack_res; /* pin 10 */ - double amplitude_res; /* pin 11 */ - double feedback_res; /* pin 12 */ - double vco_voltage; /* pin 16 */ - double vco_cap; /* pin 17 */ - double vco_res; /* pin 18 */ - double pitch_voltage; /* pin 19 */ - double slf_res; /* pin 20 */ - double slf_cap; /* pin 21 */ - int vco_select; /* pin 22 */ - double oneshot_cap; /* pin 23 */ - double oneshot_res; /* pin 24 */ - int mixer; /* pin 25,26,27 */ - - INT16 vol_lookup[VMAX+1-VMIN]; /* volume lookup table */ -}; - -//static struct SN76477interface *intf; -struct SN76477 *sn76477[MAX_SN76477] = {NULL, NULL, NULL, NULL}; - -static void attack_decay(int param) -{ - struct SN76477 *sn = sn76477[param]; - sn->envelope_state ^= 1; - if( sn->envelope_state ) - { - /* start ATTACK */ - sn->vol_rate = ( sn->attack_time > 0 ) ? VMAX / sn->attack_time : VMAX; - sn->vol_step = +1; - LOG(2,("SN76477 #%d: ATTACK rate %d/%d = %d/sec\n", param, sn->vol_rate, sn->samplerate, sn->vol_rate/sn->samplerate)); - } - else - { - /* start DECAY */ - sn->vol = VMAX; /* just in case... */ - sn->vol_rate = ( sn->decay_time > 0 ) ? VMAX / sn->decay_time : VMAX; - sn->vol_step = -1; - LOG(2,("SN76477 #%d: DECAY rate %d/%d = %d/sec\n", param, sn->vol_rate, sn->samplerate, sn->vol_rate/sn->samplerate)); - } -} - -static void vco_envelope_cb(int param) -{ - attack_decay(param); -} - -static void oneshot_envelope_cb(int param) -{ - attack_decay(param); -} - -static void sntimer_tick(int param) -{ - if (sn76477[param]->envelope_timer > 0.0) { - vco_envelope_cb(param); - sn76477[param]->envelope_timer -= 0.0001; - //if (!sn76477[param]->envelope_timer) - // bprintf(0, _T("envtimer done!")); - } - - if (sn76477[param]->oneshot_timer > 0.0) { - oneshot_envelope_cb(param); - sn76477[param]->oneshot_timer -= 0.0001; - //if (!sn76477[param]->oneshot_timer) - // bprintf(0, _T("shottimer done!")); - } -} - -#if VERBOSE -static const char *mixer_mode[8] = { - "VCO", - "SLF", - "Noise", - "VCO/Noise", - "SLF/Noise", - "SLF/VCO/Noise", - "SLF/VCO", - "Inhibit" -}; -#endif - -/***************************************************************************** - * set MIXER select inputs - *****************************************************************************/ -void SN76477_mixer_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - if( data == sn->mixer ) - return; - - sn->mixer = data; - LOG(1,("SN76477 #%d: MIXER mode %d [%s]\n", chip, sn->mixer, mixer_mode[sn->mixer])); -} - -void SN76477_mixer_a_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - data = data ? 1 : 0; - if( data == (sn->mixer & 1) ) - return; - - sn->mixer = (sn->mixer & ~1) | data; - LOG(1,("SN76477 #%d: MIXER mode %d [%s]\n", chip, sn->mixer, mixer_mode[sn->mixer])); -} - -void SN76477_mixer_b_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - data = data ? 2 : 0; - if( data == (sn->mixer & 2) ) - return; - - sn->mixer = (sn->mixer & ~2) | data; - LOG(1,("SN76477 #%d: MIXER mode %d [%s]\n", chip, sn->mixer, mixer_mode[sn->mixer])); -} - -void SN76477_mixer_c_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - data = data ? 4 : 0; - if( data == (sn->mixer & 4) ) - return; - - sn->mixer = (sn->mixer & ~4) | data; - LOG(1,("SN76477 #%d: MIXER mode %d [%s]\n", chip, sn->mixer, mixer_mode[sn->mixer])); -} - -#if VERBOSE -static const char *envelope_mode[4] = { - "VCO", - "One-Shot", - "Mixer only", - "VCO with alternating Polarity" -}; -#endif - -/***************************************************************************** - * set ENVELOPE select inputs - *****************************************************************************/ -void SN76477_envelope_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - if( data == sn->envelope ) - return; - - sn->envelope = data; - LOG(1,("SN76477 #%d: ENVELOPE mode %d [%s]\n", chip, sn->envelope, envelope_mode[sn->envelope])); -} - -void SN76477_envelope_1_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - if( data == (sn->envelope & 1) ) - return; - - sn->envelope = (sn->envelope & ~1) | data; - LOG(1,("SN76477 #%d: ENVELOPE mode %d [%s]\n", chip, sn->envelope, envelope_mode[sn->envelope])); -} - -void SN76477_envelope_2_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - data <<= 1; - - if( data == (sn->envelope & 2) ) - return; - - sn->envelope = (sn->envelope & ~2) | data; - LOG(1,("SN76477 #%d: ENVELOPE mode %d [%s]\n", chip, sn->envelope, envelope_mode[sn->envelope])); -} - -/***************************************************************************** - * set VCO external/SLF input - *****************************************************************************/ -void SN76477_vco_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - if( data == sn->vco_select ) - return; - - sn->vco_select = data; - LOG(1,("SN76477 #%d: VCO select %d [%s]\n", chip, sn->vco_select, sn->vco_select ? "Internal (SLF)" : "External (Pin 16)")); -} - -/***************************************************************************** - * set VCO enable input - *****************************************************************************/ -void SN76477_enable_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - if( data == sn->enable ) - return; - - sn->enable = data; - sn->envelope_state = data; - - sn->envelope_timer = 0; - sn->oneshot_timer = 0; - - if( sn->enable == 0 ) - { - switch( sn->envelope ) - { - case 0: /* VCO */ - if( sn->vco_res > 0 && sn->vco_cap > 0 ) - sn->envelope_timer = TIME_IN_HZ(0.64/(sn->vco_res * sn->vco_cap)); - else - oneshot_envelope_cb(chip); - break; - case 1: /* One-Shot */ - oneshot_envelope_cb(chip); - if (sn->oneshot_time > 0) - sn->oneshot_timer = sn->oneshot_time; - break; - case 2: /* MIXER only */ - sn->vol = VMAX; - break; - default: /* VCO with alternating polariy */ - /* huh? */ - if( sn->vco_res > 0 && sn->vco_cap > 0 ) - sn->envelope_timer = TIME_IN_HZ(0.64/(sn->vco_res * sn->vco_cap)/2); - else - oneshot_envelope_cb(chip); - break; - } - } - else - { - switch( sn->envelope ) - { - case 0: /* VCO */ - if( sn->vco_res > 0 && sn->vco_cap > 0 ) - sn->envelope_timer = TIME_IN_HZ(0.64/(sn->vco_res * sn->vco_cap)); - else - oneshot_envelope_cb(chip); - break; - case 1: /* One-Shot */ - oneshot_envelope_cb(chip); - break; - case 2: /* MIXER only */ - sn->vol = VMIN; - break; - default: /* VCO with alternating polariy */ - /* huh? */ - if( sn->vco_res > 0 && sn->vco_cap > 0 ) - sn->envelope_timer = TIME_IN_HZ(0.64/(sn->vco_res * sn->vco_cap)/2); - else - oneshot_envelope_cb(chip); - break; - } - } - LOG(1,("SN76477 #%d: ENABLE line %d [%s]\n", chip, sn->enable, sn->enable ? "Inhibited" : "Enabled" )); -} - -/***************************************************************************** - * set NOISE external signal (pin 3) - *****************************************************************************/ -void SN76477_noise_clock_w(int chip, int data) -{ - struct SN76477 *sn = sn76477[chip]; - - if( data == sn->noise_clock ) - return; - - sn->noise_clock = data; - /* on the rising edge shift the polynome */ - if( sn->noise_clock ) - sn->noise_poly = ((sn->noise_poly << 7) + (sn->noise_poly >> 10) + 0x18000) & 0x1ffff; -} - -/***************************************************************************** - * set NOISE resistor (pin 4) - *****************************************************************************/ -void SN76477_set_noise_res(int chip, double res) -{ - struct SN76477 *sn = sn76477[chip]; - - sn->noise_res = res; -} - -/***************************************************************************** - * set NOISE FILTER resistor (pin 5) - *****************************************************************************/ -void SN76477_set_filter_res(int chip, double res) -{ - struct SN76477 *sn = sn76477[chip]; - - if( res == sn->filter_res ) - return; - - sn->filter_res = res; - if( sn->filter_res > 0 && sn->filter_cap > 0 ) - { - sn->noise_freq = (int)(1.28 / (sn->filter_res * sn->filter_cap)); - LOG(1,("SN76477 #%d: NOISE FILTER freqency %d\n", chip, sn->noise_freq)); - } - else - sn->noise_freq = sn->samplerate; -} - -/***************************************************************************** - * set NOISE FILTER capacitor (pin 6) - *****************************************************************************/ -void SN76477_set_filter_cap(int chip, double cap) -{ - struct SN76477 *sn = sn76477[chip]; - - if( cap == sn->filter_cap ) - return; - - sn->filter_cap = cap; - if( sn->filter_res > 0 && sn->filter_cap > 0 ) - { - sn->noise_freq = (int)(1.28 / (sn->filter_res * sn->filter_cap)); - LOG(1,("SN76477 #%d: NOISE FILTER freqency %d\n", chip, sn->noise_freq)); - } - else - sn->noise_freq = sn->samplerate; -} - -/***************************************************************************** - * set DECAY resistor (pin 7) - *****************************************************************************/ -void SN76477_set_decay_res(int chip, double res) -{ - struct SN76477 *sn = sn76477[chip]; - - if( res == sn->decay_res ) - return; - - sn->decay_res = res; - sn->decay_time = sn->decay_res * sn->attack_decay_cap; - LOG(1,("SN76477 #%d: DECAY time is %fs\n", chip, sn->decay_time)); -} - -/***************************************************************************** - * set ATTACK/DECAY capacitor (pin 8) - *****************************************************************************/ -void SN76477_set_attack_decay_cap(int chip, double cap) -{ - struct SN76477 *sn = sn76477[chip]; - - if( cap == sn->attack_decay_cap ) - return; - - sn->attack_decay_cap = cap; - sn->decay_time = sn->decay_res * sn->attack_decay_cap; - sn->attack_time = sn->attack_res * sn->attack_decay_cap; - LOG(1,("SN76477 #%d: ATTACK time is %fs\n", chip, sn->attack_time)); - LOG(1,("SN76477 #%d: DECAY time is %fs\n", chip, sn->decay_time)); -} - -/***************************************************************************** - * set ATTACK resistor (pin 10) - *****************************************************************************/ -void SN76477_set_attack_res(int chip, double res) -{ - struct SN76477 *sn = sn76477[chip]; - - if( res == sn->attack_res ) - return; - - sn->attack_res = res; - sn->attack_time = sn->attack_res * sn->attack_decay_cap; - LOG(1,("SN76477 #%d: ATTACK time is %fs\n", chip, sn->attack_time)); -} - -/***************************************************************************** - * set AMP resistor (pin 11) - *****************************************************************************/ -void SN76477_set_amplitude_res(int chip, double res) -{ - struct SN76477 *sn = sn76477[chip]; - int i; - - if( res == sn->amplitude_res ) - return; - - sn->amplitude_res = res; - if( sn->amplitude_res > 0 ) - { -#if VERBOSE - int clip = 0; -#endif - for( i = 0; i < VMAX+1; i++ ) - { - int vol = (int)((3.4 * sn->feedback_res / sn->amplitude_res) * 32767 * i / (VMAX+1)); -#if VERBOSE - if( vol > 32767 && !clip ) - clip = i; - LOG(3,("%d\n", vol)); -#endif - if( vol > 32767 ) vol = 32767; - sn->vol_lookup[i] = vol * sn->mastervol / 100; - } - LOG(1,("SN76477 #%d: volume range from -%d to +%d (clip at %d%%)\n", chip, sn->vol_lookup[VMAX-VMIN], sn->vol_lookup[VMAX-VMIN], clip * 100 / 256)); - } - else - { - memset(sn->vol_lookup, 0, sizeof(sn->vol_lookup)); - } -} - -/***************************************************************************** - * set FEEDBACK resistor (pin 12) - *****************************************************************************/ -void SN76477_set_feedback_res(int chip, double res) -{ - struct SN76477 *sn = sn76477[chip]; - int i; - - if( res == sn->feedback_res ) - return; - - sn->feedback_res = res; - if( sn->amplitude_res > 0 ) - { -#if VERBOSE - int clip = 0; -#endif - for( i = 0; i < VMAX+1; i++ ) - { - int vol = (int)((3.4 * sn->feedback_res / sn->amplitude_res) * 32767 * i / (VMAX+1)); -#if VERBOSE - if( vol > 32767 && !clip ) clip = i; -#endif - if( vol > 32767 ) vol = 32767; - sn->vol_lookup[i] = vol * sn->mastervol / 100; - } - LOG(1,("SN76477 #%d: volume range from -%d to +%d (clip at %d%%)\n", chip, sn->vol_lookup[VMAX-VMIN], sn->vol_lookup[VMAX-VMIN], clip * 100 / 256)); - } - else - { - memset(sn->vol_lookup, 0, sizeof(sn->vol_lookup)); - } -} - -/***************************************************************************** - * set PITCH voltage (pin 19) - * TODO: fill with live... - *****************************************************************************/ -void SN76477_set_pitch_voltage(int chip, double voltage) -{ - struct SN76477 *sn = sn76477[chip]; - - if( voltage == sn->pitch_voltage ) - return; - - sn->pitch_voltage = voltage; - LOG(1,("SN76477 #%d: VCO pitch voltage %f (%d%% duty cycle)\n", chip, sn->pitch_voltage, 0)); -} - -/***************************************************************************** - * set VCO resistor (pin 18) - *****************************************************************************/ -void SN76477_set_vco_res(int chip, double res) -{ - struct SN76477 *sn = sn76477[chip]; - - if( res == sn->vco_res ) - return; - - sn->vco_res = res; - if( sn->vco_res > 0 && sn->vco_cap > 0 ) - { - sn->vco_freq = 0.64 / (sn->vco_res * sn->vco_cap); - LOG(1,("SN76477 #%d: VCO freqency %f\n", chip, sn->vco_freq)); - } - else - sn->vco_freq = 0; -} - -/***************************************************************************** - * set VCO capacitor (pin 17) - *****************************************************************************/ -void SN76477_set_vco_cap(int chip, double cap) -{ - struct SN76477 *sn = sn76477[chip]; - - if( cap == sn->vco_cap ) - return; - - sn->vco_cap = cap; - if( sn->vco_res > 0 && sn->vco_cap > 0 ) - { - sn->vco_freq = 0.64 / (sn->vco_res * sn->vco_cap); - LOG(1,("SN76477 #%d: VCO freqency %f\n", chip, sn->vco_freq)); - } - else - sn->vco_freq = 0; -} - -/***************************************************************************** - * set VCO voltage (pin 16) - *****************************************************************************/ -void SN76477_set_vco_voltage(int chip, double voltage) -{ - struct SN76477 *sn = sn76477[chip]; - - if( voltage == sn->vco_voltage ) - return; - - sn->vco_voltage = voltage; - LOG(1,("SN76477 #%d: VCO ext. voltage %f (%f * %f = %f Hz)\n", chip, - sn->vco_voltage, - sn->vco_freq, - 10.0 * (5.0 - sn->vco_voltage) / 5.0, - sn->vco_freq * 10.0 * (5.0 - sn->vco_voltage) / 5.0)); -} - -/***************************************************************************** - * set SLF resistor (pin 20) - *****************************************************************************/ -void SN76477_set_slf_res(int chip, double res) -{ - struct SN76477 *sn = sn76477[chip]; - - if( res == sn->slf_res ) - return; - - sn->slf_res = res; - if( sn->slf_res > 0 && sn->slf_cap > 0 ) - { - sn->slf_freq = 0.64 / (sn->slf_res * sn->slf_cap); - LOG(1,("SN76477 #%d: SLF freqency %f\n", chip, sn->slf_freq)); - } - else - sn->slf_freq = 0; -} - -/***************************************************************************** - * set SLF capacitor (pin 21) - *****************************************************************************/ -void SN76477_set_slf_cap(int chip, double cap) -{ - struct SN76477 *sn = sn76477[chip]; - - if( cap == sn->slf_cap ) - return; - - sn->slf_cap = cap; - if( sn->slf_res > 0 && sn->slf_cap > 0 ) - { - sn->slf_freq = 0.64 / (sn->slf_res * sn->slf_cap); - LOG(1,("SN76477 #%d: SLF freqency %f\n", chip, sn->slf_freq)); - } - else - sn->slf_freq = 0; -} - -/***************************************************************************** - * set ONESHOT resistor (pin 24) - *****************************************************************************/ -void SN76477_set_oneshot_res(int chip, double res) -{ - struct SN76477 *sn = sn76477[chip]; - - if( res == sn->oneshot_res ) - return; - sn->oneshot_res = res; - sn->oneshot_time = 0.8 * sn->oneshot_res * sn->oneshot_cap; - //bprintf(0,_T("SN76477 #%d: ONE-SHOT(res) time %fs\n"), chip, sn->oneshot_time); -} - -/***************************************************************************** - * set ONESHOT capacitor (pin 23) - *****************************************************************************/ -void SN76477_set_oneshot_cap(int chip, double cap) -{ - struct SN76477 *sn = sn76477[chip]; - - if( cap == sn->oneshot_cap ) - return; - sn->oneshot_cap = cap; - sn->oneshot_time = 0.8 * sn->oneshot_res * sn->oneshot_cap; - //bprintf(0,_T("SN76477 #%d: ONE-SHOT(cap) time %fs\n"), chip, sn->oneshot_time); -} - -void SN76477_set_mastervol(int chip, double vol) -{ - struct SN76477 *sn = sn76477[chip]; - - sn->mastervol = vol; -} - -#define UPDATE_SLF \ - /************************************* \ - * SLF super low frequency oscillator \ - * frequency = 0.64 / (r_slf * c_slf) \ - *************************************/ \ - sn->slf_count -= sn->slf_freq; \ - while( sn->slf_count <= 0 ) \ - { \ - sn->slf_count += sn->samplerate; \ - sn->slf_out ^= 1; \ - } - -#define UPDATE_VCO \ - /************************************ \ - * VCO voltage controlled oscilator \ - * min. freq = 0.64 / (r_vco * c_vco) \ - * freq. range is approx. 10:1 \ - ************************************/ \ - if( sn->vco_select ) \ - { \ - /* VCO is controlled by SLF */ \ - if( sn->slf_dir == 0 ) \ - { \ - sn->slf_level -= sn->slf_freq * 2 * 5.0 / sn->samplerate; \ - if( sn->slf_level <= 0.0 ) \ - { \ - sn->slf_level = 0.0; \ - sn->slf_dir = 1; \ - } \ - } \ - else \ - if( sn->slf_dir == 1 ) \ - { \ - sn->slf_level += sn->slf_freq * 2 * 5.0 / sn->samplerate; \ - if( sn->slf_level >= 5.0 ) \ - { \ - sn->slf_level = 5.0; \ - sn->slf_dir = 0; \ - } \ - } \ - sn->vco_step = sn->vco_freq * sn->slf_level; \ - } \ - else \ - { \ - /* VCO is controlled by external voltage */ \ - sn->vco_step = sn->vco_freq * sn->vco_voltage; \ - } \ - sn->vco_count -= sn->vco_step; \ - while( sn->vco_count <= 0 ) \ - { \ - sn->vco_count += sn->samplerate; \ - sn->vco_out ^= 1; \ - } - -#define UPDATE_NOISE \ - /************************************* \ - * NOISE pseudo rand number generator \ - *************************************/ \ - if( sn->noise_res > 0 ) \ - sn->noise_poly = ( (sn->noise_poly << 7) + \ - (sn->noise_poly >> 10) + \ - 0x18000 ) & 0x1ffff; \ - \ - /* low pass filter: sample every noise_freq pseudo random value */ \ - sn->noise_count -= sn->noise_freq; \ - while( sn->noise_count <= 0 ) \ - { \ - sn->noise_count = sn->samplerate; \ - sn->noise_out = sn->noise_poly & 1; \ - } - -#define UPDATE_VOLUME \ - /************************************* \ - * VOLUME adjust for attack/decay \ - *************************************/ \ - sn->vol_count -= sn->vol_rate; \ - if( sn->vol_count <= 0 ) \ - { \ - int n = - sn->vol_count / sn->samplerate + 1; /* number of steps */ \ - sn->vol_count += n * sn->samplerate; \ - sn->vol += n * sn->vol_step; \ - if( sn->vol < VMIN ) sn->vol = VMIN; \ - if( sn->vol > VMAX ) sn->vol = VMAX; \ - LOG(3,("SN76477 #%d: vol = $%04X\n", chip, sn->vol)); \ - } - - -/***************************************************************************** - * mixer select 0 0 0 : VCO - *****************************************************************************/ -static void SN76477_update_0(int chip, INT16 *buffer, int length) -{ - struct SN76477 *sn = sn76477[chip]; - while( length-- ) - { - UPDATE_VCO; - UPDATE_VOLUME; - INT16 sam = (sn->vco_out ? sn->vol_lookup[sn->vol-VMIN] : -sn->vol_lookup[sn->vol-VMIN]);// * SNMASTERVOL; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - sntimer_tick(chip); - } -} - -/***************************************************************************** - * mixer select 0 0 1 : SLF - *****************************************************************************/ -static void SN76477_update_1(int chip, INT16 *buffer, int length) -{ - struct SN76477 *sn = sn76477[chip]; - while( length-- ) - { - UPDATE_SLF; - UPDATE_VOLUME; - INT16 sam = (sn->slf_out ? sn->vol_lookup[sn->vol-VMIN] : -sn->vol_lookup[sn->vol-VMIN]);// * SNMASTERVOL; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - sntimer_tick(chip); - } -} - -/***************************************************************************** - * mixer select 0 1 0 : NOISE - *****************************************************************************/ -static void SN76477_update_2(int chip, INT16 *buffer, int length) -{ - struct SN76477 *sn = sn76477[chip]; - while( length-- ) - { - UPDATE_NOISE; - UPDATE_VOLUME; - INT16 sam = (sn->noise_out ? sn->vol_lookup[sn->vol-VMIN] : -sn->vol_lookup[sn->vol-VMIN]);// * SNMASTERVOL; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - sntimer_tick(chip); - } -} - -/***************************************************************************** - * mixer select 0 1 1 : VCO and NOISE - *****************************************************************************/ -static void SN76477_update_3(int chip, INT16 *buffer, int length) -{ - struct SN76477 *sn = sn76477[chip]; - while( length-- ) - { - UPDATE_VCO; - UPDATE_NOISE; - UPDATE_VOLUME; - INT16 sam = ((sn->vco_out & sn->noise_out) ? sn->vol_lookup[sn->vol-VMIN] : -sn->vol_lookup[sn->vol-VMIN]);// * SNMASTERVOL; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - sntimer_tick(chip); - } -} - -/***************************************************************************** - * mixer select 1 0 0 : SLF and NOISE - *****************************************************************************/ -static void SN76477_update_4(int chip, INT16 *buffer, int length) -{ - struct SN76477 *sn = sn76477[chip]; - while( length-- ) - { - UPDATE_SLF; - UPDATE_NOISE; - UPDATE_VOLUME; - INT16 sam = ((sn->slf_out & sn->noise_out) ? sn->vol_lookup[sn->vol-VMIN] : -sn->vol_lookup[sn->vol-VMIN]);// * SNMASTERVOL; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - sntimer_tick(chip); - } -} - -/***************************************************************************** - * mixer select 1 0 1 : VCO, SLF and NOISE - *****************************************************************************/ -static void SN76477_update_5(int chip, INT16 *buffer, int length) -{ - struct SN76477 *sn = sn76477[chip]; - while( length-- ) - { - UPDATE_SLF; - UPDATE_VCO; - UPDATE_NOISE; - UPDATE_VOLUME; - INT16 sam = ((sn->vco_out & sn->slf_out & sn->noise_out) ? sn->vol_lookup[sn->vol-VMIN] : -sn->vol_lookup[sn->vol-VMIN]);// * SNMASTERVOL; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - sntimer_tick(chip); - } -} - -/***************************************************************************** - * mixer select 1 1 0 : VCO and SLF - *****************************************************************************/ -static void SN76477_update_6(int chip, INT16 *buffer, int length) -{ - struct SN76477 *sn = sn76477[chip]; - while( length-- ) - { - UPDATE_SLF; - UPDATE_VCO; - UPDATE_VOLUME; - INT16 sam = ((sn->vco_out & sn->slf_out) ? sn->vol_lookup[sn->vol-VMIN] : -sn->vol_lookup[sn->vol-VMIN]);// * SNMASTERVOL; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - sntimer_tick(chip); - } -} - -/***************************************************************************** - * mixer select 1 1 1 : Inhibit - *****************************************************************************/ -static void SN76477_update_7(int chip, INT16 *buffer, int length) -{ - /*while( length-- ) { - *buffer++ = 0; - *buffer++ = 0; - }*/ -} - -void SN76477_sound_update(int param, INT16 *buffer, int length) -{ - struct SN76477 *sn = sn76477[param]; - if( sn->enable ) - { - SN76477_update_7(param,buffer,length); - } - else - { - switch( sn->mixer ) - { - case 0: - SN76477_update_0(param,buffer,length); - break; - case 1: - SN76477_update_1(param,buffer,length); - break; - case 2: - SN76477_update_2(param,buffer,length); - break; - case 3: - SN76477_update_3(param,buffer,length); - break; - case 4: - SN76477_update_4(param,buffer,length); - break; - case 5: - SN76477_update_5(param,buffer,length); - break; - case 6: - SN76477_update_6(param,buffer,length); - break; - default: - SN76477_update_7(param,buffer,length); - break; - } - } -#if 0 - if (sn76477[param]->oneshot_timer > 0.0) - bprintf(0, _T("ost: %fs, "), sn76477[param]->oneshot_timer); - if (sn76477[param]->envelope_timer > 0.0) - bprintf(0, _T("envt: %fs, "), sn76477[param]->envelope_timer); -#endif -} - -void SN76477_exit(int num) // yea, needs work. I know.. -{ - BurnFree(sn76477[num]); -} - -void SN76477_init(int num) -{ - sn76477[num] = (SN76477 *)BurnMalloc(sizeof(struct SN76477)); - if( !sn76477[num] ) - { - LOG(0,("%s failed to malloc struct SN76477\n", name)); - return; - } - memset(sn76477[num], 0, sizeof(struct SN76477)); - - sn76477[num]->samplerate = nBurnSoundRate; - - sn76477[num]->envelope_timer = 0; - sn76477[num]->oneshot_timer = 0; - sn76477[num]->mastervol = 1.00; - - SN76477_mixer_w(num, 0x07); /* turn off mixing */ - SN76477_envelope_w(num, 0x03); /* envelope inputs open */ - SN76477_enable_w(num, 0x01); /* enable input open */ -} diff --git a/jan/src/burn/snd/sn76477.h b/jan/src/burn/snd/sn76477.h deleted file mode 100644 index 0561094d4..000000000 --- a/jan/src/burn/snd/sn76477.h +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - SN76477 pins and assigned interface variables/functions - - SN76477_envelope_w() - / \ - [ 1] ENV SEL 1 ENV SEL 2 [28] - [ 2] GND MIXER C [27] \ - SN76477_noise_w() [ 3] NOISE EXT OSC MIXER A [26] > SN76477_mixer_w() - noise_res [ 4] RES NOISE OSC MIXER B [25] / - filter_res [ 5] NOISE FILTER RES O/S RES [24] oneshot_res - filter_cap [ 6] NOISE FILTER CAP O/S CAP [23] oneshot_cap - decay_res [ 7] DECAY RES VCO SEL [22] SN76477_vco_w() - attack_decay_cap [ 8] A/D CAP SLF CAP [21] slf_cap - SN76477_enable_w() [ 9] ENABLE SLF RES [20] slf_res - attack_res [10] ATTACK RES PITCH [19] pitch_voltage - amplitude_res [11] AMP VCO RES [18] vco_res - feedback_res [12] FEEDBACK VCO CAP [17] vco_cap - [13] OUTPUT VCO EXT CONT [16] vco_voltage - [14] Vcc +5V REG OUT [15] - - All resistor values in Ohms. - All capacitor values in Farads. - Use RES_K, RES_M and CAP_U, CAP_N, CAP_P macros to convert - magnitudes, eg. 220k = RES_K(220), 47nF = CAP_N(47) - - *****************************************************************************/ - -#define MAX_SN76477 4 - -/* Little helpers for magnitude conversions */ -#define RES_K(res) ((double)res*1e3) -#define RES_M(res) ((double)res*1e6) -#define CAP_U(cap) ((double)cap*1e-6) -#define CAP_N(cap) ((double)cap*1e-9) -#define CAP_P(cap) ((double)cap*1e-12) -#define TIME_IN_HZ(hz) (1.0 / (double)(hz)) - -/* Noise clock write, useful only if noise_res is zero */ -extern void SN76477_noise_clock_w(int chip, int data); - -/* Enable (one input line: 0 enabled, 1 inhibited) - resets one shot */ -extern void SN76477_enable_w(int chip, int data); - -/* Mixer select (three input lines, data 0 to 7) */ -extern void SN76477_mixer_w(int chip, int data); - -/* Alternatively write the single input lines */ -extern void SN76477_mixer_a_w(int chip, int data); -extern void SN76477_mixer_b_w(int chip, int data); -extern void SN76477_mixer_c_w(int chip, int data); - -/* Select envelope (two input lines, data 0 to 3) */ -extern void SN76477_envelope_w(int chip, int data); - -/* Alternatively use the single input lines */ -extern void SN76477_envelope_1_w(int chip, int data); -extern void SN76477_envelope_2_w(int chip, int data); - -/* VCO select (one input line: 0 external control, 1: SLF control) */ -extern void SN76477_vco_w(int chip, int data); - -void SN76477_set_noise_res(int chip, double res); -void SN76477_set_filter_res(int chip, double res); -void SN76477_set_filter_cap(int chip, double cap); -void SN76477_set_decay_res(int chip, double res); -void SN76477_set_attack_decay_cap(int chip, double cap); -void SN76477_set_attack_res(int chip, double res); -void SN76477_set_amplitude_res(int chip, double res); -void SN76477_set_feedback_res(int chip, double res); -void SN76477_set_slf_res(int chip, double res); -void SN76477_set_slf_cap(int chip, double cap); -void SN76477_set_oneshot_res(int chip, double res); -void SN76477_set_oneshot_cap(int chip, double cap); -void SN76477_set_vco_res(int chip, double res); -void SN76477_set_vco_cap(int chip, double cap); -void SN76477_set_pitch_voltage(int chip, double voltage); -void SN76477_set_vco_voltage(int chip, double voltage); -void SN76477_set_mastervol(int chip, double vol); -void SN76477_sound_update(int param, INT16 *buffer, int length); - -void SN76477_init(int num); -void SN76477_exit(int num); diff --git a/jan/src/burn/snd/sn76496.cpp b/jan/src/burn/snd/sn76496.cpp deleted file mode 100644 index cd42a8010..000000000 --- a/jan/src/burn/snd/sn76496.cpp +++ /dev/null @@ -1,680 +0,0 @@ -// Based on MAME driver by Nicola Salmoria - -#include "burnint.h" -#include "burn_sound.h" -#include "sn76496.h" - -#define MAX_SN76496_CHIPS 5 - -#define MAX_OUTPUT 0x7fff - -#define STEP 0x10000 - -struct SN76496 -{ - UINT32 UpdateStep; - INT32 VolTable[16]; /* volume table */ - INT32 Register[8]; /* registers */ - INT32 LastRegister; /* last register written */ - INT32 Volume[4]; /* volume of voice 0-2 and noise */ - INT32 RNG; /* noise generator */ - INT32 NoiseMode; /* active noise mode */ - INT32 FeedbackMask; /* mask for feedback */ - INT32 WhitenoiseTaps; /* mask for white noise taps */ - INT32 WhitenoiseInvert; /* white noise invert flag */ - INT32 Period[4]; - INT32 Count[4]; - INT32 Output[4]; - INT32 bSignalAdd; - double nVolume; - INT32 StereoMask; /* the stereo output mask */ - INT32 nOutputDir; -}; - -static INT32 NumChips = 0; -static struct SN76496 *Chip0 = NULL; -static struct SN76496 *Chip1 = NULL; -static struct SN76496 *Chip2 = NULL; -static struct SN76496 *Chip3 = NULL; -static struct SN76496 *Chip4 = NULL; - -void SN76496Update(INT32 Num, INT16* pSoundBuf, INT32 Length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SN76496Initted) bprintf(PRINT_ERROR, _T("SN76496Update called without init\n")); - if (Num > NumChips) bprintf(PRINT_ERROR, _T("SN76496Update called with invalid chip %x\n"), Num); -#endif - - INT32 i; - struct SN76496 *R = Chip0; - - if (Num >= MAX_SN76496_CHIPS) return; - - if (Num == 1) R = Chip1; - if (Num == 2) R = Chip2; - if (Num == 3) R = Chip3; - if (Num == 4) R = Chip4; - - /* If the volume is 0, increase the counter */ - for (i = 0;i < 4;i++) - { - if (R->Volume[i] == 0) - { - /* note that I do count += length, NOT count = length + 1. You might think */ - /* it's the same since the volume is 0, but doing the latter could cause */ - /* interferencies when the program is rapidly modulating the volume. */ - if (R->Count[i] <= Length*STEP) R->Count[i] += Length*STEP; - } - } - - while (Length > 0) - { - INT32 Vol[4]; - UINT32 Out, Out2 = 0; - INT32 Left; - - - /* vol[] keeps track of how long each square wave stays */ - /* in the 1 position during the sample period. */ - Vol[0] = Vol[1] = Vol[2] = Vol[3] = 0; - - for (i = 0;i < 3;i++) - { - if (R->Output[i]) Vol[i] += R->Count[i]; - R->Count[i] -= STEP; - /* Period[i] is the half period of the square wave. Here, in each */ - /* loop I add Period[i] twice, so that at the end of the loop the */ - /* square wave is in the same status (0 or 1) it was at the start. */ - /* vol[i] is also incremented by Period[i], since the wave has been 1 */ - /* exactly half of the time, regardless of the initial position. */ - /* If we exit the loop in the middle, Output[i] has to be inverted */ - /* and vol[i] incremented only if the exit status of the square */ - /* wave is 1. */ - while (R->Count[i] <= 0) - { - R->Count[i] += R->Period[i]; - if (R->Count[i] > 0) - { - R->Output[i] ^= 1; - if (R->Output[i]) Vol[i] += R->Period[i]; - break; - } - R->Count[i] += R->Period[i]; - Vol[i] += R->Period[i]; - } - if (R->Output[i]) Vol[i] -= R->Count[i]; - } - - Left = STEP; - do - { - INT32 NextEvent; - - - if (R->Count[3] < Left) NextEvent = R->Count[3]; - else NextEvent = Left; - - if (R->Output[3]) Vol[3] += R->Count[3]; - R->Count[3] -= NextEvent; - if (R->Count[3] <= 0) - { - if (R->NoiseMode == 1) /* White Noise Mode */ - { - if (((R->RNG & R->WhitenoiseTaps) != R->WhitenoiseTaps) && ((R->RNG & R->WhitenoiseTaps) != 0)) /* crappy xor! */ - { - R->RNG >>= 1; - R->RNG |= R->FeedbackMask; - } - else - { - R->RNG >>= 1; - } - R->Output[3] = R->WhitenoiseInvert ? !(R->RNG & 1) : R->RNG & 1; - } - else /* Periodic noise mode */ - { - if (R->RNG & 1) - { - R->RNG >>= 1; - R->RNG |= R->FeedbackMask; - } - else - { - R->RNG >>= 1; - } - R->Output[3] = R->RNG & 1; - } - R->Count[3] += R->Period[3]; - if (R->Output[3]) Vol[3] += R->Period[3]; - } - if (R->Output[3]) Vol[3] -= R->Count[3]; - - Left -= NextEvent; - } while (Left > 0); - - if (R->StereoMask != 0xFF) - { - Out = ((R->StereoMask&0x10) ? Vol[0] * R->Volume[0]:0) - + ((R->StereoMask&0x20) ? Vol[1] * R->Volume[1]:0) - + ((R->StereoMask&0x40) ? Vol[2] * R->Volume[2]:0) - + ((R->StereoMask&0x80) ? Vol[3] * R->Volume[3]:0); - - Out2 = ((R->StereoMask&0x1) ? Vol[0] * R->Volume[0]:0) - + ((R->StereoMask&0x2) ? Vol[1] * R->Volume[1]:0) - + ((R->StereoMask&0x4) ? Vol[2] * R->Volume[2]:0) - + ((R->StereoMask&0x8) ? Vol[3] * R->Volume[3]:0); - if (Out2 > MAX_OUTPUT * STEP) Out2 = MAX_OUTPUT * STEP; - - Out2 /= STEP; - } - else - { - Out = Vol[0] * R->Volume[0] + Vol[1] * R->Volume[1] + - Vol[2] * R->Volume[2] + Vol[3] * R->Volume[3]; - } - - if (Out > MAX_OUTPUT * STEP) Out = MAX_OUTPUT * STEP; - - Out /= STEP; - - INT32 nLeftSample = 0, nRightSample = 0; - if ((R->nOutputDir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)(Out * R->nVolume); - } - if ((R->nOutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - if (R->StereoMask != 0xFF) - nRightSample += (INT32)(Out2 * R->nVolume); - else - nRightSample += (INT32)(Out * R->nVolume); - } - - if (R->bSignalAdd) { - pSoundBuf[0] = BURN_SND_CLIP(pSoundBuf[0] + nLeftSample); - pSoundBuf[1] = BURN_SND_CLIP(pSoundBuf[1] + nRightSample); - } else { - pSoundBuf[0] = BURN_SND_CLIP(nLeftSample); - pSoundBuf[1] = BURN_SND_CLIP(nRightSample); - } - - pSoundBuf += 2; - Length--; - } -} - -void SN76496UpdateToBuffer(INT32 Num, INT16* pSoundBuf, INT32 Length) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SN76496Initted) bprintf(PRINT_ERROR, _T("SN76496Update called without init\n")); - if (Num > NumChips) bprintf(PRINT_ERROR, _T("SN76496Update called with invalid chip %x\n"), Num); -#endif - - INT32 i; - struct SN76496 *R = Chip0; - - if (Num >= MAX_SN76496_CHIPS) return; - - if (Num == 1) R = Chip1; - if (Num == 2) R = Chip2; - if (Num == 3) R = Chip3; - if (Num == 4) R = Chip4; - - /* If the volume is 0, increase the counter */ - for (i = 0;i < 4;i++) - { - if (R->Volume[i] == 0) - { - /* note that I do count += length, NOT count = length + 1. You might think */ - /* it's the same since the volume is 0, but doing the latter could cause */ - /* interferencies when the program is rapidly modulating the volume. */ - if (R->Count[i] <= Length*STEP) R->Count[i] += Length*STEP; - } - } - - while (Length > 0) - { - INT32 Vol[4]; - UINT32 Out; - INT32 Left; - - - /* vol[] keeps track of how long each square wave stays */ - /* in the 1 position during the sample period. */ - Vol[0] = Vol[1] = Vol[2] = Vol[3] = 0; - - for (i = 0;i < 3;i++) - { - if (R->Output[i]) Vol[i] += R->Count[i]; - R->Count[i] -= STEP; - /* Period[i] is the half period of the square wave. Here, in each */ - /* loop I add Period[i] twice, so that at the end of the loop the */ - /* square wave is in the same status (0 or 1) it was at the start. */ - /* vol[i] is also incremented by Period[i], since the wave has been 1 */ - /* exactly half of the time, regardless of the initial position. */ - /* If we exit the loop in the middle, Output[i] has to be inverted */ - /* and vol[i] incremented only if the exit status of the square */ - /* wave is 1. */ - while (R->Count[i] <= 0) - { - R->Count[i] += R->Period[i]; - if (R->Count[i] > 0) - { - R->Output[i] ^= 1; - if (R->Output[i]) Vol[i] += R->Period[i]; - break; - } - R->Count[i] += R->Period[i]; - Vol[i] += R->Period[i]; - } - if (R->Output[i]) Vol[i] -= R->Count[i]; - } - - Left = STEP; - do - { - INT32 NextEvent; - - - if (R->Count[3] < Left) NextEvent = R->Count[3]; - else NextEvent = Left; - - if (R->Output[3]) Vol[3] += R->Count[3]; - R->Count[3] -= NextEvent; - if (R->Count[3] <= 0) - { - if (R->NoiseMode == 1) /* White Noise Mode */ - { - if (((R->RNG & R->WhitenoiseTaps) != R->WhitenoiseTaps) && ((R->RNG & R->WhitenoiseTaps) != 0)) /* crappy xor! */ - { - R->RNG >>= 1; - R->RNG |= R->FeedbackMask; - } - else - { - R->RNG >>= 1; - } - R->Output[3] = R->WhitenoiseInvert ? !(R->RNG & 1) : R->RNG & 1; - } - else /* Periodic noise mode */ - { - if (R->RNG & 1) - { - R->RNG >>= 1; - R->RNG |= R->FeedbackMask; - } - else - { - R->RNG >>= 1; - } - R->Output[3] = R->RNG & 1; - } - R->Count[3] += R->Period[3]; - if (R->Output[3]) Vol[3] += R->Period[3]; - } - if (R->Output[3]) Vol[3] -= R->Count[3]; - - Left -= NextEvent; - } while (Left > 0); - - Out = Vol[0] * R->Volume[0] + Vol[1] * R->Volume[1] + - Vol[2] * R->Volume[2] + Vol[3] * R->Volume[3]; - - if (Out > MAX_OUTPUT * STEP) Out = MAX_OUTPUT * STEP; - - pSoundBuf[0] = BURN_SND_CLIP(((INT32)((Out / STEP) * R->nVolume))); - pSoundBuf++; - Length--; - } -} - -void SN76496StereoWrite(INT32 Num, INT32 Data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SN76496Initted) bprintf(PRINT_ERROR, _T("SN76496StereoWrite called without init\n")); - if (Num > NumChips) bprintf(PRINT_ERROR, _T("SN76496StereoWrite called with invalid chip %x\n"), Num); -#endif - - struct SN76496 *R = Chip0; - - if (Num >= MAX_SN76496_CHIPS) return; - - if (Num == 1) R = Chip1; - if (Num == 2) R = Chip2; - if (Num == 3) R = Chip3; - if (Num == 4) R = Chip4; - - R->StereoMask = Data; -} - -void SN76496Write(INT32 Num, INT32 Data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SN76496Initted) bprintf(PRINT_ERROR, _T("SN76496Write called without init\n")); - if (Num > NumChips) bprintf(PRINT_ERROR, _T("SN76496Write called with invalid chip %x\n"), Num); -#endif - - struct SN76496 *R = Chip0; - INT32 n, r, c; - - if (Num >= MAX_SN76496_CHIPS) return; - - if (Num == 1) R = Chip1; - if (Num == 2) R = Chip2; - if (Num == 3) R = Chip3; - if (Num == 4) R = Chip4; - - if (Data & 0x80) { - r = (Data & 0x70) >> 4; - R->LastRegister = r; - R->Register[r] = (R->Register[r] & 0x3f0) | (Data & 0x0f); - } else { - r = R->LastRegister; - } - - c = r / 2; - - switch (r) - { - case 0: /* tone 0 : frequency */ - case 2: /* tone 1 : frequency */ - case 4: /* tone 2 : frequency */ - if ((Data & 0x80) == 0) R->Register[r] = (R->Register[r] & 0x0f) | ((Data & 0x3f) << 4); - R->Period[c] = R->UpdateStep * R->Register[r]; - if (R->Period[c] == 0) R->Period[c] = R->UpdateStep; - if (r == 4) - { - /* update noise shift frequency */ - if ((R->Register[6] & 0x03) == 0x03) - R->Period[3] = 2 * R->Period[2]; - } - break; - case 1: /* tone 0 : volume */ - case 3: /* tone 1 : volume */ - case 5: /* tone 2 : volume */ - case 7: /* noise : volume */ - R->Volume[c] = R->VolTable[Data & 0x0f]; - if ((Data & 0x80) == 0) R->Register[r] = (R->Register[r] & 0x3f0) | (Data & 0x0f); - break; - case 6: /* noise : frequency, mode */ - { - if ((Data & 0x80) == 0) R->Register[r] = (R->Register[r] & 0x3f0) | (Data & 0x0f); - n = R->Register[6]; - R->NoiseMode = (n & 4) ? 1 : 0; - /* N/512,N/1024,N/2048,Tone #3 output */ - R->Period[3] = ((n&3) == 3) ? 2 * R->Period[2] : (R->UpdateStep << (5+(n&3))); - /* Reset noise shifter */ - R->RNG = R->FeedbackMask; /* this is correct according to the smspower document */ - //R->RNG = 0xF35; /* this is not, but sounds better in do run run */ - R->Output[3] = R->RNG & 1; - } - break; - } -} - -static void SN76496SetGain(struct SN76496 *R,INT32 Gain) -{ - INT32 i; - double Out; - - Gain &= 0xff; - - /* increase max output basing on gain (0.2 dB per step) */ - Out = MAX_OUTPUT / 3; - while (Gain-- > 0) - Out *= 1.023292992; /* = (10 ^ (0.2/20)) */ - - /* build volume table (2dB per step) */ - for (i = 0;i < 15;i++) - { - /* limit volume to avoid clipping */ - if (Out > MAX_OUTPUT / 3) R->VolTable[i] = MAX_OUTPUT / 3; - else R->VolTable[i] = (INT32)Out; - - Out /= 1.258925412; /* = 10 ^ (2/20) = 2dB */ - } - R->VolTable[15] = 0; -} - -void SN76496Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_SN76496Initted) bprintf(PRINT_ERROR, _T("SN76496Reset called without init\n")); -#endif - - struct SN76496 *R = Chip0; - INT32 i, Num; - - for (Num = 0; Num < NumChips; Num++) { - if (Num == 0) R = Chip0; - if (Num == 1) R = Chip1; - if (Num == 2) R = Chip2; - if (Num == 3) R = Chip3; - if (Num == 4) R = Chip4; - - for (i = 0; i < 4; i++) R->Volume[i] = 0; - - R->LastRegister = 0; - for (i = 0; i < 8; i += 2) { - R->Register[i + 0] = 0x00; - R->Register[i + 1] = 0x0f; - } - - for (i = 0; i < 4; i++) { - R->Output[i] = 0; - R->Period[i] = R->Count[i] = R->UpdateStep; - } - - R->FeedbackMask = 0x4000; - R->WhitenoiseTaps = 0x03; - R->WhitenoiseInvert = 1; - R->StereoMask = 0xFF; - - R->RNG = R->FeedbackMask; - R->Output[3] = R->RNG & 1; - } -} - -static void SN76496Init(struct SN76496 *R, INT32 Clock) -{ - R->UpdateStep = (UINT32)(((double)STEP * nBurnSoundRate * 16) / Clock); - - SN76496Reset(); -} - -static void GenericStart(INT32 Num, INT32 Clock, INT32 FeedbackMask, INT32 NoiseTaps, INT32 NoiseInvert, INT32 SignalAdd) -{ - DebugSnd_SN76496Initted = 1; - - if (Num >= MAX_SN76496_CHIPS) return; - - NumChips = Num + 1; - - if (Num == 0) { - Chip0 = (struct SN76496*)BurnMalloc(sizeof(*Chip0)); - memset(Chip0, 0, sizeof(*Chip0)); - - SN76496Init(Chip0, Clock); - SN76496SetGain(Chip0, 0); - - Chip0->FeedbackMask = FeedbackMask; - Chip0->WhitenoiseTaps = NoiseTaps; - Chip0->WhitenoiseInvert = NoiseInvert; - Chip0->bSignalAdd = SignalAdd; - Chip0->nVolume = 1.00; - Chip0->nOutputDir = BURN_SND_ROUTE_BOTH; - } - - if (Num == 1) { - Chip1 = (struct SN76496*)BurnMalloc(sizeof(*Chip1)); - memset(Chip1, 0, sizeof(*Chip1)); - - SN76496Init(Chip1, Clock); - SN76496SetGain(Chip1, 0); - - Chip1->FeedbackMask = FeedbackMask; - Chip1->WhitenoiseTaps = NoiseTaps; - Chip1->WhitenoiseInvert = NoiseInvert; - Chip1->bSignalAdd = SignalAdd; - Chip1->nVolume = 1.00; - Chip1->nOutputDir = BURN_SND_ROUTE_BOTH; - } - - if (Num == 2) { - Chip2 = (struct SN76496*)BurnMalloc(sizeof(*Chip2)); - memset(Chip2, 0, sizeof(*Chip2)); - - SN76496Init(Chip2, Clock); - SN76496SetGain(Chip2, 0); - - Chip2->FeedbackMask = FeedbackMask; - Chip2->WhitenoiseTaps = NoiseTaps; - Chip2->WhitenoiseInvert = NoiseInvert; - Chip2->bSignalAdd = SignalAdd; - Chip2->nVolume = 1.00; - Chip2->nOutputDir = BURN_SND_ROUTE_BOTH; - } - - if (Num == 3) { - Chip3 = (struct SN76496*)BurnMalloc(sizeof(*Chip3)); - memset(Chip3, 0, sizeof(*Chip3)); - - SN76496Init(Chip3, Clock); - SN76496SetGain(Chip3, 0); - - Chip3->FeedbackMask = FeedbackMask; - Chip3->WhitenoiseTaps = NoiseTaps; - Chip3->WhitenoiseInvert = NoiseInvert; - Chip3->bSignalAdd = SignalAdd; - Chip3->nVolume = 1.00; - Chip3->nOutputDir = BURN_SND_ROUTE_BOTH; - } - - if (Num == 4) { - Chip4 = (struct SN76496*)BurnMalloc(sizeof(*Chip4)); - memset(Chip4, 0, sizeof(*Chip4)); - - SN76496Init(Chip4, Clock); - SN76496SetGain(Chip4, 0); - - Chip4->FeedbackMask = FeedbackMask; - Chip4->WhitenoiseTaps = NoiseTaps; - Chip4->WhitenoiseInvert = NoiseInvert; - Chip4->bSignalAdd = SignalAdd; - Chip4->nVolume = 1.00; - Chip4->nOutputDir = BURN_SND_ROUTE_BOTH; - } -} - -void SN76489Init(INT32 Num, INT32 Clock, INT32 SignalAdd) -{ - return GenericStart(Num, Clock, 0x4000, 0x03, 1, SignalAdd); -} - -void SN76489AInit(INT32 Num, INT32 Clock, INT32 SignalAdd) -{ - return GenericStart(Num, Clock, 0x8000, 0x06, 0, SignalAdd); -} - -void SN76494Init(INT32 Num, INT32 Clock, INT32 SignalAdd) -{ - return GenericStart(Num, Clock, 0x8000, 0x06, 0, SignalAdd); -} - -void SN76496Init(INT32 Num, INT32 Clock, INT32 SignalAdd) -{ - return GenericStart(Num, Clock, 0x8000, 0x06, 0, SignalAdd); -} - -void SN76496SetRoute(INT32 Num, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SN76496Initted) bprintf(PRINT_ERROR, _T("SN76496SetRoute called without init\n")); - if (Num > NumChips) bprintf(PRINT_ERROR, _T("SN76496SetRoute called with invalid chip %i\n"), Num); -#endif - - struct SN76496 *R = Chip0; - if (Num >= MAX_SN76496_CHIPS) return; - if (Num == 1) R = Chip1; - if (Num == 2) R = Chip2; - if (Num == 3) R = Chip3; - if (Num == 4) R = Chip4; - - R->nVolume = nVolume; - R->nOutputDir = nRouteDir; -} - -void SN76496Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_SN76496Initted) bprintf(PRINT_ERROR, _T("SN76496Exit called without init\n")); -#endif - - NumChips = 0; - - if (Chip0) BurnFree(Chip0); - if (Chip1) BurnFree(Chip1); - if (Chip2) BurnFree(Chip2); - if (Chip3) BurnFree(Chip3); - if (Chip4) BurnFree(Chip4); - Chip0 = NULL; - Chip1 = NULL; - Chip2 = NULL; - Chip3 = NULL; - Chip4 = NULL; - - DebugSnd_SN76496Initted = 0; -} - -INT32 SN76496Scan(INT32 nAction,INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_SN76496Initted) bprintf(PRINT_ERROR, _T("SN76496Scan called without init\n")); -#endif - - char szName[16]; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i < NumChips; i++) { - SN76496 *Chip = Chip0; - if (i == 1) Chip = Chip1; - if (i == 2) Chip = Chip2; - if (i == 3) Chip = Chip3; - if (i == 4) Chip = Chip4; - - memset(szName, 0, 16); - sprintf(szName, "Chip%iVolTable", i); - ScanVar(Chip->VolTable, 16 * sizeof(INT32), szName); - memset(szName, 0, 16); - sprintf(szName, "Chip%iRegisters", i); - ScanVar(Chip->Register, 8 * sizeof(INT32), szName); - memset(szName, 0, 16); - sprintf(szName, "Chip%iVolume", i); - ScanVar(Chip->Volume, 4 * sizeof(INT32), szName); - memset(szName, 0, 16); - sprintf(szName, "Chip%iPeriod", i); - ScanVar(Chip->Period, 4 * sizeof(INT32), szName); - memset(szName, 0, 16); - sprintf(szName, "Chip%iCount", i); - ScanVar(Chip->Count, 4 * sizeof(INT32), szName); - memset(szName, 0, 16); - sprintf(szName, "Chip%iOutput", i); - ScanVar(Chip->Output, 4 * sizeof(INT32), szName); - - SCAN_VAR(Chip->LastRegister); - SCAN_VAR(Chip->RNG); - SCAN_VAR(Chip->NoiseMode); - SCAN_VAR(Chip->FeedbackMask); - SCAN_VAR(Chip->WhitenoiseTaps); - SCAN_VAR(Chip->WhitenoiseInvert); - } - } - - return 0; -} - -#undef MAX_SN76496_CHIPS -#undef MAX_OUTPUT -#undef STEP diff --git a/jan/src/burn/snd/sn76496.h b/jan/src/burn/snd/sn76496.h deleted file mode 100644 index d8d5db501..000000000 --- a/jan/src/burn/snd/sn76496.h +++ /dev/null @@ -1,12 +0,0 @@ -void SN76496Update(INT32 Num, INT16* pSoundBuf, INT32 Length); -void SN76496UpdateToBuffer(INT32 Num, INT16* pSoundBuf, INT32 Length); // output mono -void SN76496Write(INT32 Num, INT32 Data); -void SN76496StereoWrite(INT32 Num, INT32 Data); -void SN76489Init(INT32 Num, INT32 Clock, INT32 SignalAdd); -void SN76489AInit(INT32 Num, INT32 Clock, INT32 SignalAdd); -void SN76494Init(INT32 Num, INT32 Clock, INT32 SignalAdd); -void SN76496Init(INT32 Num, INT32 Clock, INT32 SignalAdd); -void SN76496SetRoute(INT32 Num, double nVolume, INT32 nRouteDir); -void SN76496Reset(); -void SN76496Exit(); -INT32 SN76496Scan(INT32 nAction,INT32 *pnMin); diff --git a/jan/src/burn/snd/tms36xx.cpp b/jan/src/burn/snd/tms36xx.cpp deleted file mode 100644 index 0f081a56e..000000000 --- a/jan/src/burn/snd/tms36xx.cpp +++ /dev/null @@ -1,490 +0,0 @@ -// Based on MAME source by Juergen Buchmueller - -#include "burnint.h" -#include "tms36xx.h" - -#define VERBOSE 0 - -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif - -#define VMIN 0x0000 -#define VMAX 0x7fff - -/* the frequencies are later adjusted by "* clock / FSCALE" */ -#define FSCALE 1024 - -struct TMS36XX { - int samplerate; /* from Machine->sample_rate */ - - int basefreq; /* chip's base frequency */ - int octave; /* octave select of the TMS3615 */ - - int speed; /* speed of the tune */ - int tune_counter; /* tune counter */ - int note_counter; /* note counter */ - - int voices; /* active voices */ - int shift; /* shift toggles between 0 and 6 to allow decaying voices */ - int vol[12]; /* (decaying) volume of harmonics notes */ - int vol_counter[12];/* volume adjustment counter */ - int decay[12]; /* volume adjustment rate - dervied from decay */ - - int counter[12]; /* tone frequency counter */ - int frequency[12]; /* tone frequency */ - int output; /* output signal bits */ - int enable; /* mask which harmoics */ - - int tune_num; /* tune currently playing */ - int tune_ofs; /* note currently playing */ - int tune_max; /* end of tune */ -}; - -struct TMS36XX *tms = NULL; - -#define C(n) (int)((FSCALE<<(n-1))*1.18921) /* 2^(3/12) */ -#define Cx(n) (int)((FSCALE<<(n-1))*1.25992) /* 2^(4/12) */ -#define D(n) (int)((FSCALE<<(n-1))*1.33484) /* 2^(5/12) */ -#define Dx(n) (int)((FSCALE<<(n-1))*1.41421) /* 2^(6/12) */ -#define E(n) (int)((FSCALE<<(n-1))*1.49831) /* 2^(7/12) */ -#define F(n) (int)((FSCALE<<(n-1))*1.58740) /* 2^(8/12) */ -#define Fx(n) (int)((FSCALE<<(n-1))*1.68179) /* 2^(9/12) */ -#define G(n) (int)((FSCALE<<(n-1))*1.78180) /* 2^(10/12) */ -#define Gx(n) (int)((FSCALE<<(n-1))*1.88775) /* 2^(11/12) */ -#define A(n) (int)((FSCALE<vol[voice] > VMIN ) \ - { \ - /* decay of first voice */ \ - tms->vol_counter[voice] -= tms->decay[voice]; \ - while( tms->vol_counter[voice] <= 0 ) \ - { \ - tms->vol_counter[voice] += samplerate; \ - if( tms->vol[voice]-- <= VMIN ) \ - { \ - tms->frequency[voice] = 0; \ - tms->vol[voice] = VMIN; \ - break; \ - } \ - } \ - } - -#define RESTART(voice) \ - if( tunes[tms->tune_num][tms->tune_ofs*6+voice] ) \ - { \ - tms->frequency[tms->shift+voice] = \ - tunes[tms->tune_num][tms->tune_ofs*6+voice] * \ - (tms->basefreq << tms->octave) / FSCALE; \ - tms->vol[tms->shift+voice] = VMAX; \ - } - -#define TONE(voice) \ - if( (tms->enable & (1<frequency[voice] ) \ - { \ - /* first note */ \ - tms->counter[voice] -= tms->frequency[voice]; \ - while( tms->counter[voice] <= 0 ) \ - { \ - tms->counter[voice] += samplerate; \ - tms->output ^= 1 << voice; \ - } \ - if (tms->output & tms->enable & (1 << voice)) \ - sum += tms->vol[voice]; \ - } - - - -void tms36xx_sound_update(INT16 *buffer, INT32 length) -{ - int samplerate = tms->samplerate; - - /* no tune played? */ - if( !tunes[tms->tune_num] || tms->voices == 0 ) { - return; - } - - while( length-- > 0 ) - { - int sum = 0; - - /* decay the twelve voices */ - DECAY( 0) DECAY( 1) DECAY( 2) DECAY( 3) DECAY( 4) DECAY( 5) - DECAY( 6) DECAY( 7) DECAY( 8) DECAY( 9) DECAY(10) DECAY(11) - - /* musical note timing */ - tms->tune_counter -= tms->speed; - if( tms->tune_counter <= 0 ) - { - int n = (-tms->tune_counter / samplerate) + 1; - tms->tune_counter += n * samplerate; - - if( (tms->note_counter -= n) <= 0 ) - { - tms->note_counter += VMAX; - if (tms->tune_ofs < tms->tune_max) - { - /* shift to the other 'bank' of voices */ - tms->shift ^= 6; - /* restart one 'bank' of voices */ - RESTART(0) RESTART(1) RESTART(2) - RESTART(3) RESTART(4) RESTART(5) - tms->tune_ofs++; - } - } - } - - /* update the twelve voices */ - TONE( 0) TONE( 1) TONE( 2) TONE( 3) TONE( 4) TONE( 5) - TONE( 6) TONE( 7) TONE( 8) TONE( 9) TONE(10) TONE(11) - - INT16 sam = (sum / tms->voices) * 0.60; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - *buffer = BURN_SND_CLIP(*buffer + sam); - buffer++; - } -} - -static void tms36xx_reset_counters() -{ - tms->tune_counter = 0; - tms->note_counter = 0; - memset(tms->vol_counter, 0, sizeof(tms->vol_counter)); - memset(tms->counter, 0, sizeof(tms->counter)); -} - -void tms36xx_reset() -{ - tms36xx_reset_counters(); - tms->tune_num = 0; -} - -void mm6221aa_tune_w(int tune) -{ - /* which tune? */ - tune &= 3; - if( tune == tms->tune_num ) - return; - - //bprintf(0, _T("tune: %X\n"), tune); - - tms->tune_num = tune; - tms->tune_ofs = 0; - tms->tune_max = 96; /* fixed for now */ -} - -void tms36xx_note_w(int octave, int note) -{ - octave &= 3; - note &= 15; - - if (note > 12) - return; - - //LOG(("%s octave:%X note:%X\n", tms->subtype, octave, note)); - - /* play a single note from 'tune 4', a list of the 13 tones */ - tms36xx_reset_counters(); - tms->octave = octave; - tms->tune_num = 4; - tms->tune_ofs = note; - tms->tune_max = note + 1; -} - -void tms3617_enable(int enable) -{ - int bits = 0; - - /* duplicate the 6 voice enable bits */ - enable = (enable & 0x3f) | ((enable & 0x3f) << 6); - if (enable == tms->enable) - return; - - for (int i = 0; i < 6; i++) { - if (enable & (1 << i)) - bits += 2; /* each voice has two instances */ - } - - /* set the enable mask and number of active voices */ - tms->enable = enable; - tms->voices = bits; -} - -void tms36xx_init(int clock, int subtype, double *decay, double speed) -{ - int enable; - - tms = (TMS36XX *)BurnMalloc(sizeof(TMS36XX)); - memset(tms, 0, sizeof(*tms)); - - tms->samplerate = nBurnSoundRate; - tms->basefreq = clock; - enable = 0; - - for (int j = 0; j < 6; j++) - { - if( decay[j] > 0 ) - { - tms->decay[j+0] = tms->decay[j+6] = VMAX / decay[j]; - enable |= 0x41 << j; - } - } - - tms->speed = (speed > 0) ? VMAX / speed : VMAX; - tms3617_enable(enable); -} - -void tms36xx_deinit() -{ - BurnFree(tms); -} - diff --git a/jan/src/burn/snd/tms36xx.h b/jan/src/burn/snd/tms36xx.h deleted file mode 100644 index 0560c896c..000000000 --- a/jan/src/burn/snd/tms36xx.h +++ /dev/null @@ -1,28 +0,0 @@ -/* subtypes */ -#define MM6221AA 21 /* Phoenix (fixed melodies) */ -#define TMS3615 15 /* Naughty Boy, Pleiads (13 notes, one output) */ -#define TMS3617 17 /* Monster Bash (13 notes, six outputs) */ - -#if 0 -/* The interface structure */ -struct TMS36XXinterface { - int subtype; - double decay[6]; /* decay times for the six harmonic notes */ - double speed; /* tune speed (meaningful for the TMS3615 only) */ -}; -#endif - -/* MM6221AA interface functions */ -void mm6221aa_tune_w(int tune); - -/* TMS3615/17 interface functions */ -void tms36xx_note_w(int octave, int note); - -/* TMS3617 interface functions */ -void tms3617_enable(int enable); - -//void tms36xx_init(int clock, int subtype, double decay[6], double speed); -void tms36xx_init(int clock, int subtype, double *decay, double speed); -void tms36xx_deinit(); -void tms36xx_reset(); -void tms36xx_sound_update(INT16 *buffer, INT32 length); diff --git a/jan/src/burn/snd/upd7759.cpp b/jan/src/burn/snd/upd7759.cpp deleted file mode 100644 index 63bfeec00..000000000 --- a/jan/src/burn/snd/upd7759.cpp +++ /dev/null @@ -1,592 +0,0 @@ -// Based on MAME driver by Juergen Buchmueller, Mike Balfour, Howie Cohen, Olivier Galibert, Aaron Giles - -#include "burnint.h" -#include "burn_sound.h" -#include "upd7759.h" - -#define FRAC_BITS 20 -#define FRAC_ONE (1 << FRAC_BITS) -#define FRAC_MASK (FRAC_ONE - 1) - -static INT32 SlaveMode; - -/* chip states */ -enum -{ - STATE_IDLE, - STATE_DROP_DRQ, - STATE_START, - STATE_FIRST_REQ, - STATE_LAST_SAMPLE, - STATE_DUMMY1, - STATE_ADDR_MSB, - STATE_ADDR_LSB, - STATE_DUMMY2, - STATE_BLOCK_HEADER, - STATE_NIBBLE_COUNT, - STATE_NIBBLE_MSN, - STATE_NIBBLE_LSN -}; - -struct upd7759_chip -{ - /* internal clock to output sample rate mapping */ - UINT32 pos; /* current output sample position */ - UINT32 step; /* step value per output sample */ - - /* I/O lines */ - UINT8 fifo_in; /* last data written to the sound chip */ - UINT8 reset; /* current state of the RESET line */ - UINT8 start; /* current state of the START line */ - UINT8 drq; /* current state of the DRQ line */ - void (*drqcallback)(INT32 param); /* drq callback */ - - /* internal state machine */ - INT8 state; /* current overall chip state */ - INT32 clocks_left; /* number of clocks left in this state */ - UINT16 nibbles_left; /* number of ADPCM nibbles left to process */ - UINT8 repeat_count; /* number of repeats remaining in current repeat block */ - INT8 post_drq_state; /* state we will be in after the DRQ line is dropped */ - INT32 post_drq_clocks; /* clocks that will be left after the DRQ line is dropped */ - UINT8 req_sample; /* requested sample number */ - UINT8 last_sample; /* last sample number available */ - UINT8 block_header; /* header byte */ - UINT8 sample_rate; /* number of UPD clocks per ADPCM nibble */ - UINT8 first_valid_header; /* did we get our first valid header yet? */ - UINT32 offset; /* current ROM offset */ - UINT32 repeat_offset; /* current ROM repeat offset */ - - /* ADPCM processing */ - INT8 adpcm_state; /* ADPCM state index */ - UINT8 adpcm_data; /* current byte of ADPCM data */ - INT16 sample; /* current sample value */ - - /* ROM access */ - UINT8 * rom; /* pointer to ROM data or NULL for slave mode */ - UINT8 * rombase; /* pointer to ROM data or NULL for slave mode */ - UINT32 romoffset; /* ROM offset to make save/restore easier */ - - /* route */ - double volume; - INT32 output_dir; -}; - -static struct upd7759_chip *Chips[2] = { NULL, NULL }; // more? -static struct upd7759_chip *Chip = NULL; - -static INT32 nNumChips = 0; - -static const INT32 upd7759_step[16][16] = -{ - { 0, 0, 1, 2, 3, 5, 7, 10, 0, 0, -1, -2, -3, -5, -7, -10 }, - { 0, 1, 2, 3, 4, 6, 8, 13, 0, -1, -2, -3, -4, -6, -8, -13 }, - { 0, 1, 2, 4, 5, 7, 10, 15, 0, -1, -2, -4, -5, -7, -10, -15 }, - { 0, 1, 3, 4, 6, 9, 13, 19, 0, -1, -3, -4, -6, -9, -13, -19 }, - { 0, 2, 3, 5, 8, 11, 15, 23, 0, -2, -3, -5, -8, -11, -15, -23 }, - { 0, 2, 4, 7, 10, 14, 19, 29, 0, -2, -4, -7, -10, -14, -19, -29 }, - { 0, 3, 5, 8, 12, 16, 22, 33, 0, -3, -5, -8, -12, -16, -22, -33 }, - { 1, 4, 7, 10, 15, 20, 29, 43, -1, -4, -7, -10, -15, -20, -29, -43 }, - { 1, 4, 8, 13, 18, 25, 35, 53, -1, -4, -8, -13, -18, -25, -35, -53 }, - { 1, 6, 10, 16, 22, 31, 43, 64, -1, -6, -10, -16, -22, -31, -43, -64 }, - { 2, 7, 12, 19, 27, 37, 51, 76, -2, -7, -12, -19, -27, -37, -51, -76 }, - { 2, 9, 16, 24, 34, 46, 64, 96, -2, -9, -16, -24, -34, -46, -64, -96 }, - { 3, 11, 19, 29, 41, 57, 79, 117, -3, -11, -19, -29, -41, -57, -79, -117 }, - { 4, 13, 24, 36, 50, 69, 96, 143, -4, -13, -24, -36, -50, -69, -96, -143 }, - { 4, 16, 29, 44, 62, 85, 118, 175, -4, -16, -29, -44, -62, -85, -118, -175 }, - { 6, 20, 36, 54, 76, 104, 144, 214, -6, -20, -36, -54, -76, -104, -144, -214 }, -}; - -static const INT32 upd7759_state[16] = { -1, -1, 0, 0, 1, 2, 2, 3, -1, -1, 0, 0, 1, 2, 2, 3 }; - -inline static void UpdateAdpcm(INT32 Data) -{ - Chip->sample += upd7759_step[Chip->adpcm_state][Data]; - Chip->adpcm_state += upd7759_state[Data]; - - /* clamp the state to 0..15 */ - if (Chip->adpcm_state < 0) - Chip->adpcm_state = 0; - else if (Chip->adpcm_state > 15) - Chip->adpcm_state = 15; -} - -static void UPD7759AdvanceState() -{ - switch (Chip->state) - { - /* Idle state: we stick around here while there's nothing to do */ - case STATE_IDLE: - Chip->clocks_left = 4; - break; - - /* drop DRQ state: update to the intended state */ - case STATE_DROP_DRQ: - Chip->drq = 0; - - Chip->clocks_left = Chip->post_drq_clocks; - Chip->state = Chip->post_drq_state; - break; - - /* Start state: we begin here as soon as a sample is triggered */ - case STATE_START: - Chip->req_sample = Chip->rom ? Chip->fifo_in : 0x10; - - /* 35+ cycles after we get here, the /DRQ goes low - * (first byte (number of samples in ROM) should be sent in response) - * - * (35 is the minimum number of cycles I found during heavy tests. - * Depending on the state the chip was in just before the /MD was set to 0 (reset, standby - * or just-finished-playing-previous-sample) this number can range from 35 up to ~24000). - * It also varies slightly from test to test, but not much - a few cycles at most.) */ - Chip->clocks_left = 70; /* 35 - breaks cotton */ - Chip->state = STATE_FIRST_REQ; - break; - - /* First request state: issue a request for the first byte */ - /* The expected response will be the index of the last sample */ - case STATE_FIRST_REQ: - Chip->drq = 1; - - /* 44 cycles later, we will latch this value and request another byte */ - Chip->clocks_left = 44; - Chip->state = STATE_LAST_SAMPLE; - break; - - /* Last sample state: latch the last sample value and issue a request for the second byte */ - /* The second byte read will be just a dummy */ - case STATE_LAST_SAMPLE: - Chip->last_sample = Chip->rom ? Chip->rom[0] : Chip->fifo_in; - Chip->drq = 1; - - /* 28 cycles later, we will latch this value and request another byte */ - Chip->clocks_left = 28; /* 28 - breaks cotton */ - Chip->state = (Chip->req_sample > Chip->last_sample) ? STATE_IDLE : STATE_DUMMY1; - break; - - /* First dummy state: ignore any data here and issue a request for the third byte */ - /* The expected response will be the MSB of the sample address */ - case STATE_DUMMY1: - Chip->drq = 1; - - /* 32 cycles later, we will latch this value and request another byte */ - Chip->clocks_left = 32; - Chip->state = STATE_ADDR_MSB; - break; - - /* Address MSB state: latch the MSB of the sample address and issue a request for the fourth byte */ - /* The expected response will be the LSB of the sample address */ - case STATE_ADDR_MSB: - Chip->offset = (Chip->rom ? Chip->rom[Chip->req_sample * 2 + 5] : Chip->fifo_in) << 9; - Chip->drq = 1; - - /* 44 cycles later, we will latch this value and request another byte */ - Chip->clocks_left = 44; - Chip->state = STATE_ADDR_LSB; - break; - - /* Address LSB state: latch the LSB of the sample address and issue a request for the fifth byte */ - /* The expected response will be just a dummy */ - case STATE_ADDR_LSB: - Chip->offset |= (Chip->rom ? Chip->rom[Chip->req_sample * 2 + 6] : Chip->fifo_in) << 1; - Chip->drq = 1; - - /* 36 cycles later, we will latch this value and request another byte */ - Chip->clocks_left = 36; - Chip->state = STATE_DUMMY2; - break; - - /* Second dummy state: ignore any data here and issue a request for the the sixth byte */ - /* The expected response will be the first block header */ - case STATE_DUMMY2: - Chip->offset++; - Chip->first_valid_header = 0; - Chip->drq = 1; - - /* 36?? cycles later, we will latch this value and request another byte */ - Chip->clocks_left = 36; - Chip->state = STATE_BLOCK_HEADER; - break; - - /* Block header state: latch the header and issue a request for the first byte afterwards */ - case STATE_BLOCK_HEADER: - - /* if we're in a repeat loop, reset the offset to the repeat point and decrement the count */ - if (Chip->repeat_count) - { - Chip->repeat_count--; - Chip->offset = Chip->repeat_offset; - } - Chip->block_header = Chip->rom ? Chip->rom[Chip->offset++ & 0x1ffff] : Chip->fifo_in; - Chip->drq = 1; - - /* our next step depends on the top two bits */ - switch (Chip->block_header & 0xc0) - { - case 0x00: /* silence */ - Chip->clocks_left = 1024 * ((Chip->block_header & 0x3f) + 1); - Chip->state = (Chip->block_header == 0 && Chip->first_valid_header) ? STATE_IDLE : STATE_BLOCK_HEADER; - Chip->sample = 0; - Chip->adpcm_state = 0; - break; - - case 0x40: /* 256 nibbles */ - Chip->sample_rate = (Chip->block_header & 0x3f) + 1; - Chip->nibbles_left = 256; - Chip->clocks_left = 36; /* just a guess */ - Chip->state = STATE_NIBBLE_MSN; - break; - - case 0x80: /* n nibbles */ - Chip->sample_rate = (Chip->block_header & 0x3f) + 1; - Chip->clocks_left = 36; /* just a guess */ - Chip->state = STATE_NIBBLE_COUNT; - break; - - case 0xc0: /* repeat loop */ - Chip->repeat_count = (Chip->block_header & 7) + 1; - Chip->repeat_offset = Chip->offset; - Chip->clocks_left = 36; /* just a guess */ - Chip->state = STATE_BLOCK_HEADER; - break; - } - - /* set a flag when we get the first non-zero header */ - if (Chip->block_header != 0) - Chip->first_valid_header = 1; - break; - - /* Nibble count state: latch the number of nibbles to play and request another byte */ - /* The expected response will be the first data byte */ - case STATE_NIBBLE_COUNT: - Chip->nibbles_left = (Chip->rom ? Chip->rom[Chip->offset++ & 0x1ffff] : Chip->fifo_in) + 1; - Chip->drq = 1; - - /* 36?? cycles later, we will latch this value and request another byte */ - Chip->clocks_left = 36; /* just a guess */ - Chip->state = STATE_NIBBLE_MSN; - break; - - /* MSN state: latch the data for this pair of samples and request another byte */ - /* The expected response will be the next sample data or another header */ - case STATE_NIBBLE_MSN: - Chip->adpcm_data = Chip->rom ? Chip->rom[Chip->offset++ & 0x1ffff] : Chip->fifo_in; - UpdateAdpcm(Chip->adpcm_data >> 4); - Chip->drq = 1; - - /* we stay in this state until the time for this sample is complete */ - Chip->clocks_left = Chip->sample_rate * 4; - if (--Chip->nibbles_left == 0) - Chip->state = STATE_BLOCK_HEADER; - else - Chip->state = STATE_NIBBLE_LSN; - break; - - /* LSN state: process the lower nibble */ - case STATE_NIBBLE_LSN: - UpdateAdpcm(Chip->adpcm_data & 15); - - /* we stay in this state until the time for this sample is complete */ - Chip->clocks_left = Chip->sample_rate * 4; - if (--Chip->nibbles_left == 0) - Chip->state = STATE_BLOCK_HEADER; - else - Chip->state = STATE_NIBBLE_MSN; - break; - } - - /* if there's a DRQ, fudge the state */ - if (Chip->drq) - { - Chip->post_drq_state = Chip->state; - Chip->post_drq_clocks = Chip->clocks_left - 21; - Chip->state = STATE_DROP_DRQ; - Chip->clocks_left = 21; - } -} - -static void UPD7759SlaveModeUpdate() -{ - UINT8 OldDrq = Chip->drq; - - UPD7759AdvanceState(); - - if (OldDrq != Chip->drq && Chip->drqcallback) { - (*Chip->drqcallback)(Chip->drq); - } -} - -void UPD7759Update(INT32 chip, INT16 *pSoundBuf, INT32 nLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759Update called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("UPD7759Update called with invalid chip %x\n"), chip); -#endif - - Chip = Chips[chip]; - - INT32 ClocksLeft = Chip->clocks_left; - INT16 Sample = Chip->sample; - UINT32 Step = Chip->step; - UINT32 Pos = Chip->pos; - - /* loop until done */ - if (Chip->state != STATE_IDLE) - while (nLength != 0) - { - /* store the current sample */ - INT32 nLeftSample = 0; - INT32 nRightSample = 0; - - if ((Chip->output_dir & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((Sample << 7) * Chip->volume); - } - if ((Chip->output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((Sample << 7) * Chip->volume); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - pSoundBuf[0] = BURN_SND_CLIP(pSoundBuf[0] + nLeftSample); - pSoundBuf[1] = BURN_SND_CLIP(pSoundBuf[1] + nRightSample); - pSoundBuf += 2; - nLength--; - - /* advance by the number of clocks/output sample */ - Pos += Step; - - /* handle clocks, but only in standalone mode */ - while (Chip->rom && Pos >= FRAC_ONE) - { - INT32 ClocksThisTime = Pos >> FRAC_BITS; - if (ClocksThisTime > ClocksLeft) - ClocksThisTime = ClocksLeft; - - /* clock once */ - Pos -= ClocksThisTime * FRAC_ONE; - ClocksLeft -= ClocksThisTime; - - /* if we're out of clocks, time to handle the next state */ - if (ClocksLeft == 0) - { - /* advance one state; if we hit idle, bail */ - UPD7759AdvanceState(); - if (Chip->state == STATE_IDLE) - break; - - /* reimport the variables that we cached */ - ClocksLeft = Chip->clocks_left; - Sample = Chip->sample; - } - } - } - - if (SlaveMode && ClocksLeft > 0) UPD7759SlaveModeUpdate(); - - Chip->clocks_left = ClocksLeft; - Chip->pos = Pos; -} - -void UPD7759Reset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759Reset called without init\n")); -#endif - - for (INT32 i = 0; i < 2; i++) { - Chip = Chips[i]; - if (Chip == NULL) { - continue; - } - - Chip->pos = 0; - Chip->fifo_in = 0; - Chip->drq = 0; - Chip->state = STATE_IDLE; - Chip->clocks_left = 0; - Chip->nibbles_left = 0; - Chip->repeat_count = 0; - Chip->post_drq_state = STATE_IDLE; - Chip->post_drq_clocks = 0; - Chip->req_sample = 0; - Chip->last_sample = 0; - Chip->block_header = 0; - Chip->sample_rate = 0; - Chip->first_valid_header = 0; - Chip->offset = 0; - Chip->repeat_offset = 0; - Chip->adpcm_state = 0; - Chip->adpcm_data = 0; - Chip->sample = 0; - } -} - -void UPD7759Init(INT32 chip, INT32 clock, UINT8* pSoundData) -{ - DebugSnd_UPD7759Initted = 1; - - Chips[chip] = (struct upd7759_chip*)BurnMalloc(sizeof(*Chip)); - Chip = Chips[chip]; - - memset(Chip, 0, sizeof(*Chip)); - - SlaveMode = 0; - - float Rate = (float)clock / 4 / nBurnSoundRate; - Chip->step = (INT32)(4 * FRAC_ONE * Rate); - Chip->state = STATE_IDLE; - - if (pSoundData) { - Chip->rom = pSoundData; - } else { - SlaveMode = 1; - } - - Chip->reset = 1; - Chip->start = 1; - Chip->volume = 1.00; - Chip->output_dir = BURN_SND_ROUTE_BOTH; - - nNumChips = chip; - - UPD7759Reset(); -} - -void UPD7759SetRoute(INT32 chip, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759SetRoute called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("UPD7759SetRoute called with invalid chip %i\n"), chip); -#endif - - Chip = Chips[chip]; - Chip->volume = nVolume; - Chip->output_dir = nRouteDir; -} - -void UPD7759SetDrqCallback(INT32 chip, drqcallback Callback) -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759SetDrqCallback called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("UPD7759SetDrqCallback called with invalid chip %x\n"), chip); -#endif - - Chip = Chips[chip]; - Chip->drqcallback = Callback; -} - -INT32 UPD7759BusyRead(INT32 chip) -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759BusyRead called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("UPD7759BusyRead called with invalid chip %x\n"), chip); -#endif - - Chip = Chips[chip]; - return (Chip->state == STATE_IDLE); -} - -void UPD7759ResetWrite(INT32 chip, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759ResetWrite called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("UPD7759ResetWrite called with invalid chip %x\n"), chip); -#endif - - Chip = Chips[chip]; - UINT8 Oldreset = Chip->reset; - Chip->reset = (Data != 0); - - if (Oldreset && !Chip->reset) { - UPD7759Reset(); - } -} - -void UPD7759StartWrite(INT32 chip, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759StartWrite called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("UPD7759StartWrite called with invalid chip %x\n"), chip); -#endif - - Chip = Chips[chip]; - UINT8 Oldstart = Chip->start; - Chip->start = (Data != 0); - - if (Chip->state == STATE_IDLE && !Oldstart && Chip->start && Chip->reset) { - Chip->state = STATE_START; - - if (SlaveMode) UPD7759SlaveModeUpdate(); - } -} - -void UPD7759PortWrite(INT32 chip, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759PortWrite called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("UPD7759PortWrite called with invalid chip %x\n"), chip); -#endif - - Chip = Chips[chip]; - Chip->fifo_in = Data; -} - -INT32 UPD7759Scan(INT32 chip, INT32 nAction,INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759Scan called without init\n")); - if (chip > nNumChips) bprintf(PRINT_ERROR, _T("UPD7759Scan called with invalid chip %x\n"), chip); -#endif - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - if (pnMin != NULL) { - *pnMin = 0x029680; - } - - Chip = Chips[chip]; - - SCAN_VAR(Chip->pos); - SCAN_VAR(Chip->step); - SCAN_VAR(Chip->fifo_in); - SCAN_VAR(Chip->reset); - SCAN_VAR(Chip->start); - SCAN_VAR(Chip->drq); - SCAN_VAR(Chip->state); - SCAN_VAR(Chip->clocks_left); - SCAN_VAR(Chip->nibbles_left); - SCAN_VAR(Chip->repeat_count); - SCAN_VAR(Chip->post_drq_state); - SCAN_VAR(Chip->post_drq_clocks); - SCAN_VAR(Chip->req_sample); - SCAN_VAR(Chip->last_sample); - SCAN_VAR(Chip->block_header); - SCAN_VAR(Chip->sample_rate); - SCAN_VAR(Chip->first_valid_header); - SCAN_VAR(Chip->offset); - SCAN_VAR(Chip->repeat_offset); - SCAN_VAR(Chip->adpcm_state); - SCAN_VAR(Chip->adpcm_data); - SCAN_VAR(Chip->sample); - SCAN_VAR(Chip->romoffset); - SCAN_VAR(Chip->volume); - SCAN_VAR(Chip->output_dir); - - return 0; -} - -void UPD7759Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_UPD7759Initted) bprintf(PRINT_ERROR, _T("UPD7759Exit called without init\n")); -#endif - - BurnFree(Chips[0]); - BurnFree(Chips[1]); - SlaveMode = 0; - - DebugSnd_UPD7759Initted = 0; - nNumChips = 0; -} diff --git a/jan/src/burn/snd/upd7759.h b/jan/src/burn/snd/upd7759.h deleted file mode 100644 index 17afab879..000000000 --- a/jan/src/burn/snd/upd7759.h +++ /dev/null @@ -1,15 +0,0 @@ -#define UPD7759_STANDARD_CLOCK 640000 - -typedef void (*drqcallback)(INT32 param); - -void UPD7759Update(INT32 chip, INT16 *pSoundBuf, INT32 nLength); -void UPD7759Reset(); -void UPD7759Init(INT32 chip, INT32 clock, UINT8* pSoundData); -void UPD7759SetRoute(INT32 chip, double nVolume, INT32 nRouteDir); -void UPD7759SetDrqCallback(INT32 chip, drqcallback Callback); -INT32 UPD7759BusyRead(INT32 chip); -void UPD7759ResetWrite(INT32 chip, UINT8 Data); -void UPD7759StartWrite(INT32 chip, UINT8 Data); -void UPD7759PortWrite(INT32 chip, UINT8 Data); -INT32 UPD7759Scan(INT32 chip, INT32 nAction,INT32 *pnMin); -void UPD7759Exit(); diff --git a/jan/src/burn/snd/vlm5030.cpp b/jan/src/burn/snd/vlm5030.cpp deleted file mode 100644 index 9893d2840..000000000 --- a/jan/src/burn/snd/vlm5030.cpp +++ /dev/null @@ -1,854 +0,0 @@ -/* - vlm5030.c - - VLM5030 emulator - - Written by Tatsuyuki Satoh - Based on TMS5220 simulator (tms5220.c) - - note: - memory read cycle(==sampling rate) = 122.9u(440clock) - interpolator (LC8109 = 2.5ms) = 20 * samples(125us) - frame time (20ms) = 4 * interpolator - 9bit DAC is composed of 5bit Physical and 3bitPWM. - - todo: - Noise Generator circuit without 'rand()' function. - ------------ command format (Analytical result) ---------- - -1)end of speech (8bit) -:00000011: - -2)silent some frame (8bit) -:????SS01: - -SS : number of silent frames - 00 = 2 frame - 01 = 4 frame - 10 = 6 frame - 11 = 8 frame - -3)-speech frame (48bit) -function: 6th : 5th : 4th : 3rd : 2nd : 1st : -end : --- : --- : --- : --- : --- :00000011: -silent : --- : --- : --- : --- : --- :0000SS01: -speech :11111122:22233334:44455566:67778889:99AAAEEE:EEPPPPP0: - -EEEEE : energy : volume 0=off,0x1f=max -PPPPP : pitch : 0=noize , 1=fast,0x1f=slow -111111 : K1 : 48=off -22222 : K2 : 0=off,1=+min,0x0f=+max,0x10=off,0x11=+max,0x1f=-min - : 16 == special function?? -3333 : K3 : 0=off,1=+min,0x07=+max,0x08=-max,0x0f=-min -4444 : K4 : -555 : K5 : 0=off,1=+min,0x03=+max,0x04=-max,0x07=-min -666 : K6 : -777 : K7 : -888 : K8 : -999 : K9 : -AAA : K10 : - - ---------- chirp table information ---------- - -DAC PWM cycle == 88system clock , (11clock x 8 pattern) = 40.6KHz -one chirp == 5 x PWM cycle == 440systemclock(8,136Hz) - -chirp 0 : volume 10- 8 : with filter -chirp 1 : volume 8- 6 : with filter -chirp 2 : volume 6- 4 : with filter -chirp 3 : volume 4 : no filter ?? -chirp 4- 5: volume 4- 2 : with filter -chirp 6-11: volume 2- 0 : with filter -chirp 12-..: volume 0 : silent - - ---------- digial output information ---------- - when ME pin = high , some status output to A0..15 pins - - A0..8 : DAC output value (abs) - A9 : DAC sign flag , L=minus,H=Plus - A10 : energy reload flag (pitch pulse) - A11..15 : unknown - - [DAC output value(signed 6bit)] = A9 ? A0..8 : -(A0..8) - -*/ -/* - Ported from MAME 0.120 - 29/01/14 -*/ - -#include "burnint.h" -#include "vlm5030.h" - -#define CHIP_COUNT 1 -#define LEFT 0x00 -#define RIGHT 0x01 - -/* interpolator per frame */ -#define FR_SIZE 4 -/* samples per interpolator */ -#define IP_SIZE_SLOWER (240/FR_SIZE) -#define IP_SIZE_SLOW (200/FR_SIZE) -#define IP_SIZE_NORMAL (160/FR_SIZE) -#define IP_SIZE_FAST (120/FR_SIZE) -#define IP_SIZE_FASTER ( 80/FR_SIZE) - -struct vlm5030_info -{ - /* need to save state */ - - UINT8 *rom; - INT32 address_mask; - UINT16 address; - UINT8 pin_BSY; - UINT8 pin_ST; - UINT8 pin_VCU; - UINT8 pin_RST; - UINT8 latch_data; - UINT16 vcu_addr_h; - UINT8 parameter; - UINT8 phase; - - /* state of option paramter */ - INT32 frame_size; - INT32 pitch_offset; - UINT8 interp_step; - - UINT8 interp_count; /* number of interp periods */ - UINT8 sample_count; /* sample number within interp */ - UINT8 pitch_count; - - /* these contain data describing the current and previous voice frames */ - UINT16 old_energy; - UINT8 old_pitch; - INT16 old_k[10]; - UINT16 target_energy; - UINT8 target_pitch; - INT16 target_k[10]; - - UINT16 new_energy; - UINT8 new_pitch; - INT16 new_k[10]; - - /* these are all used to contain the current state of the sound generation */ - UINT32 current_energy; - UINT32 current_pitch; - INT32 current_k[10]; - - INT32 x[10]; - - // FBA-specific variables - INT16 *output; - INT32 samples_per_frame; - UINT32 (*pSyncCallback)(int samples_per_frame); - INT32 current_position; - INT32 fill_buffer_hack; - double gain[2]; - INT32 output_dir[2]; - INT32 bAdd; -}; - -static struct vlm5030_info vlm5030_chips[CHIP_COUNT]; - -/* phase value */ -enum { - PH_RESET, - PH_IDLE, - PH_SETUP, - PH_WAIT, - PH_RUN, - PH_STOP, - PH_END -}; - -/* - speed parameter -SPC SPB SPA - 1 0 1 more slow (05h) : 42ms (150%) : 60sample - 1 1 x slow (06h,07h) : 34ms (125%) : 50sample - x 0 0 normal (00h,04h) : 25.6ms (100%) : 40samplme - 0 0 1 fast (01h) : 20.2ms (75%) : 30sample - 0 1 x more fast (02h,03h) : 12.2ms (50%) : 20sample -*/ -static const INT32 vlm5030_speed_table[8] = -{ - IP_SIZE_NORMAL, - IP_SIZE_FAST, - IP_SIZE_FASTER, - IP_SIZE_FASTER, - IP_SIZE_NORMAL, - IP_SIZE_SLOWER, - IP_SIZE_SLOW, - IP_SIZE_SLOW -}; - -static const char VLM_NAME[] = "VLM5030"; - -/* ROM Tables */ - -/* This is the energy lookup table */ - -/* sampled from real chip */ -static const UINT16 energytable[0x20] = -{ - 0, 2, 4, 6, 10, 12, 14, 18, /* 0-7 */ - 22, 26, 30, 34, 38, 44, 48, 54, /* 8-15 */ - 62, 68, 76, 84, 94,102,114,124, /* 16-23 */ - 136,150,164,178,196,214,232,254 /* 24-31 */ -}; - -/* This is the pitch lookup table */ -static const UINT8 pitchtable [0x20]= -{ - 1, /* 0 : random mode */ - 22, /* 1 : start=22 */ - 23, 24, 25, 26, 27, 28, 29, 30, /* 2- 9 : 1step */ - 32, 34, 36, 38, 40, 42, 44, 46, /* 10-17 : 2step */ - 50, 54, 58, 62, 66, 70, 74, 78, /* 18-25 : 4step */ - 86, 94, 102,110,118,126 /* 26-31 : 8step */ -}; - -static const INT16 K1_table[] = { - -24898, -25672, -26446, -27091, -27736, -28252, -28768, -29155, - -29542, -29929, -30316, -30574, -30832, -30961, -31219, -31348, - -31606, -31735, -31864, -31864, -31993, -32122, -32122, -32251, - -32251, -32380, -32380, -32380, -32509, -32509, -32509, -32509, - 24898, 23995, 22963, 21931, 20770, 19480, 18061, 16642, - 15093, 13416, 11610, 9804, 7998, 6063, 3999, 1935, - 0, -1935, -3999, -6063, -7998, -9804, -11610, -13416, - -15093, -16642, -18061, -19480, -20770, -21931, -22963, -23995 -}; -static const INT16 K2_table[] = { - 0, -3096, -6321, -9417, -12513, -15351, -18061, -20770, - -23092, -25285, -27220, -28897, -30187, -31348, -32122, -32638, - 0, 32638, 32122, 31348, 30187, 28897, 27220, 25285, - 23092, 20770, 18061, 15351, 12513, 9417, 6321, 3096 -}; -static const INT16 K3_table[] = { - 0, -3999, -8127, -12255, -16384, -20383, -24511, -28639, - 32638, 28639, 24511, 20383, 16254, 12255, 8127, 3999 -}; -static const INT16 K5_table[] = { - 0, -8127, -16384, -24511, 32638, 24511, 16254, 8127 -}; - -static INT32 get_bits(struct vlm5030_info *chip, INT32 sbit,INT32 bits) -{ - INT32 offset = chip->address + (sbit>>3); - INT32 data; - - data = chip->rom[offset&chip->address_mask] + - (((INT32)chip->rom[(offset+1)&chip->address_mask])*256); - data >>= (sbit&7); - data &= (0xff>>(8-bits)); - - return data; -} - -/* get next frame */ -static INT32 parse_frame (struct vlm5030_info *chip) -{ - UINT8 cmd; - INT32 i; - - /* remember previous frame */ - chip->old_energy = chip->new_energy; - chip->old_pitch = chip->new_pitch; - for(i=0;i<=9;i++) - chip->old_k[i] = chip->new_k[i]; - - /* command byte check */ - cmd = chip->rom[chip->address&chip->address_mask]; - if( cmd & 0x01 ) - { /* extend frame */ - chip->new_energy = chip->new_pitch = 0; - for(i=0;i<=9;i++) - chip->new_k[i] = 0; - chip->address++; - if( cmd & 0x02 ) - { /* end of speech */ - - /* logerror("VLM5030 %04X end \n",chip->address ); */ - return 0; - } - else - { /* silent frame */ - int nums = ( (cmd>>2)+1 )*2; - /* logerror("VLM5030 %04X silent %d frame\n",chip->address,nums ); */ - return nums * FR_SIZE; - } - } - /* pitch */ - chip->new_pitch = ( pitchtable[get_bits(chip, 1,5)] + chip->pitch_offset )&0xff; - /* energy */ - chip->new_energy = energytable[get_bits(chip, 6,5)]; - - /* 10 K's */ - chip->new_k[9] = K5_table[get_bits(chip,11,3)]; - chip->new_k[8] = K5_table[get_bits(chip,14,3)]; - chip->new_k[7] = K5_table[get_bits(chip,17,3)]; - chip->new_k[6] = K5_table[get_bits(chip,20,3)]; - chip->new_k[5] = K5_table[get_bits(chip,23,3)]; - chip->new_k[4] = K5_table[get_bits(chip,26,3)]; - chip->new_k[3] = K3_table[get_bits(chip,29,4)]; - chip->new_k[2] = K3_table[get_bits(chip,33,4)]; - chip->new_k[1] = K2_table[get_bits(chip,37,5)]; - chip->new_k[0] = K1_table[get_bits(chip,42,6)]; - - chip->address+=6; - - return FR_SIZE; -} - -/* decode and buffering data */ -static void vlm5030_update(struct vlm5030_info *chip) -{ - INT32 buf_count=0; - INT32 interp_effect; - INT32 i; - INT32 u[11]; - -//------------------------------------------------------------------------------------------------------ - if (chip->pSyncCallback == NULL) return; - INT32 position; - - if (chip->fill_buffer_hack) { - position = chip->samples_per_frame; - chip->fill_buffer_hack = 0; - } else { - position = chip->pSyncCallback(chip->samples_per_frame); - } - - if (position > chip->samples_per_frame) position = chip->samples_per_frame; - if (position == chip->current_position) return; - - INT16 *buffer = chip->output + chip->current_position; - - INT32 samples = position - chip->current_position; - - chip->current_position = position; - - if (samples <= 0) return; -//------------------------------------------------------------------------------------------------------- - - /* running */ - if( chip->phase == PH_RUN || chip->phase == PH_STOP ) - { - /* playing speech */ - while (samples > 0) - { - INT32 current_val; - - /* check new interpolator or new frame */ - if( chip->sample_count == 0 ) - { - if( chip->phase == PH_STOP ) - { - chip->phase = PH_END; - chip->sample_count = 1; - goto phase_stop; /* continue to end phase */ - } - chip->sample_count = chip->frame_size; - /* interpolator changes */ - if ( chip->interp_count == 0 ) - { - /* change to new frame */ - chip->interp_count = parse_frame(chip); /* with change phase */ - if ( chip->interp_count == 0 ) - { /* end mark found */ - chip->interp_count = FR_SIZE; - chip->sample_count = chip->frame_size; /* end -> stop time */ - chip->phase = PH_STOP; - } - /* Set old target as new start of frame */ - chip->current_energy = chip->old_energy; - chip->current_pitch = chip->old_pitch; - for(i=0;i<=9;i++) - chip->current_k[i] = chip->old_k[i]; - /* is this a zero energy frame? */ - if (chip->current_energy == 0) - { - chip->target_energy = 0; - chip->target_pitch = chip->current_pitch; - for(i=0;i<=9;i++) - chip->target_k[i] = chip->current_k[i]; - } - else - { - chip->target_energy = chip->new_energy; - chip->target_pitch = chip->new_pitch; - for(i=0;i<=9;i++) - chip->target_k[i] = chip->new_k[i]; - } - } - /* next interpolator */ - /* Update values based on step values 25% , 50% , 75% , 100% */ - chip->interp_count -= chip->interp_step; - /* 3,2,1,0 -> 1,2,3,4 */ - interp_effect = FR_SIZE - (chip->interp_count%FR_SIZE); - chip->current_energy = chip->old_energy + (chip->target_energy - chip->old_energy) * interp_effect / FR_SIZE; - if (chip->old_pitch > 1) - chip->current_pitch = chip->old_pitch + (chip->target_pitch - chip->old_pitch) * interp_effect / FR_SIZE; - for (i = 0; i <= 9 ; i++) - chip->current_k[i] = chip->old_k[i] + (chip->target_k[i] - chip->old_k[i]) * interp_effect / FR_SIZE; - } - /* calcrate digital filter */ - if (chip->old_energy == 0) - { - /* generate silent samples here */ - current_val = 0x00; - } - else if (chip->old_pitch <= 1) - { /* generate unvoiced samples here */ - current_val = (rand()&1) ? chip->current_energy : -chip->current_energy; - } - else - { - /* generate voiced samples here */ - current_val = ( chip->pitch_count == 0) ? chip->current_energy : 0; - } - - /* Lattice filter here */ - u[10] = current_val; - for (i = 9; i >= 0; i--) - u[i] = u[i+1] - ((chip->current_k[i] * chip->x[i]) / 32768); - for (i = 9; i >= 1; i--) - chip->x[i] = chip->x[i-1] + ((chip->current_k[i-1] * u[i-1]) / 32768); - chip->x[0] = u[0]; - - /* clipping, buffering */ - if (u[0] > 511) - buffer[buf_count] = 511<<6; - else if (u[0] < -511) - buffer[buf_count] = -511<<6; - else - buffer[buf_count] = (u[0] << 6); - buf_count++; - - /* sample count */ - chip->sample_count--; - /* pitch */ - chip->pitch_count++; - if (chip->pitch_count >= chip->current_pitch ) - chip->pitch_count = 0; - /* size */ - samples--; - } - } - /* stop phase */ -phase_stop: - switch( chip->phase ) - { - case PH_SETUP: - if( chip->sample_count <= samples) - { - chip->sample_count = 0; - /* logerror("VLM5030 BSY=H\n" ); */ - /* pin_BSY = 1; */ - chip->phase = PH_WAIT; - } - else - { - chip->sample_count -= samples; - } - break; - case PH_END: - if( chip->sample_count <= samples) - { - chip->sample_count = 0; - /* logerror("VLM5030 BSY=L\n" ); */ - chip->pin_BSY = 0; - chip->phase = PH_IDLE; - } - else - { - chip->sample_count -= samples; - } - } - /* silent buffering */ - while (samples > 0) - { - buffer[buf_count++] = 0x00; - samples--; - } -} - -/* setup parameteroption when RST=H */ -static void vlm5030_setup_parameter(struct vlm5030_info *chip, UINT8 param) -{ - /* latch parameter value */ - chip->parameter = param; - - /* bit 0,1 : 4800bps / 9600bps , interporator step */ - if(param&2) /* bit 1 = 1 , 9600bps */ - chip->interp_step = 4; /* 9600bps : no interporator */ - else if(param&1) /* bit1 = 0 & bit0 = 1 , 4800bps */ - chip->interp_step = 2; /* 4800bps : 2 interporator */ - else /* bit1 = bit0 = 0 : 2400bps */ - chip->interp_step = 1; /* 2400bps : 4 interporator */ - - /* bit 3,4,5 : speed (frame size) */ - chip->frame_size = vlm5030_speed_table[(param>>3) &7]; - - /* bit 6,7 : low / high pitch */ - if(param&0x80) /* bit7=1 , high pitch */ - chip->pitch_offset = -8; - else if(param&0x40) /* bit6=1 , low pitch */ - chip->pitch_offset = 8; - else - chip->pitch_offset = 0; -} - -static void vlm5030_reset(struct vlm5030_info *chip) -{ - memset (chip->output, 0, chip->samples_per_frame * sizeof(INT16)); - chip->current_position = 0; - chip->fill_buffer_hack = 0; - - srand (132); - - chip->phase = PH_RESET; - chip->address = 0; - chip->vcu_addr_h = 0; - chip->pin_BSY = 0; - - chip->old_energy = chip->old_pitch = 0; - chip->new_energy = chip->new_pitch = 0; - chip->current_energy = chip->current_pitch = 0; - chip->target_energy = chip->target_pitch = 0; - memset(chip->old_k, 0, sizeof(chip->old_k)); - memset(chip->new_k, 0, sizeof(chip->new_k)); - memset(chip->current_k, 0, sizeof(chip->current_k)); - memset(chip->target_k, 0, sizeof(chip->target_k)); - chip->interp_count = chip->sample_count = chip->pitch_count = 0; - memset(chip->x, 0, sizeof(chip->x)); - /* reset parameters */ - vlm5030_setup_parameter(chip, 0x00); -} - -void vlm5030Reset(INT32 nChip) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030Reset called without init\n")); -#endif - - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - - vlm5030_reset(chip); -} - -/* set speech rom address */ -void vlm5030_set_rom(INT32 nChip, void *speech_rom) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030_set_rom called without init\n")); -#endif - - struct vlm5030_info *chip = &vlm5030_chips[nChip];; - chip->rom = (UINT8 *)speech_rom; -} - -/* get BSY pin level */ -INT32 vlm5030_bsy(INT32 nChip) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030_bsy called without init\n")); -#endif - - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - vlm5030_update(chip); - return chip->pin_BSY; -} - -/* latch contoll data */ -void vlm5030_data_write(INT32 nChip, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030_data_write called without init\n")); -#endif - - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - - chip->latch_data = (UINT8)data; -} - -/* set RST pin level : reset / set table address A8-A15 */ -void vlm5030_rst(INT32 nChip, INT32 pin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030_rst called without init\n")); -#endif - - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - if( chip->pin_RST ) - { - if( !pin ) - { /* H -> L : latch parameters */ - chip->pin_RST = 0; - vlm5030_setup_parameter(chip, chip->latch_data); - } - } - else - { - if( pin ) - { /* L -> H : reset chip */ - chip->pin_RST = 1; - if( chip->pin_BSY ) - { - vlm5030_reset(chip); - } - } - } -} - -/* set VCU pin level : ?? unknown */ -void vlm5030_vcu(INT32 nChip, INT32 pin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030_vcu called without init\n")); -#endif - - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - /* direct mode / indirect mode */ - chip->pin_VCU = pin; - return; -} - -/* set ST pin level : set table address A0-A7 / start speech */ -void vlm5030_st(INT32 nChip, INT32 pin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030_st called without init\n")); -#endif - - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - INT32 table; - - if( chip->pin_ST != pin ) - { - /* pin level is change */ - if( !pin ) - { /* H -> L */ - chip->pin_ST = 0; - - if( chip->pin_VCU ) - { /* direct access mode & address High */ - chip->vcu_addr_h = ((INT32)chip->latch_data<<8) + 0x01; - } - else - { - /* start speech */ - /* check access mode */ - if( chip->vcu_addr_h ) - { /* direct access mode */ - chip->address = (chip->vcu_addr_h&0xff00) + chip->latch_data; - chip->vcu_addr_h = 0; - } - else - { /* indirect accedd mode */ - table = (chip->latch_data&0xfe) + (((INT32)chip->latch_data&1)<<8); - chip->address = (((INT32)chip->rom[table&chip->address_mask])<<8) - | chip->rom[(table+1)&chip->address_mask]; - } - vlm5030_update(chip); - /* logerror("VLM5030 %02X start adr=%04X\n",table/2,chip->address ); */ - /* reset process status */ - chip->sample_count = chip->frame_size; - chip->interp_count = FR_SIZE; - /* clear filter */ - /* start after 3 sampling cycle */ - chip->phase = PH_RUN; - } - } - else - { /* L -> H */ - chip->pin_ST = 1; - /* setup speech , BSY on after 30ms? */ - chip->phase = PH_SETUP; - chip->sample_count = 1; /* wait time for busy on */ - chip->pin_BSY = 1; /* */ - } - } -} - -/* start VLM5030 with sound rom */ -/* speech_rom == 0 -> use sampling data mode */ -void vlm5030Init(INT32 nChip, INT32 clock, UINT32 (*pSyncCallback)(INT32 samples_per_frame), UINT8 *rom, INT32 rom_size, INT32 bAdd) -{ - DebugSnd_VLM5030Initted = 1; - - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - memset (chip, 0, sizeof(vlm5030_info)); - - /* reset input pins */ - chip->pin_RST = chip->pin_ST = chip->pin_VCU= 0; - - chip->samples_per_frame = (clock * 100) / 440 / nBurnFPS; - - chip->latch_data = 0; - chip->output = (INT16*)BurnMalloc(chip->samples_per_frame * sizeof(INT16)); - - vlm5030_reset(chip); - - chip->phase = PH_IDLE; - - chip->bAdd = bAdd; - chip->rom = rom; - chip->address_mask = rom_size - 1; - chip->pSyncCallback = pSyncCallback; - chip->gain[BURN_SND_VLM5030_ROUTE_1] = 1.00; - chip->gain[BURN_SND_VLM5030_ROUTE_2] = 1.00; - chip->output_dir[BURN_SND_VLM5030_ROUTE_1] = BURN_SND_ROUTE_BOTH; - chip->output_dir[BURN_SND_VLM5030_ROUTE_2] = BURN_SND_ROUTE_BOTH; -} - -void vlm5030SetRoute(INT32 nChip, INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030SetRoute called without init\n")); -#endif - - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - - chip->gain[nIndex] = nVolume; - chip->output_dir[nIndex] = nRouteDir; -} - -void vlm5030Exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030Exit called without init\n")); -#endif - - if (!DebugSnd_VLM5030Initted) return; - - struct vlm5030_info *chip; - - for (INT32 i = 0; i < CHIP_COUNT; i++) { - chip = &vlm5030_chips[i]; - - if (chip->output) { - BurnFree(chip->output); - chip->output = NULL; - } - } - - DebugSnd_VLM5030Initted = 0; -} - -void vlm5030Update(INT32 nChip, INT16 *buf, INT32 samples) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030Update called without init\n")); -#endif - - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - - if (pBurnSoundOut == NULL) { - chip->current_position = 0; - return; - } - - chip->fill_buffer_hack = 1; - vlm5030_update(chip); - - INT32 nAdd = chip->bAdd; - INT16 *stream = chip->output; - - UINT32 step = (chip->samples_per_frame << 12) / nBurnSoundLen; - INT32 pos = 0; - - for (INT32 i = 0; i < samples; i++) { - if ((pos>>12) >= chip->samples_per_frame) pos = (chip->samples_per_frame-1) << 12; - - INT16 output = stream[pos>>12]; - - /* write sound data to the buffer */ - INT32 nLeftSample = 0, nRightSample = 0; - - if ((chip->output_dir[BURN_SND_VLM5030_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((output / 6) * chip->gain[BURN_SND_VLM5030_ROUTE_1]); - } - if ((chip->output_dir[BURN_SND_VLM5030_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((output / 6) * chip->gain[BURN_SND_VLM5030_ROUTE_1]); - } - if ((chip->output_dir[BURN_SND_VLM5030_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((output / 6) * chip->gain[BURN_SND_VLM5030_ROUTE_2]); - } - if ((chip->output_dir[BURN_SND_VLM5030_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((output / 6) * chip->gain[BURN_SND_VLM5030_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - if (nAdd) { - buf[LEFT] = BURN_SND_CLIP(buf[LEFT] + nLeftSample); - buf[RIGHT] = BURN_SND_CLIP(buf[RIGHT] + nRightSample); - } else { - buf[LEFT] = nLeftSample; - buf[RIGHT] = nRightSample; - } - - buf += 2; - pos += step; - } - - chip->current_position = 0; - memset (chip->output, 0, chip->samples_per_frame * sizeof(INT16)); -} - -static void vlm5030_restore_state(INT32 nChip) -{ - struct vlm5030_info *chip = &vlm5030_chips[nChip]; - INT32 i; - - INT32 interp_effect = FR_SIZE - (chip->interp_count%FR_SIZE); - /* restore parameter data */ - vlm5030_setup_parameter(chip, chip->parameter); - - /* restore current energy,pitch & filter */ - chip->current_energy = chip->old_energy + (chip->target_energy - chip->old_energy) * interp_effect / FR_SIZE; - if (chip->old_pitch > 1) - chip->current_pitch = chip->old_pitch + (chip->target_pitch - chip->old_pitch) * interp_effect / FR_SIZE; - for (i = 0; i <= 9 ; i++) - chip->current_k[i] = chip->old_k[i] + (chip->target_k[i] - chip->old_k[i]) * interp_effect / FR_SIZE; -} - -INT32 vlm5030Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugSnd_VLM5030Initted) bprintf(PRINT_ERROR, _T("vlm5030Scan called without init\n")); -#endif - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i < CHIP_COUNT; i++) { - struct vlm5030_info *chip = &vlm5030_chips[i]; - - SCAN_VAR(chip->address); - SCAN_VAR(chip->pin_BSY); - SCAN_VAR(chip->pin_ST); - SCAN_VAR(chip->pin_VCU); - SCAN_VAR(chip->pin_RST); - SCAN_VAR(chip->latch_data); - SCAN_VAR(chip->vcu_addr_h); - SCAN_VAR(chip->parameter); - SCAN_VAR(chip->phase); - SCAN_VAR(chip->interp_count); - SCAN_VAR(chip->sample_count); - SCAN_VAR(chip->pitch_count); - SCAN_VAR(chip->old_energy); - SCAN_VAR(chip->old_pitch); - SCAN_VAR(chip->old_k); - SCAN_VAR(chip->target_energy); - SCAN_VAR(chip->target_pitch); - SCAN_VAR(chip->target_k); - SCAN_VAR(chip->x); - - vlm5030_restore_state(i); - } - } - - return 0; -} diff --git a/jan/src/burn/snd/vlm5030.h b/jan/src/burn/snd/vlm5030.h deleted file mode 100644 index f77d7b774..000000000 --- a/jan/src/burn/snd/vlm5030.h +++ /dev/null @@ -1,21 +0,0 @@ -void vlm5030Reset(INT32 nChip); -void vlm5030Init(INT32 nChip, INT32 clock, UINT32 (*pSyncCallback)(INT32 sample_rate), UINT8 *rom, INT32 rom_size, INT32 nAdd); -void vlm5030Update(INT32 nChip, INT16 *buf, INT32 samples); -void vlm5030SetRoute(INT32 chip, INT32 nIndex, double nVolume, INT32 nRouteDir); -void vlm5030Exit(); - -INT32 vlm5030Scan(INT32 nAction); - -void vlm5030_set_rom(INT32 nChip, void *speech_rom); -INT32 vlm5030_bsy(INT32 nChip); -void vlm5030_st(INT32 nChip, INT32 pin); -void vlm5030_vcu(INT32 nChip, INT32 pin); -void vlm5030_rst(INT32 nChip, INT32 pin); -void vlm5030_data_write(INT32 nChip, UINT8 data); - -#define BURN_SND_VLM5030_ROUTE_1 0 -#define BURN_SND_VLM5030_ROUTE_2 1 - -#define vlm5030SetAllRoutes(i, v, d) \ - vlm5030SetRoute(i, BURN_SND_VLM5030_ROUTE_1, v, d); \ - vlm5030SetRoute(i, BURN_SND_VLM5030_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/x1010.cpp b/jan/src/burn/snd/x1010.cpp deleted file mode 100644 index 912bfd8c5..000000000 --- a/jan/src/burn/snd/x1010.cpp +++ /dev/null @@ -1,269 +0,0 @@ -// Based on MAME sources by Luca Elia - -#include "burnint.h" -#include "msm6295.h" -#include "burn_sound.h" -#include "x1010.h" - -UINT8 *X1010SNDROM; -INT32 X1010_Arbalester_Mode = 0; - -struct x1_010_info * x1_010_chip = NULL; - -void x1010_sound_bank_w(UINT32 offset, UINT16 data) -{ -#if defined FBA_DEBUG - if (!DebugSnd_X1010Initted) bprintf(PRINT_ERROR, _T("x1010_sound_bank_w called without init\n")); -#endif - - //int banks = (memory_region_length( REGION_SOUND1 ) - 0x100000) / 0x20000; - //if ( data >= banks ) { - // bprintf(PRINT_NORMAL, _T("invalid sound bank %04x\n"), data); - // data %= banks; - //} - memcpy(X1010SNDROM + offset * 0x20000, X1010SNDROM + 0x100000 + data * 0x20000, 0x20000); - - // backup sound bank index, need when game load status - x1_010_chip->sound_banks[ offset ] = data; -} - -UINT8 x1010_sound_read(UINT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_X1010Initted) bprintf(PRINT_ERROR, _T("x1010_sound_read called without init\n")); -#endif - - offset ^= x1_010_chip->address; - return x1_010_chip->reg[offset]; -} - -UINT16 x1010_sound_read_word(UINT32 offset) -{ -#if defined FBA_DEBUG - if (!DebugSnd_X1010Initted) bprintf(PRINT_ERROR, _T("x1010_sound_read_word called without init\n")); -#endif - - UINT16 ret; - - ret = x1_010_chip->HI_WORD_BUF[offset] << 8; - ret += x1010_sound_read(offset); - - return ret; -} - -void x1010_sound_update() -{ -#if defined FBA_DEBUG - if (!DebugSnd_X1010Initted) bprintf(PRINT_ERROR, _T("x1010_sound_update called without init\n")); -#endif - - INT16* pSoundBuf = pBurnSoundOut; - memset(pSoundBuf, 0, nBurnSoundLen * sizeof(INT16) * 2); - - X1_010_CHANNEL *reg; - INT32 ch, i, volL, volR, freq, mempos, div; - INT8 *start, *end, data; - UINT8 *env; - UINT32 smp_offs, smp_step, env_offs, env_step, delta; - - for( ch = 0; ch < SETA_NUM_CHANNELS; ch++ ) { - reg = (X1_010_CHANNEL *) & (x1_010_chip->reg[ch * sizeof(X1_010_CHANNEL)]); - if( reg->status & 1 ) { // Key On - INT16 *bufL = pSoundBuf + 0; - INT16 *bufR = pSoundBuf + 1; - div = (reg->status&0x80) ? 1 : 0; - if( (reg->status & 2) == 0 ) { // PCM sampling - start = (INT8*)( reg->start * 0x1000 + X1010SNDROM ); - mempos = reg->start * 0x1000; // used only for bounds checking - end = (INT8*)((0x100 - reg->end) * 0x1000 + X1010SNDROM ); - volL = ((reg->volume >> 4) & 0xf) * VOL_BASE; - volR = ((reg->volume >> 0) & 0xf) * VOL_BASE; - smp_offs = x1_010_chip->smp_offset[ch]; - freq = reg->frequency>>div; - if (!volL) volL = volR; // dink aug.17,2016: fix missing samples in ms gundam - if (!volR) volR = volL; - // Meta Fox does not write the frequency register. Ever - if( freq == 0 ) freq = 4; - // Special handling for Arbalester -dink - if( X1010_Arbalester_Mode && ch==0x0f && reg->start != 0xc0 && reg->start != 0xc8 ) - freq = 8; - - smp_step = (UINT32)((float)x1_010_chip->rate / (float)nBurnSoundRate / 8.0 * freq * (1 << FREQ_BASE_BITS) ); -#if 0 - if( smp_offs == 0 ) { - bprintf(PRINT_ERROR, _T("Play sample %06X - %06X, channel %X volumeL %d volumeR %d freq %X step %X offset %X\n"), - reg->start, reg->end, ch, volL, volR, freq, smp_step, smp_offs); - } -#endif - for( i = 0; i < nBurnSoundLen; i++ ) { - delta = smp_offs >> FREQ_BASE_BITS; - // sample ended? - if( start + delta >= end) { - reg->status &= 0xfe; // Key off - break; - } - - if (mempos + delta >= 0xfffff) { // bounds checking - reg->status &= 0xfe; // Key off - bprintf(0, _T("X1-010: Overflow detected (PCM)!\n")); - break; - } - - data = *(start + delta); - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((data * volL / 256) * x1_010_chip->gain[BURN_SND_X1010_ROUTE_1]); - } - if ((x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((data * volL / 256) * x1_010_chip->gain[BURN_SND_X1010_ROUTE_1]); - } - - if ((x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((data * volR / 256) * x1_010_chip->gain[BURN_SND_X1010_ROUTE_2]); - } - if ((x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((data * volR / 256) * x1_010_chip->gain[BURN_SND_X1010_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - *bufL = BURN_SND_CLIP(*bufL + nLeftSample); bufL += 2;; - *bufR = BURN_SND_CLIP(*bufR + nRightSample); bufR += 2; - - smp_offs += smp_step; - } - x1_010_chip->smp_offset[ch] = smp_offs; - - } else { // Wave form - start = (INT8*) & (x1_010_chip->reg[reg->volume * 128 + 0x1000]); - mempos = reg->volume * 128 + 0x1000; // used only for bounds checking - smp_offs = x1_010_chip->smp_offset[ch]; - freq = ((reg->pitch_hi << 8) + reg->frequency)>>div; - smp_step = (UINT32)((float)x1_010_chip->rate / (float)nBurnSoundRate / 128.0 / 4.0 * freq * (1 << FREQ_BASE_BITS) ); - - env = (UINT8*) & (x1_010_chip->reg[reg->end * 128]); - env_offs = x1_010_chip->env_offset[ch]; - env_step = (UINT32)((float)x1_010_chip->rate / (float)nBurnSoundRate / 128.0 / 4.0 * reg->start * (1 << ENV_BASE_BITS) ); -#if 0 - if( smp_offs == 0 ) { - bprintf(PRINT_ERROR, _T("Play waveform %X, channel %X volume %X freq %4X step %X offset %X dlta %X\n"), - reg->volume, ch, reg->end, freq, smp_step, smp_offs, env_offs>>ENV_BASE_BITS ); - } -#endif - if (mempos > 0x2000 - 0x80) { // bounds checking - reg->status &= 0xfe; // Key off - bprintf(0, _T("X1-010: Overflow detected (Waveform)!\n")); - break; - } - - for( i = 0; i < nBurnSoundLen; i++ ) { - INT32 vol; - delta = env_offs>>ENV_BASE_BITS; - // Envelope one shot mode - if( (reg->status&4) != 0 && delta >= 0x80 ) { - reg->status &= 0xfe; // Key off - break; - } - - vol = *(env + (delta & 0x7f)); - volL = ((vol >> 4) & 0xf) * VOL_BASE; - volR = ((vol >> 0) & 0xf) * VOL_BASE; - data = *(start + ((smp_offs >> FREQ_BASE_BITS) & 0x7f)); - - INT32 nLeftSample = 0, nRightSample = 0; - - if ((x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((data * volL / 256) * x1_010_chip->gain[BURN_SND_X1010_ROUTE_1]); - } - if ((x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((data * volL / 256) * x1_010_chip->gain[BURN_SND_X1010_ROUTE_1]); - } - - if ((x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((data * volR / 256) * x1_010_chip->gain[BURN_SND_X1010_ROUTE_2]); - } - if ((x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((data * volR / 256) * x1_010_chip->gain[BURN_SND_X1010_ROUTE_2]); - } - - nLeftSample = BURN_SND_CLIP(nLeftSample); - nRightSample = BURN_SND_CLIP(nRightSample); - - *bufL = BURN_SND_CLIP(*bufL + nLeftSample); bufL += 2;; - *bufR = BURN_SND_CLIP(*bufR + nRightSample); bufR += 2; - - smp_offs += smp_step; - env_offs += env_step; - } - - x1_010_chip->smp_offset[ch] = smp_offs; - x1_010_chip->env_offset[ch] = env_offs; - } - } - } -} - -void x1010_sound_init(UINT32 base_clock, INT32 address) -{ - DebugSnd_X1010Initted = 1; - - x1_010_chip = (struct x1_010_info *) BurnMalloc( sizeof(struct x1_010_info) ); - - memset(x1_010_chip, 0, sizeof(struct x1_010_info)); - - x1_010_chip->base_clock = base_clock; - x1_010_chip->rate = x1_010_chip->base_clock / 1024; - x1_010_chip->address = address; - - x1_010_chip->gain[BURN_SND_X1010_ROUTE_1] = 1.00; - x1_010_chip->gain[BURN_SND_X1010_ROUTE_2] = 1.00; - x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_1] = BURN_SND_ROUTE_BOTH; - x1_010_chip->output_dir[BURN_SND_X1010_ROUTE_2] = BURN_SND_ROUTE_BOTH; - X1010_Arbalester_Mode = 0; -} - -void x1010_set_route(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_X1010Initted) bprintf(PRINT_ERROR, _T("x1010_set_route called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("x1010_set_route called with invalid index %i\n"), nIndex); -#endif - - x1_010_chip->gain[nIndex] = nVolume; - x1_010_chip->output_dir[nIndex] = nRouteDir; -} - -void x1010_scan(INT32 nAction,INT32 *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugSnd_X1010Initted) bprintf(PRINT_ERROR, _T("x1010_scan called without init\n")); -#endif - - struct BurnArea ba; - - if (pnMin != NULL) { - *pnMin = 0x029672; - } - - if ( nAction & ACB_DRIVER_DATA ) { - memset(&ba, 0, sizeof(ba)); - ba.Data = x1_010_chip; - ba.nLen = sizeof(struct x1_010_info); - ba.szName = "X1-010"; - BurnAcb(&ba); - } -} - -void x1010_exit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_X1010Initted) bprintf(PRINT_ERROR, _T("x1010_exit called without init\n")); -#endif - - BurnFree(x1_010_chip); - - DebugSnd_X1010Initted = 0; -} diff --git a/jan/src/burn/snd/x1010.h b/jan/src/burn/snd/x1010.h deleted file mode 100644 index bbb30af95..000000000 --- a/jan/src/burn/snd/x1010.h +++ /dev/null @@ -1,52 +0,0 @@ -#define SETA_NUM_CHANNELS 16 -#define SETA_NUM_BANKS (0x100000 / 0x20000) - -#define FREQ_BASE_BITS 8 // Frequency fixed decimal shift bits -#define ENV_BASE_BITS 16 // wave form envelope fixed decimal shift bits -#define VOL_BASE (2 * 32 * 256 / 30) // Volume base - -struct x1_010_info -{ - INT32 rate; // Output sampling rate (Hz) - INT32 address; // address eor data - INT32 sound_enable; // sound output enable/disable - UINT8 reg[0x2000]; // X1-010 Register & wave form area - UINT8 HI_WORD_BUF[0x2000]; // X1-010 16bit access ram check avoidance work - UINT32 smp_offset[SETA_NUM_CHANNELS]; - UINT32 env_offset[SETA_NUM_CHANNELS]; - UINT32 base_clock; - UINT32 sound_banks[SETA_NUM_BANKS]; - double gain[2]; - INT32 output_dir[2]; -}; - -typedef struct { - UINT8 status; - UINT8 volume; // volume / wave form no. - UINT8 frequency; // frequency / pitch lo - UINT8 pitch_hi; // reserved / pitch hi - UINT8 start; // start address / envelope time - UINT8 end; // end address / envelope no. - UINT8 reserve[2]; -} X1_010_CHANNEL; - -extern UINT8 *X1010SNDROM; -extern INT32 X1010_Arbalester_Mode; - -extern struct x1_010_info * x1_010_chip; - -void x1010_sound_bank_w(UINT32 offset, UINT16 data); -UINT8 x1010_sound_read(UINT32 offset); -UINT16 x1010_sound_read_word(UINT32 offset); -void x1010_sound_update(); -void x1010_sound_init(UINT32 base_clock, INT32 address); -void x1010_set_route(INT32 nIndex, double nVolume, INT32 nRouteDir); -void x1010_scan(INT32 nAction,INT32 *pnMin); -void x1010_exit(); - -#define BURN_SND_X1010_ROUTE_1 0 -#define BURN_SND_X1010_ROUTE_2 1 - -#define x1010_set_all_routes(v, d) \ - x1010_set_route(BURN_SND_X1010_ROUTE_1, v, d); \ - x1010_set_route(BURN_SND_X1010_ROUTE_2, v, d); diff --git a/jan/src/burn/snd/ym2151.c b/jan/src/burn/snd/ym2151.c deleted file mode 100644 index a96c9ce35..000000000 --- a/jan/src/burn/snd/ym2151.c +++ /dev/null @@ -1,2630 +0,0 @@ -// Based on MAME sources by Jarek Burczynski -/***************************************************************************** -* -* Yamaha YM2151 driver (version 2.150 final beta) -* -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "driver.h" -#include "state.h" -#include "ym2151.h" - -#if defined FBA_DEBUG -#ifdef __GNUC__ - // MSVC doesn't like this - this module only supports debug tracking with GCC only - #include - extern UINT8 DebugSnd_AY8910Initted; - extern INT32 (__cdecl *bprintf) (INT32 nStatus, TCHAR* szFormat, ...); - #define PRINT_ERROR (3) -#endif -#endif - -/* undef this to not use MAME timer system */ -// #define USE_MAME_TIMERS - -/*#define FM_EMU*/ -#ifdef FM_EMU - #define INLINE static __inline__ - #ifdef USE_MAME_TIMERS - #undef USE_MAME_TIMERS - #endif -#endif -#ifdef USE_MAME_TIMERS - /*#define LOG_CYM_FILE*/ - #ifdef LOG_CYM_FILE - FILE * cymfile = NULL; - #endif -#endif - - -/* struct describing a single operator */ -typedef struct{ - UINT32 phase; /* accumulated operator phase */ - UINT32 freq; /* operator frequency count */ - INT32 dt1; /* current DT1 (detune 1 phase inc/decrement) value */ - UINT32 mul; /* frequency count multiply */ - UINT32 dt1_i; /* DT1 index * 32 */ - UINT32 dt2; /* current DT2 (detune 2) value */ - - signed int *connect; /* operator output 'direction' */ - - /* only M1 (operator 0) is filled with this data: */ - signed int *mem_connect; /* where to put the delayed sample (MEM) */ - INT32 mem_value; /* delayed sample (MEM) value */ - - /* channel specific data; note: each operator number 0 contains channel specific data */ - UINT32 fb_shift; /* feedback shift value for operators 0 in each channel */ - INT32 fb_out_curr; /* operator feedback value (used only by operators 0) */ - INT32 fb_out_prev; /* previous feedback value (used only by operators 0) */ - UINT32 kc; /* channel KC (copied to all operators) */ - UINT32 kc_i; /* just for speedup */ - UINT32 pms; /* channel PMS */ - UINT32 ams; /* channel AMS */ - /* end of channel specific data */ - - UINT32 AMmask; /* LFO Amplitude Modulation enable mask */ - UINT32 state; /* Envelope state: 4-attack(AR) 3-decay(D1R) 2-sustain(D2R) 1-release(RR) 0-off */ - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT32 tl; /* Total attenuation Level */ - INT32 volume; /* current envelope attenuation level */ - UINT8 eg_sh_d1r; /* (decay state) */ - UINT8 eg_sel_d1r; /* (decay state) */ - UINT32 d1l; /* envelope switches to sustain state after reaching this level */ - UINT8 eg_sh_d2r; /* (sustain state) */ - UINT8 eg_sel_d2r; /* (sustain state) */ - UINT8 eg_sh_rr; /* (release state) */ - UINT8 eg_sel_rr; /* (release state) */ - - UINT32 key; /* 0=last key was KEY OFF, 1=last key was KEY ON */ - - UINT32 ks; /* key scale */ - UINT32 ar; /* attack rate */ - UINT32 d1r; /* decay rate */ - UINT32 d2r; /* sustain rate */ - UINT32 rr; /* release rate */ - - UINT32 reserved0; /**/ - UINT32 reserved1; /**/ - -} YM2151Operator; - - -typedef struct -{ - YM2151Operator oper[32]; /* the 32 operators */ - - UINT32 pan[16]; /* channels output masks (0xffffffff = enable) */ - - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/64/3 */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow; /* envelope generator timer overlfows every 3 samples (on real chip) */ - - UINT32 lfo_phase; /* accumulated LFO phase (0 to 255) */ - UINT32 lfo_timer; /* LFO timer */ - UINT32 lfo_timer_add; /* step of lfo_timer */ - UINT32 lfo_overflow; /* LFO generates new output when lfo_timer reaches this value */ - UINT32 lfo_counter; /* LFO phase increment counter */ - UINT32 lfo_counter_add; /* step of lfo_counter */ - UINT8 lfo_wsel; /* LFO waveform (0-saw, 1-square, 2-triangle, 3-random noise) */ - UINT8 amd; /* LFO Amplitude Modulation Depth */ - INT8 pmd; /* LFO Phase Modulation Depth */ - UINT32 lfa; /* LFO current AM output */ - INT32 lfp; /* LFO current PM output */ - - UINT8 test; /* TEST register */ - UINT8 ct; /* output control pins (bit1-CT2, bit0-CT1) */ - - UINT32 noise; /* noise enable/period register (bit 7 - noise enable, bits 4-0 - noise period */ - UINT32 noise_rng; /* 17 bit noise shift register */ - UINT32 noise_p; /* current noise 'phase'*/ - UINT32 noise_f; /* current noise period */ - - UINT32 csm_req; /* CSM KEY ON / KEY OFF sequence request */ - - UINT32 irq_enable; /* IRQ enable for timer B (bit 3) and timer A (bit 2); bit 7 - CSM mode (keyon to all slots, everytime timer A overflows) */ - UINT32 status; /* chip status (BUSY, IRQ Flags) */ - UINT8 connect[8]; /* channels connections */ - -#ifdef USE_MAME_TIMERS -/* ASG 980324 -- added for tracking timers */ - void *timer_A; - void *timer_B; - double timer_A_time[1024]; /* timer A times for MAME */ - double timer_B_time[256]; /* timer B times for MAME */ -#else - UINT8 tim_A; /* timer A enable (0-disabled) */ - UINT8 tim_B; /* timer B enable (0-disabled) */ - INT32 tim_A_val; /* current value of timer A */ - INT32 tim_B_val; /* current value of timer B */ - UINT32 tim_A_tab[1024]; /* timer A deltas */ - UINT32 tim_B_tab[256]; /* timer B deltas */ -#endif - UINT32 timer_A_index; /* timer A index */ - UINT32 timer_B_index; /* timer B index */ - UINT32 timer_A_index_old; /* timer A previous index */ - UINT32 timer_B_index_old; /* timer B previous index */ - - /* Frequency-deltas to get the closest frequency possible. - * There are 11 octaves because of DT2 (max 950 cents over base frequency) - * and LFO phase modulation (max 800 cents below AND over base frequency) - * Summary: octave explanation - * 0 note code - LFO PM - * 1 note code - * 2 note code - * 3 note code - * 4 note code - * 5 note code - * 6 note code - * 7 note code - * 8 note code - * 9 note code + DT2 + LFO PM - * 10 note code + DT2 + LFO PM - */ - UINT32 freq[11*768]; /* 11 octaves, 768 'cents' per octave */ - - /* Frequency deltas for DT1. These deltas alter operator frequency - * after it has been taken from frequency-deltas table. - */ - INT32 dt1_freq[8*32]; /* 8 DT1 levels, 32 KC values */ - - UINT32 noise_tab[32]; /* 17bit Noise Generator periods */ - - void (*irqhandler)(int irq); /* IRQ function handler */ - write8_handler porthandler; /* port write function handler */ - - unsigned int clock; /* chip clock in Hz (passed from 2151intf.c) */ - unsigned int sampfreq; /* sampling frequency in Hz (passed from 2151intf.c) */ - -} YM2151; - - -#define FREQ_SH 16 /* 16.16 fixed point (frequency calculations) */ -#define EG_SH 16 /* 16.16 fixed point (envelope generator timing) */ -#define LFO_SH 10 /* 22.10 fixed point (LFO calculations) */ -#define TIMER_SH 16 /* 16.16 fixed point (timers calculations) */ - -#define FREQ_MASK ((1<>3) - -/* sin waveform table in 'decibel' scale */ -static unsigned int sin_tab[SIN_LEN]; - - -/* translate from D1L to volume index (16 D1L levels) */ -static UINT32 d1l_tab[16]; - - -#define RATE_STEPS (8) -static UINT8 eg_inc[19*RATE_STEPS]={ - -/*cycle:0 1 2 3 4 5 6 7*/ - -/* 0 */ 0,1, 0,1, 0,1, 0,1, /* rates 00..11 0 (increment by 0 or 1) */ -/* 1 */ 0,1, 0,1, 1,1, 0,1, /* rates 00..11 1 */ -/* 2 */ 0,1, 1,1, 0,1, 1,1, /* rates 00..11 2 */ -/* 3 */ 0,1, 1,1, 1,1, 1,1, /* rates 00..11 3 */ - -/* 4 */ 1,1, 1,1, 1,1, 1,1, /* rate 12 0 (increment by 1) */ -/* 5 */ 1,1, 1,2, 1,1, 1,2, /* rate 12 1 */ -/* 6 */ 1,2, 1,2, 1,2, 1,2, /* rate 12 2 */ -/* 7 */ 1,2, 2,2, 1,2, 2,2, /* rate 12 3 */ - -/* 8 */ 2,2, 2,2, 2,2, 2,2, /* rate 13 0 (increment by 2) */ -/* 9 */ 2,2, 2,4, 2,2, 2,4, /* rate 13 1 */ -/*10 */ 2,4, 2,4, 2,4, 2,4, /* rate 13 2 */ -/*11 */ 2,4, 4,4, 2,4, 4,4, /* rate 13 3 */ - -/*12 */ 4,4, 4,4, 4,4, 4,4, /* rate 14 0 (increment by 4) */ -/*13 */ 4,4, 4,8, 4,4, 4,8, /* rate 14 1 */ -/*14 */ 4,8, 4,8, 4,8, 4,8, /* rate 14 2 */ -/*15 */ 4,8, 8,8, 4,8, 8,8, /* rate 14 3 */ - -/*16 */ 8,8, 8,8, 8,8, 8,8, /* rates 15 0, 15 1, 15 2, 15 3 (increment by 8) */ -/*17 */ 16,16,16,16,16,16,16,16, /* rates 15 2, 15 3 for attack */ -/*18 */ 0,0, 0,0, 0,0, 0,0, /* infinity rates for attack and decay(s) */ -}; - - -#define O(a) (a*RATE_STEPS) - -/*note that there is no O(17) in this table - it's directly in the code */ -static UINT8 eg_rate_select[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ -/* 32 dummy (infinite time) rates */ -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), -O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), - -/* rates 00-11 */ -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), - -/* rate 12 */ -O( 4),O( 5),O( 6),O( 7), - -/* rate 13 */ -O( 8),O( 9),O(10),O(11), - -/* rate 14 */ -O(12),O(13),O(14),O(15), - -/* rate 15 */ -O(16),O(16),O(16),O(16), - -/* 32 dummy rates (same as 15 3) */ -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), -O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16) - -}; -#undef O - -/*rate 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15*/ -/*shift 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0 */ -/*mask 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0, 0, 0, 0, 0 */ - -#define O(a) (a*1) -static UINT8 eg_rate_shift[32+64+32]={ /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */ -/* 32 infinite time rates */ -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), - - -/* rates 00-11 */ -O(11),O(11),O(11),O(11), -O(10),O(10),O(10),O(10), -O( 9),O( 9),O( 9),O( 9), -O( 8),O( 8),O( 8),O( 8), -O( 7),O( 7),O( 7),O( 7), -O( 6),O( 6),O( 6),O( 6), -O( 5),O( 5),O( 5),O( 5), -O( 4),O( 4),O( 4),O( 4), -O( 3),O( 3),O( 3),O( 3), -O( 2),O( 2),O( 2),O( 2), -O( 1),O( 1),O( 1),O( 1), -O( 0),O( 0),O( 0),O( 0), - -/* rate 12 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 13 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 14 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 15 */ -O( 0),O( 0),O( 0),O( 0), - -/* 32 dummy rates (same as 15 3) */ -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0) - -}; -#undef O - -/* DT2 defines offset in cents from base note -* -* This table defines offset in frequency-deltas table. -* User's Manual page 22 -* -* Values below were calculated using formula: value = orig.val / 1.5625 -* -* DT2=0 DT2=1 DT2=2 DT2=3 -* 0 600 781 950 -*/ -static UINT32 dt2_tab[4] = { 0, 384, 500, 608 }; - -/* DT1 defines offset in Hertz from base note -* This table is converted while initialization... -* Detune table shown in YM2151 User's Manual is wrong (verified on the real chip) -*/ - -static UINT8 dt1_tab[4*32] = { /* 4*32 DT1 values */ -/* DT1=0 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -/* DT1=1 */ - 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8, 8, 8, 8, - -/* DT1=2 */ - 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, - 5, 6, 6, 7, 8, 8, 9,10,11,12,13,14,16,16,16,16, - -/* DT1=3 */ - 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, - 8, 8, 9,10,11,12,13,14,16,17,19,20,22,22,22,22 -}; - -static UINT16 phaseinc_rom[768]={ -1299,1300,1301,1302,1303,1304,1305,1306,1308,1309,1310,1311,1313,1314,1315,1316, -1318,1319,1320,1321,1322,1323,1324,1325,1327,1328,1329,1330,1332,1333,1334,1335, -1337,1338,1339,1340,1341,1342,1343,1344,1346,1347,1348,1349,1351,1352,1353,1354, -1356,1357,1358,1359,1361,1362,1363,1364,1366,1367,1368,1369,1371,1372,1373,1374, -1376,1377,1378,1379,1381,1382,1383,1384,1386,1387,1388,1389,1391,1392,1393,1394, -1396,1397,1398,1399,1401,1402,1403,1404,1406,1407,1408,1409,1411,1412,1413,1414, -1416,1417,1418,1419,1421,1422,1423,1424,1426,1427,1429,1430,1431,1432,1434,1435, -1437,1438,1439,1440,1442,1443,1444,1445,1447,1448,1449,1450,1452,1453,1454,1455, -1458,1459,1460,1461,1463,1464,1465,1466,1468,1469,1471,1472,1473,1474,1476,1477, -1479,1480,1481,1482,1484,1485,1486,1487,1489,1490,1492,1493,1494,1495,1497,1498, -1501,1502,1503,1504,1506,1507,1509,1510,1512,1513,1514,1515,1517,1518,1520,1521, -1523,1524,1525,1526,1528,1529,1531,1532,1534,1535,1536,1537,1539,1540,1542,1543, -1545,1546,1547,1548,1550,1551,1553,1554,1556,1557,1558,1559,1561,1562,1564,1565, -1567,1568,1569,1570,1572,1573,1575,1576,1578,1579,1580,1581,1583,1584,1586,1587, -1590,1591,1592,1593,1595,1596,1598,1599,1601,1602,1604,1605,1607,1608,1609,1610, -1613,1614,1615,1616,1618,1619,1621,1622,1624,1625,1627,1628,1630,1631,1632,1633, -1637,1638,1639,1640,1642,1643,1645,1646,1648,1649,1651,1652,1654,1655,1656,1657, -1660,1661,1663,1664,1666,1667,1669,1670,1672,1673,1675,1676,1678,1679,1681,1682, -1685,1686,1688,1689,1691,1692,1694,1695,1697,1698,1700,1701,1703,1704,1706,1707, -1709,1710,1712,1713,1715,1716,1718,1719,1721,1722,1724,1725,1727,1728,1730,1731, -1734,1735,1737,1738,1740,1741,1743,1744,1746,1748,1749,1751,1752,1754,1755,1757, -1759,1760,1762,1763,1765,1766,1768,1769,1771,1773,1774,1776,1777,1779,1780,1782, -1785,1786,1788,1789,1791,1793,1794,1796,1798,1799,1801,1802,1804,1806,1807,1809, -1811,1812,1814,1815,1817,1819,1820,1822,1824,1825,1827,1828,1830,1832,1833,1835, -1837,1838,1840,1841,1843,1845,1846,1848,1850,1851,1853,1854,1856,1858,1859,1861, -1864,1865,1867,1868,1870,1872,1873,1875,1877,1879,1880,1882,1884,1885,1887,1888, -1891,1892,1894,1895,1897,1899,1900,1902,1904,1906,1907,1909,1911,1912,1914,1915, -1918,1919,1921,1923,1925,1926,1928,1930,1932,1933,1935,1937,1939,1940,1942,1944, -1946,1947,1949,1951,1953,1954,1956,1958,1960,1961,1963,1965,1967,1968,1970,1972, -1975,1976,1978,1980,1982,1983,1985,1987,1989,1990,1992,1994,1996,1997,1999,2001, -2003,2004,2006,2008,2010,2011,2013,2015,2017,2019,2021,2022,2024,2026,2028,2029, -2032,2033,2035,2037,2039,2041,2043,2044,2047,2048,2050,2052,2054,2056,2058,2059, -2062,2063,2065,2067,2069,2071,2073,2074,2077,2078,2080,2082,2084,2086,2088,2089, -2092,2093,2095,2097,2099,2101,2103,2104,2107,2108,2110,2112,2114,2116,2118,2119, -2122,2123,2125,2127,2129,2131,2133,2134,2137,2139,2141,2142,2145,2146,2148,2150, -2153,2154,2156,2158,2160,2162,2164,2165,2168,2170,2172,2173,2176,2177,2179,2181, -2185,2186,2188,2190,2192,2194,2196,2197,2200,2202,2204,2205,2208,2209,2211,2213, -2216,2218,2220,2222,2223,2226,2227,2230,2232,2234,2236,2238,2239,2242,2243,2246, -2249,2251,2253,2255,2256,2259,2260,2263,2265,2267,2269,2271,2272,2275,2276,2279, -2281,2283,2285,2287,2288,2291,2292,2295,2297,2299,2301,2303,2304,2307,2308,2311, -2315,2317,2319,2321,2322,2325,2326,2329,2331,2333,2335,2337,2338,2341,2342,2345, -2348,2350,2352,2354,2355,2358,2359,2362,2364,2366,2368,2370,2371,2374,2375,2378, -2382,2384,2386,2388,2389,2392,2393,2396,2398,2400,2402,2404,2407,2410,2411,2414, -2417,2419,2421,2423,2424,2427,2428,2431,2433,2435,2437,2439,2442,2445,2446,2449, -2452,2454,2456,2458,2459,2462,2463,2466,2468,2470,2472,2474,2477,2480,2481,2484, -2488,2490,2492,2494,2495,2498,2499,2502,2504,2506,2508,2510,2513,2516,2517,2520, -2524,2526,2528,2530,2531,2534,2535,2538,2540,2542,2544,2546,2549,2552,2553,2556, -2561,2563,2565,2567,2568,2571,2572,2575,2577,2579,2581,2583,2586,2589,2590,2593 -}; - - -/* - Noise LFO waveform. - - Here are just 256 samples out of much longer data. - - It does NOT repeat every 256 samples on real chip and I wasnt able to find - the point where it repeats (even in strings as long as 131072 samples). - - I only put it here because its better than nothing and perhaps - someone might be able to figure out the real algorithm. - - - Note that (due to the way the LFO output is calculated) it is quite - possible that two values: 0x80 and 0x00 might be wrong in this table. - To be exact: - some 0x80 could be 0x81 as well as some 0x00 could be 0x01. -*/ - -static UINT8 lfo_noise_waveform[256] = { -0xFF,0xEE,0xD3,0x80,0x58,0xDA,0x7F,0x94,0x9E,0xE3,0xFA,0x00,0x4D,0xFA,0xFF,0x6A, -0x7A,0xDE,0x49,0xF6,0x00,0x33,0xBB,0x63,0x91,0x60,0x51,0xFF,0x00,0xD8,0x7F,0xDE, -0xDC,0x73,0x21,0x85,0xB2,0x9C,0x5D,0x24,0xCD,0x91,0x9E,0x76,0x7F,0x20,0xFB,0xF3, -0x00,0xA6,0x3E,0x42,0x27,0x69,0xAE,0x33,0x45,0x44,0x11,0x41,0x72,0x73,0xDF,0xA2, - -0x32,0xBD,0x7E,0xA8,0x13,0xEB,0xD3,0x15,0xDD,0xFB,0xC9,0x9D,0x61,0x2F,0xBE,0x9D, -0x23,0x65,0x51,0x6A,0x84,0xF9,0xC9,0xD7,0x23,0xBF,0x65,0x19,0xDC,0x03,0xF3,0x24, -0x33,0xB6,0x1E,0x57,0x5C,0xAC,0x25,0x89,0x4D,0xC5,0x9C,0x99,0x15,0x07,0xCF,0xBA, -0xC5,0x9B,0x15,0x4D,0x8D,0x2A,0x1E,0x1F,0xEA,0x2B,0x2F,0x64,0xA9,0x50,0x3D,0xAB, - -0x50,0x77,0xE9,0xC0,0xAC,0x6D,0x3F,0xCA,0xCF,0x71,0x7D,0x80,0xA6,0xFD,0xFF,0xB5, -0xBD,0x6F,0x24,0x7B,0x00,0x99,0x5D,0xB1,0x48,0xB0,0x28,0x7F,0x80,0xEC,0xBF,0x6F, -0x6E,0x39,0x90,0x42,0xD9,0x4E,0x2E,0x12,0x66,0xC8,0xCF,0x3B,0x3F,0x10,0x7D,0x79, -0x00,0xD3,0x1F,0x21,0x93,0x34,0xD7,0x19,0x22,0xA2,0x08,0x20,0xB9,0xB9,0xEF,0x51, - -0x99,0xDE,0xBF,0xD4,0x09,0x75,0xE9,0x8A,0xEE,0xFD,0xE4,0x4E,0x30,0x17,0xDF,0xCE, -0x11,0xB2,0x28,0x35,0xC2,0x7C,0x64,0xEB,0x91,0x5F,0x32,0x0C,0x6E,0x00,0xF9,0x92, -0x19,0xDB,0x8F,0xAB,0xAE,0xD6,0x12,0xC4,0x26,0x62,0xCE,0xCC,0x0A,0x03,0xE7,0xDD, -0xE2,0x4D,0x8A,0xA6,0x46,0x95,0x0F,0x8F,0xF5,0x15,0x97,0x32,0xD4,0x28,0x1E,0x55 -}; - - -static YM2151 * YMPSG = NULL; /* array of YM2151's */ -static unsigned int YMNumChips; /* total # of YM2151's emulated */ - - -/* these variables stay here for speedup purposes only */ -static YM2151 * PSG; -static signed int chanout[8]; -static signed int m2,c1,c2; /* Phase Modulation input for operators 2,3,4 */ -static signed int mem; /* one sample delay memory */ - - -/* save output as raw 16-bit sample */ -/* #define SAVE_SAMPLE */ -/* #define SAVE_SEPARATE_CHANNELS */ -#if defined SAVE_SAMPLE || defined SAVE_SEPARATE_CHANNELS -static FILE *sample[9]; -#endif - - -/* own PI definition */ -#ifdef PI - #undef PI -#endif -#define PI 3.14159265358979323846 - -static void init_tables(void) -{ - signed int i,x,n; - double o,m; - - for (x=0; x>= 4; /* 12 bits here */ - if (n&1) /* round to closest */ - n = (n>>1)+1; - else - n = n>>1; - /* 11 bits here (rounded) */ - n <<= 2; /* 13 bits here (as in real chip) */ - tl_tab[ x*2 + 0 ] = n; - tl_tab[ x*2 + 1 ] = -tl_tab[ x*2 + 0 ]; - - for (i=1; i<13; i++) - { - tl_tab[ x*2+0 + i*2*TL_RES_LEN ] = tl_tab[ x*2+0 ]>>i; - tl_tab[ x*2+1 + i*2*TL_RES_LEN ] = -tl_tab[ x*2+0 + i*2*TL_RES_LEN ]; - } - #if 0 - logerror("tl %04i", x*2); - for (i=0; i<13; i++) - logerror(", [%02i] %4i", i*2, tl_tab[ x*2 /*+1*/ + i*2*TL_RES_LEN ]); - logerror("\n"); - #endif - } - /*logerror("TL_TAB_LEN = %i (%i bytes)\n",TL_TAB_LEN, (int)sizeof(tl_tab));*/ - /*logerror("ENV_QUIET= %i\n",ENV_QUIET );*/ - - - for (i=0; i0.0) - o = 8*log(1.0/m)/log(2.0); /* convert to 'decibels' */ - else - o = 8*log(-1.0/m)/log(2.0); /* convert to 'decibels' */ - - o = o / (ENV_STEP/4); - - n = (int)(2.0*o); - if (n&1) /* round to closest */ - n = (n>>1)+1; - else - n = n>>1; - - sin_tab[ i ] = n*2 + (m>=0.0? 0: 1 ); - /*logerror("sin [0x%4x]= %4i (tl_tab value=%8x)\n", i, sin_tab[i],tl_tab[sin_tab[i]]);*/ - } - - - /* calculate d1l_tab table */ - for (i=0; i<16; i++) - { - m = (i!=15 ? i : i+16) * (4.0/ENV_STEP); /* every 3 'dB' except for all bits = 1 = 45+48 'dB' */ - d1l_tab[i] = m; - /*logerror("d1l_tab[%02x]=%08x\n",i,d1l_tab[i] );*/ - } - -#ifdef SAVE_SAMPLE - sample[8]=fopen("sampsum.pcm","wb"); -#endif -#ifdef SAVE_SEPARATE_CHANNELS - sample[0]=fopen("samp0.pcm","wb"); - sample[1]=fopen("samp1.pcm","wb"); - sample[2]=fopen("samp2.pcm","wb"); - sample[3]=fopen("samp3.pcm","wb"); - sample[4]=fopen("samp4.pcm","wb"); - sample[5]=fopen("samp5.pcm","wb"); - sample[6]=fopen("samp6.pcm","wb"); - sample[7]=fopen("samp7.pcm","wb"); -#endif -} - - -static void init_chip_tables(YM2151 *chip) -{ - int i,j; - double mult,pom,phaseinc,Hz; - double scaler; - - scaler = ( (double)chip->clock / 64.0 ) / ( (double)chip->sampfreq ); - /*logerror("scaler = %20.15f\n", scaler);*/ - - - /* this loop calculates Hertz values for notes from c-0 to b-7 */ - /* including 64 'cents' (100/64 that is 1.5625 of real cent) per note */ - /* i*100/64/1200 is equal to i/768 */ - - /* real chip works with 10 bits fixed point values (10.10) */ - mult = (1<<(FREQ_SH-10)); /* -10 because phaseinc_rom table values are already in 10.10 format */ - - for (i=0; i<768; i++) - { - /* 3.4375 Hz is note A; C# is 4 semitones higher */ - Hz = 1000; -#if 0 -/* Hz is close, but not perfect */ - //Hz = scaler * 3.4375 * pow (2, (i + 4 * 64 ) / 768.0 ); - /* calculate phase increment */ - phaseinc = (Hz*SIN_LEN) / (double)chip->sampfreq; -#endif - - phaseinc = phaseinc_rom[i]; /* real chip phase increment */ - phaseinc *= scaler; /* adjust */ - - - /* octave 2 - reference octave */ - chip->freq[ 768+2*768+i ] = ((int)(phaseinc*mult)) & 0xffffffc0; /* adjust to X.10 fixed point */ - /* octave 0 and octave 1 */ - for (j=0; j<2; j++) - { - chip->freq[768 + j*768 + i] = (chip->freq[ 768+2*768+i ] >> (2-j) ) & 0xffffffc0; /* adjust to X.10 fixed point */ - } - /* octave 3 to 7 */ - for (j=3; j<8; j++) - { - chip->freq[768 + j*768 + i] = chip->freq[ 768+2*768+i ] << (j-2); - } - - #if 0 - pom = (double)chip->freq[ 768+2*768+i ] / ((double)(1<sampfreq / (double)SIN_LEN; - logerror("1freq[%4i][%08x]= real %20.15f Hz emul %20.15f Hz\n", i, chip->freq[ 768+2*768+i ], Hz, pom); - #endif - } - - /* octave -1 (all equal to: oct 0, _KC_00_, _KF_00_) */ - for (i=0; i<768; i++) - { - chip->freq[ 0*768 + i ] = chip->freq[1*768+0]; - } - - /* octave 8 and 9 (all equal to: oct 7, _KC_14_, _KF_63_) */ - for (j=8; j<10; j++) - { - for (i=0; i<768; i++) - { - chip->freq[768+ j*768 + i ] = chip->freq[768 + 8*768 -1]; - } - } - -#if 0 - for (i=0; i<11*768; i++) - { - pom = (double)chip->freq[i] / ((double)(1<sampfreq / (double)SIN_LEN; - logerror("freq[%4i][%08x]= emul %20.15f Hz\n", i, chip->freq[i], pom); - } -#endif - - mult = (1<clock/64.0) ) / (double)(1<<20); - - /*calculate phase increment*/ - phaseinc = (Hz*SIN_LEN) / (double)chip->sampfreq; - - /*positive and negative values*/ - chip->dt1_freq[ (j+0)*32 + i ] = phaseinc * mult; - chip->dt1_freq[ (j+4)*32 + i ] = -chip->dt1_freq[ (j+0)*32 + i ]; - -#if 0 - { - int x = j*32 + i; - pom = (double)chip->dt1_freq[x] / mult; - pom = pom * (double)chip->sampfreq / (double)SIN_LEN; - logerror("DT1(%03i)[%02i %02i][%08x]= real %19.15f Hz emul %19.15f Hz\n", - x, j, i, chip->dt1_freq[x], Hz, pom); - } -#endif - } - } - - - /* calculate timers' deltas */ - /* User's Manual pages 15,16 */ - mult = (1<clock ); - #ifdef USE_MAME_TIMERS - chip->timer_A_time[i] = pom; - #else - chip->tim_A_tab[i] = pom * (double)chip->sampfreq * mult; /* number of samples that timer period takes (fixed point) */ - #endif - } - for (i=0; i<256; i++) - { - /* ASG 980324: changed to compute both tim_B_tab and timer_B_time */ - pom= ( 1024.0 * (256.0-i) / (double)chip->clock ); - #ifdef USE_MAME_TIMERS - chip->timer_B_time[i] = pom; - #else - chip->tim_B_tab[i] = pom * (double)chip->sampfreq * mult; /* number of samples that timer period takes (fixed point) */ - #endif - } - - /* calculate noise periods table */ - scaler = ( (double)chip->clock / 64.0 ) / ( (double)chip->sampfreq ); - for (i=0; i<32; i++) - { - j = (i!=31 ? i : 30); /* rate 30 and 31 are the same */ - j = 32-j; - j = (65536.0 / (double)(j*32.0)); /* number of samples per one shift of the shift register */ - /*chip->noise_tab[i] = j * 64;*/ /* number of chip clock cycles per one shift */ - chip->noise_tab[i] = j * 64 * scaler; - /*logerror("noise_tab[%02x]=%08x\n", i, chip->noise_tab[i]);*/ - } -} - -#define KEY_ON(op, key_set){ \ - if (!(op)->key) \ - { \ - (op)->phase = 0; /* clear phase */ \ - (op)->state = EG_ATT; /* KEY ON = attack */ \ - (op)->volume += (~(op)->volume * \ - (eg_inc[(op)->eg_sel_ar + ((PSG->eg_cnt>>(op)->eg_sh_ar)&7)]) \ - ) >>4; \ - if ((op)->volume <= MIN_ATT_INDEX) \ - { \ - (op)->volume = MIN_ATT_INDEX; \ - (op)->state = EG_DEC; \ - } \ - } \ - (op)->key |= key_set; \ -} - -#define KEY_OFF(op, key_clr){ \ - if ((op)->key) \ - { \ - (op)->key &= key_clr; \ - if (!(op)->key) \ - { \ - if ((op)->state>EG_REL) \ - (op)->state = EG_REL;/* KEY OFF = release */\ - } \ - } \ -} - -INLINE void envelope_KONKOFF(YM2151Operator * op, int v) -{ - if (v&0x08) /* M1 */ - KEY_ON (op+0, 1) - else - KEY_OFF(op+0,~1) - - if (v&0x20) /* M2 */ - KEY_ON (op+1, 1) - else - KEY_OFF(op+1,~1) - - if (v&0x10) /* C1 */ - KEY_ON (op+2, 1) - else - KEY_OFF(op+2,~1) - - if (v&0x40) /* C2 */ - KEY_ON (op+3, 1) - else - KEY_OFF(op+3,~1) -} - - -#ifdef USE_MAME_TIMERS -static void timer_callback_a (int n) -{ - YM2151 *chip = &YMPSG[n]; - timer_adjust(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], n, 0); - chip->timer_A_index_old = chip->timer_A_index; - if (chip->irq_enable & 0x04) - { - int oldstate = chip->status & 3; - chip->status |= 1; - if ((!oldstate) && (chip->irqhandler)) (*chip->irqhandler)(1); - } - if (chip->irq_enable & 0x80) - chip->csm_req = 2; /* request KEY ON / KEY OFF sequence */ -} -static void timer_callback_b (int n) -{ - YM2151 *chip = &YMPSG[n]; - timer_adjust(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], n, 0); - chip->timer_B_index_old = chip->timer_B_index; - if (chip->irq_enable & 0x08) - { - int oldstate = chip->status & 3; - chip->status |= 2; - if ((!oldstate) && (chip->irqhandler)) (*chip->irqhandler)(1); - } -} -#if 0 -static void timer_callback_chip_busy (int n) -{ - YM2151 *chip = &YMPSG[n]; - chip->status &= 0x7f; /* reset busy flag */ -} -#endif -#endif - - - - - - -INLINE void set_connect( YM2151Operator *om1, int cha, int v) -{ - YM2151Operator *om2 = om1+1; - YM2151Operator *oc1 = om1+2; - - /* set connect algorithm */ - - /* MEM is simply one sample delay */ - - switch( v&7 ) - { - case 0: - /* M1---C1---MEM---M2---C2---OUT */ - om1->connect = &c1; - oc1->connect = &mem; - om2->connect = &c2; - om1->mem_connect = &m2; - break; - - case 1: - /* M1------+-MEM---M2---C2---OUT */ - /* C1-+ */ - om1->connect = &mem; - oc1->connect = &mem; - om2->connect = &c2; - om1->mem_connect = &m2; - break; - - case 2: - /* M1-----------------+-C2---OUT */ - /* C1---MEM---M2-+ */ - om1->connect = &c2; - oc1->connect = &mem; - om2->connect = &c2; - om1->mem_connect = &m2; - break; - - case 3: - /* M1---C1---MEM------+-C2---OUT */ - /* M2-+ */ - om1->connect = &c1; - oc1->connect = &mem; - om2->connect = &c2; - om1->mem_connect = &c2; - break; - - case 4: - /* M1---C1-+-OUT */ - /* M2---C2-+ */ - /* MEM: not used */ - om1->connect = &c1; - oc1->connect = &chanout[cha]; - om2->connect = &c2; - om1->mem_connect = &mem; /* store it anywhere where it will not be used */ - break; - - case 5: - /* +----C1----+ */ - /* M1-+-MEM---M2-+-OUT */ - /* +----C2----+ */ - om1->connect = 0; /* special mark */ - oc1->connect = &chanout[cha]; - om2->connect = &chanout[cha]; - om1->mem_connect = &m2; - break; - - case 6: - /* M1---C1-+ */ - /* M2-+-OUT */ - /* C2-+ */ - /* MEM: not used */ - om1->connect = &c1; - oc1->connect = &chanout[cha]; - om2->connect = &chanout[cha]; - om1->mem_connect = &mem; /* store it anywhere where it will not be used */ - break; - - case 7: - /* M1-+ */ - /* C1-+-OUT */ - /* M2-+ */ - /* C2-+ */ - /* MEM: not used*/ - om1->connect = &chanout[cha]; - oc1->connect = &chanout[cha]; - om2->connect = &chanout[cha]; - om1->mem_connect = &mem; /* store it anywhere where it will not be used */ - break; - } -} - - -INLINE void refresh_EG(YM2151Operator * op) -{ - UINT32 kc; - UINT32 v; - - kc = op->kc; - - /* v = 32 + 2*RATE + RKS = max 126 */ - - v = kc >> op->ks; - if ((op->ar+v) < 32+62) - { - op->eg_sh_ar = eg_rate_shift [op->ar + v ]; - op->eg_sel_ar = eg_rate_select[op->ar + v ]; - } - else - { - op->eg_sh_ar = 0; - op->eg_sel_ar = 17*RATE_STEPS; - } - op->eg_sh_d1r = eg_rate_shift [op->d1r + v]; - op->eg_sel_d1r= eg_rate_select[op->d1r + v]; - op->eg_sh_d2r = eg_rate_shift [op->d2r + v]; - op->eg_sel_d2r= eg_rate_select[op->d2r + v]; - op->eg_sh_rr = eg_rate_shift [op->rr + v]; - op->eg_sel_rr = eg_rate_select[op->rr + v]; - - - op+=1; - - v = kc >> op->ks; - if ((op->ar+v) < 32+62) - { - op->eg_sh_ar = eg_rate_shift [op->ar + v ]; - op->eg_sel_ar = eg_rate_select[op->ar + v ]; - } - else - { - op->eg_sh_ar = 0; - op->eg_sel_ar = 17*RATE_STEPS; - } - op->eg_sh_d1r = eg_rate_shift [op->d1r + v]; - op->eg_sel_d1r= eg_rate_select[op->d1r + v]; - op->eg_sh_d2r = eg_rate_shift [op->d2r + v]; - op->eg_sel_d2r= eg_rate_select[op->d2r + v]; - op->eg_sh_rr = eg_rate_shift [op->rr + v]; - op->eg_sel_rr = eg_rate_select[op->rr + v]; - - op+=1; - - v = kc >> op->ks; - if ((op->ar+v) < 32+62) - { - op->eg_sh_ar = eg_rate_shift [op->ar + v ]; - op->eg_sel_ar = eg_rate_select[op->ar + v ]; - } - else - { - op->eg_sh_ar = 0; - op->eg_sel_ar = 17*RATE_STEPS; - } - op->eg_sh_d1r = eg_rate_shift [op->d1r + v]; - op->eg_sel_d1r= eg_rate_select[op->d1r + v]; - op->eg_sh_d2r = eg_rate_shift [op->d2r + v]; - op->eg_sel_d2r= eg_rate_select[op->d2r + v]; - op->eg_sh_rr = eg_rate_shift [op->rr + v]; - op->eg_sel_rr = eg_rate_select[op->rr + v]; - - op+=1; - - v = kc >> op->ks; - if ((op->ar+v) < 32+62) - { - op->eg_sh_ar = eg_rate_shift [op->ar + v ]; - op->eg_sel_ar = eg_rate_select[op->ar + v ]; - } - else - { - op->eg_sh_ar = 0; - op->eg_sel_ar = 17*RATE_STEPS; - } - op->eg_sh_d1r = eg_rate_shift [op->d1r + v]; - op->eg_sel_d1r= eg_rate_select[op->d1r + v]; - op->eg_sh_d2r = eg_rate_shift [op->d2r + v]; - op->eg_sel_d2r= eg_rate_select[op->d2r + v]; - op->eg_sh_rr = eg_rate_shift [op->rr + v]; - op->eg_sel_rr = eg_rate_select[op->rr + v]; -} - - -/* write a register on YM2151 chip number 'n' */ -void YM2151WriteReg(int n, int r, int v) -{ - YM2151 *chip = &YMPSG[n]; - YM2151Operator *op = &chip->oper[ (r&0x07)*4+((r&0x18)>>3) ]; - - /* adjust bus to 8 bits */ - r &= 0xff; - v &= 0xff; - -#if 0 - /* There is no info on what YM2151 really does when busy flag is set */ - if ( chip->status & 0x80 ) return; - timer_set ( 64.0 / (double)chip->clock, n, timer_callback_chip_busy); - chip->status |= 0x80; /* set busy flag for 64 chip clock cycles */ -#endif - -#ifdef LOG_CYM_FILE - if ((cymfile) && (r!=0) ) - { - fputc( (unsigned char)r, cymfile ); - fputc( (unsigned char)v, cymfile ); - } -#endif - - - switch(r & 0xe0){ - case 0x00: - switch(r){ - case 0x01: /* LFO reset(bit 1), Test Register (other bits) */ - chip->test = v; - if (v&2) chip->lfo_phase = 0; - break; - - case 0x08: - PSG = &YMPSG[n]; /* PSG is used in KEY_ON macro */ - envelope_KONKOFF(&chip->oper[ (v&7)*4 ], v ); - break; - - case 0x0f: /* noise mode enable, noise period */ - chip->noise = v; - chip->noise_f = chip->noise_tab[ v & 0x1f ]; - break; - - case 0x10: /* timer A hi */ - chip->timer_A_index = (chip->timer_A_index & 0x003) | (v<<2); - break; - - case 0x11: /* timer A low */ - chip->timer_A_index = (chip->timer_A_index & 0x3fc) | (v & 3); - break; - - case 0x12: /* timer B */ - chip->timer_B_index = v; - break; - - case 0x14: /* CSM, irq flag reset, irq enable, timer start/stop */ - - chip->irq_enable = v; /* bit 3-timer B, bit 2-timer A, bit 7 - CSM */ - - if (v&0x20) /* reset timer B irq flag */ - { - int oldstate = chip->status & 3; - chip->status &= 0xfd; - if ((oldstate==2) && (chip->irqhandler)) (*chip->irqhandler)(0); - } - - if (v&0x10) /* reset timer A irq flag */ - { - int oldstate = chip->status & 3; - chip->status &= 0xfe; - if ((oldstate==1) && (chip->irqhandler)) (*chip->irqhandler)(0); - - } - - if (v&0x02){ /* load and start timer B */ - #ifdef USE_MAME_TIMERS - /* ASG 980324: added a real timer */ - /* start timer _only_ if it wasn't already started (it will reload time value next round) */ - if (!timer_enable(chip->timer_B, 1)) - { - timer_adjust(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], n, 0); - chip->timer_B_index_old = chip->timer_B_index; - } - #else - if (!chip->tim_B) - { - chip->tim_B = 1; - chip->tim_B_val = chip->tim_B_tab[ chip->timer_B_index ]; - } - #endif - }else{ /* stop timer B */ - #ifdef USE_MAME_TIMERS - /* ASG 980324: added a real timer */ - timer_enable(chip->timer_B, 0); - #else - chip->tim_B = 0; - #endif - } - - if (v&0x01){ /* load and start timer A */ - #ifdef USE_MAME_TIMERS - /* ASG 980324: added a real timer */ - /* start timer _only_ if it wasn't already started (it will reload time value next round) */ - if (!timer_enable(chip->timer_A, 1)) - { - timer_adjust(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], n, 0); - chip->timer_A_index_old = chip->timer_A_index; - } - #else - if (!chip->tim_A) - { - chip->tim_A = 1; - chip->tim_A_val = chip->tim_A_tab[ chip->timer_A_index ]; - } - #endif - }else{ /* stop timer A */ - #ifdef USE_MAME_TIMERS - /* ASG 980324: added a real timer */ - timer_enable(chip->timer_A, 0); - #else - chip->tim_A = 0; - #endif - } - break; - - case 0x18: /* LFO frequency */ - { - chip->lfo_overflow = ( 1 << ((15-(v>>4))+3) ) * (1<lfo_counter_add = 0x10 + (v & 0x0f); - } - break; - - case 0x19: /* PMD (bit 7==1) or AMD (bit 7==0) */ - if (v&0x80) - chip->pmd = v & 0x7f; - else - chip->amd = v & 0x7f; - break; - - case 0x1b: /* CT2, CT1, LFO waveform */ - chip->ct = v >> 6; - chip->lfo_wsel = v & 3; - if (chip->porthandler) (*chip->porthandler)(0 , chip->ct ); - break; - - default: - logerror("YM2151 Write %02x to undocumented register #%02x\n",v,r); - break; - } - break; - - case 0x20: -// bprintf(0, _T("%X: %X %X.\n"), n, r, v); - op = &chip->oper[ (r&7) * 4 ]; - switch(r & 0x18){ - case 0x00: /* RL enable, Feedback, Connection */ - op->fb_shift = ((v>>3)&7) ? ((v>>3)&7)+6:0; - chip->pan[ (r&7)*2 ] = (v & 0x40) ? ~0 : 0; - chip->pan[ (r&7)*2 +1 ] = (v & 0x80) ? ~0 : 0; - chip->connect[r&7] = v&7; - set_connect(op, r&7, v&7); - break; - - case 0x08: /* Key Code */ - v &= 0x7f; - if (v != op->kc) - { - UINT32 kc, kc_channel; - - kc_channel = (v - (v>>2))*64; - kc_channel += 768; - kc_channel |= (op->kc_i & 63); - - (op+0)->kc = v; - (op+0)->kc_i = kc_channel; - (op+1)->kc = v; - (op+1)->kc_i = kc_channel; - (op+2)->kc = v; - (op+2)->kc_i = kc_channel; - (op+3)->kc = v; - (op+3)->kc_i = kc_channel; - - kc = v>>2; - - (op+0)->dt1 = chip->dt1_freq[ (op+0)->dt1_i + kc ]; - (op+0)->freq = ( (chip->freq[ kc_channel + (op+0)->dt2 ] + (op+0)->dt1) * (op+0)->mul ) >> 1; - - (op+1)->dt1 = chip->dt1_freq[ (op+1)->dt1_i + kc ]; - (op+1)->freq = ( (chip->freq[ kc_channel + (op+1)->dt2 ] + (op+1)->dt1) * (op+1)->mul ) >> 1; - - (op+2)->dt1 = chip->dt1_freq[ (op+2)->dt1_i + kc ]; - (op+2)->freq = ( (chip->freq[ kc_channel + (op+2)->dt2 ] + (op+2)->dt1) * (op+2)->mul ) >> 1; - - (op+3)->dt1 = chip->dt1_freq[ (op+3)->dt1_i + kc ]; - (op+3)->freq = ( (chip->freq[ kc_channel + (op+3)->dt2 ] + (op+3)->dt1) * (op+3)->mul ) >> 1; - - refresh_EG( op ); - } - break; - - case 0x10: /* Key Fraction */ - v >>= 2; - if (v != (op->kc_i & 63)) - { - UINT32 kc_channel; - - kc_channel = v; - kc_channel |= (op->kc_i & ~63); - - (op+0)->kc_i = kc_channel; - (op+1)->kc_i = kc_channel; - (op+2)->kc_i = kc_channel; - (op+3)->kc_i = kc_channel; - - (op+0)->freq = ( (chip->freq[ kc_channel + (op+0)->dt2 ] + (op+0)->dt1) * (op+0)->mul ) >> 1; - (op+1)->freq = ( (chip->freq[ kc_channel + (op+1)->dt2 ] + (op+1)->dt1) * (op+1)->mul ) >> 1; - (op+2)->freq = ( (chip->freq[ kc_channel + (op+2)->dt2 ] + (op+2)->dt1) * (op+2)->mul ) >> 1; - (op+3)->freq = ( (chip->freq[ kc_channel + (op+3)->dt2 ] + (op+3)->dt1) * (op+3)->mul ) >> 1; - } - break; - - case 0x18: /* PMS, AMS */ - op->pms = (v>>4) & 7; - op->ams = (v & 3); - break; - } - break; - - case 0x40: /* DT1, MUL */ - { - UINT32 olddt1_i = op->dt1_i; - UINT32 oldmul = op->mul; - - op->dt1_i = (v&0x70)<<1; - op->mul = (v&0x0f) ? (v&0x0f)<<1: 1; - - if (olddt1_i != op->dt1_i) - op->dt1 = chip->dt1_freq[ op->dt1_i + (op->kc>>2) ]; - - if ( (olddt1_i != op->dt1_i) || (oldmul != op->mul) ) - op->freq = ( (chip->freq[ op->kc_i + op->dt2 ] + op->dt1) * op->mul ) >> 1; - } - break; - - case 0x60: /* TL */ - op->tl = (v&0x7f)<<(ENV_BITS-7); /* 7bit TL */ - break; - - case 0x80: /* KS, AR */ - { - UINT32 oldks = op->ks; - UINT32 oldar = op->ar; - - op->ks = 5-(v>>6); - op->ar = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; - - if ( (op->ar != oldar) || (op->ks != oldks) ) - { - if ((op->ar + (op->kc>>op->ks)) < 32+62) - { - op->eg_sh_ar = eg_rate_shift [op->ar + (op->kc>>op->ks) ]; - op->eg_sel_ar = eg_rate_select[op->ar + (op->kc>>op->ks) ]; - } - else - { - op->eg_sh_ar = 0; - op->eg_sel_ar = 17*RATE_STEPS; - } - } - - if (op->ks != oldks) - { - op->eg_sh_d1r = eg_rate_shift [op->d1r + (op->kc>>op->ks) ]; - op->eg_sel_d1r= eg_rate_select[op->d1r + (op->kc>>op->ks) ]; - op->eg_sh_d2r = eg_rate_shift [op->d2r + (op->kc>>op->ks) ]; - op->eg_sel_d2r= eg_rate_select[op->d2r + (op->kc>>op->ks) ]; - op->eg_sh_rr = eg_rate_shift [op->rr + (op->kc>>op->ks) ]; - op->eg_sel_rr = eg_rate_select[op->rr + (op->kc>>op->ks) ]; - } - } - break; - - case 0xa0: /* LFO AM enable, D1R */ - op->AMmask = (v&0x80) ? ~0 : 0; - op->d1r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; - op->eg_sh_d1r = eg_rate_shift [op->d1r + (op->kc>>op->ks) ]; - op->eg_sel_d1r= eg_rate_select[op->d1r + (op->kc>>op->ks) ]; - break; - - case 0xc0: /* DT2, D2R */ - { - UINT32 olddt2 = op->dt2; - op->dt2 = dt2_tab[ v>>6 ]; - if (op->dt2 != olddt2) - op->freq = ( (chip->freq[ op->kc_i + op->dt2 ] + op->dt1) * op->mul ) >> 1; - } - op->d2r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; - op->eg_sh_d2r = eg_rate_shift [op->d2r + (op->kc>>op->ks) ]; - op->eg_sel_d2r= eg_rate_select[op->d2r + (op->kc>>op->ks) ]; - break; - - case 0xe0: /* D1L, RR */ - op->d1l = d1l_tab[ v>>4 ]; - op->rr = 34 + ((v&0x0f)<<2); - op->eg_sh_rr = eg_rate_shift [op->rr + (op->kc>>op->ks) ]; - op->eg_sel_rr = eg_rate_select[op->rr + (op->kc>>op->ks) ]; - break; - } -} - - -#ifdef LOG_CYM_FILE -static void cymfile_callback (int n) -{ - if (cymfile) - fputc( (unsigned char)0, cymfile ); -} -#endif - - -int YM2151ReadStatus( int n ) -{ - return YMPSG[n].status; -} - - - -//#ifdef USE_MAME_TIMERS -#if 0 // disabled for now due to crashing in debug+map+symbols build -/* -* state save support for MAME -*/ -static void ym2151_postload_refresh(void) -{ - int i,j; - - for (i=0; i>3)]; - - state_save_register_UINT32 (buf1, i, "phase", &op->phase, 1); - state_save_register_UINT32 (buf1, i, "freq" , &op->freq, 1); - state_save_register_INT32 (buf1, i, "dt1" , &op->dt1, 1); - state_save_register_UINT32 (buf1, i, "mul" , &op->mul, 1); - state_save_register_UINT32 (buf1, i, "dt1_i", &op->dt1_i, 1); - state_save_register_UINT32 (buf1, i, "dt2" , &op->dt2, 1); - /* operators connection is saved in chip data block */ - state_save_register_INT32 (buf1, i, "mem_v" ,&op->mem_value,1); - - state_save_register_UINT32 (buf1, i, "fb_sh", &op->fb_shift, 1); - state_save_register_INT32 (buf1, i, "fb_c" , &op->fb_out_curr,1); - state_save_register_INT32 (buf1, i, "fb_p" , &op->fb_out_prev,1); - state_save_register_UINT32 (buf1, i, "kc" , &op->kc, 1); - state_save_register_UINT32 (buf1, i, "kc_i" , &op->kc_i, 1); - state_save_register_UINT32 (buf1, i, "pms" , &op->pms, 1); - state_save_register_UINT32 (buf1, i, "ams" , &op->ams, 1); - state_save_register_UINT32 (buf1, i, "AMmask",&op->AMmask,1); - - state_save_register_UINT32 (buf1, i, "state" ,&op->state, 1); - state_save_register_UINT8 (buf1, i, "e_shAR",&op->eg_sh_ar, 1); - state_save_register_UINT8 (buf1, i, "e_slAR",&op->eg_sel_ar, 1); - state_save_register_UINT32 (buf1, i, "tl" ,&op->tl, 1); - state_save_register_INT32 (buf1, i, "volume",&op->volume, 1); - state_save_register_UINT8 (buf1, i, "e_shD1",&op->eg_sh_d1r, 1); - state_save_register_UINT8 (buf1, i, "e_slD1",&op->eg_sel_d1r,1); - state_save_register_UINT32 (buf1, i, "d1l" ,&op->d1l, 1); - state_save_register_UINT8 (buf1, i, "e_shD2",&op->eg_sh_d2r, 1); - state_save_register_UINT8 (buf1, i, "e_slD2",&op->eg_sel_d2r,1); - state_save_register_UINT8 (buf1, i, "e_shRR",&op->eg_sh_rr, 1); - state_save_register_UINT8 (buf1, i, "e_slRR",&op->eg_sel_rr, 1); - - state_save_register_UINT32 (buf1, i, "key" ,&op->key, 1); - state_save_register_UINT32 (buf1, i, "ks" ,&op->ks, 1); - state_save_register_UINT32 (buf1, i, "ar" ,&op->ar, 1); - state_save_register_UINT32 (buf1, i, "d1r" ,&op->d1r, 1); - state_save_register_UINT32 (buf1, i, "d2r" ,&op->d2r, 1); - state_save_register_UINT32 (buf1, i, "rr" ,&op->rr, 1); - - state_save_register_UINT32 (buf1, i, "rsrvd0",&op->reserved0, 1); - state_save_register_UINT32 (buf1, i, "rsrvd1",&op->reserved1, 1); - } - - sprintf(buf1,"YM2151.registers"); - - state_save_register_UINT32 (buf1, i, "pan" , &YMPSG[i].pan[0], 16); - - state_save_register_UINT32 (buf1, i, "eg_cnt" , &YMPSG[i].eg_cnt, 1); - state_save_register_UINT32 (buf1, i, "eg_tmr" , &YMPSG[i].eg_timer, 1); - state_save_register_UINT32 (buf1, i, "eg_tmra" , &YMPSG[i].eg_timer_add, 1); - state_save_register_UINT32 (buf1, i, "eg_ovr" , &YMPSG[i].eg_timer_overflow,1); - - state_save_register_UINT32 (buf1, i, "lfo_phas", &YMPSG[i].lfo_phase, 1); - state_save_register_UINT32 (buf1, i, "lfo_tmr" , &YMPSG[i].lfo_timer, 1); - state_save_register_UINT32 (buf1, i, "lfo_tmra", &YMPSG[i].lfo_timer_add, 1); - state_save_register_UINT32 (buf1, i, "lfo_ovr" , &YMPSG[i].lfo_overflow, 1); - state_save_register_UINT32 (buf1, i, "lfo_ctr" , &YMPSG[i].lfo_counter, 1); - state_save_register_UINT32 (buf1, i, "lfo_ctra", &YMPSG[i].lfo_counter_add,1); - state_save_register_UINT8 (buf1, i, "lfo_wsel", &YMPSG[i].lfo_wsel, 1); - state_save_register_UINT8 (buf1, i, "amd" , &YMPSG[i].amd, 1); - state_save_register_INT8 (buf1, i, "pmd" , &YMPSG[i].pmd, 1); - state_save_register_UINT32 (buf1, i, "lfa" , &YMPSG[i].lfa, 1); - state_save_register_INT32 (buf1, i, "lfp" , &YMPSG[i].lfp, 1); - - state_save_register_UINT8 (buf1, i, "test" , &YMPSG[i].test,1); - state_save_register_UINT8 (buf1, i, "ct" , &YMPSG[i].ct, 1); - - state_save_register_UINT32 (buf1, i, "noise" , &YMPSG[i].noise, 1); - state_save_register_UINT32 (buf1, i, "noiseRNG", &YMPSG[i].noise_rng, 1); - state_save_register_UINT32 (buf1, i, "noise_p" , &YMPSG[i].noise_p, 1); - state_save_register_UINT32 (buf1, i, "noise_f" , &YMPSG[i].noise_f, 1); - - state_save_register_UINT32 (buf1, i, "csm_req" , &YMPSG[i].csm_req, 1); - state_save_register_UINT32 (buf1, i, "irq_ena" , &YMPSG[i].irq_enable,1); - state_save_register_UINT32 (buf1, i, "status" , &YMPSG[i].status, 1); - - state_save_register_UINT32 (buf1, i, "TimAind" , &YMPSG[i].timer_A_index, 1); - state_save_register_UINT32 (buf1, i, "TimBind" , &YMPSG[i].timer_B_index, 1); - state_save_register_UINT32 (buf1, i, "TimAold" , &YMPSG[i].timer_A_index_old, 1); - state_save_register_UINT32 (buf1, i, "TimBold" , &YMPSG[i].timer_B_index_old, 1); - - state_save_register_UINT8 (buf1, i, "connect" , &YMPSG[i].connect[0], 8); - } - - state_save_register_func_postload(ym2151_postload_refresh); -} -#else -static void ym2151_state_save_register( int numchips ) -{ -} -#endif - -static void ym2151_postload_refresh(void) -{ - int i,j; - - for (i=0; i>3)]; - - SCAN_VAR(op->phase); - SCAN_VAR(op->freq); - SCAN_VAR(op->dt1); - SCAN_VAR(op->mul); - SCAN_VAR(op->dt1_i); - SCAN_VAR(op->dt2); - SCAN_VAR(op->mem_value); - - SCAN_VAR(op->fb_shift); - SCAN_VAR(op->fb_out_curr); - SCAN_VAR(op->fb_out_prev); - SCAN_VAR(op->kc); - SCAN_VAR(op->kc_i); - SCAN_VAR(op->pms); - SCAN_VAR(op->ams); - SCAN_VAR(op->AMmask); - - SCAN_VAR(op->state); - SCAN_VAR(op->eg_sh_ar); - SCAN_VAR(op->eg_sel_ar); - SCAN_VAR(op->tl); - SCAN_VAR(op->volume); - SCAN_VAR(op->eg_sh_d1r); - SCAN_VAR(op->eg_sel_d1r); - SCAN_VAR(op->d1l); - SCAN_VAR(op->eg_sh_d2r); - SCAN_VAR(op->eg_sel_d2r); - SCAN_VAR(op->eg_sh_rr); - SCAN_VAR(op->eg_sel_rr); - - SCAN_VAR(op->key); - SCAN_VAR(op->ks); - SCAN_VAR(op->ar); - SCAN_VAR(op->d1r); - SCAN_VAR(op->d2r); - SCAN_VAR(op->rr); - - SCAN_VAR(op->reserved0); - SCAN_VAR(op->reserved1); - } - - //sprintf(buf1,"YM2151.registers"); - SCAN_VAR(YMPSG[i].pan); - - SCAN_VAR(YMPSG[i].eg_cnt); - //SCAN_VAR(YMPSG[i].eg_timer); - YMPSG[i].eg_timer = 0; - //SCAN_VAR(YMPSG[i].eg_timer_add); - SCAN_VAR(YMPSG[i].eg_timer_overflow); - - //SCAN_VAR(YMPSG[i].lfo_phase); - //SCAN_VAR(YMPSG[i].lfo_timer); - YMPSG[i].lfo_timer = 0; - YMPSG[i].lfo_phase = 0; - //SCAN_VAR(YMPSG[i].lfo_timer_add); - SCAN_VAR(YMPSG[i].lfo_overflow); - SCAN_VAR(YMPSG[i].lfo_counter); - SCAN_VAR(YMPSG[i].lfo_counter_add); - SCAN_VAR(YMPSG[i].lfo_wsel); - SCAN_VAR(YMPSG[i].amd); - SCAN_VAR(YMPSG[i].pmd); - SCAN_VAR(YMPSG[i].lfa); - SCAN_VAR(YMPSG[i].lfp); - - SCAN_VAR(YMPSG[i].test); - SCAN_VAR(YMPSG[i].ct); - - SCAN_VAR(YMPSG[i].noise); - SCAN_VAR(YMPSG[i].noise_rng); - SCAN_VAR(YMPSG[i].noise_p); - SCAN_VAR(YMPSG[i].noise_f); - - SCAN_VAR(YMPSG[i].csm_req); - SCAN_VAR(YMPSG[i].irq_enable); - SCAN_VAR(YMPSG[i].status); - - SCAN_VAR(YMPSG[i].timer_A_index); - SCAN_VAR(YMPSG[i].timer_B_index); - SCAN_VAR(YMPSG[i].timer_A_index_old); - SCAN_VAR(YMPSG[i].timer_B_index_old); - - SCAN_VAR(YMPSG[i].connect); - SCAN_VAR(YMPSG[i].tim_A); - SCAN_VAR(YMPSG[i].tim_B); - /*SCAN_VAR(YMPSG[i].tim_A_val); - SCAN_VAR(YMPSG[i].tim_B_val); - SCAN_VAR(YMPSG[i].tim_A_tab); - SCAN_VAR(YMPSG[i].tim_B_tab); - SCAN_VAR(YMPSG[i].freq); - SCAN_VAR(YMPSG[i].dt1_freq); - SCAN_VAR(YMPSG[i].noise_tab);*/ - if (nAction & ACB_WRITE) { - if (YMPSG[i].tim_B) { - YMPSG[i].tim_B_val = YMPSG[i].tim_B_tab[ YMPSG[i].timer_B_index ]; - } - if (YMPSG[i].tim_A) { - YMPSG[i].tim_A_val = YMPSG[i].tim_A_tab[ YMPSG[i].timer_A_index ]; - } - //init_chip_tables( &YMPSG[i] ); - - } - } -#if 0 - SCAN_VAR(chanout); - SCAN_VAR(m2); - SCAN_VAR(c1); - SCAN_VAR(c2); /* Phase Modulation input for operators 2,3,4 */ - SCAN_VAR(mem); /* one sample delay memory */ -#endif - if (nAction & ACB_WRITE) { - // state_save_register_func_postload(ym2151_postload_refresh); - ym2151_postload_refresh(); - } -} - - -/* -* Initialize YM2151 emulator(s). -* -* 'num' is the number of virtual YM2151's to allocate -* 'clock' is the chip clock in Hz -* 'rate' is sampling rate -*/ -int YM2151Init(int num, int clock, int rate) -{ - int i; - - if (YMPSG) - return -1; /* duplicate init. */ - - YMNumChips = num; - - YMPSG = (YM2151 *)malloc(sizeof(YM2151) * YMNumChips); - if (YMPSG == NULL) - return 1; - - memset(YMPSG, 0, sizeof(YM2151) * YMNumChips); - - ym2151_state_save_register( YMNumChips ); - - init_tables(); - - for (i=0 ; ioper[i],'\0',sizeof(YM2151Operator)); - chip->oper[i].volume = MAX_ATT_INDEX; - chip->oper[i].kc_i = 768; /* min kc_i value */ - } - - chip->eg_timer = 0; - chip->eg_cnt = 0; - - chip->lfo_timer = 0; - chip->lfo_counter= 0; - chip->lfo_phase = 0; - chip->lfo_wsel = 0; - chip->pmd = 0; - chip->amd = 0; - chip->lfa = 0; - chip->lfp = 0; - - chip->test= 0; - - chip->irq_enable = 0; -#ifdef USE_MAME_TIMERS - /* ASG 980324 -- reset the timers before writing to the registers */ - timer_enable(chip->timer_A, 0); - timer_enable(chip->timer_B, 0); -#else - chip->tim_A = 0; - chip->tim_B = 0; - chip->tim_A_val = 0; - chip->tim_B_val = 0; -#endif - chip->timer_A_index = 0; - chip->timer_B_index = 0; - chip->timer_A_index_old = 0; - chip->timer_B_index_old = 0; - - chip->noise = 0; - chip->noise_rng = 0; - chip->noise_p = 0; - chip->noise_f = chip->noise_tab[0]; - - chip->csm_req = 0; - chip->status = 0; - - YM2151WriteReg(num, 0x1b, 0); /* only because of CT1, CT2 output pins */ - YM2151WriteReg(num, 0x18, 0); /* set LFO frequency */ - for (i=0x20; i<0x100; i++) /* set the operators */ - { - YM2151WriteReg(num, i, 0); - } -} - - - -INLINE signed int op_calc(YM2151Operator * OP, unsigned int env, signed int pm) -{ - UINT32 p; - - - p = (env<<3) + sin_tab[ ( ((signed int)((OP->phase & ~FREQ_MASK) + (pm<<15))) >> FREQ_SH ) & SIN_MASK ]; - - if (p >= TL_TAB_LEN) - return 0; - - return tl_tab[p]; -} - -INLINE signed int op_calc1(YM2151Operator * OP, unsigned int env, signed int pm) -{ - UINT32 p; - INT32 i; - - - i = (OP->phase & ~FREQ_MASK) + pm; - -/*logerror("i=%08x (i>>16)&511=%8i phase=%i [pm=%08x] ",i, (i>>16)&511, OP->phase>>FREQ_SH, pm);*/ - - p = (env<<3) + sin_tab[ (i>>FREQ_SH) & SIN_MASK]; - -/*logerror("(p&255=%i p>>8=%i) out= %i\n", p&255,p>>8, tl_tab[p&255]>>(p>>8) );*/ - - if (p >= TL_TAB_LEN) - return 0; - - return tl_tab[p]; -} - - - -#define volume_calc(OP) ((OP)->tl + ((UINT32)(OP)->volume) + (AM & (OP)->AMmask)) - -INLINE void chan_calc(unsigned int chan) -{ - YM2151Operator *op; - unsigned int env; - UINT32 AM = 0; - - m2 = c1 = c2 = mem = 0; - op = &PSG->oper[chan*4]; /* M1 */ - - *op->mem_connect = op->mem_value; /* restore delayed sample (MEM) value to m2 or c2 */ - - if (op->ams) - AM = PSG->lfa << (op->ams-1); - env = volume_calc(op); - { - INT32 out = op->fb_out_prev + op->fb_out_curr; - op->fb_out_prev = op->fb_out_curr; - - if (!op->connect) - /* algorithm 5 */ - mem = c1 = c2 = op->fb_out_prev; - else - /* other algorithms */ - *op->connect = op->fb_out_prev; - - op->fb_out_curr = 0; - if (env < ENV_QUIET) - { - if (!op->fb_shift) - out=0; - op->fb_out_curr = op_calc1(op, env, (out<fb_shift) ); - } - } - - env = volume_calc(op+1); /* M2 */ - if (env < ENV_QUIET) - *(op+1)->connect += op_calc(op+1, env, m2); - - env = volume_calc(op+2); /* C1 */ - if (env < ENV_QUIET) - *(op+2)->connect += op_calc(op+2, env, c1); - - env = volume_calc(op+3); /* C2 */ - if (env < ENV_QUIET) - chanout[chan] += op_calc(op+3, env, c2); - - /* M1 */ - op->mem_value = mem; -} -INLINE void chan7_calc(void) -{ - YM2151Operator *op; - unsigned int env; - UINT32 AM = 0; - - m2 = c1 = c2 = mem = 0; - op = &PSG->oper[7*4]; /* M1 */ - - *op->mem_connect = op->mem_value; /* restore delayed sample (MEM) value to m2 or c2 */ - - if (op->ams) - AM = PSG->lfa << (op->ams-1); - env = volume_calc(op); - { - INT32 out = op->fb_out_prev + op->fb_out_curr; - op->fb_out_prev = op->fb_out_curr; - - if (!op->connect) - /* algorithm 5 */ - mem = c1 = c2 = op->fb_out_prev; - else - /* other algorithms */ - *op->connect = op->fb_out_prev; - - op->fb_out_curr = 0; - if (env < ENV_QUIET) - { - if (!op->fb_shift) - out=0; - op->fb_out_curr = op_calc1(op, env, (out<fb_shift) ); - } - } - - env = volume_calc(op+1); /* M2 */ - if (env < ENV_QUIET) - *(op+1)->connect += op_calc(op+1, env, m2); - - env = volume_calc(op+2); /* C1 */ - if (env < ENV_QUIET) - *(op+2)->connect += op_calc(op+2, env, c1); - - env = volume_calc(op+3); /* C2 */ - if (PSG->noise & 0x80) - { - UINT32 noiseout; - - noiseout = 0; - if (env < 0x3ff) - noiseout = (env ^ 0x3ff) * 2; /* range of the YM2151 noise output is -2044 to 2040 */ - chanout[7] += ((PSG->noise_rng&0x10000) ? noiseout: -noiseout); /* bit 16 -> output */ - } - else - { - if (env < ENV_QUIET) - chanout[7] += op_calc(op+3, env, c2); - } - /* M1 */ - op->mem_value = mem; -} - - - - - - -/* -The 'rate' is calculated from following formula (example on decay rate): - rks = notecode after key scaling (a value from 0 to 31) - DR = value written to the chip register - rate = 2*DR + rks; (max rate = 2*31+31 = 93) -Four MSBs of the 'rate' above are the 'main' rate (from 00 to 15) -Two LSBs of the 'rate' above are the value 'x' (the shape type). -(eg. '11 2' means that 'rate' is 11*4+2=46) - -NOTE: A 'sample' in the description below is actually 3 output samples, -thats because the Envelope Generator clock is equal to internal_clock/3. - -Single '-' (minus) character in the diagrams below represents one sample -on the output; this is for rates 11 x (11 0, 11 1, 11 2 and 11 3) - -these 'main' rates: -00 x: single '-' = 2048 samples; (ie. level can change every 2048 samples) -01 x: single '-' = 1024 samples; -02 x: single '-' = 512 samples; -03 x: single '-' = 256 samples; -04 x: single '-' = 128 samples; -05 x: single '-' = 64 samples; -06 x: single '-' = 32 samples; -07 x: single '-' = 16 samples; -08 x: single '-' = 8 samples; -09 x: single '-' = 4 samples; -10 x: single '-' = 2 samples; -11 x: single '-' = 1 sample; (ie. level can change every 1 sample) - -Shapes for rates 11 x look like this: -rate: step: -11 0 01234567 - -level: -0 -- -1 -- -2 -- -3 -- - -rate: step: -11 1 01234567 - -level: -0 -- -1 -- -2 - -3 - -4 -- - -rate: step: -11 2 01234567 - -level: -0 -- -1 - -2 - -3 -- -4 - -5 - - -rate: step: -11 3 01234567 - -level: -0 -- -1 - -2 - -3 - -4 - -5 - -6 - - - -For rates 12 x, 13 x, 14 x and 15 x output level changes on every -sample - this means that the waveform looks like this: (but the level -changes by different values on different steps) -12 3 01234567 - -0 - -2 - -4 - -8 - -10 - -12 - -14 - -18 - -20 - - -Notes about the timing: ----------------------- - -1. Synchronism - -Output level of each two (or more) voices running at the same 'main' rate -(eg 11 0 and 11 1 in the diagram below) will always be changing in sync, -even if there're started with some delay. - -Note that, in the diagram below, the decay phase in channel 0 starts at -sample #2, while in channel 1 it starts at sample #6. Anyway, both channels -will always change their levels at exactly the same (following) samples. - -(S - start point of this channel, A-attack phase, D-decay phase): - -step: -01234567012345670123456 - -channel 0: - -- - | -- - | - - | - - | -- - | -- -| -- -| - -| - -| -- -AADDDDDDDDDDDDDDDD -S - -01234567012345670123456 -channel 1: - - - | - - | -- - | -- - | -- - | - - | - - | -- - | -- - | -- - AADDDDDDDDDDDDDDDD - S -01234567012345670123456 - - -2. Shifted (delayed) synchronism - -Output of each two (or more) voices running at different 'main' rate -(9 1, 10 1 and 11 1 in the diagrams below) will always be changing -in 'delayed-sync' (even if there're started with some delay as in "1.") - -Note that the shapes are delayed by exactly one sample per one 'main' rate -increment. (Normally one would expect them to start at the same samples.) - -See diagram below (* - start point of the shape). - -cycle: -0123456701234567012345670123456701234567012345670123456701234567 - -rate 09 1 -*------- - -------- - ---- - ---- - -------- - *------- - | -------- - | ---- - | ---- - | -------- -rate 10 1 | --- | - *--- | - ---- | - -- | - -- | - ---- | - *--- | - | ---- | - | -- | | <- one step (two samples) delay between 9 1 and 10 1 - | -- | | - | ----| - | *--- - | ---- - | -- - | -- - | ---- -rate 11 1 | -- | - -- | - *- | - -- | - - | - - | - -- | - *- | - -- | - - || <- one step (one sample) delay between 10 1 and 11 1 - - || - --| - *- - -- - - - - - -- - *- - -- - - - - - -- -*/ - -INLINE void advance_eg(void) -{ - YM2151Operator *op; - unsigned int i; - - - - PSG->eg_timer += PSG->eg_timer_add; - - while (PSG->eg_timer >= PSG->eg_timer_overflow) - { - PSG->eg_timer -= PSG->eg_timer_overflow; - - PSG->eg_cnt++; - - /* envelope generator */ - op = &PSG->oper[0]; /* CH 0 M1 */ - i = 32; - do - { - switch(op->state) - { - case EG_ATT: /* attack phase */ - if ( !(PSG->eg_cnt & ((1<eg_sh_ar)-1) ) ) - { - op->volume += (~op->volume * - (eg_inc[op->eg_sel_ar + ((PSG->eg_cnt>>op->eg_sh_ar)&7)]) - ) >>4; - - if (op->volume <= MIN_ATT_INDEX) - { - op->volume = MIN_ATT_INDEX; - op->state = EG_DEC; - } - - } - break; - - case EG_DEC: /* decay phase */ - if ( !(PSG->eg_cnt & ((1<eg_sh_d1r)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_d1r + ((PSG->eg_cnt>>op->eg_sh_d1r)&7)]; - - if ( op->volume >= op->d1l ) - op->state = EG_SUS; - - } - break; - - case EG_SUS: /* sustain phase */ - if ( !(PSG->eg_cnt & ((1<eg_sh_d2r)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_d2r + ((PSG->eg_cnt>>op->eg_sh_d2r)&7)]; - - if ( op->volume >= MAX_ATT_INDEX ) - { - op->volume = MAX_ATT_INDEX; - op->state = EG_OFF; - } - - } - break; - - case EG_REL: /* release phase */ - if ( !(PSG->eg_cnt & ((1<eg_sh_rr)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_rr + ((PSG->eg_cnt>>op->eg_sh_rr)&7)]; - - if ( op->volume >= MAX_ATT_INDEX ) - { - op->volume = MAX_ATT_INDEX; - op->state = EG_OFF; - } - - } - break; - } - op++; - i--; - }while (i); - } -} - - -INLINE void advance(void) -{ - YM2151Operator *op; - unsigned int i; - int a,p; - - /* LFO */ - if (PSG->test&2) - PSG->lfo_phase = 0; - else - { - PSG->lfo_timer += PSG->lfo_timer_add; - if (PSG->lfo_timer >= PSG->lfo_overflow) - { - PSG->lfo_timer -= PSG->lfo_overflow; - PSG->lfo_counter += PSG->lfo_counter_add; - PSG->lfo_phase += (PSG->lfo_counter>>4); - PSG->lfo_phase &= 255; - PSG->lfo_counter &= 15; - } - } - - i = PSG->lfo_phase; - /* calculate LFO AM and PM waveform value (all verified on real chip, except for noise algorithm which is impossible to analyse)*/ - switch (PSG->lfo_wsel) - { - case 0: - /* saw */ - /* AM: 255 down to 0 */ - /* PM: 0 to 127, -127 to 0 (at PMD=127: LFP = 0 to 126, -126 to 0) */ - a = 255 - i; - if (i<128) - p = i; - else - p = i - 255; - break; - case 1: - /* square */ - /* AM: 255, 0 */ - /* PM: 128,-128 (LFP = exactly +PMD, -PMD) */ - if (i<128){ - a = 255; - p = 128; - }else{ - a = 0; - p = -128; - } - break; - case 2: - /* triangle */ - /* AM: 255 down to 1 step -2; 0 up to 254 step +2 */ - /* PM: 0 to 126 step +2, 127 to 1 step -2, 0 to -126 step -2, -127 to -1 step +2*/ - if (i<128) - a = 255 - (i*2); - else - a = (i*2) - 256; - - if (i<64) /* i = 0..63 */ - p = i*2; /* 0 to 126 step +2 */ - else if (i<128) /* i = 64..127 */ - p = 255 - i*2; /* 127 to 1 step -2 */ - else if (i<192) /* i = 128..191 */ - p = 256 - i*2; /* 0 to -126 step -2*/ - else /* i = 192..255 */ - p = i*2 - 511; /*-127 to -1 step +2*/ - break; - case 3: - default: /*keep the compiler happy*/ - /* random */ - /* the real algorithm is unknown !!! - We just use a snapshot of data from real chip */ - - /* AM: range 0 to 255 */ - /* PM: range -128 to 127 */ - - a = lfo_noise_waveform[i]; - p = a-128; - break; - } - PSG->lfa = a * PSG->amd / 128; - PSG->lfp = p * PSG->pmd / 128; - - - /* The Noise Generator of the YM2151 is 17-bit shift register. - * Input to the bit16 is negated (bit0 XOR bit3) (EXNOR). - * Output of the register is negated (bit0 XOR bit3). - * Simply use bit16 as the noise output. - */ - PSG->noise_p += PSG->noise_f; - i = (PSG->noise_p>>16); /* number of events (shifts of the shift register) */ - PSG->noise_p &= 0xffff; - while (i) - { - UINT32 j; - j = ( (PSG->noise_rng ^ (PSG->noise_rng>>3) ) & 1) ^ 1; - PSG->noise_rng = (j<<16) | (PSG->noise_rng>>1); - i--; - } - - - /* phase generator */ - op = &PSG->oper[0]; /* CH 0 M1 */ - i = 8; - do - { - if (op->pms) /* only when phase modulation from LFO is enabled for this channel */ - { - INT32 mod_ind = PSG->lfp; /* -128..+127 (8bits signed) */ - if (op->pms < 6) - mod_ind >>= (6 - op->pms); - else - mod_ind <<= (op->pms - 5); - - if (mod_ind) - { - UINT32 kc_channel = op->kc_i + mod_ind; - (op+0)->phase += ( (PSG->freq[ kc_channel + (op+0)->dt2 ] + (op+0)->dt1) * (op+0)->mul ) >> 1; - (op+1)->phase += ( (PSG->freq[ kc_channel + (op+1)->dt2 ] + (op+1)->dt1) * (op+1)->mul ) >> 1; - (op+2)->phase += ( (PSG->freq[ kc_channel + (op+2)->dt2 ] + (op+2)->dt1) * (op+2)->mul ) >> 1; - (op+3)->phase += ( (PSG->freq[ kc_channel + (op+3)->dt2 ] + (op+3)->dt1) * (op+3)->mul ) >> 1; - } - else /* phase modulation from LFO is equal to zero */ - { - (op+0)->phase += (op+0)->freq; - (op+1)->phase += (op+1)->freq; - (op+2)->phase += (op+2)->freq; - (op+3)->phase += (op+3)->freq; - } - } - else /* phase modulation from LFO is disabled */ - { - (op+0)->phase += (op+0)->freq; - (op+1)->phase += (op+1)->freq; - (op+2)->phase += (op+2)->freq; - (op+3)->phase += (op+3)->freq; - } - - op+=4; - i--; - }while (i); - - - /* CSM is calculated *after* the phase generator calculations (verified on real chip) - * CSM keyon line seems to be ORed with the KO line inside of the chip. - * The result is that it only works when KO (register 0x08) is off, ie. 0 - * - * Interesting effect is that when timer A is set to 1023, the KEY ON happens - * on every sample, so there is no KEY OFF at all - the result is that - * the sound played is the same as after normal KEY ON. - */ - - if (PSG->csm_req) /* CSM KEYON/KEYOFF seqeunce request */ - { - if (PSG->csm_req==2) /* KEY ON */ - { - op = &PSG->oper[0]; /* CH 0 M1 */ - i = 32; - do - { - KEY_ON(op, 2); - op++; - i--; - }while (i); - PSG->csm_req = 1; - } - else /* KEY OFF */ - { - op = &PSG->oper[0]; /* CH 0 M1 */ - i = 32; - do - { - KEY_OFF(op,~2); - op++; - i--; - }while (i); - PSG->csm_req = 0; - } - } -} - -#if 0 -INLINE signed int acc_calc(signed int value) -{ - if (value>=0) - { - if (value < 0x0200) - return (value & ~0); - if (value < 0x0400) - return (value & ~1); - if (value < 0x0800) - return (value & ~3); - if (value < 0x1000) - return (value & ~7); - if (value < 0x2000) - return (value & ~15); - if (value < 0x4000) - return (value & ~31); - return (value & ~63); - } - /*else value < 0*/ - if (value > -0x0200) - return (~abs(value) & ~0); - if (value > -0x0400) - return (~abs(value) & ~1); - if (value > -0x0800) - return (~abs(value) & ~3); - if (value > -0x1000) - return (~abs(value) & ~7); - if (value > -0x2000) - return (~abs(value) & ~15); - if (value > -0x4000) - return (~abs(value) & ~31); - return (~abs(value) & ~63); -} -#endif - -/* first macro saves left and right channels to mono file */ -/* second macro saves left and right channels to stereo file */ -#if 0 /*MONO*/ - #ifdef SAVE_SEPARATE_CHANNELS - #define SAVE_SINGLE_CHANNEL(j) \ - { signed int pom= -(chanout[j] & PSG->pan[j*2]); \ - if (pom > 32767) pom = 32767; else if (pom < -32768) pom = -32768; \ - fputc((unsigned short)pom&0xff,sample[j]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[j]); } - #else - #define SAVE_SINGLE_CHANNEL(j) - #endif -#else /*STEREO*/ - #ifdef SAVE_SEPARATE_CHANNELS - #define SAVE_SINGLE_CHANNEL(j) \ - { signed int pom = -(chanout[j] & PSG->pan[j*2]); \ - if (pom > 32767) pom = 32767; else if (pom < -32768) pom = -32768; \ - fputc((unsigned short)pom&0xff,sample[j]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[j]); \ - pom = -(chanout[j] & PSG->pan[j*2+1]); \ - if (pom > 32767) pom = 32767; else if (pom < -32768) pom = -32768; \ - fputc((unsigned short)pom&0xff,sample[j]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[j]); \ - } - #else - #define SAVE_SINGLE_CHANNEL(j) - #endif -#endif - -/* first macro saves left and right channels to mono file */ -/* second macro saves left and right channels to stereo file */ -#if 1 /*MONO*/ - #ifdef SAVE_SAMPLE - #define SAVE_ALL_CHANNELS \ - { signed int pom = outl; \ - /*pom = acc_calc(pom);*/ \ - /*fprintf(sample[8]," %i\n",pom);*/ \ - fputc((unsigned short)pom&0xff,sample[8]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[8]); \ - } - #else - #define SAVE_ALL_CHANNELS - #endif -#else /*STEREO*/ - #ifdef SAVE_SAMPLE - #define SAVE_ALL_CHANNELS \ - { signed int pom = outl; \ - fputc((unsigned short)pom&0xff,sample[8]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[8]); \ - pom = outr; \ - fputc((unsigned short)pom&0xff,sample[8]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[8]); \ - } - #else - #define SAVE_ALL_CHANNELS - #endif -#endif - - -/* Generate samples for one of the YM2151's -* -* 'num' is the number of virtual YM2151 -* '**buffers' is table of pointers to the buffers: left and right -* 'length' is the number of samples that should be generated -*/ -void YM2151UpdateOne(int num, INT16 **buffers, int length) -{ - int i; - signed int outl,outr; - SAMP *bufL, *bufR; - - bufL = buffers[0]; - bufR = buffers[1]; - - PSG = &YMPSG[num]; - -#ifdef USE_MAME_TIMERS - /* ASG 980324 - handled by real timers now */ -#else - if (PSG->tim_B) - { - PSG->tim_B_val -= ( length << TIMER_SH ); - if (PSG->tim_B_val<=0) - { - PSG->tim_B_val += PSG->tim_B_tab[ PSG->timer_B_index ]; - if ( PSG->irq_enable & 0x08 ) - { - int oldstate = PSG->status & 3; - PSG->status |= 2; - if ((!oldstate) && (PSG->irqhandler)) (*PSG->irqhandler)(1); - } - } - } -#endif - - for (i=0; ipan[0]; - outr = chanout[0] & PSG->pan[1]; - outl += (chanout[1] & PSG->pan[2]); - outr += (chanout[1] & PSG->pan[3]); - outl += (chanout[2] & PSG->pan[4]); - outr += (chanout[2] & PSG->pan[5]); - outl += (chanout[3] & PSG->pan[6]); - outr += (chanout[3] & PSG->pan[7]); - outl += (chanout[4] & PSG->pan[8]); - outr += (chanout[4] & PSG->pan[9]); - outl += (chanout[5] & PSG->pan[10]); - outr += (chanout[5] & PSG->pan[11]); - outl += (chanout[6] & PSG->pan[12]); - outr += (chanout[6] & PSG->pan[13]); - outl += (chanout[7] & PSG->pan[14]); - outr += (chanout[7] & PSG->pan[15]); - - outl >>= FINAL_SH; - outr >>= FINAL_SH; - if (outl > MAXOUT) outl = MAXOUT; - else if (outl < MINOUT) outl = MINOUT; - if (outr > MAXOUT) outr = MAXOUT; - else if (outr < MINOUT) outr = MINOUT; - ((SAMP*)bufL)[i] = (SAMP)outl; - ((SAMP*)bufR)[i] = (SAMP)outr; - - SAVE_ALL_CHANNELS - -#ifdef USE_MAME_TIMERS - /* ASG 980324 - handled by real timers now */ -#else - /* calculate timer A */ - if (PSG->tim_A) - { - PSG->tim_A_val -= ( 1 << TIMER_SH ); - if (PSG->tim_A_val <= 0) - { - PSG->tim_A_val += PSG->tim_A_tab[ PSG->timer_A_index ]; - if (PSG->irq_enable & 0x04) - { - int oldstate = PSG->status & 3; - PSG->status |= 1; - if ((!oldstate) && (PSG->irqhandler)) (*PSG->irqhandler)(1); - } - if (PSG->irq_enable & 0x80) - PSG->csm_req = 2; /* request KEY ON / KEY OFF sequence */ - } - } -#endif - advance(); - } -} - -void YM2151SetIrqHandler(int n, void(*handler)(int irq)) -{ - YMPSG[n].irqhandler = handler; -} - -void YM2151SetPortWriteHandler(int n, write8_handler handler) -{ - YMPSG[n].porthandler = handler; -} - diff --git a/jan/src/burn/snd/ym2151.h b/jan/src/burn/snd/ym2151.h deleted file mode 100644 index 8eacbf01e..000000000 --- a/jan/src/burn/snd/ym2151.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -** -** File: ym2151.h - header file for software implementation of YM2151 -** FM Operator Type-M(OPM) -** -** (c) 1997-2002 Jarek Burczynski (s0246@poczta.onet.pl, bujar@mame.net) -** Some of the optimizing ideas by Tatsuyuki Satoh -** -** Version 2.150 final beta May, 11th 2002 -** -** -** I would like to thank following people for making this project possible: -** -** Beauty Planets - for making a lot of real YM2151 samples and providing -** additional informations about the chip. Also for the time spent making -** the samples and the speed of replying to my endless requests. -** -** Shigeharu Isoda - for general help, for taking time to scan his YM2151 -** Japanese Manual first of all, and answering MANY of my questions. -** -** Nao - for giving me some info about YM2151 and pointing me to Shigeharu. -** Also for creating fmemu (which I still use to test the emulator). -** -** Aaron Giles and Chris Hardy - they made some samples of one of my favourite -** arcade games so I could compare it to my emulator. -** -** Bryan McPhail and Tim (powerjaw) - for making some samples. -** -** Ishmair - for the datasheet and motivation. -*/ - -#ifndef _H_YM2151_ -#define _H_YM2151_ - -/* 16- and 8-bit samples (signed) are supported*/ -#define SAMPLE_BITS 16 - -#if (SAMPLE_BITS==16) - typedef INT16 SAMP; -#endif -#if (SAMPLE_BITS==8) - typedef signed char SAMP; -#endif - -/* -** Initialize YM2151 emulator(s). -** -** 'num' is the number of virtual YM2151's to allocate -** 'clock' is the chip clock in Hz -** 'rate' is sampling rate -*/ -int YM2151Init(int num, int clock, int rate); - -/* shutdown the YM2151 emulators*/ -void YM2151Shutdown(void); - -/* reset all chip registers for YM2151 number 'num'*/ -void YM2151ResetChip(int num); - -/* -** Generate samples for one of the YM2151's -** -** 'num' is the number of virtual YM2151 -** '**buffers' is table of pointers to the buffers: left and right -** 'length' is the number of samples that should be generated -*/ -void YM2151UpdateOne(int num, INT16 **buffers, int length); - -/* write 'v' to register 'r' on YM2151 chip number 'n'*/ -void YM2151WriteReg(int n, int r, int v); - -/* read status register on YM2151 chip number 'n'*/ -int YM2151ReadStatus(int n); - -/* set interrupt handler on YM2151 chip number 'n'*/ -void YM2151SetIrqHandler(int n, void (*handler)(int irq)); - -/* set port write handler on YM2151 chip number 'n'*/ -void YM2151SetPortWriteHandler(int n, write8_handler handler); - -/* FBAlpha-style savestate function for ym2151.c internal registers & operators */ -void BurnYM2151Scan_int(INT32 nAction); - -#endif /*_H_YM2151_*/ diff --git a/jan/src/burn/snd/ym2413.c b/jan/src/burn/snd/ym2413.c deleted file mode 100644 index cb8d94be8..000000000 --- a/jan/src/burn/snd/ym2413.c +++ /dev/null @@ -1,2239 +0,0 @@ -/* -** -** File: ym2413.c - software implementation of YM2413 -** FM sound generator type OPLL -** -** Copyright (C) 2002 Jarek Burczynski -** -** Version 1.0 -** - - -to do: - -- make sure of the sinus amplitude bits - -- make sure of the EG resolution bits (looks like the biggest - modulation index generated by the modulator is 123, 124 = no modulation) -- find proper algorithm for attack phase of EG - -- tune up instruments ROM - -- support sample replay in test mode (it is NOT as simple as setting bit 0 - in register 0x0f and using register 0x10 for sample data). - Which games use this feature ? - - -*/ - -#include "driver.h" -#include "state.h" -#include "ym2413.h" - -#ifndef MAME_INLINE -#ifndef MAME_INLINE -#define MAME_INLINE static inline -#endif -#endif - -#ifndef PI -#define PI 3.14159265358979323846 -#endif - -/* output final shift */ -#if (SAMPLE_BITS==16) - #define FINAL_SH (0) - #define MAXOUT (+32767) - #define MINOUT (-32768) -#else - #define FINAL_SH (8) - #define MAXOUT (+127) - #define MINOUT (-128) -#endif - - -#define FREQ_SH 16 /* 16.16 fixed point (frequency calculations) */ -#define EG_SH 16 /* 16.16 fixed point (EG timing) */ -#define LFO_SH 24 /* 8.24 fixed point (LFO calculations) */ - -#define FREQ_MASK ((1<=0) - { - if (value < 0x0200) - return (value & ~0); - if (value < 0x0400) - return (value & ~1); - if (value < 0x0800) - return (value & ~3); - if (value < 0x1000) - return (value & ~7); - if (value < 0x2000) - return (value & ~15); - if (value < 0x4000) - return (value & ~31); - return (value & ~63); - } - /*else value < 0*/ - if (value > -0x0200) - return (~abs(value) & ~0); - if (value > -0x0400) - return (~abs(value) & ~1); - if (value > -0x0800) - return (~abs(value) & ~3); - if (value > -0x1000) - return (~abs(value) & ~7); - if (value > -0x2000) - return (~abs(value) & ~15); - if (value > -0x4000) - return (~abs(value) & ~31); - return (~abs(value) & ~63); -} - - -static FILE *sample[1]; - #if 0 /*save to MONO file */ - #define SAVE_ALL_CHANNELS \ - { signed int pom = acc_calc(mo); \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - } - #else /*save to STEREO file */ - #define SAVE_ALL_CHANNELS \ - { signed int pom = mo; \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - pom = ro; \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - } - #define SAVE_SEPARATE_CHANNEL(j) \ - { signed int pom = outchan; \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - pom = chip->instvol_r[j]>>4; \ - fputc((unsigned short)pom&0xff,sample[0]); \ - fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ - } - #endif -#endif - -/*#define LOG_CYM_FILE*/ -#ifdef LOG_CYM_FILE - FILE * cymfile = NULL; -#endif - - - - -typedef struct{ - UINT32 ar; /* attack rate: AR<<2 */ - UINT32 dr; /* decay rate: DR<<2 */ - UINT32 rr; /* release rate:RR<<2 */ - UINT8 KSR; /* key scale rate */ - UINT8 ksl; /* keyscale level */ - UINT8 ksr; /* key scale rate: kcode>>KSR */ - UINT8 mul; /* multiple: mul_tab[ML] */ - - /* Phase Generator */ - UINT32 phase; /* frequency counter */ - UINT32 freq; /* frequency counter step */ - UINT8 fb_shift; /* feedback shift value */ - INT32 op1_out[2]; /* slot1 output for feedback */ - - /* Envelope Generator */ - UINT8 eg_type; /* percussive/nonpercussive mode*/ - UINT8 state; /* phase type */ - UINT32 TL; /* total level: TL << 2 */ - INT32 TLL; /* adjusted now TL */ - INT32 volume; /* envelope counter */ - UINT32 sl; /* sustain level: sl_tab[SL] */ - - UINT8 eg_sh_dp; /* (dump state) */ - UINT8 eg_sel_dp; /* (dump state) */ - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT8 eg_sh_dr; /* (decay state) */ - UINT8 eg_sel_dr; /* (decay state) */ - UINT8 eg_sh_rr; /* (release state for non-perc.)*/ - UINT8 eg_sel_rr; /* (release state for non-perc.)*/ - UINT8 eg_sh_rs; /* (release state for perc.mode)*/ - UINT8 eg_sel_rs; /* (release state for perc.mode)*/ - - UINT32 key; /* 0 = KEY OFF, >0 = KEY ON */ - - /* LFO */ - UINT32 AMmask; /* LFO Amplitude Modulation enable mask */ - UINT8 vib; /* LFO Phase Modulation enable flag (active high)*/ - - /* waveform select */ - unsigned int wavetable; -} YM2413_OPLL_SLOT; - -typedef struct{ - YM2413_OPLL_SLOT SLOT[2]; - /* phase generator state */ - UINT32 block_fnum; /* block+fnum */ - UINT32 fc; /* Freq. freqement base */ - UINT32 ksl_base; /* KeyScaleLevel Base step */ - UINT8 kcode; /* key code (for key scaling) */ - UINT8 sus; /* sus on/off (release speed in percussive mode)*/ -} YM2413_OPLL_CH; - -/* chip state */ -typedef struct { - YM2413_OPLL_CH P_CH[9]; /* OPLL chips have 9 channels*/ - UINT8 instvol_r[9]; /* instrument/volume (or volume/volume in percussive mode)*/ - - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/72 */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow; /* envelope generator timer overlfows every 1 sample (on real chip) */ - - UINT8 rhythm; /* Rhythm mode */ - - /* LFO */ - UINT32 lfo_am_cnt; - UINT32 lfo_am_inc; - UINT32 lfo_pm_cnt; - UINT32 lfo_pm_inc; - - UINT32 noise_rng; /* 23 bit noise shift register */ - UINT32 noise_p; /* current noise 'phase' */ - UINT32 noise_f; /* current noise period */ - - -/* instrument settings */ -/* - 0-user instrument - 1-15 - fixed instruments - 16 -bass drum settings - 17,18 - other percussion instruments -*/ - UINT8 inst_tab[19][8]; - - /* external event callback handlers */ - OPLL_UPDATEHANDLER UpdateHandler; /* stream update handler */ - int UpdateParam; /* stream update parameter */ - - UINT32 fn_tab[1024]; /* fnumber->increment counter */ - - UINT8 address; /* address register */ - UINT8 status; /* status flag */ - - int clock; /* master clock (Hz) */ - int rate; /* sampling rate (Hz) */ - double freqbase; /* frequency base */ -} YM2413; - -/* key scale level */ -/* table is 3dB/octave, DV converts this into 6dB/octave */ -/* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */ -#define DV (0.1875/1.0) -static const UINT32 ksl_tab[8*16]= -{ - /* OCT 0 */ - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - /* OCT 1 */ - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 0.750/DV, 1.125/DV, 1.500/DV, - 1.875/DV, 2.250/DV, 2.625/DV, 3.000/DV, - /* OCT 2 */ - 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, - 0.000/DV, 1.125/DV, 1.875/DV, 2.625/DV, - 3.000/DV, 3.750/DV, 4.125/DV, 4.500/DV, - 4.875/DV, 5.250/DV, 5.625/DV, 6.000/DV, - /* OCT 3 */ - 0.000/DV, 0.000/DV, 0.000/DV, 1.875/DV, - 3.000/DV, 4.125/DV, 4.875/DV, 5.625/DV, - 6.000/DV, 6.750/DV, 7.125/DV, 7.500/DV, - 7.875/DV, 8.250/DV, 8.625/DV, 9.000/DV, - /* OCT 4 */ - 0.000/DV, 0.000/DV, 3.000/DV, 4.875/DV, - 6.000/DV, 7.125/DV, 7.875/DV, 8.625/DV, - 9.000/DV, 9.750/DV,10.125/DV,10.500/DV, - 10.875/DV,11.250/DV,11.625/DV,12.000/DV, - /* OCT 5 */ - 0.000/DV, 3.000/DV, 6.000/DV, 7.875/DV, - 9.000/DV,10.125/DV,10.875/DV,11.625/DV, - 12.000/DV,12.750/DV,13.125/DV,13.500/DV, - 13.875/DV,14.250/DV,14.625/DV,15.000/DV, - /* OCT 6 */ - 0.000/DV, 6.000/DV, 9.000/DV,10.875/DV, - 12.000/DV,13.125/DV,13.875/DV,14.625/DV, - 15.000/DV,15.750/DV,16.125/DV,16.500/DV, - 16.875/DV,17.250/DV,17.625/DV,18.000/DV, - /* OCT 7 */ - 0.000/DV, 9.000/DV,12.000/DV,13.875/DV, - 15.000/DV,16.125/DV,16.875/DV,17.625/DV, - 18.000/DV,18.750/DV,19.125/DV,19.500/DV, - 19.875/DV,20.250/DV,20.625/DV,21.000/DV -}; -#undef DV - -/* sustain level table (3dB per step) */ -/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,45 (dB)*/ -#define SC(db) (UINT32) ( db * (1.0/ENV_STEP) ) -static const UINT32 sl_tab[16]={ - SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7), - SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(15) -}; -#undef SC - - -#define RATE_STEPS (8) -static const unsigned char eg_inc[15*RATE_STEPS]={ - -/*cycle:0 1 2 3 4 5 6 7*/ - -/* 0 */ 0,1, 0,1, 0,1, 0,1, /* rates 00..12 0 (increment by 0 or 1) */ -/* 1 */ 0,1, 0,1, 1,1, 0,1, /* rates 00..12 1 */ -/* 2 */ 0,1, 1,1, 0,1, 1,1, /* rates 00..12 2 */ -/* 3 */ 0,1, 1,1, 1,1, 1,1, /* rates 00..12 3 */ - -/* 4 */ 1,1, 1,1, 1,1, 1,1, /* rate 13 0 (increment by 1) */ -/* 5 */ 1,1, 1,2, 1,1, 1,2, /* rate 13 1 */ -/* 6 */ 1,2, 1,2, 1,2, 1,2, /* rate 13 2 */ -/* 7 */ 1,2, 2,2, 1,2, 2,2, /* rate 13 3 */ - -/* 8 */ 2,2, 2,2, 2,2, 2,2, /* rate 14 0 (increment by 2) */ -/* 9 */ 2,2, 2,4, 2,2, 2,4, /* rate 14 1 */ -/*10 */ 2,4, 2,4, 2,4, 2,4, /* rate 14 2 */ -/*11 */ 2,4, 4,4, 2,4, 4,4, /* rate 14 3 */ - -/*12 */ 4,4, 4,4, 4,4, 4,4, /* rates 15 0, 15 1, 15 2, 15 3 (increment by 4) */ -/*13 */ 8,8, 8,8, 8,8, 8,8, /* rates 15 2, 15 3 for attack */ -/*14 */ 0,0, 0,0, 0,0, 0,0, /* infinity rates for attack and decay(s) */ -}; - - -#define O(a) (a*RATE_STEPS) - -/*note that there is no O(13) in this table - it's directly in the code */ -static const unsigned char eg_rate_select[16+64+16]={ /* Envelope Generator rates (16 + 64 rates + 16 RKS) */ -/* 16 infinite time rates */ -O(14),O(14),O(14),O(14),O(14),O(14),O(14),O(14), -O(14),O(14),O(14),O(14),O(14),O(14),O(14),O(14), - -/* rates 00-12 */ -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), -O( 0),O( 1),O( 2),O( 3), - -/* rate 13 */ -O( 4),O( 5),O( 6),O( 7), - -/* rate 14 */ -O( 8),O( 9),O(10),O(11), - -/* rate 15 */ -O(12),O(12),O(12),O(12), - -/* 16 dummy rates (same as 15 3) */ -O(12),O(12),O(12),O(12),O(12),O(12),O(12),O(12), -O(12),O(12),O(12),O(12),O(12),O(12),O(12),O(12), - -}; -#undef O - -/*rate 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 */ -/*shift 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0 */ -/*mask 8191, 4095, 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0, 0, 0 */ - -#define O(a) (a*1) -static const unsigned char eg_rate_shift[16+64+16]={ /* Envelope Generator counter shifts (16 + 64 rates + 16 RKS) */ -/* 16 infinite time rates */ -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), -O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), - -/* rates 00-12 */ -O(13),O(13),O(13),O(13), -O(12),O(12),O(12),O(12), -O(11),O(11),O(11),O(11), -O(10),O(10),O(10),O(10), -O( 9),O( 9),O( 9),O( 9), -O( 8),O( 8),O( 8),O( 8), -O( 7),O( 7),O( 7),O( 7), -O( 6),O( 6),O( 6),O( 6), -O( 5),O( 5),O( 5),O( 5), -O( 4),O( 4),O( 4),O( 4), -O( 3),O( 3),O( 3),O( 3), -O( 2),O( 2),O( 2),O( 2), -O( 1),O( 1),O( 1),O( 1), - -/* rate 13 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 14 */ -O( 0),O( 0),O( 0),O( 0), - -/* rate 15 */ -O( 0),O( 0),O( 0),O( 0), - -/* 16 dummy rates (same as 15 3) */ -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), -O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), - -}; -#undef O - - -/* multiple table */ -#define ML 2 -static const UINT8 mul_tab[16]= { -/* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */ - 0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML, - 8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML -}; -#undef ML - -/* TL_TAB_LEN is calculated as: -* 11 - sinus amplitude bits (Y axis) -* 2 - sinus sign bit (Y axis) -* TL_RES_LEN - sinus resolution (X axis) -*/ -#define TL_TAB_LEN (11*2*TL_RES_LEN) -static signed int tl_tab[TL_TAB_LEN]; - -#define ENV_QUIET (TL_TAB_LEN>>5) - -/* sin waveform table in 'decibel' scale */ -/* two waveforms on OPLL type chips */ -static unsigned int sin_tab[SIN_LEN * 2]; - - -/* LFO Amplitude Modulation table (verified on real YM3812) - 27 output levels (triangle waveform); 1 level takes one of: 192, 256 or 448 samples - - Length: 210 elements. - - Each of the elements has to be repeated - exactly 64 times (on 64 consecutive samples). - The whole table takes: 64 * 210 = 13440 samples. - -We use data>>1, until we find what it really is on real chip... - -*/ - -#define LFO_AM_TAB_ELEMENTS 210 - -static const UINT8 lfo_am_table[LFO_AM_TAB_ELEMENTS] = { -0,0,0,0,0,0,0, -1,1,1,1, -2,2,2,2, -3,3,3,3, -4,4,4,4, -5,5,5,5, -6,6,6,6, -7,7,7,7, -8,8,8,8, -9,9,9,9, -10,10,10,10, -11,11,11,11, -12,12,12,12, -13,13,13,13, -14,14,14,14, -15,15,15,15, -16,16,16,16, -17,17,17,17, -18,18,18,18, -19,19,19,19, -20,20,20,20, -21,21,21,21, -22,22,22,22, -23,23,23,23, -24,24,24,24, -25,25,25,25, -26,26,26, -25,25,25,25, -24,24,24,24, -23,23,23,23, -22,22,22,22, -21,21,21,21, -20,20,20,20, -19,19,19,19, -18,18,18,18, -17,17,17,17, -16,16,16,16, -15,15,15,15, -14,14,14,14, -13,13,13,13, -12,12,12,12, -11,11,11,11, -10,10,10,10, -9,9,9,9, -8,8,8,8, -7,7,7,7, -6,6,6,6, -5,5,5,5, -4,4,4,4, -3,3,3,3, -2,2,2,2, -1,1,1,1 -}; - -/* LFO Phase Modulation table (verified on real YM2413) */ -static const INT8 lfo_pm_table[8*8] = { - -/* FNUM2/FNUM = 0 00xxxxxx (0x0000) */ -0, 0, 0, 0, 0, 0, 0, 0, - -/* FNUM2/FNUM = 0 01xxxxxx (0x0040) */ -1, 0, 0, 0,-1, 0, 0, 0, - -/* FNUM2/FNUM = 0 10xxxxxx (0x0080) */ -2, 1, 0,-1,-2,-1, 0, 1, - -/* FNUM2/FNUM = 0 11xxxxxx (0x00C0) */ -3, 1, 0,-1,-3,-1, 0, 1, - -/* FNUM2/FNUM = 1 00xxxxxx (0x0100) */ -4, 2, 0,-2,-4,-2, 0, 2, - -/* FNUM2/FNUM = 1 01xxxxxx (0x0140) */ -5, 2, 0,-2,-5,-2, 0, 2, - -/* FNUM2/FNUM = 1 10xxxxxx (0x0180) */ -6, 3, 0,-3,-6,-3, 0, 3, - -/* FNUM2/FNUM = 1 11xxxxxx (0x01C0) */ -7, 3, 0,-3,-7,-3, 0, 3, -}; - - - - - - -/* This is not 100% perfect yet but very close */ -/* - - multi parameters are 100% correct (instruments and drums) - - LFO PM and AM enable are 100% correct - - waveform DC and DM select are 100% correct -*/ - -static unsigned char table[19][8] = { -/* MULT MULT modTL DcDmFb AR/DR AR/DR SL/RR SL/RR */ -/* 0 1 2 3 4 5 6 7 */ - {0x49, 0x4c, 0x4c, 0x12, 0x00, 0x00, 0x00, 0x00 }, //0 - - {0x61, 0x61, 0x1e, 0x17, 0xf0, 0x78, 0x00, 0x17 }, //1 - {0x13, 0x41, 0x1e, 0x0d, 0xd7, 0xf7, 0x13, 0x13 }, //2 - {0x13, 0x01, 0x99, 0x04, 0xf2, 0xf4, 0x11, 0x23 }, //3 - {0x21, 0x61, 0x1b, 0x07, 0xaf, 0x64, 0x40, 0x27 }, //4 - -//{0x22, 0x21, 0x1e, 0x09, 0xf0, 0x76, 0x08, 0x28 }, //5 - {0x22, 0x21, 0x1e, 0x06, 0xf0, 0x75, 0x08, 0x18 }, //5 - -//{0x31, 0x22, 0x16, 0x09, 0x90, 0x7f, 0x00, 0x08 }, //6 - {0x31, 0x22, 0x16, 0x05, 0x90, 0x71, 0x00, 0x13 }, //6 - - {0x21, 0x61, 0x1d, 0x07, 0x82, 0x80, 0x10, 0x17 }, //7 - {0x23, 0x21, 0x2d, 0x16, 0xc0, 0x70, 0x07, 0x07 }, //8 - {0x61, 0x61, 0x1b, 0x06, 0x64, 0x65, 0x10, 0x17 }, //9 - -//{0x61, 0x61, 0x0c, 0x08, 0x85, 0xa0, 0x79, 0x07 }, //A - {0x61, 0x61, 0x0c, 0x18, 0x85, 0xf0, 0x70, 0x07 }, //A - - {0x23, 0x01, 0x07, 0x11, 0xf0, 0xa4, 0x00, 0x22 }, //B - {0x97, 0xc1, 0x24, 0x07, 0xff, 0xf8, 0x22, 0x12 }, //C - -//{0x61, 0x10, 0x0c, 0x08, 0xf2, 0xc4, 0x40, 0xc8 }, //D - {0x61, 0x10, 0x0c, 0x05, 0xf2, 0xf4, 0x40, 0x44 }, //D - - {0x01, 0x01, 0x55, 0x03, 0xf3, 0x92, 0xf3, 0xf3 }, //E - {0x61, 0x41, 0x89, 0x03, 0xf1, 0xf4, 0xf0, 0x13 }, //F - -/* drum instruments definitions */ -/* MULTI MULTI modTL xxx AR/DR AR/DR SL/RR SL/RR */ -/* 0 1 2 3 4 5 6 7 */ - {0x01, 0x01, 0x16, 0x00, 0xfd, 0xf8, 0x2f, 0x6d },/* BD(multi verified, modTL verified, mod env - verified(close), carr. env verifed) */ - {0x01, 0x01, 0x00, 0x00, 0xd8, 0xd8, 0xf9, 0xf8 },/* HH(multi verified), SD(multi not used) */ - {0x05, 0x01, 0x00, 0x00, 0xf8, 0xba, 0x49, 0x55 },/* TOM(multi,env verified), TOP CYM(multi verified, env verified) */ -}; - -/* lock level of common table */ -static int num_lock = 0; - -/* work table */ -static void *cur_chip = NULL; /* current chip pointer */ -static YM2413_OPLL_SLOT *SLOT7_1,*SLOT7_2,*SLOT8_1,*SLOT8_2; - -static signed int output[2]; -static signed int outchan; - -static UINT32 LFO_AM; -static INT32 LFO_PM; - - -MAME_INLINE int limit( int val, int max, int min ) { - if ( val > max ) - val = max; - else if ( val < min ) - val = min; - - return val; -} - - -/* advance LFO to next sample */ -MAME_INLINE void advance_lfo(YM2413 *chip) -{ - /* LFO */ - chip->lfo_am_cnt += chip->lfo_am_inc; - if (chip->lfo_am_cnt >= (LFO_AM_TAB_ELEMENTS<lfo_am_cnt -= (LFO_AM_TAB_ELEMENTS<lfo_am_cnt >> LFO_SH ] >> 1; - - chip->lfo_pm_cnt += chip->lfo_pm_inc; - LFO_PM = (chip->lfo_pm_cnt>>LFO_SH) & 7; -} - -/* advance to next sample */ -MAME_INLINE void advance(YM2413 *chip) -{ - YM2413_OPLL_CH *CH; - YM2413_OPLL_SLOT *op; - unsigned int i; - -//profiler_mark(PROFILER_USER3); - - /* Envelope Generator */ - chip->eg_timer += chip->eg_timer_add; - - while (chip->eg_timer >= chip->eg_timer_overflow) - { - chip->eg_timer -= chip->eg_timer_overflow; - - chip->eg_cnt++; - - for (i=0; i<9*2; i++) - { - CH = &chip->P_CH[i/2]; - - op = &CH->SLOT[i&1]; - - switch(op->state) - { - - case EG_DMP: /* dump phase */ - /*dump phase is performed by both operators in each channel*/ - /*when CARRIER envelope gets down to zero level, - ** phases in BOTH opearators are reset (at the same time ?) - */ - if ( !(chip->eg_cnt & ((1<eg_sh_dp)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_dp + ((chip->eg_cnt>>op->eg_sh_dp)&7)]; - - if ( op->volume >= MAX_ATT_INDEX ) - { - op->volume = MAX_ATT_INDEX; - op->state = EG_ATT; - /* restart Phase Generator */ - op->phase = 0; - } - } - break; - - case EG_ATT: /* attack phase */ - if ( !(chip->eg_cnt & ((1<eg_sh_ar)-1) ) ) - { - op->volume += (~op->volume * - (eg_inc[op->eg_sel_ar + ((chip->eg_cnt>>op->eg_sh_ar)&7)]) - ) >>2; - - if (op->volume <= MIN_ATT_INDEX) - { - op->volume = MIN_ATT_INDEX; - op->state = EG_DEC; - } - } - break; - - case EG_DEC: /* decay phase */ - if ( !(chip->eg_cnt & ((1<eg_sh_dr)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_dr + ((chip->eg_cnt>>op->eg_sh_dr)&7)]; - - if ( op->volume >= op->sl ) - op->state = EG_SUS; - } - break; - - case EG_SUS: /* sustain phase */ - /* this is important behaviour: - one can change percusive/non-percussive modes on the fly and - the chip will remain in sustain phase - verified on real YM3812 */ - - if(op->eg_type) /* non-percussive mode (sustained tone) */ - { - /* do nothing */ - } - else /* percussive mode */ - { - /* during sustain phase chip adds Release Rate (in percussive mode) */ - if ( !(chip->eg_cnt & ((1<eg_sh_rr)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_rr + ((chip->eg_cnt>>op->eg_sh_rr)&7)]; - - if ( op->volume >= MAX_ATT_INDEX ) - op->volume = MAX_ATT_INDEX; - } - /* else do nothing in sustain phase */ - } - break; - - case EG_REL: /* release phase */ - /* exclude modulators in melody channels from performing anything in this mode*/ - /* allowed are only carriers in melody mode and rhythm slots in rhythm mode */ - - /*This table shows which operators and on what conditions are allowed to perform EG_REL: - (a) - always perform EG_REL - (n) - never perform EG_REL - (r) - perform EG_REL in Rhythm mode ONLY - 0: 0 (n), 1 (a) - 1: 2 (n), 3 (a) - 2: 4 (n), 5 (a) - 3: 6 (n), 7 (a) - 4: 8 (n), 9 (a) - 5: 10(n), 11(a) - 6: 12(r), 13(a) - 7: 14(r), 15(a) - 8: 16(r), 17(a) - */ - if ( (i&1) || ((chip->rhythm&0x20) && (i>=12)) )/* exclude modulators */ - { - if(op->eg_type) /* non-percussive mode (sustained tone) */ - /*this is correct: use RR when SUS = OFF*/ - /*and use RS when SUS = ON*/ - { - if (CH->sus) - { - if ( !(chip->eg_cnt & ((1<eg_sh_rs)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_rs + ((chip->eg_cnt>>op->eg_sh_rs)&7)]; - if ( op->volume >= MAX_ATT_INDEX ) - { - op->volume = MAX_ATT_INDEX; - op->state = EG_OFF; - } - } - } - else - { - if ( !(chip->eg_cnt & ((1<eg_sh_rr)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_rr + ((chip->eg_cnt>>op->eg_sh_rr)&7)]; - if ( op->volume >= MAX_ATT_INDEX ) - { - op->volume = MAX_ATT_INDEX; - op->state = EG_OFF; - } - } - } - } - else /* percussive mode */ - { - if ( !(chip->eg_cnt & ((1<eg_sh_rs)-1) ) ) - { - op->volume += eg_inc[op->eg_sel_rs + ((chip->eg_cnt>>op->eg_sh_rs)&7)]; - if ( op->volume >= MAX_ATT_INDEX ) - { - op->volume = MAX_ATT_INDEX; - op->state = EG_OFF; - } - } - } - } - break; - - default: - break; - } - } - } - -//profiler_mark(PROFILER_END); - -//profiler_mark(PROFILER_USER4); - - for (i=0; i<9*2; i++) - { - CH = &chip->P_CH[i/2]; - op = &CH->SLOT[i&1]; - - /* Phase Generator */ - if(op->vib) - { - UINT8 block; - - unsigned int fnum_lfo = 8*((CH->block_fnum&0x01c0) >> 6); - unsigned int block_fnum = CH->block_fnum * 2; - signed int lfo_fn_table_index_offset = lfo_pm_table[LFO_PM + fnum_lfo ]; - - if (lfo_fn_table_index_offset) /* LFO phase modulation active */ - { - block_fnum += lfo_fn_table_index_offset; - block = (block_fnum&0x1c00) >> 10; - op->phase += (chip->fn_tab[block_fnum&0x03ff] >> (7-block)) * op->mul; - } - else /* LFO phase modulation = zero */ - { - op->phase += op->freq; - } - } - else /* LFO phase modulation disabled for this operator */ - { - op->phase += op->freq; - } - } - - /* The Noise Generator of the YM3812 is 23-bit shift register. - * Period is equal to 2^23-2 samples. - * Register works at sampling frequency of the chip, so output - * can change on every sample. - * - * Output of the register and input to the bit 22 is: - * bit0 XOR bit14 XOR bit15 XOR bit22 - * - * Simply use bit 22 as the noise output. - */ - - chip->noise_p += chip->noise_f; - i = chip->noise_p >> FREQ_SH; /* number of events (shifts of the shift register) */ - chip->noise_p &= FREQ_MASK; - while (i) - { - /* - UINT32 j; - j = ( (chip->noise_rng) ^ (chip->noise_rng>>14) ^ (chip->noise_rng>>15) ^ (chip->noise_rng>>22) ) & 1; - chip->noise_rng = (j<<22) | (chip->noise_rng>>1); - */ - - /* - Instead of doing all the logic operations above, we - use a trick here (and use bit 0 as the noise output). - The difference is only that the noise bit changes one - step ahead. This doesn't matter since we don't know - what is real state of the noise_rng after the reset. - */ - - if (chip->noise_rng & 1) chip->noise_rng ^= 0x800302; - chip->noise_rng >>= 1; - - i--; - } -//profiler_mark(PROFILER_END); -} - - -MAME_INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) -{ - UINT32 p; - - p = (env<<5) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + (pm<<17))) >> FREQ_SH ) & SIN_MASK) ]; - - if (p >= TL_TAB_LEN) - return 0; - return tl_tab[p]; -} - -MAME_INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) -{ - UINT32 p; - INT32 i; - - i = (phase & ~FREQ_MASK) + pm; - -/*logerror("i=%08x (i>>16)&511=%8i phase=%i [pm=%08x] ",i, (i>>16)&511, phase>>FREQ_SH, pm);*/ - - p = (env<<5) + sin_tab[ wave_tab + ((i>>FREQ_SH) & SIN_MASK)]; - -/*logerror("(p&255=%i p>>8=%i) out= %i\n", p&255,p>>8, tl_tab[p&255]>>(p>>8) );*/ - - if (p >= TL_TAB_LEN) - return 0; - return tl_tab[p]; -} - - -#define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (LFO_AM & (OP)->AMmask)) - -/* calculate output */ -MAME_INLINE void chan_calc( YM2413_OPLL_CH *CH ) -{ - YM2413_OPLL_SLOT *SLOT; - unsigned int env; - signed int out; - signed int phase_modulation; /* phase modulation input (SLOT 2) */ - - - /* SLOT 1 */ - SLOT = &CH->SLOT[SLOT1]; - env = volume_calc(SLOT); - out = SLOT->op1_out[0] + SLOT->op1_out[1]; - - SLOT->op1_out[0] = SLOT->op1_out[1]; - phase_modulation = SLOT->op1_out[0]; - - SLOT->op1_out[1] = 0; - - if( env < ENV_QUIET ) - { - if (!SLOT->fb_shift) - out = 0; - SLOT->op1_out[1] = op_calc1(SLOT->phase, env, (out<fb_shift), SLOT->wavetable ); - } - - /* SLOT 2 */ - -outchan=0; - - SLOT++; - env = volume_calc(SLOT); - if( env < ENV_QUIET ) - { - signed int outp = op_calc(SLOT->phase, env, phase_modulation, SLOT->wavetable); - output[0] += outp; - outchan = outp; - //output[0] += op_calc(SLOT->phase, env, phase_modulation, SLOT->wavetable); - } -} - -/* - operators used in the rhythm sounds generation process: - - Envelope Generator: - -channel operator register number Bass High Snare Tom Top -/ slot number TL ARDR SLRR Wave Drum Hat Drum Tom Cymbal - 6 / 0 12 50 70 90 f0 + - 6 / 1 15 53 73 93 f3 + - 7 / 0 13 51 71 91 f1 + - 7 / 1 16 54 74 94 f4 + - 8 / 0 14 52 72 92 f2 + - 8 / 1 17 55 75 95 f5 + - - Phase Generator: - -channel operator register number Bass High Snare Tom Top -/ slot number MULTIPLE Drum Hat Drum Tom Cymbal - 6 / 0 12 30 + - 6 / 1 15 33 + - 7 / 0 13 31 + + + - 7 / 1 16 34 ----- n o t u s e d ----- - 8 / 0 14 32 + - 8 / 1 17 35 + + - -channel operator register number Bass High Snare Tom Top -number number BLK/FNUM2 FNUM Drum Hat Drum Tom Cymbal - 6 12,15 B6 A6 + - - 7 13,16 B7 A7 + + + - - 8 14,17 B8 A8 + + + - -*/ - -/* calculate rhythm */ - -MAME_INLINE void rhythm_calc( YM2413_OPLL_CH *CH, unsigned int noise ) -{ - YM2413_OPLL_SLOT *SLOT; - signed int out; - unsigned int env; - signed int phase_modulation; /* phase modulation input (SLOT 2) */ - - - /* Bass Drum (verified on real YM3812): - - depends on the channel 6 'connect' register: - when connect = 0 it works the same as in normal (non-rhythm) mode (op1->op2->out) - when connect = 1 _only_ operator 2 is present on output (op2->out), operator 1 is ignored - - output sample always is multiplied by 2 - */ - - - /* SLOT 1 */ - SLOT = &CH[6].SLOT[SLOT1]; - env = volume_calc(SLOT); - - out = SLOT->op1_out[0] + SLOT->op1_out[1]; - SLOT->op1_out[0] = SLOT->op1_out[1]; - - phase_modulation = SLOT->op1_out[0]; - - SLOT->op1_out[1] = 0; - if( env < ENV_QUIET ) - { - if (!SLOT->fb_shift) - out = 0; - SLOT->op1_out[1] = op_calc1(SLOT->phase, env, (out<fb_shift), SLOT->wavetable ); - } - - /* SLOT 2 */ - SLOT++; - env = volume_calc(SLOT); - if( env < ENV_QUIET ) - output[1] += op_calc(SLOT->phase, env, phase_modulation, SLOT->wavetable) * 2; - - - /* Phase generation is based on: */ - // HH (13) channel 7->slot 1 combined with channel 8->slot 2 (same combination as TOP CYMBAL but different output phases) - // SD (16) channel 7->slot 1 - // TOM (14) channel 8->slot 1 - // TOP (17) channel 7->slot 1 combined with channel 8->slot 2 (same combination as HIGH HAT but different output phases) - - /* Envelope generation based on: */ - // HH channel 7->slot1 - // SD channel 7->slot2 - // TOM channel 8->slot1 - // TOP channel 8->slot2 - - - /* The following formulas can be well optimized. - I leave them in direct form for now (in case I've missed something). - */ - - /* High Hat (verified on real YM3812) */ - env = volume_calc(SLOT7_1); - if( env < ENV_QUIET ) - { - - /* high hat phase generation: - phase = d0 or 234 (based on frequency only) - phase = 34 or 2d0 (based on noise) - */ - - /* base frequency derived from operator 1 in channel 7 */ - unsigned char bit7 = ((SLOT7_1->phase>>FREQ_SH)>>7)&1; - unsigned char bit3 = ((SLOT7_1->phase>>FREQ_SH)>>3)&1; - unsigned char bit2 = ((SLOT7_1->phase>>FREQ_SH)>>2)&1; - - unsigned char res1 = (bit2 ^ bit7) | bit3; - - /* when res1 = 0 phase = 0x000 | 0xd0; */ - /* when res1 = 1 phase = 0x200 | (0xd0>>2); */ - UINT32 phase = res1 ? (0x200|(0xd0>>2)) : 0xd0; - - /* enable gate based on frequency of operator 2 in channel 8 */ - unsigned char bit5e= ((SLOT8_2->phase>>FREQ_SH)>>5)&1; - unsigned char bit3e= ((SLOT8_2->phase>>FREQ_SH)>>3)&1; - - unsigned char res2 = (bit3e | bit5e); - - /* when res2 = 0 pass the phase from calculation above (res1); */ - /* when res2 = 1 phase = 0x200 | (0xd0>>2); */ - if (res2) - phase = (0x200|(0xd0>>2)); - - - /* when phase & 0x200 is set and noise=1 then phase = 0x200|0xd0 */ - /* when phase & 0x200 is set and noise=0 then phase = 0x200|(0xd0>>2), ie no change */ - if (phase&0x200) - { - if (noise) - phase = 0x200|0xd0; - } - else - /* when phase & 0x200 is clear and noise=1 then phase = 0xd0>>2 */ - /* when phase & 0x200 is clear and noise=0 then phase = 0xd0, ie no change */ - { - if (noise) - phase = 0xd0>>2; - } - - output[1] += op_calc(phase<wavetable) * 2; - } - - /* Snare Drum (verified on real YM3812) */ - env = volume_calc(SLOT7_2); - if( env < ENV_QUIET ) - { - /* base frequency derived from operator 1 in channel 7 */ - unsigned char bit8 = ((SLOT7_1->phase>>FREQ_SH)>>8)&1; - - /* when bit8 = 0 phase = 0x100; */ - /* when bit8 = 1 phase = 0x200; */ - UINT32 phase = bit8 ? 0x200 : 0x100; - - /* Noise bit XOR'es phase by 0x100 */ - /* when noisebit = 0 pass the phase from calculation above */ - /* when noisebit = 1 phase ^= 0x100; */ - /* in other words: phase ^= (noisebit<<8); */ - if (noise) - phase ^= 0x100; - - output[1] += op_calc(phase<wavetable) * 2; - } - - /* Tom Tom (verified on real YM3812) */ - env = volume_calc(SLOT8_1); - if( env < ENV_QUIET ) - output[1] += op_calc(SLOT8_1->phase, env, 0, SLOT8_1->wavetable) * 2; - - /* Top Cymbal (verified on real YM2413) */ - env = volume_calc(SLOT8_2); - if( env < ENV_QUIET ) - { - /* base frequency derived from operator 1 in channel 7 */ - unsigned char bit7 = ((SLOT7_1->phase>>FREQ_SH)>>7)&1; - unsigned char bit3 = ((SLOT7_1->phase>>FREQ_SH)>>3)&1; - unsigned char bit2 = ((SLOT7_1->phase>>FREQ_SH)>>2)&1; - - unsigned char res1 = (bit2 ^ bit7) | bit3; - - /* when res1 = 0 phase = 0x000 | 0x100; */ - /* when res1 = 1 phase = 0x200 | 0x100; */ - UINT32 phase = res1 ? 0x300 : 0x100; - - /* enable gate based on frequency of operator 2 in channel 8 */ - unsigned char bit5e= ((SLOT8_2->phase>>FREQ_SH)>>5)&1; - unsigned char bit3e= ((SLOT8_2->phase>>FREQ_SH)>>3)&1; - - unsigned char res2 = (bit3e | bit5e); - /* when res2 = 0 pass the phase from calculation above (res1); */ - /* when res2 = 1 phase = 0x200 | 0x100; */ - if (res2) - phase = 0x300; - - output[1] += op_calc(phase<wavetable) * 2; - } - -} - - -/* generic table initialize */ -static int init_tables(void) -{ - signed int i,x; - signed int n; - double o,m; - - - for (x=0; x>= 4; /* 12 bits here */ - if (n&1) /* round to nearest */ - n = (n>>1)+1; - else - n = n>>1; - /* 11 bits here (rounded) */ - tl_tab[ x*2 + 0 ] = n; - tl_tab[ x*2 + 1 ] = -tl_tab[ x*2 + 0 ]; - - for (i=1; i<11; i++) - { - tl_tab[ x*2+0 + i*2*TL_RES_LEN ] = tl_tab[ x*2+0 ]>>i; - tl_tab[ x*2+1 + i*2*TL_RES_LEN ] = -tl_tab[ x*2+0 + i*2*TL_RES_LEN ]; - } - #if 0 - logerror("tl %04i", x*2); - for (i=0; i<11; i++) - logerror(", [%02i] %5i", i*2, tl_tab[ x*2 /*+1*/ + i*2*TL_RES_LEN ] ); - logerror("\n"); - #endif - } - /*logerror("ym2413.c: TL_TAB_LEN = %i elements (%i bytes)\n",TL_TAB_LEN, (int)sizeof(tl_tab));*/ - - - for (i=0; i0.0) - o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */ - else - o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */ - - o = o / (ENV_STEP/4); - - n = (int)(2.0*o); - if (n&1) /* round to nearest */ - n = (n>>1)+1; - else - n = n>>1; - - /* waveform 0: standard sinus */ - sin_tab[ i ] = n*2 + (m>=0.0? 0: 1 ); - - /*logerror("ym2413.c: sin [%4i (hex=%03x)]= %4i (tl_tab value=%5i)\n", i, i, sin_tab[i], tl_tab[sin_tab[i]] );*/ - - - /* waveform 1: __ __ */ - /* / \____/ \____*/ - /* output only first half of the sinus waveform (positive one) */ - if (i & (1<<(SIN_BITS-1)) ) - sin_tab[1*SIN_LEN+i] = TL_TAB_LEN; - else - sin_tab[1*SIN_LEN+i] = sin_tab[i]; - - /*logerror("ym2413.c: sin1[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[1*SIN_LEN+i], tl_tab[sin_tab[1*SIN_LEN+i]] );*/ - } -#if 0 - logerror("YM2413.C: ENV_QUIET= %08x (*32=%08x)\n", ENV_QUIET, ENV_QUIET*32 ); - for (i=0; ifreqbase = (chip->rate) ? ((double)chip->clock / 72.0) / chip->rate : 0; -#if 0 - chip->rate = (double)chip->clock / 72.0; - chip->freqbase = 1.0; - logerror("freqbase=%f\n", chip->freqbase); -#endif - - /* make fnumber -> increment counter table */ - for( i = 0 ; i < 1024; i++ ) - { - /* OPLL (YM2413) phase increment counter = 18bit */ - - chip->fn_tab[i] = (UINT32)( (double)i * 64 * chip->freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ -#if 0 - logerror("ym2413.c: fn_tab[%4i] = %08x (dec=%8i)\n", - i, chip->fn_tab[i]>>6, chip->fn_tab[i]>>6 ); -#endif - } - -#if 0 - for( i=0 ; i < 16 ; i++ ) - { - logerror("ym2413.c: sl_tab[%i] = %08x\n", i, sl_tab[i] ); - } - for( i=0 ; i < 8 ; i++ ) - { - int j; - logerror("ym2413.c: ksl_tab[oct=%2i] =",i); - for (j=0; j<16; j++) - { - logerror("%08x ", ksl_tab[i*16+j] ); - } - logerror("\n"); - } -#endif - - - /* Amplitude modulation: 27 output levels (triangle waveform); 1 level takes one of: 192, 256 or 448 samples */ - /* One entry from LFO_AM_TABLE lasts for 64 samples */ - chip->lfo_am_inc = (1.0 / 64.0 ) * (1<freqbase; - - /* Vibrato: 8 output levels (triangle waveform); 1 level takes 1024 samples */ - chip->lfo_pm_inc = (1.0 / 1024.0) * (1<freqbase; - - /*logerror ("chip->lfo_am_inc = %8x ; chip->lfo_pm_inc = %8x\n", chip->lfo_am_inc, chip->lfo_pm_inc);*/ - - /* Noise generator: a step takes 1 sample */ - chip->noise_f = (1.0 / 1.0) * (1<freqbase; - /*logerror("YM2413init noise_f=%8x\n", chip->noise_f);*/ - - chip->eg_timer_add = (1<freqbase; - chip->eg_timer_overflow = ( 1 ) * (1<eg_timer_add, chip->eg_timer_overflow);*/ - -} - -MAME_INLINE void KEY_ON(YM2413_OPLL_SLOT *SLOT, UINT32 key_set) -{ - if( !SLOT->key ) - { - /* do NOT restart Phase Generator (verified on real YM2413)*/ - /* phase -> Dump */ - SLOT->state = EG_DMP; - } - SLOT->key |= key_set; -} - -MAME_INLINE void KEY_OFF(YM2413_OPLL_SLOT *SLOT, UINT32 key_clr) -{ - if( SLOT->key ) - { - SLOT->key &= key_clr; - - if( !SLOT->key ) - { - /* phase -> Release */ - if (SLOT->state>EG_REL) - SLOT->state = EG_REL; - } - } -} - -/* update phase increment counter of operator (also update the EG rates if necessary) */ -MAME_INLINE void CALC_FCSLOT(YM2413_OPLL_CH *CH,YM2413_OPLL_SLOT *SLOT) -{ - int ksr; - UINT32 SLOT_rs; - UINT32 SLOT_dp; - - /* (frequency) phase increment counter */ - SLOT->freq = CH->fc * SLOT->mul; - ksr = CH->kcode >> SLOT->KSR; - - if( SLOT->ksr != ksr ) - { - SLOT->ksr = ksr; - - /* calculate envelope generator rates */ - if ((SLOT->ar + SLOT->ksr) < 16+62) - { - SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; - SLOT->eg_sel_ar = eg_rate_select[SLOT->ar + SLOT->ksr ]; - } - else - { - SLOT->eg_sh_ar = 0; - SLOT->eg_sel_ar = 13*RATE_STEPS; - } - SLOT->eg_sh_dr = eg_rate_shift [SLOT->dr + SLOT->ksr ]; - SLOT->eg_sel_dr = eg_rate_select[SLOT->dr + SLOT->ksr ]; - SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr ]; - SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr ]; - - } - - if (CH->sus) - SLOT_rs = 16 + (5<<2); - else - SLOT_rs = 16 + (7<<2); - - SLOT->eg_sh_rs = eg_rate_shift [SLOT_rs + SLOT->ksr ]; - SLOT->eg_sel_rs = eg_rate_select[SLOT_rs + SLOT->ksr ]; - - SLOT_dp = 16 + (13<<2); - SLOT->eg_sh_dp = eg_rate_shift [SLOT_dp + SLOT->ksr ]; - SLOT->eg_sel_dp = eg_rate_select[SLOT_dp + SLOT->ksr ]; -} - -/* set multi,am,vib,EG-TYP,KSR,mul */ -MAME_INLINE void set_mul(YM2413 *chip,int slot,int v) -{ - YM2413_OPLL_CH *CH = &chip->P_CH[slot/2]; - YM2413_OPLL_SLOT *SLOT = &CH->SLOT[slot&1]; - - SLOT->mul = mul_tab[v&0x0f]; - SLOT->KSR = (v&0x10) ? 0 : 2; - SLOT->eg_type = (v&0x20); - SLOT->vib = (v&0x40); - SLOT->AMmask = (v&0x80) ? ~0 : 0; - CALC_FCSLOT(CH,SLOT); -} - -/* set ksl, tl */ -MAME_INLINE void set_ksl_tl(YM2413 *chip,int chan,int v) -{ - int ksl; - YM2413_OPLL_CH *CH = &chip->P_CH[chan]; -/* modulator */ - YM2413_OPLL_SLOT *SLOT = &CH->SLOT[SLOT1]; - - ksl = v>>6; /* 0 / 1.5 / 3.0 / 6.0 dB/OCT */ - - SLOT->ksl = ksl ? 3-ksl : 31; - SLOT->TL = (v&0x3f)<<(ENV_BITS-2-7); /* 7 bits TL (bit 6 = always 0) */ - SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl); -} - -/* set ksl , waveforms, feedback */ -MAME_INLINE void set_ksl_wave_fb(YM2413 *chip,int chan,int v) -{ - int ksl; - YM2413_OPLL_CH *CH = &chip->P_CH[chan]; -/* modulator */ - YM2413_OPLL_SLOT *SLOT = &CH->SLOT[SLOT1]; - SLOT->wavetable = ((v&0x08)>>3)*SIN_LEN; - SLOT->fb_shift = (v&7) ? (v&7) + 8 : 0; - -/*carrier*/ - SLOT = &CH->SLOT[SLOT2]; - ksl = v>>6; /* 0 / 1.5 / 3.0 / 6.0 dB/OCT */ - - SLOT->ksl = ksl ? 3-ksl : 31; - SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl); - - SLOT->wavetable = ((v&0x10)>>4)*SIN_LEN; -} - -/* set attack rate & decay rate */ -MAME_INLINE void set_ar_dr(YM2413 *chip,int slot,int v) -{ - YM2413_OPLL_CH *CH = &chip->P_CH[slot/2]; - YM2413_OPLL_SLOT *SLOT = &CH->SLOT[slot&1]; - - SLOT->ar = (v>>4) ? 16 + ((v>>4) <<2) : 0; - - if ((SLOT->ar + SLOT->ksr) < 16+62) - { - SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; - SLOT->eg_sel_ar = eg_rate_select[SLOT->ar + SLOT->ksr ]; - } - else - { - SLOT->eg_sh_ar = 0; - SLOT->eg_sel_ar = 13*RATE_STEPS; - } - - SLOT->dr = (v&0x0f)? 16 + ((v&0x0f)<<2) : 0; - SLOT->eg_sh_dr = eg_rate_shift [SLOT->dr + SLOT->ksr ]; - SLOT->eg_sel_dr = eg_rate_select[SLOT->dr + SLOT->ksr ]; -} - -/* set sustain level & release rate */ -MAME_INLINE void set_sl_rr(YM2413 *chip,int slot,int v) -{ - YM2413_OPLL_CH *CH = &chip->P_CH[slot/2]; - YM2413_OPLL_SLOT *SLOT = &CH->SLOT[slot&1]; - - SLOT->sl = sl_tab[ v>>4 ]; - - SLOT->rr = (v&0x0f)? 16 + ((v&0x0f)<<2) : 0; - SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr ]; - SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr ]; -} - -static void load_instrument(YM2413 *chip, UINT32 chan, UINT32 slot, UINT8* inst ) -{ - set_mul (chip, slot, inst[0]); - set_mul (chip, slot+1, inst[1]); - set_ksl_tl (chip, chan, inst[2]); - set_ksl_wave_fb (chip, chan, inst[3]); - set_ar_dr (chip, slot, inst[4]); - set_ar_dr (chip, slot+1, inst[5]); - set_sl_rr (chip, slot, inst[6]); - set_sl_rr (chip, slot+1, inst[7]); -} -static void update_instrument_zero(YM2413 *chip, UINT8 r ) -{ - UINT8* inst = &chip->inst_tab[0][0]; /* point to user instrument */ - UINT32 chan; - UINT32 chan_max; - - chan_max = 9; - if (chip->rhythm & 0x20) - chan_max=6; - - switch(r) - { - case 0: - for (chan=0; chaninstvol_r[chan]&0xf0)==0) - { - set_mul (chip, chan*2, inst[0]); - } - } - break; - case 1: - for (chan=0; chaninstvol_r[chan]&0xf0)==0) - { - set_mul (chip, chan*2+1,inst[1]); - } - } - break; - case 2: - for (chan=0; chaninstvol_r[chan]&0xf0)==0) - { - set_ksl_tl (chip, chan, inst[2]); - } - } - break; - case 3: - for (chan=0; chaninstvol_r[chan]&0xf0)==0) - { - set_ksl_wave_fb (chip, chan, inst[3]); - } - } - break; - case 4: - for (chan=0; chaninstvol_r[chan]&0xf0)==0) - { - set_ar_dr (chip, chan*2, inst[4]); - } - } - break; - case 5: - for (chan=0; chaninstvol_r[chan]&0xf0)==0) - { - set_ar_dr (chip, chan*2+1,inst[5]); - } - } - break; - case 6: - for (chan=0; chaninstvol_r[chan]&0xf0)==0) - { - set_sl_rr (chip, chan*2, inst[6]); - } - } - break; - case 7: - for (chan=0; chaninstvol_r[chan]&0xf0)==0) - { - set_sl_rr (chip, chan*2+1,inst[7]); - } - } - break; - } -} - -/* write a value v to register r on chip chip */ -static void OPLLWriteReg(YM2413 *chip, int r, int v) -{ - YM2413_OPLL_CH *CH; - YM2413_OPLL_SLOT *SLOT; - UINT8 *inst; - int chan; - int slot; - - /* adjust bus to 8 bits */ - r &= 0xff; - v &= 0xff; - - -#ifdef LOG_CYM_FILE - if ((cymfile) && (r!=8) ) - { - fputc( (unsigned char)r, cymfile ); - fputc( (unsigned char)v, cymfile ); - } -#endif - - - switch(r&0xf0) - { - case 0x00: /* 00-0f:control */ - { - switch(r&0x0f) - { - case 0x00: /* AM/VIB/EGTYP/KSR/MULTI (modulator) */ - case 0x01: /* AM/VIB/EGTYP/KSR/MULTI (carrier) */ - case 0x02: /* Key Scale Level, Total Level (modulator) */ - case 0x03: /* Key Scale Level, carrier waveform, modulator waveform, Feedback */ - case 0x04: /* Attack, Decay (modulator) */ - case 0x05: /* Attack, Decay (carrier) */ - case 0x06: /* Sustain, Release (modulator) */ - case 0x07: /* Sustain, Release (carrier) */ - chip->inst_tab[0][r & 0x07] = v; - update_instrument_zero(chip,r&7); - break; - - case 0x0e: /* x, x, r,bd,sd,tom,tc,hh */ - { - if(v&0x20) - { - if ((chip->rhythm&0x20)==0) - /*rhythm off to on*/ - { - logerror("YM2413: Rhythm mode enable\n"); - - /* Load instrument settings for channel seven(chan=6 since we're zero based). (Bass drum) */ - chan = 6; - inst = &chip->inst_tab[16][0]; - slot = chan*2; - - load_instrument(chip, chan, slot, inst); - - /* Load instrument settings for channel eight. (High hat and snare drum) */ - chan = 7; - inst = &chip->inst_tab[17][0]; - slot = chan*2; - - load_instrument(chip, chan, slot, inst); - - CH = &chip->P_CH[chan]; - SLOT = &CH->SLOT[SLOT1]; /* modulator envelope is HH */ - SLOT->TL = ((chip->instvol_r[chan]>>4)<<2)<<(ENV_BITS-2-7); /* 7 bits TL (bit 6 = always 0) */ - SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl); - - /* Load instrument settings for channel nine. (Tom-tom and top cymbal) */ - chan = 8; - inst = &chip->inst_tab[18][0]; - slot = chan*2; - - load_instrument(chip, chan, slot, inst); - - CH = &chip->P_CH[chan]; - SLOT = &CH->SLOT[SLOT1]; /* modulator envelope is TOM */ - SLOT->TL = ((chip->instvol_r[chan]>>4)<<2)<<(ENV_BITS-2-7); /* 7 bits TL (bit 6 = always 0) */ - SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl); - } - /* BD key on/off */ - if(v&0x10) - { - KEY_ON (&chip->P_CH[6].SLOT[SLOT1], 2); - KEY_ON (&chip->P_CH[6].SLOT[SLOT2], 2); - } - else - { - KEY_OFF(&chip->P_CH[6].SLOT[SLOT1],~2); - KEY_OFF(&chip->P_CH[6].SLOT[SLOT2],~2); - } - /* HH key on/off */ - if(v&0x01) KEY_ON (&chip->P_CH[7].SLOT[SLOT1], 2); - else KEY_OFF(&chip->P_CH[7].SLOT[SLOT1],~2); - /* SD key on/off */ - if(v&0x08) KEY_ON (&chip->P_CH[7].SLOT[SLOT2], 2); - else KEY_OFF(&chip->P_CH[7].SLOT[SLOT2],~2); - /* TOM key on/off */ - if(v&0x04) KEY_ON (&chip->P_CH[8].SLOT[SLOT1], 2); - else KEY_OFF(&chip->P_CH[8].SLOT[SLOT1],~2); - /* TOP-CY key on/off */ - if(v&0x02) KEY_ON (&chip->P_CH[8].SLOT[SLOT2], 2); - else KEY_OFF(&chip->P_CH[8].SLOT[SLOT2],~2); - } - else - { - if (chip->rhythm&0x20) - /*rhythm on to off*/ - { - logerror("YM2413: Rhythm mode disable\n"); - /* Load instrument settings for channel seven(chan=6 since we're zero based).*/ - chan = 6; - inst = &chip->inst_tab[chip->instvol_r[chan]>>4][0]; - slot = chan*2; - - load_instrument(chip, chan, slot, inst); - - /* Load instrument settings for channel eight.*/ - chan = 7; - inst = &chip->inst_tab[chip->instvol_r[chan]>>4][0]; - slot = chan*2; - - load_instrument(chip, chan, slot, inst); - - /* Load instrument settings for channel nine.*/ - chan = 8; - inst = &chip->inst_tab[chip->instvol_r[chan]>>4][0]; - slot = chan*2; - - load_instrument(chip, chan, slot, inst); - } - /* BD key off */ - KEY_OFF(&chip->P_CH[6].SLOT[SLOT1],~2); - KEY_OFF(&chip->P_CH[6].SLOT[SLOT2],~2); - /* HH key off */ - KEY_OFF(&chip->P_CH[7].SLOT[SLOT1],~2); - /* SD key off */ - KEY_OFF(&chip->P_CH[7].SLOT[SLOT2],~2); - /* TOM key off */ - KEY_OFF(&chip->P_CH[8].SLOT[SLOT1],~2); - /* TOP-CY off */ - KEY_OFF(&chip->P_CH[8].SLOT[SLOT2],~2); - } - chip->rhythm = v&0x3f; - } - break; - } - } - break; - - case 0x10: - case 0x20: - { - int block_fnum; - - chan = r&0x0f; - - if (chan >= 9) - chan -= 9; /* verified on real YM2413 */ - - CH = &chip->P_CH[chan]; - - if(r&0x10) - { /* 10-18: FNUM 0-7 */ - block_fnum = (CH->block_fnum&0x0f00) | v; - } - else - { /* 20-28: suson, keyon, block, FNUM 8 */ - block_fnum = ((v&0x0f)<<8) | (CH->block_fnum&0xff); - - if(v&0x10) - { - KEY_ON (&CH->SLOT[SLOT1], 1); - KEY_ON (&CH->SLOT[SLOT2], 1); - } - else - { - KEY_OFF(&CH->SLOT[SLOT1],~1); - KEY_OFF(&CH->SLOT[SLOT2],~1); - } - - - if (CH->sus!=(v&0x20)) - logerror("chan=%i sus=%2x\n",chan,v&0x20); - - CH->sus = v & 0x20; - } - /* update */ - if(CH->block_fnum != block_fnum) - { - UINT8 block; - - CH->block_fnum = block_fnum; - - /* BLK 2,1,0 bits -> bits 3,2,1 of kcode, FNUM MSB -> kcode LSB */ - CH->kcode = (block_fnum&0x0f00)>>8; - - CH->ksl_base = ksl_tab[block_fnum>>5]; - - block_fnum = block_fnum * 2; - block = (block_fnum&0x1c00) >> 10; - CH->fc = chip->fn_tab[block_fnum&0x03ff] >> (7-block); - - /* refresh Total Level in both SLOTs of this channel */ - CH->SLOT[SLOT1].TLL = CH->SLOT[SLOT1].TL + (CH->ksl_base>>CH->SLOT[SLOT1].ksl); - CH->SLOT[SLOT2].TLL = CH->SLOT[SLOT2].TL + (CH->ksl_base>>CH->SLOT[SLOT2].ksl); - - /* refresh frequency counter in both SLOTs of this channel */ - CALC_FCSLOT(CH,&CH->SLOT[SLOT1]); - CALC_FCSLOT(CH,&CH->SLOT[SLOT2]); - } - } - break; - - case 0x30: /* inst 4 MSBs, VOL 4 LSBs */ - { - UINT8 old_instvol; - - chan = r&0x0f; - - if (chan >= 9) - chan -= 9; /* verified on real YM2413 */ - - old_instvol = chip->instvol_r[chan]; - chip->instvol_r[chan] = v; /* store for later use */ - - CH = &chip->P_CH[chan]; - SLOT = &CH->SLOT[SLOT2]; /* carrier */ - SLOT->TL = ((v&0x0f)<<2)<<(ENV_BITS-2-7); /* 7 bits TL (bit 6 = always 0) */ - SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl); - - - /*check wether we are in rhythm mode and handle instrument/volume register accordingly*/ - if ((chan>=6) && (chip->rhythm&0x20)) - { - /* we're in rhythm mode*/ - - if (chan>=7) /* only for channel 7 and 8 (channel 6 is handled in usual way)*/ - { - SLOT = &CH->SLOT[SLOT1]; /* modulator envelope is HH(chan=7) or TOM(chan=8) */ - SLOT->TL = ((chip->instvol_r[chan]>>4)<<2)<<(ENV_BITS-2-7); /* 7 bits TL (bit 6 = always 0) */ - SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl); - } - } - else - { - if ( (old_instvol&0xf0) == (v&0xf0) ) - return; - - inst = &chip->inst_tab[chip->instvol_r[chan]>>4][0]; - slot = chan*2; - - load_instrument(chip, chan, slot, inst); - - #if 0 - logerror("YM2413: chan#%02i inst=%02i: (r=%2x, v=%2x)\n",chan,v>>4,r,v); - logerror(" 0:%2x 1:%2x\n",inst[0],inst[1]); logerror(" 2:%2x 3:%2x\n",inst[2],inst[3]); - logerror(" 4:%2x 5:%2x\n",inst[4],inst[5]); logerror(" 6:%2x 7:%2x\n",inst[6],inst[7]); - #endif - } - } - break; - - default: - break; - } -} - -#ifdef LOG_CYM_FILE -static void cymfile_callback (int n) -{ - if (cymfile) - { - fputc( (unsigned char)8, cymfile ); - } -} -#endif - -/* lock/unlock for common table */ -static int OPLL_LockTable(void) -{ - num_lock++; - if(num_lock>1) return 0; - - /* first time */ - - cur_chip = NULL; - /* allocate total level table (128kb space) */ - if( !init_tables() ) - { - num_lock--; - return -1; - } - -#ifdef LOG_CYM_FILE - cymfile = fopen("2413_.cym","wb"); - if (cymfile) - timer_pulse ( TIME_IN_HZ(110), 0, cymfile_callback); /*110 Hz pulse timer*/ - else - logerror("Could not create file 2413_.cym\n"); -#endif - - return 0; -} - -static void OPLL_UnLockTable(void) -{ - if(num_lock) num_lock--; - if(num_lock) return; - - /* last time */ - - cur_chip = NULL; - OPLCloseTable(); - -#ifdef LOG_CYM_FILE - fclose (cymfile); - cymfile = NULL; -#endif - -} - -static void OPLLResetChip(YM2413 *chip) -{ - int c,s; - int i; - - chip->eg_timer = 0; - chip->eg_cnt = 0; - - chip->noise_rng = 1; /* noise shift register */ - - - /* setup instruments table */ - for (i=0; i<19; i++) - { - for (c=0; c<8; c++) - { - chip->inst_tab[i][c] = table[i][c]; - } - } - - - /* reset with register write */ - OPLLWriteReg(chip,0x0f,0); /*test reg*/ - for(i = 0x3f ; i >= 0x10 ; i-- ) OPLLWriteReg(chip,i,0x00); - - /* reset operator parameters */ - for( c = 0 ; c < 9 ; c++ ) - { - YM2413_OPLL_CH *CH = &chip->P_CH[c]; - for(s = 0 ; s < 2 ; s++ ) - { - /* wave table */ - CH->SLOT[s].wavetable = 0; - CH->SLOT[s].state = EG_OFF; - CH->SLOT[s].volume = MAX_ATT_INDEX; - } - } -} - -/* Create one of virtual YM2413 */ -/* 'clock' is chip clock in Hz */ -/* 'rate' is sampling rate */ -static YM2413 *OPLLCreate(int clock, int rate) -{ - char *ptr; - YM2413 *chip; - int state_size; - - if (OPLL_LockTable() ==-1) return NULL; - - /* calculate chip state size */ - state_size = sizeof(YM2413); - - /* allocate memory block */ - ptr = malloc(state_size); - - if (ptr==NULL) - return NULL; - - /* clear */ - memset(ptr,0,state_size); - - chip = (YM2413 *)ptr; - - chip->clock = clock; - chip->rate = rate; - - /* init global tables */ - OPLL_initalize(chip); - - /* reset chip */ - OPLLResetChip(chip); - return chip; -} - -/* Destroy one of virtual YM3812 */ -static void OPLLDestroy(YM2413 *chip) -{ - OPLL_UnLockTable(); - if (chip) { - free(chip); - chip = NULL; - } -} - -/* Option handlers */ - -static void OPLLSetUpdateHandler(YM2413 *chip,OPLL_UPDATEHANDLER UpdateHandler,int param) -{ - chip->UpdateHandler = UpdateHandler; - chip->UpdateParam = param; -} - -/* YM3812 I/O interface */ -static void OPLLWrite(YM2413 *chip,int a,int v) -{ - if( !(a&1) ) - { /* address port */ - chip->address = v & 0xff; - } - else - { /* data port */ - if(chip->UpdateHandler) chip->UpdateHandler(chip->UpdateParam,0); - OPLLWriteReg(chip,chip->address,v); - } -} - -static unsigned char OPLLRead(YM2413 *chip,int a) -{ - if( !(a&1) ) - { - /* status port */ - return chip->status; - } - return 0xff; -} - - - - - -#define MAX_OPLL_CHIPS 4 - - -static YM2413 *OPLL_YM2413[MAX_OPLL_CHIPS]; /* array of pointers to the YM2413's */ -static int YM2413NumChips = 0; /* number of chips */ - -int YM2413Init(int num, int clock, int rate) -{ - int i; - - if (YM2413NumChips) - return -1; /* duplicate init. */ - - YM2413NumChips = num; - - for (i = 0;i < YM2413NumChips; i++) - { - /* emulator create */ - OPLL_YM2413[i] = OPLLCreate(clock, rate); - if(OPLL_YM2413[i] == NULL) - { - /* it's really bad - we run out of memeory */ - YM2413NumChips = 0; - return -1; - } - } - - return 0; -} - -void YM2413Shutdown(void) -{ - int i; - - for (i = 0;i < YM2413NumChips; i++) - { - /* emulator shutdown */ - if(OPLL_YM2413[i]) - OPLLDestroy(OPLL_YM2413[i]); - OPLL_YM2413[i] = NULL; - } - YM2413NumChips = 0; -} - -void YM2413ResetChip(int which) -{ - OPLLResetChip(OPLL_YM2413[which]); -} - -void YM2413Write(int which, int a, int v) -{ - OPLLWrite(OPLL_YM2413[which], a, v); -} - -void YM2413WriteReg(int which, int r, int v) -{ - OPLLWriteReg(OPLL_YM2413[which], r, v); -} - -unsigned char YM2413Read(int which, int a) -{ - return OPLLRead(OPLL_YM2413[which], a) & 0x03 ; -} - -void YM2413SetUpdateHandler(int which,OPLL_UPDATEHANDLER UpdateHandler,int param) -{ - OPLLSetUpdateHandler(OPLL_YM2413[which], UpdateHandler, param); -} - - -/* -** Generate samples for one of the YM2413's -** -** 'which' is the virtual YM2413 number -** '*buffer' is the output buffer pointer -** 'length' is the number of samples that should be generated -*/ -void YM2413UpdateOne(int which, INT16 **buffers, int length) -{ - YM2413 *chip = OPLL_YM2413[which]; - UINT8 rhythm = chip->rhythm&0x20; - SAMP *bufMO = buffers[0]; - SAMP *bufRO = buffers[1]; - - int i; - - if( (void *)chip != cur_chip ){ - cur_chip = (void *)chip; - /* rhythm slots */ - SLOT7_1 = &chip->P_CH[7].SLOT[SLOT1]; - SLOT7_2 = &chip->P_CH[7].SLOT[SLOT2]; - SLOT8_1 = &chip->P_CH[8].SLOT[SLOT1]; - SLOT8_2 = &chip->P_CH[8].SLOT[SLOT2]; - } - - - for( i=0; i < length ; i++ ) - { - int mo,ro; - - output[0] = 0; - output[1] = 0; - - advance_lfo(chip); - - /* FM part */ - chan_calc(&chip->P_CH[0]); -//SAVE_SEPARATE_CHANNEL(0); - chan_calc(&chip->P_CH[1]); - chan_calc(&chip->P_CH[2]); - chan_calc(&chip->P_CH[3]); - chan_calc(&chip->P_CH[4]); - chan_calc(&chip->P_CH[5]); - - if(!rhythm) - { - chan_calc(&chip->P_CH[6]); - chan_calc(&chip->P_CH[7]); - chan_calc(&chip->P_CH[8]); - } - else /* Rhythm part */ - { - rhythm_calc(&chip->P_CH[0], (chip->noise_rng>>0)&1 ); - } - - mo = output[0]; - ro = output[1]; - - mo >>= FINAL_SH; - ro >>= FINAL_SH; - - /* limit check */ - mo = limit( mo , MAXOUT, MINOUT ); - ro = limit( ro , MAXOUT, MINOUT ); - - #ifdef SAVE_SAMPLE - if (which==0) - { - SAVE_ALL_CHANNELS - } - #endif - - /* store to sound buffer */ - bufMO[i] = mo; - bufRO[i] = ro; - - advance(chip); - } - -} - -void YM2413Scan(INT32 which, INT32 nAction) -{ - YM2413 *chip = OPLL_YM2413[which]; - - if (nAction & ACB_DRIVER_DATA) { - INT32 chnum; - INT32 slotnum; - - SCAN_VAR(chip->instvol_r); - SCAN_VAR(chip->eg_cnt); - SCAN_VAR(chip->eg_timer); - SCAN_VAR(chip->eg_timer_add); - SCAN_VAR(chip->eg_timer_overflow); - SCAN_VAR(chip->rhythm); - SCAN_VAR(chip->lfo_am_cnt); - SCAN_VAR(chip->lfo_am_inc); - SCAN_VAR(chip->lfo_pm_cnt); - SCAN_VAR(chip->lfo_pm_inc); - SCAN_VAR(chip->noise_rng); - SCAN_VAR(chip->noise_p); - SCAN_VAR(chip->noise_f); - SCAN_VAR(chip->inst_tab); - SCAN_VAR(chip->address); - SCAN_VAR(chip->status); - - for (chnum = 0; chnum < 9; chnum++) { - YM2413_OPLL_CH *ch = &chip->P_CH[chnum]; - - SCAN_VAR(ch->block_fnum); - SCAN_VAR(ch->fc); - SCAN_VAR(ch->ksl_base); - SCAN_VAR(ch->kcode); - SCAN_VAR(ch->sus); - - for (slotnum = 0; slotnum < 2; slotnum++) { - YM2413_OPLL_SLOT *sl = &ch->SLOT[slotnum]; - - SCAN_VAR(sl->ar); - SCAN_VAR(sl->dr); - SCAN_VAR(sl->rr); - SCAN_VAR(sl->KSR); - SCAN_VAR(sl->ksl); - SCAN_VAR(sl->ksr); - SCAN_VAR(sl->mul); - SCAN_VAR(sl->phase); - SCAN_VAR(sl->freq); - SCAN_VAR(sl->fb_shift); - SCAN_VAR(sl->op1_out); - SCAN_VAR(sl->eg_type); - SCAN_VAR(sl->state); - SCAN_VAR(sl->TL); - SCAN_VAR(sl->TLL); - SCAN_VAR(sl->volume); - SCAN_VAR(sl->sl); - SCAN_VAR(sl->eg_sh_dp); - SCAN_VAR(sl->eg_sel_dp); - SCAN_VAR(sl->eg_sh_ar); - SCAN_VAR(sl->eg_sel_ar); - SCAN_VAR(sl->eg_sh_dr); - SCAN_VAR(sl->eg_sel_dr); - SCAN_VAR(sl->eg_sh_rr); - SCAN_VAR(sl->eg_sel_rr); - SCAN_VAR(sl->eg_sh_rs); - SCAN_VAR(sl->eg_sel_rs); - SCAN_VAR(sl->key); - SCAN_VAR(sl->AMmask); - SCAN_VAR(sl->vib); - SCAN_VAR(sl->wavetable); - } - } - } -} diff --git a/jan/src/burn/snd/ym2413.h b/jan/src/burn/snd/ym2413.h deleted file mode 100644 index 4c953fbcf..000000000 --- a/jan/src/burn/snd/ym2413.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _H_YM2413_ -#define _H_YM2413_ - -/* select output bits size of output : 8 or 16 */ -#define SAMPLE_BITS 16 - -#if (SAMPLE_BITS==16) -typedef INT16 SAMP; -#endif -#if (SAMPLE_BITS==8) -typedef INT8 SAMP; -#endif - - - - -int YM2413Init(int num, int clock, int rate); -void YM2413Shutdown(void); -void YM2413ResetChip(int which); -void YM2413Write(int which, int a, int v); -void YM2413WriteReg(int which, int r, int v); -unsigned char YM2413Read(int which, int a); -void YM2413UpdateOne(int which, INT16 **buffers, int length); - -typedef void (*OPLL_UPDATEHANDLER)(int param,int min_interval_us); - -void YM2413SetUpdateHandler(int which, OPLL_UPDATEHANDLER UpdateHandler, int param); - -void YM2413Scan(INT32 which, INT32 nAction); - -#endif /*_H_YM2413_*/ diff --git a/jan/src/burn/snd/ymdeltat.c b/jan/src/burn/snd/ymdeltat.c deleted file mode 100644 index 0ece10ea3..000000000 --- a/jan/src/burn/snd/ymdeltat.c +++ /dev/null @@ -1,669 +0,0 @@ -/* -** -** File: ymdeltat.c -** -** YAMAHA DELTA-T adpcm sound emulation subroutine -** used by fmopl.c (Y8950) and fm.c (YM2608 and YM2610/B) -** -** Base program is YM2610 emulator by Hiromitsu Shioya. -** Written by Tatsuyuki Satoh -** Improvements by Jarek Burczynski (bujar at mame dot net) -** -** -** History: -** -** 03-08-2003 Jarek Burczynski: -** - fixed BRDY flag implementation. -** -** 24-07-2003 Jarek Burczynski, Frits Hilderink: -** - fixed delault value for control2 in YM_DELTAT_ADPCM_Reset -** -** 22-07-2003 Jarek Burczynski, Frits Hilderink: -** - fixed external memory support -** -** 15-06-2003 Jarek Burczynski: -** - implemented CPU -> AUDIO ADPCM synthesis (via writes to the ADPCM data reg $08) -** - implemented support for the Limit address register -** - supported two bits from the control register 2 ($01): RAM TYPE (x1 bit/x8 bit), ROM/RAM -** - implemented external memory access (read/write) via the ADPCM data reg reads/writes -** Thanks go to Frits Hilderink for the example code. -** -** 14-06-2003 Jarek Burczynski: -** - various fixes to enable proper support for status register flags: BSRDY, PCM BSY, ZERO -** - modified EOS handling -** -** 05-04-2003 Jarek Burczynski: -** - implemented partial support for external/processor memory on sample replay -** -** 01-12-2002 Jarek Burczynski: -** - fixed first missing sound in gigandes thanks to previous fix (interpolator) by ElSemi -** - renamed/removed some YM_DELTAT struct fields -** -** 28-12-2001 Acho A. Tang -** - added EOS status report on ADPCM playback. -** -** 05-08-2001 Jarek Burczynski: -** - now_step is initialized with 0 at the start of play. -** -** 12-06-2001 Jarek Burczynski: -** - corrected end of sample bug in YM_DELTAT_ADPCM_CALC. -** Checked on real YM2610 chip - address register is 24 bits wide. -** Thanks go to Stefan Jokisch (stefan.jokisch@gmx.de) for tracking down the problem. -** -** TO DO: -** Check size of the address register on the other chips.... -** -** Version 0.72 -** -** sound chips that have this unit: -** YM2608 OPNA -** YM2610/B OPNB -** Y8950 MSX AUDIO -** -*/ - -#include "driver.h" -#include "state.h" -#include "ymdeltat.h" - -#define YM_DELTAT_DELTA_MAX (24576) -#define YM_DELTAT_DELTA_MIN (127) -#define YM_DELTAT_DELTA_DEF (127) - -#define YM_DELTAT_DECODE_RANGE 32768 -#define YM_DELTAT_DECODE_MIN (-(YM_DELTAT_DECODE_RANGE)) -#define YM_DELTAT_DECODE_MAX ((YM_DELTAT_DECODE_RANGE)-1) - - -/* Forecast to next Forecast (rate = *8) */ -/* 1/8 , 3/8 , 5/8 , 7/8 , 9/8 , 11/8 , 13/8 , 15/8 */ -const INT32 ym_deltat_decode_tableB1[16] = { - 1, 3, 5, 7, 9, 11, 13, 15, - -1, -3, -5, -7, -9, -11, -13, -15, -}; -/* delta to next delta (rate= *64) */ -/* 0.9 , 0.9 , 0.9 , 0.9 , 1.2 , 1.6 , 2.0 , 2.4 */ -const INT32 ym_deltat_decode_tableB2[16] = { - 57, 57, 57, 57, 77, 102, 128, 153, - 57, 57, 57, 57, 77, 102, 128, 153 -}; - -#if 0 -void YM_DELTAT_BRDY_callback(YM_DELTAT *DELTAT) -{ - logerror("BRDY_callback reached (flag set) !\n"); - - /* set BRDY bit in status register */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_BRDY_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); -} -#endif - -UINT8 YM_DELTAT_ADPCM_Read(YM_DELTAT *DELTAT) -{ - UINT8 v = 0; - - /* external memory read */ - if ( (DELTAT->portstate & 0xe0)==0x20 ) - { - /* two dummy reads */ - if (DELTAT->memread) - { - DELTAT->now_addr = DELTAT->start << 1; - DELTAT->memread--; - return 0; - } - - - if ( DELTAT->now_addr != (DELTAT->end<<1) ) - { - v = DELTAT->memory[DELTAT->now_addr>>1]; - - /*logerror("YM Delta-T memory read $%08x, v=$%02x\n", DELTAT->now_addr >> 1, v);*/ - - DELTAT->now_addr+=2; /* two nibbles at a time */ - - /* reset BRDY bit in status register, which means we are reading the memory now */ - if(DELTAT->status_reset_handler) - if(DELTAT->status_change_BRDY_bit) - (DELTAT->status_reset_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); - - /* setup a timer that will callback us in 10 master clock cycles for Y8950 - * in the callback set the BRDY flag to 1 , which means we have another data ready. - * For now, we don't really do this; we simply reset and set the flag in zero time, so that the IRQ will work. - */ - /* set BRDY bit in status register */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_BRDY_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); - } - else - { - /* set EOS bit in status register */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_EOS_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_EOS_bit); - } - } - - return v; -} - - -/* 0-DRAM x1, 1-ROM, 2-DRAM x8, 3-ROM (3 is bad setting - not allowed by the manual) */ -static UINT8 dram_rightshift[4]={3,0,0,0}; - -/* DELTA-T ADPCM write register */ -void YM_DELTAT_ADPCM_Write(YM_DELTAT *DELTAT,int r,int v) -{ - if(r>=0x10) return; - DELTAT->reg[r] = v; /* stock data */ - - switch( r ) - { - case 0x00: -/* -START: - Accessing *external* memory is started when START bit (D7) is set to "1", so - you must set all conditions needed for recording/playback before starting. - If you access *CPU-managed* memory, recording/playback starts after - read/write of ADPCM data register $08. - -REC: - 0 = ADPCM synthesis (playback) - 1 = ADPCM analysis (record) - -MEMDATA: - 0 = processor (*CPU-managed*) memory (means: using register $08) - 1 = external memory (using start/end/limit registers to access memory: RAM or ROM) - - -SPOFF: - controls output pin that should disable the speaker while ADPCM analysis - -RESET and REPEAT only work with external memory. - - -some examples: -value: START, REC, MEMDAT, REPEAT, SPOFF, x,x,RESET meaning: - C8 1 1 0 0 1 0 0 0 Analysis (recording) from AUDIO to CPU (to reg $08), sample rate in PRESCALER register - E8 1 1 1 0 1 0 0 0 Analysis (recording) from AUDIO to EXT.MEMORY, sample rate in PRESCALER register - 80 1 0 0 0 0 0 0 0 Synthesis (playing) from CPU (from reg $08) to AUDIO,sample rate in DELTA-N register - a0 1 0 1 0 0 0 0 0 Synthesis (playing) from EXT.MEMORY to AUDIO, sample rate in DELTA-N register - - 60 0 1 1 0 0 0 0 0 External memory write via ADPCM data register $08 - 20 0 0 1 0 0 0 0 0 External memory read via ADPCM data register $08 - -*/ - /* handle emulation mode */ - if(DELTAT->emulation_mode == YM_DELTAT_EMULATION_MODE_YM2610) - { - v |= 0x20; /* YM2610 always uses external memory and doesn't even have memory flag bit. */ - } - - DELTAT->portstate = v & (0x80|0x40|0x20|0x10|0x01); /* start, rec, memory mode, repeat flag copy, reset(bit0) */ - - if( DELTAT->portstate&0x80 )/* START,REC,MEMDATA,REPEAT,SPOFF,--,--,RESET */ - { - /* set PCM BUSY bit */ - DELTAT->PCM_BSY = 1; - - /* start ADPCM */ - DELTAT->now_step = 0; - DELTAT->acc = 0; - DELTAT->prev_acc = 0; - DELTAT->adpcml = 0; - DELTAT->adpcmd = YM_DELTAT_DELTA_DEF; - DELTAT->now_data = 0; - - } - - if( DELTAT->portstate&0x20 ) /* do we access external memory? */ - { - DELTAT->now_addr = DELTAT->start << 1; - DELTAT->memread = 2; /* two dummy reads needed before accesing external memory via register $08*/ - - /* if yes, then let's check if ADPCM memory is mapped and big enough */ - if(DELTAT->memory == 0) - { - logerror("YM Delta-T ADPCM rom not mapped\n"); - DELTAT->portstate = 0x00; - DELTAT->PCM_BSY = 0; - } - else - { - if( DELTAT->end >= DELTAT->memory_size ) /* Check End in Range */ - { - logerror("YM Delta-T ADPCM end out of range: $%08x\n", DELTAT->end); - DELTAT->end = DELTAT->memory_size - 1; - } - if( DELTAT->start >= DELTAT->memory_size ) /* Check Start in Range */ - { - logerror("YM Delta-T ADPCM start out of range: $%08x\n", DELTAT->start); - DELTAT->portstate = 0x00; - DELTAT->PCM_BSY = 0; - } - } - } - else /* we access CPU memory (ADPCM data register $08) so we only reset now_addr here */ - { - DELTAT->now_addr = 0; - } - - if( DELTAT->portstate&0x01 ) - { - DELTAT->portstate = 0x00; - - /* clear PCM BUSY bit (in status register) */ - DELTAT->PCM_BSY = 0; - - /* set BRDY flag */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_BRDY_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); - } - break; - case 0x01: /* L,R,-,-,SAMPLE,DA/AD,RAMTYPE,ROM */ - /* handle emulation mode */ - if(DELTAT->emulation_mode == YM_DELTAT_EMULATION_MODE_YM2610) - { - v |= 0x01; /* YM2610 always uses ROM as an external memory and doesn't tave ROM/RAM memory flag bit. */ - } - - DELTAT->pan = &DELTAT->output_pointer[(v>>6)&0x03]; - if ((DELTAT->control2 & 3) != (v & 3)) - { - /*0-DRAM x1, 1-ROM, 2-DRAM x8, 3-ROM (3 is bad setting - not allowed by the manual) */ - if (DELTAT->DRAMportshift != dram_rightshift[v&3]) - { - DELTAT->DRAMportshift = dram_rightshift[v&3]; - - /* final shift value depends on chip type and memory type selected: - 8 for YM2610 (ROM only), - 5 for ROM for Y8950 and YM2608, - 5 for x8bit DRAMs for Y8950 and YM2608, - 2 for x1bit DRAMs for Y8950 and YM2608. - */ - - /* refresh addresses */ - DELTAT->start = (DELTAT->reg[0x3]*0x0100 | DELTAT->reg[0x2]) << (DELTAT->portshift - DELTAT->DRAMportshift); - DELTAT->end = (DELTAT->reg[0x5]*0x0100 | DELTAT->reg[0x4]) << (DELTAT->portshift - DELTAT->DRAMportshift); - DELTAT->end += (1 << (DELTAT->portshift-DELTAT->DRAMportshift) ) - 1; - DELTAT->limit = (DELTAT->reg[0xd]*0x0100 | DELTAT->reg[0xc]) << (DELTAT->portshift - DELTAT->DRAMportshift); - } - } - DELTAT->control2 = v; - break; - case 0x02: /* Start Address L */ - case 0x03: /* Start Address H */ - DELTAT->start = (DELTAT->reg[0x3]*0x0100 | DELTAT->reg[0x2]) << (DELTAT->portshift - DELTAT->DRAMportshift); - /*logerror("DELTAT start: 02=%2x 03=%2x addr=%8x\n",DELTAT->reg[0x2], DELTAT->reg[0x3],DELTAT->start );*/ - break; - case 0x04: /* Stop Address L */ - case 0x05: /* Stop Address H */ - DELTAT->end = (DELTAT->reg[0x5]*0x0100 | DELTAT->reg[0x4]) << (DELTAT->portshift - DELTAT->DRAMportshift); - DELTAT->end += (1 << (DELTAT->portshift-DELTAT->DRAMportshift) ) - 1; - /*logerror("DELTAT end : 04=%2x 05=%2x addr=%8x\n",DELTAT->reg[0x4], DELTAT->reg[0x5],DELTAT->end );*/ - break; - case 0x06: /* Prescale L (ADPCM and Record frq) */ - case 0x07: /* Prescale H */ - break; - case 0x08: /* ADPCM data */ - -/* -some examples: -value: START, REC, MEMDAT, REPEAT, SPOFF, x,x,RESET meaning: - C8 1 1 0 0 1 0 0 0 Analysis (recording) from AUDIO to CPU (to reg $08), sample rate in PRESCALER register - E8 1 1 1 0 1 0 0 0 Analysis (recording) from AUDIO to EXT.MEMORY, sample rate in PRESCALER register - 80 1 0 0 0 0 0 0 0 Synthesis (playing) from CPU (from reg $08) to AUDIO,sample rate in DELTA-N register - a0 1 0 1 0 0 0 0 0 Synthesis (playing) from EXT.MEMORY to AUDIO, sample rate in DELTA-N register - - 60 0 1 1 0 0 0 0 0 External memory write via ADPCM data register $08 - 20 0 0 1 0 0 0 0 0 External memory read via ADPCM data register $08 - -*/ - - /* external memory write */ - if ( (DELTAT->portstate & 0xe0)==0x60 ) - { - if (DELTAT->memread) - { - DELTAT->now_addr = DELTAT->start << 1; - DELTAT->memread = 0; - } - - /*logerror("YM Delta-T memory write $%08x, v=$%02x\n", DELTAT->now_addr >> 1, v);*/ - - if ( DELTAT->now_addr != (DELTAT->end<<1) ) - { - DELTAT->memory[DELTAT->now_addr>>1] = v; - DELTAT->now_addr+=2; /* two nibbles at a time */ - - /* reset BRDY bit in status register, which means we are processing the write */ - if(DELTAT->status_reset_handler) - if(DELTAT->status_change_BRDY_bit) - (DELTAT->status_reset_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); - - /* setup a timer that will callback us in 10 master clock cycles for Y8950 - * in the callback set the BRDY flag to 1 , which means we have written the data. - * For now, we don't really do this; we simply reset and set the flag in zero time, so that the IRQ will work. - */ - /* set BRDY bit in status register */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_BRDY_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); - - } - else - { - /* set EOS bit in status register */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_EOS_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_EOS_bit); - } - - return; - } - - /* ADPCM synthesis from CPU */ - if ( (DELTAT->portstate & 0xe0)==0x80 ) - { - DELTAT->CPU_data = v; - - /* Reset BRDY bit in status register, which means we are full of data */ - if(DELTAT->status_reset_handler) - if(DELTAT->status_change_BRDY_bit) - (DELTAT->status_reset_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); - return; - } - - break; - case 0x09: /* DELTA-N L (ADPCM Playback Prescaler) */ - case 0x0a: /* DELTA-N H */ - DELTAT->delta = (DELTAT->reg[0xa]*0x0100 | DELTAT->reg[0x9]); - DELTAT->step = (UINT32)( (double)(DELTAT->delta /* *(1<<(YM_DELTAT_SHIFT-16)) */ ) * (DELTAT->freqbase) ); - /*logerror("DELTAT deltan:09=%2x 0a=%2x\n",DELTAT->reg[0x9], DELTAT->reg[0xa]);*/ - break; - case 0x0b: /* Output level control (volume, linear) */ - { - INT32 oldvol = DELTAT->volume; - DELTAT->volume = (v&0xff) * (DELTAT->output_range/256) / YM_DELTAT_DECODE_RANGE; -/* v * ((1<<16)>>8) >> 15; -* thus: v * (1<<8) >> 15; -* thus: output_range must be (1 << (15+8)) at least -* v * ((1<<23)>>8) >> 15; -* v * (1<<15) >> 15; -*/ - /*logerror("DELTAT vol = %2x\n",v&0xff);*/ - if( oldvol != 0 ) - { - DELTAT->adpcml = (int)((double)DELTAT->adpcml / (double)oldvol * (double)DELTAT->volume); - } - } - break; - case 0x0c: /* Limit Address L */ - case 0x0d: /* Limit Address H */ - DELTAT->limit = (DELTAT->reg[0xd]*0x0100 | DELTAT->reg[0xc]) << (DELTAT->portshift - DELTAT->DRAMportshift); - /*logerror("DELTAT limit: 0c=%2x 0d=%2x addr=%8x\n",DELTAT->reg[0xc], DELTAT->reg[0xd],DELTAT->limit );*/ - break; - } -} - -void YM_DELTAT_ADPCM_Reset(YM_DELTAT *DELTAT,int pan,int emulation_mode) -{ - DELTAT->now_addr = 0; - DELTAT->now_step = 0; - DELTAT->step = 0; - DELTAT->start = 0; - DELTAT->end = 0; - DELTAT->limit = ~0; /* this way YM2610 and Y8950 (both of which don't have limit address reg) will still work */ - DELTAT->volume = 0; - DELTAT->pan = &DELTAT->output_pointer[pan]; - DELTAT->acc = 0; - DELTAT->prev_acc = 0; - DELTAT->adpcmd = 127; - DELTAT->adpcml = 0; - DELTAT->emulation_mode = (UINT8)emulation_mode; - DELTAT->portstate = (emulation_mode == YM_DELTAT_EMULATION_MODE_YM2610) ? 0x20 : 0; - DELTAT->control2 = (emulation_mode == YM_DELTAT_EMULATION_MODE_YM2610) ? 0x01 : 0; /* default setting depends on the emulation mode. MSX demo called "facdemo_4" doesn't setup control2 register at all and still works */ - DELTAT->DRAMportshift = dram_rightshift[DELTAT->control2 & 3]; - - /* The flag mask register disables the BRDY after the reset, however - ** as soon as the mask is enabled the flag needs to be set. */ - - /* set BRDY bit in status register */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_BRDY_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); -} - -void YM_DELTAT_postload(YM_DELTAT *DELTAT,UINT8 *regs) -{ - int r; - - /* to keep adpcml */ - DELTAT->volume = 0; - /* update */ - for(r=1;r<16;r++) - YM_DELTAT_ADPCM_Write(DELTAT,r,regs[r]); - DELTAT->reg[0] = regs[0]; - - /* current rom data */ - if (DELTAT->memory) - DELTAT->now_data = *(DELTAT->memory + (DELTAT->now_addr>>1) ); - -} -void YM_DELTAT_savestate(const char *statename,int num,YM_DELTAT *DELTAT) -{ -#ifdef _STATE_H - state_save_register_UINT8 (statename, num, "DeltaT.portstate", &DELTAT->portstate, 1); - state_save_register_UINT32(statename, num, "DeltaT.address" , &DELTAT->now_addr , 1); - state_save_register_UINT32(statename, num, "DeltaT.step" , &DELTAT->now_step , 1); - state_save_register_INT32 (statename, num, "DeltaT.acc" , &DELTAT->acc , 1); - state_save_register_INT32 (statename, num, "DeltaT.prev_acc" , &DELTAT->prev_acc , 1); - state_save_register_INT32 (statename, num, "DeltaT.adpcmd" , &DELTAT->adpcmd , 1); - state_save_register_INT32 (statename, num, "DeltaT.adpcml" , &DELTAT->adpcml , 1); -#endif -} - - -#define YM_DELTAT_Limit(val,max,min) \ -{ \ - if ( val > max ) val = max; \ - else if ( val < min ) val = min; \ -} - -INLINE void YM_DELTAT_synthesis_from_external_memory(YM_DELTAT *DELTAT) -{ - UINT32 step; - int data; - - DELTAT->now_step += DELTAT->step; - if ( DELTAT->now_step >= (1<now_step >> YM_DELTAT_SHIFT; - DELTAT->now_step &= (1<now_addr == (DELTAT->limit<<1) ) - DELTAT->now_addr = 0; - - if ( DELTAT->now_addr >= (DELTAT->memory_size<<1) ) { - /* 2-26-2016 DINK@FBAlpha: solution for crash in gwar when loading a savestate as player death sample is playing. */ - /* set EOS bit in status register */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_EOS_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_EOS_bit); - - /* clear PCM BUSY bit (reflected in status register) */ - DELTAT->PCM_BSY = 0; - - DELTAT->portstate = 0; - DELTAT->adpcml = 0; - DELTAT->prev_acc = 0; - return; - } - - if ( DELTAT->now_addr == (DELTAT->end<<1) ) { /* 12-06-2001 JB: corrected comparison. Was > instead of == */ - if( DELTAT->portstate&0x10 ){ - /* repeat start */ - DELTAT->now_addr = DELTAT->start<<1; - DELTAT->acc = 0; - DELTAT->adpcmd = YM_DELTAT_DELTA_DEF; - DELTAT->prev_acc = 0; - }else{ - /* set EOS bit in status register */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_EOS_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_EOS_bit); - - /* clear PCM BUSY bit (reflected in status register) */ - DELTAT->PCM_BSY = 0; - - DELTAT->portstate = 0; - DELTAT->adpcml = 0; - DELTAT->prev_acc = 0; - return; - } - } - - if( DELTAT->now_addr&1 ) data = DELTAT->now_data & 0x0f; - else - { - DELTAT->now_data = *(DELTAT->memory + (DELTAT->now_addr>>1)); - data = DELTAT->now_data >> 4; - } - - DELTAT->now_addr++; - /* 12-06-2001 JB: */ - /* YM2610 address register is 24 bits wide.*/ - /* The "+1" is there because we use 1 bit more for nibble calculations.*/ - /* WARNING: */ - /* Side effect: we should take the size of the mapped ROM into account */ - DELTAT->now_addr &= ( (1<<(24+1))-1); - - /* store accumulator value */ - DELTAT->prev_acc = DELTAT->acc; - - /* Forecast to next Forecast */ - DELTAT->acc += (ym_deltat_decode_tableB1[data] * DELTAT->adpcmd / 8); - YM_DELTAT_Limit(DELTAT->acc,YM_DELTAT_DECODE_MAX, YM_DELTAT_DECODE_MIN); - - /* delta to next delta */ - DELTAT->adpcmd = (DELTAT->adpcmd * ym_deltat_decode_tableB2[data] ) / 64; - YM_DELTAT_Limit(DELTAT->adpcmd,YM_DELTAT_DELTA_MAX, YM_DELTAT_DELTA_MIN ); - - /* ElSemi: Fix interpolator. */ - /*DELTAT->prev_acc = prev_acc + ((DELTAT->acc - prev_acc) / 2 );*/ - - }while(--step); - - } - - /* ElSemi: Fix interpolator. */ - DELTAT->adpcml = DELTAT->prev_acc * (int)((1<now_step); - DELTAT->adpcml += (DELTAT->acc * (int)DELTAT->now_step); - DELTAT->adpcml = (DELTAT->adpcml>>YM_DELTAT_SHIFT) * (int)DELTAT->volume; - - /* output for work of output channels (outd[OPNxxxx])*/ - *(DELTAT->pan) += DELTAT->adpcml; -} - - - -INLINE void YM_DELTAT_synthesis_from_CPU_memory(YM_DELTAT *DELTAT) -{ - UINT32 step; - int data; - - DELTAT->now_step += DELTAT->step; - if ( DELTAT->now_step >= (1<now_step >> YM_DELTAT_SHIFT; - DELTAT->now_step &= (1<now_addr&1 ) - { - data = DELTAT->now_data & 0x0f; - - DELTAT->now_data = DELTAT->CPU_data; - - /* after we used CPU_data, we set BRDY bit in status register, - * which means we are ready to accept another byte of data */ - if(DELTAT->status_set_handler) - if(DELTAT->status_change_BRDY_bit) - (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); - } - else - { - data = DELTAT->now_data >> 4; - } - - DELTAT->now_addr++; - - /* store accumulator value */ - DELTAT->prev_acc = DELTAT->acc; - - /* Forecast to next Forecast */ - DELTAT->acc += (ym_deltat_decode_tableB1[data] * DELTAT->adpcmd / 8); - YM_DELTAT_Limit(DELTAT->acc,YM_DELTAT_DECODE_MAX, YM_DELTAT_DECODE_MIN); - - /* delta to next delta */ - DELTAT->adpcmd = (DELTAT->adpcmd * ym_deltat_decode_tableB2[data] ) / 64; - YM_DELTAT_Limit(DELTAT->adpcmd,YM_DELTAT_DELTA_MAX, YM_DELTAT_DELTA_MIN ); - - - }while(--step); - - } - - /* ElSemi: Fix interpolator. */ - DELTAT->adpcml = DELTAT->prev_acc * (int)((1<now_step); - DELTAT->adpcml += (DELTAT->acc * (int)DELTAT->now_step); - DELTAT->adpcml = (DELTAT->adpcml>>YM_DELTAT_SHIFT) * (int)DELTAT->volume; - - /* output for work of output channels (outd[OPNxxxx])*/ - *(DELTAT->pan) += DELTAT->adpcml; -} - - - -/* ADPCM B (Delta-T control type) */ -void YM_DELTAT_ADPCM_CALC(YM_DELTAT *DELTAT) -{ - -/* -some examples: -value: START, REC, MEMDAT, REPEAT, SPOFF, x,x,RESET meaning: - 80 1 0 0 0 0 0 0 0 Synthesis (playing) from CPU (from reg $08) to AUDIO,sample rate in DELTA-N register - a0 1 0 1 0 0 0 0 0 Synthesis (playing) from EXT.MEMORY to AUDIO, sample rate in DELTA-N register - C8 1 1 0 0 1 0 0 0 Analysis (recording) from AUDIO to CPU (to reg $08), sample rate in PRESCALER register - E8 1 1 1 0 1 0 0 0 Analysis (recording) from AUDIO to EXT.MEMORY, sample rate in PRESCALER register - - 60 0 1 1 0 0 0 0 0 External memory write via ADPCM data register $08 - 20 0 0 1 0 0 0 0 0 External memory read via ADPCM data register $08 - -*/ - - if ( (DELTAT->portstate & 0xe0)==0xa0 ) - { - YM_DELTAT_synthesis_from_external_memory(DELTAT); - return; - } - - if ( (DELTAT->portstate & 0xe0)==0x80 ) - { - /* ADPCM synthesis from CPU-managed memory (from reg $08) */ - YM_DELTAT_synthesis_from_CPU_memory(DELTAT); /* change output based on data in ADPCM data reg ($08) */ - return; - } - -//todo: ADPCM analysis -// if ( (DELTAT->portstate & 0xe0)==0xc0 ) -// if ( (DELTAT->portstate & 0xe0)==0xe0 ) - - return; -} - diff --git a/jan/src/burn/snd/ymdeltat.h b/jan/src/burn/snd/ymdeltat.h deleted file mode 100644 index e8cfe7635..000000000 --- a/jan/src/burn/snd/ymdeltat.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef __YMDELTAT_H_ -#define __YMDELTAT_H_ - -#define YM_DELTAT_SHIFT (16) - -#define YM_DELTAT_EMULATION_MODE_NORMAL 0 -#define YM_DELTAT_EMULATION_MODE_YM2610 1 - - -typedef void (*STATUS_CHANGE_HANDLER)(UINT8 which_chip, UINT8 status_bits); - - -/* DELTA-T (adpcm type B) struct */ -typedef struct deltat_adpcm_state { /* AT: rearranged and tigntened structure */ - UINT8 *memory; - INT32 *output_pointer;/* pointer of output pointers */ - INT32 *pan; /* pan : &output_pointer[pan] */ - double freqbase; -#if 0 - double write_time; /* Y8950: 10 cycles of main clock; YM2608: 20 cycles of main clock */ - double read_time; /* Y8950: 8 cycles of main clock; YM2608: 18 cycles of main clock */ -#endif - UINT32 memory_size; - int output_range; - UINT32 now_addr; /* current address */ - UINT32 now_step; /* currect step */ - UINT32 step; /* step */ - UINT32 start; /* start address */ - UINT32 limit; /* limit address */ - UINT32 end; /* end address */ - UINT32 delta; /* delta scale */ - INT32 volume; /* current volume */ - INT32 acc; /* shift Measurement value*/ - INT32 adpcmd; /* next Forecast */ - INT32 adpcml; /* current value */ - INT32 prev_acc; /* leveling value */ - UINT8 now_data; /* current rom data */ - UINT8 CPU_data; /* current data from reg 08 */ - UINT8 portstate; /* port status */ - UINT8 control2; /* control reg: SAMPLE, DA/AD, RAM TYPE (x8bit / x1bit), ROM/RAM */ - UINT8 portshift; /* address bits shift-left: - ** 8 for YM2610, - ** 5 for Y8950 and YM2608 */ - - UINT8 DRAMportshift; /* address bits shift-right: - ** 0 for ROM and x8bit DRAMs, - ** 3 for x1 DRAMs */ - - UINT8 memread; /* needed for reading/writing external memory */ - - /* handlers and parameters for the status flags support */ - STATUS_CHANGE_HANDLER status_set_handler; - STATUS_CHANGE_HANDLER status_reset_handler; - - /* note that different chips have these flags on different - ** bits of the status register - */ - UINT8 status_change_which_chip; /* this chip id */ - UINT8 status_change_EOS_bit; /* 1 on End Of Sample (record/playback/cycle time of AD/DA converting has passed)*/ - UINT8 status_change_BRDY_bit; /* 1 after recording 2 datas (2x4bits) or after reading/writing 1 data */ - UINT8 status_change_ZERO_bit; /* 1 if silence lasts for more than 290 miliseconds on ADPCM recording */ - - /* neither Y8950 nor YM2608 can generate IRQ when PCMBSY bit changes, so instead of above, - ** the statusflag gets ORed with PCM_BSY (below) (on each read of statusflag of Y8950 and YM2608) - */ - UINT8 PCM_BSY; /* 1 when ADPCM is playing; Y8950/YM2608 only */ - - UINT8 reg[16]; /* adpcm registers */ - UINT8 emulation_mode; /* which chip we're emulating */ -}YM_DELTAT; - -/*void YM_DELTAT_BRDY_callback(YM_DELTAT *DELTAT);*/ - -UINT8 YM_DELTAT_ADPCM_Read(YM_DELTAT *DELTAT); -void YM_DELTAT_ADPCM_Write(YM_DELTAT *DELTAT,int r,int v); -void YM_DELTAT_ADPCM_Reset(YM_DELTAT *DELTAT,int pan,int emulation_mode); -void YM_DELTAT_ADPCM_CALC(YM_DELTAT *DELTAT); - -void YM_DELTAT_postload(YM_DELTAT *DELTAT,UINT8 *regs); -void YM_DELTAT_savestate(const char *statename,int num,YM_DELTAT *DELTAT); - -#endif diff --git a/jan/src/burn/snd/ymf278b.c b/jan/src/burn/snd/ymf278b.c deleted file mode 100644 index 59a811d6f..000000000 --- a/jan/src/burn/snd/ymf278b.c +++ /dev/null @@ -1,1256 +0,0 @@ -/* - Based on MAME sources by R. Belmont, Olivier Galibert, hap - - YMF278B FM + Wave table Synthesizer (OPL4) - - Timer and PCM YMF278B. The FM will be shared with the ymf262, eventually. - - This chip roughly splits the difference between the Sega 315-5560 MultiPCM - (Multi32, Model 1/2) and YMF 292-F SCSP (later Model 2, STV, Saturn, Model 3). - - Features as listed in LSI-4MF2782 data sheet: - FM Synthesis (same as YMF262) - 1. Sound generation mode - Two-operater mode - Generates eighteen voices or fifteen voices plus five rhythm sounds simultaneously - Four-operator mode - Generates six voices in four-operator mode plus six voices in two-operator mode simultaneously, - or generates six voices in four-operator mode plus three voices in two-operator mode plus five - rhythm sounds simultaneously - 2. Eight selectable waveforms - 3. Stereo output - Wave Table Synthesis - 1. Generates twenty-four voices simultaneously - 2. 44.1kHz sampling rate for output sound data - 3. Selectable from 8-bit, 12-bit and 16-bit word lengths for wave data - 4. Stereo output (16-stage panpot for each voice) - Wave Data - 1. Accepts 32M bit external memory at maximum - 2. Up to 512 wave tables - 3. External ROM or SRAM can be connected. With SRAM connected, the CPU can download wave data - 4. Outputs chip select signals for 1Mbit, 4Mbit, 8Mbit or 16Mbit memory - 5. Can be directly connected to the Yamaha YRW801 (Wave data ROM) - Features of YRW801 as listed in LSI 4RW801A2 - Built-in wave data of tones which comply with GM system Level 1 - Melody tone ....... 128 tones - Percussion tone ... 47 tones - 16Mbit capacity (2,097,152word x 8) - - By R. Belmont and O. Galibert. - - Copyright R. Belmont and O. Galibert. - - This software is dual-licensed: it may be used in MAME and properly licensed - MAME derivatives under the terms of the MAME license. For use outside of - MAME and properly licensed derivatives, it is available under the - terms of the GNU Lesser General Public License (LGPL), version 2.1. - You may read the LGPL at http://www.gnu.org/licenses/lgpl.html - - Changelog: - Sep. 8, 2002 - fixed ymf278b_compute_rate when octave is negative (RB) - Dec. 11, 2002 - added ability to set non-standard clock rates (RB) - fixed envelope target for release (fixes missing - instruments in hotdebut). - Thanks to Team Japump! for MP3s from a real PCB. - fixed crash if MAME is run with no sound. - June 4, 2003 - Changed to dual-license with LGPL for use in openMSX. - openMSX contributed a bugfix where looped samples were - not being addressed properly, causing pitch fluctuation. - - With further improvements over the years by MAME team. - - TODO: - - accurate timing of envelopes - - LFO (vibrato, tremolo) - - integrate YMF262 (used by Fuuki games, not used by Psikyo and Metro games) - - able to hook up "Moonsound", supporting mixed ROM+RAM (for MSX driver in MESS) -*/ - -#include -#include "driver.h" -#include "ymf278b.h" -#include "state.h" - -#define YMF278B_STD_CLOCK (33868800) /* standard clock for OPL4 */ - -#define LOG(x) logerror x; - - typedef struct - { - INT16 wave; /* wavetable number */ - INT16 F_NUMBER; /* frequency */ - INT8 octave; /* octave */ - INT8 preverb; /* pseudo-reverb */ - INT8 DAMP; /* damping */ - INT8 CH; /* output channel */ - INT8 LD; /* level direct */ - INT8 TL; /* total level */ - INT8 pan; /* panpot */ - INT8 LFO; /* LFO */ - INT8 VIB; /* vibrato */ - INT8 AM; /* tremolo */ - - INT8 AR; /* attack rate */ - INT8 D1R; /* decay 1 rate */ - INT8 DL; /* decay level */ - INT8 D2R; /* decay 2 rate */ - INT8 RC; /* rate correction */ - INT8 RR; /* release rate */ - - UINT32 step; /* fixed-point frequency step */ - UINT64 stepptr; /* fixed-point pointer into the sample */ - - INT8 active; /* channel is playing */ - INT8 KEY_ON; /* slot keyed on */ - INT8 bits; /* width of the samples */ - UINT32 startaddr; - UINT32 loopaddr; - UINT32 endaddr; - - int env_step; - UINT32 env_vol; - UINT32 env_vol_step; - UINT32 env_vol_lim; - INT8 env_preverb; - - int num; /* slot number (for debug only) */ - } YMF278BSlot; - - // internal state - UINT8 m_pcmregs[256]; - YMF278BSlot m_slots[24]; - INT8 m_wavetblhdr; - INT8 m_memmode; - INT32 m_memadr; - - UINT8 m_status_busy, m_status_ld; - void *m_timer_busy; - void *m_timer_ld; - UINT8 m_exp; - - INT32 m_fm_l, m_fm_r; - INT32 m_pcm_l, m_pcm_r; - - //attotime m_timer_base; - UINT8 m_timer_a_count, m_timer_b_count; - UINT8 m_enable, m_current_irq; - int m_irq_line; - - UINT8 m_port_C, m_port_A, m_port_B, m_lastport; - - // precomputed tables - UINT32 m_lut_ar[64]; // attack rate - UINT32 m_lut_dr[64]; // decay rate - INT32 m_volume[256*4]; // precalculated attenuation values with some margin for envelope and pan levels - int m_pan_left[16],m_pan_right[16]; // pan volume offsets - INT32 m_mix_level[8]; - - void *m_timer_a, *m_timer_b; - const UINT8 *m_rom; - UINT32 m_romsize, m_sample_rate; - int m_clock; - - //sound_stream * m_stream; - INT32 *m_mix_buffer; - //devcb2_write_line m_irq_handler; - void (*m_irq_handler)(INT32, INT32); - void (*timer_callback)(INT32, INT32, double); - float m_clock_ratio; - static int ymf278b_chip_in_reset = 0; - -void write_memory(UINT32 offset, UINT8 data) -{ - LOG(("YMF278B: Memory write %02x to %x\n", data, offset)); -} - -UINT8 read_memory(UINT32 offset) -{ - if (offset >= m_romsize) - { - // LOG(("YMF278B: Memory read overflow %x\n", offset)); - return 0xff; - } - return m_rom[offset]; -} - - -/**************************************************************************/ - -static int compute_rate(YMF278BSlot *slot, int val) -{ - int res, oct; - - if(val == 0) - return 0; - if(val == 15) - return 63; - if(slot->RC != 15) - { - oct = slot->octave; - if (oct & 8) - oct |= -8; - - res = (oct+slot->RC)*2 + (slot->F_NUMBER & 0x200 ? 1 : 0) + val*4; - } - else - res = val * 4; - if(res < 0) - res = 0; - else if(res > 63) - res = 63; - - return res; -} - -static UINT32 compute_decay_env_vol_step(YMF278BSlot *slot, int val) -{ - int rate; - UINT32 res; - - // rate override with damping/pseudo reverb - if (slot->DAMP) - rate = 56; // approximate, datasheet says it's slightly curved though - else if (slot->preverb && slot->env_vol > ((6*8)<<23)) - { - // pseudo reverb starts at -18dB (6 in voltab) - slot->env_preverb = 1; - rate = 5; - } - else - rate = compute_rate(slot, val); - - if (rate < 4) - res = 0; - else - res = (256U<<23) / m_lut_dr[rate]; - - return res; -} - -static void compute_freq_step(YMF278BSlot *slot) -{ - UINT32 step; - int oct; - - oct = slot->octave; - if(oct & 8) - oct |= -8; - - step = (slot->F_NUMBER | 1024) << (oct + 8); - slot->step = step >> 3; -} - -static void compute_envelope(YMF278BSlot *slot) -{ - switch (slot->env_step) - { - // Attack - case 0: - { - // Attack - int rate = compute_rate(slot, slot->AR); - slot->env_vol = 256U<<23; - slot->env_vol_lim = (256U<<23) - 1; - - if (rate==63) - { - // immediate - LOG(("YMF278B: Attack skipped - ")); - slot->env_vol = 0; - slot->env_step++; - compute_envelope(slot); - } - else if (rate<4) - { - slot->env_vol_step = 0; - } - else - { - // NOTE: attack rate is linear here, but datasheet shows a smooth curve - LOG(("YMF278B: Attack, val = %d, rate = %d, delay = %g\n", slot->AR, rate, m_lut_ar[rate]*1000.0)); - slot->env_vol_step = ~((256U<<23) / m_lut_ar[rate]); - } - - break; - } - - // Decay 1 - case 1: - if(slot->DL) - { - LOG(("YMF278B: Decay step 1, dl=%d, val = %d rate = %d, delay = %g, PRVB = %d, DAMP = %d\n", slot->DL, slot->D1R, compute_rate(slot, slot->D1R), m_lut_dr[compute_rate(slot, slot->D1R)]*1000.0, slot->preverb, slot->DAMP)); - slot->env_vol_step = compute_decay_env_vol_step(slot, slot->D1R); - slot->env_vol_lim = (slot->DL*8)<<23; - } - else - { - LOG(("YMF278B: Decay 1 skipped - ")); - slot->env_step++; - compute_envelope(slot); - } - - break; - - // Decay 2 - case 2: - LOG(("YMF278B: Decay step 2, val = %d, rate = %d, delay = %g, , PRVB = %d, DAMP = %d, current vol = %d\n", slot->D2R, compute_rate(slot, slot->D2R), m_lut_dr[compute_rate(slot, slot->D2R)]*1000.0, slot->preverb, slot->DAMP, slot->env_vol >> 23)); - slot->env_vol_step = compute_decay_env_vol_step(slot, slot->D2R); - slot->env_vol_lim = 256U<<23; - break; - - // Decay 2 reached -96dB - case 3: - LOG(("YMF278B: Voice cleared because of decay 2\n")); - slot->env_vol = 256U<<23; - slot->env_vol_step = 0; - slot->env_vol_lim = 0; - slot->active = 0; - break; - - // Release - case 4: - LOG(("YMF278B: Release, val = %d, rate = %d, delay = %g, PRVB = %d, DAMP = %d\n", slot->RR, compute_rate(slot, slot->RR), m_lut_dr[compute_rate(slot, slot->RR)]*1000.0, slot->preverb, slot->DAMP)); - slot->env_vol_step = compute_decay_env_vol_step(slot, slot->RR); - slot->env_vol_lim = 256U<<23; - break; - - // Release reached -96dB - case 5: - LOG(("YMF278B: Release ends\n")); - slot->env_vol = 256U<<23; - slot->env_vol_step = 0; - slot->env_vol_lim = 0; - slot->active = 0; - break; - - default: break; - } -} - -//------------------------------------------------- -// sound_stream_update - handle a stream update -//------------------------------------------------- - -void ymf278b_pcm_update(int num, INT16 **outputs, int samples) -{ - int i, j; - YMF278BSlot *slot = NULL; - INT16 sample = 0; - INT32 *mixp; - INT32 vl, vr; - - memset(m_mix_buffer, 0, sizeof(m_mix_buffer[0])*samples*2); - - for (i = 0; i < 24; i++) - { - slot = &m_slots[i]; - - if (slot->active) - { - mixp = m_mix_buffer; - - for (j = 0; j < samples; j++) - { - if (slot->stepptr >= slot->endaddr) - { - slot->stepptr = slot->stepptr - slot->endaddr + slot->loopaddr; - - // NOTE: loop overflow is still possible here if (slot->stepptr >= slot->endaddr) - // This glitch may be (ab)used to your advantage to create pseudorandom noise. - } - - switch (slot->bits) - { - // 8 bit - case 0: - sample = read_memory(slot->startaddr + (slot->stepptr>>16))<<8; - break; - - // 12 bit - case 1: - if (slot->stepptr & 0x10000) - sample = read_memory(slot->startaddr + (slot->stepptr>>17)*3+2)<<8 | - (read_memory(slot->startaddr + (slot->stepptr>>17)*3+1) << 4 & 0xf0); - else - sample = read_memory(slot->startaddr + (slot->stepptr>>17)*3)<<8 | - (read_memory(slot->startaddr + (slot->stepptr>>17)*3+1) & 0xf0); - break; - - // 16 bit - case 2: - sample = read_memory(slot->startaddr + ((slot->stepptr>>16)*2))<<8 | - read_memory(slot->startaddr + ((slot->stepptr>>16)*2)+1); - break; - - // ?? bit, effect is unknown, datasheet says it's prohibited - case 3: - sample = 0; - break; - } - - *mixp++ += (sample * m_volume[slot->TL+m_pan_left [slot->pan]+(slot->env_vol>>23)])>>17; - *mixp++ += (sample * m_volume[slot->TL+m_pan_right[slot->pan]+(slot->env_vol>>23)])>>17; - - // update frequency - slot->stepptr += slot->step; - - // update envelope - slot->env_vol += slot->env_vol_step; - if (((INT32)(slot->env_vol - slot->env_vol_lim)) >= 0) - { - slot->env_step++; - compute_envelope(slot); - } - else if (slot->preverb && !slot->env_preverb && slot->env_step && slot->env_vol > ((6*8)<<23)) - compute_envelope(slot); - } - } - } - - mixp = m_mix_buffer; - vl = m_mix_level[m_pcm_l]; - vr = m_mix_level[m_pcm_r]; - for (i = 0; i < samples; i++) - { - outputs[0][i] = (*mixp++ * vl) >> 16; - outputs[1][i] = (*mixp++ * vr) >> 16; - } -} - -static void irq_check() -{ - int prev_line = m_irq_line; - m_irq_line = m_current_irq ? 1 : 0; - if (m_irq_line != prev_line && m_irq_handler && !ymf278b_chip_in_reset) - m_irq_handler(0, m_irq_line); -} - -int ymf278b_timer_over(int num, int timer) -{ - if(!(m_enable & (0x20 << timer))) - { - m_current_irq |= (0x20 << timer); - irq_check(); - } - - return 0; -} - -static void ymf278b_timer_a_reset(int num) -{ - if(m_enable & 1) - { - double period = (256-m_timer_a_count) * 80.8 * m_clock_ratio; - timer_callback(num, 0, period); - } - else - timer_callback(num, 0, 0); -} - -static void ymf278b_timer_b_reset(int num) -{ - if(m_enable & 2) - { - double period = (256-m_timer_b_count) * 323.1 * m_clock_ratio; - timer_callback(num, 1, period); - } - else - timer_callback(num, 1, 0); -} - - -/* -enum -{ - TIMER_A = 0, - TIMER_B, - TIMER_BUSY_CLEAR, - TIMER_LD_CLEAR -}; - -void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - switch(id) - { - case TIMER_A: - if(!(m_enable & 0x40)) - { - m_current_irq |= 0x40; - irq_check(); - } - break; - - case TIMER_B: - if(!(m_enable & 0x20)) - { - m_current_irq |= 0x20; - irq_check(); - } - break; - - case TIMER_BUSY_CLEAR: - m_status_busy = 0; - break; - - case TIMER_LD_CLEAR: - m_status_ld = 0; - break; - } -}*/ - - -/**************************************************************************/ - -static void A_w(int num, UINT8 reg, UINT8 data) -{ - // FM register array 0 (compatible with YMF262) - switch(reg) - { - // LSI TEST - case 0x00: - case 0x01: - break; - - // timer a count - case 0x02: - //if (data != m_timer_a_count) - this breaks FBA if uncommented - { - m_timer_a_count = data; - if (!ymf278b_chip_in_reset) - ymf278b_timer_a_reset(num); - - } - break; - - // timer b count - case 0x03: - //if (data != m_timer_b_count) - same here. - { - m_timer_b_count = data; - if (!ymf278b_chip_in_reset) - ymf278b_timer_b_reset(num); - } - break; - - // timer control - case 0x04: - if(data & 0x80) - m_current_irq = 0; - else - { - // reset timers - UINT8 old_enable = m_enable; - m_enable = data; - m_current_irq &= ~data; - if((old_enable ^ data) & 1 && !ymf278b_chip_in_reset) - ymf278b_timer_a_reset(num); - if((old_enable ^ data) & 2 && !ymf278b_chip_in_reset) - ymf278b_timer_b_reset(num); - } - irq_check(); - break; - - default: - LOG(("YMF278B: Port A write %02x, %02x\n", reg, data)); - break; - } -} - -static void B_w(int num, UINT8 reg, UINT8 data) -{ - // FM register array 1 (compatible with YMF262) - switch(reg) - { - // LSI TEST - case 0x00: - case 0x01: - break; - - // expansion register (NEW2/NEW) - case 0x05: - m_exp = data; - break; - - default: - LOG(("YMF278B: Port B write %02x, %02x\n", reg, data)); - break; - } -} - -static void retrigger_note(YMF278BSlot *slot) -{ - // activate channel - if (slot->octave != 8) - slot->active = 1; - - // reset sample pos and go to attack stage - slot->stepptr = 0; - slot->env_step = 0; - slot->env_preverb = 0; - - compute_freq_step(slot); - compute_envelope(slot); -} - -static void C_w(int num, UINT8 reg, UINT8 data) -{ - // Handle slot registers specifically - if (reg >= 0x08 && reg <= 0xf7) - { - YMF278BSlot *slot = NULL; - int snum; - snum = (reg-8) % 24; - slot = &m_slots[snum]; - switch((reg-8) / 24) - { - case 0: - { - //attotime period; - UINT32 offset; - UINT8 p[12]; - int i; - - slot->wave &= 0x100; - slot->wave |= data; - - // load wavetable header - if(slot->wave < 384 || !m_wavetblhdr) - offset = slot->wave * 12; - else - offset = m_wavetblhdr*0x80000 + (slot->wave - 384) * 12; - for (i = 0; i < 12; i++) - p[i] = read_memory(offset+i); - - slot->bits = (p[0]&0xc0)>>6; - slot->startaddr = (p[2] | (p[1]<<8) | ((p[0]&0x3f)<<16)); - slot->loopaddr = (p[4]<<16) | (p[3]<<24); - slot->endaddr = (p[6]<<16) | (p[5]<<24); - slot->endaddr -= 0x00010000U; - slot->endaddr ^= 0xffff0000U; - - // copy internal registers data - for (i = 7; i < 12; i++) - C_w(0, 8 + snum + (i-2) * 24, p[i]); - - // status register LD bit is on for approx 300us - m_status_ld = 1; - //period = attotime::from_usec(300); - //if (m_clock != YMF278B_STD_CLOCK) - // period = (period * m_clock) / YMF278B_STD_CLOCK; - //m_timer_ld->adjust(period); !!! - - // retrigger if key is on - if (slot->KEY_ON) - retrigger_note(slot); - else if (slot->active) - { - // deactivate channel - slot->env_step = 5; - compute_envelope(slot); - } - - break; - } - - case 1: - slot->wave &= 0xff; - slot->wave |= ((data&0x1)<<8); - slot->F_NUMBER &= 0x380; - slot->F_NUMBER |= (data>>1); - if (slot->active && (data ^ m_pcmregs[reg]) & 0xfe) - { - compute_freq_step(slot); - compute_envelope(slot); - } - break; - - case 2: - slot->F_NUMBER &= 0x07f; - slot->F_NUMBER |= ((data&0x07)<<7); - slot->preverb = (data&0x8)>>3; - slot->octave = (data&0xf0)>>4; - if (data != m_pcmregs[reg]) - { - // channel goes off if octave is set to -8 (datasheet says it's prohibited) - // (it is ok if this activates the channel while it was off: compute_envelope will reset it again if needed) - slot->active = (slot->octave != 8); - - if (slot->active) - { - slot->env_preverb = 0; - compute_freq_step(slot); - compute_envelope(slot); - } - } - break; - - case 3: - slot->TL = data>>1; - slot->LD = data&0x1; - break; - - case 4: - slot->CH = (data&0x10)>>4; - // CH bit note: output to DO1 pin (1) or DO2 pin (0), this may - // silence the channel depending on how it's wired up on the PCB. - // For now, it's always enabled. - // (bit 5 (LFO reset) is also not hooked up yet) - - slot->pan = data&0xf; - slot->DAMP = (data&0x40)>>6; - if (data & 0x80) - { - // don't retrigger if key was already on - if (slot->KEY_ON) - { - if ((data ^ m_pcmregs[reg]) & 0x40) - compute_envelope(slot); - - break; - } - - retrigger_note(slot); - } - else if (slot->active) - { - // release - slot->env_step = 4; - compute_envelope(slot); - } - slot->KEY_ON = (data&0x80)>>7; - break; - - case 5: - // LFO and vibrato level, not hooked up yet - slot->LFO = (data>>3)&0x7; - slot->VIB = data&0x7; - break; - - case 6: - slot->AR = data>>4; - slot->D1R = data&0xf; - if (slot->active && data != m_pcmregs[reg]) - compute_envelope(slot); - break; - - case 7: - slot->DL = data>>4; - slot->D2R = data&0xf; - if (slot->active && data != m_pcmregs[reg]) - compute_envelope(slot); - break; - - case 8: - slot->RC = data>>4; - slot->RR = data&0xf; - if (slot->active && data != m_pcmregs[reg]) - compute_envelope(slot); - break; - - case 9: - // tremolo level, not hooked up yet - slot->AM = data & 0x7; - break; - } - } - else - { - // All non-slot registers - switch (reg) - { - // LSI TEST - case 0x00: - case 0x01: - break; - - case 0x02: - m_wavetblhdr = (data>>2)&0x7; - m_memmode = data&3; - break; - - case 0x03: - data &= 0x3f; // ! - break; - case 0x04: - break; - case 0x05: - // set memory address - m_memadr = m_pcmregs[3] << 16 | m_pcmregs[4] << 8 | data; - break; - - case 0x06: - // memory data (ignored, we don't support RAM) - write_memory(m_memadr, data); - m_memadr = (m_memadr + 1) & 0x3fffff; - break; - - case 0x07: - break; // unused - - case 0xf8: - m_fm_l = data & 0x7; - m_fm_r = (data>>3)&0x7; - break; - - case 0xf9: - m_pcm_l = data & 0x7; - m_pcm_r = (data>>3)&0x7; - break; - - default: - LOG(("YMF278B: Port C write %02x, %02x\n", reg, data)); - break; - } - } - - m_pcmregs[reg] = data; -} - -/*static void timer_busy_start(int is_pcm) -{ - // status register BUSY bit is on for 56(FM) or 88(PCM) cycles - m_status_busy = 1; - //m_timer_busy->adjust(attotime::from_hz(m_clock / (is_pcm ? 88 : 56))); -} - -WRITE8_MEMBER( ymf278b_device::write ) -{ - switch (offset) - { - case 0: - case 2: - timer_busy_start(0); - m_port_AB = data; - m_lastport = offset>>1 & 1; - break; - - case 1: - case 3: - timer_busy_start(0); - if (m_lastport) B_w(m_port_AB, data); - else A_w(m_port_AB, data); - break; - - case 4: - timer_busy_start(1); - m_port_C = data; - break; - - case 5: - // PCM regs are only accessible if NEW2 is set - if (~m_exp & 2) - break; - - //m_stream->update(); - - timer_busy_start(1); - C_w(m_port_C, data); - break; - - default: - logerror("%s: unexpected write at offset %X to ymf278b = %02X\n", machine().describe_context(), offset, data); - break; - } -} - - -READ8_MEMBER( ymf278b_device::read ) -{ - UINT8 ret = 0; - - switch (offset) - { - // status register - case 0: - { - // bits 0 and 1 are only valid if NEW2 is set - UINT8 newbits = 0; - if (m_exp & 2) - newbits = (m_status_ld << 1) | m_status_busy; - - ret = newbits | m_current_irq | (m_irq_line ? 0x80 : 0x00); - break; - } - - // FM regs can be read too (on contrary to what the datasheet says) - case 1: - case 3: - // but they're not implemented here yet - break; - - // PCM regs - case 5: - // only accessible if NEW2 is set - if (~m_exp & 2) - break; - - switch (m_port_C) - { - // special cases - case 2: - ret = (m_pcmregs[m_port_C] & 0x1f) | 0x20; // device ID in upper bits - break; - case 6: - ret = read_memory(m_memadr); - m_memadr = (m_memadr + 1) & 0x3fffff; - break; - - default: - ret = m_pcmregs[m_port_C]; - break; - } - break; - - default: - logerror("%s: unexpected read at offset %X from ymf278b\n", machine().describe_context(), offset); - break; - } - - return ret; -}*/ - -static UINT8 ymf278b_status_port_r(int num) -{ - return m_current_irq | (m_irq_line == ASSERT_LINE ? 0x80 : 0x00); -} - -// Not implemented yet -static UINT8 ymf278b_data_port_r(int num) -{ - return 0; -} - -static void ymf278b_control_port_A_w(int num, UINT8 data) -{ - m_port_A = data; -} - -static void ymf278b_data_port_A_w(int num, UINT8 data) -{ - A_w(num, m_port_A, data); -} - -static void ymf278b_control_port_B_w(int num, UINT8 data) -{ - m_port_B = data; -} - -static void ymf278b_data_port_B_w(int num, UINT8 data) -{ - B_w(num, m_port_B, data); -} - -static void ymf278b_control_port_C_w(int num, UINT8 data) -{ - m_port_C = data; -} - -static void ymf278b_data_port_C_w(int num, UINT8 data) -{ - C_w(num, m_port_C, data); -} - -/**************************************************************************/ - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void ymf278b_reset() -{ - int i; - - ymf278b_chip_in_reset = 1; - m_enable = 0; // w/o this, loading tengai then strikers ii/iii causes a hang at boot (must be above the A_w() for-loop) -dink - // clear registers - for (i = 0; i <= 4; i++) - A_w(0, i, 0); - - B_w(0, 5, 0); - for (i = 0; i < 8; i++) - C_w(0, i, 0); - for (i = 0xff; i >= 8; i--) - C_w(0, i, 0); - C_w(0, 0xf8, 0x1b); - - m_port_A = m_port_B = m_port_C = 0; - m_lastport = 0; - m_memadr = 0; - - // init/silence channels - for (i = 0; i < 24 ; i++) - { - YMF278BSlot *slot = &m_slots[i]; - - slot->LFO = 0; - slot->VIB = 0; - slot->AR = 0; - slot->D1R = 0; - slot->DL = 0; - slot->D2R = 0; - slot->RC = 0; - slot->RR = 0; - slot->AM = 0; - - slot->startaddr = 0; - slot->loopaddr = 0; - slot->endaddr = 0; - - slot->env_step = 5; - compute_envelope(slot); - } - -// ymf278b_timer_a_reset(0); - these are reset in burn_ymf278b.cpp -dink -// ymf278b_timer_b_reset(0); "" - //m_timer_a->reset(); - //m_timer_b->reset(); - /*m_timer_busy->reset();*/ m_status_busy = 0; - /*m_timer_ld->reset();*/ m_status_ld = 0; - - m_irq_line = 0; - m_current_irq = 0; - //if (m_irq_handler) - // m_irq_handler(0, 0); - ymf278b_chip_in_reset = 0; -} - -static void precompute_rate_tables() -{ - int i; - - // decay rate - for (i = 0; i < 64; i++) - { - if (i <= 3) - m_lut_dr[i] = 0; - else if (i >= 60) - m_lut_dr[i] = 15 << 4; - else - m_lut_dr[i] = (15 << (21 - i / 4)) / (4 + i % 4); - } - - // attack rate (manual shows curve instead of linear though, so this is not entirely accurate) - for (i = 0; i < 64; i++) - { - if (i <= 3 || i == 63) - m_lut_ar[i] = 0; - else if (i >= 60) - m_lut_ar[i] = 17; - else - m_lut_ar[i] = (67 << (15 - i / 4)) / (4 + i % 4); - } -} - -/*void register_save_state() -{ - int i; - - save_item(NAME(m_pcmregs)); - save_item(NAME(m_wavetblhdr)); - save_item(NAME(m_memmode)); - save_item(NAME(m_memadr)); - save_item(NAME(m_status_busy)); - save_item(NAME(m_status_ld)); - save_item(NAME(m_exp)); - save_item(NAME(m_fm_l)); - save_item(NAME(m_fm_r)); - save_item(NAME(m_pcm_l)); - save_item(NAME(m_pcm_r)); - save_item(NAME(m_timer_a_count)); - save_item(NAME(m_timer_b_count)); - save_item(NAME(m_enable)); - save_item(NAME(m_current_irq)); - save_item(NAME(m_irq_line)); - save_item(NAME(m_port_AB)); - save_item(NAME(m_port_C)); - save_item(NAME(m_lastport)); - - for (i = 0; i < 24; ++i) - { - save_item(NAME(m_slots[i].wave), i); - save_item(NAME(m_slots[i].F_NUMBER), i); - save_item(NAME(m_slots[i].octave), i); - save_item(NAME(m_slots[i].preverb), i); - save_item(NAME(m_slots[i].DAMP), i); - save_item(NAME(m_slots[i].CH), i); - save_item(NAME(m_slots[i].LD), i); - save_item(NAME(m_slots[i].TL), i); - save_item(NAME(m_slots[i].pan), i); - save_item(NAME(m_slots[i].LFO), i); - save_item(NAME(m_slots[i].VIB), i); - save_item(NAME(m_slots[i].AM), i); - - save_item(NAME(m_slots[i].AR), i); - save_item(NAME(m_slots[i].D1R), i); - save_item(NAME(m_slots[i].DL), i); - save_item(NAME(m_slots[i].D2R), i); - save_item(NAME(m_slots[i].RC), i); - save_item(NAME(m_slots[i].RR), i); - - save_item(NAME(m_slots[i].step), i); - save_item(NAME(m_slots[i].stepptr), i); - - save_item(NAME(m_slots[i].active), i); - save_item(NAME(m_slots[i].KEY_ON), i); - save_item(NAME(m_slots[i].bits), i); - save_item(NAME(m_slots[i].startaddr), i); - save_item(NAME(m_slots[i].loopaddr), i); - save_item(NAME(m_slots[i].endaddr), i); - - save_item(NAME(m_slots[i].env_step), i); - save_item(NAME(m_slots[i].env_vol), i); - save_item(NAME(m_slots[i].env_vol_step), i); - save_item(NAME(m_slots[i].env_vol_lim), i); - save_item(NAME(m_slots[i].env_preverb), i); - } -}*/ - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -int ymf278b_start(int num, UINT8 *rom, INT32 romsize, void (*irq_cb)(INT32, INT32), void (*timer_cb)(INT32, INT32, double), int clock, int rate) -{ - int i; - - m_rom = rom; - m_romsize = romsize; - m_clock = clock; - m_irq_handler = irq_cb; - timer_callback = timer_cb; - - /*m_timer_base = attotime::from_hz(m_clock) * (19*36); - we use different timers -dink - m_timer_a = timer_alloc(TIMER_A); - m_timer_b = timer_alloc(TIMER_B); - m_timer_busy = timer_alloc(TIMER_BUSY_CLEAR); - m_timer_ld = timer_alloc(TIMER_LD_CLEAR); */ - - m_clock_ratio = (float)clock / (float)YMF278B_STD_CLOCK; - m_sample_rate = rate; - - for (i = 0; i < 24; i++) - { - m_slots[i].num = i; - } - - //m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()/768); - m_mix_buffer = malloc(sizeof(INT32)*48000*2); // this driver only supports 44100, but set the buffersize to 48000 just incase someone uses this in their FBA settings. - - // rate tables - precompute_rate_tables(); - - // Volume table, 1 = -0.375dB, 8 = -3dB, 256 = -96dB - for(i = 0; i < 256; i++) - m_volume[i] = 65536*pow(2.0, (-0.375/6)*i); - for(i = 256; i < 256*4; i++) - m_volume[i] = 0; - - // Pan values, units are -3dB, i.e. 8. - for(i = 0; i < 16; i++) - { - m_pan_left[i] = i < 7 ? i*8 : i < 9 ? 256 : 0; - m_pan_right[i] = i < 8 ? 0 : i < 10 ? 256 : (16-i)*8; - } - - // Mixing levels, units are -3dB, and add some margin to avoid clipping - for(i=0; i<7; i++) - m_mix_level[i] = m_volume[8*i+13]; - m_mix_level[7] = 0; - ymf278b_chip_in_reset = 0; - - // Register state for saving - //register_save_state(); - return 0; -} - -void ymf278b_scan(INT32 nAction, INT32* pnMin) -{ - if (nAction & ACB_DRIVER_DATA) { - // internal state - make for happy savestates -dink - SCAN_VAR(m_pcmregs); - SCAN_VAR(m_slots); - SCAN_VAR(m_wavetblhdr); - SCAN_VAR(m_memmode); - SCAN_VAR(m_memadr); - SCAN_VAR(m_exp); - - SCAN_VAR(m_fm_l); SCAN_VAR(m_fm_r); - SCAN_VAR(m_pcm_l); SCAN_VAR(m_pcm_r); - - SCAN_VAR(m_timer_a_count); SCAN_VAR(m_timer_b_count); - SCAN_VAR(m_enable); SCAN_VAR(m_current_irq); - SCAN_VAR(m_irq_line); - - SCAN_VAR(m_port_C); SCAN_VAR(m_port_A); SCAN_VAR(m_port_B); - } -} - - -/* -const device_type YMF278B = &device_creator; - -ymf278b_device::ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, YMF278B, "YMF278B", tag, owner, clock, "ymf278b", __FILE__), - device_sound_interface(mconfig, *this), - m_irq_handler(*this) -{ -} - -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void ymf278b_device::device_config_complete() -{ -} -*/ -void YMF278B_sh_stop( void ) -{ - if(m_mix_buffer) { - free(m_mix_buffer); - m_mix_buffer = NULL; - } -} - -READ8_HANDLER( YMF278B_status_port_0_r ) -{ - return ymf278b_status_port_r(0); -} - -READ8_HANDLER( YMF278B_data_port_0_r ) -{ - return ymf278b_data_port_r(0); -} - -WRITE8_HANDLER( YMF278B_control_port_0_A_w ) -{ - ymf278b_control_port_A_w(0, data); -} - -WRITE8_HANDLER( YMF278B_data_port_0_A_w ) -{ - ymf278b_data_port_A_w(0, data); -} - -WRITE8_HANDLER( YMF278B_control_port_0_B_w ) -{ - ymf278b_control_port_B_w(0, data); -} - -WRITE8_HANDLER( YMF278B_data_port_0_B_w ) -{ - ymf278b_data_port_B_w(0, data); -} - -WRITE8_HANDLER( YMF278B_control_port_0_C_w ) -{ - ymf278b_control_port_C_w(0, data); -} - -WRITE8_HANDLER( YMF278B_data_port_0_C_w ) -{ - ymf278b_data_port_C_w(0, data); -} - diff --git a/jan/src/burn/snd/ymf278b.h b/jan/src/burn/snd/ymf278b.h deleted file mode 100644 index 472803c61..000000000 --- a/jan/src/burn/snd/ymf278b.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __YMF278B_H__ -#define __YMF278B_H__ - -#define MAX_YMF278B (1) - -#define YMF278B_STD_CLOCK (33868800) /* standard clock for OPL4 */ - -void ymf278b_scan(INT32 nAction, INT32* pnMin); -void ymf278b_pcm_update(int num, INT16 **outputs, int samples); -int ymf278b_timer_over(int num, int timer); -int ymf278b_start(int num, UINT8 *rom, INT32 romsize, void (*irq_cb)(INT32, INT32), void (*timer_cb)(INT32, INT32, double), int clock, int rate); -void ymf278b_reset(); -void YMF278B_sh_stop(void); - -READ8_HANDLER( YMF278B_status_port_0_r ); -READ8_HANDLER( YMF278B_data_port_0_r ); -WRITE8_HANDLER( YMF278B_control_port_0_A_w ); -WRITE8_HANDLER( YMF278B_data_port_0_A_w ); -WRITE8_HANDLER( YMF278B_control_port_0_B_w ); -WRITE8_HANDLER( YMF278B_data_port_0_B_w ); -WRITE8_HANDLER( YMF278B_control_port_0_C_w ); -WRITE8_HANDLER( YMF278B_data_port_0_C_w ); -#endif diff --git a/jan/src/burn/snd/ymz280b.cpp b/jan/src/burn/snd/ymz280b.cpp deleted file mode 100644 index e4785ead8..000000000 --- a/jan/src/burn/snd/ymz280b.cpp +++ /dev/null @@ -1,785 +0,0 @@ -// Yamaha YMZ280B module -// Emulation by Jan Klaassen - -#include -#include "burnint.h" -#include "ymz280b.h" -#include "burn_sound.h" - -static INT32 nYMZ280BSampleRate; -bool bESPRaDeMixerKludge = false; - -UINT8* YMZ280BROM; -UINT32 YMZ280BROMSIZE = 0xffffff; // 16meg max addressable rom size -void (*pYMZ280BRAMWrite)(INT32 offset, INT32 nValue) = NULL; -INT32 (*pYMZ280BRAMRead)(INT32 offset) = NULL; - -UINT32 nYMZ280BStatus; -UINT32 nYMZ280BRegister; - -static bool bYMZ280BEnable; - -static bool bYMZ280BIRQEnable; -static INT32 nYMZ280BIRQMask; -static INT32 nYMZ280BIRQStatus; -void (*YMZ280BIRQCallback)(INT32 nStatus) = NULL; - -static INT32* pBuffer = NULL; - -static double nYMZ280BFrequency; - -static INT32 YMZ280BDeltaTable[16]; - -static INT32 YMZ280BStepShift[8] = {0x0E6, 0x0E6, 0x0E6, 0x0E6, 0x133, 0x199, 0x200, 0x266}; - -static double YMZ280BVolumes[2]; -static INT32 YMZ280BRouteDirs[2]; - -struct sYMZ280BChannelInfo { - bool bEnabled; - bool bPlaying; - bool bLoop; - INT32 nMode; - INT32 nFrequency; - INT32 nSample; - INT32 nLoopSample; - UINT32 nSampleSize; - UINT32 nPosition; - INT32 nFractionalPosition; - INT32 nStep; - INT32 nLoopStep; - UINT32 nSampleStart; - UINT32 nSampleStop; - UINT32 nLoopStart; - UINT32 nLoopStop; - INT32 nVolume; - INT32 nVolumeLeft; - INT32 nVolumeRight; - INT32 nPan; - - INT32 nOutput; - INT32 nPreviousOutput; - - INT32 nBufPos; -}; - -static INT32 nActiveChannel, nDelta, nSample, nCount, nRamReadAddress; -static INT32* buf = NULL; - -sYMZ280BChannelInfo YMZ280BChannelInfo[8]; -static sYMZ280BChannelInfo* channelInfo; - -static INT32* YMZ280BChannelData[8]; - -void YMZ280BReset() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMZ280BInitted) bprintf(PRINT_ERROR, _T("YMZ280BReset called without init\n")); -#endif - - memset(&YMZ280BChannelInfo[0], 0, sizeof(YMZ280BChannelInfo)); - - nYMZ280BIRQMask = 0; - nYMZ280BIRQStatus = 0; - nYMZ280BStatus = 0; - bYMZ280BEnable = false; - nRamReadAddress = 0; - - for (INT32 j = 0; j < 8; j++) { - memset(YMZ280BChannelData[j], 0, 0x1000 * sizeof(INT32)); - YMZ280BChannelInfo[j].nBufPos = 4; - } - - return; -} - -inline void YMZ280BSetSampleSize(const INT32 nChannel) -{ - double rate = (double)(YMZ280BChannelInfo[nChannel].nFrequency + 1) * nYMZ280BFrequency * 512; - rate /= nYMZ280BSampleRate * 3; - - YMZ280BChannelInfo[nChannel].nSampleSize = (UINT32)rate; -} - -INT32 YMZ280BScan() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMZ280BInitted) bprintf(PRINT_ERROR, _T("YMZ280BScan called without init\n")); -#endif - - SCAN_VAR(nYMZ280BStatus); - SCAN_VAR(nYMZ280BRegister); - - SCAN_VAR(bYMZ280BEnable); - - SCAN_VAR(bYMZ280BIRQEnable); - SCAN_VAR(nYMZ280BIRQMask); - SCAN_VAR(nYMZ280BIRQStatus); - SCAN_VAR(nRamReadAddress); - - for (INT32 j = 0; j < 8; j++) { - SCAN_VAR(YMZ280BChannelInfo[j]); - YMZ280BSetSampleSize(j); - } - - return 0; -} - -INT32 YMZ280BInit(INT32 nClock, void (*IRQCallback)(INT32)) -{ - DebugSnd_YMZ280BInitted = 1; - - nYMZ280BFrequency = nClock; - - if (nBurnSoundRate > 0) { - nYMZ280BSampleRate = nBurnSoundRate; - } else { - nYMZ280BSampleRate = 11025; - } - - // Compute sample deltas - for (INT32 n = 0; n < 16; n++) { - nDelta = (n & 7) * 2 + 1; - if (n & 8) { - nDelta = -nDelta; - } - YMZ280BDeltaTable[n] = nDelta; - } - - YMZ280BIRQCallback = IRQCallback; - - BurnFree(pBuffer); - pBuffer = (INT32*)BurnMalloc(nYMZ280BSampleRate * 2 * sizeof(INT32)); - - for (INT32 j = 0; j < 8; j++) { - YMZ280BChannelData[j] = (INT32*)BurnMalloc(0x1000 * sizeof(INT32)); - } - - // default routes - YMZ280BVolumes[BURN_SND_YMZ280B_YMZ280B_ROUTE_1] = 1.00; - YMZ280BVolumes[BURN_SND_YMZ280B_YMZ280B_ROUTE_2] = 1.00; - YMZ280BRouteDirs[BURN_SND_YMZ280B_YMZ280B_ROUTE_1] = BURN_SND_ROUTE_LEFT; - YMZ280BRouteDirs[BURN_SND_YMZ280B_YMZ280B_ROUTE_2] = BURN_SND_ROUTE_RIGHT; - - YMZ280BReset(); - - return 0; -} - -INT32 YMZ280BInit(INT32 nClock, void (*IRQCallback)(INT32), INT32 rom_len) -{ - YMZ280BROMSIZE = rom_len; - - return YMZ280BInit(nClock, IRQCallback); -} - -void YMZ280BSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMZ280BInitted) bprintf(PRINT_ERROR, _T("BurnYMZ280BSetRoute called without init\n")); - if (nIndex < 0 || nIndex > 1) bprintf(PRINT_ERROR, _T("BurnYMZ280BSetRoute called with invalid index %i\n"), nIndex); -#endif - - YMZ280BVolumes[nIndex] = nVolume; - YMZ280BRouteDirs[nIndex] = nRouteDir; -} - -void YMZ280BExit() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMZ280BInitted) bprintf(PRINT_ERROR, _T("YMZ280BExit called without init\n")); -#endif - - if (!DebugSnd_YMZ280BInitted) return; - - BurnFree(pBuffer); - - for (INT32 j = 0; j < 8; j++) { - BurnFree(YMZ280BChannelData[j]); - } - - YMZ280BIRQCallback = NULL; - pYMZ280BRAMWrite = NULL; - pYMZ280BRAMRead = NULL; - bESPRaDeMixerKludge = false; - YMZ280BROMSIZE = 0xffffff; - - DebugSnd_YMZ280BInitted = 0; -} - -inline static void UpdateIRQStatus() -{ - nYMZ280BIRQStatus = 0; - if (bYMZ280BIRQEnable && (nYMZ280BStatus & nYMZ280BIRQMask)) { - nYMZ280BIRQStatus = 1; - } - - if ((YMZ280BIRQCallback != NULL)) { - YMZ280BIRQCallback(nYMZ280BIRQStatus); - } -} - -inline static void ComputeVolume(sYMZ280BChannelInfo* channel) -{ - if (channel->nPan == 8) { - channel->nVolumeLeft = channel->nVolume; - channel->nVolumeRight = channel->nVolume; - } else { - if (channel->nPan < 8) { - channel->nVolumeLeft = channel->nVolume; - channel->nVolumeRight = channel->nVolume * channel->nPan / 8; - } else { - channel->nVolumeLeft = channel->nVolume * (15 - channel->nPan) / 8; - channel->nVolumeRight = channel->nVolume; - } - } -} - -inline static void RampChannel() -{ -#if 1 - if (channelInfo->nSample != 0) { - if (channelInfo->nSample > 0) { - INT32 nRamp = 64 * 32678 / nYMZ280BSampleRate; - while (nCount-- && channelInfo->nSample > nRamp) { - channelInfo->nSample -= nRamp; - *buf++ += channelInfo->nSample * channelInfo->nVolumeLeft; - *buf++ += channelInfo->nSample * channelInfo->nVolumeRight; - } - if (channelInfo->nSample < nRamp) { - channelInfo->nSample = 0; - } - } else { - INT32 nRamp = 0 - 64 * 32678 / nYMZ280BSampleRate; - while (nCount-- && channelInfo->nSample < nRamp) { - channelInfo->nSample -= nRamp; - *buf++ += channelInfo->nSample * channelInfo->nVolumeLeft; - *buf++ += channelInfo->nSample * channelInfo->nVolumeRight; - } - if (channelInfo->nSample > nRamp) { - channelInfo->nSample = 0; - } - } - } -#endif -} - -inline static UINT8 ymz280b_readmem(UINT32 offset) -{ - if (offset < YMZ280BROMSIZE) { - return YMZ280BROM[offset]; - } else { - // Battle Bakraid, rom length 0xC00000 tries to read from 0xFFFF00 twice in level 5 at the first mid-boss. - // Possile protection? Or just a bug? Hmmm.. -dink - bprintf(0, _T("ymz280b: bad offset: %d!! (max. size: %d)\n"), offset, YMZ280BROMSIZE); - return 0; - } -} - -inline static void decode_adpcm() -{ - // Get next value & compute delta - nDelta = ymz280b_readmem(channelInfo->nPosition >> 1); - if (channelInfo->nPosition & 1) { - nDelta &= 0x0F; - } else { - nDelta >>= 4; - } - - nSample = channelInfo->nSample + channelInfo->nStep * YMZ280BDeltaTable[nDelta] / 8; - if (nSample > 32767) { - nSample = 32767; - } else { - if (nSample < -32768) { - nSample = -32768; - } - } - channelInfo->nSample = nSample; - - channelInfo->nStep = channelInfo->nStep * YMZ280BStepShift[nDelta & 7] / 256; - if (channelInfo->nStep > 0x6000) { - channelInfo->nStep = 0x6000; - } else { - if (channelInfo->nStep < 127) { - channelInfo->nStep = 127; - } - } - - channelInfo->nPosition++; -} - -inline static void decode_pcm8() -{ - nDelta = ymz280b_readmem(channelInfo->nPosition >> 1); - - channelInfo->nSample = (INT8)nDelta * 256; - channelInfo->nPosition+=2; -} - -inline static void decode_pcm16() -{ - nDelta = (INT16)((ymz280b_readmem(channelInfo->nPosition / 2 + 1) << 8) + ymz280b_readmem(channelInfo->nPosition / 2)); - - channelInfo->nSample = nDelta; - channelInfo->nPosition+=4; -} - -inline static void decode_none() -{ - channelInfo->nSample=0; -} - -static void (*decode_table[4])() = { decode_none, decode_adpcm, decode_pcm8, decode_pcm16 }; - -inline static void ComputeOutput_Linear() -{ - nSample = channelInfo->nPreviousOutput + (channelInfo->nOutput - channelInfo->nPreviousOutput) * (channelInfo->nFractionalPosition >> 12) / (0x01000000 >> 12); - - *buf++ += nSample * channelInfo->nVolumeLeft; - *buf++ += nSample * channelInfo->nVolumeRight; -} - -inline static void ComputeOutput_Cubic() -{ - if (channelInfo->nBufPos > 0x0FF0) { - YMZ280BChannelData[nActiveChannel][0] = YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos - 4]; - YMZ280BChannelData[nActiveChannel][1] = YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos - 3]; - YMZ280BChannelData[nActiveChannel][2] = YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos - 2]; - YMZ280BChannelData[nActiveChannel][3] = YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos - 1]; - channelInfo->nBufPos = 4; - } - - nSample = INTERPOLATE4PS_16BIT(channelInfo->nFractionalPosition >> 12, - YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos - 4], - YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos - 3], - YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos - 2], - YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos - 1]); - - *buf++ += nSample * channelInfo->nVolumeLeft; - *buf++ += nSample * channelInfo->nVolumeRight; -} - -inline static void RenderADPCM_Linear() -{ - while (nCount--) { - if (channelInfo->nFractionalPosition >= 0x01000000) { - - channelInfo->nPreviousOutput = channelInfo->nOutput; - - do { - // Check for end of sample - if (channelInfo->nPosition >= channelInfo->nSampleStop) { - channelInfo->bPlaying = false; - - RampChannel(); - - nYMZ280BStatus |= 1 << nActiveChannel; - UpdateIRQStatus(); - - return; - } else { - - decode_table[YMZ280BChannelInfo[nActiveChannel].nMode](); // decode one sample - - // Advance sample position - channelInfo->nFractionalPosition -= 0x01000000; - } - - } while (channelInfo->nFractionalPosition >= 0x01000000); - - channelInfo->nOutput = channelInfo->nSample; - } - - ComputeOutput_Linear(); - - channelInfo->nFractionalPosition += channelInfo->nSampleSize; - } -} - -inline static void RenderADPCMLoop_Linear() -{ - while (nCount--) { - if (channelInfo->nFractionalPosition >= 0x01000000) { - - channelInfo->nPreviousOutput = channelInfo->nOutput; - - do { - // Check for end of sample - if (channelInfo->nPosition >= channelInfo->nLoopStop) { - channelInfo->nStep = channelInfo->nLoopStep; - channelInfo->nSample = channelInfo->nLoopSample; - channelInfo->nPosition = channelInfo->nLoopStart; - } else { - // Store the state of the channel at the point where the loop starts - if (channelInfo->nPosition == channelInfo->nLoopStart) { - channelInfo->nLoopStep = channelInfo->nStep; - channelInfo->nLoopSample = channelInfo->nSample; - } - } - - decode_table[YMZ280BChannelInfo[nActiveChannel].nMode](); // decode one sample - - // Advance sample position - channelInfo->nFractionalPosition -= 0x01000000; - - } while (channelInfo->nFractionalPosition >= 0x01000000); - - channelInfo->nOutput = channelInfo->nSample; - } - - ComputeOutput_Linear(); - - channelInfo->nFractionalPosition += channelInfo->nSampleSize; - } -} -inline static void RenderADPCM_Cubic() -{ - while (nCount--) { - while (channelInfo->nFractionalPosition >= 0x01000000) { - - // Check for end of sample - if (channelInfo->nPosition >= channelInfo->nSampleStop) { - channelInfo->bPlaying = false; - - RampChannel(); - - nYMZ280BStatus |= 1 << nActiveChannel; - UpdateIRQStatus(); - - return; - } else { - - decode_table[YMZ280BChannelInfo[nActiveChannel].nMode](); // decode one sample - - // Advance sample position - channelInfo->nFractionalPosition -= 0x01000000; - - YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos++] = channelInfo->nSample; - } - } - - ComputeOutput_Cubic(); - - channelInfo->nFractionalPosition += channelInfo->nSampleSize; - } -} - -inline static void RenderADPCMLoop_Cubic() -{ - while (nCount--) { - - while (channelInfo->nFractionalPosition >= 0x01000000) { - // Check for end of sample - if (channelInfo->nPosition >= channelInfo->nLoopStop) { - - channelInfo->nStep = channelInfo->nLoopStep; - channelInfo->nSample = channelInfo->nLoopSample; - channelInfo->nPosition = channelInfo->nLoopStart; - } else { - // Store the state of the channel at the point where the loop starts - if (channelInfo->nPosition == channelInfo->nLoopStart) { - channelInfo->nLoopStep = channelInfo->nStep; - channelInfo->nLoopSample = channelInfo->nSample; - } - } - - decode_table[YMZ280BChannelInfo[nActiveChannel].nMode](); // decode one sample - - // Advance sample position - channelInfo->nFractionalPosition -= 0x01000000; - - YMZ280BChannelData[nActiveChannel][channelInfo->nBufPos++] = channelInfo->nSample; - } - - ComputeOutput_Cubic(); - - channelInfo->nFractionalPosition += channelInfo->nSampleSize; - } -} - -INT32 YMZ280BRender(INT16* pSoundBuf, INT32 nSegmentLength) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMZ280BInitted) bprintf(PRINT_ERROR, _T("YMZ280BRender called without init\n")); -#endif - - memset(pBuffer, 0, nSegmentLength * 2 * sizeof(INT32)); - - for (nActiveChannel = 0; nActiveChannel < 8; nActiveChannel++) { - nCount = nSegmentLength; - buf = pBuffer; - channelInfo = &YMZ280BChannelInfo[nActiveChannel]; - - if (channelInfo->bPlaying) { - if (nInterpolation < 3) { - if (channelInfo->bEnabled && channelInfo->bLoop) { - RenderADPCMLoop_Linear(); - } else { - RenderADPCM_Linear(); - } - } else { - if (channelInfo->bEnabled && channelInfo->bLoop) { - RenderADPCMLoop_Cubic(); - } else { - RenderADPCM_Cubic(); - } - } - } else { - RampChannel(); - } - } - - for (INT32 i = 0; i < nSegmentLength; i++) { - INT32 nLeftSample = 0, nRightSample = 0; - - if ((YMZ280BRouteDirs[BURN_SND_YMZ280B_YMZ280B_ROUTE_1] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((pBuffer[(i << 1) + 0] >> 8) * YMZ280BVolumes[BURN_SND_YMZ280B_YMZ280B_ROUTE_1]); - } - if ((YMZ280BRouteDirs[BURN_SND_YMZ280B_YMZ280B_ROUTE_1] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((pBuffer[(i << 1) + 0] >> 8) * YMZ280BVolumes[BURN_SND_YMZ280B_YMZ280B_ROUTE_1]); - } - - if ((YMZ280BRouteDirs[BURN_SND_YMZ280B_YMZ280B_ROUTE_2] & BURN_SND_ROUTE_LEFT) == BURN_SND_ROUTE_LEFT) { - nLeftSample += (INT32)((pBuffer[(i << 1) + 1] >> 8) * YMZ280BVolumes[BURN_SND_YMZ280B_YMZ280B_ROUTE_2]); - } - if ((YMZ280BRouteDirs[BURN_SND_YMZ280B_YMZ280B_ROUTE_2] & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) { - nRightSample += (INT32)((pBuffer[(i << 1) + 1] >> 8) * YMZ280BVolumes[BURN_SND_YMZ280B_YMZ280B_ROUTE_2]); - } - - pSoundBuf[(i << 1) + 0] = BURN_SND_CLIP(nLeftSample); - pSoundBuf[(i << 1) + 1] = BURN_SND_CLIP(nRightSample); - } - - return 0; -} - -void YMZ280BWriteRegister(UINT8 nValue) -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMZ280BInitted) bprintf(PRINT_ERROR, _T("YMZ280BWriteRegister called without init\n")); -#endif - - if (nYMZ280BRegister < 0x80) { - INT32 nWriteChannel = (nYMZ280BRegister >> 2) & 0x07; - - switch (nYMZ280BRegister & 0x63) { - - // Miscellaneous - case 0: // Frequency - YMZ280BChannelInfo[nWriteChannel].nFrequency &= 0x0100; - YMZ280BChannelInfo[nWriteChannel].nFrequency |= nValue; - YMZ280BSetSampleSize(nWriteChannel); - break; - case 1: { // Start/mode/freq - YMZ280BChannelInfo[nWriteChannel].nFrequency &= 0x00FF; - YMZ280BChannelInfo[nWriteChannel].nFrequency |= ((nValue & 1) << 8); - YMZ280BSetSampleSize(nWriteChannel); - - YMZ280BChannelInfo[nWriteChannel].bLoop = (nValue & 0x10); - YMZ280BChannelInfo[nWriteChannel].nMode = ((nValue >> 5) & 0x03); - - if ((nValue & 0x80) == 0) { - YMZ280BChannelInfo[nWriteChannel].bEnabled = false; - if (!YMZ280BChannelInfo[nWriteChannel].bLoop) { - YMZ280BChannelInfo[nWriteChannel].bPlaying = false; - } - } else { - if (!YMZ280BChannelInfo[nWriteChannel].bEnabled) { - YMZ280BChannelInfo[nWriteChannel].bEnabled = true; - YMZ280BChannelInfo[nWriteChannel].bPlaying = true; - YMZ280BChannelInfo[nWriteChannel].nPosition = YMZ280BChannelInfo[nWriteChannel].nSampleStart; - YMZ280BChannelInfo[nWriteChannel].nStep = 127; - - if (YMZ280BChannelInfo[nWriteChannel].nMode > 1) { -#ifdef DEBUG - //bprintf(0,_T("Sample Start: %08X - Stop: %08X.\n"),YMZ280BChannelInfo[nWriteChannel].nSampleStart, YMZ280BChannelInfo[nWriteChannel].nSampleStop); -#endif - } - -#if 0 - if (nInterpolation < 3) { - YMZ280BChannelInfo[nWriteChannel].nFractionalPosition = 0; - YMZ280BChannelInfo[nWriteChannel].nPreviousOutput = YMZ280BChannelInfo[nWriteChannel].nSample; - YMZ280BChannelInfo[nWriteChannel].nOutput = YMZ280BChannelInfo[nWriteChannel].nSample; - } else { - YMZ280BChannelInfo[nWriteChannel].nFractionalPosition = 0x03000000; - YMZ280BChannelData[nWriteChannel][0] = YMZ280BChannelInfo[nWriteChannel].nSample; - YMZ280BChannelInfo[nWriteChannel].nBufPos = 1; - } -#else - YMZ280BChannelInfo[nWriteChannel].nSample = 0; - - if (nInterpolation < 3) { - YMZ280BChannelInfo[nWriteChannel].nFractionalPosition = 0; - YMZ280BChannelInfo[nWriteChannel].nPreviousOutput = 0; - YMZ280BChannelInfo[nWriteChannel].nOutput = 0; - } else { - YMZ280BChannelInfo[nWriteChannel].nFractionalPosition = 0x03000000; - YMZ280BChannelData[nWriteChannel][3] = 0; - YMZ280BChannelInfo[nWriteChannel].nBufPos = 1; - } -#endif - } - } - - break; - } - case 2: // Volume - if (bESPRaDeMixerKludge) { - if (nWriteChannel != 7 && nWriteChannel != 6) nValue -= 30; - if (nWriteChannel == 7) { - if (nValue + 15 > 255) - nValue = 255; - else - nValue += 15; - } - } - //bprintf(0,_T("Ch: %d Volume %d Sample Start: %08X - Stop: %08X.\n"),nWriteChannel,nValue,YMZ280BChannelInfo[nWriteChannel].nSampleStart, YMZ280BChannelInfo[nWriteChannel].nSampleStop); - YMZ280BChannelInfo[nWriteChannel].nVolume = nValue; - ComputeVolume(&YMZ280BChannelInfo[nWriteChannel]); - break; - case 3: // Pan - YMZ280BChannelInfo[nWriteChannel].nPan = nValue & 0x0F; - ComputeVolume(&YMZ280BChannelInfo[nWriteChannel]); - break; - - // Hi bits - case 0x20: - YMZ280BChannelInfo[nWriteChannel].nSampleStart &= 0x0001FFFE; - YMZ280BChannelInfo[nWriteChannel].nSampleStart |= (nValue << 17); - break; - case 0x21: - YMZ280BChannelInfo[nWriteChannel].nLoopStart &= 0x0001FFFE; - YMZ280BChannelInfo[nWriteChannel].nLoopStart |= (nValue << 17); - break; - case 0x22: - YMZ280BChannelInfo[nWriteChannel].nLoopStop &= 0x0001FFFE; - YMZ280BChannelInfo[nWriteChannel].nLoopStop |= (nValue << 17); - break; - case 0x23: - YMZ280BChannelInfo[nWriteChannel].nSampleStop &= 0x0001FFFE; - YMZ280BChannelInfo[nWriteChannel].nSampleStop |= (nValue << 17); - break; - - // Mid bits - case 0x40: - YMZ280BChannelInfo[nWriteChannel].nSampleStart &= 0x01FE01FE; - YMZ280BChannelInfo[nWriteChannel].nSampleStart |= (nValue << 9); - break; - case 0x41: - YMZ280BChannelInfo[nWriteChannel].nLoopStart &= 0x01FE01FE; - YMZ280BChannelInfo[nWriteChannel].nLoopStart |= (nValue << 9); - break; - case 0x42: - YMZ280BChannelInfo[nWriteChannel].nLoopStop &= 0x01FE01FE; - YMZ280BChannelInfo[nWriteChannel].nLoopStop |= (nValue << 9); - break; - case 0x43: - YMZ280BChannelInfo[nWriteChannel].nSampleStop &= 0x01FE01FE; - YMZ280BChannelInfo[nWriteChannel].nSampleStop |= (nValue << 9); - break; - - // Lo bits - case 0x60: - YMZ280BChannelInfo[nWriteChannel].nSampleStart &= 0x01FFFE00; - YMZ280BChannelInfo[nWriteChannel].nSampleStart |= (nValue << 1); - break; - case 0x61: - YMZ280BChannelInfo[nWriteChannel].nLoopStart &= 0x01FFFE00; - YMZ280BChannelInfo[nWriteChannel].nLoopStart |= (nValue << 1); - break; - case 0x62: - YMZ280BChannelInfo[nWriteChannel].nLoopStop &= 0x01FFFE00; - YMZ280BChannelInfo[nWriteChannel].nLoopStop |= (nValue << 1); - break; - case 0x63: - YMZ280BChannelInfo[nWriteChannel].nSampleStop &= 0x01FFFE00; - YMZ280BChannelInfo[nWriteChannel].nSampleStop |= (nValue << 1); - break; - - } - } else { - switch (nYMZ280BRegister) - { - case 0x84: // ROM readback / RAM write (high) - nRamReadAddress &= 0x00ffff; - nRamReadAddress |= (nValue << 16); - break; - - case 0x85: // ROM readback / RAM write (med) - nRamReadAddress &= 0xff00ff; - nRamReadAddress |= (nValue << 8); - break; - - case 0x86: // ROM readback / RAM write (low) - nRamReadAddress &= 0xffff00; - nRamReadAddress |= (nValue << 0); - break; - - case 0x87: // RAM write - if (pYMZ280BRAMWrite) { - pYMZ280BRAMWrite(nRamReadAddress, nValue); - } - break; - - case 0xfe: // Set IRQ mask - nYMZ280BIRQMask = nValue; - UpdateIRQStatus(); - break; - - case 0xff: // Start/stop playing, enable/disable IRQ - { - if (nValue & 0x10) { - bYMZ280BIRQEnable = true; - } else { - bYMZ280BIRQEnable = false; - } - UpdateIRQStatus(); - - if (bYMZ280BEnable && !(nValue & 0x80)) { - bYMZ280BEnable = false; - for (INT32 n = 0; n < 8; n++) { - YMZ280BChannelInfo[n].bPlaying = false; - } - } else { - if (!bYMZ280BEnable && (nValue & 0x80)) { - bYMZ280BEnable = true; - for (INT32 n = 0; n < 8; n++) { - if (YMZ280BChannelInfo[n].bEnabled && YMZ280BChannelInfo[n].bLoop) { - YMZ280BChannelInfo[n].bPlaying = true; - } - } - } - } - } - break; - } - } -} - -UINT32 YMZ280BReadStatus() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMZ280BInitted) bprintf(PRINT_ERROR, _T("YMZ280BReadStatus called without init\n")); -#endif - - UINT32 nStatus = nYMZ280BStatus; - nYMZ280BStatus = 0; - - UpdateIRQStatus(); - - return nStatus; -} - -UINT32 YMZ280BReadRAM() -{ -#if defined FBA_DEBUG - if (!DebugSnd_YMZ280BInitted) bprintf(PRINT_ERROR, _T("YMZ280BReadRAM called without init\n")); -#endif - - if (pYMZ280BRAMRead) { - return pYMZ280BRAMRead(nRamReadAddress++ - 1); - } - - return 0; -} diff --git a/jan/src/burn/snd/ymz280b.h b/jan/src/burn/snd/ymz280b.h deleted file mode 100644 index 864826b20..000000000 --- a/jan/src/burn/snd/ymz280b.h +++ /dev/null @@ -1,55 +0,0 @@ -// Yamaha YMZ280B module - -INT32 YMZ280BInit(INT32 nClock, void (*IRQCallback)(INT32)); -INT32 YMZ280BInit(INT32 nClock, void (*IRQCallback)(INT32), INT32 rom_len); -void YMZ280BSetRoute(INT32 nIndex, double nVolume, INT32 nRouteDir); -void YMZ280BReset(); -INT32 YMZ280BScan(); -void YMZ280BExit(); -INT32 YMZ280BRender(INT16* pSoundBuf, INT32 nSegmenLength); -void YMZ280BWriteRegister(UINT8 nValue); -UINT32 YMZ280BReadStatus(); -UINT32 YMZ280BReadRAM(); - -extern UINT8* YMZ280BROM; -extern UINT32 YMZ280BROMSIZE; -extern bool bESPRaDeMixerKludge; - -// external memory handlers -extern void (*pYMZ280BRAMWrite)(INT32 offset, INT32 nValue); -extern INT32 (*pYMZ280BRAMRead)(INT32 offset); - -extern UINT32 nYMZ280BStatus; -extern UINT32 nYMZ280BRegister; - -inline static void YMZ280BSelectRegister(UINT8 nRegister) -{ - nYMZ280BRegister = nRegister; -} - -inline static void YMZ280BWrite(INT32 offset, UINT8 nValue) -{ - if (offset & 1) { - YMZ280BWriteRegister(nValue); - } else { - nYMZ280BRegister = nValue; - } -} - -inline static UINT32 YMZ280BRead(INT32 offset) -{ - if (offset & 1) { - return YMZ280BReadStatus(); - } else { - return YMZ280BReadRAM(); - } - - return 0; -} - -#define BURN_SND_YMZ280B_YMZ280B_ROUTE_1 0 -#define BURN_SND_YMZ280B_YMZ280B_ROUTE_2 1 - -#define YMZ280BSetAllRoutes(v, d) \ - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, v, d); \ - YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, v, d); diff --git a/jan/src/burn/state.h b/jan/src/burn/state.h deleted file mode 100644 index c6cca3e48..000000000 --- a/jan/src/burn/state.h +++ /dev/null @@ -1,78 +0,0 @@ -#if !defined(_STATE_H) - -#ifdef __cplusplus - extern "C" { -#endif - -#if !defined(__cplusplus) && defined(_XBOX) -#define C_INLINE _inline -#else -#ifndef C_INLINE -#define C_INLINE inline -#endif -#endif - -/* Scan driver data */ -INT32 BurnAreaScan(INT32 nAction, INT32* pnMin); - -/* flags to use for nAction */ -#define ACB_READ ( 1) -#define ACB_WRITE ( 2) - -#define ACB_MEMORY_ROM ( 4) -#define ACB_NVRAM ( 8) -#define ACB_MEMCARD (16) -#define ACB_MEMORY_RAM (32) -#define ACB_DRIVER_DATA (64) - -#define ACB_FULLSCAN (ACB_NVRAM | ACB_MEMCARD | ACB_MEMORY_RAM | ACB_DRIVER_DATA) - -#define ACB_ACCESSMASK (ACB_READ | ACB_WRITE) -#define ACB_TYPEMASK (ACB_MEMORY_ROM | ACB_NVRAM | ACB_MEMCARD | ACB_MEMORY_RAM | ACB_DRIVER_DATA) - -#define ACB_VOLATILE (ACB_MEMORY_RAM | ACB_DRIVER_DATA) - -/* Structure used for area scanning */ -struct BurnArea { void *Data; UINT32 nLen; INT32 nAddress; char *szName; }; - -/* Application-defined callback for processing the area */ -extern INT32 (__cdecl *BurnAcb) (struct BurnArea* pba); - -/* Scan a small variable or structure */ -C_INLINE static void ScanVar(void* pv, INT32 nSize, char* szName) -{ - struct BurnArea ba; - memset(&ba, 0, sizeof(ba)); - ba.Data = pv; - ba.nLen = nSize; - ba.szName = szName; - BurnAcb(&ba); -} - -#define SCAN_VAR(x) ScanVar(&x, sizeof(x), #x) - -#define SCAN_OFF(x, y, a) { INT32 n = x - y; ScanVar(&n, sizeof(n), #x); if (a & ACB_WRITE) { x = y + n; } } - -#ifdef OSD_CPU_H - /* wrappers for the MAME savestate functions (used by the FM sound cores) */ - void state_save_register_func_postload(void (*pFunction)()); - - void state_save_register_INT8(const char* module, INT32 instance, const char* name, INT8* val, unsigned size); - void state_save_register_UINT8(const char* module, INT32 instance, const char* name, UINT8* val, unsigned size); - void state_save_register_INT16(const char* module, INT32 instance, const char* name, INT16* val, unsigned size); - void state_save_register_UINT16(const char* module, INT32 instance, const char* name, UINT16* val, unsigned size); - void state_save_register_INT32(const char* module, INT32 instance, const char* name, INT32* val, unsigned size); - void state_save_register_UINT32(const char* module, INT32 instance, const char* name, UINT32* val, unsigned size); - - void state_save_register_int(const char* module, INT32 instance, const char* name, INT32* val); - void state_save_register_float(const char* module, INT32 instance, const char* name, float* val, unsigned size); - void state_save_register_double(const char* module, INT32 instance, const char* name, double* val, unsigned size); -#endif - -#ifdef __cplusplus - } -#endif - -#define _STATE_H - -#endif /* _STATE_H */ diff --git a/jan/src/burn/stdfunc.h b/jan/src/burn/stdfunc.h deleted file mode 100644 index 68ecdae54..000000000 --- a/jan/src/burn/stdfunc.h +++ /dev/null @@ -1,148 +0,0 @@ -// Standard ROM/input/DIP info functions - -// A function to pick a rom, or return NULL if i is out of range -#define STD_ROM_PICK(Name) \ -static struct BurnRomInfo* Name##PickRom(UINT32 i) \ -{ \ - if (i >= sizeof(Name##RomDesc) / sizeof(Name##RomDesc[0])) { \ - return NULL; \ - } \ - return Name##RomDesc + i; \ -} - -#define STDROMPICKEXT(Name, Info1, Info2) \ -static struct BurnRomInfo* Name##PickRom(UINT32 i) \ -{ \ - if (i >= 0x80) { \ - i &= 0x7F; \ - if (i >= sizeof(Info2##RomDesc) / sizeof(Info2##RomDesc[0])) { \ - return NULL; \ - } \ - return Info2##RomDesc + i; \ - } else { \ - if (i >= sizeof(Info1##RomDesc) / sizeof(Info1##RomDesc[0])) { \ - return emptyRomDesc + 0; \ - } \ - return Info1##RomDesc + i; \ - } \ -} - -// Standard rom functions for returning Length, Crc, Type and one one Name -#define STD_ROM_FN(Name) \ -static INT32 Name##RomInfo(struct BurnRomInfo* pri, UINT32 i) \ -{ \ - struct BurnRomInfo* por = Name##PickRom(i); \ - if (por == NULL) { \ - return 1; \ - } \ - if (pri) { \ - pri->nLen = por->nLen; \ - pri->nCrc = por->nCrc; \ - pri->nType = por->nType; \ - } \ - return 0; \ -} \ - \ -static INT32 Name##RomName(char** pszName, UINT32 i, INT32 nAka) \ -{ \ - struct BurnRomInfo *por = Name##PickRom(i); \ - if (por == NULL) { \ - return 1; \ - } \ - if (nAka) { \ - return 1; \ - } \ - *pszName = por->szName; \ - return 0; \ -} - -#define STDINPUTINFO(Name) \ -static INT32 Name##InputInfo(struct BurnInputInfo* pii, UINT32 i) \ -{ \ - if (i >= sizeof(Name##InputList) / sizeof(Name##InputList[0])) { \ - return 1; \ - } \ - if (pii) { \ - *pii = Name##InputList[i]; \ - } \ - return 0; \ -} - -#define STDINPUTINFOSPEC(Name, Info1) \ -static INT32 Name##InputInfo(struct BurnInputInfo* pii, UINT32 i) \ -{ \ - if (i >= sizeof(Info1) / sizeof(Info1[0])) { \ - return 1; \ - } \ - if (pii) { \ - *pii = Info1[i]; \ - } \ - return 0; \ -} - -#define STDDIPINFO(Name) \ -static INT32 Name##DIPInfo(struct BurnDIPInfo* pdi, UINT32 i) \ -{ \ - if (i >= sizeof(Name##DIPList) / sizeof(Name##DIPList[0])) { \ - return 1; \ - } \ - if (pdi) { \ - *pdi = Name##DIPList[i]; \ - } \ - return 0; \ -} - -#define STDDIPINFOEXT(Name, Info1, Info2) \ -static INT32 Name##DIPInfo(struct BurnDIPInfo* pdi, UINT32 i) \ -{ \ - if (i >= sizeof(Info1##DIPList) / sizeof(Info1##DIPList[0])) { \ - i -= sizeof(Info1##DIPList) / sizeof(Info1##DIPList[0]); \ - if (i >= sizeof(Info2##DIPList) / sizeof(Info2##DIPList[0])) { \ - return 1; \ - } \ - if (pdi) { \ - *pdi = Info2##DIPList[i]; \ - } \ - return 0; \ - } \ - if (pdi) { \ - *pdi = Info1##DIPList[i]; \ - } \ - return 0; \ -} - -// sample support -#define STD_SAMPLE_PICK(Name) \ -static struct BurnSampleInfo* Name##PickSample(UINT32 i) \ -{ \ - if (i >= sizeof(Name##SampleDesc) / sizeof(Name##SampleDesc[0])) { \ - return NULL; \ - } \ - return Name##SampleDesc + i; \ -} - -#define STD_SAMPLE_FN(Name) \ -static INT32 Name##SampleInfo(struct BurnSampleInfo* pri, UINT32 i) \ -{ \ - struct BurnSampleInfo* por = Name##PickSample(i); \ - if (por == NULL) { \ - return 1; \ - } \ - if (pri) { \ - pri->nFlags = por->nFlags; \ - } \ - return 0; \ -} \ - \ -static INT32 Name##SampleName(char** pszName, UINT32 i, INT32 nAka) \ -{ \ - struct BurnSampleInfo *por = Name##PickSample(i); \ - if (por == NULL) { \ - return 1; \ - } \ - if (nAka) { \ - return 1; \ - } \ - *pszName = por->szName; \ - return 0; \ -} diff --git a/jan/src/burn/tilemap_generic.cpp b/jan/src/burn/tilemap_generic.cpp deleted file mode 100644 index 4efd1b5fe..000000000 --- a/jan/src/burn/tilemap_generic.cpp +++ /dev/null @@ -1,1025 +0,0 @@ -#include "tiles_generic.h" - -#define MAX_TILEMAPS 32 // number of tile maps allowed -#define MAX_GFX 32 // number of graphics data regions allowed - -struct GenericTilemap { - UINT8 initialized; - INT32 (*pScan)(INT32 col, INT32 row); - void (*pTile)(INT32 offs, INT32 *tile_gfx, INT32 *tile_code, INT32 *tile_color, UINT32 *tile_flags); - UINT8 enable; - UINT32 mwidth; - UINT32 mheight; - UINT32 twidth; - UINT32 theight; - UINT32 scroll_cols; // sy - UINT32 scroll_rows; // sx - INT32 scrollx; - INT32 scrolly; - INT32 *scrollx_table; - INT32 *scrolly_table; - INT32 priority; - INT32 xoffset; - INT32 yoffset; - UINT32 flags; - UINT8 transparent[256]; // 0 draw, 1 skip - INT32 transcolor; -}; - -struct GenericTilemapGfx { - UINT8 *gfxbase; // pointer to graphics data - INT32 depth; // bits per pixel - INT32 width; // tile width - INT32 height; // tile height - UINT32 gfx_len; // full size of the tile data - UINT32 code_mask; // gfx_len / width / height - UINT32 color_offset; // is there a color offset for this graphics region? - UINT32 color_mask; // mask the color added to the pixels -}; - -static GenericTilemap maps[MAX_TILEMAPS]; -static GenericTilemapGfx gfxdata[MAX_TILEMAPS]; -static GenericTilemap *cur_map; - -void GenericTilemapInit(INT32 which, INT32 (*pScan)(INT32 col, INT32 row), void (*pTile)(INT32 offs, INT32 *tile_gfx, INT32 *tile_code, INT32 *tile_color, UINT32 *tile_flags), UINT32 tile_width, UINT32 tile_height, UINT32 map_width, UINT32 map_height) -{ - if (Debug_GenericTilesInitted == 0) { - bprintf (0, _T("Please call GenericTilesInit() before GenericTilemapInit()!\n")); - return; - } - - cur_map = &maps[which]; - - memset (cur_map, 0, sizeof(GenericTilemap)); - - cur_map->initialized = 1; - - // error - if (pTile == NULL) { - bprintf (0, _T("GenericTilemapInit %d pTile initializer cannot be NULL!\n"), which); - return; - } - - // error - if (pScan == NULL) { - bprintf (0, _T("GenericTilemapInit %d pScan initializer cannot be NULL!\n"), which); - return; - } - - // error - if (map_width == 0 || map_height == 0 || tile_width == 0 || tile_height == 0) { - bprintf (0, _T("GenericTilemapInit(%d, pScan, pTile, %d, %d, %d, %d) called with bad initializer!\n"), which, tile_width, tile_height, map_width, map_height); - return; - } - - // warning - if (map_width > 2048 || map_height > 2048 || tile_width > 512 || tile_height > 512) { - bprintf (0, _T("GenericTilemapInit(%d, pScan, pTile, %d, %d, %d, %d) called with likely bad initializer!\n"), which, tile_width, tile_height, map_width, map_height); - } - - cur_map->pTile = pTile; - cur_map->pScan = pScan; - - cur_map->enable = 1; - - cur_map->mwidth = map_width; - cur_map->mheight = map_height; - cur_map->twidth = tile_width; - cur_map->theight = tile_height; - - cur_map->scroll_cols = 1; - cur_map->scroll_rows = 1; - cur_map->scrollx = 0; - cur_map->scrolly = 0; - cur_map->scrollx_table = NULL; - cur_map->scrolly_table = NULL; - - cur_map->xoffset = 0; - cur_map->yoffset = 0; - - cur_map->priority = -1; - cur_map->flags = 0; - memset (cur_map->transparent, 0, 256); - cur_map->transcolor = 0xfff; // opaque by default -} - -void GenericTilemapSetGfx(INT32 num, UINT8 *gfxbase, INT32 depth, INT32 tile_width, INT32 tile_height, INT32 gfxlen, UINT32 color_offset, UINT32 color_mask) -{ - if (Debug_GenericTilesInitted == 0) { - bprintf (0, _T("GenericTilesInit must be called before GenericTilemapSetGfx!\n")); - return; - } - - // warning - if (depth > 8 || tile_width > 512 || tile_height > 512 || gfxlen <= 0 || gfxlen > 0x10000000 || color_offset > 0x10000) { - bprintf (0, _T("GenericTilemapSetGfx(%d, gfxbase, %d, %d, %d, 0x%x, 0x%x, 0x%s) called with likely bad initializer(s)!\n"), num, depth, tile_width, tile_height, gfxlen, color_offset, color_mask); - } - - // error - if (num < 0 || num >= MAX_GFX || tile_width <= 0 || tile_height <= 0 || gfxlen <= 0 || gfxbase == NULL) { - bprintf (0, _T("GenericTilemapSetGfx(%d, gfxbase (%s), %d, %d, %d, 0x%x, 0x%x, 0x%s) called with bad initializer(s)!\n"), num, (gfxbase == NULL) ? _T("NULL") : _T("NON-NULL"), depth, tile_width, tile_height, gfxlen, color_offset, color_mask); - return; - } - - GenericTilemapGfx *ptr = &gfxdata[num]; - - ptr->gfxbase = gfxbase; - ptr->depth = depth; - ptr->width = tile_width; - ptr->height = tile_height; - ptr->gfx_len = gfxlen; - - ptr->color_offset = color_offset; - ptr->color_mask = color_mask; - -#if 0 - UINT32 t = gfxlen / (tile_width * tile_height); - - // create a mask for the tile number (prevent crashes) - for (UINT32 i = 1; i < (UINT32)(1 << 31); i <<= 1) { - if (i >= t) { - ptr->code_mask = i - 1; - break; - } - } -#else - // we're using much safer modulos for limiting the tile number - ptr->code_mask = gfxlen / (tile_width * tile_height); -#endif -} - -void GenericTilemapExit() -{ - // de-allocate any row/col scroll tables - for (INT32 i = 0; i < MAX_TILEMAPS; i++) { - cur_map = &maps[i]; - if (cur_map->scrolly_table) BurnFree(cur_map->scrolly_table); - if (cur_map->scrollx_table) BurnFree(cur_map->scrollx_table); - } - - // wipe everything else out - memset (maps, 0, sizeof(maps)); - memset (gfxdata, 0, sizeof(gfxdata)); -} - -void GenericTilemapSetOffsets(INT32 which, INT32 x, INT32 y) -{ - if (which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetOffsets(%d, %d, %d); called with impossible tilemap!\n"), which, x, y); - return; - } - - // set offsets globally - if (which == TMAP_GLOBAL) - { - INT32 counter = 0; - - for (INT32 i = 0; i < MAX_TILEMAPS; i++) { - cur_map = &maps[i]; - if (cur_map->initialized) { - cur_map->xoffset = x; - cur_map->yoffset = y; - - counter++; - } - } - - if (counter == 0) { - bprintf (0, _T("GenericTilemapSetOffsets(TMAP_GLOBAL, %d, %d); called, but there are no initialized tilemaps!\n"), x, y); - } - - return; - } - - // set offsets to a single tile map - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetOffsets(%d, %d, %d); called without initialized tilemap!\n"), which, x, y); - return; - } - - cur_map->xoffset = x; - cur_map->yoffset = y; -} - -void GenericTilemapSetTransparent(INT32 which, UINT32 transparent) -{ - if (which < 0 || which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetTransparent(%d, 0x%x); called with impossible tilemap number!\n"), which, transparent); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetTransparent(%d, 0x%x); called without initialized tilemap!\n"), which, transparent); - return; - } - - memset (cur_map->transparent, 0, 256); // set all to opaque - - cur_map->transparent[transparent] = 1; // one color opaque - - cur_map->transcolor = transparent; // pass this to generic tile drawing - cur_map->flags |= TMAP_TRANSPARENT; -} - -void GenericTilemapSetTransMask(INT32 which, UINT16 transmask) -{ - if (which < 0 || which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetTransMask(%d, 0x%4.4x); called with impossible tilemap number!\n"), which, transmask); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapsSetTransMask(%d, 0x%4.4x); called without initialized tilemap!\n"), which, transmask); - return; - } - - memset (cur_map->transparent, 1, 256); - - for (INT32 i = 0; i < 16; i++) { - if ((transmask & (1 << i)) == 0) { - cur_map->transparent[i] = 0; - } - } - - cur_map->flags |= TMAP_TRANSMASK; -} - -void GenericTilemapSetTransTable(INT32 which, INT32 color, INT32 transparent) -{ - if (which < 0 || which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetTransTable(%d, %d, %d); called with impossible tilemap number!\n"), which, color, transparent); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetTransTable(%d, %d, %d); called without initialized tilemap!\n"), which, color, transparent); - return; - } - - if (color < 0 || color >= 256) { - bprintf (0, _T("GenericTilemapSetTransTable(%d, %d, %d); called with color entry outside of bounds (0-255)!\n"), which, color, transparent); - return; - } - - cur_map->transparent[color] = (transparent) ? 1 : 0; - cur_map->flags |= TMAP_TRANSMASK; -} - -void GenericTilemapSetScrollX(INT32 which, INT32 scrollx) -{ - if (which < 0 || which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetScrollX(%d, %d); called with impossible tilemap!\n"), which, scrollx); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetScrollX(%d, %d); called without initialized tilemap!\n"), which, scrollx); - return; - } - - cur_map->scrollx = scrollx % (cur_map->twidth * cur_map->mwidth); -} - -void GenericTilemapSetScrollY(INT32 which, INT32 scrolly) -{ - if (which < 0 || which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetScrollY(%d, %d); called with impossible tilemap!\n"), which, scrolly); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetScrollY(%d, %d); called without initialized tilemap!\n"), which, scrolly); - return; - } - - cur_map->scrolly = scrolly % (cur_map->theight * cur_map->mheight); -} - -void GenericTilemapSetScrollCols(INT32 which, UINT32 cols) -{ - if (which < 0 || which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetScrollCols(%d, %d); called with impossible tilemap!\n"), which, cols); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetScrollCols(%d, %d); called without initialized tilemap!\n"), which, cols); - return; - } - - if (cols > (cur_map->mwidth * cur_map->twidth)) { - bprintf (0, _T("GenericTilemapSetScrollCols(%d, %d); called with more cols than tilemap is wide (%d)!\n"), which, cols, cur_map->mwidth*cur_map->twidth); - return; - } - - // use scrolly instead - if (cols <= 0) cols = 1; - if (cols == 1) { - cur_map->scroll_rows = cols; - if (cur_map->scrolly_table) { - BurnFree(cur_map->scrolly_table); - } - return; - } - - if (cur_map->scroll_cols != cols) - { - cur_map->scroll_cols = cols; - - if (cur_map->scrolly_table) { - BurnFree(cur_map->scrolly_table); - } - - cur_map->scrolly_table = (INT32*)BurnMalloc(cols * sizeof(INT32)); - - memset (cur_map->scrolly_table, 0, cols * sizeof(INT32)); - - if (cols > cur_map->mwidth) { - bprintf (0, _T("GenericTilemapSetScrollCols(%d, %d) line scroll not supported at this time (cols).\n"), which, cols); - } - } -} - -void GenericTilemapSetScrollRows(INT32 which, UINT32 rows) -{ - if (which < 0 || which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetScrollRows(%d, %d); called with impossible tilemap!\n"), which, rows); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetScrollRows(%d, %d); called without initialized tilemap!\n"), which, rows); - return; - } - - if (rows > (cur_map->mheight * cur_map->theight)) { - bprintf (0, _T("GenericTilemapSetScrollRows(%d, %d); called with more rows than tilemap is high (%d)!\n"), which, rows, cur_map->mheight*cur_map->theight); - return; - } - - // use scrollx instead - if (rows <= 0) rows = 1; - if (rows == 1) { - cur_map->scroll_rows = rows; - if (cur_map->scrollx_table) { - BurnFree(cur_map->scrollx_table); - } - return; - } - - if (cur_map->scroll_rows != rows) - { - cur_map->scroll_rows = rows; - - if (cur_map->scrollx_table) { - BurnFree(cur_map->scrollx_table); - } - - cur_map->scrollx_table = (INT32*)BurnMalloc(rows * sizeof(INT32)); - - memset (cur_map->scrollx_table, 0, rows * sizeof(INT32)); - } -} - -void GenericTilemapSetScrollCol(INT32 which, INT32 col, INT32 scroll) -{ - if (which < 0 || which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetScrollCol(%d, %d, %d); called with impossible tilemap!\n"), which, col, scroll); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetScrollCol(%d, %d, %d); called without initialized tilemap!\n"), which, col, scroll); - return; - } - - if ((INT32)cur_map->scroll_cols <= col || col < 0) { - bprintf (0, _T("GenericTilemapSetScrollCol(%d, %d, %d); called with improper col value!\n"), which, col, scroll); - return; - } - - if (cur_map->scrolly_table != NULL) { - cur_map->scrolly_table[col] = scroll % (cur_map->theight * cur_map->mheight); - } -} - -void GenericTilemapSetScrollRow(INT32 which, INT32 row, INT32 scroll) -{ - if (which < 0 || which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetScrollRow(%d, %d, %d); called with impossible tilemap!\n"), which, row, scroll); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetScrollRow(%d, %d, %d); called without initialized tilemap!\n"), which, row, scroll); - return; - } - - if ((INT32)cur_map->scroll_rows <= row || row < 0) { - bprintf (0, _T("GenericTilemapSetScrollRow(%d, %d, %d); called with improper row value!\n"), which, row, scroll); - return; - } - - if (cur_map->scrollx_table != NULL) { - cur_map->scrollx_table[row] = scroll % (cur_map->twidth * cur_map->mwidth); - } -} - -void GenericTilemapSetFlip(INT32 which, INT32 flip) -{ - if (which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetFlip(%d, %d); called with impossible tilemap!\n"), which, flip); - return; - } - - if (which == TMAP_GLOBAL) { - INT32 counter = 0; - for (INT32 i = 0; i < MAX_TILEMAPS; i++) { - cur_map = &maps[i]; - if (cur_map->initialized) { - cur_map->flags &= ~(TMAP_FLIPY|TMAP_FLIPX); - cur_map->flags |= flip; - - counter++; - } - } - - if (counter == 0) { - bprintf (0, _T("GenericTilemapSetFlip(TMAP_GLOBAL, %d); called, but there are no initialized tilemaps!\n"), flip); - } - - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetFlip(%d, %d); called without initialized tilemap!\n"), which, flip); - return; - } - - cur_map->flags &= ~(TMAP_FLIPY|TMAP_FLIPX); - cur_map->flags |= flip; -} - -void GenericTilemapSetEnable(INT32 which, INT32 enable) -{ - if (which >= MAX_TILEMAPS) { - bprintf (0, _T("GenericTilemapSetEnable(%d, %d); called with impossible tilemap!\n"), which, enable); - return; - } - - if (which == TMAP_GLOBAL) { - INT32 counter = 0; - for (INT32 i = 0; i < MAX_TILEMAPS; i++) { - cur_map = &maps[i]; - if (cur_map->initialized) { - cur_map->enable = enable ? 1 : 0; - counter++; - } - } - - if (counter == 0) { - bprintf (0, _T("GenericTilemapSetEnable(TMAP_GLOBAL, %d); called, but there are no initialized tilemaps!\n"), enable); - } - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapSetEnable(%d, %d); called without initialized tilemap!\n"), which, enable); - return; - } - - cur_map->enable = enable ? 1 : 0; -} - -void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority) -{ - if (Bitmap == NULL) { - bprintf (0, _T("GenericTilemapDraw(%d, Bitmap, %d); called without initialized Bitmap!\n"), which, priority); - return; - } - - cur_map = &maps[which]; - - if (cur_map->initialized == 0) { - bprintf (0, _T("GenericTilemapDraw(%d, Bitmap, %d); called without initialized tilemap!\n"), which, priority); - return; - } - - if (cur_map->enable == 0) { // layer disabled! - return; - } - - INT32 minx, maxx, miny, maxy; - GenericTilesGetClip(&minx, &maxx, &miny, &maxy); - - // check clipping and fix clipping sizes if out of bounds - if (minx < 0 || maxx > nScreenWidth || miny < 0 || maxy > nScreenHeight) { - bprintf (0, _T("GenericTilemapDraw(%d, Bitmap, %d) called with improper clipping values (%d, %d, %d, %d)!"), which, priority, minx, maxx, miny, maxy); - bprintf (0, _T("pPrioDraw is %d pixels wide and %d pixels high!\n"), nScreenWidth, nScreenHeight); - - if (minx < 0) minx = 0; - if (maxx >= nScreenWidth) maxx = nScreenWidth; - if (miny < 0) miny = 0; - if (maxy >= nScreenHeight) maxy = nScreenHeight; - } - - INT32 opaque = priority & TMAP_FORCEOPAQUE; - - INT32 tgroup = (priority >> 8) & 0xff; - priority &= 0xff; - - // line / column scroll - if ((cur_map->scrollx_table != NULL) && (cur_map->scroll_rows > cur_map->mheight)) - { - INT32 bitmap_width = maxx - minx; - UINT16 *dest = Bitmap; - UINT8 *prio = pPrioDraw; - - for (INT32 y = miny; y < maxy; y++, prio += bitmap_width) // line by line - { - INT32 scrolly = (cur_map->scrolly + y + cur_map->yoffset) % (cur_map->mheight * cur_map->theight); - - INT32 scrollx = cur_map->scrollx_table[(scrolly * cur_map->scroll_rows) / (cur_map->mheight * cur_map->theight)] - cur_map->xoffset; - - scrollx %= (cur_map->twidth * cur_map->mwidth); - - INT32 row = scrolly / cur_map->theight; - - INT32 scry = scrolly % (cur_map->theight); - INT32 scrx = scrollx % (cur_map->twidth); - - INT32 sy = y; - if (cur_map->flags & TMAP_FLIPY) { - sy = ((maxy - miny) - cur_map->theight) - sy; - } - - dest = Bitmap + sy * nScreenWidth; - prio = pPrioDraw + sy * nScreenWidth; - - for (UINT32 x = 0; x < bitmap_width + cur_map->twidth; x+=cur_map->twidth) - { - INT32 sx = x; - INT32 col = ((x + scrollx) % (cur_map->mwidth * cur_map->twidth)) / cur_map->twidth; - - INT32 code = 0, color = 0, group = 0, gfxnum = 0; - UINT32 flags = 0; - - cur_map->pTile(cur_map->pScan(col,row), &gfxnum, &code, &color, &flags); - - if (flags & TILE_SKIP) continue; // skip this tile - - if (flags & TILE_GROUP_ENABLE) { - group = (flags >> 16) & 0xff; - - if (group != tgroup) { - continue; - } - } - - GenericTilemapGfx *gfx = &gfxdata[gfxnum]; - - if (gfx->gfxbase == NULL) { - bprintf (0,_T("GenericTilemapDraw(%d) gfx[%d] not initialized!\n"), which, gfxnum); - continue; - } - - color = ((color & gfx->color_mask) << gfx->depth) + gfx->color_offset; - code %= gfx->code_mask; - - INT32 flipx = flags & TILE_FLIPX; - INT32 flipy = flags & TILE_FLIPY; - - if (cur_map->flags & TMAP_FLIPY) { - flipy ^= TILE_FLIPY; - } - - INT32 scy; - if (flipy) - scy = (cur_map->theight - 1) - scry; - else - scy = scry; - - if (cur_map->flags & TMAP_FLIPX) { - sx = ((maxx - minx) - cur_map->twidth) - sx; - scrx = ((cur_map->twidth) - 1) - scrx; - flipx ^= TILE_FLIPX; - } - - UINT8 *gfxsrc = gfx->gfxbase + (code * cur_map->twidth * cur_map->theight) + (scy * cur_map->twidth); - - if (flipx) - { - INT32 flip_wide = cur_map->twidth - 1; - - for (UINT32 dx = 0; dx < cur_map->twidth; dx++) - { - INT32 dst = (sx + dx) - scrx; - if (dst < minx || dst >= maxx) continue; - - if (cur_map->transparent[gfxsrc[flip_wide - dx]] == 0) { - dest[dst] = color + gfxsrc[flip_wide - dx]; - prio[dst] = priority; - } - } - } - else - { - for (UINT32 dx = 0; dx < cur_map->twidth; dx++) - { - INT32 dst = (sx + dx) - scrx; - if (dst < minx || dst >= maxx) continue; - - if (cur_map->transparent[gfxsrc[dx]] == 0) { - dest[dst] = color + gfxsrc[dx]; - prio[dst] = priority; - } - } - } - } - } - - return; - } - // scrollx and scrolly - else if (cur_map->scroll_rows <= 1 && cur_map->scroll_cols <= 1) // one scroll row and column. Fast! - { - INT32 syshift = ((cur_map->scrolly - cur_map->yoffset) % cur_map->theight); - INT32 scrolly = ((cur_map->scrolly - cur_map->yoffset) / cur_map->theight) * cur_map->theight; - - INT32 sxshift = ((cur_map->scrollx - cur_map->xoffset) % cur_map->twidth); - INT32 scrollx = ((cur_map->scrollx - cur_map->xoffset) / cur_map->twidth) * cur_map->twidth; - - for (INT32 y = miny; y < (INT32)(maxy + cur_map->theight); y += cur_map->theight) - { - INT32 syy = (y + scrolly) % (cur_map->theight * cur_map->mheight); - - for (INT32 x = minx; x < (INT32)(maxx + cur_map->twidth); x += cur_map->twidth) - { - INT32 sxx = (x + scrollx) % (cur_map->twidth * cur_map->mwidth); - - INT32 code = 0, color = 0, group = 0, gfxnum = 0; - UINT32 flags = 0; - - cur_map->pTile(cur_map->pScan(sxx/cur_map->twidth,syy/cur_map->theight), &gfxnum, &code, &color, &flags); - - if (flags & TILE_SKIP) continue; // skip this tile - - if (flags & TILE_GROUP_ENABLE) { - group = (flags >> 16) & 0xff; - - if (group != tgroup) { - continue; - } - } - - GenericTilemapGfx *gfx = &gfxdata[gfxnum]; - - if (gfx->gfxbase == NULL) { - bprintf (0,_T("GenericTilemapDraw(%d) gfx[%d] not initialized!\n"), which, gfxnum); - continue; - } - - color &= gfx->color_mask; - code %= gfx->code_mask; - - INT32 sy = y - syshift; - INT32 sx = x - sxshift; - - INT32 flipx = flags & TILE_FLIPX; - INT32 flipy = flags & TILE_FLIPY; - - if (cur_map->flags & TMAP_FLIPY) { - sy = ((maxy - miny) - cur_map->theight) - sy; - flipy ^= TILE_FLIPY; - } - - if (cur_map->flags & TMAP_FLIPX) { - sx = ((maxx - minx) - cur_map->twidth) - sx; - flipx ^= TILE_FLIPX; - } - - // skip tiles that are out of the visible area - if ((sx >= maxx) || (sy >= maxy) || (sx < (INT32)(minx - (cur_map->twidth - 1))) || (sy < (INT32)(miny - (cur_map->theight - 1)))) { - continue; - } - - if (sx < minx || sy < miny || sx >= (INT32)(maxx - cur_map->twidth - 1) || sy >= (INT32)(maxy - cur_map->theight - 1)) - { - if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0) - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_Mask_FlipXY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Mask_FlipY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_Mask_FlipX_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Mask_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0) - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_TransMask_FlipXY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_TransMask_FlipY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_TransMask_FlipX_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_TransMask_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - else - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_FlipXY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_FlipY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_FlipX_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - } - else - { - if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0) - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_Mask_FlipXY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Mask_FlipY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_Mask_FlipX(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Mask(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0) - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_TransMask_FlipXY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_TransMask_FlipY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_TransMask_FlipX(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_TransMask(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - else - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_FlipXY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_FlipY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_FlipX(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - } - } - } - - return; - } - - // column / row scroll (greater >= tile size) - for (UINT32 offs = 0; offs < (cur_map->mwidth * cur_map->mheight); offs++) - { - INT32 col = offs % cur_map->mwidth; //x - INT32 row = offs / cur_map->mwidth; //y - - INT32 code = 0, color = 0, group = 0, gfxnum = 0; - UINT32 flags = 0; - - cur_map->pTile(cur_map->pScan(col,row), &gfxnum, &code, &color, &flags); - - if (flags & TILE_SKIP) continue; // skip this tile - - if (flags & TILE_GROUP_ENABLE) { - group = (flags >> 16) & 0xff; - - if (group != tgroup) { - continue; - } - } - - GenericTilemapGfx *gfx = &gfxdata[gfxnum]; - - if (gfx->gfxbase == NULL) { - bprintf (0,_T("GenericTilemapDraw(%d) gfx[%d] not initialized!\n"), which, gfxnum); - continue; - } - - color &= gfx->color_mask; - code %= gfx->code_mask; - - INT32 sx = col * cur_map->twidth; - INT32 sy = row * cur_map->theight; - - if (cur_map->scroll_rows <= 1) { - sx -= cur_map->scrollx; - } else { - INT32 r = (row * cur_map->scroll_rows) / cur_map->mheight; - sx -= (cur_map->scrollx + cur_map->scrollx_table[r]) % (cur_map->twidth * cur_map->mwidth); - } - - if (cur_map->scroll_cols <= 1) { - sy -= cur_map->scrolly; - } else { - INT32 r = (col * cur_map->scroll_cols) / cur_map->mwidth; - sy -= (cur_map->scrolly + cur_map->scrolly_table[r]) % (cur_map->theight * cur_map->mheight); - } - - sx += cur_map->xoffset; - sy += cur_map->yoffset; - - if (sx < (INT32)(1-cur_map->twidth)) sx += cur_map->twidth * cur_map->mwidth; - if (sy < (INT32)(1-cur_map->theight)) sy += cur_map->theight * cur_map->mheight; - - INT32 flipx = flags & TILE_FLIPX; - INT32 flipy = flags & TILE_FLIPY; - - if (cur_map->flags & TMAP_FLIPY) { - sy = ((maxy - miny) - cur_map->theight) - sy; - flipy ^= TILE_FLIPY; - } - - if (cur_map->flags & TMAP_FLIPX) { - sx = ((maxx - minx) - cur_map->twidth) - sx; - flipx ^= TILE_FLIPX; - } - - // skip tiles that are out of the visible area - if ((sx >= maxx) || (sy >= maxy) || (sx < (INT32)(minx - (cur_map->twidth - 1))) || (sy < (INT32)(miny - (cur_map->theight - 1)))) { - continue; - } - - if (sx < minx || sy < miny || sx >= (INT32)(maxx - cur_map->twidth - 1) || sy >= (INT32)(maxy - cur_map->theight - 1)) - { - if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0) - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_Mask_FlipXY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Mask_FlipY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_Mask_FlipX_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Mask_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0) - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_TransMask_FlipXY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_TransMask_FlipY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_TransMask_FlipX_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_TransMask_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - else - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_FlipXY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_FlipY_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_FlipX_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Clip(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - } - else - { - if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0) - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_Mask_FlipXY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Mask_FlipY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_Mask_FlipX(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_Mask(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transcolor, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0) - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_TransMask_FlipXY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_TransMask_FlipY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_TransMask_FlipX(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_TransMask(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, cur_map->transparent, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - else - { - if (flipy) { - if (flipx) { - RenderCustomTile_Prio_FlipXY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio_FlipY(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } - } else { - if (flipx) { - RenderCustomTile_Prio_FlipX(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } else { - RenderCustomTile_Prio(Bitmap, cur_map->twidth, cur_map->theight, code, sx, sy, color, gfx->depth, gfx->color_offset, priority, gfx->gfxbase); - } - } - } - } - } -} - -tilemap_scan( scan_rows ) -{ - return (cur_map->mwidth * row) + col; -} - -tilemap_scan( scan_cols ) -{ - return (cur_map->mheight * col) + row; -} - - diff --git a/jan/src/burn/tilemap_generic.h b/jan/src/burn/tilemap_generic.h deleted file mode 100644 index db3128570..000000000 --- a/jan/src/burn/tilemap_generic.h +++ /dev/null @@ -1,141 +0,0 @@ -// Tilemap defines - -// use this when in place of "which" to have this apply to all initialized tilemaps -// works for: GenericTilemapSetEnable, GenericTilemapSetFlip, GenericTilemapSetOffsets -#define TMAP_GLOBAL -1 - -// flip the tilemap on the screen horizontally (used with GenericTilemapSetFlip ) -#define TMAP_FLIPX (1 << 0) - -// flip the tilemap on the screen vertically (used with GenericTilemapSetFlip ) -#define TMAP_FLIPY (1 << 1) - -// flip the tilemap on the screen vertically and horizontally (used with GenericTilemapSetFlip ) -#define TMAP_FLIPXY (TMAP_FLIPX | TMAP_FLIPY) - -// force the tilemap to ignore any transparency settings -#define TMAP_FORCEOPAQUE (1 << 24) - -// set tilemap to use transparent color (is set when using GenericTilemapSetTransparent) -#define TMAP_TRANSPARENT (1 << 9) - -// set tilemap to use a transparency mask (is set when using GenericTilemapSetTransMask) -#define TMAP_TRANSMASK (1 << 10) - -// select which group to use in the tilemap (group is set in the tilemap_callback) -// pass this in the priority variable in GenericTilemapDraw. -#define TMAP_SET_GROUP(x) ((x) <<8) - -// Tile defines (used in tilemap_callback) - -// flip this tile horizontally -#define TILE_FLIPX TMAP_FLIPX - -// flip this tile vertically -#define TILE_FLIPY TMAP_FLIPY - -// ignore transparency for this tile only -#define TILE_OPAQUE (1 << 2) - -// skip drawing this tile (can be used for speedups) -#define TILE_SKIP (1 << 3) - -// enabled in TILE_GROUP to show that the group is enabled -#define TILE_GROUP_ENABLE (1 << 4) - -// set flipping (pass variable through these to set them as a pair) -#define TILE_FLIPXY(x) ((((x) & 2) >> 1) | (((x) & 1) << 1)) -#define TILE_FLIPYX(x) ((x) & 3) - -// set group, pass this as a flag -#define TILE_GROUP(x) (((x) << 16) | TILE_GROUP_ENABLE) - -// This are used to make sure the tilemap functions are given standard names -#define tilemap_callback( xname ) void xname##_map_callback(INT32 offs, INT32 *tile_gfx, INT32 *tile_code, INT32 *tile_color, UINT32 *tile_flags) -#define tilemap_scan( xname ) INT32 xname##_map_scan(INT32 col, INT32 row) - -// Pass the tilemap callback variables using this macro (looks nice) -#define TILE_SET_INFO(ttgfx, ttcode, ttcolor, ttflags) \ - *tile_gfx = (ttgfx); \ - *tile_code = (ttcode); \ - *tile_color = (ttcolor); \ - *tile_flags = (ttflags) - -// The tilemap scan calculates the offset of the current tile information in the video ram -// these are the two most common variations -extern tilemap_scan( scan_rows ); -extern tilemap_scan( scan_cols ); - -// Now give them nice names -#define TILEMAP_SCAN_ROWS scan_rows_map_scan -#define TILEMAP_SCAN_COLS scan_cols_map_scan - -// The actual initialization routine for the tilemap -// which - which actual tilemap do you want to set this as -// pScan - pointer to "scan" routine, described above... -// pTile - pointer to tile info callback -// tile_width - how many pixels wide are the tiles -// tile_height - how many pixels tall are the tiles -// map_width - how many tiles wide is the tile map -// map_height - how many tiles high is the tile map -void GenericTilemapInit(INT32 which, INT32 (*pScan)(INT32 col, INT32 row), void (*pTile)(INT32 offs, INT32 *tile_gfx, INT32 *tile_code, INT32 *tile_color, UINT32 *tile_flags), UINT32 tile_width, UINT32 tile_height, UINT32 map_width, UINT32 map_height); - -// SetGfx sets information on the tile data the tile map is drawing. -// This MUST be used in conjunction with GenericTilemapInit -// num - which graphics data to set as -// gfxbase - pointer to tile data -// depth - how many bits per pixel -// tile_width - how many pixels wide is the tile -// tile_high - how many pixels high is the tile -// gfxlen - how many pixels bytes total are there in the tile data (this is used to ensure we don't go outside the maximum) -// color_offset - this is where the color for this tilemap starts -// color_mask - how many colors can the tilemap use for *color (called in pScan) -void GenericTilemapSetGfx(INT32 num, UINT8 *gfxbase, INT32 depth, INT32 tile_width, INT32 tile_height, INT32 gfxlen, UINT32 color_offset, UINT32 color_mask); - -// Exit tilemap (called in tiles_generic) -void GenericTilemapExit(); - -// Set a single transparent color 0 - 255 -void GenericTilemapSetTransparent(INT32 which, UINT32 transparent); - -// Set a mask for transparent colors, only works with 4bpp or less tiles -void GenericTilemapSetTransMask(INT32 which, UINT16 transmask); - -// Set entry (color) in transparency table (1 if transparent, 0 if opaque) -// works for depths from 1bpp (2 entries) to 8bpp (256 entries) -void GenericTilemapSetTransTable(INT32 which, INT32 color, INT32 transparent); - -// Set scroll x (horizontal) for the tilemap -void GenericTilemapSetScrollX(INT32 which, INT32 scrollx); - -// Set scroll y (vertical) for the tile map -void GenericTilemapSetScrollY(INT32 which, INT32 scrolly); - -// Set how many columns there are to scroll. Used in conjunction with TilemapSetScrollCol... -void GenericTilemapSetScrollCols(INT32 which, UINT32 cols); - -// Set how many rows there are to scroll. Used in conjunction with TilemapSetScrollRow... -void GenericTilemapSetScrollRows(INT32 which, UINT32 rows); - -// Set scroll value for individual row. Must set GenericTilemapSetScrollRows first! -void GenericTilemapSetScrollRow(INT32 which, INT32 row, INT32 scroll); - -// Set scroll value for individual column. Must set GenericTilemapSetScrollCols first! -void GenericTilemapSetScrollCol(INT32 which, INT32 col, INT32 scroll); - -// Set video offsets, this allows adjusting where the tilemap is displayed on the screen -// This is applied AFTER the scroll values -void GenericTilemapSetOffsets(INT32 which, INT32 x, INT32 y); - -// Used to flip the tilemap on the screen vertically or horizontally -// Very useful for *flipscreen -void GenericTilemapSetFlip(INT32 which, INT32 flip); - -// Disable (0) or enable (1) tile map (draw or don't draw) -void GenericTilemapSetEnable(INT32 which, INT32 enable); - -// Actually draw the tilemap. -// which - select which tilemap to draw -// Bitmap - pointer to the bitmap to draw the tilemap -// priority - this will be used to set priority data, group is data passed in this variable using TILE_GROUP(x) -void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority); diff --git a/jan/src/burn/tiles_generic.cpp b/jan/src/burn/tiles_generic.cpp deleted file mode 100644 index a9147bab1..000000000 --- a/jan/src/burn/tiles_generic.cpp +++ /dev/null @@ -1,4994 +0,0 @@ -/*================================================================================================ -Generic Tile Rendering Module - Uses the Colour-Depth Independent Image Transfer Method - -Supports 8 x 8, 16 x 16 and 32 x 32 with or without masking and with full flipping. The functions fully -support varying colour-depths and palette offsets as well as all the usual variables. - -Call GenericTilesInit() in the driver Init function to store the drivers screen size for clipping. -This function also calls BurnTransferInit(). - -Call GenericTilesExit() in the driver Exit function to clear the screen size variables. -Again, this function also calls BurnTransferExit(). - -Otherwise, use the Transfer code as usual. -================================================================================================*/ - -#include "tiles_generic.h" - -UINT8* pTileData; -INT32 nScreenWidth, nScreenHeight; -static INT32 nScreenWidthMax, nScreenHeightMax, nScreenWidthMin, nScreenHeightMin; - -INT32 GenericTilesInit() -{ - Debug_GenericTilesInitted = 1; - - INT32 nRet; - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nScreenHeight, &nScreenWidth); - } else { - BurnDrvGetVisibleSize(&nScreenWidth, &nScreenHeight); - } - - nScreenWidthMax = nScreenWidth; - nScreenHeightMax = nScreenHeight; - nScreenHeightMin = nScreenWidthMin = 0; - - nRet = BurnTransferInit(); - - GenericTilemapExit(); - - return nRet; -} - -INT32 GenericTilesExit() -{ - nScreenWidth = nScreenHeight = 0; - nScreenWidthMax = nScreenHeightMax = 0; - nScreenHeightMin = nScreenWidthMin = 0; - - BurnTransferExit(); - - Debug_GenericTilesInitted = 0; - - GenericTilemapExit(); - - return 0; -} - -void GenericTilesSetClip(INT32 nMinx, INT32 nMaxx, INT32 nMiny, INT32 nMaxy) -{ - if (nMinx > -1) nScreenWidthMin = nMinx; - if (nMaxx > -1) nScreenWidthMax = nMaxx; - if (nMiny > -1) nScreenHeightMin = nMiny; - if (nMaxy > -1) nScreenHeightMax = nMaxy; - - if (nMinx < 0) nMinx = 0; - if (nMiny < 0) nMiny = 0; - - if (nMaxx > nScreenWidth) nMaxx = nScreenWidth; - if (nMaxy > nScreenHeight) nMaxy = nScreenHeight; -} - -void GenericTilesGetClip(INT32 *nMinx, INT32 *nMaxx, INT32 *nMiny, INT32 *nMaxy) -{ - *nMinx = nScreenWidthMin; - *nMaxx = nScreenWidthMax; - *nMiny = nScreenHeightMin; - *nMaxy = nScreenHeightMax; -} - -void GenericTilesClearClip() -{ - nScreenWidthMin = 0; - nScreenWidthMax = nScreenWidth; - nScreenHeightMin = 0; - nScreenHeightMax = nScreenHeight; -} - -void GenericTilesSetClipRaw(INT32 nMinx, INT32 nMaxx, INT32 nMiny, INT32 nMaxy) -{ - nScreenWidthMin = nMinx; - nScreenWidthMax = nMaxx; - nScreenHeightMin = nMiny; - nScreenHeightMax = nMaxy; - - nScreenWidth = nMaxx; - nScreenHeight = nMaxy; -} - -void GenericTilesClearClipRaw() -{ - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nScreenHeight, &nScreenWidth); - } else { - BurnDrvGetVisibleSize(&nScreenWidth, &nScreenHeight); - } - - nScreenWidthMax = nScreenWidth; - nScreenHeightMax = nScreenHeight; - nScreenHeightMin = nScreenWidthMin = 0; -} - -void GenericTilesSetScanline(INT32 nScanline) -{ - if (nScanline < 0 || nScanline == nScreenHeight) { - return; - } - - nScreenHeightMin = nScanline; - nScreenHeightMax = nScanline + 1; -} - -// ---------------------------------------------------------------------------- -// Colour-depth independant image transfer - -UINT16* pTransDraw = NULL; -UINT8 *pPrioDraw = NULL; - -static INT32 nTransWidth, nTransHeight; - -void BurnTransferClear() -{ -#if defined FBA_DEBUG - if (!Debug_BurnTransferInitted) bprintf(PRINT_ERROR, _T("BurnTransferClear called without init\n")); -#endif - - memset((void*)pTransDraw, 0, nTransWidth * nTransHeight * sizeof(UINT16)); - - memset(pPrioDraw, 0, nTransWidth * nTransHeight); -} - -void BurnPrioClear() -{ -#if defined FBA_DEBUG - if (!Debug_BurnTransferInitted) bprintf(PRINT_ERROR, _T("BurnPrioClear called without init\n")); -#endif - - memset(pPrioDraw, 0, nTransWidth * nTransHeight); -} - -void BurnTransferClear(UINT16 nFillPattern) -{ -#if defined FBA_DEBUG - if (!Debug_BurnTransferInitted) bprintf(PRINT_ERROR, _T("BurnTransferClear called without init\n")); -#endif - - for (INT32 i = 0; i < nTransWidth * nTransHeight; i++) { - pTransDraw[i] = nFillPattern; - pPrioDraw[i] = 0; - } -} - -INT32 BurnTransferCopy(UINT32* pPalette) -{ -#if defined FBA_DEBUG - if (!Debug_BurnTransferInitted) bprintf(PRINT_ERROR, _T("BurnTransferCopy called without init\n")); -#endif - - UINT16* pSrc = pTransDraw; - UINT8* pDest = pBurnDraw; - - pBurnDrvPalette = pPalette; - - switch (nBurnBpp) { - case 2: { - for (INT32 y = 0; y < nTransHeight; y++, pSrc += nTransWidth, pDest += nBurnPitch) { - for (INT32 x = 0; x < nTransWidth; x ++) { - ((UINT16*)pDest)[x] = pPalette[pSrc[x]]; - } - } - break; - } - case 3: { - for (INT32 y = 0; y < nTransHeight; y++, pSrc += nTransWidth, pDest += nBurnPitch) { - for (INT32 x = 0; x < nTransWidth; x++) { - UINT32 c = pPalette[pSrc[x]]; - *(pDest + (x * 3) + 0) = c & 0xFF; - *(pDest + (x * 3) + 1) = (c >> 8) & 0xFF; - *(pDest + (x * 3) + 2) = c >> 16; - - } - } - break; - } - case 4: { - for (INT32 y = 0; y < nTransHeight; y++, pSrc += nTransWidth, pDest += nBurnPitch) { - for (INT32 x = 0; x < nTransWidth; x++) { - ((UINT32*)pDest)[x] = pPalette[pSrc[x]]; - } - } - break; - } - } - - return 0; -} - -void BurnTransferExit() -{ -#if defined FBA_DEBUG - if (!Debug_BurnTransferInitted) bprintf(PRINT_ERROR, _T("BurnTransferExit called without init\n")); -#endif - - BurnFree(pTransDraw); - BurnFree(pPrioDraw); - - Debug_BurnTransferInitted = 0; -} - -#define nTransOverflow 10 // 10 lines of overflow, some games spill past the end of the allocated height causing heap corruption. - -INT32 BurnTransferInit() -{ - Debug_BurnTransferInitted = 1; - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nTransHeight, &nTransWidth); - } else { - BurnDrvGetVisibleSize(&nTransWidth, &nTransHeight); - } - - pTransDraw = (UINT16*)BurnMalloc(nTransWidth * (nTransHeight + nTransOverflow) * sizeof(UINT16)); - if (pTransDraw == NULL) { - return 1; - } - - pPrioDraw = (UINT8*)BurnMalloc(nTransWidth * (nTransHeight + nTransOverflow)); - if (pPrioDraw == NULL) { - return 1; - } - - BurnTransferClear(); - - return 0; -} - -/*================================================================================================ -Graphics Decoding -================================================================================================*/ - -inline static INT32 readbit(const UINT8 *src, INT32 bitnum) -{ - return src[bitnum / 8] & (0x80 >> (bitnum % 8)); -} - -void GfxDecode(INT32 num, INT32 numPlanes, INT32 xSize, INT32 ySize, INT32 planeoffsets[], INT32 xoffsets[], INT32 yoffsets[], INT32 modulo, UINT8 *pSrc, UINT8 *pDest) -{ - INT32 c; - - for (c = 0; c < num; c++) { - INT32 plane, x, y; - - UINT8 *dp = pDest + (c * xSize * ySize); - memset(dp, 0, xSize * ySize); - - for (plane = 0; plane < numPlanes; plane++) { - INT32 planebit = 1 << (numPlanes - 1 - plane); - INT32 planeoffs = (c * modulo) + planeoffsets[plane]; - - for (y = 0; y < ySize; y++) { - INT32 yoffs = planeoffs + yoffsets[y]; - dp = pDest + (c * xSize * ySize) + (y * xSize); - - for (x = 0; x < xSize; x++) { - if (readbit(pSrc, yoffs + xoffsets[x])) dp[x] |= planebit; - } - } - } - } -} - -void GfxDecodeSingle(INT32 which, INT32 numPlanes, INT32 xSize, INT32 ySize, INT32 planeoffsets[], INT32 xoffsets[], INT32 yoffsets[], INT32 modulo, UINT8 *pSrc, UINT8 *pDest) -{ - INT32 plane, x, y; - - UINT8 *dp = pDest + (which * xSize * ySize); - memset(dp, 0, xSize * ySize); - - for (plane = 0; plane < numPlanes; plane++) { - INT32 planebit = 1 << (numPlanes - 1 - plane); - INT32 planeoffs = (which * modulo) + planeoffsets[plane]; - - for (y = 0; y < ySize; y++) { - INT32 yoffs = planeoffs + yoffsets[y]; - dp = pDest + (which * xSize * ySize) + (y * xSize); - - for (x = 0; x < xSize; x++) { - if (readbit(pSrc, yoffs + xoffsets[x])) dp[x] |= planebit; - } - } - } -} - -//================================================================================================ - -#define PLOTPIXEL_PRIO(x) { pPixel[x] = nPalette + pTileData[x]; pPri[x] = nPriority; } -#define PLOTPIXEL_PRIO_FLIPX(x, a) { pPixel[x] = nPalette + pTileData[a]; pPri[x] = nPriority; } -#define PLOTPIXEL_PRIO_MASK(x, mc) if (pTileData[x] != mc) { pPixel[x] = nPalette + pTileData[x]; pPri[x] = nPriority; } -#define PLOTPIXEL_PRIO_MASK_FLIPX(x, a, mc) if (pTileData[a] != mc) { pPixel[x] = nPalette + pTileData[a]; pPri[x] = nPriority; } - -#define PLOTPIXEL(x) pPixel[x] = nPalette + pTileData[x]; -#define PLOTPIXEL_FLIPX(x, a) pPixel[x] = nPalette + pTileData[a]; -#define PLOTPIXEL_MASK(x, mc) if (pTileData[x] != mc) {pPixel[x] = nPalette + pTileData[x];} -#define PLOTPIXEL_MASK_FLIPX(x, a, mc) if (pTileData[a] != mc) {pPixel[x] = nPalette + pTileData[a] ;} - -#define PLOTPIXEL_PRIO_TRANSMASK(x) if (pTransTable[pTileData[x]] == 0) { pPixel[x] = nPalette + pTileData[x]; pPri[x] = nPriority; } -#define PLOTPIXEL_PRIO_TRANSMASK_FLIPX(x, a) if (pTransTable[pTileData[a]] == 0) { pPixel[x] = nPalette + pTileData[a]; pPri[x] = nPriority; } -#define PLOTPIXEL_TRANSMASK(x) if (pTransTable[pTileData[x]] == 0) { pPixel[x] = nPalette + pTileData[x];} -#define PLOTPIXEL_TRANSMASK_FLIPX(x, a) if (pTransTable[pTileData[a]] == 0) { pPixel[x] = nPalette + pTileData[a] ;} - -#define CLIPPIXEL(x, sx, a) if ((sx + x) >= nScreenWidthMin && (sx + x) < nScreenWidthMax) { a; }; - -/*================================================================================================ -8 x 8 Functions -================================================================================================*/ - -void Render8x8Tile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth ) | nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pTileData += 8) { - PLOTPIXEL(0); - PLOTPIXEL(1); - PLOTPIXEL(2); - PLOTPIXEL(3); - PLOTPIXEL(4); - PLOTPIXEL(5); - PLOTPIXEL(6); - PLOTPIXEL(7); - } -} - -void Render8x8Tile_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(0, StartX, PLOTPIXEL(0)); - CLIPPIXEL(1, StartX, PLOTPIXEL(1)); - CLIPPIXEL(2, StartX, PLOTPIXEL(2)); - CLIPPIXEL(3, StartX, PLOTPIXEL(3)); - CLIPPIXEL(4, StartX, PLOTPIXEL(4)); - CLIPPIXEL(5, StartX, PLOTPIXEL(5)); - CLIPPIXEL(6, StartX, PLOTPIXEL(6)); - CLIPPIXEL(7, StartX, PLOTPIXEL(7)); - } -} - -void Render8x8Tile_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pTileData += 8) { - PLOTPIXEL_FLIPX(7, 0); - PLOTPIXEL_FLIPX(6, 1); - PLOTPIXEL_FLIPX(5, 2); - PLOTPIXEL_FLIPX(4, 3); - PLOTPIXEL_FLIPX(3, 4); - PLOTPIXEL_FLIPX(2, 5); - PLOTPIXEL_FLIPX(1, 6); - PLOTPIXEL_FLIPX(0, 7); - } -} - -void Render8x8Tile_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(7, StartX, PLOTPIXEL_FLIPX(7, 0)); - CLIPPIXEL(6, StartX, PLOTPIXEL_FLIPX(6, 1)); - CLIPPIXEL(5, StartX, PLOTPIXEL_FLIPX(5, 2)); - CLIPPIXEL(4, StartX, PLOTPIXEL_FLIPX(4, 3)); - CLIPPIXEL(3, StartX, PLOTPIXEL_FLIPX(3, 4)); - CLIPPIXEL(2, StartX, PLOTPIXEL_FLIPX(2, 5)); - CLIPPIXEL(1, StartX, PLOTPIXEL_FLIPX(1, 6)); - CLIPPIXEL(0, StartX, PLOTPIXEL_FLIPX(0, 7)); - } -} - -void Render8x8Tile_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 8) { - PLOTPIXEL(0); - PLOTPIXEL(1); - PLOTPIXEL(2); - PLOTPIXEL(3); - PLOTPIXEL(4); - PLOTPIXEL(5); - PLOTPIXEL(6); - PLOTPIXEL(7); - } -} - -void Render8x8Tile_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(0, StartX, PLOTPIXEL(0)); - CLIPPIXEL(1, StartX, PLOTPIXEL(1)); - CLIPPIXEL(2, StartX, PLOTPIXEL(2)); - CLIPPIXEL(3, StartX, PLOTPIXEL(3)); - CLIPPIXEL(4, StartX, PLOTPIXEL(4)); - CLIPPIXEL(5, StartX, PLOTPIXEL(5)); - CLIPPIXEL(6, StartX, PLOTPIXEL(6)); - CLIPPIXEL(7, StartX, PLOTPIXEL(7)); - } -} - -void Render8x8Tile_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 8) { - PLOTPIXEL_FLIPX(7, 0); - PLOTPIXEL_FLIPX(6, 1); - PLOTPIXEL_FLIPX(5, 2); - PLOTPIXEL_FLIPX(4, 3); - PLOTPIXEL_FLIPX(3, 4); - PLOTPIXEL_FLIPX(2, 5); - PLOTPIXEL_FLIPX(1, 6); - PLOTPIXEL_FLIPX(0, 7); - } -} - -void Render8x8Tile_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(7, StartX, PLOTPIXEL_FLIPX(7, 0)); - CLIPPIXEL(6, StartX, PLOTPIXEL_FLIPX(6, 1)); - CLIPPIXEL(5, StartX, PLOTPIXEL_FLIPX(5, 2)); - CLIPPIXEL(4, StartX, PLOTPIXEL_FLIPX(4, 3)); - CLIPPIXEL(3, StartX, PLOTPIXEL_FLIPX(3, 4)); - CLIPPIXEL(2, StartX, PLOTPIXEL_FLIPX(2, 5)); - CLIPPIXEL(1, StartX, PLOTPIXEL_FLIPX(1, 6)); - CLIPPIXEL(0, StartX, PLOTPIXEL_FLIPX(0, 7)); - } -} - -/*================================================================================================ -8 x 8 Functions with Masking -================================================================================================*/ - -void Render8x8Tile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Mask called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pTileData += 8) { - PLOTPIXEL_MASK(0, nMaskColour); - PLOTPIXEL_MASK(1, nMaskColour); - PLOTPIXEL_MASK(2, nMaskColour); - PLOTPIXEL_MASK(3, nMaskColour); - PLOTPIXEL_MASK(4, nMaskColour); - PLOTPIXEL_MASK(5, nMaskColour); - PLOTPIXEL_MASK(6, nMaskColour); - PLOTPIXEL_MASK(7, nMaskColour); - } -} - -void Render8x8Tile_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Mask_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(0, StartX, PLOTPIXEL_MASK(0, nMaskColour)); - CLIPPIXEL(1, StartX, PLOTPIXEL_MASK(1, nMaskColour)); - CLIPPIXEL(2, StartX, PLOTPIXEL_MASK(2, nMaskColour)); - CLIPPIXEL(3, StartX, PLOTPIXEL_MASK(3, nMaskColour)); - CLIPPIXEL(4, StartX, PLOTPIXEL_MASK(4, nMaskColour)); - CLIPPIXEL(5, StartX, PLOTPIXEL_MASK(5, nMaskColour)); - CLIPPIXEL(6, StartX, PLOTPIXEL_MASK(6, nMaskColour)); - CLIPPIXEL(7, StartX, PLOTPIXEL_MASK(7, nMaskColour)); - } -} - -void Render8x8Tile_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Mask_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pTileData += 8) { - PLOTPIXEL_MASK_FLIPX(7, 0, nMaskColour); - PLOTPIXEL_MASK_FLIPX(6, 1, nMaskColour); - PLOTPIXEL_MASK_FLIPX(5, 2, nMaskColour); - PLOTPIXEL_MASK_FLIPX(4, 3, nMaskColour); - PLOTPIXEL_MASK_FLIPX(3, 4, nMaskColour); - PLOTPIXEL_MASK_FLIPX(2, 5, nMaskColour); - PLOTPIXEL_MASK_FLIPX(1, 6, nMaskColour); - PLOTPIXEL_MASK_FLIPX(0, 7, nMaskColour); - } -} - -void Render8x8Tile_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Mask_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(7, StartX, PLOTPIXEL_MASK_FLIPX(7, 0, nMaskColour)); - CLIPPIXEL(6, StartX, PLOTPIXEL_MASK_FLIPX(6, 1, nMaskColour)); - CLIPPIXEL(5, StartX, PLOTPIXEL_MASK_FLIPX(5, 2, nMaskColour)); - CLIPPIXEL(4, StartX, PLOTPIXEL_MASK_FLIPX(4, 3, nMaskColour)); - CLIPPIXEL(3, StartX, PLOTPIXEL_MASK_FLIPX(3, 4, nMaskColour)); - CLIPPIXEL(2, StartX, PLOTPIXEL_MASK_FLIPX(2, 5, nMaskColour)); - CLIPPIXEL(1, StartX, PLOTPIXEL_MASK_FLIPX(1, 6, nMaskColour)); - CLIPPIXEL(0, StartX, PLOTPIXEL_MASK_FLIPX(0, 7, nMaskColour)); - } -} - -void Render8x8Tile_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Mask_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 8) { - PLOTPIXEL_MASK(0, nMaskColour); - PLOTPIXEL_MASK(1, nMaskColour); - PLOTPIXEL_MASK(2, nMaskColour); - PLOTPIXEL_MASK(3, nMaskColour); - PLOTPIXEL_MASK(4, nMaskColour); - PLOTPIXEL_MASK(5, nMaskColour); - PLOTPIXEL_MASK(6, nMaskColour); - PLOTPIXEL_MASK(7, nMaskColour); - } -} - -void Render8x8Tile_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Mask_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(0, StartX, PLOTPIXEL_MASK(0, nMaskColour)); - CLIPPIXEL(1, StartX, PLOTPIXEL_MASK(1, nMaskColour)); - CLIPPIXEL(2, StartX, PLOTPIXEL_MASK(2, nMaskColour)); - CLIPPIXEL(3, StartX, PLOTPIXEL_MASK(3, nMaskColour)); - CLIPPIXEL(4, StartX, PLOTPIXEL_MASK(4, nMaskColour)); - CLIPPIXEL(5, StartX, PLOTPIXEL_MASK(5, nMaskColour)); - CLIPPIXEL(6, StartX, PLOTPIXEL_MASK(6, nMaskColour)); - CLIPPIXEL(7, StartX, PLOTPIXEL_MASK(7, nMaskColour)); - } -} - -void Render8x8Tile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Mask_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 8) { - PLOTPIXEL_MASK_FLIPX(7, 0, nMaskColour); - PLOTPIXEL_MASK_FLIPX(6, 1, nMaskColour); - PLOTPIXEL_MASK_FLIPX(5, 2, nMaskColour); - PLOTPIXEL_MASK_FLIPX(4, 3, nMaskColour); - PLOTPIXEL_MASK_FLIPX(3, 4, nMaskColour); - PLOTPIXEL_MASK_FLIPX(2, 5, nMaskColour); - PLOTPIXEL_MASK_FLIPX(1, 6, nMaskColour); - PLOTPIXEL_MASK_FLIPX(0, 7, nMaskColour); - } -} - -void Render8x8Tile_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Mask_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(7, StartX, PLOTPIXEL_MASK_FLIPX(7, 0, nMaskColour)); - CLIPPIXEL(6, StartX, PLOTPIXEL_MASK_FLIPX(6, 1, nMaskColour)); - CLIPPIXEL(5, StartX, PLOTPIXEL_MASK_FLIPX(5, 2, nMaskColour)); - CLIPPIXEL(4, StartX, PLOTPIXEL_MASK_FLIPX(4, 3, nMaskColour)); - CLIPPIXEL(3, StartX, PLOTPIXEL_MASK_FLIPX(3, 4, nMaskColour)); - CLIPPIXEL(2, StartX, PLOTPIXEL_MASK_FLIPX(2, 5, nMaskColour)); - CLIPPIXEL(1, StartX, PLOTPIXEL_MASK_FLIPX(1, 6, nMaskColour)); - CLIPPIXEL(0, StartX, PLOTPIXEL_MASK_FLIPX(0, 7, nMaskColour)); - } -} - -/*================================================================================================ -16 x 16 Functions -================================================================================================*/ - -void Render16x16Tile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pTileData += 16) { - PLOTPIXEL( 0); - PLOTPIXEL( 1); - PLOTPIXEL( 2); - PLOTPIXEL( 3); - PLOTPIXEL( 4); - PLOTPIXEL( 5); - PLOTPIXEL( 6); - PLOTPIXEL( 7); - PLOTPIXEL( 8); - PLOTPIXEL( 9); - PLOTPIXEL(10); - PLOTPIXEL(11); - PLOTPIXEL(12); - PLOTPIXEL(13); - PLOTPIXEL(14); - PLOTPIXEL(15); - } -} - -void Render16x16Tile_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL( 0)); - CLIPPIXEL( 1, StartX, PLOTPIXEL( 1)); - CLIPPIXEL( 2, StartX, PLOTPIXEL( 2)); - CLIPPIXEL( 3, StartX, PLOTPIXEL( 3)); - CLIPPIXEL( 4, StartX, PLOTPIXEL( 4)); - CLIPPIXEL( 5, StartX, PLOTPIXEL( 5)); - CLIPPIXEL( 6, StartX, PLOTPIXEL( 6)); - CLIPPIXEL( 7, StartX, PLOTPIXEL( 7)); - CLIPPIXEL( 8, StartX, PLOTPIXEL( 8)); - CLIPPIXEL( 9, StartX, PLOTPIXEL( 9)); - CLIPPIXEL(10, StartX, PLOTPIXEL(10)); - CLIPPIXEL(11, StartX, PLOTPIXEL(11)); - CLIPPIXEL(12, StartX, PLOTPIXEL(12)); - CLIPPIXEL(13, StartX, PLOTPIXEL(13)); - CLIPPIXEL(14, StartX, PLOTPIXEL(14)); - CLIPPIXEL(15, StartX, PLOTPIXEL(15)); - } -} - -void Render16x16Tile_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pTileData += 16) { - PLOTPIXEL_FLIPX(15, 0); - PLOTPIXEL_FLIPX(14, 1); - PLOTPIXEL_FLIPX(13, 2); - PLOTPIXEL_FLIPX(12, 3); - PLOTPIXEL_FLIPX(11, 4); - PLOTPIXEL_FLIPX(10, 5); - PLOTPIXEL_FLIPX( 9, 6); - PLOTPIXEL_FLIPX( 8, 7); - PLOTPIXEL_FLIPX( 7, 8); - PLOTPIXEL_FLIPX( 6, 9); - PLOTPIXEL_FLIPX( 5, 10); - PLOTPIXEL_FLIPX( 4, 11); - PLOTPIXEL_FLIPX( 3, 12); - PLOTPIXEL_FLIPX( 2, 13); - PLOTPIXEL_FLIPX( 1, 14); - PLOTPIXEL_FLIPX( 0, 15); - } -} - -void Render16x16Tile_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(15, StartX, PLOTPIXEL_FLIPX(15, 0)); - CLIPPIXEL(14, StartX, PLOTPIXEL_FLIPX(14, 1)); - CLIPPIXEL(13, StartX, PLOTPIXEL_FLIPX(13, 2)); - CLIPPIXEL(12, StartX, PLOTPIXEL_FLIPX(12, 3)); - CLIPPIXEL(11, StartX, PLOTPIXEL_FLIPX(11, 4)); - CLIPPIXEL(10, StartX, PLOTPIXEL_FLIPX(10, 5)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_FLIPX( 9, 6)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_FLIPX( 8, 7)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_FLIPX( 7, 8)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_FLIPX( 6, 9)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_FLIPX( 5, 10)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_FLIPX( 4, 11)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_FLIPX( 3, 12)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_FLIPX( 2, 13)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_FLIPX( 1, 14)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_FLIPX( 0, 15)); - } -} - -void Render16x16Tile_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 16) { - PLOTPIXEL( 0); - PLOTPIXEL( 1); - PLOTPIXEL( 2); - PLOTPIXEL( 3); - PLOTPIXEL( 4); - PLOTPIXEL( 5); - PLOTPIXEL( 6); - PLOTPIXEL( 7); - PLOTPIXEL( 8); - PLOTPIXEL( 9); - PLOTPIXEL(10); - PLOTPIXEL(11); - PLOTPIXEL(12); - PLOTPIXEL(13); - PLOTPIXEL(14); - PLOTPIXEL(15); - } -} - -void Render16x16Tile_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL( 0)); - CLIPPIXEL( 1, StartX, PLOTPIXEL( 1)); - CLIPPIXEL( 2, StartX, PLOTPIXEL( 2)); - CLIPPIXEL( 3, StartX, PLOTPIXEL( 3)); - CLIPPIXEL( 4, StartX, PLOTPIXEL( 4)); - CLIPPIXEL( 5, StartX, PLOTPIXEL( 5)); - CLIPPIXEL( 6, StartX, PLOTPIXEL( 6)); - CLIPPIXEL( 7, StartX, PLOTPIXEL( 7)); - CLIPPIXEL( 8, StartX, PLOTPIXEL( 8)); - CLIPPIXEL( 9, StartX, PLOTPIXEL( 9)); - CLIPPIXEL(10, StartX, PLOTPIXEL(10)); - CLIPPIXEL(11, StartX, PLOTPIXEL(11)); - CLIPPIXEL(12, StartX, PLOTPIXEL(12)); - CLIPPIXEL(13, StartX, PLOTPIXEL(13)); - CLIPPIXEL(14, StartX, PLOTPIXEL(14)); - CLIPPIXEL(15, StartX, PLOTPIXEL(15)); - } -} - -void Render16x16Tile_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 16) { - PLOTPIXEL_FLIPX(15, 0); - PLOTPIXEL_FLIPX(14, 1); - PLOTPIXEL_FLIPX(13, 2); - PLOTPIXEL_FLIPX(12, 3); - PLOTPIXEL_FLIPX(11, 4); - PLOTPIXEL_FLIPX(10, 5); - PLOTPIXEL_FLIPX( 9, 6); - PLOTPIXEL_FLIPX( 8, 7); - PLOTPIXEL_FLIPX( 7, 8); - PLOTPIXEL_FLIPX( 6, 9); - PLOTPIXEL_FLIPX( 5, 10); - PLOTPIXEL_FLIPX( 4, 11); - PLOTPIXEL_FLIPX( 3, 12); - PLOTPIXEL_FLIPX( 2, 13); - PLOTPIXEL_FLIPX( 1, 14); - PLOTPIXEL_FLIPX( 0, 15); - } -} - -void Render16x16Tile_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(15, StartX, PLOTPIXEL_FLIPX(15, 0)); - CLIPPIXEL(14, StartX, PLOTPIXEL_FLIPX(14, 1)); - CLIPPIXEL(13, StartX, PLOTPIXEL_FLIPX(13, 2)); - CLIPPIXEL(12, StartX, PLOTPIXEL_FLIPX(12, 3)); - CLIPPIXEL(11, StartX, PLOTPIXEL_FLIPX(11, 4)); - CLIPPIXEL(10, StartX, PLOTPIXEL_FLIPX(10, 5)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_FLIPX( 9, 6)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_FLIPX( 8, 7)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_FLIPX( 7, 8)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_FLIPX( 6, 9)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_FLIPX( 5, 10)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_FLIPX( 4, 11)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_FLIPX( 3, 12)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_FLIPX( 2, 13)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_FLIPX( 1, 14)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_FLIPX( 0, 15)); - } -} - -/*================================================================================================ -16 x 16 Functions with Masking -================================================================================================*/ - -void Render16x16Tile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Mask called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pTileData += 16) { - PLOTPIXEL_MASK( 0, nMaskColour); - PLOTPIXEL_MASK( 1, nMaskColour); - PLOTPIXEL_MASK( 2, nMaskColour); - PLOTPIXEL_MASK( 3, nMaskColour); - PLOTPIXEL_MASK( 4, nMaskColour); - PLOTPIXEL_MASK( 5, nMaskColour); - PLOTPIXEL_MASK( 6, nMaskColour); - PLOTPIXEL_MASK( 7, nMaskColour); - PLOTPIXEL_MASK( 8, nMaskColour); - PLOTPIXEL_MASK( 9, nMaskColour); - PLOTPIXEL_MASK(10, nMaskColour); - PLOTPIXEL_MASK(11, nMaskColour); - PLOTPIXEL_MASK(12, nMaskColour); - PLOTPIXEL_MASK(13, nMaskColour); - PLOTPIXEL_MASK(14, nMaskColour); - PLOTPIXEL_MASK(15, nMaskColour); - } -} - -void Render16x16Tile_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Mask_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_MASK( 0, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_MASK( 1, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_MASK( 2, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_MASK( 3, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_MASK( 4, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_MASK( 5, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_MASK( 6, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_MASK( 7, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_MASK( 8, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_MASK( 9, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_MASK(10, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_MASK(11, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_MASK(12, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_MASK(13, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_MASK(14, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_MASK(15, nMaskColour)); - } -} - -void Render16x16Tile_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Mask_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pTileData += 16) { - PLOTPIXEL_MASK_FLIPX(15, 0, nMaskColour); - PLOTPIXEL_MASK_FLIPX(14, 1, nMaskColour); - PLOTPIXEL_MASK_FLIPX(13, 2, nMaskColour); - PLOTPIXEL_MASK_FLIPX(12, 3, nMaskColour); - PLOTPIXEL_MASK_FLIPX(11, 4, nMaskColour); - PLOTPIXEL_MASK_FLIPX(10, 5, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 9, 6, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 8, 7, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 7, 8, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 6, 9, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 5, 10, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 4, 11, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 3, 12, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 2, 13, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 1, 14, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 0, 15, nMaskColour); - } -} - -void Render16x16Tile_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Mask_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(15, StartX, PLOTPIXEL_MASK_FLIPX(15, 0, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_MASK_FLIPX(14, 1, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_MASK_FLIPX(13, 2, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_MASK_FLIPX(12, 3, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_MASK_FLIPX(11, 4, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_MASK_FLIPX(10, 5, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_MASK_FLIPX( 9, 6, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_MASK_FLIPX( 8, 7, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_MASK_FLIPX( 7, 8, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_MASK_FLIPX( 6, 9, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_MASK_FLIPX( 5, 10, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_MASK_FLIPX( 4, 11, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_MASK_FLIPX( 3, 12, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_MASK_FLIPX( 2, 13, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_MASK_FLIPX( 1, 14, nMaskColour)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_MASK_FLIPX( 0, 15, nMaskColour)); - } -} - -void Render16x16Tile_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Mask_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 16) { - PLOTPIXEL_MASK( 0, nMaskColour); - PLOTPIXEL_MASK( 1, nMaskColour); - PLOTPIXEL_MASK( 2, nMaskColour); - PLOTPIXEL_MASK( 3, nMaskColour); - PLOTPIXEL_MASK( 4, nMaskColour); - PLOTPIXEL_MASK( 5, nMaskColour); - PLOTPIXEL_MASK( 6, nMaskColour); - PLOTPIXEL_MASK( 7, nMaskColour); - PLOTPIXEL_MASK( 8, nMaskColour); - PLOTPIXEL_MASK( 9, nMaskColour); - PLOTPIXEL_MASK(10, nMaskColour); - PLOTPIXEL_MASK(11, nMaskColour); - PLOTPIXEL_MASK(12, nMaskColour); - PLOTPIXEL_MASK(13, nMaskColour); - PLOTPIXEL_MASK(14, nMaskColour); - PLOTPIXEL_MASK(15, nMaskColour); - } -} - -void Render16x16Tile_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Mask_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_MASK( 0, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_MASK( 1, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_MASK( 2, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_MASK( 3, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_MASK( 4, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_MASK( 5, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_MASK( 6, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_MASK( 7, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_MASK( 8, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_MASK( 9, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_MASK(10, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_MASK(11, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_MASK(12, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_MASK(13, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_MASK(14, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_MASK(15, nMaskColour)); - } -} - -void Render16x16Tile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Mask_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 16) { - PLOTPIXEL_MASK_FLIPX(15, 0, nMaskColour); - PLOTPIXEL_MASK_FLIPX(14, 1, nMaskColour); - PLOTPIXEL_MASK_FLIPX(13, 2, nMaskColour); - PLOTPIXEL_MASK_FLIPX(12, 3, nMaskColour); - PLOTPIXEL_MASK_FLIPX(11, 4, nMaskColour); - PLOTPIXEL_MASK_FLIPX(10, 5, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 9, 6, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 8, 7, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 7, 8, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 6, 9, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 5, 10, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 4, 11, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 3, 12, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 2, 13, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 1, 14, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 0, 15, nMaskColour); - } -} - -void Render16x16Tile_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Mask_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(15, StartX, PLOTPIXEL_MASK_FLIPX(15, 0, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_MASK_FLIPX(14, 1, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_MASK_FLIPX(13, 2, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_MASK_FLIPX(12, 3, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_MASK_FLIPX(11, 4, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_MASK_FLIPX(10, 5, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_MASK_FLIPX( 9, 6, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_MASK_FLIPX( 8, 7, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_MASK_FLIPX( 7, 8, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_MASK_FLIPX( 6, 9, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_MASK_FLIPX( 5, 10, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_MASK_FLIPX( 4, 11, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_MASK_FLIPX( 3, 12, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_MASK_FLIPX( 2, 13, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_MASK_FLIPX( 1, 14, nMaskColour)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_MASK_FLIPX( 0, 15, nMaskColour)); - } -} - -/*================================================================================================ -32 x 32 Functions -================================================================================================*/ - -void Render32x32Tile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pTileData += 32) { - PLOTPIXEL( 0); - PLOTPIXEL( 1); - PLOTPIXEL( 2); - PLOTPIXEL( 3); - PLOTPIXEL( 4); - PLOTPIXEL( 5); - PLOTPIXEL( 6); - PLOTPIXEL( 7); - PLOTPIXEL( 8); - PLOTPIXEL( 9); - PLOTPIXEL(10); - PLOTPIXEL(11); - PLOTPIXEL(12); - PLOTPIXEL(13); - PLOTPIXEL(14); - PLOTPIXEL(15); - PLOTPIXEL(16); - PLOTPIXEL(17); - PLOTPIXEL(18); - PLOTPIXEL(19); - PLOTPIXEL(20); - PLOTPIXEL(21); - PLOTPIXEL(22); - PLOTPIXEL(23); - PLOTPIXEL(24); - PLOTPIXEL(25); - PLOTPIXEL(26); - PLOTPIXEL(27); - PLOTPIXEL(28); - PLOTPIXEL(29); - PLOTPIXEL(30); - PLOTPIXEL(31); - } -} - -void Render32x32Tile_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL( 0)); - CLIPPIXEL( 1, StartX, PLOTPIXEL( 1)); - CLIPPIXEL( 2, StartX, PLOTPIXEL( 2)); - CLIPPIXEL( 3, StartX, PLOTPIXEL( 3)); - CLIPPIXEL( 4, StartX, PLOTPIXEL( 4)); - CLIPPIXEL( 5, StartX, PLOTPIXEL( 5)); - CLIPPIXEL( 6, StartX, PLOTPIXEL( 6)); - CLIPPIXEL( 7, StartX, PLOTPIXEL( 7)); - CLIPPIXEL( 8, StartX, PLOTPIXEL( 8)); - CLIPPIXEL( 9, StartX, PLOTPIXEL( 9)); - CLIPPIXEL(10, StartX, PLOTPIXEL(10)); - CLIPPIXEL(11, StartX, PLOTPIXEL(11)); - CLIPPIXEL(12, StartX, PLOTPIXEL(12)); - CLIPPIXEL(13, StartX, PLOTPIXEL(13)); - CLIPPIXEL(14, StartX, PLOTPIXEL(14)); - CLIPPIXEL(15, StartX, PLOTPIXEL(15)); - CLIPPIXEL(16, StartX, PLOTPIXEL(16)); - CLIPPIXEL(17, StartX, PLOTPIXEL(17)); - CLIPPIXEL(18, StartX, PLOTPIXEL(18)); - CLIPPIXEL(19, StartX, PLOTPIXEL(19)); - CLIPPIXEL(20, StartX, PLOTPIXEL(20)); - CLIPPIXEL(21, StartX, PLOTPIXEL(21)); - CLIPPIXEL(22, StartX, PLOTPIXEL(22)); - CLIPPIXEL(23, StartX, PLOTPIXEL(23)); - CLIPPIXEL(24, StartX, PLOTPIXEL(24)); - CLIPPIXEL(25, StartX, PLOTPIXEL(25)); - CLIPPIXEL(26, StartX, PLOTPIXEL(26)); - CLIPPIXEL(27, StartX, PLOTPIXEL(27)); - CLIPPIXEL(28, StartX, PLOTPIXEL(28)); - CLIPPIXEL(29, StartX, PLOTPIXEL(29)); - CLIPPIXEL(30, StartX, PLOTPIXEL(30)); - CLIPPIXEL(31, StartX, PLOTPIXEL(31)); - } -} - -void Render32x32Tile_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pTileData += 32) { - PLOTPIXEL_FLIPX(31, 0); - PLOTPIXEL_FLIPX(30, 1); - PLOTPIXEL_FLIPX(29, 2); - PLOTPIXEL_FLIPX(28, 3); - PLOTPIXEL_FLIPX(27, 4); - PLOTPIXEL_FLIPX(26, 5); - PLOTPIXEL_FLIPX(25, 6); - PLOTPIXEL_FLIPX(24, 7); - PLOTPIXEL_FLIPX(23, 8); - PLOTPIXEL_FLIPX(22, 9); - PLOTPIXEL_FLIPX(21, 10); - PLOTPIXEL_FLIPX(20, 11); - PLOTPIXEL_FLIPX(19, 12); - PLOTPIXEL_FLIPX(18, 13); - PLOTPIXEL_FLIPX(17, 14); - PLOTPIXEL_FLIPX(16, 15); - PLOTPIXEL_FLIPX(15, 16); - PLOTPIXEL_FLIPX(14, 17); - PLOTPIXEL_FLIPX(13, 18); - PLOTPIXEL_FLIPX(12, 19); - PLOTPIXEL_FLIPX(11, 20); - PLOTPIXEL_FLIPX(10, 21); - PLOTPIXEL_FLIPX( 9, 22); - PLOTPIXEL_FLIPX( 8, 23); - PLOTPIXEL_FLIPX( 7, 24); - PLOTPIXEL_FLIPX( 6, 25); - PLOTPIXEL_FLIPX( 5, 26); - PLOTPIXEL_FLIPX( 4, 27); - PLOTPIXEL_FLIPX( 3, 28); - PLOTPIXEL_FLIPX( 2, 29); - PLOTPIXEL_FLIPX( 1, 30); - PLOTPIXEL_FLIPX( 0, 31); - } -} - -void Render32x32Tile_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(31, StartX, PLOTPIXEL_FLIPX(31, 0)); - CLIPPIXEL(30, StartX, PLOTPIXEL_FLIPX(30, 1)); - CLIPPIXEL(29, StartX, PLOTPIXEL_FLIPX(29, 2)); - CLIPPIXEL(28, StartX, PLOTPIXEL_FLIPX(28, 3)); - CLIPPIXEL(27, StartX, PLOTPIXEL_FLIPX(27, 4)); - CLIPPIXEL(26, StartX, PLOTPIXEL_FLIPX(26, 5)); - CLIPPIXEL(25, StartX, PLOTPIXEL_FLIPX(25, 6)); - CLIPPIXEL(24, StartX, PLOTPIXEL_FLIPX(24, 7)); - CLIPPIXEL(23, StartX, PLOTPIXEL_FLIPX(23, 8)); - CLIPPIXEL(22, StartX, PLOTPIXEL_FLIPX(22, 9)); - CLIPPIXEL(21, StartX, PLOTPIXEL_FLIPX(21, 10)); - CLIPPIXEL(20, StartX, PLOTPIXEL_FLIPX(20, 11)); - CLIPPIXEL(19, StartX, PLOTPIXEL_FLIPX(19, 12)); - CLIPPIXEL(18, StartX, PLOTPIXEL_FLIPX(18, 13)); - CLIPPIXEL(17, StartX, PLOTPIXEL_FLIPX(17, 14)); - CLIPPIXEL(16, StartX, PLOTPIXEL_FLIPX(16, 15)); - CLIPPIXEL(15, StartX, PLOTPIXEL_FLIPX(15, 16)); - CLIPPIXEL(14, StartX, PLOTPIXEL_FLIPX(14, 17)); - CLIPPIXEL(13, StartX, PLOTPIXEL_FLIPX(13, 18)); - CLIPPIXEL(12, StartX, PLOTPIXEL_FLIPX(12, 19)); - CLIPPIXEL(11, StartX, PLOTPIXEL_FLIPX(11, 20)); - CLIPPIXEL(10, StartX, PLOTPIXEL_FLIPX(10, 21)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_FLIPX( 9, 22)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_FLIPX( 8, 23)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_FLIPX( 7, 24)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_FLIPX( 6, 25)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_FLIPX( 5, 26)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_FLIPX( 4, 27)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_FLIPX( 3, 28)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_FLIPX( 2, 29)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_FLIPX( 1, 30)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_FLIPX( 0, 31)); - } -} - -void Render32x32Tile_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 32) { - PLOTPIXEL( 0); - PLOTPIXEL( 1); - PLOTPIXEL( 2); - PLOTPIXEL( 3); - PLOTPIXEL( 4); - PLOTPIXEL( 5); - PLOTPIXEL( 6); - PLOTPIXEL( 7); - PLOTPIXEL( 8); - PLOTPIXEL( 9); - PLOTPIXEL(10); - PLOTPIXEL(11); - PLOTPIXEL(12); - PLOTPIXEL(13); - PLOTPIXEL(14); - PLOTPIXEL(15); - PLOTPIXEL(16); - PLOTPIXEL(17); - PLOTPIXEL(18); - PLOTPIXEL(19); - PLOTPIXEL(20); - PLOTPIXEL(21); - PLOTPIXEL(22); - PLOTPIXEL(23); - PLOTPIXEL(24); - PLOTPIXEL(25); - PLOTPIXEL(26); - PLOTPIXEL(27); - PLOTPIXEL(28); - PLOTPIXEL(29); - PLOTPIXEL(30); - PLOTPIXEL(31); - } -} - -void Render32x32Tile_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL( 0)); - CLIPPIXEL( 1, StartX, PLOTPIXEL( 1)); - CLIPPIXEL( 2, StartX, PLOTPIXEL( 2)); - CLIPPIXEL( 3, StartX, PLOTPIXEL( 3)); - CLIPPIXEL( 4, StartX, PLOTPIXEL( 4)); - CLIPPIXEL( 5, StartX, PLOTPIXEL( 5)); - CLIPPIXEL( 6, StartX, PLOTPIXEL( 6)); - CLIPPIXEL( 7, StartX, PLOTPIXEL( 7)); - CLIPPIXEL( 8, StartX, PLOTPIXEL( 8)); - CLIPPIXEL( 9, StartX, PLOTPIXEL( 9)); - CLIPPIXEL(10, StartX, PLOTPIXEL(10)); - CLIPPIXEL(11, StartX, PLOTPIXEL(11)); - CLIPPIXEL(12, StartX, PLOTPIXEL(12)); - CLIPPIXEL(13, StartX, PLOTPIXEL(13)); - CLIPPIXEL(14, StartX, PLOTPIXEL(14)); - CLIPPIXEL(15, StartX, PLOTPIXEL(15)); - CLIPPIXEL(16, StartX, PLOTPIXEL(16)); - CLIPPIXEL(17, StartX, PLOTPIXEL(17)); - CLIPPIXEL(18, StartX, PLOTPIXEL(18)); - CLIPPIXEL(19, StartX, PLOTPIXEL(19)); - CLIPPIXEL(20, StartX, PLOTPIXEL(20)); - CLIPPIXEL(21, StartX, PLOTPIXEL(21)); - CLIPPIXEL(22, StartX, PLOTPIXEL(22)); - CLIPPIXEL(23, StartX, PLOTPIXEL(23)); - CLIPPIXEL(24, StartX, PLOTPIXEL(24)); - CLIPPIXEL(25, StartX, PLOTPIXEL(25)); - CLIPPIXEL(26, StartX, PLOTPIXEL(26)); - CLIPPIXEL(27, StartX, PLOTPIXEL(27)); - CLIPPIXEL(28, StartX, PLOTPIXEL(28)); - CLIPPIXEL(29, StartX, PLOTPIXEL(29)); - CLIPPIXEL(30, StartX, PLOTPIXEL(30)); - CLIPPIXEL(31, StartX, PLOTPIXEL(31)); - } -} - -void Render32x32Tile_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 32) { - PLOTPIXEL_FLIPX(31, 0); - PLOTPIXEL_FLIPX(30, 1); - PLOTPIXEL_FLIPX(29, 2); - PLOTPIXEL_FLIPX(28, 3); - PLOTPIXEL_FLIPX(27, 4); - PLOTPIXEL_FLIPX(26, 5); - PLOTPIXEL_FLIPX(25, 6); - PLOTPIXEL_FLIPX(24, 7); - PLOTPIXEL_FLIPX(23, 8); - PLOTPIXEL_FLIPX(22, 9); - PLOTPIXEL_FLIPX(21, 10); - PLOTPIXEL_FLIPX(20, 11); - PLOTPIXEL_FLIPX(19, 12); - PLOTPIXEL_FLIPX(18, 13); - PLOTPIXEL_FLIPX(17, 14); - PLOTPIXEL_FLIPX(16, 15); - PLOTPIXEL_FLIPX(15, 16); - PLOTPIXEL_FLIPX(14, 17); - PLOTPIXEL_FLIPX(13, 18); - PLOTPIXEL_FLIPX(12, 19); - PLOTPIXEL_FLIPX(11, 20); - PLOTPIXEL_FLIPX(10, 21); - PLOTPIXEL_FLIPX( 9, 22); - PLOTPIXEL_FLIPX( 8, 23); - PLOTPIXEL_FLIPX( 7, 24); - PLOTPIXEL_FLIPX( 6, 25); - PLOTPIXEL_FLIPX( 5, 26); - PLOTPIXEL_FLIPX( 4, 27); - PLOTPIXEL_FLIPX( 3, 28); - PLOTPIXEL_FLIPX( 2, 29); - PLOTPIXEL_FLIPX( 1, 30); - PLOTPIXEL_FLIPX( 0, 31); - } -} - -void Render32x32Tile_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(31, StartX, PLOTPIXEL_FLIPX(31, 0)); - CLIPPIXEL(30, StartX, PLOTPIXEL_FLIPX(30, 1)); - CLIPPIXEL(29, StartX, PLOTPIXEL_FLIPX(29, 2)); - CLIPPIXEL(28, StartX, PLOTPIXEL_FLIPX(28, 3)); - CLIPPIXEL(27, StartX, PLOTPIXEL_FLIPX(27, 4)); - CLIPPIXEL(26, StartX, PLOTPIXEL_FLIPX(26, 5)); - CLIPPIXEL(25, StartX, PLOTPIXEL_FLIPX(25, 6)); - CLIPPIXEL(24, StartX, PLOTPIXEL_FLIPX(24, 7)); - CLIPPIXEL(23, StartX, PLOTPIXEL_FLIPX(23, 8)); - CLIPPIXEL(22, StartX, PLOTPIXEL_FLIPX(22, 9)); - CLIPPIXEL(21, StartX, PLOTPIXEL_FLIPX(21, 10)); - CLIPPIXEL(20, StartX, PLOTPIXEL_FLIPX(20, 11)); - CLIPPIXEL(19, StartX, PLOTPIXEL_FLIPX(19, 12)); - CLIPPIXEL(18, StartX, PLOTPIXEL_FLIPX(18, 13)); - CLIPPIXEL(17, StartX, PLOTPIXEL_FLIPX(17, 14)); - CLIPPIXEL(16, StartX, PLOTPIXEL_FLIPX(16, 15)); - CLIPPIXEL(15, StartX, PLOTPIXEL_FLIPX(15, 16)); - CLIPPIXEL(14, StartX, PLOTPIXEL_FLIPX(14, 17)); - CLIPPIXEL(13, StartX, PLOTPIXEL_FLIPX(13, 18)); - CLIPPIXEL(12, StartX, PLOTPIXEL_FLIPX(12, 19)); - CLIPPIXEL(11, StartX, PLOTPIXEL_FLIPX(11, 20)); - CLIPPIXEL(10, StartX, PLOTPIXEL_FLIPX(10, 21)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_FLIPX( 9, 22)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_FLIPX( 8, 23)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_FLIPX( 7, 24)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_FLIPX( 6, 25)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_FLIPX( 5, 26)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_FLIPX( 4, 27)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_FLIPX( 3, 28)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_FLIPX( 2, 29)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_FLIPX( 1, 30)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_FLIPX( 0, 31)); - } -} - -/*================================================================================================ -32 x 32 Functions with Masking -================================================================================================*/ - -void Render32x32Tile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Mask called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pTileData += 32) { - PLOTPIXEL_MASK( 0, nMaskColour); - PLOTPIXEL_MASK( 1, nMaskColour); - PLOTPIXEL_MASK( 2, nMaskColour); - PLOTPIXEL_MASK( 3, nMaskColour); - PLOTPIXEL_MASK( 4, nMaskColour); - PLOTPIXEL_MASK( 5, nMaskColour); - PLOTPIXEL_MASK( 6, nMaskColour); - PLOTPIXEL_MASK( 7, nMaskColour); - PLOTPIXEL_MASK( 8, nMaskColour); - PLOTPIXEL_MASK( 9, nMaskColour); - PLOTPIXEL_MASK(10, nMaskColour); - PLOTPIXEL_MASK(11, nMaskColour); - PLOTPIXEL_MASK(12, nMaskColour); - PLOTPIXEL_MASK(13, nMaskColour); - PLOTPIXEL_MASK(14, nMaskColour); - PLOTPIXEL_MASK(15, nMaskColour); - PLOTPIXEL_MASK(16, nMaskColour); - PLOTPIXEL_MASK(17, nMaskColour); - PLOTPIXEL_MASK(18, nMaskColour); - PLOTPIXEL_MASK(19, nMaskColour); - PLOTPIXEL_MASK(20, nMaskColour); - PLOTPIXEL_MASK(21, nMaskColour); - PLOTPIXEL_MASK(22, nMaskColour); - PLOTPIXEL_MASK(23, nMaskColour); - PLOTPIXEL_MASK(24, nMaskColour); - PLOTPIXEL_MASK(25, nMaskColour); - PLOTPIXEL_MASK(26, nMaskColour); - PLOTPIXEL_MASK(27, nMaskColour); - PLOTPIXEL_MASK(28, nMaskColour); - PLOTPIXEL_MASK(29, nMaskColour); - PLOTPIXEL_MASK(30, nMaskColour); - PLOTPIXEL_MASK(31, nMaskColour); - } -} - -void Render32x32Tile_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Mask_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_MASK( 0, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_MASK( 1, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_MASK( 2, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_MASK( 3, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_MASK( 4, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_MASK( 5, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_MASK( 6, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_MASK( 7, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_MASK( 8, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_MASK( 9, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_MASK(10, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_MASK(11, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_MASK(12, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_MASK(13, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_MASK(14, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_MASK(15, nMaskColour)); - CLIPPIXEL(16, StartX, PLOTPIXEL_MASK(16, nMaskColour)); - CLIPPIXEL(17, StartX, PLOTPIXEL_MASK(17, nMaskColour)); - CLIPPIXEL(18, StartX, PLOTPIXEL_MASK(18, nMaskColour)); - CLIPPIXEL(19, StartX, PLOTPIXEL_MASK(19, nMaskColour)); - CLIPPIXEL(20, StartX, PLOTPIXEL_MASK(20, nMaskColour)); - CLIPPIXEL(21, StartX, PLOTPIXEL_MASK(21, nMaskColour)); - CLIPPIXEL(22, StartX, PLOTPIXEL_MASK(22, nMaskColour)); - CLIPPIXEL(23, StartX, PLOTPIXEL_MASK(23, nMaskColour)); - CLIPPIXEL(24, StartX, PLOTPIXEL_MASK(24, nMaskColour)); - CLIPPIXEL(25, StartX, PLOTPIXEL_MASK(25, nMaskColour)); - CLIPPIXEL(26, StartX, PLOTPIXEL_MASK(26, nMaskColour)); - CLIPPIXEL(27, StartX, PLOTPIXEL_MASK(27, nMaskColour)); - CLIPPIXEL(28, StartX, PLOTPIXEL_MASK(28, nMaskColour)); - CLIPPIXEL(29, StartX, PLOTPIXEL_MASK(29, nMaskColour)); - CLIPPIXEL(30, StartX, PLOTPIXEL_MASK(30, nMaskColour)); - CLIPPIXEL(31, StartX, PLOTPIXEL_MASK(31, nMaskColour)); - } -} - -void Render32x32Tile_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Mask_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pTileData += 32) { - PLOTPIXEL_MASK_FLIPX(31, 0, nMaskColour); - PLOTPIXEL_MASK_FLIPX(30, 1, nMaskColour); - PLOTPIXEL_MASK_FLIPX(29, 2, nMaskColour); - PLOTPIXEL_MASK_FLIPX(28, 3, nMaskColour); - PLOTPIXEL_MASK_FLIPX(27, 4, nMaskColour); - PLOTPIXEL_MASK_FLIPX(26, 5, nMaskColour); - PLOTPIXEL_MASK_FLIPX(25, 6, nMaskColour); - PLOTPIXEL_MASK_FLIPX(24, 7, nMaskColour); - PLOTPIXEL_MASK_FLIPX(23, 8, nMaskColour); - PLOTPIXEL_MASK_FLIPX(22, 9, nMaskColour); - PLOTPIXEL_MASK_FLIPX(21, 10, nMaskColour); - PLOTPIXEL_MASK_FLIPX(20, 11, nMaskColour); - PLOTPIXEL_MASK_FLIPX(19, 12, nMaskColour); - PLOTPIXEL_MASK_FLIPX(18, 13, nMaskColour); - PLOTPIXEL_MASK_FLIPX(17, 14, nMaskColour); - PLOTPIXEL_MASK_FLIPX(16, 15, nMaskColour); - PLOTPIXEL_MASK_FLIPX(15, 16, nMaskColour); - PLOTPIXEL_MASK_FLIPX(14, 17, nMaskColour); - PLOTPIXEL_MASK_FLIPX(13, 18, nMaskColour); - PLOTPIXEL_MASK_FLIPX(12, 19, nMaskColour); - PLOTPIXEL_MASK_FLIPX(11, 20, nMaskColour); - PLOTPIXEL_MASK_FLIPX(10, 21, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 9, 22, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 8, 23, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 7, 24, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 6, 25, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 5, 26, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 4, 27, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 3, 28, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 2, 29, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 1, 30, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 0, 31, nMaskColour); - } -} - -void Render32x32Tile_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Mask_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(31, StartX, PLOTPIXEL_MASK_FLIPX(31, 0, nMaskColour)); - CLIPPIXEL(30, StartX, PLOTPIXEL_MASK_FLIPX(30, 1, nMaskColour)); - CLIPPIXEL(29, StartX, PLOTPIXEL_MASK_FLIPX(29, 2, nMaskColour)); - CLIPPIXEL(28, StartX, PLOTPIXEL_MASK_FLIPX(28, 3, nMaskColour)); - CLIPPIXEL(27, StartX, PLOTPIXEL_MASK_FLIPX(27, 4, nMaskColour)); - CLIPPIXEL(26, StartX, PLOTPIXEL_MASK_FLIPX(26, 5, nMaskColour)); - CLIPPIXEL(25, StartX, PLOTPIXEL_MASK_FLIPX(25, 6, nMaskColour)); - CLIPPIXEL(24, StartX, PLOTPIXEL_MASK_FLIPX(24, 7, nMaskColour)); - CLIPPIXEL(23, StartX, PLOTPIXEL_MASK_FLIPX(23, 8, nMaskColour)); - CLIPPIXEL(22, StartX, PLOTPIXEL_MASK_FLIPX(22, 9, nMaskColour)); - CLIPPIXEL(21, StartX, PLOTPIXEL_MASK_FLIPX(21, 10, nMaskColour)); - CLIPPIXEL(20, StartX, PLOTPIXEL_MASK_FLIPX(20, 11, nMaskColour)); - CLIPPIXEL(19, StartX, PLOTPIXEL_MASK_FLIPX(19, 12, nMaskColour)); - CLIPPIXEL(18, StartX, PLOTPIXEL_MASK_FLIPX(18, 13, nMaskColour)); - CLIPPIXEL(17, StartX, PLOTPIXEL_MASK_FLIPX(17, 14, nMaskColour)); - CLIPPIXEL(16, StartX, PLOTPIXEL_MASK_FLIPX(16, 15, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_MASK_FLIPX(15, 16, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_MASK_FLIPX(14, 17, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_MASK_FLIPX(13, 18, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_MASK_FLIPX(12, 19, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_MASK_FLIPX(11, 20, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_MASK_FLIPX(10, 21, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_MASK_FLIPX( 9, 22, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_MASK_FLIPX( 8, 23, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_MASK_FLIPX( 7, 24, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_MASK_FLIPX( 6, 25, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_MASK_FLIPX( 5, 26, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_MASK_FLIPX( 4, 27, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_MASK_FLIPX( 3, 28, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_MASK_FLIPX( 2, 29, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_MASK_FLIPX( 1, 30, nMaskColour)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_MASK_FLIPX( 0, 31, nMaskColour)); - } -} - -void Render32x32Tile_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Mask_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 32) { - PLOTPIXEL_MASK( 0, nMaskColour); - PLOTPIXEL_MASK( 1, nMaskColour); - PLOTPIXEL_MASK( 2, nMaskColour); - PLOTPIXEL_MASK( 3, nMaskColour); - PLOTPIXEL_MASK( 4, nMaskColour); - PLOTPIXEL_MASK( 5, nMaskColour); - PLOTPIXEL_MASK( 6, nMaskColour); - PLOTPIXEL_MASK( 7, nMaskColour); - PLOTPIXEL_MASK( 8, nMaskColour); - PLOTPIXEL_MASK( 9, nMaskColour); - PLOTPIXEL_MASK(10, nMaskColour); - PLOTPIXEL_MASK(11, nMaskColour); - PLOTPIXEL_MASK(12, nMaskColour); - PLOTPIXEL_MASK(13, nMaskColour); - PLOTPIXEL_MASK(14, nMaskColour); - PLOTPIXEL_MASK(15, nMaskColour); - PLOTPIXEL_MASK(16, nMaskColour); - PLOTPIXEL_MASK(17, nMaskColour); - PLOTPIXEL_MASK(18, nMaskColour); - PLOTPIXEL_MASK(19, nMaskColour); - PLOTPIXEL_MASK(20, nMaskColour); - PLOTPIXEL_MASK(21, nMaskColour); - PLOTPIXEL_MASK(22, nMaskColour); - PLOTPIXEL_MASK(23, nMaskColour); - PLOTPIXEL_MASK(24, nMaskColour); - PLOTPIXEL_MASK(25, nMaskColour); - PLOTPIXEL_MASK(26, nMaskColour); - PLOTPIXEL_MASK(27, nMaskColour); - PLOTPIXEL_MASK(28, nMaskColour); - PLOTPIXEL_MASK(29, nMaskColour); - PLOTPIXEL_MASK(30, nMaskColour); - PLOTPIXEL_MASK(31, nMaskColour); - } -} - -void Render32x32Tile_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Mask_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_MASK( 0, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_MASK( 1, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_MASK( 2, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_MASK( 3, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_MASK( 4, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_MASK( 5, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_MASK( 6, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_MASK( 7, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_MASK( 8, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_MASK( 9, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_MASK(10, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_MASK(11, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_MASK(12, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_MASK(13, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_MASK(14, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_MASK(15, nMaskColour)); - CLIPPIXEL(16, StartX, PLOTPIXEL_MASK(16, nMaskColour)); - CLIPPIXEL(17, StartX, PLOTPIXEL_MASK(17, nMaskColour)); - CLIPPIXEL(18, StartX, PLOTPIXEL_MASK(18, nMaskColour)); - CLIPPIXEL(19, StartX, PLOTPIXEL_MASK(19, nMaskColour)); - CLIPPIXEL(20, StartX, PLOTPIXEL_MASK(20, nMaskColour)); - CLIPPIXEL(21, StartX, PLOTPIXEL_MASK(21, nMaskColour)); - CLIPPIXEL(22, StartX, PLOTPIXEL_MASK(22, nMaskColour)); - CLIPPIXEL(23, StartX, PLOTPIXEL_MASK(23, nMaskColour)); - CLIPPIXEL(24, StartX, PLOTPIXEL_MASK(24, nMaskColour)); - CLIPPIXEL(25, StartX, PLOTPIXEL_MASK(25, nMaskColour)); - CLIPPIXEL(26, StartX, PLOTPIXEL_MASK(26, nMaskColour)); - CLIPPIXEL(27, StartX, PLOTPIXEL_MASK(27, nMaskColour)); - CLIPPIXEL(28, StartX, PLOTPIXEL_MASK(28, nMaskColour)); - CLIPPIXEL(29, StartX, PLOTPIXEL_MASK(29, nMaskColour)); - CLIPPIXEL(30, StartX, PLOTPIXEL_MASK(30, nMaskColour)); - CLIPPIXEL(31, StartX, PLOTPIXEL_MASK(31, nMaskColour)); - } -} - -void Render32x32Tile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Mask_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 32) { - PLOTPIXEL_MASK_FLIPX(31, 0, nMaskColour); - PLOTPIXEL_MASK_FLIPX(30, 1, nMaskColour); - PLOTPIXEL_MASK_FLIPX(29, 2, nMaskColour); - PLOTPIXEL_MASK_FLIPX(28, 3, nMaskColour); - PLOTPIXEL_MASK_FLIPX(27, 4, nMaskColour); - PLOTPIXEL_MASK_FLIPX(26, 5, nMaskColour); - PLOTPIXEL_MASK_FLIPX(25, 6, nMaskColour); - PLOTPIXEL_MASK_FLIPX(24, 7, nMaskColour); - PLOTPIXEL_MASK_FLIPX(23, 8, nMaskColour); - PLOTPIXEL_MASK_FLIPX(22, 9, nMaskColour); - PLOTPIXEL_MASK_FLIPX(21, 10, nMaskColour); - PLOTPIXEL_MASK_FLIPX(20, 11, nMaskColour); - PLOTPIXEL_MASK_FLIPX(19, 12, nMaskColour); - PLOTPIXEL_MASK_FLIPX(18, 13, nMaskColour); - PLOTPIXEL_MASK_FLIPX(17, 14, nMaskColour); - PLOTPIXEL_MASK_FLIPX(16, 15, nMaskColour); - PLOTPIXEL_MASK_FLIPX(15, 16, nMaskColour); - PLOTPIXEL_MASK_FLIPX(14, 17, nMaskColour); - PLOTPIXEL_MASK_FLIPX(13, 18, nMaskColour); - PLOTPIXEL_MASK_FLIPX(12, 19, nMaskColour); - PLOTPIXEL_MASK_FLIPX(11, 20, nMaskColour); - PLOTPIXEL_MASK_FLIPX(10, 21, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 9, 22, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 8, 23, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 7, 24, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 6, 25, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 5, 26, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 4, 27, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 3, 28, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 2, 29, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 1, 30, nMaskColour); - PLOTPIXEL_MASK_FLIPX( 0, 31, nMaskColour); - } -} - -void Render32x32Tile_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Mask_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(31, StartX, PLOTPIXEL_MASK_FLIPX(31, 0, nMaskColour)); - CLIPPIXEL(30, StartX, PLOTPIXEL_MASK_FLIPX(30, 1, nMaskColour)); - CLIPPIXEL(29, StartX, PLOTPIXEL_MASK_FLIPX(29, 2, nMaskColour)); - CLIPPIXEL(28, StartX, PLOTPIXEL_MASK_FLIPX(28, 3, nMaskColour)); - CLIPPIXEL(27, StartX, PLOTPIXEL_MASK_FLIPX(27, 4, nMaskColour)); - CLIPPIXEL(26, StartX, PLOTPIXEL_MASK_FLIPX(26, 5, nMaskColour)); - CLIPPIXEL(25, StartX, PLOTPIXEL_MASK_FLIPX(25, 6, nMaskColour)); - CLIPPIXEL(24, StartX, PLOTPIXEL_MASK_FLIPX(24, 7, nMaskColour)); - CLIPPIXEL(23, StartX, PLOTPIXEL_MASK_FLIPX(23, 8, nMaskColour)); - CLIPPIXEL(22, StartX, PLOTPIXEL_MASK_FLIPX(22, 9, nMaskColour)); - CLIPPIXEL(21, StartX, PLOTPIXEL_MASK_FLIPX(21, 10, nMaskColour)); - CLIPPIXEL(20, StartX, PLOTPIXEL_MASK_FLIPX(20, 11, nMaskColour)); - CLIPPIXEL(19, StartX, PLOTPIXEL_MASK_FLIPX(19, 12, nMaskColour)); - CLIPPIXEL(18, StartX, PLOTPIXEL_MASK_FLIPX(18, 13, nMaskColour)); - CLIPPIXEL(17, StartX, PLOTPIXEL_MASK_FLIPX(17, 14, nMaskColour)); - CLIPPIXEL(16, StartX, PLOTPIXEL_MASK_FLIPX(16, 15, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_MASK_FLIPX(15, 16, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_MASK_FLIPX(14, 17, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_MASK_FLIPX(13, 18, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_MASK_FLIPX(12, 19, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_MASK_FLIPX(11, 20, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_MASK_FLIPX(10, 21, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_MASK_FLIPX( 9, 22, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_MASK_FLIPX( 8, 23, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_MASK_FLIPX( 7, 24, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_MASK_FLIPX( 6, 25, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_MASK_FLIPX( 5, 26, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_MASK_FLIPX( 4, 27, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_MASK_FLIPX( 3, 28, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_MASK_FLIPX( 2, 29, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_MASK_FLIPX( 1, 30, nMaskColour)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_MASK_FLIPX( 0, 31, nMaskColour)); - } -} - -/*================================================================================================ -Custom Height and Width Functions -================================================================================================*/ - -void RenderCustomTile(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth ) | nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL(x); - } - } -} - -void RenderCustomTile_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL(x)); - } - } -} - -void RenderCustomTile_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_FLIPX(nWidth - x - 1, x); - } - } -} - -void RenderCustomTile_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_FLIPX(nWidth - x - 1, x)); - } - } -} - -void RenderCustomTile_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL(x); - } - } -} - -void RenderCustomTile_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL(x)); - } - } -} - -void RenderCustomTile_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_FLIPX(nWidth - x - 1, x); - } - } -} - -void RenderCustomTile_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_FLIPX(nWidth - x - 1, x)); - } - } -} - -/*================================================================================================ -Custom Height and Width Functions with Masking -================================================================================================*/ - -void RenderCustomTile_Mask(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Mask called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_MASK(x, nMaskColour); - } - } -} - -void RenderCustomTile_Mask_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Mask_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL_MASK(x, nMaskColour)); - } - } -} - -void RenderCustomTile_Mask_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Mask_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_MASK_FLIPX(nWidth - x - 1, x, nMaskColour); - } - } -} - -void RenderCustomTile_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Mask_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_MASK_FLIPX(nWidth - x - 1, x, nMaskColour)); - } - } -} - -void RenderCustomTile_Mask_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Mask_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_MASK(x, nMaskColour); - } - } -} - -void RenderCustomTile_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Mask_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL_MASK(x, nMaskColour)); - } - } -} - -void RenderCustomTile_Mask_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Mask_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_MASK_FLIPX(nWidth - x - 1, x, nMaskColour); - } - } -} - -void RenderCustomTile_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Mask_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_MASK_FLIPX(nWidth - x - 1, x, nMaskColour)); - } - } -} - - - -void Render8x8Tile_Prio(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth ) | nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 8) { - PLOTPIXEL_PRIO(0); - PLOTPIXEL_PRIO(1); - PLOTPIXEL_PRIO(2); - PLOTPIXEL_PRIO(3); - PLOTPIXEL_PRIO(4); - PLOTPIXEL_PRIO(5); - PLOTPIXEL_PRIO(6); - PLOTPIXEL_PRIO(7); - } -} - -void Render8x8Tile_Prio_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(0, StartX, PLOTPIXEL_PRIO(0)); - CLIPPIXEL(1, StartX, PLOTPIXEL_PRIO(1)); - CLIPPIXEL(2, StartX, PLOTPIXEL_PRIO(2)); - CLIPPIXEL(3, StartX, PLOTPIXEL_PRIO(3)); - CLIPPIXEL(4, StartX, PLOTPIXEL_PRIO(4)); - CLIPPIXEL(5, StartX, PLOTPIXEL_PRIO(5)); - CLIPPIXEL(6, StartX, PLOTPIXEL_PRIO(6)); - CLIPPIXEL(7, StartX, PLOTPIXEL_PRIO(7)); - } -} - -void Render8x8Tile_Prio_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 8) { - PLOTPIXEL_PRIO_FLIPX(7, 0); - PLOTPIXEL_PRIO_FLIPX(6, 1); - PLOTPIXEL_PRIO_FLIPX(5, 2); - PLOTPIXEL_PRIO_FLIPX(4, 3); - PLOTPIXEL_PRIO_FLIPX(3, 4); - PLOTPIXEL_PRIO_FLIPX(2, 5); - PLOTPIXEL_PRIO_FLIPX(1, 6); - PLOTPIXEL_PRIO_FLIPX(0, 7); - } -} - -void Render8x8Tile_Prio_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(7, StartX, PLOTPIXEL_PRIO_FLIPX(7, 0)); - CLIPPIXEL(6, StartX, PLOTPIXEL_PRIO_FLIPX(6, 1)); - CLIPPIXEL(5, StartX, PLOTPIXEL_PRIO_FLIPX(5, 2)); - CLIPPIXEL(4, StartX, PLOTPIXEL_PRIO_FLIPX(4, 3)); - CLIPPIXEL(3, StartX, PLOTPIXEL_PRIO_FLIPX(3, 4)); - CLIPPIXEL(2, StartX, PLOTPIXEL_PRIO_FLIPX(2, 5)); - CLIPPIXEL(1, StartX, PLOTPIXEL_PRIO_FLIPX(1, 6)); - CLIPPIXEL(0, StartX, PLOTPIXEL_PRIO_FLIPX(0, 7)); - } -} - -void Render8x8Tile_Prio_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 8) { - PLOTPIXEL_PRIO(0); - PLOTPIXEL_PRIO(1); - PLOTPIXEL_PRIO(2); - PLOTPIXEL_PRIO(3); - PLOTPIXEL_PRIO(4); - PLOTPIXEL_PRIO(5); - PLOTPIXEL_PRIO(6); - PLOTPIXEL_PRIO(7); - } -} - -void Render8x8Tile_Prio_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(0, StartX, PLOTPIXEL_PRIO(0)); - CLIPPIXEL(1, StartX, PLOTPIXEL_PRIO(1)); - CLIPPIXEL(2, StartX, PLOTPIXEL_PRIO(2)); - CLIPPIXEL(3, StartX, PLOTPIXEL_PRIO(3)); - CLIPPIXEL(4, StartX, PLOTPIXEL_PRIO(4)); - CLIPPIXEL(5, StartX, PLOTPIXEL_PRIO(5)); - CLIPPIXEL(6, StartX, PLOTPIXEL_PRIO(6)); - CLIPPIXEL(7, StartX, PLOTPIXEL_PRIO(7)); - } -} - -void Render8x8Tile_Prio_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 8) { - PLOTPIXEL_PRIO_FLIPX(7, 0); - PLOTPIXEL_PRIO_FLIPX(6, 1); - PLOTPIXEL_PRIO_FLIPX(5, 2); - PLOTPIXEL_PRIO_FLIPX(4, 3); - PLOTPIXEL_PRIO_FLIPX(3, 4); - PLOTPIXEL_PRIO_FLIPX(2, 5); - PLOTPIXEL_PRIO_FLIPX(1, 6); - PLOTPIXEL_PRIO_FLIPX(0, 7); - } -} - -void Render8x8Tile_Prio_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw+ ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(7, StartX, PLOTPIXEL_PRIO_FLIPX(7, 0)); - CLIPPIXEL(6, StartX, PLOTPIXEL_PRIO_FLIPX(6, 1)); - CLIPPIXEL(5, StartX, PLOTPIXEL_PRIO_FLIPX(5, 2)); - CLIPPIXEL(4, StartX, PLOTPIXEL_PRIO_FLIPX(4, 3)); - CLIPPIXEL(3, StartX, PLOTPIXEL_PRIO_FLIPX(3, 4)); - CLIPPIXEL(2, StartX, PLOTPIXEL_PRIO_FLIPX(2, 5)); - CLIPPIXEL(1, StartX, PLOTPIXEL_PRIO_FLIPX(1, 6)); - CLIPPIXEL(0, StartX, PLOTPIXEL_PRIO_FLIPX(0, 7)); - } -} - -/*================================================================================================ -8 x 8 Functions with Masking -================================================================================================*/ - -void Render8x8Tile_Prio_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_Mask called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 8) { - PLOTPIXEL_PRIO_MASK(0, nMaskColour); - PLOTPIXEL_PRIO_MASK(1, nMaskColour); - PLOTPIXEL_PRIO_MASK(2, nMaskColour); - PLOTPIXEL_PRIO_MASK(3, nMaskColour); - PLOTPIXEL_PRIO_MASK(4, nMaskColour); - PLOTPIXEL_PRIO_MASK(5, nMaskColour); - PLOTPIXEL_PRIO_MASK(6, nMaskColour); - PLOTPIXEL_PRIO_MASK(7, nMaskColour); - } -} - -void Render8x8Tile_Prio_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_Mask_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(0, StartX, PLOTPIXEL_PRIO_MASK(0, nMaskColour)); - CLIPPIXEL(1, StartX, PLOTPIXEL_PRIO_MASK(1, nMaskColour)); - CLIPPIXEL(2, StartX, PLOTPIXEL_PRIO_MASK(2, nMaskColour)); - CLIPPIXEL(3, StartX, PLOTPIXEL_PRIO_MASK(3, nMaskColour)); - CLIPPIXEL(4, StartX, PLOTPIXEL_PRIO_MASK(4, nMaskColour)); - CLIPPIXEL(5, StartX, PLOTPIXEL_PRIO_MASK(5, nMaskColour)); - CLIPPIXEL(6, StartX, PLOTPIXEL_PRIO_MASK(6, nMaskColour)); - CLIPPIXEL(7, StartX, PLOTPIXEL_PRIO_MASK(7, nMaskColour)); - } -} - -void Render8x8Tile_Prio_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_Mask_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 8) { - PLOTPIXEL_PRIO_MASK_FLIPX(7, 0, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(6, 1, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(5, 2, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(4, 3, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(3, 4, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(2, 5, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(1, 6, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(0, 7, nMaskColour); - } -} - -void Render8x8Tile_Prio_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_Mask_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 8; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(7, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(7, 0, nMaskColour)); - CLIPPIXEL(6, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(6, 1, nMaskColour)); - CLIPPIXEL(5, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(5, 2, nMaskColour)); - CLIPPIXEL(4, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(4, 3, nMaskColour)); - CLIPPIXEL(3, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(3, 4, nMaskColour)); - CLIPPIXEL(2, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(2, 5, nMaskColour)); - CLIPPIXEL(1, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(1, 6, nMaskColour)); - CLIPPIXEL(0, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(0, 7, nMaskColour)); - } -} - -void Render8x8Tile_Prio_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_Mask_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 8) { - PLOTPIXEL_PRIO_MASK(0, nMaskColour); - PLOTPIXEL_PRIO_MASK(1, nMaskColour); - PLOTPIXEL_PRIO_MASK(2, nMaskColour); - PLOTPIXEL_PRIO_MASK(3, nMaskColour); - PLOTPIXEL_PRIO_MASK(4, nMaskColour); - PLOTPIXEL_PRIO_MASK(5, nMaskColour); - PLOTPIXEL_PRIO_MASK(6, nMaskColour); - PLOTPIXEL_PRIO_MASK(7, nMaskColour); - } -} - -void Render8x8Tile_Prio_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_Mask_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(0, StartX, PLOTPIXEL_PRIO_MASK(0, nMaskColour)); - CLIPPIXEL(1, StartX, PLOTPIXEL_PRIO_MASK(1, nMaskColour)); - CLIPPIXEL(2, StartX, PLOTPIXEL_PRIO_MASK(2, nMaskColour)); - CLIPPIXEL(3, StartX, PLOTPIXEL_PRIO_MASK(3, nMaskColour)); - CLIPPIXEL(4, StartX, PLOTPIXEL_PRIO_MASK(4, nMaskColour)); - CLIPPIXEL(5, StartX, PLOTPIXEL_PRIO_MASK(5, nMaskColour)); - CLIPPIXEL(6, StartX, PLOTPIXEL_PRIO_MASK(6, nMaskColour)); - CLIPPIXEL(7, StartX, PLOTPIXEL_PRIO_MASK(7, nMaskColour)); - } -} - -void Render8x8Tile_Prio_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_Mask_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 8) { - PLOTPIXEL_PRIO_MASK_FLIPX(7, 0, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(6, 1, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(5, 2, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(4, 3, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(3, 4, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(2, 5, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(1, 6, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(0, 7, nMaskColour); - } -} - -void Render8x8Tile_Prio_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render8x8Tile_Prio_Mask_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 6); - - UINT16* pPixel = pDestDraw + ((StartY + 7) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 7) * nScreenWidth) + StartX; - - for (INT32 y = 7; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 8) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(7, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(7, 0, nMaskColour)); - CLIPPIXEL(6, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(6, 1, nMaskColour)); - CLIPPIXEL(5, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(5, 2, nMaskColour)); - CLIPPIXEL(4, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(4, 3, nMaskColour)); - CLIPPIXEL(3, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(3, 4, nMaskColour)); - CLIPPIXEL(2, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(2, 5, nMaskColour)); - CLIPPIXEL(1, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(1, 6, nMaskColour)); - CLIPPIXEL(0, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(0, 7, nMaskColour)); - } -} - -/*================================================================================================ -16 x 16 Functions -================================================================================================*/ - -void Render16x16Tile_Prio(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 16) { - PLOTPIXEL_PRIO( 0); - PLOTPIXEL_PRIO( 1); - PLOTPIXEL_PRIO( 2); - PLOTPIXEL_PRIO( 3); - PLOTPIXEL_PRIO( 4); - PLOTPIXEL_PRIO( 5); - PLOTPIXEL_PRIO( 6); - PLOTPIXEL_PRIO( 7); - PLOTPIXEL_PRIO( 8); - PLOTPIXEL_PRIO( 9); - PLOTPIXEL_PRIO(10); - PLOTPIXEL_PRIO(11); - PLOTPIXEL_PRIO(12); - PLOTPIXEL_PRIO(13); - PLOTPIXEL_PRIO(14); - PLOTPIXEL_PRIO(15); - } -} - -void Render16x16Tile_Prio_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO( 0)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO( 1)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO( 2)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO( 3)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO( 4)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO( 5)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO( 6)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO( 7)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO( 8)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO( 9)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO(10)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO(11)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO(12)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO(13)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO(14)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO(15)); - } -} - -void Render16x16Tile_Prio_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 16) { - PLOTPIXEL_PRIO_FLIPX(15, 0); - PLOTPIXEL_PRIO_FLIPX(14, 1); - PLOTPIXEL_PRIO_FLIPX(13, 2); - PLOTPIXEL_PRIO_FLIPX(12, 3); - PLOTPIXEL_PRIO_FLIPX(11, 4); - PLOTPIXEL_PRIO_FLIPX(10, 5); - PLOTPIXEL_PRIO_FLIPX( 9, 6); - PLOTPIXEL_PRIO_FLIPX( 8, 7); - PLOTPIXEL_PRIO_FLIPX( 7, 8); - PLOTPIXEL_PRIO_FLIPX( 6, 9); - PLOTPIXEL_PRIO_FLIPX( 5, 10); - PLOTPIXEL_PRIO_FLIPX( 4, 11); - PLOTPIXEL_PRIO_FLIPX( 3, 12); - PLOTPIXEL_PRIO_FLIPX( 2, 13); - PLOTPIXEL_PRIO_FLIPX( 1, 14); - PLOTPIXEL_PRIO_FLIPX( 0, 15); - } -} - -void Render16x16Tile_Prio_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_FLIPX(15, 0)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_FLIPX(14, 1)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_FLIPX(13, 2)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_FLIPX(12, 3)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_FLIPX(11, 4)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_FLIPX(10, 5)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_FLIPX( 9, 6)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_FLIPX( 8, 7)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_FLIPX( 7, 8)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_FLIPX( 6, 9)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_FLIPX( 5, 10)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_FLIPX( 4, 11)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_FLIPX( 3, 12)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_FLIPX( 2, 13)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_FLIPX( 1, 14)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_FLIPX( 0, 15)); - } -} - -void Render16x16Tile_Prio_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 16) { - PLOTPIXEL_PRIO( 0); - PLOTPIXEL_PRIO( 1); - PLOTPIXEL_PRIO( 2); - PLOTPIXEL_PRIO( 3); - PLOTPIXEL_PRIO( 4); - PLOTPIXEL_PRIO( 5); - PLOTPIXEL_PRIO( 6); - PLOTPIXEL_PRIO( 7); - PLOTPIXEL_PRIO( 8); - PLOTPIXEL_PRIO( 9); - PLOTPIXEL_PRIO(10); - PLOTPIXEL_PRIO(11); - PLOTPIXEL_PRIO(12); - PLOTPIXEL_PRIO(13); - PLOTPIXEL_PRIO(14); - PLOTPIXEL_PRIO(15); - } -} - -void Render16x16Tile_Prio_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO( 0)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO( 1)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO( 2)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO( 3)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO( 4)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO( 5)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO( 6)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO( 7)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO( 8)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO( 9)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO(10)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO(11)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO(12)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO(13)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO(14)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO(15)); - } -} - -void Render16x16Tile_Prio_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 16) { - PLOTPIXEL_PRIO_FLIPX(15, 0); - PLOTPIXEL_PRIO_FLIPX(14, 1); - PLOTPIXEL_PRIO_FLIPX(13, 2); - PLOTPIXEL_PRIO_FLIPX(12, 3); - PLOTPIXEL_PRIO_FLIPX(11, 4); - PLOTPIXEL_PRIO_FLIPX(10, 5); - PLOTPIXEL_PRIO_FLIPX( 9, 6); - PLOTPIXEL_PRIO_FLIPX( 8, 7); - PLOTPIXEL_PRIO_FLIPX( 7, 8); - PLOTPIXEL_PRIO_FLIPX( 6, 9); - PLOTPIXEL_PRIO_FLIPX( 5, 10); - PLOTPIXEL_PRIO_FLIPX( 4, 11); - PLOTPIXEL_PRIO_FLIPX( 3, 12); - PLOTPIXEL_PRIO_FLIPX( 2, 13); - PLOTPIXEL_PRIO_FLIPX( 1, 14); - PLOTPIXEL_PRIO_FLIPX( 0, 15); - } -} - -void Render16x16Tile_Prio_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_FLIPX(15, 0)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_FLIPX(14, 1)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_FLIPX(13, 2)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_FLIPX(12, 3)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_FLIPX(11, 4)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_FLIPX(10, 5)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_FLIPX( 9, 6)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_FLIPX( 8, 7)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_FLIPX( 7, 8)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_FLIPX( 6, 9)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_FLIPX( 5, 10)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_FLIPX( 4, 11)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_FLIPX( 3, 12)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_FLIPX( 2, 13)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_FLIPX( 1, 14)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_FLIPX( 0, 15)); - } -} - -/*================================================================================================ -16 x 16 Functions with Masking -================================================================================================*/ - -void Render16x16Tile_Prio_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_Mask called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 16) { - PLOTPIXEL_PRIO_MASK( 0, nMaskColour); - PLOTPIXEL_PRIO_MASK( 1, nMaskColour); - PLOTPIXEL_PRIO_MASK( 2, nMaskColour); - PLOTPIXEL_PRIO_MASK( 3, nMaskColour); - PLOTPIXEL_PRIO_MASK( 4, nMaskColour); - PLOTPIXEL_PRIO_MASK( 5, nMaskColour); - PLOTPIXEL_PRIO_MASK( 6, nMaskColour); - PLOTPIXEL_PRIO_MASK( 7, nMaskColour); - PLOTPIXEL_PRIO_MASK( 8, nMaskColour); - PLOTPIXEL_PRIO_MASK( 9, nMaskColour); - PLOTPIXEL_PRIO_MASK(10, nMaskColour); - PLOTPIXEL_PRIO_MASK(11, nMaskColour); - PLOTPIXEL_PRIO_MASK(12, nMaskColour); - PLOTPIXEL_PRIO_MASK(13, nMaskColour); - PLOTPIXEL_PRIO_MASK(14, nMaskColour); - PLOTPIXEL_PRIO_MASK(15, nMaskColour); - } -} - -void Render16x16Tile_Prio_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_Mask_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_MASK( 0, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_MASK( 1, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_MASK( 2, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_MASK( 3, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_MASK( 4, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_MASK( 5, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_MASK( 6, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_MASK( 7, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_MASK( 8, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_MASK( 9, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_MASK(10, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_MASK(11, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_MASK(12, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_MASK(13, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_MASK(14, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_MASK(15, nMaskColour)); - } -} - -void Render16x16Tile_Prio_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_Mask_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 16) { - PLOTPIXEL_PRIO_MASK_FLIPX(15, 0, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(14, 1, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(13, 2, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(12, 3, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(11, 4, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(10, 5, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 9, 6, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 8, 7, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 7, 8, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 6, 9, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 5, 10, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 4, 11, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 3, 12, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 2, 13, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 1, 14, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 0, 15, nMaskColour); - } -} - -void Render16x16Tile_Prio_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_Mask_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 16; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(15, 0, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(14, 1, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(13, 2, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(12, 3, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(11, 4, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(10, 5, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 9, 6, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 8, 7, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 7, 8, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 6, 9, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 5, 10, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 4, 11, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 3, 12, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 2, 13, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 1, 14, nMaskColour)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 0, 15, nMaskColour)); - } -} - -void Render16x16Tile_Prio_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_Mask_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 16) { - PLOTPIXEL_PRIO_MASK( 0, nMaskColour); - PLOTPIXEL_PRIO_MASK( 1, nMaskColour); - PLOTPIXEL_PRIO_MASK( 2, nMaskColour); - PLOTPIXEL_PRIO_MASK( 3, nMaskColour); - PLOTPIXEL_PRIO_MASK( 4, nMaskColour); - PLOTPIXEL_PRIO_MASK( 5, nMaskColour); - PLOTPIXEL_PRIO_MASK( 6, nMaskColour); - PLOTPIXEL_PRIO_MASK( 7, nMaskColour); - PLOTPIXEL_PRIO_MASK( 8, nMaskColour); - PLOTPIXEL_PRIO_MASK( 9, nMaskColour); - PLOTPIXEL_PRIO_MASK(10, nMaskColour); - PLOTPIXEL_PRIO_MASK(11, nMaskColour); - PLOTPIXEL_PRIO_MASK(12, nMaskColour); - PLOTPIXEL_PRIO_MASK(13, nMaskColour); - PLOTPIXEL_PRIO_MASK(14, nMaskColour); - PLOTPIXEL_PRIO_MASK(15, nMaskColour); - } -} - -void Render16x16Tile_Prio_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_Mask_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_MASK( 0, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_MASK( 1, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_MASK( 2, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_MASK( 3, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_MASK( 4, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_MASK( 5, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_MASK( 6, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_MASK( 7, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_MASK( 8, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_MASK( 9, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_MASK(10, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_MASK(11, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_MASK(12, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_MASK(13, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_MASK(14, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_MASK(15, nMaskColour)); - } -} - -void Render16x16Tile_Prio_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_Mask_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 16) { - PLOTPIXEL_PRIO_MASK_FLIPX(15, 0, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(14, 1, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(13, 2, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(12, 3, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(11, 4, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(10, 5, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 9, 6, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 8, 7, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 7, 8, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 6, 9, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 5, 10, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 4, 11, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 3, 12, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 2, 13, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 1, 14, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 0, 15, nMaskColour); - } -} - -void Render16x16Tile_Prio_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render16x16Tile_Prio_Mask_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 8); - - UINT16* pPixel = pDestDraw + ((StartY + 15) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 15) * nScreenWidth) + StartX; - - for (INT32 y = 15; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 16) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(15, 0, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(14, 1, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(13, 2, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(12, 3, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(11, 4, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(10, 5, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 9, 6, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 8, 7, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 7, 8, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 6, 9, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 5, 10, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 4, 11, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 3, 12, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 2, 13, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 1, 14, nMaskColour)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 0, 15, nMaskColour)); - } -} - -/*================================================================================================ -32 x 32 Functions -================================================================================================*/ - -void Render32x32Tile_Prio(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 32) { - PLOTPIXEL_PRIO( 0); - PLOTPIXEL_PRIO( 1); - PLOTPIXEL_PRIO( 2); - PLOTPIXEL_PRIO( 3); - PLOTPIXEL_PRIO( 4); - PLOTPIXEL_PRIO( 5); - PLOTPIXEL_PRIO( 6); - PLOTPIXEL_PRIO( 7); - PLOTPIXEL_PRIO( 8); - PLOTPIXEL_PRIO( 9); - PLOTPIXEL_PRIO(10); - PLOTPIXEL_PRIO(11); - PLOTPIXEL_PRIO(12); - PLOTPIXEL_PRIO(13); - PLOTPIXEL_PRIO(14); - PLOTPIXEL_PRIO(15); - PLOTPIXEL_PRIO(16); - PLOTPIXEL_PRIO(17); - PLOTPIXEL_PRIO(18); - PLOTPIXEL_PRIO(19); - PLOTPIXEL_PRIO(20); - PLOTPIXEL_PRIO(21); - PLOTPIXEL_PRIO(22); - PLOTPIXEL_PRIO(23); - PLOTPIXEL_PRIO(24); - PLOTPIXEL_PRIO(25); - PLOTPIXEL_PRIO(26); - PLOTPIXEL_PRIO(27); - PLOTPIXEL_PRIO(28); - PLOTPIXEL_PRIO(29); - PLOTPIXEL_PRIO(30); - PLOTPIXEL_PRIO(31); - } -} - -void Render32x32Tile_Prio_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO( 0)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO( 1)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO( 2)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO( 3)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO( 4)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO( 5)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO( 6)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO( 7)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO( 8)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO( 9)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO(10)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO(11)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO(12)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO(13)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO(14)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO(15)); - CLIPPIXEL(16, StartX, PLOTPIXEL_PRIO(16)); - CLIPPIXEL(17, StartX, PLOTPIXEL_PRIO(17)); - CLIPPIXEL(18, StartX, PLOTPIXEL_PRIO(18)); - CLIPPIXEL(19, StartX, PLOTPIXEL_PRIO(19)); - CLIPPIXEL(20, StartX, PLOTPIXEL_PRIO(20)); - CLIPPIXEL(21, StartX, PLOTPIXEL_PRIO(21)); - CLIPPIXEL(22, StartX, PLOTPIXEL_PRIO(22)); - CLIPPIXEL(23, StartX, PLOTPIXEL_PRIO(23)); - CLIPPIXEL(24, StartX, PLOTPIXEL_PRIO(24)); - CLIPPIXEL(25, StartX, PLOTPIXEL_PRIO(25)); - CLIPPIXEL(26, StartX, PLOTPIXEL_PRIO(26)); - CLIPPIXEL(27, StartX, PLOTPIXEL_PRIO(27)); - CLIPPIXEL(28, StartX, PLOTPIXEL_PRIO(28)); - CLIPPIXEL(29, StartX, PLOTPIXEL_PRIO(29)); - CLIPPIXEL(30, StartX, PLOTPIXEL_PRIO(30)); - CLIPPIXEL(31, StartX, PLOTPIXEL_PRIO(31)); - } -} - -void Render32x32Tile_Prio_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 32) { - PLOTPIXEL_PRIO_FLIPX(31, 0); - PLOTPIXEL_PRIO_FLIPX(30, 1); - PLOTPIXEL_PRIO_FLIPX(29, 2); - PLOTPIXEL_PRIO_FLIPX(28, 3); - PLOTPIXEL_PRIO_FLIPX(27, 4); - PLOTPIXEL_PRIO_FLIPX(26, 5); - PLOTPIXEL_PRIO_FLIPX(25, 6); - PLOTPIXEL_PRIO_FLIPX(24, 7); - PLOTPIXEL_PRIO_FLIPX(23, 8); - PLOTPIXEL_PRIO_FLIPX(22, 9); - PLOTPIXEL_PRIO_FLIPX(21, 10); - PLOTPIXEL_PRIO_FLIPX(20, 11); - PLOTPIXEL_PRIO_FLIPX(19, 12); - PLOTPIXEL_PRIO_FLIPX(18, 13); - PLOTPIXEL_PRIO_FLIPX(17, 14); - PLOTPIXEL_PRIO_FLIPX(16, 15); - PLOTPIXEL_PRIO_FLIPX(15, 16); - PLOTPIXEL_PRIO_FLIPX(14, 17); - PLOTPIXEL_PRIO_FLIPX(13, 18); - PLOTPIXEL_PRIO_FLIPX(12, 19); - PLOTPIXEL_PRIO_FLIPX(11, 20); - PLOTPIXEL_PRIO_FLIPX(10, 21); - PLOTPIXEL_PRIO_FLIPX( 9, 22); - PLOTPIXEL_PRIO_FLIPX( 8, 23); - PLOTPIXEL_PRIO_FLIPX( 7, 24); - PLOTPIXEL_PRIO_FLIPX( 6, 25); - PLOTPIXEL_PRIO_FLIPX( 5, 26); - PLOTPIXEL_PRIO_FLIPX( 4, 27); - PLOTPIXEL_PRIO_FLIPX( 3, 28); - PLOTPIXEL_PRIO_FLIPX( 2, 29); - PLOTPIXEL_PRIO_FLIPX( 1, 30); - PLOTPIXEL_PRIO_FLIPX( 0, 31); - } -} - -void Render32x32Tile_Prio_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(31, StartX, PLOTPIXEL_PRIO_FLIPX(31, 0)); - CLIPPIXEL(30, StartX, PLOTPIXEL_PRIO_FLIPX(30, 1)); - CLIPPIXEL(29, StartX, PLOTPIXEL_PRIO_FLIPX(29, 2)); - CLIPPIXEL(28, StartX, PLOTPIXEL_PRIO_FLIPX(28, 3)); - CLIPPIXEL(27, StartX, PLOTPIXEL_PRIO_FLIPX(27, 4)); - CLIPPIXEL(26, StartX, PLOTPIXEL_PRIO_FLIPX(26, 5)); - CLIPPIXEL(25, StartX, PLOTPIXEL_PRIO_FLIPX(25, 6)); - CLIPPIXEL(24, StartX, PLOTPIXEL_PRIO_FLIPX(24, 7)); - CLIPPIXEL(23, StartX, PLOTPIXEL_PRIO_FLIPX(23, 8)); - CLIPPIXEL(22, StartX, PLOTPIXEL_PRIO_FLIPX(22, 9)); - CLIPPIXEL(21, StartX, PLOTPIXEL_PRIO_FLIPX(21, 10)); - CLIPPIXEL(20, StartX, PLOTPIXEL_PRIO_FLIPX(20, 11)); - CLIPPIXEL(19, StartX, PLOTPIXEL_PRIO_FLIPX(19, 12)); - CLIPPIXEL(18, StartX, PLOTPIXEL_PRIO_FLIPX(18, 13)); - CLIPPIXEL(17, StartX, PLOTPIXEL_PRIO_FLIPX(17, 14)); - CLIPPIXEL(16, StartX, PLOTPIXEL_PRIO_FLIPX(16, 15)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_FLIPX(15, 16)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_FLIPX(14, 17)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_FLIPX(13, 18)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_FLIPX(12, 19)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_FLIPX(11, 20)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_FLIPX(10, 21)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_FLIPX( 9, 22)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_FLIPX( 8, 23)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_FLIPX( 7, 24)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_FLIPX( 6, 25)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_FLIPX( 5, 26)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_FLIPX( 4, 27)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_FLIPX( 3, 28)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_FLIPX( 2, 29)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_FLIPX( 1, 30)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_FLIPX( 0, 31)); - } -} - -void Render32x32Tile_Prio_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 32) { - PLOTPIXEL_PRIO( 0); - PLOTPIXEL_PRIO( 1); - PLOTPIXEL_PRIO( 2); - PLOTPIXEL_PRIO( 3); - PLOTPIXEL_PRIO( 4); - PLOTPIXEL_PRIO( 5); - PLOTPIXEL_PRIO( 6); - PLOTPIXEL_PRIO( 7); - PLOTPIXEL_PRIO( 8); - PLOTPIXEL_PRIO( 9); - PLOTPIXEL_PRIO(10); - PLOTPIXEL_PRIO(11); - PLOTPIXEL_PRIO(12); - PLOTPIXEL_PRIO(13); - PLOTPIXEL_PRIO(14); - PLOTPIXEL_PRIO(15); - PLOTPIXEL_PRIO(16); - PLOTPIXEL_PRIO(17); - PLOTPIXEL_PRIO(18); - PLOTPIXEL_PRIO(19); - PLOTPIXEL_PRIO(20); - PLOTPIXEL_PRIO(21); - PLOTPIXEL_PRIO(22); - PLOTPIXEL_PRIO(23); - PLOTPIXEL_PRIO(24); - PLOTPIXEL_PRIO(25); - PLOTPIXEL_PRIO(26); - PLOTPIXEL_PRIO(27); - PLOTPIXEL_PRIO(28); - PLOTPIXEL_PRIO(29); - PLOTPIXEL_PRIO(30); - PLOTPIXEL_PRIO(31); - } -} - -void Render32x32Tile_Prio_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO( 0)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO( 1)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO( 2)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO( 3)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO( 4)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO( 5)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO( 6)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO( 7)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO( 8)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO( 9)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO(10)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO(11)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO(12)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO(13)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO(14)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO(15)); - CLIPPIXEL(16, StartX, PLOTPIXEL_PRIO(16)); - CLIPPIXEL(17, StartX, PLOTPIXEL_PRIO(17)); - CLIPPIXEL(18, StartX, PLOTPIXEL_PRIO(18)); - CLIPPIXEL(19, StartX, PLOTPIXEL_PRIO(19)); - CLIPPIXEL(20, StartX, PLOTPIXEL_PRIO(20)); - CLIPPIXEL(21, StartX, PLOTPIXEL_PRIO(21)); - CLIPPIXEL(22, StartX, PLOTPIXEL_PRIO(22)); - CLIPPIXEL(23, StartX, PLOTPIXEL_PRIO(23)); - CLIPPIXEL(24, StartX, PLOTPIXEL_PRIO(24)); - CLIPPIXEL(25, StartX, PLOTPIXEL_PRIO(25)); - CLIPPIXEL(26, StartX, PLOTPIXEL_PRIO(26)); - CLIPPIXEL(27, StartX, PLOTPIXEL_PRIO(27)); - CLIPPIXEL(28, StartX, PLOTPIXEL_PRIO(28)); - CLIPPIXEL(29, StartX, PLOTPIXEL_PRIO(29)); - CLIPPIXEL(30, StartX, PLOTPIXEL_PRIO(30)); - CLIPPIXEL(31, StartX, PLOTPIXEL_PRIO(31)); - } -} - -void Render32x32Tile_Prio_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 32) { - PLOTPIXEL_PRIO_FLIPX(31, 0); - PLOTPIXEL_PRIO_FLIPX(30, 1); - PLOTPIXEL_PRIO_FLIPX(29, 2); - PLOTPIXEL_PRIO_FLIPX(28, 3); - PLOTPIXEL_PRIO_FLIPX(27, 4); - PLOTPIXEL_PRIO_FLIPX(26, 5); - PLOTPIXEL_PRIO_FLIPX(25, 6); - PLOTPIXEL_PRIO_FLIPX(24, 7); - PLOTPIXEL_PRIO_FLIPX(23, 8); - PLOTPIXEL_PRIO_FLIPX(22, 9); - PLOTPIXEL_PRIO_FLIPX(21, 10); - PLOTPIXEL_PRIO_FLIPX(20, 11); - PLOTPIXEL_PRIO_FLIPX(19, 12); - PLOTPIXEL_PRIO_FLIPX(18, 13); - PLOTPIXEL_PRIO_FLIPX(17, 14); - PLOTPIXEL_PRIO_FLIPX(16, 15); - PLOTPIXEL_PRIO_FLIPX(15, 16); - PLOTPIXEL_PRIO_FLIPX(14, 17); - PLOTPIXEL_PRIO_FLIPX(13, 18); - PLOTPIXEL_PRIO_FLIPX(12, 19); - PLOTPIXEL_PRIO_FLIPX(11, 20); - PLOTPIXEL_PRIO_FLIPX(10, 21); - PLOTPIXEL_PRIO_FLIPX( 9, 22); - PLOTPIXEL_PRIO_FLIPX( 8, 23); - PLOTPIXEL_PRIO_FLIPX( 7, 24); - PLOTPIXEL_PRIO_FLIPX( 6, 25); - PLOTPIXEL_PRIO_FLIPX( 5, 26); - PLOTPIXEL_PRIO_FLIPX( 4, 27); - PLOTPIXEL_PRIO_FLIPX( 3, 28); - PLOTPIXEL_PRIO_FLIPX( 2, 29); - PLOTPIXEL_PRIO_FLIPX( 1, 30); - PLOTPIXEL_PRIO_FLIPX( 0, 31); - } -} - -void Render32x32Tile_Prio_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(31, StartX, PLOTPIXEL_PRIO_FLIPX(31, 0)); - CLIPPIXEL(30, StartX, PLOTPIXEL_PRIO_FLIPX(30, 1)); - CLIPPIXEL(29, StartX, PLOTPIXEL_PRIO_FLIPX(29, 2)); - CLIPPIXEL(28, StartX, PLOTPIXEL_PRIO_FLIPX(28, 3)); - CLIPPIXEL(27, StartX, PLOTPIXEL_PRIO_FLIPX(27, 4)); - CLIPPIXEL(26, StartX, PLOTPIXEL_PRIO_FLIPX(26, 5)); - CLIPPIXEL(25, StartX, PLOTPIXEL_PRIO_FLIPX(25, 6)); - CLIPPIXEL(24, StartX, PLOTPIXEL_PRIO_FLIPX(24, 7)); - CLIPPIXEL(23, StartX, PLOTPIXEL_PRIO_FLIPX(23, 8)); - CLIPPIXEL(22, StartX, PLOTPIXEL_PRIO_FLIPX(22, 9)); - CLIPPIXEL(21, StartX, PLOTPIXEL_PRIO_FLIPX(21, 10)); - CLIPPIXEL(20, StartX, PLOTPIXEL_PRIO_FLIPX(20, 11)); - CLIPPIXEL(19, StartX, PLOTPIXEL_PRIO_FLIPX(19, 12)); - CLIPPIXEL(18, StartX, PLOTPIXEL_PRIO_FLIPX(18, 13)); - CLIPPIXEL(17, StartX, PLOTPIXEL_PRIO_FLIPX(17, 14)); - CLIPPIXEL(16, StartX, PLOTPIXEL_PRIO_FLIPX(16, 15)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_FLIPX(15, 16)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_FLIPX(14, 17)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_FLIPX(13, 18)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_FLIPX(12, 19)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_FLIPX(11, 20)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_FLIPX(10, 21)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_FLIPX( 9, 22)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_FLIPX( 8, 23)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_FLIPX( 7, 24)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_FLIPX( 6, 25)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_FLIPX( 5, 26)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_FLIPX( 4, 27)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_FLIPX( 3, 28)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_FLIPX( 2, 29)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_FLIPX( 1, 30)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_FLIPX( 0, 31)); - } -} - -/*================================================================================================ -32 x 32 Functions with Masking -================================================================================================*/ - -void Render32x32Tile_Prio_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_Mask called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 32) { - PLOTPIXEL_PRIO_MASK( 0, nMaskColour); - PLOTPIXEL_PRIO_MASK( 1, nMaskColour); - PLOTPIXEL_PRIO_MASK( 2, nMaskColour); - PLOTPIXEL_PRIO_MASK( 3, nMaskColour); - PLOTPIXEL_PRIO_MASK( 4, nMaskColour); - PLOTPIXEL_PRIO_MASK( 5, nMaskColour); - PLOTPIXEL_PRIO_MASK( 6, nMaskColour); - PLOTPIXEL_PRIO_MASK( 7, nMaskColour); - PLOTPIXEL_PRIO_MASK( 8, nMaskColour); - PLOTPIXEL_PRIO_MASK( 9, nMaskColour); - PLOTPIXEL_PRIO_MASK(10, nMaskColour); - PLOTPIXEL_PRIO_MASK(11, nMaskColour); - PLOTPIXEL_PRIO_MASK(12, nMaskColour); - PLOTPIXEL_PRIO_MASK(13, nMaskColour); - PLOTPIXEL_PRIO_MASK(14, nMaskColour); - PLOTPIXEL_PRIO_MASK(15, nMaskColour); - PLOTPIXEL_PRIO_MASK(16, nMaskColour); - PLOTPIXEL_PRIO_MASK(17, nMaskColour); - PLOTPIXEL_PRIO_MASK(18, nMaskColour); - PLOTPIXEL_PRIO_MASK(19, nMaskColour); - PLOTPIXEL_PRIO_MASK(20, nMaskColour); - PLOTPIXEL_PRIO_MASK(21, nMaskColour); - PLOTPIXEL_PRIO_MASK(22, nMaskColour); - PLOTPIXEL_PRIO_MASK(23, nMaskColour); - PLOTPIXEL_PRIO_MASK(24, nMaskColour); - PLOTPIXEL_PRIO_MASK(25, nMaskColour); - PLOTPIXEL_PRIO_MASK(26, nMaskColour); - PLOTPIXEL_PRIO_MASK(27, nMaskColour); - PLOTPIXEL_PRIO_MASK(28, nMaskColour); - PLOTPIXEL_PRIO_MASK(29, nMaskColour); - PLOTPIXEL_PRIO_MASK(30, nMaskColour); - PLOTPIXEL_PRIO_MASK(31, nMaskColour); - } -} - -void Render32x32Tile_Prio_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_Mask_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_MASK( 0, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_MASK( 1, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_MASK( 2, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_MASK( 3, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_MASK( 4, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_MASK( 5, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_MASK( 6, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_MASK( 7, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_MASK( 8, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_MASK( 9, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_MASK(10, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_MASK(11, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_MASK(12, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_MASK(13, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_MASK(14, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_MASK(15, nMaskColour)); - CLIPPIXEL(16, StartX, PLOTPIXEL_PRIO_MASK(16, nMaskColour)); - CLIPPIXEL(17, StartX, PLOTPIXEL_PRIO_MASK(17, nMaskColour)); - CLIPPIXEL(18, StartX, PLOTPIXEL_PRIO_MASK(18, nMaskColour)); - CLIPPIXEL(19, StartX, PLOTPIXEL_PRIO_MASK(19, nMaskColour)); - CLIPPIXEL(20, StartX, PLOTPIXEL_PRIO_MASK(20, nMaskColour)); - CLIPPIXEL(21, StartX, PLOTPIXEL_PRIO_MASK(21, nMaskColour)); - CLIPPIXEL(22, StartX, PLOTPIXEL_PRIO_MASK(22, nMaskColour)); - CLIPPIXEL(23, StartX, PLOTPIXEL_PRIO_MASK(23, nMaskColour)); - CLIPPIXEL(24, StartX, PLOTPIXEL_PRIO_MASK(24, nMaskColour)); - CLIPPIXEL(25, StartX, PLOTPIXEL_PRIO_MASK(25, nMaskColour)); - CLIPPIXEL(26, StartX, PLOTPIXEL_PRIO_MASK(26, nMaskColour)); - CLIPPIXEL(27, StartX, PLOTPIXEL_PRIO_MASK(27, nMaskColour)); - CLIPPIXEL(28, StartX, PLOTPIXEL_PRIO_MASK(28, nMaskColour)); - CLIPPIXEL(29, StartX, PLOTPIXEL_PRIO_MASK(29, nMaskColour)); - CLIPPIXEL(30, StartX, PLOTPIXEL_PRIO_MASK(30, nMaskColour)); - CLIPPIXEL(31, StartX, PLOTPIXEL_PRIO_MASK(31, nMaskColour)); - } -} - -void Render32x32Tile_Prio_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_Mask_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 32) { - PLOTPIXEL_PRIO_MASK_FLIPX(31, 0, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(30, 1, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(29, 2, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(28, 3, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(27, 4, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(26, 5, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(25, 6, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(24, 7, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(23, 8, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(22, 9, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(21, 10, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(20, 11, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(19, 12, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(18, 13, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(17, 14, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(16, 15, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(15, 16, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(14, 17, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(13, 18, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(12, 19, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(11, 20, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(10, 21, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 9, 22, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 8, 23, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 7, 24, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 6, 25, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 5, 26, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 4, 27, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 3, 28, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 2, 29, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 1, 30, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 0, 31, nMaskColour); - } -} - -void Render32x32Tile_Prio_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_Mask_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < 32; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(31, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(31, 0, nMaskColour)); - CLIPPIXEL(30, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(30, 1, nMaskColour)); - CLIPPIXEL(29, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(29, 2, nMaskColour)); - CLIPPIXEL(28, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(28, 3, nMaskColour)); - CLIPPIXEL(27, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(27, 4, nMaskColour)); - CLIPPIXEL(26, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(26, 5, nMaskColour)); - CLIPPIXEL(25, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(25, 6, nMaskColour)); - CLIPPIXEL(24, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(24, 7, nMaskColour)); - CLIPPIXEL(23, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(23, 8, nMaskColour)); - CLIPPIXEL(22, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(22, 9, nMaskColour)); - CLIPPIXEL(21, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(21, 10, nMaskColour)); - CLIPPIXEL(20, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(20, 11, nMaskColour)); - CLIPPIXEL(19, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(19, 12, nMaskColour)); - CLIPPIXEL(18, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(18, 13, nMaskColour)); - CLIPPIXEL(17, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(17, 14, nMaskColour)); - CLIPPIXEL(16, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(16, 15, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(15, 16, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(14, 17, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(13, 18, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(12, 19, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(11, 20, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(10, 21, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 9, 22, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 8, 23, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 7, 24, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 6, 25, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 5, 26, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 4, 27, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 3, 28, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 2, 29, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 1, 30, nMaskColour)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 0, 31, nMaskColour)); - } -} - -void Render32x32Tile_Prio_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_Mask_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 32) { - PLOTPIXEL_PRIO_MASK( 0, nMaskColour); - PLOTPIXEL_PRIO_MASK( 1, nMaskColour); - PLOTPIXEL_PRIO_MASK( 2, nMaskColour); - PLOTPIXEL_PRIO_MASK( 3, nMaskColour); - PLOTPIXEL_PRIO_MASK( 4, nMaskColour); - PLOTPIXEL_PRIO_MASK( 5, nMaskColour); - PLOTPIXEL_PRIO_MASK( 6, nMaskColour); - PLOTPIXEL_PRIO_MASK( 7, nMaskColour); - PLOTPIXEL_PRIO_MASK( 8, nMaskColour); - PLOTPIXEL_PRIO_MASK( 9, nMaskColour); - PLOTPIXEL_PRIO_MASK(10, nMaskColour); - PLOTPIXEL_PRIO_MASK(11, nMaskColour); - PLOTPIXEL_PRIO_MASK(12, nMaskColour); - PLOTPIXEL_PRIO_MASK(13, nMaskColour); - PLOTPIXEL_PRIO_MASK(14, nMaskColour); - PLOTPIXEL_PRIO_MASK(15, nMaskColour); - PLOTPIXEL_PRIO_MASK(16, nMaskColour); - PLOTPIXEL_PRIO_MASK(17, nMaskColour); - PLOTPIXEL_PRIO_MASK(18, nMaskColour); - PLOTPIXEL_PRIO_MASK(19, nMaskColour); - PLOTPIXEL_PRIO_MASK(20, nMaskColour); - PLOTPIXEL_PRIO_MASK(21, nMaskColour); - PLOTPIXEL_PRIO_MASK(22, nMaskColour); - PLOTPIXEL_PRIO_MASK(23, nMaskColour); - PLOTPIXEL_PRIO_MASK(24, nMaskColour); - PLOTPIXEL_PRIO_MASK(25, nMaskColour); - PLOTPIXEL_PRIO_MASK(26, nMaskColour); - PLOTPIXEL_PRIO_MASK(27, nMaskColour); - PLOTPIXEL_PRIO_MASK(28, nMaskColour); - PLOTPIXEL_PRIO_MASK(29, nMaskColour); - PLOTPIXEL_PRIO_MASK(30, nMaskColour); - PLOTPIXEL_PRIO_MASK(31, nMaskColour); - } -} - -void Render32x32Tile_Prio_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_Mask_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_MASK( 0, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_MASK( 1, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_MASK( 2, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_MASK( 3, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_MASK( 4, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_MASK( 5, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_MASK( 6, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_MASK( 7, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_MASK( 8, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_MASK( 9, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_MASK(10, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_MASK(11, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_MASK(12, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_MASK(13, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_MASK(14, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_MASK(15, nMaskColour)); - CLIPPIXEL(16, StartX, PLOTPIXEL_PRIO_MASK(16, nMaskColour)); - CLIPPIXEL(17, StartX, PLOTPIXEL_PRIO_MASK(17, nMaskColour)); - CLIPPIXEL(18, StartX, PLOTPIXEL_PRIO_MASK(18, nMaskColour)); - CLIPPIXEL(19, StartX, PLOTPIXEL_PRIO_MASK(19, nMaskColour)); - CLIPPIXEL(20, StartX, PLOTPIXEL_PRIO_MASK(20, nMaskColour)); - CLIPPIXEL(21, StartX, PLOTPIXEL_PRIO_MASK(21, nMaskColour)); - CLIPPIXEL(22, StartX, PLOTPIXEL_PRIO_MASK(22, nMaskColour)); - CLIPPIXEL(23, StartX, PLOTPIXEL_PRIO_MASK(23, nMaskColour)); - CLIPPIXEL(24, StartX, PLOTPIXEL_PRIO_MASK(24, nMaskColour)); - CLIPPIXEL(25, StartX, PLOTPIXEL_PRIO_MASK(25, nMaskColour)); - CLIPPIXEL(26, StartX, PLOTPIXEL_PRIO_MASK(26, nMaskColour)); - CLIPPIXEL(27, StartX, PLOTPIXEL_PRIO_MASK(27, nMaskColour)); - CLIPPIXEL(28, StartX, PLOTPIXEL_PRIO_MASK(28, nMaskColour)); - CLIPPIXEL(29, StartX, PLOTPIXEL_PRIO_MASK(29, nMaskColour)); - CLIPPIXEL(30, StartX, PLOTPIXEL_PRIO_MASK(30, nMaskColour)); - CLIPPIXEL(31, StartX, PLOTPIXEL_PRIO_MASK(31, nMaskColour)); - } -} - -void Render32x32Tile_Prio_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_Mask_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 32) { - PLOTPIXEL_PRIO_MASK_FLIPX(31, 0, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(30, 1, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(29, 2, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(28, 3, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(27, 4, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(26, 5, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(25, 6, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(24, 7, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(23, 8, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(22, 9, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(21, 10, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(20, 11, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(19, 12, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(18, 13, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(17, 14, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(16, 15, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(15, 16, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(14, 17, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(13, 18, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(12, 19, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(11, 20, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX(10, 21, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 9, 22, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 8, 23, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 7, 24, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 6, 25, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 5, 26, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 4, 27, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 3, 28, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 2, 29, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 1, 30, nMaskColour); - PLOTPIXEL_PRIO_MASK_FLIPX( 0, 31, nMaskColour); - } -} - -void Render32x32Tile_Prio_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("Render32x32Tile_Prio_Mask_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber << 10); - - UINT16* pPixel = pDestDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + 31) * nScreenWidthMax) + StartX; - - for (INT32 y = 31; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += 32) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - CLIPPIXEL(31, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(31, 0, nMaskColour)); - CLIPPIXEL(30, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(30, 1, nMaskColour)); - CLIPPIXEL(29, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(29, 2, nMaskColour)); - CLIPPIXEL(28, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(28, 3, nMaskColour)); - CLIPPIXEL(27, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(27, 4, nMaskColour)); - CLIPPIXEL(26, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(26, 5, nMaskColour)); - CLIPPIXEL(25, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(25, 6, nMaskColour)); - CLIPPIXEL(24, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(24, 7, nMaskColour)); - CLIPPIXEL(23, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(23, 8, nMaskColour)); - CLIPPIXEL(22, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(22, 9, nMaskColour)); - CLIPPIXEL(21, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(21, 10, nMaskColour)); - CLIPPIXEL(20, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(20, 11, nMaskColour)); - CLIPPIXEL(19, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(19, 12, nMaskColour)); - CLIPPIXEL(18, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(18, 13, nMaskColour)); - CLIPPIXEL(17, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(17, 14, nMaskColour)); - CLIPPIXEL(16, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(16, 15, nMaskColour)); - CLIPPIXEL(15, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(15, 16, nMaskColour)); - CLIPPIXEL(14, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(14, 17, nMaskColour)); - CLIPPIXEL(13, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(13, 18, nMaskColour)); - CLIPPIXEL(12, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(12, 19, nMaskColour)); - CLIPPIXEL(11, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(11, 20, nMaskColour)); - CLIPPIXEL(10, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(10, 21, nMaskColour)); - CLIPPIXEL( 9, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 9, 22, nMaskColour)); - CLIPPIXEL( 8, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 8, 23, nMaskColour)); - CLIPPIXEL( 7, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 7, 24, nMaskColour)); - CLIPPIXEL( 6, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 6, 25, nMaskColour)); - CLIPPIXEL( 5, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 5, 26, nMaskColour)); - CLIPPIXEL( 4, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 4, 27, nMaskColour)); - CLIPPIXEL( 3, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 3, 28, nMaskColour)); - CLIPPIXEL( 2, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 2, 29, nMaskColour)); - CLIPPIXEL( 1, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 1, 30, nMaskColour)); - CLIPPIXEL( 0, StartX, PLOTPIXEL_PRIO_MASK_FLIPX( 0, 31, nMaskColour)); - } -} - -/*================================================================================================ -Custom Height and Width Functions -================================================================================================*/ - -void RenderCustomTile_Prio(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth ) | nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO(x); - } - } -} - -void RenderCustomTile_Prio_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL_PRIO(x)); - } - } -} - -void RenderCustomTile_Prio_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_FLIPX(nWidth - x - 1, x); - } - } -} - -void RenderCustomTile_Prio_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_PRIO_FLIPX(nWidth - x - 1, x)); - } - } -} - -void RenderCustomTile_Prio_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO(x); - } - } -} - -void RenderCustomTile_Prio_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL_PRIO(x)); - } - } -} - -void RenderCustomTile_Prio_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_FLIPX(nWidth - x - 1, x); - } - } -} - -void RenderCustomTile_Prio_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_PRIO_FLIPX(nWidth - x - 1, x)); - } - } -} - -/*================================================================================================ -Custom Height and Width Functions with Masking -================================================================================================*/ - -void RenderCustomTile_Prio_Mask(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_MASK(x, nMaskColour); - } - } -} - -void RenderCustomTile_Prio_Mask_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL_PRIO_MASK(x, nMaskColour)); - } - } -} - -void RenderCustomTile_Prio_Mask_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_MASK_FLIPX(nWidth - x - 1, x, nMaskColour); - } - } -} - -void RenderCustomTile_Prio_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(nWidth - x - 1, x, nMaskColour)); - } - } -} - -void RenderCustomTile_Prio_Mask_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_MASK(x, nMaskColour); - } - } -} - -void RenderCustomTile_Prio_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL_PRIO_MASK(x, nMaskColour)); - } - } -} - -void RenderCustomTile_Prio_Mask_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_MASK_FLIPX(nWidth - x - 1, x, nMaskColour); - } - } -} - -void RenderCustomTile_Prio_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_PRIO_MASK_FLIPX(nWidth - x - 1, x, nMaskColour)); - } - } -} - - - - - - - - - -void RenderCustomTile_Prio_TransMask(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_TRANSMASK(x); - } - } -} - -void RenderCustomTile_Prio_TransMask_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL_PRIO_TRANSMASK(x)); - } - } -} - -void RenderCustomTile_Prio_TransMask_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipX called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_TRANSMASK_FLIPX(nWidth - x - 1, x); - } - } -} - -void RenderCustomTile_Prio_TransMask_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipX_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX; - - for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_PRIO_TRANSMASK_FLIPX(nWidth - x - 1, x)); - } - } -} - -void RenderCustomTile_Prio_TransMask_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_TRANSMASK(x); - } - } -} - -void RenderCustomTile_Prio_TransMask_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(x, StartX, PLOTPIXEL_PRIO_TRANSMASK(x)); - } - } -} - -void RenderCustomTile_Prio_TransMask_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipXY called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - for (INT32 x = 0; x < nWidth; x++) { - PLOTPIXEL_PRIO_TRANSMASK_FLIPX(nWidth - x - 1, x); - } - } -} - -void RenderCustomTile_Prio_TransMask_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderCustomTile_Prio_Mask_FlipXY_Clip called without init\n")); -#endif - - UINT32 nPalette = (nTilePalette << nColourDepth) + nPaletteOffset; - pTileData = pTile + (nTileNumber * nWidth * nHeight); - - UINT16* pPixel = pDestDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - UINT8 *pPri = pPrioDraw + ((StartY + nHeight - 1) * nScreenWidth) + StartX; - - for (INT32 y = nHeight - 1; y >= 0; y--, pPixel -= nScreenWidth, pPri -= nScreenWidth, pTileData += nWidth) { - if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) { - continue; - } - - for (INT32 x = 0; x < nWidth; x++) { - CLIPPIXEL(nWidth - x - 1, StartX, PLOTPIXEL_PRIO_TRANSMASK_FLIPX(nWidth - x - 1, x)); - } - } -} - - - -#undef PLOTPIXEL_PRIO_TRANSMASK -#undef PLOTPIXEL_PRIO_MASK_FLIPX -#undef PLOTPIXEL_TRANSMASK -#undef PLOTPIXEL_TRANSMASK_FLIPX - -#undef PLOTPIXEL -#undef PLOTPIXEL_FLIPX -#undef PLOTPIXEL_MASK -#undef CLIPPIXEL - -#undef PLOTPIXEL_PRIO -#undef PLOTPIXEL_PRIO_FLIPX -#undef PLOTPIXEL_PRIO_MASK -#undef PLOTPIXEL_PRIO_MASK_FLIPX - -/*================================================================================================ -Zoomed Tile Functions -================================================================================================*/ - -void RenderZoomedTile(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderZoomedTile called without init\n")); -#endif - - // Based on MAME sources for tile zooming - UINT8 *gfx_base = gfx + (code * width * height); - int dh = (zoomy * height + 0x8000) / 0x10000; - int dw = (zoomx * width + 0x8000) / 0x10000; - - if (dw && dh) - { - int dx = (width * 0x10000) / dw; - int dy = (height * 0x10000) / dh; - int ex = sx + dw; - int ey = sy + dh; - int x_index_base = 0; - int y_index = 0; - - if (fx) { - x_index_base = (dw - 1) * dx; - dx = -dx; - } - - if (fy) { - y_index = (dh - 1) * dy; - dy = -dy; - } - - for (INT32 y = sy; y < ey; y++) - { - UINT8 *src = gfx_base + (y_index / 0x10000) * width; - UINT16 *dst = dest + y * nScreenWidth; - - if (y >= nScreenHeightMin && y < nScreenHeightMax) - { - for (INT32 x = sx, x_index = x_index_base; x < ex; x++) - { - if (x >= nScreenWidthMin && x < nScreenWidthMax) { - INT32 pxl = src[x_index>>16]; - - if (pxl != t) - dst[x] = pxl + color; - } - - x_index += dx; - } - } - - y_index += dy; - } - } -} - -void RenderZoomedPrioTile(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, INT32 priority) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderZoomedPrioTile called without init\n")); -#endif - - // Based on MAME sources for tile zooming - UINT8 *gfx_base = gfx + (code * width * height); - int dh = (zoomy * height + 0x8000) / 0x10000; - int dw = (zoomx * width + 0x8000) / 0x10000; - - if (dw && dh) - { - int dx = (width * 0x10000) / dw; - int dy = (height * 0x10000) / dh; - int ex = sx + dw; - int ey = sy + dh; - int x_index_base = 0; - int y_index = 0; - - if (fx) { - x_index_base = (dw - 1) * dx; - dx = -dx; - } - - if (fy) { - y_index = (dh - 1) * dy; - dy = -dy; - } - - for (INT32 y = sy; y < ey; y++) - { - UINT8 *src = gfx_base + (y_index / 0x10000) * width; - UINT16 *dst = dest + y * nScreenWidth; - UINT8 *pri = pPrioDraw + y * nScreenWidth; - - if (y >= nScreenHeightMin && y < nScreenHeightMax) - { - for (INT32 x = sx, x_index = x_index_base; x < ex; x++) - { - if (x >= nScreenWidthMin && x < nScreenWidthMax) { - INT32 pxl = src[x_index>>16]; - - if (pxl != t) { - dst[x] = pxl + color; - pri[x] = priority; - } - } - - x_index += dx; - } - } - - y_index += dy; - } - } -} - -/*================================================================================================ -Tile with Transparency Table Functions -================================================================================================*/ - -void RenderTileTranstab(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 trans_col, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, UINT8 *tab) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderTileTranstab called without init\n")); -#endif - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < nScreenHeightMin || sy >= nScreenHeightMax) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < nScreenWidthMin || sx >= nScreenWidthMax) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip] | color; - - if (tab[pxl] == trans_col) continue; - - dest[sy * nScreenWidth + sx] = pxl; - } - - sx -= width; - } -} - -void RenderTilePrioTranstab(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 trans_col, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, UINT8 *tab, INT32 priority) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderTilePrioTranstab called without init\n")); -#endif - - INT32 flip = 0; - if (flipy) flip |= (height - 1) * width; - if (flipx) flip |= width - 1; - - gfx += code * width * height; - - for (INT32 y = 0; y < height; y++, sy++) { - if (sy < nScreenHeightMin || sy >= nScreenHeightMax) continue; - - for (INT32 x = 0; x < width; x++, sx++) { - if (sx < nScreenWidthMin || sx >= nScreenWidthMax) continue; - - INT32 pxl = gfx[((y * width) + x) ^ flip] | color; - - if (tab[pxl] == trans_col) continue; - - dest[sy * nScreenWidth + sx] = pxl; - pPrioDraw[sy * nScreenWidth + sx] = priority; - } - - sx -= width; - } -} - -/*================================================================================================ -Sprite tile with priorities -================================================================================================*/ - -void RenderZoomedPrioSprite(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, INT32 priority) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderZoomedPrioSprite called without init\n")); -#endif - - // Based on MAME sources for tile zooming - UINT8 *gfx_base = gfx + (code * width * height); - int dh = (zoomy * height + 0x8000) / 0x10000; - int dw = (zoomx * width + 0x8000) / 0x10000; - - priority |= 1 << 31; - - if (dw && dh) - { - int dx = (width * 0x10000) / dw; - int dy = (height * 0x10000) / dh; - int ex = sx + dw; - int ey = sy + dh; - int x_index_base = 0; - int y_index = 0; - - if (fx) { - x_index_base = (dw - 1) * dx; - dx = -dx; - } - - if (fy) { - y_index = (dh - 1) * dy; - dy = -dy; - } - - for (INT32 y = sy; y < ey; y++) - { - UINT8 *src = gfx_base + (y_index / 0x10000) * width; - UINT16 *dst = dest + y * nScreenWidth; - UINT8 *pri = pPrioDraw + y * nScreenWidth; - - if (y >= nScreenHeightMin && y < nScreenHeightMax) - { - for (INT32 x = sx, x_index = x_index_base; x < ex; x++) - { - if (x >= nScreenWidthMin && x < nScreenWidthMax) { - INT32 pxl = src[x_index>>16]; - - if (pxl != t) { - if ((priority & (1 << pri[x])) == 0) { - dst[x] = pxl + color; - } - pri[x] = 0x1f; - } - } - - x_index += dx; - } - } - - y_index += dy; - } - } -} - - - -void RenderPrioSprite(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 priority) -{ -#if defined FBA_DEBUG - if (!Debug_GenericTilesInitted) bprintf(PRINT_ERROR, _T("RenderPrioSprite called without init\n")); -#endif - - if (sx < (nScreenWidthMin - (width - 1)) || sy < (nScreenHeightMin - (height - 1)) || sx >= nScreenWidthMax || sy >= nScreenHeightMax) return; - - UINT8 *gfx_base = gfx + (code * width * height); - - priority |= 1 << 31; - - INT32 flipx = fx ? (width - 1) : 0; - INT32 flipy = fy ? (height - 1) : 0; - - for (INT32 y = 0; y < height; y++, sy++) - { - if (sy < nScreenHeightMin || sy >= nScreenHeightMax) continue; - - UINT16 *dst = dest + sy * nScreenWidth + sx; - UINT8 *pri = pPrioDraw + sy * nScreenWidth + sx; - - for (INT32 x = 0; x < width; x++, sx++) - { - if (sx < nScreenWidthMin || sx >= nScreenWidthMax) continue; - - INT32 pxl = gfx_base[(y ^ flipy) * width + (x ^ flipx)]; - - if (pxl != t) { - if ((priority & (1 << pri[x])) == 0) { - dst[x] = pxl + color; - } - pri[x] = 0x1f; - } - } - - sx -= width; - } -} - diff --git a/jan/src/burn/tiles_generic.h b/jan/src/burn/tiles_generic.h deleted file mode 100644 index c641d9dcb..000000000 --- a/jan/src/burn/tiles_generic.h +++ /dev/null @@ -1,204 +0,0 @@ -#include "burnint.h" -#include "tilemap_generic.h" - -extern UINT8* pTileData; -extern INT32 nScreenWidth, nScreenHeight; - -INT32 GenericTilesInit(); -INT32 GenericTilesExit(); - -// Tile decoding macros -#define RGN_FRAC(length, numerator, denominator) ((((length) * 8) * (numerator)) / (denominator)) - -#define STEP2(start, step) ((start) + ((step)*0)), ((start) + ((step)*1)) -#define STEP4(start, step) STEP2(start, step), STEP2((start)+((step)*2), step) -#define STEP8(start, step) STEP4(start, step), STEP4((start)+((step)*4), step) -#define STEP16(start, step) STEP8(start, step), STEP8((start)+((step)*8), step) -#define STEP32(start, step) STEP16(start, step), STEP16((start)+((step)*16), step) -#define STEP64(start, step) STEP32(start, step), STEP32((start)+((step)*32), step) - -void GfxDecode(INT32 num, INT32 numPlanes, INT32 xSize, INT32 ySize, INT32 planeoffsets[], INT32 xoffsets[], INT32 yoffsets[], INT32 modulo, UINT8 *pSrc, UINT8 *pDest); -void GfxDecodeSingle(INT32 which, INT32 numPlanes, INT32 xSize, INT32 ySize, INT32 planeoffsets[], INT32 xoffsets[], INT32 yoffsets[], INT32 modulo, UINT8 *pSrc, UINT8 *pDest); - -void GenericTilesSetClip(INT32 nMinx, INT32 nMaxx, INT32 nMiny, INT32 nMaxy); -void GenericTilesGetClip(INT32 *nMinx, INT32 *nMaxx, INT32 *nMiny, INT32 *nMaxy); -void GenericTilesClearClip(); -void GenericTilesSetClipRaw(INT32 nMinx, INT32 nMaxx, INT32 nMiny, INT32 nMaxy); -void GenericTilesClearClipRaw(); -void GenericTilesSetScanline(INT32 nScanline); - -// Sprite priority handling is different than tile! -void RenderPrioSprite(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 priority); -void RenderZoomedPrioSprite(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, INT32 priority); - -void RenderZoomedTile(UINT16 *pDestDraw, UINT8 *gfx, INT32 code, INT32 color, INT32 trans_color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy); -void RenderZoomedPrioTile(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 t, INT32 sx, INT32 sy, INT32 fx, INT32 fy, INT32 width, INT32 height, INT32 zoomx, INT32 zoomy, INT32 priority); -void RenderTileTranstab(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 trans_col, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, UINT8 *tab); -void RenderTilePrioTranstab(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 trans_col, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, UINT8 *tab, INT32 priority); - -void Render8x8Tile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); - -void Render8x8Tile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render8x8Tile_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); - -void Render8x8Tile_Prio(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); - -void Render8x8Tile_Prio_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render8x8Tile_Prio_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); - -void Render16x16Tile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); - -void Render16x16Tile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render16x16Tile_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); - -void Render16x16Tile_Prio(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); - -void Render16x16Tile_Prio_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render16x16Tile_Prio_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); - -void Render32x32Tile(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); - -void Render32x32Tile_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void Render32x32Tile_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); - -void Render32x32Tile_Prio(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); - -void Render32x32Tile_Prio_Mask(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_Mask_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_Mask_FlipX(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_Mask_FlipY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_Mask_FlipXY(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void Render32x32Tile_Prio_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); - -void RenderCustomTile(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, UINT8 *pTile); - -void RenderCustomTile_Mask(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_Mask_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_Mask_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_Mask_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_Mask_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); -void RenderCustomTile_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, UINT8 *pTile); - -void RenderCustomTile_Prio(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); - -void RenderCustomTile_Prio_Mask(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_Mask_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_Mask_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_Mask_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_Mask_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_Mask_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_Mask_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_Mask_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, INT32 nMaskColour, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); - -void RenderCustomTile_Prio_TransMask(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_TransMask_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_TransMask_FlipX(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_TransMask_FlipX_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_TransMask_FlipY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_TransMask_FlipY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_TransMask_FlipXY(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); -void RenderCustomTile_Prio_TransMask_FlipXY_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32 nTileNumber, INT32 StartX, INT32 StartY, INT32 nTilePalette, INT32 nColourDepth, UINT8 *pTransTable, INT32 nPaletteOffset, INT32 nPriority, UINT8 *pTile); - - -// --------------------------------------------------------------------------- -// Colour-depth independant image transfer - -extern UINT16* pTransDraw; -extern UINT8* pPrioDraw; - -void BurnTransferClear(); -void BurnTransferClear(UINT16 nFillPattern); -void BurnPrioClear(); -INT32 BurnTransferCopy(UINT32* pPalette); -void BurnTransferExit(); -INT32 BurnTransferInit(); diff --git a/jan/src/burn/timer.cpp b/jan/src/burn/timer.cpp deleted file mode 100644 index a32da96be..000000000 --- a/jan/src/burn/timer.cpp +++ /dev/null @@ -1,485 +0,0 @@ -// Timers (for Yamaha FM cips and generic) -#include "burnint.h" -#include "timer.h" -#include "m68000_intf.h" -#include "z80_intf.h" -#include "m6809_intf.h" -#include "hd6309_intf.h" -#include "m6800_intf.h" -#include "m6502_intf.h" -#include "sh2_intf.h" -#include "h6280_intf.h" -#include "tlcs90_intf.h" - -#define MAX_TIMER_VALUE ((1 << 30) - 65536) - -double dTime; // Time elapsed since the emulated machine was started - -static INT32 nTimerCount[2], nTimerStart[2]; - -// Callbacks -static INT32 (*pTimerOverCallback)(INT32, INT32); -static double (*pTimerTimeCallback)(); - -static INT32 nCPUClockspeed = 0; -static INT32 (*pCPUTotalCycles)() = NULL; -static INT32 (*pCPURun)(INT32) = NULL; -static void (*pCPURunEnd)() = NULL; - -// --------------------------------------------------------------------------- -// Running time - -static double BurnTimerTimeCallbackDummy() -{ - return 0.0; -} - -extern "C" double BurnTimerGetTime() -{ - return dTime + pTimerTimeCallback(); -} - -// --------------------------------------------------------------------------- -// Update timers - -static INT32 nTicksTotal, nTicksDone, nTicksExtra; - -INT32 BurnTimerUpdate(INT32 nCycles) -{ - INT32 nIRQStatus = 0; - - nTicksTotal = MAKE_TIMER_TICKS(nCycles, nCPUClockspeed); - -// bprintf(PRINT_NORMAL, _T(" -- Ticks: %08X, cycles %i\n"), nTicksTotal, nCycles); - - while (nTicksDone < nTicksTotal) { - INT32 nTimer, nCyclesSegment, nTicksSegment; - - // Determine which timer fires first - if (nTimerCount[0] <= nTimerCount[1]) { - nTicksSegment = nTimerCount[0]; - } else { - nTicksSegment = nTimerCount[1]; - } - if (nTicksSegment > nTicksTotal) { - nTicksSegment = nTicksTotal; - } - - nCyclesSegment = MAKE_CPU_CYLES(nTicksSegment + nTicksExtra, nCPUClockspeed); -// bprintf(PRINT_NORMAL, _T(" - Timer: %08X, %08X, %08X, cycles %i, %i\n"), nTicksDone, nTicksSegment, nTicksTotal, nCyclesSegment, pCPUTotalCycles()); - - pCPURun(nCyclesSegment - pCPUTotalCycles()); - - nTicksDone = MAKE_TIMER_TICKS(pCPUTotalCycles() + 1, nCPUClockspeed) - 1; -// bprintf(PRINT_NORMAL, _T(" - ticks done -> %08X cycles -> %i\n"), nTicksDone, pCPUTotalCycles()); - - nTimer = 0; - if (nTicksDone >= nTimerCount[0]) { - if (nTimerStart[0] == MAX_TIMER_VALUE) { - nTimerCount[0] = MAX_TIMER_VALUE; - } else { - nTimerCount[0] += nTimerStart[0]; - } -// bprintf(PRINT_NORMAL, _T(" - timer 0 fired\n")); - nTimer |= 1; - } - if (nTicksDone >= nTimerCount[1]) { - if (nTimerStart[1] == MAX_TIMER_VALUE) { - nTimerCount[1] = MAX_TIMER_VALUE; - } else { - nTimerCount[1] += nTimerStart[1]; - } -// bprintf(PRINT_NORMAL, _T(" - timer 1 fired\n")); - nTimer |= 2; - } - if (nTimer & 1) { - nIRQStatus |= pTimerOverCallback(0, 0); - } - if (nTimer & 2) { - nIRQStatus |= pTimerOverCallback(0, 1); - } - } - - return nIRQStatus; -} - -void BurnTimerEndFrame(INT32 nCycles) -{ - INT32 nTicks = MAKE_TIMER_TICKS(nCycles, nCPUClockspeed); - - BurnTimerUpdate(nCycles); - - if (nTimerCount[0] < MAX_TIMER_VALUE) { - nTimerCount[0] -= nTicks; - } - if (nTimerCount[1] < MAX_TIMER_VALUE) { - nTimerCount[1] -= nTicks; - } - - nTicksDone -= nTicks; - if (nTicksDone < 0) { -// bprintf(PRINT_ERROR, _T(" -- ticks done -> %08X\n"), nTicksDone); - nTicksDone = 0; - } -} - -void BurnTimerUpdateEnd() -{ -// bprintf(PRINT_NORMAL, _T(" - end %i\n"), pCPUTotalCycles()); - - pCPURunEnd(); - - nTicksTotal = 0; -} - - -// --------------------------------------------------------------------------- -// Callbacks for the sound cores -/* -static INT32 BurnTimerExtraCallbackDummy() -{ - return 0; -} -*/ -void BurnOPLTimerCallback(INT32 c, double period) -{ - pCPURunEnd(); - - if (period == 0.0) { - nTimerCount[c] = MAX_TIMER_VALUE; -// bprintf(PRINT_NORMAL, _T(" - timer %i stopped\n"), c); - return; - } - - nTimerCount[c] = (INT32)(period * (double)TIMER_TICKS_PER_SECOND); - nTimerCount[c] += MAKE_TIMER_TICKS(pCPUTotalCycles(), nCPUClockspeed); - -// bprintf(PRINT_NORMAL, _T(" - timer %i started, %08X ticks (fires in %lf seconds)\n"), c, nTimerCount[c], period); -} - -void BurnOPMTimerCallback(INT32 c, double period) -{ - pCPURunEnd(); - - if (period == 0.0) { - nTimerCount[c] = MAX_TIMER_VALUE; - return; - } - - nTimerCount[c] = (INT32)(period * (double)TIMER_TICKS_PER_SECOND); - nTimerCount[c] += MAKE_TIMER_TICKS(pCPUTotalCycles(), nCPUClockspeed); -} - -void BurnOPNTimerCallback(INT32 /*n */, INT32 c, INT32 cnt, double stepTime) -{ - pCPURunEnd(); - - if (cnt == 0) { - nTimerCount[c] = MAX_TIMER_VALUE; - -// bprintf(PRINT_NORMAL, _T(" - timer %i stopped\n"), c); - - return; - } - - nTimerCount[c] = (INT32)(stepTime * cnt * (double)TIMER_TICKS_PER_SECOND); - nTimerCount[c] += MAKE_TIMER_TICKS(pCPUTotalCycles(), nCPUClockspeed); -// bprintf(PRINT_NORMAL, _T(" - timer %i started, %08X ticks (fires in %lf seconds)\n"), c, nTimerCount[c], stepTime * cnt); -} - -void BurnYMFTimerCallback(INT32 /* n */, INT32 c, double period) -{ - pCPURunEnd(); - - if (period == 0.0) { - nTimerStart[c] = nTimerCount[c] = MAX_TIMER_VALUE; - -// bprintf(PRINT_NORMAL, _T(" - timer %i stopped\n"), c); - - return; - } - - nTimerStart[c] = nTimerCount[c] = (INT32)(period * (double)(TIMER_TICKS_PER_SECOND / 1000000)); - nTimerCount[c] += MAKE_TIMER_TICKS(pCPUTotalCycles(), nCPUClockspeed); - -// bprintf(PRINT_NORMAL, _T(" - timer %i started, %08X ticks (fires in %lf seconds)\n"), c, nTimerCount[c], period); -} - -void BurnTimerSetRetrig(INT32 c, double period) -{ - pCPURunEnd(); - - if (period == 0.0) { - nTimerStart[c] = nTimerCount[c] = MAX_TIMER_VALUE; - -// bprintf(PRINT_NORMAL, _T(" - timer %i stopped\n"), c); - - return; - } - - nTimerStart[c] = nTimerCount[c] = (INT32)(period * (double)(TIMER_TICKS_PER_SECOND)); - nTimerCount[c] += MAKE_TIMER_TICKS(pCPUTotalCycles(), nCPUClockspeed); - -// bprintf(PRINT_NORMAL, _T(" - timer %i started, %08X ticks (fires in %lf seconds)\n"), c, nTimerCount[c], period); -} - -void BurnTimerSetOneshot(INT32 c, double period) -{ - pCPURunEnd(); - - if (period == 0.0) { - nTimerStart[c] = nTimerCount[c] = MAX_TIMER_VALUE; - -// bprintf(PRINT_NORMAL, _T(" - timer %i stopped\n"), c); - - return; - } - - nTimerCount[c] = (INT32)(period * (double)(TIMER_TICKS_PER_SECOND)); - nTimerCount[c] += MAKE_TIMER_TICKS(pCPUTotalCycles(), nCPUClockspeed); - -// bprintf(PRINT_NORMAL, _T(" - timer %i started, %08X ticks (fires in %lf seconds)\n"), c, nTimerCount[c], period / 1000000.0); -} - -// ------------------------------------ --------------------------------------- -// Initialisation etc. - -void BurnTimerScan(INT32 nAction, INT32* pnMin) -{ - if (pnMin && *pnMin < 0x029521) { - *pnMin = 0x029521; - } - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(nTimerCount); - SCAN_VAR(nTimerStart); - SCAN_VAR(dTime); - - SCAN_VAR(nTicksDone); - } -} - -void BurnTimerExit() -{ - nCPUClockspeed = 0; - pCPUTotalCycles = NULL; - pCPURun = NULL; - pCPURunEnd = NULL; - - return; -} - -void BurnTimerReset() -{ - nTimerCount[0] = nTimerCount[1] = MAX_TIMER_VALUE; - nTimerStart[0] = nTimerStart[1] = MAX_TIMER_VALUE; - - dTime = 0.0; - - nTicksDone = 0; -} - -INT32 BurnTimerInit(INT32 (*pOverCallback)(INT32, INT32), double (*pTimeCallback)()) -{ - BurnTimerExit(); - - pTimerOverCallback = pOverCallback; - pTimerTimeCallback = pTimeCallback ? pTimeCallback : BurnTimerTimeCallbackDummy; - - BurnTimerReset(); - - return 0; -} - -// Null CPU, for a FM timer that isn't attached to anything. -static INT32 NullCyclesTotal; - -void NullNewFrame() -{ - NullCyclesTotal = 0; -} - -INT32 NullTotalCycles() -{ - return NullCyclesTotal; -} - -INT32 NullRun(const INT32 nCycles) -{ - NullCyclesTotal += nCycles; - - return nCycles; -} - -void NullRunEnd() -{ -} - -INT32 BurnTimerAttachNull(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = NullTotalCycles; - pCPURun = NullRun; - pCPURunEnd = NullRunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - -INT32 BurnTimerAttachSek(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = SekTotalCycles; - pCPURun = SekRun; - pCPURunEnd = SekRunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - -INT32 BurnTimerAttachZet(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = ZetTotalCycles; - pCPURun = ZetRun; - pCPURunEnd = ZetRunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - -INT32 BurnTimerAttachM6809(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6809TotalCycles; - pCPURun = M6809Run; - pCPURunEnd = M6809RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - -INT32 BurnTimerAttachHD6309(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = HD6309TotalCycles; - pCPURun = HD6309Run; - pCPURunEnd = HD6309RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - -INT32 BurnTimerAttachM6800(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = M6800Run; - pCPURunEnd = M6800RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - -INT32 BurnTimerAttachHD63701(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = HD63701Run; - pCPURunEnd = HD63701RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - -INT32 BurnTimerAttachM6803(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6800TotalCycles; - pCPURun = M6803Run; - pCPURunEnd = M6803RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - -INT32 BurnTimerAttachM6502(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = M6502TotalCycles; - pCPURun = M6502Run; - pCPURunEnd = M6502RunEnd; // doesn't do anything... - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - - -INT32 BurnTimerAttachSh2(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = Sh2TotalCycles; - pCPURun = Sh2Run; - pCPURunEnd = Sh2StopRun; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - -INT32 BurnTimerAttachH6280(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = h6280TotalCycles; - pCPURun = h6280Run; - pCPURunEnd = h6280RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} -INT32 BurnTimerAttachTlcs90(INT32 nClockspeed) -{ - nCPUClockspeed = nClockspeed; - pCPUTotalCycles = tlcs90TotalCycles; - pCPURun = tlcs90Run; - pCPURunEnd = tlcs90RunEnd; - - nTicksExtra = MAKE_TIMER_TICKS(1, nCPUClockspeed) - 1; - -// bprintf(PRINT_NORMAL, _T("--- timer cpu speed %iHz, one cycle = %i ticks.\n"), nClockspeed, MAKE_TIMER_TICKS(1, nCPUClockspeed)); - - return 0; -} - diff --git a/jan/src/burn/timer.h b/jan/src/burn/timer.h deleted file mode 100644 index 9b5b9fae3..000000000 --- a/jan/src/burn/timer.h +++ /dev/null @@ -1,42 +0,0 @@ -// FM timers - -#define TIMER_TICKS_PER_SECOND (2048000000) -#define MAKE_TIMER_TICKS(n, m) ((INT64)(n) * TIMER_TICKS_PER_SECOND / (m)) -#define MAKE_CPU_CYLES(n, m) ((INT64)(n) * (m) / TIMER_TICKS_PER_SECOND) - -extern "C" double BurnTimerGetTime(); - -// Callbacks for various sound chips -void BurnOPNTimerCallback(INT32 n, INT32 c, INT32 cnt, double stepTime); // period = cnt * stepTime in s -void BurnOPLTimerCallback(INT32 c, double period); // period in s -void BurnYMFTimerCallback(INT32 n, INT32 c, double period); // period in us - -// Start / stop a timer -void BurnTimerSetRetrig(INT32 c, double period); // period in s -void BurnTimerSetOneshot(INT32 c, double period); // period in s - -extern double dTime; - -void BurnTimerExit(); -void BurnTimerReset(); -INT32 BurnTimerInit(INT32 (*pOverCallback)(INT32, INT32), double (*pTimeCallback)()); -INT32 BurnTimerAttachNull(INT32 nClockspeed); -INT32 BurnTimerAttachSek(INT32 nClockspeed); -INT32 BurnTimerAttachZet(INT32 nClockspeed); -INT32 BurnTimerAttachM6809(INT32 nClockspeed); -INT32 BurnTimerAttachHD6309(INT32 nClockspeed); -INT32 BurnTimerAttachM6800(INT32 nClockspeed); -INT32 BurnTimerAttachHD63701(INT32 nClockspeed); -INT32 BurnTimerAttachM6803(INT32 nClockspeed); -INT32 BurnTimerAttachM6502(INT32 nClockspeed); -INT32 BurnTimerAttachSh2(INT32 nClockspeed); -INT32 BurnTimerAttachTlcs90(INT32 nClockspeed); -INT32 BurnTimerAttachH6280(INT32 nClockspeed); -void BurnTimerScan(INT32 nAction, INT32* pnMin); -INT32 BurnTimerUpdate(INT32 nCycles); -void BurnTimerUpdateEnd(); -void BurnTimerEndFrame(INT32 nCycles); - -void NullNewFrame(); -INT32 NullTotalCycles(); -INT32 NullRun(const INT32 nCycles); diff --git a/jan/src/burn/vector.cpp b/jan/src/burn/vector.cpp deleted file mode 100644 index cb4814158..000000000 --- a/jan/src/burn/vector.cpp +++ /dev/null @@ -1,130 +0,0 @@ - -#include "tiles_generic.h" -#include "math.h" - -#define TABLE_SIZE 0x10000 // excessive? - -struct vector_line { - INT32 x; - INT32 y; - INT32 color; - UINT8 intensity; -}; - -static struct vector_line *vector_table; -struct vector_line *vector_ptr; // pointer -static INT32 vector_cnt; - -void vector_add_point(INT32 x, INT32 y, INT32 color, INT32 intensity) -{ - vector_ptr->x = x >> 16; - vector_ptr->y = y >> 16; - vector_ptr->color = color; - vector_ptr->intensity = intensity; - - vector_cnt++; - if (vector_cnt > (TABLE_SIZE - 2)) return; - vector_ptr++; - vector_ptr->color = -1; // mark it as the last one to save some cycles later... -} - -static void lineSimple(INT32 x0, INT32 y0, INT32 x1, INT32 y1, INT32 color, INT32 intensity) -{ - color = color * 256 + intensity; - - // http://rosettacode.org/wiki/Bitmap/Bresenham%27s_line_algorithm - - INT32 dx = abs(x1 - x0); - INT32 dy = abs(y1 - y0); - INT32 sx = x0 < x1 ? 1 : -1; - INT32 sy = y0 < y1 ? 1 : -1; - INT32 err = (dx>dy ? dx : -dy)/2, e2; - - while (1) - { - if (x0 >= 0 && x0 < nScreenWidth && y0 >= 0 && y0 < nScreenHeight) { - pTransDraw[y0 * nScreenWidth + x0] = color; - } - - if (x0 == x1 && y0 == y1) break; - - e2 = err; - - if (e2 >-dx) { err -= dy; x0 += sx; } - if (e2 < dy) { err += dx; y0 += sy; } - } -} - -void draw_vector(UINT32 *palette) -{ - struct vector_line *ptr = &vector_table[0]; - - INT32 prev_x = 0, prev_y = 0; - - BurnTransferClear(); - - for (INT32 i = 0; i < vector_cnt && i < TABLE_SIZE; i++, ptr++) - { - if (ptr->color == -1) break; - - INT32 curr_y = ptr->y; - INT32 curr_x = ptr->x; - - if (ptr->intensity != 0) { // intensity 0 means turn off the beam... - lineSimple(curr_x, curr_y, prev_x, prev_y, ptr->color, ptr->intensity); - } - - prev_x = curr_x; - prev_y = curr_y; - } - - BurnTransferCopy(palette); -} - -void vector_reset() -{ - vector_cnt = 0; - vector_ptr = &vector_table[0]; - vector_ptr->color = -1; -} - -void vector_init() -{ - GenericTilesInit(); - - vector_table = (struct vector_line*)BurnMalloc(TABLE_SIZE * sizeof(vector_line)); - - memset (vector_table, 0, TABLE_SIZE * sizeof(vector_line)); - - vector_reset(); -} - -void vector_exit() -{ - GenericTilesExit(); - - BurnFree (vector_table); - vector_ptr = NULL; -} - -INT32 vector_scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = (UINT8*)vector_table; - ba.nLen = TABLE_SIZE * sizeof(vector_line); - ba.szName = "Vector Table"; - BurnAcb(&ba); - - SCAN_VAR(vector_cnt); - } - - if (nAction & ACB_WRITE) { - vector_ptr = &vector_table[vector_cnt]; - } - - return 0; -} diff --git a/jan/src/burn/vector.h b/jan/src/burn/vector.h deleted file mode 100644 index 074ad599b..000000000 --- a/jan/src/burn/vector.h +++ /dev/null @@ -1,7 +0,0 @@ - -void draw_vector(UINT32 *palette); -void vector_init(); -void vector_reset(); -INT32 vector_scan(INT32 nAction); -void vector_exit(); -void vector_add_point(INT32 x, INT32 y, INT32 color, INT32 intensity); diff --git a/jan/src/burn/version.h b/jan/src/burn/version.h deleted file mode 100644 index 4e7f2f6cf..000000000 --- a/jan/src/burn/version.h +++ /dev/null @@ -1,13 +0,0 @@ -// Version number, written as vV.V.BB or vV.V.BBaa -// (0xVVBBaa, in BCD notation) - -#define VER_MAJOR 0 -#define VER_MINOR 2 -#define VER_BETA 97 -#define VER_ALPHA 41 - -#define BURN_VERSION (VER_MAJOR * 0x100000) + (VER_MINOR * 0x010000) + (((VER_BETA / 10) * 0x001000) + ((VER_BETA % 10) * 0x000100)) + (((VER_ALPHA / 10) * 0x000010) + (VER_ALPHA % 10)) - - - - diff --git a/jan/src/burner/burner.h b/jan/src/burner/burner.h deleted file mode 100644 index 22206e858..000000000 --- a/jan/src/burner/burner.h +++ /dev/null @@ -1,230 +0,0 @@ -// FB Alpha - Emulator for MC68000/Z80 based arcade games -// Refer to the "license.txt" file for more info -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tchar.h" - -// Macro to make quoted strings -#define MAKE_STRING_2(s) #s -#define MAKE_STRING(s) MAKE_STRING_2(s) - -#define BZIP_MAX (20) // Maximum zip files to search through -#if defined (BUILD_QT) - #define DIRS_MAX (4) // Maximum number of directories to search -#else - #define DIRS_MAX (20) // Maximum number of directories to search -#endif - -#include "title.h" -#include "burn.h" - -// --------------------------------------------------------------------------- -// OS dependent functionality -typedef struct tagIMAGE { - unsigned int width; - unsigned int height; - unsigned int rowbytes; - unsigned int imgbytes; - unsigned char** rowptr; - unsigned char* bmpbits; - unsigned int flags; -} IMAGE; - -#if defined (BUILD_WIN32) - #include "burner_win32.h" -#elif defined (BUILD_SDL) - #include "burner_sdl.h" -#elif defined (_XBOX) && !defined(__LIBRETRO__) - #include "burner_xbox.h" -#elif defined(__LIBRETRO__) -#include "burner_libretro.h" -#elif defined(BUILD_QT) - #include "burner_qt.h" -#endif - -#if defined (INCLUDE_LIB_PNGH) - #include "png.h" -#endif - -// --------------------------------------------------------------------------- -// OS independent functionality - -#ifndef __LIBRETRO__ -#include "interface.h" -#endif - -#define IMG_FREE (1 << 0) - -// Macros for parsing text -#define SKIP_WS(s) while (_istspace(*s)) { s++; } // Skip whitespace -#define FIND_WS(s) while (*s && !_istspace(*s)) { s++; } // Find whitespace -#define FIND_QT(s) while (*s && *s != _T('\"')) { s++; } // Find quote - -// image.cpp -extern int bPngImageOrientation; -void img_free(IMAGE* img); -INT32 img_alloc(IMAGE* img); - -bool PNGIsImage(FILE* fp); -INT32 PNGLoad(IMAGE* img, FILE* fp, INT32 nPreset); -INT32 PNGGetInfo(IMAGE* img, FILE *fp); - -// gami.cpp -extern struct GameInp* GameInp; -extern UINT32 nGameInpCount; -extern UINT32 nMacroCount; -extern UINT32 nMaxMacro; - -extern INT32 nAnalogSpeed; - -extern INT32 nFireButtons; - -extern bool bStreetFighterLayout; -extern bool bLeftAltkeyMapped; - -INT32 GameInpInit(); -INT32 GameInpExit(); -TCHAR* InputCodeDesc(INT32 c); -TCHAR* InpToDesc(struct GameInp* pgi); -TCHAR* InpMacroToDesc(struct GameInp* pgi); -#ifndef __LIBRETRO__ -void GameInpCheckLeftAlt(); -void GameInpCheckMouse(); -#endif -INT32 GameInpBlank(INT32 bDipSwitch); -INT32 GameInputAutoIni(INT32 nPlayer, TCHAR* lpszFile, bool bOverWrite); -INT32 ConfigGameLoadHardwareDefaults(); -INT32 GameInpDefault(); -INT32 GameInpWrite(FILE* h); -INT32 GameInpRead(TCHAR* szVal, bool bOverWrite); -INT32 GameInpMacroRead(TCHAR* szVal, bool bOverWrite); -INT32 GameInpCustomRead(TCHAR* szVal, bool bOverWrite); - -// inp_interface.cpp -extern INT32 nAutoFireRate; - -// Player Default Controls -extern INT32 nPlayerDefaultControls[4]; -extern TCHAR szPlayerDefaultIni[4][MAX_PATH]; - -// mappable System Macros for the Input Dialogue -extern UINT8 macroSystemPause; -extern UINT8 macroSystemFFWD; -extern UINT8 macroSystemSaveState; -extern UINT8 macroSystemLoadState; -extern UINT8 macroSystemUNDOState; - -// scrn.cpp -extern void scrnSSUndo(); -extern bool bHasFocus; - -// cong.cpp -extern const INT32 nConfigMinVersion; // Minimum version of application for which input files are valid -extern bool bSaveInputs; -INT32 ConfigGameLoad(bool bOverWrite); // char* lpszName = NULL -INT32 ConfigGameSave(bool bSave); - -// conc.cpp -INT32 ConfigCheatLoad(); - -// gamc.cpp -INT32 GamcMisc(struct GameInp* pgi, char* szi, INT32 nPlayer); -INT32 GamcAnalogKey(struct GameInp* pgi, char* szi, INT32 nPlayer, INT32 nSlide); -INT32 GamcAnalogJoy(struct GameInp* pgi, char* szi, INT32 nPlayer, INT32 nJoy, INT32 nSlide); -INT32 GamcPlayer(struct GameInp* pgi, char* szi, INT32 nPlayer, INT32 nDevice); -INT32 GamcPlayerHotRod(struct GameInp* pgi, char* szi, INT32 nPlayer, INT32 nFlags, INT32 nSlide); - -// misc.cpp -#define QUOTE_MAX (128) // Maximum length of "quoted strings" -INT32 QuoteRead(TCHAR** ppszQuote, TCHAR** ppszEnd, TCHAR* pszSrc); // Read a quoted string from szSrc and poINT32 to the end -TCHAR* LabelCheck(TCHAR* s, TCHAR* pszLabel); - -TCHAR* ExtractFilename(TCHAR* fullname); -TCHAR* DriverToName(UINT32 nDrv); -UINT32 NameToDriver(TCHAR* szName); - -extern INT32 bDoGamma; -extern INT32 bHardwareGammaOnly; -extern double nGamma; - -INT32 SetBurnHighCol(INT32 nDepth); -char* DecorateGameName(UINT32 nBurnDrv); -TCHAR* DecorateGenreInfo(); -void ComputeGammaLUT(); - -// dat.cpp -#define DAT_ARCADE_ONLY 0 -#define DAT_MEGADRIVE_ONLY 1 -#define DAT_PCENGINE_ONLY 2 -#define DAT_TG16_ONLY 3 -#define DAT_SGX_ONLY 4 -#define DAT_SG1000_ONLY 5 -#define DAT_COLECO_ONLY 6 -#define DAT_MASTERSYSTEM_ONLY 7 -#define DAT_GAMEGEAR_ONLY 8 -#define DAT_MSX_ONLY 9 - -INT32 write_datfile(INT32 bType, FILE* fDat); -INT32 create_datfile(TCHAR* szFilename, INT32 bType); - -// sshot.cpp -INT32 MakeScreenShot(); - -// state.cpp -INT32 BurnStateLoadEmbed(FILE* fp, INT32 nOffset, INT32 bAll, INT32 (*pLoadGame)()); -INT32 BurnStateLoad(TCHAR* szName, INT32 bAll, INT32 (*pLoadGame)()); -INT32 BurnStateSaveEmbed(FILE* fp, INT32 nOffset, INT32 bAll); -INT32 BurnStateSave(TCHAR* szName, INT32 bAll); -INT32 BurnStateUNDO(TCHAR* szName); - -// statec.cpp -INT32 BurnStateCompress(UINT8** pDef, INT32* pnDefLen, INT32 bAll); -INT32 BurnStateDecompress(UINT8* Def, INT32 nDefLen, INT32 bAll); - -// zipfn.cpp -struct ZipEntry { char* szName; UINT32 nLen; UINT32 nCrc; }; - -INT32 ZipOpen(char* szZip); -INT32 ZipClose(); -INT32 ZipGetList(struct ZipEntry** pList, INT32* pnListCount); -INT32 ZipLoadFile(UINT8* Dest, INT32 nLen, INT32* pnWrote, INT32 nEntry); -INT32 __cdecl ZipLoadOneFile(char* arcName, const char* fileName, void** Dest, INT32* pnWrote); - -// bzip.cpp - -#define BZIP_STATUS_OK (0) -#define BZIP_STATUS_BADDATA (1) -#define BZIP_STATUS_ERROR (2) - -INT32 BzipOpen(bool); -INT32 BzipClose(); -INT32 BzipInit(); -INT32 BzipExit(); -INT32 BzipStatus(); - -// support_paths.cpp -extern TCHAR szAppPreviewsPath[MAX_PATH]; -extern TCHAR szAppTitlesPath[MAX_PATH]; -extern TCHAR szAppCheatsPath[MAX_PATH]; -extern TCHAR szAppIpsPath[MAX_PATH]; -extern TCHAR szAppIconsPath[MAX_PATH]; -extern TCHAR szAppSelectPath[MAX_PATH]; -extern TCHAR szAppVersusPath[MAX_PATH]; -extern TCHAR szAppHowtoPath[MAX_PATH]; -extern TCHAR szAppScoresPath[MAX_PATH]; -extern TCHAR szAppBossesPath[MAX_PATH]; -extern TCHAR szAppGameoverPath[MAX_PATH]; -extern TCHAR szAppFlyersPath[MAX_PATH]; -extern TCHAR szAppMarqueesPath[MAX_PATH]; -extern TCHAR szAppControlsPath[MAX_PATH]; -extern TCHAR szAppCabinetsPath[MAX_PATH]; -extern TCHAR szAppPCBsPath[MAX_PATH]; -extern TCHAR szAppHistoryPath[MAX_PATH]; diff --git a/jan/src/burner/conc.cpp b/jan/src/burner/conc.cpp deleted file mode 100644 index 2046a7476..000000000 --- a/jan/src/burner/conc.cpp +++ /dev/null @@ -1,626 +0,0 @@ -#include "burner.h" - -static bool SkipComma(TCHAR** s) -{ - while (**s && **s != _T(',')) { - (*s)++; - } - - if (**s == _T(',')) { - (*s)++; - } - - if (**s) { - return true; - } - - return false; -} - -static void CheatError(TCHAR* pszFilename, INT32 nLineNumber, CheatInfo* pCheat, TCHAR* pszInfo, TCHAR* pszLine) -{ -#if defined (BUILD_WIN32) - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Cheat file %s is malformed.\nPlease remove or repair the file.\n\n"), pszFilename); - if (pCheat) { - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Parse error at line %i, in cheat \"%s\".\n"), nLineNumber, pCheat->szCheatName); - } else { - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Parse error at line %i.\n"), nLineNumber); - } - - if (pszInfo) { - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Problem:\t%s.\n"), pszInfo); - } - if (pszLine) { - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Text:\t%s\n"), pszLine); - } - - FBAPopupDisplay(PUF_TYPE_ERROR); -#endif -} - -static INT32 ConfigParseFile(TCHAR* pszFilename) -{ -#define INSIDE_NOTHING (0xFFFF & (1 << ((sizeof(TCHAR) * 8) - 1))) - - TCHAR szLine[8192]; - TCHAR* s; - TCHAR* t; - INT32 nLen; - - INT32 nLine = 0; - TCHAR nInside = INSIDE_NOTHING; - - CheatInfo* pCurrentCheat = NULL; - - FILE* h = _tfopen(pszFilename, _T("rt")); - if (h == NULL) { - return 1; - } - - while (1) { - if (_fgetts(szLine, sizeof(szLine), h) == NULL) { - break; - } - - nLine++; - - nLen = _tcslen(szLine); - // Get rid of the linefeed at the end - while (szLine[nLen - 1] == 0x0A || szLine[nLen - 1] == 0x0D) { - szLine[nLen - 1] = 0; - nLen--; - } - - s = szLine; // Start parsing - - if (s[0] == _T('/') && s[1] == _T('/')) { // Comment - continue; - } - - if ((t = LabelCheck(s, _T("include"))) != 0) { // Include a file - s = t; - - TCHAR szFilename[MAX_PATH] = _T(""); - - // Read name of the cheat file - TCHAR* szQuote = NULL; - QuoteRead(&szQuote, NULL, s); - - _stprintf(szFilename, _T("%s%s.dat"), szAppCheatsPath, szQuote); - - if (ConfigParseFile(szFilename)) { - _stprintf(szFilename, _T("%s%s.ini"), szAppCheatsPath, szQuote); - if (ConfigParseFile(szFilename)) { - CheatError(pszFilename, nLine, NULL, _T("included file doesn't exist"), szLine); - } - } - - continue; - } - - if ((t = LabelCheck(s, _T("cheat"))) != 0) { // Add new cheat - s = t; - - // Read cheat name - TCHAR* szQuote = NULL; - TCHAR* szEnd = NULL; - - QuoteRead(&szQuote, &szEnd, s); - - s = szEnd; - - if ((t = LabelCheck(s, _T("advanced"))) != 0) { // Advanced cheat - s = t; - } - - SKIP_WS(s); - - if (nInside == _T('{')) { - CheatError(pszFilename, nLine, pCurrentCheat, _T("missing closing bracket"), NULL); - break; - } -#if 0 - if (*s != _T('\0') && *s != _T('{')) { - CheatError(pszFilename, nLine, NULL, _T("malformed cheat declaration"), szLine); - break; - } -#endif - nInside = *s; - - // Link new node into the list - CheatInfo* pPreviousCheat = pCurrentCheat; - pCurrentCheat = (CheatInfo*)malloc(sizeof(CheatInfo)); - if (pCheatInfo == NULL) { - pCheatInfo = pCurrentCheat; - } - - memset(pCurrentCheat, 0, sizeof(CheatInfo)); - pCurrentCheat->pPrevious = pPreviousCheat; - if (pPreviousCheat) { - pPreviousCheat->pNext = pCurrentCheat; - } - - // Fill in defaults - pCurrentCheat->nType = 0; // Default to cheat type 0 (apply each frame) - pCurrentCheat->nStatus = -1; // Disable cheat - - memcpy(pCurrentCheat->szCheatName, szQuote, QUOTE_MAX); - - continue; - } - - if ((t = LabelCheck(s, _T("type"))) != 0) { // Cheat type - if (nInside == INSIDE_NOTHING || pCurrentCheat == NULL) { - CheatError(pszFilename, nLine, pCurrentCheat, _T("rogue cheat type"), szLine); - break; - } - s = t; - - // Set type - pCurrentCheat->nType = _tcstol(s, NULL, 0); - - continue; - } - - if ((t = LabelCheck(s, _T("default"))) != 0) { // Default option - if (nInside == INSIDE_NOTHING || pCurrentCheat == NULL) { - CheatError(pszFilename, nLine, pCurrentCheat, _T("rogue default"), szLine); - break; - } - s = t; - - // Set default option - pCurrentCheat->nDefault = _tcstol(s, NULL, 0); - - continue; - } - - INT32 n = _tcstol(s, &t, 0); - if (t != s) { // New option - - if (nInside == INSIDE_NOTHING || pCurrentCheat == NULL) { - CheatError(pszFilename, nLine, pCurrentCheat, _T("rogue option"), szLine); - break; - } - - // Link a new Option structure to the cheat - if (n < CHEAT_MAX_OPTIONS) { - s = t; - - // Read option name - TCHAR* szQuote = NULL; - TCHAR* szEnd = NULL; - if (QuoteRead(&szQuote, &szEnd, s)) { - CheatError(pszFilename, nLine, pCurrentCheat, _T("option name omitted"), szLine); - break; - } - s = szEnd; - - if (pCurrentCheat->pOption[n] == NULL) { - pCurrentCheat->pOption[n] = (CheatOption*)malloc(sizeof(CheatOption)); - } - memset(pCurrentCheat->pOption[n], 0, sizeof(CheatOption)); - - memcpy(pCurrentCheat->pOption[n]->szOptionName, szQuote, QUOTE_MAX * sizeof(TCHAR)); - - INT32 nCurrentAddress = 0; - bool bOK = true; - while (nCurrentAddress < CHEAT_MAX_ADDRESS) { - INT32 nCPU = 0, nAddress = 0, nValue = 0; - - if (SkipComma(&s)) { - nCPU = _tcstol(s, &t, 0); // CPU number - if (t == s) { - CheatError(pszFilename, nLine, pCurrentCheat, _T("CPU number omitted"), szLine); - bOK = false; - break; - } - s = t; - - SkipComma(&s); - nAddress = _tcstol(s, &t, 0); // Address - if (t == s) { - bOK = false; - CheatError(pszFilename, nLine, pCurrentCheat, _T("address omitted"), szLine); - break; - } - s = t; - - SkipComma(&s); - nValue = _tcstol(s, &t, 0); // Value - if (t == s) { - bOK = false; - CheatError(pszFilename, nLine, pCurrentCheat, _T("value omitted"), szLine); - break; - } - } else { - if (nCurrentAddress) { // Only the first option is allowed no address - break; - } - if (n) { - bOK = false; - CheatError(pszFilename, nLine, pCurrentCheat, _T("CPU / address / value omitted"), szLine); - break; - } - } - - pCurrentCheat->pOption[n]->AddressInfo[nCurrentAddress].nCPU = nCPU; - pCurrentCheat->pOption[n]->AddressInfo[nCurrentAddress].nAddress = nAddress; - pCurrentCheat->pOption[n]->AddressInfo[nCurrentAddress].nValue = nValue; - nCurrentAddress++; - } - - if (!bOK) { - break; - } - - } - - continue; - } - - SKIP_WS(s); - if (*s == _T('}')) { - if (nInside != _T('{')) { - CheatError(pszFilename, nLine, pCurrentCheat, _T("missing opening bracket"), NULL); - break; - } - - nInside = INSIDE_NOTHING; - } - - // Line isn't (part of) a valid cheat -#if 0 - if (*s) { - CheatError(pszFilename, nLine, NULL, _T("rogue line"), szLine); - break; - } -#endif - - } - - if (h) { - fclose(h); - } - - return 0; -} - - -//TODO: make cross platform -static INT32 ConfigParseNebulaFile(TCHAR* pszFilename) -{ - -#if defined (BUILD_WIN32) - FILE *fp = _tfopen(pszFilename, _T("rt")); - if (fp == NULL) { - return 1; - } - - INT32 nLen; - INT32 i, j, n = 0; - TCHAR tmp[32]; - TCHAR szLine[1024]; - - CheatInfo* pCurrentCheat = NULL; - - while (1) - { - if (_fgetts(szLine, 1024, fp) == NULL) - break; - - nLen = _tcslen(szLine); - - if (nLen < 3 || szLine[0] == '[') continue; - - if (!_tcsncmp (_T("Name="), szLine, 5)) - { - n = 0; - - // Link new node into the list - CheatInfo* pPreviousCheat = pCurrentCheat; - pCurrentCheat = (CheatInfo*)malloc(sizeof(CheatInfo)); - if (pCheatInfo == NULL) { - pCheatInfo = pCurrentCheat; - } - - memset(pCurrentCheat, 0, sizeof(CheatInfo)); - pCurrentCheat->pPrevious = pPreviousCheat; - if (pPreviousCheat) { - pPreviousCheat->pNext = pCurrentCheat; - } - - // Fill in defaults - pCurrentCheat->nType = 0; // Default to cheat type 0 (apply each frame) - pCurrentCheat->nStatus = -1; // Disable cheat - pCurrentCheat->nDefault = 0; // Set default option - - _tcsncpy (pCurrentCheat->szCheatName, szLine + 5, QUOTE_MAX); - pCurrentCheat->szCheatName[nLen-6] = '\0'; - - continue; - } - - if (!_tcsncmp (_T("Default="), szLine, 8) && n >= 0) - { - _tcsncpy (tmp, szLine + 8, nLen-9); - tmp[nLen-9] = '\0'; - _stscanf (tmp, _T("%d"), &(pCurrentCheat->nDefault)); - continue; - } - - - i = 0, j = 0; - while (i < nLen) - { - if (szLine[i] == '=' && i < 4) j = i+1; - if (szLine[i] == ',' || szLine[i] == '\n') - { - if (pCurrentCheat->pOption[n] == NULL) { - pCurrentCheat->pOption[n] = (CheatOption*)malloc(sizeof(CheatOption)); - } - memset(pCurrentCheat->pOption[n], 0, sizeof(CheatOption)); - - _tcsncpy (pCurrentCheat->pOption[n]->szOptionName, szLine + j, QUOTE_MAX * sizeof(TCHAR)); - pCurrentCheat->pOption[n]->szOptionName[i-j] = '\0'; - - i++; j = i; - break; - } - i++; - } - - INT32 nAddress = -1, nValue = 0, nCurrentAddress = 0; - while (nCurrentAddress < CHEAT_MAX_ADDRESS) - { - if (i == nLen) break; - - if (szLine[i] == ',' || szLine[i] == '\n') - { - _tcsncpy (tmp, szLine + j, i-j); - tmp[i-j] = '\0'; - - if (nAddress == -1) { - _stscanf (tmp, _T("%x"), &nAddress); - } else { - _stscanf (tmp, _T("%x"), &nValue); - - pCurrentCheat->pOption[n]->AddressInfo[nCurrentAddress].nCPU = 0; // Always - pCurrentCheat->pOption[n]->AddressInfo[nCurrentAddress].nAddress = nAddress ^ 1; - pCurrentCheat->pOption[n]->AddressInfo[nCurrentAddress].nValue = nValue; - nCurrentAddress++; - - nAddress = -1; - nValue = 0; - } - j = i+1; - } - i++; - } - n++; - } - - fclose (fp); -#endif - return 0; -} - - -//TODO: make cross platform -static INT32 ConfigParseMAMEFile() -{ -#if defined (BUILD_WIN32) - -#define AddressInfo() \ - INT32 k = (flags >> 20) & 3; \ - for (INT32 i = 0; i < k+1; i++) { \ - pCurrentCheat->pOption[n]->AddressInfo[nCurrentAddress].nCPU = 0; \ - pCurrentCheat->pOption[n]->AddressInfo[nCurrentAddress].nAddress = nAddress + i; \ - pCurrentCheat->pOption[n]->AddressInfo[nCurrentAddress].nValue = (nValue >> ((k*8)-(i*8))) & 0xff; \ - nCurrentAddress++; \ - } \ - -#define OptionName(a) \ - if (pCurrentCheat->pOption[n] == NULL) { \ - pCurrentCheat->pOption[n] = (CheatOption*)malloc(sizeof(CheatOption)); \ - } \ - memset(pCurrentCheat->pOption[n], 0, sizeof(CheatOption)); \ - _tcsncpy (pCurrentCheat->pOption[n]->szOptionName, a, QUOTE_MAX * sizeof(TCHAR)); \ - -#define tmpcpy(a) \ - _tcsncpy (tmp, szLine + c0[a] + 1, c0[a+1] - (c0[a]+1)); \ - tmp[c0[a+1] - (c0[a]+1)] = '\0'; \ - - TCHAR szFileName[MAX_PATH] = _T(""); - _stprintf(szFileName, _T("%scheat.dat"), szAppCheatsPath); - - FILE *fz = _tfopen(szFileName, _T("rt")); - if (fz == NULL) { - return 1; - } - - TCHAR tmp[256]; - TCHAR tmp2[256]; - TCHAR gName[64]; - TCHAR szLine[1024]; - - INT32 nLen; - INT32 n = 0; - INT32 menu = 0; - INT32 nFound = 0; - INT32 nCurrentAddress = 0; - UINT32 flags = 0; - UINT32 nAddress = 0; - UINT32 nValue = 0; - UINT32 nAttrib = 0; - - CheatInfo* pCurrentCheat = NULL; - _stprintf(gName, _T(":%s:"), BurnDrvGetText(DRV_NAME)); - - while (1) - { - if (_fgetts(szLine, 1024, fz) == NULL) - break; - - nLen = _tcslen (szLine); - - if (szLine[0] == ';') continue; - - if (_tcsncmp (szLine, gName, lstrlen(gName))) { - if (nFound) break; - else continue; - } - - nFound = 1; - - INT32 c0[16], c1 = 0; // find colons / break - for (INT32 i = 0; i < nLen; i++) - if (szLine[i] == ':' || szLine[i] == '\n') - c0[c1++] = i; - - tmpcpy(1); // control flags - _stscanf (tmp, _T("%x"), &flags); - - tmpcpy(2); // cheat address - _stscanf (tmp, _T("%x"), &nAddress); - - tmpcpy(3); // cheat value - _stscanf (tmp, _T("%x"), &nValue); - - tmpcpy(4); // cheat attribute - _stscanf (tmp, _T("%x"), &nAttrib); - - tmpcpy(5); // cheat name - //was x7f00 - if (flags & 0x80007c00) continue; // skip various cheats (unhandled methods at this time) - - if ( flags & 0x00008000 || (flags & 0x0001000 && !menu)) { - if (nCurrentAddress < CHEAT_MAX_ADDRESS) { - AddressInfo(); - } - - continue; - } - - if (~flags & 0x00010000) { - n = 0; - menu = 0; - nCurrentAddress = 0; - - // Link new node into the list - CheatInfo* pPreviousCheat = pCurrentCheat; - pCurrentCheat = (CheatInfo*)malloc(sizeof(CheatInfo)); - if (pCheatInfo == NULL) { - pCheatInfo = pCurrentCheat; - } - - memset(pCurrentCheat, 0, sizeof(CheatInfo)); - pCurrentCheat->pPrevious = pPreviousCheat; - if (pPreviousCheat) { - pPreviousCheat->pNext = pCurrentCheat; - } - - // Fill in defaults - pCurrentCheat->nType = 0; // Default to cheat type 0 (apply each frame) - pCurrentCheat->nStatus = -1; // Disable cheat - pCurrentCheat->nDefault = 0; // Set default option - pCurrentCheat->bOneShot = 0; // Set default option (off) - pCurrentCheat->bWatchMode = 0; // Set default option (off) - - _tcsncpy (pCurrentCheat->szCheatName, tmp, QUOTE_MAX); - - if (lstrlen(tmp) <= 0 || flags == 0x60000000) { - n++; - continue; - } - - OptionName(_T("Disabled")); - - if (nAddress) { - if (flags & 0x1) { - pCurrentCheat->bOneShot = 1; // apply once and stop - } - if (flags & 0x2) { - pCurrentCheat->bWaitForModification = 1; // wait for modification before changing - } - if ((flags & 0x6) == 0x6) { - pCurrentCheat->bWatchMode = 1; // display value @ address - } - if (flags & 0x100) { // add options - INT32 nTotal = nValue + 1; - INT32 nPlus1 = (flags & 0x300) ? 1 : 0; // displayed value +1? - - //bprintf(0, _T("adding .. %X. options\n"), nTotal); - for (nValue = 0; nValue < nTotal; nValue++) { - swprintf(tmp2, L"# %d.", nValue + nPlus1); - n++; - nCurrentAddress = 0; - OptionName(tmp2); - AddressInfo(); - } - } else { - n++; - OptionName(tmp); - AddressInfo(); - } - } else { - menu = 1; - } - - continue; - } - - if ( flags & 0x00010000 && menu) { - n++; - nCurrentAddress = 0; - - if (flags & 0x1) { - pCurrentCheat->bOneShot = 1; // apply once and stop - } - if (flags & 0x2) { - pCurrentCheat->bWaitForModification = 1; // wait for modification before changing - } - if ((flags & 0x6) == 0x6) { - pCurrentCheat->bWatchMode = 1; // display value @ address - } - - OptionName(tmp); - AddressInfo(); - - continue; - } - } - - fclose (fz); -#endif - return 0; -} - - -INT32 ConfigCheatLoad() -{ - TCHAR szFilename[MAX_PATH] = _T(""); - - _stprintf(szFilename, _T("%s%s.ini"), szAppCheatsPath, BurnDrvGetText(DRV_NAME)); - if (ConfigParseFile(szFilename)) { - _stprintf(szFilename, _T("%s%s.dat"), szAppCheatsPath, BurnDrvGetText(DRV_NAME)); - if (ConfigParseNebulaFile(szFilename)) { - if (ConfigParseMAMEFile()) { - return 1; - } - } - } - - if (pCheatInfo) { - INT32 nCurrentCheat = 0; - while (CheatEnable(nCurrentCheat, -1) == 0) { - nCurrentCheat++; - } - - CheatUpdate(); - } - - return 0; -} - - diff --git a/jan/src/burner/cong.cpp b/jan/src/burner/cong.cpp deleted file mode 100644 index 0b43315a7..000000000 --- a/jan/src/burner/cong.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// Burner Config for Game file module -#include "burner.h" - -const INT32 nConfigMinVersion = 0x020921; - -bool bSaveInputs = true; - -static TCHAR* GameConfigName() -{ - // Return the path of the config file for this game - static TCHAR szName[32]; - _stprintf(szName, _T("config/games/%s.ini"), BurnDrvGetText(DRV_NAME)); - return szName; -} - -// Read in the config file for the game-specific inputs -INT32 ConfigGameLoad(bool bOverWrite) -{ - TCHAR szLine[256]; - INT32 nFileVersion = 0; - - FILE* h = _tfopen(GameConfigName(), _T("rt")); - if (h == NULL) { - return 1; - } - - if (bOverWrite) { - nAnalogSpeed = 0x0100; - nBurnCPUSpeedAdjust = 0x0100; - } - - // Go through each line of the config file and process inputs - while (_fgetts(szLine, sizeof(szLine), h)) { - TCHAR *szValue; - INT32 nLen = _tcslen(szLine); - - // Get rid of the linefeed at the end - if (szLine[nLen - 1] == 10) { - szLine[nLen - 1] = 0; - nLen--; - } - - szValue = LabelCheck(szLine, _T("version")); - if (szValue) { - nFileVersion = _tcstol(szValue, NULL, 0); - } - - if (bOverWrite) { - szValue = LabelCheck(szLine, _T("analog")); - if (szValue) { - nAnalogSpeed = _tcstol(szValue, NULL, 0); - } - szValue = LabelCheck(szLine, _T("cpu")); - if (szValue) { - nBurnCPUSpeedAdjust = _tcstol(szValue, NULL, 0); - } - } - - if (nConfigMinVersion <= nFileVersion && nFileVersion <= nBurnVer) { - szValue = LabelCheck(szLine, _T("input")); - if (szValue) { - GameInpRead(szValue, bOverWrite); - continue; - } - - szValue = LabelCheck(szLine, _T("macro")); - if (szValue) { - GameInpMacroRead(szValue, bOverWrite); - continue; - } - - szValue = LabelCheck(szLine, _T("custom")); - if (szValue) { - GameInpCustomRead(szValue, bOverWrite); - continue; - } - } - } - - fclose(h); - return 0; -} - -// Write out the config file for the game-specific inputs -INT32 ConfigGameSave(bool bSave) -{ - FILE* h; - - if (!bSave) { - GameInpBlank(0); - ConfigGameLoad(false); - } - - h = _tfopen(GameConfigName(), _T("wt")); - if (h == NULL) { - return 1; - } - - // Write title - _ftprintf(h, _T("// ") _T(APP_TITLE) _T(" v%s --- Config File for %s (%s)\n\n"), szAppBurnVer, BurnDrvGetText(DRV_NAME), ANSIToTCHAR(BurnDrvGetTextA(DRV_FULLNAME), NULL, 0)); - - _ftprintf(h, _T("// --- Miscellaneous ----------------------------------------------------------\n\n")); - // Write version number - _ftprintf(h, _T("version 0x%06X\n\n"), nBurnVer); - // Write speed for relative analog controls - _ftprintf(h, _T("analog 0x%04X\n"), nAnalogSpeed); - // Write CPU speed adjustment - _ftprintf(h, _T("cpu 0x%04X\n"), nBurnCPUSpeedAdjust); - - _ftprintf(h, _T("\n\n\n")); - _ftprintf(h, _T("// --- Inputs -----------------------------------------------------------------\n\n")); - - GameInpWrite(h); - - fclose(h); - return 0; -} - diff --git a/jan/src/burner/dat.cpp b/jan/src/burner/dat.cpp deleted file mode 100644 index 7c821a0be..000000000 --- a/jan/src/burner/dat.cpp +++ /dev/null @@ -1,633 +0,0 @@ -// Burner data file module (for ROM managers) -// written 2001 LoqiqX -// updated 11/2003 by LvR -- essentially a rewrite - -#include "burner.h" - -static void ReplaceAmpersand(char *szBuffer, char *szGameName) -{ - UINT32 nStringPos = 0; - - for (UINT32 i = 0; i < strlen(szGameName); i++) { - if (szGameName[i] == '&') { - szBuffer[nStringPos + 0] = '&'; - szBuffer[nStringPos + 1] = 'a'; - szBuffer[nStringPos + 2] = 'm'; - szBuffer[nStringPos + 3] = 'p'; - szBuffer[nStringPos + 4] = ';'; - nStringPos += 5; - } else { - szBuffer[nStringPos] = szGameName[i]; - nStringPos++; - } - } -} - -static void ReplaceLessThan(char *szBuffer, char *szGameName) -{ - UINT32 nStringPos = 0; - - for (UINT32 i = 0; i < strlen(szGameName); i++) { - if (szGameName[i] == '<') { - szBuffer[nStringPos + 0] = '&'; - szBuffer[nStringPos + 1] = 'l'; - szBuffer[nStringPos + 2] = 't'; - szBuffer[nStringPos + 3] = ';'; - nStringPos += 4; - } else { - szBuffer[nStringPos] = szGameName[i]; - nStringPos++; - } - } -} - -static void ReplaceGreaterThan(char *szBuffer, char *szGameName) -{ - UINT32 nStringPos = 0; - - for (UINT32 i = 0; i < strlen(szGameName); i++) { - if (szGameName[i] == '>') { - szBuffer[nStringPos + 0] = '&'; - szBuffer[nStringPos + 1] = 'g'; - szBuffer[nStringPos + 2] = 't'; - szBuffer[nStringPos + 3] = ';'; - nStringPos += 4; - } else { - szBuffer[nStringPos] = szGameName[i]; - nStringPos++; - } - } -} - -#define remove_driver_leader(HARDWARE_CODE, NUM_CHARS, NORMAL_PASS) \ - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_CODE) { \ - char Temp[NUM_CHARS + 32]; \ - INT32 Length; \ - if (sgName[0]) { \ - Length = strlen(sgName); \ - memset(Temp, 0, NUM_CHARS + 32); \ - strcpy(Temp, sgName); \ - memset(sgName, 0, NUM_CHARS); \ - for (INT32 pos = 0; pos < Length; pos++) { \ - sgName[pos] = Temp[pos + NUM_CHARS]; \ - } \ - } \ - if (NORMAL_PASS) { \ - if (spName[0]) { \ - Length = strlen(spName); \ - memset(Temp, 0, NUM_CHARS + 32); \ - strcpy(Temp, spName); \ - memset(spName, 0, NUM_CHARS); \ - for (INT32 pos = 0; pos < Length; pos++) { \ - spName[pos] = Temp[pos + NUM_CHARS]; \ - } \ - } \ - if (sbName[0]) { \ - Length = strlen(sbName); \ - memset(Temp, 0, NUM_CHARS + 32); \ - strcpy(Temp, sbName); \ - memset(sbName, 0, NUM_CHARS); \ - for (INT32 pos = 0; pos < Length; pos++) { \ - sbName[pos] = Temp[pos + NUM_CHARS]; \ - } \ - } \ - } \ - } - -INT32 write_datfile(INT32 bType, FILE* fDat) -{ - INT32 nRet=0; - UINT32 nOldSelect=0; - UINT32 nGameSelect=0; - UINT32 nParentSelect,nBoardROMSelect; - - fprintf(fDat, "\n"); - fprintf(fDat, "\n\n"); - fprintf(fDat, "\n"); - fprintf(fDat, "\t
\n"); - if (bType == DAT_ARCADE_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - Arcade Games\n"); - if (bType == DAT_MEGADRIVE_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - Megadrive Games\n"); - if (bType == DAT_PCENGINE_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - PC-Engine Games\n"); - if (bType == DAT_TG16_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - TurboGrafx 16 Games\n"); - if (bType == DAT_SGX_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - SuprGrafx Games\n"); - if (bType == DAT_SG1000_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - Sega SG-1000 Games\n"); - if (bType == DAT_COLECO_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - ColecoVision Games\n"); - if (bType == DAT_MASTERSYSTEM_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - Master System Games\n"); - if (bType == DAT_GAMEGEAR_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - Game Gear Games\n"); - if (bType == DAT_MSX_ONLY) fprintf(fDat, "\t\t" APP_TITLE " - MSX 1 Games\n"); - - if (bType == DAT_ARCADE_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" Arcade Games\n"), szAppBurnVer); - if (bType == DAT_MEGADRIVE_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" Megadrive Games\n"), szAppBurnVer); - if (bType == DAT_PCENGINE_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" PC-Engine Games\n"), szAppBurnVer); - if (bType == DAT_TG16_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" TurboGrafx 16 Games\n"), szAppBurnVer); - if (bType == DAT_SGX_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" SuprGrafx Games\n"), szAppBurnVer); - if (bType == DAT_SG1000_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" Sega SG-1000 Games\n"), szAppBurnVer); - if (bType == DAT_COLECO_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" ColecoVision Games\n"), szAppBurnVer); - if (bType == DAT_MASTERSYSTEM_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" Master System Games\n"), szAppBurnVer); - if (bType == DAT_GAMEGEAR_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" Game Gear Games\n"), szAppBurnVer); - if (bType == DAT_MSX_ONLY) _ftprintf(fDat, _T("\t\t") _T(APP_TITLE) _T(" v%s") _T(" MSX 1 Games\n"), szAppBurnVer); - fprintf(fDat, "\t\tStandard DatFile\n"); - _ftprintf(fDat, _T("\t\t%s\n"), szAppBurnVer); - fprintf(fDat, "\t\t" APP_TITLE "\n"); - fprintf(fDat, "\t\thttps://www.fbalpha.com/\n"); - fprintf(fDat, "\t\thttps://www.fbalpha.com/\n"); - fprintf(fDat, "\t\t\n"); - fprintf(fDat, "\t
\n"); - - nOldSelect=nBurnDrvActive; // preserve the currently selected driver - - // Go over each of the games - for (nGameSelect=0;nGameSelect\n", sgName, spName, spName); - } else { - fprintf(fDat, "\t\n", sgName, spName, spName, ssName); - } - } - else - { - // Add "romof" (but not 'cloneof') line for games that have boardROMs - if (nBoardROMSelect!=nGameSelect && nBoardROMSelect!=-1U) - { - fprintf(fDat, "\t\n", sgName, sbName); - } else { - if (!strcmp(ssName, "") || !strcmp(ssName, sgName)) { - fprintf(fDat, "\t\n", sgName); - } else { - fprintf(fDat, "\t\n", sgName, ssName); - } - } - } - - char szGameName[255]; - char szGameNameBuffer[255]; - char szManufacturer[255]; - char szManufacturerBuffer[255]; - - memset(szGameName, 0, 255); - memset(szGameNameBuffer, 0, 255); - memset(szManufacturer, 0, 255); - memset(szManufacturerBuffer, 0, 255); - - strcpy(szGameName, DecorateGameName(nBurnDrvActive)); - ReplaceAmpersand(szGameNameBuffer, szGameName); - memset(szGameName, 0, 255); - strcpy(szGameName, szGameNameBuffer); - memset(szGameNameBuffer, 0, 255); - ReplaceLessThan(szGameNameBuffer, szGameName); - memset(szGameName, 0, 255); - strcpy(szGameName, szGameNameBuffer); - memset(szGameNameBuffer, 0, 255); - ReplaceGreaterThan(szGameNameBuffer, szGameName); - - strcpy(szManufacturer, BurnDrvGetTextA(DRV_MANUFACTURER)); - ReplaceAmpersand(szManufacturerBuffer, szManufacturer); - memset(szManufacturer, 0, 255); - strcpy(szManufacturer, szManufacturerBuffer); - memset(szManufacturerBuffer, 0, 255); - ReplaceLessThan(szManufacturerBuffer, szManufacturer); - memset(szManufacturer, 0, 255); - strcpy(szManufacturer, szManufacturerBuffer); - memset(szManufacturerBuffer, 0, 255); - ReplaceGreaterThan(szManufacturerBuffer, szManufacturer); - - fprintf(fDat, "\t\t%s\n", szGameNameBuffer); - fprintf(fDat, "\t\t%s\n", BurnDrvGetTextA(DRV_DATE)); - fprintf(fDat, "\t\t%s\n", szManufacturerBuffer); - - // Write the individual ROM info - for (nPass=0; nPass<2; nPass++) - { - nBurnDrvActive=nGameSelect; - - // Skip pass 0 if possible (pass 0 only needed for old-style clrMAME format) - if (nPass==0 /*&& (nBoardROMSelect==nGameSelect || nBoardROMSelect==-1U)*/) - continue; - - // Go over each of the files needed for this game (upto 0x0100) - for (i=0, nRet=0; nRet==0 && i<0x100; i++) - { - INT32 nRetTmp=0; - struct BurnRomInfo ri; - INT32 nLen; UINT32 nCrc; - char *szPossibleName=NULL; - INT32 j, nMerged=0; - - memset(&ri,0,sizeof(ri)); - - // Get info on this file - nBurnDrvActive=nGameSelect; - nRet=BurnDrvGetRomInfo(&ri,i); - nRet+=BurnDrvGetRomName(&szPossibleName,i,0); - - if (ri.nLen==0) continue; - - if (nRet==0) - { - struct BurnRomInfo riTmp; - char *szPossibleNameTmp; - nLen=ri.nLen; nCrc=ri.nCrc; - - // Check for files from boardROMs - if (nBoardROMSelect!=nGameSelect && nBoardROMSelect!=-1U) { - nBurnDrvActive=nBoardROMSelect; - nRetTmp=0; - - // Go over each of the files needed for this game (upto 0x0100) - for (j=0; nRetTmp==0 && j<0x100; j++) - { - memset(&riTmp,0,sizeof(riTmp)); - - nRetTmp+=BurnDrvGetRomInfo(&riTmp,j); - nRetTmp+=BurnDrvGetRomName(&szPossibleNameTmp,j,0); - - if (nRetTmp==0) - { - if (riTmp.nLen && riTmp.nCrc==nCrc && !strcmp(szPossibleName, szPossibleNameTmp)) - { - // This file is from a boardROM - nMerged|=2; - nRetTmp++; - } - } - } - } - - if (!nMerged && nParentSelect!=nGameSelect && nParentSelect!=-1U) { - nBurnDrvActive=nParentSelect; - nRetTmp=0; - - // Go over each of the files needed for this game (upto 0x0100) - for (j=0; nRetTmp==0 && j<0x100; j++) - { - memset(&riTmp,0,sizeof(riTmp)); - - nRetTmp+=BurnDrvGetRomInfo(&riTmp,j); - nRetTmp+=BurnDrvGetRomName(&szPossibleNameTmp,j,0); - - if (nRetTmp==0) - { - if (riTmp.nLen && riTmp.nCrc==nCrc && !strcmp(szPossibleName, szPossibleNameTmp)) - { - // This file is from a parent set - nMerged|=1; - nRetTmp++; - } - } - } - } - - nBurnDrvActive=nGameSelect; // Switch back to game - } - - char szPossibleNameBuffer[255]; - char szPossibleNameBuffer2[255]; - - memset(szPossibleNameBuffer, 0, 255); - memset(szPossibleNameBuffer2, 0, 255); - - ReplaceAmpersand(szPossibleNameBuffer, szPossibleName); - strcpy(szPossibleNameBuffer2, szPossibleNameBuffer); - memset(szPossibleNameBuffer, 0, 255); - ReplaceLessThan(szPossibleNameBuffer, szPossibleNameBuffer2); - memset(szPossibleNameBuffer2, 0, 255); - strcpy(szPossibleNameBuffer2, szPossibleNameBuffer); - memset(szPossibleNameBuffer, 0, 255); - ReplaceGreaterThan(szPossibleNameBuffer, szPossibleNameBuffer2); - - // File info - if (nPass==1 && !nMerged) { - if (ri.nType & BRF_NODUMP) { - fprintf(fDat, "\t\t\n", szPossibleNameBuffer, ri.nLen); - } else { - fprintf(fDat, "\t\t\n", szPossibleNameBuffer, ri.nLen, ri.nCrc); - } - } - if (nPass==1 && nMerged) - { - // Files from parent/boardROMs - if (ri.nType & BRF_NODUMP) { - fprintf(fDat, "\t\t\n", szPossibleNameBuffer, szPossibleNameBuffer, ri.nLen); - } else { - fprintf(fDat, "\t\t\n", szPossibleNameBuffer, szPossibleNameBuffer, ri.nLen, ri.nCrc); - } - } - } - - // samples - if (strcmp(ssName, "")) { - for (i=0, nRet=0; nRet==0 && i<0x100; i++) - { - struct BurnSampleInfo si; - char *szPossibleName=NULL; - - memset(&si,0,sizeof(si)); - - // Get info on this file - nBurnDrvActive=nGameSelect; - nRet=BurnDrvGetSampleInfo(&si,i); - nRet+=BurnDrvGetSampleName(&szPossibleName,i,0); - - if (si.nFlags==0) continue; - - if (nPass == 1) { - char szPossibleNameBuffer[255]; - char szPossibleNameBuffer2[255]; - - memset(szPossibleNameBuffer, 0, 255); - memset(szPossibleNameBuffer2, 0, 255); - - ReplaceAmpersand(szPossibleNameBuffer, szPossibleName); - strcpy(szPossibleNameBuffer2, szPossibleNameBuffer); - memset(szPossibleNameBuffer, 0, 255); - ReplaceLessThan(szPossibleNameBuffer, szPossibleNameBuffer2); - memset(szPossibleNameBuffer2, 0, 255); - strcpy(szPossibleNameBuffer2, szPossibleNameBuffer); - memset(szPossibleNameBuffer, 0, 255); - ReplaceGreaterThan(szPossibleNameBuffer, szPossibleNameBuffer2); - - fprintf(fDat, "\t\t\n", szPossibleNameBuffer); - } - } - } - } - - fprintf(fDat, "\t\n"); - } - - // Do another pass over each of the games to find boardROMs - for (nBurnDrvActive=0; nBurnDrvActive\n", sgName); - fprintf(fDat, "\t\t%s\n", DecorateGameName(nBurnDrvActive)); - fprintf(fDat, "\t\t%s\n", BurnDrvGetTextA(DRV_DATE)); - fprintf(fDat, "\t\t%s\n", BurnDrvGetTextA(DRV_MANUFACTURER)); - - for (nPass=0; nPass<2; nPass++) - { - // No meta information needed (pass 0 only needed for old-style clrMAME format) - if (nPass==0) continue; - - // Go over each of the individual files (upto 0x0100) - for (i=0; i<0x100; i++) - { - struct BurnRomInfo ri; - char *szPossibleName=NULL; - - memset(&ri,0,sizeof(ri)); - - nRet=BurnDrvGetRomInfo(&ri,i); - nRet+=BurnDrvGetRomName(&szPossibleName,i,0); - - if (ri.nLen==0) continue; - - if (nRet==0) { - char szPossibleNameBuffer[255]; - char szPossibleNameBuffer2[255]; - - memset(szPossibleNameBuffer, 0, 255); - memset(szPossibleNameBuffer2, 0, 255); - - ReplaceAmpersand(szPossibleNameBuffer, szPossibleName); - strcpy(szPossibleNameBuffer2, szPossibleNameBuffer); - memset(szPossibleNameBuffer, 0, 255); - ReplaceLessThan(szPossibleNameBuffer, szPossibleNameBuffer2); - memset(szPossibleNameBuffer2, 0, 255); - strcpy(szPossibleNameBuffer2, szPossibleNameBuffer); - memset(szPossibleNameBuffer, 0, 255); - ReplaceGreaterThan(szPossibleNameBuffer, szPossibleNameBuffer2); - - fprintf(fDat, "\t\t\n", szPossibleNameBuffer, ri.nLen, ri.nCrc); - } - } - } - - fprintf(fDat, "\t\n"); - } - - // Restore current driver - nBurnDrvActive=nOldSelect; - - fprintf(fDat, "
"); - - return 0; -} - -INT32 create_datfile(TCHAR* szFilename, INT32 bType) -{ - FILE *fDat=0; - INT32 nRet=0; - - if ((fDat = _tfopen(szFilename, _T("wt")))==0) - return -1; - - nRet = write_datfile(bType, fDat); - - fclose(fDat); - - return nRet; -} diff --git a/jan/src/burner/gamc.cpp b/jan/src/burner/gamc.cpp deleted file mode 100644 index f350c992d..000000000 --- a/jan/src/burner/gamc.cpp +++ /dev/null @@ -1,776 +0,0 @@ -// Burner Game Control -#include "burner.h" - -static char szPlay[4][4]={"p1 ", "p2 ", "p3 ", "p4 "}; - -#define KEY(x) { pgi->nInput = GIT_SWITCH; pgi->Input.Switch.nCode = (UINT16)(x); } -#define MACRO(x) { pgi->Macro.nMode = 1; pgi->Macro.Switch.nCode = (UINT16)(x); } - -// Configure the misc game controls -INT32 GamcMisc(struct GameInp* pgi, char* szi, INT32 nPlayer) -{ - switch (nPlayer) { - case 0: - // Set general controls according to Player 1 settings - if (strcmp(szi, "diag") == 0) { - KEY(FBK_F2); - return 0; - } - if (strcmp(szi, "reset") == 0) { - KEY(FBK_F3); - return 0; - } - if (strcmp(szi, "service" ) == 0) { - KEY(FBK_9); - return 0; - } - if (strcmp(szi, "service2" ) == 0) { - KEY(FBK_0); - return 0; - } - if (strcmp(szi, "service3" ) == 0) { - KEY(FBK_MINUS); - return 0; - } - if (strcmp(szi, "service4" ) == 0) { - KEY(FBK_EQUALS); - return 0; - } - if (strcmp(szi, "tilt") == 0) { - KEY(FBK_T); - return 0; - } - - if (strcmp(szi, "op menu" ) == 0) { - KEY(FBK_F1); - return 0; - } - - if (strcmp(szi, "clear credit" ) == 0) { - KEY(FBK_G); - return 0; - } - - if (strcmp(szi, "hopper" ) == 0) { - KEY(FBK_H); - return 0; - } - - // Mahjong controls - if (strcmp(szi, "mah a") == 0) { - KEY(FBK_A); - return 0; - } - - if (strcmp(szi, "mah b") == 0) { - KEY(FBK_B); - return 0; - } - - if (strcmp(szi, "mah c") == 0) { - KEY(FBK_C); - return 0; - } - - if (strcmp(szi, "mah d") == 0) { - KEY(FBK_D); - return 0; - } - - if (strcmp(szi, "mah e") == 0) { - KEY(FBK_E); - return 0; - } - - if (strcmp(szi, "mah f") == 0) { - KEY(FBK_F); - return 0; - } - - if (strcmp(szi, "mah g") == 0) { - KEY(FBK_G); - return 0; - } - - if (strcmp(szi, "mah h") == 0) { - KEY(FBK_H); - return 0; - } - - if (strcmp(szi, "mah i") == 0) { - KEY(FBK_I); - return 0; - } - - if (strcmp(szi, "mah j") == 0) { - KEY(FBK_J); - return 0; - } - - if (strcmp(szi, "mah k") == 0) { - KEY(FBK_K); - return 0; - } - - if (strcmp(szi, "mah l") == 0) { - KEY(FBK_L); - return 0; - } - - if (strcmp(szi, "mah m") == 0) { - KEY(FBK_M); - return 0; - } - - if (strcmp(szi, "mah n") == 0) { - KEY(FBK_N); - return 0; - } - - if (strcmp(szi, "mah kan") == 0) { - KEY(FBK_LCONTROL); - return 0; - } - - if (strcmp(szi, "mah pon") == 0) { - KEY(FBK_LALT); - return 0; - } - - if (strcmp(szi, "mah chi") == 0) { - KEY(FBK_SPACE); - return 0; - } - - if (strcmp(szi, "mah reach") == 0) { - KEY(FBK_LSHIFT); - return 0; - } - - if (strcmp(szi, "mah ron") == 0) { - KEY(FBK_Z); - return 0; - } - - if (strcmp(szi, "mah ff") == 0) { - KEY(FBK_Y); - return 0; - } - - if (strcmp(szi, "mah lc") == 0) { - KEY(FBK_RALT); - return 0; - } - - if (strcmp(szi, "mah bet") == 0) { - KEY(FBK_2); - return 0; - } - - if (strcmp(szi, "mah score") == 0) { - KEY(FBK_RCONTROL); - return 0; - } - - // Player 1 controls - if (strcmp(szi, "p1 start") == 0) { - KEY(FBK_1); - return 0; - } - if (strcmp(szi, "p1 select" ) == 0) { - KEY(FBK_3); - return 0; - } - if (strcmp(szi, "p1 coin" ) == 0) { - KEY(FBK_5); - return 0; - } - break; - case 1: - if (strcmp(szi, "p2 start") == 0) { - KEY(FBK_2); - return 0; - } - if (strcmp(szi, "p2 select" ) == 0) { - KEY(FBK_4); - return 0; - } - if (strcmp(szi, "p2 coin" ) == 0) { - KEY(FBK_6); - return 0; - } - break; - case 2: - if (strcmp(szi, "p3 coin" ) == 0) { - KEY(FBK_7); - return 0; - } - if (strcmp(szi, "p3 start") == 0) { - KEY(FBK_3); - return 0; - } - break; - case 3: - if (strcmp(szi, "p4 start") == 0) { - KEY(FBK_4); - return 0; - } - if (strcmp(szi, "p4 coin" ) == 0) { - KEY(FBK_8); - return 0; - } - break; - } - - if (strncmp(szi, "mouse", 5) == 0) { - - if (strcmp(szi, "mouse x-axis") == 0) { - pgi->nInput = GIT_MOUSEAXIS; - pgi->Input.MouseAxis.nAxis = 0; - return 0; - - } - if (strcmp(szi, "mouse y-axis") == 0) { - pgi->nInput = GIT_MOUSEAXIS; - pgi->Input.MouseAxis.nAxis = 1; - return 0; - } - if (strncmp(szi, "mouse button", 12) == 0) { - char* szb = szi + 13; - INT32 nButton = strtol(szb, NULL, 0); - if (nButton >= 1) { - nButton--; - } - KEY(0x8080 + nButton); - return 0; - } - } - - return 0; -} - -static void SetSliderKey(struct GameInp* pgi, INT32 k0, INT32 k1, INT32 nSlide) -{ - pgi->nInput = GIT_KEYSLIDER; - pgi->Input.Slider.SliderAxis.nSlider[0] = (UINT8)k0; - pgi->Input.Slider.SliderAxis.nSlider[1] = (UINT8)k1; - - if (nSlide == 2) { - // Sliding - pgi->Input.Slider.nSliderSpeed = 0x0700; - pgi->Input.Slider.nSliderCenter = 0; - } else { - // Sliding (centering) - pgi->Input.Slider.nSliderSpeed = 0x0E00; - pgi->Input.Slider.nSliderCenter = 10; - } -} - -INT32 GamcAnalogKey(struct GameInp* pgi, char* szi, INT32 nPlayer, INT32 nSlide) -{ - char *szSearch = NULL; - INT32 k0 = 0, k1 = 0; - szSearch = szPlay[nPlayer & 3]; - if (_strnicmp(szSearch, szi, 3) != 0) { // Not our player - return 1; - } - szi += 3; - - if (*szi == 0) { - return 1; - } - if (strcmp(szi + 1, "-axis") != 0) { - return 1; - } - - // Keyboard - if (szi[0] == 'x') { - k0 = FBK_LEFTARROW; - k1 = FBK_RIGHTARROW; - } - if (szi[0] == 'y') { - k0 = FBK_UPARROW; - k1 = FBK_DOWNARROW; - } - if (szi[0] == 'z') { - k0 = FBK_V; - k1 = FBK_F; - } - if (k0 == 0 || k1 == 0) { - return 1; - } - - SetSliderKey(pgi, k0, k1, nSlide); - - return 0; -} - -INT32 GamcAnalogJoy(struct GameInp* pgi, char* szi, INT32 nPlayer, INT32 nJoy, INT32 nSlide) -{ - INT32 nAxis = 0; - - char* szSearch = szPlay[nPlayer & 3]; - if (_strnicmp(szSearch, szi, 3) != 0) { // Not our player - return 1; - } - szi += 3; - - if (szi[0] == 0) { - return 1; - } - if (strncmp(szi + 1, "-axis", 5) != 0) { - return 1; - } - - if (strncmp(szi, "x", 1) == 0) { - nAxis = 0; - } - if (strncmp(szi, "y", 1) == 0) { - nAxis = 1; - } - if (strncmp(szi, "z", 1) == 0) { - nAxis = 2; - } - - if (strlen(szi) > 6) { - if (strcmp(&szi[6], "-neg") == 0) { - nSlide = 3; - } - if (strcmp(&szi[6], "-pos") == 0) { - nSlide = 4; - } - } - - switch (nSlide) { - case 2: // Sliding - pgi->nInput = GIT_JOYSLIDER; - pgi->Input.Slider.nSliderValue = 0x8000; // Put slider in the middle - pgi->Input.Slider.nSliderSpeed = 0x0700; - pgi->Input.Slider.nSliderCenter = 0; - pgi->Input.Slider.JoyAxis.nAxis = nAxis; - pgi->Input.Slider.JoyAxis.nJoy = (UINT8)nJoy; - break; - case 1: // Sliding (centering) - pgi->nInput = GIT_JOYSLIDER; - pgi->Input.Slider.nSliderValue = 0x8000; // Put slider in the middle - pgi->Input.Slider.nSliderSpeed = 0x0E00; - pgi->Input.Slider.nSliderCenter = 10; - pgi->Input.Slider.JoyAxis.nAxis = nAxis; - pgi->Input.Slider.JoyAxis.nJoy = (UINT8)nJoy; - break; - case 3: // Absolute, axis-neg - pgi->nInput = GIT_JOYAXIS_NEG; - pgi->Input.JoyAxis.nAxis = nAxis; - pgi->Input.JoyAxis.nJoy = (UINT8)nJoy; - break; - case 4: // Absolute, axis-pos - pgi->nInput = GIT_JOYAXIS_POS; - pgi->Input.JoyAxis.nAxis = nAxis; - pgi->Input.JoyAxis.nJoy = (UINT8)nJoy; - break; - default: // Absolute, entire axis - pgi->nInput = GIT_JOYAXIS_FULL; - pgi->Input.JoyAxis.nAxis = nAxis; - pgi->Input.JoyAxis.nJoy = (UINT8)nJoy; - } - - return 0; -} - -// Set a Game Input to use Device 'nDevice' if it belongs to 'nPlayer' -// -2 = nothing -1 == keyboard, 0 == joystick 1, 1 == joystick 2 etc... -INT32 GamcPlayer(struct GameInp* pgi, char* szi, INT32 nPlayer, INT32 nDevice) -{ - char* szSearch = szPlay[nPlayer & 3]; - INT32 nJoyBase = 0; - - if (_strnicmp(szSearch, szi, 3) != 0) { // Not our player - return 1; - } - szi += 3; - - if (nDevice <= -2) { - INT32 bOurs = 0; - if (strcmp(szi, "up") == 0 || strcmp(szi, "y-axis-neg") == 0) { - bOurs = 1; - } - if (strcmp(szi, "down") == 0 || strcmp(szi, "y-axis-pos") == 0) { - bOurs = 1; - } - if (strcmp(szi, "left") == 0 || strcmp(szi, "x-axis-neg") == 0) { - bOurs = 1; - } - if (strcmp(szi, "right") == 0 || strcmp(szi, "x-axis-pos") == 0) { - bOurs = 1; - } - if (strncmp(szi, "fire ", 5) == 0) { - bOurs = 1; - } - - if (!bOurs) { - return 1; - } - - pgi->nInput = GIT_CONSTANT; // Constant zero - pgi->Input.Constant.nConst = 0; // - - return 0; - } - - // Now check the rest of it - if (nDevice == -1) { - // Keyboard - if (strcmp(szi, "up") == 0 || strcmp(szi, "y-axis-neg") == 0) { - KEY(FBK_UPARROW); - } - if (strcmp(szi, "down") == 0 || strcmp(szi, "y-axis-pos") == 0) { - KEY(FBK_DOWNARROW); - } - if (strcmp(szi, "left") == 0 || strcmp(szi, "x-axis-neg") == 0) { - KEY(FBK_LEFTARROW); - } - if (strcmp(szi, "right") == 0 || strcmp(szi, "x-axis-pos") == 0) { - KEY(FBK_RIGHTARROW); - } - if (nFireButtons == 4) { - if (strcmp(szi, "fire 1") == 0) { - KEY(FBK_Z); - } - if (strcmp(szi, "fire 2") == 0) { - KEY(FBK_X); - } - if (strcmp(szi, "fire 3") == 0) { - KEY(FBK_C); - } - if (strcmp(szi, "fire 4") == 0) { - KEY(FBK_V); - } - -// if (_stricmp(szi, "Button ABC") == 0) { -// MACRO(FBK_A); -// } -// if (_stricmp(szi, "Button BCD") == 0) { -// MACRO(FBK_S); -// } -// if (_stricmp(szi, "Button ABCD") == 0) { -// MACRO(FBK_D); -// } - - } else { - if (bStreetFighterLayout) { - if (strcmp(szi, "fire 1") == 0) { - KEY(FBK_A); - } - if (strcmp(szi, "fire 2") == 0) { - KEY(FBK_S); - } - if (strcmp(szi, "fire 3") == 0) { - KEY(FBK_D); - } - if (strcmp(szi, "fire 4") == 0) { - KEY(FBK_Z); - } - if (strcmp(szi, "fire 5") == 0) { - KEY(FBK_X); - } - if (strcmp(szi, "fire 6") == 0) { - KEY(FBK_C); - } - if (_stricmp(szi, "3 Punch") == 0) { - MACRO(FBK_F); - } - if (_stricmp(szi, "3 Kick") == 0) { - MACRO(FBK_V); - } - } else { - if (strcmp(szi, "fire 1") == 0) { - KEY(FBK_Z); - } - if (strcmp(szi, "fire 2") == 0) { - KEY(FBK_X); - } - if (strcmp(szi, "fire 3") == 0) { - KEY(FBK_C); - } - if (strcmp(szi, "fire 4") == 0) { - KEY(FBK_A); - } - if (strcmp(szi, "fire 5") == 0) { - KEY(FBK_S); - } - if (strcmp(szi, "fire 6") == 0) { - KEY(FBK_D); - } - if (strcmp(szi, "fire 7") == 0) { - KEY(FBK_Q); - } - if (strcmp(szi, "fire 8") == 0) { - KEY(FBK_W); - } - if (strcmp(szi, "fire 9") == 0) { - KEY(FBK_E); - } - } - } - - return 0; - } - - // Joystick - nJoyBase = 0x4000; - nJoyBase |= nDevice << 8; - - if (strcmp(szi, "up") == 0) { - KEY(nJoyBase + 0x02) - } - if (strcmp(szi, "down") == 0) { - KEY(nJoyBase + 0x03) - } - if (strcmp(szi, "left") == 0) { - KEY(nJoyBase + 0x00) - } - if (strcmp(szi, "right") == 0) { - KEY(nJoyBase + 0x01) - } - if (strncmp(szi, "fire ", 5) == 0) { - char *szb = szi + 5; - INT32 nButton = strtol(szb, NULL, 0); - if (nButton >= 1) { - nButton--; - } - KEY(nJoyBase + 0x80 + nButton); - } - - return 0; -} - -INT32 GamcPlayerHotRod(struct GameInp* pgi, char* szi, INT32 nPlayer, INT32 nFlags, INT32 nSlide) -{ - char *szSearch = NULL; - szSearch = szPlay[nPlayer & 3]; - INT32 k0 = 0, k1 = 0; - - if (_strnicmp(szSearch, szi, 3) != 0) { // Not our player - return 1; - } - szi += 3; - - if ((nFlags & 1) == 0) { - - // X-Arcade / Hanaho HotRod joystick left side - if (strcmp(szi, "x-axis") == 0) { - k0 = FBK_NUMPAD4; - k1 = FBK_NUMPAD6; - } - if (strcmp(szi, "y-axis") == 0) { - k0 = FBK_NUMPAD8; - k1 = FBK_NUMPAD2; - } - - if (strcmp(szi, "up") == 0 || strcmp(szi, "y-axis-neg") == 0) { - KEY(FBK_NUMPAD8); - } - if (strcmp(szi, "down") == 0 || strcmp(szi, "y-axis-pos") == 0) { - KEY(FBK_NUMPAD2); - } - if (strcmp(szi, "left") == 0 || strcmp(szi, "x-axis-neg") == 0) { - KEY(FBK_NUMPAD4); - } - if (strcmp(szi, "right") == 0 || strcmp(szi, "x-axis-pos") == 0) { - KEY(FBK_NUMPAD6); - } - - if (nFireButtons == 4) { - if (strcmp(szi, "fire 1") == 0) { - KEY(FBK_C); - } - if (strcmp(szi, "fire 2") == 0) { - KEY(FBK_LSHIFT); - } - if (strcmp(szi, "fire 3") == 0) { - KEY(FBK_Z); - } - if (strcmp(szi, "fire 4") == 0) { - KEY(FBK_X); - } - } else { - if (bStreetFighterLayout) { - // Street Fighter and other Capcom 6-button games - if (strcmp(szi, "fire 1") == 0) { - KEY(FBK_LCONTROL); - } - if (strcmp(szi, "fire 2") == 0) { - KEY(FBK_LALT); - } - if (strcmp(szi, "fire 3") == 0) { - KEY(FBK_SPACE); - } - if (strcmp(szi, "fire 4") == 0) { - KEY(FBK_LSHIFT); - } - if (strcmp(szi, "fire 5") == 0) { - KEY(FBK_Z); - } - if (strcmp(szi, "fire 6") == 0) { - KEY(FBK_X); - } - - // Map the 3x macros on X-Arcade - if ((nFlags & 0x10)) { - if (_stricmp(szi, "3 Punch") == 0) { - MACRO(FBK_C); - } - if (_stricmp(szi, "3 Kick") == 0) { - MACRO(FBK_5); - } - } - } else { - if (strcmp(szi, "fire 1") == 0) { - KEY(FBK_LSHIFT); - } - if (strcmp(szi, "fire 2") == 0) { - KEY(FBK_Z); - } - if (strcmp(szi, "fire 3") == 0) { - KEY(FBK_X); - } - if (strcmp(szi, "fire 4") == 0) { - KEY(FBK_LCONTROL); - } - if (strcmp(szi, "fire 5") == 0) { - KEY(FBK_LALT); - } - if (strcmp(szi, "fire 6") == 0) { - KEY(FBK_SPACE); - } - } - } - - // Map remaining buttons as usual - if (strcmp(szi, "start") == 0) { - KEY(FBK_1); - } - if (strcmp(szi, "coin") == 0 || strcmp(szi, "select") == 0) { - KEY(FBK_3); - } - - if (k0 && k1) { - SetSliderKey(pgi, k0, k1, nSlide); - } - - return 0; - - } else { - if ((nFlags & 1) == 1) { - // X-Arcade / Hanaho HotRod joystick right side - - if (strcmp(szi, "x-axis") == 0) { - k0 = FBK_D; - k1 = FBK_G; - } - if (strcmp(szi, "y-axis") == 0) { - k0 = FBK_R; - k1 = FBK_F; - } - - if (strcmp(szi, "up") == 0 || strcmp(szi, "y-axis-neg") == 0) { - KEY(FBK_R); - } - if (strcmp(szi, "down") == 0 || strcmp(szi, "y-axis-pos") == 0) { - KEY(FBK_F); - } - if (strcmp(szi, "left") == 0 || strcmp(szi, "x-axis-neg") == 0) { - KEY(FBK_D); - } - if (strcmp(szi, "right") == 0 || strcmp(szi, "x-axis-pos") == 0) { - KEY(FBK_G); - } - - if (nFireButtons == 4) { - if (strcmp(szi, "fire 1") == 0) { - KEY(FBK_RBRACKET); - } - if (strcmp(szi, "fire 2") == 0) { - KEY(FBK_W); - } - if (strcmp(szi, "fire 3") == 0) { - KEY(FBK_E); - } - if (strcmp(szi, "fire 4") == 0) { - KEY(FBK_LBRACKET); - } - } else { - if (bStreetFighterLayout) { - // Street Fighter and other Capcom 6-button games - if (strcmp(szi, "fire 1") == 0) { - KEY(FBK_A); - } - if (strcmp(szi, "fire 2") == 0) { - KEY(FBK_S); - } - if (strcmp(szi, "fire 3") == 0) { - KEY(FBK_Q); - } - if (strcmp(szi, "fire 4") == 0) { - KEY(FBK_W); - } - if (strcmp(szi, "fire 5") == 0) { - KEY(FBK_E); - } - if (strcmp(szi, "fire 6") == 0) { - KEY(FBK_LBRACKET); - } - - // Map the 3x macros on X-Arcade - if ((nFlags & 0x10)) { - if (_stricmp(szi, "3 Punch") == 0) { - MACRO(FBK_RBRACKET); - } - if (_stricmp(szi, "3 Kick") == 0) { - MACRO(FBK_6); - } - } - } else { - if (strcmp(szi, "fire 1") == 0) { - KEY(FBK_W); - } - if (strcmp(szi, "fire 2") == 0) { - KEY(FBK_E); - } - if (strcmp(szi, "fire 3") == 0) { - KEY(FBK_LBRACKET); - } - if (strcmp(szi, "fire 4") == 0) { - KEY(FBK_A); - } - if (strcmp(szi, "fire 5") == 0) { - KEY(FBK_S); - } - if (strcmp(szi, "fire 6") == 0) { - KEY(FBK_Q); - } - } - } - - // Map remaining buttons as usual - if (strcmp(szi, "start") == 0) { - KEY(FBK_2); - } - if (strcmp(szi, "coin") == 0 || strcmp(szi, "select") == 0) { - KEY(FBK_4); - } - - if (k0 && k1) { - SetSliderKey(pgi, k0, k1, nSlide); - } - - return 0; - } - } - - return 1; // Couldn't map input -} - -#undef MACRO -#undef KEY - diff --git a/jan/src/burner/gameinp.h b/jan/src/burner/gameinp.h deleted file mode 100644 index a2d80349c..000000000 --- a/jan/src/burner/gameinp.h +++ /dev/null @@ -1,100 +0,0 @@ - -struct giConstant { - UINT8 nConst; // The constant value -}; - -struct giSwitch { - UINT16 nCode; // The input code (for digital) -}; - -struct giJoyAxis { - UINT8 nJoy; // The joystick number - UINT8 nAxis; // The joystick axis number -}; - -struct giMouseAxis { - UINT8 nMouse; // The mouse number - UINT8 nAxis; // The axis number - UINT16 nOffset; // Used for absolute axes -}; - -struct giSliderAxis { - UINT16 nSlider[2]; // Keys to use for slider -}; - -struct giSlider { - union { - struct giJoyAxis JoyAxis; - struct giSliderAxis SliderAxis; - }; - INT16 nSliderSpeed; // speed with which keys move the slider - INT16 nSliderCenter; // Speed the slider should center itself (high value = slow) - INT32 nSliderValue; // Current position of the slider -}; - -struct giInput { - union { // Destination for the Input Value - UINT8* pVal; - UINT16* pShortVal; - }; - UINT16 nVal; // The Input Value - - union { - struct giConstant Constant; - struct giSwitch Switch; - struct giJoyAxis JoyAxis; - struct giMouseAxis MouseAxis; - struct giSlider Slider; - }; -}; - -struct giForce { - UINT8 nInput; // The input to apply force feedback effects to - UINT8 nEffect; // The effect to use -}; - -struct giMacro { - UINT8 nMode; // 0 = Unused, 1 = used - - UINT8* pVal[4]; // Destination for the Input Value - UINT8 nVal[4]; // The Input Value - UINT8 nInput[4]; // Which inputs are mapped - - struct giSwitch Switch; - - char szName[33]; // Maximum name length 16 chars - UINT8 nSysMacro; // mappable system macro (1) or Auto-Fire (15) -}; - -#define GIT_CONSTANT (0x01) -#define GIT_SWITCH (0x02) - -#define GIT_GROUP_SLIDER (0x08) -#define GIT_KEYSLIDER (0x08) -#define GIT_JOYSLIDER (0x09) - -#define GIT_GROUP_MOUSE (0x10) -#define GIT_MOUSEAXIS (0x10) - -#define GIT_GROUP_JOYSTICK (0x20) -#define GIT_JOYAXIS_FULL (0x20) -#define GIT_JOYAXIS_NEG (0x21) -#define GIT_JOYAXIS_POS (0x22) - -#define GIT_FORCE (0x40) - -#define GIT_GROUP_MACRO (0x80) -#define GIT_MACRO_AUTO (0x80) -#define GIT_MACRO_CUSTOM (0x81) - -struct GameInp { - UINT8 nInput; // PC side: see above - UINT8 nType; // game side: see burn.h - - union { - struct giInput Input; - struct giForce Force; - struct giMacro Macro; - }; -}; - diff --git a/jan/src/burner/gami.cpp b/jan/src/burner/gami.cpp deleted file mode 100644 index a774609d7..000000000 --- a/jan/src/burner/gami.cpp +++ /dev/null @@ -1,1828 +0,0 @@ -// Burner Game Input -#include "burner.h" - -// Player Default Controls -INT32 nPlayerDefaultControls[4] = {0, 1, 2, 3}; -TCHAR szPlayerDefaultIni[4][MAX_PATH] = { _T(""), _T(""), _T(""), _T("") }; - -// Mapping of PC inputs to game inputs -struct GameInp* GameInp = NULL; -UINT32 nGameInpCount = 0; -UINT32 nMacroCount = 0; -UINT32 nMaxMacro = 0; - -INT32 nAnalogSpeed; - -INT32 nFireButtons = 0; - -bool bStreetFighterLayout = false; -bool bLeftAltkeyMapped = false; - -// These are mappable global macros for mapping Pause/FFWD etc to controls in the input mapping dialogue. -dink -UINT8 macroSystemPause = 0; -UINT8 macroSystemFFWD = 0; -UINT8 macroSystemSaveState = 0; -UINT8 macroSystemLoadState = 0; -UINT8 macroSystemUNDOState = 0; - -// --------------------------------------------------------------------------- - -// Check if the left alt (menu) key is mapped -#ifndef __LIBRETRO__ -void GameInpCheckLeftAlt() -{ - struct GameInp* pgi; - UINT32 i; - - bLeftAltkeyMapped = false; - - for (i = 0, pgi = GameInp; i < (nGameInpCount + nMacroCount); i++, pgi++) { - - if (bLeftAltkeyMapped) { - break; - } - - switch (pgi->nInput) { - case GIT_SWITCH: - if (pgi->Input.Switch.nCode == FBK_LALT) { - bLeftAltkeyMapped = true; - } - break; - case GIT_MACRO_AUTO: - case GIT_MACRO_CUSTOM: - if (pgi->Macro.nMode) { - if (pgi->Macro.Switch.nCode == FBK_LALT) { - bLeftAltkeyMapped = true; - } - } - break; - - default: - continue; - } - } -} - -// Check if the sytem mouse is mapped and set the cooperative level apropriately -void GameInpCheckMouse() -{ - bool bMouseMapped = false; - struct GameInp* pgi; - UINT32 i; - - for (i = 0, pgi = GameInp; i < (nGameInpCount + nMacroCount); i++, pgi++) { - - if (bMouseMapped) { - break; - } - - switch (pgi->nInput) { - case GIT_SWITCH: - if ((pgi->Input.Switch.nCode & 0xFF00) == 0x8000) { - bMouseMapped = true; - } - break; - case GIT_MOUSEAXIS: - if (pgi->Input.MouseAxis.nMouse == 0) { - bMouseMapped = true; - } - break; - case GIT_MACRO_AUTO: - case GIT_MACRO_CUSTOM: - if (pgi->Macro.nMode) { - if ((pgi->Macro.Switch.nCode & 0xFF00) == 0x8000) { - bMouseMapped = true; - } - } - break; - - default: - continue; - } - } - - if (bDrvOkay) { - if (!bRunPause) { - InputSetCooperativeLevel(bMouseMapped, bAlwaysProcessKeyboardInput); - } else { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - } - } else { - InputSetCooperativeLevel(false, false); - } -} -#endif - -// --------------------------------------------------------------------------- - -INT32 GameInpBlank(INT32 bDipSwitch) -{ - UINT32 i = 0; - struct GameInp* pgi = NULL; - - // Reset all inputs to undefined (even dip switches, if bDipSwitch==1) - if (GameInp == NULL) { - return 1; - } - - // Get the targets in the library for the Input Values - for (i = 0, pgi = GameInp; i < nGameInpCount; i++, pgi++) { - struct BurnInputInfo bii; - memset(&bii, 0, sizeof(bii)); - BurnDrvGetInputInfo(&bii, i); - if (bDipSwitch == 0 && (bii.nType & BIT_GROUP_CONSTANT)) { // Don't blank the dip switches - continue; - } - - memset(pgi, 0, sizeof(*pgi)); // Clear input - - pgi->nType = bii.nType; // store input type - pgi->Input.pVal = bii.pVal; // store input pointer to value - - if (bii.nType & BIT_GROUP_CONSTANT) { // Further initialisation for constants/DIPs - pgi->nInput = GIT_CONSTANT; - pgi->Input.Constant.nConst = *bii.pVal; - } - } - - for (i = 0; i < nMacroCount; i++, pgi++) { - pgi->Macro.nMode = 0; - if (pgi->nInput == GIT_MACRO_CUSTOM) { - pgi->nInput = 0; - } - } - - bLeftAltkeyMapped = false; - - return 0; -} - -static void GameInpInitMacros() -{ - struct GameInp* pgi; - struct BurnInputInfo bii; - - INT32 nPunchx3[4] = {0, 0, 0, 0}; - INT32 nPunchInputs[4][3]; - INT32 nKickx3[4] = {0, 0, 0, 0}; - INT32 nKickInputs[4][3]; - - INT32 nNeogeoButtons[4][4]; - INT32 nPgmButtons[10][16]; - - bStreetFighterLayout = false; - nMacroCount = 0; - - nFireButtons = 0; - - memset(&nNeogeoButtons, 0, sizeof(nNeogeoButtons)); - memset(&nPgmButtons, 0, sizeof(nPgmButtons)); - - for (UINT32 i = 0; i < nGameInpCount; i++) { - bii.szName = NULL; - BurnDrvGetInputInfo(&bii, i); - if (bii.szName == NULL) { - bii.szName = ""; - } - - bool bPlayerInInfo = (toupper(bii.szInfo[0]) == 'P' && bii.szInfo[1] >= '1' && bii.szInfo[1] <= '4'); // Because some of the older drivers don't use the standard input naming. - bool bPlayerInName = (bii.szName[0] == 'P' && bii.szName[1] >= '1' && bii.szName[1] <= '4'); - - if (bPlayerInInfo || bPlayerInName) { - INT32 nPlayer = 0; - - if (bPlayerInName) - nPlayer = bii.szName[1] - '1'; - if (bPlayerInInfo && nPlayer == 0) - nPlayer = bii.szInfo[1] - '1'; - - if (nPlayer == 0) { - if (strncmp(" fire", bii.szInfo + 2, 5) == 0) { - nFireButtons++; - } - } - - if (_stricmp(" Weak Punch", bii.szName + 2) == 0) { - nPunchx3[nPlayer] |= 1; - nPunchInputs[nPlayer][0] = i; - } - if (_stricmp(" Medium Punch", bii.szName + 2) == 0) { - nPunchx3[nPlayer] |= 2; - nPunchInputs[nPlayer][1] = i; - } - if (_stricmp(" Strong Punch", bii.szName + 2) == 0) { - nPunchx3[nPlayer] |= 4; - nPunchInputs[nPlayer][2] = i; - } - if (_stricmp(" Weak Kick", bii.szName + 2) == 0) { - nKickx3[nPlayer] |= 1; - nKickInputs[nPlayer][0] = i; - } - if (_stricmp(" Medium Kick", bii.szName + 2) == 0) { - nKickx3[nPlayer] |= 2; - nKickInputs[nPlayer][1] = i; - } - if (_stricmp(" Strong Kick", bii.szName + 2) == 0) { - nKickx3[nPlayer] |= 4; - nKickInputs[nPlayer][2] = i; - } - - if ((BurnDrvGetHardwareCode() & (HARDWARE_PUBLIC_MASK - HARDWARE_PREFIX_CARTRIDGE)) == HARDWARE_SNK_NEOGEO) { - if (_stricmp(" Button A", bii.szName + 2) == 0) { - nNeogeoButtons[nPlayer][0] = i; - } - if (_stricmp(" Button B", bii.szName + 2) == 0) { - nNeogeoButtons[nPlayer][1] = i; - } - if (_stricmp(" Button C", bii.szName + 2) == 0) { - nNeogeoButtons[nPlayer][2] = i; - } - if (_stricmp(" Button D", bii.szName + 2) == 0) { - nNeogeoButtons[nPlayer][3] = i; - } - } - - //if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_IGS_PGM) { - { // Use nPgmButtons for Autofire too -dink - if ((_stricmp(" Button 1", bii.szName + 2) == 0) || (_stricmp(" fire 1", bii.szInfo + 2) == 0)) { - nPgmButtons[nPlayer][0] = i; - } - if ((_stricmp(" Button 2", bii.szName + 2) == 0) || (_stricmp(" fire 2", bii.szInfo + 2) == 0)) { - nPgmButtons[nPlayer][1] = i; - } - if ((_stricmp(" Button 3", bii.szName + 2) == 0) || (_stricmp(" fire 3", bii.szInfo + 2) == 0)) { - nPgmButtons[nPlayer][2] = i; - } - if ((_stricmp(" Button 4", bii.szName + 2) == 0) || (_stricmp(" fire 4", bii.szInfo + 2) == 0)) { - nPgmButtons[nPlayer][3] = i; - } - if ((_stricmp(" Button 5", bii.szName + 2) == 0) || (_stricmp(" fire 5", bii.szInfo + 2) == 0)) { - nPgmButtons[nPlayer][4] = i; - } - if ((_stricmp(" Button 6", bii.szName + 2) == 0) || (_stricmp(" fire 6", bii.szInfo + 2) == 0)) { - nPgmButtons[nPlayer][5] = i; - } - } - } - } - - pgi = GameInp + nGameInpCount; - - { // Mappable system macros -dink - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - pgi->Macro.nSysMacro = 1; - sprintf(pgi->Macro.szName, "System Pause"); - pgi->Macro.pVal[0] = ¯oSystemPause; - pgi->Macro.nVal[0] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - pgi->Macro.nSysMacro = 1; - sprintf(pgi->Macro.szName, "System FFWD"); - pgi->Macro.pVal[0] = ¯oSystemFFWD; - pgi->Macro.nVal[0] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - pgi->Macro.nSysMacro = 1; - sprintf(pgi->Macro.szName, "System Load State"); - pgi->Macro.pVal[0] = ¯oSystemLoadState; - pgi->Macro.nVal[0] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - pgi->Macro.nSysMacro = 1; - sprintf(pgi->Macro.szName, "System Save State"); - pgi->Macro.pVal[0] = ¯oSystemSaveState; - pgi->Macro.nVal[0] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - pgi->Macro.nSysMacro = 1; - sprintf(pgi->Macro.szName, "System UNDO State"); - pgi->Macro.pVal[0] = ¯oSystemUNDOState; - pgi->Macro.nVal[0] = 1; - nMacroCount++; - pgi++; - } - { // Autofire!!! - for (INT32 nPlayer = 0; nPlayer < nMaxPlayers; nPlayer++) { - for (INT32 i = 0; i < nFireButtons; i++) { - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - pgi->Macro.nSysMacro = 15; // 15 = Auto-Fire mode - if ((BurnDrvGetHardwareCode() & (HARDWARE_PUBLIC_MASK - HARDWARE_PREFIX_CARTRIDGE)) == HARDWARE_SEGA_MEGADRIVE) { - if (i < 3) { - sprintf(pgi->Macro.szName, "P%d Auto-Fire Button %c", nPlayer+1, i+'A'); // A,B,C - } else { - sprintf(pgi->Macro.szName, "P%d Auto-Fire Button %c", nPlayer+1, i+'X'-3); // X,Y,Z - } - } else { - sprintf(pgi->Macro.szName, "P%d Auto-Fire Button %d", nPlayer+1, i+1); - } - if ((BurnDrvGetHardwareCode() & (HARDWARE_PUBLIC_MASK - HARDWARE_PREFIX_CARTRIDGE)) == HARDWARE_SNK_NEOGEO) { - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][i]); - } else { - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][i]); - } - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - nMacroCount++; - pgi++; - } - } - } - - for (INT32 nPlayer = 0; nPlayer < nMaxPlayers; nPlayer++) { - if (nPunchx3[nPlayer] == 7) { // Create a 3x punch macro - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - - sprintf(pgi->Macro.szName, "P%i 3 Punch", nPlayer + 1); - for (INT32 j = 0; j < 3; j++) { - BurnDrvGetInputInfo(&bii, nPunchInputs[nPlayer][j]); - pgi->Macro.pVal[j] = bii.pVal; - pgi->Macro.nVal[j] = 1; - } - - nMacroCount++; - pgi++; - } - - if (nKickx3[nPlayer] == 7) { // Create a 3x kick macro - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - - sprintf(pgi->Macro.szName, "P%i 3 Kick", nPlayer + 1); - for (INT32 j = 0; j < 3; j++) { - BurnDrvGetInputInfo(&bii, nKickInputs[nPlayer][j]); - pgi->Macro.pVal[j] = bii.pVal; - pgi->Macro.nVal[j] = 1; - } - - nMacroCount++; - pgi++; - } - - if (nFireButtons == 4 && (BurnDrvGetHardwareCode() & (HARDWARE_PUBLIC_MASK - HARDWARE_PREFIX_CARTRIDGE)) == HARDWARE_SNK_NEOGEO) { - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons AB", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][1]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons AC", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][2]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons AD", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][3]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons BC", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][1]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][2]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons BD", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][1]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][3]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons CD", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][2]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][3]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons ABC", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][1]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][2]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons ABD", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][1]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][3]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons ACD", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][2]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][3]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons BCD", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][1]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][2]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][3]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons ABCD", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][1]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][2]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - BurnDrvGetInputInfo(&bii, nNeogeoButtons[nPlayer][3]); - pgi->Macro.pVal[3] = bii.pVal; - pgi->Macro.nVal[3] = 1; - nMacroCount++; - pgi++; - } - - if (nFireButtons == 4 && (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_IGS_PGM) { - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 12", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][1]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 13", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][2]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 14", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][3]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 23", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][1]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][2]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 24", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][1]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][3]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 34", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][2]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][3]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 123", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][1]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][2]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 124", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][1]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][3]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 134", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][2]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][3]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 234", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][1]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][2]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][3]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - nMacroCount++; - pgi++; - - pgi->nInput = GIT_MACRO_AUTO; - pgi->nType = BIT_DIGITAL; - pgi->Macro.nMode = 0; - sprintf(pgi->Macro.szName, "P%i Buttons 1234", nPlayer + 1); - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][0]); - pgi->Macro.pVal[0] = bii.pVal; - pgi->Macro.nVal[0] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][1]); - pgi->Macro.pVal[1] = bii.pVal; - pgi->Macro.nVal[1] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][2]); - pgi->Macro.pVal[2] = bii.pVal; - pgi->Macro.nVal[2] = 1; - BurnDrvGetInputInfo(&bii, nPgmButtons[nPlayer][3]); - pgi->Macro.pVal[3] = bii.pVal; - pgi->Macro.nVal[3] = 1; - nMacroCount++; - pgi++; - } - } - - if ((nPunchx3[0] == 7) && (nKickx3[0] == 7)) { - bStreetFighterLayout = true; - } - if (nFireButtons >= 5 && (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_CAPCOM_CPS2) { - bStreetFighterLayout = true; - } -} - -INT32 GameInpInit() -{ - INT32 nRet = 0; - // Count the number of inputs - nGameInpCount = 0; - nMacroCount = 0; - nMaxMacro = nMaxPlayers * 52; - - for (UINT32 i = 0; i < 0x1000; i++) { - nRet = BurnDrvGetInputInfo(NULL,i); - if (nRet) { // end of input list - nGameInpCount = i; - break; - } - } - - // Allocate space for all the inputs - INT32 nSize = (nGameInpCount + nMaxMacro) * sizeof(struct GameInp); - GameInp = (struct GameInp*)malloc(nSize); - if (GameInp == NULL) { - return 1; - } - memset(GameInp, 0, nSize); - - GameInpBlank(1); - - InpDIPSWResetDIPs(); - - GameInpInitMacros(); - - nAnalogSpeed = 0x0100; - - return 0; -} - -INT32 GameInpExit() -{ - if (GameInp) { - free(GameInp); - GameInp = NULL; - } - - nGameInpCount = 0; - nMacroCount = 0; - - nFireButtons = 0; - - bStreetFighterLayout = false; - bLeftAltkeyMapped = false; - - return 0; -} - -// --------------------------------------------------------------------------- -// Convert a string from a config file to an input - -static TCHAR* SliderInfo(struct GameInp* pgi, TCHAR* s) -{ - TCHAR* szRet = NULL; - pgi->Input.Slider.nSliderSpeed = 0x700; // defaults - pgi->Input.Slider.nSliderCenter = 0; - pgi->Input.Slider.nSliderValue = 0x8000; - - szRet = LabelCheck(s, _T("speed")); - s = szRet; - if (s == NULL) { - return s; - } - pgi->Input.Slider.nSliderSpeed = (INT16)_tcstol(s, &szRet, 0); - s = szRet; - if (s==NULL) { - return s; - } - szRet = LabelCheck(s, _T("center")); - s = szRet; - if (s == NULL) { - return s; - } - pgi->Input.Slider.nSliderCenter = (INT16)_tcstol(s, &szRet, 0); - s = szRet; - if (s == NULL) { - return s; - } - - return szRet; -} - -static INT32 StringToJoyAxis(struct GameInp* pgi, TCHAR* s) -{ - TCHAR* szRet = s; - - pgi->Input.JoyAxis.nJoy = (UINT8)_tcstol(s, &szRet, 0); - if (szRet == NULL) { - return 1; - } - s = szRet; - pgi->Input.JoyAxis.nAxis = (UINT8)_tcstol(s, &szRet, 0); - if (szRet == NULL) { - return 1; - } - - return 0; -} - -static INT32 StringToMouseAxis(struct GameInp* pgi, TCHAR* s) -{ - TCHAR* szRet = s; - - pgi->Input.MouseAxis.nAxis = (UINT8)_tcstol(s, &szRet, 0); - if (szRet == NULL) { - return 1; - } - - return 0; -} - -static INT32 StringToMacro(struct GameInp* pgi, TCHAR* s) -{ - TCHAR* szRet = NULL; - - szRet = LabelCheck(s, _T("switch")); - if (szRet) { - s = szRet; - pgi->Macro.nMode = 0x01; - pgi->Macro.Switch.nCode = (UINT16)_tcstol(s, &szRet, 0); - return 0; - } - - return 1; -} - -static INT32 StringToInp(struct GameInp* pgi, TCHAR* s) -{ - TCHAR* szRet = NULL; - - SKIP_WS(s); // skip whitespace - szRet = LabelCheck(s, _T("undefined")); - if (szRet) { - pgi->nInput = 0; - return 0; - } - - szRet = LabelCheck(s, _T("constant")); - if (szRet) { - pgi->nInput = GIT_CONSTANT; - s = szRet; - pgi->Input.Constant.nConst=(UINT8)_tcstol(s, &szRet, 0); - *(pgi->Input.pVal) = pgi->Input.Constant.nConst; - return 0; - } - - szRet = LabelCheck(s, _T("switch")); - if (szRet) { - pgi->nInput = GIT_SWITCH; - s = szRet; - pgi->Input.Switch.nCode = (UINT16)_tcstol(s, &szRet, 0); - return 0; - } - - // Analog using mouse axis: - szRet = LabelCheck(s, _T("mouseaxis")); - if (szRet) { - pgi->nInput = GIT_MOUSEAXIS; - return StringToMouseAxis(pgi, szRet); - } - // Analog using joystick axis: - szRet = LabelCheck(s, _T("joyaxis-neg")); - if (szRet) { - pgi->nInput = GIT_JOYAXIS_NEG; - return StringToJoyAxis(pgi, szRet); - } - szRet = LabelCheck(s, _T("joyaxis-pos")); - if (szRet) { - pgi->nInput = GIT_JOYAXIS_POS; - return StringToJoyAxis(pgi, szRet); - } - szRet = LabelCheck(s, _T("joyaxis")); - if (szRet) { - pgi->nInput = GIT_JOYAXIS_FULL; - return StringToJoyAxis(pgi, szRet); - } - - // Analog using keyboard slider - szRet = LabelCheck(s, _T("slider")); - if (szRet) { - s = szRet; - pgi->nInput = GIT_KEYSLIDER; - pgi->Input.Slider.SliderAxis.nSlider[0] = 0; // defaults - pgi->Input.Slider.SliderAxis.nSlider[1] = 0; // - - pgi->Input.Slider.SliderAxis.nSlider[0] = (UINT16)_tcstol(s, &szRet, 0); - s = szRet; - if (s == NULL) { - return 1; - } - pgi->Input.Slider.SliderAxis.nSlider[1] = (UINT16)_tcstol(s, &szRet, 0); - s = szRet; - if (s == NULL) { - return 1; - } - szRet = SliderInfo(pgi, s); - s = szRet; - if (s == NULL) { // Get remaining slider info - return 1; - } - return 0; - } - - // Analog using joystick slider - szRet = LabelCheck(s, _T("joyslider")); - if (szRet) { - s = szRet; - pgi->nInput = GIT_JOYSLIDER; - pgi->Input.Slider.JoyAxis.nJoy = 0; // defaults - pgi->Input.Slider.JoyAxis.nAxis = 0; // - - pgi->Input.Slider.JoyAxis.nJoy = (UINT8)_tcstol(s, &szRet, 0); - s = szRet; - if (s == NULL) { - return 1; - } - pgi->Input.Slider.JoyAxis.nAxis = (UINT8)_tcstol(s, &szRet, 0); - s = szRet; - if (s == NULL) { - return 1; - } - szRet = SliderInfo(pgi, s); // Get remaining slider info - s = szRet; - if (s == NULL) { - return 1; - } - return 0; - } - - return 1; -} - -// --------------------------------------------------------------------------- -// Convert an input to a string for config files - -static TCHAR* InpToString(struct GameInp* pgi) -{ - static TCHAR szString[80]; - - if (pgi->nInput == 0) { - return _T("undefined"); - } - if (pgi->nInput == GIT_CONSTANT) { - _stprintf(szString, _T("constant 0x%.2X"), pgi->Input.Constant.nConst); - return szString; - } - if (pgi->nInput == GIT_SWITCH) { - _stprintf(szString, _T("switch 0x%.2X"), pgi->Input.Switch.nCode); - return szString; - } - if (pgi->nInput == GIT_KEYSLIDER) { - _stprintf(szString, _T("slider 0x%.2x 0x%.2x speed 0x%x center %d"), pgi->Input.Slider.SliderAxis.nSlider[0], pgi->Input.Slider.SliderAxis.nSlider[1], pgi->Input.Slider.nSliderSpeed, pgi->Input.Slider.nSliderCenter); - return szString; - } - if (pgi->nInput == GIT_JOYSLIDER) { - _stprintf(szString, _T("joyslider %d %d speed 0x%x center %d"), pgi->Input.Slider.JoyAxis.nJoy, pgi->Input.Slider.JoyAxis.nAxis, pgi->Input.Slider.nSliderSpeed, pgi->Input.Slider.nSliderCenter); - return szString; - } - if (pgi->nInput == GIT_MOUSEAXIS) { - _stprintf(szString, _T("mouseaxis %d"), pgi->Input.MouseAxis.nAxis); - return szString; - } - if (pgi->nInput == GIT_JOYAXIS_FULL) { - _stprintf(szString, _T("joyaxis %d %d"), pgi->Input.JoyAxis.nJoy, pgi->Input.JoyAxis.nAxis); - return szString; - } - if (pgi->nInput == GIT_JOYAXIS_NEG) { - _stprintf(szString, _T("joyaxis-neg %d %d"), pgi->Input.JoyAxis.nJoy, pgi->Input.JoyAxis.nAxis); - return szString; - } - if (pgi->nInput == GIT_JOYAXIS_POS) { - _stprintf(szString, _T("joyaxis-pos %d %d"), pgi->Input.JoyAxis.nJoy, pgi->Input.JoyAxis.nAxis); - return szString; - } - - return _T("unknown"); -} - -static TCHAR* InpMacroToString(struct GameInp* pgi) -{ - static TCHAR szString[256]; - - if (pgi->nInput == GIT_MACRO_AUTO) { - if (pgi->Macro.nMode) { - _stprintf(szString, _T("switch 0x%.2X"), pgi->Macro.Switch.nCode); - return szString; - } - } - - if (pgi->nInput == GIT_MACRO_CUSTOM) { - struct BurnInputInfo bii; - - if (pgi->Macro.nMode) { - _stprintf(szString, _T("switch 0x%.2X"), pgi->Macro.Switch.nCode); - } else { - _stprintf(szString, _T("undefined")); - } - - for (INT32 i = 0; i < 4; i++) { - if (pgi->Macro.pVal[i]) { - BurnDrvGetInputInfo(&bii, pgi->Macro.nInput[i]); - _stprintf(szString + _tcslen(szString), _T(" \"%hs\" 0x%02X"), bii.szName, pgi->Macro.nVal[i]); - } - } - - return szString; - } - - return _T("undefined"); -} - -// --------------------------------------------------------------------------- -// Generate a user-friendly name for a control (PC-side) - -static struct { INT32 nCode; TCHAR* szName; } KeyNames[] = { - -#define FBK_DEFNAME(k) k, _T(#k) - - { FBK_ESCAPE, _T("ESCAPE") }, - { FBK_1, _T("1") }, - { FBK_2, _T("2") }, - { FBK_3, _T("3") }, - { FBK_4, _T("4") }, - { FBK_5, _T("5") }, - { FBK_6, _T("6") }, - { FBK_7, _T("7") }, - { FBK_8, _T("8") }, - { FBK_9, _T("9") }, - { FBK_0, _T("0") }, - { FBK_MINUS, _T("MINUS") }, - { FBK_EQUALS, _T("EQUALS") }, - { FBK_BACK, _T("BACKSPACE") }, - { FBK_TAB, _T("TAB") }, - { FBK_Q, _T("Q") }, - { FBK_W, _T("W") }, - { FBK_E, _T("E") }, - { FBK_R, _T("R") }, - { FBK_T, _T("T") }, - { FBK_Y, _T("Y") }, - { FBK_U, _T("U") }, - { FBK_I, _T("I") }, - { FBK_O, _T("O") }, - { FBK_P, _T("P") }, - { FBK_LBRACKET, _T("OPENING BRACKET") }, - { FBK_RBRACKET, _T("CLOSING BRACKET") }, - { FBK_RETURN, _T("ENTER") }, - { FBK_LCONTROL, _T("LEFT CONTROL") }, - { FBK_A, _T("A") }, - { FBK_S, _T("S") }, - { FBK_D, _T("D") }, - { FBK_F, _T("F") }, - { FBK_G, _T("G") }, - { FBK_H, _T("H") }, - { FBK_J, _T("J") }, - { FBK_K, _T("K") }, - { FBK_L, _T("L") }, - { FBK_SEMICOLON, _T("SEMICOLON") }, - { FBK_APOSTROPHE, _T("APOSTROPHE") }, - { FBK_GRAVE, _T("ACCENT GRAVE") }, - { FBK_LSHIFT, _T("LEFT SHIFT") }, - { FBK_BACKSLASH, _T("BACKSLASH") }, - { FBK_Z, _T("Z") }, - { FBK_X, _T("X") }, - { FBK_C, _T("C") }, - { FBK_V, _T("V") }, - { FBK_B, _T("B") }, - { FBK_N, _T("N") }, - { FBK_M, _T("M") }, - { FBK_COMMA, _T("COMMA") }, - { FBK_PERIOD, _T("PERIOD") }, - { FBK_SLASH, _T("SLASH") }, - { FBK_RSHIFT, _T("RIGHT SHIFT") }, - { FBK_MULTIPLY, _T("NUMPAD MULTIPLY") }, - { FBK_LALT, _T("LEFT MENU") }, - { FBK_SPACE, _T("SPACE") }, - { FBK_CAPITAL, _T("CAPSLOCK") }, - { FBK_F1, _T("F1") }, - { FBK_F2, _T("F2") }, - { FBK_F3, _T("F3") }, - { FBK_F4, _T("F4") }, - { FBK_F5, _T("F5") }, - { FBK_F6, _T("F6") }, - { FBK_F7, _T("F7") }, - { FBK_F8, _T("F8") }, - { FBK_F9, _T("F9") }, - { FBK_F10, _T("F10") }, - { FBK_NUMLOCK, _T("NUMLOCK") }, - { FBK_SCROLL, _T("SCROLLLOCK") }, - { FBK_NUMPAD7, _T("NUMPAD 7") }, - { FBK_NUMPAD8, _T("NUMPAD 8") }, - { FBK_NUMPAD9, _T("NUMPAD 9") }, - { FBK_SUBTRACT, _T("NUMPAD SUBTRACT") }, - { FBK_NUMPAD4, _T("NUMPAD 4") }, - { FBK_NUMPAD5, _T("NUMPAD 5") }, - { FBK_NUMPAD6, _T("NUMPAD 6") }, - { FBK_ADD, _T("NUMPAD ADD") }, - { FBK_NUMPAD1, _T("NUMPAD 1") }, - { FBK_NUMPAD2, _T("NUMPAD 2") }, - { FBK_NUMPAD3, _T("NUMPAD 3") }, - { FBK_NUMPAD0, _T("NUMPAD 0") }, - { FBK_DECIMAL, _T("NUMPAD DECIMAL POINT") }, - { FBK_DEFNAME(FBK_OEM_102) }, - { FBK_F11, _T("F11") }, - { FBK_F12, _T("F12") }, - { FBK_F13, _T("F13") }, - { FBK_F14, _T("F14") }, - { FBK_F15, _T("F15") }, - { FBK_DEFNAME(FBK_KANA) }, - { FBK_DEFNAME(FBK_ABNT_C1) }, - { FBK_DEFNAME(FBK_CONVERT) }, - { FBK_DEFNAME(FBK_NOCONVERT) }, - { FBK_DEFNAME(FBK_YEN) }, - { FBK_DEFNAME(FBK_ABNT_C2) }, - { FBK_NUMPADEQUALS, _T("NUMPAD EQUALS") }, - { FBK_DEFNAME(FBK_PREVTRACK) }, - { FBK_DEFNAME(FBK_AT) }, - { FBK_COLON, _T("COLON") }, - { FBK_UNDERLINE, _T("UNDERSCORE") }, - { FBK_DEFNAME(FBK_KANJI) }, - { FBK_DEFNAME(FBK_STOP) }, - { FBK_DEFNAME(FBK_AX) }, - { FBK_DEFNAME(FBK_UNLABELED) }, - { FBK_DEFNAME(FBK_NEXTTRACK) }, - { FBK_NUMPADENTER, _T("NUMPAD ENTER") }, - { FBK_RCONTROL, _T("RIGHT CONTROL") }, - { FBK_DEFNAME(FBK_MUTE) }, - { FBK_DEFNAME(FBK_CALCULATOR) }, - { FBK_DEFNAME(FBK_PLAYPAUSE) }, - { FBK_DEFNAME(FBK_MEDIASTOP) }, - { FBK_DEFNAME(FBK_VOLUMEDOWN) }, - { FBK_DEFNAME(FBK_VOLUMEUP) }, - { FBK_DEFNAME(FBK_WEBHOME) }, - { FBK_DEFNAME(FBK_NUMPADCOMMA) }, - { FBK_DIVIDE, _T("NUMPAD DIVIDE") }, - { FBK_SYSRQ, _T("PRINTSCREEN") }, - { FBK_RALT, _T("RIGHT MENU") }, - { FBK_PAUSE, _T("PAUSE") }, - { FBK_HOME, _T("HOME") }, - { FBK_UPARROW, _T("ARROW UP") }, - { FBK_PRIOR, _T("PAGE UP") }, - { FBK_LEFTARROW, _T("ARROW LEFT") }, - { FBK_RIGHTARROW, _T("ARROW RIGHT") }, - { FBK_END, _T("END") }, - { FBK_DOWNARROW, _T("ARROW DOWN") }, - { FBK_NEXT, _T("PAGE DOWN") }, - { FBK_INSERT, _T("INSERT") }, - { FBK_DELETE, _T("DELETE") }, - { FBK_LWIN, _T("LEFT WINDOWS") }, - { FBK_RWIN, _T("RIGHT WINDOWS") }, - { FBK_DEFNAME(FBK_APPS) }, - { FBK_DEFNAME(FBK_POWER) }, - { FBK_DEFNAME(FBK_SLEEP) }, - { FBK_DEFNAME(FBK_WAKE) }, - { FBK_DEFNAME(FBK_WEBSEARCH) }, - { FBK_DEFNAME(FBK_WEBFAVORITES) }, - { FBK_DEFNAME(FBK_WEBREFRESH) }, - { FBK_DEFNAME(FBK_WEBSTOP) }, - { FBK_DEFNAME(FBK_WEBFORWARD) }, - { FBK_DEFNAME(FBK_WEBBACK) }, - { FBK_DEFNAME(FBK_MYCOMPUTER) }, - { FBK_DEFNAME(FBK_MAIL) }, - { FBK_DEFNAME(FBK_MEDIASELECT) }, - -#undef FBK_DEFNAME - - { 0, NULL } -}; - -TCHAR* InputCodeDesc(INT32 c) -{ - static TCHAR szString[64]; - TCHAR* szName = _T(""); - - // Mouse - if (c >= 0x8000) { - INT32 nMouse = (c >> 8) & 0x3F; - INT32 nCode = c & 0xFF; - if (nCode >= 0x80) { - _stprintf(szString, _T("Mouse %d Button %d"), nMouse, nCode & 0x7F); - return szString; - } - if (nCode < 0x06) { - TCHAR szAxis[3][3] = { _T("X"), _T("Y"), _T("Z") }; - TCHAR szDir[6][16] = { _T("negative"), _T("positive"), _T("Left"), _T("Right"), _T("Up"), _T("Down") }; - if (nCode < 4) { - _stprintf(szString, _T("Mouse %d %s (%s %s)"), nMouse, szDir[nCode + 2], szAxis[nCode >> 1], szDir[nCode & 1]); - } else { - _stprintf(szString, _T("Mouse %d %s %s"), nMouse, szAxis[nCode >> 1], szDir[nCode & 1]); - } - return szString; - } - } - - // Joystick - if (c >= 0x4000 && c < 0x8000) { - INT32 nJoy = (c >> 8) & 0x3F; - INT32 nCode = c & 0xFF; - if (nCode >= 0x80) { - _stprintf(szString, _T("Joy %d Button %d"), nJoy, nCode & 0x7F); - return szString; - } - if (nCode < 0x10) { - TCHAR szAxis[8][3] = { _T("X"), _T("Y"), _T("Z"), _T("rX"), _T("rY"), _T("rZ"), _T("s0"), _T("s1") }; - TCHAR szDir[6][16] = { _T("negative"), _T("positive"), _T("Left"), _T("Right"), _T("Up"), _T("Down") }; - if (nCode < 4) { - _stprintf(szString, _T("Joy %d %s (%s %s)"), nJoy, szDir[nCode + 2], szAxis[nCode >> 1], szDir[nCode & 1]); - } else { - _stprintf(szString, _T("Joy %d %s %s"), nJoy, szAxis[nCode >> 1], szDir[nCode & 1]); - } - return szString; - } - if (nCode < 0x20) { - TCHAR szDir[4][16] = { _T("Left"), _T("Right"), _T("Up"), _T("Down") }; - _stprintf(szString, _T("Joy %d POV-hat %d %s"), nJoy, (nCode & 0x0F) >> 2, szDir[nCode & 3]); - return szString; - } - } - - for (INT32 i = 0; KeyNames[i].nCode; i++) { - if (c == KeyNames[i].nCode) { - if (KeyNames[i].szName) { - szName = KeyNames[i].szName; - } - break; - } - } - - if (szName[0]) { - _stprintf(szString, _T("%s"), szName); - } else { - _stprintf(szString, _T("code 0x%.2X"), c); - } - - return szString; -} - -TCHAR* InpToDesc(struct GameInp* pgi) -{ - static TCHAR szInputName[64] = _T(""); - - if (pgi->nInput == 0) { - return _T(""); - } - if (pgi->nInput == GIT_CONSTANT) { - if (pgi->nType & BIT_GROUP_CONSTANT) { - for (INT32 i = 0; i < 8; i++) { - szInputName[7 - i] = pgi->Input.Constant.nConst & (1 << i) ? _T('1') : _T('0'); - } - szInputName[8] = 0; - - return szInputName; - } - - if (pgi->Input.Constant.nConst == 0) { - return _T("-"); - } - } - if (pgi->nInput == GIT_SWITCH) { - return InputCodeDesc(pgi->Input.Switch.nCode); - } - if (pgi->nInput == GIT_MOUSEAXIS) { - TCHAR nAxis = _T('?'); - switch (pgi->Input.MouseAxis.nAxis) { - case 0: - nAxis = _T('X'); - break; - case 1: - nAxis = _T('Y'); - break; - case 2: - nAxis = _T('Z'); - break; - } - _stprintf(szInputName, _T("Mouse %i %c axis"), pgi->Input.MouseAxis.nMouse, nAxis); - return szInputName; - } - if (pgi->nInput & GIT_GROUP_JOYSTICK) { - TCHAR szAxis[8][3] = { _T("X"), _T("Y"), _T("Z"), _T("rX"), _T("rY"), _T("rZ"), _T("s0"), _T("s1") }; - TCHAR szRange[4][16] = { _T("unknown"), _T("full"), _T("negative"), _T("positive") }; - INT32 nRange = 0; - switch (pgi->nInput) { - case GIT_JOYAXIS_FULL: - nRange = 1; - break; - case GIT_JOYAXIS_NEG: - nRange = 2; - break; - case GIT_JOYAXIS_POS: - nRange = 3; - break; - } - - _stprintf(szInputName, _T("Joy %d %s axis (%s range)"), pgi->Input.JoyAxis.nJoy, szAxis[pgi->Input.JoyAxis.nAxis], szRange[nRange]); - return szInputName; - } - - return InpToString(pgi); // Just do the rest as they are in the config file -} - -TCHAR* InpMacroToDesc(struct GameInp* pgi) -{ - if (pgi->nInput & GIT_GROUP_MACRO) { - if (pgi->Macro.nMode) { - return InputCodeDesc(pgi->Macro.Switch.nCode); - } - } - - return _T(""); -} - -// --------------------------------------------------------------------------- - -// Find the input number by info -static UINT32 InputInfoToNum(TCHAR* szName) -{ - for (UINT32 i = 0; i < nGameInpCount; i++) { - struct BurnInputInfo bii; - BurnDrvGetInputInfo(&bii, i); - if (bii.pVal == NULL) { - continue; - } - - if (_tcsicmp(szName, ANSIToTCHAR(bii.szInfo, NULL, 0)) == 0) { - return i; - } - } - return ~0U; -} - -// Find the input number by name -static UINT32 InputNameToNum(TCHAR* szName) -{ - for (UINT32 i = 0; i < nGameInpCount; i++) { - struct BurnInputInfo bii; - BurnDrvGetInputInfo(&bii, i); - if (bii.pVal == NULL) { - continue; - } - - if (_tcsicmp(szName, ANSIToTCHAR(bii.szName, NULL, 0)) == 0) { - return i; - } - } - return ~0U; -} - -static TCHAR* InputNumToName(UINT32 i) -{ - struct BurnInputInfo bii; - bii.szName = NULL; - BurnDrvGetInputInfo(&bii, i); - if (bii.szName == NULL) { - return _T("unknown"); - } - return ANSIToTCHAR(bii.szName, NULL, 0); -} - -static UINT32 MacroNameToNum(TCHAR* szName) -{ - struct GameInp* pgi = GameInp + nGameInpCount; - for (UINT32 i = 0; i < nMacroCount; i++, pgi++) { - if (pgi->nInput & GIT_GROUP_MACRO) { - if (_tcsicmp(szName, ANSIToTCHAR(pgi->Macro.szName, NULL, 0)) == 0) { - return i; - } - } - } - return ~0U; -} - -// --------------------------------------------------------------------------- - -static INT32 GameInpAutoOne(struct GameInp* pgi, char* szi) -{ - for (INT32 i = 0; i < nMaxPlayers; i++) { - INT32 nSlide = nPlayerDefaultControls[i] >> 4; - switch (nPlayerDefaultControls[i] & 0x0F) { - case 0: // Keyboard - GamcAnalogKey(pgi, szi, i, nSlide); - GamcPlayer(pgi, szi, i, -1); - GamcMisc(pgi, szi, i); - break; - case 1: // Joystick 1 - GamcAnalogJoy(pgi, szi, i, 0, nSlide); - GamcPlayer(pgi, szi, i, 0); - GamcMisc(pgi, szi, i); - break; - case 2: // Joystick 2 - GamcAnalogJoy(pgi, szi, i, 1, nSlide); - GamcPlayer(pgi, szi, i, 1); - GamcMisc(pgi, szi, i); - break; - case 3: // Joystick 3 - GamcAnalogJoy(pgi, szi, i, 2, nSlide); - GamcPlayer(pgi, szi, i, 2); - GamcMisc(pgi, szi, i); - break; - case 4: // X-Arcade left side - GamcMisc(pgi, szi, i); - GamcPlayerHotRod(pgi, szi, i, 0x10, nSlide); - break; - case 5: // X-Arcade right side - GamcMisc(pgi, szi, i); - GamcPlayerHotRod(pgi, szi, i, 0x11, nSlide); - break; - case 6: // Hot Rod left side - GamcMisc(pgi, szi, i); - GamcPlayerHotRod(pgi, szi, i, 0x00, nSlide); - break; - case 7: // Hot Rod right side - GamcMisc(pgi, szi, i); - GamcPlayerHotRod(pgi, szi, i, 0x01, nSlide); - break; - default: - GamcMisc(pgi, szi, i); - } - } - - return 0; -} - -static INT32 AddCustomMacro(TCHAR* szValue, bool bOverWrite) -{ - TCHAR* szQuote = NULL; - TCHAR* szEnd = NULL; - - if (QuoteRead(&szQuote, &szEnd, szValue)) { - return 1; - } - - INT32 nMode = -1; - INT32 nInput = -1; - bool bCreateNew = false; - struct BurnInputInfo bii; - - for (UINT32 j = nGameInpCount; j < nGameInpCount + nMacroCount; j++) { - if (GameInp[j].nInput == GIT_MACRO_CUSTOM) { - if (LabelCheck(szQuote, ANSIToTCHAR(GameInp[j].Macro.szName, NULL, 0))) { - nInput = j; - break; - } - } - } - - if (nInput == -1) { - if (nMacroCount + 1 == nMaxMacro) { - return 1; - } - nInput = nGameInpCount + nMacroCount; - bCreateNew = true; - } - - _tcscpy(szQuote, ANSIToTCHAR(GameInp[nInput].Macro.szName, NULL, 0)); - - if ((szValue = LabelCheck(szEnd, _T("undefined"))) != NULL) { - nMode = 0; - } else { - if ((szValue = LabelCheck(szEnd, _T("switch"))) != NULL) { - - if (bOverWrite || GameInp[nInput].Macro.nMode == 0) { - GameInp[nInput].Macro.Switch.nCode = (UINT16)_tcstol(szValue, &szValue, 0); - } - - nMode = 1; - } - } - - if (nMode >= 0) { - INT32 nFound = 0; - - for (INT32 i = 0; i < 4; i++) { - GameInp[nInput].Macro.pVal[i] = NULL; - GameInp[nInput].Macro.nVal[i] = 0; - GameInp[nInput].Macro.nInput[i] = 0; - - if (szValue == NULL) { - break; - } - - if (QuoteRead(&szQuote, &szEnd, szValue)) { - break; - } - - for (UINT32 j = 0; j < nGameInpCount; j++) { - bii.szName = NULL; - BurnDrvGetInputInfo(&bii, j); - if (bii.pVal == NULL) { - continue; - } - - TCHAR* szString = LabelCheck(szQuote, ANSIToTCHAR(bii.szName, NULL, 0)); - if (szString && szEnd) { - GameInp[nInput].Macro.pVal[i] = bii.pVal; - GameInp[nInput].Macro.nInput[i] = j; - - GameInp[nInput].Macro.nVal[i] = (UINT8)_tcstol(szEnd, &szValue, 0); - - nFound++; - - break; - } - } - } - - if (nFound) { - if (GameInp[nInput].Macro.pVal[nFound - 1]) { - GameInp[nInput].nInput = GIT_MACRO_CUSTOM; - GameInp[nInput].Macro.nMode = nMode; - if (bCreateNew) { - nMacroCount++; - } - return 0; - } - } - } - - return 1; -} - -INT32 GameInputAutoIni(INT32 nPlayer, TCHAR* lpszFile, bool bOverWrite) -{ - TCHAR szLine[1024]; - INT32 nFileVersion = 0; - UINT32 i; - - //nAnalogSpeed = 0x0100; /* this clobbers the setting read at the beginning of the file. */ - - FILE* h = _tfopen(lpszFile, _T("rt")); - if (h == NULL) { - return 1; - } - - // Go through each line of the config file and process inputs - while (_fgetts(szLine, sizeof(szLine), h)) { - TCHAR* szValue; - INT32 nLen = _tcslen(szLine); - - // Get rid of the linefeed at the end - if (szLine[nLen - 1] == 10) { - szLine[nLen - 1] = 0; - nLen--; - } - - szValue = LabelCheck(szLine, _T("version")); - if (szValue) { - nFileVersion = _tcstol(szValue, NULL, 0); - } - szValue = LabelCheck(szLine, _T("analog")); - if (szValue) { - nAnalogSpeed = _tcstol(szValue, NULL, 0); - } - - if (nConfigMinVersion <= nFileVersion && nFileVersion <= nBurnVer) { - szValue = LabelCheck(szLine, _T("input")); - if (szValue) { - TCHAR* szQuote = NULL; - TCHAR* szEnd = NULL; - if (QuoteRead(&szQuote, &szEnd, szValue)) { - continue; - } - - if ((szQuote[0] == _T('p') || szQuote[0] == _T('P')) && szQuote[1] >= _T('1') && szQuote[1] <= _T('0') + nMaxPlayers && szQuote[2] == _T(' ')) { - if (szQuote[1] != _T('1') + nPlayer) { - continue; - } - } else { - if (nPlayer != 0) { - continue; - } - } - - // Find which input number this refers to - i = InputNameToNum(szQuote); - if (i == ~0U) { - i = InputInfoToNum(szQuote); - if (i == ~0U) { - continue; - } - } - - if (GameInp[i].nInput == 0 || bOverWrite) { // Undefined - assign mapping - StringToInp(GameInp + i, szEnd); - } - } - - szValue = LabelCheck(szLine, _T("macro")); - if (szValue) { - TCHAR* szQuote = NULL; - TCHAR* szEnd = NULL; - if (QuoteRead(&szQuote, &szEnd, szValue)) { - continue; - } - - i = MacroNameToNum(szQuote); - if (i != ~0U) { - i += nGameInpCount; - if (GameInp[i].Macro.nMode == 0 || bOverWrite) { // Undefined - assign mapping - StringToMacro(GameInp + i, szEnd); - } - } - } - - szValue = LabelCheck(szLine, _T("custom")); - if (szValue) { - AddCustomMacro(szValue, bOverWrite); - } - } - } - - fclose(h); - - return 0; -} - -INT32 ConfigGameLoadHardwareDefaults() -{ - TCHAR *szDefaultCpsFile = _T("config/presets/cps.ini"); - TCHAR *szDefaultNeogeoFile = _T("config/presets/neogeo.ini"); - TCHAR *szDefaultPgmFile = _T("config/presets/pgm.ini"); - TCHAR *szFileName = _T(""); - INT32 nApplyHardwareDefaults = 0; - - INT32 nHardwareFlag = (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK); - - if (nHardwareFlag == HARDWARE_CAPCOM_CPS1 || nHardwareFlag == HARDWARE_CAPCOM_CPS1_QSOUND || nHardwareFlag == HARDWARE_CAPCOM_CPS1_GENERIC || nHardwareFlag == HARDWARE_CAPCOM_CPSCHANGER || nHardwareFlag == HARDWARE_CAPCOM_CPS2 || nHardwareFlag == HARDWARE_CAPCOM_CPS3) { - szFileName = szDefaultCpsFile; - nApplyHardwareDefaults = 1; - } - - if (nHardwareFlag == HARDWARE_SNK_NEOGEO) { - szFileName = szDefaultNeogeoFile; - nApplyHardwareDefaults = 1; - } - - if (nHardwareFlag == HARDWARE_IGS_PGM) { - szFileName = szDefaultPgmFile; - nApplyHardwareDefaults = 1; - } - - if (nApplyHardwareDefaults) { - for (INT32 nPlayer = 0; nPlayer < nMaxPlayers; nPlayer++) { - GameInputAutoIni(nPlayer, szFileName, true); - } - } - - return 0; -} - -// Auto-configure any undefined inputs to defaults -INT32 GameInpDefault() -{ - struct GameInp* pgi; - struct BurnInputInfo bii; - UINT32 i; - - for (INT32 nPlayer = 0; nPlayer < nMaxPlayers; nPlayer++) { - - if ((nPlayerDefaultControls[nPlayer] & 0x0F) != 0x0F) { - continue; - } - - GameInputAutoIni(nPlayer, szPlayerDefaultIni[nPlayer], false); - } - - // Fill all inputs still undefined - for (i = 0, pgi = GameInp; i < nGameInpCount; i++, pgi++) { - if (pgi->nInput) { // Already defined - leave it alone - continue; - } - - // Get the extra info about the input - bii.szInfo = NULL; - BurnDrvGetInputInfo(&bii, i); - if (bii.pVal == NULL) { - continue; - } - if (bii.szInfo == NULL) { - bii.szInfo = ""; - } - - // Dip switches - set to constant - if (bii.nType & BIT_GROUP_CONSTANT) { - pgi->nInput = GIT_CONSTANT; - continue; - } - - GameInpAutoOne(pgi, bii.szInfo); - } - - // Fill in macros still undefined - for (i = 0; i < nMacroCount; i++, pgi++) { - if (pgi->nInput != GIT_MACRO_AUTO || pgi->Macro.nMode) { // Already defined - leave it alone - continue; - } - - GameInpAutoOne(pgi, pgi->Macro.szName); - } - - return 0; -} - -// --------------------------------------------------------------------------- -// Write all the GameInps out to config file 'h' - -INT32 GameInpWrite(FILE* h) -{ - // Write input types - for (UINT32 i = 0; i < nGameInpCount; i++) { - TCHAR* szName = NULL; - INT32 nPad = 0; - szName = InputNumToName(i); - _ftprintf(h, _T("input \"%s\" "), szName); - nPad = 16 - _tcslen(szName); - for (INT32 j = 0; j < nPad; j++) { - _ftprintf(h, _T(" ")); - } - _ftprintf(h, _T("%s\n"), InpToString(GameInp + i)); - } - - _ftprintf(h, _T("\n")); - - struct GameInp* pgi = GameInp + nGameInpCount; - for (UINT32 i = 0; i < nMacroCount; i++, pgi++) { - INT32 nPad = 0; - - if (pgi->nInput & GIT_GROUP_MACRO) { - switch (pgi->nInput) { - case GIT_MACRO_AUTO: // Auto-assigned macros - _ftprintf(h, _T("macro \"%hs\" "), pgi->Macro.szName); - break; - case GIT_MACRO_CUSTOM: // Custom macros - _ftprintf(h, _T("custom \"%hs\" "), pgi->Macro.szName); - break; - default: // Unknown -- ignore - continue; - } - - nPad = 16 - strlen(pgi->Macro.szName); - for (INT32 j = 0; j < nPad; j++) { - _ftprintf(h, _T(" ")); - } - _ftprintf(h, _T("%s\n"), InpMacroToString(pgi)); - } - } - - return 0; -} - -// --------------------------------------------------------------------------- - -// Read a GameInp in -INT32 GameInpRead(TCHAR* szVal, bool bOverWrite) -{ - INT32 nRet; - TCHAR* szQuote = NULL; - TCHAR* szEnd = NULL; - UINT32 i = 0; - - nRet = QuoteRead(&szQuote, &szEnd, szVal); - if (nRet) { - return 1; - } - - // Find which input number this refers to - i = InputNameToNum(szQuote); - if (i == ~0U) { - return 1; - } - - if (bOverWrite || GameInp[i].nInput == 0) { - // Parse the input description into the GameInp structure - StringToInp(GameInp + i, szEnd); - } - - return 0; -} - -INT32 GameInpMacroRead(TCHAR* szVal, bool bOverWrite) -{ - INT32 nRet; - TCHAR* szQuote = NULL; - TCHAR* szEnd = NULL; - UINT32 i = 0; - - nRet = QuoteRead(&szQuote, &szEnd, szVal); - if (nRet) { - return 1; - } - - i = MacroNameToNum(szQuote); - if (i != ~0U) { - i += nGameInpCount; - if (GameInp[i].Macro.nMode == 0 || bOverWrite) { - StringToMacro(GameInp + i, szEnd); - } - } - - return 0; -} - -INT32 GameInpCustomRead(TCHAR* szVal, bool bOverWrite) -{ - return AddCustomMacro(szVal, bOverWrite); -} - diff --git a/jan/src/burner/image.cpp b/jan/src/burner/image.cpp deleted file mode 100644 index b3975c0df..000000000 --- a/jan/src/burner/image.cpp +++ /dev/null @@ -1,582 +0,0 @@ -#include "burner.h" -#include "png.h" - -#define PNG_SIG_CHECK_BYTES (8) - -int bPngImageOrientation = 0; - -void img_free(IMAGE* img) -{ - free(img->rowptr); - img->rowptr = NULL; - if (img->flags & IMG_FREE) { - if (img->bmpbits) { - free(img->bmpbits); - img->bmpbits = NULL; - } - } -} - -INT32 img_alloc(IMAGE* img) -{ - img->flags = 0; - - img->rowbytes = ((DWORD)img->width * 24 + 31) / 32 * 4; - img->imgbytes = img->rowbytes * img->height; - img->rowptr = (BYTE**)malloc((size_t)img->height * sizeof(BYTE*)); - - if (img->bmpbits == NULL) { - img->flags |= IMG_FREE; - img->bmpbits = (BYTE*)malloc((size_t)img->imgbytes); - } - - if (img->rowptr == NULL || img->bmpbits == NULL) { - img_free(img); - return 1; - } - - for (UINT32 y = 0; y < img->height; y++) { - img->rowptr[img->height - y - 1] = img->bmpbits + y * img->rowbytes; - } - - return 0; -} - -// Interpolate using a Catmull-Rom spline -static inline double interpolate(const double f, const double* c) -{ - return 0.5 * (( 2.0 * c[1] ) + - ( -c[0] + c[2] ) * f + - (2.0 * c[0] - 5.0 * c[1] + 4.0 * c[2] - c[3]) * (f * f) + - ( -c[0] + 3.0 * c[1] - 3.0 * c[2] + c[3]) * (f * f * f)); -} - -static inline double interpolatePixelH(const double f, const INT32 x, const UINT8* row, const INT32 width) -{ - double c[4]; - - c[0] = x >= 1 ? row[(x - 1) * 3] : row[0 ]; - c[1] = row[ x * 3]; - c[2] = x < (width - 1) ? row[(x + 1) * 3] : row[width - 1]; - c[3] = x < (width - 2) ? row[(x + 2) * 3] : row[width - 1]; - - return interpolate(f, c); -} - -static void interpolateRowH(const IMAGE* img, const INT32 y, double* row, const INT32 width) -{ - for (INT32 x = 0, x2; x < width; x++) { - - double f = (double)x * img->width / width; - x2 = (INT32)f; f -= x2; - - row[x * 3 + 0] = interpolatePixelH(f, x2, img->rowptr[y] + 0, img->width); - row[x * 3 + 1] = interpolatePixelH(f, x2, img->rowptr[y] + 1, img->width); - row[x * 3 + 2] = interpolatePixelH(f, x2, img->rowptr[y] + 2, img->width); - } -} - -static inline void interpolateRowV(const double f, const INT32 y, double** row, const IMAGE* img) -{ - double c[5]; - - for (UINT32 x = 0; x < img->width * 3; x++) { - - c[0] = row[0][x]; - c[1] = row[1][x]; - c[2] = row[2][x]; - c[3] = row[3][x]; - - c[4] = interpolate(f, c); - - if (c[4] < 0.0) c[4] = 0.0; else if (c[4] > 255.0) c[4] = 255.0; - - img->rowptr[y][x] = (UINT8)c[4]; - } -} - -// Resize the image to the required size using area averaging -static INT32 img_process(IMAGE* img, UINT32 width, UINT32 height, INT32 /*preset*/, bool /*swapRB*/) -{ -/* static struct { double gamma; double sharpness; INT32 min; INT32 max; } presetdata[] = { - { 1.000, 0.000, 0x000000, 0xFFFFFF }, // 0 no effects - { 1.000, 1.000, 0x000000, 0xFFFFFF }, // 1 normal sharpening - { 1.000, 1.250, 0x000000, 0xFFFFFF }, // 2 preview 1 - { 1.250, 1.750, 0x000000, 0xFFFFFF }, // 3 preview 2 - { 1.000, 0.750, 0x000000, 0xFFFFFF }, // 4 preview 3 - { 1.125, 1.500, 0x000000, 0xFFFFFF }, // 5 preview 4 - { 1.000, 1.000, 0x000000, 0xFFFFFF }, // 6 marquee dim 1 - { 1.250, 1.000, 0x202020, 0xFFFFFF }, // 7 marquee light 1 - { 1.250, 1.000, 0x000000, 0xEFEFEF }, // 8 marquee dim 2 - { 0.750, 1.750, 0x202020, 0xFFFFFF }, // 9 marquee light 2 - };*/ - - IMAGE sized_img; - - double ratio = (double)(height * width) / (img->height * img->width); - -/* { - double LUT[256]; - - INT32 rdest = 0, gdest = 1, bdest = 2; - if (swapRB) { - rdest = 2, gdest = 1, bdest = 0; - } - - // Compute a look-up table for gamma correction - - double min = (presetdata[preset].min & 255); - double rng = ((presetdata[preset].max & 255) - (presetdata[preset].min & 255)); - - for (INT32 i = 0; i < 256; i++) { - - LUT[i] = min + rng * pow((i / 255.0), presetdata[preset].gamma); - } - - // Apply gamma - for (UINT32 y = 0; y < img->height; y++) { - for (UINT32 x = 0; x < img->width; x++) { - UINT8 r = (UINT8)LUT[img->rowptr[y][x * 3 + 0]]; - UINT8 g = (UINT8)LUT[img->rowptr[y][x * 3 + 1]]; - UINT8 b = (UINT8)LUT[img->rowptr[y][x * 3 + 2]]; - - img->rowptr[y][x * 3 + rdest] = r; - img->rowptr[y][x * 3 + gdest] = g; - img->rowptr[y][x * 3 + bdest] = b; - } - } - }*/ - - if (img->height == height && img->width == width) { - - // We don't need to resize the image - - return 0; - } - - memset(&sized_img, 0, sizeof(IMAGE)); - sized_img.width = width; - sized_img.height = height; - img_alloc(&sized_img); - - if (ratio >= 1.0) { - - double* row[4]; - - // Enlarge the image using bi-cubic filtering - - for (INT32 i = 0; i < 4; i++) { - row[i] = (double*)malloc(width * 3 * sizeof(double)); - } - - interpolateRowH(img, 0, row[0], width); - interpolateRowH(img, 0, row[1], width); - interpolateRowH(img, 1, row[2], width); - interpolateRowH(img, 2, row[3], width); - - for (UINT32 y = 0, ylast = 0, y2 = 0; y < height; ylast = y2, y++) { - double f = (double)y * img->height / height; - - y2 = (UINT32)f; f -= y2; - - if (y2 > ylast) { - double* r = row[0]; - row[0] = row[1]; - row[1] = row[2]; - row[2] = row[3]; - row[3] = r; - - interpolateRowH(img, (y2 + 2) < img->height ? y2 + 2 : img->height - 1, row[3], width); - } - - interpolateRowV(f, y, row, &sized_img); - } - - for (INT32 i = 0; i < 4; i++) { - if (row[i]) { - free(row[i]); - row[i] = NULL; - } - } - - img_free(img); - - memcpy(img, &sized_img, sizeof(IMAGE)); - - return 0; - } - - // Shrink the image using area averaging and apply gamma - - for (UINT32 y = 0; y < sized_img.height; y++) { - for (UINT32 x = 0; x < sized_img.width; x++) { - - double r0, b0, g0, r1, g1, b1, xf, yf; - UINT32 x1, y1; - - r0 = g0 = b0 = 0.0; - - y1 = img->height * y / sized_img.height; - yf = (double)img->height * y / sized_img.height - y1; - - x1 = img->width * x / sized_img.width; - xf = (double)img->width * x / sized_img.width - x1; - r1 = (double)img->rowptr[y1][x1 * 3 + 0] * (1.0 - xf); - g1 = (double)img->rowptr[y1][x1 * 3 + 1] * (1.0 - xf); - b1 = (double)img->rowptr[y1][x1 * 3 + 2] * (1.0 - xf); - - for (x1 = x1 + 1; x1 < img->width * (x + 1) / sized_img.width; x1++) { - r1 += (double)img->rowptr[y1][x1 * 3 + 0]; - g1 += (double)img->rowptr[y1][x1 * 3 + 1]; - b1 += (double)img->rowptr[y1][x1 * 3 + 2]; - } - - if (x1 < img->width) { - xf = (double)img->width * (x + 1) / sized_img.width - x1; - r1 += (double)img->rowptr[y1][x1 * 3 + 0] * xf; - g1 += (double)img->rowptr[y1][x1 * 3 + 1] * xf; - b1 += (double)img->rowptr[y1][x1 * 3 + 2] * xf; - } - - r0 += r1 * (1.0 - yf); - g0 += g1 * (1.0 - yf); - b0 += b1 * (1.0 - yf); - - for (y1 = y1 + 1; y1 < img->height * (y + 1) / sized_img.height; y1++) { - x1 = img->width * x / sized_img.width; - xf = (double)img->width * x / sized_img.width - x1; - - r1 = (double)img->rowptr[y1][x1 * 3 + 0] * (1.0 - xf); - g1 = (double)img->rowptr[y1][x1 * 3 + 1] * (1.0 - xf); - b1 = (double)img->rowptr[y1][x1 * 3 + 2] * (1.0 - xf); - - for (x1 = x1 + 1; x1 < img->width * (x + 1) / sized_img.width; x1++) { - r1 += (double)img->rowptr[y1][x1 * 3 + 0]; - g1 += (double)img->rowptr[y1][x1 * 3 + 1]; - b1 += (double)img->rowptr[y1][x1 * 3 + 2]; - } - - if (x1 < img->width) { - xf = (double)img->width * (x + 1) / sized_img.width - x1; - r1 += (double)img->rowptr[y1][x1 * 3 + 0] * xf; - g1 += (double)img->rowptr[y1][x1 * 3 + 1] * xf; - b1 += (double)img->rowptr[y1][x1 * 3 + 2] * xf; - } - - r0 += r1; - g0 += g1; - b0 += b1; - } - - if (y1 < img->height) { - yf = (double)img->height * (y + 1) / sized_img.height - y1; - - x1 = img->width * x / sized_img.width; - xf = (double)img->width * x / sized_img.width - x1; - r1 = (double)img->rowptr[y1][x1 * 3 + 0] * (1.0 - xf); - g1 = (double)img->rowptr[y1][x1 * 3 + 1] * (1.0 - xf); - b1 = (double)img->rowptr[y1][x1 * 3 + 2] * (1.0 - xf); - - for (x1 = x1 + 1; x1 < img->width * (x + 1) / sized_img.width; x1++) { - r1 += (double)img->rowptr[y1][x1 * 3 + 0]; - g1 += (double)img->rowptr[y1][x1 * 3 + 1]; - b1 += (double)img->rowptr[y1][x1 * 3 + 2]; - } - - if (x1 < img->width) { - xf = (double)img->width * (x + 1) / sized_img.width - x1; - r1 += (double)img->rowptr[y1][x1 * 3 + 0] * xf; - g1 += (double)img->rowptr[y1][x1 * 3 + 1] * xf; - b1 += (double)img->rowptr[y1][x1 * 3 + 2] * xf; - } - - r0 += r1 * yf; - g0 += g1 * yf; - b0 += b1 * yf; - } - - sized_img.rowptr[y][x * 3 + 0] = (UINT8)(r0 * ratio);// + 0.5; - sized_img.rowptr[y][x * 3 + 1] = (UINT8)(g0 * ratio);// + 0.5; - sized_img.rowptr[y][x * 3 + 2] = (UINT8)(b0 * ratio);// + 0.5; - } - } - - img_free(img); - -// if (!presetdata[preset].sharpness || ratio >= 1.0) { - memcpy(img, &sized_img, sizeof(IMAGE)); - - return 0; -// } - - // Sharpen the image using an unsharp mask - -/* IMAGE sharp_img; - - memset(&sharp_img, 0, sizeof(IMAGE)); - sharp_img.width = width; - sharp_img.height = height; - img_alloc(&sharp_img); - - // Create a convolution matrix for a gaussian blur - - double matrix[9][9]; - - // Control the radius of the blur based on sharpness and image reduction - double b = presetdata[preset].sharpness / (8.0 * ratio); - -// dprintf(_T(" %3ix%3i -> %3ix%3i %0.4lf %0.4lf\n"), img->width, img->height, sized_img.width, sized_img.height, ratio, b); - if (b > 1.5) { b = 1.5; } - b = pow(b, 2.0); - - for (INT32 x = -4; x < 5; x++) { - for (INT32 y = -4; y < 5; y++) { - - double c = sqrt(double(x * x + y * y)); - - matrix[y + 4][x + 4] = 1.0 / exp(-c * -c / b); - } - } - - for (INT32 y = 0; y < sized_img.height; y++) { - for (INT32 x = 0; x < sized_img.width; x++) { - - double r, g, b, m; - - r = g = b = m = 0.0; - - // Convolve the image - for (INT32 y1 = -4; y1 < 5; y1++) { - if (y + y1 > 0 && y + y1 < sized_img.height) { - for (INT32 x1 = -4; x1 < 5; x1++) { - if (x + x1 > 0 && x + x1 < sized_img.width) { - r += matrix[y1 + 4][x1 + 4] * sized_img.rowptr[y + y1][(x + x1) * 3 + 0]; - g += matrix[y1 + 4][x1 + 4] * sized_img.rowptr[y + y1][(x + x1) * 3 + 1]; - b += matrix[y1 + 4][x1 + 4] * sized_img.rowptr[y + y1][(x + x1) * 3 + 2]; - m += abs(matrix[y1 + 4][x1 + 4]); - } - } - } - } - - // Normalise the image - r /= m; - g /= m; - b /= m; - - // create the mask by subtracting the blurred image from the original - r = presetdata[preset].sharpness * ((double)sized_img.rowptr[y][x * 3 + 0] - r); - g = presetdata[preset].sharpness * ((double)sized_img.rowptr[y][x * 3 + 1] - g); - b = presetdata[preset].sharpness * ((double)sized_img.rowptr[y][x * 3 + 2] - b); - - // Implement a treshold control, rolloff beneath the treshold based on image reduction - - double treshold = 32.0 / presetdata[preset].sharpness; - - if (abs(r) < treshold && abs(g) < treshold && abs(b) < treshold) { - r /= 1.0 + ((treshold - abs(r)) * ratio); - g /= 1.0 + ((treshold - abs(g)) * ratio); - b /= 1.0 + ((treshold - abs(b)) * ratio); - } - - // Add the mask back to the original - r = (double)sized_img.rowptr[y][x * 3 + 0] + r; - g = (double)sized_img.rowptr[y][x * 3 + 1] + g; - b = (double)sized_img.rowptr[y][x * 3 + 2] + b; - - // Clamp RGB values - if (r < 0) { r = 0; } if (r > 255) { r = 255; } - if (g < 0) { g = 0; } if (g > 255) { g = 255; } - if (b < 0) { b = 0; } if (b > 255) { b = 255; } - - // Store image - sharp_img.rowptr[y][x * 3 + 0] = r; - sharp_img.rowptr[y][x * 3 + 1] = g; - sharp_img.rowptr[y][x * 3 + 2] = b; - } - }*/ - - img_free(&sized_img); - -// memcpy(img, &sharp_img, sizeof(IMAGE)); - - return 0; -} - -bool PNGIsImage(FILE* fp) -{ - if (fp) { - UINT8 pngsig[PNG_SIG_CHECK_BYTES]; - - fseek(fp, 0, SEEK_SET); - fread(pngsig, 1, PNG_SIG_CHECK_BYTES, fp); - fseek(fp, 0, SEEK_SET); - - if (png_sig_cmp(pngsig, 0, PNG_SIG_CHECK_BYTES) == 0) { - return true; - } - } - - return false; -} - -INT32 PNGLoad(IMAGE* img, FILE* fp, INT32 nPreset) -{ - IMAGE temp_img; - png_uint_32 width, height; - INT32 bit_depth, color_type; - - if (fp) { - // check signature - UINT8 pngsig[PNG_SIG_CHECK_BYTES]; - fread(pngsig, 1, PNG_SIG_CHECK_BYTES, fp); - if (png_sig_cmp(pngsig, 0, PNG_SIG_CHECK_BYTES)) { - return 1; - } - - png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!png_ptr) { - return 1; - } - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); - return 1; - } - - memset(&temp_img, 0, sizeof(IMAGE)); - png_init_io(png_ptr, fp); - png_set_sig_bytes(png_ptr, PNG_SIG_CHECK_BYTES); - png_read_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, NULL, NULL, NULL); - - if (setjmp(png_jmpbuf(png_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - return 1; - } - - // Instruct libpng to convert the image to 24-bit RGB format - if (color_type == PNG_COLOR_TYPE_PALETTE) { - png_set_palette_to_rgb(png_ptr); - } - if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - png_set_gray_to_rgb(png_ptr); - } - if (bit_depth == 16) { - png_set_strip_16(png_ptr); - } - if (color_type & PNG_COLOR_MASK_ALPHA) { - png_set_strip_alpha(png_ptr); - } - - temp_img.width = width; - temp_img.height = height; - - // Initialize our img structure - if (img_alloc(&temp_img)) { - //longjmp(png_ptr->jmpbuf, 1); - png_jmpbuf(png_ptr); - } - - // If bad things happen in libpng we need to do img_free(&temp_img) as well - if (setjmp(png_jmpbuf(png_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - img_free(&temp_img); - return 1; - } - - // Read the .PNG image - png_set_bgr(png_ptr); - png_read_update_info(png_ptr, info_ptr); - png_read_image(png_ptr, temp_img.rowptr); - png_read_end(png_ptr, (png_infop)NULL); - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - } else { - -#ifdef BUILD_WIN32 - // Find resource - HRSRC hrsrc = FindResource(NULL, MAKEINTRESOURCE(BMP_SPLASH), RT_BITMAP); - HGLOBAL hglobal = LoadResource(NULL, (HRSRC)hrsrc); - BYTE* pResourceData = (BYTE*)LockResource(hglobal); - - BITMAPINFOHEADER* pbmih = (BITMAPINFOHEADER*)LockResource(hglobal); - - // Allocate a new image - memset(&temp_img, 0, sizeof(IMAGE)); - temp_img.width = pbmih->biWidth; - temp_img.height = pbmih->biHeight; - temp_img.bmpbits = pResourceData + pbmih->biSize; - img_alloc(&temp_img); - -#else - return 1; -#endif - - } - - if (img_process(&temp_img, img->width ? img->width : temp_img.width, img->height ? img->height : temp_img.height, nPreset, false)) { - img_free(&temp_img); - return 1; - } - - bPngImageOrientation = 0; - if (height > width) bPngImageOrientation = 1; - - memcpy(img, &temp_img, sizeof(IMAGE)); - - return 0; -} - -INT32 PNGGetInfo(IMAGE* img, FILE *fp) -{ - IMAGE temp_img; - png_uint_32 width, height; - INT32 bit_depth, color_type; - - if (fp) { - // check signature - UINT8 pngsig[PNG_SIG_CHECK_BYTES]; - fread(pngsig, 1, PNG_SIG_CHECK_BYTES, fp); - if (png_sig_cmp(pngsig, 0, PNG_SIG_CHECK_BYTES)) { - return 1; - } - - png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!png_ptr) { - return 1; - } - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); - return 1; - } - - memset(&temp_img, 0, sizeof(IMAGE)); - png_init_io(png_ptr, fp); - png_set_sig_bytes(png_ptr, PNG_SIG_CHECK_BYTES); - png_read_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, NULL, NULL, NULL); - - if (setjmp(png_jmpbuf(png_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - return 1; - } - - temp_img.width = width; - temp_img.height = height; - - if (setjmp(png_jmpbuf(png_ptr))) { - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - return 1; - } - - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - } - - memcpy(img, &temp_img, sizeof(IMAGE)); - img_free(&temp_img); - - return 0; -} diff --git a/jan/src/burner/ioapi.c b/jan/src/burner/ioapi.c deleted file mode 100644 index 5c710472a..000000000 --- a/jan/src/burner/ioapi.c +++ /dev/null @@ -1,241 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - -*/ - -#if (defined(_WIN32)) - #define _CRT_SECURE_NO_WARNINGS -#endif - -#if defined(__APPLE__) - #define fopen64 fopen - #define ftello64 ftell - #define fseeko64 fseek -#endif - -#include "ioapi.h" - -voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) -{ - if (pfilefunc->zfile_func64.zopen64_file != NULL) - return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); - else - { - return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); - } -} - -long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) -{ - if (pfilefunc->zfile_func64.zseek64_file != NULL) - return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); - else - { - uLong offsetTruncated = (uLong)offset; - if (offsetTruncated != offset) - return -1; - else - return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); - } -} - -ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) -{ - if (pfilefunc->zfile_func64.zseek64_file != NULL) - return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); - else - { - uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); - if ((tell_uLong) == ((uLong)-1)) - return (ZPOS64_T)-1; - else - return tell_uLong; - } -} - -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) -{ - p_filefunc64_32->zfile_func64.zopen64_file = NULL; - p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; - p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; - p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; - p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; - p_filefunc64_32->zfile_func64.ztell64_file = NULL; - p_filefunc64_32->zfile_func64.zseek64_file = NULL; - p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; - p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; - p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; - p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; - p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; -} - - - -static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); -static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); -static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); -static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); -static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); - -static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) -{ - FILE* file = NULL; - const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename!=NULL) && (mode_fopen != NULL)) - file = fopen(filename, mode_fopen); - return file; -} - -static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) -{ - FILE* file = NULL; - const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename!=NULL) && (mode_fopen != NULL)) - file = fopen64((const char*)filename, mode_fopen); - return file; -} - - -static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) -{ - uLong ret; - ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - -static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) -{ - uLong ret; - ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - -static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) -{ - long ret; - ret = ftell((FILE *)stream); - return ret; -} - - -static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) -{ - ZPOS64_T ret; - ret = ftello64((FILE *)stream); - return ret; -} - -static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) -{ - int fseek_origin=0; - long ret; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END : - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - fseek_origin = SEEK_SET; - break; - default: return -1; - } - ret = 0; - if (fseek((FILE *)stream, offset, fseek_origin) != 0) - ret = -1; - return ret; -} - -static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) -{ - int fseek_origin=0; - long ret; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END : - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - fseek_origin = SEEK_SET; - break; - default: return -1; - } - ret = 0; - - if(fseeko64((FILE *)stream, offset, fseek_origin) != 0) - ret = -1; - - return ret; -} - - -static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) -{ - int ret; - ret = fclose((FILE *)stream); - return ret; -} - -static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) -{ - int ret; - ret = ferror((FILE *)stream); - return ret; -} - -void fill_fopen_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; -{ - pzlib_filefunc_def->zopen_file = fopen_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell_file = ftell_file_func; - pzlib_filefunc_def->zseek_file = fseek_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} - -void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen64_file = fopen64_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell64_file = ftell64_file_func; - pzlib_filefunc_def->zseek64_file = fseek64_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} diff --git a/jan/src/burner/ioapi.h b/jan/src/burner/ioapi.h deleted file mode 100644 index 8309c4cf8..000000000 --- a/jan/src/burner/ioapi.h +++ /dev/null @@ -1,200 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - Changes - - Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) - Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. - More if/def section may be needed to support other platforms - Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. - (but you should use iowin32.c for windows instead) - -*/ - -#ifndef _ZLIBIOAPI64_H -#define _ZLIBIOAPI64_H - -#if (!defined(_WIN32)) && (!defined(WIN32)) - - // Linux needs this to support file operation on files larger then 4+GB - // But might need better if/def to select just the platforms that needs them. - - #ifndef __USE_FILE_OFFSET64 - #define __USE_FILE_OFFSET64 - #endif - #ifndef __USE_LARGEFILE64 - #define __USE_LARGEFILE64 - #endif - #ifndef _LARGEFILE64_SOURCE - #define _LARGEFILE64_SOURCE - #endif - #ifndef _FILE_OFFSET_BIT - #define _FILE_OFFSET_BIT 64 - #endif -#endif - -#include -#include -#include "zlib.h" - -#if defined(USE_FILE32API) -#define fopen64 fopen -#define ftello64 ftell -#define fseeko64 fseek -#else -#ifdef _MSC_VER - #define fopen64 fopen - #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) - #define ftello64 _ftelli64 - #define fseeko64 _fseeki64 - #else // old MSC - #define ftello64 ftell - #define fseeko64 fseek - #endif -#endif -#endif - -/* -#ifndef ZPOS64_T - #ifdef _WIN32 - #define ZPOS64_T fpos_t - #else - #include - #define ZPOS64_T uint64_t - #endif -#endif -*/ - -#ifdef HAVE_MINIZIP64_CONF_H -#include "mz64conf.h" -#endif - -/* a type choosen by DEFINE */ -#ifdef HAVE_64BIT_INT_CUSTOM -typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; -#else -#ifdef HAS_STDINT_H -#include "stdint.h" -typedef uint64_t ZPOS64_T; -#else - - -#if defined(_MSC_VER) || defined(__BORLANDC__) -typedef unsigned __int64 ZPOS64_T; -#else -typedef unsigned long long int ZPOS64_T; -#endif -#endif -#endif - - - -#ifdef __cplusplus -extern "C" { -#endif - - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) - #define ZCALLBACK CALLBACK - #else - #define ZCALLBACK - #endif -#endif - - - - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); - - -/* here is the "old" 32 bits structure structure */ -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - -typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); - -typedef struct zlib_filefunc64_def_s -{ - open64_file_func zopen64_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell64_file_func ztell64_file; - seek64_file_func zseek64_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc64_def; - -void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -/* now internal definition, only for zip.c and unzip.h */ -typedef struct zlib_filefunc64_32_def_s -{ - zlib_filefunc64_def zfile_func64; - open_file_func zopen32_file; - tell_file_func ztell32_file; - seek_file_func zseek32_file; -} zlib_filefunc64_32_def; - - -#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) -//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) -#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) - -voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); -long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); -ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); - -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); - -#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) -#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) -#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/jan/src/burner/libretro/burn_endian.h b/jan/src/burner/libretro/burn_endian.h deleted file mode 100644 index 88ddb151f..000000000 --- a/jan/src/burner/libretro/burn_endian.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef _FBA_ENDIAN_H -#define _FBA_ENDIAN_H - -#ifndef _XBOX -#define NO_64BIT_BYTESWAP -#endif - -typedef union { - struct { UINT8 h3,h2,h,l; } b; - struct { UINT16 h,l; } w; - UINT32 d; -} PAIR; - -/* Only Xbox 360 so far seems to have byteswap 64-bit intrinsic */ -#ifdef NO_64BIT_BYTESWAP -typedef union { - UINT64 ll; - struct { UINT32 l, h; } l; -} BYTESWAP_INT64; -#endif - -/* Libogc doesn't have intrinsics or ASM macros defined for this */ -#if defined(HW_RVL) || defined(GEKKO) -#define __sthbrx(base,index,value) \ - __asm__ volatile ("sthbrx %0,%1,%2" : : "r"(value), "b%"(index), "r"(base) : "memory") - -#define __stwbrx(base,index,value) \ - __asm__ volatile ("stwbrx %0,%1,%2" : : "r"(value), "b%"(index), "r"(base) : "memory") -#endif - -/* Xbox 360 */ -#if defined(_XBOX) -#define BURN_ENDIAN_SWAP_INT8(x) (x^1) -#define BURN_ENDIAN_SWAP_INT16(x) (_byteswap_ushort(x)) -#define BURN_ENDIAN_SWAP_INT32(x) (_byteswap_ulong(x)) -#define BURN_ENDIAN_SWAP_INT64(x) (_byteswap_uint64(x)) -/* PlayStation3 */ -#elif defined(__CELLOS_LV2__) -#include -#define BURN_ENDIAN_SWAP_INT8(x) (x^1) -#define BURN_ENDIAN_SWAP_INT16(x) ({uint16_t t; __sthbrx(&t, x); t;}) -#define BURN_ENDIAN_SWAP_INT32(x) ({uint32_t t; __stwbrx(&t, x); t;}) -/* Wii */ -#elif defined(HW_RVL) -#define BURN_ENDIAN_SWAP_INT8(x) (x^1) -#define BURN_ENDIAN_SWAP_INT16(x) ({uint16_t t; __sthbrx(&t, 0, x); t;}) -#define BURN_ENDIAN_SWAP_INT32(x) ({uint32_t t; __stwbrx(&t, 0, x); t;}) -#endif - -#ifdef NO_64BIT_BYTESWAP -static inline UINT64 BURN_ENDIAN_SWAP_INT64(UINT64 x) -{ - BYTESWAP_INT64 r = {0}; - r.l.l = BURN_ENDIAN_SWAP_INT32(x); - r.l.h = BURN_ENDIAN_SWAP_INT32(x >> 32); - return r.ll; -} -#endif - -#endif diff --git a/jan/src/burner/libretro/burn_libretro_opts.h b/jan/src/burner/libretro/burn_libretro_opts.h deleted file mode 100644 index 7c740c1e6..000000000 --- a/jan/src/burner/libretro/burn_libretro_opts.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _LIBRETRO_OPTIMIZATIONS_H_ -#define _LIBRETRO_OPTIMIZATIONS_H_ - -#define BurnHighCol LIBRETRO_COLOR_CONVERT -#define BurnHighColSwitch LIBRETRO_COLOR_CONVERT_SWITCH - -#ifdef FRONTEND_SUPPORTS_RGB565 -#define LIBRETRO_COLOR_15BPP_XBGR(color, unused) (((color & 0x001f) << 11) | ((color & 0x03e0) << 1) | ((color & 0x7c00) >> 10)) -#define LIBRETRO_COLOR_CONVERT(r, g, b, a) (((r << 8) & 0xf800) | ((g << 3) & 0x07e0) | ((b >> 3) & 0x001f)) -#define LIBRETRO_COLOR_CONVERT_SWITCH(r, g, b, a) (nBurnBpp == 2) ? (((r << 8) & 0xf800) | ((g << 3) & 0x07e0) | ((b >> 3) & 0x001f)) : (((r << 16) & 0xff0000) | ((g << 8) & 0x00ff00) | ((b) & 0x0000ff)) -#else -#define LIBRETRO_COLOR_15BPP_XBGR(color, unused) ((((color & 0x1f) << 10) | (((color & 0x3e0) >> 5) << 5) | (((color & 0x7c00) >> 10))) & 0x7fff) -#define LIBRETRO_COLOR_CONVERT(r, g, b, a) (((r << 7) & 0x7c00) | ((g << 2) & 0x03e0) | ((b >> 3) & 0x001f)) -#define LIBRETRO_COLOR_CONVERT_SWITCH(r, g, b, a) (nBurnBpp == 2) ? (((r << 7) & 0x7c00) | ((g << 2) & 0x03e0) | ((b >> 3) & 0x001f)) : (((r << 16) & 0xff0000) | ((g << 8) & 0x00ff00) | ((b) & 0x0000ff)) -#endif - -#endif diff --git a/jan/src/burner/libretro/burner_libretro.h b/jan/src/burner/libretro/burner_libretro.h deleted file mode 100644 index ddfc06f98..000000000 --- a/jan/src/burner/libretro/burner_libretro.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _BURNER_LIBRETRO_H -#define _BURNER_LIBRETRO_H - -#include "gameinp.h" -#include "input/inp_keys.h" - -extern int bDrvOkay; -extern int bRunPause; -extern bool bAlwaysProcessKeyboardInput; - -#ifdef _MSC_VER -#define snprintf _snprintf -#define ANSIToTCHAR(str, foo, bar) (str) -#endif - -extern void InpDIPSWResetDIPs (void); - -#endif diff --git a/jan/src/burner/libretro/libretro.cpp b/jan/src/burner/libretro/libretro.cpp deleted file mode 100644 index a0fb0d0ef..000000000 --- a/jan/src/burner/libretro/libretro.cpp +++ /dev/null @@ -1,1744 +0,0 @@ -#include "libretro.h" -#include "burner.h" -#include "input/inp_keys.h" -#include "state.h" -#include -#include - -#include -#include -#include - -#include "cd/cd_interface.h" - -static unsigned int BurnDrvGetIndexByName(const char* name); - -#define STAT_NOFIND 0 -#define STAT_OK 1 -#define STAT_CRC 2 -#define STAT_SMALL 3 -#define STAT_LARGE 4 - -struct ROMFIND -{ - unsigned int nState; - int nArchive; - int nPos; - BurnRomInfo ri; -}; - -static std::vector g_find_list_path; -static ROMFIND g_find_list[1024]; -static unsigned g_rom_count; - -#define AUDIO_SAMPLERATE 32000 -#define AUDIO_SEGMENT_LENGTH 534 // <-- Hardcoded value that corresponds well to 32kHz audio. - -static uint32_t g_fba_frame[1024 * 1024]; -static int16_t g_audio_buf[AUDIO_SEGMENT_LENGTH * 2]; - -// libretro globals - -static retro_environment_t environ_cb; -static retro_video_refresh_t video_cb; -static retro_input_poll_t poll_cb; -static retro_input_state_t input_cb; -static retro_audio_sample_batch_t audio_batch_cb; -void retro_set_video_refresh(retro_video_refresh_t cb) { video_cb = cb; } -void retro_set_audio_sample(retro_audio_sample_t) {} -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) { poll_cb = cb; } -void retro_set_input_state(retro_input_state_t cb) { input_cb = cb; } -void retro_set_environment(retro_environment_t cb) { environ_cb = cb; } - -static char g_rom_dir[1024]; -static bool driver_inited; - -void retro_get_system_info(struct retro_system_info *info) -{ - info->library_name = "FB Alpha"; - info->library_version = "v0.2.97.28"; - info->need_fullpath = true; - info->block_extract = true; - info->valid_extensions = "iso|ISO|zip|ZIP"; -} - -///// -static void poll_input(); -static bool init_input(); - -// FBA stubs -unsigned ArcadeJoystick; - -int bDrvOkay; -int bRunPause; -bool bAlwaysProcessKeyboardInput; - -bool bDoIpsPatch; -void IpsApplyPatches(UINT8 *, char *) {} - -TCHAR szAppHiscorePath[MAX_PATH]; -TCHAR szAppSamplesPath[MAX_PATH]; -TCHAR szAppBurnVer[16]; - -CDEmuStatusValue CDEmuStatus; - -const char* isowavLBAToMSF(const int LBA) { return ""; } -int isowavMSFToLBA(const char* address) { return 0; } -TCHAR* GetIsoPath() { return NULL; } -INT32 CDEmuInit() { return 0; } -INT32 CDEmuExit() { return 0; } -INT32 CDEmuStop() { return 0; } -INT32 CDEmuPlay(UINT8 M, UINT8 S, UINT8 F) { return 0; } -INT32 CDEmuLoadSector(INT32 LBA, char* pBuffer) { return 0; } -UINT8* CDEmuReadTOC(INT32 track) { return 0; } -UINT8* CDEmuReadQChannel() { return 0; } -INT32 CDEmuGetSoundBuffer(INT16* buffer, INT32 samples) { return 0; } - -static int nDIPOffset; - -static void InpDIPSWGetOffset (void) -{ - BurnDIPInfo bdi; - nDIPOffset = 0; - - for(int i = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++) - { - if (bdi.nFlags == 0xF0) - { - nDIPOffset = bdi.nInput; - break; - } - } -} - -void InpDIPSWResetDIPs (void) -{ - int i = 0; - BurnDIPInfo bdi; - struct GameInp * pgi = NULL; - - InpDIPSWGetOffset(); - - while (BurnDrvGetDIPInfo(&bdi, i) == 0) - { - if (bdi.nFlags == 0xFF) - { - pgi = GameInp + bdi.nInput + nDIPOffset; - if (pgi) - pgi->Input.Constant.nConst = (pgi->Input.Constant.nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); - } - i++; - } -} - -int InputSetCooperativeLevel(const bool bExclusive, const bool bForeGround) { return 0; } - -void Reinitialise(void) -{ -#if 0 // ?! - int width, height; - BurnDrvGetVisibleSize(&width, &height); - unsigned drv_flags = BurnDrvGetFlags(); - if (drv_flags & BDF_ORIENTATION_VERTICAL) - nBurnPitch = height * sizeof(uint16_t); - else - nBurnPitch = width * sizeof(uint16_t); - - if (environ_cb) - { - BurnDrvGetVisibleSize(&width, &height); - retro_geometry geom = { width, height, width, height }; - environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &geom); - environ_cb(RETRO_ENVIRONMENT_SET_PITCH, &nBurnPitch); - } -#endif -} - -// Non-idiomatic (OutString should be to the left to match strcpy()) -// Seems broken to not check nOutSize. -char* TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int /*nOutSize*/) -{ - if (pszOutString) - { - strcpy(pszOutString, pszInString); - return pszOutString; - } - - return (char*)pszInString; -} - -int QuoteRead(char **, char **, char*) { return 1; } -char *LabelCheck(char *, char *) { return 0; } -const int nConfigMinVersion = 0x020921; - -static int find_rom_by_crc(uint32_t crc, const ZipEntry *list, unsigned elems) -{ - for (unsigned i = 0; i < elems; i++) - { - if (list[i].nCrc == crc) - return i; - } - - return -1; -} - -static void free_archive_list(ZipEntry *list, unsigned count) -{ - if (list) - { - for (unsigned i = 0; i < count; i++) - free(list[i].szName); - free(list); - } -} - -static int archive_load_rom(uint8_t *dest, int *wrote, int i) -{ - if (i < 0 || i >= g_rom_count) - return 1; - - int archive = g_find_list[i].nArchive; - - if (ZipOpen((char*)g_find_list_path[archive].c_str()) != 0) - return 1; - - BurnRomInfo ri = {0}; - BurnDrvGetRomInfo(&ri, i); - - if (ZipLoadFile(dest, ri.nLen, wrote, g_find_list[i].nPos) != 0) - { - ZipClose(); - return 1; - } - - ZipClose(); - return 0; -} - -// This code is very confusing. The original code is even more confusing :( -static bool open_archive() -{ - memset(g_find_list, 0, sizeof(g_find_list)); - - // FBA wants some roms ... Figure out how many. - g_rom_count = 0; - while (!BurnDrvGetRomInfo(&g_find_list[g_rom_count].ri, g_rom_count)) - g_rom_count++; - - g_find_list_path.clear(); - - // Check if we have said archives. - // Check if archives are found. These are relative to g_rom_dir. - char *rom_name; - for (unsigned index = 0; index < 32; index++) - { - if (BurnDrvGetZipName(&rom_name, index)) - continue; - - fprintf(stderr, "[FBA] Archive: %s\n", rom_name); - - char path[1024]; -#ifdef _XBOX - snprintf(path, sizeof(path), "%s\\%s", g_rom_dir, rom_name); -#else - snprintf(path, sizeof(path), "%s/%s", g_rom_dir, rom_name); -#endif - - if (ZipOpen(path) != 0) - { - fprintf(stderr, "[FBA] Failed to find archive: %s\n", path); - return false; - } - ZipClose(); - - g_find_list_path.push_back(path); - } - - for (unsigned z = 0; z < g_find_list_path.size(); z++) - { - if (ZipOpen((char*)g_find_list_path[z].c_str()) != 0) - { - fprintf(stderr, "[FBA] Failed to open archive %s\n", g_find_list_path[z].c_str()); - return false; - } - - ZipEntry *list = NULL; - int count; - ZipGetList(&list, &count); - - // Try to map the ROMs FBA wants to ROMs we find inside our pretty archives ... - for (unsigned i = 0; i < g_rom_count; i++) - { - if (g_find_list[i].nState == STAT_OK) - continue; - - if (g_find_list[i].ri.nType == 0 || g_find_list[i].ri.nLen == 0 || g_find_list[i].ri.nCrc == 0) - { - g_find_list[i].nState = STAT_OK; - continue; - } - - int index = find_rom_by_crc(g_find_list[i].ri.nCrc, list, count); - if (index < 0) - continue; - - // Yay, we found it! - g_find_list[i].nArchive = z; - g_find_list[i].nPos = index; - g_find_list[i].nState = STAT_OK; - - if (list[index].nLen < g_find_list[i].ri.nLen) - g_find_list[i].nState = STAT_SMALL; - else if (list[index].nLen > g_find_list[i].ri.nLen) - g_find_list[i].nState = STAT_LARGE; - } - - free_archive_list(list, count); - ZipClose(); - } - - // Going over every rom to see if they are properly loaded before we continue ... - for (unsigned i = 0; i < g_rom_count; i++) - { - if (g_find_list[i].nState != STAT_OK) - { - fprintf(stderr, "[FBA] ROM index %i was not found ... CRC: 0x%08x\n", - i, g_find_list[i].ri.nCrc); - if(!(g_find_list[i].ri.nType & BRF_OPT)) - return false; - } - } - - BurnExtLoadRom = archive_load_rom; - return true; -} - -void retro_init() -{ - BurnLibInit(); -} - -void retro_deinit() -{ - if (driver_inited) - BurnDrvExit(); - driver_inited = false; - BurnLibExit(); -} - -static bool g_reset; -void retro_reset() { g_reset = true; } - -void retro_run() -{ - int width, height; - BurnDrvGetVisibleSize(&width, &height); - pBurnDraw = (uint8_t*)g_fba_frame; - - poll_input(); - - //nBurnLayer = 0xff; - pBurnSoundOut = g_audio_buf; - nBurnSoundRate = AUDIO_SAMPLERATE; - //nBurnSoundLen = AUDIO_SEGMENT_LENGTH; - nCurrentFrame++; - - - BurnDrvFrame(); - unsigned drv_flags = BurnDrvGetFlags(); - uint32_t height_tmp = height; - size_t pitch_size = nBurnBpp == 2 ? sizeof(uint16_t) : sizeof(uint32_t); - if (drv_flags & (BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED)) - { - nBurnPitch = height * pitch_size; - height = width; - width = height_tmp; - } - else - nBurnPitch = width * pitch_size; - - video_cb(g_fba_frame, width, height, nBurnPitch); - audio_batch_cb(g_audio_buf, nBurnSoundLen); -} - -static uint8_t *write_state_ptr; -static const uint8_t *read_state_ptr; -static unsigned state_size; - -static int burn_write_state_cb(BurnArea *pba) -{ - memcpy(write_state_ptr, pba->Data, pba->nLen); - write_state_ptr += pba->nLen; - return 0; -} - -static int burn_read_state_cb(BurnArea *pba) -{ - memcpy(pba->Data, read_state_ptr, pba->nLen); - read_state_ptr += pba->nLen; - return 0; -} - -static int burn_dummy_state_cb(BurnArea *pba) -{ - state_size += pba->nLen; - return 0; -} - -size_t retro_serialize_size() -{ - if (state_size) - return state_size; - - BurnAcb = burn_dummy_state_cb; - state_size = 0; - BurnAreaScan(ACB_VOLATILE | ACB_WRITE, 0); - return state_size; -} - -bool retro_serialize(void *data, size_t size) -{ - if (size != state_size) - return false; - - BurnAcb = burn_write_state_cb; - write_state_ptr = (uint8_t*)data; - BurnAreaScan(ACB_VOLATILE | ACB_WRITE, 0); - - return true; -} - -bool retro_unserialize(const void *data, size_t size) -{ - if (size != state_size) - return false; - BurnAcb = burn_read_state_cb; - read_state_ptr = (const uint8_t*)data; - BurnAreaScan(ACB_VOLATILE | ACB_READ, 0); - - return true; -} - -void retro_cheat_reset() {} -void retro_cheat_set(unsigned, bool, const char*) {} - -void retro_get_system_av_info(struct retro_system_av_info *info) -{ - int width, height; - BurnDrvGetVisibleSize(&width, &height); - int maximum = width > height ? width : height; - struct retro_game_geometry geom = { width, height, maximum, maximum }; - - struct retro_system_timing timing = { (nBurnFPS / 100.0), (nBurnFPS / 100.0) * AUDIO_SEGMENT_LENGTH }; - - info->geometry = geom; - info->timing = timing; -} - -int VidRecalcPal() -{ - return BurnRecalcPal(); -} - -static bool fba_init(unsigned driver, const char *game_zip_name) -{ - nBurnDrvActive = driver; - - if (!open_archive()) - return false; - - nBurnBpp = 2; - nFMInterpolation = 3; - nInterpolation = 3; - - BurnDrvInit(); - - int width, height; - BurnDrvGetVisibleSize(&width, &height); - unsigned drv_flags = BurnDrvGetFlags(); - size_t pitch_size = nBurnBpp == 2 ? sizeof(uint16_t) : sizeof(uint32_t); - if (drv_flags & BDF_ORIENTATION_VERTICAL) - nBurnPitch = height * pitch_size; - else - nBurnPitch = width * pitch_size; - - unsigned rotation; - switch (drv_flags & (BDF_ORIENTATION_FLIPPED | BDF_ORIENTATION_VERTICAL)) - { - case BDF_ORIENTATION_VERTICAL: - rotation = 1; - break; - - case BDF_ORIENTATION_FLIPPED: - rotation = 2; - break; - - case BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED: - rotation = 3; - break; - - default: - rotation = 0; - } - - if( - (strcmp("gunbird2", game_zip_name) == 0) || - (strcmp("s1945ii", game_zip_name) == 0) || - (strcmp("s1945iii", game_zip_name) == 0) || - (strcmp("dragnblz", game_zip_name) == 0) || - (strcmp("gnbarich", game_zip_name) == 0) || - (strcmp("mjgtaste", game_zip_name) == 0) || - (strcmp("tgm2", game_zip_name) == 0) || - (strcmp("tgm2p", game_zip_name) == 0) || - (strcmp("soldivid", game_zip_name) == 0) || - (strcmp("daraku", game_zip_name) == 0) || - (strcmp("sbomber", game_zip_name) == 0) || - (strcmp("sbombera", game_zip_name) == 0) - - ) - { - nBurnBpp = 4; - } - fprintf(stderr, "Game: %s\n", game_zip_name); - - environ_cb(RETRO_ENVIRONMENT_SET_ROTATION, &rotation); - - VidRecalcPal(); - -#ifdef FRONTEND_SUPPORTS_RGB565 - if(nBurnBpp == 4) - { - enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888; - - if(environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) - fprintf(stderr, "Frontend supports XRGB888 - will use that instead of XRGB1555.\n"); - } - else - { - enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565; - - if(environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) - fprintf(stderr, "Frontend supports RGB565 - will use that instead of XRGB1555.\n"); - } -#endif - - return true; -} - -#if defined(FRONTEND_SUPPORTS_RGB565) -static unsigned int HighCol16(int r, int g, int b, int /* i */) -{ - return (((r << 8) & 0xf800) | ((g << 3) & 0x07e0) | ((b >> 3) & 0x001f)); -} -#else -static unsigned int HighCol15(int r, int g, int b, int /* i */) -{ - return (((r << 7) & 0x7c00) | ((g << 2) & 0x03e0) | ((b >> 3) & 0x001f)); -} -#endif - - -static void init_video() -{ -} - -static void extract_basename(char *buf, const char *path, size_t size) -{ - const char *base = strrchr(path, '/'); - if (!base) - base = strrchr(path, '\\'); - if (!base) - base = path; - - if (*base == '\\' || *base == '/') - base++; - - strncpy(buf, base, size - 1); - buf[size - 1] = '\0'; - - char *ext = strrchr(buf, '.'); - if (ext) - *ext = '\0'; -} - -static void extract_directory(char *buf, const char *path, size_t size) -{ - strncpy(buf, path, size - 1); - buf[size - 1] = '\0'; - - char *base = strrchr(buf, '/'); - if (!base) - base = strrchr(buf, '\\'); - - if (base) - *base = '\0'; - else - buf[0] = '\0'; -} - -bool analog_controls_enabled = false; - -bool retro_load_game(const struct retro_game_info *info) -{ - bool retval = false; - char basename[128]; - extract_basename(basename, info->path, sizeof(basename)); - extract_directory(g_rom_dir, info->path, sizeof(g_rom_dir)); - - unsigned i = BurnDrvGetIndexByName(basename); - if (i < nBurnDrvCount) - { - pBurnSoundOut = g_audio_buf; - nBurnSoundRate = AUDIO_SAMPLERATE; - nBurnSoundLen = AUDIO_SEGMENT_LENGTH; - - if (!fba_init(i, basename)) - return false; - - driver_inited = true; - analog_controls_enabled = init_input(); - - retval = true; - } - else - fprintf(stderr, "[FBA] Cannot find driver.\n"); - - - return retval; -} - -bool retro_load_game_special(unsigned, const struct retro_game_info*, size_t) { return false; } - -void retro_unload_game(void) {} - -unsigned retro_get_region() { return RETRO_REGION_NTSC; } - -void *retro_get_memory_data(unsigned) { return 0; } -size_t retro_get_memory_size(unsigned) { return 0; } - -unsigned retro_api_version() { return RETRO_API_VERSION; } - -void retro_set_controller_port_device(unsigned, unsigned) {} - -// Input stuff. - -// Ref GamcPlayer() in ../gamc.cpp -struct key_map -{ - const char *bii_name; - unsigned nCode[2]; -}; -static uint8_t keybinds[0x5000][2]; - -//#define BIND_MAP_COUNT 151 -#define BIND_MAP_COUNT 149 - -#define RETRO_DEVICE_ID_JOYPAD_RESET 16 -#define RETRO_DEVICE_ID_JOYPAD_SERVICE 17 -#define RETRO_DEVICE_ID_JOYPAD_DIAGNOSTIC 18 -#define RETRO_DEVICE_ID_JOYPAD_DIP_A 19 -#define RETRO_DEVICE_ID_JOYPAD_DIP_B 20 -#define RETRO_DEVICE_ID_JOYPAD_TEST 21 - -static const char *print_label(unsigned i) -{ - switch(i) - { - case RETRO_DEVICE_ID_JOYPAD_B: - return "RetroPad Button B"; - case RETRO_DEVICE_ID_JOYPAD_Y: - return "RetroPad Button Y"; - case RETRO_DEVICE_ID_JOYPAD_SELECT: - return "RetroPad Button Select"; - case RETRO_DEVICE_ID_JOYPAD_START: - return "RetroPad Button Start"; - case RETRO_DEVICE_ID_JOYPAD_UP: - return "RetroPad D-Pad Up"; - case RETRO_DEVICE_ID_JOYPAD_DOWN: - return "RetroPad D-Pad Down"; - case RETRO_DEVICE_ID_JOYPAD_LEFT: - return "RetroPad D-Pad Left"; - case RETRO_DEVICE_ID_JOYPAD_RIGHT: - return "RetroPad D-Pad Right"; - case RETRO_DEVICE_ID_JOYPAD_A: - return "RetroPad Button A"; - case RETRO_DEVICE_ID_JOYPAD_X: - return "RetroPad Button X"; - case RETRO_DEVICE_ID_JOYPAD_L: - return "RetroPad Button L"; - case RETRO_DEVICE_ID_JOYPAD_R: - return "RetroPad Button R"; - case RETRO_DEVICE_ID_JOYPAD_L2: - return "RetroPad Button L2"; - case RETRO_DEVICE_ID_JOYPAD_R2: - return "RetroPad Button R2"; - case RETRO_DEVICE_ID_JOYPAD_L3: - return "RetroPad Button L3"; - case RETRO_DEVICE_ID_JOYPAD_R3: - return "RetroPad Button R3"; - case RETRO_DEVICE_ID_JOYPAD_RESET: - return "RetroPad Reset"; - case RETRO_DEVICE_ID_JOYPAD_SERVICE: - return "RetroPad Service"; - case RETRO_DEVICE_ID_JOYPAD_DIAGNOSTIC: - return "RetroPad Diagnostic"; - case RETRO_DEVICE_ID_JOYPAD_DIP_A: - return "RetroPad DIP A"; - case RETRO_DEVICE_ID_JOYPAD_DIP_B: - return "RetroPad DIP B"; - case RETRO_DEVICE_ID_JOYPAD_TEST: - return "RetroPad Test"; - default: - return "No known label"; - } -} - -static bool init_input() -{ - GameInpInit(); - GameInpDefault(); - - bool has_analog = false; - struct GameInp* pgi = GameInp; - for (unsigned i = 0; i < nGameInpCount; i++, pgi++) - { - if (pgi->nType == BIT_ANALOG_REL) - { - has_analog = true; - break; - } - } - - //needed for Neo Geo button mappings (and other drivers in future) - const char * parentrom = BurnDrvGetTextA(DRV_PARENT); - const char * boardrom = BurnDrvGetTextA(DRV_BOARDROM); - const char * drvname = BurnDrvGetTextA(DRV_NAME); - INT32 genre = BurnDrvGetGenreFlags(); - INT32 hardware = BurnDrvGetHardwareCode(); - - fprintf(stderr, "has_analog: %d\n", has_analog); - fprintf(stderr, "parentrom: %s\n", parentrom); - fprintf(stderr, "boardrom: %s\n", boardrom); - fprintf(stderr, "drvname: %s\n", drvname); - fprintf(stderr, "genre: %d\n", genre); - fprintf(stderr, "hardware: %d\n", hardware); - - /* initialization */ - struct BurnInputInfo bii; - memset(&bii, 0, sizeof(bii)); - - // Bind to nothing. - for (unsigned i = 0; i < 0x5000; i++) - keybinds[i][0] = 0xff; - - pgi = GameInp; - - key_map bind_map[BIND_MAP_COUNT]; - - bind_map[0].bii_name = "P1 Coin"; - bind_map[0].nCode[0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - bind_map[0].nCode[1] = 0; - - bind_map[1].bii_name = "P1 Start"; - bind_map[1].nCode[0] = RETRO_DEVICE_ID_JOYPAD_START; - bind_map[1].nCode[1] = 0; - - bind_map[2].bii_name = "Start 1"; - bind_map[2].nCode[0] = RETRO_DEVICE_ID_JOYPAD_START; - bind_map[2].nCode[1] = 0; - - bind_map[3].bii_name = "P1 Up"; - bind_map[3].nCode[0] = RETRO_DEVICE_ID_JOYPAD_UP; - bind_map[3].nCode[1] = 0; - - bind_map[4].bii_name = "P1 Down"; - bind_map[4].nCode[0] = RETRO_DEVICE_ID_JOYPAD_DOWN; - bind_map[4].nCode[1] = 0; - - bind_map[5].bii_name = "P1 Left"; - bind_map[5].nCode[0] = RETRO_DEVICE_ID_JOYPAD_LEFT; - bind_map[5].nCode[1] = 0; - - bind_map[6].bii_name = "P1 Right"; - bind_map[6].nCode[0] = RETRO_DEVICE_ID_JOYPAD_RIGHT; - bind_map[6].nCode[1] = 0; - - bind_map[7].bii_name = "P1 Attack"; - bind_map[7].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[7].nCode[1] = 0; - - bind_map[8].bii_name = "Accelerate"; - bind_map[8].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[8].nCode[1] = 0; - - bind_map[9].bii_name = "Brake"; - bind_map[9].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[9].nCode[1] = 0; - - bind_map[10].bii_name = "Gear"; - bind_map[10].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[10].nCode[1] = 0; - - /* for Forgotten Worlds, etc */ - bind_map[11].bii_name = "P1 Turn"; - bind_map[11].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[11].nCode[1] = 0; - - bind_map[12].bii_name = "P1 Jump"; - bind_map[12].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[12].nCode[1] = 0; - - bind_map[13].bii_name = "P1 Pin"; - bind_map[13].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[13].nCode[1] = 0; - - bind_map[14].bii_name = "P1 Select"; - bind_map[14].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[14].nCode[1] = 0; - - bind_map[15].bii_name = "P1 Use"; - bind_map[15].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[15].nCode[1] = 0; - - bind_map[16].bii_name = "P1 Weak Punch"; - bind_map[16].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[16].nCode[1] = 0; - - bind_map[17].bii_name = "P1 Medium Punch"; - bind_map[17].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[17].nCode[1] = 0; - - bind_map[18].bii_name = "P1 Strong Punch"; - bind_map[18].nCode[0] = RETRO_DEVICE_ID_JOYPAD_L; - bind_map[18].nCode[1] = 0; - - bind_map[19].bii_name = "P1 Weak Kick"; - bind_map[19].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[19].nCode[1] = 0; - - bind_map[20].bii_name = "P1 Medium Kick"; - bind_map[20].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[20].nCode[1] = 0; - - bind_map[21].bii_name = "P1 Strong Kick"; - bind_map[21].nCode[0] = RETRO_DEVICE_ID_JOYPAD_R; - bind_map[21].nCode[1] = 0; - - bind_map[22].bii_name = "P1 Rotate Left"; - bind_map[22].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[22].nCode[1] = 0; - - bind_map[23].bii_name = "P1 Rotate Right"; - bind_map[23].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[23].nCode[1] = 0; - - bind_map[24].bii_name = "P1 Punch"; - bind_map[24].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[24].nCode[1] = 0; - - bind_map[25].bii_name = "P1 Kick"; - bind_map[25].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[25].nCode[1] = 0; - - bind_map[26].bii_name = "P1 Special"; - bind_map[26].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[26].nCode[1] = 0; - - bind_map[27].bii_name = "P1 Shot"; - bind_map[27].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[27].nCode[1] = 0; - - bind_map[28].bii_name = "P1 Shot (auto)"; - bind_map[28].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[28].nCode[1] = 0; - - /* Simpsons - Konami */ - bind_map[29].bii_name = "P1 Button 1"; - bind_map[29].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[29].nCode[1] = 0; - - /* Simpsons - Konami */ - bind_map[30].bii_name = "P1 Button 2"; - bind_map[30].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[30].nCode[1] = 0; - - bind_map[31].bii_name = "P1 Button 3"; - bind_map[31].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[31].nCode[1] = 0; - - bind_map[32].bii_name = "P1 Button 4"; - bind_map[32].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[32].nCode[1] = 0; - - /* Progear */ - bind_map[33].bii_name = "P1 Auto"; - bind_map[33].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[33].nCode[1] = 0; - - /* Punisher */ - bind_map[34].bii_name = "P1 Super"; - bind_map[34].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[34].nCode[1] = 0; - - bind_map[35].bii_name = "P1 Answer 1"; - bind_map[35].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[35].nCode[1] = 0; - - bind_map[36].bii_name = "P1 Answer 2"; - bind_map[36].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[36].nCode[1] = 0; - - bind_map[37].bii_name = "P1 Answer 3"; - bind_map[37].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[37].nCode[1] = 0; - - bind_map[38].bii_name = "P1 Answer 4"; - bind_map[38].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[38].nCode[1] = 0; - - bind_map[39].bii_name = "P1 Shot 1"; - bind_map[39].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[39].nCode[1] = 0; - - /* Pang 3 */ - bind_map[40].bii_name = "P1 Shot 1"; - bind_map[40].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[40].nCode[1] = 0; - - /* Pang 3 */ - bind_map[41].bii_name = "P1 Shot 2"; - bind_map[41].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[41].nCode[1] = 0; - - bind_map[42].bii_name = "P1 Bomb"; - bind_map[42].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[42].nCode[1] = 0; - - bind_map[43].bii_name = "P1 Special"; - bind_map[43].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[43].nCode[1] = 0; - - /* for Ghouls 'n Ghosts */ - bind_map[44].bii_name = "P1 Fire"; - bind_map[44].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[44].nCode[1] = 0; - - /* TMNT */ - bind_map[45].bii_name = "P1 Fire 1"; - bind_map[45].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[45].nCode[1] = 0; - - /* Space Harrier */ - bind_map[46].bii_name = "Fire 1"; - bind_map[46].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[46].nCode[1] = 0; - - /* Space Harrier */ - bind_map[47].bii_name = "Fire 2"; - bind_map[47].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[47].nCode[1] = 0; - - /* Space Harrier */ - bind_map[48].bii_name = "Fire 3"; - bind_map[48].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[48].nCode[1] = 0; - - /* TMNT */ - bind_map[49].bii_name = "P1 Fire 2"; - bind_map[49].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[49].nCode[1] = 0; - - /* Strider */ - bind_map[50].bii_name = "P1 Fire 3"; - bind_map[50].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[50].nCode[1] = 0; - - /* Strider */ - bind_map[51].bii_name = "Coin 1"; - bind_map[51].nCode[0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - bind_map[51].nCode[1] = 0; - - /* Neo Geo */ - bind_map[52].bii_name = "P1 Button A"; - bind_map[52].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[52].nCode[1] = 0; - - /* Neo Geo */ - bind_map[53].bii_name = "P1 Button B"; - bind_map[53].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[53].nCode[1] = 0; - - /* Neo Geo */ - bind_map[54].bii_name = "P1 Button C"; - bind_map[54].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[54].nCode[1] = 0; - - /* Neo Geo */ - bind_map[55].bii_name = "P1 Button D"; - bind_map[55].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[55].nCode[1] = 0; - - bind_map[56].bii_name = "P2 Coin"; - bind_map[56].nCode[0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - bind_map[56].nCode[1] = 1; - - bind_map[57].bii_name = "P2 Start"; - bind_map[57].nCode[0] = RETRO_DEVICE_ID_JOYPAD_START; - bind_map[57].nCode[1] = 1; - - bind_map[58].bii_name = "P2 Up"; - bind_map[58].nCode[0] = RETRO_DEVICE_ID_JOYPAD_UP; - bind_map[58].nCode[1] = 1; - - bind_map[59].bii_name = "P2 Down"; - bind_map[59].nCode[0] = RETRO_DEVICE_ID_JOYPAD_DOWN; - bind_map[59].nCode[1] = 1; - - bind_map[60].bii_name = "P2 Left"; - bind_map[60].nCode[0] = RETRO_DEVICE_ID_JOYPAD_LEFT; - bind_map[60].nCode[1] = 1; - - bind_map[61].bii_name = "P2 Right"; - bind_map[61].nCode[0] = RETRO_DEVICE_ID_JOYPAD_RIGHT; - bind_map[61].nCode[1] = 1; - - bind_map[62].bii_name = "P2 Attack"; - bind_map[62].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[62].nCode[1] = 1; - - // for Forgotten Worlds, etc. - bind_map[63].bii_name = "P2 Turn"; - bind_map[63].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[63].nCode[1] = 1; - - bind_map[64].bii_name = "P2 Jump"; - bind_map[64].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[64].nCode[1] = 1; - - bind_map[65].bii_name = "P2 Pin"; - bind_map[65].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[65].nCode[1] = 1; - - bind_map[66].bii_name = "P2 Select"; - bind_map[66].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[66].nCode[1] = 1; - - bind_map[67].bii_name = "P2 Use"; - bind_map[67].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[67].nCode[1] = 1; - - bind_map[68].bii_name = "P2 Weak Punch"; - bind_map[68].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[68].nCode[1] = 1; - - bind_map[69].bii_name = "P2 Medium Punch"; - bind_map[69].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[69].nCode[1] = 1; - - bind_map[70].bii_name = "P2 Strong Punch"; - bind_map[70].nCode[0] = RETRO_DEVICE_ID_JOYPAD_L; - bind_map[70].nCode[1] = 1; - - bind_map[71].bii_name = "P2 Weak Kick"; - bind_map[71].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[71].nCode[1] = 1; - - bind_map[72].bii_name = "P2 Medium Kick"; - bind_map[72].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[72].nCode[1] = 1; - - bind_map[73].bii_name = "P2 Strong Kick"; - bind_map[73].nCode[0] = RETRO_DEVICE_ID_JOYPAD_R; - bind_map[73].nCode[1] = 1; - - bind_map[74].bii_name = "P2 Rotate Left"; - bind_map[74].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[74].nCode[1] = 1; - - bind_map[75].bii_name = "P2 Rotate Right"; - bind_map[75].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[75].nCode[1] = 1; - - bind_map[76].bii_name = "P2 Punch"; - bind_map[76].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[76].nCode[1] = 1; - - bind_map[77].bii_name = "P2 Kick"; - bind_map[77].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[77].nCode[1] = 1; - - bind_map[78].bii_name = "P2 Special"; - bind_map[78].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[78].nCode[1] = 1; - - bind_map[79].bii_name = "P2 Shot"; - bind_map[79].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[79].nCode[1] = 1; - - /* Simpsons - Konami */ - bind_map[80].bii_name = "P2 Button 1"; - bind_map[80].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[80].nCode[1] = 1; - - bind_map[81].bii_name = "P2 Button 2"; - bind_map[81].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[81].nCode[1] = 1; - - /* Various */ - bind_map[82].bii_name = "P2 Button 3"; - bind_map[82].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[82].nCode[1] = 1; - - bind_map[83].bii_name = "P2 Button 4"; - bind_map[83].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[83].nCode[1] = 1; - - /* Progear */ - bind_map[84].bii_name = "P2 Auto"; - bind_map[84].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[84].nCode[1] = 1; - - bind_map[85].bii_name = "P2 Shot (auto)"; - bind_map[85].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[85].nCode[1] = 1; - - /* Punisher */ - bind_map[86].bii_name = "P2 Super"; - bind_map[86].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[86].nCode[1] = 1; - - bind_map[87].bii_name = "P2 Answer 1"; - bind_map[87].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[87].nCode[1] = 1; - - bind_map[88].bii_name = "P2 Answer 2"; - bind_map[88].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[88].nCode[1] = 1; - - bind_map[89].bii_name = "P2 Answer 3"; - bind_map[89].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[89].nCode[1] = 1; - - bind_map[90].bii_name = "P2 Answer 4"; - bind_map[90].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[90].nCode[1] = 1; - - /* Pang 3 */ - bind_map[91].bii_name = "P2 Shot 1"; - bind_map[91].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[91].nCode[1] = 1; - - bind_map[92].bii_name = "P2 Shot 2"; - bind_map[92].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[92].nCode[1] = 1; - - bind_map[93].bii_name = "P2 Bomb"; - bind_map[93].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[93].nCode[1] = 1; - - bind_map[94].bii_name = "P2 Special"; - bind_map[94].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[94].nCode[1] = 1; - - /* Ghouls 'n Ghosts */ - bind_map[95].bii_name = "P2 Fire"; - bind_map[95].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[95].nCode[1] = 1; - - /* TMNT */ - bind_map[96].bii_name = "P2 Fire 1"; - bind_map[96].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[96].nCode[1] = 1; - - bind_map[97].bii_name = "P2 Fire 2"; - bind_map[97].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[97].nCode[1] = 1; - - /* Strider */ - bind_map[98].bii_name = "P2 Fire 3"; - bind_map[98].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[98].nCode[1] = 1; - - bind_map[99].bii_name = "Coin 2"; - bind_map[99].nCode[0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - bind_map[99].nCode[1] = 1; - - /* Neo Geo */ - bind_map[100].bii_name = "P2 Button A"; - bind_map[100].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[100].nCode[1] = 1; - - bind_map[101].bii_name = "P2 Button B"; - bind_map[101].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[101].nCode[1] = 1; - - bind_map[102].bii_name = "P2 Button C"; - bind_map[102].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[102].nCode[1] = 1; - - bind_map[103].bii_name = "P2 Button D"; - bind_map[103].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[103].nCode[1] = 1; - - bind_map[104].bii_name = "P3 Coin"; - bind_map[104].nCode[0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - bind_map[104].nCode[1] = 2; - - bind_map[105].bii_name = "P3 Start"; - bind_map[105].nCode[0] = RETRO_DEVICE_ID_JOYPAD_START; - bind_map[105].nCode[1] = 2; - - bind_map[106].bii_name = "P3 Up"; - bind_map[106].nCode[0] = RETRO_DEVICE_ID_JOYPAD_UP; - bind_map[106].nCode[1] = 2; - - bind_map[107].bii_name = "P3 Down"; - bind_map[107].nCode[0] = RETRO_DEVICE_ID_JOYPAD_DOWN; - bind_map[107].nCode[1] = 2; - - bind_map[108].bii_name = "P3 Left"; - bind_map[108].nCode[0] = RETRO_DEVICE_ID_JOYPAD_LEFT; - bind_map[108].nCode[1] = 2; - - bind_map[109].bii_name = "P3 Right"; - bind_map[109].nCode[0] = RETRO_DEVICE_ID_JOYPAD_RIGHT; - bind_map[109].nCode[1] = 2; - - bind_map[110].bii_name = "P3 Attack"; - bind_map[110].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[110].nCode[1] = 2; - - bind_map[111].bii_name = "P3 Jump"; - bind_map[111].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[111].nCode[1] = 2; - - bind_map[112].bii_name = "P3 Pin"; - bind_map[112].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[112].nCode[1] = 2; - - bind_map[113].bii_name = "P3 Select"; - bind_map[113].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[113].nCode[1] = 2; - - bind_map[114].bii_name = "P3 Use"; - bind_map[114].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[114].nCode[1] = 2; - - /* Simpsons - Konami */ - bind_map[115].bii_name = "P3 Button 1"; - bind_map[115].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[115].nCode[1] = 2; - - bind_map[116].bii_name = "P3 Button 2"; - bind_map[116].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[116].nCode[1] = 2; - - bind_map[117].bii_name = "P3 Button 3"; - bind_map[117].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[117].nCode[1] = 2; - - bind_map[118].bii_name = "P3 Button 4"; - bind_map[118].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[118].nCode[1] = 2; - - /* TMNT */ - bind_map[119].bii_name = "P3 Fire 1"; - bind_map[119].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[119].nCode[1] = 2; - - bind_map[120].bii_name = "P3 Fire 2"; - bind_map[120].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[120].nCode[1] = 2; - - /* Strider */ - bind_map[121].bii_name = "P3 Fire 3"; - bind_map[121].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[121].nCode[1] = 2; - - bind_map[122].bii_name = "Coin 3"; - bind_map[122].nCode[0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - bind_map[122].nCode[1] = 2; - - bind_map[123].bii_name = "P4 Coin"; - bind_map[123].nCode[0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - bind_map[123].nCode[1] = 3; - - bind_map[124].bii_name = "P4 Start"; - bind_map[124].nCode[0] = RETRO_DEVICE_ID_JOYPAD_START; - bind_map[124].nCode[1] = 3; - - bind_map[125].bii_name = "P4 Up"; - bind_map[125].nCode[0] = RETRO_DEVICE_ID_JOYPAD_UP; - bind_map[125].nCode[1] = 3; - - bind_map[126].bii_name = "P4 Down"; - bind_map[126].nCode[0] = RETRO_DEVICE_ID_JOYPAD_DOWN; - bind_map[126].nCode[1] = 3; - - bind_map[127].bii_name = "P4 Left"; - bind_map[127].nCode[0] = RETRO_DEVICE_ID_JOYPAD_LEFT; - bind_map[127].nCode[1] = 3; - - bind_map[128].bii_name = "P4 Right"; - bind_map[128].nCode[0] = RETRO_DEVICE_ID_JOYPAD_RIGHT; - bind_map[128].nCode[1] = 3; - - bind_map[129].bii_name = "P4 Attack"; - bind_map[129].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[129].nCode[1] = 3; - - bind_map[130].bii_name = "P4 Jump"; - bind_map[130].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[130].nCode[1] = 3; - - bind_map[131].bii_name = "P4 Pin"; - bind_map[131].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[131].nCode[1] = 3; - - bind_map[132].bii_name = "P4 Select"; - bind_map[132].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[132].nCode[1] = 3; - - bind_map[133].bii_name = "P4 Use"; - bind_map[133].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[133].nCode[1] = 3; - - /* Simpsons */ - bind_map[134].bii_name = "P4 Button 1"; - bind_map[134].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[134].nCode[1] = 3; - - bind_map[135].bii_name = "P4 Button 2"; - bind_map[135].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[135].nCode[1] = 3; - - bind_map[136].bii_name = "P4 Button 3"; - bind_map[136].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[136].nCode[1] = 3; - - bind_map[137].bii_name = "P4 Button 4"; - bind_map[137].nCode[0] = RETRO_DEVICE_ID_JOYPAD_X; - bind_map[137].nCode[1] = 3; - - /* TMNT */ - bind_map[138].bii_name = "P4 Fire 1"; - bind_map[138].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[138].nCode[1] = 3; - - bind_map[139].bii_name = "P4 Fire 2"; - bind_map[139].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[139].nCode[1] = 3; - - bind_map[140].bii_name = "P4 Fire 3"; - bind_map[140].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[140].nCode[1] = 3; - - bind_map[141].bii_name = "Coin 4"; - bind_map[141].nCode[0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - bind_map[141].nCode[1] = 3; - - bind_map[142].bii_name = "Missile"; - bind_map[142].nCode[0] = RETRO_DEVICE_ID_JOYPAD_A; - bind_map[142].nCode[1] = 3; - - /* Afterburner */ - bind_map[143].bii_name = "Vulcan"; - bind_map[143].nCode[0] = RETRO_DEVICE_ID_JOYPAD_B; - bind_map[143].nCode[1] = 3; - - bind_map[144].bii_name = "Throttle"; - bind_map[144].nCode[0] = RETRO_DEVICE_ID_JOYPAD_Y; - bind_map[144].nCode[1] = 3; - - bind_map[145].bii_name = "Reset"; - bind_map[145].nCode[0] = RETRO_DEVICE_ID_JOYPAD_RESET; - bind_map[145].nCode[1] = 0; - - bind_map[146].bii_name = "Service"; - bind_map[146].nCode[0] = RETRO_DEVICE_ID_JOYPAD_SERVICE; - bind_map[146].nCode[1] = 0; - - bind_map[147].bii_name = "Diagnostic"; - bind_map[147].nCode[0] = RETRO_DEVICE_ID_JOYPAD_DIAGNOSTIC; - bind_map[147].nCode[1] = 0; - - bind_map[148].bii_name = "Test"; - bind_map[148].nCode[0] = RETRO_DEVICE_ID_JOYPAD_TEST; - bind_map[148].nCode[1] = 0; - - for(unsigned int i = 0; i < nGameInpCount; i++, pgi++) - { - /* TODO: Cyberbots: Full Metal Madness */ - /* TODO: Armored Warriors */ - BurnDrvGetInputInfo(&bii, i); - - bool value_found = false; - for(int j = 0; j < BIND_MAP_COUNT; j++) - { - if((strcmp(bii.szName,"P1 Select") ==0) && (boardrom && (strcmp(boardrom,"neogeo") == 0))) - { - keybinds[pgi->Input.Switch.nCode][0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - keybinds[pgi->Input.Switch.nCode][1] = 0; - value_found = true; - } - else if((strcmp(bii.szName,"P1 Shot") ==0) && (parentrom && strcmp(parentrom,"avsp") == 0 || strcmp(drvname,"avsp") == 0)) - { - keybinds[pgi->Input.Switch.nCode][0] = RETRO_DEVICE_ID_JOYPAD_A; - keybinds[pgi->Input.Switch.nCode][1] = 0; - value_found = true; - } - else if((strcmp(bii.szName,"P2 Select") ==0) && (boardrom && (strcmp(boardrom,"neogeo") == 0))) - { - keybinds[pgi->Input.Switch.nCode][0] = RETRO_DEVICE_ID_JOYPAD_SELECT; - keybinds[pgi->Input.Switch.nCode][1] = 1; - value_found = true; - } - else if((parentrom && strcmp(parentrom,"avsp") == 0 || strcmp(drvname,"avsp") == 0) && (strcmp(bii.szName,"P2 Shot") ==0)) - { - keybinds[pgi->Input.Switch.nCode][0] = RETRO_DEVICE_ID_JOYPAD_A; - keybinds[pgi->Input.Switch.nCode][1] = 1; - value_found = true; - } - else if(strcmp(bii.szName, bind_map[j].bii_name) == 0) - { - keybinds[pgi->Input.Switch.nCode][0] = bind_map[j].nCode[0]; - keybinds[pgi->Input.Switch.nCode][1] = bind_map[j].nCode[1]; - value_found = true; - } - else - value_found = false; - - if(value_found) - { - fprintf(stderr, "%s - assigned to key: %s, port: %d.\n", bii.szName, print_label(keybinds[pgi->Input.Switch.nCode][0]),keybinds[pgi->Input.Switch.nCode][1]); - break; - } - } - - if(!value_found) - fprintf(stderr, "WARNING! Button unaccounted for: [%s].\n", bii.szName); - } - - return has_analog; -} - -//#define DEBUG_INPUT -// - -static inline int CinpJoyAxis(int i, int axis) -{ - switch(axis) - { - case 0: - return input_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, - RETRO_DEVICE_ID_ANALOG_X); - case 1: - return input_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, - RETRO_DEVICE_ID_ANALOG_Y); - case 2: - return 0; - case 3: - return input_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, - RETRO_DEVICE_ID_ANALOG_X); - case 4: - return input_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, - RETRO_DEVICE_ID_ANALOG_Y); - case 5: - return 0; - case 6: - return 0; - case 7: - return 0; - } - return 0; -} - -static inline int CinpMouseAxis(int i, int axis) -{ - return 0; -} - -static inline int CinpState(int i) -{ - return keybinds[i][0]; -} - -static void poll_input(void) -{ - poll_cb(); - - struct GameInp* pgi = GameInp; - unsigned controller_binds_count = nGameInpCount; - - for (int i = 0; i < controller_binds_count; i++, pgi++) - { - int nAdd = 0; - - if ((pgi->nInput & GIT_GROUP_SLIDER) == 0) // not a slider - continue; - - if (pgi->nInput == GIT_KEYSLIDER) - { - // Get states of the two keys - if (input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT)) - nAdd -= 0x100; - if (input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT)) - nAdd += 0x100; - } - - // nAdd is now -0x100 to +0x100 - - // Change to slider speed - nAdd *= pgi->Input.Slider.nSliderSpeed; - nAdd /= 0x100; - - if (pgi->Input.Slider.nSliderCenter) - { // Attact to center - int v = pgi->Input.Slider.nSliderValue - 0x8000; - v *= (pgi->Input.Slider.nSliderCenter - 1); - v /= pgi->Input.Slider.nSliderCenter; - v += 0x8000; - pgi->Input.Slider.nSliderValue = v; - } - - pgi->Input.Slider.nSliderValue += nAdd; - // Limit slider - if (pgi->Input.Slider.nSliderValue < 0x0100) - pgi->Input.Slider.nSliderValue = 0x0100; - if (pgi->Input.Slider.nSliderValue > 0xFF00) - pgi->Input.Slider.nSliderValue = 0xFF00; - } - - pgi = GameInp; - - for (unsigned i = 0; i < controller_binds_count; i++, pgi++) - { - switch (pgi->nInput) - { - case GIT_CONSTANT: // Constant value - { - pgi->Input.nVal = pgi->Input.Constant.nConst; - *(pgi->Input.pVal) = pgi->Input.nVal; - } - break; - case GIT_SWITCH: - { - // Digital input - INT32 id = keybinds[pgi->Input.Switch.nCode][0]; - unsigned port = keybinds[pgi->Input.Switch.nCode][1]; - - bool state = false; - - if (g_reset || id > 15) - { - if(g_reset && id == RETRO_DEVICE_ID_JOYPAD_RESET) - { - state = true; - id = RETRO_DEVICE_ID_JOYPAD_RESET; - g_reset = false; - } - else - { - bool button_combo_down = - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L2) && - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R2) && - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L) && - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R); - bool service_pressed = ((id == RETRO_DEVICE_ID_JOYPAD_SERVICE) && - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT) - && button_combo_down); - bool diag_pressed = ((id == RETRO_DEVICE_ID_JOYPAD_DIAGNOSTIC) && - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START) - && button_combo_down); - bool reset_pressed = ((id == RETRO_DEVICE_ID_JOYPAD_RESET) && - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT) - && button_combo_down); - bool dip_a_pressed = ((id == RETRO_DEVICE_ID_JOYPAD_DIP_A) && - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT) - && button_combo_down); - bool dip_b_pressed = ((id == RETRO_DEVICE_ID_JOYPAD_DIP_B) && - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP) - && button_combo_down); - bool test_pressed = ((id == RETRO_DEVICE_ID_JOYPAD_TEST) && - input_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN) - && button_combo_down); - - state = diag_pressed || service_pressed || reset_pressed || dip_a_pressed - || dip_b_pressed || test_pressed; - } - - Reinitialise(); - } - else - state = input_cb(port, RETRO_DEVICE_JOYPAD, 0, id); - - //fprintf(stderr, "GIT_SWITCH: %s, port: %d, pressed: %d.\n", print_label(id), port, state); - - if (pgi->nType & BIT_GROUP_ANALOG) - { - // Set analog controls to full - if (state) - pgi->Input.nVal = 0xFFFF; - else - pgi->Input.nVal = 0x0001; -#ifdef LSB_FIRST - *(pgi->Input.pShortVal) = pgi->Input.nVal; -#else - *((int *)pgi->Input.pShortVal) = pgi->Input.nVal; -#endif - } - else - { - // Binary controls - if (state) - pgi->Input.nVal = 1; - else - pgi->Input.nVal = 0; - *(pgi->Input.pVal) = pgi->Input.nVal; - } - break; - } - case GIT_KEYSLIDER: // Keyboard slider - //fprintf(stderr, "GIT_JOYSLIDER\n"); - { - int nSlider = pgi->Input.Slider.nSliderValue; - if (pgi->nType == BIT_ANALOG_REL) { - nSlider -= 0x8000; - nSlider >>= 4; - } - - pgi->Input.nVal = (unsigned short)nSlider; -#ifdef LSB_FIRST - *(pgi->Input.pShortVal) = pgi->Input.nVal; -#else - *((int *)pgi->Input.pShortVal) = pgi->Input.nVal; -#endif - break; - } - case GIT_MOUSEAXIS: // Mouse axis - { - pgi->Input.nVal = (UINT16)(CinpMouseAxis(pgi->Input.MouseAxis.nMouse, pgi->Input.MouseAxis.nAxis) * nAnalogSpeed); -#ifdef LSB_FIRST - *(pgi->Input.pShortVal) = pgi->Input.nVal; -#else - *((int *)pgi->Input.pShortVal) = pgi->Input.nVal; -#endif - } - break; - case GIT_JOYAXIS_FULL: - { // Joystick axis - INT32 nJoy = CinpJoyAxis(pgi->Input.JoyAxis.nJoy, pgi->Input.JoyAxis.nAxis); - - if (pgi->nType == BIT_ANALOG_REL) { - nJoy *= nAnalogSpeed; - nJoy >>= 13; - - // Clip axis to 8 bits - if (nJoy < -32768) { - nJoy = -32768; - } - if (nJoy > 32767) { - nJoy = 32767; - } - } else { - nJoy >>= 1; - nJoy += 0x8000; - - // Clip axis to 16 bits - if (nJoy < 0x0001) { - nJoy = 0x0001; - } - if (nJoy > 0xFFFF) { - nJoy = 0xFFFF; - } - } - - pgi->Input.nVal = (UINT16)nJoy; -#ifdef LSB_FIRST - *(pgi->Input.pShortVal) = pgi->Input.nVal; -#else - *((int *)pgi->Input.pShortVal) = pgi->Input.nVal; -#endif - break; - } - case GIT_JOYAXIS_NEG: - { // Joystick axis Lo - INT32 nJoy = CinpJoyAxis(pgi->Input.JoyAxis.nJoy, pgi->Input.JoyAxis.nAxis); - if (nJoy < 32767) - { - nJoy = -nJoy; - - if (nJoy < 0x0000) - nJoy = 0x0000; - if (nJoy > 0xFFFF) - nJoy = 0xFFFF; - - pgi->Input.nVal = (UINT16)nJoy; - } - else - pgi->Input.nVal = 0; - -#ifdef LSB_FIRST - *(pgi->Input.pShortVal) = pgi->Input.nVal; -#else - *((int *)pgi->Input.pShortVal) = pgi->Input.nVal; -#endif - break; - } - case GIT_JOYAXIS_POS: - { // Joystick axis Hi - INT32 nJoy = CinpJoyAxis(pgi->Input.JoyAxis.nJoy, pgi->Input.JoyAxis.nAxis); - if (nJoy > 32767) - { - - if (nJoy < 0x0000) - nJoy = 0x0000; - if (nJoy > 0xFFFF) - nJoy = 0xFFFF; - - pgi->Input.nVal = (UINT16)nJoy; - } - else - pgi->Input.nVal = 0; - -#ifdef LSB_FIRST - *(pgi->Input.pShortVal) = pgi->Input.nVal; -#else - *((int *)pgi->Input.pShortVal) = pgi->Input.nVal; -#endif - break; - } - } - } -} - -static unsigned int BurnDrvGetIndexByName(const char* name) -{ - unsigned int ret = ~0U; - for (unsigned int i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - if (strcmp(BurnDrvGetText(DRV_NAME), name) == 0) { - ret = i; - break; - } - } - return ret; -} - -#ifdef ANDROID -#include - -size_t mbstowcs(wchar_t *pwcs, const char *s, size_t n) -{ - if (pwcs == NULL) - return strlen(s); - return mbsrtowcs(pwcs, &s, n, NULL); -} - -size_t wcstombs(char *s, const wchar_t *pwcs, size_t n) -{ - return wcsrtombs(s, &pwcs, n, NULL); -} - -#endif diff --git a/jan/src/burner/libretro/libretro.h b/jan/src/burner/libretro/libretro.h deleted file mode 100644 index 3eef75884..000000000 --- a/jan/src/burner/libretro/libretro.h +++ /dev/null @@ -1,577 +0,0 @@ -#ifndef LIBRETRO_H__ -#define LIBRETRO_H__ - -#include -#include -#include - -// 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 -#endif -#endif - -// Used for checking API/ABI mismatches that can break libretro implementations. -// It is not incremented for compatible changes. -#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 - -// 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 - -// 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 -}; - -// 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. - // -#define RETRO_ENVIRONMENT_GET_VARIABLE 4 // struct retro_variable * -- - // Interface to aquire user-defined information from environment - // that cannot feasibly be supported in a multi-system way. - // Mostly used for obscure, - // specific features that the user can tap into when neseccary. - // -#define RETRO_ENVIRONMENT_SET_VARIABLES 5 // const struct retro_variable * -- - // Allows an implementation to signal the environment - // which variables it might want to check for later using GET_VARIABLE. - // 'data' points to an array of retro_variable structs terminated by a { NULL, NULL } element. - // retro_variable::value should contain a human readable description of the key. - // -#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. - - -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 diff --git a/jan/src/burner/libretro/link.T b/jan/src/burner/libretro/link.T deleted file mode 100644 index b0c262db9..000000000 --- a/jan/src/burner/libretro/link.T +++ /dev/null @@ -1,5 +0,0 @@ -{ - global: retro_*; - local: *; -}; - diff --git a/jan/src/burner/libretro/neocdlist.cpp b/jan/src/burner/libretro/neocdlist.cpp deleted file mode 100644 index 63180fc23..000000000 --- a/jan/src/burner/libretro/neocdlist.cpp +++ /dev/null @@ -1,500 +0,0 @@ -// --------------------------------------------------------------------------------------- -// NeoGeo CD Game Info Module (by CaptainCPS-X) -// --------------------------------------------------------------------------------------- -#include "burner.h" -#include "../neocdlist.h" - -struct NGCDGAME games[] = -{ -// ---------------------------------------------------------------------------------------------------------------------------------------------// -// * Name * Title * Year * Company * Game ID // -// ---------------------------------------------------------------------------------------------------------------------------------------------// - { _T("nam1975") , _T("NAM-1975") , _T("1990") , _T("SNK") , 0x0001 }, // - { _T("bstars") , _T("Baseball Stars Professional") , _T("1991") , _T("SNK") , 0x0002 }, // - { _T("tpgolf") , _T("Top Player's Golf") , _T("1990") , _T("SNK") , 0x0003 }, // - { _T("mahretsu") , _T("Mahjong Kyo Retsuden - Nishi Nihon Hen") , _T("1990") , _T("SNK") , 0x0004 }, // - { _T("maglord") , _T("Magician Lord") , _T("1990") , _T("ADK") , 0x0005 }, // - { _T("ridhero") , _T("Riding Hero") , _T("1991") , _T("SNK") , 0x0006 }, // - { _T("alpham2") , _T("Alpha Mission II / ASO II - Last Guardian") , _T("1994") , _T("SNK") , 0x0007 }, // - { _T("ncombat") , _T("Ninja Combat") , _T("1990") , _T("SNK/ADK") , 0x0009 }, // - { _T("cyberlip") , _T("Cyber-Lip") , _T("1991") , _T("SNK") , 0x0010 }, // - { _T("superspy") , _T("The Super Spy") , _T("1990") , _T("SNK") , 0x0011 }, // - { _T("mutnat") , _T("Mutation Nation") , _T("1995") , _T("SNK") , 0x0014 }, // - { _T("sengoku") , _T("Sengoku / Sengoku Denshou") , _T("1994") , _T("SNK") , 0x0017 }, // - { _T("burningf") , _T("Burning Fight") , _T("1994") , _T("SNK") , 0x0018 }, // - { _T("lbowling") , _T("League Bowling") , _T("1994") , _T("SNK") , 0x0019 }, // - { _T("gpilots") , _T("Ghost Pilots") , _T("1991") , _T("SNK") , 0x0020 }, // - { _T("joyjoy") , _T("Puzzled / Joy Joy Kid") , _T("1990") , _T("SNK") , 0x0021 }, // - { _T("bjourney") , _T("Blue's Journey / Raguy") , _T("1990") , _T("SNK/ADK") , 0x0022 }, // - { _T("lresort") , _T("Last Resort") , _T("1994") , _T("SNK") , 0x0024 }, // - { _T("2020bb") , _T("2020 Super Baseball") , _T("1994") , _T("SNK") , 0x0030 }, // - { _T("socbrawl") , _T("Soccer Brawl") , _T("1991") , _T("SNK") , 0x0031 }, // - { _T("roboarmy") , _T("Robo Army") , _T("1991") , _T("SNK") , 0x0032 }, // - { _T("fatfury") , _T("Fatal Fury - The Battle of Fury") , _T("1994") , _T("SNK") , 0x0033 }, // - { _T("fbfrenzy") , _T("Football Frenzy") , _T("1994") , _T("SNK") , 0x0034 }, // - { _T("crswords") , _T("Crossed Swords") , _T("1994") , _T("SNK/ADK") , 0x0037 }, // - { _T("rallych") , _T("Rally Chase") , _T("1991") , _T("SNK/ADK") , 0x0038 }, // - { _T("kotm2") , _T("King of the Monsters 2") , _T("1992") , _T("SNK") , 0x0039 }, // - { _T("sengoku2") , _T("Sengoku 2 / Sengoku Denshou 2") , _T("1994") , _T("SNK") , 0x0040 }, // - { _T("bstars2") , _T("Baseball Stars 2") , _T("1992") , _T("SNK") , 0x0041 }, // - { _T("3countb") , _T("3 Count Bout / Fire Suplex") , _T("1995") , _T("SNK") , 0x0043 }, // - { _T("aof") , _T("Art of Fighting / Ryuuko no Ken") , _T("1994") , _T("SNK") , 0x0044 }, // - { _T("samsho") , _T("Samurai Shodown / Samurai Spirits") , _T("1993") , _T("SNK") , 0x0045 }, // - { _T("tophuntr") , _T("Top Hunter - Roddy & Cathy") , _T("1994") , _T("SNK") , 0x0046 }, // - { _T("fatfury2") , _T("Fatal Fury 2 / Garou Densetsu 2 - Aratanaru Tatakai") , _T("1994") , _T("SNK") , 0x0047 }, // - { _T("janshin") , _T("Janshin Densetsu - Quest of the Jongmaster") , _T("1995") , _T("Yubis") , 0x0048 }, // - { _T("ncommand") , _T("Ninja Commando") , _T("1992") , _T("SNK") , 0x0050 }, // - { _T("viewpoin") , _T("Viewpoint") , _T("1992") , _T("Sammy/Aicom") , 0x0051 }, // - { _T("ssideki") , _T("Super Sidekicks / Tokuten Oh") , _T("1993") , _T("SNK") , 0x0052 }, // - { _T("wh1") , _T("World Heroes") , _T("1992") , _T("ADK") , 0x0053 }, // - { _T("crsword2") , _T("Crossed Swords II") , _T("1995") , _T("SNK/ADK") , 0x0054 }, // - { _T("kof94") , _T("The King of Fighters '94 (JP)") , _T("1994") , _T("SNK") , 0x0055 }, // - { _T("kof94ju") , _T("The King of Fighters '94 (JP-US)") , _T("1994") , _T("SNK") , 0x1055 }, // custom id - { _T("aof2") , _T("Art of Fighting 2 / Ryuuko no Ken 2") , _T("1994") , _T("SNK") , 0x0056 }, // - { _T("wh2") , _T("World Heroes 2") , _T("1995") , _T("SNK/ADK") , 0x0057 }, // - { _T("fatfursp") , _T("Fatal Fury Special / Garou Densetsu Special") , _T("1994") , _T("SNK") , 0x0058 }, // - { _T("savagere") , _T("Savage Reign / Fu'un Mokujiroku - Kakutou Sousei") , _T("1995") , _T("SNK") , 0x0059 }, // - { _T("ssideki2") , _T("Super Sidekicks 2 / Tokuten Oh 2") , _T("1994") , _T("SNK") , 0x0061 }, // - { _T("samsho2") , _T("Samurai Shodown 2 / Shin Samurai Spirits") , _T("1994") , _T("SNK") , 0x0063 }, // - { _T("wh2j") , _T("World Heroes 2 Jet") , _T("1995") , _T("SNK/ADK") , 0x0064 }, // - { _T("wjammers") , _T("Windjammers / Flying Power Disc") , _T("1994") , _T("Data East") , 0x0065 }, // - { _T("karnovr") , _T("Karnov's Revenge / Fighters History Dynamite") , _T("1994") , _T("Data East") , 0x0066 }, // - { _T("pspikes2") , _T("Power Spikes II") , _T("1994") , _T("Video System") , 0x0068 }, // - { _T("aodk") , _T("Aggressors of Dark Kombat / Tsuukai GanGan Koushinkyoku") , _T("1994"), _T("SNK/ADK") , 0x0074 }, // - { _T("sonicwi2") , _T("Aero Fighters 2 / Sonic Wings 2") , _T("1994") , _T("Video System") , 0x0075 }, // - { _T("galaxyfg") , _T("Galaxy Fight - Universal Warriors") , _T("1995") , _T("Sunsoft") , 0x0078 }, // - { _T("strhoop") , _T("Street Hoop / Dunk Dream") , _T("1994") , _T("Data East") , 0x0079 }, // - { _T("quizkof") , _T("Quiz King of Fighters") , _T("1993") , _T("SNK/Saurus") , 0x0080 }, // - { _T("ssideki3") , _T("Super Sidekicks 3 - The Next Glory / Tokuten Oh 3 - Eikoue No Chousen"), _T("1995") , _T("SNK") , 0x0081 }, // - { _T("doubledr") , _T("Double Dragon") , _T("1995") , _T("Technos") , 0x0082 }, // - { _T("pbobblen") , _T("Puzzle Bobble / Bust-A-Move") , _T("1994") , _T("SNK") , 0x0083 }, // - { _T("kof95") , _T("The King of Fighters '95 (JP-US)") , _T("1995") , _T("SNK") , 0x0084 }, // - { _T("kof95r1") , _T("The King of Fighters '95 (JP-US)(Rev 1)") , _T("1995") , _T("SNK") , 0x1084 }, // - { _T("ssrpg") , _T("Shinsetsu Samurai Spirits - Bushidohretsuden") , _T("1997") , _T("SNK") , 0x0085 }, // - { _T("samsho3") , _T("Samurai Shodown 3 / Samurai Spirits 3") , _T("1995") , _T("SNK") , 0x0087 }, // - { _T("stakwin") , _T("Stakes Winner - GI Kanzen Seiha Heno Machi") , _T("1995") , _T("Saurus") , 0x0088 }, // - { _T("pulstar") , _T("Pulstar") , _T("1995") , _T("Aicom") , 0x0089 }, // - { _T("whp") , _T("World Heroes Perfect") , _T("1995") , _T("ADK") , 0x0090 }, // - { _T("kabukikl") , _T("Kabuki Klash / Tengai Makyou Shinden - Far East of Eden") , _T("1995"), _T("Hudson") , 0x0092 }, // - { _T("gowcaizr") , _T("Voltage Fighter Gowcaizer / Choujin Gakuen Gowcaizer"), _T("1995") , _T("Technos") , 0x0094 }, // - { _T("rbff1") , _T("Real Bout Fatal Fury") , _T("1995") , _T("SNK") , 0x0095 }, // - { _T("aof3") , _T("Art of Fighting 3: Path of the Warrior") , _T("1996") , _T("SNK") , 0x0096 }, // - { _T("sonicwi3") , _T("Aero Fighters 3 / Sonic Wings 3") , _T("1995") , _T("SNK") , 0x0097 }, // - { _T("fromanc2") , _T("Idol Mahjong Final Romance 2") , _T("1995") , _T("Video Systems") , 0x0098 }, // - { _T("turfmast") , _T("Neo Turf Masters / Big Tournament Golf") , _T("1996") , _T("Nazca") , 0x0200 }, // - { _T("mslug") , _T("Metal Slug - Super Vehicle-001") , _T("1996") , _T("Nazca") , 0x0201 }, // - { _T("mosyougi") , _T("Shougi no Tatsujin - Master of Syougi") , _T("1995") , _T("ADK") , 0x0203 }, // - { _T("adkworld") , _T("ADK World / ADK Special") , _T("1995") , _T("ADK") , 0x0204 }, // - { _T("ngcdsp") , _T("Neo Geo CD Special") , _T("1995") , _T("SNK") , 0x0205 }, // - { _T("zintrick") , _T("Zintrick / Oshidashi Zintrick") , _T("1996") , _T("ADK") , 0x0211 }, // - { _T("overtop") , _T("OverTop") , _T("1996") , _T("ADK") , 0x0212 }, // - { _T("neodrift") , _T("Neo DriftOut") , _T("1996") , _T("Visco") , 0x0213 }, // - { _T("kof96") , _T("The King of Fighters '96") , _T("1996") , _T("SNK") , 0x0214 }, // - { _T("ninjamas") , _T("Ninja Master's - Haou Ninpou-Chou") , _T("1996") , _T("ADK/SNK") , 0x0217 }, // - { _T("ragnagrd") , _T("Ragnagard / Shinouken") , _T("1996") , _T("Saurus") , 0x0218 }, // - { _T("pgoal") , _T("Pleasuregoal - 5 on 5 Mini Soccer / Futsal") , _T("1996") , _T("Saurus") , 0x0219 }, // - { _T("ironclad") , _T("Ironclad / Choutetsu Brikin'ger") , _T("1996") , _T("Saurus") , 0x0220 }, // - { _T("magdrop2") , _T("Magical Drop 2") , _T("1996") , _T("Data East") , 0x0221 }, // - { _T("samsho4") , _T("Samurai Shodown IV - Amakusa's Revenge") , _T("1996") , _T("SNK") , 0x0222 }, // - { _T("rbffspec") , _T("Real Bout Fatal Fury Special") , _T("1996") , _T("SNK") , 0x0223 }, // - { _T("twinspri") , _T("Twinkle Star Sprites") , _T("1996") , _T("ADK") , 0x0224 }, // - { _T("kof96ngc") , _T("The King of Fighters '96 NEOGEO Collection") , _T("1996") , _T("SNK") , 0x0229 }, // - { _T("breakers") , _T("Breakers") , _T("1996") , _T("Visco") , 0x0230 }, // - { _T("kof97") , _T("The King of Fighters '97") , _T("1997") , _T("SNK") , 0x0232 }, // - { _T("lastblad") , _T("The Last Blade / Bakumatsu Roman - Gekka no Kenshi") , _T("1997") , _T("SNK") , 0x0234 }, // - { _T("rbff2") , _T("Real Bout Fatal Fury 2 / Garou Densetsu 2 - Aratanaru Tatakai"), _T("1998"), _T("SNK") , 0x0240 }, // - { _T("mslug2") , _T("Metal Slug 2 - Super Vehicle-001/II") , _T("1998") , _T("SNK") , 0x0241 }, // - { _T("kof98") , _T("The King of Fighters '98 - The Slugfest") , _T("1998") , _T("SNK") , 0x0242 }, // - { _T("lastbld2") , _T("The Last Blade 2") , _T("1998") , _T("SNK") , 0x0243 }, // - { _T("kof99") , _T("The King of Fighters '99 - Millennium Battle") , _T("1999") , _T("SNK") , 0x0251 }, // - { _T("fatfury3") , _T("Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - Harukanaru Tatakai"), _T("1995"), _T("SNK"), 0x069c }, // -}; - -NGCDGAME* GetNeoGeoCDInfo(unsigned int nID) -{ - for(unsigned int nGame = 0; nGame < (sizeof(games) / sizeof(NGCDGAME)); nGame++) { - if(nID == games[nGame].id ) { - return &games[nGame]; - } - } - - return NULL; -} - -NGCDGAME* game; - -// Get the title -int GetNeoCDTitle(unsigned int nGameID) -{ - game = (NGCDGAME*)malloc(sizeof(NGCDGAME)); - memset(game, 0, sizeof(NGCDGAME)); - - if(GetNeoGeoCDInfo(nGameID)) - { - memcpy(game, GetNeoGeoCDInfo(nGameID), sizeof(NGCDGAME)); - return 1; - } - - game = NULL; - return 0; -} - -void iso9660_ReadOffset(unsigned char *Dest, FILE* fp, unsigned int lOffset, unsigned int lSize, unsigned int lLength) -{ - if(fp == NULL) return; - if (Dest == NULL) return; - - fseek(fp, lOffset, SEEK_SET); - fread(Dest, lLength, lSize, fp); -} - -static void NeoCDList_iso9660_CheckDirRecord(FILE* fp, int nSector) -{ - int nSectorLength = 2048; - //int nFile = 0; - unsigned int lBytesRead = 0; - //int nLen = 0; - unsigned int lOffset = 0; - bool bNewSector = false; - bool bRevisionQueve = false; - int nRevisionQueveID = 0; - - lOffset = (nSector * nSectorLength); - - unsigned char* nLenDR = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* Flags = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* ExtentLoc = (unsigned char*)malloc(8 * sizeof(unsigned char)); - unsigned char* Data = (unsigned char*)malloc(0x10b * sizeof(unsigned char)); - unsigned char* LEN_FI = (unsigned char*)malloc(1 * sizeof(unsigned char)); - char *File = (char*)malloc(32 * sizeof(char)); - - while(1) - { - iso9660_ReadOffset(nLenDR, fp, lOffset, 1, sizeof(unsigned char)); - - if(nLenDR[0] == 0x22) { - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - if(nLenDR[0] < 0x22) - { - if(bNewSector) - { - if(bRevisionQueve) { - bRevisionQueve = false; - - GetNeoCDTitle(nRevisionQueveID); - } - return; - } - - nLenDR[0] = 0; - iso9660_ReadOffset(nLenDR, fp, lOffset + 1, 1, sizeof(unsigned char)); - - if(nLenDR[0] < 0x22) { - lOffset += (2048 - lBytesRead); - lBytesRead = 0; - bNewSector = true; - continue; - } - } - - bNewSector = false; - - iso9660_ReadOffset(Flags, fp, lOffset + 25, 1, sizeof(unsigned char)); - - if(!(Flags[0] & (1 << 1))) - { - iso9660_ReadOffset(ExtentLoc, fp, lOffset + 2, 8, sizeof(unsigned char)); - - char szValue[9]; - sprintf(szValue, "%02x%02x%02x%02x", ExtentLoc[4], ExtentLoc[5], ExtentLoc[6], ExtentLoc[7]); - - unsigned int nValue = 0; - sscanf(szValue, "%x", &nValue); - - iso9660_ReadOffset(Data, fp, nValue * 2048, 0x10a, sizeof(unsigned char)); - - char szData[8]; - sprintf(szData, "%c%c%c%c%c%c%c", Data[0x100], Data[0x101], Data[0x102], Data[0x103], Data[0x104], Data[0x105], Data[0x106]); - - if(!strncmp(szData, "NEO-GEO", 7)) - { - char id[] = "0000"; - sprintf(id, "%02X%02X", Data[0x108], Data[0x109]); - - unsigned int nID = 0; - sscanf(id, "%x", &nID); - - iso9660_ReadOffset(LEN_FI, fp, lOffset + 32, 1, sizeof(unsigned char)); - - iso9660_ReadOffset((unsigned char*)File, fp, lOffset + 33, LEN_FI[0], sizeof(char)); - strncpy(File, File, LEN_FI[0]); - File[LEN_FI[0]] = 0; - - // King of Fighters '94, The (1994)(SNK)(JP) - // 10-6-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xDE) { - // ...continue - } - - // King of Fighters '94, The (1994)(SNK)(JP-US) - // 11-21-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xE6) { - // Change to custom revision id - nID = 0x1055; - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B01, B03-B06, NGCD-084E MT B01] - // 9-11-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xC0) { - // ... continue - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B10, NGCD-084E MT B03] - // 10-5-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xFF) { - // Change to custom revision id - nID = 0x1084; - } - - // King of Fighters '96 NEOGEO Collection, The - if(nID == 0x0229) { - bRevisionQueve = false; - - GetNeoCDTitle(nID); - break; - } - - // King of Fighters '96, The - if(nID == 0x0214) { - bRevisionQueve = true; - nRevisionQueveID = nID; - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - GetNeoCDTitle(nID); - - break; - } - } - - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - } - - if (nLenDR) { - free(nLenDR); - nLenDR = NULL; - } - - if (Flags) { - free(Flags); - Flags = NULL; - } - - if (ExtentLoc) { - free(ExtentLoc); - ExtentLoc = NULL; - } - - if (Data) { - free(Data); - Data = NULL; - } - - if (LEN_FI) { - free(LEN_FI); - LEN_FI = NULL; - } - - if (File) { - free(File); - File = NULL; - } -} - -// Check the specified ISO, and proceed accordingly -static int NeoCDList_CheckISO(TCHAR* pszFile) -{ - if(!pszFile) { - // error - return 0; - } - - // Make sure we have a valid ISO file extension... - if(_tcsstr(pszFile, _T(".iso")) || _tcsstr(pszFile, _T(".ISO")) ) - { - FILE* fp = _tfopen(pszFile, _T("rb")); - if(fp) - { - // Read ISO and look for 68K ROM standard program header, ID is always there - // Note: This function works very quick, doesn't compromise performance :) - // it just read each sector first 264 bytes aproximately only. - - // Get ISO Size (bytes) - fseek(fp, 0, SEEK_END); - unsigned int lSize = 0; - lSize = ftell(fp); - //rewind(fp); - fseek(fp, 0, SEEK_SET); - - // If it has at least 16 sectors proceed - if(lSize > (2048 * 16)) - { - // Check for Standard ISO9660 Identifier - unsigned char IsoHeader[2048 * 16 + 1]; - unsigned char IsoCheck[6]; - - fread(IsoHeader, 1, 2048 * 16 + 1, fp); // advance to sector 16 and PVD Field 2 - fread(IsoCheck, 1, 5, fp); // get Standard Identifier Field from PVD - - // Verify that we have indeed a valid ISO9660 MODE1/2048 - if(!memcmp(IsoCheck, "CD001", 5)) - { - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Found. \n")); - iso9660_VDH vdh; - - // Get Volume Descriptor Header - memset(&vdh, 0, sizeof(vdh)); - //memcpy(&vdh, iso9660_ReadOffset(fp, (2048 * 16), sizeof(vdh)), sizeof(vdh)); - iso9660_ReadOffset((unsigned char*)&vdh, fp, 2048 * 16, 1, sizeof(vdh)); - - // Check for a valid Volume Descriptor Type - if(vdh.vdtype == 0x01) - { -#if 0 -// This will fail on 64-bit due to differing variable sizes in the pvd struct - // Get Primary Volume Descriptor - iso9660_PVD pvd; - memset(&pvd, 0, sizeof(pvd)); - //memcpy(&pvd, iso9660_ReadOffset(fp, (2048 * 16), sizeof(pvd)), sizeof(pvd)); - iso9660_ReadOffset((unsigned char*)&pvd, fp, 2048 * 16, 1, sizeof(pvd)); - - // ROOT DIRECTORY RECORD - - // Handle Path Table Location - char szRootSector[32]; - unsigned int nRootSector = 0; - - sprintf(szRootSector, "%02X%02X%02X%02X", - pvd.root_directory_record.location_of_extent[4], - pvd.root_directory_record.location_of_extent[5], - pvd.root_directory_record.location_of_extent[6], - pvd.root_directory_record.location_of_extent[7]); - - // Convert HEX string to Decimal - sscanf(szRootSector, "%X", &nRootSector); -#else -// Just read from the file directly at the correct offset (0x8000 + 0x9e for the start of the root directory record) - unsigned char buffer[8]; - char szRootSector[32]; - unsigned int nRootSector = 0; - - fseek(fp, 0x809e, SEEK_SET); - fread(buffer, 1, 8, fp); - - sprintf(szRootSector, "%02x%02x%02x%02x", buffer[4], buffer[5], buffer[6], buffer[7]); - - sscanf(szRootSector, "%x", &nRootSector); -#endif - - // Process the Root Directory Records - NeoCDList_iso9660_CheckDirRecord(fp, nRootSector); - - // Path Table Records are not processed, since NeoGeo CD should not have subdirectories - // ... - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Not Found, cannot continue. \n")); - return 0; - } - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Couldn't open %s \n"), GetIsoPath()); - return 0; - } - - if(fp) fclose(fp); - - } else { - - //bprintf(PRINT_NORMAL, _T(" File doesn't have a valid ISO extension [ .iso / .ISO ] \n")); - return 0; - } - - return 1; -} - -// This will do everything -int GetNeoGeoCD_Identifier() -{ - if(!GetIsoPath() || !IsNeoGeoCD()) { - return 0; - } - - // Make sure we have a valid ISO file extension... - if(_tcsstr(GetIsoPath(), _T(".iso")) || _tcsstr(GetIsoPath(), _T(".ISO")) ) - { - if(_tfopen(GetIsoPath(), _T("rb"))) - { - // Read ISO and look for 68K ROM standard program header, ID is always there - // Note: This function works very quick, doesn't compromise performance :) - // it just read each sector first 264 bytes aproximately only. - NeoCDList_CheckISO(GetIsoPath()); - - } else { - - bprintf(PRINT_NORMAL, _T(" Couldn't open %s \n"), GetIsoPath()); - return 0; - } - - } else { - - bprintf(PRINT_NORMAL, _T(" File doesn't have a valid ISO extension [ .iso / .ISO ] \n")); - return 0; - } - - return 1; -} - -int NeoCDInfo_Init() -{ - NeoCDInfo_Exit(); - return GetNeoGeoCD_Identifier(); -} - -TCHAR* NeoCDInfo_Text(int nText) -{ - if(!game || !IsNeoGeoCD() || !bDrvOkay) return NULL; - - switch(nText) - { - case DRV_NAME: return game->pszName; - case DRV_FULLNAME: return game->pszTitle; - case DRV_MANUFACTURER: return game->pszCompany; - case DRV_DATE: return game->pszYear; - } - - return NULL; -} - -int NeoCDInfo_ID() -{ - if(!game || !IsNeoGeoCD() || !bDrvOkay) return 0; - return game->id; -} - -void NeoCDInfo_Exit() -{ - if(game) { - free(game); - game = NULL; - } -} diff --git a/jan/src/burner/libretro/net.h b/jan/src/burner/libretro/net.h deleted file mode 100644 index 7839a9653..000000000 --- a/jan/src/burner/libretro/net.h +++ /dev/null @@ -1 +0,0 @@ -// Dummy header as core needs to include this for some reason. diff --git a/jan/src/burner/libretro/tchar.h b/jan/src/burner/libretro/tchar.h deleted file mode 100644 index e3934d58e..000000000 --- a/jan/src/burner/libretro/tchar.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef __PORT_TYPEDEFS_H -#define __PORT_TYPEDEFS_H - -#include -#include - -#include "inp_keys.h" -#define TCHAR char -#define _T(x) x -#define _tfopen fopen -#define _tcstol strtol -#define _tcsstr strstr -#define _istspace(x) isspace(x) -#define _stprintf sprintf -#define _tcslen strlen -#define _tcsicmp(a, b) strcasecmp(a, b) -#define _tcscpy(to, from) strcpy(to, from) -#define _fgetts fgets -#define _strnicmp(s1, s2, n) strncasecmp(s1, s2, n) -#define _tcsncmp strncmp -#define _tcsncpy strncpy -#define _stscanf sscanf -#define _ftprintf fprintf - -#ifdef _MSC_VER -#include -#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n) -#define strcasecmp(x, y) _stricmp(x, y) -#define snprintf _snprintf -#else -#define _stricmp(x, y) strcasecmp(x,y) - -typedef struct { int x, y, width, height; } RECT; -#undef __cdecl -#define __cdecl - -#define bprintf(...) {} -#endif - -#undef __fastcall -#undef _fastcall -#define __fastcall /*what does this correspond to?*/ -#define _fastcall /*same as above - what does this correspond to?*/ -#define ANSIToTCHAR(str, foo, bar) (str) - -/* for Windows / Xbox 360 (below VS2010) - typedefs for missing stdint.h types such as uintptr_t?*/ - -/*FBA defines*/ -#define PUF_TEXT_NO_TRANSLATE (0) -#define PUF_TYPE_ERROR (1) - -extern TCHAR szAppBurnVer[16]; - -typedef int HWND; - -extern int bDrvOkay; -extern int bRunPause; -extern bool bAlwaysProcessKeyboardInput; -extern HWND hScrnWnd; // Handle to the screen window - -extern void InpDIPSWResetDIPs (void); - -#endif diff --git a/jan/src/burner/misc.cpp b/jan/src/burner/misc.cpp deleted file mode 100644 index 127397766..000000000 --- a/jan/src/burner/misc.cpp +++ /dev/null @@ -1,434 +0,0 @@ -// Misc functions module -#include -#include "burner.h" - -// --------------------------------------------------------------------------- -// Software gamma - -INT32 bDoGamma = 0; -INT32 bHardwareGammaOnly = 1; -double nGamma = 1.25; -const INT32 nMaxRGB = 255; - -static UINT8 GammaLUT[256]; - -void ComputeGammaLUT() -{ - for (INT32 i = 0; i < 256; i++) { - GammaLUT[i] = (UINT8)((double)nMaxRGB * pow((i / 255.0), nGamma)); - } -} - -// Standard callbacks for 16/24/32 bit color: -static UINT32 __cdecl HighCol15(INT32 r, INT32 g, INT32 b, INT32 /* i */) -{ - UINT32 t; - t =(r<<7)&0x7c00; // 0rrr rr00 0000 0000 - t|=(g<<2)&0x03e0; // 0000 00gg ggg0 0000 - t|=(b>>3)&0x001f; // 0000 0000 000b bbbb - return t; -} - -static UINT32 __cdecl HighCol16(INT32 r, INT32 g, INT32 b, INT32 /* i */) -{ - UINT32 t; - t =(r<<8)&0xf800; // rrrr r000 0000 0000 - t|=(g<<3)&0x07e0; // 0000 0ggg ggg0 0000 - t|=(b>>3)&0x001f; // 0000 0000 000b bbbb - return t; -} - -// 24-bit/32-bit -static UINT32 __cdecl HighCol24(INT32 r, INT32 g, INT32 b, INT32 /* i */) -{ - UINT32 t; - t =(r<<16)&0xff0000; - t|=(g<<8 )&0x00ff00; - t|=(b )&0x0000ff; - - return t; -} - -static UINT32 __cdecl HighCol15Gamma(INT32 r, INT32 g, INT32 b, INT32 /* i */) -{ - UINT32 t; - t = (GammaLUT[r] << 7) & 0x7C00; // 0rrr rr00 0000 0000 - t |= (GammaLUT[g] << 2) & 0x03E0; // 0000 00gg ggg0 0000 - t |= (GammaLUT[b] >> 3) & 0x001F; // 0000 0000 000b bbbb - return t; -} - -static UINT32 __cdecl HighCol16Gamma(INT32 r, INT32 g ,INT32 b, INT32 /* i */) -{ - UINT32 t; - t = (GammaLUT[r] << 8) & 0xF800; // rrrr r000 0000 0000 - t |= (GammaLUT[g] << 3) & 0x07E0; // 0000 0ggg ggg0 0000 - t |= (GammaLUT[b] >> 3) & 0x001F; // 0000 0000 000b bbbb - return t; -} - -// 24-bit/32-bit -static UINT32 __cdecl HighCol24Gamma(INT32 r, INT32 g, INT32 b, INT32 /* i */) -{ - UINT32 t; - t = (GammaLUT[r] << 16); - t |= (GammaLUT[g] << 8); - t |= GammaLUT[b]; - - return t; -} - -INT32 SetBurnHighCol(INT32 nDepth) -{ - VidRecalcPal(); - - if (bDoGamma && ((nVidFullscreen && !bVidUseHardwareGamma) || (!nVidFullscreen && !bHardwareGammaOnly))) { - if (nDepth == 15) { - VidHighCol = HighCol15Gamma; - } - if (nDepth == 16) { - VidHighCol = HighCol16Gamma; - } - if (nDepth > 16) { - VidHighCol = HighCol24Gamma; - } - } else { - if (nDepth == 15) { - VidHighCol = HighCol15; - } - if (nDepth == 16) { - VidHighCol = HighCol16; - } - if (nDepth > 16) { - VidHighCol = HighCol24; - } - } - if ((bDrvOkay && !(BurnDrvGetFlags() & BDF_16BIT_ONLY)) || nDepth <= 16) { - BurnHighCol = VidHighCol; - } - - return 0; -} - -// --------------------------------------------------------------------------- - -char* DecorateGameName(UINT32 nBurnDrv) -{ - static char szDecoratedName[256]; - UINT32 nOldBurnDrv = nBurnDrvActive; - - nBurnDrvActive = nBurnDrv; - - const char* s1 = ""; - const char* s2 = ""; - const char* s3 = ""; - const char* s4 = ""; - const char* s5 = ""; - const char* s6 = ""; - const char* s7 = ""; - const char* s8 = ""; - const char* s9 = ""; - const char* s10 = ""; - const char* s11 = ""; - const char* s12 = ""; - const char* s13 = ""; - const char* s14 = ""; - - s1 = BurnDrvGetTextA(DRV_FULLNAME); - if ((BurnDrvGetFlags() & BDF_DEMO) || (BurnDrvGetFlags() & BDF_HACK) || (BurnDrvGetFlags() & BDF_HOMEBREW) || (BurnDrvGetFlags() & BDF_PROTOTYPE) || (BurnDrvGetFlags() & BDF_BOOTLEG) || (BurnDrvGetTextA(DRV_COMMENT) && strlen(BurnDrvGetTextA(DRV_COMMENT)) > 0)) { - s2 = " ["; - if (BurnDrvGetFlags() & BDF_DEMO) { - s3 = "Demo"; - if ((BurnDrvGetFlags() & BDF_HACK) || (BurnDrvGetFlags() & BDF_HOMEBREW) || (BurnDrvGetFlags() & BDF_PROTOTYPE) || (BurnDrvGetFlags() & BDF_BOOTLEG) || (BurnDrvGetTextA(DRV_COMMENT) && strlen(BurnDrvGetTextA(DRV_COMMENT)) > 0)) { - s4 = ", "; - } - } - if (BurnDrvGetFlags() & BDF_HACK) { - s5 = "Hack"; - if ((BurnDrvGetFlags() & BDF_HOMEBREW) || (BurnDrvGetFlags() & BDF_PROTOTYPE) || (BurnDrvGetFlags() & BDF_BOOTLEG) || (BurnDrvGetTextA(DRV_COMMENT) && strlen(BurnDrvGetTextA(DRV_COMMENT)) > 0)) { - s6 = ", "; - } - } - if (BurnDrvGetFlags() & BDF_HOMEBREW) { - s7 = "Homebrew"; - if ((BurnDrvGetFlags() & BDF_PROTOTYPE) || (BurnDrvGetFlags() & BDF_BOOTLEG) || (BurnDrvGetTextA(DRV_COMMENT) && strlen(BurnDrvGetTextA(DRV_COMMENT)) > 0)) { - s8 = ", "; - } - } - if (BurnDrvGetFlags() & BDF_PROTOTYPE) { - s9 = "Prototype"; - if ((BurnDrvGetFlags() & BDF_BOOTLEG) || (BurnDrvGetTextA(DRV_COMMENT) && strlen(BurnDrvGetTextA(DRV_COMMENT)) > 0)) { - s10 = ", "; - } - } - if (BurnDrvGetFlags() & BDF_BOOTLEG) { - s11 = "Bootleg"; - if (BurnDrvGetTextA(DRV_COMMENT) && strlen(BurnDrvGetTextA(DRV_COMMENT)) > 0) { - s12 = ", "; - } - } - if (BurnDrvGetTextA(DRV_COMMENT) && strlen(BurnDrvGetTextA(DRV_COMMENT)) > 0) { - s13 = BurnDrvGetTextA(DRV_COMMENT); - } - s14 = "]"; - } - - sprintf(szDecoratedName, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s", s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14); - - nBurnDrvActive = nOldBurnDrv; - return szDecoratedName; -} - -TCHAR* DecorateGenreInfo() -{ - INT32 nGenre = BurnDrvGetGenreFlags(); - INT32 nFamily = BurnDrvGetFamilyFlags(); - - static TCHAR szDecoratedGenre[256]; - TCHAR szFamily[256]; - - _stprintf(szDecoratedGenre, _T("")); - _stprintf(szFamily, _T("")); - -#ifdef BUILD_WIN32 -//TODO: Translations are not working in non-win32 builds. This needs to be fixed - - if (nGenre) { - if (nGenre & GBF_HORSHOOT) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_HORSHOOT, true)); - } - - if (nGenre & GBF_VERSHOOT) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_VERSHOOT, true)); - } - - if (nGenre & GBF_SCRFIGHT) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_SCRFIGHT, true)); - } - - if (nGenre & GBF_VSFIGHT) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_VSFIGHT, true)); - } - - if (nGenre & GBF_BIOS) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_BIOS, true)); - } - - if (nGenre & GBF_BREAKOUT) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_BREAKOUT, true)); - } - - if (nGenre & GBF_CASINO) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_CASINO, true)); - } - - if (nGenre & GBF_BALLPADDLE) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_BALLPADDLE, true)); - } - - if (nGenre & GBF_MAZE) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_MAZE, true)); - } - - if (nGenre & GBF_MINIGAMES) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_MINIGAMES, true)); - } - - if (nGenre & GBF_PINBALL) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_PINBALL, true)); - } - - if (nGenre & GBF_PLATFORM) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_PLATFORM, true)); - } - - if (nGenre & GBF_PUZZLE) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_PUZZLE, true)); - } - - if (nGenre & GBF_QUIZ) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_QUIZ, true)); - } - - if (nGenre & GBF_SPORTSMISC) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_SPORTSMISC, true)); - } - - if (nGenre & GBF_SPORTSFOOTBALL) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_SPORTSFOOTBALL, true)); - } - - if (nGenre & GBF_MISC) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_MISC, true)); - } - - if (nGenre & GBF_MAHJONG) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_MAHJONG, true)); - } - - if (nGenre & GBF_RACING) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_RACING, true)); - } - - if (nGenre & GBF_SHOOT) { - _stprintf(szDecoratedGenre, _T("%s%s, "), szDecoratedGenre, FBALoadStringEx(hAppInst, IDS_GENRE_SHOOT, true)); - } - - szDecoratedGenre[_tcslen(szDecoratedGenre) - 2] = _T('\0'); - } - - if (nFamily) { - _stprintf(szFamily, _T(" (")); - - if (nFamily & FBF_MSLUG) { - _stprintf(szFamily, _T("%s%s, "), szFamily, FBALoadStringEx(hAppInst, IDS_FAMILY_MSLUG, true)); - } - - if (nFamily & FBF_SF) { - _stprintf(szFamily, _T("%s%s, "), szFamily, FBALoadStringEx(hAppInst, IDS_FAMILY_SF, true)); - } - - if (nFamily & FBF_KOF) { - _stprintf(szFamily, _T("%s%s, "), szFamily, FBALoadStringEx(hAppInst, IDS_FAMILY_KOF, true)); - } - - if (nFamily & FBF_DSTLK) { - _stprintf(szFamily, _T("%s%s, "), szFamily, FBALoadStringEx(hAppInst, IDS_FAMILY_DSTLK, true)); - } - - if (nFamily & FBF_FATFURY) { - _stprintf(szFamily, _T("%s%s, "), szFamily, FBALoadStringEx(hAppInst, IDS_FAMILY_FATFURY, true)); - } - - if (nFamily & FBF_SAMSHO) { - _stprintf(szFamily, _T("%s%s, "), szFamily, FBALoadStringEx(hAppInst, IDS_FAMILY_SAMSHO, true)); - } - - if (nFamily & FBF_19XX) { - _stprintf(szFamily, _T("%s%s, "), szFamily, FBALoadStringEx(hAppInst, IDS_FAMILY_19XX, true)); - } - - if (nFamily & FBF_SONICWI) { - _stprintf(szFamily, _T("%s%s, "), szFamily, FBALoadStringEx(hAppInst, IDS_FAMILY_SONICWI, true)); - } - - if (nFamily & FBF_PWRINST) { - _stprintf(szFamily, _T("%s%s, "), szFamily, FBALoadStringEx(hAppInst, IDS_FAMILY_PWRINST, true)); - } - - szFamily[_tcslen(szFamily) - 2] = _T(')'); - szFamily[_tcslen(szFamily) - 1] = _T('\0'); - } -#endif - _stprintf(szDecoratedGenre, _T("%s%s"), szDecoratedGenre, szFamily); - - return szDecoratedGenre; -} - -// --------------------------------------------------------------------------- -// config file parsing - -TCHAR* LabelCheck(TCHAR* s, TCHAR* pszLabel) -{ - INT32 nLen; - if (s == NULL) { - return NULL; - } - if (pszLabel == NULL) { - return NULL; - } - nLen = _tcslen(pszLabel); - - SKIP_WS(s); // Skip whitespace - - if (_tcsncmp(s, pszLabel, nLen)){ // Doesn't match - return NULL; - } - return s + nLen; -} - -INT32 QuoteRead(TCHAR** ppszQuote, TCHAR** ppszEnd, TCHAR* pszSrc) // Read a (quoted) string from szSrc and poINT32 to the end -{ - static TCHAR szQuote[QUOTE_MAX]; - TCHAR* s = pszSrc; - TCHAR* e; - - // Skip whitespace - SKIP_WS(s); - - e = s; - - if (*s == _T('\"')) { // Quoted string - s++; - e++; - // Find end quote - FIND_QT(e); - _tcsncpy(szQuote, s, e - s); - // Zero-terminate - szQuote[e - s] = _T('\0'); - e++; - } else { // Non-quoted string - // Find whitespace - FIND_WS(e); - _tcsncpy(szQuote, s, e - s); - // Zero-terminate - szQuote[e - s] = _T('\0'); - } - - if (ppszQuote) { - *ppszQuote = szQuote; - } - if (ppszEnd) { - *ppszEnd = e; - } - - return 0; -} - -TCHAR* ExtractFilename(TCHAR* fullname) -{ - TCHAR* filename = fullname + _tcslen(fullname); - - do { - filename--; - } while (filename >= fullname && *filename != _T('\\') && *filename != _T('/') && *filename != _T(':')); - - return filename; -} - -TCHAR* DriverToName(UINT32 nDrv) -{ - TCHAR* szName = NULL; - UINT32 nOldDrv; - - if (nDrv >= nBurnDrvCount) { - return NULL; - } - - nOldDrv = nBurnDrvActive; - nBurnDrvActive = nDrv; - szName = BurnDrvGetText(DRV_NAME); - nBurnDrvActive = nOldDrv; - - return szName; -} - -UINT32 NameToDriver(TCHAR* szName) -{ - UINT32 nOldDrv = nBurnDrvActive; - UINT32 nDrv = 0; - - for (nBurnDrvActive = 0; nBurnDrvActive < nBurnDrvCount; nBurnDrvActive++) { - if (_tcscmp(szName, BurnDrvGetText(DRV_NAME)) == 0 && !(BurnDrvGetFlags() & BDF_BOARDROM)) { - break; - } - } - nDrv = nBurnDrvActive; - if (nDrv >= nBurnDrvCount) { - nDrv = ~0U; - } - - nBurnDrvActive = nOldDrv; - - return nDrv; -} diff --git a/jan/src/burner/neocdlist.h b/jan/src/burner/neocdlist.h deleted file mode 100644 index 25dfd767d..000000000 --- a/jan/src/burner/neocdlist.h +++ /dev/null @@ -1,143 +0,0 @@ -#ifndef _neocdlist_ -#define _neocdlist_ - -struct NGCDGAME -{ - TCHAR* pszName; // Short name - TCHAR* pszTitle; // Title - TCHAR* pszYear; // Release Year - TCHAR* pszCompany; // Developer - unsigned int id; // Game ID -}; - -NGCDGAME* GetNeoGeoCDInfo(unsigned int nID); -int GetNeoCDTitle(unsigned int nGameID); -void SetNeoCDTitle(TCHAR* pszTitle); -int GetNeoGeoCD_Identifier(); - -bool IsNeoGeoCD(); // neo_run.cpp -TCHAR* GetIsoPath(); // cd_isowav.cpp - -int NeoCDInfo_Init(); -TCHAR* NeoCDInfo_Text(int nText); -int NeoCDInfo_ID(); -void NeoCDInfo_Exit(); - -// ------------------------------------------------------ -// ISO9660 STUFF - -// ISO9660 date and time -struct iso9660_date -{ - unsigned char Year; // Number of year since 1900 - unsigned char Month; // Month (1 to 12) - unsigned char Day; // Day (1 to 31) - unsigned char Hour; // Hour (0 to 23) - unsigned char Minute; // Minute (0 to 59) - unsigned char Second; // Second (0 to 59) - unsigned char Zone; // Offset related to GMT, by 15-min interval (from -48 to +52) -}; - -// ISO9660 BCD date and time -struct iso9660_bcd_date -{ - unsigned char Year[4]; - unsigned char Month[2]; - unsigned char Day[2]; - unsigned char Hour[2]; - unsigned char Minute[2]; - unsigned char Second[2]; - unsigned char SecFrac[2]; - char Zone; -}; - -struct iso9660_DirectoryRecord -{ - unsigned char len_dr; // [1] Length of Directory Record (bytes) - unsigned char ext_attr_rec_len; // [1] Extended Attribute Record Length (bytes) - unsigned char location_of_extent[8]; // [8] [LEF / BEF] LBN / Sector location of the file data - unsigned char data_lenth[8]; // [8] [LEF / BEF] Length of the file section (bytes) - iso9660_date rec_date_time; // [7] Recording Date and Time - unsigned char file_flags; // [1] 8-bit flags - // [bit 0] File is Hidden if this bit is 1 - // [bit 1] Entry is a Directory if this bit is 1 - // [bit 2] Entry is an Associated file is this bit is 1 - // [bit 3] Information is structured according to the extended attribute record if this bit is 1 - // [bit 4] Owner, group and permissions are specified in the extended attribute record if this bit is 1 - // [bit 5] Reserved (0) - // [bit 6] Reserved (0) - // [bit 7] File has more than one directory record if this bit is 1 - unsigned char file_unit_size; // [1] This field is only valid if the file is recorded in interleave mode, otherwise this field is (00) - unsigned char int_gap_size; // [1] This field is only valid if the file is recorded in interleave mode, otherwise this field is (00) - unsigned char vol_seq_number[4]; // [4] The ordinal number of the volume in the Volume Set on which the file described by the directory record is recorded. - unsigned char len_fi; // [1] Length of File Identifier (LEN_FI) - char* file_id; // [LEN_FI] File Identifier -}; - -struct iso9660_PathTableRecord -{ - unsigned char len_di; // [1] Length of Directory Identifier - unsigned char extended_attr_len; // [1] Extended Attribute Record Length - unsigned char extent_location[4]; // [4] Extent Location (Sector) - unsigned char parent_dir_num; // [1] Parent Directory Number - char* directory_id; // [LEN_DI] Directory Identifier -}; - -// Volume Descriptor Header (Sector 16) -struct iso9660_VDH -{ - char vdtype; // [1] Volume Descriptor Type - unsigned char stdid[5]; // [5] ISO9660 Standard Identifier - char vdver; // [1] Volume Descriptor Version -}; - -// Primary Volume Descriptor (Volume Descriptor Type 1) -struct iso9660_PVD -{ - // ----------------------------- - // Volume Descriptor Header - char type; - unsigned char id[5]; - char version; - // ----------------------------- - // Primary Volume Descriptor - char unused1; - unsigned char system_id[32]; - unsigned char volume_id[32]; - unsigned char unused2[8]; - unsigned char volume_space_size[8]; - unsigned char unused3[32]; - unsigned char volume_set_size[4]; - unsigned char volume_sequence_number[4]; - unsigned char logical_block_size[4]; - unsigned char path_table_size[8]; - unsigned char type_l_path_table[4]; - unsigned char opt_type_l_path_table[4]; - unsigned char type_m_path_table[4]; - unsigned char opt_type_m_path_table[4]; - iso9660_DirectoryRecord root_directory_record; - unsigned char volume_set_id[128]; - unsigned char publisher_id[128]; - unsigned char preparer_id[128]; - unsigned char application_id[128]; - unsigned char copyright_file_id[37]; - unsigned char abstract_file_id[37]; - unsigned char bibliographic_file_id[37]; - - iso9660_bcd_date creation_date; // [17] - iso9660_bcd_date modification_date; // [17] - iso9660_bcd_date expiration_date; // [17] - iso9660_bcd_date effective_date; // [17] - - char file_structure_version; - char unused4; - unsigned char application_data[512]; - unsigned char unused5[643]; -}; - -void iso9660_ReadOffset(unsigned char *Dest, FILE* fp, unsigned int lOffset, unsigned int lSize, unsigned int lLength); - -// ------------------------------------------------------ - - -#endif diff --git a/jan/src/burner/psp/burner_psp.h b/jan/src/burner/psp/burner_psp.h deleted file mode 100644 index 3603a5747..000000000 --- a/jan/src/burner/psp/burner_psp.h +++ /dev/null @@ -1,90 +0,0 @@ - -#include -#include -#include -#include -#include -//#include -//#include -#include -#include - - -//use this define to enable crappy logging functions -#define logging_build - -#ifndef _WIN32 -typedef struct tagRECT { - int left; - int top; - int right; - int bottom; -} RECT,*PRECT,*LPRECT; -typedef const RECT *LPCRECT; -#endif - - -#ifndef MAX_PATH -#define MAX_PATH 511 -#endif -#define stricmp strcasecmp - -#ifdef __GNU_C__ -#undef _strncmpi -#define _strncmpi strncasecmp -#undef _strnicmp -#define _strnicmp strncasecmp -#endif - -#ifndef __cdecl -#define __cdecl -#endif - -//main.cpp -int SetBurnHighCol(int nDepth); -extern int nAppVirtualFps; -extern bool bRunPause; -extern bool bAlwaysProcessKeyboardInput; -TCHAR* ANSIToTCHAR(const char* pszInString, TCHAR* pszOutString, int nOutSize); -char* TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int nOutSize); -bool AppProcessKeyboardInput(); -char* DecorateGameName(unsigned int nBurnDrv); - - -//gui_menu.cpp -int init_guimenu(); -void exit_guimenu(); - -//config.cpp -int ConfigAppLoad(); -int ConfigAppSave(); -char *LabelCheck(char* s, char* szLabel); - - -// drv.cpp -extern int bDrvOkay; // 1 if the Driver has been initted okay, and it's okay to use the BurnDrv functions -extern char szAppRomPaths[DIRS_MAX][MAX_PATH]; -int DrvInit(int nDrvNum, bool bRestore); -int DrvInitCallback(); // Used when Burn library needs to load a game. DrvInit(nBurnSelect, false) -int DrvExit(); -int ProgressUpdateBurner(double dProgress, const TCHAR* pszText, bool bAbs); -int AppError(TCHAR* szText, int bWarning); - -//run.cpp -extern int RunMessageLoop(); -extern int RunReset(); - -//inpdipsw.cpp -void InpDIPSWResetDIPs(); - -//interface/inp_interface.cpp -int InputInit(); -int InputExit(); -int InputMake(bool bCopy); - -#ifdef logging_build -void log_printf(const char *format, ...); -#endif -//TODO: -#define szAppBurnVer 123142 - diff --git a/jan/src/burner/psp/config.cpp b/jan/src/burner/psp/config.cpp deleted file mode 100644 index 78a07260a..000000000 --- a/jan/src/burner/psp/config.cpp +++ /dev/null @@ -1,159 +0,0 @@ -// Burner Config file module -#include "burner.h" -int nIniVersion = 0; - -static void CreateConfigName(char* szConfig) -{ - memcpy(szConfig, "fba.ini\0", 8); - return; -} - -// Read in the config file for the whole application -int ConfigAppLoad() -{ - char szConfig[MAX_PATH]; - char szLine[256]; - FILE *h; - - CreateConfigName(szConfig); - - if ((h = fopen(szConfig,"rt")) == NULL) { - return 1; - } - - // Go through each line of the config file - while (fgets(szLine, sizeof(szLine), h)) { - int nLen; - - nLen = strlen(szLine); - - // Get rid of the linefeed at the end - if (szLine[nLen - 1] == 10) { - szLine[nLen - 1] = 0; - nLen--; - } - -#define VAR(x) { char *szValue = LabelCheck(szLine,#x); \ - if (szValue) x = strtol(szValue, NULL, 0); } -#define FLT(x) { char *szValue = LabelCheck(szLine,#x); \ - if (szValue) x = atof(szValue); } -#define STR(x) { char *szValue = LabelCheck(szLine,#x " "); \ - if (szValue) strcpy(x,szValue); } - - VAR(nIniVersion); - - - // Other - STR(szAppRomPaths[0]); - STR(szAppRomPaths[1]); - STR(szAppRomPaths[2]); - STR(szAppRomPaths[3]); - STR(szAppRomPaths[4]); - STR(szAppRomPaths[5]); - STR(szAppRomPaths[6]); - STR(szAppRomPaths[7]); -#undef STR -#undef FLT -#undef VAR - } - - fclose(h); - return 0; -} - -// Write out the config file for the whole application -int ConfigAppSave() -{ - char szConfig[MAX_PATH]; - FILE *h; - - CreateConfigName(szConfig); - - if ((h = fopen(szConfig, "wt")) == NULL) { - return 1; - } - - -#define VAR(x) fprintf(h, #x " %d\n", x) -#define FLT(x) fprintf(h, #x " %f\n", x) -#define STR(x) fprintf(h, #x " %s\n", x) - - fprintf(h,"\n// The application version this file was saved from\n"); - // We can't use the macros for this! - fprintf(h, "nIniVersion 0x%06X", nBurnVer); - - fprintf(h,"\n// The paths to search for rom zips. (include trailing backslash)\n"); - STR(szAppRomPaths[0]); - STR(szAppRomPaths[1]); - STR(szAppRomPaths[2]); - STR(szAppRomPaths[3]); - STR(szAppRomPaths[4]); - STR(szAppRomPaths[5]); - STR(szAppRomPaths[6]); - STR(szAppRomPaths[7]); - - fprintf(h,"\n\n\n"); - -#undef STR -#undef FLT -#undef VAR - - fclose(h); - return 0; -} - -char* LabelCheck(char *s,char *szLabel) -{ - int nLen; - if (s == NULL) { - return NULL; - } - if (szLabel == NULL) { - return NULL; - } - nLen = strlen(szLabel); - - SKIP_WS(s); // Skip whitespace - - if (strncmp(s, szLabel, nLen)){ // Doesn't match - return NULL; - } - return s + nLen; -} - -int QuoteRead(char** pszQuote, char** pszEnd, char* szSrc) // Read a quoted string from szSrc and point to the end -{ - static char szQuote[QUOTE_MAX]; - char *s = szSrc; - int i; - - SKIP_WS(s); // Skip whitespace - - if (*s != '\"') { // Didn't start with a quote - return 1; - } - s++; - - // Copy the characters into szQuote - for (i = 0; i < QUOTE_MAX - 1; i++, s++) { - if (*s == '\"') { - s++; - break; - } - if (*s == 0) { // Stop copying if end of line or end of string - break; - } - szQuote[i] = *s; // Copy character to szQuote - } - szQuote[i] = 0; // Zero-terminate szQuote - - if (pszQuote) { - *pszQuote = szQuote; - } - if (pszEnd) { - *pszEnd = s; - } - - return 0; -} - diff --git a/jan/src/burner/psp/drv.cpp b/jan/src/burner/psp/drv.cpp deleted file mode 100644 index 794c89b50..000000000 --- a/jan/src/burner/psp/drv.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// Driver Init module -#include "burner.h" - -int bDrvOkay = 0; // 1 if the Driver has been initted okay, and it's okay to use the BurnDrv functions - -char szAppRomPaths[DIRS_MAX][MAX_PATH] = {{"ms0:/"},{"roms/"}, }; - -static bool bSaveRAM = false; - -static int DoLibInit() // Do Init of Burn library driver -{ - int nRet; - - BzipOpen(false); - - // If there is an error with the romset, report it - if (nBzipError) { - /* char *szTitle; - int nIcon, nButton; - - // Make the correct title and icon - if (nBzipError & 1) { - nIcon = MB_ICONERROR; - szTitle = APP_TITLE " Error"; - } else { - nIcon = MB_ICONWARNING; - szTitle = APP_TITLE " Warning"; - } - - if (nBzipError & 0x08) { - nButton = MB_OK; // no data at all - pretty basic! - } else { - BzipText.Add("\nWould you like more detailed information?\n(For experts only!)\n"); - nButton = MB_DEFBUTTON2 | MB_YESNO; - } - - // We can't use AppError, so use MessageBox directly - if (MessageBox(hScrnWnd, BzipText.szText, szTitle, nButton | nIcon | MB_SETFOREGROUND) == IDYES) { - // Give the more detailed information string - MessageBox(hScrnWnd, BzipDetail.szText, szTitle, MB_OK | nIcon | MB_SETFOREGROUND); - } -*/ } - - //ProgressCreate(); - - nRet = BurnDrvInit(); - - BzipClose(); - -// ProgressDestroy(); - - if (nRet) { - return 1; - } else { - return 0; - } -} - -// Catch calls to BurnLoadRom() once the emulation has started; -// Intialise the zip module before forwarding the call, and exit cleanly. -static int DrvLoadRom(unsigned char* Dest, int* pnWrote, int i) -{ - int nRet; - - BzipOpen(false); - - if ((nRet = BurnExtLoadRom(Dest, pnWrote, i)) != 0) { - char szText[256] = ""; - char* pszFilename; - - BurnDrvGetRomName(&pszFilename, i, 0); - sprintf(szText, "Error loading %s, requested by %s.\nThe emulation will likely suffer problems.", pszFilename, BurnDrvGetTextA(0)); - } - - BzipClose(); - - BurnExtLoadRom = DrvLoadRom; - - //ScrnTitle(); - - return nRet; -} - -int DrvInit(int nDrvNum, bool bRestore) -{ - DrvExit(); // Make sure exitted - AudSoundInit(); // Init Sound (not critical if it fails) - - nBurnSoundRate = 0; // Assume no sound - pBurnSoundOut = NULL; - if (bAudOkay) { - nBurnSoundRate = nAudSampleRate; - nBurnSoundLen = nAudSegLen; - } - nBurnDrvSelect = nDrvNum; // Set the driver number - - // Define nMaxPlayers early; GameInpInit() needs it (normally defined in DoLibInit()). - nMaxPlayers = BurnDrvGetMaxPlayers(); - GameInpInit(); // Init game input - - ConfigGameLoad(true); - InputMake(true); - - GameInpDefault(); - - if (DoLibInit()) { // Init the Burn library's driver - char szTemp[512]; - - BurnDrvExit(); // Exit the driver - - _stprintf (szTemp, _T("There was an error starting '%s'.\n"), BurnDrvGetText(DRV_FULLNAME)); - return 1; - } - - BurnExtLoadRom = DrvLoadRom; - - bDrvOkay = 1; // Okay to use all BurnDrv functions - - bSaveRAM = false; - nBurnLayer = 0xFF; // show all layers - - // Reset the speed throttling code, so we don't 'jump' after the load - RunReset(); - return 0; -} - -int DrvInitCallback() -{ - return DrvInit(nBurnDrvSelect, false); -} - -int DrvExit() -{ - if (bDrvOkay) { - -// StopReplay(); - - VidExit(); - - if (nBurnDrvSelect < nBurnDrvCount) { - - //MemCardEject(); // Eject memory card if present - - if (bSaveRAM) { - //StatedAuto(1); // Save NV (or full) RAM - bSaveRAM = false; - } - - ConfigGameSave(bSaveInputs); - - GameInpExit(); // Exit game input - BurnDrvExit(); // Exit the driver - } - } - - BurnExtLoadRom = NULL; - - bDrvOkay = 0; // Stop using the BurnDrv functions - - //bRunPause = 0; // Don't pause when exitted - - if (bAudOkay) { -// // Write silence into the sound buffer on exit, and for drivers which don't use pBurnSoundOut - memset(nAudNextSound, 0, nAudSegLen << 2); - } - - nBurnDrvSelect = ~0U; // no driver selected - - return 0; -} - -int ProgressUpdateBurner(double dProgress, const TCHAR* pszText, bool bAbs) -{ - printf("."); - return 0; -} - -int AppError(TCHAR* szText, int bWarning) -{ - return 0; -} - diff --git a/jan/src/burner/psp/font.c b/jan/src/burner/psp/font.c deleted file mode 100644 index b24678eb0..000000000 --- a/jan/src/burner/psp/font.c +++ /dev/null @@ -1,448 +0,0 @@ -// font for Hello World PSP - -const unsigned char font[]={ - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0x38,0x44,0x82,0x82,0x82,0x44,0x38,0x00, // - 0x82,0x44,0x28,0x10,0x28,0x44,0x82,0x00, //~ - 0xFE,0x82,0x82,0x82,0x82,0x82,0xFE,0x00, // - 0x10,0x28,0x28,0x44,0x44,0x82,0xFE,0x00, // - 0x10,0x38,0x7C,0x10,0x10,0x10,0x10,0x00, // - 0x00,0x08,0x0C,0xFE,0x0C,0x08,0x00,0x00, // - 0x10,0x10,0x10,0x10,0x7C,0x38,0x10,0x00, // - - 0x00,0x20,0x60,0xFE,0x60,0x20,0x00,0x00, // - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - -0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, -0x00, 0x18, 0x18, 0x18, -0x18, 0x00, 0x18, 0x00, -0x00, 0x66, 0x66, 0x66, -0x00, 0x00, 0x00, 0x00, -0x00, 0x66, 0xff, 0x66, -0x66, 0xff, 0x66, 0x00, -0x18, 0x3e, 0x60, 0x3c, -0x06, 0x7c, 0x18, 0x00, -0x00, 0x66, 0x6c, 0x18, -0x30, 0x66, 0x46, 0x00, -0x1c, 0x36, 0x1c, 0x38, -0x6f, 0x66, 0x3b, 0x00, -0x00, 0x18, 0x18, 0x18, -0x00, 0x00, 0x00, 0x00, -0x00, 0x0e, 0x1c, 0x18, -0x18, 0x1c, 0x0e, 0x00, -0x00, 0x70, 0x38, 0x18, -0x18, 0x38, 0x70, 0x00, -0x00, 0x66, 0x3c, 0xff, -0x3c, 0x66, 0x00, 0x00, -0x00, 0x18, 0x18, 0x7e, -0x18, 0x18, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, -0x00, 0x18, 0x18, 0x30, -0x00, 0x00, 0x00, 0x7e, -0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, -0x00, 0x18, 0x18, 0x00, -0x00, 0x06, 0x0c, 0x18, -0x30, 0x60, 0x40, 0x00, -0x00, 0x3c, 0x66, 0x6e, -0x76, 0x66, 0x3c, 0x00, -0x00, 0x18, 0x38, 0x18, -0x18, 0x18, 0x7e, 0x00, -0x00, 0x3c, 0x66, 0x0c, -0x18, 0x30, 0x7e, 0x00, -0x00, 0x7e, 0x0c, 0x18, -0x0c, 0x66, 0x3c, 0x00, -0x00, 0x0c, 0x1c, 0x3c, -0x6c, 0x7e, 0x0c, 0x00, -0x00, 0x7e, 0x60, 0x7c, -0x06, 0x66, 0x3c, 0x00, -0x00, 0x3c, 0x60, 0x7c, -0x66, 0x66, 0x3c, 0x00, -0x00, 0x7e, 0x06, 0x0c, -0x18, 0x30, 0x30, 0x00, -0x00, 0x3c, 0x66, 0x3c, -0x66, 0x66, 0x3c, 0x00, -0x00, 0x3c, 0x66, 0x3e, -0x06, 0x0c, 0x38, 0x00, -0x00, 0x00, 0x18, 0x18, -0x00, 0x18, 0x18, 0x00, -0x00, 0x00, 0x18, 0x18, -0x00, 0x18, 0x18, 0x30, -0x06, 0x0c, 0x18, 0x30, -0x18, 0x0c, 0x06, 0x00, -0x00, 0x00, 0x7e, 0x00, -0x00, 0x7e, 0x00, 0x00, -0x60, 0x30, 0x18, 0x0c, -0x18, 0x30, 0x60, 0x00, -0x00, 0x3c, 0x66, 0x0c, -0x18, 0x00, 0x18, 0x00, -0x00, 0x3c, 0x66, 0x6e, -0x6e, 0x60, 0x3e, 0x00, -0x00, 0x18, 0x3c, 0x66, -0x66, 0x7e, 0x66, 0x00, -0x00, 0x7c, 0x66, 0x7c, -0x66, 0x66, 0x7c, 0x00, -0x00, 0x3c, 0x66, 0x60, -0x60, 0x66, 0x3c, 0x00, -0x00, 0x78, 0x6c, 0x66, -0x66, 0x6c, 0x78, 0x00, -0x00, 0x7e, 0x60, 0x7c, -0x60, 0x60, 0x7e, 0x00, -0x00, 0x7e, 0x60, 0x7c, -0x60, 0x60, 0x60, 0x00, -0x00, 0x3e, 0x60, 0x60, -0x6e, 0x66, 0x3e, 0x00, -0x00, 0x66, 0x66, 0x7e, -0x66, 0x66, 0x66, 0x00, -0x00, 0x7e, 0x18, 0x18, -0x18, 0x18, 0x7e, 0x00, -0x00, 0x06, 0x06, 0x06, -0x06, 0x66, 0x3c, 0x00, -0x00, 0x66, 0x6c, 0x78, -0x78, 0x6c, 0x66, 0x00, -0x00, 0x60, 0x60, 0x60, -0x60, 0x60, 0x7e, 0x00, -0x00, 0x63, 0x77, 0x7f, -0x6b, 0x63, 0x63, 0x00, -0x00, 0x66, 0x76, 0x7e, -0x7e, 0x6e, 0x66, 0x00, -0x00, 0x3c, 0x66, 0x66, -0x66, 0x66, 0x3c, 0x00, -0x00, 0x7c, 0x66, 0x66, -0x7c, 0x60, 0x60, 0x00, -0x00, 0x3c, 0x66, 0x66, -0x66, 0x6c, 0x36, 0x00, -0x00, 0x7c, 0x66, 0x66, -0x7c, 0x6c, 0x66, 0x00, -0x00, 0x3c, 0x60, 0x3c, -0x06, 0x06, 0x3c, 0x00, -0x00, 0x7e, 0x18, 0x18, -0x18, 0x18, 0x18, 0x00, -0x00, 0x66, 0x66, 0x66, -0x66, 0x66, 0x7e, 0x00, -0x00, 0x66, 0x66, 0x66, -0x66, 0x3c, 0x18, 0x00, -0x00, 0x63, 0x63, 0x6b, -0x7f, 0x77, 0x63, 0x00, -0x00, 0x66, 0x66, 0x3c, -0x3c, 0x66, 0x66, 0x00, -0x00, 0x66, 0x66, 0x3c, -0x18, 0x18, 0x18, 0x00, -0x00, 0x7e, 0x0c, 0x18, -0x30, 0x60, 0x7e, 0x00, -0x00, 0x1e, 0x18, 0x18, -0x18, 0x18, 0x1e, 0x00, -0x00, 0x40, 0x60, 0x30, -0x18, 0x0c, 0x06, 0x00, -0x00, 0x78, 0x18, 0x18, -0x18, 0x18, 0x78, 0x00, -0x00, 0x08, 0x1c, 0x36, -0x63, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xff, 0x00, -0x00, 0x18, 0x3c, 0x7e, -0x7e, 0x3c, 0x18, 0x00, -0x00, 0x00, 0x3c, 0x06, -0x3e, 0x66, 0x3e, 0x00, -0x00, 0x60, 0x60, 0x7c, -0x66, 0x66, 0x7c, 0x00, -0x00, 0x00, 0x3c, 0x60, -0x60, 0x60, 0x3c, 0x00, -0x00, 0x06, 0x06, 0x3e, -0x66, 0x66, 0x3e, 0x00, -0x00, 0x00, 0x3c, 0x66, -0x7e, 0x60, 0x3c, 0x00, -0x00, 0x0e, 0x18, 0x3e, -0x18, 0x18, 0x18, 0x00, -0x00, 0x00, 0x3e, 0x66, -0x66, 0x3e, 0x06, 0x7c, -0x00, 0x60, 0x60, 0x7c, -0x66, 0x66, 0x66, 0x00, -0x00, 0x18, 0x00, 0x38, -0x18, 0x18, 0x3c, 0x00, -0x00, 0x06, 0x00, 0x06, -0x06, 0x06, 0x06, 0x3c, -0x00, 0x60, 0x60, 0x6c, -0x78, 0x6c, 0x66, 0x00, -0x00, 0x38, 0x18, 0x18, -0x18, 0x18, 0x3c, 0x00, -0x00, 0x00, 0x66, 0x7f, -0x7f, 0x6b, 0x63, 0x00, -0x00, 0x00, 0x7c, 0x66, -0x66, 0x66, 0x66, 0x00, -0x00, 0x00, 0x3c, 0x66, -0x66, 0x66, 0x3c, 0x00, -0x00, 0x00, 0x7c, 0x66, -0x66, 0x7c, 0x60, 0x60, -0x00, 0x00, 0x3e, 0x66, -0x66, 0x3e, 0x06, 0x06, -0x00, 0x00, 0x7c, 0x66, -0x60, 0x60, 0x60, 0x00, -0x00, 0x00, 0x3e, 0x60, -0x3c, 0x06, 0x7c, 0x00, -0x00, 0x18, 0x7e, 0x18, -0x18, 0x18, 0x0e, 0x00, -0x00, 0x00, 0x66, 0x66, -0x66, 0x66, 0x3e, 0x00, -0x00, 0x00, 0x66, 0x66, -0x66, 0x3c, 0x18, 0x00, -0x00, 0x00, 0x63, 0x6b, -0x7f, 0x3e, 0x36, 0x00, -0x00, 0x00, 0x66, 0x3c, -0x18, 0x3c, 0x66, 0x00, -0x00, 0x00, 0x66, 0x66, -0x66, 0x3e, 0x0c, 0x78, -0x00, 0x00, 0x7e, 0x0c, -0x18, 0x30, 0x7e, 0x00, -0x00, 0x18, 0x3c, 0x7e, -0x7e, 0x18, 0x3c, 0x00, -0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, -0x00, 0x7e, 0x78, 0x7c, -0x6e, 0x66, 0x06, 0x00, -0x08, 0x18, 0x38, 0x78, -0x38, 0x18, 0x08, 0x00, -0x10, 0x18, 0x1c, 0x1e, -0x1c, 0x18, 0x10, 0x00, -0x00, 0x36, 0x7f, 0x7f, -0x3e, 0x1c, 0x08, 0x00, -0x18, 0x18, 0x18, 0x1f, -0x1f, 0x18, 0x18, 0x18, -0x03, 0x03, 0x03, 0x03, -0x03, 0x03, 0x03, 0x03, -0x18, 0x18, 0x18, 0xf8, -0xf8, 0x00, 0x00, 0x00, -0x18, 0x18, 0x18, 0xf8, -0xf8, 0x18, 0x18, 0x18, -0x00, 0x00, 0x00, 0xf8, -0xf8, 0x18, 0x18, 0x18, -0x03, 0x07, 0x0e, 0x1c, -0x38, 0x70, 0xe0, 0xc0, -0xc0, 0xe0, 0x70, 0x38, -0x1c, 0x0e, 0x07, 0x03, -0x01, 0x03, 0x07, 0x0f, -0x1f, 0x3f, 0x7f, 0xff, -0x00, 0x00, 0x00, 0x00, -0x0f, 0x0f, 0x0f, 0x0f, -0x80, 0xc0, 0xe0, 0xf0, -0xf8, 0xfc, 0xfe, 0xff, -0x0f, 0x0f, 0x0f, 0x0f, -0x00, 0x00, 0x00, 0x00, -0xf0, 0xf0, 0xf0, 0xf0, -0x00, 0x00, 0x00, 0x00, -0xff, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xff, 0xff, -0x00, 0x00, 0x00, 0x00, -0xf0, 0xf0, 0xf0, 0xf0, -0x00, 0x1c, 0x1c, 0x77, -0x77, 0x08, 0x1c, 0x00, -0x00, 0x00, 0x00, 0x1f, -0x1f, 0x18, 0x18, 0x18, -0x00, 0x00, 0x00, 0xff, -0xff, 0x00, 0x00, 0x00, -0x18, 0x18, 0x18, 0xff, -0xff, 0x18, 0x18, 0x18, -0x00, 0x00, 0x3c, 0x7e, -0x7e, 0x7e, 0x3c, 0x00, -0x00, 0x00, 0x00, 0x00, -0xff, 0xff, 0xff, 0xff, -0xc0, 0xc0, 0xc0, 0xc0, -0xc0, 0xc0, 0xc0, 0xc0, -0x00, 0x00, 0x00, 0xff, -0xff, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0xff, -0xff, 0x00, 0x00, 0x00, -0xf0, 0xf0, 0xf0, 0xf0, -0xf0, 0xf0, 0xf0, 0xf0, -0x18, 0x18, 0x18, 0x1f, -0x1f, 0x00, 0x00, 0x00, -0x78, 0x60, 0x78, 0x60, -0x7e, 0x18, 0x1e, 0x00, -0x00, 0x18, 0x3c, 0x7e, -0x18, 0x18, 0x18, 0x00, -0x00, 0x18, 0x18, 0x18, -0x7e, 0x3c, 0x18, 0x00, -0x00, 0x18, 0x30, 0x7e, -0x30, 0x18, 0x00, 0x00, -0x00, 0x18, 0x0c, 0x7e, -0x0c, 0x18, 0x00, 0x00, - //7b - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, - 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33, -}; - - diff --git a/jan/src/burner/psp/inpdipsw.cpp b/jan/src/burner/psp/inpdipsw.cpp deleted file mode 100644 index ec09e37cb..000000000 --- a/jan/src/burner/psp/inpdipsw.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// Burner DipSwitches Dialog module -#include "burner.h" - -static unsigned char nPrevDIPSettings[4]; - -static int nDIPOffset; - -static bool bOK; - -static void InpDIPSWGetOffset() -{ - BurnDIPInfo bdi; - - nDIPOffset = 0; - for (int i = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++) { - if (bdi.nFlags == 0xF0) { - nDIPOffset = bdi.nInput; - break; - } - } -} - -void InpDIPSWResetDIPs() -{ - int i = 0; - BurnDIPInfo bdi; - struct GameInp* pgi; - - InpDIPSWGetOffset(); - - while (BurnDrvGetDIPInfo(&bdi, i) == 0) { - if (bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + nDIPOffset; - pgi->Input.Constant.nConst = (pgi->Input.Constant.nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); - } - i++; - } -} - -static int InpDIPSWListBegin() -{ - - - - - return 0; -} - -static bool CheckSetting(int i) -{ - BurnDIPInfo bdi; - BurnDrvGetDIPInfo(&bdi, i); - struct GameInp* pgi = GameInp + bdi.nInput + nDIPOffset; - - if ((pgi->Input.Constant.nConst & bdi.nMask) == bdi.nSetting) { - unsigned char nFlags = bdi.nFlags; - if ((nFlags & 0x0F) <= 1) { - return true; - } else { - for (int j = 1; j < (nFlags & 0x0F); j++) { - BurnDrvGetDIPInfo(&bdi, i + j); - pgi = GameInp + bdi.nInput + nDIPOffset; - if (nFlags & 0x80) { - if ((pgi->Input.Constant.nConst & bdi.nMask) == bdi.nSetting) { - return false; - } - } else { - if ((pgi->Input.Constant.nConst & bdi.nMask) != bdi.nSetting) { - return false; - } - } - } - return true; - } - } - return false; -} - -// Make a list view of the DIPswitches -static int InpDIPSWListMake() -{ - - return 0; -} - -static int InpDIPSWInit() -{ - BurnDIPInfo bdi; - struct GameInp *pgi; - - InpDIPSWGetOffset(); - - InpDIPSWListBegin(); - InpDIPSWListMake(); - - for (int i = 0, j = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++) { - if (bdi.nInput >= 0 && bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + nDIPOffset; - nPrevDIPSettings[j] = pgi->Input.Constant.nConst; - j++; - } - } - - return 0; -} - -static int InpDIPSWExit() -{ - GameInpCheckMouse(); - return 0; -} - -static void InpDIPSWCancel() -{ - if (!bOK) { - int i = 0, j = 0; - BurnDIPInfo bdi; - struct GameInp *pgi; - while (BurnDrvGetDIPInfo(&bdi, i) == 0) { - if (bdi.nInput >= 0 && bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + nDIPOffset; - pgi->Input.Constant.nConst = nPrevDIPSettings[j]; - j++; - } - i++; - } - } -} - -// Create the list of possible values for a DIPswitch -static void InpDIPSWSelect() -{ -} - -int InpDIPSWCreate() -{ - if (bDrvOkay == 0) { // No game is loaded - return 1; - } - - bOK = false; - - return 0; -} diff --git a/jan/src/burner/psp/main.cpp b/jan/src/burner/psp/main.cpp deleted file mode 100644 index 58317bb54..000000000 --- a/jan/src/burner/psp/main.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/*---------------- -Stuff to finish: -redo config stuff + add support for per game config files -decide how to add the sound code via the sound interface -add config options for video and sound -add dat.cpp and sshot.cpp - - -------------------*/ -#include -#include -#include -#include -#include -#include -#include -//#include -//#include -#include -#include -#include "burner.h" - - -int nAppVirtualFps = 6000; // App fps * 100 -bool bRunPause=0; -bool bAlwaysProcessKeyboardInput=0; - - -/* Define the module info section */ -PSP_MODULE_INFO("fbapsp", 0, 1, 0); -PSP_HEAP_SIZE_MAX(); - - -#ifdef logging_build - -static FILE *fp; - - -void log_printf(const char *format, ...) -{ - va_list ap; - va_start(ap, format); - fprintf(fp, format, ap); - va_end(ap); -// fflush(fp); - -} - -#endif - -/* Exit callback */ -int exit_callback(int arg1, int arg2, void *common) -{ - //need to cleanup here -#ifdef logging_build - fflush(fp); - fclose(fp); -#endif - scePowerSetClockFrequency(222,222,111); - sceKernelExitGame(); - - return 0; -} - -/* Callback thread */ -int CallbackThread(SceSize args, void *argp) -{ - int cbid; - - cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL); - sceKernelRegisterExitCallback(cbid); - - sceKernelSleepThreadCB(); - - return 0; -} - -/* Sets up the callback thread and returns its thread id */ -int SetupCallbacks(void) -{ - int thid = 0; - - thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, THREAD_ATTR_USER, 0); - if(thid >= 0) - { - sceKernelStartThread(thid, 0, 0); - } - - return thid; -} - - -void init_emu(unsigned int gamenum) -{ - bCheatsAllowed=false; -// ConfigAppLoad(); -// ConfigAppSave(); - //CreateDirectory(".:\\cfg", NULL); - //CreateDirectory(".:\\state", NULL); - DrvInit(gamenum,0); - } - - - -void fbamain() -{ - unsigned int i=0; - int menureturn=0; - -#ifdef logging_build - fp = fopen("fbalog.txt", "a"); -#endif - scePowerSetClockFrequency(333,333,166); - - BurnLibInit(); - // samsho 317 - // ffight 131 - // 2020bb 14 - nBurnDrvSelect = 131; // game to start - - InputInit(); - init_emu(nBurnDrvSelect); - - RunMessageLoop(); - - DrvExit(); - InputExit(); - - ConfigAppSave(); - BurnLibExit(); - -} - -int user_main(SceSize args, void *argp) -{ - SetupCallbacks(); - - scePowerSetClockFrequency(333,333,166); - - sceCtrlSetSamplingCycle( 0 ); - sceCtrlSetSamplingMode( 1 ); - - fbamain(); - - scePowerSetClockFrequency(222,222,111); - sceKernelExitGame(); - - return 0; -} - -int main(int argc, char* argv[]) -{ - - // create user thread, tweek stack size here if necessary - SceUID thid = sceKernelCreateThread("User Mode Thread", user_main, 0x11,256 * 1024, PSP_THREAD_ATTR_USER, NULL); - // start user thread, then wait for it to do everything else - sceKernelStartThread(thid, 0, 0); - sceKernelWaitThreadEnd(thid, NULL); - return 0; -} - - - -/* const */ TCHAR* ANSIToTCHAR(const char* pszInString, TCHAR* pszOutString, int nOutSize) -{ -#if defined (UNICODE) - static TCHAR szStringBuffer[1024]; - - TCHAR* pszBuffer = pszOutString ? pszOutString : szStringBuffer; - int nBufferSize = pszOutString ? nOutSize * 2 : sizeof(szStringBuffer); - - if (MultiByteToWideChar(CP_ACP, 0, pszInString, -1, pszBuffer, nBufferSize)) { - return pszBuffer; - } - - return NULL; -#else - if (pszOutString) { - _tcscpy(pszOutString, pszInString); - return pszOutString; - } - - return (TCHAR*)pszInString; -#endif -} - - -/* const */ char* TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int nOutSize) -{ -#if defined (UNICODE) - static char szStringBuffer[1024]; - memset(szStringBuffer, 0, sizeof(szStringBuffer)); - - char* pszBuffer = pszOutString ? pszOutString : szStringBuffer; - int nBufferSize = pszOutString ? nOutSize * 2 : sizeof(szStringBuffer); - - if (WideCharToMultiByte(CP_ACP, 0, pszInString, -1, pszBuffer, nBufferSize, NULL, NULL)) { - return pszBuffer; - } - - return NULL; -#else - if (pszOutString) { - strcpy(pszOutString, pszInString); - return pszOutString; - } - - return (char*)pszInString; -#endif -} - - -bool AppProcessKeyboardInput() -{ - return true; -} diff --git a/jan/src/burner/psp/pg.c b/jan/src/burner/psp/pg.c deleted file mode 100644 index 753e5e2cc..000000000 --- a/jan/src/burner/psp/pg.c +++ /dev/null @@ -1,343 +0,0 @@ -// primitive graphics for Hello World sce - -#include "pg.h" -#include "font.c" - -#include - -#define pg_vramtop ((unsigned char *)0x04000000) -long pg_screenmode; -long pg_showframe; -long pg_drawframe=0; - -void pgWaitVn(unsigned long count) -{ - for (; count>0; --count) { - sceDisplayWaitVblankStart(); - } -} - - -void pgWaitV() -{ - sceDisplayWaitVblankStart(); -} - - -unsigned char *pgGetVramAddr(unsigned long x,unsigned long y) -{ - return pg_vramtop+pg_drawframe*FRAMESIZE+x*PIXELSIZE*2+y*LINESIZE*2+0x40000000; -} - - -void pgPrint(unsigned long x,unsigned long y,unsigned long color,const char *str,int bg) -{ - while (*str!=0 && x=CMAX_X) { - x=0; - y++; - } - } -} - -void pgPrintCenter(unsigned long y,unsigned long color,const char *str,int bg) -{ - unsigned long x=(480-strlen(str)*8)>>4; - while (*str!=0 && x=CMAX_X) { - x=0; - y++; - } - } -} - -void pgDrawFrame(unsigned long x1, unsigned long y1, unsigned long x2, unsigned long y2, unsigned long color) -{ - unsigned char *vptr0; //pointer to vram - unsigned long i; - - vptr0=pgGetVramAddr(0,0); - for(i=x1; i<=x2; i++){ - ((unsigned short *)vptr0)[i*PIXELSIZE + y1*LINESIZE] = color; - ((unsigned short *)vptr0)[i*PIXELSIZE + y2*LINESIZE] = color; - } - for(i=y1; i<=y2; i++){ - ((unsigned short *)vptr0)[x1*PIXELSIZE + i*LINESIZE] = color; - ((unsigned short *)vptr0)[x2*PIXELSIZE + i*LINESIZE] = color; - } -} - -void pgFillBox(unsigned long x1, unsigned long y1, unsigned long x2, unsigned long y2, unsigned long color) -{ - unsigned char *vptr0; //pointer to vram - unsigned long i, j; - - vptr0=pgGetVramAddr(0,0); - for(i=y1; i<=y2; i++){ - for(j=x1; j<=x2; j++){ - ((unsigned short *)vptr0)[j*PIXELSIZE + i*LINESIZE] = color; - } - } -} - -void pgFillvram(unsigned long color) -{ - - unsigned char *vptr0; //pointer to vram - unsigned long i; - - vptr0=pgGetVramAddr(0,0); - for (i=0; i0; --yy) { - for (xx=80; xx>0; --xx) { - dx=*(d++); - d0=( (dx&0x0000ffff)|((dx&0x0000ffff)<<16) ); - d1=( (dx&0xffff0000)|((dx&0xffff0000)>>16) ); - v0[LINESIZE/2]=d0; - v0[LINESIZE/2+1]=d1; - *(v0++)=d0; - *(v0++)=d1; - } - v0+=(LINESIZE-160); - d+=8; - } -} - -//by z-rwt -void pgBitBltStScan(unsigned long x,unsigned long y,unsigned long h,unsigned long *d) -{ - unsigned long *v0; //pointer to vram - unsigned long xx,yy; - unsigned long dx,d0,d1; - - v0=(unsigned long *)pgGetVramAddr(x,y); - for (yy=h; yy>0; --yy) { - for (xx=80; xx>0; --xx) { - dx=*(d++); - d0=( (dx&0x0000ffff)|((dx&0x0000ffff)<<16) ); - d1=( (dx&0xffff0000)|((dx&0xffff0000)>>16) ); - *(v0++)=d0; - *(v0++)=d1; - } - v0+=(LINESIZE-160); - d+=8; - } -} - -void pgBitBltSt2wotop(unsigned long x,unsigned long y,unsigned long h,unsigned long *d) -{ - unsigned long *v0; //pointer to vram - unsigned long xx,yy; - unsigned long dx,d0,d1; - - v0=(unsigned long *)pgGetVramAddr(x,y); - for (yy=0; yy<16; yy++){ - for (xx=80; xx>0; --xx) { - dx=*(d++); - d0=( (dx&0x0000ffff)|((dx&0x0000ffff)<<16) ); - d1=( (dx&0xffff0000)|((dx&0xffff0000)>>16) ); - *(v0++)=d0; - *(v0++)=d1; - } - v0+=(LINESIZE/2-160); - d+=8; - } - for (; yy0; --xx) { - dx=*(d++); - d0=( (dx&0x0000ffff)|((dx&0x0000ffff)<<16) ); - d1=( (dx&0xffff0000)|((dx&0xffff0000)>>16) ); - v0[LINESIZE/2]=d0; - v0[LINESIZE/2+1]=d1; - *(v0++)=d0; - *(v0++)=d1; - } - v0+=(LINESIZE-160); - d+=8; - } -} - -void pgBitBltSt2wobot(unsigned long x,unsigned long y,unsigned long h,unsigned long *d) -{ - unsigned long *v0; //pointer to vram - unsigned long xx,yy; - unsigned long dx,d0,d1; - - v0=(unsigned long *)pgGetVramAddr(x,y); - for (yy=0; yy0; --xx) { - dx=*(d++); - d0=( (dx&0x0000ffff)|((dx&0x0000ffff)<<16) ); - d1=( (dx&0xffff0000)|((dx&0xffff0000)>>16) ); - v0[LINESIZE/2]=d0; - v0[LINESIZE/2+1]=d1; - *(v0++)=d0; - *(v0++)=d1; - } - v0+=(LINESIZE-160); - d+=8; - } - for (; yy0; --xx) { - dx=*(d++); - d0=( (dx&0x0000ffff)|((dx&0x0000ffff)<<16) ); - d1=( (dx&0xffff0000)|((dx&0xffff0000)>>16) ); - *(v0++)=d0; - *(v0++)=d1; - } - v0+=(LINESIZE/2-160); - d+=8; - } -} - -void pgPutChar(unsigned long x,unsigned long y,unsigned long color,unsigned long bgcolor,unsigned char ch,char drawfg,char drawbg,char mag) -{ - unsigned char *vptr0; //pointer to vram - unsigned char *vptr; //pointer to vram - const unsigned char *cfont; //pointer to font - unsigned long cx,cy; - unsigned long b; - char mx,my; - - cfont=font+ch*8; - vptr0=pgGetVramAddr(x,y); - for (cy=0; cy<8; cy++) { - for (my=0; my>1; - } - vptr0+=LINESIZE*2; - } - cfont++; - } -} - -void pgScreenFrame(long mode,long frame) -{ - pg_screenmode=mode; - frame=(frame?1:0); - pg_showframe=frame; - if (mode==0) { - //screen off - pg_drawframe=frame; - sceDisplaySetFrameBuf(0,0,0,1); - } else if (mode==1) { - //show/draw same - pg_drawframe=frame; - sceDisplaySetFrameBuf(pg_vramtop+(pg_showframe?FRAMESIZE:0),LINESIZE,PIXELSIZE,1); - } else if (mode==2) { - //show/draw different - pg_drawframe=(frame?0:1); - sceDisplaySetFrameBuf(pg_vramtop+(pg_showframe?FRAMESIZE:0),LINESIZE,PIXELSIZE,1); - } -} - -void pgScreenFlip() -{ - pg_showframe=pg_drawframe; - pg_drawframe++; - pg_drawframe&=1; - sceDisplaySetFrameBuf(pg_vramtop+pg_showframe*FRAMESIZE,LINESIZE,PIXELSIZE,0); -} - - -void pgScreenFlipV() -{ - pgWaitV(); - pgScreenFlip(); -} -/******************************************************************************/ - -static unsigned Seed1; -static unsigned Seed2; - -unsigned _rand(unsigned long MAX) -{ - Seed1 = (Seed1 + 46906481) ^ Seed2; - Seed2 = Seed1 ^ ( ((Seed2<<3) | (Seed2 >> 29)) + 103995407); - - return (Seed1 - Seed2)%MAX; -} - -void PutGfx(unsigned long x,unsigned long y,unsigned long w,unsigned long h,unsigned long mag,const unsigned short *d) -{ - unsigned char *vptr0; //pointer to vram - unsigned char *vptr; //pointer to vram - unsigned long xx,yy,mx,my; - const unsigned short *dd; - - vptr0=pgGetVramAddr(x,y); - for (yy=0; yy>3) & 0x1F)<<10)|(((g>>3) & 0x1F)<<5)|(((r>>3) & 0x1F)<<0)|0x8000) -#define RGB_WHITE RGB(255,255,255) -#define RGB_BLACK RGB(0,0,0) -#define RGB_BLUE RGB(0,0,255) -#define RGB_GREEN RGB(0,255,0) -#define RGB_RED RGB(255,0,0) -#define RGB_YELLOW RGB(255,255,0) - -#define SCREEN_WIDTH 480 -#define SCREEN_HEIGHT 272 -#define PIXELSIZE 1 //in short -#define LINESIZE 512 //in short -#define FRAMESIZE 0x44000 //in byte -#define CMAX_X 60 -#define CMAX_Y 34 -//480*272 = 60*34 - -void pgWaitVn(unsigned long count); -void pgWaitV(); -unsigned char *pgGetVramAddr(unsigned long x,unsigned long y); -void pgPrint(unsigned long x,unsigned long y,unsigned long color,const char *str,int bg); -void pgPrintCenter(unsigned long y,unsigned long color,const char *str,int bg); -void pgDrawFrame(unsigned long x1, unsigned long y1, unsigned long x2, unsigned long y2, unsigned long color); -void pgFillBox(unsigned long x1, unsigned long y1, unsigned long x2, unsigned long y2, unsigned long color); -void pgFillvram(unsigned long color); -void pgBitBlt(unsigned long x,unsigned long y,unsigned long w,unsigned long h,unsigned long mag,const unsigned short *d); -void pgBitBltN2(unsigned long x,unsigned long y,unsigned long h,unsigned long *d); -void pgBitBltStScan(unsigned long x,unsigned long y,unsigned long h,unsigned long *d); -void pgBitBltSt2wotop(unsigned long x,unsigned long y,unsigned long h,unsigned long *d); -void pgBitBltSt2wobot(unsigned long x,unsigned long y,unsigned long h,unsigned long *d); -void pgPutChar(unsigned long x,unsigned long y,unsigned long color,unsigned long bgcolor,unsigned char ch,char drawfg,char drawbg,char mag); -void pgScreenFrame(long mode,long frame); -void pgScreenFlip(); -void pgScreenFlipV(); -unsigned _rand(unsigned long MAX); -void PutGfx(unsigned long x,unsigned long y,unsigned long w,unsigned long h,unsigned long mag,const unsigned short *d); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif diff --git a/jan/src/burner/psp/run.cpp b/jan/src/burner/psp/run.cpp deleted file mode 100644 index 9a4d9ef00..000000000 --- a/jan/src/burner/psp/run.cpp +++ /dev/null @@ -1,344 +0,0 @@ -// Run module -#include "burner.h" -#include "pg.h" -//#include "app.h" -//#include "kailleraclient.h" - - -//stolen from psp sdl -#include -#include - -static struct timeval start; - -void PspStartTicks(void) -{ - gettimeofday(&start, NULL); -} - -unsigned int PspGetTicks(void) -{ - struct timeval now; - unsigned int ticks; - - gettimeofday(&now, NULL); - ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000; - return(ticks); -} - -void PspDelay(unsigned int ms) -{ - const unsigned int max_delay = 0xffffffffUL / 1000; - if(ms > max_delay) - ms = max_delay; - sceKernelDelayThreadCB(ms * 1000); -} - -//end of stolen. :) - - -bool bAltPause = 0; - -int bAlwaysDrawFrames = 0; - -static bool bShowFPS = false; - -//int kNetGame = 0; // Non-zero if Kaillera is being used - -int counter; // General purpose variable used when debugging - -static unsigned int nNormalLast = 0; // Last value of timeGetTime() -static int nNormalFrac = 0; // Extra fraction we did - -static bool bAppDoStep = 0; -static bool bAppDoFast = 0; -static int nFastSpeed = 6; - -static int GetInput(bool bCopy) -{ - static int i = 0; - InputMake(bCopy); // get input - - // Update Input dialog ever 3 frames - if (i == 0) { - //InpdUpdate(); - } - - i++; - - if (i >= 3) { - i = 0; - } - - // Update Input Set dialog - //InpsUpdate(); - return 0; -} - -static void DisplayFPS() -{ - static time_t fpstimer; - static unsigned int nPreviousFrames; - - char fpsstring[8]; - time_t temptime = clock(); - float fps = static_cast(nFramesRendered - nPreviousFrames) * CLOCKS_PER_SEC / (temptime - fpstimer); - sprintf(fpsstring, "%2.1f", fps); - //VidSNewShortMsg(fpsstring, 0xDFDFFF, 480, 0); - pgPrint(1,1,0xFFFFFF,fpsstring,0); - - fpstimer = temptime; - nPreviousFrames = nFramesRendered; -} - -// define this function somewhere above RunMessageLoop() -void ToggleLayer(unsigned char thisLayer) -{ - nBurnLayer ^= thisLayer; // xor with thisLayer - VidRedraw(); - VidPaint(0); -} - - - -// With or without sound, run one frame. -// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen -static int RunFrame(int bDraw, int bPause) -{ - static int bPrevPause = 0; - static int bPrevDraw = 0; - - if (bPrevDraw && !bPause) { - VidPaint(0); // paint the screen (no need to validate) - DisplayFPS(); - } - - if (!bDrvOkay) { - return 1; - } - - if (bPause) - { - GetInput(false); // Update burner inputs, but not game inputs - if (bPause != bPrevPause) - { - VidPaint(2); // Redraw the screen (to ensure mode indicators are updated) - } - } - else - { - nFramesEmulated++; - nCurrentFrame++; - - /* { - if (nReplayStatus == 2) { - GetInput(false); // Update burner inputs, but not game inputs - if (ReplayInput()) { // Read input from file - bAltPause = 1; - bRunPause = 1; - MenuEnableItems(); - InputSetCooperativeLevel(false, false); - } - } - else - */ { - GetInput(true); // Update inputs - } - } -/* if (nReplayStatus == 1) { - RecordInput(); // Write input to file - } -*/ if (bDraw) { - nFramesRendered++; - if (VidFrame()) { // Do one frame - AudBlankSound(); - - } - } - else { // frame skipping - pBurnDraw = NULL; // Make sure no image is drawn - BurnDrvFrame(); - } - bPrevPause = bPause; - bPrevDraw = bDraw; - - return 0; -} - - -// Callback used when DSound needs more sound -static int RunGetNextSound(int bDraw) -{ - if (nAudNextSound == NULL) { - return 1; - } - - if (bRunPause) { - if (bAppDoStep) { - RunFrame(bDraw, 0); - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - } else { - RunFrame(bDraw, 1); - } - - bAppDoStep = 0; // done one step - return 0; - } - - if (bAppDoFast) { // do more frames - for (int i = 0; i < nFastSpeed; i++) { - RunFrame(0, 0); - } - } - - // Render frame with sound - pBurnSoundOut = nAudNextSound; - RunFrame(bDraw, 0); -/* - if (WaveLog != NULL && pBurnSoundOut != NULL) { // log to the file - fwrite(pBurnSoundOut, 1, nBurnSoundLen << 2, WaveLog); - pBurnSoundOut = NULL; - } -*/ - if (bAppDoStep) { - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - } - bAppDoStep = 0; // done one step - - return 0; -} - -int RunIdle() -{ - int nTime, nCount; - - if (bAudPlaying) { - // Run with sound - AudSoundCheck(); - return 0; - } - - // Run without sound - nTime = PspGetTicks() - nNormalLast; - nCount = (nTime * nAppVirtualFps - nNormalFrac) / 100000; - if (nCount <= 0) { // No need to do anything for a bit - PspDelay(2); - - return 0; - } - - nNormalFrac += nCount * 100000; - nNormalLast += nNormalFrac / nAppVirtualFps; - nNormalFrac %= nAppVirtualFps; - - if (bAppDoFast){ // Temporarily increase virtual fps - nCount *= nFastSpeed; - } - if (nCount > 100) { // Limit frame skipping - nCount = 100; - } - if (bRunPause) { - if (bAppDoStep) { // Step one frame - nCount = 10; - } else { - RunFrame(1, 1); // Paused - return 0; - } - } - bAppDoStep = 0; - - for (int i = nCount / 10; i > 0; i--) { // Mid-frames - RunFrame(!bAlwaysDrawFrames, 0); - } - RunFrame(1, 0); // End-frame - // temp added for SDLFBA - //VidPaint(0); - return 0; -} - -int RunReset() -{ - // Reset the speed throttling code - nNormalLast = 0; nNormalFrac = 0; - if (!bAudPlaying) { - // run without sound - nNormalLast = PspGetTicks(); - } - return 0; -} - -static int RunInit() -{ - // Try to run with sound - AudSetCallback(RunGetNextSound); - AudSoundPlay(); - - RunReset(); - - return 0; -} - -static int RunExit() -{ - nNormalLast = 0; - // Stop sound if it was playing - AudSoundStop(); - return 0; -} - -// The main message loop -int RunMessageLoop() -{ - int bRestartVideo; - int finished= 0; - do { - bRestartVideo = 0; - - //MediaInit(); - - if (!bVidOkay) { - - // Reinit the video plugin - VidInit(); - if (!bVidOkay && nVidFullscreen) { - - nVidFullscreen = 0; - - // MediaExit(bRestartVideo); - // MediaInit(); - VidInit(); - } - if (!nVidFullscreen) { - //ScrnSize(); - } - - /* if (!bVidOkay && (bDrvOkay || bVidUsePlaceholder)) { - // Maske sure the error will be visible - SplashDestroy(1); - - AppError("VidInit Failed", 0); - } -*/ -/* if (bVidOkay && (bRunPause || !bDrvOkay)) { - VidRedraw(); - } -*/ } - - RunInit(); - - // ShowWindow(hScrnWnd, nAppShowCmd); // Show the screen window - // nAppShowCmd = SW_NORMAL; - - // SetForegroundWindow(hScrnWnd); - - //GameInpCheckLeftAlt(); - GameInpCheckMouse(); // Hide the cursor - while (!finished) { - RunIdle(); - } - RunExit(); - } while (bRestartVideo); - - return 0; -} - diff --git a/jan/src/burner/psp/select.cpp b/jan/src/burner/psp/select.cpp deleted file mode 100644 index c5da6c19e..000000000 --- a/jan/src/burner/psp/select.cpp +++ /dev/null @@ -1,46 +0,0 @@ -static int startGame=0; // game at top of list as it is displayed on the menu -static int gamesperscreen=12; -static int gametoplay=0; - -void process_menu() -{ - for (unsigned int i=startGame,game_counter=0; game_counter0 && i -#define __TEXT(q) L##q - -typedef wchar_t TCHAR; -typedef wchar_t _TCHAR; - -#else - - -#define __TEXT(q) q - -#ifndef RC_INVOKED -typedef char TCHAR; -typedef char _TCHAR; -#endif - -// WTF? This is a normal string function! -// #define wcslen(void) - -#define _tcslen strlen -#define _tcscpy strcpy -#define _tcsncpy strncpy - -#define _tprintf printf -#define _vstprintf vsprintf -#define _vsntprintf vsnprintf -#define _stprintf sprintf -#define _sntprintf snprintf -#define _ftprintf fprintf -#define _tsprintf sprintf - -#define _tcscmp strcmp -#define _tcsncmp strncmp -#define _tcsicmp stricmp -#define _tcsnicmp _strnicmp - -#define _tcstol strtol - -#define _fgetts fgets -#define _fputts fputs - -#define _istspace isspace - -#define _tfopen fopen - - -// FBA function, change this! -#define dprintf printf - - -#endif - -#define _TEXT(x) __TEXT(x) -#define _T(x) __TEXT(x) - diff --git a/jan/src/burner/qt/aboutdialog.cpp b/jan/src/burner/qt/aboutdialog.cpp deleted file mode 100644 index 838c52796..000000000 --- a/jan/src/burner/qt/aboutdialog.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include "aboutdialog.h" -#include "ui_aboutdialog.h" -#include "qutil.h" -#include "version.h" - -AboutDialog::AboutDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::AboutDialog) -{ - ui->setupUi(this); - ui->teLicense->hide(); - layout()->setContentsMargins(0, 0, 0, 0); - layout()->setSizeConstraint(QLayout::SetFixedSize); - - ui->teLicense->setText(util::loadText(tr(":/license.txt"))); - - ui->lblVersion->setText(QString(" FBAlpha %1.%2.%3.%4") - .arg(VER_MAJOR) - .arg(VER_MINOR) - .arg(VER_BETA) - .arg(VER_ALPHA)); - QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(); - shadow->setColor(QColor(255, 102, 0)); - shadow->setXOffset(0); - shadow->setYOffset(0); - shadow->setBlurRadius(10); - ui->lblVersion->setFont(QFont("Monospace", 12)); - ui->lblVersion->setGraphicsEffect(shadow); -} - -AboutDialog::~AboutDialog() -{ - delete ui; -} diff --git a/jan/src/burner/qt/aboutdialog.h b/jan/src/burner/qt/aboutdialog.h deleted file mode 100644 index d462de289..000000000 --- a/jan/src/burner/qt/aboutdialog.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef ABOUTDIALOG_H -#define ABOUTDIALOG_H - -#include - -namespace Ui { -class AboutDialog; -} - -class AboutDialog : public QDialog -{ - Q_OBJECT - -public: - explicit AboutDialog(QWidget *parent = 0); - ~AboutDialog(); - -private: - Ui::AboutDialog *ui; -}; - -#endif // ABOUTDIALOG_H diff --git a/jan/src/burner/qt/aboutdialog.ui b/jan/src/burner/qt/aboutdialog.ui deleted file mode 100644 index c6279f825..000000000 --- a/jan/src/burner/qt/aboutdialog.ui +++ /dev/null @@ -1,131 +0,0 @@ - - - AboutDialog - - - - 0 - 0 - 645 - 350 - - - - About - - - - - - QFrame::StyledPanel - - - - - - :/resource/about.bmp - - - true - - - - - - - 6 - - - 6 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - License - - - true - - - - - - - Ok - - - - - - - - - - 8 - - - - true - - - - - - - - - - - btnOk - clicked() - AboutDialog - accept() - - - 293 - 178 - - - 488 - 177 - - - - - btnLicense - toggled(bool) - teLicense - setVisible(bool) - - - 167 - 182 - - - 154 - 259 - - - - - diff --git a/jan/src/burner/qt/burner_qt.h b/jan/src/burner/qt/burner_qt.h deleted file mode 100644 index 90051c858..000000000 --- a/jan/src/burner/qt/burner_qt.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _BURNER_QT_H -#define _BURNER_QT_H - -typedef unsigned char BYTE; -/* -typedef unsigned short WORD; -*/ -typedef unsigned long DWORD; - -extern int bDrvOkay; -extern int bRunPause; -extern bool bAlwaysProcessKeyboardInput; -extern int nAppVirtualFps; - -// main.cpp -extern bool AppProcessKeyboardInput(); -extern void InpDIPSWResetDIPs (void); -extern void IpsApplyPatches(UINT8 *, char *); -extern void Reinitialise(void); -extern TCHAR *GetIsoPath(); -extern int VidRecalcPal(); -extern void wav_pause(bool bResume); - -extern TCHAR szAppRomPaths[DIRS_MAX][MAX_PATH]; -// drv.cpp -int DrvInit(int nDrvNum, bool bRestore); -int DrvInitCallback(); -int DrvExit(); - -// progress.cpp -int ProgressUpdateBurner(double dProgress, const TCHAR* pszText, bool bAbs); -void ProgressCreate(); -void ProgressDestroy(); -bool ProgressIsRunning(); - -#ifdef _MSC_VER -#define snprintf _snprintf -#define ANSIToTCHAR(str, foo, bar) (str) -#endif - -extern char *TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int nOutSize); - - -class StringSet { -public: - TCHAR* szText; - int nLen; - // printf function to add text to the Bzip string - int __cdecl Add(TCHAR* szFormat, ...); - int Reset(); - StringSet(); - ~StringSet(); -}; - -extern StringSet BzipText; -extern StringSet BzipDetail; - -#endif diff --git a/jan/src/burner/qt/bzip.cpp b/jan/src/burner/qt/bzip.cpp deleted file mode 100644 index d512d7628..000000000 --- a/jan/src/burner/qt/bzip.cpp +++ /dev/null @@ -1,518 +0,0 @@ -// Burner Zip module -#include "burner.h" - -#include - -int nBzipError = 0; // non-zero if there is a problem with the opened romset - -static TCHAR* szBzipName[BZIP_MAX] = { NULL, }; // Zip files to search through - -struct RomFind { int nState; int nZip; int nPos; }; // State is non-zero if found. 1 = found totally okay. -static struct RomFind* RomFind = NULL; -static int nRomCount = 0; static int nTotalSize = 0; -static struct ZipEntry* List = NULL; static int nListCount = 0; // List of entries for current zip file -static int nCurrentZip = -1; // Zip which is currently open -static int nZipsFound = 0; - -StringSet BzipText; // Text which describes any problems with loading the zip -StringSet BzipDetail; // Text which describes in detail any problems with loading the zip - -int BzipStatus() -{ - if (!(nBzipError & 0x0F0F)) { - return BZIP_STATUS_OK; - } - if (nBzipError & 1) { - return BZIP_STATUS_ERROR; - } - - return BZIP_STATUS_BADDATA; -} - -void BzipListFree() -{ - if (List) { - for (int i = 0; i < nListCount; i++) { - if (List[i].szName) { - free(List[i].szName); - List[i].szName = NULL; - } - } - free(List); - } - - List = NULL; - nListCount = 0; -} - -static char* GetFilenameA(char* szFull) -{ - int nLen = strlen(szFull); - - if (nLen <= 0) { - return szFull; - } - for (int i = nLen - 1; i >= 0; i--) { - if (szFull[i] == '\\' || szFull[i] == '/') { - return szFull + i + 1; - } - } - - return szFull; -} - -static TCHAR* GetFilenameW(TCHAR* szFull) -{ - int nLen = _tcslen(szFull); - - if (nLen <= 0) { - return szFull; - } - for (int i = nLen - 1; i >= 0; i--) { - if (szFull[i] == _T('\\') || szFull[i] == _T('/')) { - return szFull + i + 1; - } - } - - return szFull; -} - -static int FindRomByName(TCHAR* szName) -{ - struct ZipEntry* pl; - int i; - - // Find the rom named szName in the List - for (i = 0, pl = List; i < nListCount; i++, pl++) { - TCHAR szCurrentName[MAX_PATH]; - if (_tcsicmp(szName, GetFilenameW(ANSIToTCHAR(pl->szName, szCurrentName, MAX_PATH))) == 0) { - return i; - } - } - return -1; // couldn't find the rom -} - -static int FindRomByCrc(unsigned int nCrc) -{ - struct ZipEntry* pl; - int i; - - // Find the rom named szName in the List - for (i = 0, pl = List; i< nListCount; i++, pl++) { - if (nCrc == pl->nCrc) { - return i; - } - } - - return -1; // couldn't find the rom -} - -// Find rom number i from the pBzipDriver game -static int FindRom(int i) -{ - struct BurnRomInfo ri; - int nRet; - - memset(&ri, 0, sizeof(ri)); - - nRet = BurnDrvGetRomInfo(&ri, i); - if (nRet != 0) { // Failure: no such rom - return -2; - } - - if (ri.nCrc) { // Search by crc first - nRet = FindRomByCrc(ri.nCrc); - if (nRet >= 0) { - return nRet; - } - } - - for (int nAka = 0; nAka < 0x10000; nAka++) { // Failing that, search for possible names - char *szPossibleName = NULL; - - nRet = BurnDrvGetRomName(&szPossibleName, i, nAka); - if (nRet) { // No more rom names - break; - } - nRet = FindRomByName(ANSIToTCHAR(szPossibleName, NULL, 0)); - if (nRet >= 0) { - return nRet; - } - } - - return -1; // Couldn't find the rom -} - -static int RomDescribe(StringSet* pss, struct BurnRomInfo* pri) -{ - pss->Add(_T("The ")); - if (pri->nType & 0x10) { - pss->Add(_T("essential ")); - } - if (pri->nType & 0x80) { - pss->Add(_T("BIOS ")); - } - if (pri->nType & 0x01) { - pss->Add(_T("graphics ")); - } - if (pri->nType & 0x02) { - pss->Add(_T("sound ")); - } - pss->Add(_T("ROM ")); - - return 0; -} - -static int CheckRomsBoot() -{ - for (int i = 0; i < nRomCount; i++) { - struct BurnRomInfo ri; - int nState; - - memset(&ri, 0, sizeof(ri)); - BurnDrvGetRomInfo(&ri, i); // Find information about the wanted rom - nState = RomFind[i].nState; // Get the state of the rom in the zip file - - if (nState != 1 && ri.nType && ri.nCrc) { - if (ri.nType & 0x80) { - return 2; - } - return 1; - } - } - - return 0; -} - -static int GetBZipError(int nState) -{ - switch (nState) { - case 1: // OK - return 0x00; - case 0: // Not present - return 0x01; - case 3: // Incomplete - return 0x01; - default: // CRC wrong or too large - return 0x10; - } - - return 0x10; -} - -// Check the roms to see if they code, graphics etc are complete -static int CheckRoms() -{ - nBzipError = 0; // Assume romset is fine - - for (int i = 0; i < nRomCount; i++) { - struct BurnRomInfo ri; - - memset(&ri, 0, sizeof(ri)); - BurnDrvGetRomInfo(&ri, i); // Find information about the wanted rom - if (ri.nCrc && (ri.nType & 0x80) == 0) { - int nState = RomFind[i].nState; // Get the state of the rom in the zip file - - if (nState == 0 && ri.nType) { // (A type of 0 means empty slot - no rom) - char* szName = "Unknown"; - RomDescribe(&BzipDetail, &ri); - BurnDrvGetRomName(&szName, i, 0); - BzipDetail.Add(_T("%hs was not found.\n"), szName); - } - - if (ri.nType & 0x90) { // essential rom - without it the game may not run at all - nBzipError |= GetBZipError(nState) << 0; - } - if (ri.nType & 0x01) { // rom which contains graphics information - nBzipError |= GetBZipError(nState) << 1; - } - if (ri.nType & 0x02) { // rom which contains sound information - nBzipError |= GetBZipError(nState) << 2; - } - } - } - - if (!nZipsFound) { - nBzipError |= 0x08; // No data at all! - } - - return 0; -} - -static int __cdecl BzipBurnLoadRom(unsigned char* Dest, int* pnWrote, int i) -{ -#if defined (BUILD_WIN32) - MSG Msg; -#endif - - struct BurnRomInfo ri; - int nWantZip = 0; - TCHAR szText[128]; - char* pszRomName = NULL; - int nRet = 0; - - if (i < 0 || i >= nRomCount) { - return 1; - } - - ri.nLen = 0; - BurnDrvGetRomInfo(&ri, i); // Get info - - // show what we're doing - BurnDrvGetRomName(&pszRomName, i, 0); - if (pszRomName == NULL) { - pszRomName = "unknown"; - } - _stprintf(szText, _T("Loading")); - if (ri.nType & 0x83) { - if (ri.nType & 0x80) { - _stprintf (szText + _tcslen(szText), _T(" %s"), _T("BIOS ")); - } - if (ri.nType & 0x10) { - _stprintf (szText + _tcslen(szText), _T(" %s"), _T("program ")); - } - if (ri.nType & 0x01) { - _stprintf (szText + _tcslen(szText), _T(" %s"), _T("graphics ")); - } - if (ri.nType & 0x02) { - _stprintf (szText + _tcslen(szText), _T(" %s"), _T("sound ")); - } - _stprintf(szText + _tcslen(szText), _T("(%hs)..."), pszRomName); - } else { - _stprintf(szText + _tcslen(szText), _T(" %hs..."), pszRomName); - } - - ProgressUpdateBurner(ri.nLen ? 1.0 / ((double)nTotalSize / ri.nLen) : 0, szText, 0); - -#if defined (BUILD_WIN32) - // Check for messages: - while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) { - DispatchMessage(&Msg); - } -#endif - - if (RomFind[i].nState == 0) { // Rom not found in zip at all - return 1; - } - - nWantZip = RomFind[i].nZip; // Which zip file it is in - if (nCurrentZip != nWantZip) { // If we haven't got the right zip file currently open - ZipClose(); - nCurrentZip = -1; - if (ZipOpen(TCHARToANSI(szBzipName[nWantZip], NULL, 0))) { - return 1; - } - nCurrentZip = nWantZip; - } - - // Read in file and return how many bytes we read - if (ZipLoadFile(Dest, ri.nLen, pnWrote, RomFind[i].nPos)) { - // Error loading from the zip file - TCHAR szTemp[128] = _T(""); - _stprintf(szTemp, _T("%s reading %.30hs from %.30s"), nRet == 2 ? _T("CRC error") : _T("Error"), pszRomName, GetFilenameW(szBzipName[nCurrentZip])); -// AppError(szTemp, 1); - return 1; - } - - return 0; -} - -int BzipOpen(bool bootApp) -{ - int nMemLen; // Zip name number - - nZipsFound = 0; // Haven't found zips yet - nTotalSize = 0; - - if (szBzipName == NULL) { - return 1; - } - - BzipClose(); // Make sure nothing is open - - if(!bootApp) { // reset information strings - BzipText.Reset(); - BzipDetail.Reset(); - } - - // Count the number of roms needed - for (nRomCount = 0; ; nRomCount++) { - if (BurnDrvGetRomInfo(NULL, nRomCount)) { - break; - } - } - if (nRomCount <= 0) { - return 1; - } - - // Create an array for holding lookups for each rom -> zip entries - nMemLen = nRomCount * sizeof(struct RomFind); - RomFind = (struct RomFind*)malloc(nMemLen); - if (RomFind == NULL) { - return 1; - } - memset(RomFind, 0, nMemLen); - - for (int z = 0; z < BZIP_MAX; z++) { - char* szName = NULL; - - if (BurnDrvGetZipName(&szName, z)) { - break; - } - - for (int d = 0; d < DIRS_MAX; d++) { - free(szBzipName[z]); - szBzipName[z] = (TCHAR*)malloc(MAX_PATH * sizeof(TCHAR)); - - _stprintf(szBzipName[z], _T("%s%hs"), szAppRomPaths[d], szName); - - if (ZipOpen(TCHARToANSI(szBzipName[z], NULL, 0)) == 0) { // Open the rom zip file - nZipsFound++; - nCurrentZip = z; - break; - } - } - - if (nCurrentZip >= 0) { - if (!bootApp) { - BzipText.Add(_T("Found %s;\n"), szBzipName[z]); - } - ZipGetList(&List, &nListCount); // Get the list of entries - - for (int i = 0; i < nRomCount; i++) { - struct BurnRomInfo ri; - int nFind; - - if (RomFind[i].nState == 1) { // Already found this and it's okay - continue; - } - - memset(&ri, 0, sizeof(ri)); - - nFind = FindRom(i); - - if (nFind < 0) { // Couldn't find this rom at all - continue; - } - - RomFind[i].nZip = z; // Remember which zip file it is in - RomFind[i].nPos = nFind; - RomFind[i].nState = 1; // Set to found okay - - BurnDrvGetRomInfo(&ri, i); // Get info about the rom - - if ((ri.nType & 0x80) == 0) { - nTotalSize += ri.nLen; - } - - if (List[nFind].nLen == ri.nLen) { - if (ri.nCrc) { // If we know the CRC - if (List[nFind].nCrc != ri.nCrc) { // Length okay, but CRC wrong - RomFind[i].nState = 2; - } - } - } else { - if (List[nFind].nLen < ri.nLen) { - RomFind[i].nState = 3; // Too small - } else { - RomFind[i].nState = 4; // Too big - } - } - - if (!bootApp) { - if (RomFind[i].nState != 1) { - RomDescribe(&BzipDetail, &ri); - - if (RomFind[i].nState == 2) { - BzipDetail.Add(_T("%hs has a CRC of %.8X. (It should be %.8X.)\n"), GetFilenameA(List[nFind].szName), List[nFind].nCrc, ri.nCrc); - } - if (RomFind[i].nState == 3) { - BzipDetail.Add(_T("%hs is %dk which is incomplete. (It should be %dkB.)\n"), GetFilenameA(List[nFind].szName), List[nFind].nLen >> 10, ri.nLen >> 10); - } - if (RomFind[i].nState == 4) { - BzipDetail.Add(_T("%hs is %dk which is too big. (It should be %dkB.)\n"), GetFilenameA(List[nFind].szName), List[nFind].nLen >> 10, ri.nLen >> 10); - } - } - } - } - - BzipListFree(); - - } else { - if (!bootApp) { - BzipText.Add(_T("Couldn't find %hs;\n"), szName); - } - } - - ZipClose(); // Close the last zip file if open - nCurrentZip = -1; - } - - if (!bootApp) { - // Check the roms to see if they code, graphics etc are complete - CheckRoms(); - - if (nZipsFound) { - if (nBzipError == 0) { - BzipText.Add(_T("The romset is fine.\n")); - } - - if (nBzipError & 0x07) { - BzipText.Add(_T("However the romset is INCOMPLETE.\n")); - } - - if (nBzipError & 0x01) { - BzipText.Add(_T("Essential rom data is missing; the game probably won't run.\n")); - } else { - if (nBzipError & 0x10) { - BzipText.Add(_T("Some essential roms are different. ")); - } - } - if (nBzipError & 0x02) { - BzipText.Add(_T("Graphical data is missing. ")); - } else { - if (nBzipError & 0x20) { - BzipText.Add(_T("Some graphics roms are different. ")); - } - } - if (nBzipError & 0x04) { - BzipText.Add(_T("Sound data is missing. ")); - } else { - if (nBzipError & 0x40) { - BzipText.Add(_T("Some sound roms are different. ")); - } - } - - if (nBzipError & 0x76) { - BzipText.Add(_T("\n")); - } - } - - BurnExtLoadRom = BzipBurnLoadRom; // Okay to call our function to load each rom - - } else { - return CheckRomsBoot(); - } - - return 0; -} - -int BzipClose() -{ - ZipClose(); - nCurrentZip = -1; // Close the last zip file if open - - BurnExtLoadRom = NULL; // Can't call our function to load each rom anymore - nBzipError = 0; // reset romset errors - - free(RomFind); - RomFind = NULL; - nRomCount = 0; - - for (int z = 0; z < BZIP_MAX; z++) { - free(szBzipName[z]); - szBzipName[z] = NULL; - } - - return 0; -} diff --git a/jan/src/burner/qt/dipswitchdialog.cpp b/jan/src/burner/qt/dipswitchdialog.cpp deleted file mode 100644 index df806ef88..000000000 --- a/jan/src/burner/qt/dipswitchdialog.cpp +++ /dev/null @@ -1,196 +0,0 @@ -#include -#include "dipswitchdialog.h" -#include "ui_dipswitchdialog.h" -#include "burner.h" - -DipswitchDialog::DipswitchDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::DipswitchDialog) -{ - ui->setupUi(this); - setWindowTitle("DIPSwitches"); - connect(ui->tvSettings, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), - this, SLOT(dipChange(QTreeWidgetItem*,QTreeWidgetItem*))); - connect(ui->cbValues, SIGNAL(currentIndexChanged(int)), this, SLOT(dipValueChange(int))); - connect(ui->btnDefault, SIGNAL(clicked()), this, SLOT(reset())); - m_dipGroup = 0; - m_dipChanging = false; -} - -DipswitchDialog::~DipswitchDialog() -{ - delete ui; -} - -int DipswitchDialog::exec() -{ - getDipOffset(); - makeList(); - int ret = QDialog::exec(); - return ret; -} - -void DipswitchDialog::reset() -{ - int i = 0; - BurnDIPInfo bdi; - struct GameInp* pgi; - - getDipOffset(); - - while (BurnDrvGetDIPInfo(&bdi, i) == 0) { - if (bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + m_dipOffset; - pgi->Input.Constant.nConst = (pgi->Input.Constant.nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); - } - i++; - } - - makeList(); -} - -void DipswitchDialog::dipChange(QTreeWidgetItem *item, QTreeWidgetItem *prev) -{ - if (item == nullptr) - return; - - m_dipGroup = item->data(0, Qt::UserRole).toInt(); - - BurnDIPInfo bdiGroup; - BurnDrvGetDIPInfo(&bdiGroup, m_dipGroup); - - qDebug() << "DIP Change" << bdiGroup.szText; - m_dipChanging = true; - ui->cbValues->clear(); - - int nCurrentSetting = 0; - for (int i = 0, j = 0; i < bdiGroup.nSetting; i++) { - TCHAR szText[256]; - BurnDIPInfo bdi; - - do { - BurnDrvGetDIPInfo(&bdi, m_dipGroup + 1 + j++); - } while (bdi.nFlags == 0); - - if (bdiGroup.szText) { - _stprintf(szText, _T("%hs: %hs"), bdiGroup.szText, bdi.szText); - } else { - _stprintf(szText, _T("%hs"), bdi.szText); - } - ui->cbValues->insertItem(i, szText); - - if (checkSetting(m_dipGroup + j)) { - nCurrentSetting = i; - } - } - ui->cbValues->setCurrentIndex(nCurrentSetting); - m_dipChanging = false; -} - -void DipswitchDialog::dipValueChange(int index) -{ - if (ui->cbValues->count() <= 0 || m_dipChanging) - return; - - BurnDIPInfo bdi = {0, 0, 0, 0, NULL}; - struct GameInp *pgi; - int j = 0, k = 0; - for (int i = 0; i <= index; i++) { - do { - BurnDrvGetDIPInfo(&bdi, m_dipGroup + 1 + j++); - } while (bdi.nFlags == 0); - } - pgi = GameInp + bdi.nInput + m_dipOffset; - pgi->Input.Constant.nConst = (pgi->Input.Constant.nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); - if (bdi.nFlags & 0x40) { - while (BurnDrvGetDIPInfo(&bdi, m_dipGroup + 1 + j++) == 0) { - if (bdi.nFlags == 0) { - pgi = GameInp + bdi.nInput + m_dipOffset; - pgi->Input.Constant.nConst = (pgi->Input.Constant.nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); - } else { - break; - } - } - } - - QTreeWidgetItem *item = ui->tvSettings->currentItem(); - item->setText(1, bdi.szText); -} - -bool DipswitchDialog::checkSetting(int i) -{ - BurnDIPInfo bdi; - BurnDrvGetDIPInfo(&bdi, i); - struct GameInp* pgi = GameInp + bdi.nInput + m_dipOffset; - - if ((pgi->Input.Constant.nConst & bdi.nMask) == bdi.nSetting) { - unsigned char nFlags = bdi.nFlags; - if ((nFlags & 0x0F) <= 1) { - return true; - } else { - for (int j = 1; j < (nFlags & 0x0F); j++) { - BurnDrvGetDIPInfo(&bdi, i + j); - pgi = GameInp + bdi.nInput + m_dipOffset; - if (nFlags & 0x80) { - if ((pgi->Input.Constant.nConst & bdi.nMask) == bdi.nSetting) { - return false; - } - } else { - if ((pgi->Input.Constant.nConst & bdi.nMask) != bdi.nSetting) { - return false; - } - } - } - return true; - } - } - return false; -} - -void DipswitchDialog::getDipOffset() -{ - BurnDIPInfo bdi; - m_dipOffset = 0; - for (int i = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++) { - if (bdi.nFlags == 0xF0) { - m_dipOffset = bdi.nInput; - break; - } - } -} - -void DipswitchDialog::makeList() -{ - clearList(); - BurnDIPInfo bdi; - unsigned int i = 0, j = 0, k = 0; - char* pDIPGroup = NULL; - while (BurnDrvGetDIPInfo(&bdi, i) == 0) { - if ((bdi.nFlags & 0xF0) == 0xF0) { - if (bdi.nFlags == 0xFE || bdi.nFlags == 0xFD) { - pDIPGroup = bdi.szText; - k = i; - } - i++; - } else { - if (checkSetting(i)) { - QTreeWidgetItem *item = new QTreeWidgetItem(); - - item->setText(0, pDIPGroup); - item->setText(1, bdi.szText); - item->setData(0, Qt::UserRole, k); - item->setData(1, Qt::UserRole, k); - ui->tvSettings->addTopLevelItem(item); - j++; - } - i += (bdi.nFlags & 0x0F); - } - } - -} - -void DipswitchDialog::clearList() -{ - while (ui->tvSettings->topLevelItemCount() > 0) - ui->tvSettings->takeTopLevelItem(0); -} diff --git a/jan/src/burner/qt/dipswitchdialog.h b/jan/src/burner/qt/dipswitchdialog.h deleted file mode 100644 index 776c4d352..000000000 --- a/jan/src/burner/qt/dipswitchdialog.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef DIPSWITCHDIALOG_H -#define DIPSWITCHDIALOG_H - -#include -#include - -namespace Ui { -class DipswitchDialog; -} - -class DipswitchDialog : public QDialog -{ - Q_OBJECT - -public: - explicit DipswitchDialog(QWidget *parent = 0); - ~DipswitchDialog(); - -public slots: - int exec(); - void reset(); - void dipChange(QTreeWidgetItem * item, QTreeWidgetItem * prev); - void dipValueChange(int index); -private: - bool checkSetting(int i); - void getDipOffset(); - void makeList(); - void clearList(); - Ui::DipswitchDialog *ui; - unsigned m_dipOffset; - unsigned m_dipGroup; - bool m_dipChanging; -}; - -#endif // DIPSWITCHDIALOG_H diff --git a/jan/src/burner/qt/dipswitchdialog.ui b/jan/src/burner/qt/dipswitchdialog.ui deleted file mode 100644 index c9fb92d40..000000000 --- a/jan/src/burner/qt/dipswitchdialog.ui +++ /dev/null @@ -1,96 +0,0 @@ - - - DipswitchDialog - - - - 0 - 0 - 555 - 374 - - - - Dialog - - - - - - QAbstractScrollArea::AdjustToContents - - - true - - - - DIPSwitch - - - - - Setting - - - - - - - - - - - - - Defaults - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Ok - - - - - - - - - - - btnOk - clicked() - DipswitchDialog - accept() - - - 477 - 355 - - - 290 - 359 - - - - - diff --git a/jan/src/burner/qt/driver.cpp b/jan/src/burner/qt/driver.cpp deleted file mode 100644 index e5506823b..000000000 --- a/jan/src/burner/qt/driver.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// Driver Init module -#include "burner.h" -#include - -int bDrvOkay = 0; // 1 if the Driver has been initted okay, and it's okay to use the BurnDrv functions - -static int DrvBzipOpen() -{ - BzipOpen(false); - - if (BzipStatus()) - return 1; - return 0; -} - -static int DoLibInit() // Do Init of Burn library driver -{ - int nRet = 0; - - if (DrvBzipOpen()) { - return 1; - } - ProgressCreate(); - nRet = BurnDrvInit(); - - BzipClose(); - - ProgressDestroy(); - - if (nRet) { - return 3; - } else { - return 0; - } -} - -// Catch calls to BurnLoadRom() once the emulation has started; -// Intialise the zip module before forwarding the call, and exit cleanly. -static int __cdecl DrvLoadRom(unsigned char* Dest, int* pnWrote, int i) -{ - int nRet; - - BzipOpen(false); - - if ((nRet = BurnExtLoadRom(Dest, pnWrote, i)) != 0) { - char* pszFilename; - - BurnDrvGetRomName(&pszFilename, i, 0); - } - - BzipClose(); - return nRet; -} - -int DrvInit(int nDrvNum, bool bRestore) -{ - int nStatus; - bDrvOkay = 0; - - DrvExit(); // Make sure exitted - nBurnDrvActive = nDrvNum; // Set the driver number - - nMaxPlayers = BurnDrvGetMaxPlayers(); - GameInpInit(); // Init game input - if (ConfigGameLoad(true)) { - ConfigGameLoadHardwareDefaults(); - } - InputMake(true); - GameInpDefault(); - - nStatus = DoLibInit(); // Init the Burn library's driver - if (nStatus) { - if (nStatus & 2) { - BurnDrvExit(); // Exit the driver - } - return 1; - } - - - - BurnExtLoadRom = DrvLoadRom; - - bDrvOkay = 1; // Okay to use all BurnDrv functions - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - bVidArcaderes = bVidArcaderesVer; - nVidWidth = nVidVerWidth; - nVidHeight = nVidVerHeight; - } else { - bVidArcaderes = bVidArcaderesHor; - nVidWidth = nVidHorWidth; - nVidHeight = nVidHorHeight; - } - - nBurnLayer = 0xFF; // show all layers - - // Reset the speed throttling code, so we don't 'jump' after the load - //RunReset(); - VidExit(); - return 0; -} - -int DrvInitCallback() -{ - return DrvInit(nBurnDrvActive, false); -} - -int DrvExit() -{ - if (bDrvOkay) { - ConfigGameSave(bSaveInputs); - GameInpExit(); - BurnDrvExit(); // Exit the driver - } - - BurnExtLoadRom = NULL; - bDrvOkay = 0; // Stop using the BurnDrv functions - bRunPause = 0; // Don't pause when exitted - nBurnDrvActive = ~0U; // no driver selected - return 0; -} - diff --git a/jan/src/burner/qt/emuworker.cpp b/jan/src/burner/qt/emuworker.cpp deleted file mode 100644 index d7eb4e095..000000000 --- a/jan/src/burner/qt/emuworker.cpp +++ /dev/null @@ -1,128 +0,0 @@ -#include -#include "emuworker.h" -#include "burner.h" - -static int GetInput(bool bCopy); -static int RunFrame(int bDraw, int bPause); -static int RunGetNextSound(int bDraw); - -EmuWorker::EmuWorker(QObject *parent) : - QObject(parent) -{ - m_isRunning = false; -} - -bool EmuWorker::init() -{ - AudSoundStop(); - - if (bDrvOkay) - DrvExit(); - - // we need to initialize sound first - AudSoundInit(); - AudSetCallback(RunGetNextSound); - bAudOkay = 1; - - DrvInit(m_game, false); - if (!bDrvOkay) - return false; - - VidInit(); - - return true; -} - -void EmuWorker::resume() -{ - AudSoundPlay(); - if (!bDrvOkay) { - m_isRunning = false; - return; - } - m_isRunning = true; -} - - -void EmuWorker::close() -{ - AudSoundStop(); - DrvExit(); -} - -void EmuWorker::pause() -{ - m_isRunning = false; -} - -void EmuWorker::setGame(int no) -{ - m_game = no; -} - -void EmuWorker::run() -{ - if (m_isRunning && bDrvOkay) { - AudSoundCheck(); - } -} - -int GetInput(bool bCopy) -{ - InputMake(bCopy); // get input - return 0; -} - -int RunFrame(int bDraw, int bPause) -{ - static int bPrevPause = 0; - static int bPrevDraw = 0; - - if (bPrevDraw && !bPause) { - VidPaint(0); // paint the screen (no need to validate) - } - - if (!bDrvOkay) { - return 1; - } - - if (bPause) - { - GetInput(false); // Update burner inputs, but not game inputs - if (bPause != bPrevPause) - { - VidPaint(2); // Redraw the screen (to ensure mode indicators are updated) - } - } - else - { - nFramesEmulated++; - nCurrentFrame++; - GetInput(true); // Update inputs - } - if (bDraw) { - nFramesRendered++; - if (VidFrame()) { // Do one frame - AudBlankSound(); - } - } - else { // frame skipping - pBurnDraw = NULL; // Make sure no image is drawn - BurnDrvFrame(); - } - bPrevPause = bPause; - bPrevDraw = bDraw; - - return 0; -} - -int RunGetNextSound(int bDraw) -{ - if (nAudNextSound == NULL) { - return 1; - } - // Render frame with sound - pBurnSoundOut = nAudNextSound; - RunFrame(bDraw, 0); - return 0; -} diff --git a/jan/src/burner/qt/emuworker.h b/jan/src/burner/qt/emuworker.h deleted file mode 100644 index 9f44f21ca..000000000 --- a/jan/src/burner/qt/emuworker.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef EMUWORKER_H -#define EMUWORKER_H - -#include - -class EmuWorker : public QObject -{ - Q_OBJECT -public: - explicit EmuWorker(QObject *parent = 0); - -signals: - -public slots: - bool init(); - void resume(); - void close(); - void pause(); - void setGame(int no); - void run(); -private: - int m_game; - bool m_isRunning; -}; - -#endif // EMUWORKER_H diff --git a/jan/src/burner/qt/inputdialog.cpp b/jan/src/burner/qt/inputdialog.cpp deleted file mode 100644 index 8a279477f..000000000 --- a/jan/src/burner/qt/inputdialog.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include -#include "inputdialog.h" -#include "ui_inputdialog.h" -#include "burner.h" - -InputDialog::InputDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::InputDialog) -{ - ui->setupUi(this); - ui->tvInputs->setColumnWidth(0, 200); - ui->tvInputs->setColumnWidth(1, 200); - - setWindowTitle("Map Game Inputs"); - - m_hexEditor = new HexSpinDialog(this); - m_inputSet = new InputSetDialog(this); - - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), this, SLOT(updateInputs())); - m_timer->setInterval(30); - - connect(ui->tvInputs, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), - this, SLOT(inputEdit(QTreeWidgetItem*,int))); -} - -InputDialog::~InputDialog() -{ - delete ui; -} - -int InputDialog::exec() -{ - makeList(); - m_timer->start(); - QDialog::exec(); - m_timer->stop(); -} - -void InputDialog::updateInputs() -{ - InputMake(true); - - for (int i = 0; i < ui->tvInputs->topLevelItemCount(); i++) { - QTreeWidgetItem *item = ui->tvInputs->topLevelItem(i); - struct GameInp *pgi = GameInp; - - pgi += item->data(0, Qt::UserRole).toInt(); - - if (pgi->nType == 0) - continue; - - int value = pgi->Input.nVal; - int lastValue = item->data(2, Qt::UserRole).toInt(); - - if (value == lastValue) - continue; - - switch (pgi->nType) { - case BIT_DIGITAL: - if (value) - item->setText(2, "ON"); - else - item->setText(2, ""); - break; - } - item->setData(2, Qt::UserRole, value); - } -} - -void InputDialog::inputEdit(QTreeWidgetItem *item, int column) -{ - struct GameInp *pgi = GameInp; - - pgi += item->data(0, Qt::UserRole).toInt(); - - switch (pgi->nType) { - case BIT_DIPSWITCH: { - if (pgi->nInput & BIT_GROUP_CONSTANT) - break; - - m_hexEditor->setValue(pgi->Input.nVal); - m_hexEditor->exec(); - - pgi->nInput = GIT_CONSTANT; - pgi->Input.Constant.nConst = (m_hexEditor->value() & 0xFF); - auto value = InpToDesc(pgi); - item->setText(1, value); - break; - } - default: { - m_inputSet->setInput(item->data(0, Qt::UserRole).toInt()); - m_inputSet->exec(); - break; - } - } -} - -void InputDialog::makeList() -{ - static const QColor dipColor(255, 255, 210); - clear(); - - struct GameInp *pgi = GameInp; - - // Add all the input names to the list - for (unsigned int i = 0; i < nGameInpCount; i++) { - struct BurnInputInfo bii; - - // Get the name of the input - bii.szName = nullptr; - BurnDrvGetInputInfo(&bii, i); - - // skip unused inputs - if (bii.pVal == nullptr) - continue; - - if (bii.szName == nullptr) - bii.szName = ""; - - QTreeWidgetItem *item = new QTreeWidgetItem(); - item->setData(0, Qt::UserRole, i); - item->setData(2, Qt::UserRole, 0); - - if (pgi->nType == BIT_DIPSWITCH) { - for (int j = 0; j < ui->tvInputs->columnCount(); j++) - item->setBackgroundColor(j, dipColor); - } - - item->setText(0, bii.szName); - - if (pgi->Input.pVal != nullptr) { - auto value = InpToDesc(pgi); - item->setText(1, value); - } - - ui->tvInputs->addTopLevelItem(item); - pgi++; - } -} - -void InputDialog::clear() -{ - while (ui->tvInputs->topLevelItemCount() > 0) - ui->tvInputs->takeTopLevelItem(0); -} diff --git a/jan/src/burner/qt/inputdialog.h b/jan/src/burner/qt/inputdialog.h deleted file mode 100644 index a3677899b..000000000 --- a/jan/src/burner/qt/inputdialog.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef INPUTDIALOG_H -#define INPUTDIALOG_H - -#include -#include -#include -#include "widgets/hexspinbox.h" -#include "inputsetdialog.h" - -namespace Ui { -class InputDialog; -} - -class InputDialog : public QDialog -{ - Q_OBJECT - -public: - explicit InputDialog(QWidget *parent = 0); - ~InputDialog(); - -public slots: - int exec(); - void updateInputs(); - void inputEdit(QTreeWidgetItem *item, int column); -private: - void makeList(); - void clear(); - Ui::InputDialog *ui; - QTimer *m_timer; - HexSpinDialog *m_hexEditor; - InputSetDialog *m_inputSet; -}; - -#endif // INPUTDIALOG_H diff --git a/jan/src/burner/qt/inputdialog.ui b/jan/src/burner/qt/inputdialog.ui deleted file mode 100644 index 820f2b2d9..000000000 --- a/jan/src/burner/qt/inputdialog.ui +++ /dev/null @@ -1,100 +0,0 @@ - - - InputDialog - - - - 0 - 0 - 573 - 443 - - - - Dialog - - - - - - Double-click an input to change its mapping - - - - - - - false - - - false - - - false - - - true - - - - Game input - - - - - Mapped to - - - - - State - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Ok - - - - - - - - - - - btnOk - clicked() - InputDialog - accept() - - - 495 - 421 - - - 440 - 435 - - - - - diff --git a/jan/src/burner/qt/inputsetdialog.cpp b/jan/src/burner/qt/inputsetdialog.cpp deleted file mode 100644 index 2496d4051..000000000 --- a/jan/src/burner/qt/inputsetdialog.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include "inputsetdialog.h" -#include "ui_inputsetdialog.h" -#include "burner.h" - - -InputSetDialog::InputSetDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::InputSetDialog) -{ - ui->setupUi(this); - - m_timer = new QTimer(this); - m_timer->setInterval(10); - m_state = 0; - connect(m_timer, SIGNAL(timeout()), this, SLOT(updateInputs())); -} - -InputSetDialog::~InputSetDialog() -{ - delete ui; -} - -void InputSetDialog::setInput(int i) -{ - m_input = i; - - struct BurnInputInfo bii; - BurnDrvGetInputInfo(&bii, i); - - ui->txtInput->setText(bii.szName); -} - -int InputSetDialog::exec() -{ - m_lastFound = 0; - ui->lblInfo->setText(""); - m_timer->start(); - int ret = QDialog::exec(); - m_timer->stop(); - return ret; -} - -void InputSetDialog::updateInputs() -{ - struct GameInp *pgi = GameInp; - pgi += m_input; - - int i = InputFind(4); - - if (i != m_lastFound) { - - if (i != -1) { - struct GameInp mpgi; - - memcpy(&mpgi, pgi, sizeof(struct GameInp)); - mpgi.Input.Constant.nConst = i; - - auto str = InpToDesc(&mpgi); - ui->lblInfo->setText(str); - } - else - { - ui->lblInfo->setText(""); - } - m_lastFound = i; - } -} diff --git a/jan/src/burner/qt/inputsetdialog.h b/jan/src/burner/qt/inputsetdialog.h deleted file mode 100644 index 6005ecd53..000000000 --- a/jan/src/burner/qt/inputsetdialog.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef INPUTSETDIALOG_H -#define INPUTSETDIALOG_H - -#include -#include - -namespace Ui { -class InputSetDialog; -} - -class InputSetDialog : public QDialog -{ - Q_OBJECT - -public: - explicit InputSetDialog(QWidget *parent = 0); - ~InputSetDialog(); - - void setInput(int i); - - int exec(); -public slots: - void updateInputs(); -private: - int m_state; - int m_lastFound; - int m_input; - Ui::InputSetDialog *ui; - QTimer *m_timer; -}; - -#endif // INPUTSETDIALOG_H diff --git a/jan/src/burner/qt/inputsetdialog.ui b/jan/src/burner/qt/inputsetdialog.ui deleted file mode 100644 index 8c521203f..000000000 --- a/jan/src/burner/qt/inputsetdialog.ui +++ /dev/null @@ -1,87 +0,0 @@ - - - InputSetDialog - - - - 0 - 0 - 362 - 151 - - - - Dialog - - - - - - - - Grab Mouse - - - - - - - Activate - - - - - - - Cancel - - - - - - - - - - - Qt::AlignCenter - - - true - - - - - - - - - - Qt::AlignCenter - - - - - - - - - - - btnCancel - clicked() - InputSetDialog - reject() - - - 69 - 116 - - - 73 - 147 - - - - - diff --git a/jan/src/burner/qt/logdialog.cpp b/jan/src/burner/qt/logdialog.cpp deleted file mode 100644 index 52e8d6e16..000000000 --- a/jan/src/burner/qt/logdialog.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include -#include -#include "logdialog.h" -#include "ui_logdialog.h" -#include "burner.h" - -LogDialog *LogDialog::m_instance = nullptr; - -LogDialog::LogDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::LogDialog) -{ - ui->setupUi(this); - setWindowTitle("Messages"); - bprintf = &LogDialog::qprintf; -} - -LogDialog::~LogDialog() -{ - delete ui; - m_instance = nullptr; -} - -INT32 LogDialog::qprintf(INT32 level, TCHAR *fmt, ...) -{ - - LogDialog *p = LogDialog::get(); - if (!p) - return 0; - - static const QColor colorLevels[4] = { - QColor( 0, 0, 0), - QColor( 0, 0, 127), - QColor( 0, 127, 0), - QColor(127, 0, 0) - }; - if (level >= 4) - level = 0; - - const int maxBuffer = 1024; - char strBuffer[maxBuffer]; - - va_list args; - va_start (args, fmt); - ::vsnprintf(strBuffer, maxBuffer, fmt, args); - va_end(args); - - p->ui->teLogger->setTextColor(colorLevels[level]); - p->ui->teLogger->append(strBuffer); - return 1; -} - -LogDialog *LogDialog::get(QWidget *parent) -{ - if (!m_instance) - m_instance = new LogDialog(parent); - return m_instance; -} - diff --git a/jan/src/burner/qt/logdialog.h b/jan/src/burner/qt/logdialog.h deleted file mode 100644 index 5aeedbef4..000000000 --- a/jan/src/burner/qt/logdialog.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef LOGDIALOG_H -#define LOGDIALOG_H - -#include -#include -#include "burner.h" - -namespace Ui { -class LogDialog; -} - -class LogDialog : public QDialog -{ - Q_OBJECT - explicit LogDialog(QWidget *parent = 0); - static LogDialog *m_instance; -public: - ~LogDialog(); - - static LogDialog *get(QWidget *parent = 0); - static INT32 qprintf(INT32 level, TCHAR *fmt, ...); -private: - Ui::LogDialog *ui; -}; - - -#endif // LOGDIALOG_H diff --git a/jan/src/burner/qt/logdialog.ui b/jan/src/burner/qt/logdialog.ui deleted file mode 100644 index da8b7fad8..000000000 --- a/jan/src/burner/qt/logdialog.ui +++ /dev/null @@ -1,92 +0,0 @@ - - - LogDialog - - - - 0 - 0 - 565 - 388 - - - - Dialog - - - - - - true - - - - - - - - - Clear - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Ok - - - - - - - - - - - btnOk - clicked() - LogDialog - accept() - - - 498 - 365 - - - 412 - 373 - - - - - btnClear - clicked() - teLogger - clear() - - - 53 - 360 - - - 145 - 286 - - - - - diff --git a/jan/src/burner/qt/main.cpp b/jan/src/burner/qt/main.cpp deleted file mode 100644 index 663180248..000000000 --- a/jan/src/burner/qt/main.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include -#include "burner.h" -#include "mainwindow.h" - -int bRunPause = 0; -bool bAlwaysProcessKeyboardInput; -bool bDoIpsPatch; - -TCHAR szAppBurnVer[16]; -TCHAR szAppBlendPath[MAX_PATH]; - -int nAppVirtualFps = 6000; - -TCHAR *GetIsoPath() -{ - return NULL; -} - - -void IpsApplyPatches(UINT8 *, char *) -{ - -} - -void InpDIPSWResetDIPs() -{ -} - - -void Reinitialise(void) -{ - -} - -void wav_pause(bool bResume) -{ - -} - -void wav_exit() -{ - -} - -bool AppProcessKeyboardInput() -{ - return true; -} - -char *TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int nOutSize) -{ - if (pszOutString) { - strcpy(pszOutString, pszInString); - return pszOutString; - } - - return (char*)pszInString; -} - - -QString loadAppStyle(const QString &name) -{ - QFile file(name); - file.open(QFile::ReadOnly); - - return QString(file.readAll()); -} - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - app.setStyleSheet(loadAppStyle(":/resource/dark-flat.css")); - - MainWindow mw; - mw.show(); - - return mw.main(app); -} diff --git a/jan/src/burner/qt/mainwindow.cpp b/jan/src/burner/qt/mainwindow.cpp deleted file mode 100644 index 4b4a04d23..000000000 --- a/jan/src/burner/qt/mainwindow.cpp +++ /dev/null @@ -1,268 +0,0 @@ -#include -#ifdef Q_OS_MACX -#include -#else -#include -#endif -#include "mainwindow.h" -#include "burner.h" -#include "selectdialog.h" -#include "version.h" - -MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent) -{ - - createDefaultDirs(); - - BurnLibInit(); - createActions(); - createMenus(); - createControls(); - - setWindowTitle(QString("FBAlpha %1.%2.%3.%4") - .arg(VER_MAJOR) - .arg(VER_MINOR) - .arg(VER_BETA) - .arg(VER_ALPHA)); - - connectActions(); - - m_logo = QImage(":/resource/splash.bmp"); - - m_isRunning = false; - InputInit(); - - show(); - -} - -MainWindow::~MainWindow() -{ - BurnLibExit(); - AudSoundStop(); - AudSoundExit(); -} - -int MainWindow::main(QApplication &app) -{ - m_closeApp = false; - while (!m_closeApp) { - if (m_isRunning) { - app.processEvents(); - m_emulation->run(); - } else { - app.processEvents(); - QThread::msleep(10); - } - } - return 0; -} - -void MainWindow::loadGame() -{ - int ret = m_selectDlg->exec(); - if (ret != QDialog::Accepted) { - return; - } - m_emulation->pause(); - m_emulation->setGame(m_selectDlg->selectedDriver()); - bool okay = m_emulation->init(); - - if (!okay) { - QStringList str; - str << BzipText.szText << BzipDetail.szText; - QMessageBox::critical(this, "Error", str.join("\n")); - return; - } - m_isRunning = true; - enableInGame(); - m_emulation->resume(); -} - - -void MainWindow::exitEmulator() -{ - close(); -} - -void MainWindow::closeGame() -{ - if (bDrvOkay) { - m_emulation->close(); - disableInGame(); - m_isRunning = false; - drawLogo(); - } -} - -void MainWindow::setupInputInterface(QAction *action) -{ - InputExit(); - nInputSelect = action->data().toInt(); - InputInit(); -} - -void MainWindow::toogleMenu() -{ - if (menuBar()->isHidden()) { - menuBar()->show(); - } - else menuBar()->hide(); - drawLogo(); -} - -void MainWindow::toogleFullscreen() -{ - if (isFullScreen()) - showNormal(); - else showFullScreen(); -} - -void MainWindow::closeEvent(QCloseEvent *event) -{ - m_closeApp = true; - event->accept(); -} - -void MainWindow::resizeEvent(QResizeEvent *event) -{ - drawLogo(); -} - -void MainWindow::createDefaultDirs() -{ - QStringList dirs; - dirs << "config" << "config/games" << "config/ips" << "config/localisation" - << "config/presets" << "recordings" << "roms" << "savestates" - << "screenshots" << "support" << "support/previews" - << "support/titles" << "support/icons" << "support/cheats" - << "support/hiscores" << "support/samples" << "support/ips" - << "support/neocdz" << "neocdiso"; - QDir current = QDir::currentPath(); - foreach (QString dirName, dirs) - current.mkpath(dirName); -} - -void MainWindow::createMenus() -{ - m_menuGame = menuBar()->addMenu(tr("Game")); - m_menuGame->addAction(m_actionLoadGame); - m_menuGame->addAction(m_actionCloseGame); - m_menuGame->addSeparator(); - m_menuGame->addAction(m_actionExitEmulator); - - m_menuInput = menuBar()->addMenu(tr("Input")); - m_menuInputPlugin = new QMenu(tr("Plugin"), this); - m_menuInput->addMenu(m_menuInputPlugin); - setupInputInterfaces(); - - m_menuInput->addAction(m_actionDipswitch); - m_menuInput->addAction(m_actionMapGameInputs); - - m_menuMisc = menuBar()->addMenu(tr("Misc")); - m_menuMisc->addAction(m_actionConfigureRomPaths); - m_menuMisc->addAction(m_actionConfigureSupportPaths); - m_menuMisc->addSeparator(); - m_menuMisc->addAction(m_actionToogleMenu); - m_menuMisc->addAction(m_actionLogWindow); - - m_menuHelp = menuBar()->addMenu(tr("Help")); - m_menuHelp->addAction(m_actionAbout); -} - -void MainWindow::createControls() -{ - m_audio = QAudioInterface::get(this); - m_viewport = new OGLViewport(nullptr); - setCentralWidget(m_viewport); - resize(640, 480); - - m_emulation = new EmuWorker(); - m_selectDlg = new SelectDialog(this); - m_supportPathDlg = new SupportDirsDialog(this); - m_aboutDlg = new AboutDialog(this); - m_dipSwitchDlg = new DipswitchDialog(this); - m_inputDlg = new InputDialog(this); - m_logDlg = LogDialog::get(this); - - extern void ProgressSetParent(QWidget *); - ProgressSetParent(this); -} - -void MainWindow::createActions() -{ - m_actionLoadGame = new QAction(tr("Load Game"), this); - m_actionLoadGame->setShortcut(QKeySequence("F6")); - m_actionCloseGame = new QAction(tr("Close Game"), this); - m_actionCloseGame->setEnabled(false); - m_actionConfigureRomPaths = new QAction(tr("Configure ROM paths..."), this); - m_actionConfigureSupportPaths = new QAction(tr("Configure support paths..."), this); - m_actionExitEmulator = new QAction(tr("Exit emulator"), this); - m_actionToogleMenu = new QAction(tr("Toogle Menu"), this); - m_scutToogleMenu = new QShortcut(QKeySequence(tr("F12")), this); - m_scutToogleFullscreen = new QShortcut(QKeySequence(tr("Alt+Return")), this); - m_scutToogleMenu->setContext(Qt::ApplicationShortcut); - m_actionAbout = new QAction(tr("About FBA"), this); - m_actionDipswitch = new QAction(tr("Configure DIPs"), this); - m_actionDipswitch->setEnabled(false); - m_actionMapGameInputs = new QAction(tr("Map game inputs"), this); - m_actionMapGameInputs->setEnabled(false); - m_actionLogWindow = new QAction(tr("Log window"), this); -} - -void MainWindow::connectActions() -{ - connect(m_actionLoadGame, SIGNAL(triggered()), this, SLOT(loadGame())); - connect(m_actionCloseGame, SIGNAL(triggered()), this, SLOT(closeGame())); - connect(m_actionConfigureRomPaths, SIGNAL(triggered()), m_selectDlg, SLOT(editRomPaths())); - connect(m_actionExitEmulator, SIGNAL(triggered()), this, SLOT(exitEmulator())); - connect(m_actionConfigureSupportPaths, SIGNAL(triggered()), m_supportPathDlg, SLOT(exec())); - connect(m_actionAbout, SIGNAL(triggered()), m_aboutDlg, SLOT(exec())); - connect(m_actionToogleMenu, SIGNAL(triggered()), this, SLOT(toogleMenu())); - connect(m_scutToogleMenu, SIGNAL(activated()), this, SLOT(toogleMenu())); - connect(m_scutToogleFullscreen, SIGNAL(activated()), this, SLOT(toogleFullscreen())); - connect(m_actionDipswitch, SIGNAL(triggered()), m_dipSwitchDlg, SLOT(exec())); - connect(m_actionMapGameInputs, SIGNAL(triggered()), m_inputDlg, SLOT(exec())); - connect(m_actionLogWindow, SIGNAL(triggered()), m_logDlg, SLOT(show())); -} - -void MainWindow::enableInGame() -{ - m_actionCloseGame->setEnabled(true); - m_actionDipswitch->setEnabled(true); - m_actionMapGameInputs->setEnabled(true); -} - -void MainWindow::disableInGame() -{ - m_actionCloseGame->setEnabled(false); - m_actionDipswitch->setEnabled(false); - m_actionMapGameInputs->setEnabled(false); - -} - -void MainWindow::drawLogo() -{ -} - - -void MainWindow::setupInputInterfaces() -{ - m_actionInputPlugins = new QActionGroup(this); - m_actionInputPlugins->setExclusive(true); - m_inputInterfaces = QVector::fromStdVector(InputGetInterfaces()); - - for (int i = 0; i < m_inputInterfaces.size(); i++) { - const InputInOut *intf = m_inputInterfaces[i]; - QAction *action = new QAction(QString(intf->szModuleName), this); - action->setCheckable(true); - action->setChecked(i ? false : true); - action->setData(QVariant(i)); - m_actionInputPlugins->addAction(action); - } - - m_menuInputPlugin->addActions(m_actionInputPlugins->actions()); - connect(m_actionInputPlugins, SIGNAL(triggered(QAction*)), - this, SLOT(setupInputInterface(QAction*))); -} diff --git a/jan/src/burner/qt/mainwindow.h b/jan/src/burner/qt/mainwindow.h deleted file mode 100644 index 10f98c850..000000000 --- a/jan/src/burner/qt/mainwindow.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "selectdialog.h" -#include "oglviewport.h" -#include "qaudiointerface.h" -#include "supportdirsdialog.h" -#include "aboutdialog.h" -#include "dipswitchdialog.h" -#include "inputdialog.h" -#include "logdialog.h" -#include "emuworker.h" -#include "burner.h" - - -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - - int main(QApplication &app); -signals: -public slots: - void loadGame(); - void exitEmulator(); - void closeGame(); - void setupInputInterface(QAction *action); - void toogleMenu(); - void toogleFullscreen(); - void closeEvent(QCloseEvent *event); - void resizeEvent(QResizeEvent *event); -private: - void createDefaultDirs(); - void createMenus(); - void createControls(); - void createActions(); - void connectActions(); - void enableInGame(); - void disableInGame(); - void drawLogo(); - int m_game; - bool m_isRunning; - OGLViewport *m_viewport; - QAudioInterface *m_audio; - EmuWorker *m_emulation; - SelectDialog *m_selectDlg; - SupportDirsDialog *m_supportPathDlg; - AboutDialog *m_aboutDlg; - DipswitchDialog *m_dipSwitchDlg; - InputDialog *m_inputDlg; - LogDialog *m_logDlg; - QMenu *m_menuGame; - QMenu *m_menuMisc; - QMenu *m_menuHelp; - QMenu *m_menuInput; - QMenu *m_menuInputPlugin; - QAction *m_actionConfigureRomPaths; - QAction *m_actionConfigureSupportPaths; - QAction *m_actionAbout; - QAction *m_actionLoadGame; - QAction *m_actionExitEmulator; - QAction *m_actionCloseGame; - QAction *m_actionToogleMenu; - QAction *m_actionDipswitch; - QAction *m_actionMapGameInputs; - QAction *m_actionLogWindow; - QShortcut *m_scutToogleMenu; - QShortcut *m_scutToogleFullscreen; - QImage m_logo; - - void setupInputInterfaces(); - QVector m_inputInterfaces; - QActionGroup *m_actionInputPlugins; - bool m_closeApp; -}; - -#endif // MAINWINDOW_H diff --git a/jan/src/burner/qt/neocdlist.cpp b/jan/src/burner/qt/neocdlist.cpp deleted file mode 100644 index 6899fc974..000000000 --- a/jan/src/burner/qt/neocdlist.cpp +++ /dev/null @@ -1,500 +0,0 @@ -// --------------------------------------------------------------------------------------- -// NeoGeo CD Game Info Module (by CaptainCPS-X) -// --------------------------------------------------------------------------------------- -#include "burner.h" -#include "../neocdlist.h" - -struct NGCDGAME games[] = -{ -// ---------------------------------------------------------------------------------------------------------------------------------------------// -// * Name * Title * Year * Company * Game ID // -// ---------------------------------------------------------------------------------------------------------------------------------------------// - { _T("nam1975") , _T("NAM-1975") , _T("1990") , _T("SNK") , 0x0001 }, // - { _T("bstars") , _T("Baseball Stars Professional") , _T("1991") , _T("SNK") , 0x0002 }, // - { _T("tpgolf") , _T("Top Player's Golf") , _T("1990") , _T("SNK") , 0x0003 }, // - { _T("mahretsu") , _T("Mahjong Kyo Retsuden - Nishi Nihon Hen") , _T("1990") , _T("SNK") , 0x0004 }, // - { _T("maglord") , _T("Magician Lord") , _T("1990") , _T("ADK") , 0x0005 }, // - { _T("ridhero") , _T("Riding Hero") , _T("1991") , _T("SNK") , 0x0006 }, // - { _T("alpham2") , _T("Alpha Mission II / ASO II - Last Guardian") , _T("1994") , _T("SNK") , 0x0007 }, // - { _T("ncombat") , _T("Ninja Combat") , _T("1990") , _T("SNK/ADK") , 0x0009 }, // - { _T("cyberlip") , _T("Cyber-Lip") , _T("1991") , _T("SNK") , 0x0010 }, // - { _T("superspy") , _T("The Super Spy") , _T("1990") , _T("SNK") , 0x0011 }, // - { _T("mutnat") , _T("Mutation Nation") , _T("1995") , _T("SNK") , 0x0014 }, // - { _T("sengoku") , _T("Sengoku / Sengoku Denshou") , _T("1994") , _T("SNK") , 0x0017 }, // - { _T("burningf") , _T("Burning Fight") , _T("1994") , _T("SNK") , 0x0018 }, // - { _T("lbowling") , _T("League Bowling") , _T("1994") , _T("SNK") , 0x0019 }, // - { _T("gpilots") , _T("Ghost Pilots") , _T("1991") , _T("SNK") , 0x0020 }, // - { _T("joyjoy") , _T("Puzzled / Joy Joy Kid") , _T("1990") , _T("SNK") , 0x0021 }, // - { _T("bjourney") , _T("Blue's Journey / Raguy") , _T("1990") , _T("SNK/ADK") , 0x0022 }, // - { _T("lresort") , _T("Last Resort") , _T("1994") , _T("SNK") , 0x0024 }, // - { _T("2020bb") , _T("2020 Super Baseball") , _T("1994") , _T("SNK") , 0x0030 }, // - { _T("socbrawl") , _T("Soccer Brawl") , _T("1991") , _T("SNK") , 0x0031 }, // - { _T("roboarmy") , _T("Robo Army") , _T("1991") , _T("SNK") , 0x0032 }, // - { _T("fatfury") , _T("Fatal Fury - The Battle of Fury") , _T("1994") , _T("SNK") , 0x0033 }, // - { _T("fbfrenzy") , _T("Football Frenzy") , _T("1994") , _T("SNK") , 0x0034 }, // - { _T("crswords") , _T("Crossed Swords") , _T("1994") , _T("SNK/ADK") , 0x0037 }, // - { _T("rallych") , _T("Rally Chase") , _T("1991") , _T("SNK/ADK") , 0x0038 }, // - { _T("kotm2") , _T("King of the Monsters 2") , _T("1992") , _T("SNK") , 0x0039 }, // - { _T("sengoku2") , _T("Sengoku 2 / Sengoku Denshou 2") , _T("1994") , _T("SNK") , 0x0040 }, // - { _T("bstars2") , _T("Baseball Stars 2") , _T("1992") , _T("SNK") , 0x0041 }, // - { _T("3countb") , _T("3 Count Bout / Fire Suplex") , _T("1995") , _T("SNK") , 0x0043 }, // - { _T("aof") , _T("Art of Fighting / Ryuuko no Ken") , _T("1994") , _T("SNK") , 0x0044 }, // - { _T("samsho") , _T("Samurai Shodown / Samurai Spirits") , _T("1993") , _T("SNK") , 0x0045 }, // - { _T("tophuntr") , _T("Top Hunter - Roddy & Cathy") , _T("1994") , _T("SNK") , 0x0046 }, // - { _T("fatfury2") , _T("Fatal Fury 2 / Garou Densetsu 2 - Aratanaru Tatakai") , _T("1994") , _T("SNK") , 0x0047 }, // - { _T("janshin") , _T("Janshin Densetsu - Quest of the Jongmaster") , _T("1995") , _T("Yubis") , 0x0048 }, // - { _T("ncommand") , _T("Ninja Commando") , _T("1992") , _T("SNK") , 0x0050 }, // - { _T("viewpoin") , _T("Viewpoint") , _T("1992") , _T("Sammy/Aicom") , 0x0051 }, // - { _T("ssideki") , _T("Super Sidekicks / Tokuten Oh") , _T("1993") , _T("SNK") , 0x0052 }, // - { _T("wh1") , _T("World Heroes") , _T("1992") , _T("ADK") , 0x0053 }, // - { _T("crsword2") , _T("Crossed Swords II") , _T("1995") , _T("SNK/ADK") , 0x0054 }, // - { _T("kof94") , _T("The King of Fighters '94 (JP)") , _T("1994") , _T("SNK") , 0x0055 }, // - { _T("kof94ju") , _T("The King of Fighters '94 (JP-US)") , _T("1994") , _T("SNK") , 0x1055 }, // custom id - { _T("aof2") , _T("Art of Fighting 2 / Ryuuko no Ken 2") , _T("1994") , _T("SNK") , 0x0056 }, // - { _T("wh2") , _T("World Heroes 2") , _T("1995") , _T("SNK/ADK") , 0x0057 }, // - { _T("fatfursp") , _T("Fatal Fury Special / Garou Densetsu Special") , _T("1994") , _T("SNK") , 0x0058 }, // - { _T("savagere") , _T("Savage Reign / Fu'un Mokujiroku - Kakutou Sousei") , _T("1995") , _T("SNK") , 0x0059 }, // - { _T("ssideki2") , _T("Super Sidekicks 2 / Tokuten Oh 2") , _T("1994") , _T("SNK") , 0x0061 }, // - { _T("samsho2") , _T("Samurai Shodown 2 / Shin Samurai Spirits") , _T("1994") , _T("SNK") , 0x0063 }, // - { _T("wh2j") , _T("World Heroes 2 Jet") , _T("1995") , _T("SNK/ADK") , 0x0064 }, // - { _T("wjammers") , _T("Windjammers / Flying Power Disc") , _T("1994") , _T("Data East") , 0x0065 }, // - { _T("karnovr") , _T("Karnov's Revenge / Fighters History Dynamite") , _T("1994") , _T("Data East") , 0x0066 }, // - { _T("pspikes2") , _T("Power Spikes II") , _T("1994") , _T("Video System") , 0x0068 }, // - { _T("aodk") , _T("Aggressors of Dark Kombat / Tsuukai GanGan Koushinkyoku") , _T("1994"), _T("SNK/ADK") , 0x0074 }, // - { _T("sonicwi2") , _T("Aero Fighters 2 / Sonic Wings 2") , _T("1994") , _T("Video System") , 0x0075 }, // - { _T("galaxyfg") , _T("Galaxy Fight - Universal Warriors") , _T("1995") , _T("Sunsoft") , 0x0078 }, // - { _T("strhoop") , _T("Street Hoop / Dunk Dream") , _T("1994") , _T("Data East") , 0x0079 }, // - { _T("quizkof") , _T("Quiz King of Fighters") , _T("1993") , _T("SNK/Saurus") , 0x0080 }, // - { _T("ssideki3") , _T("Super Sidekicks 3 - The Next Glory / Tokuten Oh 3 - Eikoue No Chousen"), _T("1995") , _T("SNK") , 0x0081 }, // - { _T("doubledr") , _T("Double Dragon") , _T("1995") , _T("Technos") , 0x0082 }, // - { _T("pbobblen") , _T("Puzzle Bobble / Bust-A-Move") , _T("1994") , _T("SNK") , 0x0083 }, // - { _T("kof95") , _T("The King of Fighters '95 (JP-US)") , _T("1995") , _T("SNK") , 0x0084 }, // - { _T("kof95r1") , _T("The King of Fighters '95 (JP-US)(Rev 1)") , _T("1995") , _T("SNK") , 0x1084 }, // - { _T("ssrpg") , _T("Shinsetsu Samurai Spirits - Bushidohretsuden") , _T("1997") , _T("SNK") , 0x0085 }, // - { _T("samsho3") , _T("Samurai Shodown 3 / Samurai Spirits 3") , _T("1995") , _T("SNK") , 0x0087 }, // - { _T("stakwin") , _T("Stakes Winner - GI Kanzen Seiha Heno Machi") , _T("1995") , _T("Saurus") , 0x0088 }, // - { _T("pulstar") , _T("Pulstar") , _T("1995") , _T("Aicom") , 0x0089 }, // - { _T("whp") , _T("World Heroes Perfect") , _T("1995") , _T("ADK") , 0x0090 }, // - { _T("kabukikl") , _T("Kabuki Klash / Tengai Makyou Shinden - Far East of Eden") , _T("1995"), _T("Hudson") , 0x0092 }, // - { _T("gowcaizr") , _T("Voltage Fighter Gowcaizer / Choujin Gakuen Gowcaizer"), _T("1995") , _T("Technos") , 0x0094 }, // - { _T("rbff1") , _T("Real Bout Fatal Fury") , _T("1995") , _T("SNK") , 0x0095 }, // - { _T("aof3") , _T("Art of Fighting 3: Path of the Warrior") , _T("1996") , _T("SNK") , 0x0096 }, // - { _T("sonicwi3") , _T("Aero Fighters 3 / Sonic Wings 3") , _T("1995") , _T("SNK") , 0x0097 }, // - { _T("fromanc2") , _T("Idol Mahjong Final Romance 2") , _T("1995") , _T("Video Systems") , 0x0098 }, // - { _T("turfmast") , _T("Neo Turf Masters / Big Tournament Golf") , _T("1996") , _T("Nazca") , 0x0200 }, // - { _T("mslug") , _T("Metal Slug - Super Vehicle-001") , _T("1996") , _T("Nazca") , 0x0201 }, // - { _T("mosyougi") , _T("Shougi no Tatsujin - Master of Syougi") , _T("1995") , _T("ADK") , 0x0203 }, // - { _T("adkworld") , _T("ADK World / ADK Special") , _T("1995") , _T("ADK") , 0x0204 }, // - { _T("ngcdsp") , _T("Neo Geo CD Special") , _T("1995") , _T("SNK") , 0x0205 }, // - { _T("zintrick") , _T("Zintrick / Oshidashi Zintrick") , _T("1996") , _T("ADK") , 0x0211 }, // - { _T("overtop") , _T("OverTop") , _T("1996") , _T("ADK") , 0x0212 }, // - { _T("neodrift") , _T("Neo DriftOut") , _T("1996") , _T("Visco") , 0x0213 }, // - { _T("kof96") , _T("The King of Fighters '96") , _T("1996") , _T("SNK") , 0x0214 }, // - { _T("ninjamas") , _T("Ninja Master's - Haou Ninpou-Chou") , _T("1996") , _T("ADK/SNK") , 0x0217 }, // - { _T("ragnagrd") , _T("Ragnagard / Shinouken") , _T("1996") , _T("Saurus") , 0x0218 }, // - { _T("pgoal") , _T("Pleasuregoal - 5 on 5 Mini Soccer / Futsal") , _T("1996") , _T("Saurus") , 0x0219 }, // - { _T("ironclad") , _T("Ironclad / Choutetsu Brikin'ger") , _T("1996") , _T("Saurus") , 0x0220 }, // - { _T("magdrop2") , _T("Magical Drop 2") , _T("1996") , _T("Data East") , 0x0221 }, // - { _T("samsho4") , _T("Samurai Shodown IV - Amakusa's Revenge") , _T("1996") , _T("SNK") , 0x0222 }, // - { _T("rbffspec") , _T("Real Bout Fatal Fury Special") , _T("1996") , _T("SNK") , 0x0223 }, // - { _T("twinspri") , _T("Twinkle Star Sprites") , _T("1996") , _T("ADK") , 0x0224 }, // - { _T("kof96ngc") , _T("The King of Fighters '96 NEOGEO Collection") , _T("1996") , _T("SNK") , 0x0229 }, // - { _T("breakers") , _T("Breakers") , _T("1996") , _T("Visco") , 0x0230 }, // - { _T("kof97") , _T("The King of Fighters '97") , _T("1997") , _T("SNK") , 0x0232 }, // - { _T("lastblad") , _T("The Last Blade / Bakumatsu Roman - Gekka no Kenshi") , _T("1997") , _T("SNK") , 0x0234 }, // - { _T("rbff2") , _T("Real Bout Fatal Fury 2 / Garou Densetsu 2 - Aratanaru Tatakai"), _T("1998"), _T("SNK") , 0x0240 }, // - { _T("mslug2") , _T("Metal Slug 2 - Super Vehicle-001/II") , _T("1998") , _T("SNK") , 0x0241 }, // - { _T("kof98") , _T("The King of Fighters '98 - The Slugfest") , _T("1998") , _T("SNK") , 0x0242 }, // - { _T("lastbld2") , _T("The Last Blade 2") , _T("1998") , _T("SNK") , 0x0243 }, // - { _T("kof99") , _T("The King of Fighters '99 - Millennium Battle") , _T("1999") , _T("SNK") , 0x0251 }, // - { _T("fatfury3") , _T("Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - Harukanaru Tatakai"), _T("1995"), _T("SNK"), 0x069c }, // -}; - -NGCDGAME* GetNeoGeoCDInfo(unsigned int nID) -{ - for(unsigned int nGame = 0; nGame < (sizeof(games) / sizeof(NGCDGAME)); nGame++) { - if(nID == games[nGame].id ) { - return &games[nGame]; - } - } - - return NULL; -} - -NGCDGAME* game; - -// Get the title -int GetNeoCDTitle(unsigned int nGameID) -{ - game = (NGCDGAME*)malloc(sizeof(NGCDGAME)); - memset(game, 0, sizeof(NGCDGAME)); - - if(GetNeoGeoCDInfo(nGameID)) - { - memcpy(game, GetNeoGeoCDInfo(nGameID), sizeof(NGCDGAME)); - return 1; - } - - game = NULL; - return 0; -} - -void iso9660_ReadOffset(unsigned char *Dest, FILE* fp, unsigned int lOffset, unsigned int lSize, unsigned int lLength) -{ - if(fp == NULL) return; - if (Dest == NULL) return; - - fseek(fp, lOffset, SEEK_SET); - fread(Dest, lLength, lSize, fp); -} - -static void NeoCDList_iso9660_CheckDirRecord(FILE* fp, int nSector) -{ - int nSectorLength = 2048; - //int nFile = 0; - unsigned int lBytesRead = 0; - //int nLen = 0; - unsigned int lOffset = 0; - bool bNewSector = false; - bool bRevisionQueve = false; - int nRevisionQueveID = 0; - - lOffset = (nSector * nSectorLength); - - unsigned char* nLenDR = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* Flags = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* ExtentLoc = (unsigned char*)malloc(8 * sizeof(unsigned char)); - unsigned char* Data = (unsigned char*)malloc(0x10b * sizeof(unsigned char)); - unsigned char* LEN_FI = (unsigned char*)malloc(1 * sizeof(unsigned char)); - char *File = (char*)malloc(32 * sizeof(char)); - - while(1) - { - iso9660_ReadOffset(nLenDR, fp, lOffset, 1, sizeof(unsigned char)); - - if(nLenDR[0] == 0x22) { - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - if(nLenDR[0] < 0x22) - { - if(bNewSector) - { - if(bRevisionQueve) { - bRevisionQueve = false; - - GetNeoCDTitle(nRevisionQueveID); - } - return; - } - - nLenDR[0] = 0; - iso9660_ReadOffset(nLenDR, fp, lOffset + 1, 1, sizeof(unsigned char)); - - if(nLenDR[0] < 0x22) { - lOffset += (2048 - lBytesRead); - lBytesRead = 0; - bNewSector = true; - continue; - } - } - - bNewSector = false; - - iso9660_ReadOffset(Flags, fp, lOffset + 25, 1, sizeof(unsigned char)); - - if(!(Flags[0] & (1 << 1))) - { - iso9660_ReadOffset(ExtentLoc, fp, lOffset + 2, 8, sizeof(unsigned char)); - - char szValue[9]; - sprintf(szValue, "%02x%02x%02x%02x", ExtentLoc[4], ExtentLoc[5], ExtentLoc[6], ExtentLoc[7]); - - unsigned int nValue = 0; - sscanf(szValue, "%x", &nValue); - - iso9660_ReadOffset(Data, fp, nValue * 2048, 0x10a, sizeof(unsigned char)); - - char szData[8]; - sprintf(szData, "%c%c%c%c%c%c%c", Data[0x100], Data[0x101], Data[0x102], Data[0x103], Data[0x104], Data[0x105], Data[0x106]); - - if(!strncmp(szData, "NEO-GEO", 7)) - { - char id[] = "0000"; - sprintf(id, "%02X%02X", Data[0x108], Data[0x109]); - - unsigned int nID = 0; - sscanf(id, "%x", &nID); - - iso9660_ReadOffset(LEN_FI, fp, lOffset + 32, 1, sizeof(unsigned char)); - - iso9660_ReadOffset((unsigned char*)File, fp, lOffset + 33, LEN_FI[0], sizeof(char)); - strncpy(File, File, LEN_FI[0]); - File[LEN_FI[0]] = 0; - - // King of Fighters '94, The (1994)(SNK)(JP) - // 10-6-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xDE) { - // ...continue - } - - // King of Fighters '94, The (1994)(SNK)(JP-US) - // 11-21-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xE6) { - // Change to custom revision id - nID = 0x1055; - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B01, B03-B06, NGCD-084E MT B01] - // 9-11-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xC0) { - // ... continue - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B10, NGCD-084E MT B03] - // 10-5-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xFF) { - // Change to custom revision id - nID = 0x1084; - } - - // King of Fighters '96 NEOGEO Collection, The - if(nID == 0x0229) { - bRevisionQueve = false; - - GetNeoCDTitle(nID); - break; - } - - // King of Fighters '96, The - if(nID == 0x0214) { - bRevisionQueve = true; - nRevisionQueveID = nID; - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - GetNeoCDTitle(nID); - - break; - } - } - - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - } - - if (nLenDR) { - free(nLenDR); - nLenDR = NULL; - } - - if (Flags) { - free(Flags); - Flags = NULL; - } - - if (ExtentLoc) { - free(ExtentLoc); - ExtentLoc = NULL; - } - - if (Data) { - free(Data); - Data = NULL; - } - - if (LEN_FI) { - free(LEN_FI); - LEN_FI = NULL; - } - - if (File) { - free(File); - File = NULL; - } -} - -// Check the specified ISO, and proceed accordingly -static int NeoCDList_CheckISO(TCHAR* pszFile) -{ - if(!pszFile) { - // error - return 0; - } - - // Make sure we have a valid ISO file extension... - if(_tcsstr(pszFile, _T(".iso")) || _tcsstr(pszFile, _T(".ISO")) ) - { - FILE* fp = _tfopen(pszFile, _T("rb")); - if(fp) - { - // Read ISO and look for 68K ROM standard program header, ID is always there - // Note: This function works very quick, doesn't compromise performance :) - // it just read each sector first 264 bytes aproximately only. - - // Get ISO Size (bytes) - fseek(fp, 0, SEEK_END); - unsigned int lSize = 0; - lSize = ftell(fp); - //rewind(fp); - fseek(fp, 0, SEEK_SET); - - // If it has at least 16 sectors proceed - if(lSize > (2048 * 16)) - { - // Check for Standard ISO9660 Identifier - unsigned char IsoHeader[2048 * 16 + 1]; - unsigned char IsoCheck[6]; - - fread(IsoHeader, 1, 2048 * 16 + 1, fp); // advance to sector 16 and PVD Field 2 - fread(IsoCheck, 1, 5, fp); // get Standard Identifier Field from PVD - - // Verify that we have indeed a valid ISO9660 MODE1/2048 - if(!memcmp(IsoCheck, "CD001", 5)) - { - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Found. \n")); - iso9660_VDH vdh; - - // Get Volume Descriptor Header - memset(&vdh, 0, sizeof(vdh)); - //memcpy(&vdh, iso9660_ReadOffset(fp, (2048 * 16), sizeof(vdh)), sizeof(vdh)); - iso9660_ReadOffset((unsigned char*)&vdh, fp, 2048 * 16, 1, sizeof(vdh)); - - // Check for a valid Volume Descriptor Type - if(vdh.vdtype == 0x01) - { -#if 0 -// This will fail on 64-bit due to differing variable sizes in the pvd struct - // Get Primary Volume Descriptor - iso9660_PVD pvd; - memset(&pvd, 0, sizeof(pvd)); - //memcpy(&pvd, iso9660_ReadOffset(fp, (2048 * 16), sizeof(pvd)), sizeof(pvd)); - iso9660_ReadOffset((unsigned char*)&pvd, fp, 2048 * 16, 1, sizeof(pvd)); - - // ROOT DIRECTORY RECORD - - // Handle Path Table Location - char szRootSector[32]; - unsigned int nRootSector = 0; - - sprintf(szRootSector, "%02X%02X%02X%02X", - pvd.root_directory_record.location_of_extent[4], - pvd.root_directory_record.location_of_extent[5], - pvd.root_directory_record.location_of_extent[6], - pvd.root_directory_record.location_of_extent[7]); - - // Convert HEX string to Decimal - sscanf(szRootSector, "%X", &nRootSector); -#else -// Just read from the file directly at the correct offset (0x8000 + 0x9e for the start of the root directory record) - unsigned char buffer[8]; - char szRootSector[4]; - unsigned int nRootSector = 0; - - fseek(fp, 0x809e, SEEK_SET); - fread(buffer, 1, 8, fp); - - sprintf(szRootSector, "%02x%02x%02x%02x", buffer[4], buffer[5], buffer[6], buffer[7]); - - sscanf(szRootSector, "%x", &nRootSector); -#endif - - // Process the Root Directory Records - NeoCDList_iso9660_CheckDirRecord(fp, nRootSector); - - // Path Table Records are not processed, since NeoGeo CD should not have subdirectories - // ... - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Not Found, cannot continue. \n")); - return 0; - } - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Couldn't open %s \n"), GetIsoPath()); - return 0; - } - - if(fp) fclose(fp); - - } else { - - //bprintf(PRINT_NORMAL, _T(" File doesn't have a valid ISO extension [ .iso / .ISO ] \n")); - return 0; - } - - return 1; -} - -// This will do everything -int GetNeoGeoCD_Identifier() -{ - if(!GetIsoPath() || !IsNeoGeoCD()) { - return 0; - } - - // Make sure we have a valid ISO file extension... - if(_tcsstr(GetIsoPath(), _T(".iso")) || _tcsstr(GetIsoPath(), _T(".ISO")) ) - { - if(_tfopen(GetIsoPath(), _T("rb"))) - { - // Read ISO and look for 68K ROM standard program header, ID is always there - // Note: This function works very quick, doesn't compromise performance :) - // it just read each sector first 264 bytes aproximately only. - NeoCDList_CheckISO(GetIsoPath()); - - } else { - - bprintf(PRINT_NORMAL, _T(" Couldn't open %s \n"), GetIsoPath()); - return 0; - } - - } else { - - bprintf(PRINT_NORMAL, _T(" File doesn't have a valid ISO extension [ .iso / .ISO ] \n")); - return 0; - } - - return 1; -} - -int NeoCDInfo_Init() -{ - NeoCDInfo_Exit(); - return GetNeoGeoCD_Identifier(); -} - -TCHAR* NeoCDInfo_Text(int nText) -{ - if(!game || !IsNeoGeoCD() || !bDrvOkay) return NULL; - - switch(nText) - { - case DRV_NAME: return game->pszName; - case DRV_FULLNAME: return game->pszTitle; - case DRV_MANUFACTURER: return game->pszCompany; - case DRV_DATE: return game->pszYear; - } - - return NULL; -} - -int NeoCDInfo_ID() -{ - if(!game || !IsNeoGeoCD() || !bDrvOkay) return 0; - return game->id; -} - -void NeoCDInfo_Exit() -{ - if(game) { - free(game); - game = NULL; - } -} diff --git a/jan/src/burner/qt/oglviewport.cpp b/jan/src/burner/qt/oglviewport.cpp deleted file mode 100644 index 4912ee818..000000000 --- a/jan/src/burner/qt/oglviewport.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include -#include "oglviewport.h" - -extern void OGLSetContext(void *ptr); -extern void OGLSetSwapBuffers(void (*f)(void*)); -extern void OGLSetMakeCurrent(void (*f)(void*)); -extern void OGLSetDoneCurrent(void (*f)(void*)); -extern void OGLResize(int w, int h); - -static void swapBuffers(void *ptr) -{ - OGLViewport* view = static_cast(ptr); - view->swapBuffers(); -} - -static void doneCurrent(void *ptr) -{ - OGLViewport* view = static_cast(ptr); - view->doneCurrent(); -} - -static void makeCurrent(void *ptr) -{ - OGLViewport* view = static_cast(ptr); - view->makeCurrent(); -} - -OGLViewport::OGLViewport(QWidget *parent) : - QGLWidget(parent) -{ - QGLFormat format; - format.setVersion(3, 3); - format.setProfile(QGLFormat::CoreProfile); - setFormat(format); - - OGLSetContext(this); - OGLSetSwapBuffers(::swapBuffers); - OGLSetMakeCurrent(::makeCurrent); - OGLSetDoneCurrent(::doneCurrent); -} - -OGLViewport::~OGLViewport() -{ - -} - -void OGLViewport::initializeGL() -{ -} - -void OGLViewport::paintGL() -{ -} - -void OGLViewport::resizeGL(int w, int h) -{ - OGLResize(w, h); -} - diff --git a/jan/src/burner/qt/oglviewport.h b/jan/src/burner/qt/oglviewport.h deleted file mode 100644 index 81dad6482..000000000 --- a/jan/src/burner/qt/oglviewport.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef OGLVIEWPORT_H -#define OGLVIEWPORT_H - -#include -#include - -class OGLViewport : public QGLWidget -{ - Q_OBJECT - -public: - OGLViewport(QWidget* parent); - ~OGLViewport(); - - virtual void initializeGL(); - virtual void paintGL(); - virtual void resizeGL(int w, int h); -}; - -#endif // OGLVIEWPORT_H diff --git a/jan/src/burner/qt/progress.cpp b/jan/src/burner/qt/progress.cpp deleted file mode 100644 index ef41d8a1a..000000000 --- a/jan/src/burner/qt/progress.cpp +++ /dev/null @@ -1,117 +0,0 @@ -#include -#include -#include -#include "burner.h" - -static QProgressDialog *dlgProgress = nullptr; -static QWidget *dlgProgressParent = nullptr; - -static int nProgressPosBurn = 0; -static int nProgressPosBurner = 0; -static int nProgressMin = 0; -static int nProgressMax = 0; - -static int ProgressSetRangeBurn(double dProgressRange) -{ - - nProgressMin = -(int)((double)nProgressMax * dProgressRange); - dlgProgress->setRange(nProgressMin, nProgressMax); - return 0; -} - -static int ProgressUpdateBurn(double dProgress, const TCHAR *pszText, bool bAbs) -{ - - if (pszText) { - dlgProgress->setLabelText(pszText); - } - - if (bAbs) { - nProgressPosBurn = (int)((double)(-nProgressMin) * dProgress); - if (nProgressPosBurn > -nProgressMin) { - nProgressPosBurn = -nProgressMin; - } - dlgProgress->setValue(nProgressMin + nProgressPosBurn + nProgressPosBurner); - } else { - if (dProgress) { - nProgressPosBurn += (int)((double)(-nProgressMin) * dProgress); - if (nProgressPosBurn > -nProgressMin) { - nProgressPosBurn = -nProgressMin; - } - dlgProgress->setValue(nProgressMin + nProgressPosBurn + nProgressPosBurner); - } - } - QApplication::processEvents(); - return 0; -} - -void ProgressSetParent(QWidget *parent) -{ - - dlgProgressParent = parent; -} - -void ProgressCreate() -{ - nProgressMin = 0; - nProgressMax = 1 << 30; - - nProgressPosBurn = 0; - nProgressPosBurner = 0; - - BurnExtProgressRangeCallback = ProgressSetRangeBurn; - BurnExtProgressUpdateCallback = ProgressUpdateBurn; - - if (dlgProgress == nullptr) { - dlgProgress = new QProgressDialog(dlgProgressParent); - dlgProgress->setWindowModality(Qt::WindowModal); - dlgProgress->setRange(nProgressMin, nProgressMax); - dlgProgress->setWindowTitle(QObject::tr("Working...")); - dlgProgress->setAutoClose(true); - dlgProgress->setAutoReset(true); - dlgProgress->setMinimumDuration(500); - } - dlgProgress->setValue(0); -} - -void ProgressDestroy() -{ - dlgProgress->setValue(nProgressMax); - dlgProgress->close(); - QApplication::processEvents(); - BurnExtProgressRangeCallback = NULL; - BurnExtProgressUpdateCallback = NULL; -} - -int ProgressUpdateBurner(double dProgress, const TCHAR *pszText, bool bAbs) -{ - if (pszText) { - dlgProgress->setLabelText(pszText); - } - - if (bAbs) { - nProgressPosBurner = (int)((double)nProgressMax * dProgress); - if (nProgressPosBurner > nProgressMax) { - nProgressPosBurner = nProgressMax; - } - dlgProgress->setValue(nProgressMin + nProgressPosBurn + nProgressPosBurner); - } else { - if (dProgress) { - if (nProgressPosBurner > nProgressMax) { - nProgressPosBurner = nProgressMax; - } - nProgressPosBurner += (int)((double)nProgressMax * dProgress); - dlgProgress->setValue(nProgressMin + nProgressPosBurn + nProgressPosBurner); - } - } - return 0; -} - -bool ProgressIsRunning() -{ - if (dlgProgress != nullptr) { - if (dlgProgress->isVisible()) - return true; - } - return false; -} diff --git a/jan/src/burner/qt/qaudiointerface.cpp b/jan/src/burner/qt/qaudiointerface.cpp deleted file mode 100644 index fcbb13fc5..000000000 --- a/jan/src/burner/qt/qaudiointerface.cpp +++ /dev/null @@ -1,376 +0,0 @@ -#include -#include -#include "burner.h" -#include "qaudiointerface.h" - -#define QT_DEBUG_SOUNDBACKEND 0 - -QAudioInterface *qAudio = nullptr; -int (*QtSoundGetNextSound)(int); - -static int nQtAudioFps = 0; -static int cbLoopLen = 0; - -static QAudioInterfaceBuffer *qSoundBuffer = nullptr; - -static int QtSoundGetNextSoundFiller(int) -{ - qDebug() << __func__; - if (nAudNextSound == nullptr) - return 1; - memset(nAudNextSound, 0, nAudSegLen * 4); - return 0; -} - -static int QtSoundBlankSound() -{ - qDebug() << __func__; - if (nAudNextSound != nullptr) - AudWriteSilence(); - return 0; -} - -static int QtSoundCheck() -{ - int avail = 0; - while ((avail = qSoundBuffer->bytesAvailable()) > (nAudAllocSegLen * 3)) { - return 0; - } - - QtSoundGetNextSound(1); - qSoundBuffer->writeData((const char *)nAudNextSound, nAudSegLen << 2); - return 0; -} - -static int QtSoundExit() -{ - qDebug() << __func__; - return 0; -} - -static int QtSoundSetCallback(int (*pCallback)(int)) -{ - qDebug() << __func__; - if (pCallback == nullptr) - QtSoundGetNextSound = QtSoundGetNextSoundFiller; - else - QtSoundGetNextSound = pCallback; - return 0; -} - -static int QtSoundInit() -{ - qDebug() << __func__; - nQtAudioFps = nAppVirtualFps; - nAudSegLen = (nAudSampleRate[0] * 100 + (nQtAudioFps / 2)) / nQtAudioFps; - - // seglen * 2 channels * 2 bytes per sample (16bits) - nAudAllocSegLen = nAudSegLen * 4; - - // seg * nsegs * 2 channels - if (qSoundBuffer != nullptr) - delete qSoundBuffer; - - qSoundBuffer = new QAudioInterfaceBuffer(); - qSoundBuffer->setBufferSize(nAudAllocSegLen * nAudSegCount); - nAudNextSound = new short[nAudAllocSegLen / sizeof(short)]; - - QtSoundSetCallback(nullptr); - QtSoundGetNextSoundFiller(0); - - //qSoundBuffer->writeData((const char *) nAudNextSound, nAudAllocSegLen); - //qSoundBuffer->writeData((const char *) nAudNextSound, nAudAllocSegLen); - - pBurnSoundOut = nAudNextSound; - nBurnSoundRate = nAudSampleRate[0]; - nBurnSoundLen = nAudAllocSegLen; - - qAudio = QAudioInterface::get(); - qAudio->setBuffer(qSoundBuffer); - QAudioFormat format; - format.setChannelCount(2); - format.setSampleRate(nAudSampleRate[0]); - format.setSampleType(QAudioFormat::SignedInt); - format.setByteOrder(QAudioFormat::LittleEndian); - format.setSampleSize(16); - qAudio->setFormat(format); - - // we need to invoke this method on sound's thread, so we can't call this - // method from our object - QMetaObject::invokeMethod(qAudio, "init", Qt::QueuedConnection); - - bAudOkay = 1; - return 0; -} - -static int QtSoundPlay() -{ - qDebug() << __func__; - QMetaObject::invokeMethod(qAudio, "play", Qt::QueuedConnection); - bAudPlaying = 1; - return 0; -} - -static int QtSoundStop() -{ - qDebug() << __func__; - if (qAudio) - QMetaObject::invokeMethod(qAudio, "stop", Qt::QueuedConnection); - bAudPlaying = 0; - return 0; -} - -static int QtSoundSetVolume() -{ - qDebug() << __func__; - return 1; -} - -static int QtSoundGetSettings(InterfaceInfo *info) -{ - Q_UNUSED(info); - return 0; -} - -struct AudOut AudOutQtSound = { QtSoundBlankSound, QtSoundCheck, - QtSoundInit, QtSoundSetCallback, QtSoundPlay, - QtSoundStop, QtSoundExit, QtSoundSetVolume, - QtSoundGetSettings, ("qt-audio") }; - - - -QAudioInterface *QAudioInterface::m_onlyInstance = nullptr; -QAudioInterface::QAudioInterface(QObject *parent) : - QThread() -{ - // start thread - start(); - m_audioOutput = nullptr; - - moveToThread(this); -} - -QAudioInterface::~QAudioInterface() -{ - if (m_audioOutput != nullptr) { - delete m_audioOutput; - m_audioOutput = nullptr; - } -} - -void QAudioInterface::run() -{ - exec(); -} - -QAudioInterface *QAudioInterface::get(QObject *parent) -{ - if (m_onlyInstance != nullptr) - return m_onlyInstance; - m_onlyInstance = new QAudioInterface(parent); - - return m_onlyInstance; -} - -void QAudioInterface::init() -{ - if (m_audioOutput != nullptr) { - stop(); - delete m_audioOutput; - m_audioOutput = nullptr; - } - m_audioOutput = new QAudioOutput(m_format, this); - m_audioOutput->setBufferSize(nAudAllocSegLen); -} - -void QAudioInterface::play() -{ - if (m_buffer != nullptr) - m_buffer->start(); - m_audioOutput->start(m_buffer); -} - -void QAudioInterface::stop() -{ - m_audioOutput->stop(); - if (m_buffer != nullptr) - m_buffer->stop(); -} - -void QAudioInterface::setBuffer(QAudioInterfaceBuffer *buffer) -{ - m_buffer = buffer; -} - -void QAudioInterface::setFormat(QAudioFormat &format) -{ - m_format = format; -} - -void QAudioInterface::writeMoreData() -{ -} - - -QAudioInterfaceBuffer::QAudioInterfaceBuffer(int size) : - QIODevice() -{ - - m_buffer = nullptr; - if (size > 0) { - m_buffer = new char[size]; - } - m_size = size; - m_readPos = 0; - m_writePos = 0; - m_readWrap = 0; - m_writeWrap = 0; -} - -QAudioInterfaceBuffer::~QAudioInterfaceBuffer() -{ - delete[] m_buffer; - m_buffer = nullptr; - m_size = 0; -} - -void QAudioInterfaceBuffer::start() -{ - open(QIODevice::ReadWrite | QIODevice::Unbuffered); -} - -void QAudioInterfaceBuffer::stop() -{ - close(); -} - - -qint64 QAudioInterfaceBuffer::readData(char *data, qint64 maxlen) -{ - - if (m_size <= 0 || maxlen <= 0) { - return 0; - } - - int avail = this->bytesAvailable(); - -#if QT_DEBUG_SOUNDBACKEND - qDebug() << QThread::currentThreadId() << (quint64)m_elapsed.elapsed() << - "rd:" << maxlen << "/" << avail; -#endif - if (avail <= 0) { - memset(data, 0, maxlen); - return maxlen; - } - - m_mutex.lock(); - - int count = maxlen; - char *pdata = data; - int increment = 0; - - while (count > 0) { - bool wrap = (m_readPos + count) >= m_size; - if (wrap) { - int block = m_size - m_readPos; - memcpy(pdata, m_buffer + m_readPos, block); - count -= block; - pdata += block; - increment = block; - m_readWrap++; - } else { - memcpy(pdata, m_buffer + m_readPos, count); - increment = count; - count -= count; - pdata += count; - } - m_readPos = (m_readPos + increment) % m_size; - } - - int retval = avail; - if (avail >= maxlen) - retval = maxlen; - - m_mutex.unlock(); - return retval; -} - -qint64 QAudioInterfaceBuffer::writeData(const char *data, qint64 len) -{ - if (m_size <= 0 || len <= 0) { - return 0; - } - - m_mutex.lock(); - int count = len; - const char *pdata = data; - int increment = 0; - -#if QT_DEBUG_SOUNDBACKEND - qDebug() << QThread::currentThreadId() << (quint64)m_elapsed.elapsed() << - "wr:" << len << "+" << (writeCounter() - readCounter()); -#endif - while (count > 0) { - bool wrap = (m_writePos + count) >= m_size; - if (wrap) { - int block = m_size - m_writePos; - memcpy(m_buffer + m_writePos, pdata, block); - increment = block; - count -= block; - pdata += block; - m_writeWrap++; - m_writePos = 0; - } else { - memcpy(m_buffer + m_writePos, pdata, count); - increment = count; - count -= count; - pdata += count; - m_writePos = (m_writePos + increment) % m_size; - } - } - - m_mutex.unlock(); - return len; -} - -qint64 QAudioInterfaceBuffer::bytesAvailable() -{ - m_mutex.lock(); - int count = writeCounter() - readCounter(); - m_mutex.unlock(); - if (count >= 0) - return count; - return 0; -} - -void QAudioInterfaceBuffer::setBufferSize(int len) -{ - if (m_buffer != nullptr) - delete[] m_buffer; -#if QT_DEBUG_SOUNDBACKEND - qDebug() << "buffer size" << len; -#endif - m_buffer = new char[len]; - m_size = len; - m_readPos = 0; - m_writePos = 0; - m_readWrap = 0; - m_writeWrap = 0; - zero(); -} - -void QAudioInterfaceBuffer::zero() -{ - if (m_buffer != nullptr) - memset(m_buffer, 0, m_size); -} - -int QAudioInterfaceBuffer::readCounter() const -{ - return (m_readWrap * m_size) + m_readPos; -} - -int QAudioInterfaceBuffer::writeCounter() const -{ - return (m_writeWrap * m_size) + m_writePos; -} diff --git a/jan/src/burner/qt/qaudiointerface.h b/jan/src/burner/qt/qaudiointerface.h deleted file mode 100644 index ddefe5e3c..000000000 --- a/jan/src/burner/qt/qaudiointerface.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef QAUDIOINTERFACE_H -#define QAUDIOINTERFACE_H - -#include -#include -#include -#include -#include -#include - -class QAudioInterfaceBuffer : public QIODevice -{ - Q_OBJECT - -public: - QAudioInterfaceBuffer(int size = 0); - ~QAudioInterfaceBuffer(); - void start(); - void stop(); - qint64 readData(char *data, qint64 maxlen); - qint64 writeData(const char *data, qint64 len); - qint64 bytesAvailable(); - void setBufferSize(int len); - -private: - QElapsedTimer m_elapsed; - QMutex m_mutex; - void zero(); - int readCounter() const; - int writeCounter() const; - int m_writeWrap; - int m_readWrap; - int m_size; - char *m_buffer; - int m_readPos; - int m_writePos; -}; - -class QAudioInterface : public QThread -{ - Q_OBJECT - - QAudioInterface(QObject *parent=0); - static QAudioInterface *m_onlyInstance; -public: - ~QAudioInterface(); - - void run(); - static QAudioInterface *get(QObject *parent=0); - void setBuffer(QAudioInterfaceBuffer *buffer); - void setFormat(QAudioFormat &format); -signals: -public slots: - void play(); - void stop(); - void init(); - void writeMoreData(); -private: - QAudioOutput *m_audioOutput; - QAudioFormat m_format; - QAudioInterfaceBuffer *m_buffer; -}; - -#endif // QAUDIOINTERFACE_H diff --git a/jan/src/burner/qt/qinputinterface.cpp b/jan/src/burner/qt/qinputinterface.cpp deleted file mode 100644 index 8c2f37e86..000000000 --- a/jan/src/burner/qt/qinputinterface.cpp +++ /dev/null @@ -1,435 +0,0 @@ -#include -#include -#include "SDL.h" -#include "qinputinterface.h" -#include "burner.h" - -QInputInterface *qInput = nullptr; - -static QVector qJoysticks; - -int QtKToFBAK(int key); -static char qKeyboardState[QINPUT_MAX_KEYS] = { 0 }; -static bool bKeyboardRead = false; -static bool bJoystickRead = false; - -int QtInputSetCooperativeLevel(bool bExclusive, bool) -{ - qDebug() << __func__; - return 0; -} - -int QtInputExit() -{ - qDebug() << __func__; - if (qInput) { - delete qInput; - qInput = nullptr; - } - - return 0; -} - -int QtInputInit() -{ - qDebug() << __func__; - qInput = QInputInterface::get(); - qInput->install(); - memset(qKeyboardState, 0, QINPUT_MAX_KEYS); - bKeyboardRead = false; - - return 0; -} - -int QtInputStart() -{ - bKeyboardRead = false; - bJoystickRead = false; - return 0; -} - -static int ReadJoystick() -{ - if (bJoystickRead) - return 0; - qInput->joystickUpdate(); - bJoystickRead = true; - return 0; -} - -int QtInputJoyAxis(int i, int nAxis) -{ - return qInput->joystickAxis(i, nAxis); -} - -static int ReadKeyboard() -{ - if (bKeyboardRead) - return 0; - qInput->snapshot(qKeyboardState); - bKeyboardRead = true; - return 0; -} - -static int ReadMouse() -{ - return 0; -} - -int QtInputMouseAxis(int i, int nAxis) -{ - return 0; -} - -static int JoystickState(int i, int nSubCode) -{ - if (i >= qInput->joystickCount() || nSubCode < 0) - return 0; - - if (nSubCode < 0x10) { - const int deadZone = 0x4000; - - int axis = nSubCode / 2; - int value = qInput->joystickAxis(i, axis); - - if (nSubCode % 2) - return value > deadZone; - - return value < -deadZone; - } - - if (nSubCode < 0x20) { - const static unsigned mask[4] = { SDL_HAT_LEFT, - SDL_HAT_RIGHT, - SDL_HAT_UP, - SDL_HAT_DOWN }; - - int hat = (nSubCode & 0x0F) >> 2; - return qInput->joystickHat(i, hat) & mask[nSubCode & 3]; - } - - if (nSubCode < 0x80) - return 0; - - int button = nSubCode - 0x80; - - return qInput->joystickButton(i, button); -} - -static int CheckMouseState(unsigned int nSubCode) -{ - return 0; -} - -int QtInputState(int nCode) -{ - if (nCode < 0) - return 0; - - if (nCode < 0x100) { - if (!bKeyboardRead) - ReadKeyboard(); - return qKeyboardState[nCode & 0xFF]; - } - - if (nCode < 0x4000) - return 0; - - if (nCode < 0x8000) { - if (!bJoystickRead) - ReadJoystick(); - - int joystick = (nCode - 0x4000) >> 8; - return JoystickState(joystick, nCode & 0xFF); - } - - return 0; -} - -int QtInputFind(bool CreateBaseline) -{ - if (!bKeyboardRead) - ReadKeyboard(); - - for (int i = 0; i < 256; i++) - if (qKeyboardState[i]) - return i; - - return -1; -} - -int QtInputGetControlName(int nCode, TCHAR* pszDeviceName, TCHAR* pszControlName) -{ - pszDeviceName[0] = '\0'; - pszControlName[0] = '\0'; - - if (nCode < 256) { - strcpy(pszControlName, QString("Key %1").arg(nCode).toLatin1().data()); - strcpy(pszDeviceName, "Keyboard"); - return 0; - } - - return 0; -} - -struct InputInOut InputInOutQt = { QtInputInit, QtInputExit, - QtInputSetCooperativeLevel, QtInputStart, - QtInputState, QtInputJoyAxis, QtInputMouseAxis, - QtInputFind, QtInputGetControlName, NULL, - ("Qt") }; - - -QInputInterface *QInputInterface::m_onlyInstance = nullptr; -QInputInterface::QInputInterface(QObject *parent) : - QObject(parent) -{ - memset(m_keys, 0, QINPUT_MAX_KEYS); - m_isInitialized = false; - joystickInit(); -} - -bool QInputInterface::joystickInit() -{ - if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) { - qDebug() << "SDL Joystick initialization error!" << SDL_GetError(); - return false; - } - - int nJoys = SDL_NumJoysticks(); - - m_joysticks.clear(); - m_joysticks.resize(nJoys); - - for (int i = 0; i < nJoys; i++) { - SDL_Joystick *joystick = SDL_JoystickOpen(i); - if (joystick == nullptr) - qDebug() << "joystick error:" << i; - else - m_joysticks[i] = joystick; - } - - SDL_JoystickEventState(SDL_IGNORE); - - return true; -} - -void QInputInterface::joystickExit() -{ - foreach (SDL_Joystick *joystick, m_joysticks) - SDL_JoystickClose(joystick); - - m_joysticks.clear(); - - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); -} - -void QInputInterface::joystickUpdate() -{ - SDL_JoystickUpdate(); -} - -int QInputInterface::joystickHat(int joy, int hat) -{ - if (m_joysticks.empty()) - return 0; - - if (joy >= m_joysticks.size() || joy < 0) - return 0; - - if (hat > SDL_JoystickNumHats(m_joysticks[joy])) - return 0; - - return SDL_JoystickGetHat(m_joysticks[joy], hat); -} - -int QInputInterface::joystickAxis(int joy, int axis) -{ - if (m_joysticks.empty()) - return 0; - - if (joy >= m_joysticks.size() || joy < 0) - return 0; - - if (axis > SDL_JoystickNumAxes(m_joysticks[joy])) - return 0; - - return SDL_JoystickGetAxis(m_joysticks[joy], axis); -} - -int QInputInterface::joystickButton(int joy, int button) -{ - if (m_joysticks.empty()) - return 0; - - if (joy >= m_joysticks.size() || joy < 0) - return 0; - - if (button > SDL_JoystickNumButtons(m_joysticks[joy])) - return 0; - - return SDL_JoystickGetButton(m_joysticks[joy], button); -} - -QInputInterface::~QInputInterface() -{ - if (m_isInitialized) - uninstall(); - m_onlyInstance = nullptr; - joystickExit(); -} - -QInputInterface *QInputInterface::get(QObject *parent) -{ - if (m_onlyInstance != nullptr) - return m_onlyInstance; - m_onlyInstance = new QInputInterface(parent); - return m_onlyInstance; -} - -void QInputInterface::install() -{ - qApp->installEventFilter(this); - m_isInitialized = true; -} - -void QInputInterface::uninstall() -{ - qApp->removeEventFilter(this); - m_isInitialized = false; -} - -int QInputInterface::joystickCount() -{ - return m_joysticks.size(); -} - -void QInputInterface::snapshot(char *buffer, int keys) -{ - if (keys >= QINPUT_MAX_KEYS) - keys = QINPUT_MAX_KEYS; - memcpy(buffer, m_keys, keys); -} - -int QInputInterface::state(int key) -{ - if (key >= 0 && key < 256) - return m_keys[key]; - return 0; -} - -bool QInputInterface::eventFilter(QObject *obj, QEvent *event) -{ - if (event->type() == QEvent::KeyPress) { - QKeyEvent *keyEvent = static_cast(event); - int fbak = QtKToFBAK(keyEvent->key()); - if (fbak < QINPUT_MAX_KEYS) - m_keys[fbak] = 1; - } - if (event->type() == QEvent::KeyRelease) { - QKeyEvent *keyEvent = static_cast(event); - int fbak = QtKToFBAK(keyEvent->key()); - if (fbak < QINPUT_MAX_KEYS) - m_keys[fbak] = 0; - } - return false; -} - - -int QtKToFBAK(int key) -{ - /* - * TODO: - * FBK_CAPITAL 0x3A - * RIGHT-(SHIFT/CONTROL/ALT) - * NUMPADS - */ - switch (key) { - case Qt::Key_Escape: return FBK_ESCAPE; - case Qt::Key_0: return FBK_0; - case Qt::Key_1: return FBK_1; - case Qt::Key_2: return FBK_2; - case Qt::Key_3: return FBK_3; - case Qt::Key_4: return FBK_4; - case Qt::Key_5: return FBK_5; - case Qt::Key_6: return FBK_6; - case Qt::Key_7: return FBK_7; - case Qt::Key_8: return FBK_8; - case Qt::Key_9: return FBK_9; - case Qt::Key_Minus: return FBK_MINUS; - case Qt::Key_Equal: return FBK_EQUALS; - case Qt::Key_Back: return FBK_BACK; - case Qt::Key_Tab: return FBK_TAB; - case Qt::Key_Q: return FBK_Q; - case Qt::Key_W: return FBK_W; - case Qt::Key_E: return FBK_E; - case Qt::Key_R: return FBK_R; - case Qt::Key_T: return FBK_T; - case Qt::Key_Y: return FBK_Y; - case Qt::Key_U: return FBK_U; - case Qt::Key_I: return FBK_I; - case Qt::Key_O: return FBK_O; - case Qt::Key_P: return FBK_P; - case Qt::Key_BracketLeft: return FBK_LBRACKET; - case Qt::Key_BracketRight: return FBK_RBRACKET; - case Qt::Key_Return: return FBK_RETURN; - case Qt::Key_Control: return FBK_LCONTROL; - case Qt::Key_A: return FBK_A; - case Qt::Key_S: return FBK_S; - case Qt::Key_D: return FBK_D; - case Qt::Key_F: return FBK_F; - case Qt::Key_G: return FBK_G; - case Qt::Key_H: return FBK_H; - case Qt::Key_J: return FBK_J; - case Qt::Key_K: return FBK_K; - case Qt::Key_L: return FBK_L; - case Qt::Key_Semicolon: return FBK_SEMICOLON; - case Qt::Key_Apostrophe: return FBK_APOSTROPHE; - case Qt::Key_Dead_Grave: return FBK_GRAVE; - case Qt::Key_Shift: return FBK_LSHIFT; - case Qt::Key_Backslash: return FBK_BACKSLASH; - case Qt::Key_Z: return FBK_Z; - case Qt::Key_X: return FBK_X; - case Qt::Key_C: return FBK_C; - case Qt::Key_V: return FBK_V; - case Qt::Key_B: return FBK_B; - case Qt::Key_N: return FBK_N; - case Qt::Key_M: return FBK_M; - case Qt::Key_Comma: return FBK_COMMA; - case Qt::Key_Period: return FBK_PERIOD; - case Qt::Key_Slash: return FBK_SLASH; - case Qt::Key_multiply: return FBK_MULTIPLY; - case Qt::Key_Alt: return FBK_LALT; - case Qt::Key_Space: return FBK_SPACE; - case Qt::Key_F1: return FBK_F1; - case Qt::Key_F2: return FBK_F2; - case Qt::Key_F3: return FBK_F3; - case Qt::Key_F4: return FBK_F4; - case Qt::Key_F5: return FBK_F5; - case Qt::Key_F6: return FBK_F6; - case Qt::Key_F7: return FBK_F7; - case Qt::Key_F8: return FBK_F8; - case Qt::Key_F9: return FBK_F9; - case Qt::Key_F10: return FBK_F10; - case Qt::Key_NumLock: return FBK_NUMLOCK; - case Qt::Key_ScrollLock: return FBK_SCROLL; - case Qt::Key_Pause: return FBK_PAUSE; - case Qt::Key_Home: return FBK_HOME; - case Qt::Key_Up: return FBK_UPARROW; - case Qt::Key_PageUp: return FBK_PRIOR; - case Qt::Key_Left: return FBK_LEFTARROW; - case Qt::Key_Right: return FBK_RIGHTARROW; - case Qt::Key_End: return FBK_END; - case Qt::Key_Down: return FBK_DOWNARROW; - case Qt::Key_PageDown: return FBK_NEXT; - case Qt::Key_Insert: return FBK_INSERT; - case Qt::Key_Delete: return FBK_DELETE; - case Qt::Key_F11: return FBK_F11; - case Qt::Key_F12: return FBK_F12; - case Qt::Key_F13: return FBK_F13; - case Qt::Key_F14: return FBK_F14; - case Qt::Key_F15: return FBK_F15; - default: - return 0; - } - return 0; -} diff --git a/jan/src/burner/qt/qinputinterface.h b/jan/src/burner/qt/qinputinterface.h deleted file mode 100644 index cb0590b83..000000000 --- a/jan/src/burner/qt/qinputinterface.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef QINPUTINTERFACE_H -#define QINPUTINTERFACE_H - -#include -#include -#include "SDL.h" - -#define QINPUT_MAX_KEYS 256 - -class QInputInterface : public QObject -{ - Q_OBJECT - explicit QInputInterface(QObject *parent = 0); - static QInputInterface *m_onlyInstance; - char m_keys[QINPUT_MAX_KEYS]; - bool m_isInitialized; - QVector m_joysticks; - bool joystickInit(); - void joystickExit(); -public: - ~QInputInterface(); - static QInputInterface *get(QObject *parent=nullptr); - void install(); - void uninstall(); - int joystickCount(); - void joystickUpdate(); - int joystickHat(int joy, int hat); - int joystickAxis(int joy, int axis); - int joystickButton(int joy, int button); - void snapshot(char *buffer, int keys=QINPUT_MAX_KEYS); - int state(int key); -protected: - bool eventFilter(QObject *obj, QEvent *event); -}; - -#endif // QINPUTINTERFACE_H diff --git a/jan/src/burner/qt/qutil.cpp b/jan/src/burner/qt/qutil.cpp deleted file mode 100644 index 1f07ed374..000000000 --- a/jan/src/burner/qt/qutil.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include -#include -#include "qutil.h" - -namespace util { - -const QString appConfigName("config/fbaqt.ini"); - -void fixPath(QString &path) -{ - if (!path.isEmpty()) { - QChar lastChar = path.at(path.size() - 1); - if (lastChar != QChar('\\') && lastChar != QChar('/')) - path.append('/'); - } -} - -void PathHandler::editorToString() -{ - if (str == nullptr || edit == nullptr) - return; - QByteArray bytes; - QString path = edit->text(); - fixPath(path); - bytes = path.toLocal8Bit(); - _sntprintf(str, MAX_PATH, bytes.data()); -} - -void PathHandler::stringToEditor() -{ - if (edit == nullptr) - return; - edit->setText(QString(str)); -} - -void PathHandler::browse(QWidget *parent) -{ - QString path = QFileDialog::getExistingDirectory(parent); - if (path.isEmpty()) - return; - if (edit == nullptr) - return; - edit->setText(path); -} - -QString loadText(const QString &fileName) -{ - QFile file(fileName); - if (file.exists()) { - file.open(QFile::ReadOnly | QFile::Text); - return QString(file.readAll()); - } - return QString(); -} - -struct FlagDescription { - unsigned flags; - QString name; -}; - -static FlagDescription genreDescription[] = { - { GBF_HORSHOOT, QT_TR_NOOP("Shooter - Horizontal") }, - { GBF_VERSHOOT, QT_TR_NOOP("Shooter - Vertical") }, - { GBF_SCRFIGHT, QT_TR_NOOP("Fighter - Scrolling") }, - { GBF_VSFIGHT, QT_TR_NOOP("Fighter - Versus") }, - { GBF_BIOS, QT_TR_NOOP("BIOS") }, - { GBF_BREAKOUT, QT_TR_NOOP("Breakout") }, - { GBF_CASINO, QT_TR_NOOP("Casino") }, - { GBF_BALLPADDLE, QT_TR_NOOP("Ball & Paddle") }, - { GBF_MAZE, QT_TR_NOOP("Maze") }, - { GBF_MINIGAMES, QT_TR_NOOP("Mini-Games") }, - { GBF_PINBALL, QT_TR_NOOP("Pinball") }, - { GBF_PLATFORM, QT_TR_NOOP("Platform") }, - { GBF_PUZZLE, QT_TR_NOOP("Puzzle") }, - { GBF_QUIZ, QT_TR_NOOP("Quiz") }, - { GBF_SPORTSFOOTBALL, QT_TR_NOOP("Sports - Football") }, - { GBF_SPORTSMISC, QT_TR_NOOP("Sports - Misc") }, - { GBF_MISC, QT_TR_NOOP("Misc") }, - { GBF_MAHJONG, QT_TR_NOOP("Mahjong") }, - { GBF_RACING, QT_TR_NOOP("Racing") }, - { GBF_SHOOT, QT_TR_NOOP("Shooter - Other") }, -}; -static const int genreDescriptionSize = sizeof(genreDescription) / sizeof(FlagDescription); - -static FlagDescription familyDescription[] = { - { FBF_MSLUG, QT_TR_NOOP("Metal Slug") }, - { FBF_19XX, QT_TR_NOOP("19XX") }, - { FBF_DSTLK, QT_TR_NOOP("Darkstalkers") }, - { FBF_FATFURY, QT_TR_NOOP("Fatal Fury") }, - { FBF_KOF, QT_TR_NOOP("King of Fighters") }, - { FBF_PWRINST, QT_TR_NOOP("Power Instinct") }, - { FBF_SAMSHO, QT_TR_NOOP("Samurai Shodown") }, - { FBF_SF, QT_TR_NOOP("Street Fighter") }, - { FBF_SONICWI, QT_TR_NOOP("Aero Fighters") }, -}; -static const int familyDescriptionSize = sizeof(familyDescription) / sizeof(FlagDescription); - - -static FlagDescription boardDescription[] = { - { BDF_PROTOTYPE, QT_TR_NOOP("Prototype") }, - { BDF_BOOTLEG, QT_TR_NOOP("Bootleg") }, - { BDF_HACK, QT_TR_NOOP("Hack") }, - { BDF_DEMO, QT_TR_NOOP("Demo") }, - { BDF_HOMEBREW, QT_TR_NOOP("Homebrew") }, - -}; -static const int boardDescriptionSize = sizeof(boardDescription) / sizeof(FlagDescription); - -QString decorateGenre() -{ - unsigned genre = BurnDrvGetGenreFlags(); - unsigned family = BurnDrvGetFamilyFlags(); - - QStringList decorated; - - for (int i = 0; i < genreDescriptionSize; i++) { - if (genreDescription[i].flags & genre) - decorated << genreDescription[i].name; - } - - for (int i = 0; i < familyDescriptionSize; i++) { - if (familyDescription[i].flags & family) - decorated << familyDescription[i].name; - } - - return decorated.join(", "); -} - -QString decorateRomInfo() -{ - unsigned flags = BurnDrvGetFlags(); - QStringList decorated; - - for (int i = 0; i < boardDescriptionSize; i++) { - if (boardDescription[i].flags & flags) - decorated << boardDescription[i].name; - } - - decorated << QObject::tr("%0 players max").arg(BurnDrvGetMaxPlayers()); - - QString board(BurnDrvGetText(DRV_BOARDROM)); - if (!board.isEmpty()) - decorated << QObject::tr("uses board-ROMs from %0").arg(board); - - return decorated.join(", "); -} - -} diff --git a/jan/src/burner/qt/qutil.h b/jan/src/burner/qt/qutil.h deleted file mode 100644 index 974bed0a4..000000000 --- a/jan/src/burner/qt/qutil.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef QUTIL_H -#define QUTIL_H - -#include -#include -#include -#include "burner.h" - -namespace util { - -struct PathHandler { - TCHAR *str; - QLineEdit *edit; - int number; - PathHandler(TCHAR *s=nullptr, QLineEdit *e=nullptr, int n=-1) { - str = s; - edit = e; - number = n; - } - void editorToString(); - void stringToEditor(); - void browse(QWidget *parent=nullptr); -}; - -void fixPath(QString &path); -QString loadText(const QString &fileName); - -extern const QString appConfigName; -QString decorateGenre(); -QString decorateRomInfo(); - -} - -#endif // QUTIL_H diff --git a/jan/src/burner/qt/resource/about.bmp b/jan/src/burner/qt/resource/about.bmp deleted file mode 100644 index 938ae09a0..000000000 Binary files a/jan/src/burner/qt/resource/about.bmp and /dev/null differ diff --git a/jan/src/burner/qt/resource/branch-closed.png b/jan/src/burner/qt/resource/branch-closed.png deleted file mode 100644 index 45c40bf99..000000000 Binary files a/jan/src/burner/qt/resource/branch-closed.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/branch-end.png b/jan/src/burner/qt/resource/branch-end.png deleted file mode 100644 index 469d93ed2..000000000 Binary files a/jan/src/burner/qt/resource/branch-end.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/branch-more.png b/jan/src/burner/qt/resource/branch-more.png deleted file mode 100644 index 2ec5d376d..000000000 Binary files a/jan/src/burner/qt/resource/branch-more.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/branch-open.png b/jan/src/burner/qt/resource/branch-open.png deleted file mode 100644 index d62a0ae4c..000000000 Binary files a/jan/src/burner/qt/resource/branch-open.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/checked.png b/jan/src/burner/qt/resource/checked.png deleted file mode 100644 index a84840285..000000000 Binary files a/jan/src/burner/qt/resource/checked.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/dark-flat-bg.png b/jan/src/burner/qt/resource/dark-flat-bg.png deleted file mode 100644 index c27562975..000000000 Binary files a/jan/src/burner/qt/resource/dark-flat-bg.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/dark-flat.css b/jan/src/burner/qt/resource/dark-flat.css deleted file mode 100644 index 82d1d4175..000000000 --- a/jan/src/burner/qt/resource/dark-flat.css +++ /dev/null @@ -1,501 +0,0 @@ - -QWidget, QDialog -{ - background: url(:resource/dark-flat-bg.png); - color: #EFF0EF; -} - -QHeaderView::section -{ - border: none; - border-top: 0.5px solid #686868; - border-bottom: 0.5px solid #0f0f0f; - padding-left: 4px; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #4a4a4a, - stop: 1.0 #2b2b2b ); -} - -QPushButton -{ - border: 0.5px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #686868 ); - padding: 2px; - padding-left: 8px; - padding-right: 8px; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #4a4a4a, - stop: 1.0 #2b2b2b ); -} - -QPushButton:hover -{ - border: 0.5px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #686868 ); - padding: 2px; - padding-left: 8px; - padding-right: 8px; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #8c8c8c, - stop: 1.0 #515152 ); -} - -QPushButton:focus -{ - outline: 0; - border: 0.5px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #2e65a9 ); - padding: 2px; - padding-left: 8px; - padding-right: 8px; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #4282e5, - stop: 1.0 #142dd8 ); -} - -QPushButton#btnPlay -{ - outline: 0; - border: 0.5px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #652ea9 ); - padding: 2px; - padding-left: 8px; - padding-right: 8px; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #8242e5, - stop: 1.0 #2d14d8 ); -} - -QPushButton#btnPlay:hover -{ - border: 0.5px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #686868 ); - padding: 2px; - padding-left: 8px; - padding-right: 8px; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #8242e5, - stop: 1.0 #2da4d8 ); -} - -QLineEdit, QTextEdit, QSpinBox -{ - background: #1f1f1f; - border: 1px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #1f1f1f ); -} - -QTreeWidget -{ - background: #1f1f1f; - border: 1px solid #0f0f0f; - alternate-background-color: #1d1d1d; -} - - -QTreeWidget:item:selected, QTreeView::branch:selected -{ - outline: 0; - border: none; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #4282e5, - stop: 1.0 #142dd8 ); -} - -QTreeView::branch:has-siblings:!adjoins-item { - border-image: url(:resource/vline.png) 0; -} - -QTreeView::branch:has-siblings:adjoins-item { - border-image: url(:resource/branch-more.png) 0; -} - -QTreeView::branch:!has-children:!has-siblings:adjoins-item { - border-image: url(:resource/branch-end.png) 0; -} - -QTreeView::branch:has-children:!has-siblings:closed, -QTreeView::branch:closed:has-children:has-siblings { - border-image: none; - image: url(:resource/branch-closed.png); -} - -QTreeView::branch:open:has-children:!has-siblings, -QTreeView::branch:open:has-children:has-siblings { - border-image: none; - image: url(:resource/branch-open.png); -} - -QMenuBar -{ - background: url(:resource/dark-flat-bg.png); - border: 1px solid #0f0f0f; - color: white; -} - - -QMenuBar:item -{ - background: transparent; -} - -QMenuBar:item:pressed -{ - color: white; - - outline: 0; - border: 0.5px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #2e65a9 ); - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #4282e5, - stop: 1.0 #142dd8 ); -} - -QMenu -{ - background: url(:resource/dark-flat-bg.png); - border: 1px solid #0f0f0f; - color: white; - /*padding: 2px; - padding-left: 8px; - padding-right: 8px;*/ -} - -QMenu::item::selected -{ - - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #4282e5, - stop: 1.0 #142dd8 ); -} - -QMenu::separator -{ - width: 100%; - height: 1px; - margin-left: 5%; - margin-right: 5%; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #686868 ); -} - -QLabel#imgTitleScreen, QLabel#imgPreview -{ - border: 1px solid #0f0f0f; -} - -QToolTip -{ - border: 1px solid black; - background-color: #FFFF99; - border-radius: 2px; - padding: 0px; - color: black; -} - -QComboBox -{ - border: 0.5px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #686868 ); - - padding-left: 4px; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #4a4a4a, - stop: 1.0 #2b2b2b ); -} - -QComboBox::drop-down -{ - border: none; - padding: 3px; -} - -QComboBox QAbstractItemView -{ - background-color: #1f1f1f; - border: 1px solid #0f0f0f; -} - - -QComboBox::down-arrow -{ - image: url(:resource/down_arrow.png); -} - -QGroupBox -{ - spacing: 5px; - padding-top: 20px; - background: #1f1f1f; - border: 1px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #1f1f1f ); -} - -QCheckBox -{ - outline: 0; - background: none; - width: 13px; - height: 13px; -} - -QCheckBox::indicator -{ - width: 16px; - height: 16px; - background: #2f2f2f; - border: 1px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #1f1f1f ); -} - -QCheckBox::indicator:hover -{ - width: 16px; - height: 16px; - background: #3f3f3f; - border: 1px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #1f1f1f ); -} - -QCheckBox::indicator:checked -{ - width: 16px; - height: 16px; - background-image: url(:resource/checked.png); - background-position: center; - background-repeat: no-repeat; - - border: 1px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #1f1f1f ); -} - - -/*****************/ -QScrollBar:horizontal { - border: 1px solid #222222; - background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); - height: 16px; - margin: 0px 20px 0 20px; -} - -QScrollBar::handle:horizontal -{ - background: QLinearGradient( x1:0 y1:1, x2:0 y2:0, stop:0 #676767, stop:0.5 #878787, stop:0.51 #979797, stop:1 #a7a7a7); - border-radius: 1px; - min-width: 16px; - border: 1px solid #202020; -} - -QScrollBar::add-line:horizontal { - border: 1px solid #1b1b19; - background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); - width: 20px; - subcontrol-position: right; - subcontrol-origin: margin; -} - -QScrollBar::sub-line:horizontal { - border: 1px solid #1b1b19; - background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); - width: 20px; - subcontrol-position: left; - subcontrol-origin: margin; -} - -QScrollBar::right-arrow:horizontal -{ - background-image: url(:resource/right_arrow.png); - background-position: center; - background-repeat: no-repeat; - border: none; -} - -QScrollBar::left-arrow:horizontal -{ - background-image: url(:resource/left_arrow.png); - background-position: center; - background-repeat: no-repeat; - border: none; -} - -QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal -{ - background: none; -} - -/*****************************/ -QScrollBar:vertical -{ - background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); - width: 16px; - margin: 20px 0 20px 0; - border: 1px solid #222222; -} - -QScrollBar::handle:vertical -{ - background: QLinearGradient( x1:1 y1:0, x2:0 y2:0, stop:0 #676767, stop:0.5 #878787, stop:0.51 #979797, stop:1 #a7a7a7); - border-radius: 1px; - min-height: 16px; - border: 1px solid #202020; -} - -QScrollBar::add-line:vertical -{ - border: 1px solid #1b1b19; - background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); - height: 20px; - subcontrol-position: bottom; - subcontrol-origin: margin; -} - -QScrollBar::sub-line:vertical -{ - border: 1px solid #1b1b19; - background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); - height: 20px; - subcontrol-position: top; - subcontrol-origin: margin; -} - -QScrollBar::up-arrow:vertical -{ - background-image: url(:resource/up_arrow.png); - background-position: center; - background-repeat: no-repeat; - border: none; -} - -QScrollBar::down-arrow:vertical -{ - background-image: url(:resource/down_arrow.png); - background-position: center; - background-repeat: no-repeat; - border: none; -} - -QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical -{ - background: none; -} - -QTabWidget::pane -{ - outline: 0; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #686868 ); -} - -QTabBar -{ - outline: 0; -} - -QTabBar::tab -{ - border: 0.5px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #686868 ); - border-bottom: none; - padding-left: 3px; - padding-right: 3px; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #4a4a4a, - stop: 1.0 #2b2b2b ); - color: white; -} - -QTabBar::tab::selected -{ - border: 0.5px solid #0f0f0f; - border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #686868 ); - border-bottom: none; - padding-left: 3px; - padding-right: 3px; - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #8c8c8c, - stop: 1.0 #515152 ); - color: white; -} - -QProgressBar -{ - background: #1f1f1f; - border: 1px solid #0f0f0f; - text-align: center; - color: white; -} - -QProgressBar::chunk -{ -border-top: 2px solid - qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0.0 #0f0f0f, - stop: 1.0 #686868 ); -background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #8242e5, - stop: 1.0 #2da4d8 ); - width: 1px; -} diff --git a/jan/src/burner/qt/resource/down_arrow.png b/jan/src/burner/qt/resource/down_arrow.png deleted file mode 100644 index db581cb78..000000000 Binary files a/jan/src/burner/qt/resource/down_arrow.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/left_arrow.png b/jan/src/burner/qt/resource/left_arrow.png deleted file mode 100644 index 3586ea471..000000000 Binary files a/jan/src/burner/qt/resource/left_arrow.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/misc.bmp b/jan/src/burner/qt/resource/misc.bmp deleted file mode 100644 index 408da009c..000000000 Binary files a/jan/src/burner/qt/resource/misc.bmp and /dev/null differ diff --git a/jan/src/burner/qt/resource/right_arrow.png b/jan/src/burner/qt/resource/right_arrow.png deleted file mode 100644 index 0172f02c7..000000000 Binary files a/jan/src/burner/qt/resource/right_arrow.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/splash.bmp b/jan/src/burner/qt/resource/splash.bmp deleted file mode 100644 index 1690a818d..000000000 Binary files a/jan/src/burner/qt/resource/splash.bmp and /dev/null differ diff --git a/jan/src/burner/qt/resource/tv-not-found-non-essential.ico b/jan/src/burner/qt/resource/tv-not-found-non-essential.ico deleted file mode 100644 index 367cb47cf..000000000 Binary files a/jan/src/burner/qt/resource/tv-not-found-non-essential.ico and /dev/null differ diff --git a/jan/src/burner/qt/resource/tv-not-found.ico b/jan/src/burner/qt/resource/tv-not-found.ico deleted file mode 100644 index 9cfa60df9..000000000 Binary files a/jan/src/burner/qt/resource/tv-not-found.ico and /dev/null differ diff --git a/jan/src/burner/qt/resource/tv-not-working.ico b/jan/src/burner/qt/resource/tv-not-working.ico deleted file mode 100644 index 9149eeba3..000000000 Binary files a/jan/src/burner/qt/resource/tv-not-working.ico and /dev/null differ diff --git a/jan/src/burner/qt/resource/up_arrow.png b/jan/src/burner/qt/resource/up_arrow.png deleted file mode 100644 index f28e1420d..000000000 Binary files a/jan/src/burner/qt/resource/up_arrow.png and /dev/null differ diff --git a/jan/src/burner/qt/resource/vline.png b/jan/src/burner/qt/resource/vline.png deleted file mode 100644 index d633d8de8..000000000 Binary files a/jan/src/burner/qt/resource/vline.png and /dev/null differ diff --git a/jan/src/burner/qt/romdirsdialog.cpp b/jan/src/burner/qt/romdirsdialog.cpp deleted file mode 100644 index e30f99ef8..000000000 --- a/jan/src/burner/qt/romdirsdialog.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include -#include "romdirsdialog.h" -#include "ui_romdirsdialog.h" -#include "burner.h" - -TCHAR szAppRomPaths[DIRS_MAX][MAX_PATH] = { { _T("roms/") } }; - -RomDirsDialog::RomDirsDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::RomDirsDialog) -{ - ui->setupUi(this); - setWindowTitle(tr("Edit ROM paths")); - - m_group = new QButtonGroup(this); - m_group->addButton(ui->btnEditPath1, 0); - m_group->addButton(ui->btnEditPath2, 1); - m_group->addButton(ui->btnEditPath3, 2); - m_group->addButton(ui->btnEditPath4, 3); - - m_handlers[0] = util::PathHandler(szAppRomPaths[0], ui->lePath1, 0); - m_handlers[1] = util::PathHandler(szAppRomPaths[1], ui->lePath2, 1); - m_handlers[2] = util::PathHandler(szAppRomPaths[2], ui->lePath3, 2); - m_handlers[3] = util::PathHandler(szAppRomPaths[3], ui->lePath4, 3); - - connect(m_group, SIGNAL(buttonClicked(int)), this, SLOT(editPath(int))); - - load(); -} - -RomDirsDialog::~RomDirsDialog() -{ - save(); - delete ui; -} - -int RomDirsDialog::exec() -{ - for (int i = 0; i < DIRS_MAX; i++) - m_handlers[i].stringToEditor(); - - if (QDialog::exec() == QDialog::Accepted) { - for (int i = 0; i < DIRS_MAX; i++) - m_handlers[i].editorToString(); - } -} - -void RomDirsDialog::editPath(int no) -{ - m_handlers[no].browse(this); -} - -bool RomDirsDialog::load() -{ - QSettings settings(util::appConfigName, QSettings::IniFormat); - if (settings.status() == QSettings::AccessError) - return false; - - settings.beginReadArray("rom_directories"); - - for (int i = 0; i < DIRS_MAX; i++) { - settings.setArrayIndex(i); - QString path(settings.value("path").toString()); - if (!path.isEmpty()) { - m_handlers[i].edit->setText(settings.value("path").toString()); - m_handlers[i].editorToString(); - } - } - - settings.endArray(); -} - -bool RomDirsDialog::save() -{ - QSettings settings(util::appConfigName, QSettings::IniFormat); - if (!settings.isWritable()) - return false; - - settings.beginWriteArray("rom_directories"); - - for (int i = 0; i < DIRS_MAX; i++) { - settings.setArrayIndex(i); - settings.setValue("path", m_handlers[i].edit->text()); - } - - settings.endArray(); - settings.sync(); -} diff --git a/jan/src/burner/qt/romdirsdialog.h b/jan/src/burner/qt/romdirsdialog.h deleted file mode 100644 index a46ff4b6d..000000000 --- a/jan/src/burner/qt/romdirsdialog.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ROMDIRSDIALOG_H -#define ROMDIRSDIALOG_H - -#include -#include -#include "qutil.h" - -namespace Ui { -class RomDirsDialog; -} - -class RomDirsDialog : public QDialog -{ - Q_OBJECT - -public: - explicit RomDirsDialog(QWidget *parent = 0); - ~RomDirsDialog(); - -public slots: - int exec(); - void editPath(int no); - bool load(); - bool save(); -private: - Ui::RomDirsDialog *ui; - int m_activePath; - QButtonGroup *m_group; - - util::PathHandler m_handlers[DIRS_MAX]; - -}; - -#endif // ROMDIRSDIALOG_H diff --git a/jan/src/burner/qt/romdirsdialog.ui b/jan/src/burner/qt/romdirsdialog.ui deleted file mode 100644 index 1f2b2a2f2..000000000 --- a/jan/src/burner/qt/romdirsdialog.ui +++ /dev/null @@ -1,188 +0,0 @@ - - - RomDirsDialog - - - - 0 - 0 - 510 - 244 - - - - Dialog - - - true - - - - - - - - Path #1 - - - - - - - true - - - - - - - Browse - - - - - - - - - - - Path #2 - - - - - - - true - - - - - - - Browse - - - - - - - - - - - Path #3 - - - - - - - true - - - - - - - Browse - - - - - - - - - - - Path #4 - - - - - - - true - - - - - - - Browse - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Cancel - - - - - - - Ok - - - - - - - - - - - btnCancel - clicked() - RomDirsDialog - reject() - - - 239 - 192 - - - 160 - 198 - - - - - btnOk - clicked() - RomDirsDialog - accept() - - - 355 - 197 - - - 316 - 217 - - - - - diff --git a/jan/src/burner/qt/rominfodialog.cpp b/jan/src/burner/qt/rominfodialog.cpp deleted file mode 100644 index 6861a5e1c..000000000 --- a/jan/src/burner/qt/rominfodialog.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include -#include "rominfodialog.h" -#include "ui_rominfodialog.h" -#include "burner.h" - -RomInfoDialog::RomInfoDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::RomInfoDialog) -{ - ui->setupUi(this); -} - -RomInfoDialog::~RomInfoDialog() -{ - delete ui; -} - -void RomInfoDialog::setDriverNo(int no) -{ - clear(); - m_driverNo = no; - - int tmp = nBurnDrvActive; - - nBurnDrvActive = m_driverNo; - setWindowTitle(QString(BurnDrvGetText(DRV_FULLNAME))); - for (int i = 0; i < 0x100; i++) { - BurnRomInfo info; - char *romName = nullptr; - memset(&info, 0, sizeof(info)); - BurnDrvGetRomInfo(&info, i); - BurnDrvGetRomName(&romName, i, 0); - - if (info.nLen == 0 || info.nType & BRF_BIOS) - continue; - - QTreeWidgetItem *item = new QTreeWidgetItem(); - item->setText(0, QString(romName)); - item->setText(1, QString::number(info.nLen)); - - - item->setText(2, QString::number(info.nCrc, 16)); - - QStringList type; - if (info.nType & BRF_ESS) - type << "Essential"; - if (info.nType & BRF_OPT) - type << "Optional"; - if (info.nType & BRF_PRG) - type << "Program"; - if (info.nType & BRF_GRA) - type << "Graphics"; - if (info.nType & BRF_SND) - type << "Sound"; - if (info.nType & BRF_BIOS) - type << "BIOS"; - item->setText(3, type.join(", ")); - - if (info.nType & BRF_NODUMP) - item->setText(4, "No Dump"); - - item->setTextAlignment(0, Qt::AlignLeft); - item->setTextAlignment(1, Qt::AlignRight); - item->setTextAlignment(2, Qt::AlignRight); - ui->tvRoms->addTopLevelItem(item); - } - - nBurnDrvActive = tmp; -} - -void RomInfoDialog::clear() -{ - ui->tvRoms->clear(); -} diff --git a/jan/src/burner/qt/rominfodialog.h b/jan/src/burner/qt/rominfodialog.h deleted file mode 100644 index 1518ef3e5..000000000 --- a/jan/src/burner/qt/rominfodialog.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef ROMINFODIALOG_H -#define ROMINFODIALOG_H - -#include - -namespace Ui { -class RomInfoDialog; -} - -class RomInfoDialog : public QDialog -{ - Q_OBJECT - -public: - explicit RomInfoDialog(QWidget *parent = 0); - ~RomInfoDialog(); - - void setDriverNo(int no); -private: - void clear(); - int m_driverNo; - Ui::RomInfoDialog *ui; -}; - -#endif // ROMINFODIALOG_H diff --git a/jan/src/burner/qt/rominfodialog.ui b/jan/src/burner/qt/rominfodialog.ui deleted file mode 100644 index 1984b5a26..000000000 --- a/jan/src/burner/qt/rominfodialog.ui +++ /dev/null @@ -1,121 +0,0 @@ - - - RomInfoDialog - - - - 0 - 0 - 650 - 358 - - - - Dialog - - - - - - 0 - - - - Rom Info - - - - - - - Name - - - - - Size (bytes) - - - - - CRC32 - - - - - Type - - - - - Flags - - - - - - - - - Sample Info - - - - - - - Name - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Close - - - - - - - - - - - btnClose - clicked() - RomInfoDialog - accept() - - - 604 - 332 - - - 514 - 334 - - - - - diff --git a/jan/src/burner/qt/romscandialog.cpp b/jan/src/burner/qt/romscandialog.cpp deleted file mode 100644 index f7490a5d2..000000000 --- a/jan/src/burner/qt/romscandialog.cpp +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include "romscandialog.h" -#include "ui_romscandialog.h" -#include "burner.h" -#include "version.h" - -RomScanDialog::RomScanDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::RomScanDialog), - m_analyzer(this), - m_settingsName("config/fbaqt.roms.ini") -{ - ui->setupUi(this); - - setWindowTitle(tr("Wait...")); - setFixedSize(size()); - - if (!load()) { - m_status.resize(nBurnDrvCount); - for (int i = 0; i < nBurnDrvCount; i++) - m_status[i] = 0; - } - - connect(&m_analyzer, SIGNAL(finished()), this, SLOT(accept())); - connect(ui->btnCancel, SIGNAL(clicked()), &m_analyzer, SLOT(terminate())); - - connect(&m_analyzer, SIGNAL(setRange(int,int)), - ui->progressBar, SLOT(setRange(int,int))); - connect(&m_analyzer, SIGNAL(setValue(int)), - ui->progressBar, SLOT(setValue(int))); - connect(&m_analyzer, SIGNAL(done()), this, SLOT(save())); - connect(this, SIGNAL(rejected()), &m_analyzer, SLOT(terminate())); -} - -RomScanDialog::~RomScanDialog() -{ - delete ui; -} - -int RomScanDialog::status(int drvNo) -{ - if (drvNo < 0 && drvNo >= nBurnDrvCount) - return 0; - return m_status[drvNo]; -} - -void RomScanDialog::setStatus(int drvNo, char stat) -{ - if (drvNo < 0 && drvNo >= nBurnDrvCount) - return; - m_status[drvNo] = stat; -} - -void RomScanDialog::cancel() -{ - close(); -} - -void RomScanDialog::showEvent(QShowEvent *event) -{ - ui->progressBar->setValue(0); - m_analyzer.start(); -} - -bool RomScanDialog::load() -{ - QSettings settings(m_settingsName, QSettings::IniFormat); - if (settings.status() == QSettings::AccessError) - return false; - - if (settings.value("version") != BURN_VERSION) - return false; - - if (settings.value("drivers") != nBurnDrvCount) - return false; - - m_status = settings.value("status").toByteArray(); - return true; -} - -bool RomScanDialog::save() -{ - QSettings settings(m_settingsName, QSettings::IniFormat); - if (!settings.isWritable()) - return false; - settings.setValue("version", BURN_VERSION); - settings.setValue("drivers", nBurnDrvCount); - settings.setValue("status", m_status); - settings.sync(); - return true; -} - -RomAnalyzer::RomAnalyzer(RomScanDialog *parent) : - m_scanDlg(parent) -{ -} - -void RomAnalyzer::run() -{ - QByteArray &status = m_scanDlg->m_status; - - if (status.size() != nBurnDrvCount) - status.resize(nBurnDrvCount); - - int tmp = nBurnDrvActive; - - emit setRange(0, nBurnDrvCount - 1); - - for (int i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - - emit setValue(i); - - int stat = BzipOpen(1); - switch (stat) { - case 0: - status[i] = 3; - break; - case 2: - status[i] = 1; - break; - case 1: - status[i] = 0; - break; - default: - break; - } - BzipClose(); - } - msleep(100); - emit done(); - nBurnDrvActive = tmp; -} diff --git a/jan/src/burner/qt/romscandialog.h b/jan/src/burner/qt/romscandialog.h deleted file mode 100644 index 760cb0567..000000000 --- a/jan/src/burner/qt/romscandialog.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef ROMSCANDIALOG_H -#define ROMSCANDIALOG_H - -#include -#include -#include - -namespace Ui { -class RomScanDialog; -} - -class RomScanDialog; - -class RomAnalyzer : public QThread { - Q_OBJECT - RomScanDialog *m_scanDlg; -public: - RomAnalyzer(RomScanDialog *parent); -signals: - void setRange(int, int); - void setValue(int); - void done(); -private: - void run(); -}; - -class RomScanDialog : public QDialog -{ - friend class RomAnalyzer; - Q_OBJECT - -public: - explicit RomScanDialog(QWidget *parent = 0); - ~RomScanDialog(); - int status(int drvNo); - void setStatus(int drvNo, char stat); -public slots: - void cancel(); - bool load(); - bool save(); -protected: - virtual void showEvent(QShowEvent *event); -private: - Ui::RomScanDialog *ui; - QByteArray m_status; - RomAnalyzer m_analyzer; - const QString m_settingsName; -}; - -#endif // ROMSCANDIALOG_H diff --git a/jan/src/burner/qt/romscandialog.ui b/jan/src/burner/qt/romscandialog.ui deleted file mode 100644 index c89648e5c..000000000 --- a/jan/src/burner/qt/romscandialog.ui +++ /dev/null @@ -1,87 +0,0 @@ - - - RomScanDialog - - - Qt::NonModal - - - - 0 - 0 - 373 - 80 - - - - Dialog - - - false - - - - - - QFrame::Box - - - QFrame::Sunken - - - - - - :/resource/misc.bmp - - - - - - - - - 0 - - - - - - - - - Scanning ROMs... - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Cancel - - - - - - - - - - - - - - diff --git a/jan/src/burner/qt/rscr.qrc b/jan/src/burner/qt/rscr.qrc deleted file mode 100644 index 4ae6132d5..000000000 --- a/jan/src/burner/qt/rscr.qrc +++ /dev/null @@ -1,23 +0,0 @@ - - - resource/splash.bmp - resource/tv-not-working.ico - resource/tv-not-found.ico - resource/tv-not-found-non-essential.ico - resource/misc.bmp - resource/about.bmp - resource/dark-flat.css - resource/down_arrow.png - resource/left_arrow.png - resource/right_arrow.png - resource/up_arrow.png - resource/dark-flat-bg.png - resource/checked.png - resource/branch-closed.png - resource/branch-end.png - resource/branch-more.png - resource/branch-open.png - resource/vline.png - ../../license.txt - - diff --git a/jan/src/burner/qt/selectdialog.cpp b/jan/src/burner/qt/selectdialog.cpp deleted file mode 100644 index 90105e183..000000000 --- a/jan/src/burner/qt/selectdialog.cpp +++ /dev/null @@ -1,428 +0,0 @@ -#include -#include -#include -#include "selectdialog.h" -#include "ui_selectdialog.h" -#include "burner.h" -#include "rominfodialog.h" -#include "qutil.h" - -SelectDialog::SelectDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::SelectDialog) -{ - ui->setupUi(this); - - m_icoNotFound = QIcon(tr(":/resource/tv-not-found.ico")); - m_icoNotFoundNonEssential = QIcon(tr(":/resource/tv-not-found-non-essential.ico")); - m_icoNotWorking = QIcon(tr(":/resource/tv-not-working.ico")); - - m_defaultImage = QPixmap(tr(":/resource/splash.bmp")); - - m_romInfoDlg = new RomInfoDialog(this); - m_romScanner = new RomScanDialog(this); - m_romPathEditor = new RomDirsDialog(this); - - setWindowTitle(tr("Select Game")); - buildDriverTree(); - - connect(ui->tvDrivers, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), - this, SLOT(driverChange(QTreeWidgetItem*,QTreeWidgetItem*))); - connect(ui->tvDrivers, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), - this, SLOT(driverSelect(QTreeWidgetItem*,int))); - connect(ui->btnRomInfo, SIGNAL(clicked()), this, SLOT(openRomInfo())); - connect(ui->btnScanRoms, SIGNAL(clicked()), this, SLOT(rescanRoms())); - connect(ui->btnRomDirs, SIGNAL(clicked()), this, SLOT(editRomPaths())); - - connect(ui->btnPlay, SIGNAL(clicked()), this, SLOT(playGame())); - - connect(ui->ckbShowAvaliable, SIGNAL(toggled(bool)), this, SLOT(itemShowAvaliable(bool))); - connect(ui->ckbShowUnavaliable, SIGNAL(toggled(bool)), this, SLOT(itemShowUnavaliable(bool))); - connect(ui->ckbShowClones, SIGNAL(toggled(bool)), this, SLOT(itemShowClones(bool))); - connect(ui->ckbUseZipnames, SIGNAL(toggled(bool)), this, SLOT(itemShowZipNames(bool))); - - m_selectedDriver = 0; - - m_showAvailable = true; - m_showUnavailable = true; - m_showClones = true; - m_showZipNames = false; - m_showCount = 0; - - QMenu *contextMenu = new QMenu(ui->tvDrivers); - m_actionScanThis = new QAction("Rescan this romset", contextMenu); - ui->tvDrivers->setContextMenuPolicy(Qt::ActionsContextMenu); - ui->tvDrivers->addAction(m_actionScanThis); - connect(m_actionScanThis, SIGNAL(triggered()), this, SLOT(rescanRomset())); - - connect(ui->btnSearch, SIGNAL(clicked()), this, SLOT(doSearch())); - - // hide zip name column - ui->tvDrivers->setColumnHidden(1, true); - filterDrivers(); -} - -SelectDialog::~SelectDialog() -{ - delete ui; -} - -void SelectDialog::driverChange(QTreeWidgetItem *item, QTreeWidgetItem *prev) -{ - TreeDriverItem *driver = static_cast(item); - int tmp = nBurnDrvActive; - int flags = DRV_ASCIIONLY; - - m_selectedDriver = driver->driverNo(); - - // atualiza as informações sobre o driver - nBurnDrvActive = driver->driverNo(); - ui->leGameInfo->setText(BurnDrvGetText(flags | DRV_FULLNAME)); - updateTitleScreen(); - updatePreview(); - { - QString manufacturer = BurnDrvGetTextA(DRV_MANUFACTURER) ? - BurnDrvGetText(flags | DRV_MANUFACTURER) : tr("Unknown"); - QString date = BurnDrvGetTextA(DRV_DATE); - QString system = BurnDrvGetText(flags | DRV_SYSTEM); - QString prefix = (BurnDrvGetHardwareCode() & HARDWARE_PREFIX_CARTRIDGE) - ? tr("Cartridge") : tr("Hardware"); - QString releaseInfo = QString("%0 (%1, %2 %3)").arg(manufacturer, - date, - system, - prefix); - ui->leReleasedBy->setText(releaseInfo); - } - ui->leRomName->setText(driver->romName()); - ui->leGenre->setText(util::decorateGenre()); - ui->leRomInfo->setText(util::decorateRomInfo()); - - - QString comments(BurnDrvGetText(flags | DRV_COMMENT)); - if (BurnDrvGetFlags() & BDF_HISCORE_SUPPORTED) - comments += tr(", hiscores supported"); - ui->leNotes->setText(comments); - - - nBurnDrvActive = tmp; -} - -void SelectDialog::driverSelect(QTreeWidgetItem *item, int column) -{ - TreeDriverItem *driver = static_cast(item); - m_selectedDriver = driver->driverNo(); - accept(); -} - -void SelectDialog::playGame() -{ - TreeDriverItem *driver = static_cast(ui->tvDrivers->currentItem()); - if (driver != nullptr) { - m_selectedDriver = driver->driverNo(); - accept(); - } -} - - - -void SelectDialog::itemShowAvaliable(bool state) -{ - if (state == m_showAvailable) - return; - m_showAvailable = state; - filterDrivers(); -} - -void SelectDialog::itemShowUnavaliable(bool state) -{ - if (state == m_showUnavailable) - return; - m_showUnavailable = state; - filterDrivers(); -} - -void SelectDialog::itemShowClones(bool state) -{ - if (state == m_showClones) - return; - m_showClones = state; - filterDrivers(); -} - -void SelectDialog::itemShowZipNames(bool state) -{ - if (state == m_showZipNames) - return; - m_showZipNames = state; - - if (m_showZipNames) - ui->tvDrivers->setColumnHidden(1, false); - else - ui->tvDrivers->setColumnHidden(1, true); -} - -void SelectDialog::doSearch() -{ - const QString criteria(ui->leSearch->text()); - if (criteria.isEmpty()) { - filterDrivers(); - return; - } - - QList found = - ui->tvDrivers->findItems(criteria, Qt::MatchContains | Qt::MatchRecursive); - - // hide all drivers - foreach (TreeDriverItem *driver, m_parents.values()) { - if (driver == nullptr) - continue; - driver->setHidden(true); - for (int idx = 0; idx < driver->childCount(); idx++) { - driver->child(idx)->setHidden(true); - } - } - - foreach (QTreeWidgetItem *item, found) { - TreeDriverItem *driver = static_cast(item); - if (!driver->isParent()) { - driver->parent()->setHidden(false); - } - driver->setHidden(false); - } -} - -void SelectDialog::updateTitleScreen() -{ - QString drv = BurnDrvGetTextA(DRV_NAME); - QString path = QString(szAppTitlesPath); - path += QString("%0.png").arg(drv); - if (QFile(path).exists()) { - QPixmap p(path); - ui->imgTitleScreen->setPixmap(p); - } else { - ui->imgTitleScreen->setPixmap(m_defaultImage); - } -} - -void SelectDialog::updatePreview() -{ - QString drv = BurnDrvGetTextA(DRV_NAME); - QString path = QString(szAppPreviewsPath); - path += QString("%0.png").arg(drv); - if (QFile(path).exists()) { - QPixmap p(path); - ui->imgPreview->setPixmap(p); - } else { - ui->imgPreview->setPixmap(m_defaultImage); - } -} - -void SelectDialog::updateLabelCounter() -{ - QString text(tr("Showing %0 of %1 sets"). - arg(m_showCount).arg(nBurnDrvCount)); - ui->lblCounter->setText(text); -} - -int SelectDialog::selectedDriver() const -{ - return m_selectedDriver; -} - -void SelectDialog::openRomInfo() -{ - m_romInfoDlg->setDriverNo(m_selectedDriver); - m_romInfoDlg->exec(); -} - -void SelectDialog::rescanRoms() -{ - if (m_romScanner->exec() == QDialog::Accepted) { - filterDrivers(); - } -} - -void SelectDialog::rescanRomset() -{ - int tmp = nBurnDrvActive; - nBurnDrvActive = m_selectedDriver; - int stat = BzipOpen(1); - switch (stat) { - case 0: - m_romScanner->setStatus(m_selectedDriver, 3); - break; - case 2: - m_romScanner->setStatus(m_selectedDriver, 1); - break; - case 1: - default: - m_romScanner->setStatus(m_selectedDriver, 0); - break; - } - BzipClose(); - nBurnDrvActive = tmp; - filterDrivers(); -} - -void SelectDialog::editRomPaths() -{ - m_romPathEditor->exec(); -} - -void SelectDialog::buildDriverTree() -{ - int nTmpDrv = nBurnDrvActive; - - // build parent list - for (int i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - if (BurnDrvGetFlags() & BDF_BOARDROM) - continue; - - // skip clones - if (BurnDrvGetText(DRV_PARENT) != NULL && (BurnDrvGetFlags() & BDF_CLONE)) - continue; - - TreeDriverItem *ditem = new TreeDriverItem(); - ditem->setIcon(0, m_icoNotFound); - ditem->setFullName(BurnDrvGetText(DRV_ASCIIONLY | DRV_FULLNAME)); - ditem->setText(0, ditem->fullName()); - ditem->setRomName(BurnDrvGetTextA(DRV_NAME)); - ditem->setText(1, ditem->romName()); - ditem->setDriverNo(i); - ditem->setIsParent(true); - ui->tvDrivers->addTopLevelItem(ditem); - m_parents[tr(ditem->romName())] = ditem; - } - - // build clones tree - for (int i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - - if (BurnDrvGetFlags() & BDF_BOARDROM) - continue; - - // skip parents - if (BurnDrvGetTextA(DRV_PARENT) == NULL || !(BurnDrvGetFlags() & BDF_CLONE)) - continue; - - TreeDriverItem *itemParent = m_parents[tr(BurnDrvGetTextA(DRV_PARENT))]; - if (itemParent) { - TreeDriverItem *ditem = new TreeDriverItem(); - ditem->setIcon(0, m_icoNotFound); - ditem->setFullName(BurnDrvGetText(DRV_ASCIIONLY | DRV_FULLNAME)); - ditem->setText(0, ditem->fullName()); - ditem->setRomName(BurnDrvGetTextA(DRV_NAME)); - ditem->setText(1, ditem->romName()); - ditem->setDriverNo(i); - ditem->setIsParent(false); - //ditem->setBackgroundColor(0, QColor(200, 230, 255)); - //ditem->setBackgroundColor(1, QColor(210, 240, 255)); - itemParent->addChild(ditem); - } - } - nBurnDrvActive = nTmpDrv; -} - -bool SelectDialog::isFiltered(TreeDriverItem *driver) -{ - bool status = m_romScanner->status(driver->driverNo()) ? true : false; - - if (!m_showUnavailable) - if (!(m_showAvailable && status)) - return false; - return true; -} - -void SelectDialog::filterDrivers() -{ - auto setupIcon = [&](int stat, TreeDriverItem *item) -> void { - switch (stat) { - case 0: item->setIcon(0, m_icoNotFound); break; - case 2: - case 3: item->setIcon(0, m_icoNotFoundNonEssential); break; - case 1: item->setIcon(0, m_icoNotWorking); break; - } - }; - - m_showCount = 0; - foreach (TreeDriverItem *driver, m_parents.values()) { - // skip it - if (driver == nullptr) - continue; - - // show all - driver->setHidden(true); - - // setup icon - int stat = m_romScanner->status(driver->driverNo()); - setupIcon(stat, driver); - - if (!isFiltered(driver)) - continue; - - driver->setHidden(false); - - for (int idx = 0; idx < driver->childCount(); idx++) { - TreeDriverItem *clone = static_cast(driver->child(idx)); - clone->setHidden(true); - - int cstat = m_romScanner->status(driver->driverNo()); - setupIcon(cstat, clone); - - if (m_showClones) { - if (!isFiltered(clone)) - continue; - clone->setHidden(false); - m_showCount++; - } - } - m_showCount++; - } - updateLabelCounter(); -} - -TreeDriverItem::TreeDriverItem() : QTreeWidgetItem() -{ - -} - -int TreeDriverItem::driverNo() const -{ - return m_driverNo; -} - -void TreeDriverItem::setDriverNo(int driverNo) -{ - m_driverNo = driverNo; -} - -const char *TreeDriverItem::romName() const -{ - return m_romName; -} - -void TreeDriverItem::setRomName(const char *romName) -{ - m_romName = romName; -} - -const char *TreeDriverItem::fullName() const -{ - return m_fullName; -} - -void TreeDriverItem::setFullName(const char *fullName) -{ - m_fullName = fullName; -} - -bool TreeDriverItem::isParent() const -{ - return m_isParent; -} - -void TreeDriverItem::setIsParent(bool isParent) -{ - m_isParent = isParent; -} diff --git a/jan/src/burner/qt/selectdialog.h b/jan/src/burner/qt/selectdialog.h deleted file mode 100644 index e79830174..000000000 --- a/jan/src/burner/qt/selectdialog.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef SELECTDIALOG_H -#define SELECTDIALOG_H - -#include -#include -#include -#include -#include -#include "rominfodialog.h" -#include "romscandialog.h" -#include "romdirsdialog.h" - -namespace Ui { -class SelectDialog; -} - -class TreeDriverItem : public QTreeWidgetItem -{ -public: - TreeDriverItem(); - - int driverNo() const; - void setDriverNo(int driverNo); - - const char *romName() const; - void setRomName(const char *romName); - const char *fullName() const; - void setFullName(const char *fullName); - - bool isParent() const; - void setIsParent(bool isParent); - -private: - int m_driverNo; - const char *m_romName; - const char *m_fullName; - bool m_isParent; -}; - -class SelectDialog : public QDialog -{ - Q_OBJECT - -public: - explicit SelectDialog(QWidget *parent = 0); - ~SelectDialog(); - - int selectedDriver() const; -public slots: - void openRomInfo(); - void rescanRoms(); - void rescanRomset(); - void editRomPaths(); - void driverChange(QTreeWidgetItem * item, QTreeWidgetItem * prev); - void driverSelect(QTreeWidgetItem * item, int column); - void playGame(); - - void itemShowAvaliable(bool state); - void itemShowUnavaliable(bool state); - void itemShowClones(bool state); - void itemShowZipNames(bool state); - void doSearch(); - -signals: - void driverSelected(int no); -private: - int m_selectedDriver; - void updateTitleScreen(); - void updatePreview(); - - void updateLabelCounter(); - void buildDriverTree(); - bool isFiltered(TreeDriverItem *driver); - void filterDrivers(); - - Ui::SelectDialog *ui; - QIcon m_icoNotFound; - QIcon m_icoNotFoundNonEssential; - QIcon m_icoNotWorking; - RomInfoDialog *m_romInfoDlg; - RomScanDialog *m_romScanner; - RomDirsDialog *m_romPathEditor; - QMap m_parents; - - bool m_showAvailable; - bool m_showUnavailable; - bool m_showClones; - bool m_showZipNames; - int m_showCount; - - QPixmap m_defaultImage; - QAction *m_actionScanThis; -}; - -#endif // SELECTDIALOG_H diff --git a/jan/src/burner/qt/selectdialog.ui b/jan/src/burner/qt/selectdialog.ui deleted file mode 100644 index 50f5e70d9..000000000 --- a/jan/src/burner/qt/selectdialog.ui +++ /dev/null @@ -1,741 +0,0 @@ - - - SelectDialog - - - - 0 - 0 - 899 - 650 - - - - Dialog - - - - - - - - - - - 0 - 0 - - - - - 210 - 160 - - - - - 210 - 160 - - - - Preview - - - QFrame::StyledPanel - - - - - - :/resource/splash.bmp - - - true - - - - - - - - 0 - 0 - - - - - 210 - 160 - - - - - 210 - 160 - - - - Title screen - - - QFrame::StyledPanel - - - - - - :/resource/splash.bmp - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - true - - - - Title - - - - - Rom - - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - 0 - - - 3 - - - - - Game Info - - - - - - - true - - - true - - - - - - - ROM Name - - - - - - - true - - - true - - - - - - - ROM Info - - - - - - - true - - - true - - - - - - - Released by - - - - - - - true - - - true - - - - - - - Genre - - - - - - - true - - - true - - - - - - - Notes - - - - - - - true - - - true - - - - - - - - - - - - 0 - 0 - - - - ... - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Rom Info - - - - - - - - - - - - - Options - - - - - - - - Show avaliable - - - true - - - - - - - Show unavaliable - - - true - - - - - - - Always show clones - - - true - - - - - - - Use zipnames - - - - - - - false - - - Latin text only - - - - - - - - - ROMs Dirs... - - - - - - - Scan ROMs - - - - - - - - - - - - - - false - - - - Filters - - - - - Filters - - - Unchecked - - - ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled|ItemIsTristate - - - - BoardType - - - Unchecked - - - ItemIsSelectable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled|ItemIsTristate - - - - Genuine - - - Unchecked - - - - - Bootleg - - - Unchecked - - - - - Demo - - - Unchecked - - - - - Hack - - - Unchecked - - - - - Homebrew - - - Unchecked - - - - - Prototype - - - Unchecked - - - - - - Family - - - Unchecked - - - - - Genre - - - Unchecked - - - - - Hardware - - - Unchecked - - - - Capcom (Other) - - - Unchecked - - - - - Cave - - - Unchecked - - - - - CPS-1 - - - Unchecked - - - - - CPS-2 - - - Unchecked - - - - - CPS-3 - - - Unchecked - - - - - Data East - - - Unchecked - - - - - Galaxian - - - Unchecked - - - - - Irem - - - Unchecked - - - - - Kaneko - - - Unchecked - - - - - Konami - - - Unchecked - - - - - Neo Geo - - - Unchecked - - - - - Pacman - - - Unchecked - - - - - PGM - - - Unchecked - - - - - Psikyo - - - Unchecked - - - - - Sega - - - Unchecked - - - - - Seta - - - Unchecked - - - - - Taito - - - Unchecked - - - - - Technos - - - Unchecked - - - - - Toaplan - - - Unchecked - - - - - Misc (pre 90s) - - - Unchecked - - - - - Misc (post 90s) - - - Unchecked - - - - - Master System - - - Unchecked - - - - - Megadrive - - - Unchecked - - - - - PC-Engine - - - Unchecked - - - - - SNES - - - Unchecked - - - - - - - - - - - - true - - - - - - - Search - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Cancel - - - - - - - Play - - - - - - - - - - - - - - - btnCancel - clicked() - SelectDialog - reject() - - - 601 - 558 - - - 545 - 555 - - - - - diff --git a/jan/src/burner/qt/stringset.cpp b/jan/src/burner/qt/stringset.cpp deleted file mode 100644 index 74cc77a2e..000000000 --- a/jan/src/burner/qt/stringset.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// StringSet C++ class -#include "burner.h" - -int __cdecl StringSet::Add(TCHAR* szFormat,...) -{ - TCHAR szAdd[256]; - int nAddLen = 0; - TCHAR* NewMem; - va_list Arg; - - va_start(Arg, szFormat); - vsprintf(szAdd, szFormat, Arg); - - nAddLen = _tcslen(szAdd); // find out the length of the new text - NewMem = (TCHAR*)realloc(szText, (nLen + nAddLen + 1) * sizeof(TCHAR)); - if (NewMem) { - szText = NewMem; - // copy the new text to the end - _tcsncpy(szText + nLen, szAdd, nAddLen); - nLen += nAddLen; - szText[nLen] = 0; // zero-terminate - } - - va_end(Arg); - - return 0; -} - -int StringSet::Reset() -{ - // Reset the text - nLen = 0; - szText= (TCHAR*)realloc(szText, sizeof(TCHAR)); - if (szText == NULL) { - return 1; - } - szText[0] = 0; - - return 0; -} - -StringSet::StringSet() -{ - szText = NULL; - nLen = 0; - Reset(); // reset string to nothing -} - -StringSet::~StringSet() -{ - realloc(szText, 0); // Free BZip text -} diff --git a/jan/src/burner/qt/supportdirsdialog.cpp b/jan/src/burner/qt/supportdirsdialog.cpp deleted file mode 100644 index d937402f8..000000000 --- a/jan/src/burner/qt/supportdirsdialog.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include -#include "supportdirsdialog.h" -#include "ui_supportdirsdialog.h" -#include "burner.h" - -TCHAR szAppHiscorePath[MAX_PATH] = _T("support/hiscores/"); -TCHAR szAppSamplesPath[MAX_PATH] = _T("support/samples/"); -TCHAR szAppCheatsPath[MAX_PATH] = _T("support/cheats/"); -TCHAR szAppPreviewsPath[MAX_PATH] = _T("support/previews/"); -TCHAR szAppTitlesPath[MAX_PATH] = _T("support/titles/"); - -SupportDirsDialog::SupportDirsDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::SupportDirsDialog) -{ - ui->setupUi(this); - setWindowTitle(tr("Edit support paths")); - setFixedHeight(height()); - - m_group = new QButtonGroup(this); - - m_handlers[PATH_PREVIEWS] = util::PathHandler { szAppPreviewsPath, ui->lePreviews, PATH_PREVIEWS }; - m_handlers[PATH_TITLES] = util::PathHandler { szAppTitlesPath, ui->leTitles, PATH_TITLES }; - m_handlers[PATH_HISCORES] = util::PathHandler { szAppHiscorePath, ui->leHiscores, PATH_HISCORES }; - m_handlers[PATH_SAMPLES] = util::PathHandler { szAppSamplesPath, ui->leSamples, PATH_SAMPLES }; - m_handlers[PATH_CHEATS] = util::PathHandler { szAppCheatsPath, ui->leCheats, PATH_CHEATS }; - - m_group->addButton(ui->btnPreviews, PATH_PREVIEWS); - m_group->addButton(ui->btnTitles, PATH_TITLES); - m_group->addButton(ui->btnHiscores, PATH_HISCORES); - m_group->addButton(ui->btnSamples, PATH_SAMPLES); - m_group->addButton(ui->btnCheats, PATH_CHEATS); - connect(m_group, SIGNAL(buttonClicked(int)), this, SLOT(editPath(int))); - - load(); -} - -SupportDirsDialog::~SupportDirsDialog() -{ - save(); - delete ui; -} - -void SupportDirsDialog::editPath(int no) -{ - m_handlers[no].browse(this); -} - -int SupportDirsDialog::exec() -{ - for (int i = 0; i < PATH_MAX_HANDLERS; i++) - m_handlers[i].stringToEditor(); - - if (QDialog::exec() == QDialog::Accepted) { - for (int i = 0; i < PATH_MAX_HANDLERS; i++) - m_handlers[i].editorToString(); - } -} - -bool SupportDirsDialog::load() -{ - QSettings settings(util::appConfigName, QSettings::IniFormat); - if (settings.status() == QSettings::AccessError) - return false; - - settings.beginGroup("support_directories"); - - loadPath(settings, "previews", PATH_PREVIEWS); - loadPath(settings, "titles", PATH_TITLES); - loadPath(settings, "hiscores", PATH_HISCORES); - loadPath(settings, "samples", PATH_SAMPLES); - loadPath(settings, "cheats", PATH_CHEATS); - - settings.endGroup(); - return true; -} - -bool SupportDirsDialog::save() -{ - QSettings settings(util::appConfigName, QSettings::IniFormat); - if (!settings.isWritable()) - return false; - - settings.beginGroup("support_directories"); - - settings.setValue("previews", m_handlers[PATH_PREVIEWS].edit->text()); - settings.setValue("titles", m_handlers[PATH_TITLES].edit->text()); - settings.setValue("hiscores", m_handlers[PATH_HISCORES].edit->text()); - settings.setValue("samples", m_handlers[PATH_SAMPLES].edit->text()); - settings.setValue("cheats", m_handlers[PATH_CHEATS].edit->text()); - - settings.endGroup(); - settings.sync(); -} - -void SupportDirsDialog::loadPath(QSettings &settings, QString name, int i) -{ - if (i >= PATH_MAX_HANDLERS) - return; - QString path(settings.value(name).toString()); - - if (QFile(path).exists()) { - m_handlers[i].edit->setText(path); - m_handlers[i].editorToString(); - } -} diff --git a/jan/src/burner/qt/supportdirsdialog.h b/jan/src/burner/qt/supportdirsdialog.h deleted file mode 100644 index 255f1c979..000000000 --- a/jan/src/burner/qt/supportdirsdialog.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef SUPPORTDIRSDIALOG_H -#define SUPPORTDIRSDIALOG_H - -#include -#include -#include -#include -#include "qutil.h" - -namespace Ui { -class SupportDirsDialog; -} - -class SupportDirsDialog : public QDialog -{ - Q_OBJECT - -public: - explicit SupportDirsDialog(QWidget *parent = 0); - ~SupportDirsDialog(); - -public slots: - void editPath(int no); - int exec(); - bool load(); - bool save(); - -private: - void loadPath(QSettings &settings, QString name, int i); - Ui::SupportDirsDialog *ui; - QButtonGroup *m_group; - enum { - PATH_PREVIEWS = 0, - PATH_TITLES, - PATH_HISCORES, - PATH_SAMPLES, - PATH_CHEATS, - PATH_MAX_HANDLERS - }; - - util::PathHandler m_handlers[PATH_MAX_HANDLERS]; -}; - -#endif // SUPPORTDIRSDIALOG_H diff --git a/jan/src/burner/qt/supportdirsdialog.ui b/jan/src/burner/qt/supportdirsdialog.ui deleted file mode 100644 index 4a439b85c..000000000 --- a/jan/src/burner/qt/supportdirsdialog.ui +++ /dev/null @@ -1,199 +0,0 @@ - - - SupportDirsDialog - - - - 0 - 0 - 576 - 275 - - - - - 0 - 0 - - - - Dialog - - - true - - - - - - - - Previews - - - - - - - - - - Browse - - - - - - - - - - - Titles - - - - - - - - - - Browse - - - - - - - - - - - Hiscores - - - - - - - - - - Browse - - - - - - - - - - - Cheats - - - - - - - - - - Browse - - - - - - - - - - - Samples - - - - - - - - - - Browse - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Cancel - - - - - - - Ok - - - - - - - - - - - btnCancel - clicked() - SupportDirsDialog - reject() - - - 238 - 102 - - - 97 - 102 - - - - - btnOk - clicked() - SupportDirsDialog - accept() - - - 287 - 104 - - - 276 - 116 - - - - - diff --git a/jan/src/burner/qt/tchar.h b/jan/src/burner/qt/tchar.h deleted file mode 100644 index 6c690fa62..000000000 --- a/jan/src/burner/qt/tchar.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef __PORT_TYPEDEFS_H -#define __PORT_TYPEDEFS_H - -#include -#include - -#include "inp_keys.h" -#define TCHAR char -#define _T(x) x -#define _tfopen fopen -#define _tcstol strtol -#define _tcsstr strstr -#define _istspace(x) isspace(x) -#define _stprintf sprintf -#define _tcslen strlen -#define _tcsicmp(a, b) strcasecmp(a, b) -#define _tcscpy(to, from) strcpy(to, from) -#define _fgetts fgets -#define _strnicmp(s1, s2, n) strncasecmp(s1, s2, n) -#define _sntprintf snprintf -#define _tcscmp strcmp -#define _tcsncmp strncmp -#define _tcsncpy strncpy -#define _stscanf sscanf -#define _ftprintf fprintf - -#ifdef _MSC_VER -#include -#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n) -#define strcasecmp(x, y) _stricmp(x, y) -#define snprintf _snprintf -#else -#define _stricmp(x, y) strcasecmp(x,y) - -typedef struct { int x, y, width, height; } RECT; -#undef __cdecl -#define __cdecl - -//#define bprintf(...) {} -#endif - -#undef __fastcall -#undef _fastcall -#define __fastcall /*what does this correspond to?*/ -#define _fastcall /*same as above - what does this correspond to?*/ -#define ANSIToTCHAR(str, foo, bar) (str) - -/* for Windows / Xbox 360 (below VS2010) - typedefs for missing stdint.h types such as uintptr_t?*/ - -/*FBA defines*/ -#define PUF_TEXT_NO_TRANSLATE (0) -#define PUF_TYPE_ERROR (1) - -extern TCHAR szAppBurnVer[16]; - -typedef int HWND; - -extern int bDrvOkay; -extern int bRunPause; -#ifdef __cplusplus -extern bool bAlwaysProcessKeyboardInput; -#endif -extern HWND hScrnWnd; // Handle to the screen window - -extern void InpDIPSWResetDIPs (void); - -#endif diff --git a/jan/src/burner/qt/widgets/hexspinbox.cpp b/jan/src/burner/qt/widgets/hexspinbox.cpp deleted file mode 100644 index 53b911322..000000000 --- a/jan/src/burner/qt/widgets/hexspinbox.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "hexspinbox.h" -#include - -HexSpinBox::HexSpinBox(QWidget *parent) : - QSpinBox(parent) -{ - m_hexValidator = new QRegExpValidator(QRegExp("[0-9a-fA-F]{1,8}"), this); -} - -int HexSpinBox::valueFromText(const QString &text) const -{ - return text.toInt(nullptr, 16); -} - -QString HexSpinBox::textFromValue(int val) const -{ - return QString::number(val, 16).toUpper(); -} - -QValidator::State HexSpinBox::validate(QString &input, int &pos) const -{ - return m_hexValidator->validate(input, pos); -} - -HexSpinDialog::HexSpinDialog(QWidget *parent) : - QDialog(parent) -{ - setWindowTitle("Edit hex value"); - m_editor = new HexSpinBox(this); - m_editor->setRange(0, 255); - m_closeButton = new QPushButton(tr("Close"), this); - - QHBoxLayout *layout = new QHBoxLayout(); - layout->addWidget(m_editor); - layout->addWidget(m_closeButton); - layout->setStretch(0, 1); - setLayout(layout); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(accept())); -} - -int HexSpinDialog::value() const -{ - return m_editor->value(); -} - -void HexSpinDialog::setValue(int value) -{ - m_editor->setValue(value); -} diff --git a/jan/src/burner/qt/widgets/hexspinbox.h b/jan/src/burner/qt/widgets/hexspinbox.h deleted file mode 100644 index e39e0f73b..000000000 --- a/jan/src/burner/qt/widgets/hexspinbox.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef HEXSPINBOX_H -#define HEXSPINBOX_H - -#include -#include -#include -#include - -class HexSpinBox : public QSpinBox -{ - Q_OBJECT -public: - explicit HexSpinBox(QWidget *parent = 0); - -protected: - int valueFromText(const QString &text) const; - QString textFromValue(int val) const; - QValidator::State validate(QString &input, int &pos) const; - -private: - QRegExpValidator *m_hexValidator; - -}; - -class HexSpinDialog : public QDialog -{ - Q_OBJECT -public: - explicit HexSpinDialog(QWidget *parent = 0); -public slots: - int value() const; - void setValue(int value); -private: - QPushButton *m_closeButton; - HexSpinBox *m_editor; -}; - - -#endif // HEXSPINBOX_H diff --git a/jan/src/burner/resource/TV Minus.ico b/jan/src/burner/resource/TV Minus.ico deleted file mode 100644 index 5efea17a8..000000000 Binary files a/jan/src/burner/resource/TV Minus.ico and /dev/null differ diff --git a/jan/src/burner/resource/TV Not Found Non Essential.ico b/jan/src/burner/resource/TV Not Found Non Essential.ico deleted file mode 100644 index 367cb47cf..000000000 Binary files a/jan/src/burner/resource/TV Not Found Non Essential.ico and /dev/null differ diff --git a/jan/src/burner/resource/TV Not Found.ico b/jan/src/burner/resource/TV Not Found.ico deleted file mode 100644 index 9cfa60df9..000000000 Binary files a/jan/src/burner/resource/TV Not Found.ico and /dev/null differ diff --git a/jan/src/burner/resource/TV Not Working.ico b/jan/src/burner/resource/TV Not Working.ico deleted file mode 100644 index 9149eeba3..000000000 Binary files a/jan/src/burner/resource/TV Not Working.ico and /dev/null differ diff --git a/jan/src/burner/resource/TV Plus.ico b/jan/src/burner/resource/TV Plus.ico deleted file mode 100644 index bcc12ba16..000000000 Binary files a/jan/src/burner/resource/TV Plus.ico and /dev/null differ diff --git a/jan/src/burner/resource/about.bmp b/jan/src/burner/resource/about.bmp deleted file mode 100644 index d1e8166a9..000000000 Binary files a/jan/src/burner/resource/about.bmp and /dev/null differ diff --git a/jan/src/burner/resource/fba.ico b/jan/src/burner/resource/fba.ico deleted file mode 100644 index 290321e95..000000000 Binary files a/jan/src/burner/resource/fba.ico and /dev/null differ diff --git a/jan/src/burner/resource/manifest.xml b/jan/src/burner/resource/manifest.xml deleted file mode 100644 index 46eff36d3..000000000 --- a/jan/src/burner/resource/manifest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jan/src/burner/resource/misc.bmp b/jan/src/burner/resource/misc.bmp deleted file mode 100644 index 408da009c..000000000 Binary files a/jan/src/burner/resource/misc.bmp and /dev/null differ diff --git a/jan/src/burner/resource/splash.bmp b/jan/src/burner/resource/splash.bmp deleted file mode 100644 index 1690a818d..000000000 Binary files a/jan/src/burner/resource/splash.bmp and /dev/null differ diff --git a/jan/src/burner/sdl/burner_sdl.h b/jan/src/burner/sdl/burner_sdl.h deleted file mode 100644 index 62d6bddf0..000000000 --- a/jan/src/burner/sdl/burner_sdl.h +++ /dev/null @@ -1,96 +0,0 @@ -#include - -// defines to override various #ifndef _WIN32 -typedef struct tagRECT { - int left; - int top; - int right; - int bottom; -} RECT,*PRECT,*LPRECT; -typedef const RECT *LPCRECT; - -typedef unsigned long DWORD; -typedef unsigned char BYTE; - -#ifndef MAX_PATH -#define MAX_PATH 511 -#endif - -#ifndef __cdecl -#define __cdecl -#endif - -//main.cpp -int SetBurnHighCol(int nDepth); -extern int nAppVirtualFps; -extern bool bRunPause; -extern bool bAlwaysProcessKeyboardInput; -TCHAR* ANSIToTCHAR(const char* pszInString, TCHAR* pszOutString, int nOutSize); -char* TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int nOutSize); -bool AppProcessKeyboardInput(); - -//config.cpp -int ConfigAppLoad(); -int ConfigAppSave(); - -// drv.cpp -extern int bDrvOkay; // 1 if the Driver has been initted okay, and it's okay to use the BurnDrv functions -extern char szAppRomPaths[DIRS_MAX][MAX_PATH]; -int DrvInit(int nDrvNum, bool bRestore); -int DrvInitCallback(); // Used when Burn library needs to load a game. DrvInit(nBurnSelect, false) -int DrvExit(); -int ProgressUpdateBurner(double dProgress, const TCHAR* pszText, bool bAbs); -int AppError(TCHAR* szText, int bWarning); - -//run.cpp -extern int RunMessageLoop(); -extern int RunReset(); - -// media.cpp -int MediaInit(); -int MediaExit(); - -//inpdipsw.cpp -void InpDIPSWResetDIPs(); - -//interface/inp_interface.cpp -int InputInit(); -int InputExit(); -int InputMake(bool bCopy); - -//TODO: -#define szAppBurnVer 1 - -//stringset.cpp -class StringSet { -public: - TCHAR* szText; - int nLen; - // printf function to add text to the Bzip string - int __cdecl Add(TCHAR* szFormat, ...); - int Reset(); - StringSet(); - ~StringSet(); -}; - -// support_paths.cpp -extern TCHAR szAppPreviewsPath[MAX_PATH]; -extern TCHAR szAppTitlesPath[MAX_PATH]; -extern TCHAR szAppSelectPath[MAX_PATH]; -extern TCHAR szAppVersusPath[MAX_PATH]; -extern TCHAR szAppHowtoPath[MAX_PATH]; -extern TCHAR szAppScoresPath[MAX_PATH]; -extern TCHAR szAppBossesPath[MAX_PATH]; -extern TCHAR szAppGameoverPath[MAX_PATH]; -extern TCHAR szAppFlyersPath[MAX_PATH]; -extern TCHAR szAppMarqueesPath[MAX_PATH]; -extern TCHAR szAppControlsPath[MAX_PATH]; -extern TCHAR szAppCabinetsPath[MAX_PATH]; -extern TCHAR szAppPCBsPath[MAX_PATH]; -extern TCHAR szAppCheatsPath[MAX_PATH]; -extern TCHAR szAppHistoryPath[MAX_PATH]; -extern TCHAR szAppListsPath[MAX_PATH]; -extern TCHAR szAppDatListsPath[MAX_PATH]; -extern TCHAR szAppIpsPath[MAX_PATH]; -extern TCHAR szAppIconsPath[MAX_PATH]; -extern TCHAR szAppArchivesPath[MAX_PATH]; diff --git a/jan/src/burner/sdl/bzip.cpp b/jan/src/burner/sdl/bzip.cpp deleted file mode 100644 index cde3834ad..000000000 --- a/jan/src/burner/sdl/bzip.cpp +++ /dev/null @@ -1,520 +0,0 @@ -// Burner Zip module -#include "burner.h" - -int nBzipError = 0; // non-zero if there is a problem with the opened romset - -static TCHAR* szBzipName[BZIP_MAX] = { NULL, }; // Zip files to search through - -struct RomFind { int nState; int nZip; int nPos; }; // State is non-zero if found. 1 = found totally okay. -static struct RomFind* RomFind = NULL; -static int nRomCount = 0; static int nTotalSize = 0; -static struct ZipEntry* List = NULL; static int nListCount = 0; // List of entries for current zip file -static int nCurrentZip = -1; // Zip which is currently open -static int nZipsFound = 0; - -StringSet BzipText; // Text which describes any problems with loading the zip -StringSet BzipDetail; // Text which describes in detail any problems with loading the zip - -void BzipListFree() -{ - if (List) { - for (int i = 0; i < nListCount; i++) { - if (List[i].szName) { - free(List[i].szName); - List[i].szName = NULL; - } - } - free(List); - } - - List = NULL; - nListCount = 0; -} - -static char* GetFilenameA(char* szFull) -{ - int nLen = strlen(szFull); - - if (nLen <= 0) { - return szFull; - } - for (int i = nLen - 1; i >= 0; i--) { - if (szFull[i] == '\\' || szFull[i] == '/') { - return szFull + i + 1; - } - } - - return szFull; -} - -static TCHAR* GetFilenameW(TCHAR* szFull) -{ - int nLen = _tcslen(szFull); - - if (nLen <= 0) { - return szFull; - } - for (int i = nLen - 1; i >= 0; i--) { - if (szFull[i] == _T('\\') || szFull[i] == _T('/')) { - return szFull + i + 1; - } - } - - return szFull; -} - -static int FindRomByName(TCHAR* szName) -{ - struct ZipEntry* pl; - int i; - - // Find the rom named szName in the List - for (i = 0, pl = List; i < nListCount; i++, pl++) { - TCHAR szCurrentName[MAX_PATH]; - if (_tcsicmp(szName, GetFilenameW(ANSIToTCHAR(pl->szName, szCurrentName, MAX_PATH))) == 0) { - return i; - } - } - return -1; // couldn't find the rom -} - -static int FindRomByCrc(unsigned int nCrc) -{ - struct ZipEntry* pl; - int i; - - // Find the rom named szName in the List - for (i = 0, pl = List; i< nListCount; i++, pl++) { - if (nCrc == pl->nCrc) { - return i; - } - } - - return -1; // couldn't find the rom -} - -// Find rom number i from the pBzipDriver game -static int FindRom(int i) -{ - struct BurnRomInfo ri; - int nRet; - - memset(&ri, 0, sizeof(ri)); - - nRet = BurnDrvGetRomInfo(&ri, i); - if (nRet != 0) { // Failure: no such rom - return -2; - } - - if (ri.nCrc) { // Search by crc first - nRet = FindRomByCrc(ri.nCrc); - if (nRet >= 0) { - return nRet; - } - } - - for (int nAka = 0; nAka < 0x10000; nAka++) { // Failing that, search for possible names - char *szPossibleName = NULL; - - nRet = BurnDrvGetRomName(&szPossibleName, i, nAka); - if (nRet) { // No more rom names - break; - } - nRet = FindRomByName(ANSIToTCHAR(szPossibleName, NULL, 0)); - if (nRet >= 0) { - return nRet; - } - } - - return -1; // Couldn't find the rom -} - -static int RomDescribe(StringSet* pss, struct BurnRomInfo* pri) -{ - pss->Add(_T("The ")); - if (pri->nType & BRF_ESS) { - pss->Add(_T("essential ")); - } - if (pri->nType & BRF_BIOS) { - pss->Add(_T("BIOS ")); - } - if (pri->nType & BRF_PRG) { - pss->Add(_T("program ")); - } - if (pri->nType & BRF_GRA) { - pss->Add(_T("graphics ")); - } - if (pri->nType & BRF_SND) { - pss->Add(_T("sound ")); - } - pss->Add(_T("ROM ")); - - return 0; -} - -static int CheckRomsBoot() -{ - for (int i = 0; i < nRomCount; i++) { - struct BurnRomInfo ri; - int nState; - - memset(&ri, 0, sizeof(ri)); - BurnDrvGetRomInfo(&ri, i); // Find information about the wanted rom - nState = RomFind[i].nState; // Get the state of the rom in the zip file - - if (nState != 1 && ri.nType && ri.nCrc) { - if (!(ri.nType & BRF_OPT) && !(ri.nType & BRF_NODUMP)) { - return 2; - } - return 1; - } - } - - return 0; -} - -static int GetBZipError(int nState) -{ - switch (nState) { - case 1: // OK - return 0x00; - case 0: // Not present - return 0x01; - case 3: // Incomplete - return 0x01; - default: // CRC wrong or too large - return 0x10; - } - - return 0x10; -} - -// Check the roms to see if they code, graphics etc are complete -static int CheckRoms() -{ - nBzipError = 0; // Assume romset is fine - - for (int i = 0; i < nRomCount; i++) { - struct BurnRomInfo ri; - - memset(&ri, 0, sizeof(ri)); - BurnDrvGetRomInfo(&ri, i); // Find information about the wanted rom - if (ri.nCrc && (ri.nType & BRF_OPT) == 0 && (ri.nType & BRF_NODUMP)) { - int nState = RomFind[i].nState; // Get the state of the rom in the zip file - int nError = GetBZipError(nState); - - if (nState == 0 && ri.nType) { // (A type of 0 means empty slot - no rom) - char* szName = "Unknown"; - RomDescribe(&BzipDetail, &ri); - BurnDrvGetRomName(&szName, i, 0); - BzipDetail.Add(_T("%hs was not found.\n"), szName); - } - - if (nError == 0) { - nBzipError |= 0x2000; - } - - if (ri.nType & BRF_ESS) { // essential rom - without it the game may not run at all - nBzipError |= nError << 0; - } - if (ri.nType & BRF_PRG) { // rom which contains program information - nBzipError |= nError << 1; - } - if (ri.nType & BRF_GRA) { // rom which contains graphics information - nBzipError |= nError << 2; - } - if (ri.nType & BRF_SND) { // rom which contains sound information - nBzipError |= nError << 3; - } - } - } - - if (nBzipError & 0x0F0F) { - nBzipError |= 0x4000; - } - - return 0; -} - -static int __cdecl BzipBurnLoadRom(unsigned char* Dest, int* pnWrote, int i) -{ -#if defined (BUILD_WIN32) - MSG Msg; -#endif - - struct BurnRomInfo ri; - int nWantZip = 0; - TCHAR szText[128]; - char* pszRomName = NULL; - int nRet = 0; - - if (i < 0 || i >= nRomCount) { - return 1; - } - - ri.nLen = 0; - BurnDrvGetRomInfo(&ri, i); // Get info - - // show what we're doing - BurnDrvGetRomName(&pszRomName, i, 0); - if (pszRomName == NULL) { - pszRomName = "unknown"; - } - _stprintf(szText, _T("Loading")); - if (ri.nType & (BRF_PRG | BRF_GRA | BRF_SND | BRF_BIOS)) { - if (ri.nType & BRF_BIOS) { - _stprintf (szText + _tcslen(szText), _T(" %s"), _T("BIOS ")); - } - if (ri.nType & BRF_PRG) { - _stprintf (szText + _tcslen(szText), _T(" %s"), _T("program ")); - } - if (ri.nType & BRF_GRA) { - _stprintf (szText + _tcslen(szText), _T(" %s"), _T("graphics ")); - } - if (ri.nType & BRF_SND) { - _stprintf (szText + _tcslen(szText), _T(" %s"), _T("sound ")); - } - _stprintf(szText + _tcslen(szText), _T("(%hs)..."), pszRomName); - } else { - _stprintf(szText + _tcslen(szText), _T(" %hs..."), pszRomName); - } - ProgressUpdateBurner(ri.nLen ? 1.0 / ((double)nTotalSize / ri.nLen) : 0, szText, 0); - -#if defined (BUILD_WIN32) - // Check for messages: - while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) { - DispatchMessage(&Msg); - } -#endif - - if (RomFind[i].nState == 0) { // Rom not found in zip at all - TCHAR szTemp[128] = _T(""); - _stprintf(szTemp, "%s (not found)\n",szText); - fprintf(stderr, szTemp); - AppError(szTemp, 1); - return 1; - } - - nWantZip = RomFind[i].nZip; // Which zip file it is in - if (nCurrentZip != nWantZip) { // If we haven't got the right zip file currently open - ZipClose(); - nCurrentZip = -1; - if (ZipOpen(TCHARToANSI(szBzipName[nWantZip], NULL, 0))) { - return 1; - } - nCurrentZip = nWantZip; - } - - // Read in file and return how many bytes we read - if (ZipLoadFile(Dest, ri.nLen, pnWrote, RomFind[i].nPos)) { - // Error loading from the zip file - TCHAR szTemp[128] = _T(""); - _stprintf(szTemp, _T("%s reading %.30hs from %.30s"), nRet == 2 ? _T("CRC error") : _T("Error"), pszRomName, GetFilenameW(szBzipName[nCurrentZip])); - fprintf(stderr, szTemp); - AppError(szTemp, 1); - return 1; - } - - fprintf(stderr, "%s (OK)\n", szText); - return 0; -} - -int BzipOpen(bool bootApp) -{ - int nMemLen; // Zip name number - - nZipsFound = 0; // Haven't found zips yet - nTotalSize = 0; - - if (szBzipName == NULL) { - return 1; - } - - BzipClose(); // Make sure nothing is open - - if(!bootApp) { // reset information strings - BzipText.Reset(); - BzipDetail.Reset(); - } - - // Count the number of roms needed - for (nRomCount = 0; ; nRomCount++) { - if (BurnDrvGetRomInfo(NULL, nRomCount)) { - break; - } - } - if (nRomCount <= 0) { - return 1; - } - - // Create an array for holding lookups for each rom -> zip entries - nMemLen = nRomCount * sizeof(struct RomFind); - RomFind = (struct RomFind*)malloc(nMemLen); - if (RomFind == NULL) { - return 1; - } - memset(RomFind, 0, nMemLen); - - for (int z = 0; z < BZIP_MAX; z++) { - char* szName = NULL; - - if (BurnDrvGetZipName(&szName, z)) { - break; - } - - for (int d = 0; d < DIRS_MAX; d++) { - free(szBzipName[z]); - szBzipName[z] = (TCHAR*)malloc(MAX_PATH * sizeof(TCHAR)); - - _stprintf(szBzipName[z], _T("%s%hs"), szAppRomPaths[d], szName); - - if (ZipOpen(TCHARToANSI(szBzipName[z], NULL, 0)) == 0) { // Open the rom zip file - nZipsFound++; - nCurrentZip = z; - break; - } - } - - if (nCurrentZip >= 0) { - if (!bootApp) { - BzipText.Add(_T("Found %s;\n"), szBzipName[z]); - } - ZipGetList(&List, &nListCount); // Get the list of entries - - for (int i = 0; i < nRomCount; i++) { - struct BurnRomInfo ri; - int nFind; - - if (RomFind[i].nState == 1) { // Already found this and it's okay - continue; - } - - memset(&ri, 0, sizeof(ri)); - - nFind = FindRom(i); - - if (nFind < 0) { // Couldn't find this rom at all - continue; - } - - RomFind[i].nZip = z; // Remember which zip file it is in - RomFind[i].nPos = nFind; - RomFind[i].nState = 1; // Set to found okay - - BurnDrvGetRomInfo(&ri, i); // Get info about the rom - - if ((ri.nType & BRF_OPT) == 0 && (ri.nType & BRF_NODUMP) == 0) { - nTotalSize += ri.nLen; - } - - if (List[nFind].nLen == ri.nLen) { - if (ri.nCrc) { // If we know the CRC - if (List[nFind].nCrc != ri.nCrc) { // Length okay, but CRC wrong - RomFind[i].nState = 2; - } - } - } else { - if (List[nFind].nLen < ri.nLen) { - RomFind[i].nState = 3; // Too small - } else { - RomFind[i].nState = 4; // Too big - } - } - - if (!bootApp) { - if (RomFind[i].nState != 1) { - RomDescribe(&BzipDetail, &ri); - - if (RomFind[i].nState == 2) { - BzipDetail.Add(_T("%hs has a CRC of %.8X. (It should be %.8X.)\n"), GetFilenameA(List[nFind].szName), List[nFind].nCrc, ri.nCrc); - } - if (RomFind[i].nState == 3) { - BzipDetail.Add(_T("%hs is %dk which is incomplete. (It should be %dkB.)\n"), GetFilenameA(List[nFind].szName), List[nFind].nLen >> 10, ri.nLen >> 10); - } - if (RomFind[i].nState == 4) { - BzipDetail.Add(_T("%hs is %dk which is too big. (It should be %dkB.)\n"), GetFilenameA(List[nFind].szName), List[nFind].nLen >> 10, ri.nLen >> 10); - } - } - } - } - - BzipListFree(); - - } else { - if (!bootApp) { - BzipText.Add(_T("Couldn't find %hs;\n"), szName); - } - } - - ZipClose(); // Close the last zip file if open - nCurrentZip = -1; - } - - if (!bootApp) { - // Check the roms to see if they code, graphics etc are complete - CheckRoms(); - - if (nZipsFound) { - if (nBzipError == 0) { - BzipText.Add(_T("The romset is fine.\n")); - } - - if (nBzipError & 0x07) { - BzipText.Add(_T("However the romset is INCOMPLETE.\n")); - } - - if (nBzipError & 0x01) { - BzipText.Add(_T("Essential rom data is missing; the game probably won't run.\n")); - } else { - if (nBzipError & 0x10) { - BzipText.Add(_T("Some essential roms are different. ")); - } - } - if (nBzipError & 0x02) { - BzipText.Add(_T("Graphical data is missing. ")); - } else { - if (nBzipError & 0x20) { - BzipText.Add(_T("Some graphics roms are different. ")); - } - } - if (nBzipError & 0x04) { - BzipText.Add(_T("Sound data is missing. ")); - } else { - if (nBzipError & 0x40) { - BzipText.Add(_T("Some sound roms are different. ")); - } - } - - if (nBzipError & 0x76) { - BzipText.Add(_T("\n")); - } - } - - BurnExtLoadRom = BzipBurnLoadRom; // Okay to call our function to load each rom - - } else { - return CheckRomsBoot(); - } - - return 0; -} - -int BzipClose() -{ - ZipClose(); - nCurrentZip = -1; // Close the last zip file if open - - BurnExtLoadRom = NULL; // Can't call our function to load each rom anymore - nBzipError = 0; // reset romset errors - - free(RomFind); - RomFind = NULL; - nRomCount = 0; - - for (int z = 0; z < BZIP_MAX; z++) { - free(szBzipName[z]); - szBzipName[z] = NULL; - } - - return 0; -} diff --git a/jan/src/burner/sdl/config.cpp b/jan/src/burner/sdl/config.cpp deleted file mode 100644 index 2ba970c84..000000000 --- a/jan/src/burner/sdl/config.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// Burner Config file module -#include "burner.h" -int nIniVersion = 0; - -static void CreateConfigName(char* szConfig) -{ - memcpy(szConfig, "fbasdl.ini", 12); - return; -} - -// Read in the config file for the whole application -int ConfigAppLoad() -{ - char szConfig[MAX_PATH]; - char szLine[256]; - FILE *h; - - CreateConfigName(szConfig); - - if ((h = fopen(szConfig,"rt")) == NULL) { - return 1; - } - - // Go through each line of the config file - while (fgets(szLine, sizeof(szLine), h)) { - int nLen; - - nLen = strlen(szLine); - - // Get rid of the linefeed at the end - if (szLine[nLen - 1] == 10) { - szLine[nLen - 1] = 0; - nLen--; - } - -#define VAR(x) { char *szValue = LabelCheck(szLine,#x); \ - if (szValue) x = strtol(szValue, NULL, 0); } -#define FLT(x) { char *szValue = LabelCheck(szLine,#x); \ - if (szValue) x = atof(szValue); } -#define STR(x) { char *szValue = LabelCheck(szLine,#x " "); \ - if (szValue) strcpy(x,szValue); } - - VAR(nIniVersion); - VAR(nVidSelect); // video mode select - VAR(bVidFullStretch); - - VAR(nAutoFireRate); - - // Other - STR(szAppRomPaths[0]); - STR(szAppRomPaths[1]); - STR(szAppRomPaths[2]); - STR(szAppRomPaths[3]); - STR(szAppRomPaths[4]); - STR(szAppRomPaths[5]); - STR(szAppRomPaths[6]); - STR(szAppRomPaths[7]); - STR(szAppRomPaths[8]); - STR(szAppRomPaths[9]); - STR(szAppRomPaths[10]); - STR(szAppRomPaths[11]); - STR(szAppRomPaths[12]); - STR(szAppRomPaths[13]); - STR(szAppRomPaths[14]); - STR(szAppRomPaths[15]); - STR(szAppRomPaths[16]); - STR(szAppRomPaths[17]); - STR(szAppRomPaths[18]); - STR(szAppRomPaths[19]); -#undef STR -#undef FLT -#undef VAR - } - - fclose(h); - return 0; -} - -// Write out the config file for the whole application -int ConfigAppSave() -{ - char szConfig[MAX_PATH]; - FILE *h; - - CreateConfigName(szConfig); - - if ((h = fopen(szConfig, "wt")) == NULL) { - return 1; - } - - -#define VAR(x) fprintf(h, #x " %d\n", x) -#define FLT(x) fprintf(h, #x " %f\n", x) -#define STR(x) fprintf(h, #x " %s\n", x) - - fprintf(h,"\n// The application version this file was saved from\n"); - // We can't use the macros for this! - fprintf(h, "nIniVersion 0x%06X", nBurnVer); - - fprintf(h,"\n// video mode 0 = standard SDL 1= (very expiermental) opengl\n"); - VAR(nVidSelect); // video mode select - - fprintf(h,"\n// If non-zero, allow stretching of the image to any size\n"); - VAR(bVidFullStretch); - - fprintf(h,"\n// Auto-Fire Rate, non-linear - use the GUI to change this setting!\n"); - VAR(nAutoFireRate); - - fprintf(h,"\n// The paths to search for rom zips. (include trailing backslash)\n"); - STR(szAppRomPaths[0]); - STR(szAppRomPaths[1]); - STR(szAppRomPaths[2]); - STR(szAppRomPaths[3]); - STR(szAppRomPaths[4]); - STR(szAppRomPaths[5]); - STR(szAppRomPaths[6]); - STR(szAppRomPaths[7]); - STR(szAppRomPaths[8]); - STR(szAppRomPaths[9]); - STR(szAppRomPaths[10]); - STR(szAppRomPaths[11]); - STR(szAppRomPaths[12]); - STR(szAppRomPaths[13]); - STR(szAppRomPaths[14]); - STR(szAppRomPaths[15]); - STR(szAppRomPaths[16]); - STR(szAppRomPaths[17]); - STR(szAppRomPaths[18]); - STR(szAppRomPaths[19]); - - fprintf(h,"\n\n\n"); - -#undef STR -#undef FLT -#undef VAR - - fclose(h); - return 0; -} diff --git a/jan/src/burner/sdl/drv.cpp b/jan/src/burner/sdl/drv.cpp deleted file mode 100644 index f02425403..000000000 --- a/jan/src/burner/sdl/drv.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// Driver Init module -#include "burner.h" - -int bDrvOkay = 0; // 1 if the Driver has been initted okay, and it's okay to use the BurnDrv functions - -char szAppRomPaths[DIRS_MAX][MAX_PATH] = {{"/usr/local/share/roms/"},{"roms/"}, }; - -static bool bSaveRAM = false; - -static int DoLibInit() // Do Init of Burn library driver -{ - int nRet; - - BzipOpen(false); - - //ProgressCreate(); - - nRet = BurnDrvInit(); - - BzipClose(); - - //ProgressDestroy(); - - if (nRet) { - return 1; - } else { - return 0; - } -} - -// Catch calls to BurnLoadRom() once the emulation has started; -// Intialise the zip module before forwarding the call, and exit cleanly. -static int DrvLoadRom(unsigned char* Dest, int* pnWrote, int i) -{ - int nRet; - - BzipOpen(false); - - if ((nRet = BurnExtLoadRom(Dest, pnWrote, i)) != 0) { - char szText[256] = ""; - char* pszFilename; - - BurnDrvGetRomName(&pszFilename, i, 0); - sprintf(szText, "Error loading %s, requested by %s.\nThe emulation will likely suffer problems.", pszFilename, BurnDrvGetTextA(0)); - } - - BzipClose(); - - BurnExtLoadRom = DrvLoadRom; - - //ScrnTitle(); - - return nRet; -} - -int DrvInit(int nDrvNum, bool bRestore) -{ - DrvExit(); // Make sure exitted - MediaExit(); - - nBurnDrvSelect[0] = nDrvNum; // Set the driver number - - MediaInit(); - - // Define nMaxPlayers early; GameInpInit() needs it (normally defined in DoLibInit()). - nMaxPlayers = BurnDrvGetMaxPlayers(); - GameInpInit(); // Init game input - - ConfigGameLoad(true); - InputMake(true); - - GameInpDefault(); - - if (DoLibInit()) { // Init the Burn library's driver - char szTemp[512]; - - BurnDrvExit(); // Exit the driver - - _stprintf (szTemp, _T("There was an error starting '%s'.\n"), BurnDrvGetText(DRV_FULLNAME)); - return 1; - } - - BurnExtLoadRom = DrvLoadRom; - - bDrvOkay = 1; // Okay to use all BurnDrv functions - - bSaveRAM = false; - nBurnLayer = 0xFF; // show all layers - - // Reset the speed throttling code, so we don't 'jump' after the load - RunReset(); - return 0; -} - -int DrvInitCallback() -{ - return DrvInit(nBurnDrvSelect[0], false); -} - -int DrvExit() -{ - if (bDrvOkay) { - if (nBurnDrvSelect[0] < nBurnDrvCount) { - if (bSaveRAM) { - - bSaveRAM = false; - } - - ConfigGameSave(bSaveInputs); - - GameInpExit(); // Exit game input - BurnDrvExit(); // Exit the driver - } - } - - BurnExtLoadRom = NULL; - - bDrvOkay = 0; // Stop using the BurnDrv functions - nBurnDrvSelect[0] = ~0U; // no driver selected - - return 0; -} - -int ProgressUpdateBurner(double dProgress, const TCHAR* pszText, bool bAbs) -{ - return 0; -} - -int AppError(TCHAR* szText, int bWarning) -{ - return 0; -} - diff --git a/jan/src/burner/sdl/inpdipsw.cpp b/jan/src/burner/sdl/inpdipsw.cpp deleted file mode 100644 index ec09e37cb..000000000 --- a/jan/src/burner/sdl/inpdipsw.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// Burner DipSwitches Dialog module -#include "burner.h" - -static unsigned char nPrevDIPSettings[4]; - -static int nDIPOffset; - -static bool bOK; - -static void InpDIPSWGetOffset() -{ - BurnDIPInfo bdi; - - nDIPOffset = 0; - for (int i = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++) { - if (bdi.nFlags == 0xF0) { - nDIPOffset = bdi.nInput; - break; - } - } -} - -void InpDIPSWResetDIPs() -{ - int i = 0; - BurnDIPInfo bdi; - struct GameInp* pgi; - - InpDIPSWGetOffset(); - - while (BurnDrvGetDIPInfo(&bdi, i) == 0) { - if (bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + nDIPOffset; - pgi->Input.Constant.nConst = (pgi->Input.Constant.nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); - } - i++; - } -} - -static int InpDIPSWListBegin() -{ - - - - - return 0; -} - -static bool CheckSetting(int i) -{ - BurnDIPInfo bdi; - BurnDrvGetDIPInfo(&bdi, i); - struct GameInp* pgi = GameInp + bdi.nInput + nDIPOffset; - - if ((pgi->Input.Constant.nConst & bdi.nMask) == bdi.nSetting) { - unsigned char nFlags = bdi.nFlags; - if ((nFlags & 0x0F) <= 1) { - return true; - } else { - for (int j = 1; j < (nFlags & 0x0F); j++) { - BurnDrvGetDIPInfo(&bdi, i + j); - pgi = GameInp + bdi.nInput + nDIPOffset; - if (nFlags & 0x80) { - if ((pgi->Input.Constant.nConst & bdi.nMask) == bdi.nSetting) { - return false; - } - } else { - if ((pgi->Input.Constant.nConst & bdi.nMask) != bdi.nSetting) { - return false; - } - } - } - return true; - } - } - return false; -} - -// Make a list view of the DIPswitches -static int InpDIPSWListMake() -{ - - return 0; -} - -static int InpDIPSWInit() -{ - BurnDIPInfo bdi; - struct GameInp *pgi; - - InpDIPSWGetOffset(); - - InpDIPSWListBegin(); - InpDIPSWListMake(); - - for (int i = 0, j = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++) { - if (bdi.nInput >= 0 && bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + nDIPOffset; - nPrevDIPSettings[j] = pgi->Input.Constant.nConst; - j++; - } - } - - return 0; -} - -static int InpDIPSWExit() -{ - GameInpCheckMouse(); - return 0; -} - -static void InpDIPSWCancel() -{ - if (!bOK) { - int i = 0, j = 0; - BurnDIPInfo bdi; - struct GameInp *pgi; - while (BurnDrvGetDIPInfo(&bdi, i) == 0) { - if (bdi.nInput >= 0 && bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + nDIPOffset; - pgi->Input.Constant.nConst = nPrevDIPSettings[j]; - j++; - } - i++; - } - } -} - -// Create the list of possible values for a DIPswitch -static void InpDIPSWSelect() -{ -} - -int InpDIPSWCreate() -{ - if (bDrvOkay == 0) { // No game is loaded - return 1; - } - - bOK = false; - - return 0; -} diff --git a/jan/src/burner/sdl/ips_manager.cpp b/jan/src/burner/sdl/ips_manager.cpp deleted file mode 100644 index e1ecc86d9..000000000 --- a/jan/src/burner/sdl/ips_manager.cpp +++ /dev/null @@ -1,151 +0,0 @@ - -#include "burner.h" - -#ifndef FALSE -#define FALSE 0 -#define TRUE 1 -#endif -// Game patching - -#define UTF8_SIGNATURE "\xef\xbb\xbf" -#define IPS_SIGNATURE "PATCH" -#define IPS_TAG_EOF "EOF" -#define IPS_EXT ".ips" - -#define BYTE3_TO_UINT(bp) \ - (((unsigned int)(bp)[0] << 16) & 0x00FF0000) | \ - (((unsigned int)(bp)[1] << 8) & 0x0000FF00) | \ - ((unsigned int)(bp)[2] & 0x000000FF) - -#define BYTE2_TO_UINT(bp) \ - (((unsigned int)(bp)[0] << 8) & 0xFF00) | \ - ((unsigned int) (bp)[1] & 0x00FF) - -bool bDoIpsPatch = FALSE; - -static void PatchFile(const char* ips_path, UINT8* base) -{ - char buf[6]; - FILE* f = NULL; - int Offset, Size; - UINT8* mem8 = NULL; - - if (NULL == (f = fopen(ips_path, "rb"))) - return; - - memset(buf, 0, sizeof buf); - fread(buf, 1, 5, f); - if (strcmp(buf, IPS_SIGNATURE)) { - return; - } else { - UINT8 ch = 0; - int bRLE = 0; - while (!feof(f)) { - // read patch address offset - fread(buf, 1, 3, f); - buf[3] = 0; - if (strcmp(buf, IPS_TAG_EOF) == 0) - break; - - Offset = BYTE3_TO_UINT(buf); - - // read patch length - fread(buf, 1, 2, f); - Size = BYTE2_TO_UINT(buf); - - bRLE = (Size == 0); - if (bRLE) { - fread(buf, 1, 2, f); - Size = BYTE2_TO_UINT(buf); - ch = fgetc(f); - } - - while (Size--) { - mem8 = base + Offset; - Offset++; - *mem8 = bRLE ? ch : fgetc(f); - } - } - } - - fclose(f); -} - -static void DoPatchGame(const char* patch_name, char* game_name, UINT8* base) -{ - char s[MAX_PATH]; - char* p = NULL; - char* rom_name = NULL; - char* ips_name = NULL; - FILE* fp = NULL; - unsigned long nIpsSize; - - if ((fp = fopen(patch_name, "rb")) != NULL) { - // get ips size - fseek(fp, 0, SEEK_END); - nIpsSize = ftell(fp); - fseek(fp, 0, SEEK_SET); - - while (!feof(fp)) { - if (fgets(s, sizeof s, fp) != NULL) { - p = s; - - // skip UTF-8 sig - if (strncmp(p, UTF8_SIGNATURE, strlen(UTF8_SIGNATURE)) == 0) - p += strlen(UTF8_SIGNATURE); - - if (p[0] == '[') // '[' - break; - - rom_name = strtok(p, " \t\r\n"); - if (!rom_name) - continue; - if (*rom_name == '#') - continue; - if (_stricmp(rom_name, game_name)) - continue; - - ips_name = strtok(NULL, " \t\r\n"); - if (!ips_name) - continue; - - // skip CRC check - strtok(NULL, "\r\n"); - - char ips_path[MAX_PATH]; - char ips_dir[MAX_PATH]; - TCHARToANSI(szAppIpsPath, ips_dir, sizeof(ips_dir)); - - if (strchr(ips_name, '\\')) { - // ips in parent's folder - sprintf(ips_path, "%s\\%s%s", ips_dir, ips_name, IPS_EXT); - } else { - sprintf(ips_path, "%s%s\\%s%s", ips_dir, BurnDrvGetTextA(DRV_NAME), ips_name, IPS_EXT); - } - - PatchFile(ips_path, base); - } - } - fclose(fp); - } -} - -void IpsApplyPatches(UINT8* base, char* rom_name) -{ -#if 0 - char ips_data[MAX_PATH]; - - int nActivePatches = GetIpsNumActivePatches(); - - for (int i = 0; i < nActivePatches; i++) { - memset(ips_data, 0, MAX_PATH); - TCHARToANSI(szIpsActivePatches[i], ips_data, sizeof(ips_data)); - DoPatchGame(ips_data, rom_name, base); - } -#endif -} - -void IpsPatchExit() -{ - bDoIpsPatch = FALSE; -} diff --git a/jan/src/burner/sdl/main.cpp b/jan/src/burner/sdl/main.cpp deleted file mode 100644 index b219f1827..000000000 --- a/jan/src/burner/sdl/main.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/*---------------- -Stuff to finish: - -It wouldn't be a stretch of the imagination to think the whole of the sdl 'port' needs a redo but here are the main things wrong with this version: - - -There is OSD of any kind which makes it hard to display info to the users. -There are lots of problems with the audio output code. -There are lots of problems with the opengl renderer -probably many other things. -------------------*/ -#include "burner.h" - -int nAppVirtualFps = 6000; // App fps * 100 -bool bRunPause=0; -bool bAlwaysProcessKeyboardInput=0; - -void CheckFirstTime() -{ - -} - -void ProcessCommandLine(int argc, char *argv[]) -{ - -} - -#undef main - -int main(int argc, char *argv[]) -{ - UINT32 i=0; - - ConfigAppLoad(); - - CheckFirstTime(); // check for first time run - - SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO); - - BurnLibInit(); - - SDL_WM_SetCaption( "FBA, SDL port.", "FBA, SDL port."); - SDL_ShowCursor(SDL_DISABLE); - - if (argc < 2) - { - int c; - printf ("Usage: fbasdl \n ie: fbasdl uopoko\n Note: no extension.\n\n"); - - return 0; - } - - if (argc == 2) - { - for (i = 0; i < nBurnDrvCount; i++) { - //nBurnDrvSelect[0] = i; - nBurnDrvActive = i; - if (strcmp(BurnDrvGetTextA(0), argv[1]) == 0) { - break; - } - } - - if (i == nBurnDrvCount) { - printf("%s is not supported by FB Alpha.",argv[1]); - return 1; - } - } - - bBurnUseASMCPUEmulation = 0; - bCheatsAllowed = false; - ConfigAppLoad(); - ConfigAppSave(); - - DrvInit(i, 0); - - RunMessageLoop(); - - DrvExit(); - MediaExit(); - - ConfigAppSave(); - BurnLibExit(); - //SDL_Quit(); - - return 0; -} - - -/* const */ TCHAR* ANSIToTCHAR(const char* pszInString, TCHAR* pszOutString, int nOutSize) -{ -#if defined (UNICODE) - static TCHAR szStringBuffer[1024]; - - TCHAR* pszBuffer = pszOutString ? pszOutString : szStringBuffer; - int nBufferSize = pszOutString ? nOutSize * 2 : sizeof(szStringBuffer); - - if (MultiByteToWideChar(CP_ACP, 0, pszInString, -1, pszBuffer, nBufferSize)) { - return pszBuffer; - } - - return NULL; -#else - if (pszOutString) { - _tcscpy(pszOutString, pszInString); - return pszOutString; - } - - return (TCHAR*)pszInString; -#endif -} - - -/* const */ char* TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int nOutSize) -{ -#if defined (UNICODE) - static char szStringBuffer[1024]; - memset(szStringBuffer, 0, sizeof(szStringBuffer)); - - char* pszBuffer = pszOutString ? pszOutString : szStringBuffer; - int nBufferSize = pszOutString ? nOutSize * 2 : sizeof(szStringBuffer); - - if (WideCharToMultiByte(CP_ACP, 0, pszInString, -1, pszBuffer, nBufferSize, NULL, NULL)) { - return pszBuffer; - } - - return NULL; -#else - if (pszOutString) { - strcpy(pszOutString, pszInString); - return pszOutString; - } - - return (char*)pszInString; -#endif -} - - -bool AppProcessKeyboardInput() -{ - return true; -} diff --git a/jan/src/burner/sdl/media.cpp b/jan/src/burner/sdl/media.cpp deleted file mode 100644 index 326be5fc4..000000000 --- a/jan/src/burner/sdl/media.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// Media module -#include "burner.h" - -int MediaInit() -{ - //ScrnInit() // Init the Scrn Window - - if (!bInputOkay) { - InputInit(); // Init Input - } - - nAppVirtualFps = nBurnFPS; - - if (!bAudOkay) { - AudSoundInit(); // Init Sound (not critical if it fails) - } - - nBurnSoundRate = 0; // Assume no sound - pBurnSoundOut = NULL; - if (bAudOkay) { - nBurnSoundRate = nAudSampleRate[nAudSelect]; - nBurnSoundLen = nAudSegLen; - } - - if (!bVidOkay) { - // Reinit the video plugin - VidInit(); - if (!bVidOkay && nVidFullscreen) { - - nVidFullscreen = 0; - - MediaExit(); - return (MediaInit()); - } - if (!nVidFullscreen) { - //ScrnSize(); - } - - if (!bVidOkay) { - printf("Initialized video: %s\n", VidGetModuleName()); - } - - if (bVidOkay && (bRunPause || !bDrvOkay)) { - VidRedraw(); - } - } - - return 0; -} - -int MediaExit() -{ - nBurnSoundRate = 0; // Blank sound - pBurnSoundOut = NULL; - - AudSoundExit(); // Exit sound - - VidExit(); - - InputExit(); - - //ScrnExit(); // Exit the Scrn Window - - return 0; -} - diff --git a/jan/src/burner/sdl/neocdlist.cpp b/jan/src/burner/sdl/neocdlist.cpp deleted file mode 100644 index 75e1d6b74..000000000 --- a/jan/src/burner/sdl/neocdlist.cpp +++ /dev/null @@ -1,519 +0,0 @@ -// --------------------------------------------------------------------------------------- -// NeoGeo CD Game Info Module (by CaptainCPS-X) -// --------------------------------------------------------------------------------------- -#include "burner.h" -#include "neocdlist.h" - -struct NGCDGAME games[] = -{ -// ---------------------------------------------------------------------------------------------------------------------------------------------// -// * Name * Title * Year * Company * Game ID // -// ---------------------------------------------------------------------------------------------------------------------------------------------// - { _T("nam1975") , _T("NAM-1975") , _T("1990") , _T("SNK") , 0x0001 }, // - { _T("bstars") , _T("Baseball Stars Professional") , _T("1991") , _T("SNK") , 0x0002 }, // - { _T("tpgolf") , _T("Top Player's Golf") , _T("1990") , _T("SNK") , 0x0003 }, // - { _T("mahretsu") , _T("Mahjong Kyo Retsuden - Nishi Nihon Hen") , _T("1990") , _T("SNK") , 0x0004 }, // - { _T("maglord") , _T("Magician Lord") , _T("1990") , _T("ADK") , 0x0005 }, // - { _T("ridhero") , _T("Riding Hero") , _T("1991") , _T("SNK") , 0x0006 }, // - { _T("alpham2") , _T("Alpha Mission II / ASO II - Last Guardian") , _T("1994") , _T("SNK") , 0x0007 }, // - { _T("ncombat") , _T("Ninja Combat") , _T("1990") , _T("SNK/ADK") , 0x0009 }, // - { _T("cyberlip") , _T("Cyber-Lip") , _T("1991") , _T("SNK") , 0x0010 }, // - { _T("superspy") , _T("The Super Spy") , _T("1990") , _T("SNK") , 0x0011 }, // - { _T("mutnat") , _T("Mutation Nation") , _T("1995") , _T("SNK") , 0x0014 }, // - { _T("sengoku") , _T("Sengoku / Sengoku Denshou") , _T("1994") , _T("SNK") , 0x0017 }, // - { _T("burningf") , _T("Burning Fight") , _T("1994") , _T("SNK") , 0x0018 }, // - { _T("lbowling") , _T("League Bowling") , _T("1994") , _T("SNK") , 0x0019 }, // - { _T("gpilots") , _T("Ghost Pilots") , _T("1991") , _T("SNK") , 0x0020 }, // - { _T("joyjoy") , _T("Puzzled / Joy Joy Kid") , _T("1990") , _T("SNK") , 0x0021 }, // - { _T("bjourney") , _T("Blue's Journey / Raguy") , _T("1990") , _T("SNK/ADK") , 0x0022 }, // - { _T("lresort") , _T("Last Resort") , _T("1994") , _T("SNK") , 0x0024 }, // - { _T("2020bb") , _T("2020 Super Baseball") , _T("1994") , _T("SNK") , 0x0030 }, // - { _T("socbrawl") , _T("Soccer Brawl") , _T("1991") , _T("SNK") , 0x0031 }, // - { _T("roboarmy") , _T("Robo Army") , _T("1991") , _T("SNK") , 0x0032 }, // - { _T("fatfury") , _T("Fatal Fury - The Battle of Fury") , _T("1994") , _T("SNK") , 0x0033 }, // - { _T("fbfrenzy") , _T("Football Frenzy") , _T("1994") , _T("SNK") , 0x0034 }, // - { _T("crswords") , _T("Crossed Swords") , _T("1994") , _T("SNK/ADK") , 0x0037 }, // - { _T("rallych") , _T("Rally Chase") , _T("1991") , _T("SNK/ADK") , 0x0038 }, // - { _T("kotm2") , _T("King of the Monsters 2") , _T("1992") , _T("SNK") , 0x0039 }, // - { _T("sengoku2") , _T("Sengoku 2 / Sengoku Denshou 2") , _T("1994") , _T("SNK") , 0x0040 }, // - { _T("bstars2") , _T("Baseball Stars 2") , _T("1992") , _T("SNK") , 0x0041 }, // - { _T("3countb") , _T("3 Count Bout / Fire Suplex") , _T("1995") , _T("SNK") , 0x0043 }, // - { _T("aof") , _T("Art of Fighting / Ryuuko no Ken") , _T("1994") , _T("SNK") , 0x0044 }, // - { _T("samsho") , _T("Samurai Shodown / Samurai Spirits") , _T("1993") , _T("SNK") , 0x0045 }, // - { _T("tophuntr") , _T("Top Hunter - Roddy & Cathy") , _T("1994") , _T("SNK") , 0x0046 }, // - { _T("fatfury2") , _T("Fatal Fury 2 / Garou Densetsu 2 - Aratanaru Tatakai") , _T("1994") , _T("SNK") , 0x0047 }, // - { _T("janshin") , _T("Janshin Densetsu - Quest of the Jongmaster") , _T("1995") , _T("Yubis") , 0x0048 }, // - { _T("ncommand") , _T("Ninja Commando") , _T("1992") , _T("SNK") , 0x0050 }, // - { _T("viewpoin") , _T("Viewpoint") , _T("1992") , _T("Sammy/Aicom") , 0x0051 }, // - { _T("ssideki") , _T("Super Sidekicks / Tokuten Oh") , _T("1993") , _T("SNK") , 0x0052 }, // - { _T("wh1") , _T("World Heroes") , _T("1992") , _T("ADK") , 0x0053 }, // - { _T("crsword2") , _T("Crossed Swords II") , _T("1995") , _T("SNK/ADK") , 0x0054 }, // - { _T("kof94") , _T("The King of Fighters '94 (JP)") , _T("1994") , _T("SNK") , 0x0055 }, // - { _T("kof94ju") , _T("The King of Fighters '94 (JP-US)") , _T("1994") , _T("SNK") , 0x1055 }, // custom id - { _T("aof2") , _T("Art of Fighting 2 / Ryuuko no Ken 2") , _T("1994") , _T("SNK") , 0x0056 }, // - { _T("wh2") , _T("World Heroes 2") , _T("1995") , _T("SNK/ADK") , 0x0057 }, // - { _T("fatfursp") , _T("Fatal Fury Special / Garou Densetsu Special") , _T("1994") , _T("SNK") , 0x0058 }, // - { _T("savagere") , _T("Savage Reign / Fu'un Mokujiroku - Kakutou Sousei") , _T("1995") , _T("SNK") , 0x0059 }, // - { _T("ssideki2") , _T("Super Sidekicks 2 / Tokuten Oh 2") , _T("1994") , _T("SNK") , 0x0061 }, // - { _T("samsho2") , _T("Samurai Shodown 2 / Shin Samurai Spirits") , _T("1994") , _T("SNK") , 0x0063 }, // - { _T("wh2j") , _T("World Heroes 2 Jet") , _T("1995") , _T("SNK/ADK") , 0x0064 }, // - { _T("wjammers") , _T("Windjammers / Flying Power Disc") , _T("1994") , _T("Data East") , 0x0065 }, // - { _T("karnovr") , _T("Karnov's Revenge / Fighters History Dynamite") , _T("1994") , _T("Data East") , 0x0066 }, // - { _T("pspikes2") , _T("Power Spikes II") , _T("1994") , _T("Video System") , 0x0068 }, // - { _T("aodk") , _T("Aggressors of Dark Kombat / Tsuukai GanGan Koushinkyoku") , _T("1994"), _T("SNK/ADK") , 0x0074 }, // - { _T("sonicwi2") , _T("Aero Fighters 2 / Sonic Wings 2") , _T("1994") , _T("Video System") , 0x0075 }, // - { _T("galaxyfg") , _T("Galaxy Fight - Universal Warriors") , _T("1995") , _T("Sunsoft") , 0x0078 }, // - { _T("strhoop") , _T("Street Hoop / Dunk Dream") , _T("1994") , _T("Data East") , 0x0079 }, // - { _T("quizkof") , _T("Quiz King of Fighters") , _T("1993") , _T("SNK/Saurus") , 0x0080 }, // - { _T("ssideki3") , _T("Super Sidekicks 3 - The Next Glory / Tokuten Oh 3 - Eikoue No Chousen"), _T("1995") , _T("SNK") , 0x0081 }, // - { _T("doubledr") , _T("Double Dragon") , _T("1995") , _T("Technos") , 0x0082 }, // - { _T("pbobblen") , _T("Puzzle Bobble / Bust-A-Move") , _T("1994") , _T("SNK") , 0x0083 }, // - { _T("kof95") , _T("The King of Fighters '95 (JP-US)") , _T("1995") , _T("SNK") , 0x0084 }, // - { _T("kof95r1") , _T("The King of Fighters '95 (JP-US)(Rev 1)") , _T("1995") , _T("SNK") , 0x1084 }, // - { _T("ssrpg") , _T("Shinsetsu Samurai Spirits - Bushidohretsuden") , _T("1997") , _T("SNK") , 0x0085 }, // - { _T("samsho3") , _T("Samurai Shodown 3 / Samurai Spirits 3") , _T("1995") , _T("SNK") , 0x0087 }, // - { _T("stakwin") , _T("Stakes Winner - GI Kanzen Seiha Heno Machi") , _T("1995") , _T("Saurus") , 0x0088 }, // - { _T("pulstar") , _T("Pulstar") , _T("1995") , _T("Aicom") , 0x0089 }, // - { _T("whp") , _T("World Heroes Perfect") , _T("1995") , _T("ADK") , 0x0090 }, // - { _T("kabukikl") , _T("Kabuki Klash / Tengai Makyou Shinden - Far East of Eden") , _T("1995"), _T("Hudson") , 0x0092 }, // - { _T("gowcaizr") , _T("Voltage Fighter Gowcaizer / Choujin Gakuen Gowcaizer"), _T("1995") , _T("Technos") , 0x0094 }, // - { _T("rbff1") , _T("Real Bout Fatal Fury") , _T("1995") , _T("SNK") , 0x0095 }, // - { _T("aof3") , _T("Art of Fighting 3: Path of the Warrior") , _T("1996") , _T("SNK") , 0x0096 }, // - { _T("sonicwi3") , _T("Aero Fighters 3 / Sonic Wings 3") , _T("1995") , _T("SNK") , 0x0097 }, // - { _T("fromanc2") , _T("Idol Mahjong Final Romance 2") , _T("1995") , _T("Video Systems") , 0x0098 }, // - { _T("turfmast") , _T("Neo Turf Masters / Big Tournament Golf") , _T("1996") , _T("Nazca") , 0x0200 }, // - { _T("mslug") , _T("Metal Slug - Super Vehicle-001") , _T("1996") , _T("Nazca") , 0x0201 }, // - { _T("mosyougi") , _T("Shougi no Tatsujin - Master of Syougi") , _T("1995") , _T("ADK") , 0x0203 }, // - { _T("adkworld") , _T("ADK World / ADK Special") , _T("1995") , _T("ADK") , 0x0204 }, // - { _T("ngcdsp") , _T("Neo Geo CD Special") , _T("1995") , _T("SNK") , 0x0205 }, // - { _T("zintrick") , _T("Zintrick / Oshidashi Zintrick") , _T("1996") , _T("ADK") , 0x0211 }, // - { _T("overtop") , _T("OverTop") , _T("1996") , _T("ADK") , 0x0212 }, // - { _T("neodrift") , _T("Neo DriftOut") , _T("1996") , _T("Visco") , 0x0213 }, // - { _T("kof96") , _T("The King of Fighters '96") , _T("1996") , _T("SNK") , 0x0214 }, // - { _T("ninjamas") , _T("Ninja Master's - Haou Ninpou-Chou") , _T("1996") , _T("ADK/SNK") , 0x0217 }, // - { _T("ragnagrd") , _T("Ragnagard / Shinouken") , _T("1996") , _T("Saurus") , 0x0218 }, // - { _T("pgoal") , _T("Pleasuregoal - 5 on 5 Mini Soccer / Futsal") , _T("1996") , _T("Saurus") , 0x0219 }, // - { _T("ironclad") , _T("Ironclad / Choutetsu Brikin'ger") , _T("1996") , _T("Saurus") , 0x0220 }, // - { _T("magdrop2") , _T("Magical Drop 2") , _T("1996") , _T("Data East") , 0x0221 }, // - { _T("samsho4") , _T("Samurai Shodown IV - Amakusa's Revenge") , _T("1996") , _T("SNK") , 0x0222 }, // - { _T("rbffspec") , _T("Real Bout Fatal Fury Special") , _T("1996") , _T("SNK") , 0x0223 }, // - { _T("twinspri") , _T("Twinkle Star Sprites") , _T("1996") , _T("ADK") , 0x0224 }, // - { _T("kof96ngc") , _T("The King of Fighters '96 NEOGEO Collection") , _T("1996") , _T("SNK") , 0x0229 }, // - { _T("breakers") , _T("Breakers") , _T("1996") , _T("Visco") , 0x0230 }, // - { _T("kof97") , _T("The King of Fighters '97") , _T("1997") , _T("SNK") , 0x0232 }, // - { _T("lastblad") , _T("The Last Blade / Bakumatsu Roman - Gekka no Kenshi") , _T("1997") , _T("SNK") , 0x0234 }, // - { _T("rbff2") , _T("Real Bout Fatal Fury 2 / Garou Densetsu 2 - Aratanaru Tatakai"), _T("1998"), _T("SNK") , 0x0240 }, // - { _T("mslug2") , _T("Metal Slug 2 - Super Vehicle-001/II") , _T("1998") , _T("SNK") , 0x0241 }, // - { _T("kof98") , _T("The King of Fighters '98 - The Slugfest") , _T("1998") , _T("SNK") , 0x0242 }, // - { _T("lastbld2") , _T("The Last Blade 2") , _T("1998") , _T("SNK") , 0x0243 }, // - { _T("kof99") , _T("The King of Fighters '99 - Millennium Battle") , _T("1999") , _T("SNK") , 0x0251 }, // - { _T("fatfury3") , _T("Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - Harukanaru Tatakai"), _T("1995"), _T("SNK"), 0x069c }, // -}; - -NGCDGAME* GetNeoGeoCDInfo(unsigned int nID) -{ - for(unsigned int nGame = 0; nGame < (sizeof(games) / sizeof(NGCDGAME)); nGame++) { - if(nID == games[nGame].id ) { - return &games[nGame]; - } - } - - return NULL; -} - -// Update the main window title -void SetNeoCDTitle(TCHAR* pszTitle) -{ - TCHAR szText[1024] = _T(""); - _stprintf(szText, _T(APP_TITLE) _T( " v%.20s") _T(SEPERATOR_1) _T("%s") _T(SEPERATOR_1) _T("%s"), szAppBurnVer, BurnDrvGetText(DRV_FULLNAME), pszTitle); -#ifdef BUILD_WIN32 - SetWindowText(hScrnWnd, szText); -#endif -} - -NGCDGAME* game; - -// Get the title -int GetNeoCDTitle(unsigned int nGameID) -{ - game = (NGCDGAME*)malloc(sizeof(NGCDGAME)); - memset(game, 0, sizeof(NGCDGAME)); - - if(GetNeoGeoCDInfo(nGameID)) - { - memcpy(game, GetNeoGeoCDInfo(nGameID), sizeof(NGCDGAME)); - - bprintf(PRINT_NORMAL, _T(" Title: %s \n") , game->pszTitle); - bprintf(PRINT_NORMAL, _T(" Shortname: %s \n") , game->pszName); - bprintf(PRINT_NORMAL, _T(" Year: %s \n") , game->pszYear); - bprintf(PRINT_NORMAL, _T(" Company: %s \n") , game->pszCompany); - - // Update the main window title - SetNeoCDTitle(game->pszTitle); - - return 1; - } - - game = NULL; - return 0; -} - -void iso9660_ReadOffset(unsigned char *Dest, FILE* fp, unsigned int lOffset, unsigned int lSize, unsigned int lLength) -{ - if(fp == NULL) return; - if (Dest == NULL) return; - - fseek(fp, lOffset, SEEK_SET); - fread(Dest, lLength, lSize, fp); -} - -static void NeoCDList_iso9660_CheckDirRecord(FILE* fp, int nSector) -{ - int nSectorLength = 2048; - //int nFile = 0; - unsigned int lBytesRead = 0; - //int nLen = 0; - unsigned int lOffset = 0; - bool bNewSector = false; - bool bRevisionQueve = false; - int nRevisionQueveID = 0; - - lOffset = (nSector * nSectorLength); - - unsigned char* nLenDR = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* Flags = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* ExtentLoc = (unsigned char*)malloc(8 * sizeof(unsigned char)); - unsigned char* Data = (unsigned char*)malloc(0x10b * sizeof(unsigned char)); - unsigned char* LEN_FI = (unsigned char*)malloc(1 * sizeof(unsigned char)); - char *File = (char*)malloc(32 * sizeof(char)); - - while(1) - { - iso9660_ReadOffset(nLenDR, fp, lOffset, 1, sizeof(unsigned char)); - - if(nLenDR[0] == 0x22) { - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - if(nLenDR[0] < 0x22) - { - if(bNewSector) - { - if(bRevisionQueve) { - bRevisionQueve = false; - - GetNeoCDTitle(nRevisionQueveID); - } - return; - } - - nLenDR[0] = 0; - iso9660_ReadOffset(nLenDR, fp, lOffset + 1, 1, sizeof(unsigned char)); - - if(nLenDR[0] < 0x22) { - lOffset += (2048 - lBytesRead); - lBytesRead = 0; - bNewSector = true; - continue; - } - } - - bNewSector = false; - - iso9660_ReadOffset(Flags, fp, lOffset + 25, 1, sizeof(unsigned char)); - - if(!(Flags[0] & (1 << 1))) - { - iso9660_ReadOffset(ExtentLoc, fp, lOffset + 2, 8, sizeof(unsigned char)); - - char szValue[9]; - sprintf(szValue, "%02x%02x%02x%02x", ExtentLoc[4], ExtentLoc[5], ExtentLoc[6], ExtentLoc[7]); - - unsigned int nValue = 0; - sscanf(szValue, "%x", &nValue); - - iso9660_ReadOffset(Data, fp, nValue * 2048, 0x10a, sizeof(unsigned char)); - - char szData[8]; - sprintf(szData, "%c%c%c%c%c%c%c", Data[0x100], Data[0x101], Data[0x102], Data[0x103], Data[0x104], Data[0x105], Data[0x106]); - - if(!strncmp(szData, "NEO-GEO", 7)) - { - char id[] = "0000"; - sprintf(id, "%02X%02X", Data[0x108], Data[0x109]); - - unsigned int nID = 0; - sscanf(id, "%x", &nID); - - iso9660_ReadOffset(LEN_FI, fp, lOffset + 32, 1, sizeof(unsigned char)); - - iso9660_ReadOffset((unsigned char*)File, fp, lOffset + 33, LEN_FI[0], sizeof(char)); - strncpy(File, File, LEN_FI[0]); - File[LEN_FI[0]] = 0; - - // King of Fighters '94, The (1994)(SNK)(JP) - // 10-6-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xDE) { - // ...continue - } - - // King of Fighters '94, The (1994)(SNK)(JP-US) - // 11-21-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xE6) { - // Change to custom revision id - nID = 0x1055; - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B01, B03-B06, NGCD-084E MT B01] - // 9-11-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xC0) { - // ... continue - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B10, NGCD-084E MT B03] - // 10-5-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xFF) { - // Change to custom revision id - nID = 0x1084; - } - - // King of Fighters '96 NEOGEO Collection, The - if(nID == 0x0229) { - bRevisionQueve = false; - - GetNeoCDTitle(nID); - break; - } - - // King of Fighters '96, The - if(nID == 0x0214) { - bRevisionQueve = true; - nRevisionQueveID = nID; - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - GetNeoCDTitle(nID); - - break; - } - } - - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - } - - if (nLenDR) { - free(nLenDR); - nLenDR = NULL; - } - - if (Flags) { - free(Flags); - Flags = NULL; - } - - if (ExtentLoc) { - free(ExtentLoc); - ExtentLoc = NULL; - } - - if (Data) { - free(Data); - Data = NULL; - } - - if (LEN_FI) { - free(LEN_FI); - LEN_FI = NULL; - } - - if (File) { - free(File); - File = NULL; - } -} - -// Check the specified ISO, and proceed accordingly -static int NeoCDList_CheckISO(TCHAR* pszFile) -{ - if(!pszFile) { - // error - return 0; - } - - // Make sure we have a valid ISO file extension... - if(_tcsstr(pszFile, _T(".iso")) || _tcsstr(pszFile, _T(".ISO")) ) - { - FILE* fp = _tfopen(pszFile, _T("rb")); - if(fp) - { - // Read ISO and look for 68K ROM standard program header, ID is always there - // Note: This function works very quick, doesn't compromise performance :) - // it just read each sector first 264 bytes aproximately only. - - // Get ISO Size (bytes) - fseek(fp, 0, SEEK_END); - unsigned int lSize = 0; - lSize = ftell(fp); - //rewind(fp); - fseek(fp, 0, SEEK_SET); - - // If it has at least 16 sectors proceed - if(lSize > (2048 * 16)) - { - // Check for Standard ISO9660 Identifier - unsigned char IsoHeader[2048 * 16 + 1]; - unsigned char IsoCheck[6]; - - fread(IsoHeader, 1, 2048 * 16 + 1, fp); // advance to sector 16 and PVD Field 2 - fread(IsoCheck, 1, 5, fp); // get Standard Identifier Field from PVD - - // Verify that we have indeed a valid ISO9660 MODE1/2048 - if(!memcmp(IsoCheck, "CD001", 5)) - { - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Found. \n")); - iso9660_VDH vdh; - - // Get Volume Descriptor Header - memset(&vdh, 0, sizeof(vdh)); - //memcpy(&vdh, iso9660_ReadOffset(fp, (2048 * 16), sizeof(vdh)), sizeof(vdh)); - iso9660_ReadOffset((unsigned char*)&vdh, fp, 2048 * 16, 1, sizeof(vdh)); - - // Check for a valid Volume Descriptor Type - if(vdh.vdtype == 0x01) - { -#if 0 -// This will fail on 64-bit due to differing variable sizes in the pvd struct - // Get Primary Volume Descriptor - iso9660_PVD pvd; - memset(&pvd, 0, sizeof(pvd)); - //memcpy(&pvd, iso9660_ReadOffset(fp, (2048 * 16), sizeof(pvd)), sizeof(pvd)); - iso9660_ReadOffset((unsigned char*)&pvd, fp, 2048 * 16, 1, sizeof(pvd)); - - // ROOT DIRECTORY RECORD - - // Handle Path Table Location - char szRootSector[32]; - unsigned int nRootSector = 0; - - sprintf(szRootSector, "%02X%02X%02X%02X", - pvd.root_directory_record.location_of_extent[4], - pvd.root_directory_record.location_of_extent[5], - pvd.root_directory_record.location_of_extent[6], - pvd.root_directory_record.location_of_extent[7]); - - // Convert HEX string to Decimal - sscanf(szRootSector, "%X", &nRootSector); -#else -// Just read from the file directly at the correct offset (0x8000 + 0x9e for the start of the root directory record) - unsigned char buffer[8]; - char szRootSector[32]; - unsigned int nRootSector = 0; - - fseek(fp, 0x809e, SEEK_SET); - fread(buffer, 1, 8, fp); - - sprintf(szRootSector, "%02x%02x%02x%02x", buffer[4], buffer[5], buffer[6], buffer[7]); - - sscanf(szRootSector, "%x", &nRootSector); -#endif - - // Process the Root Directory Records - NeoCDList_iso9660_CheckDirRecord(fp, nRootSector); - - // Path Table Records are not processed, since NeoGeo CD should not have subdirectories - // ... - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Not Found, cannot continue. \n")); - return 0; - } - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Couldn't open %s \n"), GetIsoPath()); - return 0; - } - - if(fp) fclose(fp); - - } else { - - //bprintf(PRINT_NORMAL, _T(" File doesn't have a valid ISO extension [ .iso / .ISO ] \n")); - return 0; - } - - return 1; -} - -// This will do everything -int GetNeoGeoCD_Identifier() -{ - if(!GetIsoPath() || !IsNeoGeoCD()) { - return 0; - } - - // Make sure we have a valid ISO file extension... - if(_tcsstr(GetIsoPath(), _T(".iso")) || _tcsstr(GetIsoPath(), _T(".ISO")) ) - { - if(_tfopen(GetIsoPath(), _T("rb"))) - { - // Read ISO and look for 68K ROM standard program header, ID is always there - // Note: This function works very quick, doesn't compromise performance :) - // it just read each sector first 264 bytes aproximately only. - NeoCDList_CheckISO(GetIsoPath()); - - } else { - - bprintf(PRINT_NORMAL, _T(" Couldn't open %s \n"), GetIsoPath()); - return 0; - } - - } else { - - bprintf(PRINT_NORMAL, _T(" File doesn't have a valid ISO extension [ .iso / .ISO ] \n")); - return 0; - } - - return 1; -} - -int NeoCDInfo_Init() -{ - NeoCDInfo_Exit(); - return GetNeoGeoCD_Identifier(); -} - -TCHAR* NeoCDInfo_Text(int nText) -{ - if(!game || !IsNeoGeoCD() || !bDrvOkay) return NULL; - - switch(nText) - { - case DRV_NAME: return game->pszName; - case DRV_FULLNAME: return game->pszTitle; - case DRV_MANUFACTURER: return game->pszCompany; - case DRV_DATE: return game->pszYear; - } - - return NULL; -} - -int NeoCDInfo_ID() -{ - if(!game || !IsNeoGeoCD() || !bDrvOkay) return 0; - return game->id; -} - -void NeoCDInfo_Exit() -{ - if(game) { - free(game); - game = NULL; - } -} diff --git a/jan/src/burner/sdl/run.cpp b/jan/src/burner/sdl/run.cpp deleted file mode 100644 index d68ea2ed8..000000000 --- a/jan/src/burner/sdl/run.cpp +++ /dev/null @@ -1,253 +0,0 @@ -// Run module -#include "burner.h" - -bool bAltPause = 0; - -int bAlwaysDrawFrames = 0; - -static bool bShowFPS = false; - -int counter; // General purpose variable used when debugging - -static unsigned int nNormalLast = 0; // Last value of timeGetTime() -static int nNormalFrac = 0; // Extra fraction we did - -static bool bAppDoStep = 0; -static bool bAppDoFast = 0; -static int nFastSpeed = 6; - -static int GetInput(bool bCopy) -{ - static int i = 0; - InputMake(bCopy); // get input - - // Update Input dialog ever 3 frames - if (i == 0) { - //InpdUpdate(); - } - - i++; - - if (i >= 3) { - i = 0; - } - - // Update Input Set dialog - //InpsUpdate(); - return 0; -} - -static void DisplayFPS() -{ - static time_t fpstimer; - static unsigned int nPreviousFrames; - - char fpsstring[8]; - time_t temptime = clock(); - float fps = static_cast(nFramesRendered - nPreviousFrames) * CLOCKS_PER_SEC / (temptime - fpstimer); - sprintf(fpsstring, "%2.1f", fps); - - fpstimer = temptime; - nPreviousFrames = nFramesRendered; -} - -// define this function somewhere above RunMessageLoop() -void ToggleLayer(unsigned char thisLayer) -{ - nBurnLayer ^= thisLayer; // xor with thisLayer - VidRedraw(); - VidPaint(0); -} - -// With or without sound, run one frame. -// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen -static int RunFrame(int bDraw, int bPause) -{ - static int bPrevPause = 0; - static int bPrevDraw = 0; - - if (bPrevDraw && !bPause) { - VidPaint(0); // paint the screen (no need to validate) - } - - if (!bDrvOkay) { - return 1; - } - - if (bPause) - { - GetInput(false); // Update burner inputs, but not game inputs - if (bPause != bPrevPause) - { - VidPaint(2); // Redraw the screen (to ensure mode indicators are updated) - } - } - else - { - nFramesEmulated++; - nCurrentFrame++; - GetInput(true); // Update inputs - } - if (bDraw) { - nFramesRendered++; - if (VidFrame()) { // Do one frame - AudBlankSound(); - } - } - else { // frame skipping - pBurnDraw = NULL; // Make sure no image is drawn - BurnDrvFrame(); - } - bPrevPause = bPause; - bPrevDraw = bDraw; - - return 0; -} - - -// Callback used when DSound needs more sound -static int RunGetNextSound(int bDraw) -{ - if (nAudNextSound == NULL) { - return 1; - } - - if (bRunPause) { - if (bAppDoStep) { - RunFrame(bDraw, 0); - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - } else { - RunFrame(bDraw, 1); - } - - bAppDoStep = 0; // done one step - return 0; - } - - if (bAppDoFast) { // do more frames - for (int i = 0; i < nFastSpeed; i++) { - RunFrame(0, 0); - } - } - - // Render frame with sound - pBurnSoundOut = nAudNextSound; - RunFrame(bDraw, 0); - if (bAppDoStep) { - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - } - bAppDoStep = 0; // done one step - - return 0; -} - -int RunIdle() -{ - int nTime, nCount; - - if (bAudPlaying) { - // Run with sound - AudSoundCheck(); - return 0; - } - - // Run without sound - nTime = SDL_GetTicks() - nNormalLast; - nCount = (nTime * nAppVirtualFps - nNormalFrac) / 100000; - if (nCount <= 0) { // No need to do anything for a bit - SDL_Delay(3); - - return 0; - } - - nNormalFrac += nCount * 100000; - nNormalLast += nNormalFrac / nAppVirtualFps; - nNormalFrac %= nAppVirtualFps; - - if (bAppDoFast){ // Temporarily increase virtual fps - nCount *= nFastSpeed; - } - if (nCount > 100) { // Limit frame skipping - nCount = 100; - } - if (bRunPause) { - if (bAppDoStep) { // Step one frame - nCount = 10; - } else { - RunFrame(1, 1); // Paused - return 0; - } - } - bAppDoStep = 0; - - for (int i = nCount / 10; i > 0; i--) { // Mid-frames - RunFrame(!bAlwaysDrawFrames, 0); - } - RunFrame(1, 0); // End-frame - // temp added for SDLFBA - //VidPaint(0); - return 0; -} - -int RunReset() -{ - // Reset the speed throttling code - nNormalLast = 0; nNormalFrac = 0; - if (!bAudPlaying) { - // run without sound - nNormalLast = SDL_GetTicks(); - } - return 0; -} - -static int RunInit() -{ - // Try to run with sound - AudSetCallback(RunGetNextSound); - AudSoundPlay(); - - RunReset(); - - return 0; -} - -static int RunExit() -{ - nNormalLast = 0; - - return 0; -} - -// The main message loop -int RunMessageLoop() -{ - int bRestartVideo; - int finished= 0; - do { - bRestartVideo = 0; - - MediaInit(); - - RunInit(); - - GameInpCheckMouse(); // Hide the cursor - while (!finished) { - SDL_Event event; - if ( SDL_PollEvent(&event) ) { - switch (event.type) { - case SDL_QUIT: /* Windows was closed */ - finished=1; - break; - } - } - else - { - RunIdle(); - } - } - RunExit(); - } while (bRestartVideo); - - return 0; -} - diff --git a/jan/src/burner/sdl/scrn.cpp b/jan/src/burner/sdl/scrn.cpp deleted file mode 100644 index 5f63537e9..000000000 --- a/jan/src/burner/sdl/scrn.cpp +++ /dev/null @@ -1,8 +0,0 @@ - -#include "burner.h" - -void Reinitialise() -{ - //POST_INITIALISE_MESSAGE; - VidReInitialise(); -} diff --git a/jan/src/burner/sdl/stated.cpp b/jan/src/burner/sdl/stated.cpp deleted file mode 100644 index a1df0939c..000000000 --- a/jan/src/burner/sdl/stated.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// State dialog module -#include "burner.h" - -int bDrvSaveAll=0; - - -// The automatic save -int StatedAuto(int bSave) -{ - return 0; -} - -static void CreateStateName(int nSlot) -{ - -} - -int StatedLoad(int nSlot) // int nSlot = 0 -{ - return 0; -} - -int StatedSave(int nSlot) // int nSlot = 0 -{ - - return 0; -} diff --git a/jan/src/burner/sdl/stringset.cpp b/jan/src/burner/sdl/stringset.cpp deleted file mode 100644 index 8167278ac..000000000 --- a/jan/src/burner/sdl/stringset.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// StringSet C++ class -#include "burner.h" - -int __cdecl StringSet::Add(TCHAR* szFormat,...) -{ - TCHAR szAdd[256]; - int nAddLen = 0; - TCHAR* NewMem; - va_list Arg; - - va_start(Arg, szFormat); - _vstprintf(szAdd, szFormat, Arg); - - nAddLen = _tcslen(szAdd); // find out the length of the new text - NewMem = (TCHAR*)realloc(szText, (nLen + nAddLen + 1) * sizeof(TCHAR)); - if (NewMem) { - szText = NewMem; - // copy the new text to the end - _tcsncpy(szText + nLen, szAdd, nAddLen); - nLen += nAddLen; - szText[nLen] = 0; // zero-terminate - } - - va_end(Arg); - - return 0; -} - -int StringSet::Reset() -{ - // Reset the text - nLen = 0; - szText= (TCHAR*)realloc(szText, sizeof(TCHAR)); - if (szText == NULL) { - return 1; - } - szText[0] = 0; - - return 0; -} - -StringSet::StringSet() -{ - szText = NULL; - nLen = 0; - Reset(); // reset string to nothing -} - -StringSet::~StringSet() -{ - realloc(szText, 0); // Free BZip text -} diff --git a/jan/src/burner/sdl/support_paths.cpp b/jan/src/burner/sdl/support_paths.cpp deleted file mode 100644 index f9adb05b3..000000000 --- a/jan/src/burner/sdl/support_paths.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "burner.h" - -TCHAR szAppPreviewsPath[MAX_PATH] = _T("support\\previews\\"); -TCHAR szAppTitlesPath[MAX_PATH] = _T("support\\titles\\"); -TCHAR szAppSelectPath[MAX_PATH] = _T("support\\select\\"); -TCHAR szAppVersusPath[MAX_PATH] = _T("support\\versus\\"); -TCHAR szAppHowtoPath[MAX_PATH] = _T("support\\howto\\"); -TCHAR szAppScoresPath[MAX_PATH] = _T("support\\scores\\"); -TCHAR szAppBossesPath[MAX_PATH] = _T("support\\bosses\\"); -TCHAR szAppGameoverPath[MAX_PATH] = _T("support\\gameover\\"); -TCHAR szAppFlyersPath[MAX_PATH] = _T("support\\flyers\\"); -TCHAR szAppMarqueesPath[MAX_PATH] = _T("support\\marquees\\"); -TCHAR szAppControlsPath[MAX_PATH] = _T("support\\controls\\"); -TCHAR szAppCabinetsPath[MAX_PATH] = _T("support\\cabinets\\"); -TCHAR szAppPCBsPath[MAX_PATH] = _T("support\\pcbs\\"); -TCHAR szAppCheatsPath[MAX_PATH] = _T("support\\cheats\\"); -TCHAR szAppHistoryPath[MAX_PATH] = _T("support\\"); -TCHAR szAppListsPath[MAX_PATH] = _T("support\\lists\\lst\\"); -TCHAR szAppDatListsPath[MAX_PATH] = _T("support\\lists\\dat\\"); -TCHAR szAppIpsPath[MAX_PATH] = _T("support\\ips\\"); -TCHAR szAppIconsPath[MAX_PATH] = _T("support\\icons\\"); -TCHAR szAppArchivesPath[MAX_PATH] = _T("support\\archives\\"); -TCHAR szAppHiscorePath[MAX_PATH] = _T("support\\hiscores\\"); -TCHAR szAppSamplesPath[MAX_PATH] = _T("support\\samples\\"); -TCHAR szAppBlendPath[MAX_PATH] = _T("support\\blend\\"); - -TCHAR szCheckIconsPath[MAX_PATH]; diff --git a/jan/src/burner/sdl/tchar.h b/jan/src/burner/sdl/tchar.h deleted file mode 100644 index 684390a67..000000000 --- a/jan/src/burner/sdl/tchar.h +++ /dev/null @@ -1,59 +0,0 @@ -#include -#ifdef _UNICODE -//TODO: bah -#include -#define __TEXT(q) L##q - -typedef wchar_t TCHAR; -typedef wchar_t _TCHAR; - -#else - -#define __TEXT(q) q - -#ifndef RC_INVOKED -typedef char TCHAR; -typedef char _TCHAR; -#endif - -// WTF? This is a normal string function! -// damn linux. :) -#define wcslen(void) - -#define _tcslen strlen -#define _tcscpy strcpy -#define _tcsncpy strncpy - -#define _tprintf printf -#define _vstprintf vsprintf -#define _vsntprintf vsnprintf -#define _stprintf sprintf -#define _sntprintf snprintf -#define _ftprintf fprintf -#define _tsprintf sprintf - -#define _tcscmp strcmp -#define _tcsncmp strncmp -#define _tcsicmp strcasecmp -#define _tcsnicmp strncasecmp -#define _tcstol strtol -#define _tcsstr strstr - -#define _fgetts fgets -#define _fputts fputs - -#define _istspace isspace - -#define _tfopen fopen - -#define _stricmp strcmp -#define _strnicmp strncmp - -// FBA function, change this! -#define dprintf printf - -#endif - -#define _TEXT(x) __TEXT(x) -#define _T(x) __TEXT(x) - diff --git a/jan/src/burner/sshot.cpp b/jan/src/burner/sshot.cpp deleted file mode 100644 index a4d1d9b78..000000000 --- a/jan/src/burner/sshot.cpp +++ /dev/null @@ -1,230 +0,0 @@ -#include "burner.h" - -#define SSHOT_NOERROR 0 -#define SSHOT_ERROR_BPP_NOTSUPPORTED 1 -#define SSHOT_LIBPNG_ERROR 2 -#define SSHOT_OTHER_ERROR 3 - -#define SSHOT_DIRECTORY "screenshots/" - -static UINT8* pSShot = NULL; -static UINT8* pConvertedImage = NULL; -static png_bytep* pSShotImageRows = NULL; -static FILE* ff = NULL; - -INT32 MakeScreenShot() -{ - char szAuthor[256]; char szDescription[256]; char szCopyright[256]; char szSoftware[256]; char szSource[256]; - png_text text_ptr[8] = { { 0, 0, 0, 0, 0, 0, 0 }, }; - INT32 num_text = 8; - - time_t currentTime; - tm* tmTime; - png_time_struct png_time_now; - - char szSShotName[MAX_PATH] = { 0, }; - INT32 w, h; - - // do our PNG construct things - png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!png_ptr) { - return SSHOT_LIBPNG_ERROR; - } - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - png_destroy_write_struct(&png_ptr, (png_infopp)NULL); - - return SSHOT_LIBPNG_ERROR; - } - - if (setjmp(png_jmpbuf(png_ptr))) { - png_destroy_write_struct(&png_ptr, &info_ptr); - if (pConvertedImage) { - free(pConvertedImage); - pConvertedImage = NULL; - } - - if (pSShotImageRows) { - free(pSShotImageRows); - pSShotImageRows = NULL; - } - - if (ff) { - fclose(ff); - remove(szSShotName); - } - - return SSHOT_LIBPNG_ERROR; - } - - if (pVidImage == NULL) { - return SSHOT_OTHER_ERROR; - } - - if (nVidImageBPP < 2 || nVidImageBPP > 4) { - return SSHOT_ERROR_BPP_NOTSUPPORTED; - } - - BurnDrvGetVisibleSize(&w, &h); - - pSShot = pVidImage; - - // Convert the image to 32-bit - if (nVidImageBPP < 4) { - UINT8* pTemp = (UINT8*)malloc(w * h * sizeof(INT32)); - - if (nVidImageBPP == 2) { - for (INT32 i = 0; i < h * w; i++) { - UINT16 nColour = ((UINT16*)pSShot)[i]; - - // Red - *(pTemp + i * 4 + 0) = (UINT8)((nColour & 0x1F) << 3); - *(pTemp + i * 4 + 0) |= *(pTemp + 4 * i + 0) >> 5; - - if (nVidImageDepth == 15) { - // Green - *(pTemp + i * 4 + 1) = (UINT8)(((nColour >> 5) & 0x1F) << 3); - *(pTemp + i * 4 + 1) |= *(pTemp + i * 4 + 1) >> 5; - // Blue - *(pTemp + i * 4 + 2) = (UINT8)(((nColour >> 10)& 0x1F) << 3); - *(pTemp + i * 4 + 2) |= *(pTemp + i * 4 + 2) >> 5; - } - - if (nVidImageDepth == 16) { - // Green - *(pTemp + i * 4 + 1) = (UINT8)(((nColour >> 5) & 0x3F) << 2); - *(pTemp + i * 4 + 1) |= *(pTemp + i * 4 + 1) >> 6; - // Blue - *(pTemp + i * 4 + 2) = (UINT8)(((nColour >> 11) & 0x1F) << 3); - *(pTemp + i * 4 + 2) |= *(pTemp + i * 4 + 2) >> 5; - } - } - } else { - memset(pTemp, 0, w * h * sizeof(INT32)); - for (INT32 i = 0; i < h * w; i++) { - *(pTemp + i * 4 + 0) = *(pSShot + i * 3 + 0); - *(pTemp + i * 4 + 1) = *(pSShot + i * 3 + 1); - *(pTemp + i * 4 + 2) = *(pSShot + i * 3 + 2); - } - } - - pConvertedImage = pTemp; - - pSShot = pConvertedImage; - } - - // Rotate and flip the image - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - UINT8* pTemp = (UINT8*)malloc(w * h * sizeof(INT32)); - - for (INT32 x = 0; x < h; x++) { - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - for (INT32 y = 0; y < w; y++) { - ((UINT32*)pTemp)[(w - y - 1) + x * w] = ((UINT32*)pSShot)[x + y * h]; - } - } else { - for (INT32 y = 0; y < w; y++) { - ((UINT32*)pTemp)[y + (h - x - 1) * w] = ((UINT32*)pSShot)[x + y * h]; - } - } - } - - pSShot = pTemp; - } - else if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { // fixed rotation by regret - UINT8* pTemp = (UINT8*)malloc(w * h * sizeof(INT32)); - - for (INT32 y = h - 1; y >= 0; y--) { - for (INT32 x = w - 1; x >= 0; x--) { - ((UINT32*)pTemp)[(w - x - 1) + (h - y - 1) * w] = ((UINT32*)pSShot)[x + y * w]; - } - } - - pSShot = pTemp; - } - - // Get the time - time(¤tTime); - tmTime = localtime(¤tTime); - png_convert_from_time_t(&png_time_now, currentTime); - - // construct our filename -> "romname-mm-dd-hms.png" - sprintf(szSShotName,"%s%s-%.2d-%.2d-%.2d%.2d%.2d.png", SSHOT_DIRECTORY, BurnDrvGetTextA(DRV_NAME), tmTime->tm_mon + 1, tmTime->tm_mday, tmTime->tm_hour, tmTime->tm_min, tmTime->tm_sec); - - ff = fopen(szSShotName, "wb"); - if (ff == NULL) { - png_destroy_write_struct(&png_ptr, &info_ptr); - - if (pConvertedImage) { - free(pConvertedImage); - pConvertedImage = NULL; - } - - return SSHOT_OTHER_ERROR; - } - - // Fill the PNG text fields -#ifdef _UNICODE - sprintf(szAuthor, APP_TITLE " v%.20ls", szAppBurnVer); -#else - sprintf(szAuthor, APP_TITLE " v%.20s", szAppBurnVer); -#endif - sprintf(szDescription, "Screenshot of %s", DecorateGameName(nBurnDrvActive)); - sprintf(szCopyright, "%s %s", BurnDrvGetTextA(DRV_DATE), BurnDrvGetTextA(DRV_MANUFACTURER)); -#ifdef _UNICODE - sprintf(szSoftware, APP_TITLE " v%.20ls using LibPNG " PNG_LIBPNG_VER_STRING, szAppBurnVer); -#else - sprintf(szSoftware, APP_TITLE " v%.20s using LibPNG " PNG_LIBPNG_VER_STRING, szAppBurnVer); -#endif - sprintf(szSource, "%s video game hardware", BurnDrvGetTextA(DRV_SYSTEM)); - - text_ptr[0].key = "Title"; text_ptr[0].text = BurnDrvGetTextA(DRV_FULLNAME); - text_ptr[1].key = "Author"; text_ptr[1].text = szAuthor; - text_ptr[2].key = "Description"; text_ptr[2].text = szDescription; - text_ptr[3].key = "Copyright"; text_ptr[3].text = szCopyright; -// text_ptr[4].key = "Creation Time"; text_ptr[4].text = (char*)png_convert_to_rfc1123(png_ptr, &png_time_now); // deprecated in libpng - text_ptr[4].key = "Creation Time"; png_convert_to_rfc1123_buffer(text_ptr[4].text, &png_time_now); - text_ptr[5].key = "Software"; text_ptr[5].text = szSoftware; - text_ptr[6].key = "Source"; text_ptr[6].text = szSource; - text_ptr[7].key = "Comment"; text_ptr[7].text = "This screenshot was created by running the game in an emulator; it might not accurately reflect the actual hardware the game was designed to run on."; - - for (INT32 i = 0; i < num_text; i++) { - text_ptr[i].compression = PNG_TEXT_COMPRESSION_NONE; - } - - png_set_text(png_ptr, info_ptr, text_ptr, num_text); - - png_init_io(png_ptr, ff); - - png_set_IHDR(png_ptr, info_ptr, w, h, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); - png_write_info(png_ptr, info_ptr); - - png_set_filler(png_ptr, 0, PNG_FILLER_AFTER); - - png_set_bgr(png_ptr); - - pSShotImageRows = (png_bytep*)malloc(h * sizeof(png_bytep)); - for (INT32 y = 0; y < h; y++) { - pSShotImageRows[y] = pSShot + (y * w * sizeof(INT32)); - } - - png_write_image(png_ptr, pSShotImageRows); - png_write_end(png_ptr, info_ptr); - - if (pSShotImageRows) { - free(pSShotImageRows); - pSShotImageRows = NULL; - } - - fclose(ff); - - png_destroy_write_struct(&png_ptr, &info_ptr); - - if (pConvertedImage) { - free(pConvertedImage); - pConvertedImage = NULL; - } - - return SSHOT_NOERROR; -} diff --git a/jan/src/burner/state.cpp b/jan/src/burner/state.cpp deleted file mode 100644 index 2954ee074..000000000 --- a/jan/src/burner/state.cpp +++ /dev/null @@ -1,545 +0,0 @@ -// Driver Save State module -#include "burner.h" - -// from dynhuff.cpp -INT32 FreezeDecode(UINT8 **buffer, INT32 *size); -INT32 UnfreezeDecode(const UINT8* buffer, INT32 size); -INT32 FreezeEncode(UINT8 **buffer, INT32 *size); -INT32 UnfreezeEncode(const UINT8* buffer, INT32 size); - -// from replay.cpp -INT32 FreezeInput(UINT8** buf, int* size); -INT32 UnfreezeInput(const UINT8* buf, INT32 size); - -extern INT32 nReplayStatus; -extern bool bReplayReadOnly; -extern INT32 nReplayUndoCount; -extern UINT32 nReplayCurrentFrame; -extern UINT32 nStartFrame; - -// If bAll=0 save/load all non-volatile ram to .fs -// If bAll=1 save/load all ram to .fs - -// ------------ State len -------------------- -static INT32 nTotalLen = 0; - -static INT32 __cdecl StateLenAcb(struct BurnArea* pba) -{ - nTotalLen += pba->nLen; - - return 0; -} - -static INT32 StateInfo(int* pnLen, int* pnMinVer, INT32 bAll) -{ - INT32 nMin = 0; - nTotalLen = 0; - BurnAcb = StateLenAcb; - - BurnAreaScan(ACB_NVRAM, &nMin); // Scan nvram - if (bAll) { - INT32 m; - BurnAreaScan(ACB_MEMCARD, &m); // Scan memory card - if (m > nMin) { // Up the minimum, if needed - nMin = m; - } - BurnAreaScan(ACB_VOLATILE, &m); // Scan volatile ram - if (m > nMin) { // Up the minimum, if needed - nMin = m; - } - } - *pnLen = nTotalLen; - *pnMinVer = nMin; - - return 0; -} - -// State load -INT32 BurnStateLoadEmbed(FILE* fp, INT32 nOffset, INT32 bAll, INT32 (*pLoadGame)()) -{ - const char* szHeader = "FS1 "; // Chunk identifier - - INT32 nLen = 0; - INT32 nMin = 0, nFileVer = 0, nFileMin = 0; - INT32 t1 = 0, t2 = 0; - char ReadHeader[4]; - char szForName[33]; - INT32 nChunkSize = 0; - UINT8 *Def = NULL; - INT32 nDefLen = 0; // Deflated version - INT32 nRet = 0; - - if (nOffset >= 0) { - fseek(fp, nOffset, SEEK_SET); - } else { - if (nOffset == -2) { - fseek(fp, 0, SEEK_END); - } else { - fseek(fp, 0, SEEK_CUR); - } - } - - memset(ReadHeader, 0, 4); - fread(ReadHeader, 1, 4, fp); // Read identifier - if (memcmp(ReadHeader, szHeader, 4)) { // Not the right file type - return -2; - } - - fread(&nChunkSize, 1, 4, fp); - if (nChunkSize <= 0x40) { // Not big enough - return -1; - } - - INT32 nChunkData = ftell(fp); - - fread(&nFileVer, 1, 4, fp); // Version of FB that this file was saved from - - fread(&t1, 1, 4, fp); // Min version of FB that NV data will work with - fread(&t2, 1, 4, fp); // Min version of FB that All data will work with - - if (bAll) { // Get the min version number which applies to us - nFileMin = t2; - } else { - nFileMin = t1; - } - - fread(&nDefLen, 1, 4, fp); // Get the size of the compressed data block - - memset(szForName, 0, sizeof(szForName)); - fread(szForName, 1, 32, fp); - - if (nBurnVer < nFileMin) { // Error - emulator is too old to load this state - return -5; - } - - // Check the game the savestate is for, and load it if needed. - { - bool bLoadGame = false; - - if (nBurnDrvActive < nBurnDrvCount) { - if (strcmp(szForName, BurnDrvGetTextA(DRV_NAME))) { // The save state is for the wrong game - bLoadGame = true; - } - } else { // No game loaded - bLoadGame = true; - } - - if (bLoadGame) { - UINT32 nCurrentGame = nBurnDrvActive; - UINT32 i; - for (i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - if (strcmp(szForName, BurnDrvGetTextA(DRV_NAME)) == 0) { - break; - } - } - if (i == nBurnDrvCount) { - nBurnDrvActive = nCurrentGame; - return -3; - } else { - if (nCurrentGame != nBurnDrvActive) { - INT32 nOldActive = nBurnDrvActive; // Exit current game if loading a state from another game - nBurnDrvActive = nCurrentGame; - DrvExit(); - nBurnDrvActive = nOldActive; - } - if (pLoadGame == NULL) { - return -1; - } - if (pLoadGame()) { - return -1; - } - } - } - } - - StateInfo(&nLen, &nMin, bAll); - if (nLen <= 0) { // No memory to load - return -1; - } - - // Check if the save state is okay - if (nFileVer < nMin) { // Error - this state is too old and cannot be loaded. - return -4; - } - - fseek(fp, nChunkData + 0x30, SEEK_SET); // Read current frame - fread(&nReplayCurrentFrame, 1, 4, fp); - nCurrentFrame = nStartFrame + nReplayCurrentFrame; - - fseek(fp, 0x0C, SEEK_CUR); // Move file pointer to the start of the compressed block - Def = (UINT8*)malloc(nDefLen); - if (Def == NULL) { - return -1; - } - memset(Def, 0, nDefLen); - fread(Def, 1, nDefLen, fp); // Read in deflated block - - nRet = BurnStateDecompress(Def, nDefLen, bAll); // Decompress block into driver - free(Def); // free deflated block - - fseek(fp, nChunkData + nChunkSize, SEEK_SET); - - if (nRet == 0) { // Force the palette to recalculate on state load - BurnRecalcPal(); - } - - if (nRet) { - return -1; - } else { - return 0; - } -} - -// State load -INT32 BurnStateLoad(TCHAR* szName, INT32 bAll, INT32 (*pLoadGame)()) -{ - const char szHeader[] = "FB1 "; // File identifier - char szReadHeader[4] = ""; - INT32 nRet = 0; - - FILE* fp = _tfopen(szName, _T("rb")); - if (fp == NULL) { - return 1; - } - - fread(szReadHeader, 1, 4, fp); // Read identifier - if (memcmp(szReadHeader, szHeader, 4) == 0) { // Check filetype - nRet = BurnStateLoadEmbed(fp, -1, bAll, pLoadGame); - } - - // load movie extra info - if(nReplayStatus) - { - const char szMovieExtra[] = "MOV "; - const char szDecodeChunk[] = "HUFF"; - const char szInputChunk[] = "INP "; - - INT32 nChunkSize; - UINT8* buf=NULL; - - do - { - fread(szReadHeader, 1, 4, fp); - if(memcmp(szReadHeader, szMovieExtra, 4)) { nRet = -1; break; } - fread(&nChunkSize, 1, 4, fp); - - fread(szReadHeader, 1, 4, fp); - if(memcmp(szReadHeader, szDecodeChunk, 4)) { nRet = -1; break; } - fread(&nChunkSize, 1, 4, fp); - - if((buf=(UINT8*)malloc(nChunkSize))==NULL) { nRet = -1; break; } - fread(buf, 1, nChunkSize, fp); - - INT32 ret=-1; - if(nReplayStatus == 1) - { - ret = UnfreezeEncode(buf, nChunkSize); - ++nReplayUndoCount; - } - else if(nReplayStatus == 2) - { - ret = UnfreezeDecode(buf, nChunkSize); - } - if(ret) { nRet = -1; break; } - - free(buf); - buf = NULL; - - fread(szReadHeader, 1, 4, fp); - if(memcmp(szReadHeader, szInputChunk, 4)) { nRet = -1; break; } - fread(&nChunkSize, 1, 4, fp); - - if((buf=(UINT8*)malloc(nChunkSize))==NULL) { nRet = -1; break; } - fread(buf, 1, nChunkSize, fp); - if(UnfreezeInput(buf, nChunkSize)) { nRet = -1; break; } - - free(buf); - buf = NULL; - } - while(false); - - if(buf) free(buf); - } - - fclose(fp); - - if (nRet < 0) { - return -nRet; - } else { - return 0; - } -} - -// Write a savestate as a chunk of an "FB1 " file -// nOffset is the absolute offset from the beginning of the file -// -1: Append at current position -// -2: Append at EOF -INT32 BurnStateSaveEmbed(FILE* fp, INT32 nOffset, INT32 bAll) -{ - const char* szHeader = "FS1 "; // Chunk identifier - - INT32 nLen = 0; - INT32 nNvMin = 0, nAMin = 0; - INT32 nZero = 0; - char szGame[33]; - UINT8 *Def = NULL; - INT32 nDefLen = 0; // Deflated version - INT32 nRet = 0; - - if (fp == NULL) { - return -1; - } - - StateInfo(&nLen, &nNvMin, 0); // Get minimum version for NV part - nAMin = nNvMin; - if (bAll) { // Get minimum version for All data - StateInfo(&nLen, &nAMin, 1); - } - - if (nLen <= 0) { // No memory to save - return -1; - } - - if (nOffset >= 0) { - fseek(fp, nOffset, SEEK_SET); - } else { - if (nOffset == -2) { - fseek(fp, 0, SEEK_END); - } else { - fseek(fp, 0, SEEK_CUR); - } - } - - fwrite(szHeader, 1, 4, fp); // Chunk identifier - INT32 nSizeOffset = ftell(fp); // Reserve space to write the size of this chunk - fwrite(&nZero, 1, 4, fp); // - - fwrite(&nBurnVer, 1, 4, fp); // Version of FB this was saved from - fwrite(&nNvMin, 1, 4, fp); // Min version of FB NV data will work with - fwrite(&nAMin, 1, 4, fp); // Min version of FB All data will work with - - fwrite(&nZero, 1, 4, fp); // Reserve space to write the compressed data size - - memset(szGame, 0, sizeof(szGame)); // Game name - sprintf(szGame, "%.32s", BurnDrvGetTextA(DRV_NAME)); // - fwrite(szGame, 1, 32, fp); // - - nReplayCurrentFrame = GetCurrentFrame() - nStartFrame; - fwrite(&nReplayCurrentFrame, 1, 4, fp); // Current frame - - fwrite(&nZero, 1, 4, fp); // Reserved - fwrite(&nZero, 1, 4, fp); // - fwrite(&nZero, 1, 4, fp); // - - nRet = BurnStateCompress(&Def, &nDefLen, bAll); // Compress block from driver and return deflated buffer - if (Def == NULL) { - return -1; - } - - nRet = fwrite(Def, 1, nDefLen, fp); // Write block to disk - free(Def); // free deflated block and close file - - if (nRet != nDefLen) { // error writing block to disk - return -1; - } - - if (nDefLen & 3) { // Chunk size must be a multiple of 4 - fwrite(&nZero, 1, 4 - (nDefLen & 3), fp); // Pad chunk if needed - } - - fseek(fp, nSizeOffset + 0x10, SEEK_SET); // Write size of the compressed data - fwrite(&nDefLen, 1, 4, fp); // - - nDefLen = (nDefLen + 0x43) & ~3; // Add for header size and align - - fseek(fp, nSizeOffset, SEEK_SET); // Write size of the chunk - fwrite(&nDefLen, 1, 4, fp); // - - fseek (fp, 0, SEEK_END); // Set file pointer to the end of the chunk - - return nDefLen; -} - -#ifdef BUILD_WIN32 -INT32 FileExists(const TCHAR *fileName) -{ - DWORD dwAttrib = GetFileAttributes(fileName); - return (dwAttrib != INVALID_FILE_ATTRIBUTES && - !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)); -} -#endif - -#define MAX_STATEBACKUPS 10 -// SaveState Undo - restores the last savestate backup file. Windows-only at the moment. -INT32 BurnStateUNDO(TCHAR* szName) -{ -#ifdef BUILD_WIN32 - /* - Savestate Undo - derp.fs.backup0 -> derp.fs - derp.fs.backup1 -> derp.fs.backup0 - derp.fs.backup2 -> derpfs.backup1 - derp.fs.backup3 -> derpfs.backup2 - */ - INT32 cantundo = 0; - - for (INT32 i = 0; i <= MAX_STATEBACKUPS; i++) { - TCHAR szBackupNameTo[1024] = _T(""); - TCHAR szBackupNameFrom[1024] = _T(""); - TCHAR szBackupNamePrev[1024] = _T(""); - - if (i == 0) { - _stprintf(szBackupNameTo, _T("%s.UNDO"), szName);// game.fs -> game.fs.UNDO - _stprintf(szBackupNamePrev, _T("%s.backup0"), szName); - if (FileExists(szName) && FileExists(szBackupNamePrev)) { - DeleteFileW(szBackupNameTo); - MoveFileW(szName, szBackupNameTo); - } else { - cantundo = 1; - } - - _stprintf(szBackupNameTo, _T("%s"), szName);// game.fs - } else { - _stprintf(szBackupNameTo, _T("%s.backup%d"), szName, i - 1); //game.fs.backup0 - } - _stprintf(szBackupNameFrom, _T("%s.backup%d"), szName, i); //game.fs.backup1 - //bprintf(0, _T("%d: %s -> %s\n"), i, szBackupNameFrom, szBackupNameTo); - MoveFileW(szBackupNameFrom, szBackupNameTo); - } - return cantundo; -#else - return 0; -#endif - -} - -// State save -INT32 BurnStateSave(TCHAR* szName, INT32 bAll) -{ - const char szHeader[] = "FB1 "; // File identifier - INT32 nLen = 0, nVer = 0; - INT32 nRet = 0; - - if (bAll) { // Get amount of data - StateInfo(&nLen, &nVer, 1); - } else { - StateInfo(&nLen, &nVer, 0); - } - if (nLen <= 0) { // No data, so exit without creating a savestate - return 0; // Don't return an error code - } - -#ifdef BUILD_WIN32 - /* - Save State backups - used in conjunction with BurnStateUNDO(); - derp.fs -> derp.fs.backup - derp.fs.backup -> derp.fs.backup1 - derp.fs.backup1 -> derpfs.backup2 - derp.fs.backup3 -> derpfs.backup4 - */ - if (_tcsstr(szName, _T(" slot "))) { - for (INT32 i=MAX_STATEBACKUPS;i>=0;i--) { - TCHAR szBackupNameTo[1024] = _T(""); - TCHAR szBackupNameFrom[1024] = _T(""); - - _stprintf(szBackupNameTo, _T("%s.backup%d"), szName, i + 1); - _stprintf(szBackupNameFrom, _T("%s.backup%d"), szName, i); - if (i == MAX_STATEBACKUPS) { - DeleteFileW(szBackupNameFrom); // make sure there is only MAX_STATEBACKUPS :) - } else { - MoveFileW(szBackupNameFrom, szBackupNameTo); //derp.fs.backup0 -> derp.fs.backup1 - if (i == 0) { - MoveFileW(szName, szBackupNameFrom); //derp.fs -> derp.fs.backup0 - } - } - } - } -#endif - - FILE* fp = _tfopen(szName, _T("wb")); - if (fp == NULL) { - return 1; - } - - fwrite(&szHeader, 1, 4, fp); - nRet = BurnStateSaveEmbed(fp, -1, bAll); - - // save movie extra info - if(nReplayStatus) - { - UINT8* huff_buf = NULL; - INT32 huff_size; - UINT8* input_buf = NULL; - INT32 input_size; - INT32 ret=-1; - - if(nReplayStatus == 1) - { - ret = FreezeEncode(&huff_buf, &huff_size); - } - else if(nReplayStatus == 2) - { - ret = FreezeDecode(&huff_buf, &huff_size); - } - - if(!ret && - !FreezeInput(&input_buf, &input_size)) - { - const char szMovieExtra[] = "MOV "; - const char szDecodeChunk[] = "HUFF"; - const char szInputChunk[] = "INP "; - - INT32 nZero = 0; - INT32 nAlign = 0; - INT32 nChkLen = 0; - INT32 nMovChunkLen = 0; - - fwrite(szMovieExtra, 1, 4, fp); - INT32 nSizeOffset = ftell(fp); - fwrite(&nZero, 1, 4, fp); // Leave room for the chunk size - nMovChunkLen = 0; - - // write Decode block - nAlign = (huff_size&3) ? (4 - (huff_size&3)) : 0; - nChkLen = huff_size + nAlign; - - fwrite(szDecodeChunk, 1, 4, fp); - fwrite(&nChkLen, 1, 4, fp); - fwrite(huff_buf, 1, huff_size, fp); - if(nAlign) - { - fwrite(&nZero, 1, nAlign, fp); - } - nMovChunkLen += nChkLen + 8; - - // write Input block - nAlign = (input_size&3) ? (4 - (input_size&3)) : 0; - nChkLen = input_size + nAlign; - - fwrite(szInputChunk, 1, 4, fp); - fwrite(&nChkLen, 1, 4, fp); - fwrite(input_buf, 1, input_size, fp); - if(nAlign) - { - fwrite(&nZero, 1, nAlign, fp); - } - nMovChunkLen += nChkLen + 8; - - fseek(fp, nSizeOffset, SEEK_SET); - fwrite(&nMovChunkLen, 1, 4, fp); - fseek(fp, nMovChunkLen, SEEK_CUR); - } - - if(huff_buf) free(huff_buf); - if(input_buf) free(input_buf); - } - - fclose(fp); - - if (nRet < 0) { - return 1; - } else { - return 0; - } -} diff --git a/jan/src/burner/statec.cpp b/jan/src/burner/statec.cpp deleted file mode 100644 index 48c6c5264..000000000 --- a/jan/src/burner/statec.cpp +++ /dev/null @@ -1,171 +0,0 @@ -// Driver State Compression module -#include "zlib.h" - -#include "burnint.h" - -static UINT8* Comp = NULL; // Compressed data buffer -static INT32 nCompLen = 0; -static INT32 nCompFill = 0; // How much of the buffer has been filled so far - -static z_stream Zstr; // Deflate stream - -// ----------------------------------------------------------------------------- -// Compression - -static INT32 CompEnlarge(INT32 nAdd) -{ - void* NewMem = NULL; - - // Need to make more room in the compressed buffer - NewMem = realloc(Comp, nCompLen + nAdd); - if (NewMem == NULL) { - return 1; - } - - Comp = (UINT8*)NewMem; - memset(Comp + nCompLen, 0, nAdd); - nCompLen += nAdd; - - return 0; -} - -static INT32 CompGo(INT32 bFinish) -{ - INT32 nResult = 0; - INT32 nAvailOut = 0; - - bool bRetry, bOverflow; - - do { - - bRetry = false; - - // Point to the remainder of out buffer - Zstr.next_out = Comp + nCompFill; - nAvailOut = nCompLen - nCompFill; - if (nAvailOut < 0) { - nAvailOut = 0; - } - Zstr.avail_out = nAvailOut; - - // Try to deflate into the buffer (there may not be enough room though) - if (bFinish) { - nResult = deflate(&Zstr, Z_FINISH); // deflate and finish - if (nResult != Z_OK && nResult != Z_STREAM_END) { - return 1; - } - } else { - nResult = deflate(&Zstr, 0); // deflate - if (nResult != Z_OK) { - return 1; - } - } - - nCompFill = Zstr.next_out - Comp; // Update how much has been filled - - // Check for overflow - bOverflow = bFinish ? (nResult == Z_OK) : (Zstr.avail_out <= 0); - - if (bOverflow) { - if (CompEnlarge(4 * 1024)) { - return 1; - } - - bRetry = true; - } - } while (bRetry); - - return 0; -} - -static INT32 __cdecl StateCompressAcb(struct BurnArea* pba) -{ - // Set the data as the next available input - Zstr.next_in = (UINT8*)pba->Data; - Zstr.avail_in = pba->nLen; - - CompGo(0); // Compress this Area - - Zstr.avail_in = 0; - Zstr.next_in = NULL; - - return 0; -} - -// Compress a state using deflate -INT32 BurnStateCompress(UINT8** pDef, INT32* pnDefLen, INT32 bAll) -{ - void* NewMem = NULL; - - memset(&Zstr, 0, sizeof(Zstr)); - - Comp = NULL; nCompLen = 0; nCompFill = 0; // Begin with a zero-length buffer - if (CompEnlarge(8 * 1024)) { - return 1; - } - - deflateInit(&Zstr, Z_DEFAULT_COMPRESSION); - - BurnAcb = StateCompressAcb; // callback our function with each area - - if (bAll) BurnAreaScan(ACB_FULLSCAN | ACB_READ, NULL); // scan all ram, read (from driver <- decompress) - else BurnAreaScan(ACB_NVRAM | ACB_READ, NULL); // scan nvram, read (from driver <- decompress) - - // Finish off - CompGo(1); - - deflateEnd(&Zstr); - - // Size down - NewMem = realloc(Comp, nCompFill); - if (NewMem) { - Comp = (UINT8*)NewMem; - nCompLen = nCompFill; - } - - // Return the buffer - if (pDef) { - *pDef = Comp; - } - if (pnDefLen) { - *pnDefLen = nCompFill; - } - - return 0; -} - -// ----------------------------------------------------------------------------- -// Decompression - -static INT32 __cdecl StateDecompressAcb(struct BurnArea* pba) -{ - Zstr.next_out =(UINT8*)pba->Data; - Zstr.avail_out = pba->nLen; - - inflate(&Zstr, Z_SYNC_FLUSH); - - Zstr.avail_out = 0; - Zstr.next_out = NULL; - - return 0; -} - -INT32 BurnStateDecompress(UINT8* Def, INT32 nDefLen, INT32 bAll) -{ - memset(&Zstr, 0, sizeof(Zstr)); - inflateInit(&Zstr); - - // Set all of the buffer as available input - Zstr.next_in = (UINT8*)Def; - Zstr.avail_in = nDefLen; - - BurnAcb = StateDecompressAcb; // callback our function with each area - - if (bAll) BurnAreaScan(ACB_FULLSCAN | ACB_WRITE, NULL); // scan all ram, write (to driver <- decompress) - else BurnAreaScan(ACB_NVRAM | ACB_WRITE, NULL); // scan nvram, write (to driver <- decompress) - - inflateEnd(&Zstr); - memset(&Zstr, 0, sizeof(Zstr)); - - return 0; -} diff --git a/jan/src/burner/title.h b/jan/src/burner/title.h deleted file mode 100644 index 541263d1c..000000000 --- a/jan/src/burner/title.h +++ /dev/null @@ -1,9 +0,0 @@ -// Define macros for appliction title and description -#ifdef FBA_DEBUG - #define APP_TITLE "FB Alpha [DEBUG]" -#else - #define APP_TITLE "FB Alpha" -#endif - -#define APP_DESCRIPTION "Emulator for arcade games" - diff --git a/jan/src/burner/un7z.cpp b/jan/src/burner/un7z.cpp deleted file mode 100644 index 44515129c..000000000 --- a/jan/src/burner/un7z.cpp +++ /dev/null @@ -1,522 +0,0 @@ -/*************************************************************************** - - un7z.c - - Functions to manipulate data within 7z files. - -**************************************************************************** - - Copyright Aaron Giles - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name 'MAME' nor the names of its contributors may be - used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -***************************************************************************/ - -// this is based on unzip.c, with modifications needed to use the 7zip library - -/*************************************************************************** - Above notices are from MAME - - Updated Feb 2012 - Adapted for use outside MAME by Barry Harris (FB Alpha) -***************************************************************************/ - -#include "un7z.h" - -#include -#include -#include "zlib.h" - -/*************************************************************************** - 7Zip Memory / File handling (adapted from 7zfile.c/.h and 7zalloc.c/.h) -***************************************************************************/ - -void *SZipAlloc(void *, size_t size) -{ - if (size == 0) - return 0; - - return malloc(size); -} - -void SZipFree(void *, void *address) -{ - free(address); -} - - - -void File_Construct(CSzFile *p) -{ - p->_7z_osdfile = NULL; -} - -static WRes File_Open(CSzFile *p, const char *, int) -{ - /* we handle this ourselves ... */ - if (!p->_7z_osdfile) return 1; - else return 0; -} - -WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); } -WRes OutFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 1); } - - -WRes File_Close(CSzFile *) -{ - /* we handle this ourselves ... */ - return 0; -} - -WRes File_Read(CSzFile *p, void *data, size_t *size) -{ - UINT32 read_length; - - if (!p->_7z_osdfile) - { - printf("un7z.c: called File_Read without file\n"); - return 1; - } - - size_t originalSize = *size; - if (originalSize == 0) - return 0; - - fseek(p->_7z_osdfile, p->_7z_currfpos, SEEK_SET); - *size = read_length = fread(data, 1, originalSize, p->_7z_osdfile); - p->_7z_currfpos += read_length; - - if (*size == originalSize) - return 0; - - return 0; -} - -WRes File_Write(CSzFile *, const void *, size_t *) -{ - return 0; -} - -WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin) -{ - if (origin==0) p->_7z_currfpos = *pos; - if (origin==1) p->_7z_currfpos = p->_7z_currfpos + *pos; - if (origin==2) p->_7z_currfpos = p->_7z_length - *pos; - - *pos = p->_7z_currfpos; - - return 0; -} - -WRes File_GetLength(CSzFile *p, UInt64 *length) -{ - *length = p->_7z_length; - return 0; -} - -/* ---------- FileSeqInStream ---------- */ - -static SRes FileSeqInStream_Read(void *pp, void *buf, size_t *size) -{ - CFileSeqInStream *p = (CFileSeqInStream *)pp; - return File_Read(&p->file, buf, size) == 0 ? SZ_OK : SZ_ERROR_READ; -} - -void FileSeqInStream_CreateVTable(CFileSeqInStream *p) -{ - p->s.Read = FileSeqInStream_Read; -} - - -/* ---------- FileInStream ---------- */ - -static SRes FileInStream_Read(void *pp, void *buf, size_t *size) -{ - CFileInStream *p = (CFileInStream *)pp; - return (File_Read(&p->file, buf, size) == 0) ? SZ_OK : SZ_ERROR_READ; -} - -static SRes FileInStream_Seek(void *pp, Int64 *pos, ESzSeek origin) -{ - CFileInStream *p = (CFileInStream *)pp; - return File_Seek(&p->file, pos, origin); -} - -void FileInStream_CreateVTable(CFileInStream *p) -{ - p->s.Read = FileInStream_Read; - p->s.Seek = FileInStream_Seek; -} - -/* ---------- FileOutStream ---------- */ - -static size_t FileOutStream_Write(void *, const void *, size_t size) -{ -// CFileOutStream *p = (CFileOutStream *)pp; -// File_Write(&p->file, data, &size); - return size; -} - -void FileOutStream_CreateVTable(CFileOutStream *p) -{ - p->s.Write = FileOutStream_Write; -} - -/*************************************************************************** - CONSTANTS -***************************************************************************/ - -/* number of open files to cache */ -#define _7Z_CACHE_SIZE 8 - - -/*************************************************************************** - GLOBAL VARIABLES -***************************************************************************/ - -static _7z_file *_7z_cache[_7Z_CACHE_SIZE]; - -/*************************************************************************** - FUNCTION PROTOTYPES -***************************************************************************/ - -/* cache management */ -static void free__7z_file(_7z_file *_7z); - - -/*************************************************************************** - _7Z FILE ACCESS -***************************************************************************/ - -/*------------------------------------------------- - _7z_file_open - opens a _7Z file for reading --------------------------------------------------*/ - -int _7z_search_crc_match(_7z_file *new_7z, UINT32 search_crc, const char* search_filename, int search_filename_length, bool matchcrc, bool matchname) -{ - UInt16 *temp = NULL; - size_t tempSize = 0; - - for (unsigned int i = 0; i < new_7z->db.NumFiles; i++) - { - size_t len; - - len = SzArEx_GetFileNameUtf16(&new_7z->db, i, NULL); - - // if it's a directory entry we don't care about it.. - if (SzArEx_IsDir(&new_7z->db, i)) continue; - - if (len > tempSize) - { - SZipFree(NULL, temp); - tempSize = len; - temp = (UInt16 *)SZipAlloc(NULL, tempSize * sizeof(temp[0])); - if (temp == 0) - { - return -1; // memory error - } - } - - bool crcmatch = false; - bool namematch = false; - - UINT64 size = SzArEx_GetFileSize(&new_7z->db, i); - UINT32 crc = new_7z->db.CRCs.Vals[i]; - - /* Check for a name match */ - SzArEx_GetFileNameUtf16(&new_7z->db, i, temp); - - if (len == (unsigned int)search_filename_length+1) - { - int j; - for (j=0;j=0x41) && (zn<=0x5a)) zn+=0x20; - - if (sn != zn) break; - } - if (j==search_filename_length) namematch = true; - } - - - /* Check for a CRC match */ - if (crc==search_crc) crcmatch = true; - - bool found = false; - - if (matchcrc && matchname) - { - if (crcmatch && namematch) - found = true; - } - else if (matchcrc) - { - if (crcmatch) - found = true; - } - else if (matchname) - { - if (namematch) - found = true; - } - - if (found) - { - // printf("found %S %d %08x %08x %08x %s %d\n", temp, len, crc, search_crc, size, search_filename, search_filename_length); - new_7z->curr_file_idx = i; - new_7z->uncompressed_length = size; - new_7z->crc = crc; - - SZipFree(NULL, temp); - return i; - } - } - - SZipFree(NULL, temp); - return -1; -} - - -_7z_error _7z_file_open(const char *filename, _7z_file **_7z) -{ - _7z_error _7zerr = _7ZERR_NONE; - - - _7z_file *new_7z; - char *string; - unsigned int cachenum; - - SRes res; - - /* ensure we start with a NULL result */ - *_7z = NULL; - - /* see if we are in the cache, and reopen if so */ - for (cachenum = 0; cachenum < ARRAY_LENGTH(_7z_cache); cachenum++) - { - _7z_file *cached = _7z_cache[cachenum]; - - /* if we have a valid entry and it matches our filename, use it and remove from the cache */ - if (cached != NULL && cached->filename != NULL && strcmp(filename, cached->filename) == 0) - { - *_7z = cached; - _7z_cache[cachenum] = NULL; - return _7ZERR_NONE; - } - } - - /* allocate memory for the _7z_file structure */ - new_7z = (_7z_file *)malloc(sizeof(*new_7z)); - if (new_7z == NULL) - return _7ZERR_OUT_OF_MEMORY; - memset(new_7z, 0, sizeof(*new_7z)); - - new_7z->inited = false; - new_7z->archiveStream.file._7z_currfpos = 0; - - new_7z->archiveStream.file._7z_osdfile = fopen(filename, "rb"); - if (!new_7z->archiveStream.file._7z_osdfile) { - _7zerr = _7ZERR_FILE_ERROR; - goto error; - } - - fseek(new_7z->archiveStream.file._7z_osdfile, 0, SEEK_END); - new_7z->archiveStream.file._7z_length = ftell(new_7z->archiveStream.file._7z_osdfile); - fseek(new_7z->archiveStream.file._7z_osdfile, 0, SEEK_SET); - - new_7z->allocImp.Alloc = SZipAlloc; - new_7z->allocImp.Free = SZipFree; - - new_7z->allocTempImp.Alloc = SZipAlloc; - new_7z->allocTempImp.Free = SZipFree; - - if (InFile_Open(&new_7z->archiveStream.file, filename)) - { - _7zerr = _7ZERR_FILE_ERROR; - goto error; - } - - FileInStream_CreateVTable(&new_7z->archiveStream); - LookToRead_CreateVTable(&new_7z->lookStream, False); - - new_7z->lookStream.realStream = &new_7z->archiveStream.s; - LookToRead_Init(&new_7z->lookStream); - - CrcGenerateTable(); - - SzArEx_Init(&new_7z->db); - new_7z->inited = true; - - res = SzArEx_Open(&new_7z->db, &new_7z->lookStream.s, &new_7z->allocImp, &new_7z->allocTempImp); - if (res != SZ_OK) - { - _7zerr = _7ZERR_FILE_ERROR; - goto error; - } - - new_7z->blockIndex = 0xFFFFFFFF; /* it can have any value before first call (if outBuffer = 0) */ - new_7z->outBuffer = 0; /* it must be 0 before first call for each new archive. */ - new_7z->outBufferSize = 0; /* it can have any value before first call (if outBuffer = 0) */ - - /* make a copy of the filename for caching purposes */ - string = (char *)malloc(strlen(filename) + 1); - if (string == NULL) - { - _7zerr = _7ZERR_OUT_OF_MEMORY; - goto error; - } - strcpy(string, filename); - new_7z->filename = string; - *_7z = new_7z; - return _7ZERR_NONE; - -error: - free__7z_file(new_7z); - return _7zerr; -} - - -/*------------------------------------------------- - _7z_file_close - close a _7Z file and add it - to the cache --------------------------------------------------*/ - -void _7z_file_close(_7z_file *_7z) -{ - unsigned int cachenum; - - /* close the open files */ - if (_7z->archiveStream.file._7z_osdfile != NULL) - fclose(_7z->archiveStream.file._7z_osdfile); - _7z->archiveStream.file._7z_osdfile = NULL; - - /* find the first NULL entry in the cache */ - for (cachenum = 0; cachenum < ARRAY_LENGTH(_7z_cache); cachenum++) - if (_7z_cache[cachenum] == NULL) - break; - - /* if no room left in the cache, free the bottommost entry */ - if (cachenum == ARRAY_LENGTH(_7z_cache)) - free__7z_file(_7z_cache[--cachenum]); - - /* move everyone else down and place us at the top */ - if (cachenum != 0) - memmove(&_7z_cache[1], &_7z_cache[0], cachenum * sizeof(_7z_cache[0])); - _7z_cache[0] = _7z; -} - - -/*------------------------------------------------- - _7z_file_cache_clear - clear the _7Z file - cache and free all memory --------------------------------------------------*/ - -void _7z_file_cache_clear(void) -{ - unsigned int cachenum; - - /* clear call cache entries */ - for (cachenum = 0; cachenum < ARRAY_LENGTH(_7z_cache); cachenum++) - if (_7z_cache[cachenum] != NULL) - { - free__7z_file(_7z_cache[cachenum]); - _7z_cache[cachenum] = NULL; - } -} - - -/*------------------------------------------------- - _7z_file_decompress - decompress a file - from a _7Z into the target buffer --------------------------------------------------*/ - -_7z_error _7z_file_decompress(_7z_file *new_7z, void *buffer, UINT32 length, UINT32 *Processed) -{ - SRes res; - int index = new_7z->curr_file_idx; - - /* make sure the file is open.. */ - if (new_7z->archiveStream.file._7z_osdfile==NULL) - { - new_7z->archiveStream.file._7z_currfpos = 0; - new_7z->archiveStream.file._7z_osdfile = fopen(new_7z->filename, "rb"); - if (!new_7z->archiveStream.file._7z_osdfile) { - return _7ZERR_FILE_ERROR; - } - } - - size_t offset = 0; - size_t outSizeProcessed = 0; - - res = SzArEx_Extract(&new_7z->db, &new_7z->lookStream.s, index, - &new_7z->blockIndex, &new_7z->outBuffer, &new_7z->outBufferSize, - &offset, &outSizeProcessed, - &new_7z->allocImp, &new_7z->allocTempImp); - - if (res != SZ_OK) - return _7ZERR_FILE_ERROR; - - *Processed = outSizeProcessed; - - memcpy(buffer, new_7z->outBuffer + offset, length); - - return _7ZERR_NONE; -} - - - -/*************************************************************************** - CACHE MANAGEMENT -***************************************************************************/ - -/*------------------------------------------------- - free__7z_file - free all the data for a - _7z_file --------------------------------------------------*/ - -static void free__7z_file(_7z_file *_7z) -{ - if (_7z != NULL) - { - if (_7z->archiveStream.file._7z_osdfile != NULL) - fclose(_7z->archiveStream.file._7z_osdfile); - if (_7z->filename != NULL) - free((void *)_7z->filename); - - - if (_7z->outBuffer) IAlloc_Free(&_7z->allocImp, _7z->outBuffer); - if (_7z->inited) SzArEx_Free(&_7z->db, &_7z->allocImp); - - - free(_7z); - } -} diff --git a/jan/src/burner/un7z.h b/jan/src/burner/un7z.h deleted file mode 100644 index 72cad0494..000000000 --- a/jan/src/burner/un7z.h +++ /dev/null @@ -1,183 +0,0 @@ -/*************************************************************************** - - un7z.h - - 7z file management. - -**************************************************************************** - - Copyright Aaron Giles - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name 'MAME' nor the names of its contributors may be - used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -***************************************************************************/ - -// this is based on unzip.h, with modifications needed to use the 7zip library - -/*************************************************************************** - Above notices are from MAME - - Updated Feb 2012 - Adapted for use outside MAME by Barry Harris (FB Alpha) -***************************************************************************/ - -#pragma once - -#ifndef __UN_7Z_H__ -#define __UN_7Z_H__ - -#include "driver.h" - -#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0])) - -#include "7z.h" -#include "7zCrc.h" -#include "7zVersion.h" - - -void *SZipAlloc(void *p, size_t size); -void SZipFree(void *p, void *address); -void *SZipAllocTemp(void *p, size_t size); -void SZipFreeTemp(void *p, void *address); - -typedef struct -{ - long _7z_currfpos; - UINT64 _7z_length; - FILE * _7z_osdfile; /* OSD file handle */ - -} CSzFile; - - -typedef struct -{ - ISeqInStream s; - CSzFile file; -} CFileSeqInStream; - -void FileSeqInStream_CreateVTable(CFileSeqInStream *p); - - -typedef struct -{ - ISeekInStream s; - CSzFile file; -} CFileInStream; - -void FileInStream_CreateVTable(CFileInStream *p); - - -typedef struct -{ - ISeqOutStream s; - CSzFile file; -} CFileOutStream; - -void FileOutStream_CreateVTable(CFileOutStream *p); - - - -/*************************************************************************** - CONSTANTS -***************************************************************************/ - - -/* Error types */ -enum __7z_error -{ - _7ZERR_NONE = 0, - _7ZERR_OUT_OF_MEMORY, - _7ZERR_FILE_ERROR, - _7ZERR_BAD_SIGNATURE, - _7ZERR_DECOMPRESS_ERROR, - _7ZERR_FILE_TRUNCATED, - _7ZERR_FILE_CORRUPT, - _7ZERR_UNSUPPORTED, - _7ZERR_BUFFER_TOO_SMALL -}; -typedef enum __7z_error _7z_error; - - - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -/* describes an open _7Z file */ -typedef struct __7z_file _7z_file; -struct __7z_file -{ - const char * filename; /* copy of _7Z filename (for caching) */ - - int curr_file_idx; /* current file index */ - UINT64 uncompressed_length; /* current file uncompressed length */ - UINT64 crc; /* current file crc */ - - CFileInStream archiveStream; - CLookToRead lookStream; - CSzArEx db; - SRes res; - ISzAlloc allocImp; - ISzAlloc allocTempImp; - bool inited; - - // cached stuff for solid blocks - UInt32 blockIndex;// = 0xFFFFFFFF; /* it can have any value before first call (if outBuffer = 0) */ - Byte *outBuffer;// = 0; /* it must be 0 before first call for each new archive. */ - size_t outBufferSize;// = 0; /* it can have any value before first call (if outBuffer = 0) */ -}; - - - -/*************************************************************************** - FUNCTION PROTOTYPES -***************************************************************************/ - - -/* ----- _7Z file access ----- */ - -/* open a _7Z file and parse its central directory */ -_7z_error _7z_file_open(const char *filename, _7z_file **_7z); - -/* close a _7Z file (may actually be left open due to caching) */ -void _7z_file_close(_7z_file *_7z); - -/* clear out all open _7Z files from the cache */ -void _7z_file_cache_clear(void); - - -/* ----- contained file access ----- */ - -/* find a file index by crc, filename or both */ -int _7z_search_crc_match(_7z_file *new_7z, UINT32 crc, const char *search_filename, int search_filename_length, bool matchcrc, bool matchname); - -/* decompress the most recently found file in the _7Z */ -_7z_error _7z_file_decompress(_7z_file *new_7z, void *buffer, UINT32 length, UINT32 *Processed); - - -#endif /* __UN_7Z_H__ */ diff --git a/jan/src/burner/unzip.c b/jan/src/burner/unzip.c deleted file mode 100644 index 7617f41f1..000000000 --- a/jan/src/burner/unzip.c +++ /dev/null @@ -1,2125 +0,0 @@ -/* unzip.c -- IO for uncompress .zip files using zlib - Version 1.1, February 14h, 2010 - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications of Unzip for Zip64 - Copyright (C) 2007-2008 Even Rouault - - Modifications for Zip64 support on both zip and unzip - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - - ------------------------------------------------------------------------------------ - Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of - compatibility with older software. The following is from the original crypt.c. - Code woven in by Terry Thorsen 1/2003. - - Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html - - crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - - ------------------------------------------------------------------------------------ - - Changes in unzip.c - - 2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos - 2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz* - 2007-2008 - Even Rouault - Remove old C style function prototypes - 2007-2008 - Even Rouault - Add unzip support for ZIP64 - - Copyright (C) 2007-2008 Even Rouault - - - Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again). - Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G - should only read the compressed/uncompressed size from the Zip64 format if - the size from normal header was 0xFFFFFFFF - Oct-2009 - Mathias Svensson - Applied some bug fixes from paches recived from Gilles Vollant - Oct-2009 - Mathias Svensson - Applied support to unzip files with compression mathod BZIP2 (bzip2 lib is required) - Patch created by Daniel Borca - - Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer - - Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson - -*/ - - -#include -#include -#include - -#ifndef NOUNCRYPT - #define NOUNCRYPT -#endif - -#include "zlib.h" -#include "unzip.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - - -#ifndef CASESENSITIVITYDEFAULT_NO -# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) -# define CASESENSITIVITYDEFAULT_NO -# endif -#endif - - -#ifndef UNZ_BUFSIZE -#define UNZ_BUFSIZE (16384) -#endif - -#ifndef UNZ_MAXFILENAMEINZIP -#define UNZ_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) - - -const char unz_copyright[] = - " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; - -/* unz_file_info_interntal contain internal info about a file in zipfile*/ -typedef struct unz_file_info64_internal_s -{ - ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */ -} unz_file_info64_internal; - - -/* file_in_zip_read_info_s contain internal information about a file in zipfile, - when reading and decompress it */ -typedef struct -{ - char *read_buffer; /* internal buffer for compressed data */ - z_stream stream; /* zLib stream structure for inflate */ - -#ifdef HAVE_BZIP2 - bz_stream bstream; /* bzLib stream structure for bziped */ -#endif - - ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ - uLong stream_initialised; /* flag set if stream structure is initialised*/ - - ZPOS64_T offset_local_extrafield;/* offset of the local extra field */ - uInt size_local_extrafield;/* size of the local extra field */ - ZPOS64_T pos_local_extrafield; /* position in the local extra field in read*/ - ZPOS64_T total_out_64; - - uLong crc32; /* crc32 of all data uncompressed */ - uLong crc32_wait; /* crc32 we must obtain after decompress all */ - ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */ - ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/ - zlib_filefunc64_32_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - uLong compression_method; /* compression method (0==store) */ - ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - int raw; -} file_in_zip64_read_info_s; - - -/* unz64_s contain internal information about the zipfile -*/ -typedef struct -{ - zlib_filefunc64_32_def z_filefunc; - int is64bitOpenFunction; - voidpf filestream; /* io structore of the zipfile */ - unz_global_info64 gi; /* public global information */ - ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - ZPOS64_T num_file; /* number of the current file in the zipfile*/ - ZPOS64_T pos_in_central_dir; /* pos of the current file in the central dir*/ - ZPOS64_T current_file_ok; /* flag about the usability of the current file*/ - ZPOS64_T central_pos; /* position of the beginning of the central dir*/ - - ZPOS64_T size_central_dir; /* size of the central directory */ - ZPOS64_T offset_central_dir; /* offset of start of central directory with - respect to the starting disk number */ - - unz_file_info64 cur_file_info; /* public info about the current file in zip*/ - unz_file_info64_internal cur_file_info_internal; /* private info about it*/ - file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current - file if we are decompressing it */ - int encrypted; - - int isZip64; - -# ifndef NOUNCRYPT - unsigned long keys[3]; /* keys defining the pseudo-random sequence */ - const unsigned long* pcrc_32_tab; -# endif -} unz64_s; - - -#ifndef NOUNCRYPT -#include "crypt.h" -#endif - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been sucessfully opened for reading. -*/ - - -local int unz64local_getByte OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi) -{ - unsigned char c; - int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return UNZ_OK; - } - else - { - if (ZERROR64(*pzlib_filefunc_def,filestream)) - return UNZ_ERRNO; - else - return UNZ_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int unz64local_getShort OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX) -{ - uLong x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<8; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unz64local_getLong OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX) -{ - uLong x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<8; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<16; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unz64local_getLong64 OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - ZPOS64_T *pX)); - - -local int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - ZPOS64_T *pX) -{ - ZPOS64_T x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (ZPOS64_T)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<8; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<16; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<24; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<32; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<40; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<48; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<56; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -/* My own strcmpi / strcasecmp */ -local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2) -{ - for (;;) - { - char c1=*(fileName1++); - char c2=*(fileName2++); - if ((c1>='a') && (c1<='z')) - c1 -= 0x20; - if ((c2>='a') && (c2<='z')) - c2 -= 0x20; - if (c1=='\0') - return ((c2=='\0') ? 0 : -1); - if (c2=='\0') - return 1; - if (c1c2) - return 1; - } -} - - -#ifdef CASESENSITIVITYDEFAULT_NO -#define CASESENSITIVITYDEFAULTVALUE 2 -#else -#define CASESENSITIVITYDEFAULTVALUE 1 -#endif - -#ifndef STRCMPCASENOSENTIVEFUNCTION -#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal -#endif - -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) - -*/ -extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, - const char* fileName2, - int iCaseSensitivity) - -{ - if (iCaseSensitivity==0) - iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; - - if (iCaseSensitivity==1) - return strcmp(fileName1,fileName2); - - return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); -} - -#ifndef BUFREADCOMMENT -#define BUFREADCOMMENT (0x400) -#endif - -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); -local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) -{ - unsigned char* buf; - ZPOS64_T uSizeFile; - ZPOS64_T uBackRead; - ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ - ZPOS64_T uPosFound=0; - - if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); - if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} - - -/* - Locate the Central directory 64 of a zipfile (at the end, just before - the global comment) -*/ -local ZPOS64_T unz64local_SearchCentralDir64 OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream)); - -local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream) -{ - unsigned char* buf; - ZPOS64_T uSizeFile; - ZPOS64_T uBackRead; - ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ - ZPOS64_T uPosFound=0; - uLong uL; - ZPOS64_T relativeOffset; - - if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); - if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - if (uPosFound == 0) - return 0; - - /* Zip64 end of central directory locator */ - if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) - return 0; - - /* the signature, already checked */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - - /* number of the disk with the start of the zip64 end of central directory */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - if (uL != 0) - return 0; - - /* relative offset of the zip64 end of central directory record */ - if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK) - return 0; - - /* total number of disks */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - if (uL != 1) - return 0; - - /* Goto end of central directory record */ - if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) - return 0; - - /* the signature */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - - if (uL != 0x06064b50) - return 0; - - return relativeOffset; -} - -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer - "zlib/zlib114.zip". - If the zipfile cannot be opened (file doesn't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ -local unzFile unzOpenInternal (const void *path, - zlib_filefunc64_32_def* pzlib_filefunc64_32_def, - int is64bitOpenFunction) -{ - unz64_s us; - unz64_s *s; - ZPOS64_T central_pos; - uLong uL; - - uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ - ZPOS64_T number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - - int err=UNZ_OK; - - if (unz_copyright[0]!=' ') - return NULL; - - us.z_filefunc.zseek32_file = NULL; - us.z_filefunc.ztell32_file = NULL; - if (pzlib_filefunc64_32_def==NULL) - fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); - else - us.z_filefunc = *pzlib_filefunc64_32_def; - us.is64bitOpenFunction = is64bitOpenFunction; - - - - us.filestream = ZOPEN64(us.z_filefunc, - path, - ZLIB_FILEFUNC_MODE_READ | - ZLIB_FILEFUNC_MODE_EXISTING); - if (us.filestream==NULL) - return NULL; - - central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream); - if (central_pos) - { - uLong uS; - ZPOS64_T uL64; - - us.isZip64 = 1; - - if (ZSEEK64(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* size of zip64 end of central directory record */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK) - err=UNZ_ERRNO; - - /* version made by */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) - err=UNZ_ERRNO; - - /* version needed to extract */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central directory on this disk */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central directory */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - us.gi.size_comment = 0; - } - else - { - central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream); - if (central_pos==0) - err=UNZ_ERRNO; - - us.isZip64 = 0; - - if (ZSEEK64(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - us.gi.number_entry = uL; - - /* total number of entries in the central dir */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - number_entry_CD = uL; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - us.size_central_dir = uL; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - us.offset_central_dir = uL; - - /* zipfile comment length */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) - err=UNZ_ERRNO; - } - - if ((central_pospfile_in_zip_read!=NULL) - unzCloseCurrentFile(file); - - ZCLOSE64(s->z_filefunc, s->filestream); - TRYFREE(s); - return UNZ_OK; -} - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) -{ - unz64_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - *pglobal_info=s->gi; - return UNZ_OK; -} - -extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) -{ - unz64_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - /* to do : check if number_entry is not truncated */ - pglobal_info32->number_entry = (uLong)s->gi.number_entry; - pglobal_info32->size_comment = s->gi.size_comment; - return UNZ_OK; -} -/* - Translate date/time from Dos format to tm_unz (readable more easilty) -*/ -local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) -{ - ZPOS64_T uDate; - uDate = (ZPOS64_T)(ulDosDate>>16); - ptm->tm_mday = (uInt)(uDate&0x1f) ; - ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; - ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; - - ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); - ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; - ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; -} - -/* - Get Info about the current file in the zipfile, with internal only info -*/ -local int unz64local_GetCurrentFileInfoInternal OF((unzFile file, - unz_file_info64 *pfile_info, - unz_file_info64_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -local int unz64local_GetCurrentFileInfoInternal (unzFile file, - unz_file_info64 *pfile_info, - unz_file_info64_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize) -{ - unz64_s* s; - unz_file_info64 file_info; - unz_file_info64_internal file_info_internal; - int err=UNZ_OK; - uLong uMagic; - long lSeek=0; - uLong uL; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (ZSEEK64(s->z_filefunc, s->filestream, - s->pos_in_central_dir+s->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - - /* we check the magic */ - if (err==UNZ_OK) - { - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x02014b50) - err=UNZ_BADZIPFILE; - } - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) - err=UNZ_ERRNO; - - unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - file_info.compressed_size = uL; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - file_info.uncompressed_size = uL; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) - err=UNZ_ERRNO; - - // relative offset of local header - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - file_info_internal.offset_curfile = uL; - - lSeek+=file_info.size_filename; - if ((err==UNZ_OK) && (szFileName!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_filename0) && (fileNameBufferSize>0)) - if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek -= uSizeRead; - } - - // Read extrafield - if ((err==UNZ_OK) && (extraField!=NULL)) - { - ZPOS64_T uSizeRead ; - if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - - if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) - if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - - lSeek += file_info.size_file_extra - (uLong)uSizeRead; - } - else - lSeek += file_info.size_file_extra; - - - if ((err==UNZ_OK) && (file_info.size_file_extra != 0)) - { - uLong acc = 0; - - // since lSeek now points to after the extra field we need to move back - lSeek -= file_info.size_file_extra; - - if (lSeek!=0) - { - if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - - while(acc < file_info.size_file_extra) - { - uLong headerId; - uLong dataSize; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK) - err=UNZ_ERRNO; - - /* ZIP64 extra fields */ - if (headerId == 0x0001) - { - uLong uL; - - if(file_info.uncompressed_size == (ZPOS64_T)(unsigned long)-1) - { - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info.compressed_size == (ZPOS64_T)(unsigned long)-1) - { - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info_internal.offset_curfile == (ZPOS64_T)(unsigned long)-1) - { - /* Relative Header offset */ - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info.disk_num_start == (unsigned long)-1) - { - /* Disk Start Number */ - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - } - - } - else - { - if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0) - err=UNZ_ERRNO; - } - - acc += 2 + 2 + dataSize; - } - } - - if ((err==UNZ_OK) && (szComment!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - - if ((file_info.size_file_comment>0) && (commentBufferSize>0)) - if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek+=file_info.size_file_comment - uSizeRead; - } - else - lSeek+=file_info.size_file_comment; - - - if ((err==UNZ_OK) && (pfile_info!=NULL)) - *pfile_info=file_info; - - if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) - *pfile_info_internal=file_info_internal; - - return err; -} - - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. -*/ -extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, - unz_file_info64 * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, - char* szComment, uLong commentBufferSize) -{ - return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); -} - -extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, - unz_file_info * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, - char* szComment, uLong commentBufferSize) -{ - int err; - unz_file_info64 file_info64; - err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); - if (err==UNZ_OK) - { - pfile_info->version = file_info64.version; - pfile_info->version_needed = file_info64.version_needed; - pfile_info->flag = file_info64.flag; - pfile_info->compression_method = file_info64.compression_method; - pfile_info->dosDate = file_info64.dosDate; - pfile_info->crc = file_info64.crc; - - pfile_info->size_filename = file_info64.size_filename; - pfile_info->size_file_extra = file_info64.size_file_extra; - pfile_info->size_file_comment = file_info64.size_file_comment; - - pfile_info->disk_num_start = file_info64.disk_num_start; - pfile_info->internal_fa = file_info64.internal_fa; - pfile_info->external_fa = file_info64.external_fa; - - pfile_info->tmu_date = file_info64.tmu_date, - - - pfile_info->compressed_size = (uLong)file_info64.compressed_size; - pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size; - - } - return err; -} -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ -extern int ZEXPORT unzGoToFirstFile (unzFile file) -{ - int err=UNZ_OK; - unz64_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - s->pos_in_central_dir=s->offset_central_dir; - s->num_file=0; - err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ -extern int ZEXPORT unzGoToNextFile (unzFile file) -{ - unz64_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ - if (s->num_file+1==s->gi.number_entry) - return UNZ_END_OF_LIST_OF_FILE; - - s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + - s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; - s->num_file++; - err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - - -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzipStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ -extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) -{ - unz64_s* s; - int err; - - /* We remember the 'current' position in the file so that we can jump - * back there if we fail. - */ - unz_file_info64 cur_file_infoSaved; - unz_file_info64_internal cur_file_info_internalSaved; - ZPOS64_T num_fileSaved; - ZPOS64_T pos_in_central_dirSaved; - - - if (file==NULL) - return UNZ_PARAMERROR; - - if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) - return UNZ_PARAMERROR; - - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - /* Save the current state */ - num_fileSaved = s->num_file; - pos_in_central_dirSaved = s->pos_in_central_dir; - cur_file_infoSaved = s->cur_file_info; - cur_file_info_internalSaved = s->cur_file_info_internal; - - err = unzGoToFirstFile(file); - - while (err == UNZ_OK) - { - char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; - err = unzGetCurrentFileInfo64(file,NULL, - szCurrentFileName,sizeof(szCurrentFileName)-1, - NULL,0,NULL,0); - if (err == UNZ_OK) - { - if (unzStringFileNameCompare(szCurrentFileName, - szFileName,iCaseSensitivity)==0) - return UNZ_OK; - err = unzGoToNextFile(file); - } - } - - /* We failed, so restore the state of the 'current file' to where we - * were. - */ - s->num_file = num_fileSaved ; - s->pos_in_central_dir = pos_in_central_dirSaved ; - s->cur_file_info = cur_file_infoSaved; - s->cur_file_info_internal = cur_file_info_internalSaved; - return err; -} - - -/* -/////////////////////////////////////////// -// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) -// I need random access -// -// Further optimization could be realized by adding an ability -// to cache the directory in memory. The goal being a single -// comprehensive file read to put the file I need in a memory. -*/ - -/* -typedef struct unz_file_pos_s -{ - ZPOS64_T pos_in_zip_directory; // offset in file - ZPOS64_T num_of_file; // # of file -} unz_file_pos; -*/ - -extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) -{ - unz64_s* s; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - file_pos->pos_in_zip_directory = s->pos_in_central_dir; - file_pos->num_of_file = s->num_file; - - return UNZ_OK; -} - -extern int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos) -{ - unz64_file_pos file_pos64; - int err = unzGetFilePos64(file,&file_pos64); - if (err==UNZ_OK) - { - file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory; - file_pos->num_of_file = (uLong)file_pos64.num_of_file; - } - return err; -} - -extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) -{ - unz64_s* s; - int err; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - - /* jump to the right spot */ - s->pos_in_central_dir = file_pos->pos_in_zip_directory; - s->num_file = file_pos->num_of_file; - - /* set the current file */ - err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - /* return results */ - s->current_file_ok = (err == UNZ_OK); - return err; -} - -extern int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos) -{ - unz64_file_pos file_pos64; - if (file_pos == NULL) - return UNZ_PARAMERROR; - - file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory; - file_pos64.num_of_file = file_pos->num_of_file; - return unzGoToFilePos64(file,&file_pos64); -} - -/* -// Unzip Helper Functions - should be here? -/////////////////////////////////////////// -*/ - -/* - Read the local header of the current zipfile - Check the coherency of the local header and info in the end of central - directory about this file - store in *piSizeVar the size of extra info in local header - (filename and size of extra field data) -*/ -local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar, - ZPOS64_T * poffset_local_extrafield, - uInt * psize_local_extrafield) -{ - uLong uMagic,uData,uFlags; - uLong size_filename; - uLong size_extra_field; - int err=UNZ_OK; - - *piSizeVar = 0; - *poffset_local_extrafield = 0; - *psize_local_extrafield = 0; - - if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + - s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - - if (err==UNZ_OK) - { - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x04034b50) - err=UNZ_BADZIPFILE; - } - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; -/* - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) - err=UNZ_BADZIPFILE; -*/ - if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) - err=UNZ_BADZIPFILE; - - if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && -/* #ifdef HAVE_BZIP2 */ - (s->cur_file_info.compression_method!=Z_BZIP2ED) && -/* #endif */ - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ - err=UNZ_ERRNO; - else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ - err=UNZ_ERRNO; - else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) - err=UNZ_BADZIPFILE; - - *piSizeVar += (uInt)size_filename; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) - err=UNZ_ERRNO; - *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + - SIZEZIPLOCALHEADER + size_filename; - *psize_local_extrafield = (uInt)size_extra_field; - - *piSizeVar += (uInt)size_extra_field; - - return err; -} - -/* - Open for reading data the current file in the zipfile. - If there is no error and the file is opened, the return value is UNZ_OK. -*/ -extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, - int* level, int raw, const char* password) -{ - int err=UNZ_OK; - uInt iSizeVar; - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - ZPOS64_T offset_local_extrafield; /* offset of the local extra field */ - uInt size_local_extrafield; /* size of the local extra field */ -# ifndef NOUNCRYPT - char source[12]; -# else - if (password != NULL) - return UNZ_PARAMERROR; -# endif - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_PARAMERROR; - - if (s->pfile_in_zip_read != NULL) - unzCloseCurrentFile(file); - - if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) - return UNZ_BADZIPFILE; - - pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s)); - if (pfile_in_zip_read_info==NULL) - return UNZ_INTERNALERROR; - - pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); - pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; - pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; - pfile_in_zip_read_info->pos_local_extrafield=0; - pfile_in_zip_read_info->raw=raw; - - if (pfile_in_zip_read_info->read_buffer==NULL) - { - TRYFREE(pfile_in_zip_read_info); - return UNZ_INTERNALERROR; - } - - pfile_in_zip_read_info->stream_initialised=0; - - if (method!=NULL) - *method = (int)s->cur_file_info.compression_method; - - if (level!=NULL) - { - *level = 6; - switch (s->cur_file_info.flag & 0x06) - { - case 6 : *level = 1; break; - case 4 : *level = 2; break; - case 2 : *level = 9; break; - } - } - - if ((s->cur_file_info.compression_method!=0) && -/* #ifdef HAVE_BZIP2 */ - (s->cur_file_info.compression_method!=Z_BZIP2ED) && -/* #endif */ - (s->cur_file_info.compression_method!=Z_DEFLATED)) - - err=UNZ_BADZIPFILE; - - pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; - pfile_in_zip_read_info->crc32=0; - pfile_in_zip_read_info->total_out_64=0; - pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method; - pfile_in_zip_read_info->filestream=s->filestream; - pfile_in_zip_read_info->z_filefunc=s->z_filefunc; - pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; - - pfile_in_zip_read_info->stream.total_out = 0; - - if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw)) - { -#ifdef HAVE_BZIP2 - pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0; - pfile_in_zip_read_info->bstream.bzfree = (free_func)0; - pfile_in_zip_read_info->bstream.opaque = (voidpf)0; - pfile_in_zip_read_info->bstream.state = (voidpf)0; - - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - pfile_in_zip_read_info->stream.next_in = (voidpf)0; - pfile_in_zip_read_info->stream.avail_in = 0; - - err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED; - else - { - TRYFREE(pfile_in_zip_read_info); - return err; - } -#else - pfile_in_zip_read_info->raw=1; -#endif - } - else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw)) - { - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - pfile_in_zip_read_info->stream.next_in = 0; - pfile_in_zip_read_info->stream.avail_in = 0; - - err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=Z_DEFLATED; - else - { - TRYFREE(pfile_in_zip_read_info); - return err; - } - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. - * In unzip, i don't wait absolutely Z_STREAM_END because I known the - * size of both compressed and uncompressed data - */ - } - pfile_in_zip_read_info->rest_read_compressed = - s->cur_file_info.compressed_size ; - pfile_in_zip_read_info->rest_read_uncompressed = - s->cur_file_info.uncompressed_size ; - - - pfile_in_zip_read_info->pos_in_zipfile = - s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + - iSizeVar; - - pfile_in_zip_read_info->stream.avail_in = (uInt)0; - - s->pfile_in_zip_read = pfile_in_zip_read_info; - s->encrypted = 0; - -# ifndef NOUNCRYPT - if (password != NULL) - { - int i; - s->pcrc_32_tab = get_crc_table(); - init_keys(password,s->keys,s->pcrc_32_tab); - if (ZSEEK64(s->z_filefunc, s->filestream, - s->pfile_in_zip_read->pos_in_zipfile + - s->pfile_in_zip_read->byte_before_the_zipfile, - SEEK_SET)!=0) - return UNZ_INTERNALERROR; - if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12) - return UNZ_INTERNALERROR; - - for (i = 0; i<12; i++) - zdecode(s->keys,s->pcrc_32_tab,source[i]); - - s->pfile_in_zip_read->pos_in_zipfile+=12; - s->encrypted=1; - } -# endif - - - return UNZ_OK; -} - -extern int ZEXPORT unzOpenCurrentFile (unzFile file) -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); -} - -extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, password); -} - -extern int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) -{ - return unzOpenCurrentFile3(file, method, level, raw, NULL); -} - -/** Addition for GDAL : START */ - -extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - s=(unz64_s*)file; - if (file==NULL) - return 0; //UNZ_PARAMERROR; - pfile_in_zip_read_info=s->pfile_in_zip_read; - if (pfile_in_zip_read_info==NULL) - return 0; //UNZ_PARAMERROR; - return pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile; -} - -/** Addition for GDAL : END */ - -/* - Read bytes from the current file. - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ -extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) -{ - int err=UNZ_OK; - uInt iRead = 0; - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->read_buffer == NULL)) - return UNZ_END_OF_LIST_OF_FILE; - if (len==0) - return 0; - - pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; - - pfile_in_zip_read_info->stream.avail_out = (uInt)len; - - if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && - (!(pfile_in_zip_read_info->raw))) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_uncompressed; - - if ((len>pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in) && - (pfile_in_zip_read_info->raw)) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in; - - while (pfile_in_zip_read_info->stream.avail_out>0) - { - if ((pfile_in_zip_read_info->stream.avail_in==0) && - (pfile_in_zip_read_info->rest_read_compressed>0)) - { - uInt uReadThis = UNZ_BUFSIZE; - if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; - if (uReadThis == 0) - return UNZ_EOF; - if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - if (ZREAD64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->read_buffer, - uReadThis)!=uReadThis) - return UNZ_ERRNO; - - -# ifndef NOUNCRYPT - if(s->encrypted) - { - uInt i; - for(i=0;iread_buffer[i] = - zdecode(s->keys,s->pcrc_32_tab, - pfile_in_zip_read_info->read_buffer[i]); - } -# endif - - - pfile_in_zip_read_info->pos_in_zipfile += uReadThis; - - pfile_in_zip_read_info->rest_read_compressed-=uReadThis; - - pfile_in_zip_read_info->stream.next_in = - (Bytef*)pfile_in_zip_read_info->read_buffer; - pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; - } - - if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) - { - uInt uDoCopy,i ; - - if ((pfile_in_zip_read_info->stream.avail_in == 0) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - return (iRead==0) ? UNZ_EOF : iRead; - - if (pfile_in_zip_read_info->stream.avail_out < - pfile_in_zip_read_info->stream.avail_in) - uDoCopy = pfile_in_zip_read_info->stream.avail_out ; - else - uDoCopy = pfile_in_zip_read_info->stream.avail_in ; - - for (i=0;istream.next_out+i) = - *(pfile_in_zip_read_info->stream.next_in+i); - - pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy; - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, - pfile_in_zip_read_info->stream.next_out, - uDoCopy); - pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; - pfile_in_zip_read_info->stream.avail_in -= uDoCopy; - pfile_in_zip_read_info->stream.avail_out -= uDoCopy; - pfile_in_zip_read_info->stream.next_out += uDoCopy; - pfile_in_zip_read_info->stream.next_in += uDoCopy; - pfile_in_zip_read_info->stream.total_out += uDoCopy; - iRead += uDoCopy; - } - else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED) - { -#ifdef HAVE_BZIP2 - uLong uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - uLong uOutThis; - - pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in; - pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in; - pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in; - pfile_in_zip_read_info->bstream.total_in_hi32 = 0; - pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out; - pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out; - pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out; - pfile_in_zip_read_info->bstream.total_out_hi32 = 0; - - uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32; - bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out; - - err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream); - - uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); - pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in; - pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in; - pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32; - pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out; - pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out; - pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32; - - if (err==BZ_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=BZ_OK) - break; -#endif - } // end Z_BZIP2ED - else - { - ZPOS64_T uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - ZPOS64_T uOutThis; - int flush=Z_SYNC_FLUSH; - - uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; - bufBefore = pfile_in_zip_read_info->stream.next_out; - - /* - if ((pfile_in_zip_read_info->rest_read_uncompressed == - pfile_in_zip_read_info->stream.avail_out) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - flush = Z_FINISH; - */ - err=inflate(&pfile_in_zip_read_info->stream,flush); - - if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) - err = Z_DATA_ERROR; - - uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; - - pfile_in_zip_read_info->crc32 = - crc32(pfile_in_zip_read_info->crc32,bufBefore, - (uInt)(uOutThis)); - - pfile_in_zip_read_info->rest_read_uncompressed -= - uOutThis; - - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - if (err==Z_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=Z_OK) - break; - } - } - - if (err==Z_OK) - return iRead; - return err; -} - - -/* - Give the current position in uncompressed data -*/ -extern z_off_t ZEXPORT unztell (unzFile file) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - return (z_off_t)pfile_in_zip_read_info->stream.total_out; -} - -extern ZPOS64_T ZEXPORT unztell64 (unzFile file) -{ - - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return (ZPOS64_T)-1; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return (ZPOS64_T)-1; - - return pfile_in_zip_read_info->total_out_64; -} - - -/* - return 1 if the end of file was reached, 0 elsewhere -*/ -extern int ZEXPORT unzeof (unzFile file) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - if (pfile_in_zip_read_info->rest_read_uncompressed == 0) - return 1; - else - return 0; -} - - - -/* -Read extra field from the current file (opened by unzOpenCurrentFile) -This is the local-header version of the extra field (sometimes, there is -more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field that can be read - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ -extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - uInt read_now; - ZPOS64_T size_to_read; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - size_to_read = (pfile_in_zip_read_info->size_local_extrafield - - pfile_in_zip_read_info->pos_local_extrafield); - - if (buf==NULL) - return (int)size_to_read; - - if (len>size_to_read) - read_now = (uInt)size_to_read; - else - read_now = (uInt)len ; - - if (read_now==0) - return 0; - - if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->offset_local_extrafield + - pfile_in_zip_read_info->pos_local_extrafield, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (ZREAD64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - buf,read_now)!=read_now) - return UNZ_ERRNO; - - return (int)read_now; -} - -/* - Close the file in zip opened with unzipOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ -extern int ZEXPORT unzCloseCurrentFile (unzFile file) -{ - int err=UNZ_OK; - - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && - (!pfile_in_zip_read_info->raw)) - { - if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) - err=UNZ_CRCERROR; - } - - - TRYFREE(pfile_in_zip_read_info->read_buffer); - pfile_in_zip_read_info->read_buffer = NULL; - if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED) - inflateEnd(&pfile_in_zip_read_info->stream); -#ifdef HAVE_BZIP2 - else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED) - BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream); -#endif - - - pfile_in_zip_read_info->stream_initialised = 0; - TRYFREE(pfile_in_zip_read_info); - - s->pfile_in_zip_read=NULL; - - return err; -} - - -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ -extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) -{ - unz64_s* s; - uLong uReadThis ; - if (file==NULL) - return (int)UNZ_PARAMERROR; - s=(unz64_s*)file; - - uReadThis = uSizeBuf; - if (uReadThis>s->gi.size_comment) - uReadThis = s->gi.size_comment; - - if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (uReadThis>0) - { - *szComment='\0'; - if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) - return UNZ_ERRNO; - } - - if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) - *(szComment+s->gi.size_comment)='\0'; - return (int)uReadThis; -} - -/* Additions by RX '2004 */ -extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) -{ - unz64_s* s; - - if (file==NULL) - return 0; //UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return 0; - if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) - if (s->num_file==s->gi.number_entry) - return 0; - return s->pos_in_central_dir; -} - -extern uLong ZEXPORT unzGetOffset (unzFile file) -{ - ZPOS64_T offset64; - - if (file==NULL) - return 0; //UNZ_PARAMERROR; - offset64 = unzGetOffset64(file); - return (uLong)offset64; -} - -extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) -{ - unz64_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - - s->pos_in_central_dir = pos; - s->num_file = s->gi.number_entry; /* hack */ - err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - -extern int ZEXPORT unzSetOffset (unzFile file, uLong pos) -{ - return unzSetOffset64(file,pos); -} diff --git a/jan/src/burner/unzip.h b/jan/src/burner/unzip.h deleted file mode 100644 index 3183968b7..000000000 --- a/jan/src/burner/unzip.h +++ /dev/null @@ -1,437 +0,0 @@ -/* unzip.h -- IO for uncompress .zip files using zlib - Version 1.1, February 14h, 2010 - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications of Unzip for Zip64 - Copyright (C) 2007-2008 Even Rouault - - Modifications for Zip64 support on both zip and unzip - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - --------------------------------------------------------------------------------- - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - - Changes - - See header of unzip64.c - -*/ - -#ifndef _unz64_H -#define _unz64_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#ifdef HAVE_BZIP2 -#include "bzlib.h" -#endif - -#define Z_BZIP2ED 12 - -#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; -typedef unzFile__ *unzFile; -#else -typedef voidp unzFile; -#endif - - -#define UNZ_OK (0) -#define UNZ_END_OF_LIST_OF_FILE (-100) -#define UNZ_ERRNO (Z_ERRNO) -#define UNZ_EOF (0) -#define UNZ_PARAMERROR (-102) -#define UNZ_BADZIPFILE (-103) -#define UNZ_INTERNALERROR (-104) -#define UNZ_CRCERROR (-105) - -/* tm_unz contain date/time info */ -typedef struct tm_unz_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_unz; - -/* unz_global_info structure contain global data about the ZIPfile - These data comes from the end of central dir */ -typedef struct unz_global_info64_s -{ - ZPOS64_T number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info64; - -typedef struct unz_global_info_s -{ - uLong number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info; - -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_info64_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - ZPOS64_T compressed_size; /* compressed size 8 bytes */ - ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info64; - -typedef struct unz_file_info_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info; - -extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) -*/ - - -extern unzFile ZEXPORT unzOpen OF((const char *path)); -extern unzFile ZEXPORT unzOpen64 OF((const void *path)); -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer - "zlib/zlib113.zip". - If the zipfile cannot be opened (file don't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. - the "64" function take a const void* pointer, because the path is just the - value passed to the open64_file_func callback. - Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path - is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* - does not describe the reality -*/ - - -extern unzFile ZEXPORT unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unzOpen, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, - zlib_filefunc64_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unz64Open, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -extern int ZEXPORT unzClose OF((unzFile file)); -/* - Close a ZipFile opened with unzipOpen. - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzipCloseCurrentFile before call unzipClose. - return UNZ_OK if there is no problem. */ - -extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); - -extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, - unz_global_info64 *pglobal_info)); -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ - - -extern int ZEXPORT unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ - - -/***************************************************************************/ -/* Unzip package allow you browse the directory of the zipfile */ - -extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ - -extern int ZEXPORT unzGoToNextFile OF((unzFile file)); -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -extern int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ - - -/* ****************************************** */ -/* Ryan supplied functions */ -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; /* offset in zip file directory */ - uLong num_of_file; /* # of file */ -} unz_file_pos; - -extern int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); - -extern int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); - -typedef struct unz64_file_pos_s -{ - ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ - ZPOS64_T num_of_file; /* # of file */ -} unz64_file_pos; - -extern int ZEXPORT unzGetFilePos64( - unzFile file, - unz64_file_pos* file_pos); - -extern int ZEXPORT unzGoToFilePos64( - unzFile file, - const unz64_file_pos* file_pos); - -/* ****************************************** */ - -extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); -/* - Get Info about the current file - if pfile_info!=NULL, the *pfile_info structure will contain somes info about - the current file - if szFileName!=NULL, the filemane string will be copied in szFileName - (fileNameBufferSize is the size of the buffer) - if extraField!=NULL, the extra field information will be copied in extraField - (extraFieldBufferSize is the size of the buffer). - This is the Central-header version of the extra field - if szComment!=NULL, the comment string of the file will be copied in szComment - (commentBufferSize is the size of the buffer) -*/ - - -/** Addition for GDAL : START */ - -extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); - -/** Addition for GDAL : END */ - - -/***************************************************************************/ -/* for reading the content of the current zipfile, you can open it, read data - from it, and close it (you can close it before reading all the file) - */ - -extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); -/* - Open for reading data the current file in the zipfile. - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); -/* - Open for reading data the current file in the zipfile. - password is a crypting password - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - -extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, - const char* password)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - - -extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); -/* - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ - -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read bytes from the current file (opened by unzOpenCurrentFile) - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ - -extern z_off_t ZEXPORT unztell OF((unzFile file)); - -extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); -/* - Give the current position in uncompressed data -*/ - -extern int ZEXPORT unzeof OF((unzFile file)); -/* - return 1 if the end of file was reached, 0 elsewhere -*/ - -extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ - -/***************************************************************************/ - -/* Get the current file offset */ -extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); -extern uLong ZEXPORT unzGetOffset (unzFile file); - -/* Set the current file offset */ -extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); -extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); - - - -#ifdef __cplusplus -} -#endif - -#endif /* _unz64_H */ diff --git a/jan/src/burner/win32/about.cpp b/jan/src/burner/win32/about.cpp deleted file mode 100644 index 21d408a02..000000000 --- a/jan/src/burner/win32/about.cpp +++ /dev/null @@ -1,301 +0,0 @@ -#include "burner.h" -#include "version.h" -#include "build_details.h" -#include - -// Print text surrounded by a black outline -static void myDrawText(HDC hDC, RECT* pRect, TCHAR* szText, int nSizeDelta, int nColour, UINT uFormat) -{ - TCHAR szName[32]; - RECT rect; - HFONT hFont, myFont; - TEXTMETRIC myMetric; - -#ifdef USE_SEGOE - nSizeDelta += 2; -#endif - - GetTextFace(hDC, 32, szName); - GetTextMetrics(hDC, &myMetric); - myFont = CreateFont(myMetric.tmHeight + nSizeDelta, 0, 0, 0, FW_BLACK, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, 0, szName); - hFont = (HFONT)SelectObject(hDC, myFont); - SetBkMode(hDC, TRANSPARENT); - - // Shrink the rect to allow space for the outline - memcpy(&rect, pRect, sizeof(RECT)); - rect.left += 1; - rect.top += 1; - rect.right -= 1; - rect.bottom -= 1; - - // Print the outline first - SetTextColor(hDC, 0); - rect.left -= 1; - rect.right -= 1; - DrawText(hDC, szText, -1, &rect, uFormat); - rect.top -= 1; - rect.bottom -= 1; - DrawText(hDC, szText, -1, &rect, uFormat); - rect.left += 1; - rect.right += 1; - DrawText(hDC, szText, -1, &rect, uFormat); - rect.left += 1; - rect.right += 1; - DrawText(hDC, szText, -1, &rect, uFormat); - rect.top += 1; - rect.bottom += 1; - DrawText(hDC, szText, -1, &rect, uFormat); - rect.top += 1; - rect.bottom += 1; - DrawText(hDC, szText, -1, &rect, uFormat); - rect.left -= 1; - rect.right -= 1; - DrawText(hDC, szText, -1, &rect, uFormat); - rect.left -= 1; - rect.right -= 1; - DrawText(hDC, szText, -1, &rect, uFormat); - rect.left += 1; - rect.right += 1; - rect.top -= 1; - rect.bottom -= 1; - - // Then print the text on top - SetTextColor(hDC, nColour); - DrawText(hDC, szText, -1, &rect, uFormat); - - SelectObject(hDC, hFont); - DeleteObject(myFont); -} - -static bool AboutDrawStrings(unsigned int nControlID, LPDRAWITEMSTRUCT pdis) -{ - switch (nControlID) { - case IDC_FBA_VER: { - TCHAR szVerString[128]; - if ((nBurnVer & 0xFFFF) > 0x9990) { - - int nVer1 = ((nBurnVer >> 16) & 0xFF) + 1; - if ((nVer1 & 0x0F) > 9) { - nVer1 += 6; - } - int nVer2 = nVer1 & 0x0F; - nVer1 >>= 4; - - _stprintf(szVerString, _T(APP_TITLE) _T(" v%s (v%i.%i Release Candidate %i)"), szAppBurnVer, nVer1, nVer2, nBurnVer & 0x0F); - } else { - if (nBurnVer & 0x00FF) { - _stprintf(szVerString, _T(APP_TITLE) _T(" v%s (alpha version)"), szAppBurnVer); - } else { - if (nBurnVer & 0xFF00) { - _stprintf(szVerString, _T(APP_TITLE) _T(" v%s (beta version)"), szAppBurnVer); - } else { - _stprintf(szVerString, _T(APP_TITLE) _T(" v%s (release version)"), szAppBurnVer); - } - } - } - - myDrawText(pdis->hDC, &pdis->rcItem, szVerString, 2, RGB(0xFF, 0xF7, 0xDF), DT_CENTER); - - return true; - } - case IDC_SPECIALSTRING: { - -#ifdef SPECIALBUILD - TCHAR* szSpecialBuild = _T(MAKE_STRING(SPECIALBUILD)); - - myDrawText(pdis->hDC, &pdis->rcItem, szSpecialBuild, -1, RGB(0xFF, 0xCF, 0x7F), DT_CENTER); -#else - TCHAR szBuild[256] = _T(""); - - RECT rect = pdis->rcItem; - rect.top += 1; -#ifdef MMX - _stprintf(szBuild, _T("built on ") _T(MAKE_STRING(BUILD_DATE)) _T(", ") _T(MAKE_STRING(BUILD_TIME)) _T(" (") _T(MAKE_STRING(BUILD_CHAR)) _T(", ") _T(MAKE_STRING(BUILD_COMP)) _T(", ") _T(MAKE_STRING(BUILD_CPU)) _T("%s)"), MMX ? _T(", MMX") : _T("")); -#else - _stprintf(szBuild, _T("built on ") _T(MAKE_STRING(BUILD_DATE)) _T(", ") _T(MAKE_STRING(BUILD_TIME)) _T(" (") _T(MAKE_STRING(BUILD_CHAR)) _T(", ") _T(MAKE_STRING(BUILD_COMP)) _T(", ") _T(MAKE_STRING(BUILD_CPU)) _T("%s)"), _T("")); -#endif - - myDrawText(pdis->hDC, &rect, szBuild, -2, RGB(0xDB, 0xDB, 0xDB), DT_CENTER); -#endif - return true; - } - } - - return false; -} - -// ---------------------------------------------------------------------------- - -void AddLicenseText(HWND hDlg, unsigned int nControlID) -{ - HRSRC hrsrc = FindResource(NULL, MAKEINTRESOURCE(ID_LICENSE), MAKEINTRESOURCE(256)); - HGLOBAL hglobal = LoadResource(NULL, hrsrc); - char* pszLicense = (char*)LockResource(hglobal); - - SendDlgItemMessageA(hDlg, nControlID, WM_SETTEXT, (WPARAM)0, (LPARAM)pszLicense); -} - -// ---------------------------------------------------------------------------- - -static INT_PTR CALLBACK AboutProc(HWND hDlg ,UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if (Msg == WM_INITDIALOG) { - WndInMid(hDlg, hScrnWnd); - return TRUE; - } - - if (Msg == WM_DRAWITEM) { - if (AboutDrawStrings(wParam, (LPDRAWITEMSTRUCT)lParam)) { - return TRUE; - } - - return 0; - } - - if (Msg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_SHOWLICENSE) { - RECT rect = { 0, 0, 0, 80 }; - - SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDOK), TRUE); - EnableWindow(GetDlgItem(hDlg, IDC_SHOWLICENSE), FALSE); - - SendDlgItemMessage(hDlg, IDC_LICENSE, EM_SETMARGINS, EC_LEFTMARGIN, 3); -// SendDlgItemMessage(hDlg, IDC_LICENSE, EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY, TO_ADVANCEDTYPOGRAPHY); - - AddLicenseText(hDlg, IDC_LICENSE); - - MapDialogRect(hDlg, &rect); - int nSize = rect.bottom; - GetWindowRect(hDlg, &rect); - MoveWindow(hDlg, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top + nSize, TRUE); - - WndInMid(hDlg, hScrnWnd); - return 0; - } - - if (Msg == WM_CLOSE) { - EndDialog(hDlg,0); - } - if (Msg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDOK) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - - return 0; -} - -int AboutCreate() -{ - HMODULE hRiched = NULL; - -#if defined (_UNICODE) - hRiched = LoadLibrary(L"RICHED20.DLL"); -#else - hRiched = LoadLibrary("RICHED20.DLL"); -#endif - if (hRiched) { - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_ABOUT), hScrnWnd, (DLGPROC)AboutProc); - FreeLibrary(hRiched); - hRiched = NULL; - } - - return 0; -} - -// ---------------------------------------------------------------------------- - -static INT_PTR CALLBACK FirstProc(HWND hDlg ,UINT Msg, WPARAM wParam, LPARAM lParam) -{ - static bool bLicenseDisplayed, bLicenseAccepted; - - if (Msg == WM_INITDIALOG) { - TCHAR szWarningString[4096]; - - bLicenseDisplayed = false; - bLicenseAccepted = false; - - SendDlgItemMessage(hDlg, IDC_LICENSE, EM_SETMARGINS, EC_LEFTMARGIN, 3); -// SendDlgItemMessage(hDlg, IDC_LICENSE, EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY, TO_ADVANCEDTYPOGRAPHY); - - _stprintf(szWarningString, FBALoadStringEx(hAppInst, IDS_FIRSTRUN1, true), _T(APP_TITLE), szAppBurnVer); - _tcscat(szWarningString, FBALoadStringEx(hAppInst, IDS_FIRSTRUN2, true)); -#if VER_ALPHA > 0 && (VER_ALPHA < 90 || VER_BETA < 99) - _tcscat(szWarningString, FBALoadStringEx(hAppInst, IDS_FIRSTRUN3A, true)); -#elif VER_BETA > 0 && VER_BETA < 99 - _tcscat(szWarningString, FBALoadStringEx(hAppInst, IDS_FIRSTRUN3B, true)); -#endif - - SendDlgItemMessage(hDlg, IDC_LICENSE, WM_SETTEXT, (WPARAM)0, (LPARAM)szWarningString); - - ShowWindow(GetDlgItem(hDlg, IDC_ACCEPTLICENSE), SW_HIDE); - - SetForegroundWindow(hDlg); - WndInMid(hDlg, NULL); - - SplashDestroy(1); - - return TRUE; - } - - if (Msg == WM_DRAWITEM) { - if (AboutDrawStrings(wParam, (LPDRAWITEMSTRUCT)lParam)) { - return TRUE; - } - - return 0; - } - - if (Msg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDOK) { - - if (bLicenseDisplayed) { - if (bLicenseAccepted) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - return 0; - } - - bLicenseDisplayed = true; - - EnableWindow(GetDlgItem(hDlg, IDOK), FALSE); - ShowWindow(GetDlgItem(hDlg, IDC_ACCEPTLICENSE), SW_SHOW); - SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDC_ACCEPTLICENSE), TRUE); - - AddLicenseText(hDlg, IDC_LICENSE); - - return 0; - } - if (Msg == WM_COMMAND && LOWORD(wParam) == IDC_ACCEPTLICENSE) { - if (SendDlgItemMessage(hDlg, IDC_ACCEPTLICENSE, BM_GETSTATE, 0, 0) & BST_CHECKED) { - bLicenseAccepted = true; - EnableWindow(GetDlgItem(hDlg, IDOK), TRUE); - } else { - bLicenseAccepted = false; - EnableWindow(GetDlgItem(hDlg, IDOK), FALSE); - } - } - - if (Msg == WM_CLOSE) { - if (bLicenseAccepted) { - EndDialog(hDlg, 0); - } - } - - return 0; -} - -int FirstUsageCreate() -{ - HMODULE hRiched = NULL; - -#if defined (_UNICODE) - hRiched = LoadLibrary(L"RICHED20.DLL"); -#else - hRiched = LoadLibrary("RICHED20.DLL"); -#endif - if (hRiched) { - DialogBox(hAppInst, MAKEINTRESOURCE(IDD_FIRST), hScrnWnd, (DLGPROC)FirstProc); - FreeLibrary(hRiched); - hRiched = NULL; - } - - return 0; -} - diff --git a/jan/src/burner/win32/app.rc b/jan/src/burner/win32/app.rc deleted file mode 100644 index 305bd0d5b..000000000 --- a/jan/src/burner/win32/app.rc +++ /dev/null @@ -1,1671 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SPLASH DIALOGEX 0, 0, 206, 141 -STYLE DS_MODALFRAME | DS_CENTER | DS_FIXEDSYS | WS_POPUP -EXSTYLE WS_EX_TOOLWINDOW -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - CONTROL BMP_SPLASH,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,1,1,9999,9999 -END - -IDD_INPD DIALOGEX 0, 0, 283, 244 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Map Game Inputs" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - DEFPUSHBUTTON "OK",IDCANCEL,228,225,50,14 - GROUPBOX "", IDC_STATIC, 3, 0, 277, 220 - CTEXT "Double-click an input to change its mapping",IDC_STATIC,7,7,265,15,SS_CENTERIMAGE - CONTROL "List1",IDC_INPD_LIST,"SysListView32",LVS_REPORT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 9, 24, 265, 128 - - CONTROL "", IDC_STATIC, "Static", SS_SUNKEN, 9, 156, 265, 58 - CTEXT "Make selection in all three drop-down boxes, click apropriate button",IDC_STATIC,11,159,261,15,SS_CENTERIMAGE - COMBOBOX IDC_INPD_GI,15,177,81,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_INPD_PCI,101,177,81,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_INPD_ANALOG,187,177,81,48,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP -// PUSHBUTTON "Macro...",IDC_INPD_NEWMACRO,15,194,52,14 - PUSHBUTTON "Save preset",IDC_INPD_SAVE_AS_PRESET,15,194,81,14 - PUSHBUTTON "Make default",IDC_INPD_DEFAULT,101,194,81,14 - PUSHBUTTON "Use preset",IDC_INPD_USE,187,194,81,14 -END - -IDD_INPS DIALOGEX 0, 0, 195, 64 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select control" -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - CONTROL "Grab mouse",IDC_INPS_GRABMOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,5,50,10 - PUSHBUTTON "Activate",IDC_INPS_PUSH,5,15,50,11 -// PUSHBUTTON "Cancel",IDCANCEL,5,35,50,15 - PUSHBUTTON "Clear Input",IDCANCEL+1,5,26,50,11 - CONTROL "Clear Lock",IDC_INPS_CLEARLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,38,50,10 - CONTROL "",IDC_INPS_CONTROL,"Static",SS_SUNKEN | SS_CENTER | SS_CENTERIMAGE,60,5,130,45, WS_EX_STATICEDGE - CONTROL "",IDC_INPS_CONTROL_NAME,"Edit",ES_CENTER | ES_AUTOHSCROLL | ES_READONLY,5,53,185,8 -END - -IDD_INPC DIALOGEX 0, 0, 97, 26 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION -CAPTION "Edit Constant" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - EDITTEXT IDC_INPC_VALUE,5,5,40,15,ES_AUTOHSCROLL - PUSHBUTTON "Close",IDCANCEL,50,5,40,15 -END - -IDD_INPCHEAT DIALOGEX 0, 0, 250, 200 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Edit cheat settings" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - GROUPBOX "", IDC_STATIC, 3, 0, 244, 176 - CTEXT "Select a cheat to change it.", IDC_STATIC, 7, 7, 232, 15, SS_CENTERIMAGE - CONTROL "List1", IDC_INPCHEAT_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 9, 24, 232, 128 - COMBOBOX IDC_INPCX1_VALUE, 9, 157, 177, 128, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL - PUSHBUTTON "Defaults",IDC_INPC_RESET,191,156,50,14 - DEFPUSHBUTTON "OK",IDOK,195,181,50,14 - PUSHBUTTON "Cancel",IDCANCEL,140,181,50,14 -END - -IDD_INPDIP DIALOGEX 0, 0, 270, 200 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Edit DIPswitch settings" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - GROUPBOX "", IDC_STATIC, 3, 0, 264, 176 - CTEXT "Select a setting to change it.", IDC_STATIC, 7, 7, - 252, 15, SS_CENTERIMAGE - CONTROL "List1", IDC_INPCHEAT_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 9, 24, 252, 128 - COMBOBOX IDC_INPCX1_VALUE, 9, 157, 197, 128, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL - PUSHBUTTON "Defaults",IDC_INPC_RESET,211,156,50,14 - DEFPUSHBUTTON "OK",IDOK,215,181,50,14 - PUSHBUTTON "Cancel",IDCANCEL,160,181,50,14 -END - -IDD_VALUE DIALOGEX DISCARDABLE 0, 0, 140, 20 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - DEFPUSHBUTTON "Close",ID_VALUE_CLOSE,86,3,50,13 - EDITTEXT IDC_VALUE_EDIT,4,3,78,12,ES_AUTOHSCROLL | ES_NUMBER -END - -IDD_WAIT DIALOGEX 0, 0, 206, 42 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP -EXSTYLE WS_EX_TOOLWINDOW -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - CONTROL BMP_MISC,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,2,2,9999,9999 - CONTROL "Progress1",IDC_WAIT_PROG,"msctls_progress32",PBS_SMOOTH | WS_BORDER,62,5,139,11 - LTEXT "",IDC_WAIT_LABEL_A,65,23,134,14,SS_CENTERIMAGE | NOT WS_VISIBLE - LTEXT "",IDC_WAIT_LABEL_B1,65,19,134,10,SS_CENTERIMAGE | NOT WS_VISIBLE - LTEXT "",IDC_WAIT_LABEL_B2,65,29,134,10,SS_CENTERIMAGE | NOT WS_VISIBLE - PUSHBUTTON "Cancel",IDCANCEL,151,23,50,14, NOT WS_VISIBLE -END - -IDD_ROMSDIR DIALOGEX 0, 0, 242, 81 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Edit ROMs paths" -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - CONTROL "Tab2",IDC_ROMPATH_TAB,"SysTabControl32",WS_TABSTOP,9,6,224,48 - DEFPUSHBUTTON "OK",IDOK,183,57,50,14 - PUSHBUTTON "Cancel",IDCANCEL,128,57,50,14 - GROUPBOX "",IDC_STATIC,5,0,233,76 - EDITTEXT IDC_ROMSDIR_EDIT1,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR1,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT2,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR2,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT3,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR3,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT4,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR4,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT5,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR5,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT6,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR6,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT7,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR7,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT8,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR8,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT9,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR9,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT10,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR10,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT11,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR11,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT12,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR12,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT13,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR13,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT14,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR14,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT15,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR15,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT16,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR16,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT17,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR17,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT18,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR18,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT19,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR19,177,30,50,14 - EDITTEXT IDC_ROMSDIR_EDIT20,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_ROMSDIR_BR20,177,30,50,14 -END - -IDD_ABOUT DIALOGEX 0, 0, 360, 109 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP -EXSTYLE WS_EX_TOOLWINDOW -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - CONTROL BMP_ABOUT,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,3,3,100,50 - CONTROL "version",IDC_FBA_VER,"Static",SS_OWNERDRAW | WS_GROUP,83,65,269,10 - CONTROL "specialbuild",IDC_SPECIALSTRING,"Static",SS_OWNERDRAW | WS_GROUP,83,73,269,10 - LTEXT "FB Alpha contains parts of MAME && Final Burn.\n 2004-2017, Team FB Alpha.",IDC_STATIC,6,88,235,16,WS_DISABLED - DEFPUSHBUTTON "OK",IDOK,305,90,50,14 - PUSHBUTTON "License",IDC_SHOWLICENSE,251,90,50,14 - CONTROL "",IDC_LICENSE,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | WS_VSCROLL | ES_NOIME,3,109,353,77, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT -END - -IDD_FIRST DIALOGEX 0, 0, 360, 191 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP -EXSTYLE WS_EX_TOOLWINDOW -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - CONTROL BMP_ABOUT,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,3,3,100,50 - CONTROL "version",IDC_FBA_VER,"Static",SS_OWNERDRAW | WS_GROUP,83,65,269,10 - CONTROL "specialbuild",IDC_SPECIALSTRING,"Static",SS_OWNERDRAW | WS_GROUP,83,73,269,10 - CONTROL "",IDC_LICENSE,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | WS_VSCROLL | ES_NOIME,3,90,353,77, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - DEFPUSHBUTTON "OK",IDOK,305,172,50,14 - CONTROL " I understand and agree to be bound by the terms of the above license agreement",IDC_ACCEPTLICENSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,172,293,14 -END - -IDD_SELNEW DIALOGEX 0, 0, 500, 362 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Select Game" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - CONTROL "Tree1",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS | TVS_LINESATROOT | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | TVS_NOHSCROLL | WS_TABSTOP,9,133,323,137,WS_EX_STATICEDGE - CONTROL "Tree2",IDC_TREE2,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_TABSTOP | 0x8000,345,101,148,168,WS_EX_STATICEDGE - GROUPBOX "Preview",IDC_STATIC2,4,1,157,118 - GROUPBOX "Title",IDC_STATIC3,163,1,157,118 - CONTROL "",IDC_SCREENSHOT_H,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,10,13,50,50, WS_EX_CLIENTEDGE - CONTROL "",IDC_SCREENSHOT_V,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,48,13,50,50, WS_EX_CLIENTEDGE - CONTROL "",IDC_SCREENSHOT2_H,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,169,13,50,50, WS_EX_CLIENTEDGE - CONTROL "",IDC_SCREENSHOT2_V,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,197,13,50,50, WS_EX_CLIENTEDGE - GROUPBOX "Select Game",IDC_STATIC1,4,121,334,240 - CONTROL "",IDC_STATIC_INFOBOX,"Static",SS_WHITERECT | SS_SUNKEN,9,273,323,66 - LTEXT "Game info:",IDC_LABELCOMMENT,13,278,45,8,NOT WS_GROUP - LTEXT "ROM name:",IDC_LABELROMNAME,13,288,45,8,NOT WS_GROUP - LTEXT "ROM info:",IDC_LABELROMINFO,13,298,45,8,NOT WS_GROUP - LTEXT "Released by:",IDC_LABELSYSTEM,13,308,45,8,NOT WS_GROUP - LTEXT "Genre:",IDC_LABELGENRE,13,318,45,8,NOT WS_GROUP - LTEXT "Notes:",IDC_LABELNOTES,13,328,45,8,NOT WS_GROUP - EDITTEXT IDC_TEXTCOMMENT,60,278,271,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTROMNAME,60,288,271,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTROMINFO,60,298,271,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTSYSTEM,60,308,271,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTGENRE,60,318,271,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTNOTES,60,328,271,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - GROUPBOX "Filters",IDC_STATIC_SYS,341,90,157,180 - LTEXT "",IDC_DRVCOUNT,10,345,241,8 - CONTROL "Game Info",IDGAMEINFO,"Button",WS_TABSTOP,256,343,78,14 - GROUPBOX "Options",IDC_STATIC_OPT,341,1,157,87 - CONTROL "Show available",IDC_CHECKAVAILABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,346,13,80,8 - CONTROL "Show unavailable",IDC_CHECKUNAVAILABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,346,24,80,8 - CONTROL "Always show clones",IDC_CHECKAUTOEXPAND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,346,35,80,8 - CONTROL "Use zipnames",IDC_SEL_SHORTNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,346,46,80,8 - CONTROL "Latin text only",IDC_SEL_ASCIIONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,346,57,80,8 - CONTROL "ROMs Dirs...",IDROM,"Button",WS_TABSTOP,346,70,72,14 - CONTROL "Scan ROMs",IDRESCAN,"Button",WS_TABSTOP,422,70,72,14 - CONTROL "Cancel",IDCANCEL,"Button",WS_TABSTOP,376,346,58,14 - CONTROL "Play",IDOK,"Button",WS_TABSTOP,439,346,58,14 - GROUPBOX "IPS",IDC_SEL_IPSGROUP,341,299,157,43 - CONTROL "Apply Patches",IDC_SEL_APPLYIPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,346,311,90,8 - CONTROL "IPS Manager",IDC_SEL_IPSMANAGER,"Button",WS_TABSTOP,346,324,78,14 - GROUPBOX "Search",IDC_SEL_SEARCHGROUP,341,271,157,27 - EDITTEXT IDC_SEL_SEARCH,346,282,147,12,ES_AUTOHSCROLL | WS_TABSTOP -END - -IDD_CAPTURE DIALOGEX 0, 0, 270, 90 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Shots Factory" -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - DEFPUSHBUTTON "&Capture",IDCAPTURE,125,72,70,14 - PUSHBUTTON "OK",IDOK,197,72,70,14 - PUSHBUTTON "&Advance Frame",IDC_ADVANCE,54,72,70,14 - CONTROL "Layer &1",IDC_LAYER1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,17,80,10 - CONTROL "Layer &2",IDC_LAYER2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,29,80,10 - CONTROL "Layer &3",IDC_LAYER3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,41,80,10 - CONTROL "Layer &4",IDC_LAYER4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,53,80,10 - GROUPBOX "Show",IDC_SHOW,5,7,260,62 - CONTROL "Sprite Priority 1",IDC_SPRITE1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,93,17,80,10 - CONTROL "Sprite Priority 2",IDC_SPRITE2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,93,29,80,10 - CONTROL "Sprite Priority 3",IDC_SPRITE3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,93,41,80,10 - CONTROL "Sprite Priority 4",IDC_SPRITE4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,93,53,80,10 - CONTROL "Sprite Priority 5",IDC_SPRITE5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,176,17,80,10 - CONTROL "Sprite Priority 6",IDC_SPRITE6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,176,29,80,10 - CONTROL "Sprite Priority 7",IDC_SPRITE7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,176,41,80,10 - CONTROL "Sprite Priority 8",IDC_SPRITE8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,176,53,80,10 -END - -IDD_GAMMA DIALOGEX 0, 0, 214, 59 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select desired Gamma value" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - DEFPUSHBUTTON "OK",IDOK,159,40,50,14 - GROUPBOX "", IDC_STATIC, 3, 0, 208, 35 - CONTROL "Gamma value",IDC_GAMMA_SLIDER,"msctls_trackbar32", WS_TABSTOP, 5, 10, 160, 18 - EDITTEXT IDC_GAMMA_EDIT,167,10,35,14,SS_CENTERIMAGE - PUSHBUTTON "Cancel",IDCANCEL,105,40,50,14 -END - -IDD_SCANLINE DIALOGEX 0, 0, 214, 59 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select desired scanline intensity" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - DEFPUSHBUTTON "OK",IDOK,159,40,50,14 - GROUPBOX "", IDC_STATIC, 3, 0, 208, 35 - CONTROL "Scanline intensity",IDC_SCANLINE_SLIDER,"msctls_trackbar32", WS_TABSTOP, 5, 10, 160, 18 - EDITTEXT IDC_SCANLINE_EDIT,167,10,35,14,SS_CENTERIMAGE - PUSHBUTTON "Cancel",IDCANCEL,105,40,50,14 -END - -IDD_PHOSPHOR DIALOGEX 0, 0, 214, 82 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select desired feedback intensity" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - DEFPUSHBUTTON "OK",IDOK,159,63,50,14 - GROUPBOX "", IDC_STATIC, 3, 0, 208, 58 - CONTROL "Feedback strength",IDC_PHOSPHOR_1_SLIDER,"msctls_trackbar32", WS_TABSTOP, 5, 10, 160, 18 - EDITTEXT IDC_PHOSPHOR_1_EDIT,167,10,35,14,SS_CENTERIMAGE - RTEXT "Max. Oversaturation:", IDC_STATIC, 8, 35, 75, 10, SS_CENTERIMAGE - CONTROL "Feedback oversaturation",IDC_PHOSPHOR_2_SLIDER,"msctls_trackbar32", WS_TABSTOP, 85, 33, 80, 18 - EDITTEXT IDC_PHOSPHOR_2_EDIT,167,33,35,14,SS_CENTERIMAGE - PUSHBUTTON "Cancel",IDCANCEL,105,63,50,14 -END - -IDD_SCREENANGLE DIALOGEX 0, 0, 234, 82 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select desired 3D projection properties" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - DEFPUSHBUTTON "OK",IDOK,179,63,50,14 - GROUPBOX "", IDC_STATIC, 3, 0, 228, 58 - RTEXT "Angle:", IDC_STATIC, 8, 12, 25, 10, SS_CENTERIMAGE - CONTROL "Screen Angle",IDC_SCREENANGLE_SLIDER,"msctls_trackbar32", WS_TABSTOP, 35, 10, 150, 18 - EDITTEXT IDC_SCREENANGLE_EDIT,187,10,35,14,SS_CENTERIMAGE - RTEXT "Fishbowl Factor:", IDC_STATIC, 9, 35, 56, 10, SS_CENTERIMAGE - CONTROL "Fishbowl Factor",IDC_SCREENCURVATURE_SLIDER,"msctls_trackbar32", WS_TABSTOP, 65, 33, 120, 18 - EDITTEXT IDC_SCREENCURVATURE_EDIT,187,33,35,14,SS_CENTERIMAGE - PUSHBUTTON "Cancel",IDCANCEL,125,63,50,14 -END - -IDD_CHOOSERES DIALOGEX 0, 0, 134, 54 -STYLE DS_MODALFRAME | DS_CENTER | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select desired resolution" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - DEFPUSHBUTTON "OK", IDOK, 79, 35, 50, 14 - GROUPBOX "", IDC_STATIC, 3, 0, 128, 30 - LTEXT "Resolution:", IDC_RESOLUTION, 8, 11, 48, 10, SS_CENTERIMAGE - COMBOBOX IDC_CHOOSE_LIST, 60, 10, 64, 128, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL - PUSHBUTTON "Cancel", IDCANCEL, 25, 35, 50, 14 -END - -IDD_CPUCLOCK DIALOGEX 0, 0, 222, 59 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Adjust speed of the emulated CPU" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - DEFPUSHBUTTON "OK",IDOK,167,40,50,14 - GROUPBOX "", IDC_STATIC, 3, 0, 216, 35 - CONTROL "CPU speed",IDC_CPUCLOCK_SLIDER,"msctls_trackbar32", WS_TABSTOP, 5, 10, 160, 18 - EDITTEXT IDC_CPUCLOCK_EDIT,167,10,35,14,SS_CENTERIMAGE - LTEXT "%", IDC_STATIC, 206, 11, 8, 10, SS_CENTERIMAGE - PUSHBUTTON "Cancel",IDCANCEL,113,40,50,14 -END - -IDD_EXCEPTION DIALOGEX 0, 0, 349, 69 -STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "FB Alpha has encountered an unrecoverable problem and will be terminated" -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - CONTROL "", IDC_SYSINFO_CODE, "Static", SS_SUNKEN | SS_CENTER | SS_CENTERIMAGE, 3,3,342,40, WS_EX_STATICEDGE - DEFPUSHBUTTON "OK",IDOK,294,49,50,14 - PUSHBUTTON "Debug",IDC_SYSINFO_DEBUG,240,49,50,14 - PUSHBUTTON "Details",IDC_SYSINFO_SHOW,186,49,50,14 - PUSHBUTTON "Log",IDC_SYSINFO_LOG,132,49,50,14 - CONTROL "",IDC_SYSINFO_EDIT,"EDIT",ES_MULTILINE | ES_WANTRETURN | ES_READONLY | WS_TABSTOP | WS_VSCROLL,3,69,342,122, WS_EX_STATICEDGE -END - -IDD_SYSINFO DIALOGEX 0, 0, 349, 151 -STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "FB Alpha system information report" -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - DEFPUSHBUTTON "OK",IDOK,274,131,70,14 - PUSHBUTTON "Save...",IDC_SYSINFO_LOG_SAVE,200,131,70,14 - CONTROL "",IDC_SYSINFO_EDIT,"EDIT",ES_MULTILINE | ES_WANTRETURN | ES_READONLY | WS_TABSTOP | WS_VSCROLL,3,3,342,122, WS_EX_STATICEDGE -END - -IDD_DEBUG_LRG DIALOGEX 0, 0, 582, 442 -STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "FB Alpha debugger" -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - CONTROL "",IDC_STATIC,"Static",SS_WHITERECT,3,399,523,14,WS_EX_STATICEDGE - CONTROL "",IDC_DBG_COMMAND,"RICHEDIT20A",ES_LOWERCASE | ES_AUTOHSCROLL | ES_NOIME | WS_TABSTOP,4,400,521,12, ES_EX_NOCALLOLEINIT - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,11,83,16,WS_EX_STATICEDGE - CTEXT "Disassembly", IDC_STATIC,13,3,48,16,SS_CENTERIMAGE - COMBOBOX IDC_DBG_MAINWN1_DRP1,95,3,145,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Endianness", IDC_STATIC,250,3,40,16,SS_CENTERIMAGE - COMBOBOX IDC_DBG_MAINWN1_DRP2,295,3,105,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,412,11,167,16,WS_EX_STATICEDGE - CTEXT "Internal CPU state", IDC_STATIC,417,3,67,16,SS_CENTERIMAGE - CONTROL "",IDC_DBG_MAINWN1,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME | WS_TABSTOP,3,19,401,179, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,209,83,16,WS_EX_STATICEDGE - CTEXT "Memory map", IDC_STATIC,13,201,48,16,SS_CENTERIMAGE - COMBOBOX IDC_DBG_MAINWN2_DRP1,95,201,145,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Endianness", IDC_STATIC,250,201,40,16,SS_CENTERIMAGE - COMBOBOX IDC_DBG_MAINWN2_DRP2,295,201,105,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,412,209,167,16,WS_EX_STATICEDGE - CTEXT "Debugger messages", IDC_STATIC,417,201,72,16,SS_CENTERIMAGE - CONTROL "",IDC_DBG_MAINWN2,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME | WS_TABSTOP,3,217,401,179, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - CONTROL "",IDC_DBG_INFOWN1,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME,407,19,172,179, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - CONTROL "",IDC_DBG_INFOWN2,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME,407,217,172,179, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - DEFPUSHBUTTON "Execute",IDOK,529,399,50,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,3,417,577,4,WS_EX_STATICEDGE - PUSHBUTTON "Exit",IDCANCEL,527,423,50,14 - PUSHBUTTON "Go!",IDC_DBG_GO,473,423,50,14 - PUSHBUTTON "Step frame",IDC_DBG_STEPFRAME,419,423,50,14 - PUSHBUTTON "Step",IDC_DBG_STEP,365,423,50,14 - PUSHBUTTON "Step into",IDC_DBG_STEPINTO,311,423,50,14 - PUSHBUTTON "Skip",IDC_DBG_SKIP,257,423,50,14 - - PUSHBUTTON "Screenshot",IDC_DBG_SHOT,6,423,50,14 -END - -IDD_DEBUG_SML DIALOGEX 0, 0, 592, 356 -STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "FB Alpha debugger" -#ifdef USE_SEGOE -FONT 6, "Segoe UI" -#else -FONT 6, "MS Shell Dlg" -#endif -BEGIN - CONTROL "",IDC_STATIC,"Static",SS_WHITERECT,3,313,532,14,WS_EX_STATICEDGE - CONTROL "",IDC_DBG_COMMAND,"RICHEDIT20A",ES_LOWERCASE | ES_AUTOHSCROLL | ES_NOIME | WS_TABSTOP,4,314,530,12, ES_EX_NOCALLOLEINIT - COMBOBOX IDC_DBG_MAINWN1_DRP1,3,3,249,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_DBG_MAINWN1_DRP2,254,3,150,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_DBG_MAINWN1,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME | WS_TABSTOP,3,19,401,136, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - COMBOBOX IDC_DBG_MAINWN2_DRP1,3,158,249,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_DBG_MAINWN2_DRP2,254,158,150,128,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_DBG_MAINWN2,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME | WS_TABSTOP,3,174,401,136, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - CONTROL "",IDC_DBG_INFOWN1,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME,407,3,182,182, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - CONTROL "",IDC_DBG_INFOWN2,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME,407,188,182,122, WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - DEFPUSHBUTTON "Execute",IDOK,538,313,50,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,3,331,586,4,WS_EX_STATICEDGE - PUSHBUTTON "Exit",IDCANCEL,536,337,50,14 - PUSHBUTTON "Go!",IDC_DBG_GO,482,337,50,14 - PUSHBUTTON "Step frame",IDC_DBG_STEPFRAME,428,337,50,14 - PUSHBUTTON "Step",IDC_DBG_STEP,374,337,50,14 - PUSHBUTTON "Step into",IDC_DBG_STEPINTO,320,337,50,14 - PUSHBUTTON "Skip",IDC_DBG_SKIP,266,337,50,14 - - PUSHBUTTON "Screenshot",IDC_DBG_SHOT,6,337,50,14 -END - -IDD_POPUP DIALOGEX 0, 0, 45, 36 -STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "FB Alpha message" -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - DEFPUSHBUTTON "OK",IDOK,38,16,50,14 - CONTROL "",IDC_MESSAGE_BACK,"Static",SS_WHITERECT | NOT WS_VISIBLE,0,0,0,0 - CONTROL "",IDC_MESSAGE_ICON,"Static",SS_OWNERDRAW,7,7,30,30 - CONTROL "",IDC_MESSAGE_EDIT_LOCAL,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME | WS_TABSTOP | NOT WS_VISIBLE,38,7,4,2 | ES_EX_NOCALLOLEINIT - CONTROL "",IDC_MESSAGE_EDIT_ENG,"RICHEDIT20A",ES_MULTILINE | ES_READONLY | ES_WANTRETURN | ES_NOIME | WS_TABSTOP,38,7,4,2 | ES_EX_NOCALLOLEINIT -END - -IDD_SUPPORTDIR DIALOGEX 0, 0, 242, 81 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Edit support file paths" -#ifdef USE_SEGOE -FONT 8, "Segoe UI" -#else -FONT 8, "MS Shell Dlg" -#endif -BEGIN - CONTROL "Tab2",IDC_SPATH_TAB,"SysTabControl32",WS_TABSTOP,9,6,224,48 - DEFPUSHBUTTON "OK",IDOK,183,57,50,14 - PUSHBUTTON "Cancel",IDCANCEL,128,57,50,14 - GROUPBOX "",IDC_STATIC,5,0,233,76 - EDITTEXT IDC_SUPPORTDIR_EDIT1,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR1,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT2,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR2,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT3,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR3,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT4,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR4,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT5,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR5,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT6,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR6,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT7,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR7,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT8,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR8,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT9,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR9,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT10,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR10,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT11,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR11,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT12,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR12,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT13,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR13,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT14,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR14,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT15,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR15,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT16,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR16,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT17,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR17,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT18,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR18,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT19,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR19,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT20,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR20,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT21,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR21,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT22,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR22,177,30,50,14 - EDITTEXT IDC_SUPPORTDIR_EDIT23,14,31,154,12,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_SUPPORTDIR_BR23,177,30,50,14 -END - -IDD_PALETTEVIEWER DIALOGEX 0, 0, 320, 240 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Palette Viewer" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - CONTROL "00000",IDC_GFX_VIEWER_VERT_1,"Static",SS_RIGHT,1,15,22,8 - CONTROL "00010",IDC_GFX_VIEWER_VERT_2,"Static",SS_RIGHT,1,28,22,8 - CONTROL "00020",IDC_GFX_VIEWER_VERT_3,"Static",SS_RIGHT,1,41,22,8 - CONTROL "00030",IDC_GFX_VIEWER_VERT_4,"Static",SS_RIGHT,1,54,22,8 - CONTROL "00040",IDC_GFX_VIEWER_VERT_5,"Static",SS_RIGHT,1,67,22,8 - CONTROL "00050",IDC_GFX_VIEWER_VERT_6,"Static",SS_RIGHT,1,80,22,8 - CONTROL "00060",IDC_GFX_VIEWER_VERT_7,"Static",SS_RIGHT,1,93,22,8 - CONTROL "00070",IDC_GFX_VIEWER_VERT_8,"Static",SS_RIGHT,1,105,22,8 - CONTROL "00080",IDC_GFX_VIEWER_VERT_9,"Static",SS_RIGHT,1,118,22,8 - CONTROL "00090",IDC_GFX_VIEWER_VERT_10,"Static",SS_RIGHT,1,131,22,8 - CONTROL "000A0",IDC_GFX_VIEWER_VERT_11,"Static",SS_RIGHT,1,144,22,8 - CONTROL "000B0",IDC_GFX_VIEWER_VERT_12,"Static",SS_RIGHT,1,157,22,8 - CONTROL "000C0",IDC_GFX_VIEWER_VERT_13,"Static",SS_RIGHT,1,170,22,8 - CONTROL "000D0",IDC_GFX_VIEWER_VERT_14,"Static",SS_RIGHT,1,183,22,8 - CONTROL "000E0",IDC_GFX_VIEWER_VERT_15,"Static",SS_RIGHT,1,196,22,8 - CONTROL "000F0",IDC_GFX_VIEWER_VERT_16,"Static",SS_RIGHT,1,209,22,8 - CONTROL "0",IDC_GFX_VIEWER_HORI_1,"Static",0,30,3,8,8 - CONTROL "1",IDC_GFX_VIEWER_HORI_2,"Static",0,44,3,8,8 - CONTROL "2",IDC_GFX_VIEWER_HORI_3,"Static",0,58,3,8,8 - CONTROL "3",IDC_GFX_VIEWER_HORI_4,"Static",0,72,3,8,8 - CONTROL "4",IDC_GFX_VIEWER_HORI_5,"Static",0,86,3,8,8 - CONTROL "5",IDC_GFX_VIEWER_HORI_6,"Static",0,100,3,8,8 - CONTROL "6",IDC_GFX_VIEWER_HORI_7,"Static",0,114,3,8,8 - CONTROL "7",IDC_GFX_VIEWER_HORI_8,"Static",0,128,3,8,8 - CONTROL "8",IDC_GFX_VIEWER_HORI_9,"Static",0,142,3,8,8 - CONTROL "9",IDC_GFX_VIEWER_HORI_10,"Static",0,156,3,8,8 - CONTROL "A",IDC_GFX_VIEWER_HORI_11,"Static",0,170,3,8,8 - CONTROL "B",IDC_GFX_VIEWER_HORI_12,"Static",0,184,3,8,8 - CONTROL "C",IDC_GFX_VIEWER_HORI_13,"Static",0,198,3,8,8 - CONTROL "D",IDC_GFX_VIEWER_HORI_14,"Static",0,211,3,8,8 - CONTROL "E",IDC_GFX_VIEWER_HORI_15,"Static",0,226,3,8,8 - CONTROL "F",IDC_GFX_VIEWER_HORI_16,"Static",0,240,3,8,8 - LTEXT "Selected colour: ",IDC_GFX_VIEWER_SEL_COL,3,226,180,8,NOT WS_GROUP - DEFPUSHBUTTON "Close",IDCANCEL,256,206,60,14 - CONTROL "Previous...",IDC_GFX_VIEWER_PREV,"Button",WS_TABSTOP,256,13,60,14 - CONTROL "Next...",IDC_GFX_VIEWER_NEXT,"Button",WS_TABSTOP,256,33,60,14 -END - -IDD_IPS_MANAGER DIALOGEX 0, 0, 474, 318 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "IPS Patch Manager" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - CONTROL "Tree1",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_TABSTOP | 0x8000,8,10,250,150,WS_EX_STATICEDGE - GROUPBOX "",IDC_STATIC1,2,0,470,298 - CONTROL "",IDC_STATIC_INFOBOX,"Static",SS_WHITERECT | SS_SUNKEN,8,190,250,100 - EDITTEXT IDC_TEXTCOMMENT,8,190,458,100,ES_MULTILINE | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP | WS_VSCROLL - RTEXT "Language:", IDC_IPSMAN_LANGUAGE, 8, 170, 40, 10, SS_CENTERIMAGE - COMBOBOX IDC_CHOOSE_LIST, 60, 169, 100, 128, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL - CONTROL "Deselect All",IDC_IPSMAN_DESELECTALL,"Button",WS_TABSTOP,170,169,58,13 - CONTROL "",IDC_SCREENSHOT_H,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,262,10,106,100, WS_EX_CLIENTEDGE - CONTROL "Cancel",IDCANCEL,"Button",WS_TABSTOP,350,300,58,14 - CONTROL "OK",IDOK,"Button",WS_TABSTOP,413,300,58,14 -END - -IDD_MVS_SELECT_CARTS DIALOGEX 0, 0, 369, 271 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select cartridges to load..." -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - GROUPBOX "", IDC_STATIC, 3, 0, 362, 247 - - DEFPUSHBUTTON "OK",IDOK,313,252,50,14 - PUSHBUTTON "Cancel",IDCANCEL,258,252,50,14 - - CONTROL "",IDC_MVS_CART1,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,8,8,48,36 - LTEXT "Slot 1", IDC_MVS_SLOT1,61,9,50,8,SS_CENTERIMAGE - CONTROL "", IDC_MVS_TEXTROMNAME1,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,115,9,172,8 - CONTROL "", IDC_MVS_TEXTCOMMENT1,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,21,226,8 - CONTROL "", IDC_MVS_TEXTSYSTEM1,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,33,226,8 - PUSHBUTTON "Clear",IDC_MVS_CLEAR1,292,14,70,14 - PUSHBUTTON "Select...",IDC_MVS_SELECT1,292,30,70,14 - - CONTROL "",IDC_MVS_CART2,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,8,48,48,36 - LTEXT "Slot 2", IDC_MVS_SLOT2,61,49,50,8,SS_CENTERIMAGE - CONTROL "", IDC_MVS_TEXTROMNAME2,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,115,49,172,8 - CONTROL "", IDC_MVS_TEXTCOMMENT2,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,61,226,8 - CONTROL "", IDC_MVS_TEXTSYSTEM2,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,73,226,8 - PUSHBUTTON "Clear",IDC_MVS_CLEAR2,292,54,70,14 - PUSHBUTTON "Select...",IDC_MVS_SELECT2,292,70,70,14 - - CONTROL "",IDC_MVS_CART3,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,8,88,48,36 - LTEXT "Slot 3", IDC_MVS_SLOT3,61,89,50,8,SS_CENTERIMAGE - CONTROL "", IDC_MVS_TEXTROMNAME3,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,115,89,172,8 - CONTROL "", IDC_MVS_TEXTCOMMENT3,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,101,226,8 - CONTROL "", IDC_MVS_TEXTSYSTEM3,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,113,226,8 - PUSHBUTTON "Clear",IDC_MVS_CLEAR3,292,94,70,14 - PUSHBUTTON "Select...",IDC_MVS_SELECT3,292,110,70,14 - - CONTROL "",IDC_MVS_CART4,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,8,128,48,36 - LTEXT "Slot 4", IDC_MVS_SLOT4,61,129,50,8,SS_CENTERIMAGE - CONTROL "", IDC_MVS_TEXTROMNAME4,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,115,129,172,8 - CONTROL "", IDC_MVS_TEXTCOMMENT4,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,141,226,8 - CONTROL "", IDC_MVS_TEXTSYSTEM4,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,153,226,8 - PUSHBUTTON "Clear",IDC_MVS_CLEAR4,292,134,70,14 - PUSHBUTTON "Select...",IDC_MVS_SELECT4,292,150,70,14 - - CONTROL "",IDC_MVS_CART5,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,8,168,48,36 - LTEXT "Slot 5", IDC_MVS_SLOT5,61,169,50,8,SS_CENTERIMAGE - CONTROL "", IDC_MVS_TEXTROMNAME5,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,115,169,172,8 - CONTROL "", IDC_MVS_TEXTCOMMENT5,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,181,226,8 - CONTROL "", IDC_MVS_TEXTSYSTEM5,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,193,226,8 - PUSHBUTTON "Clear",IDC_MVS_CLEAR5,292,174,70,14 - PUSHBUTTON "Select...",IDC_MVS_SELECT5,292,190,70,14 - - CONTROL "",IDC_MVS_CART6,"Static",SS_BITMAP | SS_REALSIZEIMAGE | SS_SUNKEN,8,208,48,36 - LTEXT "Slot 6", IDC_MVS_SLOT6,61,209,50,8,SS_CENTERIMAGE - CONTROL "", IDC_MVS_TEXTROMNAME6,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,115,209,172,8 - CONTROL "", IDC_MVS_TEXTCOMMENT6,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,221,226,8 - CONTROL "", IDC_MVS_TEXTSYSTEM6,"Edit",ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE,61,233,226,8 - PUSHBUTTON "Clear",IDC_MVS_CLEAR6,292,214,70,14 - PUSHBUTTON "Select...",IDC_MVS_SELECT6,292,230,70,14 -END - -IDD_NCD_DLG DIALOGEX 0, 0, 520, 291 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "NeoGeo CDZ Game List" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 400, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -#endif -BEGIN - CONTROL "",IDC_NCD_LIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,5,348,218 - DEFPUSHBUTTON "Play",IDC_NCD_PLAY_BUTTON,445,272,71,14 - PUSHBUTTON "Cancel",IDC_NCD_CANCEL_BUTTON,370,272,71,14 - PUSHBUTTON "Scan Games",IDC_NCD_SCAN_BUTTON,366,236,71,14 - PUSHBUTTON "Directories...",IDC_NCD_SEL_DIR_BUTTON,441,236,71,14 - CONTROL "Scan sub-dirs",IDC_NCD_SSUBDIR_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,367,255,71,10 - GROUPBOX "Front Cover",IDC_STATIC,362,1,156,108 - GROUPBOX "Back Cover",IDC_STATIC,362,115,156,108 -// GROUPBOX "Selection Info",IDC_STATIC,7,256,348,59 - CONTROL "",IDC_STATIC_INFOBOX,"Static",SS_WHITERECT | SS_SUNKEN,7,227,348,59 - GROUPBOX "Options",IDC_STATIC,362,226,155,43 - CONTROL "",IDC_NCD_FRONT_PIC,"Static",SS_BITMAP | SS_NOTIFY,368,12,22,19,WS_EX_CLIENTEDGE - CONTROL "",IDC_NCD_BACK_PIC,"Static",SS_BITMAP | SS_NOTIFY,368,126,17,15,WS_EX_CLIENTEDGE - CONTROL "",IDC_NCD_FRONT_PIC_FRAME,"Static",SS_BITMAP | NOT WS_VISIBLE,368,12,22,19,WS_EX_CLIENTEDGE - CONTROL "",IDC_NCD_BACK_PIC_FRAME,"Static",SS_BITMAP | NOT WS_VISIBLE,369,126,17,15,WS_EX_CLIENTEDGE - LTEXT "Short name:",IDC_NCD_LABELSHORT,13,231,44,8,NOT WS_GROUP - LTEXT "Released by:",IDC_NCD_LABELPUBLISHER,13,245,44,8,NOT WS_GROUP - LTEXT "Disc Image:",IDC_NCD_LABELIMAGE,13,259,44,8,NOT WS_GROUP - LTEXT "Audio Tracks:",IDC_NCD_LABELAUDIO,13,273,44,8,NOT WS_GROUP - EDITTEXT IDC_NCD_TEXTSHORT,64,231,286,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_NCD_TEXTPUBLISHER,64,245,286,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_NCD_TEXTIMAGE,64,259,286,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_NCD_TEXTAUDIO,64,273,50,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - CONTROL "Scan for ISO only",IDC_NCD_SISO_ONLY_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,442,255,71,10 -END - - -// LTEXT "Game info:",IDC_LABELCOMMENT,13,208,45,8,NOT WS_GROUP -// LTEXT "ROM name:",IDC_LABELROMNAME,13,218,45,8,NOT WS_GROUP -// LTEXT "ROM info:",IDC_LABELROMINFO,13,228,45,8,NOT WS_GROUP -// LTEXT "Released by:",IDC_LABELSYSTEM,13,238,45,8,NOT WS_GROUP -// LTEXT "Genre:",IDC_LABELGENRE,13,248,45,8,NOT WS_GROUP -// LTEXT "Notes:",IDC_LABELNOTES,13,258,45,8,NOT WS_GROUP -// EDITTEXT IDC_TEXTCOMMENT,60,208,268,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP -// EDITTEXT IDC_TEXTROMNAME,60,218,268,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - -IDD_NCD_COVER_DLG DIALOGEX 0, 0, 397, 262 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "Cover Image" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 400, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -#endif -BEGIN - CONTROL "",IDC_NCD_COVER_PREVIEW_PIC,"Static",SS_BITMAP,3,2,312,179,WS_EX_CLIENTEDGE -END - -IDD_GAMEINFO DIALOGEX 0, 0, 520, 369 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Game Information" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - CONTROL "Tab1",IDC_TAB1,"SysTabControl32",TCS_SINGLELINE | WS_TABSTOP,4,76,512,270 - CONTROL "",IDC_STATIC_INFOBOX,"Static",SS_WHITERECT | SS_SUNKEN,4,4,512,66 - LTEXT "Game info:",IDC_LABELCOMMENT,8,9,45,8,NOT WS_GROUP - LTEXT "ROM name:",IDC_LABELROMNAME,8,19,45,8,NOT WS_GROUP - LTEXT "ROM info:",IDC_LABELROMINFO,8,29,45,8,NOT WS_GROUP - LTEXT "Released by:",IDC_LABELSYSTEM,8,39,45,8,NOT WS_GROUP - LTEXT "Genre:",IDC_LABELGENRE,8,49,45,8,NOT WS_GROUP - LTEXT "Notes:",IDC_LABELNOTES,8,59,45,8,NOT WS_GROUP - EDITTEXT IDC_TEXTCOMMENT,55,9,456,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTROMNAME,55,19,456,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTROMINFO,55,29,456,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTSYSTEM,55,39,456,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTGENRE,55,49,456,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_TEXTNOTES,55,59,456,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - CONTROL "",IDC_SCREENSHOT_H,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_REALSIZEIMAGE | SS_SUNKEN,8,94,504,247 - CONTROL "",IDC_SCREENSHOT_V,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_REALSIZEIMAGE | SS_SUNKEN,8,94,504,247 - CONTROL "List1",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,8,94,504,247 - CONTROL "List2",IDC_LIST2,"SysListView32",LVS_REPORT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,8,94,504,247 - CONTROL "",IDC_MESSAGE_EDIT_ENG,"RICHEDIT20A",WS_VSCROLL | WS_SYSMENU | 0x804,8,94,504,247,WS_EX_STATICEDGE | ES_EX_NOCALLOLEINIT - CONTROL "Favorite",IDFAVORITESET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,351,60,14 - PUSHBUTTON "Rescan Romset",IDRESCANSET,390,351,60,14 - DEFPUSHBUTTON "Close",IDCANCEL,456,351,60,14 -END - -IDD_DOWNLOAD_LOCAL DIALOGEX 0, 0, 168, 48 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Download Localisation Template" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - GROUPBOX "",IDC_STATIC1,2,0,164,28 - LTEXT "Language:", IDC_LOCAL_DOWNLOAD_LANG, 8, 10, 40, 10, SS_CENTERIMAGE - COMBOBOX IDC_CHOOSE_LIST, 60, 9, 100, 128, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL - CONTROL "Cancel",IDCANCEL,"Button",WS_TABSTOP,44,30,58,14 - CONTROL "OK",IDOK,"Button",WS_TABSTOP,107,30,58,14 -END - -IDD_REPLAYINP DIALOGEX 0, 0, 276, 137 -STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Replay input" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - DEFPUSHBUTTON "OK",IDOK,219,120,50,14 - GROUPBOX "",IDC_STATIC,3,0,269,115 - RTEXT "File:",IDC_STATIC,8,11,24,10,SS_CENTERIMAGE - COMBOBOX IDC_CHOOSE_LIST,35,10,231,118,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Cancel",IDCANCEL,165,120,50,14 - RTEXT "Length:",IDC_STATIC,10,44,59,8 - RTEXT "Frames:",IDC_STATIC,10,53,59,8 - RTEXT "Undo Count:",IDC_STATIC,10,62,59,8 - RTEXT "Author Info:",IDC_STATIC,10,71,59,8 - RTEXT "Recorded From:",IDC_STATIC,10,80,59,8 - LTEXT "00:00:00",IDC_LENGTH,76,44,59,8 - LTEXT "0",IDC_FRAMES,76,53,59,8 - LTEXT "0",IDC_UNDO,76,62,59,8 - LTEXT "",IDC_METADATA,76,71,190,30 - LTEXT "",IDC_REPLAYRESET,76,80,190,30 - CONTROL "Open Read-Only",IDC_READONLY,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,35,25,69,10 - CONTROL "Show Joystick Movement",IDC_SHOWMOVEMENT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,120,25,100,10 -END - -IDD_RECORDINP DIALOGEX 0, 0, 276, 98 -STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Record input" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - DEFPUSHBUTTON "OK",IDOK,219,79,50,14 - GROUPBOX "",-1,3,0,269,73 - RTEXT "File:",-1,26,11,24,10,SS_CENTERIMAGE - PUSHBUTTON "Cancel",IDCANCEL,165,79,50,14 - RTEXT "Author Info:",-1,10,30,40,8 - EDITTEXT IDC_FILENAME,55,10,189,14,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_BROWSE,249,10,18,14 - EDITTEXT IDC_METADATA,55,30,189,37,ES_AUTOHSCROLL - CONTROL "Record From Power-On",IDC_REPLAYRESET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,55,79,106,14 -END - -IDD_CHOOSEMONITOR DIALOGEX 0, 0, 242, 77 -STYLE DS_MODALFRAME | DS_CENTER | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Choose Monitor for Full Screen" -#ifdef USE_SEGOE -FONT 8, "Segoe UI", 0, 0, 0x1 -#else -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -#endif -BEGIN - GROUPBOX "",IDC_STATIC1,2,0,236,56 - LTEXT "These only apply to the DirectX Graphics 9 blitters.",IDC_CHOOSE_MONITOR_TEXT,8,4,210,15,SS_CENTERIMAGE - LTEXT "Horizontal Games:", IDC_CHOOSE_MONITOR_HOR, 8, 21, 60, 10, SS_CENTERIMAGE - COMBOBOX IDC_CHOOSE_MONITOR_HOR_LIST, 80, 20, 150, 128, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL - LTEXT "Vertical Games:", IDC_CHOOSE_MONITOR_VER, 8, 39, 60, 10, SS_CENTERIMAGE - COMBOBOX IDC_CHOOSE_MONITOR_VER_LIST, 80, 38, 150, 128, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL - CONTROL "Cancel",IDCANCEL,"Button",WS_TABSTOP,117,59,58,14 - CONTROL "OK",IDOK,"Button",WS_TABSTOP,180,59,58,14 -END - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MENU MENU DISCARDABLE -BEGIN - POPUP "Game" - BEGIN - MENUITEM "Load game...\tF6", MENU_LOAD - MENUITEM "Play via Kaillera...", MENU_STARTNET - POPUP "Most recent games..." - BEGIN - MENUITEM "no game selected", MENU_PREVIOUSGAMES1, GRAYED - MENUITEM "no game selected", MENU_PREVIOUSGAMES2, GRAYED - MENUITEM "no game selected", MENU_PREVIOUSGAMES3, GRAYED - MENUITEM "no game selected", MENU_PREVIOUSGAMES4, GRAYED - MENUITEM "no game selected", MENU_PREVIOUSGAMES5, GRAYED - MENUITEM "no game selected", MENU_PREVIOUSGAMES6, GRAYED - MENUITEM "no game selected", MENU_PREVIOUSGAMES7, GRAYED - MENUITEM "no game selected", MENU_PREVIOUSGAMES8, GRAYED - MENUITEM "no game selected", MENU_PREVIOUSGAMES9, GRAYED - MENUITEM "no game selected", MENU_PREVIOUSGAMES10, GRAYED - END - MENUITEM SEPARATOR - MENUITEM "Start Neo Geo Multi-slot...\tCtrl+F6",MENU_START_NEOGEO_MVS - MENUITEM SEPARATOR - MENUITEM "Load Neo Geo CDZ game...\tCtrl+F8", MENU_LOAD_NEOCD - MENUITEM "Select CD image (ISO/CUE)...\tCtrl+Shift+F12", MENU_CDIMAGE - MENUITEM "Start Neo Geo CDZ...\tCtrl+Shift+F6", MENU_START_NEOGEO_CD - MENUITEM SEPARATOR - MENUITEM "Exit game\tCtrl+F4", MENU_QUIT, GRAYED - MENUITEM "Pause game\tPause", MENU_PAUSE, GRAYED - MENUITEM SEPARATOR - MENUITEM "Adjust CPU speed...", MENU_SETCPUCLOCK, GRAYED - MENUITEM "Reset CPU speed to 100%", MENU_RESETCPUCLOCK, GRAYED - MENUITEM SEPARATOR - POPUP "Memory Card..." - BEGIN - MENUITEM "Create new memory card...\tCtrl+Shift+F7", MENU_MEMCARD_CREATE - MENUITEM "Select memory card...\tCtrl+F7", MENU_MEMCARD_SELECT - MENUITEM "Insert memory card\tF7", MENU_MEMCARD_INSERT - MENUITEM "Eject memory card\tF7", MENU_MEMCARD_EJECT - END - MENUITEM SEPARATOR - POPUP "Replay..." - BEGIN - MENUITEM "Replay input...", MENU_STARTREPLAY, GRAYED - MENUITEM "Record input...", MENU_STARTRECORD, GRAYED - MENUITEM "Stop replay/record", MENU_STOPREPLAY, GRAYED - END - MENUITEM SEPARATOR - POPUP "Save states..." - BEGIN - MENUITEM "Load state...\tCtrl+F9", MENU_STATE_LOAD_DIALOG, GRAYED - MENUITEM "Save state...\tCtrl+F10", MENU_STATE_SAVE_DIALOG, GRAYED - POPUP "State slots..." - BEGIN - MENUITEM "Activate previous slot\tF8", MENU_STATE_PREVSLOT - MENUITEM "Activate next slot\tF11", MENU_STATE_NEXTSLOT - MENUITEM "MENU_STATE_LOAD_SLOT", MENU_STATE_LOAD_SLOT, GRAYED - MENUITEM "MENU_STATE_SAVE_SLOT", MENU_STATE_SAVE_SLOT, GRAYED - MENUITEM "Undo last state save\tShift+F8", MENU_STATE_UNDO - END - MENUITEM "Restore full state on load", MENU_ALLRAM - END -#ifdef INCLUDE_AVI_RECORDING - MENUITEM SEPARATOR - MENUITEM "Record AVI", MENU_AVISTART, GRAYED - MENUITEM "Stop recording", MENU_AVISTOP, GRAYED -#endif - MENUITEM SEPARATOR - MENUITEM "Exit emulator\tAlt+F4", MENU_EXIT - END - POPUP "Video" - BEGIN - POPUP "&Select blitter" - BEGIN - MENUITEM "Basic\t(DirectDraw 7)", MENU_BLITTER_1 - MENUITEM "SoftFX\t(DirectDraw 7)", MENU_BLITTER_3 - MENUITEM "Enhanced\t(Direct3D 7)", MENU_BLITTER_2 - MENUITEM "Experimental\t(DirectX Graphics 9)", MENU_BLITTER_4 - MENUITEM "DirectX9 Alt\t(DirectX Graphics 9)", MENU_BLITTER_5 - END - MENUITEM "&Blitter options", MENU_BLITTEROPTIONS, GRAYED - POPUP "&Stretch" - BEGIN - MENUITEM "&Normal stretch", MENU_NOSTRETCH - MENUITEM "&Full stretch", MENU_STRETCH - MENUITEM "Correct &aspect ratio", MENU_ASPECT - END - MENUITEM SEPARATOR - MENUITEM "&Enable gamma correction", MENU_GAMMA_DO - POPUP "&Gamma correction settings" - BEGIN - MENUITEM "&Darken midtones\t(1.25)", MENU_GAMMA_DARKER - MENUITEM "&Lighten midtones\t(0.80)", MENU_GAMMA_LIGHTER - MENUITEM "MENU_GAMMA_OTHER", MENU_GAMMA_OTHER - MENUITEM SEPARATOR - MENUITEM "Use video &hardware when possible", MENU_GAMMA_USE_HARDWARE - MENUITEM "Use video hardware &exclusively", MENU_GAMMA_HARDWARE_ONLY - MENUITEM "Use &software exclusively", MENU_GAMMA_SOFTWARE_ONLY - END - MENUITEM SEPARATOR - POPUP "&Window size" - BEGIN - MENUITEM "&Auto", MENU_AUTOSIZE - MENUITEM SEPARATOR - MENUITEM "&Single size", MENU_SINGLESIZEWINDOW - MENUITEM "&Double size", MENU_DOUBLESIZEWINDOW - MENUITEM "&Triple size", MENU_TRIPLESIZEWINDOW - MENUITEM "&Quadruple size", MENU_QUADSIZEWINDOW - MENUITEM "&Maximum size", MENU_MAXIMUMSIZEWINDOW - END - MENUITEM SEPARATOR - MENUITEM "Toggle &fullscreen mode\tAlt+Enter", MENU_FULL - MENUITEM "Auto Switch to Fullscreen after loading", MENU_AUTOSWITCHFULL - POPUP "Fullscreen Resolution (Horizontal)" - BEGIN - MENUITEM "MENU_RES_ARCADE", MENU_RES_ARCADE - MENUITEM SEPARATOR - MENUITEM "&Single size", MENU_SINGLESIZESCREEN - MENUITEM "&Double size", MENU_DOUBLESIZESCREEN - MENUITEM "&Triple size", MENU_TRIPLESIZESCREEN - MENUITEM "&Quadruple size", MENU_QUADSIZESCREEN - MENUITEM SEPARATOR - MENUITEM "MENU_RES_1", MENU_RES_1 - MENUITEM "MENU_RES_2", MENU_RES_2 - MENUITEM "MENU_RES_3", MENU_RES_3 - MENUITEM "MENU_RES_4", MENU_RES_4 - MENUITEM SEPARATOR - MENUITEM "MENU_RES_OTHER", MENU_RES_OTHER - END - POPUP "Fullscreen Resolution (Vertical)" - BEGIN - MENUITEM "MENU_RES_ARCADE_VERTICAL", MENU_RES_ARCADE_VERTICAL - MENUITEM SEPARATOR - MENUITEM "&Single size", MENU_SINGLESIZESCREEN_VERTICAL - MENUITEM "&Double size", MENU_DOUBLESIZESCREEN_VERTICAL - MENUITEM "&Triple size", MENU_TRIPLESIZESCREEN_VERTICAL - MENUITEM "&Quadruple size", MENU_QUADSIZESCREEN_VERTICAL - MENUITEM SEPARATOR - MENUITEM "MENU_RES_1_VERTICAL", MENU_RES_1_VERTICAL - MENUITEM "MENU_RES_2_VERTICAL", MENU_RES_2_VERTICAL - MENUITEM "MENU_RES_3_VERTICAL", MENU_RES_3_VERTICAL - MENUITEM "MENU_RES_4_VERTICAL", MENU_RES_4_VERTICAL - MENUITEM SEPARATOR - MENUITEM "MENU_RES_OTHER_VERTICAL", MENU_RES_OTHER_VERTICAL - END - POPUP "Fullscreen bit&depth" - BEGIN - MENUITEM "&16bit", MENU_16 - MENUITEM "&24bit", MENU_24 - MENUITEM "&32bit", MENU_32 - END - MENUITEM "Choose Fullscreen Monitor", MENU_FULLSCREEN_MONITOR - MENUITEM SEPARATOR - POPUP "&Monitor properties" - BEGIN - MENUITEM "Automatically detect aspect ratio", MENU_MONITORAUTOCHECK - MENUITEM SEPARATOR - MENUITEM "Normal CRT aspect ratio\t(4:3)", MENU_ASPECTNORMAL - MENUITEM "Normal LCD aspect ratio\t(5:4)", MENU_ASPECTLCD - MENUITEM "Widescreen CRT aspect ratio\t(16:9)", MENU_ASPECTWIDE - MENUITEM "Widescreen LCD aspect ratio\t(16:10)", MENU_ASPECTWIDELCD - MENUITEM SEPARATOR - MENUITEM "Mirrored vertical alignment", MENU_MONITORMIRRORVERT - END - MENUITEM SEPARATOR - MENUITEM "&Rotate vertically aligned games", MENU_ROTATEVERTICAL - MENUITEM "Force 60Hz refresh rate", MENU_FORCE60HZ - MENUITEM "Enable &Triple Buffering (Fullscreen)", MENU_TRIPLE - MENUITEM "Enable VSync (Windowed)", MENU_VIDEOVSYNC - MENUITEM "Auto Frameskip", MENU_AUTOFRAMESKIP - END - POPUP "Audio" - BEGIN - POPUP "Select &plugin" - BEGIN - MENUITEM "DirectSound", MENU_AUD_PLUGIN_1 - MENUITEM "XAudio2", MENU_AUD_PLUGIN_2 - END - MENUITEM "Plugin &options", MENU_AUDIO_OPTIONS, GRAYED - MENUITEM SEPARATOR - MENUITEM "2-point 1st order sample interpolation", MENU_INTERPOLATE_1 - MENUITEM "4-point 3rd order sample interpolation", MENU_INTERPOLATE_3 - MENUITEM SEPARATOR - MENUITEM "Disable FM interpolation", MENU_INTERPOLATE_FM_0 - MENUITEM "4-point 3rd order FM interpolation", MENU_INTERPOLATE_FM_3 - MENUITEM SEPARATOR - POPUP "&Sound logging" - BEGIN - MENUITEM "Log to file...", MENU_WLOGSTART, GRAYED - MENUITEM "Stop logging", MENU_WLOGEND, GRAYED - END - MENUITEM "Buffer size...", MENU_FRAMES - END - POPUP "Input" - BEGIN - POPUP "Select &plugin" - BEGIN - MENUITEM "DirectInput", MENU_INP_PLUGIN_1, GRAYED - END - MENUITEM SEPARATOR - POPUP "&Auto-Fire Rate" - BEGIN - MENUITEM "Slow", MENU_INPUT_AUTOFIRE_RATE_1 - MENUITEM "Medium", MENU_INPUT_AUTOFIRE_RATE_2 - MENUITEM "Fast", MENU_INPUT_AUTOFIRE_RATE_3 - MENUITEM "Very Fast", MENU_INPUT_AUTOFIRE_RATE_4 - END - MENUITEM SEPARATOR - MENUITEM "Map game inputs...\tF5", MENU_INPUT, GRAYED - MENUITEM "Set dipswitches...\tCtrl+F5", MENU_DIPSW, GRAYED - END - POPUP "Misc" - BEGIN - POPUP "Options" - BEGIN - MENUITEM "Auto pause", MENU_AUTOPAUSE - MENUITEM "Always process keyboard input", MENU_PROCESSINPUT, GRAYED - MENUITEM "Display mode indicator", MENU_DISPLAYINDICATOR - MENUITEM "Modeless menu", MENU_MODELESS - MENUITEM "Don't change Num Lock status", MENU_NOCHANGENUMLOCK - MENUITEM "Create support folders at runtime", MENU_CREATEDIRS - MENUITEM SEPARATOR - POPUP "Set application thread priority" - BEGIN -// MENUITEM "Realtime", MENU_PRIORITY_REALTIME - MENUITEM "High", MENU_PRIORITY_HIGH - MENUITEM "Above normal", MENU_PRIORITY_ABOVE_NORMAL - MENUITEM "Normal", MENU_PRIORITY_NORMAL - MENUITEM "Below normal", MENU_PRIORITY_BELOW_NORMAL - MENUITEM "Low", MENU_PRIORITY_LOW - END - MENUITEM SEPARATOR -#ifdef BUILD_A68K - MENUITEM "Use assembly MC68000 core (this session only)", MENU_ASSEMBLYCORE - MENUITEM SEPARATOR -#endif - MENUITEM "Save High Scores when supported", MENU_SAVEHISCORES - MENUITEM "Use alpha blend effects when supported", MENU_USEBLEND - MENUITEM "Display Gear-Shift Indicator when supported", MENU_GEARSHIFT -#ifdef INCLUDE_AVI_RECORDING - POPUP "AVI Writer Output size" - BEGIN - MENUITEM "1x", MENU_AVI1X - MENUITEM "2x", MENU_AVI2X - MENUITEM "3x", MENU_AVI3X - END -#endif - END - MENUITEM SEPARATOR - POPUP "Generate dat file" - BEGIN - MENUITEM "Generate dat (Arcade only)...", MENU_CLRMAME_PRO_XML - MENUITEM "Generate dat (Megadrive only)...", MENU_CLRMAME_PRO_XML_MD_ONLY - MENUITEM "Generate dat (PC-Engine only)...", MENU_CLRMAME_PRO_XML_PCE_ONLY - MENUITEM "Generate dat (TurboGrafx16 only)...", MENU_CLRMAME_PRO_XML_TG16_ONLY - MENUITEM "Generate dat (SuprGrafx only)...", MENU_CLRMAME_PRO_XML_SGX_ONLY - MENUITEM "Generate dat (Sega SG-1000 only)...", MENU_CLRMAME_PRO_XML_SG1000_ONLY - MENUITEM "Generate dat (ColecoVision only)...", MENU_CLRMAME_PRO_XML_COLECO_ONLY - MENUITEM "Generate dat (Master System only)...", MENU_CLRMAME_PRO_XML_SMS_ONLY - MENUITEM "Generate dat (Game Gear only)...", MENU_CLRMAME_PRO_XML_GG_ONLY - MENUITEM "Generate dat (MSX 1 Games only)...", MENU_CLRMAME_PRO_XML_MSX_ONLY - MENUITEM SEPARATOR - MENUITEM "Generate all dats...", MENU_CLRMAME_PRO_ALL_DATS - END - MENUITEM SEPARATOR - MENUITEM "Configure ROM paths...", MENU_ROMDIRS - MENUITEM "Configure support file paths...", MENU_SUPPORTDIRS - MENUITEM SEPARATOR - POPUP "UI language" - BEGIN - MENUITEM "Select UI language...", MENU_LANGUAGE_SELECT - MENUITEM "Export UI translation template...", MENU_LANGUAGE_EXPORT - MENUITEM "Reset UI default language", MENU_LANGUAGE_RESET - MENUITEM "Download UI language...", MENU_LANGUAGE_DOWNLOAD - END - POPUP "Gamelist language" - BEGIN - MENUITEM "Select gamelist language...", MENU_LANGUAGE_GL_SELECT - MENUITEM "Export gamelist translation template...", MENU_LANGUAGE_GL_EXPORT - MENUITEM "Reset gamelist default language", MENU_LANGUAGE_GL_RESET - END - MENUITEM SEPARATOR - POPUP "Icons" - BEGIN - MENUITEM "Enable driver icons display", MENU_ENABLEICONS - POPUP "Icon size" - BEGIN - MENUITEM "16 x 16 pixels", MENU_ICONS_SIZE_16 - MENUITEM "24 x 24 pixels", MENU_ICONS_SIZE_24 - MENUITEM "32 x 32 pixels", MENU_ICONS_SIZE_32 - END - END - MENUITEM SEPARATOR - MENUITEM "Save snapshot\tF12", MENU_SAVESNAP - MENUITEM "Shot factory..\tCtrl+F12", MENU_SNAPFACT - MENUITEM SEPARATOR - MENUITEM "Enable cheats...\tCtrl+F1", MENU_ENABLECHEAT, GRAYED - POPUP "Cheat search" - BEGIN - MENUITEM "Start New Search\tCtrl+Home", MENU_CHEATSEARCH_START, GRAYED - MENUITEM SEPARATOR - MENUITEM "Target value has not changed\tCtrl+/", MENU_CHEATSEARCH_NOCHANGE, GRAYED - MENUITEM "Target value has changed\tCtrl+*", MENU_CHEATSEARCH_CHANGE, GRAYED - MENUITEM "Target value has decreased\tCtrl+-", MENU_CHEATSEARCH_DECREASE, GRAYED - MENUITEM "Target value has increased\tCtrl++", MENU_CHEATSEARCH_INCREASE, GRAYED - MENUITEM SEPARATOR - MENUITEM "Dump search to file", MENU_CHEATSEARCH_DUMPFILE, GRAYED - MENUITEM SEPARATOR - MENUITEM "Exit Cheat Search", MENU_CHEATSEARCH_EXIT, GRAYED - END - MENUITEM SEPARATOR - MENUITEM "Invoke 68K debugger...\tCtrl+Shift+F1", MENU_DEBUG - MENUITEM SEPARATOR - MENUITEM "Palette Viewer...\tCtrl+Shift+F5", MENU_PALETTEVIEWER, GRAYED - MENUITEM SEPARATOR - MENUITEM "Associate with .fs and .fr files", MENU_ASSOCIATE - MENUITEM "Disassociate from .fs and .fr files", MENU_DISASSOCIATE - MENUITEM SEPARATOR - MENUITEM "Save input mapping now", MENU_SAVEGAMEINPUTNOW - MENUITEM "Auto-save input mapping", MENU_SAVEGAMEINPUT - MENUITEM SEPARATOR - MENUITEM "Save settings to .ini now", MENU_SAVESET - MENUITEM "Reload settings from .ini", MENU_LOADSET - END - POPUP "Help" - BEGIN - MENUITEM "&Help", MENU_CONTENTS - MENUITEM SEPARATOR - MENUITEM "&What's New", MENU_WHATSNEW - MENUITEM SEPARATOR - MENUITEM "&FB Alpha homepage", MENU_WWW_HOME - MENUITEM "&Neo-Source forums", MENU_WWW_NSFORUM - MENUITEM SEPARATOR - MENUITEM "&System information", MENU_SYSINFO - MENUITEM "&About FB Alpha", MENU_ABOUT - END -END - -IDR_MENU_BLITTER_1 MENU -BEGIN - POPUP "Basic\t(DirectDraw 7)" - BEGIN - MENUITEM "&No effects", MENU_BASIC_NORMAL - MENUITEM "&Scanlines", MENU_BASIC_SCAN - MENUITEM "Scanlines &50%", MENU_SCAN50 - MENUITEM SEPARATOR - MENUITEM "&Rotate scanlines", MENU_BASIC_ROTSCAN - MENUITEM SEPARATOR - MENUITEM "Force &Flip", MENU_FORCE_FLIP - MENUITEM SEPARATOR - POPUP "Buffering &method" - BEGIN - MENUITEM "&Autodetect", MENU_BASIC_MEMAUTO - MENUITEM "&Video memory", MENU_BASIC_VIDEOMEM - MENUITEM "&System memory", MENU_BASIC_SYSMEM - END - END -END - -IDR_MENU_BLITTER_2 MENU -BEGIN - POPUP "Enhanced\t(Direct3D 7)" - BEGIN - MENUITEM "Disable all effects", MENU_DISABLEFX - MENUITEM SEPARATOR - MENUITEM "Enable &bi-linear filtering", MENU_BILINEAR - MENUITEM "&Rotate scanlines and RGB effects", MENU_ENHANCED_ROTSCAN - MENUITEM SEPARATOR - MENUITEM "Enable &Pre-scale", MENU_PRESCALE - MENUITEM "Pre-scale using Soft&FX", MENU_SOFTFX - POPUP "SoftFX algorithm" - BEGIN - MENUITEM "Double pixels (3D hardware)", MENU_ENHANCED_SOFT_STRETCH - MENUITEM "AdvanceMAME Scale2x", MENU_ENHANCED_SOFT_SCALE2X - MENUITEM "AdvanceMAME Scale3x", MENU_ENHANCED_SOFT_SCALE3X - MENUITEM "2xPM LQ", MENU_ENHANCED_SOFT_2XPM_LQ - MENUITEM "2xPM HQ", MENU_ENHANCED_SOFT_2XPM_HQ - MENUITEM "Eagle Graphics", MENU_ENHANCED_SOFT_EAGLE - MENUITEM "Super Eagle", MENU_ENHANCED_SOFT_SUPEREAGLE - MENUITEM "2xSaI", MENU_ENHANCED_SOFT_2XSAI - MENUITEM "Super 2xSaI", MENU_ENHANCED_SOFT_SUPER2XSAI - MENUITEM "Super Eagle (VBA)", MENU_ENHANCED_SOFT_SUPEREAGLE_VBA - MENUITEM "2xSaI (VBA)", MENU_ENHANCED_SOFT_2XSAI_VBA - MENUITEM "Super 2xSaI (VBA)", MENU_ENHANCED_SOFT_SUPER2XSAI_VBA - MENUITEM "SuperScale", MENU_ENHANCED_SOFT_SUPERSCALE - MENUITEM "SuperScale (75% Scanlines)", MENU_ENHANCED_SOFT_SUPERSCALE75 - MENUITEM "hq2x Filter", MENU_ENHANCED_SOFT_HQ2X - MENUITEM "hq3x Filter", MENU_ENHANCED_SOFT_HQ3X - MENUITEM "hq4x Filter", MENU_ENHANCED_SOFT_HQ4X - MENUITEM "hq2xS (VBA) Filter", MENU_ENHANCED_SOFT_HQ2XS_VBA - MENUITEM "hq3xS (VBA) Filter", MENU_ENHANCED_SOFT_HQ3XS_VBA, GRAYED - MENUITEM "hq2xS (SNES9X) Filter", MENU_ENHANCED_SOFT_HQ2XS_SNES9X - MENUITEM "hq3xS (SNEX9X) Filter", MENU_ENHANCED_SOFT_HQ3XS_SNES9X - MENUITEM "hq2xBold Filter", MENU_ENHANCED_SOFT_HQ2XBOLD - MENUITEM "hq3xBold Filter", MENU_ENHANCED_SOFT_HQ3XBOLD - MENUITEM "EPXB Filter", MENU_ENHANCED_SOFT_EPXB - MENUITEM "EPXC Filter", MENU_ENHANCED_SOFT_EPXC - MENUITEM "2xBR Squared", MENU_ENHANCED_SOFT_2XBR_A - MENUITEM "2xBR Semi-Rounded", MENU_ENHANCED_SOFT_2XBR_B - MENUITEM "2xBR Rounded", MENU_ENHANCED_SOFT_2XBR_C - MENUITEM "3xBR Squared", MENU_ENHANCED_SOFT_3XBR_A - MENUITEM "3xBR Semi-Rounded", MENU_ENHANCED_SOFT_3XBR_B - MENUITEM "3xBR Rounded", MENU_ENHANCED_SOFT_3XBR_C - MENUITEM "4xBR Squared", MENU_ENHANCED_SOFT_4XBR_A - MENUITEM "4xBR Semi-Rounded", MENU_ENHANCED_SOFT_4XBR_B - MENUITEM "4xBR Rounded", MENU_ENHANCED_SOFT_4XBR_C - MENUITEM "DDT3x", MENU_ENHANCED_SOFT_DDT3X - MENUITEM SEPARATOR - MENUITEM "Force image to SoftFX size", MENU_ENHANCED_SOFT_AUTOSIZE - END - MENUITEM SEPARATOR - MENUITEM "Enable &Scanlines", MENU_ENHANCED_SCAN - MENUITEM "Set scanline &intensity...", MENU_ENHANCED_SCANINTENSITY - MENUITEM SEPARATOR - MENUITEM "Enable phosphor &feedback", MENU_PHOSPHOR - MENUITEM "Set &phosphor feedback intensity...", MENU_PHOSPHORINTENSITY - MENUITEM SEPARATOR - MENUITEM "&No effects", MENU_ENHANCED_NORMAL - MENUITEM "RGB &effects", MENU_RGBEFFECTS - MENUITEM "&3D projection", MENU_3DPROJECTION - MENUITEM SEPARATOR - MENUITEM "&Auto size scanlined RGB preset", MENU_EFFECT_AUTO - POPUP "Manually select RGB preset" - BEGIN - MENUITEM "Small faint RGB mask", MENU_EFFECT_01 - MENUITEM "Large faint RGB dot mask", MENU_EFFECT_02 - MENUITEM "Large faint RGB mask", MENU_EFFECT_03 - MENUITEM SEPARATOR - MENUITEM "MAME rgbmicro", MENU_EFFECT_04 - MENUITEM "MAME rgbtiny", MENU_EFFECT_05 - MENUITEM "Aperture grille", MENU_EFFECT_06 - MENUITEM SEPARATOR - MENUITEM "Large oversaturated RGB dot", MENU_EFFECT_07 - MENUITEM "Huge oversaturated pattern", MENU_EFFECT_08 - END - MENUITEM SEPARATOR - MENUITEM "Set 3&D projection properties...", MENU_3DSCREENANGLE -// MENUITEM "Enable &lighting", MENU_3DUSELIGHTING - MENUITEM SEPARATOR - POPUP "Advanced settings" - BEGIN - MENUITEM "Force &16-bit emulation", MENU_FORCE_16BIT - MENUITEM "Use DirectX texture &management", MENU_TEXTUREMANAGE - END - END -END - -IDR_MENU_BLITTER_3 MENU -BEGIN - POPUP "SoftFX\t(DirectDraw 7)" - BEGIN - MENUITEM "&Double pixels (Software)", MENU_SOFTFX_SOFT_STRETCH - MENUITEM "AdvanceMAME Scale2x\t(16/32-bit only)", MENU_SOFTFX_SOFT_SCALE2X - MENUITEM "AdvanceMAME Scale3x\t(16/32-bit only)", MENU_SOFTFX_SOFT_SCALE3X - MENUITEM "2xPM LQ\t(15/16-bit only)", MENU_SOFTFX_SOFT_2XPM_LQ - MENUITEM "2xPM HQ\t(15/16-bit only)", MENU_SOFTFX_SOFT_2XPM_HQ - MENUITEM "Eagle Graphics\t(16-bit only)", MENU_SOFTFX_SOFT_EAGLE - MENUITEM "Super Eagle\t(15/16-bit only)", MENU_SOFTFX_SOFT_SUPEREAGLE - MENUITEM "2xSaI\t(15/16-bit only)", MENU_SOFTFX_SOFT_2XSAI - MENUITEM "Super 2xSaI\t(15/16-bit only)", MENU_SOFTFX_SOFT_SUPER2XSAI - MENUITEM "Super Eagle (VBA)\t(15/16/32-bit only)", MENU_SOFTFX_SOFT_SUPEREAGLE_VBA - MENUITEM "2xSaI (VBA)\t(15/16/32-bit only)", MENU_SOFTFX_SOFT_2XSAI_VBA - MENUITEM "Super 2xSaI (VBA)\t(15/16/32-bit only)", MENU_SOFTFX_SOFT_SUPER2XSAI_VBA - MENUITEM "SuperScale\t(15/16-bit only)", MENU_SOFTFX_SOFT_SUPERSCALE - MENUITEM "SuperScale (75% Scanlines)\t(15/16-bit only)",MENU_SOFTFX_SOFT_SUPERSCALE75 - MENUITEM "hq2x filter\t(32-bit only)", MENU_SOFTFX_SOFT_HQ2X - MENUITEM "hq3x filter\t(32-bit only)", MENU_SOFTFX_SOFT_HQ3X - MENUITEM "hq4x filter\t(32-bit only)", MENU_SOFTFX_SOFT_HQ4X - MENUITEM "hq2xS (VBA) filter\t(16/32-bit only)", MENU_SOFTFX_SOFT_HQ2XS_VBA - MENUITEM "hq3xS (VBA) filter\t(16/32-bit only)", MENU_SOFTFX_SOFT_HQ3XS_VBA, GRAYED - MENUITEM "hq2xS (SNES9X) Filter\t(16-bit only)", MENU_SOFTFX_SOFT_HQ2XS_SNES9X - MENUITEM "hq3xS (SNEX9X) Filter\t(16-bit only)", MENU_SOFTFX_SOFT_HQ3XS_SNES9X - MENUITEM "hq2xBold Filter\t(16-bit only)", MENU_SOFTFX_SOFT_HQ2XBOLD - MENUITEM "hq3xBold Filter\t(16-bit only)", MENU_SOFTFX_SOFT_HQ3XBOLD - MENUITEM "EPXB Filter\t(16-bit only)", MENU_SOFTFX_SOFT_EPXB - MENUITEM "EPXC Filter\t(16-bit only)", MENU_SOFTFX_SOFT_EPXC - MENUITEM "2xBR Squared\t(16-bit only)", MENU_SOFTFX_SOFT_2XBR_A - MENUITEM "2xBR Semi-Rounded\t(16-bit only)", MENU_SOFTFX_SOFT_2XBR_B - MENUITEM "2xBR Rounded\t(16-bit only)", MENU_SOFTFX_SOFT_2XBR_C - MENUITEM "3xBR Squared\t(16-bit only)", MENU_SOFTFX_SOFT_3XBR_A - MENUITEM "3xBR Semi-Rounded\t(16-bit only)", MENU_SOFTFX_SOFT_3XBR_B - MENUITEM "3xBR Rounded\t(16-bit only)", MENU_SOFTFX_SOFT_3XBR_C - MENUITEM "4xBR Squared\t(16-bit only)", MENU_SOFTFX_SOFT_4XBR_A - MENUITEM "4xBR Semi-Rounded\t(16-bit only)", MENU_SOFTFX_SOFT_4XBR_B - MENUITEM "4xBR Rounded\t(16-bit only)", MENU_SOFTFX_SOFT_4XBR_C - MENUITEM "DDT3x\t(16-bit only)", MENU_SOFTFX_SOFT_DDT3X - MENUITEM SEPARATOR - MENUITEM "&Force image to SoftFX size", MENU_SOFTFX_SOFT_AUTOSIZE - POPUP "Buffering &method" - BEGIN - MENUITEM "&Autodetect", MENU_SOFTFX_MEMAUTO - MENUITEM "&Video memory", MENU_SOFTFX_VIDEOMEM - MENUITEM "&System memory", MENU_SOFTFX_SYSMEM - MENUITEM SEPARATOR - MENUITEM "Directly access video memory", MENU_SOFT_DIRECTACCESS - END - END -END -IDR_MENU_BLITTER_4 MENU -BEGIN - POPUP "Experimental\t(DirectX Graphics 9)" - BEGIN - MENUITEM "Enable point filtering", MENU_DX9_POINT - MENUITEM "Enable linear filtering", MENU_DX9_LINEAR - MENUITEM "Enable cubic filtering", MENU_DX9_CUBIC - POPUP "Cubic filter quality" - BEGIN - MENUITEM "Lightly filtered\tTensioned B-spline", MENU_DX9_CUBIC_LIGHT - MENUITEM SEPARATOR - MENUITEM "Smoothened strongly\tMitchell-Netravali notch", MENU_DX9_CUBIC_NOTCH - MENUITEM "Smoothened lightly\tCubic B-spline", MENU_DX9_CUBIC_BSPLINE - MENUITEM "Perceptual compromise\tMitchell-Netravali", MENU_DX9_CUBIC_OPTIMAL - MENUITEM "Sharpened lightly\tCatmull-Rom spline", MENU_DX9_CUBIC_CATMULL - MENUITEM "Sharpened strongly\tCardinal cubic spline", MENU_DX9_CUBIC_SHARP - MENUITEM SEPARATOR - MENUITEM "Duff's tensioned B-splines...", MENU_DX9_CUBIC_DUFF, GRAYED - MENUITEM "Mitchell-Netravali 2C + B = 1...", MENU_DX9_CUBIC_MITCHELL, GRAYED - MENUITEM "Cardinal cubic splines...", MENU_DX9_CUBIC_CARDINAL, GRAYED - MENUITEM "Mitchell-Netravali free...", MENU_DX9_CUBIC_CUSTOM, GRAYED - END - MENUITEM SEPARATOR - MENUITEM "Enable &Scanlines", MENU_EXP_SCAN - MENUITEM "Set scanline &intensity...", MENU_EXP_SCANINTENSITY - MENUITEM SEPARATOR - POPUP "Advanced settings" - BEGIN -// MENUITEM "Single-pass reference implementation", MENU_DX9_CUBIC0 -// MENUITEM "Single-pass partial precision implementation", MENU_DX9_CUBIC1 -// MENUITEM "Multi-pass full precision implementation", MENU_DX9_CUBIC2 -// MENUITEM "Multi-pass partial precision implementation", MENU_DX9_CUBIC3 -// MENUITEM "Multi-pass high-performance implementation", MENU_DX9_CUBIC4 - MENUITEM "Single-pass\tRadeon GPUs", MENU_DX9_CUBIC1 - MENUITEM "Multi-pass\tGeforce GPUs", MENU_DX9_CUBIC3 - MENUITEM "High-performance", MENU_DX9_CUBIC4 - MENUITEM SEPARATOR - MENUITEM "Use PS1.4", MENU_DX9_FORCE_PS14, GRAYED - MENUITEM "Use floating-point textures", MENU_DX9_FPTERXTURES, GRAYED - END - END -END - -IDR_MENU_BLITTER_5 MENU -BEGIN - POPUP "DirectX9 Alt\t(DirectX 9)" - BEGIN - MENUITEM "Point filtering", MENU_DX9_ALT_POINT - MENUITEM "Linear filtering", MENU_DX9_ALT_LINEAR - MENUITEM SEPARATOR - POPUP "SoftFX algorithm" - BEGIN - MENUITEM "Double pixels (3D hardware)", MENU_DX9_ALT_SOFT_STRETCH - MENUITEM "AdvanceMAME Scale2x", MENU_DX9_ALT_SOFT_SCALE2X - MENUITEM "AdvanceMAME Scale3x", MENU_DX9_ALT_SOFT_SCALE3X - MENUITEM "2xPM LQ", MENU_DX9_ALT_SOFT_2XPM_LQ - MENUITEM "2xPM HQ", MENU_DX9_ALT_SOFT_2XPM_HQ - MENUITEM "Eagle Graphics", MENU_DX9_ALT_SOFT_EAGLE - MENUITEM "Super Eagle", MENU_DX9_ALT_SOFT_SUPEREAGLE - MENUITEM "2xSaI", MENU_DX9_ALT_SOFT_2XSAI - MENUITEM "Super 2xSaI", MENU_DX9_ALT_SOFT_SUPER2XSAI - MENUITEM "Super Eagle (VBA)", MENU_DX9_ALT_SOFT_SUPEREAGLE_VBA - MENUITEM "2xSaI (VBA)", MENU_DX9_ALT_SOFT_2XSAI_VBA - MENUITEM "Super 2xSaI (VBA)", MENU_DX9_ALT_SOFT_SUPER2XSAI_VBA - MENUITEM "SuperScale", MENU_DX9_ALT_SOFT_SUPERSCALE - MENUITEM "SuperScale (75% Scanlines)", MENU_DX9_ALT_SOFT_SUPERSCALE75 - MENUITEM "hq2x Filter", MENU_DX9_ALT_SOFT_HQ2X - MENUITEM "hq3x Filter", MENU_DX9_ALT_SOFT_HQ3X - MENUITEM "hq4x Filter", MENU_DX9_ALT_SOFT_HQ4X - MENUITEM "hq2xS (VBA) Filter", MENU_DX9_ALT_SOFT_HQ2XS_VBA - MENUITEM "hq3xS (VBA) Filter", MENU_DX9_ALT_SOFT_HQ3XS_VBA, GRAYED - MENUITEM "hq2xS (SNES9X) Filter", MENU_DX9_ALT_SOFT_HQ2XS_SNES9X - MENUITEM "hq3xS (SNEX9X) Filter", MENU_DX9_ALT_SOFT_HQ3XS_SNES9X - MENUITEM "hq2xBold Filter", MENU_DX9_ALT_SOFT_HQ2XBOLD - MENUITEM "hq3xBold Filter", MENU_DX9_ALT_SOFT_HQ3XBOLD - MENUITEM "EPXB Filter", MENU_DX9_ALT_SOFT_EPXB - MENUITEM "EPXC Filter", MENU_DX9_ALT_SOFT_EPXC - MENUITEM "2xBR Squared", MENU_DX9_ALT_SOFT_2XBR_A - MENUITEM "2xBR Semi-Rounded", MENU_DX9_ALT_SOFT_2XBR_B - MENUITEM "2xBR Rounded", MENU_DX9_ALT_SOFT_2XBR_C - MENUITEM "3xBR Squared", MENU_DX9_ALT_SOFT_3XBR_A - MENUITEM "3xBR Semi-Rounded", MENU_DX9_ALT_SOFT_3XBR_B - MENUITEM "3xBR Rounded", MENU_DX9_ALT_SOFT_3XBR_C - MENUITEM "4xBR Squared", MENU_DX9_ALT_SOFT_4XBR_A - MENUITEM "4xBR Semi-Rounded", MENU_DX9_ALT_SOFT_4XBR_B - MENUITEM "4xBR Rounded", MENU_DX9_ALT_SOFT_4XBR_C - MENUITEM "DDT3x", MENU_DX9_ALT_SOFT_DDT3X - MENUITEM SEPARATOR - MENUITEM "Force image to SoftFX size", MENU_DX9_ALT_SOFT_AUTOSIZE - END - MENUITEM SEPARATOR - POPUP "Advanced settings" - BEGIN - MENUITEM "Force &16-bit emulation", MENU_DX9_ALT_FORCE_16BIT - MENUITEM "Hardware vertex processing", MENU_DX9_ALT_HARDWAREVERTEX - MENUITEM "Motion blur", MENU_DX9_ALT_MOTIONBLUR - END - END -END - -IDR_MENU_AUD_PLUGIN_1 MENU -BEGIN - POPUP "DirectSound plugin" - BEGIN - MENUITEM "Use Low-pass filter", MENU_DSOUND_BASS - MENUITEM SEPARATOR - MENUITEM "Sound disabled", MENU_DSOUND_NOSOUND - MENUITEM "11025Hz samplerate", MENU_DSOUND_11025 - MENUITEM "22050Hz samplerate", MENU_DSOUND_22050 - MENUITEM "44100Hz samplerate", MENU_DSOUND_44100 - MENUITEM "48000Hz samplerate", MENU_DSOUND_48000 - END -END - -IDR_MENU_AUD_PLUGIN_2 MENU -BEGIN - POPUP "XAudio2 plugin" - BEGIN - MENUITEM "Use Low-pass filter", MENU_XAUDIO_BASS - MENUITEM "Use reverb", MENU_XAUDIO_REVERB - MENUITEM SEPARATOR - MENUITEM "Sound disabled", MENU_XAUDIO_NOSOUND - MENUITEM "11025Hz samplerate", MENU_XAUDIO_11025 - MENUITEM "22050Hz samplerate", MENU_XAUDIO_22050 - MENUITEM "44100Hz samplerate", MENU_XAUDIO_44100 - MENUITEM "48000Hz samplerate", MENU_XAUDIO_48000 - END -END - -IDR_MENU_GAMESEL MENU -BEGIN - POPUP "Game Selection Menu" - BEGIN - MENUITEM "Play", GAMESEL_MENU_PLAY - MENUITEM SEPARATOR - MENUITEM "View Game Information", GAMESEL_MENU_GAMEINFO - MENUITEM SEPARATOR - MENUITEM "View in Progetto EMMA", GAMESEL_MENU_VIEWEMMA - MENUITEM SEPARATOR - MENUITEM "Favorite", GAMESEL_MENU_FAVORITE - END -END - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -BMP_SPLASH BITMAP DISCARDABLE "resource/splash.bmp" -BMP_ABOUT BITMAP DISCARDABLE "resource/about.bmp" -BMP_MISC BITMAP DISCARDABLE "resource/misc.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_ACCELERATOR ACCELERATORS DISCARDABLE -BEGIN - VK_F1, MENU_ENABLECHEAT, CONTROL, VIRTKEY, NOINVERT - VK_F1, MENU_DEBUG, CONTROL, SHIFT, VIRTKEY, NOINVERT - VK_F4, MENU_QUIT, CONTROL, VIRTKEY, NOINVERT - VK_F5, MENU_INPUT, VIRTKEY, NOINVERT - VK_F5, MENU_DIPSW, CONTROL, VIRTKEY, NOINVERT - VK_F5, MENU_PALETTEVIEWER, CONTROL, SHIFT, VIRTKEY, NOINVERT - VK_F6, MENU_LOAD, VIRTKEY, NOINVERT - VK_F6, MENU_START_NEOGEO_MVS, CONTROL, VIRTKEY, NOINVERT - VK_F6, MENU_START_NEOGEO_CD, CONTROL, SHIFT, VIRTKEY, NOINVERT - VK_F7, MENU_MEMCARD_TOGGLE, VIRTKEY, NOINVERT - VK_F7, MENU_MEMCARD_CREATE, CONTROL, SHIFT, VIRTKEY, NOINVERT - VK_F7, MENU_MEMCARD_SELECT, CONTROL, VIRTKEY, NOINVERT - VK_F8, MENU_STATE_PREVSLOT, VIRTKEY, NOINVERT - VK_F8, MENU_LOAD_NEOCD, CONTROL, VIRTKEY, NOINVERT - VK_F8, MENU_STATE_UNDO, SHIFT, VIRTKEY, NOINVERT - VK_F9, MENU_STATE_LOAD_SLOT, VIRTKEY, NOINVERT - VK_F9, MENU_STATE_LOAD_DIALOG, CONTROL, VIRTKEY, NOINVERT - VK_F10, MENU_STATE_SAVE_SLOT, VIRTKEY, NOINVERT - VK_F10, MENU_STATE_SAVE_DIALOG, CONTROL, VIRTKEY, NOINVERT - VK_F11, MENU_STATE_NEXTSLOT, VIRTKEY, NOINVERT - VK_F12, MENU_SAVESNAP, VIRTKEY, NOINVERT - VK_F12, MENU_SNAPFACT, CONTROL, VIRTKEY, NOINVERT - VK_F12, MENU_CDIMAGE, CONTROL, SHIFT, VIRTKEY, NOINVERT - VK_PAUSE, MENU_PAUSE, VIRTKEY, NOINVERT - VK_RETURN, MENU_FULL, ALT, VIRTKEY, NOINVERT - VK_HOME, MENU_CHEATSEARCH_START, CONTROL, VIRTKEY, NOINVERT - VK_DIVIDE, MENU_CHEATSEARCH_NOCHANGE, CONTROL, VIRTKEY, NOINVERT - VK_MULTIPLY, MENU_CHEATSEARCH_CHANGE, CONTROL, VIRTKEY, NOINVERT - VK_SUBTRACT, MENU_CHEATSEARCH_DECREASE, CONTROL, VIRTKEY, NOINVERT - VK_ADD, MENU_CHEATSEARCH_INCREASE, CONTROL, VIRTKEY, NOINVERT - "W", MENU_QUIT, CONTROL, VIRTKEY, NOINVERT -END - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_APP ICON DISCARDABLE "resource/fba.ico" -IDI_TV_PLUS ICON DISCARDABLE "resource/TV Plus.ico" -IDI_TV_MINUS ICON DISCARDABLE "resource/TV Minus.ico" -IDI_TV_NOTWORKING ICON DISCARDABLE "resource/TV Not Working.ico" -IDI_TV_NOTFOUND_ESS ICON DISCARDABLE "resource/TV Not Found.ico" -IDI_TV_NOTFOUND_NON ICON DISCARDABLE "resource/TV Not Found Non Essential.ico" - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/jan/src/burner/win32/avi.cpp b/jan/src/burner/win32/avi.cpp deleted file mode 100644 index 8c99c5918..000000000 --- a/jan/src/burner/win32/avi.cpp +++ /dev/null @@ -1,837 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// -// This code has been modified to work with FinalBurn Alpha. -// -//--------------------------------------------------------------------------- -// -// AVI Recorder for FBA version 0.7 by Gangta -// - massive re-work by dink in fall 2015 - -// -// Limitations: -// -// - Supported bitdepths are 15, 16, 24, and 32. -// -// - Avi will be recorded at original game resolution w/1x, 2x, 3x pixels. -// -// - Video effects will not be recorded. -// (i.e. stretch, scanline, 3D effects, software effects) -// -// - Audio compression is not supported. -// -//--------------------------------------------------------------------------- -// -// Version History: -// -// 0.9 - Added 1x, 2x, 3x (selectable w/nAvi3x) pixel recording. -dink -// -// 0.8 - Automatically split the video before the 2gig mark, to prevent -// corruption of the video. -dink -// -// 0.7 - completely re-worked the image-conversion process, using -// burner/sshot.cpp as an example. as a result of this: -// + source data is now supplied to the encoder at 32bpp -// + fixes some crash issues in the previous 24bpp convertor when -// the source data is 16bpp or the blitter being forced to 16bit mode -// + fixes the skew problem when lines weren't a multiple of 4 -// -// 0.6 - added flipped screen support, fixed a bunch of bugs -// added to FBAlpha 2.97.37 -// -// 0.5 - fixed a minor bug regarding video stream header -// (some applications chose wrong decompressor while opening avi) -// -// 0.4 - fixed avi video/audio desync in cave games -// -// 0.3 - fixed the garbled bottom line in resulting avi -// -// 0.2 - interleaved audio -// - fixed rotation -// - fixed 24-bit mode -// - cleaned up some comments, re-wrote some codes -// -// 0.1 - initial release -// -//--------------------------------------------------------------------------- -// -// Credits: -// -// - FBA Team (http://fba.emuunlim.com) -// -// for helping development and making cygwin build possible -// -// - VBA Team (http://vboy.emuhq.com) -// -// part of this code is incorporated from VBA source -// -// - {Gambit} -// -// for testing and reporting bugs -// -///////////////////////////////////////////////////////////////////////////// - -#include "burner.h" -#define AVI_DEBUG -#ifdef _MSC_VER - #include // use the headers from MS Platform SDK -#endif -#ifdef __GNUC__ - #include "vfw.h" // use the modified idheaders included in the src -#endif - -// defines -#define FBAVI_VFW_INIT 0x0001 // avi file library initialized -#define FBAVI_VID_SET 0x0002 // avi video compression set -#define FBAVI_AUD_SET 0x0004 // avi audio compression set (not used for now) - -#define TAVI_DIRECTORY ".\\avi\\" - -INT32 nAviStatus = 0; // 1 (recording started), 0 (recording stopped) -INT32 nAviIntAudio = 1; // 1 (interleave audio aka audio enabled), 0 (do not interleave aka disable audio) -INT32 nAvi3x = 0; // set 1 - 3 for 1x - 3x pixel expansion - -INT32 nAviSplit; // number of the split (@2gig) video -COMPVARS compvarsave; // compression options, for split -char szAviFileName[MAX_PATH]; - -static INT32 nAviFlags = 0; - -static struct FBAVI { - PAVIFILE pFile; // avi file - // formats - BITMAPINFOHEADER bih; // video format - WAVEFORMATEX wfx; // audio format - // headers - AVISTREAMINFO vidh; // header for a single video stream - AVISTREAMINFO audh; // header for a single audio stream - // streams - PAVISTREAM psVid; // uncompressed video stream - PAVISTREAM psVidCompressed; // compressed video stream - PAVISTREAM psAud; // uncompressed audio stream - PAVISTREAM psAudCompressed; // compressed audio stream (not supported yet) - // compression options - COMPVARS compvar; // compression options - AVICOMPRESSOPTIONS opts; // compression options - // other - UINT32 nFrameNum; // frame number for each compressed frame - LONG nAviSize; // current bytes written, used to break up the avi @ the 2gig mark - INT32 nWidth; - INT32 nHeight; - UINT8 nLastDest; // number of the last pBitmapBuf# written to - for chaining effects - UINT8 *pBitmap; // pointer for buffer for bitmap - UINT8 *pBitmapBuf1; // buffer #1 - UINT8 *pBitmapBuf2; // buffer #2 (flippy, pBitmapBufX points to one of these depending on last effect used) -} FBAvi; - -// Opens an avi file for writing. -// Returns: 0 (successful), 1 (failed) -static INT32 AviCreateFile() -{ - HRESULT hRet; - - char szFilePath[MAX_PATH]; - time_t currentTime; - tm* tmTime; - - // Get the time - time(¤tTime); - tmTime = localtime(¤tTime); - - // construct our filename -> "romname-mm-dd-hms.avi" - - if (nAviSplit == 0) { // Create the filename @ the first file in our set - sprintf(szAviFileName, "%s%s-%.2d-%.2d-%.2d%.2d%.2d", TAVI_DIRECTORY, BurnDrvGetTextA(DRV_NAME), tmTime->tm_mon + 1, tmTime->tm_mday, tmTime->tm_hour, tmTime->tm_min, tmTime->tm_sec); - } - - // add the set# and extension to our file. - sprintf(szFilePath, "%s_%X.avi", szAviFileName, nAviSplit); - - hRet = AVIFileOpenA( - &FBAvi.pFile, // returned file pointer - szFilePath, // file path - OF_CREATE | OF_WRITE, // mode - NULL); // use handler determined from file extension - if (hRet) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: AVIFileOpen() failed.\n")); - switch (hRet) { - case AVIERR_BADFORMAT: - bprintf(0, _T("\t Cannot read file (corrupt file or unrecognized format).\n")); - break; - case AVIERR_MEMORY: - bprintf(0, _T("\t Cannot open file (insufficient memory).\n")); - break; - case AVIERR_FILEREAD: - bprintf(0, _T("\t Cannot read file (disk error).\n")); - break; - case AVIERR_FILEOPEN: - bprintf(0, _T("\t Cannot open file (disk error).\n")); - break; - case REGDB_E_CLASSNOTREG: - bprintf(0, _T("\t Windows registry does not have a handler for this file type (.avi).\n")); - break; - default: - bprintf(0, _T("\t Unknown error).\n")); - break; - } -#endif - return 1; - } - - return 0; -} - -// Make a 32bit Bitmap of the gamescreen and flip it depending on orientation. -static INT MakeSSBitmap() -{ - INT32 w = FBAvi.nWidth, h = FBAvi.nHeight; - UINT8 *pTemp = FBAvi.pBitmapBuf1; - UINT8* pSShot = NULL; - - if (pVidImage == NULL) { - return 1; // video buffer is empty - } - - pSShot = pVidImage; - - FBAvi.nLastDest = 1; - - // Convert the image to 32-bit - if (nVidImageBPP < 4) { - if (nVidImageBPP == 2) { - for (INT32 i = 0; i < h * w; i++) { - UINT16 nColour = ((UINT16*)pSShot)[i]; - - // Red - *(pTemp + i * 4 + 0) = (UINT8)((nColour & 0x1F) << 3); - *(pTemp + i * 4 + 0) |= *(pTemp + 4 * i + 0) >> 5; - - if (nVidImageDepth == 15) { - // Green - *(pTemp + i * 4 + 1) = (UINT8)(((nColour >> 5) & 0x1F) << 3); - *(pTemp + i * 4 + 1) |= *(pTemp + i * 4 + 1) >> 5; - // Blue - *(pTemp + i * 4 + 2) = (UINT8)(((nColour >> 10)& 0x1F) << 3); - *(pTemp + i * 4 + 2) |= *(pTemp + i * 4 + 2) >> 5; - } - - if (nVidImageDepth == 16) { - // Green - *(pTemp + i * 4 + 1) = (UINT8)(((nColour >> 5) & 0x3F) << 2); - *(pTemp + i * 4 + 1) |= *(pTemp + i * 4 + 1) >> 6; - // Blue - *(pTemp + i * 4 + 2) = (UINT8)(((nColour >> 11) & 0x1F) << 3); - *(pTemp + i * 4 + 2) |= *(pTemp + i * 4 + 2) >> 5; - } - } - } else { // 24-bit - memset(pTemp, 0, w * h * sizeof(INT32)); - for (INT32 i = 0; i < h * w; i++) { - *(pTemp + i * 4 + 0) = *(pSShot + i * 3 + 0); - *(pTemp + i * 4 + 1) = *(pSShot + i * 3 + 1); - *(pTemp + i * 4 + 2) = *(pSShot + i * 3 + 2); - } - } - - pSShot = pTemp; - FBAvi.pBitmap = FBAvi.pBitmapBuf1; - } else if (nVidImageBPP == 4) { - // source is 32bit already, just copy the buffer - memmove(pTemp, pVidImage, h * w * 4); - FBAvi.pBitmap = FBAvi.pBitmapBuf1; - pSShot = pTemp; - } else { - return 1; // unsupported BPP (unlikely) - } - - // Rotate and flip the image - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - pTemp = FBAvi.pBitmapBuf2; - - for (INT32 x = 0; x < h; x++) { - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - for (INT32 y = 0; y < w; y++) { - ((UINT32*)pTemp)[(w - y - 1) + x * w] = ((UINT32*)pSShot)[x + y * h]; - } - } else { - for (INT32 y = 0; y < w; y++) { - ((UINT32*)pTemp)[y + (h - x - 1) * w] = ((UINT32*)pSShot)[x + y * h]; - } - } - } - - FBAvi.pBitmap = FBAvi.pBitmapBuf2; - FBAvi.nLastDest = 2; - pSShot = pTemp; - } - else if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { // fixed rotation by regret - pTemp = FBAvi.pBitmapBuf2; - - for (INT32 y = h - 1; y >= 0; y--) { - for (INT32 x = w - 1; x >= 0; x--) { - ((UINT32*)pTemp)[(w - x - 1) + (h - y - 1) * w] = ((UINT32*)pSShot)[x + y * w]; - } - } - - FBAvi.pBitmap = FBAvi.pBitmapBuf2; - FBAvi.nLastDest = 2; - pSShot = pTemp; - } - - return 0; // success! -} - -#define aviBPP 4 // BYTES per pixel - -// Flips the image the way the encoder expects it to be -static INT32 MakeBitmapFlippedForEncoder() -{ - INT32 nWidth = FBAvi.nWidth; - INT32 nHeight = FBAvi.nHeight; - UINT8 *pDest = (FBAvi.nLastDest == 2) ? FBAvi.pBitmapBuf1 : FBAvi.pBitmapBuf2; - UINT8 *pSrc = (FBAvi.nLastDest == 2) ? FBAvi.pBitmapBuf2 : FBAvi.pBitmapBuf1; - FBAvi.pBitmap = pDest; - - UINT8 *pxl = pSrc + (nWidth*(nHeight-1)<<2); - - for (INT32 h = nHeight-1; h >- 1; h--) { - for (INT32 w = nWidth-1; w>-1; w--) { - memcpy(pDest, pxl, 4); // just copy 24 bits straight into bitmap - pDest += 4; // next pixel (dest) - pxl += 4; // next pixel (src) - } - pxl -= nWidth<<3; // go to next line up - } - - FBAvi.nLastDest = (FBAvi.pBitmap == FBAvi.pBitmapBuf1) ? 1 : 2; - - return 0; -} - -// Doubles the pixels on an already converted buffer -static INT32 MakeBitmap2x() -{ - INT32 nWidth = FBAvi.nWidth; - INT32 nHeight = FBAvi.nHeight; - UINT8 *pSrc = (FBAvi.nLastDest == 2) ? FBAvi.pBitmapBuf2 : FBAvi.pBitmapBuf1; - UINT8 *pDest = (FBAvi.nLastDest == 2) ? FBAvi.pBitmapBuf1 : FBAvi.pBitmapBuf2; - UINT8 *pDestL2; - FBAvi.pBitmap = pDest; - INT32 lctr = 0; - - for (INT32 i = 0; i < nHeight * nWidth; i++) { - pDestL2 = pDest + (nWidth * (aviBPP * 2)); // next line down - memcpy(pDest, pSrc, aviBPP); - pDest += aviBPP; - memcpy(pDest, pSrc, aviBPP); - pDest += aviBPP; - memcpy(pDestL2, pSrc, aviBPP); - pDestL2 += aviBPP; - memcpy(pDestL2, pSrc, aviBPP); - lctr++; - if(lctr >= nWidth) { - lctr = 0; - pDest += nWidth*(aviBPP * 2); - } - pSrc += aviBPP; // source a new pixel - } - - FBAvi.nLastDest = (FBAvi.pBitmap == FBAvi.pBitmapBuf1) ? 1 : 2; - - return 0; -} - -// Doubles the pixels on an already converted buffer -static INT32 MakeBitmap3x() -{ - INT32 nWidth = FBAvi.nWidth; - INT32 nHeight = FBAvi.nHeight; - UINT8 *pSrc = (FBAvi.nLastDest == 2) ? FBAvi.pBitmapBuf2 : FBAvi.pBitmapBuf1; - UINT8 *pDest = (FBAvi.nLastDest == 2) ? FBAvi.pBitmapBuf1 : FBAvi.pBitmapBuf2; - UINT8 *pDestL2, *pDestL3; - FBAvi.pBitmap = pDest; - INT32 lctr = 0; - - for (INT32 i = 0; i < nHeight * nWidth; i++) { - pDestL2 = pDest + (nWidth * (aviBPP * 3)); // next line down, aviBPP * x = # pixels expanding - pDestL3 = pDest + ((nWidth * (aviBPP * 3)) * 2); // next line down + 1 - memcpy(pDest, pSrc, aviBPP); - pDest += aviBPP; - memcpy(pDest, pSrc, aviBPP); - pDest += aviBPP; - memcpy(pDest, pSrc, aviBPP); - pDest += aviBPP; - memcpy(pDestL2, pSrc, aviBPP); - pDestL2 += aviBPP; - memcpy(pDestL2, pSrc, aviBPP); - pDestL2 += aviBPP; - memcpy(pDestL2, pSrc, aviBPP); - - memcpy(pDestL3, pSrc, aviBPP); - pDestL3 += aviBPP; - memcpy(pDestL3, pSrc, aviBPP); - pDestL3 += aviBPP; - memcpy(pDestL3, pSrc, aviBPP); - lctr++; - if(lctr >= nWidth) { // end of line 1 - lctr = 0; - pDest += nWidth*(aviBPP * 3); // line 2 - pDest += nWidth*(aviBPP * 3); // line 3 - } - pSrc += aviBPP; // source a new pixel - } - - FBAvi.nLastDest = (FBAvi.pBitmap == FBAvi.pBitmapBuf1) ? 1 : 2; - - return 0; -} - -// Sets the format for video stream. -static void AviSetVidFormat() -{ - // set the format of bitmap - memset(&FBAvi.bih,0,sizeof(BITMAPINFOHEADER)); - FBAvi.bih.biSize = sizeof(BITMAPINFOHEADER); - - BurnDrvGetVisibleSize(&FBAvi.nWidth, &FBAvi.nHeight); - FBAvi.bih.biWidth = FBAvi.nWidth * nAvi3x; - FBAvi.bih.biHeight = FBAvi.nHeight * nAvi3x; - - FBAvi.pBitmap = FBAvi.pBitmapBuf1; - - FBAvi.bih.biPlanes = 1; - FBAvi.bih.biBitCount = 32; - FBAvi.bih.biCompression = BI_RGB; // uncompressed RGB source - FBAvi.bih.biSizeImage = aviBPP * FBAvi.bih.biWidth * FBAvi.bih.biHeight; -} - -// Sets the format for the audio stream. -static void AviSetAudFormat() -{ - memset(&FBAvi.wfx, 0, sizeof(WAVEFORMATEX)); - FBAvi.wfx.cbSize = sizeof(WAVEFORMATEX); - FBAvi.wfx.wFormatTag = WAVE_FORMAT_PCM; - FBAvi.wfx.nChannels = 2; // stereo - FBAvi.wfx.nSamplesPerSec = nBurnSoundRate; // sample rate - FBAvi.wfx.wBitsPerSample = 16; // 16-bit - FBAvi.wfx.nBlockAlign = 4; // bytes per sample - FBAvi.wfx.nAvgBytesPerSec = FBAvi.wfx.nSamplesPerSec * FBAvi.wfx.nBlockAlign; -} - -// Creates the video stream. -// Returns: 0 (successful), 1 (failed) -static INT32 AviCreateVidStream() -{ - INT32 nRet; - HRESULT hRet; - - /* - Problem: - Must set the compressor option prior to creating the video - stream in the file because fccHandler is unknown until the - compressor is chosen. However, AVISaveOptions() requires - the stream to be created prior to the function call. - - Solution: - Use ICCompressorChoose() to set the COMPVARS, create the - video stream in the file using the returned fccHandler, - manually convert COMPVARS to AVICOMPRESSOPTIONS, and - then, make the compressed stream. - */ - - // initialize COMPVARS - memset(&FBAvi.compvar, 0, sizeof(COMPVARS)); - FBAvi.compvar.cbSize = sizeof(COMPVARS); - FBAvi.compvar.dwFlags = ICMF_COMPVARS_VALID; - //FBAvi.compvar.fccHandler = comptypeDIB; // default compressor = uncompressed full frames - FBAvi.compvar.fccHandler = 0; // default compressor = uncompressed full frames - FBAvi.compvar.lQ = ICQUALITY_DEFAULT; - - if (nAviSplit>0) { // next 2gig chunk, don't ask user for video type. - memmove(&FBAvi.compvar, &compvarsave, sizeof(COMPVARS)); - } else {// let user choose the compressor and compression options - nRet = ICCompressorChoose( - hScrnWnd, - ICMF_CHOOSE_DATARATE | ICMF_CHOOSE_KEYFRAME, - (LPVOID) &FBAvi.bih, // uncompressed data input format - NULL, // no preview window - &FBAvi.compvar, // returned info - "Set video compression option"); - if (!nRet) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: ICCompressorChoose() failed.\n")); - ICCompressorFree(&FBAvi.compvar); -#endif - return 1; - } - memmove(&compvarsave, &FBAvi.compvar, sizeof(COMPVARS)); - } - - nAviFlags |= FBAVI_VID_SET; // flag |= video compression option is set - - // fill in the header for the video stream - memset(&FBAvi.vidh, 0, sizeof(FBAvi.vidh)); - FBAvi.vidh.fccType = streamtypeVIDEO; // stream type - FBAvi.vidh.fccHandler = FBAvi.compvar.fccHandler; - FBAvi.vidh.dwScale = 100; // scale - FBAvi.vidh.dwRate = nBurnFPS; // rate, (fps = dwRate/dwScale) - FBAvi.vidh.dwSuggestedBufferSize = FBAvi.bih.biSizeImage; - - // set rectangle for stream - nRet = SetRect( - &FBAvi.vidh.rcFrame, - 0, // x-coordinate of the rectangle's upper left corner - 0, // y-coordinate of the rectangle's upper left corner - (INT32) FBAvi.bih.biWidth, - (INT32) FBAvi.bih.biHeight); - if (nRet == 0) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: SetRect() failed.\n")); -#endif - return 1; - } - - // create the video stream in the avi file - hRet = AVIFileCreateStream( - FBAvi.pFile, // file pointer - &FBAvi.psVid, // returned stream pointer - &FBAvi.vidh); // stream header - if (hRet) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: AVIFileCreateStream() failed.\n")); -#endif - return 1; - } - - // convert COMPVARS to AVICOMPRESSOPTIONS - memset(&FBAvi.opts, 0, sizeof(FBAvi.opts)); - FBAvi.opts.fccType = streamtypeVIDEO; - FBAvi.opts.fccHandler = FBAvi.compvar.fccHandler; - FBAvi.opts.dwKeyFrameEvery = FBAvi.compvar.lKey; - FBAvi.opts.dwQuality = FBAvi.compvar.lQ; - FBAvi.opts.dwBytesPerSecond = FBAvi.compvar.lDataRate * 1024L; - FBAvi.opts.dwFlags = AVICOMPRESSF_VALID | - (FBAvi.compvar.lDataRate ? AVICOMPRESSF_DATARATE:0L) | - (FBAvi.compvar.lKey ? AVICOMPRESSF_KEYFRAMES:0L); - FBAvi.opts.lpFormat = &FBAvi.bih; - FBAvi.opts.cbFormat = FBAvi.bih.biSize + FBAvi.bih.biClrUsed * sizeof(RGBQUAD); - FBAvi.opts.lpParms = FBAvi.compvar.lpState; - FBAvi.opts.cbParms = FBAvi.compvar.cbState; - FBAvi.opts.dwInterleaveEvery = 0; - - // make the compressed video stream - hRet = AVIMakeCompressedStream( - &FBAvi.psVidCompressed, - FBAvi.psVid, - &FBAvi.opts, - NULL); - if (hRet != AVIERR_OK) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: AVIMakeCompressedStream() failed.\n")); - switch (hRet) { - case AVIERR_NOCOMPRESSOR: - bprintf(0, _T("\t A suitable compressor cannot be found.\n")); - break; - case AVIERR_MEMORY: - bprintf(0, _T("\t Not enough memory to complete the operation.\n")); - break; - case AVIERR_UNSUPPORTED: - bprintf(0, _T("\t Compression is not supported for this type of data.\n")); - break; - default: - bprintf(0, _T("\t Unknown error.\n")); - break; - } -#endif - return 1; - } - - // set the stream format for compressed video - hRet = AVIStreamSetFormat( - FBAvi.psVidCompressed, // pointer to the opened video output stream - 0, // starting position - &FBAvi.bih, // stream format - FBAvi.bih.biSize + FBAvi.bih.biClrUsed * sizeof(RGBQUAD)); // format size - if (hRet) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: AVIStreamSetFormat() failed.\n")); -#endif - return 1; - } - - return 0; -} - -// Creates the audio stream. -// Returns: 0 (successful), 1 (failed) -static INT32 AviCreateAudStream() -{ - HRESULT hRet; - - // fill in the header for the audio stream - // - // - dwInitialFrames specifies how much to skew the - // audio data ahead of the video frames in interleaved - // files (typically 0.75 sec). - // - memset(&FBAvi.audh, 0, sizeof(FBAvi.audh)); - FBAvi.audh.fccType = streamtypeAUDIO; // stream type - FBAvi.audh.dwScale = FBAvi.wfx.nBlockAlign; - FBAvi.audh.dwRate = FBAvi.wfx.nAvgBytesPerSec; - FBAvi.audh.dwInitialFrames = 1; // audio skew - FBAvi.audh.dwSuggestedBufferSize = nBurnSoundLen<<2; - FBAvi.audh.dwSampleSize = FBAvi.wfx.nBlockAlign; - - // create the audio stream - hRet = AVIFileCreateStream( - FBAvi.pFile, // file pointer - &FBAvi.psAud, // returned stream pointer - &FBAvi.audh); // stream header - if (hRet) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: AVIFileCreateStream() failed.\n")); -#endif - return 1; - } - - // set the format for audio stream - hRet = AVIStreamSetFormat( - FBAvi.psAud, // pointer to the opened audio output stream - 0, // starting position - &FBAvi.wfx, // stream format - sizeof(WAVEFORMATEX)); // format size - if (hRet) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: AVIStreamSetFormat() failed.\n")); -#endif - return 1; - } - - return 0; -} - -INT32 AviStart_INT(); -void AviStop_INT(); - -// Records 1 frame worth of data to the output stream -// Returns: 0 (successful), 1 (failed) -INT32 AviRecordFrame(INT32 bDraw) -{ - HRESULT hRet; - LONG wrote; - /* - When FBA is frame skipping (bDraw == 0), we don't - need to build a new bitmap, nor encode video frame. - Just increment the frame number. However, if avi - is in vid/aud interleaved mode, audio must be recorded - every frame regardless of frameskip. - */ - if(bDraw) { - if(MakeSSBitmap()) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: MakeBitmap() failed.\n")); -#endif - return 1; - } - - MakeBitmapFlippedForEncoder(); // Mandatory, encoder needs image data to be flipped. - - switch (nAvi3x) { - case 2: MakeBitmap2x(); break; // Double the pixels, this must always happen otherwise the compression size and video quality - especially when uploaded to yt - will suck. -dink - case 3: MakeBitmap3x(); break; // Triple the pixels, for 720p/60hz* yt videos (yay!) *) if * 3 >= 720 && hz >= 60 - } - - wrote = 0; - - // compress the bitmap and write to AVI output stream - hRet = AVIStreamWrite( - FBAvi.psVidCompressed, // stream pointer - FBAvi.nFrameNum, // time of this frame - 1, // number to write - (LPBYTE) FBAvi.pBitmap, // pointer to data - FBAvi.bih.biSizeImage, // size of this frame - AVIIF_KEYFRAME, // flags - NULL, - &wrote); - if (hRet != AVIERR_OK) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: AVIStreamWrite() failed.\n")); -#endif - return 1; - } - - FBAvi.nAviSize += wrote; - } - - // interleave audio - if (nAviIntAudio) { - wrote = 0; - - // write the PCM audio data to AVI output stream - hRet = AVIStreamWrite( - FBAvi.psAud, // stream pointer - FBAvi.nFrameNum, // time of this frame - 1, // number to write - (LPBYTE) nAudNextSound, // pointer to data - nBurnSoundLen<<2, // size of data - AVIIF_KEYFRAME, // flags - NULL, - &wrote); - if (hRet != AVIERR_OK) { -#ifdef AVI_DEBUG - bprintf(0, _T(" AVI Error: AVIStreamWrite() failed.\n")); -#endif - return 1; - } - FBAvi.nAviSize += wrote; - } - - FBAvi.nFrameNum++; - - if (FBAvi.nAviSize >= 0x79000000) { - nAviSplit++; - bprintf(0, _T(" AVI Writer Split-Point 0x%X reached, creating new file.\n"), nAviSplit); - AviStop_INT(); - AviStart_INT(); - } - - return 0; -} - -// Frees bitmap. -static void FreeBMP() -{ - if (FBAvi.pBitmapBuf1) { - free(FBAvi.pBitmapBuf1); - FBAvi.pBitmapBuf1 = NULL; - } - if (FBAvi.pBitmapBuf2) { - free(FBAvi.pBitmapBuf2); - FBAvi.pBitmapBuf2 = NULL; - } - FBAvi.pBitmap = NULL; -} - -// Stops AVI recording. -void AviStop_INT() -{ - if (nAviFlags & FBAVI_VFW_INIT) { - if (FBAvi.psAud) { - AVIStreamRelease(FBAvi.psAud); - } - - if (FBAvi.psVidCompressed) { - AVIStreamRelease(FBAvi.psVidCompressed); - } - - if (FBAvi.psVid) { - AVIStreamRelease(FBAvi.psVid); - } - - if (FBAvi.pFile) { - AVIFileRelease(FBAvi.pFile); - } - - if (nAviFlags & FBAVI_VID_SET) { - if (nAviSplit == -1) - ICCompressorFree(&FBAvi.compvar); - } - - AVIFileExit(); - Sleep(150); // Allow compressor-codec threads/windows/etc time to finish gracefully - FreeBMP(); - -#ifdef AVI_DEBUG - if (nAviStatus) { - bprintf(0, _T(" ** AVI recording finished.\n")); - bprintf(0, _T(" total frames recorded = %u\n"), FBAvi.nFrameNum+1); - } -#endif - nAviStatus = 0; - nAviFlags = 0; - - memset(&FBAvi, 0, sizeof(FBAVI)); - MenuEnableItems(); - } -} - -void AviStop() -{ - nAviSplit = -1; - AviStop_INT(); -} - - -// Starts AVI recording. -// Returns: 0 (successful), 1 (failed) -INT32 AviStart_INT() -{ - // initialize local variables - memset (&FBAvi, 0, sizeof(FBAVI)); - - // initialize avi file library - // - we need VFW version 1.1 or greater - if (HIWORD(VideoForWindowsVersion()) < 0x010a){ - // VFW verison is too old, disable AVI recording - return 1; - } - - if (nAvi3x < 1 || nAvi3x > 3) { - nAvi3x = 2; // bad value, default to 2x pixels - } - - AVIFileInit(); - - nAviFlags |= FBAVI_VFW_INIT; // avi file library initialized - - // create the avi file - if(AviCreateFile()) { - return 1; - } - - // set video format - AviSetVidFormat(); - - // allocate memory for 2x 32bpp bitmap buffers - FBAvi.pBitmapBuf1 = (UINT8 *)malloc(FBAvi.bih.biSizeImage); - if (FBAvi.pBitmapBuf1 == NULL) { - return 1; // not enough memory to create allocate bitmap - } - FBAvi.pBitmapBuf2 = (UINT8 *)malloc(FBAvi.bih.biSizeImage); - if (FBAvi.pBitmapBuf2 == NULL) { - free(FBAvi.pBitmapBuf1); - return 1; // not enough memory to create allocate bitmap - } - FBAvi.pBitmap = FBAvi.pBitmapBuf1; - - // create the video stream - if(AviCreateVidStream()) { - return 1; - } - - // interleave audio / add audio to the stream - if (nAviIntAudio) { - // set audio format - AviSetAudFormat(); - // create the audio stream - if(AviCreateAudStream()) { - return 1; - } - } - - // record the first frame (at init only, not on splits init) - if(nAviSplit == 0 && AviRecordFrame(1)) { - return 1; - } - - nAviStatus = 1; // recording started - MenuEnableItems(); - return 0; -} - -INT32 AviStart() -{ - nAviSplit = 0; - - return AviStart_INT(); -} - diff --git a/jan/src/burner/win32/burner_win32.h b/jan/src/burner/win32/burner_win32.h deleted file mode 100644 index 089298eed..000000000 --- a/jan/src/burner/win32/burner_win32.h +++ /dev/null @@ -1,487 +0,0 @@ -#ifdef __GNUC__ -// silence warnings with GCC 4.6.1 -#undef _WIN32_WINDOWS -#undef _WIN32_IE -#undef _WIN32_WINNT -#undef WINVER -#endif - -#define _WIN32_WINDOWS 0x0410 -//#define _WIN32_WINNT 0x0400 -#define _WIN32_IE 0x0500 -#define _WIN32_WINNT 0x0501 -#define WINVER 0x0501 -#define STRICT - -#if defined (_UNICODE) -#ifndef UNICODE - #define UNICODE -#endif -#endif - -#define WIN32_LEAN_AND_MEAN -#define OEMRESOURCE -#include -#include -#include -#include - -#include -#include -#include - -INT32 DSCore_Init(); -INT32 DICore_Init(); -INT32 DDCore_Init(); -INT32 Dx9Core_Init(); - -// Additions to the Cygwin/MinGW win32 headers -#ifdef __GNUC__ - #include "mingw_win32.h" -#endif - -#include "resource.h" -#include "resource_string.h" -#include "net.h" -// --------------------------------------------------------------------------- - -// Macro for releasing a COM object -#define RELEASE(x) { if ((x)) (x)->Release(); (x) = NULL; } - -#define KEY_DOWN(Code) ((GetAsyncKeyState(Code) & 0x8000) ? 1 : 0) - -// Macros used for handling Window Messages -#define HANDLE_WM_ENTERMENULOOP(hwnd, wParam, lParam, fn) \ - ((fn)((hwnd), (BOOL)(wParam)), 0L) - -#ifdef __GNUC__ -#define HANDLE_WM_EXITMENULOOP(hwnd, wParam, lParam, fn) \ - ((fn)((hwnd), (BOOL)(wParam))) -#else -#define HANDLE_WM_EXITMENULOOP(hwnd, wParam, lParam, fn) \ - ((fn)((hwnd), (BOOL)(wParam)), 0L) -#endif - -#define HANDLE_WM_ENTERSIZEMOVE(hwnd, wParam, lParam, fn) \ - ((fn)(hwnd), 0L) - -#define HANDLE_WM_EXITSIZEMOVE(hwnd, wParam, lParam, fn) \ - ((fn)(hwnd), 0L) - -#define HANDLE_WM_UNINITMENUPOPUP(hwnd,wParam,lParam,fn) \ - ((fn)((hwnd), (HMENU)(wParam), (UINT)LOWORD(lParam), (BOOL)HIWORD(lParam)),0) - -// Extra macro used for handling Window Messages -#define HANDLE_MSGB(hwnd, message, fn) \ - case (message): \ - HANDLE_##message((hwnd), (wParam), (lParam), (fn)); \ - break; - -// Macro used for re-initialiging video/sound/input -// #define POST_INITIALISE_MESSAGE { dprintf(_T("*** (re-) initialising - %s %i\n"), _T(__FILE__), __LINE__); PostMessage(NULL, WM_APP + 0, 0, 0); } -#define POST_INITIALISE_MESSAGE PostMessage(NULL, WM_APP + 0, 0, 0) - -// --------------------------------------------------------------------------- - -// main.cpp -extern HINSTANCE hAppInst; // Application Instance -extern HANDLE hMainThread; // Handle to the main thread -extern long int nMainThreadID; // ID of the main thread -extern int nAppThreadPriority; -extern int nAppShowCmd; - -extern HACCEL hAccel; - -extern int nAppVirtualFps; // virtual fps - -#define EXE_NAME_SIZE (32) -extern TCHAR szAppExeName[EXE_NAME_SIZE + 1]; -extern TCHAR szAppBurnVer[16]; - -extern bool bCmdOptUsed; -extern bool bAlwaysProcessKeyboardInput; -extern bool bAlwaysCreateSupportFolders; - -extern bool bQuietLoading; - -extern bool bNoChangeNumLock; -extern bool bMonitorAutoCheck; - -// Used for the load/save dialog in commdlg.h -extern TCHAR szChoice[MAX_PATH]; // File chosen by the user -extern OPENFILENAME ofn; - -// Used to convert strings when possibly needed -/* const */ char* TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int nOutSize); -/* const */ TCHAR* ANSIToTCHAR(const char* pszString, TCHAR* pszOutString, int nOutSize); - -CHAR *astring_from_utf8(const char *s); -char *utf8_from_astring(const CHAR *s); - -WCHAR *wstring_from_utf8(const char *s); -char *utf8_from_wstring(const WCHAR *s); - -#ifdef _UNICODE -#define tstring_from_utf8 wstring_from_utf8 -#define utf8_from_tstring utf8_from_wstring -#else // !_UNICODE -#define tstring_from_utf8 astring_from_utf8 -#define utf8_from_tstring utf8_from_astring -#endif // _UNICODE - -int dprintf(TCHAR* pszFormat, ...); // Use instead of printf() in the UI - -void MonitorAutoCheck(); - -void AppCleanup(); -int AppMessage(MSG* pMsg); -bool AppProcessKeyboardInput(); - -// localise.cpp -extern bool bLocalisationActive; -extern TCHAR szLocalisationTemplate[MAX_PATH]; - -void FBALocaliseExit(); -int FBALocaliseInit(TCHAR* pszTemplate); -int FBALocaliseLoadTemplate(); -int FBALocaliseCreateTemplate(); -HMENU FBALoadMenu(HINSTANCE hInstance, LPTSTR lpMenuName); -INT_PTR FBADialogBox(HINSTANCE hInstance, LPTSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc); -HWND FBACreateDialog(HINSTANCE hInstance, LPCTSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc); -int FBALoadString(HINSTANCE hInstance, UINT uID, LPTSTR lpBuffer, int nBufferMax); -TCHAR* FBALoadStringEx(HINSTANCE hInstance, UINT uID, bool bTranslate); - -// localise_gamelist.cpp -extern TCHAR szGamelistLocalisationTemplate[MAX_PATH]; -extern bool nGamelistLocalisationActive; - -void BurnerDoGameListLocalisation(); -void BurnerExitGameListLocalisation(); -int FBALocaliseGamelistLoadTemplate(); -int FBALocaliseGamelistCreateTemplate(); - -// popup_win32.cpp -enum FBAPopupType { MT_NONE = 0, MT_ERROR, MT_WARNING, MT_INFO }; - -#define PUF_TYPE_ERROR (1) -#define PUF_TYPE_WARNING (2) -#define PUF_TYPE_INFO (3) -#define PUF_TYPE_LOGONLY (8) - -#define PUF_TEXT_TRANSLATE (1 << 16) - -#define PUF_TEXT_NO_TRANSLATE (0) -#define PUF_TEXT_DEFAULT (PUF_TEXT_TRANSLATE) - -int FBAPopupDisplay(int nFlags); -int FBAPopupAddText(int nFlags, TCHAR* pszFormat, ...); -int FBAPopupDestroyText(); - -// sysinfo.cpp -LONG CALLBACK ExceptionFilter(_EXCEPTION_POINTERS* pExceptionInfo); -int SystemInfoCreate(); - -// splash.cpp -int SplashCreate(); -void SplashDestroy(bool bForce); - -extern int nSplashTime; - -// about.cpp -int AboutCreate(); -int FirstUsageCreate(); - -// media.cpp -int MediaInit(); -int MediaExit(); - -// misc_win32.cpp -extern bool bIsWindowsXPorGreater; -extern bool bIsWindowsXP; -BOOL DetectWindowsVersion(); -int AppDirectory(); -void UpdatePath(TCHAR* path); -void RegisterExtensions(bool bCreateKeys); -int GetClientScreenRect(HWND hWnd, RECT* pRect); -int WndInMid(HWND hMid, HWND hBase); -char* DecorateGameName(unsigned int nBurnDrv); -void EnableHighResolutionTiming(); -void DisableHighResolutionTiming(); - - -// drv.cpp -extern int bDrvOkay; // 1 if the Driver has been initted okay, and it's okay to use the BurnDrv functions -extern TCHAR szAppRomPaths[DIRS_MAX][MAX_PATH]; -int DrvInit(int nDrvNum, bool bRestore); -int DrvInitCallback(); // Used when Burn library needs to load a game. DrvInit(nBurnSelect, false) -int DrvExit(); - -// burn_shift -extern INT32 BurnShiftEnabled; - -// run.cpp -extern int bRunPause; -extern int bAltPause; -extern int bAlwaysDrawFrames; -extern int kNetGame; -int RunIdle(); -int RunMessageLoop(); -int RunReset(); -void ToggleLayer(unsigned char thisLayer); - -// scrn.cpp -extern HWND hScrnWnd; // Handle to the screen window -extern HWND hRebar; // Handle to the Rebar control containing the menu -extern HWND hwndChat; -extern bool bRescanRoms; -extern bool bMenuEnabled; - -extern RECT SystemWorkArea; // The full screen area -extern int nWindowPosX, nWindowPosY; - -extern int nSavestateSlot; - -int ScrnInit(); -int ScrnExit(); -int ScrnSize(); -int ScrnTitle(); -void SetPauseMode(bool bPause); -int ActivateChat(); -void DeActivateChat(); -int BurnerLoadDriver(TCHAR *szDriverName); -int StartFromReset(TCHAR *szDriverName); - -// menu.cpp -#define UM_DISPLAYPOPUP (WM_USER + 0x0100) -#define UM_CANCELPOPUP (WM_USER + 0x0101) - -extern HANDLE hMenuThread; // Handle to the thread that executes TrackPopupMenuEx -extern DWORD nMenuThreadID; // ID of the thread that executes TrackPopupMenuEx -extern HWND hMenubar; // Handle to the Toolbar control comprising the menu -extern HWND hMenuWindow; -extern bool bMenuDisplayed; -extern int nLastMenu; -extern HMENU hMenu; // Handle to the menu -extern HMENU hMenuPopup; // Handle to a popup version of the menu -extern int nMenuHeight; -extern int bAutoPause; -extern int nScreenSize; -extern int nScreenSizeHor; // For horizontal orientation -extern int nScreenSizeVer; // For vertical orientation -extern int nWindowSize; - -#define SHOW_PREV_GAMES 10 -extern TCHAR szPrevGames[SHOW_PREV_GAMES][32]; - -extern bool bModelessMenu; - -int MenuCreate(); -void MenuDestroy(); -int SetMenuPriority(); -void MenuUpdate(); -void CreateArcaderesItem(); -void MenuEnableItems(); -bool MenuHandleKeyboard(MSG*); -void MenuRemoveTheme(); - -// sel.cpp -extern int nLoadMenuShowX; -extern int nLoadMenuShowY; -extern int nLoadMenuBoardTypeFilter; -extern int nLoadMenuGenreFilter; -extern int nLoadMenuFavoritesFilter; -extern int nLoadMenuFamilyFilter; -extern int nSelDlgWidth; -extern int nSelDlgHeight; -int SelDialog(int nMVSCartsOnly, HWND hParentWND); -extern UINT_PTR nTimer; -extern HBITMAP hPrevBmp; -extern HBITMAP hTitleBmp; -extern int nDialogSelect; -void CreateToolTipForRect(HWND hwndParent, PTSTR pszText); -int SelMVSDialog(); -void LoadDrvIcons(); -void UnloadDrvIcons(); -#define ICON_16x16 0 -#define ICON_24x24 1 -#define ICON_32x32 2 -extern bool bEnableIcons; -extern bool bIconsLoaded; -extern int nIconsSize, nIconsSizeXY, nIconsYDiff; -extern bool bGameInfoOpen; - -// neocdsel.cpp -extern int NeoCDList_Init(); -extern bool bNeoCDListScanSub; -extern bool bNeoCDListScanOnlyISO; -extern TCHAR szNeoCDCoverDir[MAX_PATH]; -extern TCHAR szNeoCDGamesDir[MAX_PATH]; - -HBITMAP ImageToBitmap(HWND hwnd, IMAGE* img); -HBITMAP PNGLoadBitmap(HWND hWnd, FILE* fp, int nWidth, int nHeight, int nPreset); -HBITMAP LoadBitmap(HWND hWnd, FILE* fp, int nWidth, int nHeight, int nPreset); - -// cona.cpp -extern int nIniVersion; - -struct VidPresetData { int nWidth; int nHeight; }; -extern struct VidPresetData VidPreset[4]; - -struct VidPresetDataVer { int nWidth; int nHeight; }; -extern struct VidPresetDataVer VidPresetVer[4]; - -int ConfigAppLoad(); -int ConfigAppSave(); - -// wave.cpp -extern FILE* WaveLog; // wave log file - -int WaveLogStart(); -int WaveLogStop(); - -// inpd.cpp -extern HWND hInpdDlg; // Handle to the Input Dialog - -int InpdUpdate(); -int InpdCreate(); -int InpdListMake(int bBuild); - -// inpcheat.cpp -extern HWND hInpCheatDlg; // Handle to the Input Dialog - -int InpCheatCreate(); -int InpCheatListMake(int bBuild); - -// inpdipsw.cpp -extern HWND hInpDIPSWDlg; // Handle to the Input Dialog -void InpDIPSWResetDIPs(); -int InpDIPSWCreate(); - -// inpmacro.cpp -extern HWND hInpMacroDlg; -void InpMacroExit(); -int InpMacroCreate(int nInput); - -// inps.cpp -extern HWND hInpsDlg; // Handle to the Input Set Dialog -extern unsigned int nInpsInput; // The input number we are redefining -int InpsCreate(); -int InpsUpdate(); - -// inpc.cpp -extern HWND hInpcDlg; // Handle to the Input Constant Dialog -extern unsigned int nInpcInput; // The input number we are redefining -int InpcCreate(); - -// stated.cpp -extern int bDrvSaveAll; -int StatedAuto(int bSave); -int StatedLoad(int nSlot); -int StatedUNDO(int nSlot); -int StatedSave(int nSlot); - -// numdial.cpp -int NumDialCreate(int bDial); -void GammaDialog(); -void ScanlineDialog(); -void PhosphorDialog(); -void ScreenAngleDialog(); -void CPUClockDialog(); -void CubicSharpnessDialog(); -// sfactd.cpp -int SFactdCreate(); - -// roms.cpp -extern char* gameAv; -extern bool avOk; -extern bool bSkipStartupCheck; -int RomsDirCreate(HWND hParentWND); -int CreateROMInfo(HWND hParentWND); -void FreeROMInfo(); -int WriteGameAvb(); - -// support_paths.cpp -int SupportDirCreate(HWND hParentWND); -int SupportDirCreateTab(int nTab, HWND hParentWND); - -// res.cpp -int ResCreate(int); - -// fba_kaillera.cpp -int KailleraInitInput(); -int KailleraGetInput(); - -// replay.cpp -extern int nReplayStatus; -extern bool bReplayReadOnly; -extern bool bReplayFrameCounterDisplay; -int RecordInput(); -int ReplayInput(); -int StartRecord(); -int StartReplay(const TCHAR* szFileName = NULL); -void StopReplay(); -int FreezeInput(unsigned char** buf, int* size); -int UnfreezeInput(const unsigned char* buf, int size); -void DisplayReplayProperties(HWND hDlg, bool bClear); - -// memcard.cpp -extern int nMemoryCardStatus; // & 1 = file selected, & 2 = inserted - -int MemCardCreate(); -int MemCardSelect(); -int MemCardInsert(); -int MemCardEject(); -int MemCardToggle(); - -// progress.cpp -int ProgressUpdateBurner(double dProgress, const TCHAR* pszText, bool bAbs); -int ProgressCreate(); -int ProgressDestroy(); - -// gameinfo.cpp -int GameInfoDialogCreate(HWND hParentWND, int nDrvSel); -void LoadFavorites(); -void AddFavorite_Ext(UINT8 addf); -INT32 CheckFavorites(char *name); - -// --------------------------------------------------------------------------- -// Debugger - -// debugger.cpp -extern HWND hDbgDlg; - -int DebugExit(); -int DebugCreate(); - -// paletteviewer.cpp -int PaletteViewerDialogCreate(HWND hParentWND); - -// ips_manager.cpp -extern int nIpsSelectedLanguage; -int GetIpsNumPatches(); -void LoadIpsActivePatches(); -int GetIpsNumActivePatches(); -int IpsManagerCreate(HWND hParentWND); -void IpsPatchExit(); - -// localise_download.cpp -int LocaliseDownloadCreate(HWND hParentWND); - -// choose_monitor.cpp -int ChooseMonitorCreate(); - -// Misc -#define _TtoA(a) TCHARToANSI(a, NULL, 0) -#define _AtoT(a) ANSIToTCHAR(a, NULL, 0) - -#ifdef INCLUDE_AVI_RECORDING -// ---------------------------------------------------------------------------- -// AVI recording - -// avi.cpp -INT32 AviStart(); -INT32 AviRecordFrame(INT32 bDraw); -void AviStop(); -extern INT32 nAviStatus; -extern INT32 nAvi3x; -#endif diff --git a/jan/src/burner/win32/bzip.cpp b/jan/src/burner/win32/bzip.cpp deleted file mode 100644 index 98267af66..000000000 --- a/jan/src/burner/win32/bzip.cpp +++ /dev/null @@ -1,612 +0,0 @@ -// Burner Zip module -#include "burner.h" - -int nBzipError = 0; // non-zero if there is a problem with the opened romset - -static TCHAR* szBzipName[BZIP_MAX] = { NULL, }; // Zip files to search through - -struct RomFind { int nState; int nZip; int nPos; }; // State is non-zero if found. 1 = found totally okay. -static struct RomFind* RomFind = NULL; -static int nRomCount = 0; static int nTotalSize = 0; -static struct ZipEntry* List = NULL; static int nListCount = 0; // List of entries for current zip file -static int nCurrentZip = -1; // Zip which is currently open - -// ---------------------------------------------------------------------------- - -static void BzipListFree() -{ - if (List) { - for (int i = 0; i < nListCount; i++) { - if (List[i].szName) { - free(List[i].szName); - List[i].szName = NULL; - } - } - free(List); - List = NULL; - } - - nListCount = 0; -} - -static char* GetFilenameA(char* szFull) -{ - int nLen = strlen(szFull); - - if (nLen <= 0) { - return szFull; - } - for (int i = nLen - 1; i >= 0; i--) { - if (szFull[i] == '\\' || szFull[i] == '/') { - return szFull + i + 1; - } - } - - return szFull; -} - -static TCHAR* GetFilenameW(TCHAR* szFull) -{ - int nLen = _tcslen(szFull); - - if (nLen <= 0) { - return szFull; - } - for (int i = nLen - 1; i >= 0; i--) { - if (szFull[i] == _T('\\') || szFull[i] == _T('/')) { - return szFull + i + 1; - } - } - - return szFull; -} - -static int FindRomByName(TCHAR* szName) -{ - struct ZipEntry* pl; - int i; - - // Find the rom named szName in the List - for (i = 0, pl = List; i < nListCount; i++, pl++) { - TCHAR szCurrentName[MAX_PATH]; - if (pl->szName) { - if (_tcsicmp(szName, GetFilenameW(ANSIToTCHAR(pl->szName, szCurrentName, MAX_PATH))) == 0) { - return i; - } - } - } - return -1; // couldn't find the rom -} - -static int FindRomByCrc(unsigned int nCrc) -{ - struct ZipEntry* pl; - int i; - - // Find the rom named szName in the List - for (i = 0, pl = List; i< nListCount; i++, pl++) { - if (nCrc == pl->nCrc) { - return i; - } - } - - return -1; // couldn't find the rom -} - -// Find rom number i from the pBzipDriver game -static int FindRom(int i) -{ - struct BurnRomInfo ri; - int nRet; - - memset(&ri, 0, sizeof(ri)); - - nRet = BurnDrvGetRomInfo(&ri, i); - if (nRet != 0) { // Failure: no such rom - return -2; - } - - if (ri.nCrc) { // Search by crc first - nRet = FindRomByCrc(ri.nCrc); - if (nRet >= 0) { - return nRet; - } - } - - for (int nAka = 0; nAka < 0x10000; nAka++) { // Failing that, search for possible names - char *szPossibleName = NULL; - - nRet = BurnDrvGetRomName(&szPossibleName, i, nAka); - if (nRet) { // No more rom names - break; - } - nRet = FindRomByName(ANSIToTCHAR(szPossibleName, NULL, 0)); - if (nRet >= 0) { - return nRet; - } - } - - return -1; // Couldn't find the rom -} - -static int RomDescribe(struct BurnRomInfo* pri) -{ - if (nBzipError == 0) { - nBzipError |= 0x8000; - - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_INVALID)); - } - - FBAPopupAddText(PUF_TEXT_DEFAULT, _T(" ") _T(SEPERATOR_1)); - if (pri->nType & BRF_ESS) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DET_ESS)); - } - if (pri->nType & BRF_BIOS) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DET_BIOS)); - } - if (pri->nType & BRF_PRG) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DET_PRG)); - } - if (pri->nType & BRF_GRA) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DET_GRA)); - } - if (pri->nType & BRF_SND) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DET_SND)); - } - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DET_ROM)); - - return 0; -} - -static int CheckRomsBoot() -{ - int nRet = 0; - - for (int i = 0; i < nRomCount; i++) { - struct BurnRomInfo ri; - int nState; - - memset(&ri, 0, sizeof(ri)); - BurnDrvGetRomInfo(&ri, i); // Find information about the wanted rom - nState = RomFind[i].nState; // Get the state of the rom in the zip file - - if (nState != 1 && ri.nType && ri.nCrc) { - if (!(ri.nType & BRF_OPT) && !(ri.nType & BRF_NODUMP)) { - return 1; - } - nRet = 2; - } - } - - return nRet; -} - -static int GetBZipError(int nState) -{ - switch (nState) { - case 1: // OK - return 0x0000; - case 0: // Not present - return 0x0001; - case 3: // Incomplete - return 0x0001; - default: // CRC wrong or too large - return 0x0100; - } - - return 0x0100; -} - -// Check the roms to see if they code, graphics etc are complete -static int CheckRoms() -{ - for (int i = 0; i < nRomCount; i++) { - struct BurnRomInfo ri; - - memset(&ri, 0, sizeof(ri)); - BurnDrvGetRomInfo(&ri, i); // Find information about the wanted rom - if ( /*ri.nCrc &&*/ (ri.nType & BRF_OPT) == 0 && (ri.nType & BRF_NODUMP) == 0) { - int nState = RomFind[i].nState; // Get the state of the rom in the zip file - int nError = GetBZipError(nState); - - if (nState == 0 && ri.nType) { // (A type of 0 means empty slot - no rom) - char* szName = "Unknown"; - RomDescribe(&ri); - BurnDrvGetRomName(&szName, i, 0); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_NOTFOUND), szName); - } - - if (nError == 0) { - nBzipError |= 0x2000; - } - - if (ri.nType & BRF_ESS) { // essential rom - without it the game may not run at all - nBzipError |= nError << 0; - } - if (ri.nType & BRF_PRG) { // rom which contains program information - nBzipError |= nError << 1; - } - if (ri.nType & BRF_GRA) { // rom which contains graphics information - nBzipError |= nError << 2; - } - if (ri.nType & BRF_SND) { // rom which contains sound information - nBzipError |= nError << 3; - } - } - } - - if (nBzipError & 0x0F0F) { - nBzipError |= 0x4000; - } - - return 0; -} - -// ---------------------------------------------------------------------------- - -static int __cdecl BzipBurnLoadRom(unsigned char* Dest, int* pnWrote, int i) -{ -#if defined (BUILD_WIN32) - MSG Msg; -#endif - - struct BurnRomInfo ri; - int nWantZip = 0; - TCHAR szText[128]; - char* pszRomName = NULL; - int nRet = 0; - - if (i < 0 || i >= nRomCount) { - return 1; - } - - ri.nLen = 0; - BurnDrvGetRomInfo(&ri, i); // Get info - - // show what we're doing - BurnDrvGetRomName(&pszRomName, i, 0); - if (pszRomName == NULL) { - TCHAR szTempName[100]; - _stprintf(szTempName, _T("%s"), FBALoadStringEx(hAppInst, IDS_ERR_UNKNOWN, true)); - sprintf(pszRomName, "%s", TCHARToANSI(szTempName, NULL, 0)); - } - - TCHAR szTempLoading[100]; - _stprintf(szTempLoading, _T("%s"), FBALoadStringEx(hAppInst, IDS_PROGRESS_LOADING_ONLY, true)); - _stprintf(szText, _T("%s"), szTempLoading); - - if (ri.nType & (BRF_PRG | BRF_GRA | BRF_SND | BRF_BIOS)) { - if (ri.nType & BRF_BIOS) { - TCHAR szTempBios[100]; - _stprintf(szTempBios, _T("%s"), FBALoadStringEx(hAppInst, IDS_ERR_LOAD_DET_BIOS, true)); - _stprintf(szText + _tcslen(szText), _T(" %s"), szTempBios); - } - if (ri.nType & BRF_PRG) { - TCHAR szTempPrg[100]; - _stprintf(szTempPrg, _T("%s"), FBALoadStringEx(hAppInst, IDS_ERR_LOAD_DET_PRG, true)); - _stprintf(szText + _tcslen(szText), _T(" %s"), szTempPrg); - } - if (ri.nType & BRF_GRA) { - TCHAR szTempGra[100]; - _stprintf(szTempGra, _T("%s"), FBALoadStringEx(hAppInst, IDS_ERR_LOAD_DET_GRA, true)); - _stprintf (szText + _tcslen(szText), _T(" %s"), szTempGra); - } - if (ri.nType & BRF_SND) { - TCHAR szTempSnd[100]; - _stprintf(szTempSnd, _T("%s"), FBALoadStringEx(hAppInst, IDS_ERR_LOAD_DET_SND, true)); - _stprintf (szText + _tcslen(szText), _T(" %s"), szTempSnd); - } - _stprintf(szText + _tcslen(szText), _T("(%hs)..."), pszRomName); - } else { - _stprintf(szText + _tcslen(szText), _T(" %hs..."), pszRomName); - } - ProgressUpdateBurner(ri.nLen ? 1.0 / ((double)nTotalSize / ri.nLen) : 0, szText, 0); - -#if defined (BUILD_WIN32) - // Check for messages: - while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) { - DispatchMessage(&Msg); - } -#endif - - if (RomFind[i].nState == 0) { // Rom not found in zip at all - return 1; - } - - nWantZip = RomFind[i].nZip; // Which zip file it is in - if (nCurrentZip != nWantZip) { // If we haven't got the right zip file currently open - ZipClose(); - nCurrentZip = -1; - if (ZipOpen(TCHARToANSI(szBzipName[nWantZip], NULL, 0))) { - return 1; - } - nCurrentZip = nWantZip; - } - - // Read in file and return how many bytes we read - if (ZipLoadFile(Dest, ri.nLen, pnWrote, RomFind[i].nPos)) { - - // Error loading from the zip file - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(nRet == 2 ? IDS_ERR_LOAD_DISK_CRC : IDS_ERR_LOAD_DISK), pszRomName, GetFilenameW(szBzipName[nCurrentZip])); - FBAPopupDisplay(PUF_TYPE_WARNING); - - return 1; - } - - return 0; -} - -// ---------------------------------------------------------------------------- - -int BzipStatus() -{ - if (!(nBzipError & 0x0F0F)) { - return BZIP_STATUS_OK; - } - if (nBzipError & 1) { - return BZIP_STATUS_ERROR; - } - - return BZIP_STATUS_BADDATA; -} - -int BzipOpen(bool bootApp) -{ - int nMemLen; // Zip name number - - nTotalSize = 0; - nBzipError = 0; - - if (szBzipName == NULL) { - return 1; - } - - BzipClose(); // Make sure nothing is open - - // Count the number of roms needed - for (nRomCount = 0; ; nRomCount++) { - if (BurnDrvGetRomInfo(NULL, nRomCount)) { - break; - } - } - if (nRomCount <= 0) { - return 1; - } - - // Create an array for holding lookups for each rom -> zip entries - nMemLen = nRomCount * sizeof(struct RomFind); - RomFind = (struct RomFind*)malloc(nMemLen); - if (RomFind == NULL) { - return 1; - } - memset(RomFind, 0, nMemLen); - - for (int y = 0; y < BZIP_MAX; y++) { - if (szBzipName[y]) { - free(szBzipName[y]); - szBzipName[y] = NULL; - } - } - - // Locate each zip file - for (int y = 0, z = 0; y < BZIP_MAX && z < BZIP_MAX; y++) { - char* szName = NULL; - bool bFound = false; - - if (BurnDrvGetZipName(&szName, y)) { - break; - } - - for (int d = 0; d < DIRS_MAX; d++) { - TCHAR szFullName[MAX_PATH]; - - _stprintf(szFullName, _T("%s%hs"), szAppRomPaths[d], szName); - - if (ZipOpen(TCHARToANSI(szFullName, NULL, 0)) == 0) { // Open the rom zip file - ZipClose(); - - bFound = true; - - szBzipName[z] = (TCHAR*)malloc(MAX_PATH * sizeof(TCHAR)); - _tcscpy(szBzipName[z], szFullName); - - if (!bootApp) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_FOUND), szName, szBzipName[z]); - } - - z++; - if (z >= BZIP_MAX) break; - - // Look further in the last ten paths specified, so you can put files with ROMs - // used only by FB Alpha there without causing problems with dat files - if (d < DIRS_MAX - 11) { - d = DIRS_MAX - 11; - } else { - if (d >= DIRS_MAX - 1) { - break; - } - } - } - } - - if (!bootApp && !bFound) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_NOTFOUND), szName); - } - } - - if (!bootApp) { - FBAPopupAddText(PUF_TEXT_DEFAULT, _T("\n")); - } - - // Locate the ROM data in the zip files - for (int z = 0; z < BZIP_MAX; z++) { - - if (szBzipName[z] == NULL) { - continue; - } - - if (ZipOpen(TCHARToANSI(szBzipName[z], NULL, 0)) == 0) { // Open the rom zip file - nCurrentZip = z; - - ZipGetList(&List, &nListCount); // Get the list of entries - - for (int i = 0; i < nRomCount; i++) { - struct BurnRomInfo ri; - int nFind; - - if (RomFind[i].nState == 1) { // Already found this and it's okay - continue; - } - - memset(&ri, 0, sizeof(ri)); - - nFind = FindRom(i); - - if (nFind < 0) { // Couldn't find this rom at all - continue; - } - - RomFind[i].nZip = z; // Remember which zip file it is in - RomFind[i].nPos = nFind; - RomFind[i].nState = 1; // Set to found okay - - BurnDrvGetRomInfo(&ri, i); // Get info about the rom - - if ((ri.nType & BRF_OPT) == 0 && (ri.nType & BRF_NODUMP) == 0) { - nTotalSize += ri.nLen; - } - - if (List[nFind].nLen == ri.nLen) { - if (ri.nCrc) { // If we know the CRC - if (List[nFind].nCrc != ri.nCrc) { // Length okay, but CRC wrong - RomFind[i].nState = 2; - } - } - } else { - if (List[nFind].nLen < ri.nLen) { - RomFind[i].nState = 3; // Too small - } else { - RomFind[i].nState = 4; // Too big - } - } - - if (!bootApp) { - if (RomFind[i].nState != 1) { - RomDescribe(&ri); - - if (RomFind[i].nState == 2) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_CRC), GetFilenameA(List[nFind].szName), List[nFind].nCrc, ri.nCrc); - } - if (RomFind[i].nState == 3) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_SMALL), GetFilenameA(List[nFind].szName), List[nFind].nLen >> 10, ri.nLen >> 10); - } - if (RomFind[i].nState == 4) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_LARGE), GetFilenameA(List[nFind].szName), List[nFind].nLen >> 10, ri.nLen >> 10); - } - } - } - } - - BzipListFree(); - } - - ZipClose(); // Close the last zip file if open - nCurrentZip = -1; - } - - if (!bootApp) { - // Check the roms to see if the code, graphics etc are complete - CheckRoms(); - - if (nBzipError & 0x2000) { - if (!(nBzipError & 0x0F0F)) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_OK)); - } else { - FBAPopupAddText(PUF_TEXT_DEFAULT, _T("\n")); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_PROBLEM)); - } - - if (nBzipError & 0x0101) { - FBAPopupAddText(PUF_TEXT_DEFAULT, _T("\n ") _T(SEPERATOR_1)); - if (nBzipError & 0x0001) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_ESS_MISS)); - } else { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_ESS_BAD)); - } - } - if (nBzipError & 0x0202) { - FBAPopupAddText(PUF_TEXT_DEFAULT, _T("\n ") _T(SEPERATOR_1)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DET_PRG)); - if (nBzipError & 0x0002) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DATA_MISS)); - } else { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DATA_BAD)); - } - } - if (nBzipError & 0x0404) { - FBAPopupAddText(PUF_TEXT_DEFAULT, _T("\n ") _T(SEPERATOR_1)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DET_GRA)); - if (nBzipError & 0x0004) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DATA_MISS)); - } else { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DATA_BAD)); - } - } - if (nBzipError & 0x0808) { - FBAPopupAddText(PUF_TEXT_DEFAULT, _T("\n ") _T(SEPERATOR_1)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DET_SND)); - if (nBzipError & 0x0008) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DATA_MISS)); - } else { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DATA_BAD)); - } - } - - // Catch non-categorised ROMs - if ((nBzipError & 0x0F0F) == 0) { - if (nBzipError & 0x0010) { - FBAPopupAddText(PUF_TEXT_DEFAULT, _T("\n ") _T(SEPERATOR_1)); - if (nBzipError & 0x1000) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DATA_MISS)); - } else { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_DATA_BAD)); - } - } - } - } else { - FBAPopupAddText(PUF_TEXT_DEFAULT, _T("\n")); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_NODATA)); - } - - BurnExtLoadRom = BzipBurnLoadRom; // Okay to call our function to load each rom - - } else { - return CheckRomsBoot(); - } - - return 0; -} - -int BzipClose() -{ - ZipClose(); - nCurrentZip = -1; // Close the last zip file if open - - BurnExtLoadRom = NULL; // Can't call our function to load each rom anymore - nBzipError = 0; // reset romset errors - - if (RomFind) { - free(RomFind); - RomFind = NULL; - } - nRomCount = 0; - - for (int z = 0; z < BZIP_MAX; z++) { - if (szBzipName[z]) { - free(szBzipName[z]); - szBzipName[z] = NULL; - } - } - - return 0; -} diff --git a/jan/src/burner/win32/choose_monitor.cpp b/jan/src/burner/win32/choose_monitor.cpp deleted file mode 100644 index db266fe07..000000000 --- a/jan/src/burner/win32/choose_monitor.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "burner.h" - -#define MAX_MONITORS 8 - -static TCHAR *MonitorIDs[MAX_MONITORS]; - -static INT_PTR CALLBACK ResProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) -{ - static bool bOK; - - switch (Msg) { - case WM_INITDIALOG: { - int i; - int nHorSelected = 0, nVerSelected = 0; - - for (i = 0; i < MAX_MONITORS; i++) { - MonitorIDs[i] = (TCHAR*)malloc(32 * sizeof(TCHAR)); - memset(MonitorIDs[i], 0, 32 * sizeof(TCHAR)); - } - - DISPLAY_DEVICE dd; - ZeroMemory(&dd, sizeof(dd)); - dd.cb = sizeof(dd); - - for (i = 0; EnumDisplayDevices(NULL, i, &dd, 0); i++) { - if (dd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) { - DISPLAY_DEVICE dd2; - ZeroMemory(&dd2, sizeof(dd2)); - dd2.cb = sizeof(dd2); - EnumDisplayDevices(dd.DeviceName, 0, &dd2, 0); - - // Add to dropdowns - TCHAR szTemp[256]; - _stprintf(szTemp, _T("%s"), dd2.DeviceString); - if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) _stprintf(szTemp, _T("%s (default)"), szTemp); - - SendDlgItemMessage(hDlg, IDC_CHOOSE_MONITOR_HOR_LIST, CB_ADDSTRING, 0, (LPARAM)&szTemp); - SendDlgItemMessage(hDlg, IDC_CHOOSE_MONITOR_VER_LIST, CB_ADDSTRING, 0, (LPARAM)&szTemp); - - // Store id for later - _stprintf(MonitorIDs[i], _T("%s"), dd.DeviceName); - - // Select if this is our value or the default - if (nHorSelected == 0) { - if (!_tcsicmp(HorScreen, MonitorIDs[i])) { - nHorSelected = 1; - SendDlgItemMessage(hDlg, IDC_CHOOSE_MONITOR_HOR_LIST, CB_SETCURSEL, i, 0); - } else { - if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) SendDlgItemMessage(hDlg, IDC_CHOOSE_MONITOR_HOR_LIST, CB_SETCURSEL, i, 0); - } - } - - if (nVerSelected == 0) { - if (!_tcsicmp(VerScreen, MonitorIDs[i])) { - nVerSelected = 1; - SendDlgItemMessage(hDlg, IDC_CHOOSE_MONITOR_VER_LIST, CB_SETCURSEL, i, 0); - } else { - if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) SendDlgItemMessage(hDlg, IDC_CHOOSE_MONITOR_VER_LIST, CB_SETCURSEL, i, 0); - } - } - } - } - - WndInMid(hDlg, hScrnWnd); - SetFocus(hDlg); // Enable Esc=close - break; - } - - case WM_COMMAND: { - if (LOWORD(wParam) == IDOK) { - bOK = 1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDCANCEL) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - - case WM_CLOSE: { - if (bOK) { - // save selected values - int nItem = (int)SendDlgItemMessage(hDlg, IDC_CHOOSE_MONITOR_HOR_LIST, CB_GETCURSEL, 0, 0); - if (MonitorIDs[(int)nItem]) _stprintf(HorScreen, _T("%s"), MonitorIDs[(int)nItem]); - - nItem = (int)SendDlgItemMessage(hDlg, IDC_CHOOSE_MONITOR_VER_LIST, CB_GETCURSEL, 0, 0); - if (MonitorIDs[(int)nItem]) _stprintf(VerScreen, _T("%s"), MonitorIDs[(int)nItem]); - } - EndDialog(hDlg, 0); - break; - } - } - - return 0; -} - -int ChooseMonitorCreate() -{ - FBADialogBox(hAppInst,MAKEINTRESOURCE(IDD_CHOOSEMONITOR),hScrnWnd,(DLGPROC)ResProc); - return 0; -} diff --git a/jan/src/burner/win32/cona.cpp b/jan/src/burner/win32/cona.cpp deleted file mode 100644 index 7a58ae1fc..000000000 --- a/jan/src/burner/win32/cona.cpp +++ /dev/null @@ -1,698 +0,0 @@ -// Burner Config file module -#include "burner.h" - -#ifdef _UNICODE - #include -#endif - -int nIniVersion = 0; - -struct VidPresetData VidPreset[4] = { - { 640, 480}, - { 1024, 768}, - { 1280, 960}, - // last one set at desktop resolution -}; - -struct VidPresetDataVer VidPresetVer[4] = { - { 640, 480}, - { 1024, 768}, - { 1280, 960}, - // last one set at desktop resolution -}; - -static void CreateConfigName(TCHAR* szConfig) -{ - _stprintf(szConfig, _T("config/%s.ini"), szAppExeName); - return; -} - -// Read in the config file for the whole application -int ConfigAppLoad() -{ - TCHAR szConfig[MAX_PATH]; - TCHAR szLine[1024]; - FILE* h; - -#ifdef _UNICODE - setlocale(LC_ALL, ""); -#endif - - CreateConfigName(szConfig); - - if ((h = _tfopen(szConfig, _T("rt"))) == NULL) { - return 1; - } - - // Go through each line of the config file - while (_fgetts(szLine, sizeof(szLine), h)) { - int nLen = _tcslen(szLine); - - // Get rid of the linefeed at the end - if (szLine[nLen - 1] == 10) { - szLine[nLen - 1] = 0; - nLen--; - } - -#define VAR(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x)); \ - if (szValue) x = _tcstol(szValue, NULL, 0); } -#define VAR64(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x)); \ - if (szValue) x = (long long)_tcstod(szValue, NULL); } -#define FLT(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x)); \ - if (szValue) x = _tcstod(szValue, NULL); } -#define STR(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x) _T(" ")); \ - if (szValue) _tcscpy(x,szValue); } -#define PAT(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x) _T(" ")); \ - if (szValue) { _tcscpy(x, szValue); UpdatePath(x); } } -#define DRV(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x) _T(" ")); \ - if (szValue) x = NameToDriver(szValue); } - - VAR(nIniVersion); - - // Emulation -#ifdef BUILD_A68K - VAR(bBurnUseASMCPUEmulation); -#endif - - // Video - VAR(nVidDepth); VAR(nVidRefresh); - VAR(nVidRotationAdjust); - - // horizontal oriented - VAR(nVidHorWidth); VAR(nVidHorHeight); - VAR(bVidArcaderesHor); - VAR(VidPreset[0].nWidth); VAR(VidPreset[0].nHeight); - VAR(VidPreset[1].nWidth); VAR(VidPreset[1].nHeight); - VAR(VidPreset[2].nWidth); VAR(VidPreset[2].nHeight); - VAR(VidPreset[3].nWidth); VAR(VidPreset[3].nHeight); - VAR(nScreenSizeHor); - - // vertical oriented - VAR(nVidVerWidth); VAR(nVidVerHeight); - VAR(bVidArcaderesVer); - VAR(VidPresetVer[0].nWidth); VAR(VidPresetVer[0].nHeight); - VAR(VidPresetVer[1].nWidth); VAR(VidPresetVer[1].nHeight); - VAR(VidPresetVer[2].nWidth); VAR(VidPresetVer[2].nHeight); - VAR(VidPresetVer[3].nWidth); VAR(VidPresetVer[3].nHeight); - VAR(nScreenSizeVer); - - VAR(nWindowSize); - VAR(nWindowPosX); VAR(nWindowPosY); - VAR(bDoGamma); - VAR(bVidUseHardwareGamma); - VAR(bHardwareGammaOnly); - FLT(nGamma); - VAR(bVidFullStretch); - VAR(bVidCorrectAspect); - - VAR(bVidAutoSwitchFull); - STR(HorScreen); - STR(VerScreen); - - VAR(bVidTripleBuffer); - VAR(bVidVSync); - - VAR(bVidScanlines); - VAR(nVidScanIntensity); - VAR(bMonitorAutoCheck); - VAR(nVidScrnAspectX); - VAR(nVidScrnAspectY); - VAR(bForce60Hz); - VAR(bAlwaysDrawFrames); - - VAR(nVidSelect); - VAR(nVidBlitterOpt[0]); - VAR64(nVidBlitterOpt[1]); - VAR(nVidBlitterOpt[2]); - VAR(nVidBlitterOpt[3]); - VAR(nVidBlitterOpt[4]); - - // DirectDraw blitter - VAR(bVidScanHalf); - VAR(bVidForceFlip); - - // Direct3D blitter - VAR(bVidBilinear); - VAR(bVidScanDelay); - VAR(bVidScanRotate); - VAR(bVidScanBilinear); - VAR(nVidFeedbackIntensity); - VAR(nVidFeedbackOverSaturation); - FLT(fVidScreenAngle); - FLT(fVidScreenCurvature); - VAR(bVidForce16bit); - VAR(nVidTransferMethod); - - // DirectX Graphics blitter - FLT(dVidCubicB); - FLT(dVidCubicC); - - // DirectX Graphics 9 Alt blitter - VAR(bVidDX9Bilinear); - VAR(bVidHardwareVertex); - VAR(bVidMotionBlur); - VAR(bVidForce16bitDx9Alt); - - // Sound - VAR(nAudSelect); - VAR(nAudSegCount); - VAR(nInterpolation); - VAR(nFMInterpolation); - VAR(nAudSampleRate[0]); - VAR(nAudDSPModule[0]); - VAR(nAudSampleRate[1]); - VAR(nAudDSPModule[1]); - - // Other - STR(szLocalisationTemplate); - STR(szGamelistLocalisationTemplate); - VAR(nGamelistLocalisationActive); - - VAR(nVidSDisplayStatus); - VAR(nMinChatFontSize); - VAR(nMaxChatFontSize); - - VAR(bModelessMenu); - - VAR(nSplashTime); - - VAR(bDrvSaveAll); - VAR(nAppThreadPriority); - VAR(bAlwaysProcessKeyboardInput); - VAR(bAutoPause); - VAR(bSaveInputs); - - VAR(nCDEmuSelect); - PAT(CDEmuImage); - - VAR(nSelDlgWidth); - VAR(nSelDlgHeight); - VAR(nLoadMenuShowX); - VAR(nLoadMenuShowY); - VAR(nLoadMenuBoardTypeFilter); - VAR(nLoadMenuGenreFilter); - VAR(nLoadMenuFavoritesFilter); - VAR(nLoadMenuFamilyFilter); - - STR(szAppRomPaths[0]); - STR(szAppRomPaths[1]); - STR(szAppRomPaths[2]); - STR(szAppRomPaths[3]); - STR(szAppRomPaths[4]); - STR(szAppRomPaths[5]); - STR(szAppRomPaths[6]); - STR(szAppRomPaths[7]); - STR(szAppRomPaths[8]); - STR(szAppRomPaths[9]); - STR(szAppRomPaths[10]); - STR(szAppRomPaths[11]); - STR(szAppRomPaths[12]); - STR(szAppRomPaths[13]); - STR(szAppRomPaths[14]); - STR(szAppRomPaths[15]); - STR(szAppRomPaths[16]); - STR(szAppRomPaths[17]); - STR(szAppRomPaths[18]); - STR(szAppRomPaths[19]); - - STR(szNeoCDGamesDir); - - STR(szAppPreviewsPath); - STR(szAppTitlesPath); - STR(szAppCheatsPath); - STR(szAppHiscorePath); - STR(szAppSamplesPath); - STR(szAppIpsPath); - STR(szAppIconsPath); - STR(szNeoCDCoverDir); - STR(szAppBlendPath); - STR(szAppSelectPath); - STR(szAppVersusPath); - STR(szAppScoresPath); - STR(szAppBossesPath); - STR(szAppGameoverPath); - STR(szAppFlyersPath); - STR(szAppMarqueesPath); - STR(szAppControlsPath); - STR(szAppCabinetsPath); - STR(szAppPCBsPath); - STR(szAppHistoryPath); - STR(szAppEEPROMPath); - - VAR(bNoChangeNumLock); - VAR(bAlwaysCreateSupportFolders); - - VAR(nAutoFireRate); - - VAR(EnableHiscores); - VAR(bBurnUseBlend); - VAR(BurnShiftEnabled); - VAR(bSkipStartupCheck); - -#ifdef INCLUDE_AVI_RECORDING - VAR(nAvi3x); -#endif - - VAR(nIpsSelectedLanguage); - - VAR(bEnableIcons); - VAR(nIconsSize); - - STR(szPrevGames[0]); - STR(szPrevGames[1]); - STR(szPrevGames[2]); - STR(szPrevGames[3]); - STR(szPrevGames[4]); - STR(szPrevGames[5]); - STR(szPrevGames[6]); - STR(szPrevGames[7]); - STR(szPrevGames[8]); - STR(szPrevGames[9]); - - // MVS cartridges - DRV(nBurnDrvSelect[0]); - DRV(nBurnDrvSelect[1]); - DRV(nBurnDrvSelect[2]); - DRV(nBurnDrvSelect[3]); - DRV(nBurnDrvSelect[4]); - DRV(nBurnDrvSelect[5]); - - VAR(bNeoCDListScanSub); - VAR(bNeoCDListScanOnlyISO); - - // Default Controls - VAR(nPlayerDefaultControls[0]); - STR(szPlayerDefaultIni[0]); - VAR(nPlayerDefaultControls[1]); - STR(szPlayerDefaultIni[1]); - VAR(nPlayerDefaultControls[2]); - STR(szPlayerDefaultIni[2]); - VAR(nPlayerDefaultControls[3]); - STR(szPlayerDefaultIni[3]); - -#undef DRV -#undef PAT -#undef STR -#undef FLT -#undef VAR -#undef VAR64 - } - - fclose(h); - return 0; -} - -// Write out the config file for the whole application -int ConfigAppSave() -{ - TCHAR szConfig[MAX_PATH]; - FILE *h; - - if (bCmdOptUsed) { - return 1; - } - -#ifdef _UNICODE - setlocale(LC_ALL, ""); -#endif - - CreateConfigName(szConfig); - - if ((h = _tfopen(szConfig, _T("wt"))) == NULL) { - return 1; - } - - // Write title - _ftprintf(h, _T("// ") _T(APP_TITLE) _T(" v%s --- Main Config File\n\n"), szAppBurnVer); - _ftprintf(h, _T("// Don't edit this file manually unless you know what you're doing\n")); - _ftprintf(h, _T("// ") _T(APP_TITLE) _T(" will restore default settings when this file is deleted\n")); - -#define VAR(x) _ftprintf(h, _T(#x) _T(" %d\n"), x) -#define VAR64(x) _ftprintf(h, _T(#x) _T(" %lf\n"), (float)x) -#define FLT(x) _ftprintf(h, _T(#x) _T(" %lf\n"), x) -#define STR(x) _ftprintf(h, _T(#x) _T(" %s\n"), x) -#define DRV(x) _ftprintf(h, _T(#x) _T(" %s\n"), DriverToName(x)) - - _ftprintf(h, _T("\n// The application version this file was saved from\n")); - // We can't use the macros for this! - _ftprintf(h, _T("nIniVersion 0x%06X"), nBurnVer); - -#ifdef BUILD_A68K - _ftprintf(h, _T("\n\n\n")); - _ftprintf(h, _T("// --- emulation --------------------------------------------------------------\n")); - - _ftprintf(h, _T("\n// If non-zero, use A68K for MC68000 emulation\n")); - - bBurnUseASMCPUEmulation = 0; // Assembly MC68000 emulation only availble on a per-session basis. Causes too many problems in a non-debug setting. - VAR(bBurnUseASMCPUEmulation); -#endif - - _ftprintf(h, _T("\n\n\n")); - _ftprintf(h, _T("// --- Video ------------------------------------------------------------------\n")); - - // Horizontal oriented - _ftprintf(h, _T("\n// (Horizontal Oriented) The display mode to use for fullscreen\n")); - VAR(nVidHorWidth); VAR(nVidHorHeight); - _ftprintf(h, _T("\n// (Horizontal Oriented) If non-zero, use the same fullscreen resolution as the original arcade game\n")); - VAR(bVidArcaderesHor); - _ftprintf(h, _T("\n// (Horizontal Oriented) The preset resolutions appearing in the menu\n")); - VAR(VidPreset[0].nWidth); VAR(VidPreset[0].nHeight); - VAR(VidPreset[1].nWidth); VAR(VidPreset[1].nHeight); - VAR(VidPreset[2].nWidth); VAR(VidPreset[2].nHeight); - VAR(VidPreset[3].nWidth); VAR(VidPreset[3].nHeight); - _ftprintf(h, _T("\n// (Horizontal Oriented) Full-screen size (0 = use display mode variables)\n")); - VAR(nScreenSizeHor); - - // Vertical oriented - _ftprintf(h, _T("\n// (Vertical Oriented) The display mode to use for fullscreen\n")); - VAR(nVidVerWidth); VAR(nVidVerHeight); - _ftprintf(h, _T("\n// (Vertical Oriented) If non-zero, use the same fullscreen resolution as the original arcade game\n")); - VAR(bVidArcaderesVer); - _ftprintf(h, _T("\n// (Vertical Oriented) The preset resolutions appearing in the menu\n")); - VAR(VidPresetVer[0].nWidth); VAR(VidPresetVer[0].nHeight); - VAR(VidPresetVer[1].nWidth); VAR(VidPresetVer[1].nHeight); - VAR(VidPresetVer[2].nWidth); VAR(VidPresetVer[2].nHeight); - VAR(VidPresetVer[3].nWidth); VAR(VidPresetVer[3].nHeight); - _ftprintf(h, _T("\n// (Vertical Oriented) Full-screen size (0 = use display mode variables)\n")); - VAR(nScreenSizeVer); - - _ftprintf(h, _T("\n// Full-screen bit depth\n")); - VAR(nVidDepth); - _ftprintf(h, _T("\n// Specify the refresh rate, 0 = default (changing this will not work with many video cards)\n")); - VAR(nVidRefresh); - _ftprintf(h, _T("\n// If non-zero, do not rotate the graphics for vertical games\n")); - VAR(nVidRotationAdjust); - _ftprintf(h, _T("\n// Initial window size (0 = autosize)\n")); - VAR(nWindowSize); - _ftprintf(h, _T("\n// Window position\n")); - VAR(nWindowPosX); VAR(nWindowPosY); - _ftprintf(h, _T("\n// If non-zero, perform gamma correction\n")); - VAR(bDoGamma); - _ftprintf(h, _T("\n// If non-zero, use the video hardware to correct gamma\n")); - VAR(bVidUseHardwareGamma); - _ftprintf(h, _T("\n// If non-zero, don't fall back on software gamma correction\n")); - VAR(bHardwareGammaOnly); - _ftprintf(h, _T("\n// Gamma to correct with\n")); - FLT(nGamma); - _ftprintf(h, _T("\n// If non-zero, auto-switch to fullscreen after loading game\n")); - VAR(bVidAutoSwitchFull); - _ftprintf(h, _T("\n// Monitor for Horizontal Games (GDI Identifier)\n")); - STR(HorScreen); - _ftprintf(h, _T("\n// Monitor for Vertical Games (GDI Identifier)\n")); - STR(VerScreen); - _ftprintf(h, _T("\n// If non-zero, allow stretching of the image to any size\n")); - VAR(bVidFullStretch); - _ftprintf(h, _T("\n// If non-zero, stretch the image to the largest size preserving aspect ratio\n")); - VAR(bVidCorrectAspect); - _ftprintf(h, _T("\n// If non-zero, try to use a triple buffer in fullscreen\n")); - VAR(bVidTripleBuffer); - _ftprintf(h, _T("\n// If non-zero, try to synchronise blits with the display\n")); - VAR(bVidVSync); - _ftprintf(h, _T("\n// Transfer method: 0 = blit from system memory / use driver/DirectX texture management;\n")); - _ftprintf(h, _T("// 1 = copy to a video memory surface, then use bltfast();\n")); - _ftprintf(h, _T("// -1 = autodetect for DirectDraw, equals 1 for Direct3D\n")); - VAR(nVidTransferMethod); - _ftprintf(h, _T("\n// If non-zero, draw scanlines to simulate a low-res monitor\n")); - VAR(bVidScanlines); - _ftprintf(h, _T("\n// Maximum scanline intensity\n")); - VAR(nVidScanIntensity); - _ftprintf(h, _T("\n// If non-zero, rotate scanlines and RGB effects for rotated games\n")); - VAR(bVidScanRotate); - _ftprintf(h, _T("\n// The selected blitter module\n")); - VAR(nVidSelect); - _ftprintf(h, _T("\n// Options for the blitter modules\n")); - VAR(nVidBlitterOpt[0]); - VAR64(nVidBlitterOpt[1]); - VAR(nVidBlitterOpt[2]); - VAR(nVidBlitterOpt[3]); - VAR(nVidBlitterOpt[4]); - _ftprintf(h, _T("\n// If non-zero, attempt to auto-detect the monitor aspect ratio\n")); - VAR(bMonitorAutoCheck); - _ftprintf(h, _T("\n// The aspect ratio of the monitor\n")); - VAR(nVidScrnAspectX); - VAR(nVidScrnAspectY); - _ftprintf(h, _T("\n// If non-zero, force all games to use a 60Hz refresh rate\n")); - VAR(bForce60Hz); - _ftprintf(h, _T("\n// If non-zero, skip frames when needed to keep the emulation running at full speed\n")); - VAR(bAlwaysDrawFrames); - - _ftprintf(h, _T("\n")); - _ftprintf(h, _T("// --- DirectDraw blitter module settings -------------------------------------\n")); - _ftprintf(h, _T("\n// If non-zero, draw scanlines at 50%% intensity\n")); - VAR(bVidScanHalf); - _ftprintf(h, _T("\n// If non-zero, force flipping for games that need it\n")); - VAR(bVidForceFlip); - _ftprintf(h, _T("\n")); - _ftprintf(h, _T("// --- Direct3D 7 blitter module settings -------------------------------------\n")); - _ftprintf(h, _T("\n// If non-zero, use bi-linear filtering to display the image\n")); - VAR(bVidBilinear); - _ftprintf(h, _T("\n// If non-zero, simulate slow phosphors (feedback)\n")); - VAR(bVidScanDelay); - _ftprintf(h, _T("\n// If non-zero, use bi-linear filtering for the scanlines\n")); - VAR(bVidScanBilinear); - _ftprintf(h, _T("\n// Feedback amount for slow phosphor simulation\n")); - VAR(nVidFeedbackIntensity); - _ftprintf(h, _T("\n// Oversaturation amount for slow phosphor simulation\n")); - VAR(nVidFeedbackOverSaturation); - _ftprintf(h, _T("\n// Angle at wich the emulated screen is tilted (in radians)\n")); - FLT(fVidScreenAngle); - _ftprintf(h, _T("\n// Angle of the sphere segment used for the 3D screen (in radians)\n")); - FLT(fVidScreenCurvature); - _ftprintf(h, _T("\n// If non-zero, force 16 bit emulation even in 32-bit screenmodes\n")); - VAR(bVidForce16bit); - _ftprintf(h, _T("\n")); - _ftprintf(h, _T("// --- DirectX Graphics 9 blitter module settings -----------------------------\n")); - _ftprintf(h, _T("\n// The filter parameters for the cubic filter\n")); - FLT(dVidCubicB); - FLT(dVidCubicC); - _ftprintf(h, _T("\n")); - _ftprintf(h, _T("// --- DirectX Graphics 9 Alt blitter module settings -------------------------\n")); - _ftprintf(h, _T("\n// If non-zero, use bi-linear filtering to display the image\n")); - VAR(bVidDX9Bilinear); - _ftprintf(h, _T("\n// If non-zero, use hardware vertex to display the image\n")); - VAR(bVidHardwareVertex); - _ftprintf(h, _T("\n// If non-zero, use motion blur to display the image\n")); - VAR(bVidMotionBlur); - _ftprintf(h, _T("\n// If non-zero, force 16 bit emulation even in 32-bit screenmodes\n")); - VAR(bVidForce16bitDx9Alt); - - _ftprintf(h, _T("\n\n\n")); - _ftprintf(h, _T("// --- Sound ------------------------------------------------------------------\n")); - _ftprintf(h, _T("\n// The selected audio plugin\n")); - VAR(nAudSelect); - _ftprintf(h, _T("\n// Number of frames in sound buffer (= sound lag)\n")); - VAR(nAudSegCount); - _ftprintf(h, _T("\n// The order of PCM/ADPCM interpolation\n")); - VAR(nInterpolation); - _ftprintf(h, _T("\n// The order of FM interpolation\n")); - VAR(nFMInterpolation); - _ftprintf(h, _T("\n")); - _ftprintf(h, _T("// --- DirectSound plugin settings --------------------------------------------\n")); - _ftprintf(h, _T("\n// Sample rate\n")); - VAR(nAudSampleRate[0]); - _ftprintf(h, _T("\n// DSP module to use for sound enhancement: 0 = none, 1 = low-pass filter\n")); - VAR(nAudDSPModule[0]); - _ftprintf(h, _T("\n")); - _ftprintf(h, _T("// --- XAudio2 plugin settings ------------------------------------------------\n")); - _ftprintf(h, _T("\n// Sample rate\n")); - VAR(nAudSampleRate[1]); - _ftprintf(h, _T("\n// DSP module to use for sound enhancement: 0 = none, 1 = low-pass filter, 2 = reverb\n")); - VAR(nAudDSPModule[1]); - - _ftprintf(h, _T("\n\n\n")); - _ftprintf(h, _T("// --- UI ---------------------------------------------------------------------\n")); - - _ftprintf(h, _T("\n// Filename of the active UI translation template\n")); - STR(szLocalisationTemplate); - - _ftprintf(h, _T("\n// Filename of the active gamelist translation template\n")); - STR(szGamelistLocalisationTemplate); - - _ftprintf(h, _T("\n// If non-zero, enable gamelist localisation\n")); - VAR(nGamelistLocalisationActive); - - _ftprintf(h, _T("\n// 1 = display pause/record/replay/kaillera icons in the upper right corner of the display\n")); - VAR(nVidSDisplayStatus); - _ftprintf(h, _T("\n// Minimum height (in pixels) of the font used for the Kaillera chat function (used for arcade resolution)\n")); - VAR(nMinChatFontSize); - _ftprintf(h, _T("\n// Maximum height (in pixels) of the font used for the Kaillera chat function (used for 1280x960 or higher).\n")); - VAR(nMaxChatFontSize); - - _ftprintf(h, _T("\n// Make the menu modeless\n")); - VAR(bModelessMenu); - - _ftprintf(h, _T("\n// Minimum length of time to display the splash screen (in milliseconds)\n")); - VAR(nSplashTime); - - _ftprintf(h, _T("\n// If non-zero, load and save all ram (the state)\n")); - VAR(bDrvSaveAll); - _ftprintf(h, _T("\n// The thread priority for the application. Do *NOT* edit this manually\n")); - VAR(nAppThreadPriority); - _ftprintf(h, _T("\n// If non-zero, process keyboard input even when the application loses focus\n")); - VAR(bAlwaysProcessKeyboardInput); - _ftprintf(h, _T("\n// If non-zero, pause when the application loses focus\n")); - VAR(bAutoPause); - _ftprintf(h, _T("\n// If non-zero, save the inputs for each game\n")); - VAR(bSaveInputs); - - _ftprintf(h, _T("\n\n\n")); - _ftprintf(h, _T("// --- CD emulation -----------------------------------------------------------\n")); - _ftprintf(h, _T("\n // The selected CD emulation module\n")); - VAR(nCDEmuSelect); - _ftprintf(h, _T("\n // The path to the CD image to use (.cue or .iso)\n")); - STR(CDEmuImage); - - _ftprintf(h, _T("\n\n\n")); - _ftprintf(h, _T("// --- Load Game Dialogs ------------------------------------------------------\n")); - _ftprintf(h, _T("\n// Load game dialog dimensions (in win32 client co-ordinates)\n")); - VAR(nSelDlgWidth); - VAR(nSelDlgHeight); - - _ftprintf(h, _T("\n// Load game dialog options\n")); - VAR(nLoadMenuShowX); - VAR(nLoadMenuShowY); - - _ftprintf(h, _T("\n// Load game dialog board type filter options\n")); - VAR(nLoadMenuBoardTypeFilter); - - _ftprintf(h, _T("\n// Load game dialog genre filter options\n")); - VAR(nLoadMenuGenreFilter); - - _ftprintf(h, _T("\n// Load game dialog favorites filter options\n")); - VAR(nLoadMenuFavoritesFilter); - - _ftprintf(h, _T("\n// Load game dialog family filter options\n")); - VAR(nLoadMenuFamilyFilter); - - _ftprintf(h, _T("\n// The paths to search for rom zips (include trailing backslash)\n")); - STR(szAppRomPaths[0]); - STR(szAppRomPaths[1]); - STR(szAppRomPaths[2]); - STR(szAppRomPaths[3]); - STR(szAppRomPaths[4]); - STR(szAppRomPaths[5]); - STR(szAppRomPaths[6]); - STR(szAppRomPaths[7]); - STR(szAppRomPaths[8]); - STR(szAppRomPaths[9]); - STR(szAppRomPaths[10]); - STR(szAppRomPaths[11]); - STR(szAppRomPaths[12]); - STR(szAppRomPaths[13]); - STR(szAppRomPaths[14]); - STR(szAppRomPaths[15]); - STR(szAppRomPaths[16]); - STR(szAppRomPaths[17]); - STR(szAppRomPaths[18]); - STR(szAppRomPaths[19]); - - _ftprintf(h, _T("\n// The path to search for Neo Geo CDZ isos\n")); - STR(szNeoCDGamesDir); - - _ftprintf(h, _T("\n// The paths to search for support files (include trailing backslash)\n")); - STR(szAppPreviewsPath); - STR(szAppTitlesPath); - STR(szAppCheatsPath); - STR(szAppHiscorePath); - STR(szAppSamplesPath); - STR(szAppIpsPath); - STR(szAppIconsPath); - STR(szNeoCDCoverDir); - STR(szAppBlendPath); - STR(szAppSelectPath); - STR(szAppVersusPath); - STR(szAppScoresPath); - STR(szAppBossesPath); - STR(szAppGameoverPath); - STR(szAppFlyersPath); - STR(szAppMarqueesPath); - STR(szAppControlsPath); - STR(szAppCabinetsPath); - STR(szAppPCBsPath); - STR(szAppHistoryPath); - STR(szAppEEPROMPath); - - _ftprintf(h, _T("\n// The cartridges to use for emulation of an MVS system\n")); - DRV(nBurnDrvSelect[0]); - DRV(nBurnDrvSelect[1]); - DRV(nBurnDrvSelect[2]); - DRV(nBurnDrvSelect[3]); - DRV(nBurnDrvSelect[4]); - DRV(nBurnDrvSelect[5]); - - _ftprintf(h, _T("\n// Neo Geo CD Load Game Dialog options\n")); - VAR(bNeoCDListScanSub); - VAR(bNeoCDListScanOnlyISO); - - _ftprintf(h, _T("\n\n\n")); - _ftprintf(h, _T("// --- miscellaneous ---------------------------------------------------------\n")); - - _ftprintf(h, _T("\n// If non-zero, don't change the status of the Num Lock key.\n")); - VAR(bNoChangeNumLock); - - _ftprintf(h, _T("\n// If non-zero, create support folders at program start.\n")); - VAR(bAlwaysCreateSupportFolders); - - _ftprintf(h, _T("\n// Auto-Fire Rate, non-linear - use the GUI to change this setting!\n")); - VAR(nAutoFireRate); - - _ftprintf(h, _T("\n// If non-zero, enable high score saving support.\n")); - VAR(EnableHiscores); - - _ftprintf(h, _T("\n// If non-zero, enable alpha blending support.\n")); - VAR(bBurnUseBlend); - - _ftprintf(h, _T("\n// If non-zero, enable gear shifter display support.\n")); - VAR(BurnShiftEnabled); - - _ftprintf(h, _T("\n// If non-zero, DISABLE start-up rom scan (if needed).\n")); - VAR(bSkipStartupCheck); - -#ifdef INCLUDE_AVI_RECORDING - _ftprintf(h, _T("\n// If non-zero, enable 1x - 3x pixel output for the AVI writer.\n")); - VAR(nAvi3x); -#endif - - _ftprintf(h, _T("\n// The language index to use for the IPS Patch Manager dialog.\n")); - VAR(nIpsSelectedLanguage); - - _ftprintf(h, _T("\n// If non-zero, display drivers icons.\n")); - VAR(bEnableIcons); - - _ftprintf(h, _T("\n// Specify icons display size, 0 = 16x16 , 1 = 24x24, 2 = 32x32.\n")); - VAR(nIconsSize); - - _ftprintf(h, _T("\n// Previous games list.\n")); - STR(szPrevGames[0]); - STR(szPrevGames[1]); - STR(szPrevGames[2]); - STR(szPrevGames[3]); - STR(szPrevGames[4]); - STR(szPrevGames[5]); - STR(szPrevGames[6]); - STR(szPrevGames[7]); - STR(szPrevGames[8]); - STR(szPrevGames[9]); - - _ftprintf(h, _T("\n// Player default controls, number is the index of the configuration in the input dialog\n")); - VAR(nPlayerDefaultControls[0]); - STR(szPlayerDefaultIni[0]); - VAR(nPlayerDefaultControls[1]); - STR(szPlayerDefaultIni[1]); - VAR(nPlayerDefaultControls[2]); - STR(szPlayerDefaultIni[2]); - VAR(nPlayerDefaultControls[3]); - STR(szPlayerDefaultIni[3]); - - _ftprintf(h, _T("\n\n\n")); - -#undef DRV -#undef STR -#undef FLT -#undef VAR -#undef VAR64 - - fclose(h); - return 0; -} - diff --git a/jan/src/burner/win32/debugger.cpp b/jan/src/burner/win32/debugger.cpp deleted file mode 100644 index 62b20c5fc..000000000 --- a/jan/src/burner/win32/debugger.cpp +++ /dev/null @@ -1,1579 +0,0 @@ -#include "burner.h" - -HWND hDbgDlg = NULL; - -#if defined (FBA_DEBUG) - -#include "m68000_intf.h" -#include "m68000_debug.h" -#include "richedit.h" - -static bool bLargeWindow; -static bool bOldPause; - -static HFONT hCommandFont = NULL; -static unsigned int nMouseWheelScrollLines; - -static unsigned int nActiveWindow; -static unsigned int nDisassWindow; -static unsigned int nMemdumpWindow; - -static int nDisassCPUType; - -static unsigned int nDisassAddress[16]; -static int nDisassArea; -static int nDisassAttrib; - -static int nMemdumpAddress; -static int nMemdumpArea; -static int nMemdumpAttrib; - -static bool bBreakpointHit; - -#if defined FBA_DEBUG -extern UINT8 DebugCPU_SekInitted; -#endif - -struct DbgM68000State { - unsigned int a[8]; unsigned int d[8]; - unsigned int pc; - unsigned int sr; - unsigned int sp; unsigned int usp; unsigned int isp; unsigned int msp; - unsigned int vbr; - unsigned int sfc; unsigned int dfc; - unsigned int cacr; unsigned int caar; - - unsigned int irq; -}; - -static DbgM68000State curr_m68000, prev_m68000; - -static int nDbgMemoryAreaCount; -static int nDbgCurrentMemoryArea; -static struct BurnArea* DbgMemoryAreaInfo = NULL; - -// ---------------------------------------------------------------------------- -// Callbacks for m68k's disassembler - -static unsigned int DbgFetchByte(unsigned int nAddress) { return SekFetchByte(nAddress); } -static unsigned int DbgFetchWord(unsigned int nAddress) { return SekFetchWord(nAddress); } -static unsigned int DbgFetchLong(unsigned int nAddress) { return SekFetchLong(nAddress); } - -static unsigned int DbgFetchByteArea(unsigned int nAddress) -{ - if (nAddress < DbgMemoryAreaInfo[nDisassArea].nLen) { - return ((unsigned char*)(DbgMemoryAreaInfo[nDisassArea].Data))[nAddress ^ nDisassAttrib]; - } - - return 0; -} -static unsigned int DbgFetchWordArea(unsigned int nAddress) -{ - return (DbgFetchByteArea(nAddress) << 8) | DbgFetchByteArea(nAddress + 1); -} -static unsigned int DbgFetchLongArea(unsigned int nAddress) -{ - return (DbgFetchWordArea(nAddress) << 16) | DbgFetchWordArea(nAddress + 2); -} - -// ---------------------------------------------------------------------------- -// Message pump used when a breakpoint is hit - -static void BreakpointMessagePump() -{ - MSG msg; - - while (GetMessage(&msg, NULL, 0, 0)) { - - if (IsDialogMessage(hDbgDlg, &msg)) { - continue; - } - if (msg.message == (WM_APP + 0)) { - bBreakpointHit = false; - return; - } - - TranslateMessage(&msg); - DispatchMessage(&msg); - } -} - -// ---------------------------------------------------------------------------- -// Feedback functions - -static void InitFeedback(HWND hWindow) -{ - TCHAR szBuffer[16384] = _T(""); - TCHAR* pszBuf = szBuffer; - - // RTF header and initial settings - pszBuf += _stprintf(pszBuf, _T("{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl(\\f0\\fmodern\\charset0\\fprq0 Courier New;)}{\\colortbl\\red0\\green0\\blue0;\\red96\\green96\\blue96;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}\\deflang1033\\horzdoc\\pard\\plain\\f0\\fs18\\cf2 Welcome to the FB Alpha debugger.\\par}")); - // Send the new data to the RichEdit control - SendMessage(hWindow, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuffer); -} - -static int AddFeedback(HWND hWindow, TCHAR* pszText) -{ -#ifdef UNICODE - SETTEXTEX settext = { ST_SELECTION, 1200 }; -#else - SETTEXTEX settext = { ST_SELECTION, 1252 }; -#endif - - // Add the new info to the top - SendMessage(hWindow, EM_SETSEL, (WPARAM)0, (LPARAM)0); - // Doesn't work if you send it Unicode data... - SendMessageA(hWindow, EM_SETTEXTEX, (WPARAM)&settext, (LPARAM)TCHARToANSI(pszText, NULL, 0)); - - // Trim the bottom lines - SendMessage(hWindow, EM_SETSEL, (WPARAM)SendMessage(hWindow, EM_LINEINDEX, 18, 0) - 1, (LPARAM)-1); - SendMessage(hWindow, EM_SETTEXTEX, (WPARAM)&settext, (LPARAM)_T("")); - - return 0; -} - -// ---------------------------------------------------------------------------- -// Trace back instructions starting at a given address - -static unsigned int trace_pc, trace_size, trace_max; - -static void TraceBackDo(unsigned int start_pc, unsigned int trace_level, int cpu_type) -{ - unsigned int pc; - unsigned int trace; - - // Go over all possible instruction sizes (the longest 68020 instruction is 30 bytes) - for (unsigned int size = (cpu_type == M68K_CPU_TYPE_68000) ? 10 : 30; size != 0 ; size -= 2) { - pc = start_pc; - trace = trace_level; - - // Make sure we don't go past the start of memory - if (size > pc) { - break; - } - - // Check if there is a valid instruction at the current address - if (m68k_is_valid_instruction(SekFetchWord(pc - size), cpu_type) != 0) { - char buf[100] = ""; - - // Check if the instruction at the current address has the right size - if (m68k_disassemble(buf, pc - size, cpu_type) == size) { - pc -= size; - trace++; - - // Update best result - if (trace_size < trace) { - trace_size = trace; - trace_pc = pc; - } - - // Recurse until we've traced back enough instructions - if (trace < trace_max) { - TraceBackDo(pc, trace, cpu_type); - } - } - } - } -} - -static unsigned int TraceBack(unsigned int nStartAddress, unsigned int nTotalInstructions, int nCPU) -{ - unsigned int pc = nStartAddress; - unsigned int trace = nTotalInstructions; - - if (nStartAddress == 0 || nTotalInstructions == 0) { - return 0; - } - - // If there's no valid instruction at the start adress, increase it - while (m68k_is_valid_instruction(SekFetchWord(pc), nCPU) == 0 && (pc - nStartAddress) < ((nCPU == M68K_CPU_TYPE_68000) ? 10 : 30) - 2) { - pc += 2; - } - - do { - trace_size = 0; - trace_pc = pc; - // Trace back a few extra instructions to ensure we'll return a valid code path - trace_max = trace + 4; - - TraceBackDo(pc, 0, nCPU); - - pc -= 2; - - } while (trace_size == 0 && pc >= nStartAddress); - - pc = trace_pc; - - // If we've traced back more instructions than needed, skip the extra ones - while (trace_size > trace) { - char buf[100] = ""; - pc += m68k_disassemble(buf, pc, nCPU); - trace++; - } - - // If we can't trace back at all, simply decrease the address - if (trace_size == 0) { - return nTotalInstructions * 2 < nStartAddress ? nStartAddress - nTotalInstructions * 2 : 0; - } - - return pc; -} - -// ---------------------------------------------------------------------------- -// Write a disassembly to a file - -static int CreateDisassFile(TCHAR* filename, unsigned int start, unsigned int end, int nCPU) -{ - unsigned int size; - unsigned int pc = start; - FILE* fp = _tfopen(filename, _T("wt")); - - if (fp == NULL) { - return 1; - } - - // Print the disassembly - while (pc <= end) { - char buf[100] = ""; - unsigned int j; - - if (pc > 0x00FFFFFE) { - break; - } - - // Get the mnemonic - size = m68k_disassemble(buf, pc, nCPU); - - // Print the address - _ftprintf(fp, _T("%06x "), pc); - - // Print the word values - if (nCPU == M68K_CPU_TYPE_68000) { - for (j = 10; j > size; j -= 2) { - _ftprintf(fp, _T(" ")); - } - for (j = 0; j < size; j += 2) { - _ftprintf(fp, _T("%04x "), SekFetchWord(pc + j)); - } - } else { - if (size > 20) { - for (j = 0; j < 18; j += 2) { - _ftprintf(fp, _T("%04x "), SekFetchWord(pc + j)); - } - _ftprintf(fp, _T("... ")); - } else { - for (j = 20; j > size; j -= 2) { - _ftprintf(fp, _T(" ")); - } - for (j = 0; j < size; j += 2) { - _ftprintf(fp, _T("%04x "), SekFetchWord(pc + j)); - } - } - } - - // Print the instruction - _ftprintf(fp, _T("%hs\n"), buf); - - pc += size; - } - - fclose(fp); - - return 0; -} - -// ---------------------------------------------------------------------------- -// Create a disassembly in RTF format - -// Tabs are specified in twips (a single 16pt cell = 100twips) - -static void CreateDisass(HWND hWindow, unsigned int nAddress, int nCPU) -{ - int nPageSize = bLargeWindow ? 16 : 12; - TCHAR szBuffer[16384] = _T(""); - TCHAR* pszBuf = szBuffer; - unsigned int pc, nSize; - - pc = nAddress; - - // RTF header and initial settings - pszBuf += _stprintf(pszBuf, _T("{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl(\\f0\\fmodern\\charset0\\fprq0 Courier New;)}{\\colortbl\\red0\\green0\\blue0;\\red96\\green96\\blue96;\\red255\\green0\\blue0;\\red255\\green96\\blue96;\\red224\\green224\\blue224;}\\deflang1033\\horzdoc\\pard\\plain\\f0")); - if (bLargeWindow) { - if (nCPU == M68K_CPU_TYPE_68000) { - // Tabstops 5555 4444 3333 2222 1111 Mnemonic - pszBuf += _stprintf(pszBuf, _T("\\tx1050\\tx1513\\tx1976\\tx2429\\tx2892\\tx3450")); - } else { - // Tabstops 6666 5555 4444 3333 2222 1111 Mnemonic - pszBuf += _stprintf(pszBuf, _T("\\tx1050\\tx1435\\tx1820\\tx2205\\tx2590\\tx2975\\tx3450")); - } - // Indentation - pszBuf += _stprintf(pszBuf, _T("\\fi-4665\\li4665 ")); - } else { - // Tabstops - pszBuf += _stprintf(pszBuf, _T("\\tx735")); - } - - // Print the disassembly - for (int i = 0; i < nPageSize; i++) { - char buf[100] = ""; - unsigned int j; - unsigned int nCol; - - if (pc > 0x00FFFFFE) { - - do { - nDisassAddress[i++] = 0x00FFFFFE; - } while (i < nPageSize); - - break; - } - - nDisassAddress[i] = pc; - - // Get the mnemonic - nSize = m68k_disassemble(buf, pc, nCPU); - // Display the instruction at the current PC in red - nCol = (pc == SekDbgGetRegister(SEK_REG_PC)) ? 2 : 0; - - // Print the address - pszBuf += _stprintf(pszBuf, _T("\\fs%i\\cf%i %06x\t"), bLargeWindow ? 24 : 16, nCol, pc); - - if (bLargeWindow) { - // Print the word values - if (nCPU == M68K_CPU_TYPE_68000) { - // Print a filler - pszBuf += _stprintf(pszBuf, _T("\\fs16\\cf4 ")); - for (j = 10; j > nSize; j -= 2) { - pszBuf += _stprintf(pszBuf, _T(" -- \t")); - } - // Print the words that make up the instruction - pszBuf += _stprintf(pszBuf, _T("\\cf%i "), nCol + 1); - for (j = 0; j < nSize; j += 2) { - pszBuf += _stprintf(pszBuf, _T("%04x\t"), SekFetchWord(pc + j)); - } - } else { - if (nSize > 12) { - // There's not enough room for all words, so print the first 5 words that make up the instruction - pszBuf += _stprintf(pszBuf, _T("\\fs13\\cf%i "), nCol + 1); - for (j = 0; j < 10; j += 2) { - pszBuf += _stprintf(pszBuf, _T("%04x\t"), SekFetchWord(pc + j)); - } - // Print an ellipsis - pszBuf += _stprintf(pszBuf, _T("... \t")); - } else { - // Print a filler - pszBuf += _stprintf(pszBuf, _T("\\fs13\\cf4 ")); - for (j = 12; j > nSize; j -= 2) { - pszBuf += _stprintf(pszBuf, _T(" -- \t")); - } - // Print the words that make up the instruction - pszBuf += _stprintf(pszBuf, _T("\\cf%i "), nCol + 1); - for (j = 0; j < nSize; j += 2) { - pszBuf += _stprintf(pszBuf, _T("%04x\t"), SekFetchWord(pc + j)); - } - } - } - } - - // Colour Invalid instructions gray - if (nCol == 0) { - if (m68k_is_valid_instruction(SekFetchWord(pc), nCPU) == 0) { - nCol++; - } - } - // Print the instruction - pszBuf += _stprintf(pszBuf, _T("\\fs%i\\cf%i %hs\\par"), bLargeWindow ? 24 : 16, nCol, buf); - - pc += nSize; - } - pszBuf += _stprintf(pszBuf, _T("}\0")); - - // Send the new data to the RichEdit control - SendMessage(hWindow, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuffer); - -#if 0 - FILE* fp = _tfopen(_T("disass.rtf"), _T("wb")); - if (fp) { - fwrite(szBuffer, 1, _tcslen(szBuffer), fp); - fclose(fp); - } -#endif -} - -// ---------------------------------------------------------------------------- -// Create a memory dump in RTF format - -static unsigned int DbgReadByteArea(unsigned int nAddress) -{ - if (nAddress < DbgMemoryAreaInfo[nDbgCurrentMemoryArea].nLen) { - return ((unsigned char*)(DbgMemoryAreaInfo[nDbgCurrentMemoryArea].Data))[nAddress ^ nMemdumpAttrib]; - } - - return 0; -} - -static void CreateMemdump(HWND hWindow, int nArea, unsigned int nAddress) -{ - int nPageSize = bLargeWindow ? 16 : 12; - unsigned int (*DbgReadByte)(unsigned int); - TCHAR szBuffer[16384] = _T(""); - TCHAR* pszBuf = szBuffer; - unsigned int pc; - - nDbgCurrentMemoryArea = nArea; - - if (nDbgCurrentMemoryArea) { - DbgReadByte = DbgReadByteArea; - } else { - DbgReadByte = SekReadByte; - } - - pc = nAddress; - - // RTF header and initial settings - pszBuf += _stprintf(pszBuf, _T("{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl(\\f0\\fmodern\\fprq0 Courier New\\cpg1252;)}{\\colortbl\\red96\\green96\\blue96;\\red255\\green255\\blue255;\\red0\\green0\\blue0;\\red160\\green160\\blue160;\\red0\\green0\\blue0;\\red224\\green224\\blue224;}\\deflang1033\\horzdoc\\pard\\f0\\plain")); - - if (bLargeWindow) { - // Tabstops 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF abcdefghijklnmop - pszBuf += _stprintf(pszBuf, _T("\\tx1050\\tx1375\\tx1700\\tx2025\\tx2400\\tx2725\\tx3050\\tx3375\\tx3750\\tx4075\\tx4400\\tx4725\\tx5100\\tx5425\\tx5750\\tx6075\\tx6500")); - - // Print the memory dump - for (int i = 0; i < nPageSize; i++, pc += 16) { - pszBuf += _stprintf(pszBuf, _T("\\cf4 %06x\t"), pc); - for (int j = 0; j < 16; j += 2) { - pszBuf += _stprintf(pszBuf, _T("\\cf0\\cb1 %02x\t\\cf2\\cb3 %02x\t"), DbgReadByte(pc + j), DbgReadByte(pc + j + 1)); - } - pszBuf += _stprintf(pszBuf, _T("\\cf4 ")); - for (int j = 0; j < 16; j++) { - unsigned char c = DbgReadByte(pc + j); - - if (c == 0x00 || (c >= 0x09 && c <= 0x0D)) { - pszBuf += _stprintf(pszBuf, _T("{\\cf5 -}")); - } else { - pszBuf += _stprintf(pszBuf, _T("\\\'%02x"), c); - } - } - pszBuf += _stprintf(pszBuf, _T("\\par ")); - } - pszBuf += _stprintf(pszBuf, _T("}\0")); - } else { - pszBuf += _stprintf(pszBuf, _T("\\fs16")); - for (int i = 0; i < nPageSize; i++, pc += 16) { - pszBuf += _stprintf(pszBuf, _T("\\cf4 %06x "), pc); - for (int j = 0; j < 16; j += 2) { - pszBuf += _stprintf(pszBuf, _T("\\cf0\\cb1 %02x\\cf2\\cb3 %02x"), DbgReadByte(pc + j), DbgReadByte(pc + j + 1)); - } - pszBuf += _stprintf(pszBuf, _T("\\cf4 ")); - for (int j = 0; j < 16; j++) { - unsigned char c = DbgReadByte(pc + j); - - if (c == 0x00 || (c >= 0x09 && c <= 0x0D)) { - pszBuf += _stprintf(pszBuf, _T("{\\cf5 -}")); - } else { - pszBuf += _stprintf(pszBuf, _T("\\\'%02x"), c); - } - } - pszBuf += _stprintf(pszBuf, _T("\\par ")); - } - pszBuf += _stprintf(pszBuf, _T("}\0")); - } - - // Send the new data to the RichEdit control - SendMessage(hWindow, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuffer); - -#if 0 - FILE* fp = _tfopen(_T("memdump.rtf"), _T("wb")); - if (fp) { - fwrite(szBuffer, 1, _tcslen(szBuffer), fp); - fclose(fp); - } -#endif -} - -// ---------------------------------------------------------------------------- -// Memory area setup - -static int __cdecl GetMemoryAcb(struct BurnArea* pba) -{ - TCHAR szAreaName[256] = _T(""); - - memcpy(DbgMemoryAreaInfo + nDbgMemoryAreaCount, pba, sizeof(BurnArea)); - - _stprintf(szAreaName, _T("%hs - %x bytes"), pba->szName, pba->nLen); - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN1_DRP1, CB_ADDSTRING, 0, (LPARAM)szAreaName); - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN2_DRP1, CB_ADDSTRING, 0, (LPARAM)szAreaName); - - nDbgMemoryAreaCount++; - - return 0; -} - -static int GetMemoryAreas() -{ - nDbgMemoryAreaCount = 1; - DbgMemoryAreaInfo = (BurnArea*)malloc(256 * sizeof(BurnArea)); - if (DbgMemoryAreaInfo == NULL) { - return 1; - } - - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN1_DRP1, CB_ADDSTRING, 0, (LPARAM)_T("Main CPU memory map")); - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN2_DRP1, CB_ADDSTRING, 0, (LPARAM)_T("Main CPU memory map")); - - BurnAcb = GetMemoryAcb; - BurnAreaScan(ACB_MEMORY_ROM | ACB_NVRAM | ACB_MEMCARD | ACB_MEMORY_RAM | ACB_READ, NULL); - - return 0; -} - -static int SetupDisass(int nArea) -{ - nDisassAddress[0] = 0; - nDisassArea = nArea; - nDisassAttrib = 0; - - nDisassCPUType = SekDbgGetCPUType(); - - if (nDisassArea) { - SekDbgFetchByteDisassembler = DbgFetchByteArea; - SekDbgFetchWordDisassembler = DbgFetchWordArea; - SekDbgFetchLongDisassembler = DbgFetchLongArea; - } else { - SekDbgFetchByteDisassembler = DbgFetchByte; - SekDbgFetchWordDisassembler = DbgFetchWord; - SekDbgFetchLongDisassembler = DbgFetchLong; - - nDisassAddress[0] = TraceBack(SekDbgGetRegister(SEK_REG_PC), 5, nDisassCPUType); - } - - CreateDisass(GetDlgItem(hDbgDlg, nDisassWindow), nDisassAddress[0], nDisassCPUType); - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN1_DRP1, CB_SETCURSEL, (WPARAM)nDisassArea, (LPARAM)0); - - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN1_DRP2, CB_RESETCONTENT, (WPARAM)0, (LPARAM)0); - if (nArea) { - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN1_DRP2, CB_ADDSTRING, (WPARAM)0, (LPARAM)_T("little-endian 8-bit / big-endian")); - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN1_DRP2, CB_ADDSTRING, (WPARAM)0, (LPARAM)_T("little-endian 16-bit")); - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN1_DRP2, CB_ADDSTRING, (WPARAM)0, (LPARAM)_T("little-endian 32-bit")); - } else { - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN1_DRP2, CB_ADDSTRING, (WPARAM)0, (LPARAM)_T("Auto")); - } - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN1_DRP2, CB_SETCURSEL, (WPARAM)0, (LPARAM)0); - - return 0; -} - -static int SetupMemdump(int nArea) -{ - nMemdumpArea = nArea; - nMemdumpAddress = 0x000000; - nMemdumpAttrib = 0; - - CreateMemdump(GetDlgItem(hDbgDlg, nMemdumpWindow), nMemdumpArea, nMemdumpAddress); - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN2_DRP1, CB_SETCURSEL, (WPARAM)nMemdumpArea, (LPARAM)0); - - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN2_DRP2, CB_RESETCONTENT, (WPARAM)0, (LPARAM)0); - if (nArea) { - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN2_DRP2, CB_ADDSTRING, (WPARAM)0, (LPARAM)_T("little-endian 8-bit / big-endian")); - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN2_DRP2, CB_ADDSTRING, (WPARAM)0, (LPARAM)_T("little-endian 16-bit")); - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN2_DRP2, CB_ADDSTRING, (WPARAM)0, (LPARAM)_T("little-endian 32-bit")); - } else { - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN2_DRP2, CB_ADDSTRING, (WPARAM)0, (LPARAM)_T("Auto")); - } - SendDlgItemMessage(hDbgDlg, IDC_DBG_MAINWN2_DRP2, CB_SETCURSEL, (WPARAM)0, (LPARAM)0); - - return 0; -} - -// ---------------------------------------------------------------------------- -// Create CPU info in RTF format - -int UpdateCPUState(DbgM68000State* Curr_M68000) { - Curr_M68000->a[0] = SekDbgGetRegister(SEK_REG_A0); - Curr_M68000->a[1] = SekDbgGetRegister(SEK_REG_A1); - Curr_M68000->a[2] = SekDbgGetRegister(SEK_REG_A2); - Curr_M68000->a[3] = SekDbgGetRegister(SEK_REG_A3); - Curr_M68000->a[4] = SekDbgGetRegister(SEK_REG_A4); - Curr_M68000->a[5] = SekDbgGetRegister(SEK_REG_A5); - Curr_M68000->a[6] = SekDbgGetRegister(SEK_REG_A6); - Curr_M68000->a[7] = SekDbgGetRegister(SEK_REG_A7); - - Curr_M68000->d[0] = SekDbgGetRegister(SEK_REG_D0); - Curr_M68000->d[1] = SekDbgGetRegister(SEK_REG_D1); - Curr_M68000->d[2] = SekDbgGetRegister(SEK_REG_D2); - Curr_M68000->d[3] = SekDbgGetRegister(SEK_REG_D3); - Curr_M68000->d[4] = SekDbgGetRegister(SEK_REG_D4); - Curr_M68000->d[5] = SekDbgGetRegister(SEK_REG_D5); - Curr_M68000->d[6] = SekDbgGetRegister(SEK_REG_D6); - Curr_M68000->d[7] = SekDbgGetRegister(SEK_REG_D7); - - Curr_M68000->pc = SekDbgGetRegister(SEK_REG_PC); - Curr_M68000->sr = SekDbgGetRegister(SEK_REG_SR); - - Curr_M68000->sp = SekDbgGetRegister(SEK_REG_SP); - Curr_M68000->usp = SekDbgGetRegister(SEK_REG_USP); - Curr_M68000->isp = SekDbgGetRegister(SEK_REG_ISP); - - Curr_M68000->irq = SekDbgGetPendingIRQ(); - - return 0; -} - -static void CreateCPUInfo(HWND hWindow, bool bUpdate, DbgM68000State* Curr_M68000, DbgM68000State* Prev_M68000) -{ - int col; - TCHAR szBuffer[16384] = _T(""); - TCHAR* pszBuf = szBuffer; - - int curr_sr, diff_sr; - - if (bUpdate) { - UpdateCPUState(Curr_M68000); - } - - curr_sr = Curr_M68000->sr; - diff_sr = Prev_M68000->sr ^ curr_sr; - - // RTF header and initial settings - pszBuf += _stprintf(pszBuf, _T("{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl(\\f0\\fmodern\\fprq0 Courier New\\cpg1252;)}{\\colortbl\\red0\\green0\\blue0;\\red128\\green128\\blue128;\\red255\\green0\\blue0;\\red255\\green96\\blue96;}\\deflang1033\\horzdoc\\pard\\f0\\plain")); - // Tabstops - if (bLargeWindow) { - pszBuf += _stprintf(pszBuf, _T("\\tx1950\\fs24 ")); - } else { - pszBuf += _stprintf(pszBuf, _T("\\tx1365\\fs16 ")); - } - - // Print SR - pszBuf += _stprintf(pszBuf, _T("SR ")); - if (nDisassCPUType >= M68K_CPU_TYPE_68EC020) { - // T - if (diff_sr & 0xC000) { - pszBuf += _stprintf(pszBuf, _T("\\cf%i T%i"), (diff_sr & 0xC000) ? 2 : 0, curr_sr >> 14); - } else { - pszBuf += _stprintf(pszBuf, _T("\\cf%i \\\'95\\\'95"), (diff_sr & 0xC000) ? 2 : 0); - } - } else { - // T - pszBuf += _stprintf(pszBuf, _T("\\cf%i %s"), (diff_sr & 0x8000) ? 2 : 0, (curr_sr & 0x8000) ? _T("T") : _T("\\\'95")); - // Unused - pszBuf += _stprintf(pszBuf, _T("{\\cf1\\\'B7}")); - } - // S - pszBuf += _stprintf(pszBuf, _T("\\cf%i %s"), (diff_sr & 0x2000) ? 2 : 0, (curr_sr & 0x2000) ? _T("S") : _T("\\\'95")); - if (nDisassCPUType >= M68K_CPU_TYPE_68EC020) { - // M - pszBuf += _stprintf(pszBuf, _T("\\cf%i %s"), (diff_sr & 0x1000) ? 2 : 0, (curr_sr & 0x1000) ? _T("M") : _T("\\\'95")); - } else { - // Unused - pszBuf += _stprintf(pszBuf, _T("{\\cf1\\\'B7}")); - } - // Unused - pszBuf += _stprintf(pszBuf, _T("{\\cf1\\\'B7}")); - // I - pszBuf += _stprintf(pszBuf, _T("\\cf%i IM%i"), (diff_sr & 0x0700) ? 2 : 0, (curr_sr & 0x0700) >> 8); - // Unused - pszBuf += _stprintf(pszBuf, _T("{\\cf1\\\'B7\\\'B7\\\'B7}")); - // X - pszBuf += _stprintf(pszBuf, _T("\\cf%i %s"), (diff_sr & 0x10) ? 2 : 0, (curr_sr & 0x10) ? _T("X") : _T("\\\'95")); - // N - pszBuf += _stprintf(pszBuf, _T("\\cf%i %s"), (diff_sr & 0x08) ? 2 : 0, (curr_sr & 0x08) ? _T("N") : _T("\\\'95")); - // Z - pszBuf += _stprintf(pszBuf, _T("\\cf%i %s"), (diff_sr & 0x04) ? 2 : 0, (curr_sr & 0x04) ? _T("Z") : _T("\\\'95")); - // V - pszBuf += _stprintf(pszBuf, _T("\\cf%i %s"), (diff_sr & 0x02) ? 2 : 0, (curr_sr & 0x02) ? _T("V") : _T("\\\'95")); - // C - pszBuf += _stprintf(pszBuf, _T("\\cf%i %s "), (diff_sr & 0x01) ? 2 : 0, (curr_sr & 0x01) ? _T("C") : _T("\\\'95")); - // Hex value - pszBuf += _stprintf(pszBuf, _T("\\cf%i %02x\\cf%i %02x\\par "), (diff_sr & 0xFF00) ? 2 : 0, curr_sr >> 8, (diff_sr & 0xFF) ? 2 : 0, curr_sr & 0xFF); - -#if 1 - // Print pending IRQ - { - int s1, s2; - - if (bLargeWindow) { - s1 = 16; - s2 = 22; - } else { - s1 = 12; - s2 = 14; - } - if (Curr_M68000->irq & 7) { - pszBuf += _stprintf(pszBuf, _T("\\cf0 IRQ %i{\\fs%i \\fs%i\\cf1 pending}\t"), Curr_M68000->irq & 7, s1, s2); - } else { - pszBuf += _stprintf(pszBuf, _T("\\cf1 IRQ 0{\\fs%i \\fs%i pending}\t"), s1, s2); - } - } -#else - if (nDisassCPUType >= M68K_CPU_TYPE_68010) { - // Print SFC/DFC - col = (Curr_M68000->sfc ^ Prev_M68000->sfc) ? 2 : 0; - pszBuf += _stprintf(pszBuf, _T("\\cf0 SFC \\cf%i %i "), col + 1, Curr_M68000->sfc); - col = (Curr_M68000->dfc ^ Prev_M68000->dfc) ? 2 : 0; - pszBuf += _stprintf(pszBuf, _T("\\cf0 DFC \\cf%i %i "), col + 1, Curr_M68000->dfc); - } else { - pszBuf += _stprintf(pszBuf, _T(" ")); - } -#endif - - // Print PC - col = (Curr_M68000->pc ^ Prev_M68000->pc) ? 2 : 0; - pszBuf += _stprintf(pszBuf, _T("\\cf0 PC \\cf%i %02x\\cf%i %06x\\par\\par "), col + 1, Curr_M68000->pc >> 24, col, Curr_M68000->pc & 0x00FFFFFF); - - // Print data and address registers - for (int i = 0; i < 8; i++) { - col = (Curr_M68000->d[i] ^ Prev_M68000->d[i]) ? 2 : 0; - pszBuf += _stprintf(pszBuf, _T("\\cf0 D%i \\cf%i %08x "), i, col, Curr_M68000->d[i]); - - col = (Curr_M68000->a[i] ^ Prev_M68000->a[i]) ? 2 : 0; - pszBuf += _stprintf(pszBuf, _T("\\cf0 A%i \\cf%i %02x\\cf%i %06x\\par "), i, col + 1, Curr_M68000->a[i] >> 24, col, Curr_M68000->a[i] & 0x00FFFFFF); - } - pszBuf += _stprintf(pszBuf, _T("\\par")); - - if (nDisassCPUType >= M68K_CPU_TYPE_68EC020) { - // Print vector base register - col = (Curr_M68000->vbr ^ Prev_M68000->vbr) ? 2 : 0; - pszBuf += _stprintf(pszBuf, _T("\\cf0 VBR \\cf%i %02x\\cf%i %06x "), col + 1, Curr_M68000->vbr >> 24, col, Curr_M68000->vbr & 0x00FFFFFF); - // Print master stack pointer - col = (Curr_M68000->msp ^ Prev_M68000->msp) ? 2 : 0; - pszBuf += _stprintf(pszBuf, _T("\\cf0 MSP \\cf%i %02x\\cf%i %06x\\par "), col + 1, Curr_M68000->msp >> 24, col, Curr_M68000->msp & 0x00FFFFFF); - } - - // Print interrupt stack pointer - col = (Curr_M68000->isp ^ Prev_M68000->isp) ? 2 : 0; - pszBuf += _stprintf(pszBuf, _T("\\cf0 ISP \\cf%i %02x\\cf%i %06x "), col + 1, Curr_M68000->isp >> 24, col, Curr_M68000->isp & 0x00FFFFFF); - // Print user stack pointer - col = (Curr_M68000->usp ^ Prev_M68000->usp) ? 2 : 0; - pszBuf += _stprintf(pszBuf, _T("\\cf0 USP \\cf%i %02x\\cf%i %06x\\par "), col + 1, Curr_M68000->usp >> 24, col, Curr_M68000->usp & 0x00FFFFFF); - - // Cycles done this frame - pszBuf += _stprintf(pszBuf, _T("\\par\\cf0 cycle%7i "), SekTotalCycles()); - if (nSekCyclesScanline) { - pszBuf += _stprintf(pszBuf, _T("scanline %3i\\par"), SekCurrentScanline()); - } else { - pszBuf += _stprintf(pszBuf, _T("\\cf1 scanline ---\\par")); - } - - SendMessage(hWindow, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuffer); - - if (bUpdate) { - memcpy(Prev_M68000, Curr_M68000, sizeof(DbgM68000State)); - } - -#if 0 - FILE* fp = _ftopen(_T("cpuinfo.rtf"), _T("wb"); - if (fp) { - fwrite(szBuffer, 1, strlen(szBuffer), fp); - fclose(fp); - } -#endif -} - -// ---------------------------------------------------------------------------- -// Callbacks for when a breakpoint is hit - -void BreakpointProcessing(TCHAR* pszMessage) -{ - bBreakpointHit = true; - AudBlankSound(); - - // Make sure single stepping is disabled - SekDbgEnableBreakpoints(); - - // Update the feedback area - AddFeedback(GetDlgItem(hDbgDlg, IDC_DBG_INFOWN2), pszMessage); - - // Update info - CreateCPUInfo(GetDlgItem(hDbgDlg, IDC_DBG_INFOWN1), true, &curr_m68000, &prev_m68000); - CreateDisass(GetDlgItem(hDbgDlg, nDisassWindow), TraceBack(SekDbgGetRegister(SEK_REG_PC), 5, nDisassCPUType), nDisassCPUType); - - SetWindowText(GetDlgItem(hDbgDlg, IDC_DBG_GO), _T("Go!")); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_STEPFRAME), TRUE); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_STEPINTO), TRUE); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_STEP), TRUE); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_SKIP), TRUE); - - // Activate message pump - BreakpointMessagePump(); -} - -void BreakpointHitRead(unsigned int address, int breakpoint) -{ - TCHAR szBuffer[256] = _T(""); - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;\\red0\\green0\\blue255;}\\pard\\f0\\fs20\\cf1 Breakpoint R%i! read <- %06x\\par}"), breakpoint, address); - - BreakpointProcessing(szBuffer); -} - -void BreakpointHitFetch(unsigned int address, int breakpoint) -{ - TCHAR szBuffer[256] = _T(""); - - if (breakpoint == 0) { - - // Remove step into breakpoint - SekDbgSetBreakpointFetch(0, 0); - - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;\\red0\\green0\\blue255;}\\pard\\f0\\fs20\\cf1 Step complete! PC == %06x\\par}"), address); - } else { - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;\\red0\\green0\\blue255;}\\pard\\f0\\fs20\\cf1 Breakpoint P%i! PC == %06x\\par}"), breakpoint, address); - } - - BreakpointProcessing(szBuffer); -} - -void BreakpointHitWrite(unsigned int address, int breakpoint) -{ - TCHAR szBuffer[256] = _T(""); - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;\\red0\\green0\\blue255;}\\pard\\f0\\fs20\\cf1 Breakpoint W%i! write -> %06x\\par}"), breakpoint, address); - - BreakpointProcessing(szBuffer); -} - -// ---------------------------------------------------------------------------- -// Command parsing - -static int cmd_exit(TCHAR* /*arg*/) -{ - SendMessage(hDbgDlg, WM_CLOSE, 0, 0); - - return 0; -} - -static int cmd_disass(TCHAR* arg) -{ - TCHAR* pos = arg; - long address; - - // Check if we need to write to a file - if (*pos == _T('>')) { - unsigned int start, end; - TCHAR filename[MAX_PATH] = _T(""); - TCHAR* fn; - - pos++; - - SKIP_WS(pos); - - fn = pos; - - if (*pos == _T('\"')) { - fn++; - pos++; - FIND_QT(pos); - _tcsncpy(filename, fn, pos - fn); - pos++; - } else { - FIND_WS(pos); - _tcsncpy(filename, fn, pos - fn); - } - - start = _tcstol(pos, &pos, 16); - end = _tcstol(pos, &pos, 16); - - CreateDisassFile(filename, start, end, nDisassCPUType); - - return 0; - } - - // Just set the active window when no arguments are specified - if (*pos == _T('\0')) { - nActiveWindow = nDisassWindow; - - return 0; - } - - // Check for keywords - if (!_tcsicmp(pos, _T("pc"))) { - CreateDisass(GetDlgItem(hDbgDlg, nDisassWindow), TraceBack(SekDbgGetRegister(SEK_REG_PC), 5, nDisassCPUType), nDisassCPUType); - - nActiveWindow = nDisassWindow; - - return 0; - } - - // Disassemble to the window - address = _tcstol(pos, &pos, 16); - if (address > 0x00FFFFFE || address < 0) { - return 1; - } - - CreateDisass(GetDlgItem(hDbgDlg, nDisassWindow), address & 0xFFFFFE, nDisassCPUType); - - nActiveWindow = nDisassWindow; - - return 0; -} - -static int cmd_memdump(TCHAR* arg) -{ - TCHAR* pos = arg; - long address = 0; - - // Just set the active window when no arguments are specified - if (*pos == _T('\0')) { - nActiveWindow = nMemdumpWindow; - - return 0; - } - - // Check for keywords - if (!_tcsicmp(pos, _T("pc"))) { - address = SekDbgGetRegister(SEK_REG_PC) - 5 * 16; - } - if (!_tcsicmp(pos, _T("sp"))) { - address = SekDbgGetRegister(SEK_REG_SP); - } - - if (!address) { - address = _tcstol(pos, &pos, 16); - } - - if (address > 0x00FFFFFE || address < 0) { - return 1; - } - - nMemdumpAddress = address; - CreateMemdump(GetDlgItem(hDbgDlg, nMemdumpWindow), nMemdumpArea, nMemdumpAddress); - - nActiveWindow = nMemdumpWindow; - - return 0; -} - -static int cmd_go(TCHAR* arg) -{ - TCHAR szBuffer[256]; - TCHAR* pos = arg; - long address = _tcstol(pos, &pos, 16); - - curr_m68000 = prev_m68000; - if (address) { - SekDbgSetRegister(SEK_REG_PC, address); - } - - SetWindowText(GetDlgItem(hDbgDlg, IDC_DBG_GO), _T("Halt")); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_STEPFRAME), FALSE); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_STEPINTO), FALSE); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_STEP), FALSE); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_SKIP), FALSE); - - // Update the feedback area - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;}\\pard\\f0\\fs20\\cf0 Running, start at PC = %06x\\par}"), SekDbgGetRegister(SEK_REG_PC)); - AddFeedback(GetDlgItem(hDbgDlg, IDC_DBG_INFOWN2), szBuffer); - - if (bRunPause) { - SetPauseMode(false); - } - if (bBreakpointHit) { - PostMessage(hScrnWnd, WM_APP + 0, 0, 0); - } - - return 0; -} - -static int cmd_halt(TCHAR* /*arg*/) -{ - TCHAR szBuffer[256]; - - // remove temporary breakpoint (if any) - SekDbgSetBreakpointFetch(0, 0); - - SetWindowText(GetDlgItem(hDbgDlg, IDC_DBG_GO), _T("Go!")); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_STEPFRAME), TRUE); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_STEPINTO), TRUE); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_STEP), TRUE); - EnableWindow(GetDlgItem(hDbgDlg, IDC_DBG_SKIP), TRUE); - - if (!bRunPause) { - SetPauseMode(true); - - SekOpen(0); - - CreateDisass(GetDlgItem(hDbgDlg, nDisassWindow), TraceBack(SekGetPC(-1), 5, nDisassCPUType), nDisassCPUType); - CreateCPUInfo(GetDlgItem(hDbgDlg, IDC_DBG_INFOWN1), true, &curr_m68000, &prev_m68000); - - SekClose(); - } - - // Update the feedback area - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;}\\pard\\f0\\fs20\\cf0 Stopped, PC = %06x\\par}"), SekDbgGetRegister(SEK_REG_PC)); - AddFeedback(GetDlgItem(hDbgDlg, IDC_DBG_INFOWN2), szBuffer); - - return 0; -} - -static int cmd_setbp(TCHAR* arg) -{ - TCHAR* pos = arg; - TCHAR szBuffer[256] = _T(""); - - long number, address; - - SKIP_WS(pos); - - switch (*pos) { - case _T('r'): { - number = _tcstol(pos + 1, &pos, 16); - address = _tcstol(pos, &pos, 16); - - if (number < 1 || number > 8) { - return 1; - } - - if (address) { - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;}\\pard\\f0\\fs20\\cf0 Breakpoint R%i: read <- %06x\\par}"), number, address); - } else { - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;}\\pard\\f0\\fs20\\cf0 Breakpoint R%i: disabled\\par}"), number); - } - - SekDbgSetBreakpointDataRead(address, number); - - break; - } - case _T('w'): { - number = _tcstol(pos + 1, &pos, 16); - address = _tcstol(pos, &pos, 16); - - if (number < 1 || number > 8) { - return 1; - } - - if (address) { - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;}\\pard\\f0\\fs20\\cf0 Breakpoint W%i: write -> %06x\\par}"), number, address); - } else { - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;}\\pard\\f0\\fs20\\cf0 Breakpoint W%i: disabled\\par}"), number); - } - - SekDbgSetBreakpointDataWrite(address, number); - - break; - } - case _T('p'): { - number = _tcstol(pos + 1, &pos, 16); - address = _tcstol(pos, &pos, 16); - - if (number < 1 || number > 8) { - return 1; - } - - if (address) { - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;}\\pard\\f0\\fs20\\cf0 Breakpoint P%i: PC == %06x\\par}"), number, address); - } else { - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252{\\colortbl;}\\pard\\f0\\fs20\\cf0 Breakpoint P%i: disabled\\par}"), number); - } - - SekDbgSetBreakpointFetch(address, number); - - break; - } - } - - // Update the feedback area - AddFeedback(GetDlgItem(hDbgDlg, IDC_DBG_INFOWN2), szBuffer); - - return 0; -} - -static int cmd_frame(TCHAR* /*arg*/) -{ - TCHAR szBuffer[256] = _T(""); - - SetPauseMode(true); - - prev_m68000 = curr_m68000; - - // Run until the next frame starts - if (bBreakpointHit) { - PostMessage(hScrnWnd, WM_APP + 0, 0, 0); - return 0; - } else { - VidFrame(); - } - - // Display the image - VidPaint(0); - - // Update the cpu info & disassembly - SekOpen(0); - CreateDisass(GetDlgItem(hDbgDlg, nDisassWindow), TraceBack(SekGetPC(-1), 5, nDisassCPUType), nDisassCPUType); - CreateCPUInfo(GetDlgItem(hDbgDlg, IDC_DBG_INFOWN1), true, &curr_m68000, &prev_m68000); - SekClose(); - - // Update the feedback area - _stprintf(szBuffer, _T("{\\rtf1\\ansi\\ansicpg1252\\pard\\f0\\fs20\\cf0 Stepped frame, PC = %06x\\par}"), SekDbgGetRegister(SEK_REG_PC)); - AddFeedback(GetDlgItem(hDbgDlg, IDC_DBG_INFOWN2), szBuffer); - - return 0; -} - -static int cmd_single(TCHAR* /*arg*/) -{ - char buf[100] = ""; - - int size = m68k_disassemble(buf, SekDbgGetRegister(SEK_REG_PC), nDisassCPUType); - - SekDbgSetBreakpointFetch(SekDbgGetRegister(SEK_REG_PC) + size, 0); - - return cmd_go(_T("0")); -} - -static int cmd_into(TCHAR* /*arg*/) -{ - SekDbgEnableSingleStep(); - - return cmd_go(_T("0")); -} - -static int cmd_skip(TCHAR* /*arg*/) -{ - char buf[100] = ""; - - int size = m68k_disassemble(buf, SekDbgGetRegister(SEK_REG_PC), nDisassCPUType); - - prev_m68000 = curr_m68000; - - SekDbgSetRegister(SEK_REG_PC, SekDbgGetRegister(SEK_REG_PC) + size); - // Update active CPU context - SekClose(); - - CreateCPUInfo(GetDlgItem(hDbgDlg, IDC_DBG_INFOWN1), true, &curr_m68000, &prev_m68000); - CreateDisass(GetDlgItem(hDbgDlg, nDisassWindow), TraceBack(SekDbgGetRegister(SEK_REG_PC), 5, nDisassCPUType), nDisassCPUType); - - return 0; -} - -static struct { TCHAR* cmdstring; int (*cmdfunction)(TCHAR*); } CommandList[] = { - { _T(""), NULL }, - - { _T("x"), cmd_exit }, { _T("exit"), cmd_exit }, - { _T("d"), cmd_disass }, { _T("dasm"), cmd_disass }, - { _T("m"), cmd_memdump }, { _T("mem"), cmd_memdump }, - - { _T("g"), cmd_go }, { _T("go"), cmd_go }, { _T("go!"), cmd_go }, - { _T("h"), cmd_halt }, { _T("halt"), cmd_halt }, - - { _T("ss"), cmd_single }, { _T("step"), cmd_single }, - { _T("si"), cmd_into }, { _T("step into"), cmd_into }, - { _T("sk"), cmd_skip }, { _T("skip"), cmd_skip }, - - { _T("sf"), cmd_frame }, { _T("step frame"), cmd_frame }, - - { _T("sb"), cmd_setbp }, - - { NULL, NULL } -}; - -static int ExecuteCommand(TCHAR* cmd) -{ - TCHAR cmdonly[8] = _T(""); - TCHAR* pos = cmd; - - SKIP_WS(pos); - - for (int i = 0; *pos && !isspace(*pos); i++) { - cmdonly[i] = *pos++; - } - - SKIP_WS(pos); - - for (int i = 0; CommandList[i].cmdstring; i++) { - if (!_tcsicmp(cmdonly, CommandList[i].cmdstring)) { - if (CommandList[i].cmdfunction) { - return CommandList[i].cmdfunction(pos); - } - - return 0; - } - } - - return 1; -} - -// ---------------------------------------------------------------------------- -// Message processing - -static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if (Msg == WM_INITDIALOG) { - - hDbgDlg = hDlg; - - nDisassWindow = IDC_DBG_MAINWN1; - nMemdumpWindow = IDC_DBG_MAINWN2; - - nActiveWindow = nDisassWindow; - - SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &nMouseWheelScrollLines, 0); - - SendDlgItemMessage(hDlg, IDC_DBG_COMMAND, EM_SETTEXTMODE, TM_PLAINTEXT, 0); - SendDlgItemMessage(hDlg, IDC_DBG_COMMAND, EM_LIMITTEXT, 63, 0); - - hCommandFont = CreateFont(bLargeWindow ? 18 : 14, 0, 0, 0, FW_NORMAL, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_MODERN, _T("Courier New")); - SendDlgItemMessage(hDlg, IDC_DBG_COMMAND, WM_SETFONT, (WPARAM)hCommandFont, (LPARAM)0); - - SendDlgItemMessage(hDlg, IDC_DBG_MAINWN1, EM_SETMARGINS, EC_LEFTMARGIN, 3); - SendDlgItemMessage(hDlg, IDC_DBG_MAINWN2, EM_SETMARGINS, EC_LEFTMARGIN, 3); - SendDlgItemMessage(hDlg, IDC_DBG_INFOWN1, EM_SETMARGINS, EC_LEFTMARGIN, 3); - SendDlgItemMessage(hDlg, IDC_DBG_INFOWN2, EM_SETMARGINS, EC_LEFTMARGIN, 3); - SendDlgItemMessage(hDlg, IDC_DBG_COMMAND, EM_SETMARGINS, EC_LEFTMARGIN, 3); - - SendDlgItemMessage(hDlg, IDC_DBG_MAINWN1, EM_SETEVENTMASK, 0, ENM_KEYEVENTS | ENM_MOUSEEVENTS | ENM_SCROLLEVENTS | ENM_PROTECTED); - SendDlgItemMessage(hDlg, IDC_DBG_MAINWN2, EM_SETEVENTMASK, 0, ENM_KEYEVENTS | ENM_MOUSEEVENTS | ENM_SCROLLEVENTS | ENM_PROTECTED); - SendDlgItemMessage(hDlg, IDC_DBG_INFOWN1, EM_SETEVENTMASK, 0, ENM_KEYEVENTS | ENM_MOUSEEVENTS | ENM_SCROLLEVENTS | ENM_PROTECTED); - SendDlgItemMessage(hDlg, IDC_DBG_INFOWN2, EM_SETEVENTMASK, 0, ENM_KEYEVENTS | ENM_MOUSEEVENTS | ENM_SCROLLEVENTS | ENM_PROTECTED); - SendDlgItemMessage(hDlg, IDC_DBG_COMMAND, EM_SETEVENTMASK, 0, ENM_KEYEVENTS | ENM_MOUSEEVENTS | ENM_SCROLLEVENTS); - - // Initialise feedback window - InitFeedback(GetDlgItem(hDlg, IDC_DBG_INFOWN2)); - - // Get the list of memory areas - GetMemoryAreas(); - - // Initialise disassembly window - SekOpen(0); - SetupDisass(0); - - // Initialise memory dump window - SetupMemdump(0); - - UpdateCPUState(&prev_m68000); - CreateCPUInfo(GetDlgItem(hDlg, IDC_DBG_INFOWN1), true, &curr_m68000, &prev_m68000); - - SekClose(); - - SendDlgItemMessage(hDlg, IDC_DBG_MAINWN1_DRP1, CB_SETCURSEL, (WPARAM)0, (LPARAM)0); - - SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDC_DBG_COMMAND), TRUE); - - WndInMid(hDlg, NULL); - ShowWindow(hDlg, SW_NORMAL); - - return FALSE; - } - - if (Msg == WM_CLOSE) { - DebugExit(); - - return 0; - } - - if (Msg == WM_COMMAND) { - - // Exit the debugger - if (LOWORD(wParam) == IDCANCEL && HIWORD(wParam) == BN_CLICKED) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - - if (LOWORD(wParam) == IDC_DBG_GO && HIWORD(wParam) == BN_CLICKED) { - if (bRunPause || bBreakpointHit) { - ExecuteCommand(_T("g")); - } else { - ExecuteCommand(_T("h")); - } - return 0; - } - - if (LOWORD(wParam) == IDC_DBG_STEP && HIWORD(wParam) == BN_CLICKED) { - ExecuteCommand(_T("ss")); - return 0; - } - if (LOWORD(wParam) == IDC_DBG_STEPINTO && HIWORD(wParam) == BN_CLICKED) { - ExecuteCommand(_T("si")); - return 0; - } - if (LOWORD(wParam) == IDC_DBG_SKIP && HIWORD(wParam) == BN_CLICKED) { - ExecuteCommand(_T("sk")); - return 0; - } - - if (LOWORD(wParam) == IDC_DBG_STEPFRAME && HIWORD(wParam) == BN_CLICKED) { - ExecuteCommand(_T("sf")); - return 0; - } - if (LOWORD(wParam) == IDC_DBG_SHOT && HIWORD(wParam) == BN_CLICKED) { - MakeScreenShot(); - return 0; - } - - // Execute the comnmand entered in the command text control - if (LOWORD(wParam) == IDOK) { - TCHAR CommandText[64] = _T(""); - SendDlgItemMessage(hDlg, IDC_DBG_COMMAND, WM_GETTEXT, (WPARAM)64, (LPARAM)CommandText); - SendDlgItemMessage(hDlg, IDC_DBG_COMMAND, WM_SETTEXT, (WPARAM)0, (LPARAM)_T("")); - - ExecuteCommand(CommandText); - - SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDC_DBG_COMMAND), TRUE); - } - - if (HIWORD(wParam) == CBN_SELENDOK) { - if (LOWORD(wParam) == IDC_DBG_MAINWN1_DRP1) { - SetupDisass(SendMessage((HWND)lParam, CB_GETCURSEL, (WPARAM)0, (LPARAM)0)); - } - if (LOWORD(wParam) == IDC_DBG_MAINWN1_DRP2) { - nDisassAttrib = SendMessage((HWND)lParam, CB_GETCURSEL, (WPARAM)0, (LPARAM)0); - CreateDisass(GetDlgItem(hDlg, nDisassWindow), nDisassAddress[0], nDisassCPUType); - } - if (LOWORD(wParam) == IDC_DBG_MAINWN2_DRP1) { - SetupMemdump(SendMessage((HWND)lParam, CB_GETCURSEL, (WPARAM)0, (LPARAM)0)); - } - if (LOWORD(wParam) == IDC_DBG_MAINWN2_DRP2) { - nMemdumpAttrib = SendMessage((HWND)lParam, CB_GETCURSEL, (WPARAM)0, (LPARAM)0); - CreateMemdump(GetDlgItem(hDlg, nMemdumpWindow), nMemdumpArea, nMemdumpAddress); - } - } - } - - if (Msg == WM_NOTIFY) { - int nPageSize = bLargeWindow ? 16 : 12; - unsigned int nWindow = 0; - bool bAffectCaret = true; - int nScrollLines = 0; - - if (((NMHDR*)lParam)->code == EN_MSGFILTER) { - nWindow = ((NMHDR*)lParam)->idFrom; - - if (nWindow == IDC_DBG_COMMAND) { - nWindow = nActiveWindow; - - bAffectCaret = false; - } - } - - if (((NMHDR*)lParam)->code == EN_MSGFILTER && ((MSGFILTER*)lParam)->msg == WM_MOUSEWHEEL) { - static int nMouseWheelDelta; - -// if (wParam & (MK_SHIFT | MK_CONTROL)) { -// break; -// } - - nMouseWheelDelta -= (short)HIWORD(((MSGFILTER*)lParam)->wParam); - - if (abs(nMouseWheelDelta) >= WHEEL_DELTA) { - if (nMouseWheelScrollLines == WHEEL_PAGESCROLL) { - nScrollLines = 2 * (nPageSize - ((nWindow == nDisassWindow) ? 1 : 0)); - if (nMouseWheelDelta < 0) { - nScrollLines = -nScrollLines; - } - } else { - nScrollLines = 2 * (nMouseWheelDelta / WHEEL_DELTA); - } - nMouseWheelDelta %= WHEEL_DELTA; - - bAffectCaret = false; - } - } - - if ((bBreakpointHit || bRunPause) && ((NMHDR*)lParam)->code == EN_MSGFILTER && (((MSGFILTER*)lParam)->msg == WM_KEYDOWN || ((MSGFILTER*)lParam)->msg == WM_SYSKEYDOWN)) { - - if (((NMHDR*)lParam)->idFrom != IDC_DBG_COMMAND && ((NMHDR*)lParam)->idFrom != nDisassWindow && ((NMHDR*)lParam)->idFrom != nMemdumpWindow) { - nWindow = 0; - } - - if (((MSGFILTER*)lParam)->wParam == VK_UP) { - if (KEY_DOWN(VK_CONTROL)) { - nScrollLines = -1; - } else { - nScrollLines = -2; - } - } - if (((MSGFILTER*)lParam)->wParam == VK_DOWN) { - if (KEY_DOWN(VK_CONTROL)) { - nScrollLines = 1; - } else { - nScrollLines = 2; - } - } - if (((MSGFILTER*)lParam)->wParam == VK_PRIOR) { - nScrollLines = -2 * (nPageSize - ((nWindow == nDisassWindow) ? 1 : 0)); - } - if (((MSGFILTER*)lParam)->wParam == VK_NEXT) { - nScrollLines = 2 * (nPageSize - ((nWindow == nDisassWindow) ? 1 : 0)); - } - } - - if (nScrollLines && nWindow) { - DWORD dwStart = 0, dwEnd = 0; - bool bResetCaret = false; - - if (nWindow == nDisassWindow) { - - SendDlgItemMessage(hDlg, nWindow, EM_GETSEL, (WPARAM)&dwStart, (LPARAM)&dwEnd); - - if (nScrollLines < 0) { - int nLine = SendDlgItemMessage(hDlg, nWindow, EM_LINEFROMCHAR, (WPARAM)((dwStart != (DWORD)-1) ? dwStart : dwEnd), (LPARAM)0); - - if (nScrollLines & 1) { - CreateDisass(GetDlgItem(hDlg, nWindow), nDisassAddress[0] < 2 ? 0 : nDisassAddress[0] - 2, nDisassCPUType); - - dwStart = dwEnd = 2 * nPageSize + SendDlgItemMessage(hDlg, nWindow, EM_LINEINDEX, nLine, 0); - bResetCaret = true; - } else { - if (!bAffectCaret || nScrollLines < -2 || nLine == 0) { - CreateDisass(GetDlgItem(hDlg, nWindow), TraceBack(nDisassAddress[0], -nScrollLines / 2, nDisassCPUType), nDisassCPUType); - - if (bAffectCaret) { - dwStart = dwEnd = 2 * nPageSize; - } - bResetCaret = true; - } - } - } - if (nScrollLines > 0) { - int nLine = SendDlgItemMessage(hDlg, nWindow, EM_LINEFROMCHAR, (WPARAM)dwEnd, (LPARAM)0); - - if (nScrollLines & 1) { - CreateDisass(GetDlgItem(hDlg, nWindow), nDisassAddress[0] >= 0x00FFFFFE ? 0x00FFFFFE : nDisassAddress[0] + 2, nDisassCPUType); - - dwStart = dwEnd = 32 + SendDlgItemMessage(hDlg, nWindow, EM_LINEINDEX, nLine, 0); - bResetCaret = true; - } else { - if (!bAffectCaret || nScrollLines > 2 || SendDlgItemMessage(hDlg, nWindow, EM_LINEFROMCHAR, (WPARAM)dwEnd, (LPARAM)0) >= (nPageSize - 1)) { - - // Make sure we don't go past the end of memory - if (nDisassAddress[0] >= 0x00FFFFFE) { - nDisassAddress[1] = 0x00FFFFFE; - } - - CreateDisass(GetDlgItem(hDlg, nWindow), nDisassAddress[nScrollLines / 2], nDisassCPUType); - - if (bAffectCaret) { - dwStart = dwEnd = 32 + SendDlgItemMessage(hDlg, nWindow, EM_LINEINDEX, nPageSize - 1, 0); - } - bResetCaret = true; - } - } - } - } - - if (nWindow == nMemdumpWindow) { - int nAreaSize = nMemdumpArea ? DbgMemoryAreaInfo[nMemdumpArea].nLen : 0x01000000; - bool bRefresh = true; - - SendDlgItemMessage(hDlg, nWindow, EM_GETSEL, (WPARAM)&dwStart, (LPARAM)&dwEnd); - - if (nScrollLines < 0) { - if (nScrollLines & 1) { - nMemdumpAddress -= 1; - } else { - if (!bAffectCaret || nScrollLines < -2 || SendDlgItemMessage(hDlg, nWindow, EM_LINEFROMCHAR, (WPARAM)dwStart, (LPARAM)0) == 0) { - nMemdumpAddress += 8 * nScrollLines; - } else { - bRefresh = false; - } - } - } - if (nScrollLines > 0) { - if (nScrollLines & 1) { - nMemdumpAddress += 1; - } else { - if (!bAffectCaret || nScrollLines > 2 || SendDlgItemMessage(hDlg, nWindow, EM_LINEFROMCHAR, (WPARAM)dwEnd, (LPARAM)0) >= nPageSize - 1) { - nMemdumpAddress += 8 * nScrollLines; - } else { - bRefresh = false; - } - } - } - - if (bRefresh) { - // Make sure we don't go past the end of memory - if (nMemdumpAddress > nAreaSize - nPageSize * 16) { - nMemdumpAddress = nAreaSize - nPageSize * 16; - } - if (nMemdumpAddress < 0) { - nMemdumpAddress = 0; - } - - CreateMemdump(GetDlgItem(hDlg, nWindow), nMemdumpArea, nMemdumpAddress); - bResetCaret = true; - } - } - - // If we've re-filled the RichEdit control, the caret position is reset as well, so restore it - if (bResetCaret) { - SendDlgItemMessage(hDlg, nWindow, EM_SETSEL, (WPARAM)dwStart, (LPARAM)dwEnd); - } - } - } - - return 0; -} - -// ---------------------------------------------------------------------------- -// Public functions - -#endif - -int DebugExit() -{ - -#if defined (FBA_DEBUG) - - if (DbgMemoryAreaInfo) { - free(DbgMemoryAreaInfo); - DbgMemoryAreaInfo = NULL; - } - - EnableWindow(hScrnWnd, TRUE); - DestroyWindow(hDbgDlg); - - DeleteObject(hCommandFont); - hCommandFont = NULL; - - SekDbgDisableBreakpoints(); - if (bBreakpointHit) { - bBreakpointHit = false; - POST_INITIALISE_MESSAGE; - } - - SetPauseMode(bOldPause); - MenuUpdate(); - -#endif - - return 0; -} - -int DebugCreate() -{ - -#if defined (FBA_DEBUG) - - if (DebugCPU_SekInitted == 0) { - return 1; - } - - if (bDrvOkay == 0) { - return 1; - } - - AudBlankSound(); - - DestroyWindow(hDbgDlg); - - SystemParametersInfo(SPI_GETWORKAREA, 0, &SystemWorkArea, 0); - bLargeWindow = (SystemWorkArea.right - SystemWorkArea.left >= 1024 && SystemWorkArea.bottom - SystemWorkArea.top >= 768) ? true : false; - hDbgDlg = FBACreateDialog(hAppInst, MAKEINTRESOURCE(bLargeWindow ? IDD_DEBUG_LRG : IDD_DEBUG_SML), hScrnWnd, (DLGPROC)DialogProc); - if (hDbgDlg == NULL) { - return 1; - } - - SekDbgBreakpointHandlerRead = BreakpointHitRead; - SekDbgBreakpointHandlerFetch = BreakpointHitFetch; - SekDbgBreakpointHandlerWrite = BreakpointHitWrite; - - bOldPause = bRunPause; - - SetPauseMode(true); - - return 0; - -#else - - POST_INITIALISE_MESSAGE; - - return 1; - -#endif - -} diff --git a/jan/src/burner/win32/drv.cpp b/jan/src/burner/win32/drv.cpp deleted file mode 100644 index 8f6b642dc..000000000 --- a/jan/src/burner/win32/drv.cpp +++ /dev/null @@ -1,278 +0,0 @@ -// Driver Init module -#include "burner.h" - -int bDrvOkay = 0; // 1 if the Driver has been initted okay, and it's okay to use the BurnDrv functions - -TCHAR szAppRomPaths[DIRS_MAX][MAX_PATH] = { { _T("") }, { _T("") }, { _T("") }, { _T("") }, { _T("") }, - { _T("") }, { _T("") }, { _T("") }, { _T("") }, { _T("") }, - { _T("msx/") }, { _T("sms/") }, { _T("gamegear/") }, { _T("sg1000/") }, { _T("coleco/") }, - { _T("tg16/") }, { _T("sgx/") }, { _T("pce/") }, { _T("megadriv/") }, { _T("roms/") } }; - -static bool bSaveRAM = false; - -static int DrvBzipOpen() -{ - BzipOpen(false); - - // If there is a problem with the romset, report it - switch (BzipStatus()) { - case BZIP_STATUS_BADDATA: { - FBAPopupDisplay(PUF_TYPE_WARNING); - break; - } - case BZIP_STATUS_ERROR: { - FBAPopupDisplay(PUF_TYPE_ERROR); - -#if 0 || !defined FBA_DEBUG - // Don't even bother trying to start the game if we know it won't work - BzipClose(); - return 1; -#endif - - break; - } - default: { - -#if 0 && defined FBA_DEBUG - FBAPopupDisplay(PUF_TYPE_INFO); -#else - FBAPopupDisplay(PUF_TYPE_INFO | PUF_TYPE_LOGONLY); -#endif - - } - } - - return 0; -} - -static int DoLibInit() // Do Init of Burn library driver -{ - int nRet = 0; - - if (DrvBzipOpen()) { - return 1; - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) != HARDWARE_SNK_MVS) { - if (!bQuietLoading) ProgressCreate(); - } - - nRet = BurnDrvInit(); - - BzipClose(); - - if (!bQuietLoading) ProgressDestroy(); - - if (nRet) { - return 3; - } else { - return 0; - } -} - -// Catch calls to BurnLoadRom() once the emulation has started; -// Intialise the zip module before forwarding the call, and exit cleanly. -static int __cdecl DrvLoadRom(unsigned char* Dest, int* pnWrote, int i) -{ - int nRet; - - BzipOpen(false); - - if ((nRet = BurnExtLoadRom(Dest, pnWrote, i)) != 0) { - char* pszFilename; - - BurnDrvGetRomName(&pszFilename, i, 0); - - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_REQUEST), pszFilename, BurnDrvGetText(DRV_NAME)); - FBAPopupDisplay(PUF_TYPE_ERROR); - } - - BzipClose(); - - BurnExtLoadRom = DrvLoadRom; - - ScrnTitle(); - - return nRet; -} - -int __cdecl DrvCartridgeAccess(BurnCartrigeCommand nCommand) -{ - switch (nCommand) { - case CART_INIT_START: - if (!bQuietLoading) ProgressCreate(); - if (DrvBzipOpen()) { - return 1; - } - break; - case CART_INIT_END: - if (!bQuietLoading) ProgressDestroy(); - BzipClose(); - break; - case CART_EXIT: - break; - default: - return 1; - } - - return 0; -} - -int DrvInit(int nDrvNum, bool bRestore) -{ - int nStatus; - - DrvExit(); // Make sure exitted - MediaExit(); - - nBurnDrvActive = nDrvNum; // Set the driver number - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_MVS) { - - BurnExtCartridgeSetupCallback = DrvCartridgeAccess; - - if (SelMVSDialog()) { - POST_INITIALISE_MESSAGE; - return 0; - } - } - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_NEOCD) { - if (CDEmuInit()) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_CDEMU_INI_FAIL)); - FBAPopupDisplay(PUF_TYPE_ERROR); - - POST_INITIALISE_MESSAGE; - return 0; - } - } - - { // Init input and audio, save blitter init for later. (reduce # of mode changes, nice for emu front-ends) - bVidOkay = 1; - MediaInit(); - bVidOkay = 0; - } - - // Define nMaxPlayers early; GameInpInit() needs it (normally defined in DoLibInit()). - nMaxPlayers = BurnDrvGetMaxPlayers(); - GameInpInit(); // Init game input - - if(ConfigGameLoad(true)) { - ConfigGameLoadHardwareDefaults(); - } - InputMake(true); - GameInpDefault(); - - if (kNetGame) { - nBurnCPUSpeedAdjust = 0x0100; - } - - nStatus = DoLibInit(); // Init the Burn library's driver - if (nStatus) { - if (nStatus & 2) { - BurnDrvExit(); // Exit the driver - - ScrnTitle(); - - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_BURN_INIT), BurnDrvGetText(DRV_FULLNAME)); - FBAPopupDisplay(PUF_TYPE_WARNING); - } - - POST_INITIALISE_MESSAGE; - return 1; - } - - BurnExtLoadRom = DrvLoadRom; - - bDrvOkay = 1; // Okay to use all BurnDrv functions - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - nVidWidth = nVidVerWidth; - nVidHeight = nVidVerHeight; - } else { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - nVidWidth = nVidHorWidth; - nVidHeight = nVidHorHeight; - } - - bSaveRAM = false; - if (kNetGame) { - KailleraInitInput(); - KailleraGetInput(); - } else { - if (bRestore) { - StatedAuto(0); - bSaveRAM = true; - - ConfigCheatLoad(); - } - } - - nBurnLayer = 0xFF; // show all layers - - // Reset the speed throttling code, so we don't 'jump' after the load - RunReset(); - - VidExit(); - POST_INITIALISE_MESSAGE; - - return 0; -} - -int DrvInitCallback() -{ - return DrvInit(nBurnDrvActive, false); -} - -int DrvExit() -{ - if (bDrvOkay) { - StopReplay(); - - VidExit(); - - InvalidateRect(hScrnWnd, NULL, 1); - UpdateWindow(hScrnWnd); // Blank screen window - - DestroyWindow(hInpdDlg); // Make sure the Input Dialog is exited - DestroyWindow(hInpDIPSWDlg); // Make sure the DipSwitch Dialog is exited - DestroyWindow(hInpCheatDlg); // Make sure the Cheat Dialog is exited - - if (nBurnDrvActive < nBurnDrvCount) { - MemCardEject(); // Eject memory card if present - - if (bSaveRAM) { - StatedAuto(1); // Save NV (or full) RAM - bSaveRAM = false; - } - - ConfigGameSave(bSaveInputs); - - GameInpExit(); // Exit game input - - BurnDrvExit(); // Exit the driver - } - } - - BurnExtLoadRom = NULL; - - bDrvOkay = 0; // Stop using the BurnDrv functions - - bRunPause = 0; // Don't pause when exitted - - if (bAudOkay) { - // Write silence into the sound buffer on exit, and for drivers which don't use pBurnSoundOut - memset(nAudNextSound, 0, nAudSegLen << 2); - } - - CDEmuExit(); - - BurnExtCartridgeSetupCallback = NULL; - - nBurnDrvActive = ~0U; // no driver selected - - return 0; -} diff --git a/jan/src/burner/win32/dynhuff.cpp b/jan/src/burner/win32/dynhuff.cpp deleted file mode 100644 index 44b0bee4a..000000000 --- a/jan/src/burner/win32/dynhuff.cpp +++ /dev/null @@ -1,1330 +0,0 @@ -// -// Dynamic Huffman Encoder/Decoder -// -// implemented by Gangta -// -//----------------------------------------------------------- -// -// Version History -// -// version 0.1 - first release -// version 0.1a - fixed a bug where the bit remainder in -// the EncodeBuffer() function didn't reset -// to 32 if encoding is restarted before -// program exit -// version 0.1b - fixed right shift -// - fixed some utility functions -// -// version 0.1c - fixed PrintResult() -// - fixed a fatal bug in CorrectDH_T) 15% slower -// - optimized compression/decompression 95% faster -// - overall 80% faster :) -// -// version 0.2 - optimized even more, now O(lg 2) :) -// -//----------------------------------------------------------- -// -// Memory usage: -// -// 128 KB for both encoding/decoding -// -// I tested buffer size 16K, 32K, 64K, 128K, etc -// The performance started to drop after 512K, -// so I chose 128K. -// -// Comments: -// -// I tried to optimize the speed as best I can in my -// knowledge. -// -// It has buffer overflow protection for encoding and -// decoding. -// -// It has a frequency reset function which prevents -// frequency overflow. -// -// It can compress text files as well as any type of -// binary files. The compression is not as good as -// zlib, or bzlibb2, but it supports "on the fly" -// encoding/decoding, and I believe it is faster than -// bzlibb2. -// -// -/////////////////////////////////////////////////////////////// - -#include -#include -#include -#include "dynhuff.h" - -#ifndef UINT32 -#define UINT32 unsigned int -#endif - -//# -//# Data sets for Dynamic Huffman Encoding/Decoding -//# -//############################################################################## - -// data sets for dynamic huffman -struct DHTNode { - unsigned int freq; - unsigned char value; - struct DHTNode *left; - struct DHTNode *right; - struct DHTNode *parent; - int l_index; // where this node is in the list -}; -static struct DHTNode DHTroot = {0,0,NULL,NULL,NULL,0}; -static struct DHTNode *null_node_ptr = &DHTroot; // where to add a new data -static struct DHTNode *look_up_table[257] = {NULL,}; // check if it's a new data -static struct DHTNode *node_list[MAX_LIST_LEN] = {NULL,}; // reverse level traverse -static int list_idx = MAX_LIST_LEN-1; - -// data sets for compressed buffer and compressed file I/O -static FILE *cFile = NULL; -static UINT32 *c_buffer = NULL; -static int c_buffer_idx = 0; -static int c_buffer_size = 0; -int end_of_buffer = 0; -static int code_length = 0; - -// data sets for decompressed buffer and decompressed file I/O -static FILE *dFile = NULL; -static UINT32 d_buffer[MAX_BUFFER_LEN]={0,}; -static int d_buffer_idx = 0; - -// file embedding -static int bEmbed = 0; -static int embed_offset = 0; - -// flags used to determine when to stop decoding -static unsigned int code_count = 0; -static int code_reset_count = 0; - -// for saving compression result -static unsigned int nCompressedFileSize; // flag -static unsigned int nCodeCount; // flag -static int nCodeResetCount; // flag -static int nBufferIdx; -static int nBufferResetCount; // flag - -// for decompressing -static struct DecodeStatus -{ - UINT32 code_slice; // slice of a buffer element - int bit_counter; // if 32, get a new slice - unsigned int nCode; // how many codes has been decoded so far - int nCodeReset; // how many times the data counter has been reset -} dcs; - -// function prototypes -static void AllocBufferC(int size); -static void GrowBufferC(); -static void ResetBufferD(); -static void ReloadBufferD(); -static void SaveResult(); -#ifdef _DEBUG -static void CheckList(); -#endif - -//# -//# Functions for Dynamic Huffman Encoding/Decoding -//# -//############################################################################## - -// initialize a node in the dynamic huffman tree -static void SetNode (struct DHTNode *node_ptr,unsigned int freq, unsigned char value, struct DHTNode *left, struct DHTNode *right, struct DHTNode *parent) -{ - node_ptr->freq = freq; // count # of occurances - node_ptr->value = value; // corresponding key in the mInputSet - node_ptr->left = left; // left subtree - node_ptr->right = right; // right subtree - node_ptr->parent = parent; // parent node -} - -// the list is a reverse level traversal of the dynamic huffman tree -static void BuildNodeList (struct DHTNode *node_ptr) -{ - if(list_idx == MAX_LIST_LEN-1) { node_list[MAX_LIST_LEN-1] = NULL;} - node_list[--list_idx] = node_ptr->parent; - node_ptr->parent->l_index = list_idx; - node_list[--list_idx] = node_ptr; - node_ptr->l_index = list_idx; -} - -// swap the two nodes in the dynamic huffman tree -static void SwapNodes (struct DHTNode *node1, struct DHTNode *node2) -{ - unsigned int freq_diff; - struct DHTNode temp_node; - struct DHTNode *node_ptr = node1; // node1 always has higher freq - - // backup node1 before swapping - memcpy(&temp_node,node1,sizeof(struct DHTNode)); - - // swap each node's parent's left or right depending on - // whether each noce is a left child or a right child - if(node2->parent->left == node2) - node2->parent->left = node1; - else - node2->parent->right = node1; - if(temp_node.parent->left == node1) - node1->parent->left = node2; - else - node1->parent->right = node2; - - // swap each node's parent - node1->parent = node2->parent; - node2->parent = temp_node.parent; - - // swap each node's l_index - node1->l_index = node2->l_index; - node2->l_index = temp_node.l_index; - - // correct frequencies - freq_diff = node1->freq - node2->freq; - node_ptr = node1; - while(node_ptr->parent) - { - node_ptr = node_ptr->parent; - node_ptr->freq += freq_diff; - } - node_ptr = node2; - while(node_ptr->parent) - { - node_ptr = node_ptr->parent; - node_ptr->freq -= freq_diff; - } -} - -// correct the dynamic huffman tree if necessary -static void CorrectDHT(int curr_idx) -{ - struct DHTNode *temp; - int swap_idx; - - // search for nodes that are not in order - while(node_list[curr_idx+1]) - { - // if found something out of order - if(node_list[curr_idx]->freq > node_list[curr_idx+1]->freq) - { - // search for the node to swap with, then swap them - swap_idx = curr_idx+1; - while(node_list[swap_idx+1]) - { - // found node to swap it with, so swap them, - if(node_list[swap_idx]->freq < node_list[swap_idx+1]->freq) - { - // extra check for null node exception - if(node_list[list_idx]->parent == node_list[curr_idx]) - { - SwapNodes(node_list[list_idx], node_list[swap_idx]); - temp = node_list[list_idx]; - node_list[list_idx] = node_list[swap_idx]; - node_list[swap_idx] = temp; - } - else - { - SwapNodes(node_list[curr_idx], node_list[swap_idx]); - temp = node_list[curr_idx]; - node_list[curr_idx] = node_list[swap_idx]; - node_list[swap_idx] = temp; - } - - if(node_list[swap_idx]->parent) - CorrectDHT(node_list[swap_idx]->parent->l_index); - - return; - } - ++swap_idx; - } - } - if(!(node_list[curr_idx]->parent)) - return; - curr_idx = node_list[curr_idx]->parent->l_index; - } -} - -// prevent node frequency from overflowing -static void ResetFrequency() -{ - int idx = list_idx; // start with the bottom left node - - node_list[idx++]->freq = 1; - node_list[idx++]->freq = 1; - - while(node_list[idx]) - { - // if it's a leaf, set it to the minimum possible frequency - if(!node_list[idx]->right) - node_list[idx]->freq = node_list[idx-1]->freq; - // if it's a joint node, set the frequency to left + right - else if(node_list[idx]->left) - node_list[idx]->freq = node_list[idx]->left->freq + node_list[idx]->right->freq; - ++idx; - } -} - -// build the dynamic huffman tree -static void BuildDHT (unsigned char data) -{ - struct DHTNode *node_ptr = look_up_table[data]; - struct DHTNode *update_node_ptr = NULL; - - // if tree is empty, initialize the tree - if(!DHTroot.freq) - { - null_node_ptr->right = (struct DHTNode *)malloc(sizeof(struct DHTNode)); - SetNode(&DHTroot, 1, 0, NULL, DHTroot.right, NULL); - SetNode(DHTroot.right, 1, data, NULL, NULL, &DHTroot); - - look_up_table[data] = DHTroot.right; - BuildNodeList(look_up_table[data]); - } - // if the data already exists in the tree, - // just increment the node counter - else if(look_up_table[data]) - { - // reset frequencies before they overflow - if(DHTroot.freq+1 > MAX_FREQ) ResetFrequency(); - - // increment node frequency - node_ptr->freq += 1; - - // reduce level of reverse level traversing (optimization) - if(node_ptr->parent != null_node_ptr && node_ptr->freq > node_list[(node_ptr->l_index)+1]->freq) - update_node_ptr = node_ptr; - - // increment frequencies for all its ancestors - node_ptr = node_ptr->parent; - while (node_ptr) - { - node_ptr->freq += 1; - - // reduce level of reverse level traversing (optimization) - if(!update_node_ptr && node_ptr->parent && node_ptr->freq > node_list[(node_ptr->l_index)+1]->freq) - update_node_ptr = node_ptr; - - node_ptr = node_ptr->parent; - } - - // correct the dynamic huffman tree if neccessary - if(update_node_ptr) CorrectDHT(update_node_ptr->l_index); - } - // if it's a new data, insert it into a new node - else - { - // reset frequencies before they overflow - if(DHTroot.freq+1 > MAX_FREQ) ResetFrequency(); - - null_node_ptr->left = (struct DHTNode *)malloc(sizeof(struct DHTNode)); - SetNode(null_node_ptr->left, 1, 0, NULL, NULL, null_node_ptr); - null_node_ptr = null_node_ptr->left; - - null_node_ptr->right = (struct DHTNode *)malloc(sizeof(struct DHTNode)); - SetNode(null_node_ptr->right, 1, data, NULL, NULL, null_node_ptr); - - look_up_table[data] = null_node_ptr->right; - BuildNodeList(look_up_table[data]); - - // increment frequencies of all its ancestors - node_ptr = null_node_ptr->parent; - while (node_ptr) - { - node_ptr->freq += 1; - - // reduce level of reverse level traversing (optimization) - if(!update_node_ptr && node_ptr->parent && node_ptr->freq > node_list[(node_ptr->l_index)+1]->freq) - update_node_ptr = node_ptr; - - node_ptr = node_ptr->parent; - } - - // correct the dynamic huffman tree if necessary - if(update_node_ptr) CorrectDHT(list_idx); - } -} - -// clean-ups -static void DestroyDHT() -{ - int i; - - // free all nodes in the dynamic huffman tree - // and reset the node list - while(list_idx < MAX_LIST_LEN-3) - { - free(node_list[list_idx]); - node_list[list_idx] = NULL; - ++list_idx; - } - node_list[MAX_LIST_LEN-2]=NULL; - node_list[MAX_LIST_LEN-1]=NULL; - list_idx = MAX_LIST_LEN - 1; - - // reset lookup table - for(i=0; i<257; i++) - { - look_up_table[i] = NULL; - } - - // reset the root node and null node pointer - SetNode (&DHTroot,0,0,NULL,NULL,NULL); - null_node_ptr = &DHTroot; - end_of_buffer = 0; -} - -// return the reverse path for the data existing in the tree -static UINT32 ReverseDataPath(struct DHTNode *node_ptr) -{ - UINT32 path_reverse = 0; - code_length = 0; - - while(node_ptr->parent) - { - path_reverse <<= 1; - - if(node_ptr->parent->left == node_ptr) - path_reverse &= 0xFFFFFFFE; // fill the bit with 0 - else - path_reverse |= 1; // fill the bit with 1 - - node_ptr = node_ptr->parent; - ++code_length; - } - - return path_reverse; -} - -// generates and return a reverse code -static UINT32 GenerateReverseCode(unsigned char data) -{ - UINT32 path_reverse=0; - UINT32 code_reverse=0; - int i; - - // this data exists in the tree, so code is just - // return the reverse path of the data - if(look_up_table[data]) return ReverseDataPath(look_up_table[data]); - - // reverse the code - for(i=0;i<8;i++) - { - code_reverse <<= 1; // shift path_reverse 1 bit to the left - code_reverse |= data&1; // get the first bit - data >>= 1; // shift data 1 bit to the right - } - - // tree is empty, the reverse code is - // just the original data reversed. - if(!DHTroot.freq) - { - code_length = 8; - return code_reverse; // return the reversed code - } - - // it's a new data. get the reverse path for the null - // node and append it after the reverse code - path_reverse = ReverseDataPath(node_list[list_idx]->parent); - ++code_length; // for the null node path (0) - code_reverse <<= code_length; - code_length += 8; - return code_reverse | path_reverse; -} - -//# -//# Functions for Buffer Handling -//# -//############################################################################## - -// takes a decompressed file and compresses the whole thing into another file -int Compress(char *d_file_name, char *c_file_name) -{ - int i,nRet; - UINT32 code_slice; - unsigned char data; - int byte_count; - int bytes_remain; - - nRet = OpenDecompressedFile(d_file_name,"rb"); - if(nRet) return nRet; - - nRet = OpenCompressedFile(c_file_name,"wb"); - if(nRet) return nRet; - - // get file size (# of bytes) - fseek(dFile,0,SEEK_END); - byte_count = ftell(dFile); - fseek(dFile,0,SEEK_SET); - - // if buffer is smaller than the file, load max allowed bytes - // into the buffer, otherwise, load everything into the buffer - if(byte_count*4 > MAX_BUFFER_LEN) - fread(d_buffer,4,MAX_BUFFER_LEN,dFile); - else - fread(d_buffer,1,byte_count,dFile); - - d_buffer_idx = 0; - code_slice = d_buffer[0]; - bytes_remain = byte_count%4; - byte_count /= 4; - - for(i=0;i>24); - EncodeBuffer(data); - data = (unsigned char)((code_slice>>16)&0xFF); - EncodeBuffer(data); - data = (unsigned char)((code_slice>>8)&0xFF); - EncodeBuffer(data); - data = (unsigned char)(code_slice&0xFF); - EncodeBuffer(data); - - // prevent buffer overflow - if(++d_buffer_idx == MAX_BUFFER_LEN) {ReloadBufferD();} - code_slice = d_buffer[d_buffer_idx]; - } - if(bytes_remain) - { - code_slice <<= 32 - (bytes_remain*8); - for(i=0;i>24); - EncodeBuffer(data); - code_slice <<= 8; - } - } - CloseDecompressedFile(); - WriteCompressedFile(); - return nRet; -} - -// takes a compressed file and decompresses the whole thing into another file -int Decompress(char *c_file_name, char *d_file_name) -{ - int remainder = 32; - UINT32 code_slice = 0; - int bytes_remain = 0; - int nRet; - - nRet = OpenCompressedFile(c_file_name,"rb"); - if(nRet) return nRet; - - nRet = OpenDecompressedFile(d_file_name,"wb"); - if(nRet) return nRet; - - LoadCompressedFile(); - - d_buffer[0] = 0; - d_buffer_idx = 0; - - while(!end_of_buffer) - { - code_slice = (UINT32)DecodeBuffer(); - remainder -= 8; - code_slice <<= remainder; - d_buffer[d_buffer_idx] |= code_slice; - - if(!remainder) - { - if(++d_buffer_idx == MAX_BUFFER_LEN) ResetBufferD(); - d_buffer[d_buffer_idx] = 0; - remainder = 32; - } - } - bytes_remain = (32-remainder)/8; - - CloseCompressedFile(); - WriteDecompressedFile(bytes_remain); - return nRet; -} - -// take a data and encode it into c_buffer -void EncodeBuffer(unsigned char data) -{ - UINT32 code = 0; // code that is ready to put into the buffer - UINT32 code_temp = 0; // used to break the code into two parts - UINT32 code_reverse; - int i; - - // at the beginning, reset everything - // also fill 0s for the headers (coude_count, code_reset_count, buffer_reset_count) - if(!DHTroot.freq) - { - dcs.bit_counter = 32; - code_count = 0; - code_reset_count = 0; - c_buffer_idx = 0; - - // leave space for the 4 flags - fwrite(&code_count,sizeof(int),4,cFile); - - // init code buffer - AllocBufferC(MAX_BUFFER_LEN); - c_buffer[0] = 0; - } - - // generate reverse code for the data - code_reverse = GenerateReverseCode(data); - - // put the data in the tree - BuildDHT(data); - - // check for overflow and reset code counter - if(code_count+1 > MAX_FREQ) { code_count=DHTroot.freq; ++code_reset_count; } - else ++code_count; - - // convert the reversed code to original code - for(i=0;i>= 1; - } - - // calculate how many bits would remain in current buffer element after putting the code - dcs.bit_counter -= code_length; - - // if enough bits left to put the code, just put the code - if(dcs.bit_counter > 0) - { - code <<= dcs.bit_counter; - c_buffer[c_buffer_idx] |= code; - } - // if it will fit in perfectly, put the code, and increment buffer index - else if(dcs.bit_counter == 0) - { - c_buffer[c_buffer_idx] |= code; - dcs.bit_counter = 32; - - // prevent buffer overflow - if(++c_buffer_idx == c_buffer_size) GrowBufferC(); - - // get next buffer element ready - c_buffer[c_buffer_idx] = 0; - } - // if not enough bits left to put the code - else - { - // retrieve part of the code - for(i=0;i>dcs.bit_counter;i--) - { - code_temp <<= 1; - code_temp |= code&1; - code >>= 1; - } - // put part of the code in the remaining bits of the current buffer element - c_buffer[c_buffer_idx] |= code; - - // retrieve rest of the code - for(i=0;i>dcs.bit_counter;i--) - { - code <<= 1; - code |= code_temp&1; - code_temp >>= 1; - } - dcs.bit_counter += 32; - code <<= dcs.bit_counter; - // prevent buffer overflow - if(++c_buffer_idx == c_buffer_size) GrowBufferC(); - - // put the rest of the code in the next buffer element - c_buffer[c_buffer_idx] = code; - } -} - -// decode and return the next data from c_buffer -unsigned char DecodeBuffer() -{ - struct DHTNode *node_ptr = &DHTroot; // start with the root node - unsigned char data = 0; // decoded data - int isData = 0; - int i; - - // if it's the first code, reset everything and decode the first data - // otherwise, get the next data - if(!DHTroot.freq) - { - c_buffer_idx = 0; - end_of_buffer = 0; - - dcs.code_slice = c_buffer[c_buffer_idx]; - data = (unsigned char)(dcs.code_slice>>24); - dcs.code_slice <<= 8; - - dcs.nCodeReset = 0; - dcs.nCode = 0; - dcs.bit_counter = 8; - } - else - { - do - { - isData = 0; - - // if it's the end of the code slice, get the next slice - if(dcs.bit_counter==32) - { - - dcs.code_slice=c_buffer[++c_buffer_idx]; - dcs.bit_counter=0; - } - - // if next bit is 1, go to right. if it is 0, goto left - if(dcs.code_slice&0x80000000) - node_ptr = node_ptr->right; - else - node_ptr = node_ptr->left; - dcs.code_slice <<= 1; - ++dcs.bit_counter; - - // if it is a data node, just copy the data from that node - if(node_ptr && !node_ptr->right) - { - data = node_ptr->value; - isData = 1; - } - - // if the it's a new data, get the next 8 bits - else if(node_ptr==NULL) - { - for(i=0;i<8;i++) - { - // if it's the end of the code slice, get the next slice. - if(dcs.bit_counter==32) - { - - dcs.code_slice = c_buffer[++c_buffer_idx]; - dcs.bit_counter = 0; - } - data <<= 1; - data |= dcs.code_slice>>31; - dcs.code_slice <<= 1; - ++dcs.bit_counter; - } - isData = 1; - } // end of 'else if(node_ptr==NULL)' - } while (!isData); - } // end of 'if(DHTroot.freq)' - - BuildDHT(data); - - // prevent code count overflow - if(dcs.nCode+1 > MAX_FREQ) { dcs.nCode = DHTroot.freq; ++dcs.nCodeReset; } - else ++dcs.nCode; - - // if everything has been decoded, set end_of_buffer flag - if(dcs.nCodeReset == code_reset_count && dcs.nCode == code_count) - { - end_of_buffer=1; - } - - return data; // return the decoded data -} - -static void AllocBufferC(int size) -{ - c_buffer_size = size; - c_buffer = (UINT32*)realloc(c_buffer, c_buffer_size*4); -} - -// prevent c_buffer overflow while encoding -static void GrowBufferC() -{ - // flush to disk periodically - fwrite(c_buffer+c_buffer_size-MAX_BUFFER_LEN,4,MAX_BUFFER_LEN,cFile); - AllocBufferC(c_buffer_size + MAX_BUFFER_LEN); -} - -// prevent d_buffer foverflow while encoding -static void ReloadBufferD() -{ - fread(d_buffer,4,MAX_BUFFER_LEN,dFile); - d_buffer_idx = 0; -} - -// prevent d_buffer overflow while decoding -static void ResetBufferD() -{ - fwrite(d_buffer,4,MAX_BUFFER_LEN,dFile); - d_buffer_idx = 0; -} - -//# -//# Functions for File I/O -//# -//############################################################################## - -// return 0 if the compressed file is opened sucessfully, 1 otherwise -int OpenCompressedFile(char *file_name, char *mode) -{ - if(cFile) fclose(cFile); - cFile = NULL; - - cFile = fopen(file_name, mode); - if (cFile) return 0; - - return 1; -} - -// Always returns 0 -int EmbedCompressedFile(FILE *pEmb, int nOffset) -{ - if(cFile) fclose(cFile); - cFile = NULL; - - cFile = pEmb; - bEmbed = 1; - if (nOffset >= 0) { - embed_offset = nOffset; - fseek(cFile,nOffset,SEEK_SET); - } else { - if (nOffset == -2) { - fseek(cFile,0,SEEK_END); - } - embed_offset = ftell(cFile); - } - return 0; -} - -// return 0 if the decompressed file is opened sucessfully, 1 otherwise -int OpenDecompressedFile(char *file_name, char *mode) -{ - dFile = NULL; - dFile = fopen(file_name, mode); - if (dFile) return 0; - return 1; -} - -// load the compressed file into the c_buffer -// - call this function only if the compressed file is opened successfully -void LoadCompressedFile() -{ - int byte_count; - int buffer_reset_count; - - // load the flags - fread(&byte_count,sizeof(int),1,cFile); - fread(&code_count,sizeof(int),1,cFile); - fread(&code_reset_count,sizeof(int),1,cFile); - fread(&buffer_reset_count,sizeof(int),1,cFile); - - // load everything into the buffer - AllocBufferC((buffer_reset_count+1)*MAX_BUFFER_LEN); - fread(c_buffer,1,byte_count-16,cFile); // note: byte_count includes the size of the headers -} - -// this method is used when unfreezing the compression status -// it flushes the contents of the compressed file to disk -static void DoWriteCompressedFile() -{ - // save file size, code count, etc - SaveResult(); - - // handle file embedding - fseek(cFile,embed_offset,SEEK_SET); - - fwrite(&nCompressedFileSize,sizeof(int),1,cFile); - fwrite(&nCodeCount,sizeof(int),1,cFile); - fwrite(&nCodeResetCount,sizeof(int),1,cFile); - fwrite(&nBufferResetCount,sizeof(int),1,cFile); - - // flush entire contents of compress buffer - fwrite(c_buffer,4,c_buffer_idx+1,cFile); -} - -// write whatever is left in the c_buffer to the -// compressed file, and close the compressed file -// - use this if the compressed file was opened in 'write' mode -void WriteCompressedFile() -{ - if(cFile) - { - DoWriteCompressedFile(); - CloseCompressedFile(); - } -} - -// write whatever is left in the d_buffer to the -// decompressed file, and close the decompressed file -// - use this if the decompressed file was opened in 'write' mode -void WriteDecompressedFile(int bytes_remain) -{ - UINT32 code_slice; - int i; - - if(dFile) - { - // write the buffer to the file - if(d_buffer_idx) fwrite(d_buffer,4,d_buffer_idx,dFile); - if(bytes_remain) - { - code_slice = d_buffer[d_buffer_idx]; - for(i=0;i<(4-bytes_remain);i++) - { - code_slice >>= 8; - } - fwrite(&code_slice,1,bytes_remain,dFile); - } - - fclose(dFile); - dFile = NULL; - } -} - -// close the compressed file -// - use this if the compressed file was opened in 'read' mode -void CloseCompressedFile() -{ - if(cFile) - { - // handle file embedding - if (!bEmbed) { - fclose(cFile); - } - - cFile = NULL; - embed_offset = 0; - bEmbed = 0; - -#ifdef _DEBUG - // PrintTree(); - CheckList(); -#endif - - DestroyDHT(); - - free(c_buffer); - c_buffer = NULL; - c_buffer_size = 0; - } -} - -// close the decompressed file -// - use this if the decompressed file was opened in 'read' mode -void CloseDecompressedFile() -{ - if(dFile) - { - fclose(dFile); - dFile = NULL; - } -} - -//# -//# Utility Functions for Debugging Purpose -//# -//############################################################################## - -// print the node frequency while reverse level traversing -void PrintFreqTraverse() -{ - int curr_idx = list_idx; - - printf("Frequency Traverse -"); - while(node_list[curr_idx]) - { - printf(" %d",node_list[curr_idx]->freq); - if(node_list[curr_idx]->value) printf(":%c",node_list[curr_idx]->value); - ++curr_idx; - } -} - -// print the tree view (rotated -90 degrees) -void PrintTreeBreath(struct DHTNode *node_ptr, int spaces) -{ - int i; - int num_digits; - int tab_len; - if(node_ptr) - { - num_digits = node_ptr->freq; - tab_len = spaces; - PrintTreeBreath(node_ptr->right, spaces+7); // right tree first - - num_digits=num_digits/10; - while(num_digits) { --tab_len; num_digits=num_digits/10;} - for(i=0;ifreq); - if(node_ptr->value) printf(":%c",node_ptr->value); - printf("\n"); - - PrintTreeBreath(node_ptr->left, spaces+7); // then left tree - } -} - -// print the header, then print the tree in breath order -void PrintTree() -{ - printf("View of the Tree (rotated -90 degrees)\n"); - PrintTreeBreath(&DHTroot, 0); -} - -// check the reverse traverse list and print any frequencies that are out of order -#ifdef _DEBUG -static void CheckList() -{ - int curr_idx = list_idx; - int count_errors = 0; - while(curr_idx < MAX_LIST_LEN-3) - { - if(node_list[curr_idx]->freq > node_list[curr_idx+1]->freq) - printf("\nError: list is out of order.\n%d\n%d\n",node_list[curr_idx]->freq,node_list[curr_idx+1]->freq); - - curr_idx++; - count_errors++; - } - if(!count_errors) - printf("\nNo errors in reverse traverse list.\n"); -} -#endif - -// dump the buffer to the screen -void PrintBuffer() -{ - UINT32 i, j; - j = (UINT32)c_buffer_idx; - - printf("buffer = "); - for(i=0;i<=j;i++) printf("%.8X ",c_buffer[i]); -} - -// save compression result -static void SaveResult() -{ - nCompressedFileSize = 16+(c_buffer_idx+1)*4; // convert to Bytes - nCodeCount = code_count; - nCodeResetCount = code_reset_count; - nBufferIdx = c_buffer_idx; - // nBufferResetCount is retained for backwards compatability - nBufferResetCount = c_buffer_idx/MAX_BUFFER_LEN; -} - -// print file size, how many codes, etc -void PrintResult() -{ - printf("\ncompressed file size = %.3f KB\n\n",(double)nCompressedFileSize/1024.0); // convert to KB - printf(" max code count = %u\n", MAX_FREQ); - printf(" current code count = %u\n", nCodeCount); - printf(" # code count reset = %d\n\n",nCodeResetCount); - printf(" max buffer size = %.3f KB\n",(float)(4*MAX_BUFFER_LEN)/1024.0); - printf(" max buffer index = %d\n", MAX_BUFFER_LEN); - printf("current buffer index = %u\n", nBufferIdx); - printf(" # buffer re-used = %d\n\n",nBufferResetCount); -} - -//# -//# Compression Status Freezing -//# -//############################################################################## - -static inline void Write32(unsigned char*& ptr, const unsigned long v) -{ - *ptr++ = (unsigned char)(v&0xff); - *ptr++ = (unsigned char)((v>>8)&0xff); - *ptr++ = (unsigned char)((v>>16)&0xff); - *ptr++ = (unsigned char)((v>>24)&0xff); -} - -static inline unsigned long Read32(const unsigned char*& ptr) -{ - unsigned long v; - v = (unsigned long)(*ptr++); - v |= (unsigned long)((*ptr++)<<8); - v |= (unsigned long)((*ptr++)<<16); - v |= (unsigned long)((*ptr++)<<24); - return v; -} - -static inline void Write16(unsigned char*& ptr, const unsigned short v) -{ - *ptr++ = (unsigned char)(v&0xff); - *ptr++ = (unsigned char)((v>>8)&0xff); -} - -static inline unsigned short Read16(const unsigned char*& ptr) -{ - unsigned short v; - v = (unsigned short)(*ptr++); - v |= (unsigned short)((*ptr++)<<8); - return v; -} - -/* -struct DHTFreezeStruct -{ - struct DHTFreezeStatus header; - struct DHTFreezeNode - { - unsigned int freq; - unsigned char val; - short left, right, parent - } node_list[n_nodes] -} -*/ - -struct DHTFreezeStatus -{ - int n_nodes; - unsigned long null_node_p; - int bit_counter; - unsigned int code_count; - int code_reset_count; - int c_buffer_idx; -}; - -static const int DHTFreezeStatusSize = 6*4; -static const int DHTNodeSize = 12; - -static inline int IndexForNode(const DHTNode* node) -{ - if(!node) return 0xffff; - return node->l_index; -} - -static inline DHTNode* NodeForIndex(int idx) -{ - switch(idx) - { - case 0xffff: - return NULL; - default: - return node_list[idx]; - } -} - -static void WriteNode(unsigned char*& ptr, const DHTNode* node) -{ - Write32(ptr, node->freq); - Write16(ptr, node->value); - Write16(ptr, IndexForNode(node->left)); - Write16(ptr, IndexForNode(node->right)); - Write16(ptr, IndexForNode(node->parent)); -} - -static void ReadNode(const unsigned char*& ptr, DHTNode* node) -{ - node->freq = Read32(ptr); - node->value = Read16(ptr); - node->left=NodeForIndex(Read16(ptr)); - node->right=NodeForIndex(Read16(ptr)); - node->parent=NodeForIndex(Read16(ptr)); -} - -static void FreezeDHT(const struct DHTFreezeStatus& status, unsigned char*& ptr) -{ - Write32(ptr, status.n_nodes); - Write32(ptr, status.null_node_p); - Write32(ptr, status.bit_counter); - Write32(ptr, status.code_count); - Write32(ptr, status.code_reset_count); - Write32(ptr, status.c_buffer_idx); - - int n_nodes=status.n_nodes; - while(n_nodes) - { - WriteNode(ptr, node_list[MAX_LIST_LEN-1-n_nodes]); - --n_nodes; - } -} - -static int UnfreezeDHT(struct DHTFreezeStatus* status, const unsigned char*& ptr, const int buf_size) -{ - if(buf_size < DHTFreezeStatusSize) - { - return 1; - } - - status->n_nodes = Read32(ptr); - status->null_node_p = Read32(ptr); - status->bit_counter = Read32(ptr); - status->code_count = Read32(ptr); - status->code_reset_count = Read32(ptr); - status->c_buffer_idx = Read32(ptr); - - if(buf_size < (DHTFreezeStatusSize + status->n_nodes*DHTNodeSize)) - { - return 1; - } - - DestroyDHT(); - - int n=status->n_nodes; - if(n) - { - node_list[--list_idx]=&DHTroot; - --n; - } - while(n) - { - node_list[--list_idx]=(struct DHTNode *)malloc(sizeof(struct DHTNode)); - --n; - } - - n=status->n_nodes; - while(n) - { - int idx=MAX_LIST_LEN-1-n; - ReadNode(ptr, node_list[idx]); - node_list[idx]->l_index=idx; - if(!node_list[idx]->right) - { - look_up_table[node_list[idx]->value]=node_list[idx]; - } - --n; - } - - null_node_ptr = (status->null_node_p == 0xffffffff) ? &DHTroot : node_list[status->null_node_p]; - - return 0; -} - -int FreezeDecode(unsigned char **buf, int *size) -{ - // compute the size required for the buffer - int n_nodes = MAX_LIST_LEN-1 - list_idx; - int dht_size = DHTFreezeStatusSize + n_nodes*DHTNodeSize; - int buf_size = 4 + dht_size + (c_buffer_idx+1)*4; - - *buf = (unsigned char*)malloc(buf_size); - *size = buf_size; - - if(!(*buf)) - { - return 1; - } - - DHTFreezeStatus status; - status.n_nodes = n_nodes; - status.null_node_p = (null_node_ptr == &DHTroot) ? 0xffffffff : null_node_ptr->l_index; - status.bit_counter = dcs.bit_counter; - status.code_count = dcs.nCode; - status.code_reset_count = dcs.nCodeReset; - status.c_buffer_idx = c_buffer_idx; - - unsigned char* ptr = *buf; - Write32(ptr, dht_size); // write DHT status size - FreezeDHT(status, ptr); // write DHT status - memcpy(ptr, c_buffer, (c_buffer_idx+1)*4); // write code buffer - - return 0; -} - -int UnfreezeDecode(const unsigned char* buf, int size) -{ - if(size < 4) - { - return 1; - } - - const unsigned char* ptr = buf; - int dht_size = (int)Read32(ptr); // read DHT status size - - DHTFreezeStatus status; - if(UnfreezeDHT(&status, ptr, dht_size)) // read DHT status - { - return 1; - } - - // NOTE: - // UnfreezeDecode is a special case. In order to - // implement "rewind" functionality, it's necessary - // to restore the state of the decode, but leave - // the contents of the code buffer intact - -#if 0 - // restore code buffer - int n_buffers = status.c_buffer_idx/MAX_BUFFER_LEN; - AllocBufferC((n_buffers+1)*MAX_BUFFER_LEN); - memcpy(c_buffer, ptr, (status.c_buffer_idx+1)*4); // read code buffer -#endif - - // Here we make a weak check against attempting to - // seek past the end of the code buffer - if(status.c_buffer_idx >= c_buffer_size) - { - return 1; - } - - dcs.bit_counter = status.bit_counter; - dcs.nCode = status.code_count; - dcs.nCodeReset = status.code_reset_count; - - c_buffer_idx = status.c_buffer_idx; - dcs.code_slice = c_buffer[c_buffer_idx] << dcs.bit_counter; - - return 0; -} - -int FreezeEncode(unsigned char **buf, int *size) -{ - // compute the size required for the buffer - int n_nodes = MAX_LIST_LEN-1 - list_idx; - int dht_size = DHTFreezeStatusSize + n_nodes*DHTNodeSize; - int buf_size = 4 + dht_size + (c_buffer_idx+1)*4; - - *buf = (unsigned char*)malloc(buf_size); - *size = buf_size; - - if(!(*buf)) - { - return 1; - } - - DHTFreezeStatus status; - status.n_nodes = n_nodes; - status.null_node_p = (null_node_ptr == &DHTroot) ? 0xffffffff : null_node_ptr->l_index; - status.bit_counter = 32 - dcs.bit_counter; // while encoding, bit_counter equals bits remaining in slice - status.code_count = code_count; - status.code_reset_count = code_reset_count; - status.c_buffer_idx = c_buffer_idx; - - unsigned char* ptr = *buf; - Write32(ptr, dht_size); // write DHT status size - FreezeDHT(status, ptr); // write DHT status - memcpy(ptr, c_buffer, (c_buffer_idx+1)*4); // write code buffer - - return 0; -} - -int UnfreezeEncode(const unsigned char* buf, int size) -{ - if(size < 4) - { - return 1; - } - - const unsigned char* ptr = buf; - int dht_size = (int)Read32(ptr); // read DHT status size - - DHTFreezeStatus status; - if(UnfreezeDHT(&status, ptr, dht_size)) // read DHT status - { - return 1; - } - - int buf_size = 4 + dht_size + (status.c_buffer_idx+1)*4; - if(buf_size > size) - { - return 1; - } - - dcs.bit_counter = 32 - status.bit_counter; // while encoding, bit_counter equals bits remaining in slice - code_count = status.code_count; - code_reset_count = status.code_reset_count; - c_buffer_idx = status.c_buffer_idx; - - int n_buffers = status.c_buffer_idx/MAX_BUFFER_LEN; - AllocBufferC((n_buffers+1)*MAX_BUFFER_LEN); - memcpy(c_buffer, ptr, (status.c_buffer_idx+1)*4); // read code buffer - DoWriteCompressedFile(); // flush to disk - fseek(cFile,embed_offset+16+(n_buffers*MAX_BUFFER_LEN)*4,SEEK_SET); // position write ptr for periodic flush - - // mask off the unread bits from the current code - // this should be unneccessary, but it doesn't hurt - c_buffer[c_buffer_idx] &= (0xffffffff << dcs.bit_counter); - - return 0; -} diff --git a/jan/src/burner/win32/dynhuff.h b/jan/src/burner/win32/dynhuff.h deleted file mode 100644 index 5154dace5..000000000 --- a/jan/src/burner/win32/dynhuff.h +++ /dev/null @@ -1,164 +0,0 @@ -// -// Dynamic Huffman Encoder/Decoder -// -// implemented by Gangta -// -//----------------------------------------------------------- -// -// Version History -// -// version 0.1 - first release -// version 0.1a - fixed a bug where the bit remainder in -// the EncodeBuffer() function didn't reset -// to 32 if encoding is restarted before -// program exit -// version 0.1b - fixed right shift -// - fixed some utility functions -// -// version 0.1c - fixed PrintResult() -// - fixed a fatal bug in CorrectDHT() 15% slower -// - optimized compression/decompression 95% faster -// - overall 80% faster :) -// -// version 0.2 - optimized even more, now O(lg 2) :) -// -//----------------------------------------------------------- -// -// Memory usage: -// -// 128 KB for both encoding/decoding -// -// I tested buffer size 16K, 32K, 64K, 128K, etc -// The performance started to drop after 512K, -// so I chose 128K. -// -// Comments: -// -// I tried to optimize the speed as best I can in my -// knowledge. -// -// It has buffer overflow protection for encoding and -// decoding. -// -// It has a frequency reset function which prevents -// frequency overflow. -// -// It can compress text files as well as any type of -// binary files. The compression is not as good as -// zlib, or bzlibb2, but it supports "on the fly" -// encoding/decoding, and I believe it is faster than -// bzlibb2. -// -// -/////////////////////////////////////////////////////////////// - -#ifndef _DYNHUFF_H_ -#define _DYNHUFF_H_ - -#include - -#define MAX_FREQ ((unsigned int)0xFFFFFFFF) // max unsigned int -#define MAX_BUFFER_LEN 32768 // 4 B * 32768 = 128 KB -#define MAX_LIST_LEN 512 - -//# -//# Buffer Handling -//# -//############################################################################## - -// 1 if decoding is finished, 0 otherwise -extern int end_of_buffer; - -// takes a data and compress it to the buffer -void EncodeBuffer(unsigned char data); - -// decompresses and returns the next data from buffer -unsigned char DecodeBuffer(); - -//# -//# File I/O -//# -//############################################################################## - -// takes a decompressed file and compresses the whole thing into another file -int Compress(char *d_file_name, char *c_file_name); - -// takes a compressed file and decompresses the whole thing into another file -int Decompress(char *c_file_name, char *d_file_name); - -// returns 0 if the compressed file is opened successfully, 1 otherwise -int OpenCompressedFile(char *file_name, char *mode); - -// Always returns 0 -int EmbedCompressedFile(FILE *pEmb, int nOffset); - -// returns 0 if the decompressed file is opened successfully, 1 otherwise -int OpenDecompressedFile(char *file_name, char *mode); - -// loads the compressed file into c_buffer -// - use it only if the compressed file was opened successfully -void LoadCompressedFile(); - -// writes whatever is left in c_buffer to the compressed file, -// and closes the compressed file -// - use this if the compressed file was opened in 'write' mode -void WriteCompressedFile(); - -// writes whatever is left in d_buffer to the decompressed file, -// and closes the decompressed file -// - use this if the decompressed file was opened in 'write' mode -void WriteDecompressedFile(int bytes_remain); - -// closes the compressed file -// - use this if the compressed file was opened in 'read' mode -void CloseCompressedFile(); - -// closes the compressed file -// - use this if the decompressed file was opened in 'read' mode -void CloseDecompressedFile(); - -//# -//# Utility Functions -//# -//############################################################################## - -// print the encoded buffer (upto the current buffer item) -void PrintBuffer(); // use this while encoding - -// print all nodes while reverse level traversing -void PrintFreqTraverse(); // use this before DestroyDHT() happens - -// print the tree in breath order (rotated -90 degrees) -void PrintTree(); // use this before DestroyDHT() happens - -// print compression result -void PrintResult(); // use this after finish encoding - -//# -//# Compression Status Freezing -//# -//############################################################################## - -// freeze the status of decoding -// returns a malloc()'d buffer in *buffer -// the length of the buffer is returned in *size -// returns 0 always -int FreezeDecode(unsigned char **buffer, int *size); - -// unfreeze the status of decoding from the given buffer -// the length of the buffer is passed in size -// returns 0 if successful, 1 otherwise -int UnfreezeDecode(const unsigned char* buffer, int size); - -// freeze the status of encoding -// returns a malloc()'d buffer in *buffer -// the length of the buffer is returned in *size -// returns 0 always -int FreezeEncode(unsigned char **buffer, int *size); - -// unfreeze the status of encoding from the given buffer -// the length of the buffer is passed in size -// returns 0 if successful, 1 otherwise -int UnfreezeEncode(const unsigned char* buffer, int size); - -#endif // end of '#ifndef _DYNHUFF_H_' diff --git a/jan/src/burner/win32/fba_kaillera.cpp b/jan/src/burner/win32/fba_kaillera.cpp deleted file mode 100644 index 81a31ca28..000000000 --- a/jan/src/burner/win32/fba_kaillera.cpp +++ /dev/null @@ -1,213 +0,0 @@ -#include "burner.h" - -const int MAXPLAYER = 4; -static int nPlayerInputs[MAXPLAYER], nCommonInputs, nDIPInputs; -static int nPlayerOffset[MAXPLAYER], nCommonOffset, nDIPOffset; - -const int INPUTSIZE = 8 * (4 + 8); -static unsigned char nControls[INPUTSIZE]; - -// Inputs are assumed to be in the following order: -// All player 1 controls -// All player 2 controls (if any) -// All player 3 controls (if any) -// All player 4 controls (if any) -// All common controls -// All DIP switches - -int KailleraInitInput() -{ - if (nGameInpCount == 0) { - return 1; - } - - struct BurnInputInfo bii; - memset(&bii, 0, sizeof(bii)); - - unsigned int i = 0; - - nPlayerOffset[0] = 0; - do { - BurnDrvGetInputInfo(&bii, i); - i++; - } while (!_strnicmp(bii.szName, "P1", 2) && i <= nGameInpCount); - i--; - nPlayerInputs[0] = i - nPlayerOffset[0]; - - for (int j = 1; j < MAXPLAYER; j++) { - char szString[3] = "P?"; - szString[1] = j + '1'; - nPlayerOffset[j] = i; - while (!_strnicmp(bii.szName, szString, 2) && i < nGameInpCount) { - i++; - BurnDrvGetInputInfo(&bii, i); - } - nPlayerInputs[j] = i - nPlayerOffset[j]; - } - - nCommonOffset = i; - while ((bii.nType & BIT_GROUP_CONSTANT) == 0 && i < nGameInpCount){ - i++; - BurnDrvGetInputInfo(&bii, i); - }; - nCommonInputs = i - nCommonOffset; - - nDIPOffset = i; - nDIPInputs = nGameInpCount - nDIPOffset; - -#if 0 && defined FBA_DEBUG - dprintf(_T(" * Kaillera inputs configured as follows --\n")); - for (int j = 0; j < MAXPLAYER; j++) { - dprintf(_T(" p%d offset %d, inputs %d.\n"), j + 1, nPlayerOffset[j], nPlayerInputs[j]); - } - dprintf(_T(" common offset %d, inputs %d.\n"), nCommonOffset, nCommonInputs); - dprintf(_T(" dip offset %d, inputs %d.\n"), nDIPOffset, nDIPInputs); -#endif - - return 0; -} - -int KailleraGetInput() -{ - int i, j, k; - - struct BurnInputInfo bii; - memset(&bii, 0, sizeof(bii)); - - // Initialize controls to 0 - memset(nControls, 0, INPUTSIZE); - - // Pack all DIP switches + common controls + player 1 controls - for (i = 0, j = 0; i < nPlayerInputs[0]; i++, j++) { - BurnDrvGetInputInfo(&bii, i + nPlayerOffset[0]); - if (*bii.pVal && bii.nType == BIT_DIGITAL) { - nControls[j >> 3] |= (1 << (j & 7)); - } - } - for (i = 0; i < nCommonInputs; i++, j++) { - BurnDrvGetInputInfo(&bii, i + nCommonOffset); - if (*bii.pVal) { - nControls[j >> 3] |= (1 << (j & 7)); - } - } - - // Convert j to byte count - j = (j + 7) >> 3; - - // Analog controls/constants - for (i = 0; i < nPlayerInputs[0]; i++) { - BurnDrvGetInputInfo(&bii, i + nPlayerOffset[0]); - if (*bii.pVal && bii.nType != BIT_DIGITAL) { - if (bii.nType & BIT_GROUP_ANALOG) { - nControls[j++] = *bii.pShortVal >> 8; - nControls[j++] = *bii.pShortVal & 0xFF; - } else { - nControls[j++] = *bii.pVal; - } - } - } - - // DIP switches - for (i = 0; i < nDIPInputs; i++, j++) { - BurnDrvGetInputInfo(&bii, i + nDIPOffset); - nControls[j] = *bii.pVal; - } - - // k has the size of all inputs for one player - k = j + 1; - - // Send the control block to the Kaillera DLL & retrieve all controls - //if (kailleraModifyPlayValues(nControls, k) == -1) { - if (Kaillera_Modify_Play_Values(nControls, k) == -1) { - kNetGame = 0; - return 1; - } - - // Decode Player 1 input block - for (i = 0, j = 0; i < nPlayerInputs[0]; i++, j++) { - BurnDrvGetInputInfo(&bii, i + nPlayerOffset[0]); - if (bii.nType == BIT_DIGITAL) { - if (nControls[j >> 3] & (1 << (j & 7))) { - *bii.pVal = 0x01; - } else { - *bii.pVal = 0x00; - } - } - } - for (i = 0; i < nCommonInputs; i++, j++) { - BurnDrvGetInputInfo(&bii, i + nCommonOffset); - if (nControls[j >> 3] & (1 << (j & 7))) { - *bii.pVal = 0x01; - } else { - *bii.pVal = 0x00; - } - } - - // Convert j to byte count - j = (j + 7) >> 3; - - // Analog inputs - for (i = 0; i < nPlayerInputs[0]; i++) { - BurnDrvGetInputInfo(&bii, i + nDIPOffset); - if (bii.nType & BIT_GROUP_ANALOG) { - *bii.pShortVal = (nControls[j] << 8) | nControls[j + 1]; - j += 2; - } - } - - // DIP switches - for (i = 0; i < nDIPInputs; i++, j++) { - BurnDrvGetInputInfo(&bii, i + nDIPOffset); - *bii.pVal = nControls[j]; - } - - // Decode other player's input blocks - for (int l = 1; l < MAXPLAYER; l++) { - if (nPlayerInputs[l]) { - for (i = 0, j = k * (l << 3); i < nPlayerInputs[l]; i++, j++) { - BurnDrvGetInputInfo(&bii, i + nPlayerOffset[l]); - if (bii.nType == BIT_DIGITAL) { - if (nControls[j >> 3] & (1 << (j & 7))) { - *bii.pVal = 0x01; - } else { - *bii.pVal = 0x00; - } - } - } - - for (i = 0; i < nCommonInputs; i++, j++) { -#if 0 - // Allow other players to use common inputs - BurnDrvGetInputInfo(&bii, i + nCommonOffset); - if (nControls[j >> 3] & (1 << (j & 7))) { - *bii.pVal |= 0x01; - } -#endif - } - - // Convert j to byte count - j = (j + 7) >> 3; - - // Analog inputs/constants - for (i = 0; i < nPlayerInputs[l]; i++) { - BurnDrvGetInputInfo(&bii, i + nPlayerOffset[l]); - if (bii.nType != BIT_DIGITAL) { - if (bii.nType & BIT_GROUP_ANALOG) { - *bii.pShortVal = (nControls[j] << 8) | nControls[j + 1]; - j += 2; - } - } - } - -#if 0 - // For a DIP switch to be set to 1, ALL players must set it - for (i = 0; i < nDIPInputs; i++, j++) { - BurnDrvGetInputInfo(&bii, i + nDIPOffset); - *bii.pVal &= nControls[j]; - } -#endif - } - } - - return 0; -} diff --git a/jan/src/burner/win32/gameinfo.cpp b/jan/src/burner/win32/gameinfo.cpp deleted file mode 100644 index ebdab7dfe..000000000 --- a/jan/src/burner/win32/gameinfo.cpp +++ /dev/null @@ -1,846 +0,0 @@ -// FBAlpha Game Info and Favorites handling -#include "burner.h" - -static HWND hGameInfoDlg = NULL; -static HWND hParent = NULL; -static HWND hTabControl = NULL; -static HMODULE hRiched = NULL; -static HBITMAP hPreview = NULL; -HBITMAP hGiBmp = NULL; -static TCHAR szFullName[1024]; -static int nGiDriverSelected; -static HBRUSH hWhiteBGBrush; - -static FILE* OpenPreview(TCHAR *szPath) -{ - TCHAR szBaseName[MAX_PATH]; - TCHAR szFileName[MAX_PATH]; - - FILE* fp = NULL; - - // Try to load a .PNG preview image - _sntprintf(szBaseName, sizeof(szBaseName), _T("%s%s"), szPath, BurnDrvGetText(DRV_NAME)); - _stprintf(szFileName, _T("%s.png"), szBaseName); - fp = _tfopen(szFileName, _T("rb")); - - if (!fp && BurnDrvGetText(DRV_PARENT)) { // Try the parent - _sntprintf(szBaseName, sizeof(szBaseName), _T("%s%s"), szPath, BurnDrvGetText(DRV_PARENT)); - _stprintf(szFileName, _T("%s.png"), szBaseName); - fp = _tfopen(szFileName, _T("rb")); - } - - return fp; -} - -#define IMG_MAX_HEIGHT 380 -#define IMG_MAX_WIDTH 700 -#define IMG_DEFAULT_WIDTH 506 -#define IMG_DEFAULT_WIDTH_V 285 -#define IMG_ASPECT_4_3 1 -#define IMG_ASPECT_PRESERVE 2 - -static void SetPreview(TCHAR* szPreviewDir, int nAspectFlag) -{ - HWND hDlg = hGameInfoDlg; - - HBITMAP hNewImage = NULL; - - if (hGiBmp) { - DeleteObject((HGDIOBJ)hGiBmp); - hGiBmp = NULL; - } - - // get image dimensions and work out what to resize to (default to 4:3) - IMAGE img = { 0, 0, 0, 0, NULL, NULL, 0}; - int img_width = IMG_DEFAULT_WIDTH; - int img_height = IMG_MAX_HEIGHT; - - FILE *fp = OpenPreview(szPreviewDir); - if (fp) { - PNGGetInfo(&img, fp); - - // vertical 3:4 - if (img.height > img.width) { - img_width = IMG_DEFAULT_WIDTH_V; - } - - // preserve aspect support - if (nAspectFlag == IMG_ASPECT_PRESERVE) { - double nAspect = (double)img.width / img.height; - img_width = (int)((double)IMG_MAX_HEIGHT * nAspect); - - if (img_width > IMG_MAX_WIDTH) { - img_width = IMG_MAX_WIDTH; - img_height = (int)((double)IMG_MAX_WIDTH / nAspect); - } - } - - img_free(&img); - fclose(fp); - } - - fp = OpenPreview(szPreviewDir); - if (fp) { - hNewImage = PNGLoadBitmap(hDlg, fp, img_width, img_height, 3); - fclose(fp); - } - - if (hNewImage) { - - if(hGiBmp) DeleteObject((HGDIOBJ)hGiBmp); - - hGiBmp = hNewImage; - - if (bPngImageOrientation == 0) { - SendDlgItemMessage(hDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hGiBmp); - SendDlgItemMessage(hDlg, IDC_SCREENSHOT_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - ShowWindow(GetDlgItem(hDlg, IDC_SCREENSHOT_V), SW_HIDE); - } else { - SendDlgItemMessage(hDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - ShowWindow(GetDlgItem(hDlg, IDC_SCREENSHOT_V), SW_SHOW); - SendDlgItemMessage(hDlg, IDC_SCREENSHOT_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hGiBmp); - } - - } else { - SendDlgItemMessage(hDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)LoadBitmap(hAppInst, MAKEINTRESOURCE(BMP_SPLASH))); - SendDlgItemMessage(hDlg, IDC_SCREENSHOT_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - ShowWindow(GetDlgItem(hDlg, IDC_SCREENSHOT_V), SW_HIDE); - } -} - -static int DisplayRomInfo() -{ - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_SCREENSHOT_H), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_MESSAGE_EDIT_ENG), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_LIST1), SW_SHOW); - UpdateWindow(hGameInfoDlg); - - return 0; -} - -static int DisplaySampleInfo() -{ - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_SCREENSHOT_H), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_MESSAGE_EDIT_ENG), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_LIST2), SW_SHOW); - UpdateWindow(hGameInfoDlg); - - return 0; -} - -static int DisplayHistory() -{ - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_SCREENSHOT_H), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_LIST1), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_LIST2), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_MESSAGE_EDIT_ENG), SW_SHOW); - UpdateWindow(hGameInfoDlg); - - return 0; -} - -static int GameInfoInit() -{ - // Get the games full name - TCHAR szText[1024] = _T(""); - TCHAR* pszPosition = szText; - TCHAR* pszName = BurnDrvGetText(DRV_FULLNAME); - - pszPosition += _sntprintf(szText, 1024, pszName); - - pszName = BurnDrvGetText(DRV_FULLNAME); - while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) { - if (pszPosition + _tcslen(pszName) - 1024 > szText) { - break; - } - pszPosition += _stprintf(pszPosition, _T(SEPERATOR_2) _T("%s"), pszName); - } - - _tcscpy(szFullName, szText); - - _stprintf(szText, _T("%s") _T(SEPERATOR_1) _T("%s"), FBALoadStringEx(hAppInst, IDS_GAMEINFO_DIALOGTITLE, true), szFullName); - - // Set the window caption - SetWindowText(hGameInfoDlg, szText); - - // Setup the tabs - hTabControl = GetDlgItem(hGameInfoDlg, IDC_TAB1); - TC_ITEM TCI; - TCI.mask = TCIF_TEXT; - - UINT idsString[16] = { IDS_GAMEINFO_ROMINFO, IDS_GAMEINFO_SAMPLES, IDS_GAMEINFO_HISTORY, IDS_GAMEINFO_INGAME, IDS_GAMEINFO_TITLE, IDS_GAMEINFO_SELECT, IDS_GAMEINFO_VERSUS, IDS_GAMEINFO_HOWTO, IDS_GAMEINFO_SCORES, IDS_GAMEINFO_BOSSES, IDS_GAMEINFO_GAMEOVER, IDS_GAMEINFO_FLYER, IDS_GAMEINFO_CABINET, IDS_GAMEINFO_MARQUEE, IDS_GAMEINFO_CONTROLS, IDS_GAMEINFO_PCB }; - - for(int i = 0; i < 16; i++) { - TCI.pszText = FBALoadStringEx(hAppInst, idsString[i], true); - SendMessage(hTabControl, TCM_INSERTITEM, (WPARAM) i, (LPARAM) &TCI); - } - - // Load the preview image - hPreview = LoadBitmap(hAppInst, MAKEINTRESOURCE(BMP_SPLASH)); - - // Display preview image - SendDlgItemMessage(hGameInfoDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - SendDlgItemMessage(hGameInfoDlg, IDC_SCREENSHOT_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - - // Favorite game checkbox - CheckDlgButton(hGameInfoDlg,IDFAVORITESET,(CheckFavorites(BurnDrvGetTextA(DRV_NAME)) != -1) ? BST_CHECKED : BST_UNCHECKED); - - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_LIST1), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_LIST2), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_MESSAGE_EDIT_ENG), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_SCREENSHOT_H), SW_SHOW); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_SCREENSHOT_V), SW_SHOW); - UpdateWindow(hGameInfoDlg); - - nBurnDrvActive = nGiDriverSelected; - DisplayRomInfo(); - - // Display the game title - TCHAR szItemText[1024]; - HWND hInfoControl = GetDlgItem(hGameInfoDlg, IDC_TEXTCOMMENT); - SendMessage(hInfoControl, WM_SETTEXT, (WPARAM)0, (LPARAM)szFullName); - - // Display the romname - bool bBracket = false; - hInfoControl = GetDlgItem(hGameInfoDlg, IDC_TEXTROMNAME); - _stprintf(szItemText, _T("%s"), BurnDrvGetText(DRV_NAME)); - if ((BurnDrvGetFlags() & BDF_CLONE) && BurnDrvGetTextA(DRV_PARENT)) { - int nOldDrvSelect = nBurnDrvActive; - pszName = BurnDrvGetText(DRV_PARENT); - - _stprintf(szItemText + _tcslen(szItemText), _T(" (clone of %s"), BurnDrvGetText(DRV_PARENT)); - - for (nBurnDrvActive = 0; nBurnDrvActive < nBurnDrvCount; nBurnDrvActive++) { - if (!_tcsicmp(pszName, BurnDrvGetText(DRV_NAME))) { - break; - } - } - if (nBurnDrvActive < nBurnDrvCount) { - if (BurnDrvGetText(DRV_PARENT)) { - _stprintf(szItemText + _tcslen(szItemText), _T(", uses ROMs from %s"), BurnDrvGetText(DRV_PARENT)); - } - } - nBurnDrvActive = nOldDrvSelect; - bBracket = true; - } else { - if (BurnDrvGetTextA(DRV_PARENT)) { - _stprintf(szItemText + _tcslen(szItemText), _T("%suses ROMs from %s"), bBracket ? _T(", ") : _T(" ("), BurnDrvGetText(DRV_PARENT)); - bBracket = true; - } - } - if (BurnDrvGetTextA(DRV_SAMPLENAME)) { - _stprintf(szItemText + _tcslen(szItemText), _T("%suses samples from %s"), bBracket ? _T(", ") : _T(" ("), BurnDrvGetText(DRV_SAMPLENAME)); - bBracket = true; - } - if (bBracket) { - _stprintf(szItemText + _tcslen(szItemText), _T(")")); - } - SendMessage(hInfoControl, WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - - //Display the rom info - bool bUseInfo = false; - szItemText[0] = _T('\0'); - hInfoControl = GetDlgItem(hGameInfoDlg, IDC_TEXTROMINFO); - if (BurnDrvGetFlags() & BDF_PROTOTYPE) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_PROTOTYPE, true)); - bUseInfo = true; - } - if (BurnDrvGetFlags() & BDF_BOOTLEG) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_BOOTLEG, true), bUseInfo ? _T(", ") : _T("")); - bUseInfo = true; - } - if (BurnDrvGetFlags() & BDF_HACK) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_HACK, true), bUseInfo ? _T(", ") : _T("")); - bUseInfo = true; - } - if (BurnDrvGetFlags() & BDF_HOMEBREW) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_HOMEBREW, true), bUseInfo ? _T(", ") : _T("")); - bUseInfo = true; - } - if (BurnDrvGetFlags() & BDF_DEMO) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_DEMO, true), bUseInfo ? _T(", ") : _T("")); - bUseInfo = true; - } - TCHAR szPlayersMax[100]; - _stprintf(szPlayersMax, FBALoadStringEx(hAppInst, IDS_NUM_PLAYERS_MAX, true)); - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_NUM_PLAYERS, true), bUseInfo ? _T(", ") : _T(""), BurnDrvGetMaxPlayers(), (BurnDrvGetMaxPlayers() != 1) ? szPlayersMax : _T("")); - bUseInfo = true; - if (BurnDrvGetText(DRV_BOARDROM)) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_BOARD_ROMS_FROM, true), bUseInfo ? _T(", ") : _T(""), BurnDrvGetText(DRV_BOARDROM)); - SendMessage(hInfoControl, WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - bUseInfo = true; - } - SendMessage(hInfoControl, WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - - // Display the release info - szItemText[0] = _T('\0'); - hInfoControl = GetDlgItem(hGameInfoDlg, IDC_TEXTSYSTEM); - TCHAR szUnknown[100]; - TCHAR szCartridge[100]; - _stprintf(szUnknown, FBALoadStringEx(hAppInst, IDS_ERR_UNKNOWN, true)); - _stprintf(szCartridge, FBALoadStringEx(hAppInst, IDS_MVS_CARTRIDGE, true)); - _stprintf(szItemText, FBALoadStringEx(hAppInst, IDS_HARDWARE_DESC, true), BurnDrvGetTextA(DRV_MANUFACTURER) ? BurnDrvGetText(DRV_MANUFACTURER) : szUnknown, BurnDrvGetText(DRV_DATE), (((BurnDrvGetHardwareCode() & HARDWARE_SNK_MVS) == HARDWARE_SNK_MVS) && ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK)) == HARDWARE_SNK_NEOGEO)? szCartridge : BurnDrvGetText(DRV_SYSTEM)); - SendMessage(hInfoControl, WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - - // Display any comments - szItemText[0] = _T('\0'); - hInfoControl = GetDlgItem(hGameInfoDlg, IDC_TEXTNOTES); - _stprintf(szItemText, _T("%s"), BurnDrvGetTextA(DRV_COMMENT) ? BurnDrvGetText(DRV_COMMENT) : _T("")); - if (BurnDrvGetFlags() & BDF_HISCORE_SUPPORTED) { - _stprintf(szItemText + _tcslen(szItemText), _T("%shigh scores supported"), _tcslen(szItemText) ? _T(", ") : _T("")); - } - SendMessage(hInfoControl, WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - - // Display the genre - szItemText[0] = _T('\0'); - hInfoControl = GetDlgItem(hGameInfoDlg, IDC_TEXTGENRE); - _stprintf(szItemText, _T("%s"), DecorateGenreInfo()); - SendMessage(hInfoControl, WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - - // Set up the rom info list - HWND hList = GetDlgItem(hGameInfoDlg, IDC_LIST1); - LV_COLUMN LvCol; - LV_ITEM LvItem; - - ListView_SetExtendedListViewStyle(hList, LVS_EX_FULLROWSELECT); - - memset(&LvCol, 0, sizeof(LvCol)); - LvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; - LvCol.cx = 200; - LvCol.pszText = _T("Name"); - SendMessage(hList, LVM_INSERTCOLUMN , 0, (LPARAM)&LvCol); - LvCol.cx = 100; - LvCol.pszText = _T("Size (bytes)"); - SendMessage(hList, LVM_INSERTCOLUMN , 1, (LPARAM)&LvCol); - LvCol.cx = 100; - LvCol.pszText = _T("CRC32"); - SendMessage(hList, LVM_INSERTCOLUMN , 2, (LPARAM)&LvCol); - LvCol.cx = 200; - LvCol.pszText = _T("Type"); - SendMessage(hList, LVM_INSERTCOLUMN , 3, (LPARAM)&LvCol); - LvCol.cx = 100; - LvCol.pszText = _T("Flags"); - SendMessage(hList, LVM_INSERTCOLUMN , 4, (LPARAM)&LvCol); - LvCol.cx = 100; - - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask= LVIF_TEXT; - LvItem.cchTextMax = 256; - int RomPos = 0; - for (int i = 0; i < 0x100; i++) { // assume max 0x100 roms per game - int nRet; - struct BurnRomInfo ri; - char nLen[10] = ""; - char nCrc[10] = ""; - char *szRomName = NULL; - char Type[100] = ""; - char FormatType[100] = ""; - - memset(&ri, 0, sizeof(ri)); - - nRet = BurnDrvGetRomInfo(&ri, i); - nRet += BurnDrvGetRomName(&szRomName, i, 0); - - if (ri.nLen == 0) continue; - if (ri.nType & BRF_BIOS) continue; - - LvItem.iItem = RomPos; - LvItem.iSubItem = 0; - LvItem.pszText = ANSIToTCHAR(szRomName, NULL, 0); - SendMessage(hList, LVM_INSERTITEM, 0, (LPARAM)&LvItem); - - sprintf(nLen, "%d", ri.nLen); - LvItem.iSubItem = 1; - LvItem.pszText = ANSIToTCHAR(nLen, NULL, 0); - SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); - - sprintf(nCrc, "%08X", ri.nCrc); - if (!(ri.nType & BRF_NODUMP)) { - LvItem.iSubItem = 2; - LvItem.pszText = ANSIToTCHAR(nCrc, NULL, 0); - SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); - } - - if (ri.nType & BRF_ESS) sprintf(Type, "%s, Essential", Type); - if (ri.nType & BRF_OPT) sprintf(Type, "%s, Optional", Type); - if (ri.nType & BRF_PRG) sprintf(Type, "%s, Program", Type); - if (ri.nType & BRF_GRA) sprintf(Type, "%s, Graphics", Type); - if (ri.nType & BRF_SND) sprintf(Type, "%s, Sound", Type); - if (ri.nType & BRF_BIOS) sprintf(Type, "%s, BIOS", Type); - - for (int j = 0; j < 98; j++) { - FormatType[j] = Type[j + 2]; - } - - LvItem.iSubItem = 3; - LvItem.pszText = ANSIToTCHAR(FormatType, NULL, 0); - SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); - - LvItem.iSubItem = 4; - LvItem.pszText = _T(""); - if (ri.nType & BRF_NODUMP) LvItem.pszText = _T("No Dump"); - SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); - - RomPos++; - } - - // Check for board roms - if (BurnDrvGetTextA(DRV_BOARDROM)) { - char szBoardName[12] = ""; - unsigned int nOldDrvSelect = nBurnDrvActive; - strcpy(szBoardName, BurnDrvGetTextA(DRV_BOARDROM)); - - for (unsigned int i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - if (!strcmp(szBoardName, BurnDrvGetTextA(DRV_NAME))) break; - } - - for (int j = 0; j < 0x100; j++) { - int nRetBoard; - struct BurnRomInfo riBoard; - char nLenBoard[10] = ""; - char nCrcBoard[10] = ""; - char *szBoardRomName = NULL; - char BoardType[100] = ""; - char BoardFormatType[100] = ""; - - memset(&riBoard, 0, sizeof(riBoard)); - - nRetBoard = BurnDrvGetRomInfo(&riBoard, j); - nRetBoard += BurnDrvGetRomName(&szBoardRomName, j, 0); - - if (riBoard.nLen == 0) continue; - - LvItem.iItem = RomPos; - LvItem.iSubItem = 0; - LvItem.pszText = ANSIToTCHAR(szBoardRomName, NULL, 0); - SendMessage(hList, LVM_INSERTITEM, 0, (LPARAM)&LvItem); - - sprintf(nLenBoard, "%d", riBoard.nLen); - LvItem.iSubItem = 1; - LvItem.pszText = ANSIToTCHAR(nLenBoard, NULL, 0); - SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); - - sprintf(nCrcBoard, "%08X", riBoard.nCrc); - if (!(riBoard.nType & BRF_NODUMP)) { - LvItem.iSubItem = 2; - LvItem.pszText = ANSIToTCHAR(nCrcBoard, NULL, 0); - SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); - } - - if (riBoard.nType & BRF_ESS) sprintf(BoardType, "%s, Essential", BoardType); - if (riBoard.nType & BRF_OPT) sprintf(BoardType, "%s, Optional", BoardType); - if (riBoard.nType & BRF_PRG) sprintf(BoardType, "%s, Program", BoardType); - if (riBoard.nType & BRF_GRA) sprintf(BoardType, "%s, Graphics", BoardType); - if (riBoard.nType & BRF_SND) sprintf(BoardType, "%s, Sound", BoardType); - if (riBoard.nType & BRF_BIOS) sprintf(BoardType, "%s, BIOS", BoardType); - - for (int k = 0; k < 98; k++) { - BoardFormatType[k] = BoardType[k + 2]; - } - - LvItem.iSubItem = 3; - LvItem.pszText = ANSIToTCHAR(BoardFormatType, NULL, 0); - SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); - - LvItem.iSubItem = 4; - LvItem.pszText = _T(""); - if (riBoard.nType & BRF_NODUMP) LvItem.pszText = _T("No Dump"); - SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); - - RomPos++; - } - - nBurnDrvActive = nOldDrvSelect; - } - - // Set up the sample info list - hList = GetDlgItem(hGameInfoDlg, IDC_LIST2); - - ListView_SetExtendedListViewStyle(hList, LVS_EX_FULLROWSELECT); - - memset(&LvCol, 0, sizeof(LvCol)); - LvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; - LvCol.cx = 200; - LvCol.pszText = _T("Name"); - SendMessage(hList, LVM_INSERTCOLUMN , 0, (LPARAM)&LvCol); - - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask= LVIF_TEXT; - LvItem.cchTextMax = 256; - int SamplePos = 0; - if (BurnDrvGetTextA(DRV_SAMPLENAME) != NULL) { - for (int i = 0; i < 0x100; i++) { // assume max 0x100 samples per game - int nRet; - struct BurnSampleInfo si; - char *szSampleName = NULL; - - memset(&si, 0, sizeof(si)); - - nRet = BurnDrvGetSampleInfo(&si, i); - nRet += BurnDrvGetSampleName(&szSampleName, i, 0); - - if (si.nFlags == 0) continue; - - LvItem.iItem = SamplePos; - LvItem.iSubItem = 0; - LvItem.pszText = ANSIToTCHAR(szSampleName, NULL, 0); - SendMessage(hList, LVM_INSERTITEM, 0, (LPARAM)&LvItem); - - SamplePos++; - } - } - - // Get the history info - CHAR szFileName[MAX_PATH] = ""; - sprintf(szFileName, "%shistory.dat", TCHARToANSI(szAppHistoryPath, NULL, 0)); - - FILE *fp = fopen(szFileName, "rt"); - char Temp[10000]; - int inGame = 0; - -#ifdef USE_SEGOE - TCHAR szBuffer[50000] = _T("{\\rtf1\\ansi{\\fonttbl(\\f0\\fnil\\fcharset0 Verdana;)}{\\colortbl;\\red220\\green0\\blue0;\\red0\\green0\\blue0;}"); -#else - TCHAR szBuffer[50000] = _T("{\\rtf1\\ansi{\\fonttbl(\\f0\\fnil\\fcharset0 Segoe UI;)}{\\colortbl;\\red220\\green0\\blue0;\\red0\\green0\\blue0;}"); -#endif - - if (fp) { - while (!feof(fp)) { - char *Tokens; - - fgets(Temp, 10000, fp); - if (!strncmp("$info=", Temp, 6)) { - Tokens = strtok(Temp, "=,"); - while (Tokens != NULL) { - if (!strcmp(Tokens, BurnDrvGetTextA(DRV_NAME))) { - inGame = 1; - break; - } - - Tokens = strtok(NULL, "=,"); - } - } - - if (inGame) { - int nTitleWrote = 0; - while (strncmp("$end", Temp, 4)) { - fgets(Temp, 10000, fp); - - if (!strncmp("$", Temp, 1)) continue; - - if (!nTitleWrote) { - _stprintf(szBuffer, _T("%s{\\b\\f0\\fs28\\cf1 %s}"), szBuffer, ANSIToTCHAR(Temp, NULL, 0)); - } else { - _stprintf(szBuffer, _T("%s\\line"), szBuffer); - if (!strncmp("- ", Temp, 2)) { - _stprintf(szBuffer, _T("%s{\\b\\f0\\fs16\\cf1 %s}"), szBuffer, ANSIToTCHAR(Temp, NULL, 0)); - } else { - _stprintf(szBuffer, _T("%s{\\f0\\fs16\\cf2 %s}"), szBuffer, ANSIToTCHAR(Temp, NULL, 0)); - } - } - - if (strcmp("\n", Temp)) nTitleWrote = 1; - } - break; - } - } - fclose(fp); - } - - _stprintf(szBuffer, _T("%s}"), szBuffer); - SendMessage(GetDlgItem(hGameInfoDlg, IDC_MESSAGE_EDIT_ENG), WM_SETTEXT, (WPARAM)0, (LPARAM)szBuffer); - - // Make a white brush - hWhiteBGBrush = CreateSolidBrush(RGB(0xFF,0xFF,0xFF)); - - return 0; -} - -#define MAXFAVORITES 2000 -char szFavorites[MAXFAVORITES][28]; -INT32 nFavorites = 0; - -void LoadFavorites() -{ - char szTemp[255]; - char szFileName[] = "config/favorites.dat"; - - nFavorites = 0; - memset(szFavorites, 0, sizeof(szFavorites)); - - FILE *fp = fopen(szFileName, "rb"); - - if (fp) { - while (!feof(fp)) { - memset(szTemp, 0, sizeof(szTemp)); - fgets(szTemp, 255, fp); - - // Get rid of the linefeed at the end - INT32 nLen = strlen(szTemp); - while (nLen > 0 && (szTemp[nLen - 1] == 0x0A || szTemp[nLen - 1] == 0x0D)) { - szTemp[nLen - 1] = 0; - nLen--; - } - - if (strlen(szTemp) < 25 && strlen(szTemp) > 2) { - strncpy(szFavorites[nFavorites++], szTemp, 25); - //bprintf(0, _T("Loaded: %S.\n"), szFavorites[nFavorites-1]); - } - } - fclose(fp); - } -} - -static void SaveFavorites() -{ - char szFileName[] = "config/favorites.dat"; - FILE *fp = fopen(szFileName, "wb"); - INT32 nSaved = 0; - - if (fp) { - for (INT32 i = 0; i < nFavorites; i++) { - if (strlen(szFavorites[i]) > 0) { - fprintf(fp, "%s\n", szFavorites[i]); - nSaved++; - } - } - //bprintf(0, _T("Saved %X favorites.\n"), nSaved); - fclose(fp); - } -} - -INT32 CheckFavorites(char *name) -{ - for (INT32 i = 0; i < nFavorites; i++) { - if (!strcmp(name, szFavorites[i])) { - return i; - } - } - return -1; -} - -static void AddFavorite(UINT8 addf) -{ - UINT32 nOldDrvSelect = nBurnDrvActive; - char szBoardName[28] = ""; - - LoadFavorites(); - - nBurnDrvActive = nGiDriverSelected; // get driver name under cursor - strcpy(szBoardName, BurnDrvGetTextA(DRV_NAME)); - nBurnDrvActive = nOldDrvSelect; - - INT32 inthere = CheckFavorites(szBoardName); - - if (addf && inthere == -1) { // add favorite - //bprintf(0, _T("[add %S]"), szBoardName); - strcpy(szFavorites[nFavorites++], szBoardName); - } - - if (addf == 0 && inthere != -1) { // remove favorite - //bprintf(0, _T("[remove %S]"), szBoardName); - szFavorites[inthere][0] = '\0'; - } - - SaveFavorites(); -} - -void AddFavorite_Ext(UINT8 addf) -{ // For use outside of the gameinfo window. - nGiDriverSelected = nBurnDrvActive; - AddFavorite(addf); -} - -static void MyEndDialog() -{ - SendDlgItemMessage(hGameInfoDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - SendDlgItemMessage(hGameInfoDlg, IDC_SCREENSHOT_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - - if (hGiBmp) { - DeleteObject((HGDIOBJ)hGiBmp); - hGiBmp = NULL; - } - if (hPreview) { - DeleteObject((HGDIOBJ)hPreview); - hPreview = NULL; - } - - hTabControl = NULL; - memset(szFullName, 0, 1024); - - EndDialog(hGameInfoDlg, 0); -} - -static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if (Msg == WM_INITDIALOG) { - hGameInfoDlg = hDlg; - - if (bDrvOkay) { - if (!kNetGame && bAutoPause) bRunPause = 1; - AudSoundStop(); - } - - GameInfoInit(); - - WndInMid(hDlg, hParent); - SetFocus(hDlg); // Enable Esc=close - - return TRUE; - } - - if (Msg == WM_CLOSE) { - MyEndDialog(); - DeleteObject(hWhiteBGBrush); - - EnableWindow(hScrnWnd, TRUE); - DestroyWindow(hGameInfoDlg); - - FreeLibrary(hRiched); - hRiched = NULL; - - if (bDrvOkay) { - if(!bAltPause && bRunPause) bRunPause = 0; - AudSoundPlay(); - } - - return 0; - } - - if (Msg == WM_COMMAND) { - int Id = LOWORD(wParam); - int Notify = HIWORD(wParam); - - if (Id == IDCANCEL && Notify == BN_CLICKED) { - SendMessage(hGameInfoDlg, WM_CLOSE, 0, 0); - return 0; - } - - if (Id == IDFAVORITESET && Notify == BN_CLICKED) { - INT32 nButtonState = SendDlgItemMessage(hGameInfoDlg, IDFAVORITESET, BM_GETSTATE, 0, 0); - - AddFavorite((nButtonState & BST_CHECKED) ? 1 : 0); - return 0; - } - - if (Id == IDRESCANSET && Notify == BN_CLICKED) { - nBurnDrvActive = nGiDriverSelected; - // use the nBurnDrvActive value from when the Rom Info button was clicked, because it can/will change - // even though the selection list [window below it] doesn't have focus. -dink - // for proof/symptoms - uncomment the line below and click the 'rescan' button after moving the window to different places on the screen. - //bprintf(0, _T("nBurnDrvActive %d nGiDriverSelected %d\n"), nBurnDrvActive, nGiDriverSelected); - - switch (BzipOpen(1)) { - case 0: { - gameAv[nGiDriverSelected] = 3; - break; - } - - case 2: { - gameAv[nGiDriverSelected] = 1; - break; - } - - case 1: { - gameAv[nGiDriverSelected] = 0; - BzipClose(); - BzipOpen(0); // this time, get the missing roms/error message. - { - HWND hScrnWndtmp = hScrnWnd; // Crash preventer: Make the gameinfo dialog (this one) the parent modal for the popup message - hScrnWnd = hGameInfoDlg; - FBAPopupDisplay(PUF_TYPE_ERROR); - hScrnWnd = hScrnWndtmp; - } - break; - } - } - - if (gameAv[nGiDriverSelected] > 0) { - int TabPage = TabCtrl_GetCurSel(hTabControl); - if (TabPage != 0) { - MessageBox(hGameInfoDlg, FBALoadStringEx(hAppInst, IDS_ERR_LOAD_OK, true), FBALoadStringEx(hAppInst, IDS_ERR_INFORMATION, true), MB_OK); - } - if (TabPage == 0) { - // if the romset is OK, just say so in the rom info dialog (instead of popping up a window) - HWND hList = GetDlgItem(hGameInfoDlg, IDC_LIST1); - LV_ITEM LvItem; - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask= LVIF_TEXT; - LvItem.cchTextMax = 256; - LvItem.iSubItem = 4; - LvItem.pszText = _T("Romset OK!"); - SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); - UpdateWindow(hGameInfoDlg); - } - } - BzipClose(); - WriteGameAvb(); - return 0; - } - } - - if (Msg == WM_NOTIFY) { - NMHDR* pNmHdr = (NMHDR*)lParam; - - if (pNmHdr->code == TCN_SELCHANGE) { - int TabPage = TabCtrl_GetCurSel(hTabControl); - - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_LIST1), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_LIST2), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_MESSAGE_EDIT_ENG), SW_HIDE); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_SCREENSHOT_H), SW_SHOW); - ShowWindow(GetDlgItem(hGameInfoDlg, IDC_SCREENSHOT_V), SW_SHOW); - UpdateWindow(hGameInfoDlg); - - nBurnDrvActive = nGiDriverSelected; - - if (TabPage == 0) DisplayRomInfo(); - if (TabPage == 1) DisplaySampleInfo(); - if (TabPage == 2) DisplayHistory(); - if (TabPage == 3) SetPreview(szAppPreviewsPath, IMG_ASPECT_4_3); - if (TabPage == 4) SetPreview(szAppTitlesPath, IMG_ASPECT_4_3); - if (TabPage == 5) SetPreview(szAppSelectPath, IMG_ASPECT_4_3); - if (TabPage == 6) SetPreview(szAppVersusPath, IMG_ASPECT_4_3); - if (TabPage == 7) SetPreview(szAppHowtoPath, IMG_ASPECT_4_3); - if (TabPage == 8) SetPreview(szAppScoresPath, IMG_ASPECT_4_3); - if (TabPage == 9) SetPreview(szAppBossesPath, IMG_ASPECT_4_3); - if (TabPage == 10) SetPreview(szAppGameoverPath, IMG_ASPECT_4_3); - if (TabPage == 11) SetPreview(szAppFlyersPath, IMG_ASPECT_PRESERVE); - if (TabPage == 12) SetPreview(szAppCabinetsPath, IMG_ASPECT_PRESERVE); - if (TabPage == 13) SetPreview(szAppMarqueesPath, IMG_ASPECT_PRESERVE); - if (TabPage == 14) SetPreview(szAppControlsPath, IMG_ASPECT_PRESERVE); - if (TabPage == 15) SetPreview(szAppPCBsPath, IMG_ASPECT_PRESERVE); - - return FALSE; - } - } - - if (Msg == WM_CTLCOLORSTATIC) { - if ((HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_LABELCOMMENT) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_LABELROMNAME) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_LABELROMINFO) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_LABELSYSTEM) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_LABELNOTES) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_LABELGENRE) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_TEXTCOMMENT) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_TEXTROMNAME) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_TEXTROMINFO) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_TEXTSYSTEM) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_TEXTNOTES) || (HWND)lParam == GetDlgItem(hGameInfoDlg, IDC_TEXTGENRE)) { - return (INT_PTR)hWhiteBGBrush; - } - } - - return 0; -} - -int GameInfoDialogCreate(HWND hParentWND, int nDrvSel) -{ - bGameInfoOpen = true; - nGiDriverSelected = nDrvSel; - -#if defined (_UNICODE) - hRiched = LoadLibrary(L"RICHED20.DLL"); -#else - hRiched = LoadLibrary("RICHED20.DLL"); -#endif - - if (hRiched) { - hParent = hParentWND; - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_GAMEINFO), hParent, (DLGPROC)DialogProc); - } - - bGameInfoOpen = false; - return 0; -} diff --git a/jan/src/burner/win32/image_win32.cpp b/jan/src/burner/win32/image_win32.cpp deleted file mode 100644 index 41aa31532..000000000 --- a/jan/src/burner/win32/image_win32.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "burner.h" -#include "png.h" - -HBITMAP ImageToBitmap(HWND hwnd, IMAGE* img) -{ - BITMAPINFO bi; - - if (hwnd == NULL || img == NULL) { - return NULL; - } - - bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bi.bmiHeader.biWidth = img->width; - bi.bmiHeader.biHeight = img->height; - bi.bmiHeader.biPlanes = 1; - bi.bmiHeader.biBitCount = 24; - bi.bmiHeader.biCompression = BI_RGB; - bi.bmiHeader.biSizeImage = img->imgbytes; - bi.bmiHeader.biXPelsPerMeter = 0; - bi.bmiHeader.biYPelsPerMeter = 0; - bi.bmiHeader.biClrUsed = 0; - bi.bmiHeader.biClrImportant = 0; - - HDC hDC = GetDC(hwnd); - BYTE* pbits = NULL; - HBITMAP hBitmap = CreateDIBSection(hDC, &bi, DIB_RGB_COLORS, (void**)&pbits, NULL, 0); - if (pbits) { - memcpy(pbits, img->bmpbits, img->imgbytes); - } - ReleaseDC(hwnd, hDC); - img_free(img); - - return hBitmap; -} - -HBITMAP PNGLoadBitmap(HWND hWnd, FILE* fp, int nWidth, int nHeight, int nPreset) -{ - IMAGE img = { nWidth, nHeight, 0, 0, NULL, NULL, 0}; - - if (PNGLoad(&img, fp, nPreset)) { - return NULL; - } - - return ImageToBitmap(hWnd, &img); -} - -HBITMAP LoadBitmap(HWND hWnd, FILE* fp, int nWidth, int nHeight, int nPreset) -{ - if (hWnd == NULL || fp == NULL) { - return NULL; - } - - if (PNGIsImage(fp)) return PNGLoadBitmap(hWnd, fp, nWidth, nHeight, nPreset); - - return NULL; -} diff --git a/jan/src/burner/win32/inpc.cpp b/jan/src/burner/win32/inpc.cpp deleted file mode 100644 index 1bd8734f1..000000000 --- a/jan/src/burner/win32/inpc.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// Burner Input Constant dialog module -#include "burner.h" - -HWND hInpcDlg = NULL; // Handle to the Input Dialog -unsigned int nInpcInput = 0; // The input number we are redefining - -static HWND hValue = NULL; // Handle to value edit control -static struct GameInp* pgi = NULL; // Current GameInp - -static int InpcInit() -{ - TCHAR szOldTitle[1024] = _T(""); - TCHAR szNewTitle[1024] = _T(""); - int nCurrent = 0; - - struct BurnInputInfo bii; // Info about the input - - hValue = GetDlgItem(hInpcDlg, IDC_INPC_VALUE); // Get Edit controls - - // Get the extra info about the input - memset(&bii, 0, sizeof(bii)); - BurnDrvGetInputInfo(&bii, nInpcInput); - if (bii.szName == NULL) { - bii.szName= ""; - } - - // Set the dialog title - GetWindowText(hInpcDlg, szOldTitle, 1024); - _sntprintf(szNewTitle, 1024, _T(APP_TITLE) _T(SEPERATOR_1) _T("%s %hs"), szOldTitle, bii.szName); - SetWindowText(hInpcDlg, szNewTitle); - - pgi = NULL; - if (nInpcInput >= nGameInpCount) { // input out of range - return 1; - } - pgi = GameInp + nInpcInput; - - // Get current constant - if (pgi->nInput == GIT_CONSTANT) { - nCurrent=pgi->Input.Constant.nConst; } - _stprintf(szNewTitle, _T("0x%.2X"), nCurrent); - SetWindowText(hValue, szNewTitle); - - return 0; -} - -static int InpcExit() -{ - pgi=NULL; - hValue=NULL; - hInpcDlg=NULL; - - return 0; -} - -static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM /*lParam*/) -{ - if (Msg == WM_INITDIALOG) { // 1 = we didn't set focus? - hInpcDlg = hDlg; - InpcInit(); - - return 1; - } - if (Msg == WM_CLOSE){ - DestroyWindow(hInpcDlg); - - return 0; - } - if (Msg == WM_DESTROY) { - InpcExit(); - - return 0; - } - - if (Msg == WM_COMMAND) { - int Id = LOWORD(wParam); - int Notify = HIWORD(wParam); - if (Id == IDOK && Notify == BN_CLICKED) { // OK = close - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - if (Id == IDCANCEL && Notify == BN_CLICKED) { // cancel = close - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - - if (Id == IDC_INPC_VALUE && Notify == EN_CHANGE) { - // Edit box may have been changed - TCHAR szNew[16] = _T(""); - int nVal = 0; - - if (pgi == NULL) { - return 0; - } - - GetWindowText(hValue, szNew, sizeof(szNew)); - - // Set new constant - pgi->nInput = GIT_CONSTANT; - nVal = _tcstol(szNew, NULL, 0); - pgi->Input.Constant.nConst = (unsigned char)nVal; - - InpdListMake(0); // refresh view - - return 0; - } - } - - return 0; -} - -int InpcCreate() -{ - DestroyWindow(hInpcDlg); - hInpcDlg = NULL; - - hInpcDlg = FBACreateDialog(hAppInst, MAKEINTRESOURCE(IDD_INPC), hInpdDlg, (DLGPROC)DialogProc); - if (hInpcDlg == NULL) { - return 1; - } - - WndInMid(hInpcDlg, hInpdDlg); - ShowWindow(hInpcDlg, SW_NORMAL); - - return 0; -} diff --git a/jan/src/burner/win32/inpcheat.cpp b/jan/src/burner/win32/inpcheat.cpp deleted file mode 100644 index a94da68a6..000000000 --- a/jan/src/burner/win32/inpcheat.cpp +++ /dev/null @@ -1,277 +0,0 @@ -#include "burner.h" - -HWND hInpCheatDlg = NULL; // Handle to the Cheat Dialog - -static HWND hInpCheatList = NULL; - -static bool bOK; - -static int nCurrentCheat; -static int* nPrevCheatSettings = NULL; - -static int InpCheatListBegin() -{ - LVCOLUMN LvCol; - if (hInpCheatList == NULL) { - return 1; - } - - // Full row select style: - SendMessage(hInpCheatList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); - // Make column headers - memset(&LvCol, 0, sizeof(LvCol)); - LvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; - LvCol.cx = 0xA4; - LvCol.pszText = FBALoadStringEx(hAppInst, IDS_CHEAT_NAME, true); - SendMessage(hInpCheatList, LVM_INSERTCOLUMN, 0, (LPARAM)&LvCol); - LvCol.cx = 0xA4; - LvCol.pszText = FBALoadStringEx(hAppInst, IDS_CHEAT_STATUS, true); - SendMessage(hInpCheatList, LVM_INSERTCOLUMN, 1, (LPARAM)&LvCol); - - return 0; -} - -// Make a list view of the DIPswitches -static int InpCheatListMake() -{ - if (hInpCheatList == NULL) { - return 1; - } - - SendMessage(hInpCheatList, LVM_DELETEALLITEMS, 0, 0); - - int i = 0; - CheatInfo* pCurrentCheat = pCheatInfo; - - while (pCurrentCheat) { - - LVITEM LvItem; - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask = LVIF_TEXT; - LvItem.iItem = i; - LvItem.iSubItem = 0; - LvItem.pszText = pCurrentCheat->szCheatName; - SendMessage(hInpCheatList, LVM_INSERTITEM, 0, (LPARAM)&LvItem); - LvItem.mask = LVIF_TEXT; - LvItem.iSubItem = 1; - LvItem.pszText = pCurrentCheat->pOption[pCurrentCheat->nCurrent]->szOptionName; - SendMessage(hInpCheatList, LVM_SETITEM, 0, (LPARAM)&LvItem); - - pCurrentCheat = pCurrentCheat->pNext; - i++; - } - - return 0; -} - -static int InpCheatInit() -{ - hInpCheatList = GetDlgItem(hInpCheatDlg, IDC_INPCHEAT_LIST); - InpCheatListBegin(); - InpCheatListMake(); - - // Save old cheat settings - CheatInfo* pCurrentCheat = pCheatInfo; - nCurrentCheat = 0; - while (pCurrentCheat) { - pCurrentCheat = pCurrentCheat->pNext; - nCurrentCheat++; - } - - nPrevCheatSettings = (int*)malloc(nCurrentCheat * sizeof(int)); - - pCurrentCheat = pCheatInfo; - nCurrentCheat = 0; - while (pCurrentCheat) { - nPrevCheatSettings[nCurrentCheat] = pCurrentCheat->nCurrent; - pCurrentCheat = pCurrentCheat->pNext; - nCurrentCheat++; - } - - return 0; -} - -static int InpCheatExit() -{ - if (nPrevCheatSettings) { - free(nPrevCheatSettings); - nPrevCheatSettings = NULL; - } - - hInpCheatList = NULL; - hInpCheatDlg = NULL; - if(!bAltPause && bRunPause) { - bRunPause = 0; - } - GameInpCheckMouse(); - return 0; -} - -static void InpCheatCancel() -{ - if (!bOK) { - CheatInfo* pCurrentCheat = pCheatInfo; - nCurrentCheat = 0; - while (pCurrentCheat) { - CheatEnable(nCurrentCheat, nPrevCheatSettings[nCurrentCheat]); - pCurrentCheat = pCurrentCheat->pNext; - nCurrentCheat++; - } - } -} - -static void InpCheatSelect() -{ - SendMessage(GetDlgItem(hInpCheatDlg, IDC_INPCX1_VALUE), CB_RESETCONTENT, 0, 0); - - int nSel = SendMessage(hInpCheatList, LVM_GETNEXTITEM, (WPARAM)-1, LVNI_SELECTED); - if (nSel >= 0) { - LVITEM LvItem; - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask = LVIF_PARAM; - LvItem.iItem = nSel; - SendMessage(hInpCheatList, LVM_GETITEM, 0, (LPARAM)&LvItem); - - CheatInfo* pCurrentCheat = pCheatInfo; - nCurrentCheat = 0; - while (pCurrentCheat && nCurrentCheat < nSel) { - pCurrentCheat = pCurrentCheat->pNext; - nCurrentCheat++; - } - - for (int i = 0; pCurrentCheat->pOption[i]; i++) { - TCHAR szText[256]; - _stprintf(szText, _T("%s: %s"), pCurrentCheat->szCheatName, pCurrentCheat->pOption[i]->szOptionName); - SendMessage(GetDlgItem(hInpCheatDlg, IDC_INPCX1_VALUE), CB_ADDSTRING, 0, (LPARAM)szText); - } - - SendMessage(GetDlgItem(hInpCheatDlg, IDC_INPCX1_VALUE), CB_SETCURSEL, (WPARAM)pCurrentCheat->nCurrent, 0); - } -} - -static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if (Msg == WM_INITDIALOG) { - -// EnableWindow(hScrnWnd, FALSE); - - hInpCheatDlg = hDlg; - InpCheatInit(); - if (!kNetGame && bAutoPause) { - bRunPause = 1; - } - - WndInMid(hDlg, hScrnWnd); - SetFocus(hDlg); // Enable Esc=close - - return TRUE; - } - - if (Msg == WM_CLOSE) { - EnableWindow(hScrnWnd, TRUE); - DestroyWindow(hInpCheatDlg); - return 0; - } - - if (Msg == WM_DESTROY) { - InpCheatCancel(); - InpCheatExit(); - return 0; - } - - if (Msg == WM_COMMAND) { - int Id = LOWORD(wParam); - int Notify = HIWORD(wParam); - - if (Id == IDOK && Notify == BN_CLICKED) { // OK button - bOK = true; - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - if (Id == IDCANCEL && Notify == BN_CLICKED) { // cancel = close - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - - if (Id == IDC_INPCX1_VALUE && Notify == CBN_SELCHANGE) { - - int nSel = SendMessage(GetDlgItem(hInpCheatDlg, IDC_INPCX1_VALUE), CB_GETCURSEL, 0, 0); - - CheatEnable(nCurrentCheat, nSel); - - InpCheatListMake(); - return 0; - } - - if (Id == IDC_INPC_RESET && Notify == BN_CLICKED) { - - CheatInfo* pCurrentCheat = pCheatInfo; - nCurrentCheat = 0; - while (pCurrentCheat) { - CheatEnable(nCurrentCheat, -1); - pCurrentCheat = pCurrentCheat->pNext; - nCurrentCheat++; - } - - InpCheatListMake(); // refresh view - SendMessage(GetDlgItem(hInpCheatDlg, IDC_INPCX1_VALUE), CB_RESETCONTENT, 0, 0); - return 0; - } - - } - - if (Msg == WM_NOTIFY && lParam) { - int Id = LOWORD(wParam); - NMHDR *pnm = (NMHDR*)lParam; - - if (Id == IDC_INPCHEAT_LIST && pnm->code == LVN_ITEMCHANGED) { - if (((NM_LISTVIEW*)lParam)->uNewState & LVIS_SELECTED) { - InpCheatSelect(); - } - return 0; - } - - if (Id == IDC_INPCHEAT_LIST && ((pnm->code == NM_DBLCLK) || (pnm->code == NM_RDBLCLK))) { - // Select the next item of the currently selected one. - int nSel_Dbl = SendMessage(GetDlgItem(hInpCheatDlg, IDC_INPCX1_VALUE), CB_GETCURSEL, 0, 0); - int nCount = SendMessage(GetDlgItem(hInpCheatDlg, IDC_INPCX1_VALUE), CB_GETCOUNT, 0, 0); - if ((nSel_Dbl != LB_ERR) && (nCount > 1)) { - if (pnm->code == NM_DBLCLK) { - if (++nSel_Dbl >= nCount) nSel_Dbl = 0; - } else { - if (--nSel_Dbl < 0) nSel_Dbl = nCount - 1; - } - SendMessage(GetDlgItem(hInpCheatDlg, IDC_INPCX1_VALUE), CB_SETCURSEL, nSel_Dbl, 0); - CheatEnable(nCurrentCheat, nSel_Dbl); - InpCheatListMake(); - } - return 0; - } - } - - return 0; -} - -int InpCheatCreate() -{ - if (bDrvOkay == 0) { // No game is loaded - return 1; - } - - bOK = false; - -// DestroyWindow(hInpCheatDlg); // Make sure exitted - -// hInpCheatDlg = FBACreateDialog(hAppInst, MAKEINTRESOURCE(IDD_INPCHEAT), hScrnWnd, DialogProc); -// if (hInpCheatDlg == NULL) { -// return 1; -// } - -// WndInMid(hInpCheatDlg, hScrnWnd); -// ShowWindow(hInpCheatDlg, SW_NORMAL); - - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_INPCHEAT), hScrnWnd, (DLGPROC)DialogProc); - - return 0; -} - diff --git a/jan/src/burner/win32/inpd.cpp b/jan/src/burner/win32/inpd.cpp deleted file mode 100644 index 63e3b2ddc..000000000 --- a/jan/src/burner/win32/inpd.cpp +++ /dev/null @@ -1,913 +0,0 @@ -// Burner Input Dialog module -#include "burner.h" - -HWND hInpdDlg = NULL; // Handle to the Input Dialog -static HWND hInpdList = NULL; -static unsigned char *LastVal = NULL; // Last input values/defined -static int bLastValDefined = 0; // - -static HWND hInpdGi = NULL, hInpdPci = NULL, hInpdAnalog = NULL; // Combo boxes - -// Update which input is using which PC input -static int InpdUseUpdate() -{ - unsigned int i, j = 0; - struct GameInp* pgi = NULL; - if (hInpdList == NULL) { - return 1; - } - - // Update the values of all the inputs - for (i = 0, pgi = GameInp; i < nGameInpCount; i++, pgi++) { - LVITEM LvItem; - TCHAR* pszVal = NULL; - - if (pgi->Input.pVal == NULL) { - continue; - } - - pszVal = InpToDesc(pgi); - - if (_tcscmp(pszVal, _T("code 0x00")) == 0) - pszVal = _T("Unassigned (locked)"); - - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask = LVIF_TEXT; - LvItem.iItem = j; - LvItem.iSubItem = 1; - LvItem.pszText = pszVal; - - SendMessage(hInpdList, LVM_SETITEM, 0, (LPARAM)&LvItem); - - j++; - } - - for (i = 0, pgi = GameInp + nGameInpCount; i < nMacroCount; i++, pgi++) { - LVITEM LvItem; - TCHAR* pszVal = NULL; - - if (pgi->nInput & GIT_GROUP_MACRO) { - pszVal = InpMacroToDesc(pgi); - - if (_tcscmp(pszVal, _T("code 0x00")) == 0) - pszVal = _T("Unassigned (locked)"); - - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask = LVIF_TEXT; - LvItem.iItem = j; - LvItem.iSubItem = 1; - LvItem.pszText = pszVal; - - SendMessage(hInpdList, LVM_SETITEM, 0, (LPARAM)&LvItem); - } - - j++; - } - - return 0; -} - -int InpdUpdate() -{ - unsigned int i, j = 0; - struct GameInp* pgi = NULL; - unsigned char* plv = NULL; - unsigned short nThisVal; - if (hInpdList == NULL) { - return 1; - } - if (LastVal == NULL) { - return 1; - } - - // Update the values of all the inputs - for (i = 0, pgi = GameInp, plv = LastVal; i < nGameInpCount; i++, pgi++, plv++) { - LVITEM LvItem; - TCHAR szVal[16]; - - if (pgi->nType == 0) { - continue; - } - - if (pgi->nType & BIT_GROUP_ANALOG) { - if (bRunPause) { // Update LastVal - nThisVal = pgi->Input.nVal; - } else { - nThisVal = *pgi->Input.pShortVal; - } - - if (bLastValDefined && (pgi->nType != BIT_ANALOG_REL || nThisVal) && pgi->Input.nVal == *((unsigned short*)plv)) { - j++; - continue; - } - - *((unsigned short*)plv) = nThisVal; - } else { - if (bRunPause) { // Update LastVal - nThisVal = pgi->Input.nVal; - } else { - nThisVal = *pgi->Input.pVal; - } - - if (bLastValDefined && pgi->Input.nVal == *plv) { // hasn't changed - j++; - continue; - } - - *plv = nThisVal; - } - - switch (pgi->nType) { - case BIT_DIGITAL: { - if (nThisVal == 0) { - szVal[0] = 0; - } else { - if (nThisVal == 1) { - _tcscpy(szVal, _T("ON")); - } else { - _stprintf(szVal, _T("0x%02X"), nThisVal); - } - } - break; - } - case BIT_ANALOG_ABS: { - _stprintf(szVal, _T("0x%02X"), nThisVal >> 8); - break; - } - case BIT_ANALOG_REL: { - if (nThisVal == 0) { - szVal[0] = 0; - } - if ((short)nThisVal < 0) { - _stprintf(szVal, _T("%d"), ((short)nThisVal) >> 8); - } - if ((short)nThisVal > 0) { - _stprintf(szVal, _T("+%d"), ((short)nThisVal) >> 8); - } - break; - } - default: { - _stprintf(szVal, _T("0x%02X"), nThisVal); - } - } - - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask = LVIF_TEXT; - LvItem.iItem = j; - LvItem.iSubItem = 2; - LvItem.pszText = szVal; - - SendMessage(hInpdList, LVM_SETITEM, 0, (LPARAM)&LvItem); - - j++; - } - - bLastValDefined = 1; // LastVal is now defined - - return 0; -} - -static int InpdListBegin() -{ - LVCOLUMN LvCol; - if (hInpdList == NULL) { - return 1; - } - - // Full row select style: - SendMessage(hInpdList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); - - // Make column headers - memset(&LvCol, 0, sizeof(LvCol)); - LvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; - - LvCol.cx = 0xa0; - LvCol.pszText = FBALoadStringEx(hAppInst, IDS_INPUT_INPUT, true); - SendMessage(hInpdList, LVM_INSERTCOLUMN, 0, (LPARAM)&LvCol); - - LvCol.cx = 0xa0; - LvCol.pszText = FBALoadStringEx(hAppInst, IDS_INPUT_MAPPING, true); - SendMessage(hInpdList, LVM_INSERTCOLUMN, 1, (LPARAM)&LvCol); - - LvCol.cx = 0x38; - LvCol.pszText = FBALoadStringEx(hAppInst, IDS_INPUT_STATE, true); - SendMessage(hInpdList, LVM_INSERTCOLUMN, 2, (LPARAM)&LvCol); - - return 0; -} - -// Make a list view of the game inputs -int InpdListMake(int bBuild) -{ - unsigned int j = 0; - - if (hInpdList == NULL) { - return 1; - } - - bLastValDefined = 0; - if (bBuild) { - SendMessage(hInpdList, LVM_DELETEALLITEMS, 0, 0); - } - - // Add all the input names to the list - for (unsigned int i = 0; i < nGameInpCount; i++) { - struct BurnInputInfo bii; - LVITEM LvItem; - - // Get the name of the input - bii.szName = NULL; - BurnDrvGetInputInfo(&bii, i); - - // skip unused inputs - if (bii.pVal == NULL) { - continue; - } - if (bii.szName == NULL) { - bii.szName = ""; - } - - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask = LVIF_TEXT | LVIF_PARAM; - LvItem.iItem = j; - LvItem.iSubItem = 0; - LvItem.pszText = ANSIToTCHAR(bii.szName, NULL, 0); - LvItem.lParam = (LPARAM)i; - - SendMessage(hInpdList, bBuild ? LVM_INSERTITEM : LVM_SETITEM, 0, (LPARAM)&LvItem); - - j++; - } - - struct GameInp* pgi = GameInp + nGameInpCount; - for (unsigned int i = 0; i < nMacroCount; i++, pgi++) { - LVITEM LvItem; - - if (pgi->nInput & GIT_GROUP_MACRO) { - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask = LVIF_TEXT | LVIF_PARAM; - LvItem.iItem = j; - LvItem.iSubItem = 0; - LvItem.pszText = ANSIToTCHAR(pgi->Macro.szName, NULL, 0); - LvItem.lParam = (LPARAM)j; - - SendMessage(hInpdList, bBuild ? LVM_INSERTITEM : LVM_SETITEM, 0, (LPARAM)&LvItem); - } - - j++; - } - - InpdUseUpdate(); - - return 0; -} - -static void DisablePresets() -{ - EnableWindow(hInpdPci, FALSE); - EnableWindow(hInpdAnalog, FALSE); - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_DEFAULT), FALSE); - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_USE), FALSE); -} - -static void InitComboboxes() -{ - TCHAR szLabel[1024]; - HANDLE search; - WIN32_FIND_DATA findData; - - for (int i = 0; i < 4; i++) { - _stprintf(szLabel, FBALoadStringEx(hAppInst, IDS_INPUT_INP_PLAYER, true), i + 1); - SendMessage(hInpdGi, CB_ADDSTRING, 0, (LPARAM)szLabel); - } - - SendMessage(hInpdPci, CB_ADDSTRING, 0, (LPARAM)FBALoadStringEx(hAppInst, IDS_INPUT_INP_KEYBOARD, true)); - for (int i = 0; i < 3; i++) { - _stprintf(szLabel, FBALoadStringEx(hAppInst, IDS_INPUT_INP_JOYSTICK, true), i); - SendMessage(hInpdPci, CB_ADDSTRING, 0, (LPARAM)szLabel); - } - SendMessage(hInpdPci, CB_ADDSTRING, 0, (LPARAM)FBALoadStringEx(hAppInst, IDS_INPUT_INP_XARCADEL, true)); - SendMessage(hInpdPci, CB_ADDSTRING, 0, (LPARAM)FBALoadStringEx(hAppInst, IDS_INPUT_INP_XARCADER, true)); - SendMessage(hInpdPci, CB_ADDSTRING, 0, (LPARAM)FBALoadStringEx(hAppInst, IDS_INPUT_INP_HOTRODL, true)); - SendMessage(hInpdPci, CB_ADDSTRING, 0, (LPARAM)FBALoadStringEx(hAppInst, IDS_INPUT_INP_HOTRODR, true)); - - // Scan presets directory for .ini files and add them to the list - if ((search = FindFirstFile(_T("config/presets/*.ini"), &findData)) != INVALID_HANDLE_VALUE) { - do { - findData.cFileName[_tcslen(findData.cFileName) - 4] = 0; - SendMessage(hInpdPci, CB_ADDSTRING, 0, (LPARAM)findData.cFileName); - } while (FindNextFile(search, &findData) != 0); - - FindClose(search); - } -} - -static int InpdInit() -{ - int nMemLen; - - hInpdList = GetDlgItem(hInpdDlg, IDC_INPD_LIST); - - // Allocate a last val array for the last input values - nMemLen = nGameInpCount * sizeof(char); - LastVal = (unsigned char*)malloc(nMemLen); - if (LastVal == NULL) { - return 1; - } - memset(LastVal, 0, nMemLen); - - InpdListBegin(); - InpdListMake(1); - - // Init the Combo boxes - hInpdGi = GetDlgItem(hInpdDlg, IDC_INPD_GI); - hInpdPci = GetDlgItem(hInpdDlg, IDC_INPD_PCI); - hInpdAnalog = GetDlgItem(hInpdDlg, IDC_INPD_ANALOG); - InitComboboxes(); - - DisablePresets(); - - return 0; -} - -static int InpdExit() -{ - // Exit the Combo boxes - hInpdPci = NULL; - hInpdGi = NULL; - hInpdAnalog = NULL; - - if (LastVal != NULL) { - free(LastVal); - LastVal = NULL; - } - hInpdList = NULL; - hInpdDlg = NULL; - if (!bAltPause && bRunPause) { - bRunPause=0; - } - GameInpCheckMouse(); - - return 0; -} - -static void GameInpConfigOne(int nPlayer, int nPcDev, int nAnalog, struct GameInp* pgi, char* szi) -{ - switch (nPcDev) { - case 0: - GamcPlayer(pgi, szi, nPlayer, -1); // Keyboard - GamcAnalogKey(pgi, szi, nPlayer, nAnalog); - GamcMisc(pgi, szi, nPlayer); - break; - case 1: - GamcPlayer(pgi, szi, nPlayer, 0); // Joystick 1 - GamcAnalogJoy(pgi, szi, nPlayer, 0, nAnalog); - GamcMisc(pgi, szi, nPlayer); - break; - case 2: - GamcPlayer(pgi, szi, nPlayer, 1); // Joystick 2 - GamcAnalogJoy(pgi, szi, nPlayer, 1, nAnalog); - GamcMisc(pgi, szi, nPlayer); - break; - case 3: - GamcPlayer(pgi, szi, nPlayer, 2); // Joystick 3 - GamcAnalogJoy(pgi, szi, nPlayer, 2, nAnalog); - GamcMisc(pgi, szi, nPlayer); - break; - case 4: - GamcPlayerHotRod(pgi, szi, nPlayer, 0x10, nAnalog); // X-Arcade left side - GamcMisc(pgi, szi, -1); - break; - case 5: - GamcPlayerHotRod(pgi, szi, nPlayer, 0x11, nAnalog); // X-Arcade right side - GamcMisc(pgi, szi, -1); - break; - case 6: - GamcPlayerHotRod(pgi, szi, nPlayer, 0x00, nAnalog); // HotRod left side - GamcMisc(pgi, szi, -1); - break; - case 7: - GamcPlayerHotRod(pgi, szi, nPlayer, 0x01, nAnalog); // HotRod right size - GamcMisc(pgi, szi, -1); - break; - } -} - -// Configure some of the game input -static int GameInpConfig(int nPlayer, int nPcDev, int nAnalog) -{ - struct GameInp* pgi = NULL; - unsigned int i; - - for (i = 0, pgi = GameInp; i < nGameInpCount; i++, pgi++) { - struct BurnInputInfo bii; - - // Get the extra info about the input - bii.szInfo = NULL; - BurnDrvGetInputInfo(&bii, i); - if (bii.pVal == NULL) { - continue; - } - if (bii.szInfo == NULL) { - bii.szInfo = ""; - } - GameInpConfigOne(nPlayer, nPcDev, nAnalog, pgi, bii.szInfo); - } - - for (i = 0; i < nMacroCount; i++, pgi++) { - GameInpConfigOne(nPlayer, nPcDev, nAnalog, pgi, pgi->Macro.szName); - } - - GameInpCheckLeftAlt(); - - return 0; -} - -// List item activated; find out which one -static int ListItemActivate() -{ - struct BurnInputInfo bii; - LVITEM LvItem; - - memset(&LvItem, 0, sizeof(LvItem)); - int nSel = SendMessage(hInpdList, LVM_GETNEXTITEM, (WPARAM)-1, LVNI_SELECTED); - if (nSel < 0) { - return 1; - } - - // Get the corresponding input - LvItem.mask = LVIF_PARAM; - LvItem.iItem = nSel; - LvItem.iSubItem = 0; - SendMessage(hInpdList, LVM_GETITEM, 0, (LPARAM)&LvItem); - nSel = LvItem.lParam; - - if (nSel >= (int)(nGameInpCount + nMacroCount)) { // out of range - return 1; - } - - memset(&bii, 0, sizeof(bii)); - bii.nType = 0; - int rc = BurnDrvGetInputInfo(&bii, nSel); - if (bii.pVal == NULL && rc != 1) { // rc == 1 for a macro or system macro. - return 1; - } - - DestroyWindow(hInpsDlg); // Make sure any existing dialogs are gone - DestroyWindow(hInpcDlg); // - - if (bii.nType & BIT_GROUP_CONSTANT) { - // Dip switch is a constant - change it - nInpcInput = nSel; - InpcCreate(); - } else { - if (GameInp[nSel].nInput == GIT_MACRO_CUSTOM) { -#if 0 - InpMacroCreate(nSel); -#endif - } else { - // Assign to a key - nInpsInput = nSel; - InpsCreate(); - } - } - - GameInpCheckLeftAlt(); - - return 0; -} - -#if 0 -static int NewMacroButton() -{ - LVITEM LvItem; - int nSel; - - DestroyWindow(hInpsDlg); // Make sure any existing dialogs are gone - DestroyWindow(hInpcDlg); // - - nSel = SendMessage(hInpdList, LVM_GETNEXTITEM, (WPARAM)-1, LVNI_SELECTED); - if (nSel < 0) { - nSel = -1; - } - - // Get the corresponding input - LvItem.mask = LVIF_PARAM; - LvItem.iItem = nSel; - LvItem.iSubItem = 0; - SendMessage(hInpdList, LVM_GETITEM, 0, (LPARAM)&LvItem); - nSel = LvItem.lParam; - - if (nSel >= (int)nGameInpCount && nSel < (int)(nGameInpCount + nMacroCount)) { - if (GameInp[nSel].nInput != GIT_MACRO_CUSTOM) { - nSel = -1; - } - } else { - nSel = -1; - } - - InpMacroCreate(nSel); - - return 0; -} -#endif - -static int DeleteInput(unsigned int i) -{ - struct BurnInputInfo bii; - - if (i >= nGameInpCount) { - - if (i < nGameInpCount + nMacroCount) { // Macro - GameInp[i].Macro.nMode = 0; - } else { // out of range - return 1; - } - } else { // "True" input - bii.nType = BIT_DIGITAL; - BurnDrvGetInputInfo(&bii, i); - if (bii.pVal == NULL) { - return 1; - } - if (bii.nType & BIT_GROUP_CONSTANT) { // Don't delete dip switches - return 1; - } - - GameInp[i].nInput = 0; - } - - GameInpCheckLeftAlt(); - - return 0; -} - -// List item(s) deleted; find out which one(s) -static int ListItemDelete() -{ - int nStart = -1; - LVITEM LvItem; - int nRet; - - while ((nRet = SendMessage(hInpdList, LVM_GETNEXTITEM, (WPARAM)nStart, LVNI_SELECTED)) != -1) { - nStart = nRet; - - // Get the corresponding input - LvItem.mask = LVIF_PARAM; - LvItem.iItem = nRet; - LvItem.iSubItem = 0; - SendMessage(hInpdList, LVM_GETITEM, 0, (LPARAM)&LvItem); - nRet = LvItem.lParam; - - DeleteInput(nRet); - } - - InpdListMake(0); // refresh view - return 0; -} - -static int InitAnalogOptions(int nGi, int nPci) -{ - // init analog options dialog - int nAnalog = -1; - if (nPci == (nPlayerDefaultControls[nGi] & 0x0F)) { - nAnalog = nPlayerDefaultControls[nGi] >> 4; - } - - SendMessage(hInpdAnalog, CB_RESETCONTENT, 0, 0); - if (nPci >= 1 && nPci <= 3) { - // Absolute mode only for joysticks - SendMessage(hInpdAnalog, CB_ADDSTRING, 0, (LPARAM)(LPARAM)FBALoadStringEx(hAppInst, IDS_INPUT_ANALOG_ABS, true)); - } else { - if (nAnalog > 0) { - nAnalog--; - } - } - SendMessage(hInpdAnalog, CB_ADDSTRING, 0, (LPARAM)(LPARAM)FBALoadStringEx(hAppInst, IDS_INPUT_ANALOG_AUTO, true)); - SendMessage(hInpdAnalog, CB_ADDSTRING, 0, (LPARAM)(LPARAM)FBALoadStringEx(hAppInst, IDS_INPUT_ANALOG_NORMAL, true)); - - SendMessage(hInpdAnalog, CB_SETCURSEL, (WPARAM)nAnalog, 0); - - return 0; -} - -static void SaveHardwarePreset() -{ - TCHAR *szDefaultCpsFile = _T("config\\presets\\cps.ini"); - TCHAR *szDefaultNeogeoFile = _T("config\\presets\\neogeo.ini"); - TCHAR *szDefaultPgmFile = _T("config\\presets\\pgm.ini"); - TCHAR *szFileName = _T("config\\presets\\preset.ini"); - TCHAR *szHardwareString = _T("Generic hardware"); - - int nHardwareFlag = (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK); - - if (nHardwareFlag == HARDWARE_CAPCOM_CPS1 || nHardwareFlag == HARDWARE_CAPCOM_CPS1_QSOUND || nHardwareFlag == HARDWARE_CAPCOM_CPS1_GENERIC || nHardwareFlag == HARDWARE_CAPCOM_CPSCHANGER || nHardwareFlag == HARDWARE_CAPCOM_CPS2 || nHardwareFlag == HARDWARE_CAPCOM_CPS3) { - szFileName = szDefaultCpsFile; - szHardwareString = _T("CPS-1/CPS-2/CPS-3 hardware"); - } - - if (nHardwareFlag == HARDWARE_SNK_NEOGEO) { - szFileName = szDefaultNeogeoFile; - szHardwareString = _T("Neo-Geo hardware"); - } - - if (nHardwareFlag == HARDWARE_IGS_PGM) { - szFileName = szDefaultPgmFile; - szHardwareString = _T("PGM hardware"); - } - - FILE *fp = _tfopen(szFileName, _T("wt")); - if (fp) { - _ftprintf(fp, _T(APP_TITLE) _T(" - Hardware Default Preset\n\n")); - _ftprintf(fp, _T("%s\n\n"), szHardwareString); - _ftprintf(fp, _T("version 0x%06X\n\n"), nBurnVer); - GameInpWrite(fp); - fclose(fp); - } - - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_PRESET_SAVED), szFileName); - FBAPopupDisplay(PUF_TYPE_INFO); -} - -int UsePreset(bool bMakeDefault) -{ - int nGi, nPci, nAnalog = 0; - TCHAR szFilename[MAX_PATH] = _T("config\\presets\\"); - - nGi = SendMessage(hInpdGi, CB_GETCURSEL, 0, 0); - if (nGi == CB_ERR) { - return 1; - } - nPci = SendMessage(hInpdPci, CB_GETCURSEL, 0, 0); - if (nPci == CB_ERR) { - return 1; - } - if (nPci <= 7) { - // Determine analog option - nAnalog = SendMessage(hInpdAnalog, CB_GETCURSEL, 0, 0); - if (nAnalog == CB_ERR) { - return 1; - } - - if (nPci == 0 || nPci > 3) { // No "Absolute" option for keyboard or X-Arcade/HotRod controls - nAnalog++; - } - - GameInpConfig(nGi, nPci, nAnalog); // Re-configure inputs - } else { - // Find out the filename of the preset ini - SendMessage(hInpdPci, CB_GETLBTEXT, nPci, (LPARAM)(szFilename + _tcslen(szFilename))); - _tcscat(szFilename, _T(".ini")); - - GameInputAutoIni(nGi, szFilename, true); // Read inputs from file - - // Make sure all inputs are defined - for (unsigned int i = 0, j = 0; i < nGameInpCount; i++) { - if (GameInp[i].Input.pVal == NULL) { - continue; - } - - if (GameInp[i].nInput == 0) { - DeleteInput(j); - } - - j++; - } - - nPci = 0x0F; - } - - SendMessage(hInpdAnalog, CB_SETCURSEL, (WPARAM)-1, 0); - SendMessage(hInpdPci, CB_SETCURSEL, (WPARAM)-1, 0); - SendMessage(hInpdGi, CB_SETCURSEL, (WPARAM)-1, 0); - - DisablePresets(); - - if (bMakeDefault) { - nPlayerDefaultControls[nGi] = nPci | (nAnalog << 4); - _tcscpy(szPlayerDefaultIni[nGi], szFilename); - } - - GameInpCheckLeftAlt(); - - return 0; -} - -static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if (Msg == WM_INITDIALOG) { - hInpdDlg = hDlg; - InpdInit(); - if (!kNetGame && bAutoPause) { - bRunPause = 1; - } - - return TRUE; - } - - if (Msg == WM_CLOSE) { - EnableWindow(hScrnWnd, TRUE); - DestroyWindow(hInpdDlg); - return 0; - } - - if (Msg == WM_DESTROY) { - InpdExit(); - return 0; - } - - if (Msg == WM_COMMAND) { - int Id = LOWORD(wParam); - int Notify = HIWORD(wParam); - - if (Id == IDOK && Notify == BN_CLICKED) { - ListItemActivate(); - return 0; - } - if (Id == IDCANCEL && Notify == BN_CLICKED) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - - if (Id == IDC_INPD_NEWMACRO && Notify == BN_CLICKED) { - -// NewMacroButton(); - - return 0; - } - - if (Id == IDC_INPD_SAVE_AS_PRESET && Notify == BN_CLICKED) { - SaveHardwarePreset(); - return 0; - } - - if (Id == IDC_INPD_USE && Notify == BN_CLICKED) { - - UsePreset(false); - - InpdListMake(0); // refresh view - - return 0; - } - - if (Id == IDC_INPD_DEFAULT && Notify == BN_CLICKED) { - - UsePreset(true); - - InpdListMake(0); // refresh view - - return 0; - } - - if (Id == IDC_INPD_GI && Notify == CBN_SELCHANGE) { - int nGi; - nGi = SendMessage(hInpdGi, CB_GETCURSEL, 0, 0); - if (nGi == CB_ERR) { - SendMessage(hInpdPci, CB_SETCURSEL, (WPARAM)-1, 0); - SendMessage(hInpdAnalog, CB_SETCURSEL, (WPARAM)-1, 0); - - DisablePresets(); - - return 0; - } - int nPci = nPlayerDefaultControls[nGi] & 0x0F; - SendMessage(hInpdPci, CB_SETCURSEL, nPci, 0); - EnableWindow(hInpdPci, TRUE); - - if (nPci > 5) { - SendMessage(hInpdAnalog, CB_SETCURSEL, (WPARAM)-1, 0); - EnableWindow(hInpdAnalog, FALSE); - } else { - InitAnalogOptions(nGi, nPci); - EnableWindow(hInpdAnalog, TRUE); - } - - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_DEFAULT), TRUE); - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_USE), TRUE); - - return 0; - } - - if (Id == IDC_INPD_PCI && Notify == CBN_SELCHANGE) { - int nGi, nPci; - nGi = SendMessage(hInpdGi, CB_GETCURSEL, 0, 0); - if (nGi == CB_ERR) { - return 0; - } - nPci = SendMessage(hInpdPci, CB_GETCURSEL, 0, 0); - if (nPci == CB_ERR) { - return 0; - } - - if (nPci > 7) { - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_DEFAULT), TRUE); - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_USE), TRUE); - - SendMessage(hInpdAnalog, CB_SETCURSEL, (WPARAM)-1, 0); - EnableWindow(hInpdAnalog, FALSE); - } else { - EnableWindow(hInpdAnalog, TRUE); - InitAnalogOptions(nGi, nPci); - - if (SendMessage(hInpdAnalog, CB_GETCURSEL, 0, 0) != CB_ERR) { - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_DEFAULT), TRUE); - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_USE), TRUE); - } else { - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_DEFAULT), FALSE); - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_USE), FALSE); - } - } - - return 0; - } - - if (Id == IDC_INPD_ANALOG && Notify == CBN_SELCHANGE) { - if (SendMessage(hInpdAnalog, CB_GETCURSEL, 0, 0) != CB_ERR) { - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_DEFAULT), TRUE); - EnableWindow(GetDlgItem(hInpdDlg, IDC_INPD_USE), TRUE); - } - - return 0; - } - - } - - if (Msg == WM_NOTIFY && lParam != 0) { - int Id = LOWORD(wParam); - NMHDR* pnm = (NMHDR*)lParam; - - if (Id == IDC_INPD_LIST && pnm->code == LVN_ITEMACTIVATE) { - ListItemActivate(); - } - if (Id == IDC_INPD_LIST && pnm->code == LVN_KEYDOWN) { - NMLVKEYDOWN *pnmkd = (NMLVKEYDOWN*)lParam; - if (pnmkd->wVKey == VK_DELETE) { - ListItemDelete(); - } - } - - if (Id == IDC_INPD_LIST && pnm->code == NM_CUSTOMDRAW) { - NMLVCUSTOMDRAW* plvcd = (NMLVCUSTOMDRAW*)lParam; - - switch (plvcd->nmcd.dwDrawStage) { - case CDDS_PREPAINT: - SetWindowLongPtr(hInpdDlg, DWLP_MSGRESULT, CDRF_NOTIFYITEMDRAW); - return 1; - case CDDS_ITEMPREPAINT: - if (plvcd->nmcd.dwItemSpec < nGameInpCount) { - if (GameInp[plvcd->nmcd.dwItemSpec].nType & BIT_GROUP_CONSTANT) { - - if (GameInp[plvcd->nmcd.dwItemSpec].nInput == 0) { - plvcd->clrTextBk = RGB(0xDF, 0xDF, 0xDF); - - SetWindowLongPtr(hInpdDlg, DWLP_MSGRESULT, CDRF_NEWFONT); - return 1; - } - - if (GameInp[plvcd->nmcd.dwItemSpec].nType == BIT_DIPSWITCH) { - plvcd->clrTextBk = RGB(0xFF, 0xEF, 0xD7); - - SetWindowLongPtr(hInpdDlg, DWLP_MSGRESULT, CDRF_NEWFONT); - return 1; - } - } - } - - if (plvcd->nmcd.dwItemSpec >= nGameInpCount) { - if (GameInp[plvcd->nmcd.dwItemSpec].Macro.nMode) { - plvcd->clrTextBk = RGB(0xFF, 0xCF, 0xCF); - } else { - plvcd->clrTextBk = RGB(0xFF, 0xEF, 0xEF); - } - - SetWindowLongPtr(hInpdDlg, DWLP_MSGRESULT, CDRF_NEWFONT); - return 1; - } - return 1; - } - } - return 0; - } - - return 0; -} - -int InpdCreate() -{ - if (bDrvOkay == 0) { - return 1; - } - - DestroyWindow(hInpdDlg); // Make sure exitted - - hInpdDlg = FBACreateDialog(hAppInst, MAKEINTRESOURCE(IDD_INPD), hScrnWnd, (DLGPROC)DialogProc); - if (hInpdDlg == NULL) { - return 1; - } - - WndInMid(hInpdDlg, hScrnWnd); - ShowWindow(hInpdDlg, SW_NORMAL); - - return 0; -} - - diff --git a/jan/src/burner/win32/inpdipsw.cpp b/jan/src/burner/win32/inpdipsw.cpp deleted file mode 100644 index bf53b1868..000000000 --- a/jan/src/burner/win32/inpdipsw.cpp +++ /dev/null @@ -1,360 +0,0 @@ -// Burner DipSwitches Dialog module -#include "burner.h" - -HWND hInpDIPSWDlg = NULL; // Handle to the DIPSW Dialog -static HWND hInpDIPSWList = NULL; - -static unsigned char nPrevDIPSettings[8]; - -static unsigned int nDIPGroup; -static int nDIPOffset; - -static bool bOK; - -static void InpDIPSWGetOffset() -{ - BurnDIPInfo bdi; - - nDIPOffset = 0; - for (int i = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++) { - if (bdi.nFlags == 0xF0) { - nDIPOffset = bdi.nInput; - break; - } - } -} - -void InpDIPSWResetDIPs() -{ - int i = 0; - BurnDIPInfo bdi; - struct GameInp* pgi; - - InpDIPSWGetOffset(); - - while (BurnDrvGetDIPInfo(&bdi, i) == 0) { - if (bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + nDIPOffset; - pgi->Input.Constant.nConst = (pgi->Input.Constant.nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); - } - i++; - } -} - -static int InpDIPSWListBegin() -{ - LVCOLUMN LvCol; - if (hInpDIPSWList == NULL) { - return 1; - } - - // Full row select style: - SendMessage(hInpDIPSWList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); - // Make column headers - memset(&LvCol, 0, sizeof(LvCol)); - LvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; - LvCol.cx = 158; - LvCol.pszText = FBALoadStringEx(hAppInst, IDS_DIP_GROUP, true); - SendMessage(hInpDIPSWList, LVM_INSERTCOLUMN, 0, (LPARAM)&LvCol); - LvCol.cx = 215; - LvCol.pszText = FBALoadStringEx(hAppInst, IDS_DIP_SETTING, true); - SendMessage(hInpDIPSWList, LVM_INSERTCOLUMN, 1, (LPARAM)&LvCol); - - return 0; -} - -static bool CheckSetting(int i) -{ - BurnDIPInfo bdi; - BurnDrvGetDIPInfo(&bdi, i); - struct GameInp* pgi = GameInp + bdi.nInput + nDIPOffset; - - if ((pgi->Input.Constant.nConst & bdi.nMask) == bdi.nSetting) { - unsigned char nFlags = bdi.nFlags; - if ((nFlags & 0x0F) <= 1) { - return true; - } else { - for (int j = 1; j < (nFlags & 0x0F); j++) { - BurnDrvGetDIPInfo(&bdi, i + j); - pgi = GameInp + bdi.nInput + nDIPOffset; - if (nFlags & 0x80) { - if ((pgi->Input.Constant.nConst & bdi.nMask) == bdi.nSetting) { - return false; - } - } else { - if ((pgi->Input.Constant.nConst & bdi.nMask) != bdi.nSetting) { - return false; - } - } - } - return true; - } - } - return false; -} - -// Make a list view of the DIPswitches -static int InpDIPSWListMake() -{ - if (hInpDIPSWList == NULL) { - return 1; - } - SendMessage(hInpDIPSWList, LVM_DELETEALLITEMS, 0, 0); - - BurnDIPInfo bdi; - unsigned int i = 0, j = 0, k = 0; - char* pDIPGroup = NULL; - while (BurnDrvGetDIPInfo(&bdi, i) == 0) { - if ((bdi.nFlags & 0xF0) == 0xF0) { - if (bdi.nFlags == 0xFE || bdi.nFlags == 0xFD) { - pDIPGroup = bdi.szText; - k = i; - } - i++; - } else { - if (CheckSetting(i)) { - LVITEM LvItem; - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask = LVIF_TEXT | LVIF_PARAM; - LvItem.iItem = j; - LvItem.iSubItem = 0; - LvItem.pszText = ANSIToTCHAR(pDIPGroup, NULL, 0); - LvItem.lParam = (LPARAM)k; - SendMessage(hInpDIPSWList, LVM_INSERTITEM, 0, (LPARAM)&LvItem); - LvItem.mask = LVIF_TEXT; - LvItem.iSubItem = 1; - LvItem.pszText = ANSIToTCHAR(bdi.szText, NULL, 0); - SendMessage(hInpDIPSWList, LVM_SETITEM, 0, (LPARAM)&LvItem); - j++; - } - i += (bdi.nFlags & 0x0F); - } - } - - return 0; -} - -static int InpDIPSWInit() -{ - BurnDIPInfo bdi; - struct GameInp *pgi; - - InpDIPSWGetOffset(); - - hInpDIPSWList = GetDlgItem(hInpDIPSWDlg, IDC_INPCHEAT_LIST); - InpDIPSWListBegin(); - InpDIPSWListMake(); - - for (int i = 0, j = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++) { - if (bdi.nInput >= 0 && bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + nDIPOffset; - nPrevDIPSettings[j] = pgi->Input.Constant.nConst; - j++; - } - } - - return 0; -} - -static int InpDIPSWExit() -{ - hInpDIPSWList = NULL; - hInpDIPSWDlg = NULL; - if(!bAltPause && bRunPause) { - bRunPause = 0; - } - GameInpCheckMouse(); - return 0; -} - -static void InpDIPSWCancel() -{ - if (!bOK) { - int i = 0, j = 0; - BurnDIPInfo bdi; - struct GameInp *pgi; - while (BurnDrvGetDIPInfo(&bdi, i) == 0) { - if (bdi.nInput >= 0 && bdi.nFlags == 0xFF) { - pgi = GameInp + bdi.nInput + nDIPOffset; - pgi->Input.Constant.nConst = nPrevDIPSettings[j]; - j++; - } - i++; - } - } -} - -// Create the list of possible values for a DIPswitch -static void InpDIPSWSelect() -{ - SendMessage(GetDlgItem(hInpDIPSWDlg, IDC_INPCX1_VALUE), CB_RESETCONTENT, 0, 0); - - int nSel = SendMessage(hInpDIPSWList, LVM_GETNEXTITEM, (WPARAM)-1, LVNI_SELECTED); - if (nSel >= 0) { - LVITEM LvItem; - memset(&LvItem, 0, sizeof(LvItem)); - LvItem.mask = LVIF_PARAM; - LvItem.iItem = nSel; - SendMessage(hInpDIPSWList, LVM_GETITEM, 0, (LPARAM)&LvItem); - - nDIPGroup = LvItem.lParam; - - BurnDIPInfo bdiGroup; - BurnDrvGetDIPInfo(&bdiGroup, nDIPGroup); - - int nCurrentSetting = 0; - for (int i = 0, j = 0; i < bdiGroup.nSetting; i++) { - TCHAR szText[256]; - BurnDIPInfo bdi; - - do { - BurnDrvGetDIPInfo(&bdi, nDIPGroup + 1 + j++); - } while (bdi.nFlags == 0); - - if (bdiGroup.szText) { - _stprintf(szText, _T("%hs: %hs"), bdiGroup.szText, bdi.szText); - } else { - _stprintf(szText, _T("%hs"), bdi.szText); - } - SendMessage(GetDlgItem(hInpDIPSWDlg, IDC_INPCX1_VALUE), CB_ADDSTRING, 0, (LPARAM)szText); - - if (CheckSetting(nDIPGroup + j)) { - nCurrentSetting = i; - } - } - SendMessage(GetDlgItem(hInpDIPSWDlg, IDC_INPCX1_VALUE), CB_SETCURSEL, (WPARAM)nCurrentSetting, 0); - } -} - -static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if (Msg == WM_INITDIALOG) { - -// EnableWindow(hScrnWnd, FALSE); - - hInpDIPSWDlg = hDlg; - InpDIPSWInit(); - if (!kNetGame && bAutoPause) { - bRunPause = 1; - } - - WndInMid(hDlg, hScrnWnd); - SetFocus(hDlg); // Enable Esc=close - - return TRUE; - } - - if (Msg == WM_CLOSE) { - EnableWindow(hScrnWnd, TRUE); - DestroyWindow(hInpDIPSWDlg); - return 0; - } - - if (Msg == WM_DESTROY) { - InpDIPSWCancel(); - InpDIPSWExit(); - return 0; - } - - if (Msg == WM_COMMAND) { - int Id = LOWORD(wParam); - int Notify = HIWORD(wParam); - - if (Id == IDOK && Notify == BN_CLICKED) { // OK button - bOK = true; - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - if (Id == IDCANCEL && Notify == BN_CLICKED) { // cancel = close - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - - // New DIPswitch value selected - if (Id == IDC_INPCX1_VALUE && Notify == CBN_SELCHANGE) { - BurnDIPInfo bdi = {0, 0, 0, 0, NULL}; - struct GameInp *pgi; - int nSel = SendMessage(GetDlgItem(hInpDIPSWDlg, IDC_INPCX1_VALUE), CB_GETCURSEL, 0, 0); - int j = 0; - for (int i = 0; i <= nSel; i++) { - do { - BurnDrvGetDIPInfo(&bdi, nDIPGroup + 1 + j++); - } while (bdi.nFlags == 0); - } - pgi = GameInp + bdi.nInput + nDIPOffset; - pgi->Input.Constant.nConst = (pgi->Input.Constant.nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); - if (bdi.nFlags & 0x40) { - while (BurnDrvGetDIPInfo(&bdi, nDIPGroup + 1 + j++) == 0) { - if (bdi.nFlags == 0) { - pgi = GameInp + bdi.nInput + nDIPOffset; - pgi->Input.Constant.nConst = (pgi->Input.Constant.nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); - } else { - break; - } - } - } - - InpDIPSWListMake(); - return 0; - } - - // New DIPswitch selected - if (Id == IDC_INPC_RESET && Notify == BN_CLICKED) { - - InpDIPSWResetDIPs(); - - InpDIPSWListMake(); // refresh view - SendMessage(GetDlgItem(hInpDIPSWDlg, IDC_INPCX1_VALUE), CB_RESETCONTENT, 0, 0); - return 0; - } - - } - - if (Msg == WM_NOTIFY && lParam) { - int Id = LOWORD(wParam); - NMHDR* pnm = (NMHDR*)lParam; - - if (Id == IDC_INPCHEAT_LIST && pnm->code == LVN_ITEMCHANGED) { - if (((NM_LISTVIEW*)lParam)->uNewState & LVIS_SELECTED) { - InpDIPSWSelect(); - } - return 0; - } - - if (Id == IDC_INPCHEAT_LIST && pnm->code == NM_CUSTOMDRAW) { - NMLVCUSTOMDRAW* plvcd = (NMLVCUSTOMDRAW*)lParam; - - switch (plvcd->nmcd.dwDrawStage) { - case CDDS_PREPAINT: { - SetWindowLongPtr(hInpDIPSWDlg, DWLP_MSGRESULT, CDRF_NOTIFYITEMDRAW); - return 1; - } - case CDDS_ITEMPREPAINT: { - BurnDIPInfo bdi; - BurnDrvGetDIPInfo(&bdi, plvcd->nmcd.lItemlParam); - if (bdi.nFlags == 0xFD) { - plvcd->clrTextBk = RGB(0xFF, 0xDF, 0xBB); - SetWindowLongPtr(hInpDIPSWDlg, DWLP_MSGRESULT, CDRF_NEWFONT); - } - - return 1; - } - } - } - } - - return 0; -} - -int InpDIPSWCreate() -{ - if (bDrvOkay == 0) { // No game is loaded - return 1; - } - - bOK = false; - - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_INPDIP), hScrnWnd, (DLGPROC)DialogProc); - - return 0; -} diff --git a/jan/src/burner/win32/inps.cpp b/jan/src/burner/win32/inps.cpp deleted file mode 100644 index 19cf56543..000000000 --- a/jan/src/burner/win32/inps.cpp +++ /dev/null @@ -1,362 +0,0 @@ -// Burner Input Set dialog module -#include "burner.h" - -HWND hInpsDlg = NULL; // Handle to the Input Set Dialog -static HBRUSH hWhiteBGBrush; - -unsigned int nInpsInput = 0; // The input number we are redefining -static struct BurnInputInfo bii; // Info about the input -static int nDlgState = 0; -static int nInputCode = -1; // If in state 3, code N was nInputCode -static int nCounter = 0; // Counter of frames since the dialog was made -static struct GameInp* pgi = NULL; // Current GameInp -static struct GameInp OldInp; // Old GameInp -static int bOldPush = 0; // 1 if the push button was pressed last time - -static bool bGrabMouse = false; -static bool bClearLock = false; // ClearLock checkbox - -static bool bOldLeftAltkeyMapped; - -static int InpsInit() -{ - TCHAR szTitle[128]; - memset(&OldInp, 0, sizeof(OldInp)); - - pgi = NULL; - if (nInpsInput >= nGameInpCount + nMacroCount) { // input out of range - return 1; - } - pgi = GameInp + nInpsInput; - - memset(&bii,0,sizeof(bii)); - BurnDrvGetInputInfo(&bii, nInpsInput); - - if (bii.nType & BIT_GROUP_CONSTANT) { // This dialog doesn't handle constants - return 1; - } - - OldInp = *pgi; - bOldPush = 0; - - bGrabMouse = false; - bClearLock = false; - - bOldLeftAltkeyMapped = bLeftAltkeyMapped; - bLeftAltkeyMapped = true; - - // Set the dialog title - if (nInpsInput >= nGameInpCount) { - // Macro - _stprintf(szTitle, FBALoadStringEx(hAppInst, IDS_INPSET_MOVENAME, true), pgi->Macro.szName); - } else { - // Normal input - if (bii.szName == NULL || bii.szName[0] == _T('\0')) { - _stprintf(szTitle, FBALoadStringEx(hAppInst, IDS_INPSET_MOVE, true)); - } else { - _stprintf(szTitle, FBALoadStringEx(hAppInst, IDS_INPSET_MOVENAME, true), bii.szName); - } - } - SetWindowText(hInpsDlg, szTitle); - - InputFind(2); - - nDlgState = 4; - nInputCode = -1; - nCounter = 0; - - return 0; -} - -static int InpsExit() -{ - bOldPush = 0; - if (pgi != NULL) { - *pgi=OldInp; - } - memset(&OldInp, 0, sizeof(OldInp)); - - bLeftAltkeyMapped = bOldLeftAltkeyMapped; - - nDlgState = 0; - - return 0; -} - -static int SetInput(int nCode) -{ - if ((pgi->nInput & GIT_GROUP_MACRO) == 0) { - - if (bii.nType & BIT_GROUP_CONSTANT) { // Don't change dip switches! - DestroyWindow(hInpsDlg); - return 0; - } - - if ((bii.nType & BIT_GROUP_ANALOG) && (nCode & 0xFF) < 0x10) { // Analog controls - if (strcmp(bii.szInfo + 4, "-axis-neg") == 0 || strcmp(bii.szInfo + 4, "-axis-pos") == 0) { - if ((nCode & 0xF000) == 0x4000) { - if (nCode & 1) { - pgi->nInput = GIT_JOYAXIS_POS; - } else { - pgi->nInput = GIT_JOYAXIS_NEG; - } - pgi->Input.JoyAxis.nJoy = (nCode & 0x0F00) >> 8; - pgi->Input.JoyAxis.nAxis = (nCode & 0x0F) >> 1; - } - } else { // Map entire axis - if ((nCode & 0xF000) == 0x4000) { - pgi->nInput = GIT_JOYAXIS_FULL; - pgi->Input.JoyAxis.nJoy = (nCode & 0x0F00) >> 8; - pgi->Input.JoyAxis.nAxis = (nCode & 0x0F) >> 1; - } else { - pgi->nInput = GIT_MOUSEAXIS; - pgi->Input.MouseAxis.nMouse = (nCode & 0x0F00) >> 8; - pgi->Input.MouseAxis.nAxis = (nCode & 0x0F) >> 1; - } - } - - if (nCode == 0) { // Clear Input button pressed (for Analogue/Mouse) - pgi->nInput = 0; - pgi->Input.JoyAxis.nJoy = 0; - pgi->Input.JoyAxis.nAxis = 0; - pgi->Input.MouseAxis.nMouse = 0; - pgi->Input.MouseAxis.nAxis = 0; - - if (bClearLock) { // If ClearLock is checked, morph the analogue/mouse input to a switch (switch w/nCode of 0 == ClearLock) - pgi->nInput = GIT_SWITCH; - pgi->Input.Switch.nCode = (unsigned short)nCode; - } - } - - } else { - pgi->nInput = GIT_SWITCH; - if (nCode == 0 && !bClearLock) pgi->nInput = 0; // Clear Input button pressed (for buttons) - pgi->Input.Switch.nCode = (unsigned short)nCode; - } - } else { - pgi->Macro.nMode = 0x01; // Mark macro as in use - if (nCode == 0 && !bClearLock) pgi->Macro.nMode = 0; // Clear Input button pressed (for Macros) - pgi->Macro.Switch.nCode = (unsigned short)nCode; // Assign switch - } - - OldInp = *pgi; - - InpdListMake(0); // Update list with new input type - - return 0; -} - -static int InpsPushUpdate() -{ - int nPushState = 0; - - if (pgi == NULL || nInpsInput >= nGameInpCount) { - return 0; - } - - // See if the push button is pressed - nPushState = SendDlgItemMessage(hInpsDlg, IDC_INPS_PUSH, BM_GETSTATE, 0, 0); - if (nPushState & BST_PUSHED) { - nPushState = 1; - } else { - nPushState = 0; - } - - if (nPushState) { - switch (OldInp.nType) { - case BIT_DIGITAL: // Set digital inputs to 1 - pgi->nInput = GIT_CONSTANT; - pgi->Input.Constant.nConst = 1; - break; - case BIT_DIPSWITCH: // Set dipswitch block to 0xFF - pgi->nInput = GIT_CONSTANT; - pgi->Input.Constant.nConst = 0xFF; - break; - } - } else { - // Change back - *pgi = OldInp; - } - if (nPushState != bOldPush) { // refresh view - InpdListMake(0); - } - - bOldPush = nPushState; - - return nPushState; -} - -static void InpsUpdateControl(int nCode) -{ - TCHAR szString[MAX_PATH] = _T(""); - TCHAR szDevice[MAX_PATH] = _T(""); - TCHAR szControl[MAX_PATH] = _T(""); - - _stprintf(szString, _T("%s"), InputCodeDesc(nCode)); - SetWindowText(GetDlgItem(hInpsDlg, IDC_INPS_CONTROL), szString); - - InputGetControlName(nCode, szDevice, szControl); - _sntprintf(szString, MAX_PATH, _T("%s %s"), szDevice, szControl); - SetWindowText(GetDlgItem(hInpsDlg, IDC_INPS_CONTROL_NAME), szString); -} - -int InpsUpdate() -{ - TCHAR szTemp[MAX_PATH] = _T(""); - int nButtonState; - int nFind = -1; - - if (hInpsDlg == NULL) { // Don't do anything if the dialog isn't created - return 1; - } - if (nCounter < 0x100000) { // advance frames since dialog was created - nCounter++; - } - - if (InpsPushUpdate()) { - return 0; - } - - nButtonState = SendDlgItemMessage(hInpsDlg, IDC_INPS_CLEARLOCK, BM_GETSTATE, 0, 0); // Lock Input = If checked: clear an input, and don't let a default value or default preset re-fill it in. - bClearLock = (nButtonState & BST_CHECKED); - - nButtonState = SendDlgItemMessage(hInpsDlg, IDC_INPS_GRABMOUSE, BM_GETSTATE, 0, 0); - if (bGrabMouse) { - if ((nButtonState & BST_CHECKED) == 0) { - bGrabMouse = false; - nDlgState = 2; - return 0; - } - } else { - if (nButtonState & BST_CHECKED) { - bGrabMouse = true; - nDlgState = 4; - return 0; - } - } - // This doesn't work properly - if (nButtonState & BST_PUSHED) { - return 0; - } - - nButtonState = SendDlgItemMessage(hInpsDlg, IDCANCEL, BM_GETSTATE, 0, 0); - if (nButtonState & BST_PUSHED) { - return 0; - } - - nFind = InputFind(nDlgState); - - if (nDlgState & 4) { // 4 = Waiting for all controls to be released - - if (bGrabMouse ? nFind >= 0 : (nFind >= 0 && nFind < 0x8000)) { - - if (nCounter >= 60) { - - // Alert the user that a control is stuck - - _stprintf(szTemp, FBALoadStringEx(hAppInst, IDS_INPSET_WAITING, true), InputCodeDesc(nFind)); - SetWindowText(GetDlgItem(hInpsDlg, IDC_INPS_CONTROL), szTemp); - - nCounter = 0; - } - return 0; - } - - // All keys released - SetWindowText(GetDlgItem(hInpsDlg, IDC_INPS_CONTROL), _T("")); - SetWindowText(GetDlgItem(hInpsDlg, IDC_INPS_CONTROL_NAME), _T("")); - nDlgState = 8; - } - - if (nDlgState & 8) { // 8 = Waiting for a control to be activated - - if (bGrabMouse ? nFind < 0 : (nFind < 0 || nFind >= 0x8000)) { - return 0; - } - - // Key pressed - - nInputCode = nFind; - InpsUpdateControl(nInputCode); - - nDlgState = 16; - } - - if (nDlgState & 16) { // 16 = waiting for control to be released - - if (bGrabMouse ? nFind >= 0 : (nFind >= 0 && nFind < 0x8000)) { - if (nInputCode != nFind) { - nInputCode = nFind; - InpsUpdateControl(nInputCode); - } - return 0; - } - - // Key released - SetInput(nInputCode); - - nDlgState = 0; - DestroyWindow(hInpsDlg); // Quit dialog - } - - return 0; -} - -static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if (Msg == WM_INITDIALOG) { - hInpsDlg = hDlg; - hWhiteBGBrush = CreateSolidBrush(RGB(0xFF,0xFF,0xFF)); - if (InpsInit()) { - DestroyWindow(hInpsDlg); - return FALSE; - } - SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDC_INPS_CONTROL), TRUE); - return FALSE; - } - if (Msg == WM_CLOSE) { - DestroyWindow(hInpsDlg); - return 0; - } - if (Msg == WM_DESTROY) { - DeleteObject(hWhiteBGBrush); - InpsExit(); - hInpsDlg = NULL; - return 0; - } - if (Msg == WM_COMMAND) { - int Id = LOWORD(wParam); - int Notify = HIWORD(wParam); - if (Id == IDCANCEL && Notify == BN_CLICKED) { // Cancel button pressed - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - if (Id == IDCANCEL+1 && Notify == BN_CLICKED) { // Clear Input button pressed - SetInput(0); - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - } - if (Msg == WM_CTLCOLORSTATIC) { - if ((HWND)lParam == GetDlgItem(hDlg, IDC_INPS_CONTROL)) { - return (INT_PTR)hWhiteBGBrush; - } - } - return 0; -} - -int InpsCreate() -{ - DestroyWindow(hInpsDlg); // Make sure exitted - hInpsDlg = NULL; - - hInpsDlg = FBACreateDialog(hAppInst, MAKEINTRESOURCE(IDD_INPS), hInpdDlg, (DLGPROC)DialogProc); - if (hInpsDlg == NULL) { - return 1; - } - - WndInMid(hInpsDlg, hInpdDlg); - ShowWindow(hInpsDlg, SW_NORMAL); - - return 0; -} diff --git a/jan/src/burner/win32/ips_manager.cpp b/jan/src/burner/win32/ips_manager.cpp deleted file mode 100644 index fdf2853c6..000000000 --- a/jan/src/burner/win32/ips_manager.cpp +++ /dev/null @@ -1,830 +0,0 @@ -#include "burner.h" - -#define NUM_LANGUAGES 12 -#define MAX_NODES 1024 -#define MAX_ACTIVE_PATCHES 1024 - -static HWND hIpsDlg = NULL; -static HWND hParent = NULL; -static HWND hIpsList = NULL; - -int nIpsSelectedLanguage = 0; -static TCHAR szFullName[1024]; -static TCHAR szLanguages[NUM_LANGUAGES][32]; -static TCHAR szLanguageCodes[NUM_LANGUAGES][6]; - -static HTREEITEM hItemHandles[MAX_NODES]; - -static int nPatchIndex = 0; -static int nNumPatches = 0; -static HTREEITEM hPatchHandlesIndex[MAX_NODES]; -static TCHAR szPatchFileNames[MAX_NODES][MAX_PATH]; - -static HBRUSH hWhiteBGBrush; -static HBITMAP hBmp = NULL; -static HBITMAP hPreview = NULL; - -static TCHAR szDriverName[32]; - -TCHAR szIpsActivePatches[MAX_ACTIVE_PATCHES][MAX_PATH]; - -// GCC doesn't seem to define these correctly..... -#define _TreeView_SetItemState(hwndTV, hti, data, _mask) \ -{ TVITEM _ms_TVi;\ - _ms_TVi.mask = TVIF_STATE; \ - _ms_TVi.hItem = hti; \ - _ms_TVi.stateMask = _mask;\ - _ms_TVi.state = data;\ - SNDMSG((hwndTV), TVM_SETITEM, 0, (LPARAM)(TV_ITEM *)&_ms_TVi);\ -} - -#define _TreeView_SetCheckState(hwndTV, hti, fCheck) \ - _TreeView_SetItemState(hwndTV, hti, INDEXTOSTATEIMAGEMASK((fCheck)?2:1), TVIS_STATEIMAGEMASK) - -#define _TreeView_GetCheckState(hwndTV, hti) \ - ((((UINT)(SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), TVIS_STATEIMAGEMASK))) >> 12) -1) - -static TCHAR* GameIpsConfigName() -{ - // Return the path of the config file for this game - static TCHAR szName[64]; - _stprintf(szName, _T("config\\ips\\%s.ini"), szDriverName); - return szName; -} - -int GetIpsNumPatches() -{ - WIN32_FIND_DATA wfd; - HANDLE hSearch; - TCHAR szFilePath[MAX_PATH]; - int Count = 0; - - _stprintf(szFilePath, _T("%s%s\\"), szAppIpsPath, BurnDrvGetText(DRV_NAME)); - _tcscat(szFilePath, _T("*.dat")); - - hSearch = FindFirstFile(szFilePath, &wfd); - - if (hSearch != INVALID_HANDLE_VALUE) { - int Done = 0; - - while (!Done ) { - Count++; - Done = !FindNextFile(hSearch, &wfd); - } - - FindClose(hSearch); - } - - return Count; -} - -static TCHAR* GetPatchDescByLangcode(FILE* fp, int nLang) -{ - TCHAR* result = NULL; - char* desc = NULL; - char langtag[10]; - - sprintf(langtag, "[%s]", TCHARToANSI(szLanguageCodes[nLang], NULL, 0)); - - fseek(fp, 0, SEEK_SET); - - while (!feof(fp)) - { - char s[4096]; - - if (fgets(s, sizeof(s), fp) != NULL) - { - if (strncmp(langtag, s, strlen(langtag)) != 0) - continue; - - while (fgets(s, sizeof(s), fp) != NULL) - { - char* p; - - if (*s == '[') - { - if (desc) - { - result = tstring_from_utf8(desc); - if (desc) { - free(desc); - desc = NULL; - } - return result; - } - else - return NULL; - } - - for (p = s; *p; p++) - { - if (*p == '\r' || *p == '\n') - { - *p = '\0'; - break; - } - } - - if (desc) - { - char* p1; - int len = strlen(desc); - - len += strlen(s) + 2; - p1 = (char*)malloc(len + 1); - sprintf(p1, "%s\r\n%s", desc, s); - if (desc) { - free(desc); - } - desc = p1; - } - else - { - desc = (char*)malloc(strlen(s) + 1); - if (desc != NULL) - strcpy(desc, s); - } - } - } - } - - if (desc) - { - result = tstring_from_utf8(desc); - if (desc) { - free(desc); - desc = NULL; - } - return result; - } - else - return NULL; -} - -static void FillListBox() -{ - WIN32_FIND_DATA wfd; - HANDLE hSearch; - TCHAR szFilePath[MAX_PATH]; - TCHAR szFilePathSearch[MAX_PATH]; - TCHAR szFileName[MAX_PATH]; - TCHAR *PatchDesc = NULL; - TCHAR PatchName[256]; - int nHandlePos = 0; - - TV_INSERTSTRUCT TvItem; - - memset(&TvItem, 0, sizeof(TvItem)); - TvItem.item.mask = TVIF_TEXT | TVIF_PARAM; - TvItem.hInsertAfter = TVI_LAST; - - _stprintf(szFilePath, _T("%s%s\\"), szAppIpsPath, szDriverName); - _stprintf(szFilePathSearch, _T("%s*.dat"), szFilePath); - - hSearch = FindFirstFile(szFilePathSearch, &wfd); - - if (hSearch != INVALID_HANDLE_VALUE) { - int Done = 0; - - while (!Done ) { - memset(szFileName, '\0', MAX_PATH); - _stprintf(szFileName, _T("%s%s"), szFilePath, wfd.cFileName); - - FILE *fp = _tfopen(szFileName, _T("r")); - if (fp) { - PatchDesc = NULL; - memset(PatchName, '\0', 256); - - PatchDesc = GetPatchDescByLangcode(fp, nIpsSelectedLanguage); - // If not available - try English first - if (PatchDesc == NULL) PatchDesc = GetPatchDescByLangcode(fp, 0); - // Simplified Chinese is the reference language (should always be available!!) - if (PatchDesc == NULL) PatchDesc = GetPatchDescByLangcode(fp, 1); - - bprintf(0, _T("PatchDesc [%s]\n"), PatchDesc); - - for (unsigned int i = 0; i < _tcslen(PatchDesc); i++) { - if (PatchDesc[i] == '\r' || PatchDesc[i] == '\n') break; - PatchName[i] = PatchDesc[i]; - } - - // Check for categories - TCHAR *Tokens; - int nNumTokens = 0; - int nNumNodes = 0; - TCHAR szCategory[256]; - unsigned int nPatchNameLength = _tcslen(PatchName); - - Tokens = _tcstok(PatchName, _T("/")); - while (Tokens != NULL) { - if (nNumTokens == 0) { - int bAddItem = 1; - // Check if item already exists - nNumNodes = SendMessage(hIpsList, TVM_GETCOUNT, (WPARAM)0, (LPARAM)0); - for (int i = 0; i < nNumNodes; i++) { - TCHAR Temp[256]; - TVITEM Tvi; - memset(&Tvi, 0, sizeof(Tvi)); - Tvi.hItem = hItemHandles[i]; - Tvi.mask = TVIF_TEXT | TVIF_HANDLE; - Tvi.pszText = Temp; - Tvi.cchTextMax = 256; - SendMessage(hIpsList, TVM_GETITEM, (WPARAM)0, (LPARAM)&Tvi); - - if (!_tcsicmp(Tvi.pszText, Tokens)) bAddItem = 0; - } - - if (bAddItem) { - TvItem.hParent = TVI_ROOT; - TvItem.item.pszText = Tokens; - hItemHandles[nHandlePos] = (HTREEITEM)SendMessage(hIpsList, TVM_INSERTITEM, 0, (LPARAM)&TvItem); - nHandlePos++; - } - - if (_tcslen(Tokens) == nPatchNameLength) { - hPatchHandlesIndex[nPatchIndex] = hItemHandles[nHandlePos - 1]; - _tcscpy(szPatchFileNames[nPatchIndex], szFileName); - - nPatchIndex++; - } - - _tcscpy(szCategory, Tokens); - } else { - HTREEITEM hNode = TVI_ROOT; - // See which category we should be in - nNumNodes = SendMessage(hIpsList, TVM_GETCOUNT, (WPARAM)0, (LPARAM)0); - for (int i = 0; i < nNumNodes; i++) { - TCHAR Temp[256]; - TVITEM Tvi; - memset(&Tvi, 0, sizeof(Tvi)); - Tvi.hItem = hItemHandles[i]; - Tvi.mask = TVIF_TEXT | TVIF_HANDLE; - Tvi.pszText = Temp; - Tvi.cchTextMax = 256; - SendMessage(hIpsList, TVM_GETITEM, (WPARAM)0, (LPARAM)&Tvi); - - if (!_tcsicmp(Tvi.pszText, szCategory)) hNode = Tvi.hItem; - } - - TvItem.hParent = hNode; - TvItem.item.pszText = Tokens; - hItemHandles[nHandlePos] = (HTREEITEM)SendMessage(hIpsList, TVM_INSERTITEM, 0, (LPARAM)&TvItem); - - hPatchHandlesIndex[nPatchIndex] = hItemHandles[nHandlePos]; - _tcscpy(szPatchFileNames[nPatchIndex], szFileName); - - nHandlePos++; - nPatchIndex++; - } - - Tokens = _tcstok(NULL, _T("/")); - nNumTokens++; - } - - fclose(fp); - } - - Done = !FindNextFile(hSearch, &wfd); - } - - FindClose(hSearch); - } - - nNumPatches = nPatchIndex; - - // Expand all branches - int nNumNodes = SendMessage(hIpsList, TVM_GETCOUNT, (WPARAM)0, (LPARAM)0);; - for (int i = 0; i < nNumNodes; i++) { - SendMessage(hIpsList, TVM_EXPAND, TVE_EXPAND, (LPARAM)hItemHandles[i]); - } -} - -int GetIpsNumActivePatches() -{ - int nActivePatches = 0; - - for (int i = 0; i < MAX_ACTIVE_PATCHES; i++) { - if (_tcsicmp(szIpsActivePatches[i], _T(""))) nActivePatches++; - } - - return nActivePatches; -} - -void LoadIpsActivePatches() -{ - for (int i = 0; i < MAX_ACTIVE_PATCHES; i++) { - _stprintf(szIpsActivePatches[i], _T("")); - } - - FILE* fp = _tfopen(GameIpsConfigName(), _T("rt")); - TCHAR szLine[MAX_PATH]; - int nActivePatches = 0; - - if (fp) { - while (_fgetts(szLine, sizeof(szLine), fp)) { - int nLen = _tcslen(szLine); - - // Get rid of the linefeed at the end - if (szLine[nLen - 1] == 10) { - szLine[nLen - 1] = 0; - nLen--; - } - - if (!_tcsnicmp(szLine, _T("//"), 2)) continue; - if (!_tcsicmp(szLine, _T(""))) continue; - - _stprintf(szIpsActivePatches[nActivePatches], _T("%s%s\\%s"), szAppIpsPath, szDriverName, szLine); - nActivePatches++; - } - - fclose(fp); - } -} - -static void CheckActivePatches() -{ - LoadIpsActivePatches(); - - int nActivePatches = GetIpsNumActivePatches(); - - for (int i = 0; i < nActivePatches; i++) { - for (int j = 0; j < nNumPatches; j++) { - if (!_tcsicmp(szIpsActivePatches[i], szPatchFileNames[j])) { - _TreeView_SetCheckState(hIpsList, hPatchHandlesIndex[j], TRUE); - } - } - } -} - -static int IpsManagerInit() -{ - // Get the games full name - TCHAR szText[1024] = _T(""); - TCHAR* pszPosition = szText; - TCHAR* pszName = BurnDrvGetText(DRV_FULLNAME); - - pszPosition += _sntprintf(szText, 1024, pszName); - - pszName = BurnDrvGetText(DRV_FULLNAME); - while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) { - if (pszPosition + _tcslen(pszName) - 1024 > szText) { - break; - } - pszPosition += _stprintf(pszPosition, _T(SEPERATOR_2) _T("%s"), pszName); - } - - _tcscpy(szFullName, szText); - - _stprintf(szText, _T("%s") _T(SEPERATOR_1) _T("%s"), FBALoadStringEx(hAppInst, IDS_IPSMANAGER_TITLE, true), szFullName); - - // Set the window caption - SetWindowText(hIpsDlg, szText); - - // Fill the combo box - _stprintf(szLanguages[0], FBALoadStringEx(hAppInst, IDS_LANG_ENGLISH_US, true)); - _stprintf(szLanguages[1], FBALoadStringEx(hAppInst, IDS_LANG_SIMP_CHINESE, true)); - _stprintf(szLanguages[2], FBALoadStringEx(hAppInst, IDS_LANG_TRAD_CHINESE, true)); - _stprintf(szLanguages[3], FBALoadStringEx(hAppInst, IDS_LANG_JAPANESE, true)); - _stprintf(szLanguages[4], FBALoadStringEx(hAppInst, IDS_LANG_KOREAN, true)); - _stprintf(szLanguages[5], FBALoadStringEx(hAppInst, IDS_LANG_FRENCH, true)); - _stprintf(szLanguages[6], FBALoadStringEx(hAppInst, IDS_LANG_SPANISH, true)); - _stprintf(szLanguages[7], FBALoadStringEx(hAppInst, IDS_LANG_ITALIAN, true)); - _stprintf(szLanguages[8], FBALoadStringEx(hAppInst, IDS_LANG_GERMAN, true)); - _stprintf(szLanguages[9], FBALoadStringEx(hAppInst, IDS_LANG_PORTUGUESE, true)); - _stprintf(szLanguages[10], FBALoadStringEx(hAppInst, IDS_LANG_POLISH, true)); - _stprintf(szLanguages[11], FBALoadStringEx(hAppInst, IDS_LANG_HUNGARIAN, true)); - - _stprintf(szLanguageCodes[0], _T("en_US")); - _stprintf(szLanguageCodes[1], _T("zh_CN")); - _stprintf(szLanguageCodes[2], _T("zh_TW")); - _stprintf(szLanguageCodes[3], _T("ja_JP")); - _stprintf(szLanguageCodes[4], _T("ko_KR")); - _stprintf(szLanguageCodes[5], _T("fr_FR")); - _stprintf(szLanguageCodes[6], _T("es_ES")); - _stprintf(szLanguageCodes[7], _T("it_IT")); - _stprintf(szLanguageCodes[8], _T("de_DE")); - _stprintf(szLanguageCodes[9], _T("pt_BR")); - _stprintf(szLanguageCodes[10], _T("pl_PL")); - _stprintf(szLanguageCodes[11], _T("hu_HU")); - - for (int i = 0; i < NUM_LANGUAGES; i++) { - SendDlgItemMessage(hIpsDlg, IDC_CHOOSE_LIST, CB_ADDSTRING, 0, (LPARAM)&szLanguages[i]); - } - - SendDlgItemMessage(hIpsDlg, IDC_CHOOSE_LIST, CB_SETCURSEL, (WPARAM)nIpsSelectedLanguage, (LPARAM)0); - - hIpsList = GetDlgItem(hIpsDlg, IDC_TREE1); - - _tcscpy(szDriverName, BurnDrvGetText(DRV_NAME)); - - FillListBox(); - - CheckActivePatches(); - - return 0; -} - -static void RefreshPatch() -{ - SendMessage(GetDlgItem(hIpsDlg, IDC_TEXTCOMMENT), WM_SETTEXT, (WPARAM)0, (LPARAM)NULL); - SendDlgItemMessage(hIpsDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hPreview); - - HTREEITEM hSelectHandle = (HTREEITEM)SendMessage(hIpsList, TVM_GETNEXTITEM, TVGN_CARET, ~0U); - - if (hBmp) { - DeleteObject((HGDIOBJ)hBmp); - hBmp = NULL; - } - - for (int i = 0; i < nNumPatches; i++) { - if (hSelectHandle == hPatchHandlesIndex[i]) { - TCHAR *PatchDesc = NULL; - - FILE *fp = _tfopen(szPatchFileNames[i], _T("r")); - if (fp) { - PatchDesc = GetPatchDescByLangcode(fp, nIpsSelectedLanguage); - // If not available - try English first - if (PatchDesc == NULL) PatchDesc = GetPatchDescByLangcode(fp, 0); - // Simplified Chinese is the reference language (should always be available!!) - if (PatchDesc == NULL) PatchDesc = GetPatchDescByLangcode(fp, 1); - - SendMessage(GetDlgItem(hIpsDlg, IDC_TEXTCOMMENT), WM_SETTEXT, (WPARAM)0, (LPARAM)PatchDesc); - - fclose(fp); - } - fp = NULL; - - TCHAR szImageFileName[MAX_PATH]; - szImageFileName[0] = _T('\0'); - - _tcscpy(szImageFileName, szPatchFileNames[i]); - szImageFileName[_tcslen(szImageFileName) - 3] = _T('p'); - szImageFileName[_tcslen(szImageFileName) - 2] = _T('n'); - szImageFileName[_tcslen(szImageFileName) - 1] = _T('g'); - - fp = _tfopen(szImageFileName, _T("rb")); - HBITMAP hNewImage = NULL; - if (fp) { - hNewImage = PNGLoadBitmap(hIpsDlg, fp, 304, 228, 3); - fclose(fp); - } - - if (hNewImage) { - DeleteObject((HGDIOBJ)hBmp); - hBmp = hNewImage; - SendDlgItemMessage(hIpsDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBmp); - } else { - SendDlgItemMessage(hIpsDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hPreview); - } - } - } -} - -static void SavePatches() -{ - int nActivePatches = 0; - - for (int i = 0; i < MAX_ACTIVE_PATCHES; i++) { - _stprintf(szIpsActivePatches[i], _T("")); - } - - for (int i = 0; i < nNumPatches; i++) { - int nChecked = _TreeView_GetCheckState(hIpsList, hPatchHandlesIndex[i]); - - if (nChecked) { - _tcscpy(szIpsActivePatches[nActivePatches], szPatchFileNames[i]); - nActivePatches++; - } - } - - FILE* fp = _tfopen(GameIpsConfigName(), _T("wt")); - - if (fp) { - _ftprintf(fp, _T("// ") _T(APP_TITLE) _T(" v%s --- IPS Config File for %s (%s)\n\n"), szAppBurnVer, szDriverName, szFullName); - for (int i = 0; i < nActivePatches; i++) { - TCHAR *Tokens; - TCHAR szFileName[MAX_PATH]; - Tokens = _tcstok(szIpsActivePatches[i], _T("\\")); - while (Tokens != NULL) { - szFileName[0] = _T('\0'); - _tcscpy(szFileName, Tokens); - Tokens = _tcstok(NULL, _T("\\")); - } - - _ftprintf(fp, _T("%s\n"), szFileName); - } - fclose(fp); - } -} - -static void IpsManagerExit() -{ - SendDlgItemMessage(hIpsDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - - for (int i = 0; i < NUM_LANGUAGES; i++) { - szLanguages[i][0] = _T('\0'); - szLanguageCodes[i][0] = _T('\0'); - } - - memset(hItemHandles, 0, MAX_NODES); - memset(hPatchHandlesIndex, 0, MAX_NODES); - - nPatchIndex = 0; - nNumPatches = 0; - - for (int i = 0; i < MAX_NODES; i++) { - szPatchFileNames[i][0] = _T('\0'); - } - - if (hBmp) { - DeleteObject((HGDIOBJ)hBmp); - hBmp = NULL; - } - - if (hPreview) { - DeleteObject((HGDIOBJ)hPreview); - hPreview = NULL; - } - - DeleteObject(hWhiteBGBrush); - - hParent = NULL; - - EndDialog(hIpsDlg, 0); -} - -static void IpsOkay() -{ - SavePatches(); - IpsManagerExit(); -} - -static INT_PTR CALLBACK DefInpProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - switch (Msg) { - case WM_INITDIALOG: { - hIpsDlg = hDlg; - - hWhiteBGBrush = CreateSolidBrush(RGB(0xFF,0xFF,0xFF)); - hPreview = PNGLoadBitmap(hIpsDlg, NULL, 304, 228, 2); - SendDlgItemMessage(hIpsDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hPreview); - - LONG_PTR Style; - Style = GetWindowLongPtr (GetDlgItem(hIpsDlg, IDC_TREE1), GWL_STYLE); - Style |= TVS_CHECKBOXES; - SetWindowLongPtr (GetDlgItem(hIpsDlg, IDC_TREE1), GWL_STYLE, Style); - - IpsManagerInit(); - - WndInMid(hDlg, hScrnWnd); - SetFocus(hDlg); // Enable Esc=close - break; - } - - case WM_COMMAND: { - int wID = LOWORD(wParam); - int Notify = HIWORD(wParam); - - if (Notify == BN_CLICKED) { - switch (wID) { - case IDOK: { - IpsOkay(); - break; - } - - case IDCANCEL: { - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - - case IDC_IPSMAN_DESELECTALL: { - for (int i = 0; i < nNumPatches; i++) { - for (int j = 0; j < nNumPatches; j++) { - _TreeView_SetCheckState(hIpsList, hPatchHandlesIndex[j], FALSE); - } - } - break; - } - } - } - - if (wID == IDC_CHOOSE_LIST && Notify == CBN_SELCHANGE) { - nIpsSelectedLanguage = SendMessage(GetDlgItem(hIpsDlg, IDC_CHOOSE_LIST), CB_GETCURSEL, 0, 0); - TreeView_DeleteAllItems(hIpsList); - FillListBox(); - RefreshPatch(); - return 0; - } - - break; - } - - case WM_NOTIFY: { - NMHDR* pNmHdr = (NMHDR*)lParam; - - if (LOWORD(wParam) == IDC_TREE1 && pNmHdr->code == TVN_SELCHANGED) { - RefreshPatch(); - - return 1; - } - - if (LOWORD(wParam) == IDC_TREE1 && pNmHdr->code == NM_DBLCLK) { - // disable double-click node-expand - SetWindowLongPtr(hIpsDlg, DWLP_MSGRESULT, 1); - - return 1; - } - - if (LOWORD(wParam) == IDC_TREE1 && pNmHdr->code == NM_CLICK) { - POINT cursorPos; - GetCursorPos(&cursorPos); - ScreenToClient(hIpsList, &cursorPos); - - TVHITTESTINFO thi; - thi.pt = cursorPos; - TreeView_HitTest(hIpsList, &thi); - - if (thi.flags == TVHT_ONITEMSTATEICON) { - TreeView_SelectItem(hIpsList, thi.hItem); - } - - return 1; - } - - SetWindowLongPtr(hIpsDlg, DWLP_MSGRESULT, CDRF_DODEFAULT); - return 1; - } - - case WM_CTLCOLORSTATIC: { - if ((HWND)lParam == GetDlgItem(hIpsDlg, IDC_TEXTCOMMENT)) { - return (INT_PTR)hWhiteBGBrush; - } - break; - } - - case WM_CLOSE: { - IpsManagerExit(); - break; - } - } - - return 0; -} - -int IpsManagerCreate(HWND hParentWND) -{ - hParent = hParentWND; - - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_IPS_MANAGER), hParent, (DLGPROC)DefInpProc); - return 1; -} - -// Game patching - -#define UTF8_SIGNATURE "\xef\xbb\xbf" -#define IPS_SIGNATURE "PATCH" -#define IPS_TAG_EOF "EOF" -#define IPS_EXT ".ips" - -#define BYTE3_TO_UINT(bp) \ - (((unsigned int)(bp)[0] << 16) & 0x00FF0000) | \ - (((unsigned int)(bp)[1] << 8) & 0x0000FF00) | \ - ((unsigned int)(bp)[2] & 0x000000FF) - -#define BYTE2_TO_UINT(bp) \ - (((unsigned int)(bp)[0] << 8) & 0xFF00) | \ - ((unsigned int) (bp)[1] & 0x00FF) - -bool bDoIpsPatch = FALSE; - -static void PatchFile(const char* ips_path, UINT8* base) -{ - char buf[6]; - FILE* f = NULL; - int Offset, Size; - UINT8* mem8 = NULL; - - if (NULL == (f = fopen(ips_path, "rb"))) - return; - - memset(buf, 0, sizeof(buf)); - fread(buf, 1, 5, f); - if (strcmp(buf, IPS_SIGNATURE)) { - bprintf(0, _T("IPS - Bad IPS-Signature in: %S.\n"), ips_path); - if (f) - { - fclose(f); - } - return; - } else { - bprintf(0, _T("IPS - Patching with: %S.\n"), ips_path); - UINT8 ch = 0; - int bRLE = 0; - while (!feof(f)) { - // read patch address offset - fread(buf, 1, 3, f); - buf[3] = 0; - if (strcmp(buf, IPS_TAG_EOF) == 0) - break; - - Offset = BYTE3_TO_UINT(buf); - - // read patch length - fread(buf, 1, 2, f); - Size = BYTE2_TO_UINT(buf); - - bRLE = (Size == 0); - if (bRLE) { - fread(buf, 1, 2, f); - Size = BYTE2_TO_UINT(buf); - ch = fgetc(f); - } - - while (Size--) { - mem8 = base + Offset; - Offset++; - *mem8 = bRLE ? ch : fgetc(f); - } - } - } - - fclose(f); -} - -static void DoPatchGame(const char* patch_name, char* game_name, UINT8* base) -{ - char s[MAX_PATH]; - char* p = NULL; - char* rom_name = NULL; - char* ips_name = NULL; - FILE* fp = NULL; - unsigned long nIpsSize; - - if ((fp = fopen(patch_name, "rb")) != NULL) { - // get ips size - fseek(fp, 0, SEEK_END); - nIpsSize = ftell(fp); - fseek(fp, 0, SEEK_SET); - - while (!feof(fp)) { - if (fgets(s, sizeof(s), fp) != NULL) { - p = s; - - // skip UTF-8 sig - if (strncmp(p, UTF8_SIGNATURE, strlen(UTF8_SIGNATURE)) == 0) - p += strlen(UTF8_SIGNATURE); - - if (p[0] == '[') // '[' - break; - - rom_name = strtok(p, " \t\r\n"); - - if (!rom_name) - continue; - if (*rom_name == '#') - continue; - if (_stricmp(rom_name, game_name)) - continue; - - ips_name = strtok(NULL, " \t\r\n"); - if (!ips_name) - continue; - - // skip CRC check - strtok(NULL, "\r\n"); - - char ips_path[MAX_PATH]; - char ips_dir[MAX_PATH]; - TCHARToANSI(szAppIpsPath, ips_dir, sizeof(ips_dir)); - - if (strchr(ips_name, '\\')) { - // ips in parent's folder - sprintf(ips_path, "%s\\%s%s", ips_dir, ips_name, IPS_EXT); - } else { - sprintf(ips_path, "%s%s\\%s%s", ips_dir, BurnDrvGetTextA(DRV_NAME), ips_name, IPS_EXT); - } - - PatchFile(ips_path, base); - } - } - fclose(fp); - } -} - -void IpsApplyPatches(UINT8* base, char* rom_name) -{ - char ips_data[MAX_PATH]; - - int nActivePatches = GetIpsNumActivePatches(); - - for (int i = 0; i < nActivePatches; i++) { - memset(ips_data, 0, MAX_PATH); - TCHARToANSI(szIpsActivePatches[i], ips_data, sizeof(ips_data)); - DoPatchGame(ips_data, rom_name, base); - } -} - -void IpsPatchExit() -{ - bDoIpsPatch = FALSE; -} diff --git a/jan/src/burner/win32/localise.cpp b/jan/src/burner/win32/localise.cpp deleted file mode 100644 index 7b45a6bc3..000000000 --- a/jan/src/burner/win32/localise.cpp +++ /dev/null @@ -1,1707 +0,0 @@ -#include "burner.h" -#include - -// #define PRINT_TRANSLATION_INFO - -bool bLocalisationActive = false; -TCHAR szLocalisationTemplate[MAX_PATH] = _T(""); - -static const unsigned int nMaxResources = 2000; - -static int nFBACodepage; - -struct LocaliseControlInfo { unsigned int nID; wchar_t szCaption[QUOTE_MAX]; }; -struct LocaliseResourceInfo { unsigned int nID; wchar_t szCaption[QUOTE_MAX]; LocaliseControlInfo* pControlInfo[1024]; }; - -#define RES_DEALLOCATE (1 << 0) -#define RES_ISTRANSLATION (1 << 1) - -struct FBAResourceInfo_t { int nResourceFlags; void* pResourceTranslation; }; -static FBAResourceInfo_t* FBAResourceInfo = NULL; - -typedef struct { - WORD dlgVer; - WORD signature; - DWORD helpID; - DWORD exStyle; - DWORD style; - WORD cDlgItems; - short x; - short y; - short cx; - short cy; -// sz_Or_Ord menu; -// sz_Or_Ord windowClass; -// WCHAR title[titleLen]; -// WORD pointsize; -// WORD weight; -// BYTE italic; -// BYTE charset; -// WCHAR typeface[stringLen]; -} DLGTEMPLATEEX; - -typedef struct { - DWORD helpID; - DWORD exStyle; - DWORD style; - short x; - short y; - short cx; - short cy; - WORD id; -// sz_Or_Ord windowClass; -// sz_Or_Ord title; -// WORD extraCount; -} DLGITEMTEMPLATEEX; - -// ---------------------------------------------------------------------------- - -#define WSKIP_WS(s) while (iswspace(*s)) { s++; } // Skip whitespace -#define WFIND_WS(s) while (*s && !iswspace(*s)) { s++; } // Find whitespace -#define WFIND_QT(s) while (*s && *s != L'\"') { s++; } // Find quote - -#if defined (UNICODE) -#define QuoteReadW QuoteRead -#define LabelCheckW LabelCheck -#else -int QuoteReadW(wchar_t** ppszQuote, wchar_t** ppszEnd, wchar_t* pszSrc) -{ - static wchar_t szQuote[QUOTE_MAX]; - wchar_t* s = pszSrc; - wchar_t* e; - - // Skip whitespace - WSKIP_WS(s); - - e = s; - - if (*s == _T('\"')) { // Quoted string - s++; - e++; - // Find end quote - WFIND_QT(e); - wcsncpy(szQuote, s, e - s); - // Zero-terminate - szQuote[e - s] = _T('\0'); - e++; - } else { // Non-quoted string - // Find whitespace - WFIND_WS(e); - wcsncpy(szQuote, s, e - s); - // Zero-terminate - szQuote[e - s] = _T('\0'); - } - - if (ppszQuote) { - *ppszQuote = szQuote; - } - if (ppszEnd) { - *ppszEnd = e; - } - - return 0; -} - -wchar_t* LabelCheckW(wchar_t* s, wchar_t* pszLabel) -{ - int nLen; - - if (s == NULL) { - return NULL; - } - if (pszLabel == NULL) { - return NULL; - } - nLen = wcslen(pszLabel); - - WSKIP_WS(s); // Skip whitespace - - if (wcsncmp(s, pszLabel, nLen)){ // Doesn't match - return NULL; - } - - return s + nLen; -} -#endif - -// ---------------------------------------------------------------------------- - -int EscapeString(wchar_t* pwszStringOut, wchar_t* pwszStringIn, int max) -{ - int in = 0, out = 0; - - while (pwszStringIn[in] && out < (max - 1)) { - switch (pwszStringIn[in]) { - case L'\n': - pwszStringOut[out++] = L'\\'; - pwszStringOut[out++] = L'n'; - break; - case L'\t': - pwszStringOut[out++] = L'\\'; - pwszStringOut[out++] = L't'; - break; - case L'\'': - pwszStringOut[out++] = L'\\'; - pwszStringOut[out++] = L'\''; - break; - case L'\"': - pwszStringOut[out++] = L'\\'; - pwszStringOut[out++] = L'\"'; - break; - case L'\\': - pwszStringOut[out++] = L'\\'; - pwszStringOut[out++] = L'\\'; - break; - - default: - pwszStringOut[out++] = pwszStringIn[in]; - } - - in++; - } - - pwszStringOut[out] = L'\0'; - - return out; -} - -int UnEscapeString(wchar_t* pwszStringOut, wchar_t* pwszStringIn, int max) -{ - int in = 0, out = 0; - - while (pwszStringIn[in] && in < max) { - if (pwszStringIn[in] == L'\\') { - in++; - switch (pwszStringIn[in++]) { - case L'n': - pwszStringOut[out++] = L'\n'; - break; - case L't': - pwszStringOut[out++] = L'\t'; - break; - case L'\'': - pwszStringOut[out++] = L'\''; - break; - case L'\"': - pwszStringOut[out++] = L'\"'; - break; - case L'\\': - pwszStringOut[out++] = L'\\'; - break; - - default: - pwszStringOut[out++] = pwszStringIn[in]; - } - } else { - pwszStringOut[out++] = pwszStringIn[in++]; - } - } - - pwszStringOut[out] = L'\0'; - - return out; -} - -// ---------------------------------------------------------------------------- -// Translation template creation - -int BuildTemplateDlgTemplateEx(const DLGTEMPLATEEX* pTemplate, LPTSTR lpszName, FILE* fp) -{ - wchar_t wszBuffer[5120]; - wchar_t* pszCaption = L""; - int nControls = 0; - - // 26 is sizeof(DLGTEMPLATEEX) - char* pTemplateDataIn = (char*)(((INT_PTR)pTemplate + 26 + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - - // Menu - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - - // Class - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - - // Caption - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: - pszCaption = (wchar_t*)pTemplateDataIn; - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - - if (fp) { - EscapeString(wszBuffer, pszCaption, 5120); - _ftprintf(fp, _T(" //-- \"%ls\"\n"), wszBuffer); - if (IS_INTRESOURCE(lpszName)) { - _ftprintf(fp, _T("dialog\t%4i "), (INT_PTR)lpszName); - } else { -#if defined (UNICODE) - EscapeString(wszBuffer, lpszName, 5120); -#else - wchar_t szTemp[5120] = L""; - - MultiByteToWideChar(nFBACodepage, 0, lpszName, -1, szTemp, 5120); - EscapeString(wszBuffer, szTemp, 5120); -#endif - _ftprintf(fp, _T("dialog\t%s "), wszBuffer); - } - - _ftprintf(fp, _T("\"\" {\n")); - } - - // Font - if (pTemplate->style & (DS_SETFONT | DS_SHELLFONT)) { - -#if 0 - if (fp) { - EscapeString(wszBuffer, (wchar_t*)(pTemplateDataIn + 2 + 2 * sizeof(WORD)), 5120); - _ftprintf(fp, _T("\tfont %2i \"%ls\"\n"), *((WORD*)pTemplateDataIn), wszBuffer); - } -#endif - - pTemplateDataIn += 2 + 2 * sizeof(WORD); - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - } - - // Controls - for (int i = 0; i < pTemplate->cDlgItems; i++) { - bool bExcludeControl = false; - DWORD dwStyle; - WORD wID; - - pTemplateDataIn = (char*)(((INT_PTR)pTemplateDataIn + sizeof(DWORD) - 1) & ~(sizeof(DWORD) - 1)); - - dwStyle = ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->style; - wID = ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->id; - - pTemplateDataIn = (char*)(((INT_PTR)pTemplateDataIn + sizeof(DLGITEMTEMPLATEEX) + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - - // Class - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: - if ( ((WORD*)pTemplateDataIn)[1] == 0x0081 || - (((WORD*)pTemplateDataIn)[1] == 0x0082 && (dwStyle & SS_BITMAP))) { - - bExcludeControl = true; - } - - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: - if ( !wcsicmp((wchar_t*)pTemplateDataIn, L"SysTreeView32") || - !wcsicmp((wchar_t*)pTemplateDataIn, L"SysListView32") || - !wcsicmp((wchar_t*)pTemplateDataIn, L"Edit") || - !wcsnicmp((wchar_t*)pTemplateDataIn, L"RichEdit", 8) || - (!wcsicmp((wchar_t*)pTemplateDataIn, L"Static") && (dwStyle & SS_BITMAP))) { - - bExcludeControl = true; - } - - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - - if (*((WORD*)pTemplateDataIn) == 0xFFFF) { - pTemplateDataIn += 4; - } - - if (wcslen((wchar_t*)pTemplateDataIn) && !bExcludeControl) { - nControls++; - - if (fp) { - EscapeString(wszBuffer, (wchar_t*)pTemplateDataIn, 5120); - _ftprintf(fp, _T(" //-- \"%ls\"\n"), wszBuffer); - _ftprintf(fp, _T(" %5i\t%4i \"\"\n"), wID, i); - } - } - - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - pTemplateDataIn += sizeof(WORD) + *((WORD*)pTemplateDataIn); - } - - if (fp) { - _ftprintf(fp, _T("}\n\n")); - } - - return nControls; -} - -int BuildTemplateMenuTemplate(const MENUTEMPLATE* pTemplate, LPTSTR lpszName, FILE* fp) -{ - wchar_t wszBuffer[5120]; - TCHAR szIndent[] = _T(" "); - - char* pTemplateDataIn = (char*)pTemplate + sizeof(MENUITEMTEMPLATEHEADER); - bool bLastPopup = false, bLastItem = false; - int nIndent = 0; - int bracketcnt = 0; // popup menu counter (BEGIN...END) - int i = 0; - - if (fp) { - if (IS_INTRESOURCE(lpszName)) { - _ftprintf(fp, _T("menu %4i {\n"), (INT_PTR)lpszName); - } else { -#if defined (UNICODE) - EscapeString(wszBuffer, lpszName, 5120); -#else - wchar_t szTemp[5120] = L""; - - MultiByteToWideChar(nFBACodepage, 0, lpszName, -1, szTemp, 5120); - EscapeString(wszBuffer, szTemp, 5120); -#endif - _ftprintf(fp, _T("menu %s {\n"), wszBuffer); - } - } - - do { - wchar_t pszTitle[1024] = L""; - WORD wOption = ((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption; - WORD wID = 0; - int l; - - if (((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption & MF_POPUP) { - bLastPopup = false; - bLastItem = false; - bracketcnt++; - if (((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption & MF_END) { - bLastPopup = true; - bracketcnt--; - } - pTemplateDataIn += sizeof(WORD); - } else { - if (((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption & MF_END) { - bLastItem = true; - bracketcnt--; - } - wID = ((MENUITEMTEMPLATE*)pTemplateDataIn)->mtID; - pTemplateDataIn += sizeof(WORD) * 2; - } - - for (l = 0; l < 1023 && ((wchar_t*)pTemplateDataIn)[l] && ((wchar_t*)pTemplateDataIn)[l] != _T('\t'); l++) { } - - wcsncpy(pszTitle, (wchar_t*)pTemplateDataIn, l); - - if (fp) { - if (wcslen((wchar_t*)pTemplateDataIn)) { - EscapeString(wszBuffer, pszTitle, 5120); - _ftprintf(fp, _T("%s //-- \"%ls\"\n"), szIndent + (8 - nIndent) * 2, wszBuffer); - _ftprintf(fp, _T("%s"), szIndent + (8 - nIndent) * 2); - if (wOption & MF_POPUP) { - _ftprintf(fp, _T(" popup %4i \"\" {\n"), i); - nIndent++; - } else { - _ftprintf(fp, _T(" %5i %4i \"\"\n"), wID, i); - } - } - - if ((wOption & MF_END) && !(wOption & MF_POPUP)) { - nIndent--; - if (nIndent < 0) { - nIndent = 0; - } - if (nIndent > 8) { - nIndent = 8; - } - - if (fp) { - _ftprintf(fp, _T("%s }\n"), szIndent + (8 - nIndent) * 2); - } - } - } - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - - } while (i++ < 1024 && (!(bLastPopup && bLastItem) || bracketcnt > 0)); - - if (fp) { - while (nIndent) { - nIndent--; - _ftprintf(fp, _T("%s }\n"), szIndent + (8 - nIndent) * 2); - } - - _ftprintf(fp, _T("}\n\n")); - } - - return i; -} - -static BOOL CALLBACK FBALocaliseEnumResourceNamesDialog(HMODULE /* hModule */, LPCTSTR /* lpszType */, LPTSTR lpszName, LONG_PTR lParam) -{ - LPCDLGTEMPLATE pTemplate = (LPCDLGTEMPLATE)LoadResource(hAppInst, FindResource(hAppInst, lpszName, RT_DIALOG)); - - if (LockResource((HGLOBAL)pTemplate)) { - if (((DLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF && ((DLGTEMPLATEEX*)pTemplate)->dlgVer == 1) { - if (BuildTemplateDlgTemplateEx((DLGTEMPLATEEX*)pTemplate, lpszName, NULL)) { - BuildTemplateDlgTemplateEx((DLGTEMPLATEEX*)pTemplate, lpszName, (FILE*)lParam); - } - } - } - - return TRUE; -} - -static BOOL CALLBACK FBALocaliseEnumResourceNamesMenu(HMODULE /* hModule */, LPCTSTR /* lpszType */, LPTSTR lpszName, LONG_PTR lParam) -{ - MENUTEMPLATE* pTemplate = (MENUTEMPLATE*)LoadResource(hAppInst, FindResource(hAppInst, lpszName, RT_MENU)); - - if (LockResource((HGLOBAL)pTemplate)) { - if (((MENUITEMTEMPLATEHEADER*)pTemplate)->versionNumber == 0) { - BuildTemplateMenuTemplate((MENUITEMTEMPLATEHEADER*)pTemplate, lpszName, (FILE*)lParam); - } - } - - return TRUE; -} - -static BOOL CALLBACK FBALocaliseEnumResourceNamesString(HMODULE /* hModule */, LPCTSTR /* lpszType */, LPTSTR lpszName, LONG_PTR lParam) -{ - wchar_t* pwsz = (wchar_t*)LoadResource(hAppInst, FindResource(hAppInst, lpszName, RT_STRING)); - - if (LockResource(pwsz)) { - wchar_t wszBuffer[5120]; - - // Locate the string in the bundle - for (int i = 0; i < 16; i++) { - if (*pwsz) { - EscapeString(wszBuffer, pwsz + 1, 5120); - _ftprintf((FILE*)lParam, _T(" //-- \"%ls\"\n"), wszBuffer); - _ftprintf((FILE*)lParam, _T("string %5i \"\"\n\n"), (((INT_PTR)lpszName) - 1) * 16 + i); - } - pwsz += *pwsz + 1; - } - } - - return TRUE; -} - -static BOOL CALLBACK FBALocaliseEnumResTypeProc(HMODULE /* hModule */, LPTSTR lpszType, LONG_PTR lParam) -{ - if (lpszType == RT_DIALOG) { - EnumResourceNames(NULL, lpszType, &FBALocaliseEnumResourceNamesDialog, lParam); - } - if (lpszType == RT_MENU) { - EnumResourceNames(NULL, lpszType, &FBALocaliseEnumResourceNamesMenu, lParam); - } - if (lpszType == RT_STRING) { - EnumResourceNames(NULL, lpszType, &FBALocaliseEnumResourceNamesString, lParam); - } - - return TRUE; -} - -static int FBALocaliseWriteTemplate(TCHAR* pszTemplate) -{ - FILE* fp = _tfopen(pszTemplate, _T("wt")); - if (fp == NULL) { - return 1; - } - - _ftprintf(fp, _T("// translation template for FB Alpha\n\n")); - _ftprintf(fp, _T("version 0x%06X\n\n"), nBurnVer); - - _ftprintf(fp, _T("// codepage 1252\n\n")); - - EnumResourceTypes(NULL, (ENUMRESTYPEPROC)FBALocaliseEnumResTypeProc, (LONG_PTR)fp); - - fclose(fp); - - return 0; -} - -// ----------------------------------------------------------------------------- - -#define CATCH_UP { int nCopySize = pTemplateDataIn - pTemplateDataInSync; \ - int nTotalSize = pTemplateDataOutSync - pTemplateDataOut; \ - pTemplateDataOut = (char*)realloc(pTemplateDataOut, nTotalSize + nCopySize); \ - memcpy(pTemplateDataOut + nTotalSize, pTemplateDataInSync, nCopySize); \ - pTemplateDataInSync = pTemplateDataIn; \ - pTemplateDataOutSync = pTemplateDataOut + nTotalSize + nCopySize; } - -#define ALIGN(a) { int nTotalSize = (pTemplateDataOutSync - pTemplateDataOut + a - 1) & ~(a - 1); \ - pTemplateDataOut = (char*)realloc(pTemplateDataOut, nTotalSize); \ - pTemplateDataOutSync = pTemplateDataOut + nTotalSize; } - -#define ADD_STRING(s) { int nTotalSize = pTemplateDataOutSync - pTemplateDataOut; \ - int nExtraSize = wcslen((wchar_t*)s) * sizeof(wchar_t) + sizeof(wchar_t); \ - pTemplateDataOut = (char*)realloc(pTemplateDataOut, nTotalSize + nExtraSize); \ - wcscpy((wchar_t*)(pTemplateDataOut + nTotalSize), s); \ - pTemplateDataOutSync = pTemplateDataOut + nTotalSize + nExtraSize; } - -#ifdef PRINT_TRANSLATION_INFO -void ParseDlgTemplateEx(const DLGTEMPLATEEX* pTemplate) -{ - // 26 is sizeof(DLGTEMPLATEEX) - char* pTemplateDataIn = (char*)(((UINT32)pTemplate + 26 + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - -#if 0 - dprintf(_T("\n")); - char* pData = (char*)pTemplate; - for (int i = 0; i < 16; i++) { - for (int j = 0; j < 4; j++) { - for (int k = 0; k < 4; k++) { - unsigned int n = *pData; - dprintf(_T("%02X"), n & 255); - pData++; - } - dprintf(_T(" ")); - } - dprintf(_T("\n")); - } - dprintf(_T("\n")); -#endif - - // Menu - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: - dprintf(_T(" menu is %04X.\n"), *((UINT16*)pTemplateDataIn + sizeof(WORD))); - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: - dprintf(_T(" menu is \"%ls\".\n"), (wchar_t*)pTemplateDataIn); - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - -// pTemplateDataIn = (char*)(((UINT32)pTemplateDataIn + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - - // Class - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: - dprintf(_T(" class is %04X.\n"), *((UINT16*)pTemplateDataIn + sizeof(WORD))); - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: - dprintf(_T(" class is \"%ls\".\n"), (wchar_t*)pTemplateDataIn); - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - -// pTemplateDataIn = (char*)(((UINT32)pTemplateDataIn + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - - // Caption - dprintf(_T(" ")); - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: - dprintf(_T("icon is %04X, "), *((UINT16*)pTemplateDataIn + sizeof(WORD))); - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: - dprintf(_T("caption is \"%ls\".\n"), (wchar_t*)pTemplateDataIn); - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - - // Font - if (pTemplate->style & (DS_SETFONT | DS_SHELLFONT)) { - dprintf(_T(" Font: \"%ls\", %i pt.\n"), (wchar_t*)(pTemplateDataIn + 2 + 2 * sizeof(WORD)), *((WORD*)pTemplateDataIn)); - pTemplateDataIn += 2 + 2 * sizeof(WORD); - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - } - - // Controls - dprintf(_T(" %i controls used.\n"), pTemplate->cDlgItems); - for (int i = 0; i < pTemplate->cDlgItems; i++) { - pTemplateDataIn = (char*)(((UINT32)pTemplateDataIn + sizeof(DWORD) - 1) & ~(sizeof(DWORD) - 1)); - - dprintf(_T(" control %02i, ID is %05i, pos %03ix%03i, size %03ix%03i\n"), i, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->id, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->x, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->y, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->cx, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->cy); - - pTemplateDataIn = (char*)(((UINT32)pTemplateDataIn + sizeof(DLGITEMTEMPLATEEX) + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - - dprintf(_T(" ")); - - // Class - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: - dprintf(_T("class is %04X, "), *((UINT16*)pTemplateDataIn + sizeof(WORD))); - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: - dprintf(_T("class is \"%ls\", "), (wchar_t*)pTemplateDataIn); - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - -// pTemplateDataIn = (char*)(((UINT32)pTemplateDataIn + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - - if (*((WORD*)pTemplateDataIn) == 0xFFFF) { - pTemplateDataIn += 4; - } - - dprintf(_T("title is \"%ls\".\n"), (wchar_t*)pTemplateDataIn); - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - if (*((WORD*)pTemplateDataIn)) { - dprintf(_T(" %i bytes of extra data present.\n"), *((WORD*)pTemplateDataIn)); - } - pTemplateDataIn += sizeof(WORD) + *((WORD*)pTemplateDataIn); - } -} -#endif - -DLGTEMPLATE* TranslateDlgTemplateEx(const DLGTEMPLATEEX* pTemplate, const LocaliseResourceInfo* pLocaliseInfo) -{ - // 26 is sizeof(DLGTEMPLATEEX) - char* pTemplateDataIn = (char*)(((INT_PTR)pTemplate + 26 + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - char* pTemplateDataOut = NULL; - char* pTemplateDataInSync = NULL; - char* pTemplateDataOutSync = NULL; - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("Translating dialogex template:\n")); -#endif - - pTemplateDataOut = (char*)malloc(26); - memcpy(pTemplateDataOut, (char*)pTemplate, 26); - pTemplateDataInSync = pTemplateDataIn; - pTemplateDataOutSync = pTemplateDataOut + 26; - -#ifdef PRINT_TRANSLATION_INFO - #if 0 - dprintf(_T("\n")); - char* pData = (char*)pTemplate; - for (int i = 0; i < 16; i++) { - for (int j = 0; j < 4; j++) { - for (int k = 0; k < 4; k++) { - unsigned int n = *pData; - dprintf(_T("%02X"), n & 255); - pData++; - } - dprintf(_T(" ")); - } - dprintf(_T("\n")); - } - dprintf(_T("\n")); - #endif -#endif - - // Menu - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" menu is %04X.\n"), *((UINT16*)pTemplateDataIn + sizeof(WORD))); -#endif - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" menu is \"%ls\".\n"), (wchar_t*)pTemplateDataIn); -#endif - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - -// pTemplateDataIn = (char*)(((UINT32)pTemplateDataIn + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - - // Class - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" class is %04X.\n"), *((UINT16*)pTemplateDataIn + sizeof(WORD))); -#endif - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" class is \"%ls\".\n"), (wchar_t*)pTemplateDataIn); -#endif - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - -// pTemplateDataIn = (char*)(((UINT32)pTemplateDataIn + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - - // Caption -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" ")); -#endif - if (*((WORD*)pTemplateDataIn) == 0xFFFF) { -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("icon is %04X, "), *((UINT16*)pTemplateDataIn + sizeof(WORD))); -#endif - pTemplateDataIn += 2 * sizeof(WORD); - } - CATCH_UP; - if (pLocaliseInfo->szCaption[0]) { - ADD_STRING(pLocaliseInfo->szCaption); - } else { - ADD_STRING((wchar_t*)pTemplateDataIn); - } - - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - default: -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("caption is \"%ls\".\n"), (wchar_t*)pTemplateDataIn); -#endif - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - pTemplateDataInSync = pTemplateDataIn; - - // Font - if (pTemplate->style & (DS_SETFONT | DS_SHELLFONT)) { -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" Font: \"%ls\", %i pt.\n"), (wchar_t*)(pTemplateDataIn + 2 + 2 * sizeof(WORD)), *((WORD*)pTemplateDataIn)); -#endif - pTemplateDataIn += 2 + 2 * sizeof(WORD); - -#if 0 - CATCH_UP; - ADD_STRING(L"Times New Roman"); - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - pTemplateDataInSync = pTemplateDataIn; -#else - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); -#endif - - } - - // Controls -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" %i controls used.\n"), pTemplate->cDlgItems); -#endif - for (int i = 0; i < pTemplate->cDlgItems; i++) { - - CATCH_UP; - ALIGN(sizeof(DWORD)); - - pTemplateDataIn = pTemplateDataInSync = (char*)(((INT_PTR)pTemplateDataIn + sizeof(DWORD) - 1) & ~(sizeof(DWORD) - 1)); - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" control %02i, ID is %05i, pos %03ix%03i, size %03ix%03i\n"), i, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->id, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->x, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->y, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->cx, ((DLGITEMTEMPLATEEX*)pTemplateDataIn)->cy); -#endif - - pTemplateDataIn = (char*)(((INT_PTR)pTemplateDataIn + sizeof(DLGITEMTEMPLATEEX) + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" ")); -#endif - - // Class - switch (*((WORD*)pTemplateDataIn)) { - case 0x0000: - pTemplateDataIn += 1 * sizeof(WORD); - break; - case 0xFFFF: -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("class is %04X, "), *((UINT16*)pTemplateDataIn + sizeof(WORD))); -#endif - pTemplateDataIn += 2 * sizeof(WORD); - break; - default: -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("class is \"%ls\", "), (wchar_t*)pTemplateDataIn); -#endif - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - break; - } - -// pTemplateDataIn = (char*)(((UINT32)pTemplateDataIn + sizeof(WORD) - 1) & ~(sizeof(WORD) - 1)); - - if (*((WORD*)pTemplateDataIn) == 0xFFFF) { - pTemplateDataIn += 4; - } - - CATCH_UP; - if (pLocaliseInfo->pControlInfo[i] && pLocaliseInfo->pControlInfo[i]->szCaption[0]) { - ADD_STRING(pLocaliseInfo->pControlInfo[i]->szCaption); - } else { - ADD_STRING((wchar_t*)pTemplateDataIn); - } - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("title is \"%ls\".\n"), (wchar_t*)pTemplateDataIn); -#endif - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - pTemplateDataInSync = pTemplateDataIn; -#ifdef PRINT_TRANSLATION_INFO - if (*((WORD*)pTemplateDataIn)) { - dprintf(_T(" %i bytes of extra data present.\n"), *((WORD*)pTemplateDataIn)); - } -#endif - pTemplateDataIn += sizeof(WORD) + *((WORD*)pTemplateDataIn); - } - - CATCH_UP; - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("Parsing translated template:\n")); - - if (((DLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF) { - ParseDlgTemplateEx((DLGTEMPLATEEX*)pTemplateDataOut); - } - - dprintf(_T("Done.\n")); -#endif - - return (DLGTEMPLATE*)pTemplateDataOut; -} - -INT_PTR FBADialogBox(HINSTANCE hInstance, LPTSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc) -{ - // Try to load the translated dialog - if (bLocalisationActive && hInstance == hAppInst && (UINT_PTR)lpTemplate < nMaxResources && FBAResourceInfo[(UINT_PTR)lpTemplate].pResourceTranslation) { - return DialogBoxIndirect(hInstance, (LPCDLGTEMPLATE)FBAResourceInfo[(INT_PTR)lpTemplate].pResourceTranslation, hWndParent, lpDialogFunc); - } - - // Localisation disabled or couldn't lock resource, so use normal function - return DialogBox(hInstance, lpTemplate, hWndParent, lpDialogFunc); -} - -HWND FBACreateDialog(HINSTANCE hInstance, LPCTSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc) -{ - // Try to load the translated dialog - if (bLocalisationActive && hInstance == hAppInst && (UINT_PTR)lpTemplate < nMaxResources && FBAResourceInfo[(UINT_PTR)lpTemplate].pResourceTranslation) { - return CreateDialogIndirect(hInstance, (LPCDLGTEMPLATE)FBAResourceInfo[(INT_PTR)lpTemplate].pResourceTranslation, hWndParent, lpDialogFunc); - } - - // Localisation disabled or couldn't lock resource, so use normal function - return CreateDialog(hInstance, lpTemplate, hWndParent, lpDialogFunc); -} - -// ---------------------------------------------------------------------------- - -#ifdef PRINT_TRANSLATION_INFO -void ParseMenuTemplate(const MENUTEMPLATE* pTemplate) -{ - // 26 is sizeof(DLGTEMPLATEEX) - char* pTemplateDataIn = (char*)pTemplate + sizeof(MENUITEMTEMPLATEHEADER); - -#if 0 - dprintf(_T("\n")); - char* pData = (char*)pTemplate; - for (int i = 0; i < 16; i++) { - for (int j = 0; j < 4; j++) { - for (int k = 0; k < 4; k++) { - unsigned int n = *pData; - dprintf(_T("%02X"), n & 255); - pData++; - } - dprintf(_T(" ")); - } - dprintf(_T("\n")); - } - dprintf(_T("\n")); -#endif - - int i = 0; - int bracketcnt = 0; // popup menu counter (BEGIN...END) - bool bLastPopup = false, bLastItem = false; - do { - if (((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption & MF_POPUP) { - bLastPopup = false; - bLastItem = false; - bracketcnt++; - if (((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption & MF_END) { - bLastPopup = true; - bracketcnt--; - } - dprintf(_T(" popup %03i "), i); - pTemplateDataIn += sizeof(WORD); - } else { - if (((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption & MF_END) { - bLastItem = true; - bracketcnt--; - } - dprintf(_T(" item %03i ID is %05i "), i, ((MENUITEMTEMPLATE*)pTemplateDataIn)->mtID); - pTemplateDataIn += sizeof(WORD) * 2; - } - - dprintf(_T("\"%ls\".\n"), ((wchar_t*)pTemplateDataIn)); - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - } while (i++ < 1024 && (!(bLastPopup && bLastItem) || bracketcnt > 0)); -} -#endif - -MENUTEMPLATE* TranslateMenuTemplate(const MENUTEMPLATE* pTemplate, const LocaliseResourceInfo* pLocaliseInfo) -{ - // 26 is sizeof(DLGTEMPLATEEX) - char* pTemplateDataIn = (char*)pTemplate + sizeof(MENUITEMTEMPLATEHEADER); - char* pTemplateDataOut = NULL; - char* pTemplateDataInSync = NULL; - char* pTemplateDataOutSync = NULL; - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("Translating menu template:\n")); -#endif - - pTemplateDataOut = (char*)malloc(sizeof(MENUITEMTEMPLATEHEADER)); - memcpy(pTemplateDataOut, (char*)pTemplate, sizeof(MENUITEMTEMPLATEHEADER) + ((MENUITEMTEMPLATEHEADER*)pTemplate)->offset); - pTemplateDataInSync = pTemplateDataIn; - pTemplateDataOutSync = pTemplateDataOut + sizeof(MENUITEMTEMPLATEHEADER) + ((MENUITEMTEMPLATEHEADER*)pTemplate)->offset; - -#ifdef PRINT_TRANSLATION_INFO - #if 0 - dprintf(_T("\n")); - char* pData = (char*)pTemplate; - for (int i = 0; i < 16; i++) { - for (int j = 0; j < 4; j++) { - for (int k = 0; k < 4; k++) { - unsigned int n = *pData; - dprintf(_T("%02X"), n & 255); - pData++; - } - dprintf(_T(" ")); - } - dprintf(_T("\n")); - } - dprintf(_T("\n")); - #endif -#endif - - int i = 0; - int bracketcnt = 0; // popup menu counter (BEGIN...END) - bool bLastPopup = false, bLastItem = false; - do { - if (((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption & MF_POPUP) { - bLastPopup = false; - bLastItem = false; - bracketcnt++; - if (((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption & MF_END) { - bLastPopup = true; - bracketcnt--; - } -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" popup %03i "), i); -#endif - pTemplateDataIn += sizeof(WORD); - } else { - if (((MENUITEMTEMPLATE*)pTemplateDataIn)->mtOption & MF_END) { - bLastItem = true; - bracketcnt--; - } -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T(" item %03i ID is %05i "), i, ((MENUITEMTEMPLATE*)pTemplateDataIn)->mtID); -#endif - pTemplateDataIn += sizeof(WORD) * 2; - } - - CATCH_UP; -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("\"%ls\".\n"), (wchar_t*)pTemplateDataIn); -#endif - if (pLocaliseInfo->pControlInfo[i] && pLocaliseInfo->pControlInfo[i]->szCaption[0]) { - wchar_t* pszHotkey = NULL; - - for (pszHotkey = (wchar_t*)pTemplateDataIn; *pszHotkey && *pszHotkey != _T('\t'); pszHotkey++) { } - - ADD_STRING(pLocaliseInfo->pControlInfo[i]->szCaption); - if (*pszHotkey) { - pTemplateDataOutSync -= sizeof(wchar_t); - ADD_STRING(pszHotkey); - } - } else { - ADD_STRING((wchar_t*)pTemplateDataIn); - } - - pTemplateDataIn += wcslen((wchar_t*)pTemplateDataIn) * sizeof(wchar_t) + sizeof(wchar_t); - pTemplateDataInSync = pTemplateDataIn; - } while (i++ < 1024 && (!(bLastPopup && bLastItem) || bracketcnt > 0)); - - CATCH_UP; - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("Parsing translated template:\n")); - ParseMenuTemplate((MENUTEMPLATE*)pTemplateDataOut); - dprintf(_T("Done.\n")); -#endif - - return (MENUTEMPLATE*)pTemplateDataOut; - -} - -HMENU FBALoadMenu(HINSTANCE hInstance, LPTSTR lpMenuName) -{ - // Try to load the translated menu - if (bLocalisationActive && hInstance == hAppInst && (UINT_PTR)lpMenuName < nMaxResources && FBAResourceInfo[(UINT_PTR)lpMenuName].pResourceTranslation) { - return LoadMenuIndirect((MENUTEMPLATE*)FBAResourceInfo[(INT_PTR)lpMenuName].pResourceTranslation); - } - - // Translation unavailable, so use normal function - return LoadMenu(hInstance, lpMenuName); -} - -// ---------------------------------------------------------------------------- - -TCHAR* FBALoadStringEx(HINSTANCE hInstance, UINT uID, bool bTranslate) -{ - if (bLocalisationActive && bTranslate && uID < nMaxResources) { - if (FBAResourceInfo[uID].pResourceTranslation) { - -#if 1 && defined (PRINT_TRANSLATION_INFO) - dprintf(_T("string %5i: \"%ls\"\n"), uID, (TCHAR*)FBAResourceInfo[uID].pResourceTranslation); -#endif - - return (TCHAR*)FBAResourceInfo[uID].pResourceTranslation; - } - } - - { - // Convert the string ID into a bundle number - wchar_t* pwsz = (wchar_t*)LoadResource(hInstance, FindResource(hInstance, MAKEINTRESOURCE(uID / 16 + 1), RT_STRING)); - - if ((pwsz = (wchar_t*)LockResource(pwsz)) != NULL) { - // Locate the string in the bundle - for (unsigned int i = 0; i < (uID & 15); i++) { - pwsz += *pwsz + 1; - } - } - -#if 1 && defined (PRINT_TRANSLATION_INFO) - dprintf(_T("string %5i: \"%ls\"\n"), uID, *pwsz ? pwsz + 1 : pwsz); -#endif - -#if defined (UNICODE) && defined (_MSC_VER) - return *pwsz ? pwsz + 1 : pwsz; -#else - { -#if !defined (UNICODE) - static char szStringBuffer[5120]; -// memset(szStringBuffer, 0, sizeof(szStringBuffer)); - - if (WideCharToMultiByte(CP_ACP, 0, *pwsz ? pwsz + 1 : pwsz, *pwsz, szStringBuffer, 5120, NULL, NULL)) { - szStringBuffer[*pwsz] = '\0'; - return szStringBuffer; - } -#else - static wchar_t szStringBuffer[5120]; - - // When using GCC, copy the string since Windres can't zero-terminate strings in resource files - if (*pwsz) { - wcsncpy(szStringBuffer, pwsz + 1, *pwsz); - } - szStringBuffer[*pwsz] = '\0'; - return szStringBuffer; - -#endif - return NULL; - } -#endif - } -} - -int FBALoadString(HINSTANCE hInstance, UINT uID, LPTSTR lpBuffer, int nBufferMax) -{ - if (bLocalisationActive && uID < nMaxResources) { - if (FBAResourceInfo[uID].pResourceTranslation) { - int nLen = _tcslen((TCHAR*)FBAResourceInfo[uID].pResourceTranslation); - -#if defined (UNICODE) - _tcsncpy(lpBuffer, (TCHAR*)FBAResourceInfo[uID].pResourceTranslation, nBufferMax - 1); -#else - strncpy(lpBuffer, (char*)FBAResourceInfo[uID].pResourceTranslation, nBufferMax - 1); -#endif - return ((nLen < nBufferMax) ? nLen : nBufferMax) - 1; - } - } - - return LoadString(hInstance, uID, lpBuffer, nBufferMax); -} - -// ---------------------------------------------------------------------------- - -static void FBALocaliseError(TCHAR* pszFilename, int nLineNumber, TCHAR* pszInfo, wchar_t* pszLine) -{ - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Language file %s is malformed.\nPlease remove or repair the file.\n\n"), pszFilename); - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Parse error at line %i.\n"), nLineNumber); - - if (pszInfo) { - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Problem:\t%s.\n"), pszInfo); - } - if (pszLine) { - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Text:\t%ls\n"), pszLine); - } - - FBAPopupDisplay(PUF_TYPE_ERROR); -} - -static int FBALocaliseParseFile(TCHAR* pszFilename) -{ - LocaliseResourceInfo CurrentResource; - wchar_t wszBuffer[5120]; - - int nTemplateVersion = 0; - - wchar_t szLine[5120]; - wchar_t* s; - wchar_t* t; - int nLen; - - int nLine = 0; - int nInside = 0; - TCHAR* nResourceType = 0; - - if (pszFilename == 0 || _tcslen(pszFilename) == 0) { - return -1; - } - - memset(&CurrentResource, 0, sizeof(LocaliseResourceInfo)); - - FILE* h = _tfopen(pszFilename, _T("rb")); - if (h == NULL) { - return 1; - } - - { - unsigned char szBOM[4] = { 0, }; - - fread(szBOM, 1, sizeof(szBOM), h); - - // See if it's a UTF-8 file - if (szBOM[0] == 0xEF && szBOM[1] == 0xBB && szBOM[2] == 0xBF) { - nFBACodepage = CP_UTF8; - } - -#ifdef _UNICODE - // See if it's a UTF-16 file - if (szBOM[0] == 0xFF && szBOM[1] == 0xFE) { - nFBACodepage = CP_WINUNICODE; - - fseek(h, 2, SEEK_SET); - } -#endif - - } - - if (nFBACodepage != CP_WINUNICODE) { - fclose(h); - h = _tfopen(pszFilename, _T("rt")); - if (h == NULL) { - return 1; - } - - if (nFBACodepage == CP_UTF8) { - fseek(h, 3, SEEK_SET); - } - - } - - while (1) { - char szTemp[1024]; - -#ifdef _UNICODE - if (nFBACodepage != CP_WINUNICODE) { -#endif - if (fgets(szTemp, sizeof(szTemp), h) == NULL) { - break; - } - MultiByteToWideChar(nFBACodepage, 0, szTemp, -1, szLine, sizeof(szLine) / sizeof(TCHAR)); -#ifdef _UNICODE - } else { - if (_fgetts(szLine, sizeof(szLine), h) == NULL) { - break; - } - } -#endif - - nLine++; - - nLen = wcslen(szLine); - // Get rid of the linefeed at the end - while (szLine[nLen - 1] == 0x0A || szLine[nLen - 1] == 0x0D) { - szLine[nLen - 1] = 0; - nLen--; - } - - s = szLine; // Start parsing - - WSKIP_WS(s); - - if (s[0] == _T('/') && s[1] == _T('/')) { // Comment - continue; - } - - if ((t = LabelCheckW(s, L"version")) != 0) { // Version - s = t; - - WSKIP_WS(s); - - nTemplateVersion = wcstol(s, &t, 0); - - if (s != t) { - if (nTemplateVersion != nBurnVer) { - break; - } - } - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("version\n"), nTemplateVersion); -#endif - - s = t; - - continue; - } - - if ((t = LabelCheckW(s, L"codepage")) != 0) { // Set codepage - s = t; - - WSKIP_WS(s); - - nFBACodepage = wcstol(s, &t, 0); - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("codepage\n"), nFBACodepage); -#endif - - s = t; - - continue; - } - - if ((t = LabelCheckW(s, L"menu")) != 0) { - s = t; - - nResourceType = RT_MENU; - - WSKIP_WS(s); - - unsigned int nID = wcstol(s, &t, 0); - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("menu %i\n"), nID); -#endif - s = t; - - WSKIP_WS(s); - - if (nInside) { - FBALocaliseError(pszFilename, nLine, _T("missing closing bracket"), NULL); - break; - } - if (*s != _T('{')) { - FBALocaliseError(pszFilename, nLine, _T("missing opening bracket"), NULL); - break; - } - nInside = 1; - - CurrentResource.nID = nID; - - continue; - } - - if ((t = LabelCheckW(s, L"dialog")) != 0) { // Add new resource - s = t; - - nResourceType = RT_DIALOG; - - WSKIP_WS(s); - - unsigned int nID = wcstol(s, &t, 0); - -#ifdef PRINT_TRANSLATION_INFO - dprintf(_T("dialog %i\n"), nID); -#endif - s = t; - - // Read dialog caption - wchar_t* szQuote = NULL; - wchar_t* szEnd = NULL; - - QuoteReadW(&szQuote, &szEnd, s); - - s = szEnd; - - WSKIP_WS(s); - - if (nInside) { - FBALocaliseError(pszFilename, nLine, _T("missing closing bracket"), NULL); - break; - } - if (*s != L'{') { - FBALocaliseError(pszFilename, nLine, _T("missing opening bracket"), NULL); - break; - } - nInside = 1; - - CurrentResource.nID = nID; - - if (wcslen(szQuote)) { - memcpy(CurrentResource.szCaption, szQuote, QUOTE_MAX * sizeof(TCHAR)); - } - - continue; - } - - if ((t = LabelCheckW(s, L"string")) != 0) { - s = t; - - if (nInside) { - FBALocaliseError(pszFilename, nLine, _T("missing closing bracket"), NULL); - break; - } - - WSKIP_WS(s); - - unsigned int nID = wcstol(s, &t, 0); - - s = t; - - // Read dialog caption - WFIND_QT(s); - s++; - wchar_t* szQuote = s; - WFIND_QT(s); - wchar_t* szEnd = s; - - if (nID < nMaxResources) { - -#ifdef PRINT_TRANSLATION_INFO - { - TCHAR szFormat[256]; - _stprintf(szFormat, _T("string %%5i \"%%.%ils\"\n"), szEnd - szQuote); - dprintf(szFormat, nID, szQuote); - } -#endif - - if (szEnd - szQuote > 0) { - UnEscapeString(wszBuffer, szQuote, szEnd - szQuote); - FBAResourceInfo[nID].nResourceFlags = RES_DEALLOCATE; -#ifdef _UNICODE - FBAResourceInfo[nID].pResourceTranslation = malloc((wcslen(wszBuffer) + 1) * sizeof(wchar_t)); - wcscpy((wchar_t*)FBAResourceInfo[nID].pResourceTranslation, wszBuffer); -#else - { - char szStringBuffer[5120]; - memset(szStringBuffer, 0, sizeof(szStringBuffer)); - - WideCharToMultiByte(CP_ACP, 0, wszBuffer, -1, szStringBuffer, 5120, NULL, NULL); - - FBAResourceInfo[nID].pResourceTranslation = malloc((strlen(szStringBuffer) + 1)); - strcpy((char*)FBAResourceInfo[nID].pResourceTranslation, szStringBuffer); - } -#endif - } - } - } - - int n = wcstol(s, &t, 0); - bool bPopup = false; - if (t == s) { - t = LabelCheckW(s, L"popup"); - bPopup = true; - } - if (t && t != s) { // New control - - if (nInside == 0) { - FBALocaliseError(pszFilename, nLine, _T("rogue control statement"), szLine); - break; - } - - s = t; - n = wcstol(s, &t, 0); - - // Link a new control info structure - if (n < 256) { - s = t; - - // Read option name - wchar_t* szQuote = NULL; - wchar_t* szEnd = NULL; - if (QuoteReadW(&szQuote, &szEnd, s)) { - FBALocaliseError(pszFilename, nLine, _T("control name omitted"), szLine); - break; - } - s = szEnd; - - if (bPopup) { - WSKIP_WS(s); - - if (*s != L'{') { - FBALocaliseError(pszFilename, nLine, _T("missing opening bracket"), NULL); - break; - } - nInside++; - } - - if (wcslen(szQuote)) { - if (CurrentResource.pControlInfo[n] == NULL) { - CurrentResource.pControlInfo[n] = (LocaliseControlInfo*)malloc(sizeof(LocaliseControlInfo)); - } - memset(CurrentResource.pControlInfo[n], 0, sizeof(LocaliseControlInfo)); - memcpy(CurrentResource.pControlInfo[n]->szCaption, szQuote, QUOTE_MAX * sizeof(TCHAR)); - } - -// dprintf(_T(" - %ls\n"), pCurrentResource->pControlInfo[n]->szCaption); - - } - - continue; - } - - WSKIP_WS(s); - if (*s == L'}') { - if (nInside == 0) { - FBALocaliseError(pszFilename, nLine, _T("rogue closing bracket"), NULL); - break; - } - - nInside--; - - if (nInside == 0) { - - if (CurrentResource.nID < nMaxResources) { - if (nResourceType == RT_MENU) { - MENUTEMPLATE* pTemplate; - - pTemplate = (MENUTEMPLATE*)LoadResource(hAppInst, FindResource(hAppInst, MAKEINTRESOURCE(CurrentResource.nID), RT_MENU)); - if (LockResource((HGLOBAL)pTemplate)) { - if (((MENUITEMTEMPLATEHEADER*)pTemplate)->versionNumber == 0) { - - // Translate the structure - FBAResourceInfo[CurrentResource.nID].pResourceTranslation = TranslateMenuTemplate((MENUTEMPLATE*)pTemplate, &CurrentResource); - FBAResourceInfo[CurrentResource.nID].nResourceFlags = RES_DEALLOCATE; - } - } - } - if (nResourceType == RT_DIALOG) { - LPCDLGTEMPLATE pTemplate; - - pTemplate = (LPCDLGTEMPLATE)LoadResource(hAppInst, FindResource(hAppInst, MAKEINTRESOURCE(CurrentResource.nID), RT_DIALOG)); - if (LockResource((HGLOBAL)pTemplate)) { - if (((DLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF && ((DLGTEMPLATEEX*)pTemplate)->dlgVer == 1) { - - // Translate the structure - FBAResourceInfo[CurrentResource.nID].pResourceTranslation = TranslateDlgTemplateEx((DLGTEMPLATEEX*)pTemplate, &CurrentResource); - FBAResourceInfo[CurrentResource.nID].nResourceFlags = RES_DEALLOCATE; - } - } - } - } - - for (int i = 0; i < 1024; i++) { - if (CurrentResource.pControlInfo[i]) { - free(CurrentResource.pControlInfo[i]); - CurrentResource.pControlInfo[i] = NULL; - } - } - memset(&CurrentResource, 0, sizeof(LocaliseResourceInfo)); - } - } - - // Line isn't (part of) a valid cheat -#if 0 - if (*s) { - FBALocaliseError(pszFilename, nLine, _T("rogue line"), szLine); - break; - } -#endif - - } - - for (int i = 0; i < 1024; i++) { - if (CurrentResource.pControlInfo[i]) { - free(CurrentResource.pControlInfo[i]); - CurrentResource.pControlInfo[i] = NULL; - } - } - - if (h) { - fclose(h); - } - - if (nTemplateVersion != nBurnVer) { - if (nTemplateVersion == 0) { - return -1; - } - return -2; - } - - return 0; -} - -void FBALocaliseExit() -{ - bLocalisationActive = false; - - if (FBAResourceInfo) { - for (unsigned int i = 0; i < nMaxResources; i++) { - if (FBAResourceInfo[i].nResourceFlags & RES_DEALLOCATE) { - if (FBAResourceInfo[i].pResourceTranslation) { - free(FBAResourceInfo[i].pResourceTranslation); - FBAResourceInfo[i].pResourceTranslation = NULL; - } - } - } - - if (FBAResourceInfo) { - free(FBAResourceInfo); - FBAResourceInfo = NULL; - } - } - - return; -} - -int FBALocaliseInit(TCHAR* pszTemplate) -{ - int nRet; - - FBALocaliseExit(); - nFBACodepage = GetACP(); - - if (pszTemplate == NULL || _tcslen(pszTemplate) == 0) { - -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" ** Translation disabled\n")); -#endif - - szLocalisationTemplate[0] = _T('\0'); - - return 0; - } - - FBAResourceInfo = (FBAResourceInfo_t*)malloc(nMaxResources * sizeof(FBAResourceInfo_t)); - if (FBAResourceInfo == NULL) { - return 1; - } - - memset(FBAResourceInfo, 0, nMaxResources * sizeof(FBAResourceInfo_t)); - - nRet = FBALocaliseParseFile(pszTemplate); - if (nRet > 0) { - -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" ** Translation initialisation failed\n")); -#endif - - return 1; - } - - if (nRet < 0) { - -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" ** Translation disabled\n")); -#endif - - FBALocaliseExit(); - nFBACodepage = GetACP(); - - szLocalisationTemplate[0] = _T('\0'); - - return 0; - } - -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" ** Translation initialised\n")); -#endif - - if (pszTemplate) { - _tcsncpy(szLocalisationTemplate, pszTemplate, sizeof(szLocalisationTemplate) / sizeof(TCHAR)); - } - - bLocalisationActive = true; - - return 0; -} - -// ---------------------------------------------------------------------------- -// Dialog box to load/save a template - -static TCHAR szFilter[100]; - -static void MakeOfn() -{ - _stprintf(szFilter, _T("%s"), FBALoadStringEx(hAppInst, IDS_LOCAL_FILTER, true)); - memcpy(szFilter + _tcslen(szFilter), _T(" (*.flt)\0*.flt\0\0"), 16 * sizeof(TCHAR)); - - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hScrnWnd; - ofn.lpstrFilter = szFilter; - ofn.lpstrFile = szChoice; - ofn.nMaxFile = sizeof(szChoice) / sizeof(TCHAR); - ofn.lpstrInitialDir = _T(".\\config\\localisation"); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("flt"); - - return; -} - -int FBALocaliseLoadTemplate() -{ - _stprintf(szChoice, _T("template")); - MakeOfn(); - TCHAR szTitle[100]; - _stprintf(szTitle, _T("%s"), FBALoadStringEx(hAppInst, IDS_LOCAL_SELECT, true)); - ofn.lpstrTitle = szTitle; - ofn.Flags |= OFN_OVERWRITEPROMPT; - - int bOldPause = bRunPause; - bRunPause = 1; - int nRet = GetOpenFileName(&ofn); - bRunPause = bOldPause; - - if (nRet == 0) { - return 1; - } - - return FBALocaliseInit(szChoice); -} - -int FBALocaliseCreateTemplate() -{ - _stprintf(szChoice, _T("template")); - MakeOfn(); - TCHAR szTitle[100]; - _stprintf(szTitle, _T("%s"), FBALoadStringEx(hAppInst, IDS_LOCAL_CREATE, true)); - ofn.lpstrTitle = szTitle; - ofn.Flags |= OFN_OVERWRITEPROMPT; - - int bOldPause = bRunPause; - bRunPause = 1; - int nRet = GetSaveFileName(&ofn); - bRunPause = bOldPause; - - if (nRet == 0) { - return 1; - } - - return FBALocaliseWriteTemplate(szChoice); -} diff --git a/jan/src/burner/win32/localise_download.cpp b/jan/src/burner/win32/localise_download.cpp deleted file mode 100644 index f85b5e063..000000000 --- a/jan/src/burner/win32/localise_download.cpp +++ /dev/null @@ -1,182 +0,0 @@ -#include "burner.h" -#include -#include - -#define MAX_LANGUAGES 64 - -static HWND hLocalDownDlg = NULL; -static HWND hParent = NULL; - -static int langCodes[MAX_LANGUAGES]; - -static void LocaliseDownloadExit() -{ - hParent = NULL; - - memset(langCodes, 0, MAX_LANGUAGES * sizeof(int)); - - EndDialog(hLocalDownDlg, 0); -} - -static INT32 LocaliseDownloadInit() -{ - HINTERNET connect = InternetOpen(_T("MyBrowser"), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); - - if (!connect) { - MessageBox(hLocalDownDlg, FBALoadStringEx(hAppInst, IDS_ERR_LOCAL_FAIL_CONNECT, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - return 1; - } - - HINTERNET OpenAddress = InternetOpenUrl(connect, _T("https://www.fbalpha.com/localisationinfo/"), NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_KEEP_CONNECTION, 0); - if (!OpenAddress) { - MessageBox(hLocalDownDlg, FBALoadStringEx(hAppInst, IDS_ERR_LOCAL_FAIL_OPEN_URL, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - InternetCloseHandle(connect); - return 1; - } - - char DataReceived[4096]; - DWORD NumberOfBytesRead = 0; - InternetReadFile(OpenAddress, DataReceived, 4096, &NumberOfBytesRead); - - DataReceived[NumberOfBytesRead] = '\0'; - - char *Tokens; - int i = 0; - int j = 0; - Tokens = strtok(DataReceived, ":^"); - while (Tokens != NULL) { - if (i & 1) { - SendDlgItemMessage(hLocalDownDlg, IDC_CHOOSE_LIST, CB_ADDSTRING, 0, (LPARAM)ANSIToTCHAR(Tokens, NULL, 0)); - } else { - langCodes[j] = atoi(Tokens); - j++; - } - - i++; - Tokens = strtok(NULL, ":^"); - } - - SendDlgItemMessage(hLocalDownDlg, IDC_CHOOSE_LIST, CB_SETCURSEL, (WPARAM)0, (LPARAM)0); - - InternetCloseHandle(OpenAddress); - InternetCloseHandle(connect); - - return 0; -} - -static int LocaliseDownloadOkay() -{ - TCHAR szTitle[256]; - TCHAR szFilter[256]; - - int nIndex = SendMessage(GetDlgItem(hLocalDownDlg, IDC_CHOOSE_LIST), CB_GETCURSEL, 0, 0); - SendMessage(GetDlgItem(hLocalDownDlg, IDC_CHOOSE_LIST), CB_GETLBTEXT, (WPARAM)nIndex, (LPARAM)szChoice); - - _sntprintf(szTitle, 256, FBALoadStringEx(hAppInst, IDS_LOCAL_GL_SELECT, true)); - - _stprintf(szFilter, FBALoadStringEx(hAppInst, IDS_LOCAL_GL_FILTER, true)); - memcpy(szFilter + _tcslen(szFilter), _T(" (*.flt)\0*.flt\0\0"), 16 * sizeof(TCHAR)); - - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hScrnWnd; - ofn.lpstrFilter = szFilter; - ofn.lpstrFile = szChoice; - ofn.nMaxFile = sizeof(szChoice) / sizeof(TCHAR); - ofn.lpstrInitialDir = _T("."); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("dat"); - ofn.lpstrTitle = szTitle; - ofn.Flags |= OFN_OVERWRITEPROMPT; - - if (GetSaveFileName(&ofn) == 0) return 1; - - FILE *fFlt = NULL; - - if ((fFlt = _tfopen(szChoice, _T("wb"))) == 0) return 1; - - HINTERNET connect = InternetOpen(_T("MyBrowser"), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); - - if (!connect) { - MessageBox(hLocalDownDlg, FBALoadStringEx(hAppInst, IDS_ERR_LOCAL_FAIL_CONNECT, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - return 1; - } - - TCHAR url[256]; - _sntprintf(url, 256, _T("https://www.fbalpha.com/localisation/downloadtemplates/%i/"), langCodes[nIndex]); - - HINTERNET OpenAddress = InternetOpenUrl(connect, url, NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_KEEP_CONNECTION, 0); - if (!OpenAddress) { - MessageBox(hLocalDownDlg, FBALoadStringEx(hAppInst, IDS_ERR_LOCAL_FAIL_OPEN_URL, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - InternetCloseHandle(connect); - return 1; - } - - char DataReceived[4096]; - DWORD NumberOfBytesRead = 0; - while (InternetReadFile(OpenAddress, DataReceived, 4096, &NumberOfBytesRead) && NumberOfBytesRead) { - fwrite(DataReceived, sizeof(char), NumberOfBytesRead, fFlt); - } - - InternetCloseHandle(OpenAddress); - InternetCloseHandle(connect); - - fclose(fFlt); - - FBALocaliseInit(szChoice); - POST_INITIALISE_MESSAGE; - - return 0; -} - -static INT_PTR CALLBACK DefInpProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM /*lParam*/) -{ - switch (Msg) { - case WM_INITDIALOG: { - hLocalDownDlg = hDlg; - - if (LocaliseDownloadInit() == 1) SendMessage(hDlg, WM_CLOSE, 0, 0); - - WndInMid(hDlg, hScrnWnd); - SetFocus(hDlg); // Enable Esc=close - break; - } - - case WM_COMMAND: { - int wID = LOWORD(wParam); - int Notify = HIWORD(wParam); - - if (Notify == BN_CLICKED) { - switch (wID) { - case IDOK: { - LocaliseDownloadOkay(); - SendMessage(hDlg, WM_CLOSE, 0, 0); - break; - } - - case IDCANCEL: { - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - } - } - } - - break; - } - - case WM_CLOSE: { - LocaliseDownloadExit(); - break; - } - } - - return 0; -} - -int LocaliseDownloadCreate(HWND hParentWND) -{ - hParent = hParentWND; - - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_DOWNLOAD_LOCAL), hParent, (DLGPROC)DefInpProc); - return 1; -} diff --git a/jan/src/burner/win32/localise_gamelist.cpp b/jan/src/burner/win32/localise_gamelist.cpp deleted file mode 100644 index c1c79d96b..000000000 --- a/jan/src/burner/win32/localise_gamelist.cpp +++ /dev/null @@ -1,203 +0,0 @@ -#include "burner.h" -#include - -#define MAX_LST_GAMES 25000 -#define MAX_LST_LINE_LEN 256 - -TCHAR szGamelistLocalisationTemplate[MAX_PATH] = _T(""); -bool nGamelistLocalisationActive = false; -static int nCodePage = CP_ACP; -static TCHAR *szLongNamesArray[MAX_LST_GAMES]; - -void BurnerDoGameListLocalisation() -{ - if (!nGamelistLocalisationActive) return; - - FILE* fp = _tfopen(szGamelistLocalisationTemplate, _T("rt")); - if (fp) { - TCHAR *szShortNamesArray[MAX_LST_GAMES]; - TCHAR szLine[MAX_LST_LINE_LEN * sizeof(TCHAR)]; - int nTokenPos = 0; - int nArrayPos = 0; - int nNumGames = 0; - - // Allocate arrays to read the file into - for (int i = 0; i < MAX_LST_GAMES; i++) { - szLongNamesArray[i] = (TCHAR*)malloc(MAX_LST_LINE_LEN * sizeof(TCHAR)); - szShortNamesArray[i] = (TCHAR*)malloc(33 * sizeof(TCHAR)); - memset(szLongNamesArray[i], _T('\0'), MAX_LST_LINE_LEN * sizeof(TCHAR)); - memset(szShortNamesArray[i], _T('\0'), 33 * sizeof(TCHAR)); - } - - char szTemp[MAX_LST_LINE_LEN]; - - while (fgets(szTemp, sizeof(szTemp), fp)) { - if (szTemp[0] == '/' && szTemp[1] == '/') { - continue; - } - - if (!strncmp(szTemp, "codepage=", 9)) { - if ((strlen(szTemp) - 10) == 4) { - nCodePage = (szTemp[9] - '0') * 1000; - nCodePage += (szTemp[10] - '0') * 100; - nCodePage += (szTemp[11] - '0') * 10; - nCodePage += (szTemp[12] - '0'); - } - if ((strlen(szTemp) - 10) == 3) { - nCodePage = (szTemp[9] - '0') * 100; - nCodePage += (szTemp[10] - '0') * 10; - nCodePage += (szTemp[11] - '0'); - } - continue; - } - - // Get rid of the linefeed at the end - int nLen = strlen(szTemp); - if (szTemp[nLen - 1] == 10) { - szTemp[nLen - 1] = 0; - nLen--; - } - - MultiByteToWideChar(nCodePage, 0, szTemp, -1, szLine, sizeof(szLine) / sizeof(TCHAR)); - - TCHAR *Tokens; - - // Read the file into arrays - Tokens = _tcstok(szLine, _T("\t")); - while (Tokens != NULL) { - if (nTokenPos == 0) { - wcscpy(szShortNamesArray[nArrayPos], Tokens); -// szShortNamesArray[nArrayPos][_tcslen(Tokens)] = _T('\0'); - } - - if (nTokenPos == 1) { - wcscpy(szLongNamesArray[nArrayPos], Tokens); -// szLongNamesArray[nArrayPos][_tcslen(Tokens)] = _T('\0'); - } - - Tokens = _tcstok(NULL, _T("\t")); - nTokenPos++; - } - - nTokenPos = 0; - nArrayPos++; - } - nNumGames = nArrayPos; - - for (int i = 0; i < nNumGames; i++) { - BurnLocalisationSetName(TCHARToANSI(szShortNamesArray[i], NULL, 0), szLongNamesArray[i]); - } - - // tidy up - for (int i = 0; i < MAX_LST_GAMES; i++) { - if (szShortNamesArray[i]) { - free(szShortNamesArray[i]); - szShortNamesArray[i] = NULL; - } - } - - fclose(fp); - } -} - -static void BurnerGameListCreateTemplate() -{ - unsigned int nOldDrvSelect = nBurnDrvActive; - - FILE* fp = _tfopen(szGamelistLocalisationTemplate, _T("wt")); - if (fp) { - _ftprintf(fp, _T("// game list translation template for FB Alpha version 0x%06X\n\n"), nBurnVer); - _ftprintf(fp, _T("// codepage=1252\n\n")); - - for (unsigned int i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - _ftprintf(fp, _T("%s\t%s\n"), BurnDrvGetText(DRV_NAME), BurnDrvGetText(DRV_ASCIIONLY | DRV_FULLNAME)); - } - - fclose(fp); - } - - nBurnDrvActive = nOldDrvSelect; -} - -void BurnerExitGameListLocalisation() -{ - for (int i = 0; i < MAX_LST_GAMES; i++) { - if (szLongNamesArray[i]) { - free(szLongNamesArray[i]); - szLongNamesArray[i] = NULL; - } - } - - nCodePage = CP_ACP; -} - -// ---------------------------------------------------------------------------- -// Dialog box to load/save a template - -static TCHAR szFilter[100]; - -static void MakeOfn() -{ - _stprintf(szFilter, _T("%s"), FBALoadStringEx(hAppInst, IDS_LOCAL_GL_FILTER, true)); - memcpy(szFilter + _tcslen(szFilter), _T(" (*.glt)\0*.glt\0\0"), 16 * sizeof(TCHAR)); - - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hScrnWnd; - ofn.lpstrFilter = szFilter; - ofn.lpstrFile = szGamelistLocalisationTemplate; - ofn.nMaxFile = sizeof(szGamelistLocalisationTemplate) / sizeof(TCHAR); - ofn.lpstrInitialDir = _T(".\\config\\localisation"); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("glt"); - - return; -} - -int FBALocaliseGamelistLoadTemplate() -{ - _stprintf(szGamelistLocalisationTemplate, _T("template")); - MakeOfn(); - TCHAR szTitle[100]; - _stprintf(szTitle, _T("%s"), FBALoadStringEx(hAppInst, IDS_LOCAL_GL_SELECT, true)); - ofn.lpstrTitle = szTitle; - ofn.Flags |= OFN_OVERWRITEPROMPT; - - int bOldPause = bRunPause; - bRunPause = 1; - int nRet = GetOpenFileName(&ofn); - bRunPause = bOldPause; - - if (nRet == 0) { - return 1; - } - - nGamelistLocalisationActive = true; - BurnerDoGameListLocalisation(); - - return 0; -} - -int FBALocaliseGamelistCreateTemplate() -{ - _stprintf(szGamelistLocalisationTemplate, _T("template")); - MakeOfn(); - TCHAR szTitle[100]; - _stprintf(szTitle, _T("%s"), FBALoadStringEx(hAppInst, IDS_LOCAL_GL_CREATE, true)); - ofn.lpstrTitle = szTitle; - ofn.Flags |= OFN_OVERWRITEPROMPT; - - int bOldPause = bRunPause; - bRunPause = 1; - int nRet = GetSaveFileName(&ofn); - bRunPause = bOldPause; - - if (nRet == 0) { - return 1; - } - - BurnerGameListCreateTemplate(); - - return 0; -} diff --git a/jan/src/burner/win32/main.cpp b/jan/src/burner/win32/main.cpp deleted file mode 100644 index 8133c1b3c..000000000 --- a/jan/src/burner/win32/main.cpp +++ /dev/null @@ -1,1039 +0,0 @@ -// FB Alpha - Emulator for MC68000/Z80 based arcade games -// Refer to the "license.txt" file for more info - -// Main module - -// #define USE_SDL // define if SDL is used -// #define DONT_DISPLAY_SPLASH // Prevent Splash screen from being displayed -#define APP_DEBUG_LOG // log debug messages to zzBurnDebug.html - -#ifdef USE_SDL - #include "SDL.h" -#endif - -#include "burner.h" - -#ifdef _MSC_VER -// #include - #ifdef _DEBUG - #include - #endif -#endif - -#include "version.h" - -HINSTANCE hAppInst = NULL; // Application Instance -HANDLE hMainThread; -long int nMainThreadID; -int nAppThreadPriority = THREAD_PRIORITY_NORMAL; -int nAppShowCmd; - -static TCHAR szCmdLine[1024] = _T(""); - -HACCEL hAccel = NULL; - -int nAppVirtualFps = 6000; // App fps * 100 - -TCHAR szAppBurnVer[16] = _T(""); -TCHAR szAppExeName[EXE_NAME_SIZE + 1]; - -bool bCmdOptUsed = 0; -bool bAlwaysProcessKeyboardInput = false; -bool bAlwaysCreateSupportFolders = true; - -bool bQuietLoading = false; - -bool bNoChangeNumLock = 1; -static bool bNumlockStatus; - -bool bMonitorAutoCheck = true; - -// Used for the load/save dialog in commdlg.h (savestates, input replay, wave logging) -TCHAR szChoice[MAX_PATH] = _T(""); -OPENFILENAME ofn; - -#if defined (UNICODE) -char* TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int nOutSize) -{ - - static char szStringBuffer[1024]; - memset(szStringBuffer, 0, sizeof(szStringBuffer)); - - char* pszBuffer = pszOutString ? pszOutString : szStringBuffer; - int nBufferSize = pszOutString ? nOutSize * 2 : sizeof(szStringBuffer); - - if (WideCharToMultiByte(CP_ACP, 0, pszInString, -1, pszBuffer, nBufferSize, NULL, NULL)) { - return pszBuffer; - } - - return NULL; -} - -TCHAR* ANSIToTCHAR(const char* pszInString, TCHAR* pszOutString, int nOutSize) -{ - static TCHAR szStringBuffer[1024]; - - TCHAR* pszBuffer = pszOutString ? pszOutString : szStringBuffer; - int nBufferSize = pszOutString ? nOutSize * 2 : sizeof(szStringBuffer); - - if (MultiByteToWideChar(CP_ACP, 0, pszInString, -1, pszBuffer, nBufferSize)) { - return pszBuffer; - } - - return NULL; -} -#else -char* TCHARToANSI(const TCHAR* pszInString, char* pszOutString, int /*nOutSize*/) -{ - if (pszOutString) { - strcpy(pszOutString, pszInString); - return pszOutString; - } - - return (char*)pszInString; -} - -TCHAR* ANSIToTCHAR(const char* pszInString, TCHAR* pszOutString, int /*nOutSize*/) -{ - if (pszOutString) { - _tcscpy(pszOutString, pszInString); - return pszOutString; - } - - return (TCHAR*)pszInString; -} -#endif - -CHAR *astring_from_utf8(const char *utf8string) -{ - WCHAR *wstring; - int char_count; - CHAR *result; - - // convert MAME string (UTF-8) to UTF-16 - char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); - wstring = (WCHAR *)malloc(char_count * sizeof(*wstring)); - MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, wstring, char_count); - - // convert UTF-16 to "ANSI code page" string - char_count = WideCharToMultiByte(CP_ACP, 0, wstring, -1, NULL, 0, NULL, NULL); - result = (CHAR *)malloc(char_count * sizeof(*result)); - if (result != NULL) - WideCharToMultiByte(CP_ACP, 0, wstring, -1, result, char_count, NULL, NULL); - - if (wstring) { - free(wstring); - wstring = NULL; - } - return result; -} - -char *utf8_from_astring(const CHAR *astring) -{ - WCHAR *wstring; - int char_count; - CHAR *result; - - // convert "ANSI code page" string to UTF-16 - char_count = MultiByteToWideChar(CP_ACP, 0, astring, -1, NULL, 0); - wstring = (WCHAR *)malloc(char_count * sizeof(*wstring)); - MultiByteToWideChar(CP_ACP, 0, astring, -1, wstring, char_count); - - // convert UTF-16 to MAME string (UTF-8) - char_count = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, NULL, 0, NULL, NULL); - result = (CHAR *)malloc(char_count * sizeof(*result)); - if (result != NULL) - WideCharToMultiByte(CP_UTF8, 0, wstring, -1, result, char_count, NULL, NULL); - - if (wstring) { - free(wstring); - wstring = NULL; - } - return result; -} - -WCHAR *wstring_from_utf8(const char *utf8string) -{ - int char_count; - WCHAR *result; - - // convert MAME string (UTF-8) to UTF-16 - char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); - result = (WCHAR *)malloc(char_count * sizeof(*result)); - if (result != NULL) - MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count); - - return result; -} - -char *utf8_from_wstring(const WCHAR *wstring) -{ - int char_count; - char *result; - - // convert UTF-16 to MAME string (UTF-8) - char_count = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, NULL, 0, NULL, NULL); - result = (char *)malloc(char_count * sizeof(*result)); - if (result != NULL) - WideCharToMultiByte(CP_UTF8, 0, wstring, -1, result, char_count, NULL, NULL); - - return result; -} - -#if defined (FBA_DEBUG) - static TCHAR szConsoleBuffer[1024]; - static int nPrevConsoleStatus = -1; - - static HANDLE DebugBuffer; - static FILE *DebugLog = NULL; - static bool bEchoLog = true; // false; -#endif - -void tcharstrreplace(TCHAR *pszSRBuffer, const TCHAR *pszFind, const TCHAR *pszReplace) -{ - if (pszSRBuffer == NULL || pszFind == NULL || pszReplace == NULL) - return; - - int lenFind = _tcslen(pszFind); - int lenReplace = _tcslen(pszReplace); - int lenSRBuffer = _tcslen(pszSRBuffer)+1; - - for(int i = 0; (lenSRBuffer > lenFind) && (i < lenSRBuffer - lenFind); i++) { - if (!memcmp(pszFind, &pszSRBuffer[i], lenFind * sizeof(TCHAR))) { - if (lenFind == lenReplace) { - memcpy(&pszSRBuffer[i], pszReplace, lenReplace * sizeof(TCHAR)); - i += lenReplace - 1; - } else if (lenFind > lenReplace) { - memcpy(&pszSRBuffer[i], pszReplace, lenReplace * sizeof(TCHAR)); - i += lenReplace; - int delta = lenFind - lenReplace; - lenSRBuffer -= delta; - memmove(&pszSRBuffer[i], &pszSRBuffer[i + delta], (lenSRBuffer - i) * sizeof(TCHAR)); - i--; - } else { /* this part only works on dynamic buffers - the replacement string length must be smaller or equal to the find string length if this is commented out! - int delta = lenReplace - lenFind; - pszSRBuffer = (TCHAR *)realloc(pszSRBuffer, (lenSRBuffer + delta) * sizeof(TCHAR)); - memmove(&pszSRBuffer[i + lenReplace], &pszSRBuffer[i + lenFind], (lenSRBuffer - i - lenFind) * sizeof(TCHAR)); - lenSRBuffer += delta; - memcpy(&pszSRBuffer[i], pszReplace, lenReplace * sizeof(TCHAR)); - i += lenReplace - 1; */ - } - } - } -} - -#if defined (FBA_DEBUG) -// Debug printf to a file -static int __cdecl AppDebugPrintf(int nStatus, TCHAR* pszFormat, ...) -{ - va_list vaFormat; - - va_start(vaFormat, pszFormat); - - if (DebugLog) { - - if (nStatus != nPrevConsoleStatus) { - switch (nStatus) { - case PRINT_ERROR: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_IMPORTANT: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL1: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL2: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL3: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL4: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL5: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL6: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL7: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL8: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL9: - _ftprintf(DebugLog, _T("
")); - break; - case PRINT_LEVEL10: - _ftprintf(DebugLog, _T("
")); - break; - default: - _ftprintf(DebugLog, _T("
")); - } - } - _vftprintf(DebugLog, pszFormat, vaFormat); - fflush(DebugLog); - } - - if (!DebugLog || bEchoLog) { - _vsntprintf(szConsoleBuffer, 1024, pszFormat, vaFormat); - - if (nStatus != nPrevConsoleStatus) { - switch (nStatus) { - case PRINT_UI: - SetConsoleTextAttribute(DebugBuffer, FOREGROUND_INTENSITY); - break; - case PRINT_IMPORTANT: - case PRINT_LEVEL1: - case PRINT_LEVEL2: - case PRINT_LEVEL3: - case PRINT_LEVEL4: - case PRINT_LEVEL5: - case PRINT_LEVEL6: - case PRINT_LEVEL7: - case PRINT_LEVEL8: - case PRINT_LEVEL9: - case PRINT_LEVEL10: - SetConsoleTextAttribute(DebugBuffer, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY); - break; - case PRINT_ERROR: - SetConsoleTextAttribute(DebugBuffer, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY); - break; - default: - SetConsoleTextAttribute(DebugBuffer, FOREGROUND_GREEN | FOREGROUND_INTENSITY); - } - } - - tcharstrreplace(szConsoleBuffer, _T(SEPERATOR_1), _T(" * ")); - WriteConsole(DebugBuffer, szConsoleBuffer, _tcslen(szConsoleBuffer), NULL, NULL); - } - - nPrevConsoleStatus = nStatus; - - va_end(vaFormat); - - return 0; -} -#endif - -int dprintf(TCHAR* pszFormat, ...) -{ -#if defined (FBA_DEBUG) - va_list vaFormat; - va_start(vaFormat, pszFormat); - - _vsntprintf(szConsoleBuffer, 1024, pszFormat, vaFormat); - - if (nPrevConsoleStatus != PRINT_UI) { - if (DebugLog) { - _ftprintf(DebugLog, _T("
")); - } - SetConsoleTextAttribute(DebugBuffer, FOREGROUND_INTENSITY); - nPrevConsoleStatus = PRINT_UI; - } - - if (DebugLog) { - _ftprintf(DebugLog, szConsoleBuffer); - fflush(DebugLog); - } - - tcharstrreplace(szConsoleBuffer, _T(SEPERATOR_1), _T(" * ")); - WriteConsole(DebugBuffer, szConsoleBuffer, _tcslen(szConsoleBuffer), NULL, NULL); - va_end(vaFormat); -#else - (void)pszFormat; -#endif - - return 0; -} - -void CloseDebugLog() -{ -#if defined (FBA_DEBUG) - if (DebugLog) { - - _ftprintf(DebugLog, _T("")); - - fclose(DebugLog); - DebugLog = NULL; - } - - if (DebugBuffer) { - CloseHandle(DebugBuffer); - DebugBuffer = NULL; - } - - FreeConsole(); -#endif -} - -int OpenDebugLog() -{ -#if defined (FBA_DEBUG) - #if defined (APP_DEBUG_LOG) - - time_t nTime; - tm* tmTime; - - time(&nTime); - tmTime = localtime(&nTime); - - { - // Initialise the debug log file - - #ifdef _UNICODE - DebugLog = _tfopen(_T("zzBurnDebug.html"), _T("wb")); - - if (ftell(DebugLog) == 0) { - WRITE_UNICODE_BOM(DebugLog); - - _ftprintf(DebugLog, _T("")); - _ftprintf(DebugLog, _T("")); - _ftprintf(DebugLog, _T("")); - _ftprintf(DebugLog, _T("
"));
-		}
-  #else
-		DebugLog = _tfopen(_T("zzBurnDebug.html"), _T("wt"));
-
-		if (ftell(DebugLog) == 0) {
-			_ftprintf(DebugLog, _T(""));
-			_ftprintf(DebugLog, _T("
"), GetACP());
-		}
-  #endif
-
-		_ftprintf(DebugLog, _T("
")); - _ftprintf(DebugLog, _T("Debug log created by ") _T(APP_TITLE) _T(" v%.20s on %s"), szAppBurnVer, _tasctime(tmTime)); - - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - _ftprintf(DebugLog, _T("
 ")); - } - #endif - - { - // Initialise the debug console - - COORD DebugBufferSize = { 80, 1000 }; - - { - - // Since AttachConsole is only present in Windows XP, import it manually - -#if _WIN32_WINNT >= 0x0500 && defined (_MSC_VER) -// #error Manually importing AttachConsole() function, but compiling with _WIN32_WINNT >= 0x0500 - if (!AttachConsole(ATTACH_PARENT_PROCESS)) { - AllocConsole(); - } -#else - #define ATTACH_PARENT_PROCESS ((DWORD)-1) - - BOOL (WINAPI* pAttachConsole)(DWORD dwProcessId) = NULL; - HINSTANCE hKernel32DLL = LoadLibrary(_T("kernel32.dll")); - - if (hKernel32DLL) { - pAttachConsole = (BOOL (WINAPI*)(DWORD))GetProcAddress(hKernel32DLL, "AttachConsole"); - } - if (pAttachConsole) { - if (!pAttachConsole(ATTACH_PARENT_PROCESS)) { - AllocConsole(); - } - } else { - AllocConsole(); - } - if (hKernel32DLL) { - FreeLibrary(hKernel32DLL); - } - - #undef ATTACH_PARENT_PROCESS -#endif - - } - - DebugBuffer = CreateConsoleScreenBuffer(GENERIC_WRITE, FILE_SHARE_READ, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - SetConsoleScreenBufferSize(DebugBuffer, DebugBufferSize); - SetConsoleActiveScreenBuffer(DebugBuffer); - SetConsoleTitle(_T(APP_TITLE) _T(" Debug console")); - - SetConsoleTextAttribute(DebugBuffer, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY); - _sntprintf(szConsoleBuffer, 1024, _T("Welcome to the ") _T(APP_TITLE) _T(" debug console.\n")); - WriteConsole(DebugBuffer, szConsoleBuffer, _tcslen(szConsoleBuffer), NULL, NULL); - - SetConsoleTextAttribute(DebugBuffer, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); - if (DebugLog) { - _sntprintf(szConsoleBuffer, 1024, _T("Debug messages are logged in zzBurnDebug.html")); - if (!DebugLog || bEchoLog) { - _sntprintf(szConsoleBuffer + _tcslen(szConsoleBuffer), 1024 - _tcslen(szConsoleBuffer), _T(", and echod to this console")); - } - _sntprintf(szConsoleBuffer + _tcslen(szConsoleBuffer), 1024 - _tcslen(szConsoleBuffer), _T(".\n\n")); - } else { - _sntprintf(szConsoleBuffer, 1024, _T("Debug messages are echod to this console.\n\n")); - } - WriteConsole(DebugBuffer, szConsoleBuffer, _tcslen(szConsoleBuffer), NULL, NULL); - } - - nPrevConsoleStatus = -1; - - bprintf = AppDebugPrintf; // Redirect Burn library debug to our function -#endif - - return 0; -} - -void MonitorAutoCheck() -{ - RECT rect; - int x, y; - - SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0); - - x = GetSystemMetrics(SM_CXSCREEN); - y = GetSystemMetrics(SM_CYSCREEN); - - // default full-screen resolution to this size - nVidHorWidth = x; - nVidHorHeight = y; - nVidVerWidth = x; - nVidVerHeight = y; - - // also add this to the presets - VidPreset[3].nWidth = x; - VidPreset[3].nHeight = y; - VidPresetVer[3].nWidth = x; - VidPresetVer[3].nHeight = y; - - TCHAR szResXY[256] = _T(""); - _stprintf(szResXY, _T("%dx%d"), x, y); - - // Normal CRT (4:3) ( Verified at Wikipedia.Org ) - if( !_tcscmp(szResXY, _T("320x240")) || - !_tcscmp(szResXY, _T("512x384")) || - !_tcscmp(szResXY, _T("640x480")) || - !_tcscmp(szResXY, _T("800x600")) || - !_tcscmp(szResXY, _T("832x624")) || - !_tcscmp(szResXY, _T("1024x768")) || - !_tcscmp(szResXY, _T("1120x832")) || - !_tcscmp(szResXY, _T("1152x864")) || - !_tcscmp(szResXY, _T("1280x960")) || - !_tcscmp(szResXY, _T("1280x1024")) || - !_tcscmp(szResXY, _T("1400x1050")) || - !_tcscmp(szResXY, _T("1600x1200")) || - !_tcscmp(szResXY, _T("2048x1536")) || - !_tcscmp(szResXY, _T("2800x2100")) || - !_tcscmp(szResXY, _T("3200x2400")) || - !_tcscmp(szResXY, _T("4096x3072")) || - !_tcscmp(szResXY, _T("6400x4800")) ){ - nVidScrnAspectX = 4; - nVidScrnAspectY = 3; - } - - // Normal LCD (5:4) ( Verified at Wikipedia.Org ) - if( !_tcscmp(szResXY, _T("320x256")) || - !_tcscmp(szResXY, _T("640x512")) || - !_tcscmp(szResXY, _T("1280x1024")) || - !_tcscmp(szResXY, _T("2560x2048")) || - !_tcscmp(szResXY, _T("5120x4096")) ){ - nVidScrnAspectX = 5; - nVidScrnAspectY = 4; - } - - // CRT Widescreen (16:9) ( Verified at Wikipedia.Org ) - if( !_tcscmp(szResXY, _T("480x270")) || - !_tcscmp(szResXY, _T("1280x720")) || - !_tcscmp(szResXY, _T("1360x768")) || - !_tcscmp(szResXY, _T("1366x768")) || - !_tcscmp(szResXY, _T("1920x1080"))) { - nVidScrnAspectX = 16; - nVidScrnAspectY = 9; - } - - // LCD Widescreen (16:10) ( Verified at Wikipedia.Org ) - if( !_tcscmp(szResXY, _T("320x200")) || - !_tcscmp(szResXY, _T("1280x800")) || - !_tcscmp(szResXY, _T("1440x900")) || - !_tcscmp(szResXY, _T("1680x1050")) || - !_tcscmp(szResXY, _T("1920x1200")) || - !_tcscmp(szResXY, _T("2560x1600")) || - !_tcscmp(szResXY, _T("3840x2400")) || - !_tcscmp(szResXY, _T("5120x3200")) || - !_tcscmp(szResXY, _T("7680x4800")) ){ - nVidScrnAspectX = 16; - nVidScrnAspectY = 10; - } -} - -bool SetNumLock(bool bState) -{ - BYTE keyState[256]; - - if (bNoChangeNumLock) return 0; - - GetKeyboardState(keyState); - if ((bState && !(keyState[VK_NUMLOCK] & 1)) || (!bState && (keyState[VK_NUMLOCK] & 1))) { - keybd_event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY, 0 ); - - keybd_event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); - } - - return keyState[VK_NUMLOCK] & 1; -} - -#include - -static int AppInit() -{ -#if defined (_MSC_VER) && defined (_DEBUG) - _CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF); // Check for memory corruption - _CrtSetDbgFlag(_CRTDBG_DELAY_FREE_MEM_DF); // - _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF); // -#endif - -#if defined (FBA_DEBUG) - OpenDebugLog(); -#endif - - // Create a handle to the main thread of execution - DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, 0, false, DUPLICATE_SAME_ACCESS); - - // Init the Burn library - BurnLibInit(); - - // Load config for the application - ConfigAppLoad(); - - FBALocaliseInit(szLocalisationTemplate); - BurnerDoGameListLocalisation(); - - if (bMonitorAutoCheck) MonitorAutoCheck(); - -#if 1 || !defined (FBA_DEBUG) - // print a warning if we're running for the 1st time - if (nIniVersion < nBurnVer) { - ScrnInit(); - //SplashDestroy(1); - FirstUsageCreate(); - - ConfigAppSave(); // Create initial config file - } -#endif - - // Set the thread priority for the main thread - SetThreadPriority(GetCurrentThread(), nAppThreadPriority); - - bCheatsAllowed = true; - -#ifdef USE_SDL - SDL_Init(0); -#endif - - ComputeGammaLUT(); - - if (VidSelect(nVidSelect)) { - nVidSelect = 0; - VidSelect(nVidSelect); - } - - hAccel = LoadAccelerators(hAppInst, MAKEINTRESOURCE(IDR_ACCELERATOR)); - - // Build the ROM information - CreateROMInfo(NULL); - - // Write a clrmame dat file if we are verifying roms -#if defined (ROM_VERIFY) - create_datfile(_T("fba.dat"), 0); -#endif - - bNumlockStatus = SetNumLock(false); - - if(bEnableIcons && !bIconsLoaded) { - // load driver icons - LoadDrvIcons(); - bIconsLoaded = 1; - } - - return 0; -} - -static int AppExit() -{ - if(bIconsLoaded) { - // unload driver icons - UnloadDrvIcons(); - bIconsLoaded = 0; - } - - SetNumLock(bNumlockStatus); - - DrvExit(); // Make sure any game driver is exitted - FreeROMInfo(); - MediaExit(); - BurnLibExit(); // Exit the Burn library - - DisableHighResolutionTiming(); - -#ifdef USE_SDL - SDL_Quit(); -#endif - - FBALocaliseExit(); - BurnerExitGameListLocalisation(); - - if (hAccel) { - DestroyAcceleratorTable(hAccel); - hAccel = NULL; - } - - SplashDestroy(1); - - CloseHandle(hMainThread); - - CloseDebugLog(); - - return 0; -} - -void AppCleanup() -{ - StopReplay(); - WaveLogStop(); - - AppExit(); -} - -int AppMessage(MSG *pMsg) -{ - if (IsDialogMessage(hInpdDlg, pMsg)) return 0; - if (IsDialogMessage(hInpCheatDlg, pMsg)) return 0; - if (IsDialogMessage(hInpDIPSWDlg, pMsg)) return 0; - if (IsDialogMessage(hDbgDlg, pMsg)) return 0; - - if (IsDialogMessage(hInpsDlg, pMsg)) return 0; - if (IsDialogMessage(hInpcDlg, pMsg)) return 0; - - return 1; // Didn't process this message -} - -bool AppProcessKeyboardInput() -{ - if (hwndChat) { - return false; - } - - return true; -} - -int ProcessCmdLine() -{ - unsigned int i; - int nOptX = 0, nOptY = 0, nOptD = 0; - int nOpt1Size; - TCHAR szOpt2[3] = _T(""); - TCHAR szName[MAX_PATH]; - - if (szCmdLine[0] == _T('\"')) { - int nLen = _tcslen(szCmdLine); - nOpt1Size = 1; - while (szCmdLine[nOpt1Size] != _T('\"') && nOpt1Size < nLen) { - nOpt1Size++; - } - if (nOpt1Size == nLen) { - szName[0] = 0; - } else { - nOpt1Size++; - _tcsncpy(szName, szCmdLine + 1, nOpt1Size - 2); - szName[nOpt1Size - 2] = 0; - } - } else { - int nLen = _tcslen(szCmdLine); - nOpt1Size = 0; - while (szCmdLine[nOpt1Size] != _T(' ') && nOpt1Size < nLen) { - nOpt1Size++; - } - _tcsncpy(szName, szCmdLine, nOpt1Size); - szName[nOpt1Size] = 0; - } - - if (_tcslen(szName)) { - if (_tcscmp(szName, _T("-listinfo")) == 0) { - write_datfile(DAT_ARCADE_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listinfomdonly")) == 0) { - write_datfile(DAT_MEGADRIVE_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listinfopceonly")) == 0) { - write_datfile(DAT_PCENGINE_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listinfotg16only")) == 0) { - write_datfile(DAT_TG16_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listinfosgxonly")) == 0) { - write_datfile(DAT_SGX_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listinfosg1000only")) == 0) { - write_datfile(DAT_SG1000_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listinfocolecoonly")) == 0) { - write_datfile(DAT_COLECO_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listinfosmsonly")) == 0) { - write_datfile(DAT_MASTERSYSTEM_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listinfoggonly")) == 0) { - write_datfile(DAT_GAMEGEAR_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listinfomsxonly")) == 0) { - write_datfile(DAT_MSX_ONLY, stdout); - return 1; - } - - if (_tcscmp(szName, _T("-listextrainfo")) == 0) { - int nWidth; - int nHeight; - int nAspectX; - int nAspectY; - for (i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - BurnDrvGetVisibleSize(&nWidth, &nHeight); - BurnDrvGetAspect(&nAspectX, &nAspectY); - printf("%s\t%ix%i\t%i:%i\t0x%08X\t\"%s\"\t%i\t%i\t%x\t%x\t\"%s\"\n", BurnDrvGetTextA(DRV_NAME), nWidth, nHeight, nAspectX, nAspectY, BurnDrvGetHardwareCode(), BurnDrvGetTextA(DRV_SYSTEM), BurnDrvIsWorking(), BurnDrvGetMaxPlayers(), BurnDrvGetGenreFlags(), BurnDrvGetFamilyFlags(), BurnDrvGetTextA(DRV_COMMENT)); - } - return 1; - } - } - - _stscanf(&szCmdLine[nOpt1Size], _T("%2s %i x %i x %i"), szOpt2, &nOptX, &nOptY, &nOptD); - - if (_tcslen(szName)) { - bool bFullscreen = 1; - bCmdOptUsed = 1; - - if (_tcscmp(szOpt2, _T("-r")) == 0) { - if (nOptX && nOptY) { - nVidWidth = nOptX; - nVidHeight = nOptY; - } - if (nOptD) { - nVidDepth = nOptD; - } - } else { - if (_tcscmp(szOpt2, _T("-a")) == 0) { - bVidArcaderes = 1; - } else { - if (_tcscmp(szOpt2, _T("-w")) == 0) { - bCmdOptUsed = 0; - bFullscreen = 0; - } - } - } - - if (bFullscreen) { - nVidFullscreen = 1; - } - - if (_tcscmp(&szName[_tcslen(szName) - 3], _T(".fs")) == 0) { - if (BurnStateLoad(szName, 1, &DrvInitCallback)) { - return 1; - } else { -// bRunPause = 1; - } - } else { - if (_tcscmp(&szName[_tcslen(szName) - 3], _T(".fr")) == 0) { - if (StartReplay(szName)) { - return 1; - } - } else { - bQuietLoading = true; - - for (i = 0; i < nBurnDrvCount; i++) { - nBurnDrvActive = i; - if ((_tcscmp(BurnDrvGetText(DRV_NAME), szName) == 0) && (!(BurnDrvGetFlags() & BDF_BOARDROM))){ - if (DrvInit(i, true)) { // failed (bad romset, etc.) - nVidFullscreen = 0; // Don't get stuck in fullscreen mode - } - break; - } - } - - bQuietLoading = false; - - if (i == nBurnDrvCount) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_NOSUPPORT), szName, _T(APP_TITLE)); - FBAPopupDisplay(PUF_TYPE_ERROR); - return 1; - } - } - } - } - - POST_INITIALISE_MESSAGE; - - if (!nVidFullscreen) { - MenuEnableItems(); - } - - return 0; -} - -static void CreateSupportFolders() -{ - TCHAR szSupportDirs[32][MAX_PATH] = { - {_T("support/")}, - {_T("support/previews/")}, - {_T("support/titles/")}, - {_T("support/icons/")}, - {_T("support/cheats/")}, - {_T("support/hiscores/")}, - {_T("support/samples/")}, - {_T("support/ips/")}, - {_T("support/neocdz/")}, - {_T("support/blend/")}, - {_T("support/select/")}, - {_T("support/versus/")}, - {_T("support/howto/")}, - {_T("support/scores/")}, - {_T("support/bosses/")}, - {_T("support/gameover/")}, - {_T("support/flyers/")}, - {_T("support/marquees/")}, - {_T("support/cpanel/")}, - {_T("support/cabinets/")}, - {_T("support/pcbs/")}, - {_T("support/history/")}, - {_T("neocdiso/")}, - // the below are named after the MESS software lists - {_T("megadriv/")}, - {_T("pce/")}, - {_T("sgx/")}, - {_T("tg16/")}, - {_T("sg1000/")}, - {_T("coleco/")}, - {_T("sms/")}, - {_T("gamegear/")}, - {_T("msx/")}, - }; - - for(int x = 0; x < 32; x++) { - CreateDirectory(szSupportDirs[x], NULL); - } -} - -// Main program entry point -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nShowCmd) -{ - DSCore_Init(); - DICore_Init(); - DDCore_Init(); - Dx9Core_Init(); - - // Provide a custom exception handler - SetUnhandledExceptionFilter(ExceptionFilter); - - hAppInst = hInstance; - - // Make version string - if (nBurnVer & 0xFF) { - // private version (alpha) - _stprintf(szAppBurnVer, _T("%x.%x.%x.%02x"), nBurnVer >> 20, (nBurnVer >> 16) & 0x0F, (nBurnVer >> 8) & 0xFF, nBurnVer & 0xFF); - } else { - // public version - _stprintf(szAppBurnVer, _T("%x.%x.%x"), nBurnVer >> 20, (nBurnVer >> 16) & 0x0F, (nBurnVer >> 8) & 0xFF); - } - -#if !defined (DONT_DISPLAY_SPLASH) -// if (lpCmdLine[0] == 0) SplashCreate(); -#endif - - nAppShowCmd = nShowCmd; - - AppDirectory(); // Set current directory to be the applications directory - -#ifdef INCLUDE_AVI_RECORDING -#define DIRCNT 10 -#else -#define DIRCNT 9 -#endif - // Make sure there are roms and cfg subdirectories - TCHAR szDirs[DIRCNT][MAX_PATH] = { - {_T("config")}, - {_T("config/games")}, - {_T("config/ips")}, - {_T("config/localisation")}, - {_T("config/presets")}, - {_T("recordings")}, - {_T("roms")}, - {_T("savestates")}, - {_T("screenshots")}, -#ifdef INCLUDE_AVI_RECORDING - {_T("avi")}, -#endif - }; - - for(int x = 0; x < DIRCNT; x++) { - CreateDirectory(szDirs[x], NULL); - } -#undef DIRCNT - - // - - { - INITCOMMONCONTROLSEX initCC = { - sizeof(INITCOMMONCONTROLSEX), - ICC_BAR_CLASSES | ICC_COOL_CLASSES | ICC_LISTVIEW_CLASSES | ICC_PROGRESS_CLASS | ICC_TREEVIEW_CLASSES, - }; - InitCommonControlsEx(&initCC); - } - - if (lpCmdLine) { - _tcscpy(szCmdLine, ANSIToTCHAR(lpCmdLine, NULL, 0)); - } - - if (!(AppInit())) { // Init the application - if (bAlwaysCreateSupportFolders) CreateSupportFolders(); - if (!(ProcessCmdLine())) { - DetectWindowsVersion(); - EnableHighResolutionTiming(); - - MediaInit(); - - RunMessageLoop(); // Run the application message loop - } - } - - ConfigAppSave(); // Save config for the application - - AppExit(); // Exit the application - - return 0; -} diff --git a/jan/src/burner/win32/media.cpp b/jan/src/burner/win32/media.cpp deleted file mode 100644 index 173b14301..000000000 --- a/jan/src/burner/win32/media.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// Media module -#include "burner.h" - -int MediaInit() -{ - if (ScrnInit()) { // Init the Scrn Window - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_WINDOW)); - FBAPopupDisplay(PUF_TYPE_ERROR); - return 1; - } - - if (!bInputOkay) { - InputInit(); // Init Input - } - - nAppVirtualFps = nBurnFPS; - - if (!bAudOkay) { - AudSoundInit(); // Init Sound (not critical if it fails) - } - - nBurnSoundRate = 0; // Assume no sound - pBurnSoundOut = NULL; - if (bAudOkay) { - nBurnSoundRate = nAudSampleRate[nAudSelect]; - nBurnSoundLen = nAudSegLen; - } - - if (!bVidOkay) { - - // Reinit the video plugin - VidInit(); - if (!bVidOkay && nVidFullscreen) { - - nVidFullscreen = 0; - - MediaExit(); - return (MediaInit()); - } - if (!nVidFullscreen) { - ScrnSize(); - } - - if (!bVidOkay) { - // Make sure the error will be visible - SplashDestroy(1); - - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_VID_MODULE), VidGetModuleName()); - FBAPopupDisplay(PUF_TYPE_ERROR); - } - - if (bVidOkay && ((bRunPause && bAltPause) || !bDrvOkay)) { - VidRedraw(); - } - } - - return 0; -} - -int MediaExit() -{ - nBurnSoundRate = 0; // Blank sound - pBurnSoundOut = NULL; - - AudSoundExit(); // Exit Dsound - - VidExit(); - - InputExit(); - - DestroyWindow(hInpsDlg); // Make sure the Input Set dialog is exitted - DestroyWindow(hInpdDlg); // Make sure the Input Dialog is exitted - - ScrnExit(); // Exit the Scrn Window - - return 0; -} diff --git a/jan/src/burner/win32/memcard.cpp b/jan/src/burner/win32/memcard.cpp deleted file mode 100644 index c3ef13514..000000000 --- a/jan/src/burner/win32/memcard.cpp +++ /dev/null @@ -1,309 +0,0 @@ -// Memory card support module - -#include "burner.h" - -static TCHAR szMemoryCardFile[MAX_PATH]; - -int nMemoryCardStatus = 0; -int nMemoryCardSize; - -static int nMinVersion; -static bool bMemCardFC1Format; - -static int MakeOfn() -{ - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hScrnWnd; - ofn.lpstrFile = szMemoryCardFile; - ofn.nMaxFile = sizeof(szMemoryCardFile); - ofn.lpstrInitialDir = _T("."); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("fc"); - - return 0; -} - -static int MemCardRead(TCHAR* szFilename, unsigned char* pData, int nSize) -{ - const char* szHeader = "FB1 FC1 "; // File + chunk identifier - char szReadHeader[8] = ""; - - bMemCardFC1Format = false; - - FILE* fp = _tfopen(szFilename, _T("rb")); - if (fp == NULL) { - return 1; - } - - fread(szReadHeader, 1, 8, fp); // Read identifiers - if (memcmp(szReadHeader, szHeader, 8) == 0) { - - // FB Alpha memory card file - - int nChunkSize = 0; - int nVersion = 0; - - bMemCardFC1Format = true; - - fread(&nChunkSize, 1, 4, fp); // Read chunk size - if (nSize < nChunkSize - 32) { - fclose(fp); - return 1; - } - - fread(&nVersion, 1, 4, fp); // Read version - if (nVersion < nMinVersion) { - fclose(fp); - return 1; - } - fread(&nVersion, 1, 4, fp); -#if 0 - if (nVersion < nBurnVer) { - fclose(fp); - return 1; - } -#endif - - fseek(fp, 0x0C, SEEK_CUR); // Move file pointer to the start of the data block - - fread(pData, 1, nChunkSize - 32, fp); // Read the data - } else { - - // MAME or old FB Alpha memory card file - - unsigned char* pTemp = (unsigned char*)malloc(nSize >> 1); - - memset(pData, 0, nSize); - fseek(fp, 0x00, SEEK_SET); - - if (pTemp) { - fread(pTemp, 1, nSize >> 1, fp); - - for (int i = 1; i < nSize; i += 2) { - pData[i] = pTemp[i >> 1]; - } - - free(pTemp); - pTemp = NULL; - } - } - - fclose(fp); - - return 0; -} - -static int MemCardWrite(TCHAR* szFilename, unsigned char* pData, int nSize) -{ - FILE* fp = _tfopen(szFilename, _T("wb")); - if (fp == NULL) { - return 1; - } - - if (bMemCardFC1Format) { - - // FB Alpha memory card file - - const char* szFileHeader = "FB1 "; // File identifier - const char* szChunkHeader = "FC1 "; // Chunk identifier - const int nZero = 0; - - int nChunkSize = nSize + 32; - - fwrite(szFileHeader, 1, 4, fp); - fwrite(szChunkHeader, 1, 4, fp); - - fwrite(&nChunkSize, 1, 4, fp); // Chunk size - - fwrite(&nBurnVer, 1, 4, fp); // Version of FBA this was saved from - fwrite(&nMinVersion, 1, 4, fp); // Min version of FBA data will work with - - fwrite(&nZero, 1, 4, fp); // Reserved - fwrite(&nZero, 1, 4, fp); // - fwrite(&nZero, 1, 4, fp); // - - fwrite(pData, 1, nSize, fp); - } else { - - // MAME or old FB Alpha memory card file - - unsigned char* pTemp = (unsigned char*)malloc(nSize >> 1); - if (pTemp) { - for (int i = 1; i < nSize; i += 2) { - pTemp[i >> 1] = pData[i]; - } - - fwrite(pTemp, 1, nSize >> 1, fp); - - free(pTemp); - pTemp = NULL; - } - } - - fclose(fp); - - return 0; -} - -static int __cdecl MemCardDoGetSize(struct BurnArea* pba) -{ - nMemoryCardSize = pba->nLen; - - return 0; -} - -static int MemCardGetSize() -{ - BurnAcb = MemCardDoGetSize; - BurnAreaScan(ACB_MEMCARD, &nMinVersion); - - return 0; -} - -int MemCardCreate() -{ - TCHAR szFilter[1024]; - int nRet; - - _stprintf(szFilter, FBALoadStringEx(hAppInst, IDS_DISK_FILE_CARD, true), _T(APP_TITLE)); - memcpy(szFilter + _tcslen(szFilter), _T(" (*.fc)\0*.fc\0\0"), 14 * sizeof(TCHAR)); - - _stprintf (szMemoryCardFile, _T("memorycard")); - MakeOfn(); - ofn.lpstrTitle = FBALoadStringEx(hAppInst, IDS_MEMCARD_CREATE, true); - ofn.lpstrFilter = szFilter; - ofn.Flags |= OFN_OVERWRITEPROMPT; - - int bOldPause = bRunPause; - bRunPause = 1; - nRet = GetSaveFileName(&ofn); - bRunPause = bOldPause; - - if (nRet == 0) { - return 1; - } - - { - unsigned char* pCard; - - MemCardGetSize(); - - pCard = (unsigned char*)malloc(nMemoryCardSize); - memset(pCard, 0, nMemoryCardSize); - - bMemCardFC1Format = true; - - if (MemCardWrite(szMemoryCardFile, pCard, nMemoryCardSize)) { - return 1; - } - - if (pCard) { - free(pCard); - pCard = NULL; - } - } - - nMemoryCardStatus = 1; - MenuEnableItems(); - - return 0; -} - -int MemCardSelect() -{ - TCHAR szFilter[1024]; - TCHAR* pszTemp = szFilter; - int nRet; - - pszTemp += _stprintf(pszTemp, FBALoadStringEx(hAppInst, IDS_DISK_ALL_CARD, true)); - memcpy(pszTemp, _T(" (*.fc, MEMCARD.\?\?\?)\0*.fc;MEMCARD.\?\?\?\0"), 38 * sizeof(TCHAR)); - pszTemp += 38; - pszTemp += _stprintf(pszTemp, FBALoadStringEx(hAppInst, IDS_DISK_FILE_CARD, true), _T(APP_TITLE)); - memcpy(pszTemp, _T(" (*.fc)\0*.fc\0"), 13 * sizeof(TCHAR)); - pszTemp += 13; - pszTemp += _stprintf(pszTemp, FBALoadStringEx(hAppInst, IDS_DISK_FILE_CARD, true), _T("MAME")); - memcpy(pszTemp, _T(" (MEMCARD.\?\?\?)\0MEMCARD.\?\?\?\0\0"), 28 * sizeof(TCHAR)); - - MakeOfn(); - ofn.lpstrTitle = FBALoadStringEx(hAppInst, IDS_MEMCARD_SELECT, true); - ofn.lpstrFilter = szFilter; - - int bOldPause = bRunPause; - bRunPause = 1; - nRet = GetOpenFileName(&ofn); - bRunPause = bOldPause; - - if (nRet == 0) { - return 1; - } - - MemCardGetSize(); - - if (nMemoryCardSize <= 0) { - return 1; - } - - nMemoryCardStatus = 1; - MenuEnableItems(); - - return 0; -} - -static int __cdecl MemCardDoInsert(struct BurnArea* pba) -{ - if (MemCardRead(szMemoryCardFile, (unsigned char*)pba->Data, pba->nLen)) { - return 1; - } - - nMemoryCardStatus |= 2; - MenuEnableItems(); - - return 0; -} - -int MemCardInsert() -{ - if ((nMemoryCardStatus & 1) && (nMemoryCardStatus & 2) == 0) { - BurnAcb = MemCardDoInsert; - BurnAreaScan(ACB_WRITE | ACB_MEMCARD, &nMinVersion); - } - - return 0; -} - -static int __cdecl MemCardDoEject(struct BurnArea* pba) -{ - if (MemCardWrite(szMemoryCardFile, (unsigned char*)pba->Data, pba->nLen) == 0) { - nMemoryCardStatus &= ~2; - MenuEnableItems(); - - return 0; - } - - return 1; -} - -int MemCardEject() -{ - if ((nMemoryCardStatus & 1) && (nMemoryCardStatus & 2)) { - BurnAcb = MemCardDoEject; - nMinVersion = 0; - BurnAreaScan(ACB_READ | ACB_MEMCARD, &nMinVersion); - } - - return 0; -} - -int MemCardToggle() -{ - if (nMemoryCardStatus & 1) { - if (nMemoryCardStatus & 2) { - return MemCardEject(); - } else { - return MemCardInsert(); - } - } - - return 1; -} diff --git a/jan/src/burner/win32/menu.cpp b/jan/src/burner/win32/menu.cpp deleted file mode 100644 index ad502dbb0..000000000 --- a/jan/src/burner/win32/menu.cpp +++ /dev/null @@ -1,1444 +0,0 @@ -// Menu handling - -#include "burner.h" - -#ifdef _MSC_VER -// #include -#endif - -int nOtherRes = 0; - -HMENU hMenu = NULL; -HMENU hMenuPopup = NULL; -HWND hMenubar = NULL; // Handle to the Toolbar control comprising the menu -static HMENU hBlitterMenu[8] = {NULL, }; // Handles to the blitter-specific sub-menus -static HMENU hAudioPluginMenu[8] = {NULL, }; - -bool bMenuDisplayed = false; -bool bModelessMenu = false; -int nLastMenu = 0; -static int nRecursions = -1; -static HMENU hCurrentMenu; -static int nCurrentItem; -static int nCurrentItemFlags; - -int nMenuHeight = 0; -int nWindowSize = 0; -int nScreenSize = 0; -int nScreenSizeHor = 0; -int nScreenSizeVer = 0; - -TCHAR szPrevGames[SHOW_PREV_GAMES][32]; - -static HHOOK hMenuHook; - -static LRESULT CALLBACK MenuHook(int nCode, WPARAM wParam, LPARAM lParam) -{ - - switch (((MSG*)lParam)->message) { - - case WM_MOUSEMOVE: { // Translate coordinates to menubar client coordinates - RECT rect; - POINT point = {GET_X_LPARAM(((MSG*)lParam)->lParam), GET_Y_LPARAM(((MSG*)lParam)->lParam)}; - - GetWindowRect(hMenubar, &rect); - - if (point.x >= rect.left && point.y >= rect.top && point.x < rect.right && point.y < rect.bottom) { - RECT buttonrect; - SendMessage(hMenubar, TB_GETITEMRECT, nLastMenu, (LPARAM)&buttonrect); - - if (!(point.x >= rect.left + buttonrect.left && point.y >= rect.top + buttonrect.top && point.x < rect.left + buttonrect.right && point.y < rect.top + buttonrect.bottom)) { - SendNotifyMessage(hMenubar, WM_MOUSEMOVE, wParam, MAKELONG(point.x - rect.left, point.y - rect.top)); - } - } - break; - } - - case WM_LBUTTONDOWN: { - RECT rect; - RECT buttonrect; - POINT point = {GET_X_LPARAM(((MSG*)lParam)->lParam), GET_Y_LPARAM(((MSG*)lParam)->lParam)}; - - GetWindowRect(hMenubar, &rect); - SendMessage(hMenubar, TB_GETITEMRECT, nLastMenu, (LPARAM)&buttonrect); - - // If the button is pressed over the currently selected menu title, eat the message and close the menu - if (point.x >= rect.left + buttonrect.left && point.y >= rect.top + buttonrect.top && point.x < rect.left + buttonrect.right && point.y < rect.top + buttonrect.bottom) { - PostMessage(hMenubar, WM_CANCELMODE, 0, 0); - return 1; - } - break; - } - - } - - MenuHandleKeyboard((MSG*)lParam); - - return CallNextHookEx(hMenuHook, nCode, wParam, lParam); -} - -void DisplayPopupMenu(int nMenu) -{ - if (bMenuDisplayed) { - EndMenu(); - if (nLastMenu != nMenu) { - PostMessage(hScrnWnd, UM_DISPLAYPOPUP, nMenu, 0); - } - } else { - HMENU hPopupMenu = GetSubMenu(hMenu, nMenu); - RECT clientRect; - RECT buttonRect; - - nLastMenu = nMenu; - nRecursions = 0; - nCurrentItemFlags = 0; - - GetWindowRect(hMenubar, &clientRect); - SendMessage(hMenubar, TB_GETITEMRECT, nMenu, (LPARAM)&buttonRect); - - if (!bModelessMenu) { - hMenuHook = SetWindowsHookEx(WH_MSGFILTER, MenuHook, NULL, GetCurrentThreadId()); - } - TrackPopupMenuEx(hPopupMenu, TPM_LEFTALIGN | TPM_TOPALIGN, clientRect.left + buttonRect.left, clientRect.top + buttonRect.bottom, hScrnWnd, NULL); - if (!bModelessMenu) { - UnhookWindowsHookEx(hMenuHook); - } - } -} - -int OnNotify(HWND, int, NMHDR* lpnmhdr) // HWND hwnd, int id, NMHDR* lpnmhdr -{ - switch (((TBNOTIFY*)lpnmhdr)->hdr.code) { - - case TBN_DROPDOWN: { - if (!bMenuDisplayed || ((TBNOTIFY*)lpnmhdr)->iItem - MENU_MENU_0 != nLastMenu) { - DisplayPopupMenu(((TBNOTIFY*)lpnmhdr)->iItem - MENU_MENU_0); - nLastMenu = ((TBNOTIFY*)lpnmhdr)->iItem - MENU_MENU_0; - } - return TBDDRET_DEFAULT; - } - - case TBN_HOTITEMCHANGE: { - int nItem = ((NMTBHOTITEM*)lpnmhdr)->idNew; - - // If a menu is being displayed, close it and display the new one - if (bMenuDisplayed) { - if (nItem) { - if (nItem - MENU_MENU_0 != nLastMenu) { - DisplayPopupMenu(nItem - MENU_MENU_0); - return 1; - } - } - } else { - nLastMenu = nItem - MENU_MENU_0; - if (!nItem && !bAltPause) { - GameInpCheckMouse(); - } - return 0; - } - } - } - return 0; -} - -int OnMenuSelect(HWND, HMENU, int nItem, HMENU, UINT nFlags) -{ -// printf("WM_MENUSELECT: %4i, %08x\n", nItem, nFlags); - nCurrentItem = nItem; - nCurrentItemFlags = nFlags; - return 0; -} - -int OnInitMenuPopup(HWND, HMENU hNewMenuPopup, UINT, BOOL bWindowsMenu) -{ - if (!bWindowsMenu) { - if (!nRecursions) { - bMenuDisplayed = true; - SendMessage(hMenubar, TB_PRESSBUTTON, nLastMenu + MENU_MENU_0, MAKELONG(1, 0)); - hCurrentMenu = hNewMenuPopup; - } - nRecursions++; - } - return 0; -} - -int OnUnInitMenuPopup(HWND, HMENU, UINT, BOOL) -{ - if (nRecursions <= 1) { - bMenuDisplayed = false; - SendMessage(hMenubar, TB_PRESSBUTTON, nLastMenu + MENU_MENU_0, MAKELONG(0, 0)); - if(!bAltPause) { - if (bRunPause) { - bRunPause = 0; - } - GameInpCheckMouse(); - } - } - nRecursions--; - - return 0; -} - -bool MenuHandleKeyboard(MSG* Msg) -{ - static bool bProcessAltKeyUp = true; - - if (!bMenuEnabled) { - return 0; - } - - if (Msg->message == WM_KEYDOWN) { - switch (Msg->wParam) { - case VK_ESCAPE: { - if (bMenuDisplayed) { - if (nRecursions > 1) { - break; - } else { - EndMenu(); - SendMessage(hMenubar, TB_SETHOTITEM, nLastMenu, 0); - return 1; - } - } else { - if (SendMessage(hMenubar, TB_GETHOTITEM, 0, 0) != -1) { - SendMessage(hMenubar, TB_SETHOTITEM, (WPARAM)-1, 0); - if (!bAltPause) { - GameInpCheckMouse(); - } - return 1; - } - } - break; - } - case VK_LEFT: { - int nItem; - if (bMenuDisplayed) { - if (nRecursions > 1) { - break; - } else { - nItem = nLastMenu; - } - } else { - nItem = SendMessage(hMenubar, TB_GETHOTITEM, 0, 0); - } - if (nItem != -1) { - if (nItem) { - nItem -= 1; - } else { - nItem = 5; - } - SendMessage(hMenubar, TB_SETHOTITEM, (WPARAM)nItem, 0); - return 1; - } - break; - } - case VK_RIGHT: { - int nItem; - if (bMenuDisplayed) { - if (nCurrentItemFlags & MF_POPUP) { - break; - } else { - nItem = nLastMenu; - } - } else { - nItem = SendMessage(hMenubar, TB_GETHOTITEM, 0, 0); - } - if (nItem != -1) { - if (nItem != 5) { - nItem += 1; - } else { - nItem = 0; - } - SendMessage(hMenubar, TB_SETHOTITEM, (WPARAM)nItem, 0); - return 1; - } - break; - } - case VK_UP: { - if (!bMenuDisplayed) { - int nItem = SendMessage(hMenubar, TB_GETHOTITEM, 0, 0); - if (nItem == -1) { - break; - } else { - SendMessage(hMenubar, TB_SETHOTITEM, (WPARAM)-1, 0); - DisplayPopupMenu(nItem); - return 1; - } - } - break; - } - case VK_DOWN: { - if (!bMenuDisplayed) { - int nItem = SendMessage(hMenubar, TB_GETHOTITEM, 0, 0); - if (nItem == -1) { - break; - } else { - SendMessage(hMenubar, TB_SETHOTITEM, (WPARAM)-1, 0); - DisplayPopupMenu(nItem); - return 1; - } - } - break; - } - } - } else { - if (!bLeftAltkeyMapped || bRunPause || !bDrvOkay) { - if (Msg->message == WM_SYSKEYDOWN && Msg->wParam == VK_MENU) { - if (bMenuDisplayed) { - bProcessAltKeyUp = false; - EndMenu(); - if (!bAltPause) { - GameInpCheckMouse(); - } - return 1; - } - } else { - if (Msg->message == WM_SYSKEYUP && Msg->wParam == VK_MENU) { - if (bProcessAltKeyUp) { - int nItem = SendMessage(hMenubar, TB_GETHOTITEM, 0, 0); - if (nItem == -1) { // Menu enabled - SendMessage(hMenubar, TB_SETHOTITEM, 0, 0); - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - return 1; - } else { // Menu disabled - SendMessage(hMenubar, TB_SETHOTITEM, (WPARAM)-1, 0); - if (!bAltPause) { - GameInpCheckMouse(); - } - return 1; - } - } - } else { - if (Msg->message == UM_DISPLAYPOPUP) { - DisplayPopupMenu(Msg->wParam); - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - return 1; - } - } - } - } - } - - bProcessAltKeyUp = true; - - return 0; -} - -int MenuCreate() -{ - TBBUTTON button; - TCHAR szButtonText[32]; - MENUITEMINFO menuItemInfo; - MENUINFO menu; - - if (hMenu == NULL) { - hMenu = FBALoadMenu(hAppInst, MAKEINTRESOURCE(IDR_MENU)); // Main application menu - hBlitterMenu[0] = FBALoadMenu(hAppInst, MAKEINTRESOURCE(IDR_MENU_BLITTER_1)); // DirectDraw Standard blitter - hBlitterMenu[1] = FBALoadMenu(hAppInst, MAKEINTRESOURCE(IDR_MENU_BLITTER_2)); // Direct3D - hBlitterMenu[2] = FBALoadMenu(hAppInst, MAKEINTRESOURCE(IDR_MENU_BLITTER_3)); // Software effects blitter - hBlitterMenu[3] = FBALoadMenu(hAppInst, MAKEINTRESOURCE(IDR_MENU_BLITTER_4)); // DirectX 9 - hBlitterMenu[4] = FBALoadMenu(hAppInst, MAKEINTRESOURCE(IDR_MENU_BLITTER_5)); // DirectX 9 Alt - - hAudioPluginMenu[0] = FBALoadMenu(hAppInst, MAKEINTRESOURCE(IDR_MENU_AUD_PLUGIN_1)); - hAudioPluginMenu[1] = FBALoadMenu(hAppInst, MAKEINTRESOURCE(IDR_MENU_AUD_PLUGIN_2)); - } - - if (hMenuPopup == NULL) { - hMenuPopup = CreatePopupMenu(); - - menuItemInfo.cbSize = sizeof(MENUITEMINFO); - menuItemInfo.fMask = MIIM_TYPE; - menuItemInfo.dwTypeData = szButtonText; - - for (int i = 0; i < 6; i++) { - menuItemInfo.cch = 32; - GetMenuItemInfo(hMenu, i, true, &menuItemInfo); - AppendMenu(hMenuPopup, MF_POPUP | MF_STRING, (UINT_PTR)GetSubMenu(hMenu, i), szButtonText); - } - } - - MenuEnableItems(); - MenuUpdate(); - - bMenuDisplayed = false; - nLastMenu = -1; - - hMenubar = CreateWindowEx(0, - TOOLBARCLASSNAME, NULL, - TBSTYLE_FLAT | TBSTYLE_LIST | CCS_NODIVIDER | CCS_NOPARENTALIGN | CCS_NORESIZE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, - 0, 0, 0, 0, - hScrnWnd, NULL, hAppInst, NULL); - - SendMessage(hMenubar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); - SendMessage(hMenubar, TB_SETBITMAPSIZE, 0, 0); - - // Reset window menu to default - GetSystemMenu(hScrnWnd, TRUE); - - if (bModelessMenu) { // Make menu modeless - - memset(&menu, 0, sizeof(MENUINFO)); - menu.cbSize = sizeof(MENUINFO); - menu.fMask = MIM_APPLYTOSUBMENUS | MIM_STYLE; - menu.dwStyle = MNS_MODELESS | MNS_CHECKORBMP; - - SetMenuInfo(hMenuPopup, &menu); - - for (int i = 0; i < 6; i++) { - SetMenuInfo(GetSubMenu(hMenu, i), &menu); - } - - memset(&menu, 0, sizeof(MENUINFO)); - menu.cbSize = sizeof(MENUINFO); - menu.fMask = MIM_STYLE | MIM_MAXHEIGHT; - -#if 0 - // Doesn't seem to work - { - HMENU hWindowMenu = GetSystemMenu(hScrnWnd, FALSE); - GetMenuInfo(hWindowMenu, &menu); - menu.dwStyle |= MNS_MODELESS; - SetMenuInfo(hWindowMenu, &menu); - } -#endif - } - - // Add buttons to the menu toolbar - memset(&button, 0, sizeof(TBBUTTON)); - memset(&menuItemInfo, 0, sizeof(MENUITEMINFO)); - - menuItemInfo.cbSize = sizeof(MENUITEMINFO); - menuItemInfo.fMask = MIIM_TYPE; - menuItemInfo.dwTypeData = szButtonText; - - for (int i = 0; i < 6; i++) { - - menuItemInfo.cch = 32; - GetMenuItemInfo(hMenu, i, true, &menuItemInfo); - - button.iBitmap = 0; - button.idCommand = MENU_MENU_0 + i; - button.fsState = TBSTATE_ENABLED; - button.fsStyle = TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE; - - button.iString = (INT_PTR)szButtonText; - - SendMessage(hMenubar, TB_ADDBUTTONS, 1, (LPARAM)&button); - } - - SendMessage(hMenubar, TB_AUTOSIZE, 0, 0); - - return 0; -} - -void MenuDestroy() -{ - if (hMenubar) { - DestroyWindow(hMenubar); - hMenubar = NULL; - } - - { - MENUITEMINFO myMenuItemInfo; - myMenuItemInfo.cbSize = sizeof(MENUITEMINFO); - myMenuItemInfo.fMask = MIIM_SUBMENU | MIIM_STATE; - myMenuItemInfo.fState = MFS_GRAYED; - myMenuItemInfo.hSubMenu = NULL; - if (hMenu) { - SetMenuItemInfo(GetSubMenu(hMenu, 1), 1, TRUE, &myMenuItemInfo); - } - if (hMenuPopup) { - SetMenuItemInfo(GetSubMenu(hMenuPopup, 1), 1, TRUE, &myMenuItemInfo); - } - - for (int i = 0; i < 5; i++) { - if (hBlitterMenu[i]) { - DestroyMenu(hBlitterMenu[i]); - hBlitterMenu[i] = 0; - } - } - - for (int i = 0; i < 2; i++) { - if (hAudioPluginMenu[i]) { - DestroyMenu(hAudioPluginMenu[i]); - hAudioPluginMenu[i] = 0; - } - } - } - - if(hMenu) { - DestroyMenu(hMenu); - hMenu = NULL; - } - if (hMenuPopup) { - DestroyMenu(hMenuPopup); - hMenuPopup = NULL; - } -} - -// Update the arade resolution menuitem -void CreateArcaderesItem() -{ - int nGameWidth, nGameHeight; - - TCHAR szItemText[256]; - MENUITEMINFO menuItem = {sizeof(MENUITEMINFO), MIIM_TYPE, MFT_STRING, 0, 0, NULL, NULL, NULL, 0, szItemText, 0, 0, }; - - // horizontal oriented - FBALoadString(hAppInst, IDS_MENU_0, szItemText, 256); - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - _stprintf(szItemText + _tcslen(szItemText), _T("\t(%i x %i)"), nGameWidth, nGameHeight); - } - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_RES_ARCADE, 0, &menuItem); - - // vertical oriented - TCHAR szItemText2[256]; - MENUITEMINFO menuItem2 = {sizeof(MENUITEMINFO), MIIM_TYPE, MFT_STRING, 0, 0, NULL, NULL, NULL, 0, szItemText2, 0, 0, }; - - FBALoadString(hAppInst, IDS_MENU_0, szItemText2, 256); - if (bDrvOkay && BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - _stprintf(szItemText + _tcslen(szItemText2), _T("\t(%i x %i)"), nGameWidth, nGameHeight); - } - menuItem2.cch = _tcslen(szItemText2); - SetMenuItemInfo(hMenu, MENU_RES_ARCADE_VERTICAL, 0, &menuItem2); -} - -// (Horizontal oriented) Update the custom resolution menuitem -static void CreateOtherresItem(bool bOther) -{ - TCHAR szItemText[256]; - MENUITEMINFO menuItem = {sizeof(MENUITEMINFO), MIIM_TYPE, MFT_STRING, 0, 0, NULL, NULL, NULL, 0, szItemText, 0, 0 }; - - FBALoadString(hAppInst, IDS_MENU_1, szItemText, 256); - if (bOther) { - _stprintf(szItemText + _tcslen(szItemText), _T("\t(%i x %i)"), nVidHorWidth, nVidHorHeight); - } - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_RES_OTHER, 0, &menuItem); -} - -// (Vertical oriented) Update the custom resolution menuitem -static void CreateOtherresItemVer(bool bOther) -{ - TCHAR szItemText[256]; - MENUITEMINFO menuItem = {sizeof(MENUITEMINFO), MIIM_TYPE, MFT_STRING, 0, 0, NULL, NULL, NULL, 0, szItemText, 0, 0 }; - - FBALoadString(hAppInst, IDS_MENU_1, szItemText, 256); - if (bOther) { - _stprintf(szItemText + _tcslen(szItemText), _T("\t(%i x %i)"), nVidVerWidth, nVidVerHeight); - } - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_RES_OTHER_VERTICAL, 0, &menuItem); -} - -static void CreatepresetResItems() -{ - TCHAR szItemText[256]; - MENUITEMINFO menuItem = {sizeof(MENUITEMINFO), MIIM_TYPE, MFT_STRING, 0, 0, NULL, NULL, NULL, 0, szItemText, 0, 0 }; - - // horizontal oriented - for (int i = 0; i < 4; i++) { - _stprintf(szItemText, _T("%i x %i"), VidPreset[i].nWidth, VidPreset[i].nHeight); - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_RES_1 + i, 0, &menuItem); - } - - // vertical oriented - for (int i = 0; i < 4; i++) { - _stprintf(szItemText, _T("%i x %i"), VidPresetVer[i].nWidth, VidPresetVer[i].nHeight); - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_RES_1_VERTICAL + i, 0, &menuItem); - } - return; -} - -// Update the other gamma menuitem -static void CreateOtherGammaItem(bool bOther) -{ - TCHAR szItemText[256]; - MENUITEMINFO menuItem = {sizeof(MENUITEMINFO), MIIM_TYPE, MFT_STRING, 0, 0, NULL, NULL, NULL, 0, szItemText, 0, 0 }; - - FBALoadString(hAppInst, IDS_MENU_2, szItemText, 256); - if (bOther) { - _stprintf(szItemText + _tcslen(szItemText), _T("\t(%1.2f)"), nGamma); - } - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_GAMMA_OTHER, 0, &menuItem); -} - -// Update the cpu speed menuitem -static void CreateCPUSpeedItem(bool bOther) -{ - TCHAR szItemText[256]; - MENUITEMINFO menuItem = {sizeof(MENUITEMINFO), MIIM_TYPE, MFT_STRING, 0, 0, NULL, NULL, NULL, 0, szItemText, 0, 0 }; - - FBALoadString(hAppInst, IDS_MENU_3, szItemText, 256); - if (bOther) { - _stprintf(szItemText + _tcslen(szItemText), _T("\t(%d%%)"), nBurnCPUSpeedAdjust * 100 / 256); - } - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_SETCPUCLOCK, 0, &menuItem); -} - -// Update state slot menuitmes -static void CreateStateslotItems() -{ - TCHAR szItemText[256]; - MENUITEMINFO menuItem = {sizeof(MENUITEMINFO), MIIM_TYPE, MFT_STRING, 0, 0, NULL, NULL, NULL, 0, szItemText, 0, 0 }; - - _sntprintf(szItemText, 256, FBALoadStringEx(hAppInst, IDS_MENU_4, true), nSavestateSlot); - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_STATE_LOAD_SLOT, 0, &menuItem); - - _sntprintf(szItemText, 256, FBALoadStringEx(hAppInst, IDS_MENU_5, true), nSavestateSlot); - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_STATE_SAVE_SLOT, 0, &menuItem); -} -#if 0 -// Update CD menu items -static void CreateCDItems() -{ - TCHAR szItemText[256]; - MENUITEMINFO menuItem = { sizeof(MENUITEMINFO), MIIM_TYPE, MFT_STRING, 0, 0, NULL, NULL, NULL, 0, szItemText, 0, NULL }; - - _sntprintf(szItemText, 256, FBALoadStringEx(hAppInst, IDS_CD_SELECT_IMAGE, true)); - if (nCDEmuSelect == 0) { - TCHAR szImage[32]; - int length = _tcslen(szItemText); - - _sntprintf(szImage, 13, _T("\t%s"), CDEmuImage); - if (_tcslen(szImage) > 13) { - _sntprintf(szImage + 13, 8, _T("...")); - } - - _sntprintf(szItemText + length - 1, 256 - length, szImage); - } - menuItem.cch = _tcslen(szItemText); - SetMenuItemInfo(hMenu, MENU_CDIMAGE, 0, &menuItem); -} -#endif -// Update bullets, checkmarks, and item text -void MenuUpdate() -{ - int var; - -// if (!bMenuEnabled) { -// return; -// } - - CreateStateslotItems(); - - CheckMenuItem(hMenu, MENU_PAUSE, bAltPause ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_ALLRAM, bDrvSaveAll ? MF_CHECKED : MF_UNCHECKED); - -// CreateCDItems(); -// CheckMenuRadioItem(hMenu, MENU_CDIMAGE, MENU_CDIMAGE, MENU_CDIMAGE + nCDEmuSelect, MF_BYCOMMAND); - - CheckMenuItem(hMenu, MENU_SETCPUCLOCK, nBurnCPUSpeedAdjust != 0x0100 ? MF_CHECKED : MF_UNCHECKED); - CreateCPUSpeedItem(nBurnCPUSpeedAdjust != 0x0100); - - if (bVidFullStretch) { - var = MENU_STRETCH; - } else { - if (bVidCorrectAspect) { - var = MENU_ASPECT; - } else { - var = MENU_NOSTRETCH; - } - } - CheckMenuRadioItem(hMenu, MENU_NOSTRETCH, MENU_ASPECT, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_STRETCH, bVidFullStretch ? MF_CHECKED : MF_UNCHECKED); - - CheckMenuItem(hMenu, MENU_TRIPLE, bVidTripleBuffer ? MF_CHECKED : MF_UNCHECKED); - - var = nVidSelect + MENU_BLITTER_1; - CheckMenuRadioItem(hMenu, MENU_BLITTER_1, MENU_BLITTER_8, var, MF_BYCOMMAND); - - switch (nVidSelect) { - case 0: - if (bVidScanlines) { - if (bVidScanHalf) { - var = MENU_SCAN50; - } else { - var = MENU_BASIC_SCAN; - } - } else { - var = MENU_BASIC_NORMAL; - } - CheckMenuRadioItem(hMenu, MENU_BASIC_NORMAL, MENU_SCAN50, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_BASIC_ROTSCAN, bVidScanRotate ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_FORCE_FLIP, bVidForceFlip ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_RES_ARCADE, bVidArcaderes ? MF_CHECKED : MF_UNCHECKED); - break; - case 1: - CheckMenuItem(hMenu, MENU_BILINEAR, bVidBilinear ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_ENHANCED_SCAN, bVidScanlines ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_PHOSPHOR, bVidScanDelay ? MF_CHECKED : MF_UNCHECKED); - - CheckMenuItem(hMenu, MENU_PRESCALE, nVidBlitterOpt[nVidSelect] & 0x01000000 ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_SOFTFX, nVidBlitterOpt[nVidSelect] & 0x02000000 ? MF_CHECKED : MF_UNCHECKED); - - var = ((unsigned long long)nVidBlitterOpt[nVidSelect] >> 32) + MENU_ENHANCED_SOFT_STRETCH; - CheckMenuRadioItem(hMenu, MENU_ENHANCED_SOFT_STRETCH, MENU_ENHANCED_SOFT_STRETCH + 34, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_ENHANCED_SOFT_AUTOSIZE, (nVidBlitterOpt[nVidSelect] & 0x04000000) ? MF_CHECKED : MF_UNCHECKED); - if (nVidBlitterOpt[nVidSelect] & 0x00100000) { - var = MENU_3DPROJECTION; - } else { - if (nVidBlitterOpt[nVidSelect] & 0x00010000) { - var = MENU_RGBEFFECTS; - } else { - var = MENU_ENHANCED_NORMAL; - } - } - CheckMenuRadioItem(hMenu, MENU_ENHANCED_NORMAL, MENU_ENHANCED_NORMAL, var, MF_BYCOMMAND); - CheckMenuRadioItem(hMenu, MENU_RGBEFFECTS, MENU_3DPROJECTION, var, MF_BYCOMMAND); - - CheckMenuItem(hMenu, MENU_EFFECT_AUTO, (nVidBlitterOpt[nVidSelect] & 0x00020000) ? MF_CHECKED : MF_UNCHECKED); - var = MENU_EFFECT_01 + (nVidBlitterOpt[nVidSelect] & 0x000000FF) - 8; - CheckMenuRadioItem(hMenu, MENU_EFFECT_01, MENU_EFFECT_08, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_3DUSELIGHTING, nVidBlitterOpt[nVidSelect] & 0x00200000 ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_ENHANCED_ROTSCAN, bVidScanRotate ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_FORCE_16BIT, bVidForce16bit ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_TEXTUREMANAGE, (nVidTransferMethod & 1) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_RES_ARCADE, bVidArcaderes ? MF_CHECKED : MF_UNCHECKED); - break; - case 2: - var = (nVidBlitterOpt[nVidSelect] & 0xFF) + MENU_SOFTFX_SOFT_STRETCH; - CheckMenuRadioItem(hMenu, MENU_SOFTFX_SOFT_STRETCH, MENU_SOFTFX_SOFT_STRETCH + 34, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_SOFTFX_SOFT_AUTOSIZE, (nVidBlitterOpt[nVidSelect] & 0x0100) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_SOFT_DIRECTACCESS, !(nVidBlitterOpt[nVidSelect] & 0x0200) ? MF_CHECKED : MF_UNCHECKED); - break; - case 3: - var = ((nVidBlitterOpt[nVidSelect] >> 24) & 0x03) + MENU_DX9_POINT; - CheckMenuRadioItem(hMenu, MENU_DX9_POINT, MENU_DX9_POINT + 2, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_EXP_SCAN, bVidScanlines ? MF_CHECKED : MF_UNCHECKED); - - var = MENU_DX9_CUBIC_CUSTOM; - if (dVidCubicB > -0.001 && dVidCubicB < 0.001 && dVidCubicC > -0.001 && dVidCubicC < 0.001) { - var = MENU_DX9_CUBIC_LIGHT; - } - if (dVidCubicB > 1.499 && dVidCubicB < 1.501 && dVidCubicC > -0.251 && dVidCubicC < -0.249) { - var = MENU_DX9_CUBIC_NOTCH; - } - if (dVidCubicB > 0.999 && dVidCubicB < 1.001 && dVidCubicC > -0.001 && dVidCubicC < 0.001) { - var = MENU_DX9_CUBIC_BSPLINE; - } - if (dVidCubicB > 0.333 && dVidCubicB < 0.334 && dVidCubicC > 0.333 && dVidCubicC < 0.334) { - var = MENU_DX9_CUBIC_OPTIMAL; - } - if (dVidCubicB > -0.001 && dVidCubicB < 0.001 && dVidCubicC > 0.499 && dVidCubicC < 0.501) { - var = MENU_DX9_CUBIC_CATMULL; - } - if (dVidCubicB > -0.001 && dVidCubicB < 0.001 && dVidCubicC > 0.999 && dVidCubicC < 1.001) { - var = MENU_DX9_CUBIC_SHARP; - } - CheckMenuRadioItem(hMenu, MENU_DX9_CUBIC_LIGHT, MENU_DX9_CUBIC_BSPLINE + 8, var, MF_BYCOMMAND); - - CheckMenuItem(hMenu, MENU_DX9_FORCE_PS14, !(nVidBlitterOpt[nVidSelect] & (1 << 9)) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_DX9_FPTERXTURES, (nVidBlitterOpt[nVidSelect] & (1 << 8)) ? MF_CHECKED : MF_UNCHECKED); - if (!(nVidBlitterOpt[nVidSelect] & (1 << 9))) { - var = MENU_DX9_CUBIC4; - } else { - var = ((nVidBlitterOpt[nVidSelect] >> 28) & 0x07) + MENU_DX9_CUBIC0; - } - CheckMenuRadioItem(hMenu, MENU_DX9_CUBIC0, MENU_DX9_CUBIC0 + 8, var, MF_BYCOMMAND); - break; - case 4: - var = (nVidBlitterOpt[nVidSelect] & 0xFF) + MENU_DX9_ALT_SOFT_STRETCH; - CheckMenuRadioItem(hMenu, MENU_DX9_ALT_SOFT_STRETCH, MENU_DX9_ALT_SOFT_STRETCH + 34, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_DX9_ALT_SOFT_AUTOSIZE, (nVidBlitterOpt[nVidSelect] & 0x0100) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuRadioItem(hMenu, MENU_DX9_ALT_POINT, MENU_DX9_ALT_POINT + 1, MENU_DX9_ALT_POINT + bVidDX9Bilinear, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_DX9_ALT_HARDWAREVERTEX, (bVidHardwareVertex) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_DX9_ALT_MOTIONBLUR, (bVidMotionBlur) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_DX9_ALT_FORCE_16BIT, bVidForce16bitDx9Alt ? MF_CHECKED : MF_UNCHECKED); - break; - } - - var = 0; - if (nScreenSizeHor) { - var = MENU_SINGLESIZESCREEN + nScreenSizeHor - 1; - CreateOtherresItem(0); - } else { - for (int n = 0; n < 4; n++) { - if (nVidHorWidth == VidPreset[n].nWidth && nVidHorHeight == VidPreset[n].nHeight) { - var = MENU_RES_1 + n; - break; - } - } - if (var) { - CreateOtherresItem(0); - } else { - var = MENU_RES_OTHER; - CreateOtherresItem(1); - } - if (bVidArcaderesHor) { - var = MENU_RES_ARCADE; - } - } - CheckMenuRadioItem(hMenu, MENU_RES_1, MENU_QUADSIZESCREEN, var, MF_BYCOMMAND); - - var = 0; - if (nScreenSizeVer) { - var = MENU_SINGLESIZESCREEN_VERTICAL + nScreenSizeVer - 1; - CreateOtherresItemVer(0); - } else { - for (int n = 0; n < 4; n++) { - if (nVidVerWidth == VidPresetVer[n].nWidth && nVidVerHeight == VidPresetVer[n].nHeight) { - var = MENU_RES_1_VERTICAL + n; - break; - } - } - if (var) { - CreateOtherresItemVer(0); - } else { - var = MENU_RES_OTHER_VERTICAL; - CreateOtherresItemVer(1); - } - if (bVidArcaderesVer) { - var = MENU_RES_ARCADE_VERTICAL; - } - } - CheckMenuRadioItem(hMenu, MENU_RES_1_VERTICAL, MENU_QUADSIZESCREEN_VERTICAL, var, MF_BYCOMMAND); - - if (nVidDepth == 16) { - var = MENU_16; - } else { - if (nVidDepth == 24) { - var = MENU_24; - } else { - var = MENU_32; - } - } - CheckMenuRadioItem(hMenu, MENU_16, MENU_32, var, MF_BYCOMMAND); - - if (nGamma > 1.249 && nGamma < 1.251) { - var = MENU_GAMMA_DARKER; - } else { - if (nGamma > 0.799 && nGamma < 0.801) { - var = MENU_GAMMA_LIGHTER; - } else { - var = MENU_GAMMA_OTHER; - } - } - if (var == MENU_GAMMA_OTHER) { - CreateOtherGammaItem(1); - } else { - CreateOtherGammaItem(0); - } - if (!bDoGamma) { - var = MENU_GAMMA_DO; - } - CheckMenuRadioItem(hMenu, MENU_GAMMA_DARKER, MENU_GAMMA_OTHER, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_GAMMA_DO, bDoGamma ? MF_CHECKED : MF_UNCHECKED); - - var = MENU_GAMMA_SOFTWARE_ONLY; - if (bVidUseHardwareGamma) { - if (bHardwareGammaOnly) { - var = MENU_GAMMA_HARDWARE_ONLY; - } else { - var = MENU_GAMMA_USE_HARDWARE; - } - } - CheckMenuRadioItem(hMenu, MENU_GAMMA_USE_HARDWARE, MENU_GAMMA_SOFTWARE_ONLY, var, MF_BYCOMMAND); - - CheckMenuItem(hMenu, MENU_AUTOSWITCHFULL, bVidAutoSwitchFull ? MF_CHECKED : MF_UNCHECKED); - - if (nVidTransferMethod == 0) { - var = MENU_BASIC_VIDEOMEM; - } else { - if (nVidTransferMethod == -1) { - var = MENU_BASIC_MEMAUTO; - } else { - var = MENU_BASIC_SYSMEM; - } - } - CheckMenuRadioItem(hMenu, MENU_BASIC_MEMAUTO, MENU_BASIC_SYSMEM, var, MF_BYCOMMAND); - - if (nVidTransferMethod == 0) { - var = MENU_SOFTFX_VIDEOMEM; - } else { - if (nVidTransferMethod == -1) { - var = MENU_SOFTFX_MEMAUTO; - } else { - var = MENU_SOFTFX_SYSMEM; - } - } - CheckMenuRadioItem(hMenu, MENU_SOFTFX_MEMAUTO, MENU_SOFTFX_SYSMEM, var, MF_BYCOMMAND); - - if (nWindowSize <= 4) { - var = MENU_AUTOSIZE + nWindowSize; - } else { - var = MENU_MAXIMUMSIZEWINDOW; - } - CheckMenuRadioItem(hMenu, MENU_AUTOSIZE, MENU_MAXIMUMSIZEWINDOW, var, MF_BYCOMMAND); - - CheckMenuItem(hMenu, MENU_MONITORAUTOCHECK, bMonitorAutoCheck ? MF_CHECKED : MF_UNCHECKED); - - var = -1; - if (nVidScrnAspectX == 4 && nVidScrnAspectY == 3) { - var = MENU_ASPECTNORMAL; - } else { - if (nVidScrnAspectX == 5 && nVidScrnAspectY == 4) { - var = MENU_ASPECTLCD; - } else { - if (nVidScrnAspectX == 16 && nVidScrnAspectY == 9) { - var = MENU_ASPECTWIDE; - } else { - if (nVidScrnAspectX == 16 && nVidScrnAspectY == 10) { - var = MENU_ASPECTWIDELCD; - } - } - } - } - CheckMenuRadioItem(hMenu, MENU_ASPECTNORMAL, MENU_ASPECTWIDELCD, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_MONITORMIRRORVERT, (nVidRotationAdjust & 2) ? MF_CHECKED : MF_UNCHECKED); - - CheckMenuItem(hMenu, MENU_ROTATEVERTICAL, !(nVidRotationAdjust & 1) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_FORCE60HZ, bForce60Hz ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_VIDEOVSYNC, bVidVSync ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_AUTOFRAMESKIP, !bAlwaysDrawFrames ? MF_CHECKED : MF_UNCHECKED); - - var = nAudSelect + MENU_AUD_PLUGIN_1; - CheckMenuRadioItem(hMenu, MENU_AUD_PLUGIN_1, MENU_AUD_PLUGIN_8, var, MF_BYCOMMAND); - - switch (nAudSelect) { - case 0: { - var = MENU_DSOUND_NOSOUND; - if (nAudSampleRate[0] > 0) { - if (nAudSampleRate[0] <= 11025) { - var = MENU_DSOUND_11025; - } else { - if (nAudSampleRate[0] <= 22050) { - var = MENU_DSOUND_22050; - } else { - if (nAudSampleRate[0] <= 44100) { - var = MENU_DSOUND_44100; - } else { - var = MENU_DSOUND_48000; - } - } - } - } - CheckMenuRadioItem(hMenu, MENU_DSOUND_NOSOUND, MENU_DSOUND_48000, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_DSOUND_BASS, nAudDSPModule[0] ? MF_CHECKED : MF_UNCHECKED); - break; - } - - case 1: { - var = MENU_XAUDIO_NOSOUND; - if (nAudSampleRate[1] > 0) { - if (nAudSampleRate[1] <= 11025) { - var = MENU_XAUDIO_11025; - } else { - if (nAudSampleRate[1] <= 22050) { - var = MENU_XAUDIO_22050; - } else { - if (nAudSampleRate[1] <= 44100) { - var = MENU_XAUDIO_44100; - } else { - var = MENU_XAUDIO_48000; - } - } - } - } - CheckMenuRadioItem(hMenu, MENU_XAUDIO_NOSOUND, MENU_XAUDIO_48000, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_XAUDIO_BASS, (nAudDSPModule[1] & 1) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_XAUDIO_REVERB, (nAudDSPModule[1] & 2) ? MF_CHECKED : MF_UNCHECKED); - break; - } - } - - var = MENU_INTERPOLATE_0 + nInterpolation; - if (bDrvOkay) { - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_NEOGEO) { - var = MENU_INTERPOLATE_0 + 1; - } - } - CheckMenuRadioItem(hMenu, MENU_INTERPOLATE_0, MENU_INTERPOLATE_5, var, MF_BYCOMMAND); - - var = MENU_INTERPOLATE_FM_0 + nFMInterpolation; - CheckMenuRadioItem(hMenu, MENU_INTERPOLATE_FM_0, MENU_INTERPOLATE_FM_5, var, MF_BYCOMMAND); - - CheckMenuItem(hMenu, MENU_AUTOPAUSE, bAutoPause ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_PROCESSINPUT, !bAlwaysProcessKeyboardInput ? MF_CHECKED : MF_UNCHECKED); - if (bAutoPause) { - EnableMenuItem(hMenu, MENU_PROCESSINPUT, MF_GRAYED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_PROCESSINPUT, MF_ENABLED | MF_BYCOMMAND); - } - CheckMenuItem(hMenu, MENU_DISPLAYINDICATOR, nVidSDisplayStatus ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_MODELESS, bModelessMenu ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_NOCHANGENUMLOCK, bNoChangeNumLock ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_CREATEDIRS, bAlwaysCreateSupportFolders ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_SAVEHISCORES, EnableHiscores ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_USEBLEND, bBurnUseBlend ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, MENU_GEARSHIFT, BurnShiftEnabled ? MF_CHECKED : MF_UNCHECKED); - -#ifdef INCLUDE_AVI_RECORDING - if (nAvi3x <= 1) { - nAvi3x = 1; - var = MENU_AVI1X; - } - if (nAvi3x == 2) { - var = MENU_AVI2X; - } - if (nAvi3x >= 3) { - nAvi3x = 3; - var = MENU_AVI3X; - } - - CheckMenuRadioItem(hMenu, MENU_AVI1X, MENU_AVI3X, var, MF_BYCOMMAND); -#endif - - if (nAppThreadPriority == THREAD_PRIORITY_TIME_CRITICAL) { - var = MENU_PRIORITY_REALTIME; - } else { - if (nAppThreadPriority == THREAD_PRIORITY_HIGHEST) { - var = MENU_PRIORITY_HIGH; - } else { - if (nAppThreadPriority == THREAD_PRIORITY_ABOVE_NORMAL) { - var = MENU_PRIORITY_ABOVE_NORMAL; - } else { - if (nAppThreadPriority == THREAD_PRIORITY_BELOW_NORMAL) { - var = MENU_PRIORITY_BELOW_NORMAL; - } else { - if (nAppThreadPriority == THREAD_PRIORITY_LOWEST) { - var = MENU_PRIORITY_LOW; - } else { - var = MENU_PRIORITY_NORMAL; - } - } - } - } - } - CheckMenuRadioItem(hMenu, MENU_PRIORITY_REALTIME, MENU_PRIORITY_LOW, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_SAVEGAMEINPUT, bSaveInputs ? MF_CHECKED : MF_UNCHECKED); - - // Auto-Fire - if (nAutoFireRate == 4) var = MENU_INPUT_AUTOFIRE_RATE_4; - if (nAutoFireRate == 8) var = MENU_INPUT_AUTOFIRE_RATE_3; - if (nAutoFireRate == 12) var = MENU_INPUT_AUTOFIRE_RATE_2; - if (nAutoFireRate == 22) var = MENU_INPUT_AUTOFIRE_RATE_1; - CheckMenuRadioItem(hMenu, MENU_INPUT_AUTOFIRE_RATE_1, MENU_INPUT_AUTOFIRE_RATE_4, var, MF_BYCOMMAND); - -#ifdef BUILD_A68K - CheckMenuItem(hMenu, MENU_ASSEMBLYCORE, bBurnUseASMCPUEmulation ? MF_CHECKED : MF_UNCHECKED); -#endif - - var = MENU_ICONS_SIZE_16; - switch (nIconsSize) { - case ICON_16x16: var = MENU_ICONS_SIZE_16; break; - case ICON_24x24: var = MENU_ICONS_SIZE_24; break; - case ICON_32x32: var = MENU_ICONS_SIZE_32; break; - } - CheckMenuRadioItem(hMenu, MENU_ICONS_SIZE_16, MENU_ICONS_SIZE_32, var, MF_BYCOMMAND); - CheckMenuItem(hMenu, MENU_ENABLEICONS, bEnableIcons ? MF_CHECKED : MF_UNCHECKED); - - // Previous games list - for (int i = 0; i < SHOW_PREV_GAMES; i++) { - MENUITEMINFO menuItemInfo; - TCHAR szText[256] = _T(""); - int OldDrvSelect = nBurnDrvActive; - - memset(&menuItemInfo, 0, sizeof(MENUITEMINFO)); - menuItemInfo.cbSize = sizeof(MENUITEMINFO); - menuItemInfo.fType = MFT_STRING; - menuItemInfo.fMask = MIIM_TYPE; - - if (_tcslen(szPrevGames[i])) { - for (unsigned int j = 0; j < nBurnDrvCount; j++) { - nBurnDrvActive = j; - if (!_tcsicmp(szPrevGames[i], BurnDrvGetText(DRV_NAME))) { - _stprintf(szText, _T("%s\t%s"), BurnDrvGetText(DRV_FULLNAME), BurnDrvGetText(DRV_NAME)); - - break; - } - } - - // Check for &s and change to && - TCHAR szText2[256] = _T(""); - TCHAR *Tokens = NULL; - int NumTokens = 0; - - Tokens = _tcstok(szText, _T("&")); - while (Tokens != NULL) { - if (NumTokens) { - _stprintf(szText2, _T("%s&&%s"), szText2, Tokens); - } else { - _stprintf(szText2, _T("%s"), Tokens); - } - - Tokens = _tcstok(NULL, _T("&")); - NumTokens++; - } - - menuItemInfo.dwTypeData = szText2; - menuItemInfo.cch = _tcslen(szText2); - - SetMenuItemInfo(hMenu, MENU_PREVIOUSGAMES1 + i, FALSE, &menuItemInfo); - EnableMenuItem(hMenu, MENU_PREVIOUSGAMES1 + i, MF_ENABLED | MF_BYCOMMAND); - } else { - _tcscpy(szText, FBALoadStringEx(hAppInst, IDS_MENU_6, true)); - - menuItemInfo.dwTypeData = szText; - menuItemInfo.cch = _tcslen(szText); - - SetMenuItemInfo(hMenu, MENU_PREVIOUSGAMES1 + i, FALSE, &menuItemInfo); - EnableMenuItem(hMenu, MENU_PREVIOUSGAMES1 + i, MF_GRAYED | MF_BYCOMMAND); - } - - nBurnDrvActive = OldDrvSelect; - } - -#if !defined BUILD_X86_ASM - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_2XPM_LQ, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_2XPM_HQ, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_EAGLE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_SUPEREAGLE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_2XSAI, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_SUPER2XSAI, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_SUPEREAGLE_VBA, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_2XSAI_VBA, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_SUPER2XSAI_VBA, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_SUPERSCALE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_SUPERSCALE75, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_HQ2X, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_HQ3X, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENHANCED_SOFT_HQ4X, MF_GRAYED | MF_BYCOMMAND); - - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_2XPM_LQ, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_2XPM_HQ, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_EAGLE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_SUPEREAGLE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_2XSAI, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_SUPER2XSAI, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_SUPEREAGLE_VBA, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_2XSAI_VBA, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_SUPER2XSAI_VBA, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_SUPERSCALE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_SUPERSCALE75, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_HQ2X, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_HQ3X, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SOFTFX_SOFT_HQ4X, MF_GRAYED | MF_BYCOMMAND); - - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_2XPM_LQ, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_2XPM_HQ, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_EAGLE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_SUPEREAGLE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_2XSAI, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_SUPER2XSAI, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_SUPEREAGLE_VBA, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_2XSAI_VBA, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_SUPER2XSAI_VBA, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_SUPERSCALE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_SUPERSCALE75, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_HQ2X, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_HQ3X, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_ALT_SOFT_HQ4X, MF_GRAYED | MF_BYCOMMAND); -#endif - -#if defined BUILD_X64_EXE - EnableMenuItem(hMenu, MENU_BLITTER_2, MF_GRAYED | MF_BYCOMMAND); -#endif -} - -void MenuEnableItems() -{ - CreateArcaderesItem(); - CreatepresetResItems(); - - if (hBlitterMenu[nVidSelect]) { - MENUITEMINFO myMenuItemInfo; - myMenuItemInfo.cbSize = sizeof(MENUITEMINFO); - myMenuItemInfo.fMask = MIIM_SUBMENU | MIIM_STATE; - myMenuItemInfo.fState = MFS_ENABLED; - myMenuItemInfo.hSubMenu = GetSubMenu(hBlitterMenu[nVidSelect], 0); - SetMenuItemInfo(GetSubMenu(hMenu, 1), 1, TRUE, &myMenuItemInfo); - } else { - MENUITEMINFO myMenuItemInfo; - myMenuItemInfo.cbSize = sizeof(MENUITEMINFO); - myMenuItemInfo.fMask = MIIM_SUBMENU | MIIM_STATE; - myMenuItemInfo.fState = MFS_GRAYED; - myMenuItemInfo.hSubMenu = NULL; - SetMenuItemInfo(GetSubMenu(hMenu, 1), 1, TRUE, &myMenuItemInfo); - } - - if (hBlitterMenu[nAudSelect]) { - MENUITEMINFO myMenuItemInfo; - myMenuItemInfo.cbSize = sizeof(MENUITEMINFO); - myMenuItemInfo.fMask = MIIM_SUBMENU | MIIM_STATE; - myMenuItemInfo.fState = MFS_ENABLED; - myMenuItemInfo.hSubMenu = GetSubMenu(hAudioPluginMenu[nAudSelect], 0); - SetMenuItemInfo(GetSubMenu(hMenu, 2), 1, TRUE, &myMenuItemInfo); - } else { - MENUITEMINFO myMenuItemInfo; - myMenuItemInfo.cbSize = sizeof(MENUITEMINFO); - myMenuItemInfo.fMask = MIIM_SUBMENU | MIIM_STATE; - myMenuItemInfo.fState = MFS_GRAYED; - myMenuItemInfo.hSubMenu = NULL; - SetMenuItemInfo(GetSubMenu(hMenu, 2), 1, TRUE, &myMenuItemInfo); - } - - // Auto-size image when software blitter effects anre enabled - if ((nVidSelect == 1 && (nVidBlitterOpt[1] & 0x07000000) == 0x07000000) || (nVidSelect == 2 && nVidBlitterOpt[2] & 0x0100)) { - EnableMenuItem(GetSubMenu(hMenu, 1), 2, MF_GRAYED | MF_BYPOSITION); - EnableMenuItem(GetSubMenu(hMenu, 1), 7, MF_GRAYED | MF_BYPOSITION); - EnableMenuItem(GetSubMenu(hMenu, 1), 10, MF_GRAYED | MF_BYPOSITION); - } else { - EnableMenuItem(GetSubMenu(hMenu, 1), 2, MF_ENABLED | MF_BYPOSITION); - EnableMenuItem(GetSubMenu(hMenu, 1), 7, MF_ENABLED | MF_BYPOSITION); - EnableMenuItem(GetSubMenu(hMenu, 1), 10, MF_ENABLED | MF_BYPOSITION); - } - EnableMenuItem(GetSubMenu(hMenu, 1), 11, MF_ENABLED | MF_BYPOSITION); - -#if 0 - if (nVidSelect == 3 && !(nVidBlitterOpt[3] & (1 << 9))) { - EnableMenuItem(hMenu, MENU_DX9_CUBIC0, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC1, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC2, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC3, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC4, MF_GRAYED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_DX9_CUBIC0, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC1, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC2, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC3, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC4, MF_ENABLED | MF_BYCOMMAND); - } -#endif - - if (nVidSelect == 3 && (!(nVidBlitterOpt[3] & (1 << 9)) || (nVidBlitterOpt[nVidSelect] & (7 << 28)) == (4 << 28))) { - EnableMenuItem(hMenu, MENU_DX9_CUBIC_BSPLINE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC_NOTCH, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC_OPTIMAL, MF_GRAYED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_DX9_CUBIC_BSPLINE, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC_NOTCH, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DX9_CUBIC_OPTIMAL, MF_ENABLED | MF_BYCOMMAND); - } - if (nVidSelect == 3) { - EnableMenuItem(hMenu, MENU_24, MF_GRAYED | MF_BYCOMMAND); - } - - EnableMenuItem(hMenu, MENU_MODELESS, MF_ENABLED | MF_BYCOMMAND); - -#if defined _MSC_VER && defined BUILD_X86_ASM - EnableMenuItem(hBlitterMenu[1], MENU_ENHANCED_SOFT_HQ3XS_VBA, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hBlitterMenu[2], MENU_SOFTFX_SOFT_HQ3XS_VBA, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hBlitterMenu[4], MENU_DX9_ALT_SOFT_HQ3XS_VBA, MF_ENABLED | MF_BYCOMMAND); -#endif - - if (bDrvOkay) { - EnableMenuItem(hMenu, MENU_QUIT, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_INPUT, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_FORCE60HZ, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_NOSOUND, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_11025, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_22050, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_44100, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_48000, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_NOSOUND, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_11025, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_22050, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_44100, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_48000, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_INTERPOLATE_FM_0, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_INTERPOLATE_FM_3, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_FRAMES, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SAVESNAP, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SAVEGAMEINPUTNOW, MF_ENABLED | MF_BYCOMMAND); -#ifdef BUILD_A68K - EnableMenuItem(hMenu, MENU_ASSEMBLYCORE, MF_GRAYED | MF_BYCOMMAND); -#endif - EnableMenuItem(hMenu, MENU_SAVEHISCORES, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_USEBLEND, MF_GRAYED | MF_BYCOMMAND); - - EnableMenuItem(hMenu, MENU_CDIMAGE, MF_GRAYED | MF_BYCOMMAND); - - EnableMenuItem(hMenu, MENU_AUD_PLUGIN_1, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AUD_PLUGIN_2, MF_GRAYED | MF_BYCOMMAND); - - BurnDIPInfo bdi; - if (BurnDrvGetDIPInfo(&bdi, 0) == 0) { - EnableMenuItem(hMenu, MENU_DIPSW, MF_ENABLED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_DIPSW, MF_GRAYED | MF_BYCOMMAND); - } - - EnableMenuItem(hMenu, MENU_INTERPOLATE_1, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_INTERPOLATE_3, MF_ENABLED | MF_BYCOMMAND); - - EnableMenuItem(hMenu, MENU_MEMCARD_CREATE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_MEMCARD_SELECT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_MEMCARD_INSERT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_MEMCARD_EJECT, MF_GRAYED | MF_BYCOMMAND); - - if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_NEOGEO) { - EnableMenuItem(hMenu, MENU_INTERPOLATE_1, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_INTERPOLATE_3, MF_GRAYED | MF_BYCOMMAND); - - if (!kNetGame) { - EnableMenuItem(hMenu, MENU_MEMCARD_CREATE, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_MEMCARD_SELECT, MF_ENABLED | MF_BYCOMMAND); - if (nMemoryCardStatus & 1) { - if (nMemoryCardStatus & 2) { - EnableMenuItem(hMenu, MENU_MEMCARD_EJECT, MF_ENABLED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_MEMCARD_INSERT, MF_ENABLED | MF_BYCOMMAND); - } - } - } - } - - if (kNetGame) { - EnableMenuItem(hMenu, MENU_LOAD, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STARTNET, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_EXIT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SETCPUCLOCK, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_RESETCPUCLOCK, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_PAUSE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENABLECHEAT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SNAPFACT, MF_GRAYED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_LOAD, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STARTNET, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_EXIT, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SETCPUCLOCK, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_RESETCPUCLOCK, (nBurnCPUSpeedAdjust != 0x0100 ? MF_ENABLED : MF_GRAYED) | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_PAUSE, MF_ENABLED | MF_BYCOMMAND); - if (pCheatInfo) { - EnableMenuItem(hMenu, MENU_ENABLECHEAT, MF_ENABLED | MF_BYCOMMAND); - } - - if (CheatSearchInit()) { - EnableMenuItem(hMenu, MENU_CHEATSEARCH_START, MF_ENABLED | MF_BYCOMMAND); - } - -#if defined (FBA_DEBUG) - extern UINT8 DebugCPU_SekInitted; - if (DebugCPU_SekInitted) { - EnableMenuItem(hMenu, MENU_DEBUG, MF_ENABLED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_DEBUG, MF_GRAYED | MF_BYCOMMAND); - } -#else - EnableMenuItem(hMenu, MENU_DEBUG, MF_GRAYED | MF_BYCOMMAND); -#endif - - if (BurnDrvGetPaletteEntries()) EnableMenuItem(hMenu, MENU_PALETTEVIEWER, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SNAPFACT, MF_ENABLED | MF_BYCOMMAND); - } - - if (WaveLog) { - EnableMenuItem(hMenu, MENU_WLOGEND, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_WLOGSTART, MF_GRAYED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_WLOGEND, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_WLOGSTART, MF_ENABLED | MF_BYCOMMAND); - } - - { // Enabled by default / selectively disabled below (nReplayStatus & kNetGame blocks) - EnableMenuItem(hMenu, MENU_STARTRECORD, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STARTREPLAY, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_SAVE_SLOT, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_SAVE_DIALOG, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_LOAD_SLOT, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_LOAD_DIALOG, MF_ENABLED | MF_BYCOMMAND); - } - - if (nReplayStatus) { - EnableMenuItem(hMenu, MENU_STOPREPLAY, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STARTRECORD, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STARTREPLAY, MF_GRAYED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_STOPREPLAY, MF_GRAYED | MF_BYCOMMAND); - } - - if (kNetGame) { - EnableMenuItem(hMenu, MENU_STARTRECORD, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STARTREPLAY, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_SAVE_SLOT, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_SAVE_DIALOG, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_LOAD_SLOT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_LOAD_DIALOG, MF_GRAYED | MF_BYCOMMAND); - } - -#ifdef INCLUDE_AVI_RECORDING - if (nAviStatus) { - EnableMenuItem(hMenu, MENU_AVISTART, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AVISTOP, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AVI1X, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AVI2X, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AVI3X, MF_GRAYED | MF_BYCOMMAND); - } else { - EnableMenuItem(hMenu, MENU_AVISTART, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AVISTOP, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AVI1X, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AVI2X, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AVI3X, MF_ENABLED | MF_BYCOMMAND); - } -#endif - } else { - bAltPause = 0; - - EnableMenuItem(hMenu, MENU_LOAD, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_MEMCARD_CREATE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_MEMCARD_SELECT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_MEMCARD_INSERT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_MEMCARD_EJECT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STARTNET, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STARTREPLAY, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STARTRECORD, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STOPREPLAY, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_QUIT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_EXIT, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_INPUT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SETCPUCLOCK, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_RESETCPUCLOCK, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_PAUSE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_FORCE60HZ, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DIPSW, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_ENABLECHEAT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DEBUG, MF_GRAYED | MF_BYCOMMAND); -#ifdef BUILD_A68K - EnableMenuItem(hMenu, MENU_ASSEMBLYCORE, MF_ENABLED | MF_BYCOMMAND); -#endif - EnableMenuItem(hMenu, MENU_SAVEHISCORES, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_USEBLEND, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_LOAD_SLOT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_LOAD_DIALOG, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_SAVE_SLOT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_STATE_SAVE_DIALOG, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_FRAMES, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_NOSOUND, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_11025, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_22050, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_44100, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_DSOUND_48000, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_NOSOUND, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_11025, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_22050, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_44100, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_XAUDIO_48000, MF_ENABLED | MF_BYCOMMAND); -// EnableMenuItem(hMenu, MENU_INTERPOLATE_1, MF_ENABLED | MF_BYCOMMAND); -// EnableMenuItem(hMenu, MENU_INTERPOLATE_3, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_WLOGSTART, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_INTERPOLATE_FM_0, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_INTERPOLATE_FM_3, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_WLOGEND, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SAVESNAP, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SNAPFACT, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_PALETTEVIEWER, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_SAVEGAMEINPUTNOW, MF_GRAYED | MF_BYCOMMAND); -#ifdef INCLUDE_AVI_RECORDING - EnableMenuItem(hMenu, MENU_AVISTART, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AVISTOP, MF_GRAYED | MF_BYCOMMAND); -#endif - EnableMenuItem(hMenu, MENU_CDIMAGE, MF_ENABLED | MF_BYCOMMAND); - - EnableMenuItem(hMenu, MENU_AUD_PLUGIN_1, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_AUD_PLUGIN_2, MF_ENABLED | MF_BYCOMMAND); - } -} diff --git a/jan/src/burner/win32/misc_win32.cpp b/jan/src/burner/win32/misc_win32.cpp deleted file mode 100644 index 8901e9b26..000000000 --- a/jan/src/burner/win32/misc_win32.cpp +++ /dev/null @@ -1,290 +0,0 @@ -#include "burner.h" - -bool bIsWindowsXPorGreater = false; -bool bIsWindowsXP = false; -bool bIsWindows8OrGreater = false; - -// Detect if we are using Windows XP/Vista/7 -BOOL DetectWindowsVersion() -{ - OSVERSIONINFO osvi; - BOOL bIsWindowsXPorLater; - - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - - GetVersionEx(&osvi); - - // osvi.dwMajorVersion returns the windows version: 5 = XP 6 = Vista/7 - // osvi.dwMinorVersion returns the minor version, XP and 7 = 1, Vista = 0 - bIsWindowsXPorLater = ((osvi.dwMajorVersion > 5) || ( (osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion >= 1))); - bIsWindowsXP = (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1); - bIsWindows8OrGreater = ((osvi.dwMajorVersion > 6) || ((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion >= 2))); - - return bIsWindowsXPorLater; -} - -// Set the current directory to be the application's directory -int AppDirectory() -{ - TCHAR szPath[MAX_PATH] = _T(""); - int nLen = 0; - TCHAR *pc1, *pc2; - TCHAR* szCmd = GetCommandLine(); - - // Find the end of the "c:\directory\program.exe" bit - if (szCmd[0] == _T('\"')) { // Filename is enclosed in quotes - szCmd++; - for (pc1 = szCmd; *pc1; pc1++) { - if (*pc1 == _T('\"')) break; // Find the last " - } - } else { - for (pc1 = szCmd; *pc1; pc1++) { - if (*pc1 == _T(' ')) break; // Find the first space - } - } - // Find the last \ or / - for (pc2 = pc1; pc2 >= szCmd; pc2--) { - if (*pc2 == _T('\\')) break; - if (*pc2 == _T('/')) break; - } - - // Copy the name of the executable into a variable - nLen = pc1 - pc2 - 1; - if (nLen > EXE_NAME_SIZE) { - nLen = EXE_NAME_SIZE; - } - _tcsncpy(szAppExeName, pc2 + 1, nLen); - szAppExeName[nLen] = 0; - - // strip .exe - if ((pc1 = _tcschr(szAppExeName, _T('.'))) != 0) { - *pc1 = 0; - } - - nLen = pc2 - szCmd; - if (nLen <= 0) return 1; // No path - - // Now copy the path into a new buffer - _tcsncpy(szPath, szCmd, nLen); - SetCurrentDirectory(szPath); // Finally set the current directory to be the application's directory - - dprintf(szPath); - dprintf(_T("\n")); - - return 0; -} - -void UpdatePath(TCHAR* path) -{ - int pathlen = _tcslen(path); - if (pathlen) { - DWORD attrib = INVALID_FILE_ATTRIBUTES; - TCHAR curdir[MAX_PATH] = _T(""); - int curlen = 0; - - attrib = GetFileAttributes(path); - if (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY) && path[pathlen - 1] != _T('\\')) { - path[pathlen] = _T('\\'); - path[pathlen + 1] = _T('\0'); - - pathlen++; - } - - GetCurrentDirectory(sizeof(curdir), curdir); - curlen = _tcslen(curdir); - - if (_tcsnicmp(curdir, path, curlen) == 0 && path[curlen] == _T('\\')) { - TCHAR newpath[MAX_PATH]; - - _tcscpy(newpath, path + curlen + 1); - _tcscpy(path, newpath); - } - } -} - -// --------------------------------------------------------------------------- - -static void MyRegCreateKeys(int nDepth, TCHAR* pNames[], HKEY* pResult) -{ - for (int i = 0; i < nDepth; i++) { - pResult[i] = NULL; - RegCreateKeyEx((i ? pResult[i - 1] : HKEY_CLASSES_ROOT), pNames[i], 0, _T(""), 0, KEY_WRITE, NULL, &pResult[i], NULL); - } -} - -static void MyRegCloseKeys(int nDepth, HKEY* pKeys) -{ - for (int i = nDepth - 1; i >= 0; i--) { - if (pKeys[i]) { - RegCloseKey(pKeys[i]); - } - } -} - -static void MyRegDeleteKeys(int nDepth, TCHAR* pNames[], HKEY* pKeys) -{ - for (int i = 0; i < nDepth - 1; i++) { - pKeys[i] = NULL; - RegOpenKeyEx((i ? pKeys[i - 1] : HKEY_CLASSES_ROOT), pNames[i], 0, 0, &pKeys[i]); - } - for (int i = nDepth - 1; i >= 0; i--) { - RegDeleteKey((i ? pKeys[i - 1] : HKEY_CLASSES_ROOT), pNames[i]); - if (i) { - RegCloseKey(pKeys[i - 1]); - } - } -} - -void RegisterExtensions(bool bCreateKeys) -{ - HKEY myKeys[4]; - - TCHAR* myKeynames1[1] = { _T(".fr") }; - TCHAR* myKeynames2[1] = { _T(".fs") }; - TCHAR* myKeynames3[4] = { _T("FBAlpha"), _T("shell"), _T("open"), _T("command") }; - TCHAR* myKeynames4[2] = { _T("FBAlpha"), _T("DefaultIcon") }; - TCHAR myKeyValue[MAX_PATH + 32] = _T(""); - - if (bCreateKeys) { - TCHAR szExename[MAX_PATH] = _T(""); - GetModuleFileName(NULL, szExename, MAX_PATH); - - MyRegCreateKeys(1, myKeynames1, myKeys); - _stprintf(myKeyValue, _T("FBAlpha")); - RegSetValueEx(myKeys[0], NULL, 0, REG_SZ, (BYTE*)myKeyValue, (_tcslen(myKeyValue) + 1) * sizeof(TCHAR)); - MyRegCloseKeys(2, myKeys); - - MyRegCreateKeys(1, myKeynames2, myKeys); - _stprintf(myKeyValue, _T("FBAlpha")); - RegSetValueEx(myKeys[0], NULL, 0, REG_SZ, (BYTE*)myKeyValue, (_tcslen(myKeyValue) + 1) * sizeof(TCHAR)); - MyRegCloseKeys(2, myKeys); - - MyRegCreateKeys(4, myKeynames3, myKeys); - _stprintf(myKeyValue, _T("\"%s\" \"%%1\" -w"), szExename); - RegSetValueEx(myKeys[3], NULL, 0, REG_SZ, (BYTE*)myKeyValue, (_tcslen(myKeyValue) + 1) * sizeof(TCHAR)); - _stprintf(myKeyValue, _T("FB Alpha file")); - RegSetValueEx(myKeys[0], NULL, 0, REG_SZ, (BYTE*)myKeyValue, (_tcslen(myKeyValue) + 1) * sizeof(TCHAR)); - MyRegCloseKeys(4, myKeys); - - MyRegCreateKeys(2, myKeynames4, myKeys); - _stprintf(myKeyValue, _T("\"%s\", 0"), szExename); - RegSetValueEx(myKeys[1], NULL, 0, REG_SZ, (BYTE*)myKeyValue, (_tcslen(myKeyValue) + 1) * sizeof(TCHAR)); - MyRegCloseKeys(2, myKeys); - } else { - MyRegDeleteKeys(2, myKeynames4, myKeys); - MyRegDeleteKeys(4, myKeynames3, myKeys); - MyRegDeleteKeys(1, myKeynames2, myKeys); - MyRegDeleteKeys(1, myKeynames1, myKeys); - } - - return; -} - -// --------------------------------------------------------------------------- - -// Get the position of the client area of a window on the screen -int GetClientScreenRect(HWND hWnd, RECT *pRect) -{ - POINT Corner = {0, 0}; - - GetClientRect(hWnd, pRect); - ClientToScreen(hWnd, &Corner); - - pRect->left += Corner.x; - pRect->right += Corner.x; - pRect->top += Corner.y; - pRect->bottom += Corner.y; - - return 0; -} - -// Put a window in the middle of another window -int WndInMid(HWND hMid, HWND hBase) -{ - RECT MidRect = {0, 0, 0, 0}; - int mw = 0, mh = 0; - RECT BaseRect = {0, 0, 0, 0}; - int bx = 0, by = 0; - - // Find the height and width of the Mid window - GetWindowRect(hMid, &MidRect); - mw = MidRect.right - MidRect.left; - mh = MidRect.bottom - MidRect.top; - - // Find the center of the Base window - if (hBase && IsWindowVisible(hBase)) { - GetWindowRect(hBase, &BaseRect); - if (hBase == hScrnWnd) { - // For the main window, center in the client area. - BaseRect.left += GetSystemMetrics(SM_CXSIZEFRAME); - BaseRect.right -= GetSystemMetrics(SM_CXSIZEFRAME); - BaseRect.top += GetSystemMetrics(SM_CYSIZEFRAME); - if (bMenuEnabled) { - BaseRect.top += GetSystemMetrics(SM_CYCAPTION) + nMenuHeight; - } - BaseRect.bottom -= GetSystemMetrics(SM_CYSIZEFRAME); - } - } else { - SystemParametersInfo(SPI_GETWORKAREA, 0, &BaseRect, 0); - } - - bx = BaseRect.left + BaseRect.right; - bx = (bx - mw) >> 1; - by = BaseRect.top + BaseRect.bottom; - by = (by - mh) >> 1; - - if (hBase) { - SystemParametersInfo(SPI_GETWORKAREA, 0, &SystemWorkArea, 0); - - if (bx + mw > SystemWorkArea.right) { - bx = SystemWorkArea.right - mw; - } - if (by + mh > SystemWorkArea.bottom) { - by = SystemWorkArea.bottom - mh; - } - if (bx < SystemWorkArea.left) { - bx = SystemWorkArea.left; - } - if (by < SystemWorkArea.top) { - by = SystemWorkArea.top; - } - } - - // Center the window - SetWindowPos(hMid, NULL, bx, by, 0, 0, SWP_NOSIZE | SWP_NOZORDER); - - return 0; -} - -// --------------------------------------------------------------------------- - -// Set-up high resolution timing - -static int bHighResolutionTimerActive = 0; - -void EnableHighResolutionTiming() -{ - TIMECAPS hTCaps; - - bHighResolutionTimerActive = 0; - - if (bIsWindows8OrGreater) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" ** Enabling High-Resolution system timer.\n")); -#endif - - if (timeGetDevCaps(&hTCaps, sizeof(hTCaps)) == TIMERR_NOERROR) { - bHighResolutionTimerActive = hTCaps.wPeriodMin; - timeBeginPeriod(hTCaps.wPeriodMin); - } - } -} - -void DisableHighResolutionTiming() -{ - if (bHighResolutionTimerActive) { - timeEndPeriod(bHighResolutionTimerActive); - bHighResolutionTimerActive = 0; - } -} diff --git a/jan/src/burner/win32/neocdlist.cpp b/jan/src/burner/win32/neocdlist.cpp deleted file mode 100644 index 943d1ad59..000000000 --- a/jan/src/burner/win32/neocdlist.cpp +++ /dev/null @@ -1,519 +0,0 @@ -// --------------------------------------------------------------------------------------- -// NeoGeo CD Game Info Module (by CaptainCPS-X) -// --------------------------------------------------------------------------------------- -#include "burner.h" -#include "neocdlist.h" - -struct NGCDGAME games[] = -{ -// ---------------------------------------------------------------------------------------------------------------------------------------------// -// * Name * Title * Year * Company * Game ID // -// ---------------------------------------------------------------------------------------------------------------------------------------------// - { _T("nam1975") , _T("NAM-1975") , _T("1990") , _T("SNK") , 0x0001 }, // - { _T("bstars") , _T("Baseball Stars Professional") , _T("1991") , _T("SNK") , 0x0002 }, // - { _T("tpgolf") , _T("Top Player's Golf") , _T("1990") , _T("SNK") , 0x0003 }, // - { _T("mahretsu") , _T("Mahjong Kyo Retsuden - Nishi Nihon Hen") , _T("1990") , _T("SNK") , 0x0004 }, // - { _T("maglord") , _T("Magician Lord") , _T("1990") , _T("ADK") , 0x0005 }, // - { _T("ridhero") , _T("Riding Hero") , _T("1991") , _T("SNK") , 0x0006 }, // - { _T("alpham2") , _T("Alpha Mission II / ASO II - Last Guardian") , _T("1994") , _T("SNK") , 0x0007 }, // - { _T("ncombat") , _T("Ninja Combat") , _T("1990") , _T("SNK/ADK") , 0x0009 }, // - { _T("cyberlip") , _T("Cyber-Lip") , _T("1991") , _T("SNK") , 0x0010 }, // - { _T("superspy") , _T("The Super Spy") , _T("1990") , _T("SNK") , 0x0011 }, // - { _T("mutnat") , _T("Mutation Nation") , _T("1995") , _T("SNK") , 0x0014 }, // - { _T("sengoku") , _T("Sengoku / Sengoku Denshou") , _T("1994") , _T("SNK") , 0x0017 }, // - { _T("burningf") , _T("Burning Fight") , _T("1994") , _T("SNK") , 0x0018 }, // - { _T("lbowling") , _T("League Bowling") , _T("1994") , _T("SNK") , 0x0019 }, // - { _T("gpilots") , _T("Ghost Pilots") , _T("1991") , _T("SNK") , 0x0020 }, // - { _T("joyjoy") , _T("Puzzled / Joy Joy Kid") , _T("1990") , _T("SNK") , 0x0021 }, // - { _T("bjourney") , _T("Blue's Journey / Raguy") , _T("1990") , _T("SNK/ADK") , 0x0022 }, // - { _T("lresort") , _T("Last Resort") , _T("1994") , _T("SNK") , 0x0024 }, // - { _T("2020bb") , _T("2020 Super Baseball") , _T("1994") , _T("SNK") , 0x0030 }, // - { _T("socbrawl") , _T("Soccer Brawl") , _T("1991") , _T("SNK") , 0x0031 }, // - { _T("roboarmy") , _T("Robo Army") , _T("1991") , _T("SNK") , 0x0032 }, // - { _T("fatfury") , _T("Fatal Fury - The Battle of Fury") , _T("1994") , _T("SNK") , 0x0033 }, // - { _T("fbfrenzy") , _T("Football Frenzy") , _T("1994") , _T("SNK") , 0x0034 }, // - { _T("crswords") , _T("Crossed Swords") , _T("1994") , _T("SNK/ADK") , 0x0037 }, // - { _T("rallych") , _T("Rally Chase") , _T("1991") , _T("SNK/ADK") , 0x0038 }, // - { _T("kotm2") , _T("King of the Monsters 2") , _T("1992") , _T("SNK") , 0x0039 }, // - { _T("sengoku2") , _T("Sengoku 2 / Sengoku Denshou 2") , _T("1994") , _T("SNK") , 0x0040 }, // - { _T("bstars2") , _T("Baseball Stars 2") , _T("1992") , _T("SNK") , 0x0041 }, // - { _T("3countb") , _T("3 Count Bout / Fire Suplex") , _T("1995") , _T("SNK") , 0x0043 }, // - { _T("aof") , _T("Art of Fighting / Ryuuko no Ken") , _T("1994") , _T("SNK") , 0x0044 }, // - { _T("samsho") , _T("Samurai Shodown / Samurai Spirits") , _T("1993") , _T("SNK") , 0x0045 }, // - { _T("tophuntr") , _T("Top Hunter - Roddy & Cathy") , _T("1994") , _T("SNK") , 0x0046 }, // - { _T("fatfury2") , _T("Fatal Fury 2 / Garou Densetsu 2 - Aratanaru Tatakai") , _T("1994") , _T("SNK") , 0x0047 }, // - { _T("janshin") , _T("Janshin Densetsu - Quest of the Jongmaster") , _T("1995") , _T("Yubis") , 0x0048 }, // - { _T("ncommand") , _T("Ninja Commando") , _T("1992") , _T("SNK") , 0x0050 }, // - { _T("viewpoin") , _T("Viewpoint") , _T("1992") , _T("Sammy/Aicom") , 0x0051 }, // - { _T("ssideki") , _T("Super Sidekicks / Tokuten Oh") , _T("1993") , _T("SNK") , 0x0052 }, // - { _T("wh1") , _T("World Heroes") , _T("1992") , _T("ADK") , 0x0053 }, // - { _T("crsword2") , _T("Crossed Swords II") , _T("1995") , _T("SNK/ADK") , 0x0054 }, // - { _T("kof94") , _T("The King of Fighters '94 (JP)") , _T("1994") , _T("SNK") , 0x0055 }, // - { _T("kof94ju") , _T("The King of Fighters '94 (JP-US)") , _T("1994") , _T("SNK") , 0x1055 }, // custom id - { _T("aof2") , _T("Art of Fighting 2 / Ryuuko no Ken 2") , _T("1994") , _T("SNK") , 0x0056 }, // - { _T("wh2") , _T("World Heroes 2") , _T("1995") , _T("SNK/ADK") , 0x0057 }, // - { _T("fatfursp") , _T("Fatal Fury Special / Garou Densetsu Special") , _T("1994") , _T("SNK") , 0x0058 }, // - { _T("savagere") , _T("Savage Reign / Fu'un Mokujiroku - Kakutou Sousei") , _T("1995") , _T("SNK") , 0x0059 }, // - { _T("ssideki2") , _T("Super Sidekicks 2 / Tokuten Oh 2") , _T("1994") , _T("SNK") , 0x0061 }, // - { _T("samsho2") , _T("Samurai Shodown 2 / Shin Samurai Spirits") , _T("1994") , _T("SNK") , 0x0063 }, // - { _T("wh2j") , _T("World Heroes 2 Jet") , _T("1995") , _T("SNK/ADK") , 0x0064 }, // - { _T("wjammers") , _T("Windjammers / Flying Power Disc") , _T("1994") , _T("Data East") , 0x0065 }, // - { _T("karnovr") , _T("Karnov's Revenge / Fighters History Dynamite") , _T("1994") , _T("Data East") , 0x0066 }, // - { _T("pspikes2") , _T("Power Spikes II") , _T("1994") , _T("Video System") , 0x0068 }, // - { _T("aodk") , _T("Aggressors of Dark Kombat / Tsuukai GanGan Koushinkyoku") , _T("1994"), _T("SNK/ADK") , 0x0074 }, // - { _T("sonicwi2") , _T("Aero Fighters 2 / Sonic Wings 2") , _T("1994") , _T("Video System") , 0x0075 }, // - { _T("galaxyfg") , _T("Galaxy Fight - Universal Warriors") , _T("1995") , _T("Sunsoft") , 0x0078 }, // - { _T("strhoop") , _T("Street Hoop / Dunk Dream") , _T("1994") , _T("Data East") , 0x0079 }, // - { _T("quizkof") , _T("Quiz King of Fighters") , _T("1993") , _T("SNK/Saurus") , 0x0080 }, // - { _T("ssideki3") , _T("Super Sidekicks 3 - The Next Glory / Tokuten Oh 3 - Eikoue No Chousen"), _T("1995") , _T("SNK") , 0x0081 }, // - { _T("doubledr") , _T("Double Dragon") , _T("1995") , _T("Technos") , 0x0082 }, // - { _T("pbobblen") , _T("Puzzle Bobble / Bust-A-Move") , _T("1994") , _T("SNK") , 0x0083 }, // - { _T("kof95") , _T("The King of Fighters '95 (JP-US)") , _T("1995") , _T("SNK") , 0x0084 }, // - { _T("kof95r1") , _T("The King of Fighters '95 (JP-US)(Rev 1)") , _T("1995") , _T("SNK") , 0x1084 }, // - { _T("ssrpg") , _T("Shinsetsu Samurai Spirits - Bushidohretsuden") , _T("1997") , _T("SNK") , 0x0085 }, // - { _T("samsho3") , _T("Samurai Shodown 3 / Samurai Spirits 3") , _T("1995") , _T("SNK") , 0x0087 }, // - { _T("stakwin") , _T("Stakes Winner - GI Kanzen Seiha Heno Machi") , _T("1995") , _T("Saurus") , 0x0088 }, // - { _T("pulstar") , _T("Pulstar") , _T("1995") , _T("Aicom") , 0x0089 }, // - { _T("whp") , _T("World Heroes Perfect") , _T("1995") , _T("ADK") , 0x0090 }, // - { _T("kabukikl") , _T("Kabuki Klash / Tengai Makyou Shinden - Far East of Eden") , _T("1995"), _T("Hudson") , 0x0092 }, // - { _T("gowcaizr") , _T("Voltage Fighter Gowcaizer / Choujin Gakuen Gowcaizer"), _T("1995") , _T("Technos") , 0x0094 }, // - { _T("rbff1") , _T("Real Bout Fatal Fury") , _T("1995") , _T("SNK") , 0x0095 }, // - { _T("aof3") , _T("Art of Fighting 3: Path of the Warrior") , _T("1996") , _T("SNK") , 0x0096 }, // - { _T("sonicwi3") , _T("Aero Fighters 3 / Sonic Wings 3") , _T("1995") , _T("SNK") , 0x0097 }, // - { _T("fromanc2") , _T("Idol Mahjong Final Romance 2") , _T("1995") , _T("Video Systems") , 0x0098 }, // - { _T("turfmast") , _T("Neo Turf Masters / Big Tournament Golf") , _T("1996") , _T("Nazca") , 0x0200 }, // - { _T("mslug") , _T("Metal Slug - Super Vehicle-001") , _T("1996") , _T("Nazca") , 0x0201 }, // - { _T("mosyougi") , _T("Shougi no Tatsujin - Master of Syougi") , _T("1995") , _T("ADK") , 0x0203 }, // - { _T("adkworld") , _T("ADK World / ADK Special") , _T("1995") , _T("ADK") , 0x0204 }, // - { _T("ngcdsp") , _T("Neo Geo CD Special") , _T("1995") , _T("SNK") , 0x0205 }, // - { _T("zintrick") , _T("Zintrick / Oshidashi Zintrick") , _T("1996") , _T("ADK") , 0x0211 }, // - { _T("overtop") , _T("OverTop") , _T("1996") , _T("ADK") , 0x0212 }, // - { _T("neodrift") , _T("Neo DriftOut") , _T("1996") , _T("Visco") , 0x0213 }, // - { _T("kof96") , _T("The King of Fighters '96") , _T("1996") , _T("SNK") , 0x0214 }, // - { _T("ninjamas") , _T("Ninja Master's - Haou Ninpou-Chou") , _T("1996") , _T("ADK/SNK") , 0x0217 }, // - { _T("ragnagrd") , _T("Ragnagard / Shinouken") , _T("1996") , _T("Saurus") , 0x0218 }, // - { _T("pgoal") , _T("Pleasuregoal - 5 on 5 Mini Soccer / Futsal") , _T("1996") , _T("Saurus") , 0x0219 }, // - { _T("ironclad") , _T("Ironclad / Choutetsu Brikin'ger") , _T("1996") , _T("Saurus") , 0x0220 }, // - { _T("magdrop2") , _T("Magical Drop 2") , _T("1996") , _T("Data East") , 0x0221 }, // - { _T("samsho4") , _T("Samurai Shodown IV - Amakusa's Revenge") , _T("1996") , _T("SNK") , 0x0222 }, // - { _T("rbffspec") , _T("Real Bout Fatal Fury Special") , _T("1996") , _T("SNK") , 0x0223 }, // - { _T("twinspri") , _T("Twinkle Star Sprites") , _T("1996") , _T("ADK") , 0x0224 }, // - { _T("kof96ngc") , _T("The King of Fighters '96 NEOGEO Collection") , _T("1996") , _T("SNK") , 0x0229 }, // - { _T("breakers") , _T("Breakers") , _T("1996") , _T("Visco") , 0x0230 }, // - { _T("kof97") , _T("The King of Fighters '97") , _T("1997") , _T("SNK") , 0x0232 }, // - { _T("lastblad") , _T("The Last Blade / Bakumatsu Roman - Gekka no Kenshi") , _T("1997") , _T("SNK") , 0x0234 }, // - { _T("rbff2") , _T("Real Bout Fatal Fury 2 / Garou Densetsu 2 - Aratanaru Tatakai"), _T("1998"), _T("SNK") , 0x0240 }, // - { _T("mslug2") , _T("Metal Slug 2 - Super Vehicle-001/II") , _T("1998") , _T("SNK") , 0x0241 }, // - { _T("kof98") , _T("The King of Fighters '98 - The Slugfest") , _T("1998") , _T("SNK") , 0x0242 }, // - { _T("lastbld2") , _T("The Last Blade 2") , _T("1998") , _T("SNK") , 0x0243 }, // - { _T("kof99") , _T("The King of Fighters '99 - Millennium Battle") , _T("1999") , _T("SNK") , 0x0251 }, // - { _T("fatfury3") , _T("Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - Harukanaru Tatakai"), _T("1995"), _T("SNK"), 0x069c }, // -}; - -NGCDGAME* GetNeoGeoCDInfo(unsigned int nID) -{ - for(unsigned int nGame = 0; nGame < (sizeof(games) / sizeof(NGCDGAME)); nGame++) { - if(nID == games[nGame].id ) { - return &games[nGame]; - } - } - - return NULL; -} - -// Update the main window title -void SetNeoCDTitle(TCHAR* pszTitle) -{ - TCHAR szText[1024] = _T(""); - _stprintf(szText, _T(APP_TITLE) _T( " v%.20s") _T(SEPERATOR_1) _T("%s") _T(SEPERATOR_1) _T("%s"), szAppBurnVer, BurnDrvGetText(DRV_FULLNAME), pszTitle); - - SetWindowText(hScrnWnd, szText); -} - -NGCDGAME* game; - -// Get the title -int GetNeoCDTitle(unsigned int nGameID) -{ - game = (NGCDGAME*)malloc(sizeof(NGCDGAME)); - memset(game, 0, sizeof(NGCDGAME)); - - if(GetNeoGeoCDInfo(nGameID)) { - memcpy(game, GetNeoGeoCDInfo(nGameID), sizeof(NGCDGAME)); - - bprintf(PRINT_NORMAL, _T(" Title: %s \n") , game->pszTitle); - bprintf(PRINT_NORMAL, _T(" Shortname: %s \n") , game->pszName); - bprintf(PRINT_NORMAL, _T(" Year: %s \n") , game->pszYear); - bprintf(PRINT_NORMAL, _T(" Company: %s \n") , game->pszCompany); - - // Update the main window title - SetNeoCDTitle(game->pszTitle); - - return 1; - } else { - SetNeoCDTitle(FBALoadStringEx(hAppInst, IDS_UNIDENTIFIED_CD, true)); - } - - game = NULL; - return 0; -} - -void iso9660_ReadOffset(unsigned char *Dest, FILE* fp, unsigned int lOffset, unsigned int lSize, unsigned int lLength) -{ - if(fp == NULL) return; - if (Dest == NULL) return; - - fseek(fp, lOffset, SEEK_SET); - fread(Dest, lLength, lSize, fp); -} - -static void NeoCDList_iso9660_CheckDirRecord(FILE* fp, int nSector) -{ - int nSectorLength = 2048; - //int nFile = 0; - unsigned int lBytesRead = 0; - //int nLen = 0; - unsigned int lOffset = 0; - bool bNewSector = false; - bool bRevisionQueve = false; - int nRevisionQueveID = 0; - - lOffset = (nSector * nSectorLength); - - unsigned char* nLenDR = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* Flags = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* ExtentLoc = (unsigned char*)malloc(8 * sizeof(unsigned char)); - unsigned char* Data = (unsigned char*)malloc(0x10b * sizeof(unsigned char)); - unsigned char* LEN_FI = (unsigned char*)malloc(1 * sizeof(unsigned char)); - char *File = (char*)malloc(32 * sizeof(char)); - - while(1) - { - iso9660_ReadOffset(nLenDR, fp, lOffset, 1, sizeof(unsigned char)); - - if(nLenDR[0] == 0x22) { - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - if(nLenDR[0] < 0x22) - { - if(bNewSector) - { - if(bRevisionQueve) { - bRevisionQueve = false; - - GetNeoCDTitle(nRevisionQueveID); - } - return; - } - - nLenDR[0] = 0; - iso9660_ReadOffset(nLenDR, fp, lOffset + 1, 1, sizeof(unsigned char)); - - if(nLenDR[0] < 0x22) { - lOffset += (2048 - lBytesRead); - lBytesRead = 0; - bNewSector = true; - continue; - } - } - - bNewSector = false; - - iso9660_ReadOffset(Flags, fp, lOffset + 25, 1, sizeof(unsigned char)); - - if(!(Flags[0] & (1 << 1))) - { - iso9660_ReadOffset(ExtentLoc, fp, lOffset + 2, 8, sizeof(unsigned char)); - - char szValue[9]; - sprintf(szValue, "%02x%02x%02x%02x", ExtentLoc[4], ExtentLoc[5], ExtentLoc[6], ExtentLoc[7]); - - unsigned int nValue = 0; - sscanf(szValue, "%x", &nValue); - - iso9660_ReadOffset(Data, fp, nValue * 2048, 0x10a, sizeof(unsigned char)); - - char szData[8]; - sprintf(szData, "%c%c%c%c%c%c%c", Data[0x100], Data[0x101], Data[0x102], Data[0x103], Data[0x104], Data[0x105], Data[0x106]); - - if(!strncmp(szData, "NEO-GEO", 7)) - { - char id[] = "0000"; - sprintf(id, "%02X%02X", Data[0x108], Data[0x109]); - - unsigned int nID = 0; - sscanf(id, "%x", &nID); - - iso9660_ReadOffset(LEN_FI, fp, lOffset + 32, 1, sizeof(unsigned char)); - - iso9660_ReadOffset((unsigned char*)File, fp, lOffset + 33, LEN_FI[0], sizeof(char)); - strncpy(File, File, LEN_FI[0]); - File[LEN_FI[0]] = 0; - - // King of Fighters '94, The (1994)(SNK)(JP) - // 10-6-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xDE) { - // ...continue - } - - // King of Fighters '94, The (1994)(SNK)(JP-US) - // 11-21-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xE6) { - // Change to custom revision id - nID = 0x1055; - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B01, B03-B06, NGCD-084E MT B01] - // 9-11-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xC0) { - // ... continue - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B10, NGCD-084E MT B03] - // 10-5-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xFF) { - // Change to custom revision id - nID = 0x1084; - } - - // King of Fighters '96 NEOGEO Collection, The - if(nID == 0x0229) { - bRevisionQueve = false; - - GetNeoCDTitle(nID); - break; - } - - // King of Fighters '96, The - if(nID == 0x0214) { - bRevisionQueve = true; - nRevisionQueveID = nID; - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - GetNeoCDTitle(nID); - - break; - } - } - - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - } - - if (nLenDR) { - free(nLenDR); - nLenDR = NULL; - } - - if (Flags) { - free(Flags); - Flags = NULL; - } - - if (ExtentLoc) { - free(ExtentLoc); - ExtentLoc = NULL; - } - - if (Data) { - free(Data); - Data = NULL; - } - - if (LEN_FI) { - free(LEN_FI); - LEN_FI = NULL; - } - - if (File) { - free(File); - File = NULL; - } -} - -// Check the specified ISO, and proceed accordingly -static int NeoCDList_CheckISO(TCHAR* pszFile) -{ - if(!pszFile) { - // error - return 0; - } - - // Make sure we have a valid ISO file extension... - if(_tcsstr(pszFile, _T(".iso")) || _tcsstr(pszFile, _T(".ISO")) ) - { - FILE* fp = _tfopen(pszFile, _T("rb")); - if(fp) - { - // Read ISO and look for 68K ROM standard program header, ID is always there - // Note: This function works very quick, doesn't compromise performance :) - // it just read each sector first 264 bytes aproximately only. - - // Get ISO Size (bytes) - fseek(fp, 0, SEEK_END); - unsigned int lSize = 0; - lSize = ftell(fp); - //rewind(fp); - fseek(fp, 0, SEEK_SET); - - // If it has at least 16 sectors proceed - if(lSize > (2048 * 16)) - { - // Check for Standard ISO9660 Identifier - unsigned char IsoHeader[2048 * 16 + 1]; - unsigned char IsoCheck[6]; - - fread(IsoHeader, 1, 2048 * 16 + 1, fp); // advance to sector 16 and PVD Field 2 - fread(IsoCheck, 1, 5, fp); // get Standard Identifier Field from PVD - - // Verify that we have indeed a valid ISO9660 MODE1/2048 - if(!memcmp(IsoCheck, "CD001", 5)) - { - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Found. \n")); - iso9660_VDH vdh; - - // Get Volume Descriptor Header - memset(&vdh, 0, sizeof(vdh)); - //memcpy(&vdh, iso9660_ReadOffset(fp, (2048 * 16), sizeof(vdh)), sizeof(vdh)); - iso9660_ReadOffset((unsigned char*)&vdh, fp, 2048 * 16, 1, sizeof(vdh)); - - // Check for a valid Volume Descriptor Type - if(vdh.vdtype == 0x01) - { -#if 0 -// This will fail on 64-bit due to differing variable sizes in the pvd struct - // Get Primary Volume Descriptor - iso9660_PVD pvd; - memset(&pvd, 0, sizeof(pvd)); - //memcpy(&pvd, iso9660_ReadOffset(fp, (2048 * 16), sizeof(pvd)), sizeof(pvd)); - iso9660_ReadOffset((unsigned char*)&pvd, fp, 2048 * 16, 1, sizeof(pvd)); - - // ROOT DIRECTORY RECORD - - // Handle Path Table Location - char szRootSector[32]; - unsigned int nRootSector = 0; - - sprintf(szRootSector, "%02X%02X%02X%02X", - pvd.root_directory_record.location_of_extent[4], - pvd.root_directory_record.location_of_extent[5], - pvd.root_directory_record.location_of_extent[6], - pvd.root_directory_record.location_of_extent[7]); - - // Convert HEX string to Decimal - sscanf(szRootSector, "%X", &nRootSector); -#else -// Just read from the file directly at the correct offset (0x8000 + 0x9e for the start of the root directory record) - unsigned char buffer[8]; - char szRootSector[32]; - unsigned int nRootSector = 0; - - fseek(fp, 0x809e, SEEK_SET); - fread(buffer, 1, 8, fp); - - sprintf(szRootSector, "%02x%02x%02x%02x", buffer[4], buffer[5], buffer[6], buffer[7]); - - sscanf(szRootSector, "%x", &nRootSector); -#endif - - // Process the Root Directory Records - NeoCDList_iso9660_CheckDirRecord(fp, nRootSector); - - // Path Table Records are not processed, since NeoGeo CD should not have subdirectories - // ... - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Not Found, cannot continue. \n")); - return 0; - } - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Couldn't open %s \n"), GetIsoPath()); - return 0; - } - - if(fp) fclose(fp); - - } else { - - //bprintf(PRINT_NORMAL, _T(" File doesn't have a valid ISO extension [ .iso / .ISO ] \n")); - return 0; - } - - return 1; -} - -// This will do everything -int GetNeoGeoCD_Identifier() -{ - if(!GetIsoPath() || !IsNeoGeoCD()) { - return 0; - } - - // Make sure we have a valid ISO file extension... - if(_tcsstr(GetIsoPath(), _T(".iso")) || _tcsstr(GetIsoPath(), _T(".ISO")) ) - { - if(_tfopen(GetIsoPath(), _T("rb"))) - { - // Read ISO and look for 68K ROM standard program header, ID is always there - // Note: This function works very quick, doesn't compromise performance :) - // it just read each sector first 264 bytes aproximately only. - NeoCDList_CheckISO(GetIsoPath()); - - } else { - - bprintf(PRINT_NORMAL, _T(" Couldn't open %s \n"), GetIsoPath()); - return 0; - } - - } else { - - bprintf(PRINT_NORMAL, _T(" File doesn't have a valid ISO extension [ .iso / .ISO ] \n")); - return 0; - } - - return 1; -} - -int NeoCDInfo_Init() -{ - NeoCDInfo_Exit(); - return GetNeoGeoCD_Identifier(); -} - -TCHAR* NeoCDInfo_Text(int nText) -{ - if(!game || !IsNeoGeoCD() || !bDrvOkay) return NULL; - - switch(nText) - { - case DRV_NAME: return game->pszName; - case DRV_FULLNAME: return game->pszTitle; - case DRV_MANUFACTURER: return game->pszCompany; - case DRV_DATE: return game->pszYear; - } - - return NULL; -} - -int NeoCDInfo_ID() -{ - if(!game || !IsNeoGeoCD() || !bDrvOkay) return 0; - return game->id; -} - -void NeoCDInfo_Exit() -{ - if(game) { - free(game); - game = NULL; - } -} diff --git a/jan/src/burner/win32/neocdsel.cpp b/jan/src/burner/win32/neocdsel.cpp deleted file mode 100644 index 64342687b..000000000 --- a/jan/src/burner/win32/neocdsel.cpp +++ /dev/null @@ -1,1331 +0,0 @@ -// ---------------------------------------------------------------------------------------------------------- -// NEOCDSEL.CPP -#include "burner.h" -#include "png.h" -#include "neocdlist.h" - -#include - -int NeoCDList_Init(); -static void NeoCDList_InitListView(); -static int NeoCDList_CheckISO(HWND hList, TCHAR* pszFile); -static void NeoCDList_iso9660_CheckDirRecord(HWND hList, TCHAR* pszFile, FILE* fp, int nSector); -static int NeoCDList_AddGame(TCHAR* pszFile, unsigned int nGameID); -static void NeoCDList_ScanDir(HWND hList, TCHAR* pszDirectory); -static TCHAR* NeoCDList_ParseCUE(TCHAR* pszFile); -static void NeoCDList_ShowPreview(HWND hDlg, TCHAR* szFile, int nCtrID, int nFrameCtrID, float maxw, float maxh); -struct PNGRESOLUTION { int nWidth; int nHeight; }; -static PNGRESOLUTION GetPNGResolution(TCHAR* szFile); - -static INT_PTR CALLBACK NeoCDList_WndProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); -static unsigned __stdcall NeoCDList_DoProc(void*); - -static HWND hNeoCDWnd = NULL; -static HWND hListView = NULL; -static HWND hProcParent = NULL; -static bool bProcessingList = false; -static HANDLE hProcessThread = NULL; -static unsigned ProcessThreadID = 0; - -static HBRUSH hWhiteBGBrush; - -bool bNeoCDListScanSub = false; -bool bNeoCDListScanOnlyISO = false; -TCHAR szNeoCDCoverDir[MAX_PATH] = _T("support/neocdz/"); -TCHAR szNeoCDGamesDir[MAX_PATH] = _T("/neocdiso/"); - -static int nSelectedItem = -1; - -struct GAMELIST { - unsigned int nID; - bool bFoundCUE; - TCHAR szPathCUE[256]; - TCHAR szPath[256]; - TCHAR szISOFile[256]; - int nAudioTracks; - TCHAR szTracks[99][256]; - TCHAR szShortName[32]; - TCHAR szPublisher[100]; -}; - -GAMELIST ngcd_list[100]; -int nListItems = 0; - -// Add game to List -static int NeoCDList_AddGame(TCHAR* pszFile, unsigned int nGameID) -{ - NGCDGAME* game; - - if(GetNeoGeoCDInfo(nGameID)) - { - game = (NGCDGAME*)malloc(sizeof(NGCDGAME)); - memset(game, 0, sizeof(NGCDGAME)); - - memcpy(game, GetNeoGeoCDInfo(nGameID), sizeof(NGCDGAME)); - - TCHAR szNGCDID[12]; - _stprintf(szNGCDID, _T("%04X"), nGameID); - - LVITEM lvi; - ZeroMemory(&lvi, sizeof(lvi)); - - // NGCD-ID [Insert] - lvi.iImage = 0; - lvi.iItem = ListView_GetItemCount(hListView) + 1; - lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; - lvi.cchTextMax = 256; - TCHAR szTitle[256]; - _stprintf(szTitle, _T(" %s"), game->pszTitle); - lvi.pszText = szTitle; - - int nItem = ListView_InsertItem(hListView, &lvi); - - // TITLE - ZeroMemory(&lvi, sizeof(lvi)); - - lvi.iSubItem = 1; - lvi.iItem = nItem; - lvi.cchTextMax = _tcslen(game->pszTitle); - lvi.mask = LVIF_TEXT | LVIF_IMAGE; - lvi.pszText = szNGCDID; - - ListView_SetItem(hListView, &lvi); - - ngcd_list[nListItems].nID = nGameID; - - _tcscpy(ngcd_list[nListItems].szPath, pszFile); - _tcscpy(ngcd_list[nListItems].szShortName, game->pszName); - _stprintf(ngcd_list[nListItems].szPublisher, _T("%s (%s)"), game->pszCompany, game->pszYear); - - nListItems++; - - } else { - // error - - return 0; - } - - if(game) { - free(game); - game = NULL; - } - return 1; -} - -static void NeoCDList_InitListView() -{ - LVCOLUMN LvCol; - ListView_SetExtendedListViewStyle(hListView, LVS_EX_FULLROWSELECT); - - memset(&LvCol, 0, sizeof(LvCol)); - LvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; - - LvCol.cx = 445; - LvCol.pszText = FBALoadStringEx(hAppInst, IDS_NGCD_TITLE, true); - SendMessage(hListView, LVM_INSERTCOLUMN , 0, (LPARAM)&LvCol); - - LvCol.cx = 70; - LvCol.pszText = FBALoadStringEx(hAppInst, IDS_NGCD_NGCDID, true); - SendMessage(hListView, LVM_INSERTCOLUMN , 1, (LPARAM)&LvCol); - - // Setup ListView Icons -// HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR16, 0, 1); -// ListView_SetImageList(hListView, hImageList, LVSIL_SMALL); -// ImageList_AddMasked(hImageList, LoadBitmap(hAppInst, MAKEINTRESOURCE(BMP_CD)), RGB(255, 0, 255)); -} - -static int NeoCDList_CheckDuplicates(HWND hList, unsigned int nID) -{ - int nItemCount = ListView_GetItemCount(hList); - - for(int nItem = 0; nItem < nItemCount; nItem++) - { - unsigned int nItemVal = 0; - TCHAR szText[] = _T("0000"); - - ListView_GetItemText(hList, nItem, 1, szText, 5); - - _stscanf(szText, _T("%x"), &nItemVal); - - if(nItemVal == nID) { - ngcd_list[nItemCount].nAudioTracks = 0; - return 1; // let's get out of here... - } - } - - return 0; -} - -static void NeoCDList_iso9660_CheckDirRecord(HWND hList, TCHAR* pszFile, FILE* fp, int nSector) -{ - int nSectorLength = 2048; - //int nFile = 0; - unsigned int lBytesRead = 0; - //int nLen = 0; - unsigned int lOffset = 0; - bool bNewSector = false; - bool bRevisionQueve = false; - int nRevisionQueveID = 0; - - lOffset = (nSector * nSectorLength); - - unsigned char* nLenDR = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* Flags = (unsigned char*)malloc(1 * sizeof(unsigned char)); - unsigned char* ExtentLoc = (unsigned char*)malloc(8 * sizeof(unsigned char)); - unsigned char* Data = (unsigned char*)malloc(0x10b * sizeof(unsigned char)); - unsigned char* LEN_FI = (unsigned char*)malloc(1 * sizeof(unsigned char)); - char *File = (char*)malloc(32 * sizeof(char)); - - while(1) - { - iso9660_ReadOffset(nLenDR, fp, lOffset, 1, sizeof(unsigned char)); - - if(nLenDR[0] == 0x22) { - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - if(nLenDR[0] < 0x22) - { - if(bNewSector) - { - if(bRevisionQueve) { - bRevisionQueve = false; - - // make sure we don't add duplicates to the list - if(NeoCDList_CheckDuplicates(hList, nRevisionQueveID)) { - return; - } - - NeoCDList_AddGame(pszFile, nRevisionQueveID); - } - return; - } - - nLenDR[0] = 0; - iso9660_ReadOffset(nLenDR, fp, lOffset + 1, 1, sizeof(unsigned char)); - - if(nLenDR[0] < 0x22) { - lOffset += (2048 - lBytesRead); - lBytesRead = 0; - bNewSector = true; - continue; - } - } - - bNewSector = false; - - iso9660_ReadOffset(Flags, fp, lOffset + 25, 1, sizeof(unsigned char)); - - if(!(Flags[0] & (1 << 1))) - { - iso9660_ReadOffset(ExtentLoc, fp, lOffset + 2, 8, sizeof(unsigned char)); - - char szValue[9]; - sprintf(szValue, "%02x%02x%02x%02x", ExtentLoc[4], ExtentLoc[5], ExtentLoc[6], ExtentLoc[7]); - - unsigned int nValue = 0; - sscanf(szValue, "%x", &nValue); - - iso9660_ReadOffset(Data, fp, nValue * 2048, 0x10a, sizeof(unsigned char)); - - char szData[8]; - sprintf(szData, "%c%c%c%c%c%c%c", Data[0x100], Data[0x101], Data[0x102], Data[0x103], Data[0x104], Data[0x105], Data[0x106]); - - if(!strncmp(szData, "NEO-GEO", 7)) - { - _tcscpy(ngcd_list[nListItems].szISOFile, pszFile); - - char id[] = "0000"; - sprintf(id, "%02X%02X", Data[0x108], Data[0x109]); - - unsigned int nID = 0; - sscanf(id, "%x", &nID); - - iso9660_ReadOffset(LEN_FI, fp, lOffset + 32, 1, sizeof(unsigned char)); - - iso9660_ReadOffset((unsigned char*)File, fp, lOffset + 33, LEN_FI[0], sizeof(char)); - strncpy(File, File, LEN_FI[0]); - File[LEN_FI[0]] = 0; - - // King of Fighters '94, The (1994)(SNK)(JP) - // 10-6-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xDE) { - // ...continue - } - - // King of Fighters '94, The (1994)(SNK)(JP-US) - // 11-21-1994 (P1.PRG) - if(nID == 0x0055 && Data[0x67] == 0xE6) { - // Change to custom revision id - nID = 0x1055; - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B01, B03-B06, NGCD-084E MT B01] - // 9-11-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xC0) { - // ... continue - } - - // King of Fighters '95, The (1995)(SNK)(JP-US)[!][NGCD-084 MT B10, NGCD-084E MT B03] - // 10-5-1995 (P1.PRG) - if(nID == 0x0084 && Data[0x6C] == 0xFF) { - // Change to custom revision id - nID = 0x1084; - } - - // King of Fighters '96 NEOGEO Collection, The - if(nID == 0x0229) { - bRevisionQueve = false; - - // make sure we don't add duplicates to the list - if(NeoCDList_CheckDuplicates(hList, nID)) { - return; - } - - NeoCDList_AddGame(pszFile, nID); - break; - } - - // King of Fighters '96, The - if(nID == 0x0214) { - bRevisionQueve = true; - nRevisionQueveID = nID; - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - continue; - } - - // make sure we don't add duplicates to the list - if(NeoCDList_CheckDuplicates(hList, nID)) { - return; - } - - NeoCDList_AddGame(pszFile, nID); - - //MessageBoxA(NULL, id, "", MB_OK); - break; - } - } - - lOffset += nLenDR[0]; - lBytesRead += nLenDR[0]; - } - - if (nLenDR) { - free(nLenDR); - nLenDR = NULL; - } - - if (Flags) { - free(Flags); - Flags = NULL; - } - - if (ExtentLoc) { - free(ExtentLoc); - ExtentLoc = NULL; - } - - if (Data) { - free(Data); - Data = NULL; - } - - if (LEN_FI) { - free(LEN_FI); - LEN_FI = NULL; - } - - if (File) { - free(File); - File = NULL; - } -} - -// Check the specified ISO, and proceed accordingly -static int NeoCDList_CheckISO(HWND hList, TCHAR* pszFile) -{ - if(!pszFile) { - // error - return 0; - } - - // Make sure we have a valid ISO file extension... - if(_tcsstr(pszFile, _T(".iso")) || _tcsstr(pszFile, _T(".ISO")) ) - { - FILE* fp = _tfopen(pszFile, _T("rb")); - if(fp) - { - // Read ISO and look for 68K ROM standard program header, ID is always there - // Note: This function works very quick, doesn't compromise performance :) - // it just read each sector first 264 bytes aproximately only. - - // Get ISO Size (bytes) - fseek(fp, 0, SEEK_END); - unsigned int lSize = 0; - lSize = ftell(fp); - rewind(fp); - - // If it has at least 16 sectors proceed - if(lSize > (2048 * 16)) - { - // Check for Standard ISO9660 Identifier - unsigned char IsoHeader[2048 * 16 + 1]; - unsigned char IsoCheck[6]; - - fread(IsoHeader, 1, 2048 * 16 + 1, fp); // advance to sector 16 and PVD Field 2 - fread(IsoCheck, 1, 5, fp); // get Standard Identifier Field from PVD - - // Verify that we have indeed a valid ISO9660 MODE1/2048 - if(!memcmp(IsoCheck, "CD001", 5)) - { - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Found. \n")); - iso9660_VDH vdh; - - // Get Volume Descriptor Header - memset(&vdh, 0, sizeof(vdh)); - //memcpy(&vdh, iso9660_ReadOffset(fp, (2048 * 16), sizeof(vdh)), sizeof(vdh)); - iso9660_ReadOffset((unsigned char*)&vdh, fp, 2048 * 16, 1, sizeof(vdh)); - - // Check for a valid Volume Descriptor Type - if(vdh.vdtype == 0x01) - { -#if 0 -// This will fail on 64-bit due to differing variable sizes in the pvd struct - // Get Primary Volume Descriptor - iso9660_PVD pvd; - memset(&pvd, 0, sizeof(pvd)); - //memcpy(&pvd, iso9660_ReadOffset(fp, (2048 * 16), sizeof(pvd)), sizeof(pvd)); - iso9660_ReadOffset((unsigned char*)&pvd, fp, 2048 * 16, 1, sizeof(pvd)); - - // ROOT DIRECTORY RECORD - - // Handle Path Table Location - char szRootSector[32]; - unsigned int nRootSector = 0; - - sprintf(szRootSector, "%02X%02X%02X%02X", - pvd.root_directory_record.location_of_extent[4], - pvd.root_directory_record.location_of_extent[5], - pvd.root_directory_record.location_of_extent[6], - pvd.root_directory_record.location_of_extent[7]); - - // Convert HEX string to Decimal - sscanf(szRootSector, "%X", &nRootSector); -#else -// Just read from the file directly at the correct offset (0x8000 + 0x9e for the start of the root directory record) - unsigned char buffer[8]; - char szRootSector[32]; - unsigned int nRootSector = 0; - - fseek(fp, 0x809e, SEEK_SET); - fread(buffer, 1, 8, fp); - - sprintf(szRootSector, "%02x%02x%02x%02x", buffer[4], buffer[5], buffer[6], buffer[7]); - - sscanf(szRootSector, "%x", &nRootSector); -#endif - - // Process the Root Directory Records - NeoCDList_iso9660_CheckDirRecord(hList, pszFile, fp, nRootSector); - - // Path Table Records are not processed, since NeoGeo CD should not have subdirectories - // ... - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Standard ISO9660 Identifier Not Found, cannot continue. \n")); - return 0; - } - } - } else { - - //bprintf(PRINT_NORMAL, _T(" Couldn't open %s \n"), GetIsoPath()); - return 0; - } - - if(fp) fclose(fp); - - } else { - - //bprintf(PRINT_NORMAL, _T(" File doesn't have a valid ISO extension [ .iso / .ISO ] \n")); - return 0; - } - - return 1; -} - -// Scan the specified directory for sub-directories that contain ISO / CUE files -static void NeoCDList_ScanDir(HWND hList, TCHAR* pszDirectory) -{ -// bProcessingList = true; - -// ListView_DeleteAllItems(hList); - - WIN32_FIND_DATA ffdDirectory; - - HANDLE hDirectory = NULL; - memset(&ffdDirectory, 0, sizeof(WIN32_FIND_DATA)); - - // Scan main dir for sub-directories - TCHAR szSearch[2048] = _T("\0"); - - _stprintf(szSearch, _T("%s*"), pszDirectory); - - hDirectory = FindFirstFile(szSearch, &ffdDirectory); - - if (hDirectory == INVALID_HANDLE_VALUE) { - // error - } else { - - do - { - // DIRECTORY - if((ffdDirectory.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { - if(!_tcscmp(ffdDirectory.cFileName, _T(".")) || !_tcscmp(ffdDirectory.cFileName, _T(".."))) - { - // lets ignore " . " and " .. " - continue; - } - - TCHAR* pszISO = NULL; - pszISO = (TCHAR*)malloc(sizeof(TCHAR) * 512); - - bool bDone = false; - - WIN32_FIND_DATA ffdSubDirectory; - - HANDLE hSubDirectory = NULL; - memset(&ffdSubDirectory, 0, sizeof(WIN32_FIND_DATA)); - - TCHAR szSubSearch[512] = _T("\0"); - - if(!bNeoCDListScanOnlyISO) - { - - // Scan sub-directory for CUE - _stprintf(szSubSearch, _T("%s%s/*.cue"), pszDirectory, ffdDirectory.cFileName); - - hSubDirectory = FindFirstFile(szSubSearch, &ffdSubDirectory); - - if (hSubDirectory == INVALID_HANDLE_VALUE) { - // error - } else { - - do - { - // Sub-directories only - if(!(ffdSubDirectory.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { - // File is CUE - if(_tcsstr(ffdSubDirectory.cFileName, _T(".cue")) || _tcsstr(ffdSubDirectory.cFileName, _T(".CUE"))) - { - // Parse CUE - TCHAR szParse[512] = _T("\0"); - _stprintf(szParse, _T("%s%s/%s"), pszDirectory, ffdDirectory.cFileName, ffdSubDirectory.cFileName); - - //MessageBox(NULL, szParse, _T(""), MB_OK); - - pszISO = NeoCDList_ParseCUE( szParse ); - - TCHAR szISO[512] =_T("\0"); - _stprintf(szISO, _T("%s%s/%s"), pszDirectory, ffdDirectory.cFileName, pszISO); - - NeoCDList_CheckISO(hList, szISO); - bDone = true; - - break; // no need to continue - } - } - } while(FindNextFile(hSubDirectory, &ffdSubDirectory)); - } - - if(pszISO) { - free(pszISO); - pszISO = NULL; - } - - if(bDone) { - FindClose(hSubDirectory); - continue; - } - } else { - if(!ngcd_list[nListItems].nAudioTracks) { - ngcd_list[nListItems].nAudioTracks = 0; - } - } - - hSubDirectory = NULL; - memset(&ffdSubDirectory, 0, sizeof(WIN32_FIND_DATA)); - - // Scan sub-directory for ISO - _stprintf(szSubSearch, _T("%s%s/*.iso"), pszDirectory, ffdDirectory.cFileName); - - hSubDirectory = FindFirstFile(szSubSearch, &ffdSubDirectory); - - if (hSubDirectory == INVALID_HANDLE_VALUE) { - // error - } else { - - do - { - // Sub-directories only - if(!(ffdSubDirectory.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { - // File is ISO - if(_tcsstr(ffdSubDirectory.cFileName, _T(".iso")) || _tcsstr(ffdSubDirectory.cFileName, _T(".ISO"))) - { - TCHAR szISO[512] = _T("\0"); - _stprintf(szISO, _T("%s%s/%s"), pszDirectory, ffdDirectory.cFileName, ffdSubDirectory.cFileName); - - NeoCDList_CheckISO(hList, szISO); - - break; // no need to continue - } - } - } while(FindNextFile(hSubDirectory, &ffdSubDirectory)); - } - } else { - // FILE - } - } while(FindNextFile(hDirectory, &ffdDirectory)); - } - FindClose(hDirectory); - -// bProcessingList = false; -} - -// Scan the specified directory for ISO / CUE files -static void NeoCDList_ScanSingleDir(HWND hList, TCHAR* pszDirectory) -{ -// bProcessingList = true; -// ListView_DeleteAllItems(hList); - - // - TCHAR* pszISO = NULL; - pszISO = (TCHAR*)malloc(sizeof(TCHAR) * 512); - - WIN32_FIND_DATA ffdDirectory; - - HANDLE hDirectory = NULL; - memset(&ffdDirectory, 0, sizeof(WIN32_FIND_DATA)); - - // Scan directory for CUE - TCHAR szSearch[512] = _T("\0"); - - if(!bNeoCDListScanOnlyISO) - { - _stprintf(szSearch, _T("%s*.cue"), pszDirectory); - - hDirectory = FindFirstFile(szSearch, &ffdDirectory); - - if (hDirectory == INVALID_HANDLE_VALUE) { - // error - } else { - - do - { - // Files only - if(!(ffdDirectory.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { - // File is CUE - if(_tcsstr(ffdDirectory.cFileName, _T(".cue")) || _tcsstr(ffdDirectory.cFileName, _T(".CUE"))) - { - // Parse CUE - TCHAR szParse[512] = _T("\0"); - _stprintf(szParse, _T("%s%s"), pszDirectory, ffdDirectory.cFileName); - - //MessageBox(NULL, szParse, _T(""), MB_OK); - - pszISO = NeoCDList_ParseCUE( szParse ); - - TCHAR szISO[512] =_T("\0"); - _stprintf(szISO, _T("%s%s"), pszDirectory, pszISO); - - NeoCDList_CheckISO(hList, szISO); - } - } - } while(FindNextFile(hDirectory, &ffdDirectory)); - - FindClose(hDirectory); - } - } else { - if(!ngcd_list[nListItems].nAudioTracks) { - ngcd_list[nListItems].nAudioTracks = 0; - } - } - - hDirectory = NULL; - memset(&ffdDirectory, 0, sizeof(WIN32_FIND_DATA)); - - // Scan directory for ISO - _stprintf(szSearch, _T("%s*.iso"), pszDirectory); - - hDirectory = FindFirstFile(szSearch, &ffdDirectory); - - if (hDirectory == INVALID_HANDLE_VALUE) { - // error - } else { - - do - { - // Files only - if(!(ffdDirectory.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { - // File is ISO - if(_tcsstr(ffdDirectory.cFileName, _T(".iso")) || _tcsstr(ffdDirectory.cFileName, _T(".ISO"))) - { - TCHAR szISO[512] = _T("\0"); - _stprintf(szISO, _T("%s%s"), pszDirectory, ffdDirectory.cFileName); - - NeoCDList_CheckISO(hList, szISO); - - } - } - } while(FindNextFile(hDirectory, &ffdDirectory)); - - FindClose(hDirectory); - } - - if (pszISO) { - free(pszISO); - pszISO = NULL; - } - -// bProcessingList = false; -} - - -// This will parse the specified CUE file and return the ISO path, if found -static TCHAR* NeoCDList_ParseCUE(TCHAR* pszFile) -{ - //if(!pszFile) return NULL; - - TCHAR* szISO = NULL; - szISO = (TCHAR*)malloc(sizeof(TCHAR) * 2048); - if(!szISO) return NULL; - - // open file - FILE* fp = NULL; - fp = _tfopen(pszFile, _T("r")); - - if(!fp) { - if (szISO) - { - free(szISO); - return NULL; - } - } - - while(!feof(fp)) - { - TCHAR szBuffer[2048]; - TCHAR szOriginal[2048]; - - _fgetts(szBuffer, sizeof(szBuffer), fp); - - // terminate string - szBuffer[260] = 0; - - if(!*szBuffer) { - return NULL; - } - - int nLength = 0; - nLength = _tcslen(szBuffer); - - // Remove ASCII control characters from the string (including the 'space' character) - while (szBuffer[nLength-1] < 32 && nLength > 0) - { - szBuffer[nLength-1] = 0; - nLength--; - } - - _tcscpy(szOriginal, szBuffer); - - if(!_tcsncmp(szBuffer, _T("FILE"), 4)) - { - TCHAR* pEnd = _tcsrchr(szBuffer, '"'); - if (!pEnd) { - break; // Invalid CUE format - } - - *pEnd = 0; - - TCHAR* pStart = _tcschr(szBuffer, '"'); - - if(!pStart) { - break; // Invalid CUE format - } - - if(!_tcsncmp(pEnd + 2, _T("BINARY"), 6)) - { - _tcscpy(szISO, pStart + 1); - ngcd_list[nListItems].bFoundCUE = true; - _tcscpy(ngcd_list[nListItems].szPathCUE, pszFile); - _tcscpy(ngcd_list[nListItems].szISOFile, pStart + 1); - } - - if (!_tcsncmp(pEnd + 2, _T("WAVE"), 5)) { - if(!ngcd_list[nListItems].nAudioTracks) { - ngcd_list[nListItems].nAudioTracks = 0; - } - - _tcscpy(ngcd_list[nListItems].szTracks[ngcd_list[nListItems].nAudioTracks], pStart + 1); - - ngcd_list[nListItems].nAudioTracks++; - } - } - } - if(fp) fclose(fp); - - return szISO; -} - -static PNGRESOLUTION GetPNGResolution(TCHAR* szFile) -{ - int width = 0; - int height = 0; - PNGRESOLUTION nResolution = { 0, 0 }; - png_structp png_ptr; - png_infop info_ptr; - char header[8]; - - FILE *fp = _tfopen(szFile, _T("rb")); - - if (!fp) { - return nResolution; - } - - fread(header, 1, 8, fp); - - if (png_sig_cmp((png_const_bytep)header, 0, 8)) { - return nResolution; - } - - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - - if (!png_ptr) { - return nResolution; - } - - info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - return nResolution; - } - - if (setjmp(png_jmpbuf(png_ptr))) { - return nResolution; - } - - png_init_io(png_ptr, fp); - png_set_sig_bytes(png_ptr, 8); - png_read_info(png_ptr, info_ptr); - - width = png_get_image_width(png_ptr, info_ptr); - height = png_get_image_height(png_ptr, info_ptr); - - nResolution.nWidth = width; - nResolution.nHeight = height; - - fclose(fp); - - return nResolution; -} - -static void NeoCDList_ShowPreview(HWND hDlg, TCHAR* szFile, int nCtrID, int nFrameCtrID, float maxw, float maxh) -{ - PNGRESOLUTION PNGRes = { 0, 0 }; - if(!_tfopen(szFile, _T("rb"))) - { - HRSRC hrsrc = FindResource(NULL, MAKEINTRESOURCE(BMP_SPLASH), RT_BITMAP); - HGLOBAL hglobal = LoadResource(NULL, (HRSRC)hrsrc); - - BITMAPINFOHEADER* pbmih = (BITMAPINFOHEADER*)LockResource(hglobal); - - PNGRes.nWidth = pbmih->biWidth; - PNGRes.nHeight = pbmih->biHeight; - - FreeResource(hglobal); - - } else { - PNGRes = GetPNGResolution(szFile); - } - - // ------------------------------------------------------ - // PROPER ASPECT RATIO CALCULATIONS - - float w = (float)PNGRes.nWidth; - float h = (float)PNGRes.nHeight; - - //float maxw = 216; // - //float maxh = 150; // - - // max WIDTH - if(w > maxw) { - float nh = maxw * (float)(h / w); - float nw = maxw; - - // max HEIGHT - if(nh > maxh) { - nw = maxh * (float)(nw / nh); - nh = maxh; - } - - w = nw; - h = nh; - } - - // max HEIGHT - if(h > maxh) { - float nw = maxh * (float)(w / h); - float nh = maxh; - - // max WIDTH - if(nw > maxw) { - nh = maxw * (float)(nh / nw); - nw = maxw; - } - - w = nw; - h = nh; - } - - // Proper centering of preview - float x = ((maxw - w) / 2); - float y = ((maxh - h) / 2); - - RECT rc = {0, 0, 0, 0}; - GetWindowRect(GetDlgItem(hDlg, nFrameCtrID), &rc); - - POINT pt; - pt.x = rc.left; - pt.y = rc.top; - - ScreenToClient(hDlg, &pt); - - // ------------------------------------------------------ - - FILE* fp = _tfopen(szFile, _T("rb")); - - HBITMAP hCoverBmp = PNGLoadBitmap(hDlg, fp, (int)w, (int)h, 0); - - SetWindowPos(GetDlgItem(hDlg, nCtrID), NULL, (int)(pt.x + x), (int)(pt.y + y), 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); - SendDlgItemMessage(hDlg, nCtrID, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hCoverBmp); - - if(fp) fclose(fp); - -} - -static void NeoCDList_Clean() -{ - NeoCDList_ShowPreview(hNeoCDWnd, _T(""), IDC_NCD_FRONT_PIC, IDC_NCD_FRONT_PIC_FRAME, 216, 150); - NeoCDList_ShowPreview(hNeoCDWnd, _T(""), IDC_NCD_BACK_PIC, IDC_NCD_BACK_PIC_FRAME, 216, 150); - - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTSHORT), _T("")); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTPUBLISHER), _T("")); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTIMAGE), _T("")); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTAUDIO), _T("")); - - hProcessThread = NULL; - ProcessThreadID = 0; - - for(int x = 0; x < 100; x++) { - for(int y = 0; y < 99; y++) { - memset(&ngcd_list[x].szTracks[y], 0, sizeof(TCHAR) * 256); - } - ngcd_list[x].bFoundCUE = false; - } - memset(&ngcd_list, 0, (sizeof(GAMELIST) * 100)); - - hProcParent = NULL; - bProcessingList = false; - - nListItems = 0; - - nSelectedItem = -1; -} - -static HWND hNeoCDList_CoverDlg = NULL; -TCHAR szBigCover[512] = _T(""); - -static INT_PTR CALLBACK NeoCDList_CoverWndProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM /*lParam*/) -{ - if(Msg == WM_INITDIALOG) - { - hNeoCDList_CoverDlg = hDlg; - - NeoCDList_ShowPreview(hDlg, szBigCover, IDC_NCD_COVER_PREVIEW_PIC, IDC_NCD_COVER_PREVIEW_PIC, 580, 415); - - return TRUE; - } - - if(Msg == WM_CLOSE) - { - EndDialog(hDlg, 0); - hNeoCDList_CoverDlg = NULL; - } - - if(Msg == WM_COMMAND) - { - if (LOWORD(wParam) == WM_DESTROY) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - } - - return 0; -} - -void NeoCDList_InitCoverDlg() -{ - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_NCD_COVER_DLG), hNeoCDWnd, (DLGPROC)NeoCDList_CoverWndProc); -} - -static INT_PTR CALLBACK NeoCDList_WndProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if(Msg == WM_INITDIALOG) - { - hNeoCDWnd = hDlg; - - InitCommonControls(); - - hListView = GetDlgItem(hDlg, IDC_NCD_LIST); - - NeoCDList_InitListView(); - - HICON hIcon = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_APP)); - SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); // Set the Game Selection dialog icon. - - hWhiteBGBrush = CreateSolidBrush(RGB(0xFF,0xFF,0xFF)); - - NeoCDList_ShowPreview(hNeoCDWnd, _T(""), IDC_NCD_FRONT_PIC, IDC_NCD_FRONT_PIC_FRAME, 216, 150); - NeoCDList_ShowPreview(hNeoCDWnd, _T(""), IDC_NCD_BACK_PIC, IDC_NCD_BACK_PIC_FRAME, 216, 150); - - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTSHORT), _T("")); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTPUBLISHER), _T("")); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTIMAGE), _T("")); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTAUDIO), _T("")); - - CheckDlgButton(hNeoCDWnd, IDC_NCD_SSUBDIR_CHECK, bNeoCDListScanSub ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hNeoCDWnd, IDC_NCD_SISO_ONLY_CHECK, bNeoCDListScanOnlyISO ? BST_CHECKED : BST_UNCHECKED); - - TreeView_SetItemHeight(hListView, 40); - - TCHAR szDialogTitle[200]; - _stprintf(szDialogTitle, FBALoadStringEx(hAppInst, IDS_NGCD_DIAG_TITLE, true), _T(APP_TITLE), _T(SEPERATOR_1), _T(SEPERATOR_1)); - SetWindowText(hDlg, szDialogTitle); - - hProcessThread = (HANDLE)_beginthreadex(NULL, 0, NeoCDList_DoProc, NULL, 0, &ProcessThreadID); - - WndInMid(hDlg, hScrnWnd); - SetFocus(hListView); - - return TRUE; - } - - if(Msg == WM_CLOSE) - { - NeoCDList_Clean(); - - DeleteObject(hWhiteBGBrush); - - hNeoCDWnd = NULL; - hListView = NULL; - - EndDialog(hDlg, 0); - } - - if (Msg == WM_CTLCOLORSTATIC) - { - if ((HWND)lParam == GetDlgItem(hNeoCDWnd, IDC_NCD_LABELSHORT)) return (INT_PTR)hWhiteBGBrush; - if ((HWND)lParam == GetDlgItem(hNeoCDWnd, IDC_NCD_LABELPUBLISHER)) return (INT_PTR)hWhiteBGBrush; - if ((HWND)lParam == GetDlgItem(hNeoCDWnd, IDC_NCD_LABELIMAGE)) return (INT_PTR)hWhiteBGBrush; - if ((HWND)lParam == GetDlgItem(hNeoCDWnd, IDC_NCD_LABELAUDIO)) return (INT_PTR)hWhiteBGBrush; - if ((HWND)lParam == GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTSHORT)) return (INT_PTR)hWhiteBGBrush; - if ((HWND)lParam == GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTPUBLISHER)) return (INT_PTR)hWhiteBGBrush; - if ((HWND)lParam == GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTIMAGE)) return (INT_PTR)hWhiteBGBrush; - if ((HWND)lParam == GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTAUDIO)) return (INT_PTR)hWhiteBGBrush; - } - - if (Msg == WM_NOTIFY) - { - NMLISTVIEW* pNMLV = (NMLISTVIEW*)lParam; - - // Game Selected - if (pNMLV->hdr.code == LVN_ITEMCHANGED && pNMLV->hdr.idFrom == IDC_NCD_LIST) - { - int iCount = SendMessage(hListView, LVM_GETITEMCOUNT, 0, 0); - int iSelCount = SendMessage(hListView, LVM_GETSELECTEDCOUNT, 0, 0); - - if(iCount == 0 || iSelCount == 0) return 1; - - TCHAR szID[] = _T("0000"); - - int iItem = pNMLV->iItem; - - LVITEM LvItem; - memset(&LvItem, 0, sizeof(LvItem)); - - LvItem.iItem = iItem; - LvItem.mask = LVIF_TEXT; - LvItem.iSubItem = 1; // id column - LvItem.pszText = szID; - LvItem.cchTextMax = sizeof(szID) + 1; - - SendMessage(hListView, LVM_GETITEMTEXT, (WPARAM)iItem, (LPARAM)&LvItem); - - //MessageBox(NULL, LvItem.pszText, _T(""), MB_OK); - - TCHAR szFront[512]; - TCHAR szBack[512]; - - _stprintf(szFront, _T("%s%s-front.png"), szNeoCDCoverDir, LvItem.pszText ); - _stprintf(szBack, _T("%s%s-back.png"), szNeoCDCoverDir, LvItem.pszText ); - - // Front / Back Cover preview - NeoCDList_ShowPreview(hNeoCDWnd, szFront, IDC_NCD_FRONT_PIC, IDC_NCD_FRONT_PIC_FRAME, 216, 150); - NeoCDList_ShowPreview(hNeoCDWnd, szBack, IDC_NCD_BACK_PIC, IDC_NCD_BACK_PIC_FRAME, 216, 150); - - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTSHORT), _T("")); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTPUBLISHER), _T("")); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTIMAGE), _T("")); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTAUDIO), _T("")); - - for(int nItem = 0; nItem < nListItems; nItem++) - { - unsigned int nID = 0; - _stscanf(szID, _T("%x"), &nID); - - TCHAR szAudioTracks[] =_T("0"); - - if(nID == ngcd_list[nItem].nID) { - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTSHORT), ngcd_list[nItem].szShortName); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTPUBLISHER), ngcd_list[nItem].szPublisher); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTIMAGE), ngcd_list[nItem].szISOFile); - _stprintf(szAudioTracks, _T("%d"), ngcd_list[nItem].nAudioTracks); - SetWindowText(GetDlgItem(hNeoCDWnd, IDC_NCD_TEXTAUDIO), szAudioTracks); - - nSelectedItem = nItem; - break; - } - } - - - } - - // Double Click - if (pNMLV->hdr.code == NM_DBLCLK && pNMLV->hdr.idFrom == IDC_NCD_LIST) - { - if(nSelectedItem >= 0) { - nCDEmuSelect = 0; - if(ngcd_list[nSelectedItem].bFoundCUE) { - _tcscpy(CDEmuImage, ngcd_list[nSelectedItem].szPathCUE); - } else { - _tcscpy(CDEmuImage, ngcd_list[nSelectedItem].szPath); - } - } else { - return 0; - } - - NeoCDList_Clean(); - - hNeoCDWnd = NULL; - hListView = NULL; - - EndDialog(hDlg, 0); - - BurnerLoadDriver(_T("neocdz")); - } - } - - if(Msg == WM_COMMAND) - { - if(HIWORD(wParam) == STN_CLICKED) - { - int nCtrlID = LOWORD(wParam); - - if(nCtrlID == IDC_NCD_FRONT_PIC) - { - if(nSelectedItem >= 0) { - _stprintf(szBigCover, _T("%s%04x-front.png"), szNeoCDCoverDir, ngcd_list[nSelectedItem].nID ); - - if(!_tfopen(szBigCover, _T("rb"))) { - szBigCover[0] = 0; - return 0; - } - } else { - return 0; - } - NeoCDList_InitCoverDlg(); - return 0; - } - - if(nCtrlID == IDC_NCD_BACK_PIC) - { - if(nSelectedItem >= 0) { - _stprintf(szBigCover, _T("%s%04x-back.png"), szNeoCDCoverDir, ngcd_list[nSelectedItem].nID ); - - if(!_tfopen(szBigCover, _T("rb"))) { - szBigCover[0] = 0; - return 0; - } - } else { - return 0; - } - NeoCDList_InitCoverDlg(); - return 0; - } - } - - if (LOWORD(wParam) == WM_DESTROY) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - - if(HIWORD(wParam) == BN_CLICKED) - { - int nCtrlID = LOWORD(wParam); - - switch(nCtrlID) - { - case IDC_NCD_PLAY_BUTTON: - { - if(nSelectedItem >= 0) { - nCDEmuSelect = 0; - if(ngcd_list[nSelectedItem].bFoundCUE) { - _tcscpy(CDEmuImage, ngcd_list[nSelectedItem].szPathCUE); - } else { - _tcscpy(CDEmuImage, ngcd_list[nSelectedItem].szPath); - } - } else { - break; - } - - NeoCDList_Clean(); - - DeleteObject(hWhiteBGBrush); - - hNeoCDWnd = NULL; - hListView = NULL; - - EndDialog(hDlg, 0); - - BurnerLoadDriver(_T("neocdz")); - break; - } - - case IDC_NCD_SCAN_BUTTON: - { - if(bProcessingList) break; - - NeoCDList_Clean(); - hProcessThread = (HANDLE)_beginthreadex(NULL, 0, NeoCDList_DoProc, NULL, 0, &ProcessThreadID); - SetFocus(hListView); - break; - } - - case IDC_NCD_SEL_DIR_BUTTON: - { - if(bProcessingList) break; - - NeoCDList_Clean(); - - SupportDirCreateTab(IDC_SUPPORTDIR_EDIT8, hNeoCDWnd); - hProcessThread = (HANDLE)_beginthreadex(NULL, 0, NeoCDList_DoProc, NULL, 0, &ProcessThreadID); - SetFocus(hListView); - break; - } - - case IDC_NCD_SSUBDIR_CHECK: - { - if(BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_NCD_SSUBDIR_CHECK)) { - bNeoCDListScanSub = true; - } else { - bNeoCDListScanSub = false; - } - - if(bProcessingList) break; - - NeoCDList_Clean(); - - hProcessThread = (HANDLE)_beginthreadex(NULL, 0, NeoCDList_DoProc, NULL, 0, &ProcessThreadID); - SetFocus(hListView); - break; - } - - case IDC_NCD_SISO_ONLY_CHECK: - { - if(BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_NCD_SISO_ONLY_CHECK)) { - bNeoCDListScanOnlyISO = true; - } else { - bNeoCDListScanOnlyISO = false; - } - - if(bProcessingList) break; - - NeoCDList_Clean(); - - hProcessThread = (HANDLE)_beginthreadex(NULL, 0, NeoCDList_DoProc, NULL, 0, &ProcessThreadID); - SetFocus(hListView); - break; - } - - case IDC_NCD_CANCEL_BUTTON: - { - NeoCDList_Clean(); - - DeleteObject(hWhiteBGBrush); - - hNeoCDWnd = NULL; - hListView = NULL; - - EndDialog(hDlg, 0); - break; - } - } - } - } - return 0; -} - -//static DWORD WINAPI NeoCDList_DoProc(LPVOID) -static unsigned __stdcall NeoCDList_DoProc(void*) -{ - if(bProcessingList) return 0; - - SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); - - bProcessingList = true; - ListView_DeleteAllItems(hListView); - - if(bNeoCDListScanSub) { - NeoCDList_ScanSingleDir(hListView, szNeoCDGamesDir); - NeoCDList_ScanDir(hListView, szNeoCDGamesDir); - } else { - NeoCDList_ScanSingleDir(hListView, szNeoCDGamesDir); - } - - bProcessingList = false; - - PostThreadMessage(ProcessThreadID, WM_APP + 0, 0, 0); - - // Wait for the thread to finish - if (WaitForSingleObject(hProcessThread, 10000) != WAIT_OBJECT_0) { - // If the thread doesn't finish within 10 seconds, forcibly kill it - TerminateThread(hProcessThread, 1); - bProcessingList = false; - } - - CloseHandle(hProcessThread); - hProcessThread = NULL; - ProcessThreadID = 0; - - return 0; -} - -int NeoCDList_Init() -{ - return FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_NCD_DLG), hScrnWnd, (DLGPROC)NeoCDList_WndProc); -} diff --git a/jan/src/burner/win32/numdial.cpp b/jan/src/burner/win32/numdial.cpp deleted file mode 100644 index 364ee7548..000000000 --- a/jan/src/burner/win32/numdial.cpp +++ /dev/null @@ -1,1011 +0,0 @@ -#include "burner.h" -#include - -const double PI = 3.14159265358979323846f; // Pi -const double DEGTORAD = 0.01745329251994329547f; // Degrees to Radians -const double RADTODEG = 57.29577951308232286465f; // Radians to Degrees - -static int nExitStatus; - -// ----------------------------------------------------------------------------- - -static INT_PTR CALLBACK DefInpProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) -{ - int nRet = 0; - BOOL fTrue = FALSE; - - switch (Msg) { - case WM_INITDIALOG: - nRet = nAudSegCount; - SetWindowText(hDlg, FBALoadStringEx(hAppInst, IDS_NUMDIAL_NUM_FRAMES, true)); - SetDlgItemInt(hDlg, IDC_VALUE_EDIT, nRet, TRUE); - return TRUE; - - case WM_COMMAND: - if (LOWORD(wParam) == ID_VALUE_CLOSE) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } else { - if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDCANCEL) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - } - break; - - case WM_CLOSE: - nRet = GetDlgItemInt(hDlg, IDC_VALUE_EDIT, &fTrue, TRUE); - if (fTrue) { - nAudSegCount = nRet; - } - EndDialog(hDlg, 0); - } - - return 0; -} - -int NumDialCreate(int) -{ - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_VALUE), hScrnWnd, (DLGPROC)DefInpProc); - - return 1; -} - -// ----------------------------------------------------------------------------- -// Gamma dialog - -static INT_PTR CALLBACK GammaProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) // LPARAM lParam -{ - static double nPrevGamma; - - switch (Msg) { - case WM_INITDIALOG: { - TCHAR szText[16]; - int nPos; - - nPrevGamma = nGamma; - nExitStatus = 0; - - WndInMid(hDlg, hScrnWnd); - - // Initialise gamma slider - SendDlgItemMessage(hDlg, IDC_GAMMA_SLIDER, TBM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG(1, 20000)); - SendDlgItemMessage(hDlg, IDC_GAMMA_SLIDER, TBM_SETLINESIZE, (WPARAM)0, (LPARAM)200); - SendDlgItemMessage(hDlg, IDC_GAMMA_SLIDER, TBM_SETPAGESIZE, (WPARAM)0, (LPARAM)250); - SendDlgItemMessage(hDlg, IDC_GAMMA_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)7500); - SendDlgItemMessage(hDlg, IDC_GAMMA_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)10001); - SendDlgItemMessage(hDlg, IDC_GAMMA_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)12500); - - // Set slider to value of nGamma - if (nGamma > 1.0) { // Gamma > 1 - nPos = int((nGamma - 1.0) * 10000.0 + 10001.0); - } else { // Gamma < 1 - nPos = int(10000.0f - ((1.0 / nGamma) * 10000.0 - 10000.0)); - } - SendDlgItemMessage(hDlg, IDC_GAMMA_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nPos); - - // Set the edit control to the value of nGamma - _stprintf(szText, _T("%0.2f"), nGamma); - SendDlgItemMessage(hDlg, IDC_GAMMA_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - // Update the screen - ComputeGammaLUT(); - if (bVidOkay) { - VidRedraw(); - VidPaint(0); - } - - return TRUE; - } - case WM_COMMAND: { - switch (HIWORD(wParam)) { - case BN_CLICKED: { - if (LOWORD(wParam) == IDOK) { - nExitStatus = 1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDCANCEL) { - nExitStatus = -1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - case EN_UPDATE: { - if (nExitStatus == 0) { - TCHAR szText[16] = _T(""); - bool bPoint = 0; - bool bValid = 1; - - if (SendDlgItemMessage(hDlg, IDC_GAMMA_EDIT, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0) < 16) { - SendDlgItemMessage(hDlg, IDC_GAMMA_EDIT, WM_GETTEXT, (WPARAM)16, (LPARAM)szText); - } - - // Scan string in the edit control for illegal characters - for (int i = 0; szText[i]; i++) { - if (szText[i] == _T('.')) { - if (bPoint) { - bValid = 0; - break; - } - } else { - if (!_istdigit(szText[i])) { - bValid = 0; - break; - } - } - } - - if (bValid) { - int nPos; - - nGamma = _tcstod(szText, NULL); - - // Set slider to value of nGamma - if (nGamma > 1.0) { // Gamma > 1 - nPos = int((nGamma - 1.0) * 10000.0 + 10001.0); - } else { // Gamma < 1 - nPos = int(10000.0 - ((1.0 / nGamma) * 10000.0 - 10000.0)); - } - SendDlgItemMessage(hDlg, IDC_GAMMA_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nPos); - - // Update the screen - ComputeGammaLUT(); - if (bVidOkay) { - VidRedraw(); - VidPaint(0); - } - } - } - break; - } - break; - } - } - - case WM_HSCROLL: { - switch (LOWORD(wParam)) { - case TB_BOTTOM: - case TB_ENDTRACK: - case TB_LINEDOWN: - case TB_LINEUP: - case TB_PAGEDOWN: - case TB_PAGEUP: - case TB_THUMBPOSITION: - case TB_THUMBTRACK: - case TB_TOP: { - if (nExitStatus == 0) { - TCHAR szText[16]; - int nPos; - - // Update the contents of the edit control - nPos = SendDlgItemMessage(hDlg, IDC_GAMMA_SLIDER, TBM_GETPOS, (WPARAM)0, (LPARAM)0); - if (nPos > 10000) { // Gamma > 1 - nGamma = 1.0 + (nPos - 10000.0) / 10000.0; - } else { // Gamma < 1 - nGamma = 1.0 / (1.0 + ((10001.0 - nPos) / 10000.0)); - } - _stprintf(szText, _T("%0.2f"), nGamma); - SendDlgItemMessage(hDlg, IDC_GAMMA_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - // Update the screen - ComputeGammaLUT(); - if (bVidOkay) { - VidRedraw(); - VidPaint(0); - } - } - break; - } - } - break; - } - - case WM_CLOSE: - if (nExitStatus != 1) { - nGamma = nPrevGamma; - } - EndDialog(hDlg, 0); - } - - return 0; -} - -void GammaDialog() -{ - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_GAMMA), hScrnWnd, (DLGPROC)GammaProc); -} - -// ----------------------------------------------------------------------------- -// Scanline intensity dialog - -static INT_PTR CALLBACK ScanlineProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) // LPARAM lParam -{ - static int nPrevIntensity; - - switch (Msg) { - case WM_INITDIALOG: { - TCHAR szText[16]; - nPrevIntensity = nVidScanIntensity; - nExitStatus = 0; - - WndInMid(hDlg, hScrnWnd); - - // Initialise slider - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG(0, 255)); - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETPAGESIZE, (WPARAM)0, (LPARAM)16); - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)191); - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)127); - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)63); - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nVidScanIntensity & 0xFF); - - // Set the edit control to current value - _stprintf(szText, _T("%i"), nVidScanIntensity & 0xFF); - SendDlgItemMessage(hDlg, IDC_SCANLINE_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - // Update the screen - if (bDrvOkay) { - VidPaint(2); - } - - return TRUE; - } - case WM_COMMAND: { - switch (HIWORD(wParam)) { - case BN_CLICKED: { - if (LOWORD(wParam) == IDOK) { - nExitStatus = 1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDCANCEL) { - nExitStatus = -1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - case EN_UPDATE: { - if (nExitStatus == 0) { - TCHAR szText[16] = _T(""); - bool bValid = 1; - - if (SendDlgItemMessage(hDlg, IDC_SCANLINE_EDIT, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0) < 16) { - SendDlgItemMessage(hDlg, IDC_SCANLINE_EDIT, WM_GETTEXT, (WPARAM)16, (LPARAM)szText); - } - - // Scan string in the edit control for illegal characters - for (int i = 0; szText[i]; i++) { - if (!_istdigit(szText[i])) { - bValid = 0; - break; - } - } - - if (bValid) { - nVidScanIntensity = _tcstol(szText, NULL, 0); - if (nVidScanIntensity < 0) { - nVidScanIntensity = 0; - } else { - if (nVidScanIntensity > 255) { - nVidScanIntensity = 255; - } - } - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nVidScanIntensity); - - nVidScanIntensity |= (nVidScanIntensity << 8) | (nVidScanIntensity << 16); - - // Update the screen - if (bVidOkay) { - VidPaint(2); - } - } - } - break; - } - } - break; - } - - case WM_HSCROLL: { - switch (LOWORD(wParam)) { - case TB_BOTTOM: - case TB_ENDTRACK: - case TB_LINEDOWN: - case TB_LINEUP: - case TB_PAGEDOWN: - case TB_PAGEUP: - case TB_THUMBPOSITION: - case TB_THUMBTRACK: - case TB_TOP: { - if (nExitStatus == 0) { - TCHAR szText[16]; - - // Update the contents of the edit control - nVidScanIntensity = SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_GETPOS, (WPARAM)0, (LPARAM)0); - _stprintf(szText, _T("%i"), nVidScanIntensity); - SendDlgItemMessage(hDlg, IDC_SCANLINE_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - nVidScanIntensity |= (nVidScanIntensity << 8) | (nVidScanIntensity << 16); - // Update the screen - if (bVidOkay) { -// VidRedraw(); - VidPaint(2); - } - } - break; - } - } - break; - } - - case WM_CLOSE: - if (nExitStatus != 1) { - nVidScanIntensity = nPrevIntensity; - } - EndDialog(hDlg, 0); - break; - } - - return 0; -} - -void ScanlineDialog() -{ - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_SCANLINE), hScrnWnd, (DLGPROC)ScanlineProc); -} - -// ----------------------------------------------------------------------------- -// Feedback intensity dialog -static INT_PTR CALLBACK PhosphorProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) // LPARAM lParam -{ - static int nPrevIntensity; - static int nPrevSaturation; - - switch (Msg) { - case WM_INITDIALOG: { - TCHAR szText[16]; - nPrevIntensity = nVidFeedbackIntensity; - nPrevSaturation = nVidFeedbackOverSaturation; - nExitStatus = 0; - - WndInMid(hDlg, hScrnWnd); - - // Initialise sliders - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_SLIDER, TBM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG(0, 255)); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_SLIDER, TBM_SETPAGESIZE, (WPARAM)0, (LPARAM)8); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)127); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)63); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)31); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)15); - - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_SLIDER, TBM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG(0, 127)); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_SLIDER, TBM_SETPAGESIZE, (WPARAM)0, (LPARAM)4); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)63); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)31); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)15); - - // Set slider to current values - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nVidFeedbackIntensity); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nVidFeedbackOverSaturation); - - // Set the edit control to current values - _stprintf(szText, _T("%i"), nVidFeedbackIntensity); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - _stprintf(szText, _T("%i"), nVidFeedbackOverSaturation); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - return TRUE; - } - case WM_COMMAND: { - switch (HIWORD(wParam)) { - case BN_CLICKED: { - if (LOWORD(wParam) == IDOK) { - nExitStatus = 1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDCANCEL) { - nExitStatus = -1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - case EN_UPDATE: { - if (nExitStatus == 0) { - TCHAR szText[16] = _T(""); - bool bValid = 1; - - switch (LOWORD(wParam)) { - case IDC_PHOSPHOR_1_EDIT: - if (SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_EDIT, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0) < 16) { - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_EDIT, WM_GETTEXT, (WPARAM)16, (LPARAM)szText); - } - - // Scan string in the edit control for illegal characters - for (int i = 0; szText[i]; i++) { - if (!_istdigit(szText[i])) { - bValid = 0; - break; - } - } - - if (bValid) { - nVidFeedbackIntensity = _tcstol(szText, NULL, 0); - if (nVidFeedbackIntensity < 0) { - nVidFeedbackIntensity = 0; - } else { - if (nVidFeedbackIntensity > 255) { - nVidFeedbackIntensity = 255; - } - } - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nVidFeedbackIntensity); - } - break; - case IDC_PHOSPHOR_2_EDIT: - if (SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_EDIT, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0) < 16) { - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_EDIT, WM_GETTEXT, (WPARAM)16, (LPARAM)szText); - } - - // Scan string in the edit control for illegal characters - for (int i = 0; szText[i]; i++) { - if (!_istdigit(szText[i])) { - bValid = 0; - break; - } - } - - if (bValid) { - nVidFeedbackOverSaturation = _tcstol(szText, NULL, 0); - if (nVidFeedbackOverSaturation < 0) { - nVidFeedbackOverSaturation = 0; - } else { - if (nVidFeedbackOverSaturation > 255) { - nVidFeedbackOverSaturation = 255; - } - } - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nVidFeedbackOverSaturation); - - // Update the screen - if (bVidOkay) { - VidPaint(2); - } - } - break; - } - } - break; - } - } - break; - } - - case WM_HSCROLL: { - switch (LOWORD(wParam)) { - case TB_BOTTOM: - case TB_ENDTRACK: - case TB_LINEDOWN: - case TB_LINEUP: - case TB_PAGEDOWN: - case TB_PAGEUP: - case TB_THUMBPOSITION: - case TB_THUMBTRACK: - case TB_TOP: { - if (nExitStatus == 0) { - TCHAR szText[16]; - - // Update the contents of the edit control - switch (GetDlgCtrlID((HWND)lParam)) { - case IDC_PHOSPHOR_1_SLIDER: - nVidFeedbackIntensity = SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_SLIDER, TBM_GETPOS, (WPARAM)0, (LPARAM)0); - _stprintf(szText, _T("%i"), nVidFeedbackIntensity); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_1_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - break; - case IDC_PHOSPHOR_2_SLIDER: - nVidFeedbackOverSaturation = SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_SLIDER, TBM_GETPOS, (WPARAM)0, (LPARAM)0); - _stprintf(szText, _T("%i"), nVidFeedbackOverSaturation); - SendDlgItemMessage(hDlg, IDC_PHOSPHOR_2_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - break; - } - } - break; - } - } - break; - } - - case WM_CLOSE: - if (nExitStatus != 1) { - nVidFeedbackIntensity = nPrevIntensity; - nVidFeedbackOverSaturation = nPrevSaturation; - } - EndDialog(hDlg, 0); - break; - } - - return 0; -} - -void PhosphorDialog() -{ - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_PHOSPHOR), hScrnWnd, (DLGPROC)PhosphorProc); -} - -// ----------------------------------------------------------------------------- -// Screen Angle dialog -static INT_PTR CALLBACK ScreenAngleProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - static float fPrevScreenAngle, fPrevScreenCurvature; - static HWND hScreenAngleSlider, hScreenAngleEdit; - - switch (Msg) { - case WM_INITDIALOG: { - TCHAR szText[16]; - fPrevScreenAngle = fVidScreenAngle; - fPrevScreenCurvature = fVidScreenCurvature; - hScreenAngleSlider = GetDlgItem(hDlg, IDC_SCREENANGLE_SLIDER); - hScreenAngleEdit = GetDlgItem(hDlg, IDC_SCREENANGLE_EDIT); - nExitStatus = 0; - - WndInMid(hDlg, hScrnWnd); - - // Initialise sliders - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_SLIDER, TBM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG(0, 12000)); - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_SLIDER, TBM_SETLINESIZE, (WPARAM)0, (LPARAM)100); - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_SLIDER, TBM_SETPAGESIZE, (WPARAM)0, (LPARAM)250); - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)1000); - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)2250); - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)6000); - - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_SLIDER, TBM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG(0, 12000)); - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_SLIDER, TBM_SETLINESIZE, (WPARAM)0, (LPARAM)150); - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_SLIDER, TBM_SETPAGESIZE, (WPARAM)0, (LPARAM)375); - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)3000); - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)4500); - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)6000); - - // Set sliders to current value - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)(fVidScreenAngle * RADTODEG * 100.0f)); - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)(fVidScreenCurvature * RADTODEG * 150.0f)); - - // Set the edit controls to current value - _stprintf(szText, _T("%0.2f"), fVidScreenAngle * RADTODEG); - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - _stprintf(szText, _T("%0.2f"), fVidScreenCurvature * RADTODEG); - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - // Update the screen - if (bVidOkay) { - VidPaint(2); - } - - return TRUE; - } - case WM_COMMAND: { - switch (HIWORD(wParam)) { - case BN_CLICKED: { - if (LOWORD(wParam) == IDOK) { - nExitStatus = 1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDCANCEL) { - nExitStatus = -1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - case EN_UPDATE: { - if (nExitStatus == 0) { - TCHAR szText[16] = _T(""); - bool bPoint = 0; - bool bValid = 1; - - if ((HWND)lParam == hScreenAngleEdit) { - if (SendDlgItemMessage(hDlg, IDC_SCREENANGLE_EDIT, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0) < 16) { - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_EDIT, WM_GETTEXT, (WPARAM)16, (LPARAM)szText); - } - } else { - if (SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_EDIT, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0) < 16) { - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_EDIT, WM_GETTEXT, (WPARAM)16, (LPARAM)szText); - } - } - - // Scan string in the edit control for illegal characters - for (int i = 0; szText[i]; i++) { - if (szText[i] == '.') { - if (bPoint) { - bValid = 0; - break; - } - } else { - if (!_istdigit(szText[i])) { - bValid = 0; - break; - } - } - } - - if (bValid) { - if ((HWND)lParam == hScreenAngleEdit) { - fVidScreenAngle = _tcstod(szText, NULL) * DEGTORAD; - if (fVidScreenAngle < 0.0f) { - fVidScreenAngle = 0.0f; - } else { - if (fVidScreenAngle > PI / 1.5f) { - fVidScreenAngle = PI / 1.5f; - } - } - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)(fVidScreenAngle * RADTODEG * 100.0f)); - } else { - fVidScreenCurvature = _tcstod(szText, NULL) * DEGTORAD; - if (fVidScreenCurvature < 0.0f) { - fVidScreenCurvature = 0.0f; - } else { - if (fVidScreenCurvature > PI / 2.25f) { - fVidScreenCurvature = PI / 2.25f; - } - } - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)(fVidScreenCurvature * RADTODEG * 150.0f)); - } - - // Update the screen - if (bVidOkay) { - VidPaint(2); - } - } - } - break; - } - } - break; - } - - case WM_HSCROLL: { - switch (LOWORD(wParam)) { - case TB_BOTTOM: - case TB_ENDTRACK: - case TB_LINEDOWN: - case TB_LINEUP: - case TB_PAGEDOWN: - case TB_PAGEUP: - case TB_THUMBPOSITION: - case TB_THUMBTRACK: - case TB_TOP: { - if (nExitStatus == 0) { - TCHAR szText[16]; - - // Update the contents of the edit control - if ((HWND)lParam == hScreenAngleSlider) { - fVidScreenAngle = (float)SendDlgItemMessage(hDlg, IDC_SCREENANGLE_SLIDER, TBM_GETPOS, (WPARAM)0, (LPARAM)0) * DEGTORAD / 100.0f; - _stprintf(szText, _T("%0.2f"), fVidScreenAngle * RADTODEG); - SendDlgItemMessage(hDlg, IDC_SCREENANGLE_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - } else { - fVidScreenCurvature = (float)SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_SLIDER, TBM_GETPOS, (WPARAM)0, (LPARAM)0) * DEGTORAD / 150.0f; - _stprintf(szText, _T("%0.2f"), fVidScreenCurvature * RADTODEG); - SendDlgItemMessage(hDlg, IDC_SCREENCURVATURE_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - } - - // Update the screen - if (bVidOkay) { - VidPaint(0); - } - } - break; - } - } - break; - } - - case WM_CLOSE: - if (nExitStatus != 1) { - fVidScreenAngle = fPrevScreenAngle; - fVidScreenCurvature = fPrevScreenCurvature; - } - EndDialog(hDlg, 0); - break; - } - - return 0; -} - -void ScreenAngleDialog() -{ - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_SCREENANGLE), hScrnWnd, (DLGPROC)ScreenAngleProc); -} - -// ----------------------------------------------------------------------------- -// CPU clock dialog - -static INT_PTR CALLBACK CPUClockProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) // LPARAM lParam -{ - switch (Msg) { - case WM_INITDIALOG: { - TCHAR szText[16]; - nExitStatus = 0; - - WndInMid(hDlg, hScrnWnd); - - // Initialise slider - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG(0x80, 0x0200)); - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_SETLINESIZE, (WPARAM)0, (LPARAM)0x05); - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_SETPAGESIZE, (WPARAM)0, (LPARAM)0x10); - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)0x0100); - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)0x0120); - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)0x0140); - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)0x0180); - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nBurnCPUSpeedAdjust); - - // Set the edit control to current value - _stprintf(szText, _T("%i"), nBurnCPUSpeedAdjust * 100 / 256); - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - return TRUE; - } - case WM_COMMAND: { - switch (HIWORD(wParam)) { - case BN_CLICKED: { - if (LOWORD(wParam) == IDOK) { - nExitStatus = 1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDCANCEL) { - nExitStatus = -1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - case EN_UPDATE: { - if (nExitStatus == 0) { - TCHAR szText[16] = _T(""); - bool bValid = 1; - int nValue; - - if (SendDlgItemMessage(hDlg, IDC_CPUCLOCK_EDIT, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0) < 16) { - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_EDIT, WM_GETTEXT, (WPARAM)16, (LPARAM)szText); - } - - // Scan string in the edit control for illegal characters - for (int i = 0; szText[i]; i++) { - if (!_istdigit(szText[i])) { - bValid = 0; - break; - } - } - - if (bValid) { - nValue = _tcstol(szText, NULL, 0); - if (nValue < 25) { - nValue = 25; - } else { - if (nValue > 400) { - nValue = 400; - } - } - - nValue = (int)((double)nValue * 256.0 / 100.0 + 0.5); - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)nValue); - } - } - break; - } - } - break; - } - - case WM_HSCROLL: { - switch (LOWORD(wParam)) { - case TB_BOTTOM: - case TB_ENDTRACK: - case TB_LINEDOWN: - case TB_LINEUP: - case TB_PAGEDOWN: - case TB_PAGEUP: - case TB_THUMBPOSITION: - case TB_THUMBTRACK: - case TB_TOP: { - if (nExitStatus == 0) { - TCHAR szText[16]; - int nValue; - - // Update the contents of the edit control - nValue = SendDlgItemMessage(hDlg, IDC_CPUCLOCK_SLIDER, TBM_GETPOS, (WPARAM)0, (LPARAM)0); - nValue = (int)((double)nValue * 100.0 / 256.0 + 0.5); - _stprintf(szText, _T("%i"), nValue); - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - } - break; - } - } - break; - } - - case WM_CLOSE: - if (nExitStatus == 1) { - TCHAR szText[16] = _T(""); - - SendDlgItemMessage(hDlg, IDC_CPUCLOCK_EDIT, WM_GETTEXT, (WPARAM)16, (LPARAM)szText); - nBurnCPUSpeedAdjust = _tcstol(szText, NULL, 0); - if (nBurnCPUSpeedAdjust < 25) { - nBurnCPUSpeedAdjust = 25; - } else { - if (nBurnCPUSpeedAdjust > 400) { - nBurnCPUSpeedAdjust = 400; - } - } - - nBurnCPUSpeedAdjust = (int)((double)nBurnCPUSpeedAdjust * 256.0 / 100.0 + 0.5); - } - EndDialog(hDlg, 0); - break; - } - - return 0; -} - -void CPUClockDialog() -{ - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_CPUCLOCK), hScrnWnd, (DLGPROC)CPUClockProc); -} - -// ----------------------------------------------------------------------------- -// Cubic filter quality dialog - -static INT_PTR CALLBACK CubicProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) // LPARAM lParam -{ - static double dPrevB, dPrevC; - - switch (Msg) { - case WM_INITDIALOG: { - TCHAR szText[16]; - dPrevB = dVidCubicB; - dPrevC = dVidCubicC; - nExitStatus = 0; - - WndInMid(hDlg, hScrnWnd); - - // Initialise slider - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG(0, 10000)); - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETLINESIZE, (WPARAM)0, (LPARAM)100); - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETPAGESIZE, (WPARAM)0, (LPARAM)500); - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)3333); - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)5000); - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETTIC, (WPARAM)0, (LPARAM)7500); - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)((1.0 - dVidCubicB) * 10000)); - - // Set the edit control to current value - _stprintf(szText, _T("%.3lf"), 1.0 - dVidCubicB); - SendDlgItemMessage(hDlg, IDC_SCANLINE_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - SetWindowText(hDlg, FBALoadStringEx(hAppInst, IDS_NUMDIAL_FILTER_SHARP, true)); - - // Update the screen - if (bDrvOkay) { - VidPaint(2); - } - - return TRUE; - } - case WM_COMMAND: { - switch (HIWORD(wParam)) { - case BN_CLICKED: { - if (LOWORD(wParam) == IDOK) { - nExitStatus = 1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDCANCEL) { - nExitStatus = -1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - case EN_UPDATE: { - if (nExitStatus == 0) { - TCHAR szText[16] = _T(""); - bool bPoint = 0; - bool bValid = 1; - - if (SendDlgItemMessage(hDlg, IDC_SCANLINE_EDIT, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0) < 16) { - SendDlgItemMessage(hDlg, IDC_SCANLINE_EDIT, WM_GETTEXT, (WPARAM)16, (LPARAM)szText); - } - - // Scan string in the edit control for illegal characters - for (int i = 0; szText[i]; i++) { - if (szText[i] == _T('.')) { - if (bPoint) { - bValid = 0; - break; - } - } else { - if (!_istdigit(szText[i])) { - bValid = 0; - break; - } - } - } - - if (bValid) { - dVidCubicB = 1.0 - _tcstod(szText, NULL); - if (dVidCubicB < 0.0) { - dVidCubicB = 0.0; - } else { - if (dVidCubicB > 1.0) { - dVidCubicB = 1.0; - } - } - - // Set slider to current value - SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)((1.0 - dVidCubicB) * 10000)); - - // Update the screen - if (bVidOkay) { - VidPaint(2); - } - } - } - break; - } - } - break; - } - - case WM_HSCROLL: { - switch (LOWORD(wParam)) { - case TB_BOTTOM: - case TB_ENDTRACK: - case TB_LINEDOWN: - case TB_LINEUP: - case TB_PAGEDOWN: - case TB_PAGEUP: - case TB_THUMBPOSITION: - case TB_THUMBTRACK: - case TB_TOP: { - if (nExitStatus == 0) { - TCHAR szText[16]; - - // Update the contents of the edit control - dVidCubicB = 1.0 - (double)SendDlgItemMessage(hDlg, IDC_SCANLINE_SLIDER, TBM_GETPOS, (WPARAM)0, (LPARAM)0) / 10000; - _stprintf(szText, _T("%.3lf"), 1.0 - dVidCubicB); - SendDlgItemMessage(hDlg, IDC_SCANLINE_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - // Update the screen - if (bVidOkay) { -// VidRedraw(); - VidPaint(2); - } - } - break; - } - } - break; - } - - case WM_CLOSE: - if (nExitStatus != 1) { - dVidCubicB = dPrevB; - dVidCubicC = dPrevC; - } - EndDialog(hDlg, 0); - break; - } - - return 0; -} - -void CubicSharpnessDialog() -{ - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_SCANLINE), hScrnWnd, (DLGPROC)CubicProc); -} - diff --git a/jan/src/burner/win32/paletteviewer.cpp b/jan/src/burner/win32/paletteviewer.cpp deleted file mode 100644 index 9d0651059..000000000 --- a/jan/src/burner/win32/paletteviewer.cpp +++ /dev/null @@ -1,196 +0,0 @@ -#include "burner.h" - -static HWND hPaletteViewerDlg = NULL; -static HWND hParent = NULL; -static HWND PaletteControl[256] = {NULL,}; -static HBRUSH PaletteBrush[256] = {NULL,}; - -static int nPalettePosition; -static int nPaletteEntries; - -static void CalcBrushes(int nStartColour) -{ - int Colour, r, g, b; - - for (int i = 0; i < 256; i++) { - DeleteObject(PaletteBrush[i]); - PaletteBrush[i] = NULL; - - if (i + nStartColour < nPaletteEntries) { - Colour = pBurnDrvPalette[i + nStartColour]; - - if (nVidImageDepth < 16) { - // 15-bit - r = (Colour & 0x7c00) >> 7; - g = (Colour & 0x03e0) >> 2; - b = (Colour & 0x001f) << 3; - } else - if (nVidImageDepth == 16) { - // 16-bit - r = (Colour & 0xf800) >> 8; - g = (Colour & 0x07e0) >> 3; - b = (Colour & 0x001f) << 3; - - } else { - // 24/32-bit - r = (Colour & 0xff0000) >> 16; - g = (Colour & 0x00ff00) >> 8; - b = (Colour & 0x0000ff); - } - - PaletteBrush[i] = CreateSolidBrush(RGB(r, g, b)); - } - } -} - -static void UpdateLabels() -{ - TCHAR szItemText[10]; - - for (int i = 0; i < 16; i++) { - int nLabel = nPalettePosition + (i * 16); - szItemText[0] = _T('\0'); - _stprintf(szItemText, _T("%05X"), nLabel); - SendMessage(GetDlgItem(hPaletteViewerDlg, IDC_GFX_VIEWER_VERT_1 + i), WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - } -} - -static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if (Msg == WM_INITDIALOG) { - hPaletteViewerDlg = hDlg; - - if (bDrvOkay) { - if (!kNetGame && bAutoPause) bRunPause = 1; - AudSoundStop(); - } - - for (int y = 0; y < 16; y++) { - for (int x = 0; x < 16; x++) { - PaletteControl[(y * 16) + x] = CreateWindowEx(0, _T("STATIC"), NULL, WS_CHILD | WS_VISIBLE | SS_NOTIFY, (x * 21) + 38, (y * 21) + 21, 20, 20, hPaletteViewerDlg, NULL, NULL, NULL); - } - } - - nPaletteEntries = BurnDrvGetPaletteEntries(); - nPalettePosition = 0x0000; - CalcBrushes(nPalettePosition); - - WndInMid(hDlg, hParent); - SetFocus(hDlg); - - return TRUE; - } - - if (Msg == WM_CTLCOLORSTATIC) { - for (int i = 0; i < 256; i++) { - if ((HWND)lParam == PaletteControl[i]) { - return (INT_PTR)PaletteBrush[i]; - } - - } - } - - if (Msg == WM_CLOSE) { - for (int i = 0; i < 256; i++) { - DeleteObject(PaletteBrush[i]); - PaletteBrush[i] = NULL; - PaletteControl[i] = NULL; - } - - nPalettePosition = 0; - nPaletteEntries = 0; - - EndDialog(hPaletteViewerDlg, 0); - - EnableWindow(hScrnWnd, TRUE); - DestroyWindow(hPaletteViewerDlg); - - if (bDrvOkay) { - if(!bAltPause && bRunPause) bRunPause = 0; - AudSoundPlay(); - } - - return 0; - } - - if (Msg == WM_COMMAND) { - int Id = LOWORD(wParam); - int Notify = HIWORD(wParam); - - if (Notify == STN_CLICKED) { - TCHAR szText[100]; - - for (int i = 0; i < 256; i++) { - if ((HWND)lParam == PaletteControl[i]) { - int Colour, r, g, b; - - Colour = pBurnDrvPalette[i + nPalettePosition]; - - if (nVidImageDepth < 16) { - // 15-bit - r = (Colour & 0x7c00) >> 7; - g = (Colour & 0x03e0) >> 2; - b = (Colour & 0x001f) << 3; - } else - if (nVidImageDepth == 16) { - // 16-bit - r = (Colour & 0xf800) >> 8; - g = (Colour & 0x07e0) >> 3; - b = (Colour & 0x001f) << 3; - } else { - // 24/32-bit - r = (Colour & 0xff0000) >> 16; - g = (Colour & 0x00ff00) >> 8; - b = (Colour & 0x0000ff); - } - - szText[0] = _T('\0'); - _stprintf(szText, _T("Selected colour: #%X RGB #%02X%02X%02X"), i + nPalettePosition, r, g, b); - SendMessage(GetDlgItem(hPaletteViewerDlg, IDC_GFX_VIEWER_SEL_COL), WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - return 0; - } - } - } - - if (Id == IDCANCEL && Notify == BN_CLICKED) { - SendMessage(hPaletteViewerDlg, WM_CLOSE, 0, 0); - return 0; - } - - if (Id == IDC_GFX_VIEWER_PREV && Notify == BN_CLICKED) { - nPalettePosition -= 0x100; - if (nPalettePosition < 0) nPalettePosition = nPaletteEntries - 0x100; - CalcBrushes(nPalettePosition); - RedrawWindow(hPaletteViewerDlg, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN); - UpdateLabels(); - return 0; - } - - if (Id == IDC_GFX_VIEWER_NEXT && Notify == BN_CLICKED) { - nPalettePosition += 0x100; - if (nPalettePosition >= nPaletteEntries) nPalettePosition = 0x0000; - CalcBrushes(nPalettePosition); - RedrawWindow(hPaletteViewerDlg, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN); - UpdateLabels(); - return 0; - } - } - - return 0; -} - -int PaletteViewerDialogCreate(HWND hParentWND) -{ - if (pBurnDrvPalette == NULL) { - bprintf(PRINT_IMPORTANT, _T("No DrvPalette associated with this game.\n")); - return 1; - } - - hParent = hParentWND; - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_PALETTEVIEWER), hParent, (DLGPROC)DialogProc); - - hParent = NULL; - hPaletteViewerDlg = NULL; - - return 0; -} diff --git a/jan/src/burner/win32/popup_win32.cpp b/jan/src/burner/win32/popup_win32.cpp deleted file mode 100644 index ed98c41f5..000000000 --- a/jan/src/burner/win32/popup_win32.cpp +++ /dev/null @@ -1,364 +0,0 @@ -// Display a dialog containing error messages -#include "burner.h" -#include - -static TCHAR* pszBufferEnglish = NULL; -static TCHAR* pszBufferLocal = NULL; - -static int nBufferEnglishSize = 0; -static int nBufferLocalSize = 0; - -static int nPopupFlags; - -static HFONT hEditFont; -static int nIcon; - -// ---------------------------------------------------------------------------- -// Log the popup message to the debug log/console - -static int FBAPopupLog() -{ - TCHAR* pszTypeEnglish; - - switch (nPopupFlags & 7) { - case PUF_TYPE_ERROR: - pszTypeEnglish = FBALoadStringEx(hAppInst, IDS_ERR_ERROR, false); - break; - case PUF_TYPE_WARNING: - pszTypeEnglish = FBALoadStringEx(hAppInst, IDS_ERR_WARNING, false); - break; - default: - pszTypeEnglish = FBALoadStringEx(hAppInst, IDS_ERR_INFORMATION, false); - break; - } - - dprintf(_T("*** %s message:\n"), pszTypeEnglish); - - for (TCHAR* szText = pszBufferEnglish; ; ) { - int nLen; - - for (nLen = 0; szText[nLen] && szText[nLen] != _T('\n'); nLen++) { } - - if (nLen) { - TCHAR szFormat[16]; - _stprintf(szFormat, _T(" %%.%is\n"), nLen); - dprintf(szFormat, szText); - } - - if (!szText[nLen]) { - break; - } - - szText += nLen + 1; - } - - return 0; -} - -// ---------------------------------------------------------------------------- - -static INT_PTR CALLBACK FBAPopupProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - switch (Msg) { - - // Grab the handle to the font we need to use - case WM_SETFONT: { - hEditFont = (HFONT)wParam; - break; - } - - case WM_DRAWITEM: { - if (((LPDRAWITEMSTRUCT)lParam)->CtlID == IDC_MESSAGE_ICON) { - DrawIconEx(((LPDRAWITEMSTRUCT)lParam)->hDC, 0, 0, (HICON)LoadImage(NULL, MAKEINTRESOURCE(nIcon), IMAGE_ICON, 0, 0, LR_LOADTRANSPARENT | LR_SHARED), 32, 32, 0, NULL, DI_NORMAL | DI_DEFAULTSIZE); - } - - break; - } - - case WM_INITDIALOG: { - int nBeep = -1; - TCHAR szCaption[1024] = _T(""); - TCHAR* pszTypeEnglish; - TCHAR* pszTypeLocal; - - nIcon = 0; - - switch (nPopupFlags & 7) { - case PUF_TYPE_ERROR: - nIcon = OIC_ERROR; - nBeep = MB_ICONHAND; - pszTypeEnglish = FBALoadStringEx(hAppInst, IDS_ERR_ERROR, false); - pszTypeLocal = FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true); - break; - case PUF_TYPE_WARNING: - nIcon = OIC_WARNING; - nBeep = MB_ICONEXCLAMATION; - pszTypeEnglish = FBALoadStringEx(hAppInst, IDS_ERR_WARNING, false); - pszTypeLocal = FBALoadStringEx(hAppInst, IDS_ERR_WARNING, true); - break; - default: - nIcon = OIC_INFORMATION; - nBeep = MB_ICONASTERISK; - pszTypeEnglish = FBALoadStringEx(hAppInst, IDS_ERR_INFORMATION, false); - pszTypeLocal = FBALoadStringEx(hAppInst, IDS_ERR_INFORMATION, true); - break; - } - - // Set the icon - SendDlgItemMessage(hDlg, IDC_MESSAGE_ICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(NULL, MAKEINTRESOURCE(nIcon), IMAGE_ICON, 32, 32, LR_SHARED)); - - // Set the caption - _sntprintf(szCaption, 1024, _T(APP_TITLE) _T(" %s"), pszTypeLocal); - SetWindowText(hDlg, szCaption); - - { - SIZE sizee = { 0, 0 }; - SIZE sizel = { 0, 0 }; - POINT p = { 0, 0 }; - RECT rect; - HWND hWnd; - - { - hWnd = GetDlgItem(hDlg, IDC_MESSAGE_EDIT_ENG); - HDC hDC = GetDC(hWnd); - HFONT hFont = (HFONT)SelectObject(hDC, hEditFont); - - for (TCHAR* szText = pszBufferEnglish; ; ) { - - SIZE line; - int nLen; - - for (nLen = 0; szText[nLen] && szText[nLen] != _T('\n'); nLen++) { } - - GetTextExtentPoint32(hDC, szText, nLen ? nLen : 1, &line); - - if (sizee.cx < line.cx) { - sizee.cx = line.cx; - } - sizee.cy += line.cy; - - if (!szText[nLen]) { - break; - } - - szText += nLen + 1; - } - - if (bLocalisationActive && pszBufferLocal) { - for (TCHAR* szText = pszBufferLocal; ; ) { - - SIZE line; - int nLen; - - for (nLen = 0; szText[nLen] && szText[nLen] != _T('\n'); nLen++) { } - - GetTextExtentPoint32(hDC, szText, nLen ? nLen : 1, &line); - - if (sizel.cx < line.cx) { - sizel.cx = line.cx; - } - sizel.cy += line.cy; - - if (!szText[nLen]) { - break; - } - - szText += nLen + 1; - } - } - - SelectObject(hDC, hFont); - ReleaseDC(hWnd, hDC); - } - - // Set minimum size if needed - hWnd = GetDlgItem(hDlg, IDOK); - GetWindowRect(hWnd, &rect); - if (sizee.cx < (rect.right - rect.left)) { - sizee.cx = rect.right - rect.left; - } - - ClientToScreen(hDlg, &p); - GetWindowRect(hDlg, &rect); - - // Size dialog and edit control containing message text - if (bLocalisationActive && pszBufferLocal) { - - if (sizel.cx < sizee.cx) { - sizel.cx = sizee.cx; - } else { - sizee.cx = sizel.cx; - } - if (sizel.cy < 32) { - sizel.cy = 32; - } - - MoveWindow(hDlg, rect.left, rect.top, rect.right - rect.left + sizee.cx, rect.bottom - rect.top + sizee.cy + sizel.cy + 12, FALSE); - - hWnd = GetDlgItem(hDlg, IDC_MESSAGE_EDIT_LOCAL); - GetWindowRect(hWnd, &rect); - SetWindowPos(hWnd, NULL, 0, 0, rect.right - rect.left + sizel.cx, rect.bottom - rect.top + sizel.cy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW); - SendMessage(hWnd, WM_SETTEXT, (WPARAM)0, (LPARAM)pszBufferLocal); - SendMessage(hWnd, EM_SETMARGINS, EC_LEFTMARGIN, 3); - ShowWindow(hWnd, SW_SHOW); - - hWnd = GetDlgItem(hDlg, IDC_MESSAGE_BACK); - SetWindowPos(hWnd, NULL, 0, 0, 9999, rect.bottom - p.y + sizel.cy + 6, SWP_NOZORDER | SWP_NOREDRAW); - ShowWindow(hWnd, SW_SHOW); - - p.y -= rect.bottom - rect.top + sizel.cy + 12; - } else { - if (sizee.cy < 32) { - sizee.cy = 32; - } - - MoveWindow(hDlg, rect.left, rect.top, rect.right - rect.left + sizee.cx, rect.bottom - rect.top + sizee.cy, FALSE); - } - - hWnd = GetDlgItem(hDlg, IDC_MESSAGE_EDIT_ENG); - SendMessage(hWnd, EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_3DFACE)); - GetWindowRect(hWnd, &rect); - SetWindowPos(hWnd, NULL, rect.left - p.x, rect.top - p.y, rect.right - rect.left + sizee.cx, rect.bottom - rect.top + sizee.cy, (pszBufferLocal ? 0 : SWP_NOMOVE) | SWP_NOZORDER | SWP_NOREDRAW); - SendMessage(hWnd, WM_SETTEXT, (WPARAM)0, (LPARAM)pszBufferEnglish); - SendMessage(hWnd, EM_SETMARGINS, EC_LEFTMARGIN, 3); - - // Center button - GetClientRect(hDlg, &rect); - p.x = (rect.right - rect.left) / 2; - hWnd = GetDlgItem(hDlg, IDOK); - GetWindowRect(hWnd, &rect); - SetWindowPos(hWnd, NULL, p.x - (rect.right - rect.left) / 2, rect.top - p.y + sizee.cy, 0, 0, SWP_NOSIZE | SWP_NOZORDER); - } - - WndInMid(hDlg, hScrnWnd); - SetForegroundWindow(hDlg); - MessageBeep(nBeep); - - return TRUE; - } - case WM_COMMAND: { - if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDOK) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - case WM_CLOSE: { - EndDialog(hDlg, 0); - break; - } - } - - return 0; -} - -// ---------------------------------------------------------------------------- - -int FBAPopupAddText(int nFlags, TCHAR* pszFormat, ...) -{ - TCHAR szString[1024] = _T(""); - TCHAR* pszStringEnglish; - - va_list vaEnglish; - va_start(vaEnglish, pszFormat); - - if (IS_INTRESOURCE(pszFormat)) { - pszStringEnglish = FBALoadStringEx(hAppInst, (INT_PTR)pszFormat, false); - } else { - pszStringEnglish = pszFormat; - } - - // See if we need to load strings from reources - if (nFlags & PUF_TEXT_TRANSLATE) { - TCHAR* pszStringLocal; - - va_list vaLocal; - va_start(vaLocal, pszFormat); - - if (IS_INTRESOURCE(pszFormat)) { - pszStringLocal = FBALoadStringEx(hAppInst, (INT_PTR)pszFormat, true); - } else { - pszStringLocal = pszFormat; - } - - // Add the translated string if present - if (bLocalisationActive && (nFlags & PUF_TEXT_TRANSLATE) && pszStringLocal && *pszStringLocal) { - // Add the translated string - int nLen = _vsntprintf(szString, 1024, pszStringLocal, vaLocal); - if (nLen > 0) { - TCHAR* pszNewBuffer = (TCHAR*)realloc(pszBufferLocal, (nLen + nBufferLocalSize + 1) * sizeof(TCHAR)); - if (pszNewBuffer) { - pszBufferLocal = pszNewBuffer; - _tcsncpy(pszBufferLocal + nBufferLocalSize, szString, nLen); - nBufferLocalSize += nLen; - pszBufferLocal[nBufferLocalSize] = 0; - } - } - } - - va_end(vaLocal); - } - - // Add the English language string - if (pszStringEnglish && *pszStringEnglish) { - int nLen = _vsntprintf(szString, 1024, pszStringEnglish, vaEnglish); - if (nLen > 0) { - TCHAR* pszNewBuffer = (TCHAR*)realloc(pszBufferEnglish, (nLen + nBufferEnglishSize + 1) * sizeof(TCHAR)); - if (pszNewBuffer) { - pszBufferEnglish = pszNewBuffer; - _tcsncpy(pszBufferEnglish + nBufferEnglishSize, szString, nLen); - nBufferEnglishSize += nLen; - pszBufferEnglish[nBufferEnglishSize] = 0; - } - } - } - - va_end(vaEnglish); - - return 0; -} - -int FBAPopupDestroyText() -{ - if (pszBufferEnglish) { - free(pszBufferEnglish); - pszBufferEnglish = NULL; - } - nBufferEnglishSize = 0; - - if (pszBufferLocal) { - free(pszBufferLocal); - pszBufferLocal = NULL; - } - nBufferLocalSize = 0; - - return 0; -} - -// ---------------------------------------------------------------------------- - -int FBAPopupDisplay(int nFlags) -{ - HMODULE hRiched = NULL; - -#if defined (_UNICODE) - hRiched = LoadLibrary(L"RICHED20.DLL"); -#else - hRiched = LoadLibrary("RICHED20.DLL"); -#endif - - nPopupFlags = nFlags; - - SplashDestroy(true); - - FBAPopupLog(); - - if (!(nPopupFlags & PUF_TYPE_LOGONLY) && hRiched) { - DialogBox(hAppInst, MAKEINTRESOURCE(IDD_POPUP), hScrnWnd, (DLGPROC)FBAPopupProc); - FreeLibrary(hRiched); - hRiched = NULL; - } - - FBAPopupDestroyText(); - - return 1; -} diff --git a/jan/src/burner/win32/progress.cpp b/jan/src/burner/win32/progress.cpp deleted file mode 100644 index d40924633..000000000 --- a/jan/src/burner/win32/progress.cpp +++ /dev/null @@ -1,202 +0,0 @@ -#include "burner.h" -#include - -static HWND hProgressDlg = NULL; -static HANDLE hProgressThread = NULL; -static unsigned ProgressThreadID = 0; - -int nProgressPosBurn, nProgressPosBurner; -int nProgressMin, nProgressMax; - -static HANDLE hEvent = NULL; - -// ---------------------------------------------------------------------------- -// Callbacks for burn library - -static int __cdecl ProgressSetRangeBurn(double dProgressRange) -{ - if (hProgressThread == NULL || hProgressDlg == NULL) { - return 1; - } - - nProgressMin = -(int)((double)nProgressMax * dProgressRange); - SendDlgItemMessage(hProgressDlg, IDC_WAIT_PROG, PBM_SETRANGE32, nProgressMin, nProgressMax); - - return 0; -} - -static int __cdecl ProgressUpdateBurn(double dProgress, const TCHAR* pszText, bool bAbs) -{ - if (hProgressThread == NULL || hProgressDlg == NULL) { - return 1; - } - - if (pszText) { - SendDlgItemMessage(hProgressDlg, IDC_WAIT_LABEL_B2, WM_SETTEXT, 0, (LPARAM)pszText); - SetWindowText(hScrnWnd, pszText); - } - - if (bAbs) { - nProgressPosBurn = (int)((double)(-nProgressMin) * dProgress); - if (nProgressPosBurn > -nProgressMin) { - nProgressPosBurn = -nProgressMin; - } - SendDlgItemMessage(hProgressDlg, IDC_WAIT_PROG, PBM_SETPOS, (WPARAM)(nProgressMin + nProgressPosBurn + nProgressPosBurner), 0); - } else { - if (dProgress) { - nProgressPosBurn += (int)((double)(-nProgressMin) * dProgress); - if (nProgressPosBurn > -nProgressMin) { - nProgressPosBurn = -nProgressMin; - } - SendDlgItemMessage(hProgressDlg, IDC_WAIT_PROG, PBM_SETPOS, (WPARAM)(nProgressMin + nProgressPosBurn + nProgressPosBurner), 0); - } - } - - return 0; -} - -// ---------------------------------------------------------------------------- -// Callback for burner - -int ProgressUpdateBurner(double dProgress, const TCHAR* pszText, bool bAbs) -{ - if (hProgressThread == NULL || hProgressDlg == NULL) { - return 1; - } - - if (pszText) { - SendDlgItemMessage(hProgressDlg, IDC_WAIT_LABEL_B2, WM_SETTEXT, 0, (LPARAM)pszText); - SetWindowText(hScrnWnd, pszText); - } - - if (bAbs) { - nProgressPosBurner = (int)((double)nProgressMax * dProgress); - if (nProgressPosBurner > nProgressMax) { - nProgressPosBurner = nProgressMax; - } - SendDlgItemMessage(hProgressDlg, IDC_WAIT_PROG, PBM_SETPOS, (WPARAM)(nProgressMin + nProgressPosBurn + nProgressPosBurner), 0); - } else { - if (dProgress) { - if (nProgressPosBurner > nProgressMax) { - nProgressPosBurner = nProgressMax; - } - nProgressPosBurner += (int)((double)nProgressMax * dProgress); - SendDlgItemMessage(hProgressDlg, IDC_WAIT_PROG, PBM_SETPOS, (WPARAM)(nProgressMin + nProgressPosBurn + nProgressPosBurner), 0); - } - } - - return 0; -} - -// ---------------------------------------------------------------------------- -// Code that runs in a seperate thread - -static INT_PTR CALLBACK ProgressProc(HWND hDlg, UINT Msg, WPARAM /*wParam*/, LPARAM /*lParam*/) -{ - if (Msg == WM_INITDIALOG) { - TCHAR szText[128] = _T(""); - - hProgressDlg = hDlg; - - SendDlgItemMessage(hDlg, IDC_WAIT_PROG, PBM_SETRANGE32, nProgressMin, nProgressMax); - - _stprintf(szText, FBALoadStringEx(hAppInst, IDS_PROGRESS_LOADING, true), BurnDrvGetText(DRV_NAME)); - SendDlgItemMessage(hDlg, IDC_WAIT_LABEL_B1, WM_SETTEXT, 0, (LPARAM)szText); - - ShowWindow(GetDlgItem(hDlg, IDC_WAIT_LABEL_B1), TRUE); - ShowWindow(GetDlgItem(hDlg, IDC_WAIT_LABEL_B2), TRUE); - - WndInMid(hDlg, hScrnWnd); - SetForegroundWindow(hDlg); - SetWindowPos(hDlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - - return TRUE; - } - - return 0; -} - -static unsigned __stdcall DoProgress(void*) -{ - MSG msg; - - // Raise the thread priority for this thread - SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); - - nProgressMin = 0; - nProgressMax = 1 << 30; - - nProgressPosBurn = 0; - nProgressPosBurner = 0; - - BurnExtProgressRangeCallback = ProgressSetRangeBurn; - BurnExtProgressUpdateCallback = ProgressUpdateBurn; - - FBACreateDialog(hAppInst, MAKEINTRESOURCE(IDD_WAIT), NULL, (DLGPROC)ProgressProc); - - if (hEvent) { - SetEvent(hEvent); - } - - while (GetMessage(&msg, NULL, 0, 0)) { - - // See if we need to end the thread - if (msg.message == (WM_APP + 0)) { - break; - } - - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - DestroyWindow(hProgressDlg); - - return 0; -} - -// ---------------------------------------------------------------------------- - -int ProgressCreate() -{ - if (hProgressDlg || hProgressThread) { - return 1; - } - - hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - - hProgressThread = (HANDLE)_beginthreadex(NULL, 0, DoProgress, NULL, 0, &ProgressThreadID); - - WaitForSingleObject(hEvent, 15000); - - CloseHandle(hEvent); - hEvent = NULL; - - return 0; -} - -int ProgressDestroy() -{ - if (hProgressThread) { - - // Signal the prgress thread to end - PostThreadMessage(ProgressThreadID, WM_APP + 0, 0, 0); - - // Wait for the thread to finish - if (WaitForSingleObject(hProgressThread, 15000) != WAIT_OBJECT_0) { - // If the thread doesn't finish within 15 seconds, forcibly kill it - TerminateThread(hProgressThread, 1); - } - - BurnExtProgressRangeCallback = NULL; - BurnExtProgressUpdateCallback = NULL; - - hProgressDlg = NULL; - - CloseHandle(hProgressThread); - - hProgressThread = NULL; - ProgressThreadID = 0; - } - - return 0; -} diff --git a/jan/src/burner/win32/replay.cpp b/jan/src/burner/win32/replay.cpp deleted file mode 100644 index aee0c0bb5..000000000 --- a/jan/src/burner/win32/replay.cpp +++ /dev/null @@ -1,1222 +0,0 @@ -// Functions for recording & replaying input -#include "burner.h" -#include "dynhuff.h" -#include - -#include - -#ifndef W_OK -#define W_OK 4 -#endif - -#define MAX_METADATA 1024 -wchar_t wszMetadata[MAX_METADATA]; -wchar_t wszStartupGame[MAX_PATH]; -wchar_t wszAuthorInfo[MAX_METADATA-64]; - -INT32 nReplayStatus = 0; // 1 record, 2 replay, 0 nothing -bool bReplayReadOnly = false; -bool bReplayShowMovement = false; -bool bReplayDontClose = false; -INT32 nReplayUndoCount = 0; -bool bReplayFrameCounterDisplay = 1; -TCHAR szFilter[1024]; -INT32 movieFlags = 0; -bool bStartFromReset = true; -TCHAR szCurrentMovieFilename[MAX_PATH] = _T(""); -UINT32 nTotalFrames = 0; -UINT32 nReplayCurrentFrame; - -// If a driver has external data that needs to be recorded every frame. -INT32 nReplayExternalDataCount = 0; -UINT8 *ReplayExternalData = NULL; - -#define MOVIE_FLAG_FROM_POWERON (1<<1) - -const UINT8 nMovieVersion = 0x01; -UINT32 nStartFrame; -static UINT32 nEndFrame; - -static FILE* fp = NULL; -static INT32 nSizeOffset; - -static short nPrevInputs[0x0100]; - -static INT32 nPrintInputsActive[2] = { 0, 0 }; - -static INT32 ReplayDialog(); -static INT32 RecordDialog(); - -INT32 RecordInput() -{ - struct BurnInputInfo bii; - memset(&bii, 0, sizeof(bii)); - - for (UINT32 i = 0; i < nGameInpCount; i++) { - BurnDrvGetInputInfo(&bii, i); - if (bii.pVal) { - if (bii.nType & BIT_GROUP_ANALOG) { - if (*bii.pShortVal != nPrevInputs[i]) { - EncodeBuffer(i); - EncodeBuffer(*bii.pShortVal >> 8); - EncodeBuffer(*bii.pShortVal & 0xFF); - nPrevInputs[i] = *bii.pShortVal; - } - } else { - if (*bii.pVal != nPrevInputs[i]) { - EncodeBuffer(i); - EncodeBuffer(*bii.pVal); - nPrevInputs[i] = *bii.pVal; - } - } - } - } - EncodeBuffer(0xFF); - - if (nReplayExternalDataCount && ReplayExternalData) { - for (INT32 i = 0; i < nReplayExternalDataCount; i++) { - EncodeBuffer(ReplayExternalData[i]); - } - } - - if (bReplayFrameCounterDisplay) { - wchar_t framestring[15]; - swprintf(framestring, L"%d", GetCurrentFrame() - nStartFrame); - VidSNewTinyMsg(framestring); - } - - return 0; -} - -static void CheckRedraw() -{ - if (bRunPause) { - INT32 oldOk = bDrvOkay; // Redraw w/o running a frame. - bDrvOkay = 0; - VidRedraw(); // Redraw screen so status doesn't get clobbered - VidPaint(0); // "" - bDrvOkay = oldOk; - } -} - -static void PrintInputsReset() -{ - nPrintInputsActive[0] = nPrintInputsActive[1] = -(60 * 5); -} - -static inline void PrintInputsSetActive(UINT8 plyrnum) -{ - nPrintInputsActive[plyrnum] = GetCurrentFrame(); -} - -static void PrintInputs() -{ - struct BurnInputInfo bii; - - UINT8 UDLR[2][4]; // P1 & P2 joystick movements - UINT8 BUTTONS[2][8]; // P1 and P2 buttons - UINT8 OFFBUTTONS[2][8]; // P1 and P2 buttons - wchar_t lines[3][64]; - - memset(&lines, 0, sizeof(lines)); - memset(UDLR, 0, sizeof(UDLR)); - memset(BUTTONS, ' ', sizeof(BUTTONS)); - memset(OFFBUTTONS, ' ', sizeof(OFFBUTTONS)); - - for (UINT32 i = 0; i < nGameInpCount; i++) { - memset(&bii, 0, sizeof(bii)); - BurnDrvGetInputInfo(&bii, i); - if (bii.pVal && bii.szInfo && bii.szInfo[0]) { - // Translate X/Y axis to UDLR, TODO: (maybe) support mouse axis/buttons - if ((bii.nType & BIT_GROUP_ANALOG) && bii.pShortVal && *bii.pShortVal) { - if (stricmp(bii.szInfo+2, " x-axis")==0 && bii.nType == BIT_GROUP_ANALOG) { - if (bii.szInfo[1] == '1' || bii.szInfo[1] == '2') { - if ((INT16)*bii.pShortVal > 0x80) - UDLR[(bii.szInfo[1] - '1')][3] = 1; // Right - if ((INT16)*bii.pShortVal < -0x80) - UDLR[(bii.szInfo[1] - '1')][2] = 1; // Left - PrintInputsSetActive(bii.szInfo[1] - '1'); - } - } - if (stricmp(bii.szInfo+2, " y-axis")==0 && bii.nType == BIT_GROUP_ANALOG) { - if (bii.szInfo[1] == '1' || bii.szInfo[1] == '2') { - if ((INT16)*bii.pShortVal > 0x80) - UDLR[(bii.szInfo[1] - '1')][1] = 1; // Down - if ((INT16)*bii.pShortVal < -0x80) - UDLR[(bii.szInfo[1] - '1')][0] = 1; // Up - PrintInputsSetActive(bii.szInfo[1] - '1'); - } - } - } - if (*bii.pVal) { // Button pressed - if (stricmp(bii.szInfo+2, " Up")==0) { - if (bii.szInfo[1] == '1' || bii.szInfo[1] == '2') { - UDLR[(bii.szInfo[1] - '1')][0] = 1; - PrintInputsSetActive(bii.szInfo[1] - '1'); - } - } - if (stricmp(bii.szInfo+2, " Down")==0) { - if (bii.szInfo[1] == '1' || bii.szInfo[1] == '2') { - UDLR[(bii.szInfo[1] - '1')][1] = 1; - PrintInputsSetActive(bii.szInfo[1] - '1'); - } - } - if (stricmp(bii.szInfo+2, " Left")==0) { - if (bii.szInfo[1] == '1' || bii.szInfo[1] == '2') { - UDLR[(bii.szInfo[1] - '1')][2] = 1; - PrintInputsSetActive(bii.szInfo[1] - '1'); - } - } - if (stricmp(bii.szInfo+2, " Right")==0) { - if (bii.szInfo[1] == '1' || bii.szInfo[1] == '2') { - UDLR[(bii.szInfo[1] - '1')][3] = 1; - PrintInputsSetActive(bii.szInfo[1] - '1'); - } - } - if (strnicmp(bii.szInfo+2, " fire ", 6)==0) { - if (bii.szInfo[1] == '1' || bii.szInfo[1] == '2') { - if (bii.szInfo[8] - '1' < 6) { // avoid overflow - BUTTONS[(bii.szInfo[1] - '1')][bii.szInfo[8] - '1'] = bii.szInfo[8]; - PrintInputsSetActive(bii.szInfo[1] - '1'); - } - } - } - } else { // get "off" buttons - if (strnicmp(bii.szInfo+2, " fire ", 6)==0) { - if (bii.szInfo[1] == '1' || bii.szInfo[1] == '2') { - if (bii.szInfo[8] - '1' < 6) // avoid overflow - OFFBUTTONS[(bii.szInfo[1] - '1')][bii.szInfo[8] - '1'] = bii.szInfo[8]; - } - } - } - } - } - - VidSNewJoystickMsg(NULL); // Clear surface. - // Draw shadows - if (GetCurrentFrame() < nPrintInputsActive[0] + (60*5)) { - swprintf(lines[0], L" ^ %c%c ", OFFBUTTONS[0][0], OFFBUTTONS[0][1]); - swprintf(lines[1], L" < > %c%c ", OFFBUTTONS[0][2], OFFBUTTONS[0][3]); - swprintf(lines[2], L" v %c%c ", OFFBUTTONS[0][4], OFFBUTTONS[0][5]); - VidSNewJoystickMsg(lines[0], 0x404040, 20, 0); - VidSNewJoystickMsg(lines[1], 0x404040, 20, 1); - VidSNewJoystickMsg(lines[2], 0x404040, 20, 2); - } - - if (GetCurrentFrame() < nPrintInputsActive[1] + (60*5)) { // time out np2active after 200 frames or so... - swprintf(lines[0], L" ^ %c%c ", OFFBUTTONS[1][0], OFFBUTTONS[1][1]); - swprintf(lines[1], L" < > %c%c ", OFFBUTTONS[1][2], OFFBUTTONS[1][3]); - swprintf(lines[2], L" v %c%c ", OFFBUTTONS[1][4], OFFBUTTONS[1][5]); - VidSNewJoystickMsg(lines[0], 0x404040, 20, 0); - VidSNewJoystickMsg(lines[1], 0x404040, 20, 1); - VidSNewJoystickMsg(lines[2], 0x404040, 20, 2); - } - - // Draw active buttons - INT32 nLen = 0; - for (INT32 i = 0; i < 2; i++) { - if (i == 1) nLen = _tcslen(lines[0]); // Create the textual mini-joystick icons - swprintf(lines[0] + nLen, L" %c %c%c ", UDLR[i][0] ? '^' : ' ', BUTTONS[i][0], BUTTONS[i][1]); - swprintf(lines[1] + nLen, L" %c %c %c%c ", UDLR[i][2] ? '<' : ' ', UDLR[i][3] ? '>' : ' ', BUTTONS[i][2], BUTTONS[i][3]); - swprintf(lines[2] + nLen, L" %c %c%c ", UDLR[i][1] ? 'v' : ' ', BUTTONS[i][4], BUTTONS[i][5]); - } - VidSNewJoystickMsg(lines[0], 0xffffff, 20, 0); // Draw them - VidSNewJoystickMsg(lines[1], 0xffffff, 20, 1); - VidSNewJoystickMsg(lines[2], 0xffffff, 20, 2); -} - -INT32 ReplayInput() -{ - UINT8 n; - struct BurnInputInfo bii; - memset(&bii, 0, sizeof(bii)); - - // Just to be safe, restore the inputs to the known correct settings - for (UINT32 i = 0; i < nGameInpCount; i++) { - BurnDrvGetInputInfo(&bii, i); - if (bii.pVal) { - if (bii.nType & BIT_GROUP_ANALOG) { - *bii.pShortVal = nPrevInputs[i]; - } else { - *bii.pVal = nPrevInputs[i]; - } - } - } - - // Now read all inputs that need to change from the .fr file - while ((n = DecodeBuffer()) != 0xFF) { - BurnDrvGetInputInfo(&bii, n); - if (bii.pVal) { - if (bii.nType & BIT_GROUP_ANALOG) { - *bii.pShortVal = nPrevInputs[n] = (DecodeBuffer() << 8) | DecodeBuffer(); - } else { - *bii.pVal = nPrevInputs[n] = DecodeBuffer(); - } - } else { - DecodeBuffer(); - } - } - - if (nReplayExternalDataCount && ReplayExternalData) { - for (INT32 i = 0; i < nReplayExternalDataCount; i++) { - ReplayExternalData[i] = DecodeBuffer(); - } - } - - if (bReplayFrameCounterDisplay) { - wchar_t framestring[32]; - swprintf(framestring, L"%d / %d", GetCurrentFrame() - nStartFrame,nTotalFrames); - VidSNewTinyMsg(framestring); - } - - if (bReplayShowMovement) { - PrintInputs(); - } - -#if 0 - if ( (GetCurrentFrame()-nStartFrame) == (nTotalFrames-1) ) { - //bRunPause = 1; // not needed, but reenable if problems -dink. - } -#endif - - if (end_of_buffer) { - StopReplay(); - return 1; - } else { - return 0; - } -} - -static void MakeOfn(TCHAR* pszFilter) -{ - _stprintf(pszFilter, FBALoadStringEx(hAppInst, IDS_DISK_FILE_REPLAY, true), _T(APP_TITLE)); - memcpy(pszFilter + _tcslen(pszFilter), _T(" (*.fr)\0*.fr\0\0"), 14 * sizeof(TCHAR)); - - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hScrnWnd; - ofn.lpstrFilter = pszFilter; - ofn.lpstrFile = szChoice; - ofn.nMaxFile = sizeof(szChoice) / sizeof(TCHAR); - ofn.lpstrInitialDir = _T(".\\recordings"); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("fr"); - - return; -} - -INT32 StartRecord() -{ - INT32 nRet; - INT32 bOldPause; - - fp = NULL; - movieFlags = 0; - - bOldPause = bRunPause; - bRunPause = 1; - nRet = RecordDialog(); - bRunPause = bOldPause; - - if (nRet == 0) { - return 1; - } - - bReplayReadOnly = false; - bReplayShowMovement = false; - - if (bStartFromReset) { - if(!StartFromReset(NULL)) return 1; - movieFlags |= MOVIE_FLAG_FROM_POWERON; - } - { - const char szFileHeader[] = "FB1 "; // File identifier - fp = _tfopen(szChoice, _T("w+b")); - _tcscpy(szCurrentMovieFilename, szChoice); - - nRet = 0; - if (fp == NULL) { - nRet = 1; - } else { - fwrite(&szFileHeader, 1, 4, fp); - fwrite(&movieFlags, 1, 4, fp); - if (bStartFromReset) - nRet = 1; - else - nRet = BurnStateSaveEmbed(fp, -1, 1); - if (nRet >= 0) { - const char szChunkHeader[] = "FR1 "; // Chunk identifier - INT32 nZero = 0; - - fwrite(&szChunkHeader, 1, 4, fp); // Write chunk identifier - - nSizeOffset = ftell(fp); - - fwrite(&nZero, 1, 4, fp); // reserve space for chunk size - - fwrite(&nZero, 1, 4, fp); // reserve space for number of frames - - fwrite(&nZero, 1, 4, fp); // undo count - fwrite(&nZero, 1, 4, fp); // reserved - fwrite(&nZero, 1, 4, fp); // - - nRet = EmbedCompressedFile(fp, -1); - } - } - } - - if (nRet) { - if (fp) { - fclose(fp); - fp = NULL; - } - - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_CREATE)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_REPLAY)); - FBAPopupDisplay(PUF_TYPE_ERROR); - return 1; - } else { - struct BurnInputInfo bii; - memset(&bii, 0, sizeof(bii)); - - nReplayStatus = 1; // Set record status - CheckRedraw(); - MenuEnableItems(); - - nStartFrame = GetCurrentFrame(); - nReplayUndoCount = 0; - - // Create a baseline so we can just record the deltas afterwards - for (UINT32 i = 0; i < nGameInpCount; i++) { - BurnDrvGetInputInfo(&bii, i); - if (bii.pVal) { - if (bii.nType & BIT_GROUP_ANALOG) { - EncodeBuffer(*bii.pShortVal >> 8); - EncodeBuffer(*bii.pShortVal & 0xFF); - nPrevInputs[i] = *bii.pShortVal; - } else { - EncodeBuffer(*bii.pVal); - nPrevInputs[i] = *bii.pVal; - } - } else { - EncodeBuffer(0); - } - } - -#ifdef FBA_DEBUG - dprintf(_T("*** Recording of file %s started.\n"), szChoice); -#endif - - return 0; - } -} - -INT32 StartReplay(const TCHAR* szFileName) // const char* szFileName = NULL -{ - INT32 nRet; - INT32 bOldPause; - - PrintInputsReset(); - - fp = NULL; - - if (szFileName) { - _tcscpy(szChoice, szFileName); - if (!bReplayDontClose) { - // if bStartFromReset, get file "wszStartupGame" from metadata!! - DisplayReplayProperties(0, false); - } - } else { - bOldPause = bRunPause; - bRunPause = 1; - nRet = ReplayDialog(); - bRunPause = bOldPause; - - if (nRet == 0) { - return 1; - } - - } - _tcscpy(szCurrentMovieFilename, szChoice); - - // init metadata - wszMetadata[0] = L'\0'; - { - const char szFileHeader[] = "FB1 "; // File identifier - char ReadHeader[] = " "; - fp = _tfopen(szChoice, _T("r+b")); - if (!fp) return 1; - memset(ReadHeader, 0, 4); - fread(ReadHeader, 1, 4, fp); // Read identifier - if (memcmp(ReadHeader, szFileHeader, 4)) { // Not the right file type - fclose(fp); - fp = NULL; - nRet = 2; - } else { - memset(ReadHeader, 0, 4); - fread(&movieFlags, 1, 4, fp); // Read movie flags - if (movieFlags&MOVIE_FLAG_FROM_POWERON) { // Starts from reset - bStartFromReset = 1; - if (!bReplayDontClose) - if(!StartFromReset(wszStartupGame)) return 0; - nRet = 0; - } - else {// Load the savestate associated with the recording - bStartFromReset = 0; - nRet = BurnStateLoadEmbed(fp, -1, 1, &DrvInitCallback); - } - if (nRet == 0) { - const char szChunkHeader[] = "FR1 "; // Chunk identifier - fread(ReadHeader, 1, 4, fp); // Read identifier - if (memcmp(ReadHeader, szChunkHeader, 4)) { // Not the right file type - fclose(fp); - fp = NULL; - nRet = 2; - } else { - INT32 nChunkSize = 0; - // Open the recording itself - nSizeOffset = ftell(fp); // Save chunk size offset in case the file is re-recorded - fread(&nChunkSize, 1, 0x04, fp); // Read chunk size - INT32 nChunkPosition = ftell(fp); // For seeking to the metadata - fread(&nEndFrame, 1, 4, fp); // Read framecount - nTotalFrames = nEndFrame; - - nStartFrame = GetCurrentFrame(); - bReplayDontClose = 0; // we don't need it anymore from this point - nEndFrame += nStartFrame; - fread(&nReplayUndoCount, 1, 4, fp); - fseek(fp, 0x08, SEEK_CUR); // Skip rest of header - INT32 nEmbedPosition = ftell(fp); - - // Read metadata - const char szMetadataHeader[] = "FRM1"; - fseek(fp, nChunkPosition + nChunkSize, SEEK_SET); - memset(ReadHeader, 0, 4); - fread(ReadHeader, 1, 4, fp); - if(memcmp(ReadHeader, szMetadataHeader, 4) == 0) { - INT32 nMetaSize; - fread(&nMetaSize, 1, 4, fp); - INT32 nMetaLen = nMetaSize >> 1; - if(nMetaLen >= MAX_METADATA) { - nMetaLen = MAX_METADATA-1; - } - INT32 i; - for(i=0; i 0) { - fseek(fp, nMetadataOffset, SEEK_SET); - const char szChunkHeader[] = "FRM1"; - fwrite(szChunkHeader, 1, 4, fp); - INT32 nMetaSize = nMetaLen * 2; - fwrite(&nMetaSize, 1, 4, fp); - UINT8* metabuf = (UINT8*)malloc(nMetaSize); - INT32 i; - for(i=0; i> 8) & 0xff; - } - fwrite(metabuf, 1, nMetaSize, fp); - free(metabuf); - } - - fclose(fp); - fp = NULL; - if (bReplayDontClose) { - if(!StartReplay(szCurrentMovieFilename)) return; - } -} - -static void CloseReplay() -{ - CloseCompressedFile(); - - if(fp) { - fclose(fp); - fp = NULL; - } -} - -void StopReplay() -{ - if (nReplayStatus) { - if (nReplayStatus == 1) { - -#ifdef FBA_DEBUG - dprintf(_T(" ** Recording stopped, recorded %d frames.\n"), GetCurrentFrame() - nStartFrame); -#endif - CloseRecord(); -#ifdef FBA_DEBUG - PrintResult(); -#endif - } else { -#ifdef FBA_DEBUG - dprintf(_T(" ** Replay stopped, replayed %d frames.\n"), GetCurrentFrame() - nStartFrame); -#endif - - CloseReplay(); - } - nReplayStatus = 0; - CheckRedraw(); - MenuEnableItems(); - } -} - - -//# -//# Input Status Freezing -//# -//############################################################################## - -static inline void Write32(UINT8*& ptr, const unsigned long v) -{ - *ptr++ = (UINT8)(v&0xff); - *ptr++ = (UINT8)((v>>8)&0xff); - *ptr++ = (UINT8)((v>>16)&0xff); - *ptr++ = (UINT8)((v>>24)&0xff); -} - -static inline UINT32 Read32(const UINT8*& ptr) -{ - UINT32 v; - v = (UINT32)(*ptr++); - v |= (UINT32)((*ptr++)<<8); - v |= (UINT32)((*ptr++)<<16); - v |= (UINT32)((*ptr++)<<24); - return v; -} - -static inline void Write16(UINT8*& ptr, const UINT16 v) -{ - *ptr++ = (UINT8)(v&0xff); - *ptr++ = (UINT8)((v>>8)&0xff); -} - -static inline UINT16 Read16(const UINT8*& ptr) -{ - UINT16 v; - v = (UINT16)(*ptr++); - v |= (UINT16)((*ptr++)<<8); - return v; -} - -INT32 FreezeInput(UINT8** buf, INT32* size) -{ - *size = 4 + 2*nGameInpCount; - *buf = (UINT8*)malloc(*size); - if(!*buf) - { - return -1; - } - - UINT8* ptr=*buf; - Write32(ptr, nGameInpCount); - - for (UINT32 i = 0; i < nGameInpCount; i++) - { - Write16(ptr, nPrevInputs[i]); - } - - return 0; -} - -INT32 UnfreezeInput(const UINT8* buf, INT32 size) -{ - UINT32 n=Read32(buf); - if(n>0x100 || (unsigned)size < (4 + 2*n)) - { - return -1; - } - - for (UINT32 i = 0; i < n; i++) - { - nPrevInputs[i]=Read16(buf); - } - - return 0; -} - -//------------------------------------------------------ - -static void GetRecordingPath(wchar_t* szPath) -{ - wchar_t szDrive[MAX_PATH]; - wchar_t szDirectory[MAX_PATH]; - wchar_t szFilename[MAX_PATH]; - wchar_t szExt[MAX_PATH]; - szDrive[0] = '\0'; - szDirectory[0] = '\0'; - szFilename[0] = '\0'; - szExt[0] = '\0'; - _wsplitpath(szPath, szDrive, szDirectory, szFilename, szExt); - if (szDrive[0] == '\0' && szDirectory[0] == '\0') { - wchar_t szTmpPath[MAX_PATH]; - wcscpy(szTmpPath, L"recordings\\"); - wcsncpy(szTmpPath + wcslen(szTmpPath), szPath, MAX_PATH - wcslen(szTmpPath)); - szTmpPath[MAX_PATH-1] = '\0'; - wcscpy(szPath, szTmpPath); - } -} - -static void DisplayPropertiesError(HWND hDlg, INT32 nErrType) -{ - if (hDlg != 0) { - switch (nErrType) { - case 0: - SetDlgItemTextW(hDlg, IDC_METADATA, _T("ERROR: Not a FBAlpha input recording file.\0")); - break; - case 1: - SetDlgItemTextW(hDlg, IDC_METADATA, _T("ERROR: Incompatible file-type. Try playback with an earlier version of FBAlpha.\0")); - break; - case 2: - SetDlgItemTextW(hDlg, IDC_METADATA, _T("ERROR: Recording is corrupt :(\0")); - break; - } - } -} - -void DisplayReplayProperties(HWND hDlg, bool bClear) -{ - if (hDlg != 0) { - // save status of read only checkbox - static bool bReadOnlyStatus = true; - if (IsWindowEnabled(GetDlgItem(hDlg, IDC_READONLY))) { - bReadOnlyStatus = (BST_CHECKED == SendDlgItemMessage(hDlg, IDC_READONLY, BM_GETCHECK, 0, 0)); - } - - //bReplayShowMovement = false; - if (IsWindowEnabled(GetDlgItem(hDlg, IDC_SHOWMOVEMENT))) { - if (BST_CHECKED == SendDlgItemMessage(hDlg, IDC_SHOWMOVEMENT, BM_GETCHECK, 0, 0)) { - bReplayShowMovement = true; - } - } - - bReplayReadOnly = bReadOnlyStatus; - - // set default values - SetDlgItemTextA(hDlg, IDC_LENGTH, ""); - SetDlgItemTextA(hDlg, IDC_FRAMES, ""); - SetDlgItemTextA(hDlg, IDC_UNDO, ""); - SetDlgItemTextA(hDlg, IDC_METADATA, ""); - SetDlgItemTextA(hDlg, IDC_REPLAYRESET, ""); - EnableWindow(GetDlgItem(hDlg, IDC_READONLY), FALSE); - SendDlgItemMessage(hDlg, IDC_READONLY, BM_SETCHECK, BST_UNCHECKED, 0); - - EnableWindow(GetDlgItem(hDlg, IDC_SHOWMOVEMENT), FALSE); - SendDlgItemMessage(hDlg, IDC_SHOWMOVEMENT, BM_SETCHECK, BST_UNCHECKED, 0); - - EnableWindow(GetDlgItem(hDlg, IDOK), FALSE); - - if(bClear) { - return; - } - - long lCount = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETCOUNT, 0, 0); - long lIndex = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETCURSEL, 0, 0); - if (lIndex == CB_ERR) { - return; - } - - if (lIndex == lCount - 1) { // Last item is "Browse..." - EnableWindow(GetDlgItem(hDlg, IDOK), TRUE); // Browse is selectable - return; - } - - long lStringLength = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETLBTEXTLEN, (WPARAM)lIndex, 0); - if(lStringLength + 1 > MAX_PATH) { - return; - } - - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETLBTEXT, (WPARAM)lIndex, (LPARAM)szChoice); - - // check relative path - GetRecordingPath(szChoice); - } - - const char szFileHeader[] = "FB1 "; // File identifier - const char szSavestateHeader[] = "FS1 "; // Chunk identifier - const char szRecordingHeader[] = "FR1 "; // Chunk identifier - const char szMetadataHeader[] = "FRM1"; // Chunk identifier - char ReadHeader[4]; - INT32 nChunkSize = 0; - INT32 nChunkDataPosition = 0; - INT32 nFileVer = 0; - INT32 nFileMin = 0; - INT32 t1 = 0, t2 = 0; - INT32 nFrames = 0; - INT32 nUndoCount = 0; - wchar_t* local_metadata = NULL; - - memset(&wszStartupGame, 0, sizeof(wszStartupGame)); - memset(&wszAuthorInfo, 0, sizeof(wszAuthorInfo)); - - FILE* fd = _wfopen(szChoice, L"r+b"); - if (!fd) { - return; - } - - if (hDlg != 0) { - if (_waccess(szChoice, W_OK)) { - SendDlgItemMessage(hDlg, IDC_READONLY, BM_SETCHECK, BST_CHECKED, 0); - } else { - EnableWindow(GetDlgItem(hDlg, IDC_READONLY), TRUE); - SendDlgItemMessage(hDlg, IDC_READONLY, BM_SETCHECK, (bReplayReadOnly) ? BST_CHECKED : BST_UNCHECKED, 0); //read-only by default - } - - EnableWindow(GetDlgItem(hDlg, IDC_SHOWMOVEMENT), TRUE); - SendDlgItemMessage(hDlg, IDC_SHOWMOVEMENT, BM_SETCHECK, (bReplayShowMovement) ? BST_CHECKED : BST_UNCHECKED, 0); - } - - memset(ReadHeader, 0, 4); - fread(ReadHeader, 1, 4, fd); // Read identifier - if (memcmp(ReadHeader, szFileHeader, 4)) { // Not the right file type - fclose(fd); - DisplayPropertiesError(hDlg, 0 /* not our file */); - return; - } - - fread(&movieFlags, 1, 4, fd); // Read identifier - - bStartFromReset = (movieFlags&MOVIE_FLAG_FROM_POWERON) ? 1 : 0; // Starts from reset - - if (!bStartFromReset) { - memset(ReadHeader, 0, 4); - fread(ReadHeader, 1, 4, fd); // Read identifier - if (memcmp(ReadHeader, szSavestateHeader, 4)) { // Not the chunk type - fclose(fd); - DisplayPropertiesError(hDlg, 1 /* most likely recorded w/ an earlier version */); - return; - } - - fread(&nChunkSize, 1, 4, fd); - if (nChunkSize <= 0x40) { // Not big enough - fclose(fd); - DisplayPropertiesError(hDlg, 2 /* corrupt. */); - return; - } - - nChunkDataPosition = ftell(fd); - - fread(&nFileVer, 1, 4, fd); // Version of FB that this file was saved from - - fread(&t1, 1, 4, fd); // Min version of FB that NV data will work with - fread(&t2, 1, 4, fd); // Min version of FB that All data will work with - - nFileMin = t2; // Replays require a full state - -// if (nBurnVer < nFileMin) { // Error - emulator is too old to load this state -// fclose(fd); -// return; -// } - - fseek(fd, nChunkDataPosition + nChunkSize, SEEK_SET); - } - - memset(ReadHeader, 0, 4); - fread(ReadHeader, 1, 4, fd); // Read identifier - if (memcmp(ReadHeader, szRecordingHeader, 4)) { // Not the chunk type - fclose(fd); - DisplayPropertiesError(hDlg, 1 /* most likely recorded w/ an earlier version */); - return; - } - - nChunkSize = 0; - fread(&nChunkSize, 1, 4, fd); - if (nChunkSize <= 0x10) { // Not big enough - fclose(fd); - DisplayPropertiesError(hDlg, 2 /* corrupt. */); - return; - } - - nChunkDataPosition = ftell(fd); - fread(&nFrames, 1, 4, fd); - fread(&nUndoCount, 1, 4, fd); - - // read metadata - fseek(fd, nChunkDataPosition + nChunkSize, SEEK_SET); - memset(ReadHeader, 0, 4); - fread(ReadHeader, 1, 4, fd); // Read identifier - if (memcmp(ReadHeader, szMetadataHeader, 4) == 0) { - nChunkSize = 0; - fread(&nChunkSize, 1, 4, fd); - INT32 nMetaLen = nChunkSize >> 1; - if(nMetaLen >= MAX_METADATA) { - nMetaLen = MAX_METADATA-1; - } - - local_metadata = (wchar_t*)malloc((nMetaLen+1)*sizeof(wchar_t)); - memset(local_metadata, 0, (nMetaLen+1)*sizeof(wchar_t)); - - INT32 i; - for(i=0; i>1)) / nBurnFPS; - INT32 nMinutes = nSeconds / 60; - INT32 nHours = nSeconds / 3600; - - // write strings to dialog - char szFramesString[32]; - char szLengthString[32]; - char szUndoCountString[32]; - char szRecordedFrom[32]; - - sprintf(szFramesString, "%d", nFrames); - sprintf(szLengthString, "%02d:%02d:%02d", nHours, nMinutes % 60, nSeconds % 60); - sprintf(szUndoCountString, "%d", nUndoCount); - sprintf(szRecordedFrom, "v%x.%x.%x.%02x, %s", nBurnVer >> 20, (nBurnVer >> 16) & 0x0F, (nBurnVer >> 8) & 0xFF, nBurnVer & 0xFF, (bStartFromReset) ? "Power-On" : "Savestate"); - - SetDlgItemTextA(hDlg, IDC_LENGTH, szLengthString); - SetDlgItemTextA(hDlg, IDC_FRAMES, szFramesString); - SetDlgItemTextA(hDlg, IDC_UNDO, szUndoCountString); - SetDlgItemTextW(hDlg, IDC_METADATA, wszAuthorInfo); - SetDlgItemTextA(hDlg, IDC_REPLAYRESET, szRecordedFrom); - } -} - -static BOOL CALLBACK ReplayDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) -{ - if (Msg == WM_INITDIALOG) { - wchar_t szFindPath[MAX_PATH] = L"recordings\\*.fr"; - WIN32_FIND_DATA wfd; - HANDLE hFind; - INT32 i = 0; - - SendDlgItemMessage(hDlg, IDC_READONLY, BM_SETCHECK, BST_CHECKED, 0); - - memset(&wfd, 0, sizeof(WIN32_FIND_DATA)); - if (bDrvOkay) { - _stprintf(szFindPath, _T("recordings\\%s*.fr"), BurnDrvGetText(DRV_NAME)); - } - - hFind = FindFirstFile(szFindPath, &wfd); - if (hFind != INVALID_HANDLE_VALUE) { - do { - if(!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_INSERTSTRING, i++, (LPARAM)wfd.cFileName); - } while(FindNextFile(hFind, &wfd)); - FindClose(hFind); - } - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_INSERTSTRING, i, (LPARAM)_T("Browse...")); - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_SETCURSEL, i, 0); - - if (i>=1) { - DisplayReplayProperties(hDlg, false); - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_SETCURSEL, i, 0); - } - - SetFocus(GetDlgItem(hDlg, IDC_CHOOSE_LIST)); - return FALSE; - } - - if (Msg == WM_COMMAND) { - if (HIWORD(wParam) == CBN_SELCHANGE) { - LONG lCount = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETCOUNT, 0, 0); - LONG lIndex = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETCURSEL, 0, 0); - if (lIndex != CB_ERR) { - DisplayReplayProperties(hDlg, (lIndex == lCount - 1)); // Selecting "Browse..." will clear the replay properties display - } - } else if (HIWORD(wParam) == CBN_CLOSEUP) { - LONG lCount = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETCOUNT, 0, 0); - LONG lIndex = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETCURSEL, 0, 0); - if (lIndex != CB_ERR) { - if (lIndex == lCount - 1) { - // send an OK notification to open the file browser - SendMessage(hDlg, WM_COMMAND, (WPARAM)IDOK, 0); - } - } - } else { - INT32 wID = LOWORD(wParam); - switch (wID) { - case IDOK: - { - LONG lCount = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETCOUNT, 0, 0); - LONG lIndex = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETCURSEL, 0, 0); - if (lIndex != CB_ERR) { - if (lIndex == lCount - 1) { - MakeOfn(szFilter); - ofn.lpstrTitle = FBALoadStringEx(hAppInst, IDS_REPLAY_REPLAY, true); - //ofn.Flags &= ~OFN_HIDEREADONLY; - - INT32 nRet = GetOpenFileName(&ofn); // Browse... - if (nRet != 0) { - LONG lOtherIndex = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_FINDSTRING, (WPARAM)-1, (LPARAM)szChoice); - if (lOtherIndex != CB_ERR) { - // select already existing string - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_SETCURSEL, lOtherIndex, 0); - } else { - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_INSERTSTRING, lIndex, (LPARAM)szChoice); - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_SETCURSEL, lIndex, 0); - } - // restore focus to the dialog - SetFocus(GetDlgItem(hDlg, IDC_CHOOSE_LIST)); - DisplayReplayProperties(hDlg, false); - if (ofn.Flags & OFN_READONLY || bReplayReadOnly) { - SendDlgItemMessage(hDlg, IDC_READONLY, BM_SETCHECK, BST_CHECKED, 0); - } else { - SendDlgItemMessage(hDlg, IDC_READONLY, BM_SETCHECK, BST_UNCHECKED, 0); - } - } - } else { - // get readonly status - bReplayReadOnly = false; - if (BST_CHECKED == SendDlgItemMessage(hDlg, IDC_READONLY, BM_GETCHECK, 0, 0)) { - bReplayReadOnly = true; - } - - // get show movements status - bReplayShowMovement = false; - if (BST_CHECKED == SendDlgItemMessage(hDlg, IDC_SHOWMOVEMENT, BM_GETCHECK, 0, 0)) { - bReplayShowMovement = true; - } - - EndDialog(hDlg, 1); // only allow OK if a valid selection was made - } - } - } - return TRUE; - case IDCANCEL: - szChoice[0] = '\0'; - EndDialog(hDlg, 0); - return FALSE; - } - } - } - - return FALSE; -} - -static INT32 ReplayDialog() -{ - return FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_REPLAYINP), hScrnWnd, (DLGPROC)ReplayDialogProc); -} - -static INT32 VerifyRecordingAccessMode(wchar_t* szFilename, INT32 mode) -{ - GetRecordingPath(szFilename); - if(_waccess(szFilename, mode)) { - return 0; // not writeable, return failure - } - - return 1; -} - -static void VerifyRecordingFilename(HWND hDlg) -{ - wchar_t szFilename[MAX_PATH]; - GetDlgItemText(hDlg, IDC_FILENAME, szFilename, MAX_PATH); - - // if filename null, or, file exists and is not writeable - // then disable the dialog controls - if(szFilename[0] == '\0' || - (VerifyRecordingAccessMode(szFilename, 0) != 0 && VerifyRecordingAccessMode(szFilename, W_OK) == 0)) { - EnableWindow(GetDlgItem(hDlg, IDOK), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_METADATA), FALSE); - } else { - EnableWindow(GetDlgItem(hDlg, IDOK), TRUE); - EnableWindow(GetDlgItem(hDlg, IDC_METADATA), TRUE); - } -} - -static BOOL CALLBACK RecordDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) -{ - wchar_t szAuthInfo[MAX_METADATA]; - - if (Msg == WM_INITDIALOG) { - // come up with a unique name - wchar_t szPath[MAX_PATH]; - wchar_t szFilename[MAX_PATH]; - - INT32 i = 0; - _stprintf(szFilename, _T("%s.fr"), BurnDrvGetText(DRV_NAME)); - wcscpy(szPath, szFilename); - while(VerifyRecordingAccessMode(szPath, 0) == 1) { - _stprintf(szFilename, _T("%s-%d.fr"), BurnDrvGetText(DRV_NAME), ++i); - wcscpy(szPath, szFilename); - } - - SetDlgItemText(hDlg, IDC_FILENAME, szFilename); - SetDlgItemTextW(hDlg, IDC_METADATA, L""); - CheckDlgButton(hDlg, IDC_REPLAYRESET, BST_UNCHECKED); - - VerifyRecordingFilename(hDlg); - - SetFocus(GetDlgItem(hDlg, IDC_METADATA)); - return FALSE; - } - - if (Msg == WM_COMMAND) { - if (HIWORD(wParam) == EN_CHANGE) { - VerifyRecordingFilename(hDlg); - } else { - INT32 wID = LOWORD(wParam); - switch (wID) { - case IDC_BROWSE: - { - _stprintf(szChoice, _T("%s"), BurnDrvGetText(DRV_NAME)); - MakeOfn(szFilter); - ofn.lpstrTitle = FBALoadStringEx(hAppInst, IDS_REPLAY_RECORD, true); - ofn.Flags |= OFN_OVERWRITEPROMPT; - INT32 nRet = GetSaveFileName(&ofn); - if (nRet != 0) { - // this should trigger an EN_CHANGE message - SetDlgItemText(hDlg, IDC_FILENAME, szChoice); - } - } - return TRUE; - case IDOK: - GetDlgItemText(hDlg, IDC_FILENAME, szChoice, MAX_PATH); - GetDlgItemTextW(hDlg, IDC_METADATA, szAuthInfo, MAX_METADATA-64-1); - bStartFromReset = false; - if (BST_CHECKED == SendDlgItemMessage(hDlg, IDC_REPLAYRESET, BM_GETCHECK, 0, 0)) { - bStartFromReset = true; - // add "romset," to beginning of metadata - _stprintf(wszMetadata, _T("%s,%s"), BurnDrvGetText(DRV_NAME), szAuthInfo); - } else { - _tcscpy(wszMetadata, szAuthInfo); - } - wszMetadata[MAX_METADATA-1] = L'\0'; - - // ensure a relative path has the "recordings\" path in prepended to it - GetRecordingPath(szChoice); - EndDialog(hDlg, 1); - return TRUE; - case IDCANCEL: - szChoice[0] = '\0'; - EndDialog(hDlg, 0); - return FALSE; - } - } - } - - return FALSE; -} - -static INT32 RecordDialog() -{ - return FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_RECORDINP), hScrnWnd, (DLGPROC)RecordDialogProc); -} diff --git a/jan/src/burner/win32/res.cpp b/jan/src/burner/win32/res.cpp deleted file mode 100644 index 84e4877e8..000000000 --- a/jan/src/burner/win32/res.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include "burner.h" - -#define HORIZONTAL_ORIENTED_RES 0 -#define VERTICAL_ORIENTED_RES 1 -int nOrientation; - -static INT_PTR CALLBACK ResProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) // LPARAM lParam -{ - static bool bOK; - - switch (Msg) { - case WM_INITDIALOG: { - DEVMODE devMode; - devMode.dmSize = sizeof(DEVMODE); - devMode.dmDriverExtra = 0; - - // Run through all possible screenmodes and fill the combobox - for (int i = 0; EnumDisplaySettings(NULL, i, &devMode); i++) { - - // We're only interested in 16, 24, or 32 bit modes. - if (devMode.dmBitsPerPel & 0x30) { - long nItem = 0, nItemValue; - long nNewRes = (devMode.dmPelsWidth << 16) | devMode.dmPelsHeight; - - // See if the resolution is already in the combobox - do { - nItemValue = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETITEMDATA, nItem, 0); - nItem++; - } while ((nItemValue != CB_ERR) && (nItemValue != nNewRes)); - - // If not, add it - if (nItemValue == CB_ERR) { - TCHAR szTemp[32]; - _stprintf(szTemp, _T(" %li x %li"), devMode.dmPelsWidth, devMode.dmPelsHeight); - nItem = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_ADDSTRING, 0, (LPARAM)&szTemp); - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_SETITEMDATA, nItem, nNewRes); - } - } - } - - SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_SETCURSEL, 0, 0); - - bOK = 0; - WndInMid(hDlg, hScrnWnd); - - return TRUE; - } - case WM_COMMAND: - if (LOWORD(wParam) == IDOK) { - bOK = 1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDCANCEL) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - - case WM_CLOSE: { - - if (bOK) { - long nItem = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETCURSEL, 0, 0); - long nItemValue = SendDlgItemMessage(hDlg, IDC_CHOOSE_LIST, CB_GETITEMDATA, nItem, 0); - - if(nOrientation == HORIZONTAL_ORIENTED_RES) { - nVidHorWidth = nItemValue >> 16; - nVidHorHeight = nItemValue & 0xFFFF; - } - if(nOrientation == VERTICAL_ORIENTED_RES) { - nVidVerWidth = nItemValue >> 16; - nVidVerHeight = nItemValue & 0xFFFF; - } - if(bDrvOkay) { - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - nVidWidth = nVidVerWidth; - nVidHeight = nVidVerHeight; - } else { - nVidWidth = nVidHorWidth; - nVidHeight = nVidHorHeight; - } - } - } - - EndDialog(hDlg, 0); - } - } - - return 0; -} - - -int ResCreate(int nResOrientation) -{ - nOrientation = nResOrientation; - - FBADialogBox(hAppInst,MAKEINTRESOURCE(IDD_CHOOSERES),hScrnWnd,(DLGPROC)ResProc); - return 0; -} - diff --git a/jan/src/burner/win32/resource.h b/jan/src/burner/win32/resource.h deleted file mode 100644 index a6dda8918..000000000 --- a/jan/src/burner/win32/resource.h +++ /dev/null @@ -1,853 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by app.rc -// - -#define IDS_STRING 200 - -#define BMP_SPLASH 1 -#define BMP_ABOUT 2 -#define BMP_MISC 3 - -#define IDI_APP 10 -#define IDI_TV_PLUS 11 -#define IDI_TV_MINUS 12 -#define IDI_TV_NOTWORKING 13 -#define IDI_TV_NOTFOUND_ESS 14 -#define IDI_TV_NOTFOUND_NON 15 - -#define IDD_SPLASH 50 -#define IDD_INPD 51 -#define IDD_INPS 52 -#define IDD_INPCHEAT 53 -#define IDD_INPC 54 -#define IDD_INPDIP 55 -#define IDD_WAIT 56 -#define IDD_ABOUT 57 -#define IDD_FIRST 58 -#define IDD_VALUE 59 -#define IDD_ROMSDIR 60 -#define IDD_SELNEW 61 -#define IDD_CAPTURE 62 -#define IDD_GAMMA 63 -#define IDD_CHOOSERES 64 -#define IDD_SCANLINE 65 -#define IDD_PHOSPHOR 66 -#define IDD_SCREENANGLE 67 -#define IDD_CPUCLOCK 68 -#define IDD_SYSINFO 69 -#define IDD_EXCEPTION 70 -#define IDD_DEBUG_LRG 71 -#define IDD_DEBUG_SML 72 -#define IDD_POPUP 73 -#define IDD_SUPPORTDIR 74 -#define IDD_PALETTEVIEWER 75 -#define IDD_IPS_MANAGER 77 -#define IDD_MVS_SELECT_CARTS 78 -#define IDD_NCD_DLG 79 -#define IDD_NCD_COVER_DLG 80 -#define IDD_GAMEINFO 81 -#define IDD_DOWNLOAD_LOCAL 82 -#define IDD_CHOOSEMONITOR 83 - -#define IDR_MENU 100 -#define IDR_MENU_BLITTER_1 110 -#define IDR_MENU_BLITTER_2 111 -#define IDR_MENU_BLITTER_3 112 -#define IDR_MENU_BLITTER_4 113 -#define IDR_MENU_BLITTER_5 114 -#define IDR_MENU_AUD_PLUGIN_1 130 -#define IDR_MENU_AUD_PLUGIN_2 131 -#define IDR_MENU_GAMESEL 140 -#define IDR_ACCELERATOR 150 - -#define IDD_REPLAYINP 233 -#define IDD_RECORDINP 234 - -#define MENU_MENU_0 2000 -#define MENU_MENU_1 2001 -#define MENU_MENU_2 2002 -#define MENU_MENU_3 2003 -#define MENU_MENU_4 2004 -#define MENU_MENU_5 2005 - -#define IDC_INPD_LIST 20000 -#define IDC_INPD_NEWMACRO 20001 -#define IDC_INPD_GI 20002 -#define IDC_INPD_PCI 20003 -#define IDC_INPD_ANALOG 20004 -#define IDC_INPD_USE 20005 -#define IDC_INPD_DEFAULT 20006 -#define IDC_INPS_GRABMOUSE 20007 -#define IDC_INPS_CLEARLOCK 20021 -#define IDC_INPS_CONTROL 20008 -#define IDC_INPS_CONTROL_NAME 20009 -#define IDC_INPC_VALUE 20010 -#define IDC_INPS_PUSH 20011 -#define IDC_INPCX1_VALUE 20012 -#define IDC_INPC_RESET 20013 -#define IDC_INPCHEAT_LIST 20014 -#define IDC_WAIT_PROG 20015 -#define IDC_WAIT_LABEL_A 20016 -#define IDC_WAIT_LABEL_B1 20017 -#define IDC_WAIT_LABEL_B2 20018 -#define ID_VALUE_CLOSE 20019 -#define IDC_VALUE_EDIT 20020 - // 20021 is used by IDC_INPS_CLEARLOCK. - -#define IDC_FBA_VER 20050 -#define IDC_SPECIALSTRING 20051 -#define IDC_SHOWLICENSE 20052 -#define IDC_LICENSE 20053 -#define IDC_ACCEPTLICENSE 20054 -#define IDC_CHECKAUTOEXPAND 20055 -#define IDC_SCREENSHOT_H 20056 -#define IDC_SCREENSHOT_V 20057 -#define IDC_SCREENSHOT2_H 20058 -#define IDC_SCREENSHOT2_V 20059 -#define IDC_CHECKAVAILABLE 20060 -#define IDCAPTURE 20061 -#define IDC_ADVANCE 20062 -#define IDC_LABELROMNAME 20063 -#define IDC_LABELROMINFO 20064 -#define IDC_LABELCOMMENT 20065 -#define IDC_LABELGENRE 20066 -#define IDC_LABELSYSTEM 20067 -#define IDC_TEXTROMNAME 20068 -#define IDC_TEXTROMINFO 20069 -#define IDC_TEXTCOMMENT 20070 -#define IDC_TEXTGENRE 20071 -#define IDC_TEXTSYSTEM 20072 -#define IDC_TREE1 20073 -#define IDC_SEL_SHORTNAME 20074 -#define IDC_SEL_ASCIIONLY 20075 -#define IDC_LIST1 20076 -#define IDC_SPRITE1 20077 -#define IDC_SPRITE2 20078 -#define IDC_SPRITE4 20079 -#define IDC_SPRITE3 20080 -#define IDC_SPRITE5 20081 -#define IDC_SPRITE6 20082 -#define IDC_SPRITE7 20083 -#define IDC_SPRITE8 20084 -#define IDC_GAMMA_SLIDER 20085 -#define IDC_GAMMA_EDIT 20086 -#define IDC_CHOOSE_LIST 20087 -#define IDC_SCANLINE_SLIDER 20088 -#define IDC_SCANLINE_EDIT 20089 -#define IDC_PHOSPHOR_1_SLIDER 20090 -#define IDC_PHOSPHOR_1_EDIT 20091 -#define IDC_PHOSPHOR_2_SLIDER 20092 -#define IDC_PHOSPHOR_2_EDIT 20093 -#define IDC_SCREENANGLE_SLIDER 20094 -#define IDC_SCREENANGLE_EDIT 20095 -#define IDC_SCREENCURVATURE_SLIDER 20096 -#define IDC_SCREENCURVATURE_EDIT 20097 -#define IDC_CPUCLOCK_SLIDER 20098 -#define IDC_CPUCLOCK_EDIT 20099 -#define IDC_SYSINFO_CODE 20100 -#define IDC_SYSINFO_EDIT 20101 -#define IDC_SYSINFO_DEBUG 20102 -#define IDC_SYSINFO_SHOW 20103 -#define IDC_SYSINFO_LOG 20104 -#define IDC_DBG_MAINWN1 20105 -#define IDC_DBG_MAINWN1_DRP1 20106 -#define IDC_DBG_MAINWN1_DRP2 20107 -#define IDC_DBG_MAINWN2 20108 -#define IDC_DBG_MAINWN2_DRP1 20109 -#define IDC_DBG_MAINWN2_DRP2 20110 -#define IDC_DBG_INFOWN1 20111 -#define IDC_DBG_INFOWN2 20112 -#define IDC_DBG_COMMAND 20113 -#define IDC_DBG_GO 20114 -#define IDC_DBG_STEP 20115 -#define IDC_DBG_STEPINTO 20116 -#define IDC_DBG_SKIP 20117 -#define IDC_DBG_STEPFRAME 20118 -#define IDC_DBG_SHOT 20119 -#define IDC_MESSAGE_EDIT_ENG 20120 -#define IDC_MESSAGE_EDIT_LOCAL 20121 -#define IDC_MESSAGE_ICON 20122 -#define IDC_MESSAGE_BACK 20123 -#define IDC_LABELNOTES 20124 -#define IDC_TEXTNOTES 20125 -#define IDC_ROMSAVAILABLEINFO 20126 -#define IDC_INPD_SAVE_AS_PRESET 20127 -#define IDC_LIST2 20128 -#define IDC_IPSMAN_LANGUAGE 20129 -#define IDC_IPSMAN_DESELECTALL 20130 -#define IDC_SEL_IPSMANAGER 20131 -#define IDC_SEL_APPLYIPS 20132 -#define IDC_SEL_IPSGROUP 20133 -#define IDC_SEL_SEARCH 20134 -#define IDC_SEL_SEARCHGROUP 20135 -#define IDC_RESOLUTION 20136 -#define IDC_CHECKUNAVAILABLE 20137 -#define IDC_SYSINFO_LOG_SAVE 20138 -#define IDC_LOCAL_DOWNLOAD_LANG 20139 -#define IDC_SEL_SEARCHTIMER 20140 -#define IDC_CHOOSE_MONITOR_HOR 20141 -#define IDC_CHOOSE_MONITOR_HOR_LIST 20142 -#define IDC_CHOOSE_MONITOR_VER 20143 -#define IDC_CHOOSE_MONITOR_VER_LIST 20144 -#define IDC_CHOOSE_MONITOR_TEXT 20145 - -#define IDC_DRVCOUNT 20200 -#define IDC_TREE2 20201 -#define IDC_LAYER1 20202 -#define IDC_LAYER2 20203 -#define IDC_LAYER3 20204 -#define IDC_LAYER4 20205 -#define IDC_SHOW 20206 - -#define IDC_LENGTH 20255 -#define IDC_FRAMES 20256 -#define IDC_UNDO 20257 -#define IDC_METADATA 20258 -#define IDC_READONLY 20259 -#define IDC_FILENAME 20260 -#define IDC_BROWSE 20261 -#define IDC_REPLAYRESET 20262 -#define IDC_SHOWMOVEMENT 20263 - -#define IDC_STATIC_SYS 20300 -#define IDC_STATIC_OPT 20301 -#define IDC_STATIC1 20302 -#define IDC_STATIC2 20303 -#define IDC_STATIC3 20304 -#define IDC_STATIC_INFOBOX 20305 -#define IDC_STATIC_INFOBOX2 20306 -#define IDC_STATIC_INFOBOX3 20307 -#define IDC_STATIC_INFOBOX4 20308 -#define IDC_STATIC_INFOBOX5 20309 -#define IDC_STATIC_INFOBOX6 20310 - -#define IDC_GFX_VIEWER_HORI_1 20400 -#define IDC_GFX_VIEWER_HORI_2 20401 -#define IDC_GFX_VIEWER_HORI_3 20402 -#define IDC_GFX_VIEWER_HORI_4 20403 -#define IDC_GFX_VIEWER_HORI_5 20404 -#define IDC_GFX_VIEWER_HORI_6 20405 -#define IDC_GFX_VIEWER_HORI_7 20406 -#define IDC_GFX_VIEWER_HORI_8 20407 -#define IDC_GFX_VIEWER_HORI_9 20408 -#define IDC_GFX_VIEWER_HORI_10 20409 -#define IDC_GFX_VIEWER_HORI_11 20410 -#define IDC_GFX_VIEWER_HORI_12 20411 -#define IDC_GFX_VIEWER_HORI_13 20412 -#define IDC_GFX_VIEWER_HORI_14 20413 -#define IDC_GFX_VIEWER_HORI_15 20414 -#define IDC_GFX_VIEWER_HORI_16 20415 -#define IDC_GFX_VIEWER_VERT_1 20416 -#define IDC_GFX_VIEWER_VERT_2 20417 -#define IDC_GFX_VIEWER_VERT_3 20418 -#define IDC_GFX_VIEWER_VERT_4 20419 -#define IDC_GFX_VIEWER_VERT_5 20420 -#define IDC_GFX_VIEWER_VERT_6 20421 -#define IDC_GFX_VIEWER_VERT_7 20422 -#define IDC_GFX_VIEWER_VERT_8 20423 -#define IDC_GFX_VIEWER_VERT_9 20424 -#define IDC_GFX_VIEWER_VERT_10 20425 -#define IDC_GFX_VIEWER_VERT_11 20426 -#define IDC_GFX_VIEWER_VERT_12 20427 -#define IDC_GFX_VIEWER_VERT_13 20428 -#define IDC_GFX_VIEWER_VERT_14 20429 -#define IDC_GFX_VIEWER_VERT_15 20430 -#define IDC_GFX_VIEWER_VERT_16 20431 -#define IDC_GFX_VIEWER_PREV 20432 -#define IDC_GFX_VIEWER_NEXT 20433 -#define IDC_GFX_VIEWER_SEL_COL 20434 - -#define IDC_TAB1 20500 -#define IDC_SPATH_TAB 20501 -#define IDC_ROMPATH_TAB 20502 - -#define IDROM 20600 -#define IDRESCAN 20601 -#define IDGAMEINFO 20602 -#define IDRESCANSET 20603 -#define IDFAVORITESET 20604 - -#define IDC_MVS_CART1 20700 -#define IDC_MVS_CART2 20701 -#define IDC_MVS_CART3 20702 -#define IDC_MVS_CART4 20703 -#define IDC_MVS_CART5 20704 -#define IDC_MVS_CART6 20705 -#define IDC_MVS_TEXTROMNAME1 20706 -#define IDC_MVS_TEXTROMNAME2 20707 -#define IDC_MVS_TEXTROMNAME3 20708 -#define IDC_MVS_TEXTROMNAME4 20709 -#define IDC_MVS_TEXTROMNAME5 20710 -#define IDC_MVS_TEXTROMNAME6 20711 -#define IDC_MVS_TEXTSYSTEM1 20712 -#define IDC_MVS_TEXTSYSTEM2 20713 -#define IDC_MVS_TEXTSYSTEM3 20714 -#define IDC_MVS_TEXTSYSTEM4 20715 -#define IDC_MVS_TEXTSYSTEM5 20716 -#define IDC_MVS_TEXTSYSTEM6 20717 -#define IDC_MVS_TEXTCOMMENT1 20718 -#define IDC_MVS_TEXTCOMMENT2 20719 -#define IDC_MVS_TEXTCOMMENT3 20720 -#define IDC_MVS_TEXTCOMMENT4 20721 -#define IDC_MVS_TEXTCOMMENT5 20722 -#define IDC_MVS_TEXTCOMMENT6 20723 -#define IDC_MVS_SELECT1 20724 -#define IDC_MVS_SELECT2 20725 -#define IDC_MVS_SELECT3 20726 -#define IDC_MVS_SELECT4 20727 -#define IDC_MVS_SELECT5 20728 -#define IDC_MVS_SELECT6 20729 -#define IDC_MVS_CLEAR1 20730 -#define IDC_MVS_CLEAR2 20731 -#define IDC_MVS_CLEAR3 20732 -#define IDC_MVS_CLEAR4 20733 -#define IDC_MVS_CLEAR5 20734 -#define IDC_MVS_CLEAR6 20735 -#define IDC_MVS_SLOT1 20736 -#define IDC_MVS_SLOT2 20737 -#define IDC_MVS_SLOT3 20738 -#define IDC_MVS_SLOT4 20739 -#define IDC_MVS_SLOT5 20740 -#define IDC_MVS_SLOT6 20741 - -#define IDC_NCD_LIST 20800 -#define IDC_NCD_FRONT_PIC 20801 -#define IDC_NCD_BACK_PIC 20802 -#define IDC_NCD_FRONT_PIC_FRAME 20803 -#define IDC_NCD_BACK_PIC_FRAME 20804 -#define IDC_NCD_TEXTSHORT 20805 -#define IDC_NCD_TEXTPUBLISHER 20806 -#define IDC_NCD_TEXTIMAGE 20807 -#define IDC_NCD_TEXTAUDIO 20808 -#define IDC_NCD_SSUBDIR_CHECK 20809 -#define IDC_NCD_SISO_ONLY_CHECK 20810 -#define IDC_NCD_SCAN_BUTTON 20811 -#define IDC_NCD_SEL_DIR_BUTTON 20812 -#define IDC_NCD_PLAY_BUTTON 20813 -#define IDC_NCD_CANCEL_BUTTON 20814 -#define IDC_NCD_COVER_PREVIEW_PIC 20815 -#define IDC_NCD_LABELSHORT 20816 -#define IDC_NCD_LABELPUBLISHER 20817 -#define IDC_NCD_LABELIMAGE 20818 -#define IDC_NCD_LABELAUDIO 20819 - -#define IDC_SUPPORTDIR_EDIT1 20900 -#define IDC_SUPPORTDIR_EDIT2 20901 -#define IDC_SUPPORTDIR_EDIT3 20902 -#define IDC_SUPPORTDIR_EDIT4 20903 -#define IDC_SUPPORTDIR_EDIT5 20904 -#define IDC_SUPPORTDIR_EDIT6 20905 -#define IDC_SUPPORTDIR_EDIT7 20906 -#define IDC_SUPPORTDIR_EDIT8 20907 -#define IDC_SUPPORTDIR_EDIT9 20908 -#define IDC_SUPPORTDIR_EDIT10 20909 -#define IDC_SUPPORTDIR_EDIT11 20910 -#define IDC_SUPPORTDIR_EDIT12 20911 -#define IDC_SUPPORTDIR_EDIT13 20912 -#define IDC_SUPPORTDIR_EDIT14 20913 -#define IDC_SUPPORTDIR_EDIT15 20914 -#define IDC_SUPPORTDIR_EDIT16 20915 -#define IDC_SUPPORTDIR_EDIT17 20916 -#define IDC_SUPPORTDIR_EDIT18 20917 -#define IDC_SUPPORTDIR_EDIT19 20918 -#define IDC_SUPPORTDIR_EDIT20 20919 -#define IDC_SUPPORTDIR_EDIT21 20920 -#define IDC_SUPPORTDIR_EDIT22 20921 -#define IDC_SUPPORTDIR_EDIT23 20922 - -#define IDC_SUPPORTDIR_BR1 20950 -#define IDC_SUPPORTDIR_BR2 20951 -#define IDC_SUPPORTDIR_BR3 20952 -#define IDC_SUPPORTDIR_BR4 20953 -#define IDC_SUPPORTDIR_BR5 20954 -#define IDC_SUPPORTDIR_BR6 20955 -#define IDC_SUPPORTDIR_BR7 20956 -#define IDC_SUPPORTDIR_BR8 20957 -#define IDC_SUPPORTDIR_BR9 20958 -#define IDC_SUPPORTDIR_BR10 20959 -#define IDC_SUPPORTDIR_BR11 20960 -#define IDC_SUPPORTDIR_BR12 20961 -#define IDC_SUPPORTDIR_BR13 20962 -#define IDC_SUPPORTDIR_BR14 20963 -#define IDC_SUPPORTDIR_BR15 20964 -#define IDC_SUPPORTDIR_BR16 20965 -#define IDC_SUPPORTDIR_BR17 20966 -#define IDC_SUPPORTDIR_BR18 20967 -#define IDC_SUPPORTDIR_BR19 20968 -#define IDC_SUPPORTDIR_BR20 20969 -#define IDC_SUPPORTDIR_BR21 20970 -#define IDC_SUPPORTDIR_BR22 20971 -#define IDC_SUPPORTDIR_BR23 20972 - -#define ID_LICENSE 21000 -#define ID_DX9EFFECT 21001 - -#define IDC_ROMSDIR_EDIT1 21100 -#define IDC_ROMSDIR_EDIT2 21101 -#define IDC_ROMSDIR_EDIT3 21102 -#define IDC_ROMSDIR_EDIT4 21103 -#define IDC_ROMSDIR_EDIT5 21104 -#define IDC_ROMSDIR_EDIT6 21105 -#define IDC_ROMSDIR_EDIT7 21106 -#define IDC_ROMSDIR_EDIT8 21107 -#define IDC_ROMSDIR_EDIT9 21108 -#define IDC_ROMSDIR_EDIT10 21109 -#define IDC_ROMSDIR_EDIT11 21110 -#define IDC_ROMSDIR_EDIT12 21111 -#define IDC_ROMSDIR_EDIT13 21112 -#define IDC_ROMSDIR_EDIT14 21113 -#define IDC_ROMSDIR_EDIT15 21114 -#define IDC_ROMSDIR_EDIT16 21115 -#define IDC_ROMSDIR_EDIT17 21116 -#define IDC_ROMSDIR_EDIT18 21117 -#define IDC_ROMSDIR_EDIT19 21118 -#define IDC_ROMSDIR_EDIT20 21119 - -#define IDC_ROMSDIR_BR1 21140 -#define IDC_ROMSDIR_BR2 21141 -#define IDC_ROMSDIR_BR3 21142 -#define IDC_ROMSDIR_BR4 21143 -#define IDC_ROMSDIR_BR5 21144 -#define IDC_ROMSDIR_BR6 21145 -#define IDC_ROMSDIR_BR7 21146 -#define IDC_ROMSDIR_BR8 21147 -#define IDC_ROMSDIR_BR9 21148 -#define IDC_ROMSDIR_BR10 21149 -#define IDC_ROMSDIR_BR11 21150 -#define IDC_ROMSDIR_BR12 21151 -#define IDC_ROMSDIR_BR13 21152 -#define IDC_ROMSDIR_BR14 21153 -#define IDC_ROMSDIR_BR15 21154 -#define IDC_ROMSDIR_BR16 21155 -#define IDC_ROMSDIR_BR17 21156 -#define IDC_ROMSDIR_BR18 21157 -#define IDC_ROMSDIR_BR19 21158 -#define IDC_ROMSDIR_BR20 21159 - -#define MENU_LOAD 10001 -#define MENU_STARTNET 10002 -#define MENU_STARTREPLAY 10003 -#define MENU_STARTRECORD 10004 -#define MENU_STOPREPLAY 10005 -#define MENU_QUIT 10006 -#define MENU_INPUT 10007 -#define MENU_PAUSE 10008 -#define MENU_DIPSW 10009 -#define MENU_SETCPUCLOCK 10010 -#define MENU_RESETCPUCLOCK 10011 -#define MENU_EXIT 10012 -#define MENU_MEMCARD_CREATE 10020 -#define MENU_MEMCARD_SELECT 10021 -#define MENU_MEMCARD_INSERT 10022 -#define MENU_MEMCARD_EJECT 10023 -#define MENU_MEMCARD_TOGGLE 10024 -#define MENU_STATE_LOAD_DIALOG 10030 -#define MENU_STATE_SAVE_DIALOG 10031 -#define MENU_STATE_LOAD_SLOT 10032 -#define MENU_STATE_SAVE_SLOT 10033 -#define MENU_STATE_PREVSLOT 10034 -#define MENU_STATE_NEXTSLOT 10035 -#define MENU_ALLRAM 10036 -#define MENU_STATE_UNDO 10037 -#define MENU_TRIPLE 10100 -#define MENU_FULL 10102 -#define MENU_NOSTRETCH 10110 -#define MENU_STRETCH 10111 -#define MENU_ASPECT 10112 -#define MENU_BLITTER_1 10121 -#define MENU_BLITTER_2 10122 -#define MENU_BLITTER_3 10123 -#define MENU_BLITTER_4 10124 -#define MENU_BLITTER_5 10125 -#define MENU_BLITTER_6 10126 -#define MENU_BLITTER_7 10127 -#define MENU_BLITTER_8 10128 -#define MENU_RES_ARCADE 10130 -#define MENU_RES_1 10131 -#define MENU_RES_2 10132 -#define MENU_RES_3 10133 -#define MENU_RES_4 10134 -#define MENU_RES_OTHER 10135 -#define MENU_SINGLESIZESCREEN 10136 -#define MENU_DOUBLESIZESCREEN 10137 -#define MENU_TRIPLESIZESCREEN 10138 -#define MENU_QUADSIZESCREEN 10139 -#define MENU_16 10141 -#define MENU_24 10142 -#define MENU_32 10143 -#define MENU_GAMMA_DO 10150 -#define MENU_GAMMA_DARKER 10151 -#define MENU_GAMMA_LIGHTER 10152 -#define MENU_GAMMA_OTHER 10153 -#define MENU_GAMMA_USE_HARDWARE 10154 -#define MENU_GAMMA_HARDWARE_ONLY 10155 -#define MENU_GAMMA_SOFTWARE_ONLY 10156 -#define MENU_BASIC_MEMAUTO 10160 -#define MENU_BASIC_VIDEOMEM 10161 -#define MENU_BASIC_SYSMEM 10162 -#define MENU_SOFTFX_MEMAUTO 10163 -#define MENU_SOFTFX_VIDEOMEM 10164 -#define MENU_SOFTFX_SYSMEM 10165 -#define MENU_AUTOSIZE 10170 -#define MENU_SINGLESIZEWINDOW 10171 -#define MENU_DOUBLESIZEWINDOW 10172 -#define MENU_TRIPLESIZEWINDOW 10173 -#define MENU_QUADSIZEWINDOW 10174 -#define MENU_MAXIMUMSIZEWINDOW 10175 -#define MENU_FORCE60HZ 10176 -#define MENU_AUTOFRAMESKIP 10177 -#define MENU_ROTATEVERTICAL 10181 -#define MENU_ASPECTNORMAL 10190 -#define MENU_ASPECTLCD 10191 -#define MENU_ASPECTWIDE 10192 -#define MENU_ASPECTWIDELCD 10193 -#define MENU_MONITORMIRRORVERT 10194 -#define MENU_FRAMES 10200 -#define MENU_DSOUND_BASS 10201 -#define MENU_XAUDIO_BASS 10202 -#define MENU_XAUDIO_REVERB 10203 -#define MENU_DSOUND_NOSOUND 10210 -#define MENU_DSOUND_11025 10211 -#define MENU_DSOUND_22050 10212 -#define MENU_DSOUND_44100 10213 -#define MENU_DSOUND_48000 10214 -#define MENU_XAUDIO_NOSOUND 10220 -#define MENU_XAUDIO_11025 10221 -#define MENU_XAUDIO_22050 10222 -#define MENU_XAUDIO_44100 10223 -#define MENU_XAUDIO_48000 10224 -#define MENU_INTERPOLATE_0 10230 -#define MENU_INTERPOLATE_1 10231 -#define MENU_INTERPOLATE_3 10233 -#define MENU_INTERPOLATE_5 10235 -#define MENU_INTERPOLATE_FM_0 10240 -#define MENU_INTERPOLATE_FM_1 10241 -#define MENU_INTERPOLATE_FM_3 10243 -#define MENU_INTERPOLATE_FM_5 10245 - -#define MENU_INPUT_AUTOFIRE_RATE_1 10260 -#define MENU_INPUT_AUTOFIRE_RATE_2 10261 -#define MENU_INPUT_AUTOFIRE_RATE_3 10262 -#define MENU_INPUT_AUTOFIRE_RATE_4 10263 - -#define MENU_AUTOPAUSE 10300 -#define MENU_PROCESSINPUT 10301 -#define MENU_DISPLAYINDICATOR 10302 -#define MENU_MODELESS 10303 -#define MENU_ROMSDIR 10304 -#define MENU_ENABLECHEAT 10306 -#define MENU_LANGUAGE_SELECT 10307 -#define MENU_LANGUAGE_EXPORT 10308 -#define MENU_LANGUAGE_DOWNLOAD 10309 -#define MENU_PRIORITY_REALTIME 10310 -#define MENU_PRIORITY_HIGH 10311 -#define MENU_PRIORITY_ABOVE_NORMAL 10312 -#define MENU_PRIORITY_NORMAL 10313 -#define MENU_PRIORITY_BELOW_NORMAL 10314 -#define MENU_PRIORITY_LOW 10315 -#define MENU_SNAPFACT 10317 -#define MENU_SAVESNAP 10318 -#define MENU_ASSOCIATE 10330 -#define MENU_DISASSOCIATE 10331 -#define MENU_SAVEGAMEINPUTNOW 10332 -#define MENU_SAVEGAMEINPUT 10333 -#define MENU_SAVESET 10334 -#define MENU_LOADSET 10335 -#define MENU_STARTLOG 10390 -#define MENU_STOPLOG 10391 -#define MENU_DEBUG 10392 -#define MENU_ASSEMBLYCORE 10393 -#define MENU_ABOUT 10501 -#define MENU_SYSINFO 10502 -#define MENU_CONTENTS 10503 -#define MENU_WWW_HOME 10504 -#define MENU_WHATSNEW 10505 -#define MENU_WWW_NSFORUM 10506 -#define MENU_WLOGSTART 10606 -#define MENU_WLOGEND 10607 -#define MENU_AUTOSWITCHFULL 10613 -#define MENU_ROMDIRS 10614 -#define MENU_SUPPORTDIRS 10615 -#define MENU_NOCHANGENUMLOCK 10616 -#define MENU_PREVIOUSGAMES1 10617 -#define MENU_PREVIOUSGAMES2 10618 -#define MENU_PREVIOUSGAMES3 10619 -#define MENU_PREVIOUSGAMES4 10620 -#define MENU_PREVIOUSGAMES5 10621 -#define MENU_PREVIOUSGAMES6 10622 -#define MENU_PREVIOUSGAMES7 10623 -#define MENU_PREVIOUSGAMES8 10624 -#define MENU_PREVIOUSGAMES9 10625 -#define MENU_PREVIOUSGAMES10 10626 -#define MENU_CHEATSEARCH_START 10628 -#define MENU_CHEATSEARCH_NOCHANGE 10629 -#define MENU_CHEATSEARCH_CHANGE 10630 -#define MENU_CHEATSEARCH_DECREASE 10631 -#define MENU_CHEATSEARCH_INCREASE 10632 -#define MENU_CHEATSEARCH_DUMPFILE 10633 -#define MENU_CHEATSEARCH_EXIT 10634 -#define MENU_LANGUAGE_RESET 10635 -#define MENU_BLITTEROPTIONS 10643 -#define MENU_VIDEOVSYNC 10646 -#define MENU_MONITORAUTOCHECK 10650 -#define MENU_CLRMAME_PRO_XML 10651 -#define MENU_CLRMAME_PRO_XML_MD_ONLY 10653 -#define MENU_SAVEHISCORES 10654 -#define MENU_AUD_PLUGIN_1 10655 -#define MENU_AUD_PLUGIN_2 10656 -#define MENU_AUD_PLUGIN_3 10657 -#define MENU_AUD_PLUGIN_4 10658 -#define MENU_AUD_PLUGIN_5 10659 -#define MENU_AUD_PLUGIN_6 10660 -#define MENU_AUD_PLUGIN_7 10661 -#define MENU_AUD_PLUGIN_8 10662 -#define MENU_AUDIO_OPTIONS 10663 -#define MENU_INP_PLUGIN_1 10664 -#define MENU_INP_PLUGIN_2 10665 -#define MENU_INP_PLUGIN_3 10666 -#define MENU_INP_PLUGIN_4 10667 -#define MENU_INP_PLUGIN_5 10668 -#define MENU_INP_PLUGIN_6 10669 -#define MENU_INP_PLUGIN_7 10670 -#define MENU_INP_PLUGIN_8 10671 -#define MENU_PALETTEVIEWER 10672 -#define MENU_LANGUAGE_GL_SELECT 10673 -#define MENU_LANGUAGE_GL_EXPORT 10674 -#define MENU_LANGUAGE_GL_RESET 10675 -#define MENU_ENABLEICONS 10676 -#define MENU_ICONS_SIZE_16 10677 -#define MENU_ICONS_SIZE_24 10678 -#define MENU_ICONS_SIZE_32 10679 -#define MENU_RES_ARCADE_VERTICAL 10700 -#define MENU_RES_1_VERTICAL 10701 -#define MENU_RES_2_VERTICAL 10702 -#define MENU_RES_3_VERTICAL 10703 -#define MENU_RES_4_VERTICAL 10704 -#define MENU_RES_OTHER_VERTICAL 10705 -#define MENU_SINGLESIZESCREEN_VERTICAL 10706 -#define MENU_DOUBLESIZESCREEN_VERTICAL 10707 -#define MENU_TRIPLESIZESCREEN_VERTICAL 10708 -#define MENU_QUADSIZESCREEN_VERTICAL 10709 -#define MENU_CDIMAGE 10710 -#define MENU_START_NEOGEO_MVS 10711 -#define MENU_START_NEOGEO_CD 10712 -#define MENU_LOAD_NEOCD 10713 -#define MENU_CLRMAME_PRO_XML_PCE_ONLY 10714 -#define MENU_CLRMAME_PRO_XML_TG16_ONLY 10715 -#define MENU_CLRMAME_PRO_XML_SGX_ONLY 10716 -#define MENU_CLRMAME_PRO_XML_SG1000_ONLY 10717 -#define MENU_CLRMAME_PRO_XML_COLECO_ONLY 10718 -#define MENU_CREATEDIRS 10719 -#define MENU_USEBLEND 10720 -#define MENU_CLRMAME_PRO_XML_SMS_ONLY 10721 -#define MENU_CLRMAME_PRO_XML_GG_ONLY 10722 -#define MENU_CLRMAME_PRO_XML_MSX_ONLY 10723 -#define MENU_AVI1X 10724 -#define MENU_AVI2X 10725 -#define MENU_AVI3X 10726 -#define MENU_GEARSHIFT 10727 -#define MENU_FULLSCREEN_MONITOR 10728 -#define MENU_CLRMAME_PRO_ALL_DATS 10729 - -#define MENU_BASIC_NORMAL 11001 -#define MENU_BASIC_SCAN 11002 -#define MENU_SCAN50 11003 -#define MENU_ENHANCED_NORMAL 11004 -#define MENU_ENHANCED_SCAN 11005 -#define MENU_EXP_SCAN 11010 - -#define MENU_DISABLEFX 11101 -#define MENU_BILINEAR 11102 -#define MENU_PHOSPHOR 11103 -#define MENU_RGBEFFECTS 11104 -#define MENU_3DPROJECTION 11105 -#define MENU_BASIC_ROTSCAN 11106 -#define MENU_PRESCALE 11107 -#define MENU_SOFTFX 11108 -#define MENU_ENHANCED_SCANINTENSITY 11109 -#define MENU_PHOSPHORINTENSITY 11110 -#define MENU_3DSCREENANGLE 11111 -#define MENU_3DUSELIGHTING 11112 -#define MENU_ENHANCED_ROTSCAN 11113 -#define MENU_EFFECT_AUTO 11121 -#define MENU_EFFECT_01 11122 -#define MENU_EFFECT_02 11123 -#define MENU_EFFECT_03 11124 -#define MENU_EFFECT_04 11125 -#define MENU_EFFECT_05 11126 -#define MENU_EFFECT_06 11127 -#define MENU_EFFECT_07 11128 -#define MENU_EFFECT_08 11129 -#define MENU_EFFECT_09 11130 -#define MENU_EFFECT_0A 11131 -#define MENU_EFFECT_0B 11132 -#define MENU_EFFECT_0C 11133 -#define MENU_EFFECT_0D 11134 -#define MENU_EFFECT_0E 11135 -#define MENU_EFFECT_0F 11136 -#define MENU_EFFECT_10 11147 -#define MENU_FORCE_16BIT 11141 -#define MENU_TEXTUREMANAGE 11142 -#define MENU_FORCE_FLIP 11143 -#define MENU_EXP_SCANINTENSITY 11144 - -#define MENU_ENHANCED_SOFT_STRETCH 11201 -#define MENU_ENHANCED_SOFT_SCALE2X 11202 -#define MENU_ENHANCED_SOFT_SCALE3X 11203 -#define MENU_ENHANCED_SOFT_2XPM_LQ 11204 -#define MENU_ENHANCED_SOFT_2XPM_HQ 11205 -#define MENU_ENHANCED_SOFT_EAGLE 11206 -#define MENU_ENHANCED_SOFT_SUPEREAGLE 11207 -#define MENU_ENHANCED_SOFT_2XSAI 11208 -#define MENU_ENHANCED_SOFT_SUPER2XSAI 11209 -#define MENU_ENHANCED_SOFT_SUPEREAGLE_VBA 11210 -#define MENU_ENHANCED_SOFT_2XSAI_VBA 11211 -#define MENU_ENHANCED_SOFT_SUPER2XSAI_VBA 11212 -#define MENU_ENHANCED_SOFT_SUPERSCALE 11213 -#define MENU_ENHANCED_SOFT_SUPERSCALE75 11214 -#define MENU_ENHANCED_SOFT_HQ2X 11215 -#define MENU_ENHANCED_SOFT_HQ3X 11216 -#define MENU_ENHANCED_SOFT_HQ4X 11217 -#define MENU_ENHANCED_SOFT_HQ2XS_VBA 11218 -#define MENU_ENHANCED_SOFT_HQ3XS_VBA 11219 -#define MENU_ENHANCED_SOFT_HQ2XS_SNES9X 11220 -#define MENU_ENHANCED_SOFT_HQ3XS_SNES9X 11221 -#define MENU_ENHANCED_SOFT_HQ2XBOLD 11222 -#define MENU_ENHANCED_SOFT_HQ3XBOLD 11223 -#define MENU_ENHANCED_SOFT_EPXB 11224 -#define MENU_ENHANCED_SOFT_EPXC 11225 -#define MENU_ENHANCED_SOFT_2XBR_A 11226 -#define MENU_ENHANCED_SOFT_2XBR_B 11227 -#define MENU_ENHANCED_SOFT_2XBR_C 11228 -#define MENU_ENHANCED_SOFT_3XBR_A 11229 -#define MENU_ENHANCED_SOFT_3XBR_B 11230 -#define MENU_ENHANCED_SOFT_3XBR_C 11231 -#define MENU_ENHANCED_SOFT_4XBR_A 11232 -#define MENU_ENHANCED_SOFT_4XBR_B 11233 -#define MENU_ENHANCED_SOFT_4XBR_C 11234 -#define MENU_ENHANCED_SOFT_DDT3X 11235 -#define MENU_ENHANCED_SOFT_AUTOSIZE 11290 - -#define MENU_SOFTFX_SOFT_STRETCH 11301 -#define MENU_SOFTFX_SOFT_SCALE2X 11302 -#define MENU_SOFTFX_SOFT_SCALE3X 11303 -#define MENU_SOFTFX_SOFT_2XPM_LQ 11304 -#define MENU_SOFTFX_SOFT_2XPM_HQ 11305 -#define MENU_SOFTFX_SOFT_EAGLE 11306 -#define MENU_SOFTFX_SOFT_SUPEREAGLE 11307 -#define MENU_SOFTFX_SOFT_2XSAI 11308 -#define MENU_SOFTFX_SOFT_SUPER2XSAI 11309 -#define MENU_SOFTFX_SOFT_SUPEREAGLE_VBA 11310 -#define MENU_SOFTFX_SOFT_2XSAI_VBA 11311 -#define MENU_SOFTFX_SOFT_SUPER2XSAI_VBA 11312 -#define MENU_SOFTFX_SOFT_SUPERSCALE 11313 -#define MENU_SOFTFX_SOFT_SUPERSCALE75 11314 -#define MENU_SOFTFX_SOFT_HQ2X 11315 -#define MENU_SOFTFX_SOFT_HQ3X 11316 -#define MENU_SOFTFX_SOFT_HQ4X 11317 -#define MENU_SOFTFX_SOFT_HQ2XS_VBA 11318 -#define MENU_SOFTFX_SOFT_HQ3XS_VBA 11319 -#define MENU_SOFTFX_SOFT_HQ2XS_SNES9X 11320 -#define MENU_SOFTFX_SOFT_HQ3XS_SNES9X 11321 -#define MENU_SOFTFX_SOFT_HQ2XBOLD 11322 -#define MENU_SOFTFX_SOFT_HQ3XBOLD 11323 -#define MENU_SOFTFX_SOFT_EPXB 11324 -#define MENU_SOFTFX_SOFT_EPXC 11325 -#define MENU_SOFTFX_SOFT_2XBR_A 11326 -#define MENU_SOFTFX_SOFT_2XBR_B 11327 -#define MENU_SOFTFX_SOFT_2XBR_C 11328 -#define MENU_SOFTFX_SOFT_3XBR_A 11329 -#define MENU_SOFTFX_SOFT_3XBR_B 11330 -#define MENU_SOFTFX_SOFT_3XBR_C 11331 -#define MENU_SOFTFX_SOFT_4XBR_A 11332 -#define MENU_SOFTFX_SOFT_4XBR_B 11333 -#define MENU_SOFTFX_SOFT_4XBR_C 11334 -#define MENU_SOFTFX_SOFT_DDT3X 11335 -#define MENU_SOFTFX_SOFT_AUTOSIZE 11390 -#define MENU_SOFT_DIRECTACCESS 11391 - -#define MENU_DX9_ALT_SOFT_STRETCH 11401 -#define MENU_DX9_ALT_SOFT_SCALE2X 11402 -#define MENU_DX9_ALT_SOFT_SCALE3X 11403 -#define MENU_DX9_ALT_SOFT_2XPM_LQ 11404 -#define MENU_DX9_ALT_SOFT_2XPM_HQ 11405 -#define MENU_DX9_ALT_SOFT_EAGLE 11406 -#define MENU_DX9_ALT_SOFT_SUPEREAGLE 11407 -#define MENU_DX9_ALT_SOFT_2XSAI 11408 -#define MENU_DX9_ALT_SOFT_SUPER2XSAI 11409 -#define MENU_DX9_ALT_SOFT_SUPEREAGLE_VBA 11410 -#define MENU_DX9_ALT_SOFT_2XSAI_VBA 11411 -#define MENU_DX9_ALT_SOFT_SUPER2XSAI_VBA 11412 -#define MENU_DX9_ALT_SOFT_SUPERSCALE 11413 -#define MENU_DX9_ALT_SOFT_SUPERSCALE75 11414 -#define MENU_DX9_ALT_SOFT_HQ2X 11415 -#define MENU_DX9_ALT_SOFT_HQ3X 11416 -#define MENU_DX9_ALT_SOFT_HQ4X 11417 -#define MENU_DX9_ALT_SOFT_HQ2XS_VBA 11418 -#define MENU_DX9_ALT_SOFT_HQ3XS_VBA 11419 -#define MENU_DX9_ALT_SOFT_HQ2XS_SNES9X 11420 -#define MENU_DX9_ALT_SOFT_HQ3XS_SNES9X 11421 -#define MENU_DX9_ALT_SOFT_HQ2XBOLD 11422 -#define MENU_DX9_ALT_SOFT_HQ3XBOLD 11423 -#define MENU_DX9_ALT_SOFT_EPXB 11424 -#define MENU_DX9_ALT_SOFT_EPXC 11425 -#define MENU_DX9_ALT_SOFT_2XBR_A 11426 -#define MENU_DX9_ALT_SOFT_2XBR_B 11427 -#define MENU_DX9_ALT_SOFT_2XBR_C 11428 -#define MENU_DX9_ALT_SOFT_3XBR_A 11429 -#define MENU_DX9_ALT_SOFT_3XBR_B 11430 -#define MENU_DX9_ALT_SOFT_3XBR_C 11431 -#define MENU_DX9_ALT_SOFT_4XBR_A 11432 -#define MENU_DX9_ALT_SOFT_4XBR_B 11433 -#define MENU_DX9_ALT_SOFT_4XBR_C 11434 -#define MENU_DX9_ALT_SOFT_DDT3X 11435 -#define MENU_DX9_ALT_SOFT_AUTOSIZE 11490 -#define MENU_DX9_ALT_FORCE_16BIT 11491 - -#define MENU_DX9_POINT 11601 -#define MENU_DX9_LINEAR 11602 -#define MENU_DX9_CUBIC 11603 -#define MENU_DX9_CUBIC_LIGHT 11610 -#define MENU_DX9_CUBIC_BSPLINE 11611 -#define MENU_DX9_CUBIC_NOTCH 11612 -#define MENU_DX9_CUBIC_OPTIMAL 11613 -#define MENU_DX9_CUBIC_CATMULL 11614 -#define MENU_DX9_CUBIC_SHARP 11615 -#define MENU_DX9_CUBIC_DUFF 11616 -#define MENU_DX9_CUBIC_MITCHELL 11617 -#define MENU_DX9_CUBIC_CARDINAL 11618 -#define MENU_DX9_CUBIC_CUSTOM 11619 -#define MENU_DX9_FPTERXTURES 11620 -#define MENU_DX9_FORCE_PS14 11621 -#define MENU_DX9_CUBIC0 11622 -#define MENU_DX9_CUBIC1 11623 -#define MENU_DX9_CUBIC2 11624 -#define MENU_DX9_CUBIC3 11625 -#define MENU_DX9_CUBIC4 11626 - -#define MENU_DX9_ALT_POINT 11701 -#define MENU_DX9_ALT_LINEAR 11702 -#define MENU_DX9_ALT_HARDWAREVERTEX 11703 -#define MENU_DX9_ALT_MOTIONBLUR 11704 - -#define MENU_AVISTART 11827 -#define MENU_AVISTOP 11828 -#define MENU_AVIINTAUD 11829 - -#define GAMESEL_MENU_PLAY 11900 -#define GAMESEL_MENU_GAMEINFO 11901 -#define GAMESEL_MENU_VIEWEMMA 11902 -#define GAMESEL_MENU_FAVORITE 11903 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 0 -#define _APS_NEXT_COMMAND_VALUE 0 -#define _APS_NEXT_CONTROL_VALUE 0 -#define _APS_NEXT_SYMED_VALUE 0 -#endif -#endif diff --git a/jan/src/burner/win32/resource.rc b/jan/src/burner/win32/resource.rc deleted file mode 100644 index c6fe0ff0c..000000000 --- a/jan/src/burner/win32/resource.rc +++ /dev/null @@ -1,44 +0,0 @@ -#ifdef APSTUDIO_INVOKED - #error This file cannot be edited using the Visual C resource editor -#endif - -#define MAKE_STRING_2(s) #s -#define MAKE_STRING(s) MAKE_STRING_2(s) - -#ifdef __GNUC__ - #define _WIN32_WINDOWS 0x410 - #define _WIN32_IE 0x0500 -#endif - -// For version macros -#include "version.h" -// For APP_TITLE and APP_DESCRIPTION macros (both include quotes) -#include "title.h" - -// String IDs -#include "resource_string.h" - -#ifdef __GNUC__ - #include "app_gnuc.rc" -#else - #include "app.rc" -#endif - -// Version resource -#include "version.rc" - -// Manifest for Windows XP in themed mode -CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "resource/manifest.xml" - -// License (we need to use a custom resource type, since Windres doesn't understand rcdata strings -ID_LICENSE 256 "license.rtf" - -// DirectX 9 blitter effects/shaders -//#ifdef _MSC_VER -ID_DX9EFFECT RCDATA "resource/bicubic.fx" -//#endif - -// GUI strings -#include "string.rc" - - diff --git a/jan/src/burner/win32/resource_string.h b/jan/src/burner/win32/resource_string.h deleted file mode 100644 index e4b596532..000000000 --- a/jan/src/burner/win32/resource_string.h +++ /dev/null @@ -1,365 +0,0 @@ -// This in increments of 2, otherwise creating a localisation template is broken with GCC -#define IDS_ERROR (IDS_STRING + 1600) - -#define IDS_FIRSTRUN1 (IDS_STRING + 0) -#define IDS_FIRSTRUN2 (IDS_STRING + 2) -#define IDS_FIRSTRUN3A (IDS_STRING + 4) -#define IDS_FIRSTRUN3B (IDS_STRING + 6) - -#define IDS_CHEAT_NAME (IDS_STRING + 20) -#define IDS_CHEAT_STATUS (IDS_STRING + 22) - -#define IDS_INPUT_INPUT (IDS_STRING + 40) -#define IDS_INPUT_MAPPING (IDS_STRING + 42) -#define IDS_INPUT_STATE (IDS_STRING + 44) -#define IDS_INPUT_INP_PLAYER (IDS_STRING + 46) -#define IDS_INPUT_INP_KEYBOARD (IDS_STRING + 48) -#define IDS_INPUT_INP_JOYSTICK (IDS_STRING + 50) -#define IDS_INPUT_INP_XARCADEL (IDS_STRING + 52) -#define IDS_INPUT_INP_XARCADER (IDS_STRING + 54) -#define IDS_INPUT_INP_HOTRODL (IDS_STRING + 56) -#define IDS_INPUT_INP_HOTRODR (IDS_STRING + 58) -#define IDS_INPUT_ANALOG_ABS (IDS_STRING + 60) -#define IDS_INPUT_ANALOG_AUTO (IDS_STRING + 62) -#define IDS_INPUT_ANALOG_NORMAL (IDS_STRING + 64) - -#define IDS_DIP_GROUP (IDS_STRING + 80) -#define IDS_DIP_SETTING (IDS_STRING + 82) - -#define IDS_INPSET_MOVENAME (IDS_STRING + 100) -#define IDS_INPSET_MOVE (IDS_STRING + 102) -#define IDS_INPSET_WAITING (IDS_STRING + 104) - -#define IDS_MEMCARD_CREATE (IDS_STRING + 120) -#define IDS_MEMCARD_SELECT (IDS_STRING + 122) - -#define IDS_PROGRESS_LOADING (IDS_STRING + 140) -#define IDS_PROGRESS_LOADING_ONLY (IDS_STRING + 142) - -#define IDS_REPLAY_RECORD (IDS_STRING + 150) -#define IDS_REPLAY_REPLAY (IDS_STRING + 152) - -#define IDS_ROMS_SELECT_DIR (IDS_STRING + 160) - -#define IDS_STATE_LOAD (IDS_STRING + 180) -#define IDS_STATE_SAVE (IDS_STRING + 182) -#define IDS_STATE_ACTIVESLOT (IDS_STRING + 184) -#define IDS_STATE_LOADED (IDS_STRING + 186) -#define IDS_STATE_LOAD_ERROR (IDS_STRING + 188) -#define IDS_STATE_SAVED (IDS_STRING + 190) -#define IDS_STATE_SAVE_ERROR (IDS_STRING + 192) - -#define IDS_DAT_GENERATE (IDS_STRING + 220) -#define IDS_SCRN_NOGAME (IDS_STRING + 222) - -#define IDS_NETPLAY_START (IDS_STRING + 240) -#define IDS_NETPLAY_START_YOU (IDS_STRING + 242) -#define IDS_NETPLAY_START_TOTAL (IDS_STRING + 244) -#define IDS_NETPLAY_DROP (IDS_STRING + 246) -#define IDS_NETPLAY_TOOMUCH (IDS_STRING + 248) - -#define IDS_SSHOT_SAVED (IDS_STRING + 260) -#define IDS_SSHOT_ERROR (IDS_STRING + 262) - -#define IDS_REC_AVI (IDS_STRING + 264) -#define IDS_STOP_AVI (IDS_STRING + 266) - -#define IDS_SOUND_NOVOLUME (IDS_STRING + 280) -#define IDS_SOUND_VOLUMESET (IDS_STRING + 282) -#define IDS_SOUND_MUTE (IDS_STRING + 284) -#define IDS_SOUND_MUTE_OFF (IDS_STRING + 286) - -#define IDS_DISK_REPLAY (IDS_STRING + 300) -#define IDS_DISK_THIS_REPLAY (IDS_STRING + 302) -#define IDS_DISK_FILE_REPLAY (IDS_STRING + 304) -#define IDS_DISK_STATE (IDS_STRING + 306) -#define IDS_DISK_THIS_STATE (IDS_STRING + 308) -#define IDS_DISK_FILE_STATE (IDS_STRING + 310) -#define IDS_DISK_SOUND (IDS_STRING + 312) -#define IDS_DISK_THIS_SOUND (IDS_STRING + 314) -#define IDS_DISK_FILE_SOUND (IDS_STRING + 316) -#define IDS_DISK_FILE_CARD (IDS_STRING + 318) -#define IDS_DISK_ALL_CARD (IDS_STRING + 320) -#define IDS_DISK_ALL_DAT (IDS_STRING + 322) -#define IDS_DISK_TEXT (IDS_STRING + 324) -#define IDS_DISK_FILE_PATCH (IDS_STRING + 326) - -#define IDS_DISK_SAVEREPORT (IDS_STRING + 340) - -#define IDS_GAMELANG_LOAD (IDS_STRING + 360) -#define IDS_GAMELANG_EXPORT (IDS_STRING + 362) - -#define IDS_ROMINFO_DIALOGTITLE (IDS_STRING + 400) -#define IDS_ROMINFO_ROMS (IDS_STRING + 402) -#define IDS_ROMINFO_SAMPLES (IDS_STRING + 404) -#define IDS_ROMINFO_NAME (IDS_STRING + 406) -#define IDS_ROMINFO_SIZE (IDS_STRING + 408) -#define IDS_ROMINFO_CRC32 (IDS_STRING + 410) -#define IDS_ROMINFO_TYPE (IDS_STRING + 412) -#define IDS_ROMINFO_FLAGS (IDS_STRING + 414) -#define IDS_ROMINFO_ESSENTIAL (IDS_STRING + 416) -#define IDS_ROMINFO_OPTIONAL (IDS_STRING + 418) -#define IDS_ROMINFO_PROGRAM (IDS_STRING + 420) -#define IDS_ROMINFO_GRAPHICS (IDS_STRING + 422) -#define IDS_ROMINFO_SOUND (IDS_STRING + 424) -#define IDS_ROMINFO_BIOS (IDS_STRING + 426) -#define IDS_ROMINFO_NODUMP (IDS_STRING + 428) - -#define IDS_SPATH_PREVIEW (IDS_STRING + 430) -#define IDS_SPATH_TITLES (IDS_STRING + 432) -#define IDS_SPATH_ICONS (IDS_STRING + 434) -#define IDS_SPATH_CHEATS (IDS_STRING + 436) -#define IDS_SPATH_HISCORE (IDS_STRING + 438) -#define IDS_SPATH_SAMPLES (IDS_STRING + 440) -#define IDS_SPATH_IPS (IDS_STRING + 442) -#define IDS_SPATH_NGCD_ISOS (IDS_STRING + 444) -#define IDS_SPATH_NGCD_COVERS (IDS_STRING + 446) -#define IDS_SPATH_BLEND (IDS_STRING + 448) -#define IDS_SPATH_SELECT (IDS_STRING + 450) -#define IDS_SPATH_VERSUS (IDS_STRING + 452) -#define IDS_SPATH_HOWTO (IDS_STRING + 454) -#define IDS_SPATH_SCORES (IDS_STRING + 456) -#define IDS_SPATH_BOSSES (IDS_STRING + 458) -#define IDS_SPATH_GAMEOVER (IDS_STRING + 460) -#define IDS_SPATH_FLYERS (IDS_STRING + 462) -#define IDS_SPATH_MARQUEES (IDS_STRING + 464) -#define IDS_SPATH_CONTROLS (IDS_STRING + 466) -#define IDS_SPATH_CABINETS (IDS_STRING + 468) -#define IDS_SPATH_PCBS (IDS_STRING + 470) -#define IDS_SPATH_HISTORY (IDS_STRING + 472) -#define IDS_SPATH_EEPROM (IDS_STRING + 474) - -#define IDS_ROMPATH_1 (IDS_STRING + 480) -#define IDS_ROMPATH_2 (IDS_STRING + 482) -#define IDS_ROMPATH_3 (IDS_STRING + 484) -#define IDS_ROMPATH_4 (IDS_STRING + 486) -#define IDS_ROMPATH_5 (IDS_STRING + 488) -#define IDS_ROMPATH_6 (IDS_STRING + 490) -#define IDS_ROMPATH_7 (IDS_STRING + 492) -#define IDS_ROMPATH_8 (IDS_STRING + 494) -#define IDS_ROMPATH_9 (IDS_STRING + 496) -#define IDS_ROMPATH_10 (IDS_STRING + 498) -#define IDS_ROMPATH_11 (IDS_STRING + 500) -#define IDS_ROMPATH_12 (IDS_STRING + 502) -#define IDS_ROMPATH_13 (IDS_STRING + 504) -#define IDS_ROMPATH_14 (IDS_STRING + 506) -#define IDS_ROMPATH_15 (IDS_STRING + 508) -#define IDS_ROMPATH_16 (IDS_STRING + 510) -#define IDS_ROMPATH_17 (IDS_STRING + 512) -#define IDS_ROMPATH_18 (IDS_STRING + 514) -#define IDS_ROMPATH_19 (IDS_STRING + 516) -#define IDS_ROMPATH_20 (IDS_STRING + 518) - -#define IDS_PRESET_SAVED (IDS_STRING + 520) - -#define IDS_LOCAL_GL_CREATE (IDS_STRING + 530) -#define IDS_LOCAL_GL_SELECT (IDS_STRING + 532) -#define IDS_LOCAL_GL_FILTER (IDS_STRING + 534) - -#define IDS_CD_SELECT_IMAGE (IDS_STRING + 540) -#define IDS_CD_SELECT_IMAGE_TITLE (IDS_STRING + 542) -#define IDS_CD_SELECT_FILTER (IDS_STRING + 544) - -#define IDS_LOCAL_CREATE (IDS_STRING + 550) -#define IDS_LOCAL_SELECT (IDS_STRING + 552) -#define IDS_LOCAL_FILTER (IDS_STRING + 554) - -#define IDS_SEL_FILTERS (IDS_STRING + 560) -#define IDS_SEL_HARDWARE (IDS_STRING + 562) -#define IDS_SEL_CAVE (IDS_STRING + 564) -#define IDS_SEL_CPS1 (IDS_STRING + 566) -#define IDS_SEL_CPS2 (IDS_STRING + 568) -#define IDS_SEL_CPS3 (IDS_STRING + 570) -#define IDS_SEL_NEOGEO (IDS_STRING + 572) -#define IDS_SEL_PGM (IDS_STRING + 574) -#define IDS_SEL_PSIKYO (IDS_STRING + 576) -#define IDS_SEL_SEGA (IDS_STRING + 578) -#define IDS_SEL_TAITO (IDS_STRING + 580) -#define IDS_SEL_TOAPLAN (IDS_STRING + 582) -#define IDS_SEL_MISCPRE90S (IDS_STRING + 584) -#define IDS_SEL_MISCPOST90S (IDS_STRING + 586) -#define IDS_SEL_MEGADRIVE (IDS_STRING + 588) -#define IDS_SEL_PACMAN (IDS_STRING + 590) -#define IDS_SEL_KONAMI (IDS_STRING + 592) -#define IDS_SEL_GALAXIAN (IDS_STRING + 594) -#define IDS_SEL_IREM (IDS_STRING + 596) -#define IDS_SEL_BOARDTYPE (IDS_STRING + 598) -#define IDS_SEL_BOOTLEG (IDS_STRING + 600) -#define IDS_SEL_PROTOTYPE (IDS_STRING + 602) -#define IDS_SEL_HACK (IDS_STRING + 604) -#define IDS_SEL_HOMEBREW (IDS_STRING + 606) -#define IDS_SEL_DEMO (IDS_STRING + 608) -#define IDS_SEL_GENUINE (IDS_STRING + 610) -#define IDS_SEL_SETSTATUS (IDS_STRING + 612) -#define IDS_SEL_KANEKO (IDS_STRING + 614) -#define IDS_SEL_SNES (IDS_STRING + 616) -#define IDS_SEL_DATAEAST (IDS_STRING + 618) -#define IDS_SEL_CAPCOM_MISC (IDS_STRING + 620) -#define IDS_SEL_SETA (IDS_STRING + 622) -#define IDS_SEL_TECHNOS (IDS_STRING + 624) -#define IDS_SEL_PCE (IDS_STRING + 626) -#define IDS_SEL_SMS (IDS_STRING + 628) -#define IDS_SEL_SG1000 (IDS_STRING + 630) -#define IDS_SEL_COLECO (IDS_STRING + 632) -#define IDS_SEL_GG (IDS_STRING + 634) -#define IDS_SEL_MSX (IDS_STRING + 636) - -#define IDS_GENRE (IDS_STRING + 650) -#define IDS_GENRE_HORSHOOT (IDS_STRING + 652) -#define IDS_GENRE_VERSHOOT (IDS_STRING + 654) -#define IDS_GENRE_SCRFIGHT (IDS_STRING + 656) -#define IDS_GENRE_VSFIGHT (IDS_STRING + 658) -#define IDS_GENRE_BIOS (IDS_STRING + 660) -#define IDS_GENRE_BREAKOUT (IDS_STRING + 662) -#define IDS_GENRE_CASINO (IDS_STRING + 664) -#define IDS_GENRE_BALLPADDLE (IDS_STRING + 666) -#define IDS_GENRE_MAZE (IDS_STRING + 668) -#define IDS_GENRE_MINIGAMES (IDS_STRING + 670) -#define IDS_GENRE_PINBALL (IDS_STRING + 672) -#define IDS_GENRE_PLATFORM (IDS_STRING + 674) -#define IDS_GENRE_PUZZLE (IDS_STRING + 676) -#define IDS_GENRE_QUIZ (IDS_STRING + 678) -#define IDS_GENRE_SPORTSMISC (IDS_STRING + 680) -#define IDS_GENRE_SPORTSFOOTBALL (IDS_STRING + 682) -#define IDS_GENRE_MISC (IDS_STRING + 684) -#define IDS_GENRE_MAHJONG (IDS_STRING + 686) -#define IDS_GENRE_RACING (IDS_STRING + 688) -#define IDS_GENRE_SHOOT (IDS_STRING + 690) - -#define IDS_FAMILY (IDS_STRING + 740) -#define IDS_FAMILY_MSLUG (IDS_STRING + 742) -#define IDS_FAMILY_SF (IDS_STRING + 744) -#define IDS_FAMILY_KOF (IDS_STRING + 746) -#define IDS_FAMILY_DSTLK (IDS_STRING + 748) -#define IDS_FAMILY_FATFURY (IDS_STRING + 750) -#define IDS_FAMILY_SAMSHO (IDS_STRING + 752) -#define IDS_FAMILY_19XX (IDS_STRING + 754) -#define IDS_FAMILY_SONICWI (IDS_STRING + 756) -#define IDS_FAMILY_PWRINST (IDS_STRING + 758) -#define IDS_FAMILY_OTHER (IDS_STRING + 760) - -#define IDS_FAVORITES (IDS_STRING + 790) - -#define IDS_IPSMANAGER_TITLE (IDS_STRING + 800) - -#define IDS_NGCD_DIAG_TITLE (IDS_STRING + 810) -#define IDS_NGCD_TITLE (IDS_STRING + 812) -#define IDS_NGCD_NGCDID (IDS_STRING + 814) - -#define IDS_MENU_0 (IDS_STRING + 840) -#define IDS_MENU_1 (IDS_STRING + 842) -#define IDS_MENU_2 (IDS_STRING + 844) -#define IDS_MENU_3 (IDS_STRING + 846) -#define IDS_MENU_4 (IDS_STRING + 848) -#define IDS_MENU_5 (IDS_STRING + 850) -#define IDS_MENU_6 (IDS_STRING + 852) - -#define IDS_NUMDIAL_NUM_FRAMES (IDS_STRING + 870) -#define IDS_NUMDIAL_FILTER_SHARP (IDS_STRING + 872) - -#define IDS_SCANNING_ROMS (IDS_STRING + 876) - -#define IDS_CHEAT_SEARCH_NEW (IDS_STRING + 880) -#define IDS_CHEAT_SEARCH_ADD_MATCH (IDS_STRING + 882) -#define IDS_CHEAT_SEARCH_RESULTS (IDS_STRING + 884) -#define IDS_CHEAT_SEARCH_EXIT (IDS_STRING + 886) - -#define IDS_LANG_ENGLISH_US (IDS_STRING + 900) -#define IDS_LANG_SIMP_CHINESE (IDS_STRING + 902) -#define IDS_LANG_TRAD_CHINESE (IDS_STRING + 904) -#define IDS_LANG_JAPANESE (IDS_STRING + 906) -#define IDS_LANG_KOREAN (IDS_STRING + 908) -#define IDS_LANG_FRENCH (IDS_STRING + 910) -#define IDS_LANG_SPANISH (IDS_STRING + 912) -#define IDS_LANG_ITALIAN (IDS_STRING + 914) -#define IDS_LANG_GERMAN (IDS_STRING + 916) -#define IDS_LANG_PORTUGUESE (IDS_STRING + 918) -#define IDS_LANG_POLISH (IDS_STRING + 920) -#define IDS_LANG_HUNGARIAN (IDS_STRING + 922) - -#define IDS_GAMEINFO_DIALOGTITLE (IDS_STRING + 1000) -#define IDS_GAMEINFO_INGAME (IDS_STRING + 1002) -#define IDS_GAMEINFO_TITLE (IDS_STRING + 1004) -#define IDS_GAMEINFO_SELECT (IDS_STRING + 1006) -#define IDS_GAMEINFO_VERSUS (IDS_STRING + 1008) -#define IDS_GAMEINFO_HOWTO (IDS_STRING + 1010) -#define IDS_GAMEINFO_SCORES (IDS_STRING + 1012) -#define IDS_GAMEINFO_BOSSES (IDS_STRING + 1014) -#define IDS_GAMEINFO_GAMEOVER (IDS_STRING + 1016) -#define IDS_GAMEINFO_FLYER (IDS_STRING + 1018) -#define IDS_GAMEINFO_CABINET (IDS_STRING + 1020) -#define IDS_GAMEINFO_MARQUEE (IDS_STRING + 1022) -#define IDS_GAMEINFO_CONTROLS (IDS_STRING + 1024) -#define IDS_GAMEINFO_PCB (IDS_STRING + 1026) -#define IDS_GAMEINFO_ROMINFO (IDS_STRING + 1028) -#define IDS_GAMEINFO_HISTORY (IDS_STRING + 1030) -#define IDS_GAMEINFO_SAMPLES (IDS_STRING + 1032) - -#define IDS_CLONE_OF (IDS_STRING + 1400) -#define IDS_ROMS_FROM_1 (IDS_STRING + 1402) -#define IDS_ROMS_FROM_2 (IDS_STRING + 1404) -#define IDS_BOARD_ROMS_FROM (IDS_STRING + 1406) -#define IDS_SAMPLES_FROM (IDS_STRING + 1408) -#define IDS_NUM_PLAYERS (IDS_STRING + 1410) -#define IDS_NUM_PLAYERS_MAX (IDS_STRING + 1412) -#define IDS_HARDWARE_DESC (IDS_STRING + 1414) -#define IDS_MVS_CARTRIDGE (IDS_STRING + 1416) -#define IDS_HISCORES_SUPPORTED (IDS_STRING + 1418) -#define IDS_CARTRIDGE (IDS_STRING + 1420) -#define IDS_HARDWARE (IDS_STRING + 1422) -#define IDS_EMPTY (IDS_STRING + 1424) -#define IDS_UNIDENTIFIED_CD (IDS_STRING + 1426) - -#define IDS_ERR_ERROR (IDS_ERROR + 0) -#define IDS_ERR_WARNING (IDS_ERROR + 2) -#define IDS_ERR_INFORMATION (IDS_ERROR + 4) -#define IDS_ERR_UNKNOWN (IDS_ERROR + 6) - -#define IDS_ERR_LOAD_OK (IDS_ERROR + 10) -#define IDS_ERR_LOAD_PROBLEM (IDS_ERROR + 12) -#define IDS_ERR_LOAD_NODATA (IDS_ERROR + 14) -#define IDS_ERR_LOAD_ESS_MISS (IDS_ERROR + 16) -#define IDS_ERR_LOAD_ESS_BAD (IDS_ERROR + 18) -#define IDS_ERR_LOAD_DATA_MISS (IDS_ERROR + 20) -#define IDS_ERR_LOAD_DATA_BAD (IDS_ERROR + 22) -#define IDS_ERR_LOAD_FOUND (IDS_ERROR + 24) -#define IDS_ERR_LOAD_NOTFOUND (IDS_ERROR + 26) -#define IDS_ERR_LOAD_INVALID (IDS_ERROR + 28) -#define IDS_ERR_LOAD_CRC (IDS_ERROR + 30) -#define IDS_ERR_LOAD_SMALL (IDS_ERROR + 32) -#define IDS_ERR_LOAD_LARGE (IDS_ERROR + 34) -#define IDS_ERR_LOAD_DET_ESS (IDS_ERROR + 36) -#define IDS_ERR_LOAD_DET_PRG (IDS_ERROR + 38) -#define IDS_ERR_LOAD_DET_BIOS (IDS_ERROR + 40) -#define IDS_ERR_LOAD_DET_GRA (IDS_ERROR + 42) -#define IDS_ERR_LOAD_DET_SND (IDS_ERROR + 44) -#define IDS_ERR_LOAD_DET_ROM (IDS_ERROR + 46) -#define IDS_ERR_LOAD_REQUEST (IDS_ERROR + 48) -#define IDS_ERR_LOAD_DISK (IDS_ERROR + 50) -#define IDS_ERR_LOAD_DISK_CRC (IDS_ERROR + 52) - -#define IDS_ERR_BURN_INIT (IDS_ERROR + 60) - -#define IDS_ERR_UI_NOSUPPORT (IDS_ERROR + 70) -#define IDS_ERR_UI_WINDOW (IDS_ERROR + 72) -#define IDS_ERR_UI_MODULE (IDS_ERROR + 74) -#define IDS_ERR_UI_TRIPLE (IDS_ERROR + 76) -#define IDS_ERR_UI_FULL_NOMODE (IDS_ERROR + 78) -#define IDS_ERR_UI_FULL_PROBLEM (IDS_ERROR + 80) -#define IDS_ERR_UI_FULL_CUSTRES (IDS_ERROR + 82) -#define IDS_ERR_UI_VID_MODULE (IDS_ERROR + 84) - -#define IDS_ERR_DISK_CREATE (IDS_ERROR + 90) -#define IDS_ERR_DISK_LOAD (IDS_ERROR + 92) -#define IDS_ERR_DISK_UNAVAIL (IDS_ERROR + 94) -#define IDS_ERR_DISK_TOONEW (IDS_ERROR + 96) -#define IDS_ERR_DISK_TOOOLD (IDS_ERROR + 98) - -#define IDS_ERR_NO_NETPLAYDLL (IDS_ERROR + 110) -#define IDS_ERR_NO_DRIVER_SELECTED (IDS_ERROR + 112) -#define IDS_ERR_NO_DRIVER_SEL_SLOT1 (IDS_ERROR + 114) -#define IDS_ERR_NON_WORKING (IDS_ERROR + 116) -#define IDS_ERR_CDEMU_INI_FAIL (IDS_ERROR + 118) - -#define IDS_ERR_LOCAL_FAIL_CONNECT (IDS_ERROR + 150) -#define IDS_ERR_LOCAL_FAIL_OPEN_URL (IDS_ERROR + 152) diff --git a/jan/src/burner/win32/roms.cpp b/jan/src/burner/win32/roms.cpp deleted file mode 100644 index 1a79dde76..000000000 --- a/jan/src/burner/win32/roms.cpp +++ /dev/null @@ -1,488 +0,0 @@ -#include "burner.h" -#include -#include - -static HWND hTabControl = NULL; - -HWND hRomsDlg = NULL; -static HWND hParent = NULL; - -char* gameAv = NULL; -bool avOk = false; - -bool bSkipStartupCheck = false; - -static unsigned ScanThreadId = 0; -static HANDLE hScanThread = NULL; -static int nOldSelect = 0; - -static HANDLE hEvent = NULL; - -static void CreateRomDatName(TCHAR* szRomDat) -{ - _stprintf(szRomDat, _T("config/%s.roms.dat"), szAppExeName); - - return; -} - -//Select Directory Dialog////////////////////////////////////////////////////////////////////////// - -static INT_PTR CALLBACK DefInpProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - int var; - static bool chOk; - - switch (Msg) { - case WM_INITDIALOG: { - chOk = false; - - // Setup edit controls values (ROMs Paths) - for(int x = 0; x < 20; x++) { - SetDlgItemText(hDlg, IDC_ROMSDIR_EDIT1 + x, szAppRomPaths[x]); - } - - // Setup the tabs - hTabControl = GetDlgItem(hDlg, IDC_ROMPATH_TAB); - - TC_ITEM tcItem; - tcItem.mask = TCIF_TEXT; - - UINT idsString[20] = { IDS_ROMPATH_1,IDS_ROMPATH_2,IDS_ROMPATH_3,IDS_ROMPATH_4,IDS_ROMPATH_5,IDS_ROMPATH_6,IDS_ROMPATH_7,IDS_ROMPATH_8,IDS_ROMPATH_9,IDS_ROMPATH_10,IDS_ROMPATH_11,IDS_ROMPATH_12,IDS_ROMPATH_13,IDS_ROMPATH_14,IDS_ROMPATH_15,IDS_ROMPATH_16,IDS_ROMPATH_17,IDS_ROMPATH_18,IDS_ROMPATH_19,IDS_ROMPATH_20 }; - - for(int nIndex = 0; nIndex < 20; nIndex++) { - tcItem.pszText = FBALoadStringEx(hAppInst, idsString[nIndex], true); - TabCtrl_InsertItem(hTabControl, nIndex, &tcItem); - } - - int TabPage = TabCtrl_GetCurSel(hTabControl); - - // hide all controls excluding the selected controls - for(int x = 0; x < 20; x++) { - if(x != TabPage) { - ShowWindow(GetDlgItem(hDlg, IDC_ROMSDIR_BR1 + x), SW_HIDE); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_ROMSDIR_EDIT1 + x), SW_HIDE); // edit controls - } - } - - // Show the proper controls - ShowWindow(GetDlgItem(hDlg, IDC_ROMSDIR_BR1 + TabPage), SW_SHOW); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_ROMSDIR_EDIT1 + TabPage), SW_SHOW); // edit controls - - UpdateWindow(hDlg); - - WndInMid(hDlg, hParent); - SetFocus(hDlg); // Enable Esc=close - break; - } - case WM_NOTIFY: { - NMHDR* pNmHdr = (NMHDR*)lParam; - - if (pNmHdr->code == TCN_SELCHANGE) { - - int TabPage = TabCtrl_GetCurSel(hTabControl); - - // hide all controls excluding the selected controls - for(int x = 0; x < 20; x++) { - if(x != TabPage) { - ShowWindow(GetDlgItem(hDlg, IDC_ROMSDIR_BR1 + x), SW_HIDE); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_ROMSDIR_EDIT1 + x), SW_HIDE); // edit controls - } - } - - // Show the proper controls - ShowWindow(GetDlgItem(hDlg, IDC_ROMSDIR_BR1 + TabPage), SW_SHOW); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_ROMSDIR_EDIT1 + TabPage), SW_SHOW); // edit controls - - UpdateWindow(hDlg); - - return FALSE; - } - break; - } - case WM_COMMAND: { - LPMALLOC pMalloc = NULL; - BROWSEINFO bInfo; - ITEMIDLIST* pItemIDList = NULL; - TCHAR buffer[MAX_PATH]; - - if (LOWORD(wParam) == IDOK) { - - for (int i = 0; i < 20; i++) { -// if (GetDlgItemText(hDlg, IDC_ROMSDIR_EDIT1 + i, buffer, sizeof(buffer)) && lstrcmp(szAppRomPaths[i], buffer)) { - GetDlgItemText(hDlg, IDC_ROMSDIR_EDIT1 + i, buffer, sizeof(buffer)); - if (lstrcmp(szAppRomPaths[i], buffer)) chOk = true; - lstrcpy(szAppRomPaths[i], buffer); -// } - } - - SendMessage(hDlg, WM_CLOSE, 0, 0); - break; - } else { - if (LOWORD(wParam) >= IDC_ROMSDIR_BR1 && LOWORD(wParam) <= IDC_ROMSDIR_BR20) { - var = IDC_ROMSDIR_EDIT1 + LOWORD(wParam) - IDC_ROMSDIR_BR1; - } else { - if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDCANCEL) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - } - - SHGetMalloc(&pMalloc); - - memset(&bInfo, 0, sizeof(bInfo)); - bInfo.hwndOwner = hDlg; - bInfo.pszDisplayName = buffer; - bInfo.lpszTitle = FBALoadStringEx(hAppInst, IDS_ROMS_SELECT_DIR, true); - bInfo.ulFlags = BIF_EDITBOX | BIF_RETURNONLYFSDIRS; - - pItemIDList = SHBrowseForFolder(&bInfo); - - if (pItemIDList) { - if (SHGetPathFromIDList(pItemIDList, buffer)) { - int strLen = _tcslen(buffer); - if (strLen) { - if (buffer[strLen - 1] != _T('\\')) { - buffer[strLen] = _T('\\'); - buffer[strLen + 1] = _T('\0'); - } - SetDlgItemText(hDlg, var, buffer); - } - } - pMalloc->Free(pItemIDList); - } - pMalloc->Release(); - - break; - } - case WM_CLOSE: { - hParent = NULL; - EndDialog(hDlg, 0); - if (chOk) { - bRescanRoms = true; - CreateROMInfo(hDlg); - } - } - } - - return 0; -} - - -int RomsDirCreate(HWND hParentWND) -{ - hParent = hParentWND; - - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_ROMSDIR), hParent, (DLGPROC)DefInpProc); - return 1; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -//Check Romsets Dialog///////////////////////////////////////////////////////////////////////////// - -int WriteGameAvb() -{ - TCHAR szRomDat[MAX_PATH]; - FILE* h; - - CreateRomDatName(szRomDat); - - if ((h = _tfopen(szRomDat, _T("wt"))) == NULL) { - return 1; - } - - _ftprintf(h, _T(APP_TITLE) _T(" v%.20s ROMs"), szAppBurnVer); // identifier - _ftprintf(h, _T(" 0x%04X "), nBurnDrvCount); // no of games - - for (unsigned int i = 0; i < nBurnDrvCount; i++) { - if (gameAv[i] & 2) { - _fputtc(_T('*'), h); - } else { - if (gameAv[i] & 1) { - _fputtc(_T('+'), h); - } else { - _fputtc(_T('-'), h); - } - } - } - - _ftprintf(h, _T(" END")); // end marker - - fclose(h); - - return 0; -} - -static int DoCheck(TCHAR* buffPos) -{ - TCHAR label[256]; - - // Check identifier - memset(label, 0, sizeof(label)); - _stprintf(label, _T(APP_TITLE) _T(" v%.20s ROMs"), szAppBurnVer); - if ((buffPos = LabelCheck(buffPos, label)) == NULL) { - return 1; - } - - // Check no of supported games - memset(label, 0, sizeof(label)); - memcpy(label, buffPos, 16); - buffPos += 8; - unsigned int n = _tcstol(label, NULL, 0); - if (n != nBurnDrvCount) { - return 1; - } - - for (unsigned int i = 0; i < nBurnDrvCount; i++) { - if (*buffPos == _T('*')) { - gameAv[i] = 3; - } else { - if (*buffPos == _T('+')) { - gameAv[i] = 1; - } else { - if (*buffPos == _T('-')) { - gameAv[i] = 0; - } else { - return 1; - } - } - } - - buffPos++; - } - - memset(label, 0, sizeof(label)); - _stprintf(label, _T(" END")); - if (LabelCheck(buffPos, label) == NULL) { - avOk = true; - return 0; - } else { - return 1; - } -} - -int CheckGameAvb() -{ - TCHAR szRomDat[MAX_PATH]; - FILE* h; - int bOK; - int nBufferSize = nBurnDrvCount + 256; - TCHAR* buffer = (TCHAR*)malloc(nBufferSize * sizeof(TCHAR)); - if (buffer == NULL) { - return 1; - } - - memset(buffer, 0, nBufferSize * sizeof(TCHAR)); - CreateRomDatName(szRomDat); - - if ((h = _tfopen(szRomDat, _T("r"))) == NULL) { - if (buffer) - { - free(buffer); - buffer = NULL; - } - return 1; - } - - _fgetts(buffer, nBufferSize, h); - fclose(h); - - bOK = DoCheck(buffer); - - if (buffer) { - free(buffer); - buffer = NULL; - } - return bOK; -} - -static int QuitRomsScan() -{ - DWORD dwExitCode; - - GetExitCodeThread(hScanThread, &dwExitCode); - - if (dwExitCode == STILL_ACTIVE) { - - // Signal the scan thread to abort - SetEvent(hEvent); - - // Wait for the thread to finish - if (WaitForSingleObject(hScanThread, 10000) != WAIT_OBJECT_0) { - // If the thread doesn't finish within 10 seconds, forcibly kill it - TerminateThread(hScanThread, 1); - } - - CloseHandle(hScanThread); - } - - CloseHandle(hEvent); - - hEvent = NULL; - - hScanThread = NULL; - ScanThreadId = 0; - - BzipClose(); - - nBurnDrvActive = nOldSelect; - nOldSelect = 0; - bRescanRoms = false; - - if (avOk) { - WriteGameAvb(); - } - - return 1; -} - -static unsigned __stdcall AnalyzingRoms(void*) -{ - for (unsigned int z = 0; z < nBurnDrvCount; z++) { - nBurnDrvActive = z; - - // See if we need to abort - if (WaitForSingleObject(hEvent, 0) == WAIT_OBJECT_0) { - ExitThread(0); - } - - SendDlgItemMessage(hRomsDlg, IDC_WAIT_PROG, PBM_STEPIT, 0, 0); - - switch (BzipOpen(TRUE)) { - case 0: - gameAv[z] = 3; - break; - case 2: - gameAv[z] = 1; - break; - case 1: - gameAv[z] = 0; - } - BzipClose(); - } - - avOk = true; - - PostMessage(hRomsDlg, WM_CLOSE, 0, 0); - - return 0; -} - -//Add these two static variables -static int xClick; -static int yClick; - -static INT_PTR CALLBACK WaitProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) // LPARAM lParam -{ - switch (Msg) { - case WM_INITDIALOG: { - hRomsDlg = hDlg; - nOldSelect = nBurnDrvActive; - memset(gameAv, 0, nBurnDrvCount); // clear game list - SendDlgItemMessage(hDlg, IDC_WAIT_PROG, PBM_SETRANGE, 0, MAKELPARAM(0, nBurnDrvCount)); - SendDlgItemMessage(hDlg, IDC_WAIT_PROG, PBM_SETSTEP, (WPARAM)1, 0); - - ShowWindow(GetDlgItem(hDlg, IDC_WAIT_LABEL_A), TRUE); - SendMessage(GetDlgItem(hDlg, IDC_WAIT_LABEL_A), WM_SETTEXT, (WPARAM)0, (LPARAM)FBALoadStringEx(hAppInst, IDS_SCANNING_ROMS, true)); - ShowWindow(GetDlgItem(hDlg, IDCANCEL), TRUE); - - avOk = false; - hScanThread = (HANDLE)_beginthreadex(NULL, 0, AnalyzingRoms, NULL, 0, &ScanThreadId); - - hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - - if (hParent == NULL) { - RECT rect; - int x, y; - - SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0); - - x = 315 + GetSystemMetrics(SM_CXDLGFRAME) * 2 + 6; - y = 74 + GetSystemMetrics(SM_CYDLGFRAME) * 2 + 6; - - SetForegroundWindow(hDlg); - SetWindowPos(hDlg, HWND_TOPMOST, (rect.right - rect.left) / 2 - x / 2, (rect.bottom - rect.top) / 2 - y / 2, x, y, 0); - RedrawWindow(hDlg, NULL, NULL, 0); - ShowWindow(hDlg, SW_SHOWNORMAL); - } else { - WndInMid(hDlg, hParent); - SetFocus(hDlg); // Enable Esc=close - } - - break; - } - - case WM_LBUTTONDOWN: { - SetCapture(hDlg); - - xClick = GET_X_LPARAM(lParam); - yClick = GET_Y_LPARAM(lParam); - break; - } - - case WM_LBUTTONUP: { - ReleaseCapture(); - break; - } - - case WM_MOUSEMOVE: { - if (GetCapture() == hDlg) { - RECT rcWindow; - GetWindowRect(hDlg,&rcWindow); - - int xMouse = GET_X_LPARAM(lParam); - int yMouse = GET_Y_LPARAM(lParam); - int xWindow = rcWindow.left + xMouse - xClick; - int yWindow = rcWindow.top + yMouse - yClick; - - SetWindowPos(hDlg,NULL,xWindow,yWindow,0,0,SWP_NOSIZE|SWP_NOZORDER); - } - break; - } - - case WM_COMMAND: { - if (LOWORD(wParam) == IDCANCEL) { - PostMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - - case WM_CLOSE: { - QuitRomsScan(); - EndDialog(hDlg, 0); - hRomsDlg = NULL; - hParent = NULL; - } - } - - return 0; -} - -int CreateROMInfo(HWND hParentWND) -{ - hParent = hParentWND; - bool bStarting = 0; - - if (gameAv == NULL) { - gameAv = (char*)malloc(nBurnDrvCount); - memset(gameAv, 0, nBurnDrvCount); - bStarting = 1; - } - - if (gameAv) { - if (CheckGameAvb() || bRescanRoms) { - if ((bStarting && bSkipStartupCheck == false) || bRescanRoms) - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_WAIT), hParent, (DLGPROC)WaitProc); - } - } - - return 1; -} - -void FreeROMInfo() -{ - if (gameAv) { - free(gameAv); - gameAv = NULL; - } -} diff --git a/jan/src/burner/win32/run.cpp b/jan/src/burner/win32/run.cpp deleted file mode 100644 index 33e2cb1fc..000000000 --- a/jan/src/burner/win32/run.cpp +++ /dev/null @@ -1,692 +0,0 @@ -// Run module -#include "burner.h" - -// for NeoGeo CD (WAV playback) -void wav_pause(bool bResume); - -int bRunPause = 0; -int bAltPause = 0; - -int bAlwaysDrawFrames = 0; - -static bool bShowFPS = false; -static unsigned int nDoFPS = 0; - -static bool bMute = false; -static int nOldAudVolume; - -int kNetGame = 0; // Non-zero if Kaillera is being used - -#ifdef FBA_DEBUG -int counter; // General purpose variable used when debugging -#endif - -static unsigned int nNormalLast = 0; // Last value of timeGetTime() -static int nNormalFrac = 0; // Extra fraction we did - -static bool bAppDoStep = 0; -static bool bAppDoFast = 0; -static bool bAppDoFasttoggled = 0; -static int nFastSpeed = 6; - -// For System Macros (below) -static int prevPause = 0, prevFFWD = 0, prevSState = 0, prevLState = 0, prevUState = 0; -UINT32 prevPause_debounce = 0; - -static void CheckSystemMacros() // These are the Pause / FFWD macros added to the input dialog -{ - // Pause - if (macroSystemPause && macroSystemPause != prevPause && timeGetTime() > prevPause_debounce+90) { - if (bHasFocus) { - PostMessage(hScrnWnd, WM_KEYDOWN, VK_PAUSE, 0); - prevPause_debounce = timeGetTime(); - } - } - prevPause = macroSystemPause; - // FFWD - if (!kNetGame) { - if (macroSystemFFWD) { - bAppDoFast = 1; prevFFWD = 1; - } else if (prevFFWD) { - bAppDoFast = 0; prevFFWD = 0; - } - } - // Load State - if (macroSystemLoadState && macroSystemLoadState != prevLState) { - PostMessage(hScrnWnd, WM_KEYDOWN, VK_F9, 0); - } - prevLState = macroSystemLoadState; - // Save State - if (macroSystemSaveState && macroSystemSaveState != prevSState) { - PostMessage(hScrnWnd, WM_KEYDOWN, VK_F10, 0); - } - prevSState = macroSystemSaveState; - // UNDO State - if (macroSystemUNDOState && macroSystemUNDOState != prevUState) { - scrnSSUndo(); - } - prevUState = macroSystemUNDOState; -} - -static int GetInput(bool bCopy) -{ - static int i = 0; - InputMake(bCopy); // get input - - CheckSystemMacros(); - - // Update Input dialog ever 3 frames - if (i == 0) { - InpdUpdate(); - } - - i++; - - if (i >= 3) { - i = 0; - } - - // Update Input Set dialog - InpsUpdate(); - return 0; -} - -static time_t fpstimer; -static unsigned int nPreviousFrames; - -static void DisplayFPSInit() -{ - nDoFPS = 0; - fpstimer = 0; - nPreviousFrames = nFramesRendered; -} - -static void DisplayFPS() -{ - TCHAR fpsstring[8]; - time_t temptime = clock(); - double fps = (double)(nFramesRendered - nPreviousFrames) * CLOCKS_PER_SEC / (temptime - fpstimer); - if (bAppDoFast) { - fps *= nFastSpeed+1; - } - _sntprintf(fpsstring, 7, _T("%2.2lf"), fps); - if (fpstimer && temptime - fpstimer>0) { // avoid strange fps values - VidSNewShortMsg(fpsstring, 0xDFDFFF, 480, 0); - } - - fpstimer = temptime; - nPreviousFrames = nFramesRendered; -} - -// define this function somewhere above RunMessageLoop() -void ToggleLayer(unsigned char thisLayer) -{ - nBurnLayer ^= thisLayer; // xor with thisLayer - VidRedraw(); - VidPaint(0); -} - -// With or without sound, run one frame. -// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen -static int RunFrame(int bDraw, int bPause) -{ - static int bPrevPause = 0; - static int bPrevDraw = 0; - - if (bPrevDraw && !bPause) { - VidPaint(0); // paint the screen (no need to validate) - } - - if (!bDrvOkay) { - return 1; - } - - if (bPause) { - GetInput(false); // Update burner inputs, but not game inputs - if (bPause != bPrevPause) { - VidPaint(2); // Redraw the screen (to ensure mode indicators are updated) - } - } else { - - nFramesEmulated++; - nCurrentFrame++; - - if (kNetGame) { - GetInput(true); // Update inputs - if (KailleraGetInput()) { // Synchronize input with Kaillera - return 0; - } - } else { - if (nReplayStatus == 2) { - GetInput(false); // Update burner inputs, but not game inputs - if (ReplayInput()) { // Read input from file - SetPauseMode(1); // Replay has finished - MenuEnableItems(); - InputSetCooperativeLevel(false, false); - return 0; - } - } else { - GetInput(true); // Update inputs - } - } - - if (nReplayStatus == 1) { - RecordInput(); // Write input to file - } - - if (bDraw) { - nFramesRendered++; - - if (VidFrame()) { // Do one frame - AudBlankSound(); - } - } else { // frame skipping - pBurnDraw = NULL; // Make sure no image is drawn - BurnDrvFrame(); - } - - if (bShowFPS) { - if (nDoFPS < nFramesRendered) { - DisplayFPS(); - nDoFPS = nFramesRendered + 30; - } - } - -#ifdef INCLUDE_AVI_RECORDING - if (nAviStatus) { - if (AviRecordFrame(bDraw)) { - AviStop(); - } - } -#endif - } - - bPrevPause = bPause; - bPrevDraw = bDraw; - - return 0; -} - -// Callback used when DSound needs more sound -static int RunGetNextSound(int bDraw) -{ - if (nAudNextSound == NULL) { - return 1; - } - - if (bRunPause) { - if (bAppDoStep) { - RunFrame(bDraw, 0); - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - } else { - RunFrame(bDraw, 1); - } - - bAppDoStep = 0; // done one step - return 0; - } - - if (bAppDoFast) { // do more frames - for (int i = 0; i < nFastSpeed; i++) { -#ifdef INCLUDE_AVI_RECORDING - if (nAviStatus) { - // Render frame with sound - pBurnSoundOut = nAudNextSound; - RunFrame(bDraw, 0); - } else { - RunFrame(0, 0); - } -#else - RunFrame(0, 0); -#endif - } - } - - // Render frame with sound - pBurnSoundOut = nAudNextSound; - RunFrame(bDraw, 0); - - if (WaveLog != NULL && pBurnSoundOut != NULL) { // log to the file - fwrite(pBurnSoundOut, 1, nBurnSoundLen << 2, WaveLog); - pBurnSoundOut = NULL; - } - - if (bAppDoStep) { - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - } - bAppDoStep = 0; // done one step - - return 0; -} - -extern bool bRunFrame; - -int RunIdle() -{ - int nTime, nCount; - - if (bAudPlaying) { - // Run with sound - - if(bRunFrame) { - bRunFrame = false; - if(bAlwaysDrawFrames) { - RunFrame(1, 0); - } else { - RunGetNextSound(0); - } - return 0; - } else { - AudSoundCheck(); - return 0; - } - } - - // Run without sound - nTime = timeGetTime() - nNormalLast; - nCount = (nTime * nAppVirtualFps - nNormalFrac) / 100000; - if (nCount <= 0) { // No need to do anything for a bit - //Sleep(2); - return 0; - } - - nNormalFrac += nCount * 100000; - nNormalLast += nNormalFrac / nAppVirtualFps; - nNormalFrac %= nAppVirtualFps; - - //if (bAppDoFast){ // Temporarily increase virtual fps - // nCount *= nFastSpeed; - //} - if (nCount > 100) { // Limit frame skipping - nCount = 100; - } - if (bRunPause) { - if (bAppDoStep) { // Step one frame - nCount = 10; - } else { - RunFrame(1, 1); // Paused - return 0; - } - } - bAppDoStep = 0; - - if (bAppDoFast) { // do more frames - for (int i = 0; i < nFastSpeed; i++) { -#ifdef INCLUDE_AVI_RECORDING - if (nAviStatus) { - // Render frame with sound - pBurnSoundOut = nAudNextSound; - RunFrame(1, 0); - } else { - RunFrame(0, 0); - } -#else - RunFrame(0, 0); -#endif - } - } - - if(!bAlwaysDrawFrames) { - for (int i = nCount / 10; i > 0; i--) { // Mid-frames - RunFrame(0, 0); - } - } - RunFrame(1, 0); // End-frame - - return 0; -} - -int RunReset() -{ - // Reset the speed throttling code - nNormalLast = 0; nNormalFrac = 0; - - // Reset FPS display - DisplayFPSInit(); - - if (!bAudPlaying) { - // run without sound - nNormalLast = timeGetTime(); - } - return 0; -} - -static int RunInit() -{ - // Try to run with sound - AudSetCallback(RunGetNextSound); - AudSoundPlay(); - - RunReset(); - - return 0; -} - -static int RunExit() -{ - nNormalLast = 0; - // Stop sound if it was playing - AudSoundStop(); - - bAppDoFast = 0; - bAppDoFasttoggled = 0; - - return 0; -} - -// Keyboard callback function, a way to provide a driver with shifted/unshifted ASCII data from the keyboard. see drv/msx/d_msx.cpp for usage -void (*cBurnerKeyCallback)(UINT8 code, UINT8 KeyType, UINT8 down) = NULL; - -static void BurnerHandlerKeyCallback(MSG *Msg, INT32 KeyDown, INT32 KeyType) -{ - INT32 shifted = (GetAsyncKeyState(VK_SHIFT) & 0x80000000) ? 0xf0 : 0; - INT32 scancode = (Msg->lParam >> 16) & 0xFF; - UINT8 keyboardState[256]; - GetKeyboardState(keyboardState); - char charvalue[2]; - if (ToAsciiEx(Msg->wParam, scancode, keyboardState, (LPWORD)&charvalue[0], 0, GetKeyboardLayout(0)) == 1) { - cBurnerKeyCallback(charvalue[0], shifted|KeyType, KeyDown); - } -} - -// The main message loop -int RunMessageLoop() -{ - int bRestartVideo; - MSG Msg; - - do { - bRestartVideo = 0; - - // Remove pending initialisation messages from the queue - while (PeekMessage(&Msg, NULL, WM_APP + 0, WM_APP + 0, PM_NOREMOVE)) { - if (Msg.message != WM_QUIT) { - PeekMessage(&Msg, NULL, WM_APP + 0, WM_APP + 0, PM_REMOVE); - } - } - - RunInit(); - - ShowWindow(hScrnWnd, nAppShowCmd); // Show the screen window - nAppShowCmd = SW_NORMAL; - - SetForegroundWindow(hScrnWnd); - - GameInpCheckLeftAlt(); - GameInpCheckMouse(); // Hide the cursor - - - while (1) { - if (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) { - // A message is waiting to be processed - if (Msg.message == WM_QUIT) { // Quit program - break; - } - if (Msg.message == (WM_APP + 0)) { // Restart video - bRestartVideo = 1; - break; - } - - if (bMenuEnabled && nVidFullscreen == 0) { // Handle keyboard messages for the menu - if (MenuHandleKeyboard(&Msg)) { - continue; - } - } - - if (Msg.message == WM_SYSKEYDOWN || Msg.message == WM_KEYDOWN) { - if (Msg.lParam & 0x20000000) { - // An Alt/AltGr-key was pressed - switch (Msg.wParam) { - -#if defined (FBA_DEBUG) - case 'C': { - static int count = 0; - if (count == 0) { - count++; - { char* p = NULL; if (*p) { printf("crash...\n"); } } - } - break; - } -#endif - - // 'Silence' & 'Sound Restored' Code (added by CaptainCPS-X) - case 'S': { - TCHAR buffer[60]; - bMute = !bMute; - - if (bMute) { - nOldAudVolume = nAudVolume; - nAudVolume = 0;// mute sound - _stprintf(buffer, FBALoadStringEx(hAppInst, IDS_SOUND_MUTE, true), nAudVolume / 100); - } else { - nAudVolume = nOldAudVolume;// restore volume - _stprintf(buffer, FBALoadStringEx(hAppInst, IDS_SOUND_MUTE_OFF, true), nAudVolume / 100); - } - if (AudSoundSetVolume() == 0) { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_SOUND_NOVOLUME, true)); - } else { - VidSNewShortMsg(buffer); - } - break; - } - - case VK_OEM_PLUS: { - if (bMute) break; // if mute, not do this - nOldAudVolume = nAudVolume; - TCHAR buffer[60]; - - if (GetAsyncKeyState(VK_CONTROL) & 0x80000000) { - nAudVolume += 100; - } else { - nAudVolume += 1000; - } - - if (nAudVolume > 10000) { - nAudVolume = 10000; - } - if (AudSoundSetVolume() == 0) { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_SOUND_NOVOLUME, true)); - } else { - _stprintf(buffer, FBALoadStringEx(hAppInst, IDS_SOUND_VOLUMESET, true), nAudVolume / 100); - VidSNewShortMsg(buffer); - } - break; - } - case VK_OEM_MINUS: { - if (bMute) break; // if mute, not do this - nOldAudVolume = nAudVolume; - TCHAR buffer[60]; - - if (GetAsyncKeyState(VK_CONTROL) & 0x80000000) { - nAudVolume -= 100; - } else { - nAudVolume -= 1000; - } - - if (nAudVolume < 0) { - nAudVolume = 0; - } - if (AudSoundSetVolume() == 0) { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_SOUND_NOVOLUME, true)); - } else { - _stprintf(buffer, FBALoadStringEx(hAppInst, IDS_SOUND_VOLUMESET, true), nAudVolume / 100); - VidSNewShortMsg(buffer); - } - break; - } - case VK_MENU: { - continue; - } - } - } else { - - if (cBurnerKeyCallback) - BurnerHandlerKeyCallback(&Msg, (Msg.message == WM_KEYDOWN) ? 1 : 0, 0); - - switch (Msg.wParam) { - -#if defined (FBA_DEBUG) - case 'N': - counter--; - if (counter < 0) { - bprintf(PRINT_IMPORTANT, _T("*** New counter value: %04X (%d).\n"), counter, counter); - } else { - bprintf(PRINT_IMPORTANT, _T("*** New counter value: %04X.\n"), counter); - } - break; - case 'M': - counter++; - if (counter < 0) { - bprintf(PRINT_IMPORTANT, _T("*** New counter value: %04X (%d).\n"), counter, counter); - } else { - bprintf(PRINT_IMPORTANT, _T("*** New counter value: %04X.\n"), counter); - } - break; -#endif - case VK_ESCAPE: { - if (hwndChat) { - DeActivateChat(); - } else { - if (bCmdOptUsed) { - PostQuitMessage(0); - } else { - if (nVidFullscreen) { - nVidFullscreen = 0; - POST_INITIALISE_MESSAGE; - } - } - } - break; - } - case VK_RETURN: { - if (hwndChat) { - int i = 0; - while (EditText[i]) { - if (EditText[i++] != 0x20) { - break; - } - } - if (i) { - Kaillera_Chat_Send(TCHARToANSI(EditText, NULL, 0)); - //kailleraChatSend(TCHARToANSI(EditText, NULL, 0)); - } - DeActivateChat(); - - break; - } - if (GetAsyncKeyState(VK_CONTROL) & 0x80000000) { - bMenuEnabled = !bMenuEnabled; - POST_INITIALISE_MESSAGE; - - break; - } - - break; - } - case VK_F1: { - bool bOldAppDoFast = bAppDoFast; - - if (kNetGame) { - break; - } - - if (((GetAsyncKeyState(VK_CONTROL) | GetAsyncKeyState(VK_SHIFT)) & 0x80000000) == 0) { - if (bRunPause) { - bAppDoStep = 1; - } else { - bAppDoFast = 1; - } - } - - if ((GetAsyncKeyState(VK_SHIFT) & 0x80000000) && !GetAsyncKeyState(VK_CONTROL)) { // Shift-F1: toggles FFWD state - bAppDoFast = !bAppDoFast; - bAppDoFasttoggled = bAppDoFast; - } - - if (bOldAppDoFast != bAppDoFast) { - DisplayFPSInit(); // resync fps display - } - break; - } - case VK_BACK: { - if ((GetAsyncKeyState(VK_SHIFT) & 0x80000000) && !GetAsyncKeyState(VK_CONTROL)) - { // Shift-Backspace: toggles recording/replay frame counter - bReplayFrameCounterDisplay = !bReplayFrameCounterDisplay; - if (!bReplayFrameCounterDisplay) { - VidSKillTinyMsg(); - } - } else - { // Backspace: toggles FPS counter - bShowFPS = !bShowFPS; - if (bShowFPS) { - DisplayFPSInit(); - } else { - VidSKillShortMsg(); - VidSKillOSDMsg(); - } - } - break; - } - case 'T': { - if (kNetGame && hwndChat == NULL) { - if (AppMessage(&Msg)) { - ActivateChat(); - } - } - break; - } - } - } - } else { - if (Msg.message == WM_SYSKEYUP || Msg.message == WM_KEYUP) { - - if (cBurnerKeyCallback) - BurnerHandlerKeyCallback(&Msg, (Msg.message == WM_KEYDOWN) ? 1 : 0, 0); - - switch (Msg.wParam) { - case VK_MENU: - continue; - case VK_F1: { - bool bOldAppDoFast = bAppDoFast; - - if (!bAppDoFasttoggled) - bAppDoFast = 0; - bAppDoFasttoggled = 0; - if (bOldAppDoFast != bAppDoFast) { - DisplayFPSInit(); // resync fps display - } - break; - } - } - } - } - - // Check for messages for dialogs etc. - if (AppMessage(&Msg)) { - if (TranslateAccelerator(hScrnWnd, hAccel, &Msg) == 0) { - if (hwndChat) { - TranslateMessage(&Msg); - } - DispatchMessage(&Msg); - } - } - } else { - - bRunPause ? wav_pause(false) : wav_pause(true); - - // No messages are waiting - SplashDestroy(0); - RunIdle(); - } - } - - RunExit(); - MediaExit(); - if (bRestartVideo) { - MediaInit(); - } - } while (bRestartVideo); - - return 0; -} - diff --git a/jan/src/burner/win32/scrn.cpp b/jan/src/burner/win32/scrn.cpp deleted file mode 100644 index 0852b67ef..000000000 --- a/jan/src/burner/win32/scrn.cpp +++ /dev/null @@ -1,3390 +0,0 @@ -// Screen Window -#include "burner.h" -#include - -#define HORIZONTAL_ORIENTED_RES 0 -#define VERTICAL_ORIENTED_RES 1 - -int nActiveGame; - -static bool bLoading = 0; - -int OnMenuSelect(HWND, HMENU, int, HMENU, UINT); -int OnInitMenuPopup(HWND, HMENU, UINT, BOOL); -int OnUnInitMenuPopup(HWND, HMENU, UINT, BOOL); -void DisplayPopupMenu(int nMenu); - -RECT SystemWorkArea = { 0, 0, 640, 480 }; // Work area on the desktop -int nWindowPosX = -1, nWindowPosY = -1; // Window position - -int bAutoPause = 1; - -bool bMenuEnabled = true; -bool bHasFocus = false; - -int nSavestateSlot = 1; - -static TCHAR* szClass = _T("FB Alpha"); // Window class name -HWND hScrnWnd = NULL; // Handle to the screen window -HWND hRebar = NULL; // Handle to the Rebar control containing the menu - -static bool bMaximised; -static int nPrevWidth, nPrevHeight; - -static int bBackFromHibernation = 0; - -#define ID_NETCHAT 999 -HWND hwndChat = NULL; -WNDPROC pOldWndProc = NULL; - -bool bRescanRoms = false; - -static bool bDrag = false; -static int nDragX, nDragY; -static int nOldWindowX, nOldWindowY; -static int nLeftButtonX, nLeftButtonY; - -static int OnCreate(HWND, LPCREATESTRUCT); -static void OnActivateApp(HWND, BOOL, DWORD); -static void OnPaint(HWND); -static void OnClose(HWND); -static void OnDestroy(HWND); -static void OnCommand(HWND, int, HWND, UINT); -static int OnSysCommand(HWND, UINT, int, int); -static void OnSize(HWND, UINT, int, int); -static void OnEnterSizeMove(HWND); -static void OnExitSizeMove(HWND); -static void OnEnterIdle(HWND, UINT, HWND); -static void OnEnterMenuLoop(HWND, BOOL); -static void OnExitMenuLoop(HWND, BOOL); -static int OnMouseMove(HWND, int, int, UINT); -static int OnLButtonUp(HWND, int, int, UINT); -static int OnLButtonDown(HWND, BOOL, int, int, UINT); -static int OnLButtonDblClk(HWND, BOOL, int, int, UINT); -static int OnRButtonUp(HWND, int, int, UINT); -static int OnRButtonDown(HWND, BOOL, int, int, UINT); - -static int OnDisplayChange(HWND, UINT, UINT, UINT); - -int OnNotify(HWND, int, NMHDR* lpnmhdr); - -static bool UseDialogs() -{ - if (/*!bDrvOkay ||*/ !nVidFullscreen) { - return true; - } - - return false; -} - -void SetPauseMode(bool bPause) -{ - bRunPause = bPause; - bAltPause = bPause; - - if (bPause) { - AudBlankSound(); - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - } - } else { - GameInpCheckMouse(); - } -} - -static char* CreateKailleraList() -{ - unsigned int nOldDrvSelect = nBurnDrvActive; - int nSize = 256 * 1024; - char* pList = (char*)malloc(nSize); - char* pName = pList; - - if (pList == NULL) { - return NULL; - } - - // Add chat option to the gamelist - pName += sprintf(pName, "* Chat only"); - pName++; - - if (avOk) { - // Add all the driver names to the list - for (nBurnDrvActive = 0; nBurnDrvActive < nBurnDrvCount; nBurnDrvActive++) { - - if(BurnDrvGetFlags() & BDF_GAME_WORKING && gameAv[nBurnDrvActive]) { - char* szDecoratedName = DecorateGameName(nBurnDrvActive); - - if (pName + strlen(szDecoratedName) >= pList + nSize) { - char* pNewList; - nSize <<= 1; - pNewList = (char*)realloc(pList, nSize); - if (pNewList == NULL) { - return NULL; - } - pName -= (INT_PTR)pList; - pList = pNewList; - pName += (INT_PTR)pList; - } - pName += sprintf(pName, "%s", szDecoratedName); - pName++; - } - } - } - - *pName = '\0'; - pName++; - - nBurnDrvActive = nOldDrvSelect; - - return pList; -} - -void DeActivateChat() -{ - bEditActive = false; - DestroyWindow(hwndChat); - hwndChat = NULL; -} - -int ActivateChat() -{ - RECT rect; - GetClientRect(hScrnWnd, &rect); - - DeActivateChat(); - - // Create an invisible edit control - hwndChat = CreateWindow( - _T("EDIT"), NULL, - WS_CHILD | ES_LEFT, - 0, rect.bottom - 32, rect.right, 32, - hScrnWnd, (HMENU)ID_NETCHAT, (HINSTANCE)GetWindowLongPtr(hScrnWnd, GWLP_HINSTANCE), NULL); // pointer not needed - - EditText[0] = 0; - bEditTextChanged = true; - bEditActive = true; - - SendMessage(hwndChat, EM_LIMITTEXT, MAX_CHAT_SIZE, 0); // Limit the amount of text - - SetFocus(hwndChat); - - return 0; -} - -static int WINAPI gameCallback(char* game, int player, int numplayers) -{ - bool bFound = false; - HWND hActive; - - for (nBurnDrvActive = 0; nBurnDrvActive < nBurnDrvCount; nBurnDrvActive++) { - - char* szDecoratedName = DecorateGameName(nBurnDrvActive); - - if (!strcmp(szDecoratedName, game)) { - bFound = true; - break; - } - } - - if (!bFound) { -// kailleraEndGame(); - Kaillera_End_Game(); - return 1; - } - - kNetGame = 1; - hActive = GetActiveWindow(); - - bCheatsAllowed = false; // Disable cheats during netplay - AudSoundStop(); // Stop while we load roms - DrvInit(nBurnDrvActive, false); // Init the game driver - ScrnInit(); - AudSoundPlay(); // Restart sound - VidInit(); - SetFocus(hScrnWnd); - -// dprintf(_T(" ** OSD startnet text sent.\n")); - - TCHAR szTemp1[256]; - TCHAR szTemp2[256]; - VidSAddChatMsg(FBALoadStringEx(hAppInst, IDS_NETPLAY_START, true), 0xFFFFFF, BurnDrvGetText(DRV_FULLNAME), 0xFFBFBF); - _sntprintf(szTemp1, 256, FBALoadStringEx(hAppInst, IDS_NETPLAY_START_YOU, true), player); - _sntprintf(szTemp2, 256, FBALoadStringEx(hAppInst, IDS_NETPLAY_START_TOTAL, true), numplayers); - VidSAddChatMsg(szTemp1, 0xFFFFFF, szTemp2, 0xFFBFBF); - - RunMessageLoop(); - - DrvExit(); - if (kNetGame) { - kNetGame = 0; -// kailleraEndGame(); - Kaillera_End_Game(); - } - DeActivateChat(); - - bCheatsAllowed = true; // reenable cheats netplay has ended - - SetFocus(hActive); - return 0; -} - -static void WINAPI kChatCallback(char* nick, char* text) -{ - TCHAR szTemp[128]; - _sntprintf(szTemp, 128, _T("%.32hs "), nick); - VidSAddChatMsg(szTemp, 0xBFBFFF, ANSIToTCHAR(text, NULL, 0), 0x7F7FFF); -} - -static void WINAPI kDropCallback(char *nick, int playernb) -{ - TCHAR szTemp[128]; - _sntprintf(szTemp, 128, FBALoadStringEx(hAppInst, IDS_NETPLAY_DROP, true), playernb, nick); - VidSAddChatMsg(szTemp, 0xFFFFFF, NULL, 0); -} - -static void DoNetGame() -{ - kailleraInfos ki; - char tmpver[128]; - char* gameList; - - if(bDrvOkay) { - DrvExit(); - ScrnTitle(); - } - MenuEnableItems(); - -#ifdef _UNICODE - _snprintf(tmpver, 128, APP_TITLE " v%.20ls", szAppBurnVer); -#else - _snprintf(tmpver, 128, APP_TITLE " v%.20s", szAppBurnVer); -#endif - - gameList = CreateKailleraList(); - - ki.appName = tmpver; - ki.gameList = gameList; - ki.gameCallback = &gameCallback; - ki.chatReceivedCallback = &kChatCallback; - ki.clientDroppedCallback = &kDropCallback; - ki.moreInfosCallback = NULL; - - Kaillera_Set_Infos(&ki); - //kailleraSetInfos(&ki); - - Kaillera_Select_Server_Dialog(NULL); - //kailleraSelectServerDialog(NULL); - - if (gameList) { - free(gameList); - gameList = NULL; - } - - End_Network(); - - POST_INITIALISE_MESSAGE; -} - -int CreateDatfileWindows(int bType) -{ - TCHAR szTitle[1024]; - TCHAR szFilter[1024]; - - TCHAR szConsoleString[64]; - _sntprintf(szConsoleString, 64, _T("")); - if (bType == DAT_MEGADRIVE_ONLY) _sntprintf(szConsoleString, 64, _T(", Megadrive only")); - if (bType == DAT_PCENGINE_ONLY) _sntprintf(szConsoleString, 64, _T(", PC-Engine only")); - if (bType == DAT_TG16_ONLY) _sntprintf(szConsoleString, 64, _T(", TurboGrafx16 only")); - if (bType == DAT_SGX_ONLY) _sntprintf(szConsoleString, 64, _T(", SuprGrafx only")); - if (bType == DAT_SG1000_ONLY) _sntprintf(szConsoleString, 64, _T(", Sega SG-1000 only")); - if (bType == DAT_COLECO_ONLY) _sntprintf(szConsoleString, 64, _T(", ColecoVision only")); - if (bType == DAT_MASTERSYSTEM_ONLY) _sntprintf(szConsoleString, 64, _T(", Master System only")); - if (bType == DAT_GAMEGEAR_ONLY) _sntprintf(szConsoleString, 64, _T(", Game Gear only")); - if (bType == DAT_MSX_ONLY) _sntprintf(szConsoleString, 64, _T(", MSX 1 Games only")); - - TCHAR szProgramString[25]; - _sntprintf(szProgramString, 25, _T("ClrMame Pro XML")); - - _sntprintf(szChoice, MAX_PATH, _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), szAppBurnVer, szProgramString, szConsoleString); - _sntprintf(szTitle, 256, FBALoadStringEx(hAppInst, IDS_DAT_GENERATE, true), szProgramString); - - _stprintf(szFilter, FBALoadStringEx(hAppInst, IDS_DISK_ALL_DAT, true), _T(APP_TITLE)); - memcpy(szFilter + _tcslen(szFilter), _T(" (*.dat)\0*.dat\0\0"), 16 * sizeof(TCHAR)); - - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hScrnWnd; - ofn.lpstrFilter = szFilter; - ofn.lpstrFile = szChoice; - ofn.nMaxFile = sizeof(szChoice) / sizeof(TCHAR); - ofn.lpstrInitialDir = _T("."); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("dat"); - ofn.lpstrTitle = szTitle; - ofn.Flags |= OFN_OVERWRITEPROMPT; - - if (GetSaveFileName(&ofn) == 0) - return -1; - - return create_datfile(szChoice, bType); -} - -int CreateAllDatfilesWindows() -{ - INT32 nRet = 0; - - LPMALLOC pMalloc = NULL; - BROWSEINFO bInfo; - ITEMIDLIST* pItemIDList = NULL; - TCHAR buffer[MAX_PATH]; - TCHAR szFilename[MAX_PATH]; - TCHAR szProgramString[25]; - - _sntprintf(szProgramString, 25, _T("ClrMame Pro XML")); - - SHGetMalloc(&pMalloc); - - memset(&bInfo, 0, sizeof(bInfo)); - bInfo.hwndOwner = hScrnWnd; - bInfo.pszDisplayName = buffer; - bInfo.lpszTitle = FBALoadStringEx(hAppInst, IDS_ROMS_SELECT_DIR, true); - bInfo.ulFlags = BIF_EDITBOX | BIF_RETURNONLYFSDIRS; - - pItemIDList = SHBrowseForFolder(&bInfo); - - if (pItemIDList) { - if (SHGetPathFromIDList(pItemIDList, buffer)) { - int strLen = _tcslen(buffer); - if (strLen) { - if (buffer[strLen - 1] != _T('\\')) { - buffer[strLen] = _T('\\'); - buffer[strLen + 1] = _T('\0'); - } - } - } - pMalloc->Free(pItemIDList); - } - pMalloc->Release(); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T("")); - create_datfile(szFilename, DAT_ARCADE_ONLY); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T(", Megadrive only")); - create_datfile(szFilename, DAT_MEGADRIVE_ONLY); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T(", PC-Engine only")); - create_datfile(szFilename, DAT_PCENGINE_ONLY); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T(", TurboGrafx16 only")); - create_datfile(szFilename, DAT_TG16_ONLY); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T(", SuprGrafx only")); - create_datfile(szFilename, DAT_SGX_ONLY); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T(", Sega SG-1000 only")); - create_datfile(szFilename, DAT_SG1000_ONLY); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T(", ColecoVision only")); - create_datfile(szFilename, DAT_COLECO_ONLY); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T(", Master System only")); - create_datfile(szFilename, DAT_MASTERSYSTEM_ONLY); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T(", Game Gear only")); - create_datfile(szFilename, DAT_GAMEGEAR_ONLY); - - _sntprintf(szFilename, MAX_PATH, _T("%s") _T(APP_TITLE) _T(" v%.20s (%s%s).dat"), buffer, szAppBurnVer, szProgramString, _T(", MSX 1 Games only")); - create_datfile(szFilename, DAT_MSX_ONLY); - - return nRet; -} - -// Returns true if a VidInit is needed when the window is resized -static bool VidInitNeeded() -{ - // D3D blitter needs to re-initialise only when auto-size RGB effects are enabled - if (nVidSelect == 1 && (nVidBlitterOpt[nVidSelect] & 0x00030000) == 0x00030000) { - return true; - } - if (nVidSelect == 3) { - return true; - } - - return false; -} - -// Refresh the contents of the window when re-sizing it -static void RefreshWindow(bool bInitialise) -{ - if (nVidFullscreen) { - return; - } - - if (bInitialise && VidInitNeeded()) { - VidInit(); - if (bVidOkay && (bRunPause || !bDrvOkay)) { - VidRedraw(); - VidPaint(0); - } - } -} - -static LRESULT CALLBACK ScrnProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - switch (Msg) { - HANDLE_MSG(hWnd, WM_CREATE, OnCreate); - HANDLE_MSG(hWnd, WM_ACTIVATEAPP, OnActivateApp); - HANDLE_MSGB(hWnd,WM_PAINT, OnPaint); - HANDLE_MSG(hWnd, WM_CLOSE, OnClose); - HANDLE_MSG(hWnd, WM_DESTROY, OnDestroy); - HANDLE_MSG(hWnd, WM_COMMAND, OnCommand); - - // We can't use the macro from windowsx.h macro for this one - case WM_SYSCOMMAND: { - if (OnSysCommand(hWnd,(UINT)wParam,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam))) { - return 0; - } - break; - } - // - dink - handle return from Hibernation - case WM_POWERBROADCAST: { - if (wParam == PBT_APMRESUMESUSPEND || wParam == PBT_APMSUSPEND) { - bBackFromHibernation = 1; - } - break; - } - // - dink - end - HANDLE_MSG(hWnd, WM_SIZE, OnSize); - HANDLE_MSG(hWnd, WM_ENTERSIZEMOVE, OnEnterSizeMove); - HANDLE_MSG(hWnd, WM_EXITSIZEMOVE, OnExitSizeMove); - HANDLE_MSG(hWnd, WM_ENTERIDLE, OnEnterIdle); - - HANDLE_MSG(hWnd, WM_MOUSEMOVE, OnMouseMove); - HANDLE_MSG(hWnd, WM_LBUTTONUP, OnLButtonUp); - HANDLE_MSG(hWnd, WM_LBUTTONDOWN, OnLButtonDown); - - HANDLE_MSG(hWnd, WM_LBUTTONDBLCLK, OnLButtonDblClk); - - HANDLE_MSG(hWnd, WM_RBUTTONUP, OnRButtonUp); - HANDLE_MSG(hWnd, WM_RBUTTONDBLCLK, OnRButtonDown); - HANDLE_MSG(hWnd, WM_RBUTTONDOWN, OnRButtonDown); - - HANDLE_MSG(hWnd, WM_NOTIFY, OnNotify); - HANDLE_MSG(hWnd, WM_MENUSELECT, OnMenuSelect); - HANDLE_MSG(hWnd, WM_ENTERMENULOOP, OnEnterMenuLoop); - HANDLE_MSGB(hWnd,WM_EXITMENULOOP, OnExitMenuLoop); - HANDLE_MSGB(hWnd,WM_INITMENUPOPUP, OnInitMenuPopup); - HANDLE_MSG(hWnd, WM_UNINITMENUPOPUP,OnUnInitMenuPopup); - - HANDLE_MSG(hWnd, WM_DISPLAYCHANGE, OnDisplayChange); - } - - return DefWindowProc(hWnd, Msg, wParam, lParam); -} - -static int OnDisplayChange(HWND, UINT, UINT, UINT) -{ - if (!nVidFullscreen) { - POST_INITIALISE_MESSAGE; - } - - return 0; -} - -/******************************************************************************/ -/* Fixed right click mouse events, now they work properly without interfering - with other applications in the background [CaptainCPS-X] */ -//----------------------------------------------------------------------------// -bool bRDblClick = false; - -static int OnRButtonDown(HWND hwnd, BOOL bDouble, int, int, UINT) -{ - if (hwnd != hScrnWnd && !nVidFullscreen) return 1; - - if (bDouble) { - // Right double-click at fullcreen happened, turn this flag 'true' so - // when right double-click ends (OnRButtonUp) it doesn't do anything else. - bRDblClick = true; - } - return 1; -} - -static int OnRButtonUp(HWND hwnd, int, int, UINT) -{ - // If fullscreen and right double-click - if (hwnd == hScrnWnd && nVidFullscreen && bRDblClick) - { - // game running - if (bDrvOkay) - { - // toggle fullscreen - nVidFullscreen = !nVidFullscreen; - bRDblClick = false; - POST_INITIALISE_MESSAGE; - return 0; - } - } - - // If not fullscreen and this event is not related to 'toggle fullscreen' right double-click event - if (!nVidFullscreen && !bRDblClick) { - bMenuEnabled = !bMenuEnabled; - POST_INITIALISE_MESSAGE; - return 0; - } - - return 1; -} -/*************************************************************************/ - -static int OnMouseMove(HWND hwnd, int x, int y, UINT keyIndicators) -{ - if (bDrag && hwnd == hScrnWnd && keyIndicators == MK_LBUTTON && !nVidFullscreen && !bMenuEnabled) { - RECT clientRect; - - GetWindowRect(hScrnWnd, &clientRect); - - if ((nLeftButtonX - (clientRect.left + x)) < nDragX && (nLeftButtonX - (clientRect.left + x)) > -nDragX && (nLeftButtonY - (clientRect.top + y)) < nDragY && (nLeftButtonY - (clientRect.top + y)) > -nDragY) { - SetWindowPos(hScrnWnd, NULL, nOldWindowX, nOldWindowY, 0, 0, SWP_NOREPOSITION | SWP_NOSIZE); - } else { - nWindowPosX = nOldWindowX - (nLeftButtonX - (clientRect.left + x)); - nWindowPosY = nOldWindowY - (nLeftButtonY - (clientRect.top + y)); - - SetWindowPos(hScrnWnd, NULL, nWindowPosX, nWindowPosY, 0, 0, SWP_NOREPOSITION | SWP_NOSIZE); - } - - return 0; - } - - return 1; -} - -static int OnLButtonDown(HWND hwnd, BOOL, int x, int y, UINT) -{ - if (hwnd == hScrnWnd && !nVidFullscreen && !bMenuEnabled) { - RECT clientRect; - - GetWindowRect(hScrnWnd, &clientRect); - - nOldWindowX = clientRect.left; - nOldWindowY = clientRect.top; - - nLeftButtonX = clientRect.left + x; - nLeftButtonY = clientRect.top + y; - - bDrag = true; - - return 0; - } - - return 1; -} - -static int OnLButtonUp(HWND hwnd, int x, int y, UINT) -{ - bDrag = false; - - if (nVidFullscreen) { - - if (hwnd != hScrnWnd) { - return 1; - } - - if (UseDialogs()) { - RECT clientRect; - GetWindowRect(hScrnWnd, &clientRect); - - TrackPopupMenuEx(hMenuPopup, TPM_LEFTALIGN | TPM_TOPALIGN, clientRect.left + x, clientRect.top + y, hScrnWnd, NULL); - return 0; - } - } else { - if (!bMenuEnabled) { - RECT clientRect; - GetWindowRect(hScrnWnd, &clientRect); - - if ((nLeftButtonX - (clientRect.left + x)) < nDragX && (nLeftButtonX - (clientRect.left + x)) > -nDragX && (nLeftButtonY - (clientRect.top + y)) < nDragY && (nLeftButtonY - (clientRect.top + y)) > -nDragY) { - TrackPopupMenuEx(hMenuPopup, TPM_LEFTALIGN | TPM_TOPALIGN, clientRect.left + x, clientRect.top + y, hScrnWnd, NULL); - return 0; - } - } - } - - return 1; -} - -static int OnLButtonDblClk(HWND hwnd, BOOL, int, int, UINT) -{ - if (bDrvOkay) { - nVidFullscreen = !nVidFullscreen; - POST_INITIALISE_MESSAGE; - return 0; - } - - return 1; -} - -static int OnCreate(HWND, LPCREATESTRUCT) // HWND hwnd, LPCREATESTRUCT lpCreateStruct -{ - return 1; -} - -static void OnActivateApp(HWND hwnd, BOOL fActivate, DWORD /* dwThreadId */) -{ - bHasFocus = fActivate; - if (!kNetGame && bAutoPause && !bAltPause && hInpdDlg == NULL && hInpCheatDlg == NULL && hInpDIPSWDlg == NULL) { - bRunPause = fActivate? 0 : 1; - } - if (fActivate == false && hwnd == hScrnWnd) { - EndMenu(); - } - if (fActivate == false && bRunPause) { - AudBlankSound(); - } - - if (fActivate) { - if (hInpdDlg || hInpCheatDlg || hInpDIPSWDlg || hDbgDlg) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - } else { - GameInpCheckMouse(); - } - } -} - -extern HWND hSelDlg; - -static void PausedRedraw(void) -{ - if (bVidOkay && bRunPause && bDrvOkay && (hSelDlg == NULL)) { // Redraw the screen to show certain messages while paused. - dink - INT16 *pBtemp = pBurnSoundOut; - pBurnSoundOut = NULL; // Mute the sound as VidRedraw() draws the frame - - VidRedraw(); - VidPaint(0); - - pBurnSoundOut = pBtemp; - } -} - -static void OnPaint(HWND hWnd) -{ - if (hWnd == hScrnWnd) - { - VidPaint(1); - - if (bBackFromHibernation) { - PausedRedraw(); // redraw game screen if paused and returning from hibernation - dink - bBackFromHibernation = 0; - } - - // draw menu - if (!nVidFullscreen) { - RedrawWindow(hRebar, NULL, NULL, RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); - } - } -} - -static void OnClose(HWND) -{ -#ifdef INCLUDE_AVI_RECORDING - AviStop(); -#endif - PostQuitMessage(0); // Quit the program if the window is closed -} - -static void OnDestroy(HWND) -{ - VidExit(); // Stop using video with the Window - hScrnWnd = NULL; // Make sure handle is not used again -} - -OPENFILENAME bgFn; -TCHAR szFile[MAX_PATH]; - -static void UpdatePreviousGameList() -{ - int nRecentIdenticalTo = -1; - - // check if this game is identical to any of the listed in the recent menu - for(int x = 0; x < SHOW_PREV_GAMES; x++) { - if(!_tcscmp(BurnDrvGetText(DRV_NAME), szPrevGames[x])) { - nRecentIdenticalTo = x; - } - } - - // Declare temporary array - TCHAR szTmp[SHOW_PREV_GAMES][32]; - - // Backup info for later use - for(int x = 0; x < SHOW_PREV_GAMES; x++) { - _tcscpy(szTmp[x], szPrevGames[x]); - } - - switch(nRecentIdenticalTo) - { - case -1: - // Normal rotation when recent game is not identical to any of the ones listed - // - - - - _tcscpy(szPrevGames[9], szPrevGames[8]); // Recent 10 = 9 - _tcscpy(szPrevGames[8], szPrevGames[7]); // Recent 9 = 8 - _tcscpy(szPrevGames[7], szPrevGames[6]); // Recent 8 = 7 - _tcscpy(szPrevGames[6], szPrevGames[5]); // Recent 7 = 6 - _tcscpy(szPrevGames[5], szPrevGames[4]); // Recent 6 = 5 - _tcscpy(szPrevGames[4], szPrevGames[3]); // Recent 5 = 4 - _tcscpy(szPrevGames[3], szPrevGames[2]); // Recent 4 = 3 - _tcscpy(szPrevGames[2], szPrevGames[1]); // Recent 3 = 2 - _tcscpy(szPrevGames[1], szPrevGames[0]); // Recent 2 = 1 - _tcscpy(szPrevGames[0], BurnDrvGetText(DRV_NAME)); // Update most recent game played (Recent 1) - break; - case 0: - break; // Nothing Change - case 1: - _tcscpy(szPrevGames[0], szTmp[1]); // Update most recent game played (Recent 1 = 2) - _tcscpy(szPrevGames[1], szTmp[0]); // Recent 2 = 1 - break; - case 2: - _tcscpy(szPrevGames[0], szTmp[2]); // Update most recent game played (Recent 1 = 3) - _tcscpy(szPrevGames[1], szTmp[0]); // Recent 2 = 1 - _tcscpy(szPrevGames[2], szTmp[1]); // Recent 3 = 2 - break; - case 3: - _tcscpy(szPrevGames[0], szTmp[3]); // Update most recent game played (Recent 1 = 4) - _tcscpy(szPrevGames[1], szTmp[0]); // Recent 2 = 1 - _tcscpy(szPrevGames[2], szTmp[1]); // Recent 3 = 2 - _tcscpy(szPrevGames[3], szTmp[2]); // Recent 4 = 3 - break; - case 4: - _tcscpy(szPrevGames[0], szTmp[4]); // Update most recent game played (Recent 1 = 5) - _tcscpy(szPrevGames[1], szTmp[0]); // Recent 2 = 1 - _tcscpy(szPrevGames[2], szTmp[1]); // Recent 3 = 2 - _tcscpy(szPrevGames[3], szTmp[2]); // Recent 4 = 3 - _tcscpy(szPrevGames[4], szTmp[3]); // Recent 5 = 4 - break; - case 5: - _tcscpy(szPrevGames[0], szTmp[5]); // Update most recent game played (Recent 1 = 6) - _tcscpy(szPrevGames[1], szTmp[0]); // Recent 2 = 1 - _tcscpy(szPrevGames[2], szTmp[1]); // Recent 3 = 2 - _tcscpy(szPrevGames[3], szTmp[2]); // Recent 4 = 3 - _tcscpy(szPrevGames[4], szTmp[3]); // Recent 5 = 4 - _tcscpy(szPrevGames[5], szTmp[4]); // Recent 6 = 5 - break; - case 6: - _tcscpy(szPrevGames[0], szTmp[6]); // Update most recent game played (Recent 1 = 7) - _tcscpy(szPrevGames[1], szTmp[0]); // Recent 2 = 1 - _tcscpy(szPrevGames[2], szTmp[1]); // Recent 3 = 2 - _tcscpy(szPrevGames[3], szTmp[2]); // Recent 4 = 3 - _tcscpy(szPrevGames[4], szTmp[3]); // Recent 5 = 4 - _tcscpy(szPrevGames[5], szTmp[4]); // Recent 6 = 5 - _tcscpy(szPrevGames[6], szTmp[5]); // Recent 7 = 6 - break; - case 7: - _tcscpy(szPrevGames[0], szTmp[7]); // Update most recent game played (Recent 1 = 8) - _tcscpy(szPrevGames[1], szTmp[0]); // Recent 2 = 1 - _tcscpy(szPrevGames[2], szTmp[1]); // Recent 3 = 2 - _tcscpy(szPrevGames[3], szTmp[2]); // Recent 4 = 3 - _tcscpy(szPrevGames[4], szTmp[3]); // Recent 5 = 4 - _tcscpy(szPrevGames[5], szTmp[4]); // Recent 6 = 5 - _tcscpy(szPrevGames[6], szTmp[5]); // Recent 7 = 6 - _tcscpy(szPrevGames[7], szTmp[6]); // Recent 8 = 7 - break; - case 8: - _tcscpy(szPrevGames[0], szTmp[8]); // Update most recent game played (Recent 1 = 9) - _tcscpy(szPrevGames[1], szTmp[0]); // Recent 2 = 1 - _tcscpy(szPrevGames[2], szTmp[1]); // Recent 3 = 2 - _tcscpy(szPrevGames[3], szTmp[2]); // Recent 4 = 3 - _tcscpy(szPrevGames[4], szTmp[3]); // Recent 5 = 4 - _tcscpy(szPrevGames[5], szTmp[4]); // Recent 6 = 5 - _tcscpy(szPrevGames[6], szTmp[5]); // Recent 7 = 6 - _tcscpy(szPrevGames[7], szTmp[6]); // Recent 8 = 7 - _tcscpy(szPrevGames[8], szTmp[7]); // Recent 9 = 8 - break; - case 9: - _tcscpy(szPrevGames[0], szTmp[9]); // Update most recent game played (Recent 1 = 10) - _tcscpy(szPrevGames[1], szTmp[0]); // Recent 2 = 1 - _tcscpy(szPrevGames[2], szTmp[1]); // Recent 3 = 2 - _tcscpy(szPrevGames[3], szTmp[2]); // Recent 4 = 3 - _tcscpy(szPrevGames[4], szTmp[3]); // Recent 5 = 4 - _tcscpy(szPrevGames[5], szTmp[4]); // Recent 6 = 5 - _tcscpy(szPrevGames[6], szTmp[5]); // Recent 7 = 6 - _tcscpy(szPrevGames[7], szTmp[6]); // Recent 8 = 7 - _tcscpy(szPrevGames[8], szTmp[7]); // Recent 9 = 8 - _tcscpy(szPrevGames[9], szTmp[8]); // Recent 10 = 9 - break; - } -} - -// Compact driver loading module -int BurnerLoadDriver(TCHAR *szDriverName) -{ - unsigned int j; - - int nOldDrvSelect = nBurnDrvActive; - DrvExit(); - bLoading = 1; - - for (j = 0; j < nBurnDrvCount; j++) { - nBurnDrvActive = j; - if (!_tcscmp(szDriverName, BurnDrvGetText(DRV_NAME)) && (!(BurnDrvGetFlags() & BDF_BOARDROM))) { - nBurnDrvActive = nOldDrvSelect; - nDialogSelect = j; - SplashDestroy(1); - StopReplay(); - - DrvExit(); - DrvInit(j, true); // Init the game driver - MenuEnableItems(); - bAltPause = 0; - AudSoundPlay(); // Restart sound - bLoading = 0; - UpdatePreviousGameList(); - if (bVidAutoSwitchFull) { - nVidFullscreen = 1; - POST_INITIALISE_MESSAGE; - } - break; - } - } - - return 0; -} - -int StartFromReset(TCHAR *szDriverName) -{ - if (!bDrvOkay || (szDriverName && _tcscmp(szDriverName, BurnDrvGetText(DRV_NAME))) ) { - BurnerLoadDriver(szDriverName); - return 1; - } - //if(nBurnDrvActive < 1) return 0; - - int nOldDrvSelect = nBurnDrvActive; - - DrvExit(); - bLoading = 1; - - nBurnDrvActive = nOldDrvSelect; - nDialogSelect = nOldDrvSelect; - SplashDestroy(1); - StopReplay(); - - DrvInit(nOldDrvSelect, false); // Init the game driver, without loading SRAM - MenuEnableItems(); - bAltPause = 0; - AudSoundPlay(); // Restart sound - bLoading = 0; - UpdatePreviousGameList(); - if (bVidAutoSwitchFull) { - nVidFullscreen = 1; - POST_INITIALISE_MESSAGE; - } - return 1; -} - -void scrnSSUndo() // called from the menu (shift+F8) and CheckSystemMacros() in run.cpp -{ - if (bDrvOkay) { - TCHAR szString[256] = _T("state undo"); - TCHAR szStringFailed[256] = _T("state: nothing to undo"); - if (!StatedUNDO(nSavestateSlot)) { - VidSNewShortMsg(szString); - } else { - VidSNewShortMsg(szStringFailed); - } - PausedRedraw(); - } -} - -static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify) -{ - //if(id >= ID_MDI_START_CHILD) { - // DefFrameProc(hwndCtl, hWndChildFrame, WM_COMMAND, wParam, lParam); - // return; - //} else { - // HWND hWndCurrent = (HWND)SendMessage(hWndChildFrame, WM_MDIGETACTIVE,0,0); - // if(hWndCurrent) { - // SendMessage(hWndCurrent, WM_COMMAND, wParam, lParam); - // return; - // } - //} - - if (bLoading) { - return; - } - - switch (id) { - case MENU_LOAD: { - int nGame; - - if(kNetGame || !UseDialogs() || bLoading) { - break; - } - - SplashDestroy(1); - StopReplay(); - -#ifdef INCLUDE_AVI_RECORDING - AviStop(); -#endif - - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - - bLoading = 1; - AudSoundStop(); // Stop while the dialog is active or we're loading ROMs - - nGame = SelDialog(0, hScrnWnd); // Bring up select dialog to pick a driver - - extern bool bDialogCancel; - - if (nGame >= 0 && bDialogCancel == false) { - DrvExit(); - DrvInit(nGame, true); // Init the game driver - MenuEnableItems(); - bAltPause = 0; - AudSoundPlay(); // Restart sound - bLoading = 0; - UpdatePreviousGameList(); - if (bVidAutoSwitchFull) { - nVidFullscreen = 1; - POST_INITIALISE_MESSAGE; - } - - POST_INITIALISE_MESSAGE; - break; - } else { - GameInpCheckMouse(); - AudSoundPlay(); // Restart sound - bLoading = 0; - break; - } - } - - case MENU_PREVIOUSGAMES1: - case MENU_PREVIOUSGAMES2: - case MENU_PREVIOUSGAMES3: - case MENU_PREVIOUSGAMES4: - case MENU_PREVIOUSGAMES5: - case MENU_PREVIOUSGAMES6: - case MENU_PREVIOUSGAMES7: - case MENU_PREVIOUSGAMES8: - case MENU_PREVIOUSGAMES9: - case MENU_PREVIOUSGAMES10: { - BurnerLoadDriver(szPrevGames[id - MENU_PREVIOUSGAMES1]); - break; - } - - case MENU_START_NEOGEO_MVS: { - BurnerLoadDriver(_T("neogeo")); - break; - } - - case MENU_START_NEOGEO_CD: { - BurnerLoadDriver(_T("neocdz")); - break; - } - - case MENU_LOAD_NEOCD: { - AudBlankSound(); - if (UseDialogs()) { - NeoCDList_Init(); - } - break; - } - - case MENU_CDIMAGE: { - nCDEmuSelect = 0; - TCHAR szFilter[100]; - _stprintf(szFilter, _T("%s"), FBALoadStringEx(hAppInst, IDS_CD_SELECT_FILTER, true)); - memcpy(szFilter + _tcslen(szFilter), _T(" (*.iso,*.cue)\0*.iso;*.cue\0\0"), 28 * sizeof(TCHAR)); - TCHAR szTitle[100]; - _stprintf(szTitle, _T("%s"), FBALoadStringEx(hAppInst, IDS_CD_SELECT_IMAGE_TITLE, true)); - if (UseDialogs() && !bDrvOkay) { - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hScrnWnd; - ofn.lpstrFile = CDEmuImage; - ofn.nMaxFile = MAX_PATH; - ofn.lpstrTitle = szTitle; - ofn.lpstrFilter = szFilter; - ofn.lpstrInitialDir = _T("."); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("cue"); - - GetOpenFileName(&ofn); - } - break; - } - - case MENU_STARTNET: - if (Init_Network()) { - MessageBox(hScrnWnd, FBALoadStringEx(hAppInst, IDS_ERR_NO_NETPLAYDLL, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - break; - } -#ifdef BUILD_A68K - if (bBurnUseASMCPUEmulation) { - FBAPopupAddText(PUF_TEXT_DEFAULT, _T("Please uncheck \"Misc -> Options -> Use Assembly MC68000 Core\" before starting a netgame!")); - FBAPopupDisplay(PUF_TYPE_ERROR); - break; - } -#endif - if (!kNetGame) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - SplashDestroy(1); - StopReplay(); -#ifdef INCLUDE_AVI_RECORDING - AviStop(); -#endif - DrvExit(); - DoNetGame(); - MenuEnableItems(); - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - } - break; - - case MENU_STARTREPLAY: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudSoundStop(); - SplashDestroy(1); - StopReplay(); - StartReplay(); - GameInpCheckMouse(); - AudSoundPlay(); - } - break; - case MENU_STARTRECORD: - if (UseDialogs() && nReplayStatus != 1) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - StopReplay(); - StartRecord(); - GameInpCheckMouse(); - } - break; - case MENU_STOPREPLAY: - StopReplay(); - SetPauseMode(1); - break; - -#ifdef INCLUDE_AVI_RECORDING - case MENU_AVISTART: - if (AviStart()) { - AviStop(); - } else { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_REC_AVI, true), 0x0000FF); - } - break; - case MENU_AVISTOP: - AviStop(); - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_STOP_AVI, true), 0xFF3F3F); - break; -#endif - - case MENU_QUIT: - AudBlankSound(); - if (nVidFullscreen) { - nVidFullscreen = 0; - VidExit(); - } - if (bDrvOkay) { - StopReplay(); -#ifdef INCLUDE_AVI_RECORDING - AviStop(); -#endif - DrvExit(); - if (kNetGame) { - kNetGame = 0; -// kailleraEndGame(); - Kaillera_End_Game(); - DeActivateChat(); - PostQuitMessage(0); - } - bCheatsAllowed = true; // reenable cheats netplay has ended - - ScrnSize(); - ScrnTitle(); - MenuEnableItems(); - nDialogSelect = -1; - nBurnDrvActive = ~0U; - - POST_INITIALISE_MESSAGE; - } - break; - - case MENU_EXIT: - StopReplay(); -#ifdef INCLUDE_AVI_RECORDING - AviStop(); -#endif - if (kNetGame) { - kNetGame = 0; -// kailleraEndGame(); - Kaillera_End_Game(); - DeActivateChat(); - } - PostQuitMessage(0); - return; - - case MENU_PAUSE: - if (bDrvOkay && !kNetGame) { - SetPauseMode(!bRunPause); - } else { - SetPauseMode(0); - } - break; - - case MENU_INPUT: - AudBlankSound(); - if (UseDialogs()) { - InputSetCooperativeLevel(false, false); - InpdCreate(); - } - break; - - case MENU_DIPSW: - AudBlankSound(); - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - InpDIPSWCreate(); - } - break; - - case MENU_SETCPUCLOCK: - AudBlankSound(); - CPUClockDialog(); - MenuEnableItems(); - GameInpCheckMouse(); - break; - case MENU_RESETCPUCLOCK: - nBurnCPUSpeedAdjust = 0x0100; - MenuEnableItems(); - break; - - case MENU_MEMCARD_CREATE: - if (bDrvOkay && UseDialogs() && !kNetGame && (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_NEOGEO) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - MemCardEject(); - MemCardCreate(); - MemCardInsert(); - GameInpCheckMouse(); - } - break; - case MENU_MEMCARD_SELECT: - if (bDrvOkay && UseDialogs() && !kNetGame && (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_NEOGEO) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - MemCardEject(); - MemCardSelect(); - MemCardInsert(); - GameInpCheckMouse(); - } - break; - case MENU_MEMCARD_INSERT: - if (!kNetGame && (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_NEOGEO) { - MemCardInsert(); - } - break; - case MENU_MEMCARD_EJECT: - if (!kNetGame && (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_NEOGEO) { - MemCardEject(); - } - break; - - case MENU_MEMCARD_TOGGLE: - if (bDrvOkay && !kNetGame && (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_NEOGEO) { - MemCardToggle(); - } - break; - - case MENU_STATE_LOAD_DIALOG: - if (UseDialogs() && !kNetGame) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudSoundStop(); - SplashDestroy(1); - StatedLoad(0); - GameInpCheckMouse(); - AudSoundPlay(); - } - break; - case MENU_STATE_SAVE_DIALOG: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - StatedSave(0); - GameInpCheckMouse(); - } - return; - case MENU_STATE_PREVSLOT: { - TCHAR szString[256]; - - nSavestateSlot--; - if (nSavestateSlot < 1) { - nSavestateSlot = 1; - } - _sntprintf(szString, 256, FBALoadStringEx(hAppInst, IDS_STATE_ACTIVESLOT, true), nSavestateSlot); - VidSNewShortMsg(szString); - PausedRedraw(); - break; - } - case MENU_STATE_NEXTSLOT: { - TCHAR szString[256]; - - nSavestateSlot++; - if (nSavestateSlot > 8) { - nSavestateSlot = 8; - } - _sntprintf(szString, 256, FBALoadStringEx(hAppInst, IDS_STATE_ACTIVESLOT, true), nSavestateSlot); - VidSNewShortMsg(szString); - PausedRedraw(); - break; - } - case MENU_STATE_UNDO: - scrnSSUndo(); - break; - case MENU_STATE_LOAD_SLOT: - if (bDrvOkay && !kNetGame) { - if (StatedLoad(nSavestateSlot) == 0) { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_STATE_LOADED, true), 0, 40); - } else { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_STATE_LOAD_ERROR, true), 0xFF3F3F); - } - PausedRedraw(); - } - break; - case MENU_STATE_SAVE_SLOT: - if (bDrvOkay) { - if (StatedSave(nSavestateSlot) == 0) { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_STATE_SAVED, true), 0, 40); - } else { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_STATE_SAVE_ERROR, true), 0xFF3F3F); - SetPauseMode(1); - } - PausedRedraw(); - } - break; - - case MENU_ALLRAM: - bDrvSaveAll = !bDrvSaveAll; - break; - - case MENU_NOSTRETCH: - bVidCorrectAspect = 0; - bVidFullStretch = 0; - POST_INITIALISE_MESSAGE; - break; - - case MENU_STRETCH: - bVidFullStretch = true; - if (bVidFullStretch) { - bVidCorrectAspect = 0; - } - POST_INITIALISE_MESSAGE; - break; - - case MENU_ASPECT: - bVidCorrectAspect = true; - if (bVidCorrectAspect) { - bVidFullStretch = 0; - } - POST_INITIALISE_MESSAGE; - break; - - case MENU_TRIPLE: - bVidTripleBuffer = !bVidTripleBuffer; - POST_INITIALISE_MESSAGE; - break; - - case MENU_BLITTER_1: - VidSelect(0); - POST_INITIALISE_MESSAGE; - break; - case MENU_BLITTER_2: - VidSelect(1); - POST_INITIALISE_MESSAGE; - break; - case MENU_BLITTER_3: - VidSelect(2); - POST_INITIALISE_MESSAGE; - break; - case MENU_BLITTER_4: - VidSelect(3); - POST_INITIALISE_MESSAGE; - break; - case MENU_BLITTER_5: - VidSelect(4); - POST_INITIALISE_MESSAGE; - break; -#if 0 - case MENU_BLITTER_6: - VidSelect(5); - POST_INITIALISE_MESSAGE; - break; - case MENU_BLITTER_7: - VidSelect(6); - POST_INITIALISE_MESSAGE; - break; - case MENU_BLITTER_8: - VidSelect(7); - POST_INITIALISE_MESSAGE; - break; -#endif - - case MENU_RES_ARCADE: - bVidArcaderesHor = !bVidArcaderesHor; - nScreenSizeHor = 0; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - } - break; - - case MENU_SINGLESIZESCREEN: - nScreenSizeHor = 1; - bVidArcaderesHor = false; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - } - break; - case MENU_DOUBLESIZESCREEN: - nScreenSizeHor = 2; - bVidArcaderesHor = false; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - } - break; - case MENU_TRIPLESIZESCREEN: - nScreenSizeHor = 3; - bVidArcaderesHor = false; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - } - break; - case MENU_QUADSIZESCREEN: - nScreenSizeHor = 4; - bVidArcaderesHor = false; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - } - break; - - case MENU_RES_1: - nVidHorWidth = VidPreset[0].nWidth; - nVidHorHeight = VidPreset[0].nHeight; - bVidArcaderesHor = false; - nScreenSizeHor = 0; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - nVidWidth = nVidHorWidth; - nVidHeight = nVidHorHeight; - } - break; - case MENU_RES_2: - nVidHorWidth = VidPreset[1].nWidth; - nVidHorHeight = VidPreset[1].nHeight; - bVidArcaderesHor = false; - nScreenSizeHor = 0; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - nVidWidth = nVidHorWidth; - nVidHeight = nVidHorHeight; - } - break; - case MENU_RES_3: - nVidHorWidth = VidPreset[2].nWidth; - nVidHorHeight = VidPreset[2].nHeight; - bVidArcaderesHor = false; - nScreenSizeHor = 0; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - nVidWidth = nVidHorWidth; - nVidHeight = nVidHorHeight; - } - break; - case MENU_RES_4: - nVidHorWidth = VidPreset[3].nWidth; - nVidHorHeight = VidPreset[3].nHeight; - bVidArcaderesHor = false; - nScreenSizeHor = 0; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - nVidWidth = nVidHorWidth; - nVidHeight = nVidHorHeight; - } - break; - - - case MENU_RES_OTHER: - bVidArcaderesHor = false; - nScreenSizeHor = 0; - if ((bDrvOkay) && !(BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeHor; - bVidArcaderes = bVidArcaderesHor; - } - AudBlankSound(); - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - ResCreate(HORIZONTAL_ORIENTED_RES); - GameInpCheckMouse(); - break; - - case MENU_FULLSCREEN_MONITOR: - if (UseDialogs()) { - AudBlankSound(); - ChooseMonitorCreate(); - GameInpCheckMouse(); - } - break; - - // Vertical - case MENU_RES_ARCADE_VERTICAL: - bVidArcaderesVer = !bVidArcaderesVer; - nScreenSizeVer = 0; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - } - break; - - case MENU_SINGLESIZESCREEN_VERTICAL: - nScreenSizeVer = 1; - bVidArcaderesVer = false; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - } - break; - case MENU_DOUBLESIZESCREEN_VERTICAL: - nScreenSizeVer = 2; - bVidArcaderesVer = false; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - } - break; - case MENU_TRIPLESIZESCREEN_VERTICAL: - nScreenSizeVer = 3; - bVidArcaderesVer = false; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - } - break; - case MENU_QUADSIZESCREEN_VERTICAL: - nScreenSizeVer = 4; - bVidArcaderesVer = false; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - } - break; - - case MENU_RES_1_VERTICAL: - nVidVerWidth = VidPresetVer[0].nWidth; - nVidVerHeight = VidPresetVer[0].nHeight; - bVidArcaderesVer = false; - nScreenSizeVer = 0; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - nVidWidth = nVidVerWidth; - nVidHeight = nVidVerHeight; - } - break; - case MENU_RES_2_VERTICAL: - nVidVerWidth = VidPresetVer[1].nWidth; - nVidVerHeight = VidPresetVer[1].nHeight; - bVidArcaderesVer = false; - nScreenSizeVer = 0; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - nVidWidth = nVidVerWidth; - nVidHeight = nVidVerHeight; - } - break; - case MENU_RES_3_VERTICAL: - nVidVerWidth = VidPresetVer[2].nWidth; - nVidVerHeight = VidPresetVer[2].nHeight; - bVidArcaderesVer = false; - nScreenSizeVer = 0; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - nVidWidth = nVidVerWidth; - nVidHeight = nVidVerHeight; - } - break; - case MENU_RES_4_VERTICAL: - nVidVerWidth = VidPresetVer[3].nWidth; - nVidVerHeight = VidPresetVer[3].nHeight; - bVidArcaderesVer = false; - nScreenSizeVer = 0; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - nVidWidth = nVidVerWidth; - nVidHeight = nVidVerHeight; - } - break; - - case MENU_RES_OTHER_VERTICAL: - bVidArcaderesVer = false; - nScreenSizeVer = 0; - if ((bDrvOkay) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nScreenSize = nScreenSizeVer; - bVidArcaderes = bVidArcaderesVer; - } - AudBlankSound(); - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - ResCreate(VERTICAL_ORIENTED_RES); - GameInpCheckMouse(); - break; - - case MENU_16: - nVidDepth = 16; - break; - - case MENU_24: - nVidDepth = 24; - break; - - case MENU_32: - nVidDepth = 32; - break; - - case MENU_GAMMA_DO: - bDoGamma = !bDoGamma; - if (bDrvOkay) { - if (nVidSelect == 1) { - VidInit(); - } - SetBurnHighCol(nVidImageDepth); - if (bRunPause) { - VidRedraw(); - } - } - break; - - case MENU_GAMMA_DARKER: - nGamma = 1.25; - ComputeGammaLUT(); - bDoGamma = 1; - if (bDrvOkay) { - if (nVidSelect == 1) { - VidInit(); - } - SetBurnHighCol(nVidImageDepth); - if (bRunPause) { - VidRedraw(); - } - } - break; - - case MENU_GAMMA_LIGHTER: - nGamma = 0.80; - ComputeGammaLUT(); - bDoGamma = 1; - if (bDrvOkay) { - if (nVidSelect == 1) { - VidInit(); - } - SetBurnHighCol(nVidImageDepth); - if (bRunPause) { - VidRedraw(); - } - } - break; - - case MENU_GAMMA_OTHER: { - if (UseDialogs()) { - double nOldGamma = nGamma; - bDoGamma = 1; - if (bDrvOkay) { - if (nVidSelect == 1) { - VidInit(); - } - SetBurnHighCol(nVidImageDepth); - } - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - GammaDialog(); - if (nGamma > 0.999 && nGamma < 1.001) { - nGamma = nOldGamma; - bDoGamma = 0; - if (nVidSelect == 1) { - VidInit(); - } - SetBurnHighCol(nVidImageDepth); - } else { - bDoGamma = 1; - ComputeGammaLUT(); - } - if (bDrvOkay) { - VidRecalcPal(); - } - GameInpCheckMouse(); - } - break; - } - - case MENU_GAMMA_USE_HARDWARE: - bVidUseHardwareGamma = 1; - bHardwareGammaOnly = 0; - if (bDrvOkay) { - if (nVidSelect == 1) { - VidInit(); - } - SetBurnHighCol(nVidImageDepth); - VidRecalcPal(); - if (bRunPause) { - VidRedraw(); - } - } - break; - case MENU_GAMMA_HARDWARE_ONLY: - bVidUseHardwareGamma = 1; - bHardwareGammaOnly = 1; - if (bDrvOkay) { - if (nVidSelect == 1) { - VidInit(); - } - SetBurnHighCol(nVidImageDepth); - VidRecalcPal(); - if (bRunPause) { - VidRedraw(); - } - } - break; - case MENU_GAMMA_SOFTWARE_ONLY: - bVidUseHardwareGamma = 0; - bHardwareGammaOnly = 0; - if (bDrvOkay) { - if (nVidSelect == 1) { - VidInit(); - } - SetBurnHighCol(nVidImageDepth); - VidRecalcPal(); - if (bRunPause) { - VidRedraw(); - } - } - break; - - case MENU_FULL: - if (bDrvOkay || nVidFullscreen) { - nVidFullscreen = !nVidFullscreen; - POST_INITIALISE_MESSAGE; - } - return; - - case MENU_AUTOSWITCHFULL: - bVidAutoSwitchFull = !bVidAutoSwitchFull; - break; - - case MENU_BASIC_MEMAUTO: - case MENU_SOFTFX_MEMAUTO: - nVidTransferMethod = -1; - POST_INITIALISE_MESSAGE; - break; - - case MENU_BASIC_VIDEOMEM: - case MENU_SOFTFX_VIDEOMEM: - nVidTransferMethod = 0; - POST_INITIALISE_MESSAGE; - break; - - case MENU_BASIC_SYSMEM: - case MENU_SOFTFX_SYSMEM: - nVidTransferMethod = 1; - POST_INITIALISE_MESSAGE; - break; - - case MENU_AUTOSIZE: - if (nWindowSize != 0) { - nWindowSize = 0; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_SINGLESIZEWINDOW: - if (nWindowSize != 1) { - nWindowSize = 1; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_DOUBLESIZEWINDOW: - if (nWindowSize != 2) { - nWindowSize = 2; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_TRIPLESIZEWINDOW: - if (nWindowSize != 3) { - nWindowSize = 3; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_QUADSIZEWINDOW: - if (nWindowSize != 4) { - nWindowSize = 4; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_MAXIMUMSIZEWINDOW: - if (nWindowSize <= 4) { - nWindowSize = 9999; - POST_INITIALISE_MESSAGE; - } - break; - - case MENU_MONITORAUTOCHECK: - bMonitorAutoCheck = !bMonitorAutoCheck; - if (bMonitorAutoCheck) MonitorAutoCheck(); - POST_INITIALISE_MESSAGE; - break; - - case MENU_ASPECTNORMAL: - bMonitorAutoCheck = false; nVidScrnAspectX = 4; nVidScrnAspectY = 3; - POST_INITIALISE_MESSAGE; - break; - case MENU_ASPECTLCD: - bMonitorAutoCheck = false; nVidScrnAspectX = 5; nVidScrnAspectY = 4; - POST_INITIALISE_MESSAGE; - break; - case MENU_ASPECTWIDE: - bMonitorAutoCheck = false; nVidScrnAspectX = 16; nVidScrnAspectY = 9; - POST_INITIALISE_MESSAGE; - break; - case MENU_ASPECTWIDELCD: - bMonitorAutoCheck = false; nVidScrnAspectX = 16; nVidScrnAspectY = 10; - POST_INITIALISE_MESSAGE; - break; - case MENU_MONITORMIRRORVERT: - nVidRotationAdjust ^= 2; - POST_INITIALISE_MESSAGE; - break; - - case MENU_ROTATEVERTICAL: - nVidRotationAdjust ^= 1; - POST_INITIALISE_MESSAGE; - break; - - case MENU_FORCE60HZ: - bForce60Hz = !bForce60Hz; - break; - - case MENU_VIDEOVSYNC: - bVidVSync = !bVidVSync; - POST_INITIALISE_MESSAGE; - break; - - case MENU_AUTOFRAMESKIP: - bAlwaysDrawFrames = !bAlwaysDrawFrames; - POST_INITIALISE_MESSAGE; - break; - - case MENU_AUD_PLUGIN_1: - AudSelect(0); - POST_INITIALISE_MESSAGE; - break; - - case MENU_AUD_PLUGIN_2: - AudSelect(1); - POST_INITIALISE_MESSAGE; - break; - - case MENU_DSOUND_NOSOUND: - if (!bDrvOkay) { - nAudSampleRate[0] = 0; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_DSOUND_11025: - if (!bDrvOkay) { - nAudSampleRate[0] = 11025; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_DSOUND_22050: - if (!bDrvOkay) { - nAudSampleRate[0] = 22050; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_DSOUND_44100: - if (!bDrvOkay) { - nAudSampleRate[0] = 44100; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_DSOUND_48000: - if (!bDrvOkay) { - nAudSampleRate[0] = 48000; - POST_INITIALISE_MESSAGE; - } - break; - - case MENU_XAUDIO_NOSOUND: - if (!bDrvOkay) { - nAudSampleRate[1] = 0; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_XAUDIO_11025: - if (!bDrvOkay) { - nAudSampleRate[1] = 11025; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_XAUDIO_22050: - if (!bDrvOkay) { - nAudSampleRate[1] = 22050; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_XAUDIO_44100: - if (!bDrvOkay) { - nAudSampleRate[1] = 44100; - POST_INITIALISE_MESSAGE; - } - break; - case MENU_XAUDIO_48000: - if (!bDrvOkay) { - nAudSampleRate[1] = 48000; - POST_INITIALISE_MESSAGE; - } - break; - - case MENU_FRAMES: - if (UseDialogs()) { - if (!bDrvOkay) { -// AudBlankSound(); - NumDialCreate(0); - POST_INITIALISE_MESSAGE; - } - } - break; - - case MENU_INTERPOLATE_0: - nInterpolation = 0; - break; - case MENU_INTERPOLATE_1: - nInterpolation = 1; - break; - case MENU_INTERPOLATE_3: - nInterpolation = 3; - break; - - case MENU_INTERPOLATE_FM_0: - nFMInterpolation = 0; - break; - case MENU_INTERPOLATE_FM_1: - nFMInterpolation = 1; - break; - case MENU_INTERPOLATE_FM_3: - nFMInterpolation = 3; - break; - - case MENU_DSOUND_BASS: - nAudDSPModule[0] = !nAudDSPModule[0]; - break; - - case MENU_XAUDIO_BASS: - nAudDSPModule[1] ^= 1; - break; - - case MENU_XAUDIO_REVERB: - nAudDSPModule[1] ^= 2; - break; - - case MENU_WLOGSTART: - AudBlankSound(); - WaveLogStart(); - break; - - case MENU_WLOGEND: - AudBlankSound(); - WaveLogStop(); - break; - - case MENU_AUTOPAUSE: - bAutoPause = !bAutoPause; - break; - - case MENU_PROCESSINPUT: - bAlwaysProcessKeyboardInput = !bAlwaysProcessKeyboardInput; - break; - - case MENU_DISPLAYINDICATOR: - nVidSDisplayStatus = !nVidSDisplayStatus; -// VidRedraw(); - VidPaint(2); - break; - - case MENU_MODELESS: - bModelessMenu = !bModelessMenu; - POST_INITIALISE_MESSAGE; - break; - - case MENU_NOCHANGENUMLOCK: - bNoChangeNumLock = !bNoChangeNumLock; - break; - - case MENU_CREATEDIRS: - bAlwaysCreateSupportFolders = !bAlwaysCreateSupportFolders; - break; - - case MENU_SAVEHISCORES: - EnableHiscores = !EnableHiscores; - break; - - case MENU_USEBLEND: - bBurnUseBlend = !bBurnUseBlend; - break; - - case MENU_GEARSHIFT: - BurnShiftEnabled = !BurnShiftEnabled; - break; - -#ifdef INCLUDE_AVI_RECORDING - case MENU_AVI1X: - nAvi3x = 1; - break; - - case MENU_AVI2X: - nAvi3x = 2; - break; - - case MENU_AVI3X: - nAvi3x = 3; - break; -#endif - - case MENU_ROMDIRS: - RomsDirCreate(hScrnWnd); - break; - - case MENU_SUPPORTDIRS: - SupportDirCreate(hScrnWnd); - break; - - case MENU_LANGUAGE_SELECT: - if (UseDialogs()) { - FBALocaliseLoadTemplate(); - POST_INITIALISE_MESSAGE; - } - break; - case MENU_LANGUAGE_EXPORT: - if (UseDialogs()) { - FBALocaliseCreateTemplate(); - } - break; - case MENU_LANGUAGE_RESET: - szLocalisationTemplate[0] = _T('\0'); - FBALocaliseInit(szLocalisationTemplate); - POST_INITIALISE_MESSAGE; - break; - case MENU_LANGUAGE_DOWNLOAD: - if (UseDialogs()) { - LocaliseDownloadCreate(hScrnWnd); - } - break; - - case MENU_LANGUAGE_GL_SELECT: - if (UseDialogs()) { - FBALocaliseGamelistLoadTemplate(); - } - break; - case MENU_LANGUAGE_GL_EXPORT: - if (UseDialogs()) { - FBALocaliseGamelistCreateTemplate(); - } - break; - case MENU_LANGUAGE_GL_RESET: - szGamelistLocalisationTemplate[0] = _T('\0'); - nGamelistLocalisationActive = false; - break; - - case MENU_ENABLEICONS: { - bEnableIcons = !bEnableIcons; - if(!bEnableIcons && bIconsLoaded) { - // unload icons - UnloadDrvIcons(); - bIconsLoaded = 0; - } - if(bEnableIcons && !bIconsLoaded) { - // load icons - LoadDrvIcons(); - bIconsLoaded = 1; - } - break; - } - - case MENU_ICONS_SIZE_16: { - nIconsSize = ICON_16x16; - if(bEnableIcons && bIconsLoaded) { - // unload icons - UnloadDrvIcons(); - bIconsLoaded = 0; - // load icons - LoadDrvIcons(); - bIconsLoaded = 1; - } - if(bEnableIcons && !bIconsLoaded) { - // load icons - LoadDrvIcons(); - bIconsLoaded = 1; - } - break; - } - - case MENU_ICONS_SIZE_24: { - nIconsSize = ICON_24x24; - if(bEnableIcons && bIconsLoaded) { - // unload icons - UnloadDrvIcons(); - bIconsLoaded = 0; - // load icons - LoadDrvIcons(); - bIconsLoaded = 1; - } - if(bEnableIcons && !bIconsLoaded) { - // load icons - LoadDrvIcons(); - bIconsLoaded = 1; - } - break; - } - - case MENU_ICONS_SIZE_32: { - nIconsSize = ICON_32x32; - if(bEnableIcons && bIconsLoaded) { - // unload icons - UnloadDrvIcons(); - bIconsLoaded = 0; - // load icons - LoadDrvIcons(); - bIconsLoaded = 1; - } - if(bEnableIcons && !bIconsLoaded) { - // load icons - LoadDrvIcons(); - bIconsLoaded = 1; - } - break; - } - - case MENU_INPUT_AUTOFIRE_RATE_1: nAutoFireRate = 22; break; - case MENU_INPUT_AUTOFIRE_RATE_2: nAutoFireRate = 12; break; - case MENU_INPUT_AUTOFIRE_RATE_3: nAutoFireRate = 8; break; - case MENU_INPUT_AUTOFIRE_RATE_4: nAutoFireRate = 4; break; - - case MENU_PRIORITY_REALTIME: - nAppThreadPriority = THREAD_PRIORITY_TIME_CRITICAL; - SetThreadPriority(GetCurrentThread(), nAppThreadPriority); - break; - case MENU_PRIORITY_HIGH: - nAppThreadPriority = THREAD_PRIORITY_HIGHEST; - SetThreadPriority(GetCurrentThread(), nAppThreadPriority); - break; - case MENU_PRIORITY_ABOVE_NORMAL: - nAppThreadPriority = THREAD_PRIORITY_ABOVE_NORMAL; - SetThreadPriority(GetCurrentThread(), nAppThreadPriority); - break; - case MENU_PRIORITY_NORMAL: - nAppThreadPriority = THREAD_PRIORITY_NORMAL; - SetThreadPriority(GetCurrentThread(), nAppThreadPriority); - break; - case MENU_PRIORITY_BELOW_NORMAL: - nAppThreadPriority = THREAD_PRIORITY_BELOW_NORMAL; - SetThreadPriority(GetCurrentThread(), nAppThreadPriority); - break; - case MENU_PRIORITY_LOW: - nAppThreadPriority = THREAD_PRIORITY_LOWEST; - SetThreadPriority(GetCurrentThread(), nAppThreadPriority); - break; - - case MENU_CLRMAME_PRO_XML: - if (UseDialogs()) { - CreateDatfileWindows(DAT_ARCADE_ONLY); - } - break; - - case MENU_CLRMAME_PRO_XML_MD_ONLY: - if (UseDialogs()) { - CreateDatfileWindows(DAT_MEGADRIVE_ONLY); - } - break; - - case MENU_CLRMAME_PRO_XML_PCE_ONLY: - if (UseDialogs()) { - CreateDatfileWindows(DAT_PCENGINE_ONLY); - } - break; - - case MENU_CLRMAME_PRO_XML_TG16_ONLY: - if (UseDialogs()) { - CreateDatfileWindows(DAT_TG16_ONLY); - } - break; - - case MENU_CLRMAME_PRO_XML_SGX_ONLY: - if (UseDialogs()) { - CreateDatfileWindows(DAT_SGX_ONLY); - } - break; - - case MENU_CLRMAME_PRO_XML_SG1000_ONLY: - if (UseDialogs()) { - CreateDatfileWindows(DAT_SG1000_ONLY); - } - break; - - case MENU_CLRMAME_PRO_XML_COLECO_ONLY: - if (UseDialogs()) { - CreateDatfileWindows(DAT_COLECO_ONLY); - } - break; - - case MENU_CLRMAME_PRO_XML_SMS_ONLY: - if (UseDialogs()) { - CreateDatfileWindows(DAT_MASTERSYSTEM_ONLY); - } - break; - - case MENU_CLRMAME_PRO_XML_GG_ONLY: - if (UseDialogs()) { - CreateDatfileWindows(DAT_GAMEGEAR_ONLY); - } - break; - - case MENU_CLRMAME_PRO_XML_MSX_ONLY: - if (UseDialogs()) { - CreateDatfileWindows(DAT_MSX_ONLY); - } - break; - - case MENU_CLRMAME_PRO_ALL_DATS: - if (UseDialogs()) { - CreateAllDatfilesWindows(); - } - break; - - case MENU_ENABLECHEAT: - AudBlankSound(); - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - InpCheatCreate(); - break; - - case MENU_DEBUG: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - DebugCreate(); - } - break; - - case MENU_PALETTEVIEWER: { - AudBlankSound(); - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - PaletteViewerDialogCreate(hScrnWnd); - break; - } - -#ifdef BUILD_A68K - case MENU_ASSEMBLYCORE: - bBurnUseASMCPUEmulation = !bBurnUseASMCPUEmulation; - break; -#endif - - case MENU_SAVESNAP: { - if (bDrvOkay) { - int status = MakeScreenShot(); - - if (!status) { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_SSHOT_SAVED, true)); - } else { - TCHAR tmpmsg[256]; - - _sntprintf(tmpmsg, 256, FBALoadStringEx(hAppInst, IDS_SSHOT_ERROR, true), status); - VidSNewShortMsg(tmpmsg, 0xFF3F3F); - } - } - break; - } - - case MENU_SNAPFACT: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - SFactdCreate(); - } - break; - - case MENU_CHEATSEARCH_START: { - CheatSearchStart(); - - TCHAR szText[100]; - _stprintf(szText, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_NEW, true)); - VidSAddChatMsg(NULL, 0xFFFFFF, szText, 0xFFBFBF); - - EnableMenuItem(hMenu, MENU_CHEATSEARCH_NOCHANGE, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_CHANGE, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_DECREASE, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_INCREASE, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_DUMPFILE, MF_ENABLED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_EXIT, MF_ENABLED | MF_BYCOMMAND); - break; - } - - case MENU_CHEATSEARCH_NOCHANGE: { - TCHAR tmpmsg[256]; - unsigned int nValues = CheatSearchValueNoChange(); - - _stprintf(tmpmsg, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_ADD_MATCH, true), nValues); - VidSAddChatMsg(NULL, 0xFFFFFF, tmpmsg, 0xFFBFBF); - - if (nValues <= CHEATSEARCH_SHOWRESULTS) { - for (unsigned int i = 0; i < nValues; i++) { - _stprintf(tmpmsg, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_RESULTS, true), CheatSearchShowResultAddresses[i], CheatSearchShowResultValues[i]); - VidSAddChatMsg(NULL, 0xFFFFFF, tmpmsg, 0xFFBFBF); - } - } - break; - } - - case MENU_CHEATSEARCH_CHANGE: { - TCHAR tmpmsg[256]; - unsigned int nValues = CheatSearchValueChange(); - - _stprintf(tmpmsg, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_ADD_MATCH, true), nValues); - VidSAddChatMsg(NULL, 0xFFFFFF, tmpmsg, 0xFFBFBF); - - if (nValues <= CHEATSEARCH_SHOWRESULTS) { - for (unsigned int i = 0; i < nValues; i++) { - _stprintf(tmpmsg, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_RESULTS, true), CheatSearchShowResultAddresses[i], CheatSearchShowResultValues[i]); - VidSAddChatMsg(NULL, 0xFFFFFF, tmpmsg, 0xFFBFBF); - } - } - break; - } - - case MENU_CHEATSEARCH_DECREASE: { - TCHAR tmpmsg[256]; - unsigned int nValues = CheatSearchValueDecreased(); - - _stprintf(tmpmsg, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_ADD_MATCH, true), nValues); - VidSAddChatMsg(NULL, 0xFFFFFF, tmpmsg, 0xFFBFBF); - - if (nValues <= CHEATSEARCH_SHOWRESULTS) { - for (unsigned int i = 0; i < nValues; i++) { - _stprintf(tmpmsg, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_RESULTS, true), CheatSearchShowResultAddresses[i], CheatSearchShowResultValues[i]); - VidSAddChatMsg(NULL, 0xFFFFFF, tmpmsg, 0xFFBFBF); - } - } - break; - } - - case MENU_CHEATSEARCH_INCREASE: { - TCHAR tmpmsg[256]; - - unsigned int nValues = CheatSearchValueIncreased(); - - _stprintf(tmpmsg, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_ADD_MATCH, true), nValues); - VidSAddChatMsg(NULL, 0xFFFFFF, tmpmsg, 0xFFBFBF); - - if (nValues <= CHEATSEARCH_SHOWRESULTS) { - for (unsigned int i = 0; i < nValues; i++) { - _stprintf(tmpmsg, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_RESULTS, true), CheatSearchShowResultAddresses[i], CheatSearchShowResultValues[i]); - VidSAddChatMsg(NULL, 0xFFFFFF, tmpmsg, 0xFFBFBF); - } - } - break; - } - - case MENU_CHEATSEARCH_DUMPFILE: { - CheatSearchDumptoFile(); - break; - } - - case MENU_CHEATSEARCH_EXIT: { - CheatSearchExit(); - - TCHAR szText[100]; - _stprintf(szText, FBALoadStringEx(hAppInst, IDS_CHEAT_SEARCH_EXIT, true)); - VidSAddChatMsg(NULL, 0xFFFFFF, szText, 0xFFBFBF); - - EnableMenuItem(hMenu, MENU_CHEATSEARCH_NOCHANGE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_CHANGE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_DECREASE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_INCREASE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_DUMPFILE, MF_GRAYED | MF_BYCOMMAND); - EnableMenuItem(hMenu, MENU_CHEATSEARCH_EXIT, MF_GRAYED | MF_BYCOMMAND); - break; - } - - case MENU_ASSOCIATE: - RegisterExtensions(true); - break; - case MENU_DISASSOCIATE: - RegisterExtensions(false); - break; - - case MENU_SAVEGAMEINPUTNOW: - ConfigGameSave(true); - break; - - case MENU_SAVEGAMEINPUT: - bSaveInputs = !bSaveInputs; - break; - - case MENU_SAVESET: - ConfigAppSave(); - break; - - case MENU_LOADSET: - ConfigAppLoad(); - POST_INITIALISE_MESSAGE; - break; - - case MENU_ABOUT: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - AboutCreate(); - GameInpCheckMouse(); - } - break; - case MENU_SYSINFO: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - SystemInfoCreate(); - GameInpCheckMouse(); - } - break; - - case MENU_CONTENTS: { - if (!nVidFullscreen) { - FILE* fp = _tfopen(_T("fba.chm"), _T("r")); - if (fp) { - fclose(fp); - ShellExecute(NULL, _T("open"), _T("fba.chm"), NULL, NULL, SW_SHOWNORMAL); - } - } - break; - } - - case MENU_WHATSNEW: { - if (!nVidFullscreen) { - FILE* fp = _tfopen(_T("whatsnew.html"), _T("r")); - if (fp) { - fclose(fp); - ShellExecute(NULL, _T("open"), _T("whatsnew.html"), NULL, NULL, SW_SHOWNORMAL); - } - } - break; - } - - case MENU_WWW_HOME: - if (!nVidFullscreen) { - ShellExecute(NULL, _T("open"), _T("https://www.fbalpha.com/"), NULL, NULL, SW_SHOWNORMAL); - } - break; - - case MENU_WWW_NSFORUM: - if (!nVidFullscreen) { - ShellExecute(NULL, _T("open"), _T("http://neosource.1emu.net/forums/"), NULL, NULL, SW_SHOWNORMAL); - } - break; - -// default: -// printf(" * Command %i sent.\n"); - - } - - switch (nVidSelect) { - case 0: { - switch (id) { - // Options for the Default DirectDraw blitter - case MENU_BASIC_NORMAL: - bVidScanlines = 0; - POST_INITIALISE_MESSAGE; - break; - case MENU_BASIC_SCAN: - bVidScanlines = 1; - bVidScanHalf = 0; - POST_INITIALISE_MESSAGE; - break; - case MENU_SCAN50: - bVidScanlines = 1; - bVidScanHalf = 1; - POST_INITIALISE_MESSAGE; - break; - - case MENU_BASIC_ROTSCAN: - bVidScanRotate = !bVidScanRotate; - POST_INITIALISE_MESSAGE; - break; - - case MENU_FORCE_FLIP: - bVidForceFlip = !bVidForceFlip; - POST_INITIALISE_MESSAGE; - break; - } - break; - } - case 1: { - switch (id) { - // Options for the Direct3D blitter - case MENU_DISABLEFX: - bVidBilinear = 0; - bVidScanlines = 0; - nVidBlitterOpt[nVidSelect] &= 0xF40200FF; - POST_INITIALISE_MESSAGE; - break; - - case MENU_BILINEAR: - bVidBilinear = !bVidBilinear; - if (bVidOkay && (bRunPause || !bDrvOkay)) { - VidRedraw(); - } - break; - - case MENU_PHOSPHOR: - bVidScanDelay = !bVidScanDelay; - break; - - case MENU_ENHANCED_NORMAL: - nVidBlitterOpt[nVidSelect] &= ~0x00110000; - POST_INITIALISE_MESSAGE; - break; - case MENU_ENHANCED_SCAN: - bVidScanlines = !bVidScanlines; - nVidBlitterOpt[nVidSelect] &= ~0x00010000; - POST_INITIALISE_MESSAGE; - break; - case MENU_RGBEFFECTS: - nVidBlitterOpt[nVidSelect] &= ~0x00100000; - nVidBlitterOpt[nVidSelect] |= 0x00010000; - bVidScanlines = 0; - ScrnSize(); - VidInit(); - if (bVidScanlines) { - ScrnSize(); - VidInit(); - } - if (bVidOkay && (bRunPause || !bDrvOkay)) { - VidRedraw(); - } - break; - case MENU_3DPROJECTION: - nVidBlitterOpt[nVidSelect] &= ~0x00010000; - nVidBlitterOpt[nVidSelect] |= 0x00100000; - POST_INITIALISE_MESSAGE; - break; - - case MENU_EFFECT_AUTO: - nVidBlitterOpt[nVidSelect] &= ~0x001000000; - nVidBlitterOpt[nVidSelect] |= 0x00030000; - POST_INITIALISE_MESSAGE; - if (bVidOkay && (bRunPause || !bDrvOkay)) { - VidRedraw(); - } - break; - case MENU_EFFECT_01: - case MENU_EFFECT_02: - case MENU_EFFECT_03: - case MENU_EFFECT_04: - case MENU_EFFECT_05: - case MENU_EFFECT_06: - case MENU_EFFECT_07: - case MENU_EFFECT_08: - case MENU_EFFECT_09: - case MENU_EFFECT_0A: - case MENU_EFFECT_0B: - case MENU_EFFECT_0C: - case MENU_EFFECT_0D: - case MENU_EFFECT_0E: - case MENU_EFFECT_0F: - case MENU_EFFECT_10: - nVidBlitterOpt[nVidSelect] &= ~0x001300FF; - nVidBlitterOpt[nVidSelect] |= 0x00010008 + id - MENU_EFFECT_01; - POST_INITIALISE_MESSAGE; - if (bVidOkay && (bRunPause || !bDrvOkay)) { - VidRedraw(); - } - break; - - case MENU_ENHANCED_ROTSCAN: - bVidScanRotate = !bVidScanRotate; - POST_INITIALISE_MESSAGE; - break; - - case MENU_PRESCALE: - nVidBlitterOpt[nVidSelect] ^= 0x01000000; - POST_INITIALISE_MESSAGE; - break; - case MENU_SOFTFX: - nVidBlitterOpt[nVidSelect] ^= 0x02000000; - nVidBlitterOpt[nVidSelect] |= 0x01000000; - POST_INITIALISE_MESSAGE; - break; - - case MENU_ENHANCED_SOFT_STRETCH: - case MENU_ENHANCED_SOFT_SCALE2X: - case MENU_ENHANCED_SOFT_SCALE3X: - case MENU_ENHANCED_SOFT_2XPM_LQ: - case MENU_ENHANCED_SOFT_2XPM_HQ: - case MENU_ENHANCED_SOFT_EAGLE: - case MENU_ENHANCED_SOFT_SUPEREAGLE: - case MENU_ENHANCED_SOFT_2XSAI: - case MENU_ENHANCED_SOFT_SUPER2XSAI: - case MENU_ENHANCED_SOFT_SUPEREAGLE_VBA: - case MENU_ENHANCED_SOFT_2XSAI_VBA: - case MENU_ENHANCED_SOFT_SUPER2XSAI_VBA: - case MENU_ENHANCED_SOFT_SUPERSCALE: - case MENU_ENHANCED_SOFT_SUPERSCALE75: - case MENU_ENHANCED_SOFT_HQ2X: - case MENU_ENHANCED_SOFT_HQ3X: - case MENU_ENHANCED_SOFT_HQ4X: - case MENU_ENHANCED_SOFT_HQ2XS_VBA: - case MENU_ENHANCED_SOFT_HQ3XS_VBA: - case MENU_ENHANCED_SOFT_HQ2XS_SNES9X: - case MENU_ENHANCED_SOFT_HQ3XS_SNES9X: - case MENU_ENHANCED_SOFT_HQ2XBOLD: - case MENU_ENHANCED_SOFT_HQ3XBOLD: - case MENU_ENHANCED_SOFT_EPXB: - case MENU_ENHANCED_SOFT_EPXC: - case MENU_ENHANCED_SOFT_2XBR_A: - case MENU_ENHANCED_SOFT_2XBR_B: - case MENU_ENHANCED_SOFT_2XBR_C: - case MENU_ENHANCED_SOFT_3XBR_A: - case MENU_ENHANCED_SOFT_3XBR_B: - case MENU_ENHANCED_SOFT_3XBR_C: - case MENU_ENHANCED_SOFT_4XBR_A: - case MENU_ENHANCED_SOFT_4XBR_B: - case MENU_ENHANCED_SOFT_4XBR_C: - case MENU_ENHANCED_SOFT_DDT3X: { - nVidBlitterOpt[nVidSelect] &= 0x0FFFFFFF; - nVidBlitterOpt[nVidSelect] |= 0x03000000 + ((long long)(id - MENU_ENHANCED_SOFT_STRETCH) << 32); - POST_INITIALISE_MESSAGE; - break; - } - case MENU_ENHANCED_SOFT_AUTOSIZE: - nVidBlitterOpt[nVidSelect] ^= 0x04000000; - POST_INITIALISE_MESSAGE; - break; - - case MENU_ENHANCED_SCANINTENSITY: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - if (!bVidScanlines) { - bVidScanlines = 1; - ScrnSize(); - VidInit(); - VidRedraw(); - } - if (nVidBlitterOpt[nVidSelect] & 0x00010000) { - nVidBlitterOpt[nVidSelect] &= ~0x00010000; - ScrnSize(); - VidInit(); - VidRedraw(); - } - ScanlineDialog(); - GameInpCheckMouse(); - } - break; - - case MENU_PHOSPHORINTENSITY: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - PhosphorDialog(); - bVidScanDelay = 1; - } - break; - - case MENU_3DSCREENANGLE: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - if ((nVidBlitterOpt[nVidSelect] & 0x00100000) == 0) { - nVidBlitterOpt[nVidSelect] &= ~0x00010000; - nVidBlitterOpt[nVidSelect] |= 0x00100000; - ScrnSize(); - VidInit(); - VidRedraw(); - } - ScreenAngleDialog(); - if (!bRunPause) { - GameInpCheckMouse(); - } - } - break; - - case MENU_FORCE_16BIT: - bVidForce16bit = !bVidForce16bit; - VidInit(); - if (bVidOkay && (bRunPause || !bDrvOkay)) { - VidRedraw(); - } - break; - case MENU_TEXTUREMANAGE: - if (nVidTransferMethod != 0) { - nVidTransferMethod = 0; - } else { - nVidTransferMethod = 1; - } - VidInit(); - if (bVidOkay && (bRunPause || !bDrvOkay)) { - VidRedraw(); - } - break; - } - break; - } - case 2: { - switch (id) { - // Options for the DirectDraw Software Effects blitter - case MENU_SOFTFX_SOFT_STRETCH: - case MENU_SOFTFX_SOFT_SCALE2X: - case MENU_SOFTFX_SOFT_SCALE3X: - case MENU_SOFTFX_SOFT_2XPM_LQ: - case MENU_SOFTFX_SOFT_2XPM_HQ: - case MENU_SOFTFX_SOFT_EAGLE: - case MENU_SOFTFX_SOFT_SUPEREAGLE: - case MENU_SOFTFX_SOFT_2XSAI: - case MENU_SOFTFX_SOFT_SUPER2XSAI: - case MENU_SOFTFX_SOFT_SUPEREAGLE_VBA: - case MENU_SOFTFX_SOFT_2XSAI_VBA: - case MENU_SOFTFX_SOFT_SUPER2XSAI_VBA: - case MENU_SOFTFX_SOFT_SUPERSCALE: - case MENU_SOFTFX_SOFT_SUPERSCALE75: - case MENU_SOFTFX_SOFT_HQ2X: - case MENU_SOFTFX_SOFT_HQ3X: - case MENU_SOFTFX_SOFT_HQ4X: - case MENU_SOFTFX_SOFT_HQ2XS_VBA: - case MENU_SOFTFX_SOFT_HQ3XS_VBA: - case MENU_SOFTFX_SOFT_HQ2XS_SNES9X: - case MENU_SOFTFX_SOFT_HQ3XS_SNES9X: - case MENU_SOFTFX_SOFT_HQ2XBOLD: - case MENU_SOFTFX_SOFT_HQ3XBOLD: - case MENU_SOFTFX_SOFT_EPXB: - case MENU_SOFTFX_SOFT_EPXC: - case MENU_SOFTFX_SOFT_2XBR_A: - case MENU_SOFTFX_SOFT_2XBR_B: - case MENU_SOFTFX_SOFT_2XBR_C: - case MENU_SOFTFX_SOFT_3XBR_A: - case MENU_SOFTFX_SOFT_3XBR_B: - case MENU_SOFTFX_SOFT_3XBR_C: - case MENU_SOFTFX_SOFT_4XBR_A: - case MENU_SOFTFX_SOFT_4XBR_B: - case MENU_SOFTFX_SOFT_4XBR_C: - case MENU_SOFTFX_SOFT_DDT3X: - nVidBlitterOpt[nVidSelect] &= ~0xFF; - nVidBlitterOpt[nVidSelect] |= id - MENU_SOFTFX_SOFT_STRETCH; - POST_INITIALISE_MESSAGE; - break; - - case MENU_SOFTFX_SOFT_AUTOSIZE: - nVidBlitterOpt[nVidSelect] ^= 0x0100; - POST_INITIALISE_MESSAGE; - break; - case MENU_SOFT_DIRECTACCESS: - nVidBlitterOpt[nVidSelect] ^= 0x0200; - POST_INITIALISE_MESSAGE; - break; - } - break; - } - case 3: - switch (id) { - // Options for the DirectX Graphics 9 blitter - case MENU_DX9_POINT: - nVidBlitterOpt[nVidSelect] &= ~(3 << 24); - nVidBlitterOpt[nVidSelect] |= (0 << 24); - POST_INITIALISE_MESSAGE; - break; - case MENU_DX9_LINEAR: - nVidBlitterOpt[nVidSelect] &= ~(3 << 24); - nVidBlitterOpt[nVidSelect] |= (1 << 24); - POST_INITIALISE_MESSAGE; - break; - case MENU_DX9_CUBIC: - nVidBlitterOpt[nVidSelect] &= ~(3 << 24); - nVidBlitterOpt[nVidSelect] |= (2 << 24); - POST_INITIALISE_MESSAGE; - break; - - case MENU_DX9_CUBIC_LIGHT: - dVidCubicB = 0.0; - dVidCubicC = 0.0; - VidRedraw(); - break; - case MENU_DX9_CUBIC_BSPLINE: - dVidCubicB = 1.0; - dVidCubicC = 0.0; - VidRedraw(); - break; - case MENU_DX9_CUBIC_NOTCH: - dVidCubicB = 3.0 / 2.0; - dVidCubicC = -0.25; - VidRedraw(); - break; - case MENU_DX9_CUBIC_OPTIMAL: - dVidCubicB = 1.0 / 3.0; - dVidCubicC = 1.0 / 3.0; - VidRedraw(); - break; - case MENU_DX9_CUBIC_CATMULL: - dVidCubicB = 0.0; - dVidCubicC = 0.5; - VidRedraw(); - break; - case MENU_DX9_CUBIC_SHARP: - dVidCubicB = 0.0; - dVidCubicC = 1.0; - VidRedraw(); - break; - -/* - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - if ((nVidBlitterOpt[nVidSelect] & (3 << 24)) != (2 << 24)) { - nVidBlitterOpt[nVidSelect] &= ~(3 << 24); - nVidBlitterOpt[nVidSelect] |= (2 << 24); - ScrnSize(); - VidInit(); - VidRedraw(); - } - CubicSharpnessDialog(); - GameInpCheckMouse(); - } - break; -*/ - - case MENU_EXP_SCAN: - bVidScanlines = !bVidScanlines; - POST_INITIALISE_MESSAGE; - break; - case MENU_EXP_SCANINTENSITY: - if (UseDialogs()) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - if (!bVidScanlines) { - bVidScanlines = 1; - ScrnSize(); - VidInit(); - VidRedraw(); - } - ScanlineDialog(); - GameInpCheckMouse(); - } - break; - - case MENU_DX9_FPTERXTURES: - POST_INITIALISE_MESSAGE; - break; - - case MENU_DX9_FORCE_PS14: - nVidBlitterOpt[nVidSelect] ^= (1 << 9); - POST_INITIALISE_MESSAGE; - break; - - case MENU_DX9_CUBIC0: - nVidBlitterOpt[nVidSelect] &= ~(7 << 28); - nVidBlitterOpt[nVidSelect] |= (0 << 28); - - nVidBlitterOpt[nVidSelect] |= (1 << 8); - nVidBlitterOpt[nVidSelect] |= (1 << 9); - POST_INITIALISE_MESSAGE; - break; - case MENU_DX9_CUBIC1: - nVidBlitterOpt[nVidSelect] &= ~(7 << 28); - nVidBlitterOpt[nVidSelect] |= (1 << 28); - - nVidBlitterOpt[nVidSelect] |= (1 << 8); - nVidBlitterOpt[nVidSelect] |= (1 << 9); - POST_INITIALISE_MESSAGE; - break; - case MENU_DX9_CUBIC2: - nVidBlitterOpt[nVidSelect] &= ~(7 << 28); - nVidBlitterOpt[nVidSelect] |= (2 << 28); - - nVidBlitterOpt[nVidSelect] |= (1 << 8); - nVidBlitterOpt[nVidSelect] |= (1 << 9); - POST_INITIALISE_MESSAGE; - break; - case MENU_DX9_CUBIC3: - nVidBlitterOpt[nVidSelect] &= ~(7 << 28); - nVidBlitterOpt[nVidSelect] |= (3 << 28); - - nVidBlitterOpt[nVidSelect] |= (1 << 8); - nVidBlitterOpt[nVidSelect] |= (1 << 9); - POST_INITIALISE_MESSAGE; - break; - case MENU_DX9_CUBIC4: - nVidBlitterOpt[nVidSelect] &= ~(7 << 28); - nVidBlitterOpt[nVidSelect] |= (4 << 28); - - nVidBlitterOpt[nVidSelect] &= ~(1 << 8); - nVidBlitterOpt[nVidSelect] &= ~(1 << 9); - POST_INITIALISE_MESSAGE; - break; - - } - break; - case 4: - switch (id) { - // Options for the DirectX Graphics 9 Alternate blitter - case MENU_DX9_ALT_POINT: - bVidDX9Bilinear = 0; - POST_INITIALISE_MESSAGE; - break; - - case MENU_DX9_ALT_LINEAR: - bVidDX9Bilinear = 1; - POST_INITIALISE_MESSAGE; - break; - - case MENU_DX9_ALT_SOFT_STRETCH: - case MENU_DX9_ALT_SOFT_SCALE2X: - case MENU_DX9_ALT_SOFT_SCALE3X: - case MENU_DX9_ALT_SOFT_2XPM_LQ: - case MENU_DX9_ALT_SOFT_2XPM_HQ: - case MENU_DX9_ALT_SOFT_EAGLE: - case MENU_DX9_ALT_SOFT_SUPEREAGLE: - case MENU_DX9_ALT_SOFT_2XSAI: - case MENU_DX9_ALT_SOFT_SUPER2XSAI: - case MENU_DX9_ALT_SOFT_SUPEREAGLE_VBA: - case MENU_DX9_ALT_SOFT_2XSAI_VBA: - case MENU_DX9_ALT_SOFT_SUPER2XSAI_VBA: - case MENU_DX9_ALT_SOFT_SUPERSCALE: - case MENU_DX9_ALT_SOFT_SUPERSCALE75: - case MENU_DX9_ALT_SOFT_HQ2X: - case MENU_DX9_ALT_SOFT_HQ3X: - case MENU_DX9_ALT_SOFT_HQ4X: - case MENU_DX9_ALT_SOFT_HQ2XS_VBA: - case MENU_DX9_ALT_SOFT_HQ3XS_VBA: - case MENU_DX9_ALT_SOFT_HQ2XS_SNES9X: - case MENU_DX9_ALT_SOFT_HQ3XS_SNES9X: - case MENU_DX9_ALT_SOFT_HQ2XBOLD: - case MENU_DX9_ALT_SOFT_HQ3XBOLD: - case MENU_DX9_ALT_SOFT_EPXB: - case MENU_DX9_ALT_SOFT_EPXC: - case MENU_DX9_ALT_SOFT_2XBR_A: - case MENU_DX9_ALT_SOFT_2XBR_B: - case MENU_DX9_ALT_SOFT_2XBR_C: - case MENU_DX9_ALT_SOFT_3XBR_A: - case MENU_DX9_ALT_SOFT_3XBR_B: - case MENU_DX9_ALT_SOFT_3XBR_C: - case MENU_DX9_ALT_SOFT_4XBR_A: - case MENU_DX9_ALT_SOFT_4XBR_B: - case MENU_DX9_ALT_SOFT_4XBR_C: - case MENU_DX9_ALT_SOFT_DDT3X: - nVidBlitterOpt[nVidSelect] &= ~0xFF; - nVidBlitterOpt[nVidSelect] |= id - MENU_DX9_ALT_SOFT_STRETCH; - POST_INITIALISE_MESSAGE; - break; - - case MENU_DX9_ALT_SOFT_AUTOSIZE: - nVidBlitterOpt[nVidSelect] ^= 0x0100; - POST_INITIALISE_MESSAGE; - break; - - case MENU_DX9_ALT_HARDWAREVERTEX: - bVidHardwareVertex = !bVidHardwareVertex; - POST_INITIALISE_MESSAGE; - break; - - case MENU_DX9_ALT_MOTIONBLUR: - bVidMotionBlur = !bVidMotionBlur; - POST_INITIALISE_MESSAGE; - break; - - case MENU_DX9_ALT_FORCE_16BIT: - bVidForce16bitDx9Alt = !bVidForce16bitDx9Alt; - POST_INITIALISE_MESSAGE; - break; - } - break; - } - - if (hwndChat) { - switch (codeNotify) { - case EN_CHANGE: { - bEditTextChanged = true; - SendMessage(hwndChat, WM_GETTEXT, (WPARAM)MAX_CHAT_SIZE + 1, (LPARAM)EditText); - break; - } - case EN_KILLFOCUS: { - SetFocus(hwndChat); - break; - } - case EN_MAXTEXT: { - VidSNewShortMsg(FBALoadStringEx(hAppInst, IDS_NETPLAY_TOOMUCH, true), 0xFF3F3F); - break; - } - } - } - - MenuUpdate(); -} - -// Block screensaver and windows menu if needed -static int OnSysCommand(HWND, UINT sysCommand, int, int) -{ - switch (sysCommand) { - case SC_MONITORPOWER: - case SC_SCREENSAVE: { - if (!bRunPause && bDrvOkay) { - return 1; - } - break; - } - case SC_KEYMENU: - case SC_MOUSEMENU: { - if (kNetGame && !bModelessMenu) { - return 1; - } - break; - } - } - - return 0; -} - -static void OnSize(HWND, UINT state, int cx, int cy) -{ - if (state == SIZE_MINIMIZED) { - bMaximised = false; - } else { - bool bSizeChanged = false; - - MoveWindow(hRebar, 0, 0, cx, nMenuHeight, TRUE); - - if (hwndChat) { - MoveWindow(hwndChat, 0, cy - 32, cx, 32, FALSE); - } - - if (state == SIZE_MAXIMIZED) { - if (!bMaximised) { - bSizeChanged = true; - } - bMaximised = true; - } - if (state == SIZE_RESTORED) { - if (bMaximised) { - bSizeChanged = true; - } - bMaximised = false; - } - - if (bSizeChanged) { - RefreshWindow(true); - } else { - RefreshWindow(false); - } - } -} - -static void OnEnterSizeMove(HWND) -{ - RECT rect; - - AudBlankSound(); - - GetClientRect(hScrnWnd, &rect); - nPrevWidth = rect.right; - nPrevHeight = rect.bottom; -} - -static void OnExitSizeMove(HWND) -{ - RECT rect; - - GetClientRect(hScrnWnd, &rect); - if (rect.right != nPrevWidth || rect.bottom != nPrevHeight) { - RefreshWindow(true); - } - - GetWindowRect(hScrnWnd, &rect); - nWindowPosX = rect.left; - nWindowPosY = rect.top; -} - -static void OnEnterIdle(HWND /*hwnd*/, UINT /*source*/, HWND /*hwndSource*/) -{ - MSG Message; - - // Modeless dialog is idle - while (kNetGame && !PeekMessage(&Message, NULL, 0, 0, PM_NOREMOVE)) { - RunIdle(); - } -} - -static void OnEnterMenuLoop(HWND, BOOL) -{ - if (!bModelessMenu) { - InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput); - AudBlankSound(); - } else { - if (!kNetGame && bAutoPause) { - bRunPause = 1; - } - } -} - -static void OnExitMenuLoop(HWND, BOOL) -{ - if (!bModelessMenu) { - GameInpCheckMouse(); - } -} - -static int ScrnRegister() -{ - WNDCLASSEX WndClassEx; - ATOM Atom = 0; - - // Register the window class - memset(&WndClassEx, 0, sizeof(WndClassEx)); // Init structure to all zeros - WndClassEx.cbSize = sizeof(WndClassEx); - WndClassEx.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_CLASSDC;// These cause flicker in the toolbar - WndClassEx.lpfnWndProc = ScrnProc; - WndClassEx.hInstance = hAppInst; - WndClassEx.hIcon = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_APP)); - WndClassEx.hCursor = LoadCursor(NULL, IDC_ARROW); - WndClassEx.hbrBackground = static_cast( GetStockObject ( BLACK_BRUSH )); - WndClassEx.lpszClassName = szClass; - - // Register the window class with the above information: - Atom = RegisterClassEx(&WndClassEx); - if (Atom) { - return 0; - } else { - return 1; - } -} - -int ScrnSize() -{ - int x, y, w, h, ew, eh; - int nScrnWidth, nScrnHeight; - int nBmapWidth = nVidImageWidth, nBmapHeight = nVidImageHeight; - int nGameAspectX = 4, nGameAspectY = 3; - int nMaxSize; - - SystemParametersInfo(SPI_GETWORKAREA, 0, &SystemWorkArea, 0); // Find the size of the visible WorkArea - - if (hScrnWnd == NULL || nVidFullscreen) { - return 1; - } - - if (bDrvOkay) { - if ((BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) && (nVidRotationAdjust & 1)) { - BurnDrvGetVisibleSize(&nBmapHeight, &nBmapWidth); - BurnDrvGetAspect(&nGameAspectY, &nGameAspectX); - } else { - BurnDrvGetVisibleSize(&nBmapWidth, &nBmapHeight); - BurnDrvGetAspect(&nGameAspectX, &nGameAspectY); - } - - if (nBmapWidth <= 0 || nBmapHeight <= 0) { - return 1; - } - } - - nDragX = GetSystemMetrics(SM_CXDRAG) / 2; - nDragY = GetSystemMetrics(SM_CYDRAG) / 2; - - nScrnWidth = SystemWorkArea.right - SystemWorkArea.left; - nScrnHeight = SystemWorkArea.bottom - SystemWorkArea.top; - - if (nVidSelect == 2 && nVidBlitterOpt[2] & 0x0100) { // The Software effects blitter uses a fixed size - nMaxSize = 9; - } else { - if (nWindowSize) { - nMaxSize = nWindowSize; - } else { - if (nBmapWidth < nBmapHeight) { - if (SystemWorkArea.bottom - SystemWorkArea.top <= 600) { - nMaxSize = 1; - } else { - if (SystemWorkArea.bottom - SystemWorkArea.top <= 960) { - nMaxSize = 2; - } else { - if (SystemWorkArea.bottom - SystemWorkArea.top <= 1280) { - nMaxSize = 3; - } else { - nMaxSize = 4; - } - } - } - } else { - if (SystemWorkArea.right - SystemWorkArea.left <= 640) { - nMaxSize = 1; - } else { - if (SystemWorkArea.right - SystemWorkArea.left <= 1152) { - nMaxSize = 2; - } else { - if (SystemWorkArea.right - SystemWorkArea.left <= 1600) { - nMaxSize = 3; - } else { - nMaxSize = 4; - } - } - } - } - } - } - - // Find the width and height - w = nScrnWidth; - h = nScrnHeight; - - // Find out how much space is taken up by the borders - ew = GetSystemMetrics(SM_CXSIZEFRAME) << 1; - eh = GetSystemMetrics(SM_CYSIZEFRAME) << 1; - - // Visual Studio 2012 (seems to have an issue with these, other reports on the web about it too -#if defined _MSC_VER - #if _MSC_VER >= 1700 - // using the old XP supporting SDK we don't need to alter anything - #if !defined BUILD_VS_XP_TARGET - ew <<= 1; - eh <<= 1; - #endif - #endif -#endif - - if (bMenuEnabled) { - eh += GetSystemMetrics(SM_CYCAPTION); - eh += nMenuHeight; - } else { - eh += 1 << 1; - ew += 1 << 1; - } - - if (bMenuEnabled || !bVidScanlines || nVidSelect == 2) { - // Subtract the border space - w -= ew; - h -= eh; - } - - if ((bVidCorrectAspect || bVidFullStretch) && !(nVidSelect == 2 && (nVidBlitterOpt[2] & 0x0100) == 0)) { - int ww = w; - int hh = h; - - do { - if (nBmapWidth < nBmapHeight && bVidScanRotate) { - if (ww > nBmapWidth * nMaxSize) { - ww = nBmapWidth * nMaxSize; - } - if (hh > ww * nVidScrnAspectX * nGameAspectY * nScrnHeight / (nScrnWidth * nVidScrnAspectY * nGameAspectX)) { - hh = ww * nVidScrnAspectX * nGameAspectY * nScrnHeight / (nScrnWidth * nVidScrnAspectY * nGameAspectX); - } - } else { - if (hh > nBmapHeight * nMaxSize) { - hh = nBmapHeight * nMaxSize; - } - if (ww > hh * nVidScrnAspectY * nGameAspectX * nScrnWidth / (nScrnHeight * nVidScrnAspectX * nGameAspectY)) { - ww = hh * nVidScrnAspectY * nGameAspectX * nScrnWidth / (nScrnHeight * nVidScrnAspectX * nGameAspectY); - } - } - } while ((ww > w || hh > h) && nMaxSize-- > 1); - w = ww; - h = hh; - } else { - while ((nBmapWidth * nMaxSize > w || nBmapHeight * nMaxSize > h) && nMaxSize > 1) { - nMaxSize--; - } - - if (w > nBmapWidth * nMaxSize || h > nBmapHeight * nMaxSize) { - w = nBmapWidth * nMaxSize; - h = nBmapHeight * nMaxSize; - } - } - - if (!bDrvOkay) { - if (w < 304) w = 304; - if (h < 224) h = 224; - } - - RECT rect = { 0, 0, w, h }; - VidImageSize(&rect, nBmapWidth, nBmapHeight); - w = rect.right - rect.left + ew; - h = rect.bottom - rect.top + eh; - - x = nWindowPosX; y = nWindowPosY; - if (x + w > SystemWorkArea.right || y + h > SystemWorkArea.bottom) { - // Find the midpoint for the window - x = SystemWorkArea.left + SystemWorkArea.right; - x /= 2; - y = SystemWorkArea.bottom + SystemWorkArea.top; - y /= 2; - - x -= w / 2; - y -= h / 2; - } - - MenuUpdate(); - - bMaximised = false; - - MoveWindow(hScrnWnd, x, y, w, h, true); - -// SetWindowPos(hScrnWnd, NULL, x, y, w, h, SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOSENDCHANGING | SWP_NOZORDER); - - nWindowPosX = x; nWindowPosY = y; - - return 0; -} - -#include "neocdlist.h" - -int ScrnTitle() -{ - TCHAR szText[1024] = _T(""); - - // Create window title - if (bDrvOkay) { - TCHAR* pszPosition = szText; - TCHAR* pszName = BurnDrvGetText(DRV_FULLNAME); - - pszPosition += _sntprintf(szText, 1024, _T(APP_TITLE) _T( " v%.20s") _T(SEPERATOR_1) _T("%s"), szAppBurnVer, pszName); - while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) { - if (pszPosition + _tcslen(pszName) - 1024 > szText) { - break; - } - pszPosition += _stprintf(pszPosition, _T(SEPERATOR_2) _T("%s"), pszName); - } - - if(NeoCDInfo_Init()) { - return 0; - } - - } else { - _stprintf(szText, _T(APP_TITLE) _T( " v%.20s") _T(SEPERATOR_1) _T("[%s]"), szAppBurnVer, FBALoadStringEx(hAppInst, IDS_SCRN_NOGAME, true)); - } - - SetWindowText(hScrnWnd, szText); - return 0; -} - - -// Init the screen window (create it) -int ScrnInit() -{ - REBARINFO rebarInfo; - REBARBANDINFO rebarBandInfo; - RECT rect; - int nWindowStyles, nWindowExStyles; - - ScrnExit(); - - if (ScrnRegister() != 0) { - return 1; - } - - if (nVidFullscreen) { - nWindowStyles = WS_POPUP; - nWindowExStyles = 0; - } else { - if (bMenuEnabled) { - nWindowStyles = WS_OVERLAPPEDWINDOW; - nWindowExStyles = 0; - } else { - nWindowStyles = WS_MINIMIZEBOX | WS_POPUP | WS_SYSMENU | WS_THICKFRAME; - nWindowExStyles = WS_EX_CLIENTEDGE; - } - } - - hScrnWnd = CreateWindowEx(nWindowExStyles, szClass, _T(APP_TITLE), nWindowStyles, - 0, 0, 0, 0, // size of window - NULL, NULL, hAppInst, NULL); - - if (hScrnWnd == NULL) { - ScrnExit(); - return 1; - } - - nMenuHeight = 0; - if (!nVidFullscreen) { - - // Create the menu toolbar itself - MenuCreate(); - - // Create the toolbar - if (bMenuEnabled) { - // Create the Rebar control that will contain the menu toolbar - hRebar = CreateWindowEx(WS_EX_TOOLWINDOW, - REBARCLASSNAME, NULL, - RBS_BANDBORDERS | CCS_NOPARENTALIGN | CCS_NODIVIDER | WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, - 0, 0, 0, 0, - hScrnWnd, NULL, hAppInst, NULL); - - rebarInfo.cbSize = sizeof(REBARINFO); - rebarInfo.fMask = 0; - rebarInfo.himl = NULL; - - SendMessage(hRebar, RB_SETBARINFO, 0, (LPARAM)&rebarInfo); - - // Add the menu toolbar to the rebar - GetWindowRect(hMenubar, &rect); - - rebarBandInfo.cbSize = sizeof(REBARBANDINFO); - rebarBandInfo.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_STYLE;// | RBBIM_BACKGROUND; - rebarBandInfo.fStyle = 0;//RBBS_GRIPPERALWAYS;// | RBBS_FIXEDBMP; - rebarBandInfo.hwndChild = hMenubar; - rebarBandInfo.cxMinChild = 100; - rebarBandInfo.cyMinChild = ((SendMessage(hMenubar, TB_GETBUTTONSIZE, 0, 0)) >> 16) + 1; - rebarBandInfo.cx = rect.right - rect.left; - - SendMessage(hRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rebarBandInfo); - - GetWindowRect(hRebar, &rect); - nMenuHeight = rect.bottom - rect.top; - - } - - ScrnTitle(); - ScrnSize(); - } - - return 0; -} - -// Exit the screen window (destroy it) -int ScrnExit() -{ - // Ensure the window is destroyed - DeActivateChat(); - - if (hRebar) { - DestroyWindow(hRebar); - hRebar = NULL; - } - - if (hScrnWnd) { - DestroyWindow(hScrnWnd); - hScrnWnd = NULL; - } - - UnregisterClass(szClass, hAppInst); // Unregister the scrn class - - MenuDestroy(); - - return 0; -} - -void Reinitialise() -{ - POST_INITIALISE_MESSAGE; - VidReInitialise(); -} diff --git a/jan/src/burner/win32/sel.cpp b/jan/src/burner/win32/sel.cpp deleted file mode 100644 index fa6e44e85..000000000 --- a/jan/src/burner/win32/sel.cpp +++ /dev/null @@ -1,2574 +0,0 @@ -// Driver Selector module -// TreeView Version by HyperYagami -#include "burner.h" -#include - -// reduce the total number of sets by this number - (isgsm, neogeo, nmk004, pgm, skns, ym2608, coleco, msx_msx) -// don't reduce for these as we display them in the list (neogeo, neocdz) -#define REDUCE_TOTAL_SETS_BIOS 8 - -UINT_PTR nTimer = 0; -UINT_PTR nInitPreviewTimer = 0; -int nDialogSelect = -1; // The driver which this dialog selected -int nOldDlgSelected = -1; -bool bDialogCancel = false; - -bool bDrvSelected = false; - -static int nShowMVSCartsOnly = 0; - -HBITMAP hPrevBmp = NULL; -HBITMAP hTitleBmp = NULL; - -HWND hSelDlg = NULL; -static HWND hSelList = NULL; -static HWND hParent = NULL; -static HWND hInfoLabel[6] = { NULL, NULL, NULL, NULL, NULL }; // 4 things in our Info-box -static HWND hInfoText[6] = { NULL, NULL, NULL, NULL, NULL }; // 4 things in our Info-box - -static HBRUSH hWhiteBGBrush; -static HICON hExpand, hCollapse; -static HICON hNotWorking, hNotFoundEss, hNotFoundNonEss; - -static HICON hDrvIconMiss; - -static char TreeBuilding = 0; // if 1, ignore TVN_SELCHANGED messages - -static int bImageOrientation; -static int UpdatePreview(bool bReset, TCHAR *szPath, int HorCtrl, int VerCrtl); - -int nIconsSize = ICON_16x16; -int nIconsSizeXY = 16; -bool bEnableIcons = 0; -bool bIconsLoaded = 0; -int nIconsXDiff; -int nIconsYDiff; -static HICON hDrvIcon[19999]; -bool bGameInfoOpen = false; - -// Dialog Sizing -int nSelDlgWidth = 750; -int nSelDlgHeight = 588; -static int nDlgInitialWidth; -static int nDlgInitialHeight; -static int nDlgOptionsGrpInitialPos[4]; -static int nDlgAvailableChbInitialPos[4]; -static int nDlgUnavailableChbInitialPos[4]; -static int nDlgAlwaysClonesChbInitialPos[4]; -static int nDlgZipnamesChbInitialPos[4]; -static int nDlgLatinTextChbInitialPos[4]; -static int nDlgRomDirsBtnInitialPos[4]; -static int nDlgScanRomsBtnInitialPos[4]; -static int nDlgFilterGrpInitialPos[4]; -static int nDlgFilterTreeInitialPos[4]; -static int nDlgIpsGrpInitialPos[4]; -static int nDlgApplyIpsChbInitialPos[4]; -static int nDlgIpsManBtnInitialPos[4]; -static int nDlgSearchGrpInitialPos[4]; -static int nDlgSearchTxtInitialPos[4]; -static int nDlgCancelBtnInitialPos[4]; -static int nDlgPlayBtnInitialPos[4]; -static int nDlgPreviewGrpInitialPos[4]; -static int nDlgPreviewImgHInitialPos[4]; -static int nDlgPreviewImgVInitialPos[4]; -static int nDlgTitleGrpInitialPos[4]; -static int nDlgTitleImgHInitialPos[4]; -static int nDlgTitleImgVInitialPos[4]; -static int nDlgWhiteBoxInitialPos[4]; -static int nDlgGameInfoLblInitialPos[4]; -static int nDlgRomNameLblInitialPos[4]; -static int nDlgRomInfoLblInitialPos[4]; -static int nDlgReleasedByLblInitialPos[4]; -static int nDlgGenreLblInitialPos[4]; -static int nDlgNotesLblInitialPos[4]; -static int nDlgGameInfoTxtInitialPos[4]; -static int nDlgRomNameTxtInitialPos[4]; -static int nDlgRomInfoTxtInitialPos[4]; -static int nDlgReleasedByTxtInitialPos[4]; -static int nDlgGenreTxtInitialPos[4]; -static int nDlgNotesTxtInitialPos[4]; -static int nDlgDrvCountTxtInitialPos[4]; -static int nDlgDrvRomInfoBtnInitialPos[4]; -static int nDlgSelectGameGrpInitialPos[4]; -static int nDlgSelectGameLstInitialPos[4]; - -// Filter TreeView -HWND hFilterList = NULL; -HTREEITEM hFilterCapcomMisc = NULL; -HTREEITEM hFilterCave = NULL; -HTREEITEM hFilterCps1 = NULL; -HTREEITEM hFilterCps2 = NULL; -HTREEITEM hFilterCps3 = NULL; -HTREEITEM hFilterDataeast = NULL; -HTREEITEM hFilterGalaxian = NULL; -HTREEITEM hFilterIrem = NULL; -HTREEITEM hFilterKaneko = NULL; -HTREEITEM hFilterKonami = NULL; -HTREEITEM hFilterNeogeo = NULL; -HTREEITEM hFilterPacman = NULL; -HTREEITEM hFilterPgm = NULL; -HTREEITEM hFilterPsikyo = NULL; -HTREEITEM hFilterSega = NULL; -HTREEITEM hFilterSeta = NULL; -HTREEITEM hFilterTaito = NULL; -HTREEITEM hFilterTechnos = NULL; -HTREEITEM hFilterToaplan = NULL; -HTREEITEM hFilterMiscPre90s = NULL; -HTREEITEM hFilterMiscPost90s = NULL; -HTREEITEM hFilterMegadrive = NULL; -HTREEITEM hFilterPce = NULL; -//HTREEITEM hFilterSnes = NULL; -HTREEITEM hFilterMsx = NULL; -HTREEITEM hFilterSms = NULL; -HTREEITEM hFilterGg = NULL; -HTREEITEM hFilterSg1000 = NULL; -HTREEITEM hFilterColeco = NULL; -HTREEITEM hFilterBootleg = NULL; -HTREEITEM hFilterDemo = NULL; -HTREEITEM hFilterHack = NULL; -HTREEITEM hFilterHomebrew = NULL; -HTREEITEM hFilterPrototype = NULL; -HTREEITEM hFilterGenuine = NULL; -HTREEITEM hFilterHorshoot = NULL; -HTREEITEM hFilterVershoot = NULL; -HTREEITEM hFilterScrfight = NULL; -HTREEITEM hFilterVsfight = NULL; -HTREEITEM hFilterBios = NULL; -HTREEITEM hFilterBreakout = NULL; -HTREEITEM hFilterCasino = NULL; -HTREEITEM hFilterBallpaddle = NULL; -HTREEITEM hFilterMaze = NULL; -HTREEITEM hFilterMinigames = NULL; -HTREEITEM hFilterPinball = NULL; -HTREEITEM hFilterPlatform = NULL; -HTREEITEM hFilterPuzzle = NULL; -HTREEITEM hFilterQuiz = NULL; -HTREEITEM hFilterSportsmisc = NULL; -HTREEITEM hFilterSportsfootball = NULL; -HTREEITEM hFilterMisc = NULL; -HTREEITEM hFilterMahjong = NULL; -HTREEITEM hFilterRacing = NULL; -HTREEITEM hFilterShoot = NULL; -HTREEITEM hFilterOtherFamily = NULL; -HTREEITEM hFilterMslug = NULL; -HTREEITEM hFilterSf = NULL; -HTREEITEM hFilterKof = NULL; -HTREEITEM hFilterDstlk = NULL; -HTREEITEM hFilterFatfury = NULL; -HTREEITEM hFilterSamsho = NULL; -HTREEITEM hFilter19xx = NULL; -HTREEITEM hFilterSonicwi = NULL; -HTREEITEM hFilterPwrinst = NULL; - -HTREEITEM hRoot = NULL; -HTREEITEM hBoardType = NULL; -HTREEITEM hFamily = NULL; -HTREEITEM hGenre = NULL; -HTREEITEM hFavorites = NULL; -HTREEITEM hHardware = NULL; - -// GCC doesn't seem to define these correctly..... -#define _TreeView_SetItemState(hwndTV, hti, data, _mask) \ -{ TVITEM _ms_TVi;\ - _ms_TVi.mask = TVIF_STATE; \ - _ms_TVi.hItem = hti; \ - _ms_TVi.stateMask = _mask;\ - _ms_TVi.state = data;\ - SNDMSG((hwndTV), TVM_SETITEM, 0, (LPARAM)(TV_ITEM *)&_ms_TVi);\ -} - -#define _TreeView_SetCheckState(hwndTV, hti, fCheck) \ - _TreeView_SetItemState(hwndTV, hti, INDEXTOSTATEIMAGEMASK((fCheck)?2:1), TVIS_STATEIMAGEMASK) - -// ----------------------------------------------------------------------------------------------------------------- - -#define DISABLE_NON_AVAILABLE_SELECT 0 // Disable selecting non-available sets -#define NON_WORKING_PROMPT_ON_LOAD 1 // Prompt user on loading non-working sets - -static int CapcomMiscValue = HARDWARE_PREFIX_CAPCOM_MISC >> 24; -static int MASKCAPMISC = 1 << CapcomMiscValue; -static int CaveValue = HARDWARE_PREFIX_CAVE >> 24; -static int MASKCAVE = 1 << CaveValue; -static int CpsValue = HARDWARE_PREFIX_CAPCOM >> 24; -static int MASKCPS = 1 << CpsValue; -static int Cps2Value = HARDWARE_PREFIX_CPS2 >> 24; -static int MASKCPS2 = 1 << Cps2Value; -static int Cps3Value = HARDWARE_PREFIX_CPS3 >> 24; -static int MASKCPS3 = 1 << Cps3Value; -static int DataeastValue = HARDWARE_PREFIX_DATAEAST >> 24; -static int MASKDATAEAST = 1 << DataeastValue; -static int GalaxianValue = HARDWARE_PREFIX_GALAXIAN >> 24; -static int MASKGALAXIAN = 1 << GalaxianValue; -static int IremValue = HARDWARE_PREFIX_IREM >> 24; -static int MASKIREM = 1 << IremValue; -static int KanekoValue = HARDWARE_PREFIX_KANEKO >> 24; -static int MASKKANEKO = 1 << KanekoValue; -static int KonamiValue = HARDWARE_PREFIX_KONAMI >> 24; -static int MASKKONAMI = 1 << KonamiValue; -static int NeogeoValue = HARDWARE_PREFIX_SNK >> 24; -static int MASKNEOGEO = 1 << NeogeoValue; -static int PacmanValue = HARDWARE_PREFIX_PACMAN >> 24; -static int MASKPACMAN = 1 << PacmanValue; -static int PgmValue = HARDWARE_PREFIX_IGS_PGM >> 24; -static int MASKPGM = 1 << PgmValue; -static int PsikyoValue = HARDWARE_PREFIX_PSIKYO >> 24; -static int MASKPSIKYO = 1 << PsikyoValue; -static int SegaValue = HARDWARE_PREFIX_SEGA >> 24; -static int MASKSEGA = 1 << SegaValue; -static int SetaValue = HARDWARE_PREFIX_SETA >> 24; -static int MASKSETA = 1 << SetaValue; -static int TaitoValue = HARDWARE_PREFIX_TAITO >> 24; -static int MASKTAITO = 1 << TaitoValue; -static int TechnosValue = HARDWARE_PREFIX_TECHNOS >> 24; -static int MASKTECHNOS = 1 << TechnosValue; -static int ToaplanValue = HARDWARE_PREFIX_TOAPLAN >> 24; -static int MASKTOAPLAN = 1 << ToaplanValue; -static int MiscPre90sValue = HARDWARE_PREFIX_MISC_PRE90S >> 24; -static int MASKMISCPRE90S = 1 << MiscPre90sValue; -static int MiscPost90sValue = HARDWARE_PREFIX_MISC_POST90S >> 24; -static int MASKMISCPOST90S = 1 << MiscPost90sValue; -static int MegadriveValue = HARDWARE_PREFIX_SEGA_MEGADRIVE >> 24; -static int MASKMEGADRIVE = 1 << MegadriveValue; -static int PCEngineValue = HARDWARE_PREFIX_PCENGINE >> 24; -static int MASKPCENGINE = 1 << PCEngineValue; -//static int SnesValue = HARDWARE_PREFIX_NINTENDO_SNES >> 24; -//static int MASKSNES = 1 << SnesValue; -static int SmsValue = HARDWARE_PREFIX_SEGA_MASTER_SYSTEM >> 24; -static int MASKSMS = 1 << SmsValue; -static int GgValue = HARDWARE_PREFIX_SEGA_GAME_GEAR >> 24; -static int MASKGG = 1 << GgValue; -static int Sg1000Value = HARDWARE_PREFIX_SEGA_SG1000 >> 24; -static int MASKSG1000 = 1 << Sg1000Value; -static int ColecoValue = HARDWARE_PREFIX_COLECO >> 24; -static int MASKCOLECO = 1 << ColecoValue; -static int MsxValue = HARDWARE_PREFIX_MSX >> 24; -static int MASKMSX = 1 << MsxValue; - -static int MASKALL = MASKCAPMISC | MASKCAVE | MASKCPS | MASKCPS2 | MASKCPS3 | MASKDATAEAST | MASKGALAXIAN | MASKIREM | MASKKANEKO | MASKKONAMI | MASKNEOGEO | MASKPACMAN | MASKPGM | MASKPSIKYO | MASKSEGA | MASKSETA | MASKTAITO | MASKTECHNOS | MASKTOAPLAN | MASKMISCPRE90S | MASKMISCPOST90S | MASKMEGADRIVE | MASKPCENGINE | MASKSMS | MASKGG | MASKSG1000 | MASKCOLECO | MASKMSX; // | MASKSNES - -#define UNAVAILABLE (1 << 27) -#define AVAILABLE (1 << 28) -#define AUTOEXPAND (1 << 29) -#define SHOWSHORT (1 << 30) -#define ASCIIONLY (1 << 31) - -#define MASKBOARDTYPEGENUINE (1) -#define MASKFAMILYOTHER 0x10000000 - -#define MASKALLGENRE (GBF_HORSHOOT | GBF_VERSHOOT | GBF_SCRFIGHT | GBF_VSFIGHT | GBF_BIOS | GBF_BREAKOUT | GBF_CASINO | GBF_BALLPADDLE | GBF_MAZE | GBF_MINIGAMES | GBF_PINBALL | GBF_PLATFORM | GBF_PUZZLE | GBF_QUIZ | GBF_SPORTSMISC | GBF_SPORTSFOOTBALL | GBF_MISC | GBF_MAHJONG | GBF_RACING | GBF_SHOOT) -#define MASKALLFAMILY (MASKFAMILYOTHER | FBF_MSLUG | FBF_SF | FBF_KOF | FBF_DSTLK | FBF_FATFURY | FBF_SAMSHO | FBF_19XX | FBF_SONICWI | FBF_PWRINST) -#define MASKALLBOARD (MASKBOARDTYPEGENUINE | BDF_BOOTLEG | BDF_DEMO | BDF_HACK | BDF_HOMEBREW | BDF_PROTOTYPE) - -int nLoadMenuShowY = 0; -int nLoadMenuShowX = 0; -int nLoadMenuBoardTypeFilter = 0; -int nLoadMenuGenreFilter = 0; -int nLoadMenuFavoritesFilter = 0; -int nLoadMenuFamilyFilter = 0; - -struct NODEINFO { - int nBurnDrvNo; - bool bIsParent; - char* pszROMName; - HTREEITEM hTreeHandle; -}; - -static NODEINFO* nBurnDrv; -static unsigned int nTmpDrvCount; - -// prototype ----------------------- -static void RebuildEverything(); -// ---------------------------------- - -// Dialog sizing support functions and macros (everything working in client co-ords) -#define GetInititalControlPos(a, b) \ - GetWindowRect(GetDlgItem(hSelDlg, a), &rect); \ - memset(&point, 0, sizeof(POINT)); \ - point.x = rect.left; \ - point.y = rect.top; \ - ScreenToClient(hSelDlg, &point); \ - b[0] = point.x; \ - b[1] = point.y; \ - GetClientRect(GetDlgItem(hSelDlg, a), &rect); \ - b[2] = rect.right; \ - b[3] = rect.bottom; - -#define SetControlPosAlignTopRight(a, b) \ - SetWindowPos(GetDlgItem(hSelDlg, a), hSelDlg, b[0] - xDelta, b[1], 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOSENDCHANGING); - -#define SetControlPosAlignTopLeft(a, b) \ - SetWindowPos(GetDlgItem(hSelDlg, a), hSelDlg, b[0], b[1], 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOSENDCHANGING); - -#define SetControlPosAlignBottomRight(a, b) \ - SetWindowPos(GetDlgItem(hSelDlg, a), hSelDlg, b[0] - xDelta, b[1] - yDelta, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOSENDCHANGING); - -#define SetControlPosAlignBottomLeftResizeHor(a, b) \ - SetWindowPos(GetDlgItem(hSelDlg, a), hSelDlg, b[0], b[1] - yDelta, b[2] - xDelta, b[3], SWP_NOZORDER | SWP_NOSENDCHANGING); - -#define SetControlPosAlignTopRightResizeVert(a, b) \ - xScrollBarDelta = (a == IDC_TREE2) ? -18 : 0; \ - SetWindowPos(GetDlgItem(hSelDlg, a), hSelDlg, b[0] - xDelta, b[1], b[2] - xScrollBarDelta, b[3] - yDelta, SWP_NOZORDER | SWP_NOSENDCHANGING); - -#define SetControlPosAlignTopLeftResizeHorVert(a, b) \ - xScrollBarDelta = (a == IDC_TREE1) ? -18 : 0; \ - SetWindowPos(GetDlgItem(hSelDlg, a), hSelDlg, b[0], b[1], b[2] - xDelta - xScrollBarDelta, b[3] - yDelta, SWP_NOZORDER | SWP_NOSENDCHANGING); - -#define SetControlPosAlignTopLeftResizeHorVertALT(a, b) \ - SetWindowPos(GetDlgItem(hSelDlg, a), hSelDlg, b[0], b[1], b[2] - xDelta, b[3] - yDelta, SWP_NOZORDER | SWP_NOSENDCHANGING); - -static void GetInitialPositions() -{ - RECT rect; - POINT point; - - GetClientRect(hSelDlg, &rect); - nDlgInitialWidth = rect.right; - nDlgInitialHeight = rect.bottom; - - GetInititalControlPos(IDC_STATIC_OPT, nDlgOptionsGrpInitialPos); - GetInititalControlPos(IDC_CHECKAVAILABLE, nDlgAvailableChbInitialPos); - GetInititalControlPos(IDC_CHECKUNAVAILABLE, nDlgUnavailableChbInitialPos); - GetInititalControlPos(IDC_CHECKAUTOEXPAND, nDlgAlwaysClonesChbInitialPos); - GetInititalControlPos(IDC_SEL_SHORTNAME, nDlgZipnamesChbInitialPos); - GetInititalControlPos(IDC_SEL_ASCIIONLY, nDlgLatinTextChbInitialPos); - GetInititalControlPos(IDROM, nDlgRomDirsBtnInitialPos); - GetInititalControlPos(IDRESCAN, nDlgScanRomsBtnInitialPos); - GetInititalControlPos(IDC_STATIC_SYS, nDlgFilterGrpInitialPos); - GetInititalControlPos(IDC_TREE2, nDlgFilterTreeInitialPos); - GetInititalControlPos(IDC_SEL_IPSGROUP, nDlgIpsGrpInitialPos); - GetInititalControlPos(IDC_SEL_APPLYIPS, nDlgApplyIpsChbInitialPos); - GetInititalControlPos(IDC_SEL_IPSMANAGER, nDlgIpsManBtnInitialPos); - GetInititalControlPos(IDC_SEL_SEARCHGROUP, nDlgSearchGrpInitialPos); - GetInititalControlPos(IDC_SEL_SEARCH, nDlgSearchTxtInitialPos); - GetInititalControlPos(IDCANCEL, nDlgCancelBtnInitialPos); - GetInititalControlPos(IDOK, nDlgPlayBtnInitialPos); - GetInititalControlPos(IDC_STATIC2, nDlgPreviewGrpInitialPos); - GetInititalControlPos(IDC_SCREENSHOT_H, nDlgPreviewImgHInitialPos); - GetInititalControlPos(IDC_SCREENSHOT_V, nDlgPreviewImgVInitialPos); - GetInititalControlPos(IDC_STATIC3, nDlgTitleGrpInitialPos); - GetInititalControlPos(IDC_SCREENSHOT2_H, nDlgTitleImgHInitialPos); - GetInititalControlPos(IDC_SCREENSHOT2_V, nDlgTitleImgVInitialPos); - GetInititalControlPos(IDC_STATIC_INFOBOX, nDlgWhiteBoxInitialPos); - GetInititalControlPos(IDC_LABELCOMMENT, nDlgGameInfoLblInitialPos); - GetInititalControlPos(IDC_LABELROMNAME, nDlgRomNameLblInitialPos); - GetInititalControlPos(IDC_LABELROMINFO, nDlgRomInfoLblInitialPos); - GetInititalControlPos(IDC_LABELSYSTEM, nDlgReleasedByLblInitialPos); - GetInititalControlPos(IDC_LABELGENRE, nDlgGenreLblInitialPos); - GetInititalControlPos(IDC_LABELNOTES, nDlgNotesLblInitialPos); - GetInititalControlPos(IDC_TEXTCOMMENT, nDlgGameInfoTxtInitialPos); - GetInititalControlPos(IDC_TEXTROMNAME, nDlgRomNameTxtInitialPos); - GetInititalControlPos(IDC_TEXTROMINFO, nDlgRomInfoTxtInitialPos); - GetInititalControlPos(IDC_TEXTSYSTEM, nDlgReleasedByTxtInitialPos); - GetInititalControlPos(IDC_TEXTGENRE, nDlgGenreTxtInitialPos); - GetInititalControlPos(IDC_TEXTNOTES, nDlgNotesTxtInitialPos); - GetInititalControlPos(IDC_DRVCOUNT, nDlgDrvCountTxtInitialPos); - GetInititalControlPos(IDGAMEINFO, nDlgDrvRomInfoBtnInitialPos); - GetInititalControlPos(IDC_STATIC1, nDlgSelectGameGrpInitialPos); - GetInititalControlPos(IDC_TREE1, nDlgSelectGameLstInitialPos); -} - -// Check if a specified driver is working -static bool CheckWorkingStatus(int nDriver) -{ - int nOldnBurnDrvActive = nBurnDrvActive; - nBurnDrvActive = nDriver; - bool bStatus = BurnDrvIsWorking(); - nBurnDrvActive = nOldnBurnDrvActive; - - return bStatus; -} - -static TCHAR* MangleGamename(const TCHAR* szOldName, bool /*bRemoveArticle*/) -{ - static TCHAR szNewName[256] = _T(""); - -#if 0 - TCHAR* pszName = szNewName; - - if (_tcsnicmp(szOldName, _T("the "), 4) == 0) { - int x = 0, y = 0; - while (szOldName[x] && szOldName[x] != _T('(') && szOldName[x] != _T('-')) { - x++; - } - y = x; - while (y && szOldName[y - 1] == _T(' ')) { - y--; - } - _tcsncpy(pszName, szOldName + 4, y - 4); - pszName[y - 4] = _T('\0'); - pszName += y - 4; - - if (!bRemoveArticle) { - pszName += _stprintf(pszName, _T(", the")); - } - if (szOldName[x]) { - _stprintf(pszName, _T(" %s"), szOldName + x); - } - } else { - _tcscpy(pszName, szOldName); - } -#endif - -#if 1 - _tcscpy(szNewName, szOldName); -#endif - - return szNewName; -} - -static int DoExtraFilters() -{ - if (nLoadMenuFavoritesFilter) { - return (CheckFavorites(BurnDrvGetTextA(DRV_NAME)) != -1) ? 0 : 1; - } - - if (nShowMVSCartsOnly && ((BurnDrvGetHardwareCode() & HARDWARE_PREFIX_CARTRIDGE) != HARDWARE_PREFIX_CARTRIDGE)) return 1; - - if ((nLoadMenuBoardTypeFilter & BDF_BOOTLEG) && (BurnDrvGetFlags() & BDF_BOOTLEG)) return 1; - if ((nLoadMenuBoardTypeFilter & BDF_DEMO) && (BurnDrvGetFlags() & BDF_DEMO)) return 1; - if ((nLoadMenuBoardTypeFilter & BDF_HACK) && (BurnDrvGetFlags() & BDF_HACK)) return 1; - if ((nLoadMenuBoardTypeFilter & BDF_HOMEBREW) && (BurnDrvGetFlags() & BDF_HOMEBREW)) return 1; - if ((nLoadMenuBoardTypeFilter & BDF_PROTOTYPE) && (BurnDrvGetFlags() & BDF_PROTOTYPE)) return 1; - - if ((nLoadMenuBoardTypeFilter & MASKBOARDTYPEGENUINE) && (!(BurnDrvGetFlags() & BDF_BOOTLEG)) - && (!(BurnDrvGetFlags() & BDF_DEMO)) - && (!(BurnDrvGetFlags() & BDF_HACK)) - && (!(BurnDrvGetFlags() & BDF_HOMEBREW)) - && (!(BurnDrvGetFlags() & BDF_PROTOTYPE))) return 1; - - if ((nLoadMenuFamilyFilter & FBF_MSLUG) && (BurnDrvGetFamilyFlags() & FBF_MSLUG)) return 1; - if ((nLoadMenuFamilyFilter & FBF_SF) && (BurnDrvGetFamilyFlags() & FBF_SF)) return 1; - if ((nLoadMenuFamilyFilter & FBF_KOF) && (BurnDrvGetFamilyFlags() & FBF_KOF)) return 1; - if ((nLoadMenuFamilyFilter & FBF_DSTLK) && (BurnDrvGetFamilyFlags() & FBF_DSTLK)) return 1; - if ((nLoadMenuFamilyFilter & FBF_FATFURY) && (BurnDrvGetFamilyFlags() & FBF_FATFURY)) return 1; - if ((nLoadMenuFamilyFilter & FBF_SAMSHO) && (BurnDrvGetFamilyFlags() & FBF_SAMSHO)) return 1; - if ((nLoadMenuFamilyFilter & FBF_19XX) && (BurnDrvGetFamilyFlags() & FBF_19XX)) return 1; - if ((nLoadMenuFamilyFilter & FBF_SONICWI) && (BurnDrvGetFamilyFlags() & FBF_SONICWI)) return 1; - if ((nLoadMenuFamilyFilter & FBF_PWRINST) && (BurnDrvGetFamilyFlags() & FBF_PWRINST)) return 1; - - if ((nLoadMenuFamilyFilter & MASKFAMILYOTHER) && (!(BurnDrvGetFamilyFlags() & FBF_MSLUG)) - && (!(BurnDrvGetFamilyFlags() & FBF_SF)) - && (!(BurnDrvGetFamilyFlags() & FBF_KOF)) - && (!(BurnDrvGetFamilyFlags() & FBF_DSTLK)) - && (!(BurnDrvGetFamilyFlags() & FBF_FATFURY)) - && (!(BurnDrvGetFamilyFlags() & FBF_SAMSHO)) - && (!(BurnDrvGetFamilyFlags() & FBF_19XX)) - && (!(BurnDrvGetFamilyFlags() & FBF_SONICWI)) - && (!(BurnDrvGetFamilyFlags() & FBF_PWRINST))) return 1; - - if ((nLoadMenuGenreFilter & GBF_HORSHOOT) && (BurnDrvGetGenreFlags() & GBF_HORSHOOT)) return 1; - if ((nLoadMenuGenreFilter & GBF_VERSHOOT) && (BurnDrvGetGenreFlags() & GBF_VERSHOOT)) return 1; - if ((nLoadMenuGenreFilter & GBF_SCRFIGHT) && (BurnDrvGetGenreFlags() & GBF_SCRFIGHT)) return 1; - if ((nLoadMenuGenreFilter & GBF_VSFIGHT) && (BurnDrvGetGenreFlags() & GBF_VSFIGHT)) return 1; - if ((nLoadMenuGenreFilter & GBF_BIOS) && (BurnDrvGetGenreFlags() & GBF_BIOS)) return 1; - if ((nLoadMenuGenreFilter & GBF_BREAKOUT) && (BurnDrvGetGenreFlags() & GBF_BREAKOUT)) return 1; - if ((nLoadMenuGenreFilter & GBF_CASINO) && (BurnDrvGetGenreFlags() & GBF_CASINO)) return 1; - if ((nLoadMenuGenreFilter & GBF_BALLPADDLE) && (BurnDrvGetGenreFlags() & GBF_BALLPADDLE)) return 1; - if ((nLoadMenuGenreFilter & GBF_MAZE) && (BurnDrvGetGenreFlags() & GBF_MAZE)) return 1; - if ((nLoadMenuGenreFilter & GBF_MINIGAMES) && (BurnDrvGetGenreFlags() & GBF_MINIGAMES)) return 1; - if ((nLoadMenuGenreFilter & GBF_PINBALL) && (BurnDrvGetGenreFlags() & GBF_PINBALL)) return 1; - if ((nLoadMenuGenreFilter & GBF_PLATFORM) && (BurnDrvGetGenreFlags() & GBF_PLATFORM)) return 1; - if ((nLoadMenuGenreFilter & GBF_PUZZLE) && (BurnDrvGetGenreFlags() & GBF_PUZZLE)) return 1; - if ((nLoadMenuGenreFilter & GBF_QUIZ) && (BurnDrvGetGenreFlags() & GBF_QUIZ)) return 1; - if ((nLoadMenuGenreFilter & GBF_SPORTSMISC) && (BurnDrvGetGenreFlags() & GBF_SPORTSMISC)) return 1; - if ((nLoadMenuGenreFilter & GBF_SPORTSFOOTBALL) && (BurnDrvGetGenreFlags() & GBF_SPORTSFOOTBALL)) return 1; - if ((nLoadMenuGenreFilter & GBF_MISC) && (BurnDrvGetGenreFlags() & GBF_MISC)) return 1; - if ((nLoadMenuGenreFilter & GBF_MAHJONG) && (BurnDrvGetGenreFlags() & GBF_MAHJONG)) return 1; - if ((nLoadMenuGenreFilter & GBF_RACING) && (BurnDrvGetGenreFlags() & GBF_RACING)) return 1; - if ((nLoadMenuGenreFilter & GBF_SHOOT) && (BurnDrvGetGenreFlags() & GBF_SHOOT)) return 1; - - return 0; -} - -// Make a tree-view control with all drivers -static int SelListMake() -{ - unsigned int i, j; - unsigned int nMissingDrvCount = 0; - - if (nBurnDrv) { - free(nBurnDrv); - nBurnDrv = NULL; - } - nBurnDrv = (NODEINFO*)malloc(nBurnDrvCount * sizeof(NODEINFO)); - memset(nBurnDrv, 0, nBurnDrvCount * sizeof(NODEINFO)); - - nTmpDrvCount = 0; - - if (hSelList == NULL) { - return 1; - } - - LoadFavorites(); - - // Get dialog search string - TCHAR szSearchString[256] = { _T("") }; - j = GetDlgItemText(hSelDlg, IDC_SEL_SEARCH, szSearchString, sizeof(szSearchString)); - for (UINT32 k = 0; k < j; k++) - szSearchString[k] = _totlower(szSearchString[k]); - - // Add all the driver names to the list - // 1st: parents - for (i = 0; i < nBurnDrvCount; i++) { - TV_INSERTSTRUCT TvItem; - - nBurnDrvActive = i; // Switch to driver i - - if (BurnDrvGetFlags() & BDF_BOARDROM) { - continue; - } - - if (BurnDrvGetText(DRV_PARENT) != NULL && (BurnDrvGetFlags() & BDF_CLONE)) { // Skip clones - continue; - } - - if(!gameAv[i]) nMissingDrvCount++; - - int nHardware = 1 << (BurnDrvGetHardwareCode() >> 24); - if ((nHardware & MASKALL) && ((nHardware & nLoadMenuShowX) || (nHardware & MASKALL) == 0)) { - continue; - } - - if (avOk && (!(nLoadMenuShowY & UNAVAILABLE)) && !gameAv[i]) { // Skip non-available games if needed - continue; - } - - if (avOk && (!(nLoadMenuShowY & AVAILABLE)) && gameAv[i]) { // Skip available games if needed - continue; - } - - if (DoExtraFilters()) continue; - - if (szSearchString[0]) { - TCHAR *StringFound = NULL; - TCHAR *StringFound2 = NULL; - TCHAR *StringFound3 = NULL; - TCHAR *StringFound4 = NULL; - TCHAR szDriverName[256] = { _T("") }; - TCHAR szManufacturerName[256] = { _T("") }; - TCHAR szSystemName[256] = { _T("") }; - wcscpy(szDriverName, BurnDrvGetText(DRV_FULLNAME)); - wcscpy(szManufacturerName, BurnDrvGetText(DRV_MANUFACTURER)); - wcscpy(szSystemName, BurnDrvGetText(DRV_SYSTEM)); - for (int k = 0; k < 256; k++) { - szDriverName[k] = _totlower(szDriverName[k]); - szManufacturerName[k] = _totlower(szManufacturerName[k]); - szSystemName[k] = _totlower(szSystemName[k]); - } - StringFound = wcsstr(szDriverName, szSearchString); - StringFound2 = wcsstr(BurnDrvGetText(DRV_NAME), szSearchString); - StringFound3 = wcsstr(szManufacturerName, szSearchString); - StringFound4 = wcsstr(szSystemName, szSearchString); - - if (!StringFound && !StringFound2 && !StringFound3 && !StringFound4) continue; - } - - memset(&TvItem, 0, sizeof(TvItem)); - TvItem.item.mask = TVIF_TEXT | TVIF_PARAM; - TvItem.hInsertAfter = TVI_SORT; - TvItem.item.pszText = (nLoadMenuShowY & SHOWSHORT) ? BurnDrvGetText(DRV_NAME) : MangleGamename(BurnDrvGetText(DRV_ASCIIONLY | DRV_FULLNAME), true); - TvItem.item.lParam = (LPARAM)&nBurnDrv[nTmpDrvCount]; - nBurnDrv[nTmpDrvCount].hTreeHandle = (HTREEITEM)SendMessage(hSelList, TVM_INSERTITEM, 0, (LPARAM)&TvItem); - nBurnDrv[nTmpDrvCount].nBurnDrvNo = i; - nBurnDrv[nTmpDrvCount].pszROMName = BurnDrvGetTextA(DRV_NAME); - nBurnDrv[nTmpDrvCount].bIsParent = true; - nTmpDrvCount++; - } - - // 2nd: clones - for (i = 0; i < nBurnDrvCount; i++) { - TV_INSERTSTRUCT TvItem; - - nBurnDrvActive = i; // Switch to driver i - - if (BurnDrvGetFlags() & BDF_BOARDROM) { - continue; - } - - if (BurnDrvGetTextA(DRV_PARENT) == NULL || !(BurnDrvGetFlags() & BDF_CLONE)) { // Skip parents - continue; - } - - if(!gameAv[i]) nMissingDrvCount++; - - int nHardware = 1 << (BurnDrvGetHardwareCode() >> 24); - if ((nHardware & MASKALL) && ((nHardware & nLoadMenuShowX) || ((nHardware & MASKALL) == 0))) { - continue; - } - - if (avOk && (!(nLoadMenuShowY & UNAVAILABLE)) && !gameAv[i]) { // Skip non-available games if needed - continue; - } - - if (avOk && (!(nLoadMenuShowY & AVAILABLE)) && gameAv[i]) { // Skip available games if needed - continue; - } - - if (DoExtraFilters()) continue; - - if (szSearchString[0]) { - TCHAR *StringFound = NULL; - TCHAR *StringFound2 = NULL; - TCHAR *StringFound3 = NULL; - TCHAR *StringFound4 = NULL; - TCHAR szDriverName[256] = { _T("") }; - TCHAR szManufacturerName[256] = { _T("") }; - TCHAR szSystemName[256] = { _T("") }; - wcscpy(szDriverName, BurnDrvGetText(DRV_FULLNAME)); - wcscpy(szManufacturerName, BurnDrvGetText(DRV_MANUFACTURER)); - wcscpy(szSystemName, BurnDrvGetText(DRV_SYSTEM)); - for (int k =0; k < 256; k++) { - szDriverName[k] = _totlower(szDriverName[k]); - szManufacturerName[k] = _totlower(szManufacturerName[k]); - szSystemName[k] = _totlower(szSystemName[k]); - } - StringFound = wcsstr(szDriverName, szSearchString); - StringFound2 = wcsstr(BurnDrvGetText(DRV_NAME), szSearchString); - StringFound3 = wcsstr(szManufacturerName, szSearchString); - StringFound4 = wcsstr(szSystemName, szSearchString); - - if (!StringFound && !StringFound2 && !StringFound3 && !StringFound4) continue; - } - - memset(&TvItem, 0, sizeof(TvItem)); - TvItem.item.mask = TVIF_TEXT | TVIF_PARAM; - TvItem.hInsertAfter = TVI_SORT; - TvItem.item.pszText = (nLoadMenuShowY & SHOWSHORT) ? BurnDrvGetText(DRV_NAME) : MangleGamename(BurnDrvGetText(DRV_ASCIIONLY | DRV_FULLNAME), true); - - // Find the parent's handle - for (j = 0; j < nTmpDrvCount; j++) { - if (nBurnDrv[j].bIsParent) { - if (!_stricmp(BurnDrvGetTextA(DRV_PARENT), nBurnDrv[j].pszROMName)) { - TvItem.hParent = nBurnDrv[j].hTreeHandle; - break; - } - } - } - - // Find the parent and add a branch to the tree - if (!TvItem.hParent) { - char szTempName[32]; - strcpy(szTempName, BurnDrvGetTextA(DRV_PARENT)); - int nTempBurnDrvSelect = nBurnDrvActive; - for (j = 0; j < nBurnDrvCount; j++) { - nBurnDrvActive = j; - if (!strcmp(szTempName, BurnDrvGetTextA(DRV_NAME))) { - TV_INSERTSTRUCT TempTvItem; - memset(&TempTvItem, 0, sizeof(TempTvItem)); - TempTvItem.item.mask = TVIF_TEXT | TVIF_PARAM; - TempTvItem.hInsertAfter = TVI_SORT; - TempTvItem.item.pszText = (nLoadMenuShowY & SHOWSHORT) ? BurnDrvGetText(DRV_NAME) : MangleGamename(BurnDrvGetText(DRV_ASCIIONLY | DRV_FULLNAME), true); - TempTvItem.item.lParam = (LPARAM)&nBurnDrv[nTmpDrvCount]; - nBurnDrv[nTmpDrvCount].hTreeHandle = (HTREEITEM)SendMessage(hSelList, TVM_INSERTITEM, 0, (LPARAM)&TempTvItem); - nBurnDrv[nTmpDrvCount].nBurnDrvNo = j; - nBurnDrv[nTmpDrvCount].bIsParent = true; - nBurnDrv[nTmpDrvCount].pszROMName = BurnDrvGetTextA(DRV_NAME); - TvItem.item.lParam = (LPARAM)&nBurnDrv[nTmpDrvCount]; - TvItem.hParent = nBurnDrv[nTmpDrvCount].hTreeHandle; - nTmpDrvCount++; - break; - } - } - nBurnDrvActive = nTempBurnDrvSelect; - } - - TvItem.item.lParam = (LPARAM)&nBurnDrv[nTmpDrvCount]; - nBurnDrv[nTmpDrvCount].hTreeHandle = (HTREEITEM)SendMessage(hSelList, TVM_INSERTITEM, 0, (LPARAM)&TvItem); - nBurnDrv[nTmpDrvCount].pszROMName = BurnDrvGetTextA(DRV_NAME); - nBurnDrv[nTmpDrvCount].nBurnDrvNo = i; - nTmpDrvCount++; - } - - for (i = 0; i < nTmpDrvCount; i++) { - // See if we need to expand the branch of an unavailable or non-working parent - if (nBurnDrv[i].bIsParent && ((nLoadMenuShowY & AUTOEXPAND) || !gameAv[nBurnDrv[i].nBurnDrvNo] || !CheckWorkingStatus(nBurnDrv[i].nBurnDrvNo))) { - for (j = 0; j < nTmpDrvCount; j++) { - - // Expand the branch only if a working clone is available - if (gameAv[nBurnDrv[j].nBurnDrvNo]) { - nBurnDrvActive = nBurnDrv[j].nBurnDrvNo; - if (BurnDrvGetTextA(DRV_PARENT)) { - if (strcmp(nBurnDrv[i].pszROMName, BurnDrvGetTextA(DRV_PARENT)) == 0) { - SendMessage(hSelList, TVM_EXPAND, TVE_EXPAND, (LPARAM)nBurnDrv[i].hTreeHandle); - break; - } - } - } - } - } - } - - // Update the status info - TCHAR szRomsAvailableInfo[128] = _T(""); - - _stprintf(szRomsAvailableInfo, FBALoadStringEx(hAppInst, IDS_SEL_SETSTATUS, true), nTmpDrvCount, nBurnDrvCount - REDUCE_TOTAL_SETS_BIOS, nMissingDrvCount); - SendDlgItemMessage(hSelDlg, IDC_DRVCOUNT, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)szRomsAvailableInfo); - - return 0; -} - -static void MyEndDialog() -{ - if (nTimer) { - KillTimer(hSelDlg, nTimer); - nTimer = 0; - } - - if (nInitPreviewTimer) { - KillTimer(hSelDlg, nInitPreviewTimer); - nInitPreviewTimer = 0; - } - - SendDlgItemMessage(hSelDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - SendDlgItemMessage(hSelDlg, IDC_SCREENSHOT_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - - SendDlgItemMessage(hSelDlg, IDC_SCREENSHOT2_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - SendDlgItemMessage(hSelDlg, IDC_SCREENSHOT2_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - - if (hPrevBmp) { - DeleteObject((HGDIOBJ)hPrevBmp); - hPrevBmp = NULL; - } - if(hTitleBmp) { - DeleteObject((HGDIOBJ)hTitleBmp); - hTitleBmp = NULL; - } - - if (hExpand) { - DestroyIcon(hExpand); - hExpand = NULL; - } - if (hCollapse) { - DestroyIcon(hCollapse); - hCollapse = NULL; - } - if (hNotWorking) { - DestroyIcon(hNotWorking); - hNotWorking = NULL; - } - if (hNotFoundEss) { - DestroyIcon(hNotFoundEss); - hNotFoundEss = NULL; - } - if (hNotFoundNonEss) { - DestroyIcon(hNotFoundNonEss); - hNotFoundNonEss = NULL; - } - if(hDrvIconMiss) { - DestroyIcon(hDrvIconMiss); - hDrvIconMiss = NULL; - } - - RECT rect; - - GetClientRect(hSelDlg, &rect); - nSelDlgWidth = rect.right; - nSelDlgHeight = rect.bottom; - - EndDialog(hSelDlg, 0); -} - -// User clicked ok for a driver in the list -static void SelOkay() -{ - TV_ITEM TvItem; - unsigned int nSelect = 0; - HTREEITEM hSelectHandle = (HTREEITEM)SendMessage(hSelList, TVM_GETNEXTITEM, TVGN_CARET, ~0U); - - if (!hSelectHandle) { // Nothing is selected, return without closing the window - return; - } - - TvItem.hItem = hSelectHandle; - TvItem.mask = TVIF_PARAM; - SendMessage(hSelList, TVM_GETITEM, 0, (LPARAM)&TvItem); - nSelect = ((NODEINFO*)TvItem.lParam)->nBurnDrvNo; - -#if DISABLE_NON_AVAILABLE_SELECT - if (!gameAv[nSelect]) { // Game not available, return without closing the window - return; - } -#endif - -#if NON_WORKING_PROMPT_ON_LOAD - if (!CheckWorkingStatus(nSelect)) { - TCHAR szWarningText[1024]; - _stprintf(szWarningText, _T("%s"), FBALoadStringEx(hAppInst, IDS_ERR_WARNING, true)); - if (MessageBox(hSelDlg, FBALoadStringEx(hAppInst, IDS_ERR_NON_WORKING, true), szWarningText, MB_YESNO | MB_DEFBUTTON2 | MB_ICONWARNING) == IDNO) { - return; - } - } -#endif - nDialogSelect = nSelect; - - bDialogCancel = false; - MyEndDialog(); -} - -static void RefreshPanel() -{ - // clear preview shot - if (hPrevBmp) { - DeleteObject((HGDIOBJ)hPrevBmp); - hPrevBmp = NULL; - } - if (hTitleBmp) { - DeleteObject((HGDIOBJ)hTitleBmp); - hTitleBmp = NULL; - } - if (nTimer) { - KillTimer(hSelDlg, nTimer); - nTimer = 0; - } - - - hPrevBmp = PNGLoadBitmap(hSelDlg, NULL, 213, 160, 2); - hTitleBmp = PNGLoadBitmap(hSelDlg, NULL, 213, 160, 2); - - SendDlgItemMessage(hSelDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hPrevBmp); - SendDlgItemMessage(hSelDlg, IDC_SCREENSHOT_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - - SendDlgItemMessage(hSelDlg, IDC_SCREENSHOT2_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hTitleBmp); - SendDlgItemMessage(hSelDlg, IDC_SCREENSHOT2_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - - // Clear the things in our Info-box - for (int i = 0; i < 6; i++) { - SendMessage(hInfoText[i], WM_SETTEXT, (WPARAM)0, (LPARAM)_T("")); - EnableWindow(hInfoLabel[i], FALSE); - } - - CheckDlgButton(hSelDlg, IDC_CHECKAUTOEXPAND, (nLoadMenuShowY & AUTOEXPAND) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hSelDlg, IDC_CHECKAVAILABLE, (nLoadMenuShowY & AVAILABLE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hSelDlg, IDC_CHECKUNAVAILABLE, (nLoadMenuShowY & UNAVAILABLE) ? BST_CHECKED : BST_UNCHECKED); - - CheckDlgButton(hSelDlg, IDC_SEL_SHORTNAME, nLoadMenuShowY & SHOWSHORT ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hSelDlg, IDC_SEL_ASCIIONLY, nLoadMenuShowY & ASCIIONLY ? BST_CHECKED : BST_UNCHECKED); -} - -FILE* OpenPreview(int nIndex, TCHAR *szPath) -{ - static bool bTryParent; - - TCHAR szBaseName[MAX_PATH]; - TCHAR szFileName[MAX_PATH]; - - FILE* fp = NULL; - - // Try to load a .PNG preview image - _sntprintf(szBaseName, sizeof(szBaseName), _T("%s%s"), szPath, BurnDrvGetText(DRV_NAME)); - if (nIndex <= 1) { - _stprintf(szFileName, _T("%s.png"), szBaseName); - fp = _tfopen(szFileName, _T("rb")); - } - if (!fp) { - _stprintf(szFileName, _T("%s [%02i].png"), szBaseName, nIndex); - fp = _tfopen(szFileName, _T("rb")); - } - - if (nIndex <= 1) { - bTryParent = fp ? false : true; - } - - if (!fp && BurnDrvGetText(DRV_PARENT) && bTryParent) { // Try the parent - _sntprintf(szBaseName, sizeof(szBaseName), _T("%s%s"), szPath, BurnDrvGetText(DRV_PARENT)); - if (nIndex <= 1) { - _stprintf(szFileName, _T("%s.png"), szBaseName); - fp = _tfopen(szFileName, _T("rb")); - } - if (!fp) { - _stprintf(szFileName, _T("%s [%02i].png"), szBaseName, nIndex); - fp = _tfopen(szFileName, _T("rb")); - } - } - - return fp; -} - -static VOID CALLBACK PreviewTimerProc(HWND, UINT, UINT_PTR, DWORD) -{ - UpdatePreview(false, szAppPreviewsPath, IDC_SCREENSHOT_H, IDC_SCREENSHOT_V); -} - -static VOID CALLBACK InitPreviewTimerProc(HWND, UINT, UINT_PTR, DWORD) -{ - UpdatePreview(true, szAppPreviewsPath, IDC_SCREENSHOT_H, IDC_SCREENSHOT_V); - - if (GetIpsNumPatches()) { - if (!nShowMVSCartsOnly) EnableWindow(GetDlgItem(hSelDlg, IDC_SEL_IPSMANAGER), TRUE); - } else { - EnableWindow(GetDlgItem(hSelDlg, IDC_SEL_IPSMANAGER), FALSE); - } - - LoadIpsActivePatches(); - if (GetIpsNumActivePatches()) { - if (!nShowMVSCartsOnly) EnableWindow(GetDlgItem(hSelDlg, IDC_SEL_APPLYIPS), TRUE); - } else { - EnableWindow(GetDlgItem(hSelDlg, IDC_SEL_APPLYIPS), FALSE); - } - - KillTimer(hSelDlg, nInitPreviewTimer); - nInitPreviewTimer = 0; -} - -static int UpdatePreview(bool bReset, TCHAR *szPath, int HorCtrl, int VerCtrl) -{ - static int nIndex; - int nOldIndex = 0; - - FILE* fp = NULL; - HBITMAP hNewImage = NULL; - - if (HorCtrl == IDC_SCREENSHOT_H) { - nOldIndex = nIndex; - nIndex++; - if (bReset) { - nIndex = 1; - nOldIndex = -1; - if (nTimer) { - KillTimer(hSelDlg, 1); - nTimer = 0; - } - } - } - - nBurnDrvActive = nDialogSelect; - - if ((nIndex != nOldIndex) || (HorCtrl == IDC_SCREENSHOT2_H)) { - int x, y, ax, ay; - - BurnDrvGetAspect(&ax, &ay); - - //if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if (ay > ax) { - bImageOrientation = TRUE; - - y = 160; - x = y * ax / ay; - } else { - bImageOrientation = FALSE; - - x = 213; - y = x * ay / ax; - } - - if (HorCtrl == IDC_SCREENSHOT_H) { - fp = OpenPreview(nIndex, szPath); - } else { - fp = OpenPreview(0, szPath); - } - if (!fp && nIndex > 1 && HorCtrl == IDC_SCREENSHOT_H) { - if (nIndex == 2) { - - // There's only a single preview image, stop timer - - if (nTimer) { - KillTimer(hSelDlg, 1); - nTimer = 0; - } - - return 0; - } - - nIndex = 1; - fp = OpenPreview(nIndex, szPath); - } - if (fp) { - hNewImage = PNGLoadBitmap(hSelDlg, fp, x, y, 3); - } - } - - if (fp) { - fclose(fp); - - if (HorCtrl == IDC_SCREENSHOT_H) nTimer = SetTimer(hSelDlg, 1, 2500, PreviewTimerProc); - } else { - - // We couldn't load a new image for this game, so kill the timer (it will be restarted when a new game is selected) - - if (HorCtrl == IDC_SCREENSHOT_H) { - if (nTimer) { - KillTimer(hSelDlg, 1); - nTimer = 0; - } - } - - bImageOrientation = FALSE; - hNewImage = PNGLoadBitmap(hSelDlg, NULL, 213, 160, 2); - } - - if (hPrevBmp && (HorCtrl == IDC_SCREENSHOT_H || VerCtrl == IDC_SCREENSHOT_V)) { - DeleteObject((HGDIOBJ)hPrevBmp); - *&hPrevBmp = NULL; - hPrevBmp = hNewImage; - } - - if (hTitleBmp && (HorCtrl == IDC_SCREENSHOT2_H || VerCtrl == IDC_SCREENSHOT2_V)) { - DeleteObject((HGDIOBJ)hTitleBmp); - *&hTitleBmp = NULL; - hTitleBmp = hNewImage; - } - - if (bImageOrientation == 0) { - SendDlgItemMessage(hSelDlg, HorCtrl, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hNewImage); - SendDlgItemMessage(hSelDlg, VerCtrl, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - ShowWindow(GetDlgItem(hSelDlg, HorCtrl), SW_SHOW); - ShowWindow(GetDlgItem(hSelDlg, VerCtrl), SW_HIDE); - } else { - SendDlgItemMessage(hSelDlg, HorCtrl, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - SendDlgItemMessage(hSelDlg, VerCtrl, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hNewImage); - ShowWindow(GetDlgItem(hSelDlg, HorCtrl), SW_HIDE); - ShowWindow(GetDlgItem(hSelDlg, VerCtrl), SW_SHOW); - } - - UpdateWindow(hSelDlg); - - return 0; -} - -static unsigned __stdcall DoShellExThread(void *arg) -{ - ShellExecute(NULL, _T("open"), (TCHAR*)arg, NULL, NULL, SW_SHOWNORMAL); - - return 0; -} - -static void ViewEmma() -{ - HANDLE hThread = NULL; - unsigned ThreadID = 0; - TCHAR szShellExURL[MAX_PATH]; - - _stprintf(szShellExURL, _T("http://www.progettoemma.net/gioco.php?&game=%s"), BurnDrvGetText(DRV_NAME)); - - hThread = (HANDLE)_beginthreadex(NULL, 0, DoShellExThread, (void*)szShellExURL, 0, &ThreadID); - Sleep(150); // allow arguments to pass to ShellExecute() in new thread before they get disposed. -} - -static void RebuildEverything() -{ - RefreshPanel(); - - bDrvSelected = false; - - TreeBuilding = 1; - SendMessage(hSelList, WM_SETREDRAW, (WPARAM)FALSE,(LPARAM)TVI_ROOT); // disable redraw - SendMessage(hSelList, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT); // Destory all nodes - SelListMake(); - SendMessage(hSelList, WM_SETREDRAW, (WPARAM)TRUE, (LPARAM)TVI_ROOT); // enable redraw - - // Clear the things in our Info-box - for (int i = 0; i < 6; i++) { - SendMessage(hInfoText[i], WM_SETTEXT, (WPARAM)0, (LPARAM)_T("")); - EnableWindow(hInfoLabel[i], FALSE); - } - - TreeBuilding = 0; -} - -#define _TVCreateFiltersA(a, b, c, d) \ -{ \ - TvItem.hParent = a; \ - TvItem.item.pszText = FBALoadStringEx(hAppInst, b, true); \ - c = TreeView_InsertItem(hFilterList, &TvItem); \ - _TreeView_SetCheckState(hFilterList, c, (d) ? FALSE : TRUE); \ -} - -#define _TVCreateFiltersB(a, b, c) \ -{ \ - TvItem.hParent = a; \ - TvItem.item.pszText = FBALoadStringEx(hAppInst, b, true); \ - c = TreeView_InsertItem(hFilterList, &TvItem); \ -} - -static void CreateFilters() -{ - TV_INSERTSTRUCT TvItem; - memset(&TvItem, 0, sizeof(TvItem)); - - hFilterList = GetDlgItem(hSelDlg, IDC_TREE2); - - TvItem.item.mask = TVIF_TEXT | TVIF_PARAM; - TvItem.hInsertAfter = TVI_LAST; - - _TVCreateFiltersB(TVI_ROOT , IDS_SEL_FILTERS , hRoot ); - _TVCreateFiltersB(hRoot , IDS_SEL_BOARDTYPE , hBoardType ); - - _TVCreateFiltersA(hBoardType , IDS_SEL_GENUINE , hFilterGenuine , nLoadMenuBoardTypeFilter & MASKBOARDTYPEGENUINE ); - _TVCreateFiltersA(hBoardType , IDS_SEL_BOOTLEG , hFilterBootleg , nLoadMenuBoardTypeFilter & BDF_BOOTLEG ); - _TVCreateFiltersA(hBoardType , IDS_SEL_DEMO , hFilterDemo , nLoadMenuBoardTypeFilter & BDF_DEMO ); - _TVCreateFiltersA(hBoardType , IDS_SEL_HACK , hFilterHack , nLoadMenuBoardTypeFilter & BDF_HACK ); - _TVCreateFiltersA(hBoardType , IDS_SEL_HOMEBREW , hFilterHomebrew , nLoadMenuBoardTypeFilter & BDF_HOMEBREW ); - _TVCreateFiltersA(hBoardType , IDS_SEL_PROTOTYPE , hFilterPrototype , nLoadMenuBoardTypeFilter & BDF_PROTOTYPE ); - - _TVCreateFiltersB(hRoot , IDS_FAMILY , hFamily ); - - _TVCreateFiltersA(hFamily , IDS_FAMILY_OTHER , hFilterOtherFamily , nLoadMenuFamilyFilter & MASKFAMILYOTHER ); - _TVCreateFiltersA(hFamily , IDS_FAMILY_19XX , hFilter19xx , nLoadMenuFamilyFilter & FBF_19XX ); - _TVCreateFiltersA(hFamily , IDS_FAMILY_SONICWI , hFilterSonicwi , nLoadMenuFamilyFilter & FBF_SONICWI ); - _TVCreateFiltersA(hFamily , IDS_FAMILY_DSTLK , hFilterDstlk , nLoadMenuFamilyFilter & FBF_DSTLK ); - _TVCreateFiltersA(hFamily , IDS_FAMILY_FATFURY , hFilterFatfury , nLoadMenuFamilyFilter & FBF_FATFURY ); - _TVCreateFiltersA(hFamily , IDS_FAMILY_KOF , hFilterKof , nLoadMenuFamilyFilter & FBF_KOF ); - _TVCreateFiltersA(hFamily , IDS_FAMILY_MSLUG , hFilterMslug , nLoadMenuFamilyFilter & FBF_MSLUG ); - _TVCreateFiltersA(hFamily , IDS_FAMILY_PWRINST , hFilterPwrinst , nLoadMenuFamilyFilter & FBF_PWRINST ); - _TVCreateFiltersA(hFamily , IDS_FAMILY_SAMSHO , hFilterSamsho , nLoadMenuFamilyFilter & FBF_SAMSHO ); - _TVCreateFiltersA(hFamily , IDS_FAMILY_SF , hFilterSf , nLoadMenuFamilyFilter & FBF_SF ); - - _TVCreateFiltersA(hRoot , IDS_FAVORITES , hFavorites , !nLoadMenuFavoritesFilter ); - - _TVCreateFiltersB(hRoot , IDS_GENRE , hGenre ); - - _TVCreateFiltersA(hGenre , IDS_GENRE_BALLPADDLE , hFilterBallpaddle , nLoadMenuGenreFilter & GBF_BALLPADDLE ); - _TVCreateFiltersA(hGenre , IDS_GENRE_BIOS , hFilterBios , nLoadMenuGenreFilter & GBF_BIOS ); - _TVCreateFiltersA(hGenre , IDS_GENRE_BREAKOUT , hFilterBreakout , nLoadMenuGenreFilter & GBF_BREAKOUT ); - _TVCreateFiltersA(hGenre , IDS_GENRE_CASINO , hFilterCasino , nLoadMenuGenreFilter & GBF_CASINO ); - _TVCreateFiltersA(hGenre , IDS_GENRE_SCRFIGHT , hFilterScrfight , nLoadMenuGenreFilter & GBF_SCRFIGHT ); - _TVCreateFiltersA(hGenre , IDS_GENRE_VSFIGHT , hFilterVsfight , nLoadMenuGenreFilter & GBF_VSFIGHT ); - _TVCreateFiltersA(hGenre , IDS_GENRE_MAHJONG , hFilterMahjong , nLoadMenuGenreFilter & GBF_MAHJONG ); - _TVCreateFiltersA(hGenre , IDS_GENRE_MAZE , hFilterMaze , nLoadMenuGenreFilter & GBF_MAZE ); - _TVCreateFiltersA(hGenre , IDS_GENRE_MINIGAMES , hFilterMinigames , nLoadMenuGenreFilter & GBF_MINIGAMES ); - _TVCreateFiltersA(hGenre , IDS_GENRE_MISC , hFilterMisc , nLoadMenuGenreFilter & GBF_MISC ); - _TVCreateFiltersA(hGenre , IDS_GENRE_PINBALL , hFilterPinball , nLoadMenuGenreFilter & GBF_PINBALL ); - _TVCreateFiltersA(hGenre , IDS_GENRE_PLATFORM , hFilterPlatform , nLoadMenuGenreFilter & GBF_PLATFORM ); - _TVCreateFiltersA(hGenre , IDS_GENRE_PUZZLE , hFilterPuzzle , nLoadMenuGenreFilter & GBF_PUZZLE ); - _TVCreateFiltersA(hGenre , IDS_GENRE_QUIZ , hFilterQuiz , nLoadMenuGenreFilter & GBF_QUIZ ); - _TVCreateFiltersA(hGenre , IDS_GENRE_RACING , hFilterRacing , nLoadMenuGenreFilter & GBF_RACING ); - _TVCreateFiltersA(hGenre , IDS_GENRE_HORSHOOT , hFilterHorshoot , nLoadMenuGenreFilter & GBF_HORSHOOT ); - _TVCreateFiltersA(hGenre , IDS_GENRE_SHOOT , hFilterShoot , nLoadMenuGenreFilter & GBF_SHOOT ); - _TVCreateFiltersA(hGenre , IDS_GENRE_VERSHOOT , hFilterVershoot , nLoadMenuGenreFilter & GBF_VERSHOOT ); - _TVCreateFiltersA(hGenre , IDS_GENRE_SPORTSMISC , hFilterSportsmisc , nLoadMenuGenreFilter & GBF_SPORTSMISC ); - _TVCreateFiltersA(hGenre , IDS_GENRE_SPORTSFOOTBALL, hFilterSportsfootball, nLoadMenuGenreFilter & GBF_SPORTSFOOTBALL ); - - _TVCreateFiltersB(hRoot , IDS_SEL_HARDWARE, hHardware ); - - _TVCreateFiltersA(hHardware , IDS_SEL_CAPCOM_MISC , hFilterCapcomMisc , nLoadMenuShowX & MASKCAPMISC ); - _TVCreateFiltersA(hHardware , IDS_SEL_CAVE , hFilterCave , nLoadMenuShowX & MASKCAVE ); - _TVCreateFiltersA(hHardware , IDS_SEL_CPS1 , hFilterCps1 , nLoadMenuShowX & MASKCPS ); - _TVCreateFiltersA(hHardware , IDS_SEL_CPS2 , hFilterCps2 , nLoadMenuShowX & MASKCPS2 ); - _TVCreateFiltersA(hHardware , IDS_SEL_CPS3 , hFilterCps3 , nLoadMenuShowX & MASKCPS3 ); - _TVCreateFiltersA(hHardware , IDS_SEL_DATAEAST , hFilterDataeast , nLoadMenuShowX & MASKDATAEAST ); - _TVCreateFiltersA(hHardware , IDS_SEL_GALAXIAN , hFilterGalaxian , nLoadMenuShowX & MASKGALAXIAN ); - _TVCreateFiltersA(hHardware , IDS_SEL_IREM , hFilterIrem , nLoadMenuShowX & MASKIREM ); - _TVCreateFiltersA(hHardware , IDS_SEL_KANEKO , hFilterKaneko , nLoadMenuShowX & MASKKANEKO ); - _TVCreateFiltersA(hHardware , IDS_SEL_KONAMI , hFilterKonami , nLoadMenuShowX & MASKKONAMI ); - _TVCreateFiltersA(hHardware , IDS_SEL_NEOGEO , hFilterNeogeo , nLoadMenuShowX & MASKNEOGEO ); - _TVCreateFiltersA(hHardware , IDS_SEL_PACMAN , hFilterPacman , nLoadMenuShowX & MASKPACMAN ); - _TVCreateFiltersA(hHardware , IDS_SEL_PGM , hFilterPgm , nLoadMenuShowX & MASKPGM ); - _TVCreateFiltersA(hHardware , IDS_SEL_PSIKYO , hFilterPsikyo , nLoadMenuShowX & MASKPSIKYO ); - _TVCreateFiltersA(hHardware , IDS_SEL_SEGA , hFilterSega , nLoadMenuShowX & MASKSEGA ); - _TVCreateFiltersA(hHardware , IDS_SEL_SETA , hFilterSeta , nLoadMenuShowX & MASKSETA ); - _TVCreateFiltersA(hHardware , IDS_SEL_TAITO , hFilterTaito , nLoadMenuShowX & MASKTAITO ); - _TVCreateFiltersA(hHardware , IDS_SEL_TECHNOS , hFilterTechnos , nLoadMenuShowX & MASKTECHNOS ); - _TVCreateFiltersA(hHardware , IDS_SEL_TOAPLAN , hFilterToaplan , nLoadMenuShowX & MASKTOAPLAN ); - _TVCreateFiltersA(hHardware , IDS_SEL_MISCPRE90S , hFilterMiscPre90s , nLoadMenuShowX & MASKMISCPRE90S ); - _TVCreateFiltersA(hHardware , IDS_SEL_MISCPOST90S , hFilterMiscPost90s , nLoadMenuShowX & MASKMISCPOST90S ); - _TVCreateFiltersA(hHardware , IDS_SEL_SMS , hFilterSms , nLoadMenuShowX & MASKSMS ); - _TVCreateFiltersA(hHardware , IDS_SEL_GG , hFilterGg , nLoadMenuShowX & MASKGG ); - _TVCreateFiltersA(hHardware , IDS_SEL_MEGADRIVE , hFilterMegadrive , nLoadMenuShowX & MASKMEGADRIVE ); - _TVCreateFiltersA(hHardware , IDS_SEL_PCE , hFilterPce , nLoadMenuShowX & MASKPCENGINE ); -// _TVCreateFiltersA(hHardware , IDS_SEL_SNES , hFilterSnes , nLoadMenuShowX & MASKSNES ); - _TVCreateFiltersA(hHardware , IDS_SEL_SG1000 , hFilterSg1000 , nLoadMenuShowX & MASKSG1000 ); - _TVCreateFiltersA(hHardware , IDS_SEL_COLECO , hFilterColeco , nLoadMenuShowX & MASKCOLECO ); - _TVCreateFiltersA(hHardware , IDS_SEL_MSX , hFilterMsx , nLoadMenuShowX & MASKMSX ); - - SendMessage(hFilterList , TVM_EXPAND,TVE_EXPAND, (LPARAM)hRoot); - SendMessage(hFilterList , TVM_EXPAND,TVE_EXPAND, (LPARAM)hHardware); - //SendMessage(hFilterList , TVM_EXPAND,TVE_EXPAND, (LPARAM)hFavorites); - TreeView_SelectSetFirstVisible(hFilterList, hRoot); -} - -void LoadDrvIcons() -{ - if(nIconsSize == ICON_16x16) { - nIconsSizeXY = 16; - nIconsYDiff = 4; - } - if(nIconsSize == ICON_24x24) { - nIconsSizeXY = 24; - nIconsYDiff = 8; - } - if(nIconsSize == ICON_32x32) { - nIconsSizeXY = 32; - nIconsYDiff = 12; - } - - unsigned int nOldDrvSel = nBurnDrvActive; - - for(unsigned int nDrvIndex = 0; nDrvIndex < nBurnDrvCount; nDrvIndex++) - { - nBurnDrvActive = nDrvIndex; - TCHAR szIcon[MAX_PATH]; - - if ((((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_MEGADRIVE) - || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_PCENGINE_PCENGINE) - || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_PCENGINE_TG16) - || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_PCENGINE_SGX) - || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_SG1000) - || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_COLECO) - || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_MASTER_SYSTEM) - || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SEGA_GAME_GEAR) - || ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_MSX) - )) { - continue; - } - - _stprintf(szIcon, _T("%s%s.ico"), szAppIconsPath, BurnDrvGetText(DRV_NAME)); - hDrvIcon[nDrvIndex] = (HICON)LoadImage(hAppInst, szIcon, IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_LOADFROMFILE); - - if(!hDrvIcon[nDrvIndex] && BurnDrvGetText(DRV_PARENT)) { - _stprintf(szIcon, _T("%s%s.ico"), szAppIconsPath, BurnDrvGetText(DRV_PARENT)); - hDrvIcon[nDrvIndex] = (HICON)LoadImage(hAppInst, szIcon, IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_LOADFROMFILE); - } - } - - nBurnDrvActive = nOldDrvSel; -} - -void UnloadDrvIcons() { - - nIconsSizeXY = 16; - nIconsYDiff = 4; - - for(unsigned int nDrvIndex = 0; nDrvIndex < nBurnDrvCount; nDrvIndex++) - { - DestroyIcon(hDrvIcon[nDrvIndex]); - hDrvIcon[nDrvIndex] = NULL; - } -} - -#define UM_CHECKSTATECHANGE (WM_USER + 100) -#define UM_CLOSE (WM_USER + 101) - -#define _ToggleGameListing(nShowX, nMASK) \ -{ \ - nShowX ^= nMASK; \ - _TreeView_SetCheckState(hFilterList, hItemChanged, (nShowX & nMASK) ? FALSE : TRUE); \ -} - -static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - if (Msg == WM_INITDIALOG) { - - InitCommonControls(); - - hSelDlg = hDlg; - - SendDlgItemMessage(hDlg, IDC_SCREENSHOT_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - SendDlgItemMessage(hDlg, IDC_SCREENSHOT_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - - SendDlgItemMessage(hDlg, IDC_SCREENSHOT2_H, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - SendDlgItemMessage(hDlg, IDC_SCREENSHOT2_V, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)NULL); - - hWhiteBGBrush = CreateSolidBrush(RGB(0xFF,0xFF,0xFF)); - - hExpand = (HICON)LoadImage(hAppInst, MAKEINTRESOURCE(IDI_TV_PLUS), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); - hCollapse = (HICON)LoadImage(hAppInst, MAKEINTRESOURCE(IDI_TV_MINUS), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); - - hNotWorking = (HICON)LoadImage(hAppInst, MAKEINTRESOURCE(IDI_TV_NOTWORKING), IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_DEFAULTCOLOR); - hNotFoundEss = (HICON)LoadImage(hAppInst, MAKEINTRESOURCE(IDI_TV_NOTFOUND_ESS), IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_DEFAULTCOLOR); - hNotFoundNonEss = (HICON)LoadImage(hAppInst, MAKEINTRESOURCE(IDI_TV_NOTFOUND_NON), IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_DEFAULTCOLOR); - - hDrvIconMiss = (HICON)LoadImage(hAppInst, MAKEINTRESOURCE(IDI_APP), IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_DEFAULTCOLOR); - - TCHAR szOldTitle[1024] = _T(""), szNewTitle[1024] = _T(""); - GetWindowText(hSelDlg, szOldTitle, 1024); - _sntprintf(szNewTitle, 1024, _T(APP_TITLE) _T(SEPERATOR_1) _T("%s"), szOldTitle); - SetWindowText(hSelDlg, szNewTitle); - - hSelList = GetDlgItem(hSelDlg, IDC_TREE1); - - hInfoLabel[0] = GetDlgItem(hSelDlg, IDC_LABELROMNAME); - hInfoLabel[1] = GetDlgItem(hSelDlg, IDC_LABELROMINFO); - hInfoLabel[2] = GetDlgItem(hSelDlg, IDC_LABELSYSTEM); - hInfoLabel[3] = GetDlgItem(hSelDlg, IDC_LABELCOMMENT); - hInfoLabel[4] = GetDlgItem(hSelDlg, IDC_LABELNOTES); - hInfoLabel[5] = GetDlgItem(hSelDlg, IDC_LABELGENRE); - hInfoText[0] = GetDlgItem(hSelDlg, IDC_TEXTROMNAME); - hInfoText[1] = GetDlgItem(hSelDlg, IDC_TEXTROMINFO); - hInfoText[2] = GetDlgItem(hSelDlg, IDC_TEXTSYSTEM); - hInfoText[3] = GetDlgItem(hSelDlg, IDC_TEXTCOMMENT); - hInfoText[4] = GetDlgItem(hSelDlg, IDC_TEXTNOTES); - hInfoText[5] = GetDlgItem(hSelDlg, IDC_TEXTGENRE); - -#if !defined _UNICODE - EnableWindow(GetDlgItem(hDlg, IDC_SEL_ASCIIONLY), FALSE); -#endif - - bool bFoundROMs = false; - for (unsigned int i = 0; i < nBurnDrvCount; i++) { - if (gameAv[i]) { - bFoundROMs = true; - break; - } - } - if (!bFoundROMs && bSkipStartupCheck == false) { - RomsDirCreate(hSelDlg); - } - - // Icons size related ----------------------------------------- - SHORT cyItem = nIconsSizeXY + 4; // height (in pixels) of each item on the TreeView list - TreeView_SetItemHeight(hSelList, cyItem); - - SetFocus(hSelList); - - RebuildEverything(); - - TreeView_SetItemHeight(hSelList, cyItem); - - if (nDialogSelect > -1) { - for (unsigned int i = 0; i < nTmpDrvCount; i++) { - if (nBurnDrv[i].nBurnDrvNo == nDialogSelect) { - nBurnDrvActive = nBurnDrv[i].nBurnDrvNo; - TreeView_EnsureVisible(hSelList, nBurnDrv[i].hTreeHandle); - TreeView_Select(hSelList, nBurnDrv[i].hTreeHandle, TVGN_CARET); - TreeView_SelectSetFirstVisible(hSelList, nBurnDrv[i].hTreeHandle); - break; - } - } - - // hack to load the preview image after a delay - nInitPreviewTimer = SetTimer(hSelDlg, 1, 20, InitPreviewTimerProc); - } - - LONG_PTR Style; - Style = GetWindowLongPtr (GetDlgItem(hSelDlg, IDC_TREE2), GWL_STYLE); - Style |= TVS_CHECKBOXES; - SetWindowLongPtr (GetDlgItem(hSelDlg, IDC_TREE2), GWL_STYLE, Style); - - CreateFilters(); - - EnableWindow(GetDlgItem(hDlg, IDC_SEL_APPLYIPS), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_SEL_IPSMANAGER), FALSE); - bDoIpsPatch = FALSE; - IpsPatchExit(); - - WndInMid(hDlg, hParent); - - HICON hIcon = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_APP)); - SendMessage(hSelDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); // Set the Game Selection dialog icon. - - GetInitialPositions(); - - SetWindowPos(hDlg, NULL, 0, 0, nSelDlgWidth, nSelDlgHeight, SWP_NOZORDER); - - WndInMid(hDlg, hParent); - - return TRUE; - } - - if(Msg == UM_CHECKSTATECHANGE) { - - HTREEITEM hItemChanged = (HTREEITEM)lParam; - - if (hItemChanged == hHardware) { - if ((nLoadMenuShowX & MASKALL) == 0) { - _TreeView_SetCheckState(hFilterList, hItemChanged, FALSE); - - _TreeView_SetCheckState(hFilterList, hFilterCapcomMisc, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterCave, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterCps1, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterCps2, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterCps3, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterDataeast, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterGalaxian, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterIrem, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterKaneko, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterKonami, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterNeogeo, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterPacman, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterPgm, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterPsikyo, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterSega, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterSeta, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterTaito, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterTechnos, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterToaplan, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterMiscPre90s, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterMiscPost90s, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterMegadrive, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterPce, FALSE); -// _TreeView_SetCheckState(hFilterList, hFilterSnes, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterSms, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterGg, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterSg1000, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterColeco, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterMsx, FALSE); - - nLoadMenuShowX |= MASKALL; - } else { - _TreeView_SetCheckState(hFilterList, hItemChanged, TRUE); - - _TreeView_SetCheckState(hFilterList, hFilterCapcomMisc, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterCave, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterCps1, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterCps2, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterCps3, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterDataeast, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterGalaxian, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterIrem, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterKaneko, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterKonami, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterNeogeo, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterPacman, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterPgm, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterPsikyo, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterSega, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterSeta, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterTaito, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterTechnos, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterToaplan, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterMiscPre90s, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterMiscPost90s, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterMegadrive, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterPce, TRUE); -// _TreeView_SetCheckState(hFilterList, hFilterSnes, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterSms, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterGg, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterSg1000, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterColeco, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterMsx, TRUE); - - nLoadMenuShowX &= (0xFFFFFFFF - MASKALL); //0xf8000000; make this dynamic for future hardware additions -dink - } - } - - if (hItemChanged == hBoardType) { - if ((nLoadMenuBoardTypeFilter & MASKALLBOARD) == 0) { - _TreeView_SetCheckState(hFilterList, hItemChanged, FALSE); - - _TreeView_SetCheckState(hFilterList, hFilterBootleg, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterDemo, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterHack, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterHomebrew, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterPrototype, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterGenuine, FALSE); - - nLoadMenuBoardTypeFilter = MASKALLBOARD; - } else { - _TreeView_SetCheckState(hFilterList, hItemChanged, TRUE); - - _TreeView_SetCheckState(hFilterList, hFilterBootleg, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterDemo, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterHack, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterHomebrew, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterPrototype, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterGenuine, TRUE); - - nLoadMenuBoardTypeFilter = 0; - } - } - - if (hItemChanged == hFamily) { - if ((nLoadMenuFamilyFilter & MASKALLFAMILY) == 0) { - _TreeView_SetCheckState(hFilterList, hItemChanged, FALSE); - - _TreeView_SetCheckState(hFilterList, hFilterOtherFamily, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterMslug, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterSf, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterKof, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterDstlk, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterFatfury, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterSamsho, FALSE); - _TreeView_SetCheckState(hFilterList, hFilter19xx, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterSonicwi, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterPwrinst, FALSE); - - nLoadMenuFamilyFilter = MASKALLFAMILY; - } else { - _TreeView_SetCheckState(hFilterList, hItemChanged, TRUE); - - _TreeView_SetCheckState(hFilterList, hFilterOtherFamily, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterMslug, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterSf, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterKof, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterDstlk, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterFatfury, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterSamsho, TRUE); - _TreeView_SetCheckState(hFilterList, hFilter19xx, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterSonicwi, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterPwrinst, TRUE); - - nLoadMenuFamilyFilter = 0; - } - } - - if (hItemChanged == hFavorites) { - if (nLoadMenuFavoritesFilter) { - _TreeView_SetCheckState(hFilterList, hItemChanged, FALSE); - - nLoadMenuFavoritesFilter = 0; - } else { - _TreeView_SetCheckState(hFilterList, hItemChanged, TRUE); - - nLoadMenuFavoritesFilter = 0xff; - } - } - - if (hItemChanged == hGenre) { - if ((nLoadMenuGenreFilter & MASKALLGENRE) == 0) { - _TreeView_SetCheckState(hFilterList, hItemChanged, FALSE); - - _TreeView_SetCheckState(hFilterList, hFilterHorshoot, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterVershoot, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterScrfight, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterVsfight, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterBios, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterBreakout, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterCasino, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterBallpaddle, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterMaze, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterMinigames, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterPinball, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterPlatform, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterPuzzle, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterQuiz, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterSportsmisc, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterSportsfootball, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterMisc, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterMahjong, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterRacing, FALSE); - _TreeView_SetCheckState(hFilterList, hFilterShoot, FALSE); - - nLoadMenuGenreFilter = MASKALLGENRE; - } else { - _TreeView_SetCheckState(hFilterList, hItemChanged, TRUE); - - _TreeView_SetCheckState(hFilterList, hFilterHorshoot, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterVershoot, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterScrfight, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterVsfight, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterBios, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterBreakout, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterCasino, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterBallpaddle, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterMaze, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterMinigames, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterPinball, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterPlatform, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterPuzzle, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterQuiz, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterSportsmisc, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterSportsfootball, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterMisc, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterMahjong, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterRacing, TRUE); - _TreeView_SetCheckState(hFilterList, hFilterShoot, TRUE); - - nLoadMenuGenreFilter = 0; - } - } - - if (hItemChanged == hFilterCapcomMisc) _ToggleGameListing(nLoadMenuShowX, MASKCAPMISC); - if (hItemChanged == hFilterCave) _ToggleGameListing(nLoadMenuShowX, MASKCAVE); - if (hItemChanged == hFilterCps1) _ToggleGameListing(nLoadMenuShowX, MASKCPS); - if (hItemChanged == hFilterCps2) _ToggleGameListing(nLoadMenuShowX, MASKCPS2); - if (hItemChanged == hFilterCps3) _ToggleGameListing(nLoadMenuShowX, MASKCPS3); - if (hItemChanged == hFilterDataeast) _ToggleGameListing(nLoadMenuShowX, MASKDATAEAST); - if (hItemChanged == hFilterGalaxian) _ToggleGameListing(nLoadMenuShowX, MASKGALAXIAN); - if (hItemChanged == hFilterIrem) _ToggleGameListing(nLoadMenuShowX, MASKIREM); - if (hItemChanged == hFilterKaneko) _ToggleGameListing(nLoadMenuShowX, MASKKANEKO); - if (hItemChanged == hFilterKonami) _ToggleGameListing(nLoadMenuShowX, MASKKONAMI); - if (hItemChanged == hFilterNeogeo) _ToggleGameListing(nLoadMenuShowX, MASKNEOGEO); - if (hItemChanged == hFilterPacman) _ToggleGameListing(nLoadMenuShowX, MASKPACMAN); - if (hItemChanged == hFilterPgm) _ToggleGameListing(nLoadMenuShowX, MASKPGM); - if (hItemChanged == hFilterPsikyo) _ToggleGameListing(nLoadMenuShowX, MASKPSIKYO); - if (hItemChanged == hFilterSega) _ToggleGameListing(nLoadMenuShowX, MASKSEGA); - if (hItemChanged == hFilterSeta) _ToggleGameListing(nLoadMenuShowX, MASKSETA); - if (hItemChanged == hFilterTaito) _ToggleGameListing(nLoadMenuShowX, MASKTAITO); - if (hItemChanged == hFilterTechnos) _ToggleGameListing(nLoadMenuShowX, MASKTECHNOS); - if (hItemChanged == hFilterToaplan) _ToggleGameListing(nLoadMenuShowX, MASKTOAPLAN); - if (hItemChanged == hFilterMiscPre90s) _ToggleGameListing(nLoadMenuShowX, MASKMISCPRE90S); - if (hItemChanged == hFilterMiscPost90s) _ToggleGameListing(nLoadMenuShowX, MASKMISCPOST90S); - if (hItemChanged == hFilterMegadrive) _ToggleGameListing(nLoadMenuShowX, MASKMEGADRIVE); - if (hItemChanged == hFilterPce) _ToggleGameListing(nLoadMenuShowX, MASKPCENGINE); -// if (hItemChanged == hFilterSnes) _ToggleGameListing(nLoadMenuShowX, MASKSNES); - if (hItemChanged == hFilterSms) _ToggleGameListing(nLoadMenuShowX, MASKSMS); - if (hItemChanged == hFilterGg) _ToggleGameListing(nLoadMenuShowX, MASKGG); - if (hItemChanged == hFilterSg1000) _ToggleGameListing(nLoadMenuShowX, MASKSG1000); - if (hItemChanged == hFilterColeco) _ToggleGameListing(nLoadMenuShowX, MASKCOLECO); - if (hItemChanged == hFilterMsx) _ToggleGameListing(nLoadMenuShowX, MASKMSX); - - if (hItemChanged == hFilterBootleg) _ToggleGameListing(nLoadMenuBoardTypeFilter, BDF_BOOTLEG); - if (hItemChanged == hFilterDemo) _ToggleGameListing(nLoadMenuBoardTypeFilter, BDF_DEMO); - if (hItemChanged == hFilterHack) _ToggleGameListing(nLoadMenuBoardTypeFilter, BDF_HACK); - if (hItemChanged == hFilterHomebrew) _ToggleGameListing(nLoadMenuBoardTypeFilter, BDF_HOMEBREW); - if (hItemChanged == hFilterPrototype) _ToggleGameListing(nLoadMenuBoardTypeFilter, BDF_PROTOTYPE); - if (hItemChanged == hFilterGenuine) _ToggleGameListing(nLoadMenuBoardTypeFilter, MASKBOARDTYPEGENUINE); - - if (hItemChanged == hFilterOtherFamily) _ToggleGameListing(nLoadMenuFamilyFilter, MASKFAMILYOTHER); - if (hItemChanged == hFilterMslug) _ToggleGameListing(nLoadMenuFamilyFilter, FBF_MSLUG); - if (hItemChanged == hFilterSf) _ToggleGameListing(nLoadMenuFamilyFilter, FBF_SF); - if (hItemChanged == hFilterKof) _ToggleGameListing(nLoadMenuFamilyFilter, FBF_KOF); - if (hItemChanged == hFilterDstlk) _ToggleGameListing(nLoadMenuFamilyFilter, FBF_DSTLK); - if (hItemChanged == hFilterFatfury) _ToggleGameListing(nLoadMenuFamilyFilter, FBF_FATFURY); - if (hItemChanged == hFilterSamsho) _ToggleGameListing(nLoadMenuFamilyFilter, FBF_SAMSHO); - if (hItemChanged == hFilter19xx) _ToggleGameListing(nLoadMenuFamilyFilter, FBF_19XX); - if (hItemChanged == hFilterSonicwi) _ToggleGameListing(nLoadMenuFamilyFilter, FBF_SONICWI); - if (hItemChanged == hFilterPwrinst) _ToggleGameListing(nLoadMenuFamilyFilter, FBF_PWRINST); - - if (hItemChanged == hFilterHorshoot) _ToggleGameListing(nLoadMenuGenreFilter, GBF_HORSHOOT); - if (hItemChanged == hFilterVershoot) _ToggleGameListing(nLoadMenuGenreFilter, GBF_VERSHOOT); - if (hItemChanged == hFilterScrfight) _ToggleGameListing(nLoadMenuGenreFilter, GBF_SCRFIGHT); - if (hItemChanged == hFilterVsfight) _ToggleGameListing(nLoadMenuGenreFilter, GBF_VSFIGHT); - if (hItemChanged == hFilterBios) _ToggleGameListing(nLoadMenuGenreFilter, GBF_BIOS); - if (hItemChanged == hFilterBreakout) _ToggleGameListing(nLoadMenuGenreFilter, GBF_BREAKOUT); - if (hItemChanged == hFilterCasino) _ToggleGameListing(nLoadMenuGenreFilter, GBF_CASINO); - if (hItemChanged == hFilterBallpaddle) _ToggleGameListing(nLoadMenuGenreFilter, GBF_BALLPADDLE); - if (hItemChanged == hFilterMaze) _ToggleGameListing(nLoadMenuGenreFilter, GBF_MAZE); - if (hItemChanged == hFilterMinigames) _ToggleGameListing(nLoadMenuGenreFilter, GBF_MINIGAMES); - if (hItemChanged == hFilterPinball) _ToggleGameListing(nLoadMenuGenreFilter, GBF_PINBALL); - if (hItemChanged == hFilterPlatform) _ToggleGameListing(nLoadMenuGenreFilter, GBF_PLATFORM); - if (hItemChanged == hFilterPuzzle) _ToggleGameListing(nLoadMenuGenreFilter, GBF_PUZZLE); - if (hItemChanged == hFilterQuiz) _ToggleGameListing(nLoadMenuGenreFilter, GBF_QUIZ); - if (hItemChanged == hFilterSportsmisc) _ToggleGameListing(nLoadMenuGenreFilter, GBF_SPORTSMISC); - if (hItemChanged == hFilterSportsfootball) _ToggleGameListing(nLoadMenuGenreFilter, GBF_SPORTSFOOTBALL); - if (hItemChanged == hFilterMisc) _ToggleGameListing(nLoadMenuGenreFilter, GBF_MISC); - if (hItemChanged == hFilterMahjong) _ToggleGameListing(nLoadMenuGenreFilter, GBF_MAHJONG); - if (hItemChanged == hFilterRacing) _ToggleGameListing(nLoadMenuGenreFilter, GBF_RACING); - if (hItemChanged == hFilterShoot) _ToggleGameListing(nLoadMenuGenreFilter, GBF_SHOOT); - - RebuildEverything(); - } - - if (Msg == WM_COMMAND) { - if (HIWORD(wParam) == EN_CHANGE && LOWORD(wParam) == IDC_SEL_SEARCH) { - KillTimer(hDlg, IDC_SEL_SEARCHTIMER); - SetTimer(hDlg, IDC_SEL_SEARCHTIMER, 300, (TIMERPROC)NULL); - } - - if (HIWORD(wParam) == BN_CLICKED) { - int wID = LOWORD(wParam); - switch (wID) { - case IDOK: - SelOkay(); - break; - case IDROM: - RomsDirCreate(hSelDlg); - RebuildEverything(); - break; - case IDRESCAN: - bRescanRoms = true; - CreateROMInfo(hSelDlg); - RebuildEverything(); - break; - case IDCANCEL: - bDialogCancel = true; - SendMessage(hDlg, WM_CLOSE, 0, 0); - return 0; - case IDC_CHECKAVAILABLE: - nLoadMenuShowY ^= AVAILABLE; - RebuildEverything(); - break; - case IDC_CHECKUNAVAILABLE: - nLoadMenuShowY ^= UNAVAILABLE; - RebuildEverything(); - break; - case IDC_CHECKAUTOEXPAND: - nLoadMenuShowY ^= AUTOEXPAND; - RebuildEverything(); - break; - case IDC_SEL_SHORTNAME: - nLoadMenuShowY ^= SHOWSHORT; - RebuildEverything(); - break; - case IDC_SEL_ASCIIONLY: - nLoadMenuShowY ^= ASCIIONLY; - RebuildEverything(); - break; - case IDGAMEINFO: - if (bDrvSelected) { - GameInfoDialogCreate(hSelDlg, nBurnDrvActive); - SetFocus(hSelList); // Update list for Rescan Romset button - } else { - MessageBox(hSelDlg, FBALoadStringEx(hAppInst, IDS_ERR_NO_DRIVER_SELECTED, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - } - break; - case IDC_SEL_IPSMANAGER: - if (bDrvSelected) { - IpsManagerCreate(hSelDlg); - LoadIpsActivePatches(); - if (GetIpsNumActivePatches()) { - EnableWindow(GetDlgItem(hDlg, IDC_SEL_APPLYIPS), TRUE); - } else { - EnableWindow(GetDlgItem(hDlg, IDC_SEL_APPLYIPS), FALSE); - } - SetFocus(hSelList); - } else { - MessageBox(hSelDlg, FBALoadStringEx(hAppInst, IDS_ERR_NO_DRIVER_SELECTED, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - } - break; - case IDC_SEL_APPLYIPS: - bDoIpsPatch = !bDoIpsPatch; - break; - } - } - - int id = LOWORD(wParam); - - switch (id) { - case GAMESEL_MENU_PLAY: { - SelOkay(); - break; - } - - case GAMESEL_MENU_GAMEINFO: { - /*UpdatePreview(true, hSelDlg, szAppPreviewsPath); - if (nTimer) { - KillTimer(hSelDlg, nTimer); - nTimer = 0; - } - GameInfoDialogCreate(hSelDlg, nBurnDrvSelect);*/ - if (bDrvSelected) { - GameInfoDialogCreate(hSelDlg, nBurnDrvActive); - SetFocus(hSelList); // Update list for Rescan Romset button - } else { - MessageBox(hSelDlg, FBALoadStringEx(hAppInst, IDS_ERR_NO_DRIVER_SELECTED, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - } - break; - } - - case GAMESEL_MENU_VIEWEMMA: { - if (!nVidFullscreen) { - ViewEmma(); - } - break; - } - - case GAMESEL_MENU_FAVORITE: { // toggle favorite status. - if (bDrvSelected) { - AddFavorite_Ext((CheckFavorites(BurnDrvGetTextA(DRV_NAME)) == -1) ? 1 : 0); - } else { - MessageBox(hSelDlg, FBALoadStringEx(hAppInst, IDS_ERR_NO_DRIVER_SELECTED, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - } - - break; - } - } - } - - if (Msg == WM_TIMER) { - switch (wParam) { - case IDC_SEL_SEARCHTIMER: - KillTimer(hDlg, IDC_SEL_SEARCHTIMER); - RebuildEverything(); - break; - } - } - - if (Msg == UM_CLOSE) { - nDialogSelect = nOldDlgSelected; - MyEndDialog(); - DeleteObject(hWhiteBGBrush); - return 0; - } - - if (Msg == WM_CLOSE) { - bDialogCancel = true; - nDialogSelect = nOldDlgSelected; - MyEndDialog(); - DeleteObject(hWhiteBGBrush); - return 0; - } - - if (Msg == WM_GETMINMAXINFO) { - MINMAXINFO *info = (MINMAXINFO*)lParam; - - info->ptMinTrackSize.x = nDlgInitialWidth; - info->ptMinTrackSize.y = nDlgInitialHeight; - - return 0; - } - - if (Msg == WM_WINDOWPOSCHANGED) { - RECT rc; - int xDelta; - int yDelta; - int xScrollBarDelta; - - if (nDlgInitialWidth == 0 || nDlgInitialHeight == 0) return 0; - - GetClientRect(hDlg, &rc); - - xDelta = nDlgInitialWidth - rc.right; - yDelta = nDlgInitialHeight - rc.bottom; - - if (xDelta == 0 && yDelta == 0) return 0; - - SetControlPosAlignTopRight(IDC_STATIC_OPT, nDlgOptionsGrpInitialPos); - SetControlPosAlignTopRight(IDC_CHECKAVAILABLE, nDlgAvailableChbInitialPos); - SetControlPosAlignTopRight(IDC_CHECKUNAVAILABLE, nDlgUnavailableChbInitialPos); - SetControlPosAlignTopRight(IDC_CHECKAUTOEXPAND, nDlgAlwaysClonesChbInitialPos); - SetControlPosAlignTopRight(IDC_SEL_SHORTNAME, nDlgZipnamesChbInitialPos); - SetControlPosAlignTopRight(IDC_SEL_ASCIIONLY, nDlgLatinTextChbInitialPos); - SetControlPosAlignTopRight(IDROM, nDlgRomDirsBtnInitialPos); - SetControlPosAlignTopRight(IDRESCAN, nDlgScanRomsBtnInitialPos); - - SetControlPosAlignTopRightResizeVert(IDC_STATIC_SYS, nDlgFilterGrpInitialPos); - SetControlPosAlignTopRightResizeVert(IDC_TREE2, nDlgFilterTreeInitialPos); - - SetControlPosAlignBottomRight(IDC_SEL_IPSGROUP, nDlgIpsGrpInitialPos); - SetControlPosAlignBottomRight(IDC_SEL_APPLYIPS, nDlgApplyIpsChbInitialPos); - SetControlPosAlignBottomRight(IDC_SEL_IPSMANAGER, nDlgIpsManBtnInitialPos); - SetControlPosAlignBottomRight(IDC_SEL_SEARCHGROUP, nDlgSearchGrpInitialPos); - SetControlPosAlignBottomRight(IDC_SEL_SEARCH, nDlgSearchTxtInitialPos); - SetControlPosAlignBottomRight(IDCANCEL, nDlgCancelBtnInitialPos); - SetControlPosAlignBottomRight(IDOK, nDlgPlayBtnInitialPos); - - SetControlPosAlignTopLeft(IDC_STATIC2, nDlgPreviewGrpInitialPos); - SetControlPosAlignTopLeft(IDC_SCREENSHOT_H, nDlgPreviewImgHInitialPos); - SetControlPosAlignTopLeft(IDC_SCREENSHOT_V, nDlgPreviewImgVInitialPos); - SetControlPosAlignTopLeft(IDC_STATIC3, nDlgTitleGrpInitialPos); - SetControlPosAlignTopLeft(IDC_SCREENSHOT2_H, nDlgTitleImgHInitialPos); - SetControlPosAlignTopLeft(IDC_SCREENSHOT2_V, nDlgTitleImgVInitialPos); - - SetControlPosAlignBottomLeftResizeHor(IDC_STATIC_INFOBOX, nDlgWhiteBoxInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_LABELCOMMENT, nDlgGameInfoLblInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_LABELROMNAME, nDlgRomNameLblInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_LABELROMINFO, nDlgRomInfoLblInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_LABELSYSTEM, nDlgReleasedByLblInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_LABELGENRE, nDlgGenreLblInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_LABELNOTES, nDlgNotesLblInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_TEXTCOMMENT, nDlgGameInfoTxtInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_TEXTROMNAME, nDlgRomNameTxtInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_TEXTROMINFO, nDlgRomInfoTxtInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_TEXTSYSTEM, nDlgReleasedByTxtInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_TEXTGENRE, nDlgGenreTxtInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_TEXTNOTES, nDlgNotesTxtInitialPos); - SetControlPosAlignBottomLeftResizeHor(IDC_DRVCOUNT, nDlgDrvCountTxtInitialPos); - SetControlPosAlignBottomRight(IDGAMEINFO, nDlgDrvRomInfoBtnInitialPos); - - SetControlPosAlignTopLeftResizeHorVert(IDC_STATIC1, nDlgSelectGameGrpInitialPos); - - if (bIsWindowsXP && nTmpDrvCount < 12) { // Fix an issue on WinXP where the scrollbar overwrites past the tree size when less then 12 items are in the list - SetControlPosAlignTopLeftResizeHorVertALT(IDC_TREE1, nDlgSelectGameLstInitialPos); - } else { - SetControlPosAlignTopLeftResizeHorVert(IDC_TREE1, nDlgSelectGameLstInitialPos); - } - - InvalidateRect(hSelDlg, NULL, true); - UpdateWindow(hSelDlg); - - return 0; - } - -// if (Msg == WM_TIMER) { -// UpdatePreview(false, szAppPreviewsPath, IDC_SCREENSHOT_H, IDC_SCREENSHOT_V); -// return 0; -// } - - if (Msg == WM_CTLCOLORSTATIC) { - for (int i = 0; i < 6; i++) { - if ((HWND)lParam == hInfoLabel[i]) { return (INT_PTR)hWhiteBGBrush; } - if ((HWND)lParam == hInfoText[i]) { return (INT_PTR)hWhiteBGBrush; } - } - } - - NMHDR* pNmHdr = (NMHDR*)lParam; - if (Msg == WM_NOTIFY) - { - if ((pNmHdr->code == NM_CLICK) && (pNmHdr->idFrom == IDC_TREE2)) - { - TVHITTESTINFO thi; - DWORD dwpos = GetMessagePos(); - thi.pt.x = GET_X_LPARAM(dwpos); - thi.pt.y = GET_Y_LPARAM(dwpos); - MapWindowPoints(HWND_DESKTOP, pNmHdr->hwndFrom, &thi.pt, 1); - TreeView_HitTest(pNmHdr->hwndFrom, &thi); - - if(TVHT_ONITEMSTATEICON & thi.flags) { - PostMessage(hSelDlg, UM_CHECKSTATECHANGE, 0, (LPARAM)thi.hItem); - } - - return 1; - } - - NMTREEVIEW* pnmtv = (NMTREEVIEW*)lParam; - - if (!TreeBuilding && pnmtv->hdr.code == NM_DBLCLK && pnmtv->hdr.idFrom == IDC_TREE1) - { - DWORD dwpos = GetMessagePos(); - - TVHITTESTINFO thi; - thi.pt.x = GET_X_LPARAM(dwpos); - thi.pt.y = GET_Y_LPARAM(dwpos); - - MapWindowPoints(HWND_DESKTOP, pNmHdr->hwndFrom, &thi.pt, 1); - - TreeView_HitTest(pNmHdr->hwndFrom, &thi); - - HTREEITEM hSelectHandle = thi.hItem; - if(hSelectHandle == NULL) return 1; - - TreeView_SelectItem(hSelList, hSelectHandle); - - // Search through nBurnDrv[] for the nBurnDrvNo according to the returned hSelectHandle - for (unsigned int i = 0; i < nTmpDrvCount; i++) { - if (hSelectHandle == nBurnDrv[i].hTreeHandle) { - nBurnDrvActive = nBurnDrv[i].nBurnDrvNo; - break; - } - } - - nDialogSelect = nBurnDrvActive; - bDrvSelected = true; - - SelOkay(); - - // disable double-click node-expand - SetWindowLongPtr(hSelDlg, DWLP_MSGRESULT, 1); - - return 1; - } - - if (pNmHdr->code == NM_CUSTOMDRAW && LOWORD(wParam) == IDC_TREE1) { - LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam; - int nGetTextFlags = nLoadMenuShowY & ASCIIONLY ? DRV_ASCIIONLY : 0; - HTREEITEM hSelectHandle; - - switch (lplvcd->nmcd.dwDrawStage) { - case CDDS_PREPAINT: { - SetWindowLongPtr(hSelDlg, DWLP_MSGRESULT, CDRF_NOTIFYITEMDRAW); - return 1; - } - - case CDDS_ITEMPREPAINT: { - hSelectHandle = (HTREEITEM)(lplvcd->nmcd.dwItemSpec); - HBRUSH hBackBrush; - RECT rect; - - // TVITEM (msdn.microsoft.com) This structure is identical to the TV_ITEM structure, but it has been renamed to - // follow current naming conventions. New applications should use this structure. - - //TV_ITEM TvItem; - TVITEM TvItem; - TvItem.hItem = hSelectHandle; - TvItem.mask = TVIF_PARAM | TVIF_STATE | TVIF_CHILDREN; - SendMessage(hSelList, TVM_GETITEM, 0, (LPARAM)&TvItem); - -// dprintf(_T(" - Item (%i%i) - (%i%i) %hs\n"), lplvcd->nmcd.rc.left, lplvcd->nmcd.rc.top, lplvcd->nmcd.rc.right, lplvcd->nmcd.rc.bottom, ((NODEINFO*)TvItem.lParam)->pszROMName); - - // Set the foreground and background colours unless the item is highlighted - if (!(TvItem.state & (TVIS_SELECTED | TVIS_DROPHILITED))) { - - // Set less contrasting colours for clones - if (!((NODEINFO*)TvItem.lParam)->bIsParent) { - lplvcd->clrTextBk = RGB(0xD7, 0xD7, 0xD7); - lplvcd->clrText = RGB(0x3F, 0x3F, 0x3F); - } - - // For parents, change the colour of the background, for clones, change only the text colour - if (!CheckWorkingStatus(((NODEINFO*)TvItem.lParam)->nBurnDrvNo)) { - lplvcd->clrText = RGB(0x7F, 0x7F, 0x7F); - } - } - - rect.left = lplvcd->nmcd.rc.left; - rect.right = lplvcd->nmcd.rc.right; - rect.top = lplvcd->nmcd.rc.top; - rect.bottom = lplvcd->nmcd.rc.bottom; - - hBackBrush = CreateSolidBrush(lplvcd->clrTextBk); - - nBurnDrvActive = ((NODEINFO*)TvItem.lParam)->nBurnDrvNo; - - { - // Fill background - FillRect(lplvcd->nmcd.hdc, &lplvcd->nmcd.rc, hBackBrush); - } - - { - // Draw plus and minus buttons - if (((NODEINFO*)TvItem.lParam)->bIsParent) { - if (TvItem.state & TVIS_EXPANDED) { - DrawIconEx(lplvcd->nmcd.hdc, rect.left + 4, rect.top + nIconsYDiff, hCollapse, 16, 16, 0, NULL, DI_NORMAL); - } else { - if (TvItem.cChildren) { - DrawIconEx(lplvcd->nmcd.hdc, rect.left + 4, rect.top + nIconsYDiff, hExpand, 16, 16, 0, NULL, DI_NORMAL); - } - } - } - rect.left += 16 + 8; - } - - rect.top += 2; - - { - // Draw text - - TCHAR szText[1024]; - TCHAR* pszPosition = szText; - TCHAR* pszName; - SIZE size = { 0, 0 }; - - SetTextColor(lplvcd->nmcd.hdc, lplvcd->clrText); - SetBkMode(lplvcd->nmcd.hdc, TRANSPARENT); - - // Display the short name if needed - if (nLoadMenuShowY & SHOWSHORT) { - DrawText(lplvcd->nmcd.hdc, BurnDrvGetText(DRV_NAME), -1, &rect, DT_NOPREFIX | DT_SINGLELINE | DT_LEFT | DT_VCENTER); - rect.left += 16 + 40 + 20 + 10; - } - - { - // Draw icons if needed - if (!CheckWorkingStatus(((NODEINFO*)TvItem.lParam)->nBurnDrvNo)) { - DrawIconEx(lplvcd->nmcd.hdc, rect.left, rect.top, hNotWorking, nIconsSizeXY, nIconsSizeXY, 0, NULL, DI_NORMAL); - rect.left += nIconsSizeXY + 4; - } else { - if (!(gameAv[((NODEINFO*)TvItem.lParam)->nBurnDrvNo])) { - DrawIconEx(lplvcd->nmcd.hdc, rect.left, rect.top, hNotFoundEss, nIconsSizeXY, nIconsSizeXY, 0, NULL, DI_NORMAL); - rect.left += nIconsSizeXY + 4; - } else { - if (!(nLoadMenuShowY & AVAILABLE) && !(gameAv[((NODEINFO*)TvItem.lParam)->nBurnDrvNo] & 2)) { - DrawIconEx(lplvcd->nmcd.hdc, rect.left, rect.top, hNotFoundNonEss, nIconsSizeXY, nIconsSizeXY, 0, NULL, DI_NORMAL); - rect.left += nIconsSizeXY + 4; - } - } - } - } - - // Driver Icon drawing code... - if(bEnableIcons && bIconsLoaded) { - if(hDrvIcon[nBurnDrvActive]) { - DrawIconEx(lplvcd->nmcd.hdc, rect.left, rect.top, hDrvIcon[nBurnDrvActive], nIconsSizeXY, nIconsSizeXY, 0, NULL, DI_NORMAL); - } - - if(!hDrvIcon[nBurnDrvActive]) { - DrawIconEx(lplvcd->nmcd.hdc, rect.left, rect.top, hDrvIconMiss, nIconsSizeXY, nIconsSizeXY, 0, NULL, DI_NORMAL); - } - rect.left += nIconsSizeXY + 4; - } - - _tcsncpy(szText, MangleGamename(BurnDrvGetText(nGetTextFlags | DRV_FULLNAME), false), 1024); - szText[1023] = _T('\0'); - - GetTextExtentPoint32(lplvcd->nmcd.hdc, szText, _tcslen(szText), &size); - - DrawText(lplvcd->nmcd.hdc, szText, -1, &rect, DT_NOPREFIX | DT_SINGLELINE | DT_LEFT | DT_VCENTER); - - // Display extra info if needed - szText[0] = _T('\0'); - - pszName = BurnDrvGetText(nGetTextFlags | DRV_FULLNAME); - while ((pszName = BurnDrvGetText(nGetTextFlags | DRV_NEXTNAME | DRV_FULLNAME)) != NULL) { - if (pszPosition + _tcslen(pszName) - 1024 > szText) { - break; - } - pszPosition += _stprintf(pszPosition, _T(SEPERATOR_2) _T("%s"), pszName); - } - if (szText[0]) { - szText[255] = _T('\0'); - - unsigned int r = ((lplvcd->clrText >> 16 & 255) * 2 + (lplvcd->clrTextBk >> 16 & 255)) / 3; - unsigned int g = ((lplvcd->clrText >> 8 & 255) * 2 + (lplvcd->clrTextBk >> 8 & 255)) / 3; - unsigned int b = ((lplvcd->clrText >> 0 & 255) * 2 + (lplvcd->clrTextBk >> 0 & 255)) / 3; - - rect.left += size.cx; - SetTextColor(lplvcd->nmcd.hdc, (r << 16) | (g << 8) | (b << 0)); - DrawText(lplvcd->nmcd.hdc, szText, -1, &rect, DT_NOPREFIX | DT_SINGLELINE | DT_LEFT | DT_VCENTER); - } - } - - DeleteObject(hBackBrush); - - SetWindowLongPtr(hSelDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT); - return 1; - } - - default: { - SetWindowLongPtr(hSelDlg, DWLP_MSGRESULT, CDRF_DODEFAULT); - return 1; - } - } - } - - if (pNmHdr->code == TVN_ITEMEXPANDING && !TreeBuilding && LOWORD(wParam) == IDC_TREE1) { - SendMessage(hSelList, TVM_SELECTITEM, TVGN_CARET, (LPARAM)((LPNMTREEVIEW)lParam)->itemNew.hItem); - return FALSE; - } - - if (pNmHdr->code == TVN_SELCHANGED && !TreeBuilding && LOWORD(wParam) == IDC_TREE1) { - HTREEITEM hSelectHandle = (HTREEITEM)SendMessage(hSelList, TVM_GETNEXTITEM, TVGN_CARET, ~0U); - - // Search through nBurnDrv[] for the nBurnDrvNo according to the returned hSelectHandle - for (unsigned int i = 0; i < nTmpDrvCount; i++) { - if (hSelectHandle == nBurnDrv[i].hTreeHandle) - { - nBurnDrvActive = nBurnDrv[i].nBurnDrvNo; - nDialogSelect = nBurnDrvActive; - bDrvSelected = true; - UpdatePreview(true, szAppPreviewsPath, IDC_SCREENSHOT_H, IDC_SCREENSHOT_V); - UpdatePreview(false, szAppTitlesPath, IDC_SCREENSHOT2_H, IDC_SCREENSHOT2_V); - break; - } - } - - if (GetIpsNumPatches()) { - if (!nShowMVSCartsOnly) EnableWindow(GetDlgItem(hDlg, IDC_SEL_IPSMANAGER), TRUE); - } else { - EnableWindow(GetDlgItem(hDlg, IDC_SEL_IPSMANAGER), FALSE); - } - - LoadIpsActivePatches(); - if (GetIpsNumActivePatches()) { - if (!nShowMVSCartsOnly) EnableWindow(GetDlgItem(hDlg, IDC_SEL_APPLYIPS), TRUE); - } else { - EnableWindow(GetDlgItem(hDlg, IDC_SEL_APPLYIPS), FALSE); - } - - // Get the text from the drivers via BurnDrvGetText() - for (int i = 0; i < 6; i++) { - int nGetTextFlags = nLoadMenuShowY & ASCIIONLY ? DRV_ASCIIONLY : 0; - TCHAR szItemText[256]; - szItemText[0] = _T('\0'); - - switch (i) { - case 0: { - bool bBracket = false; - - _stprintf(szItemText, _T("%s"), BurnDrvGetText(DRV_NAME)); - if ((BurnDrvGetFlags() & BDF_CLONE) && BurnDrvGetTextA(DRV_PARENT)) { - int nOldDrvSelect = nBurnDrvActive; - TCHAR* pszName = BurnDrvGetText(DRV_PARENT); - - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_CLONE_OF, true), BurnDrvGetText(DRV_PARENT)); - - for (nBurnDrvActive = 0; nBurnDrvActive < nBurnDrvCount; nBurnDrvActive++) { - if (!_tcsicmp(pszName, BurnDrvGetText(DRV_NAME))) { - break; - } - } - if (nBurnDrvActive < nBurnDrvCount) { - if (BurnDrvGetText(DRV_PARENT)) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_ROMS_FROM_1, true), BurnDrvGetText(DRV_PARENT)); - } - } - nBurnDrvActive = nOldDrvSelect; - bBracket = true; - } else { - if (BurnDrvGetTextA(DRV_PARENT)) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_ROMS_FROM_2, true), bBracket ? _T(", ") : _T(" ("), BurnDrvGetText(DRV_PARENT)); - bBracket = true; - } - } - if (BurnDrvGetTextA(DRV_SAMPLENAME)) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SAMPLES_FROM, true), bBracket ? _T(", ") : _T(" ("), BurnDrvGetText(DRV_SAMPLENAME)); - bBracket = true; - } - if (bBracket) { - _stprintf(szItemText + _tcslen(szItemText), _T(")")); - } - SendMessage(hInfoText[i], WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - EnableWindow(hInfoLabel[i], TRUE); - break; - } - case 1: { - bool bUseInfo = false; - - if (BurnDrvGetFlags() & BDF_PROTOTYPE) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_PROTOTYPE, true)); - bUseInfo = true; - } - if (BurnDrvGetFlags() & BDF_BOOTLEG) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_BOOTLEG, true), bUseInfo ? _T(", ") : _T("")); - bUseInfo = true; - } - if (BurnDrvGetFlags() & BDF_HACK) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_HACK, true), bUseInfo ? _T(", ") : _T("")); - bUseInfo = true; - } - if (BurnDrvGetFlags() & BDF_HOMEBREW) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_HOMEBREW, true), bUseInfo ? _T(", ") : _T("")); - bUseInfo = true; - } - if (BurnDrvGetFlags() & BDF_DEMO) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_SEL_DEMO, true), bUseInfo ? _T(", ") : _T("")); - bUseInfo = true; - } - TCHAR szPlayersMax[100]; - _stprintf(szPlayersMax, FBALoadStringEx(hAppInst, IDS_NUM_PLAYERS_MAX, true)); - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_NUM_PLAYERS, true), bUseInfo ? _T(", ") : _T(""), BurnDrvGetMaxPlayers(), (BurnDrvGetMaxPlayers() != 1) ? szPlayersMax : _T("")); - bUseInfo = true; - if (BurnDrvGetText(DRV_BOARDROM)) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_BOARD_ROMS_FROM, true), bUseInfo ? _T(", ") : _T(""), BurnDrvGetText(DRV_BOARDROM)); - SendMessage(hInfoText[i], WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - EnableWindow(hInfoLabel[i], TRUE); - bUseInfo = true; - } - SendMessage(hInfoText[i], WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - EnableWindow(hInfoLabel[i], bUseInfo); - break; - } - case 2: { - TCHAR szUnknown[100]; - TCHAR szCartridge[100]; - _stprintf(szUnknown, FBALoadStringEx(hAppInst, IDS_ERR_UNKNOWN, true)); - _stprintf(szCartridge, FBALoadStringEx(hAppInst, IDS_MVS_CARTRIDGE, true)); - _stprintf(szItemText, FBALoadStringEx(hAppInst, IDS_HARDWARE_DESC, true), BurnDrvGetTextA(DRV_MANUFACTURER) ? BurnDrvGetText(nGetTextFlags | DRV_MANUFACTURER) : szUnknown, BurnDrvGetText(DRV_DATE), (((BurnDrvGetHardwareCode() & HARDWARE_SNK_MVS) == HARDWARE_SNK_MVS) && ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK)) == HARDWARE_SNK_NEOGEO)? szCartridge : BurnDrvGetText(nGetTextFlags | DRV_SYSTEM)); - SendMessage(hInfoText[i], WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - EnableWindow(hInfoLabel[i], TRUE); - break; - } - case 3: { - TCHAR szText[1024] = _T(""); - TCHAR* pszPosition = szText; - TCHAR* pszName = BurnDrvGetText(nGetTextFlags | DRV_FULLNAME); - - pszPosition += _sntprintf(szText, 1024, pszName); - - pszName = BurnDrvGetText(nGetTextFlags | DRV_FULLNAME); - while ((pszName = BurnDrvGetText(nGetTextFlags | DRV_NEXTNAME | DRV_FULLNAME)) != NULL) { - if (pszPosition + _tcslen(pszName) - 1024 > szText) { - break; - } - pszPosition += _stprintf(pszPosition, _T(SEPERATOR_2) _T("%s"), pszName); - } - SendMessage(hInfoText[i], WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - if (szText[0]) { - EnableWindow(hInfoLabel[i], TRUE); - } else { - EnableWindow(hInfoLabel[i], FALSE); - } - break; - } - case 4: { - _stprintf(szItemText, _T("%s"), BurnDrvGetTextA(DRV_COMMENT) ? BurnDrvGetText(nGetTextFlags | DRV_COMMENT) : _T("")); - if (BurnDrvGetFlags() & BDF_HISCORE_SUPPORTED) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_HISCORES_SUPPORTED, true), _tcslen(szItemText) ? _T(", ") : _T("")); - } - SendMessage(hInfoText[i], WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - EnableWindow(hInfoLabel[i], TRUE); - break; - } - - case 5: { - _stprintf(szItemText, _T("%s"), DecorateGenreInfo()); - SendMessage(hInfoText[i], WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - EnableWindow(hInfoLabel[i], TRUE); - break; - } - } - } - } - - if(!TreeBuilding && pnmtv->hdr.code == NM_RCLICK && pnmtv->hdr.idFrom == IDC_TREE1) - { - DWORD dwpos = GetMessagePos(); - - TVHITTESTINFO thi; - thi.pt.x = GET_X_LPARAM(dwpos); - thi.pt.y = GET_Y_LPARAM(dwpos); - - MapWindowPoints(HWND_DESKTOP, pNmHdr->hwndFrom, &thi.pt, 1); - - TreeView_HitTest(pNmHdr->hwndFrom, &thi); - - HTREEITEM hSelectHandle = thi.hItem; - if(hSelectHandle == NULL) return 1; - - TreeView_SelectItem(hSelList, hSelectHandle); - - // Search through nBurnDrv[] for the nBurnDrvNo according to the returned hSelectHandle - for (unsigned int i = 0; i < nTmpDrvCount; i++) { - if (hSelectHandle == nBurnDrv[i].hTreeHandle) { - nBurnDrvSelect[0] = nBurnDrv[i].nBurnDrvNo; - break; - } - } - - nDialogSelect = nBurnDrvSelect[0]; - bDrvSelected = true; - UpdatePreview(true, szAppPreviewsPath, IDC_SCREENSHOT_H, IDC_SCREENSHOT_V); - UpdatePreview(false, szAppTitlesPath, IDC_SCREENSHOT2_H, IDC_SCREENSHOT2_V); - - // Menu - POINT oPoint; - GetCursorPos(&oPoint); - - HMENU hMenuLoad = FBALoadMenu(hAppInst, MAKEINTRESOURCE(IDR_MENU_GAMESEL)); - HMENU hMenuX = GetSubMenu(hMenuLoad, 0); - - CheckMenuItem(hMenuX, GAMESEL_MENU_FAVORITE, (CheckFavorites(BurnDrvGetTextA(DRV_NAME)) != -1) ? MF_CHECKED : MF_UNCHECKED); - - TrackPopupMenu(hMenuX, TPM_LEFTALIGN | TPM_RIGHTBUTTON, oPoint.x, oPoint.y, 0, hSelDlg, NULL); - DestroyMenu(hMenuLoad); - - return 1; - } - } - return 0; -} - -int SelDialog(int nMVSCartsOnly, HWND hParentWND) -{ - int nOldSelect = nBurnDrvActive; - - if(bDrvOkay) { - nOldDlgSelected = nBurnDrvActive; - } - - hParent = hParentWND; - nShowMVSCartsOnly = nMVSCartsOnly; - - InitCommonControls(); - - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_SELNEW), hParent, (DLGPROC)DialogProc); - - hSelDlg = NULL; - hSelList = NULL; - - if (nBurnDrv) { - free(nBurnDrv); - nBurnDrv = NULL; - } - - nBurnDrvActive = nOldSelect; - - return nDialogSelect; -} - -// ----------------------------------------------------------------------------- - -static HBITMAP hMVSpreview[6]; -static unsigned int nPrevDrvSelect[6]; - -static void UpdateInfoROMInfo() -{ -// int nGetTextFlags = nLoadMenuShowY & ASCIIONLY ? DRV_ASCIIONLY : 0; - TCHAR szItemText[256] = _T(""); - bool bBracket = false; - - _stprintf(szItemText, _T("%s"), BurnDrvGetText(DRV_NAME)); - if ((BurnDrvGetFlags() & BDF_CLONE) && BurnDrvGetTextA(DRV_PARENT)) { - int nOldDrvSelect = nBurnDrvActive; - TCHAR* pszName = BurnDrvGetText(DRV_PARENT); - - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_CLONE_OF, true), BurnDrvGetText(DRV_PARENT)); - - for (nBurnDrvActive = 0; nBurnDrvActive < nBurnDrvCount; nBurnDrvActive++) { - if (!_tcsicmp(pszName, BurnDrvGetText(DRV_NAME))) { - break; - } - } - if (nBurnDrvActive < nBurnDrvCount) { - if (BurnDrvGetText(DRV_PARENT)) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_ROMS_FROM_1, true), BurnDrvGetText(DRV_PARENT)); - } - } - nBurnDrvActive = nOldDrvSelect; - bBracket = true; - } else { - if (BurnDrvGetTextA(DRV_PARENT)) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_ROMS_FROM_2, true), bBracket ? _T(", ") : _T(" ("), BurnDrvGetText(DRV_PARENT)); - bBracket = true; - } - } - if (BurnDrvGetText(DRV_BOARDROM)) { - _stprintf(szItemText + _tcslen(szItemText), FBALoadStringEx(hAppInst, IDS_BOARD_ROMS_FROM, true), bBracket ? _T(", ") : _T(" ("), BurnDrvGetText(DRV_BOARDROM)); - bBracket = true; - } - if (bBracket) { - _stprintf(szItemText + _tcslen(szItemText), _T(")")); - } - - if (hInfoText[0]) { - SendMessage(hInfoText[0], WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - } - if (hInfoLabel[0]) { - EnableWindow(hInfoLabel[0], TRUE); - } - - return; -} - -static void UpdateInfoRelease() -{ - int nGetTextFlags = nLoadMenuShowY & ASCIIONLY ? DRV_ASCIIONLY : 0; - TCHAR szItemText[256] = _T(""); - - TCHAR szUnknown[100]; - TCHAR szCartridge[100]; - TCHAR szHardware[100]; - _stprintf(szUnknown, FBALoadStringEx(hAppInst, IDS_ERR_UNKNOWN, true)); - _stprintf(szCartridge, FBALoadStringEx(hAppInst, IDS_CARTRIDGE, true)); - _stprintf(szHardware, FBALoadStringEx(hAppInst, IDS_HARDWARE, true)); - _stprintf(szItemText, _T("%s (%s, %s %s)"), BurnDrvGetTextA(DRV_MANUFACTURER) ? BurnDrvGetText(nGetTextFlags | DRV_MANUFACTURER) : szUnknown, BurnDrvGetText(DRV_DATE), - BurnDrvGetText(nGetTextFlags | DRV_SYSTEM), (BurnDrvGetHardwareCode() & HARDWARE_PREFIX_CARTRIDGE) ? szCartridge : szHardware); - - if (hInfoText[2]) { - SendMessage(hInfoText[2], WM_SETTEXT, (WPARAM)0, (LPARAM)szItemText); - } - if (hInfoLabel[2]) { - EnableWindow(hInfoLabel[2], TRUE); - } - - return; -} - -static void UpdateInfoGameInfo() -{ - int nGetTextFlags = nLoadMenuShowY & ASCIIONLY ? DRV_ASCIIONLY : 0; - TCHAR szText[1024] = _T(""); - TCHAR* pszPosition = szText; - TCHAR* pszName = BurnDrvGetText(nGetTextFlags | DRV_FULLNAME); - - pszPosition += _sntprintf(szText, 1024, pszName); - - pszName = BurnDrvGetText(nGetTextFlags | DRV_FULLNAME); - while ((pszName = BurnDrvGetText(nGetTextFlags | DRV_NEXTNAME | DRV_FULLNAME)) != NULL) { - if (pszPosition + _tcslen(pszName) - 1024 > szText) { - break; - } - pszPosition += _stprintf(pszPosition, _T(SEPERATOR_2) _T("%s"), pszName); - } - if (BurnDrvGetText(nGetTextFlags | DRV_COMMENT)) { - pszPosition += _sntprintf(pszPosition, szText + 1024 - pszPosition, _T(SEPERATOR_1) _T("%s"), BurnDrvGetText(nGetTextFlags | DRV_COMMENT)); - } - - if (hInfoText[3]) { - SendMessage(hInfoText[3], WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - } - if (hInfoLabel[3]) { - if (szText[0]) { - EnableWindow(hInfoLabel[3], TRUE); - } else { - EnableWindow(hInfoLabel[3], FALSE); - } - } - - return; -} - -static int MVSpreviewUpdateSlot(int nSlot, HWND hDlg) -{ - int nOldSelect = nBurnDrvActive; - - if (nSlot >= 0 && nSlot < 6) { - hInfoLabel[0] = 0; hInfoLabel[1] = 0; hInfoLabel[2] = 0; hInfoLabel[3] = 0; - hInfoText[0] = GetDlgItem(hDlg, IDC_MVS_TEXTROMNAME1 + nSlot); - hInfoText[1] = 0; - hInfoText[2] = GetDlgItem(hDlg, IDC_MVS_TEXTSYSTEM1 + nSlot); - hInfoText[3] = GetDlgItem(hDlg, IDC_MVS_TEXTCOMMENT1 + nSlot); - - for (int j = 0; j < 4; j++) { - if (hInfoText[j]) { - SendMessage(hInfoText[j], WM_SETTEXT, (WPARAM)0, (LPARAM)_T("")); - } - if (hInfoLabel[j]) { - EnableWindow(hInfoLabel[j], FALSE); - } - } - - nBurnDrvActive = nBurnDrvSelect[nSlot]; - if (nBurnDrvActive < nBurnDrvCount) { - - FILE* fp = OpenPreview(0, szAppTitlesPath); - if (fp) { - hMVSpreview[nSlot] = PNGLoadBitmap(hDlg, fp, 72, 54, 5); - fclose(fp); - } else { - hMVSpreview[nSlot] = PNGLoadBitmap(hDlg, NULL, 72, 54, 4); - } - - UpdateInfoROMInfo(); - UpdateInfoRelease(); - UpdateInfoGameInfo(); - nPrevDrvSelect[nSlot] = nBurnDrvActive; - - } else { - hMVSpreview[nSlot] = PNGLoadBitmap(hDlg, NULL, 72, 54, 4); - SendMessage(hInfoText[0], WM_SETTEXT, (WPARAM)0, (LPARAM)FBALoadStringEx(hAppInst, IDS_EMPTY, true)); - } - - SendDlgItemMessage(hDlg, IDC_MVS_CART1 + nSlot, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hMVSpreview[nSlot]); - } - - nBurnDrvActive = nOldSelect; - - return 0; -} - -static int MVSpreviewEndDialog() -{ - for (int i = 0; i < 6; i++) { - DeleteObject((HGDIOBJ)hMVSpreview[i]); - hMVSpreview[i] = NULL; - } - - return 0; -} - -static INT_PTR CALLBACK MVSpreviewProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM) -{ - switch (Msg) { - case WM_INITDIALOG: { - - nDialogSelect = ~0U; - - for (int i = 0; i < 6; i++) { - nPrevDrvSelect[i] = nBurnDrvSelect[i]; - MVSpreviewUpdateSlot(i, hDlg); - } - - WndInMid(hDlg, hScrnWnd); - - return TRUE; - } - case WM_COMMAND: - if (LOWORD(wParam) == ID_VALUE_CLOSE) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - break; - } - if (HIWORD(wParam) == BN_CLICKED) { - if (LOWORD(wParam) == IDOK) { - if (nPrevDrvSelect[0] == ~0U) { - MessageBox(hSelDlg, FBALoadStringEx(hAppInst, IDS_ERR_NO_DRIVER_SEL_SLOT1, true), FBALoadStringEx(hAppInst, IDS_ERR_ERROR, true), MB_OK); - break; - } - MVSpreviewEndDialog(); - for (int i = 0; i < 6; i++) { - nBurnDrvSelect[i] = nPrevDrvSelect[i]; - } - EndDialog(hDlg, 0); - break; - } - if (LOWORD(wParam) == IDCANCEL) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - break; - } - - if (LOWORD(wParam) >= IDC_MVS_CLEAR1 && LOWORD(wParam) <= IDC_MVS_CLEAR6) { - int nSlot = LOWORD(wParam) - IDC_MVS_CLEAR1; - - nBurnDrvSelect[nSlot] = ~0U; - nPrevDrvSelect[nSlot] = ~0U; - MVSpreviewUpdateSlot(nSlot, hDlg); - break; - } - - if (LOWORD(wParam) >= IDC_MVS_SELECT1 && LOWORD(wParam) <= IDC_MVS_SELECT6) { - int nSlot = LOWORD(wParam) - IDC_MVS_SELECT1; - - nBurnDrvSelect[nSlot] = SelDialog(HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, hDlg); - MVSpreviewUpdateSlot(nSlot, hDlg); - break; - } - } - break; - - case WM_CLOSE: { - MVSpreviewEndDialog(); - for (int i = 0; i < 6; i++) { - nBurnDrvSelect[i] = nPrevDrvSelect[i]; - } - EndDialog(hDlg, 1); - break; - } - } - - return 0; -} - -int SelMVSDialog() -{ - return FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_MVS_SELECT_CARTS), hScrnWnd, (DLGPROC)MVSpreviewProc); -} diff --git a/jan/src/burner/win32/sfactd.cpp b/jan/src/burner/win32/sfactd.cpp deleted file mode 100644 index fff39d443..000000000 --- a/jan/src/burner/win32/sfactd.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// Burner Shots Factory Test Dialog Rev. 0.02 -// history: -// rev 0.00: hacked together code -// rev 0.01: Added sprite toggle. -// rev 0.02: now uses VidRedraw() -// -// Known Problems: -// Swiching anything causes the frame to advance -// -// "ghosting" that appears on screen is not captured (this is a good thing) - -#include "burner.h" - -static HWND hSFactdlg=NULL; -unsigned char layerBackup; - -static bool bShotsFactory; -static bool bOldPause; - -void ToggleSprite(unsigned char PriNum) -{ - nSpriteEnable^=PriNum; // xor with thisLayer - VidRedraw(); - VidPaint(0); -} - -static int SFactdUpdate() -{ - - CheckDlgButton(hSFactdlg,IDC_LAYER1,(nBurnLayer & 1)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_LAYER2,(nBurnLayer & 2)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_LAYER3,(nBurnLayer & 4)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_LAYER4,(nBurnLayer & 8)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE1,(nSpriteEnable & 0x01)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE2,(nSpriteEnable & 0x02)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE3,(nSpriteEnable & 0x04)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE4,(nSpriteEnable & 0x08)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE5,(nSpriteEnable & 0x10)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE6,(nSpriteEnable & 0x20)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE7,(nSpriteEnable & 0x40)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE8,(nSpriteEnable & 0x80)?BST_CHECKED:BST_UNCHECKED); - return 0; -} - -static int SFactdInit() -{ - layerBackup=nBurnLayer; - bRunPause=1; - CheckDlgButton(hSFactdlg,IDC_LAYER1,(nBurnLayer & 1)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_LAYER2,(nBurnLayer & 2)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_LAYER3,(nBurnLayer & 4)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_LAYER4,(nBurnLayer & 8)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE1,(nSpriteEnable & 0x01)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE2,(nSpriteEnable & 0x02)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE3,(nSpriteEnable & 0x04)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE4,(nSpriteEnable & 0x08)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE5,(nSpriteEnable & 0x10)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE6,(nSpriteEnable & 0x20)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE7,(nSpriteEnable & 0x40)?BST_CHECKED:BST_UNCHECKED); - CheckDlgButton(hSFactdlg,IDC_SPRITE8,(nSpriteEnable & 0x80)?BST_CHECKED:BST_UNCHECKED); - return 0; -} - - -static int SFactdExit() -{ - nBurnLayer=layerBackup; - nSpriteEnable= 0xFF; - hSFactdlg=NULL; - bShotsFactory = 0; - bRunPause=bOldPause; - GameInpCheckMouse(); - return 0; -} - - -static INT_PTR CALLBACK DialogProc(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lParam) -{ - (void)lParam; (void)wParam; (void)hDlg; - - if (Msg==WM_INITDIALOG) - { - hSFactdlg=hDlg; - SFactdInit(); - SFactdUpdate(); - WndInMid(hDlg, hScrnWnd); - SetFocus(hDlg); // Enable Esc=close - return 0; - } - if (Msg==WM_CLOSE) - { - //DestroyWindow(hSFactdlg); - EndDialog(hDlg, 0); - return 0; - } - if (Msg==WM_DESTROY) { SFactdExit(); return 0; } - - if (Msg==WM_COMMAND) - { - int Id=LOWORD(wParam); int Notify=HIWORD(wParam); - if (Id==IDOK && Notify==BN_CLICKED) { SendMessage(hDlg,WM_CLOSE,0,0); return 0; } // cancel=close - if (Id==IDCANCEL && Notify==BN_CLICKED) { SendMessage(hDlg, WM_CLOSE, 0, 0); return 0; } // esc=cancel - - if (Id==IDCAPTURE && Notify==BN_CLICKED) - { - if (bDrvOkay) - { - MakeScreenShot(); - SFactdUpdate(); - } - } - if (Id==IDC_LAYER1 && Notify==BN_CLICKED) - { - ToggleLayer(1); - SFactdUpdate(); - } - if (Id==IDC_LAYER2 && Notify==BN_CLICKED) - { - ToggleLayer(2); - SFactdUpdate(); - } - if (Id==IDC_LAYER3 && Notify==BN_CLICKED) - { - ToggleLayer(4); - SFactdUpdate(); - } - if (Id==IDC_LAYER4 && Notify==BN_CLICKED) - { - ToggleLayer(8); - SFactdUpdate(); - } - if (Id==IDC_SPRITE1 && Notify==BN_CLICKED) - { - ToggleSprite(0x01); - SFactdUpdate(); - } - if (Id==IDC_SPRITE2 && Notify==BN_CLICKED) - { - ToggleSprite(0x02); - SFactdUpdate(); - } - if (Id==IDC_SPRITE3 && Notify==BN_CLICKED) - { - ToggleSprite(0x04); - SFactdUpdate(); - } - if (Id==IDC_SPRITE4 && Notify==BN_CLICKED) - { - ToggleSprite(0x08); - SFactdUpdate(); - } - if (Id==IDC_SPRITE5 && Notify==BN_CLICKED) - { - ToggleSprite(0x10); - SFactdUpdate(); - } - if (Id==IDC_SPRITE6 && Notify==BN_CLICKED) - { - ToggleSprite(0x20); - SFactdUpdate(); - } - if (Id==IDC_SPRITE7 && Notify==BN_CLICKED) - { - ToggleSprite(0x40); - SFactdUpdate(); - } - if (Id==IDC_SPRITE8 && Notify==BN_CLICKED) - { - ToggleSprite(0x80); - SFactdUpdate(); - } - - if (Id==IDC_ADVANCE && Notify==BN_CLICKED) - { - VidFrame(); - VidPaint(0); - } - if (bRunPause) { - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - } - } - return 0; -} - - - -int SFactdCreate() -{ - if (bShotsFactory) { - return 1; - } - bShotsFactory = 1; - bOldPause = bRunPause; - bRunPause = 1; - AudBlankSound(); -// hSFactdlg=FBACreateDialog(hAppInst,MAKEINTRESOURCE(IDD_CAPTURE),hScrnWnd,DialogProc); -// if (hSFactdlg==NULL) return 1; -// WndInMid(hSFactdlg,hScrnWnd); -// ShowWindow(hSFactdlg,SW_NORMAL); -// SFactdUpdate(); - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_CAPTURE), hScrnWnd, (DLGPROC)DialogProc); - return 0; -} diff --git a/jan/src/burner/win32/splash.cpp b/jan/src/burner/win32/splash.cpp deleted file mode 100644 index b6171762a..000000000 --- a/jan/src/burner/win32/splash.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// Splash screen code -#include "burner.h" -#include - -int nSplashTime = 1500; - -static HWND hSplashDlg = NULL; -static HANDLE hSplashThread = NULL; -static unsigned SplashThreadID = 0; - -static clock_t StartTime; - -static INT_PTR CALLBACK SplashProc(HWND hDlg, UINT Msg, WPARAM /*wParam*/, LPARAM /*lParam*/) -{ - if (Msg == WM_INITDIALOG) { - RECT rect; - int x, y; - - hSplashDlg = hDlg; - - SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0); - - x = 304 + GetSystemMetrics(SM_CXDLGFRAME) * 2 + 6; - y = 224 + GetSystemMetrics(SM_CYDLGFRAME) * 2 + 6; - - SetForegroundWindow(hDlg); - SetWindowPos(hDlg, HWND_TOPMOST, (rect.right - rect.left) / 2 - x / 2, (rect.bottom - rect.top) / 2 - y / 2, x, y, 0); - RedrawWindow(hDlg, NULL, NULL, 0); - ShowWindow(hDlg, SW_SHOWNORMAL); - - return TRUE; - } - - return 0; -} - -static unsigned __stdcall DoSplash(void*) -{ - MSG msg; - - // Raise the thread priority for this thread - SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); - - CreateDialog(hAppInst, MAKEINTRESOURCE(IDD_SPLASH), NULL, (DLGPROC)SplashProc); - - while (GetMessage(&msg, NULL, 0, 0)) { - - // See if we need to end the thread - if (msg.message == (WM_APP + 0)) { - break; - } - - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - DestroyWindow(hSplashDlg); - - return 0; -} - -int SplashCreate() -{ - if (hSplashDlg || !nSplashTime || hSplashThread) { - return 1; - } - - hSplashThread = (HANDLE)_beginthreadex(NULL, 0, DoSplash, NULL, 0, &SplashThreadID); - - StartTime = clock(); - return 0; -} - -void SplashDestroy(bool bForce) -{ - if (hSplashThread) { - - if (!bForce && clock() - nSplashTime < StartTime) { - return; - } - - // Signal the splash thread to end - PostThreadMessage(SplashThreadID, WM_APP + 0, 0, 0); - - // Wait for the thread to finish - if (WaitForSingleObject(hSplashThread, 10000) != WAIT_OBJECT_0) { - // If the thread doesn't finish within 10 seconds, forcibly kill it - TerminateThread(hSplashThread, 1); - } - - hSplashDlg = NULL; - - CloseHandle(hSplashThread); - - hSplashThread = NULL; - SplashThreadID = 0; - - } -} diff --git a/jan/src/burner/win32/stated.cpp b/jan/src/burner/win32/stated.cpp deleted file mode 100644 index d530f84bc..000000000 --- a/jan/src/burner/win32/stated.cpp +++ /dev/null @@ -1,169 +0,0 @@ -// State dialog module -#include "burner.h" - -extern bool bReplayDontClose; -int bDrvSaveAll = 0; - -static void MakeOfn(TCHAR* pszFilter) -{ - _stprintf(pszFilter, FBALoadStringEx(hAppInst, IDS_DISK_FILE_STATE, true), _T(APP_TITLE)); - memcpy(pszFilter + _tcslen(pszFilter), _T(" (*.fs, *.fr)\0*.fs;*.fr\0\0"), 25 * sizeof(TCHAR)); - - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hScrnWnd; - ofn.lpstrFilter = pszFilter; - ofn.lpstrFile = szChoice; - ofn.nMaxFile = sizeof(szChoice) / sizeof(TCHAR); - ofn.lpstrInitialDir = _T(".\\savestates"); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("fs"); - return; -} - -// The automatic save -int StatedAuto(int bSave) -{ - static TCHAR szName[MAX_PATH] = _T(""); - int nRet; - - _stprintf(szName, _T("config/games/%s.fs"), BurnDrvGetText(DRV_NAME)); - - if (bSave == 0) { - nRet = BurnStateLoad(szName, bDrvSaveAll, NULL); // Load ram - if (nRet && bDrvSaveAll) { - nRet = BurnStateLoad(szName, 0, NULL); // Couldn't get all - okay just try the nvram - } - } else { - nRet = BurnStateSave(szName, bDrvSaveAll); // Save ram - } - - return nRet; -} - -static void CreateStateName(int nSlot) -{ - _stprintf(szChoice, _T("./savestates/%s slot %02x.fs"), BurnDrvGetText(DRV_NAME), nSlot); -} - -int StatedUNDO(int nSlot) -{ - if (nSlot) { - CreateStateName(nSlot); - return BurnStateUNDO(szChoice); - } - return 1; -} - -int StatedLoad(int nSlot) -{ - TCHAR szFilter[1024]; - int nRet; - int bOldPause; - - // if rewinding during playback, and readonly is not set, - // then transition from decoding to encoding (recording) - if(!bReplayReadOnly && nReplayStatus == 2) - { - nReplayStatus = 1; - } - if(bReplayReadOnly && nReplayStatus == 1) - { - bReplayDontClose = 1; - StopReplay(); - nReplayStatus = 2; - } - - if (nSlot) { - CreateStateName(nSlot); - } else { - if (bDrvOkay) { - _stprintf(szChoice, _T("%s*.fs"), BurnDrvGetText(DRV_NAME)); - } else { - _stprintf(szChoice, _T("savestate")); - } - MakeOfn(szFilter); - ofn.lpstrTitle = FBALoadStringEx(hAppInst, IDS_STATE_LOAD, true); - - bOldPause = bRunPause; - bRunPause = 1; - nRet = GetOpenFileName(&ofn); - bRunPause = bOldPause; - - if (nRet == 0) { // Error - return 1; - } - } - - nRet = BurnStateLoad(szChoice, 1, &DrvInitCallback); - - if (nSlot) { - return nRet; - } - - // Describe any possible errors: - if (nRet == 3) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_THIS_STATE)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_UNAVAIL)); - } else { - if (nRet == 4) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_THIS_STATE)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_TOOOLD), _T(APP_TITLE)); - } else { - if (nRet == 5) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_THIS_STATE)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_TOONEW), _T(APP_TITLE)); - } else { - if (nRet && !nSlot) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_LOAD)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_STATE)); - } - } - } - } - - if (nRet) { - FBAPopupDisplay(PUF_TYPE_ERROR); - } - - return nRet; -} - -int StatedSave(int nSlot) -{ - TCHAR szFilter[1024]; - int nRet; - int bOldPause; - - if (bDrvOkay == 0) { - return 1; - } - - if (nSlot) { - CreateStateName(nSlot); - } else { - _stprintf(szChoice, _T("%s"), BurnDrvGetText(DRV_NAME)); - MakeOfn(szFilter); - ofn.lpstrTitle = FBALoadStringEx(hAppInst, IDS_STATE_SAVE, true); - ofn.Flags |= OFN_OVERWRITEPROMPT; - - bOldPause = bRunPause; - bRunPause = 1; - nRet = GetSaveFileName(&ofn); - bRunPause = bOldPause; - - if (nRet == 0) { // Error - return 1; - } - } - - nRet = BurnStateSave(szChoice, 1); - - if (nRet && !nSlot) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_CREATE)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_STATE)); - FBAPopupDisplay(PUF_TYPE_ERROR); - } - - return nRet; -} diff --git a/jan/src/burner/win32/string.rc b/jan/src/burner/win32/string.rc deleted file mode 100644 index be3300ea1..000000000 --- a/jan/src/burner/win32/string.rc +++ /dev/null @@ -1,365 +0,0 @@ - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FIRSTRUN1 "This appears to be the first time you run %s v%.20s.\n\n" - IDS_FIRSTRUN2 "Please take some time to match the audio/video settings to your system capabilities and personal preferences. If you continue to use and/or distribute this software, you must agree to be bound by the terms of license agreement, which is always accessible via the about dialog.\n\n" - IDS_FIRSTRUN3A "Note that this is alpha quality software. As such, it likely will exhibit problems, including audio/video options not behaving correctly, the emulation of some games misses some features, and may exhibit stability problems. CAVEAT LECTOR!" - IDS_FIRSTRUN3B "Note that this is beta quality software. As such, it likely may be missing some features, or exhibit some problems with your system." - - IDS_CHEAT_NAME "Cheat name" - IDS_CHEAT_STATUS "Status" - - IDS_INPUT_INPUT "Game input" - IDS_INPUT_MAPPING "Mapped to" - IDS_INPUT_STATE "State" - IDS_INPUT_INP_PLAYER "Player %i" - IDS_INPUT_INP_KEYBOARD "Keyboard" - IDS_INPUT_INP_JOYSTICK "Joystick %i" - IDS_INPUT_INP_XARCADEL "X-Arcade (left side)" - IDS_INPUT_INP_XARCADER "X-Arcade (right side)" - IDS_INPUT_INP_HOTRODL "Hot Rod (left side)" - IDS_INPUT_INP_HOTRODR "Hot Rod (right side)" - IDS_INPUT_ANALOG_ABS "Absolute" - IDS_INPUT_ANALOG_AUTO "Auto-center" - IDS_INPUT_ANALOG_NORMAL "Normal" - - IDS_DIP_GROUP "DIPSwitch group" - IDS_DIP_SETTING "Setting" - - IDS_INPSET_MOVENAME "Move control or press key for %.100hs" - IDS_INPSET_MOVE "Move control or press key" - IDS_INPSET_WAITING "Waiting for %.80s to be released..." - - IDS_MEMCARD_CREATE "Create new memory card" - IDS_MEMCARD_SELECT "Select new memory card" - - IDS_PROGRESS_LOADING "Loading and initialising %s..." - IDS_PROGRESS_LOADING_ONLY "Loading" - - IDS_REPLAY_RECORD "Record Input to File" - IDS_REPLAY_REPLAY "Replay Input from File" - - IDS_ROMS_SELECT_DIR "Select Directory:" - - IDS_STATE_LOAD "Load State" - IDS_STATE_SAVE "Save State" - IDS_STATE_ACTIVESLOT "slot %d active" - IDS_STATE_LOADED "state loaded" - IDS_STATE_LOAD_ERROR "load error" - IDS_STATE_SAVED "state saved" - IDS_STATE_SAVE_ERROR "save error" - - IDS_DAT_GENERATE "Generate %s dat" - IDS_SCRN_NOGAME "no game loaded" - - IDS_NETPLAY_START "*** Starting netplay: " - IDS_NETPLAY_START_YOU "*** You are player %i. " - IDS_NETPLAY_START_TOTAL "There are %i total players." - IDS_NETPLAY_DROP "*** Player %1i <%.32hs> dropped from the game." - IDS_NETPLAY_TOOMUCH "too much text" - - IDS_SSHOT_SAVED "PNG saved" - IDS_SSHOT_ERROR "PNG error %1d" - - IDS_REC_AVI "Rec AVI ON" - IDS_STOP_AVI "Rec AVI OFF" - - IDS_SOUND_NOVOLUME "No volume control" - IDS_SOUND_VOLUMESET "volume %03i %%" - IDS_SOUND_MUTE "Silence" - IDS_SOUND_MUTE_OFF "Sound Restored" - - IDS_DISK_REPLAY "This input recording" - IDS_DISK_THIS_REPLAY "input recording." - IDS_DISK_FILE_REPLAY "%s Input Recording Files" - IDS_DISK_STATE "state file" - IDS_DISK_THIS_STATE "This state file" - IDS_DISK_FILE_STATE "%s State Files" - IDS_DISK_FILE_PATCH "%s Patch Files" - IDS_DISK_SOUND "sound recording" - IDS_DISK_THIS_SOUND "This sound recording" - IDS_DISK_FILE_SOUND "%s Sound Recording Files" - IDS_DISK_FILE_CARD "%s Memory Card Files" - IDS_DISK_ALL_CARD "All Memory Card Files" - IDS_DISK_ALL_DAT "All Dat Files" - IDS_DISK_TEXT "Text Files" - - IDS_DISK_SAVEREPORT "Save system information report" - - IDS_GAMELANG_LOAD "Select game list localisation template" - IDS_GAMELANG_EXPORT "Create game list localisation template" - - IDS_ROMINFO_DIALOGTITLE "Rom Information" - IDS_ROMINFO_ROMS "Rom Info" - IDS_ROMINFO_SAMPLES "Sample Info" - IDS_ROMINFO_NAME "Name" - IDS_ROMINFO_SIZE "Size (bytes)" - IDS_ROMINFO_CRC32 "CRC32" - IDS_ROMINFO_TYPE "Type" - IDS_ROMINFO_FLAGS "Flags" - IDS_ROMINFO_ESSENTIAL "%s, Essential" - IDS_ROMINFO_OPTIONAL "%s, Optional" - IDS_ROMINFO_PROGRAM "%s, Program" - IDS_ROMINFO_GRAPHICS "%s, Graphics" - IDS_ROMINFO_SOUND "%s, Sound" - IDS_ROMINFO_BIOS "%s, BIOS" - IDS_ROMINFO_NODUMP "No Dump" - - IDS_SPATH_PREVIEW "Previews" - IDS_SPATH_TITLES "Titles" - IDS_SPATH_ICONS "Icons" - IDS_SPATH_CHEATS "Cheats" - IDS_SPATH_HISCORE "High Scores" - IDS_SPATH_SAMPLES "Samples" - IDS_SPATH_IPS "IPS" - IDS_SPATH_NGCD_ISOS "Neo Geo CDZ Games" - IDS_SPATH_NGCD_COVERS "Neo Geo CDZ Covers" - IDS_SPATH_BLEND "Blend Files" - IDS_SPATH_SELECT "Select Previews" - IDS_SPATH_VERSUS "Versus Previews" - IDS_SPATH_HOWTO "HowTo Previews" - IDS_SPATH_SCORES "Scores Previews" - IDS_SPATH_BOSSES "Bosses Previews" - IDS_SPATH_GAMEOVER "Game Over Previews" - IDS_SPATH_FLYERS "Flyers" - IDS_SPATH_MARQUEES "Marquees" - IDS_SPATH_CONTROLS "Control Panels" - IDS_SPATH_CABINETS "Cabinets" - IDS_SPATH_PCBS "PCBs" - IDS_SPATH_HISTORY "History.dat" - IDS_SPATH_EEPROM "EEPROM Saves" - - IDS_ROMPATH_1 "Path #1" - IDS_ROMPATH_2 "Path #2" - IDS_ROMPATH_3 "Path #3" - IDS_ROMPATH_4 "Path #4" - IDS_ROMPATH_5 "Path #5" - IDS_ROMPATH_6 "Path #6" - IDS_ROMPATH_7 "Path #7" - IDS_ROMPATH_8 "Path #8" - IDS_ROMPATH_9 "Path #9" - IDS_ROMPATH_10 "Path #10" - IDS_ROMPATH_11 "Path #11" - IDS_ROMPATH_12 "Path #12" - IDS_ROMPATH_13 "Path #13" - IDS_ROMPATH_14 "Path #14" - IDS_ROMPATH_15 "Path #15" - IDS_ROMPATH_16 "Path #16" - IDS_ROMPATH_17 "Path #17" - IDS_ROMPATH_18 "Path #18" - IDS_ROMPATH_19 "Path #19" - IDS_ROMPATH_20 "Path #20" - - IDS_PRESET_SAVED "The preset file was saved to %s." - - IDS_LOCAL_GL_CREATE "Create gamelist localisation template" - IDS_LOCAL_GL_SELECT "Select gamelist localisation template" - IDS_LOCAL_GL_FILTER "FB Alpha gamelist localisation templates" - - IDS_CD_SELECT_IMAGE "Select CD-ROM image..." - IDS_CD_SELECT_IMAGE_TITLE "Select CD-ROM image" - IDS_CD_SELECT_FILTER "CD images" - - IDS_LOCAL_CREATE "Create localisation template" - IDS_LOCAL_SELECT "Select localisation template" - IDS_LOCAL_FILTER "FB Alpha localisation templates" - - IDS_SEL_FILTERS "Filters" - IDS_SEL_HARDWARE "Hardware" - IDS_SEL_CAVE "Cave" - IDS_SEL_CPS1 "CPS-1" - IDS_SEL_CPS2 "CPS-2" - IDS_SEL_CPS3 "CPS-3" - IDS_SEL_NEOGEO "Neo Geo" - IDS_SEL_PGM "PGM" - IDS_SEL_PSIKYO "Psikyo" - IDS_SEL_SEGA "Sega" - IDS_SEL_TAITO "Taito" - IDS_SEL_TOAPLAN "Toaplan" - IDS_SEL_MISCPRE90S "Misc (pre 90s)" - IDS_SEL_MISCPOST90S "Misc (post 90s)" - IDS_SEL_MEGADRIVE "Megadrive" - IDS_SEL_PACMAN "Pacman" - IDS_SEL_KONAMI "Konami" - IDS_SEL_GALAXIAN "Galaxian" - IDS_SEL_IREM "Irem" - IDS_SEL_BOARDTYPE "Board Type" - IDS_SEL_BOOTLEG "Bootleg" - IDS_SEL_PROTOTYPE "Prototype" - IDS_SEL_HACK "Hack" - IDS_SEL_HOMEBREW "Homebrew" - IDS_SEL_DEMO "Demo" - IDS_SEL_GENUINE "Genuine" - IDS_SEL_SETSTATUS "Showing %i of %i sets [%i Unavailable sets]" - IDS_SEL_KANEKO "Kaneko" - IDS_SEL_SNES "SNES" - IDS_SEL_DATAEAST "Data East" - IDS_SEL_CAPCOM_MISC "Capcom (Other)" - IDS_SEL_SETA "Seta" - IDS_SEL_TECHNOS "Technos" - IDS_SEL_PCE "PC-Engine" - IDS_SEL_SMS "Master System" - IDS_SEL_SG1000 "SG-1000" - IDS_SEL_COLECO "ColecoVision" - IDS_SEL_GG "Game Gear" - IDS_SEL_MSX "MSX" - - IDS_FAVORITES "Favorites" - IDS_GENRE "Genre" - IDS_GENRE_HORSHOOT "Shooter - Horizontal" - IDS_GENRE_VERSHOOT "Shooter - Vertical" - IDS_GENRE_SCRFIGHT "Fighter - Scrolling" - IDS_GENRE_VSFIGHT "Fighter - Versus" - IDS_GENRE_BIOS "BIOS" - IDS_GENRE_BREAKOUT "Breakout" - IDS_GENRE_CASINO "Casino" - IDS_GENRE_BALLPADDLE "Ball & Paddle" - IDS_GENRE_MAZE "Maze" - IDS_GENRE_MINIGAMES "Mini-Games" - IDS_GENRE_PINBALL "Pinball" - IDS_GENRE_PLATFORM "Platform" - IDS_GENRE_PUZZLE "Puzzle" - IDS_GENRE_QUIZ "Quiz" - IDS_GENRE_SPORTSMISC "Sports - Misc" - IDS_GENRE_SPORTSFOOTBALL "Sports - Football" - IDS_GENRE_MISC "Misc" - IDS_GENRE_MAHJONG "Mahjong" - IDS_GENRE_RACING "Racing" - IDS_GENRE_SHOOT "Shooter - Other" - - IDS_FAMILY "Family" - IDS_FAMILY_MSLUG "Metal Slug" - IDS_FAMILY_SF "Street Fighter" - IDS_FAMILY_KOF "King of Fighters" - IDS_FAMILY_DSTLK "Darkstalkers" - IDS_FAMILY_FATFURY "Fatal Fury" - IDS_FAMILY_SAMSHO "Samurai Shodown" - IDS_FAMILY_19XX "19XX" - IDS_FAMILY_SONICWI "Aero Fighters" - IDS_FAMILY_PWRINST "Power Instinct" - IDS_FAMILY_OTHER "Other" - - IDS_IPSMANAGER_TITLE "IPS Patch Manager" - - IDS_NGCD_DIAG_TITLE "%s%sNeo Geo CDZ%sSelect Game" - IDS_NGCD_TITLE "Title" - IDS_NGCD_NGCDID "NGCD-ID" - - IDS_MENU_0 "&Arcade" - IDS_MENU_1 "&Other..." - IDS_MENU_2 "&Other Gamma value..." - IDS_MENU_3 "Adjust &CPU speed..." - IDS_MENU_4 "Load state from active slot (no %d)\tF9" - IDS_MENU_5 "Save state to active slot (no %d)\tF10" - IDS_MENU_6 "no game selected" - - IDS_NUMDIAL_NUM_FRAMES "Number of Frames" - IDS_NUMDIAL_FILTER_SHARP "Select desired filter sharpness" - - IDS_SCANNING_ROMS "Scanning ROMs..." - - IDS_CHEAT_SEARCH_NEW "New cheat search started" - IDS_CHEAT_SEARCH_ADD_MATCH "%i Addresses Matched" - IDS_CHEAT_SEARCH_RESULTS "Address %08X Value %02X" - IDS_CHEAT_SEARCH_EXIT "Cheat search exited" - - IDS_LANG_ENGLISH_US "English (US)" - IDS_LANG_SIMP_CHINESE "Simplified Chinese" - IDS_LANG_TRAD_CHINESE "Traditional Chinese" - IDS_LANG_JAPANESE "Japanese" - IDS_LANG_KOREAN "Korean" - IDS_LANG_FRENCH "French" - IDS_LANG_SPANISH "Spanish" - IDS_LANG_ITALIAN "Italian" - IDS_LANG_GERMAN "German" - IDS_LANG_PORTUGUESE "Portuguese" - IDS_LANG_POLISH "Polish" - IDS_LANG_HUNGARIAN "Hungarian" - - IDS_GAMEINFO_DIALOGTITLE "Game Information" - IDS_GAMEINFO_INGAME "In Game" - IDS_GAMEINFO_TITLE "Title" - IDS_GAMEINFO_SELECT "Select" - IDS_GAMEINFO_VERSUS "Versus" - IDS_GAMEINFO_HOWTO "How To" - IDS_GAMEINFO_SCORES "Scores" - IDS_GAMEINFO_BOSSES "Bosses" - IDS_GAMEINFO_GAMEOVER "Game Over" - IDS_GAMEINFO_FLYER "Flyer" - IDS_GAMEINFO_CABINET "Cabinet" - IDS_GAMEINFO_MARQUEE "Marquee" - IDS_GAMEINFO_CONTROLS "Controls" - IDS_GAMEINFO_PCB "PCB" - IDS_GAMEINFO_ROMINFO "Rom Info" - IDS_GAMEINFO_HISTORY "History" - IDS_GAMEINFO_SAMPLES "Sample Info" - - IDS_CLONE_OF " (clone of %s" - IDS_ROMS_FROM_1 ", uses ROMs from %s" - IDS_ROMS_FROM_2 "%suses ROMs from %s" - IDS_BOARD_ROMS_FROM "%suses board-ROMs from %s" - IDS_SAMPLES_FROM "%suses samples from %s" - IDS_NUM_PLAYERS "%s%i player%s" - IDS_NUM_PLAYERS_MAX "s max" - IDS_HARDWARE_DESC "%s (%s, %s hardware)" - IDS_MVS_CARTRIDGE "Neo Geo MVS Cartidge" - IDS_HISCORES_SUPPORTED "%shigh scores supported" - IDS_CARTRIDGE "cartridge" - IDS_HARDWARE "hardware" - IDS_EMPTY "Empty" - IDS_UNIDENTIFIED_CD "Unidentified CD" - - IDS_ERR_ERROR "Error" - IDS_ERR_WARNING "Warning" - IDS_ERR_INFORMATION "Information" - IDS_ERR_UNKNOWN "Unknown" - - IDS_ERR_LOAD_OK "The ROMset is OK." - IDS_ERR_LOAD_PROBLEM "The ROMset exhibits the following problems:" - IDS_ERR_LOAD_NODATA "No data was found, the game will not run!" - IDS_ERR_LOAD_ESS_MISS "essential data is missing, the game will not run!" - IDS_ERR_LOAD_ESS_BAD "essential data is invalid, the game might not run!" - IDS_ERR_LOAD_DATA_MISS "data is missing." - IDS_ERR_LOAD_DATA_BAD "data is invalid." - IDS_ERR_LOAD_FOUND "%.32hs was found (%.512s).\n" - IDS_ERR_LOAD_NOTFOUND "%.32hs was not found.\n" - IDS_ERR_LOAD_INVALID "The following ROMs are invalid:\n" - IDS_ERR_LOAD_CRC "%.32hs has a CRC of %.8X (correct is %.8X).\n" - IDS_ERR_LOAD_SMALL "%.32hs is %dk which is too small (correct is %dkB).\n" - IDS_ERR_LOAD_LARGE "%.32hs is %dk which is too large (correct is %dkB).\n" - IDS_ERR_LOAD_DET_ESS "essential " - IDS_ERR_LOAD_DET_PRG "program " - IDS_ERR_LOAD_DET_BIOS "BIOS " - IDS_ERR_LOAD_DET_GRA "graphics " - IDS_ERR_LOAD_DET_SND "sound " - IDS_ERR_LOAD_DET_ROM "ROM " - IDS_ERR_LOAD_DISK "Error reading %.32hs from %.512s" - IDS_ERR_LOAD_DISK_CRC "CRC mismatch reading %.32hs from %.512s" - IDS_ERR_LOAD_REQUEST "Error loading %.32hs, requested by %.128s.\nThe emulation will likely suffer problems." - - IDS_ERR_BURN_INIT "There was a problem starting '%.128s'.\n" - - IDS_ERR_UI_NOSUPPORT "%.32s is not supported by %.32s." - IDS_ERR_UI_WINDOW "Couldn't create main window." - IDS_ERR_UI_MODULE "Couldn't intialise '%s' module." - IDS_ERR_UI_TRIPLE "Couldn't create a triple buffer." - IDS_ERR_UI_FULL_NOMODE "No appropriate display mode supported. Please adjust your full-screen settings." - IDS_ERR_UI_FULL_PROBLEM "Problem setting '%dx%dx%dbpp (%dHz)' display mode" - IDS_ERR_UI_FULL_CUSTRES "\n\nThis is not a standard VGA resolution; please make sure it is supported by your video card." - IDS_ERR_UI_VID_MODULE "Couldn't intialise '%s' module. Try installing the Direct X End User runtimes (June 2010)." - - IDS_ERR_DISK_CREATE "Error creating " - IDS_ERR_DISK_LOAD "Error loading " - IDS_ERR_DISK_UNAVAIL " is for an unavailable game." - IDS_ERR_DISK_TOONEW " does not work with this version of %s." - IDS_ERR_DISK_TOOOLD " requires a more recent version of %s, please upgrade." - - IDS_ERR_NO_NETPLAYDLL "Error finding 'kailleraclient.dll'." - IDS_ERR_NO_DRIVER_SELECTED "No driver has been selected from the list." - IDS_ERR_NO_DRIVER_SEL_SLOT1 "No driver has been selected for slot 1." - IDS_ERR_NON_WORKING "This game isn't working. Load it anyway?" - IDS_ERR_CDEMU_INI_FAIL "Couldn't initialise CD emulation." - - IDS_ERR_LOCAL_FAIL_CONNECT "Failed to connect to Internet" - IDS_ERR_LOCAL_FAIL_OPEN_URL "Failed to access FB Alpha website" -END diff --git a/jan/src/burner/win32/support_paths.cpp b/jan/src/burner/win32/support_paths.cpp deleted file mode 100644 index e8df8b848..000000000 --- a/jan/src/burner/win32/support_paths.cpp +++ /dev/null @@ -1,255 +0,0 @@ -#include "burner.h" -#include - -static HWND hTabControl = NULL; -static int nInitTabSelect = 0; -static HWND hParent = NULL; - -TCHAR szAppPreviewsPath[MAX_PATH] = _T("support/previews/"); -TCHAR szAppTitlesPath[MAX_PATH] = _T("support/titles/"); -TCHAR szAppCheatsPath[MAX_PATH] = _T("support/cheats/"); -TCHAR szAppHiscorePath[MAX_PATH] = _T("support/hiscores/"); -TCHAR szAppSamplesPath[MAX_PATH] = _T("support/samples/"); -TCHAR szAppIpsPath[MAX_PATH] = _T("support/ips/"); -TCHAR szAppIconsPath[MAX_PATH] = _T("support/icons/"); -TCHAR szAppBlendPath[MAX_PATH] = _T("support/blend/"); -TCHAR szAppSelectPath[MAX_PATH] = _T("support/select/"); -TCHAR szAppVersusPath[MAX_PATH] = _T("support/versus/"); -TCHAR szAppHowtoPath[MAX_PATH] = _T("support/howto/"); -TCHAR szAppScoresPath[MAX_PATH] = _T("support/scores/"); -TCHAR szAppBossesPath[MAX_PATH] = _T("support/bosses/"); -TCHAR szAppGameoverPath[MAX_PATH] = _T("support/gameover/"); -TCHAR szAppFlyersPath[MAX_PATH] = _T("support/flyers/"); -TCHAR szAppMarqueesPath[MAX_PATH] = _T("support/marquees/"); -TCHAR szAppControlsPath[MAX_PATH] = _T("support/cpanel/"); -TCHAR szAppCabinetsPath[MAX_PATH] = _T("support/cabinets/"); -TCHAR szAppPCBsPath[MAX_PATH] = _T("support/pcbs/"); -TCHAR szAppHistoryPath[MAX_PATH] = _T("support/history/"); -TCHAR szAppEEPROMPath[MAX_PATH] = _T("config/games/"); - -static TCHAR szCheckIconsPath[MAX_PATH]; - -static void IconsDirPathChanged() { - if(bEnableIcons && bIconsLoaded) { - // unload icons - UnloadDrvIcons(); - bIconsLoaded = 0; - // load icons - LoadDrvIcons(); - bIconsLoaded = 1; - } - if(bEnableIcons && !bIconsLoaded) { - // load icons - LoadDrvIcons(); - bIconsLoaded = 1; - } -} - -static INT_PTR CALLBACK DefInpProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - int var; - - switch (Msg) { - case WM_INITDIALOG: { - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT1, szAppPreviewsPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT2, szAppTitlesPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT3, szAppIconsPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT4, szAppCheatsPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT5, szAppHiscorePath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT6, szAppSamplesPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT7, szAppIpsPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT8, szNeoCDGamesDir); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT9, szNeoCDCoverDir); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT10, szAppBlendPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT11, szAppSelectPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT12, szAppVersusPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT13, szAppHowtoPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT14, szAppScoresPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT15, szAppBossesPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT16, szAppGameoverPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT17, szAppFlyersPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT18, szAppMarqueesPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT19, szAppControlsPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT20, szAppCabinetsPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT21, szAppPCBsPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT22, szAppHistoryPath); - SetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT23, szAppEEPROMPath); - - // Setup the tabs - hTabControl = GetDlgItem(hDlg, IDC_SPATH_TAB); - - TC_ITEM tcItem; - tcItem.mask = TCIF_TEXT; - - UINT idsString[23] = { IDS_SPATH_PREVIEW, IDS_SPATH_TITLES, IDS_SPATH_ICONS, IDS_SPATH_CHEATS, IDS_SPATH_HISCORE, IDS_SPATH_SAMPLES, IDS_SPATH_IPS, IDS_SPATH_NGCD_ISOS, IDS_SPATH_NGCD_COVERS, IDS_SPATH_BLEND, IDS_SPATH_SELECT, IDS_SPATH_VERSUS, IDS_SPATH_HOWTO, IDS_SPATH_SCORES, IDS_SPATH_BOSSES, IDS_SPATH_GAMEOVER, IDS_SPATH_FLYERS, IDS_SPATH_MARQUEES, IDS_SPATH_CONTROLS, IDS_SPATH_CABINETS, IDS_SPATH_PCBS, IDS_SPATH_HISTORY, IDS_SPATH_EEPROM }; - - for(int nIndex = 0; nIndex < 23; nIndex++) { - tcItem.pszText = FBALoadStringEx(hAppInst, idsString[nIndex], true); - TabCtrl_InsertItem(hTabControl, nIndex, &tcItem); - } - - int TabPage = TabCtrl_GetCurSel(hTabControl); - - // hide all controls excluding the selected controls - for(int x = 0; x < 23; x++) { - if(x != TabPage) { - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_BR1 + x), SW_HIDE); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_EDIT1 + x), SW_HIDE); // edit controls - } - } - - // Show the proper controls - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_BR1 + TabPage), SW_SHOW); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_EDIT1 + TabPage), SW_SHOW); // edit controls - - WndInMid(hDlg, hParent); - SetFocus(hDlg); // Enable Esc=close - - if (nInitTabSelect) { - SendMessage(hTabControl, TCM_SETCURSEL, nInitTabSelect, 0); - // hide all controls excluding the selected controls - for(int x = 0; x < 23; x++) { - if(x != nInitTabSelect) { - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_BR1 + x), SW_HIDE); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_EDIT1 + x), SW_HIDE); // edit controls - } else { - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_BR1 + x), SW_SHOW); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_EDIT1 + x), SW_SHOW); // edit controls - } - } - } - - break; - } - - case WM_NOTIFY: - { - NMHDR* pNmHdr = (NMHDR*)lParam; - - if (pNmHdr->code == TCN_SELCHANGE) { - - int TabPage = TabCtrl_GetCurSel(hTabControl); - - // hide all controls excluding the selected controls - for(int x = 0; x < 23; x++) { - if(x != TabPage) { - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_BR1 + x), SW_HIDE); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_EDIT1 + x), SW_HIDE); // edit controls - } - } - - // Show the proper controls - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_BR1 + TabPage), SW_SHOW); // browse buttons - ShowWindow(GetDlgItem(hDlg, IDC_SUPPORTDIR_EDIT1 + TabPage), SW_SHOW); // edit controls - - UpdateWindow(hDlg); - - return FALSE; - } - break; - } - - case WM_COMMAND: { - LPMALLOC pMalloc = NULL; - BROWSEINFO bInfo; - ITEMIDLIST* pItemIDList = NULL; - TCHAR buffer[MAX_PATH]; - - if (LOWORD(wParam) == IDOK) { - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT1, szAppPreviewsPath, sizeof(szAppPreviewsPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT2, szAppTitlesPath, sizeof(szAppTitlesPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT3, szAppIconsPath, sizeof(szAppIconsPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT4, szAppCheatsPath, sizeof(szAppCheatsPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT5, szAppHiscorePath, sizeof(szAppHiscorePath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT6, szAppSamplesPath, sizeof(szAppSamplesPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT7, szAppIpsPath, sizeof(szAppIpsPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT8, szNeoCDGamesDir, sizeof(szNeoCDGamesDir)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT9, szNeoCDCoverDir, sizeof(szNeoCDCoverDir)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT10, szAppBlendPath, sizeof(szAppBlendPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT11, szAppSelectPath, sizeof(szAppSelectPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT12, szAppVersusPath, sizeof(szAppVersusPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT13, szAppHowtoPath, sizeof(szAppHowtoPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT14, szAppScoresPath, sizeof(szAppScoresPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT15, szAppBossesPath, sizeof(szAppBossesPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT16, szAppGameoverPath, sizeof(szAppGameoverPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT17, szAppFlyersPath, sizeof(szAppFlyersPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT18, szAppMarqueesPath, sizeof(szAppMarqueesPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT19, szAppControlsPath, sizeof(szAppControlsPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT20, szAppCabinetsPath, sizeof(szAppCabinetsPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT21, szAppPCBsPath, sizeof(szAppPCBsPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT22, szAppHistoryPath, sizeof(szAppHistoryPath)); - GetDlgItemText(hDlg, IDC_SUPPORTDIR_EDIT23, szAppEEPROMPath, sizeof(szAppEEPROMPath)); - - SendMessage(hDlg, WM_CLOSE, 0, 0); - break; - } else { - if (LOWORD(wParam) >= IDC_SUPPORTDIR_BR1 && LOWORD(wParam) <= IDC_SUPPORTDIR_BR23) { - var = IDC_SUPPORTDIR_EDIT1 + LOWORD(wParam) - IDC_SUPPORTDIR_BR1; - } else { - if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDCANCEL) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - break; - } - } - - SHGetMalloc(&pMalloc); - - memset(&bInfo, 0, sizeof(bInfo)); - bInfo.hwndOwner = hDlg; - bInfo.pszDisplayName = buffer; - bInfo.lpszTitle = FBALoadStringEx(hAppInst, IDS_ROMS_SELECT_DIR, true); - bInfo.ulFlags = BIF_EDITBOX | BIF_RETURNONLYFSDIRS; - - pItemIDList = SHBrowseForFolder(&bInfo); - - if (pItemIDList) { - if (SHGetPathFromIDList(pItemIDList, buffer)) { - int strLen = _tcslen(buffer); - if (strLen) { - if (buffer[strLen - 1] != _T('\\')) { - buffer[strLen] = _T('\\'); - buffer[strLen + 1] = _T('\0'); - } - SetDlgItemText(hDlg, var, buffer); - } - } - pMalloc->Free(pItemIDList); - } - pMalloc->Release(); - - break; - } - - case WM_CLOSE: { - EndDialog(hDlg, 0); - // If Icons directory path has been changed do the proper action - if(_tcscmp(szCheckIconsPath, szAppIconsPath)) { - IconsDirPathChanged(); - } - break; - } - } - - return 0; -} - -int SupportDirCreate(HWND hParentWND) -{ - hParent = hParentWND; - - _stprintf(szCheckIconsPath, szAppIconsPath); - - return FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_SUPPORTDIR), hParentWND, (DLGPROC)DefInpProc); -} - -int SupportDirCreateTab(int nTab, HWND hParentWND) -{ - nInitTabSelect = nTab - IDC_SUPPORTDIR_EDIT1; - - hParent = hParentWND; - - _stprintf(szCheckIconsPath, szAppIconsPath); - - return FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_SUPPORTDIR), hParentWND, (DLGPROC)DefInpProc); -} diff --git a/jan/src/burner/win32/systeminfo.cpp b/jan/src/burner/win32/systeminfo.cpp deleted file mode 100644 index 1b5785497..000000000 --- a/jan/src/burner/win32/systeminfo.cpp +++ /dev/null @@ -1,1120 +0,0 @@ -#include "burner.h" -#include "build_details.h" -#include -#include -#include - -#if defined _MSC_VER - #include -#endif - -// these are not defined in the Cygwin/MinGW winapi package -#ifndef DISPLAY_DEVICE_ACTIVE - #define DISPLAY_DEVICE_ACTIVE 0x00000001 -#endif -#ifndef DISPLAY_DEVICE_ATTACHED - #define DISPLAY_DEVICE_ATTACHED 0x00000002 -#endif - -static _EXCEPTION_POINTERS* pExceptionPointers; - -static TCHAR* pszTextBuffer = NULL; -static int nTextBufferSize = 0; - -static int nRecursion = 0; - -static HFONT hLogFont, hCodeFont; -static HBRUSH hCodeBGBrush; - -static const bool bPrintDriverInfo = false; - -static int AddLine(TCHAR* pszFormat, ...) -{ - TCHAR szString[128] = _T(""); - - va_list vaFormat; - va_start(vaFormat, pszFormat); - - int nLen = _vsntprintf(szString, 70, pszFormat, vaFormat); - nLen = (nLen >= 0 && nLen < 70) ? nLen : 70; - nLen += _stprintf(szString + nLen, _T("\r\n")); - TCHAR* pszNewBuffer = (TCHAR*)realloc(pszTextBuffer, (nLen + nTextBufferSize + 1) * sizeof(TCHAR)); - if (pszNewBuffer) { - pszTextBuffer = pszNewBuffer; - _tcsncpy(pszTextBuffer + nTextBufferSize, szString, nLen); - nTextBufferSize += nLen; - pszTextBuffer[nTextBufferSize] = 0; - } - - va_end(vaFormat); - - return 0; -} - -static int AddText(TCHAR* pszFormat, ...) -{ - TCHAR szString[128] = _T(""); - - va_list vaFormat; - va_start(vaFormat, pszFormat); - - int nLen = _vsntprintf(szString, 70, pszFormat, vaFormat); - nLen = (nLen >= 0 && nLen < 70) ? nLen : 70; - TCHAR* pszNewBuffer = (TCHAR*)realloc(pszTextBuffer, (nLen + nTextBufferSize + 1) * sizeof(TCHAR)); - if (pszNewBuffer) { - pszTextBuffer = pszNewBuffer; - _tcsncpy(pszTextBuffer + nTextBufferSize, szString, nLen); - nTextBufferSize += nLen; - pszTextBuffer[nTextBufferSize] = 0; - } - - va_end(vaFormat); - - return 0; -} - -static int PrintInterfaceInfo(InterfaceInfo* pInfo) -{ - if (pInfo == NULL) { - return 1; - } - - if (pInfo->pszModuleName) { - AddLine(_T(" Selected module: %s"), pInfo->pszModuleName); - } - for (int i = 0; pInfo->ppszInterfaceSettings[i]; i++) { - AddLine(_T(" %s%s"), (i == 0) ? _T("Interface settings: ") : _T(" "), pInfo->ppszInterfaceSettings[i]); - } - for (int i = 0; pInfo->ppszModuleSettings[i]; i++) { - AddLine(_T(" %s%s"), (i == 0) ? _T("Module settings: ") : _T(" "), pInfo->ppszModuleSettings[i]); - } - - return 0; -} - -// Print information about the exception -int PrintExceptionInfo() -{ - static const struct { DWORD ExceptionCode; const TCHAR* szString; } ExceptionString[] = { - -#define EXCEPTION_LIST_ENTRY(exception) { exception, _T(#exception) } - - EXCEPTION_LIST_ENTRY(EXCEPTION_ACCESS_VIOLATION), - EXCEPTION_LIST_ENTRY(EXCEPTION_ARRAY_BOUNDS_EXCEEDED), - EXCEPTION_LIST_ENTRY(EXCEPTION_BREAKPOINT), - EXCEPTION_LIST_ENTRY(EXCEPTION_DATATYPE_MISALIGNMENT), - EXCEPTION_LIST_ENTRY(EXCEPTION_FLT_DENORMAL_OPERAND), - EXCEPTION_LIST_ENTRY(EXCEPTION_FLT_DIVIDE_BY_ZERO), - EXCEPTION_LIST_ENTRY(EXCEPTION_FLT_INEXACT_RESULT), - EXCEPTION_LIST_ENTRY(EXCEPTION_FLT_INVALID_OPERATION), - EXCEPTION_LIST_ENTRY(EXCEPTION_FLT_OVERFLOW), - EXCEPTION_LIST_ENTRY(EXCEPTION_FLT_STACK_CHECK), - EXCEPTION_LIST_ENTRY(EXCEPTION_FLT_UNDERFLOW), - EXCEPTION_LIST_ENTRY(EXCEPTION_ILLEGAL_INSTRUCTION), - EXCEPTION_LIST_ENTRY(EXCEPTION_IN_PAGE_ERROR), - EXCEPTION_LIST_ENTRY(EXCEPTION_INVALID_DISPOSITION), - EXCEPTION_LIST_ENTRY(EXCEPTION_INT_DIVIDE_BY_ZERO), - EXCEPTION_LIST_ENTRY(EXCEPTION_INT_OVERFLOW), - EXCEPTION_LIST_ENTRY(EXCEPTION_INVALID_HANDLE), - EXCEPTION_LIST_ENTRY(EXCEPTION_GUARD_PAGE), - EXCEPTION_LIST_ENTRY(EXCEPTION_NONCONTINUABLE_EXCEPTION), - EXCEPTION_LIST_ENTRY(EXCEPTION_PRIV_INSTRUCTION), - EXCEPTION_LIST_ENTRY(EXCEPTION_SINGLE_STEP), - EXCEPTION_LIST_ENTRY(EXCEPTION_STACK_OVERFLOW), - { 0, _T("unspecified exception") } - -#undef EXCEPTION_LIST_ENTRY - - }; - - int i; - - for (i = 0; ExceptionString[i].ExceptionCode; i++) { - if (ExceptionString[i].ExceptionCode == pExceptionPointers->ExceptionRecord->ExceptionCode) { - break; - } - } - - AddLine(_T("Exception 0x%08X (%s) thrown.\r\nEIP: 0x%p"), pExceptionPointers->ExceptionRecord->ExceptionCode, ExceptionString[i].szString, pExceptionPointers->ExceptionRecord->ExceptionAddress); - if (pExceptionPointers->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { - AddLine(_T(" (attempting to %s address 0x%p)"), pExceptionPointers->ExceptionRecord->ExceptionInformation[0] ? _T("write") : _T("read"), pExceptionPointers->ExceptionRecord->ExceptionInformation[1]); - } - AddLine(_T("")); - -#ifdef BUILD_X86_ASM - AddLine(_T("EAX: 0x%08X, EBX: 0x%08X, ECX: 0x%08X, EDX: 0x%08X"), (unsigned int)pExceptionPointers->ContextRecord->Eax, (unsigned int)pExceptionPointers->ContextRecord->Ebx, (unsigned int)pExceptionPointers->ContextRecord->Ecx, (unsigned int)pExceptionPointers->ContextRecord->Edx); - AddLine(_T("ESI: 0x%08X, EDI: 0x%08X, ESP: 0x%08X, EBP: 0x%08X"), (unsigned int)pExceptionPointers->ContextRecord->Esi, (unsigned int)pExceptionPointers->ContextRecord->Edi, (unsigned int)pExceptionPointers->ContextRecord->Esp, (unsigned int)pExceptionPointers->ContextRecord->Ebp); -#endif - - return 0; -} - -// Print OS information -int PrintOSInfo() -{ - OSVERSIONINFOEX osvi; - - memset(&osvi, 0, sizeof(OSVERSIONINFOEX)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - if (!GetVersionEx((OSVERSIONINFO*)&osvi)) { - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx((OSVERSIONINFO*)&osvi); - } - -// bprintf(PRINT_NORMAL, _T("%i, %i\n"), osvi.dwMajorVersion, osvi.dwMinorVersion); - - AddText(_T("OS: ")); - { - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { - // http://msdn.microsoft.com/en-us/library/ms724833(VS.85).aspx - if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) { - AddText(_T("Microsoft Windows 2000 ")); - } - if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) { - AddText(_T("Microsoft Windows XP ")); - } - if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) { - AddText(_T("Microsoft Windows 2003 ")); - } - if (osvi.dwMajorVersion < 5 || osvi.dwMinorVersion > 3) { - AddText(_T("Microsoft Windows NT %d.%d "), osvi.dwMajorVersion, osvi.dwMinorVersion); - } - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 && osvi.wProductType == VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows Vista ")); - } - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 && osvi.wProductType != VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows Server 2008 ")); - } - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1 && osvi.wProductType != VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows Server 2008 R2 ")); - } - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1 && osvi.wProductType == VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows 7 ")); - } - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2 && osvi.wProductType != VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows Server 2012 ")); - } - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2 && osvi.wProductType == VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows 8 ")); - } - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3 && osvi.wProductType != VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows Server 2012 R2 ")); - } - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3 && osvi.wProductType == VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows 8.1 ")); - } - if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0 && osvi.wProductType != VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows Server Technical Preview ")); - } - if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0 && osvi.wProductType == VER_NT_WORKSTATION) { - AddText(_T("Microsoft Windows 10 ")); - } - - if (osvi.dwMajorVersion == 5) { - if (osvi.wProductType == VER_NT_WORKSTATION) { - if (osvi.wSuiteMask & VER_SUITE_PERSONAL) { - AddText(_T("Personal ")); - } else { - AddText(_T("Professional ")); - } - } - if (osvi.wProductType == VER_NT_SERVER) { - if (osvi.wSuiteMask & VER_SUITE_DATACENTER) { - AddText(_T("DataCenter Server ")); - } else { - if (osvi.wSuiteMask & VER_SUITE_DATACENTER) { - AddText(_T("Advanced Server ")); - } else { - AddText(_T("Server ")); - } - } - } - } - AddText(_T("%s (build %i)\r\n"), osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF); - } - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion < 10) { - AddText(_T("Microsoft Windows 95")); - if (osvi.szCSDVersion[1] == _T('B') || osvi.szCSDVersion[1] == _T('C')) { - AddText(_T(" OSR2")); - } - } - if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10) { - AddText(_T("Microsoft Windows 98")); - if (osvi.szCSDVersion[1] == _T('A')) { - AddText(_T(" SE")); - } - } - if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) { - AddText(_T("Microsoft Windows Me")); - } - if (osvi.dwMajorVersion != 4 && osvi.dwMinorVersion < 10) { - AddText(_T("Microsoft Windows %d.%d "), osvi.dwMajorVersion, osvi.dwMinorVersion); - } - AddText(_T("\r\n")); - } - } - - return 0; -} - -int PrintCPUInfo() -{ - AddText(_T("CPU: ")); - - char CPUBrandStringFinal[0x40] = { 0 }; - -#if defined _MSC_VER - int CPUInfo[4] = {-1}; - __cpuid(CPUInfo, 0x80000000); - unsigned int nExIds = CPUInfo[0]; - unsigned int i, j = 0; - - // Get the information associated with each extended ID. - char CPUBrandString[0x40] = { 0 }; - - for (i = 0x80000000; i <= nExIds; ++i) { - __cpuid(CPUInfo, i); - - // Interpret CPU brand string and cache information. - if (i == 0x80000002) { - memcpy( CPUBrandString, - CPUInfo, - sizeof(CPUInfo)); - } else if (i == 0x80000003) { - memcpy( CPUBrandString + 16, - CPUInfo, - sizeof(CPUInfo)); - } else if (i == 0x80000004) { - memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo)); - } - } - - // trim the leading white space - int nCheckForSpace = 1; - for (i = 0; CPUBrandString[i] != '\0'; i++) { - if (!isspace(CPUBrandString[i])) nCheckForSpace = 0; - - if (nCheckForSpace) { - if (!isspace(CPUBrandString[i])) { - CPUBrandStringFinal[j++] = CPUBrandString[i]; - } - } else { - CPUBrandStringFinal[j++] = CPUBrandString[i]; - } - } -#else - sprintf(CPUBrandStringFinal, "%s", "CPU Detection not enabled for GCC builds"); -#endif - - AddLine(_T("%hs"), CPUBrandStringFinal); - - return 0; -} - -// Print global memory information -int PrintGlobalMemoryInfo() -{ - MEMORYSTATUS stat; - GlobalMemoryStatus(&stat); - - AddLine(_T("Physical RAM: %7i KB (%4i MB) total, %7i KB (%4i MB) avail"), stat.dwTotalPhys / 1024, stat.dwTotalPhys / (1024 * 1024), stat.dwAvailPhys / 1024, stat.dwAvailPhys / (1024 * 1024)); - AddLine(_T("Total RAM: %7i KB (%4i MB) total, %7i KB (%4i MB) avail"), stat.dwTotalPageFile / 1024, stat.dwTotalPageFile / (1024 * 1024), stat.dwAvailPageFile / 1024, stat.dwAvailPageFile / (1024 * 1024)); - - // Information on FB Alpha memory usage - BOOL (WINAPI* pGetProcessMemoryInfo)(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD) = NULL; - HINSTANCE hPsapiDLL; - - hPsapiDLL = LoadLibrary(_T("psapi.dll")); - if (hPsapiDLL) { - pGetProcessMemoryInfo = (BOOL (WINAPI*)(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD))GetProcAddress(hPsapiDLL, "GetProcessMemoryInfo"); - if (pGetProcessMemoryInfo) { - PROCESS_MEMORY_COUNTERS pmc; - - if (pGetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) { - TCHAR szLine[1024] = _T(""); - int length = _tcslen(_T(APP_TITLE)); - if (length > 12) { - length = 12; - } - _sntprintf(szLine, 12, _T(APP_TITLE)); - _sntprintf(szLine + length, 14 - length, _T(": ")); - AddLine(_T("%s%7i KB in use (%i KB peak, %i KB virtual)"), szLine, pmc.WorkingSetSize / 1024, pmc.PeakWorkingSetSize / 1024, pmc.PagefileUsage / 1024); - } - } - FreeLibrary(hPsapiDLL); - } - - return 0; -} - -// Find the registry key for this display in the hardware area of the registry -// szHardwareID is the PNP ID -// szDriver is the GUID/instance of the driver -HKEY FindMonitor(TCHAR* szHardwareID, TCHAR* szDriver) -{ - TCHAR szName[1024] = _T(""); DWORD nNameSize = sizeof(szName); - TCHAR szClass[1024] = _T(""); DWORD nClassSize = sizeof(szClass); - FILETIME ftLastWriteTime; - HKEY hKey = NULL; - HKEY hMonitorKey = NULL; - - bool bFound = false; - - // We need to enumerate all displays and all instances to check the values inside them - RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SYSTEM\\CurrentControlSet\\Enum\\DISPLAY\\"), 0, KEY_READ, &hKey); - for (int i = 0; !bFound && RegEnumKeyEx(hKey, i, szName, &nNameSize, NULL, szClass, &nClassSize, &ftLastWriteTime) != ERROR_NO_MORE_ITEMS; i++) { - TCHAR szSubName[1024] = _T(""); DWORD nSubNameSize = sizeof(szSubName); - TCHAR szSubClass[1024] = _T(""); DWORD nSubClassSize = sizeof(szSubClass); - FILETIME ftSubLastWriteTime; - HKEY hSubKey = NULL; - - nNameSize = sizeof(szName); - nClassSize = sizeof(szClass); - - RegOpenKeyEx(hKey, szName, 0, KEY_READ, &hSubKey); - for (int j = 0; !bFound && RegEnumKeyEx(hSubKey, j, szSubName, &nSubNameSize, NULL, szSubClass, &nSubClassSize, &ftSubLastWriteTime) != ERROR_NO_MORE_ITEMS; j++) { - HKEY hMonitorInfoKey = NULL; - TCHAR szKeyValue[1024]; DWORD nSize = sizeof(szKeyValue); - DWORD nType; - - nSubNameSize = sizeof(szSubName); - nSubClassSize = sizeof(szSubClass); - - RegOpenKeyEx(hSubKey, szSubName, 0, KEY_READ, &hMonitorKey); - - // Check if this instance is the one we're looking for - nType = REG_SZ; nSize = sizeof(szKeyValue); - RegQueryValueEx(hMonitorKey, _T("HardwareID"), NULL, &nType, (BYTE*)szKeyValue, &nSize); - if (_tcsicmp(szKeyValue, szHardwareID)) { - continue; - } - nType = REG_SZ; nSize = sizeof(szKeyValue); - RegQueryValueEx(hMonitorKey, _T("Driver"), NULL, &nType, (BYTE*)szKeyValue, &nSize); - if (_tcsicmp(szKeyValue, szDriver)) { - continue; - } - - // Make sure the "Device Parameters" key which contains any EDID data is present - RegOpenKeyEx(hMonitorKey, _T("Device Parameters"), 0, KEY_READ, &hMonitorInfoKey); - if (!hMonitorInfoKey) { - continue; - } - - // We've found the display we're looking for - bFound = true; - - RegCloseKey(hMonitorInfoKey); - } - RegCloseKey(hSubKey); - } - RegCloseKey(hKey); - - if (!bFound) { - return NULL; - } - - return hMonitorKey; -} - -int ProcessEDID(HKEY hMonitorKey) -{ - HKEY hMonitorInfoKey = NULL; - BYTE EDIDData[1024]; DWORD nEDIDSize = sizeof(EDIDData); - DWORD nType; - - if (hMonitorKey == NULL) { - return 1; - } - - RegOpenKeyEx(hMonitorKey, _T("Device Parameters"), 0, KEY_READ, &hMonitorInfoKey); - if (hMonitorInfoKey == NULL) { - return 1; - } - - // When Windows can't get valid EDID data from a Display, it creates a BAD_EDID value instead of EDID - // Thus we can forego ensuring the validity of the EDID data ourselves - nType = REG_BINARY; nEDIDSize = sizeof(EDIDData); - if (RegQueryValueEx(hMonitorInfoKey, _T("BAD_EDID"), NULL, &nType, EDIDData, &nEDIDSize) == 0) { - AddLine(_T(" No EDID data present for this device")); - } - nType = REG_BINARY; nEDIDSize = sizeof(EDIDData); - if (RegQueryValueEx(hMonitorInfoKey, _T("EDID"), NULL, &nType, EDIDData, &nEDIDSize) == 0) { - - // Print some basic information about this display - AddLine(_T(" Display size ~%dx%dcm, Gamma %1.2lf"), EDIDData[0x15], EDIDData[0x16], ((double)EDIDData[0x17] + 100.0) / 100.0); - - // Print the preferred mode for this display - if (EDIDData[0x18] & 2) { - int nPixelClock = ((EDIDData[0x36 + 0x01] << 8) | EDIDData[0x36 + 0x00]) * 10000; - - // Size of the display image in pixels (including blanking and sync) - int nActiveH = ((EDIDData[0x36 + 0x04] & 0xF0) << 4) | EDIDData[0x36 + 0x02]; - int nBlankH = ((EDIDData[0x36 + 0x04] & 0x0F) << 8) | EDIDData[0x36 + 0x03]; - int nActiveV = ((EDIDData[0x36 + 0x07] & 0xF0) << 4) | EDIDData[0x36 + 0x05]; - int nBlankV = ((EDIDData[0x36 + 0x07] & 0x0F) << 8) | EDIDData[0x36 + 0x06]; - - // Size of the display image in mm - int nSizeH = ((EDIDData[0x36 + 0x0E] & 0xF0) << 4) | EDIDData[0x36 + 0x0C]; - int nSizeV = ((EDIDData[0x36 + 0x0E] & 0x0F) << 8) | EDIDData[0x36 + 0x0D]; - - // We need to calculate the refresh rate ourselves based on the other numbers - double dRefresh = 1.0 / ((double)(nActiveH + nBlankH) * (nActiveV + nBlankV) / nPixelClock); - - AddLine(_T(" Preferred mode %dx%d, %1.3lf Hz (%dx%dmm, %1.3lf MHz)"), nActiveH, nActiveV, dRefresh, nSizeH, nSizeV, nPixelClock / 1000000.0); - } - - { - // Print the signal limits for this display - - int nLimitsOffset = 0; - - // Find the data block containing the limits - for (int i = 0; i < 4; i++) { - if (EDIDData[0x36 + i * 0x12 + 0] == 0x00 && EDIDData[0x36 + i * 0x12 + 1] == 0x00 && EDIDData[0x36 + i * 0x12 + 2] == 0x00 && EDIDData[0x36 + i * 0x12 + 3] == 0xFD) { - nLimitsOffset = 0x36 + i * 0x12; - break; - } - } - - if (nLimitsOffset) { - AddLine(_T(" Max. bandwidth %d MHz, H sync %d-%d KHz, V sync %d-%d Hz"), EDIDData[nLimitsOffset + 0x09] * 10, EDIDData[nLimitsOffset + 0x07], EDIDData[nLimitsOffset + 0x08], EDIDData[nLimitsOffset + 0x05], EDIDData[nLimitsOffset + 0x06]); - } - } - -#if 0 - { - - // Print the raw data block - BYTE* pData = EDIDData; - - AddText(_T("\r\n Raw EDID data\r\n")); - for (int n = 0; n < 8; n++) { - AddText(_T(" ")); - - for (int m = 0; m < 16; m++) { - AddText(_T("%02X "), *pData & 255); - pData++; - } - AddText(_T("")); - } - AddText(_T("")); - } -#endif - - } - - RegCloseKey(hMonitorInfoKey); - - return 0; -} - -// Print info about displays and display adapters -int PrintDisplayInfo() -{ - BOOL (WINAPI* pEnumDisplayDevices)(LPCTSTR, DWORD, PDISPLAY_DEVICE, DWORD) = NULL; - HINSTANCE hUser32DLL; - - // The EnumDisplayDevices() function is only available on NT based OSes - hUser32DLL = LoadLibrary(_T("user32.dll")); - if (hUser32DLL) { -#if defined (UNICODE) - pEnumDisplayDevices = (BOOL (WINAPI*)(LPCTSTR, DWORD, PDISPLAY_DEVICE, DWORD))GetProcAddress(hUser32DLL, "EnumDisplayDevicesW"); -#else - pEnumDisplayDevices = (BOOL (WINAPI*)(LPCTSTR, DWORD, PDISPLAY_DEVICE, DWORD))GetProcAddress(hUser32DLL, "EnumDisplayDevicesA"); -#endif - if (pEnumDisplayDevices) { - DISPLAY_DEVICE ddAdapter; - DISPLAY_DEVICE ddDisplay; - - ddAdapter.cb = sizeof(DISPLAY_DEVICE); - ddDisplay.cb = sizeof(DISPLAY_DEVICE); - - // Now that we've ensured we can use the EnumDisplayDevices() function, use it to enumerate the connected displays - AddLine(_T("Installed displays and display adapters:")); - - for (int i = 0; pEnumDisplayDevices(NULL, i, &ddAdapter, 0); i++) { - - // We're only interested in real display adapters - if (!(ddAdapter.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER)) { - for (int j = 0; pEnumDisplayDevices(ddAdapter.DeviceName, j, &ddDisplay, 0); j++) { - - HKEY hKey = NULL; - HKEY hMonitorKey = NULL; - - TCHAR szMfg[1024] = _T(""); DWORD nMfgSize = sizeof(szMfg); - TCHAR szDeviceDesc[1024] = _T(""); DWORD nDeviceDescSize = sizeof(szDeviceDesc); - - // If the display is active, get the data about it - if (ddDisplay.StateFlags & DISPLAY_DEVICE_ACTIVE) { - if (!_tcsnicmp(ddDisplay.DeviceKey, _T("\\Registry\\Machine\\"), 18)) { - TCHAR szDriver[1024]; DWORD nSize = sizeof(szDriver); - DWORD nType = REG_SZ; - RegOpenKeyEx(HKEY_LOCAL_MACHINE, ddDisplay.DeviceKey + 18, 0, KEY_READ, &hKey); - - // Find the registry key for this display in the hardware area of the registry - RegQueryValueEx(hKey, _T("MatchingDeviceId"), NULL, &nType, (BYTE*)szDriver, &nSize); - hMonitorKey = FindMonitor(szDriver, ddDisplay.DeviceKey + 57); - - RegQueryValueEx(hMonitorKey, _T("DeviceDesc"), NULL, &nType, (BYTE*)szDeviceDesc, &nDeviceDescSize); - RegQueryValueEx(hMonitorKey, _T("Mfg"), NULL, &nType, (BYTE*)szMfg, &nMfgSize); - } - - // Print the information we've got so far - TCHAR* pszStatus = _T(""); - if (ddAdapter.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) { - pszStatus = _T(" (primary)"); - } - if (!(ddAdapter.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)) { - pszStatus = _T(" (disabled)"); - } - if (szMfg[0] && szDeviceDesc[0]) { - AddLine(_T(" %s %s on %s%s"), szMfg, szDeviceDesc, ddAdapter.DeviceString, pszStatus); - } else { - AddLine(_T(" %s on %s%s"), ddDisplay.DeviceString, ddAdapter.DeviceString, pszStatus); - } - - ProcessEDID(hMonitorKey); - - if (hMonitorKey) { - RegCloseKey(hMonitorKey); - } - if (hKey) { - RegCloseKey(hKey); - } - } - } - } - } - } - FreeLibrary(hUser32DLL); - } - - return 0; -} - -// Print FB Alpha settings -int PrintFBAInfo() -{ - InterfaceInfo* pInfo; - - AddLine(_T(APP_TITLE) _T(" information:")); - AddLine(_T("")); - - AddLine(_T("Built on ") _T(MAKE_STRING(BUILD_DATE)) _T(", ") _T(MAKE_STRING(BUILD_TIME)) _T(", using ") _T(MAKE_STRING(BUILD_COMP)) _T(".")); - AddLine(_T(" Optimised for ") _T(MAKE_STRING(BUILD_CPU)) _T(" CPUs.")); -#if defined (_UNICODE) - AddLine(_T(" Using Unicode for all text.")); -#else - AddLine(_T(" Using multi-byte characters for all text, active codepage is %d."), GetACP()); -#endif -#if defined (FBA_DEBUG) - AddLine(_T(" Debug functionality present.")); -#else - AddLine(_T(" Debug functionality absent.")); -#endif - AddLine(_T("")); - - AddLine(_T("MMX optimisations %s."), bBurnUseMMX ? _T("enabled") : _T("disabled")); -#ifdef BUILD_A68K - if (bBurnUseASMCPUEmulation) { - AddLine(_T("A68K emulation core enabled for MC68000 emulation.")); - AddLine(_T("Musashi emulation core enabled for MC68010/MC68EC020 emulation.")); - } else { - AddLine(_T("Musashi emulation core enabled for MC680x0 family emulation.")); - } -#else - AddLine(_T("Musashi emulation core enabled for MC680x0 family emulation.")); -#endif - AddLine(_T("")); - - if (bDrvOkay) { - TCHAR szName[1024]; - - int n = _stprintf(szName, _T("Emulating %s (%hs)"), BurnDrvGetText(DRV_NAME), DecorateGameName(nBurnDrvActive)); - if (n >= 70) { - _tcscpy(szName + 66, _T("...)")); - } - AddLine(_T("%s"), szName); - AddLine(_T(" Vertical refresh is %.2lf Hz."), (double)nBurnFPS / 100); - AddLine(_T(" CPU running at %i%% of normal frequency."), nBurnCPUSpeedAdjust * 100 / 256); - AddLine(_T("")); - } else { - AddLine(_T("Not emulating any game.")); - AddLine(_T("")); - } - - if ((pInfo = VidGetInfo()) != NULL) { - AddLine(_T("Video settings:")); - PrintInterfaceInfo(pInfo); - } - AddLine(_T("")); - - if ((pInfo = AudGetInfo()) != NULL) { - AddLine(_T("Audio settings:")); - PrintInterfaceInfo(pInfo); - } - AddLine(_T("")); - - if ((pInfo = InputGetInfo()) != NULL) { - AddLine(_T("Input settings:")); - PrintInterfaceInfo(pInfo); - } - AddLine(_T("")); - - if ((pInfo = ProfileGetInfo()) != NULL) { - AddLine(_T("Profiling settings:")); - PrintInterfaceInfo(pInfo); - } - - return 0; -} - -// Print process information -int PrintProcessInfo() -{ -#if 1 - - HANDLE hModuleSnap; - MODULEENTRY32 me32; - - hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId()); - if (hModuleSnap == INVALID_HANDLE_VALUE) { - AddLine(_T("Unable to retrieve detailed process information.")); - } else { - me32.dwSize = sizeof(MODULEENTRY32); - if(!Module32First(hModuleSnap, &me32)) { - AddLine(_T("Unable to retrieve detailed process information.")); - } else { - AddLine(_T("Detailed process information about %s:"), me32.szModule); - AddLine(_T("")); - AddLine(_T("%s (base address 0x%p, size %i KB)"), me32.szModule, me32.modBaseAddr, me32.modBaseSize / 1024); - AddLine(_T("")); - - if (pExceptionPointers) { - bool bFound = false; - do { - if (me32.modBaseAddr <= pExceptionPointers->ExceptionRecord->ExceptionAddress && (me32.modBaseAddr + me32.modBaseSize) > pExceptionPointers->ExceptionRecord->ExceptionAddress) { - bFound = true; - break; - } - } while (Module32Next(hModuleSnap, &me32)); - - if (bFound) { - AddLine(_T("Exception occurred in module %s:"), me32.szModule); - AddLine(_T(" %20s (base address 0x%p, size %6i KB)"), me32.szModule, me32.modBaseAddr, me32.modBaseSize / 1024); - AddLine(_T("")); - } else { - AddLine(_T("Unable to locate module in which exception occurred")); - AddLine(_T("")); - } - } - - Module32First(hModuleSnap, &me32); - AddLine(_T("Modules loaded by %s:"), me32.szModule); - while (Module32Next(hModuleSnap, &me32)){ - AddLine(_T(" %20s (base address 0x%p, size %6i KB)"), me32.szModule, me32.modBaseAddr, me32.modBaseSize / 1024); - } - } - - CloseHandle(hModuleSnap); - } - -#endif - - return 0; -} - -// Print information about installed devices -int PrintDeviceInfo() -{ - // Get a list of all devices that are present and enabled - HDEVINFO hDevInfo = SetupDiGetClassDevs(NULL, NULL, NULL, DIGCF_ALLCLASSES | DIGCF_PRESENT | DIGCF_PROFILE); - if (hDevInfo != INVALID_HANDLE_VALUE) { - SC_HANDLE (WINAPI* pOpenSCManager)(LPCTSTR, LPCTSTR, DWORD) = NULL; - SC_HANDLE (WINAPI* pOpenService)(SC_HANDLE, LPCTSTR, DWORD) = NULL; - BOOL (WINAPI* pQueryServiceConfig)(SC_HANDLE, LPQUERY_SERVICE_CONFIG, DWORD, LPDWORD) = NULL; - BOOL (WINAPI* pCloseServiceHandle)(SC_HANDLE) = NULL; - HINSTANCE hAdvapi32DLL; - - SP_DEVINFO_DATA did; - - hAdvapi32DLL = LoadLibrary(_T("advapi32.dll")); - if (hAdvapi32DLL) { -#if defined (_UNICODE) - pOpenSCManager = (SC_HANDLE (WINAPI*)(LPCTSTR, LPCTSTR, DWORD))GetProcAddress(hAdvapi32DLL, "OpenSCManagerW"); - pOpenService = (SC_HANDLE (WINAPI*)(SC_HANDLE, LPCTSTR, DWORD))GetProcAddress(hAdvapi32DLL, "OpenServiceW"); - pQueryServiceConfig = (BOOL (WINAPI*)(SC_HANDLE, LPQUERY_SERVICE_CONFIG, DWORD, LPDWORD))GetProcAddress(hAdvapi32DLL, "QueryServiceConfigW"); -#else - pOpenSCManager = (SC_HANDLE (WINAPI*)(LPCTSTR, LPCTSTR, DWORD))GetProcAddress(hAdvapi32DLL, "OpenSCManagerA"); - pOpenService = (SC_HANDLE (WINAPI*)(SC_HANDLE, LPCTSTR, DWORD))GetProcAddress(hAdvapi32DLL, "OpenServiceA"); - pQueryServiceConfig = (BOOL (WINAPI*)(SC_HANDLE, LPQUERY_SERVICE_CONFIG, DWORD, LPDWORD))GetProcAddress(hAdvapi32DLL, "QueryServiceConfigA"); -#endif - pCloseServiceHandle = (BOOL (WINAPI*)(SC_HANDLE))GetProcAddress(hAdvapi32DLL, "CloseServiceHandle"); - } - - AddLine(_T("Installed devices (partial list):")); - AddLine(_T("")); - - // Enumerate all devices in the list - did.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); - for (int i = 0; SetupDiEnumDeviceInfo(hDevInfo, i, &did); i++) { - TCHAR* list[] = { _T("display"), _T("media"), _T("hid"), _T("hidclass"), _T("mouse"), _T("system"), NULL }; - TCHAR szClass[1024] = _T(""); - - // Get the installer class of a device - SetupDiGetDeviceRegistryProperty(hDevInfo, &did, SPDRP_CLASS, NULL, (BYTE*)szClass, 1024, NULL); - - // determine if the device is of a class we're interested in - for (int j = 0; list[j]; j++) { - if (!_tcsicmp(list[j], szClass)) { - TCHAR szName[1024] = _T(""); - TCHAR szService[1024] = _T(""); - TCHAR szDriverDate[1024] = _T(""); - TCHAR szDriverVersion[1024] = _T(""); - TCHAR szImagePath[1024] = _T(""); - HKEY hKey; - - // Get the device name - SetupDiGetDeviceRegistryProperty(hDevInfo, &did, SPDRP_DEVICEDESC, NULL, (BYTE*)szName, 1024, NULL); - - // Check if there are any lower filter drivers - SetupDiGetDeviceRegistryProperty(hDevInfo, &did, SPDRP_LOWERFILTERS, NULL, (BYTE*)szService, 1024, NULL); - if (szService[0] == _T('\0')) { - // If we haven't got any lower filter drivers, just use the service key - SetupDiGetDeviceRegistryProperty(hDevInfo, &did, SPDRP_SERVICE, NULL, (BYTE*)szService, 1024, NULL); - } - - // Get driver info - hKey = SetupDiOpenDevRegKey(hDevInfo, &did, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_READ); - if (hKey != INVALID_HANDLE_VALUE) { - DWORD nType = REG_SZ; - DWORD nSize = 1024; - - RegQueryValueEx(hKey, _T("DriverVersion"), NULL, &nType, (BYTE*)szDriverVersion, &nSize); - RegQueryValueEx(hKey, _T("DriverDate"), NULL, &nType, (BYTE*)szDriverDate, &nSize); - RegCloseKey(hKey); - } - - // If we have a driver, get the filename - if (szService[0] && pOpenSCManager && pOpenService && pQueryServiceConfig && pCloseServiceHandle) { - SC_HANDLE hSCManager, hService; - QUERY_SERVICE_CONFIG* pSC = NULL; - DWORD nSize; - - hSCManager = OpenSCManager(NULL, NULL, GENERIC_READ); - hService = OpenService(hSCManager, szService, GENERIC_READ); - - QueryServiceConfig(hService, NULL, 0, &nSize); - pSC = (QUERY_SERVICE_CONFIG*)malloc(nSize); - - if (QueryServiceConfig(hService, pSC, nSize, &nSize)) { - _tcscpy(szImagePath, pSC->lpBinaryPathName); - } - - if (pSC) { - free(pSC); - pSC = NULL; - } - - CloseServiceHandle(hService); - CloseServiceHandle(hSCManager); - } - -#if 0 - if (szImagePath[0] == '\0') { - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - // Officially, we shouldn't be doing this, but there's no API for getting this info on Win9x - const TCHAR* pszServices = "SYSTEM\\CurrentControlSet\\Services\\"; - char szFullService[1024] = ""; - - _tcscpy(szFullService, pszServices); - _tcscat(szFullService, szService); - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, szFullService, 0, KEY_EXECUTE, &hKey) == ERROR_SUCCESS) { - DWORD nType = REG_SZ; - DWORD nSize = 1024; - - RegQueryValueEx(hKey, _T("ImagePath"), NULL, &nType, szImagePath, &nSize); - RegCloseKey(hKey); - } - } - } -#endif - - // Print the information - if (j < 2 || szImagePath[0]) { - AddLine(_T(" %s"), szName); - AddLine(_T(" %s"), szImagePath[0] ? szImagePath : _T("no driver needed")); - - if (szDriverVersion[0]) { - AddLine(_T(" version %s (%s)"), szDriverVersion, szDriverDate[0] ? szDriverDate : _T("no date")); - } - } - - break; - } - } - } - - FreeLibrary(hAdvapi32DLL); - - SetupDiDestroyDeviceInfoList(hDevInfo); - } - - return 0; -} - -static INT_PTR CALLBACK SysInfoProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - static int nReturnCode = 0; - - switch (Msg) { - case WM_INITDIALOG: { - time_t nTime; - tm* tmTime; - - nReturnCode = 0; - - pszTextBuffer = NULL; - nTextBufferSize = 0; - - time(&nTime); - tmTime = localtime(&nTime); - - hLogFont = CreateFont(14, 0, 0, 0, FW_NORMAL, 0, 0, 0, 0, 0, 0, DEFAULT_QUALITY, FF_MODERN, _T("")); - - hCodeBGBrush = NULL; - hCodeFont = NULL; - - if (pExceptionPointers) { - TCHAR szText[1024] = _T(""); - hCodeBGBrush = CreateSolidBrush(RGB(0,0,0)); - hCodeFont = CreateFont(22, 0, 0, 0, FW_BOLD, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_MODERN, _T("Lucida Console")); - SendDlgItemMessage(hDlg, IDC_SYSINFO_CODE, WM_SETFONT, (WPARAM)hCodeFont, (LPARAM)0); - - _stprintf(szText, _T("Guru Meditation #%08X.%08X"), pExceptionPointers->ExceptionRecord->ExceptionCode, (INT_PTR)pExceptionPointers->ExceptionRecord->ExceptionAddress); - SendDlgItemMessage(hDlg, IDC_SYSINFO_CODE, WM_SETTEXT, (WPARAM)0, (LPARAM)szText); - - AddLine(_T(APP_TITLE) _T(" v%.20s fatal exception report (%s)."), szAppBurnVer, _tasctime(tmTime)); - - AddLine(_T("")); - AddLine(_T("----------------------------------------------------------------------")); - - // Exception - PrintExceptionInfo(); - } else { - AddLine(_T(APP_TITLE) _T(" v%.20s system information (%s)."), szAppBurnVer, _tasctime(tmTime)); - } - - AddLine(_T("")); - AddLine(_T("----------------------------------------------------------------------")); - - AddLine(_T("System information:")); - AddLine(_T("")); - - // OS information - PrintOSInfo(); - - // CPU information - PrintCPUInfo(); - - AddLine(_T("")); - - // Global memory information - PrintGlobalMemoryInfo(); - - AddLine(_T("")); - - // Displays and display adapters - PrintDisplayInfo(); - - AddLine(_T("")); - AddLine(_T("----------------------------------------------------------------------")); - - PrintFBAInfo(); - - AddLine(_T("")); - AddLine(_T("----------------------------------------------------------------------")); - - // Process information - PrintProcessInfo(); - - AddLine(_T("")); - AddLine(_T("----------------------------------------------------------------------")); - - if (bPrintDriverInfo) { - // Device information - PrintDeviceInfo(); - - AddLine(_T("")); - AddLine(_T("----------------------------------------------------------------------")); - } - - SendDlgItemMessage(hDlg, IDC_SYSINFO_EDIT, WM_SETFONT, (WPARAM)hLogFont, (LPARAM)0); - SendDlgItemMessage(hDlg, IDC_SYSINFO_EDIT, EM_SETMARGINS, (WPARAM)EC_LEFTMARGIN, (LPARAM)3); - SendDlgItemMessage(hDlg, IDC_SYSINFO_EDIT, WM_SETTEXT, (WPARAM)0, (LPARAM)pszTextBuffer); - - WndInMid(hDlg, hScrnWnd); - - return TRUE; - } - - case WM_CLOSE: { - if (pszTextBuffer) { - free(pszTextBuffer); - pszTextBuffer = NULL; - } - nTextBufferSize = 0; - - DeleteObject(hLogFont); - if (hCodeFont) { - DeleteObject(hCodeFont); - } - if (hCodeBGBrush) { - DeleteObject(hCodeBGBrush); - } - EndDialog(hDlg, nReturnCode); - break; - } - - case WM_CTLCOLORSTATIC: { - if ((HWND)lParam == GetDlgItem(hDlg, IDC_SYSINFO_EDIT)) { - return (INT_PTR)GetSysColorBrush(15); - } - if ((HWND)lParam == GetDlgItem(hDlg, IDC_SYSINFO_CODE)) { - SetTextColor((HDC)wParam, RGB(255, 0, 0)); - SetBkMode((HDC)wParam, TRANSPARENT); - return (INT_PTR)hCodeBGBrush; - } - break; - } - - case WM_COMMAND: { - if (HIWORD(wParam) == BN_CLICKED) { - if (LOWORD(wParam) == IDOK) { - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDC_SYSINFO_DEBUG) { - nReturnCode = 1; - SendMessage(hDlg, WM_CLOSE, 0, 0); - } - if (LOWORD(wParam) == IDC_SYSINFO_SHOW && pExceptionPointers) { - RECT rect = { 0, 0, 0, 125 }; - - SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDOK), TRUE); - EnableWindow(GetDlgItem(hDlg, IDC_SYSINFO_SHOW), FALSE); - - MapDialogRect(hDlg, &rect); - int nSize = rect.bottom; - GetWindowRect(hDlg, &rect); - MoveWindow(hDlg, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top + nSize, TRUE); - - WndInMid(hDlg, hScrnWnd); - } - if (LOWORD(wParam) == IDC_SYSINFO_LOG_SAVE) { - FILE* fp = NULL; - - SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDOK), TRUE); - - if (pExceptionPointers) { - TCHAR szLogName[MAX_PATH]; - _stprintf(szLogName, _T("config/%s.error.log"), szAppExeName); - fp = _tfopen(szLogName, _T("ab")); - - EnableWindow(GetDlgItem(hDlg, IDC_SYSINFO_LOG_SAVE), FALSE); - } else { - TCHAR szFilter[1024]; - - _stprintf(szFilter, FBALoadStringEx(hAppInst, IDS_DISK_TEXT, true)); - memcpy(szFilter + _tcslen(szFilter), _T(" (*.txt)\0*.txt\0\0"), 16 * sizeof(TCHAR)); - - _stprintf(szChoice, _T("%s system information.txt"), szAppExeName); - - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hDlg; - ofn.lpstrFilter = szFilter; - ofn.lpstrFile = szChoice; - ofn.nMaxFile = sizeof(szChoice) / sizeof(TCHAR); - ofn.lpstrInitialDir = _T("."); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT; - ofn.lpstrDefExt = _T("txt"); - ofn.lpstrTitle = FBALoadStringEx(hAppInst, IDS_DISK_SAVEREPORT, true); - - if (GetSaveFileName(&ofn)) { - fp = _tfopen(szChoice, _T("wb")); - } - } - - if (fp) { - TCHAR* szText; - int nSize = SendDlgItemMessage(hDlg, IDC_SYSINFO_EDIT, WM_GETTEXTLENGTH, 0, 0); - szText = (TCHAR*)malloc((nSize + 1) * sizeof(TCHAR)); - -#if defined (_UNICODE) - // write a Unicode Byte Order Mark if needed - if (ftell(fp) == 0) { - WRITE_UNICODE_BOM(fp); - } -#endif - - if (nSize && szText) { - SendDlgItemMessage(hDlg, IDC_SYSINFO_EDIT, WM_GETTEXT, (WPARAM)(nSize + 1) * sizeof(TCHAR), (LPARAM)szText); - fwrite(szText, sizeof(TCHAR), nSize, fp); - _ftprintf(fp, _T("")); - } - if (szText) { - free(szText); - szText = NULL; - } - fclose(fp); - } - } - } - } - } - - return 0; -} - -LONG CALLBACK ExceptionFilter(_EXCEPTION_POINTERS* pExceptionInfo) -{ - int nRet; - - // If we're getting recursive calls to this function, bail out - if (nRecursion++) { - if (nRecursion <= 2) { - MessageBox(hScrnWnd, _T(APP_TITLE) _T(" will now be terminated."), _T(APP_TITLE) _T(" Fatal exception"), MB_OK | MB_SETFOREGROUND); - AppCleanup(); - } -#ifdef _DEBUG - return EXCEPTION_CONTINUE_SEARCH; -#else - return EXCEPTION_EXECUTE_HANDLER; -#endif - } - - SplashDestroy(1); - AudSoundStop(); - - pExceptionPointers = pExceptionInfo; - - nRet = FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_EXCEPTION), hScrnWnd, (DLGPROC)SysInfoProc); - - switch (nRet) { - case 1: - return EXCEPTION_CONTINUE_SEARCH; - default: - AppCleanup(); - return EXCEPTION_EXECUTE_HANDLER; - } -} - -int SystemInfoCreate() -{ - pExceptionPointers = NULL; - - FBADialogBox(hAppInst, MAKEINTRESOURCE(IDD_SYSINFO), hScrnWnd, (DLGPROC)SysInfoProc); - - return 0; -} diff --git a/jan/src/burner/win32/version.rc b/jan/src/burner/win32/version.rc deleted file mode 100644 index cd84438a5..000000000 --- a/jan/src/burner/win32/version.rc +++ /dev/null @@ -1,95 +0,0 @@ -#ifdef APSTUDIO_INVOKED - #error This file cannot be edited using the Visual C resource editor -#endif - -#include "build_details.h" - -#ifndef FILENAME - #define FILENAME fba -#endif - -#ifdef MMX - #define MMX_VER ", MMX" -#else - #define MMX_VER -#endif - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION VER_MAJOR,VER_MINOR,VER_BETA,VER_ALPHA - PRODUCTVERSION VER_MAJOR,VER_MINOR,VER_BETA,VER_ALPHA - FILEFLAGSMASK 0x3FL -#ifdef SPECIALBUILD - #define SPECIALFLAG VS_FF_SPECIALBUILD -#else - #define SPECIALFLAG 0x0L -#endif -#ifdef _DEBUG - #define DEBUGFLAG VS_FF_DEBUG -#else - #define DEBUGFLAG 0x0L -#endif -#if VER_ALPHA != 0 - FILEFLAGS SPECIALFLAG | DEBUGFLAG | VS_FF_PRIVATEBUILD | VS_FF_PRERELEASE -#else - FILEFLAGS SPECIALFLAG | DEBUGFLAG -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "Comments", "built on " MAKE_STRING(BUILD_DATE) ", " MAKE_STRING(BUILD_TIME) " (" MAKE_STRING(BUILD_CHAR) ", " MAKE_STRING(BUILD_COMP) ", " MAKE_STRING(BUILD_CPU) MMX_VER ").\0" - VALUE "CompanyName", "Team FB Alpha\0" - VALUE "FileDescription", APP_DESCRIPTION "\0" - VALUE "FileVersion", MAKE_STRING(VER_MAJOR) "," MAKE_STRING(VER_MINOR) "," MAKE_STRING(VER_BETA) "," MAKE_STRING(VER_ALPHA) "\0" - VALUE "InternalName", MAKE_STRING(FILENAME) "\0" - VALUE "LegalCopyright", " 2004-2011 Team FB Alpha\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", MAKE_STRING(FILENAME) ".exe\0" - #ifdef FBA_DEBUG - #if VER_ALPHA != 0 - VALUE "PrivateBuild", "Pre-release debug build\0" - #else - VALUE "PrivateBuild", "Debug build\0" - #endif -#else - #if VER_ALPHA != 0 - VALUE "PrivateBuild", "Pre-release build\0" - #endif -#endif - VALUE "ProductName", APP_TITLE "\0" -#if VER_BETA == 99 && VER_ALPHA > 90 - VALUE "ProductVersion", "Release Candidate (v" MAKE_STRING(VER_MAJOR) "." MAKE_STRING(VER_MINOR) "." MAKE_STRING(VER_BETA) "." MAKE_STRING(VER_ALPHA) ")\0" -#else - #if VER_ALPHA != 0 - VALUE "ProductVersion", "Pre-release (alpha) version v" MAKE_STRING(VER_MAJOR) "." MAKE_STRING(VER_MINOR) "." MAKE_STRING(VER_BETA) "." MAKE_STRING(VER_ALPHA) "\0" - #else - #if VER_BETA != 0 - VALUE "ProductVersion", "Pre-release (beta) version v" MAKE_STRING(VER_MAJOR) "." MAKE_STRING(VER_MINOR) "." MAKE_STRING(VER_BETA) "." MAKE_STRING(VER_ALPHA) "\0" - #else - VALUE "ProductVersion", "Release version v" MAKE_STRING(VER_MAJOR) "." MAKE_STRING(VER_MINOR) "." MAKE_STRING(VER_BETA) "." MAKE_STRING(VER_ALPHA) "\0" - #endif - #endif -#endif -#ifdef SPECIALBUILD - VALUE "SpecialBuild", MAKE_STRING(SPECIALBUILD) "\0" -#endif - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - diff --git a/jan/src/burner/win32/wave.cpp b/jan/src/burner/win32/wave.cpp deleted file mode 100644 index e1fc7f1b2..000000000 --- a/jan/src/burner/win32/wave.cpp +++ /dev/null @@ -1,116 +0,0 @@ -// Wave log module -#include "burner.h" - - -FILE *WaveLog=NULL; // wave log file - - -static void MakeOfn(TCHAR* pszFilter) -{ - _stprintf(pszFilter, FBALoadStringEx(hAppInst, IDS_DISK_FILE_SOUND, true), _T(APP_TITLE)); - memcpy(pszFilter + _tcslen(pszFilter), _T(" (*.wav)\0*.wav\0\0"), 16 * sizeof(TCHAR)); - - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hScrnWnd; - ofn.lpstrFilter = pszFilter; - ofn.lpstrFile = szChoice; - ofn.nMaxFile = sizeof(szChoice) / sizeof(TCHAR); - ofn.lpstrInitialDir = _T(".\\wav"); - ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - ofn.lpstrDefExt = _T("wav"); - - return; -} - - -// Make a wave header so we can write out raw samples after it to make a wave file -static int WaveLogHeaderStart(FILE *Hand,int nSamRate) -{ - unsigned int ua=0x10; - WORD wFormatTag=1; // PCM - WORD nChannels=0; - DWORD nSamplesPerSec=0,nAvgBytesPerSec=0; - WORD nBlockAlign=0,wBitsPerSample=0; - - nChannels=2; // stereo - nSamplesPerSec=nSamRate; - nAvgBytesPerSec=nSamRate*4; // samrate*2*short - nBlockAlign=4; // 2*short - wBitsPerSample=16; // 16-bit - - if (Hand==NULL) - return 1; - fwrite("RIFF WAVEfmt ",1,0x10,Hand); // fill in 0x04 later - fwrite(&ua,1,sizeof(ua),Hand); - fwrite(&wFormatTag,1,sizeof(wFormatTag),Hand); - fwrite(&nChannels,1,sizeof(nChannels),Hand); - fwrite(&nSamplesPerSec,1,sizeof(nSamplesPerSec),Hand); - fwrite(&nAvgBytesPerSec,1,sizeof(nAvgBytesPerSec),Hand); - fwrite(&nBlockAlign,1,sizeof(nBlockAlign),Hand); - fwrite(&wBitsPerSample,1,sizeof(wBitsPerSample),Hand); - fwrite("data ",1,0x08,Hand); // fill in 0x28 later - return 0; -} - -// Fill in the RIFF and data values -static int WaveLogHeaderFillIn(FILE *Hand) -{ - unsigned int nLen=0; - if (Hand==NULL) - return 1; - fseek(Hand,0,SEEK_END); nLen=ftell(Hand); - fseek(Hand,0x04,SEEK_SET); nLen-=8; fwrite(&nLen,1,sizeof(nLen),Hand); // RIFF value - fseek(Hand,0x28,SEEK_SET); nLen-=40; fwrite(&nLen,1,sizeof(nLen),Hand); // data value - fseek(Hand,0,SEEK_END); - return 0; -} - -int WaveLogStart() -{ - TCHAR szFilter[1024]; - int nRet; - int bOldPause; - - WaveLogStop(); // make sure old log is closed - - MakeOfn(szFilter); - bOldPause = bRunPause; - bRunPause = 1; - nRet = GetSaveFileName(&ofn); - bRunPause = bOldPause; - if (nRet == 0) { - return 1; - } - - { - WaveLog=_tfopen(szChoice,_T("wb")); - if (WaveLog==NULL) - { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_CREATE)); - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_SOUND)); - FBAPopupDisplay(PUF_TYPE_ERROR); - return 1; - } - WaveLogHeaderStart(WaveLog,nAudSampleRate[nAudSelect]); - - } - MenuEnableItems(); - return 0; -} - -int WaveLogStop() -{ - if (WaveLog) - { - WaveLogHeaderFillIn(WaveLog); - fclose(WaveLog); - - WaveLog = NULL; - - MenuEnableItems(); - } - - return 0; -} - diff --git a/jan/src/burner/zipfn.cpp b/jan/src/burner/zipfn.cpp deleted file mode 100644 index 0797d7ef3..000000000 --- a/jan/src/burner/zipfn.cpp +++ /dev/null @@ -1,400 +0,0 @@ -// Zip module -#include "burner.h" -#include "unzip.h" - -#ifdef INCLUDE_7Z_SUPPORT -#include "un7z.h" -#endif - -#define ZIPFN_FILETYPE_NONE -1 -#define ZIPFN_FILETYPE_ZIP 1 -#define ZIPFN_FILETYPE_7ZIP 2 - -static INT32 nFileType = ZIPFN_FILETYPE_NONE; - -static unzFile Zip = NULL; -static INT32 nCurrFile = 0; // The current file we are pointing to - -#ifdef INCLUDE_7Z_SUPPORT -static _7z_file* _7ZipFile = NULL; -#endif - -INT32 ZipOpen(char* szZip) -{ - nFileType = ZIPFN_FILETYPE_NONE; - - if (szZip == NULL) return 1; - - char szFileName[MAX_PATH]; - - sprintf(szFileName, "%s.zip", szZip); - Zip = unzOpen(szFileName); - if (Zip != NULL) { - nFileType = ZIPFN_FILETYPE_ZIP; - unzGoToFirstFile(Zip); - nCurrFile = 0; - - return 0; - } - -#ifdef INCLUDE_7Z_SUPPORT - sprintf(szFileName, "%s.7z", szZip); - _7z_error _7zerr = _7z_file_open(szFileName, &_7ZipFile); - if (_7zerr == _7ZERR_NONE) { - nFileType = ZIPFN_FILETYPE_7ZIP; - nCurrFile = 0; - - return 0; - } -#endif - - return 1; -} - -INT32 ZipClose() -{ - if (nFileType == ZIPFN_FILETYPE_ZIP) { - if (Zip != NULL) { - unzClose(Zip); - Zip = NULL; - } - } - -#ifdef INCLUDE_7Z_SUPPORT - if (nFileType == ZIPFN_FILETYPE_7ZIP) { - if (_7ZipFile != NULL) { - _7z_file_close(_7ZipFile); - _7ZipFile = NULL; - } - } -#endif - - nFileType = ZIPFN_FILETYPE_NONE; - - return 0; -} - -// Get the contents of a zip file into an array of ZipEntrys -INT32 ZipGetList(struct ZipEntry** pList, INT32* pnListCount) -{ - if (nFileType == ZIPFN_FILETYPE_ZIP && Zip == NULL) return 1; - if (pList == NULL) return 1; - -#ifdef INCLUDE_7Z_SUPPORT - if (nFileType == ZIPFN_FILETYPE_7ZIP && _7ZipFile == NULL) return 1; -#endif - - if (nFileType == ZIPFN_FILETYPE_ZIP) { - unz_global_info ZipGlobalInfo; - memset(&ZipGlobalInfo, 0, sizeof(ZipGlobalInfo)); - - unzGetGlobalInfo(Zip, &ZipGlobalInfo); - INT32 nListLen = ZipGlobalInfo.number_entry; - - // Make an array of File Entries - struct ZipEntry* List = (struct ZipEntry *)malloc(nListLen * sizeof(struct ZipEntry)); - if (List == NULL) { unzClose(Zip); return 1; } - memset(List, 0, nListLen * sizeof(struct ZipEntry)); - - INT32 nRet = unzGoToFirstFile(Zip); - if (nRet != UNZ_OK) { unzClose(Zip); free(List); List = NULL; return 1; } - - // Step through all of the files, until we get to the end - INT32 nNextRet = 0; - - for (nCurrFile = 0, nNextRet = UNZ_OK; - nCurrFile < nListLen && nNextRet == UNZ_OK; - nCurrFile++, nNextRet = unzGoToNextFile(Zip)) - { - unz_file_info FileInfo; - memset(&FileInfo, 0, sizeof(FileInfo)); - - nRet = unzGetCurrentFileInfo(Zip, &FileInfo, NULL, 0, NULL, 0, NULL, 0); - if (nRet != UNZ_OK) continue; - - // Allocate space for the filename - char* szName = (char *)malloc(FileInfo.size_filename + 1); - if (szName == NULL) continue; - - nRet = unzGetCurrentFileInfo(Zip, &FileInfo, szName, FileInfo.size_filename + 1, NULL, 0, NULL, 0); - if (nRet != UNZ_OK) continue; - - List[nCurrFile].szName = szName; - List[nCurrFile].nLen = FileInfo.uncompressed_size; - List[nCurrFile].nCrc = FileInfo.crc; - } - - // return the file list - *pList = List; - if (pnListCount != NULL) *pnListCount = nListLen; - - unzGoToFirstFile(Zip); - nCurrFile = 0; - } - -#ifdef INCLUDE_7Z_SUPPORT - if (nFileType == ZIPFN_FILETYPE_7ZIP) { - UInt16 *temp = NULL; - size_t tempSize = 0; - - INT32 nListLen = _7ZipFile->db.NumFiles; - - // Make an array of File Entries - struct ZipEntry* List = (struct ZipEntry *)malloc(nListLen * sizeof(struct ZipEntry)); - if (List == NULL) return 1; - memset(List, 0, nListLen * sizeof(struct ZipEntry)); - - for (UINT32 i = 0; i < _7ZipFile->db.NumFiles; i++) { - size_t len = SzArEx_GetFileNameUtf16(&_7ZipFile->db, i, NULL); - - // if it's a directory entry we don't care about it.. - if (SzArEx_IsDir(&_7ZipFile->db, i)) continue; - - if (len > tempSize) { - SZipFree(NULL, temp); - tempSize = len; - temp = (UInt16 *)SZipAlloc(NULL, tempSize * sizeof(temp[0])); - if (temp == 0) { - free(List); - List = NULL; - return 1; // memory error - } - } - - UINT64 size = SzArEx_GetFileSize(&_7ZipFile->db, i); - UINT32 crc = _7ZipFile->db.CRCs.Vals[i]; - - SzArEx_GetFileNameUtf16(&_7ZipFile->db, i, temp); - - // convert filename to char - char *szFileName = NULL; - szFileName = (char*)malloc(len * 2 * sizeof(char*)); - if (szFileName == NULL) continue; - - for (UINT32 j = 0; j < len; j++) { - szFileName[j + 0] = temp[j] & 0xff; - szFileName[j + 1] = temp[j] >> 8; - } - - List[nCurrFile].szName = szFileName; - List[nCurrFile].nLen = size; - List[nCurrFile].nCrc = crc; - - nCurrFile++; - } - - // return the file list - *pList = List; - if (pnListCount != NULL) *pnListCount = nListLen; - - nCurrFile = 0; - - SZipFree(NULL, temp); - } -#endif - - return 0; -} - -INT32 ZipLoadFile(UINT8* Dest, INT32 nLen, INT32* pnWrote, INT32 nEntry) -{ - if (nFileType == ZIPFN_FILETYPE_ZIP && Zip == NULL) return 1; - -#ifdef INCLUDE_7Z_SUPPORT - if (nFileType == ZIPFN_FILETYPE_7ZIP && _7ZipFile == NULL) return 1; -#endif - - INT32 nRet = 0; - - if (nFileType == ZIPFN_FILETYPE_ZIP) { - if (nEntry < nCurrFile) - { - // We'll have to go through the zip file again to get to our entry - nRet = unzGoToFirstFile(Zip); - if (nRet != UNZ_OK) return 1; - nCurrFile = 0; - } - - // Now step through to the file we need - while (nCurrFile < nEntry) - { - nRet = unzGoToNextFile(Zip); - if (nRet != UNZ_OK) return 1; - nCurrFile++; - } - - nRet = unzOpenCurrentFile(Zip); - if (nRet != UNZ_OK) return 1; - - nRet = unzReadCurrentFile(Zip, Dest, nLen); - // Return how many bytes were copied - if (nRet >= 0 && pnWrote != NULL) *pnWrote = nRet; - - nRet = unzCloseCurrentFile(Zip); - if (nRet == UNZ_CRCERROR) return 2; - if (nRet != UNZ_OK) return 1; - } - -#ifdef INCLUDE_7Z_SUPPORT - if (nFileType == ZIPFN_FILETYPE_7ZIP) { - _7ZipFile->curr_file_idx = nEntry; - UINT32 nWrote = 0; - - UINT32 crc = _7ZipFile->db.CRCs.Vals[nEntry]; - - _7z_error _7zerr = _7z_file_decompress(_7ZipFile, Dest, nLen, &nWrote); - if (_7zerr != _7ZERR_NONE) return 1; - - // Return how many bytes were copied - if (_7zerr == _7ZERR_NONE && pnWrote != NULL) *pnWrote = (INT32)nWrote; - - // use zlib crc32 module to calc crc of decompressed data, and check against 7z header - UINT32 nCalcCrc = crc32(0, Dest, nWrote); - if (nCalcCrc != crc) return 2; - } -#endif - - return 0; -} - -// Load one file directly, added by regret -INT32 __cdecl ZipLoadOneFile(char* arcName, const char* fileName, void** Dest, INT32* pnWrote) -{ - if (ZipOpen(arcName)) { - return 1; - } - - if (nFileType == ZIPFN_FILETYPE_ZIP) { - unz_global_info ZipGlobalInfo; - memset(&ZipGlobalInfo, 0, sizeof(ZipGlobalInfo)); - - unzGetGlobalInfo(Zip, &ZipGlobalInfo); - INT32 nListLen = ZipGlobalInfo.number_entry; - if (nListLen <= 0) { - ZipClose(); - return 1; - } - - INT32 nRet = unzGoToFirstFile(Zip); - if (nRet != UNZ_OK) { unzClose(Zip); return 1; } - - unz_file_info FileInfo; - memset(&FileInfo, 0, sizeof(FileInfo)); - - if (fileName != NULL) { - // Step through all of the files, until we get to the end - INT32 nNextRet = 0; - char szName[MAX_PATH] = ""; - - for (nCurrFile = 0, nNextRet = UNZ_OK; - nCurrFile < nListLen && nNextRet == UNZ_OK; - nCurrFile++, nNextRet = unzGoToNextFile(Zip)) - { - nRet = unzGetCurrentFileInfo(Zip, &FileInfo, szName, MAX_PATH, NULL, 0, NULL, 0); - if (nRet != UNZ_OK) continue; - - if (!strcmp(szName, fileName)) { - break; - } - } - - if (nCurrFile == nListLen) { - ZipClose(); - return 1; // didn't find - } - } - else { - nRet = unzGetCurrentFileInfo(Zip, &FileInfo, NULL, 0, NULL, 0, NULL, 0); - if (nRet != UNZ_OK) { - ZipClose(); - return 1; - } - } - - // Extract file - nRet = unzOpenCurrentFile(Zip); - if (nRet != UNZ_OK) { - unzCloseCurrentFile(Zip); - ZipClose(); - return 1; - } - - if (*Dest == NULL) { - *Dest = (UINT8*)malloc(FileInfo.uncompressed_size); - if (!*Dest) { - unzCloseCurrentFile(Zip); - ZipClose(); - return 1; - } - } - - nRet = unzReadCurrentFile(Zip, *Dest, FileInfo.uncompressed_size); - // Return how many bytes were copied - if (nRet >= 0 && pnWrote != NULL) *pnWrote = nRet; - - nRet = unzCloseCurrentFile(Zip); - ZipClose(); - - if (nRet == UNZ_CRCERROR) { - if (*Dest) { - free(*Dest); - } - return 2; - } - if (nRet != UNZ_OK) { - if (*Dest) { - free(*Dest); - } - return 1; - } - } - -#ifdef INCLUDE_7Z_SUPPORT - if (nFileType == ZIPFN_FILETYPE_7ZIP) { - UINT32 nWrote = 0; - - nCurrFile = _7z_search_crc_match(_7ZipFile, 0, fileName, strlen(fileName), 0, 1); - if (nCurrFile == -1) { - ZipClose(); - return 1; - } - - UINT64 size = SzArEx_GetFileSize(&_7ZipFile->db, nCurrFile); - UINT32 crc = _7ZipFile->db.CRCs.Vals[nCurrFile]; - - _7ZipFile->curr_file_idx = nCurrFile; - - if (*Dest == NULL) { - *Dest = (UINT8*)malloc(size); - if (!*Dest) { - ZipClose(); - return 1; - } - } - - _7z_error _7zerr = _7z_file_decompress(_7ZipFile, *Dest, size, &nWrote); - if (_7zerr != _7ZERR_NONE) { - ZipClose(); - if (*Dest) free(*Dest); - return 1; - } - - // Return how many bytes were copied - if (_7zerr == _7ZERR_NONE && pnWrote != NULL) *pnWrote = (INT32)nWrote; - - // use zlib crc32 module to calc crc of decompressed data, and check against 7z header - UINT32 nCalcCrc = crc32(0, (const Bytef*)*Dest, nWrote); - if (nCalcCrc != crc) { - ZipClose(); - if (*Dest) free(*Dest); - return 2; - } - - ZipClose(); - - nCurrFile = 0; - } -#endif - - return 0; -} diff --git a/jan/src/cpu/a68k/fba_make68k.c b/jan/src/cpu/a68k/fba_make68k.c deleted file mode 100644 index a2dcc42cb..000000000 --- a/jan/src/cpu/a68k/fba_make68k.c +++ /dev/null @@ -1,8244 +0,0 @@ -/*--------------------------------------------------------------- - * Motorola 68000 32 Bit emulator - * - * Copyright 1998-2001 Mike Coates, All rights reserved - * Darren Olafson - *--------------------------------------------------------------- - * - * Thanks to ... - * - * Neil Bradley (lots of optimisation help & ideas) - * - *--------------------------------------------------------------- - * History (so we know what bugs have been fixed) - * - * 02.11.98 MJC - CMPM bug, overwriting first value - * 04.11.98 MJC - Debug timing - same as C core - * save PC on calls to C memory routines - * 05.11.98 NS - Re-insert changes to make work on OS/2 - * 06.11.98 MJC - Flags saved on ADDA commands - * X set on ADD commands - * 23.11.98 MJC - Alternate Memory Read/Write for non DOS ports - * 24.11.98 CK - Add WIN32 specific stuff - * 25.11.98 DEO - ABCD Size not initialised - * 21.12.98 MJC - Change register saving on Memory Banking - * 13.01.99 M/D - Change to new C core disassembler - * 19.01.99 MJC - Proper? support for new Interrupt System - * 17.02.99 MJC - TRACE68K define added - * ABCD,SBCD not keeping Z flag - * JMP, JSR for some EA combo's damaging flags - * DIVU - Overflow not being set correctly - * ASL/ASR - Flag Handling now correct - * some minor optimisations - * 13.03.99 DEO - Added new cycle timing - * 24.03.99 MJC - TRACE68K define removed - * NEW INTERRUPT SYSTEM only - * interrupt check sped up (when not taken) - * STOP checks for interrupt - * 01.04.99 MJC - OS2 specifics added - * MOVEM reference point moved - * Data and Address register mode combined for :- - * movecodes - * dumpx - * 04.05.99 MJC - Add Previous PC support to MOVE.B #X,XXXXXX.L (F1 Dream) - * ABCD/SBCD could corrupt zero flag - * DIVS/DIVU overflow should not update register - * 22.05.99 MJC - Complete support of Previous PC on C calls - * Some optional bits now selected by DEFINES - * 27.05.99 MJC - Interrupt system changed - * 28.05.99 MJC - Use DEFINES in more places - * Interrupt check running one opcode when taken - * 16.07.99 MJC - Reset - Preload next opcode / external call - * 68010 commands almost complete - * more compression on jump table (16k smaller) - * Some optimising - * shl reg,1 -> add reg,reg - * or ecx,ecx:jz -> jecxz - * 22.08.99 DEO - SBCD/ABCD sets N flag same as carry - * 19.10.99 MJC - Change DOS memory routines - * Change DOS Clobber flags (ESI no longer safe) - * Save EAX around memory write where needed - * bit commands optimised - * 25.10.99 MJC - Was keeping masked register on read/write - * if register was preserved over call - * ESI assumed 'safe' again - * 25.10.99 MJC - Bank ID moved to CPU context - * 03.11.99 KENJO - VC++6.0 seems not to preserve EDI. Fixed "ABCD -(A0), -(A0)" crash / "roxr (A0)"-type shift crash - * 13.11.99 KENJO - Fixed "NABC" - * Now Win32 uses FASTCALL type call for interrupt callback - * 09.02.00 MJC - Check CPU type before allowing 68010/68020 instructions - * remove routines for 5 non existant opcodes - * 05.03.00 MJC - not command decrement A7 by 1 for bytes - * 10.03.00 MJC - as did btst,cmpm and nbcd - * 22.03.00 MJC - Divide by zero should not decrement PC by 2 before push - * Move memory banking into exception routine - * 14.04.00 Dave - BTST missing Opcode - * ASL.L > 31 shift - * 20.04.00 MJC - TST.B Also missing A7 specific routine - * - Extra Define A7ROUTINE to switch between having seperate - * routines for +-(A7) address modes. - * 24.06.00 MJC - ADDX/SUBX +-(A7) routines added. - * TAS should not touch X flag - * LSL/LSR EA not clearing V flag - * CHK not all opcodes in jump table - * Add define to mask status register - * 04.07.00 MJC - Keep high byte of Program Counter on Bxx and Jxx - * Fix flag handling on NEGX - * Really fix ADDX/SUBX +-(A7) - * PC could be set wrong after CHK.W instruction - * DIVS/DIVU always clear C flag - * ABCD/SBCD missing +-(A7) Routine - * TAS missing +-(A7) Routine - * Bitwise Static missing +-(A7) Routine - * CMPM missing +-(A7) Routine - * 30.09.00 DEO - added mull, divl, bfextu - * added '020 addressing modes - * fixed $6xff branching - * 23.01.01 MJC - Spits out seperate code for 68000 & 68020 - * allows seperate optimising! - * 17.02.01 MJC - Support for encrypted PC relative fetch calls - * 11.03.01 GUTI - change some cmp reg,0 and or reg,reg with test - * 13.03.01 MJC - Single Icount for Asm & C cores - * 16.05.01 ASG - use push/pop around mem calls instead of store to safe_REG - * optimized a bit the 020 extension word decoder - * removed lots of unnecessary code in branches - *--------------------------------------------------------------- - * Known Problems / Bugs - * - * 68000 - * None - Let us know if you find any! - * - * 68010 - * Instructions that are supervisor only as per 68000 spec. - * move address space not implemented. - * - * 68020 - * only long Bcc instruction implemented. - *--------------------------------------------------------------- - * Notes - * - * STALLCHECK should be defined for Pentium Class - * undefined for P2/Celerons - * - * ALIGNMENT is normally 4, but seems faster on my P2 as 0 ! - * - *--------------------------------------------------------------- - * - * Future Changes - * - * 68020 instructions to be completed - * assembler memory routines + - * - * and anything else that takes our fancy! - *---------------------------------------------------------------*/ - -/* Specials - Switch what program allows/disallows */ - -#undef STALLCHECK /* Affects fetching of Opcode */ -#undef SAVEPPC /* Save Previous PC (!!! FBA setting) */ -#define ENCRYPTED /* PC relative = decrypted */ -#define ASMBANK 10 /* Memory banking algorithm to use LVR - (bank size = 1 << ASMBANK (8 = 16)) */ -#define A7ROUTINE /* Define to use separate routines for -(a7)/(a7)+ */ -#define ALIGNMENT 4 /* Alignment to use for branches */ -#undef MASKCCR /* Mask the status register to filter out unused bits */ -#define KEEPHIGHPC /* Keep or Ignore bits 24-31 */ -#define QUICKZERO /* selects XOR r,r or MOV r,0 */ - -#include -#include -#include -#include - -/* New Disassembler */ - -char * codebuf; -int DisOp; - -#define cpu_readmem24bew(addr) (0) -#define cpu_readmem24bew_word(addr) (DisOp) - -#define MEMORY_H /* so memory.h will not be included... */ -/* -#include "d68k.c" -*/ -#undef MEMORY_H - -#undef cpu_readmem24bew -#undef cpu_readmem24bew_word - - -/* - * Defines used by Program - * - */ - -#define VERSION "0.30" - -#define TRUE -1 -#define FALSE 0 - -#define EAX 0 -#define EBX 1 -#define ECX 2 -#define EDX 3 -#define ESI 4 -#define PC ESI -#define EDI 5 -#define EBP 6 - - -#define NORMAL 0 -#define PCREL 1 - -#ifdef __ELF__ -#define PREF "" -#else -#define PREF "_" -#endif - -/* Register Location Offsets */ - -#define ICOUNT PREF "m68k_ICount" - -#define REG_DAT "R_D0" -#define REG_DAT_EBX "[R_D0+ebx*4]" -#define REG_ADD "R_A0" -#define REG_A7 "R_A7" -#define REG_USP "R_USP" -#define REG_ISP "R_ISP" -#define REG_SRH "R_SR_H" -#define REG_CCR "R_CCR" -#define REG_X "R_XC" -#define REG_PC "R_PC" -#define REG_IRQ "R_IRQ" -#define REG_S "R_SR" -#define REG_IRQ_CALLBACK "R_IRQ_CALLBACK" -#define REG_RESET_CALLBACK "R_RESET_CALLBACK" - - -/* 68010 Regs */ - -#define REG_VBR "R_VBR" -#define REG_SFC "R_SFC" -#define REG_DFC "R_DFC" - -#define FASTCALL_FIRST_REG "ecx" -#define FASTCALL_SECOND_REG "edx" - - - -/* - * Global Variables - * - */ - -FILE *fp = NULL; - -char *comptab = NULL; -char *CPUtype = NULL; - -int CPU = 0; -int FlagProcess = 0; -int CheckInterrupt = 0; -int ExternalIO = 0; -int Opcount = 0; -int TimingCycles = 0; -int AddEACycles = 0; -int AccessType = NORMAL; -int ppro = 0; - - - -/* External register preservation */ - -#ifdef DOS - -/* Registers normally saved around C routines anyway */ -/* GCC 2.9.1 (dos) seems to preserve EBX,EDI and EBP */ -static char SavedRegs[] = "-B--SDB"; - -#elif defined(WIN32) - -/* visual C++, win32, says it preserves ebx, edi, esi, and ebp */ -/* ---------- VC++ deosn't preserve EDI? (Kenjo, 110399) ---------- */ -static char SavedRegs[] = "-B--S-B"; - -#else - -/* Assume nothing preserved */ -static char SavedRegs[] = "-------"; - -#endif - - - -/* Jump Table */ - -int OpcodeArray[65536]; - -/* Lookup Arrays */ - -static char* regnameslong[] = -{ "EAX","EBX","ECX","EDX","ESI","EDI","EBP"}; - -static char* regnamesword[] = -{ "AX","BX","CX","DX", "SI", "DI", "BP"}; - -static char* regnamesshort[] = -{ "AL","BL","CL","DL"}; - - - -/*********************************/ -/* Conversion / Utility Routines */ -/*********************************/ - -/* Convert EA to Address Mode Number - * - * 0 Dn - * 1 An - * 2 (An) - * 3 (An)+ - * 4 -(An) - * 5 x(An) - * 6 x(An,xr.s) - * 7 x.w - * 8 x.l - * 9 x(PC) - * 10 x(PC,xr.s) - * 11 #x,SR,CCR Read = Immediate, Write = SR or CCR - * in order to read SR to AX, use READCCR - * 12-15 INVALID - * - * 19 (A7)+ - * 20 -(A7) - * - */ - -int EAtoAMN(int EA, int Way) -{ - int Work; - - if (Way) - { - Work = (EA & 0x7); - - if (Work == 7) Work += ((EA & 0x38) >> 3); - - if (((Work == 3) || (Work == 4)) && (((EA & 0x38) >> 3) == 7)) - { - Work += 16; - } - } - else - { - Work = (EA & 0x38) >> 3; - - if (Work == 7) Work += (EA & 7); - - if (((Work == 3) || (Work == 4)) && ((EA & 7) == 7)) - { - Work += 16; - } - } - - return Work; -} - -/* - * Generate Main or Sub label - */ - -char *GenerateLabel(int ID,int Type) -{ - static int LabID,LabNum; -/* - static char disasm[80]; - char *dis = disasm; -*/ - if (Type == 0) - { - CheckInterrupt=0; /* No need to check for Interrupts */ - ExternalIO=0; /* Not left Assembler Yet */ - TimingCycles=0; /* No timing info for this command */ - AddEACycles=1; /* default to add in EA timing */ - Opcount++; /* for screen display */ - - DisOp = ID; -/* - m68k_disassemble(dis,0); - sprintf(codebuf, "OP%d_%4.4x:\t\t\t\t; %s", CPU,ID, dis); -*/ - sprintf(codebuf, "OP%d_%4.4x:\t\t\t\t;", CPU,ID); - - LabID = ID; - LabNum = 0; - } - else - { - LabNum++; - sprintf(codebuf, "OP%d_%4.4x_%1x", CPU,LabID, LabNum); - } - - return codebuf; -} - -/* - * Generate Alignment Line - */ - -void Align(void) -{ - fprintf(fp, "\t\t ALIGN %d\n\n",ALIGNMENT); -} - -/* - * Copy X into Carry - * - * There are several ways this could be done, this allows - * us to easily change the way we are doing it! - */ - -void CopyX(void) -{ - /* Copy bit 0 from X flag store into Carry */ - - fprintf(fp, "\t\t bt dword [%s],0\n",REG_X); -} - -/* - * Immediate 3 bit data - * - * 0=8, anything else is itself - * - * Again, several ways to achieve this - * - * ECX contains data as 3 lowest bits - * - */ - -void ClearRegister(int regno) -{ -#ifdef QUICKZERO - fprintf(fp, "\t\t mov %s,0\n",regnameslong[regno]); -#else - fprintf(fp, "\t\t xor %s,%s\n",regnameslong[regno],regnameslong[regno]); -#endif -} - -void Immediate8(void) -{ - /* This takes 3 cycles, 5 bytes, no memory reads */ - - fprintf(fp, "\t\t dec ecx ; Move range down\n"); - fprintf(fp, "\t\t and ecx,byte 7 ; Mask out lower bits\n"); - fprintf(fp, "\t\t inc ecx ; correct range\n"); - - - /* This takes 2 cycles, 10 bytes but has a memory read */ - /* I don't know timing for the mov command - assumed 1 */ - -#if 0 - fprintf(fp, "\t\t and ecx,byte 7\n"); - fprintf(fp, "\t\t mov ecx,[ImmTable+ECX*4]\n"); -#endif -} - -/* - * This will check for bank changes before - * resorting to calling the C bank select code - * - * Most of the time it does not change! - * - */ - -/* forward used by MemoryBanking */ -void Exception(int Number, int BaseCode) ; - -void MemoryBanking(int BaseCode) -{ - /* check for odd address */ - fprintf(fp, "\t\t test esi, dword 1\n"); - fprintf(fp, "\t\t jz near OP%d_%5.5x\n",CPU,BaseCode); - - /* trying to run at an odd address */ - Exception(3,BaseCode); - - /* Keep Whole PC */ - - fprintf(fp, "OP%d_%5.5x:\n",CPU,BaseCode); - -/* ASG - always call to the changepc subroutine now, since the number of */ -/* bits varies based on the memory model */ -#ifdef KEEPHIGHPC - fprintf(fp, "\t\t mov [FullPC],ESI\n"); -#endif - - /* Mask to n bits */ - fprintf(fp, "\t\t and esi,[%smem_amask]\n", PREF); - -#if 0 -#ifdef KEEPHIGHPC - fprintf(fp, "\t\t mov [FullPC],ESI\n"); -#endif - - /* Mask to 24 bits */ -// fprintf(fp, "\t\t and esi,0ffffffh\n"); - -#ifdef ASMBANK - /* Assembler bank switch */ - - fprintf(fp, "\t\t mov eax,esi\n"); - /* LVR - use a variable bank size */ - fprintf(fp, "\t\t shr eax," ASMBANK "\n"); - fprintf(fp, "\t\t cmp [asmbank],eax\n"); - fprintf(fp, "\t\t je OP%d_%5.5x_Bank\n",CPU,BaseCode); - - fprintf(fp, "\t\t mov [asmbank],eax\n"); -#else - /* This code is same as macro used by C core */ - - fprintf(fp, "\t\t mov ecx,esi\n"); - fprintf(fp, "\t\t mov ebx,[_cur_mrhard]\n"); - fprintf(fp, "\t\t shr ecx,9\n"); - fprintf(fp, "\t\t mov al,byte [_opcode_entry]\n"); - fprintf(fp, "\t\t cmp al,[ecx+ebx]\n"); - fprintf(fp, "\t\t je OP%d_%5.5x_Bank\n",CPU,BaseCode); -#endif -#endif - - /* Call Banking Routine */ - - if (SavedRegs[ESI] == '-') - { - fprintf(fp, "\t\t mov [%s],ESI\n",REG_PC); - } - - if (SavedRegs[EDX] == '-') - { - fprintf(fp, "\t\t mov [%s],edx\n",REG_CCR); - } - -#ifdef FASTCALL - fprintf(fp, "\t\t mov %s,esi\n",FASTCALL_FIRST_REG); -#else - fprintf(fp, "\t\t push esi\n"); -#endif - - fprintf(fp, "\t\t call [%sa68k_memory_intf+28]\n", PREF); - -#ifndef FASTCALL - fprintf(fp, "\t\t lea esp,[esp+4]\n"); -#endif - - if (SavedRegs[EDX] == '-') - { - fprintf(fp, "\t\t mov edx,[%s]\n",REG_CCR); - } - - if (SavedRegs[ESI] == '-') - { - fprintf(fp, "\t\t mov esi,[%s]\n",REG_PC); - } - - /* Update our copy */ - - fprintf(fp, "\t\t mov ebp,dword [%sOP_ROM]\n", PREF); - - fprintf(fp, "OP%d_%5.5x_Bank:\n",CPU,BaseCode); -} - -/* - * Update Previous PC value - * - */ - -void SavePreviousPC(void) -{ -#ifdef SAVEPPC - fprintf(fp, "\t\t mov [R_PPC],esi\t\t\t ; Keep Previous PC\n"); -#endif -} - -/* - * Complete Opcode handling - * - * Any tidying up, end code - * - */ - -void Completed(void) -{ - - /* Flag Processing to be finished off ? */ - - AccessType = NORMAL; - - /* Use assembler timing routines */ - - if (TimingCycles != 0) - { - if (TimingCycles > 127) - fprintf(fp, "\t\t sub dword [%s],%d\n",ICOUNT,TimingCycles); - else - { - if (TimingCycles != -1) - fprintf(fp, "\t\t sub dword [%s],byte %d\n",ICOUNT,TimingCycles); - } - - if (FlagProcess > 0) - fprintf(fp, "\t\t pop EDX\n"); - if (FlagProcess == 2) - fprintf(fp, "\t\t mov [%s],edx\n",REG_X); - - fprintf(fp, "\t\t js near MainExit\n\n"); - } - else - { - fprintf(fp, "\t\t test dword [%s],0xffffffff\n",ICOUNT); - - if (FlagProcess > 0) - fprintf(fp, "\t\t pop EDX\n"); - if (FlagProcess == 2) - fprintf(fp, "\t\t mov [%s],edx\n",REG_X); - - fprintf(fp, "\t\t jle near MainExit\n\n"); - } - FlagProcess = 0; - -#ifdef MAME_DEBUG - - /* Check for Debug Active */ - - fprintf(fp, "\n\t\t test byte [%smame_debug],byte 0xff\n", PREF); - fprintf(fp, "\t\t jnz near MainExit\n\n"); - -#endif - -#ifdef FBA_DEBUG - - fprintf(fp, "\n\t\t test byte [%smame_debug],byte 0xff\n", PREF); - fprintf(fp, "\t\t jns near .NoDebug\n"); - fprintf(fp, "\t\t call near FBADebugActive\n\n"); - fprintf(fp, ".NoDebug\n"); - -#endif - - if (CheckInterrupt) - { - fprintf(fp,"; Check for Interrupt waiting\n\n"); - fprintf(fp,"\t\t test byte [%s],07H\n",REG_IRQ); - fprintf(fp,"\t\t jne near interrupt\n\n"); - } - - if(CPU==2) - { - /* 32 bit memory version */ - fprintf(fp, "\t\t mov eax,2\n"); /* ASG */ - fprintf(fp, "\t\t xor eax,esi\n"); /* ASG */ - -#ifdef STALLCHECK - ClearRegister(ECX); - fprintf(fp, "\t\t mov cx,[eax+ebp]\n"); -#else - fprintf(fp, "\t\t movzx ecx,word [eax+ebp]\n"); -#endif - } - else - { - /* 16 bit memory */ -#ifdef STALLCHECK - ClearRegister(ECX); - fprintf(fp, "\t\t mov cx,[esi+ebp]\n"); -#else - fprintf(fp, "\t\t movzx ecx,word [esi+ebp]\n"); -#endif - } - - fprintf(fp, "\t\t jmp [%s_OPCODETABLE+ecx*4]\n\n", CPUtype); -} - -/* - * Flag Routines - * - * Size = B,W or L - * Sreg = Register to Test - * TestReg = Need to test register (false if flags already set up) - * SetX = if C needs to be copied across to X register - * Delayed = Delays final processing to end of routine (Completed()) - * - */ - -void TestFlags(char Size,int Sreg) -{ - char* Regname=""; - - switch (Size) - { - case 66: - Regname = regnamesshort[Sreg]; - break; - - case 87: - Regname = regnamesword[Sreg]; - break; - - case 76: - Regname = regnameslong[Sreg]; - break; - } - - /* Test does not update register */ - /* so cannot generate partial stall */ - - fprintf(fp, "\t\t test %s,%s\n",Regname,Regname); -} - -void SetFlags(char Size,int Sreg,int Testreg,int SetX,int Delayed) -{ - if (Testreg) TestFlags(Size,Sreg); - - fprintf(fp, "\t\t pushfd\n"); - - if (Delayed) - { - /* Rest of code done by Completed routine */ - - if (SetX) FlagProcess = 2; - else FlagProcess = 1; - } - else - { - fprintf(fp, "\t\t pop EDX\n"); - - if (SetX) fprintf(fp, "\t\t mov [%s],edx\n",REG_X); - } -} - -/******************/ -/* Check CPU Type */ -/******************/ - -void CheckCPUtype(int Minimum) -{ - if(CPU==2) - { - /* Only check for > 020 */ - - if(Minimum>2) - { - fprintf(fp, "\t\t mov eax,[CPUversion]\n"); - - fprintf(fp, "\t\t cmp al,%d\n",Minimum); - fprintf(fp, "\t\t jb near ILLEGAL\n\n"); - } - } - else - { - fprintf(fp, "\t\t mov eax,[CPUversion]\n"); - - if (Minimum == 1) - { - fprintf(fp, "\t\t test eax,eax\n"); - fprintf(fp, "\t\t jz near ILLEGAL\n\n"); - } - else - { - fprintf(fp, "\t\t cmp al,%d\n",Minimum); - fprintf(fp, "\t\t jb near ILLEGAL\n\n"); - } - } -} - -/************************************/ -/* Pre-increment and Post-Decrement */ -/************************************/ - -void IncrementEDI(int Size,int Rreg) -{ - switch (Size) - { - case 66: - -#ifdef A7ROUTINE - - /* Always does Byte Increment - A7 uses special routine */ - - fprintf(fp, "\t\t inc dword [%s+%s*4]\n",REG_ADD,regnameslong[Rreg]); - -#else - - /* A7 uses same routines, so inc by 2 if A7 */ - - fprintf(fp, "\t\t cmp %s,7\n",regnamesshort[Rreg]); - fprintf(fp, "\t\t cmc\n"); - fprintf(fp, "\t\t adc dword [%s+%s*4],byte 1\n",REG_ADD,regnameslong[Rreg]); - -#endif - break; - - case 87: - - fprintf(fp, "\t\t add dword [%s+%s*4],byte 2\n",REG_ADD,regnameslong[Rreg]); - break; - - case 76: - - fprintf(fp, "\t\t add dword [%s+%s*4],byte 4\n",REG_ADD,regnameslong[Rreg]); - break; - } -} - -void DecrementEDI(int Size,int Rreg) -{ - switch (Size) - { - case 66: - -#ifdef A7ROUTINE - - /* Always does Byte Increment - A7 uses special routine */ - - fprintf(fp, "\t\t dec EDI\n"); - -#else - - /* A7 uses same routines, so dec by 2 if A7 */ - - fprintf(fp, "\t\t cmp %s,7\n",regnamesshort[Rreg]); - fprintf(fp, "\t\t cmc\n"); - fprintf(fp, "\t\t sbb dword edi,byte 1\n"); - -#endif - break; - - case 87: - - fprintf(fp, "\t\t sub EDI,byte 2\n"); - break; - - case 76: - fprintf(fp, "\t\t sub EDI,byte 4\n"); - break; - } -} - -/* - * Generate an exception - * - * if Number = -1 then assume value in AL already - * code must continue running afterwards - * - */ - -void Exception(int Number, int BaseCode) -{ - if (Number > -1) - { - fprintf(fp, "\t\t sub esi,byte 2\n"); - fprintf(fp, "\t\t mov al,%d\n",Number); - } - - fprintf(fp, "\t\t call Exception\n\n"); - - if (Number > -1) - Completed(); -} - - -/********************/ -/* Address Routines */ -/********************/ - -/* - * Decode Intel flags into AX as SR register - * - * Wreg = spare register to use (must not be EAX or EDX) - */ - -void ReadCCR(char Size, int Wreg) -{ - fprintf(fp, "\t\t mov eax,edx\n"); - fprintf(fp, "\t\t mov ah,byte [%s]\n",REG_X); - - /* Partial stall so .. switch to new bit of processing */ - - fprintf(fp, "\t\t mov %s,edx\n",regnameslong[Wreg]); - fprintf(fp, "\t\t and %s,byte 1\n",regnameslong[Wreg]); - - /* Finish what we started */ - - fprintf(fp, "\t\t shr eax,4\n"); - fprintf(fp, "\t\t and eax,byte 01Ch \t\t; X, N & Z\n\n"); - - /* and complete second task */ - - fprintf(fp, "\t\t or eax,%s \t\t\t\t; C\n\n",regnameslong[Wreg]); - - /* and Finally */ - - fprintf(fp, "\t\t mov %s,edx\n",regnameslong[Wreg]); - fprintf(fp, "\t\t shr %s,10\n",regnameslong[Wreg]); - fprintf(fp, "\t\t and %s,byte 2\n",regnameslong[Wreg]); - fprintf(fp, "\t\t or eax,%s\t\t\t\t; O\n\n",regnameslong[Wreg]); - - if (Size == 'W') - { - fprintf(fp, "\t\t mov ah,byte [%s] \t; T, S & I\n\n",REG_SRH); - -#ifdef MASKCCR - fprintf(fp, "\t\t and ax,0A71Fh\t; Mask unused bits\n"); -#endif - } -} - -/* - * Convert SR into Intel flags - * - * Also handles change of mode from Supervisor to User - * - * n.b. This is also called by EffectiveAddressWrite - */ - -void WriteCCR(char Size) -{ - if (Size == 'W') - { - /* Did we change from Supervisor to User mode ? */ - - char *Label = GenerateLabel(0,1); - - fprintf(fp, "\t\t test ah,20h \t\t\t; User Mode ?\n"); - fprintf(fp, "\t\t jne short %s\n\n",Label); - - /* Mode Switch - Update A7 */ - - fprintf(fp, "\t\t mov edx,[%s]\n",REG_A7); - fprintf(fp, "\t\t mov [%s],edx\n",REG_ISP); - fprintf(fp, "\t\t mov edx,[%s]\n",REG_USP); - fprintf(fp, "\t\t mov [%s],edx\n",REG_A7); - - fprintf(fp, "%s:\n",Label); - fprintf(fp, "\t\t mov byte [%s],ah \t;T, S & I\n",REG_SRH); - - /* Mask may now allow Interrupt */ - - CheckInterrupt += 1; - } - - /* Flags */ - - fprintf(fp, "\t\t and eax,byte 1Fh\n"); - fprintf(fp, "\t\t mov edx,[IntelFlag+eax*4]\n"); - fprintf(fp, "\t\t mov [%s],dh\n",REG_X); - fprintf(fp, "\t\t and edx,0EFFh\n"); -} - - -/* - * Interface to Mame memory commands - * - * Flags = "ABCDSDB" - set to '-' if not required to preserve - * (order EAX,EBX,ECX,EDX,ESI,EDI,EBP) - * - * AReg = Register containing Address - * - * Mask 0 : No Masking - * 1 : Mask top byte, but preserve register - * 2 : Mask top byte, preserve masked register - */ - -void Memory_Read(char Size,int AReg,char *Flags,int Mask) -{ - ExternalIO = 1; - - /* Save PC */ - - fprintf(fp, "\t\t mov [%s],ESI\n",REG_PC); - - /* Check for special mask condition */ - - /* ASG - no longer need to mask addresses here */ -/* if (Mask == 2) - fprintf(fp, "\t\t and %s,0FFFFFFh\n",regnameslong[AReg]);*/ - - /* Check to see if registers need saving */ - - if ((Flags[EDX] != '-') && (SavedRegs[EDX] == '-')) - { - fprintf(fp, "\t\t mov [%s],edx\n",REG_CCR); - } - - if ((Flags[EBX] != '-') && (SavedRegs[EBX] == '-')) - { - fprintf(fp, "\t\t push EBX\n"); - } - - if ((Flags[ECX] != '-') && (SavedRegs[ECX] == '-')) - { - fprintf(fp, "\t\t push ECX\n"); - } - - if ((Flags[EDI] != '-') && (SavedRegs[EDI] == '-')) - { - fprintf(fp, "\t\t push EDI\n"); - } - - /* Sort Address out */ - -#ifdef FASTCALL - - fprintf(fp, "\t\t mov %s,%s\n",FASTCALL_FIRST_REG,regnameslong[AReg]); - - /* ASG - no longer need to mask addresses here */ -/* if (Mask == 1) - fprintf(fp, "\t\t and %s,0FFFFFFh\n",FASTCALL_FIRST_REG);*/ - -#else - - if (Mask == 1) - { - if ((Flags[AReg] != '-') && (SavedRegs[AReg] != '-')) - { - /* Don't trash a wanted safe register */ - - fprintf(fp, "\t\t mov EAX,%s\n",regnameslong[AReg]); - /* ASG - no longer need to mask addresses here */ -/* fprintf(fp, "\t\t and EAX,0FFFFFFh\n");*/ - fprintf(fp, "\t\t push EAX\n"); - } - else - { - /* ASG - no longer need to mask addresses here */ -/* fprintf(fp, "\t\t and %s,0FFFFFFh\n",regnameslong[AReg]);*/ - fprintf(fp, "\t\t push %s\n",regnameslong[AReg]); - } - } - else - fprintf(fp, "\t\t push %s\n",regnameslong[AReg]); - -#endif - - - - /* Call Mame memory routine */ - - /* ASG - changed these to call through the function pointers */ - -#ifdef ENCRYPTED - switch (AccessType) - { - case NORMAL : - switch (Size) - { - case 66 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+4]\n", PREF); - break; - - case 87 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+8]\n", PREF); - break; - - case 76 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+12]\n", PREF); - break; - } - break; - - case PCREL : - - switch (Size) - { - case 66 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+32]\n", PREF); - break; - - case 87 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+36]\n", PREF); - break; - - case 76 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+40]\n", PREF); - break; - } - break; - } - -// AccessType = NORMAL; - -#else - - switch (Size) - { - case 66 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+4]\n", PREF); - break; - - case 87 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+8]\n", PREF); - break; - - case 76 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+12]\n", PREF); - break; - } -#endif - - /* Correct Stack */ - -#ifndef FASTCALL - fprintf(fp, "\t\t lea esp,[esp+4]\n"); -#endif - - - - /* Restore registers */ - - /* Check to see if registers need restoring */ - - if ((Flags[EDI] != '-') && (SavedRegs[EDI] == '-')) - { - fprintf(fp, "\t\t pop EDI\n"); - } - - if ((Flags[ECX] != '-') && (SavedRegs[ECX] == '-')) - { - fprintf(fp, "\t\t pop ECX\n"); - } - - if ((Flags[EBX] != '-') && (SavedRegs[EBX] == '-')) - { - fprintf(fp, "\t\t pop EBX\n"); - } - - if ((Flags[ESI] != '-') && (SavedRegs[ESI] == '-')) - { - fprintf(fp, "\t\t mov ESI,[%s]\n",REG_PC); - } - - if ((Flags[EDX] != '-') && (SavedRegs[EDX] == '-')) - { - fprintf(fp, "\t\t mov EDX,[%s]\n",REG_CCR); - } - - if ((Flags[EBP] != '-') && (SavedRegs[EBP] == '-')) - { - fprintf(fp, "\t\t mov ebp,dword [%sOP_ROM]\n", PREF); - } -} - -void Memory_Write(char Size,int AReg,int DReg,char *Flags,int Mask) -{ - ExternalIO = 1; - - /* Save PC */ - - fprintf(fp, "\t\t mov [%s],ESI\n",REG_PC); - - /* Check for special mask condition */ - - /* ASG - no longer need to mask addresses here */ -/* if (Mask == 2) - fprintf(fp, "\t\t and %s,0FFFFFFh\n",regnameslong[AReg]);*/ - - /* Check to see if registers need saving */ - - if ((Flags[EDX] != '-') && (SavedRegs[EDX] == '-')) - { - fprintf(fp, "\t\t mov [%s],edx\n",REG_CCR); - } - - if ((Flags[EAX] != '-') && (SavedRegs[EAX] == '-')) - { - fprintf(fp, "\t\t push EAX\n"); - } - - if ((Flags[EBX] != '-') && (SavedRegs[EBX] == '-')) - { - fprintf(fp, "\t\t push EBX\n"); - } - - if ((Flags[ECX] != '-') && (SavedRegs[ECX] == '-')) - { - fprintf(fp, "\t\t push ECX\n"); - } - - if ((Flags[EDI] != '-') && (SavedRegs[EDI] == '-')) - { - fprintf(fp, "\t\t push EDI\n"); - } - -#ifdef FASTCALL - - fprintf(fp, "\t\t mov %s,%s\n",FASTCALL_SECOND_REG,regnameslong[DReg]); - fprintf(fp, "\t\t mov %s,%s\n",FASTCALL_FIRST_REG,regnameslong[AReg]); - - /* ASG - no longer need to mask addresses here */ -/* if (Mask == 1) - fprintf(fp, "\t\t and %s,0FFFFFFh\n",FASTCALL_FIRST_REG);*/ - -#else - - fprintf(fp, "\t\t push %s\n",regnameslong[DReg]); - - if (Mask == 1) - { - if ((Flags[AReg] != '-') && (SavedRegs[AReg] != '-')) - { - /* Don't trash a wanted safe register */ - - fprintf(fp, "\t\t mov EAX,%s\n",regnameslong[AReg]); - /* ASG - no longer need to mask addresses here */ -/* fprintf(fp, "\t\t and EAX,0FFFFFFh\n");*/ - fprintf(fp, "\t\t push EAX\n"); - } - else - { - /* ASG - no longer need to mask addresses here */ -/* fprintf(fp, "\t\t and %s,0FFFFFFh\n",regnameslong[AReg]);*/ - fprintf(fp, "\t\t push %s\n",regnameslong[AReg]); - } - } - else - fprintf(fp, "\t\t push %s\n",regnameslong[AReg]); - -#endif - - - - /* Call Mame Routine */ - - /* ASG - changed these to call through the function pointers */ - switch (Size) - { - case 66 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+16]\n", PREF); - break; - - case 87 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+20]\n", PREF); - break; - - case 76 : - fprintf(fp, "\t\t call [%sa68k_memory_intf+24]\n", PREF); - break; - } - - /* Correct Stack */ - -#ifndef FASTCALL - fprintf(fp, "\t\t lea esp,[esp+8]\n"); -#endif - - - - /* Restore registers */ - - /* Check to see if registers need restoring */ - - if ((Flags[EDI] != '-') && (SavedRegs[EDI] == '-')) - { - fprintf(fp, "\t\t pop EDI\n"); - } - - if ((Flags[ECX] != '-') && (SavedRegs[ECX] == '-')) - { - fprintf(fp, "\t\t pop ECX\n"); - } - - if ((Flags[EBX] != '-') && (SavedRegs[EBX] == '-')) - { - fprintf(fp, "\t\t pop EBX\n"); - } - - if ((Flags[EAX] != '-') && (SavedRegs[EAX] == '-')) - { - fprintf(fp, "\t\t pop EAX\n"); - } - - if ((Flags[EDX] != '-') && (SavedRegs[EDX] == '-')) - { - fprintf(fp, "\t\t mov EDX,[%s]\n",REG_CCR); - } - - if ((Flags[ESI] != '-') && (SavedRegs[ESI] == '-')) - { - fprintf(fp, "\t\t mov ESI,[%s]\n",REG_PC); - } - - if ((Flags[EBP] != '-') && (SavedRegs[EBP] == '-')) - { - fprintf(fp, "\t\t mov ebp,dword [%sOP_ROM]\n", PREF); - } -} - - -/* - * Fetch data from Code area - * - * Dreg = Destination Register - * Extend = Sign Extend Word to Long - * - */ - -void Memory_Fetch(char Size,int Dreg,int Extend) -{ - static int loopcount=0; - - /* Always goes via OP_ROM */ - - if(CPU!=2) - { - /* 16 Bit version */ - - if ((Extend == TRUE) & (Size == 'W')) - fprintf(fp, "\t\t movsx %s,word [esi+ebp]\n",regnameslong[Dreg]); - else if (Size == 'W') - fprintf(fp, "\t\t movzx %s,word [esi+ebp]\n",regnameslong[Dreg]); - else - fprintf(fp, "\t\t mov %s,dword [esi+ebp]\n",regnameslong[Dreg]); - - if (Size == 'L') - fprintf(fp, "\t\t rol %s,16\n",regnameslong[Dreg]); - } - else - { - /* 32 Bit version */ - - if (Size == 'W') - { - fprintf(fp, "\t\t mov %s,esi\n",regnameslong[Dreg]); - fprintf(fp, "\t\t xor %s,byte 2\n",regnameslong[Dreg]); - - if (Extend == TRUE) - fprintf(fp, "\t\t movsx %s,word [%s+ebp]\n",regnameslong[Dreg],regnameslong[Dreg]); - else - fprintf(fp, "\t\t movzx %s,word [%s+ebp]\n",regnameslong[Dreg],regnameslong[Dreg]); - } - else - { - // if address is exact multiple of 4, long read will work - // otherwise we need to get words address-2 and address+4 - - // Always read long - fprintf(fp, "\t\t test esi,2\n"); -if (!ppro) -{ - fprintf(fp, "\t\t mov %s,dword [esi+ebp]\n",regnameslong[Dreg]); - - // OK ? - fprintf(fp, "\t\t jz short FL%3.3d\n",loopcount+1); - - // no, so get high word - fprintf(fp, "\t\t mov %s,dword [esi+ebp-4]\n",regnameslong[Dreg]); - // and get low word - fprintf(fp, "\t\t mov %s,word [esi+ebp+4]\n",regnamesword[Dreg]); - - fprintf(fp, "FL%3.3d:\n",++loopcount); -} -else -{ - fprintf(fp, "\t\t cmovnz %s,dword [esi+ebp-4]\n",regnameslong[Dreg]); - fprintf(fp, "\t\t cmovz %s,dword [esi+ebp]\n",regnameslong[Dreg]); - fprintf(fp, "\t\t cmovnz %s,word [esi+ebp+4]\n",regnamesword[Dreg]); -} - } - } -} - -/**********************/ -/* Push PC onto Stack */ -/**********************/ - -void PushPC(int Wreg,int Wreg2,char *Flags, int Mask) -{ - - /* Wreg2 is only used when high byte is kept */ - /* If it is EBP then the register is restored */ - - fprintf(fp, "\t\t mov %s,[%s]\t ; Push onto Stack\n",regnameslong[Wreg],REG_A7); - fprintf(fp, "\t\t sub %s,byte 4\n",regnameslong[Wreg]); - fprintf(fp, "\t\t mov [%s],%s\n",REG_A7,regnameslong[Wreg]); - -#ifndef KEEPHIGHPC - - Memory_Write('L',Wreg,ESI,Flags,Mask); - -#else - - fprintf(fp, "\t\t mov %s,[FullPC]\n",regnameslong[Wreg2]); - fprintf(fp, "\t\t and %s,0xff000000\n",regnameslong[Wreg2]); - fprintf(fp, "\t\t or %s,ESI\n",regnameslong[Wreg2]); - - Memory_Write('L',Wreg,Wreg2,Flags,Mask); - - if (Wreg2 == EBP) - { - fprintf(fp, "\t\t mov ebp,dword [%sOP_ROM]\n", PREF); - } - -#endif -} - -void ExtensionDecode(int SaveEDX) -{ - char *Label = GenerateLabel(0,1); - - if (SaveEDX) - fprintf(fp, "\t\t push edx\n"); - - Memory_Fetch('W',EAX,FALSE); - fprintf(fp, "\t\t add esi,byte 2\n"); - - if(CPU!=2) - { - /* 68000 Extension */ - - fprintf(fp, "\t\t mov edx,eax\n"); - fprintf(fp, "\t\t shr eax,12\n"); - fprintf(fp, "\t\t test edx,0x0800\n"); - fprintf(fp, "\t\t mov eax,[%s+eax*4]\n",REG_DAT); - fprintf(fp, "\t\t jnz short %s\n",Label); - fprintf(fp, "\t\t cwde\n"); - fprintf(fp, "%s:\n",Label); - fprintf(fp, "\t\t lea edi,[edi+eax]\n"); - fprintf(fp, "\t\t movsx edx,dl\n"); - fprintf(fp, "\t\t lea edi,[edi+edx]\n"); - } - else - { - /* 68020 Extension */ - - // eax holds scaled index - - // might be faster just to push all regs - fprintf(fp, "\t\t push ebx\n"); - fprintf(fp, "\t\t push ecx\n"); - - // copies for later use - fprintf(fp, "\t\t mov ecx,eax\n"); - fprintf(fp, "\t\t mov edx,eax\n"); - - // check E bit to see if displacement or full format - fprintf(fp, "\t\t test edx,0x0100\n"); - fprintf(fp, "\t\t jz short %s_a\n",Label); - // full mode so check IS (index supress) - fprintf(fp, "\t\t test edx,0x0040\n"); - fprintf(fp, "\t\t jz short %s_b\n",Label); - // set index to 0, it's not added - ClearRegister(EAX); - fprintf(fp, "\t\t jmp short %s_d\n",Label); // near - - // add displacement - fprintf(fp, "%s_a:\n",Label); - fprintf(fp, "\t\t movsx eax,al\n"); - fprintf(fp, "\t\t lea edi,[edi+eax]\n"); - - fprintf(fp, "%s_b:\n",Label); - // calc index always scale (68k will scale by 1) - fprintf(fp, "\t\t mov eax,edx\n"); - fprintf(fp, "\t\t shr eax,12\n"); - fprintf(fp, "\t\t test edx,0x0800\n"); - fprintf(fp, "\t\t mov eax,[%s+eax*4]\n",REG_DAT); - fprintf(fp, "\t\t jnz short %s_c\n",Label); - fprintf(fp, "\t\t cwde\n"); - - fprintf(fp, "%s_c:\n",Label); - fprintf(fp, "\t\t shr ecx,byte 9\n"); - fprintf(fp, "\t\t and ecx,byte 3\n"); - fprintf(fp, "\t\t shl eax,cl\n"); - - // if brief mode we can add index and exit - fprintf(fp, "\t\t test edx,0x0100\n"); - fprintf(fp, "\t\t jz near %s_i2\n",Label); - - fprintf(fp, "%s_d:\n",Label); - // check BS (base supress) - // if BS is 1 then set edi to 0 - fprintf(fp, "\t\t test edx,0x0080\n"); - fprintf(fp, "\t\t jz short %s_4a\n",Label); - ClearRegister(EDI); - // if null displacement skip over - fprintf(fp, "%s_4a:\n",Label); - fprintf(fp, "\t\t test edx,0x0020\n"); - fprintf(fp, "\t\t jz short %s_f\n",Label); - - // **** calc base displacement **** - // is it long - fprintf(fp, "\t\t test edx,0x0010\n"); - fprintf(fp, "\t\t jz short %s_e\n",Label); - // fetch long base - Memory_Fetch('L',EBX,FALSE); - fprintf(fp, "\t\t lea edi,[edi+ebx]\n"); - fprintf(fp, "\t\t add esi,byte 4\n"); - fprintf(fp, "\t\t jmp short %s_f\n",Label); - - // fetch word base - fprintf(fp, "%s_e:\n",Label); - Memory_Fetch('W',EBX,TRUE); - fprintf(fp, "\t\t lea edi,[edi+ebx]\n"); - fprintf(fp, "\t\t add esi,byte 2\n"); - - // **** indirect? **** - fprintf(fp, "%s_f:\n",Label); - fprintf(fp, "\t\t test edx,0x0003\n"); - fprintf(fp, "\t\t jz near %s_7a\n",Label); - // pre or post indirect - fprintf(fp, "\t\t test edx,0x0004\n"); - fprintf(fp, "\t\t jnz short %s_g\n",Label); - // do pre - fprintf(fp, "\t\t lea edi,[edi+eax]\n"); - Memory_Read('L',EDI,"ABCDSDB",2); - fprintf(fp, "\t\t mov edi,eax\n"); - fprintf(fp, "\t\t jmp short %s_h\n",Label); - - // do post - fprintf(fp, "%s_g:\n",Label); - fprintf(fp, "\t\t push eax\n"); - Memory_Read('L',EDI,"-B-DS-B",2); - fprintf(fp, "\t\t pop edi\n"); - - fprintf(fp, "%s_7a:\n",Label); - fprintf(fp, "\t\t lea edi,[edi+eax]\n"); - - // **** outer displacement **** - // if null displacement skip over - fprintf(fp, "%s_h:\n",Label); - fprintf(fp, "\t\t test edx,0x0002\n"); - fprintf(fp, "\t\t jz short %s_j\n",Label); - // word or long? - fprintf(fp, "\t\t test edx,0x0001\n"); - fprintf(fp, "\t\t jz short %s_i\n",Label); - // fetch long - Memory_Fetch('L',EAX,FALSE); - fprintf(fp, "\t\t add esi,byte 4\n"); - fprintf(fp, "\t\t jmp short %s_i2\n",Label); - // fetch word - fprintf(fp, "%s_i:\n",Label); - Memory_Fetch('W',EAX,TRUE); - fprintf(fp, "\t\t add esi,byte 2\n"); - fprintf(fp, "%s_i2:\n",Label); - fprintf(fp, "\t\t lea edi,[edi+eax]\n"); - - // **** exit **** - fprintf(fp, "%s_j:\n",Label); - fprintf(fp, "\t\t pop ecx\n"); - fprintf(fp, "\t\t pop ebx\n"); - } - - if (SaveEDX) - fprintf(fp, "\t\t pop edx\n"); -} - -/* Calculate Effective Address - Return address in EDI - * - * mode = Effective Address from Instruction - * Size = Byte,Word or Long - * Rreg = Register with Register Number in - * - * Only for modes 2 - 10 (5-10 clobber EAX) - */ - -void EffectiveAddressCalculate(int mode,char Size,int Rreg,int SaveEDX) -{ - /* timing */ - - if ((TimingCycles > 0) && (AddEACycles!=0)) - { - switch (mode) - { - case 2: /* (An) */ - case 3: /* (An)+ */ - case 11: /* #x,SR,CCR */ - case 19: /* (A7)+ */ - TimingCycles += 4 ; - break ; - - case 4: /* -(An) */ - case 20: /* -(A7) */ - TimingCycles += (CPU==2) ? 5 : 6 ; - break ; - - case 5: /* x(An) */ - case 9: /* x(PC) */ - TimingCycles += (CPU==2) ? 5 : 8 ; - break ; - - case 7: /* x.w */ - TimingCycles += (CPU==2) ? 4 : 8 ; - break ; - - case 6: /* x(An,xr.s) */ - case 10: /* x(PC,xr.s) */ - TimingCycles += (CPU==2) ? 7 : 10 ; - break ; - - case 8: /* x.l */ - TimingCycles += (CPU==2) ? 4 : 12 ; - break ; - } - - /* long w/r adds 4 cycles */ - - if ((mode>1) && (Size == 'L') && (CPU != 2)) - TimingCycles += 4 ; - } - - AccessType = NORMAL; - - switch (mode) - { - - case 2: - fprintf(fp, "\t\t mov EDI,[%s+%s*4]\n",REG_ADD,regnameslong[Rreg]); - break; - - case 3: - fprintf(fp, "\t\t mov EDI,[%s+%s*4]\n",REG_ADD,regnameslong[Rreg]); - IncrementEDI(Size,Rreg); - break; - - case 4: - fprintf(fp, "\t\t mov EDI,[%s+%s*4]\n",REG_ADD,regnameslong[Rreg]); - DecrementEDI(Size,Rreg); - fprintf(fp, "\t\t mov [%s+%s*4],EDI\n",REG_ADD,regnameslong[Rreg]); - break; - - case 5: - Memory_Fetch('W',EAX,TRUE); - fprintf(fp, "\t\t mov EDI,[%s+%s*4]\n",REG_ADD,regnameslong[Rreg]); - fprintf(fp, "\t\t add esi,byte 2\n"); - fprintf(fp, "\t\t add edi,eax\n"); - break; - - case 6: - - /* Get Address register Value */ - - fprintf(fp, "\t\t mov EDI,[%s+%s*4]\n",REG_ADD,regnameslong[Rreg]); - - /* Add Extension Details */ - - ExtensionDecode(SaveEDX); - break; - - case 7: - - /* Get Word */ - - Memory_Fetch('W',EDI,TRUE); -// fprintf(fp, "\t\t movsx edi,di\n"); - fprintf(fp, "\t\t add esi,byte 2\n"); - break; - - case 8: - - /* Get Long */ - - Memory_Fetch('L',EDI,FALSE); - fprintf(fp, "\t\t add esi,byte 4\n"); - break; - - case 9: - - AccessType = PCREL; - - Memory_Fetch('W',EAX,TRUE); -// fprintf(fp, "\t\t movsx eax,ax\n"); - fprintf(fp, "\t\t mov EDI,ESI ; Get PC\n"); - fprintf(fp, "\t\t add esi,byte 2\n"); - fprintf(fp, "\t\t add edi,eax ; Add Offset to PC\n"); - break; - - case 10: - - AccessType = PCREL; - - /* Get PC */ - - fprintf(fp, "\t\t mov edi,esi ; Get PC\n"); - - /* Add Extension Details */ - - ExtensionDecode(SaveEDX); - - break; - - case 19: - - /* (A7)+ */ - - fprintf(fp, "\t\t mov edi,[%s] ; Get A7\n",REG_A7); - fprintf(fp, "\t\t add dword [%s],byte 2\n",REG_A7); - break; - - case 20: - - /* -(A7) */ - - fprintf(fp, "\t\t mov edi,[%s] ; Get A7\n",REG_A7); - fprintf(fp, "\t\t sub edi,byte 2\n"); - fprintf(fp, "\t\t mov [%s],edi\n",REG_A7); - break; - - } -} - -/* Read from Effective Address - * - * mode = Effective Address from Instruction - * Size = Byte,Word or Long - * Rreg = Register with Register Number in - * Flag = Registers to preserve (EDX is handled by SaveEDX) - * - * Return - * Dreg = Register to return result in (EAX is usually most efficient) - * (modes 5 to 10) EDI = Address of data read (masked with FFFFFF) - */ - -void EffectiveAddressRead(int mode,char Size,int Rreg,int Dreg,const char *flags,int SaveEDX) -{ - char* Regname=""; - int MaskMode; - char Flags[8]; - - AccessType = NORMAL; - - strcpy(Flags,flags); - - /* Which Masking to Use */ - - if (Flags[5] != '-') - MaskMode = 2; - else - MaskMode = 1; - - if (SaveEDX) - Flags[3] = 'D'; - else - Flags[3] = '-'; - - switch (Size) - { - case 66: - Regname = regnamesshort[Dreg]; - break; - - case 87: - Regname = regnamesword[Dreg]; - break; - - case 76: - Regname = regnameslong[Dreg]; - break; - } - - switch (mode & 15) - { - - case 0: - - /* Read 32 bits - No prefix */ - - fprintf(fp, "\t\t mov %s,[%s+%s*4]\n",regnameslong[Dreg],REG_DAT,regnameslong[Rreg]); - break; - - case 1: - - /* Read 32 bits - No prefix */ - - fprintf(fp, "\t\t mov %s,[%s+%s*4]\n",regnameslong[Dreg],REG_ADD,regnameslong[Rreg]); - break; - - case 2: - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - - Memory_Read(Size,EDI,Flags,MaskMode); - - if (Dreg != EAX) - { - fprintf(fp, "\t\t mov %s,EAX\n",regnameslong[Dreg]); - } - break; - - case 3: - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - - Memory_Read(Size,EDI,Flags,MaskMode); - - if (Dreg != EAX) - { - fprintf(fp, "\t\t mov %s,EAX\n",regnameslong[Dreg]); - } - break; - - case 4: - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - - Memory_Read(Size,EDI,Flags,MaskMode); - - if (Dreg != EAX) - { - fprintf(fp, "\t\t mov %s,EAX\n",regnameslong[Dreg]); - } - break; - - - case 5: - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - - Memory_Read(Size,EDI,Flags,MaskMode); - - if (Dreg != EAX) - { - fprintf(fp, "\t\t mov %s,EAX\n",regnameslong[Dreg]); - } - break; - - case 6: - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - - Memory_Read(Size,EDI,Flags,MaskMode); - - if (Dreg != EAX) - { - fprintf(fp, "\t\t mov %s,EAX\n",regnameslong[Dreg]); - } - break; - - case 7: - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - - Memory_Read(Size,EDI,Flags,MaskMode); - - if (Dreg != EAX) - { - fprintf(fp, "\t\t mov %s,EAX\n",regnameslong[Dreg]); - } - break; - - case 8: - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - - Memory_Read(Size,EDI,Flags,MaskMode); - - if (Dreg != EAX) - { - fprintf(fp, "\t\t mov %s,EAX\n",regnameslong[Dreg]); - } - break; - - case 9: - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - - Memory_Read(Size,EDI,Flags,MaskMode); - - if (Dreg != EAX) - { - fprintf(fp, "\t\t mov %s,EAX\n",regnameslong[Dreg]); - } - break; - - case 10: - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - - Memory_Read(Size,EDI,Flags,MaskMode); - - if (Dreg != EAX) - { - fprintf(fp, "\t\t mov %s,EAX\n",regnameslong[Dreg]); - } - break; - - case 11: - - /* Immediate - for SR or CCR see ReadCCR() */ - - if (Size == 'L') - { - Memory_Fetch('L',Dreg,FALSE); - fprintf(fp, "\t\t add esi,byte 4\n"); - } - else - { - Memory_Fetch('W',Dreg,FALSE); - fprintf(fp, "\t\t add esi,byte 2\n"); - }; - break; - } -} - -/* - * EA = Effective Address from Instruction - * Size = Byte,Word or Long - * Rreg = Register with Register Number in - * - * Writes from EAX - */ - -void EffectiveAddressWrite(int mode,char Size,int Rreg,int CalcAddress,const char *flags,int SaveEDX) -{ - int MaskMode; - char* Regname=""; - char Flags[8]; - - - strcpy(Flags,flags); - - /* Which Masking to Use ? */ - - if (CalcAddress) - { - if (Flags[5] != '-') - MaskMode = 2; - else - MaskMode = 1; - } - else - MaskMode = 0; - - if (SaveEDX) - Flags[3] = 'D'; - else - Flags[3] = '-'; - - switch (Size) - { - case 66: - Regname = regnamesshort[0]; - break; - - case 87: - Regname = regnamesword[0]; - break; - - case 76: - Regname = regnameslong[0]; - break; - } - - switch (mode & 15) - { - - case 0: - fprintf(fp, "\t\t mov [%s+%s*4],%s\n",REG_DAT,regnameslong[Rreg],Regname); - break; - - case 1: - if (Size == 66) - { - /* Not Allowed */ - - fprintf(fp, "DUFF CODE!\n"); - } - else - { - if (Size == 87) - { - fprintf(fp, "\t\t cwde\n"); - } - - fprintf(fp, "\t\t mov [%s+%s*4],%s\n",REG_ADD,regnameslong[Rreg],regnameslong[0]); - } - break; - - case 2: - if (CalcAddress) EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - Memory_Write(Size,EDI,EAX,Flags,MaskMode); - break; - - case 3: - if (CalcAddress) EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - Memory_Write(Size,EDI,EAX,Flags,MaskMode); - break; - - case 4: - if (CalcAddress) EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - Memory_Write(Size,EDI,EAX,Flags,MaskMode); - break; - - case 5: - if (CalcAddress) - { - fprintf(fp, "\t\t push EAX\n"); - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - fprintf(fp, "\t\t pop EAX\n"); - } - Memory_Write(Size,EDI,EAX,Flags,MaskMode); - break; - - case 6: - if (CalcAddress) - { - fprintf(fp, "\t\t push EAX\n"); - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - fprintf(fp, "\t\t pop EAX\n"); - } - Memory_Write(Size,EDI,EAX,Flags,MaskMode); - break; - - case 7: - if (CalcAddress) - { - fprintf(fp, "\t\t push EAX\n"); - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - fprintf(fp, "\t\t pop EAX\n"); - } - Memory_Write(Size,EDI,EAX,Flags,MaskMode); - break; - - case 8: - if (CalcAddress) - { - fprintf(fp, "\t\t push EAX\n"); - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - fprintf(fp, "\t\t pop EAX\n"); - } - Memory_Write(Size,EDI,EAX,Flags,MaskMode); - break; - - case 9: - if (CalcAddress) - { - fprintf(fp, "\t\t push EAX\n"); - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - fprintf(fp, "\t\t pop EAX\n"); - } - Memory_Write(Size,EDI,EAX,Flags,MaskMode); - break; - - case 10: - if (CalcAddress) - { - fprintf(fp, "\t\t push EAX\n"); - EffectiveAddressCalculate(mode,Size,Rreg,SaveEDX); - fprintf(fp, "\t\t pop EAX\n"); - } - Memory_Write(Size,EDI,EAX,Flags,MaskMode); - break; - - case 11: - - /* SR, CCR - Chain to correct routine */ - - WriteCCR(Size); - } -} - -/* Condition Decode Routines */ - -/* - * mode = condition to check for - * - * Returns LABEL that is jumped to if condition is Condition - * - * Some conditions clobber AH - */ - -char *ConditionDecode(int mode, int Condition) -{ - char *Label = GenerateLabel(0,1); - - switch (mode) - { - - case 0: /* A - Always */ - if (Condition) - { - fprintf(fp, "\t\t jmp near %s\n",Label); - } - break; - - case 1: /* F - Never */ - if (!Condition) - { - fprintf(fp, "\t\t jmp near %s\n",Label); - } - break; - - case 2: /* Hi */ - fprintf(fp, "\t\t mov ah,dl\n"); - fprintf(fp, "\t\t sahf\n"); - - if (Condition) - { - fprintf(fp, "\t\t ja near %s\n",Label); - } - else - { - fprintf(fp, "\t\t jbe near %s\n",Label); - } - break; - - case 3: /* Ls */ - fprintf(fp, "\t\t mov ah,dl\n"); - fprintf(fp, "\t\t sahf\n"); - - if (Condition) - { - fprintf(fp, "\t\t jbe near %s\n",Label); - } - else - { - fprintf(fp, "\t\t ja near %s\n",Label); - } - break; - - case 4: /* CC */ - fprintf(fp, "\t\t test dl,1H\t\t;check carry\n"); - - if (Condition) - { - fprintf(fp, "\t\t jz near %s\n",Label); - } - else - { - fprintf(fp, "\t\t jnz near %s\n",Label); - } - break; - - case 5: /* CS */ - fprintf(fp, "\t\t test dl,1H\t\t;check carry\n"); - if (Condition) - { - fprintf(fp, "\t\t jnz near %s\n",Label); - } - else - { - fprintf(fp, "\t\t jz near %s\n",Label); - } - break; - - case 6: /* NE */ - fprintf(fp, "\t\t test dl,40H\t\t;Check zero\n"); - if (Condition) - { - fprintf(fp, "\t\t jz near %s\n",Label); - } - else - { - fprintf(fp, "\t\t jnz near %s\n",Label); - } - break; - - case 7: /* EQ */ - fprintf(fp, "\t\t test dl,40H\t\t;Check zero\n"); - if (Condition) - { - fprintf(fp, "\t\t jnz near %s\n",Label); - } - else - { - fprintf(fp, "\t\t jz near %s\n",Label); - } - break; - - case 8: /* VC */ - fprintf(fp, "\t\t test dh,8H\t\t;Check Overflow\n"); - if (Condition) - { - fprintf(fp, "\t\t jz near %s\n", Label); - } - else - { - fprintf(fp, "\t\t jnz near %s\n", Label); - } - break; - - case 9: /* VS */ - fprintf(fp, "\t\t test dh,8H\t\t;Check Overflow\n"); - if (Condition) - { - fprintf(fp, "\t\t jnz near %s\n", Label); - } - else - { - fprintf(fp, "\t\t jz near %s\n", Label); - } - break; - - case 10: /* PL */ - fprintf(fp,"\t\t test dl,80H\t\t;Check Sign\n"); - if (Condition) - { - fprintf(fp, "\t\t jz near %s\n", Label); - } - else - { - fprintf(fp, "\t\t jnz near %s\n", Label); - } - break; - - case 11: /* MI */ - fprintf(fp,"\t\t test dl,80H\t\t;Check Sign\n"); - if (Condition) - { - fprintf(fp, "\t\t jnz near %s\n", Label); - } - else - { - fprintf(fp, "\t\t jz near %s\n", Label); - } - break; - - case 12: /* GE */ - fprintf(fp, "\t\t or edx,200h\n"); - fprintf(fp, "\t\t push edx\n"); - fprintf(fp, "\t\t popf\n"); - if (Condition) - { - fprintf(fp, "\t\t jge near %s\n",Label); - } - else - { - fprintf(fp, "\t\t jl near %s\n",Label); - } - break; - - case 13: /* LT */ - fprintf(fp, "\t\t or edx,200h\n"); - fprintf(fp, "\t\t push edx\n"); - fprintf(fp, "\t\t popf\n"); - if (Condition) - { - fprintf(fp, "\t\t jl near %s\n",Label); - } - else - { - fprintf(fp, "\t\t jge near %s\n",Label); - } - break; - - case 14: /* GT */ - fprintf(fp, "\t\t or edx,200h\n"); - fprintf(fp, "\t\t push edx\n"); - fprintf(fp, "\t\t popf\n"); - if (Condition) - { - fprintf(fp, "\t\t jg near %s\n",Label); - } - else - { - fprintf(fp, "\t\t jle near %s\n",Label); - } - break; - - case 15: /* LE */ - fprintf(fp, "\t\t or edx,200h\n"); - fprintf(fp, "\t\t push edx\n"); - fprintf(fp, "\t\t popf\n"); - if (Condition) - { - fprintf(fp, "\t\t jle near %s\n",Label); - } - else - { - fprintf(fp, "\t\t jg near %s\n",Label); - } - break; - } - - return Label; -} - -/* - * mode = condition to check for - * SetWhat = text for assembler command (usually AL or address descriptor) - * - * Some conditions clobber AH - */ - -void ConditionCheck(int mode, char *SetWhat) -{ - switch (mode) - { - - case 0: /* A - Always */ - fprintf(fp, "\t\t mov %s,byte 0ffh\n",SetWhat); - break; - - case 1: /* F - Never */ - if (SetWhat[1] == 'L') - { - ClearRegister(EAX); - } - else - { - fprintf(fp, "\t\t mov %s,byte 0h\n",SetWhat); - } - break; - - case 2: /* Hi */ - fprintf(fp, "\t\t mov ah,dl\n"); - fprintf(fp, "\t\t sahf\n"); - fprintf(fp, "\t\t seta %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 3: /* Ls */ - fprintf(fp, "\t\t mov ah,dl\n"); - fprintf(fp, "\t\t sahf\n"); - fprintf(fp, "\t\t setbe %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 4: /* CC */ - fprintf(fp, "\t\t test dl,1\t\t;Check Carry\n"); - fprintf(fp, "\t\t setz %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 5: /* CS */ - fprintf(fp, "\t\t test dl,1\t\t;Check Carry\n"); - fprintf(fp, "\t\t setnz %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 6: /* NE */ - fprintf(fp, "\t\t test dl,40H\t\t;Check Zero\n"); - fprintf(fp, "\t\t setz %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 7: /* EQ */ - fprintf(fp, "\t\t test dl,40H\t\t;Check Zero\n"); - fprintf(fp, "\t\t setnz %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 8: /* VC */ - fprintf(fp, "\t\t test dh,8H\t\t;Check Overflow\n"); - fprintf(fp, "\t\t setz %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 9: /* VS */ - fprintf(fp, "\t\t test dh,8H\t\t;Check Overflow\n"); - fprintf(fp, "\t\t setnz %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 10: /* PL */ - fprintf(fp, "\t\t test dl,80H\t\t;Check Sign\n"); - fprintf(fp, "\t\t setz %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 11: /* MI */ - fprintf(fp, "\t\t test dl,80H\t\t;Check Sign\n"); - fprintf(fp, "\t\t setnz %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 12: /* GE */ - fprintf(fp, "\t\t or edx,200h\n"); - fprintf(fp, "\t\t push edx\n"); - fprintf(fp, "\t\t popf\n"); - fprintf(fp, "\t\t setge %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 13: /* LT */ - fprintf(fp, "\t\t or edx,200h\n"); - fprintf(fp, "\t\t push edx\n"); - fprintf(fp, "\t\t popf\n"); - fprintf(fp, "\t\t setl %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 14: /* GT */ - fprintf(fp, "\t\t or edx,200h\n"); - fprintf(fp, "\t\t push edx\n"); - fprintf(fp, "\t\t popf\n"); - fprintf(fp, "\t\t setg %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - - case 15: /* LE */ - fprintf(fp, "\t\t or edx,200h\n"); - fprintf(fp, "\t\t push edx\n"); - fprintf(fp, "\t\t popf\n"); - fprintf(fp, "\t\t setle %s\n",SetWhat); - fprintf(fp, "\t\t neg byte %s\n",SetWhat); - break; - } -} - - -/**********************************************************************/ -/* Instructions - Each routine generates a range of instruction codes */ -/**********************************************************************/ - -/* - * Immediate Commands - * - * ORI 00xx - * ANDI 02xx - * SUBI 04xx - * ADDI 06xx - * EORI 0axx - * CMPI 0cxx - * - */ - -void dump_imm( int type, int leng, int mode, int sreg ) -{ - int Opcode,BaseCode ; - char Size=' ' ; - char * RegnameEBX="" ; - char * Regname="" ; - char * OpcodeName[16] = {"or ", "and", "sub", "add",0,"xor","cmp",0} ; - int allow[] = {1,0,1,1, 1,1,1,1, 1,0,0,0, 0,0,0,0, 0,0,0,1, 1} ; - - Opcode = (type << 9) | ( leng << 6 ) | ( mode << 3 ) | sreg; - - BaseCode = Opcode & 0xfff8; - - if (mode == 7) BaseCode |= sreg ; - -#ifdef A7ROUTINE - if ((leng == 0) && (sreg == 7) && (mode > 2) && (mode < 5)) - { - BaseCode |= sreg ; - } -#endif - - if (type != 4) /* Not Valid (for this routine) */ - { - int Dest = EAtoAMN(Opcode, FALSE); - int SetX; - - /* ADDI & SUBI also set X flag */ - - SetX = ((type == 2) || (type == 3)); - - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameEBX = regnamesshort[EBX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[0]; - RegnameEBX = regnamesword[EBX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[0]; - RegnameEBX = regnameslong[EBX]; - break; - } - - if (allow[Dest]) - { - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - /* Save Previous PC if Memory Access */ - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (mode < 2) - { - if (Size != 'L') - TimingCycles += (CPU==2) ? 4 : 8; - else - { - TimingCycles += (CPU==2) ? 8 : 14; - if ((type != 1) && (type!=6)) - TimingCycles += 2 ; - } - } - else - { - if (type != 6) - { - if (Size != 'L') - TimingCycles += (CPU==2) ? 4 : 12 ; - else - TimingCycles += (CPU==2) ? 4 : 20 ; - } - else - { - if (Size != 'L') - TimingCycles += (CPU==2) ? 4 : 8 ; - else - TimingCycles += (CPU==2) ? 4 : 12 ; - } - } - - fprintf(fp, "\t\t and ecx,byte 7\n"); - - /* Immediate Mode Data */ - EffectiveAddressRead(11,Size,EBX,EBX,"--C-S-B",FALSE); - - /* Source Data */ - EffectiveAddressRead(Dest,Size,ECX,EAX,"-BC-SDB",FALSE); - - /* The actual work */ - fprintf(fp, "\t\t %s %s,%s\n", OpcodeName[type], Regname, RegnameEBX ); - - SetFlags(Size,EAX,FALSE,SetX,TRUE); - - if (type != 6) /* CMP no update */ - EffectiveAddressWrite(Dest,Size,ECX,EAX,"---DS-B",FALSE); - - Completed(); - } - } - else - { - /* Logicals are allowed to alter SR/CCR */ - - if ((!SetX) && (Dest == 11) && (Size != 'L') && (type != 6)) - { - Align(); - - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - TimingCycles += 20 ; - - if (Size=='W') - { - /* If SR then must be in Supervisor Mode */ - - char *Label = GenerateLabel(0,1); - - fprintf(fp, "\t\t test byte [%s],20h \t\t\t; Supervisor Mode ?\n",REG_SRH); - fprintf(fp, "\t\t jne near %s\n\n",Label); - - /* User Mode - Exception */ - - Exception(8,BaseCode); - - fprintf(fp, "%s:\n",Label); - } - - /* Immediate Mode Data */ - EffectiveAddressRead(11,Size,EBX,EBX,"---DS-B",TRUE); - - ReadCCR(Size,ECX); - - fprintf(fp, "\t\t %s %s,%s\n", OpcodeName[type], Regname, RegnameEBX ); - - WriteCCR(Size); - - Completed(); - } - else - { - - /* Illegal Opcode */ - - OpcodeArray[BaseCode] = -1; - BaseCode = -1; - } - } - } - else - { - BaseCode = -2; - } - - OpcodeArray[Opcode] = BaseCode; -} - -void immediate(void) -{ - int type, size, mode, sreg ; - - for (type = 0 ; type < 0x7; type++) - for (size = 0 ; size < 3 ; size++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dump_imm( type, size, mode, sreg ) ; -} - - -/* - * Bitwise Codes - * - */ - -void dump_bit_dynamic( int sreg, int type, int mode, int dreg ) -{ - int Opcode, BaseCode ; - char Size ; - char *EAXReg,*ECXReg, *Label ; - char allow[] = "0-2345678-------" ; - int Dest ; - - /* BTST allows x(PC) and x(PC,xr.s) - others do not */ - - if (type == 0) - { - allow[9] = '9'; - allow[10] = 'a'; - allow[11] = 'b'; // dave fix to nhl - } - - Opcode = 0x0100 | (sreg << 9) | (type<<6) | (mode<<3) | dreg ; - - BaseCode = Opcode & 0x01f8 ; - if (mode == 7) BaseCode |= dreg ; - - - // A7+, A7- - -#ifdef A7ROUTINE - if ((mode > 2) && (mode < 5)) - { - if (dreg == 7) BaseCode |= dreg; - } -#endif - - Dest = EAtoAMN(Opcode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (mode == 0) /* long*/ - { - /* Modify register memory directly */ - - Size = 'L' ; - EAXReg = REG_DAT_EBX; - ECXReg = regnameslong[ECX]; - } - else - { - Size = 'B' ; - EAXReg = regnamesshort[EAX]; - ECXReg = regnamesshort[ECX]; - } - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - /* Save Previous PC if Memory Access */ - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (mode<2) - { - switch (type) - { - case 0: - TimingCycles += 6 ; - break; - case 1: - case 3: - TimingCycles += 8 ; - break; - case 2: - TimingCycles += 10; - break; - } - } - else - { - if (type==0) - TimingCycles += 4; - else - TimingCycles += 8; - } - - /* Only need this sorted out if a register is involved */ - - if (Dest < 7) - { - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - } - - /* Get bit number and create mask in ECX */ - - fprintf(fp, "\t\t shr ecx, byte 9\n"); - fprintf(fp, "\t\t and ecx, byte 7\n"); - fprintf(fp, "\t\t mov ecx, [%s+ECX*4]\n",REG_DAT); - - if (Size == 'L') - fprintf(fp, "\t\t and ecx, byte 31\n"); - else - fprintf(fp, "\t\t and ecx, byte 7\n"); - - #ifdef QUICKZERO - fprintf(fp,"\t\t mov eax,1\n"); - #else - fprintf(fp,"\t\t xor eax,eax\n"); - fprintf(fp,"\t\t inc eax\n"); - #endif - - fprintf(fp,"\t\t shl eax,cl\n"); - fprintf(fp,"\t\t mov ecx,eax\n"); - - if (mode != 0) - EffectiveAddressRead(Dest,Size,EBX,EAX,"-BCDSDB",TRUE); - - - /* All commands copy existing bit to Zero Flag */ - - Label = GenerateLabel(0,1); - - fprintf(fp,"\t\t or edx,byte 40h\t; Set Zero Flag\n"); - fprintf(fp,"\t\t test %s,%s\n",EAXReg,ECXReg); - fprintf(fp,"\t\t jz short %s\n",Label); - fprintf(fp,"\t\t xor edx,byte 40h\t; Clear Zero Flag\n"); - fprintf(fp,"%s:\n",Label); - - /* Some then modify the data */ - - switch (type) - { - case 0: /* btst*/ - break; - - case 1: /* bchg*/ - fprintf(fp,"\t\t xor %s,%s\n",EAXReg,ECXReg); - break; - - case 2: /* bclr*/ - fprintf(fp,"\t\t not ecx\n"); - fprintf(fp,"\t\t and %s,%s\n",EAXReg,ECXReg); - break; - - case 3: /* bset*/ - fprintf(fp,"\t\t or %s,%s\n",EAXReg,ECXReg); - break; - } - - if ((mode !=0) && (type != 0)) - EffectiveAddressWrite(Dest,Size,EBX,FALSE,"---DS-B",TRUE); - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void bitdynamic(void) /* dynamic non-immediate bit operations*/ -{ - int type, sreg, mode, dreg ; - - for (sreg = 0 ; sreg < 8 ; sreg++) - for (type = 0 ; type < 4 ; type++) - for (mode = 0 ; mode < 8 ;mode++) - for (dreg = 0 ; dreg < 8 ;dreg++) - dump_bit_dynamic( sreg, type, mode, dreg ) ; -} - -void dump_bit_static(int type, int mode, int dreg ) -{ - int Opcode, BaseCode ; - char Size ; - char *EAXReg,*ECXReg, *Label ; - char allow[] = "0-2345678-------" ; - int Dest ; - - /* BTST allows x(PC) and x(PC,xr.s) - others do not */ - - if (type == 0) - { - allow[9] = '9'; - allow[10] = 'a'; - } - - Opcode = 0x0800 | (type<<6) | (mode<<3) | dreg ; - BaseCode = Opcode & 0x08f8 ; - if (mode == 7) BaseCode |= dreg ; - - // A7+, A7- - -#ifdef A7ROUTINE - if ((mode > 2) && (mode < 5)) - { - if (dreg == 7) BaseCode |= dreg; - } -#endif - - Dest = EAtoAMN(Opcode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (mode == 0) /* long*/ - { - /* Modify register memory directly */ - - Size = 'L' ; - EAXReg = REG_DAT_EBX; - ECXReg = regnameslong[ECX]; - } - else - { - Size = 'B' ; - EAXReg = regnamesshort[EAX]; - ECXReg = regnamesshort[ECX]; - } - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - /* Save Previous PC if Memory Access */ - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (mode<2) - { - switch (type) - { - case 0: - TimingCycles += 10 ; - break ; - case 1: - case 3: - TimingCycles += 12 ; - break ; - case 2: - TimingCycles += 14 ; - break ; - } - } - else - { - if (type != 0) - TimingCycles += 12 ; - else - TimingCycles += 8 ; - } - - /* Only need this sorted out if a register is involved */ - - if (Dest < 7) - { - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx, byte 7\n"); - } - - /* Get bit number and create mask in ECX */ - - Memory_Fetch('W',ECX,FALSE); - fprintf(fp, "\t\t add esi,byte 2\n"); - - if (Size == 'L') - fprintf(fp, "\t\t and ecx, byte 31\n"); - else - fprintf(fp, "\t\t and ecx, byte 7\n"); - - #ifdef QUICKZERO - fprintf(fp,"\t\t mov eax,1\n"); - #else - fprintf(fp,"\t\t xor eax,eax\n"); - fprintf(fp,"\t\t inc eax\n"); - #endif - - fprintf(fp,"\t\t shl eax,cl\n"); - fprintf(fp,"\t\t mov ecx,eax\n"); - - if (mode != 0) - EffectiveAddressRead(Dest,Size,EBX,EAX,"-BCDSDB",TRUE); - - /* All commands copy existing bit to Zero Flag */ - - Label = GenerateLabel(0,1); - - fprintf(fp,"\t\t or edx,byte 40h\t; Set Zero Flag\n"); - fprintf(fp,"\t\t test %s,%s\n",EAXReg,ECXReg); - fprintf(fp,"\t\t jz short %s\n",Label); - fprintf(fp,"\t\t xor edx,byte 40h\t; Clear Zero Flag\n"); - fprintf(fp,"%s:\n",Label); - - /* Some then modify the data */ - - switch (type) - { - case 0: /* btst*/ - break; - - case 1: /* bchg*/ - fprintf(fp,"\t\t xor %s,%s\n",EAXReg,ECXReg); - break; - - case 2: /* bclr*/ - fprintf(fp,"\t\t not ecx\n"); - fprintf(fp,"\t\t and %s,%s\n",EAXReg,ECXReg); - break; - - case 3: /* bset*/ - fprintf(fp,"\t\t or %s,%s\n",EAXReg,ECXReg); - break; - } - - if ((mode !=0) && (type != 0)) - EffectiveAddressWrite(Dest,Size,EBX,FALSE,"---DS-B",TRUE); - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - - -void bitstatic(void) /* static non-immediate bit operations*/ -{ - int type, mode, dreg ; - - for (type = 0 ; type < 4 ; type++) - for (mode = 0 ; mode < 8 ;mode++) - for (dreg = 0 ; dreg < 8 ;dreg++) - dump_bit_static( type, mode, dreg ) ; -} - -/* - * Move Peripheral - * - */ - -void movep(void) -{ - int sreg,dir,leng,dreg ; - int Opcode, BaseCode ; - - for (sreg = 0 ; sreg < 8 ; sreg++) - { - for (dir = 0 ; dir < 2 ; dir++) - { - for (leng = 0 ; leng < 2 ; leng++) - { - for (dreg = 0 ; dreg < 8 ; dreg++) - { - Opcode = 0x0108 | (sreg<<9) | (dir<<7) | (leng<<6) | dreg; - BaseCode = Opcode & 0x01c8 ; - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (leng == 0) /* word */ - TimingCycles += 16 ; - else - TimingCycles += 24 ; - - /* Save Flags Register (so we only do it once) */ - - fprintf(fp, "\t\t push edx\n"); - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - - /* Get Address to Read/Write in EDI */ - - EffectiveAddressCalculate(5,'L',EBX,FALSE); - - fprintf(fp, "\t\t shr ecx,byte 9\n"); - fprintf(fp, "\t\t and ecx,byte 7\n"); - - - if (dir == 0) /* from memory to register*/ - { - Memory_Read('B',EDI,"-BC-SDB",2); /* mask first call */ - fprintf(fp,"\t\t mov bh,al\n"); - fprintf(fp,"\t\t add edi,byte 2\n"); - Memory_Read('B',EDI,"-BC-SDB",0); /* not needed then */ - fprintf(fp,"\t\t mov bl,al\n"); - - if (leng == 0) /* word d(Ax) into Dx.W*/ - { - fprintf(fp,"\t\t mov [%s+ecx*4],bx\n",REG_DAT); - } - else /* long d(Ax) into Dx.L*/ - { - fprintf(fp,"\t\t add edi,byte 2\n"); - fprintf(fp,"\t\t shl ebx,16\n"); - Memory_Read('B',EDI,"-BC-SDB",0); - fprintf(fp,"\t\t mov bh,al\n"); - fprintf(fp,"\t\t add edi,byte 2\n"); - Memory_Read('B',EDI,"-BC-S-B",0); - fprintf(fp,"\t\t mov bl,al\n"); - fprintf(fp,"\t\t mov [%s+ecx*4],ebx\n",REG_DAT); - } - } - else /* Register to Memory*/ - { - fprintf(fp,"\t\t mov eax,[%s+ecx*4]\n",REG_DAT); - - /* Move bytes into Line */ - - if (leng == 1) - fprintf(fp,"\t\t rol eax,byte 8\n"); - else - fprintf(fp,"\t\t rol eax,byte 24\n"); - - Memory_Write('B',EDI,EAX,"A---SDB",2); /* Mask First */ - fprintf(fp,"\t\t add edi,byte 2\n"); - fprintf(fp,"\t\t rol eax,byte 8\n"); - - if (leng == 1) /* long*/ - { - Memory_Write('B',EDI,EAX,"A---SDB",0); - fprintf(fp,"\t\t add edi,byte 2\n"); - fprintf(fp,"\t\t rol eax,byte 8\n"); - Memory_Write('B',EDI,EAX,"A---SDB",0); - fprintf(fp,"\t\t add edi,byte 2\n"); - fprintf(fp,"\t\t rol eax,byte 8\n"); - } - Memory_Write('B',EDI,EAX,"A---S-B",0); - } - - fprintf(fp, "\t\t pop edx\n"); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } - } - } -} - -void movecodes(int allowfrom[],int allowto[],int Start,char Size) /* MJC */ -{ - int Opcode; - int Src,Dest; - int SaveEDX; - int BaseCode; - - for (Opcode=Start;Opcode> 6, TRUE); - - if ((allowfrom[(Src & 15)]) && (allowto[(Dest & 15)])) - { - /* If we are not going to calculate the flags */ - /* we need to preserve the existing ones */ - - SaveEDX = (Dest == 1); - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if (((Src >= 2) && (Src <= 10)) || ((Dest >= 2) && (Dest <=10))) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - - TimingCycles += 4 ; - - if (Src < 7) - { - if (Dest < 7) - { - fprintf(fp, "\t\t mov ebx,ecx\n"); - - if ((Src == 0) && allowfrom[1]) - fprintf(fp, "\t\t and ebx,byte 15\n"); - else - fprintf(fp, "\t\t and ebx,byte 7\n"); - - EffectiveAddressRead(Src,Size,EBX,EAX,"--CDS-B",SaveEDX); - } - else - { - if ((Src == 0) && allowfrom[1]) - fprintf(fp, "\t\t and ecx,byte 15\n"); - else - fprintf(fp, "\t\t and ecx,byte 7\n"); - - EffectiveAddressRead(Src,Size,ECX,EAX,"---DS-B",SaveEDX); - } - } - else - { - if (Dest < 7) - EffectiveAddressRead(Src,Size,EBX,EAX,"--CDS-B",SaveEDX); - else - EffectiveAddressRead(Src,Size,EBX,EAX,"---DS-B",SaveEDX); - } - - /* No flags if Destination Ax */ - - if (!SaveEDX) - { - SetFlags(Size,EAX,TRUE,FALSE,TRUE); - } - - if (Dest < 7) - { - fprintf(fp, "\t\t shr ecx,9\n"); - fprintf(fp, "\t\t and ecx,byte 7\n"); - } - - EffectiveAddressWrite(Dest,Size,ECX,TRUE,"---DS-B",SaveEDX); - - Completed(); - } - else - { - BaseCode = -1; /* Invalid Code */ - } - } - else - { - BaseCode = OpcodeArray[BaseCode]; - } - - if (OpcodeArray[Opcode] < 0) - OpcodeArray[Opcode] = BaseCode; - } -} - -void moveinstructions(void) -{ - int allowfrom[] = {1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0}; - int allowto[] = {1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0}; - - /* For Byte */ - - movecodes(allowfrom,allowto,0x1000,'B'); - - /* For Word & Long */ - - allowto[1] = 1; - movecodes(allowfrom,allowto,0x2000,'L'); - movecodes(allowfrom,allowto,0x3000,'W'); -} - -/* - * - * Opcodes 5### - * - * ADDQ,SUBQ,Scc and DBcc - * - */ - -void opcode5(void) -{ - /* ADDQ,SUBQ,Scc and DBcc */ - - int allowtoScc[] = {1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0}; - int allowtoADDQ[] = {1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0}; - int Opcode,BaseCode; - char Label[32]; - char Label2[32]; - char Size=' '; - char* Regname=""; - char* RegnameECX=""; - - for (Opcode = 0x5000;Opcode < 0x6000;Opcode++) - { - if ((Opcode & 0xc0) == 0xc0) - { - /* Scc or DBcc */ - - BaseCode = Opcode & 0x5FF8; - if ((BaseCode & 0x38) == 0x38) BaseCode |= (Opcode & 7); - - /* If mode = 3 or 4 and register = A7 */ - /* then make it a separate code */ - -#ifdef A7ROUTINE - if (((Opcode & 0x3F) == 0x1F) || ((Opcode & 0x3F) == 0x27)) - { - BaseCode |= 0x07; - } -#endif - - if (OpcodeArray[BaseCode] == -2) - { - OpcodeArray[BaseCode] = BaseCode; - - if ((BaseCode & 0x38) == 0x8) - { - /* DBcc */ - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - TimingCycles += 10 ; - - - strcpy(Label,GenerateLabel(BaseCode,1)) ; - strcpy(Label2,ConditionDecode((Opcode >> 8) & 0x0F,TRUE)); - - /* False - Decrement Counter - Loop if not -1 */ - - fprintf(fp, "\t\t and ecx,byte 7\n"); - fprintf(fp, "\t\t mov ax,[%s+ecx*4]\n",REG_DAT); - fprintf(fp, "\t\t dec ax\n"); - fprintf(fp, "\t\t mov [%s+ecx*4],ax\n",REG_DAT); - fprintf(fp, "\t\t inc ax\t\t; Is it -1\n"); - fprintf(fp, "\t\t jz short %s\n",Label); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - Memory_Fetch('W',EAX,TRUE); - fprintf(fp, "\t\t add esi,eax\n"); - Completed(); - - /* True - Exit Loop */ - fprintf(fp, "%s:\n",Label); - - fprintf(fp, "%s:\n",Label2); - fprintf(fp, "\t\t add esi,byte 4\n"); - TimingCycles += 2 ; - - Completed(); - } - else - { - /* Scc */ - - int Dest = EAtoAMN(Opcode, FALSE); - - if (allowtoScc[(Dest & 15)]) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (Dest > 1) - TimingCycles += 8 ; - else - TimingCycles += 4 ; - - if (Dest < 7) - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - } - - if (Dest > 1) - { - EffectiveAddressCalculate(Dest,'B',ECX,TRUE); - /* ASG - no longer need to mask addresses here */ -/* fprintf(fp,"\t\t and edi,0FFFFFFh\n");*/ - } - - ConditionCheck((Opcode >> 8) & 0x0F,"AL"); - - EffectiveAddressWrite(Dest,'B',ECX,FALSE,"---DS-B",TRUE); - - /* take advantage of AL being 0 for false, 0xff for true */ - /* need to add 2 cycles if register and condition is true */ - - if (Dest == 0) - { - fprintf(fp, "\t\t and eax,byte 2\n"); - fprintf(fp, "\t\t add eax,byte %d\n",TimingCycles); - fprintf(fp, "\t\t sub dword [%s],eax\n",ICOUNT); - - TimingCycles = -1; - } - Completed(); - } - else - { - OpcodeArray[BaseCode] = -1; - BaseCode = -1; - } - } - } - else - { - BaseCode = OpcodeArray[BaseCode]; - } - - OpcodeArray[Opcode] = BaseCode; - } - else - { - /* ADDQ or SUBQ */ - - BaseCode = Opcode & 0x51F8; - if ((BaseCode & 0x38) == 0x38) BaseCode |= (Opcode & 7); - - /* Special for Address Register Direct - Force LONG */ - - if ((Opcode & 0x38) == 0x8) BaseCode = ((BaseCode & 0xFF3F) | 0x80); - - - /* If mode = 3 or 4 and Size = byte and register = A7 */ - /* then make it a separate code */ - -#ifdef A7ROUTINE - if ((Opcode & 0xC0) == 0) - { - if (((Opcode & 0x3F) == 0x1F) || ((Opcode & 0x3F) == 0x27)) - { - BaseCode |= 0x07; - } - } -#endif - - if (OpcodeArray[BaseCode] == -2) - { - char *Operation; - int Dest = EAtoAMN(Opcode, FALSE); - int SaveEDX = (Dest == 1); - - if (allowtoADDQ[(Dest & 15)]) - { - switch (BaseCode & 0xC0) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameECX = regnamesshort[ECX]; - break; - - case 0x40: - Size = 'W'; - Regname = regnamesword[0]; - RegnameECX = regnamesword[ECX]; - break; - - case 0x80: - Size = 'L'; - Regname = regnameslong[0]; - RegnameECX = regnameslong[ECX]; - break; - } - - OpcodeArray[BaseCode] = BaseCode; - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (Dest == 0) /* write to Dx */ - { - if (Size != 'L') - TimingCycles += 4 ; - else - TimingCycles += 8 ; - } - - if (Dest == 1) - { - if ((Size == 'L') || (Opcode & 0x100)) /* if long or SUBQ */ - TimingCycles += 8 ; - else - TimingCycles += 4 ; - } - - if (Dest > 1) /* write to mem */ - { - if (Size != 'L') - TimingCycles += 8 ; - else - TimingCycles += 12 ; - } - - if (Dest < 7) - { - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - } - - if (Dest > 1) - { - EffectiveAddressRead(Dest,Size,EBX,EAX,"-BCDSDB",SaveEDX); - } - - /* Sub Immediate from Opcode */ - - fprintf(fp, "\t\t shr ecx,9\n"); - - Immediate8(); - - if (Opcode & 0x100) - { - /* SUBQ */ - Operation = "sub"; - } - else - { - /* ADDQ */ - Operation = "add"; - } - - /* For Data or Address register, operate directly */ - /* on the memory location. Don't load into EAX */ - - if (Dest < 2) - { - if (Dest == 0) - { - fprintf(fp, "\t\t %s [%s+ebx*4],%s\n",Operation,REG_DAT,RegnameECX); - } - else - { - fprintf(fp, "\t\t %s [%s+ebx*4],%s\n",Operation,REG_ADD,RegnameECX); - } - } - else - { - fprintf(fp, "\t\t %s %s,%s\n",Operation,Regname,RegnameECX); - } - - /* No Flags for Address Direct */ - - if (!SaveEDX) - { - /* Directly after ADD or SUB, so test not needed */ - - SetFlags(Size,EAX,FALSE,TRUE,TRUE); - } - - if (Dest > 1) - { - EffectiveAddressWrite(Dest,Size,EBX,FALSE,"---DS-B",FALSE); - } - - Completed(); - } - else - { - OpcodeArray[BaseCode] = -1; - BaseCode = -1; - } - } - else - { - BaseCode = OpcodeArray[BaseCode]; - } - - OpcodeArray[Opcode] = BaseCode; - } - } -} - -/* - * Branch Instructions - * - * BSR, Bcc - * - */ - -void branchinstructions(void) -{ - int Opcode,BaseCode; - int Counter; - char *Label; - char jmpLabel[40] ; - - for (Opcode = 0x60;Opcode < 0x70;Opcode++) - { - /* Displacement = 0 -> 16 Bit displacement */ - - BaseCode = Opcode * 0x100; - OpcodeArray[BaseCode] = BaseCode; - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 10 ; - - if (Opcode == 0x60) - { - Memory_Fetch('W',EAX,TRUE); - fprintf(fp, "\t\t add esi,eax\n"); - MemoryBanking(BaseCode); - Completed(); - } - else - { - if (Opcode != 0x61) - { - Label = ConditionDecode(Opcode & 0x0F,TRUE); - - /* Code for Failed branch */ - - fprintf(fp, "\t\t add esi,byte 2\n"); - - /* 2 less cycles for Failure */ - - TimingCycles -= 2; - Completed(); - TimingCycles += 2; - - /* Successful Branch */ - - Align(); - fprintf(fp, "%s:\n",Label); - - Memory_Fetch('W',EAX,TRUE); - fprintf(fp, "\t\t add esi,eax\n"); - MemoryBanking(BaseCode+2); - Completed(); - - } - else - { - /* BSR - Special Case */ - - TimingCycles += 8 ; - - Memory_Fetch('W',EBX,TRUE); - fprintf(fp, "\t\t add ebx,esi\n"); - - fprintf(fp, "\t\t add esi,byte 2\n"); - PushPC(ECX,EAX,"-B-DS-B",1); - - fprintf(fp, "\t\t mov esi,ebx\n"); - MemoryBanking(BaseCode+3); - Completed(); - } - } - - /* 8 Bit Displacement */ - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode+1,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 10 ; - - if (Opcode > 0x60) - { - if (Opcode != 0x61) - { - Label = ConditionDecode(Opcode & 0x0F,TRUE); - - /* Code for Failed branch */ - - TimingCycles -= 2; - Completed(); - TimingCycles += 2; - - /* Successful Branch */ - - Align(); - fprintf(fp, "%s:\n",Label); - } - else - { - /* BSR - Special Case */ - - TimingCycles += 8 ; - - PushPC(EDI,EBX,"--CDS-B",1); - } - } - - /* Common Ending */ - - fprintf(fp, "\t\t movsx eax,cl ; Sign Extend displacement\n"); - fprintf(fp, "\t\t add esi,eax\n"); - MemoryBanking(BaseCode+5); - Completed(); - - /* Fill up Opcode Array */ - - for (Counter=1;Counter<0x100;Counter++) - OpcodeArray[BaseCode+Counter] = BaseCode+1; - - if(CPU==2) - { - - /* 8 bit 0xff & 68020 instruction - 32 bit displacement */ - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode+0xff,0)); - sprintf( jmpLabel, GenerateLabel(BaseCode+0xff,1) ) ; - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 10 ; - - if (Opcode == 0x60) - { - /* bra - always branch */ - Memory_Fetch('L',EAX,FALSE); - fprintf(fp, "\t\t add esi,eax\n"); - MemoryBanking(BaseCode+6); - Completed(); - } - else - { - if (Opcode != 0x61) - { - Label = ConditionDecode(Opcode & 0x0F,TRUE); - - /* Code for Failed branch */ - fprintf(fp, "\t\t add esi,byte 4\n"); - - TimingCycles -= 2; - Completed(); - TimingCycles += 2; - - /* Successful Branch */ - Align(); - fprintf(fp, "%s:\n",Label); - - Memory_Fetch('L',EAX,FALSE); - fprintf(fp, "\t\t add esi,eax\n"); - MemoryBanking(BaseCode+8); - Completed(); - } - else - { - /* BSR - Special Case */ - - TimingCycles += 8 ; - - Memory_Fetch('L',EBX,TRUE); - fprintf(fp, "\t\t add ebx,esi\n"); - - fprintf(fp, "\t\t add esi,byte 4\n"); - PushPC(ECX,EAX,"-B-DS-B",1); - - fprintf(fp, "\t\t mov esi,ebx\n"); - MemoryBanking(BaseCode+9); - Completed(); - } - } - - OpcodeArray[BaseCode+0xff] = BaseCode+0xff; - } - } -} - -/* - * Move Quick Commands - * - * Fairly simple, as only allowed to Data Registers - * - */ - -void moveq(void) -{ - int Count; - - /* The Code */ - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(0x7000,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 4 ; - - fprintf(fp, "\t\t movsx eax,cl\n"); - fprintf(fp, "\t\t shr ecx,9\n"); - fprintf(fp, "\t\t and ecx,byte 7\n"); - SetFlags('L',EAX,TRUE,FALSE,FALSE); - EffectiveAddressWrite(0,'L',ECX,TRUE,"---DS-B",FALSE); - Completed(); - - /* Set OpcodeArray (Not strictly correct, since some are illegal!) */ - - for (Count=0x7000;Count<0x8000;Count++) - { - OpcodeArray[Count] = 0x7000; - } -} - -/* - * Extended version of Add & Sub commands - * - */ - -void addx_subx(void) -{ - int Opcode, BaseCode ; - int regx,type,leng,rm,regy,mode ; - int ModeModX; - int ModeModY; - char Size=' ' ; - char * Regname="" ; - char * RegnameEBX="" ; - char * Operand=""; - char * Label; - - for (type = 0 ; type < 2 ; type ++) /* 0=subx, 1=addx */ - for (regx = 0 ; regx < 8 ; regx++) - for (leng = 0 ; leng < 3 ; leng++) - for (rm = 0 ; rm < 2 ; rm++) - for (regy = 0 ; regy < 8 ; regy++) - { - Opcode = 0x9100 | (type<<14) | (regx<<9) | (leng<<6) | (rm<<3) | regy ; - - BaseCode = Opcode & 0xd1c8 ; - - ModeModX = 0; - ModeModY = 0; - -#ifdef A7ROUTINE - if ((rm == 1) && (leng == 0)) - { - if (regx == 7) - { - BaseCode |= (regx << 9); - ModeModY = 16; - } - if (regy == 7) - { - BaseCode |= regy; - ModeModX = 16; - } - } -#endif - - if (rm == 0) - mode = 0 ; - else - mode = 4 ; - - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameEBX = regnamesshort[EBX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[0]; - RegnameEBX = regnamesword[EBX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[0]; - RegnameEBX = regnameslong[EBX]; - break; - } - - if (OpcodeArray[BaseCode] == -2) - { - if (type == 0) - Operand = "sbb"; - else - Operand = "adc"; - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if (mode == 4) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - /* don't add in EA timing for ADDX,SUBX */ - - AddEACycles = 0 ; - - if (rm == 0) /* reg to reg */ - { - if (Size != 'L') - TimingCycles += 4 ; - else - TimingCycles += 8 ; - } - else - { - if (Size != 'L') - TimingCycles += 18 ; - else - TimingCycles += 30 ; - } - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx, byte 7\n"); - fprintf(fp, "\t\t shr ecx, byte 9\n"); - fprintf(fp, "\t\t and ecx, byte 7\n"); - - /* Get Source */ - - EffectiveAddressRead(mode+ModeModX,Size,EBX,EBX,"--CDS-B",FALSE); - - /* Get Destination (if needed) */ - - if (mode == 4) - EffectiveAddressRead(mode+ModeModY,Size,ECX,EAX,"-BCDSDB",FALSE); - - /* Copy the X flag into the Carry Flag */ - - CopyX(); - - /* Do the sums */ - - if (mode == 0) - fprintf(fp, "\t\t %s [%s+ecx*4],%s\n",Operand,REG_DAT,RegnameEBX); - else - fprintf(fp, "\t\t %s %s,%s\n",Operand,Regname,RegnameEBX); - - /* Preserve old Z flag */ - - fprintf(fp, "\t\t mov ebx,edx\n"); - - /* Set the Flags */ - - SetFlags(Size,EAX,FALSE,TRUE,FALSE); - - /* Handle the Z flag */ - - Label = GenerateLabel(0,1); - - fprintf(fp, "\t\t jnz short %s\n\n",Label); - - fprintf(fp, "\t\t and dl,0BFh ; Remove Z\n"); - fprintf(fp, "\t\t and bl,40h ; Mask out Old Z\n"); - fprintf(fp, "\t\t or dl,bl ; Copy across\n\n"); - fprintf(fp, "%s:\n",Label); - - /* Update the Data (if needed) */ - - if (mode == 4) - EffectiveAddressWrite(mode,Size,ECX,FALSE,"---DS-B",TRUE); - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -/* - * Logicals / Simple Maths (+ and -) - * - * OR,AND,CMP,EOR,ADD and SUB - * - */ - -void dumpx( int start, int reg, int type, char * Op, int dir, int leng, int mode, int sreg ) -{ - int Opcode,BaseCode ; - char Size=' ' ; - char * RegnameECX="" ; - char * Regname="" ; - int Dest ; - int SaveEDX ; - int SaveDir; - char * allow="" ; - char * allowtypes[] = { "0-23456789ab----", "--2345678-------", - "0123456789ab----", "0-2345678-------"}; - - SaveDir = dir; - - switch (type) - { - case 0: /* or and*/ - if (dir == 0) - allow = allowtypes[0]; - else - allow = allowtypes[1]; - break ; - - case 1: /* cmp*/ - allow = allowtypes[2] ; - break ; - - case 2: /* eor*/ - allow = allowtypes[3] ; - break ; - - case 3: /* adda suba cmpa*/ - allow = allowtypes[2] ; - break ; - - case 4: /* sub add*/ - if (dir == 0) - allow = allowtypes[0] ; - else - allow = allowtypes[1] ; - break ; - } - - if ((type == 4) && (dir == 0) && (leng > 0)) - { - allow = allowtypes[2] ; /* word and long ok*/ - } - - Opcode = start | (reg << 9 ) | (dir<<8) | (leng<<6) | (mode<<3) | sreg; - - BaseCode = Opcode & 0xf1f8; - - if (mode == 7) BaseCode |= sreg ; - -#ifdef A7ROUTINE - if ((mode == 3 || mode == 4) && ( leng == 0 ) && (sreg == 7 )) - BaseCode |= sreg ; -#endif - - - - /* If Source = Data or Address register - combine into same routine */ - - if (((Opcode & 0x38) == 0x08) && (allow[1] != '-')) - { - BaseCode &= 0xfff7; - } - - Dest = EAtoAMN(Opcode, FALSE); - SaveEDX = (Dest == 1) || (type == 3); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameECX = regnamesshort[ECX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[0]; - RegnameECX = regnamesword[ECX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[0]; - RegnameECX = regnameslong[ECX]; - break; - - case 3: /* cmpa adda suba */ - if (dir == 0) - { - Size = 'W'; - Regname = regnamesword[0]; - RegnameECX = regnamesword[ECX]; - } - else - { - Size = 'L'; - Regname = regnameslong[0]; - RegnameECX = regnameslong[ECX]; - } - dir = 0 ; - break ; - } - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (dir==0) - { - if (Size != 'L') - TimingCycles += 4; - else - TimingCycles += 6; - } - else - { - if (Size != 'L') - TimingCycles += 8; - else - TimingCycles += 12; - } - - if ((mode == 0) && (dir==0) && (Size == 'L')) - TimingCycles += 2 ; - - if ((mode == 1) && (dir==0) && (Size != 'L')) - TimingCycles += 4 ; - - if (Dest < 7) /* Others do not need reg.no. */ - { - fprintf(fp, "\t\t mov ebx,ecx\n"); - - if ((Dest == 0) & (allow[1] != '-')) - fprintf(fp, "\t\t and ebx,byte 15\n"); - else - fprintf(fp, "\t\t and ebx,byte 7\n"); - } - - fprintf(fp, "\t\t shr ecx,byte 9\n"); - fprintf(fp, "\t\t and ecx,byte 7\n"); - - EffectiveAddressRead(Dest,Size,EBX,EAX,"-BCDSDB",SaveEDX); - - if (dir == 0) - { - if (type != 3) - { - fprintf(fp, "\t\t %s [%s+ECX*4],%s\n",Op ,REG_DAT ,Regname ) ; - - if (type == 4) - SetFlags(Size,EAX,FALSE,TRUE,FALSE); - else - SetFlags(Size,EAX,FALSE,FALSE,FALSE); - } - else - { - if (Size == 'W') - fprintf(fp, "\t\t cwde\n"); - - fprintf(fp, "\t\t %s [%s+ECX*4],EAX\n",Op ,REG_ADD); - - if (Op[0] == 'c') - { - SetFlags('L',EAX,FALSE,FALSE,FALSE); - } - } - } - else - { - fprintf(fp, "\t\t %s %s,[%s+ECX*4]\n", Op, Regname ,REG_DAT ) ; - - if (type == 4) - SetFlags(Size,EAX,FALSE,TRUE,TRUE); - else - SetFlags(Size,EAX,FALSE,FALSE,TRUE); - - EffectiveAddressWrite(Dest,Size,EBX,FALSE,"---DS-B",FALSE); - } - Completed(); - } - - OpcodeArray[Opcode] = BaseCode; - } - - dir = SaveDir; -} - -void typelogicalmath(void) -{ - int dir, leng, mode, sreg ,reg ; - - for (reg = 0 ; reg < 8 ; reg++) - { - /* or */ - for (dir = 0 ; dir < 2 ; dir++) - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0x8000, reg, 0, "or ", dir, leng, mode, sreg ) ; - - /* sub */ - for (dir = 0 ; dir < 2 ; dir++) - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0x9000, reg, 4, "sub", dir, leng, mode, sreg ) ; - - /* suba */ - - for (dir = 0 ; dir < 2 ; dir++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0x9000, reg, 3, "sub", dir, 3, mode, sreg ) ; - - - /* cmp */ - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xb000, reg, 1, "cmp", 0, leng, mode, sreg ) ; - - /* cmpa */ - - for (dir = 0 ; dir < 2 ; dir++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xb000, reg, 3, "cmp", dir, 3, mode, sreg ) ; - - /* adda */ - - for (dir = 0 ; dir < 2 ; dir++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xd000, reg, 3, "add", dir, 3, mode, sreg ) ; - - - /* eor */ - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xb100, reg, 2, "xor", 1, leng, mode, sreg ) ; - - /* and */ - for (dir = 0 ; dir < 2 ; dir++) - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xc000, reg, 0, "and", dir, leng, mode, sreg ) ; - - /* add */ - for (dir = 0 ; dir < 2 ; dir++) - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xd000, reg, 4, "add", dir, leng, mode, sreg ) ; - } -} - -/* - * Single commands missed out by routines above - * - */ - -void mul(void) -{ - int dreg, type, mode, sreg ; - int Opcode, BaseCode ; - int Dest ; - char allow[] = "0-23456789ab-----" ; - - for (dreg = 0 ; dreg < 8 ; dreg++) - for (type = 0 ; type < 2 ; type++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xc0c0 | (dreg<<9) | (type<<8) | (mode<<3) | sreg ; - BaseCode = Opcode & 0xc1f8 ; - if (mode == 7) - { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - if (allow[Dest&0x0f] != '-') - { - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 54 ; - - if (mode < 7) - { - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - } - - fprintf(fp, "\t\t shr ecx, byte 9\n"); - fprintf(fp, "\t\t and ecx, byte 7\n"); - - EffectiveAddressRead(Dest,'W',EBX,EAX,"ABCDSDB",FALSE); - - if (type == 0) - fprintf(fp, "\t\t mul word [%s+ECX*4]\n",REG_DAT); - else - fprintf(fp, "\t\t imul word [%s+ECX*4]\n",REG_DAT); - - fprintf(fp, "\t\t shl edx, byte 16\n"); - fprintf(fp, "\t\t mov dx,ax\n"); - fprintf(fp, "\t\t mov [%s+ECX*4],edx\n",REG_DAT); - SetFlags('L',EDX,TRUE,FALSE,FALSE); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -void mull(void) -{ - int mode, sreg ; - int Opcode, BaseCode ; - int Dest ; - char allow[] = "0-23456789ab-----" ; - char *Label = NULL ; - - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x4c00 | (mode<<3) | sreg ; - BaseCode = Opcode & 0x4c38 ; - if (mode == 7) - { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - if (allow[Dest&0x0f] != '-') - { - if (OpcodeArray[ BaseCode ] == -2) - { - TimingCycles += 70 ; - Align(); - Label = GenerateLabel(BaseCode,0); - fprintf(fp, "%s:\n",Label); - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (mode < 7) - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - } - - Memory_Fetch('W', EBX, FALSE ); // fetch the next word - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - EffectiveAddressRead(Dest,'L',ECX,EAX,"ABCDSDB",FALSE); // read from the EA - - fprintf(fp, "\t\t mov ecx,ebx\n"); // save 2nd word in ecx - fprintf(fp, "\t\t shr ebx,12\n"); // ebx = Dl register - fprintf(fp, "\t\t and ebx,7\n"); // 0-7 - - Label = GenerateLabel(BaseCode,1); - - fprintf(fp, "\t\t test ecx,0x0800\n"); // signed/unsigned? - fprintf(fp, "\t\t jz short %s\n",Label); // skip if unsigned - - fprintf(fp, "\t\t imul dword [%s+EBX*4]\n",REG_DAT); // signed 32x32->64 - fprintf(fp, "\t\t jmp short %s_1\n",Label); // skip - - fprintf(fp, "%s:\n",Label); - fprintf(fp, "\t\t mul dword [%s+EBX*4]\n",REG_DAT); // unsigned 32x32->64 - - fprintf(fp, "%s_1:\n",Label); - fprintf(fp, "\t\t mov [%s+EBX*4],eax\n",REG_DAT); // store Dl back - - fprintf(fp, "\t\t test ecx,0x0400\n"); // do we care? - fprintf(fp, "\t\t jz short %s_2\n",Label); // if not, skip - fprintf(fp, "\t\t and ecx,7\n"); // get Dh register - fprintf(fp, "\t\t mov [%s+ECX*4],edx\n",REG_DAT); // store upper 32 bits - SetFlags('L',EDX,TRUE,FALSE,FALSE); // set the flags - fprintf(fp, "\t\t and edx,~0x0800\n"); // clear the overflow - fprintf(fp, "\t\t jmp short %s_3\n",Label); // skip - - fprintf(fp, "%s_2:\n",Label); - fprintf(fp, "\t\t mov ebx,edx\n"); // save upper 32 in ebx - SetFlags('L',EAX,TRUE,FALSE,FALSE); // set the flags - fprintf(fp, "\t\t sar eax,31\n"); // eax = sign-extended - fprintf(fp, "\t\t test ecx,0x0800\n"); // signed/unsigned? - fprintf(fp, "\t\t jnz short %s_4\n",Label); // skip if signed - fprintf(fp, "\t\t xor eax,eax\n"); // always use 0 for unsigned - fprintf(fp, "%s_4:\n",Label); - fprintf(fp, "\t\t cmp eax,ebx\n"); // compare upper 32 against eax - fprintf(fp, "\t\t je short %s_3\n",Label); // if equal to sign extension, skip - fprintf(fp, "\t\t or edx,0x0800\n"); // set the overflow - - fprintf(fp, "%s_3:\n",Label); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -void divl(void) -{ - int mode, sreg ; - int Opcode, BaseCode ; - int Dest ; - char allow[] = "0-23456789ab-----" ; - char *Label = NULL ; - - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x4c40 | (mode<<3) | sreg ; - BaseCode = Opcode & 0x4c78 ; - if (mode == 7) - { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - if (allow[Dest&0x0f] != '-') - { - if (OpcodeArray[ BaseCode ] == -2) - { - TimingCycles += 70 ; - Align(); - Label = GenerateLabel(BaseCode,0); - fprintf(fp, "%s:\n",Label); - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t push edx\n"); // save edx - fprintf(fp, "\t\t add esi,byte 2\n\n"); - fprintf(fp, "\t\t and ecx,byte 7\n"); // read from ea - - Memory_Fetch('W', EDX, FALSE ); // fetch 2nd word in ecx - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - EffectiveAddressRead(Dest,'L',ECX,EBX,"---DSDB",FALSE); - - fprintf(fp, "\t\t push esi\n"); // save and 0 esi - ClearRegister(ESI); - - Label = GenerateLabel(BaseCode,1); - - fprintf(fp, "\t\t test ebx,ebx\n"); // check divisor against 0 - fprintf(fp, "\t\t jz near %s_ZERO\n",Label); // handle divide-by-zero -// low part always used - fprintf(fp, "\t\t mov ecx,edx\n"); // ecx = extension word - fprintf(fp, "\t\t shr edx,12\n"); // edx = Dq register - fprintf(fp, "\t\t and edx,7\n"); // 0-7 - fprintf(fp, "\t\t mov eax,[%s+edx*4]\n",REG_DAT); // eax = Dq register value - - ClearRegister(EDX); // edx = 0 - fprintf(fp, "\t\t test ecx,0x0400\n"); // check size - fprintf(fp, "\t\t jz short %s_1\n",Label); // skip if 32-bit dividend -// high longword (64bit) - fprintf(fp, "\t\t mov edx,ecx\n"); // edx = extension word - fprintf(fp, "\t\t and edx,7\n"); // 0-7 - fprintf(fp, "\t\t mov edx,[%s+edx*4]\n",REG_DAT); // fetch upper 32-bits - - fprintf(fp, "\t\t test ecx,0x0800\n"); // signed? - fprintf(fp, "\t\t jz near %s_3\n",Label); // if not, skip to unsigned 64-bit - fprintf(fp, "\t\t jmp near %s_2\n",Label); // skip to signed 64-bit case - - fprintf(fp, "%s_1:\n",Label); // short case - ClearRegister(EDX); // clear edx - fprintf(fp, "\t\t test ecx,0x0800\n"); // signed? - fprintf(fp, "\t\t jz short %s_3\n",Label); // if not, don't convert - fprintf(fp, "\t\t cdq\n"); // sign extend into edx -// signed - fprintf(fp, "%s_2:\n",Label); // signed 32/64-bit case - fprintf(fp, "\t\t or esi,1\n"); // esi |= 1 to indicate signed - fprintf(fp, "\t\t test ebx,ebx\n"); // check divisor sign - fprintf(fp, "\t\t jge short %s_2b\n",Label); // if >= 0, don't set - fprintf(fp, "\t\t or esi,2\n"); // esi |= 2 to indicate negative divisor - fprintf(fp, "\t\t neg ebx\n"); // make positive - fprintf(fp, "%s_2b:\n",Label); - fprintf(fp, "\t\t test edx,edx\n"); // check dividend sign - fprintf(fp, "\t\t jge short %s_3\n",Label); // if >= 0, don't set - fprintf(fp, "\t\t push ebx\n"); // save ebx - fprintf(fp, "\t\t push ecx\n"); // save ecx - ClearRegister(EBX); // clear ebx - ClearRegister(ECX); // clear ecx - fprintf(fp, "\t\t sub ebx,eax\n"); // ebx = 0 - eax - fprintf(fp, "\t\t sbb ecx,edx\n"); // ecx = 0 - edx - fprintf(fp, "\t\t mov eax,ebx\n"); // eax = ebx - fprintf(fp, "\t\t mov edx,ecx\n"); // edx = ecx - fprintf(fp, "\t\t pop ecx\n"); // restore ecx - fprintf(fp, "\t\t pop ebx\n"); // restore ebx - fprintf(fp, "\t\t or esi,4\n"); // esi |= 4 to indicate negative dividend -// unsigned - fprintf(fp, "%s_3:\n",Label); // unsigned 32/64-bit case - fprintf(fp, "\t\t cmp ebx,edx\n"); // check ebx against upper 32 bits - fprintf(fp, "\t\t jbe near %s_OVERFLOW\n",Label); // generate overflow - fprintf(fp, "\t\t div ebx\n"); // do the divide - fprintf(fp, "\t\t test esi,esi\n"); // see if we need to post process - fprintf(fp, "\t\t jz short %s_4\n",Label); // if not, skip - fprintf(fp, "\t\t jpo short %s_4\n",Label); // if PO (pos*pos or neg*neg), leave the result - fprintf(fp, "\t\t neg eax\n"); // negate the result - -// store results - fprintf(fp, "%s_4:\n",Label); - fprintf(fp, "\t\t mov ebx,ecx\n"); // ebx = extension word - fprintf(fp, "\t\t and ebx,7\n"); // get Dr in ebx - fprintf(fp, "\t\t shr ecx,12\n"); // ecx = Dq - fprintf(fp, "\t\t and ecx,7\n"); // 0-7 - fprintf(fp, "\t\t mov [%s+ebx*4],edx\n",REG_DAT); // store remainder first - fprintf(fp, "\t\t mov [%s+ecx*4],eax\n",REG_DAT); // store quotient second - fprintf(fp, "\t\t pop esi\n"); // restore esi - fprintf(fp, "\t\t pop edx\n"); // restore edx - SetFlags('L',EAX,TRUE,FALSE,FALSE); // set the flags - fprintf(fp, "%s_5:\n",Label); - fprintf(fp, "\t\t and edx,~1\n"); // clear the carry - Completed(); - - fprintf(fp, "%s_ZERO:\t\t ;Do divide by zero trap\n", Label); - /* Correct cycle counter for error */ - fprintf(fp, "\t\t pop esi\n"); // restore esi - fprintf(fp, "\t\t pop edx\n"); // restore edx - fprintf(fp, "\t\t add dword [%s],byte %d\n",ICOUNT,95); - fprintf(fp,"\t\t jmp short %s_5\n",Label); - Exception(5,BaseCode); - - fprintf(fp, "%s_OVERFLOW:\n",Label); -//set overflow - fprintf(fp, "\t\t pop esi\n"); // restore esi - fprintf(fp, "\t\t pop edx\n"); // restore edx - fprintf(fp, "\t\t or edx,0x0800\n"); // set the overflow bit - fprintf(fp, "\t\t jmp near %s_5\n",Label); // done - - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -void bfext(void) -{ -// just bfextu/bfexts for now - char allow[] = "0-2--56789a-----" ; - char *Label = NULL ; - int mode,dreg,sign,Opcode,BaseCode,Dest ; - for (mode=0; mode<8; mode++) - for (dreg=0; dreg<8; dreg++) - for (sign=0; sign<2; sign++) - { - Opcode = 0xe9c0 | (sign<<9) | (mode<<3) | dreg ; - BaseCode = Opcode & 0xebf8 ; - if (mode == 7) - BaseCode |= dreg ; - Dest = EAtoAMN(Opcode, FALSE); - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - Align(); - Label = GenerateLabel(BaseCode,0); - fprintf(fp, "%s:\n",Label); - Label = GenerateLabel(BaseCode,1); - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (mode < 7) - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - } - - Memory_Fetch('W', EAX, FALSE ) ; - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - EffectiveAddressRead(Dest,'L',ECX,EDX,"ABCDSDB",FALSE); // edx = dword - - fprintf(fp, "\t\t mov ecx,eax\n"); - fprintf(fp, "\t\t shr ecx,byte 6\n"); - fprintf(fp, "\t\t test eax,0x0800\n"); - fprintf(fp, "\t\t je short %s_1\n",Label); - //get offset from Dx - fprintf(fp, "\t\t and ecx,byte 7\n"); - fprintf(fp, "\t\t mov ecx,[%s+ECX*4]\n",REG_DAT); - //get offset from extension - fprintf(fp, "%s_1:\n",Label); - fprintf(fp, "\t\t and ecx,31\n"); // ecx = offset - fprintf(fp, "\t\t mov ebx,eax\n"); - fprintf(fp, "\t\t test eax,0x0020\n"); - fprintf(fp, "\t\t je short %s_2\n",Label); - //get width from Dy - fprintf(fp, "\t\t and ebx,byte 7\n"); - fprintf(fp, "\t\t mov ebx,[%s+EBX*4]\n",REG_DAT); - //get width from extension - fprintf(fp, "%s_2:\n",Label); - //fix 0=32 - fprintf(fp, "\t\t sub ebx,byte 1\n"); - fprintf(fp, "\t\t and ebx,byte 31\n"); - fprintf(fp, "\t\t add ebx,byte 1\n"); // ebx = width - fprintf(fp, "\t\t rol edx,cl\n"); - // check for N - fprintf(fp, "\t\t mov ecx,32\n"); - fprintf(fp, "\t\t sub ecx,ebx\n"); - fprintf(fp, "\t\t mov ebx,edx\n"); - SetFlags('L',EBX,TRUE,FALSE,FALSE); - if (sign) - fprintf(fp, "\t\t sar ebx,cl\n"); - else - fprintf(fp, "\t\t shr ebx,cl\n"); - fprintf(fp, "\t\t shr eax,12\n"); - fprintf(fp, "\t\t and eax,7\n"); - fprintf(fp, "\t\t mov [%s+EAX*4],ebx\n",REG_DAT); - fprintf(fp, "\t\t test ebx,ebx\n"); - fprintf(fp, "\t\t jnz short %s_3\n",Label); - //zero flag - fprintf(fp, "\t\t or edx,40h\n"); - fprintf(fp, "%s_3:\n",Label); - Completed(); - } - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * not - * clr - * neg - * negx - * - */ - -void not(void) -{ - int type,leng, mode, sreg ; - int Opcode, BaseCode ; - int Dest ; - int SaveEDX=0; - char Size=' ' ; - char * Regname="" ; - char * RegnameECX ; - char * Label; - - char allow[] = "0-2345678-------" ; - - for (type = 0 ; type < 4 ; type++) - for (leng = 0 ; leng < 3 ; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x4000 | (type<<9) | (leng<<6) | (mode<<3) | sreg ; - BaseCode = Opcode & 0x46f8 ; - if (mode == 7) - { - BaseCode |= sreg ; - } - - // A7+, A7- - -#ifdef A7ROUTINE - if ((leng == 0) && (sreg == 7) && (mode > 2) && (mode < 5)) - { - BaseCode |= sreg ; - } -#endif - - Dest = EAtoAMN(Opcode, FALSE); - - if (allow[Dest&0x0f] != '-') - { - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameECX = regnamesshort[ECX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[0]; - RegnameECX = regnamesword[ECX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[0]; - RegnameECX = regnameslong[ECX]; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (Size != 'L') - TimingCycles += 4; - else - TimingCycles += 6; - - if (Dest < 7) - fprintf(fp, "\t\t and ecx,byte 7\n"); - - if (type == 0) SaveEDX = TRUE; - else SaveEDX = FALSE; - - /* CLR does not need to read source (although it does on a real 68000) */ - - if (type != 1) - { - EffectiveAddressRead(Dest,Size,ECX,EAX,"A-CDS-B",SaveEDX); - } - - switch (type) - { - case 0: /* negx */ - - /* Preserve old Z flag */ - - fprintf(fp, "\t\t mov ebx,edx\n"); - - CopyX(); - fprintf(fp, "\t\t adc %s,byte 0\n", Regname ) ; - fprintf(fp, "\t\t neg %s\n", Regname ) ; - - /* Set the Flags */ - - SetFlags(Size,EAX,FALSE,TRUE,FALSE); - - /* Handle the Z flag */ - - Label = GenerateLabel(0,1); - - fprintf(fp, "\t\t jnz short %s\n\n",Label); - - fprintf(fp, "\t\t and edx,byte -65 ; Remove Z\n"); - fprintf(fp, "\t\t and ebx,byte 40h ; Mask out Old Z\n"); - fprintf(fp, "\t\t or edx,ebx ; Copy across\n\n"); - fprintf(fp, "%s:\n",Label); - - break; - - case 1: /* clr */ - ClearRegister(EAX); - EffectiveAddressWrite(Dest,Size,ECX,TRUE,"----S-B",FALSE); - fprintf(fp, "\t\t mov edx,40H\n"); - break; - - case 2: /* neg */ - fprintf(fp, "\t\t neg %s\n",Regname ) ; - SetFlags(Size,EAX,FALSE,TRUE,TRUE); - break; - - case 3: /* not */ - fprintf(fp, "\t\t xor %s,-1\n",Regname ) ; - SetFlags(Size,EAX,FALSE,FALSE,TRUE); - break; - } - - /* Update (unless CLR command) */ - - if (type != 1) - EffectiveAddressWrite(Dest,Size,ECX,FALSE,"---DS-B",TRUE); - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Move to/from USP - * - */ - -void moveusp(void) -{ - int Opcode, BaseCode ; - int dir, sreg ; - char * Label; - - for (dir = 0 ; dir < 2 ; dir++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x4e60 | ( dir << 3 ) | sreg ; - BaseCode = Opcode & 0x4e68 ; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - Label = GenerateLabel(BaseCode,0); - fprintf(fp, "%s\n", Label ); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 4; - - fprintf(fp, "\t\t test byte [%s],20h \t\t\t; Supervisor Mode ?\n",REG_SRH); - fprintf(fp, "\t\t jz short OP%d_%4.4x_Trap\n",CPU,BaseCode); - - fprintf(fp, "\t\t and ecx,7\n"); - - if (dir == 0) /* reg 2 USP */ - { - fprintf(fp, "\t\t mov eax,[%s+ECX*4]\n",REG_ADD); - fprintf(fp, "\t\t mov [%s],eax\n",REG_USP); - } - else - { - fprintf(fp, "\t\t mov eax,[%s]\n",REG_USP); - fprintf(fp, "\t\t mov [%s+ECX*4],eax\n",REG_ADD); - } - Completed(); - - fprintf(fp, "OP%d_%4.4x_Trap:\n",CPU,BaseCode); - Exception(8,BaseCode); - } - OpcodeArray[Opcode] = BaseCode ; - } -} - - -/* - * Check - * - */ - -void chk(void) -{ - int dreg,mode,sreg,size ; - int Opcode, BaseCode ; - int Dest ; - char * Label ; - - char *allow = "0-23456789ab----" ; - - for (size = 0 ; size < (CPU==2 ? 2 : 1); size++) - for (dreg = 0 ; dreg < 8; dreg++) - for (mode = 0 ; mode < 8; mode++) - for (sreg = 0 ; sreg < 8; sreg++) - { - if (size == 0) /* word */ - Opcode = 0x4180 | (dreg<<9) | (mode<<3) | sreg ; - else /* long */ - Opcode = 0x4100 | (dreg<<9) | (mode<<3) | sreg ; - BaseCode = Opcode & 0x41f8 ; - - if (mode == 7) - { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - Align(); - Label = GenerateLabel(BaseCode,0); - fprintf(fp, "%s:\n", Label ); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 10; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t shr ebx,byte 9\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - - if (Dest < 7) - fprintf(fp, "\t\t and ecx,byte 7\n"); - - EffectiveAddressRead(Dest,(size == 0) ? 'W' : 'L',ECX,EAX,"----S-B",FALSE); - - if (size == 0) /* word */ - { - fprintf(fp, "\t\t movsx ebx,word [%s+EBX*4]\n",REG_DAT); - fprintf(fp, "\t\t movsx eax,ax\n"); - } - else /* long */ - fprintf(fp, "\t\t mov ebx,[%s+EBX*4]\n",REG_DAT); - - fprintf(fp, "\t\t test ebx,ebx\n"); /* is word bx < 0 */ - fprintf(fp, "\t\t jl near OP%d_%4.4x_Trap_minus\n",CPU,BaseCode); - - fprintf(fp, "\t\t cmp ebx,eax\n"); - fprintf(fp, "\t\t jg near OP%d_%4.4x_Trap_over\n",CPU,BaseCode); - Completed(); - - /* N is set if data less than zero */ - - Align(); - fprintf(fp, "OP%d_%4.4x_Trap_minus:\n",CPU,BaseCode); - fprintf(fp, "\t\t or edx,0x0080\n"); /* N flag = 80H */ - fprintf(fp, "\t\t jmp short OP%d_%4.4x_Trap_Exception\n",CPU,BaseCode); - - /* N is cleared if greated than compared number */ - - Align(); - fprintf(fp, "OP%d_%4.4x_Trap_over:\n",CPU,BaseCode); - fprintf(fp, "\t\t and edx,0x007f\n"); /* N flag = 80H */ - - fprintf(fp, "OP%d_%4.4x_Trap_Exception:\n",CPU,BaseCode); - fprintf(fp, "\t\t mov al,6\n"); - Exception(-1,0x10000+BaseCode); - Completed(); - - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -void chk2(void) -{ -#if 0 - int mode,sreg,size ; - int Opcode, BaseCode ; - int Dest ; - char * Label ; - - char *allow = "--2--56789a-----" ; - - for (size = 0 ; size < 2; size++) - for (mode = 0 ; mode < 8; mode++) - for (sreg = 0 ; sreg < 8; sreg++) - { - Opcode = 0x00c0 | (size<<9) | (mode<<3) | sreg; - BaseCode = Opcode & 0xfff8 ; - - if (mode == 7) - { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - Align(); - Label = GenerateLabel(BaseCode,0); - fprintf(fp, "%s:\n", Label ); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 10; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t shr ebx,byte 9\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - - if (Dest < 7) - fprintf(fp, "\t\t and ecx,byte 7\n"); - - EffectiveAddressRead(Dest,'W',ECX,EAX,"----S-B",FALSE); - - if (size == 0) /* word */ - { - fprintf(fp, "\t\t movsx ebx,word [%s+EBX*4]\n",REG_DAT); - fprintf(fp, "\t\t movsx eax,ax\n"); - } - else /* long */ - fprintf(fp, "\t\t mov ebx,[%s+EBX*4]\n",REG_DAT); - - fprintf(fp, "\t\t test ebx,ebx\n"); /* is word bx < 0 */ - fprintf(fp, "\t\t jl near OP%d_%4.4x_Trap_minus\n",CPU,BaseCode); - - fprintf(fp, "\t\t cmp ebx,eax\n"); - fprintf(fp, "\t\t jg near OP%d_%4.4x_Trap_over\n",CPU,BaseCode); - Completed(); - - /* N is set if data less than zero */ - - Align(); - fprintf(fp, "OP%d_%4.4x_Trap_minus:\n",CPU,BaseCode); - fprintf(fp, "\t\t or edx,0x0080\n"); /* N flag = 80H */ - fprintf(fp, "\t\t jmp short OP%d_%4.4x_Trap_Exception\n",CPU,BaseCode); - - /* N is cleared if greated than compared number */ - - Align(); - fprintf(fp, "OP%d_%4.4x_Trap_over:\n",CPU,BaseCode); - fprintf(fp, "\t\t and edx,0x007f\n"); /* N flag = 80H */ - - fprintf(fp, "OP%d_%4.4x_Trap_Exception:\n",CPU,BaseCode); - fprintf(fp, "\t\t mov al,6\n"); - Exception(-1,0x10000+BaseCode); - Completed(); - - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -#endif -} - -/* - * Load Effective Address - */ - -void LoadEffectiveAddress(void) -{ - int Opcode, BaseCode ; - int sreg,mode,dreg ; - int Dest ; - char allow[] = "--2--56789a-----" ; - - for (sreg = 0 ; sreg < 8 ; sreg++) - for (mode = 0 ; mode < 8 ; mode++) - for (dreg = 0 ; dreg < 8 ; dreg++) - { - Opcode = 0x41c0 | (sreg<<9) | (mode<<3) | dreg ; - - BaseCode = Opcode & 0x41f8 ; - - if (mode == 7) - BaseCode = BaseCode | dreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest&0x0f] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - switch (mode) - { - case 2: - TimingCycles += 4; - break; - case 5: - case 7: - case 9: - TimingCycles += 8; - break; - case 6: - case 8: - case 10: - TimingCycles += 12; - break; - } - - if (mode < 7) - { - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - } - - fprintf(fp, "\t\t shr ecx,byte 9\n"); - fprintf(fp, "\t\t and ecx,byte 7\n"); - - EffectiveAddressCalculate(Dest,'L',EBX,TRUE); - fprintf(fp, "\t\t mov [%s+ECX*4],edi\n",REG_ADD); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Negate BCD - * - */ - -void nbcd(void) -{ - int Opcode, BaseCode ; - int sreg,mode,Dest ; - char allow[] = "0-2345678-------" ; - - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x4800 | (mode<<3) | sreg ; - BaseCode = Opcode & 0x4838 ; - - if (mode == 7) - BaseCode |= sreg ; - - // A7+, A7- - -#ifdef A7ROUTINE - if ((sreg == 7) && (mode > 2) && (mode < 5)) - { - BaseCode |= sreg; - } -#endif - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (mode < 2) - TimingCycles += 6; - else - TimingCycles += 8; - - fprintf(fp, "\t\t and ecx, byte 7\n"); - - EffectiveAddressRead(Dest,'B',ECX,EBX,"--C-SDB",FALSE); - - ClearRegister(EAX); - CopyX(); - - fprintf(fp, "\t\t sbb al,bl\n"); - fprintf(fp, "\t\t das\n"); - - SetFlags('B',EAX,FALSE,TRUE,TRUE); - - EffectiveAddressWrite(Dest,'B',ECX,EAX,"----S-B",FALSE); - Completed(); - } - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -void tas(void) -{ - int Opcode, BaseCode ; - int sreg,mode,Dest ; - char allow[] = "0-2345678-------" ; - - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x4ac0 | (mode<<3) | sreg ; - BaseCode = Opcode & 0x4af8 ; - - if (mode == 7) - BaseCode |= sreg ; - -#ifdef A7ROUTINE - if ((sreg == 7) && (mode > 2) && (mode < 5)) - { - BaseCode |= sreg ; - } -#endif - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (mode < 2) - TimingCycles += 4; - else - TimingCycles += 14; - - fprintf(fp, "\t\t and ecx, byte 7\n"); - - EffectiveAddressRead(Dest,'B',ECX,EAX,"--C-SDB",FALSE); - - SetFlags('B',EAX,TRUE,FALSE,TRUE); - fprintf(fp, "\t\t or al,128\n"); - - EffectiveAddressWrite(Dest,'B',ECX,EAX,"----S-B",FALSE); - Completed(); - } - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * push Effective Address - */ - -void PushEffectiveAddress(void) -{ - int Opcode, BaseCode ; - int mode,dreg ; - int Dest ; - char allow[] = "--2--56789a-----" ; - - for (mode = 0 ; mode < 8 ; mode++) - for (dreg = 0 ; dreg < 8 ; dreg++) - { - Opcode = 0x4840 | (mode<<3) | dreg ; - - BaseCode = Opcode & 0x4878 ; - - if (mode == 7) - BaseCode = BaseCode | dreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest&0x0f] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - switch (mode) - { - case 2: - TimingCycles += 12; - break; - case 5: - case 7: - case 9: - TimingCycles += 16; - break; - case 6: - case 8: - case 10: - TimingCycles += 20; - break; - } - - if (mode < 7) - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - } - - EffectiveAddressCalculate(Dest,'L',ECX,TRUE); - - fprintf(fp, "\t\t mov ecx,[%s]\t ; Push onto Stack\n",REG_A7); - fprintf(fp, "\t\t sub ecx,byte 4\n"); - fprintf(fp, "\t\t mov [%s],ecx\n",REG_A7); - Memory_Write('L',ECX,EDI,"---DS-B",2); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Test - * - */ - -void tst(void) -{ - int leng, mode, sreg ; - int Opcode, BaseCode ; - int Dest ; - char Size=' ' ; - char * Regname ; - char * RegnameECX ; - - char allow[] = "0-2345678-------" ; - if (CPU==2) - allow[1] = '1'; - - for (leng = 0 ; leng < 3 ; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x4a00 | (leng<<6) | (mode<<3) | sreg ; - BaseCode = Opcode & 0x4af8 ; - if (mode == 7) - { - BaseCode |= sreg ; - } - - // A7+, A7- - -#ifdef A7ROUTINE - if ((leng == 0) && (sreg == 7) && (mode > 2) && (mode < 5)) - { - BaseCode |= sreg ; - } -#endif - - Dest = EAtoAMN(Opcode, FALSE); - - if ((allow[Dest&0x0f] != '-') || (( mode == 1 ) && (leng != 0))) - { - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameECX = regnamesshort[ECX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[0]; - RegnameECX = regnamesword[ECX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[0]; - RegnameECX = regnameslong[ECX]; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 4; - - if (Dest < 7) - fprintf(fp, "\t\t and ecx,byte 7\n"); - - EffectiveAddressRead(Dest,Size,ECX,EAX,"----S-B",FALSE); - - SetFlags(Size,EAX,TRUE,FALSE,FALSE); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Move registers too / from memory - * - */ - -void movem_reg_ea(void) -{ - int leng,mode,sreg ; - int Opcode, BaseCode ; - int Dest ; - char Size ; - char * Label ; - - char *allow = "--2-45678-------" ; - - for (leng = 0 ; leng < 2; leng++) - for (mode = 0 ; mode < 8; mode++) - for (sreg = 0 ; sreg < 8; sreg++) - { - Opcode = 0x4880 | ( leng<<6) | (mode<<3) | sreg ; - BaseCode = Opcode & 0x4cf8 ; - - if (mode == 7) - { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - - Size = "WL"[leng] ; - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[BaseCode] == - 2) - { - Align(); - Label = GenerateLabel(BaseCode,0); - fprintf(fp, "%s:\n",Label ) ; - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - switch (mode) - { - case 2: - case 4: - TimingCycles += 8 ; - break; - case 5: - case 7: - TimingCycles += 12 ; - break; - case 6: - case 8: - TimingCycles += 14 ; - break; - } - - fprintf(fp, "\t\t push edx\n"); - - Memory_Fetch('W',EDX,FALSE); - fprintf(fp, "\t\t add esi,byte 2\n"); - - if (mode < 7) - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - } - - if (mode == 4) - { - fprintf(fp, "\t\t push ecx\n"); - fprintf(fp, "\t\t mov edi,[%s+ECX*4]\n",REG_ADD); - } - else - EffectiveAddressCalculate(Dest,'L',ECX,TRUE); - - fprintf(fp, "\t\t mov ebx,1\n"); - - /* predecrement uses d0-d7..a0-a7 a7 first*/ - /* other modes use a7-a0..d7-d0 d0 first*/ - - if (Dest != 4) - ClearRegister(ECX); - else - fprintf(fp, "\t\t mov ecx,3Ch\n"); - - fprintf(fp, "OP%d_%4.4x_Again:\n",CPU,BaseCode); - fprintf(fp, "\t\t test edx,ebx\n"); - fprintf(fp, "\t\t je OP%d_%4.4x_Skip\n",CPU,BaseCode); - - fprintf(fp, "\t\t mov eax,[%s+ecx]\n",REG_DAT); /* load eax with current reg data */ - - if (Dest == 4) - { - if (Size == 'W') /* adjust pointer before write */ - fprintf(fp, "\t\t sub edi,byte 2\n"); - else - fprintf(fp, "\t\t sub edi,byte 4\n"); - } - - Memory_Write(Size,EDI,EAX,"-BCDSDB",1); - - if (Dest != 4) - { - if (Size == 'W') /* adjust pointer after write */ - fprintf(fp, "\t\t add edi,byte 2\n"); - else - fprintf(fp, "\t\t add edi,byte 4\n"); - } - - /* Update Cycle Count */ - - if (Size == 'W') - fprintf(fp, "\t\t sub dword [%s],byte 4\n",ICOUNT); - else - fprintf(fp, "\t\t sub dword [%s],byte 8\n",ICOUNT); - - fprintf(fp, "OP%d_%4.4x_Skip:\n",CPU,BaseCode); - - if (Dest != 4) - fprintf(fp, "\t\t add ecx,byte 4h\n"); - else - fprintf(fp, "\t\t sub ecx,byte 4h\n"); - - fprintf(fp, "\t\t add ebx,ebx\n"); /* faster than shl ebx,1 */ - fprintf(fp, "\t\t test bx,bx\n"); /* check low 16 bits */ - fprintf(fp, "\t\t jnz OP%d_%4.4x_Again\n",CPU,BaseCode); - - if (Dest == 4) - { - fprintf(fp, "\t\t pop ecx\n"); - fprintf(fp, "\t\t mov [%s+ECX*4],edi\n",REG_ADD); - } - - fprintf(fp, "\t\t pop edx\n"); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -void movem_ea_reg(void) -{ - int leng,mode,sreg ; - int Opcode, BaseCode ; - int Dest ; - char Size ; - char * Label ; - - char *allow = "--23-56789a-----" ; - - for (leng = 0 ; leng < 2; leng++) - for (mode = 0 ; mode < 8; mode++) - for (sreg = 0 ; sreg < 8; sreg++) - { - Opcode = 0x4c80 | ( leng<<6) | (mode<<3) | sreg ; - BaseCode = Opcode & 0x4cf8 ; - - if (mode == 7) - { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - - Size = "WL"[leng] ; - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[BaseCode] == - 2) - { - Align(); - Label = GenerateLabel(BaseCode,0); - - fprintf(fp, "%s:\n",Label ) ; - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - switch (mode) - { - case 2: - case 4: - TimingCycles += 8 ; - break; - case 5: - case 7: - TimingCycles += 12 ; - break; - case 6: - case 8: - TimingCycles += 14 ; - break; - } - - fprintf(fp, "\t\t push edx\n"); /* save edx because sr is unaffected */ - - Memory_Fetch('W',EDX,FALSE); - fprintf(fp, "\t\t add esi,byte 2\n"); - - if (mode < 7) - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - } - - if (mode == 3) - fprintf(fp, "\t\t push ecx\n"); /* if (An)+ then it needed later */ - - EffectiveAddressCalculate(Dest,'L',ECX,TRUE); - - fprintf(fp, "\t\t mov ebx,1\n"); /* setup register list mask */ - - /* predecrement uses d0-d7..a0-a7 a7 first*/ - /* other modes use a7-a0..d7-d0 d0 first*/ - - ClearRegister(ECX); /* always start with D0 */ - - fprintf(fp, "OP%d_%4.4x_Again:\n",CPU,BaseCode); - fprintf(fp, "\t\t test edx,ebx\n"); /* is bit set for this register? */ - fprintf(fp, "\t\t je OP%d_%4.4x_Skip\n",CPU,BaseCode); - - Memory_Read(Size,EDI,"-BCDSDB",1); - - if (Size == 'W') - fprintf(fp, "\t\t cwde\n"); /* word size must be sign extended */ - - fprintf(fp, "\t\t mov [%s+ecx],eax\n",REG_DAT); /* load current reg with eax */ - - if (Size == 'W') /* adjust pointer after write */ - fprintf(fp, "\t\t add edi,byte 2\n"); - else - fprintf(fp, "\t\t add edi,byte 4\n"); - - /* Update Cycle Count */ - - if (Size == 'W') - fprintf(fp, "\t\t sub dword [%s],byte 4\n",ICOUNT); - else - fprintf(fp, "\t\t sub dword [%s],byte 8\n",ICOUNT); - - fprintf(fp, "OP%d_%4.4x_Skip:\n",CPU,BaseCode); - fprintf(fp, "\t\t add ecx,byte 4\n"); /* adjust pointer to next reg */ - fprintf(fp, "\t\t add ebx,ebx\n"); /* Faster than shl ebx,1 */ - fprintf(fp, "\t\t test bx,bx\n"); /* check low 16 bits */ - fprintf(fp, "\t\t jnz OP%d_%4.4x_Again\n",CPU,BaseCode); - - if (mode == 3) - { - fprintf(fp, "\t\t pop ecx\n"); - fprintf(fp, "\t\t mov [%s+ECX*4],edi\n",REG_ADD); /* reset Ax if mode = (Ax)+ */ - } - - fprintf(fp, "\t\t pop edx\n"); /* restore flags */ - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Link / Unlink - * - * Local stack space - * - */ - -void link(void) -{ - int sreg ; - int Opcode, BaseCode ; - - for (sreg = 0 ; sreg < 8; sreg++) - { - Opcode = 0x4e50 | sreg ; - BaseCode = 0x4e50 ; - - if (OpcodeArray[BaseCode] == - 2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 16; - - fprintf(fp, "\t\t sub dword [%s],byte 4\n",REG_A7); - - fprintf(fp, "\t\t and ecx, byte 7\n"); - fprintf(fp, "\t\t mov eax,[%s+ECX*4]\n",REG_ADD); - fprintf(fp, "\t\t mov edi,[%s]\n",REG_A7); - fprintf(fp, "\t\t mov [%s+ECX*4],edi\n",REG_ADD); - - Memory_Write('L',EDI,EAX,"---DS-B",1); - - Memory_Fetch('W',EAX,TRUE); - fprintf(fp, "\t\t add esi,byte 2\n"); - fprintf(fp, "\t\t add [%s],eax\n",REG_A7); - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void unlinkasm(void) -{ - int sreg ; - int Opcode, BaseCode ; - - for (sreg = 0 ; sreg < 8; sreg++) - { - Opcode = 0x4e58 | sreg ; - BaseCode = 0x4e58 ; - - if (OpcodeArray[BaseCode] == - 2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 12; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx, byte 7\n"); - fprintf(fp, "\t\t mov edi,[%s+EBX*4]\n",REG_ADD); - - Memory_Read('L',EDI,"-B-DSDB",1); - - fprintf(fp, "\t\t mov [%s+EBX*4],eax\n",REG_ADD); - fprintf(fp, "\t\t add edi,byte 4\n"); - fprintf(fp, "\t\t mov dword [%s],EDI\n",REG_A7); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void trap(void) -{ - int Count; - int BaseCode = 0x4E40; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - fprintf(fp, "\t\t mov eax,ecx\n"); - fprintf(fp, "\t\t and eax,byte 15\n"); - fprintf(fp, "\t\t or eax,byte 32\n"); - Exception(-1,BaseCode); - Completed(); - } - - for (Count=0;Count<=15;Count++) - OpcodeArray[BaseCode+Count] = BaseCode; -} - -void reset(void) -{ - int BaseCode = 0x4E70; - char * Label; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - Label = GenerateLabel(BaseCode,0); - - TimingCycles += 132; - - fprintf(fp, "%s:\n", Label ); - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - fprintf(fp, "\t\t test byte [%s],20h \t\t\t; Supervisor Mode ?\n",REG_SRH); - fprintf(fp, "\t\t jnz near OP%d_%4.4x_RESET\n",CPU,BaseCode); - Exception(8,BaseCode); - - fprintf(fp, "\nOP%d_%4.4x_RESET:\n",CPU,BaseCode); - - /* Prefetch next instruction */ - - if(CPU==2) - { - /* 32 bit memory version */ - - fprintf(fp, "\t\t xor esi,2\n"); /* ASG */ -#ifdef STALLCHECK - ClearRegister(ECX); - fprintf(fp, "\t\t mov cx,[esi+ebp]\n"); -#else - fprintf(fp, "\t\t movzx ecx,word [esi+ebp]\n"); -#endif - fprintf(fp, "\t\t xor esi,2\n"); /* ASG */ - } - else - { - /* 16 bit memory */ -#ifdef STALLCHECK - ClearRegister(ECX); - fprintf(fp, "\t\t mov cx,[esi+ebp]\n"); -#else - fprintf(fp, "\t\t movzx ecx,word [esi+ebp]\n"); -#endif - } - - fprintf(fp, "\t\t mov eax,dword [%s]\n", REG_RESET_CALLBACK); - fprintf(fp, "\t\t test eax,eax\n"); - fprintf(fp, "\t\t jz near OP%d_%4.4x_END\n",CPU,BaseCode); - - /* Callback for Reset */ - - fprintf(fp, "\t\t mov [%s],ESI,\n",REG_PC); - fprintf(fp, "\t\t mov [%s],edx\n",REG_CCR); - fprintf(fp, "\t\t push ECX\n"); - - fprintf(fp, "\t\t call eax\n"); - - fprintf(fp, "\t\t mov ESI,[%s]\n",REG_PC); - fprintf(fp, "\t\t mov edx,[%s]\n",REG_CCR); - fprintf(fp, "\t\t pop ECX\n"); - fprintf(fp, "\t\t mov ebp,dword [%sOP_ROM]\n", PREF); - - fprintf(fp, "OP%d_%4.4x_END:\n",CPU,BaseCode); - fprintf(fp, "\t\t sub dword [%s],%d\n",ICOUNT,TimingCycles); - fprintf(fp, "\t\t jmp [%s_OPCODETABLE+ecx*4]\n\n", CPUtype); - } - OpcodeArray[BaseCode] = BaseCode ; -} - -void nop(void) -{ - int BaseCode = 0x4e71 ; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 4; - - Completed(); - OpcodeArray[BaseCode] = BaseCode ; - } -} - -void stop(void) -{ - char TrueLabel[16]; - int BaseCode = 0x4e72 ; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 4; - - /* Must be in Supervisor Mode */ - - sprintf(TrueLabel,GenerateLabel(0,1)); - - fprintf(fp, "\t\t test byte [%s],20h \t\t\t; Supervisor Mode ?\n",REG_SRH); - fprintf(fp, "\t\t je near %s\n\n",TrueLabel); - - /* Next WORD is new SR */ - - Memory_Fetch('W',EAX,FALSE); - fprintf(fp, "\t\t add esi,byte 2\n"); - - WriteCCR('W'); - - /* See if Valid interrupt waiting */ - - CheckInterrupt = 0; - - fprintf(fp, "\t\t mov eax,[%s]\n",REG_IRQ); - fprintf(fp, "\t\t and eax,byte 07H\n"); - - fprintf(fp, "\t\t cmp al,7\t\t ; Always take 7\n"); - fprintf(fp, "\t\t je near procint\n\n"); - - fprintf(fp, "\t\t mov ebx,[%s]\t\t; int mask\n",REG_SRH); - fprintf(fp, "\t\t and ebx,byte 07H\n"); - fprintf(fp, "\t\t cmp eax,ebx\n"); - fprintf(fp, "\t\t jg near procint\n\n"); - - /* No int waiting - clear count, set stop */ - - ClearRegister(ECX); - fprintf(fp, "\t\t mov [%s],ecx\n",ICOUNT); - fprintf(fp, "\t\t or byte [%s],80h\n",REG_IRQ); - Completed(); - - /* User Mode - Exception */ - - Align(); - fprintf(fp, "%s:\n",TrueLabel); - Exception(8,BaseCode); - - OpcodeArray[BaseCode] = BaseCode ; - } -} - -void ReturnFromException(void) -{ - char TrueLabel[16]; - - int BaseCode = 0x4e73; - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 20; - - /* Check in Supervisor Mode */ - - sprintf(TrueLabel,GenerateLabel(0,1)); - fprintf(fp, "\t\t test byte [%s],20h \t\t\t; Supervisor Mode ?\n",REG_SRH); - fprintf(fp, "\t\t je near %s\n\n",TrueLabel); - - /* Get SR - Save in EBX */ - - fprintf(fp, "\t\t mov edi,[%s]\n",REG_A7); - fprintf(fp, "\t\t add dword [%s],byte 6\n",REG_A7); - Memory_Read('W',EDI,"-----DB",2); - fprintf(fp, "\t\t add edi,byte 2\n"); - fprintf(fp, "\t\t mov esi,eax\n"); - - /* Get PC */ - - Memory_Read('L',EDI,"----S-B",0); - fprintf(fp, "\t\t xchg esi,eax\n"); - - /* Update CCR (and A7) */ - - WriteCCR('W'); - - MemoryBanking(BaseCode); - Completed(); - - fprintf(fp, "%s:\n",TrueLabel); - Exception(8,0x10000+BaseCode); - - OpcodeArray[BaseCode] = BaseCode; -} - -void trapv(void) -{ - int BaseCode = 0x4E76; - char * Label; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - Label = GenerateLabel(BaseCode,0); - fprintf(fp, "%s\n", Label ); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 4; - - fprintf(fp, "\t\t test dh,08h\n"); - fprintf(fp, "\t\t jz near OP%d_%4.4x_Clear\n",CPU,BaseCode); - Exception(7,BaseCode); - - fprintf(fp, "OP%d_%4.4x_Clear:\n",CPU,BaseCode); - Completed(); - } - OpcodeArray[BaseCode] = BaseCode ; -} - -void illegal_opcode(void) -{ - Align(); - fprintf(fp, "ILLEGAL:\n"); - fprintf(fp, "\t\t mov [%sillegal_op],ecx\n", PREF); - fprintf(fp, "\t\t mov [%sillegal_pc],esi\n", PREF); - -#if 0 -#ifdef MAME_DEBUG - fprintf(fp, "\t\t jmp ecx\n"); - fprintf(fp, "\t\t pushad\n"); - fprintf(fp, "\t\t call %sm68k_illegal_opcode\n", PREF); - fprintf(fp, "\t\t popad\n"); -#endif -#endif - - Exception(4,0xFFFE); -} - -/* - * Return from subroutine - * restoring flags as well - * - */ - -void ReturnandRestore(void) -{ - int BaseCode = 0x4e77; - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 20; - - /* Get SR into ESI */ - - fprintf(fp, "\t\t mov edi,[%s]\n",REG_A7); - fprintf(fp, "\t\t add dword [%s],byte 6\n",REG_A7); - - Memory_Read('W',EDI,"-----DB",2); - fprintf(fp, "\t\t add edi,byte 2\n"); - fprintf(fp, "\t\t mov esi,eax\n"); - - /* Get PC */ - - Memory_Read('L',EDI,"----SDB",0); - fprintf(fp, "\t\t xchg esi,eax\n"); - - /* Update flags */ - - WriteCCR('B'); - - MemoryBanking(BaseCode); - Completed(); - - OpcodeArray[BaseCode] = BaseCode; -} - -/* - * Return from Subroutine - * - */ - -void rts(void) -{ - int BaseCode = 0x4e75 ; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - - TimingCycles += 16; - - OpcodeArray[BaseCode] = BaseCode ; - - fprintf(fp, "\t\t mov eax,[%s]\n",REG_A7); - fprintf(fp, "\t\t add dword [%s],byte 4\n",REG_A7); - Memory_Read('L',EAX,"---D--B",1); - fprintf(fp, "\t\t mov esi,eax\n"); - MemoryBanking(BaseCode); - Completed(); - } -} - -void jmp_jsr(void) -{ - int Opcode, BaseCode ; - int dreg,mode,type ; - int Dest ; - char allow[] = "--2--56789a-----" ; - - for (type = 0 ; type < 2 ; type++) - for (mode = 0 ; mode < 8 ; mode++) - for (dreg = 0 ; dreg < 8 ; dreg++) - { - Opcode = 0x4e80 | (type<<6) | (mode<<3) | dreg ; - BaseCode = Opcode & 0x4ef8 ; - if (mode == 7) - BaseCode = BaseCode | dreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - if (allow[Dest&0x0f] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - switch (mode) - { - case 2: - TimingCycles += 8; - break; - case 5: - case 7: - case 9: - TimingCycles += 10; - break; - case 8: - TimingCycles += 12; - break; - case 6: - case 10: - TimingCycles += 14; - break; - } - - if (type == 0) /* jsr takes 8 more than jmp */ - TimingCycles += 8; - - if (mode < 7) - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - } - EffectiveAddressCalculate(Dest,'L',ECX,TRUE); - - /* jsr needs to push PC onto stack */ - - if (type == 0) - { - PushPC(EBX,EAX,"---D-DB",1); - } - - fprintf(fp, "\t\t mov esi,edi\n"); - MemoryBanking(BaseCode); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -void cmpm(void) -{ - int Opcode, BaseCode ; - int regx,leng,regy ; - int ModeModX, ModeModY; - char Size=' ' ; - char * Regname="" ; - char * RegnameEBX="" ; - - for (regx = 0 ; regx < 8 ; regx++) - for (leng = 0 ; leng < 3 ; leng++) - for (regy = 0 ; regy < 8 ; regy++) - { - Opcode = 0xb108 | (regx<<9) | (leng<<6) | regy ; - BaseCode = Opcode & 0xb1c8 ; - - ModeModX = 0; - ModeModY = 0; - -#ifdef A7ROUTINE - if (leng==0) - { - if (regx==7) - { - BaseCode |= (regx<<9); - ModeModX = 16; - } - - if (regy==7) - { - BaseCode |= regy; - ModeModY = 16; - } - } -#endif - - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[EAX]; - RegnameEBX = regnamesshort[EBX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[EAX]; - RegnameEBX = regnamesword[EBX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[EAX]; - RegnameEBX = regnameslong[EBX]; - break; - } - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - AddEACycles = 0 ; - - if (Size != 'L') - TimingCycles += 12 ; - else - TimingCycles += 20 ; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx, byte 7\n"); - fprintf(fp, "\t\t shr ecx, byte 9\n"); - fprintf(fp, "\t\t and ecx, byte 7\n"); - - EffectiveAddressRead(3+ModeModY,Size,EBX,EBX,"--C-S-B",FALSE); - EffectiveAddressRead(3+ModeModX,Size,ECX,EAX,"-B--S-B",FALSE); - - fprintf(fp, "\t\t cmp %s,%s\n",Regname,RegnameEBX); - SetFlags(Size,EAX,FALSE,FALSE,FALSE); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void exg(void) -{ - int Opcode, BaseCode ; - int regx,type,regy ; - int opmask[3] = { 0x08, 0x09, 0x11} ; - - for (regx = 0 ; regx < 8 ; regx++) - for (type = 0 ; type < 3 ; type++) - for (regy = 0 ; regy < 8 ; regy++) - { - Opcode = 0xc100 | (regx<<9) | (opmask[type]<<3) | regy ; - BaseCode = Opcode & 0xc1c8 ; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 6 ; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - fprintf(fp, "\t\t shr ecx,byte 9\n"); - fprintf(fp, "\t\t and ecx,byte 7\n"); - - if (type == 0) - { - fprintf(fp, "\t\t mov eax,[%s+ECX*4]\n",REG_DAT); - fprintf(fp, "\t\t mov edi,[%s+EBX*4]\n",REG_DAT); - fprintf(fp, "\t\t mov [%s+ECX*4],edi\n",REG_DAT); - fprintf(fp, "\t\t mov [%s+EBX*4],eax\n",REG_DAT); - } - if (type == 1) - { - fprintf(fp, "\t\t mov eax,[%s+ECX*4]\n",REG_ADD); - fprintf(fp, "\t\t mov edi,[%s+EBX*4]\n",REG_ADD); - fprintf(fp, "\t\t mov [%s+ECX*4],edi\n",REG_ADD); - fprintf(fp, "\t\t mov [%s+EBX*4],eax\n",REG_ADD); - } - if (type == 2) - { - fprintf(fp, "\t\t mov eax,[%s+ECX*4]\n",REG_DAT); - fprintf(fp, "\t\t mov edi,[%s+EBX*4]\n",REG_ADD); - fprintf(fp, "\t\t mov [%s+ECX*4],edi\n",REG_DAT); - fprintf(fp, "\t\t mov [%s+EBX*4],eax\n",REG_ADD); - } - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void ext(void) -{ - int Opcode, BaseCode ; - int type,regy ; - - for (type = 2 ; type < 8 ; type++) - for (regy = 0 ; regy < 8 ; regy++) - { - if (type > 3 && type < 7) - continue ; - Opcode = 0x4800 | (type<<6) | regy ; - BaseCode = Opcode & 0x48c0 ; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 4 ; - - fprintf(fp, "\t\t and ecx, byte 7\n"); - - if (type == 2) /* byte to word */ - { - fprintf(fp, "\t\t movsx eax,byte [%s+ECX*4]\n",REG_DAT); - fprintf(fp, "\t\t mov [%s+ECX*4],ax\n",REG_DAT); - SetFlags('W',EAX,TRUE,FALSE,FALSE); - } - if (type == 3) /* word to long */ - { - fprintf(fp, "\t\t movsx eax,word [%s+ECX*4]\n",REG_DAT); - fprintf(fp, "\t\t mov [%s+ECX*4],eax\n",REG_DAT); - SetFlags('L',EAX,TRUE,FALSE,FALSE); - } - if (type == 7) /* byte to long */ - { - fprintf(fp, "\t\t movsx eax,byte [%s+ECX*4]\n",REG_DAT); - fprintf(fp, "\t\t mov [%s+ECX*4],eax\n",REG_DAT); - SetFlags('L',EAX,TRUE,FALSE,FALSE); - } - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void swap(void) -{ - int Opcode, BaseCode ; - int sreg ; - - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x4840 | sreg ; - BaseCode = Opcode & 0x4840; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 4 ; - - fprintf(fp, "\t\t and ecx, byte 7\n"); - fprintf(fp, "\t\t mov eax, dword [%s+ECX*4]\n",REG_DAT); - fprintf(fp, "\t\t ror eax, 16\n"); - fprintf(fp, "\t\t test eax,eax\n"); - fprintf(fp, "\t\t mov dword [%s+ECX*4],eax\n",REG_DAT); - SetFlags('L',EAX,FALSE,FALSE,FALSE); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -/* - * Line A and Line F commands - * - */ - -void LineA(void) -{ - int Count; - - /* Line A */ - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(0xA000,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - Exception(0x0A,0xA000); - - for (Count=0xA000;Count<0xB000;Count++) - { - OpcodeArray[Count] = 0xA000; - } -} - -void LineF(void) -{ - int Count; - - /* Line F */ - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(0xF000,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - Exception(0x0B,0xF000); - - for (Count=0xF000;Count<0x10000;Count++) - { - OpcodeArray[Count] = 0xF000; - } -} - -/* - * Moves To/From CCR and SR - * - * (Move from CCR is 68010 command) - * - */ - -void movesr(void) -{ - int Opcode, BaseCode ; - int type, mode, sreg ; - int Dest ; - char allow[] = "0-2345678-------" ; - char Size; - - for (type = 0 ; type < 4 ; type++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x40c0 | (type << 9) | ( mode << 3 ) | sreg ; - - /* To has extra modes */ - - if (type > 1) - { - allow[0x9] = '9'; - allow[0xa] = 'a'; - allow[0xb] = 'b' ; - } - - if ((type == 0) | (type == 3)) - Size = 'W'; /* SR */ - else - Size = 'B'; /* CCR */ - - BaseCode = Opcode & 0x46f8 ; - - if (mode == 7) - BaseCode |= sreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[BaseCode] == -2) - { - char TrueLabel[16]; - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (type > 1) /* move to */ - TimingCycles += 12 ; - else - { - if (mode < 2) - TimingCycles += 6 ; - else - TimingCycles += 8 ; - } - - /* If Move to SR then must be in Supervisor Mode */ - - if (type == 3) - { - sprintf(TrueLabel,GenerateLabel(0,1)); - - fprintf(fp, "\t\t test byte [%s],20h \t\t\t; Supervisor Mode ?\n",REG_SRH); - fprintf(fp, "\t\t je near %s\n\n",TrueLabel); - } - - /* 68010 Command ? */ - if (type==1) CheckCPUtype(1); - - - if (mode < 7) - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - } - - /* Always read/write word 2 bytes */ - if (type < 2) - { - ReadCCR(Size,EBX); - EffectiveAddressWrite(Dest & 15,'W',ECX,TRUE,"---DS-B",TRUE); - } - else - { - EffectiveAddressRead(Dest & 15,'W',ECX,EAX,"----S-B",FALSE); - WriteCCR(Size); - } - Completed(); - - /* Exception if not Supervisor Mode */ - - if (type == 3) - { - /* Was in User Mode - Exception */ - - fprintf(fp, "%s:\n",TrueLabel); - Exception(8,BaseCode); - } - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Decimal mode Add / Subtracts - * - */ - -void abcd_sbcd(void) -{ - int Opcode, BaseCode ; - int regx,type,rm,regy,mode ; - int ModeModX; - int ModeModY; - char *Label; - - for (type = 0 ; type < 2 ; type ++) /* 0=sbcd, 1=abcd */ - for (regx = 0 ; regx < 8 ; regx++) - for (rm = 0 ; rm < 2 ; rm++) - for (regy = 0 ; regy < 8 ; regy++) - { - Opcode = 0x8100 | (type<<14) | (regx<<9) | (rm<<3) | regy ; - BaseCode = Opcode & 0xc108 ; - - ModeModX = 0; - ModeModY = 0; - - if (rm == 0) - mode = 0 ; - else - { - mode = 4 ; - -#ifdef A7ROUTINE - - if (regx == 7) - { - BaseCode |= (regx << 9); - ModeModY = 16; - } - if (regy == 7) - { - BaseCode |= regy; - ModeModX = 16; - } - -#endif - } - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if (mode == 4) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - AddEACycles = 0 ; - - if (rm == 0) - TimingCycles += 6 ; - else - TimingCycles += 18 ; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx, byte 7\n"); - fprintf(fp, "\t\t shr ecx, byte 9\n"); - fprintf(fp, "\t\t and ecx, byte 7\n"); - - EffectiveAddressRead(mode+ModeModX,'B',EBX,EBX,"--C-S-B",TRUE); - EffectiveAddressRead(mode+ModeModY,'B',ECX,EAX,"-BC-SDB",TRUE); - - CopyX(); - - if (type == 0) - { - fprintf(fp, "\t\t sbb al,bl\n"); - fprintf(fp, "\t\t das\n"); - } - else - { - fprintf(fp, "\t\t adc al,bl\n"); - fprintf(fp, "\t\t daa\n"); - } - - /* Should only clear Zero flag if not zero */ - - Label = GenerateLabel(0,1); - - fprintf(fp, "\t\t mov ebx,edx\n"); - fprintf(fp, "\t\t setc dl\n"); - - fprintf(fp, "\t\t jnz short %s\n\n",Label); - - /* Keep original Zero flag */ - fprintf(fp, "\t\t and bl,40h ; Mask out Old Z\n"); - fprintf(fp, "\t\t or dl,bl ; Copy across\n\n"); - - fprintf(fp, "%s:\n",Label); - - fprintf(fp, "\t\t mov bl,dl\n"); /* copy carry into sign */ - fprintf(fp, "\t\t and bl,1\n"); - fprintf(fp, "\t\t shl bl,7\n"); - fprintf(fp, "\t\t and dl,7Fh\n"); - fprintf(fp, "\t\t or dl,bl\n"); - - fprintf(fp, "\t\t mov [%s],edx\n",REG_X); - - EffectiveAddressWrite(mode,'B',ECX,EAX,"---DS-B",TRUE); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -/* - * Rotate Left / Right - * - */ - -void rol_ror(void) -{ - int Opcode, BaseCode ; - int dreg, dr, leng, ir, sreg ; - char Size=' '; - char * Label ; - char * Regname="" ; - char * RegnameECX ; - - for (dreg = 0 ; dreg < 8 ; dreg++) - for (dr = 0 ; dr < 2 ; dr++) - for (leng = 0 ; leng < 3 ; leng++) - for (ir = 0 ; ir < 2 ; ir++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xe018 | (dreg<<9) | (dr<<8) | (leng<<6) | (ir<<5) | sreg ; - BaseCode = Opcode & 0xe1f8 ; - - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameECX = regnamesshort[ECX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[0]; - RegnameECX = regnamesword[ECX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[0]; - RegnameECX = regnameslong[ECX]; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (Size != 'L') - TimingCycles += 6 ; - else - TimingCycles += 8 ; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - fprintf(fp, "\t\t shr ecx,byte 9\n"); - - if (ir == 0) - { - Immediate8(); - } - else - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - EffectiveAddressRead(0,'L',ECX,ECX,"-B--S-B",FALSE); - fprintf(fp, "\t\t and ecx,byte 63\n"); - } - - EffectiveAddressRead(0,Size,EBX,EAX,"-BC-S-B",FALSE); - - /* shift 0 - no time, no shift and clear carry */ - - Label = GenerateLabel(0,1); - fprintf(fp, "\t\t jecxz %s\n",Label); - - /* allow 2 cycles per shift */ - - fprintf(fp, "\t\t mov edx,ecx\n"); - fprintf(fp, "\t\t add edx,edx\n"); - fprintf(fp, "\t\t sub dword [%s],edx\n",ICOUNT); - - if (dr == 0) - fprintf(fp, "\t\t ror %s,cl\n",Regname); - else - fprintf(fp, "\t\t rol %s,cl\n",Regname); - - fprintf(fp, "\t\t setc ch\n"); - - fprintf(fp, "%s:\n",Label); - - SetFlags(Size,EAX,TRUE,FALSE,FALSE); -/* fprintf(fp, "\t\t and dl,254\n"); Test clears Carry */ - fprintf(fp, "\t\t or dl,ch\n"); - - EffectiveAddressWrite(0,Size,EBX,EAX,"--C-S-B",TRUE); - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void rol_ror_ea(void) -{ - int Opcode, BaseCode ; - int dr, mode, sreg ; - int Dest ; - char allow[] = "--2345678-------" ; - - for (dr = 0 ; dr < 2 ; dr++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xe6c0 | (dr<<8) | (mode<<3) | sreg ; - BaseCode = Opcode & 0xfff8 ; - - if (mode == 7) - BaseCode |= sreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 8 ; - - fprintf(fp, "\t\t and ecx,byte 7\n"); - EffectiveAddressRead(Dest&0xf,'W',ECX,EAX,"--C-SDB",FALSE); - - if (dr == 0) - fprintf(fp, "\t\t ror ax,1\n"); - else - fprintf(fp, "\t\t rol ax,1\n"); - - fprintf(fp, "\t\t setc bl\n"); - SetFlags('W',EAX,TRUE,FALSE,FALSE); -/* fprintf(fp, "\t\t and dl,254\n"); Test clears Carry */ - fprintf(fp, "\t\t or dl,bl\n"); - - EffectiveAddressWrite(Dest&0xf,'W',ECX,EAX,"---DS-B",TRUE); - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Logical Shift Left / Right - * - */ - -void lsl_lsr(void) -{ - int Opcode, BaseCode ; - int dreg, dr, leng, ir, sreg ; - char Size=' '; - char * Regname="" ; - char * RegnameECX="" ; - char * RegnameEDX="" ; - char * Label ; - - for (dreg = 0 ; dreg < 8 ; dreg++) - for (dr = 0 ; dr < 2 ; dr++) - for (leng = 0 ; leng < 3 ; leng++) - for (ir = 0 ; ir < 2 ; ir++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xe008 | (dreg<<9) | (dr<<8) | (leng<<6) | (ir<<5) | sreg ; - BaseCode = Opcode & 0xe1f8 ; - - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameECX = regnamesshort[ECX]; - RegnameEDX = regnamesshort[EDX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[0]; - RegnameECX = regnamesword[ECX]; - RegnameEDX = regnamesword[EDX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[0]; - RegnameECX = regnameslong[ECX]; - RegnameEDX = regnameslong[EDX]; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (Size != 'L') - TimingCycles += 6 ; - else - TimingCycles += 8 ; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - fprintf(fp, "\t\t shr ecx,byte 9\n"); - - if (ir == 0) - { - Immediate8(); - } - else - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - EffectiveAddressRead(0,'L',ECX,ECX,"-B--S-B",FALSE); - fprintf(fp, "\t\t and ecx,byte 63\n"); - } - - /* and 2 cycles per shift */ - - fprintf(fp, "\t\t mov edx,ecx\n"); - fprintf(fp, "\t\t add edx,edx\n"); - fprintf(fp, "\t\t sub dword [%s],edx\n",ICOUNT); - - EffectiveAddressRead(0,Size,EBX,EAX,"-BC-S-B",FALSE); - - /* ASG: on the 68k, the shift count is mod 64; on the x86, the */ - /* shift count is mod 32; we need to check for shifts of 32-63 */ - /* and produce zero */ - Label = GenerateLabel(0,1); - fprintf(fp, "\t\t test cl,0x20\n"); - fprintf(fp, "\t\t jnz %s_BigShift\n",Label); - - fprintf(fp, "%s_Continue:\n",Label); - if (dr == 0) - fprintf(fp, "\t\t shr %s,cl\n",Regname); - else - fprintf(fp, "\t\t shl %s,cl\n",Regname); - - SetFlags(Size,EAX,FALSE,FALSE,FALSE); - - /* Clear Overflow flag */ - fprintf(fp, "\t\t xor dh,dh\n"); - - EffectiveAddressWrite(0,Size,EBX,EAX,"--CDS-B",TRUE); - - /* if shift count is zero clear carry */ - - fprintf(fp, "\t\t jecxz %s\n",Label); - - fprintf(fp, "\t\t mov [%s],edx\n",REG_X); - Completed(); - - Align(); - fprintf(fp, "%s:\n",Label); - SetFlags(Size,EAX,TRUE,FALSE,FALSE); - Completed(); - - fprintf(fp, "%s_BigShift:\n",Label); - if (dr == 0) - { - fprintf(fp, "\t\t shr %s,16\n",Regname); - fprintf(fp, "\t\t shr %s,16\n",Regname); - } - else - { - fprintf(fp, "\t\t shl %s,16\n",Regname); - fprintf(fp, "\t\t shl %s,16\n",Regname); - } - fprintf(fp, "\t\t jmp %s_Continue\n",Label); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void lsl_lsr_ea(void) -{ - int Opcode, BaseCode ; - int dr, mode, sreg ; - int Dest ; - char allow[] = "--2345678-------" ; - - for (dr = 0 ; dr < 2 ; dr++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xe2c0 | (dr<<8) | (mode<<3) | sreg ; - BaseCode = Opcode & 0xfff8 ; - - if (mode == 7) - BaseCode |= sreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[ BaseCode ] == -2) - { - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 8 ; - - fprintf(fp, "\t\t and ecx,byte 7\n"); - EffectiveAddressRead(Dest&0xf,'W',ECX,EAX,"--C-SDB",FALSE); - - if (dr == 0) - fprintf(fp, "\t\t shr ax,1\n"); - else - fprintf(fp, "\t\t shl ax,1\n"); - - SetFlags('W',EAX,FALSE,TRUE,FALSE); - - /* Clear Overflow flag */ - - fprintf(fp, "\t\t xor dh,dh\n"); - - EffectiveAddressWrite(Dest&0xf,'W',ECX,EAX,"---DS-B",TRUE); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Rotate Left / Right though Extend - * - */ - -void roxl_roxr(void) -{ - int Opcode, BaseCode ; - int dreg, dr, leng, ir, sreg ; - char Size=' ' ; - char * Regname="" ; - char * RegnameECX="" ; - char * Label ; - - for (dreg = 0 ; dreg < 8 ; dreg++) - for (dr = 0 ; dr < 2 ; dr++) - for (leng = 0 ; leng < 3 ; leng++) - for (ir = 0 ; ir < 2 ; ir++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xe010 | (dreg<<9) | (dr<<8) | (leng<<6) | (ir<<5) | sreg ; - BaseCode = Opcode & 0xe1f8 ; - - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameECX = regnamesshort[ECX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[0]; - RegnameECX = regnamesword[ECX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[0]; - RegnameECX = regnameslong[ECX]; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - if (Size != 'L') - TimingCycles += 6 ; - else - TimingCycles += 8 ; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - fprintf(fp, "\t\t shr ecx,byte 9\n"); - - if (ir == 0) - { - Immediate8(); - } - else - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - EffectiveAddressRead(0,'L',ECX,ECX,"-B--S-B",FALSE); - fprintf(fp, "\t\t and ecx,byte 63\n"); - } - - /* allow 2 cycles per shift */ - - fprintf(fp, "\t\t mov edx,ecx\n"); - fprintf(fp, "\t\t add edx,edx\n"); - fprintf(fp, "\t\t sub dword [%s],edx\n",ICOUNT); - - EffectiveAddressRead(0,Size,EBX,EAX,"-BC-SDB",FALSE); - - /* move X into C so RCR & RCL can be used */ - /* RCR & RCL only set the carry flag */ - - CopyX(); - - if (dr == 0) - fprintf(fp, "\t\t rcr %s,cl\n",Regname); - else - fprintf(fp, "\t\t rcl %s,cl\n",Regname); - - fprintf(fp, "\t\t setc ch\n"); - SetFlags(Size,EAX,TRUE,FALSE,FALSE); -/* fprintf(fp, "\t\t and dl,254\n"); Test Clears Carry */ - - EffectiveAddressWrite(0,Size,EBX,EAX,"--CDS-B",TRUE); - - /* if shift count is zero clear carry */ - - Label = GenerateLabel(0,1); - fprintf(fp, "\t\t test cl,cl\n"); - fprintf(fp, "\t\t jz %s\n",Label); - - /* Add in Carry Flag */ - - fprintf(fp, "\t\t or dl,ch\n"); - fprintf(fp, "\t\t mov [%s],dl\n",REG_X); - Completed(); - - - /* copy X onto C when shift is zero */ - - Align(); - fprintf(fp, "%s:\n",Label); - fprintf(fp, "\t\t mov ecx,[%s]\n",REG_X); - fprintf(fp, "\t\t and ecx,byte 1\n"); - fprintf(fp, "\t\t or edx,ecx\n"); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void roxl_roxr_ea(void) -{ - int Opcode, BaseCode ; - int dr, mode, sreg ; - int Dest ; - char allow[] = "--2345678-------" ; - - for (dr = 0 ; dr < 2 ; dr++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xe4c0 | (dr<<8) | (mode<<3) | sreg ; - BaseCode = Opcode & 0xfff8 ; - - if (mode == 7) - BaseCode |= sreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 8 ; - - fprintf(fp, "\t\t and ecx,byte 7\n"); - EffectiveAddressRead(Dest&0xf,'W',ECX,EAX,"--C-SDB",FALSE); - - /* move X into C so RCR & RCL can be used */ - /* RCR & RCL only set the carry flag */ - - CopyX(); - - if (dr == 0) - fprintf(fp, "\t\t rcr ax,1\n"); - else - fprintf(fp, "\t\t rcl ax,1\n"); - - fprintf(fp, "\t\t setc bl\n"); - SetFlags('W',EAX,TRUE,FALSE,FALSE); -/* fprintf(fp, "\t\t and dl,254\n"); - Intel Clears on Test */ - fprintf(fp, "\t\t or dl,bl\n"); - - EffectiveAddressWrite(Dest&0xf,'W',ECX,EAX,"---DS-B",TRUE); - - fprintf(fp, "\t\t mov [%s],edx\n",REG_X); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Arithmetic Shift Left / Right - * - */ - -void asl_asr(void) -{ - int Opcode, BaseCode ; - int dreg, dr, leng, ir, sreg ; - char Size=' '; - char * Sizename="" ; - char * Regname="" ; - char * RegnameEDX="" ; - char * RegnameECX="" ; - char * Label; - - /* Normal routines for codes */ - - for (dreg = 0 ; dreg < 8 ; dreg++) - for (dr = 0 ; dr < 2 ; dr++) - for (leng = 0 ; leng < 3 ; leng++) - for (ir = 0 ; ir < 2 ; ir++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xe000 | (dreg<<9) | (dr<<8) | (leng<<6) | (ir<<5) | sreg ; - BaseCode = Opcode & 0xe1f8 ; - - switch (leng) - { - case 0: - Size = 'B'; - Regname = regnamesshort[0]; - RegnameECX = regnamesshort[ECX]; - RegnameEDX = regnamesshort[EDX]; - break; - case 1: - Size = 'W'; - Regname = regnamesword[0]; - RegnameECX = regnamesword[ECX]; - RegnameEDX = regnamesword[EDX]; - break; - case 2: - Size = 'L'; - Regname = regnameslong[0]; - RegnameECX = regnameslong[ECX]; - RegnameEDX = regnameslong[EDX]; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - Label = GenerateLabel(0,1); - - if (Size != 'L') - TimingCycles += 6 ; - else - TimingCycles += 8 ; - - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - fprintf(fp, "\t\t shr ecx,byte 9\n"); - - EffectiveAddressRead(0,Size,EBX,EAX,"-BC-S-B",FALSE); - - if (ir == 0) - { - Immediate8(); - } - else - { - fprintf(fp, "\t\t and ecx,byte 7\n"); - EffectiveAddressRead(0,'L',ECX,ECX,"-B--S-B",FALSE); - fprintf(fp, "\t\t and ecx,byte 63\n"); - fprintf(fp, "\t\t jz short %s\n",Label); - } - - /* allow 2 cycles per shift */ - - fprintf(fp, "\t\t mov edx,ecx\n"); - fprintf(fp, "\t\t add edx,edx\n"); - fprintf(fp, "\t\t sub dword [%s],edx\n",ICOUNT); - - if (dr == 0) - { - /* ASR */ - - /* ASG: on the 68k, the shift count is mod 64; on the x86, the */ - /* shift count is mod 32; we need to check for shifts of 32-63 */ - /* and effectively shift 31 */ - fprintf(fp, "\t\t shrd edx,ecx,6\n"); - fprintf(fp, "\t\t sar edx,31\n"); - fprintf(fp, "\t\t and edx,31\n"); - fprintf(fp, "\t\t or ecx,edx\n"); - - fprintf(fp, "\t\t sar %s,cl\n",Regname); - - /* Mode 0 write does not affect Flags */ - EffectiveAddressWrite(0,Size,EBX,EAX,"---DS-B",TRUE); - - /* Update Flags */ - fprintf(fp, "\t\t lahf\n"); - -#ifdef STALLCHECK - ClearRegister(EDX); - fprintf(fp, "\t\t mov dl,ah\n"); -#else - fprintf(fp, "\t\t movzx edx,ah\n"); -#endif - - fprintf(fp, "\t\t mov [%s],edx\n",REG_X); - } - else - { - /* ASL */ - - /* Check to see if Overflow should be set */ - - fprintf(fp,"\t\t mov edi,eax\t\t; Save It\n"); - - ClearRegister(EDX); - fprintf(fp,"\t\t stc\n"); - fprintf(fp,"\t\t rcr %s,1\t\t; d=1xxxx\n",RegnameEDX); - fprintf(fp,"\t\t sar %s,cl\t\t; d=1CCxx\n",RegnameEDX); - fprintf(fp,"\t\t and eax,edx\n"); - fprintf(fp,"\t\t jz short %s_V\t\t; No Overflow\n",Label); - fprintf(fp,"\t\t cmp eax,edx\n"); - fprintf(fp,"\t\t je short %s_V\t\t; No Overflow\n",Label); - - /* Set Overflow */ - fprintf(fp,"\t\t mov edx,0x800\n"); - fprintf(fp,"\t\t jmp short %s_OV\n",Label); - - fprintf(fp,"%s_V:\n",Label); - ClearRegister(EDX); - - fprintf(fp,"%s_OV:\n",Label); - - /* more than 31 shifts and long */ - - if ((ir==1) && (leng==2)) - { - fprintf(fp,"\t\t test cl,0x20\n"); - fprintf(fp,"\t\t jnz short %s_32\n\n",Label); - } - - fprintf(fp,"\t\t mov eax,edi\t\t; Restore It\n"); - - fprintf(fp, "\t\t sal %s,cl\n",Regname); - - EffectiveAddressWrite(0,Size,EBX,EAX,"---DS-B",TRUE); - fprintf(fp, "\t\t lahf\n"); - fprintf(fp, "\t\t mov dl,ah\n"); - fprintf(fp, "\t\t mov [%s],edx\n",REG_X); - } - Completed(); - - if (ir != 0) - { - Align(); - fprintf(fp, "%s:\n",Label); - - - if (dr == 0) - { - /* ASR - Test clears V and C */ - SetFlags(Size,EAX,TRUE,FALSE,FALSE); - } - else - { - /* ASL - Keep existing Carry flag, Clear V */ - fprintf(fp, "\t\t mov ebx,edx\n"); - fprintf(fp, "\t\t and ebx,byte 1\n"); - SetFlags(Size,EAX,TRUE,FALSE,FALSE); - fprintf(fp, "\t\t or edx,ebx\n"); - - if (leng==2) - { - Completed(); - - /* > 31 Shifts */ - - fprintf(fp, "%s_32:\n",Label); - fprintf(fp, "\t\t mov dl,40h\n"); // Zero flag - ClearRegister(EAX); - EffectiveAddressWrite(0,Size,EBX,EAX,"----S-B",TRUE); - } - } - - Completed(); - } - } - - OpcodeArray[Opcode] = BaseCode ; - } - - /* End with special routines for ASL.x #1,Dx */ - /* To do correct V setting, ASL needs quite a */ - /* bit of additional code. A Shift of one has */ - /* correct flags on Intel, and is very common */ - /* in 68000 programs. */ - - for (leng = 0 ; leng < 3 ; leng++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xe300 | (leng<<6) | sreg ; - BaseCode = Opcode & 0xe3c8 ; - - switch (leng) - { - case 0: - Sizename = "byte"; - break; - case 1: - Sizename = "word"; - break; - case 2: - Sizename = "long"; - break; - } - - if (sreg == 0) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - Label = GenerateLabel(0,1); - - if (Size != 'L') - TimingCycles += 6 ; - else - TimingCycles += 8 ; - - fprintf(fp, "\t\t and ecx,byte 7\n"); - fprintf(fp, "\t\t sal %s [%s+ecx*4],1\n",Sizename,REG_DAT); - SetFlags('L',EAX,FALSE,TRUE,FALSE); - Completed(); - - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void asl_asr_ea(void) -{ - int Opcode, BaseCode ; - int dr, mode, sreg ; - int Dest ; - char allow[] = "--2345678-------" ; - - for (dr = 0 ; dr < 2 ; dr++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0xe0c0 | (dr<<8) | (mode<<3) | sreg ; - BaseCode = Opcode & 0xfff8 ; - - if (mode == 7) - BaseCode |= sreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest&0xf] != '-') - { - if (OpcodeArray[ BaseCode ] == -2) - { - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - TimingCycles += 8 ; - - fprintf(fp, "\t\t and ecx,byte 7\n"); - EffectiveAddressRead(Dest&0xf,'W',ECX,EAX,"--C-SDB",FALSE); - - if (dr == 0) - fprintf(fp, "\t\t sar ax,1\n"); - else - fprintf(fp, "\t\t sal ax,1\n"); - - SetFlags('W',EAX,FALSE,TRUE,TRUE); - - EffectiveAddressWrite(Dest&0xf,'W',ECX,EAX,"----S-B",FALSE); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Divide Commands - */ - -void divides(void) -{ - int dreg, type, mode, sreg ; - int Opcode, BaseCode ; - int Dest ; - char allow[] = "0-23456789ab-----" ; - char TrapLabel[16]; - int Cycles; - - int divide_cycles[12] = - { - 38,0,42,42,44,46,50,46,50,46,48,42 - }; - - for (dreg = 0 ; dreg < 8 ; dreg++) - for (type = 0 ; type < 2 ; type++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - { - Opcode = 0x80c0 | (dreg<<9) | (type<<8) | (mode<<3) | sreg ; - BaseCode = Opcode & 0x81f8 ; - if (mode == 7) - { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - if (allow[Dest&0x0f] != '-') - { - if (OpcodeArray[ BaseCode ] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t add esi,byte 2\n\n"); - - - /* Save EDX (in case of overflow) */ - - fprintf(fp, "\t\t and edx,byte -2\n"); - fprintf(fp, "\t\t mov [%s],edx\n",REG_CCR); - - - /* Cycle Timing (if succeeds OK) */ - - Cycles = divide_cycles[Dest & 0x0f] + 95 + (type * 17); - - if (Cycles > 127) - fprintf(fp, "\t\t sub dword [%s],%d\n",ICOUNT,Cycles); - else - fprintf(fp, "\t\t sub dword [%s],byte %d\n",ICOUNT,Cycles); - - if (mode < 7) - { - fprintf(fp, "\t\t mov ebx,ecx\n"); - fprintf(fp, "\t\t and ebx,byte 7\n"); - } - - fprintf(fp, "\t\t shr ecx, byte 9\n"); - fprintf(fp, "\t\t and ecx, byte 7\n"); - - sprintf(TrapLabel, "%s", GenerateLabel(0,1) ) ; - - EffectiveAddressRead(Dest,'W',EBX,EAX,"A-C-SDB",FALSE); /* source */ - - fprintf(fp, "\t\t test ax,ax\n"); - fprintf(fp, "\t\t je near %s_ZERO\t\t;do div by zero trap\n", TrapLabel); - - if (type == 1) /* signed */ - { - fprintf(fp, "\t\t movsx ebx,ax\n"); - } - else - { - fprintf(fp, "\t\t movzx ebx,ax\n"); - } - - EffectiveAddressRead(0,'L',ECX,EAX,"ABC-SDB",FALSE); /* dest */ - - if (type == 1) /* signed */ - { - fprintf(fp, "\t\t cdq\n"); /* EDX:EAX = 64 bit signed */ - fprintf(fp, "\t\t idiv ebx\n"); /* EBX = 32 bit */ - - /* Check for Overflow */ - - fprintf(fp, "\t\t movsx ebx,ax\n"); - fprintf(fp, "\t\t cmp eax,ebx\n"); - fprintf(fp, "\t\t jne short %s_OVER\n",TrapLabel); - } - else - { - ClearRegister(EDX); - fprintf(fp, "\t\t div ebx\n"); - - /* Check for Overflow */ - - fprintf(fp, "\t\t test eax, 0FFFF0000H\n"); - fprintf(fp, "\t\t jnz short %s_OVER\n",TrapLabel); - } - - /* Sort out Result */ - - fprintf(fp, "\t\t shl edx, byte 16\n"); - fprintf(fp, "\t\t mov dx,ax\n"); - fprintf(fp, "\t\t mov [%s+ECX*4],edx\n",REG_DAT); - SetFlags('W',EDX,TRUE,FALSE,FALSE); - - Completed(); - - - /* Overflow */ - - Align(); - fprintf(fp, "%s_OVER:\n",TrapLabel); - fprintf(fp, "\t\t mov edx,[%s]\n",REG_CCR); - fprintf(fp, "\t\t or edx,0x0800\t\t;V flag\n"); - Completed(); - - - /* Division by Zero */ - - Align(); - fprintf(fp, "%s_ZERO:\t\t ;Do divide by zero trap\n", TrapLabel); - - /* Correct cycle counter for error */ - - fprintf(fp, "\t\t add dword [%s],byte %d\n",ICOUNT,95 + (type * 17)); - fprintf(fp, "\t\t mov al,5\n"); - Exception(-1,BaseCode); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - - -/* - * 68010 Extra Opcodes - * - * move from CCR is done above - * - */ - -void ReturnandDeallocate(void) -{ - int BaseCode = 0x4e74 ; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - CheckCPUtype(1); - - SavePreviousPC(); - - TimingCycles += 16; - - OpcodeArray[BaseCode] = BaseCode ; - - /* Get Return Address */ - - fprintf(fp, "\t\t mov eax,[%s]\n",REG_A7); - Memory_Read('L',EAX,"---D--B",1); - - - /* Get Displacement */ - - Memory_Fetch('W',EBX,TRUE); - - - /* Set PC = New Address */ - - fprintf(fp, "\t\t mov esi,eax\n"); - - - /* Correct Stack for Return Address and Displacement */ - - fprintf(fp, "\t\t add ebx,byte 4\n"); - fprintf(fp, "\t\t add dword [%s],ebx\n",REG_A7); - - MemoryBanking(BaseCode); - Completed(); - } -} - -void MoveControlRegister(void) -{ - int Direction; - int BaseCode = 0x4e7a ; - - for (Direction=0;Direction<2;Direction++) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode+Direction,0)); - - TimingCycles += 4; /* Assume same as move usp */ - - CheckCPUtype(1); - - fprintf(fp, "\t\t test byte [%s],20h \t\t\t; Supervisor Mode ?\n",REG_SRH); - fprintf(fp, "\t\t jz short OP%d_%4.4x_Trap\n",CPU,BaseCode+Direction); - - fprintf(fp, "\t\t add esi,byte 2\n"); - if (CPU==2) - fprintf(fp, "\t\t xor esi,2\n"); /* ASG */ -#ifdef STALLCHECK - ClearRegister(EBX); - fprintf(fp, "\t\t mov bx,[esi+ebp]\n"); -#else - fprintf(fp, "\t\t movzx ebx,word [esi+ebp]\n"); -#endif - if (CPU==2) - fprintf(fp, "\t\t xor esi,2\n"); /* ASG */ - - fprintf(fp, "\t\t add esi,byte 2\n"); - fprintf(fp, "\t\t mov eax,ebx\n"); - fprintf(fp, "\t\t mov ecx,ebx\n"); - - /* Sort out Register */ - - fprintf(fp, "\t\t shr ebx,12\n"); - - /* Sort out Control Register ID */ - - fprintf(fp, "\t\t and eax,byte 1\n"); - fprintf(fp, "\t\t shr ecx,10\n"); - fprintf(fp, "\t\t and ecx,2\n"); - fprintf(fp, "\t\t or ecx,eax\n"); - - if (Direction==0) - { - /* from Control */ - - fprintf(fp, "\t\t mov eax,[%s+ecx*4]\n",REG_SFC); - fprintf(fp, "\t\t mov %s,eax\n",REG_DAT_EBX); - } - else - { - /* To Control */ - - fprintf(fp, "\t\t mov eax,%s\n",REG_DAT_EBX); - - /* Mask out for SFC & DFC */ - - fprintf(fp, "\t\t test cl,2\n"); - fprintf(fp, "\t\t jne short OP%d_%4.4x_Mask\n",CPU,BaseCode+Direction); - fprintf(fp, "\t\t and eax,byte 7\n"); - fprintf(fp, "OP%d_%4.4x_Mask:\n",CPU,BaseCode+Direction); - - /* Write to control */ - - fprintf(fp, "\t\t mov [%s+ecx*4],eax\n",REG_SFC); - } - - Completed(); - - /* Not Supervisor Mode */ - - Align(); - fprintf(fp, "OP%d_%4.4x_Trap:\n",CPU,BaseCode+Direction); - Exception(8,BaseCode+Direction); - - OpcodeArray[BaseCode+Direction] = BaseCode+Direction; - } -} - -void MoveAddressSpace(void) -{ -} - -/* - * Generate Jump Table - * - */ - -void JumpTable(void) -{ - int Opcode,l,op; - - fprintf(fp, "DD OP%d_1000\n",CPU); - - l = 0 ; - for (Opcode=0x0;Opcode<0x10000;) - { - - op = OpcodeArray[Opcode]; - - fprintf(fp, "DD "); - - l = 1 ; - while (op == OpcodeArray[Opcode+l] && ((Opcode+l) & 0xfff) != 0) - { - l++ ; - } - - Opcode += l ; - - if (l > 255) - { - if (op > -1) - fprintf(fp, "OP%d_%4.4x - OP%d_1000\n",CPU,op,CPU); - else - fprintf(fp, "ILLEGAL - OP%d_1000\n",CPU); - - fprintf(fp, "DW %d\n", l); - } - else - { - if (op > -1) - fprintf(fp, "(OP%d_%4.4x - OP%d_1000) + (%d * 1000000h)\n",CPU,op,CPU,l); - else - fprintf(fp, "(ILLEGAL - OP%d_1000) + (%d * 1000000h)\n",CPU,l); - } - } -} - -void CodeSegmentBegin(void) -{ -/* Messages */ - - fprintf(fp, "; Make68K - V%s - Copyright 1998, Mike Coates (mame@btinternet.com)\n", VERSION); - fprintf(fp, "; & Darren Olafson (deo@mail.island.net)\n\n"); - -/* Needed code to make it work! */ - - fprintf(fp, "\t\t BITS 32\n\n"); - - fprintf(fp, "\t\t GLOBAL %s_RUN\n",CPUtype); - fprintf(fp, "\t\t GLOBAL %s_RESET\n",CPUtype); - fprintf(fp, "\t\t GLOBAL %s_regs\n",CPUtype); - fprintf(fp, "\t\t GLOBAL %s_COMPTABLE\n",CPUtype); - fprintf(fp, "\t\t GLOBAL %s_OPCODETABLE\n",CPUtype); - - /* ASG - only one interface to memory now */ - fprintf(fp, "\t\t EXTERN %sm68k_ICount\n", PREF); - fprintf(fp, "\t\t EXTERN %sa68k_memory_intf\n", PREF); - fprintf(fp, "\t\t EXTERN %smem_amask\n", PREF); - - fprintf(fp, "; Vars Mame declares / needs access to\n\n"); - - fprintf(fp, "\t\t EXTERN %smame_debug\n", PREF); - fprintf(fp, "\t\t EXTERN %sillegal_op\n", PREF); - fprintf(fp, "\t\t EXTERN %sillegal_pc\n", PREF); - - fprintf(fp, "\t\t EXTERN %sOP_ROM\n", PREF); - fprintf(fp, "\t\t EXTERN %sOP_RAM\n", PREF); - - fprintf(fp, "\t\t EXTERN %sopcode_entry\n", PREF); -// fprintf(fp, "\t\t EXTERN %scur_mrhard\n", PREF); - -#ifdef MAME_DEBUG - fprintf(fp, "\t\t EXTERN %sm68k_illegal_opcode\n", PREF); -#endif - -#ifdef OS2 - fprintf(fp, "\t\t SECTION maincode USE32 FLAT CLASS=CODE\n\n"); -#else - fprintf(fp, "\t\t SECTION .text\n\n"); -#endif - - - -/* Reset routine */ - - fprintf(fp, "%s_RESET:\n",CPUtype); - - fprintf(fp, "\t\t pushad\n\n"); - - fprintf(fp, "; Build Jump Table (not optimised!)\n\n"); - - fprintf(fp, "\t\t lea edi,[%s_OPCODETABLE]\t\t; Jump Table\n", CPUtype); - fprintf(fp, "\t\t lea esi,[%s_COMPTABLE]\t\t; RLE Compressed Table\n", CPUtype); - - /* Reference Point in EBP */ - - fprintf(fp, "\t\t mov ebp,[esi]\n"); - fprintf(fp, "\t\t add esi,byte 4\n"); - - fprintf(fp, "RESET0:\n"); - fprintf(fp, "\t\t mov eax,[esi]\n"); - fprintf(fp, "\t\t mov ecx,eax\n"); - fprintf(fp, "\t\t and eax,0xffffff\n"); - fprintf(fp, "\t\t add eax,ebp\n"); - fprintf(fp, "\t\t add esi,byte 4\n"); - - /* if count is zero, then it's a word RLE length */ - - fprintf(fp, "\t\t shr ecx,24\n"); - fprintf(fp, "\t\t jne short RESET1\n"); - -#ifdef STALLCHECK - ClearRegister(ECX); - fprintf(fp, "\t\t mov cx,[esi]\t\t; Repeats\n"); -#else - fprintf(fp, "\t\t movzx ecx,word [esi]\t\t; Repeats\n"); -#endif - - fprintf(fp, "\t\t add esi,byte 2\n"); - fprintf(fp, "\t\t jecxz RESET2\t\t; Finished!\n"); - - fprintf(fp, "RESET1:\n"); - fprintf(fp, "\t\t mov [edi],eax\n"); - fprintf(fp, "\t\t add edi,byte 4\n"); - fprintf(fp, "\t\t dec ecx\n"); - fprintf(fp, "\t\t jnz short RESET1\n"); - fprintf(fp, "\t\t jmp short RESET0\n"); - - fprintf(fp, "RESET2:\n"); - fprintf(fp, "\t\t popad\n"); - fprintf(fp, "\t\t ret\n\n"); - -/* Emulation Entry Point */ - - Align(); - - fprintf(fp, "%s_RUN:\n",CPUtype); - - fprintf(fp, "\t\t pushad\n"); - fprintf(fp, "\t\t mov esi,[%s]\n",REG_PC); - fprintf(fp, "\t\t mov edx,[%s]\n",REG_CCR); - fprintf(fp, "\t\t mov ebp,dword [%sOP_ROM]\n", PREF); - - fprintf(fp,"; Check for Interrupt waiting\n\n"); - fprintf(fp,"\t\t test [%s],byte 07H\n",REG_IRQ); - fprintf(fp,"\t\t jne near interrupt\n\n"); - - fprintf(fp, "IntCont:\n"); - - /* See if was only called to check for Interrupt */ - - fprintf(fp, "\t\t test dword [%s],-1\n",ICOUNT); - fprintf(fp, "\t\t js short MainExit\n\n"); - -#ifdef FBA_DEBUG - - fprintf(fp, "\n\t\t test byte [%smame_debug],byte 0xff\n", PREF); - fprintf(fp, "\t\t jns near .NoDebug\n"); - fprintf(fp, "\t\t call near FBADebugActive\n\n"); - fprintf(fp, ".NoDebug\n"); - -#endif - - if(CPU==2) - { - /* 32 Bit */ - fprintf(fp, "\t\t mov eax,2\n"); /* ASG */ - fprintf(fp, "\t\t xor eax,esi\n"); /* ASG */ -#ifdef STALLCHECK - ClearRegister(ECX); - fprintf(fp, "\t\t mov cx,[eax+ebp]\n"); -#else - fprintf(fp, "\t\t movzx ecx,word [eax+ebp]\n"); -#endif - } - else - { - /* 16 Bit Fetch */ -#ifdef STALLCHECK - ClearRegister(ECX); - fprintf(fp, "\t\t mov cx,[esi+ebp]\n"); -#else - fprintf(fp, "\t\t movzx ecx,word [esi+ebp]\n"); -#endif - } - fprintf(fp, "\t\t jmp [%s_OPCODETABLE+ecx*4]\n", CPUtype); - - Align(); - - fprintf(fp, "MainExit:\n"); - fprintf(fp, "\t\t mov [%s],esi\t\t; Save PC\n",REG_PC); - fprintf(fp, "\t\t mov [%s],edx\n",REG_CCR); - fprintf(fp, "\t\t test byte [%s],20H\n",REG_SRH); - fprintf(fp, "\t\t mov eax,[%s]\t\t; Get A7\n",REG_A7); - fprintf(fp, "\t\t jne short ME1\t\t; Mode ?\n"); - fprintf(fp, "\t\t mov [%s],eax\t\t;Save in USP\n",REG_USP); - fprintf(fp, "\t\t jmp short MC68Kexit\n"); - fprintf(fp, "ME1:\n"); - fprintf(fp, "\t\t mov [%s],eax\n",REG_ISP); - fprintf(fp, "MC68Kexit:\n"); - - /* If in Debug mode make normal SR register */ - -#ifdef MAME_DEBUG - - ReadCCR('W', ECX); - fprintf(fp, "\t\t mov [%s],eax\n\n",REG_S); - -#endif - - fprintf(fp, "\t\t popad\n"); - fprintf(fp, "\t\t ret\n"); - -/* Check for Pending Interrupts */ - - Align(); - fprintf(fp, "; Interrupt check\n\n"); - - fprintf(fp, "interrupt:\n"); - - /* check to exclude interrupts */ - - fprintf(fp, "\t\t mov eax,[%s]\n",REG_IRQ); - fprintf(fp, "\t\t and eax,byte 07H\n"); - - fprintf(fp, "\t\t cmp al,7\t\t ; Always take 7\n"); - fprintf(fp, "\t\t je short procint\n\n"); - - fprintf(fp, "\t\t mov ebx,[%s]\t\t; int mask\n",REG_SRH); - fprintf(fp, "\t\t and ebx,byte 07H\n"); - fprintf(fp, "\t\t cmp eax,ebx\n"); - fprintf(fp, "\t\t jle near IntCont\n\n"); - - /* Take pending Interrupt */ - - Align(); - fprintf(fp, "procint:\n"); - - /* LVR - Enable proper IRQ handling (require explicit acknowledge) */ - /* fprintf(fp, "\t\t and byte [%s],78h\t\t; remove interrupt & stop\n\n",REG_IRQ); */ - fprintf(fp, "\t\t and byte [%s],7fh\t\t; remove stop\n\n",REG_IRQ); - - /* Get Interrupt Vector from callback */ - - fprintf(fp, "\t\t push eax\t\t; save level\n\n"); - - if (SavedRegs[EBX] == '-') - { - fprintf(fp, "\t\t push EBX\n"); - } - else - { - fprintf(fp, "\t\t mov ebx,eax\n"); - } - - if (SavedRegs[ESI] == '-') - { - fprintf(fp, "\t\t mov [%s],ESI\n",REG_PC); - } - - if (SavedRegs[EDX] == '-') - { - fprintf(fp, "\t\t mov [%s],edx\n",REG_CCR); - } - -/* ----- Win32 uses FASTCALL (By Kenjo)----- */ - -#ifdef FASTCALL - fprintf(fp, "\t\t mov %s, eax\t\t; irq line #\n",FASTCALL_FIRST_REG); - fprintf(fp, "\t\t call dword [%s]\t; get the IRQ level\n", REG_IRQ_CALLBACK); -#else - fprintf(fp, "\t\t push eax\t\t; irq line #\n"); - fprintf(fp, "\t\t call dword [%s]\t; get the IRQ level\n", REG_IRQ_CALLBACK); - fprintf(fp, "\t\t lea esp,[esp+4]\n"); -#endif - - if (SavedRegs[EDX] == '-') - { - fprintf(fp, "\t\t mov edx,[%s]\n",REG_CCR); - } - - if (SavedRegs[ESI] == '-') - { - fprintf(fp, "\t\t mov esi,[%s]\n",REG_PC); - } - - /* Do we want to use normal vector number ? */ - - - fprintf(fp, "\t\t test eax,eax\n"); - fprintf(fp, "\t\t jns short AUTOVECTOR\n"); - - /* Only need EBX restored if default vector to be used */ - - if (SavedRegs[EBX] == '-') - { - fprintf(fp, "\t\t pop EBX\n"); - } - - /* Just get default vector */ - - fprintf(fp, "\t\t mov eax,ebx\n"); - - fprintf(fp, "\t\t add eax,byte 24\t\t; Vector\n\n"); - - fprintf(fp, "AUTOVECTOR:\n\n"); - - Exception(-1,0xFFFF); - - fprintf(fp, "\t\t pop eax\t\t; set Int mask\n"); - fprintf(fp, "\t\t mov bl,byte [%s]\n",REG_SRH); - fprintf(fp, "\t\t and bl,0F8h\n"); - fprintf(fp, "\t\t or bl,al\n"); - fprintf(fp, "\t\t mov byte [%s],bl\n\n",REG_SRH); - fprintf(fp, "\t\t jmp IntCont\n\n"); - -/* Exception Routine */ - - Align(); - fprintf(fp, "Exception:\n"); - fprintf(fp, "\t\t push edx\t\t; Save flags\n"); - fprintf(fp, "\t\t and eax,0FFH\t\t; Zero Extend IRQ Vector\n"); - - fprintf(fp, "\t\t push eax\t\t; Save for Later\n"); - - /* Update Cycle Count */ - - fprintf(fp, "\t\t mov al,[exception_cycles+eax]\t\t; Get Cycles\n"); - fprintf(fp, "\t\t sub [%s],eax\t\t; Decrement ICount\n",ICOUNT); - - ReadCCR('W',ECX); - - fprintf(fp, "\t\t mov edi,[%s]\t\t; Get A7\n",REG_A7); - - fprintf(fp, "\t\t test ah,20H\t; Which Mode ?\n"); - fprintf(fp, "\t\t jne short ExSuperMode\t\t; Supervisor\n"); - - fprintf(fp, "\t\t or byte [%s],20H\t; Set Supervisor Mode\n",REG_SRH); - fprintf(fp, "\t\t mov [%s],edi\t\t; Save in USP\n",REG_USP); - fprintf(fp, "\t\t mov edi,[%s]\t\t; Get ISP\n",REG_ISP); - - /* Write SR first (since it's in a register) */ - - fprintf(fp, "ExSuperMode:\n"); - fprintf(fp, "\t\t sub edi,byte 6\n"); - fprintf(fp, "\t\t mov [%s],edi\t\t; Put in A7\n",REG_A7); - Memory_Write('W',EDI,EAX,"----S-B",2); - - /* Then write PC */ - - fprintf(fp, "\t\t add edi,byte 2\n"); - Memory_Write('L',EDI,ESI,"------B",0); - - /* Get new PC */ - - fprintf(fp, "\t\t pop eax\t\t;Level\n"); - fprintf(fp, "\t\t shl eax,2\n"); - fprintf(fp, "\t\t add eax,[%s]\n",REG_VBR); /* 68010+ Vector Base */ - - /* Direct Read */ - - Memory_Read('L',EAX,"------B",0); - - fprintf(fp, "\t\t mov esi,eax\t\t;Set PC\n"); - fprintf(fp, "\t\t pop edx\t\t; Restore flags\n"); - - /* Sort out any bank changes */ - MemoryBanking(1); - - fprintf(fp, "\t\t ret\n"); - -#ifdef FBA_DEBUG - - fprintf(fp,"\n; Call FBA debugging callback\n\n"); - fprintf(fp, "FBADebugActive:"); - fprintf(fp, "\t\t mov [%s],ESI\n",REG_PC); - fprintf(fp, "\t\t mov [%s],EDX\n",REG_CCR); - fprintf(fp, "\t\t call [%sa68k_memory_intf+0]\n", PREF); - if (SavedRegs[EDX] == '-') - { - fprintf(fp, "\t\t mov EDX,[%s]\n",REG_CCR); - } - if (SavedRegs[ESI] == '-') - { - fprintf(fp, "\t\t mov ESI,[%s]\n",REG_PC); - } - if (SavedRegs[EBP] == '-') - { - fprintf(fp, "\t\t mov ebp,dword [%sOP_ROM]\n", PREF); - } - fprintf(fp,"\n; Now continue as usual\n\n"); - fprintf(fp, "\t\t ret\n"); - -#endif - -} - -void CodeSegmentEnd(void) -{ -#ifdef OS2 - fprintf(fp, "\t\t SECTION maindata USE32 FLAT CLASS=DATA\n\n"); -#else - fprintf(fp, "\t\t SECTION .data\n"); -#endif - - fprintf(fp, "\n\t\t align 16\n"); - fprintf(fp, "%s_ICount\n",CPUtype); - fprintf(fp, "asm_count\t DD 0\n\n"); - - /* Memory structure for 68000 registers */ - /* Same layout as structure in CPUDEFS.H */ - - fprintf(fp, "\n\n; Register Structure\n\n"); - fprintf(fp, "%s_regs\n",CPUtype); - - fprintf(fp, "R_D0\t DD 0\t\t\t ; Data Registers\n"); - fprintf(fp, "R_D1\t DD 0\n"); - fprintf(fp, "R_D2\t DD 0\n"); - fprintf(fp, "R_D3\t DD 0\n"); - fprintf(fp, "R_D4\t DD 0\n"); - fprintf(fp, "R_D5\t DD 0\n"); - fprintf(fp, "R_D6\t DD 0\n"); - fprintf(fp, "R_D7\t DD 0\n\n"); - - fprintf(fp, "R_A0\t DD 0\t\t\t ; Address Registers\n"); - fprintf(fp, "R_A1\t DD 0\n"); - fprintf(fp, "R_A2\t DD 0\n"); - fprintf(fp, "R_A3\t DD 0\n"); - fprintf(fp, "R_A4\t DD 0\n"); - fprintf(fp, "R_A5\t DD 0\n"); - fprintf(fp, "R_A6\t DD 0\n"); - fprintf(fp, "R_A7\t DD 0\n\n"); - - fprintf(fp, "R_ISP\t DD 0\t\t\t ; Supervisor Stack\n"); - fprintf(fp, "R_SR_H\t DD 0\t\t\t ; Status Register High TuSuuIII\n"); - fprintf(fp, "R_CCR\t DD 0\t\t\t ; CCR Register in Intel Format\n"); - fprintf(fp, "R_XC\t DD 0\t\t\t ; Extended Carry uuuuuuuX\n"); - - fprintf(fp, "R_PC\t DD 0\t\t\t ; Program Counter\n"); - fprintf(fp, "R_IRQ\t DD 0\t\t\t ; IRQ Request Level\n\n"); - fprintf(fp, "R_SR\t DD 0\t\t\t ; Motorola Format SR\n\n"); - - fprintf(fp, "R_IRQ_CALLBACK\t DD 0\t\t\t ; irq callback (get vector)\n\n"); - - fprintf(fp, "R_PPC\t DD 0\t\t\t ; Previous Program Counter\n"); - - fprintf(fp, "R_RESET_CALLBACK\t DD 0\t\t\t ; Reset Callback\n"); - - fprintf(fp, "R_SFC\t DD 0\t\t\t ; Source Function Call\n"); - fprintf(fp, "R_DFC\t DD 0\t\t\t ; Destination Function Call\n"); - fprintf(fp, "R_USP\t DD 0\t\t\t ; User Stack\n"); - fprintf(fp, "R_VBR\t DD 0\t\t\t ; Vector Base\n"); - - fprintf(fp, "asmbank\t DD 0\n\n"); - fprintf(fp, "CPUversion\t DD 0\n\n"); - fprintf(fp, "FullPC\t DD 0\n\n"); - - /* Extra space for variables mame uses for debugger */ - - fprintf(fp, "\t\t DD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"); - fprintf(fp, "\t\t DD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"); - fprintf(fp, "\t\t DD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"); - fprintf(fp, "\t\t DD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"); - fprintf(fp, "\t\t DD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"); - fprintf(fp, "\t\t DD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"); - fprintf(fp, "\t\t DD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"); - fprintf(fp, "\t\t DD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\n"); - - /* Safe Memory Locations */ - - fprintf(fp, "\t\t ALIGN 16\n"); - - fprintf(fp, "\n\nIntelFlag\t\t\t\t; Intel Flag Lookup Table\n"); - fprintf(fp, "\t\t DD 0000h,0001h,0800h,0801h,0040h,0041h,0840h,0841h\n"); - fprintf(fp, "\t\t DD 0080h,0081h,0880h,0881h,00C0h,00C1h,08C0h,08C1h\n"); - fprintf(fp, "\t\t DD 0100h,0101h,0900h,0901h,0140h,0141h,0940h,0941h\n"); - fprintf(fp, "\t\t DD 0180h,0181h,0980h,0981h,01C0h,01C1h,09C0h,09C1h\n"); - -#if 0 - fprintf(fp, "\n\nImmTable\n"); - fprintf(fp, "\t\t DD 8,1,2,3,4,5,6,7\n\n"); -#endif - - - - /* Exception Timing Table */ - - fprintf(fp, "exception_cycles\n"); - fprintf(fp, "\t\t DB 0, 0, 0, 0, 38, 42, 44, 38, 38, 0, 38, 38, 0, 0, 0, 0\n"); - fprintf(fp, "\t\t DB 0, 0, 0, 0, 0, 0, 0, 0, 46, 46, 46, 46, 46, 46, 46, 46\n"); - fprintf(fp, "\t\t DB 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38\n\n"); - - fprintf(fp, "; RLE Compressed Jump Table\n\n"); - - fprintf(fp, "%s_COMPTABLE\n\n", CPUtype); - - fprintf(fp, "%cinclude '%s'\n\n",'%', comptab); - - fprintf(fp, "\t\tDW 0,0,0\n\n"); - - -/* If using Windows, put the table area in .data section (Kenjo) */ -#ifdef WIN32 - - fprintf(fp, "%s_OPCODETABLE\tTIMES 65536 DD 0\n\n", CPUtype); - -#else - -#ifdef OS2 - fprintf(fp, "\t\t SECTION tempdata USE32 FLAT CLASS=BSS\n\n"); -#else - fprintf(fp, "\t\t SECTION .bss\n"); -#endif - - fprintf(fp, "%s_OPCODETABLE\tRESD 65536\n\n", CPUtype); - -#endif - -} - -void EmitCode(void) -{ - CodeSegmentBegin(); - - /* Instructions */ - - moveinstructions(); /* 1000 to 3FFF MOVE.X */ - immediate(); /* 0### XXX.I */ - bitdynamic(); /* 0### dynamic bit operations */ - movep(); /* 0### Move Peripheral */ - bitstatic(); /* 08## static bit operations */ - LoadEffectiveAddress(); /* 4### */ - PushEffectiveAddress(); /* ???? */ - movesr(); /* 4#C# */ - opcode5(); /* 5000 to 5FFF ADDQ,SUBQ,Scc and DBcc */ - branchinstructions(); /* 6000 to 6FFF Bcc,BSR */ - moveq(); /* 7000 to 7FFF MOVEQ */ - abcd_sbcd(); /* 8### Decimal Add/Sub */ - typelogicalmath(); /* Various ranges */ - addx_subx(); - divides(); - swap(); - not(); /* also neg negx clr */ - moveusp(); - chk(); - exg(); - cmpm(); - mul(); - ReturnandRestore(); - rts(); - jmp_jsr(); - nbcd(); - tas(); - trap(); - trapv(); - reset(); - nop(); - stop(); - ext(); - ReturnFromException(); - tst(); - movem_reg_ea(); - movem_ea_reg(); - link(); - unlinkasm(); - asl_asr(); /* E### Shift Commands */ - asl_asr_ea(); - roxl_roxr(); - roxl_roxr_ea(); - lsl_lsr(); - lsl_lsr_ea(); - rol_ror(); - rol_ror_ea(); - LineA(); /* A000 to AFFF Line A */ - LineF(); /* F000 to FFFF Line F */ - illegal_opcode(); - - ReturnandDeallocate(); /* 68010 Commands */ - MoveControlRegister(); - MoveAddressSpace(); - - if(CPU==2) /* 68020 Commands */ - { - divl(); - mull(); - bfext(); - } - - CodeSegmentEnd(); -} - -int main(int argc, char **argv) -{ - int dwLoop; - - printf("\nMake68K - V%s - Copyright 1998, Mike Coates (mame@btinternet.com)\n", VERSION); - printf(" 1999, & Darren Olafson (deo@mail.island.net)\n"); - printf(" 2000\n"); - - if (argc != 4 && argc != 5) - { - printf("Usage: %s outfile jumptable-outfile type [ppro]\n", argv[0]); - exit(1); - } - - printf("Building 680%s 2001\n\n",argv[3]); - - for (dwLoop=0;dwLoop<65536;) OpcodeArray[dwLoop++] = -2; - - codebuf=malloc(64); - if (!codebuf) - { - printf ("Memory allocation error\n"); - exit(3); - } - - /* Emit the code */ - fp = fopen(argv[1], "w"); - if (!fp) - { - fprintf(stderr, "Can't open %s for writing\n", argv[1]); - exit(1); - } - - comptab = argv[2]; - - - CPUtype = malloc(64); - - sprintf(CPUtype,"%sM680%s", PREF, argv[3]); - - if(argv[3][0]=='2') CPU = 2; - if(argc > 4 && !strcmp(argv[4], "ppro")) - { - ppro = 1; - printf("Generating ppro opcodes\n"); - } - - EmitCode(); - - fclose(fp); - - printf("\n%d Unique Opcodes\n",Opcount); - - /* output Jump table to separate file */ - fp = fopen(argv[2], "w"); - if (!fp) - { - fprintf(stderr, "Can't open %s for writing\n", argv[2]); - exit(1); - } - - JumpTable(); - - fclose(fp); - - exit(0); -} diff --git a/jan/src/cpu/a68k/mips/a68k.s b/jan/src/cpu/a68k/mips/a68k.s deleted file mode 100644 index e59ed34f7..000000000 --- a/jan/src/cpu/a68k/mips/a68k.s +++ /dev/null @@ -1,73628 +0,0 @@ - # MIPS Make68K - V0.30 - Copyright 2005, Manuel Geran (bdiamond@free.fr) - # based on Make68K - Copyright 1998, Mike Coates (mame@btinternet.com) - # & Darren Olafson (deo@mail.island.net) - .set arch=allegrex - - .set noreorder - .set nomacro - .set nobopt - # .set noat - - .globl M68000_RUN - .globl M68000_RESET - .globl M68000_regs - .globl M68000_OPCODETABLE - .globl a68k_memory_intf - - - # Vars Mame declares / needs access to - - .extern m68k_ICount,4 - .extern OP_ROM,4 - .extern OP_RAM,4 - .extern mem_amask,4 - .extern mame_debug,4 - .extern illegal_op,4 - .extern illegal_pc,4 - .extern opcode_entry,4 - .extern cur_mrhard,4 - - - - .text - - .ent M68000_RESET -M68000_RESET: - .frame $29, 0, $31 - jr $31 - nop # Delay slot - - .end M68000_RESET - - - .ent M68000_RUN -M68000_RUN: - addiu $29,$29,-112 - .frame $29, 112, $31 - - sw $16,0x48($29) - sw $17,0x4C($29) - sw $18,0x50($29) - sw $19,0x54($29) - sw $20,0x58($29) - sw $21,0x5C($29) - sw $22,0x60($29) - sw $23,0x64($29) - sw $30,0x68($29) - sw $31,0x6C($29) - la $21,M68000_regs - lbu $8,0x50($21) - xori $9,$8,0x80 - lw $15,m68k_ICount - beq $9,$0,MC68Kexit - movz $15,$0,$9 # Delay slot - la $30,M68000_OPCODETABLE - lw $22,OP_ROM - lw $23,0x4C($21) - lw $2,0x48($21) - addu $23,$22,$23 - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - # Check for Interrupt waiting - - andi $8,$8,0x07 - bne $8,$0,interrupt - - nop # Delay slot - -IntCont: - bltz $15,MainExit - lhu $24,0x00($23) # Delay slot - - sll $7,$24,2 - addu $7,$7,$30 - - lw $7,0x00($7) - - jr $7 - nop # Delay slot - -MainExit: - subu $23,$23,$22 - sw $23,0x4C($21) # Save PC - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - lw $8,0x44($21) - sw $2,0x48($21) - andi $8,$8,0x20 - bne $8,$0,ME1 # Mode ? - lw $2,0x3C($21) # Delay slot - Get A7 - bgez $0,MC68Kexit - sw $2,0x68($21) # Delay slot - Save in USP -ME1: - sw $2,0x40($21) # Save in ISP -MC68Kexit: - sw $15,m68k_ICount - lw $16,0x48($29) - lw $17,0x4C($29) - lw $18,0x50($29) - lw $19,0x54($29) - lw $20,0x58($29) - lw $21,0x5C($29) - lw $22,0x60($29) - lw $23,0x64($29) - lw $30,0x68($29) - lw $31,0x6C($29) - jr $31 - addiu $29,$29,112 # Delay slot - .end M68000_RUN - - - # Interrupt check - -interrupt: - lbu $9,0x50($21) - andi $2,$9,0x07 - xori $8,$2,0x07 # Always take 7 - beq $8,$0,procint - nop # Delay slot - - lbu $3,0x44($21) # int mask - andi $3,$3,0x07 - subu $8,$2,$3 - blez $8,IntCont - nop # Delay slot - -procint: - andi $9,$9,0x7f # remove stop - sb $9,0x50($21) - - lw $25,0x54($21) - sw $2,0x44($29) # save level - - sw $2,0x40($29) - sw $15,m68k_ICount - jalr $25 # get the IRQ level - or $4,$0,$2 # irq line # Delay slot - lw $15,m68k_ICount - bgez $2,AUTOVECTOR - lw $3,0x40($29) # Delay slot - addiu $2,$3,24 # Vector - -AUTOVECTOR: - - jal Exception - nop # Delay slot - - lbu $3,0x44($21) # set Int mask - lw $2,0x44($29) - andi $3,$3,0xF8 - or $3,$3,$2 - bgez $0,IntCont - sb $3,0x44($21) # Delay slot - - .ent Exception -Exception: - addiu $29,$29,-48 - .frame $29, 48, $31 - - sw $31,0x2C($29) - sb $2,0x28($29) # Save IRQ Vector for Later - la $8,exception_cycles - addu $2,$2,$8 - lbu $2,0x00($2) # Get Cycles - subu $15,$15,$2 # Decrement ICount - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - andi $25,$2,0x2000 # Which Mode ? - bne $25,$0,ExSuperMode # Supervisor - lw $4,0x3C($21) # Delay slot - Get A7 - srl $25,$2,8 - ori $25,$25,0x20 - sb $25,0x44($21) # Set Supervisor Mode - sw $4,0x68($21) # Save in USP - lw $4,0x40($21) # Get ISP -ExSuperMode: - addiu $4,$4,-6 - sw $4,0x3C($21) # Put in A7 - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $4,0x24($29) - or $5,$0,$2 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $4,0x24($29) - lw $15,m68k_ICount - subu $5,$23,$22 - addiu $4,$4,2 - lw $25,0x90($21) - sw $15,m68k_ICount - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - lbu $2,0x28($29) # Level - lw $25,0x6C($21) - sll $2,$2,2 - addu $4,$2,$25 - lw $25,0x84($21) - sw $15,m68k_ICount - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x01 - beq $25,$0,2f - addu $23,$22,$2 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $2,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$2,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - lw $31,0x2C($29) - jr $31 - addiu $29,$29,48 # Delay slot - - .end Exception - - - - -OP0_1000: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1010: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1018: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_101f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1020: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1027: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1028: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1030: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1038: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1039: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_103a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_103b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_103c: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sb $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1080: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1090: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1098: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_109f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10a0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10a7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10a8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10b0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10ba: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10bb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10bc: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10c0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10d0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10d8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10e0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10e8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10f0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_10fc: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1100: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1110: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1118: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_111f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1120: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1127: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1128: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1130: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1138: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1139: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_113a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_113b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_113c: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1140: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1150: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1158: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_115f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1160: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1167: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1168: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1170: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1178: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1179: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_117a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_117b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_117c: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1180: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1190: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1198: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_119f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11a0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11a7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11a8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11b0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11ba: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11bb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11bc: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11c0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11d0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11d8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11e0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11e8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11f0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_11fc: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13c0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13d0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13d8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13e0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13e8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13f0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_13fc: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1ec0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1ed0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1ed8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1edf: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1ee0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1ee7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1ee8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1ef0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1ef8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1ef9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1efa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1efb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1efc: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f00: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f10: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f18: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f1f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f20: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f27: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f28: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f30: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f38: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f39: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f3a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f3b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_1f3c: #: - addiu $23,$23,2 - - lbu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2000: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2010: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2018: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2020: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2028: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2030: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2038: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2039: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_203a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_203b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_203c: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2040: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2050: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2058: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2060: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2068: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2070: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2078: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2079: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_207a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_207b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_207c: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2080: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2090: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2098: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20a0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20a8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20b0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20ba: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20bb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20bc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20c0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20d0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20d8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20e0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20e8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20f0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_20fc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2100: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2110: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2118: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2120: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2128: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2130: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2138: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2139: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_213a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_213b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_213c: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $2,0x44($29) - sw $14,0x40($29) - addiu $14,$14,2 - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $25,0x8C($21) - lw $4,0x40($29) - lw $5,0x44($29) - jalr $25 - srl $5,$5,16 # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2140: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2150: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2158: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2160: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2168: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2170: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2178: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2179: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_217a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_217b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_217c: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2180: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2190: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_2198: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21a0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21a8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21b0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21ba: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21bb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21bc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21c0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21d0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21d8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21e0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21e8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21f0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_21fc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23c0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23d0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23d8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23e0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23e8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23f0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_23fc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3000: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3010: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3018: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3020: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3028: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3030: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3038: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3039: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_303a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_303b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_303c: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3040: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3050: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3058: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3060: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3068: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3070: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3078: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3079: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_307a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_307b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_307c: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - srl $24,$24,7 - andi $24,$24,0x1C - seh $2,$2 - addu $24,$24,$21 - sw $2,0x20($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3080: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3090: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3098: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30a0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30a8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30b0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30ba: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30bb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30bc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30c0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30d0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30d8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30e0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30e8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30f0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_30fc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3100: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3110: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3118: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3120: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3128: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3130: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3138: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3139: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_313a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_313b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_313c: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3140: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3150: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3158: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3160: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3168: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3170: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3178: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3179: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_317a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_317b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_317c: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3180: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3190: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_3198: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31a0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31a8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31b0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31ba: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31bb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31bc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31c0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31d0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31d8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31e0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31e8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31f0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_31fc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33c0: #: - addiu $23,$23,2 - - and $8,$24,0x0f - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33d0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33d8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33e0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33e8: #: - addiu $23,$23,2 - - and $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33f0: #: - addiu $23,$23,2 - - and $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_33fc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0000: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lb $2,0x00($24) - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0010: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0018: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_001f: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0020: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0027: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0028: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0030: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0038: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0039: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_003c: #: - addiu $23,$23,2 - - lbu $8,0x00($23) - addiu $23,$23,2 - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - or $2,$2,$8 - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0040: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lh $2,0x00($24) - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0050: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0058: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0060: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0068: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0070: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0078: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0079: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_007c: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - bne $8,$0,9f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - lhu $8,0x00($23) - addiu $23,$23,2 - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - or $2,$2,$8 - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0080: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $2,0x00($24) - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0090: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0098: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_00a0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_00a8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_00b0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_00b8: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_00b9: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0200: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lb $2,0x00($24) - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0210: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0218: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_021f: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0220: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0227: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0228: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0230: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0238: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0239: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_023c: #: - addiu $23,$23,2 - - lbu $8,0x00($23) - addiu $23,$23,2 - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - and $2,$2,$8 - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0240: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lh $2,0x00($24) - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0250: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0258: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0260: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0268: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0270: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0278: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0279: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_027c: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - bne $8,$0,9f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - lhu $8,0x00($23) - addiu $23,$23,2 - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - and $2,$2,$8 - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0280: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $2,0x00($24) - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0290: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0298: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_02a0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_02a8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_02b0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_02b8: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_02b9: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - and $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0400: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lb $9,0x00($24) - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0410: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0418: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_041f: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0420: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0427: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0428: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0430: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0438: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0439: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0440: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lh $9,0x00($24) - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - sh $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0450: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0458: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0460: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0468: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0470: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0478: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0479: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0480: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $9,0x00($24) - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - sw $2,0x00($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0490: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0498: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_04a0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_04a8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_04b0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_04b8: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_04b9: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $2,$9,$8 - sltu $16,$9,$8 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0600: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lb $9,0x00($24) - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0610: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0618: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_061f: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0620: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0627: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0628: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0630: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0638: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0639: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0640: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lh $9,0x00($24) - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - sh $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0650: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0658: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0660: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0668: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0670: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0678: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0679: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0680: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $9,0x00($24) - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - sw $2,0x00($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0690: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0698: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_06a0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_06a8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_06b0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_06b8: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_06b9: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $2,$9,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a00: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lb $2,0x00($24) - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a10: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a18: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a1f: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a20: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a27: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a28: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a30: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a38: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a39: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a3c: #: - addiu $23,$23,2 - - lbu $8,0x00($23) - addiu $23,$23,2 - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - xor $2,$2,$8 - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a40: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lh $2,0x00($24) - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a50: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a58: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a60: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a68: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a70: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a78: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a79: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a7c: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - bne $8,$0,9f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - lhu $8,0x00($23) - addiu $23,$23,2 - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - xor $2,$2,$8 - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a80: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $2,0x00($24) - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a90: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0a98: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0aa0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0aa8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0ab0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0ab8: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0ab9: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - xor $2,$2,$8 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c00: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lb $2,0x00($24) - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c10: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c18: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c1f: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c20: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c27: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c28: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c30: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lb $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c38: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c39: #: - addiu $23,$23,2 - - lb $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c40: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lh $2,0x00($24) - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c50: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c58: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c60: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c68: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c70: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $8,0x00($23) - addiu $23,$23,2 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c78: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c79: #: - addiu $23,$23,2 - - lh $8,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$9 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c80: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $2,0x00($24) - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$9,$0 # Set Sign - sltiu $18,$9,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c90: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$9,$0 # Set Sign - sltiu $18,$9,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0c98: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$9,$0 # Set Sign - sltiu $18,$9,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0ca0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$9,$0 # Set Sign - sltiu $18,$9,1 # Set Zero - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0ca8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$9,$0 # Set Sign - sltiu $18,$9,1 # Set Zero - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0cb0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$9,$0 # Set Sign - sltiu $18,$9,1 # Set Zero - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0cb8: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$9,$0 # Set Sign - sltiu $18,$9,1 # Set Zero - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0cb9: #: - addiu $23,$23,2 - - lhu $8,0x00($23) - lhu $25,0x02($23) - sll $8,$8,16 - or $8,$8,$25 - addiu $23,$23,4 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - subu $9,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$9,$2 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$9,$0 # Set Sign - sltiu $18,$9,1 # Set Zero - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0100: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0110: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0118: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_011f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0120: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0127: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0128: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0130: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0138: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0139: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_013a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_013b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_013c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lbu $2,0x00($23) - addiu $23,$23,2 - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0140: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0150: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0158: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_015f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0160: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0167: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0168: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0170: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0178: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0179: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0180: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - sw $2,0x00($8) - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0190: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0198: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_019f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01a7: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01c0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01df: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01e7: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $18,0x00($24) - ori $10,$0,1 - andi $18,$18,0x07 - sllv $9,$10,$18 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0108: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - sll $8,$2,8 - addiu $14,$14,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $8,$8,$2 - sh $8,0x00($24) - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0148: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $8,$2,8 - addiu $14,$14,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $8,$8,$2 - addiu $14,$14,2 - sll $8,$2,16 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $9,$2,8 - addiu $14,$14,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $8,$8,$9 - or $8,$8,$2 - sw $8,0x00($24) - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0188: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - sll $5,$24,8 - lw $25,0x88($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,2 - or $5,$0,$24 - lw $25,0x88($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_01c8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - sll $5,$24,24 - lw $25,0x88($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,2 - sll $5,$24,16 - lw $25,0x88($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,2 - sll $5,$24,8 - lw $25,0x88($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,2 - or $5,$0,$24 - lw $25,0x88($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0800: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0810: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0818: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_081f: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0820: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0827: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0828: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0830: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0838: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0839: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_083a: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_083b: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0840: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - sw $2,0x00($8) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0850: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0858: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_085f: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0860: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0867: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0868: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0870: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0878: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0879: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - xor $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0880: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - sw $2,0x00($8) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0890: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_0898: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_089f: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08a7: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08b8: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08b9: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - nor $9,$0,$9 - and $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08c0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - sw $2,0x00($8) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08df: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08e7: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08f8: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_08f9: #: - addiu $23,$23,2 - - lhu $18,0x00($23) - addiu $23,$23,2 - and $18,$18,0x07 - ori $10,$0,1 - sllv $9,$10,$18 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - srlv $18,$10,$18 - xori $18,$18,1 # Set Zero Flag - or $2,$2,$9 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - sw $14,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - sw $14,0x20($24) - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - sw $14,0x20($24) - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $14,0x00($23) - addiu $23,$23,2 - sw $14,0x20($24) - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - sw $14,0x20($24) - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41fa: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - sw $14,0x20($24) - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41fb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - sw $14,0x20($24) - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4850: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $4,0x3C($21) # Push onto Stack - addiu $4,$4,-4 - sw $4,0x3C($21) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4868: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $4,0x3C($21) # Push onto Stack - addiu $4,$4,-4 - sw $4,0x3C($21) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4870: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $4,0x3C($21) # Push onto Stack - addiu $4,$4,-4 - sw $4,0x3C($21) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4878: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $4,0x3C($21) # Push onto Stack - addiu $4,$4,-4 - sw $4,0x3C($21) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4879: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $4,0x3C($21) # Push onto Stack - addiu $4,$4,-4 - sw $4,0x3C($21) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_487a: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $4,0x3C($21) # Push onto Stack - addiu $4,$4,-4 - sw $4,0x3C($21) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_487b: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $4,0x3C($21) # Push onto Stack - addiu $4,$4,-4 - sw $4,0x3C($21) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40f8: #: - addiu $23,$23,2 - - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40f9: #: - addiu $23,$23,2 - - lbu $2,0x44($21) - sll $2,$2,4 - or $2,$2,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42c0: #: - addiu $23,$23,2 - - lw $25,0x70($21) - bne $25,$0,0f - andi $24,$24,0x07 # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - sh $2,0x00($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42d0: #: - addiu $23,$23,2 - - lw $25,0x70($21) - bne $25,$0,0f - andi $24,$24,0x07 # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42d8: #: - addiu $23,$23,2 - - lw $25,0x70($21) - bne $25,$0,0f - andi $24,$24,0x07 # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42e0: #: - addiu $23,$23,2 - - lw $25,0x70($21) - bne $25,$0,0f - andi $24,$24,0x07 # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42e8: #: - addiu $23,$23,2 - - lw $25,0x70($21) - bne $25,$0,0f - andi $24,$24,0x07 # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42f0: #: - addiu $23,$23,2 - - lw $25,0x70($21) - bne $25,$0,0f - andi $24,$24,0x07 # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42f8: #: - addiu $23,$23,2 - - lw $25,0x70($21) - bne $25,$0,0f - nop # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42f9: #: - addiu $23,$23,2 - - lw $25,0x70($21) - bne $25,$0,0f - nop # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - or $2,$0,$20 - sll $2,$2,1 - or $2,$2,$19 - sll $2,$2,1 - or $2,$2,$18 - sll $2,$2,1 - or $2,$2,$17 - sll $2,$2,1 - or $2,$2,$16 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lhu $2,0x00($24) - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44fa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44fb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44fc: #: - addiu $23,$23,2 - - lhu $2,0x00($23) - addiu $23,$23,2 - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46c0: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lhu $2,0x00($24) - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-12 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-12 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46d0: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-16 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-16 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46d8: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-16 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-16 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46e0: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-18 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-18 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46e8: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46f0: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-22 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-22 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46f8: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46f9: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-24 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-24 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46fa: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46fb: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-22 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-22 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46fc: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - lhu $2,0x00($23) - addiu $23,$23,2 - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - addiu $15,$15,-12 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-12 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5000: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lb $9,0x00($16) - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sb $2,0x00($16) - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5088: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $9,0x20($8) - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sw $2,0x20($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5010: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5018: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $25,$14,1 - sw $25,0x20($16) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_501f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5020: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $14,$14,-1 - sw $14,0x20($16) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5027: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5028: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - lh $7,0x00($23) - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5030: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5038: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5039: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5040: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lh $9,0x00($16) - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sh $2,0x00($16) - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5050: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5058: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $25,$14,2 - sw $25,0x20($16) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5060: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $14,$14,-2 - sw $14,0x20($16) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5068: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - lh $7,0x00($23) - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5070: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5078: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5079: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5080: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $9,0x00($16) - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sw $2,0x00($16) - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5090: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5098: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $25,$14,4 - sw $25,0x20($16) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50a0: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $14,$14,-4 - sw $14,0x20($16) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50a8: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - lh $7,0x00($23) - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50b0: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - addu $2,$9,$24 - sltu $16,$2,$24 # Set Carry - xor $17,$9,$24 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - addiu $2,$0,-1 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50c8: #: - bgez $0,1f - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $2,$0,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - addiu $2,$0,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - addiu $2,$0,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - addiu $2,$0,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - addiu $2,$0,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - addiu $2,$0,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - addiu $2,$0,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - addiu $2,$0,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_50f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - addiu $2,$0,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5100: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lb $9,0x00($16) - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sb $2,0x00($16) - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5188: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $9,0x20($8) - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sw $2,0x20($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5110: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5118: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $25,$14,1 - sw $25,0x20($16) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_511f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5120: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $14,$14,-1 - sw $14,0x20($16) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5127: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5128: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - lh $7,0x00($23) - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5130: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5138: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5139: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5140: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lh $9,0x00($16) - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sh $2,0x00($16) - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5150: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5158: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $25,$14,2 - sw $25,0x20($16) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5160: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $14,$14,-2 - sw $14,0x20($16) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5168: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - lh $7,0x00($23) - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5170: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5178: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5179: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5180: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $9,0x00($16) - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sw $2,0x00($16) - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5190: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5198: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $25,$14,4 - sw $25,0x20($16) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51a0: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $14,$14,-4 - sw $14,0x20($16) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51a8: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - lh $7,0x00($23) - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51b0: #: - addiu $23,$23,2 - - andi $16,$24,0x07 - sll $16,$16,2 - addu $16,$16,$21 - lw $14,0x20($16) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - subu $2,$9,$24 - sltu $16,$9,$24 # Set Carry - xor $17,$9,$24 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51c8: #: - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - and $2,$0,$0 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - and $2,$0,$0 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - and $2,$0,$0 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - and $2,$0,$0 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - and $2,$0,$0 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - and $2,$0,$0 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - and $2,$0,$0 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - and $2,$0,$0 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_51f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - and $2,$0,$0 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52c8: #: - nor $25,$16,$18 - andi $25,$25,1 - bne $25,$0,1f - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_52f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - nor $2,$16,$18 - andi $2,$2,1 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - or $2,$16,$18 - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53c8: #: - or $25,$16,$18 - bne $25,$0,1f - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - or $2,$16,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - or $2,$16,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - or $2,$16,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - or $2,$16,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - or $2,$16,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - or $2,$16,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - or $2,$16,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - or $2,$16,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_53f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - or $2,$16,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54c8: #: - beq $16,$0,1f # check carry - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_54f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - xori $2,$16,1 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55c8: #: - bne $16,$0,1f # check carry - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_55f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - or $2,$0,$16 # Check Carry - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56c8: #: - beq $18,$0,1f # Check zero - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_56f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - xori $2,$18,1 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57c8: #: - bne $18,$0,1f # Check zero - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_57f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - or $2,$0,$18 # Check Zero - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58c8: #: - beq $17,$0,1f # Check Overflow - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_58f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - xori $2,$17,1 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59c8: #: - bne $17,$0,1f # Check Overflow - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59df: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59e7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_59f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - or $2,$0,$17 # Check Overflow - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ac0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ac8: #: - beq $19,$0,1f # Check Sign - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ad0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ad8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5adf: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ae0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ae7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ae8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5af0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5af8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5af9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - xori $2,$19,1 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5bc0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5bc8: #: - bne $19,$0,1f # Check Sign - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5bd0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5bd8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5bdf: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5be0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5be7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5be8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5bf0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5bf8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5bf9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - or $2,$0,$19 # Check Sign - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5cc0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - xor $2,$19,$17 - addiu $2,$2,-1 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5cc8: #: - beq $19,$17,1f - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5cd0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - xor $2,$19,$17 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5cd8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - xor $2,$19,$17 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5cdf: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - xor $2,$19,$17 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ce0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - xor $2,$19,$17 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ce7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - xor $2,$19,$17 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ce8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - xor $2,$19,$17 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5cf0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - xor $2,$19,$17 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5cf8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - xor $2,$19,$17 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5cf9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - xor $2,$19,$17 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5dc0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - xor $2,$19,$17 - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5dc8: #: - bne $19,$17,1f - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5dd0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - xor $2,$19,$17 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5dd8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - xor $2,$19,$17 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ddf: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - xor $2,$19,$17 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5de0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - xor $2,$19,$17 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5de7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - xor $2,$19,$17 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5de8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - xor $2,$19,$17 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5df0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - xor $2,$19,$17 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5df8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - xor $2,$19,$17 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5df9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - xor $2,$19,$17 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ec0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ec8: #: - xor $25,$19,$17 - or $25,$25,$18 - beq $25,$0,1f - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ed0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ed8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5edf: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ee0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ee7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ee8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ef0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ef8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ef9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - xor $2,$19,$17 - or $2,$2,$18 - addiu $2,$2,-1 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5fc0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - andi $2,$2,0x02 - addiu $15,$15,-4 - subu $15,$15,$2 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5fc8: #: - xor $25,$19,$17 - or $25,$25,$18 - bne $25,$0,1f - andi $24,$24,0x07 # Delay slot - sll $24,$24,2 - addu $24,$24,$21 - lhu $8,0x00($24) - addiu $9,$8,-1 - beq $8,$0,9f # Is it -1 - sh $9,0x00($24) # Delay slot - - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - 1: - addiu $23,$23,4 - - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5fd0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5fd8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5fdf: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5fe0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5fe7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5fe8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ff0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ff8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_5ff9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - xor $2,$19,$17 - or $2,$2,$18 - subu $2,$0,$2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6000: #: - addiu $23,$23,2 - - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6001: #: - addiu $23,$23,2 - - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6100: #: - addiu $23,$23,2 - - lh $24,0x00($23) - addu $24,$23,$24 - addiu $23,$23,2 - lw $5,0x74($21) - lui $25,0xFF00 - lw $4,0x3C($21) # Push onto Stack - and $5,$5,$25 - subu $25,$23,$22 - addiu $4,$4,-4 - sw $4,0x3C($21) - or $5,$5,$25 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $24,0x44($29) - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $23,$0,$24 - - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6101: #: - addiu $23,$23,2 - - lw $5,0x74($21) - lui $25,0xFF00 - lw $4,0x3C($21) # Push onto Stack - and $5,$5,$25 - subu $25,$23,$22 - addiu $4,$4,-4 - sw $4,0x3C($21) - or $5,$5,$25 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $24,0x44($29) - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6200: #: - nor $25,$16,$18 - andi $25,$25,1 - bne $25,$0,1f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6201: #: - nor $25,$16,$18 - andi $25,$25,1 - bne $25,$0,1f - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6300: #: - or $25,$16,$18 - bne $25,$0,1f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6301: #: - or $25,$16,$18 - bne $25,$0,1f - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6400: #: - beq $16,$0,1f # check carry - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6401: #: - beq $16,$0,1f # check carry - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6500: #: - bne $16,$0,1f # check carry - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6501: #: - bne $16,$0,1f # check carry - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6600: #: - beq $18,$0,1f # Check zero - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6601: #: - beq $18,$0,1f # Check zero - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6700: #: - bne $18,$0,1f # Check zero - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6701: #: - bne $18,$0,1f # Check zero - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6800: #: - beq $17,$0,1f # Check Overflow - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6801: #: - beq $17,$0,1f # Check Overflow - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6900: #: - bne $17,$0,1f # Check Overflow - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6901: #: - bne $17,$0,1f # Check Overflow - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6a00: #: - beq $19,$0,1f # Check Sign - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6a01: #: - beq $19,$0,1f # Check Sign - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6b00: #: - bne $19,$0,1f # Check Sign - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6b01: #: - bne $19,$0,1f # Check Sign - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6c00: #: - beq $19,$17,1f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6c01: #: - beq $19,$17,1f - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6d00: #: - bne $19,$17,1f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6d01: #: - bne $19,$17,1f - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6e00: #: - xor $25,$19,$17 - or $25,$25,$18 - beq $25,$0,1f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6e01: #: - xor $25,$19,$17 - or $25,$25,$18 - beq $25,$0,1f - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6f00: #: - xor $25,$19,$17 - or $25,$25,$18 - bne $25,$0,1f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,2 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - lh $2,0x00($23) - addu $23,$23,$2 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_6f01: #: - xor $25,$19,$17 - or $25,$25,$18 - bne $25,$0,1f - addiu $23,$23,2 # Delay slot - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 1: - seb $24,$24 - addu $23,$23,$24 - andi $25,$23,0x01 - beq $25,$0,2f - subu $5,$23,$22 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $5,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$5,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_7000: #: - - addiu $23,$23,2 - - seb $2,$24 - srl $24,$24,7 - andi $24,$24,0x1C - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - addu $24,$24,$21 - sw $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8100: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lbu $8,0x00($8) - addu $24,$24,$21 - lbu $9,0x00($24) - subu $17,$9,$8 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - subu $11,$11,$10 - subu $11,$11,$20 - subu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - subu $11,$11,$12 - sll $12,$12,1 - subu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - addu $2,$2,$12 - sll $12,$12,2 - addu $2,$2,$12 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - sb $2,0x00($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8108: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $17,$9,$8 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - subu $11,$11,$10 - subu $11,$11,$20 - subu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - subu $11,$11,$12 - sll $12,$12,1 - subu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - addu $2,$2,$12 - sll $12,$12,2 - addu $2,$2,$12 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_810f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $17,$9,$8 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - subu $11,$11,$10 - subu $11,$11,$20 - subu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - subu $11,$11,$12 - sll $12,$12,1 - subu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - addu $2,$2,$12 - sll $12,$12,2 - addu $2,$2,$12 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8f08: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $17,$9,$8 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - subu $11,$11,$10 - subu $11,$11,$20 - subu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - subu $11,$11,$12 - sll $12,$12,1 - subu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - addu $2,$2,$12 - sll $12,$12,2 - addu $2,$2,$12 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8f0f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $17,$9,$8 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - subu $11,$11,$10 - subu $11,$11,$20 - subu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - subu $11,$11,$12 - sll $12,$12,1 - subu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - addu $2,$2,$12 - sll $12,$12,2 - addu $2,$2,$12 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c100: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lbu $8,0x00($8) - addu $24,$24,$21 - lbu $9,0x00($24) - addu $17,$9,$8 - addu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - addu $11,$11,$10 - addu $11,$11,$20 - addu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - addu $11,$11,$12 - sll $12,$12,1 - addu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - subu $2,$2,$12 - sll $12,$12,2 - subu $2,$2,$12 - nor $17,$0,$17 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - sb $2,0x00($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c108: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $17,$9,$8 - addu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - addu $11,$11,$10 - addu $11,$11,$20 - addu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - addu $11,$11,$12 - sll $12,$12,1 - addu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - subu $2,$2,$12 - sll $12,$12,2 - subu $2,$2,$12 - nor $17,$0,$17 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c10f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $17,$9,$8 - addu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - addu $11,$11,$10 - addu $11,$11,$20 - addu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - addu $11,$11,$12 - sll $12,$12,1 - addu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - subu $2,$2,$12 - sll $12,$12,2 - subu $2,$2,$12 - nor $17,$0,$17 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_cf08: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $17,$9,$8 - addu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - addu $11,$11,$10 - addu $11,$11,$20 - addu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - addu $11,$11,$12 - sll $12,$12,1 - addu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - subu $2,$2,$12 - sll $12,$12,2 - subu $2,$2,$12 - nor $17,$0,$17 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_cf0f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $17,$9,$8 - addu $17,$17,$20 - andi $17,$17,0xFF - andi $10,$8,0x0F - andi $11,$9,0x0F - andi $8,$8,0xF0 - andi $9,$9,0xF0 - addu $11,$11,$10 - addu $11,$11,$20 - addu $9,$9,$8 - sltiu $12,$11,10 - xori $12,$12,1 - sll $12,$12,1 - addu $11,$11,$12 - sll $12,$12,1 - addu $11,$11,$12 - addu $2,$9,$11 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $12,$16,5 - subu $2,$2,$12 - sll $12,$12,2 - subu $2,$2,$12 - nor $17,$0,$17 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8000: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lb $2,0x00($8) - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8010: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8018: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_801f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8020: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8027: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8028: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8030: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8038: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8039: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_803a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_803b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_803c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lb $2,0x00($23) - addiu $23,$23,2 - or $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8040: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8050: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8058: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8060: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8068: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8070: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8078: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8079: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_807a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_807b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_807c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $2,0x00($23) - addiu $23,$23,2 - or $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8080: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8090: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8098: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_80a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_80a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_80b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_80b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_80b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_80ba: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_80bb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_80bc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - or $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8110: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8118: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_811f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8120: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8127: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8128: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8130: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8138: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8139: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8150: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8158: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8160: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8168: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8170: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8178: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8179: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8190: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_8198: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_81a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_81a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_81b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_81b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_81b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - or $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9000: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lb $2,0x00($8) - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9010: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9018: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_901f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9020: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9027: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9028: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9030: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9038: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9039: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_903a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_903b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_903c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lb $2,0x00($23) - addiu $23,$23,2 - subu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9040: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9050: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9058: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9060: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9068: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9070: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9078: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9079: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_907a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_907b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_907c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $2,0x00($23) - addiu $23,$23,2 - subu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9080: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9090: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9098: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90ba: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90bb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90bc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - subu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9110: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9118: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_911f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9120: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9127: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9128: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9130: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9138: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9139: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9150: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9158: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9160: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9168: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9170: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9178: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9179: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9190: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9198: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - subu $2,$10,$9 - sltu $16,$10,$9 # Set Carry - xor $17,$10,$9 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90c0: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90fa: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90fb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_90fc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $2,0x00($23) - addiu $23,$23,2 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91c0: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91fa: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91fb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_91fc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - subu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b000: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lb $2,0x00($8) - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b010: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b018: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b01f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b020: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b027: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b028: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b030: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b038: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b039: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b03a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b03b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b03c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lb $2,0x00($23) - addiu $23,$23,2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b040: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b050: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b058: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b060: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b068: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b070: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b078: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b079: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b07a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b07b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b07c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $2,0x00($23) - addiu $23,$23,2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b080: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b090: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b098: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0ba: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0bb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0bc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0c0: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0fa: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0fb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b0fc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $2,0x00($23) - addiu $23,$23,2 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1c0: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1fa: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1fb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1fc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - subu $10,$9,$2 - sltu $16,$9,$2 # Set Carry - xor $17,$9,$2 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0c0: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0fa: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0fb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0fc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $2,0x00($23) - addiu $23,$23,2 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1c0: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1fa: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1fb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1fc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x20($24) - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - addu $10,$9,$2 - sw $10,0x20($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b100: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lb $10,0x00($8) - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b110: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b118: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b11f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b120: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b127: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b128: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b130: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b138: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b139: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b140: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $10,0x00($8) - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b150: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b158: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b160: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b168: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b170: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b178: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b179: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b180: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $10,0x00($8) - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($8) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b190: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b198: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b1b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - xor $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c000: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lb $2,0x00($8) - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c010: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c018: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c01f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c020: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c027: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c028: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c030: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c038: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c039: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c03a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c03b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c03c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lb $2,0x00($23) - addiu $23,$23,2 - and $10,$9,$2 - sb $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c040: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c050: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c058: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c060: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c068: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c070: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c078: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c079: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c07a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c07b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c07c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $2,0x00($23) - addiu $23,$23,2 - and $10,$9,$2 - sh $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c080: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c090: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c098: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0ba: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0bb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0bc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - and $10,$9,$2 - sw $10,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c110: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c118: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c11f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c120: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c127: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c128: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c130: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c138: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c139: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c150: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c158: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c160: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c168: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c170: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c178: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c179: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c190: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c198: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - and $2,$10,$9 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d000: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lb $2,0x00($8) - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d010: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d018: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d01f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d020: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d027: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d028: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d030: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d038: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d039: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d03a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d03b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x98($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d03c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lb $2,0x00($23) - addiu $23,$23,2 - addu $10,$9,$2 - sb $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d040: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d050: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d058: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d060: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d068: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d070: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d078: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d079: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d07a: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d07b: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d07c: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $2,0x00($23) - addiu $23,$23,2 - addu $10,$9,$2 - sh $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$10 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d080: #: - addiu $23,$23,2 - - andi $8,$24,0x0f - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d090: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d098: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0ba: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0bb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d0bc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $2,0x00($23) - lhu $25,0x02($23) - sll $2,$2,16 - or $2,$2,$25 - addiu $23,$23,4 - addu $10,$9,$2 - sw $10,0x00($24) - sltu $16,$10,$2 # Set Carry - xor $17,$9,$2 - nor $17,$0,$17 - xor $25,$10,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$10,$0 # Set Sign - sltiu $18,$10,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d110: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d118: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d11f: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d120: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d127: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d128: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d130: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d138: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d139: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lb $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seb $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d150: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d158: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d160: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d168: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d170: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d178: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d179: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - seh $10,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d190: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d198: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d1b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - or $10,$0,$2 - addu $2,$10,$9 - sltu $16,$2,$9 # Set Carry - xor $17,$10,$9 - nor $17,$0,$17 - xor $25,$2,$10 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - sw $9,0x44($29) - sw $14,0x40($29) - sw $24,0x3C($29) - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x3C($29) - lw $14,0x40($29) - lw $9,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9100: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lb $8,0x00($8) - addu $24,$24,$21 - - lb $9,0x00($24) - - subu $2,$9,$8 - subu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$9,$25 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - sb $2,0x00($24) - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9108: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - subu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$9,$25 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_910f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - subu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$9,$25 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9140: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lh $8,0x00($8) - addu $24,$24,$21 - - lh $9,0x00($24) - - subu $2,$9,$8 - subu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$9,$25 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - sh $2,0x00($24) - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9148: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - subu $2,$9,$8 - subu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$9,$25 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9180: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $8,0x00($8) - addu $24,$24,$21 - - lw $9,0x00($24) - - subu $2,$9,$8 - subu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$9,$25 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - sw $2,0x00($24) - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9188: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - subu $2,$9,$8 - subu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$9,$25 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9f08: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - subu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$9,$25 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_9f0f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - subu $2,$9,$8 - subu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$9,$25 # Set Carry - xor $17,$9,$8 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d100: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lb $8,0x00($8) - addu $24,$24,$21 - - lb $9,0x00($24) - - addu $2,$9,$8 - addu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$2,$25 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - sb $2,0x00($24) - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d108: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - addu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$2,$25 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d10f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - addu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$2,$25 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d140: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lh $8,0x00($8) - addu $24,$24,$21 - - lh $9,0x00($24) - - addu $2,$9,$8 - addu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$2,$25 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - sh $2,0x00($24) - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d148: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seh $9,$2 - addu $2,$9,$8 - addu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$2,$25 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d180: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $8,0x00($8) - addu $24,$24,$21 - - lw $9,0x00($24) - - addu $2,$9,$8 - addu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$2,$25 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - sw $2,0x00($24) - - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_d188: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-4 - sw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - or $9,$0,$2 - addu $2,$9,$8 - addu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$2,$25 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_df08: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-1 - sw $14,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - addu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$2,$25 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_df0f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - - srl $24,$24,7 - - andi $24,$24,0x1C - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - seb $9,$2 - addu $2,$9,$8 - addu $2,$2,$20 - addu $25,$8,$20 - sltu $16,$2,$25 # Set Carry - xor $17,$9,$8 - nor $17,$0,$17 - xor $25,$2,$9 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_80c0: #: - - addiu $23,$23,2 - - addiu $15,$15,-133 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80d0: #: - - addiu $23,$23,2 - - addiu $15,$15,-137 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80d8: #: - - addiu $23,$23,2 - - addiu $15,$15,-137 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80e0: #: - - addiu $23,$23,2 - - addiu $15,$15,-139 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80e8: #: - - addiu $23,$23,2 - - addiu $15,$15,-141 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80f0: #: - - addiu $23,$23,2 - - addiu $15,$15,-145 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80f8: #: - - addiu $23,$23,2 - - addiu $15,$15,-141 - srl $24,$24,7 - andi $24,$24,0x1C - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80f9: #: - - addiu $23,$23,2 - - addiu $15,$15,-145 - srl $24,$24,7 - andi $24,$24,0x1C - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80fa: #: - - addiu $23,$23,2 - - addiu $15,$15,-141 - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80fb: #: - - addiu $23,$23,2 - - addiu $15,$15,-143 - srl $24,$24,7 - andi $24,$24,0x1C - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_80fc: #: - - addiu $23,$23,2 - - addiu $15,$15,-137 - srl $24,$24,7 - andi $24,$24,0x1C - lhu $2,0x00($23) - addiu $23,$23,2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - divu $0,$8,$2 - mflo $9 - srl $8,$9,16 - bne $8,$0,8f - mfhi $3 # Delay slot - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,95 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81c0: #: - - addiu $23,$23,2 - - addiu $15,$15,-150 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81d0: #: - - addiu $23,$23,2 - - addiu $15,$15,-154 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81d8: #: - - addiu $23,$23,2 - - addiu $15,$15,-154 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81e0: #: - - addiu $23,$23,2 - - addiu $15,$15,-156 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81e8: #: - - addiu $23,$23,2 - - addiu $15,$15,-158 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81f0: #: - - addiu $23,$23,2 - - addiu $15,$15,-162 - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81f8: #: - - addiu $23,$23,2 - - addiu $15,$15,-158 - srl $24,$24,7 - andi $24,$24,0x1C - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81f9: #: - - addiu $23,$23,2 - - addiu $15,$15,-162 - srl $24,$24,7 - andi $24,$24,0x1C - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81fa: #: - - addiu $23,$23,2 - - addiu $15,$15,-158 - srl $24,$24,7 - andi $24,$24,0x1C - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81fb: #: - - addiu $23,$23,2 - - addiu $15,$15,-160 - srl $24,$24,7 - andi $24,$24,0x1C - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - sw $24,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x40($29) - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_81fc: #: - - addiu $23,$23,2 - - addiu $15,$15,-154 - srl $24,$24,7 - andi $24,$24,0x1C - lh $2,0x00($23) - addiu $23,$23,2 - beq $2,$0,9f # do div by zero trap - nop # Delay slot - addu $24,$24,$21 - lw $8,0x00($24) - div $0,$8,$2 - mflo $9 - sll $8,$9,16 - sra $8,$8,16 - bne $8,$9,8f - andi $9,$9,0xffff # Delay slot - mfhi $3 - sll $3,$3,16 - or $2,$9,$3 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$9,15 # Set Sign - sltiu $18,$9,1 # Set Zero - 7: - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 8: - bgez $0,7b - ori $17,$0,1 # Selay slot - V flag - 9: # Do divide by zero trap - addiu $15,$15,112 - jal Exception - ori $2,$0,5 # Delay slot - - bgez $0,7b - nop # Delay slot -OP0_4840: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $2,0x00($24) - ror $2,$2,16 - sw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4000: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lb $8,0x00($24) - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - sb $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4010: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4018: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_401f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4020: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4027: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4028: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4030: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4038: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4039: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4040: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lh $8,0x00($24) - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - sh $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4050: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4058: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4060: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4068: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4070: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4078: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4079: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $25,$25,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4080: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $8,0x00($24) - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - sw $2,0x00($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4090: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4098: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40a0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40a8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40b0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_40b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $2,$8,$20 - subu $2,$0,$2 - addu $25,$8,$20 - sltu $16,$0,$25 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4200: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - sb $2,0x00($24) - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4210: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4218: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_421f: #: - addiu $23,$23,2 - - and $2,$0,$0 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4220: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4227: #: - addiu $23,$23,2 - - and $2,$0,$0 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4228: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4230: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4238: #: - addiu $23,$23,2 - - and $2,$0,$0 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4239: #: - addiu $23,$23,2 - - and $2,$0,$0 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4240: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - sh $2,0x00($24) - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4250: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4258: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4260: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4268: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4270: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4278: #: - addiu $23,$23,2 - - and $2,$0,$0 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4279: #: - addiu $23,$23,2 - - and $2,$0,$0 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4280: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - sw $2,0x00($24) - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4290: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4298: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42a0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42a8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42b0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - and $2,$0,$0 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42b8: #: - addiu $23,$23,2 - - and $2,$0,$0 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_42b9: #: - addiu $23,$23,2 - - and $2,$0,$0 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 - and $17,$0,$0 - ori $18,$0,1 - and $19,$0,$0 - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4400: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lb $8,0x00($24) - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - sb $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4410: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4418: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_441f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4420: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4427: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4428: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4430: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4438: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4439: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4440: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lh $8,0x00($24) - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - sh $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4450: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4458: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4460: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4468: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4470: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4478: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4479: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$2 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4480: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $8,0x00($24) - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - sw $2,0x00($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4490: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4498: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44a0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44a8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44b0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_44b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - subu $2,$0,$8 - sltu $16,$0,$8 # Set Carry - xor $17,$0,$8 - xor $25,$2,$0 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4600: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lb $2,0x00($24) - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4610: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4618: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_461f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4620: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4627: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4628: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4630: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4638: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4639: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4640: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lh $2,0x00($24) - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4650: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4658: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4660: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4668: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4670: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4678: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4679: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4680: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $2,0x00($24) - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4690: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4698: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46a0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46a8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46b0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46b8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_46b9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - nor $2,$0,$2 - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x90($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e60: # - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - andi $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x20($8) - sw $2,0x68($21) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e68: # - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - andi $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x68($21) - sw $2,0x20($8) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4180: #: - addiu $23,$23,2 - - srl $8,$24,7 - andi $8,$8,0x1C - addu $8,$8,$21 - andi $24,$24,0x07 - lh $8,0x00($8) - sll $24,$24,2 - addu $24,$24,$21 - lh $2,0x00($24) - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$8,1 - slt $19,$8,$0 - bne $19,$0,8f - slt $8,$2,$8 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4190: #: - addiu $23,$23,2 - - srl $8,$24,7 - andi $8,$8,0x1C - addu $8,$8,$21 - andi $24,$24,0x07 - lh $8,0x00($8) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$8,1 - slt $19,$8,$0 - bne $19,$0,8f - slt $8,$2,$8 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4198: #: - addiu $23,$23,2 - - srl $8,$24,7 - andi $8,$8,0x1C - addu $8,$8,$21 - andi $24,$24,0x07 - lh $8,0x00($8) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$8,1 - slt $19,$8,$0 - bne $19,$0,8f - slt $8,$2,$8 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41a0: #: - addiu $23,$23,2 - - srl $8,$24,7 - andi $8,$8,0x1C - addu $8,$8,$21 - andi $24,$24,0x07 - lh $8,0x00($8) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$8,1 - slt $19,$8,$0 - bne $19,$0,8f - slt $8,$2,$8 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41a8: #: - addiu $23,$23,2 - - srl $8,$24,7 - andi $8,$8,0x1C - addu $8,$8,$21 - andi $24,$24,0x07 - lh $8,0x00($8) - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$8,1 - slt $19,$8,$0 - bne $19,$0,8f - slt $8,$2,$8 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41b0: #: - addiu $23,$23,2 - - srl $8,$24,7 - andi $8,$8,0x1C - addu $8,$8,$21 - andi $24,$24,0x07 - lh $8,0x00($8) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$8,1 - slt $19,$8,$0 - bne $19,$0,8f - slt $8,$2,$8 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41b8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $24,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - seh $2,$2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$24,1 - slt $19,$24,$0 - bne $19,$0,8f - slt $8,$2,$24 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41b9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $24,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - seh $2,$2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$24,1 - slt $19,$24,$0 - bne $19,$0,8f - slt $8,$2,$24 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41ba: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $24,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - seh $2,$2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$24,1 - slt $19,$24,$0 - bne $19,$0,8f - slt $8,$2,$24 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41bb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $24,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - seh $2,$2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$24,1 - slt $19,$24,$0 - bne $19,$0,8f - slt $8,$2,$24 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_41bc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $24,0x00($24) - lh $2,0x00($23) - addiu $23,$23,2 - and $16,$0,$0 - and $17,$0,$0 - sltiu $18,$24,1 - slt $19,$24,$0 - bne $19,$0,8f - slt $8,$2,$24 # Delay slot - bne $8,$0,9f - nop # Delay slot - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - and $19,$0,$0 - 8: - jal Exception - ori $2,$0,6 # Delay slot - - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c140: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - sll $8,$8,2 - andi $24,$24,0x1C - addu $8,$8,$21 - addu $24,$24,$21 - lw $2,0x00($8) - lw $3,0x00($24) - sw $2,0x00($24) - sw $3,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c148: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - sll $8,$8,2 - andi $24,$24,0x1C - addu $8,$8,$21 - addu $24,$24,$21 - lw $2,0x20($8) - lw $3,0x20($24) - sw $2,0x20($24) - sw $3,0x20($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c188: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - sll $8,$8,2 - andi $24,$24,0x1C - addu $8,$8,$21 - addu $24,$24,$21 - lw $2,0x20($8) - lw $3,0x00($24) - sw $2,0x00($24) - sw $3,0x20($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b108: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $3,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$3,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$3 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b10f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $3,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$3,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$3 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b148: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $8,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - subu $3,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$3,$2 - and $17,$17,$25 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - seh $25,$3 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_b188: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,4 - sw $25,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - or $8,$0,$2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - subu $3,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$3,$2 - and $17,$17,$25 - srl $17,$17,31 # Set Overflow - slt $19,$3,$0 # Set Sign - sltiu $18,$3,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_bf08: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,1 - sw $25,0x20($8) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $3,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$3,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$3 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_bf0f: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seb $8,$2 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $8,0x44($29) - lw $15,m68k_ICount - seb $2,$2 - subu $3,$2,$8 - sltu $16,$2,$8 # Set Carry - xor $17,$2,$8 - xor $25,$3,$2 - and $17,$17,$25 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - seb $25,$3 - slt $19,$25,$0 # Set Sign - sltiu $18,$25,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0c0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-54 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-58 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-58 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-60 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-62 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-64 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-62 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-66 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0fa: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-62 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0fb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-64 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c0fc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lhu $9,0x00($24) - lhu $2,0x00($23) - addiu $23,$23,2 - multu $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-54 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1c0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-54 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1d0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-58 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1d8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $25,$14,2 - sw $25,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-58 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1e0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $14,$14,-2 - sw $14,0x20($8) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-60 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1e8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-62 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1f0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-64 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1f8: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-62 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1f9: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-66 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1fa: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-62 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1fb: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $24,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-64 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_c1fc: #: - addiu $23,$23,2 - - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lh $9,0x00($24) - lh $2,0x00($23) - addiu $23,$23,2 - mult $2,$9 - mflo $8 - sw $8,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$8,$0 # Set Sign - sltiu $18,$8,1 # Set Zero - addiu $15,$15,-54 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e77: #: - lw $16,0x3C($21) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$16 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $8,$16,6 - sw $8,0x3C($21) - addiu $16,$16,2 - or $17,$0,$2 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$16 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $8,$0,$2 - or $2,$0,$17 - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - andi $25,$8,0x01 - beq $25,$0,2f - addu $23,$22,$8 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $8,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$8,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e75: #: - lw $4,0x3C($21) - addiu $8,$4,4 - sw $8,0x3C($21) - lw $25,0x84($21) - sw $15,m68k_ICount - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $8,$0,$2 - andi $25,$8,0x01 - beq $25,$0,2f - addu $23,$22,$8 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $8,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$8,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e90: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $5,0x74($21) - lui $25,0xFF00 - lw $4,0x3C($21) # Push onto Stack - and $5,$5,$25 - subu $25,$23,$22 - addiu $4,$4,-4 - sw $4,0x3C($21) - or $5,$5,$25 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $14,0x44($29) - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ea8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $5,0x74($21) - lui $25,0xFF00 - lw $4,0x3C($21) # Push onto Stack - and $5,$5,$25 - subu $25,$23,$22 - addiu $4,$4,-4 - sw $4,0x3C($21) - or $5,$5,$25 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $14,0x44($29) - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4eb0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $5,0x74($21) - lui $25,0xFF00 - lw $4,0x3C($21) # Push onto Stack - and $5,$5,$25 - subu $25,$23,$22 - addiu $4,$4,-4 - sw $4,0x3C($21) - or $5,$5,$25 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $14,0x44($29) - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-36 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4eb8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $5,0x74($21) - lui $25,0xFF00 - lw $4,0x3C($21) # Push onto Stack - and $5,$5,$25 - subu $25,$23,$22 - addiu $4,$4,-4 - sw $4,0x3C($21) - or $5,$5,$25 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $14,0x44($29) - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4eb9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $5,0x74($21) - lui $25,0xFF00 - lw $4,0x3C($21) # Push onto Stack - and $5,$5,$25 - subu $25,$23,$22 - addiu $4,$4,-4 - sw $4,0x3C($21) - or $5,$5,$25 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $14,0x44($29) - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-34 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4eba: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - lw $5,0x74($21) - lui $25,0xFF00 - lw $4,0x3C($21) # Push onto Stack - and $5,$5,$25 - subu $25,$23,$22 - addiu $4,$4,-4 - sw $4,0x3C($21) - or $5,$5,$25 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $14,0x44($29) - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-30 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ebb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $5,0x74($21) - lui $25,0xFF00 - lw $4,0x3C($21) # Push onto Stack - and $5,$5,$25 - subu $25,$23,$22 - addiu $4,$4,-4 - sw $4,0x3C($21) - or $5,$5,$25 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $14,0x44($29) - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-32 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ed0: #: - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ee8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ef0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ef8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ef9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4efa: #: - addiu $23,$23,2 - - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4efb: #: - addiu $23,$23,2 - - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - andi $25,$14,0x01 - beq $25,$0,2f - addu $23,$22,$14 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $14,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$14,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4800: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lbu $2,0x00($24) - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - sb $2,0x00($24) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4810: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4818: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_481f: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4820: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4827: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4828: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4830: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4838: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4839: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - subu $17,$0,$2 - subu $17,$17,$20 - andi $17,$17,0xFF - andi $9,$2,0x0F - andi $8,$2,0xF0 - subu $9,$0,$9 - subu $9,$9,$20 - subu $8,$0,$8 - sltiu $10,$9,10 - xori $10,$10,1 - sll $10,$10,1 - subu $9,$9,$10 - sll $10,$10,1 - subu $9,$9,$10 - addu $2,$8,$9 - sltiu $16,$2,0x9a - xori $16,$16,1 # Set Carry - sll $10,$16,5 - addu $2,$2,$10 - sll $10,$10,2 - addu $2,$2,$10 - xor $19,$17,$2 - and $17,$17,$19 - srl $17,$17,7 # Set Overflow - sltiu $25,$2,1 - and $18,$18,$25 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ac0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lbu $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - sb $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ad0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ad8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4adf: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ae0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ae7: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ae8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4af0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4af8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-22 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4af9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - or $2,$2,0x80 - lw $25,0x88($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e40: #: - addiu $23,$23,2 - - andi $2,$24,0x0f - jal Exception - ori $2,$2,32 # Delay slot - - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e76: # - beq $17,$0,9f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,-2 - jal Exception - ori $2,$0,7 - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e70: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - bne $8,$0,9f - addiu $23,$23,2 # Delay slot - - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-132 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - - 9: - lw $25,0x5C($21) - beq $25,$0,9f - lhu $24,0x00($23) # Delay slot - sw $15,m68k_ICount - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - lw $23,0x4C($21) - lhu $24,0x00($23) - 9: - sll $7,$24,2 - addu $7,$7,$30 - - lw $7,0x00($7) - - jr $7 - addiu $15,$15,-132 # Delay slot -OP0_4e71: #: - addiu $23,$23,2 - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e72: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - lhu $2,0x00($23) - addiu $23,$23,2 - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - lbu $3,0x50($21) - andi $2,$3,0x07 - xori $25,$2,0x07 # Always take 7 - bne $25,$0,8f - nop # Delay slot - - j procint - nop # Delay slot - - 8: - - lbu $8,0x44($21) # int mask - andi $8,$8,0x07 - subu $25,$8,$2 - bgez $25,8f - nop # Delay slot - - j procint - nop # Delay slot - - 8: - - and $15,$0,$0 - ori $3,$3,0x80 - sb $3,0x50($21) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4880: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lb $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48c0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lh $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e73: #: - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - - lw $16,0x3C($21) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$16 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $8,$16,6 - sw $8,0x3C($21) - addiu $16,$16,2 - or $17,$0,$2 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$16 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - or $8,$0,$2 - or $2,$0,$17 - andi $25,$2,0x2000 # User Mode ? - bne $25,$0,0f - or $18,$0,$2 # Delay slot - lw $16,0x3C($21) - lw $17,0x68($21) - sw $16,0x40($21) - sw $17,0x3C($21) - 0: - srl $18,$18,8 - sb $18,0x44($21) # T, S & I - or $20,$0,$2 - or $19,$0,$2 - or $18,$0,$2 - or $17,$0,$2 - or $16,$0,$2 - andi $20,$20,0x10 - andi $19,$19,0x08 - andi $18,$18,0x04 - andi $17,$17,0x02 - andi $16,$16,0x01 - srl $20,$20,4 - srl $19,$19,3 - srl $18,$18,2 - srl $17,$17,1 - andi $25,$8,0x01 - beq $25,$0,2f - addu $23,$22,$8 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $8,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$8,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-20 - bgez $15,3f - lbu $7,0x50($21) # Delay slot - j MainExit - 3: - # Check for Interrupt waiting - - andi $7,$7,0x07 # Delay slot - beq $7,$0,3f - nop # Delay slot - j interrupt - 3: - lhu $24,0x00($23) # Delay slot - sll $7,$24,2 - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a00: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lbu $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a10: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a18: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,1 - sw $25,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a1f: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $25,$14,2 - sw $25,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a20: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-1 - sw $14,0x20($24) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a27: #: - addiu $23,$23,2 - - lw $14,0x3C($21) # Get A7 - addiu $14,$14,-2 - sw $14,0x3C($21) - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a28: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a30: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a38: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a39: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x7C($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a40: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lhu $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a50: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a58: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a60: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a68: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a70: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a78: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a79: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a80: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $2,0x00($24) - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a90: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4a98: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4aa0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-4 - sw $14,0x20($24) - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4aa8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ab0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ab8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ab9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x84($21) - sw $15,m68k_ICount - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - and $16,$0,$0 # Clear Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4890: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48a0: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - ori $8,$0,1 - addiu $9,$21,0x3C - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - addiu $14,$14,-2 - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - sw $24,0x34($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x34($29) - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,-4 # Delay slot - sw $14,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48a8: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48b0: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48b8: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48b9: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x8C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48d0: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x90($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48e0: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - ori $8,$0,1 - addiu $9,$21,0x3C - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - addiu $14,$14,-4 - lw $25,0x90($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - sw $24,0x34($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x34($29) - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,-4 # Delay slot - sw $14,0x20($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48e8: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x90($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48f0: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x90($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48f8: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x90($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_48f9: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - lw $5,0x00($9) # Delay slot - lw $25,0x90($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4c90: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $2,$2,16 - sra $2,$2,16 - sw $2,0x00($9) - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4c98: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - sw $24,0x34($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x34($29) - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $2,$2,16 - sra $2,$2,16 - sw $2,0x00($9) - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - sw $14,0x20($24) - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ca8: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $2,$2,16 - sra $2,$2,16 - sw $2,0x00($9) - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cb0: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $2,$2,16 - sra $2,$2,16 - sw $2,0x00($9) - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cb8: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $2,$2,16 - sra $2,$2,16 - sw $2,0x00($9) - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cb9: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x80($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $2,$2,16 - sra $2,$2,16 - sw $2,0x00($9) - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cba: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $2,$2,16 - sra $2,$2,16 - sw $2,0x00($9) - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cbb: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x9C($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sll $2,$2,16 - sra $2,$2,16 - sw $2,0x00($9) - addiu $14,$14,2 - addiu $15,$15,-4 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cd0: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sw $2,0x00($9) - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cd8: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,4 - sw $25,0x20($24) - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - sw $24,0x34($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $24,0x34($29) - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sw $2,0x00($9) - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - sw $14,0x20($24) - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4ce8: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sw $2,0x00($9) - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cf0: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sw $2,0x00($9) - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cf8: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lh $14,0x00($23) - addiu $23,$23,2 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sw $2,0x00($9) - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cf9: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sw $2,0x00($9) - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-28 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cfa: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - lh $7,0x00($23) - subu $25,$23,$22 - addu $14,$25,$7 # Add Offset to PC - addiu $23,$23,2 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sw $2,0x00($9) - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-24 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4cfb: #: - addiu $23,$23,2 - - lhu $12,0x00($23) - addiu $23,$23,2 - subu $14,$23,$22 # Get PC - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - ori $8,$0,1 - or $9,$0,$21 - 9: - and $10,$12,$8 - beq $10,$0,8f - nop # Delay slot - lw $25,0xA0($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $9,0x40($29) - sw $12,0x3C($29) - sw $14,0x38($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x38($29) - lw $12,0x3C($29) - lw $9,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sw $2,0x00($9) - addiu $14,$14,4 - addiu $15,$15,-8 - 8: - sll $8,$8,1 - andi $7,$8,0xffff - bne $7,$0,9b - addiu $9,$9,4 # Delay slot - addiu $15,$15,-26 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e50: #: - addiu $23,$23,2 - - lw $14,0x3C($21) - andi $24,$24,0x07 - addiu $14,$14,-4 - sll $24,$24,2 - addu $24,$24,$21 - lw $5,0x20($24) - sw $14,0x20($24) - lw $25,0x90($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - lh $2,0x00($23) - addiu $23,$23,2 - addu $14,$14,$2 - sw $14,0x3C($21) - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e58: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - sll $8,$8,2 - addu $8,$8,$21 - lw $14,0x20($8) - lw $25,0x84($21) - sw $15,m68k_ICount - sw $8,0x44($29) - sw $14,0x40($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x40($29) - lw $8,0x44($29) - lw $15,m68k_ICount - sw $2,0x20($8) - addiu $14,$14,4 - sw $14,0x3C($21) - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e000: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lb $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - addiu $9,$24,-1 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $24,$24,$25 - sll $25,$9,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $9,$9,$25 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - srav $2,$2,$24 - sb $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e020: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lb $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - addiu $9,$24,-1 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $24,$24,$25 - sll $25,$9,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $9,$9,$25 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - srav $2,$2,$24 - sb $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e040: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - addiu $9,$24,-1 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $24,$24,$25 - sll $25,$9,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $9,$9,$25 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - srav $2,$2,$24 - sh $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e060: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - addiu $9,$24,-1 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $24,$24,$25 - sll $25,$9,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $9,$9,$25 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - srav $2,$2,$24 - sh $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e080: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - addiu $9,$24,-1 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $24,$24,$25 - sll $25,$9,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $9,$9,$25 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - srav $2,$2,$24 - sw $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - addiu $9,$24,-1 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $24,$24,$25 - sll $25,$9,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $9,$9,$25 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - srav $2,$2,$24 - sw $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e100: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lb $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $25,$24,$25 - clz $9,$2 - clo $10,$2 - addiu $9,$9,-24 - addiu $10,$10,-24 - sltu $9,$9,$25 - sltu $10,$10,$25 - or $17,$9,$10 # Set Overflow - subu $9,$0,$24 - andi $9,$9,0x07 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - sllv $2,$2,$24 - sb $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e120: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lb $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $25,$24,$25 - clz $9,$2 - clo $10,$2 - addiu $9,$9,-24 - addiu $10,$10,-24 - sltu $9,$9,$25 - sltu $10,$10,$25 - or $17,$9,$10 # Set Overflow - subu $9,$0,$24 - andi $9,$9,0x07 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - sllv $2,$2,$24 - sb $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e140: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $25,$24,$25 - clz $9,$2 - clo $10,$2 - addiu $9,$9,-16 - addiu $10,$10,-16 - sltu $9,$9,$25 - sltu $10,$10,$25 - or $17,$9,$10 # Set Overflow - subu $9,$0,$24 - andi $9,$9,0x0F - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - sllv $2,$2,$24 - sh $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e160: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lh $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $25,$24,$25 - clz $9,$2 - clo $10,$2 - addiu $9,$9,-16 - addiu $10,$10,-16 - sltu $9,$9,$25 - sltu $10,$10,$25 - or $17,$9,$10 # Set Overflow - subu $9,$0,$24 - andi $9,$9,0x0F - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - sllv $2,$2,$24 - sh $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e180: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $25,$24,$25 - clz $9,$2 - clo $10,$2 - sltu $9,$9,$25 - sltu $10,$10,$25 - or $17,$9,$10 # Set Overflow - subu $9,$0,$24 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - sllv $2,$2,$24 - sw $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1a0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - and $17,$0,$0 # Clear Overflow - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - sll $25,$24,26 - sra $25,$25,31 - andi $25,$25,0x1f - or $25,$24,$25 - clz $9,$2 - clo $10,$2 - sltu $9,$9,$25 - sltu $10,$10,$25 - or $17,$9,$10 # Set Overflow - andi $9,$24,0x20 - movn $2,$0,$9 - subu $9,$0,$24 - srlv $16,$2,$9 - andi $16,$16,0x01 # Set Carry - sllv $2,$2,$24 - sw $2,0x00($8) - or $20,$0,$16 # Copy Carry to X - 9: - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e300: #: - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lbu $3,0x00($24) - - addiu $23,$23,2 - - sll $2,$3,1 - sb $2,0x00($24) - srl $16,$3,7 # Set Carry - xor $17,$2,$3 - srl $17,$17,7 - andi $17,$17,0x01 # Set Overflow - andi $18,$2,0xFF - sltiu $18,$18,1 # Set Zero - srl $19,$2,7 # Set Sign - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e340: #: - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lhu $3,0x00($24) - - addiu $23,$23,2 - - sll $2,$3,1 - sh $2,0x00($24) - srl $16,$3,15 # Set Carry - xor $17,$2,$3 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - andi $18,$2,0xFFFF - sltiu $18,$18,1 # Set Zero - srl $19,$2,15 # Set Sign - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e380: #: - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $3,0x00($24) - - addiu $23,$23,2 - - sll $2,$3,1 - sw $2,0x00($24) - srl $16,$3,31 # Set Carry - xor $17,$2,$3 - srl $17,$17,31 # Set Overflow - or $18,$0,$2 - sltiu $18,$18,1 # Set Zero - srl $19,$2,31 # Set Sign - or $20,$0,$16 # Copy Carry to X - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0d0: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - andi $16,$2,0x01 # Set Carry - and $17,$0,$0 # Clear Overflow - sra $2,$2,1 - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0d8: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - andi $16,$2,0x01 # Set Carry - and $17,$0,$0 # Clear Overflow - sra $2,$2,1 - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0e0: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - andi $16,$2,0x01 # Set Carry - and $17,$0,$0 # Clear Overflow - sra $2,$2,1 - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0e8: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - andi $16,$2,0x01 # Set Carry - and $17,$0,$0 # Clear Overflow - sra $2,$2,1 - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0f0: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - andi $16,$2,0x01 # Set Carry - and $17,$0,$0 # Clear Overflow - sra $2,$2,1 - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0f8: #: - - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - andi $16,$2,0x01 # Set Carry - and $17,$0,$0 # Clear Overflow - sra $2,$2,1 - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0f9: #: - - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - seh $2,$2 - andi $16,$2,0x01 # Set Carry - and $17,$0,$0 # Clear Overflow - sra $2,$2,1 - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1d0: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $3,$0,$2 - sll $2,$3,1 - srl $16,$3,15 # Set Carry - xor $17,$2,$3 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - andi $2,$2,0xffff - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1d8: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $3,$0,$2 - sll $2,$3,1 - srl $16,$3,15 # Set Carry - xor $17,$2,$3 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - andi $2,$2,0xffff - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1e0: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $3,$0,$2 - sll $2,$3,1 - srl $16,$3,15 # Set Carry - xor $17,$2,$3 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - andi $2,$2,0xffff - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1e8: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $3,$0,$2 - sll $2,$3,1 - srl $16,$3,15 # Set Carry - xor $17,$2,$3 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - andi $2,$2,0xffff - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1f0: #: - - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $3,$0,$2 - sll $2,$3,1 - srl $16,$3,15 # Set Carry - xor $17,$2,$3 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - andi $2,$2,0xffff - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1f8: #: - - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $3,$0,$2 - sll $2,$3,1 - srl $16,$3,15 # Set Carry - xor $17,$2,$3 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - andi $2,$2,0xffff - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1f9: #: - - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - or $3,$0,$2 - sll $2,$3,1 - srl $16,$3,15 # Set Carry - xor $17,$2,$3 - srl $17,$17,15 - andi $17,$17,0x01 # Set Overflow - andi $2,$2,0xffff - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - or $20,$0,$16 # Copy Carry to X - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e010: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - andi $20,$2,0x01 # Set X - sll $16,$16,7 - srl $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,9 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - addiu $10,$11,-1 - sllv $16,$16,$10 - srlv $20,$2,$9 - andi $20,$20,0x01 # Set X - sllv $25,$2,$11 - srlv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e030: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - andi $20,$2,0x01 # Set X - sll $16,$16,7 - srl $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,9 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - addiu $10,$11,-1 - sllv $16,$16,$10 - srlv $20,$2,$9 - andi $20,$20,0x01 # Set X - sllv $25,$2,$11 - srlv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e050: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - andi $20,$2,0x01 # Set X - sll $16,$16,15 - srl $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,17 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - addiu $10,$11,-1 - sllv $16,$16,$10 - srlv $20,$2,$9 - andi $20,$20,0x01 # Set X - sllv $25,$2,$11 - srlv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e070: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - andi $20,$2,0x01 # Set X - sll $16,$16,15 - srl $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,17 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - addiu $10,$11,-1 - sllv $16,$16,$10 - srlv $20,$2,$9 - andi $20,$20,0x01 # Set X - sllv $25,$2,$11 - srlv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e090: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - andi $20,$2,0x01 # Set X - sll $16,$16,31 - srl $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,33 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - addiu $10,$11,-1 - sllv $16,$16,$10 - srlv $20,$2,$9 - andi $20,$20,0x01 # Set X - sllv $25,$2,$11 - srlv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - andi $20,$2,0x01 # Set X - sll $16,$16,31 - srl $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,33 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - addiu $10,$11,-1 - sllv $16,$16,$10 - srlv $20,$2,$9 - andi $20,$20,0x01 # Set X - sllv $25,$2,$11 - srlv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e110: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - srl $20,$2,7 # Set X - sll $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,9 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - sllv $16,$16,$9 - srlv $20,$2,$11 - andi $20,$20,0x01 # Set X - srlv $25,$2,$11 - sllv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e130: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - srl $20,$2,7 # Set X - sll $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,9 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - sllv $16,$16,$9 - srlv $20,$2,$11 - andi $20,$20,0x01 # Set X - srlv $25,$2,$11 - sllv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e150: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - srl $20,$2,15 # Set X - sll $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,17 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - sllv $16,$16,$9 - srlv $20,$2,$11 - andi $20,$20,0x01 # Set X - srlv $25,$2,$11 - sllv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e170: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - srl $20,$2,15 # Set X - sll $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,17 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - sllv $16,$16,$9 - srlv $20,$2,$11 - andi $20,$20,0x01 # Set X - srlv $25,$2,$11 - sllv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e190: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - srl $20,$2,31 # Set X - sll $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,33 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - sllv $16,$16,$9 - srlv $20,$2,$11 - andi $20,$20,0x01 # Set X - srlv $25,$2,$11 - sllv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1b0: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - beq $24,$0,9f - or $16,$0,$20 # Delay slot - Copy X to Carry - sll $25,$24,1 - andi $9,$24,1 - bne $9,$24,7f - subu $15,$15,$25 # Delay slot - srl $20,$2,31 # Set X - sll $2,$2,1 - bgez $0,6f - or $2,$2,$16 # Delay slot - 7: - ori $11,$0,33 - 8: - subu $9,$24,$11 - addiu $25,$9,-1 - slt $25,$25,$0 - beq $25,$0,8b - movz $24,$9,$25 # Delay slot - subu $11,$11,$24 - addiu $9,$24,-1 - sllv $16,$16,$9 - srlv $20,$2,$11 - andi $20,$20,0x01 # Set X - srlv $25,$2,$11 - sllv $2,$2,$24 - or $2,$2,$25 - or $2,$2,$16 - 6: - or $16,$0,$20 # Copy X to Carry - 9: - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e210: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lbu $2,0x00($24) - sll $9,$20,7 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e250: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lhu $2,0x00($24) - sll $9,$20,15 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e290: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $2,0x00($24) - sll $9,$20,31 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($24) - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e310: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lbu $2,0x00($24) - or $9,$0,$20 - srl $20,$2,7 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - sb $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e350: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lhu $2,0x00($24) - or $9,$0,$20 - srl $20,$2,15 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - sh $2,0x00($24) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e390: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $2,0x00($24) - or $9,$0,$20 - srl $20,$2,31 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - and $17,$0,$0 # Clear Overflow - srl $19,$2,31 # Set Sign - sltiu $18,$2,1 # Set Zero - sw $2,0x00($24) - addiu $15,$15,-10 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e4d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $9,$20,15 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e4d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $9,$20,15 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e4e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $9,$20,15 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e4e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $9,$20,15 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e4f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $9,$20,15 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e4f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $9,$20,15 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e4f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $9,$20,15 - andi $20,$2,0x01 # Set X - srl $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e5d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $9,$20,0x01 - srl $20,$2,15 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e5d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $9,$20,0x01 - srl $20,$2,15 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e5e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $9,$20,0x01 - srl $20,$2,15 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e5e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $9,$20,0x01 - srl $20,$2,15 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e5f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $9,$20,0x01 - srl $20,$2,15 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e5f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $9,$20,0x01 - srl $20,$2,15 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e5f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $9,$20,0x01 - srl $20,$2,15 # Set X - sll $2,$2,1 - or $2,$2,$9 - or $16,$0,$20 # Copy X to Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e008: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - srlv $16,$2,$10 - andi $16,$16,0x01 # Set Carry - srlv $2,$2,$24 - andi $2,$2,0xFF - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e028: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - srlv $16,$2,$10 - andi $16,$16,0x01 # Set Carry - srlv $2,$2,$24 - andi $2,$2,0xFF - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e048: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - srlv $16,$2,$10 - andi $16,$16,0x01 # Set Carry - srlv $2,$2,$24 - andi $2,$2,0xFFFF - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e068: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - srlv $16,$2,$10 - andi $16,$16,0x01 # Set Carry - srlv $2,$2,$24 - andi $2,$2,0xFFFF - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e088: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - srlv $16,$2,$10 - andi $16,$16,0x01 # Set Carry - srlv $2,$2,$24 - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - srlv $16,$2,$10 - andi $16,$16,0x01 # Set Carry - srlv $2,$2,$24 - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e108: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - sll $16,$2,24 - sllv $16,$16,$10 - srl $16,$16,31 # Set Carry - sllv $2,$2,$24 - andi $2,$2,0xFF - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e128: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - sll $16,$2,24 - sllv $16,$16,$10 - srl $16,$16,31 # Set Carry - sllv $2,$2,$24 - andi $2,$2,0xFF - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - srl $19,$2,7 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e148: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - sll $16,$2,16 - sllv $16,$16,$10 - srl $16,$16,31 # Set Carry - sllv $2,$2,$24 - andi $2,$2,0xFFFF - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e168: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - sll $16,$2,16 - sllv $16,$16,$10 - srl $16,$16,31 # Set Carry - sllv $2,$2,$24 - andi $2,$2,0xFFFF - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e188: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - sllv $16,$16,$10 - srl $16,$16,31 # Set Carry - sllv $2,$2,$24 - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1a8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $25,$24,1 - subu $15,$15,$25 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - andi $9,$24,0x20 - addiu $10,$24,-1 - andi $11,$10,0x20 - sllv $16,$16,$10 - srl $16,$16,31 # Set Carry - sllv $2,$2,$24 - movn $2,$0,$9 # Return 0 if shift by 32-63 - movn $16,$0,$11 # Clear Carry if shift by >32 - movz $16,$0,$24 # Clear Carry if shift by 0 - and $17,$0,$0 # Clear Overflow - slt $19,$2,$0 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e2d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $16,$2,0x01 # Set Carry - srl $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e2d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $16,$2,0x01 # Set Carry - srl $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e2e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $16,$2,0x01 # Set Carry - srl $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e2e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $16,$2,0x01 # Set Carry - srl $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e2f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $16,$2,0x01 # Set Carry - srl $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e2f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $16,$2,0x01 # Set Carry - srl $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e2f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - andi $16,$2,0x01 # Set Carry - srl $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e3d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $16,$2,15 # Set Carry - sll $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e3d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $16,$2,15 # Set Carry - sll $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e3e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $16,$2,15 # Set Carry - sll $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e3e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $16,$2,15 # Set Carry - sll $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e3f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $16,$2,15 # Set Carry - sll $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e3f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $16,$2,15 # Set Carry - sll $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e3f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $16,$2,15 # Set Carry - sll $2,$2,1 - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - srl $19,$2,15 # Set Sign - sltiu $18,$2,1 # Set Zero - movn $20,$16,$24 # Set X if not shift by 0 - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e018: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - andi $24,$24,0x07 - subu $25,$0,$24 - andi $25,$25,0x07 - sllv $25,$2,$25 - srlv $2,$2,$24 - or $2,$2,$25 - srl $16,$2,7 # Set Carry - 9: - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,7 # Set Sign - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e038: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - andi $24,$24,0x07 - subu $25,$0,$24 - andi $25,$25,0x07 - sllv $25,$2,$25 - srlv $2,$2,$24 - or $2,$2,$25 - srl $16,$2,7 # Set Carry - 9: - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,7 # Set Sign - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e058: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - andi $24,$24,0x0F - subu $25,$0,$24 - andi $25,$25,0x0F - sllv $25,$2,$25 - srlv $2,$2,$24 - or $2,$2,$25 - srl $16,$2,15 # Set Carry - 9: - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e078: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - andi $24,$24,0x0F - subu $25,$0,$24 - andi $25,$25,0x0F - sllv $25,$2,$25 - srlv $2,$2,$24 - or $2,$2,$25 - srl $16,$2,15 # Set Carry - 9: - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e098: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - rorv $2,$2,$24 - srl $16,$2,31 # Set Carry - 9: - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,31 # Set Sign - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e0b8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - rorv $2,$2,$24 - srl $16,$2,31 # Set Carry - 9: - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,31 # Set Sign - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e118: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - andi $24,$24,0x07 - subu $25,$0,$24 - andi $25,$25,0x07 - srlv $25,$2,$25 - sllv $2,$2,$24 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - 9: - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,7 # Set Sign - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e138: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lbu $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - andi $24,$24,0x07 - subu $25,$0,$24 - andi $25,$25,0x07 - srlv $25,$2,$25 - sllv $2,$2,$24 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - 9: - andi $2,$2,0xFF - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,7 # Set Sign - sb $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e158: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - andi $24,$24,0x0F - subu $25,$0,$24 - andi $25,$25,0x0F - srlv $25,$2,$25 - sllv $2,$2,$24 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - 9: - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e178: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lhu $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - andi $24,$24,0x0F - subu $25,$0,$24 - andi $25,$25,0x0F - srlv $25,$2,$25 - sllv $2,$2,$24 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - 9: - andi $2,$2,0xFFFF - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - sh $2,0x00($8) - addiu $15,$15,-6 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e198: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,9 - addiu $24,$24,-1 # Move range down - andi $24,$24,0x07 # Mask out lower bits - addiu $24,$24,1 # correct range - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - subu $25,$0,$24 - rorv $2,$2,$25 - andi $16,$2,0x01 # Set Carry - 9: - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,31 # Set Sign - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e1b8: #: - addiu $23,$23,2 - - andi $8,$24,0x07 - srl $24,$24,7 - andi $24,$24,0x1C - addu $24,$24,$21 - lw $24,0x00($24) - andi $24,$24,0x3F - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - beq $24,$0,9f - and $16,$0,$0 # Delay slot - Clear Carry - sll $25,$24,1 - subu $15,$15,$25 - subu $25,$0,$24 - rorv $2,$2,$25 - andi $16,$2,0x01 # Set Carry - 9: - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,31 # Set Sign - sw $2,0x00($8) - addiu $15,$15,-8 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e6d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $25,$2,15 - srl $2,$2,1 - or $2,$2,$25 - srl $16,$2,15 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e6d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $25,$2,15 - srl $2,$2,1 - or $2,$2,$25 - srl $16,$2,15 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e6e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $25,$2,15 - srl $2,$2,1 - or $2,$2,$25 - srl $16,$2,15 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e6e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $25,$2,15 - srl $2,$2,1 - or $2,$2,$25 - srl $16,$2,15 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e6f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $25,$2,15 - srl $2,$2,1 - or $2,$2,$25 - srl $16,$2,15 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e6f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $25,$2,15 - srl $2,$2,1 - or $2,$2,$25 - srl $16,$2,15 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e6f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - sll $25,$2,15 - srl $2,$2,1 - or $2,$2,$25 - srl $16,$2,15 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e7d0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $25,$2,15 - sll $2,$2,1 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e7d8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $25,$14,2 - sw $25,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $25,$2,15 - sll $2,$2,1 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-12 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e7e0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $14,$14,-2 - sw $14,0x20($24) - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $25,$2,15 - sll $2,$2,1 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-14 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e7e8: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - lh $7,0x00($23) - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - addiu $23,$23,2 - addu $14,$14,$7 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $25,$2,15 - sll $2,$2,1 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e7f0: #: - addiu $23,$23,2 - - andi $24,$24,0x07 - sll $24,$24,2 - addu $24,$24,$21 - lw $14,0x20($24) - lhu $7,0x00($23) - addiu $23,$23,2 - seb $6,$7 - or $25,$0,$7 - srl $7,$7,12 - andi $25,$25,0x0800 - sll $7,$7,2 - addu $7,$7,$21 - bne $25,$0,0f - lw $25,0x00($7) # Delay slot - seh $25,$25 - 0: - addu $25,$14,$25 - addu $14,$25,$6 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $25,$2,15 - sll $2,$2,1 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-18 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e7f8: #: - addiu $23,$23,2 - - lh $14,0x00($23) - addiu $23,$23,2 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $25,$2,15 - sll $2,$2,1 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_e7f9: #: - addiu $23,$23,2 - - lhu $14,0x00($23) - lhu $25,0x02($23) - sll $14,$14,16 - or $14,$14,$25 - addiu $23,$23,4 - lw $25,0x80($21) - sw $15,m68k_ICount - sw $14,0x44($29) - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $14,0x44($29) - lw $15,m68k_ICount - srl $25,$2,15 - sll $2,$2,1 - or $2,$2,$25 - andi $16,$2,0x01 # Set Carry - andi $2,$2,0xffff - and $17,$0,$0 # Clear Overflow - sltiu $18,$2,1 # Set Zero - srl $19,$2,15 # Set Sign - lw $25,0x8C($21) - sw $15,m68k_ICount - or $5,$0,$2 - or $4,$0,$14 - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - addiu $15,$15,-20 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_a000: #: - addiu $23,$23,2 - - addiu $23,$23,-2 - jal Exception - ori $2,$0,10 - - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_f000: #: - addiu $23,$23,2 - - addiu $23,$23,-2 - jal Exception - ori $2,$0,11 - - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -ILLEGAL: - subu $25,$23,$22 - sw $24,illegal_op - sw $25,illegal_pc - addiu $23,$23,-2 - jal Exception - ori $2,$0,4 - - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e74: #: - lw $25,0x70($21) - bne $25,$0,0f - nop # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - lw $4,0x3C($21) - lw $25,0x84($21) - sw $15,m68k_ICount - jalr $25 - sw $23,0x4C($21) # Delay slot - lw $15,m68k_ICount - lh $8,0x00($23) - lw $9,0x3C($21) - addiu $8,$8,4 - addu $9,$8,$9 - sw $9,0x3C($21) - andi $25,$2,0x01 - beq $25,$0,2f - addu $23,$22,$2 # Delay slot - addiu $23,$23,-2 - jal Exception - ori $2,$0,3 - - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 2: - sw $2,0x74($21) - lw $6,mem_amask - lw $25,0x94($21) - and $23,$2,$6 - sw $15,m68k_ICount - jalr $25 - or $4,$0,$23 # Delay slot - lw $15,m68k_ICount - lw $22,OP_ROM - addu $23,$23,$22 - # End of Banking code: - addiu $15,$15,-16 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e7a: #: - lw $25,0x70($21) - bne $25,$0,0f - nop # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - lhu $8,0x00($23) - addiu $23,$23,2 - andi $2,$8,0x01 - srl $24,$8,10 - andi $24,$24,0x02 - or $24,$24,$2 - srl $8,$8,12 - sll $24,$24,2 - addu $24,$24,$21 - addiu $24,$24,96 - lw $2,0x00($24) - sll $8,$8,2 - addu $8,$8,$21 - sw $2,0x00($8) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - -OP0_4e7b: #: - lw $25,0x70($21) - bne $25,$0,0f - nop # Delay slot - j ILLEGAL - 0: - nop # Delay slot - - lbu $8,0x44($21) - andi $8,$8,0x20 # Supervisor Mode ? - beq $8,$0,9f - addiu $23,$23,2 # Delay slot - lhu $8,0x00($23) - addiu $23,$23,2 - andi $2,$8,0x01 - srl $24,$8,10 - andi $24,$24,0x02 - or $24,$24,$2 - srl $8,$8,12 - sll $8,$8,2 - addu $8,$8,$21 - lw $2,0x00($8) - andi $9,$24,0x02 - bne $9,$0,8f - nop # Delay slot - andi $2,$2,0x07 - 8: - sll $24,$24,2 - addu $24,$24,$21 - addiu $24,$24,96 - sw $2,0x00($24) - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - 9: - addiu $23,$23,-2 - jal Exception - ori $2,$0,8 - - addiu $15,$15,-4 - bgez $15,3f - lhu $24,0x00($23) # Delay slot - j MainExit - 3: - sll $7,$24,2 # Delay slot - addu $7,$7,$30 - lw $7,0x00($7) - jr $7 - nop # Delay slot - - .data - - .align 6 - - - # Register Structure - -M68000_regs: -R_D0: .word 0 # Data Registers -R_D1: .word 0 -R_D2: .word 0 -R_D3: .word 0 -R_D4: .word 0 -R_D5: .word 0 -R_D6: .word 0 -R_D7: .word 0 - -R_A0: .word 0 # Address Registers -R_A1: .word 0 -R_A2: .word 0 -R_A3: .word 0 -R_A4: .word 0 -R_A5: .word 0 -R_A6: .word 0 -R_A7: .word 0 - -R_ISP: .word 0 # Supervisor Stack -R_SR_H: .word 0 # Status Register High TuSuuIII -R_SR: .word 0 # Motorola Format SR - -R_PC: .word 0 # Program Counter -R_IRQ: .word 0 # IRQ Request Level - -R_IRQ_CALLBACK: .word 0 # irq callback (get vector) - -R_PPC: .word 0 # Previous Program Counter -R_RESET_CALLBACK: .word 0 # Reset Callback -R_SFC: .word 0 # Source Function Call -R_DFC: .word 0 # Destination Function Call -R_USP: .word 0 # User Stack -R_VBR: .word 0 # Vector Base -CPUversion: .word 0 - -FullPC: .word 0 - -a68k_memory_intf: - .rept 13 - .word 0 - .endr - - -exception_cycles: - .byte 0, 0, 0, 0, 38, 42, 44, 38, 38, 0, 38, 38, 0, 0, 0, 0 - .byte 0, 0, 0, 0, 0, 0, 0, 0, 46, 46, 46, 46, 46, 46, 46, 46 - .byte 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38 - - .align 2 - # Jump Table - -M68000_OPCODETABLE: -.include "a68ktbl.inc" - diff --git a/jan/src/cpu/a68k/mips/a68ktbl.inc b/jan/src/cpu/a68k/mips/a68ktbl.inc deleted file mode 100644 index e610e0435..000000000 --- a/jan/src/cpu/a68k/mips/a68ktbl.inc +++ /dev/null @@ -1,18988 +0,0 @@ -.rept 8 - .word OP0_0000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0010 -.endr -.rept 7 - .word OP0_0018 -.endr -.word OP0_001f -.rept 7 - .word OP0_0020 -.endr -.word OP0_0027 -.rept 8 - .word OP0_0028 -.endr -.rept 8 - .word OP0_0030 -.endr -.word OP0_0038 -.word OP0_0039 -.rept 2 - .word ILLEGAL -.endr -.word OP0_003c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0050 -.endr -.rept 8 - .word OP0_0058 -.endr -.rept 8 - .word OP0_0060 -.endr -.rept 8 - .word OP0_0068 -.endr -.rept 8 - .word OP0_0070 -.endr -.word OP0_0078 -.word OP0_0079 -.rept 2 - .word ILLEGAL -.endr -.word OP0_007c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0090 -.endr -.rept 8 - .word OP0_0098 -.endr -.rept 8 - .word OP0_00a0 -.endr -.rept 8 - .word OP0_00a8 -.endr -.rept 8 - .word OP0_00b0 -.endr -.word OP0_00b8 -.word OP0_00b9 -.rept 70 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0100 -.endr -.rept 8 - .word OP0_0108 -.endr -.rept 8 - .word OP0_0110 -.endr -.rept 7 - .word OP0_0118 -.endr -.word OP0_011f -.rept 7 - .word OP0_0120 -.endr -.word OP0_0127 -.rept 8 - .word OP0_0128 -.endr -.rept 8 - .word OP0_0130 -.endr -.word OP0_0138 -.word OP0_0139 -.word OP0_013a -.word OP0_013b -.word OP0_013c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0140 -.endr -.rept 8 - .word OP0_0148 -.endr -.rept 8 - .word OP0_0150 -.endr -.rept 7 - .word OP0_0158 -.endr -.word OP0_015f -.rept 7 - .word OP0_0160 -.endr -.word OP0_0167 -.rept 8 - .word OP0_0168 -.endr -.rept 8 - .word OP0_0170 -.endr -.word OP0_0178 -.word OP0_0179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0180 -.endr -.rept 8 - .word OP0_0188 -.endr -.rept 8 - .word OP0_0190 -.endr -.rept 7 - .word OP0_0198 -.endr -.word OP0_019f -.rept 7 - .word OP0_01a0 -.endr -.word OP0_01a7 -.rept 8 - .word OP0_01a8 -.endr -.rept 8 - .word OP0_01b0 -.endr -.word OP0_01b8 -.word OP0_01b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_01c0 -.endr -.rept 8 - .word OP0_01c8 -.endr -.rept 8 - .word OP0_01d0 -.endr -.rept 7 - .word OP0_01d8 -.endr -.word OP0_01df -.rept 7 - .word OP0_01e0 -.endr -.word OP0_01e7 -.rept 8 - .word OP0_01e8 -.endr -.rept 8 - .word OP0_01f0 -.endr -.word OP0_01f8 -.word OP0_01f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0200 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0210 -.endr -.rept 7 - .word OP0_0218 -.endr -.word OP0_021f -.rept 7 - .word OP0_0220 -.endr -.word OP0_0227 -.rept 8 - .word OP0_0228 -.endr -.rept 8 - .word OP0_0230 -.endr -.word OP0_0238 -.word OP0_0239 -.rept 2 - .word ILLEGAL -.endr -.word OP0_023c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0240 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0250 -.endr -.rept 8 - .word OP0_0258 -.endr -.rept 8 - .word OP0_0260 -.endr -.rept 8 - .word OP0_0268 -.endr -.rept 8 - .word OP0_0270 -.endr -.word OP0_0278 -.word OP0_0279 -.rept 2 - .word ILLEGAL -.endr -.word OP0_027c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0280 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0290 -.endr -.rept 8 - .word OP0_0298 -.endr -.rept 8 - .word OP0_02a0 -.endr -.rept 8 - .word OP0_02a8 -.endr -.rept 8 - .word OP0_02b0 -.endr -.word OP0_02b8 -.word OP0_02b9 -.rept 70 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0100 -.endr -.rept 8 - .word OP0_0108 -.endr -.rept 8 - .word OP0_0110 -.endr -.rept 7 - .word OP0_0118 -.endr -.word OP0_011f -.rept 7 - .word OP0_0120 -.endr -.word OP0_0127 -.rept 8 - .word OP0_0128 -.endr -.rept 8 - .word OP0_0130 -.endr -.word OP0_0138 -.word OP0_0139 -.word OP0_013a -.word OP0_013b -.word OP0_013c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0140 -.endr -.rept 8 - .word OP0_0148 -.endr -.rept 8 - .word OP0_0150 -.endr -.rept 7 - .word OP0_0158 -.endr -.word OP0_015f -.rept 7 - .word OP0_0160 -.endr -.word OP0_0167 -.rept 8 - .word OP0_0168 -.endr -.rept 8 - .word OP0_0170 -.endr -.word OP0_0178 -.word OP0_0179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0180 -.endr -.rept 8 - .word OP0_0188 -.endr -.rept 8 - .word OP0_0190 -.endr -.rept 7 - .word OP0_0198 -.endr -.word OP0_019f -.rept 7 - .word OP0_01a0 -.endr -.word OP0_01a7 -.rept 8 - .word OP0_01a8 -.endr -.rept 8 - .word OP0_01b0 -.endr -.word OP0_01b8 -.word OP0_01b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_01c0 -.endr -.rept 8 - .word OP0_01c8 -.endr -.rept 8 - .word OP0_01d0 -.endr -.rept 7 - .word OP0_01d8 -.endr -.word OP0_01df -.rept 7 - .word OP0_01e0 -.endr -.word OP0_01e7 -.rept 8 - .word OP0_01e8 -.endr -.rept 8 - .word OP0_01f0 -.endr -.word OP0_01f8 -.word OP0_01f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0400 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0410 -.endr -.rept 7 - .word OP0_0418 -.endr -.word OP0_041f -.rept 7 - .word OP0_0420 -.endr -.word OP0_0427 -.rept 8 - .word OP0_0428 -.endr -.rept 8 - .word OP0_0430 -.endr -.word OP0_0438 -.word OP0_0439 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0440 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0450 -.endr -.rept 8 - .word OP0_0458 -.endr -.rept 8 - .word OP0_0460 -.endr -.rept 8 - .word OP0_0468 -.endr -.rept 8 - .word OP0_0470 -.endr -.word OP0_0478 -.word OP0_0479 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0480 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0490 -.endr -.rept 8 - .word OP0_0498 -.endr -.rept 8 - .word OP0_04a0 -.endr -.rept 8 - .word OP0_04a8 -.endr -.rept 8 - .word OP0_04b0 -.endr -.word OP0_04b8 -.word OP0_04b9 -.rept 70 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0100 -.endr -.rept 8 - .word OP0_0108 -.endr -.rept 8 - .word OP0_0110 -.endr -.rept 7 - .word OP0_0118 -.endr -.word OP0_011f -.rept 7 - .word OP0_0120 -.endr -.word OP0_0127 -.rept 8 - .word OP0_0128 -.endr -.rept 8 - .word OP0_0130 -.endr -.word OP0_0138 -.word OP0_0139 -.word OP0_013a -.word OP0_013b -.word OP0_013c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0140 -.endr -.rept 8 - .word OP0_0148 -.endr -.rept 8 - .word OP0_0150 -.endr -.rept 7 - .word OP0_0158 -.endr -.word OP0_015f -.rept 7 - .word OP0_0160 -.endr -.word OP0_0167 -.rept 8 - .word OP0_0168 -.endr -.rept 8 - .word OP0_0170 -.endr -.word OP0_0178 -.word OP0_0179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0180 -.endr -.rept 8 - .word OP0_0188 -.endr -.rept 8 - .word OP0_0190 -.endr -.rept 7 - .word OP0_0198 -.endr -.word OP0_019f -.rept 7 - .word OP0_01a0 -.endr -.word OP0_01a7 -.rept 8 - .word OP0_01a8 -.endr -.rept 8 - .word OP0_01b0 -.endr -.word OP0_01b8 -.word OP0_01b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_01c0 -.endr -.rept 8 - .word OP0_01c8 -.endr -.rept 8 - .word OP0_01d0 -.endr -.rept 7 - .word OP0_01d8 -.endr -.word OP0_01df -.rept 7 - .word OP0_01e0 -.endr -.word OP0_01e7 -.rept 8 - .word OP0_01e8 -.endr -.rept 8 - .word OP0_01f0 -.endr -.word OP0_01f8 -.word OP0_01f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0600 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0610 -.endr -.rept 7 - .word OP0_0618 -.endr -.word OP0_061f -.rept 7 - .word OP0_0620 -.endr -.word OP0_0627 -.rept 8 - .word OP0_0628 -.endr -.rept 8 - .word OP0_0630 -.endr -.word OP0_0638 -.word OP0_0639 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0640 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0650 -.endr -.rept 8 - .word OP0_0658 -.endr -.rept 8 - .word OP0_0660 -.endr -.rept 8 - .word OP0_0668 -.endr -.rept 8 - .word OP0_0670 -.endr -.word OP0_0678 -.word OP0_0679 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0680 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0690 -.endr -.rept 8 - .word OP0_0698 -.endr -.rept 8 - .word OP0_06a0 -.endr -.rept 8 - .word OP0_06a8 -.endr -.rept 8 - .word OP0_06b0 -.endr -.word OP0_06b8 -.word OP0_06b9 -.rept 70 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0100 -.endr -.rept 8 - .word OP0_0108 -.endr -.rept 8 - .word OP0_0110 -.endr -.rept 7 - .word OP0_0118 -.endr -.word OP0_011f -.rept 7 - .word OP0_0120 -.endr -.word OP0_0127 -.rept 8 - .word OP0_0128 -.endr -.rept 8 - .word OP0_0130 -.endr -.word OP0_0138 -.word OP0_0139 -.word OP0_013a -.word OP0_013b -.word OP0_013c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0140 -.endr -.rept 8 - .word OP0_0148 -.endr -.rept 8 - .word OP0_0150 -.endr -.rept 7 - .word OP0_0158 -.endr -.word OP0_015f -.rept 7 - .word OP0_0160 -.endr -.word OP0_0167 -.rept 8 - .word OP0_0168 -.endr -.rept 8 - .word OP0_0170 -.endr -.word OP0_0178 -.word OP0_0179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0180 -.endr -.rept 8 - .word OP0_0188 -.endr -.rept 8 - .word OP0_0190 -.endr -.rept 7 - .word OP0_0198 -.endr -.word OP0_019f -.rept 7 - .word OP0_01a0 -.endr -.word OP0_01a7 -.rept 8 - .word OP0_01a8 -.endr -.rept 8 - .word OP0_01b0 -.endr -.word OP0_01b8 -.word OP0_01b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_01c0 -.endr -.rept 8 - .word OP0_01c8 -.endr -.rept 8 - .word OP0_01d0 -.endr -.rept 7 - .word OP0_01d8 -.endr -.word OP0_01df -.rept 7 - .word OP0_01e0 -.endr -.word OP0_01e7 -.rept 8 - .word OP0_01e8 -.endr -.rept 8 - .word OP0_01f0 -.endr -.word OP0_01f8 -.word OP0_01f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0800 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0810 -.endr -.rept 7 - .word OP0_0818 -.endr -.word OP0_081f -.rept 7 - .word OP0_0820 -.endr -.word OP0_0827 -.rept 8 - .word OP0_0828 -.endr -.rept 8 - .word OP0_0830 -.endr -.word OP0_0838 -.word OP0_0839 -.word OP0_083a -.word OP0_083b -.rept 4 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0840 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0850 -.endr -.rept 7 - .word OP0_0858 -.endr -.word OP0_085f -.rept 7 - .word OP0_0860 -.endr -.word OP0_0867 -.rept 8 - .word OP0_0868 -.endr -.rept 8 - .word OP0_0870 -.endr -.word OP0_0878 -.word OP0_0879 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0880 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0890 -.endr -.rept 7 - .word OP0_0898 -.endr -.word OP0_089f -.rept 7 - .word OP0_08a0 -.endr -.word OP0_08a7 -.rept 8 - .word OP0_08a8 -.endr -.rept 8 - .word OP0_08b0 -.endr -.word OP0_08b8 -.word OP0_08b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_08c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_08d0 -.endr -.rept 7 - .word OP0_08d8 -.endr -.word OP0_08df -.rept 7 - .word OP0_08e0 -.endr -.word OP0_08e7 -.rept 8 - .word OP0_08e8 -.endr -.rept 8 - .word OP0_08f0 -.endr -.word OP0_08f8 -.word OP0_08f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0100 -.endr -.rept 8 - .word OP0_0108 -.endr -.rept 8 - .word OP0_0110 -.endr -.rept 7 - .word OP0_0118 -.endr -.word OP0_011f -.rept 7 - .word OP0_0120 -.endr -.word OP0_0127 -.rept 8 - .word OP0_0128 -.endr -.rept 8 - .word OP0_0130 -.endr -.word OP0_0138 -.word OP0_0139 -.word OP0_013a -.word OP0_013b -.word OP0_013c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0140 -.endr -.rept 8 - .word OP0_0148 -.endr -.rept 8 - .word OP0_0150 -.endr -.rept 7 - .word OP0_0158 -.endr -.word OP0_015f -.rept 7 - .word OP0_0160 -.endr -.word OP0_0167 -.rept 8 - .word OP0_0168 -.endr -.rept 8 - .word OP0_0170 -.endr -.word OP0_0178 -.word OP0_0179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0180 -.endr -.rept 8 - .word OP0_0188 -.endr -.rept 8 - .word OP0_0190 -.endr -.rept 7 - .word OP0_0198 -.endr -.word OP0_019f -.rept 7 - .word OP0_01a0 -.endr -.word OP0_01a7 -.rept 8 - .word OP0_01a8 -.endr -.rept 8 - .word OP0_01b0 -.endr -.word OP0_01b8 -.word OP0_01b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_01c0 -.endr -.rept 8 - .word OP0_01c8 -.endr -.rept 8 - .word OP0_01d0 -.endr -.rept 7 - .word OP0_01d8 -.endr -.word OP0_01df -.rept 7 - .word OP0_01e0 -.endr -.word OP0_01e7 -.rept 8 - .word OP0_01e8 -.endr -.rept 8 - .word OP0_01f0 -.endr -.word OP0_01f8 -.word OP0_01f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0a00 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0a10 -.endr -.rept 7 - .word OP0_0a18 -.endr -.word OP0_0a1f -.rept 7 - .word OP0_0a20 -.endr -.word OP0_0a27 -.rept 8 - .word OP0_0a28 -.endr -.rept 8 - .word OP0_0a30 -.endr -.word OP0_0a38 -.word OP0_0a39 -.rept 2 - .word ILLEGAL -.endr -.word OP0_0a3c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0a40 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0a50 -.endr -.rept 8 - .word OP0_0a58 -.endr -.rept 8 - .word OP0_0a60 -.endr -.rept 8 - .word OP0_0a68 -.endr -.rept 8 - .word OP0_0a70 -.endr -.word OP0_0a78 -.word OP0_0a79 -.rept 2 - .word ILLEGAL -.endr -.word OP0_0a7c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0a80 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0a90 -.endr -.rept 8 - .word OP0_0a98 -.endr -.rept 8 - .word OP0_0aa0 -.endr -.rept 8 - .word OP0_0aa8 -.endr -.rept 8 - .word OP0_0ab0 -.endr -.word OP0_0ab8 -.word OP0_0ab9 -.rept 70 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0100 -.endr -.rept 8 - .word OP0_0108 -.endr -.rept 8 - .word OP0_0110 -.endr -.rept 7 - .word OP0_0118 -.endr -.word OP0_011f -.rept 7 - .word OP0_0120 -.endr -.word OP0_0127 -.rept 8 - .word OP0_0128 -.endr -.rept 8 - .word OP0_0130 -.endr -.word OP0_0138 -.word OP0_0139 -.word OP0_013a -.word OP0_013b -.word OP0_013c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0140 -.endr -.rept 8 - .word OP0_0148 -.endr -.rept 8 - .word OP0_0150 -.endr -.rept 7 - .word OP0_0158 -.endr -.word OP0_015f -.rept 7 - .word OP0_0160 -.endr -.word OP0_0167 -.rept 8 - .word OP0_0168 -.endr -.rept 8 - .word OP0_0170 -.endr -.word OP0_0178 -.word OP0_0179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0180 -.endr -.rept 8 - .word OP0_0188 -.endr -.rept 8 - .word OP0_0190 -.endr -.rept 7 - .word OP0_0198 -.endr -.word OP0_019f -.rept 7 - .word OP0_01a0 -.endr -.word OP0_01a7 -.rept 8 - .word OP0_01a8 -.endr -.rept 8 - .word OP0_01b0 -.endr -.word OP0_01b8 -.word OP0_01b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_01c0 -.endr -.rept 8 - .word OP0_01c8 -.endr -.rept 8 - .word OP0_01d0 -.endr -.rept 7 - .word OP0_01d8 -.endr -.word OP0_01df -.rept 7 - .word OP0_01e0 -.endr -.word OP0_01e7 -.rept 8 - .word OP0_01e8 -.endr -.rept 8 - .word OP0_01f0 -.endr -.word OP0_01f8 -.word OP0_01f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0c00 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0c10 -.endr -.rept 7 - .word OP0_0c18 -.endr -.word OP0_0c1f -.rept 7 - .word OP0_0c20 -.endr -.word OP0_0c27 -.rept 8 - .word OP0_0c28 -.endr -.rept 8 - .word OP0_0c30 -.endr -.word OP0_0c38 -.word OP0_0c39 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0c40 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0c50 -.endr -.rept 8 - .word OP0_0c58 -.endr -.rept 8 - .word OP0_0c60 -.endr -.rept 8 - .word OP0_0c68 -.endr -.rept 8 - .word OP0_0c70 -.endr -.word OP0_0c78 -.word OP0_0c79 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0c80 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0c90 -.endr -.rept 8 - .word OP0_0c98 -.endr -.rept 8 - .word OP0_0ca0 -.endr -.rept 8 - .word OP0_0ca8 -.endr -.rept 8 - .word OP0_0cb0 -.endr -.word OP0_0cb8 -.word OP0_0cb9 -.rept 70 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0100 -.endr -.rept 8 - .word OP0_0108 -.endr -.rept 8 - .word OP0_0110 -.endr -.rept 7 - .word OP0_0118 -.endr -.word OP0_011f -.rept 7 - .word OP0_0120 -.endr -.word OP0_0127 -.rept 8 - .word OP0_0128 -.endr -.rept 8 - .word OP0_0130 -.endr -.word OP0_0138 -.word OP0_0139 -.word OP0_013a -.word OP0_013b -.word OP0_013c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0140 -.endr -.rept 8 - .word OP0_0148 -.endr -.rept 8 - .word OP0_0150 -.endr -.rept 7 - .word OP0_0158 -.endr -.word OP0_015f -.rept 7 - .word OP0_0160 -.endr -.word OP0_0167 -.rept 8 - .word OP0_0168 -.endr -.rept 8 - .word OP0_0170 -.endr -.word OP0_0178 -.word OP0_0179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0180 -.endr -.rept 8 - .word OP0_0188 -.endr -.rept 8 - .word OP0_0190 -.endr -.rept 7 - .word OP0_0198 -.endr -.word OP0_019f -.rept 7 - .word OP0_01a0 -.endr -.word OP0_01a7 -.rept 8 - .word OP0_01a8 -.endr -.rept 8 - .word OP0_01b0 -.endr -.word OP0_01b8 -.word OP0_01b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_01c0 -.endr -.rept 8 - .word OP0_01c8 -.endr -.rept 8 - .word OP0_01d0 -.endr -.rept 7 - .word OP0_01d8 -.endr -.word OP0_01df -.rept 7 - .word OP0_01e0 -.endr -.word OP0_01e7 -.rept 8 - .word OP0_01e8 -.endr -.rept 8 - .word OP0_01f0 -.endr -.word OP0_01f8 -.word OP0_01f9 -.rept 262 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0100 -.endr -.rept 8 - .word OP0_0108 -.endr -.rept 8 - .word OP0_0110 -.endr -.rept 7 - .word OP0_0118 -.endr -.word OP0_011f -.rept 7 - .word OP0_0120 -.endr -.word OP0_0127 -.rept 8 - .word OP0_0128 -.endr -.rept 8 - .word OP0_0130 -.endr -.word OP0_0138 -.word OP0_0139 -.word OP0_013a -.word OP0_013b -.word OP0_013c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0140 -.endr -.rept 8 - .word OP0_0148 -.endr -.rept 8 - .word OP0_0150 -.endr -.rept 7 - .word OP0_0158 -.endr -.word OP0_015f -.rept 7 - .word OP0_0160 -.endr -.word OP0_0167 -.rept 8 - .word OP0_0168 -.endr -.rept 8 - .word OP0_0170 -.endr -.word OP0_0178 -.word OP0_0179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_0180 -.endr -.rept 8 - .word OP0_0188 -.endr -.rept 8 - .word OP0_0190 -.endr -.rept 7 - .word OP0_0198 -.endr -.word OP0_019f -.rept 7 - .word OP0_01a0 -.endr -.word OP0_01a7 -.rept 8 - .word OP0_01a8 -.endr -.rept 8 - .word OP0_01b0 -.endr -.word OP0_01b8 -.word OP0_01b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_01c0 -.endr -.rept 8 - .word OP0_01c8 -.endr -.rept 8 - .word OP0_01d0 -.endr -.rept 7 - .word OP0_01d8 -.endr -.word OP0_01df -.rept 7 - .word OP0_01e0 -.endr -.word OP0_01e7 -.rept 8 - .word OP0_01e8 -.endr -.rept 8 - .word OP0_01f0 -.endr -.word OP0_01f8 -.word OP0_01f9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1000 -.endr -.rept 8 - .word OP0_1010 -.endr -.rept 7 - .word OP0_1018 -.endr -.word OP0_101f -.rept 7 - .word OP0_1020 -.endr -.word OP0_1027 -.rept 8 - .word OP0_1028 -.endr -.rept 8 - .word OP0_1030 -.endr -.word OP0_1038 -.word OP0_1039 -.word OP0_103a -.word OP0_103b -.word OP0_103c -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1080 -.endr -.rept 8 - .word OP0_1090 -.endr -.rept 7 - .word OP0_1098 -.endr -.word OP0_109f -.rept 7 - .word OP0_10a0 -.endr -.word OP0_10a7 -.rept 8 - .word OP0_10a8 -.endr -.rept 8 - .word OP0_10b0 -.endr -.word OP0_10b8 -.word OP0_10b9 -.word OP0_10ba -.word OP0_10bb -.word OP0_10bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_10c0 -.endr -.rept 8 - .word OP0_10d0 -.endr -.rept 7 - .word OP0_10d8 -.endr -.word OP0_10df -.rept 7 - .word OP0_10e0 -.endr -.word OP0_10e7 -.rept 8 - .word OP0_10e8 -.endr -.rept 8 - .word OP0_10f0 -.endr -.word OP0_10f8 -.word OP0_10f9 -.word OP0_10fa -.word OP0_10fb -.word OP0_10fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1100 -.endr -.rept 8 - .word OP0_1110 -.endr -.rept 7 - .word OP0_1118 -.endr -.word OP0_111f -.rept 7 - .word OP0_1120 -.endr -.word OP0_1127 -.rept 8 - .word OP0_1128 -.endr -.rept 8 - .word OP0_1130 -.endr -.word OP0_1138 -.word OP0_1139 -.word OP0_113a -.word OP0_113b -.word OP0_113c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1140 -.endr -.rept 8 - .word OP0_1150 -.endr -.rept 7 - .word OP0_1158 -.endr -.word OP0_115f -.rept 7 - .word OP0_1160 -.endr -.word OP0_1167 -.rept 8 - .word OP0_1168 -.endr -.rept 8 - .word OP0_1170 -.endr -.word OP0_1178 -.word OP0_1179 -.word OP0_117a -.word OP0_117b -.word OP0_117c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1180 -.endr -.rept 8 - .word OP0_1190 -.endr -.rept 7 - .word OP0_1198 -.endr -.word OP0_119f -.rept 7 - .word OP0_11a0 -.endr -.word OP0_11a7 -.rept 8 - .word OP0_11a8 -.endr -.rept 8 - .word OP0_11b0 -.endr -.word OP0_11b8 -.word OP0_11b9 -.word OP0_11ba -.word OP0_11bb -.word OP0_11bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_11c0 -.endr -.rept 8 - .word OP0_11d0 -.endr -.rept 7 - .word OP0_11d8 -.endr -.word OP0_11df -.rept 7 - .word OP0_11e0 -.endr -.word OP0_11e7 -.rept 8 - .word OP0_11e8 -.endr -.rept 8 - .word OP0_11f0 -.endr -.word OP0_11f8 -.word OP0_11f9 -.word OP0_11fa -.word OP0_11fb -.word OP0_11fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1000 -.endr -.rept 8 - .word OP0_1010 -.endr -.rept 7 - .word OP0_1018 -.endr -.word OP0_101f -.rept 7 - .word OP0_1020 -.endr -.word OP0_1027 -.rept 8 - .word OP0_1028 -.endr -.rept 8 - .word OP0_1030 -.endr -.word OP0_1038 -.word OP0_1039 -.word OP0_103a -.word OP0_103b -.word OP0_103c -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1080 -.endr -.rept 8 - .word OP0_1090 -.endr -.rept 7 - .word OP0_1098 -.endr -.word OP0_109f -.rept 7 - .word OP0_10a0 -.endr -.word OP0_10a7 -.rept 8 - .word OP0_10a8 -.endr -.rept 8 - .word OP0_10b0 -.endr -.word OP0_10b8 -.word OP0_10b9 -.word OP0_10ba -.word OP0_10bb -.word OP0_10bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_10c0 -.endr -.rept 8 - .word OP0_10d0 -.endr -.rept 7 - .word OP0_10d8 -.endr -.word OP0_10df -.rept 7 - .word OP0_10e0 -.endr -.word OP0_10e7 -.rept 8 - .word OP0_10e8 -.endr -.rept 8 - .word OP0_10f0 -.endr -.word OP0_10f8 -.word OP0_10f9 -.word OP0_10fa -.word OP0_10fb -.word OP0_10fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1100 -.endr -.rept 8 - .word OP0_1110 -.endr -.rept 7 - .word OP0_1118 -.endr -.word OP0_111f -.rept 7 - .word OP0_1120 -.endr -.word OP0_1127 -.rept 8 - .word OP0_1128 -.endr -.rept 8 - .word OP0_1130 -.endr -.word OP0_1138 -.word OP0_1139 -.word OP0_113a -.word OP0_113b -.word OP0_113c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1140 -.endr -.rept 8 - .word OP0_1150 -.endr -.rept 7 - .word OP0_1158 -.endr -.word OP0_115f -.rept 7 - .word OP0_1160 -.endr -.word OP0_1167 -.rept 8 - .word OP0_1168 -.endr -.rept 8 - .word OP0_1170 -.endr -.word OP0_1178 -.word OP0_1179 -.word OP0_117a -.word OP0_117b -.word OP0_117c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1180 -.endr -.rept 8 - .word OP0_1190 -.endr -.rept 7 - .word OP0_1198 -.endr -.word OP0_119f -.rept 7 - .word OP0_11a0 -.endr -.word OP0_11a7 -.rept 8 - .word OP0_11a8 -.endr -.rept 8 - .word OP0_11b0 -.endr -.word OP0_11b8 -.word OP0_11b9 -.word OP0_11ba -.word OP0_11bb -.word OP0_11bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_13c0 -.endr -.rept 8 - .word OP0_13d0 -.endr -.rept 7 - .word OP0_13d8 -.endr -.word OP0_13df -.rept 7 - .word OP0_13e0 -.endr -.word OP0_13e7 -.rept 8 - .word OP0_13e8 -.endr -.rept 8 - .word OP0_13f0 -.endr -.word OP0_13f8 -.word OP0_13f9 -.word OP0_13fa -.word OP0_13fb -.word OP0_13fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1000 -.endr -.rept 8 - .word OP0_1010 -.endr -.rept 7 - .word OP0_1018 -.endr -.word OP0_101f -.rept 7 - .word OP0_1020 -.endr -.word OP0_1027 -.rept 8 - .word OP0_1028 -.endr -.rept 8 - .word OP0_1030 -.endr -.word OP0_1038 -.word OP0_1039 -.word OP0_103a -.word OP0_103b -.word OP0_103c -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1080 -.endr -.rept 8 - .word OP0_1090 -.endr -.rept 7 - .word OP0_1098 -.endr -.word OP0_109f -.rept 7 - .word OP0_10a0 -.endr -.word OP0_10a7 -.rept 8 - .word OP0_10a8 -.endr -.rept 8 - .word OP0_10b0 -.endr -.word OP0_10b8 -.word OP0_10b9 -.word OP0_10ba -.word OP0_10bb -.word OP0_10bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_10c0 -.endr -.rept 8 - .word OP0_10d0 -.endr -.rept 7 - .word OP0_10d8 -.endr -.word OP0_10df -.rept 7 - .word OP0_10e0 -.endr -.word OP0_10e7 -.rept 8 - .word OP0_10e8 -.endr -.rept 8 - .word OP0_10f0 -.endr -.word OP0_10f8 -.word OP0_10f9 -.word OP0_10fa -.word OP0_10fb -.word OP0_10fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1100 -.endr -.rept 8 - .word OP0_1110 -.endr -.rept 7 - .word OP0_1118 -.endr -.word OP0_111f -.rept 7 - .word OP0_1120 -.endr -.word OP0_1127 -.rept 8 - .word OP0_1128 -.endr -.rept 8 - .word OP0_1130 -.endr -.word OP0_1138 -.word OP0_1139 -.word OP0_113a -.word OP0_113b -.word OP0_113c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1140 -.endr -.rept 8 - .word OP0_1150 -.endr -.rept 7 - .word OP0_1158 -.endr -.word OP0_115f -.rept 7 - .word OP0_1160 -.endr -.word OP0_1167 -.rept 8 - .word OP0_1168 -.endr -.rept 8 - .word OP0_1170 -.endr -.word OP0_1178 -.word OP0_1179 -.word OP0_117a -.word OP0_117b -.word OP0_117c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1180 -.endr -.rept 8 - .word OP0_1190 -.endr -.rept 7 - .word OP0_1198 -.endr -.word OP0_119f -.rept 7 - .word OP0_11a0 -.endr -.word OP0_11a7 -.rept 8 - .word OP0_11a8 -.endr -.rept 8 - .word OP0_11b0 -.endr -.word OP0_11b8 -.word OP0_11b9 -.word OP0_11ba -.word OP0_11bb -.word OP0_11bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1000 -.endr -.rept 8 - .word OP0_1010 -.endr -.rept 7 - .word OP0_1018 -.endr -.word OP0_101f -.rept 7 - .word OP0_1020 -.endr -.word OP0_1027 -.rept 8 - .word OP0_1028 -.endr -.rept 8 - .word OP0_1030 -.endr -.word OP0_1038 -.word OP0_1039 -.word OP0_103a -.word OP0_103b -.word OP0_103c -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1080 -.endr -.rept 8 - .word OP0_1090 -.endr -.rept 7 - .word OP0_1098 -.endr -.word OP0_109f -.rept 7 - .word OP0_10a0 -.endr -.word OP0_10a7 -.rept 8 - .word OP0_10a8 -.endr -.rept 8 - .word OP0_10b0 -.endr -.word OP0_10b8 -.word OP0_10b9 -.word OP0_10ba -.word OP0_10bb -.word OP0_10bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_10c0 -.endr -.rept 8 - .word OP0_10d0 -.endr -.rept 7 - .word OP0_10d8 -.endr -.word OP0_10df -.rept 7 - .word OP0_10e0 -.endr -.word OP0_10e7 -.rept 8 - .word OP0_10e8 -.endr -.rept 8 - .word OP0_10f0 -.endr -.word OP0_10f8 -.word OP0_10f9 -.word OP0_10fa -.word OP0_10fb -.word OP0_10fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1100 -.endr -.rept 8 - .word OP0_1110 -.endr -.rept 7 - .word OP0_1118 -.endr -.word OP0_111f -.rept 7 - .word OP0_1120 -.endr -.word OP0_1127 -.rept 8 - .word OP0_1128 -.endr -.rept 8 - .word OP0_1130 -.endr -.word OP0_1138 -.word OP0_1139 -.word OP0_113a -.word OP0_113b -.word OP0_113c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1140 -.endr -.rept 8 - .word OP0_1150 -.endr -.rept 7 - .word OP0_1158 -.endr -.word OP0_115f -.rept 7 - .word OP0_1160 -.endr -.word OP0_1167 -.rept 8 - .word OP0_1168 -.endr -.rept 8 - .word OP0_1170 -.endr -.word OP0_1178 -.word OP0_1179 -.word OP0_117a -.word OP0_117b -.word OP0_117c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1180 -.endr -.rept 8 - .word OP0_1190 -.endr -.rept 7 - .word OP0_1198 -.endr -.word OP0_119f -.rept 7 - .word OP0_11a0 -.endr -.word OP0_11a7 -.rept 8 - .word OP0_11a8 -.endr -.rept 8 - .word OP0_11b0 -.endr -.word OP0_11b8 -.word OP0_11b9 -.word OP0_11ba -.word OP0_11bb -.word OP0_11bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1000 -.endr -.rept 8 - .word OP0_1010 -.endr -.rept 7 - .word OP0_1018 -.endr -.word OP0_101f -.rept 7 - .word OP0_1020 -.endr -.word OP0_1027 -.rept 8 - .word OP0_1028 -.endr -.rept 8 - .word OP0_1030 -.endr -.word OP0_1038 -.word OP0_1039 -.word OP0_103a -.word OP0_103b -.word OP0_103c -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1080 -.endr -.rept 8 - .word OP0_1090 -.endr -.rept 7 - .word OP0_1098 -.endr -.word OP0_109f -.rept 7 - .word OP0_10a0 -.endr -.word OP0_10a7 -.rept 8 - .word OP0_10a8 -.endr -.rept 8 - .word OP0_10b0 -.endr -.word OP0_10b8 -.word OP0_10b9 -.word OP0_10ba -.word OP0_10bb -.word OP0_10bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_10c0 -.endr -.rept 8 - .word OP0_10d0 -.endr -.rept 7 - .word OP0_10d8 -.endr -.word OP0_10df -.rept 7 - .word OP0_10e0 -.endr -.word OP0_10e7 -.rept 8 - .word OP0_10e8 -.endr -.rept 8 - .word OP0_10f0 -.endr -.word OP0_10f8 -.word OP0_10f9 -.word OP0_10fa -.word OP0_10fb -.word OP0_10fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1100 -.endr -.rept 8 - .word OP0_1110 -.endr -.rept 7 - .word OP0_1118 -.endr -.word OP0_111f -.rept 7 - .word OP0_1120 -.endr -.word OP0_1127 -.rept 8 - .word OP0_1128 -.endr -.rept 8 - .word OP0_1130 -.endr -.word OP0_1138 -.word OP0_1139 -.word OP0_113a -.word OP0_113b -.word OP0_113c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1140 -.endr -.rept 8 - .word OP0_1150 -.endr -.rept 7 - .word OP0_1158 -.endr -.word OP0_115f -.rept 7 - .word OP0_1160 -.endr -.word OP0_1167 -.rept 8 - .word OP0_1168 -.endr -.rept 8 - .word OP0_1170 -.endr -.word OP0_1178 -.word OP0_1179 -.word OP0_117a -.word OP0_117b -.word OP0_117c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1180 -.endr -.rept 8 - .word OP0_1190 -.endr -.rept 7 - .word OP0_1198 -.endr -.word OP0_119f -.rept 7 - .word OP0_11a0 -.endr -.word OP0_11a7 -.rept 8 - .word OP0_11a8 -.endr -.rept 8 - .word OP0_11b0 -.endr -.word OP0_11b8 -.word OP0_11b9 -.word OP0_11ba -.word OP0_11bb -.word OP0_11bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1000 -.endr -.rept 8 - .word OP0_1010 -.endr -.rept 7 - .word OP0_1018 -.endr -.word OP0_101f -.rept 7 - .word OP0_1020 -.endr -.word OP0_1027 -.rept 8 - .word OP0_1028 -.endr -.rept 8 - .word OP0_1030 -.endr -.word OP0_1038 -.word OP0_1039 -.word OP0_103a -.word OP0_103b -.word OP0_103c -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1080 -.endr -.rept 8 - .word OP0_1090 -.endr -.rept 7 - .word OP0_1098 -.endr -.word OP0_109f -.rept 7 - .word OP0_10a0 -.endr -.word OP0_10a7 -.rept 8 - .word OP0_10a8 -.endr -.rept 8 - .word OP0_10b0 -.endr -.word OP0_10b8 -.word OP0_10b9 -.word OP0_10ba -.word OP0_10bb -.word OP0_10bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_10c0 -.endr -.rept 8 - .word OP0_10d0 -.endr -.rept 7 - .word OP0_10d8 -.endr -.word OP0_10df -.rept 7 - .word OP0_10e0 -.endr -.word OP0_10e7 -.rept 8 - .word OP0_10e8 -.endr -.rept 8 - .word OP0_10f0 -.endr -.word OP0_10f8 -.word OP0_10f9 -.word OP0_10fa -.word OP0_10fb -.word OP0_10fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1100 -.endr -.rept 8 - .word OP0_1110 -.endr -.rept 7 - .word OP0_1118 -.endr -.word OP0_111f -.rept 7 - .word OP0_1120 -.endr -.word OP0_1127 -.rept 8 - .word OP0_1128 -.endr -.rept 8 - .word OP0_1130 -.endr -.word OP0_1138 -.word OP0_1139 -.word OP0_113a -.word OP0_113b -.word OP0_113c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1140 -.endr -.rept 8 - .word OP0_1150 -.endr -.rept 7 - .word OP0_1158 -.endr -.word OP0_115f -.rept 7 - .word OP0_1160 -.endr -.word OP0_1167 -.rept 8 - .word OP0_1168 -.endr -.rept 8 - .word OP0_1170 -.endr -.word OP0_1178 -.word OP0_1179 -.word OP0_117a -.word OP0_117b -.word OP0_117c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1180 -.endr -.rept 8 - .word OP0_1190 -.endr -.rept 7 - .word OP0_1198 -.endr -.word OP0_119f -.rept 7 - .word OP0_11a0 -.endr -.word OP0_11a7 -.rept 8 - .word OP0_11a8 -.endr -.rept 8 - .word OP0_11b0 -.endr -.word OP0_11b8 -.word OP0_11b9 -.word OP0_11ba -.word OP0_11bb -.word OP0_11bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1000 -.endr -.rept 8 - .word OP0_1010 -.endr -.rept 7 - .word OP0_1018 -.endr -.word OP0_101f -.rept 7 - .word OP0_1020 -.endr -.word OP0_1027 -.rept 8 - .word OP0_1028 -.endr -.rept 8 - .word OP0_1030 -.endr -.word OP0_1038 -.word OP0_1039 -.word OP0_103a -.word OP0_103b -.word OP0_103c -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1080 -.endr -.rept 8 - .word OP0_1090 -.endr -.rept 7 - .word OP0_1098 -.endr -.word OP0_109f -.rept 7 - .word OP0_10a0 -.endr -.word OP0_10a7 -.rept 8 - .word OP0_10a8 -.endr -.rept 8 - .word OP0_10b0 -.endr -.word OP0_10b8 -.word OP0_10b9 -.word OP0_10ba -.word OP0_10bb -.word OP0_10bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_10c0 -.endr -.rept 8 - .word OP0_10d0 -.endr -.rept 7 - .word OP0_10d8 -.endr -.word OP0_10df -.rept 7 - .word OP0_10e0 -.endr -.word OP0_10e7 -.rept 8 - .word OP0_10e8 -.endr -.rept 8 - .word OP0_10f0 -.endr -.word OP0_10f8 -.word OP0_10f9 -.word OP0_10fa -.word OP0_10fb -.word OP0_10fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1100 -.endr -.rept 8 - .word OP0_1110 -.endr -.rept 7 - .word OP0_1118 -.endr -.word OP0_111f -.rept 7 - .word OP0_1120 -.endr -.word OP0_1127 -.rept 8 - .word OP0_1128 -.endr -.rept 8 - .word OP0_1130 -.endr -.word OP0_1138 -.word OP0_1139 -.word OP0_113a -.word OP0_113b -.word OP0_113c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1140 -.endr -.rept 8 - .word OP0_1150 -.endr -.rept 7 - .word OP0_1158 -.endr -.word OP0_115f -.rept 7 - .word OP0_1160 -.endr -.word OP0_1167 -.rept 8 - .word OP0_1168 -.endr -.rept 8 - .word OP0_1170 -.endr -.word OP0_1178 -.word OP0_1179 -.word OP0_117a -.word OP0_117b -.word OP0_117c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1180 -.endr -.rept 8 - .word OP0_1190 -.endr -.rept 7 - .word OP0_1198 -.endr -.word OP0_119f -.rept 7 - .word OP0_11a0 -.endr -.word OP0_11a7 -.rept 8 - .word OP0_11a8 -.endr -.rept 8 - .word OP0_11b0 -.endr -.word OP0_11b8 -.word OP0_11b9 -.word OP0_11ba -.word OP0_11bb -.word OP0_11bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1000 -.endr -.rept 8 - .word OP0_1010 -.endr -.rept 7 - .word OP0_1018 -.endr -.word OP0_101f -.rept 7 - .word OP0_1020 -.endr -.word OP0_1027 -.rept 8 - .word OP0_1028 -.endr -.rept 8 - .word OP0_1030 -.endr -.word OP0_1038 -.word OP0_1039 -.word OP0_103a -.word OP0_103b -.word OP0_103c -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1080 -.endr -.rept 8 - .word OP0_1090 -.endr -.rept 7 - .word OP0_1098 -.endr -.word OP0_109f -.rept 7 - .word OP0_10a0 -.endr -.word OP0_10a7 -.rept 8 - .word OP0_10a8 -.endr -.rept 8 - .word OP0_10b0 -.endr -.word OP0_10b8 -.word OP0_10b9 -.word OP0_10ba -.word OP0_10bb -.word OP0_10bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1ec0 -.endr -.rept 8 - .word OP0_1ed0 -.endr -.rept 7 - .word OP0_1ed8 -.endr -.word OP0_1edf -.rept 7 - .word OP0_1ee0 -.endr -.word OP0_1ee7 -.rept 8 - .word OP0_1ee8 -.endr -.rept 8 - .word OP0_1ef0 -.endr -.word OP0_1ef8 -.word OP0_1ef9 -.word OP0_1efa -.word OP0_1efb -.word OP0_1efc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1f00 -.endr -.rept 8 - .word OP0_1f10 -.endr -.rept 7 - .word OP0_1f18 -.endr -.word OP0_1f1f -.rept 7 - .word OP0_1f20 -.endr -.word OP0_1f27 -.rept 8 - .word OP0_1f28 -.endr -.rept 8 - .word OP0_1f30 -.endr -.word OP0_1f38 -.word OP0_1f39 -.word OP0_1f3a -.word OP0_1f3b -.word OP0_1f3c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1140 -.endr -.rept 8 - .word OP0_1150 -.endr -.rept 7 - .word OP0_1158 -.endr -.word OP0_115f -.rept 7 - .word OP0_1160 -.endr -.word OP0_1167 -.rept 8 - .word OP0_1168 -.endr -.rept 8 - .word OP0_1170 -.endr -.word OP0_1178 -.word OP0_1179 -.word OP0_117a -.word OP0_117b -.word OP0_117c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_1180 -.endr -.rept 8 - .word OP0_1190 -.endr -.rept 7 - .word OP0_1198 -.endr -.word OP0_119f -.rept 7 - .word OP0_11a0 -.endr -.word OP0_11a7 -.rept 8 - .word OP0_11a8 -.endr -.rept 8 - .word OP0_11b0 -.endr -.word OP0_11b8 -.word OP0_11b9 -.word OP0_11ba -.word OP0_11bb -.word OP0_11bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2000 -.endr -.rept 8 - .word OP0_2010 -.endr -.rept 8 - .word OP0_2018 -.endr -.rept 8 - .word OP0_2020 -.endr -.rept 8 - .word OP0_2028 -.endr -.rept 8 - .word OP0_2030 -.endr -.word OP0_2038 -.word OP0_2039 -.word OP0_203a -.word OP0_203b -.word OP0_203c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2040 -.endr -.rept 8 - .word OP0_2050 -.endr -.rept 8 - .word OP0_2058 -.endr -.rept 8 - .word OP0_2060 -.endr -.rept 8 - .word OP0_2068 -.endr -.rept 8 - .word OP0_2070 -.endr -.word OP0_2078 -.word OP0_2079 -.word OP0_207a -.word OP0_207b -.word OP0_207c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2080 -.endr -.rept 8 - .word OP0_2090 -.endr -.rept 8 - .word OP0_2098 -.endr -.rept 8 - .word OP0_20a0 -.endr -.rept 8 - .word OP0_20a8 -.endr -.rept 8 - .word OP0_20b0 -.endr -.word OP0_20b8 -.word OP0_20b9 -.word OP0_20ba -.word OP0_20bb -.word OP0_20bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_20c0 -.endr -.rept 8 - .word OP0_20d0 -.endr -.rept 8 - .word OP0_20d8 -.endr -.rept 8 - .word OP0_20e0 -.endr -.rept 8 - .word OP0_20e8 -.endr -.rept 8 - .word OP0_20f0 -.endr -.word OP0_20f8 -.word OP0_20f9 -.word OP0_20fa -.word OP0_20fb -.word OP0_20fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2100 -.endr -.rept 8 - .word OP0_2110 -.endr -.rept 8 - .word OP0_2118 -.endr -.rept 8 - .word OP0_2120 -.endr -.rept 8 - .word OP0_2128 -.endr -.rept 8 - .word OP0_2130 -.endr -.word OP0_2138 -.word OP0_2139 -.word OP0_213a -.word OP0_213b -.word OP0_213c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2140 -.endr -.rept 8 - .word OP0_2150 -.endr -.rept 8 - .word OP0_2158 -.endr -.rept 8 - .word OP0_2160 -.endr -.rept 8 - .word OP0_2168 -.endr -.rept 8 - .word OP0_2170 -.endr -.word OP0_2178 -.word OP0_2179 -.word OP0_217a -.word OP0_217b -.word OP0_217c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2180 -.endr -.rept 8 - .word OP0_2190 -.endr -.rept 8 - .word OP0_2198 -.endr -.rept 8 - .word OP0_21a0 -.endr -.rept 8 - .word OP0_21a8 -.endr -.rept 8 - .word OP0_21b0 -.endr -.word OP0_21b8 -.word OP0_21b9 -.word OP0_21ba -.word OP0_21bb -.word OP0_21bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_21c0 -.endr -.rept 8 - .word OP0_21d0 -.endr -.rept 8 - .word OP0_21d8 -.endr -.rept 8 - .word OP0_21e0 -.endr -.rept 8 - .word OP0_21e8 -.endr -.rept 8 - .word OP0_21f0 -.endr -.word OP0_21f8 -.word OP0_21f9 -.word OP0_21fa -.word OP0_21fb -.word OP0_21fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2000 -.endr -.rept 8 - .word OP0_2010 -.endr -.rept 8 - .word OP0_2018 -.endr -.rept 8 - .word OP0_2020 -.endr -.rept 8 - .word OP0_2028 -.endr -.rept 8 - .word OP0_2030 -.endr -.word OP0_2038 -.word OP0_2039 -.word OP0_203a -.word OP0_203b -.word OP0_203c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2040 -.endr -.rept 8 - .word OP0_2050 -.endr -.rept 8 - .word OP0_2058 -.endr -.rept 8 - .word OP0_2060 -.endr -.rept 8 - .word OP0_2068 -.endr -.rept 8 - .word OP0_2070 -.endr -.word OP0_2078 -.word OP0_2079 -.word OP0_207a -.word OP0_207b -.word OP0_207c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2080 -.endr -.rept 8 - .word OP0_2090 -.endr -.rept 8 - .word OP0_2098 -.endr -.rept 8 - .word OP0_20a0 -.endr -.rept 8 - .word OP0_20a8 -.endr -.rept 8 - .word OP0_20b0 -.endr -.word OP0_20b8 -.word OP0_20b9 -.word OP0_20ba -.word OP0_20bb -.word OP0_20bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_20c0 -.endr -.rept 8 - .word OP0_20d0 -.endr -.rept 8 - .word OP0_20d8 -.endr -.rept 8 - .word OP0_20e0 -.endr -.rept 8 - .word OP0_20e8 -.endr -.rept 8 - .word OP0_20f0 -.endr -.word OP0_20f8 -.word OP0_20f9 -.word OP0_20fa -.word OP0_20fb -.word OP0_20fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2100 -.endr -.rept 8 - .word OP0_2110 -.endr -.rept 8 - .word OP0_2118 -.endr -.rept 8 - .word OP0_2120 -.endr -.rept 8 - .word OP0_2128 -.endr -.rept 8 - .word OP0_2130 -.endr -.word OP0_2138 -.word OP0_2139 -.word OP0_213a -.word OP0_213b -.word OP0_213c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2140 -.endr -.rept 8 - .word OP0_2150 -.endr -.rept 8 - .word OP0_2158 -.endr -.rept 8 - .word OP0_2160 -.endr -.rept 8 - .word OP0_2168 -.endr -.rept 8 - .word OP0_2170 -.endr -.word OP0_2178 -.word OP0_2179 -.word OP0_217a -.word OP0_217b -.word OP0_217c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2180 -.endr -.rept 8 - .word OP0_2190 -.endr -.rept 8 - .word OP0_2198 -.endr -.rept 8 - .word OP0_21a0 -.endr -.rept 8 - .word OP0_21a8 -.endr -.rept 8 - .word OP0_21b0 -.endr -.word OP0_21b8 -.word OP0_21b9 -.word OP0_21ba -.word OP0_21bb -.word OP0_21bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_23c0 -.endr -.rept 8 - .word OP0_23d0 -.endr -.rept 8 - .word OP0_23d8 -.endr -.rept 8 - .word OP0_23e0 -.endr -.rept 8 - .word OP0_23e8 -.endr -.rept 8 - .word OP0_23f0 -.endr -.word OP0_23f8 -.word OP0_23f9 -.word OP0_23fa -.word OP0_23fb -.word OP0_23fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2000 -.endr -.rept 8 - .word OP0_2010 -.endr -.rept 8 - .word OP0_2018 -.endr -.rept 8 - .word OP0_2020 -.endr -.rept 8 - .word OP0_2028 -.endr -.rept 8 - .word OP0_2030 -.endr -.word OP0_2038 -.word OP0_2039 -.word OP0_203a -.word OP0_203b -.word OP0_203c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2040 -.endr -.rept 8 - .word OP0_2050 -.endr -.rept 8 - .word OP0_2058 -.endr -.rept 8 - .word OP0_2060 -.endr -.rept 8 - .word OP0_2068 -.endr -.rept 8 - .word OP0_2070 -.endr -.word OP0_2078 -.word OP0_2079 -.word OP0_207a -.word OP0_207b -.word OP0_207c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2080 -.endr -.rept 8 - .word OP0_2090 -.endr -.rept 8 - .word OP0_2098 -.endr -.rept 8 - .word OP0_20a0 -.endr -.rept 8 - .word OP0_20a8 -.endr -.rept 8 - .word OP0_20b0 -.endr -.word OP0_20b8 -.word OP0_20b9 -.word OP0_20ba -.word OP0_20bb -.word OP0_20bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_20c0 -.endr -.rept 8 - .word OP0_20d0 -.endr -.rept 8 - .word OP0_20d8 -.endr -.rept 8 - .word OP0_20e0 -.endr -.rept 8 - .word OP0_20e8 -.endr -.rept 8 - .word OP0_20f0 -.endr -.word OP0_20f8 -.word OP0_20f9 -.word OP0_20fa -.word OP0_20fb -.word OP0_20fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2100 -.endr -.rept 8 - .word OP0_2110 -.endr -.rept 8 - .word OP0_2118 -.endr -.rept 8 - .word OP0_2120 -.endr -.rept 8 - .word OP0_2128 -.endr -.rept 8 - .word OP0_2130 -.endr -.word OP0_2138 -.word OP0_2139 -.word OP0_213a -.word OP0_213b -.word OP0_213c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2140 -.endr -.rept 8 - .word OP0_2150 -.endr -.rept 8 - .word OP0_2158 -.endr -.rept 8 - .word OP0_2160 -.endr -.rept 8 - .word OP0_2168 -.endr -.rept 8 - .word OP0_2170 -.endr -.word OP0_2178 -.word OP0_2179 -.word OP0_217a -.word OP0_217b -.word OP0_217c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2180 -.endr -.rept 8 - .word OP0_2190 -.endr -.rept 8 - .word OP0_2198 -.endr -.rept 8 - .word OP0_21a0 -.endr -.rept 8 - .word OP0_21a8 -.endr -.rept 8 - .word OP0_21b0 -.endr -.word OP0_21b8 -.word OP0_21b9 -.word OP0_21ba -.word OP0_21bb -.word OP0_21bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2000 -.endr -.rept 8 - .word OP0_2010 -.endr -.rept 8 - .word OP0_2018 -.endr -.rept 8 - .word OP0_2020 -.endr -.rept 8 - .word OP0_2028 -.endr -.rept 8 - .word OP0_2030 -.endr -.word OP0_2038 -.word OP0_2039 -.word OP0_203a -.word OP0_203b -.word OP0_203c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2040 -.endr -.rept 8 - .word OP0_2050 -.endr -.rept 8 - .word OP0_2058 -.endr -.rept 8 - .word OP0_2060 -.endr -.rept 8 - .word OP0_2068 -.endr -.rept 8 - .word OP0_2070 -.endr -.word OP0_2078 -.word OP0_2079 -.word OP0_207a -.word OP0_207b -.word OP0_207c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2080 -.endr -.rept 8 - .word OP0_2090 -.endr -.rept 8 - .word OP0_2098 -.endr -.rept 8 - .word OP0_20a0 -.endr -.rept 8 - .word OP0_20a8 -.endr -.rept 8 - .word OP0_20b0 -.endr -.word OP0_20b8 -.word OP0_20b9 -.word OP0_20ba -.word OP0_20bb -.word OP0_20bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_20c0 -.endr -.rept 8 - .word OP0_20d0 -.endr -.rept 8 - .word OP0_20d8 -.endr -.rept 8 - .word OP0_20e0 -.endr -.rept 8 - .word OP0_20e8 -.endr -.rept 8 - .word OP0_20f0 -.endr -.word OP0_20f8 -.word OP0_20f9 -.word OP0_20fa -.word OP0_20fb -.word OP0_20fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2100 -.endr -.rept 8 - .word OP0_2110 -.endr -.rept 8 - .word OP0_2118 -.endr -.rept 8 - .word OP0_2120 -.endr -.rept 8 - .word OP0_2128 -.endr -.rept 8 - .word OP0_2130 -.endr -.word OP0_2138 -.word OP0_2139 -.word OP0_213a -.word OP0_213b -.word OP0_213c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2140 -.endr -.rept 8 - .word OP0_2150 -.endr -.rept 8 - .word OP0_2158 -.endr -.rept 8 - .word OP0_2160 -.endr -.rept 8 - .word OP0_2168 -.endr -.rept 8 - .word OP0_2170 -.endr -.word OP0_2178 -.word OP0_2179 -.word OP0_217a -.word OP0_217b -.word OP0_217c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2180 -.endr -.rept 8 - .word OP0_2190 -.endr -.rept 8 - .word OP0_2198 -.endr -.rept 8 - .word OP0_21a0 -.endr -.rept 8 - .word OP0_21a8 -.endr -.rept 8 - .word OP0_21b0 -.endr -.word OP0_21b8 -.word OP0_21b9 -.word OP0_21ba -.word OP0_21bb -.word OP0_21bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2000 -.endr -.rept 8 - .word OP0_2010 -.endr -.rept 8 - .word OP0_2018 -.endr -.rept 8 - .word OP0_2020 -.endr -.rept 8 - .word OP0_2028 -.endr -.rept 8 - .word OP0_2030 -.endr -.word OP0_2038 -.word OP0_2039 -.word OP0_203a -.word OP0_203b -.word OP0_203c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2040 -.endr -.rept 8 - .word OP0_2050 -.endr -.rept 8 - .word OP0_2058 -.endr -.rept 8 - .word OP0_2060 -.endr -.rept 8 - .word OP0_2068 -.endr -.rept 8 - .word OP0_2070 -.endr -.word OP0_2078 -.word OP0_2079 -.word OP0_207a -.word OP0_207b -.word OP0_207c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2080 -.endr -.rept 8 - .word OP0_2090 -.endr -.rept 8 - .word OP0_2098 -.endr -.rept 8 - .word OP0_20a0 -.endr -.rept 8 - .word OP0_20a8 -.endr -.rept 8 - .word OP0_20b0 -.endr -.word OP0_20b8 -.word OP0_20b9 -.word OP0_20ba -.word OP0_20bb -.word OP0_20bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_20c0 -.endr -.rept 8 - .word OP0_20d0 -.endr -.rept 8 - .word OP0_20d8 -.endr -.rept 8 - .word OP0_20e0 -.endr -.rept 8 - .word OP0_20e8 -.endr -.rept 8 - .word OP0_20f0 -.endr -.word OP0_20f8 -.word OP0_20f9 -.word OP0_20fa -.word OP0_20fb -.word OP0_20fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2100 -.endr -.rept 8 - .word OP0_2110 -.endr -.rept 8 - .word OP0_2118 -.endr -.rept 8 - .word OP0_2120 -.endr -.rept 8 - .word OP0_2128 -.endr -.rept 8 - .word OP0_2130 -.endr -.word OP0_2138 -.word OP0_2139 -.word OP0_213a -.word OP0_213b -.word OP0_213c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2140 -.endr -.rept 8 - .word OP0_2150 -.endr -.rept 8 - .word OP0_2158 -.endr -.rept 8 - .word OP0_2160 -.endr -.rept 8 - .word OP0_2168 -.endr -.rept 8 - .word OP0_2170 -.endr -.word OP0_2178 -.word OP0_2179 -.word OP0_217a -.word OP0_217b -.word OP0_217c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2180 -.endr -.rept 8 - .word OP0_2190 -.endr -.rept 8 - .word OP0_2198 -.endr -.rept 8 - .word OP0_21a0 -.endr -.rept 8 - .word OP0_21a8 -.endr -.rept 8 - .word OP0_21b0 -.endr -.word OP0_21b8 -.word OP0_21b9 -.word OP0_21ba -.word OP0_21bb -.word OP0_21bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2000 -.endr -.rept 8 - .word OP0_2010 -.endr -.rept 8 - .word OP0_2018 -.endr -.rept 8 - .word OP0_2020 -.endr -.rept 8 - .word OP0_2028 -.endr -.rept 8 - .word OP0_2030 -.endr -.word OP0_2038 -.word OP0_2039 -.word OP0_203a -.word OP0_203b -.word OP0_203c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2040 -.endr -.rept 8 - .word OP0_2050 -.endr -.rept 8 - .word OP0_2058 -.endr -.rept 8 - .word OP0_2060 -.endr -.rept 8 - .word OP0_2068 -.endr -.rept 8 - .word OP0_2070 -.endr -.word OP0_2078 -.word OP0_2079 -.word OP0_207a -.word OP0_207b -.word OP0_207c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2080 -.endr -.rept 8 - .word OP0_2090 -.endr -.rept 8 - .word OP0_2098 -.endr -.rept 8 - .word OP0_20a0 -.endr -.rept 8 - .word OP0_20a8 -.endr -.rept 8 - .word OP0_20b0 -.endr -.word OP0_20b8 -.word OP0_20b9 -.word OP0_20ba -.word OP0_20bb -.word OP0_20bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_20c0 -.endr -.rept 8 - .word OP0_20d0 -.endr -.rept 8 - .word OP0_20d8 -.endr -.rept 8 - .word OP0_20e0 -.endr -.rept 8 - .word OP0_20e8 -.endr -.rept 8 - .word OP0_20f0 -.endr -.word OP0_20f8 -.word OP0_20f9 -.word OP0_20fa -.word OP0_20fb -.word OP0_20fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2100 -.endr -.rept 8 - .word OP0_2110 -.endr -.rept 8 - .word OP0_2118 -.endr -.rept 8 - .word OP0_2120 -.endr -.rept 8 - .word OP0_2128 -.endr -.rept 8 - .word OP0_2130 -.endr -.word OP0_2138 -.word OP0_2139 -.word OP0_213a -.word OP0_213b -.word OP0_213c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2140 -.endr -.rept 8 - .word OP0_2150 -.endr -.rept 8 - .word OP0_2158 -.endr -.rept 8 - .word OP0_2160 -.endr -.rept 8 - .word OP0_2168 -.endr -.rept 8 - .word OP0_2170 -.endr -.word OP0_2178 -.word OP0_2179 -.word OP0_217a -.word OP0_217b -.word OP0_217c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2180 -.endr -.rept 8 - .word OP0_2190 -.endr -.rept 8 - .word OP0_2198 -.endr -.rept 8 - .word OP0_21a0 -.endr -.rept 8 - .word OP0_21a8 -.endr -.rept 8 - .word OP0_21b0 -.endr -.word OP0_21b8 -.word OP0_21b9 -.word OP0_21ba -.word OP0_21bb -.word OP0_21bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2000 -.endr -.rept 8 - .word OP0_2010 -.endr -.rept 8 - .word OP0_2018 -.endr -.rept 8 - .word OP0_2020 -.endr -.rept 8 - .word OP0_2028 -.endr -.rept 8 - .word OP0_2030 -.endr -.word OP0_2038 -.word OP0_2039 -.word OP0_203a -.word OP0_203b -.word OP0_203c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2040 -.endr -.rept 8 - .word OP0_2050 -.endr -.rept 8 - .word OP0_2058 -.endr -.rept 8 - .word OP0_2060 -.endr -.rept 8 - .word OP0_2068 -.endr -.rept 8 - .word OP0_2070 -.endr -.word OP0_2078 -.word OP0_2079 -.word OP0_207a -.word OP0_207b -.word OP0_207c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2080 -.endr -.rept 8 - .word OP0_2090 -.endr -.rept 8 - .word OP0_2098 -.endr -.rept 8 - .word OP0_20a0 -.endr -.rept 8 - .word OP0_20a8 -.endr -.rept 8 - .word OP0_20b0 -.endr -.word OP0_20b8 -.word OP0_20b9 -.word OP0_20ba -.word OP0_20bb -.word OP0_20bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_20c0 -.endr -.rept 8 - .word OP0_20d0 -.endr -.rept 8 - .word OP0_20d8 -.endr -.rept 8 - .word OP0_20e0 -.endr -.rept 8 - .word OP0_20e8 -.endr -.rept 8 - .word OP0_20f0 -.endr -.word OP0_20f8 -.word OP0_20f9 -.word OP0_20fa -.word OP0_20fb -.word OP0_20fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2100 -.endr -.rept 8 - .word OP0_2110 -.endr -.rept 8 - .word OP0_2118 -.endr -.rept 8 - .word OP0_2120 -.endr -.rept 8 - .word OP0_2128 -.endr -.rept 8 - .word OP0_2130 -.endr -.word OP0_2138 -.word OP0_2139 -.word OP0_213a -.word OP0_213b -.word OP0_213c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2140 -.endr -.rept 8 - .word OP0_2150 -.endr -.rept 8 - .word OP0_2158 -.endr -.rept 8 - .word OP0_2160 -.endr -.rept 8 - .word OP0_2168 -.endr -.rept 8 - .word OP0_2170 -.endr -.word OP0_2178 -.word OP0_2179 -.word OP0_217a -.word OP0_217b -.word OP0_217c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2180 -.endr -.rept 8 - .word OP0_2190 -.endr -.rept 8 - .word OP0_2198 -.endr -.rept 8 - .word OP0_21a0 -.endr -.rept 8 - .word OP0_21a8 -.endr -.rept 8 - .word OP0_21b0 -.endr -.word OP0_21b8 -.word OP0_21b9 -.word OP0_21ba -.word OP0_21bb -.word OP0_21bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2000 -.endr -.rept 8 - .word OP0_2010 -.endr -.rept 8 - .word OP0_2018 -.endr -.rept 8 - .word OP0_2020 -.endr -.rept 8 - .word OP0_2028 -.endr -.rept 8 - .word OP0_2030 -.endr -.word OP0_2038 -.word OP0_2039 -.word OP0_203a -.word OP0_203b -.word OP0_203c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2040 -.endr -.rept 8 - .word OP0_2050 -.endr -.rept 8 - .word OP0_2058 -.endr -.rept 8 - .word OP0_2060 -.endr -.rept 8 - .word OP0_2068 -.endr -.rept 8 - .word OP0_2070 -.endr -.word OP0_2078 -.word OP0_2079 -.word OP0_207a -.word OP0_207b -.word OP0_207c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2080 -.endr -.rept 8 - .word OP0_2090 -.endr -.rept 8 - .word OP0_2098 -.endr -.rept 8 - .word OP0_20a0 -.endr -.rept 8 - .word OP0_20a8 -.endr -.rept 8 - .word OP0_20b0 -.endr -.word OP0_20b8 -.word OP0_20b9 -.word OP0_20ba -.word OP0_20bb -.word OP0_20bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_20c0 -.endr -.rept 8 - .word OP0_20d0 -.endr -.rept 8 - .word OP0_20d8 -.endr -.rept 8 - .word OP0_20e0 -.endr -.rept 8 - .word OP0_20e8 -.endr -.rept 8 - .word OP0_20f0 -.endr -.word OP0_20f8 -.word OP0_20f9 -.word OP0_20fa -.word OP0_20fb -.word OP0_20fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2100 -.endr -.rept 8 - .word OP0_2110 -.endr -.rept 8 - .word OP0_2118 -.endr -.rept 8 - .word OP0_2120 -.endr -.rept 8 - .word OP0_2128 -.endr -.rept 8 - .word OP0_2130 -.endr -.word OP0_2138 -.word OP0_2139 -.word OP0_213a -.word OP0_213b -.word OP0_213c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2140 -.endr -.rept 8 - .word OP0_2150 -.endr -.rept 8 - .word OP0_2158 -.endr -.rept 8 - .word OP0_2160 -.endr -.rept 8 - .word OP0_2168 -.endr -.rept 8 - .word OP0_2170 -.endr -.word OP0_2178 -.word OP0_2179 -.word OP0_217a -.word OP0_217b -.word OP0_217c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_2180 -.endr -.rept 8 - .word OP0_2190 -.endr -.rept 8 - .word OP0_2198 -.endr -.rept 8 - .word OP0_21a0 -.endr -.rept 8 - .word OP0_21a8 -.endr -.rept 8 - .word OP0_21b0 -.endr -.word OP0_21b8 -.word OP0_21b9 -.word OP0_21ba -.word OP0_21bb -.word OP0_21bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3000 -.endr -.rept 8 - .word OP0_3010 -.endr -.rept 8 - .word OP0_3018 -.endr -.rept 8 - .word OP0_3020 -.endr -.rept 8 - .word OP0_3028 -.endr -.rept 8 - .word OP0_3030 -.endr -.word OP0_3038 -.word OP0_3039 -.word OP0_303a -.word OP0_303b -.word OP0_303c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3040 -.endr -.rept 8 - .word OP0_3050 -.endr -.rept 8 - .word OP0_3058 -.endr -.rept 8 - .word OP0_3060 -.endr -.rept 8 - .word OP0_3068 -.endr -.rept 8 - .word OP0_3070 -.endr -.word OP0_3078 -.word OP0_3079 -.word OP0_307a -.word OP0_307b -.word OP0_307c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3080 -.endr -.rept 8 - .word OP0_3090 -.endr -.rept 8 - .word OP0_3098 -.endr -.rept 8 - .word OP0_30a0 -.endr -.rept 8 - .word OP0_30a8 -.endr -.rept 8 - .word OP0_30b0 -.endr -.word OP0_30b8 -.word OP0_30b9 -.word OP0_30ba -.word OP0_30bb -.word OP0_30bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_30c0 -.endr -.rept 8 - .word OP0_30d0 -.endr -.rept 8 - .word OP0_30d8 -.endr -.rept 8 - .word OP0_30e0 -.endr -.rept 8 - .word OP0_30e8 -.endr -.rept 8 - .word OP0_30f0 -.endr -.word OP0_30f8 -.word OP0_30f9 -.word OP0_30fa -.word OP0_30fb -.word OP0_30fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3100 -.endr -.rept 8 - .word OP0_3110 -.endr -.rept 8 - .word OP0_3118 -.endr -.rept 8 - .word OP0_3120 -.endr -.rept 8 - .word OP0_3128 -.endr -.rept 8 - .word OP0_3130 -.endr -.word OP0_3138 -.word OP0_3139 -.word OP0_313a -.word OP0_313b -.word OP0_313c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3140 -.endr -.rept 8 - .word OP0_3150 -.endr -.rept 8 - .word OP0_3158 -.endr -.rept 8 - .word OP0_3160 -.endr -.rept 8 - .word OP0_3168 -.endr -.rept 8 - .word OP0_3170 -.endr -.word OP0_3178 -.word OP0_3179 -.word OP0_317a -.word OP0_317b -.word OP0_317c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3180 -.endr -.rept 8 - .word OP0_3190 -.endr -.rept 8 - .word OP0_3198 -.endr -.rept 8 - .word OP0_31a0 -.endr -.rept 8 - .word OP0_31a8 -.endr -.rept 8 - .word OP0_31b0 -.endr -.word OP0_31b8 -.word OP0_31b9 -.word OP0_31ba -.word OP0_31bb -.word OP0_31bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_31c0 -.endr -.rept 8 - .word OP0_31d0 -.endr -.rept 8 - .word OP0_31d8 -.endr -.rept 8 - .word OP0_31e0 -.endr -.rept 8 - .word OP0_31e8 -.endr -.rept 8 - .word OP0_31f0 -.endr -.word OP0_31f8 -.word OP0_31f9 -.word OP0_31fa -.word OP0_31fb -.word OP0_31fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3000 -.endr -.rept 8 - .word OP0_3010 -.endr -.rept 8 - .word OP0_3018 -.endr -.rept 8 - .word OP0_3020 -.endr -.rept 8 - .word OP0_3028 -.endr -.rept 8 - .word OP0_3030 -.endr -.word OP0_3038 -.word OP0_3039 -.word OP0_303a -.word OP0_303b -.word OP0_303c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3040 -.endr -.rept 8 - .word OP0_3050 -.endr -.rept 8 - .word OP0_3058 -.endr -.rept 8 - .word OP0_3060 -.endr -.rept 8 - .word OP0_3068 -.endr -.rept 8 - .word OP0_3070 -.endr -.word OP0_3078 -.word OP0_3079 -.word OP0_307a -.word OP0_307b -.word OP0_307c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3080 -.endr -.rept 8 - .word OP0_3090 -.endr -.rept 8 - .word OP0_3098 -.endr -.rept 8 - .word OP0_30a0 -.endr -.rept 8 - .word OP0_30a8 -.endr -.rept 8 - .word OP0_30b0 -.endr -.word OP0_30b8 -.word OP0_30b9 -.word OP0_30ba -.word OP0_30bb -.word OP0_30bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_30c0 -.endr -.rept 8 - .word OP0_30d0 -.endr -.rept 8 - .word OP0_30d8 -.endr -.rept 8 - .word OP0_30e0 -.endr -.rept 8 - .word OP0_30e8 -.endr -.rept 8 - .word OP0_30f0 -.endr -.word OP0_30f8 -.word OP0_30f9 -.word OP0_30fa -.word OP0_30fb -.word OP0_30fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3100 -.endr -.rept 8 - .word OP0_3110 -.endr -.rept 8 - .word OP0_3118 -.endr -.rept 8 - .word OP0_3120 -.endr -.rept 8 - .word OP0_3128 -.endr -.rept 8 - .word OP0_3130 -.endr -.word OP0_3138 -.word OP0_3139 -.word OP0_313a -.word OP0_313b -.word OP0_313c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3140 -.endr -.rept 8 - .word OP0_3150 -.endr -.rept 8 - .word OP0_3158 -.endr -.rept 8 - .word OP0_3160 -.endr -.rept 8 - .word OP0_3168 -.endr -.rept 8 - .word OP0_3170 -.endr -.word OP0_3178 -.word OP0_3179 -.word OP0_317a -.word OP0_317b -.word OP0_317c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3180 -.endr -.rept 8 - .word OP0_3190 -.endr -.rept 8 - .word OP0_3198 -.endr -.rept 8 - .word OP0_31a0 -.endr -.rept 8 - .word OP0_31a8 -.endr -.rept 8 - .word OP0_31b0 -.endr -.word OP0_31b8 -.word OP0_31b9 -.word OP0_31ba -.word OP0_31bb -.word OP0_31bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_33c0 -.endr -.rept 8 - .word OP0_33d0 -.endr -.rept 8 - .word OP0_33d8 -.endr -.rept 8 - .word OP0_33e0 -.endr -.rept 8 - .word OP0_33e8 -.endr -.rept 8 - .word OP0_33f0 -.endr -.word OP0_33f8 -.word OP0_33f9 -.word OP0_33fa -.word OP0_33fb -.word OP0_33fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3000 -.endr -.rept 8 - .word OP0_3010 -.endr -.rept 8 - .word OP0_3018 -.endr -.rept 8 - .word OP0_3020 -.endr -.rept 8 - .word OP0_3028 -.endr -.rept 8 - .word OP0_3030 -.endr -.word OP0_3038 -.word OP0_3039 -.word OP0_303a -.word OP0_303b -.word OP0_303c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3040 -.endr -.rept 8 - .word OP0_3050 -.endr -.rept 8 - .word OP0_3058 -.endr -.rept 8 - .word OP0_3060 -.endr -.rept 8 - .word OP0_3068 -.endr -.rept 8 - .word OP0_3070 -.endr -.word OP0_3078 -.word OP0_3079 -.word OP0_307a -.word OP0_307b -.word OP0_307c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3080 -.endr -.rept 8 - .word OP0_3090 -.endr -.rept 8 - .word OP0_3098 -.endr -.rept 8 - .word OP0_30a0 -.endr -.rept 8 - .word OP0_30a8 -.endr -.rept 8 - .word OP0_30b0 -.endr -.word OP0_30b8 -.word OP0_30b9 -.word OP0_30ba -.word OP0_30bb -.word OP0_30bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_30c0 -.endr -.rept 8 - .word OP0_30d0 -.endr -.rept 8 - .word OP0_30d8 -.endr -.rept 8 - .word OP0_30e0 -.endr -.rept 8 - .word OP0_30e8 -.endr -.rept 8 - .word OP0_30f0 -.endr -.word OP0_30f8 -.word OP0_30f9 -.word OP0_30fa -.word OP0_30fb -.word OP0_30fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3100 -.endr -.rept 8 - .word OP0_3110 -.endr -.rept 8 - .word OP0_3118 -.endr -.rept 8 - .word OP0_3120 -.endr -.rept 8 - .word OP0_3128 -.endr -.rept 8 - .word OP0_3130 -.endr -.word OP0_3138 -.word OP0_3139 -.word OP0_313a -.word OP0_313b -.word OP0_313c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3140 -.endr -.rept 8 - .word OP0_3150 -.endr -.rept 8 - .word OP0_3158 -.endr -.rept 8 - .word OP0_3160 -.endr -.rept 8 - .word OP0_3168 -.endr -.rept 8 - .word OP0_3170 -.endr -.word OP0_3178 -.word OP0_3179 -.word OP0_317a -.word OP0_317b -.word OP0_317c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3180 -.endr -.rept 8 - .word OP0_3190 -.endr -.rept 8 - .word OP0_3198 -.endr -.rept 8 - .word OP0_31a0 -.endr -.rept 8 - .word OP0_31a8 -.endr -.rept 8 - .word OP0_31b0 -.endr -.word OP0_31b8 -.word OP0_31b9 -.word OP0_31ba -.word OP0_31bb -.word OP0_31bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3000 -.endr -.rept 8 - .word OP0_3010 -.endr -.rept 8 - .word OP0_3018 -.endr -.rept 8 - .word OP0_3020 -.endr -.rept 8 - .word OP0_3028 -.endr -.rept 8 - .word OP0_3030 -.endr -.word OP0_3038 -.word OP0_3039 -.word OP0_303a -.word OP0_303b -.word OP0_303c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3040 -.endr -.rept 8 - .word OP0_3050 -.endr -.rept 8 - .word OP0_3058 -.endr -.rept 8 - .word OP0_3060 -.endr -.rept 8 - .word OP0_3068 -.endr -.rept 8 - .word OP0_3070 -.endr -.word OP0_3078 -.word OP0_3079 -.word OP0_307a -.word OP0_307b -.word OP0_307c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3080 -.endr -.rept 8 - .word OP0_3090 -.endr -.rept 8 - .word OP0_3098 -.endr -.rept 8 - .word OP0_30a0 -.endr -.rept 8 - .word OP0_30a8 -.endr -.rept 8 - .word OP0_30b0 -.endr -.word OP0_30b8 -.word OP0_30b9 -.word OP0_30ba -.word OP0_30bb -.word OP0_30bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_30c0 -.endr -.rept 8 - .word OP0_30d0 -.endr -.rept 8 - .word OP0_30d8 -.endr -.rept 8 - .word OP0_30e0 -.endr -.rept 8 - .word OP0_30e8 -.endr -.rept 8 - .word OP0_30f0 -.endr -.word OP0_30f8 -.word OP0_30f9 -.word OP0_30fa -.word OP0_30fb -.word OP0_30fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3100 -.endr -.rept 8 - .word OP0_3110 -.endr -.rept 8 - .word OP0_3118 -.endr -.rept 8 - .word OP0_3120 -.endr -.rept 8 - .word OP0_3128 -.endr -.rept 8 - .word OP0_3130 -.endr -.word OP0_3138 -.word OP0_3139 -.word OP0_313a -.word OP0_313b -.word OP0_313c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3140 -.endr -.rept 8 - .word OP0_3150 -.endr -.rept 8 - .word OP0_3158 -.endr -.rept 8 - .word OP0_3160 -.endr -.rept 8 - .word OP0_3168 -.endr -.rept 8 - .word OP0_3170 -.endr -.word OP0_3178 -.word OP0_3179 -.word OP0_317a -.word OP0_317b -.word OP0_317c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3180 -.endr -.rept 8 - .word OP0_3190 -.endr -.rept 8 - .word OP0_3198 -.endr -.rept 8 - .word OP0_31a0 -.endr -.rept 8 - .word OP0_31a8 -.endr -.rept 8 - .word OP0_31b0 -.endr -.word OP0_31b8 -.word OP0_31b9 -.word OP0_31ba -.word OP0_31bb -.word OP0_31bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3000 -.endr -.rept 8 - .word OP0_3010 -.endr -.rept 8 - .word OP0_3018 -.endr -.rept 8 - .word OP0_3020 -.endr -.rept 8 - .word OP0_3028 -.endr -.rept 8 - .word OP0_3030 -.endr -.word OP0_3038 -.word OP0_3039 -.word OP0_303a -.word OP0_303b -.word OP0_303c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3040 -.endr -.rept 8 - .word OP0_3050 -.endr -.rept 8 - .word OP0_3058 -.endr -.rept 8 - .word OP0_3060 -.endr -.rept 8 - .word OP0_3068 -.endr -.rept 8 - .word OP0_3070 -.endr -.word OP0_3078 -.word OP0_3079 -.word OP0_307a -.word OP0_307b -.word OP0_307c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3080 -.endr -.rept 8 - .word OP0_3090 -.endr -.rept 8 - .word OP0_3098 -.endr -.rept 8 - .word OP0_30a0 -.endr -.rept 8 - .word OP0_30a8 -.endr -.rept 8 - .word OP0_30b0 -.endr -.word OP0_30b8 -.word OP0_30b9 -.word OP0_30ba -.word OP0_30bb -.word OP0_30bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_30c0 -.endr -.rept 8 - .word OP0_30d0 -.endr -.rept 8 - .word OP0_30d8 -.endr -.rept 8 - .word OP0_30e0 -.endr -.rept 8 - .word OP0_30e8 -.endr -.rept 8 - .word OP0_30f0 -.endr -.word OP0_30f8 -.word OP0_30f9 -.word OP0_30fa -.word OP0_30fb -.word OP0_30fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3100 -.endr -.rept 8 - .word OP0_3110 -.endr -.rept 8 - .word OP0_3118 -.endr -.rept 8 - .word OP0_3120 -.endr -.rept 8 - .word OP0_3128 -.endr -.rept 8 - .word OP0_3130 -.endr -.word OP0_3138 -.word OP0_3139 -.word OP0_313a -.word OP0_313b -.word OP0_313c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3140 -.endr -.rept 8 - .word OP0_3150 -.endr -.rept 8 - .word OP0_3158 -.endr -.rept 8 - .word OP0_3160 -.endr -.rept 8 - .word OP0_3168 -.endr -.rept 8 - .word OP0_3170 -.endr -.word OP0_3178 -.word OP0_3179 -.word OP0_317a -.word OP0_317b -.word OP0_317c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3180 -.endr -.rept 8 - .word OP0_3190 -.endr -.rept 8 - .word OP0_3198 -.endr -.rept 8 - .word OP0_31a0 -.endr -.rept 8 - .word OP0_31a8 -.endr -.rept 8 - .word OP0_31b0 -.endr -.word OP0_31b8 -.word OP0_31b9 -.word OP0_31ba -.word OP0_31bb -.word OP0_31bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3000 -.endr -.rept 8 - .word OP0_3010 -.endr -.rept 8 - .word OP0_3018 -.endr -.rept 8 - .word OP0_3020 -.endr -.rept 8 - .word OP0_3028 -.endr -.rept 8 - .word OP0_3030 -.endr -.word OP0_3038 -.word OP0_3039 -.word OP0_303a -.word OP0_303b -.word OP0_303c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3040 -.endr -.rept 8 - .word OP0_3050 -.endr -.rept 8 - .word OP0_3058 -.endr -.rept 8 - .word OP0_3060 -.endr -.rept 8 - .word OP0_3068 -.endr -.rept 8 - .word OP0_3070 -.endr -.word OP0_3078 -.word OP0_3079 -.word OP0_307a -.word OP0_307b -.word OP0_307c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3080 -.endr -.rept 8 - .word OP0_3090 -.endr -.rept 8 - .word OP0_3098 -.endr -.rept 8 - .word OP0_30a0 -.endr -.rept 8 - .word OP0_30a8 -.endr -.rept 8 - .word OP0_30b0 -.endr -.word OP0_30b8 -.word OP0_30b9 -.word OP0_30ba -.word OP0_30bb -.word OP0_30bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_30c0 -.endr -.rept 8 - .word OP0_30d0 -.endr -.rept 8 - .word OP0_30d8 -.endr -.rept 8 - .word OP0_30e0 -.endr -.rept 8 - .word OP0_30e8 -.endr -.rept 8 - .word OP0_30f0 -.endr -.word OP0_30f8 -.word OP0_30f9 -.word OP0_30fa -.word OP0_30fb -.word OP0_30fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3100 -.endr -.rept 8 - .word OP0_3110 -.endr -.rept 8 - .word OP0_3118 -.endr -.rept 8 - .word OP0_3120 -.endr -.rept 8 - .word OP0_3128 -.endr -.rept 8 - .word OP0_3130 -.endr -.word OP0_3138 -.word OP0_3139 -.word OP0_313a -.word OP0_313b -.word OP0_313c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3140 -.endr -.rept 8 - .word OP0_3150 -.endr -.rept 8 - .word OP0_3158 -.endr -.rept 8 - .word OP0_3160 -.endr -.rept 8 - .word OP0_3168 -.endr -.rept 8 - .word OP0_3170 -.endr -.word OP0_3178 -.word OP0_3179 -.word OP0_317a -.word OP0_317b -.word OP0_317c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3180 -.endr -.rept 8 - .word OP0_3190 -.endr -.rept 8 - .word OP0_3198 -.endr -.rept 8 - .word OP0_31a0 -.endr -.rept 8 - .word OP0_31a8 -.endr -.rept 8 - .word OP0_31b0 -.endr -.word OP0_31b8 -.word OP0_31b9 -.word OP0_31ba -.word OP0_31bb -.word OP0_31bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3000 -.endr -.rept 8 - .word OP0_3010 -.endr -.rept 8 - .word OP0_3018 -.endr -.rept 8 - .word OP0_3020 -.endr -.rept 8 - .word OP0_3028 -.endr -.rept 8 - .word OP0_3030 -.endr -.word OP0_3038 -.word OP0_3039 -.word OP0_303a -.word OP0_303b -.word OP0_303c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3040 -.endr -.rept 8 - .word OP0_3050 -.endr -.rept 8 - .word OP0_3058 -.endr -.rept 8 - .word OP0_3060 -.endr -.rept 8 - .word OP0_3068 -.endr -.rept 8 - .word OP0_3070 -.endr -.word OP0_3078 -.word OP0_3079 -.word OP0_307a -.word OP0_307b -.word OP0_307c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3080 -.endr -.rept 8 - .word OP0_3090 -.endr -.rept 8 - .word OP0_3098 -.endr -.rept 8 - .word OP0_30a0 -.endr -.rept 8 - .word OP0_30a8 -.endr -.rept 8 - .word OP0_30b0 -.endr -.word OP0_30b8 -.word OP0_30b9 -.word OP0_30ba -.word OP0_30bb -.word OP0_30bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_30c0 -.endr -.rept 8 - .word OP0_30d0 -.endr -.rept 8 - .word OP0_30d8 -.endr -.rept 8 - .word OP0_30e0 -.endr -.rept 8 - .word OP0_30e8 -.endr -.rept 8 - .word OP0_30f0 -.endr -.word OP0_30f8 -.word OP0_30f9 -.word OP0_30fa -.word OP0_30fb -.word OP0_30fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3100 -.endr -.rept 8 - .word OP0_3110 -.endr -.rept 8 - .word OP0_3118 -.endr -.rept 8 - .word OP0_3120 -.endr -.rept 8 - .word OP0_3128 -.endr -.rept 8 - .word OP0_3130 -.endr -.word OP0_3138 -.word OP0_3139 -.word OP0_313a -.word OP0_313b -.word OP0_313c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3140 -.endr -.rept 8 - .word OP0_3150 -.endr -.rept 8 - .word OP0_3158 -.endr -.rept 8 - .word OP0_3160 -.endr -.rept 8 - .word OP0_3168 -.endr -.rept 8 - .word OP0_3170 -.endr -.word OP0_3178 -.word OP0_3179 -.word OP0_317a -.word OP0_317b -.word OP0_317c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3180 -.endr -.rept 8 - .word OP0_3190 -.endr -.rept 8 - .word OP0_3198 -.endr -.rept 8 - .word OP0_31a0 -.endr -.rept 8 - .word OP0_31a8 -.endr -.rept 8 - .word OP0_31b0 -.endr -.word OP0_31b8 -.word OP0_31b9 -.word OP0_31ba -.word OP0_31bb -.word OP0_31bc -.rept 67 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3000 -.endr -.rept 8 - .word OP0_3010 -.endr -.rept 8 - .word OP0_3018 -.endr -.rept 8 - .word OP0_3020 -.endr -.rept 8 - .word OP0_3028 -.endr -.rept 8 - .word OP0_3030 -.endr -.word OP0_3038 -.word OP0_3039 -.word OP0_303a -.word OP0_303b -.word OP0_303c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3040 -.endr -.rept 8 - .word OP0_3050 -.endr -.rept 8 - .word OP0_3058 -.endr -.rept 8 - .word OP0_3060 -.endr -.rept 8 - .word OP0_3068 -.endr -.rept 8 - .word OP0_3070 -.endr -.word OP0_3078 -.word OP0_3079 -.word OP0_307a -.word OP0_307b -.word OP0_307c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3080 -.endr -.rept 8 - .word OP0_3090 -.endr -.rept 8 - .word OP0_3098 -.endr -.rept 8 - .word OP0_30a0 -.endr -.rept 8 - .word OP0_30a8 -.endr -.rept 8 - .word OP0_30b0 -.endr -.word OP0_30b8 -.word OP0_30b9 -.word OP0_30ba -.word OP0_30bb -.word OP0_30bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_30c0 -.endr -.rept 8 - .word OP0_30d0 -.endr -.rept 8 - .word OP0_30d8 -.endr -.rept 8 - .word OP0_30e0 -.endr -.rept 8 - .word OP0_30e8 -.endr -.rept 8 - .word OP0_30f0 -.endr -.word OP0_30f8 -.word OP0_30f9 -.word OP0_30fa -.word OP0_30fb -.word OP0_30fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3100 -.endr -.rept 8 - .word OP0_3110 -.endr -.rept 8 - .word OP0_3118 -.endr -.rept 8 - .word OP0_3120 -.endr -.rept 8 - .word OP0_3128 -.endr -.rept 8 - .word OP0_3130 -.endr -.word OP0_3138 -.word OP0_3139 -.word OP0_313a -.word OP0_313b -.word OP0_313c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3140 -.endr -.rept 8 - .word OP0_3150 -.endr -.rept 8 - .word OP0_3158 -.endr -.rept 8 - .word OP0_3160 -.endr -.rept 8 - .word OP0_3168 -.endr -.rept 8 - .word OP0_3170 -.endr -.word OP0_3178 -.word OP0_3179 -.word OP0_317a -.word OP0_317b -.word OP0_317c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_3180 -.endr -.rept 8 - .word OP0_3190 -.endr -.rept 8 - .word OP0_3198 -.endr -.rept 8 - .word OP0_31a0 -.endr -.rept 8 - .word OP0_31a8 -.endr -.rept 8 - .word OP0_31b0 -.endr -.word OP0_31b8 -.word OP0_31b9 -.word OP0_31ba -.word OP0_31bb -.word OP0_31bc -.rept 67 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4010 -.endr -.rept 7 - .word OP0_4018 -.endr -.word OP0_401f -.rept 7 - .word OP0_4020 -.endr -.word OP0_4027 -.rept 8 - .word OP0_4028 -.endr -.rept 8 - .word OP0_4030 -.endr -.word OP0_4038 -.word OP0_4039 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4050 -.endr -.rept 8 - .word OP0_4058 -.endr -.rept 8 - .word OP0_4060 -.endr -.rept 8 - .word OP0_4068 -.endr -.rept 8 - .word OP0_4070 -.endr -.word OP0_4078 -.word OP0_4079 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4090 -.endr -.rept 8 - .word OP0_4098 -.endr -.rept 8 - .word OP0_40a0 -.endr -.rept 8 - .word OP0_40a8 -.endr -.rept 8 - .word OP0_40b0 -.endr -.word OP0_40b8 -.word OP0_40b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_40c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_40d0 -.endr -.rept 8 - .word OP0_40d8 -.endr -.rept 8 - .word OP0_40e0 -.endr -.rept 8 - .word OP0_40e8 -.endr -.rept 8 - .word OP0_40f0 -.endr -.word OP0_40f8 -.word OP0_40f9 -.rept 134 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4180 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4190 -.endr -.rept 8 - .word OP0_4198 -.endr -.rept 8 - .word OP0_41a0 -.endr -.rept 8 - .word OP0_41a8 -.endr -.rept 8 - .word OP0_41b0 -.endr -.word OP0_41b8 -.word OP0_41b9 -.word OP0_41ba -.word OP0_41bb -.word OP0_41bc -.rept 19 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41d0 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41e8 -.endr -.rept 8 - .word OP0_41f0 -.endr -.word OP0_41f8 -.word OP0_41f9 -.word OP0_41fa -.word OP0_41fb -.rept 4 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4200 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4210 -.endr -.rept 7 - .word OP0_4218 -.endr -.word OP0_421f -.rept 7 - .word OP0_4220 -.endr -.word OP0_4227 -.rept 8 - .word OP0_4228 -.endr -.rept 8 - .word OP0_4230 -.endr -.word OP0_4238 -.word OP0_4239 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4240 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4250 -.endr -.rept 8 - .word OP0_4258 -.endr -.rept 8 - .word OP0_4260 -.endr -.rept 8 - .word OP0_4268 -.endr -.rept 8 - .word OP0_4270 -.endr -.word OP0_4278 -.word OP0_4279 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4280 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4290 -.endr -.rept 8 - .word OP0_4298 -.endr -.rept 8 - .word OP0_42a0 -.endr -.rept 8 - .word OP0_42a8 -.endr -.rept 8 - .word OP0_42b0 -.endr -.word OP0_42b8 -.word OP0_42b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_42c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_42d0 -.endr -.rept 8 - .word OP0_42d8 -.endr -.rept 8 - .word OP0_42e0 -.endr -.rept 8 - .word OP0_42e8 -.endr -.rept 8 - .word OP0_42f0 -.endr -.word OP0_42f8 -.word OP0_42f9 -.rept 134 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4180 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4190 -.endr -.rept 8 - .word OP0_4198 -.endr -.rept 8 - .word OP0_41a0 -.endr -.rept 8 - .word OP0_41a8 -.endr -.rept 8 - .word OP0_41b0 -.endr -.word OP0_41b8 -.word OP0_41b9 -.word OP0_41ba -.word OP0_41bb -.word OP0_41bc -.rept 19 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41d0 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41e8 -.endr -.rept 8 - .word OP0_41f0 -.endr -.word OP0_41f8 -.word OP0_41f9 -.word OP0_41fa -.word OP0_41fb -.rept 4 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4400 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4410 -.endr -.rept 7 - .word OP0_4418 -.endr -.word OP0_441f -.rept 7 - .word OP0_4420 -.endr -.word OP0_4427 -.rept 8 - .word OP0_4428 -.endr -.rept 8 - .word OP0_4430 -.endr -.word OP0_4438 -.word OP0_4439 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4440 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4450 -.endr -.rept 8 - .word OP0_4458 -.endr -.rept 8 - .word OP0_4460 -.endr -.rept 8 - .word OP0_4468 -.endr -.rept 8 - .word OP0_4470 -.endr -.word OP0_4478 -.word OP0_4479 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4480 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4490 -.endr -.rept 8 - .word OP0_4498 -.endr -.rept 8 - .word OP0_44a0 -.endr -.rept 8 - .word OP0_44a8 -.endr -.rept 8 - .word OP0_44b0 -.endr -.word OP0_44b8 -.word OP0_44b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_44c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_44d0 -.endr -.rept 8 - .word OP0_44d8 -.endr -.rept 8 - .word OP0_44e0 -.endr -.rept 8 - .word OP0_44e8 -.endr -.rept 8 - .word OP0_44f0 -.endr -.word OP0_44f8 -.word OP0_44f9 -.word OP0_44fa -.word OP0_44fb -.word OP0_44fc -.rept 131 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4180 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4190 -.endr -.rept 8 - .word OP0_4198 -.endr -.rept 8 - .word OP0_41a0 -.endr -.rept 8 - .word OP0_41a8 -.endr -.rept 8 - .word OP0_41b0 -.endr -.word OP0_41b8 -.word OP0_41b9 -.word OP0_41ba -.word OP0_41bb -.word OP0_41bc -.rept 19 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41d0 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41e8 -.endr -.rept 8 - .word OP0_41f0 -.endr -.word OP0_41f8 -.word OP0_41f9 -.word OP0_41fa -.word OP0_41fb -.rept 4 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4600 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4610 -.endr -.rept 7 - .word OP0_4618 -.endr -.word OP0_461f -.rept 7 - .word OP0_4620 -.endr -.word OP0_4627 -.rept 8 - .word OP0_4628 -.endr -.rept 8 - .word OP0_4630 -.endr -.word OP0_4638 -.word OP0_4639 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4640 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4650 -.endr -.rept 8 - .word OP0_4658 -.endr -.rept 8 - .word OP0_4660 -.endr -.rept 8 - .word OP0_4668 -.endr -.rept 8 - .word OP0_4670 -.endr -.word OP0_4678 -.word OP0_4679 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4680 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4690 -.endr -.rept 8 - .word OP0_4698 -.endr -.rept 8 - .word OP0_46a0 -.endr -.rept 8 - .word OP0_46a8 -.endr -.rept 8 - .word OP0_46b0 -.endr -.word OP0_46b8 -.word OP0_46b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_46c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_46d0 -.endr -.rept 8 - .word OP0_46d8 -.endr -.rept 8 - .word OP0_46e0 -.endr -.rept 8 - .word OP0_46e8 -.endr -.rept 8 - .word OP0_46f0 -.endr -.word OP0_46f8 -.word OP0_46f9 -.word OP0_46fa -.word OP0_46fb -.word OP0_46fc -.rept 131 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4180 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4190 -.endr -.rept 8 - .word OP0_4198 -.endr -.rept 8 - .word OP0_41a0 -.endr -.rept 8 - .word OP0_41a8 -.endr -.rept 8 - .word OP0_41b0 -.endr -.word OP0_41b8 -.word OP0_41b9 -.word OP0_41ba -.word OP0_41bb -.word OP0_41bc -.rept 19 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41d0 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41e8 -.endr -.rept 8 - .word OP0_41f0 -.endr -.word OP0_41f8 -.word OP0_41f9 -.word OP0_41fa -.word OP0_41fb -.rept 4 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4800 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4810 -.endr -.rept 7 - .word OP0_4818 -.endr -.word OP0_481f -.rept 7 - .word OP0_4820 -.endr -.word OP0_4827 -.rept 8 - .word OP0_4828 -.endr -.rept 8 - .word OP0_4830 -.endr -.word OP0_4838 -.word OP0_4839 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4840 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4850 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4868 -.endr -.rept 8 - .word OP0_4870 -.endr -.word OP0_4878 -.word OP0_4879 -.word OP0_487a -.word OP0_487b -.rept 4 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4880 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4890 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_48a0 -.endr -.rept 8 - .word OP0_48a8 -.endr -.rept 8 - .word OP0_48b0 -.endr -.word OP0_48b8 -.word OP0_48b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_48c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_48d0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_48e0 -.endr -.rept 8 - .word OP0_48e8 -.endr -.rept 8 - .word OP0_48f0 -.endr -.word OP0_48f8 -.word OP0_48f9 -.rept 134 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4180 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4190 -.endr -.rept 8 - .word OP0_4198 -.endr -.rept 8 - .word OP0_41a0 -.endr -.rept 8 - .word OP0_41a8 -.endr -.rept 8 - .word OP0_41b0 -.endr -.word OP0_41b8 -.word OP0_41b9 -.word OP0_41ba -.word OP0_41bb -.word OP0_41bc -.rept 19 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41d0 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41e8 -.endr -.rept 8 - .word OP0_41f0 -.endr -.word OP0_41f8 -.word OP0_41f9 -.word OP0_41fa -.word OP0_41fb -.rept 4 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4a00 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4a10 -.endr -.rept 7 - .word OP0_4a18 -.endr -.word OP0_4a1f -.rept 7 - .word OP0_4a20 -.endr -.word OP0_4a27 -.rept 8 - .word OP0_4a28 -.endr -.rept 8 - .word OP0_4a30 -.endr -.word OP0_4a38 -.word OP0_4a39 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4a40 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4a50 -.endr -.rept 8 - .word OP0_4a58 -.endr -.rept 8 - .word OP0_4a60 -.endr -.rept 8 - .word OP0_4a68 -.endr -.rept 8 - .word OP0_4a70 -.endr -.word OP0_4a78 -.word OP0_4a79 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4a80 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4a90 -.endr -.rept 8 - .word OP0_4a98 -.endr -.rept 8 - .word OP0_4aa0 -.endr -.rept 8 - .word OP0_4aa8 -.endr -.rept 8 - .word OP0_4ab0 -.endr -.word OP0_4ab8 -.word OP0_4ab9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4ac0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4ad0 -.endr -.rept 7 - .word OP0_4ad8 -.endr -.word OP0_4adf -.rept 7 - .word OP0_4ae0 -.endr -.word OP0_4ae7 -.rept 8 - .word OP0_4ae8 -.endr -.rept 8 - .word OP0_4af0 -.endr -.word OP0_4af8 -.word OP0_4af9 -.rept 134 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4180 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4190 -.endr -.rept 8 - .word OP0_4198 -.endr -.rept 8 - .word OP0_41a0 -.endr -.rept 8 - .word OP0_41a8 -.endr -.rept 8 - .word OP0_41b0 -.endr -.word OP0_41b8 -.word OP0_41b9 -.word OP0_41ba -.word OP0_41bb -.word OP0_41bc -.rept 19 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41d0 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41e8 -.endr -.rept 8 - .word OP0_41f0 -.endr -.word OP0_41f8 -.word OP0_41f9 -.word OP0_41fa -.word OP0_41fb -.rept 148 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4c90 -.endr -.rept 8 - .word OP0_4c98 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4ca8 -.endr -.rept 8 - .word OP0_4cb0 -.endr -.word OP0_4cb8 -.word OP0_4cb9 -.word OP0_4cba -.word OP0_4cbb -.rept 20 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4cd0 -.endr -.rept 8 - .word OP0_4cd8 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4ce8 -.endr -.rept 8 - .word OP0_4cf0 -.endr -.word OP0_4cf8 -.word OP0_4cf9 -.word OP0_4cfa -.word OP0_4cfb -.rept 132 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4180 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4190 -.endr -.rept 8 - .word OP0_4198 -.endr -.rept 8 - .word OP0_41a0 -.endr -.rept 8 - .word OP0_41a8 -.endr -.rept 8 - .word OP0_41b0 -.endr -.word OP0_41b8 -.word OP0_41b9 -.word OP0_41ba -.word OP0_41bb -.word OP0_41bc -.rept 19 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41d0 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41e8 -.endr -.rept 8 - .word OP0_41f0 -.endr -.word OP0_41f8 -.word OP0_41f9 -.word OP0_41fa -.word OP0_41fb -.rept 68 - .word ILLEGAL -.endr -.rept 16 - .word OP0_4e40 -.endr -.rept 8 - .word OP0_4e50 -.endr -.rept 8 - .word OP0_4e58 -.endr -.rept 8 - .word OP0_4e60 -.endr -.rept 8 - .word OP0_4e68 -.endr -.word OP0_4e70 -.word OP0_4e71 -.word OP0_4e72 -.word OP0_4e73 -.word OP0_4e74 -.word OP0_4e75 -.word OP0_4e76 -.word OP0_4e77 -.rept 2 - .word ILLEGAL -.endr -.word OP0_4e7a -.word OP0_4e7b -.rept 20 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4e90 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4ea8 -.endr -.rept 8 - .word OP0_4eb0 -.endr -.word OP0_4eb8 -.word OP0_4eb9 -.word OP0_4eba -.word OP0_4ebb -.rept 20 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4ed0 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4ee8 -.endr -.rept 8 - .word OP0_4ef0 -.endr -.word OP0_4ef8 -.word OP0_4ef9 -.word OP0_4efa -.word OP0_4efb -.rept 132 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4180 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_4190 -.endr -.rept 8 - .word OP0_4198 -.endr -.rept 8 - .word OP0_41a0 -.endr -.rept 8 - .word OP0_41a8 -.endr -.rept 8 - .word OP0_41b0 -.endr -.word OP0_41b8 -.word OP0_41b9 -.word OP0_41ba -.word OP0_41bb -.word OP0_41bc -.rept 19 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41d0 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_41e8 -.endr -.rept 8 - .word OP0_41f0 -.endr -.word OP0_41f8 -.word OP0_41f9 -.word OP0_41fa -.word OP0_41fb -.rept 4 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5000 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5010 -.endr -.rept 7 - .word OP0_5018 -.endr -.word OP0_501f -.rept 7 - .word OP0_5020 -.endr -.word OP0_5027 -.rept 8 - .word OP0_5028 -.endr -.rept 8 - .word OP0_5030 -.endr -.word OP0_5038 -.word OP0_5039 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5040 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5050 -.endr -.rept 8 - .word OP0_5058 -.endr -.rept 8 - .word OP0_5060 -.endr -.rept 8 - .word OP0_5068 -.endr -.rept 8 - .word OP0_5070 -.endr -.word OP0_5078 -.word OP0_5079 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5080 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5090 -.endr -.rept 8 - .word OP0_5098 -.endr -.rept 8 - .word OP0_50a0 -.endr -.rept 8 - .word OP0_50a8 -.endr -.rept 8 - .word OP0_50b0 -.endr -.word OP0_50b8 -.word OP0_50b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_50c0 -.endr -.rept 8 - .word OP0_50c8 -.endr -.rept 8 - .word OP0_50d0 -.endr -.rept 7 - .word OP0_50d8 -.endr -.word OP0_50df -.rept 7 - .word OP0_50e0 -.endr -.word OP0_50e7 -.rept 8 - .word OP0_50e8 -.endr -.rept 8 - .word OP0_50f0 -.endr -.word OP0_50f8 -.word OP0_50f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5100 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5110 -.endr -.rept 7 - .word OP0_5118 -.endr -.word OP0_511f -.rept 7 - .word OP0_5120 -.endr -.word OP0_5127 -.rept 8 - .word OP0_5128 -.endr -.rept 8 - .word OP0_5130 -.endr -.word OP0_5138 -.word OP0_5139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5140 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5150 -.endr -.rept 8 - .word OP0_5158 -.endr -.rept 8 - .word OP0_5160 -.endr -.rept 8 - .word OP0_5168 -.endr -.rept 8 - .word OP0_5170 -.endr -.word OP0_5178 -.word OP0_5179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5180 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5190 -.endr -.rept 8 - .word OP0_5198 -.endr -.rept 8 - .word OP0_51a0 -.endr -.rept 8 - .word OP0_51a8 -.endr -.rept 8 - .word OP0_51b0 -.endr -.word OP0_51b8 -.word OP0_51b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_51c0 -.endr -.rept 8 - .word OP0_51c8 -.endr -.rept 8 - .word OP0_51d0 -.endr -.rept 7 - .word OP0_51d8 -.endr -.word OP0_51df -.rept 7 - .word OP0_51e0 -.endr -.word OP0_51e7 -.rept 8 - .word OP0_51e8 -.endr -.rept 8 - .word OP0_51f0 -.endr -.word OP0_51f8 -.word OP0_51f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5000 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5010 -.endr -.rept 7 - .word OP0_5018 -.endr -.word OP0_501f -.rept 7 - .word OP0_5020 -.endr -.word OP0_5027 -.rept 8 - .word OP0_5028 -.endr -.rept 8 - .word OP0_5030 -.endr -.word OP0_5038 -.word OP0_5039 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5040 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5050 -.endr -.rept 8 - .word OP0_5058 -.endr -.rept 8 - .word OP0_5060 -.endr -.rept 8 - .word OP0_5068 -.endr -.rept 8 - .word OP0_5070 -.endr -.word OP0_5078 -.word OP0_5079 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5080 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5090 -.endr -.rept 8 - .word OP0_5098 -.endr -.rept 8 - .word OP0_50a0 -.endr -.rept 8 - .word OP0_50a8 -.endr -.rept 8 - .word OP0_50b0 -.endr -.word OP0_50b8 -.word OP0_50b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_52c0 -.endr -.rept 8 - .word OP0_52c8 -.endr -.rept 8 - .word OP0_52d0 -.endr -.rept 7 - .word OP0_52d8 -.endr -.word OP0_52df -.rept 7 - .word OP0_52e0 -.endr -.word OP0_52e7 -.rept 8 - .word OP0_52e8 -.endr -.rept 8 - .word OP0_52f0 -.endr -.word OP0_52f8 -.word OP0_52f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5100 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5110 -.endr -.rept 7 - .word OP0_5118 -.endr -.word OP0_511f -.rept 7 - .word OP0_5120 -.endr -.word OP0_5127 -.rept 8 - .word OP0_5128 -.endr -.rept 8 - .word OP0_5130 -.endr -.word OP0_5138 -.word OP0_5139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5140 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5150 -.endr -.rept 8 - .word OP0_5158 -.endr -.rept 8 - .word OP0_5160 -.endr -.rept 8 - .word OP0_5168 -.endr -.rept 8 - .word OP0_5170 -.endr -.word OP0_5178 -.word OP0_5179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5180 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5190 -.endr -.rept 8 - .word OP0_5198 -.endr -.rept 8 - .word OP0_51a0 -.endr -.rept 8 - .word OP0_51a8 -.endr -.rept 8 - .word OP0_51b0 -.endr -.word OP0_51b8 -.word OP0_51b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_53c0 -.endr -.rept 8 - .word OP0_53c8 -.endr -.rept 8 - .word OP0_53d0 -.endr -.rept 7 - .word OP0_53d8 -.endr -.word OP0_53df -.rept 7 - .word OP0_53e0 -.endr -.word OP0_53e7 -.rept 8 - .word OP0_53e8 -.endr -.rept 8 - .word OP0_53f0 -.endr -.word OP0_53f8 -.word OP0_53f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5000 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5010 -.endr -.rept 7 - .word OP0_5018 -.endr -.word OP0_501f -.rept 7 - .word OP0_5020 -.endr -.word OP0_5027 -.rept 8 - .word OP0_5028 -.endr -.rept 8 - .word OP0_5030 -.endr -.word OP0_5038 -.word OP0_5039 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5040 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5050 -.endr -.rept 8 - .word OP0_5058 -.endr -.rept 8 - .word OP0_5060 -.endr -.rept 8 - .word OP0_5068 -.endr -.rept 8 - .word OP0_5070 -.endr -.word OP0_5078 -.word OP0_5079 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5080 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5090 -.endr -.rept 8 - .word OP0_5098 -.endr -.rept 8 - .word OP0_50a0 -.endr -.rept 8 - .word OP0_50a8 -.endr -.rept 8 - .word OP0_50b0 -.endr -.word OP0_50b8 -.word OP0_50b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_54c0 -.endr -.rept 8 - .word OP0_54c8 -.endr -.rept 8 - .word OP0_54d0 -.endr -.rept 7 - .word OP0_54d8 -.endr -.word OP0_54df -.rept 7 - .word OP0_54e0 -.endr -.word OP0_54e7 -.rept 8 - .word OP0_54e8 -.endr -.rept 8 - .word OP0_54f0 -.endr -.word OP0_54f8 -.word OP0_54f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5100 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5110 -.endr -.rept 7 - .word OP0_5118 -.endr -.word OP0_511f -.rept 7 - .word OP0_5120 -.endr -.word OP0_5127 -.rept 8 - .word OP0_5128 -.endr -.rept 8 - .word OP0_5130 -.endr -.word OP0_5138 -.word OP0_5139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5140 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5150 -.endr -.rept 8 - .word OP0_5158 -.endr -.rept 8 - .word OP0_5160 -.endr -.rept 8 - .word OP0_5168 -.endr -.rept 8 - .word OP0_5170 -.endr -.word OP0_5178 -.word OP0_5179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5180 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5190 -.endr -.rept 8 - .word OP0_5198 -.endr -.rept 8 - .word OP0_51a0 -.endr -.rept 8 - .word OP0_51a8 -.endr -.rept 8 - .word OP0_51b0 -.endr -.word OP0_51b8 -.word OP0_51b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_55c0 -.endr -.rept 8 - .word OP0_55c8 -.endr -.rept 8 - .word OP0_55d0 -.endr -.rept 7 - .word OP0_55d8 -.endr -.word OP0_55df -.rept 7 - .word OP0_55e0 -.endr -.word OP0_55e7 -.rept 8 - .word OP0_55e8 -.endr -.rept 8 - .word OP0_55f0 -.endr -.word OP0_55f8 -.word OP0_55f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5000 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5010 -.endr -.rept 7 - .word OP0_5018 -.endr -.word OP0_501f -.rept 7 - .word OP0_5020 -.endr -.word OP0_5027 -.rept 8 - .word OP0_5028 -.endr -.rept 8 - .word OP0_5030 -.endr -.word OP0_5038 -.word OP0_5039 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5040 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5050 -.endr -.rept 8 - .word OP0_5058 -.endr -.rept 8 - .word OP0_5060 -.endr -.rept 8 - .word OP0_5068 -.endr -.rept 8 - .word OP0_5070 -.endr -.word OP0_5078 -.word OP0_5079 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5080 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5090 -.endr -.rept 8 - .word OP0_5098 -.endr -.rept 8 - .word OP0_50a0 -.endr -.rept 8 - .word OP0_50a8 -.endr -.rept 8 - .word OP0_50b0 -.endr -.word OP0_50b8 -.word OP0_50b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_56c0 -.endr -.rept 8 - .word OP0_56c8 -.endr -.rept 8 - .word OP0_56d0 -.endr -.rept 7 - .word OP0_56d8 -.endr -.word OP0_56df -.rept 7 - .word OP0_56e0 -.endr -.word OP0_56e7 -.rept 8 - .word OP0_56e8 -.endr -.rept 8 - .word OP0_56f0 -.endr -.word OP0_56f8 -.word OP0_56f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5100 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5110 -.endr -.rept 7 - .word OP0_5118 -.endr -.word OP0_511f -.rept 7 - .word OP0_5120 -.endr -.word OP0_5127 -.rept 8 - .word OP0_5128 -.endr -.rept 8 - .word OP0_5130 -.endr -.word OP0_5138 -.word OP0_5139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5140 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5150 -.endr -.rept 8 - .word OP0_5158 -.endr -.rept 8 - .word OP0_5160 -.endr -.rept 8 - .word OP0_5168 -.endr -.rept 8 - .word OP0_5170 -.endr -.word OP0_5178 -.word OP0_5179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5180 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5190 -.endr -.rept 8 - .word OP0_5198 -.endr -.rept 8 - .word OP0_51a0 -.endr -.rept 8 - .word OP0_51a8 -.endr -.rept 8 - .word OP0_51b0 -.endr -.word OP0_51b8 -.word OP0_51b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_57c0 -.endr -.rept 8 - .word OP0_57c8 -.endr -.rept 8 - .word OP0_57d0 -.endr -.rept 7 - .word OP0_57d8 -.endr -.word OP0_57df -.rept 7 - .word OP0_57e0 -.endr -.word OP0_57e7 -.rept 8 - .word OP0_57e8 -.endr -.rept 8 - .word OP0_57f0 -.endr -.word OP0_57f8 -.word OP0_57f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5000 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5010 -.endr -.rept 7 - .word OP0_5018 -.endr -.word OP0_501f -.rept 7 - .word OP0_5020 -.endr -.word OP0_5027 -.rept 8 - .word OP0_5028 -.endr -.rept 8 - .word OP0_5030 -.endr -.word OP0_5038 -.word OP0_5039 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5040 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5050 -.endr -.rept 8 - .word OP0_5058 -.endr -.rept 8 - .word OP0_5060 -.endr -.rept 8 - .word OP0_5068 -.endr -.rept 8 - .word OP0_5070 -.endr -.word OP0_5078 -.word OP0_5079 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5080 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5090 -.endr -.rept 8 - .word OP0_5098 -.endr -.rept 8 - .word OP0_50a0 -.endr -.rept 8 - .word OP0_50a8 -.endr -.rept 8 - .word OP0_50b0 -.endr -.word OP0_50b8 -.word OP0_50b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_58c0 -.endr -.rept 8 - .word OP0_58c8 -.endr -.rept 8 - .word OP0_58d0 -.endr -.rept 7 - .word OP0_58d8 -.endr -.word OP0_58df -.rept 7 - .word OP0_58e0 -.endr -.word OP0_58e7 -.rept 8 - .word OP0_58e8 -.endr -.rept 8 - .word OP0_58f0 -.endr -.word OP0_58f8 -.word OP0_58f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5100 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5110 -.endr -.rept 7 - .word OP0_5118 -.endr -.word OP0_511f -.rept 7 - .word OP0_5120 -.endr -.word OP0_5127 -.rept 8 - .word OP0_5128 -.endr -.rept 8 - .word OP0_5130 -.endr -.word OP0_5138 -.word OP0_5139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5140 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5150 -.endr -.rept 8 - .word OP0_5158 -.endr -.rept 8 - .word OP0_5160 -.endr -.rept 8 - .word OP0_5168 -.endr -.rept 8 - .word OP0_5170 -.endr -.word OP0_5178 -.word OP0_5179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5180 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5190 -.endr -.rept 8 - .word OP0_5198 -.endr -.rept 8 - .word OP0_51a0 -.endr -.rept 8 - .word OP0_51a8 -.endr -.rept 8 - .word OP0_51b0 -.endr -.word OP0_51b8 -.word OP0_51b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_59c0 -.endr -.rept 8 - .word OP0_59c8 -.endr -.rept 8 - .word OP0_59d0 -.endr -.rept 7 - .word OP0_59d8 -.endr -.word OP0_59df -.rept 7 - .word OP0_59e0 -.endr -.word OP0_59e7 -.rept 8 - .word OP0_59e8 -.endr -.rept 8 - .word OP0_59f0 -.endr -.word OP0_59f8 -.word OP0_59f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5000 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5010 -.endr -.rept 7 - .word OP0_5018 -.endr -.word OP0_501f -.rept 7 - .word OP0_5020 -.endr -.word OP0_5027 -.rept 8 - .word OP0_5028 -.endr -.rept 8 - .word OP0_5030 -.endr -.word OP0_5038 -.word OP0_5039 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5040 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5050 -.endr -.rept 8 - .word OP0_5058 -.endr -.rept 8 - .word OP0_5060 -.endr -.rept 8 - .word OP0_5068 -.endr -.rept 8 - .word OP0_5070 -.endr -.word OP0_5078 -.word OP0_5079 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5080 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5090 -.endr -.rept 8 - .word OP0_5098 -.endr -.rept 8 - .word OP0_50a0 -.endr -.rept 8 - .word OP0_50a8 -.endr -.rept 8 - .word OP0_50b0 -.endr -.word OP0_50b8 -.word OP0_50b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5ac0 -.endr -.rept 8 - .word OP0_5ac8 -.endr -.rept 8 - .word OP0_5ad0 -.endr -.rept 7 - .word OP0_5ad8 -.endr -.word OP0_5adf -.rept 7 - .word OP0_5ae0 -.endr -.word OP0_5ae7 -.rept 8 - .word OP0_5ae8 -.endr -.rept 8 - .word OP0_5af0 -.endr -.word OP0_5af8 -.word OP0_5af9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5100 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5110 -.endr -.rept 7 - .word OP0_5118 -.endr -.word OP0_511f -.rept 7 - .word OP0_5120 -.endr -.word OP0_5127 -.rept 8 - .word OP0_5128 -.endr -.rept 8 - .word OP0_5130 -.endr -.word OP0_5138 -.word OP0_5139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5140 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5150 -.endr -.rept 8 - .word OP0_5158 -.endr -.rept 8 - .word OP0_5160 -.endr -.rept 8 - .word OP0_5168 -.endr -.rept 8 - .word OP0_5170 -.endr -.word OP0_5178 -.word OP0_5179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5180 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5190 -.endr -.rept 8 - .word OP0_5198 -.endr -.rept 8 - .word OP0_51a0 -.endr -.rept 8 - .word OP0_51a8 -.endr -.rept 8 - .word OP0_51b0 -.endr -.word OP0_51b8 -.word OP0_51b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5bc0 -.endr -.rept 8 - .word OP0_5bc8 -.endr -.rept 8 - .word OP0_5bd0 -.endr -.rept 7 - .word OP0_5bd8 -.endr -.word OP0_5bdf -.rept 7 - .word OP0_5be0 -.endr -.word OP0_5be7 -.rept 8 - .word OP0_5be8 -.endr -.rept 8 - .word OP0_5bf0 -.endr -.word OP0_5bf8 -.word OP0_5bf9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5000 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5010 -.endr -.rept 7 - .word OP0_5018 -.endr -.word OP0_501f -.rept 7 - .word OP0_5020 -.endr -.word OP0_5027 -.rept 8 - .word OP0_5028 -.endr -.rept 8 - .word OP0_5030 -.endr -.word OP0_5038 -.word OP0_5039 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5040 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5050 -.endr -.rept 8 - .word OP0_5058 -.endr -.rept 8 - .word OP0_5060 -.endr -.rept 8 - .word OP0_5068 -.endr -.rept 8 - .word OP0_5070 -.endr -.word OP0_5078 -.word OP0_5079 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5080 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5090 -.endr -.rept 8 - .word OP0_5098 -.endr -.rept 8 - .word OP0_50a0 -.endr -.rept 8 - .word OP0_50a8 -.endr -.rept 8 - .word OP0_50b0 -.endr -.word OP0_50b8 -.word OP0_50b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5cc0 -.endr -.rept 8 - .word OP0_5cc8 -.endr -.rept 8 - .word OP0_5cd0 -.endr -.rept 7 - .word OP0_5cd8 -.endr -.word OP0_5cdf -.rept 7 - .word OP0_5ce0 -.endr -.word OP0_5ce7 -.rept 8 - .word OP0_5ce8 -.endr -.rept 8 - .word OP0_5cf0 -.endr -.word OP0_5cf8 -.word OP0_5cf9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5100 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5110 -.endr -.rept 7 - .word OP0_5118 -.endr -.word OP0_511f -.rept 7 - .word OP0_5120 -.endr -.word OP0_5127 -.rept 8 - .word OP0_5128 -.endr -.rept 8 - .word OP0_5130 -.endr -.word OP0_5138 -.word OP0_5139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5140 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5150 -.endr -.rept 8 - .word OP0_5158 -.endr -.rept 8 - .word OP0_5160 -.endr -.rept 8 - .word OP0_5168 -.endr -.rept 8 - .word OP0_5170 -.endr -.word OP0_5178 -.word OP0_5179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5180 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5190 -.endr -.rept 8 - .word OP0_5198 -.endr -.rept 8 - .word OP0_51a0 -.endr -.rept 8 - .word OP0_51a8 -.endr -.rept 8 - .word OP0_51b0 -.endr -.word OP0_51b8 -.word OP0_51b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5dc0 -.endr -.rept 8 - .word OP0_5dc8 -.endr -.rept 8 - .word OP0_5dd0 -.endr -.rept 7 - .word OP0_5dd8 -.endr -.word OP0_5ddf -.rept 7 - .word OP0_5de0 -.endr -.word OP0_5de7 -.rept 8 - .word OP0_5de8 -.endr -.rept 8 - .word OP0_5df0 -.endr -.word OP0_5df8 -.word OP0_5df9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5000 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5010 -.endr -.rept 7 - .word OP0_5018 -.endr -.word OP0_501f -.rept 7 - .word OP0_5020 -.endr -.word OP0_5027 -.rept 8 - .word OP0_5028 -.endr -.rept 8 - .word OP0_5030 -.endr -.word OP0_5038 -.word OP0_5039 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5040 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5050 -.endr -.rept 8 - .word OP0_5058 -.endr -.rept 8 - .word OP0_5060 -.endr -.rept 8 - .word OP0_5068 -.endr -.rept 8 - .word OP0_5070 -.endr -.word OP0_5078 -.word OP0_5079 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5080 -.endr -.rept 8 - .word OP0_5088 -.endr -.rept 8 - .word OP0_5090 -.endr -.rept 8 - .word OP0_5098 -.endr -.rept 8 - .word OP0_50a0 -.endr -.rept 8 - .word OP0_50a8 -.endr -.rept 8 - .word OP0_50b0 -.endr -.word OP0_50b8 -.word OP0_50b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5ec0 -.endr -.rept 8 - .word OP0_5ec8 -.endr -.rept 8 - .word OP0_5ed0 -.endr -.rept 7 - .word OP0_5ed8 -.endr -.word OP0_5edf -.rept 7 - .word OP0_5ee0 -.endr -.word OP0_5ee7 -.rept 8 - .word OP0_5ee8 -.endr -.rept 8 - .word OP0_5ef0 -.endr -.word OP0_5ef8 -.word OP0_5ef9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5100 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5110 -.endr -.rept 7 - .word OP0_5118 -.endr -.word OP0_511f -.rept 7 - .word OP0_5120 -.endr -.word OP0_5127 -.rept 8 - .word OP0_5128 -.endr -.rept 8 - .word OP0_5130 -.endr -.word OP0_5138 -.word OP0_5139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5140 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5150 -.endr -.rept 8 - .word OP0_5158 -.endr -.rept 8 - .word OP0_5160 -.endr -.rept 8 - .word OP0_5168 -.endr -.rept 8 - .word OP0_5170 -.endr -.word OP0_5178 -.word OP0_5179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5180 -.endr -.rept 8 - .word OP0_5188 -.endr -.rept 8 - .word OP0_5190 -.endr -.rept 8 - .word OP0_5198 -.endr -.rept 8 - .word OP0_51a0 -.endr -.rept 8 - .word OP0_51a8 -.endr -.rept 8 - .word OP0_51b0 -.endr -.word OP0_51b8 -.word OP0_51b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_5fc0 -.endr -.rept 8 - .word OP0_5fc8 -.endr -.rept 8 - .word OP0_5fd0 -.endr -.rept 7 - .word OP0_5fd8 -.endr -.word OP0_5fdf -.rept 7 - .word OP0_5fe0 -.endr -.word OP0_5fe7 -.rept 8 - .word OP0_5fe8 -.endr -.rept 8 - .word OP0_5ff0 -.endr -.word OP0_5ff8 -.word OP0_5ff9 -.rept 6 - .word ILLEGAL -.endr -.word OP0_6000 -.rept 255 - .word OP0_6001 -.endr -.word OP0_6100 -.rept 255 - .word OP0_6101 -.endr -.word OP0_6200 -.rept 255 - .word OP0_6201 -.endr -.word OP0_6300 -.rept 255 - .word OP0_6301 -.endr -.word OP0_6400 -.rept 255 - .word OP0_6401 -.endr -.word OP0_6500 -.rept 255 - .word OP0_6501 -.endr -.word OP0_6600 -.rept 255 - .word OP0_6601 -.endr -.word OP0_6700 -.rept 255 - .word OP0_6701 -.endr -.word OP0_6800 -.rept 255 - .word OP0_6801 -.endr -.word OP0_6900 -.rept 255 - .word OP0_6901 -.endr -.word OP0_6a00 -.rept 255 - .word OP0_6a01 -.endr -.word OP0_6b00 -.rept 255 - .word OP0_6b01 -.endr -.word OP0_6c00 -.rept 255 - .word OP0_6c01 -.endr -.word OP0_6d00 -.rept 255 - .word OP0_6d01 -.endr -.word OP0_6e00 -.rept 255 - .word OP0_6e01 -.endr -.word OP0_6f00 -.rept 255 - .word OP0_6f01 -.endr -.rept 256 - .word OP0_7000 -.endr -.rept 256 - .word ILLEGAL -.endr -.rept 256 - .word OP0_7000 -.endr -.rept 256 - .word ILLEGAL -.endr -.rept 256 - .word OP0_7000 -.endr -.rept 256 - .word ILLEGAL -.endr -.rept 256 - .word OP0_7000 -.endr -.rept 256 - .word ILLEGAL -.endr -.rept 256 - .word OP0_7000 -.endr -.rept 256 - .word ILLEGAL -.endr -.rept 256 - .word OP0_7000 -.endr -.rept 256 - .word ILLEGAL -.endr -.rept 256 - .word OP0_7000 -.endr -.rept 256 - .word ILLEGAL -.endr -.rept 256 - .word OP0_7000 -.endr -.rept 256 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8010 -.endr -.rept 7 - .word OP0_8018 -.endr -.word OP0_801f -.rept 7 - .word OP0_8020 -.endr -.word OP0_8027 -.rept 8 - .word OP0_8028 -.endr -.rept 8 - .word OP0_8030 -.endr -.word OP0_8038 -.word OP0_8039 -.word OP0_803a -.word OP0_803b -.word OP0_803c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8050 -.endr -.rept 8 - .word OP0_8058 -.endr -.rept 8 - .word OP0_8060 -.endr -.rept 8 - .word OP0_8068 -.endr -.rept 8 - .word OP0_8070 -.endr -.word OP0_8078 -.word OP0_8079 -.word OP0_807a -.word OP0_807b -.word OP0_807c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8090 -.endr -.rept 8 - .word OP0_8098 -.endr -.rept 8 - .word OP0_80a0 -.endr -.rept 8 - .word OP0_80a8 -.endr -.rept 8 - .word OP0_80b0 -.endr -.word OP0_80b8 -.word OP0_80b9 -.word OP0_80ba -.word OP0_80bb -.word OP0_80bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80d0 -.endr -.rept 8 - .word OP0_80d8 -.endr -.rept 8 - .word OP0_80e0 -.endr -.rept 8 - .word OP0_80e8 -.endr -.rept 8 - .word OP0_80f0 -.endr -.word OP0_80f8 -.word OP0_80f9 -.word OP0_80fa -.word OP0_80fb -.word OP0_80fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8100 -.endr -.rept 7 - .word OP0_8108 -.endr -.word OP0_810f -.rept 8 - .word OP0_8110 -.endr -.rept 7 - .word OP0_8118 -.endr -.word OP0_811f -.rept 7 - .word OP0_8120 -.endr -.word OP0_8127 -.rept 8 - .word OP0_8128 -.endr -.rept 8 - .word OP0_8130 -.endr -.word OP0_8138 -.word OP0_8139 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8150 -.endr -.rept 8 - .word OP0_8158 -.endr -.rept 8 - .word OP0_8160 -.endr -.rept 8 - .word OP0_8168 -.endr -.rept 8 - .word OP0_8170 -.endr -.word OP0_8178 -.word OP0_8179 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8190 -.endr -.rept 8 - .word OP0_8198 -.endr -.rept 8 - .word OP0_81a0 -.endr -.rept 8 - .word OP0_81a8 -.endr -.rept 8 - .word OP0_81b0 -.endr -.word OP0_81b8 -.word OP0_81b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81d0 -.endr -.rept 8 - .word OP0_81d8 -.endr -.rept 8 - .word OP0_81e0 -.endr -.rept 8 - .word OP0_81e8 -.endr -.rept 8 - .word OP0_81f0 -.endr -.word OP0_81f8 -.word OP0_81f9 -.word OP0_81fa -.word OP0_81fb -.word OP0_81fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8010 -.endr -.rept 7 - .word OP0_8018 -.endr -.word OP0_801f -.rept 7 - .word OP0_8020 -.endr -.word OP0_8027 -.rept 8 - .word OP0_8028 -.endr -.rept 8 - .word OP0_8030 -.endr -.word OP0_8038 -.word OP0_8039 -.word OP0_803a -.word OP0_803b -.word OP0_803c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8050 -.endr -.rept 8 - .word OP0_8058 -.endr -.rept 8 - .word OP0_8060 -.endr -.rept 8 - .word OP0_8068 -.endr -.rept 8 - .word OP0_8070 -.endr -.word OP0_8078 -.word OP0_8079 -.word OP0_807a -.word OP0_807b -.word OP0_807c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8090 -.endr -.rept 8 - .word OP0_8098 -.endr -.rept 8 - .word OP0_80a0 -.endr -.rept 8 - .word OP0_80a8 -.endr -.rept 8 - .word OP0_80b0 -.endr -.word OP0_80b8 -.word OP0_80b9 -.word OP0_80ba -.word OP0_80bb -.word OP0_80bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80d0 -.endr -.rept 8 - .word OP0_80d8 -.endr -.rept 8 - .word OP0_80e0 -.endr -.rept 8 - .word OP0_80e8 -.endr -.rept 8 - .word OP0_80f0 -.endr -.word OP0_80f8 -.word OP0_80f9 -.word OP0_80fa -.word OP0_80fb -.word OP0_80fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8100 -.endr -.rept 7 - .word OP0_8108 -.endr -.word OP0_810f -.rept 8 - .word OP0_8110 -.endr -.rept 7 - .word OP0_8118 -.endr -.word OP0_811f -.rept 7 - .word OP0_8120 -.endr -.word OP0_8127 -.rept 8 - .word OP0_8128 -.endr -.rept 8 - .word OP0_8130 -.endr -.word OP0_8138 -.word OP0_8139 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8150 -.endr -.rept 8 - .word OP0_8158 -.endr -.rept 8 - .word OP0_8160 -.endr -.rept 8 - .word OP0_8168 -.endr -.rept 8 - .word OP0_8170 -.endr -.word OP0_8178 -.word OP0_8179 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8190 -.endr -.rept 8 - .word OP0_8198 -.endr -.rept 8 - .word OP0_81a0 -.endr -.rept 8 - .word OP0_81a8 -.endr -.rept 8 - .word OP0_81b0 -.endr -.word OP0_81b8 -.word OP0_81b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81d0 -.endr -.rept 8 - .word OP0_81d8 -.endr -.rept 8 - .word OP0_81e0 -.endr -.rept 8 - .word OP0_81e8 -.endr -.rept 8 - .word OP0_81f0 -.endr -.word OP0_81f8 -.word OP0_81f9 -.word OP0_81fa -.word OP0_81fb -.word OP0_81fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8010 -.endr -.rept 7 - .word OP0_8018 -.endr -.word OP0_801f -.rept 7 - .word OP0_8020 -.endr -.word OP0_8027 -.rept 8 - .word OP0_8028 -.endr -.rept 8 - .word OP0_8030 -.endr -.word OP0_8038 -.word OP0_8039 -.word OP0_803a -.word OP0_803b -.word OP0_803c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8050 -.endr -.rept 8 - .word OP0_8058 -.endr -.rept 8 - .word OP0_8060 -.endr -.rept 8 - .word OP0_8068 -.endr -.rept 8 - .word OP0_8070 -.endr -.word OP0_8078 -.word OP0_8079 -.word OP0_807a -.word OP0_807b -.word OP0_807c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8090 -.endr -.rept 8 - .word OP0_8098 -.endr -.rept 8 - .word OP0_80a0 -.endr -.rept 8 - .word OP0_80a8 -.endr -.rept 8 - .word OP0_80b0 -.endr -.word OP0_80b8 -.word OP0_80b9 -.word OP0_80ba -.word OP0_80bb -.word OP0_80bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80d0 -.endr -.rept 8 - .word OP0_80d8 -.endr -.rept 8 - .word OP0_80e0 -.endr -.rept 8 - .word OP0_80e8 -.endr -.rept 8 - .word OP0_80f0 -.endr -.word OP0_80f8 -.word OP0_80f9 -.word OP0_80fa -.word OP0_80fb -.word OP0_80fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8100 -.endr -.rept 7 - .word OP0_8108 -.endr -.word OP0_810f -.rept 8 - .word OP0_8110 -.endr -.rept 7 - .word OP0_8118 -.endr -.word OP0_811f -.rept 7 - .word OP0_8120 -.endr -.word OP0_8127 -.rept 8 - .word OP0_8128 -.endr -.rept 8 - .word OP0_8130 -.endr -.word OP0_8138 -.word OP0_8139 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8150 -.endr -.rept 8 - .word OP0_8158 -.endr -.rept 8 - .word OP0_8160 -.endr -.rept 8 - .word OP0_8168 -.endr -.rept 8 - .word OP0_8170 -.endr -.word OP0_8178 -.word OP0_8179 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8190 -.endr -.rept 8 - .word OP0_8198 -.endr -.rept 8 - .word OP0_81a0 -.endr -.rept 8 - .word OP0_81a8 -.endr -.rept 8 - .word OP0_81b0 -.endr -.word OP0_81b8 -.word OP0_81b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81d0 -.endr -.rept 8 - .word OP0_81d8 -.endr -.rept 8 - .word OP0_81e0 -.endr -.rept 8 - .word OP0_81e8 -.endr -.rept 8 - .word OP0_81f0 -.endr -.word OP0_81f8 -.word OP0_81f9 -.word OP0_81fa -.word OP0_81fb -.word OP0_81fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8010 -.endr -.rept 7 - .word OP0_8018 -.endr -.word OP0_801f -.rept 7 - .word OP0_8020 -.endr -.word OP0_8027 -.rept 8 - .word OP0_8028 -.endr -.rept 8 - .word OP0_8030 -.endr -.word OP0_8038 -.word OP0_8039 -.word OP0_803a -.word OP0_803b -.word OP0_803c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8050 -.endr -.rept 8 - .word OP0_8058 -.endr -.rept 8 - .word OP0_8060 -.endr -.rept 8 - .word OP0_8068 -.endr -.rept 8 - .word OP0_8070 -.endr -.word OP0_8078 -.word OP0_8079 -.word OP0_807a -.word OP0_807b -.word OP0_807c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8090 -.endr -.rept 8 - .word OP0_8098 -.endr -.rept 8 - .word OP0_80a0 -.endr -.rept 8 - .word OP0_80a8 -.endr -.rept 8 - .word OP0_80b0 -.endr -.word OP0_80b8 -.word OP0_80b9 -.word OP0_80ba -.word OP0_80bb -.word OP0_80bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80d0 -.endr -.rept 8 - .word OP0_80d8 -.endr -.rept 8 - .word OP0_80e0 -.endr -.rept 8 - .word OP0_80e8 -.endr -.rept 8 - .word OP0_80f0 -.endr -.word OP0_80f8 -.word OP0_80f9 -.word OP0_80fa -.word OP0_80fb -.word OP0_80fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8100 -.endr -.rept 7 - .word OP0_8108 -.endr -.word OP0_810f -.rept 8 - .word OP0_8110 -.endr -.rept 7 - .word OP0_8118 -.endr -.word OP0_811f -.rept 7 - .word OP0_8120 -.endr -.word OP0_8127 -.rept 8 - .word OP0_8128 -.endr -.rept 8 - .word OP0_8130 -.endr -.word OP0_8138 -.word OP0_8139 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8150 -.endr -.rept 8 - .word OP0_8158 -.endr -.rept 8 - .word OP0_8160 -.endr -.rept 8 - .word OP0_8168 -.endr -.rept 8 - .word OP0_8170 -.endr -.word OP0_8178 -.word OP0_8179 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8190 -.endr -.rept 8 - .word OP0_8198 -.endr -.rept 8 - .word OP0_81a0 -.endr -.rept 8 - .word OP0_81a8 -.endr -.rept 8 - .word OP0_81b0 -.endr -.word OP0_81b8 -.word OP0_81b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81d0 -.endr -.rept 8 - .word OP0_81d8 -.endr -.rept 8 - .word OP0_81e0 -.endr -.rept 8 - .word OP0_81e8 -.endr -.rept 8 - .word OP0_81f0 -.endr -.word OP0_81f8 -.word OP0_81f9 -.word OP0_81fa -.word OP0_81fb -.word OP0_81fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8010 -.endr -.rept 7 - .word OP0_8018 -.endr -.word OP0_801f -.rept 7 - .word OP0_8020 -.endr -.word OP0_8027 -.rept 8 - .word OP0_8028 -.endr -.rept 8 - .word OP0_8030 -.endr -.word OP0_8038 -.word OP0_8039 -.word OP0_803a -.word OP0_803b -.word OP0_803c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8050 -.endr -.rept 8 - .word OP0_8058 -.endr -.rept 8 - .word OP0_8060 -.endr -.rept 8 - .word OP0_8068 -.endr -.rept 8 - .word OP0_8070 -.endr -.word OP0_8078 -.word OP0_8079 -.word OP0_807a -.word OP0_807b -.word OP0_807c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8090 -.endr -.rept 8 - .word OP0_8098 -.endr -.rept 8 - .word OP0_80a0 -.endr -.rept 8 - .word OP0_80a8 -.endr -.rept 8 - .word OP0_80b0 -.endr -.word OP0_80b8 -.word OP0_80b9 -.word OP0_80ba -.word OP0_80bb -.word OP0_80bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80d0 -.endr -.rept 8 - .word OP0_80d8 -.endr -.rept 8 - .word OP0_80e0 -.endr -.rept 8 - .word OP0_80e8 -.endr -.rept 8 - .word OP0_80f0 -.endr -.word OP0_80f8 -.word OP0_80f9 -.word OP0_80fa -.word OP0_80fb -.word OP0_80fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8100 -.endr -.rept 7 - .word OP0_8108 -.endr -.word OP0_810f -.rept 8 - .word OP0_8110 -.endr -.rept 7 - .word OP0_8118 -.endr -.word OP0_811f -.rept 7 - .word OP0_8120 -.endr -.word OP0_8127 -.rept 8 - .word OP0_8128 -.endr -.rept 8 - .word OP0_8130 -.endr -.word OP0_8138 -.word OP0_8139 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8150 -.endr -.rept 8 - .word OP0_8158 -.endr -.rept 8 - .word OP0_8160 -.endr -.rept 8 - .word OP0_8168 -.endr -.rept 8 - .word OP0_8170 -.endr -.word OP0_8178 -.word OP0_8179 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8190 -.endr -.rept 8 - .word OP0_8198 -.endr -.rept 8 - .word OP0_81a0 -.endr -.rept 8 - .word OP0_81a8 -.endr -.rept 8 - .word OP0_81b0 -.endr -.word OP0_81b8 -.word OP0_81b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81d0 -.endr -.rept 8 - .word OP0_81d8 -.endr -.rept 8 - .word OP0_81e0 -.endr -.rept 8 - .word OP0_81e8 -.endr -.rept 8 - .word OP0_81f0 -.endr -.word OP0_81f8 -.word OP0_81f9 -.word OP0_81fa -.word OP0_81fb -.word OP0_81fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8010 -.endr -.rept 7 - .word OP0_8018 -.endr -.word OP0_801f -.rept 7 - .word OP0_8020 -.endr -.word OP0_8027 -.rept 8 - .word OP0_8028 -.endr -.rept 8 - .word OP0_8030 -.endr -.word OP0_8038 -.word OP0_8039 -.word OP0_803a -.word OP0_803b -.word OP0_803c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8050 -.endr -.rept 8 - .word OP0_8058 -.endr -.rept 8 - .word OP0_8060 -.endr -.rept 8 - .word OP0_8068 -.endr -.rept 8 - .word OP0_8070 -.endr -.word OP0_8078 -.word OP0_8079 -.word OP0_807a -.word OP0_807b -.word OP0_807c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8090 -.endr -.rept 8 - .word OP0_8098 -.endr -.rept 8 - .word OP0_80a0 -.endr -.rept 8 - .word OP0_80a8 -.endr -.rept 8 - .word OP0_80b0 -.endr -.word OP0_80b8 -.word OP0_80b9 -.word OP0_80ba -.word OP0_80bb -.word OP0_80bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80d0 -.endr -.rept 8 - .word OP0_80d8 -.endr -.rept 8 - .word OP0_80e0 -.endr -.rept 8 - .word OP0_80e8 -.endr -.rept 8 - .word OP0_80f0 -.endr -.word OP0_80f8 -.word OP0_80f9 -.word OP0_80fa -.word OP0_80fb -.word OP0_80fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8100 -.endr -.rept 7 - .word OP0_8108 -.endr -.word OP0_810f -.rept 8 - .word OP0_8110 -.endr -.rept 7 - .word OP0_8118 -.endr -.word OP0_811f -.rept 7 - .word OP0_8120 -.endr -.word OP0_8127 -.rept 8 - .word OP0_8128 -.endr -.rept 8 - .word OP0_8130 -.endr -.word OP0_8138 -.word OP0_8139 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8150 -.endr -.rept 8 - .word OP0_8158 -.endr -.rept 8 - .word OP0_8160 -.endr -.rept 8 - .word OP0_8168 -.endr -.rept 8 - .word OP0_8170 -.endr -.word OP0_8178 -.word OP0_8179 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8190 -.endr -.rept 8 - .word OP0_8198 -.endr -.rept 8 - .word OP0_81a0 -.endr -.rept 8 - .word OP0_81a8 -.endr -.rept 8 - .word OP0_81b0 -.endr -.word OP0_81b8 -.word OP0_81b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81d0 -.endr -.rept 8 - .word OP0_81d8 -.endr -.rept 8 - .word OP0_81e0 -.endr -.rept 8 - .word OP0_81e8 -.endr -.rept 8 - .word OP0_81f0 -.endr -.word OP0_81f8 -.word OP0_81f9 -.word OP0_81fa -.word OP0_81fb -.word OP0_81fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8010 -.endr -.rept 7 - .word OP0_8018 -.endr -.word OP0_801f -.rept 7 - .word OP0_8020 -.endr -.word OP0_8027 -.rept 8 - .word OP0_8028 -.endr -.rept 8 - .word OP0_8030 -.endr -.word OP0_8038 -.word OP0_8039 -.word OP0_803a -.word OP0_803b -.word OP0_803c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8050 -.endr -.rept 8 - .word OP0_8058 -.endr -.rept 8 - .word OP0_8060 -.endr -.rept 8 - .word OP0_8068 -.endr -.rept 8 - .word OP0_8070 -.endr -.word OP0_8078 -.word OP0_8079 -.word OP0_807a -.word OP0_807b -.word OP0_807c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8090 -.endr -.rept 8 - .word OP0_8098 -.endr -.rept 8 - .word OP0_80a0 -.endr -.rept 8 - .word OP0_80a8 -.endr -.rept 8 - .word OP0_80b0 -.endr -.word OP0_80b8 -.word OP0_80b9 -.word OP0_80ba -.word OP0_80bb -.word OP0_80bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80d0 -.endr -.rept 8 - .word OP0_80d8 -.endr -.rept 8 - .word OP0_80e0 -.endr -.rept 8 - .word OP0_80e8 -.endr -.rept 8 - .word OP0_80f0 -.endr -.word OP0_80f8 -.word OP0_80f9 -.word OP0_80fa -.word OP0_80fb -.word OP0_80fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8100 -.endr -.rept 7 - .word OP0_8108 -.endr -.word OP0_810f -.rept 8 - .word OP0_8110 -.endr -.rept 7 - .word OP0_8118 -.endr -.word OP0_811f -.rept 7 - .word OP0_8120 -.endr -.word OP0_8127 -.rept 8 - .word OP0_8128 -.endr -.rept 8 - .word OP0_8130 -.endr -.word OP0_8138 -.word OP0_8139 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8150 -.endr -.rept 8 - .word OP0_8158 -.endr -.rept 8 - .word OP0_8160 -.endr -.rept 8 - .word OP0_8168 -.endr -.rept 8 - .word OP0_8170 -.endr -.word OP0_8178 -.word OP0_8179 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8190 -.endr -.rept 8 - .word OP0_8198 -.endr -.rept 8 - .word OP0_81a0 -.endr -.rept 8 - .word OP0_81a8 -.endr -.rept 8 - .word OP0_81b0 -.endr -.word OP0_81b8 -.word OP0_81b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81d0 -.endr -.rept 8 - .word OP0_81d8 -.endr -.rept 8 - .word OP0_81e0 -.endr -.rept 8 - .word OP0_81e8 -.endr -.rept 8 - .word OP0_81f0 -.endr -.word OP0_81f8 -.word OP0_81f9 -.word OP0_81fa -.word OP0_81fb -.word OP0_81fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8010 -.endr -.rept 7 - .word OP0_8018 -.endr -.word OP0_801f -.rept 7 - .word OP0_8020 -.endr -.word OP0_8027 -.rept 8 - .word OP0_8028 -.endr -.rept 8 - .word OP0_8030 -.endr -.word OP0_8038 -.word OP0_8039 -.word OP0_803a -.word OP0_803b -.word OP0_803c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8050 -.endr -.rept 8 - .word OP0_8058 -.endr -.rept 8 - .word OP0_8060 -.endr -.rept 8 - .word OP0_8068 -.endr -.rept 8 - .word OP0_8070 -.endr -.word OP0_8078 -.word OP0_8079 -.word OP0_807a -.word OP0_807b -.word OP0_807c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8090 -.endr -.rept 8 - .word OP0_8098 -.endr -.rept 8 - .word OP0_80a0 -.endr -.rept 8 - .word OP0_80a8 -.endr -.rept 8 - .word OP0_80b0 -.endr -.word OP0_80b8 -.word OP0_80b9 -.word OP0_80ba -.word OP0_80bb -.word OP0_80bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_80d0 -.endr -.rept 8 - .word OP0_80d8 -.endr -.rept 8 - .word OP0_80e0 -.endr -.rept 8 - .word OP0_80e8 -.endr -.rept 8 - .word OP0_80f0 -.endr -.word OP0_80f8 -.word OP0_80f9 -.word OP0_80fa -.word OP0_80fb -.word OP0_80fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8100 -.endr -.rept 7 - .word OP0_8f08 -.endr -.word OP0_8f0f -.rept 8 - .word OP0_8110 -.endr -.rept 7 - .word OP0_8118 -.endr -.word OP0_811f -.rept 7 - .word OP0_8120 -.endr -.word OP0_8127 -.rept 8 - .word OP0_8128 -.endr -.rept 8 - .word OP0_8130 -.endr -.word OP0_8138 -.word OP0_8139 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8150 -.endr -.rept 8 - .word OP0_8158 -.endr -.rept 8 - .word OP0_8160 -.endr -.rept 8 - .word OP0_8168 -.endr -.rept 8 - .word OP0_8170 -.endr -.word OP0_8178 -.word OP0_8179 -.rept 22 - .word ILLEGAL -.endr -.rept 8 - .word OP0_8190 -.endr -.rept 8 - .word OP0_8198 -.endr -.rept 8 - .word OP0_81a0 -.endr -.rept 8 - .word OP0_81a8 -.endr -.rept 8 - .word OP0_81b0 -.endr -.word OP0_81b8 -.word OP0_81b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_81d0 -.endr -.rept 8 - .word OP0_81d8 -.endr -.rept 8 - .word OP0_81e0 -.endr -.rept 8 - .word OP0_81e8 -.endr -.rept 8 - .word OP0_81f0 -.endr -.word OP0_81f8 -.word OP0_81f9 -.word OP0_81fa -.word OP0_81fb -.word OP0_81fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9010 -.endr -.rept 7 - .word OP0_9018 -.endr -.word OP0_901f -.rept 7 - .word OP0_9020 -.endr -.word OP0_9027 -.rept 8 - .word OP0_9028 -.endr -.rept 8 - .word OP0_9030 -.endr -.word OP0_9038 -.word OP0_9039 -.word OP0_903a -.word OP0_903b -.word OP0_903c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9040 -.endr -.rept 8 - .word OP0_9050 -.endr -.rept 8 - .word OP0_9058 -.endr -.rept 8 - .word OP0_9060 -.endr -.rept 8 - .word OP0_9068 -.endr -.rept 8 - .word OP0_9070 -.endr -.word OP0_9078 -.word OP0_9079 -.word OP0_907a -.word OP0_907b -.word OP0_907c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9080 -.endr -.rept 8 - .word OP0_9090 -.endr -.rept 8 - .word OP0_9098 -.endr -.rept 8 - .word OP0_90a0 -.endr -.rept 8 - .word OP0_90a8 -.endr -.rept 8 - .word OP0_90b0 -.endr -.word OP0_90b8 -.word OP0_90b9 -.word OP0_90ba -.word OP0_90bb -.word OP0_90bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_90c0 -.endr -.rept 8 - .word OP0_90d0 -.endr -.rept 8 - .word OP0_90d8 -.endr -.rept 8 - .word OP0_90e0 -.endr -.rept 8 - .word OP0_90e8 -.endr -.rept 8 - .word OP0_90f0 -.endr -.word OP0_90f8 -.word OP0_90f9 -.word OP0_90fa -.word OP0_90fb -.word OP0_90fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9100 -.endr -.rept 7 - .word OP0_9108 -.endr -.word OP0_910f -.rept 8 - .word OP0_9110 -.endr -.rept 7 - .word OP0_9118 -.endr -.word OP0_911f -.rept 7 - .word OP0_9120 -.endr -.word OP0_9127 -.rept 8 - .word OP0_9128 -.endr -.rept 8 - .word OP0_9130 -.endr -.word OP0_9138 -.word OP0_9139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9140 -.endr -.rept 8 - .word OP0_9148 -.endr -.rept 8 - .word OP0_9150 -.endr -.rept 8 - .word OP0_9158 -.endr -.rept 8 - .word OP0_9160 -.endr -.rept 8 - .word OP0_9168 -.endr -.rept 8 - .word OP0_9170 -.endr -.word OP0_9178 -.word OP0_9179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9180 -.endr -.rept 8 - .word OP0_9188 -.endr -.rept 8 - .word OP0_9190 -.endr -.rept 8 - .word OP0_9198 -.endr -.rept 8 - .word OP0_91a0 -.endr -.rept 8 - .word OP0_91a8 -.endr -.rept 8 - .word OP0_91b0 -.endr -.word OP0_91b8 -.word OP0_91b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_91c0 -.endr -.rept 8 - .word OP0_91d0 -.endr -.rept 8 - .word OP0_91d8 -.endr -.rept 8 - .word OP0_91e0 -.endr -.rept 8 - .word OP0_91e8 -.endr -.rept 8 - .word OP0_91f0 -.endr -.word OP0_91f8 -.word OP0_91f9 -.word OP0_91fa -.word OP0_91fb -.word OP0_91fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9010 -.endr -.rept 7 - .word OP0_9018 -.endr -.word OP0_901f -.rept 7 - .word OP0_9020 -.endr -.word OP0_9027 -.rept 8 - .word OP0_9028 -.endr -.rept 8 - .word OP0_9030 -.endr -.word OP0_9038 -.word OP0_9039 -.word OP0_903a -.word OP0_903b -.word OP0_903c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9040 -.endr -.rept 8 - .word OP0_9050 -.endr -.rept 8 - .word OP0_9058 -.endr -.rept 8 - .word OP0_9060 -.endr -.rept 8 - .word OP0_9068 -.endr -.rept 8 - .word OP0_9070 -.endr -.word OP0_9078 -.word OP0_9079 -.word OP0_907a -.word OP0_907b -.word OP0_907c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9080 -.endr -.rept 8 - .word OP0_9090 -.endr -.rept 8 - .word OP0_9098 -.endr -.rept 8 - .word OP0_90a0 -.endr -.rept 8 - .word OP0_90a8 -.endr -.rept 8 - .word OP0_90b0 -.endr -.word OP0_90b8 -.word OP0_90b9 -.word OP0_90ba -.word OP0_90bb -.word OP0_90bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_90c0 -.endr -.rept 8 - .word OP0_90d0 -.endr -.rept 8 - .word OP0_90d8 -.endr -.rept 8 - .word OP0_90e0 -.endr -.rept 8 - .word OP0_90e8 -.endr -.rept 8 - .word OP0_90f0 -.endr -.word OP0_90f8 -.word OP0_90f9 -.word OP0_90fa -.word OP0_90fb -.word OP0_90fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9100 -.endr -.rept 7 - .word OP0_9108 -.endr -.word OP0_910f -.rept 8 - .word OP0_9110 -.endr -.rept 7 - .word OP0_9118 -.endr -.word OP0_911f -.rept 7 - .word OP0_9120 -.endr -.word OP0_9127 -.rept 8 - .word OP0_9128 -.endr -.rept 8 - .word OP0_9130 -.endr -.word OP0_9138 -.word OP0_9139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9140 -.endr -.rept 8 - .word OP0_9148 -.endr -.rept 8 - .word OP0_9150 -.endr -.rept 8 - .word OP0_9158 -.endr -.rept 8 - .word OP0_9160 -.endr -.rept 8 - .word OP0_9168 -.endr -.rept 8 - .word OP0_9170 -.endr -.word OP0_9178 -.word OP0_9179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9180 -.endr -.rept 8 - .word OP0_9188 -.endr -.rept 8 - .word OP0_9190 -.endr -.rept 8 - .word OP0_9198 -.endr -.rept 8 - .word OP0_91a0 -.endr -.rept 8 - .word OP0_91a8 -.endr -.rept 8 - .word OP0_91b0 -.endr -.word OP0_91b8 -.word OP0_91b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_91c0 -.endr -.rept 8 - .word OP0_91d0 -.endr -.rept 8 - .word OP0_91d8 -.endr -.rept 8 - .word OP0_91e0 -.endr -.rept 8 - .word OP0_91e8 -.endr -.rept 8 - .word OP0_91f0 -.endr -.word OP0_91f8 -.word OP0_91f9 -.word OP0_91fa -.word OP0_91fb -.word OP0_91fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9010 -.endr -.rept 7 - .word OP0_9018 -.endr -.word OP0_901f -.rept 7 - .word OP0_9020 -.endr -.word OP0_9027 -.rept 8 - .word OP0_9028 -.endr -.rept 8 - .word OP0_9030 -.endr -.word OP0_9038 -.word OP0_9039 -.word OP0_903a -.word OP0_903b -.word OP0_903c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9040 -.endr -.rept 8 - .word OP0_9050 -.endr -.rept 8 - .word OP0_9058 -.endr -.rept 8 - .word OP0_9060 -.endr -.rept 8 - .word OP0_9068 -.endr -.rept 8 - .word OP0_9070 -.endr -.word OP0_9078 -.word OP0_9079 -.word OP0_907a -.word OP0_907b -.word OP0_907c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9080 -.endr -.rept 8 - .word OP0_9090 -.endr -.rept 8 - .word OP0_9098 -.endr -.rept 8 - .word OP0_90a0 -.endr -.rept 8 - .word OP0_90a8 -.endr -.rept 8 - .word OP0_90b0 -.endr -.word OP0_90b8 -.word OP0_90b9 -.word OP0_90ba -.word OP0_90bb -.word OP0_90bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_90c0 -.endr -.rept 8 - .word OP0_90d0 -.endr -.rept 8 - .word OP0_90d8 -.endr -.rept 8 - .word OP0_90e0 -.endr -.rept 8 - .word OP0_90e8 -.endr -.rept 8 - .word OP0_90f0 -.endr -.word OP0_90f8 -.word OP0_90f9 -.word OP0_90fa -.word OP0_90fb -.word OP0_90fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9100 -.endr -.rept 7 - .word OP0_9108 -.endr -.word OP0_910f -.rept 8 - .word OP0_9110 -.endr -.rept 7 - .word OP0_9118 -.endr -.word OP0_911f -.rept 7 - .word OP0_9120 -.endr -.word OP0_9127 -.rept 8 - .word OP0_9128 -.endr -.rept 8 - .word OP0_9130 -.endr -.word OP0_9138 -.word OP0_9139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9140 -.endr -.rept 8 - .word OP0_9148 -.endr -.rept 8 - .word OP0_9150 -.endr -.rept 8 - .word OP0_9158 -.endr -.rept 8 - .word OP0_9160 -.endr -.rept 8 - .word OP0_9168 -.endr -.rept 8 - .word OP0_9170 -.endr -.word OP0_9178 -.word OP0_9179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9180 -.endr -.rept 8 - .word OP0_9188 -.endr -.rept 8 - .word OP0_9190 -.endr -.rept 8 - .word OP0_9198 -.endr -.rept 8 - .word OP0_91a0 -.endr -.rept 8 - .word OP0_91a8 -.endr -.rept 8 - .word OP0_91b0 -.endr -.word OP0_91b8 -.word OP0_91b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_91c0 -.endr -.rept 8 - .word OP0_91d0 -.endr -.rept 8 - .word OP0_91d8 -.endr -.rept 8 - .word OP0_91e0 -.endr -.rept 8 - .word OP0_91e8 -.endr -.rept 8 - .word OP0_91f0 -.endr -.word OP0_91f8 -.word OP0_91f9 -.word OP0_91fa -.word OP0_91fb -.word OP0_91fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9010 -.endr -.rept 7 - .word OP0_9018 -.endr -.word OP0_901f -.rept 7 - .word OP0_9020 -.endr -.word OP0_9027 -.rept 8 - .word OP0_9028 -.endr -.rept 8 - .word OP0_9030 -.endr -.word OP0_9038 -.word OP0_9039 -.word OP0_903a -.word OP0_903b -.word OP0_903c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9040 -.endr -.rept 8 - .word OP0_9050 -.endr -.rept 8 - .word OP0_9058 -.endr -.rept 8 - .word OP0_9060 -.endr -.rept 8 - .word OP0_9068 -.endr -.rept 8 - .word OP0_9070 -.endr -.word OP0_9078 -.word OP0_9079 -.word OP0_907a -.word OP0_907b -.word OP0_907c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9080 -.endr -.rept 8 - .word OP0_9090 -.endr -.rept 8 - .word OP0_9098 -.endr -.rept 8 - .word OP0_90a0 -.endr -.rept 8 - .word OP0_90a8 -.endr -.rept 8 - .word OP0_90b0 -.endr -.word OP0_90b8 -.word OP0_90b9 -.word OP0_90ba -.word OP0_90bb -.word OP0_90bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_90c0 -.endr -.rept 8 - .word OP0_90d0 -.endr -.rept 8 - .word OP0_90d8 -.endr -.rept 8 - .word OP0_90e0 -.endr -.rept 8 - .word OP0_90e8 -.endr -.rept 8 - .word OP0_90f0 -.endr -.word OP0_90f8 -.word OP0_90f9 -.word OP0_90fa -.word OP0_90fb -.word OP0_90fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9100 -.endr -.rept 7 - .word OP0_9108 -.endr -.word OP0_910f -.rept 8 - .word OP0_9110 -.endr -.rept 7 - .word OP0_9118 -.endr -.word OP0_911f -.rept 7 - .word OP0_9120 -.endr -.word OP0_9127 -.rept 8 - .word OP0_9128 -.endr -.rept 8 - .word OP0_9130 -.endr -.word OP0_9138 -.word OP0_9139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9140 -.endr -.rept 8 - .word OP0_9148 -.endr -.rept 8 - .word OP0_9150 -.endr -.rept 8 - .word OP0_9158 -.endr -.rept 8 - .word OP0_9160 -.endr -.rept 8 - .word OP0_9168 -.endr -.rept 8 - .word OP0_9170 -.endr -.word OP0_9178 -.word OP0_9179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9180 -.endr -.rept 8 - .word OP0_9188 -.endr -.rept 8 - .word OP0_9190 -.endr -.rept 8 - .word OP0_9198 -.endr -.rept 8 - .word OP0_91a0 -.endr -.rept 8 - .word OP0_91a8 -.endr -.rept 8 - .word OP0_91b0 -.endr -.word OP0_91b8 -.word OP0_91b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_91c0 -.endr -.rept 8 - .word OP0_91d0 -.endr -.rept 8 - .word OP0_91d8 -.endr -.rept 8 - .word OP0_91e0 -.endr -.rept 8 - .word OP0_91e8 -.endr -.rept 8 - .word OP0_91f0 -.endr -.word OP0_91f8 -.word OP0_91f9 -.word OP0_91fa -.word OP0_91fb -.word OP0_91fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9010 -.endr -.rept 7 - .word OP0_9018 -.endr -.word OP0_901f -.rept 7 - .word OP0_9020 -.endr -.word OP0_9027 -.rept 8 - .word OP0_9028 -.endr -.rept 8 - .word OP0_9030 -.endr -.word OP0_9038 -.word OP0_9039 -.word OP0_903a -.word OP0_903b -.word OP0_903c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9040 -.endr -.rept 8 - .word OP0_9050 -.endr -.rept 8 - .word OP0_9058 -.endr -.rept 8 - .word OP0_9060 -.endr -.rept 8 - .word OP0_9068 -.endr -.rept 8 - .word OP0_9070 -.endr -.word OP0_9078 -.word OP0_9079 -.word OP0_907a -.word OP0_907b -.word OP0_907c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9080 -.endr -.rept 8 - .word OP0_9090 -.endr -.rept 8 - .word OP0_9098 -.endr -.rept 8 - .word OP0_90a0 -.endr -.rept 8 - .word OP0_90a8 -.endr -.rept 8 - .word OP0_90b0 -.endr -.word OP0_90b8 -.word OP0_90b9 -.word OP0_90ba -.word OP0_90bb -.word OP0_90bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_90c0 -.endr -.rept 8 - .word OP0_90d0 -.endr -.rept 8 - .word OP0_90d8 -.endr -.rept 8 - .word OP0_90e0 -.endr -.rept 8 - .word OP0_90e8 -.endr -.rept 8 - .word OP0_90f0 -.endr -.word OP0_90f8 -.word OP0_90f9 -.word OP0_90fa -.word OP0_90fb -.word OP0_90fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9100 -.endr -.rept 7 - .word OP0_9108 -.endr -.word OP0_910f -.rept 8 - .word OP0_9110 -.endr -.rept 7 - .word OP0_9118 -.endr -.word OP0_911f -.rept 7 - .word OP0_9120 -.endr -.word OP0_9127 -.rept 8 - .word OP0_9128 -.endr -.rept 8 - .word OP0_9130 -.endr -.word OP0_9138 -.word OP0_9139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9140 -.endr -.rept 8 - .word OP0_9148 -.endr -.rept 8 - .word OP0_9150 -.endr -.rept 8 - .word OP0_9158 -.endr -.rept 8 - .word OP0_9160 -.endr -.rept 8 - .word OP0_9168 -.endr -.rept 8 - .word OP0_9170 -.endr -.word OP0_9178 -.word OP0_9179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9180 -.endr -.rept 8 - .word OP0_9188 -.endr -.rept 8 - .word OP0_9190 -.endr -.rept 8 - .word OP0_9198 -.endr -.rept 8 - .word OP0_91a0 -.endr -.rept 8 - .word OP0_91a8 -.endr -.rept 8 - .word OP0_91b0 -.endr -.word OP0_91b8 -.word OP0_91b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_91c0 -.endr -.rept 8 - .word OP0_91d0 -.endr -.rept 8 - .word OP0_91d8 -.endr -.rept 8 - .word OP0_91e0 -.endr -.rept 8 - .word OP0_91e8 -.endr -.rept 8 - .word OP0_91f0 -.endr -.word OP0_91f8 -.word OP0_91f9 -.word OP0_91fa -.word OP0_91fb -.word OP0_91fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9010 -.endr -.rept 7 - .word OP0_9018 -.endr -.word OP0_901f -.rept 7 - .word OP0_9020 -.endr -.word OP0_9027 -.rept 8 - .word OP0_9028 -.endr -.rept 8 - .word OP0_9030 -.endr -.word OP0_9038 -.word OP0_9039 -.word OP0_903a -.word OP0_903b -.word OP0_903c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9040 -.endr -.rept 8 - .word OP0_9050 -.endr -.rept 8 - .word OP0_9058 -.endr -.rept 8 - .word OP0_9060 -.endr -.rept 8 - .word OP0_9068 -.endr -.rept 8 - .word OP0_9070 -.endr -.word OP0_9078 -.word OP0_9079 -.word OP0_907a -.word OP0_907b -.word OP0_907c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9080 -.endr -.rept 8 - .word OP0_9090 -.endr -.rept 8 - .word OP0_9098 -.endr -.rept 8 - .word OP0_90a0 -.endr -.rept 8 - .word OP0_90a8 -.endr -.rept 8 - .word OP0_90b0 -.endr -.word OP0_90b8 -.word OP0_90b9 -.word OP0_90ba -.word OP0_90bb -.word OP0_90bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_90c0 -.endr -.rept 8 - .word OP0_90d0 -.endr -.rept 8 - .word OP0_90d8 -.endr -.rept 8 - .word OP0_90e0 -.endr -.rept 8 - .word OP0_90e8 -.endr -.rept 8 - .word OP0_90f0 -.endr -.word OP0_90f8 -.word OP0_90f9 -.word OP0_90fa -.word OP0_90fb -.word OP0_90fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9100 -.endr -.rept 7 - .word OP0_9108 -.endr -.word OP0_910f -.rept 8 - .word OP0_9110 -.endr -.rept 7 - .word OP0_9118 -.endr -.word OP0_911f -.rept 7 - .word OP0_9120 -.endr -.word OP0_9127 -.rept 8 - .word OP0_9128 -.endr -.rept 8 - .word OP0_9130 -.endr -.word OP0_9138 -.word OP0_9139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9140 -.endr -.rept 8 - .word OP0_9148 -.endr -.rept 8 - .word OP0_9150 -.endr -.rept 8 - .word OP0_9158 -.endr -.rept 8 - .word OP0_9160 -.endr -.rept 8 - .word OP0_9168 -.endr -.rept 8 - .word OP0_9170 -.endr -.word OP0_9178 -.word OP0_9179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9180 -.endr -.rept 8 - .word OP0_9188 -.endr -.rept 8 - .word OP0_9190 -.endr -.rept 8 - .word OP0_9198 -.endr -.rept 8 - .word OP0_91a0 -.endr -.rept 8 - .word OP0_91a8 -.endr -.rept 8 - .word OP0_91b0 -.endr -.word OP0_91b8 -.word OP0_91b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_91c0 -.endr -.rept 8 - .word OP0_91d0 -.endr -.rept 8 - .word OP0_91d8 -.endr -.rept 8 - .word OP0_91e0 -.endr -.rept 8 - .word OP0_91e8 -.endr -.rept 8 - .word OP0_91f0 -.endr -.word OP0_91f8 -.word OP0_91f9 -.word OP0_91fa -.word OP0_91fb -.word OP0_91fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9010 -.endr -.rept 7 - .word OP0_9018 -.endr -.word OP0_901f -.rept 7 - .word OP0_9020 -.endr -.word OP0_9027 -.rept 8 - .word OP0_9028 -.endr -.rept 8 - .word OP0_9030 -.endr -.word OP0_9038 -.word OP0_9039 -.word OP0_903a -.word OP0_903b -.word OP0_903c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9040 -.endr -.rept 8 - .word OP0_9050 -.endr -.rept 8 - .word OP0_9058 -.endr -.rept 8 - .word OP0_9060 -.endr -.rept 8 - .word OP0_9068 -.endr -.rept 8 - .word OP0_9070 -.endr -.word OP0_9078 -.word OP0_9079 -.word OP0_907a -.word OP0_907b -.word OP0_907c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9080 -.endr -.rept 8 - .word OP0_9090 -.endr -.rept 8 - .word OP0_9098 -.endr -.rept 8 - .word OP0_90a0 -.endr -.rept 8 - .word OP0_90a8 -.endr -.rept 8 - .word OP0_90b0 -.endr -.word OP0_90b8 -.word OP0_90b9 -.word OP0_90ba -.word OP0_90bb -.word OP0_90bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_90c0 -.endr -.rept 8 - .word OP0_90d0 -.endr -.rept 8 - .word OP0_90d8 -.endr -.rept 8 - .word OP0_90e0 -.endr -.rept 8 - .word OP0_90e8 -.endr -.rept 8 - .word OP0_90f0 -.endr -.word OP0_90f8 -.word OP0_90f9 -.word OP0_90fa -.word OP0_90fb -.word OP0_90fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9100 -.endr -.rept 7 - .word OP0_9108 -.endr -.word OP0_910f -.rept 8 - .word OP0_9110 -.endr -.rept 7 - .word OP0_9118 -.endr -.word OP0_911f -.rept 7 - .word OP0_9120 -.endr -.word OP0_9127 -.rept 8 - .word OP0_9128 -.endr -.rept 8 - .word OP0_9130 -.endr -.word OP0_9138 -.word OP0_9139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9140 -.endr -.rept 8 - .word OP0_9148 -.endr -.rept 8 - .word OP0_9150 -.endr -.rept 8 - .word OP0_9158 -.endr -.rept 8 - .word OP0_9160 -.endr -.rept 8 - .word OP0_9168 -.endr -.rept 8 - .word OP0_9170 -.endr -.word OP0_9178 -.word OP0_9179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9180 -.endr -.rept 8 - .word OP0_9188 -.endr -.rept 8 - .word OP0_9190 -.endr -.rept 8 - .word OP0_9198 -.endr -.rept 8 - .word OP0_91a0 -.endr -.rept 8 - .word OP0_91a8 -.endr -.rept 8 - .word OP0_91b0 -.endr -.word OP0_91b8 -.word OP0_91b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_91c0 -.endr -.rept 8 - .word OP0_91d0 -.endr -.rept 8 - .word OP0_91d8 -.endr -.rept 8 - .word OP0_91e0 -.endr -.rept 8 - .word OP0_91e8 -.endr -.rept 8 - .word OP0_91f0 -.endr -.word OP0_91f8 -.word OP0_91f9 -.word OP0_91fa -.word OP0_91fb -.word OP0_91fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9010 -.endr -.rept 7 - .word OP0_9018 -.endr -.word OP0_901f -.rept 7 - .word OP0_9020 -.endr -.word OP0_9027 -.rept 8 - .word OP0_9028 -.endr -.rept 8 - .word OP0_9030 -.endr -.word OP0_9038 -.word OP0_9039 -.word OP0_903a -.word OP0_903b -.word OP0_903c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9040 -.endr -.rept 8 - .word OP0_9050 -.endr -.rept 8 - .word OP0_9058 -.endr -.rept 8 - .word OP0_9060 -.endr -.rept 8 - .word OP0_9068 -.endr -.rept 8 - .word OP0_9070 -.endr -.word OP0_9078 -.word OP0_9079 -.word OP0_907a -.word OP0_907b -.word OP0_907c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_9080 -.endr -.rept 8 - .word OP0_9090 -.endr -.rept 8 - .word OP0_9098 -.endr -.rept 8 - .word OP0_90a0 -.endr -.rept 8 - .word OP0_90a8 -.endr -.rept 8 - .word OP0_90b0 -.endr -.word OP0_90b8 -.word OP0_90b9 -.word OP0_90ba -.word OP0_90bb -.word OP0_90bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_90c0 -.endr -.rept 8 - .word OP0_90d0 -.endr -.rept 8 - .word OP0_90d8 -.endr -.rept 8 - .word OP0_90e0 -.endr -.rept 8 - .word OP0_90e8 -.endr -.rept 8 - .word OP0_90f0 -.endr -.word OP0_90f8 -.word OP0_90f9 -.word OP0_90fa -.word OP0_90fb -.word OP0_90fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9100 -.endr -.rept 7 - .word OP0_9f08 -.endr -.word OP0_9f0f -.rept 8 - .word OP0_9110 -.endr -.rept 7 - .word OP0_9118 -.endr -.word OP0_911f -.rept 7 - .word OP0_9120 -.endr -.word OP0_9127 -.rept 8 - .word OP0_9128 -.endr -.rept 8 - .word OP0_9130 -.endr -.word OP0_9138 -.word OP0_9139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9140 -.endr -.rept 8 - .word OP0_9148 -.endr -.rept 8 - .word OP0_9150 -.endr -.rept 8 - .word OP0_9158 -.endr -.rept 8 - .word OP0_9160 -.endr -.rept 8 - .word OP0_9168 -.endr -.rept 8 - .word OP0_9170 -.endr -.word OP0_9178 -.word OP0_9179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_9180 -.endr -.rept 8 - .word OP0_9188 -.endr -.rept 8 - .word OP0_9190 -.endr -.rept 8 - .word OP0_9198 -.endr -.rept 8 - .word OP0_91a0 -.endr -.rept 8 - .word OP0_91a8 -.endr -.rept 8 - .word OP0_91b0 -.endr -.word OP0_91b8 -.word OP0_91b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_91c0 -.endr -.rept 8 - .word OP0_91d0 -.endr -.rept 8 - .word OP0_91d8 -.endr -.rept 8 - .word OP0_91e0 -.endr -.rept 8 - .word OP0_91e8 -.endr -.rept 8 - .word OP0_91f0 -.endr -.word OP0_91f8 -.word OP0_91f9 -.word OP0_91fa -.word OP0_91fb -.word OP0_91fc -.rept 3 - .word ILLEGAL -.endr -.rept 4096 - .word OP0_a000 -.endr -.rept 16 - .word OP0_b000 -.endr -.rept 8 - .word OP0_b010 -.endr -.rept 7 - .word OP0_b018 -.endr -.word OP0_b01f -.rept 7 - .word OP0_b020 -.endr -.word OP0_b027 -.rept 8 - .word OP0_b028 -.endr -.rept 8 - .word OP0_b030 -.endr -.word OP0_b038 -.word OP0_b039 -.word OP0_b03a -.word OP0_b03b -.word OP0_b03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b040 -.endr -.rept 8 - .word OP0_b050 -.endr -.rept 8 - .word OP0_b058 -.endr -.rept 8 - .word OP0_b060 -.endr -.rept 8 - .word OP0_b068 -.endr -.rept 8 - .word OP0_b070 -.endr -.word OP0_b078 -.word OP0_b079 -.word OP0_b07a -.word OP0_b07b -.word OP0_b07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b080 -.endr -.rept 8 - .word OP0_b090 -.endr -.rept 8 - .word OP0_b098 -.endr -.rept 8 - .word OP0_b0a0 -.endr -.rept 8 - .word OP0_b0a8 -.endr -.rept 8 - .word OP0_b0b0 -.endr -.word OP0_b0b8 -.word OP0_b0b9 -.word OP0_b0ba -.word OP0_b0bb -.word OP0_b0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b0c0 -.endr -.rept 8 - .word OP0_b0d0 -.endr -.rept 8 - .word OP0_b0d8 -.endr -.rept 8 - .word OP0_b0e0 -.endr -.rept 8 - .word OP0_b0e8 -.endr -.rept 8 - .word OP0_b0f0 -.endr -.word OP0_b0f8 -.word OP0_b0f9 -.word OP0_b0fa -.word OP0_b0fb -.word OP0_b0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b100 -.endr -.rept 7 - .word OP0_b108 -.endr -.word OP0_b10f -.rept 8 - .word OP0_b110 -.endr -.rept 7 - .word OP0_b118 -.endr -.word OP0_b11f -.rept 7 - .word OP0_b120 -.endr -.word OP0_b127 -.rept 8 - .word OP0_b128 -.endr -.rept 8 - .word OP0_b130 -.endr -.word OP0_b138 -.word OP0_b139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b140 -.endr -.rept 8 - .word OP0_b148 -.endr -.rept 8 - .word OP0_b150 -.endr -.rept 8 - .word OP0_b158 -.endr -.rept 8 - .word OP0_b160 -.endr -.rept 8 - .word OP0_b168 -.endr -.rept 8 - .word OP0_b170 -.endr -.word OP0_b178 -.word OP0_b179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b180 -.endr -.rept 8 - .word OP0_b188 -.endr -.rept 8 - .word OP0_b190 -.endr -.rept 8 - .word OP0_b198 -.endr -.rept 8 - .word OP0_b1a0 -.endr -.rept 8 - .word OP0_b1a8 -.endr -.rept 8 - .word OP0_b1b0 -.endr -.word OP0_b1b8 -.word OP0_b1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b1c0 -.endr -.rept 8 - .word OP0_b1d0 -.endr -.rept 8 - .word OP0_b1d8 -.endr -.rept 8 - .word OP0_b1e0 -.endr -.rept 8 - .word OP0_b1e8 -.endr -.rept 8 - .word OP0_b1f0 -.endr -.word OP0_b1f8 -.word OP0_b1f9 -.word OP0_b1fa -.word OP0_b1fb -.word OP0_b1fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b000 -.endr -.rept 8 - .word OP0_b010 -.endr -.rept 7 - .word OP0_b018 -.endr -.word OP0_b01f -.rept 7 - .word OP0_b020 -.endr -.word OP0_b027 -.rept 8 - .word OP0_b028 -.endr -.rept 8 - .word OP0_b030 -.endr -.word OP0_b038 -.word OP0_b039 -.word OP0_b03a -.word OP0_b03b -.word OP0_b03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b040 -.endr -.rept 8 - .word OP0_b050 -.endr -.rept 8 - .word OP0_b058 -.endr -.rept 8 - .word OP0_b060 -.endr -.rept 8 - .word OP0_b068 -.endr -.rept 8 - .word OP0_b070 -.endr -.word OP0_b078 -.word OP0_b079 -.word OP0_b07a -.word OP0_b07b -.word OP0_b07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b080 -.endr -.rept 8 - .word OP0_b090 -.endr -.rept 8 - .word OP0_b098 -.endr -.rept 8 - .word OP0_b0a0 -.endr -.rept 8 - .word OP0_b0a8 -.endr -.rept 8 - .word OP0_b0b0 -.endr -.word OP0_b0b8 -.word OP0_b0b9 -.word OP0_b0ba -.word OP0_b0bb -.word OP0_b0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b0c0 -.endr -.rept 8 - .word OP0_b0d0 -.endr -.rept 8 - .word OP0_b0d8 -.endr -.rept 8 - .word OP0_b0e0 -.endr -.rept 8 - .word OP0_b0e8 -.endr -.rept 8 - .word OP0_b0f0 -.endr -.word OP0_b0f8 -.word OP0_b0f9 -.word OP0_b0fa -.word OP0_b0fb -.word OP0_b0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b100 -.endr -.rept 7 - .word OP0_b108 -.endr -.word OP0_b10f -.rept 8 - .word OP0_b110 -.endr -.rept 7 - .word OP0_b118 -.endr -.word OP0_b11f -.rept 7 - .word OP0_b120 -.endr -.word OP0_b127 -.rept 8 - .word OP0_b128 -.endr -.rept 8 - .word OP0_b130 -.endr -.word OP0_b138 -.word OP0_b139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b140 -.endr -.rept 8 - .word OP0_b148 -.endr -.rept 8 - .word OP0_b150 -.endr -.rept 8 - .word OP0_b158 -.endr -.rept 8 - .word OP0_b160 -.endr -.rept 8 - .word OP0_b168 -.endr -.rept 8 - .word OP0_b170 -.endr -.word OP0_b178 -.word OP0_b179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b180 -.endr -.rept 8 - .word OP0_b188 -.endr -.rept 8 - .word OP0_b190 -.endr -.rept 8 - .word OP0_b198 -.endr -.rept 8 - .word OP0_b1a0 -.endr -.rept 8 - .word OP0_b1a8 -.endr -.rept 8 - .word OP0_b1b0 -.endr -.word OP0_b1b8 -.word OP0_b1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b1c0 -.endr -.rept 8 - .word OP0_b1d0 -.endr -.rept 8 - .word OP0_b1d8 -.endr -.rept 8 - .word OP0_b1e0 -.endr -.rept 8 - .word OP0_b1e8 -.endr -.rept 8 - .word OP0_b1f0 -.endr -.word OP0_b1f8 -.word OP0_b1f9 -.word OP0_b1fa -.word OP0_b1fb -.word OP0_b1fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b000 -.endr -.rept 8 - .word OP0_b010 -.endr -.rept 7 - .word OP0_b018 -.endr -.word OP0_b01f -.rept 7 - .word OP0_b020 -.endr -.word OP0_b027 -.rept 8 - .word OP0_b028 -.endr -.rept 8 - .word OP0_b030 -.endr -.word OP0_b038 -.word OP0_b039 -.word OP0_b03a -.word OP0_b03b -.word OP0_b03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b040 -.endr -.rept 8 - .word OP0_b050 -.endr -.rept 8 - .word OP0_b058 -.endr -.rept 8 - .word OP0_b060 -.endr -.rept 8 - .word OP0_b068 -.endr -.rept 8 - .word OP0_b070 -.endr -.word OP0_b078 -.word OP0_b079 -.word OP0_b07a -.word OP0_b07b -.word OP0_b07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b080 -.endr -.rept 8 - .word OP0_b090 -.endr -.rept 8 - .word OP0_b098 -.endr -.rept 8 - .word OP0_b0a0 -.endr -.rept 8 - .word OP0_b0a8 -.endr -.rept 8 - .word OP0_b0b0 -.endr -.word OP0_b0b8 -.word OP0_b0b9 -.word OP0_b0ba -.word OP0_b0bb -.word OP0_b0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b0c0 -.endr -.rept 8 - .word OP0_b0d0 -.endr -.rept 8 - .word OP0_b0d8 -.endr -.rept 8 - .word OP0_b0e0 -.endr -.rept 8 - .word OP0_b0e8 -.endr -.rept 8 - .word OP0_b0f0 -.endr -.word OP0_b0f8 -.word OP0_b0f9 -.word OP0_b0fa -.word OP0_b0fb -.word OP0_b0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b100 -.endr -.rept 7 - .word OP0_b108 -.endr -.word OP0_b10f -.rept 8 - .word OP0_b110 -.endr -.rept 7 - .word OP0_b118 -.endr -.word OP0_b11f -.rept 7 - .word OP0_b120 -.endr -.word OP0_b127 -.rept 8 - .word OP0_b128 -.endr -.rept 8 - .word OP0_b130 -.endr -.word OP0_b138 -.word OP0_b139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b140 -.endr -.rept 8 - .word OP0_b148 -.endr -.rept 8 - .word OP0_b150 -.endr -.rept 8 - .word OP0_b158 -.endr -.rept 8 - .word OP0_b160 -.endr -.rept 8 - .word OP0_b168 -.endr -.rept 8 - .word OP0_b170 -.endr -.word OP0_b178 -.word OP0_b179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b180 -.endr -.rept 8 - .word OP0_b188 -.endr -.rept 8 - .word OP0_b190 -.endr -.rept 8 - .word OP0_b198 -.endr -.rept 8 - .word OP0_b1a0 -.endr -.rept 8 - .word OP0_b1a8 -.endr -.rept 8 - .word OP0_b1b0 -.endr -.word OP0_b1b8 -.word OP0_b1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b1c0 -.endr -.rept 8 - .word OP0_b1d0 -.endr -.rept 8 - .word OP0_b1d8 -.endr -.rept 8 - .word OP0_b1e0 -.endr -.rept 8 - .word OP0_b1e8 -.endr -.rept 8 - .word OP0_b1f0 -.endr -.word OP0_b1f8 -.word OP0_b1f9 -.word OP0_b1fa -.word OP0_b1fb -.word OP0_b1fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b000 -.endr -.rept 8 - .word OP0_b010 -.endr -.rept 7 - .word OP0_b018 -.endr -.word OP0_b01f -.rept 7 - .word OP0_b020 -.endr -.word OP0_b027 -.rept 8 - .word OP0_b028 -.endr -.rept 8 - .word OP0_b030 -.endr -.word OP0_b038 -.word OP0_b039 -.word OP0_b03a -.word OP0_b03b -.word OP0_b03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b040 -.endr -.rept 8 - .word OP0_b050 -.endr -.rept 8 - .word OP0_b058 -.endr -.rept 8 - .word OP0_b060 -.endr -.rept 8 - .word OP0_b068 -.endr -.rept 8 - .word OP0_b070 -.endr -.word OP0_b078 -.word OP0_b079 -.word OP0_b07a -.word OP0_b07b -.word OP0_b07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b080 -.endr -.rept 8 - .word OP0_b090 -.endr -.rept 8 - .word OP0_b098 -.endr -.rept 8 - .word OP0_b0a0 -.endr -.rept 8 - .word OP0_b0a8 -.endr -.rept 8 - .word OP0_b0b0 -.endr -.word OP0_b0b8 -.word OP0_b0b9 -.word OP0_b0ba -.word OP0_b0bb -.word OP0_b0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b0c0 -.endr -.rept 8 - .word OP0_b0d0 -.endr -.rept 8 - .word OP0_b0d8 -.endr -.rept 8 - .word OP0_b0e0 -.endr -.rept 8 - .word OP0_b0e8 -.endr -.rept 8 - .word OP0_b0f0 -.endr -.word OP0_b0f8 -.word OP0_b0f9 -.word OP0_b0fa -.word OP0_b0fb -.word OP0_b0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b100 -.endr -.rept 7 - .word OP0_b108 -.endr -.word OP0_b10f -.rept 8 - .word OP0_b110 -.endr -.rept 7 - .word OP0_b118 -.endr -.word OP0_b11f -.rept 7 - .word OP0_b120 -.endr -.word OP0_b127 -.rept 8 - .word OP0_b128 -.endr -.rept 8 - .word OP0_b130 -.endr -.word OP0_b138 -.word OP0_b139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b140 -.endr -.rept 8 - .word OP0_b148 -.endr -.rept 8 - .word OP0_b150 -.endr -.rept 8 - .word OP0_b158 -.endr -.rept 8 - .word OP0_b160 -.endr -.rept 8 - .word OP0_b168 -.endr -.rept 8 - .word OP0_b170 -.endr -.word OP0_b178 -.word OP0_b179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b180 -.endr -.rept 8 - .word OP0_b188 -.endr -.rept 8 - .word OP0_b190 -.endr -.rept 8 - .word OP0_b198 -.endr -.rept 8 - .word OP0_b1a0 -.endr -.rept 8 - .word OP0_b1a8 -.endr -.rept 8 - .word OP0_b1b0 -.endr -.word OP0_b1b8 -.word OP0_b1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b1c0 -.endr -.rept 8 - .word OP0_b1d0 -.endr -.rept 8 - .word OP0_b1d8 -.endr -.rept 8 - .word OP0_b1e0 -.endr -.rept 8 - .word OP0_b1e8 -.endr -.rept 8 - .word OP0_b1f0 -.endr -.word OP0_b1f8 -.word OP0_b1f9 -.word OP0_b1fa -.word OP0_b1fb -.word OP0_b1fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b000 -.endr -.rept 8 - .word OP0_b010 -.endr -.rept 7 - .word OP0_b018 -.endr -.word OP0_b01f -.rept 7 - .word OP0_b020 -.endr -.word OP0_b027 -.rept 8 - .word OP0_b028 -.endr -.rept 8 - .word OP0_b030 -.endr -.word OP0_b038 -.word OP0_b039 -.word OP0_b03a -.word OP0_b03b -.word OP0_b03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b040 -.endr -.rept 8 - .word OP0_b050 -.endr -.rept 8 - .word OP0_b058 -.endr -.rept 8 - .word OP0_b060 -.endr -.rept 8 - .word OP0_b068 -.endr -.rept 8 - .word OP0_b070 -.endr -.word OP0_b078 -.word OP0_b079 -.word OP0_b07a -.word OP0_b07b -.word OP0_b07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b080 -.endr -.rept 8 - .word OP0_b090 -.endr -.rept 8 - .word OP0_b098 -.endr -.rept 8 - .word OP0_b0a0 -.endr -.rept 8 - .word OP0_b0a8 -.endr -.rept 8 - .word OP0_b0b0 -.endr -.word OP0_b0b8 -.word OP0_b0b9 -.word OP0_b0ba -.word OP0_b0bb -.word OP0_b0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b0c0 -.endr -.rept 8 - .word OP0_b0d0 -.endr -.rept 8 - .word OP0_b0d8 -.endr -.rept 8 - .word OP0_b0e0 -.endr -.rept 8 - .word OP0_b0e8 -.endr -.rept 8 - .word OP0_b0f0 -.endr -.word OP0_b0f8 -.word OP0_b0f9 -.word OP0_b0fa -.word OP0_b0fb -.word OP0_b0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b100 -.endr -.rept 7 - .word OP0_b108 -.endr -.word OP0_b10f -.rept 8 - .word OP0_b110 -.endr -.rept 7 - .word OP0_b118 -.endr -.word OP0_b11f -.rept 7 - .word OP0_b120 -.endr -.word OP0_b127 -.rept 8 - .word OP0_b128 -.endr -.rept 8 - .word OP0_b130 -.endr -.word OP0_b138 -.word OP0_b139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b140 -.endr -.rept 8 - .word OP0_b148 -.endr -.rept 8 - .word OP0_b150 -.endr -.rept 8 - .word OP0_b158 -.endr -.rept 8 - .word OP0_b160 -.endr -.rept 8 - .word OP0_b168 -.endr -.rept 8 - .word OP0_b170 -.endr -.word OP0_b178 -.word OP0_b179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b180 -.endr -.rept 8 - .word OP0_b188 -.endr -.rept 8 - .word OP0_b190 -.endr -.rept 8 - .word OP0_b198 -.endr -.rept 8 - .word OP0_b1a0 -.endr -.rept 8 - .word OP0_b1a8 -.endr -.rept 8 - .word OP0_b1b0 -.endr -.word OP0_b1b8 -.word OP0_b1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b1c0 -.endr -.rept 8 - .word OP0_b1d0 -.endr -.rept 8 - .word OP0_b1d8 -.endr -.rept 8 - .word OP0_b1e0 -.endr -.rept 8 - .word OP0_b1e8 -.endr -.rept 8 - .word OP0_b1f0 -.endr -.word OP0_b1f8 -.word OP0_b1f9 -.word OP0_b1fa -.word OP0_b1fb -.word OP0_b1fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b000 -.endr -.rept 8 - .word OP0_b010 -.endr -.rept 7 - .word OP0_b018 -.endr -.word OP0_b01f -.rept 7 - .word OP0_b020 -.endr -.word OP0_b027 -.rept 8 - .word OP0_b028 -.endr -.rept 8 - .word OP0_b030 -.endr -.word OP0_b038 -.word OP0_b039 -.word OP0_b03a -.word OP0_b03b -.word OP0_b03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b040 -.endr -.rept 8 - .word OP0_b050 -.endr -.rept 8 - .word OP0_b058 -.endr -.rept 8 - .word OP0_b060 -.endr -.rept 8 - .word OP0_b068 -.endr -.rept 8 - .word OP0_b070 -.endr -.word OP0_b078 -.word OP0_b079 -.word OP0_b07a -.word OP0_b07b -.word OP0_b07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b080 -.endr -.rept 8 - .word OP0_b090 -.endr -.rept 8 - .word OP0_b098 -.endr -.rept 8 - .word OP0_b0a0 -.endr -.rept 8 - .word OP0_b0a8 -.endr -.rept 8 - .word OP0_b0b0 -.endr -.word OP0_b0b8 -.word OP0_b0b9 -.word OP0_b0ba -.word OP0_b0bb -.word OP0_b0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b0c0 -.endr -.rept 8 - .word OP0_b0d0 -.endr -.rept 8 - .word OP0_b0d8 -.endr -.rept 8 - .word OP0_b0e0 -.endr -.rept 8 - .word OP0_b0e8 -.endr -.rept 8 - .word OP0_b0f0 -.endr -.word OP0_b0f8 -.word OP0_b0f9 -.word OP0_b0fa -.word OP0_b0fb -.word OP0_b0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b100 -.endr -.rept 7 - .word OP0_b108 -.endr -.word OP0_b10f -.rept 8 - .word OP0_b110 -.endr -.rept 7 - .word OP0_b118 -.endr -.word OP0_b11f -.rept 7 - .word OP0_b120 -.endr -.word OP0_b127 -.rept 8 - .word OP0_b128 -.endr -.rept 8 - .word OP0_b130 -.endr -.word OP0_b138 -.word OP0_b139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b140 -.endr -.rept 8 - .word OP0_b148 -.endr -.rept 8 - .word OP0_b150 -.endr -.rept 8 - .word OP0_b158 -.endr -.rept 8 - .word OP0_b160 -.endr -.rept 8 - .word OP0_b168 -.endr -.rept 8 - .word OP0_b170 -.endr -.word OP0_b178 -.word OP0_b179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b180 -.endr -.rept 8 - .word OP0_b188 -.endr -.rept 8 - .word OP0_b190 -.endr -.rept 8 - .word OP0_b198 -.endr -.rept 8 - .word OP0_b1a0 -.endr -.rept 8 - .word OP0_b1a8 -.endr -.rept 8 - .word OP0_b1b0 -.endr -.word OP0_b1b8 -.word OP0_b1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b1c0 -.endr -.rept 8 - .word OP0_b1d0 -.endr -.rept 8 - .word OP0_b1d8 -.endr -.rept 8 - .word OP0_b1e0 -.endr -.rept 8 - .word OP0_b1e8 -.endr -.rept 8 - .word OP0_b1f0 -.endr -.word OP0_b1f8 -.word OP0_b1f9 -.word OP0_b1fa -.word OP0_b1fb -.word OP0_b1fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b000 -.endr -.rept 8 - .word OP0_b010 -.endr -.rept 7 - .word OP0_b018 -.endr -.word OP0_b01f -.rept 7 - .word OP0_b020 -.endr -.word OP0_b027 -.rept 8 - .word OP0_b028 -.endr -.rept 8 - .word OP0_b030 -.endr -.word OP0_b038 -.word OP0_b039 -.word OP0_b03a -.word OP0_b03b -.word OP0_b03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b040 -.endr -.rept 8 - .word OP0_b050 -.endr -.rept 8 - .word OP0_b058 -.endr -.rept 8 - .word OP0_b060 -.endr -.rept 8 - .word OP0_b068 -.endr -.rept 8 - .word OP0_b070 -.endr -.word OP0_b078 -.word OP0_b079 -.word OP0_b07a -.word OP0_b07b -.word OP0_b07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b080 -.endr -.rept 8 - .word OP0_b090 -.endr -.rept 8 - .word OP0_b098 -.endr -.rept 8 - .word OP0_b0a0 -.endr -.rept 8 - .word OP0_b0a8 -.endr -.rept 8 - .word OP0_b0b0 -.endr -.word OP0_b0b8 -.word OP0_b0b9 -.word OP0_b0ba -.word OP0_b0bb -.word OP0_b0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b0c0 -.endr -.rept 8 - .word OP0_b0d0 -.endr -.rept 8 - .word OP0_b0d8 -.endr -.rept 8 - .word OP0_b0e0 -.endr -.rept 8 - .word OP0_b0e8 -.endr -.rept 8 - .word OP0_b0f0 -.endr -.word OP0_b0f8 -.word OP0_b0f9 -.word OP0_b0fa -.word OP0_b0fb -.word OP0_b0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b100 -.endr -.rept 7 - .word OP0_b108 -.endr -.word OP0_b10f -.rept 8 - .word OP0_b110 -.endr -.rept 7 - .word OP0_b118 -.endr -.word OP0_b11f -.rept 7 - .word OP0_b120 -.endr -.word OP0_b127 -.rept 8 - .word OP0_b128 -.endr -.rept 8 - .word OP0_b130 -.endr -.word OP0_b138 -.word OP0_b139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b140 -.endr -.rept 8 - .word OP0_b148 -.endr -.rept 8 - .word OP0_b150 -.endr -.rept 8 - .word OP0_b158 -.endr -.rept 8 - .word OP0_b160 -.endr -.rept 8 - .word OP0_b168 -.endr -.rept 8 - .word OP0_b170 -.endr -.word OP0_b178 -.word OP0_b179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b180 -.endr -.rept 8 - .word OP0_b188 -.endr -.rept 8 - .word OP0_b190 -.endr -.rept 8 - .word OP0_b198 -.endr -.rept 8 - .word OP0_b1a0 -.endr -.rept 8 - .word OP0_b1a8 -.endr -.rept 8 - .word OP0_b1b0 -.endr -.word OP0_b1b8 -.word OP0_b1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b1c0 -.endr -.rept 8 - .word OP0_b1d0 -.endr -.rept 8 - .word OP0_b1d8 -.endr -.rept 8 - .word OP0_b1e0 -.endr -.rept 8 - .word OP0_b1e8 -.endr -.rept 8 - .word OP0_b1f0 -.endr -.word OP0_b1f8 -.word OP0_b1f9 -.word OP0_b1fa -.word OP0_b1fb -.word OP0_b1fc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b000 -.endr -.rept 8 - .word OP0_b010 -.endr -.rept 7 - .word OP0_b018 -.endr -.word OP0_b01f -.rept 7 - .word OP0_b020 -.endr -.word OP0_b027 -.rept 8 - .word OP0_b028 -.endr -.rept 8 - .word OP0_b030 -.endr -.word OP0_b038 -.word OP0_b039 -.word OP0_b03a -.word OP0_b03b -.word OP0_b03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b040 -.endr -.rept 8 - .word OP0_b050 -.endr -.rept 8 - .word OP0_b058 -.endr -.rept 8 - .word OP0_b060 -.endr -.rept 8 - .word OP0_b068 -.endr -.rept 8 - .word OP0_b070 -.endr -.word OP0_b078 -.word OP0_b079 -.word OP0_b07a -.word OP0_b07b -.word OP0_b07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b080 -.endr -.rept 8 - .word OP0_b090 -.endr -.rept 8 - .word OP0_b098 -.endr -.rept 8 - .word OP0_b0a0 -.endr -.rept 8 - .word OP0_b0a8 -.endr -.rept 8 - .word OP0_b0b0 -.endr -.word OP0_b0b8 -.word OP0_b0b9 -.word OP0_b0ba -.word OP0_b0bb -.word OP0_b0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b0c0 -.endr -.rept 8 - .word OP0_b0d0 -.endr -.rept 8 - .word OP0_b0d8 -.endr -.rept 8 - .word OP0_b0e0 -.endr -.rept 8 - .word OP0_b0e8 -.endr -.rept 8 - .word OP0_b0f0 -.endr -.word OP0_b0f8 -.word OP0_b0f9 -.word OP0_b0fa -.word OP0_b0fb -.word OP0_b0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b100 -.endr -.rept 7 - .word OP0_bf08 -.endr -.word OP0_bf0f -.rept 8 - .word OP0_b110 -.endr -.rept 7 - .word OP0_b118 -.endr -.word OP0_b11f -.rept 7 - .word OP0_b120 -.endr -.word OP0_b127 -.rept 8 - .word OP0_b128 -.endr -.rept 8 - .word OP0_b130 -.endr -.word OP0_b138 -.word OP0_b139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b140 -.endr -.rept 8 - .word OP0_b148 -.endr -.rept 8 - .word OP0_b150 -.endr -.rept 8 - .word OP0_b158 -.endr -.rept 8 - .word OP0_b160 -.endr -.rept 8 - .word OP0_b168 -.endr -.rept 8 - .word OP0_b170 -.endr -.word OP0_b178 -.word OP0_b179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_b180 -.endr -.rept 8 - .word OP0_b188 -.endr -.rept 8 - .word OP0_b190 -.endr -.rept 8 - .word OP0_b198 -.endr -.rept 8 - .word OP0_b1a0 -.endr -.rept 8 - .word OP0_b1a8 -.endr -.rept 8 - .word OP0_b1b0 -.endr -.word OP0_b1b8 -.word OP0_b1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_b1c0 -.endr -.rept 8 - .word OP0_b1d0 -.endr -.rept 8 - .word OP0_b1d8 -.endr -.rept 8 - .word OP0_b1e0 -.endr -.rept 8 - .word OP0_b1e8 -.endr -.rept 8 - .word OP0_b1f0 -.endr -.word OP0_b1f8 -.word OP0_b1f9 -.word OP0_b1fa -.word OP0_b1fb -.word OP0_b1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c010 -.endr -.rept 7 - .word OP0_c018 -.endr -.word OP0_c01f -.rept 7 - .word OP0_c020 -.endr -.word OP0_c027 -.rept 8 - .word OP0_c028 -.endr -.rept 8 - .word OP0_c030 -.endr -.word OP0_c038 -.word OP0_c039 -.word OP0_c03a -.word OP0_c03b -.word OP0_c03c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c050 -.endr -.rept 8 - .word OP0_c058 -.endr -.rept 8 - .word OP0_c060 -.endr -.rept 8 - .word OP0_c068 -.endr -.rept 8 - .word OP0_c070 -.endr -.word OP0_c078 -.word OP0_c079 -.word OP0_c07a -.word OP0_c07b -.word OP0_c07c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c090 -.endr -.rept 8 - .word OP0_c098 -.endr -.rept 8 - .word OP0_c0a0 -.endr -.rept 8 - .word OP0_c0a8 -.endr -.rept 8 - .word OP0_c0b0 -.endr -.word OP0_c0b8 -.word OP0_c0b9 -.word OP0_c0ba -.word OP0_c0bb -.word OP0_c0bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0d0 -.endr -.rept 8 - .word OP0_c0d8 -.endr -.rept 8 - .word OP0_c0e0 -.endr -.rept 8 - .word OP0_c0e8 -.endr -.rept 8 - .word OP0_c0f0 -.endr -.word OP0_c0f8 -.word OP0_c0f9 -.word OP0_c0fa -.word OP0_c0fb -.word OP0_c0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c100 -.endr -.rept 7 - .word OP0_c108 -.endr -.word OP0_c10f -.rept 8 - .word OP0_c110 -.endr -.rept 7 - .word OP0_c118 -.endr -.word OP0_c11f -.rept 7 - .word OP0_c120 -.endr -.word OP0_c127 -.rept 8 - .word OP0_c128 -.endr -.rept 8 - .word OP0_c130 -.endr -.word OP0_c138 -.word OP0_c139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c140 -.endr -.rept 8 - .word OP0_c148 -.endr -.rept 8 - .word OP0_c150 -.endr -.rept 8 - .word OP0_c158 -.endr -.rept 8 - .word OP0_c160 -.endr -.rept 8 - .word OP0_c168 -.endr -.rept 8 - .word OP0_c170 -.endr -.word OP0_c178 -.word OP0_c179 -.rept 14 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c188 -.endr -.rept 8 - .word OP0_c190 -.endr -.rept 8 - .word OP0_c198 -.endr -.rept 8 - .word OP0_c1a0 -.endr -.rept 8 - .word OP0_c1a8 -.endr -.rept 8 - .word OP0_c1b0 -.endr -.word OP0_c1b8 -.word OP0_c1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1d0 -.endr -.rept 8 - .word OP0_c1d8 -.endr -.rept 8 - .word OP0_c1e0 -.endr -.rept 8 - .word OP0_c1e8 -.endr -.rept 8 - .word OP0_c1f0 -.endr -.word OP0_c1f8 -.word OP0_c1f9 -.word OP0_c1fa -.word OP0_c1fb -.word OP0_c1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c010 -.endr -.rept 7 - .word OP0_c018 -.endr -.word OP0_c01f -.rept 7 - .word OP0_c020 -.endr -.word OP0_c027 -.rept 8 - .word OP0_c028 -.endr -.rept 8 - .word OP0_c030 -.endr -.word OP0_c038 -.word OP0_c039 -.word OP0_c03a -.word OP0_c03b -.word OP0_c03c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c050 -.endr -.rept 8 - .word OP0_c058 -.endr -.rept 8 - .word OP0_c060 -.endr -.rept 8 - .word OP0_c068 -.endr -.rept 8 - .word OP0_c070 -.endr -.word OP0_c078 -.word OP0_c079 -.word OP0_c07a -.word OP0_c07b -.word OP0_c07c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c090 -.endr -.rept 8 - .word OP0_c098 -.endr -.rept 8 - .word OP0_c0a0 -.endr -.rept 8 - .word OP0_c0a8 -.endr -.rept 8 - .word OP0_c0b0 -.endr -.word OP0_c0b8 -.word OP0_c0b9 -.word OP0_c0ba -.word OP0_c0bb -.word OP0_c0bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0d0 -.endr -.rept 8 - .word OP0_c0d8 -.endr -.rept 8 - .word OP0_c0e0 -.endr -.rept 8 - .word OP0_c0e8 -.endr -.rept 8 - .word OP0_c0f0 -.endr -.word OP0_c0f8 -.word OP0_c0f9 -.word OP0_c0fa -.word OP0_c0fb -.word OP0_c0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c100 -.endr -.rept 7 - .word OP0_c108 -.endr -.word OP0_c10f -.rept 8 - .word OP0_c110 -.endr -.rept 7 - .word OP0_c118 -.endr -.word OP0_c11f -.rept 7 - .word OP0_c120 -.endr -.word OP0_c127 -.rept 8 - .word OP0_c128 -.endr -.rept 8 - .word OP0_c130 -.endr -.word OP0_c138 -.word OP0_c139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c140 -.endr -.rept 8 - .word OP0_c148 -.endr -.rept 8 - .word OP0_c150 -.endr -.rept 8 - .word OP0_c158 -.endr -.rept 8 - .word OP0_c160 -.endr -.rept 8 - .word OP0_c168 -.endr -.rept 8 - .word OP0_c170 -.endr -.word OP0_c178 -.word OP0_c179 -.rept 14 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c188 -.endr -.rept 8 - .word OP0_c190 -.endr -.rept 8 - .word OP0_c198 -.endr -.rept 8 - .word OP0_c1a0 -.endr -.rept 8 - .word OP0_c1a8 -.endr -.rept 8 - .word OP0_c1b0 -.endr -.word OP0_c1b8 -.word OP0_c1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1d0 -.endr -.rept 8 - .word OP0_c1d8 -.endr -.rept 8 - .word OP0_c1e0 -.endr -.rept 8 - .word OP0_c1e8 -.endr -.rept 8 - .word OP0_c1f0 -.endr -.word OP0_c1f8 -.word OP0_c1f9 -.word OP0_c1fa -.word OP0_c1fb -.word OP0_c1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c010 -.endr -.rept 7 - .word OP0_c018 -.endr -.word OP0_c01f -.rept 7 - .word OP0_c020 -.endr -.word OP0_c027 -.rept 8 - .word OP0_c028 -.endr -.rept 8 - .word OP0_c030 -.endr -.word OP0_c038 -.word OP0_c039 -.word OP0_c03a -.word OP0_c03b -.word OP0_c03c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c050 -.endr -.rept 8 - .word OP0_c058 -.endr -.rept 8 - .word OP0_c060 -.endr -.rept 8 - .word OP0_c068 -.endr -.rept 8 - .word OP0_c070 -.endr -.word OP0_c078 -.word OP0_c079 -.word OP0_c07a -.word OP0_c07b -.word OP0_c07c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c090 -.endr -.rept 8 - .word OP0_c098 -.endr -.rept 8 - .word OP0_c0a0 -.endr -.rept 8 - .word OP0_c0a8 -.endr -.rept 8 - .word OP0_c0b0 -.endr -.word OP0_c0b8 -.word OP0_c0b9 -.word OP0_c0ba -.word OP0_c0bb -.word OP0_c0bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0d0 -.endr -.rept 8 - .word OP0_c0d8 -.endr -.rept 8 - .word OP0_c0e0 -.endr -.rept 8 - .word OP0_c0e8 -.endr -.rept 8 - .word OP0_c0f0 -.endr -.word OP0_c0f8 -.word OP0_c0f9 -.word OP0_c0fa -.word OP0_c0fb -.word OP0_c0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c100 -.endr -.rept 7 - .word OP0_c108 -.endr -.word OP0_c10f -.rept 8 - .word OP0_c110 -.endr -.rept 7 - .word OP0_c118 -.endr -.word OP0_c11f -.rept 7 - .word OP0_c120 -.endr -.word OP0_c127 -.rept 8 - .word OP0_c128 -.endr -.rept 8 - .word OP0_c130 -.endr -.word OP0_c138 -.word OP0_c139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c140 -.endr -.rept 8 - .word OP0_c148 -.endr -.rept 8 - .word OP0_c150 -.endr -.rept 8 - .word OP0_c158 -.endr -.rept 8 - .word OP0_c160 -.endr -.rept 8 - .word OP0_c168 -.endr -.rept 8 - .word OP0_c170 -.endr -.word OP0_c178 -.word OP0_c179 -.rept 14 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c188 -.endr -.rept 8 - .word OP0_c190 -.endr -.rept 8 - .word OP0_c198 -.endr -.rept 8 - .word OP0_c1a0 -.endr -.rept 8 - .word OP0_c1a8 -.endr -.rept 8 - .word OP0_c1b0 -.endr -.word OP0_c1b8 -.word OP0_c1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1d0 -.endr -.rept 8 - .word OP0_c1d8 -.endr -.rept 8 - .word OP0_c1e0 -.endr -.rept 8 - .word OP0_c1e8 -.endr -.rept 8 - .word OP0_c1f0 -.endr -.word OP0_c1f8 -.word OP0_c1f9 -.word OP0_c1fa -.word OP0_c1fb -.word OP0_c1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c010 -.endr -.rept 7 - .word OP0_c018 -.endr -.word OP0_c01f -.rept 7 - .word OP0_c020 -.endr -.word OP0_c027 -.rept 8 - .word OP0_c028 -.endr -.rept 8 - .word OP0_c030 -.endr -.word OP0_c038 -.word OP0_c039 -.word OP0_c03a -.word OP0_c03b -.word OP0_c03c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c050 -.endr -.rept 8 - .word OP0_c058 -.endr -.rept 8 - .word OP0_c060 -.endr -.rept 8 - .word OP0_c068 -.endr -.rept 8 - .word OP0_c070 -.endr -.word OP0_c078 -.word OP0_c079 -.word OP0_c07a -.word OP0_c07b -.word OP0_c07c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c090 -.endr -.rept 8 - .word OP0_c098 -.endr -.rept 8 - .word OP0_c0a0 -.endr -.rept 8 - .word OP0_c0a8 -.endr -.rept 8 - .word OP0_c0b0 -.endr -.word OP0_c0b8 -.word OP0_c0b9 -.word OP0_c0ba -.word OP0_c0bb -.word OP0_c0bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0d0 -.endr -.rept 8 - .word OP0_c0d8 -.endr -.rept 8 - .word OP0_c0e0 -.endr -.rept 8 - .word OP0_c0e8 -.endr -.rept 8 - .word OP0_c0f0 -.endr -.word OP0_c0f8 -.word OP0_c0f9 -.word OP0_c0fa -.word OP0_c0fb -.word OP0_c0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c100 -.endr -.rept 7 - .word OP0_c108 -.endr -.word OP0_c10f -.rept 8 - .word OP0_c110 -.endr -.rept 7 - .word OP0_c118 -.endr -.word OP0_c11f -.rept 7 - .word OP0_c120 -.endr -.word OP0_c127 -.rept 8 - .word OP0_c128 -.endr -.rept 8 - .word OP0_c130 -.endr -.word OP0_c138 -.word OP0_c139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c140 -.endr -.rept 8 - .word OP0_c148 -.endr -.rept 8 - .word OP0_c150 -.endr -.rept 8 - .word OP0_c158 -.endr -.rept 8 - .word OP0_c160 -.endr -.rept 8 - .word OP0_c168 -.endr -.rept 8 - .word OP0_c170 -.endr -.word OP0_c178 -.word OP0_c179 -.rept 14 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c188 -.endr -.rept 8 - .word OP0_c190 -.endr -.rept 8 - .word OP0_c198 -.endr -.rept 8 - .word OP0_c1a0 -.endr -.rept 8 - .word OP0_c1a8 -.endr -.rept 8 - .word OP0_c1b0 -.endr -.word OP0_c1b8 -.word OP0_c1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1d0 -.endr -.rept 8 - .word OP0_c1d8 -.endr -.rept 8 - .word OP0_c1e0 -.endr -.rept 8 - .word OP0_c1e8 -.endr -.rept 8 - .word OP0_c1f0 -.endr -.word OP0_c1f8 -.word OP0_c1f9 -.word OP0_c1fa -.word OP0_c1fb -.word OP0_c1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c010 -.endr -.rept 7 - .word OP0_c018 -.endr -.word OP0_c01f -.rept 7 - .word OP0_c020 -.endr -.word OP0_c027 -.rept 8 - .word OP0_c028 -.endr -.rept 8 - .word OP0_c030 -.endr -.word OP0_c038 -.word OP0_c039 -.word OP0_c03a -.word OP0_c03b -.word OP0_c03c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c050 -.endr -.rept 8 - .word OP0_c058 -.endr -.rept 8 - .word OP0_c060 -.endr -.rept 8 - .word OP0_c068 -.endr -.rept 8 - .word OP0_c070 -.endr -.word OP0_c078 -.word OP0_c079 -.word OP0_c07a -.word OP0_c07b -.word OP0_c07c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c090 -.endr -.rept 8 - .word OP0_c098 -.endr -.rept 8 - .word OP0_c0a0 -.endr -.rept 8 - .word OP0_c0a8 -.endr -.rept 8 - .word OP0_c0b0 -.endr -.word OP0_c0b8 -.word OP0_c0b9 -.word OP0_c0ba -.word OP0_c0bb -.word OP0_c0bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0d0 -.endr -.rept 8 - .word OP0_c0d8 -.endr -.rept 8 - .word OP0_c0e0 -.endr -.rept 8 - .word OP0_c0e8 -.endr -.rept 8 - .word OP0_c0f0 -.endr -.word OP0_c0f8 -.word OP0_c0f9 -.word OP0_c0fa -.word OP0_c0fb -.word OP0_c0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c100 -.endr -.rept 7 - .word OP0_c108 -.endr -.word OP0_c10f -.rept 8 - .word OP0_c110 -.endr -.rept 7 - .word OP0_c118 -.endr -.word OP0_c11f -.rept 7 - .word OP0_c120 -.endr -.word OP0_c127 -.rept 8 - .word OP0_c128 -.endr -.rept 8 - .word OP0_c130 -.endr -.word OP0_c138 -.word OP0_c139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c140 -.endr -.rept 8 - .word OP0_c148 -.endr -.rept 8 - .word OP0_c150 -.endr -.rept 8 - .word OP0_c158 -.endr -.rept 8 - .word OP0_c160 -.endr -.rept 8 - .word OP0_c168 -.endr -.rept 8 - .word OP0_c170 -.endr -.word OP0_c178 -.word OP0_c179 -.rept 14 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c188 -.endr -.rept 8 - .word OP0_c190 -.endr -.rept 8 - .word OP0_c198 -.endr -.rept 8 - .word OP0_c1a0 -.endr -.rept 8 - .word OP0_c1a8 -.endr -.rept 8 - .word OP0_c1b0 -.endr -.word OP0_c1b8 -.word OP0_c1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1d0 -.endr -.rept 8 - .word OP0_c1d8 -.endr -.rept 8 - .word OP0_c1e0 -.endr -.rept 8 - .word OP0_c1e8 -.endr -.rept 8 - .word OP0_c1f0 -.endr -.word OP0_c1f8 -.word OP0_c1f9 -.word OP0_c1fa -.word OP0_c1fb -.word OP0_c1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c010 -.endr -.rept 7 - .word OP0_c018 -.endr -.word OP0_c01f -.rept 7 - .word OP0_c020 -.endr -.word OP0_c027 -.rept 8 - .word OP0_c028 -.endr -.rept 8 - .word OP0_c030 -.endr -.word OP0_c038 -.word OP0_c039 -.word OP0_c03a -.word OP0_c03b -.word OP0_c03c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c050 -.endr -.rept 8 - .word OP0_c058 -.endr -.rept 8 - .word OP0_c060 -.endr -.rept 8 - .word OP0_c068 -.endr -.rept 8 - .word OP0_c070 -.endr -.word OP0_c078 -.word OP0_c079 -.word OP0_c07a -.word OP0_c07b -.word OP0_c07c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c090 -.endr -.rept 8 - .word OP0_c098 -.endr -.rept 8 - .word OP0_c0a0 -.endr -.rept 8 - .word OP0_c0a8 -.endr -.rept 8 - .word OP0_c0b0 -.endr -.word OP0_c0b8 -.word OP0_c0b9 -.word OP0_c0ba -.word OP0_c0bb -.word OP0_c0bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0d0 -.endr -.rept 8 - .word OP0_c0d8 -.endr -.rept 8 - .word OP0_c0e0 -.endr -.rept 8 - .word OP0_c0e8 -.endr -.rept 8 - .word OP0_c0f0 -.endr -.word OP0_c0f8 -.word OP0_c0f9 -.word OP0_c0fa -.word OP0_c0fb -.word OP0_c0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c100 -.endr -.rept 7 - .word OP0_c108 -.endr -.word OP0_c10f -.rept 8 - .word OP0_c110 -.endr -.rept 7 - .word OP0_c118 -.endr -.word OP0_c11f -.rept 7 - .word OP0_c120 -.endr -.word OP0_c127 -.rept 8 - .word OP0_c128 -.endr -.rept 8 - .word OP0_c130 -.endr -.word OP0_c138 -.word OP0_c139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c140 -.endr -.rept 8 - .word OP0_c148 -.endr -.rept 8 - .word OP0_c150 -.endr -.rept 8 - .word OP0_c158 -.endr -.rept 8 - .word OP0_c160 -.endr -.rept 8 - .word OP0_c168 -.endr -.rept 8 - .word OP0_c170 -.endr -.word OP0_c178 -.word OP0_c179 -.rept 14 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c188 -.endr -.rept 8 - .word OP0_c190 -.endr -.rept 8 - .word OP0_c198 -.endr -.rept 8 - .word OP0_c1a0 -.endr -.rept 8 - .word OP0_c1a8 -.endr -.rept 8 - .word OP0_c1b0 -.endr -.word OP0_c1b8 -.word OP0_c1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1d0 -.endr -.rept 8 - .word OP0_c1d8 -.endr -.rept 8 - .word OP0_c1e0 -.endr -.rept 8 - .word OP0_c1e8 -.endr -.rept 8 - .word OP0_c1f0 -.endr -.word OP0_c1f8 -.word OP0_c1f9 -.word OP0_c1fa -.word OP0_c1fb -.word OP0_c1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c010 -.endr -.rept 7 - .word OP0_c018 -.endr -.word OP0_c01f -.rept 7 - .word OP0_c020 -.endr -.word OP0_c027 -.rept 8 - .word OP0_c028 -.endr -.rept 8 - .word OP0_c030 -.endr -.word OP0_c038 -.word OP0_c039 -.word OP0_c03a -.word OP0_c03b -.word OP0_c03c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c050 -.endr -.rept 8 - .word OP0_c058 -.endr -.rept 8 - .word OP0_c060 -.endr -.rept 8 - .word OP0_c068 -.endr -.rept 8 - .word OP0_c070 -.endr -.word OP0_c078 -.word OP0_c079 -.word OP0_c07a -.word OP0_c07b -.word OP0_c07c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c090 -.endr -.rept 8 - .word OP0_c098 -.endr -.rept 8 - .word OP0_c0a0 -.endr -.rept 8 - .word OP0_c0a8 -.endr -.rept 8 - .word OP0_c0b0 -.endr -.word OP0_c0b8 -.word OP0_c0b9 -.word OP0_c0ba -.word OP0_c0bb -.word OP0_c0bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0d0 -.endr -.rept 8 - .word OP0_c0d8 -.endr -.rept 8 - .word OP0_c0e0 -.endr -.rept 8 - .word OP0_c0e8 -.endr -.rept 8 - .word OP0_c0f0 -.endr -.word OP0_c0f8 -.word OP0_c0f9 -.word OP0_c0fa -.word OP0_c0fb -.word OP0_c0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c100 -.endr -.rept 7 - .word OP0_c108 -.endr -.word OP0_c10f -.rept 8 - .word OP0_c110 -.endr -.rept 7 - .word OP0_c118 -.endr -.word OP0_c11f -.rept 7 - .word OP0_c120 -.endr -.word OP0_c127 -.rept 8 - .word OP0_c128 -.endr -.rept 8 - .word OP0_c130 -.endr -.word OP0_c138 -.word OP0_c139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c140 -.endr -.rept 8 - .word OP0_c148 -.endr -.rept 8 - .word OP0_c150 -.endr -.rept 8 - .word OP0_c158 -.endr -.rept 8 - .word OP0_c160 -.endr -.rept 8 - .word OP0_c168 -.endr -.rept 8 - .word OP0_c170 -.endr -.word OP0_c178 -.word OP0_c179 -.rept 14 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c188 -.endr -.rept 8 - .word OP0_c190 -.endr -.rept 8 - .word OP0_c198 -.endr -.rept 8 - .word OP0_c1a0 -.endr -.rept 8 - .word OP0_c1a8 -.endr -.rept 8 - .word OP0_c1b0 -.endr -.word OP0_c1b8 -.word OP0_c1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1d0 -.endr -.rept 8 - .word OP0_c1d8 -.endr -.rept 8 - .word OP0_c1e0 -.endr -.rept 8 - .word OP0_c1e8 -.endr -.rept 8 - .word OP0_c1f0 -.endr -.word OP0_c1f8 -.word OP0_c1f9 -.word OP0_c1fa -.word OP0_c1fb -.word OP0_c1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c010 -.endr -.rept 7 - .word OP0_c018 -.endr -.word OP0_c01f -.rept 7 - .word OP0_c020 -.endr -.word OP0_c027 -.rept 8 - .word OP0_c028 -.endr -.rept 8 - .word OP0_c030 -.endr -.word OP0_c038 -.word OP0_c039 -.word OP0_c03a -.word OP0_c03b -.word OP0_c03c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c040 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c050 -.endr -.rept 8 - .word OP0_c058 -.endr -.rept 8 - .word OP0_c060 -.endr -.rept 8 - .word OP0_c068 -.endr -.rept 8 - .word OP0_c070 -.endr -.word OP0_c078 -.word OP0_c079 -.word OP0_c07a -.word OP0_c07b -.word OP0_c07c -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c080 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c090 -.endr -.rept 8 - .word OP0_c098 -.endr -.rept 8 - .word OP0_c0a0 -.endr -.rept 8 - .word OP0_c0a8 -.endr -.rept 8 - .word OP0_c0b0 -.endr -.word OP0_c0b8 -.word OP0_c0b9 -.word OP0_c0ba -.word OP0_c0bb -.word OP0_c0bc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c0d0 -.endr -.rept 8 - .word OP0_c0d8 -.endr -.rept 8 - .word OP0_c0e0 -.endr -.rept 8 - .word OP0_c0e8 -.endr -.rept 8 - .word OP0_c0f0 -.endr -.word OP0_c0f8 -.word OP0_c0f9 -.word OP0_c0fa -.word OP0_c0fb -.word OP0_c0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c100 -.endr -.rept 7 - .word OP0_cf08 -.endr -.word OP0_cf0f -.rept 8 - .word OP0_c110 -.endr -.rept 7 - .word OP0_c118 -.endr -.word OP0_c11f -.rept 7 - .word OP0_c120 -.endr -.word OP0_c127 -.rept 8 - .word OP0_c128 -.endr -.rept 8 - .word OP0_c130 -.endr -.word OP0_c138 -.word OP0_c139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c140 -.endr -.rept 8 - .word OP0_c148 -.endr -.rept 8 - .word OP0_c150 -.endr -.rept 8 - .word OP0_c158 -.endr -.rept 8 - .word OP0_c160 -.endr -.rept 8 - .word OP0_c168 -.endr -.rept 8 - .word OP0_c170 -.endr -.word OP0_c178 -.word OP0_c179 -.rept 14 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c188 -.endr -.rept 8 - .word OP0_c190 -.endr -.rept 8 - .word OP0_c198 -.endr -.rept 8 - .word OP0_c1a0 -.endr -.rept 8 - .word OP0_c1a8 -.endr -.rept 8 - .word OP0_c1b0 -.endr -.word OP0_c1b8 -.word OP0_c1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1c0 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_c1d0 -.endr -.rept 8 - .word OP0_c1d8 -.endr -.rept 8 - .word OP0_c1e0 -.endr -.rept 8 - .word OP0_c1e8 -.endr -.rept 8 - .word OP0_c1f0 -.endr -.word OP0_c1f8 -.word OP0_c1f9 -.word OP0_c1fa -.word OP0_c1fb -.word OP0_c1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d010 -.endr -.rept 7 - .word OP0_d018 -.endr -.word OP0_d01f -.rept 7 - .word OP0_d020 -.endr -.word OP0_d027 -.rept 8 - .word OP0_d028 -.endr -.rept 8 - .word OP0_d030 -.endr -.word OP0_d038 -.word OP0_d039 -.word OP0_d03a -.word OP0_d03b -.word OP0_d03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d040 -.endr -.rept 8 - .word OP0_d050 -.endr -.rept 8 - .word OP0_d058 -.endr -.rept 8 - .word OP0_d060 -.endr -.rept 8 - .word OP0_d068 -.endr -.rept 8 - .word OP0_d070 -.endr -.word OP0_d078 -.word OP0_d079 -.word OP0_d07a -.word OP0_d07b -.word OP0_d07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d080 -.endr -.rept 8 - .word OP0_d090 -.endr -.rept 8 - .word OP0_d098 -.endr -.rept 8 - .word OP0_d0a0 -.endr -.rept 8 - .word OP0_d0a8 -.endr -.rept 8 - .word OP0_d0b0 -.endr -.word OP0_d0b8 -.word OP0_d0b9 -.word OP0_d0ba -.word OP0_d0bb -.word OP0_d0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d0c0 -.endr -.rept 8 - .word OP0_d0d0 -.endr -.rept 8 - .word OP0_d0d8 -.endr -.rept 8 - .word OP0_d0e0 -.endr -.rept 8 - .word OP0_d0e8 -.endr -.rept 8 - .word OP0_d0f0 -.endr -.word OP0_d0f8 -.word OP0_d0f9 -.word OP0_d0fa -.word OP0_d0fb -.word OP0_d0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d100 -.endr -.rept 7 - .word OP0_d108 -.endr -.word OP0_d10f -.rept 8 - .word OP0_d110 -.endr -.rept 7 - .word OP0_d118 -.endr -.word OP0_d11f -.rept 7 - .word OP0_d120 -.endr -.word OP0_d127 -.rept 8 - .word OP0_d128 -.endr -.rept 8 - .word OP0_d130 -.endr -.word OP0_d138 -.word OP0_d139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d140 -.endr -.rept 8 - .word OP0_d148 -.endr -.rept 8 - .word OP0_d150 -.endr -.rept 8 - .word OP0_d158 -.endr -.rept 8 - .word OP0_d160 -.endr -.rept 8 - .word OP0_d168 -.endr -.rept 8 - .word OP0_d170 -.endr -.word OP0_d178 -.word OP0_d179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d180 -.endr -.rept 8 - .word OP0_d188 -.endr -.rept 8 - .word OP0_d190 -.endr -.rept 8 - .word OP0_d198 -.endr -.rept 8 - .word OP0_d1a0 -.endr -.rept 8 - .word OP0_d1a8 -.endr -.rept 8 - .word OP0_d1b0 -.endr -.word OP0_d1b8 -.word OP0_d1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d1c0 -.endr -.rept 8 - .word OP0_d1d0 -.endr -.rept 8 - .word OP0_d1d8 -.endr -.rept 8 - .word OP0_d1e0 -.endr -.rept 8 - .word OP0_d1e8 -.endr -.rept 8 - .word OP0_d1f0 -.endr -.word OP0_d1f8 -.word OP0_d1f9 -.word OP0_d1fa -.word OP0_d1fb -.word OP0_d1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d010 -.endr -.rept 7 - .word OP0_d018 -.endr -.word OP0_d01f -.rept 7 - .word OP0_d020 -.endr -.word OP0_d027 -.rept 8 - .word OP0_d028 -.endr -.rept 8 - .word OP0_d030 -.endr -.word OP0_d038 -.word OP0_d039 -.word OP0_d03a -.word OP0_d03b -.word OP0_d03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d040 -.endr -.rept 8 - .word OP0_d050 -.endr -.rept 8 - .word OP0_d058 -.endr -.rept 8 - .word OP0_d060 -.endr -.rept 8 - .word OP0_d068 -.endr -.rept 8 - .word OP0_d070 -.endr -.word OP0_d078 -.word OP0_d079 -.word OP0_d07a -.word OP0_d07b -.word OP0_d07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d080 -.endr -.rept 8 - .word OP0_d090 -.endr -.rept 8 - .word OP0_d098 -.endr -.rept 8 - .word OP0_d0a0 -.endr -.rept 8 - .word OP0_d0a8 -.endr -.rept 8 - .word OP0_d0b0 -.endr -.word OP0_d0b8 -.word OP0_d0b9 -.word OP0_d0ba -.word OP0_d0bb -.word OP0_d0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d0c0 -.endr -.rept 8 - .word OP0_d0d0 -.endr -.rept 8 - .word OP0_d0d8 -.endr -.rept 8 - .word OP0_d0e0 -.endr -.rept 8 - .word OP0_d0e8 -.endr -.rept 8 - .word OP0_d0f0 -.endr -.word OP0_d0f8 -.word OP0_d0f9 -.word OP0_d0fa -.word OP0_d0fb -.word OP0_d0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d100 -.endr -.rept 7 - .word OP0_d108 -.endr -.word OP0_d10f -.rept 8 - .word OP0_d110 -.endr -.rept 7 - .word OP0_d118 -.endr -.word OP0_d11f -.rept 7 - .word OP0_d120 -.endr -.word OP0_d127 -.rept 8 - .word OP0_d128 -.endr -.rept 8 - .word OP0_d130 -.endr -.word OP0_d138 -.word OP0_d139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d140 -.endr -.rept 8 - .word OP0_d148 -.endr -.rept 8 - .word OP0_d150 -.endr -.rept 8 - .word OP0_d158 -.endr -.rept 8 - .word OP0_d160 -.endr -.rept 8 - .word OP0_d168 -.endr -.rept 8 - .word OP0_d170 -.endr -.word OP0_d178 -.word OP0_d179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d180 -.endr -.rept 8 - .word OP0_d188 -.endr -.rept 8 - .word OP0_d190 -.endr -.rept 8 - .word OP0_d198 -.endr -.rept 8 - .word OP0_d1a0 -.endr -.rept 8 - .word OP0_d1a8 -.endr -.rept 8 - .word OP0_d1b0 -.endr -.word OP0_d1b8 -.word OP0_d1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d1c0 -.endr -.rept 8 - .word OP0_d1d0 -.endr -.rept 8 - .word OP0_d1d8 -.endr -.rept 8 - .word OP0_d1e0 -.endr -.rept 8 - .word OP0_d1e8 -.endr -.rept 8 - .word OP0_d1f0 -.endr -.word OP0_d1f8 -.word OP0_d1f9 -.word OP0_d1fa -.word OP0_d1fb -.word OP0_d1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d010 -.endr -.rept 7 - .word OP0_d018 -.endr -.word OP0_d01f -.rept 7 - .word OP0_d020 -.endr -.word OP0_d027 -.rept 8 - .word OP0_d028 -.endr -.rept 8 - .word OP0_d030 -.endr -.word OP0_d038 -.word OP0_d039 -.word OP0_d03a -.word OP0_d03b -.word OP0_d03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d040 -.endr -.rept 8 - .word OP0_d050 -.endr -.rept 8 - .word OP0_d058 -.endr -.rept 8 - .word OP0_d060 -.endr -.rept 8 - .word OP0_d068 -.endr -.rept 8 - .word OP0_d070 -.endr -.word OP0_d078 -.word OP0_d079 -.word OP0_d07a -.word OP0_d07b -.word OP0_d07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d080 -.endr -.rept 8 - .word OP0_d090 -.endr -.rept 8 - .word OP0_d098 -.endr -.rept 8 - .word OP0_d0a0 -.endr -.rept 8 - .word OP0_d0a8 -.endr -.rept 8 - .word OP0_d0b0 -.endr -.word OP0_d0b8 -.word OP0_d0b9 -.word OP0_d0ba -.word OP0_d0bb -.word OP0_d0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d0c0 -.endr -.rept 8 - .word OP0_d0d0 -.endr -.rept 8 - .word OP0_d0d8 -.endr -.rept 8 - .word OP0_d0e0 -.endr -.rept 8 - .word OP0_d0e8 -.endr -.rept 8 - .word OP0_d0f0 -.endr -.word OP0_d0f8 -.word OP0_d0f9 -.word OP0_d0fa -.word OP0_d0fb -.word OP0_d0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d100 -.endr -.rept 7 - .word OP0_d108 -.endr -.word OP0_d10f -.rept 8 - .word OP0_d110 -.endr -.rept 7 - .word OP0_d118 -.endr -.word OP0_d11f -.rept 7 - .word OP0_d120 -.endr -.word OP0_d127 -.rept 8 - .word OP0_d128 -.endr -.rept 8 - .word OP0_d130 -.endr -.word OP0_d138 -.word OP0_d139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d140 -.endr -.rept 8 - .word OP0_d148 -.endr -.rept 8 - .word OP0_d150 -.endr -.rept 8 - .word OP0_d158 -.endr -.rept 8 - .word OP0_d160 -.endr -.rept 8 - .word OP0_d168 -.endr -.rept 8 - .word OP0_d170 -.endr -.word OP0_d178 -.word OP0_d179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d180 -.endr -.rept 8 - .word OP0_d188 -.endr -.rept 8 - .word OP0_d190 -.endr -.rept 8 - .word OP0_d198 -.endr -.rept 8 - .word OP0_d1a0 -.endr -.rept 8 - .word OP0_d1a8 -.endr -.rept 8 - .word OP0_d1b0 -.endr -.word OP0_d1b8 -.word OP0_d1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d1c0 -.endr -.rept 8 - .word OP0_d1d0 -.endr -.rept 8 - .word OP0_d1d8 -.endr -.rept 8 - .word OP0_d1e0 -.endr -.rept 8 - .word OP0_d1e8 -.endr -.rept 8 - .word OP0_d1f0 -.endr -.word OP0_d1f8 -.word OP0_d1f9 -.word OP0_d1fa -.word OP0_d1fb -.word OP0_d1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d010 -.endr -.rept 7 - .word OP0_d018 -.endr -.word OP0_d01f -.rept 7 - .word OP0_d020 -.endr -.word OP0_d027 -.rept 8 - .word OP0_d028 -.endr -.rept 8 - .word OP0_d030 -.endr -.word OP0_d038 -.word OP0_d039 -.word OP0_d03a -.word OP0_d03b -.word OP0_d03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d040 -.endr -.rept 8 - .word OP0_d050 -.endr -.rept 8 - .word OP0_d058 -.endr -.rept 8 - .word OP0_d060 -.endr -.rept 8 - .word OP0_d068 -.endr -.rept 8 - .word OP0_d070 -.endr -.word OP0_d078 -.word OP0_d079 -.word OP0_d07a -.word OP0_d07b -.word OP0_d07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d080 -.endr -.rept 8 - .word OP0_d090 -.endr -.rept 8 - .word OP0_d098 -.endr -.rept 8 - .word OP0_d0a0 -.endr -.rept 8 - .word OP0_d0a8 -.endr -.rept 8 - .word OP0_d0b0 -.endr -.word OP0_d0b8 -.word OP0_d0b9 -.word OP0_d0ba -.word OP0_d0bb -.word OP0_d0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d0c0 -.endr -.rept 8 - .word OP0_d0d0 -.endr -.rept 8 - .word OP0_d0d8 -.endr -.rept 8 - .word OP0_d0e0 -.endr -.rept 8 - .word OP0_d0e8 -.endr -.rept 8 - .word OP0_d0f0 -.endr -.word OP0_d0f8 -.word OP0_d0f9 -.word OP0_d0fa -.word OP0_d0fb -.word OP0_d0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d100 -.endr -.rept 7 - .word OP0_d108 -.endr -.word OP0_d10f -.rept 8 - .word OP0_d110 -.endr -.rept 7 - .word OP0_d118 -.endr -.word OP0_d11f -.rept 7 - .word OP0_d120 -.endr -.word OP0_d127 -.rept 8 - .word OP0_d128 -.endr -.rept 8 - .word OP0_d130 -.endr -.word OP0_d138 -.word OP0_d139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d140 -.endr -.rept 8 - .word OP0_d148 -.endr -.rept 8 - .word OP0_d150 -.endr -.rept 8 - .word OP0_d158 -.endr -.rept 8 - .word OP0_d160 -.endr -.rept 8 - .word OP0_d168 -.endr -.rept 8 - .word OP0_d170 -.endr -.word OP0_d178 -.word OP0_d179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d180 -.endr -.rept 8 - .word OP0_d188 -.endr -.rept 8 - .word OP0_d190 -.endr -.rept 8 - .word OP0_d198 -.endr -.rept 8 - .word OP0_d1a0 -.endr -.rept 8 - .word OP0_d1a8 -.endr -.rept 8 - .word OP0_d1b0 -.endr -.word OP0_d1b8 -.word OP0_d1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d1c0 -.endr -.rept 8 - .word OP0_d1d0 -.endr -.rept 8 - .word OP0_d1d8 -.endr -.rept 8 - .word OP0_d1e0 -.endr -.rept 8 - .word OP0_d1e8 -.endr -.rept 8 - .word OP0_d1f0 -.endr -.word OP0_d1f8 -.word OP0_d1f9 -.word OP0_d1fa -.word OP0_d1fb -.word OP0_d1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d010 -.endr -.rept 7 - .word OP0_d018 -.endr -.word OP0_d01f -.rept 7 - .word OP0_d020 -.endr -.word OP0_d027 -.rept 8 - .word OP0_d028 -.endr -.rept 8 - .word OP0_d030 -.endr -.word OP0_d038 -.word OP0_d039 -.word OP0_d03a -.word OP0_d03b -.word OP0_d03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d040 -.endr -.rept 8 - .word OP0_d050 -.endr -.rept 8 - .word OP0_d058 -.endr -.rept 8 - .word OP0_d060 -.endr -.rept 8 - .word OP0_d068 -.endr -.rept 8 - .word OP0_d070 -.endr -.word OP0_d078 -.word OP0_d079 -.word OP0_d07a -.word OP0_d07b -.word OP0_d07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d080 -.endr -.rept 8 - .word OP0_d090 -.endr -.rept 8 - .word OP0_d098 -.endr -.rept 8 - .word OP0_d0a0 -.endr -.rept 8 - .word OP0_d0a8 -.endr -.rept 8 - .word OP0_d0b0 -.endr -.word OP0_d0b8 -.word OP0_d0b9 -.word OP0_d0ba -.word OP0_d0bb -.word OP0_d0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d0c0 -.endr -.rept 8 - .word OP0_d0d0 -.endr -.rept 8 - .word OP0_d0d8 -.endr -.rept 8 - .word OP0_d0e0 -.endr -.rept 8 - .word OP0_d0e8 -.endr -.rept 8 - .word OP0_d0f0 -.endr -.word OP0_d0f8 -.word OP0_d0f9 -.word OP0_d0fa -.word OP0_d0fb -.word OP0_d0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d100 -.endr -.rept 7 - .word OP0_d108 -.endr -.word OP0_d10f -.rept 8 - .word OP0_d110 -.endr -.rept 7 - .word OP0_d118 -.endr -.word OP0_d11f -.rept 7 - .word OP0_d120 -.endr -.word OP0_d127 -.rept 8 - .word OP0_d128 -.endr -.rept 8 - .word OP0_d130 -.endr -.word OP0_d138 -.word OP0_d139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d140 -.endr -.rept 8 - .word OP0_d148 -.endr -.rept 8 - .word OP0_d150 -.endr -.rept 8 - .word OP0_d158 -.endr -.rept 8 - .word OP0_d160 -.endr -.rept 8 - .word OP0_d168 -.endr -.rept 8 - .word OP0_d170 -.endr -.word OP0_d178 -.word OP0_d179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d180 -.endr -.rept 8 - .word OP0_d188 -.endr -.rept 8 - .word OP0_d190 -.endr -.rept 8 - .word OP0_d198 -.endr -.rept 8 - .word OP0_d1a0 -.endr -.rept 8 - .word OP0_d1a8 -.endr -.rept 8 - .word OP0_d1b0 -.endr -.word OP0_d1b8 -.word OP0_d1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d1c0 -.endr -.rept 8 - .word OP0_d1d0 -.endr -.rept 8 - .word OP0_d1d8 -.endr -.rept 8 - .word OP0_d1e0 -.endr -.rept 8 - .word OP0_d1e8 -.endr -.rept 8 - .word OP0_d1f0 -.endr -.word OP0_d1f8 -.word OP0_d1f9 -.word OP0_d1fa -.word OP0_d1fb -.word OP0_d1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d010 -.endr -.rept 7 - .word OP0_d018 -.endr -.word OP0_d01f -.rept 7 - .word OP0_d020 -.endr -.word OP0_d027 -.rept 8 - .word OP0_d028 -.endr -.rept 8 - .word OP0_d030 -.endr -.word OP0_d038 -.word OP0_d039 -.word OP0_d03a -.word OP0_d03b -.word OP0_d03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d040 -.endr -.rept 8 - .word OP0_d050 -.endr -.rept 8 - .word OP0_d058 -.endr -.rept 8 - .word OP0_d060 -.endr -.rept 8 - .word OP0_d068 -.endr -.rept 8 - .word OP0_d070 -.endr -.word OP0_d078 -.word OP0_d079 -.word OP0_d07a -.word OP0_d07b -.word OP0_d07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d080 -.endr -.rept 8 - .word OP0_d090 -.endr -.rept 8 - .word OP0_d098 -.endr -.rept 8 - .word OP0_d0a0 -.endr -.rept 8 - .word OP0_d0a8 -.endr -.rept 8 - .word OP0_d0b0 -.endr -.word OP0_d0b8 -.word OP0_d0b9 -.word OP0_d0ba -.word OP0_d0bb -.word OP0_d0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d0c0 -.endr -.rept 8 - .word OP0_d0d0 -.endr -.rept 8 - .word OP0_d0d8 -.endr -.rept 8 - .word OP0_d0e0 -.endr -.rept 8 - .word OP0_d0e8 -.endr -.rept 8 - .word OP0_d0f0 -.endr -.word OP0_d0f8 -.word OP0_d0f9 -.word OP0_d0fa -.word OP0_d0fb -.word OP0_d0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d100 -.endr -.rept 7 - .word OP0_d108 -.endr -.word OP0_d10f -.rept 8 - .word OP0_d110 -.endr -.rept 7 - .word OP0_d118 -.endr -.word OP0_d11f -.rept 7 - .word OP0_d120 -.endr -.word OP0_d127 -.rept 8 - .word OP0_d128 -.endr -.rept 8 - .word OP0_d130 -.endr -.word OP0_d138 -.word OP0_d139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d140 -.endr -.rept 8 - .word OP0_d148 -.endr -.rept 8 - .word OP0_d150 -.endr -.rept 8 - .word OP0_d158 -.endr -.rept 8 - .word OP0_d160 -.endr -.rept 8 - .word OP0_d168 -.endr -.rept 8 - .word OP0_d170 -.endr -.word OP0_d178 -.word OP0_d179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d180 -.endr -.rept 8 - .word OP0_d188 -.endr -.rept 8 - .word OP0_d190 -.endr -.rept 8 - .word OP0_d198 -.endr -.rept 8 - .word OP0_d1a0 -.endr -.rept 8 - .word OP0_d1a8 -.endr -.rept 8 - .word OP0_d1b0 -.endr -.word OP0_d1b8 -.word OP0_d1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d1c0 -.endr -.rept 8 - .word OP0_d1d0 -.endr -.rept 8 - .word OP0_d1d8 -.endr -.rept 8 - .word OP0_d1e0 -.endr -.rept 8 - .word OP0_d1e8 -.endr -.rept 8 - .word OP0_d1f0 -.endr -.word OP0_d1f8 -.word OP0_d1f9 -.word OP0_d1fa -.word OP0_d1fb -.word OP0_d1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d010 -.endr -.rept 7 - .word OP0_d018 -.endr -.word OP0_d01f -.rept 7 - .word OP0_d020 -.endr -.word OP0_d027 -.rept 8 - .word OP0_d028 -.endr -.rept 8 - .word OP0_d030 -.endr -.word OP0_d038 -.word OP0_d039 -.word OP0_d03a -.word OP0_d03b -.word OP0_d03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d040 -.endr -.rept 8 - .word OP0_d050 -.endr -.rept 8 - .word OP0_d058 -.endr -.rept 8 - .word OP0_d060 -.endr -.rept 8 - .word OP0_d068 -.endr -.rept 8 - .word OP0_d070 -.endr -.word OP0_d078 -.word OP0_d079 -.word OP0_d07a -.word OP0_d07b -.word OP0_d07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d080 -.endr -.rept 8 - .word OP0_d090 -.endr -.rept 8 - .word OP0_d098 -.endr -.rept 8 - .word OP0_d0a0 -.endr -.rept 8 - .word OP0_d0a8 -.endr -.rept 8 - .word OP0_d0b0 -.endr -.word OP0_d0b8 -.word OP0_d0b9 -.word OP0_d0ba -.word OP0_d0bb -.word OP0_d0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d0c0 -.endr -.rept 8 - .word OP0_d0d0 -.endr -.rept 8 - .word OP0_d0d8 -.endr -.rept 8 - .word OP0_d0e0 -.endr -.rept 8 - .word OP0_d0e8 -.endr -.rept 8 - .word OP0_d0f0 -.endr -.word OP0_d0f8 -.word OP0_d0f9 -.word OP0_d0fa -.word OP0_d0fb -.word OP0_d0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d100 -.endr -.rept 7 - .word OP0_d108 -.endr -.word OP0_d10f -.rept 8 - .word OP0_d110 -.endr -.rept 7 - .word OP0_d118 -.endr -.word OP0_d11f -.rept 7 - .word OP0_d120 -.endr -.word OP0_d127 -.rept 8 - .word OP0_d128 -.endr -.rept 8 - .word OP0_d130 -.endr -.word OP0_d138 -.word OP0_d139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d140 -.endr -.rept 8 - .word OP0_d148 -.endr -.rept 8 - .word OP0_d150 -.endr -.rept 8 - .word OP0_d158 -.endr -.rept 8 - .word OP0_d160 -.endr -.rept 8 - .word OP0_d168 -.endr -.rept 8 - .word OP0_d170 -.endr -.word OP0_d178 -.word OP0_d179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d180 -.endr -.rept 8 - .word OP0_d188 -.endr -.rept 8 - .word OP0_d190 -.endr -.rept 8 - .word OP0_d198 -.endr -.rept 8 - .word OP0_d1a0 -.endr -.rept 8 - .word OP0_d1a8 -.endr -.rept 8 - .word OP0_d1b0 -.endr -.word OP0_d1b8 -.word OP0_d1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d1c0 -.endr -.rept 8 - .word OP0_d1d0 -.endr -.rept 8 - .word OP0_d1d8 -.endr -.rept 8 - .word OP0_d1e0 -.endr -.rept 8 - .word OP0_d1e8 -.endr -.rept 8 - .word OP0_d1f0 -.endr -.word OP0_d1f8 -.word OP0_d1f9 -.word OP0_d1fa -.word OP0_d1fb -.word OP0_d1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d000 -.endr -.rept 8 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d010 -.endr -.rept 7 - .word OP0_d018 -.endr -.word OP0_d01f -.rept 7 - .word OP0_d020 -.endr -.word OP0_d027 -.rept 8 - .word OP0_d028 -.endr -.rept 8 - .word OP0_d030 -.endr -.word OP0_d038 -.word OP0_d039 -.word OP0_d03a -.word OP0_d03b -.word OP0_d03c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d040 -.endr -.rept 8 - .word OP0_d050 -.endr -.rept 8 - .word OP0_d058 -.endr -.rept 8 - .word OP0_d060 -.endr -.rept 8 - .word OP0_d068 -.endr -.rept 8 - .word OP0_d070 -.endr -.word OP0_d078 -.word OP0_d079 -.word OP0_d07a -.word OP0_d07b -.word OP0_d07c -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d080 -.endr -.rept 8 - .word OP0_d090 -.endr -.rept 8 - .word OP0_d098 -.endr -.rept 8 - .word OP0_d0a0 -.endr -.rept 8 - .word OP0_d0a8 -.endr -.rept 8 - .word OP0_d0b0 -.endr -.word OP0_d0b8 -.word OP0_d0b9 -.word OP0_d0ba -.word OP0_d0bb -.word OP0_d0bc -.rept 3 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d0c0 -.endr -.rept 8 - .word OP0_d0d0 -.endr -.rept 8 - .word OP0_d0d8 -.endr -.rept 8 - .word OP0_d0e0 -.endr -.rept 8 - .word OP0_d0e8 -.endr -.rept 8 - .word OP0_d0f0 -.endr -.word OP0_d0f8 -.word OP0_d0f9 -.word OP0_d0fa -.word OP0_d0fb -.word OP0_d0fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d100 -.endr -.rept 7 - .word OP0_df08 -.endr -.word OP0_df0f -.rept 8 - .word OP0_d110 -.endr -.rept 7 - .word OP0_d118 -.endr -.word OP0_d11f -.rept 7 - .word OP0_d120 -.endr -.word OP0_d127 -.rept 8 - .word OP0_d128 -.endr -.rept 8 - .word OP0_d130 -.endr -.word OP0_d138 -.word OP0_d139 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d140 -.endr -.rept 8 - .word OP0_d148 -.endr -.rept 8 - .word OP0_d150 -.endr -.rept 8 - .word OP0_d158 -.endr -.rept 8 - .word OP0_d160 -.endr -.rept 8 - .word OP0_d168 -.endr -.rept 8 - .word OP0_d170 -.endr -.word OP0_d178 -.word OP0_d179 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_d180 -.endr -.rept 8 - .word OP0_d188 -.endr -.rept 8 - .word OP0_d190 -.endr -.rept 8 - .word OP0_d198 -.endr -.rept 8 - .word OP0_d1a0 -.endr -.rept 8 - .word OP0_d1a8 -.endr -.rept 8 - .word OP0_d1b0 -.endr -.word OP0_d1b8 -.word OP0_d1b9 -.rept 6 - .word ILLEGAL -.endr -.rept 16 - .word OP0_d1c0 -.endr -.rept 8 - .word OP0_d1d0 -.endr -.rept 8 - .word OP0_d1d8 -.endr -.rept 8 - .word OP0_d1e0 -.endr -.rept 8 - .word OP0_d1e8 -.endr -.rept 8 - .word OP0_d1f0 -.endr -.word OP0_d1f8 -.word OP0_d1f9 -.word OP0_d1fa -.word OP0_d1fb -.word OP0_d1fc -.rept 3 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e000 -.endr -.rept 8 - .word OP0_e008 -.endr -.rept 8 - .word OP0_e010 -.endr -.rept 8 - .word OP0_e018 -.endr -.rept 8 - .word OP0_e020 -.endr -.rept 8 - .word OP0_e028 -.endr -.rept 8 - .word OP0_e030 -.endr -.rept 8 - .word OP0_e038 -.endr -.rept 8 - .word OP0_e040 -.endr -.rept 8 - .word OP0_e048 -.endr -.rept 8 - .word OP0_e050 -.endr -.rept 8 - .word OP0_e058 -.endr -.rept 8 - .word OP0_e060 -.endr -.rept 8 - .word OP0_e068 -.endr -.rept 8 - .word OP0_e070 -.endr -.rept 8 - .word OP0_e078 -.endr -.rept 8 - .word OP0_e080 -.endr -.rept 8 - .word OP0_e088 -.endr -.rept 8 - .word OP0_e090 -.endr -.rept 8 - .word OP0_e098 -.endr -.rept 8 - .word OP0_e0a0 -.endr -.rept 8 - .word OP0_e0a8 -.endr -.rept 8 - .word OP0_e0b0 -.endr -.rept 8 - .word OP0_e0b8 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e0d0 -.endr -.rept 8 - .word OP0_e0d8 -.endr -.rept 8 - .word OP0_e0e0 -.endr -.rept 8 - .word OP0_e0e8 -.endr -.rept 8 - .word OP0_e0f0 -.endr -.word OP0_e0f8 -.word OP0_e0f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e100 -.endr -.rept 8 - .word OP0_e108 -.endr -.rept 8 - .word OP0_e110 -.endr -.rept 8 - .word OP0_e118 -.endr -.rept 8 - .word OP0_e120 -.endr -.rept 8 - .word OP0_e128 -.endr -.rept 8 - .word OP0_e130 -.endr -.rept 8 - .word OP0_e138 -.endr -.rept 8 - .word OP0_e140 -.endr -.rept 8 - .word OP0_e148 -.endr -.rept 8 - .word OP0_e150 -.endr -.rept 8 - .word OP0_e158 -.endr -.rept 8 - .word OP0_e160 -.endr -.rept 8 - .word OP0_e168 -.endr -.rept 8 - .word OP0_e170 -.endr -.rept 8 - .word OP0_e178 -.endr -.rept 8 - .word OP0_e180 -.endr -.rept 8 - .word OP0_e188 -.endr -.rept 8 - .word OP0_e190 -.endr -.rept 8 - .word OP0_e198 -.endr -.rept 8 - .word OP0_e1a0 -.endr -.rept 8 - .word OP0_e1a8 -.endr -.rept 8 - .word OP0_e1b0 -.endr -.rept 8 - .word OP0_e1b8 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e1d0 -.endr -.rept 8 - .word OP0_e1d8 -.endr -.rept 8 - .word OP0_e1e0 -.endr -.rept 8 - .word OP0_e1e8 -.endr -.rept 8 - .word OP0_e1f0 -.endr -.word OP0_e1f8 -.word OP0_e1f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e000 -.endr -.rept 8 - .word OP0_e008 -.endr -.rept 8 - .word OP0_e210 -.endr -.rept 8 - .word OP0_e018 -.endr -.rept 8 - .word OP0_e020 -.endr -.rept 8 - .word OP0_e028 -.endr -.rept 8 - .word OP0_e030 -.endr -.rept 8 - .word OP0_e038 -.endr -.rept 8 - .word OP0_e040 -.endr -.rept 8 - .word OP0_e048 -.endr -.rept 8 - .word OP0_e250 -.endr -.rept 8 - .word OP0_e058 -.endr -.rept 8 - .word OP0_e060 -.endr -.rept 8 - .word OP0_e068 -.endr -.rept 8 - .word OP0_e070 -.endr -.rept 8 - .word OP0_e078 -.endr -.rept 8 - .word OP0_e080 -.endr -.rept 8 - .word OP0_e088 -.endr -.rept 8 - .word OP0_e290 -.endr -.rept 8 - .word OP0_e098 -.endr -.rept 8 - .word OP0_e0a0 -.endr -.rept 8 - .word OP0_e0a8 -.endr -.rept 8 - .word OP0_e0b0 -.endr -.rept 8 - .word OP0_e0b8 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e2d0 -.endr -.rept 8 - .word OP0_e2d8 -.endr -.rept 8 - .word OP0_e2e0 -.endr -.rept 8 - .word OP0_e2e8 -.endr -.rept 8 - .word OP0_e2f0 -.endr -.word OP0_e2f8 -.word OP0_e2f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e300 -.endr -.rept 8 - .word OP0_e108 -.endr -.rept 8 - .word OP0_e310 -.endr -.rept 8 - .word OP0_e118 -.endr -.rept 8 - .word OP0_e120 -.endr -.rept 8 - .word OP0_e128 -.endr -.rept 8 - .word OP0_e130 -.endr -.rept 8 - .word OP0_e138 -.endr -.rept 8 - .word OP0_e340 -.endr -.rept 8 - .word OP0_e148 -.endr -.rept 8 - .word OP0_e350 -.endr -.rept 8 - .word OP0_e158 -.endr -.rept 8 - .word OP0_e160 -.endr -.rept 8 - .word OP0_e168 -.endr -.rept 8 - .word OP0_e170 -.endr -.rept 8 - .word OP0_e178 -.endr -.rept 8 - .word OP0_e380 -.endr -.rept 8 - .word OP0_e188 -.endr -.rept 8 - .word OP0_e390 -.endr -.rept 8 - .word OP0_e198 -.endr -.rept 8 - .word OP0_e1a0 -.endr -.rept 8 - .word OP0_e1a8 -.endr -.rept 8 - .word OP0_e1b0 -.endr -.rept 8 - .word OP0_e1b8 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e3d0 -.endr -.rept 8 - .word OP0_e3d8 -.endr -.rept 8 - .word OP0_e3e0 -.endr -.rept 8 - .word OP0_e3e8 -.endr -.rept 8 - .word OP0_e3f0 -.endr -.word OP0_e3f8 -.word OP0_e3f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e000 -.endr -.rept 8 - .word OP0_e008 -.endr -.rept 8 - .word OP0_e010 -.endr -.rept 8 - .word OP0_e018 -.endr -.rept 8 - .word OP0_e020 -.endr -.rept 8 - .word OP0_e028 -.endr -.rept 8 - .word OP0_e030 -.endr -.rept 8 - .word OP0_e038 -.endr -.rept 8 - .word OP0_e040 -.endr -.rept 8 - .word OP0_e048 -.endr -.rept 8 - .word OP0_e050 -.endr -.rept 8 - .word OP0_e058 -.endr -.rept 8 - .word OP0_e060 -.endr -.rept 8 - .word OP0_e068 -.endr -.rept 8 - .word OP0_e070 -.endr -.rept 8 - .word OP0_e078 -.endr -.rept 8 - .word OP0_e080 -.endr -.rept 8 - .word OP0_e088 -.endr -.rept 8 - .word OP0_e090 -.endr -.rept 8 - .word OP0_e098 -.endr -.rept 8 - .word OP0_e0a0 -.endr -.rept 8 - .word OP0_e0a8 -.endr -.rept 8 - .word OP0_e0b0 -.endr -.rept 8 - .word OP0_e0b8 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e4d0 -.endr -.rept 8 - .word OP0_e4d8 -.endr -.rept 8 - .word OP0_e4e0 -.endr -.rept 8 - .word OP0_e4e8 -.endr -.rept 8 - .word OP0_e4f0 -.endr -.word OP0_e4f8 -.word OP0_e4f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e100 -.endr -.rept 8 - .word OP0_e108 -.endr -.rept 8 - .word OP0_e110 -.endr -.rept 8 - .word OP0_e118 -.endr -.rept 8 - .word OP0_e120 -.endr -.rept 8 - .word OP0_e128 -.endr -.rept 8 - .word OP0_e130 -.endr -.rept 8 - .word OP0_e138 -.endr -.rept 8 - .word OP0_e140 -.endr -.rept 8 - .word OP0_e148 -.endr -.rept 8 - .word OP0_e150 -.endr -.rept 8 - .word OP0_e158 -.endr -.rept 8 - .word OP0_e160 -.endr -.rept 8 - .word OP0_e168 -.endr -.rept 8 - .word OP0_e170 -.endr -.rept 8 - .word OP0_e178 -.endr -.rept 8 - .word OP0_e180 -.endr -.rept 8 - .word OP0_e188 -.endr -.rept 8 - .word OP0_e190 -.endr -.rept 8 - .word OP0_e198 -.endr -.rept 8 - .word OP0_e1a0 -.endr -.rept 8 - .word OP0_e1a8 -.endr -.rept 8 - .word OP0_e1b0 -.endr -.rept 8 - .word OP0_e1b8 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e5d0 -.endr -.rept 8 - .word OP0_e5d8 -.endr -.rept 8 - .word OP0_e5e0 -.endr -.rept 8 - .word OP0_e5e8 -.endr -.rept 8 - .word OP0_e5f0 -.endr -.word OP0_e5f8 -.word OP0_e5f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e000 -.endr -.rept 8 - .word OP0_e008 -.endr -.rept 8 - .word OP0_e010 -.endr -.rept 8 - .word OP0_e018 -.endr -.rept 8 - .word OP0_e020 -.endr -.rept 8 - .word OP0_e028 -.endr -.rept 8 - .word OP0_e030 -.endr -.rept 8 - .word OP0_e038 -.endr -.rept 8 - .word OP0_e040 -.endr -.rept 8 - .word OP0_e048 -.endr -.rept 8 - .word OP0_e050 -.endr -.rept 8 - .word OP0_e058 -.endr -.rept 8 - .word OP0_e060 -.endr -.rept 8 - .word OP0_e068 -.endr -.rept 8 - .word OP0_e070 -.endr -.rept 8 - .word OP0_e078 -.endr -.rept 8 - .word OP0_e080 -.endr -.rept 8 - .word OP0_e088 -.endr -.rept 8 - .word OP0_e090 -.endr -.rept 8 - .word OP0_e098 -.endr -.rept 8 - .word OP0_e0a0 -.endr -.rept 8 - .word OP0_e0a8 -.endr -.rept 8 - .word OP0_e0b0 -.endr -.rept 8 - .word OP0_e0b8 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e6d0 -.endr -.rept 8 - .word OP0_e6d8 -.endr -.rept 8 - .word OP0_e6e0 -.endr -.rept 8 - .word OP0_e6e8 -.endr -.rept 8 - .word OP0_e6f0 -.endr -.word OP0_e6f8 -.word OP0_e6f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e100 -.endr -.rept 8 - .word OP0_e108 -.endr -.rept 8 - .word OP0_e110 -.endr -.rept 8 - .word OP0_e118 -.endr -.rept 8 - .word OP0_e120 -.endr -.rept 8 - .word OP0_e128 -.endr -.rept 8 - .word OP0_e130 -.endr -.rept 8 - .word OP0_e138 -.endr -.rept 8 - .word OP0_e140 -.endr -.rept 8 - .word OP0_e148 -.endr -.rept 8 - .word OP0_e150 -.endr -.rept 8 - .word OP0_e158 -.endr -.rept 8 - .word OP0_e160 -.endr -.rept 8 - .word OP0_e168 -.endr -.rept 8 - .word OP0_e170 -.endr -.rept 8 - .word OP0_e178 -.endr -.rept 8 - .word OP0_e180 -.endr -.rept 8 - .word OP0_e188 -.endr -.rept 8 - .word OP0_e190 -.endr -.rept 8 - .word OP0_e198 -.endr -.rept 8 - .word OP0_e1a0 -.endr -.rept 8 - .word OP0_e1a8 -.endr -.rept 8 - .word OP0_e1b0 -.endr -.rept 8 - .word OP0_e1b8 -.endr -.rept 16 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e7d0 -.endr -.rept 8 - .word OP0_e7d8 -.endr -.rept 8 - .word OP0_e7e0 -.endr -.rept 8 - .word OP0_e7e8 -.endr -.rept 8 - .word OP0_e7f0 -.endr -.word OP0_e7f8 -.word OP0_e7f9 -.rept 6 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e000 -.endr -.rept 8 - .word OP0_e008 -.endr -.rept 8 - .word OP0_e010 -.endr -.rept 8 - .word OP0_e018 -.endr -.rept 8 - .word OP0_e020 -.endr -.rept 8 - .word OP0_e028 -.endr -.rept 8 - .word OP0_e030 -.endr -.rept 8 - .word OP0_e038 -.endr -.rept 8 - .word OP0_e040 -.endr -.rept 8 - .word OP0_e048 -.endr -.rept 8 - .word OP0_e050 -.endr -.rept 8 - .word OP0_e058 -.endr -.rept 8 - .word OP0_e060 -.endr -.rept 8 - .word OP0_e068 -.endr -.rept 8 - .word OP0_e070 -.endr -.rept 8 - .word OP0_e078 -.endr -.rept 8 - .word OP0_e080 -.endr -.rept 8 - .word OP0_e088 -.endr -.rept 8 - .word OP0_e090 -.endr -.rept 8 - .word OP0_e098 -.endr -.rept 8 - .word OP0_e0a0 -.endr -.rept 8 - .word OP0_e0a8 -.endr -.rept 8 - .word OP0_e0b0 -.endr -.rept 8 - .word OP0_e0b8 -.endr -.rept 64 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e100 -.endr -.rept 8 - .word OP0_e108 -.endr -.rept 8 - .word OP0_e110 -.endr -.rept 8 - .word OP0_e118 -.endr -.rept 8 - .word OP0_e120 -.endr -.rept 8 - .word OP0_e128 -.endr -.rept 8 - .word OP0_e130 -.endr -.rept 8 - .word OP0_e138 -.endr -.rept 8 - .word OP0_e140 -.endr -.rept 8 - .word OP0_e148 -.endr -.rept 8 - .word OP0_e150 -.endr -.rept 8 - .word OP0_e158 -.endr -.rept 8 - .word OP0_e160 -.endr -.rept 8 - .word OP0_e168 -.endr -.rept 8 - .word OP0_e170 -.endr -.rept 8 - .word OP0_e178 -.endr -.rept 8 - .word OP0_e180 -.endr -.rept 8 - .word OP0_e188 -.endr -.rept 8 - .word OP0_e190 -.endr -.rept 8 - .word OP0_e198 -.endr -.rept 8 - .word OP0_e1a0 -.endr -.rept 8 - .word OP0_e1a8 -.endr -.rept 8 - .word OP0_e1b0 -.endr -.rept 8 - .word OP0_e1b8 -.endr -.rept 64 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e000 -.endr -.rept 8 - .word OP0_e008 -.endr -.rept 8 - .word OP0_e010 -.endr -.rept 8 - .word OP0_e018 -.endr -.rept 8 - .word OP0_e020 -.endr -.rept 8 - .word OP0_e028 -.endr -.rept 8 - .word OP0_e030 -.endr -.rept 8 - .word OP0_e038 -.endr -.rept 8 - .word OP0_e040 -.endr -.rept 8 - .word OP0_e048 -.endr -.rept 8 - .word OP0_e050 -.endr -.rept 8 - .word OP0_e058 -.endr -.rept 8 - .word OP0_e060 -.endr -.rept 8 - .word OP0_e068 -.endr -.rept 8 - .word OP0_e070 -.endr -.rept 8 - .word OP0_e078 -.endr -.rept 8 - .word OP0_e080 -.endr -.rept 8 - .word OP0_e088 -.endr -.rept 8 - .word OP0_e090 -.endr -.rept 8 - .word OP0_e098 -.endr -.rept 8 - .word OP0_e0a0 -.endr -.rept 8 - .word OP0_e0a8 -.endr -.rept 8 - .word OP0_e0b0 -.endr -.rept 8 - .word OP0_e0b8 -.endr -.rept 64 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e100 -.endr -.rept 8 - .word OP0_e108 -.endr -.rept 8 - .word OP0_e110 -.endr -.rept 8 - .word OP0_e118 -.endr -.rept 8 - .word OP0_e120 -.endr -.rept 8 - .word OP0_e128 -.endr -.rept 8 - .word OP0_e130 -.endr -.rept 8 - .word OP0_e138 -.endr -.rept 8 - .word OP0_e140 -.endr -.rept 8 - .word OP0_e148 -.endr -.rept 8 - .word OP0_e150 -.endr -.rept 8 - .word OP0_e158 -.endr -.rept 8 - .word OP0_e160 -.endr -.rept 8 - .word OP0_e168 -.endr -.rept 8 - .word OP0_e170 -.endr -.rept 8 - .word OP0_e178 -.endr -.rept 8 - .word OP0_e180 -.endr -.rept 8 - .word OP0_e188 -.endr -.rept 8 - .word OP0_e190 -.endr -.rept 8 - .word OP0_e198 -.endr -.rept 8 - .word OP0_e1a0 -.endr -.rept 8 - .word OP0_e1a8 -.endr -.rept 8 - .word OP0_e1b0 -.endr -.rept 8 - .word OP0_e1b8 -.endr -.rept 64 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e000 -.endr -.rept 8 - .word OP0_e008 -.endr -.rept 8 - .word OP0_e010 -.endr -.rept 8 - .word OP0_e018 -.endr -.rept 8 - .word OP0_e020 -.endr -.rept 8 - .word OP0_e028 -.endr -.rept 8 - .word OP0_e030 -.endr -.rept 8 - .word OP0_e038 -.endr -.rept 8 - .word OP0_e040 -.endr -.rept 8 - .word OP0_e048 -.endr -.rept 8 - .word OP0_e050 -.endr -.rept 8 - .word OP0_e058 -.endr -.rept 8 - .word OP0_e060 -.endr -.rept 8 - .word OP0_e068 -.endr -.rept 8 - .word OP0_e070 -.endr -.rept 8 - .word OP0_e078 -.endr -.rept 8 - .word OP0_e080 -.endr -.rept 8 - .word OP0_e088 -.endr -.rept 8 - .word OP0_e090 -.endr -.rept 8 - .word OP0_e098 -.endr -.rept 8 - .word OP0_e0a0 -.endr -.rept 8 - .word OP0_e0a8 -.endr -.rept 8 - .word OP0_e0b0 -.endr -.rept 8 - .word OP0_e0b8 -.endr -.rept 64 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e100 -.endr -.rept 8 - .word OP0_e108 -.endr -.rept 8 - .word OP0_e110 -.endr -.rept 8 - .word OP0_e118 -.endr -.rept 8 - .word OP0_e120 -.endr -.rept 8 - .word OP0_e128 -.endr -.rept 8 - .word OP0_e130 -.endr -.rept 8 - .word OP0_e138 -.endr -.rept 8 - .word OP0_e140 -.endr -.rept 8 - .word OP0_e148 -.endr -.rept 8 - .word OP0_e150 -.endr -.rept 8 - .word OP0_e158 -.endr -.rept 8 - .word OP0_e160 -.endr -.rept 8 - .word OP0_e168 -.endr -.rept 8 - .word OP0_e170 -.endr -.rept 8 - .word OP0_e178 -.endr -.rept 8 - .word OP0_e180 -.endr -.rept 8 - .word OP0_e188 -.endr -.rept 8 - .word OP0_e190 -.endr -.rept 8 - .word OP0_e198 -.endr -.rept 8 - .word OP0_e1a0 -.endr -.rept 8 - .word OP0_e1a8 -.endr -.rept 8 - .word OP0_e1b0 -.endr -.rept 8 - .word OP0_e1b8 -.endr -.rept 64 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e000 -.endr -.rept 8 - .word OP0_e008 -.endr -.rept 8 - .word OP0_e010 -.endr -.rept 8 - .word OP0_e018 -.endr -.rept 8 - .word OP0_e020 -.endr -.rept 8 - .word OP0_e028 -.endr -.rept 8 - .word OP0_e030 -.endr -.rept 8 - .word OP0_e038 -.endr -.rept 8 - .word OP0_e040 -.endr -.rept 8 - .word OP0_e048 -.endr -.rept 8 - .word OP0_e050 -.endr -.rept 8 - .word OP0_e058 -.endr -.rept 8 - .word OP0_e060 -.endr -.rept 8 - .word OP0_e068 -.endr -.rept 8 - .word OP0_e070 -.endr -.rept 8 - .word OP0_e078 -.endr -.rept 8 - .word OP0_e080 -.endr -.rept 8 - .word OP0_e088 -.endr -.rept 8 - .word OP0_e090 -.endr -.rept 8 - .word OP0_e098 -.endr -.rept 8 - .word OP0_e0a0 -.endr -.rept 8 - .word OP0_e0a8 -.endr -.rept 8 - .word OP0_e0b0 -.endr -.rept 8 - .word OP0_e0b8 -.endr -.rept 64 - .word ILLEGAL -.endr -.rept 8 - .word OP0_e100 -.endr -.rept 8 - .word OP0_e108 -.endr -.rept 8 - .word OP0_e110 -.endr -.rept 8 - .word OP0_e118 -.endr -.rept 8 - .word OP0_e120 -.endr -.rept 8 - .word OP0_e128 -.endr -.rept 8 - .word OP0_e130 -.endr -.rept 8 - .word OP0_e138 -.endr -.rept 8 - .word OP0_e140 -.endr -.rept 8 - .word OP0_e148 -.endr -.rept 8 - .word OP0_e150 -.endr -.rept 8 - .word OP0_e158 -.endr -.rept 8 - .word OP0_e160 -.endr -.rept 8 - .word OP0_e168 -.endr -.rept 8 - .word OP0_e170 -.endr -.rept 8 - .word OP0_e178 -.endr -.rept 8 - .word OP0_e180 -.endr -.rept 8 - .word OP0_e188 -.endr -.rept 8 - .word OP0_e190 -.endr -.rept 8 - .word OP0_e198 -.endr -.rept 8 - .word OP0_e1a0 -.endr -.rept 8 - .word OP0_e1a8 -.endr -.rept 8 - .word OP0_e1b0 -.endr -.rept 8 - .word OP0_e1b8 -.endr -.rept 64 - .word ILLEGAL -.endr -.rept 4096 - .word OP0_f000 -.endr diff --git a/jan/src/cpu/a68k/mips/builda68k.bat b/jan/src/cpu/a68k/mips/builda68k.bat deleted file mode 100644 index bcb80c20c..000000000 --- a/jan/src/cpu/a68k/mips/builda68k.bat +++ /dev/null @@ -1,3 +0,0 @@ -cl /nologo /Og /Oi /Ot /Oy /Ob2 /G6 /GF /Gy /GL /Gr /Zc:forScope /ML /Fp$(IntDir)\generated\ /DNDEBUG=1 /DINLINE="__inline static" /DWIN32 /DFASTCALL fba_make68k.c /link /NOLOGO /INCREMENTAL:NO /MACHINE:X86 /LIBPATH:"$(VCInstallDir)lib\" /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libcp.lib /NODEFAULTLIB:libcpd.lib /NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:libcpmtd.lib /LTCG:STATUS /SUBSYSTEM:CONSOLE - -fba_make68k a68k.s a68ktbl.inc diff --git a/jan/src/cpu/a68k/mips/fba_make68k.c b/jan/src/cpu/a68k/mips/fba_make68k.c deleted file mode 100644 index a30753bf3..000000000 --- a/jan/src/cpu/a68k/mips/fba_make68k.c +++ /dev/null @@ -1,7482 +0,0 @@ -/*--------------------------------------------------------------- - * Motorola 68000 32 Bit emulator - * - * Copyright 1998-2001 Mike Coates, All rights reserved - * Darren Olafson - *--------------------------------------------------------------- - * - * Thanks to ... - * - * Neil Bradley (lots of optimisation help & ideas) - * - *--------------------------------------------------------------- - * History (so we know what bugs have been fixed) - * - * 02.11.98 MJC - CMPM bug, overwriting first value - * 04.11.98 MJC - Debug timing - same as C core - * save PC on calls to C memory routines - * 05.11.98 NS - Re-insert changes to make work on OS/2 - * 06.11.98 MJC - Flags saved on ADDA commands - * X set on ADD commands - * 23.11.98 MJC - Alternate Memory Read/Write for non DOS ports - * 24.11.98 CK - Add WIN32 specific stuff - * 25.11.98 DEO - ABCD Size not initialised - * 21.12.98 MJC - Change register saving on Memory Banking - * 13.01.99 M/D - Change to new C core disassembler - * 19.01.99 MJC - Proper? support for new Interrupt System - * 17.02.99 MJC - TRACE68K define added - * ABCD,SBCD not keeping Z flag - * JMP, JSR for some EA combo's damaging flags - * DIVU - Overflow not being set correctly - * ASL/ASR - Flag Handling now correct - * some minor optimisations - * 13.03.99 DEO - Added new cycle timing - * 24.03.99 MJC - TRACE68K define removed - * NEW INTERRUPT SYSTEM only - * interrupt check sped up (when not taken) - * STOP checks for interrupt - * 01.04.99 MJC - OS2 specifics added - * MOVEM reference point moved - * Data and Address register mode combined for :- - * movecodes - * dumpx - * 04.05.99 MJC - Add Previous PC support to MOVE.B #X,XXXXXX.L (F1 Dream) - * ABCD/SBCD could corrupt zero flag - * DIVS/DIVU overflow should not update register - * 22.05.99 MJC - Complete support of Previous PC on C calls - * Some optional bits now selected by DEFINES - * 27.05.99 MJC - Interrupt system changed - * 28.05.99 MJC - Use DEFINES in more places - * Interrupt check running one opcode when taken - * 16.07.99 MJC - Reset - Preload next opcode / external call - * 68010 commands almost complete - * more compression on jump table (16k smaller) - * Some optimising - * shl reg,1 -> add reg,reg - * or ecx,ecx:jz -> jecxz - * 22.08.99 DEO - SBCD/ABCD sets N flag same as carry - * 19.10.99 MJC - Change DOS memory routines - * Change DOS Clobber flags (ESI no longer safe) - * Save EAX around memory write where needed - * bit commands optimised - * 25.10.99 MJC - Was keeping masked register on read/write - * if register was preserved over call - * ESI assumed 'safe' again - * 25.10.99 MJC - Bank ID moved to CPU context - * 03.11.99 KENJO - VC++6.0 seems not to preserve EDI. Fixed "ABCD -(A0), -(A0)" crash / "roxr (A0)"-type shift crash - * 13.11.99 KENJO - Fixed "NABC" - * Now Win32 uses FASTCALL type call for interrupt callback - * 09.02.00 MJC - Check CPU type before allowing 68010/68020 instructions - * remove routines for 5 non existant opcodes - * 05.03.00 MJC - not command decrement A7 by 1 for bytes - * 10.03.00 MJC - as did btst,cmpm and nbcd - * 22.03.00 MJC - Divide by zero should not decrement PC by 2 before push - * Move memory banking into exception routine - * 14.04.00 Dave - BTST missing Opcode - * ASL.L > 31 shift - * 20.04.00 MJC - TST.B Also missing A7 specific routine - * - Extra Define A7ROUTINE to switch between having seperate - * routines for +-(A7) address modes. - * 24.06.00 MJC - ADDX/SUBX +-(A7) routines added. - * TAS should not touch X flag - * LSL/LSR EA not clearing V flag - * CHK not all opcodes in jump table - * Add define to mask status register - * 04.07.00 MJC - Keep high byte of Program Counter on Bxx and Jxx - * Fix flag handling on NEGX - * Really fix ADDX/SUBX +-(A7) - * PC could be set wrong after CHK.W instruction - * DIVS/DIVU always clear C flag - * ABCD/SBCD missing +-(A7) Routine - * TAS missing +-(A7) Routine - * Bitwise Static missing +-(A7) Routine - * CMPM missing +-(A7) Routine - * 30.09.00 DEO - added mull, divl, bfextu - * added '020 addressing modes - * fixed $6xff branching - * 23.01.01 MJC - Spits out seperate code for 68000 & 68020 - * allows seperate optimising! - * 17.02.01 MJC - Support for encrypted PC relative fetch calls - * 11.03.01 GUTI - change some cmp reg,0 and or reg,reg with test - * 13.03.01 MJC - Single Icount for Asm & C cores - * 16.05.01 ASG - use push/pop around mem calls instead of store to safe_REG - * optimized a bit the 020 extension word decoder - * removed lots of unnecessary code in branches - *--------------------------------------------------------------- - * Known Problems / Bugs - * - * 68000 - * None - Let us know if you find any! - * - * 68010 - * Instructions that are supervisor only as per 68000 spec. - * move address space not implemented. - * - * 68020 - * only long Bcc instruction implemented. - *--------------------------------------------------------------- - * Notes - * - * STALLCHECK should be defined for Pentium Class - * undefined for P2/Celerons - * - * ALIGNMENT is normally 4, but seems faster on my P2 as 0 ! - * - *--------------------------------------------------------------- - * - * Future Changes - * - * 68020 instructions to be completed - * assembler memory routines + - * - * and anything else that takes our fancy! - *---------------------------------------------------------------*/ - -/* Specials - Switch what program allows/disallows */ - -#undef STALLCHECK /* Affects fetching of Opcode */ -#undef SAVEPPC /* Save Previous PC (!!! FBA setting) */ -#define ENCRYPTED /* PC relative = decrypted */ -#define ASMBANK 10 /* Memory banking algorithm to use LVR - (bank size = 1 << ASMBANK (8 = 16)) */ -#define A7ROUTINE /* Define to use separate routines for -(a7)/(a7)+ */ -#define ALIGNMENT 4 /* Alignment to use for branches */ -#undef MASKCCR /* Mask the status register to filter out unused bits */ -#define KEEPHIGHPC /* Keep or Ignore bits 24-31 */ -#define QUICKZERO /* selects XOR r,r or MOV r,0 */ -#undef RLETABLE /* Don't use RLE table */ -#undef TESTTABLE - -#include -#include -#include -#include - -/* New Disassembler */ - -char * codebuf; -int DisOp; - -#define cpu_readmem24bew(addr) (0) -#define cpu_readmem24bew_word(addr) (DisOp) - -#define MEMORY_H /* so memory.h will not be included... */ -/* -#include "d68k.c" -*/ -#undef MEMORY_H - -#undef cpu_readmem24bew -#undef cpu_readmem24bew_word - - -/* - * Defines used by Program - * - */ - -#define VERSION "0.30" - -#define TRUE -1 -#define FALSE 0 - -#define ZERO 0 -#define AT 1 -#define V0 2 -#define V1 3 -#define A0 4 -#define TMPREG3 A0 -#define A1 5 -#define TMPREG2 A1 -#define A2 6 -#define TMPREG1 A2 -#define A3 7 -#define TMPREG0 A3 -#define T0 8 -#define T1 9 -#define T2 10 -#define T3 11 -#define T4 12 -#define T5 13 -#define T6 14 -#define EFFADDR T6 -#define T7 15 -#define ICNT T7 -#define S0 16 -#define FLAG_C S0 -#define S1 17 -#define FLAG_V S1 -#define S2 18 -#define FLAG_Z S2 -#define S3 19 -#define FLAG_N S3 -#define S4 20 -#define FLAG_X S4 -#define S5 21 -#define S6 22 -#define BASEPC S6 -#define S7 23 -#define PC S7 -#define T8 24 -#define OPCODE T8 -#define T9 25 -#define K0 26 -#define K1 27 -#define GP 28 -#define SP 29 -#define FP 30 -#define S8 FP -#define OPCODETBL S8 -#define RA 31 - - -#define NORMAL 0 -#define PCREL 1 - -//#ifdef __ELF__ -#define PREF "" -//#else -//#define PREF "_" -//#endif - -/* Register Location Offsets */ - -#define MEMBASE S5 -#define MEMBASESTR "$21" - -#define ICOUNT PREF "m68k_ICount" -#define OP_ROM PREF "OP_ROM" -#define OP_RAM PREF "OP_RAM" - -#define MEMINTF_DBGCALLBACK "0x78(" MEMBASESTR ")" -#define MEMINTF_READBYTE "0x7C(" MEMBASESTR ")" -#define MEMINTF_READWORD "0x80(" MEMBASESTR ")" -#define MEMINTF_READLONG "0x84(" MEMBASESTR ")" -#define MEMINTF_WRITEBYTE "0x88(" MEMBASESTR ")" -#define MEMINTF_WRITEWORD "0x8C(" MEMBASESTR ")" -#define MEMINTF_WRITELONG "0x90(" MEMBASESTR ")" -#define MEMINTF_CHANGEPC "0x94(" MEMBASESTR ")" -#define MEMINTF_READBYTEPC "0x98(" MEMBASESTR ")" -#define MEMINTF_READWORDPC "0x9C(" MEMBASESTR ")" -#define MEMINTF_READLONGPC "0xA0(" MEMBASESTR ")" -#define MEMINTF_DIR16 "0xA4(" MEMBASESTR ")" -#define MEMINTF_DIR32 "0xA8(" MEMBASESTR ")" - -#define REG_A7 "0x3C(" MEMBASESTR ")" -#define REG_USP "0x68(" MEMBASESTR ")" -#define REG_ISP "0x40(" MEMBASESTR ")" -#define REG_SRH "0x44(" MEMBASESTR ")" -#define REG_CCR "0x48(" MEMBASESTR ")" -#define REG_PC "0x4C(" MEMBASESTR ")" -#define REG_IRQ "0x50(" MEMBASESTR ")" -#define REG_IRQ_CALLBACK "0x54(" MEMBASESTR ")" -#define REG_RESET_CALLBACK "0x5C(" MEMBASESTR ")" -#define FULLPC "0x74(" MEMBASESTR ")" -#define CPUVERSION "0x70(" MEMBASESTR ")" -#define PREVIOUSPC "0x58(" MEMBASESTR ")" - -/* 68010 Regs */ - -#define REG_SFC_BASE 0x60 -#define REG_VBR "0x6C(" MEMBASESTR ")" -#define REG_SFC "0x60(" MEMBASESTR ")" -#define REG_DFC "0x64(" MEMBASESTR ")" - -/* 11 registers + space for 10 work registers + A0 - A3 : Stack must be kept on 16 bytes boundaries */ -#define STACKFRAME_SIZE (7 * (4 * 4)) -#if (MEMBASE == GP) -#define LOCALVARBASE (STACKFRAME_SIZE - 0x2C) -#else -#define LOCALVARBASE (STACKFRAME_SIZE - 0x28) -#endif -#define MINSTACK_POS (1 * (4 * 4)) - -#define FASTCALL_FIRST_REG A0 -#define FASTCALL_SECOND_REG A1 -#define FASTCALL_THIRD_REG A2 -#define FASTCALL_FOURTH_REG A3 - - -#define FLAGS_NONE 0 -#define FLAGS_ADD 1 -#define FLAGS_SUB 2 -#define FLAGS_CMP 3 -#define FLAGS_MOVE 4 -#define FLAGS_BITOP 5 -#define FLAGS_ADDX 6 -#define FLAGS_SUBX 7 - -/* - * Global Variables - * - */ - -FILE *fp = NULL; - -char *comptab = NULL; -char *CPUtype = NULL; - -int CPU = 0; -int CheckInterrupt = 0; -int ExternalIO = 0; -int Opcount = 0; -int TimingCycles = 0; -int AddEACycles = 0; -int AccessType = NORMAL; -int LocalStack = LOCALVARBASE; -int PreDecLongMove = 0; - -/* External register preservation */ - -static char SavedRegs[] = "ZA--------------SSSSSSSS----GSFR"; - - - -/* Jump Table */ - -int OpcodeArray[65536]; - -/* Lookup Arrays */ - -static char* regnameslong[] = -{ "$0","$1","$2","$3","$4","$5","$6","$7","$8","$9","$10","$11","$12","$13","$14","$15","$16","$17","$18","$19","$20","$21","$22","$23","$24","$25","$26","$27","$28","$29","$30","$31" }; -//{ "$zero","$at","$v0","$v1","$a0","$a1","$a2","$a3","$t0","$t1","$t2","$t3","$t4","$t5","$t6","$t7","$s0","$s1","$s2","$s3","$s4","$s5","$s6","$s7","$t8","$t9","$k0","$k1","$gp","$sp","$fp","$ra" }; - -//static char* regnamesword[] = -//{ "$0","$1","$2","$3","$4","$5","$6","$7","$8","$9","$10","$11","$12","$13","$14","$15","$16","$17","$18","$19","$20","$21","$22","$23","$24","$25","$26","$27","$28","$29","$30","$31" }; -// -//static char* regnamesshort[] = -//{ "$0","$1","$2","$3","$4","$5","$6","$7","$8","$9","$10","$11","$12","$13","$14","$15","$16","$17","$18","$19","$20","$21","$22","$23","$24","$25","$26","$27","$28","$29","$30","$31" }; - - -/*********************************/ -/* Conversion / Utility Routines */ -/*********************************/ - -/* Convert EA to Address Mode Number - * - * 0 Dn - * 1 An - * 2 (An) - * 3 (An)+ - * 4 -(An) - * 5 x(An) - * 6 x(An,xr.s) - * 7 x.w - * 8 x.l - * 9 x(PC) - * 10 x(PC,xr.s) - * 11 #x,SR,CCR Read = Immediate, Write = SR or CCR - * in order to read SR, use READCCR - * 12-15 INVALID - * - * 19 (A7)+ - * 20 -(A7) - * - */ - -int EAtoAMN(int EA, int Way) -{ - int Work; - - if (Way) { - Work = (EA & 0x7); - - if (Work == 7) Work += ((EA & 0x38) >> 3); - - if (((Work == 3) || (Work == 4)) && (((EA & 0x38) >> 3) == 7)) { - Work += 16; - } - } else { - Work = (EA & 0x38) >> 3; - - if (Work == 7) Work += (EA & 7); - - if (((Work == 3) || (Work == 4)) && ((EA & 7) == 7)) { - Work += 16; - } - } - - return Work; -} - -/* - * Generate Main or Sub label - */ - -char* GenerateLabel(int ID, int Type) -{ - static int LabID, LabNum; -/* - static char disasm[80]; - char *dis = disasm; -*/ - if (Type == 0) { - CheckInterrupt = 0; /* No need to check for Interrupts */ - ExternalIO = 0; /* Not left Assembler Yet */ - TimingCycles = 0; /* No timing info for this command */ - AddEACycles = 1; /* default to add in EA timing */ - Opcount++; /* for screen display */ - PreDecLongMove = 0; - - DisOp = ID; -/* - m68k_disassemble(dis,0); - sprintf(codebuf, "OP%d_%4.4x:\t\t\t\t; %s", CPU, ID, dis); -*/ - sprintf(codebuf, "OP%d_%4.4x:\t\t\t\t#", CPU, ID); - - LabID = ID; - LabNum = 0; - } else { - LabNum++; - sprintf(codebuf, "OP%d_%4.4x_%1x", CPU,LabID, LabNum); - } - - return codebuf; -} - -/* - * Generate Alignment Line - */ - -void Align(void) -{ - //fprintf(fp, "\t\t .align %d\n\n", ALIGNMENT); -} - -void ClearRegister(int regno) -{ - fprintf(fp, "\t\t and %s,$0,$0\n", regnameslong[regno]); -} - -/* - * Immediate 3 bit data - * - * 0=8, anything else is itself - * - * Again, several ways to achieve this - * - * ECX contains data as 3 lowest bits - * - */ - -void Immediate8(void) -{ - fprintf(fp, "\t\t addiu %s,%s,-1 \t # Move range down\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x07 \t # Mask out lower bits\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addiu %s,%s,1 \t # correct range\n", regnameslong[OPCODE], regnameslong[OPCODE]); -} - -/* - * This will check for bank changes before - * resorting to calling the C bank select code - * - * Most of the time it does not change! - * - */ - -/* forward used by MemoryBanking */ -void Exception(int Number, char* DelaySlot); - -void MemoryBanking(int pc, int LocalStack) -{ - /* check for odd address */ - fprintf(fp, "\t\t andi %s,%s,0x01\n", regnameslong[T9], regnameslong[pc != 0 ? pc : PC]); - fprintf(fp, "\t\t beq %s,$0,2f\n", regnameslong[T9]); - if (pc != 0) { - fprintf(fp, "\t\t addu %s,%s,%s \t # Delay slot\n", regnameslong[PC], regnameslong[BASEPC], regnameslong[pc]); - } else { - pc = TMPREG2; - fprintf(fp, "\t\t subu %s,%s,%s \t # Delay slot\n", regnameslong[pc], regnameslong[PC], regnameslong[BASEPC]); - } - - /* trying to run at an odd address */ - Exception(3, NULL); - - /* Keep Whole PC */ - - fprintf(fp, "\t2:\n"); - -/* ASG - always call to the changepc subroutine now, since the number of */ -/* bits varies based on the memory model */ -#ifdef KEEPHIGHPC - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[pc], FULLPC); -#endif - - /* Mask to n bits */ - fprintf(fp, "\t\t lw %s,%smem_amask\n", regnameslong[TMPREG1], PREF); - //fprintf(fp, "\t\t la %s,%smem_amask\n", regnameslong[TMPREG0], PREF); - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_CHANGEPC); - //fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[TMPREG1], regnameslong[TMPREG0]); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[PC], regnameslong[pc], regnameslong[TMPREG1]); - - /* Call Banking Routine */ - - if (SavedRegs[PC] == '-') fprintf(fp, "\t\t sw %s,%s\n", regnameslong[PC], REG_PC); - - if (SavedRegs[FLAG_C] == '-') fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], --LocalStack, regnameslong[SP]); - if (SavedRegs[FLAG_V] == '-') fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], --LocalStack, regnameslong[SP]); - if (SavedRegs[FLAG_Z] == '-') fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], --LocalStack, regnameslong[SP]); - if (SavedRegs[FLAG_N] == '-') fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], --LocalStack, regnameslong[SP]); - if (SavedRegs[FLAG_X] == '-') fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], --LocalStack, regnameslong[SP]); - assert(LocalStack >= MINSTACK_POS); - - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[ICNT], ICOUNT); - fprintf(fp, "\t\t jalr %s\n", regnameslong[T9]); - fprintf(fp, "\t\t or %s,$0,%s \t # Delay slot\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[PC]); - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[ICNT], ICOUNT); - - if (SavedRegs[FLAG_X] == '-') fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], LocalStack++, regnameslong[SP]); - if (SavedRegs[FLAG_N] == '-') fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], LocalStack++, regnameslong[SP]); - if (SavedRegs[FLAG_Z] == '-') fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], LocalStack++, regnameslong[SP]); - if (SavedRegs[FLAG_V] == '-') fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], LocalStack++, regnameslong[SP]); - if (SavedRegs[FLAG_C] == '-') fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], LocalStack++, regnameslong[SP]); - - if (SavedRegs[PC] == '-') fprintf(fp, "\t\t lw %s,%s\n", regnameslong[PC], REG_PC); - - /* Update our copy */ - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[BASEPC], OP_ROM); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[PC], regnameslong[PC], regnameslong[BASEPC]); - - fprintf(fp, " # End of Banking code:\n"); -} - -/* - * Update Previous PC value - * - */ - -void SavePreviousPC(void) -{ -#ifdef SAVEPPC - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T9], regnameslong[PC], regnameslong[BASEPC]); - fprintf(fp, "\t\t sw %s,%s \t # Keep Previous PC\n", regnameslong[T9], PREVIOUSPC); -#endif -} - -/* - * Complete Opcode handling - * - * Any tidying up, end code - * - */ - -void Completed(void) -{ - - /* Flag Processing to be finished off ? */ - - AccessType = NORMAL; - - /* Use assembler timing routines */ - - if (TimingCycles != 0) { - if (TimingCycles > 32767) { - fprintf(fp, "\t\t li %s,%d\n", regnameslong[T9], TimingCycles); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[ICNT], regnameslong[ICNT], regnameslong[T9]); - } else { - if (TimingCycles != -1) - fprintf(fp, "\t\t addiu %s,%s,%d\n", regnameslong[ICNT], regnameslong[ICNT], -TimingCycles); - } - } - //fprintf(fp, "\t\t bltz %s,MainExit\n", regnameslong[ICNT]); - //fprintf(fp, "\t\t nop\n\n"); - - if (CheckInterrupt) { - fprintf(fp, "\t\t bgez %s,3f\n", regnameslong[ICNT]); - fprintf(fp, "\t\t lbu %s,%s \t # Delay slot\n", regnameslong[TMPREG0], REG_IRQ); - fprintf(fp, "\t\t j MainExit\n"); - fprintf(fp, "\t3:\n"); - fprintf(fp, " # Check for Interrupt waiting\n\n"); - fprintf(fp, "\t\t andi %s,%s,0x07 \t # Delay slot\n", regnameslong[TMPREG0], regnameslong[TMPREG0]); - //fprintf(fp, "\t\t bne %s,$0,interrupt\n", regnameslong[TMPREG0]); - fprintf(fp, "\t\t beq %s,$0,3f\n", regnameslong[TMPREG0]); - fprintf(fp, "\t\t nop \t # Delay slot\n"); - fprintf(fp, "\t\t j interrupt\n"); - fprintf(fp, "\t3:\n"); - /* 16 bit memory */ - fprintf(fp, "\t\t lhu %s,0x00(%s) \t # Delay slot\n", regnameslong[OPCODE], regnameslong[PC]); - - //fprintf(fp, "\t\t jmp [%s_OPCODETABLE+ecx*4]\n\n", CPUtype); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[TMPREG0], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[TMPREG0], regnameslong[TMPREG0], regnameslong[OPCODETBL]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[TMPREG0], regnameslong[TMPREG0]); - fprintf(fp, "\t\t jr %s\n", regnameslong[TMPREG0]); - fprintf(fp, "\t\t nop \t # Delay slot\n\n"); - } else { - - /* 16 bit memory */ - fprintf(fp, "\t\t bgez %s,3f\n", regnameslong[ICNT]); - fprintf(fp, "\t\t lhu %s,0x00(%s) \t # Delay slot\n", regnameslong[OPCODE], regnameslong[PC]); - fprintf(fp, "\t\t j MainExit\n"); - fprintf(fp, "\t3:\n"); - - //fprintf(fp, "\t\t jmp [%s_OPCODETABLE+ecx*4]\n\n", CPUtype); - fprintf(fp, "\t\t sll %s,%s,2 \t # Delay slot\n", regnameslong[TMPREG0], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[TMPREG0], regnameslong[TMPREG0], regnameslong[OPCODETBL]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[TMPREG0], regnameslong[TMPREG0]); - fprintf(fp, "\t\t jr %s\n", regnameslong[TMPREG0]); - fprintf(fp, "\t\t nop \t # Delay slot\n\n"); - } -} -/* - * Flag Routines - */ - -void SetFlags(char Size, int Operand, int Rreg, int Sreg1, int Sreg2) -{ - char* Label; - int Decal; - - assert((Size == 'B') || (Size == 'W') || (Size == 'L')); - assert((Rreg != FLAG_C) && (Rreg != FLAG_V) && (Rreg != FLAG_Z) && (Rreg != FLAG_N) && (Rreg != FLAG_X)); - assert((Sreg1 != FLAG_C) && (Sreg1 != FLAG_V) && (Sreg1 != FLAG_Z) && (Sreg1 != FLAG_N) && (Sreg1 != FLAG_X)); - assert((Sreg2 != FLAG_C) && (Sreg2 != FLAG_V) && (Sreg2 != FLAG_Z) && (Sreg2 != FLAG_N) && (Sreg2 != FLAG_X)); - - Decal = Size == 'L' ? 31 : (Size == 'W' ? 15 : 7); - - switch (Operand) { - - case FLAGS_ADD: - assert((Rreg != T9) && (Rreg != Sreg1) && (Rreg != Sreg2)); - assert((Sreg1 != T9) && (Sreg1 != Sreg2)); - assert(Sreg2 != T9); - fprintf(fp, "\t\t sltu %s,%s,%s \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[Rreg], regnameslong[Sreg2]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[Sreg1], regnameslong[Sreg2]); - fprintf(fp, "\t\t nor %s,$0,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[T9], regnameslong[Rreg], regnameslong[Sreg1]); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], regnameslong[T9]); - fprintf(fp, "\t\t srl %s,%s,%d%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], Decal, Size == 'L' ? " \t # Set Overflow" : ""); - if (Size != 'L') { - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Overflow\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t se%c %s,%s\n", Size == 'W' ? 'h' : 'b', regnameslong[T9], regnameslong[Rreg]); - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[T9]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[T9]); - } else { - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[Rreg]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[Rreg]); - } - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - break; - - case FLAGS_ADDX: - assert((Rreg != T9) && (Rreg != Sreg1) && (Rreg != Sreg2)); - assert((Sreg1 != T9) && (Sreg1 != Sreg2)); - assert(Sreg2 != T9); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T9], regnameslong[Sreg2], regnameslong[FLAG_X]); - fprintf(fp, "\t\t sltu %s,%s,%s \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[Rreg], regnameslong[T9]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[Sreg1], regnameslong[Sreg2]); - fprintf(fp, "\t\t nor %s,$0,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[T9], regnameslong[Rreg], regnameslong[Sreg1]); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], regnameslong[T9]); - fprintf(fp, "\t\t srl %s,%s,%d%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], Decal, Size == 'L' ? " \t # Set Overflow" : ""); - if (Size != 'L') { - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Overflow\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t se%c %s,%s\n", Size == 'W' ? 'h' : 'b', regnameslong[T9], regnameslong[Rreg]); - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[T9]); - fprintf(fp, "\t\t sltiu %s,%s,1\n", regnameslong[T9], regnameslong[T9]); - } else { - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[Rreg]); - fprintf(fp, "\t\t sltiu %s,%s,1\n", regnameslong[T9], regnameslong[Rreg]); - } - fprintf(fp, "\t\t and %s,%s,%s \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z], regnameslong[T9]); - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - break; - - case FLAGS_SUB: - case FLAGS_CMP: - assert((Rreg != T9) && (Rreg != Sreg1) && (Rreg != Sreg2)); - assert((Sreg1 != T9) && (Sreg1 != Sreg2)); - assert(Sreg2 != T9); - fprintf(fp, "\t\t sltu %s,%s,%s \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[Sreg1], regnameslong[Sreg2]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[Sreg1], regnameslong[Sreg2]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[T9], regnameslong[Rreg], regnameslong[Sreg1]); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], regnameslong[T9]); - fprintf(fp, "\t\t srl %s,%s,%d%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], Decal, Size == 'L' ? " \t # Set Overflow" : ""); - if (Size != 'L') { - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Overflow\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t se%c %s,%s\n", Size == 'W' ? 'h' : 'b', regnameslong[T9], regnameslong[Rreg]); - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[T9]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[T9]); - } else { - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[Rreg]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[Rreg]); - } - if (Operand == FLAGS_SUB) - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - break; - - case FLAGS_SUBX: - assert((Rreg != T9) && (Rreg != Sreg1) && (Rreg != Sreg2)); - assert((Sreg1 != T9) && (Sreg1 != Sreg2)); - assert(Sreg2 != T9); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T9], regnameslong[Sreg2], regnameslong[FLAG_X]); - fprintf(fp, "\t\t sltu %s,%s,%s \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[Sreg1], regnameslong[T9]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[Sreg1], regnameslong[Sreg2]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[T9], regnameslong[Rreg], regnameslong[Sreg1]); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], regnameslong[T9]); - fprintf(fp, "\t\t srl %s,%s,%d%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], Decal, Size == 'L' ? " \t # Set Overflow" : ""); - if (Size != 'L') { - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Overflow\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t se%c %s,%s\n", Size == 'W' ? 'h' : 'b', regnameslong[T9], regnameslong[Rreg]); - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[T9]); - fprintf(fp, "\t\t sltiu %s,%s,1\n", regnameslong[T9], regnameslong[T9]); - } else { - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[Rreg]); - fprintf(fp, "\t\t sltiu %s,%s,1\n", regnameslong[T9], regnameslong[Rreg]); - } - fprintf(fp, "\t\t and %s,%s,%s \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z], regnameslong[T9]); - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - break; - - case FLAGS_BITOP: - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Carry\n", regnameslong[FLAG_C]); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[Rreg]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[Rreg]); - break; - - case FLAGS_MOVE: - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Carry\n", regnameslong[FLAG_C]); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t srl %s,%s,%d \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[Rreg], Decal); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[Rreg]); - break; - } -} - -/******************/ -/* Check CPU Type */ -/******************/ - -void CheckCPUtype(int Minimum, char* DelaySlot1, char* DelaySlot2) -{ - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], CPUVERSION); - - if (Minimum == 1) { - //fprintf(fp, "\t\t beq %s,$0,ILLEGAL\n", regnameslong[T9]); - fprintf(fp, "\t\t bne %s,$0,0f\n", regnameslong[T9]); - if (DelaySlot1 && (strlen(DelaySlot1) > 0)) - fprintf(fp, DelaySlot1); - else - fprintf(fp, "\t\t nop \t # Delay slot\n"); - } else { - fprintf(fp, "\t\t addiu %s,%s,%d\n", regnameslong[T9], regnameslong[T9], -Minimum); - //fprintf(fp, "\t\t bltz %s,ILLEGAL\n", regnameslong[T9]); - fprintf(fp, "\t\t bgez %s,0f\n", regnameslong[T9]); - if (DelaySlot1 && (strlen(DelaySlot1) > 0)) - fprintf(fp, DelaySlot1); - else - fprintf(fp, "\t\t nop \t # Delay slot\n"); - } - fprintf(fp, "\t\t j ILLEGAL\n"); - fprintf(fp, "\t0:\n"); - if (DelaySlot2 && (strlen(DelaySlot2) > 0)) - fprintf(fp, DelaySlot2); - else - fprintf(fp, "\t\t nop \t # Delay slot\n\n"); -} - -/************************************/ -/* Pre-Decrement and Post-Increment */ -/************************************/ - -void IncrementEFFADDR(int Size, int Rreg) -{ - assert((T9 != Rreg) && (EFFADDR != Rreg)); - - switch (Size) { - case 66: - - /* Always does Byte Increment - A7 uses special routine */ - - fprintf(fp, "\t\t addiu %s,%s,1\n", regnameslong[T9], regnameslong[EFFADDR]); - break; - - case 87: - - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[T9], regnameslong[EFFADDR]); - break; - - case 76: - - fprintf(fp, "\t\t addiu %s,%s,4\n", regnameslong[T9], regnameslong[EFFADDR]); - break; - } - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[T9], regnameslong[Rreg]); -} - -void DecrementEFFADDR(int Size, int Rreg) -{ - switch (Size) { - case 66: - - /* Always does Byte Increment - A7 uses special routine */ - - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - break; - - case 87: - - fprintf(fp, "\t\t addiu %s,%s,-2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - break; - - case 76: - - fprintf(fp, "\t\t addiu %s,%s,-4\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - break; - } -} - -/* - * Generate an exception - * - * if Number = -1 then assume value in V0 already - * code must continue running afterwards - * - */ - -void Exception(int Number, char* DelaySlot) -{ - if (Number > -1) { - fprintf(fp, "\t\t addiu %s,%s,-2\n", regnameslong[PC], regnameslong[PC]); - fprintf(fp, "\t\t jal Exception\n"); - fprintf(fp, "\t\t ori %s,$0,%d\n\n", regnameslong[V0], Number); - Completed(); - } else { - fprintf(fp, "\t\t jal Exception\n"); - fprintf(fp, "\t\t %s\t # Delay slot\n\n", (DelaySlot != NULL) ? DelaySlot : "nop "); - } -} - -/********************/ -/* Address Routines */ -/********************/ - -/* - * Decode flags into Rreg as SR register - * - */ - -void ReadCCR(char Size, int Rreg) -{ - assert((Rreg != FLAG_C) && (Rreg != FLAG_V) && (Rreg != FLAG_Z) && (Rreg != FLAG_N) && (Rreg != FLAG_X)); - - if (Size == 'W') { - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[Rreg], REG_SRH); - fprintf(fp, "\t\t sll %s,%s,4\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[FLAG_X]); - } else { - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[Rreg], regnameslong[FLAG_X]); - } - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[FLAG_N]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[FLAG_V]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[FLAG_C]); -#ifdef MASKCCR - fprintf(fp, "\t\t andi %s,%s,0xA71F \t # Mask unused bits\n", regnameslong[Rreg], regnameslong[Rreg]); -#endif -} - -/* - * Convert SR into flags - * - * Also handles change of mode from Supervisor to User - * - * n.b. This is also called by EffectiveAddressWrite - */ - -void WriteCCR(char Size, int Sreg) -{ - assert((Sreg != FLAG_C) && (Sreg != FLAG_V) && (Sreg != FLAG_Z) && (Sreg != FLAG_N) && (Sreg != FLAG_X)); - - if (Size == 'W') { - assert(Sreg != T9); - - /* Did we change from Supervisor to User mode ? */ - - fprintf(fp, "\t\t andi %s,%s,0x2000 \t # User Mode ?\n", regnameslong[T9], regnameslong[Sreg]); - fprintf(fp, "\t\t bne %s,$0,0f\n", regnameslong[T9]); - fprintf(fp, "\t\t or %s,$0,%s \t # Delay slot\n", regnameslong[FLAG_Z], regnameslong[Sreg]); - - /* Mode Switch - Update A7 */ - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[FLAG_C], REG_A7); - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[FLAG_V], REG_USP); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[FLAG_C], REG_ISP); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[FLAG_V], REG_A7); - - fprintf(fp, "\t0:\n"); - fprintf(fp, "\t\t srl %s,%s,8\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t sb %s,%s \t # T, S & I\n", regnameslong[FLAG_Z], REG_SRH); - - /* Mask may now allow Interrupt */ - - CheckInterrupt += 1; - } - - /* Flags */ - - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FLAG_X], regnameslong[Sreg]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FLAG_N], regnameslong[Sreg]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FLAG_Z], regnameslong[Sreg]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FLAG_V], regnameslong[Sreg]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FLAG_C], regnameslong[Sreg]); - fprintf(fp, "\t\t andi %s,%s,0x10\n", regnameslong[FLAG_X], regnameslong[FLAG_X]); - fprintf(fp, "\t\t andi %s,%s,0x08\n", regnameslong[FLAG_N], regnameslong[FLAG_N]); - fprintf(fp, "\t\t andi %s,%s,0x04\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t andi %s,%s,0x02\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t andi %s,%s,0x01\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - fprintf(fp, "\t\t srl %s,%s,4\n", regnameslong[FLAG_X], regnameslong[FLAG_X]); - fprintf(fp, "\t\t srl %s,%s,3\n", regnameslong[FLAG_N], regnameslong[FLAG_N]); - fprintf(fp, "\t\t srl %s,%s,2\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t srl %s,%s,1\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); -} - - -/* - * Interface to Mame memory commands - * - * Flags = "ABCDSDB" - set to '-' if not required to preserve - * (order EAX,EBX,ECX,EDX,ESI,EDI,EBP) - * - * AReg = Register containing Address - * - * Mask 0 : No Masking - * 1 : Mask top byte, but preserve register - * 2 : Mask top byte, preserve masked register - */ - -void Memory_Read(char Size, int AReg, char *Flags, int LocalStack) -{ - int i; - - ExternalIO = 1; - - assert(strlen(Flags) == 32); - assert(AReg != T9); - - /* Call Mame memory routine */ - - /* ASG - changed these to call through the function pointers */ - -#ifdef ENCRYPTED - switch (AccessType) { - case NORMAL : - switch (Size) { - case 66 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_READBYTE); - break; - - case 87 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_READWORD); - break; - - case 76 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_READLONG); - break; - } - break; - - case PCREL : - switch (Size) { - case 66 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_READBYTEPC); - break; - - case 87 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_READWORDPC); - break; - - case 76 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_READLONGPC); - break; - } - break; - } - -#else - - switch (Size) { - case 66 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_READBYTE); - break; - - case 87 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_READWORD); - break; - - case 76 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_READLONG); - break; - } -#endif - - /* Save ICount */ - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[ICNT], ICOUNT); - - /* Check to see if registers need saving */ - - for (i = 1; i < sizeof(SavedRegs) - 1; i++) { - if ((i == AT) || (i == T9) || (i == PC) || (i == ICNT) || (i == V0) || (i == BASEPC)) continue; - if ((Flags[i] != '-') && (SavedRegs[i] == '-')) { - LocalStack -= 4; - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[i], LocalStack, regnameslong[SP]); - } - } - assert(LocalStack >= MINSTACK_POS); - - /* Sort Address out */ - if (AReg != FASTCALL_FIRST_REG) - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[AReg]); - - fprintf(fp, "\t\t jalr %s\n", regnameslong[T9]); - - /* Save PC */ - fprintf(fp, "\t\t sw %s,%s \t # Delay slot\n", regnameslong[PC], REG_PC); - - /* Restore registers */ - - /* Check to see if registers need restoring */ - - for (i = sizeof(SavedRegs) - 2; i > 0; --i) { - if ((i == AT) || (i == T9) || (i == PC) || (i == ICNT) || (i == V0) || (i == BASEPC)) continue; - if ((Flags[i] != '-') && (SavedRegs[i] == '-')) { - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[i], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - } - - if ((Flags[PC] != '-') && (SavedRegs[PC] == '-')) { - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[PC], REG_PC); - } - - if ((Flags[BASEPC] != '-') && (SavedRegs[BASEPC] == '-')) { - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[BASEPC], OP_ROM); - } - - // Update ICount - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[ICNT], ICOUNT); -} - -void Memory_Write(char Size, int AReg, int DReg, char *Flags, int LocalStack) -{ - int i; - - ExternalIO = 1; - - assert(strlen(Flags) == 32); - assert((AReg != T9) && (DReg != T9) && (AReg != DReg) && (AReg != FASTCALL_SECOND_REG) && (DReg != FASTCALL_FIRST_REG)); - - /* ASG - changed these to call through the function pointers */ - switch (Size) { - case 66 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_WRITEBYTE); - break; - - case 87 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_WRITEWORD); - break; - - case 76 : - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], PreDecLongMove ? MEMINTF_WRITEWORD : MEMINTF_WRITELONG); - break; - } - - /* Save ICount */ - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[ICNT], ICOUNT); - - /* Check to see if registers need saving */ - - for (i = 1; i < sizeof(SavedRegs) - 1; i++) { - if ((i == AT) || (i == T9) || (i == PC) || (i == ICNT) || (i == BASEPC)) continue; - if ((Flags[i] != '-') && (SavedRegs[i] == '-')) { - LocalStack -= 4; - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[i], LocalStack, regnameslong[SP]); - } - } - - if (PreDecLongMove) { - LocalStack -= 4; - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[DReg], LocalStack, regnameslong[SP]); - LocalStack -= 4; - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[AReg], LocalStack, regnameslong[SP]); - //fprintf(fp, "\t\t andi %s,%s,0xFFFF\n", regnameslong[DReg], regnameslong[DReg]); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[AReg], regnameslong[AReg]); - } - assert(LocalStack >= MINSTACK_POS); - - /* Call Mame Routine */ - - if (DReg != FASTCALL_SECOND_REG) - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[DReg]); - if (AReg != FASTCALL_FIRST_REG) - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[AReg]); - fprintf(fp, "\t\t jalr %s\n", regnameslong[T9]); - /* Save PC */ - fprintf(fp, "\t\t sw %s,%s \t # Delay slot\n", regnameslong[PC], REG_PC); - - if (PreDecLongMove) { - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], MEMINTF_WRITEWORD); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[FASTCALL_FIRST_REG], LocalStack, regnameslong[SP]); - LocalStack += 4; - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[FASTCALL_SECOND_REG], LocalStack, regnameslong[SP]); - LocalStack += 4; - fprintf(fp, "\t\t jalr %s\n", regnameslong[T9]); - fprintf(fp, "\t\t srl %s,%s,16 \t # Delay slot\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[FASTCALL_SECOND_REG]); - } - - /* Restore registers */ - - /* Check to see if registers need restoring */ - - for (i = sizeof(SavedRegs) - 2; i > 0; --i) { - if ((i == AT) || (i == T9) || (i == PC) || (i == ICNT) || (i == BASEPC)) continue; - if ((Flags[i] != '-') && (SavedRegs[i] == '-')) { - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[i], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - } - - if ((Flags[PC] != '-') && (SavedRegs[PC] == '-')) { - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[PC], REG_PC); - } - - if ((Flags[BASEPC] != '-') && (SavedRegs[BASEPC] == '-')) { - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[BASEPC], OP_ROM); - } - - // Update ICount - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[ICNT], ICOUNT); -} - -/* - * Fetch data from Code area - * - * Dreg = Destination Register - * Extend = Sign Extend Byte/Word to Long - * - */ - -void Memory_Fetch(char Size, int Dreg, int Extend) -{ - assert((Dreg != BASEPC) && (Dreg != PC)); - - /* 16 Bit version */ - if (Size == 'B') - fprintf(fp, "\t\t lb%c %s,0x00(%s)\n", Extend ? ' ' : 'u', regnameslong[Dreg], regnameslong[PC]); - else if (Size == 'W') - fprintf(fp, "\t\t lh%c %s,0x00(%s)\n", Extend ? ' ' : 'u', regnameslong[Dreg], regnameslong[PC]); - else if (Size == 'L') { - assert(Dreg != T9); - fprintf(fp, "\t\t lhu %s,0x00(%s)\n", regnameslong[Dreg], regnameslong[PC]); - fprintf(fp, "\t\t lhu %s,0x02(%s)\n", regnameslong[T9], regnameslong[PC]); - fprintf(fp, "\t\t sll %s,%s,16\n", regnameslong[Dreg], regnameslong[Dreg]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[Dreg], regnameslong[Dreg], regnameslong[T9]); - } else { - fprintf(fp, "DUFF CODE (BAD FETCH)!!!\n"); - } -} - -/**********************/ -/* Push PC onto Stack */ -/**********************/ - -void PushPC(char *Flags) -{ -#ifndef KEEPHIGHPC - - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[PC], regnameslong[BASEPC]); - fprintf(fp, "\t\t lw %s,%s \t # Push onto Stack\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - fprintf(fp, "\t\t addiu %s,%s,-4\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[FASTCALL_FIRST_REG]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - - Memory_Write('L', FASTCALL_FIRST_REG, FASTCALL_SECOND_REG, Flags, LocalStack); - -#else - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[FASTCALL_SECOND_REG], FULLPC); - fprintf(fp, "\t\t lui %s,0xFF00\n", regnameslong[T9]); - fprintf(fp, "\t\t lw %s,%s \t # Push onto Stack\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[FASTCALL_SECOND_REG], regnameslong[T9]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T9], regnameslong[PC], regnameslong[BASEPC]); - fprintf(fp, "\t\t addiu %s,%s,-4\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[FASTCALL_FIRST_REG]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[FASTCALL_SECOND_REG], regnameslong[T9]); - - Memory_Write('L', FASTCALL_FIRST_REG, FASTCALL_SECOND_REG, Flags, LocalStack); - -#endif -} - -void ExtensionDecode() -{ - Memory_Fetch('W', TMPREG0, FALSE); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - - /* 68000 Extension */ - - fprintf(fp, "\t\t seb %s,%s\n", regnameslong[TMPREG1], regnameslong[TMPREG0]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[T9], regnameslong[TMPREG0]); - fprintf(fp, "\t\t srl %s,%s,12\n", regnameslong[TMPREG0], regnameslong[TMPREG0]); - fprintf(fp, "\t\t andi %s,%s,0x0800\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[TMPREG0], regnameslong[TMPREG0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[TMPREG0], regnameslong[TMPREG0], regnameslong[MEMBASE]); - fprintf(fp, "\t\t bne %s,$0,0f\n", regnameslong[T9]); - fprintf(fp, "\t\t lw %s,0x00(%s) \t # Delay slot\n", regnameslong[T9], regnameslong[TMPREG0]); - fprintf(fp, "\t\t seh %s,%s\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t0:\n"); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T9], regnameslong[EFFADDR], regnameslong[T9]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[EFFADDR], regnameslong[T9], regnameslong[TMPREG1]); -} - -/* Calculate Effective Address - Return address in T6 - * - * mode = Effective Address from Instruction - * Size = Byte,Word or Long - * Rreg = Register with Register Number in - * - * Only for modes 2 - 10 - */ - -void EffectiveAddressCalculate(int mode, char Size, int Rreg, int Decal, int Add) -{ - assert((Rreg != MEMBASE) && (Rreg != EFFADDR)); - /* timing */ - - if ((TimingCycles > 0) && (AddEACycles != 0)) { - switch (mode) { - case 2: /* (An) */ - case 3: /* (An)+ */ - case 11: /* #x,SR,CCR */ - case 19: /* (A7)+ */ - TimingCycles += 4; - break; - - case 4: /* -(An) */ - case 20: /* -(A7) */ - TimingCycles += 6; - break; - - case 5: /* x(An) */ - case 9: /* x(PC) */ - TimingCycles += 8; - break; - - case 7: /* x.w */ - TimingCycles += 8; - break; - - case 6: /* x(An,xr.s) */ - case 10: /* x(PC,xr.s) */ - TimingCycles += 10; - break; - - case 8: /* x.l */ - TimingCycles += 12; - break; - } - - /* long w/r adds 4 cycles */ - - if ((mode > 1) && (Size == 'L')) - TimingCycles += 4; - } - - AccessType = NORMAL; - - switch (mode) { - - case 2: - if (Add) { - if (Decal) fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[MEMBASE]); - } - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[Rreg]); - break; - - case 3: - if (Add) { - if (Decal) fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[MEMBASE]); - } - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[Rreg]); - IncrementEFFADDR(Size, Rreg); - break; - - case 4: - if (Add) { - if (Decal) fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[MEMBASE]); - } - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[Rreg]); - DecrementEFFADDR(Size, Rreg); - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[Rreg]); - break; - - case 5: - assert((Rreg != PC) && (Rreg != TMPREG0)); - Memory_Fetch('W', TMPREG0, TRUE); - if (Add) { - if (Decal) fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[MEMBASE]); - } - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[Rreg]); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[EFFADDR], regnameslong[EFFADDR], regnameslong[TMPREG0]); - break; - - case 6: - - /* Get Address register Value */ - - if (Add) { - if (Decal) fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[MEMBASE]); - } - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[Rreg]); - - /* Add Extension Details */ - - ExtensionDecode(); - break; - - case 7: - - /* Get Word */ - - Memory_Fetch('W', EFFADDR, TRUE); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - break; - - case 8: - - /* Get Long */ - - Memory_Fetch('L', EFFADDR, FALSE); - fprintf(fp, "\t\t addiu %s,%s,4\n", regnameslong[PC], regnameslong[PC]); - break; - - case 9: - - AccessType = PCREL; - - Memory_Fetch('W', TMPREG0, TRUE); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T9], regnameslong[PC], regnameslong[BASEPC]); - fprintf(fp, "\t\t addu %s,%s,%s \t # Add Offset to PC\n", regnameslong[EFFADDR], regnameslong[T9], regnameslong[TMPREG0]); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - break; - - case 10: - - AccessType = PCREL; - - /* Get PC */ - - fprintf(fp, "\t\t subu %s,%s,%s \t # Get PC\n", regnameslong[EFFADDR], regnameslong[PC], regnameslong[BASEPC]); - - /* Add Extension Details */ - - ExtensionDecode(); - - break; - - case 19: - - /* (A7)+ */ - - fprintf(fp, "\t\t lw %s,%s \t # Get A7\n", regnameslong[EFFADDR], REG_A7); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[T9], regnameslong[EFFADDR]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[T9], REG_A7); - break; - - case 20: - - /* -(A7) */ - - fprintf(fp, "\t\t lw %s,%s \t # Get A7\n", regnameslong[EFFADDR], REG_A7); - fprintf(fp, "\t\t addiu %s,%s,-2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[EFFADDR], REG_A7); - break; - - } -} - -/* Read from Effective Address - * - * mode = Effective Address from Instruction - * Size = Byte,Word or Long - * Rreg = Register with Register Number in - * Flag = Registers to preserve (EDX is handled by SaveEDX) - * Extend = Force sign extension - * - * Return - * Dreg = Register to return result in (V0 is usually most efficient) - * (modes 5 to 10) EFFADDR = Address of data read (masked with FFFFFF) - */ - -void EffectiveAddressRead(int mode, char Size, int Rreg, int Dreg, const char *flags, int Extend, int Decal, int Add) -{ - char* Opcode = ""; - char Flags[33]; - - AccessType = NORMAL; - - strcpy(Flags, flags); - - switch (Size) { - case 66: - if (mode == 1) - Opcode = "DUFF CODE (BAD READ)!!!"; - else if (Extend) - Opcode = "lb "; - else - Opcode = "lbu"; - break; - - case 87: - if (Extend || (mode == 1)) - Opcode = "lh "; - else - Opcode = "lhu"; - break; - - case 76: - Opcode = "lw "; - break; - } - - switch (mode & 15) { - - case 0: - - /* Read 32 bits - No prefix */ - - if (Add) { - if (Decal) fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[MEMBASE]); - } - fprintf(fp, "\t\t %s %s,0x00(%s)\n", Opcode, regnameslong[Dreg], regnameslong[Rreg]); - break; - - case 1: - - /* Read 32 bits - No prefix */ - - if (Add) { - if (Decal) fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[MEMBASE]); - } - fprintf(fp, "\t\t %s %s,0x20(%s)\n", Opcode, regnameslong[Dreg], regnameslong[Rreg]); - break; - - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - EffectiveAddressCalculate(mode, Size, Rreg, Decal, Add); - - Memory_Read(Size, EFFADDR, Flags, LocalStack); - - if (Extend && (Size == 'B' || Size == 'W')) { - fprintf(fp, "\t\t se%c %s,%s\n", Size == 'W' ? 'h' : 'b', regnameslong[Dreg], regnameslong[V0]); - } else if (Dreg != V0) { - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[Dreg], regnameslong[V0]); - } - break; - - case 11: - - /* Immediate - for SR or CCR see ReadCCR() */ - - if (Size == 'L') { - Memory_Fetch('L', Dreg, FALSE); - fprintf(fp, "\t\t addiu %s,%s,4\n", regnameslong[PC], regnameslong[PC]); - } else { - Memory_Fetch(Size, Dreg, Extend); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - } - break; - } -} - -/* - * EA = Effective Address from Instruction - * Size = Byte,Word or Long - * Rreg = Register with Register Number in - * - * Writes from V0 - */ - -void EffectiveAddressWrite(int mode, char Size, int Rreg, int CalcAddress, const char *flags, int Decal, int Add) -{ - char* Opcode = ""; - char Flags[33]; - - strcpy(Flags, flags); - - switch (Size) { - case 66: - Opcode = "sb"; - break; - - case 87: - Opcode = "sh"; - break; - - case 76: - Opcode = "sw"; - break; - } - - switch (mode & 15) { - - case 0: - if (Add) { - if (Decal) fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[MEMBASE]); - } - fprintf(fp, "\t\t %s %s,0x00(%s)\n", Opcode, regnameslong[V0], regnameslong[Rreg]); - break; - - case 1: - if (Size == 'B') { - /* Not Allowed */ - - fprintf(fp, "DUFF CODE (BAD WRITE)!\n"); - } else { - if (Size == 'W') { - fprintf(fp, "\t\t seh %s,%s\n", regnameslong[V0], regnameslong[V0]); - } - - if (Add) { - if (Decal) fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[Rreg], regnameslong[Rreg]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Rreg], regnameslong[Rreg], regnameslong[MEMBASE]); - } - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[V0], regnameslong[Rreg]); - } - break; - - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - if (CalcAddress) EffectiveAddressCalculate(mode, Size, Rreg, Decal, Add); - Memory_Write(Size, EFFADDR, V0, Flags, LocalStack); - break; - - case 11: - - if (Size == 'L') fprintf(fp, "DUFF CODE (BAD WRITE)!\n"); - - /* SR, CCR - Chain to correct routine */ - - WriteCCR(Size, V0); - } -} - -/* Condition Decode Routines */ - -/* - * mode = condition to check for - * - * Returns LABEL that is jumped to if condition is Condition - * - */ - -char* ConditionDecode(int mode, int Condition, int NOP) -{ - char *Label = GenerateLabel(0, 1); - - Label[0] = '1'; - Label[1] = 0; - - switch (mode) { - - case 0: /* A - Always */ - if (Condition) { - fprintf(fp, "\t\t bgez $0,%sf\n", Label); - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - } - break; - - case 1: /* F - Never */ - if (!Condition) { - fprintf(fp, "\t\t bgez $0,%sf\n", Label); - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - } - break; - - case 2: /* Hi */ - fprintf(fp, "\t\t nor %s,%s,%s\n", regnameslong[T9], regnameslong[FLAG_C], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t andi %s,%s,1\n", regnameslong[T9], regnameslong[T9]); - if (Condition) { - fprintf(fp, "\t\t bne %s,$0,%sf\n", regnameslong[T9], Label); - } else { - fprintf(fp, "\t\t beq %s,$0,%sf\n", regnameslong[T9], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 3: /* Ls */ - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[T9], regnameslong[FLAG_C], regnameslong[FLAG_Z]); - if (Condition) { - fprintf(fp, "\t\t bne %s,$0,%sf\n", regnameslong[T9], Label); - } else { - fprintf(fp, "\t\t beq %s,$0,%sf\n", regnameslong[T9], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 4: /* CC */ - if (Condition) { - fprintf(fp, "\t\t beq %s,$0,%sf \t # check carry\n", regnameslong[FLAG_C], Label); - } else { - fprintf(fp, "\t\t bne %s,$0,%sf \t # check carry\n", regnameslong[FLAG_C], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 5: /* CS */ - if (Condition) { - fprintf(fp, "\t\t bne %s,$0,%sf \t # check carry\n", regnameslong[FLAG_C], Label); - } else { - fprintf(fp, "\t\t beq %s,$0,%sf \t # check carry\n", regnameslong[FLAG_C], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 6: /* NE */ - if (Condition) { - fprintf(fp, "\t\t beq %s,$0,%sf \t # Check zero\n", regnameslong[FLAG_Z], Label); - } else { - fprintf(fp, "\t\t bne %s,$0,%sf \t # Check zero\n", regnameslong[FLAG_Z], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 7: /* EQ */ - if (Condition) { - fprintf(fp, "\t\t bne %s,$0,%sf \t # Check zero\n", regnameslong[FLAG_Z], Label); - } else { - fprintf(fp, "\t\t beq %s,$0,%sf \t # Check zero\n", regnameslong[FLAG_Z], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 8: /* VC */ - if (Condition) { - fprintf(fp, "\t\t beq %s,$0,%sf \t # Check Overflow\n", regnameslong[FLAG_V], Label); - } else { - fprintf(fp, "\t\t bne %s,$0,%sf \t # Check Overflow\n", regnameslong[FLAG_V], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 9: /* VS */ - if (Condition) { - fprintf(fp, "\t\t bne %s,$0,%sf \t # Check Overflow\n", regnameslong[FLAG_V], Label); - } else { - fprintf(fp, "\t\t beq %s,$0,%sf \t # Check Overflow\n", regnameslong[FLAG_V], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 10: /* PL */ - if (Condition) { - fprintf(fp, "\t\t beq %s,$0,%sf \t # Check Sign\n", regnameslong[FLAG_N], Label); - } else { - fprintf(fp, "\t\t bne %s,$0,%sf \t # Check Sign\n", regnameslong[FLAG_N], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 11: /* MI */ - if (Condition) { - fprintf(fp, "\t\t bne %s,$0,%sf \t # Check Sign\n", regnameslong[FLAG_N], Label); - } else { - fprintf(fp, "\t\t beq %s,$0,%sf \t # Check Sign\n", regnameslong[FLAG_N], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 12: /* GE */ - if (Condition) { - fprintf(fp, "\t\t beq %s,%s,%sf\n", regnameslong[FLAG_N], regnameslong[FLAG_V], Label); - } else { - fprintf(fp, "\t\t bne %s,%s,%sf\n", regnameslong[FLAG_N], regnameslong[FLAG_V], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 13: /* LT */ - if (Condition) { - fprintf(fp, "\t\t bne %s,%s,%sf\n", regnameslong[FLAG_N], regnameslong[FLAG_V], Label); - } else { - fprintf(fp, "\t\t beq %s,%s,%sf\n", regnameslong[FLAG_N], regnameslong[FLAG_V], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 14: /* GT */ - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[T9], regnameslong[FLAG_N], regnameslong[FLAG_V]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[T9], regnameslong[T9], regnameslong[FLAG_Z]); - if (Condition) { - fprintf(fp, "\t\t beq %s,$0,%sf\n", regnameslong[T9], Label); - } else { - fprintf(fp, "\t\t bne %s,$0,%sf\n", regnameslong[T9], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - - case 15: /* LE */ - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[T9], regnameslong[FLAG_N], regnameslong[FLAG_V]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[T9], regnameslong[T9], regnameslong[FLAG_Z]); - if (Condition) { - fprintf(fp, "\t\t bne %s,$0,%sf\n", regnameslong[T9], Label); - } else { - fprintf(fp, "\t\t beq %s,$0,%sf\n", regnameslong[T9], Label); - } - if (NOP) fprintf(fp, "\t\t nop \t # Delay slot\n"); - break; - } - - return Label; -} - -/* - * mode = condition to check for - * - * result in V0 - */ - -void ConditionCheck(int mode, int SetWhat) -{ - switch (mode) { - - case 0: /* A - Always */ - fprintf(fp, "\t\t addiu %s,$0,-1\n", regnameslong[SetWhat]); - break; - - case 1: /* F - Never */ - ClearRegister(SetWhat); - break; - - case 2: /* Hi */ - fprintf(fp, "\t\t nor %s,%s,%s\n", regnameslong[SetWhat], regnameslong[FLAG_C], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t andi %s,%s,1\n", regnameslong[SetWhat], regnameslong[SetWhat]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 3: /* Ls */ - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[SetWhat], regnameslong[FLAG_C], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 4: /* CC */ - fprintf(fp, "\t\t xori %s,%s,1 \t # Check Carry\n", regnameslong[SetWhat], regnameslong[FLAG_C]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 5: /* CS */ - fprintf(fp, "\t\t or %s,$0,%s \t # Check Carry\n", regnameslong[SetWhat], regnameslong[FLAG_C]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 6: /* NE */ - fprintf(fp, "\t\t xori %s,%s,1 \t # Check Zero\n", regnameslong[SetWhat], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 7: /* EQ */ - fprintf(fp, "\t\t or %s,$0,%s \t # Check Zero\n", regnameslong[SetWhat], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 8: /* VC */ - fprintf(fp, "\t\t xori %s,%s,1 \t # Check Overflow\n", regnameslong[SetWhat], regnameslong[FLAG_V]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 9: /* VS */ - fprintf(fp, "\t\t or %s,$0,%s \t # Check Overflow\n", regnameslong[SetWhat], regnameslong[FLAG_V]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 10: /* PL */ - fprintf(fp, "\t\t xori %s,%s,1 \t # Check Sign\n", regnameslong[SetWhat], regnameslong[FLAG_N]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 11: /* MI */ - fprintf(fp, "\t\t or %s,$0,%s \t # Check Sign\n", regnameslong[SetWhat], regnameslong[FLAG_N]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 12: /* GE */ - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[SetWhat], regnameslong[FLAG_N], regnameslong[FLAG_V]); - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 13: /* LT */ - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[SetWhat], regnameslong[FLAG_N], regnameslong[FLAG_V]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 14: /* GT */ - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[SetWhat], regnameslong[FLAG_N], regnameslong[FLAG_V]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[SetWhat], regnameslong[SetWhat], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - - case 15: /* LE */ - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[SetWhat], regnameslong[FLAG_N], regnameslong[FLAG_V]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[SetWhat], regnameslong[SetWhat], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[SetWhat], regnameslong[SetWhat]); - break; - } -} - -/**********************************************************************/ -/* Instructions - Each routine generates a range of instruction codes */ -/**********************************************************************/ - -/* - * Immediate Commands - * - * ORI 00xx - * ANDI 02xx - * SUBI 04xx - * ADDI 06xx - * EORI 0axx - * CMPI 0cxx - * - */ - -void dump_imm(int type, int leng, int mode, int sreg) -{ - int Opcode, BaseCode, OpType; - char Size = ' '; - char * OpcodeName[16] = {"or ", "and ", "subu", "addu", 0, "xor ", "subu", 0} ; - int allow[] = {1,0,1,1, 1,1,1,1, 1,0,0,0, 0,0,0,0, 0,0,0,1, 1} ; - char flags[] = "---------------------SSS----G-F-"; - - Opcode = (type << 9) | ( leng << 6 ) | ( mode << 3 ) | sreg; - - BaseCode = Opcode & 0xfff8; - - if (mode == 7) BaseCode |= sreg ; - - if ((leng == 0) && (sreg == 7) && (mode > 2) && (mode < 5)) { - BaseCode |= sreg ; - } - - if (type != 4) { /* Not Valid (for this routine) */ - int Dest = EAtoAMN(Opcode, FALSE); - int SetX; - - /* ADDI & SUBI also set X flag */ - - SetX = ((type == 2) || (type == 3)); - - switch (type) { - case 0: - case 1: - case 5: - OpType = FLAGS_BITOP; - break; - case 2: - OpType = FLAGS_SUB; - break; - case 3: - OpType = FLAGS_ADD; - break; - case 6: - OpType = FLAGS_CMP; - break; - } - - switch (leng) { - case 0: - Size = 'B'; - break; - case 1: - Size = 'W'; - break; - case 2: - Size = 'L'; - break; - } - - if (allow[Dest]) { - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if (!SetX) flags[FLAG_X] = 'S'; - - /* Save Previous PC if Memory Access */ - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (mode < 2) { - if (Size != 'L') - TimingCycles += 8; - else { - TimingCycles += 14; - if ((type != 1) && (type!=6)) - TimingCycles += 2; - } - } else { - if (type != 6) { - if (Size != 'L') - TimingCycles += 12; - else - TimingCycles += 20; - } else { - if (Size != 'L') - TimingCycles += 8; - else - TimingCycles += 12; - } - } - - if (Dest < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - if (Dest < 2) flags[OPCODE] = 'T'; - } - - /* Immediate Mode Data */ - EffectiveAddressRead(11, Size, T0, T0, flags, TRUE, FALSE, FALSE); - - /* Source Data */ - flags[T0] = 'T'; - if (Dest > 1 && type != 6) flags[EFFADDR] = 'T'; - EffectiveAddressRead(Dest, Size, OPCODE, SetX ? T1 : V0, flags, TRUE, TRUE, TRUE); - - /* The actual work */ - fprintf(fp, "\t\t %s %s,%s,%s\n", OpcodeName[type], regnameslong[type == 6 ? T1 : V0], regnameslong[SetX ? T1 : V0], regnameslong[T0]); - - SetFlags(Size, OpType, type == 6 ? T1 : V0, SetX ? T1 : V0, T0); - - if (type != 6) { /* CMP no update */ - flags[OPCODE] = '-'; - flags[T0] = '-'; - flags[EFFADDR] = '-'; - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - flags[FLAG_X] = 'S'; - EffectiveAddressWrite(Dest, Size, OPCODE, FALSE, flags, FALSE, FALSE); - } - - Completed(); - } - } else { - /* Logicals are allowed to alter SR/CCR */ - - if ((!SetX) && (Dest == 11) && (Size != 'L') && (type != 6)) { - Align(); - - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - if (Size != 'W') { - // Will be added in the delay slot for 16bit access - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - } - TimingCycles += 20 ; - - if (Size == 'W') { - /* If SR then must be in Supervisor Mode */ - - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T0], REG_SRH); - fprintf(fp, "\t\t andi %s,%s,0x20 \t # Supervisor Mode ?\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t bne %s,$0,9f\n", regnameslong[T0]); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n\n", regnameslong[PC], regnameslong[PC]); - - /* User Mode - Exception */ - - Exception(8, NULL); - - fprintf(fp, "\t9:\n"); - } - - /* Immediate Mode Data */ - EffectiveAddressRead(11, Size, T0, T0, flags, FALSE, FALSE, FALSE); - - ReadCCR(Size, V0); - - fprintf(fp, "\t\t %s %s,%s,%s\n", OpcodeName[type], regnameslong[V0], regnameslong[V0], regnameslong[T0]); - - WriteCCR(Size, V0); - - Completed(); - } else { - - /* Illegal Opcode */ - - OpcodeArray[BaseCode] = -1; - BaseCode = -1; - } - } - } else { - BaseCode = -2; - } - - OpcodeArray[Opcode] = BaseCode; -} - -void immediate(void) -{ - int type, size, mode, sreg ; - - for (type = 0 ; type < 0x7; type++) - for (size = 0 ; size < 3 ; size++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dump_imm( type, size, mode, sreg ) ; -} - - -/* - * Bitwise Codes - * - */ - -void dump_bit_dynamic( int sreg, int type, int mode, int dreg ) -{ - int Opcode, BaseCode ; - char Size ; - char allow[] = "0-2345678-------" ; - char flags[] = "----------------SSSSSSSS----G-F-"; - int Dest ; - - /* BTST allows x(PC) and x(PC,xr.s) - others do not */ - - if (type == 0) - { - allow[9] = '9'; - allow[10] = 'a'; - allow[11] = 'b'; // dave fix to nhl - } - - Opcode = 0x0100 | (sreg << 9) | (type << 6) | (mode << 3) | dreg ; - - BaseCode = Opcode & 0x01f8 ; - if (mode == 7) BaseCode |= dreg ; - - - // A7+, A7- - - if ((mode > 2) && (mode < 5)) { - if (dreg == 7) BaseCode |= dreg; - } - - Dest = EAtoAMN(Opcode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (mode == 0) {/* long*/ - Size = 'L' ; - } else { - Size = 'B' ; - } - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - /* Save Previous PC if Memory Access */ - - if ((Dest >= 2) && (Dest <=10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (mode < 2) { - switch (type) { - case 0: - TimingCycles += 6 ; - break; - case 1: - case 3: - TimingCycles += 8 ; - break; - case 2: - TimingCycles += 10; - break; - } - } else { - if (type == 0) - TimingCycles += 4; - else - TimingCycles += 8; - } - - /* Only need this sorted out if a register is involved */ - - if (Dest < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - } - - /* Get bit number and create mask in T1 */ - - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[FLAG_Z], regnameslong[OPCODE]); - - fprintf(fp,"\t\t ori %s,$0,1\n", regnameslong[T2]); - - if (Size != 'L') - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - //else - // fprintf(fp, "\t\t andi %s,%s,0x1F\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - - fprintf(fp,"\t\t sllv %s,%s,%s\n", regnameslong[T1], regnameslong[T2], regnameslong[FLAG_Z]); - - if (mode != 0) { - flags[T1] = 'T'; - flags[EFFADDR] = 'T'; - EffectiveAddressRead(Dest, Size, T0, V0, flags, FALSE, TRUE, TRUE); - } else { - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[MEMBASE]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[V0], regnameslong[T0]); - } - - - /* All commands copy existing bit to Zero Flag */ - - fprintf(fp,"\t\t and %s,%s,%s\n", regnameslong[T2], regnameslong[T1], regnameslong[V0]); - fprintf(fp,"\t\t srlv %s,%s,%s\n", regnameslong[FLAG_Z], regnameslong[T2], regnameslong[FLAG_Z]); - fprintf(fp,"\t\t xori %s,%s,1 \t # Set Zero Flag\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - - /* Some then modify the data */ - - switch (type) { - case 0: /* btst*/ - break; - - case 1: /* bchg*/ - fprintf(fp,"\t\t xor %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - break; - - case 2: /* bclr*/ - fprintf(fp,"\t\t nor %s,$0,%s\n", regnameslong[T1], regnameslong[T1]); - fprintf(fp,"\t\t and %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - break; - - case 3: /* bset*/ - fprintf(fp,"\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - break; - } - - if (type != 0) { - if (mode != 0) { - flags[T0] = '-'; - flags[T1] = '-'; - flags[EFFADDR] = '-'; - EffectiveAddressWrite(Dest, Size, T0, FALSE, flags, FALSE, FALSE); - } else { - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[T0]); - } - } - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void bitdynamic(void) /* dynamic non-immediate bit operations*/ -{ - int type, sreg, mode, dreg ; - - for (sreg = 0 ; sreg < 8 ; sreg++) - for (type = 0 ; type < 4 ; type++) - for (mode = 0 ; mode < 8 ;mode++) - for (dreg = 0 ; dreg < 8 ;dreg++) - dump_bit_dynamic( sreg, type, mode, dreg ) ; -} - -void dump_bit_static(int type, int mode, int dreg) -{ - int Opcode, BaseCode; - char Size; - char allow[] = "0-2345678-------"; - char flags[] = "----------------SSSSSSSS----G-F-"; - int Dest; - - /* BTST allows x(PC) and x(PC,xr.s) - others do not */ - - if (type == 0) { - allow[9] = '9'; - allow[10] = 'a'; - } - - Opcode = 0x0800 | (type << 6) | (mode << 3) | dreg ; - BaseCode = Opcode & 0x08f8 ; - if (mode == 7) BaseCode |= dreg ; - - // A7+, A7- - - if ((mode > 2) && (mode < 5)) { - if (dreg == 7) BaseCode |= dreg; - } - - Dest = EAtoAMN(Opcode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (mode == 0) { /* long*/ - /* Modify register memory directly */ - Size = 'L' ; - } else { - Size = 'B' ; - } - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - /* Save Previous PC if Memory Access */ - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (mode < 2) { - switch (type) { - case 0: - TimingCycles += 10; - break ; - case 1: - case 3: - TimingCycles += 12; - break ; - case 2: - TimingCycles += 14; - break ; - } - } else { - if (type != 0) - TimingCycles += 12; - else - TimingCycles += 8; - } - - /* Only need this sorted out if a register is involved */ - - if (Dest < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - } - - /* Get bit number and create mask in T1 */ - - Memory_Fetch('W', FLAG_Z, FALSE); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - - if (Size != 'L') - fprintf(fp, "\t\t and %s,%s,0x07\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - //else - // fprintf(fp, "\t\t and %s,%s,0x1F\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - - fprintf(fp,"\t\t ori %s,$0,1\n", regnameslong[T2]); - - fprintf(fp,"\t\t sllv %s,%s,%s\n", regnameslong[T1], regnameslong[T2], regnameslong[FLAG_Z]); - - if (mode != 0) { - flags[T1] = 'T'; - flags[EFFADDR] = 'T'; - EffectiveAddressRead(Dest, Size, T0, V0, flags, FALSE, TRUE, TRUE); - } else { - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[MEMBASE]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[V0], regnameslong[T0]); - } - - /* All commands copy existing bit to Zero Flag */ - - fprintf(fp,"\t\t and %s,%s,%s\n", regnameslong[T2], regnameslong[T1], regnameslong[V0]); - fprintf(fp,"\t\t srlv %s,%s,%s\n", regnameslong[FLAG_Z], regnameslong[T2], regnameslong[FLAG_Z]); - fprintf(fp,"\t\t xori %s,%s,1 \t # Set Zero Flag\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - - /* Some then modify the data */ - - switch (type) { - case 0: /* btst*/ - break; - - case 1: /* bchg*/ - fprintf(fp,"\t\t xor %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - break; - - case 2: /* bclr*/ - fprintf(fp,"\t\t nor %s,$0,%s\n", regnameslong[T1], regnameslong[T1]); - fprintf(fp,"\t\t and %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - break; - - case 3: /* bset*/ - fprintf(fp,"\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - break; - } - - if (type != 0) { - if (mode != 0) { - flags[T0] = '-'; - flags[T1] = '-'; - flags[EFFADDR] = '-'; - EffectiveAddressWrite(Dest, Size, T0, FALSE, flags, FALSE, FALSE); - } else { - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[T0]); - } - } - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - - -void bitstatic(void) /* static non-immediate bit operations*/ -{ - int type, mode, dreg ; - - for (type = 0 ; type < 4 ; type++) - for (mode = 0 ; mode < 8 ;mode++) - for (dreg = 0 ; dreg < 8 ;dreg++) - dump_bit_static( type, mode, dreg ) ; -} - -/* - * Move Peripheral - * - */ - -void movep(void) -{ - int sreg, dir, leng, dreg; - int Opcode, BaseCode; - char flags[] = "---------------------SSS----G-F-"; - - for (sreg = 0 ; sreg < 8 ; sreg++) { - for (dir = 0 ; dir < 2 ; dir++) { - for (leng = 0 ; leng < 2 ; leng++) { - for (dreg = 0 ; dreg < 8 ; dreg++) { - Opcode = 0x0108 | (sreg << 9) | (dir << 7) | (leng << 6) | dreg; - BaseCode = Opcode & 0x01c8; - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - SavePreviousPC(); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (leng == 0) /* word */ - TimingCycles += 16 ; - else - TimingCycles += 24 ; - - /* Save Flags Registers (so we only do it once) */ - - if (SavedRegs[FLAG_C] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_V] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_Z] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_N] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_X] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], LocalStack, regnameslong[SP]); - } - assert(LocalStack >= MINSTACK_POS); - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - - /* Get Address to Read/Write in EFFADDR */ - - EffectiveAddressCalculate(5, 'L', T0, TRUE, TRUE); - - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - - if (dir == 0) { /* from memory to register*/ - flags[OPCODE] = 'T'; - flags[EFFADDR] = 'T'; - Memory_Read('B', EFFADDR, flags, LocalStack); - fprintf(fp, "\t\t sll %s,%s,8\n", regnameslong[T0], regnameslong[V0]); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - flags[T0] = 'T'; - if (leng == 0) flags[EFFADDR] = '-'; /* word d(Ax) into Dx.W*/ - Memory_Read('B', EFFADDR, flags, LocalStack); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[V0]); - - if (leng == 0) { /* word d(Ax) into Dx.W*/ - fprintf(fp, "\t\t sh %s,0x00(%s)\n", regnameslong[T0], regnameslong[OPCODE]); - } else { /* long d(Ax) into Dx.L*/ - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - fprintf(fp, "\t\t sll %s,%s,16\n", regnameslong[T0], regnameslong[V0]); - Memory_Read('B', EFFADDR, flags, LocalStack); - fprintf(fp, "\t\t sll %s,%s,8\n", regnameslong[T1], regnameslong[V0]); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - flags[EFFADDR] = '-'; - Memory_Read('B', EFFADDR, flags, LocalStack); - flags[OPCODE] = '-'; - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[T1]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[V0]); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[T0], regnameslong[OPCODE]); - } - } else { /* Register to Memory*/ - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - /* Move bytes into Line */ - - if (leng == 1) - fprintf(fp,"\t\t sll %s,%s,24\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[OPCODE]); - else - fprintf(fp,"\t\t sll %s,%s,8\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[OPCODE]); - - flags[OPCODE] = 'T'; - flags[EFFADDR] = 'T'; - Memory_Write('B', EFFADDR, FASTCALL_SECOND_REG, flags, LocalStack); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - if (leng == 1) /* long*/ - fprintf(fp, "\t\t sll %s,%s,16\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[OPCODE]); - else - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[OPCODE]); - - if (leng == 1) { /* long*/ - Memory_Write('B', EFFADDR, FASTCALL_SECOND_REG, flags, LocalStack); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - fprintf(fp, "\t\t sll %s,%s,8\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[OPCODE]); - Memory_Write('B', EFFADDR, FASTCALL_SECOND_REG, flags, LocalStack); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[OPCODE]); - } - flags[OPCODE] = '-'; - flags[EFFADDR] = '-'; - Memory_Write('B', EFFADDR, FASTCALL_SECOND_REG, flags, LocalStack); - } - - if (SavedRegs[FLAG_X] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_N] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_Z] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_V] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_C] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } - } - } -} - -void movecodes(int allowfrom[], int allowto[], int Start, char Size) /* MJC */ -{ - int Opcode; - int Src, Dest; - int BaseCode; - char flags[] = "--------------------SSSS----G-F-"; - - for (Opcode = Start; Opcode < Start + 0x1000; Opcode++) { - /* Mask our Registers */ - - BaseCode = Opcode & (Start + 0x1f8); - - /* Unless Mode = 7 */ - - if ((BaseCode & 0x38) == 0x38) BaseCode |= (Opcode & 7); - if ((BaseCode & 0x1c0) == 0x1c0) BaseCode |= (Opcode & 0xE00); - - /* If mode = 3 or 4 and Size = byte and register = A7 */ - /* then make it a separate code */ - - if (Size == 'B') { - if (((Opcode & 0x3F) == 0x1F) || ((Opcode & 0x3F) == 0x27)) { - BaseCode |= 0x07; - } - - if (((Opcode & 0xFC0) == 0xEC0) || ((Opcode & 0xFC0) == 0xF00)) { - BaseCode |= 0x0E00; - } - } - - /* If Source = Data or Address register - combine into same routine */ - - if (((Opcode & 0x38) == 0x08) && (allowfrom[1])) { - BaseCode &= 0xfff7; - } - - if (OpcodeArray[BaseCode] == -2) { - Src = EAtoAMN(Opcode, FALSE); - Dest = EAtoAMN(Opcode >> 6, TRUE); - - if ((allowfrom[(Src & 15)]) && (allowto[(Dest & 15)])) { - /* If we are not going to calculate the flags */ - /* we need to preserve the existing ones */ - - if (Dest == 1) { - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - } else { - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - } - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Size == 'L') && ((Dest & 15) == 4)) - PreDecLongMove = 1; - - if (((Src >= 2) && (Src <= 10)) || ((Dest >= 2) && (Dest <= 10))) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - - TimingCycles += 4 ; - - if (Dest < 7) flags[OPCODE] = 'T'; - if (Src < 7) { - if ((Src == 0) && allowfrom[1]) - fprintf(fp, "\t\t and %s,%s,0x0f\n", regnameslong[T0], regnameslong[OPCODE]); - else - fprintf(fp, "\t\t and %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - } - EffectiveAddressRead(Src, Size, T0, V0, flags, FALSE, TRUE, TRUE); - - /* No flags if Destination Ax */ - - if (Dest != 1) { - SetFlags(Size, FLAGS_MOVE, V0, 0, 0); - } - - if (Dest < 7) { - flags[OPCODE] = '-'; - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - if (Dest != 1) { - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - } - EffectiveAddressWrite(Dest, Size, OPCODE, TRUE, flags, FALSE, TRUE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - - Completed(); - } else { - BaseCode = -1; /* Invalid Code */ - } - } else { - BaseCode = OpcodeArray[BaseCode]; - } - - if (OpcodeArray[Opcode] < 0) - OpcodeArray[Opcode] = BaseCode; - } -} - -void moveinstructions(void) -{ - int allowfrom[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}; - int allowto[] = {1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}; - - /* For Byte */ - - movecodes(allowfrom, allowto, 0x1000, 'B'); - - /* For Word & Long */ - - allowto[1] = 1; - movecodes(allowfrom, allowto, 0x2000, 'L'); - movecodes(allowfrom, allowto, 0x3000, 'W'); -} - -/* - * - * Opcodes 5### - * - * ADDQ,SUBQ,Scc and DBcc - * - */ - -void opcode5(void) -{ - /* ADDQ,SUBQ,Scc and DBcc */ - - int allowtoScc[] = {1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}; - int allowtoADDQ[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}; - int Opcode, BaseCode; - char Label[32]; - char Label2[32]; - char Size = ' '; - char OpSize = ' '; - char flags[] = "---------------------SSS----G-F-"; - - for (Opcode = 0x5000; Opcode < 0x6000; Opcode++) { - if ((Opcode & 0xc0) == 0xc0) { - /* Scc or DBcc */ - - BaseCode = Opcode & 0x5FF8; - if ((BaseCode & 0x38) == 0x38) BaseCode |= (Opcode & 7); - - /* If mode = 3 or 4 and register = A7 */ - /* then make it a separate code */ - - if (((Opcode & 0x3F) == 0x1F) || ((Opcode & 0x3F) == 0x27)) { - BaseCode |= 0x07; - } - - if (OpcodeArray[BaseCode] == -2) { - OpcodeArray[BaseCode] = BaseCode; - - if ((BaseCode & 0x38) == 0x8) { - /* DBcc */ - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - TimingCycles += 10 ; - - - strcpy(Label, GenerateLabel(BaseCode, 1)); - strcpy(Label2, ConditionDecode((Opcode >> 8) & 0x0F, TRUE, FALSE)); - - /* False - Decrement Counter - Loop if not -1 */ - - fprintf(fp, "\t\t andi %s,%s,0x07%s\n", regnameslong[OPCODE], regnameslong[OPCODE], ((Opcode >> 8) & 0x0F) == 1 ? "" : " \t # Delay slot"); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t lhu %s,0x00(%s)\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[T1], regnameslong[T0]); - fprintf(fp, "\t\t beq %s,$0,9f \t # Is it -1\n", regnameslong[T0]); - fprintf(fp, "\t\t sh %s,0x00(%s) \t # Delay slot\n\n", regnameslong[T1], regnameslong[OPCODE]); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - Memory_Fetch('W', V0, TRUE); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[PC], regnameslong[PC], regnameslong[V0]); - Completed(); - - /* True - Exit Loop */ - fprintf(fp, "\t9:\n"); - - fprintf(fp, "\t%s:\n", Label2); - fprintf(fp, "\t\t addiu %s,%s,4\n\n", regnameslong[PC], regnameslong[PC]); - TimingCycles += 2 ; - - Completed(); - } else { - /* Scc */ - - int Dest = EAtoAMN(Opcode, FALSE); - - if (allowtoScc[(Dest & 15)]) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (Dest > 1) - TimingCycles += 8; - else - TimingCycles += 4; - - if (Dest < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - if (Dest > 1) { - EffectiveAddressCalculate(Dest, 'B', OPCODE, TRUE, TRUE); - } - - ConditionCheck((Opcode >> 8) & 0x0F, V0); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - flags[FLAG_X] = 'S'; - EffectiveAddressWrite(Dest, 'B', OPCODE, FALSE, flags, TRUE, TRUE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - flags[FLAG_X] = '-'; - - /* take advantage of V0 being 0 for false, -1 for true */ - /* need to add 2 cycles if register and condition is true */ - - if (Dest == 0) { - fprintf(fp, "\t\t andi %s,%s,0x02\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t addiu %s,%s,%d\n", regnameslong[ICNT], regnameslong[ICNT], -TimingCycles); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[ICNT], regnameslong[ICNT], regnameslong[V0]); - - TimingCycles = -1; - } - Completed(); - } else { - OpcodeArray[BaseCode] = -1; - BaseCode = -1; - } - } - } else { - BaseCode = OpcodeArray[BaseCode]; - } - - OpcodeArray[Opcode] = BaseCode; - } else { - /* ADDQ or SUBQ */ - - BaseCode = Opcode & 0x51F8; - if ((BaseCode & 0x38) == 0x38) BaseCode |= (Opcode & 7); - - /* Special for Address Register Direct - Force LONG */ - - if ((Opcode & 0x38) == 0x8) BaseCode = ((BaseCode & 0xFF3F) | 0x80); - - - /* If mode = 3 or 4 and Size = byte and register = A7 */ - /* then make it a separate code */ - - if ((Opcode & 0xC0) == 0) { - if (((Opcode & 0x3F) == 0x1F) || ((Opcode & 0x3F) == 0x27)) { - BaseCode |= 0x07; - } - } - - if (OpcodeArray[BaseCode] == -2) { - char *Operation; - int Dest = EAtoAMN(Opcode, FALSE); - int SaveEDX = (Dest == 1); - - flags[FLAG_C] = 'S'; - if (SaveEDX) { - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - flags[FLAG_X] = 'S'; - } else { - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - flags[FLAG_X] = '-'; - } - - if (allowtoADDQ[(Dest & 15)]) { - switch (BaseCode & 0xC0) { - case 0: - Size = 'B'; - OpSize = 'b'; - break; - - case 0x40: - Size = 'W'; - OpSize = 'h'; - break; - - case 0x80: - Size = 'L'; - OpSize = 'w'; - break; - } - - OpcodeArray[BaseCode] = BaseCode; - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (Dest == 0) { /* write to Dx */ - if (Size != 'L') - TimingCycles += 4 ; - else - TimingCycles += 8 ; - } - - if (Dest == 1) { - if ((Size == 'L') || (Opcode & 0x100)) /* if long or SUBQ */ - TimingCycles += 8 ; - else - TimingCycles += 4 ; - } - - if (Dest > 1) { /* write to mem */ - if (Size != 'L') - TimingCycles += 8 ; - else - TimingCycles += 12 ; - } - - if (Dest < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[SaveEDX ? T0 : FLAG_C], regnameslong[OPCODE]); - } - - if (Dest > 1) { - flags[OPCODE] = 'T'; - flags[EFFADDR] = 'T'; - EffectiveAddressRead(Dest, Size, FLAG_C, T1, flags, TRUE, TRUE, TRUE); - } else { - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[SaveEDX ? T0 : FLAG_C], regnameslong[SaveEDX ? T0 : FLAG_C]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[SaveEDX ? T0 : FLAG_C], regnameslong[SaveEDX ? T0 : FLAG_C], regnameslong[MEMBASE]); - fprintf(fp, "\t\t l%c %s,0x%2.2X(%s)\n", OpSize, regnameslong[T1], SaveEDX ? 32 : 0, regnameslong[SaveEDX ? T0 : FLAG_C]); - } - - /* Sub Immediate from Opcode */ - - fprintf(fp, "\t\t srl %s,%s,9\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - Immediate8(); - - if (Opcode & 0x100) { - /* SUBQ */ - Operation = "subu"; - } else { - /* ADDQ */ - Operation = "addu"; - } - - /* For Data or Address register, operate directly */ - /* on the memory location. */ - - fprintf(fp, "\t\t %s %s,%s,%s\n", Operation, regnameslong[V0], regnameslong[T1], regnameslong[OPCODE]); - if (Dest < 2) { - fprintf(fp, "\t\t s%c %s,0x%2.2X(%s)\n", OpSize, regnameslong[V0], SaveEDX ? 32 : 0, regnameslong[SaveEDX ? T0 : FLAG_C]); - } - - /* No Flags for Address Direct */ - - if (!SaveEDX) { - SetFlags(Size, Opcode & 0x100 ? FLAGS_SUB : FLAGS_ADD, V0, T1, OPCODE); - } - - if (Dest > 1) { - flags[OPCODE] = '-'; - flags[EFFADDR] = '-'; - EffectiveAddressWrite(Dest, Size, 0, FALSE, flags, FALSE, FALSE); - } - - Completed(); - } else { - OpcodeArray[BaseCode] = -1; - BaseCode = -1; - } - flags[FLAG_C] = '-'; - } else { - BaseCode = OpcodeArray[BaseCode]; - } - - OpcodeArray[Opcode] = BaseCode; - } - } -} - -/* - * Branch Instructions - * - * BSR, Bcc - * - */ - -void branchinstructions(void) -{ - int Opcode,BaseCode; - int Counter; - char *Label; - - for (Opcode = 0x60; Opcode < 0x70; Opcode++) { - /* Displacement = 0 -> 16 Bit displacement */ - - BaseCode = Opcode * 0x100; - OpcodeArray[BaseCode] = BaseCode; - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - TimingCycles += 10 ; - - if (Opcode == 0x60) { - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - Memory_Fetch('W', V0, TRUE); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[PC], regnameslong[PC], regnameslong[V0]); - MemoryBanking(0, LocalStack); - Completed(); - } else { - if (Opcode != 0x61) { - Label = ConditionDecode(Opcode & 0x0F, TRUE, FALSE); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n\n", regnameslong[PC], regnameslong[PC]); - - /* Code for Failed branch */ - - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - - /* 2 less cycles for Failure */ - - TimingCycles -= 2; - Completed(); - TimingCycles += 2; - - /* Successful Branch */ - - Align(); - fprintf(fp, "\t%s:\n", Label); - - Memory_Fetch('W', V0, TRUE); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[PC], regnameslong[PC], regnameslong[V0]); - MemoryBanking(0, LocalStack); - Completed(); - } else { - /* BSR - Special Case */ - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 8 ; - - Memory_Fetch('W', OPCODE, TRUE); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[PC], regnameslong[OPCODE]); - - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - PushPC("----------------SSSSSSSST---G-F-"); - - fprintf(fp, "\t\t or %s,$0,%s\n\n", regnameslong[PC], regnameslong[OPCODE]); - MemoryBanking(0, LocalStack); - Completed(); - } - } - - /* 8 Bit Displacement */ - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode + 1, 0)); - - TimingCycles += 10 ; - - if (Opcode > 0x60) { - if (Opcode != 0x61) { - Label = ConditionDecode(Opcode & 0x0F, TRUE, FALSE); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n\n", regnameslong[PC], regnameslong[PC]); - - /* Code for Failed branch */ - - TimingCycles -= 2; - Completed(); - TimingCycles += 2; - - /* Successful Branch */ - - Align(); - fprintf(fp, "\t%s:\n",Label); - } else { - /* BSR - Special Case */ - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 8 ; - - PushPC("----------------SSSSSSSST---G-F-"); - } - } else { - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - } - - /* Common Ending */ - - fprintf(fp, "\t\t seb %s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[PC], regnameslong[PC], regnameslong[OPCODE]); - MemoryBanking(0, LocalStack); - Completed(); - - /* Fill up Opcode Array */ - - for (Counter = 1; Counter < 0x100; Counter++) - OpcodeArray[BaseCode + Counter] = BaseCode + 1; - } -} - -/* - * Move Quick Commands - * - * Fairly simple, as only allowed to Data Registers - * - */ - -void moveq(void) -{ -#if 0 - int Count; -#else - int i, j; -#endif - - /* The Code */ - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(0x7000, 0)); - fprintf(fp, "\n\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 4 ; - - fprintf(fp, "\t\t seb %s,%s\n", regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - SetFlags('L', FLAGS_MOVE, V0, 0, 0); - - EffectiveAddressWrite(0, 'L', OPCODE, TRUE, "----------------SSSSSSSS----G-F-", FALSE, TRUE); - Completed(); - -#if 0 - /* Set OpcodeArray (Not strictly correct, since some are illegal!) */ - - for (Count = 0x7000; Count < 0x8000; Count++) { - OpcodeArray[Count] = 0x7000; - } -#else - - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - for(j = 0x0000; j <= 0x00FF; j += 0x0001) - OpcodeArray[0x7000 + i + j] = 0x7000; -#endif -} - -/* - * Extended version of Add & Sub commands - * - */ - -void addx_subx(void) -{ - int Opcode, BaseCode ; - int regx, type, leng, rm, regy, mode ; - int ModeModX; - int ModeModY; - char Size = ' '; - char OpSize = ' '; - char * Operand = ""; - char flags[] = "------------------S-SSSS----G-F-"; - - for (type = 0 ; type < 2 ; type ++) /* 0 = subx, 1 = addx */ - for (regx = 0 ; regx < 8 ; regx++) - for (leng = 0 ; leng < 3 ; leng++) - for (rm = 0 ; rm < 2 ; rm++) - for (regy = 0 ; regy < 8 ; regy++) { - Opcode = 0x9100 | (type << 14) | (regx << 9) | (leng << 6) | (rm << 3) | regy; - - BaseCode = Opcode & 0xd1c8; - - ModeModX = 0; - ModeModY = 0; - - if ((rm == 1) && (leng == 0)) { - if (regx == 7) { - BaseCode |= (regx << 9); - ModeModY = 16; - } - if (regy == 7) { - BaseCode |= regy; - ModeModX = 16; - } - } - - if (rm == 0) - mode = 0; - else - mode = 4; - - switch (leng) { - case 0: - Size = 'B'; - OpSize = 'b'; - break; - case 1: - Size = 'W'; - OpSize = 'h'; - break; - case 2: - Size = 'L'; - OpSize = 'w'; - break; - } - - if (OpcodeArray[BaseCode] == -2) { - if (type == 0) - Operand = "subu"; - else - Operand = "addu"; - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if (mode == 4) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - /* don't add in EA timing for ADDX,SUBX */ - - AddEACycles = 0 ; - - if (rm == 0) { /* reg to reg */ - if (Size != 'L') - TimingCycles += 4 ; - else - TimingCycles += 8 ; - } else { - if (Size != 'L') - TimingCycles += 18 ; - else - TimingCycles += 30 ; - } - - fprintf(fp, "\t\t andi %s,%s,0x07\n\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,7\n\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - /* Get Source */ - - flags[OPCODE] = 'T'; - EffectiveAddressRead(mode + ModeModX, Size, T0, T0, flags, TRUE, TRUE, TRUE); - flags[OPCODE] = '-'; - - /* Get Destination (if needed) */ - - if (mode == 4) { - flags[T0] = 'T'; - //flags[OPCODE] = 'T'; - flags[EFFADDR] = 'T'; - EffectiveAddressRead(mode + ModeModY, Size, OPCODE, T1, flags, TRUE, FALSE, TRUE); - flags[T0] = '-'; - //flags[OPCODE] = '-'; - flags[EFFADDR] = '-'; - } else { - fprintf(fp, "\t\t addu %s,%s,%s\n\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t l%c %s,0x00(%s)\n\n", OpSize, regnameslong[T1], regnameslong[OPCODE]); - } - - /* Do the sums */ - fprintf(fp, "\t\t %s %s,%s,%s\n", Operand, regnameslong[V0], regnameslong[T1], regnameslong[T0]); - fprintf(fp, "\t\t %s %s,%s,%s\n", Operand, regnameslong[V0], regnameslong[V0], regnameslong[FLAG_X]); - - /* Set the Flags */ - - SetFlags(Size, type == 0 ? FLAGS_SUBX : FLAGS_ADDX, V0, T1, T0); - - /* Update the Data (if needed) */ - - if (mode == 4) { - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_N] = 'S'; - EffectiveAddressWrite(mode, Size, OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_N] = '-'; - } else { - fprintf(fp, "\t\t s%c %s,0x00(%s)\n\n", OpSize, regnameslong[V0], regnameslong[OPCODE]); - } - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -/* - * Logicals / Simple Maths (+ and -) - * - * OR,AND,CMP,EOR,ADD and SUB - * - */ - -void dumpx(int start, int reg, int type, char * Op, int dir, int leng, int mode, int sreg) -{ - int Opcode, BaseCode; - char Size = ' '; - char OpSize = ' '; - int Dest; - int SaveEDX; - int SaveDir; - char * allow = ""; - char * allowtypes[] = {"0-23456789ab----", "--2345678-------", "0123456789ab----", "0-2345678-------"}; - char flags[] = "---------------------SSS----G-F-"; - - SaveDir = dir; - - switch (type) { - case 0: /* or and*/ - flags[FLAG_X] = 'S'; - if (dir == 0) - allow = allowtypes[0]; - else - allow = allowtypes[1]; - break ; - - case 1: /* cmp*/ - flags[FLAG_X] = 'S'; - allow = allowtypes[2] ; - break ; - - case 2: /* eor*/ - flags[FLAG_X] = 'S'; - allow = allowtypes[3] ; - break ; - - case 3: /* adda suba cmpa*/ - if (start != 0xb000) { - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - } - flags[FLAG_X] = 'S'; - allow = allowtypes[2] ; - break ; - - case 4: /* sub add*/ - if (dir == 0) - allow = allowtypes[0] ; - else - allow = allowtypes[1] ; - break ; - } - - if ((type == 4) && (dir == 0) && (leng > 0)) { - allow = allowtypes[2] ; /* word and long ok*/ - } - - Opcode = start | (reg << 9 ) | (dir << 8) | (leng << 6) | (mode << 3) | sreg; - - BaseCode = Opcode & 0xf1f8; - - if (mode == 7) BaseCode |= sreg ; - - if ((mode == 3 || mode == 4) && ( leng == 0 ) && (sreg == 7 )) - BaseCode |= sreg ; - - /* If Source = Data or Address register - combine into same routine */ - - if (((Opcode & 0x38) == 0x08) && (allow[1] != '-')) { - BaseCode &= 0xfff7; - } - - Dest = EAtoAMN(Opcode, FALSE); - SaveEDX = (Dest == 1) || (type == 3); - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[BaseCode] == -2) { - switch (leng) { - case 0: - Size = 'B'; - OpSize = 'b'; - break; - case 1: - Size = 'W'; - OpSize = 'h'; - break; - case 2: - Size = 'L'; - OpSize = 'w'; - break; - - case 3: /* cmpa adda suba */ - if (dir == 0) { - Size = 'W'; - } else { - Size = 'L'; - } - OpSize = 'w'; - dir = 0 ; - break ; - } - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (dir == 0) { - if (Size != 'L') - TimingCycles += 4; - else - TimingCycles += 6; - } else { - if (Size != 'L') - TimingCycles += 8; - else - TimingCycles += 12; - } - - if ((mode == 0) && (dir == 0) && (Size == 'L')) - TimingCycles += 2 ; - - if ((mode == 1) && (dir == 0) && (Size != 'L')) - TimingCycles += 4 ; - - if (Dest < 7) { /* Others do not need reg.no. */ - if ((Dest == 0) & (allow[1] != '-')) - fprintf(fp, "\t\t andi %s,%s,0x0f\n", regnameslong[T0], regnameslong[OPCODE]); - else - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - } - - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t l%c %s,0x%2.2X(%s)\n", OpSize, regnameslong[T1], type != 3 ? 0 : 32, regnameslong[OPCODE]); - - flags[OPCODE] = 'T'; - flags[T1] = 'T'; - if (dir != 0) flags[Dest < 2 ? T0 : EFFADDR] = 'T'; - EffectiveAddressRead(Dest, Size, T0, dir == 0 ? V0 : T2, flags, TRUE, TRUE, TRUE); - - if (dir == 0) { - fprintf(fp, "\t\t %s %s,%s,%s\n", Op, regnameslong[T2], regnameslong[T1], regnameslong[V0]); - if (type != 3) { - if (start != 0xb000) - fprintf(fp, "\t\t s%c %s,0x00(%s)\n", OpSize, regnameslong[T2], regnameslong[OPCODE]); - - switch (start) { - case 0x8000: /* OR */ - case 0xc000: /* AND */ - SetFlags(Size, FLAGS_BITOP, T2, T1, V0); - break; - case 0xb000: /* CMP */ - SetFlags(Size, FLAGS_CMP, T2, T1, V0); - break; - case 0x9000: /* SUB */ - SetFlags(Size, FLAGS_SUB, T2, T1, V0); - break; - case 0xd000: /* ADD */ - SetFlags(Size, FLAGS_ADD, T2, T1, V0); - break; - } - } else { - if (start == 0xb000) { - SetFlags('L', FLAGS_CMP, T2, T1, V0); - } else { - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[T2], regnameslong[OPCODE]); - } - } - } else { - fprintf(fp, "\t\t %s %s,%s,%s\n", Op, regnameslong[V0], regnameslong[T2], regnameslong[T1]); - - switch (start) { - case 0x8000: /* OR */ - case 0xb100: /* EOR */ - case 0xc000: /* AND */ - SetFlags(Size, FLAGS_BITOP, V0, T2, T1); - break; - case 0x9000: /* SUB */ - SetFlags(Size, FLAGS_SUB, V0, T2, T1); - break; - case 0xd000: /* ADD */ - SetFlags(Size, FLAGS_ADD, V0, T2, T1); - break; - } - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - flags[FLAG_X] = 'S'; - EffectiveAddressWrite(Dest, Size, T0, FALSE, flags, FALSE, FALSE); - } - Completed(); - } - - OpcodeArray[Opcode] = BaseCode; - } - - dir = SaveDir; -} - -void typelogicalmath(void) -{ - int dir, leng, mode, sreg ,reg ; - - for (reg = 0 ; reg < 8 ; reg++) - { - /* or */ - for (dir = 0 ; dir < 2 ; dir++) - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0x8000, reg, 0, "or ", dir, leng, mode, sreg ) ; - - /* sub */ - for (dir = 0 ; dir < 2 ; dir++) - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0x9000, reg, 4, "subu", dir, leng, mode, sreg ) ; - - /* suba */ - - for (dir = 0 ; dir < 2 ; dir++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0x9000, reg, 3, "subu", dir, 3, mode, sreg ) ; - - - /* cmp */ - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xb000, reg, 1, "subu", 0, leng, mode, sreg ) ; - - /* cmpa */ - - for (dir = 0 ; dir < 2 ; dir++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xb000, reg, 3, "subu", dir, 3, mode, sreg ) ; - - /* adda */ - - for (dir = 0 ; dir < 2 ; dir++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xd000, reg, 3, "addu", dir, 3, mode, sreg ) ; - - - /* eor */ - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xb100, reg, 2, "xor ", 1, leng, mode, sreg ) ; - - /* and */ - for (dir = 0 ; dir < 2 ; dir++) - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xc000, reg, 0, "and ", dir, leng, mode, sreg ) ; - - /* add */ - for (dir = 0 ; dir < 2 ; dir++) - for (leng = 0 ; leng < 3; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) - dumpx( 0xd000, reg, 4, "addu", dir, leng, mode, sreg ) ; - } -} - -/* - * Single commands missed out by routines above - * - */ - -void mul(void) -{ - int dreg, type, mode, sreg; - int Opcode, BaseCode; - int Dest; - char allow[] = "0-23456789ab-----" ; - char flags[] = "--------------------SSSST---G-F-"; - - for (dreg = 0 ; dreg < 8 ; dreg++) - for (type = 0 ; type < 2 ; type++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) { - Opcode = 0xc0c0 | (dreg << 9) | (type << 8) | (mode << 3) | sreg ; - BaseCode = Opcode & 0xc1f8 ; - if (mode == 7) { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - if (allow[Dest & 0x0f] != '-') { - if (OpcodeArray[ BaseCode ] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 54 ; - - if (mode < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - } - - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t lh%c %s,0x00(%s)\n", type == 0 ? 'u' : ' ', regnameslong[T1], regnameslong[OPCODE]); - - EffectiveAddressRead(Dest, 'W', T0, V0, flags, type == 0 ? FALSE : TRUE, TRUE, TRUE); - - fprintf(fp, "\t\t mult%c %s,%s\n", type == 0 ? 'u' : ' ', regnameslong[V0], regnameslong[T1]); - - fprintf(fp, "\t\t mflo %s\n", regnameslong[T0]); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[T0], regnameslong[OPCODE]); - SetFlags('L', FLAGS_BITOP, T0, V0, T1); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * not - * clr - * neg - * negx - * - */ - -void not(void) -{ - int type, leng, mode, sreg; - int Opcode, BaseCode; - int Dest; - int SaveEDX = 0; - char Size = ' '; - char OpSize = ' '; - - char allow[] = "0-2345678-------" ; - char flags[] = "--------------------SSSS----G-F-"; - - for (type = 0 ; type < 4 ; type++) - for (leng = 0 ; leng < 3 ; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) { - Opcode = 0x4000 | (type<<9) | (leng<<6) | (mode<<3) | sreg ; - BaseCode = Opcode & 0x46f8 ; - if (mode == 7) { - BaseCode |= sreg ; - } - - // A7+, A7- - - if ((leng == 0) && (sreg == 7) && (mode > 2) && (mode < 5)) { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - - if (allow[Dest & 0x0f] != '-') { - switch (leng) { - case 0: - Size = 'B'; - OpSize = 'b'; - break; - case 1: - Size = 'W'; - OpSize = 'h'; - break; - case 2: - Size = 'L'; - OpSize = 'w'; - break; - } - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (Size != 'L') - TimingCycles += 4; - else - TimingCycles += 6; - - if (Dest < 7) - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - /* CLR does not need to read source (although it does on a real 68000) */ - - if (type != 1) { - if (type == 0) flags[FLAG_Z] = 'S'; - if (type != 2) flags[FLAG_X] = 'S'; - flags[Dest < 2 ? OPCODE : EFFADDR] = 'T'; - EffectiveAddressRead(Dest, Size, OPCODE, type == 3 ? V0 : T0, flags, TRUE, TRUE, TRUE); - flags[EFFADDR] = '-'; - flags[OPCODE] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_X] = '-'; - } - - switch (type) { - case 0: /* negx */ - - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[V0], regnameslong[T0], regnameslong[FLAG_X]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[V0], regnameslong[V0]); - - /* Set the Flags */ - - SetFlags(Size, FLAGS_SUBX, V0, ZERO, T0); - - break; - - case 1: /* clr */ - ClearRegister(V0); - EffectiveAddressWrite(Dest, Size, OPCODE, TRUE, flags, TRUE, TRUE); - ClearRegister(FLAG_C); - ClearRegister(FLAG_V); - fprintf(fp, "\t\t ori %s,$0,1\n", regnameslong[FLAG_Z]); - ClearRegister(FLAG_N); - break; - - case 2: /* neg */ - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[V0], regnameslong[T0]); - SetFlags(Size, FLAGS_SUB, V0, ZERO, T0); - break; - - case 3: /* not */ - fprintf(fp, "\t\t nor %s,$0,%s\n", regnameslong[V0], regnameslong[V0]); - SetFlags(Size, FLAGS_BITOP, V0, ZERO, V0); - break; - } - - /* Update (unless CLR command) */ - - if (type != 1) { - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - flags[FLAG_X] = 'S'; - EffectiveAddressWrite(Dest, Size, OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - flags[FLAG_X] = '-'; - } - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Move to/from USP - * - */ - -void moveusp(void) -{ - int Opcode, BaseCode ; - int dir, sreg ; - char * Label; - - for (dir = 0 ; dir < 2 ; dir++) - for (sreg = 0 ; sreg < 8 ; sreg++) { - Opcode = 0x4e60 | (dir << 3) | sreg ; - BaseCode = Opcode & 0x4e68 ; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - Label = GenerateLabel(BaseCode, 0); - fprintf(fp, "%s\n", Label); - - TimingCycles += 4; - - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T0], REG_SRH); - fprintf(fp, "\t\t andi %s,%s,0x20 \t # Supervisor Mode ?\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[T0]); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n\n", regnameslong[PC], regnameslong[PC]); - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[MEMBASE]); - - if (dir == 0) { /* reg 2 USP */ - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[V0], regnameslong[T0]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[V0], REG_USP); - } else { - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[V0], REG_USP); - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[V0], regnameslong[T0]); - } - Completed(); - - fprintf(fp, "\t9:\n"); - Exception(8, NULL); - } - OpcodeArray[Opcode] = BaseCode; - } -} - - -/* - * Check - * - */ - -void chk(void) -{ - int dreg, mode, sreg; - int Opcode, BaseCode; - int Dest; - char* Label; - char DelaySlot[64] = ""; - - char *allow = "0-23456789ab----"; - char flags[] = "--------------------SSSS----G-F-"; - - for (dreg = 0 ; dreg < 8; dreg++) - for (mode = 0 ; mode < 8; mode++) - for (sreg = 0 ; sreg < 8; sreg++) { - Opcode = 0x4180 | (dreg << 9) | (mode << 3) | sreg ; - BaseCode = Opcode & 0x41f8 ; - - if (mode == 7) { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[BaseCode] == -2) { - Align(); - Label = GenerateLabel(BaseCode, 0); - fprintf(fp, "%s:\n", Label); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 10; - - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[Dest < 7 ? T0 : OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[Dest < 7 ? T0 : OPCODE], regnameslong[Dest < 7 ? T0 : OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[Dest < 7 ? T0 : OPCODE], regnameslong[Dest < 7 ? T0 : OPCODE], regnameslong[MEMBASE]); - - if (Dest < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - flags[T0] = 'T'; - } - - fprintf(fp, "\t\t lh %s,0x00(%s)\n", regnameslong[Dest < 7 ? T0 : OPCODE], regnameslong[Dest < 7 ? T0 : OPCODE]); - - EffectiveAddressRead(Dest, 'W', OPCODE, V0, flags, TRUE, TRUE, TRUE); - flags[T0] = '-'; - - ClearRegister(FLAG_C); - ClearRegister(FLAG_V); - fprintf(fp, "\t\t sltiu %s,%s,1\n", regnameslong[FLAG_Z], regnameslong[Dest < 7 ? T0 : OPCODE]); - - /* N is set if data less than zero */ - - fprintf(fp, "\t\t slt %s,%s,$0\n", regnameslong[FLAG_N], regnameslong[Dest < 7 ? T0 : OPCODE]); /* is T0 < 0 */ - fprintf(fp, "\t\t bne %s,$0,8f\n", regnameslong[FLAG_N]); - - fprintf(fp, "\t\t slt %s,%s,%s \t # Delay slot\n", regnameslong[T0], regnameslong[V0], regnameslong[Dest < 7 ? T0 : OPCODE]); - fprintf(fp, "\t\t bne %s,$0,9f\n", regnameslong[T0]); - fprintf(fp, "\t\t nop \t # Delay slot\n"); - Completed(); - - /* N is cleared if greated than compared number */ - - Align(); - fprintf(fp, "\t9:\n"); - ClearRegister(FLAG_N); - - fprintf(fp, "\t8:\n"); - sprintf(DelaySlot, "ori %s,$0,6 ", regnameslong[V0]); - Exception(-1, DelaySlot); - Completed(); - - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Load Effective Address - */ - -void LoadEffectiveAddress(void) -{ - int Opcode, BaseCode; - int sreg, mode, dreg; - int Dest; - char allow[] = "--2--56789a-----" ; - - for (sreg = 0 ; sreg < 8 ; sreg++) - for (mode = 0 ; mode < 8 ; mode++) - for (dreg = 0 ; dreg < 8 ; dreg++) { - Opcode = 0x41c0 | (sreg << 9) | (mode << 3) | dreg; - - BaseCode = Opcode & 0x41f8 ; - - if (mode == 7) - BaseCode = BaseCode | dreg; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest & 0x0f] != '-') { - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - switch (mode) { - case 2: - TimingCycles += 4; - break; - case 5: - case 7: - case 9: - TimingCycles += 8; - break; - case 6: - case 8: - case 10: - TimingCycles += 12; - break; - } - - if (mode < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - } - - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - - EffectiveAddressCalculate(Dest, 'L', T0, TRUE, TRUE); - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[OPCODE]); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Negate BCD - * - */ - -void nbcd(void) -{ - int Opcode, BaseCode; - int sreg, mode, Dest; - char allow[] = "0-2345678-------" ; - char flags[] = "------------------S-SSSS----G-F-"; - char Label0[64] = ""; - - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) { - Opcode = 0x4800 | (mode << 3) | sreg ; - BaseCode = Opcode & 0x4838 ; - - if (mode == 7) - BaseCode |= sreg ; - - // A7+, A7- - - if ((sreg == 7) && (mode > 2) && (mode < 5)) { - BaseCode |= sreg; - } - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (mode < 2) - TimingCycles += 6; - else - TimingCycles += 8; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - flags[Dest < 2 ? OPCODE : EFFADDR] = 'T'; - EffectiveAddressRead(Dest, 'B', OPCODE, V0, flags, FALSE, TRUE, TRUE); - flags[OPCODE] = '-'; - flags[EFFADDR] = '-'; - - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[FLAG_V], regnameslong[V0]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], regnameslong[FLAG_X]); - fprintf(fp, "\t\t andi %s,%s,0xFF\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - - fprintf(fp, "\t\t andi %s,%s,0x0F\n", regnameslong[T1], regnameslong[V0]); - fprintf(fp, "\t\t andi %s,%s,0xF0\n", regnameslong[T0], regnameslong[V0]); - - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[T1], regnameslong[T1]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T1], regnameslong[T1], regnameslong[FLAG_X]); - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t sltiu %s,%s,10\n", regnameslong[T2], regnameslong[T1]); - fprintf(fp, "\t\t xori %s,%s,1\n", regnameslong[T2], regnameslong[T2]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T2], regnameslong[T2]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T1], regnameslong[T1], regnameslong[T2]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T2], regnameslong[T2]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T1], regnameslong[T1], regnameslong[T2]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[V0], regnameslong[T0], regnameslong[T1]); - fprintf(fp, "\t\t sltiu %s,%s,0x9a\n", regnameslong[FLAG_C], regnameslong[V0]); - fprintf(fp, "\t\t xori %s,%s,1 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - fprintf(fp, "\t\t sll %s,%s,5\n", regnameslong[T2], regnameslong[FLAG_C]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T2]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T2], regnameslong[T2]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T2]); - - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[FLAG_N], regnameslong[FLAG_V], regnameslong[V0]); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], regnameslong[FLAG_N]); - fprintf(fp, "\t\t srl %s,%s,7 \t # Set Overflow\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - - fprintf(fp, "\t\t sltiu %s,%s,1\n", regnameslong[T9], regnameslong[V0]); - fprintf(fp, "\t\t and %s,%s,%s \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z], regnameslong[T9]); - fprintf(fp, "\t\t srl %s,%s,7 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0]); - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_N] = 'S'; - EffectiveAddressWrite(Dest, 'B', OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_N] = '-'; - Completed(); - } - OpcodeArray[Opcode] = BaseCode; - } - } -} - -void tas(void) -{ - int Opcode, BaseCode; - int sreg,mode,Dest; - char allow[] = "0-2345678-------"; - char flags[] = "--------------------SSSS----G-F-"; - - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) { - Opcode = 0x4ac0 | (mode << 3) | sreg; - BaseCode = Opcode & 0x4af8; - - if (mode == 7) - BaseCode |= sreg; - - if ((sreg == 7) && (mode > 2) && (mode < 5)) { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (mode < 2) - TimingCycles += 4; - else - TimingCycles += 14; - - if (Dest < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - flags[Dest < 2 ? OPCODE : EFFADDR] = 'T'; - EffectiveAddressRead(Dest, 'B', OPCODE, V0, flags, FALSE, TRUE, TRUE); - flags[EFFADDR] = '-'; - flags[OPCODE] = '-'; - - SetFlags('B', FLAGS_MOVE, V0, 0, 0); - fprintf(fp, "\t\t or %s,%s,0x80\n", regnameslong[V0], regnameslong[V0]); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - EffectiveAddressWrite(Dest, 'B', OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - Completed(); - } - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * push Effective Address - */ - -void PushEffectiveAddress(void) -{ - int Opcode, BaseCode; - int mode,dreg; - int Dest; - char allow[] = "--2--56789a-----"; - - for (mode = 0 ; mode < 8 ; mode++) - for (dreg = 0 ; dreg < 8 ; dreg++) { - Opcode = 0x4840 | (mode << 3) | dreg ; - - BaseCode = Opcode & 0x4878 ; - - if (mode == 7) - BaseCode = BaseCode | dreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest & 0x0f] != '-') { - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - SavePreviousPC(); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - switch (mode) { - case 2: - TimingCycles += 12; - break; - case 5: - case 7: - case 9: - TimingCycles += 16; - break; - case 6: - case 8: - case 10: - TimingCycles += 20; - break; - } - - if (mode < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - EffectiveAddressCalculate(Dest, 'L', OPCODE, TRUE, TRUE); - - fprintf(fp, "\t\t lw %s,%s \t # Push onto Stack\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - fprintf(fp, "\t\t addiu %s,%s,-4\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[FASTCALL_FIRST_REG]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - Memory_Write('L', FASTCALL_FIRST_REG, EFFADDR, "----------------SSSSSSSS----G-F-", LocalStack); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Test - * - */ - -void tst(void) -{ - int leng, mode, sreg; - int Opcode, BaseCode; - int Dest; - char Size = ' '; - char OpSize = ' '; - - char allow[] = "0-2345678-------" ; - - for (leng = 0 ; leng < 3 ; leng++) - for (mode = 0 ; mode < 8 ; mode++) - for (sreg = 0 ; sreg < 8 ; sreg++) { - Opcode = 0x4a00 | (leng << 6) | (mode << 3) | sreg ; - BaseCode = Opcode & 0x4af8 ; - if (mode == 7) { - BaseCode |= sreg ; - } - - // A7+, A7- - - if ((leng == 0) && (sreg == 7) && (mode > 2) && (mode < 5)) - { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - - if ((allow[Dest & 0x0f] != '-')/* || (( mode == 1 ) && (leng != 0))*/) { - switch (leng) { - case 0: - Size = 'B'; - OpSize = 'b'; - break; - case 1: - Size = 'W'; - OpSize = 'h'; - break; - case 2: - Size = 'L'; - OpSize = 'w'; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 4; - - if (Dest < 7) - fprintf(fp, "\t\t andi %s,%s,0x07\n\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - EffectiveAddressRead(Dest, Size, OPCODE, V0, "--------------------SSSS----G-F-", FALSE, TRUE, TRUE); - - SetFlags(Size, FLAGS_MOVE, V0, 0, 0); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Move registers too / from memory - * - */ - -void movem_reg_ea(void) -{ - int leng,mode,sreg; - int Opcode, BaseCode; - int Dest; - char Size; - char * Label; - - char *allow = "--2-45678-------"; - char flags[] = "--------TT--T-T-SSSSSSSS----G-F-"; - - for (leng = 0; leng < 2; leng++) - for (mode = 0; mode < 8; mode++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0x4880 | (leng << 6) | (mode << 3) | sreg ; - BaseCode = Opcode & 0x4cf8 ; - - if (mode == 7) { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - - Size = "WL"[leng]; - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[BaseCode] == - 2) { - Align(); - Label = GenerateLabel(BaseCode, 0); - fprintf(fp, "%s:\n", Label); - SavePreviousPC(); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - switch (mode) { - case 2: - case 4: - TimingCycles += 8 ; - break; - case 5: - case 7: - TimingCycles += 12 ; - break; - case 6: - case 8: - TimingCycles += 14 ; - break; - } - - Memory_Fetch('W', T4, FALSE); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - - if (mode < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - if (mode == 4) { - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[OPCODE]); - } else - EffectiveAddressCalculate(Dest, 'L', OPCODE, TRUE, TRUE); - - fprintf(fp, "\t\t ori %s,$0,1\n", regnameslong[T0]); - - /* predecrement uses d0-d7..a0-a7 a7 first*/ - /* other modes use a7-a0..d7-d0 d0 first*/ - - if (Dest != 4) - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[T1], regnameslong[MEMBASE]); - else - fprintf(fp, "\t\t addiu %s,%s,0x3C\n", regnameslong[T1], regnameslong[MEMBASE]); - - fprintf(fp, "\t9:\n"); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[T2], regnameslong[T4], regnameslong[T0]); - fprintf(fp, "\t\t beq %s,$0,8f\n", regnameslong[T2]); - - fprintf(fp, "\t\t lw %s,0x00(%s) \t # Delay slot\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[T1]); /* load a1 with current reg data */ - - if (Dest == 4) { - if (Size == 'W') /* adjust pointer before write */ - fprintf(fp, "\t\t addiu %s,%s,-2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - else - fprintf(fp, "\t\t addiu %s,%s,-4\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - } - - if (Dest == 4) flags[OPCODE] = 'T'; - Memory_Write(Size, EFFADDR, FASTCALL_SECOND_REG, flags, LocalStack); - if (Dest == 4) flags[OPCODE] = '-'; - - if (Dest != 4){ - if (Size == 'W') /* adjust pointer after write */ - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - else - fprintf(fp, "\t\t addiu %s,%s,4\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - } - - /* Update Cycle Count */ - - if (Size == 'W') - fprintf(fp, "\t\t addiu %s,%s,-4\n", regnameslong[ICNT], regnameslong[ICNT]); - else - fprintf(fp, "\t\t addiu %s,%s,-8\n", regnameslong[ICNT], regnameslong[ICNT]); - - fprintf(fp, "\t8:\n"); - - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t andi %s,%s,0xffff\n", regnameslong[TMPREG0], regnameslong[T0]); /* check low 16 bits */ - fprintf(fp, "\t\t bne %s,$0,9b\n", regnameslong[TMPREG0]); - - if (Dest != 4) - fprintf(fp, "\t\t addiu %s,%s,4 \t # Delay slot\n", regnameslong[T1], regnameslong[T1]); - else - fprintf(fp, "\t\t addiu %s,%s,-4 \t # Delay slot\n", regnameslong[T1], regnameslong[T1]); - - if (Dest == 4) { - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[OPCODE]); - } - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -void movem_ea_reg(void) -{ - int leng, mode, sreg; - int Opcode, BaseCode; - int Dest; - char Size; - char* Label; - - char* allow = "--23-56789a-----"; - char flags[] = "--------TT--T-T-SSSSSSSS----G-F-"; - - for (leng = 0; leng < 2; leng++) - for (mode = 0; mode < 8; mode++) - for (sreg =0 ; sreg < 8; sreg++) { - Opcode = 0x4c80 | ( leng<<6) | (mode<<3) | sreg ; - BaseCode = Opcode & 0x4cf8 ; - - if (mode == 7) { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - - Size = "WL"[leng] ; - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[BaseCode] == - 2) { - Align(); - Label = GenerateLabel(BaseCode, 0); - - fprintf(fp, "%s:\n", Label); - SavePreviousPC(); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - switch (mode) { - case 2: - case 4: - TimingCycles += 8 ; - break; - case 5: - case 7: - TimingCycles += 12 ; - break; - case 6: - case 8: - TimingCycles += 14 ; - break; - } - - Memory_Fetch('W', T4, FALSE); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - - if (mode < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - EffectiveAddressCalculate(Dest, 'L' , OPCODE, TRUE, TRUE); - - fprintf(fp, "\t\t ori %s,$0,1\n", regnameslong[T0]); /* setup register list mask */ - - /* use a7-a0..d7-d0 d0 first*/ - - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[T1], regnameslong[MEMBASE]); /* always start with D0 */ - - fprintf(fp, "\t9:\n"); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[T2], regnameslong[T4], regnameslong[T0]); /* is bit set for this register? */ - fprintf(fp, "\t\t beq %s,$0,8f\n", regnameslong[T2]); - fprintf(fp, "\t\t nop \t # Delay slot\n"); - - if (mode == 3) flags[OPCODE] = 'T'; - Memory_Read(Size, EFFADDR, flags, LocalStack); - if (mode == 3) flags[OPCODE] = '-'; - if (Size == 'W') { - fprintf(fp, "\t\t sll %s,%s,16\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t sra %s,%s,16\n", regnameslong[V0], regnameslong[V0]); - } - - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[T1]); /* load current reg with v0 */ - - if (Size == 'W') /* adjust pointer after write */ - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - else - fprintf(fp, "\t\t addiu %s,%s,4\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - - /* Update Cycle Count */ - - if (Size == 'W') - fprintf(fp, "\t\t addiu %s,%s,-4\n", regnameslong[ICNT], regnameslong[ICNT]); - else - fprintf(fp, "\t\t addiu %s,%s,-8\n", regnameslong[ICNT], regnameslong[ICNT]); - - fprintf(fp, "\t8:\n"); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t andi %s,%s,0xffff\n", regnameslong[TMPREG0], regnameslong[T0]); /* check low 16 bits */ - fprintf(fp, "\t\t bne %s,$0,9b\n", regnameslong[TMPREG0]); - fprintf(fp, "\t\t addiu %s,%s,4 \t # Delay slot\n", regnameslong[T1], regnameslong[T1]); /* adjust pointer to next reg */ - - if (mode == 3) - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[OPCODE]); /* reset Ax if mode = (Ax)+ */ - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Link / Unlink - * - * Local stack space - * - */ - -void link(void) -{ - int sreg ; - int Opcode, BaseCode ; - - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0x4e50 | sreg ; - BaseCode = 0x4e50 ; - - if (OpcodeArray[BaseCode] == - 2) { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 16; - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[EFFADDR], REG_A7); - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addiu %s,%s,-4\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[OPCODE]); - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[OPCODE]); - - Memory_Write('L',EFFADDR, FASTCALL_SECOND_REG, "--------------T-SSSSSSSS----G-F-", LocalStack); - - Memory_Fetch('W', V0, TRUE); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[EFFADDR], regnameslong[EFFADDR], regnameslong[V0]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[EFFADDR], REG_A7); - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void unlinkasm(void) -{ - int sreg ; - int Opcode, BaseCode ; - - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0x4e58 | sreg ; - BaseCode = 0x4e58 ; - - if (OpcodeArray[BaseCode] == - 2) { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 12; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[MEMBASE]); - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[EFFADDR], regnameslong[T0]); - - Memory_Read('L', EFFADDR, "--------T-----T-SSSSSSSS----G-F-", LocalStack); - - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[V0], regnameslong[T0]); - fprintf(fp, "\t\t addiu %s,%s,4\n", regnameslong[EFFADDR], regnameslong[EFFADDR]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[EFFADDR], REG_A7); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void trap(void) -{ - int Count; - int BaseCode = 0x4E40; - char DelaySlot[64] = ""; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - fprintf(fp, "\t\t andi %s,%s,0x0f\n", regnameslong[V0], regnameslong[OPCODE]); - sprintf(DelaySlot, "ori %s,%s,32 ", regnameslong[V0], regnameslong[V0]); - Exception(-1, DelaySlot); - Completed(); - } - - for (Count = 0; Count <= 15; Count++) - OpcodeArray[BaseCode + Count] = BaseCode; -} - -void reset(void) -{ - int BaseCode = 0x4E70; - char * Label; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - Label = GenerateLabel(BaseCode, 0); - - TimingCycles += 132; - - fprintf(fp, "%s:\n", Label ); - SavePreviousPC(); - - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T0], REG_SRH); - fprintf(fp, "\t\t andi %s,%s,0x20 \t # Supervisor Mode ?\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t bne %s,$0,9f\n", regnameslong[T0]); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n\n", regnameslong[PC], regnameslong[PC]); - - Exception(8, NULL); - - fprintf(fp, "\n\t9:\n"); - - /* Prefetch next instruction and check for a reset callback */ - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], REG_RESET_CALLBACK); - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[T9]); - fprintf(fp, "\t\t lhu %s,0x00(%s) \t # Delay slot\n", regnameslong[OPCODE], regnameslong[PC]); - - /* Callback for Reset */ - - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[ICNT], ICOUNT); - - if (SavedRegs[FLAG_C] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_V] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_Z] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_N] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_X] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], LocalStack, regnameslong[SP]); - } - assert(LocalStack >= MINSTACK_POS); - - fprintf(fp, "\t\t jalr %s\n", regnameslong[T9]); - fprintf(fp, "\t\t sw %s,%s \t # Delay slot\n", regnameslong[PC], REG_PC); - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[ICNT], ICOUNT); - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[PC], REG_PC); - - if (SavedRegs[FLAG_X] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_N] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_Z] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_V] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_C] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - - if (SavedRegs[BASEPC] == '-') - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[BASEPC], OP_ROM); - - fprintf(fp, "\t\t lhu %s,0x00(%s)\n", regnameslong[OPCODE], regnameslong[PC]); - - fprintf(fp, "\t9:\n"); - //fprintf(fp, "\t\t jmp [%s_OPCODETABLE+ecx*4]\n\n", CPUtype); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[TMPREG0], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n\n", regnameslong[TMPREG0], regnameslong[TMPREG0], regnameslong[OPCODETBL]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n\n", regnameslong[TMPREG0], regnameslong[TMPREG0]); - fprintf(fp, "\t\t jr %s\n", regnameslong[TMPREG0]); - fprintf(fp, "\t\t addiu %s,%s,%d \t # Delay slot\n", regnameslong[ICNT], regnameslong[ICNT], -TimingCycles); - } - OpcodeArray[BaseCode] = BaseCode; -} - -void nop(void) -{ - int BaseCode = 0x4e71; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 4; - - Completed(); - OpcodeArray[BaseCode] = BaseCode ; - } -} - -void stop(void) -{ - char TrueLabel[16]; - int BaseCode = 0x4e72 ; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - TimingCycles += 4; - - /* Must be in Supervisor Mode */ - - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T0], REG_SRH); - fprintf(fp, "\t\t andi %s,%s,0x20 \t # Supervisor Mode ?\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[T0]); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n\n", regnameslong[PC], regnameslong[PC]); - - /* Next WORD is new SR */ - - Memory_Fetch('W', V0, FALSE); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - - WriteCCR('W', V0); - - /* See if Valid interrupt waiting */ - - CheckInterrupt = 0; - - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[V1], REG_IRQ); - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[V0], regnameslong[V1]); - - fprintf(fp, "\t\t xori %s,%s,0x07 \t # Always take 7\n", regnameslong[T9], regnameslong[V0]); - //fprintf(fp, "\t\t beq %s,$0,procint\n", regnameslong[T9]); - fprintf(fp, "\t\t bne %s,$0,8f\n", regnameslong[T9]); - fprintf(fp, "\t\t nop \t # Delay slot\n\n"); - fprintf(fp, "\t\t j procint\n"); - fprintf(fp, "\t\t nop \t # Delay slot\n\n"); - fprintf(fp, "\t8:\n\n"); - - fprintf(fp, "\t\t lbu %s,%s \t # int mask\n", regnameslong[T0], REG_SRH); - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T9], regnameslong[T0], regnameslong[V0]); - //fprintf(fp, "\t\t bne %s,$0,procint\n\n", regnameslong[T9]); - fprintf(fp, "\t\t bgez %s,8f\n", regnameslong[T9]); - fprintf(fp, "\t\t nop \t # Delay slot\n\n"); - fprintf(fp, "\t\t j procint\n"); - fprintf(fp, "\t\t nop \t # Delay slot\n\n"); - fprintf(fp, "\t8:\n\n"); - - /* No int waiting - clear count, set stop */ - - ClearRegister(ICNT); - fprintf(fp, "\t\t ori %s,%s,0x80\n", regnameslong[V1], regnameslong[V1]); - fprintf(fp, "\t\t sb %s,%s\n", regnameslong[V1], REG_IRQ); - Completed(); - - /* User Mode - Exception */ - - Align(); - fprintf(fp, "\t9:\n"); - Exception(8, NULL); - - OpcodeArray[BaseCode] = BaseCode ; - } -} - -void ReturnFromException(void) -{ - char TrueLabel[16]; - char flags[] = "----------------SS---SSS----G-F-"; - - int BaseCode = 0x4e73; - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - SavePreviousPC(); - - TimingCycles += 20; - - /* Check in Supervisor Mode */ - - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T0], REG_SRH); - fprintf(fp, "\t\t andi %s,%s,0x20 \t # Supervisor Mode ?\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[T0]); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n\n", regnameslong[PC], regnameslong[PC]); - - /* Get SR */ - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[FLAG_C], REG_A7); - Memory_Read('W', FLAG_C, flags, LocalStack); - fprintf(fp, "\t\t addiu %s,%s,6\n", regnameslong[T0], regnameslong[FLAG_C]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[T0], REG_A7); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FLAG_V], regnameslong[V0]); - - /* Get PC */ - - Memory_Read('L', FLAG_C, flags, LocalStack); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[T0], regnameslong[V0]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[V0], regnameslong[FLAG_V]); - - /* Update CCR (and A7) */ - - WriteCCR('W', V0); - - MemoryBanking(T0, LocalStack); - Completed(); - - fprintf(fp, "\t9:\n"); - Exception(8, NULL); - - OpcodeArray[BaseCode] = BaseCode; -} - -void trapv(void) -{ - int BaseCode = 0x4E76; - char * Label; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - Label = GenerateLabel(BaseCode, 0); - fprintf(fp, "%s\n", Label); - - TimingCycles += 4; - - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n\n", regnameslong[PC], regnameslong[PC]); - Exception(7, NULL); - - fprintf(fp, "\t9:\n"); - Completed(); - } - OpcodeArray[BaseCode] = BaseCode ; -} - -void illegal_opcode(void) -{ - Align(); - fprintf(fp, "ILLEGAL:\n"); - //fprintf(fp, "\t\t la %s,%sillegal_op\n", regnameslong[T0], PREF); - //fprintf(fp, "\t\t la %s,%sillegal_pc\n", regnameslong[T1], PREF); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T9], regnameslong[PC], regnameslong[BASEPC]); - //fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[OPCODE], regnameslong[T0]); - //fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[T9], regnameslong[T1]); - fprintf(fp, "\t\t sw %s,%sillegal_op\n", regnameslong[OPCODE], PREF); - fprintf(fp, "\t\t sw %s,%sillegal_pc\n", regnameslong[T9], PREF); - - Exception(4, NULL); -} - -/* - * Return from subroutine - * restoring flags as well - * - */ - -void ReturnandRestore(void) -{ - int BaseCode = 0x4e77; - char flags[] = "----------------SS---SSS----G-F-"; - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - //fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 20; - - /* Get SR */ - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[FLAG_C], REG_A7); - Memory_Read('W', FLAG_C, flags, LocalStack); - fprintf(fp, "\t\t addiu %s,%s,6\n", regnameslong[T0], regnameslong[FLAG_C]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[T0], REG_A7); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FLAG_V], regnameslong[V0]); - - /* Get PC */ - - Memory_Read('L', FLAG_C, flags, LocalStack); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[T0], regnameslong[V0]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[V0], regnameslong[FLAG_V]); - - /* Update flags */ - - WriteCCR('B', V0); - - MemoryBanking(T0, LocalStack); - Completed(); - - OpcodeArray[BaseCode] = BaseCode; -} - -/* - * Return from Subroutine - * - */ - -void rts(void) -{ - int BaseCode = 0x4e75; - - if (OpcodeArray[BaseCode] == -2) - { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - SavePreviousPC(); - - TimingCycles += 16; - - OpcodeArray[BaseCode] = BaseCode ; - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - fprintf(fp, "\t\t addiu %s,%s,4\n", regnameslong[T0], regnameslong[FASTCALL_FIRST_REG]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[T0], REG_A7); - Memory_Read('L', FASTCALL_FIRST_REG, "----------------SSSSSSS-----G-F-", LocalStack); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[T0], regnameslong[V0]); - MemoryBanking(T0, LocalStack); - Completed(); - } -} - -void jmp_jsr(void) -{ - int Opcode, BaseCode; - int dreg, mode, type; - int Dest; - char allow[] = "--2--56789a-----"; - - for (type = 0 ; type < 2 ; type++) - for (mode = 0 ; mode < 8 ; mode++) - for (dreg = 0 ; dreg < 8 ; dreg++) { - Opcode = 0x4e80 | (type << 6) | (mode << 3) | dreg; - BaseCode = Opcode & 0x4ef8; - if (mode == 7) - BaseCode = BaseCode | dreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - if (allow[Dest&0x0f] != '-') { - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - SavePreviousPC(); - if ((type == 0) || (mode != 2)) - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - switch (mode) { - case 2: - TimingCycles += 8; - break; - case 5: - case 7: - case 9: - TimingCycles += 10; - break; - case 8: - TimingCycles += 12; - break; - case 6: - case 10: - TimingCycles += 14; - break; - } - - if (type == 0) /* jsr takes 8 more than jmp */ - TimingCycles += 8; - - if (mode < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - EffectiveAddressCalculate(Dest, 'L', OPCODE, TRUE, TRUE); - - /* jsr needs to push PC onto stack */ - - if (type == 0) { - PushPC("--------------T-SSSSSSS-----G-F-"); - } - - MemoryBanking(EFFADDR, LocalStack); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -void cmpm(void) -{ - int Opcode, BaseCode; - int regx,leng,regy; - int ModeModX, ModeModY; - char Size = ' '; - - for (regx = 0; regx < 8 ; regx++) - for (leng = 0; leng < 3 ; leng++) - for (regy = 0; regy < 8 ; regy++) { - Opcode = 0xb108 | (regx << 9) | (leng << 6) | regy; - BaseCode = Opcode & 0xb1c8 ; - - ModeModX = 0; - ModeModY = 0; - - if (leng == 0) { - if (regx == 7) { - BaseCode |= (regx << 9); - ModeModX = 16; - } - - if (regy == 7) { - BaseCode |= regy; - ModeModY = 16; - } - } - - switch (leng) { - case 0: - Size = 'B'; - break; - case 1: - Size = 'W'; - break; - case 2: - Size = 'L'; - break; - } - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - SavePreviousPC(); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - AddEACycles = 0 ; - - if (Size != 'L') - TimingCycles += 12 ; - else - TimingCycles += 20 ; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - EffectiveAddressRead(3 + ModeModY, Size, T0, T0, "--------------------SSSST---G-F-", TRUE, TRUE, TRUE); - EffectiveAddressRead(3 + ModeModX, Size, OPCODE, V0, "--------T-----------SSSS----G-F-", TRUE, FALSE, TRUE); - - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[V1], regnameslong[V0], regnameslong[T0]); - SetFlags(Size, FLAGS_CMP, V1, V0, T0); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void exg(void) -{ - int Opcode, BaseCode; - int regx, type, regy; - int opmask[3] = {0x08, 0x09, 0x11}; - - for (regx = 0; regx < 8; regx++) - for (type = 0; type < 3; type++) - for (regy = 0; regy < 8; regy++) { - Opcode = 0xc100 | (regx << 9) | (opmask[type] << 3) | regy; - BaseCode = Opcode & 0xc1c8; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 6 ; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[MEMBASE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - - if (type == 0) { - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[V0], regnameslong[T0]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[V1], regnameslong[OPCODE]); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V1], regnameslong[T0]); - } - if (type == 1) { - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[V0], regnameslong[T0]); - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[V1], regnameslong[OPCODE]); - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[V1], regnameslong[T0]); - } - if (type == 2) { - fprintf(fp, "\t\t lw %s,0x20(%s)\n", regnameslong[V0], regnameslong[T0]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[V1], regnameslong[OPCODE]); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t sw %s,0x20(%s)\n", regnameslong[V1], regnameslong[T0]); - } - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void ext(void) -{ - int Opcode, BaseCode; - int type, regy; - - for (type = 2; type < 4/*8*/; type++) // MC68000 and 68010 don't have EXTB.L (Byte --> Long) - for (regy = 0; regy < 8; regy++) { - if (type > 3 && type < 7) - continue; - Opcode = 0x4800 | (type<<6) | regy; - BaseCode = Opcode & 0x48c0; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 4 ; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - - if (type == 2) { /* byte to word */ - fprintf(fp, "\t\t lb %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - SetFlags('W', FLAGS_BITOP, V0, 0, 0); - fprintf(fp, "\t\t sh %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - } - if (type == 3) { /* word to long */ - fprintf(fp, "\t\t lh %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - SetFlags('L', FLAGS_BITOP, V0, 0, 0); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - } - if (type == 7) { /* byte to long */ - fprintf(fp, "\t\t lb %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - SetFlags('L', FLAGS_BITOP, V0, 0, 0); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - } - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void swap(void) -{ - int Opcode, BaseCode; - int sreg; - - for (sreg = 0; sreg < 8 ; sreg++) { - Opcode = 0x4840 | sreg; - BaseCode = Opcode & 0x4840; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 4 ; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t ror %s,%s,16\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - SetFlags('L', FLAGS_BITOP, V0, 0, 0); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -/* - * Line A and Line F commands - * - */ - -void LineA(void) -{ - int Count; - - /* Line A */ - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(0xA000, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - Exception(0x0A, NULL); - - for (Count = 0xA000; Count < 0xB000; Count++) { - OpcodeArray[Count] = 0xA000; - } -} - -void LineF(void) -{ - int Count; - - /* Line F */ - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(0xF000, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - Exception(0x0B, NULL); - - for (Count = 0xF000; Count < 0x10000; Count++) { - OpcodeArray[Count] = 0xF000; - } -} - -/* - * Moves To/From CCR and SR - * - * (Move from CCR is 68010 command) - * - */ - -void movesr(void) -{ - int Opcode, BaseCode; - int type, mode, sreg; - int Dest; - char allow[] = "0-2345678-------"; - char Size; - char DelaySlot[64] = ""; - - for (type = 0; type < 4 ; type++) - for (mode = 0; mode < 8 ; mode++) - for (sreg = 0; sreg < 8 ; sreg++) { - Opcode = 0x40c0 | (type << 9) | ( mode << 3 ) | sreg; - - /* To has extra modes */ - - if (type > 1) { - allow[0x9] = '9'; - allow[0xa] = 'a'; - allow[0xb] = 'b' ; - } - - if ((type == 0) || (type == 3)) - Size = 'W'; /* SR */ - else - Size = 'B'; /* CCR */ - - BaseCode = Opcode & 0x46f8 ; - - if (mode == 7) - BaseCode |= sreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[BaseCode] == -2) { - char TrueLabel[16]; - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode,0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - if (type != 3) - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (type > 1) /* move to */ - TimingCycles += 12 ; - else { - if (mode < 2) - TimingCycles += 6 ; - else - TimingCycles += 8 ; - } - - /* If Move to SR then must be in Supervisor Mode */ - - if (type == 3) { - - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T0], REG_SRH); - fprintf(fp, "\t\t andi %s,%s,0x20 \t # Supervisor Mode ?\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[T0]); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n\n", regnameslong[PC], regnameslong[PC]); - } - - /* 68010 Command ? */ - if ((type == 1) && (mode < 7)) { - sprintf(DelaySlot, "\t\t andi %s,%s,0x07 \t # Delay slot\n", regnameslong[OPCODE], regnameslong[OPCODE]); - CheckCPUtype(1, DelaySlot, NULL); - } else if (type == 1) { - CheckCPUtype(1, NULL, NULL); - } else if (mode < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - /* Always read/write word 2 bytes */ - if (type < 2) { - /*if (type == 0) { // Move from SR first read the destionation before write - EffectiveAddressRead(Dest & 15, 'W', OPCODE, V0, "-----------------SSSSSSSST---G-F-", FALSE, TRUE, TRUE); - ReadCCR(Size, V0); - EffectiveAddressWrite(Dest & 15, 'W', OPCODE, FALSE, "----------------SSSSSSSS----G-F-", FALSE, FALSE); - } else*/ { - ReadCCR(Size, V0); - EffectiveAddressWrite(Dest & 15, 'W', OPCODE, TRUE, "----------------SSSSSSSS----G-F-", TRUE, TRUE); - } - } else { - EffectiveAddressRead(Dest & 15, 'W', OPCODE, V0, "---------------------SSS----G-F-", FALSE, TRUE, TRUE); - WriteCCR(Size, V0); - } - Completed(); - - /* Exception if not Supervisor Mode */ - - if (type == 3) { - /* Was in User Mode - Exception */ - - fprintf(fp, "\t9:\n"); - Exception(8, NULL); - } - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Decimal mode Add / Subtracts - * - */ - -void abcd_sbcd(void) -{ - int Opcode, BaseCode; - int regx, type, rm, regy, mode; - int ModeModX; - int ModeModY; - char flags[] = "------------------S-SSSS----G-F-"; - - for (type = 0; type < 2; type ++) /* 0 = sbcd, 1 = abcd */ - for (regx = 0; regx < 8; regx++) - for (rm = 0; rm < 2; rm++) - for (regy = 0; regy < 8; regy++) { - Opcode = 0x8100 | (type << 14) | (regx << 9) | (rm << 3) | regy; - BaseCode = Opcode & 0xc108; - - ModeModX = 0; - ModeModY = 0; - - if (rm == 0) - mode = 0; - else { - mode = 4; - - if (regx == 7) { - BaseCode |= (regx << 9); - ModeModY = 16; - } - if (regy == 7) { - BaseCode |= regy; - ModeModX = 16; - } - } - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if (mode == 4) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - AddEACycles = 0; - - if (rm == 0) - TimingCycles += 6; - else - TimingCycles += 18; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - flags[OPCODE] = 'T'; - EffectiveAddressRead(mode + ModeModX, 'B', T0, T0, flags, FALSE, TRUE, TRUE); - flags[EFFADDR] = 'T'; - flags[T0] = 'T'; - EffectiveAddressRead(mode + ModeModY, 'B', OPCODE, T1, flags, FALSE, FALSE, TRUE); - flags[OPCODE] = '-'; - flags[EFFADDR] = '-'; - flags[T0] = '-'; - - fprintf(fp, "\t\t %s %s,%s,%s\n", type == 0 ? "subu" : "addu", regnameslong[FLAG_V], regnameslong[T1], regnameslong[T0]); - fprintf(fp, "\t\t %s %s,%s,%s\n", type == 0 ? "subu" : "addu", regnameslong[FLAG_V], regnameslong[FLAG_V], regnameslong[FLAG_X]); - fprintf(fp, "\t\t andi %s,%s,0xFF\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - - fprintf(fp, "\t\t andi %s,%s,0x0F\n", regnameslong[T2], regnameslong[T0]); - fprintf(fp, "\t\t andi %s,%s,0x0F\n", regnameslong[T3], regnameslong[T1]); - fprintf(fp, "\t\t andi %s,%s,0xF0\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t andi %s,%s,0xF0\n", regnameslong[T1], regnameslong[T1]); - - if (type == 0) { - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[T2]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[FLAG_X]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T1], regnameslong[T1], regnameslong[T0]); - fprintf(fp, "\t\t sltiu %s,%s,10\n", regnameslong[T4], regnameslong[T3]); - fprintf(fp, "\t\t xori %s,%s,1\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[T4]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[T4]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[V0], regnameslong[T1], regnameslong[T3]); - fprintf(fp, "\t\t sltiu %s,%s,0x9a\n", regnameslong[FLAG_C], regnameslong[V0]); - fprintf(fp, "\t\t xori %s,%s,1 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - fprintf(fp, "\t\t sll %s,%s,5\n", regnameslong[T4], regnameslong[FLAG_C]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T4]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T4]); - - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[FLAG_N], regnameslong[FLAG_V], regnameslong[V0]); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], regnameslong[FLAG_N]); - fprintf(fp, "\t\t srl %s,%s,7 \t # Set Overflow\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - } else { - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[T2]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[FLAG_X]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T1], regnameslong[T1], regnameslong[T0]); - fprintf(fp, "\t\t sltiu %s,%s,10\n", regnameslong[T4], regnameslong[T3]); - fprintf(fp, "\t\t xori %s,%s,1\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[T4]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[T4]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[V0], regnameslong[T1], regnameslong[T3]); - fprintf(fp, "\t\t sltiu %s,%s,0x9a\n", regnameslong[FLAG_C], regnameslong[V0]); - fprintf(fp, "\t\t xori %s,%s,1 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - fprintf(fp, "\t\t sll %s,%s,5\n", regnameslong[T4], regnameslong[FLAG_C]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T4]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T4]); - - fprintf(fp, "\t\t nor %s,$0,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[FLAG_N], regnameslong[FLAG_V], regnameslong[V0]); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[FLAG_V], regnameslong[FLAG_N]); - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Overflow\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - } - - /* Should only clear Zero flag if not zero */ - - fprintf(fp, "\t\t sltiu %s,%s,1\n", regnameslong[T9], regnameslong[V0]); - fprintf(fp, "\t\t and %s,%s,%s \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z], regnameslong[T9]); - fprintf(fp, "\t\t srl %s,%s,7 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0]); - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - - flags[FLAG_C] = 'S'; - EffectiveAddressWrite(mode, 'B', OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -/* - * Rotate Left / Right - * - */ - -void rol_ror(void) -{ - int Opcode, BaseCode; - int dreg, dr, leng, ir, sreg; - char Size = ' '; - char * Label; - char flags[] = "--------------------SSSS----G-F-"; - - for (dreg = 0; dreg < 8; dreg++) - for (dr = 0; dr < 2; dr++) - for (leng = 0; leng < 3; leng++) - for (ir = 0 ; ir < 2; ir++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0xe018 | (dreg << 9) | (dr << 8) | (leng << 6) | (ir << 5) | sreg ; - BaseCode = Opcode & 0xe1f8 ; - - switch (leng) { - case 0: - Size = 'B'; - break; - case 1: - Size = 'W'; - break; - case 2: - Size = 'L'; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (Size != 'L') - TimingCycles += 6 ; - else - TimingCycles += 8 ; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,%d\n", regnameslong[OPCODE], regnameslong[OPCODE], ir == 0 ? 9 : 7); - - flags[T0] = 'T'; - if (ir == 0) { - Immediate8(); - } else { - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - EffectiveAddressRead(0, 'L', OPCODE, OPCODE, flags, FALSE, FALSE, TRUE); - fprintf(fp, "\t\t andi %s,%s,0x3F\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - flags[OPCODE] = 'T'; - EffectiveAddressRead(0, Size, T0, V0, flags, FALSE, TRUE, TRUE); - flags[OPCODE] = '-'; - flags[T0] = '-'; - - /* shift 0 - no time, no shift and clear carry */ - - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[OPCODE]); - fprintf(fp, "\t\t and %s,$0,$0 \t # Delay slot - Clear Carry\n", regnameslong[FLAG_C]); - - /* allow 2 cycles per shift */ - - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T9], regnameslong[OPCODE]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[ICNT], regnameslong[ICNT], regnameslong[T9]); - - if (Size != 'L') - fprintf(fp, "\t\t andi %s,%s,0x%2.2X\n", regnameslong[OPCODE], regnameslong[OPCODE], Size == 'W' ? 15 : 7); - - if (dr == 0) { - if (Size != 'L') { - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[T9], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x%2.2X\n", regnameslong[T9], regnameslong[T9], Size == 'W' ? 15 : 7); - fprintf(fp, "\t\t sllv %s,%s,%s\n", regnameslong[T9], regnameslong[V0], regnameslong[T9]); - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T9]); - fprintf(fp, "\t\t srl %s,%s,%d \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V0], Size == 'W' ? 15 : 7); - } else { - fprintf(fp, "\t\t rorv %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,31 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V0]); - } - } else { - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[T9], regnameslong[OPCODE]); - if (Size != 'L') { - fprintf(fp, "\t\t andi %s,%s,0x%2.2X\n", regnameslong[T9], regnameslong[T9], Size == 'W' ? 15 : 7); - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[T9], regnameslong[V0], regnameslong[T9]); - fprintf(fp, "\t\t sllv %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T9]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V0]); - } else { - fprintf(fp, "\t\t rorv %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T9]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V0]); - } - } - - fprintf(fp, "\t9:\n"); - - if (Size != 'L') - fprintf(fp, "\t\t andi %s,%s,0x%2.2X\n", regnameslong[V0], regnameslong[V0], Size == 'W' ? 0xffff : 0xff); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[V0]); - fprintf(fp, "\t\t srl %s,%s,%d \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0], Size == 'L' ? 31 : (Size == 'W' ? 15 : 7)); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - EffectiveAddressWrite(0, Size, T0, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void rol_ror_ea(void) -{ - int Opcode, BaseCode; - int dr, mode, sreg; - int Dest; - char allow[] = "--2345678-------"; - char flags[] = "--------------------SSSS----G-F-"; - - for (dr = 0; dr < 2; dr++) - for (mode = 0; mode < 8; mode++) - for (sreg = 0 ; sreg < 8; sreg++) { - Opcode = 0xe6c0 | (dr << 8) | (mode << 3) | sreg; - BaseCode = Opcode & 0xfff8; - - if (mode == 7) - BaseCode |= sreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[ BaseCode ] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 8 ; - - if ((Dest & 0xf) < 7) - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - flags[EFFADDR] = 'T'; - EffectiveAddressRead(Dest & 0xf, 'W', OPCODE, V0, flags, FALSE, TRUE, TRUE); - flags[EFFADDR] = '-'; - - if (dr == 0) { - fprintf(fp, "\t\t sll %s,%s,15\n", regnameslong[T9], regnameslong[V0]); - fprintf(fp, "\t\t srl %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T9]); - fprintf(fp, "\t\t srl %s,%s,15 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V0]); - } else { - fprintf(fp, "\t\t srl %s,%s,15\n", regnameslong[T9], regnameslong[V0]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T9]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V0]); - } - - fprintf(fp, "\t\t andi %s,%s,0xffff\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[V0]); - fprintf(fp, "\t\t srl %s,%s,15 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0]); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - EffectiveAddressWrite(Dest & 0xf, 'W', OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Logical Shift Left / Right - * - */ - -void lsl_lsr(void) -{ - int Opcode, BaseCode; - int dreg, dr, leng, ir, sreg; - char Size = ' '; - char flags[] = "--------------------SSSS----G-F-"; - - for (dreg = 0; dreg < 8; dreg++) - for (dr = 0; dr < 2; dr++) - for (leng = 0; leng < 3; leng++) - for (ir = 0; ir < 2; ir++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0xe008 | (dreg << 9) | (dr << 8) | (leng << 6) | (ir << 5) | sreg; - BaseCode = Opcode & 0xe1f8; - - switch (leng) { - case 0: - Size = 'B'; - break; - case 1: - Size = 'W'; - break; - case 2: - Size = 'L'; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (Size != 'L') - TimingCycles += 6 ; - else - TimingCycles += 8 ; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,%d\n", regnameslong[OPCODE], regnameslong[OPCODE], ir == 0 ? 9 : 7); - - flags[T0] = 'T'; - if (ir == 0) { - Immediate8(); - } else { - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - EffectiveAddressRead(0, 'L', OPCODE, OPCODE, flags, FALSE, FALSE, TRUE); - fprintf(fp, "\t\t andi %s,%s,0x3F\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - /* and 2 cycles per shift */ - - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T9], regnameslong[OPCODE]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[ICNT], regnameslong[ICNT], regnameslong[T9]); - - flags[OPCODE] = 'T'; - EffectiveAddressRead(0, Size, T0, V0, flags, FALSE, TRUE, TRUE); - flags[OPCODE] = '-'; - flags[T0] = '-'; - - /* ASG: on the 68k, the shift count is mod 64; on the MIPS, the */ - /* shift count is mod 32; we need to check for shifts of 32-63 */ - /* and produce zero */ - fprintf(fp, "\t\t andi %s,%s,0x20\n", regnameslong[T1], regnameslong[OPCODE]); - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[T2], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x20\n", regnameslong[T3], regnameslong[T2]); - - if (dr == 0) { - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[FLAG_C], regnameslong[V0], regnameslong[T2]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - // The actual work - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[OPCODE]); - } else { - if (Size != 'L') - fprintf(fp, "\t\t sll %s,%s,%d\n", regnameslong[FLAG_C], regnameslong[V0], Size == 'W' ? 16 : 24); - fprintf(fp, "\t\t sllv %s,%s,%s\n", regnameslong[FLAG_C], regnameslong[FLAG_C], regnameslong[T2]); - fprintf(fp, "\t\t srl %s,%s,31 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - // The actual work - fprintf(fp, "\t\t sllv %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[OPCODE]); - } - - if (Size != 'L') - fprintf(fp, "\t\t andi %s,%s,0x%2.2X\n", regnameslong[V0], regnameslong[V0], Size == 'W' ? 0xffff : 0xff); - fprintf(fp, "\t\t movn %s,$0,%s \t # Return 0 if shift by 32-63\n", regnameslong[V0], regnameslong[T1]); - fprintf(fp, "\t\t movn %s,$0,%s \t # Clear Carry if shift by >32\n", regnameslong[FLAG_C], regnameslong[T3]); - fprintf(fp, "\t\t movz %s,$0,%s \t # Clear Carry if shift by 0\n", regnameslong[FLAG_C], regnameslong[OPCODE]); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - if (Size == 'L') { - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0]); - } else { - fprintf(fp, "\t\t srl %s,%s,%d \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0], Size == 'W' ? 15 : 7); - } - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[V0]); - fprintf(fp, "\t\t movn %s,%s,%s \t # Set X if not shift by 0\n", regnameslong[FLAG_X], regnameslong[FLAG_C], regnameslong[OPCODE]); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - EffectiveAddressWrite(0, Size, T0, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void lsl_lsr_ea(void) -{ - int Opcode, BaseCode; - int dr, mode, sreg; - int Dest; - char allow[] = "--2345678-------"; - char flags[] = "---------------------SSS----G-F-"; - - for (dr = 0; dr < 2; dr++) - for (mode = 0; mode < 8; mode++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0xe2c0 | (dr << 8) | (mode << 3) | sreg; - BaseCode = Opcode & 0xfff8; - - if (mode == 7) - BaseCode |= sreg ; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[ BaseCode ] == -2) { - - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 8 ; - - if ((Dest & 0xf) < 7) - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - flags[EFFADDR] = 'T'; - EffectiveAddressRead(Dest & 0xf, 'W', OPCODE, V0, flags, FALSE, TRUE, TRUE); - flags[EFFADDR] = '-'; - - if (dr == 0) { - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V0]); - fprintf(fp, "\t\t srl %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - } else { - fprintf(fp, "\t\t srl %s,%s,15 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V0]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - } - - fprintf(fp, "\t\t andi %s,%s,0xffff\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t srl %s,%s,15 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[V0]); - fprintf(fp, "\t\t movn %s,%s,%s \t # Set X if not shift by 0\n", regnameslong[FLAG_X], regnameslong[FLAG_C], regnameslong[OPCODE]); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - flags[FLAG_X] = 'S'; - EffectiveAddressWrite(Dest & 0xf, 'W', OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - flags[FLAG_X] = '-'; - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Rotate Left / Right though Extend - * - */ - -void roxl_roxr(void) -{ - int Opcode, BaseCode; - int dreg, dr, leng, ir, sreg; - char Size = ' '; - char* Label; - char flags[] = "--------------------SSSS----G-F-"; - - for (dreg = 0; dreg < 8; dreg++) - for (dr = 0; dr < 2; dr++) - for (leng = 0; leng < 3; leng++) - for (ir = 0; ir < 2; ir++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0xe010 | (dreg << 9) | (dr << 8) | (leng << 6) | (ir << 5) | sreg; - BaseCode = Opcode & 0xe1f8; - - switch (leng) { - case 0: - Size = 'B'; - break; - case 1: - Size = 'W'; - break; - case 2: - Size = 'L'; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (Size != 'L') - TimingCycles += 6 ; - else - TimingCycles += 8 ; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,%d\n", regnameslong[OPCODE], regnameslong[OPCODE], ir == 0 ? 9 : 7); - - flags[T0] = 'T'; - if (ir == 0) { - Immediate8(); - } else { - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - EffectiveAddressRead(0, 'L', OPCODE, OPCODE, flags, FALSE, FALSE, TRUE); - fprintf(fp, "\t\t andi %s,%s,0x3F\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - flags[OPCODE] = 'T'; - EffectiveAddressRead(0, Size, T0, V0, flags, FALSE, TRUE, TRUE); - flags[OPCODE] = '-'; - flags[T0] = '-'; - - /* shift 0 - no time, no shift and copy X to carry */ - - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[OPCODE]); - fprintf(fp, "\t\t or %s,$0,%s \t # Delay slot - Copy X to Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_X]); - - /* allow 2 cycles per shift */ - - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T9], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,1\n", regnameslong[T1], regnameslong[OPCODE]); - fprintf(fp, "\t\t bne %s,%s,7f\n", regnameslong[T1], regnameslong[OPCODE]); - fprintf(fp, "\t\t subu %s,%s,%s \t # Delay slot\n", regnameslong[ICNT], regnameslong[ICNT], regnameslong[T9]); - - /* rotate by 1 */ - if (dr == 0) { - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set X\n", regnameslong[FLAG_X], regnameslong[V0]); - fprintf(fp, "\t\t sll %s,%s,%d\n", regnameslong[FLAG_C], regnameslong[FLAG_C], Size == 'L' ? 31 : (Size == 'W' ? 15 : 7)); - fprintf(fp, "\t\t srl %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t bgez $0,6f\n"); - fprintf(fp, "\t\t or %s,%s,%s \t # Delay slot\n", regnameslong[V0], regnameslong[V0], regnameslong[FLAG_C]); - } else { - fprintf(fp, "\t\t srl %s,%s,%d \t # Set X\n", regnameslong[FLAG_X], regnameslong[V0], Size == 'L' ? 31 : (Size == 'W' ? 15 : 7)); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t bgez $0,6f\n"); - fprintf(fp, "\t\t or %s,%s,%s \t # Delay slot\n", regnameslong[V0], regnameslong[V0], regnameslong[FLAG_C]); - } - - /* rotate by n (n > 1) */ - - fprintf(fp, "\t7:\n"); - fprintf(fp, "\t\t ori %s,$0,%d\n", regnameslong[T3], Size == 'L' ? 33 : (Size == 'W' ? 17 : 9)); - fprintf(fp, "\t8:\n"); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T1], regnameslong[OPCODE], regnameslong[T3]); - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[T9], regnameslong[T1]); - fprintf(fp, "\t\t slt %s,%s,$0\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t\t beq %s,$0,8b\n", regnameslong[T9]); - fprintf(fp, "\t\t movz %s,%s,%s \t # Delay slot\n", regnameslong[OPCODE], regnameslong[T1], regnameslong[T9]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[OPCODE]); - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[T1], regnameslong[OPCODE]); - - if (dr == 0) { - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[T2], regnameslong[T3]); - fprintf(fp, "\t\t sllv %s,%s,%s\n", regnameslong[FLAG_C], regnameslong[FLAG_C], regnameslong[T2]); - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[FLAG_X], regnameslong[V0], regnameslong[T1]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set X\n", regnameslong[FLAG_X], regnameslong[FLAG_X]); - fprintf(fp, "\t\t sllv %s,%s,%s\n", regnameslong[T9], regnameslong[V0], regnameslong[T3]); - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T9]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[FLAG_C]); - } else { - fprintf(fp, "\t\t sllv %s,%s,%s\n", regnameslong[FLAG_C], regnameslong[FLAG_C], regnameslong[T1]); - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[FLAG_X], regnameslong[V0], regnameslong[T3]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set X\n", regnameslong[FLAG_X], regnameslong[FLAG_X]); - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[T9], regnameslong[V0], regnameslong[T3]); - fprintf(fp, "\t\t sllv %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T9]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[FLAG_C]); - } - - fprintf(fp, "\t6:\n"); - fprintf(fp, "\t\t or %s,$0,%s \t # Copy X to Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_X]); - fprintf(fp, "\t9:\n"); - if (Size != 'L') - fprintf(fp, "\t\t andi %s,%s,0x%2.2X\n", regnameslong[V0], regnameslong[V0], Size == 'W' ? 0xffff : 0xff); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t srl %s,%s,%d \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0], Size == 'L' ? 31 : (Size == 'W' ? 15 : 7)); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[V0]); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - EffectiveAddressWrite(0, Size, T0, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - - /* End with special routines for ROXx.x #1,Dx */ - - for (dr = 0; dr < 2; dr++) - for (leng = 0; leng < 3; leng++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0xe210 | (dr << 8) | (leng << 6) | sreg; - BaseCode = Opcode & 0xe3d0; - - switch (leng) { - case 0: - Size = 'B'; - break; - case 1: - Size = 'W'; - break; - case 2: - Size = 'L'; - break; - } - - if (sreg == 0) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - if (Size != 'L') - TimingCycles += 8; - else - TimingCycles += 10; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - flags[OPCODE] = 'T'; - EffectiveAddressRead(0, Size, OPCODE, V0, flags, FALSE, TRUE, TRUE); - flags[OPCODE] = '-'; - - if (dr == 0) { - fprintf(fp, "\t\t sll %s,%s,%d\n", regnameslong[T1], regnameslong[FLAG_X], Size == 'L' ? 31 : (Size == 'W' ? 15 : 7)); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set X\n", regnameslong[FLAG_X], regnameslong[V0]); - fprintf(fp, "\t\t srl %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - } else { - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[T1], regnameslong[FLAG_X]); - fprintf(fp, "\t\t srl %s,%s,%d \t # Set X\n", regnameslong[FLAG_X], regnameslong[V0], Size == 'L' ? 31 : (Size == 'W' ? 15 : 7)); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - } - - fprintf(fp, "\t\t or %s,$0,%s \t # Copy X to Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_X]); - if (Size != 'L') - fprintf(fp, "\t\t andi %s,%s,0x%2.2X\n", regnameslong[V0], regnameslong[V0], Size == 'W' ? 0xffff : 0xff); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t srl %s,%s,%d \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0], Size == 'L' ? 31 : (Size == 'W' ? 15 : 7)); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[V0]); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - EffectiveAddressWrite(0, Size, OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - - Completed(); - } - OpcodeArray[Opcode] = BaseCode; - } -} - - -void roxl_roxr_ea(void) -{ - int Opcode, BaseCode; - int dr, mode, sreg; - int Dest; - char allow[] = "--2345678-------"; - char flags[] = "--------------------SSSS----G-F-"; - - for (dr = 0; dr < 2; dr++) - for (mode = 0; mode < 8; mode++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0xe4c0 | (dr << 8) | (mode << 3) | sreg; - BaseCode = Opcode & 0xfff8; - - if (mode == 7) - BaseCode |= sreg; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[ BaseCode ] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 8 ; - - if ((Dest & 0xf) < 7) - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - flags[EFFADDR] = 'T'; - EffectiveAddressRead(Dest & 0xf, 'W', OPCODE, V0, flags, FALSE, TRUE, TRUE); - flags[EFFADDR] = '-'; - - if (dr == 0) { - fprintf(fp, "\t\t sll %s,%s,15\n", regnameslong[T1], regnameslong[FLAG_X]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set X\n", regnameslong[FLAG_X], regnameslong[V0]); - fprintf(fp, "\t\t srl %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - } else { - fprintf(fp, "\t\t andi %s,%s,0x01\n", regnameslong[T1], regnameslong[FLAG_X]); - fprintf(fp, "\t\t srl %s,%s,15 \t # Set X\n", regnameslong[FLAG_X], regnameslong[V0]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T1]); - } - - fprintf(fp, "\t\t or %s,$0,%s \t # Copy X to Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_X]); - fprintf(fp, "\t\t andi %s,%s,0xffff\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t srl %s,%s,15 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[V0]); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - EffectiveAddressWrite(Dest & 0xf, 'W', OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Arithmetic Shift Left / Right - * - */ - -void asl_asr(void) -{ - int Opcode, BaseCode; - int dreg, dr, leng, ir, sreg; - char Size = ' '; - char* Label; - char flags[] = "--------------------SSSS----G-F-"; - - /* Normal routines for codes */ - - for (dreg = 0; dreg < 8; dreg++) - for (dr = 0; dr < 2; dr++) - for (leng = 0; leng < 3; leng++) - for (ir = 0; ir < 2; ir++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0xe000 | (dreg << 9) | (dr << 8) | (leng << 6) | (ir << 5) | sreg; - BaseCode = Opcode & 0xe1f8; - - switch (leng) { - case 0: - Size = 'B'; - break; - case 1: - Size = 'W'; - break; - case 2: - Size = 'L'; - break; - } - - if (OpcodeArray[ BaseCode ] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - fprintf(fp, "\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - Label = GenerateLabel(0, 1); - - if (Size != 'L') - TimingCycles += 6; - else - TimingCycles += 8; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - fprintf(fp, "\t\t srl %s,%s,%d\n", regnameslong[OPCODE], regnameslong[OPCODE], ir == 0 ? 9 : 7); - - flags[T0] = 'T'; - if (ir == 0) { - Immediate8(); - } else { - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - EffectiveAddressRead(0, 'L', OPCODE, OPCODE, flags, FALSE, FALSE, TRUE); - fprintf(fp, "\t\t andi %s,%s,0x3F\n", regnameslong[OPCODE], regnameslong[OPCODE]); - } - - flags[OPCODE] = 'T'; - EffectiveAddressRead(0, Size, T0, V0, flags, TRUE, TRUE, TRUE); - flags[OPCODE] = '-'; - flags[T0] = '-'; - - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[OPCODE], Label); - fprintf(fp, "\t\t and %s,$0,$0 \t # Delay slot - Clear Carry\n", regnameslong[FLAG_C]); - - /* allow 2 cycles per shift */ - - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[T9], regnameslong[OPCODE]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[ICNT], regnameslong[ICNT], regnameslong[T9]); - - if (dr == 0) { - /* ASR */ - - /* ASG: on the 68k, the shift count is mod 64; on the MIPS, the */ - /* shift count is mod 32; we need to check for shifts of 32-63 */ - /* and effectively shift 31 */ - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[T1], regnameslong[OPCODE]); - fprintf(fp, "\t\t sll %s,%s,26\n", regnameslong[T9], regnameslong[OPCODE]); - fprintf(fp, "\t\t sra %s,%s,31\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t\t andi %s,%s,0x1f\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[T9]); - fprintf(fp, "\t\t sll %s,%s,26\n", regnameslong[T9], regnameslong[T1]); - fprintf(fp, "\t\t sra %s,%s,31\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t\t andi %s,%s,0x1f\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[T1], regnameslong[T1], regnameslong[T9]); - - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[FLAG_C], regnameslong[V0], regnameslong[T1]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - - fprintf(fp, "\t\t srav %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[OPCODE]); - - /* Mode 0 write does not affect Flags */ - EffectiveAddressWrite(0, Size, T0, FALSE, flags, FALSE, FALSE); - - /* Update Flags */ - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - fprintf(fp, "\t9:\n"); - - } else { - /* ASL */ - - fprintf(fp, "\t\t sll %s,%s,26\n", regnameslong[T9], regnameslong[OPCODE]); - fprintf(fp, "\t\t sra %s,%s,31\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t\t andi %s,%s,0x1f\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[T9], regnameslong[OPCODE], regnameslong[T9]); - - /* Check to see if Overflow should be set */ - - fprintf(fp,"\t\t clz %s,%s\n", regnameslong[T1], regnameslong[V0]); - fprintf(fp,"\t\t clo %s,%s\n", regnameslong[T2], regnameslong[V0]); - if (Size != 'L') { - fprintf(fp,"\t\t addiu %s,%s,%d\n", regnameslong[T1], regnameslong[T1], Size == 'W' ? -16 : -24); - fprintf(fp,"\t\t addiu %s,%s,%d\n", regnameslong[T2], regnameslong[T2], Size == 'W' ? -16 : -24); - } - fprintf(fp,"\t\t sltu %s,%s,%s\n", regnameslong[T1], regnameslong[T1], regnameslong[T9]); - fprintf(fp,"\t\t sltu %s,%s,%s\n", regnameslong[T2], regnameslong[T2], regnameslong[T9]); - fprintf(fp,"\t\t or %s,%s,%s \t # Set Overflow\n", regnameslong[FLAG_V], regnameslong[T1], regnameslong[T2]); - - /* more than 31 shifts and long */ - - if ((ir == 1) && (leng == 2)) { - fprintf(fp, "\t\t andi %s,%s,0x20\n", regnameslong[T1], regnameslong[OPCODE]); - fprintf(fp, "\t\t movn %s,$0,%s\n", regnameslong[V0], regnameslong[T1]); - } - - fprintf(fp, "\t\t subu %s,$0,%s\n", regnameslong[T1], regnameslong[OPCODE]); - if (leng != 2) - fprintf(fp, "\t\t andi %s,%s,0x%2.2X\n", regnameslong[T1], regnameslong[T1], leng == 1 ? 15 : 7); - fprintf(fp, "\t\t srlv %s,%s,%s\n", regnameslong[FLAG_C], regnameslong[V0], regnameslong[T1]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[FLAG_C]); - - fprintf(fp, "\t\t sllv %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[OPCODE]); - - /* Mode 0 write does not affect Flags */ - EffectiveAddressWrite(0, Size, T0, FALSE, flags, FALSE, FALSE); - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - fprintf(fp,"\t9:\n"); - } - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0]); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[V0]); - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - - /* End with special routines for ASL.x #1,Dx */ - /* To do correct V setting, ASL needs quite a */ - /* bit of additional code. A Shift of one is */ - /* easy to set on MIPS, and is very common */ - /* in 68000 programs. */ - - for (leng = 0; leng < 3; leng++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0xe300 | (leng << 6) | sreg; - BaseCode = Opcode & 0xe3c8; - - switch (leng) { - case 0: - Size = 'b'; - break; - case 1: - Size = 'h'; - break; - case 2: - Size = 'w'; - break; - } - - if (sreg == 0) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if (Size != 'w') - TimingCycles += 6; - else - TimingCycles += 8; - - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t l%c%c %s,0x00(%s)\n", Size, Size == 'w' ? ' ' : 'u', regnameslong[V1], regnameslong[OPCODE]); - fprintf(fp, "\n\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[V0], regnameslong[V1]); - fprintf(fp, "\t\t s%c %s,0x00(%s)\n", Size, regnameslong[V0], regnameslong[OPCODE]); - - fprintf(fp, "\t\t srl %s,%s,%d \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V1], Size == 'w' ? 31 : (Size == 'h' ? 15 : 7)); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[V0], regnameslong[V1]); - fprintf(fp, "\t\t srl %s,%s,%d", regnameslong[FLAG_V], regnameslong[FLAG_V], Size == 'w' ? 31 : (Size == 'h' ? 15 : 7)); - if (Size != 'w') - fprintf(fp, "\n\t\t andi %s,%s,0x01 ", regnameslong[FLAG_V], regnameslong[FLAG_V]); - else - fprintf(fp, " "); - fprintf(fp, "\t # Set Overflow\n"); - if (Size == 'w') - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[FLAG_Z], regnameslong[V0]); - else - fprintf(fp, "\t\t andi %s,%s,0x%2.2X\n", regnameslong[FLAG_Z], regnameslong[V0], Size == 'h' ? 0xffff : 0xff); - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[FLAG_Z]); - fprintf(fp, "\t\t srl %s,%s,%d \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0], Size == 'w' ? 31 : (Size == 'h' ? 15 : 7)); - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - - Completed(); - - } - - OpcodeArray[Opcode] = BaseCode ; - } -} - -void asl_asr_ea(void) -{ - int Opcode, BaseCode; - int dr, mode, sreg; - int Dest; - char allow[] = "--2345678-------"; - char flags[] = "---------------------SSS----G-F-"; - - for (dr = 0; dr < 2; dr++) - for (mode = 0; mode < 8; mode++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0xe0c0 | (dr << 8) | (mode << 3) | sreg; - BaseCode = Opcode & 0xfff8; - - if (mode == 7) - BaseCode |= sreg; - - Dest = EAtoAMN(BaseCode, FALSE); - - if (allow[Dest & 0xf] != '-') { - if (OpcodeArray[BaseCode] == -2) { - - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\n\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - TimingCycles += 8 ; - - if ((Dest & 0xf) < 7) - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[OPCODE], regnameslong[OPCODE]); - flags[EFFADDR] = 'T'; - EffectiveAddressRead(Dest & 0xf, 'W', OPCODE, dr == 0 ? V0 : V1, flags, dr == 0, TRUE, TRUE); - flags[EFFADDR] = '-'; - - if (dr == 0) { - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V0]); - fprintf(fp, "\t\t and %s,$0,$0 \t # Clear Overflow\n", regnameslong[FLAG_V]); - fprintf(fp, "\t\t sra %s,%s,1\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t slt %s,%s,$0 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0]); - } else { - fprintf(fp, "\t\t sll %s,%s,1\n", regnameslong[V0], regnameslong[V1]); - - fprintf(fp, "\t\t srl %s,%s,15 \t # Set Carry\n", regnameslong[FLAG_C], regnameslong[V1]); - fprintf(fp, "\t\t xor %s,%s,%s\n", regnameslong[FLAG_V], regnameslong[V0], regnameslong[V1]); - fprintf(fp, "\t\t srl %s,%s,15\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t andi %s,%s,0x01 \t # Set Overflow\n", regnameslong[FLAG_V], regnameslong[FLAG_V]); - fprintf(fp, "\t\t andi %s,%s,0xffff\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t srl %s,%s,15 \t # Set Sign\n", regnameslong[FLAG_N], regnameslong[V0]); - } - - fprintf(fp, "\t\t sltiu %s,%s,1 \t # Set Zero\n", regnameslong[FLAG_Z], regnameslong[V0]); - fprintf(fp, "\t\t or %s,$0,%s \t # Copy Carry to X\n", regnameslong[FLAG_X], regnameslong[FLAG_C]); - - flags[FLAG_C] = 'S'; - flags[FLAG_V] = 'S'; - flags[FLAG_Z] = 'S'; - flags[FLAG_N] = 'S'; - flags[FLAG_X] = 'S'; - EffectiveAddressWrite(Dest & 0xf, 'W', OPCODE, FALSE, flags, FALSE, FALSE); - flags[FLAG_C] = '-'; - flags[FLAG_V] = '-'; - flags[FLAG_Z] = '-'; - flags[FLAG_N] = '-'; - flags[FLAG_X] = '-'; - Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - -/* - * Divide Commands - */ - -void divides(void) -{ - int dreg, type, mode, sreg; - int Opcode, BaseCode; - int Dest; - char allow[] = "0-23456789ab-----"; - char DelaySlot[32]; - int Cycles; - char flags[] = "--------------------SSSS----G-F-"; - - int divide_cycles[12] = { - 38, 0, 42, 42, 44, 46, 50, 46, 50, 46, 48, 42 - }; - - for (dreg = 0; dreg < 8; dreg++) - for (type = 0; type < 2; type++) - for (mode = 0; mode < 8; mode++) - for (sreg = 0; sreg < 8; sreg++) { - Opcode = 0x80c0 | (dreg << 9) | (type << 8) | (mode << 3) | sreg; - BaseCode = Opcode & 0x81f8; - if (mode == 7) { - BaseCode |= sreg ; - } - - Dest = EAtoAMN(Opcode, FALSE); - if (allow[Dest & 0x0f] != '-') { - if (OpcodeArray[ BaseCode ] == -2) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode, 0)); - - if ((Dest >= 2) && (Dest <= 10)) - SavePreviousPC(); - - fprintf(fp, "\n\t\t addiu %s,%s,2\n\n", regnameslong[PC], regnameslong[PC]); - - - /* Cycle Timing (if succeeds OK) */ - - Cycles = divide_cycles[Dest & 0x0f] + 95 + (type * 17); - - if (Cycles > 32767) { - fprintf(fp, "\t\t ori %s,$0,%d\n", regnameslong[T9], Cycles); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[ICNT], regnameslong[ICNT], regnameslong[T9]); - } else { - fprintf(fp, "\t\t addiu %s,%s,%d\n", regnameslong[ICNT], regnameslong[ICNT], -Cycles); - } - - if (mode < 7) { - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[OPCODE]); - } - - fprintf(fp, "\t\t srl %s,%s,7\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t andi %s,%s,0x1C\n", regnameslong[OPCODE], regnameslong[OPCODE]); - - flags[OPCODE] = 'T'; - flags[EFFADDR] = 'T'; - EffectiveAddressRead(Dest, 'W', T0, V0, flags, type == 1 /* signed */, TRUE, TRUE); /* source */ - - fprintf(fp, "\t\t beq %s,$0,9f \t # do div by zero trap\n", regnameslong[V0]); - fprintf(fp, "\t\t nop \t # Delay slot\n"); - - EffectiveAddressRead(0, 'L', OPCODE, T0, flags, TRUE, FALSE, TRUE); /* dest */ - flags[OPCODE] = '-'; - flags[EFFADDR] = '-'; - - if (type == 1) { /* signed */ - fprintf(fp, "\t\t div $0,%s,%s\n", regnameslong[T0], regnameslong[V0]); - - /* Check for Overflow */ - - fprintf(fp, "\t\t mflo %s\n", regnameslong[T1]); - fprintf(fp, "\t\t sll %s,%s,16\n", regnameslong[T0], regnameslong[T1]); - fprintf(fp, "\t\t sra %s,%s,16\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t bne %s,%s,8f\n", regnameslong[T0], regnameslong[T1]); - fprintf(fp, "\t\t andi %s,%s,0xffff \t # Delay slot\n", regnameslong[T1], regnameslong[T1]); - } else { - fprintf(fp, "\t\t divu $0,%s,%s\n", regnameslong[T0], regnameslong[V0]); - - /* Check for Overflow */ - - fprintf(fp, "\t\t mflo %s\n", regnameslong[T1]); - fprintf(fp, "\t\t srl %s,%s,16\n", regnameslong[T0], regnameslong[T1]); - fprintf(fp, "\t\t bne %s,$0,8f\n", regnameslong[T0]); - } - - /* Sort out Result */ - - fprintf(fp, "\t\t mfhi %s%s\n", regnameslong[V1], type == 1 ? "" : " \t # Delay slot"); - fprintf(fp, "\t\t sll %s,%s,16\n", regnameslong[V1], regnameslong[V1]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V0], regnameslong[T1], regnameslong[V1]); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - - SetFlags('W', FLAGS_MOVE, T1, 0, 0); - - fprintf(fp, "\t7:\n"); - Completed(); - - - /* Overflow */ - - Align(); - fprintf(fp, "\t8:\n"); - fprintf(fp, "\t\t bgez $0,7b\n"); - fprintf(fp, "\t\t ori %s,$0,1 \t # Selay slot - V flag\n", regnameslong[FLAG_V]); - //Completed(); - - - /* Division by Zero */ - - Align(); - fprintf(fp, "\t9:\t\t # Do divide by zero trap\n"); - - /* Correct cycle counter for error */ - - fprintf(fp, "\t\t addiu %s,%s,%d\n", regnameslong[ICNT], regnameslong[ICNT], 95 + (type * 17)); - sprintf(DelaySlot, "ori %s,$0,5 ", regnameslong[V0]); - Exception(-1, DelaySlot); - fprintf(fp, "\t\t bgez $0,7b\n"); - fprintf(fp, "\t\t nop \t # Delay slot\n"); - //Completed(); - } - - OpcodeArray[Opcode] = BaseCode ; - } - } -} - - -/* - * 68010 Extra Opcodes - * - * move from CCR is done above - * - */ - -void ReturnandDeallocate(void) -{ - int BaseCode = 0x4e74 ; - - if (OpcodeArray[BaseCode] == -2) { - Align(); - fprintf(fp, "%s:\n",GenerateLabel(BaseCode, 0)); - - CheckCPUtype(1, NULL, NULL); - - SavePreviousPC(); - - TimingCycles += 16; - - OpcodeArray[BaseCode] = BaseCode; - - /* Get Return Address */ - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - Memory_Read('L', FASTCALL_FIRST_REG, "----------------SSSSSSS-----G-F-", LocalStack); - - - /* Get Displacement */ - - Memory_Fetch('W' ,T0, TRUE); - - - /* Set PC = New Address */ - - //fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[PC], regnameslong[V0]); - - - /* Correct Stack for Return Address and Displacement */ - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T1], REG_A7); - fprintf(fp, "\t\t addiu %s,%s,4\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T1], regnameslong[T0], regnameslong[T1]); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[T1], REG_A7); - - MemoryBanking(V0, LocalStack); - Completed(); - } -} - -void MoveControlRegister(void) -{ - int Direction; - int BaseCode = 0x4e7a; - - for (Direction = 0; Direction < 2; Direction++) { - Align(); - fprintf(fp, "%s:\n", GenerateLabel(BaseCode + Direction, 0)); - - TimingCycles += 4; /* Assume same as move usp */ - - CheckCPUtype(1, NULL, NULL); - - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T0], REG_SRH); - fprintf(fp, "\t\t andi %s,%s,0x20 \t # Supervisor Mode ?\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t beq %s,$0,9f\n", regnameslong[T0]); - fprintf(fp, "\t\t addiu %s,%s,2 \t # Delay slot\n", regnameslong[PC], regnameslong[PC]); - - fprintf(fp, "\t\t lhu %s,0x00(%s)\n", regnameslong[T0], regnameslong[PC]); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[PC], regnameslong[PC]); - - /* Sort out Control Register ID */ - - fprintf(fp, "\t\t andi %s,%s,0x01\n", regnameslong[V0], regnameslong[T0]); - fprintf(fp, "\t\t srl %s,%s,10\n", regnameslong[OPCODE], regnameslong[T0]); - fprintf(fp, "\t\t andi %s,%s,0x02\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[V0]); - - /* Sort out Register */ - - fprintf(fp, "\t\t srl %s,%s,12\n", regnameslong[T0], regnameslong[T0]); - - if (Direction == 0) { - /* from Control */ - - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t addiu %s,%s,%d\n", regnameslong[OPCODE], regnameslong[OPCODE], REG_SFC_BASE); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[MEMBASE]); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[T0]); - } else { - /* To Control */ - - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T0], regnameslong[T0], regnameslong[MEMBASE]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[V0], regnameslong[T0]); - - /* Mask out for SFC & DFC */ - - fprintf(fp, "\t\t andi %s,%s,0x02\n", regnameslong[T1], regnameslong[OPCODE]); - fprintf(fp, "\t\t bne %s,$0,8f\n", regnameslong[T1]); - fprintf(fp, "\t\t nop \t # Delay slot\n"); - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t8:\n"); - - /* Write to control */ - - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[OPCODE], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[OPCODE], regnameslong[OPCODE], regnameslong[MEMBASE]); - fprintf(fp, "\t\t addiu %s,%s,%d\n", regnameslong[OPCODE], regnameslong[OPCODE], REG_SFC_BASE); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[V0], regnameslong[OPCODE]); - } - - Completed(); - - /* Not Supervisor Mode */ - - Align(); - fprintf(fp, "\t9:\n"); - Exception(8, NULL); - - OpcodeArray[BaseCode + Direction] = BaseCode + Direction; - } -} - -void MoveAddressSpace(void) -{ -} - -/* - * Generate Jump Table - * - */ - -void JumpTable(void) -{ - int Opcode, l, op; - -#ifdef RLETABLE - fprintf(fp, ".word OP%d_1000\n", CPU); - - l = 0; - for (Opcode = 0x0; Opcode < 0x10000;) { - - op = OpcodeArray[Opcode]; - - fprintf(fp, ".word "); - - l = 1; - if (op > -1) { - while (op == OpcodeArray[Opcode + l] && ((Opcode + l) & 0xfff) != 0) { - l++; - } - } else { - while (OpcodeArray[Opcode + l] < 0 && ((Opcode + l) & 0xfff) != 0) { - l++; - } - } - - Opcode += l; - - if (l > 255) { - if (op > -1) - fprintf(fp, "OP%d_%4.4x - OP%d_1000\n", CPU, op, CPU); - else - fprintf(fp, "ILLEGAL - OP%d_1000\n", CPU); - - fprintf(fp, ".word %d\n", l); - } else { - if (op > -1) - fprintf(fp, "(OP%d_%4.4x - OP%d_1000) + (%d * 1000000h)\n", CPU, op, CPU, l); - else - fprintf(fp, "(ILLEGAL - OP%d_1000) + (%d * 1000000h)\n", CPU, l); - } - } -#else - l = 0; - for (Opcode = 0x0; Opcode < 0x10000;) { - - op = OpcodeArray[Opcode]; - - l = 1; - if (op > -1) { - while (op == OpcodeArray[Opcode + l] && ((Opcode + l) & 0xfff) != 0) { - l++; - } - } else { - while (OpcodeArray[Opcode + l] < 0 && ((Opcode + l) & 0xfff) != 0) { - l++; - } - } - - Opcode += l; - - if (l > 1) { - fprintf(fp, ".rept %d\n", l); - if (op > -1) { - fprintf(fp, "\t.word\t OP%d_%4.4x\n", CPU, op); - } else { - fprintf(fp, "\t.word\t ILLEGAL\n"); - } - fprintf(fp, ".endr\n"); - } else { - if (op > -1) - fprintf(fp, ".word\t\t OP%d_%4.4x\n", CPU, op); - else - fprintf(fp, ".word\t\t ILLEGAL\n"); - } - } -#endif -} - -#ifdef TESTTABLE -void TestTable(void) -{ - int Opcode, l, op, line = 0; - - fprintf(fp, "unsigned short OpTestTbl[%d] = {\n", Opcount); - - for (Opcode = 0x0; Opcode < 0x10000; Opcode++) { - - op = OpcodeArray[Opcode]; - - if (op < 0) continue; - - for (l = Opcode + 1; l < 0x10000; l++) - if (OpcodeArray[l] == op) OpcodeArray[l] = -1; - - fprintf(fp, " 0x%04X,", op); - if (++line == 16) { - fprintf(fp, "\n"); - line = 0; - } - } - - if (line) fprintf(fp, "\n"); - - fprintf(fp, "};\n\n"); -} -#endif - -void CodeSegmentBegin(void) -{ - int ExLocalStack; - -/* Messages */ - - fprintf(fp, " # MIPS Make68K - V%s - Copyright 2005, Manuel Geran (bdiamond@free.fr)\n", VERSION); - fprintf(fp, " # based on Make68K - Copyright 1998, Mike Coates (mame@btinternet.com)\n"); - fprintf(fp, " # & Darren Olafson (deo@mail.island.net)\n"); - -/* Needed code to make it work! */ - - fprintf(fp, "\t\t .set arch=allegrex\n\n"); - - fprintf(fp, "\t\t .set noreorder\n"); - fprintf(fp, "\t\t .set nomacro\n"); - fprintf(fp, "\t\t .set nobopt\n"); - fprintf(fp, " #\t\t .set noat\n\n"); - - fprintf(fp, "\t\t .globl %s_RUN\n", CPUtype); - fprintf(fp, "\t\t .globl %s_RESET\n", CPUtype); - fprintf(fp, "\t\t .globl %s_regs\n", CPUtype); -#ifdef RLETABLE - fprintf(fp, "\t\t .globl %s_COMPTABLE\n", CPUtype); -#endif - fprintf(fp, "\t\t .globl %s_OPCODETABLE\n", CPUtype); - - /* ASG - only one interface to memory now */ - fprintf(fp, "\t\t .globl %sa68k_memory_intf\n", PREF); - - fprintf(fp, "\n\n # Vars Mame declares / needs access to\n\n"); - - fprintf(fp, "\t\t .extern %sm68k_ICount,4\n", PREF); - fprintf(fp, "\t\t .extern %sOP_ROM,4\n", PREF); - fprintf(fp, "\t\t .extern %sOP_RAM,4\n", PREF); - - fprintf(fp, "\t\t .extern %smem_amask,4\n", PREF); - fprintf(fp, "\t\t .extern %smame_debug,4\n", PREF); - fprintf(fp, "\t\t .extern %sillegal_op,4\n", PREF); - fprintf(fp, "\t\t .extern %sillegal_pc,4\n", PREF); - - fprintf(fp, "\t\t .extern %sopcode_entry,4\n", PREF); - fprintf(fp, "\t\t .extern %scur_mrhard,4\n", PREF); - -#ifdef MAME_DEBUG - fprintf(fp, "\t\t .extern %sm68k_illegal_opcode,4\n", PREF); -#endif - - fprintf(fp, "\n\n\n\t\t .text\n\n"); - - -/* Reset routine */ - - fprintf(fp, "\t .ent %s_RESET\n", CPUtype); - fprintf(fp, "%s_RESET:\n", CPUtype); - fprintf(fp, "\t\t .frame %s, %d, %s\n", regnameslong[SP], 0, regnameslong[RA]); - -#ifdef RLETABLE - fprintf(fp, " # Build Jump Table (not optimised!)\n\n"); - - fprintf(fp, "\t\t la %s,%s_OPCODETABLE\t\t # Jump Table\n", regnameslong[T0], CPUtype); - fprintf(fp, "\t\t la %s,%s_COMPTABLE\t\t # RLE Compressed Table\n", regnameslong[T1], CPUtype); - - fprintf(fp, "\t\t lui %s,0xff\n", regnameslong[V0]); - fprintf(fp, "\t\t ori %s,%s,0xffff\n", regnameslong[V0], regnameslong[V0]); - - /* Reference Point in T2 */ - - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[T2], regnameslong[T1]); - fprintf(fp, "\t\t addiu %s,%s,4\n", regnameslong[T1], regnameslong[T1]); - - fprintf(fp, "RESET0:\n"); - fprintf(fp, "\t\t lw %s,0x00(%s)\n", regnameslong[T3], regnameslong[T1]); - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[T4], regnameslong[T3]); - fprintf(fp, "\t\t and %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[V0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[T3], regnameslong[T3], regnameslong[T2]); - - /* if count is zero, then it's a word RLE length */ - - fprintf(fp, "\t\t srl %s,%s,24\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t bne %s,$0,RESET1\n", regnameslong[T4]); - fprintf(fp, "\t\t addiu %s,%s,4\t\t # Delay slot\n", regnameslong[T1], regnameslong[T1]); - - fprintf(fp, "\t\t lw %s,0x00(%s)\t\t # Repeats\n", regnameslong[T4], regnameslong[T4]); - - fprintf(fp, "\t\t beq %s,$0,RESET2\t\t # Finished!\n", regnameslong[T4]); - fprintf(fp, "\t\t addiu %s,%s,4\t\t # Delay slot\n", regnameslong[T1], regnameslong[T1]); - - fprintf(fp, "RESET1:\n"); - fprintf(fp, "\t\t sw %s,0x00(%s)\n", regnameslong[T3], regnameslong[T0]); - fprintf(fp, "\t\t addiu %s,%s,-1\n", regnameslong[T4], regnameslong[T4]); - fprintf(fp, "\t\t bne %s,$0,RESET1\n", regnameslong[T4]); - fprintf(fp, "\t\t addiu %s,%s,4\t\t # Delay slot\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t bgez $0,RESET0\n"); - fprintf(fp, "\t\t nop\t\t\t # Delay slot\n\n"); - - fprintf(fp, "RESET2:\n"); -#endif - - fprintf(fp, "\t\t jr %s\n", regnameslong[RA]); - fprintf(fp, "\t\t nop\t\t\t # Delay slot\n\n"); - fprintf(fp, "\t .end %s_RESET\n\n\n", CPUtype); - - -/* Emulation Entry Point */ - - Align(); - - fprintf(fp, "\t .ent %s_RUN\n", CPUtype); - fprintf(fp, "%s_RUN:\n", CPUtype); - - fprintf(fp, "\t\t addiu %s,%s,%d\n", regnameslong[SP], regnameslong[SP], -STACKFRAME_SIZE); - fprintf(fp, "\t\t .frame %s, %d, %s\n\n", regnameslong[SP], STACKFRAME_SIZE, regnameslong[RA]); -#if (MEMBASE == GP) - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[GP], STACKFRAME_SIZE - 0x2C, regnameslong[SP]); -#endif - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[S0], STACKFRAME_SIZE - 0x28, regnameslong[SP]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[S1], STACKFRAME_SIZE - 0x24, regnameslong[SP]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[S2], STACKFRAME_SIZE - 0x20, regnameslong[SP]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[S3], STACKFRAME_SIZE - 0x1C, regnameslong[SP]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[S4], STACKFRAME_SIZE - 0x18, regnameslong[SP]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[S5], STACKFRAME_SIZE - 0x14, regnameslong[SP]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[S6], STACKFRAME_SIZE - 0x10, regnameslong[SP]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[S7], STACKFRAME_SIZE - 0x0C, regnameslong[SP]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[S8], STACKFRAME_SIZE - 0x08, regnameslong[SP]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[RA], STACKFRAME_SIZE - 0x04, regnameslong[SP]); - - //fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[MEMBASE], regnameslong[A0]); - fprintf(fp, "\t\t la %s,%sM68000_regs\n", regnameslong[MEMBASE], PREF); - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T0], REG_IRQ); - fprintf(fp, "\t\t xori %s,%s,0x80\n", regnameslong[T1], regnameslong[T0]); - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[ICNT], ICOUNT); - fprintf(fp, "\t\t beq %s,$0,MC68Kexit\n", regnameslong[T1]); - fprintf(fp, "\t\t movz %s,$0,%s\t\t # Delay slot\n", regnameslong[ICNT], regnameslong[T1]); - fprintf(fp, "\t\t la %s,%sM68000_OPCODETABLE\n", regnameslong[OPCODETBL], PREF); - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[BASEPC], OP_ROM); - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[PC], REG_PC); - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[V0], REG_CCR); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[PC], regnameslong[BASEPC], regnameslong[PC]); - - WriteCCR('B', V0); - - fprintf(fp, " # Check for Interrupt waiting\n\n"); - //fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T0], REG_IRQ); - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t bne %s,$0,interrupt\n\n", regnameslong[T0]); - fprintf(fp, "\t\t nop\t\t\t # Delay slot\n\n"); - - fprintf(fp, "IntCont:\n"); - - /* See if was only called to check for Interrupt */ - - fprintf(fp, "\t\t bltz %s,MainExit\n", regnameslong[ICNT]); - - /* 16 Bit Fetch */ - fprintf(fp, "\t\t lhu %s,0x00(%s)\t\t # Delay slot\n\n", regnameslong[OPCODE], regnameslong[PC]); - - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[TMPREG0], regnameslong[OPCODE]); - fprintf(fp, "\t\t addu %s,%s,%s\n\n", regnameslong[TMPREG0], regnameslong[TMPREG0], regnameslong[OPCODETBL]); - fprintf(fp, "\t\t lw %s,0x00(%s)\n\n", regnameslong[TMPREG0], regnameslong[TMPREG0]); - fprintf(fp, "\t\t jr %s\n", regnameslong[TMPREG0]); - fprintf(fp,"\t\t nop\t\t\t # Delay slot\n\n"); - - Align(); - - fprintf(fp, "MainExit:\n"); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[PC], regnameslong[PC], regnameslong[BASEPC]); - fprintf(fp, "\t\t sw %s,%s\t\t # Save PC\n", regnameslong[PC], REG_PC); - - /* If in Debug mode make normal SR register */ - -#ifdef MAME_DEBUG - - ReadCCR('W', V0); - -#else - - ReadCCR('B', V0); - -#endif - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T0], REG_SRH); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[V0], REG_CCR); - fprintf(fp, "\t\t andi %s,%s,0x20\n", regnameslong[T0], regnameslong[T0]); - fprintf(fp, "\t\t bne %s,$0,ME1\t\t # Mode ?\n", regnameslong[T0]); - fprintf(fp, "\t\t lw %s,%s\t\t # Delay slot - Get A7\n", regnameslong[V0], REG_A7); - fprintf(fp, "\t\t bgez $0,MC68Kexit\n"); - fprintf(fp, "\t\t sw %s,%s\t\t # Delay slot - Save in USP\n", regnameslong[V0], REG_USP); - fprintf(fp, "ME1:\n"); - fprintf(fp, "\t\t sw %s,%s\t\t # Save in ISP\n", regnameslong[V0], REG_ISP); - fprintf(fp, "MC68Kexit:\n"); - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[ICNT], ICOUNT); - -#if (MEMBASE == GP) - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[GP], STACKFRAME_SIZE - 0x2C, regnameslong[SP]); -#endif - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[S0], STACKFRAME_SIZE - 0x28, regnameslong[SP]); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[S1], STACKFRAME_SIZE - 0x24, regnameslong[SP]); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[S2], STACKFRAME_SIZE - 0x20, regnameslong[SP]); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[S3], STACKFRAME_SIZE - 0x1C, regnameslong[SP]); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[S4], STACKFRAME_SIZE - 0x18, regnameslong[SP]); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[S5], STACKFRAME_SIZE - 0x14, regnameslong[SP]); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[S6], STACKFRAME_SIZE - 0x10, regnameslong[SP]); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[S7], STACKFRAME_SIZE - 0x0C, regnameslong[SP]); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[S8], STACKFRAME_SIZE - 0x08, regnameslong[SP]); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[RA], STACKFRAME_SIZE - 0x04, regnameslong[SP]); - - fprintf(fp, "\t\t jr %s\n", regnameslong[RA]); - fprintf(fp, "\t\t addiu %s,%s,%d\t\t # Delay slot\n", regnameslong[SP], regnameslong[SP], STACKFRAME_SIZE); - fprintf(fp, "\t .end %s_RUN\n\n\n", CPUtype); - -/* Check for Pending Interrupts */ - - Align(); - fprintf(fp, " # Interrupt check\n\n"); - - fprintf(fp, "interrupt:\n"); - - /* check to exclude interrupts */ - - fprintf(fp, "\t\t lbu %s,%s\n", regnameslong[T1], REG_IRQ); - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[V0], regnameslong[T1]); - - fprintf(fp, "\t\t xori %s,%s,0x07\t\t # Always take 7\n", regnameslong[T0], regnameslong[V0]); - fprintf(fp, "\t\t beq %s,$0,procint\n", regnameslong[T0]); - fprintf(fp, "\t\t nop\t\t\t # Delay slot\n\n"); - - fprintf(fp, "\t\t lbu %s,%s\t\t # int mask\n", regnameslong[V1], REG_SRH); - fprintf(fp, "\t\t andi %s,%s,0x07\n", regnameslong[V1], regnameslong[V1]); - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[T0], regnameslong[V0], regnameslong[V1]); - fprintf(fp, "\t\t blez %s,IntCont\n", regnameslong[T0]); - fprintf(fp, "\t\t nop\t\t\t # Delay slot\n\n"); - - /* Take pending Interrupt */ - - Align(); - fprintf(fp, "procint:\n"); - - /* LVR - Enable proper IRQ handling (require explicit acknowledge) */ - /* fprintf(fp, "\t\t andi %s,%s,0x78\t\t # remove interrupt & stop\n\n", regnameslong[T1], regnameslong[T1]); */ - fprintf(fp, "\t\t andi %s,%s,0x7f\t\t # remove stop\n", regnameslong[T1], regnameslong[T1]); - fprintf(fp, "\t\t sb %s,%s\n\n", regnameslong[T1], REG_IRQ); - - /* Get Interrupt Vector from callback */ - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], REG_IRQ_CALLBACK); - LocalStack -= 4; - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\t\t # save level\n\n", regnameslong[V0], LocalStack, regnameslong[SP]); - - if (SavedRegs[V1] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[V0], LocalStack, regnameslong[SP]); - } else { - fprintf(fp, "\t\t or %s,$0,%s\n", regnameslong[V1], regnameslong[V0]); - } - - if (SavedRegs[PC] == '-') { - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[PC], REG_PC); - } - - if (SavedRegs[FLAG_C] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_V] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_Z] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_N] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], LocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_X] == '-') { - LocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], LocalStack, regnameslong[SP]); - } - - assert(LocalStack >= MINSTACK_POS); - - fprintf(fp, "\t\t sw %s,%s\n", regnameslong[ICNT], ICOUNT); - fprintf(fp, "\t\t jalr %s\t # get the IRQ level\n", regnameslong[T9]); - fprintf(fp, "\t\t or %s,$0,%s\t\t # irq line #\t\t Delay slot\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[V0]); - - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[ICNT], ICOUNT); - - if (SavedRegs[FLAG_X] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_N] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_Z] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_V] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - if (SavedRegs[FLAG_C] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], LocalStack, regnameslong[SP]); - LocalStack += 4; - } - - if (SavedRegs[PC] == '-') { - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[PC], REG_PC); - } - - /* Do we want to use normal vector number ? */ - - fprintf(fp, "\t\t bgez %s,AUTOVECTOR\n", regnameslong[V0]); - - /* Only need V0 restored if default vector to be used */ - - if (SavedRegs[V1] == '-') { - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\t\t # Delay slot\n", regnameslong[V1], LocalStack, regnameslong[SP]); - LocalStack += 4; - } else { - fprintf(fp, "\t\t nop\t\t\t # Delay slot\n"); - } - - /* Just get default vector */ - - fprintf(fp, "\t\t addiu %s,%s,24\t\t # Vector\n\n", regnameslong[V0], regnameslong[V1]); - - fprintf(fp, "AUTOVECTOR:\n\n"); - - Exception(-1, NULL); - - fprintf(fp, "\t\t lbu %s,%s\t\t # set Int mask\n", regnameslong[V1], REG_SRH); - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[V0], LocalStack, regnameslong[SP]); - LocalStack += 4; - fprintf(fp, "\t\t andi %s,%s,0xF8\n", regnameslong[V1], regnameslong[V1]); - fprintf(fp, "\t\t or %s,%s,%s\n", regnameslong[V1], regnameslong[V1], regnameslong[V0]); - fprintf(fp, "\t\t bgez $0,IntCont\n"); - fprintf(fp, "\t\t sb %s,%s\t\t # Delay slot\n\n", regnameslong[V1], REG_SRH); - -/* space 1 saved register and 7 work registers : Stack must be kept on 16 bytes boundaries */ -#define EX_STACKFRAME_SIZE (3 * (4 * 4)) -#define EX_LOCALVARBASE (EX_STACKFRAME_SIZE - 0x04) - - ExLocalStack = EX_LOCALVARBASE; - -/* Exception Routine */ - - Align(); - fprintf(fp, "\t .ent Exception\n"); - fprintf(fp, "Exception:\n"); - fprintf(fp, "\t\t addiu %s,%s,%d\n", regnameslong[SP], regnameslong[SP], -EX_STACKFRAME_SIZE); - fprintf(fp, "\t\t .frame %s, %d, %s\n\n", regnameslong[SP], EX_STACKFRAME_SIZE, regnameslong[RA]); - fprintf(fp, "\t\t sw %s,0x%2.2X(%s)\n", regnameslong[RA], EX_STACKFRAME_SIZE - 0x04, regnameslong[SP]); - - if (SavedRegs[FLAG_C] == '-') { - ExLocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], ExLocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_V] == '-') { - ExLocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], ExLocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_Z] == '-') { - ExLocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], ExLocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_N] == '-') { - ExLocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], ExLocalStack, regnameslong[SP]); - } - if (SavedRegs[FLAG_X] == '-') { - ExLocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], ExLocalStack, regnameslong[SP]); - } - - //fprintf(fp, "\t\t andi %s,%s,0xFF\t\t # Zero Extend IRQ Vector\n", regnameslong[V0], regnameslong[V0]); - - ExLocalStack -= 4; - fprintf(fp, "\t\t sb %s,0x%2.2X(%s)\t\t # Save IRQ Vector for Later\n", regnameslong[V0], ExLocalStack, regnameslong[SP]); - assert(ExLocalStack >= MINSTACK_POS); - - /* Update Cycle Count */ - - fprintf(fp, "\t\t la %s,exception_cycles\n", regnameslong[T0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[V0], regnameslong[V0], regnameslong[T0]); - fprintf(fp, "\t\t lbu %s,0x00(%s)\t\t # Get Cycles\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t subu %s,%s,%s\t\t # Decrement ICount\n", regnameslong[ICNT], regnameslong[ICNT], regnameslong[V0]); - - ReadCCR('W', V0); - - fprintf(fp, "\t\t andi %s,%s,0x2000\t\t\t # Which Mode ?\n", regnameslong[T9], regnameslong[V0]); - fprintf(fp, "\t\t bne %s,$0,ExSuperMode\t\t # Supervisor\n", regnameslong[T9]); - fprintf(fp, "\t\t lw %s,%s\t\t\t # Delay slot - Get A7\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - - fprintf(fp, "\t\t srl %s,%s,8\n", regnameslong[T9], regnameslong[V0]); - fprintf(fp, "\t\t ori %s,%s,0x20\n", regnameslong[T9], regnameslong[T9]); - fprintf(fp, "\t\t sb %s,%s\t\t\t # Set Supervisor Mode\n", regnameslong[T9], REG_SRH); - fprintf(fp, "\t\t sw %s,%s\t\t\t # Save in USP\n", regnameslong[FASTCALL_FIRST_REG], REG_USP); - fprintf(fp, "\t\t lw %s,%s\t\t\t # Get ISP\n", regnameslong[FASTCALL_FIRST_REG], REG_ISP); - - /* Write SR first (since it's in a register) */ - - fprintf(fp, "ExSuperMode:\n"); - fprintf(fp, "\t\t addiu %s,%s,-6\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[FASTCALL_FIRST_REG]); - fprintf(fp, "\t\t sw %s,%s\t\t\t # Put in A7\n", regnameslong[FASTCALL_FIRST_REG], REG_A7); - Memory_Write('W', FASTCALL_FIRST_REG, V0, "----A----------------SSS----G-F-", ExLocalStack); - - /* Then write PC */ - - fprintf(fp, "\t\t subu %s,%s,%s\n", regnameslong[FASTCALL_SECOND_REG], regnameslong[PC], regnameslong[BASEPC]); - fprintf(fp, "\t\t addiu %s,%s,2\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[FASTCALL_FIRST_REG]); - Memory_Write('L', FASTCALL_FIRST_REG, FASTCALL_SECOND_REG, "---------------------SS-----G-F-", ExLocalStack); - - /* Get new PC */ - - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\t\t # Level\n", regnameslong[V0], ExLocalStack, regnameslong[SP]); - ExLocalStack += 4; - fprintf(fp, "\t\t lw %s,%s\n", regnameslong[T9], REG_VBR); /* 68010+ Vector Base */ - fprintf(fp, "\t\t sll %s,%s,2\n", regnameslong[V0], regnameslong[V0]); - fprintf(fp, "\t\t addu %s,%s,%s\n", regnameslong[FASTCALL_FIRST_REG], regnameslong[V0], regnameslong[T9]); - - /* Direct Read */ - - Memory_Read('L', FASTCALL_FIRST_REG, "---------------------SS-----G-F-", ExLocalStack); - - //fprintf(fp, "\t\t or %s,$0,%s\t\t # Set PC\n", regnameslong[PC], regnameslong[V0]); - - if (SavedRegs[FLAG_X] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_X], ExLocalStack, regnameslong[SP]); - ExLocalStack += 4; - } - if (SavedRegs[FLAG_N] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_N], ExLocalStack, regnameslong[SP]); - ExLocalStack += 4; - } - if (SavedRegs[FLAG_Z] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_Z], ExLocalStack, regnameslong[SP]); - ExLocalStack += 4; - } - if (SavedRegs[FLAG_V] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_V], ExLocalStack, regnameslong[SP]); - ExLocalStack += 4; - } - if (SavedRegs[FLAG_C] == '-') { - fprintf(fp, "\t\t lbu %s,0x%2.2X(%s)\n", regnameslong[FLAG_C], ExLocalStack, regnameslong[SP]); - ExLocalStack += 4; - } - - /* Sort out any bank changes */ - MemoryBanking(V0, ExLocalStack); - - fprintf(fp, "\t\t lw %s,0x%2.2X(%s)\n", regnameslong[RA], EX_STACKFRAME_SIZE - 0x04, regnameslong[SP]); - fprintf(fp, "\t\t jr %s\n", regnameslong[RA]); - fprintf(fp, "\t\t addiu %s,%s,%d\t\t # Delay slot\n\n", regnameslong[SP], regnameslong[SP], EX_STACKFRAME_SIZE); - fprintf(fp, "\t .end Exception\n"); - fprintf(fp, "\n\n\n\n"); - -} - -void CodeSegmentEnd(void) -{ - fprintf(fp, "\t\t .data\n"); - - /* Memory structure for 68000 registers */ - /* Aligned on a cache line */ - - fprintf(fp, "\n\t\t .align 6\n"); - - /* Memory structure for 68000 registers */ - /* Same layout as structure in CPUDEFS.H */ - - fprintf(fp, "\n\n # Register Structure\n\n"); - fprintf(fp, "%s_regs:\n", CPUtype); - - fprintf(fp, "R_D0:\t .word 0\t\t\t # Data Registers\n"); - fprintf(fp, "R_D1:\t .word 0\n"); - fprintf(fp, "R_D2:\t .word 0\n"); - fprintf(fp, "R_D3:\t .word 0\n"); - fprintf(fp, "R_D4:\t .word 0\n"); - fprintf(fp, "R_D5:\t .word 0\n"); - fprintf(fp, "R_D6:\t .word 0\n"); - fprintf(fp, "R_D7:\t .word 0\n\n"); - - fprintf(fp, "R_A0:\t .word 0\t\t\t # Address Registers\n"); - fprintf(fp, "R_A1:\t .word 0\n"); - fprintf(fp, "R_A2:\t .word 0\n"); - fprintf(fp, "R_A3:\t .word 0\n"); - fprintf(fp, "R_A4:\t .word 0\n"); - fprintf(fp, "R_A5:\t .word 0\n"); - fprintf(fp, "R_A6:\t .word 0\n"); - fprintf(fp, "R_A7:\t .word 0\n\n"); - - fprintf(fp, "R_ISP:\t .word 0\t\t\t # Supervisor Stack\n"); - fprintf(fp, "R_SR_H:\t .word 0\t\t\t # Status Register High TuSuuIII\n"); - fprintf(fp, "R_SR:\t .word 0\t\t\t # Motorola Format SR\n\n"); - - fprintf(fp, "R_PC:\t .word 0\t\t\t # Program Counter\n"); - fprintf(fp, "R_IRQ:\t .word 0\t\t\t # IRQ Request Level\n\n"); - - fprintf(fp, "R_IRQ_CALLBACK:\t .word 0\t\t\t # irq callback (get vector)\n\n"); - - fprintf(fp, "R_PPC:\t .word 0\t\t\t # Previous Program Counter\n"); - - fprintf(fp, "R_RESET_CALLBACK:\t .word 0\t\t\t # Reset Callback\n"); - - fprintf(fp, "R_SFC:\t .word 0\t\t\t # Source Function Call\n"); - fprintf(fp, "R_DFC:\t .word 0\t\t\t # Destination Function Call\n"); - fprintf(fp, "R_USP:\t .word 0\t\t\t # User Stack\n"); - fprintf(fp, "R_VBR:\t .word 0\t\t\t # Vector Base\n"); - - fprintf(fp, "CPUversion:\t .word 0\n\n"); - fprintf(fp, "FullPC:\t .word 0\n\n"); - fprintf(fp, "%sa68k_memory_intf:\n", PREF); - fprintf(fp, "\t.rept 13\n"); - fprintf(fp, "\t\t.word 0\n"); - fprintf(fp, "\t.endr\n"); - - /* Safe Memory Locations */ - - /* Exception Timing Table */ - - fprintf(fp, "\n\nexception_cycles:\n"); - fprintf(fp, "\t\t .byte 0, 0, 0, 0, 38, 42, 44, 38, 38, 0, 38, 38, 0, 0, 0, 0\n"); - fprintf(fp, "\t\t .byte 0, 0, 0, 0, 0, 0, 0, 0, 46, 46, 46, 46, 46, 46, 46, 46\n"); - fprintf(fp, "\t\t .byte 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38\n\n"); - - fprintf(fp, "\t\t .align 2\n"); - -#ifdef RLETABLE - fprintf(fp, " # RLE Compressed Jump Table\n\n"); - fprintf(fp, "%s_COMPTABLE:\n\n", CPUtype); -#else - fprintf(fp, " # Jump Table\n\n"); - fprintf(fp, "%s_OPCODETABLE:\n", CPUtype); -#endif - - fprintf(fp, "%cinclude \"%s\"\n\n", '.', comptab); - -#ifdef RLETABLE - fprintf(fp, "\t\t.word 0,0,0,0\n"); - fprintf(fp, "\n\n\n\n"); - - - fprintf(fp, "\t\t SECTION .bss\n"); - - fprintf(fp, "\n\t\t .align 4\n\n"); - - fprintf(fp, "%s_OPCODETABLE:\n", CPUtype); - fprintf(fp, "\t.rept 65536\n"); - fprintf(fp, "\t\t.word 0\n"); - fprintf(fp, "\t.endr\n"); -#endif -} - -void EmitCode(void) -{ - CodeSegmentBegin(); - - /* Instructions */ - - moveinstructions(); /* 1000 to 3FFF MOVE.X */ - immediate(); /* 0### XXX.I */ - bitdynamic(); /* 0### dynamic bit operations */ - movep(); /* 0### Move Peripheral */ - bitstatic(); /* 08## static bit operations */ - LoadEffectiveAddress(); /* 4### */ - PushEffectiveAddress(); /* ???? */ - movesr(); /* 4#C# */ - opcode5(); /* 5000 to 5FFF ADDQ,SUBQ,Scc and DBcc */ - branchinstructions(); /* 6000 to 6FFF Bcc,BSR */ - moveq(); /* 7000 to 7FFF MOVEQ */ - abcd_sbcd(); /* 8### Decimal Add/Sub */ - typelogicalmath(); /* Various ranges */ - addx_subx(); - divides(); - swap(); - not(); /* also neg negx clr */ - moveusp(); - chk(); - exg(); - cmpm(); - mul(); - ReturnandRestore(); - rts(); - jmp_jsr(); - nbcd(); - tas(); - trap(); - trapv(); - reset(); - nop(); - stop(); - ext(); - ReturnFromException(); - tst(); - movem_reg_ea(); - movem_ea_reg(); - link(); - unlinkasm(); - asl_asr(); /* E### Shift Commands */ - asl_asr_ea(); - roxl_roxr(); - roxl_roxr_ea(); - lsl_lsr(); - lsl_lsr_ea(); - rol_ror(); - rol_ror_ea(); - LineA(); /* A000 to AFFF Line A */ - LineF(); /* F000 to FFFF Line F */ - illegal_opcode(); - - ReturnandDeallocate(); /* 68010 Commands */ - MoveControlRegister(); - MoveAddressSpace(); - - CodeSegmentEnd(); -} - -int main(int argc, char **argv) -{ - int dwLoop; - - printf("\nMIPS Make68K - V%s - Copyright 2005, Manuel Geran (bdiamond@free.fr)\n", VERSION); - printf(" based on Make68K - Copyright 1998, Mike Coates (mame@btinternet.com)\n"); - printf(" 1999, & Darren Olafson (deo@mail.island.net)\n"); - printf(" 2000\n"); - - if (argc != 3) { - printf("Usage: %s outfile jumptable-outfile\n", argv[0]); - exit(1); - } - - printf("Building 68000/68010 2001\n\n"); - - for (dwLoop = 0; dwLoop < 65536;) OpcodeArray[dwLoop++] = -2; - - codebuf = malloc(64); - if (!codebuf) { - printf ("Memory allocation error\n"); - exit(3); - } - - /* Emit the code */ - fp = fopen(argv[1], "w"); - if (!fp) { - fprintf(stderr, "Can't open %s for writing\n", argv[1]); - exit(1); - } - - comptab = argv[2]; - - - CPUtype = malloc(64); - - sprintf(CPUtype, "%sM68000", PREF); - - EmitCode(); - - fclose(fp); - - printf("\n%d Unique Opcodes\n", Opcount); - - /* output Jump table to separate file */ - fp = fopen(argv[2], "w"); - if (!fp) { - fprintf(stderr, "Can't open %s for writing\n", argv[2]); - exit(1); - } - - JumpTable(); - - fclose(fp); - -#ifdef TESTTABLE - fp = fopen("opcodes.h", "w"); - if (!fp) { - fprintf(stderr, "Can't open %s for writing\n", argv[2]); - exit(1); - } - - TestTable(); - - fclose(fp); -#endif - - exit(0); -} diff --git a/jan/src/cpu/adsp2100/2100dasm.cpp b/jan/src/cpu/adsp2100/2100dasm.cpp deleted file mode 100644 index d0a287066..000000000 --- a/jan/src/cpu/adsp2100/2100dasm.cpp +++ /dev/null @@ -1,559 +0,0 @@ -#include "adsp2100.h" - -#define DASMFLAG_SUPPORTED 0x80000000 /* are disassembly flags supported? */ -#define DASMFLAG_STEP_OUT 0x40000000 /* this instruction should be the end of a step out sequence */ -#define DASMFLAG_STEP_OVER 0x20000000 /* this instruction should be stepped over by setting a breakpoint afterwards */ -#define DASMFLAG_OVERINSTMASK 0x18000000 /* number of extra instructions to skip when stepping over */ -#define DASMFLAG_OVERINSTSHIFT 27 /* bits to shift after masking to get the value */ -#define DASMFLAG_LENGTHMASK 0x0000ffff /* the low 16-bits contain the actual length */ -#define DASMFLAG_STEP_OVER_EXTRA(x) ((x) << DASMFLAG_OVERINSTSHIFT) - -static const char *const flag_change[] = { "", "TOGGLE %s ", "RESET %s ", "SET %s " }; -static const char *const mode_change[] = { "", "", "DIS %s ", "ENA %s " }; - -static const char *const alu_xop[] = { "AX0", "AX1", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" }; -static const char *const alu_yop[] = { "AY0", "AY1", "AF", "0" }; -static const char *const alu_dst[] = { "AR", "AF", "NONE" }; - -static const char *const mac_xop[] = { "MX0", "MX1", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" }; -static const char *const mac_yop[] = { "MY0", "MY1", "MF", "0" }; -static const char *const mac_dst[] = { "MR", "MF" }; - -static const char *const shift_xop[] = { "SI", "??", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" }; - -static const char *const reg_grp[][16] = -{ - { "AX0", "AX1", "MX0", "MX1", "AY0", "AY1", "MY0", "MY1", "SI", "SE", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" }, - { "I0", "I1", "I2", "I3", "M0", "M1", "M2", "M3", "L0", "L1", "L2", "L3", "??", "??", "??", "??" }, - { "I4", "I5", "I6", "I7", "M4", "M5", "M6", "M7", "L4", "L5", "L6", "L7", "??", "??", "??", "??" }, - { "ASTAT", "MSTAT", "SSTAT", "IMASK", "ICNTL", "CNTR", "SB", "PX", "RX0", "TX0", "RX1", "TX1", "IFC", "OWRCNTR", "??", "??" } -}; -static const char *const dual_xreg[] = { "AX0", "AX1", "MX0", "MX1" }; -static const char *const dual_yreg[] = { "AY0", "AY1", "MY0", "MY1" }; - -static const char *const condition[] = -{ - "IF EQ ", - "IF NE ", - "IF GT ", - "IF LE ", - "IF LT ", - "IF GE ", - "IF AV ", - "IF NOT AV ", - "IF AC ", - "IF NOT AC ", - "IF NEG ", - "IF POS ", - "IF MV ", - "IF NOT MV ", - "IF NOT CE ", - "" -}; - -static const char *const do_condition[] = -{ - "NE", - "EQ", - "LE", - "GT", - "GE", - "LT", - "NOT AV", - "AV", - "NOT AC", - "AC", - "POS", - "NEG", - "NOT MV", - "MV", - "CE", - "FOREVER" -}; - -static const char *const alumac_op[][2] = -{ - { "", "" }, - { "%s = %s * %s (RND)", "%s = %s * %s (RND)" }, - { "%s = MR + %s * %s (RND)", "%s = MR + %s * %s (RND)" }, - { "%s = MR - %s * %s (RND)", "%s = MR - %s * %s (RND)" }, - { "%s = %s * %s (SS)", "%s = 0" }, - { "%s = %s * %s (SU)", "%s = %s * %s (SU)" }, - { "%s = %s * %s (US)", "%s = %s * %s (US)" }, - { "%s = %s * %s (UU)", "%s = %s * %s (UU)" }, - { "%s = MR + %s * %s (SS)", "%s = MR + %s * %s (SS)" }, - { "%s = MR + %s * %s (SU)", "%s = MR + %s * %s (SU)" }, - { "%s = MR + %s * %s (US)", "%s = MR + %s * %s (US)" }, - { "%s = MR + %s * %s (UU)", "%s = MR + %s * %s (UU)" }, - { "%s = MR - %s * %s (SS)", "%s = MR - %s * %s (SS)" }, - { "%s = MR - %s * %s (SS)", "%s = MR - %s * %s (SS)" }, - { "%s = MR - %s * %s (US)", "%s = MR - %s * %s (US)" }, - { "%s = MR - %s * %s (UU)", "%s = MR - %s * %s (UU)" }, - - { "!%s = %s", "%s = 0" }, - { "!%s = %s + 1", "%s = 1" }, - { "%s = %s + %s + C", "%s = %s + %s + C" }, - { "%s = %s + %s", "%s = %s" }, - { "!%s = NOT %s", "!%s = NOT %s" }, - { "!%s = -%s", "!%s = -%s" }, - { "%s = %s - %s + C - 1", "%s = %s + C - 1" }, - { "%s = %s - %s", "%s = %s - %s" }, - { "!%s = %s - 1", "%s = -1" }, - { "!%s = %s - %s", "%s = -%s" }, - { "!%s = %s - %s + C - 1", "%s = -%s + C - 1" }, - { "%s = NOT %s", "%s = NOT %s" }, - { "%s = %s AND %s", "%s = %s AND %s" }, - { "%s = %s OR %s", "%s = %s OR %s" }, - { "%s = %s XOR %s", "%s = %s XOR %s" }, - { "%s = ABS %s", "%s = ABS %s" } -}; - -static const char *const shift_op[] = -{ - "SR = LSHIFT %s (HI)", - "SR = SR OR LSHIFT %s (HI)", - "SR = LSHIFT %s (LO)", - "SR = SR OR LSHIFT %s (LO)", - "SR = ASHIFT %s (HI)", - "SR = SR OR ASHIFT %s (HI)", - "SR = ASHIFT %s (LO)", - "SR = SR OR ASHIFT %s (LO)", - "SR = NORM %s (HI)", - "SR = SR OR NORM %s (HI)", - "SR = NORM %s (LO)", - "SR = SR OR NORM %s (LO)", - "SE = EXP %s (HI)", - "SE = EXP %s (HIX)", - "SE = EXP %s (LO)", - "SB = EXPADJ %s", -}; - -static const char *const shift_by_op[] = -{ - "SR = LSHIFT %s BY %d (HI)", - "SR = SR OR LSHIFT %s BY %d (HI)", - "SR = LSHIFT %s BY %d (LO)", - "SR = SR OR LSHIFT %s BY %d (LO)", - "SR = ASHIFT %s BY %d (HI)", - "SR = SR OR ASHIFT %s BY %d (HI)", - "SR = ASHIFT %s BY %d (LO)", - "SR = SR OR ASHIFT %s BY %d (LO)", - "???", - "???", - "???", - "???", - "???", - "???", - "???", - "???" -}; - -static const char *const constants[] = -{ - "$0001", - "$FFFE", - "$0002", - "$FFFD", - "$0004", - "$FFFB", - "$0008", - "$FFF7", - "$0010", - "$FFEF", - "$0020", - "$FFDF", - "$0040", - "$FFBF", - "$0080", - "$FF7F", - "$0100", - "$FEFF", - "$0200", - "$FDFF", - "$0400", - "$FBFF", - "$0800", - "$F7FF", - "$1000", - "$EFFF", - "$2000", - "$DFFF", - "$4000", - "$BFFF", - "$8000", - "$7FFF" -}; - - - - -static int alumac(char *buffer, int dest, int op) -{ - int opindex = (op >> 13) & 31; - const char *xop, *yop, *dst, *opstring; - - if (opindex & 16) - { - xop = alu_xop[(op >> 8) & 7]; - yop = alu_yop[(op >> 11) & 3]; - dst = alu_dst[dest]; - } - else - { - xop = mac_xop[(op >> 8) & 7]; - yop = mac_yop[(op >> 11) & 3]; - dst = mac_dst[dest]; - } - opstring = alumac_op[opindex][((op >> 11) & 3) == 3]; - if (opstring[0] == '!') - return sprintf(buffer, opstring + 1, dst, yop, xop); - else - return sprintf(buffer, opstring, dst, xop, yop); -} - - -static int aluconst(char *buffer, int dest, int op) -{ - int opindex = (op >> 13) & 31; - const char *xop, *dst, *cval, *opstring; - - if (opindex & 16) - { - xop = alu_xop[(op >> 8) & 7]; - cval = constants[((op >> 5) & 0x07) | ((op >> 8) & 0x18)]; - dst = alu_dst[dest]; - } - else - { - xop = mac_xop[(op >> 8) & 7]; - cval = xop; - dst = mac_dst[dest]; - } - opstring = alumac_op[opindex][((op >> 11) & 3) == 3]; - if (opstring[0] == '!') - return sprintf(buffer, opstring + 1, dst, cval, xop); - else - return sprintf(buffer, opstring, dst, xop, cval); -} - - -/* execute instructions on this CPU until icount expires */ -//CPU_DISASSEMBLE( adsp21xx ) -int adsp21xx_dasm(char *buffer, UINT8 *oprom) -{ - unsigned int op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16); - unsigned dasmflags = 0; - int temp; - - switch ((op >> 16) & 0xff) - { - case 0x00: - /* 00000000 00000000 00000000 NOP */ - sprintf(buffer, "%s", "NOP"); - break; - case 0x01: - /* 00000000 0xxxxxxx xxxxxxxx dst = IO(x) */ - /* 00000000 1xxxxxxx xxxxxxxx IO(x) = dst */ - /* ADSP-218x only */ - if ((op & 0x008000) == 0x000000) - buffer += sprintf(buffer, "%s = IO($%X)", reg_grp[0][op & 15], (op >> 4) & 0x7ff); - else - buffer += sprintf(buffer, "IO($%X) = %s", (op >> 4) & 0x7ff, reg_grp[0][op & 15]); - break; - case 0x02: - /* 00000010 0000xxxx xxxxxxxx modify flag out */ - if ((op & 0x00f000) == 0x000000) - { - buffer += sprintf(buffer, "%s", condition[op & 15]); - buffer += sprintf(buffer, flag_change[(op >> 4) & 3], "FLAG_OUT"); - buffer += sprintf(buffer, flag_change[(op >> 6) & 3], "FL0"); - buffer += sprintf(buffer, flag_change[(op >> 8) & 3], "FL1"); - buffer += sprintf(buffer, flag_change[(op >> 10) & 3], "FL2"); - } - /* 00000010 10000000 00000000 idle */ - /* 00000010 10000000 0000xxxx idle (n) */ - else if ((op & 0x00fff0) == 0x008000) - { - } - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x03: - /* 00000011 xxxxxxxx xxxxxxxx call or jump on flag in */ - if (op & 2) - buffer += sprintf(buffer, "%s", "IF FLAG_IN "); - else - buffer += sprintf(buffer, "%s", "IF NOT FLAG_IN "); - if (op & 1) - { - buffer += sprintf(buffer, "%s", "CALL "); - dasmflags = DASMFLAG_STEP_OVER; - } - else - buffer += sprintf(buffer, "%s", "JUMP "); - temp = ((op >> 4) & 0x0fff) | ((op << 10) & 0x3000); - buffer += sprintf(buffer, "$%04X", temp); - break; - case 0x04: - /* 00000100 00000000 000xxxxx stack control */ - if ((op & 0x00ffe0) == 0x000000) - { - if (op & 0x000010) - { - buffer += sprintf(buffer, "%s", "POP PC "); - dasmflags = DASMFLAG_STEP_OUT; - } - if (op & 0x000008) buffer += sprintf(buffer, "%s", "POP LOOP "); - if (op & 0x000004) buffer += sprintf(buffer, "%s", "POP CNTR "); - if ((op & 0x000003) == 0x000002) buffer += sprintf(buffer, "%s", "PUSH STAT "); - else if ((op & 0x000003) == 0x000003) buffer += sprintf(buffer, "%s", "POP STAT "); - } - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x05: - /* 00000101 00000000 00000000 saturate MR */ - if ((op & 0x00ffff) == 0x000000) - buffer += sprintf(buffer, "%s", "IF MV SAT MR"); - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x06: - /* 00000110 000xxxxx 00000000 DIVS */ - if ((op & 0x00e0ff) == 0x000000) - buffer += sprintf(buffer, "DIVS %s,%s", alu_yop[(op >> 11) & 3], alu_xop[(op >> 8) & 7]); - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x07: - /* 00000111 00010xxx 00000000 DIVQ */ - if ((op & 0x00f8ff) == 0x001000) - buffer += sprintf(buffer, "DIVQ %s", alu_xop[(op >> 8) & 7]); - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x08: - /* 00001000 00000000 0000xxxx reserved */ - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x09: - /* 00001001 00000000 000xxxxx modify address register */ - if ((op & 0x00ffe0) == 0x000000) - { - temp = (op >> 2) & 4; - buffer += sprintf(buffer, "MODIFY (I%d,M%d)", temp + ((op >> 2) & 3), temp + (op & 3)); - } - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x0a: - /* 00001010 00000000 0000xxxx conditional return */ - if ((op & 0x00ffe0) == 0x000000) - { - buffer += sprintf(buffer, "%s", condition[op & 15]); - if (op & 0x000010) - buffer += sprintf(buffer, "%s", "RTI"); - else - buffer += sprintf(buffer, "%s", "RTS"); - dasmflags = DASMFLAG_STEP_OUT; - } - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x0b: - /* 00001011 00000000 xx00xxxx conditional jump (indirect address) */ - if ((op & 0x00ff00) == 0x000000) - { - buffer += sprintf(buffer, "%s", condition[op & 15]); - if (op & 0x000010) - { - buffer += sprintf(buffer, "CALL (I%d)", 4 + ((op >> 6) & 3)); - dasmflags = DASMFLAG_STEP_OVER; - } - else - buffer += sprintf(buffer, "JUMP (I%d)", 4 + ((op >> 6) & 3)); - } - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x0c: - /* 00001100 xxxxxxxx xxxxxxxx mode control */ - buffer += sprintf(buffer, mode_change[(op >> 4) & 3], "SEC_REG"); - buffer += sprintf(buffer, mode_change[(op >> 6) & 3], "BIT_REV"); - buffer += sprintf(buffer, mode_change[(op >> 8) & 3], "AV_LATCH"); - buffer += sprintf(buffer, mode_change[(op >> 10) & 3], "AR_SAT"); - buffer += sprintf(buffer, mode_change[(op >> 12) & 3], "M_MODE"); - buffer += sprintf(buffer, mode_change[(op >> 14) & 3], "TIMER"); - buffer += sprintf(buffer, mode_change[(op >> 2) & 3], "G_MODE"); - break; - case 0x0d: - /* 00001101 0000xxxx xxxxxxxx internal data move */ - if ((op & 0x00f000) == 0x000000) - buffer += sprintf(buffer, "%s = %s", reg_grp[(op >> 10) & 3][(op >> 4) & 15], reg_grp[(op >> 8) & 3][op & 15]); - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x0e: - /* 00001110 0xxxxxxx xxxxxxxx conditional shift */ - if ((op & 0x0080f0) == 0x000000) - { - buffer += sprintf(buffer, "%s", condition[op & 15]); - buffer += sprintf(buffer, shift_op[(op >> 11) & 15], shift_xop[(op >> 8) & 7]); - } - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x0f: - /* 00001111 0xxxxxxx xxxxxxxx shift immediate */ - if ((op & 0x008000) == 0x000000) - buffer += sprintf(buffer, shift_by_op[(op >> 11) & 15], shift_xop[(op >> 8) & 7], (signed char)op); - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x10: - /* 00010000 0xxxxxxx xxxxxxxx shift with internal data register move */ - if ((op & 0x008000) == 0x000000) - { - buffer += sprintf(buffer, shift_op[(op >> 11) & 15], shift_xop[(op >> 8) & 7]); - buffer += sprintf(buffer, ", %s = %s", reg_grp[0][(op >> 4) & 15], reg_grp[0][op & 15]); - } - else - buffer += sprintf(buffer, "??? (%06X)", op); - break; - case 0x11: - /* 00010001 0xxxxxxx xxxxxxxx shift with pgm memory read/write */ - buffer += sprintf(buffer, shift_op[(op >> 11) & 15], shift_xop[(op >> 8) & 7]); - if (op & 0x008000) - buffer += sprintf(buffer, ", PM(I%d,M%d) = %s", 4 + ((op >> 2) & 3), 4 + (op & 3), reg_grp[0][(op >> 4) & 15]); - else - buffer += sprintf(buffer, ", %s = PM(I%d,M%d)", reg_grp[0][(op >> 4) & 15], 4 + ((op >> 2) & 3), 4 + (op & 3)); - break; - case 0x12: case 0x13: - /* 0001001x 0xxxxxxx xxxxxxxx shift with data memory read/write */ - buffer += sprintf(buffer, shift_op[(op >> 11) & 15], shift_xop[(op >> 8) & 7]); - temp = (op >> 14) & 4; - if (op & 0x008000) - buffer += sprintf(buffer, ", DM(I%d,M%d) = %s", temp + ((op >> 2) & 3), temp + (op & 3), reg_grp[0][(op >> 4) & 15]); - else - buffer += sprintf(buffer, ", %s = DM(I%d,M%d)", reg_grp[0][(op >> 4) & 15], temp + ((op >> 2) & 3), temp + (op & 3)); - break; - case 0x14: case 0x15: case 0x16: case 0x17: - /* 000101xx xxxxxxxx xxxxxxxx do until */ - buffer += sprintf(buffer, "DO $%04X UNTIL %s", (op >> 4) & 0x3fff, do_condition[op & 15]); - break; - case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: - /* 00011xxx xxxxxxxx xxxxxxxx conditional jump (immediate addr) */ - if (op & 0x040000) - { - buffer += sprintf(buffer, "%sCALL $%04X", condition[op & 15], (op >> 4) & 0x3fff); - dasmflags = DASMFLAG_STEP_OVER; - } - else - buffer += sprintf(buffer, "%sJUMP $%04X", condition[op & 15], (op >> 4) & 0x3fff); - break; - case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: - /* 00100xxx xxxxxxxx xxxxxxxx conditional ALU/MAC */ - buffer += sprintf(buffer, "%s", condition[op & 15]); - if (!(op & 0x10)) - buffer += alumac(buffer, (op >> 18) & 1, op); - else - { - /* ADSP-218x only */ - buffer += aluconst(buffer, (op >> 18) & 1, op); - } - break; - case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: - /* 00101xxx xxxxxxxx xxxxxxxx ALU/MAC with internal data register move */ - if ((op & 0x0600ff) == 0x0200aa) - { - /* ADSP-218x only */ - buffer += alumac(buffer, 2, op); - } - else - { - if ((op & 0x03e000) != 0) - { - buffer += alumac(buffer, (op >> 18) & 1, op); - buffer += sprintf(buffer, ", "); - } - buffer += sprintf(buffer, "%s = %s", reg_grp[0][(op >> 4) & 15], reg_grp[0][op & 15]); - } - break; - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: - case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: - /* 0011xxxx xxxxxxxx xxxxxxxx load non-data register immediate */ - buffer += sprintf(buffer, "%s = $%04X", reg_grp[(op >> 18) & 3][op & 15], (op >> 4) & 0x3fff); - break; - case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: - case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: - /* 0100xxxx xxxxxxxx xxxxxxxx load data register immediate */ - buffer += sprintf(buffer, "%s = $%04X", reg_grp[0][op & 15], (op >> 4) & 0xffff); - break; - case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: - case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: - /* 0101xxxx xxxxxxxx xxxxxxxx ALU/MAC with pgm memory read/write */ - if ((op & 0x03e000) != 0) - { - buffer += alumac(buffer, (op >> 18) & 1, op); - buffer += sprintf(buffer, ", "); - } - if (op & 0x080000) - buffer += sprintf(buffer, "PM(I%d,M%d) = %s", 4 + ((op >> 2) & 3), 4 + (op & 3), reg_grp[0][(op >> 4) & 15]); - else - buffer += sprintf(buffer, "%s = PM(I%d,M%d)", reg_grp[0][(op >> 4) & 15], 4 + ((op >> 2) & 3), 4 + (op & 3)); - break; - case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: - case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: - case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: - case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: - /* 011xxxxx xxxxxxxx xxxxxxxx ALU/MAC with data memory read/write */ - if ((op & 0x03e000) != 0) - { - buffer += alumac(buffer, (op >> 18) & 1, op); - buffer += sprintf(buffer, ", "); - } - temp = (op >> 18) & 4; - if (op & 0x080000) - buffer += sprintf(buffer, "DM(I%d,M%d) = %s", temp + ((op >> 2) & 3), temp + (op & 3), reg_grp[0][(op >> 4) & 15]); - else - buffer += sprintf(buffer, "%s = DM(I%d,M%d)", reg_grp[0][(op >> 4) & 15], temp + ((op >> 2) & 3), temp + (op & 3)); - break; - case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: - case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: - case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: - case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: - /* 100xxxxx xxxxxxxx xxxxxxxx read/write data memory (immediate addr) */ - if (op & 0x100000) - buffer += sprintf(buffer, "DM($%04X) = %s", (op >> 4) & 0x3fff, reg_grp[(op >> 18) & 3][op & 15]); - else - buffer += sprintf(buffer, "%s = DM($%04X)", reg_grp[(op >> 18) & 3][op & 15], (op >> 4) & 0x3fff); - break; - case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: - case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: - case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: - /* 101xxxxx xxxxxxxx xxxxxxxx data memory write (immediate) */ - temp = (op >> 18) & 4; - buffer += sprintf(buffer, "DM(I%d,M%d) = $%04X", temp + ((op >> 2) & 3), temp + (op & 3), (op >> 4) & 0xffff); - break; - case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: - case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: - case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: - case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: - case 0xe0: case 0xe1: case 0xe2: case 0xe3: case 0xe4: case 0xe5: case 0xe6: case 0xe7: - case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef: - case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: - case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff: - /* 11xxxxxx xxxxxxxx xxxxxxxx ALU/MAC with data & pgm memory read */ - if ((op & 0x03e000) != 0) - { - buffer += alumac(buffer, 0, op); - buffer += sprintf(buffer, ", "); - } - buffer += sprintf(buffer, "%s = DM(I%d,M%d), %s = PM(I%d,M%d)", dual_xreg[(op >> 18) & 3], (op >> 2) & 3, op & 3, - dual_yreg[(op >> 20) & 3], 4 + ((op >> 6) & 3), 4 + ((op >> 4) & 3)); - break; - } - - return 1 | dasmflags | DASMFLAG_SUPPORTED; -} diff --git a/jan/src/cpu/adsp2100/2100ops.c b/jan/src/cpu/adsp2100/2100ops.c deleted file mode 100644 index 75f1f5907..000000000 --- a/jan/src/cpu/adsp2100/2100ops.c +++ /dev/null @@ -1,2253 +0,0 @@ -/*=========================================================================== - ASTAT -- ALU/MAC status register -===========================================================================*/ - -/* flag definitions */ -#define SSFLAG 0x80 -#define MVFLAG 0x40 -#define QFLAG 0x20 -#define SFLAG 0x10 -#define CFLAG 0x08 -#define VFLAG 0x04 -#define NFLAG 0x02 -#define ZFLAG 0x01 - -/* extracts flags */ -#define GET_SS (adsp->astat & SSFLAG) -#define GET_MV (adsp->astat & MVFLAG) -#define GET_Q (adsp->astat & QFLAG) -#define GET_S (adsp->astat & SFLAG) -#define GET_C (adsp->astat & CFLAG) -#define GET_V (adsp->astat & VFLAG) -#define GET_N (adsp->astat & NFLAG) -#define GET_Z (adsp->astat & ZFLAG) - -/* clears flags */ -#define CLR_SS (adsp->astat &= ~SSFLAG) -#define CLR_MV (adsp->astat &= ~MVFLAG) -#define CLR_Q (adsp->astat &= ~QFLAG) -#define CLR_S (adsp->astat &= ~SFLAG) -#define CLR_C (adsp->astat &= ~CFLAG) -#define CLR_V (adsp->astat &= ~VFLAG) -#define CLR_N (adsp->astat &= ~NFLAG) -#define CLR_Z (adsp->astat &= ~ZFLAG) - -/* sets flags */ -#define SET_SS (adsp->astat |= SSFLAG) -#define SET_MV (adsp->astat |= MVFLAG) -#define SET_Q (adsp->astat |= QFLAG) -#define SET_S (adsp->astat |= SFLAG) -#define SET_C (adsp->astat |= CFLAG) -#define SET_V (adsp->astat |= VFLAG) -#define SET_Z (adsp->astat |= ZFLAG) -#define SET_N (adsp->astat |= NFLAG) - -/* flag clearing; must be done before setting */ -#define CLR_FLAGS (adsp->astat &= adsp->astat_clear) - -/* compute flags */ -#define CALC_Z(r) (adsp->astat |= ((r & 0xffff) == 0)) -#define CALC_N(r) (adsp->astat |= (r >> 14) & 0x02) -#define CALC_V(s,d,r) (adsp->astat |= ((s ^ d ^ r ^ (r >> 1)) >> 13) & 0x04) -#define CALC_C(r) (adsp->astat |= (r >> 13) & 0x08) -#define CALC_C_SUB(r) (adsp->astat |= (~r >> 13) & 0x08) -#define CALC_NZ(r) CLR_FLAGS; CALC_N(r); CALC_Z(r) -#define CALC_NZV(s,d,r) CLR_FLAGS; CALC_N(r); CALC_Z(r); CALC_V(s,d,r) -#define CALC_NZVC(s,d,r) CLR_FLAGS; CALC_N(r); CALC_Z(r); CALC_V(s,d,r); CALC_C(r) -#define CALC_NZVC_SUB(s,d,r) CLR_FLAGS; CALC_N(r); CALC_Z(r); CALC_V(s,d,r); CALC_C_SUB(r) - -/* ADSP-218x constants */ -static const INT32 constants[] = -{ - 0x0001, 0xfffe, 0x0002, 0xfffd, 0x0004, 0xfffb, 0x0008, 0xfff7, - 0x0010, 0xffef, 0x0020, 0xffdf, 0x0040, 0xffbf, 0x0080, 0xff7f, - 0x0100, 0xfeff, 0x0200, 0xfdff, 0x0400, 0xfbff, 0x0800, 0xf7ff, - 0x1000, 0xefff, 0x2000, 0xdfff, 0x4000, 0xbfff, 0x8000, 0x7fff -}; - - - -/*=========================================================================== - MSTAT -- ALU/MAC control register -===========================================================================*/ - -/* flag definitions */ -#define MSTAT_BANK 0x01 /* register bank select */ -#define MSTAT_REVERSE 0x02 /* bit-reverse addressing enable (DAG1) */ -#define MSTAT_STICKYV 0x04 /* sticky ALU overflow enable */ -#define MSTAT_SATURATE 0x08 /* AR saturation mode enable */ -#define MSTAT_INTEGER 0x10 /* MAC result placement; 0=fractional, 1=integer */ -#define MSTAT_TIMER 0x20 /* timer enable */ -#define MSTAT_GOMODE 0x40 /* go mode enable */ - -/* you must call this in order to change MSTAT */ -INLINE void update_mstat(adsp2100_state *adsp) -{ - if ((adsp->mstat ^ adsp->mstat_prev) & MSTAT_BANK) - { - ADSPCORE temp = adsp->core; - adsp->core = adsp->alt; - adsp->alt = temp; - } - if ((adsp->mstat ^ adsp->mstat_prev) & MSTAT_TIMER) - if (adsp->timer_fired != NULL) - (*adsp->timer_fired)(adsp, (adsp->mstat & MSTAT_TIMER) != 0); - - if (adsp->mstat & MSTAT_STICKYV) - adsp->astat_clear = ~(CFLAG | NFLAG | ZFLAG); - else - adsp->astat_clear = ~(CFLAG | VFLAG | NFLAG | ZFLAG); - adsp->mstat_prev = adsp->mstat; -} - - -/*=========================================================================== - SSTAT -- stack status register -===========================================================================*/ - -/* flag definitions */ -#define PC_EMPTY 0x01 /* PC stack empty */ -#define PC_OVER 0x02 /* PC stack overflow */ -#define COUNT_EMPTY 0x04 /* count stack empty */ -#define COUNT_OVER 0x08 /* count stack overflow */ -#define STATUS_EMPTY 0x10 /* status stack empty */ -#define STATUS_OVER 0x20 /* status stack overflow */ -#define LOOP_EMPTY 0x40 /* loop stack empty */ -#define LOOP_OVER 0x80 /* loop stack overflow */ - - - -/*=========================================================================== - PC stack handlers -===========================================================================*/ - -INLINE UINT32 pc_stack_top(adsp2100_state *adsp) -{ - if (adsp->pc_sp > 0) - return adsp->pc_stack[adsp->pc_sp - 1]; - else - return adsp->pc_stack[0]; -} - -INLINE void set_pc_stack_top(adsp2100_state *adsp, UINT32 top) -{ - if (adsp->pc_sp > 0) - adsp->pc_stack[adsp->pc_sp - 1] = top; - else - adsp->pc_stack[0] = top; -} - -INLINE void pc_stack_push(adsp2100_state *adsp) -{ - if (adsp->pc_sp < PC_STACK_DEPTH) - { - adsp->pc_stack[adsp->pc_sp] = adsp->pc; - adsp->pc_sp++; - adsp->sstat &= ~PC_EMPTY; - } - else - adsp->sstat |= PC_OVER; -} - -INLINE void pc_stack_push_val(adsp2100_state *adsp, UINT32 val) -{ - if (adsp->pc_sp < PC_STACK_DEPTH) - { - adsp->pc_stack[adsp->pc_sp] = val; - adsp->pc_sp++; - adsp->sstat &= ~PC_EMPTY; - } - else - adsp->sstat |= PC_OVER; -} - -INLINE void pc_stack_pop(adsp2100_state *adsp) -{ - if (adsp->pc_sp > 0) - { - adsp->pc_sp--; - if (adsp->pc_sp == 0) - adsp->sstat |= PC_EMPTY; - } - adsp->pc = adsp->pc_stack[adsp->pc_sp]; -} - -INLINE UINT32 pc_stack_pop_val(adsp2100_state *adsp) -{ - if (adsp->pc_sp > 0) - { - adsp->pc_sp--; - if (adsp->pc_sp == 0) - adsp->sstat |= PC_EMPTY; - } - return adsp->pc_stack[adsp->pc_sp]; -} - - -/*=========================================================================== - CNTR stack handlers -===========================================================================*/ - -INLINE UINT32 cntr_stack_top(adsp2100_state *adsp) -{ - if (adsp->cntr_sp > 0) - return adsp->cntr_stack[adsp->cntr_sp - 1]; - else - return adsp->cntr_stack[0]; -} - -INLINE void cntr_stack_push(adsp2100_state *adsp) -{ - if (adsp->cntr_sp < CNTR_STACK_DEPTH) - { - adsp->cntr_stack[adsp->cntr_sp] = adsp->cntr; - adsp->cntr_sp++; - adsp->sstat &= ~COUNT_EMPTY; - } - else - adsp->sstat |= COUNT_OVER; -} - -INLINE void cntr_stack_pop(adsp2100_state *adsp) -{ - if (adsp->cntr_sp > 0) - { - adsp->cntr_sp--; - if (adsp->cntr_sp == 0) - adsp->sstat |= COUNT_EMPTY; - } - adsp->cntr = adsp->cntr_stack[adsp->cntr_sp]; -} - - -/*=========================================================================== - LOOP stack handlers -===========================================================================*/ - -INLINE UINT32 loop_stack_top(adsp2100_state *adsp) -{ - if (adsp->loop_sp > 0) - return adsp->loop_stack[adsp->loop_sp - 1]; - else - return adsp->loop_stack[0]; -} - -INLINE void loop_stack_push(adsp2100_state *adsp, UINT32 value) -{ - if (adsp->loop_sp < LOOP_STACK_DEPTH) - { - adsp->loop_stack[adsp->loop_sp] = value; - adsp->loop_sp++; - adsp->loop = value >> 4; - adsp->loop_condition = value & 15; - adsp->sstat &= ~LOOP_EMPTY; - } - else - adsp->sstat |= LOOP_OVER; -} - -INLINE void loop_stack_pop(adsp2100_state *adsp) -{ - if (adsp->loop_sp > 0) - { - adsp->loop_sp--; - if (adsp->loop_sp == 0) - { - adsp->loop = 0xffff; - adsp->loop_condition = 0; - adsp->sstat |= LOOP_EMPTY; - } - else - { - adsp->loop = adsp->loop_stack[adsp->loop_sp -1] >> 4; - adsp->loop_condition = adsp->loop_stack[adsp->loop_sp - 1] & 15; - } - } -} - - -/*=========================================================================== - STAT stack handlers -===========================================================================*/ - -INLINE void stat_stack_push(adsp2100_state *adsp) -{ - if (adsp->stat_sp < STAT_STACK_DEPTH) - { - adsp->stat_stack[adsp->stat_sp][0] = adsp->mstat; - adsp->stat_stack[adsp->stat_sp][1] = adsp->imask; - adsp->stat_stack[adsp->stat_sp][2] = adsp->astat; - adsp->stat_sp++; - adsp->sstat &= ~STATUS_EMPTY; - } - else - adsp->sstat |= STATUS_OVER; -} - -INLINE void stat_stack_pop(adsp2100_state *adsp) -{ - if (adsp->stat_sp > 0) - { - adsp->stat_sp--; - if (adsp->stat_sp == 0) - adsp->sstat |= STATUS_EMPTY; - } - adsp->mstat = adsp->stat_stack[adsp->stat_sp][0]; - update_mstat(adsp); - adsp->imask = adsp->stat_stack[adsp->stat_sp][1]; - adsp->astat = adsp->stat_stack[adsp->stat_sp][2]; - check_irqs(adsp); -} - - - -/*=========================================================================== - condition code checking -===========================================================================*/ - -INLINE int CONDITION(adsp2100_state *adsp, int c) -{ - if (c != 14) - return condition_table[((c) << 8) | adsp->astat]; - else if ((INT32)--adsp->cntr > 0) - return 1; - else - { - cntr_stack_pop(adsp); - return 0; - } -} - - - -/*=========================================================================== - register writing -===========================================================================*/ - -INLINE void update_i(adsp2100_state *adsp, int which) -{ - adsp->base[which] = adsp->i[which] & adsp->lmask[which]; -} - -INLINE void update_l(adsp2100_state *adsp, int which) -{ - adsp->lmask[which] = mask_table[adsp->l[which] & 0x3fff]; - adsp->base[which] = adsp->i[which] & adsp->lmask[which]; -} - -static void wr_inval(adsp2100_state *adsp, INT32 val) { logerror( "ADSP %04x: Writing to an invalid register!\n", adsp->ppc ); } -static void wr_ax0(adsp2100_state *adsp, INT32 val) { adsp->core.ax0.s = val; } -static void wr_ax1(adsp2100_state *adsp, INT32 val) { adsp->core.ax1.s = val; } -static void wr_mx0(adsp2100_state *adsp, INT32 val) { adsp->core.mx0.s = val; } -static void wr_mx1(adsp2100_state *adsp, INT32 val) { adsp->core.mx1.s = val; } -static void wr_ay0(adsp2100_state *adsp, INT32 val) { adsp->core.ay0.s = val; } -static void wr_ay1(adsp2100_state *adsp, INT32 val) { adsp->core.ay1.s = val; } -static void wr_my0(adsp2100_state *adsp, INT32 val) { adsp->core.my0.s = val; } -static void wr_my1(adsp2100_state *adsp, INT32 val) { adsp->core.my1.s = val; } -static void wr_si(adsp2100_state *adsp, INT32 val) { adsp->core.si.s = val; } -static void wr_se(adsp2100_state *adsp, INT32 val) { adsp->core.se.s = (INT8)val; } -static void wr_ar(adsp2100_state *adsp, INT32 val) { adsp->core.ar.s = val; } -static void wr_mr0(adsp2100_state *adsp, INT32 val) { adsp->core.mr.mrx.mr0.s = val; } -static void wr_mr1(adsp2100_state *adsp, INT32 val) { adsp->core.mr.mrx.mr1.s = val; adsp->core.mr.mrx.mr2.s = (INT16)val >> 15; } -static void wr_mr2(adsp2100_state *adsp, INT32 val) { adsp->core.mr.mrx.mr2.s = (INT8)val; } -static void wr_sr0(adsp2100_state *adsp, INT32 val) { adsp->core.sr.srx.sr0.s = val; } -static void wr_sr1(adsp2100_state *adsp, INT32 val) { adsp->core.sr.srx.sr1.s = val; } -static void wr_i0(adsp2100_state *adsp, INT32 val) { adsp->i[0] = val & 0x3fff; update_i(adsp, 0); } -static void wr_i1(adsp2100_state *adsp, INT32 val) { adsp->i[1] = val & 0x3fff; update_i(adsp, 1); } -static void wr_i2(adsp2100_state *adsp, INT32 val) { adsp->i[2] = val & 0x3fff; update_i(adsp, 2); } -static void wr_i3(adsp2100_state *adsp, INT32 val) { adsp->i[3] = val & 0x3fff; update_i(adsp, 3); } -static void wr_i4(adsp2100_state *adsp, INT32 val) { adsp->i[4] = val & 0x3fff; update_i(adsp, 4); } -static void wr_i5(adsp2100_state *adsp, INT32 val) { adsp->i[5] = val & 0x3fff; update_i(adsp, 5); } -static void wr_i6(adsp2100_state *adsp, INT32 val) { adsp->i[6] = val & 0x3fff; update_i(adsp, 6); } -static void wr_i7(adsp2100_state *adsp, INT32 val) { adsp->i[7] = val & 0x3fff; update_i(adsp, 7); } -static void wr_m0(adsp2100_state *adsp, INT32 val) { adsp->m[0] = (INT32)(val << 18) >> 18; } -static void wr_m1(adsp2100_state *adsp, INT32 val) { adsp->m[1] = (INT32)(val << 18) >> 18; } -static void wr_m2(adsp2100_state *adsp, INT32 val) { adsp->m[2] = (INT32)(val << 18) >> 18; } -static void wr_m3(adsp2100_state *adsp, INT32 val) { adsp->m[3] = (INT32)(val << 18) >> 18; } -static void wr_m4(adsp2100_state *adsp, INT32 val) { adsp->m[4] = (INT32)(val << 18) >> 18; } -static void wr_m5(adsp2100_state *adsp, INT32 val) { adsp->m[5] = (INT32)(val << 18) >> 18; } -static void wr_m6(adsp2100_state *adsp, INT32 val) { adsp->m[6] = (INT32)(val << 18) >> 18; } -static void wr_m7(adsp2100_state *adsp, INT32 val) { adsp->m[7] = (INT32)(val << 18) >> 18; } -static void wr_l0(adsp2100_state *adsp, INT32 val) { adsp->l[0] = val & 0x3fff; update_l(adsp, 0); } -static void wr_l1(adsp2100_state *adsp, INT32 val) { adsp->l[1] = val & 0x3fff; update_l(adsp, 1); } -static void wr_l2(adsp2100_state *adsp, INT32 val) { adsp->l[2] = val & 0x3fff; update_l(adsp, 2); } -static void wr_l3(adsp2100_state *adsp, INT32 val) { adsp->l[3] = val & 0x3fff; update_l(adsp, 3); } -static void wr_l4(adsp2100_state *adsp, INT32 val) { adsp->l[4] = val & 0x3fff; update_l(adsp, 4); } -static void wr_l5(adsp2100_state *adsp, INT32 val) { adsp->l[5] = val & 0x3fff; update_l(adsp, 5); } -static void wr_l6(adsp2100_state *adsp, INT32 val) { adsp->l[6] = val & 0x3fff; update_l(adsp, 6); } -static void wr_l7(adsp2100_state *adsp, INT32 val) { adsp->l[7] = val & 0x3fff; update_l(adsp, 7); } -static void wr_astat(adsp2100_state *adsp, INT32 val) { adsp->astat = val & 0x00ff; } -static void wr_mstat(adsp2100_state *adsp, INT32 val) { adsp->mstat = val & adsp->mstat_mask; update_mstat(adsp); } -static void wr_imask(adsp2100_state *adsp, INT32 val) { adsp->imask = val & adsp->imask_mask; check_irqs(adsp); } -static void wr_icntl(adsp2100_state *adsp, INT32 val) { adsp->icntl = val & 0x001f; check_irqs(adsp); } -static void wr_cntr(adsp2100_state *adsp, INT32 val) { cntr_stack_push(adsp); adsp->cntr = val & 0x3fff; } -static void wr_sb(adsp2100_state *adsp, INT32 val) { adsp->core.sb.s = (INT32)(val << 27) >> 27; } -static void wr_px(adsp2100_state *adsp, INT32 val) { adsp->px = val; } -static void wr_ifc(adsp2100_state *adsp, INT32 val) -{ - adsp->ifc = val; - if (adsp->chip_type >= CHIP_TYPE_ADSP2181) - { - /* clear timer */ - if (val & 0x0002) adsp->irq_latch[ADSP2181_IRQ0] = 0; - if (val & 0x0004) adsp->irq_latch[ADSP2181_IRQ1] = 0; - /* clear BDMA */ - if (val & 0x0010) adsp->irq_latch[ADSP2181_IRQE] = 0; - if (val & 0x0020) adsp->irq_latch[ADSP2181_SPORT0_RX] = 0; - if (val & 0x0040) adsp->irq_latch[ADSP2181_SPORT0_TX] = 0; - if (val & 0x0080) adsp->irq_latch[ADSP2181_IRQ2] = 0; - /* force timer */ - if (val & 0x0200) adsp->irq_latch[ADSP2181_IRQ0] = 1; - if (val & 0x0400) adsp->irq_latch[ADSP2181_IRQ1] = 1; - /* force BDMA */ - if (val & 0x1000) adsp->irq_latch[ADSP2181_IRQE] = 1; - if (val & 0x2000) adsp->irq_latch[ADSP2181_SPORT0_RX] = 1; - if (val & 0x4000) adsp->irq_latch[ADSP2181_SPORT0_TX] = 1; - if (val & 0x8000) adsp->irq_latch[ADSP2181_IRQ2] = 1; - } - else - { - /* clear timer */ - if (val & 0x002) adsp->irq_latch[ADSP2101_IRQ0] = 0; - if (val & 0x004) adsp->irq_latch[ADSP2101_IRQ1] = 0; - if (val & 0x008) adsp->irq_latch[ADSP2101_SPORT0_RX] = 0; - if (val & 0x010) adsp->irq_latch[ADSP2101_SPORT0_TX] = 0; - if (val & 0x020) adsp->irq_latch[ADSP2101_IRQ2] = 0; - /* set timer */ - if (val & 0x080) adsp->irq_latch[ADSP2101_IRQ0] = 1; - if (val & 0x100) adsp->irq_latch[ADSP2101_IRQ1] = 1; - if (val & 0x200) adsp->irq_latch[ADSP2101_SPORT0_RX] = 1; - if (val & 0x400) adsp->irq_latch[ADSP2101_SPORT0_TX] = 1; - if (val & 0x800) adsp->irq_latch[ADSP2101_IRQ2] = 1; - } - check_irqs(adsp); -} -static void wr_tx0(adsp2100_state *adsp, INT32 val) { if (adsp->sport_tx_callback) (*adsp->sport_tx_callback)(adsp, 0, val); } -static void wr_tx1(adsp2100_state *adsp, INT32 val) { if (adsp->sport_tx_callback) (*adsp->sport_tx_callback)(adsp, 1, val); } -static void wr_owrctr(adsp2100_state *adsp, INT32 val) { adsp->cntr = val & 0x3fff; } -static void wr_topstack(adsp2100_state *adsp, INT32 val) { pc_stack_push_val(adsp, val & 0x3fff); } - -#define WRITE_REG(adsp,grp,reg,val) ((*wr_reg[grp][reg])(adsp,val)) - -static void (*const wr_reg[4][16])(adsp2100_state*, INT32) = -{ - { - wr_ax0, wr_ax1, wr_mx0, wr_mx1, wr_ay0, wr_ay1, wr_my0, wr_my1, - wr_si, wr_se, wr_ar, wr_mr0, wr_mr1, wr_mr2, wr_sr0, wr_sr1 - }, - { - wr_i0, wr_i1, wr_i2, wr_i3, wr_m0, wr_m1, wr_m2, wr_m3, - wr_l0, wr_l1, wr_l2, wr_l3, wr_inval, wr_inval, wr_inval, wr_inval - }, - { - wr_i4, wr_i5, wr_i6, wr_i7, wr_m4, wr_m5, wr_m6, wr_m7, - wr_l4, wr_l5, wr_l6, wr_l7, wr_inval, wr_inval, wr_inval, wr_inval - }, - { - wr_astat, wr_mstat, wr_inval, wr_imask, wr_icntl, wr_cntr, wr_sb, wr_px, - wr_inval, wr_tx0, wr_inval, wr_tx1, wr_ifc, wr_owrctr, wr_inval, wr_topstack - } -}; - - - -/*=========================================================================== - register reading -===========================================================================*/ - -static INT32 rd_inval(adsp2100_state *adsp) { logerror( "ADSP %04x: Writing to an invalid register!\n", adsp->ppc ); return 0; } -static INT32 rd_ax0(adsp2100_state *adsp) { return adsp->core.ax0.s; } -static INT32 rd_ax1(adsp2100_state *adsp) { return adsp->core.ax1.s; } -static INT32 rd_mx0(adsp2100_state *adsp) { return adsp->core.mx0.s; } -static INT32 rd_mx1(adsp2100_state *adsp) { return adsp->core.mx1.s; } -static INT32 rd_ay0(adsp2100_state *adsp) { return adsp->core.ay0.s; } -static INT32 rd_ay1(adsp2100_state *adsp) { return adsp->core.ay1.s; } -static INT32 rd_my0(adsp2100_state *adsp) { return adsp->core.my0.s; } -static INT32 rd_my1(adsp2100_state *adsp) { return adsp->core.my1.s; } -static INT32 rd_si(adsp2100_state *adsp) { return adsp->core.si.s; } -static INT32 rd_se(adsp2100_state *adsp) { return adsp->core.se.s; } -static INT32 rd_ar(adsp2100_state *adsp) { return adsp->core.ar.s; } -static INT32 rd_mr0(adsp2100_state *adsp) { return adsp->core.mr.mrx.mr0.s; } -static INT32 rd_mr1(adsp2100_state *adsp) { return adsp->core.mr.mrx.mr1.s; } -static INT32 rd_mr2(adsp2100_state *adsp) { return adsp->core.mr.mrx.mr2.s; } -static INT32 rd_sr0(adsp2100_state *adsp) { return adsp->core.sr.srx.sr0.s; } -static INT32 rd_sr1(adsp2100_state *adsp) { return adsp->core.sr.srx.sr1.s; } -static INT32 rd_i0(adsp2100_state *adsp) { return adsp->i[0]; } -static INT32 rd_i1(adsp2100_state *adsp) { return adsp->i[1]; } -static INT32 rd_i2(adsp2100_state *adsp) { return adsp->i[2]; } -static INT32 rd_i3(adsp2100_state *adsp) { return adsp->i[3]; } -static INT32 rd_i4(adsp2100_state *adsp) { return adsp->i[4]; } -static INT32 rd_i5(adsp2100_state *adsp) { return adsp->i[5]; } -static INT32 rd_i6(adsp2100_state *adsp) { return adsp->i[6]; } -static INT32 rd_i7(adsp2100_state *adsp) { return adsp->i[7]; } -static INT32 rd_m0(adsp2100_state *adsp) { return adsp->m[0]; } -static INT32 rd_m1(adsp2100_state *adsp) { return adsp->m[1]; } -static INT32 rd_m2(adsp2100_state *adsp) { return adsp->m[2]; } -static INT32 rd_m3(adsp2100_state *adsp) { return adsp->m[3]; } -static INT32 rd_m4(adsp2100_state *adsp) { return adsp->m[4]; } -static INT32 rd_m5(adsp2100_state *adsp) { return adsp->m[5]; } -static INT32 rd_m6(adsp2100_state *adsp) { return adsp->m[6]; } -static INT32 rd_m7(adsp2100_state *adsp) { return adsp->m[7]; } -static INT32 rd_l0(adsp2100_state *adsp) { return adsp->l[0]; } -static INT32 rd_l1(adsp2100_state *adsp) { return adsp->l[1]; } -static INT32 rd_l2(adsp2100_state *adsp) { return adsp->l[2]; } -static INT32 rd_l3(adsp2100_state *adsp) { return adsp->l[3]; } -static INT32 rd_l4(adsp2100_state *adsp) { return adsp->l[4]; } -static INT32 rd_l5(adsp2100_state *adsp) { return adsp->l[5]; } -static INT32 rd_l6(adsp2100_state *adsp) { return adsp->l[6]; } -static INT32 rd_l7(adsp2100_state *adsp) { return adsp->l[7]; } -static INT32 rd_astat(adsp2100_state *adsp) { return adsp->astat; } -static INT32 rd_mstat(adsp2100_state *adsp) { return adsp->mstat; } -static INT32 rd_sstat(adsp2100_state *adsp) { return adsp->sstat; } -static INT32 rd_imask(adsp2100_state *adsp) { return adsp->imask; } -static INT32 rd_icntl(adsp2100_state *adsp) { return adsp->icntl; } -static INT32 rd_cntr(adsp2100_state *adsp) { return adsp->cntr; } -static INT32 rd_sb(adsp2100_state *adsp) { return adsp->core.sb.s; } -static INT32 rd_px(adsp2100_state *adsp) { return adsp->px; } -static INT32 rd_rx0(adsp2100_state *adsp) { if (adsp->sport_rx_callback) return (*adsp->sport_rx_callback)(adsp, 0); else return 0; } -static INT32 rd_rx1(adsp2100_state *adsp) { if (adsp->sport_rx_callback) return (*adsp->sport_rx_callback)(adsp, 1); else return 0; } -static INT32 rd_stacktop(adsp2100_state *adsp) { return pc_stack_pop_val(adsp); } - -#define READ_REG(adsp,grp,reg) ((*rd_reg[grp][reg])(adsp)) - -static INT32 (*const rd_reg[4][16])(adsp2100_state *adsp) = -{ - { - rd_ax0, rd_ax1, rd_mx0, rd_mx1, rd_ay0, rd_ay1, rd_my0, rd_my1, - rd_si, rd_se, rd_ar, rd_mr0, rd_mr1, rd_mr2, rd_sr0, rd_sr1 - }, - { - rd_i0, rd_i1, rd_i2, rd_i3, rd_m0, rd_m1, rd_m2, rd_m3, - rd_l0, rd_l1, rd_l2, rd_l3, rd_inval, rd_inval, rd_inval, rd_inval - }, - { - rd_i4, rd_i5, rd_i6, rd_i7, rd_m4, rd_m5, rd_m6, rd_m7, - rd_l4, rd_l5, rd_l6, rd_l7, rd_inval, rd_inval, rd_inval, rd_inval - }, - { - rd_astat, rd_mstat, rd_sstat, rd_imask, rd_icntl, rd_cntr, rd_sb, rd_px, - rd_rx0, rd_inval, rd_rx1, rd_inval, rd_inval, rd_inval, rd_inval, rd_stacktop - } -}; - - - -/*=========================================================================== - Modulus addressing logic -===========================================================================*/ - -INLINE void modify_address(adsp2100_state *adsp, UINT32 ireg, UINT32 mreg) -{ - UINT32 base = adsp->base[ireg]; - UINT32 i = adsp->i[ireg]; - UINT32 l = adsp->l[ireg]; - - i += adsp->m[mreg]; - if (i < base) i += l; - else if (i >= base + l) i -= l; - adsp->i[ireg] = i; -} - - - -/*=========================================================================== - Data memory accessors -===========================================================================*/ - -INLINE void data_write_dag1(adsp2100_state *adsp, UINT32 op, INT32 val) -{ - UINT32 ireg = (op >> 2) & 3; - UINT32 mreg = op & 3; - UINT32 base = adsp->base[ireg]; - UINT32 i = adsp->i[ireg]; - UINT32 l = adsp->l[ireg]; - - if ( adsp->mstat & MSTAT_REVERSE ) - { - UINT32 ir = reverse_table[ i & 0x3fff ]; - WWORD_DATA(adsp, ir, val); - } - else - WWORD_DATA(adsp, i, val); - - i += adsp->m[mreg]; - if (i < base) i += l; - else if (i >= base + l) i -= l; - adsp->i[ireg] = i; -} - - -INLINE UINT32 data_read_dag1(adsp2100_state *adsp, UINT32 op) -{ - UINT32 ireg = (op >> 2) & 3; - UINT32 mreg = op & 3; - UINT32 base = adsp->base[ireg]; - UINT32 i = adsp->i[ireg]; - UINT32 l = adsp->l[ireg]; - UINT32 res; - - if (adsp->mstat & MSTAT_REVERSE) - { - UINT32 ir = reverse_table[i & 0x3fff]; - res = RWORD_DATA(adsp, ir); - } - else - res = RWORD_DATA(adsp, i); - - i += adsp->m[mreg]; - if (i < base) i += l; - else if (i >= base + l) i -= l; - adsp->i[ireg] = i; - - return res; -} - -INLINE void data_write_dag2(adsp2100_state *adsp, UINT32 op, INT32 val) -{ - UINT32 ireg = 4 + ((op >> 2) & 3); - UINT32 mreg = 4 + (op & 3); - UINT32 base = adsp->base[ireg]; - UINT32 i = adsp->i[ireg]; - UINT32 l = adsp->l[ireg]; - - WWORD_DATA(adsp, i, val); - - i += adsp->m[mreg]; - if (i < base) i += l; - else if (i >= base + l) i -= l; - adsp->i[ireg] = i; -} - - -INLINE UINT32 data_read_dag2(adsp2100_state *adsp, UINT32 op) -{ - UINT32 ireg = 4 + ((op >> 2) & 3); - UINT32 mreg = 4 + (op & 3); - UINT32 base = adsp->base[ireg]; - UINT32 i = adsp->i[ireg]; - UINT32 l = adsp->l[ireg]; - - UINT32 res = RWORD_DATA(adsp, i); - - i += adsp->m[mreg]; - if (i < base) i += l; - else if (i >= base + l) i -= l; - adsp->i[ireg] = i; - - return res; -} - -/*=========================================================================== - Program memory accessors -===========================================================================*/ - -INLINE void pgm_write_dag2(adsp2100_state *adsp, UINT32 op, INT32 val) -{ - UINT32 ireg = 4 + ((op >> 2) & 3); - UINT32 mreg = 4 + (op & 3); - UINT32 base = adsp->base[ireg]; - UINT32 i = adsp->i[ireg]; - UINT32 l = adsp->l[ireg]; - - WWORD_PGM(adsp, i, (val << 8) | adsp->px); - - i += adsp->m[mreg]; - if (i < base) i += l; - else if (i >= base + l) i -= l; - adsp->i[ireg] = i; -} - - -INLINE UINT32 pgm_read_dag2(adsp2100_state *adsp, UINT32 op) -{ - UINT32 ireg = 4 + ((op >> 2) & 3); - UINT32 mreg = 4 + (op & 3); - UINT32 base = adsp->base[ireg]; - UINT32 i = adsp->i[ireg]; - UINT32 l = adsp->l[ireg]; - UINT32 res; - - res = RWORD_PGM(adsp, i); - adsp->px = res; - res >>= 8; - - i += adsp->m[mreg]; - if (i < base) i += l; - else if (i >= base + l) i -= l; - adsp->i[ireg] = i; - - return res; -} - - - -/*=========================================================================== - register reading -===========================================================================*/ - -#define ALU_GETXREG_UNSIGNED(a,x) (*(UINT16 *)(a)->alu_xregs[x]) -#define ALU_GETYREG_UNSIGNED(a,y) (*(UINT16 *)(a)->alu_yregs[y]) - -#define MAC_GETXREG_UNSIGNED(a,x) (*(UINT16 *)(a)->mac_xregs[x]) -#define MAC_GETXREG_SIGNED(a,x) (*( INT16 *)(a)->mac_xregs[x]) -#define MAC_GETYREG_UNSIGNED(a,y) (*(UINT16 *)(a)->mac_yregs[y]) -#define MAC_GETYREG_SIGNED(a,y) (*( INT16 *)(a)->mac_yregs[y]) - -#define SHIFT_GETXREG_UNSIGNED(a,x) (*(UINT16 *)(a)->shift_xregs[x]) -#define SHIFT_GETXREG_SIGNED(a,x) (*( INT16 *)(a)->shift_xregs[x]) - - - -/*=========================================================================== - ALU operations (result in AR) -===========================================================================*/ - -static void alu_op_ar(adsp2100_state *adsp, int op) -{ - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 res; - - switch (op & (15<<13)) /*JB*/ - { - case 0x00<<13: - /* Y Clear when y = 0 */ - res = ALU_GETYREG_UNSIGNED(adsp, yop); - CALC_NZ(res); - break; - case 0x01<<13: - /* Y + 1 PASS 1 when y = 0 */ - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop + 1; - CALC_NZ(res); - if (yop == 0x7fff) SET_V; - else if (yop == 0xffff) SET_C; - break; - case 0x02<<13: - /* X + Y + C */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - yop += GET_C >> 3; - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x03<<13: - /* X + Y X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x04<<13: - /* NOT Y */ - res = ALU_GETYREG_UNSIGNED(adsp, yop) ^ 0xffff; - CALC_NZ(res); - break; - case 0x05<<13: - /* -Y */ - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = -yop; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - if (yop == 0x0000) SET_C; - break; - case 0x06<<13: - /* X - Y + C - 1 X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop - yop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x07<<13: - /* X - Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop - yop; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x08<<13: - /* Y - 1 PASS -1 when y = 0 */ - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop - 1; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - else if (yop == 0x0000) SET_C; - break; - case 0x09<<13: - /* Y - X -X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop - xop; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0a<<13: - /* Y - X + C - 1 -X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop - xop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0b<<13: - /* NOT X */ - res = ALU_GETXREG_UNSIGNED(adsp, xop) ^ 0xffff; - CALC_NZ(res); - break; - case 0x0c<<13: - /* X AND Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop & yop; - CALC_NZ(res); - break; - case 0x0d<<13: - /* X OR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop | yop; - CALC_NZ(res); - break; - case 0x0e<<13: - /* X XOR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop ^ yop; - CALC_NZ(res); - break; - case 0x0f<<13: - /* ABS X */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = (xop & 0x8000) ? -xop : xop; - if (xop == 0) SET_Z; - if (xop == 0x8000) SET_N, SET_V; - CLR_S; - if (xop & 0x8000) SET_S; - break; - default: - res = 0; /* just to keep the compiler happy */ - break; - } - - /* saturate */ - if ((adsp->mstat & MSTAT_SATURATE) && GET_V) res = GET_C ? -32768 : 32767; - - /* set the final value */ - adsp->core.ar.u = res; -} - - - -/*=========================================================================== - ALU operations (result in AR, constant yop) -===========================================================================*/ - -static void alu_op_ar_const(adsp2100_state *adsp, int op) -{ - INT32 xop = (op >> 8) & 7; - INT32 yop = constants[((op >> 5) & 0x07) | ((op >> 8) & 0x18)]; - INT32 res; - - switch (op & (15<<13)) /*JB*/ - { - case 0x00<<13: - /* Y Clear when y = 0 */ - res = yop; - CALC_NZ(res); - break; - case 0x01<<13: - /* Y + 1 PASS 1 when y = 0 */ - res = yop + 1; - CALC_NZ(res); - if (yop == 0x7fff) SET_V; - else if (yop == 0xffff) SET_C; - break; - case 0x02<<13: - /* X + Y + C */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop += GET_C >> 3; - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x03<<13: - /* X + Y X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x04<<13: - /* NOT Y */ - res = yop ^ 0xffff; - CALC_NZ(res); - break; - case 0x05<<13: - /* -Y */ - res = -yop; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - if (yop == 0x0000) SET_C; - break; - case 0x06<<13: - /* X - Y + C - 1 X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop - yop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x07<<13: - /* X - Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop - yop; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x08<<13: - /* Y - 1 PASS -1 when y = 0 */ - res = yop - 1; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - else if (yop == 0x0000) SET_C; - break; - case 0x09<<13: - /* Y - X -X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = yop - xop; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0a<<13: - /* Y - X + C - 1 -X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = yop - xop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0b<<13: - /* NOT X */ - res = ALU_GETXREG_UNSIGNED(adsp, xop) ^ 0xffff; - CALC_NZ(res); - break; - case 0x0c<<13: - /* X AND Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop & yop; - CALC_NZ(res); - break; - case 0x0d<<13: - /* X OR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop | yop; - CALC_NZ(res); - break; - case 0x0e<<13: - /* X XOR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop ^ yop; - CALC_NZ(res); - break; - case 0x0f<<13: - /* ABS X */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = (xop & 0x8000) ? -xop : xop; - if (xop == 0) SET_Z; - if (xop == 0x8000) SET_N, SET_V; - CLR_S; - if (xop & 0x8000) SET_S; - break; - default: - res = 0; /* just to keep the compiler happy */ - break; - } - - /* saturate */ - if ((adsp->mstat & MSTAT_SATURATE) && GET_V) res = GET_C ? -32768 : 32767; - - /* set the final value */ - adsp->core.ar.u = res; -} - - - -/*=========================================================================== - ALU operations (result in AF) -===========================================================================*/ - -static void alu_op_af(adsp2100_state *adsp, int op) -{ - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 res; - - switch (op & (15<<13)) /*JB*/ - { - case 0x00<<13: - /* Y Clear when y = 0 */ - res = ALU_GETYREG_UNSIGNED(adsp, yop); - CALC_NZ(res); - break; - case 0x01<<13: - /* Y + 1 PASS 1 when y = 0 */ - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop + 1; - CALC_NZ(res); - if (yop == 0x7fff) SET_V; - else if (yop == 0xffff) SET_C; - break; - case 0x02<<13: - /* X + Y + C */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - yop += GET_C >> 3; - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x03<<13: - /* X + Y X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x04<<13: - /* NOT Y */ - res = ALU_GETYREG_UNSIGNED(adsp, yop) ^ 0xffff; - CALC_NZ(res); - break; - case 0x05<<13: - /* -Y */ - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = -yop; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - if (yop == 0x0000) SET_C; - break; - case 0x06<<13: - /* X - Y + C - 1 X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop - yop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x07<<13: - /* X - Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop - yop; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x08<<13: - /* Y - 1 PASS -1 when y = 0 */ - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop - 1; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - else if (yop == 0x0000) SET_C; - break; - case 0x09<<13: - /* Y - X -X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop - xop; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0a<<13: - /* Y - X + C - 1 -X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop - xop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0b<<13: - /* NOT X */ - res = ALU_GETXREG_UNSIGNED(adsp, xop) ^ 0xffff; - CALC_NZ(res); - break; - case 0x0c<<13: - /* X AND Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop & yop; - CALC_NZ(res); - break; - case 0x0d<<13: - /* X OR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop | yop; - CALC_NZ(res); - break; - case 0x0e<<13: - /* X XOR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop ^ yop; - CALC_NZ(res); - break; - case 0x0f<<13: - /* ABS X */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = (xop & 0x8000) ? -xop : xop; - if (xop == 0) SET_Z; - if (xop == 0x8000) SET_N, SET_V; - CLR_S; - if (xop & 0x8000) SET_S; - break; - default: - res = 0; /* just to keep the compiler happy */ - break; - } - - /* set the final value */ - adsp->core.af.u = res; -} - - - -/*=========================================================================== - ALU operations (result in AF, constant yop) -===========================================================================*/ - -static void alu_op_af_const(adsp2100_state *adsp, int op) -{ - INT32 xop = (op >> 8) & 7; - INT32 yop = constants[((op >> 5) & 0x07) | ((op >> 8) & 0x18)]; - INT32 res; - - switch (op & (15<<13)) /*JB*/ - { - case 0x00<<13: - /* Y Clear when y = 0 */ - res = yop; - CALC_NZ(res); - break; - case 0x01<<13: - /* Y + 1 PASS 1 when y = 0 */ - res = yop + 1; - CALC_NZ(res); - if (yop == 0x7fff) SET_V; - else if (yop == 0xffff) SET_C; - break; - case 0x02<<13: - /* X + Y + C */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop += GET_C >> 3; - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x03<<13: - /* X + Y X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x04<<13: - /* NOT Y */ - res = yop ^ 0xffff; - CALC_NZ(res); - break; - case 0x05<<13: - /* -Y */ - res = -yop; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - if (yop == 0x0000) SET_C; - break; - case 0x06<<13: - /* X - Y + C - 1 X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop - yop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x07<<13: - /* X - Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop - yop; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x08<<13: - /* Y - 1 PASS -1 when y = 0 */ - res = yop - 1; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - else if (yop == 0x0000) SET_C; - break; - case 0x09<<13: - /* Y - X -X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = yop - xop; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0a<<13: - /* Y - X + C - 1 -X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = yop - xop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0b<<13: - /* NOT X */ - res = ALU_GETXREG_UNSIGNED(adsp, xop) ^ 0xffff; - CALC_NZ(res); - break; - case 0x0c<<13: - /* X AND Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop & yop; - CALC_NZ(res); - break; - case 0x0d<<13: - /* X OR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop | yop; - CALC_NZ(res); - break; - case 0x0e<<13: - /* X XOR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = xop ^ yop; - CALC_NZ(res); - break; - case 0x0f<<13: - /* ABS X */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = (xop & 0x8000) ? -xop : xop; - if (xop == 0) SET_Z; - if (xop == 0x8000) SET_N, SET_V; - CLR_S; - if (xop & 0x8000) SET_S; - break; - default: - res = 0; /* just to keep the compiler happy */ - break; - } - - /* set the final value */ - adsp->core.af.u = res; -} - - - -/*=========================================================================== - ALU operations (no result) -===========================================================================*/ - -static void alu_op_none(adsp2100_state *adsp, int op) -{ - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 res; - - switch (op & (15<<13)) /*JB*/ - { - case 0x00<<13: - /* Y Clear when y = 0 */ - res = ALU_GETYREG_UNSIGNED(adsp, yop); - CALC_NZ(res); - break; - case 0x01<<13: - /* Y + 1 PASS 1 when y = 0 */ - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop + 1; - CALC_NZ(res); - if (yop == 0x7fff) SET_V; - else if (yop == 0xffff) SET_C; - break; - case 0x02<<13: - /* X + Y + C */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - yop += GET_C >> 3; - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x03<<13: - /* X + Y X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop + yop; - CALC_NZVC(xop, yop, res); - break; - case 0x04<<13: - /* NOT Y */ - res = ALU_GETYREG_UNSIGNED(adsp, yop) ^ 0xffff; - CALC_NZ(res); - break; - case 0x05<<13: - /* -Y */ - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = -yop; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - if (yop == 0x0000) SET_C; - break; - case 0x06<<13: - /* X - Y + C - 1 X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop - yop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x07<<13: - /* X - Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop - yop; - CALC_NZVC_SUB(xop, yop, res); - break; - case 0x08<<13: - /* Y - 1 PASS -1 when y = 0 */ - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop - 1; - CALC_NZ(res); - if (yop == 0x8000) SET_V; - else if (yop == 0x0000) SET_C; - break; - case 0x09<<13: - /* Y - X -X when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop - xop; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0a<<13: - /* Y - X + C - 1 -X + C - 1 when y = 0 */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = yop - xop + (GET_C >> 3) - 1; - CALC_NZVC_SUB(yop, xop, res); - break; - case 0x0b<<13: - /* NOT X */ - res = ALU_GETXREG_UNSIGNED(adsp, xop) ^ 0xffff; - CALC_NZ(res); - break; - case 0x0c<<13: - /* X AND Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop & yop; - CALC_NZ(res); - break; - case 0x0d<<13: - /* X OR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop | yop; - CALC_NZ(res); - break; - case 0x0e<<13: - /* X XOR Y */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - res = xop ^ yop; - CALC_NZ(res); - break; - case 0x0f<<13: - /* ABS X */ - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - res = (xop & 0x8000) ? -xop : xop; - if (xop == 0) SET_Z; - if (xop == 0x8000) SET_N, SET_V; - CLR_S; - if (xop & 0x8000) SET_S; - break; - } -} - - - -/*=========================================================================== - MAC operations (result in MR) -===========================================================================*/ - -static void mac_op_mr(adsp2100_state *adsp, int op) -{ - INT8 shift = ((adsp->mstat & MSTAT_INTEGER) >> 4) ^ 1; - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 temp; - INT64 res; - - switch (op & (15<<13)) /*JB*/ - { - case 0x00<<13: - /* no-op */ - return; - case 0x01<<13: - /* X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x02<<13: - /* MR + X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x03<<13: - /* MR - X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x04<<13: - /* X * Y (SS) Clear when y = 0 */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; - break; - case 0x05<<13: - /* X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; - break; - case 0x06<<13: - /* X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; - break; - case 0x07<<13: - /* X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; - break; - case 0x08<<13: - /* MR + X * Y (SS) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x09<<13: - /* MR + X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0a<<13: - /* MR + X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0b<<13: - /* MR + X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0c<<13: - /* MR - X * Y (SS) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0d<<13: - /* MR - X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0e<<13: - /* MR - X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0f<<13: - /* MR - X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - default: - res = 0; /* just to keep the compiler happy */ - break; - } - - /* set the final value */ - temp = (res >> 31) & 0x1ff; - CLR_MV; - if (temp != 0x000 && temp != 0x1ff) SET_MV; - adsp->core.mr.mr = res; -} - - - -/*=========================================================================== - MAC operations (result in MR, yop == xop) -===========================================================================*/ - -static void mac_op_mr_xop(adsp2100_state *adsp, int op) -{ - INT8 shift = ((adsp->mstat & MSTAT_INTEGER) >> 4) ^ 1; - INT32 xop = (op >> 8) & 7; - INT32 temp; - INT64 res; - - switch (op & (15<<13)) /*JB*/ - { - case 0x00<<13: - /* no-op */ - return; - case 0x01<<13: - /* X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x02<<13: - /* MR + X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x03<<13: - /* MR - X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x04<<13: - /* X * Y (SS) Clear when y = 0 */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; - break; - case 0x05<<13: - /* X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; - break; - case 0x06<<13: - /* X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; - break; - case 0x07<<13: - /* X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; - break; - case 0x08<<13: - /* MR + X * Y (SS) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x09<<13: - /* MR + X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0a<<13: - /* MR + X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0b<<13: - /* MR + X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0c<<13: - /* MR - X * Y (SS) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0d<<13: - /* MR - X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0e<<13: - /* MR - X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0f<<13: - /* MR - X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - default: - res = 0; /* just to keep the compiler happy */ - break; - } - - /* set the final value */ - temp = (res >> 31) & 0x1ff; - CLR_MV; - if (temp != 0x000 && temp != 0x1ff) SET_MV; - adsp->core.mr.mr = res; -} - - - -/*=========================================================================== - MAC operations (result in MF) -===========================================================================*/ - -static void mac_op_mf(adsp2100_state *adsp, int op) -{ - INT8 shift = ((adsp->mstat & MSTAT_INTEGER) >> 4) ^ 1; - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 temp; - INT64 res; - - switch (op & (15<<13)) /*JB*/ - { - case 0x00<<13: - /* no-op */ - return; - case 0x01<<13: - /* X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x02<<13: - /* MR + X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x03<<13: - /* MR - X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x04<<13: - /* X * Y (SS) Clear when y = 0 */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; - break; - case 0x05<<13: - /* X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; - break; - case 0x06<<13: - /* X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; - break; - case 0x07<<13: - /* X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = (INT64)temp; - break; - case 0x08<<13: - /* MR + X * Y (SS) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x09<<13: - /* MR + X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0a<<13: - /* MR + X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0b<<13: - /* MR + X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0c<<13: - /* MR - X * Y (SS) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0d<<13: - /* MR - X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0e<<13: - /* MR - X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_SIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0f<<13: - /* MR - X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - yop = MAC_GETYREG_UNSIGNED(adsp, yop); - temp = (xop * yop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - default: - res = 0; /* just to keep the compiler happy */ - break; - } - - /* set the final value */ - adsp->core.mf.u = (UINT32)res >> 16; -} - - - -/*=========================================================================== - MAC operations (result in MF, yop == xop) -===========================================================================*/ - -static void mac_op_mf_xop(adsp2100_state *adsp, int op) -{ - INT8 shift = ((adsp->mstat & MSTAT_INTEGER) >> 4) ^ 1; - INT32 xop = (op >> 8) & 7; - INT32 temp; - INT64 res; - - switch (op & (15<<13)) /*JB*/ - { - case 0x00<<13: - /* no-op */ - return; - case 0x01<<13: - /* X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x02<<13: - /* MR + X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x03<<13: - /* MR - X * Y (RND) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; -#if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); - else res += (res & 0x8000) << 1; -#else - temp &= 0xffff; - res += 0x8000; - if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); -#endif - break; - case 0x04<<13: - /* X * Y (SS) Clear when y = 0 */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; - break; - case 0x05<<13: - /* X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; - break; - case 0x06<<13: - /* X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; - break; - case 0x07<<13: - /* X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = (INT64)temp; - break; - case 0x08<<13: - /* MR + X * Y (SS) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x09<<13: - /* MR + X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0a<<13: - /* MR + X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0b<<13: - /* MR + X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr + (INT64)temp; - break; - case 0x0c<<13: - /* MR - X * Y (SS) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0d<<13: - /* MR - X * Y (SU) */ - xop = MAC_GETXREG_SIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0e<<13: - /* MR - X * Y (US) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - case 0x0f<<13: - /* MR - X * Y (UU) */ - xop = MAC_GETXREG_UNSIGNED(adsp, xop); - temp = (xop * xop) << shift; - res = adsp->core.mr.mr - (INT64)temp; - break; - default: - res = 0; /* just to keep the compiler happy */ - break; - } - - /* set the final value */ - adsp->core.mf.u = (UINT32)res >> 16; -} - - - -/*=========================================================================== - SHIFT operations (result in SR/SE/SB) -===========================================================================*/ - -static void shift_op(adsp2100_state *adsp, int op) -{ - INT8 sc = adsp->core.se.s; - INT32 xop = (op >> 8) & 7; - UINT32 res; - - switch (op & (15<<11)) /*JB*/ - { - case 0x00<<11: - /* LSHIFT (HI) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop) << 16; - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? ((UINT32)xop >> -sc) : 0; - adsp->core.sr.sr = res; - break; - case 0x01<<11: - /* LSHIFT (HI, OR) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop) << 16; - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? ((UINT32)xop >> -sc) : 0; - adsp->core.sr.sr |= res; - break; - case 0x02<<11: - /* LSHIFT (LO) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : 0; - adsp->core.sr.sr = res; - break; - case 0x03<<11: - /* LSHIFT (LO, OR) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : 0; - adsp->core.sr.sr |= res; - break; - case 0x04<<11: - /* ASHIFT (HI) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : (xop >> 31); - adsp->core.sr.sr = res; - break; - case 0x05<<11: - /* ASHIFT (HI, OR) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : (xop >> 31); - adsp->core.sr.sr |= res; - break; - case 0x06<<11: - /* ASHIFT (LO) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : (xop >> 31); - adsp->core.sr.sr = res; - break; - case 0x07<<11: - /* ASHIFT (LO, OR) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : (xop >> 31); - adsp->core.sr.sr |= res; - break; - case 0x08<<11: - /* NORM (HI) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - if (sc > 0) - { - xop = ((UINT32)xop >> 1) | ((adsp->astat & CFLAG) << 28); - res = xop >> (sc - 1); - } - else res = (sc > -32) ? (xop << -sc) : 0; - adsp->core.sr.sr = res; - break; - case 0x09<<11: - /* NORM (HI, OR) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - if (sc > 0) - { - xop = ((UINT32)xop >> 1) | ((adsp->astat & CFLAG) << 28); - res = xop >> (sc - 1); - } - else res = (sc > -32) ? (xop << -sc) : 0; - adsp->core.sr.sr |= res; - break; - case 0x0a<<11: - /* NORM (LO) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop >> sc) : 0; - else res = (sc > -32) ? (xop << -sc) : 0; - adsp->core.sr.sr = res; - break; - case 0x0b<<11: - /* NORM (LO, OR) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop >> sc) : 0; - else res = (sc > -32) ? (xop << -sc) : 0; - adsp->core.sr.sr |= res; - break; - case 0x0c<<11: - /* EXP (HI) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - res = 0; - if (xop < 0) - { - SET_SS; - while ((xop & 0x40000000) != 0) res++, xop <<= 1; - } - else - { - CLR_SS; - xop |= 0x8000; - while ((xop & 0x40000000) == 0) res++, xop <<= 1; - } - adsp->core.se.s = -res; - break; - case 0x0d<<11: - /* EXP (HIX) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - if (GET_V) - { - adsp->core.se.s = 1; - if (xop < 0) CLR_SS; - else SET_SS; - } - else - { - res = 0; - if (xop < 0) - { - SET_SS; - while ((xop & 0x40000000) != 0) res++, xop <<= 1; - } - else - { - CLR_SS; - xop |= 0x8000; - while ((xop & 0x40000000) == 0) res++, xop <<= 1; - } - adsp->core.se.s = -res; - } - break; - case 0x0e<<11: - /* EXP (LO) */ - if (adsp->core.se.s == -15) - { - xop = SHIFT_GETXREG_SIGNED(adsp, xop); - res = 15; - if (GET_SS) - while ((xop & 0x8000) != 0) res++, xop <<= 1; - else - { - xop = (xop << 1) | 1; - while ((xop & 0x10000) == 0) res++, xop <<= 1; - } - adsp->core.se.s = -res; - } - break; - case 0x0f<<11: - /* EXPADJ */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - res = 0; - if (xop < 0) - while ((xop & 0x40000000) != 0) res++, xop <<= 1; - else - { - xop |= 0x8000; - while ((xop & 0x40000000) == 0) res++, xop <<= 1; - } - if (res < -adsp->core.sb.s) - adsp->core.sb.s = -res; - break; - } -} - - - -/*=========================================================================== - Immediate SHIFT operations (result in SR/SE/SB) -===========================================================================*/ - -static void shift_op_imm(adsp2100_state *adsp, int op) -{ - INT8 sc = (INT8)op; - INT32 xop = (op >> 8) & 7; - UINT32 res; - - switch (op & (15<<11)) /*JB*/ - { - case 0x00<<11: - /* LSHIFT (HI) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop) << 16; - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? ((UINT32)xop >> -sc) : 0; - adsp->core.sr.sr = res; - break; - case 0x01<<11: - /* LSHIFT (HI, OR) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop) << 16; - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? ((UINT32)xop >> -sc) : 0; - adsp->core.sr.sr |= res; - break; - case 0x02<<11: - /* LSHIFT (LO) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : 0; - adsp->core.sr.sr = res; - break; - case 0x03<<11: - /* LSHIFT (LO, OR) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : 0; - adsp->core.sr.sr |= res; - break; - case 0x04<<11: - /* ASHIFT (HI) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : (xop >> 31); - adsp->core.sr.sr = res; - break; - case 0x05<<11: - /* ASHIFT (HI, OR) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : (xop >> 31); - adsp->core.sr.sr |= res; - break; - case 0x06<<11: - /* ASHIFT (LO) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : (xop >> 31); - adsp->core.sr.sr = res; - break; - case 0x07<<11: - /* ASHIFT (LO, OR) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? (xop >> -sc) : (xop >> 31); - adsp->core.sr.sr |= res; - break; - case 0x08<<11: - /* NORM (HI) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - if (sc > 0) - { - xop = ((UINT32)xop >> 1) | ((adsp->astat & CFLAG) << 28); - res = xop >> (sc - 1); - } - else res = (sc > -32) ? (xop << -sc) : 0; - adsp->core.sr.sr = res; - break; - case 0x09<<11: - /* NORM (HI, OR) */ - xop = SHIFT_GETXREG_SIGNED(adsp, xop) << 16; - if (sc > 0) - { - xop = ((UINT32)xop >> 1) | ((adsp->astat & CFLAG) << 28); - res = xop >> (sc - 1); - } - else res = (sc > -32) ? (xop << -sc) : 0; - adsp->core.sr.sr |= res; - break; - case 0x0a<<11: - /* NORM (LO) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop >> sc) : 0; - else res = (sc > -32) ? (xop << -sc) : 0; - adsp->core.sr.sr = res; - break; - case 0x0b<<11: - /* NORM (LO, OR) */ - xop = SHIFT_GETXREG_UNSIGNED(adsp, xop); - if (sc > 0) res = (sc < 32) ? (xop >> sc) : 0; - else res = (sc > -32) ? (xop << -sc) : 0; - adsp->core.sr.sr |= res; - break; - } -} diff --git a/jan/src/cpu/adsp2100/adsp2100.cpp b/jan/src/cpu/adsp2100/adsp2100.cpp deleted file mode 100644 index cd72ca9fd..000000000 --- a/jan/src/cpu/adsp2100/adsp2100.cpp +++ /dev/null @@ -1,2110 +0,0 @@ -/*************************************************************************** - - ADSP2100.c - Core implementation for the portable Analog ADSP-2100 emulator. - Written by Aaron Giles - -**************************************************************************** - - For ADSP-2101, ADSP-2111 - ------------------------ - - MMAP = 0 MMAP = 1 - - Automatic boot loading No auto boot loading - - Program Space: Program Space: - 0000-07ff = 2k Internal RAM (booted) 0000-37ff = 14k External access - 0800-3fff = 14k External access 3800-3fff = 2k Internal RAM - - Data Space: Data Space: - 0000-03ff = 1k External DWAIT0 0000-03ff = 1k External DWAIT0 - 0400-07ff = 1k External DWAIT1 0400-07ff = 1k External DWAIT1 - 0800-2fff = 10k External DWAIT2 0800-2fff = 10k External DWAIT2 - 3000-33ff = 1k External DWAIT3 3000-33ff = 1k External DWAIT3 - 3400-37ff = 1k External DWAIT4 3400-37ff = 1k External DWAIT4 - 3800-3bff = 1k Internal RAM 3800-3bff = 1k Internal RAM - 3c00-3fff = 1k Internal Control regs 3c00-3fff = 1k Internal Control regs - - - For ADSP-2105, ADSP-2115 - ------------------------ - - MMAP = 0 MMAP = 1 - - Automatic boot loading No auto boot loading - - Program Space: Program Space: - 0000-03ff = 1k Internal RAM (booted) 0000-37ff = 14k External access - 0400-07ff = 1k Reserved 3800-3bff = 1k Internal RAM - 0800-3fff = 14k External access 3c00-3fff = 1k Reserved - - Data Space: Data Space: - 0000-03ff = 1k External DWAIT0 0000-03ff = 1k External DWAIT0 - 0400-07ff = 1k External DWAIT1 0400-07ff = 1k External DWAIT1 - 0800-2fff = 10k External DWAIT2 0800-2fff = 10k External DWAIT2 - 3000-33ff = 1k External DWAIT3 3000-33ff = 1k External DWAIT3 - 3400-37ff = 1k External DWAIT4 3400-37ff = 1k External DWAIT4 - 3800-39ff = 512 Internal RAM 3800-39ff = 512 Internal RAM - 3a00-3bff = 512 Reserved 3a00-3bff = 512 Reserved - 3c00-3fff = 1k Internal Control regs 3c00-3fff = 1k Internal Control regs - - - For ADSP-2104 - ------------- - - MMAP = 0 MMAP = 1 - - Automatic boot loading No auto boot loading - - Program Space: Program Space: - 0000-01ff = 512 Internal RAM (booted) 0000-37ff = 14k External access - 0400-07ff = 1k Reserved 3800-3bff = 1k Internal RAM - 0800-3fff = 14k External access 3c00-3fff = 1k Reserved - - Data Space: Data Space: - 0000-03ff = 1k External DWAIT0 0000-03ff = 1k External DWAIT0 - 0400-07ff = 1k External DWAIT1 0400-07ff = 1k External DWAIT1 - 0800-2fff = 10k External DWAIT2 0800-2fff = 10k External DWAIT2 - 3000-33ff = 1k External DWAIT3 3000-33ff = 1k External DWAIT3 - 3400-37ff = 1k External DWAIT4 3400-37ff = 1k External DWAIT4 - 3800-38ff = 256 Internal RAM 3800-38ff = 256 Internal RAM - 3a00-3bff = 512 Reserved 3a00-3bff = 512 Reserved - 3c00-3fff = 1k Internal Control regs 3c00-3fff = 1k Internal Control regs - - - For ADSP-2181 - ------------- - - MMAP = 0 MMAP = 1 - - Program Space: Program Space: - 0000-1fff = 8k Internal RAM 0000-1fff = 8k External access - 2000-3fff = 8k Internal RAM or Overlay 2000-3fff = 8k Internal - - Data Space: Data Space: - 0000-1fff = 8k Internal RAM or Overlay 0000-1fff = 8k Internal RAM or Overlay - 2000-3fdf = 8k-32 Internal RAM 2000-3fdf = 8k-32 Internal RAM - 3fe0-3fff = 32 Internal Control regs 3fe0-3fff = 32 Internal Control regs - - I/O Space: I/O Space: - 0000-01ff = 512 External IOWAIT0 0000-01ff = 512 External IOWAIT0 - 0200-03ff = 512 External IOWAIT1 0200-03ff = 512 External IOWAIT1 - 0400-05ff = 512 External IOWAIT2 0400-05ff = 512 External IOWAIT2 - 0600-07ff = 512 External IOWAIT3 0600-07ff = 512 External IOWAIT3 - -***************************************************************************/ - -#include "adsp2100.h" -#include -#include - -/*************************************************************************** - PRIVATE GLOBAL VARIABLES -***************************************************************************/ - -static UINT16 *reverse_table = 0; -static UINT16 *mask_table = 0; -static UINT8 *condition_table = 0; - -#if TRACK_HOTSPOTS -static UINT32 pcbucket[0x4000]; -#endif - - - -#if 0 -/*************************************************************************** - CPU STATE DESCRIPTION -***************************************************************************/ - -#define ADSP21XX_STATE_ENTRY(_name, _format, _member, _datamask, _flags) \ - CPU_STATE_ENTRY(ADSP2100_##_name, #_name, _format, adsp2100_state, _member, _datamask, ~0, _flags) - -#define ADSP21XX_STATE_ENTRY_MASK(_name, _format, _member, _datamask, _flags, _validmask) \ - CPU_STATE_ENTRY(ADSP2100_##_name, #_name, _format, adsp2100_state, _member, _datamask, _validmask, _flags) - -static const cpu_state_entry state_array[] = -{ - ADSP21XX_STATE_ENTRY(PC, "%04X", pc, 0xffff, 0) - ADSP21XX_STATE_ENTRY(GENPC, "%04X", pc, 0xffff, CPUSTATE_NOSHOW) - ADSP21XX_STATE_ENTRY(GENPCBASE, "%04X", ppc, 0xffff, CPUSTATE_NOSHOW) - - ADSP21XX_STATE_ENTRY(AX0, "%04X", core.ax0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AX1, "%04X", core.ax1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AY0, "%04X", core.ay0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AY1, "%04X", core.ay1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AR, "%04X", core.ar.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AF, "%04X", core.af.u, 0xffff, 0) - - ADSP21XX_STATE_ENTRY(MX0, "%04X", core.mx0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MX1, "%04X", core.mx1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MY0, "%04X", core.my0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MY1, "%04X", core.my1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MR0, "%04X", core.mr.mrx.mr0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MR1, "%04X", core.mr.mrx.mr1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MR2, "%02X", core.mr.mrx.mr2.u, 0xff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(MF, "%04X", core.mf.u, 0xffff, 0) - - ADSP21XX_STATE_ENTRY(SI, "%04X", core.si.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(SE, "%02X", core.se.u, 0xff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(SB, "%02X", core.sb.u, 0x1f, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(SR0, "%04X", core.sr.srx.sr0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(SR1, "%04X", core.sr.srx.sr0.u, 0xffff, 0) - - ADSP21XX_STATE_ENTRY(AX0_SEC, "%04X", alt.ax0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AX1_SEC, "%04X", alt.ax1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AY0_SEC, "%04X", alt.ay0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AY1_SEC, "%04X", alt.ay1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AR_SEC, "%04X", alt.ar.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(AF_SEC, "%04X", alt.af.u, 0xffff, 0) - - ADSP21XX_STATE_ENTRY(MX0_SEC, "%04X", alt.mx0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MX1_SEC, "%04X", alt.mx1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MY0_SEC, "%04X", alt.my0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MY1_SEC, "%04X", alt.my1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MR0_SEC, "%04X", alt.mr.mrx.mr0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MR1_SEC, "%04X", alt.mr.mrx.mr1.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(MR2_SEC, "%02X", alt.mr.mrx.mr2.u, 0xff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(MF_SEC, "%04X", alt.mf.u, 0xffff, 0) - - ADSP21XX_STATE_ENTRY(SI_SEC, "%04X", alt.si.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(SE_SEC, "%02X", alt.se.u, 0xff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(SB_SEC, "%02X", alt.sb.u, 0x1f, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(SR0_SEC, "%04X", alt.sr.srx.sr0.u, 0xffff, 0) - ADSP21XX_STATE_ENTRY(SR1_SEC, "%04X", alt.sr.srx.sr0.u, 0xffff, 0) - - ADSP21XX_STATE_ENTRY(I0, "%04X", i[0], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(I1, "%04X", i[1], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(I2, "%04X", i[2], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(I3, "%04X", i[3], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(I4, "%04X", i[4], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(I5, "%04X", i[5], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(I6, "%04X", i[6], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(I7, "%04X", i[7], 0x3fff, CPUSTATE_IMPORT) - - ADSP21XX_STATE_ENTRY(L0, "%04X", l[0], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(L1, "%04X", l[1], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(L2, "%04X", l[2], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(L3, "%04X", l[3], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(L4, "%04X", l[4], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(L5, "%04X", l[5], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(L6, "%04X", l[6], 0x3fff, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(L7, "%04X", l[7], 0x3fff, CPUSTATE_IMPORT) - - ADSP21XX_STATE_ENTRY(M0, "%04X", m[0], 0x3fff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(M1, "%04X", m[1], 0x3fff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(M2, "%04X", m[2], 0x3fff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(M3, "%04X", m[3], 0x3fff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(M4, "%04X", m[4], 0x3fff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(M5, "%04X", m[5], 0x3fff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(M6, "%04X", m[6], 0x3fff, CPUSTATE_IMPORT_SEXT) - ADSP21XX_STATE_ENTRY(M7, "%04X", m[7], 0x3fff, CPUSTATE_IMPORT_SEXT) - - ADSP21XX_STATE_ENTRY(PX, "%02X", px, 0xff, 0) - ADSP21XX_STATE_ENTRY(CNTR, "%04X", cntr, 0x3fff, 0) - ADSP21XX_STATE_ENTRY(ASTAT, "%02X", astat, 0xff, 0) - ADSP21XX_STATE_ENTRY(SSTAT, "%02X", sstat, 0xff, 0) - ADSP21XX_STATE_ENTRY_MASK(MSTAT, "%01X", mstat, 0x0f, CPUSTATE_IMPORT, (1 << CHIP_TYPE_ADSP2100)) - ADSP21XX_STATE_ENTRY_MASK(MSTAT, "%02X", mstat, 0x7f, CPUSTATE_IMPORT, ~(1 << CHIP_TYPE_ADSP2100)) - - ADSP21XX_STATE_ENTRY(PCSP, "%02X", pc_sp, 0xff, 0) - ADSP21XX_STATE_ENTRY(GENSP, "%02X", pc_sp, 0xff, CPUSTATE_NOSHOW) - ADSP21XX_STATE_ENTRY(CNTRSP, "%01X", cntr_sp, 0xf, 0) - ADSP21XX_STATE_ENTRY(STATSP, "%01X", stat_sp, 0xf, 0) - ADSP21XX_STATE_ENTRY(LOOPSP, "%01X", loop_sp, 0xf, 0) - - ADSP21XX_STATE_ENTRY_MASK(IMASK, "%01X", imask, 0x00f, CPUSTATE_IMPORT, (1 << CHIP_TYPE_ADSP2100)) - ADSP21XX_STATE_ENTRY_MASK(IMASK, "%02X", imask, 0x03f, CPUSTATE_IMPORT, ~((1 << CHIP_TYPE_ADSP2100) | (1 << CHIP_TYPE_ADSP2181))) - ADSP21XX_STATE_ENTRY_MASK(IMASK, "%03X", imask, 0x3ff, CPUSTATE_IMPORT, (1 << CHIP_TYPE_ADSP2181)) - ADSP21XX_STATE_ENTRY(ICNTL, "%02X", icntl, 0x1f, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(IRQSTATE0, "%1u", irq_state[0], 0x1, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(IRQSTATE1, "%1u", irq_state[1], 0x1, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY(IRQSTATE2, "%1u", irq_state[2], 0x1, CPUSTATE_IMPORT) - ADSP21XX_STATE_ENTRY_MASK(IRQSTATE3, "%1u", irq_state[3], 0x1, CPUSTATE_IMPORT, (1 << CHIP_TYPE_ADSP2100)) - - ADSP21XX_STATE_ENTRY(FLAGIN, "%1u", flagin, 0x1, 0) - ADSP21XX_STATE_ENTRY(FLAGOUT, "%1u", flagout, 0x1, 0) - ADSP21XX_STATE_ENTRY(FL0, "%1u", fl0, 0x1, 0) - ADSP21XX_STATE_ENTRY(FL1, "%1u", fl1, 0x1, 0) - ADSP21XX_STATE_ENTRY(FL2, "%1u", fl2, 0x1, 0) -}; -static const cpu_state_table state_table_template = -{ - NULL, /* pointer to the base of state (offsets are relative to this) */ - 0, /* subtype this table refers to */ - ARRAY_LENGTH(state_array), /* number of entries */ - state_array /* array of entries */ -}; - -#endif - - -/*************************************************************************** - PRIVATE FUNCTION PROTOTYPES -***************************************************************************/ - -static int create_tables(void); -static void check_irqs(adsp2100_state *adsp); - - - -/*************************************************************************** - STATE ACCESSORS -***************************************************************************/ - -#if 0 -INLINE adsp2100_state *get_safe_token(const device_config *device) -{ - assert(device != NULL); - assert(device->token != NULL); - assert(device->type == CPU); - assert(cpu_get_type(device) == CPU_ADSP2100 || - cpu_get_type(device) == CPU_ADSP2101 || - cpu_get_type(device) == CPU_ADSP2104 || - cpu_get_type(device) == CPU_ADSP2105 || - cpu_get_type(device) == CPU_ADSP2115 || - cpu_get_type(device) == CPU_ADSP2181); - return (adsp2100_state *)device->token; -} -#else -#define get_safe_token(x) nullptr -#endif - - -/*************************************************************************** - MEMORY ACCESSORS -***************************************************************************/ -// FBA stuff -extern UINT16 adsp21xx_data_read_word_16le(UINT32 address); -extern UINT32 adsp21xx_read_dword_32le(UINT32 address); -extern void adsp21xx_data_write_word_16le(UINT32 address, UINT16 data); -extern void adsp21xx_write_dword_32le(UINT32 address, UINT32 data); - -INLINE UINT16 RWORD_DATA(adsp2100_state *adsp, UINT32 addr) -{ - //return memory_read_word_16le(adsp->data, addr << 1); - return adsp21xx_data_read_word_16le(addr << 1); -} - -INLINE void WWORD_DATA(adsp2100_state *adsp, UINT32 addr, UINT16 data) -{ - //memory_write_word_16le(adsp->data, addr << 1, data); - adsp21xx_data_write_word_16le(addr << 1, data); -} - -INLINE UINT16 RWORD_IO(adsp2100_state *adsp, UINT32 addr) -{ - //return memory_read_word_16le(adsp->io, addr << 1); - return adsp21xx_data_read_word_16le(addr << 1); -} - -INLINE void WWORD_IO(adsp2100_state *adsp, UINT32 addr, UINT16 data) -{ - //memory_write_word_16le(adsp->io, addr << 1, data); - adsp21xx_data_write_word_16le(addr << 1, data); -} - -INLINE UINT32 RWORD_PGM(adsp2100_state *adsp, UINT32 addr) -{ - //return memory_read_dword_32le(adsp->program, addr << 2); - return adsp21xx_read_dword_32le(addr << 2); -} - -INLINE void WWORD_PGM(adsp2100_state *adsp, UINT32 addr, UINT32 data) -{ - //memory_write_dword_32le(adsp->program, addr << 2, data & 0xffffff); - adsp21xx_write_dword_32le(addr << 2, data & 0xffffff); -} - -//#define ROPCODE(a) memory_decrypted_read_dword((a)->program, (a)->pc << 2) -#define ROPCODE(a) adsp21xx_read_dword_32le((a)->pc << 2) - - -/*************************************************************************** - IMPORT CORE UTILITIES -***************************************************************************/ - -#include "2100ops.c" - - - -/*************************************************************************** - IRQ HANDLING -***************************************************************************/ - -INLINE int adsp2100_generate_irq(adsp2100_state *adsp, int which) -{ - /* skip if masked */ - if (!(adsp->imask & (1 << which))) - return 0; - - /* clear the latch */ - adsp->irq_latch[which] = 0; - - /* push the PC and the status */ - pc_stack_push(adsp); - stat_stack_push(adsp); - - /* vector to location & stop idling */ - adsp->pc = which; - adsp->idle = 0; - - /* mask other interrupts based on the nesting bit */ - if (adsp->icntl & 0x10) adsp->imask &= ~((2 << which) - 1); - else adsp->imask &= ~0xf; - - return 1; -} - - -INLINE int adsp2101_generate_irq(adsp2100_state *adsp, int which, int indx) -{ - /* skip if masked */ - if (!(adsp->imask & (0x20 >> indx))) - return 0; - - /* clear the latch */ - adsp->irq_latch[which] = 0; - - /* push the PC and the status */ - pc_stack_push(adsp); - stat_stack_push(adsp); - - /* vector to location & stop idling */ - adsp->pc = 0x04 + indx * 4; - adsp->idle = 0; - - /* mask other interrupts based on the nesting bit */ - if (adsp->icntl & 0x10) adsp->imask &= ~(0x3f >> indx); - else adsp->imask &= ~0x3f; - - return 1; -} - - -INLINE int adsp2181_generate_irq(adsp2100_state *adsp, int which, int indx) -{ - /* skip if masked */ - if (!(adsp->imask & (0x200 >> indx))) - return 0; - - /* clear the latch */ - adsp->irq_latch[which] = 0; - - /* push the PC and the status */ - pc_stack_push(adsp); - stat_stack_push(adsp); - - /* vector to location & stop idling */ - adsp->pc = 0x04 + indx * 4; - adsp->idle = 0; - - /* mask other interrupts based on the nesting bit */ - if (adsp->icntl & 0x10) adsp->imask &= ~(0x3ff >> indx); - else adsp->imask &= ~0x3ff; - - return 1; -} - - -static void check_irqs(adsp2100_state *adsp) -{ - UINT8 check; - - if (adsp->chip_type >= CHIP_TYPE_ADSP2181) - { - /* check IRQ2 */ - check = (adsp->icntl & 4) ? adsp->irq_latch[ADSP2181_IRQ2] : adsp->irq_state[ADSP2181_IRQ2]; - if (check && adsp2181_generate_irq(adsp, ADSP2181_IRQ2, 0)) - return; - - /* check IRQL1 */ - check = adsp->irq_state[ADSP2181_IRQL1]; - if (check && adsp2181_generate_irq(adsp, ADSP2181_IRQL1, 1)) - return; - - /* check IRQL2 */ - check = adsp->irq_state[ADSP2181_IRQL2]; - if (check && adsp2181_generate_irq(adsp, ADSP2181_IRQL2, 2)) - return; - - /* check SPORT0 transmit */ - check = adsp->irq_latch[ADSP2181_SPORT0_TX]; - if (check && adsp2181_generate_irq(adsp, ADSP2181_SPORT0_TX, 3)) - return; - - /* check SPORT0 receive */ - check = adsp->irq_latch[ADSP2181_SPORT0_RX]; - if (check && adsp2181_generate_irq(adsp, ADSP2181_SPORT0_RX, 4)) - return; - - /* check IRQE */ - check = adsp->irq_latch[ADSP2181_IRQE]; - if (check && adsp2181_generate_irq(adsp, ADSP2181_IRQE, 5)) - return; - - /* check BDMA interrupt */ - - /* check IRQ1/SPORT1 transmit */ - check = (adsp->icntl & 2) ? adsp->irq_latch[ADSP2181_IRQ1] : adsp->irq_state[ADSP2181_IRQ1]; - if (check && adsp2181_generate_irq(adsp, ADSP2181_IRQ1, 7)) - return; - - /* check IRQ0/SPORT1 receive */ - check = (adsp->icntl & 1) ? adsp->irq_latch[ADSP2181_IRQ0] : adsp->irq_state[ADSP2181_IRQ0]; - if (check && adsp2181_generate_irq(adsp, ADSP2181_IRQ0, 8)) - return; - - /* check timer */ - check = adsp->irq_latch[ADSP2181_TIMER]; - if (check && adsp2181_generate_irq(adsp, ADSP2181_TIMER, 9)) - return; - } - else if (adsp->chip_type >= CHIP_TYPE_ADSP2101) - { - /* check IRQ2 */ - check = (adsp->icntl & 4) ? adsp->irq_latch[ADSP2101_IRQ2] : adsp->irq_state[ADSP2101_IRQ2]; - if (check && adsp2101_generate_irq(adsp, ADSP2101_IRQ2, 0)) - return; - - /* check SPORT0 transmit */ - check = adsp->irq_latch[ADSP2101_SPORT0_TX]; - if (check && adsp2101_generate_irq(adsp, ADSP2101_SPORT0_TX, 1)) - return; - - /* check SPORT0 receive */ - check = adsp->irq_latch[ADSP2101_SPORT0_RX]; - if (check && adsp2101_generate_irq(adsp, ADSP2101_SPORT0_RX, 2)) - return; - - /* check IRQ1/SPORT1 transmit */ - check = (adsp->icntl & 2) ? adsp->irq_latch[ADSP2101_IRQ1] : adsp->irq_state[ADSP2101_IRQ1]; - if (check && adsp2101_generate_irq(adsp, ADSP2101_IRQ1, 3)) - return; - - /* check IRQ0/SPORT1 receive */ - check = (adsp->icntl & 1) ? adsp->irq_latch[ADSP2101_IRQ0] : adsp->irq_state[ADSP2101_IRQ0]; - if (check && adsp2101_generate_irq(adsp, ADSP2101_IRQ0, 4)) - return; - - /* check timer */ - check = adsp->irq_latch[ADSP2101_TIMER]; - if (check && adsp2101_generate_irq(adsp, ADSP2101_TIMER, 5)) - return; - } - else - { - /* check IRQ3 */ - check = (adsp->icntl & 8) ? adsp->irq_latch[ADSP2100_IRQ3] : adsp->irq_state[ADSP2100_IRQ3]; - if (check && adsp2100_generate_irq(adsp, ADSP2100_IRQ3)) - return; - - /* check IRQ2 */ - check = (adsp->icntl & 4) ? adsp->irq_latch[ADSP2100_IRQ2] : adsp->irq_state[ADSP2100_IRQ2]; - if (check && adsp2100_generate_irq(adsp, ADSP2100_IRQ2)) - return; - - /* check IRQ1 */ - check = (adsp->icntl & 2) ? adsp->irq_latch[ADSP2100_IRQ1] : adsp->irq_state[ADSP2100_IRQ1]; - if (check && adsp2100_generate_irq(adsp, ADSP2100_IRQ1)) - return; - - /* check IRQ0 */ - check = (adsp->icntl & 1) ? adsp->irq_latch[ADSP2100_IRQ0] : adsp->irq_state[ADSP2100_IRQ0]; - if (check && adsp2100_generate_irq(adsp, ADSP2100_IRQ0)) - return; - } -} - - -static void set_irq_line(adsp2100_state *adsp, int irqline, int state) -{ - /* update the latched state */ - if (state != CLEAR_LINE && adsp->irq_state[irqline] == CLEAR_LINE) - adsp->irq_latch[irqline] = 1; - - /* update the absolute state */ - adsp->irq_state[irqline] = state; -} - -void adsp21xx_set_irq_line(adsp2100_state *adsp, int irqline, int state) -{ - set_irq_line(adsp, irqline, state); -} -/*************************************************************************** - INITIALIZATION AND SHUTDOWN -***************************************************************************/ - -static adsp2100_state *adsp21xx_init(adsp2100_state *adsp, cpu_irq_callback irqcallback, int chiptype) -{ -// const adsp21xx_config *config = (const adsp21xx_config *)device->static_config; -// adsp2100_state *adsp = get_safe_token(device); - - /* create the tables */ - if (!create_tables()) - fatalerror("creating adsp2100 tables failed"); - - /* set the IRQ callback */ - adsp->chip_type = chiptype; - adsp->irq_callback = irqcallback; - - /* fetch device parameters */ -// adsp->device = device; -// adsp->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); -// adsp->data = memory_find_address_space(device, ADDRESS_SPACE_DATA); -// adsp->io = memory_find_address_space(device, ADDRESS_SPACE_IO); - - /* copy function pointers from the config */ -// if (config != NULL) -// { -// adsp->sport_rx_callback = config->rx; -// adsp->sport_tx_callback = config->tx; -// adsp->timer_fired = config->timer; -// } - - /* set up the state table */ -// adsp->state = state_table_template; -// adsp->state.baseptr = adsp; -// adsp->state.subtypemask = 1 << chiptype; - - /* set up ALU register pointers */ - adsp->alu_xregs[0] = &adsp->core.ax0; - adsp->alu_xregs[1] = &adsp->core.ax1; - adsp->alu_xregs[2] = &adsp->core.ar; - adsp->alu_xregs[3] = &adsp->core.mr.mrx.mr0; - adsp->alu_xregs[4] = &adsp->core.mr.mrx.mr1; - adsp->alu_xregs[5] = &adsp->core.mr.mrx.mr2; - adsp->alu_xregs[6] = &adsp->core.sr.srx.sr0; - adsp->alu_xregs[7] = &adsp->core.sr.srx.sr1; - adsp->alu_yregs[0] = &adsp->core.ay0; - adsp->alu_yregs[1] = &adsp->core.ay1; - adsp->alu_yregs[2] = &adsp->core.af; - adsp->alu_yregs[3] = &adsp->core.zero; - - /* set up MAC register pointers */ - adsp->mac_xregs[0] = &adsp->core.mx0; - adsp->mac_xregs[1] = &adsp->core.mx1; - adsp->mac_xregs[2] = &adsp->core.ar; - adsp->mac_xregs[3] = &adsp->core.mr.mrx.mr0; - adsp->mac_xregs[4] = &adsp->core.mr.mrx.mr1; - adsp->mac_xregs[5] = &adsp->core.mr.mrx.mr2; - adsp->mac_xregs[6] = &adsp->core.sr.srx.sr0; - adsp->mac_xregs[7] = &adsp->core.sr.srx.sr1; - adsp->mac_yregs[0] = &adsp->core.my0; - adsp->mac_yregs[1] = &adsp->core.my1; - adsp->mac_yregs[2] = &adsp->core.mf; - adsp->mac_yregs[3] = &adsp->core.zero; - - /* set up shift register pointers */ - adsp->shift_xregs[0] = &adsp->core.si; - adsp->shift_xregs[1] = &adsp->core.si; - adsp->shift_xregs[2] = &adsp->core.ar; - adsp->shift_xregs[3] = &adsp->core.mr.mrx.mr0; - adsp->shift_xregs[4] = &adsp->core.mr.mrx.mr1; - adsp->shift_xregs[5] = &adsp->core.mr.mrx.mr2; - adsp->shift_xregs[6] = &adsp->core.sr.srx.sr0; - adsp->shift_xregs[7] = &adsp->core.sr.srx.sr1; - -#if 0 - /* "core" */ - state_save_register_device_item(device, 0, adsp->core.ax0.u); - state_save_register_device_item(device, 0, adsp->core.ax1.u); - state_save_register_device_item(device, 0, adsp->core.ay0.u); - state_save_register_device_item(device, 0, adsp->core.ay1.u); - state_save_register_device_item(device, 0, adsp->core.ar.u); - state_save_register_device_item(device, 0, adsp->core.af.u); - state_save_register_device_item(device, 0, adsp->core.mx0.u); - state_save_register_device_item(device, 0, adsp->core.mx1.u); - state_save_register_device_item(device, 0, adsp->core.my0.u); - state_save_register_device_item(device, 0, adsp->core.my1.u); - state_save_register_device_item(device, 0, adsp->core.mr.mr); - state_save_register_device_item(device, 0, adsp->core.mf.u); - state_save_register_device_item(device, 0, adsp->core.si.u); - state_save_register_device_item(device, 0, adsp->core.se.u); - state_save_register_device_item(device, 0, adsp->core.sb.u); - state_save_register_device_item(device, 0, adsp->core.sr.sr); - state_save_register_device_item(device, 0, adsp->core.zero.u); - - /* "alt" */ - state_save_register_device_item(device, 0, adsp->alt.ax0.u); - state_save_register_device_item(device, 0, adsp->alt.ax1.u); - state_save_register_device_item(device, 0, adsp->alt.ay0.u); - state_save_register_device_item(device, 0, adsp->alt.ay1.u); - state_save_register_device_item(device, 0, adsp->alt.ar.u); - state_save_register_device_item(device, 0, adsp->alt.af.u); - state_save_register_device_item(device, 0, adsp->alt.mx0.u); - state_save_register_device_item(device, 0, adsp->alt.mx1.u); - state_save_register_device_item(device, 0, adsp->alt.my0.u); - state_save_register_device_item(device, 0, adsp->alt.my1.u); - state_save_register_device_item(device, 0, adsp->alt.mr.mr); - state_save_register_device_item(device, 0, adsp->alt.mf.u); - state_save_register_device_item(device, 0, adsp->alt.si.u); - state_save_register_device_item(device, 0, adsp->alt.se.u); - state_save_register_device_item(device, 0, adsp->alt.sb.u); - state_save_register_device_item(device, 0, adsp->alt.sr.sr); - state_save_register_device_item(device, 0, adsp->alt.zero.u); - - state_save_register_device_item_array(device, 0, adsp->i); - state_save_register_device_item_array(device, 0, adsp->m); - state_save_register_device_item_array(device, 0, adsp->l); - state_save_register_device_item_array(device, 0, adsp->lmask); - state_save_register_device_item_array(device, 0, adsp->base); - state_save_register_device_item(device, 0, adsp->px); - - state_save_register_device_item(device, 0, adsp->pc); - state_save_register_device_item(device, 0, adsp->ppc); - state_save_register_device_item(device, 0, adsp->loop); - state_save_register_device_item(device, 0, adsp->loop_condition); - state_save_register_device_item(device, 0, adsp->cntr); - state_save_register_device_item(device, 0, adsp->astat); - state_save_register_device_item(device, 0, adsp->sstat); - state_save_register_device_item(device, 0, adsp->mstat); - state_save_register_device_item(device, 0, adsp->mstat_prev); - state_save_register_device_item(device, 0, adsp->astat_clear); - state_save_register_device_item(device, 0, adsp->idle); - - state_save_register_device_item_array(device, 0, adsp->loop_stack); - state_save_register_device_item_array(device, 0, adsp->cntr_stack); - state_save_register_device_item_array(device, 0, adsp->pc_stack); - state_save_register_device_item_2d_array(device, 0, adsp->stat_stack); - - state_save_register_device_item(device, 0, adsp->pc_sp); - state_save_register_device_item(device, 0, adsp->cntr_sp); - state_save_register_device_item(device, 0, adsp->stat_sp); - state_save_register_device_item(device, 0, adsp->loop_sp); - - state_save_register_device_item(device, 0, adsp->flagout); - state_save_register_device_item(device, 0, adsp->flagin); - state_save_register_device_item(device, 0, adsp->fl0); - state_save_register_device_item(device, 0, adsp->fl1); - state_save_register_device_item(device, 0, adsp->fl2); - state_save_register_device_item(device, 0, adsp->idma_addr); - state_save_register_device_item(device, 0, adsp->idma_cache); - state_save_register_device_item(device, 0, adsp->idma_offs); - - state_save_register_device_item(device, 0, adsp->imask); - state_save_register_device_item(device, 0, adsp->icntl); - state_save_register_device_item(device, 0, adsp->ifc); - state_save_register_device_item_array(device, 0, adsp->irq_state); - state_save_register_device_item_array(device, 0, adsp->irq_latch); -#endif - return adsp; -} - - -//static CPU_RESET( adsp21xx ) -void adsp21xx_reset(adsp2100_state *adsp) -{ - int irq; - - /* ensure that zero is zero */ - adsp->core.zero.u = adsp->alt.zero.u = 0; - - /* recompute the memory registers with their current values */ - wr_l0(adsp, adsp->l[0]); wr_i0(adsp, adsp->i[0]); - wr_l1(adsp, adsp->l[1]); wr_i1(adsp, adsp->i[1]); - wr_l2(adsp, adsp->l[2]); wr_i2(adsp, adsp->i[2]); - wr_l3(adsp, adsp->l[3]); wr_i3(adsp, adsp->i[3]); - wr_l4(adsp, adsp->l[4]); wr_i4(adsp, adsp->i[4]); - wr_l5(adsp, adsp->l[5]); wr_i5(adsp, adsp->i[5]); - wr_l6(adsp, adsp->l[6]); wr_i6(adsp, adsp->i[6]); - wr_l7(adsp, adsp->l[7]); wr_i7(adsp, adsp->i[7]); - - /* reset PC and loops */ - switch (adsp->chip_type) - { - case CHIP_TYPE_ADSP2100: - adsp->pc = 4; - break; - - case CHIP_TYPE_ADSP2101: - case CHIP_TYPE_ADSP2104: - case CHIP_TYPE_ADSP2105: - case CHIP_TYPE_ADSP2115: - case CHIP_TYPE_ADSP2181: - adsp->pc = 0; - break; - - default: - logerror( "ADSP2100 core: Unknown chip type!. Defaulting to adsp->\n" ); - adsp->pc = 4; - adsp->chip_type = CHIP_TYPE_ADSP2100; - break; - } - - adsp->ppc = -1; - adsp->loop = 0xffff; - adsp->loop_condition = 0; - - /* reset status registers */ - adsp->astat_clear = ~(CFLAG | VFLAG | NFLAG | ZFLAG); - adsp->mstat = 0; - adsp->sstat = 0x55; - adsp->idle = 0; - update_mstat(adsp); - - /* reset stacks */ - adsp->pc_sp = 0; - adsp->cntr_sp = 0; - adsp->stat_sp = 0; - adsp->loop_sp = 0; - - /* reset external I/O */ - adsp->flagout = 0; - adsp->flagin = 0; - adsp->fl0 = 0; - adsp->fl1 = 0; - adsp->fl2 = 0; - - /* reset interrupts */ - adsp->imask = 0; - for (irq = 0; irq < 8; irq++) - adsp->irq_state[irq] = adsp->irq_latch[irq] = CLEAR_LINE; -} - - -static int create_tables(void) -{ - int i; - - /* allocate the tables */ - if (!reverse_table) - reverse_table = (UINT16 *)malloc(0x4000 * sizeof(UINT16)); - if (!mask_table) - mask_table = (UINT16 *)malloc(0x4000 * sizeof(UINT16)); - if (!condition_table) - condition_table = (UINT8 *)malloc(0x1000 * sizeof(UINT8)); - - /* handle errors */ - if (reverse_table == NULL || mask_table == NULL || condition_table == NULL) - return 0; - - /* initialize the bit reversing table */ - for (i = 0; i < 0x4000; i++) - { - UINT16 data = 0; - - data |= (i >> 13) & 0x0001; - data |= (i >> 11) & 0x0002; - data |= (i >> 9) & 0x0004; - data |= (i >> 7) & 0x0008; - data |= (i >> 5) & 0x0010; - data |= (i >> 3) & 0x0020; - data |= (i >> 1) & 0x0040; - data |= (i << 1) & 0x0080; - data |= (i << 3) & 0x0100; - data |= (i << 5) & 0x0200; - data |= (i << 7) & 0x0400; - data |= (i << 9) & 0x0800; - data |= (i << 11) & 0x1000; - data |= (i << 13) & 0x2000; - - reverse_table[i] = data; - } - - /* initialize the mask table */ - for (i = 0; i < 0x4000; i++) - { - if (i > 0x2000) mask_table[i] = 0x0000; - else if (i > 0x1000) mask_table[i] = 0x2000; - else if (i > 0x0800) mask_table[i] = 0x3000; - else if (i > 0x0400) mask_table[i] = 0x3800; - else if (i > 0x0200) mask_table[i] = 0x3c00; - else if (i > 0x0100) mask_table[i] = 0x3e00; - else if (i > 0x0080) mask_table[i] = 0x3f00; - else if (i > 0x0040) mask_table[i] = 0x3f80; - else if (i > 0x0020) mask_table[i] = 0x3fc0; - else if (i > 0x0010) mask_table[i] = 0x3fe0; - else if (i > 0x0008) mask_table[i] = 0x3ff0; - else if (i > 0x0004) mask_table[i] = 0x3ff8; - else if (i > 0x0002) mask_table[i] = 0x3ffc; - else if (i > 0x0001) mask_table[i] = 0x3ffe; - else mask_table[i] = 0x3fff; - } - - /* initialize the condition table */ - for (i = 0; i < 0x100; i++) - { - int az = ((i & ZFLAG) != 0); - int an = ((i & NFLAG) != 0); - int av = ((i & VFLAG) != 0); - int ac = ((i & CFLAG) != 0); - int mv = ((i & MVFLAG) != 0); - int as = ((i & SFLAG) != 0); - - condition_table[i | 0x000] = az; - condition_table[i | 0x100] = !az; - condition_table[i | 0x200] = !((an ^ av) | az); - condition_table[i | 0x300] = (an ^ av) | az; - condition_table[i | 0x400] = an ^ av; - condition_table[i | 0x500] = !(an ^ av); - condition_table[i | 0x600] = av; - condition_table[i | 0x700] = !av; - condition_table[i | 0x800] = ac; - condition_table[i | 0x900] = !ac; - condition_table[i | 0xa00] = as; - condition_table[i | 0xb00] = !as; - condition_table[i | 0xc00] = mv; - condition_table[i | 0xd00] = !mv; - condition_table[i | 0xf00] = 1; - } - return 1; -} - - -//static CPU_EXIT( adsp21xx ) -void adsp21xx_exit(adsp2100_state *adsp) -{ - if (reverse_table != NULL) - free(reverse_table); - reverse_table = NULL; - - if (mask_table != NULL) - free(mask_table); - mask_table = NULL; - - if (condition_table != NULL) - free(condition_table); - condition_table = NULL; - -#if TRACK_HOTSPOTS - { - FILE *log = fopen("adsp.hot", "w"); - while (1) - { - int maxindex = 0, i; - for (i = 1; i < 0x4000; i++) - if (pcbucket[i] > pcbucket[maxindex]) - maxindex = i; - if (pcbucket[maxindex] == 0) - break; - fprintf(log, "PC=%04X (%10d hits)\n", maxindex, pcbucket[maxindex]); - pcbucket[maxindex] = 0; - } - fclose(log); - } -#endif - -} - - - -/*************************************************************************** - CORE EXECUTION LOOP -***************************************************************************/ - -/* execute instructions on this CPU until icount expires */ -//static CPU_EXECUTE( adsp21xx ) -int adsp21xx_execute(adsp2100_state *adsp, int cycles) -{ -// int check_debugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0); -// adsp2100_state *adsp = get_safe_token(device); - - check_irqs(adsp); - - /* count cycles and interrupt cycles */ - adsp->icount = cycles; - - do - { - UINT32 temp; - UINT32 op; - - /* debugging */ - adsp->ppc = adsp->pc; /* copy PC to previous PC */ -// if (check_debugger) -// debugger_instruction_hook(device, adsp->pc); - -#if TRACK_HOTSPOTS - pcbucket[adsp->pc & 0x3fff]++; -#endif - - /* instruction fetch */ - op = ROPCODE(adsp); - - /* advance to the next instruction */ - if (adsp->pc != adsp->loop) - adsp->pc++; - - /* handle looping */ - else - { - /* condition not met, keep looping */ - if (CONDITION(adsp, adsp->loop_condition)) - adsp->pc = pc_stack_top(adsp); - - /* condition met; pop the PC and loop stacks and fall through */ - else - { - loop_stack_pop(adsp); - pc_stack_pop_val(adsp); - adsp->pc++; - } - } - - /* parse the instruction */ - switch (op >> 16) - { - case 0x00: - /* 00000000 00000000 00000000 NOP */ - break; - case 0x01: - /* 00000001 0xxxxxxx xxxxxxxx dst = IO(x) */ - /* 00000001 1xxxxxxx xxxxxxxx IO(x) = dst */ - /* ADSP-218x only */ - if (adsp->chip_type >= CHIP_TYPE_ADSP2181) - { - if ((op & 0x008000) == 0x000000) - WRITE_REG(adsp, 0, op & 15, RWORD_IO(adsp, (op >> 4) & 0x7ff)); - else - WWORD_IO(adsp, (op >> 4) & 0x7ff, READ_REG(adsp, 0, op & 15)); - } - break; - case 0x02: - /* 00000010 0000xxxx xxxxxxxx modify flag out */ - /* 00000010 10000000 00000000 idle */ - /* 00000010 10000000 0000xxxx idle (n) */ - if (op & 0x008000) - { - adsp->idle = 1; - adsp->icount = 0; - } - else - { - if (CONDITION(adsp, op & 15)) - { - if (op & 0x020) adsp->flagout = 0; - if (op & 0x010) adsp->flagout ^= 1; - if (adsp->chip_type >= CHIP_TYPE_ADSP2101) - { - if (op & 0x080) adsp->fl0 = 0; - if (op & 0x040) adsp->fl0 ^= 1; - if (op & 0x200) adsp->fl1 = 0; - if (op & 0x100) adsp->fl1 ^= 1; - if (op & 0x800) adsp->fl2 = 0; - if (op & 0x400) adsp->fl2 ^= 1; - } - } - } - break; - case 0x03: - /* 00000011 xxxxxxxx xxxxxxxx call or jump on flag in */ - if (op & 0x000002) - { - if (adsp->flagin) - { - if (op & 0x000001) - pc_stack_push(adsp); - adsp->pc = ((op >> 4) & 0x0fff) | ((op << 10) & 0x3000); - } - } - else - { - if (!adsp->flagin) - { - if (op & 0x000001) - pc_stack_push(adsp); - adsp->pc = ((op >> 4) & 0x0fff) | ((op << 10) & 0x3000); - } - } - break; - case 0x04: - /* 00000100 00000000 000xxxxx stack control */ - if (op & 0x000010) pc_stack_pop_val(adsp); - if (op & 0x000008) loop_stack_pop(adsp); - if (op & 0x000004) cntr_stack_pop(adsp); - if (op & 0x000002) - { - if (op & 0x000001) stat_stack_pop(adsp); - else stat_stack_push(adsp); - } - break; - case 0x05: - /* 00000101 00000000 00000000 saturate MR */ - if (GET_MV) - { - if (adsp->core.mr.mrx.mr2.u & 0x80) - adsp->core.mr.mrx.mr2.u = 0xffff, adsp->core.mr.mrx.mr1.u = 0x8000, adsp->core.mr.mrx.mr0.u = 0x0000; - else - adsp->core.mr.mrx.mr2.u = 0x0000, adsp->core.mr.mrx.mr1.u = 0x7fff, adsp->core.mr.mrx.mr0.u = 0xffff; - } - break; - case 0x06: - /* 00000110 000xxxxx 00000000 DIVS */ - { - int xop = (op >> 8) & 7; - int yop = (op >> 11) & 3; - - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - yop = ALU_GETYREG_UNSIGNED(adsp, yop); - - temp = xop ^ yop; - adsp->astat = (adsp->astat & ~QFLAG) | ((temp >> 10) & QFLAG); - adsp->core.af.u = (yop << 1) | (adsp->core.ay0.u >> 15); - adsp->core.ay0.u = (adsp->core.ay0.u << 1) | (temp >> 15); - } - break; - case 0x07: - /* 00000111 00010xxx 00000000 DIVQ */ - { - int xop = (op >> 8) & 7; - int res; - - xop = ALU_GETXREG_UNSIGNED(adsp, xop); - - if (GET_Q) - res = adsp->core.af.u + xop; - else - res = adsp->core.af.u - xop; - - temp = res ^ xop; - adsp->astat = (adsp->astat & ~QFLAG) | ((temp >> 10) & QFLAG); - adsp->core.af.u = (res << 1) | (adsp->core.ay0.u >> 15); - adsp->core.ay0.u = (adsp->core.ay0.u << 1) | ((~temp >> 15) & 0x0001); - } - break; - case 0x08: - /* 00001000 00000000 0000xxxx reserved */ - break; - case 0x09: - /* 00001001 00000000 000xxxxx modify address register */ - temp = (op >> 2) & 4; - modify_address(adsp, temp + ((op >> 2) & 3), temp + (op & 3)); - break; - case 0x0a: - /* 00001010 00000000 000xxxxx conditional return */ - if (CONDITION(adsp, op & 15)) - { - pc_stack_pop(adsp); - - /* RTI case */ - if (op & 0x000010) - stat_stack_pop(adsp); - } - break; - case 0x0b: - /* 00001011 00000000 xxxxxxxx conditional jump (indirect address) */ - if (CONDITION(adsp, op & 15)) - { - if (op & 0x000010) - pc_stack_push(adsp); - adsp->pc = adsp->i[4 + ((op >> 6) & 3)] & 0x3fff; - } - break; - case 0x0c: - /* 00001100 xxxxxxxx xxxxxxxx mode control */ - if (adsp->chip_type >= CHIP_TYPE_ADSP2101) - { - if (op & 0x000008) adsp->mstat = (adsp->mstat & ~MSTAT_GOMODE) | ((op << 5) & MSTAT_GOMODE); - if (op & 0x002000) adsp->mstat = (adsp->mstat & ~MSTAT_INTEGER) | ((op >> 8) & MSTAT_INTEGER); - if (op & 0x008000) adsp->mstat = (adsp->mstat & ~MSTAT_TIMER) | ((op >> 9) & MSTAT_TIMER); - } - if (op & 0x000020) adsp->mstat = (adsp->mstat & ~MSTAT_BANK) | ((op >> 4) & MSTAT_BANK); - if (op & 0x000080) adsp->mstat = (adsp->mstat & ~MSTAT_REVERSE) | ((op >> 5) & MSTAT_REVERSE); - if (op & 0x000200) adsp->mstat = (adsp->mstat & ~MSTAT_STICKYV) | ((op >> 6) & MSTAT_STICKYV); - if (op & 0x000800) adsp->mstat = (adsp->mstat & ~MSTAT_SATURATE) | ((op >> 7) & MSTAT_SATURATE); - update_mstat(adsp); - break; - case 0x0d: - /* 00001101 0000xxxx xxxxxxxx internal data move */ - WRITE_REG(adsp, (op >> 10) & 3, (op >> 4) & 15, READ_REG(adsp, (op >> 8) & 3, op & 15)); - break; - case 0x0e: - /* 00001110 0xxxxxxx xxxxxxxx conditional shift */ - if (CONDITION(adsp, op & 15)) shift_op(adsp, op); - break; - case 0x0f: - /* 00001111 0xxxxxxx xxxxxxxx shift immediate */ - shift_op_imm(adsp, op); - break; - case 0x10: - /* 00010000 0xxxxxxx xxxxxxxx shift with internal data register move */ - shift_op(adsp, op); - temp = READ_REG(adsp, 0, op & 15); - WRITE_REG(adsp, 0, (op >> 4) & 15, temp); - break; - case 0x11: - /* 00010001 xxxxxxxx xxxxxxxx shift with pgm memory read/write */ - if (op & 0x8000) - { - pgm_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - shift_op(adsp, op); - } - else - { - shift_op(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, pgm_read_dag2(adsp, op)); - } - break; - case 0x12: - /* 00010010 xxxxxxxx xxxxxxxx shift with data memory read/write DAG1 */ - if (op & 0x8000) - { - data_write_dag1(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - shift_op(adsp, op); - } - else - { - shift_op(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag1(adsp, op)); - } - break; - case 0x13: - /* 00010011 xxxxxxxx xxxxxxxx shift with data memory read/write DAG2 */ - if (op & 0x8000) - { - data_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - shift_op(adsp, op); - } - else - { - shift_op(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag2(adsp, op)); - } - break; - case 0x14: case 0x15: case 0x16: case 0x17: - /* 000101xx xxxxxxxx xxxxxxxx do until */ - loop_stack_push(adsp, op & 0x3ffff); - pc_stack_push(adsp); - break; - case 0x18: case 0x19: case 0x1a: case 0x1b: - /* 000110xx xxxxxxxx xxxxxxxx conditional jump (immediate addr) */ - if (CONDITION(adsp, op & 15)) - { - adsp->pc = (op >> 4) & 0x3fff; - /* check for a busy loop */ - if (adsp->pc == adsp->ppc) - adsp->icount = 0; - } - break; - case 0x1c: case 0x1d: case 0x1e: case 0x1f: - /* 000111xx xxxxxxxx xxxxxxxx conditional call (immediate addr) */ - if (CONDITION(adsp, op & 15)) - { - pc_stack_push(adsp); - adsp->pc = (op >> 4) & 0x3fff; - } - break; - case 0x20: case 0x21: - /* 0010000x xxxxxxxx xxxxxxxx conditional MAC to MR */ - if (CONDITION(adsp, op & 15)) - { - if (adsp->chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x0018f0) == 0x000010) - mac_op_mr_xop(adsp, op); - else - mac_op_mr(adsp, op); - } - break; - case 0x22: case 0x23: - /* 0010001x xxxxxxxx xxxxxxxx conditional ALU to AR */ - if (CONDITION(adsp, op & 15)) - { - if (adsp->chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x000010) == 0x000010) - alu_op_ar_const(adsp, op); - else - alu_op_ar(adsp, op); - } - break; - case 0x24: case 0x25: - /* 0010010x xxxxxxxx xxxxxxxx conditional MAC to MF */ - if (CONDITION(adsp, op & 15)) - { - if (adsp->chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x0018f0) == 0x000010) - mac_op_mf_xop(adsp, op); - else - mac_op_mf(adsp, op); - } - break; - case 0x26: case 0x27: - /* 0010011x xxxxxxxx xxxxxxxx conditional ALU to AF */ - if (CONDITION(adsp, op & 15)) - { - if (adsp->chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x000010) == 0x000010) - alu_op_af_const(adsp, op); - else - alu_op_af(adsp, op); - } - break; - case 0x28: case 0x29: - /* 0010100x xxxxxxxx xxxxxxxx MAC to MR with internal data register move */ - temp = READ_REG(adsp, 0, op & 15); - mac_op_mr(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, temp); - break; - case 0x2a: case 0x2b: - /* 0010101x xxxxxxxx xxxxxxxx ALU to AR with internal data register move */ - if (adsp->chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x0000ff) == 0x0000aa) - alu_op_none(adsp, op); - else - { - temp = READ_REG(adsp, 0, op & 15); - alu_op_ar(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, temp); - } - break; - case 0x2c: case 0x2d: - /* 0010110x xxxxxxxx xxxxxxxx MAC to MF with internal data register move */ - temp = READ_REG(adsp, 0, op & 15); - mac_op_mf(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, temp); - break; - case 0x2e: case 0x2f: - /* 0010111x xxxxxxxx xxxxxxxx ALU to AF with internal data register move */ - temp = READ_REG(adsp, 0, op & 15); - alu_op_af(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, temp); - break; - case 0x30: case 0x31: case 0x32: case 0x33: - /* 001100xx xxxxxxxx xxxxxxxx load non-data register immediate (group 0) */ - WRITE_REG(adsp, 0, op & 15, (INT32)(op << 14) >> 18); - break; - case 0x34: case 0x35: case 0x36: case 0x37: - /* 001101xx xxxxxxxx xxxxxxxx load non-data register immediate (group 1) */ - WRITE_REG(adsp, 1, op & 15, (INT32)(op << 14) >> 18); - break; - case 0x38: case 0x39: case 0x3a: case 0x3b: - /* 001110xx xxxxxxxx xxxxxxxx load non-data register immediate (group 2) */ - WRITE_REG(adsp, 2, op & 15, (INT32)(op << 14) >> 18); - break; - case 0x3c: case 0x3d: case 0x3e: case 0x3f: - /* 001111xx xxxxxxxx xxxxxxxx load non-data register immediate (group 3) */ - WRITE_REG(adsp, 3, op & 15, (INT32)(op << 14) >> 18); - break; - case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: - case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: - /* 0100xxxx xxxxxxxx xxxxxxxx load data register immediate */ - WRITE_REG(adsp, 0, op & 15, (op >> 4) & 0xffff); - break; - case 0x50: case 0x51: - /* 0101000x xxxxxxxx xxxxxxxx MAC to MR with pgm memory read */ - mac_op_mr(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, pgm_read_dag2(adsp, op)); - break; - case 0x52: case 0x53: - /* 0101001x xxxxxxxx xxxxxxxx ALU to AR with pgm memory read */ - alu_op_ar(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, pgm_read_dag2(adsp, op)); - break; - case 0x54: case 0x55: - /* 0101010x xxxxxxxx xxxxxxxx MAC to MF with pgm memory read */ - mac_op_mf(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, pgm_read_dag2(adsp, op)); - break; - case 0x56: case 0x57: - /* 0101011x xxxxxxxx xxxxxxxx ALU to AF with pgm memory read */ - alu_op_af(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, pgm_read_dag2(adsp, op)); - break; - case 0x58: case 0x59: - /* 0101100x xxxxxxxx xxxxxxxx MAC to MR with pgm memory write */ - pgm_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - mac_op_mr(adsp, op); - break; - case 0x5a: case 0x5b: - /* 0101101x xxxxxxxx xxxxxxxx ALU to AR with pgm memory write */ - pgm_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - alu_op_ar(adsp, op); - break; - case 0x5c: case 0x5d: - /* 0101110x xxxxxxxx xxxxxxxx ALU to MR with pgm memory write */ - pgm_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - mac_op_mf(adsp, op); - break; - case 0x5e: case 0x5f: - /* 0101111x xxxxxxxx xxxxxxxx ALU to MF with pgm memory write */ - pgm_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - alu_op_af(adsp, op); - break; - case 0x60: case 0x61: - /* 0110000x xxxxxxxx xxxxxxxx MAC to MR with data memory read DAG1 */ - mac_op_mr(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag1(adsp, op)); - break; - case 0x62: case 0x63: - /* 0110001x xxxxxxxx xxxxxxxx ALU to AR with data memory read DAG1 */ - alu_op_ar(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag1(adsp, op)); - break; - case 0x64: case 0x65: - /* 0110010x xxxxxxxx xxxxxxxx MAC to MF with data memory read DAG1 */ - mac_op_mf(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag1(adsp, op)); - break; - case 0x66: case 0x67: - /* 0110011x xxxxxxxx xxxxxxxx ALU to AF with data memory read DAG1 */ - alu_op_af(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag1(adsp, op)); - break; - case 0x68: case 0x69: - /* 0110100x xxxxxxxx xxxxxxxx MAC to MR with data memory write DAG1 */ - data_write_dag1(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - mac_op_mr(adsp, op); - break; - case 0x6a: case 0x6b: - /* 0110101x xxxxxxxx xxxxxxxx ALU to AR with data memory write DAG1 */ - data_write_dag1(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - alu_op_ar(adsp, op); - break; - case 0x6c: case 0x6d: - /* 0111110x xxxxxxxx xxxxxxxx MAC to MF with data memory write DAG1 */ - data_write_dag1(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - mac_op_mf(adsp, op); - break; - case 0x6e: case 0x6f: - /* 0111111x xxxxxxxx xxxxxxxx ALU to AF with data memory write DAG1 */ - data_write_dag1(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - alu_op_af(adsp, op); - break; - case 0x70: case 0x71: - /* 0111000x xxxxxxxx xxxxxxxx MAC to MR with data memory read DAG2 */ - mac_op_mr(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag2(adsp, op)); - break; - case 0x72: case 0x73: - /* 0111001x xxxxxxxx xxxxxxxx ALU to AR with data memory read DAG2 */ - alu_op_ar(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag2(adsp, op)); - break; - case 0x74: case 0x75: - /* 0111010x xxxxxxxx xxxxxxxx MAC to MF with data memory read DAG2 */ - mac_op_mf(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag2(adsp, op)); - break; - case 0x76: case 0x77: - /* 0111011x xxxxxxxx xxxxxxxx ALU to AF with data memory read DAG2 */ - alu_op_af(adsp, op); - WRITE_REG(adsp, 0, (op >> 4) & 15, data_read_dag2(adsp, op)); - break; - case 0x78: case 0x79: - /* 0111100x xxxxxxxx xxxxxxxx MAC to MR with data memory write DAG2 */ - data_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - mac_op_mr(adsp, op); - break; - case 0x7a: case 0x7b: - /* 0111101x xxxxxxxx xxxxxxxx ALU to AR with data memory write DAG2 */ - data_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - alu_op_ar(adsp, op); - break; - case 0x7c: case 0x7d: - /* 0111110x xxxxxxxx xxxxxxxx MAC to MF with data memory write DAG2 */ - data_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - mac_op_mf(adsp, op); - break; - case 0x7e: case 0x7f: - /* 0111111x xxxxxxxx xxxxxxxx ALU to AF with data memory write DAG2 */ - data_write_dag2(adsp, op, READ_REG(adsp, 0, (op >> 4) & 15)); - alu_op_af(adsp, op); - break; - case 0x80: case 0x81: case 0x82: case 0x83: - /* 100000xx xxxxxxxx xxxxxxxx read data memory (immediate addr) to reg group 0 */ - WRITE_REG(adsp, 0, op & 15, RWORD_DATA(adsp, (op >> 4) & 0x3fff)); - break; - case 0x84: case 0x85: case 0x86: case 0x87: - /* 100001xx xxxxxxxx xxxxxxxx read data memory (immediate addr) to reg group 1 */ - WRITE_REG(adsp, 1, op & 15, RWORD_DATA(adsp, (op >> 4) & 0x3fff)); - break; - case 0x88: case 0x89: case 0x8a: case 0x8b: - /* 100010xx xxxxxxxx xxxxxxxx read data memory (immediate addr) to reg group 2 */ - WRITE_REG(adsp, 2, op & 15, RWORD_DATA(adsp, (op >> 4) & 0x3fff)); - break; - case 0x8c: case 0x8d: case 0x8e: case 0x8f: - /* 100011xx xxxxxxxx xxxxxxxx read data memory (immediate addr) to reg group 3 */ - WRITE_REG(adsp, 3, op & 15, RWORD_DATA(adsp, (op >> 4) & 0x3fff)); - break; - case 0x90: case 0x91: case 0x92: case 0x93: - /* 1001xxxx xxxxxxxx xxxxxxxx write data memory (immediate addr) from reg group 0 */ - WWORD_DATA(adsp, (op >> 4) & 0x3fff, READ_REG(adsp, 0, op & 15)); - break; - case 0x94: case 0x95: case 0x96: case 0x97: - /* 1001xxxx xxxxxxxx xxxxxxxx write data memory (immediate addr) from reg group 1 */ - WWORD_DATA(adsp, (op >> 4) & 0x3fff, READ_REG(adsp, 1, op & 15)); - break; - case 0x98: case 0x99: case 0x9a: case 0x9b: - /* 1001xxxx xxxxxxxx xxxxxxxx write data memory (immediate addr) from reg group 2 */ - WWORD_DATA(adsp, (op >> 4) & 0x3fff, READ_REG(adsp, 2, op & 15)); - break; - case 0x9c: case 0x9d: case 0x9e: case 0x9f: - /* 1001xxxx xxxxxxxx xxxxxxxx write data memory (immediate addr) from reg group 3 */ - WWORD_DATA(adsp, (op >> 4) & 0x3fff, READ_REG(adsp, 3, op & 15)); - break; - case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: - case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - /* 1010xxxx xxxxxxxx xxxxxxxx data memory write (immediate) DAG1 */ - data_write_dag1(adsp, op, (op >> 4) & 0xffff); - break; - case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: - case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: - /* 1011xxxx xxxxxxxx xxxxxxxx data memory write (immediate) DAG2 */ - data_write_dag2(adsp, op, (op >> 4) & 0xffff); - break; - case 0xc0: case 0xc1: - /* 1100000x xxxxxxxx xxxxxxxx MAC to MR with data read to AX0 & pgm read to AY0 */ - mac_op_mr(adsp, op); - adsp->core.ax0.u = data_read_dag1(adsp, op); - adsp->core.ay0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xc2: case 0xc3: - /* 1100001x xxxxxxxx xxxxxxxx ALU to AR with data read to AX0 & pgm read to AY0 */ - alu_op_ar(adsp, op); - adsp->core.ax0.u = data_read_dag1(adsp, op); - adsp->core.ay0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xc4: case 0xc5: - /* 1100010x xxxxxxxx xxxxxxxx MAC to MR with data read to AX1 & pgm read to AY0 */ - mac_op_mr(adsp, op); - adsp->core.ax1.u = data_read_dag1(adsp, op); - adsp->core.ay0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xc6: case 0xc7: - /* 1100011x xxxxxxxx xxxxxxxx ALU to AR with data read to AX1 & pgm read to AY0 */ - alu_op_ar(adsp, op); - adsp->core.ax1.u = data_read_dag1(adsp, op); - adsp->core.ay0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xc8: case 0xc9: - /* 1100100x xxxxxxxx xxxxxxxx MAC to MR with data read to MX0 & pgm read to AY0 */ - mac_op_mr(adsp, op); - adsp->core.mx0.u = data_read_dag1(adsp, op); - adsp->core.ay0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xca: case 0xcb: - /* 1100101x xxxxxxxx xxxxxxxx ALU to AR with data read to MX0 & pgm read to AY0 */ - alu_op_ar(adsp, op); - adsp->core.mx0.u = data_read_dag1(adsp, op); - adsp->core.ay0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xcc: case 0xcd: - /* 1100110x xxxxxxxx xxxxxxxx MAC to MR with data read to MX1 & pgm read to AY0 */ - mac_op_mr(adsp, op); - adsp->core.mx1.u = data_read_dag1(adsp, op); - adsp->core.ay0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xce: case 0xcf: - /* 1100111x xxxxxxxx xxxxxxxx ALU to AR with data read to MX1 & pgm read to AY0 */ - alu_op_ar(adsp, op); - adsp->core.mx1.u = data_read_dag1(adsp, op); - adsp->core.ay0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xd0: case 0xd1: - /* 1101000x xxxxxxxx xxxxxxxx MAC to MR with data read to AX0 & pgm read to AY1 */ - mac_op_mr(adsp, op); - adsp->core.ax0.u = data_read_dag1(adsp, op); - adsp->core.ay1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xd2: case 0xd3: - /* 1101001x xxxxxxxx xxxxxxxx ALU to AR with data read to AX0 & pgm read to AY1 */ - alu_op_ar(adsp, op); - adsp->core.ax0.u = data_read_dag1(adsp, op); - adsp->core.ay1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xd4: case 0xd5: - /* 1101010x xxxxxxxx xxxxxxxx MAC to MR with data read to AX1 & pgm read to AY1 */ - mac_op_mr(adsp, op); - adsp->core.ax1.u = data_read_dag1(adsp, op); - adsp->core.ay1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xd6: case 0xd7: - /* 1101011x xxxxxxxx xxxxxxxx ALU to AR with data read to AX1 & pgm read to AY1 */ - alu_op_ar(adsp, op); - adsp->core.ax1.u = data_read_dag1(adsp, op); - adsp->core.ay1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xd8: case 0xd9: - /* 1101100x xxxxxxxx xxxxxxxx MAC to MR with data read to MX0 & pgm read to AY1 */ - mac_op_mr(adsp, op); - adsp->core.mx0.u = data_read_dag1(adsp, op); - adsp->core.ay1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xda: case 0xdb: - /* 1101101x xxxxxxxx xxxxxxxx ALU to AR with data read to MX0 & pgm read to AY1 */ - alu_op_ar(adsp, op); - adsp->core.mx0.u = data_read_dag1(adsp, op); - adsp->core.ay1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xdc: case 0xdd: - /* 1101110x xxxxxxxx xxxxxxxx MAC to MR with data read to MX1 & pgm read to AY1 */ - mac_op_mr(adsp, op); - adsp->core.mx1.u = data_read_dag1(adsp, op); - adsp->core.ay1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xde: case 0xdf: - /* 1101111x xxxxxxxx xxxxxxxx ALU to AR with data read to MX1 & pgm read to AY1 */ - alu_op_ar(adsp, op); - adsp->core.mx1.u = data_read_dag1(adsp, op); - adsp->core.ay1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xe0: case 0xe1: - /* 1110000x xxxxxxxx xxxxxxxx MAC to MR with data read to AX0 & pgm read to MY0 */ - mac_op_mr(adsp, op); - adsp->core.ax0.u = data_read_dag1(adsp, op); - adsp->core.my0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xe2: case 0xe3: - /* 1110001x xxxxxxxx xxxxxxxx ALU to AR with data read to AX0 & pgm read to MY0 */ - alu_op_ar(adsp, op); - adsp->core.ax0.u = data_read_dag1(adsp, op); - adsp->core.my0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xe4: case 0xe5: - /* 1110010x xxxxxxxx xxxxxxxx MAC to MR with data read to AX1 & pgm read to MY0 */ - mac_op_mr(adsp, op); - adsp->core.ax1.u = data_read_dag1(adsp, op); - adsp->core.my0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xe6: case 0xe7: - /* 1110011x xxxxxxxx xxxxxxxx ALU to AR with data read to AX1 & pgm read to MY0 */ - alu_op_ar(adsp, op); - adsp->core.ax1.u = data_read_dag1(adsp, op); - adsp->core.my0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xe8: case 0xe9: - /* 1110100x xxxxxxxx xxxxxxxx MAC to MR with data read to MX0 & pgm read to MY0 */ - mac_op_mr(adsp, op); - adsp->core.mx0.u = data_read_dag1(adsp, op); - adsp->core.my0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xea: case 0xeb: - /* 1110101x xxxxxxxx xxxxxxxx ALU to AR with data read to MX0 & pgm read to MY0 */ - alu_op_ar(adsp, op); - adsp->core.mx0.u = data_read_dag1(adsp, op); - adsp->core.my0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xec: case 0xed: - /* 1110110x xxxxxxxx xxxxxxxx MAC to MR with data read to MX1 & pgm read to MY0 */ - mac_op_mr(adsp, op); - adsp->core.mx1.u = data_read_dag1(adsp, op); - adsp->core.my0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xee: case 0xef: - /* 1110111x xxxxxxxx xxxxxxxx ALU to AR with data read to MX1 & pgm read to MY0 */ - alu_op_ar(adsp, op); - adsp->core.mx1.u = data_read_dag1(adsp, op); - adsp->core.my0.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xf0: case 0xf1: - /* 1111000x xxxxxxxx xxxxxxxx MAC to MR with data read to AX0 & pgm read to MY1 */ - mac_op_mr(adsp, op); - adsp->core.ax0.u = data_read_dag1(adsp, op); - adsp->core.my1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xf2: case 0xf3: - /* 1111001x xxxxxxxx xxxxxxxx ALU to AR with data read to AX0 & pgm read to MY1 */ - alu_op_ar(adsp, op); - adsp->core.ax0.u = data_read_dag1(adsp, op); - adsp->core.my1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xf4: case 0xf5: - /* 1111010x xxxxxxxx xxxxxxxx MAC to MR with data read to AX1 & pgm read to MY1 */ - mac_op_mr(adsp, op); - adsp->core.ax1.u = data_read_dag1(adsp, op); - adsp->core.my1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xf6: case 0xf7: - /* 1111011x xxxxxxxx xxxxxxxx ALU to AR with data read to AX1 & pgm read to MY1 */ - alu_op_ar(adsp, op); - adsp->core.ax1.u = data_read_dag1(adsp, op); - adsp->core.my1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xf8: case 0xf9: - /* 1111100x xxxxxxxx xxxxxxxx MAC to MR with data read to MX0 & pgm read to MY1 */ - mac_op_mr(adsp, op); - adsp->core.mx0.u = data_read_dag1(adsp, op); - adsp->core.my1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xfa: case 0xfb: - /* 1111101x xxxxxxxx xxxxxxxx ALU to AR with data read to MX0 & pgm read to MY1 */ - alu_op_ar(adsp, op); - adsp->core.mx0.u = data_read_dag1(adsp, op); - adsp->core.my1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xfc: case 0xfd: - /* 1111110x xxxxxxxx xxxxxxxx MAC to MR with data read to MX1 & pgm read to MY1 */ - mac_op_mr(adsp, op); - adsp->core.mx1.u = data_read_dag1(adsp, op); - adsp->core.my1.u = pgm_read_dag2(adsp, op >> 4); - break; - case 0xfe: case 0xff: - /* 1111111x xxxxxxxx xxxxxxxx ALU to AR with data read to MX1 & pgm read to MY1 */ - alu_op_ar(adsp, op); - adsp->core.mx1.u = data_read_dag1(adsp, op); - adsp->core.my1.u = pgm_read_dag2(adsp, op >> 4); - break; - } - - adsp->icount--; - } while (adsp->icount > 0); - - return cycles - adsp->icount; -} - - - -/*************************************************************************** - DEBUGGER DEFINITIONS -***************************************************************************/ - -//extern CPU_DISASSEMBLE( adsp21xx ); - - - -/*************************************************************************** - STATE HANDLING CALLBACKS -***************************************************************************/ - -#if 0 -static CPU_IMPORT_STATE( adsp21xx ) -{ - adsp2100_state *adsp = get_safe_token(device); - switch (entry->index) - { - case ADSP2100_MSTAT: - update_mstat(adsp); - break; - - case ADSP2100_IMASK: - case ADSP2100_ICNTL: - case ADSP2100_IRQSTATE0: - case ADSP2100_IRQSTATE1: - case ADSP2100_IRQSTATE2: - case ADSP2100_IRQSTATE3: - check_irqs(adsp); - break; - - case ADSP2100_I0: - case ADSP2100_I1: - case ADSP2100_I2: - case ADSP2100_I3: - case ADSP2100_I4: - case ADSP2100_I5: - case ADSP2100_I6: - case ADSP2100_I7: - update_i(adsp, entry->index - ADSP2100_I0); - break; - - case ADSP2100_L0: - case ADSP2100_L1: - case ADSP2100_L2: - case ADSP2100_L3: - case ADSP2100_L4: - case ADSP2100_L5: - case ADSP2100_L6: - case ADSP2100_L7: - update_l(adsp, entry->index - ADSP2100_L0); - break; - - default: - fatalerror("CPU_IMPORT_STATE(adsp21xx) called for unexpected value\n"); - break; - } -} - - - -/************************************************************************** - * Generic set_info - **************************************************************************/ -static CPU_SET_INFO( adsp21xx ) -static void adsp21xx_set_info(UINT32 state, void *value) -{ - adsp2100_state *adsp = get_safe_token(device); - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + 0: - case CPUINFO_INT_INPUT_STATE + 1: - case CPUINFO_INT_INPUT_STATE + 2: - case CPUINFO_INT_INPUT_STATE + 3: - case CPUINFO_INT_INPUT_STATE + 4: - case CPUINFO_INT_INPUT_STATE + 5: - case CPUINFO_INT_INPUT_STATE + 6: - case CPUINFO_INT_INPUT_STATE + 7: - case CPUINFO_INT_INPUT_STATE + 8: - case CPUINFO_INT_INPUT_STATE + 9: - set_irq_line(adsp, state - CPUINFO_INT_INPUT_STATE, info->i); - break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -static CPU_GET_INFO( adsp21xx ) -{ - adsp2100_state *adsp = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL; - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(adsp2100_state); break; - case CPUINFO_INT_INPUT_LINES: /* set per CPU */ break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case DEVINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 4; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; - - case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; - case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 14; break; - case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -2; break; - case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 14; break; - case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = -1; break; - - case CPUINFO_INT_INPUT_STATE + 0: - case CPUINFO_INT_INPUT_STATE + 1: - case CPUINFO_INT_INPUT_STATE + 2: - case CPUINFO_INT_INPUT_STATE + 3: - case CPUINFO_INT_INPUT_STATE + 4: - case CPUINFO_INT_INPUT_STATE + 5: - case CPUINFO_INT_INPUT_STATE + 6: - case CPUINFO_INT_INPUT_STATE + 7: - case CPUINFO_INT_INPUT_STATE + 8: - case CPUINFO_INT_INPUT_STATE + 9: - info->i = adsp->irq_state[state - CPUINFO_INT_INPUT_STATE]; - break; - - /* --- the following bits of info are returned as pointers to functions --- */ - case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp21xx); break; - case CPUINFO_FCT_INIT: /* set per CPU */ break; - case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(adsp21xx); break; - case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(adsp21xx); break; - case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(adsp21xx); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(adsp21xx); break; - case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(adsp21xx); break; - - /* --- the following bits of info are returned as pointers --- */ - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &adsp->icount; break; - case CPUINFO_PTR_STATE_TABLE: info->state_table = &adsp->state; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: /* set per CPU */ break; - case DEVINFO_STR_FAMILY: strcpy(info->s, "ADSP21xx"); break; - case DEVINFO_STR_VERSION: strcpy(info->s, "2.0"); break; - case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; - case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Aaron Giles"); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c%c%c%c%c%c%c%c", - adsp->astat & 0x80 ? 'X':'.', - adsp->astat & 0x40 ? 'M':'.', - adsp->astat & 0x20 ? 'Q':'.', - adsp->astat & 0x10 ? 'S':'.', - adsp->astat & 0x08 ? 'C':'.', - adsp->astat & 0x04 ? 'V':'.', - adsp->astat & 0x02 ? 'N':'.', - adsp->astat & 0x01 ? 'Z':'.'); - break; - } -} -#endif - -static void adsp21xx_load_boot_data(UINT8 *srcdata, UINT32 *dstdata) -{ - /* see how many words we need to copy */ - int pagelen = (srcdata[(3)] + 1) * 8; - int i; - for (i = 0; i < pagelen; i++) - { - UINT32 opcode = (srcdata[(i*4+0)] << 16) | (srcdata[(i*4+1)] << 8) | srcdata[(i*4+2)]; - dstdata[i] = opcode; - } -} - - -/************************************************************************** - * ADSP2100 section - **************************************************************************/ - -//static CPU_INIT( adsp2100 ) -void adsp2100_init(adsp2100_state *adsp, cpu_irq_callback irqcallback) -{ - adsp21xx_init(adsp, irqcallback, CHIP_TYPE_ADSP2100); - adsp->mstat_mask = 0x0f; - adsp->imask_mask = 0x0f; -} - -#if 0 -CPU_GET_INFO( adsp2100 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_LINES: info->i = 4; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2100); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "ADSP2100"); break; - - default: - CPU_GET_INFO_CALL(adsp21xx); - break; - } -} -#endif -/************************************************************************** - * ADSP2101 section - **************************************************************************/ - -//static CPU_INIT( adsp2101 ) -void adsp2101_init(adsp2100_state *adsp, cpu_irq_callback irqcallback) -{ - adsp21xx_init(adsp, irqcallback, CHIP_TYPE_ADSP2101); - adsp->mstat_mask = 0x7f; - adsp->imask_mask = 0x3f; -} - -#if 0 -CPU_GET_INFO( adsp2101 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_LINES: info->i = 5; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2101); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "ADSP2101"); break; - - default: - CPU_GET_INFO_CALL(adsp21xx); - break; - } -} -#endif - -/************************************************************************** - * ADSP2104 section - **************************************************************************/ - -//static CPU_INIT( adsp2104 ) -void adsp2104_init(adsp2100_state *adsp, cpu_irq_callback irqcallback) -{ - adsp21xx_init(adsp, irqcallback, CHIP_TYPE_ADSP2104); - adsp->mstat_mask = 0x7f; - adsp->imask_mask = 0x3f; -} - -void adsp2104_load_boot_data(UINT8 *srcdata, UINT32 *dstdata) -{ - adsp21xx_load_boot_data(srcdata, dstdata); -} - -#if 0 -CPU_GET_INFO( adsp2104 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_LINES: info->i = 6; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2104); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "ADSP2104"); break; - - default: - CPU_GET_INFO_CALL(adsp21xx); - break; - } -} - -#endif - -/************************************************************************** - * ADSP2105 section - **************************************************************************/ - -//static CPU_INIT( adsp2105 ) -void adsp2105_init(adsp2100_state *adsp, cpu_irq_callback irqcallback) -{ - adsp21xx_init(adsp, irqcallback, CHIP_TYPE_ADSP2105); - adsp->mstat_mask = 0x7f; - adsp->imask_mask = 0x3f; -} - -void adsp2105_load_boot_data(UINT8 *srcdata, UINT32 *dstdata) -{ - adsp21xx_load_boot_data(srcdata, dstdata); -} - -#if 0 -CPU_GET_INFO( adsp2105 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_LINES: info->i = 3; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2105); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "ADSP2105"); break; - - default: - CPU_GET_INFO_CALL(adsp21xx); - break; - } -} - -#endif - -/************************************************************************** - * ADSP2115 section - **************************************************************************/ - -//static CPU_INIT( adsp2115 ) -void adsp2115_init(adsp2100_state *adsp, cpu_irq_callback irqcallback) -{ - adsp21xx_init(adsp, irqcallback, CHIP_TYPE_ADSP2115); - adsp->mstat_mask = 0x7f; - adsp->imask_mask = 0x3f; -} - -void adsp2115_load_boot_data(UINT8 *srcdata, UINT32 *dstdata) -{ - adsp21xx_load_boot_data(srcdata, dstdata); -} - -#if 0 -CPU_GET_INFO( adsp2115 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_LINES: info->i = 6; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2115); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "ADSP2115"); break; - - default: - CPU_GET_INFO_CALL(adsp21xx); - break; - } -} -#endif - -/************************************************************************** - * ADSP2181 section - **************************************************************************/ - -//static CPU_INIT( adsp2181 ) -void adsp2181_init(adsp2100_state *adsp, cpu_irq_callback irqcallback) -{ - adsp21xx_init(adsp, irqcallback, CHIP_TYPE_ADSP2181); - adsp->mstat_mask = 0x7f; - adsp->imask_mask = 0x3ff; -} - -void adsp2181_load_boot_data(UINT8 *srcdata, UINT32 *dstdata) -{ - adsp21xx_load_boot_data(srcdata, dstdata); -} - -#if 0 -CPU_GET_INFO( adsp2181 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_LINES: info->i = 9; break; - - case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 11; break; - case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = -1; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2181); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "ADSP2181"); break; - - default: - CPU_GET_INFO_CALL(adsp21xx); - break; - } -} -#endif - -void adsp2181_idma_addr_w(adsp2100_state *adsp, UINT16 data) -{ -// adsp2100_state *adsp = get_safe_token(device); - adsp->idma_addr = data; - adsp->idma_offs = 0; -} - -UINT16 adsp2181_idma_addr_r(adsp2100_state *adsp) -{ -// adsp2100_state *adsp = get_safe_token(device); - return adsp->idma_addr; -} - -void adsp2181_idma_data_w(adsp2100_state *adsp, UINT16 data) -{ -// adsp2100_state *adsp = get_safe_token(device); - - /* program memory? */ - if (!(adsp->idma_addr & 0x4000)) - { - /* upper 16 bits */ - if (adsp->idma_offs == 0) - { - adsp->idma_cache = data; - adsp->idma_offs = 1; - } - - /* lower 8 bits */ - else - { - WWORD_PGM(adsp, adsp->idma_addr++ & 0x3fff, (adsp->idma_cache << 8) | (data & 0xff)); - adsp->idma_offs = 0; - } - } - - /* data memory */ - else - WWORD_DATA(adsp, adsp->idma_addr++ & 0x3fff, data); -} - -UINT16 adsp2181_idma_data_r(adsp2100_state *adsp) -{ - UINT16 result = 0xffff; - - /* program memory? */ - if (!(adsp->idma_addr & 0x4000)) - { - /* upper 16 bits */ - if (adsp->idma_offs == 0) - { - result = RWORD_PGM(adsp, adsp->idma_addr & 0x3fff) >> 8; - adsp->idma_offs = 1; - } - - /* lower 8 bits */ - else - { - result = RWORD_PGM(adsp, adsp->idma_addr++ & 0x3fff) & 0xff; - adsp->idma_offs = 0; - } - } - - /* data memory */ - else - result = RWORD_DATA(adsp, adsp->idma_addr++ & 0x3fff); - - return result; -} diff --git a/jan/src/cpu/adsp2100/adsp2100.h b/jan/src/cpu/adsp2100/adsp2100.h deleted file mode 100644 index e1d394296..000000000 --- a/jan/src/cpu/adsp2100/adsp2100.h +++ /dev/null @@ -1,164 +0,0 @@ -/*************************************************************************** - - ADSP2100.h - Interface file for the portable Analog ADSP-2100 emulator. - Written by Aaron Giles - -***************************************************************************/ - -#pragma once - -#ifndef __ADSP2100_H__ -#define __ADSP2100_H__ - -#include "cpuintrf.h" -#include "adsp2100_defs.h" - -/*************************************************************************** - REGISTER ENUMERATION -***************************************************************************/ - -enum -{ - ADSP2100_PC, - ADSP2100_AX0, ADSP2100_AX1, ADSP2100_AY0, ADSP2100_AY1, ADSP2100_AR, ADSP2100_AF, - ADSP2100_MX0, ADSP2100_MX1, ADSP2100_MY0, ADSP2100_MY1, ADSP2100_MR0, ADSP2100_MR1, ADSP2100_MR2, ADSP2100_MF, - ADSP2100_SI, ADSP2100_SE, ADSP2100_SB, ADSP2100_SR0, ADSP2100_SR1, - ADSP2100_I0, ADSP2100_I1, ADSP2100_I2, ADSP2100_I3, ADSP2100_I4, ADSP2100_I5, ADSP2100_I6, ADSP2100_I7, - ADSP2100_L0, ADSP2100_L1, ADSP2100_L2, ADSP2100_L3, ADSP2100_L4, ADSP2100_L5, ADSP2100_L6, ADSP2100_L7, - ADSP2100_M0, ADSP2100_M1, ADSP2100_M2, ADSP2100_M3, ADSP2100_M4, ADSP2100_M5, ADSP2100_M6, ADSP2100_M7, - ADSP2100_PX, ADSP2100_CNTR, ADSP2100_ASTAT, ADSP2100_SSTAT, ADSP2100_MSTAT, - ADSP2100_PCSP, ADSP2100_CNTRSP, ADSP2100_STATSP, ADSP2100_LOOPSP, - ADSP2100_IMASK, ADSP2100_ICNTL, ADSP2100_IRQSTATE0, ADSP2100_IRQSTATE1, ADSP2100_IRQSTATE2, ADSP2100_IRQSTATE3, - ADSP2100_FLAGIN, ADSP2100_FLAGOUT, ADSP2100_FL0, ADSP2100_FL1, ADSP2100_FL2, - ADSP2100_AX0_SEC, ADSP2100_AX1_SEC, ADSP2100_AY0_SEC, ADSP2100_AY1_SEC, ADSP2100_AR_SEC, ADSP2100_AF_SEC, - ADSP2100_MX0_SEC, ADSP2100_MX1_SEC, ADSP2100_MY0_SEC, ADSP2100_MY1_SEC, ADSP2100_MR0_SEC, ADSP2100_MR1_SEC, ADSP2100_MR2_SEC, ADSP2100_MF_SEC, - ADSP2100_SI_SEC, ADSP2100_SE_SEC, ADSP2100_SB_SEC, ADSP2100_SR0_SEC, ADSP2100_SR1_SEC, - - ADSP2100_GENPC = REG_GENPC, - ADSP2100_GENSP = REG_GENSP, - ADSP2100_GENPCBASE = REG_GENPCBASE -}; - -void adsp21xx_reset(adsp2100_state *adsp); -void adsp21xx_exit(adsp2100_state *adsp); -int adsp21xx_execute(adsp2100_state *adsp, int cycles); -void adsp21xx_set_irq_line(adsp2100_state *adsp, int irqline, int state); - -/*************************************************************************** - PUBLIC FUNCTIONS -***************************************************************************/ - -#define ADSP2100_IRQ0 0 /* IRQ0 */ -#define ADSP2100_SPORT1_RX 0 /* SPORT1 receive IRQ */ -#define ADSP2100_IRQ1 1 /* IRQ1 */ -#define ADSP2100_SPORT1_TX 1 /* SPORT1 transmit IRQ */ -#define ADSP2100_IRQ2 2 /* IRQ2 */ -#define ADSP2100_IRQ3 3 /* IRQ3 */ - -//CPU_GET_INFO( adsp2100 ); -//#define CPU_ADSP2100 CPU_GET_INFO_NAME( adsp2100 ) -void adsp2100_init(adsp2100_state *adsp, cpu_irq_callback irqcallback); - -/************************************************************************** - * ADSP2101 section - **************************************************************************/ - -#define ADSP2101_IRQ0 0 /* IRQ0 */ -#define ADSP2101_SPORT1_RX 0 /* SPORT1 receive IRQ */ -#define ADSP2101_IRQ1 1 /* IRQ1 */ -#define ADSP2101_SPORT1_TX 1 /* SPORT1 transmit IRQ */ -#define ADSP2101_IRQ2 2 /* IRQ2 */ -#define ADSP2101_SPORT0_RX 3 /* SPORT0 receive IRQ */ -#define ADSP2101_SPORT0_TX 4 /* SPORT0 transmit IRQ */ -#define ADSP2101_TIMER 5 /* internal timer IRQ */ - -//CPU_GET_INFO( adsp2101 ); -//#define CPU_ADSP2101 CPU_GET_INFO_NAME( adsp2101 ) -void adsp2104_init(adsp2100_state *adsp, cpu_irq_callback irqcallback); - -/************************************************************************** - * ADSP2104 section - **************************************************************************/ - -#define ADSP2104_IRQ0 0 /* IRQ0 */ -#define ADSP2104_SPORT1_RX 0 /* SPORT1 receive IRQ */ -#define ADSP2104_IRQ1 1 /* IRQ1 */ -#define ADSP2104_SPORT1_TX 1 /* SPORT1 transmit IRQ */ -#define ADSP2104_IRQ2 2 /* IRQ2 */ -#define ADSP2104_SPORT0_RX 3 /* SPORT0 receive IRQ */ -#define ADSP2104_SPORT0_TX 4 /* SPORT0 transmit IRQ */ -#define ADSP2104_TIMER 5 /* internal timer IRQ */ - -//CPU_GET_INFO( adsp2104 ); -//#define CPU_ADSP2104 CPU_GET_INFO_NAME( adsp2104 ) - -void adsp2104_init(adsp2100_state *adsp, cpu_irq_callback irqcallback); -void adsp2104_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); - - -/************************************************************************** - * ADSP2105 section - **************************************************************************/ - -#define ADSP2105_IRQ0 0 /* IRQ0 */ -#define ADSP2105_SPORT1_RX 0 /* SPORT1 receive IRQ */ -#define ADSP2105_IRQ1 1 /* IRQ1 */ -#define ADSP2105_SPORT1_TX 1 /* SPORT1 transmit IRQ */ -#define ADSP2105_IRQ2 2 /* IRQ2 */ -#define ADSP2105_TIMER 5 /* internal timer IRQ */ - -//CPU_GET_INFO( adsp2105 ); -//#define CPU_ADSP2105 CPU_GET_INFO_NAME( adsp2105 ) - -void adsp2105_init(adsp2100_state *adsp, cpu_irq_callback irqcallback); -void adsp2105_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); - - -/************************************************************************** - * ADSP2115 section - **************************************************************************/ - -#define ADSP2115_IRQ0 0 /* IRQ0 */ -#define ADSP2115_SPORT1_RX 0 /* SPORT1 receive IRQ */ -#define ADSP2115_IRQ1 1 /* IRQ1 */ -#define ADSP2115_SPORT1_TX 1 /* SPORT1 transmit IRQ */ -#define ADSP2115_IRQ2 2 /* IRQ2 */ -#define ADSP2115_SPORT0_RX 3 /* SPORT0 receive IRQ */ -#define ADSP2115_SPORT0_TX 4 /* SPORT0 transmit IRQ */ -#define ADSP2115_TIMER 5 /* internal timer IRQ */ - -//CPU_GET_INFO( adsp2115 ); -//#define CPU_ADSP2115 CPU_GET_INFO_NAME( adsp2115 ) - -void adsp2115_init(adsp2100_state *adsp, cpu_irq_callback irqcallback); -void adsp2115_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); - - -/************************************************************************** - * ADSP2181 section - **************************************************************************/ - -#define ADSP2181_IRQ0 0 /* IRQ0 */ -#define ADSP2181_SPORT1_RX 0 /* SPORT1 receive IRQ */ -#define ADSP2181_IRQ1 1 /* IRQ1 */ -#define ADSP2181_SPORT1_TX 1 /* SPORT1 transmit IRQ */ -#define ADSP2181_IRQ2 2 /* IRQ2 */ -#define ADSP2181_SPORT0_RX 3 /* SPORT0 receive IRQ */ -#define ADSP2181_SPORT0_TX 4 /* SPORT0 transmit IRQ */ -#define ADSP2181_TIMER 5 /* internal timer IRQ */ -#define ADSP2181_IRQE 6 /* IRQE */ -#define ADSP2181_IRQL1 7 /* IRQL1 */ -#define ADSP2181_IRQL2 8 /* IRQL2 */ - -//CPU_GET_INFO( adsp2181 ); -//#define CPU_ADSP2181 CPU_GET_INFO_NAME( adsp2181 ) -void adsp2181_init(adsp2100_state *adsp, cpu_irq_callback irqcallback); -void adsp2181_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); -void adsp2181_idma_addr_w(adsp2100_state *adsp, UINT16 data); -UINT16 adsp2181_idma_addr_r(adsp2100_state *adsp); -void adsp2181_idma_data_w(adsp2100_state *adsp, UINT16 data); -UINT16 adsp2181_idma_data_r(adsp2100_state *adsp); - - -#endif /* __ADSP2100_H__ */ diff --git a/jan/src/cpu/adsp2100/adsp2100_defs.h b/jan/src/cpu/adsp2100/adsp2100_defs.h deleted file mode 100644 index f91788485..000000000 --- a/jan/src/cpu/adsp2100/adsp2100_defs.h +++ /dev/null @@ -1,198 +0,0 @@ -#ifndef ADSP2100_DEFS -#define ADSP2100_DEFS - -#include "burnint.h" -#include "cpuintrf.h" - -/*************************************************************************** - CONSTANTS -***************************************************************************/ - -#define TRACK_HOTSPOTS 0 - -/* stack depths */ -#define PC_STACK_DEPTH 16 -#define CNTR_STACK_DEPTH 4 -#define STAT_STACK_DEPTH 4 -#define LOOP_STACK_DEPTH 4 - -/* chip types */ -#define CHIP_TYPE_ADSP2100 0 -#define CHIP_TYPE_ADSP2101 1 -#define CHIP_TYPE_ADSP2104 2 -#define CHIP_TYPE_ADSP2105 3 -#define CHIP_TYPE_ADSP2115 4 -#define CHIP_TYPE_ADSP2181 5 - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -struct ADSP2100STATE; - -/* transmit and receive data callbacks types */ -typedef INT32 (*adsp21xx_rx_func)(ADSP2100STATE *adsp, int port); -typedef void (*adsp21xx_tx_func)(ADSP2100STATE *adsp, int port, INT32 data); -typedef void (*adsp21xx_timer_func)(ADSP2100STATE *adsp, int enable); - -typedef struct _adsp21xx_config adsp21xx_config; -struct _adsp21xx_config -{ - adsp21xx_rx_func rx; /* callback for serial receive */ - adsp21xx_tx_func tx; /* callback for serial transmit */ - adsp21xx_timer_func timer; /* callback for timer fired */ -}; - - -/*************************************************************************** - STRUCTURES & TYPEDEFS -***************************************************************************/ - -/* 16-bit registers that can be loaded signed or unsigned */ -typedef union -{ - UINT16 u; - INT16 s; -} ADSPREG16; - - -/* the SHIFT result register is 32 bits */ -typedef union -{ -#ifdef LSB_FIRST - struct { ADSPREG16 sr0, sr1; } srx; -#else - struct { ADSPREG16 sr1, sr0; } srx; -#endif - UINT32 sr; -} SHIFTRESULT; - - -/* the MAC result register is 40 bits */ -typedef union -{ -#ifdef LSB_FIRST - struct { ADSPREG16 mr0, mr1, mr2, mrzero; } mrx; - struct { UINT32 mr0, mr1; } mry; -#else - struct { ADSPREG16 mrzero, mr2, mr1, mr0; } mrx; - struct { UINT32 mr1, mr0; } mry; -#endif - UINT64 mr; -} MACRESULT; - -/* there are two banks of "core" registers */ -typedef struct ADSPCORE -{ - /* ALU registers */ - ADSPREG16 ax0, ax1; - ADSPREG16 ay0, ay1; - ADSPREG16 ar; - ADSPREG16 af; - - /* MAC registers */ - ADSPREG16 mx0, mx1; - ADSPREG16 my0, my1; - MACRESULT mr; - ADSPREG16 mf; - - /* SHIFT registers */ - ADSPREG16 si; - ADSPREG16 se; - ADSPREG16 sb; - SHIFTRESULT sr; - - /* dummy registers */ - ADSPREG16 zero; -} ADSPCORE; - - -/* ADSP-2100 Registers */ -typedef struct ADSP2100STATE -{ - /* Core registers, 2 banks */ - ADSPCORE core; - ADSPCORE alt; - - /* Memory addressing registers */ - UINT32 i[8]; - INT32 m[8]; - UINT32 l[8]; - UINT32 lmask[8]; - UINT32 base[8]; - UINT8 px; - - /* other CPU registers */ - UINT32 pc; - UINT32 ppc; - UINT32 loop; - UINT32 loop_condition; - UINT32 cntr; - - /* status registers */ - UINT32 astat; - UINT32 sstat; - UINT32 mstat; - UINT32 mstat_prev; - UINT32 astat_clear; - UINT32 idle; - - /* stacks */ - UINT32 loop_stack[LOOP_STACK_DEPTH]; - UINT32 cntr_stack[CNTR_STACK_DEPTH]; - UINT32 pc_stack[PC_STACK_DEPTH]; - UINT16 stat_stack[STAT_STACK_DEPTH][3]; - INT32 pc_sp; - INT32 cntr_sp; - INT32 stat_sp; - INT32 loop_sp; - - /* external I/O */ - UINT8 flagout; - UINT8 flagin; - UINT8 fl0; - UINT8 fl1; - UINT8 fl2; - UINT16 idma_addr; - UINT16 idma_cache; - UINT8 idma_offs; - - /* interrupt handling */ - UINT16 imask; - UINT8 icntl; - UINT16 ifc; - UINT8 irq_state[9]; - UINT8 irq_latch[9]; - cpu_irq_callback irq_callback; - //const device_config *device; - - /* other internal states */ - int icount; - int chip_type; - int mstat_mask; - int imask_mask; - - /* register maps */ - void * alu_xregs[8]; - void * alu_yregs[4]; - void * mac_xregs[8]; - void * mac_yregs[4]; - void * shift_xregs[8]; - - /* other callbacks */ - adsp21xx_rx_func sport_rx_callback; - adsp21xx_tx_func sport_tx_callback; - adsp21xx_timer_func timer_fired; - - /* memory spaces */ -// const address_space *program; -// const address_space *data; -// const address_space *io; -// cpu_state_table state; - -} adsp2100_state; - - - -#endif // ADSP2100_DEFS - diff --git a/jan/src/cpu/adsp2100/cpuintrf.h b/jan/src/cpu/adsp2100/cpuintrf.h deleted file mode 100644 index 818080035..000000000 --- a/jan/src/cpu/adsp2100/cpuintrf.h +++ /dev/null @@ -1,33 +0,0 @@ - -#pragma once - -#include - -#define INLINE inline - -#define logerror(...) -#define fatalerror(...) - - -/* register definitions */ -enum -{ - MAX_REGS = 256, - - REG_GENPCBASE = MAX_REGS - 1, /* generic "base" PC, should point to start of current opcode */ - REG_GENPC = MAX_REGS - 2, /* generic PC, may point within an opcode */ - REG_GENSP = MAX_REGS - 3 /* generic SP, or closest equivalent */ -}; - - -enum { - CLEAR_LINE = 0, /* clear (a fired, held or pulsed) line */ - ASSERT_LINE, /* assert an interrupt immediately */ - HOLD_LINE, /* hold interrupt line until acknowledged */ - PULSE_LINE, /* pulse interrupt line for one instruction */ -}; - - -typedef int (*cpu_irq_callback)(int state); - - diff --git a/jan/src/cpu/adsp2100_intf.cpp b/jan/src/cpu/adsp2100_intf.cpp deleted file mode 100644 index 01e4c25e4..000000000 --- a/jan/src/cpu/adsp2100_intf.cpp +++ /dev/null @@ -1,357 +0,0 @@ -#include "adsp2100/adsp2100.h" -#include "adsp2100_intf.h" - -//#include -#include - -//#define xlog(...) fprintf(stdout, "dcs: " __VA_ARGS__); fflush(stdout) -#define xlog(...) - -#define ENABLE_TRACE 0 - -#define ADDR_BITS 16 -#define PAGE_SIZE 0x100 -#define PAGE_SHIFT 8 -#define PAGE_MASK 0xFF -#define PAGE_COUNT (1 << (ADDR_BITS - PAGE_SHIFT)) -#define PAGE_WADD (PAGE_COUNT) -#define ADSP_MAXHANDLER 10 -#define PFN(x) ((x >> PAGE_SHIFT) & 0xFF) - -struct Adsp2100MemoryMap -{ - UINT8 *PrgMap[PAGE_COUNT * 2]; - UINT8 *DataMap[PAGE_COUNT * 2]; - - pAdsp2100ReadLongHandler prgReadLong[ADSP_MAXHANDLER]; - pAdsp2100WriteLongHandler prgWriteLong[ADSP_MAXHANDLER]; - pAdsp2100ReadWordHandler dataReadWord[ADSP_MAXHANDLER]; - pAdsp2100WriteWordHandler dataWriteWord[ADSP_MAXHANDLER]; -}; - -static Adsp2100MemoryMap *pMemMap; -static adsp2100_state *pADSP; - -static pAdsp2100RxCallback pRxCallback; -static pAdsp2100TxCallback pTxCallback; -static pAdsp2100TimerCallback pTimerCallback; - -#if ENABLE_TRACE -static FILE *pTrace; -#endif - -static unsigned short DefReadWord(unsigned int a) { xlog("DefReadWord %x\n", a); return 0; } -static unsigned int DefReadLong(unsigned int a) { xlog("DefReadLong %x\n", a); return 0; } - -static void DefWriteWord(unsigned int a, unsigned short value) { xlog("DefWriteWord %x - %x\n", a, value); } -static void DefWriteLong(unsigned int a, unsigned int value) { xlog("DefWriteLog %x - %x\n", a, value); } - -static void ResetMemoryMap() -{ - for (int page = 0; page < PAGE_COUNT; page++) { - pMemMap->PrgMap[page] = (unsigned char*) 0; - pMemMap->PrgMap[PAGE_WADD + page] = (unsigned char*) 0; - pMemMap->DataMap[page] = (unsigned char*) 0; - pMemMap->DataMap[PAGE_WADD + page] = (unsigned char*) 0; - - } - - for (int i = 0; i < ADSP_MAXHANDLER; i++) { - pMemMap->prgReadLong[i] = DefReadLong; - pMemMap->prgWriteLong[i] = DefWriteLong; - - pMemMap->dataWriteWord[i] = DefWriteWord; - pMemMap->dataReadWord[i] = DefReadWord; - } -} - -static int RxCallback(adsp2100_state *adsp, int port) -{ - if (pRxCallback) - return pRxCallback(port); - return 0; -} - -static void TxCallback(adsp2100_state *adsp, int port, int data) -{ - if (pTxCallback) - pTxCallback(port, data); -} - -static void TimerCallback(adsp2100_state *adsp, int enable) -{ - if (pTimerCallback) - pTimerCallback(enable); -} - - -int Adsp2100Init() -{ - pMemMap = new Adsp2100MemoryMap; - ResetMemoryMap(); - pADSP = (adsp2100_state*) BurnMalloc(sizeof(adsp2100_state)); - adsp2105_init(pADSP, nullptr); - pADSP->sport_rx_callback = RxCallback; - pADSP->sport_tx_callback = TxCallback; - pADSP->timer_fired = TimerCallback; - - pTimerCallback = NULL; - pTxCallback = NULL; - pRxCallback = NULL; - -#if ENABLE_TRACE - pTrace = fopen("adsp21xx.txt", "w"); -#endif - return 0; -} - -int Adsp2100Exit() -{ - adsp21xx_exit(pADSP); - BurnFree(pADSP); - delete pMemMap; - pMemMap = nullptr; -#if ENABLE_TRACE - fclose(pTrace); -#endif - return 0; -} - -void Adsp2100Reset() -{ - adsp21xx_reset(pADSP); -} - -int Adsp2100Run(int cycles) -{ - return adsp21xx_execute(pADSP, cycles); -} - -void Adsp2100SetRxCallback(pAdsp2100RxCallback cb) -{ - pRxCallback = cb; -} - -void Adsp2100SetTxCallback(pAdsp2100TxCallback cb) -{ - pTxCallback = cb; -} - -void Adsp2100SetTimerCallback(pAdsp2100TimerCallback cb) -{ - pTimerCallback = cb; -} - -void Adsp2100SetIRQCallback(int (*cb)(int)) -{ - if (pADSP) - pADSP->irq_callback = cb; -} - -void Adsp2100SetIRQLine(int line, int state) -{ - adsp21xx_set_irq_line(pADSP, line, state); -} - - -int Adsp2100LoadBootROM(void *src, void *dst) -{ - adsp2105_load_boot_data((UINT8*)src, (UINT32*)dst); - return 0; -} - -int Adsp2100MapMemory(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd, int nType) -{ - const int maxPages = (PFN(nEnd) - PFN(nStart)) + 1; - - int page = PFN(nStart); - for (int i = 0; i < maxPages; i++, page++) { - - if (nType & MAP_READ) - pMemMap->PrgMap[page] = pMemory + (PAGE_SIZE * i); - - if (nType & MAP_WRITE) - pMemMap->PrgMap[PAGE_WADD + page] = pMemory + (PAGE_SIZE * i); - } - return 0; -} - - -int Adsp2100MapHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType) -{ - const int maxPages = (PFN(nEnd) - PFN(nStart)) + 1; - - int page = PFN(nStart); - for (int i = 0; i < maxPages; i++, page++) { - - if (nType & MAP_READ) - pMemMap->PrgMap[page] = (UINT8*) nHandler; - - if (nType & MAP_WRITE) - pMemMap->PrgMap[PAGE_WADD + page] = (UINT8*) nHandler; - } - return 0; -} - - - -int Adsp2100MapData(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd, int nType) -{ - const int maxPages = (PFN(nEnd) - PFN(nStart)) + 1; - - int page = PFN(nStart); - for (int i = 0; i < maxPages; i++, page++) { - - if (nType & MAP_READ) - pMemMap->DataMap[page] = pMemory + (PAGE_SIZE * i); - - if (nType & MAP_WRITE) - pMemMap->DataMap[PAGE_WADD + page] = pMemory + (PAGE_SIZE * i); - } - return 0; -} - - -int Adsp2100MapDataHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType) -{ - const int maxPages = (PFN(nEnd) - PFN(nStart)) + 1; - - int page = PFN(nStart); - for (int i = 0; i < maxPages; i++, page++) { - - if (nType & MAP_READ) - pMemMap->DataMap[page] = (UINT8*) nHandler; - - if (nType & MAP_WRITE) - pMemMap->DataMap[PAGE_WADD + page] = (UINT8*) nHandler; - } - return 0; -} - -// ------------------------------------------------------------------- -// Program address space -// ------------------------------------------------------------------- -int Adsp2100SetReadLongHandler(int i, pAdsp2100ReadLongHandler pHandler) -{ - if (i >= ADSP_MAXHANDLER) - return 1; - pMemMap->prgReadLong[i] = pHandler; - return 0; -} - -int Adsp2100SetWriteLongHandler(int i, pAdsp2100WriteLongHandler pHandler) -{ - if (i >= ADSP_MAXHANDLER) - return 1; - pMemMap->prgWriteLong[i] = pHandler; - return 0; -} - -// ------------------------------------------------------------------- -// Data address space -// ------------------------------------------------------------------- - -int Adsp2100SetReadDataWordHandler(int i, pAdsp2100ReadWordHandler pHandler) -{ - if (i >= ADSP_MAXHANDLER) - return 1; - pMemMap->dataReadWord[i] = pHandler; - return 0; -} - -int Adsp2100SetWriteDataWordHandler(int i, pAdsp2100WriteWordHandler pHandler) -{ - if (i >= ADSP_MAXHANDLER) - return 1; - pMemMap->dataWriteWord[i] = pHandler; - return 0; -} - -// ============================================================================ -// MEMORY ACCESSORS -// ============================================================================ - -template -inline T fast_read(uint8_t *ptr, unsigned adr) { - return *((T*) ((uint8_t*) ptr + (adr & PAGE_MASK))); -} - -template -inline void fast_write(uint8_t *xptr, unsigned adr, T value) { - T *ptr = ((T*) ((uint8_t*) xptr + (adr & PAGE_MASK))); - *ptr = value; -} - -UINT16 adsp21xx_data_read_word_16le(UINT32 address) -{ -// address &= 0xFFFF; - address >>= 1; - address &= 0x3FFF; - - UINT8 *pr = pMemMap->DataMap[PFN(address)]; - if ((uintptr_t)pr >= ADSP_MAXHANDLER) { - return BURN_ENDIAN_SWAP_INT16(fast_read(pr, address)); - } - return pMemMap->dataReadWord[(uintptr_t)pr](address); -} - -void adsp21xx_data_write_word_16le(UINT32 address, UINT16 data) -{ -// address &= 0xFFFF; - address >>= 1; - address &= 0x3FFF; - - UINT8 *pr = pMemMap->DataMap[PAGE_WADD + PFN(address)]; - if ((uintptr_t)pr >= ADSP_MAXHANDLER) { - fast_write(pr, address, BURN_ENDIAN_SWAP_INT16(data)); - return; - } - pMemMap->dataWriteWord[(uintptr_t)pr](address, data); -} - -//static UINT32 last_pc = 0xFFFFFFFF; -extern int adsp21xx_dasm(char *buffer, UINT8 *oprom); -UINT32 adsp21xx_read_dword_32le(UINT32 address) -{ -// address &= 0xFFFF; - address >>= 2; - address &= 0x3FFF; - - UINT32 value = 0; - - UINT8 *pr = pMemMap->PrgMap[PFN(address)]; - if ((uintptr_t)pr >= ADSP_MAXHANDLER) { - value = BURN_ENDIAN_SWAP_INT32(fast_read(pr, address)); - } else - value = pMemMap->prgReadLong[(uintptr_t)pr](address); -#if ENABLE_TRACE - if (last_pc != pADSP->pc) { - char buffer[1024]; - adsp21xx_dasm(buffer, (UINT8*)&value); - fprintf(pTrace, "%04X: %s\n", address>>2, buffer); - last_pc = pADSP->pc; - } -#endif - return value; -} - -void adsp21xx_write_dword_32le(UINT32 address, UINT32 data) -{ -// address &= 0xFFFF; - address >>= 2; - address &= 0x3FFF; - - UINT8 *pr = pMemMap->PrgMap[PAGE_WADD + PFN(address)]; - if ((uintptr_t)pr >= ADSP_MAXHANDLER) { - fast_write(pr, address, BURN_ENDIAN_SWAP_INT32(data)); - return; - } - pMemMap->prgWriteLong[(uintptr_t)pr](address, data); -} - - -adsp2100_state *Adsp2100GetState() -{ - return pADSP; -} - diff --git a/jan/src/cpu/adsp2100_intf.h b/jan/src/cpu/adsp2100_intf.h deleted file mode 100644 index 638b3aeeb..000000000 --- a/jan/src/cpu/adsp2100_intf.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ADSP2100_INTF -#define ADSP2100_INTF -#include - -#include "adsp2100/adsp2100_defs.h" - -enum { - ADSP21XX_CLEAR_LINE = 0, /* clear (a fired, held or pulsed) line */ - ADSP21XX_ASSERT_LINE, /* assert an interrupt immediately */ - ADSP21XX_HOLD_LINE, /* hold interrupt line until acknowledged */ - ADSP21XX_PULSE_LINE, /* pulse interrupt line for one instruction */ -}; - -typedef unsigned short (*pAdsp2100ReadWordHandler)(unsigned int a); -typedef void (*pAdsp2100WriteWordHandler)(unsigned int a, unsigned short d); - -typedef unsigned int (*pAdsp2100ReadLongHandler)(unsigned int a); -typedef void (*pAdsp2100WriteLongHandler)(unsigned int a, unsigned int d); - -typedef int (*pAdsp2100RxCallback)(int port); -typedef void (*pAdsp2100TxCallback)(int port, int data); -typedef void (*pAdsp2100TimerCallback)(int enable); - -int Adsp2100Init(); -int Adsp2100Exit(); -void Adsp2100Reset(); -int Adsp2100Run(int cycles); -int Adsp2100LoadBootROM(void *src, void *dst); - -void Adsp2100SetRxCallback(pAdsp2100RxCallback cb); -void Adsp2100SetTxCallback(pAdsp2100TxCallback cb); -void Adsp2100SetTimerCallback(pAdsp2100TimerCallback cb); -void Adsp2100SetIRQCallback(int (*irq)(int)); - -int Adsp2100MapMemory(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd, int nType); -int Adsp2100MapHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType); - -int Adsp2100MapData(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd, int nType); -int Adsp2100MapDataHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType); - -int Adsp2100SetReadLongHandler(int i, pAdsp2100ReadLongHandler pHandler); -int Adsp2100SetWriteLongHandler(int i, pAdsp2100WriteLongHandler pHandler); - -int Adsp2100SetReadDataWordHandler(int i, pAdsp2100ReadWordHandler pHandler); -int Adsp2100SetWriteDataWordHandler(int i, pAdsp2100WriteWordHandler pHandler); - -void Adsp2100SetIRQLine(const int line, const int state); - - -adsp2100_state *Adsp2100GetState(); - -#endif // ADSP2100_INTF - diff --git a/jan/src/cpu/arm/arm.cpp b/jan/src/cpu/arm/arm.cpp deleted file mode 100644 index 9cf8cdd05..000000000 --- a/jan/src/cpu/arm/arm.cpp +++ /dev/null @@ -1,1385 +0,0 @@ -/* arm.c - - ARM 2/3/6 Emulation (26 bit address bus) - - Todo: - Timing - Currently very approximated, nothing relies on proper timing so far. - IRQ timing not yet correct (again, nothing is affected by this so far). - - Recent changes (2005): - Fixed software interrupts - Fixed various mode change bugs - Added preliminary co-processor support. - - By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino - -*/ - -#include -#include -#include -//#include "state.h" -//#include "driver.h" -#include "burnint.h" -#include "arm_intf.h" - -#define READ8(addr) cpu_read8(addr) -#define WRITE8(addr,data) cpu_write8(addr,data) -#define READ32(addr) cpu_read32(addr) -#define WRITE32(addr,data) cpu_write32(addr,data) - -#define change_pc(x) R15 = (R15&~ADDRESS_MASK)|((x)&ADDRESS_MASK) - -#define ARM_DEBUG_CORE 0 -#define ARM_DEBUG_COPRO 0 - -enum -{ - ARM32_PC=0, - ARM32_R0, ARM32_R1, ARM32_R2, ARM32_R3, ARM32_R4, ARM32_R5, ARM32_R6, ARM32_R7, - ARM32_R8, ARM32_R9, ARM32_R10, ARM32_R11, ARM32_R12, ARM32_R13, ARM32_R14, ARM32_R15, - ARM32_FR8, ARM32_FR9, ARM32_FR10, ARM32_FR11, ARM32_FR12, ARM32_FR13, ARM32_FR14, - ARM32_IR13, ARM32_IR14, ARM32_SR13, ARM32_SR14 -}; - -enum -{ - eARM_MODE_USER = 0x0, - eARM_MODE_FIQ = 0x1, - eARM_MODE_IRQ = 0x2, - eARM_MODE_SVC = 0x3, - - kNumModes -}; - -/* There are 27 32 bit processor registers */ -enum -{ - eR0=0,eR1,eR2,eR3,eR4,eR5,eR6,eR7, - eR8,eR9,eR10,eR11,eR12, - eR13, /* Stack Pointer */ - eR14, /* Link Register (holds return address) */ - eR15, /* Program Counter */ - - /* Fast Interrupt */ - eR8_FIQ,eR9_FIQ,eR10_FIQ,eR11_FIQ,eR12_FIQ,eR13_FIQ,eR14_FIQ, - - /* IRQ */ - eR13_IRQ,eR14_IRQ, - - /* Software Interrupt */ - eR13_SVC,eR14_SVC, - - kNumRegisters -}; - -/* 16 processor registers are visible at any given time, - * banked depending on processor mode. - */ -static const int sRegisterTable[kNumModes][16] = -{ - { /* USR */ - eR0,eR1,eR2,eR3,eR4,eR5,eR6,eR7, - eR8,eR9,eR10,eR11,eR12, - eR13,eR14, - eR15 - }, - { /* FIQ */ - eR0,eR1,eR2,eR3,eR4,eR5,eR6,eR7, - eR8_FIQ,eR9_FIQ,eR10_FIQ,eR11_FIQ,eR12_FIQ, - eR13_FIQ,eR14_FIQ, - eR15 - }, - { /* IRQ */ - eR0,eR1,eR2,eR3,eR4,eR5,eR6,eR7, - eR8,eR9,eR10,eR11,eR12, - eR13_IRQ,eR14_IRQ, - eR15 - }, - { /* SVC */ - eR0,eR1,eR2,eR3,eR4,eR5,eR6,eR7, - eR8,eR9,eR10,eR11,eR12, - eR13_SVC,eR14_SVC, - eR15 - } -}; - -#define N_BIT 31 -#define Z_BIT 30 -#define C_BIT 29 -#define V_BIT 28 -#define I_BIT 27 -#define F_BIT 26 - -#define N_MASK ((UINT32)(1<> 31) - -/* Deconstructing an instruction */ - -#define INSN_COND ((UINT32) 0xf0000000u) -#define INSN_SDT_L ((UINT32) 0x00100000u) -#define INSN_SDT_W ((UINT32) 0x00200000u) -#define INSN_SDT_B ((UINT32) 0x00400000u) -#define INSN_SDT_U ((UINT32) 0x00800000u) -#define INSN_SDT_P ((UINT32) 0x01000000u) -#define INSN_BDT_L ((UINT32) 0x00100000u) -#define INSN_BDT_W ((UINT32) 0x00200000u) -#define INSN_BDT_S ((UINT32) 0x00400000u) -#define INSN_BDT_U ((UINT32) 0x00800000u) -#define INSN_BDT_P ((UINT32) 0x01000000u) -#define INSN_BDT_REGS ((UINT32) 0x0000ffffu) -#define INSN_SDT_IMM ((UINT32) 0x00000fffu) -#define INSN_MUL_A ((UINT32) 0x00200000u) -#define INSN_MUL_RM ((UINT32) 0x0000000fu) -#define INSN_MUL_RS ((UINT32) 0x00000f00u) -#define INSN_MUL_RN ((UINT32) 0x0000f000u) -#define INSN_MUL_RD ((UINT32) 0x000f0000u) -#define INSN_I ((UINT32) 0x02000000u) -#define INSN_OPCODE ((UINT32) 0x01e00000u) -#define INSN_S ((UINT32) 0x00100000u) -#define INSN_BL ((UINT32) 0x01000000u) -#define INSN_BRANCH ((UINT32) 0x00ffffffu) -#define INSN_SWI ((UINT32) 0x00ffffffu) -#define INSN_RN ((UINT32) 0x000f0000u) -#define INSN_RD ((UINT32) 0x0000f000u) -#define INSN_OP2 ((UINT32) 0x00000fffu) -#define INSN_OP2_SHIFT ((UINT32) 0x00000f80u) -#define INSN_OP2_SHIFT_TYPE ((UINT32) 0x00000070u) -#define INSN_OP2_RM ((UINT32) 0x0000000fu) -#define INSN_OP2_ROTATE ((UINT32) 0x00000f00u) -#define INSN_OP2_IMM ((UINT32) 0x000000ffu) -#define INSN_OP2_SHIFT_TYPE_SHIFT 4 -#define INSN_OP2_SHIFT_SHIFT 7 -#define INSN_OP2_ROTATE_SHIFT 8 -#define INSN_MUL_RS_SHIFT 8 -#define INSN_MUL_RN_SHIFT 12 -#define INSN_MUL_RD_SHIFT 16 -#define INSN_OPCODE_SHIFT 21 -#define INSN_RN_SHIFT 16 -#define INSN_RD_SHIFT 12 -#define INSN_COND_SHIFT 28 - -#define S_CYCLE 1 -#define N_CYCLE 1 -#define I_CYCLE 1 - -enum -{ - OPCODE_AND, /* 0000 */ - OPCODE_EOR, /* 0001 */ - OPCODE_SUB, /* 0010 */ - OPCODE_RSB, /* 0011 */ - OPCODE_ADD, /* 0100 */ - OPCODE_ADC, /* 0101 */ - OPCODE_SBC, /* 0110 */ - OPCODE_RSC, /* 0111 */ - OPCODE_TST, /* 1000 */ - OPCODE_TEQ, /* 1001 */ - OPCODE_CMP, /* 1010 */ - OPCODE_CMN, /* 1011 */ - OPCODE_ORR, /* 1100 */ - OPCODE_MOV, /* 1101 */ - OPCODE_BIC, /* 1110 */ - OPCODE_MVN /* 1111 */ -}; - -enum -{ - COND_EQ = 0, /* Z: equal */ - COND_NE, /* ~Z: not equal */ - COND_CS, COND_HS = 2, /* C: unsigned higher or same */ - COND_CC, COND_LO = 3, /* ~C: unsigned lower */ - COND_MI, /* N: negative */ - COND_PL, /* ~N: positive or zero */ - COND_VS, /* V: overflow */ - COND_VC, /* ~V: no overflow */ - COND_HI, /* C && ~Z: unsigned higher */ - COND_LS, /* ~C || Z: unsigned lower or same */ - COND_GE, /* N == V: greater or equal */ - COND_LT, /* N != V: less than */ - COND_GT, /* ~Z && (N == V): greater than */ - COND_LE, /* Z || (N != V): less than or equal */ - COND_AL, /* always */ - COND_NV /* never */ -}; - -#define LSL(v,s) ((v) << (s)) -#define LSR(v,s) ((v) >> (s)) -#define ROL(v,s) (LSL((v),(s)) | (LSR((v),32u - (s)))) -#define ROR(v,s) (LSR((v),(s)) | (LSL((v),32u - (s)))) - -/* Private Data */ - -/* sArmRegister defines the CPU state */ -typedef struct -{ - UINT32 sArmRegister[kNumRegisters]; - UINT32 coproRegister[16]; - UINT8 pendingIrq; - UINT8 pendingFiq; - - UINT32 ArmTotalCycles; - UINT32 ArmLeftCycles; -} ARM_REGS; - -static ARM_REGS arm; - -static int arm_icount; - -/* Prototypes */ -static void HandleALU( UINT32 insn); -static void HandleMul( UINT32 insn); -static void HandleBranch( UINT32 insn); -static void HandleMemSingle( UINT32 insn); -static void HandleMemBlock( UINT32 insn); -static void HandleCoPro( UINT32 insn); -static UINT32 decodeShift( UINT32 insn, UINT32 *pCarry); -static void arm_check_irq_state(void); - -/***************************************************************************/ - -inline void cpu_write32( int addr, UINT32 data ) -{ - /* Unaligned writes are treated as normal writes */ - ArmWriteLong(addr&ADDRESS_MASK,data); -} - -inline void cpu_write8( int addr, UINT8 data ) -{ - ArmWriteByte(addr,data); -} - -inline UINT32 cpu_read32( int addr ) -{ - UINT32 result = ArmReadLong(addr&ADDRESS_MASK); - - /* Unaligned reads rotate the word, they never combine words */ - if (addr&3) { - if ((addr&3)==1) - return ((result&0x000000ff)<<24)|((result&0xffffff00)>> 8); - if ((addr&3)==2) - return ((result&0x0000ffff)<<16)|((result&0xffff0000)>>16); - if ((addr&3)==3) - return ((result&0x00ffffff)<< 8)|((result&0xff000000)>>24); - } - - return result; -} - -inline UINT8 cpu_read8( int addr ) -{ - return ArmReadByte(addr); -} - -inline UINT32 GetRegister( int rIndex ) -{ - return arm.sArmRegister[sRegisterTable[MODE][rIndex]]; -} - -inline void SetRegister( int rIndex, UINT32 value ) -{ - arm.sArmRegister[sRegisterTable[MODE][rIndex]] = value; - if (rIndex == eR15) - change_pc(value & ADDRESS_MASK); -} - -/***************************************************************************/ - -void ArmReset(void) -{ - memset(&arm, 0, sizeof(arm)); - - /* start up in SVC mode with interrupts disabled. */ - R15 = eARM_MODE_SVC|I_MASK|F_MASK; - change_pc(R15 & ADDRESS_MASK); -} - -int ArmRun( int cycles ) -{ - UINT32 pc; - UINT32 insn; - - arm_icount = cycles; - arm.ArmLeftCycles = cycles; - - do - { - /* load instruction */ - pc = R15; - insn = ArmFetchLong( pc & ADDRESS_MASK ); - - switch (insn >> INSN_COND_SHIFT) - { - case COND_EQ: - if (Z_IS_CLEAR(pc)) goto L_Next; - break; - case COND_NE: - if (Z_IS_SET(pc)) goto L_Next; - break; - case COND_CS: - if (C_IS_CLEAR(pc)) goto L_Next; - break; - case COND_CC: - if (C_IS_SET(pc)) goto L_Next; - break; - case COND_MI: - if (N_IS_CLEAR(pc)) goto L_Next; - break; - case COND_PL: - if (N_IS_SET(pc)) goto L_Next; - break; - case COND_VS: - if (V_IS_CLEAR(pc)) goto L_Next; - break; - case COND_VC: - if (V_IS_SET(pc)) goto L_Next; - break; - case COND_HI: - if (C_IS_CLEAR(pc) || Z_IS_SET(pc)) goto L_Next; - break; - case COND_LS: - if (C_IS_SET(pc) && Z_IS_CLEAR(pc)) goto L_Next; - break; - case COND_GE: - if (!(pc & N_MASK) != !(pc & V_MASK)) goto L_Next; /* Use x ^ (x >> ...) method */ - break; - case COND_LT: - if (!(pc & N_MASK) == !(pc & V_MASK)) goto L_Next; - break; - case COND_GT: - if (Z_IS_SET(pc) || (!(pc & N_MASK) != !(pc & V_MASK))) goto L_Next; - break; - case COND_LE: - if (Z_IS_CLEAR(pc) && (!(pc & N_MASK) == !(pc & V_MASK))) goto L_Next; - break; - case COND_NV: - goto L_Next; - } - /* Condition satisfied, so decode the instruction */ - if ((insn & 0x0fc000f0u) == 0x00000090u) /* Multiplication */ - { - HandleMul(insn); - R15 += 4; - } - else if (!(insn & 0x0c000000u)) /* Data processing */ - { - HandleALU(insn); - } - else if ((insn & 0x0c000000u) == 0x04000000u) /* Single data access */ - { - HandleMemSingle(insn); - R15 += 4; - } - else if ((insn & 0x0e000000u) == 0x08000000u ) /* Block data access */ - { - HandleMemBlock(insn); - R15 += 4; - } - else if ((insn & 0x0e000000u) == 0x0a000000u) /* Branch */ - { - HandleBranch(insn); - } - else if ((insn & 0x0f000000u) == 0x0e000000u) /* Coprocessor */ - { - HandleCoPro(insn); - R15 += 4; - } - else if ((insn & 0x0f000000u) == 0x0f000000u) /* Software interrupt */ - { - pc=R15+4; - R15 = eARM_MODE_SVC; /* Set SVC mode so PC is saved to correct R14 bank */ - SetRegister( 14, pc ); /* save PC */ - R15 = (pc&PSR_MASK)|(pc&IRQ_MASK)|0x8|eARM_MODE_SVC|I_MASK|(pc&MODE_MASK); - change_pc(pc&ADDRESS_MASK); - arm_icount -= 2 * S_CYCLE + N_CYCLE; - } - else /* Undefined */ - { - L_Next: - arm_icount -= S_CYCLE; - R15 += 4; - } - - arm_check_irq_state(); - - } while( arm_icount > 0 ); - - arm.ArmTotalCycles += (cycles - arm_icount); - - return cycles - arm_icount; -} /* arm_execute */ - -static void arm_check_irq_state(void) -{ - UINT32 pc = R15+4; /* save old pc (already incremented in pipeline) */; - - /* Exception priorities (from ARM6, not specifically ARM2/3): - - Reset - Data abort - FIRQ - IRQ - Prefetch abort - Undefined instruction - */ - - if (arm.pendingFiq && (pc&F_MASK)==0) { - R15 = eARM_MODE_FIQ; /* Set FIQ mode so PC is saved to correct R14 bank */ - SetRegister( 14, pc ); /* save PC */ - R15 = (pc&PSR_MASK)|(pc&IRQ_MASK)|0x1c|eARM_MODE_FIQ|I_MASK|F_MASK; /* Mask both IRQ & FIRQ, set PC=0x1c */ - change_pc(R15 & ADDRESS_MASK); - arm.pendingFiq=0; - return; - } - - if (arm.pendingIrq && (pc&I_MASK)==0) { - R15 = eARM_MODE_IRQ; /* Set IRQ mode so PC is saved to correct R14 bank */ - SetRegister( 14, pc ); /* save PC */ - R15 = (pc&PSR_MASK)|(pc&IRQ_MASK)|0x18|eARM_MODE_IRQ|I_MASK|(pc&F_MASK); /* Mask only IRQ, set PC=0x18 */ - change_pc(R15 & ADDRESS_MASK); - arm.pendingIrq=0; - return; - } -} - -void arm_set_irq_line(int irqline, int state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("arm_set_irq_line called without init\n")); -#endif - - switch (irqline) { - - case ARM_IRQ_LINE: /* IRQ */ - if (state && (R15&0x3)!=eARM_MODE_IRQ) /* Don't allow nested IRQs */ - arm.pendingIrq=1; - else - arm.pendingIrq=0; - break; - - case ARM_FIRQ_LINE: /* FIRQ */ - if (state && (R15&0x3)!=eARM_MODE_FIQ) /* Don't allow nested FIRQs */ - arm.pendingFiq=1; - else - arm.pendingFiq=0; - break; - } - - arm_check_irq_state(); -} - -/***************************************************************************/ - -static void HandleBranch( UINT32 insn ) -{ - UINT32 off = (insn & INSN_BRANCH) << 2; - - /* Save PC into LR if this is a branch with link */ - if (insn & INSN_BL) - { - SetRegister(14,R15 + 4); - } - - /* Sign-extend the 24-bit offset in our calculations */ - if (off & 0x2000000u) - { - R15 -= ((~(off | 0xfc000000u)) + 1) - 8; - } - else - { - R15 += off + 8; - } - change_pc(R15 & ADDRESS_MASK); - arm_icount -= 2 * S_CYCLE + N_CYCLE; -} - -static void HandleMemSingle( UINT32 insn ) -{ - UINT32 rn, rnv, off, rd; - - /* Fetch the offset */ - if (insn & INSN_I) - { - off = decodeShift(insn, NULL); - } - else - { - off = insn & INSN_SDT_IMM; - } - - /* Calculate Rn, accounting for PC */ - rn = (insn & INSN_RN) >> INSN_RN_SHIFT; - - if (insn & INSN_SDT_P) - { - /* Pre-indexed addressing */ - if (insn & INSN_SDT_U) - { - rnv = (GetRegister(rn) + off); - } - else - { - rnv = (GetRegister(rn) - off); - } - - if (insn & INSN_SDT_W) - { - SetRegister(rn,rnv); - } - else if (rn == eR15) - { - rnv = (rnv & ADDRESS_MASK) + 8; - } - } - else - { - /* Post-indexed addressing */ - if (rn == eR15) - { - rnv = (R15 & ADDRESS_MASK) + 8; - } - else - { - rnv = GetRegister(rn); - } - } - - /* Do the transfer */ - rd = (insn & INSN_RD) >> INSN_RD_SHIFT; - if (insn & INSN_SDT_L) - { - /* Load */ - arm_icount -= S_CYCLE + I_CYCLE + N_CYCLE; - if (insn & INSN_SDT_B) - { - SetRegister(rd,(UINT32) READ8(rnv)); - } - else - { - if (rd == eR15) - { - R15 = (READ32(rnv) & ADDRESS_MASK) | (R15 & PSR_MASK) | (R15 & IRQ_MASK) | (R15 & MODE_MASK); - change_pc(R15 & ADDRESS_MASK); - - /* - The docs are explicit in that the bottom bits should be masked off - when writing to R15 in this way, however World Cup Volleyball 95 has - an example of an unaligned jump (bottom bits = 2) where execution - should definitely continue from the rounded up address. - - In other cases, 4 is subracted from R15 here to account for pipelining. - */ - if ((READ32(rnv)&3)==0) - R15 -= 4; - - arm_icount -= S_CYCLE + N_CYCLE; - } - else - { - SetRegister(rd,READ32(rnv)); - } - } - } - else - { - /* Store */ - arm_icount -= 2 * N_CYCLE; - if (insn & INSN_SDT_B) - { - WRITE8(rnv, (UINT8) GetRegister(rd) & 0xffu); - } - else - { - WRITE32(rnv, rd == eR15 ? R15 + 8 : GetRegister(rd)); - } - } - - /* Do post-indexing writeback */ - if (!(insn & INSN_SDT_P)/* && (insn&INSN_SDT_W)*/) - { - if (insn & INSN_SDT_U) - { - /* Writeback is applied in pipeline, before value is read from mem, - so writeback is effectively ignored */ - if (rd==rn) { - SetRegister(rn,GetRegister(rd)); - } - else { - SetRegister(rn,(rnv + off)); - } - } - else - { - /* Writeback is applied in pipeline, before value is read from mem, - so writeback is effectively ignored */ - if (rd==rn) { - SetRegister(rn,GetRegister(rd)); - } - else { - SetRegister(rn,(rnv - off)); - } - } - } -} /* HandleMemSingle */ - -#define IsNeg(i) ((i) >> 31) -#define IsPos(i) ((~(i)) >> 31) - -/* Set NZCV flags for ADDS / SUBS */ - -#define HandleALUAddFlags(rd, rn, op2) \ - if (insn & INSN_S) \ - R15 = \ - ((R15 &~ (N_MASK | Z_MASK | V_MASK | C_MASK)) \ - | (((!SIGN_BITS_DIFFER(rn, op2)) && SIGN_BITS_DIFFER(rn, rd)) \ - << V_BIT) \ - | (((~(rn)) < (op2)) << C_BIT) \ - | HandleALUNZFlags(rd)) \ - + 4; \ - else R15 += 4; - -#define HandleALUSubFlags(rd, rn, op2) \ - if (insn & INSN_S) \ - R15 = \ - ((R15 &~ (N_MASK | Z_MASK | V_MASK | C_MASK)) \ - | ((SIGN_BITS_DIFFER(rn, op2) && SIGN_BITS_DIFFER(rn, rd)) \ - << V_BIT) \ - | (((IsNeg(rn) & IsPos(op2)) | (IsNeg(rn) & IsPos(rd)) | (IsPos(op2) & IsPos(rd))) ? C_MASK : 0) \ - | HandleALUNZFlags(rd)) \ - + 4; \ - else R15 += 4; - -/* Set NZC flags for logical operations. */ - -#define HandleALUNZFlags(rd) \ - (((rd) & SIGN_BIT) | ((!(rd)) << Z_BIT)) - -#define HandleALULogicalFlags(rd, sc) \ - if (insn & INSN_S) \ - R15 = ((R15 &~ (N_MASK | Z_MASK | C_MASK)) \ - | HandleALUNZFlags(rd) \ - | (((sc) != 0) << C_BIT)) + 4; \ - else R15 += 4; - -static void HandleALU( UINT32 insn ) -{ - UINT32 op2, sc=0, rd, rn, opcode; - UINT32 by, rdn; - - opcode = (insn & INSN_OPCODE) >> INSN_OPCODE_SHIFT; - arm_icount -= S_CYCLE; - - rd = 0; - rn = 0; - - /* Construct Op2 */ - if (insn & INSN_I) - { - /* Immediate constant */ - by = (insn & INSN_OP2_ROTATE) >> INSN_OP2_ROTATE_SHIFT; - if (by) - { - op2 = ROR(insn & INSN_OP2_IMM, by << 1); - sc = op2 & SIGN_BIT; - } - else - { - op2 = insn & INSN_OP2; - sc = R15 & C_MASK; - } - } - else - { - op2 = decodeShift(insn, (insn & INSN_S) ? &sc : NULL); - - if (!(insn & INSN_S)) - sc=0; - } - - /* Calculate Rn to account for pipelining */ - if ((opcode & 0xd) != 0xd) /* No Rn in MOV */ - { - if ((rn = (insn & INSN_RN) >> INSN_RN_SHIFT) == eR15) - { - /* Docs strongly suggest the mode bits should be included here, but it breaks Captain - America, as it starts doing unaligned reads */ - rn=(R15+8)&ADDRESS_MASK; - } - else - { - rn = GetRegister(rn); - } - } - - /* Perform the operation */ - switch ((insn & INSN_OPCODE) >> INSN_OPCODE_SHIFT) - { - /* Arithmetic operations */ - case OPCODE_SBC: - rd = (rn - op2 - (R15 & C_MASK ? 0 : 1)); - HandleALUSubFlags(rd, rn, op2); - break; - case OPCODE_CMP: - case OPCODE_SUB: - rd = (rn - op2); - HandleALUSubFlags(rd, rn, op2); - break; - case OPCODE_RSC: - rd = (op2 - rn - (R15 & C_MASK ? 0 : 1)); - HandleALUSubFlags(rd, op2, rn); - break; - case OPCODE_RSB: - rd = (op2 - rn); - HandleALUSubFlags(rd, op2, rn); - break; - case OPCODE_ADC: - rd = (rn + op2 + ((R15 & C_MASK) >> C_BIT)); - HandleALUAddFlags(rd, rn, op2); - break; - case OPCODE_CMN: - case OPCODE_ADD: - rd = (rn + op2); - HandleALUAddFlags(rd, rn, op2); - break; - - /* Logical operations */ - case OPCODE_AND: - case OPCODE_TST: - rd = rn & op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_BIC: - rd = rn &~ op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_TEQ: - case OPCODE_EOR: - rd = rn ^ op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_ORR: - rd = rn | op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_MOV: - rd = op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_MVN: - rd = (~op2); - HandleALULogicalFlags(rd, sc); - break; - } - - /* Put the result in its register if not a test */ - rdn = (insn & INSN_RD) >> INSN_RD_SHIFT; - if ((opcode & 0xc) != 0x8) - { - if (rdn == eR15 && !(insn & INSN_S)) - { - /* Merge the old NZCV flags into the new PC value */ - R15 = (rd & ADDRESS_MASK) | (R15 & PSR_MASK) | (R15 & IRQ_MASK) | (R15&MODE_MASK); - change_pc(R15 & ADDRESS_MASK); - arm_icount -= S_CYCLE + N_CYCLE; - } - else - { - if (rdn==eR15) - { - /* S Flag is set - update PSR & mode if in non-user mode only */ - if ((R15&MODE_MASK)!=0) - { - SetRegister(rdn,rd); - } - else - { - SetRegister(rdn,(rd&ADDRESS_MASK) | (rd&PSR_MASK) | (R15&IRQ_MASK) | (R15&MODE_MASK)); - } - arm_icount -= S_CYCLE + N_CYCLE; - } - else - { - SetRegister(rdn,rd); - } - } - /* TST & TEQ can affect R15 (the condition code register) with the S bit set */ - } else if (rdn==eR15) { - if (insn & INSN_S) { - /* Dubious hack for 'TEQS R15, #$3', the docs suggest execution - should continue two instructions later (because pipelined R15 - is read back as already being incremented), but it seems the - hardware should execute the instruction in the delay slot. - Simulate it by just setting the PC back to the previously - skipped instruction. - - See Heavy Smash (Data East) at 0x1c4 - */ - if (insn==0xe33ff003) - rd-=4; - - arm_icount -= S_CYCLE + N_CYCLE; - if ((R15&MODE_MASK)!=0) - { - SetRegister(15, rd); - } - else - { - SetRegister(15, (rd&ADDRESS_MASK) | (rd&PSR_MASK) | (R15&IRQ_MASK) | (R15&MODE_MASK)); - } - } - } -} - -static void HandleMul( UINT32 insn) -{ - UINT32 r; - - arm_icount -= S_CYCLE + I_CYCLE; - /* should be: - Range of Rs Number of cycles - - &0 -- &1 1S + 1I - &2 -- &7 1S + 2I - &8 -- &1F 1S + 3I - &20 -- &7F 1S + 4I - &80 -- &1FF 1S + 5I - &200 -- &7FF 1S + 6I - &800 -- &1FFF 1S + 7I - &2000 -- &7FFF 1S + 8I - &8000 -- &1FFFF 1S + 9I - &20000 -- &7FFFF 1S + 10I - &80000 -- &1FFFFF 1S + 11I - &200000 -- &7FFFFF 1S + 12I - &800000 -- &1FFFFFF 1S + 13I - &2000000 -- &7FFFFFF 1S + 14I - &8000000 -- &1FFFFFFF 1S + 15I - &20000000 -- &FFFFFFFF 1S + 16I - */ - - /* Do the basic multiply of Rm and Rs */ - r = GetRegister( insn&INSN_MUL_RM ) * - GetRegister( (insn&INSN_MUL_RS)>>INSN_MUL_RS_SHIFT ); - - /* Add on Rn if this is a MLA */ - if (insn & INSN_MUL_A) - { - r += GetRegister((insn&INSN_MUL_RN)>>INSN_MUL_RN_SHIFT); - } - - /* Write the result */ - SetRegister((insn&INSN_MUL_RD)>>INSN_MUL_RD_SHIFT,r); - - /* Set N and Z if asked */ - if( insn & INSN_S ) - { - R15 = (R15 &~ (N_MASK | Z_MASK)) | HandleALUNZFlags(r); - } -} - -static int loadInc ( UINT32 pat, UINT32 rbv, UINT32 s) -{ - int i,result; - - result = 0; - for( i=0; i<16; i++ ) - { - if( (pat>>i)&1 ) - { - if (i==15) { - if (s) /* Pull full contents from stack */ - SetRegister( 15, READ32(rbv+=4) ); - else /* Pull only address, preserve mode & status flags */ - SetRegister( 15, (R15&PSR_MASK) | (R15&IRQ_MASK) | (R15&MODE_MASK) | ((READ32(rbv+=4))&ADDRESS_MASK) ); - } else - SetRegister( i, READ32(rbv+=4) ); - - result++; - } - } - return result; -} - -static int loadDec( UINT32 pat, UINT32 rbv, UINT32 s, UINT32* deferredR15, int* defer) -{ - int i,result; - - result = 0; - for( i=15; i>=0; i-- ) - { - if( (pat>>i)&1 ) - { - if (i==15) { - *defer=1; - if (s) /* Pull full contents from stack */ - *deferredR15=READ32(rbv-=4); - else /* Pull only address, preserve mode & status flags */ - *deferredR15=(R15&PSR_MASK) | (R15&IRQ_MASK) | (R15&MODE_MASK) | ((READ32(rbv-=4))&ADDRESS_MASK); - } - else - SetRegister( i, READ32(rbv -=4) ); - result++; - } - } - return result; -} - -static int storeInc( UINT32 pat, UINT32 rbv) -{ - int i,result; - - result = 0; - for( i=0; i<16; i++ ) - { - if( (pat>>i)&1 ) - { - WRITE32( rbv += 4, GetRegister(i) ); - result++; - } - } - return result; -} /* storeInc */ - -static int storeDec( UINT32 pat, UINT32 rbv) -{ - int i,result; - - result = 0; - for( i=15; i>=0; i-- ) - { - if( (pat>>i)&1 ) - { - WRITE32( rbv -= 4, GetRegister(i) ); - result++; - } - } - return result; -} /* storeDec */ - -static void HandleMemBlock( UINT32 insn) -{ - UINT32 rb = (insn & INSN_RN) >> INSN_RN_SHIFT; - UINT32 rbp = GetRegister(rb); - int result; - - if (insn & INSN_BDT_L) - { - /* Loading */ - if (insn & INSN_BDT_U) - { - /* Incrementing */ - if (!(insn & INSN_BDT_P)) rbp = rbp + (- 4); - - result = loadInc( insn & 0xffff, rbp, insn&INSN_BDT_S ); - - if (insn & 0x8000) { - R15-=4; - arm_icount -= S_CYCLE + N_CYCLE; - } - - if (insn & INSN_BDT_W) - { - /* Arm docs notes: The base register can always be loaded without any problems. - However, don't specify writeback if the base register is being loaded - - you can't end up with both a written-back value and a loaded value in the base register! - - However - Fighter's History does exactly that at 0x121e4 (LDMUW [R13], { R13-R15 })! - - This emulator implementation skips applying writeback in this case, which is confirmed - correct for this situation, but that is not necessarily true for all ARM hardware - implementations (the results are officially undefined). - */ - if ((insn&(1<> INSN_OP2_SHIFT_SHIFT; - UINT32 rm = GetRegister( insn & INSN_OP2_RM ); - UINT32 t = (insn & INSN_OP2_SHIFT_TYPE) >> INSN_OP2_SHIFT_TYPE_SHIFT; - - if ((insn & INSN_OP2_RM)==0xf) { - /* If hardwired shift, then PC is 8 bytes ahead, else if register shift - is used, then 12 bytes - TODO?? */ - rm+=8; - } - - /* All shift types ending in 1 are Rk, not #k */ - if( t & 1 ) - { - //see p35 for check on this - k = GetRegister(k >> 1)&0x1f; - arm_icount -= S_CYCLE; - if( k == 0 ) /* Register shift by 0 is a no-op */ - { - if (pCarry) *pCarry = R15 & C_MASK; - return rm; - } - } - /* Decode the shift type and perform the shift */ - switch (t >> 1) - { - case 0: /* LSL */ - if (pCarry) - { - *pCarry = k ? (rm & (1 << (32 - k))) : (R15 & C_MASK); - } - return k ? LSL(rm, k) : rm; - break; - - case 1: /* LSR */ - if (k == 0 || k == 32) - { - if (pCarry) *pCarry = rm & SIGN_BIT; - return 0; - } - else if (k > 32) - { - if (pCarry) *pCarry = 0; - return 0; - } - else - { - if (pCarry) *pCarry = (rm & (1 << (k - 1))); - return LSR(rm, k); - } - break; - - case 2: /* ASR */ - if (k == 0 || k > 32) - k = 32; - if (pCarry) *pCarry = (rm & (1 << (k - 1))); - if (k >= 32) - return rm & SIGN_BIT ? 0xffffffffu : 0; - else - { - if (rm & SIGN_BIT) - return LSR(rm, k) | (0xffffffffu << (32 - k)); - else - return LSR(rm, k); - } - break; - - case 3: /* ROR and RRX */ - if (k) - { - while (k > 32) k -= 32; - if (pCarry) *pCarry = rm & (1 << (k - 1)); - return ROR(rm, k); - } - else - { - if (pCarry) *pCarry = (rm & 1); - return LSR(rm, 1) | ((R15 & C_MASK) << 2); - } - break; - } - - return 0; -} /* decodeShift */ - - -static UINT32 BCDToDecimal(UINT32 value) -{ - UINT32 accumulator = 0; - UINT32 multiplier = 1; - int i; - - for(i = 0; i < 8; i++) - { - accumulator += (value & 0xF) * multiplier; - - multiplier *= 10; - value >>= 4; - } - - return accumulator; -} - -static UINT32 DecimalToBCD(UINT32 value) -{ - UINT32 accumulator = 0; - UINT32 divisor = 10; - int i; - - for(i = 0; i < 8; i++) - { - UINT32 temp; - - temp = value % divisor; - value -= temp; - temp /= divisor / 10; - - accumulator += temp << (i * 4); - - divisor *= 10; - } - - return accumulator; -} - -static void HandleCoPro( UINT32 insn) -{ - UINT32 rn=(insn>>12)&0xf; - UINT32 crn=(insn>>16)&0xf; - - arm_icount -= S_CYCLE; - - /* MRC - transfer copro register to main register */ - if( (insn&0x0f100010)==0x0e100010 ) - { - SetRegister(rn, arm.coproRegister[crn]); - } - /* MCR - transfer main register to copro register */ - else if( (insn&0x0f100010)==0x0e000010 ) - { - arm.coproRegister[crn]=GetRegister(rn); - - /* Data East 156 copro specific - trigger BCD operation */ - if (crn==2) - { - if (arm.coproRegister[crn]==0) - { - /* Unpack BCD */ - int v0=BCDToDecimal(arm.coproRegister[0]); - int v1=BCDToDecimal(arm.coproRegister[1]); - - /* Repack vcd */ - arm.coproRegister[5]=DecimalToBCD(v0+v1); - } - else if (arm.coproRegister[crn]==1) - { - /* Unpack BCD */ - int v0=BCDToDecimal(arm.coproRegister[0]); - int v1=BCDToDecimal(arm.coproRegister[1]); - - /* Repack vcd */ - arm.coproRegister[5]=DecimalToBCD(v0*v1); - } - else if (arm.coproRegister[crn]==3) - { - /* Unpack BCD */ - int v0=BCDToDecimal(arm.coproRegister[0]); - int v1=BCDToDecimal(arm.coproRegister[1]); - - /* Repack vcd */ - arm.coproRegister[5]=DecimalToBCD(v0-v1); - } - } - } - /* CDP - perform copro operation */ - else if( (insn&0x0f000010)==0x0e000000 ) - { - /* Data East 156 copro specific divider - result in reg 3/4 */ - if (arm.coproRegister[1]) - { - arm.coproRegister[3]=arm.coproRegister[0] / arm.coproRegister[1]; - arm.coproRegister[4]=arm.coproRegister[0] % arm.coproRegister[1]; - } - else - { - /* Unverified */ - arm.coproRegister[3]=0xffffffff; - arm.coproRegister[4]=0xffffffff; - } - } -} - -// burn some cycles -void ArmIdleCycles(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmIdleCycles called without init\n")); -#endif - - if (arm_icount > cycles) { - arm_icount -= cycles; - } else { - arm_icount = 0; - } -} - -// get the current position -unsigned int ArmGetPc(INT32) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmGetPC called without init\n")); -#endif - - return arm.sArmRegister[15]&ADDRESS_MASK; -} - -// get the remaining cycles left to run -unsigned int ArmRemainingCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmRemainingCycles called without init\n")); -#endif - - return (arm.ArmLeftCycles - arm_icount); -} - -// get the total of cycles run -int ArmGetTotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmGetTotalCycles called without init\n")); -#endif - - return arm.ArmTotalCycles + (arm.ArmLeftCycles - arm_icount); -} - -// stop the current cpu slice -void ArmRunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmRunEnd called without init\n")); -#endif - - arm_icount = 0; -} - -// start a new frame -void ArmNewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmNewFrame called without init\n")); -#endif - - arm.ArmTotalCycles = 0; - arm_icount = 0; - arm.ArmLeftCycles = 0; -} - -int ArmScan(int nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmScan called without init\n")); -#endif - - struct BurnArea ba; - - if (nAction & ACB_VOLATILE) { - memset(&ba, 0, sizeof(ba)); - ba.Data = &arm; - ba.nLen = sizeof(ARM_REGS); - ba.szName = "ARM Registers"; - BurnAcb(&ba); - - SCAN_VAR(arm_icount); - } - - return 0; -} diff --git a/jan/src/cpu/arm7/arm7.cpp b/jan/src/cpu/arm7/arm7.cpp deleted file mode 100644 index 8e38f4368..000000000 --- a/jan/src/cpu/arm7/arm7.cpp +++ /dev/null @@ -1,209 +0,0 @@ -/***************************************************************************** - * - * arm7.c - * Portable ARM7TDMI CPU Emulator - * - * Copyright Steve Ellenoff, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - * This work is based on: - * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' - * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) - * #3) Thumb support by Ryan Holtz - * - *****************************************************************************/ - -/****************************************************************************** - * Notes: - - ** This is a plain vanilla implementation of an ARM7 cpu which incorporates my ARM7 core. - It can be used as is, or used to demonstrate how to utilize the arm7 core to create a cpu - that uses the core, since there are numerous different mcu packages that incorporate an arm7 core. - - See the notes in the arm7core.c file itself regarding issues/limitations of the arm7 core. - ** -*****************************************************************************/ -#include "burnint.h" -#include "arm7core.h" -#include "arm7_intf.h" - -#if defined __GNUC__ -__extension__ typedef unsigned long long UINT64; -__extension__ typedef signed long long INT64; -#endif - -#if defined _MSC_VER -typedef unsigned long long UINT64; -typedef signed long long INT64; -#endif - -/* Example for showing how Co-Proc functions work */ -#define TEST_COPROC_FUNCS 0 - -/* prototypes */ -#if TEST_COPROC_FUNCS -static WRITE32_HANDLER(test_do_callback); -static READ32_HANDLER(test_rt_r_callback); -static WRITE32_HANDLER(test_rt_w_callback); -static void test_dt_r_callback(UINT32 insn, UINT32 *prn, UINT32 (*read32)(UINT32 addr)); -static void test_dt_w_callback(UINT32 insn, UINT32 *prn, void (*write32)(UINT32 addr, UINT32 data)); -static char *Spec_RT(char *pBuf, UINT32 opcode, char *pConditionCode, char *pBuf0); -static char *Spec_DT(char *pBuf, UINT32 opcode, char *pConditionCode, char *pBuf0); -static char *Spec_DO(char *pBuf, UINT32 opcode, char *pConditionCode, char *pBuf0); -#endif - -/* Macros that can be re-defined for custom cpu implementations - The core expects these to be defined */ -/* In this case, we are using the default arm7 handlers (supplied by the core) - - but simply changes these and define your own if needed for cpu implementation specific needs */ -#define READ8(addr) arm7_cpu_read8(addr) -#define WRITE8(addr,data) arm7_cpu_write8(addr,data) -#define READ16(addr) arm7_cpu_read16(addr) -#define WRITE16(addr,data) arm7_cpu_write16(addr,data) -#define READ32(addr) arm7_cpu_read32(addr) -#define WRITE32(addr,data) arm7_cpu_write32(addr,data) -#define PTR_READ32 &arm7_cpu_read32 -#define PTR_WRITE32 &arm7_cpu_write32 - -/* Macros that need to be defined according to the cpu implementation specific need */ -#define ARM7REG(reg) arm7.sArmRegister[reg] -#define ARM7 arm7 -#define ARM7_ICOUNT arm7_icount - -/* CPU Registers */ -typedef struct -{ - ARM7CORE_REGS // these must be included in your cpu specific register implementation -} ARM7_REGS; - -static ARM7_REGS arm7; -static int ARM7_ICOUNT; -static int total_cycles = 0; -static int curr_cycles = 0; - -void Arm7Open(int ) -{ - -} - -void Arm7Close() -{ - -} - -int Arm7TotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7TotalCycles called without init\n")); -#endif - - return total_cycles; -} - -void Arm7RunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7RunEnd called without init\n")); -#endif - - arm7_icount = 0; -} - -void Arm7BurnCycles(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7BurnCycles called without init\n")); -#endif - - arm7_icount -= cycles; -} - -void Arm7NewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7NewFrame called without init\n")); -#endif - - total_cycles = 0; -} - -/* include the arm7 core */ -#include "arm7core.c" - -/*************************************************************************** - * CPU SPECIFIC IMPLEMENTATIONS - **************************************************************************/ -/* -static void arm7_init(int ) -{ - -}*/ - -void Arm7Reset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7Reset called without init\n")); -#endif - - // must call core reset - arm7_core_reset(); -} - -/* -static void arm7_exit() -{ - -}*/ - -int Arm7Run(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7Run called without init\n")); -#endif - -/* include the arm7 core execute code */ -#include "arm7exec.c" -} - -void arm7_set_irq_line(int irqline, int state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("arm7_set_irq_line called without init\n")); -#endif - - // must call core - arm7_core_set_irq_line(irqline,state); -} - -int Arm7Scan(int nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7Scan called without init\n")); -#endif - - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - ba.Data = (unsigned char*)&ARM7; - ba.nLen = sizeof(ARM7); - ba.szName = "All Registers"; - BurnAcb(&ba); - - SCAN_VAR(ARM7_ICOUNT); - SCAN_VAR(total_cycles); - SCAN_VAR(curr_cycles); - } - - return 0; -} diff --git a/jan/src/cpu/arm7/arm7core.c b/jan/src/cpu/arm7/arm7core.c deleted file mode 100644 index 02b333cff..000000000 --- a/jan/src/cpu/arm7/arm7core.c +++ /dev/null @@ -1,1724 +0,0 @@ -/***************************************************************************** - * - * arm7core.c - * Portable ARM7TDMI Core Emulator - * - * Copyright Steve Ellenoff, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - * This work is based on: - * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' - * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) - * #3) Thumb support by Ryan Holtz - * #4) Additional Thumb support and bugfixes by R. Belmont - * - *****************************************************************************/ - -/****************************************************************************** - * Notes: - - **This core comes from my AT91 cpu core contributed to PinMAME, - but with all the AT91 specific junk removed, - which leaves just the ARM7TDMI core itself. I further removed the CPU specific MAME stuff - so you just have the actual ARM7 core itself, since many cpu's incorporate an ARM7 core, but add on - many cpu specific functionality. - - Therefore, to use the core, you simpy include this file along with the .h file into your own cpu specific - implementation, and therefore, this file shouldn't be compiled as part of your project directly. - Additionally, you will need to include arm7exec.c in your cpu's execute routine. - - For better or for worse, the code itself is very much intact from it's arm 2/3/6 origins from - Bryan & Phil's work. I contemplated merging it in, but thought the fact that the CPSR is - no longer part of the PC was enough of a change to make it annoying to merge. - ** - - Coprocessor functions are heavily implementation specific, so callback handlers are used to allow the - implementation to handle the functionality. Custom DASM handlers are included as well to allow the DASM - output to be tailored to the co-proc implementation details. - - Todo: - 26 bit compatibility mode not implemented. - Data Processing opcodes need cycle count adjustments (see page 194 of ARM7TDMI manual for instruction timing summary) - Multi-emulated cpu support untested, but probably will not work too well, as no effort was made to code for more than 1. - Could not find info on what the TEQP opcode is from page 44.. - I have no idea if user bank switching is right, as I don't fully understand it's use. - Search for Todo: tags for remaining items not done. - - - Differences from Arm 2/3 (6 also?) - -Thumb instruction support - -Full 32 bit address support - -PC no longer contains CPSR information, CPSR is own register now - -New register SPSR to store previous contents of CPSR (this register is banked in many modes) - -New opcodes for CPSR transfer, Long Multiplication, Co-Processor support, and some others - -User Bank Mode transfer using certain flags which were previously unallowed (LDM/STM with S Bit & R15) - -New operation modes? (unconfirmed) - - Based heavily on arm core from MAME 0.76: - ***************************************** - ARM 2/3/6 Emulation - - Todo: - Software interrupts unverified (nothing uses them so far, but they should be ok) - Timing - Currently very approximated, nothing relies on proper timing so far. - IRQ timing not yet correct (again, nothing is affected by this so far). - - By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino -*****************************************************************************/ - -#include -//#include "deprecat.h" - -#define ARM7_DEBUG_CORE 0 -#define logerror printf -#define fatalerror logerror - -#if 0 -#define LOG(x) mame_printf_debug x -#else -#define LOG(x) logerror x -#endif - -#define ARM7_INLINE static inline - -/* Prototypes */ - -// SJE: should these be inline? or are they too big to see any benefit? - -static void HandleCoProcDO(UINT32 insn); -static void HandleCoProcRT(UINT32 insn); -static void HandleCoProcDT(UINT32 insn); -static void HandleHalfWordDT(UINT32 insn); -static void HandleSwap(UINT32 insn); -static void HandlePSRTransfer(UINT32 insn); -static void HandleALU(UINT32 insn); -static void HandleMul(UINT32 insn); -static void HandleUMulLong(UINT32 insn); -static void HandleSMulLong(UINT32 insn); -ARM7_INLINE void HandleBranch(UINT32 insn); // pretty short, so ARM7_INLINE should be ok -static void HandleMemSingle(UINT32 insn); -static void HandleMemBlock(UINT32 insn); -static UINT32 decodeShift(UINT32 insn, UINT32 *pCarry); -ARM7_INLINE void SwitchMode(int); -static void arm7_check_irq_state(void); - -ARM7_INLINE void arm7_cpu_write32(UINT32 addr, UINT32 data); -ARM7_INLINE void arm7_cpu_write16(UINT32 addr, UINT16 data); -ARM7_INLINE void arm7_cpu_write8(UINT32 addr, UINT8 data); -ARM7_INLINE UINT32 arm7_cpu_read32(UINT32 addr); -ARM7_INLINE UINT16 arm7_cpu_read16(UINT32 addr); -ARM7_INLINE UINT8 arm7_cpu_read8(UINT32 addr); - -/* Static Vars */ -// Note: for multi-cpu implementation, this approach won't work w/o modification -void((*arm7_coproc_do_callback)(unsigned int, unsigned int)); // holder for the co processor Data Operations Callback func. -unsigned int((*arm7_coproc_rt_r_callback)(unsigned int)); // holder for the co processor Register Transfer Read Callback func. -void((*arm7_coproc_rt_w_callback)(unsigned int, unsigned int)); // holder for the co processor Register Transfer Write Callback Callback func. -// holder for the co processor Data Transfer Read & Write Callback funcs -void (*arm7_coproc_dt_r_callback)(UINT32 insn, UINT32 *prn, UINT32 (*read32)(UINT32 addr)); -void (*arm7_coproc_dt_w_callback)(UINT32 insn, UINT32 *prn, void (*write32)(UINT32 addr, UINT32 data)); - - -/*************************************************************************** - * Default Memory Handlers - ***************************************************************************/ -ARM7_INLINE void arm7_cpu_write32(UINT32 addr, UINT32 data) -{ - addr &= ~3; - Arm7WriteLong(addr, data); -} - - -ARM7_INLINE void arm7_cpu_write16(UINT32 addr, UINT16 data) -{ - addr &= ~1; - Arm7WriteWord(addr, data); -} - -ARM7_INLINE void arm7_cpu_write8(UINT32 addr, UINT8 data) -{ - Arm7WriteByte(addr, data); -} - -ARM7_INLINE UINT32 arm7_cpu_read32(UINT32 addr) -{ - UINT32 result; - - if (addr & 3) - { - result = Arm7ReadLong(addr & ~3); - result = (result >> (8 * (addr & 3))) | (result << (32 - (8 * (addr & 3)))); - } - else - { - result = Arm7ReadLong(addr); - } - - return result; -} - -ARM7_INLINE UINT16 arm7_cpu_read16(UINT32 addr) -{ - UINT16 result; - - result = Arm7ReadWord(addr & ~1); - - if (addr & 1) - { - result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); - } - - return result; -} - -ARM7_INLINE UINT8 arm7_cpu_read8(UINT32 addr) -{ - UINT8 result = Arm7ReadByte(addr); - - // Handle through normal 8 bit handler (for 32 bit cpu) - return result; -} - -ARM7_INLINE UINT32 cpu_readop32(UINT32 addr) -{ - UINT32 result; - - if (addr & 3) - { - result = Arm7FetchLong(addr & ~3); - result = (result >> (8 * (addr & 3))) | (result << (32 - (8 * (addr & 3)))); - } - else - { - result = Arm7FetchLong(addr); - } - - return result; -} - -ARM7_INLINE UINT32 cpu_readop16(UINT32 addr) -{ - UINT16 result; - - result = Arm7FetchWord(addr & ~1); - - if (addr & 1) - { - result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); - } - - return result; -} - -/*************** - * helper funcs - ***************/ - -// TODO LD: -// - SIGN_BITS_DIFFER = THUMB_SIGN_BITS_DIFFER -// - do while (0) -// - HandleALUAddFlags = HandleThumbALUAddFlags except for PC incr -// - HandleALUSubFlags = HandleThumbALUSubFlags except for PC incr - -/* Set NZCV flags for ADDS / SUBS */ -#define HandleALUAddFlags(rd, rn, op2) \ - if (insn & INSN_S) \ - SET_CPSR(((GET_CPSR & ~(N_MASK | Z_MASK | V_MASK | C_MASK)) \ - | (((!SIGN_BITS_DIFFER(rn, op2)) && SIGN_BITS_DIFFER(rn, rd)) << V_BIT) \ - | (((~(rn)) < (op2)) << C_BIT) \ - | HandleALUNZFlags(rd))); \ - R15 += 4; - -#define HandleThumbALUAddFlags(rd, rn, op2) \ - SET_CPSR(((GET_CPSR & ~(N_MASK | Z_MASK | V_MASK | C_MASK)) \ - | (((!THUMB_SIGN_BITS_DIFFER(rn, op2)) && THUMB_SIGN_BITS_DIFFER(rn, rd)) << V_BIT) \ - | (((~(rn)) < (op2)) << C_BIT) \ - | HandleALUNZFlags(rd))); \ - R15 += 2; - -#define IsNeg(i) ((i) >> 31) -#define IsPos(i) ((~(i)) >> 31) - -#define HandleALUSubFlags(rd, rn, op2) \ - if (insn & INSN_S) \ - SET_CPSR(((GET_CPSR & ~(N_MASK | Z_MASK | V_MASK | C_MASK)) \ - | ((SIGN_BITS_DIFFER(rn, op2) && SIGN_BITS_DIFFER(rn, rd)) << V_BIT) \ - | (((IsNeg(rn) & IsPos(op2)) | (IsNeg(rn) & IsPos(rd)) | (IsPos(op2) & IsPos(rd))) ? C_MASK : 0) \ - | HandleALUNZFlags(rd))); \ - R15 += 4; - -#define HandleThumbALUSubFlags(rd, rn, op2) \ - SET_CPSR(((GET_CPSR & ~(N_MASK | Z_MASK | V_MASK | C_MASK)) \ - | ((THUMB_SIGN_BITS_DIFFER(rn, op2) && THUMB_SIGN_BITS_DIFFER(rn, rd)) << V_BIT) \ - | (((IsNeg(rn) & IsPos(op2)) | (IsNeg(rn) & IsPos(rd)) | (IsPos(op2) & IsPos(rd))) ? C_MASK : 0) \ - | HandleALUNZFlags(rd))); \ - R15 += 2; - -/* Set NZC flags for logical operations. */ - -// This macro (which I didn't write) - doesn't make it obvious that the SIGN BIT = 31, just as the N Bit does, -// therefore, N is set by default -#define HandleALUNZFlags(rd) \ - (((rd) & SIGN_BIT) | ((!(rd)) << Z_BIT)) - - -// Long ALU Functions use bit 63 -#define HandleLongALUNZFlags(rd) \ - ((((rd) & ((UINT64)1 << 63)) >> 32) | ((!(rd)) << Z_BIT)) - -#define HandleALULogicalFlags(rd, sc) \ - if (insn & INSN_S) \ - SET_CPSR(((GET_CPSR & ~(N_MASK | Z_MASK | C_MASK)) \ - | HandleALUNZFlags(rd) \ - | (((sc) != 0) << C_BIT))); \ - R15 += 4; - -// convert cpsr mode num into to text -static const char modetext[ARM7_NUM_MODES][5] = { - "USER", "FIRQ", "IRQ", "SVC", "ILL1", "ILL2", "ILL3", "ABT", - "ILL4", "ILL5", "ILL6", "UND", "ILL7", "ILL8", "ILL9", "SYS" -}; - -/*static const char *GetModeText(int cpsr) -{ - return modetext[cpsr & MODE_FLAG]; -}*/ - -// used to be functions, but no longer a need, so we'll use define for better speed. -#define GetRegister(rIndex) ARM7REG(sRegisterTable[GET_MODE][rIndex]) -#define SetRegister(rIndex, value) ARM7REG(sRegisterTable[GET_MODE][rIndex]) = value - -// I could prob. convert to macro, but Switchmode shouldn't occur that often in emulated code.. -ARM7_INLINE void SwitchMode(int cpsr_mode_val) -{ - UINT32 cspr = GET_CPSR & ~MODE_FLAG; - SET_CPSR(cspr | cpsr_mode_val); -} - - -/* Decodes an Op2-style shifted-register form. If @carry@ is non-zero the - * shifter carry output will manifest itself as @*carry == 0@ for carry clear - * and @*carry != 0@ for carry set. - - SJE: Rules: - IF RC = 256, Result = no shift. - LSL 0 = Result = RM, Carry = Old Contents of CPSR C Bit - LSL(0,31) = Result shifted, least significant bit is in carry out - LSL 32 = Result of 0, Carry = Bit 0 of RM - LSL >32 = Result of 0, Carry out 0 - LSR 0 = LSR 32 (see below) - LSR 32 = Result of 0, Carry = Bit 31 of RM - LSR >32 = Result of 0, Carry out 0 - ASR >=32 = ENTIRE Result = bit 31 of RM - ROR 32 = Result = RM, Carry = Bit 31 of RM - ROR >32 = Same result as ROR n-32 until amount in range of 1-32 then follow rules -*/ - -static UINT32 decodeShift(UINT32 insn, UINT32 *pCarry) -{ - UINT32 k = (insn & INSN_OP2_SHIFT) >> INSN_OP2_SHIFT_SHIFT; // Bits 11-7 - UINT32 rm = GET_REGISTER(insn & INSN_OP2_RM); - UINT32 t = (insn & INSN_OP2_SHIFT_TYPE) >> INSN_OP2_SHIFT_TYPE_SHIFT; - - if ((insn & INSN_OP2_RM) == 0xf) { - rm += 8; - } - - /* All shift types ending in 1 are Rk, not #k */ - if (t & 1) - { -// LOG(("%08x: RegShift %02x %02x\n", R15, k >> 1, GET_REGISTER(k >> 1))); -#if ARM7_DEBUG_CORE - if ((insn & 0x80) == 0x80) - LOG(("%08x: RegShift ERROR (p36)\n", R15)); -#endif - - // see p35 for check on this - //k = GET_REGISTER(k >> 1) & 0x1f; - - // Keep only the bottom 8 bits for a Register Shift - k = GET_REGISTER(k >> 1) & 0xff; - - if (k == 0) /* Register shift by 0 is a no-op */ - { -// LOG(("%08x: NO-OP Regshift\n", R15)); - /* TODO this is wrong for at least ROR by reg with lower - * 5 bits 0 but lower 8 bits non zero */ - if (pCarry) - *pCarry = GET_CPSR & C_MASK; - return rm; - } - } - /* Decode the shift type and perform the shift */ - switch (t >> 1) - { - case 0: /* LSL */ - // LSL 32 = Result of 0, Carry = Bit 0 of RM - // LSL >32 = Result of 0, Carry out 0 - if (k >= 32) - { - if (pCarry) - *pCarry = (k == 32) ? rm & 1 : 0; - return 0; - } - else - { - if (pCarry) - { - // LSL 0 = Result = RM, Carry = Old Contents of CPSR C Bit - // LSL (0,31) = Result shifted, least significant bit is in carry out - *pCarry = k ? (rm & (1 << (32 - k))) : (GET_CPSR & C_MASK); - } - return k ? LSL(rm, k) : rm; - } - break; - - case 1: /* LSR */ - if (k == 0 || k == 32) - { - if (pCarry) - *pCarry = rm & SIGN_BIT; - return 0; - } - else if (k > 32) - { - if (pCarry) - *pCarry = 0; - return 0; - } - else - { - if (pCarry) - *pCarry = (rm & (1 << (k - 1))); - return LSR(rm, k); - } - break; - - case 2: /* ASR */ - if (k == 0 || k > 32) - k = 32; - - if (pCarry) - *pCarry = (rm & (1 << (k - 1))); - if (k >= 32) - return rm & SIGN_BIT ? 0xffffffffu : 0; - else - { - if (rm & SIGN_BIT) - return LSR(rm, k) | (0xffffffffu << (32 - k)); - else - return LSR(rm, k); - } - break; - - case 3: /* ROR and RRX */ - if (k) - { - while (k > 32) - k -= 32; - if (pCarry) - *pCarry = rm & (1 << (k - 1)); - return ROR(rm, k); - } - else - { - /* RRX */ - if (pCarry) - *pCarry = (rm & 1); - return LSR(rm, 1) | ((GET_CPSR & C_MASK) << 2); - } - break; - } - - LOG(("%08x: Decodeshift error\n", R15)); - return 0; -} /* decodeShift */ - - -static int loadInc(UINT32 pat, UINT32 rbv, UINT32 s) -{ - int i, result; - - result = 0; - rbv &= ~3; - for (i = 0; i < 16; i++) - { - if ((pat >> i) & 1) - { - if (i == 15) { - if (s) /* Pull full contents from stack */ - SET_REGISTER(15, READ32(rbv += 4)); - else /* Pull only address, preserve mode & status flags */ - SET_REGISTER(15, READ32(rbv += 4)); - } else - SET_REGISTER(i, READ32(rbv += 4)); - - result++; - } - } - return result; -} - -static int loadDec(UINT32 pat, UINT32 rbv, UINT32 s) -{ - int i, result; - - result = 0; - rbv &= ~3; - for (i = 15; i >= 0; i--) - { - if ((pat >> i) & 1) - { - if (i == 15) { - if (s) /* Pull full contents from stack */ - SET_REGISTER(15, READ32(rbv -= 4)); - else /* Pull only address, preserve mode & status flags */ - SET_REGISTER(15, READ32(rbv -= 4)); - } - else - SET_REGISTER(i, READ32(rbv -= 4)); - result++; - } - } - return result; -} - -static int storeInc(UINT32 pat, UINT32 rbv) -{ - int i, result; - - result = 0; - for (i = 0; i < 16; i++) - { - if ((pat >> i) & 1) - { -#if ARM7_DEBUG_CORE - if (i == 15) /* R15 is plus 12 from address of STM */ - LOG(("%08x: StoreInc on R15\n", R15)); -#endif - WRITE32(rbv += 4, GET_REGISTER(i)); - result++; - } - } - return result; -} /* storeInc */ - -static int storeDec(UINT32 pat, UINT32 rbv) -{ - int i, result; - - result = 0; - for (i = 15; i >= 0; i--) - { - if ((pat >> i) & 1) - { -#if ARM7_DEBUG_CORE - if (i == 15) /* R15 is plus 12 from address of STM */ - LOG(("%08x: StoreDec on R15\n", R15)); -#endif - WRITE32(rbv -= 4, GET_REGISTER(i)); - result++; - } - } - return result; -} /* storeDec */ - -/*************************************************************************** - * Main CPU Funcs - ***************************************************************************/ - -// CPU INIT -#if 0 -static void arm7_core_init(const char *cpuname, int index) -{ - state_save_register_item_array(cpuname, index, ARM7.sArmRegister); - state_save_register_item(cpuname, index, ARM7.pendingIrq); - state_save_register_item(cpuname, index, ARM7.pendingFiq); - state_save_register_item(cpuname, index, ARM7.pendingAbtD); - state_save_register_item(cpuname, index, ARM7.pendingAbtP); - state_save_register_item(cpuname, index, ARM7.pendingUnd); - state_save_register_item(cpuname, index, ARM7.pendingSwi); -} -#endif - -// CPU RESET -static void arm7_core_reset(void) -{ - int (*save_irqcallback)(int) = ARM7.irq_callback; - - memset(&ARM7, 0, sizeof(ARM7)); - ARM7.irq_callback = save_irqcallback; - - /* start up in SVC mode with interrupts disabled. */ - SwitchMode(eARM7_MODE_SVC); - SET_CPSR(GET_CPSR | I_MASK | F_MASK | 0x10); - R15 = 0; -// change_pc(R15); -} - -// Execute used to be here.. moved to separate file (arm7exec.c) to be included by cpu cores separately - -// CPU CHECK IRQ STATE -// Note: couldn't find any exact cycle counts for most of these exceptions -static void arm7_check_irq_state(void) -{ - UINT32 cpsr = GET_CPSR; /* save current CPSR */ - UINT32 pc = R15 + 4; /* save old pc (already incremented in pipeline) */; - - /* Exception priorities: - - Reset - Data abort - FIRQ - IRQ - Prefetch abort - Undefined instruction - Software Interrupt - */ - - // Data Abort - if (ARM7.pendingAbtD) { - SwitchMode(eARM7_MODE_ABT); /* Set ABT mode so PC is saved to correct R14 bank */ - SET_REGISTER(14, pc); /* save PC to R14 */ - SET_REGISTER(SPSR, cpsr); /* Save current CPSR */ - SET_CPSR(GET_CPSR | I_MASK); /* Mask IRQ */ - SET_CPSR(GET_CPSR & ~T_MASK); - R15 = 0x10; /* IRQ Vector address */ -// change_pc(R15); - ARM7.pendingAbtD = 0; - return; - } - - // FIQ - if (ARM7.pendingFiq && (cpsr & F_MASK) == 0) { - SwitchMode(eARM7_MODE_FIQ); /* Set FIQ mode so PC is saved to correct R14 bank */ - SET_REGISTER(14, pc); /* save PC to R14 */ - SET_REGISTER(SPSR, cpsr); /* Save current CPSR */ - SET_CPSR(GET_CPSR | I_MASK | F_MASK); /* Mask both IRQ & FIQ */ - SET_CPSR(GET_CPSR & ~T_MASK); - R15 = 0x1c; /* IRQ Vector address */ - // change_pc(R15); - return; - } - - // IRQ - if (ARM7.pendingIrq && (cpsr & I_MASK) == 0) { - SwitchMode(eARM7_MODE_IRQ); /* Set IRQ mode so PC is saved to correct R14 bank */ - SET_REGISTER(14, pc); /* save PC to R14 */ - SET_REGISTER(SPSR, cpsr); /* Save current CPSR */ - SET_CPSR(GET_CPSR | I_MASK); /* Mask IRQ */ - SET_CPSR(GET_CPSR & ~T_MASK); - R15 = 0x18; /* IRQ Vector address */ - // change_pc(R15); - return; - } - - // Prefetch Abort - if (ARM7.pendingAbtP) { - SwitchMode(eARM7_MODE_ABT); /* Set ABT mode so PC is saved to correct R14 bank */ - SET_REGISTER(14, pc); /* save PC to R14 */ - SET_REGISTER(SPSR, cpsr); /* Save current CPSR */ - SET_CPSR(GET_CPSR | I_MASK); /* Mask IRQ */ - SET_CPSR(GET_CPSR & ~T_MASK); - R15 = 0x0c; /* IRQ Vector address */ - // change_pc(R15); - ARM7.pendingAbtP = 0; - return; - } - - // Undefined instruction - if (ARM7.pendingUnd) { - SwitchMode(eARM7_MODE_UND); /* Set UND mode so PC is saved to correct R14 bank */ - SET_REGISTER(14, pc); /* save PC to R14 */ - SET_REGISTER(SPSR, cpsr); /* Save current CPSR */ - SET_CPSR(GET_CPSR | I_MASK); /* Mask IRQ */ - SET_CPSR(GET_CPSR & ~T_MASK); - R15 = 0x04; /* IRQ Vector address */ - // change_pc(R15); - ARM7.pendingUnd = 0; - return; - } - - // Software Interrupt - if (ARM7.pendingSwi) { - SwitchMode(eARM7_MODE_SVC); /* Set SVC mode so PC is saved to correct R14 bank */ - // compensate for prefetch (should this also be done for normal IRQ?) - if (T_IS_SET(GET_CPSR)) - { - SET_REGISTER(14, pc-2); /* save PC to R14 */ - } - else - { - SET_REGISTER(14, pc); /* save PC to R14 */ - } - SET_REGISTER(SPSR, cpsr); /* Save current CPSR */ - SET_CPSR(GET_CPSR | I_MASK); /* Mask IRQ */ - SET_CPSR(GET_CPSR & ~T_MASK); /* Go to ARM mode */ - R15 = 0x08; /* Jump to the SWI vector */ - // change_pc(R15); - ARM7.pendingSwi = 0; - return; - } -} - -// CPU - SET IRQ LINE -static void arm7_core_set_irq_line(int irqline, int state) -{ - switch (irqline) { - - case ARM7_IRQ_LINE: /* IRQ */ - ARM7.pendingIrq = state & 1; - break; - - case ARM7_FIRQ_LINE: /* FIRQ */ - ARM7.pendingFiq = state & 1; - break; - - case ARM7_ABORT_EXCEPTION: - ARM7.pendingAbtD = state & 1; - break; - case ARM7_ABORT_PREFETCH_EXCEPTION: - ARM7.pendingAbtP = state & 1; - break; - - case ARM7_UNDEFINE_EXCEPTION: - ARM7.pendingUnd = state & 1; - break; - } - - ARM7_CHECKIRQ; -} - -/*************************************************************************** - * OPCODE HANDLING - ***************************************************************************/ - -// Co-Processor Data Operation -static void HandleCoProcDO(UINT32 insn) -{ - // This instruction simply instructs the co-processor to do something, no data is returned to ARM7 core - if (arm7_coproc_do_callback) - arm7_coproc_do_callback(0, insn); // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation - else - LOG(("%08x: Co-Processor Data Operation executed, but no callback defined!\n", R15)); -} - -// Co-Processor Register Transfer - To/From Arm to Co-Proc -static void HandleCoProcRT(UINT32 insn) -{ - - /* xxxx 1110 oooL nnnn dddd cccc ppp1 mmmm */ - - // Load (MRC) data from Co-Proc to ARM7 register - if (insn & 0x00100000) // Bit 20 = Load or Store - { - if (arm7_coproc_rt_r_callback) - { - UINT32 res = arm7_coproc_rt_r_callback(insn); // RT Read handler must parse opcode & return appropriate result - SET_REGISTER((insn >> 12) & 0xf, res); - } - else - LOG(("%08x: Co-Processor Register Transfer executed, but no RT Read callback defined!\n", R15)); - } - // Store (MCR) data from ARM7 to Co-Proc register - else - { - if (arm7_coproc_rt_r_callback) - ; // arm7_coproc_rt_w_callback(insn, GET_REGISTER((insn >> 12) & 0xf), 0); - else - LOG(("%08x: Co-Processor Register Transfer executed, but no RT Write callback defined!\n", R15)); - } -} - -/* Data Transfer - To/From Arm to Co-Proc - Loading or Storing, the co-proc function is responsible to read/write from the base register supplied + offset - 8 bit immediate value Base Offset address is << 2 to get the actual # - - issues - #1 - the co-proc function, needs direct access to memory reads or writes (ie, so we must send a pointer to a func) - - #2 - the co-proc may adjust the base address (especially if it reads more than 1 word), so a pointer to the register must be used - but the old value of the register must be restored if write back is not set.. - - #3 - when post incrementing is used, it's up to the co-proc func. to add the offset, since the transfer - address supplied in that case, is simply the base. I suppose this is irrelevant if write back not set - but if co-proc reads multiple address, it must handle the offset adjustment itself. -*/ -// todo: test with valid instructions -static void HandleCoProcDT(UINT32 insn) -{ - UINT32 rn = (insn >> 16) & 0xf; - UINT32 rnv = GET_REGISTER(rn); // Get Address Value stored from Rn - UINT32 ornv = rnv; // Keep value of Rn - UINT32 off = (insn & 0xff) << 2; // Offset is << 2 according to manual - UINT32 *prn = &ARM7REG(rn); // Pointer to our register, so it can be changed in the callback - - // Pointers to read32/write32 functions - void (*write32)(UINT32 addr, UINT32 data); - UINT32 (*read32)(UINT32 addr); - write32 = PTR_WRITE32; - read32 = PTR_READ32; - -#if ARM7_DEBUG_CORE - if (((insn >> 16) & 0xf) == 15 && (insn & 0x200000)) - LOG(("%08x: Illegal use of R15 as base for write back value!\n", R15)); -#endif - - // Pre-Increment base address (IF POST INCREMENT - CALL BACK FUNCTION MUST DO IT) - if ((insn & 0x1000000) && off) - { - // Up - Down bit - if (insn & 0x800000) - rnv += off; - else - rnv -= off; - } - - // Load (LDC) data from ARM7 memory to Co-Proc memory - if (insn & 0x00100000) - { - if (arm7_coproc_dt_r_callback) - arm7_coproc_dt_r_callback(insn, prn, read32); - else - LOG(("%08x: Co-Processer Data Transfer executed, but no READ callback defined!\n", R15)); - } - // Store (STC) data from Co-Proc to ARM7 memory - else - { - if (arm7_coproc_dt_w_callback) - arm7_coproc_dt_w_callback(insn, prn, write32); - else - LOG(("%08x: Co-Processer Data Transfer executed, but no WRITE callback defined!\n", R15)); - } - - // If writeback not used - ensure the original value of RN is restored in case co-proc callback changed value - if ((insn & 0x200000) == 0) - SET_REGISTER(rn, ornv); -} - -static void HandleBranch(UINT32 insn) -{ - UINT32 off = (insn & INSN_BRANCH) << 2; - - /* Save PC into LR if this is a branch with link */ - if (insn & INSN_BL) - { - SET_REGISTER(14, R15 + 4); - } - - /* Sign-extend the 24-bit offset in our calculations */ - if (off & 0x2000000u) - { - R15 -= ((~(off | 0xfc000000u)) + 1) - 8; - } - else - { - R15 += off + 8; - } - -// change_pc(R15); -} - -static void HandleMemSingle(UINT32 insn) -{ - UINT32 rn, rnv, off, rd; - - /* Fetch the offset */ - if (insn & INSN_I) - { - /* Register Shift */ - off = decodeShift(insn, NULL); - } - else - { - /* Immediate Value */ - off = insn & INSN_SDT_IMM; - } - - /* Calculate Rn, accounting for PC */ - rn = (insn & INSN_RN) >> INSN_RN_SHIFT; - - if (insn & INSN_SDT_P) - { - /* Pre-indexed addressing */ - if (insn & INSN_SDT_U) - { - rnv = (GET_REGISTER(rn) + off); - } - else - { - rnv = (GET_REGISTER(rn) - off); - } - - if (insn & INSN_SDT_W) - { - SET_REGISTER(rn, rnv); - - // check writeback??? - } - else if (rn == eR15) - { - rnv = rnv + 8; - } - } - else - { - /* Post-indexed addressing */ - if (rn == eR15) - { - rnv = R15 + 8; - } - else - { - rnv = GET_REGISTER(rn); - } - } - - /* Do the transfer */ - rd = (insn & INSN_RD) >> INSN_RD_SHIFT; - if (insn & INSN_SDT_L) - { - /* Load */ - if (insn & INSN_SDT_B) - { - SET_REGISTER(rd, (UINT32)READ8(rnv)); - } - else - { - if (rd == eR15) - { - R15 = READ32(rnv); - R15 -= 4; - // change_pc(R15); - // LDR, PC takes 2S + 2N + 1I (5 total cycles) - ARM7_ICOUNT -= 2; - } - else - { - SET_REGISTER(rd, READ32(rnv)); - } - } - } - else - { - /* Store */ - if (insn & INSN_SDT_B) - { -#if ARM7_DEBUG_CORE - if (rd == eR15) - LOG(("Wrote R15 in byte mode\n")); -#endif - - WRITE8(rnv, (UINT8) GET_REGISTER(rd) & 0xffu); - } - else - { -#if ARM7_DEBUG_CORE - if (rd == eR15) - LOG(("Wrote R15 in 32bit mode\n")); -#endif - - //WRITE32(rnv, rd == eR15 ? R15 + 8 : GET_REGISTER(rd)); - WRITE32(rnv, rd == eR15 ? R15 + 8 + 4 : GET_REGISTER(rd)); // manual says STR rd = PC, +12 - } - // Store takes only 2 N Cycles, so add + 1 - ARM7_ICOUNT += 1; - } - - /* Do post-indexing writeback */ - if (!(insn & INSN_SDT_P)/* && (insn & INSN_SDT_W)*/) - { - if (insn & INSN_SDT_U) - { - /* Writeback is applied in pipeline, before value is read from mem, - so writeback is effectively ignored */ - if (rd == rn) { - SET_REGISTER(rn, GET_REGISTER(rd)); - // todo: check for offs... ? - } - else { - - if ((insn & INSN_SDT_W) != 0) - LOG(("%08x: RegisterWritebackIncrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0)); - - SET_REGISTER(rn, (rnv + off)); - } - } - else - { - /* Writeback is applied in pipeline, before value is read from mem, - so writeback is effectively ignored */ - if (rd == rn) { - SET_REGISTER(rn, GET_REGISTER(rd)); - } - else { - SET_REGISTER(rn, (rnv - off)); - - if ((insn & INSN_SDT_W) != 0) - LOG(("%08x: RegisterWritebackDecrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0)); - } - } - } - -// ARM7_CHECKIRQ - -} /* HandleMemSingle */ - -static void HandleHalfWordDT(UINT32 insn) -{ - UINT32 rn, rnv, off, rd; - - // Immediate or Register Offset? - if (insn & 0x400000) { // Bit 22 - 1 = immediate, 0 = register - // imm. value in high nibble (bits 8-11) and lo nibble (bit 0-3) - off = (((insn >> 8) & 0x0f) << 4) | (insn & 0x0f); - } - else { - // register - off = GET_REGISTER(insn & 0x0f); - } - - /* Calculate Rn, accounting for PC */ - rn = (insn & INSN_RN) >> INSN_RN_SHIFT; - - if (insn & INSN_SDT_P) - { - /* Pre-indexed addressing */ - if (insn & INSN_SDT_U) - { - rnv = (GET_REGISTER(rn) + off); - } - else - { - rnv = (GET_REGISTER(rn) - off); - } - - if (insn & INSN_SDT_W) - { - SET_REGISTER(rn, rnv); - - // check writeback??? - } - else if (rn == eR15) - { - rnv = (rnv) + 8; - } - } - else - { - /* Post-indexed addressing */ - if (rn == eR15) - { - rnv = R15 + 8; - } - else - { - rnv = GET_REGISTER(rn); - } - } - - /* Do the transfer */ - rd = (insn & INSN_RD) >> INSN_RD_SHIFT; - - /* Load */ - if (insn & INSN_SDT_L) - { - // Signed? - if (insn & 0x40) - { - UINT32 newval = 0; - - // Signed Half Word? - if (insn & 0x20) { - UINT16 signbyte, databyte; - databyte = READ16(rnv) & 0xFFFF; - signbyte = (databyte & 0x8000) ? 0xffff : 0; - newval = (UINT32)(signbyte << 16)|databyte; - } - // Signed Byte - else { - UINT8 databyte; - UINT32 signbyte; - databyte = READ8(rnv) & 0xff; - signbyte = (databyte & 0x80) ? 0xffffff : 0; - newval = (UINT32)(signbyte << 8)|databyte; - } - - // PC? - if (rd == eR15) - { - R15 = newval + 8; - // LDR(H,SH,SB) PC takes 2S + 2N + 1I (5 total cycles) - ARM7_ICOUNT -= 2; - - } - else - { - SET_REGISTER(rd, newval); - R15 += 4; - } - } - // Unsigned Half Word - else - { - if (rd == eR15) - { - R15 = READ16(rnv) + 8; - } - else - { - SET_REGISTER(rd, READ16(rnv)); - R15 += 4; - } - } - - - } - /* Store */ - else - { - // WRITE16(rnv, rd == eR15 ? R15 + 8 : GET_REGISTER(rd)); - WRITE16(rnv, rd == eR15 ? R15 + 8 + 4 : GET_REGISTER(rd)); // manual says STR RD=PC, +12 of address - if (rn != eR15) - R15 += 4; - // STRH takes 2 cycles, so we add + 1 - ARM7_ICOUNT += 1; - } - - - - // SJE: No idea if this writeback code works or makes sense here.. - - /* Do post-indexing writeback */ - if (!(insn & INSN_SDT_P)/* && (insn & INSN_SDT_W)*/) - { - if (insn & INSN_SDT_U) - { - /* Writeback is applied in pipeline, before value is read from mem, - so writeback is effectively ignored */ - if (rd == rn) { - SET_REGISTER(rn, GET_REGISTER(rd)); - // todo: check for offs... ? - } - else { - - if ((insn & INSN_SDT_W) != 0) - LOG(("%08x: RegisterWritebackIncrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0)); - - SET_REGISTER(rn, (rnv + off)); - } - } - else - { - /* Writeback is applied in pipeline, before value is read from mem, - so writeback is effectively ignored */ - if (rd == rn) { - SET_REGISTER(rn, GET_REGISTER(rd)); - } - else { - SET_REGISTER(rn, (rnv - off)); - - if ((insn & INSN_SDT_W) != 0) - LOG(("%08x: RegisterWritebackDecrement %d %d %d\n", R15, (insn & INSN_SDT_P) != 0, (insn & INSN_SDT_W) != 0, (insn & INSN_SDT_U) != 0)); - } - } - } - // change_pc(R15); -} - -static void HandleSwap(UINT32 insn) -{ - UINT32 rn, rm, rd, tmp; - - rn = GET_REGISTER((insn >> 16) & 0xf); // reg. w/read address - rm = GET_REGISTER(insn & 0xf); // reg. w/write address - rd = (insn >> 12) & 0xf; // dest reg - -#if ARM7_DEBUG_CORE - if (rn == 15 || rm == 15 || rd == 15) - LOG(("%08x: Illegal use of R15 in Swap Instruction\n", R15)); -#endif - - // can be byte or word - if (insn & 0x400000) - { - tmp = READ8(rn); - WRITE8(rn, rm); - SET_REGISTER(rd, tmp); - } - else - { - tmp = READ32(rn); - WRITE32(rn, rm); - SET_REGISTER(rd, tmp); - } - - R15 += 4; - // Instruction takes 1S+2N+1I cycles - so we subtract one more.. - ARM7_ICOUNT -= 1; -} - -static void HandlePSRTransfer(UINT32 insn) -{ - int reg = (insn & 0x400000) ? SPSR : eCPSR; // Either CPSR or SPSR - UINT32 newval, val = 0; - UINT32 oldmode = GET_CPSR & MODE_FLAG; - - // get old value of CPSR/SPSR - newval = GET_REGISTER(reg); - - // MSR (bit 21 set) - Copy value to CPSR/SPSR - if ((insn & 0x00200000)) - { - // Immediate Value? - if (insn & INSN_I) { - // Value can be specified for a Right Rotate, 2x the value specified. - int by = (insn & INSN_OP2_ROTATE) >> INSN_OP2_ROTATE_SHIFT; - if (by) - val = ROR(insn & INSN_OP2_IMM, by << 1); - else - val = insn & INSN_OP2_IMM; - } - // Value from Register - else - { - val = GET_REGISTER(insn & 0x0f); - } - - // apply field code bits - if (reg == eCPSR) - { - if (oldmode != eARM7_MODE_USER) - { - if (insn & 0x00010000) - { - newval = (newval & 0xffffff00) | (val & 0x000000ff); - } - if (insn & 0x00020000) - { - newval = (newval & 0xffff00ff) | (val & 0x0000ff00); - } - if (insn & 0x00040000) - { - newval = (newval & 0xff00ffff) | (val & 0x00ff0000); - } - } - - // status flags can be modified regardless of mode - if (insn & 0x00080000) - { - // TODO for non ARMv5E mask should be 0xf0000000 (ie mask Q bit) - newval = (newval & 0x00ffffff) | (val & 0xf8000000); - } - } - else // SPSR has stricter requirements - { - if (((GET_CPSR & 0x1f) > 0x10) && ((GET_CPSR & 0x1f) < 0x1f)) - { - if (insn & 0x00010000) - { - newval = (newval & 0xffffff00) | (val & 0xff); - } - if (insn & 0x00020000) - { - newval = (newval & 0xffff00ff) | (val & 0xff00); - } - if (insn & 0x00040000) - { - newval = (newval & 0xff00ffff) | (val & 0xff0000); - } - if (insn & 0x00080000) - { - // TODO for non ARMv5E mask should be 0xf0000000 (ie mask Q bit) - newval = (newval & 0x00ffffff) | (val & 0xf8000000); - } - } - } - - // force valid mode - newval |= 0x10; - - // Update the Register - SET_REGISTER(reg, newval); - - // Switch to new mode if changed - if ((newval & MODE_FLAG) != oldmode) - SwitchMode(GET_MODE); - - } - // MRS (bit 21 clear) - Copy CPSR or SPSR to specified Register - else - { - SET_REGISTER((insn >> 12)& 0x0f, GET_REGISTER(reg)); - } -} - -static void HandleALU(UINT32 insn) -{ - UINT32 op2, sc = 0, rd, rn, opcode; - UINT32 by, rdn; - // UINT32 oldR15 = R15; - - opcode = (insn & INSN_OPCODE) >> INSN_OPCODE_SHIFT; - - rd = 0; - rn = 0; - - /* --------------*/ - /* Construct Op2 */ - /* --------------*/ - - /* Immediate constant */ - if (insn & INSN_I) - { - by = (insn & INSN_OP2_ROTATE) >> INSN_OP2_ROTATE_SHIFT; - if (by) - { - op2 = ROR(insn & INSN_OP2_IMM, by << 1); - sc = op2 & SIGN_BIT; - } - else - { - op2 = insn & INSN_OP2; // SJE: Shouldn't this be INSN_OP2_IMM? - sc = GET_CPSR & C_MASK; - } - } - /* Op2 = Register Value */ - else - { - op2 = decodeShift(insn, (insn & INSN_S) ? &sc : NULL); - - // LD TODO sc will always be 0 if this applies - if (!(insn & INSN_S)) - sc = 0; - } - - // LD TODO this comment is wrong - /* Calculate Rn to account for pipelining */ - if ((opcode & 0xd) != 0xd) /* No Rn in MOV */ - { - if ((rn = (insn & INSN_RN) >> INSN_RN_SHIFT) == eR15) - { -#if ARM7_DEBUG_CORE - LOG(("%08x: Pipelined R15 (Shift %d)\n", R15, (insn & INSN_I ? 8 : insn & 0x10u ? 12 : 12))); -#endif - rn = R15 + 8; - } - else - { - rn = GET_REGISTER(rn); - } - } - - /* Perform the operation */ - - switch (opcode) - { - /* Arithmetic operations */ - case OPCODE_SBC: - rd = (rn - op2 - (GET_CPSR & C_MASK ? 0 : 1)); - HandleALUSubFlags(rd, rn, op2); - break; - case OPCODE_CMP: - case OPCODE_SUB: - rd = (rn - op2); - HandleALUSubFlags(rd, rn, op2); - break; - case OPCODE_RSC: - rd = (op2 - rn - (GET_CPSR & C_MASK ? 0 : 1)); - HandleALUSubFlags(rd, op2, rn); - break; - case OPCODE_RSB: - rd = (op2 - rn); - HandleALUSubFlags(rd, op2, rn); - break; - case OPCODE_ADC: - rd = (rn + op2 + ((GET_CPSR & C_MASK) >> C_BIT)); - HandleALUAddFlags(rd, rn, op2); - break; - case OPCODE_CMN: - case OPCODE_ADD: - rd = (rn + op2); - HandleALUAddFlags(rd, rn, op2); - break; - - /* Logical operations */ - case OPCODE_AND: - case OPCODE_TST: - rd = rn & op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_BIC: - rd = rn & ~op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_TEQ: - case OPCODE_EOR: - rd = rn ^ op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_ORR: - rd = rn | op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_MOV: - rd = op2; - HandleALULogicalFlags(rd, sc); - break; - case OPCODE_MVN: - rd = (~op2); - HandleALULogicalFlags(rd, sc); - break; - } - - /* Put the result in its register if not one of the test only opcodes (TST,TEQ,CMP,CMN) */ - rdn = (insn & INSN_RD) >> INSN_RD_SHIFT; - if ((opcode & 0xc) != 0x8) - { - // If Rd = R15, but S Flag not set, Result is placed in R15, but CPSR is not affected (page 44) - if (rdn == eR15 && !(insn & INSN_S)) - { - R15 = rd; - } - else - { - // Rd = 15 and S Flag IS set, Result is placed in R15, and current mode SPSR moved to CPSR - if (rdn == eR15) { - - // Update CPSR from SPSR - SET_CPSR(GET_REGISTER(SPSR)); - SwitchMode(GET_MODE); - - R15 = rd; - - /* IRQ masks may have changed in this instruction */ -// ARM7_CHECKIRQ; - } - else - /* S Flag is set - Write results to register & update CPSR (which was already handled using HandleALU flag macros) */ - SET_REGISTER(rdn, rd); - } - } - // SJE: Don't think this applies any more.. (see page 44 at bottom) - /* TST & TEQ can affect R15 (the condition code register) with the S bit set */ - else if (rdn == eR15) - { - if (insn & INSN_S) { -#if ARM7_DEBUG_CORE - LOG(("%08x: TST class on R15 s bit set\n", R15)); -#endif - R15 = rd; - - /* IRQ masks may have changed in this instruction */ -// ARM7_CHECKIRQ; - } - else - { -#if ARM7_DEBUG_CORE - LOG(("%08x: TST class on R15 no s bit set\n", R15)); -#endif - } - } - - // if (oldR15 != R15) -// change_pc(R15); -} - -static void HandleMul(UINT32 insn) -{ - UINT32 r; - - /* Do the basic multiply of Rm and Rs */ - r = GET_REGISTER(insn & INSN_MUL_RM) * - GET_REGISTER((insn & INSN_MUL_RS) >> INSN_MUL_RS_SHIFT); - -#if ARM7_DEBUG_CORE - if ((insn & INSN_MUL_RM) == 0xf || - ((insn & INSN_MUL_RS) >> INSN_MUL_RS_SHIFT) == 0xf || - ((insn & INSN_MUL_RN) >> INSN_MUL_RN_SHIFT) == 0xf) - LOG(("%08x: R15 used in mult\n", R15)); -#endif - - /* Add on Rn if this is a MLA */ - if (insn & INSN_MUL_A) - { - r += GET_REGISTER((insn & INSN_MUL_RN) >> INSN_MUL_RN_SHIFT); - } - - /* Write the result */ - SET_REGISTER((insn & INSN_MUL_RD) >> INSN_MUL_RD_SHIFT, r); - - /* Set N and Z if asked */ - if (insn & INSN_S) - { - SET_CPSR((GET_CPSR & ~(N_MASK | Z_MASK)) | HandleALUNZFlags(r)); - } -} - -// todo: add proper cycle counts -static void HandleSMulLong(UINT32 insn) -{ - INT32 rm, rs; - UINT32 rhi, rlo; - INT64 res = 0; - - rm = (INT32)GET_REGISTER(insn & 0xf); - rs = (INT32)GET_REGISTER(((insn >> 8) & 0xf)); - rhi = (insn >> 16) & 0xf; - rlo = (insn >> 12) & 0xf; - -#if ARM7_DEBUG_CORE - if ((insn & 0xf) == 15 || ((insn >> 8) & 0xf) == 15 || ((insn >> 16) & 0xf) == 15 || ((insn >> 12) & 0xf) == 15) - LOG(("%08x: Illegal use of PC as a register in SMULL opcode\n", R15)); -#endif - - /* Perform the multiplication */ - res = (INT64)rm * rs; - - /* Add on Rn if this is a MLA */ - if (insn & INSN_MUL_A) - { - INT64 acum = (INT64)((((INT64)(GET_REGISTER(rhi))) << 32) | GET_REGISTER(rlo)); - res += acum; - } - - /* Write the result (upper dword goes to RHi, lower to RLo) */ - SET_REGISTER(rhi, res >> 32); - SET_REGISTER(rlo, res & 0xFFFFFFFF); - - /* Set N and Z if asked */ - if (insn & INSN_S) - { - SET_CPSR((GET_CPSR & ~(N_MASK | Z_MASK)) | HandleLongALUNZFlags(res)); - } -} - -// todo: add proper cycle counts -static void HandleUMulLong(UINT32 insn) -{ - UINT32 rm, rs; - UINT32 rhi, rlo; - UINT64 res = 0; - - rm = (INT32)GET_REGISTER(insn & 0xf); - rs = (INT32)GET_REGISTER(((insn >> 8) & 0xf)); - rhi = (insn >> 16) & 0xf; - rlo = (insn >> 12) & 0xf; - -#if ARM7_DEBUG_CORE - if (((insn & 0xf) == 15) || (((insn >> 8) & 0xf) == 15) || (((insn >> 16) & 0xf) == 15) || (((insn >> 12) & 0xf) == 15) - LOG(("%08x: Illegal use of PC as a register in SMULL opcode\n", R15)); -#endif - - /* Perform the multiplication */ - res = (UINT64)rm * rs; - - /* Add on Rn if this is a MLA */ - if (insn & INSN_MUL_A) - { - UINT64 acum = (UINT64)((((UINT64)(GET_REGISTER(rhi))) << 32) | GET_REGISTER(rlo)); - res += acum; - } - - /* Write the result (upper dword goes to RHi, lower to RLo) */ - SET_REGISTER(rhi, res >> 32); - SET_REGISTER(rlo, res & 0xFFFFFFFF); - - /* Set N and Z if asked */ - if (insn & INSN_S) - { - SET_CPSR((GET_CPSR & ~(N_MASK | Z_MASK)) | HandleLongALUNZFlags(res)); - } -} - -static void HandleMemBlock(UINT32 insn) -{ - UINT32 rb = (insn & INSN_RN) >> INSN_RN_SHIFT; - UINT32 rbp = GET_REGISTER(rb); -// UINT32 oldR15 = R15; - int result; - -#if ARM7_DEBUG_CORE - if (rbp & 3) - LOG(("%08x: Unaligned Mem Transfer @ %08x\n", R15, rbp)); -#endif - - // We will specify the cycle count for each case, so remove the -3 that occurs at the end - ARM7_ICOUNT += 3; - - if (insn & INSN_BDT_L) - { - /* Loading */ - if (insn & INSN_BDT_U) - { - /* Incrementing */ - if (!(insn & INSN_BDT_P)) - { - rbp = rbp + (- 4); - } - - // S Flag Set, but R15 not in list = User Bank Transfer - if (insn & INSN_BDT_S && (insn & 0x8000) == 0) - { - // set to user mode - then do the transfer, and set back - int curmode = GET_MODE; - SwitchMode(eARM7_MODE_USER); - LOG(("%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15)); - result = loadInc(insn & 0xffff, rbp, insn & INSN_BDT_S); - // todo - not sure if Writeback occurs on User registers also.. - SwitchMode(curmode); - } - else - result = loadInc(insn & 0xffff, rbp, insn & INSN_BDT_S); - - if (insn & INSN_BDT_W) - { -#if ARM7_DEBUG_CORE - if (rb == 15) - LOG(("%08x: Illegal LDRM writeback to r15\n", R15)); -#endif - SET_REGISTER(rb, GET_REGISTER(rb) + result * 4); - } - - // R15 included? (NOTE: CPSR restore must occur LAST otherwise wrong registers restored!) - if (insn & 0x8000) { - R15 -= 4; // SJE: I forget why i did this? - // S - Flag Set? Signals transfer of current mode SPSR->CPSR - if (insn & INSN_BDT_S) { - SET_CPSR(GET_REGISTER(SPSR)); - SwitchMode(GET_MODE); - } - } - // LDM PC - takes 1 extra cycle - ARM7_ICOUNT -= 1; - } - else - { - /* Decrementing */ - if (!(insn & INSN_BDT_P)) - { - rbp = rbp - (- 4); - } - - // S Flag Set, but R15 not in list = User Bank Transfer - if (insn & INSN_BDT_S && ((insn & 0x8000) == 0)) - { - // set to user mode - then do the transfer, and set back - int curmode = GET_MODE; - SwitchMode(eARM7_MODE_USER); - LOG(("%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15)); - result = loadDec(insn & 0xffff, rbp, insn & INSN_BDT_S); - // todo - not sure if Writeback occurs on User registers also.. - SwitchMode(curmode); - } - else - result = loadDec(insn & 0xffff, rbp, insn & INSN_BDT_S); - - if (insn & INSN_BDT_W) - { - if (rb == 0xf) - LOG(("%08x: Illegal LDRM writeback to r15\n", R15)); - SET_REGISTER(rb, GET_REGISTER(rb)-result*4); - } - - // R15 included? (NOTE: CPSR restore must occur LAST otherwise wrong registers restored!) - if (insn & 0x8000) { - R15 -= 4; // SJE: I forget why i did this? - // S - Flag Set? Signals transfer of current mode SPSR->CPSR - if (insn & INSN_BDT_S) { - SET_CPSR(GET_REGISTER(SPSR)); - SwitchMode(GET_MODE); - } - // LDM PC - takes 1 extra cycle - ARM7_ICOUNT -= 1; - } - - // LDM (NO PC) takes nS + 1n + 1I cycles (n = # of register transfers) - ARM7_ICOUNT -= result + 1 + 1; - } - } /* Loading */ - else - { - /* Storing */ - if (insn & (1 << eR15)) - { -#if ARM7_DEBUG_CORE - LOG(("%08x: Writing R15 in strm\n", R15)); -#endif - /* special case handling if writing to PC */ - R15 += 12; - } - if (insn & INSN_BDT_U) - { - /* Incrementing */ - if (!(insn & INSN_BDT_P)) - { - rbp = rbp + (- 4); - } - - // S Flag Set, but R15 not in list = User Bank Transfer - if (insn & INSN_BDT_S && (insn & 0x8000) == 0) - { - // todo: needs to be tested.. - - // set to user mode - then do the transfer, and set back - int curmode = GET_MODE; - SwitchMode(eARM7_MODE_USER); - LOG(("%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15)); - result = storeInc(insn & 0xffff, rbp); - // todo - not sure if Writeback occurs on User registers also.. - SwitchMode(curmode); - } - else - result = storeInc(insn & 0xffff, rbp); - - if (insn & INSN_BDT_W) - { - SET_REGISTER(rb, GET_REGISTER(rb) + result * 4); - } - } - else - { - /* Decrementing */ - if (!(insn & INSN_BDT_P)) - { - rbp = rbp - (-4); - } - - // S Flag Set, but R15 not in list = User Bank Transfer - if (insn & INSN_BDT_S && (insn & 0x8000) == 0) - { - // set to user mode - then do the transfer, and set back - int curmode = GET_MODE; - SwitchMode(eARM7_MODE_USER); - LOG(("%08x: User Bank Transfer not fully tested - please check if working properly!\n", R15)); - result = storeDec(insn & 0xffff, rbp); - // todo - not sure if Writeback occurs on User registers also.. - SwitchMode(curmode); - } - else - result = storeDec(insn & 0xffff, rbp); - - if (insn & INSN_BDT_W) - { - SET_REGISTER(rb, GET_REGISTER(rb) - result * 4); - } - } - if (insn & (1 << eR15)) - R15 -= 12; - - // STM takes (n+1)S+2N+1I cycles (n = # of register transfers) - ARM7_ICOUNT -= (result + 1) + 2 + 1; - } - - // if (oldR15 != R15) - // change_pc(R15); -} /* HandleMemBlock */ diff --git a/jan/src/cpu/arm7/arm7core.h b/jan/src/cpu/arm7/arm7core.h deleted file mode 100644 index ec76b83eb..000000000 --- a/jan/src/cpu/arm7/arm7core.h +++ /dev/null @@ -1,400 +0,0 @@ -/***************************************************************************** - * - * arm7core.h - * Portable ARM7TDMI Core Emulator - * - * Copyright Steve Ellenoff, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - * This work is based on: - * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' - * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) - * - ***************************************************************************** - - This file contains everything related to the arm7 core itself, and is presumed - to be cpu implementation non-specific, ie, applies to only the core. - - ******************************************************************************/ - -#ifndef __ARM7CORE_H__ -#define __ARM7CORE_H__ - - -/**************************************************************************************************** - * INTERRUPT LINES/EXCEPTIONS - ***************************************************************************************************/ -enum -{ - ARM7_IRQ_LINE=0, ARM7_FIRQ_LINE, - ARM7_ABORT_EXCEPTION, ARM7_ABORT_PREFETCH_EXCEPTION, ARM7_UNDEFINE_EXCEPTION, - ARM7_NUM_LINES -}; -// Really there's only 1 ABORT Line.. and cpu decides whether it's during data fetch or prefetch, but we let the user specify - -/**************************************************************************************************** - * ARM7 CORE REGISTERS - ***************************************************************************************************/ -enum -{ - ARM7_PC = 0, - ARM7_R0, ARM7_R1, ARM7_R2, ARM7_R3, ARM7_R4, ARM7_R5, ARM7_R6, ARM7_R7, - ARM7_R8, ARM7_R9, ARM7_R10, ARM7_R11, ARM7_R12, ARM7_R13, ARM7_R14, ARM7_R15, - ARM7_FR8, ARM7_FR9, ARM7_FR10, ARM7_FR11, ARM7_FR12, ARM7_FR13, ARM7_FR14, - ARM7_IR13, ARM7_IR14, ARM7_SR13, ARM7_SR14, ARM7_FSPSR, ARM7_ISPSR, ARM7_SSPSR, - ARM7_CPSR, ARM7_AR13, ARM7_AR14, ARM7_ASPSR, ARM7_UR13, ARM7_UR14, ARM7_USPSR -}; - -#define ARM7CORE_REGS \ - UINT32 sArmRegister[kNumRegisters]; \ - UINT8 pendingIrq; \ - UINT8 pendingFiq; \ - UINT8 pendingAbtD; \ - UINT8 pendingAbtP; \ - UINT8 pendingUnd; \ - UINT8 pendingSwi; \ - ALIGN_VAR(8) int (*irq_callback)(int); - - -/**************************************************************************************************** - * VARIOUS INTERNAL STRUCS/DEFINES/ETC.. - ***************************************************************************************************/ -// Mode values come from bit 4-0 of CPSR, but we are ignoring bit 4 here, since bit 4 always = 1 for valid modes -enum -{ - eARM7_MODE_USER = 0x0, // Bit: 4-0 = 10000 - eARM7_MODE_FIQ = 0x1, // Bit: 4-0 = 10001 - eARM7_MODE_IRQ = 0x2, // Bit: 4-0 = 10010 - eARM7_MODE_SVC = 0x3, // Bit: 4-0 = 10011 - eARM7_MODE_ABT = 0x7, // Bit: 4-0 = 10111 - eARM7_MODE_UND = 0xb, // Bit: 4-0 = 11011 - eARM7_MODE_SYS = 0xf // Bit: 4-0 = 11111 -}; - -#define ARM7_NUM_MODES 0x10 - -/* There are 36 Unique - 32 bit processor registers */ -/* Each mode has 17 registers (except user & system, which have 16) */ -/* This is a list of each *unique* register */ -enum -{ - /* All modes have the following */ - eR0 = 0, eR1, eR2, eR3, eR4, eR5, eR6, eR7, - eR8, eR9, eR10, eR11, eR12, - eR13, /* Stack Pointer */ - eR14, /* Link Register (holds return address) */ - eR15, /* Program Counter */ - eCPSR, /* Current Status Program Register */ - - /* Fast Interrupt - Bank switched registers */ - eR8_FIQ, eR9_FIQ, eR10_FIQ, eR11_FIQ, eR12_FIQ, eR13_FIQ, eR14_FIQ, eSPSR_FIQ, - - /* IRQ - Bank switched registers */ - eR13_IRQ, eR14_IRQ, eSPSR_IRQ, - - /* Supervisor/Service Mode - Bank switched registers */ - eR13_SVC, eR14_SVC, eSPSR_SVC, - - /* Abort Mode - Bank switched registers */ - eR13_ABT, eR14_ABT, eSPSR_ABT, - - /* Undefined Mode - Bank switched registers */ - eR13_UND, eR14_UND, eSPSR_UND, - - kNumRegisters -}; - -static const int thumbCycles[256] = -{ -// 0 1 2 3 4 5 6 7 8 9 a b c d e f - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 - 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 4 - 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 5 - 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, // 6 - 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, // 7 - 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, // 8 - 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, // 9 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // a - 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1, // b - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // c - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, // d - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // e - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 // f -}; - -/* 17 processor registers are visible at any given time, - * banked depending on processor mode. - */ - -static const int sRegisterTable[ARM7_NUM_MODES][18] = -{ - { /* USR */ - eR0, eR1, eR2, eR3, eR4, eR5, eR6, eR7, - eR8, eR9, eR10, eR11, eR12, - eR13, eR14, - eR15, eCPSR // No SPSR in this mode - }, - { /* FIQ */ - eR0, eR1, eR2, eR3, eR4, eR5, eR6, eR7, - eR8_FIQ, eR9_FIQ, eR10_FIQ, eR11_FIQ, eR12_FIQ, - eR13_FIQ, eR14_FIQ, - eR15, eCPSR, eSPSR_FIQ - }, - { /* IRQ */ - eR0, eR1, eR2, eR3, eR4, eR5, eR6, eR7, - eR8, eR9, eR10, eR11, eR12, - eR13_IRQ, eR14_IRQ, - eR15, eCPSR, eSPSR_IRQ - }, - { /* SVC */ - eR0, eR1, eR2, eR3, eR4, eR5, eR6, eR7, - eR8, eR9, eR10, eR11, eR12, - eR13_SVC, eR14_SVC, - eR15, eCPSR, eSPSR_SVC - }, - {0}, {0}, {0}, // values for modes 4,5,6 are not valid - { /* ABT */ - eR0, eR1, eR2, eR3, eR4, eR5, eR6, eR7, - eR8, eR9, eR10, eR11, eR12, - eR13_ABT, eR14_ABT, - eR15, eCPSR, eSPSR_ABT - }, - {0}, {0}, {0}, // values for modes 8,9,a are not valid! - { /* UND */ - eR0, eR1, eR2, eR3, eR4, eR5, eR6, eR7, - eR8, eR9, eR10, eR11, eR12, - eR13_UND, eR14_UND, - eR15, eCPSR, eSPSR_UND - }, - {0}, {0}, {0}, // values for modes c,d, e are not valid! - { /* SYS */ - eR0, eR1, eR2, eR3, eR4, eR5, eR6, eR7, - eR8, eR9, eR10, eR11, eR12, - eR13, eR14, - eR15, eCPSR // No SPSR in this mode - } -}; - -#define N_BIT 31 -#define Z_BIT 30 -#define C_BIT 29 -#define V_BIT 28 -#define I_BIT 7 -#define F_BIT 6 -#define T_BIT 5 // Thumb mode - -#define N_MASK ((UINT32)(1 << N_BIT)) /* Negative flag */ -#define Z_MASK ((UINT32)(1 << Z_BIT)) /* Zero flag */ -#define C_MASK ((UINT32)(1 << C_BIT)) /* Carry flag */ -#define V_MASK ((UINT32)(1 << V_BIT)) /* oVerflow flag */ -#define I_MASK ((UINT32)(1 << I_BIT)) /* Interrupt request disable */ -#define F_MASK ((UINT32)(1 << F_BIT)) /* Fast interrupt request disable */ -#define T_MASK ((UINT32)(1 << T_BIT)) /* Thumb Mode flag */ - -#define N_IS_SET(pc) ((pc) & N_MASK) -#define Z_IS_SET(pc) ((pc) & Z_MASK) -#define C_IS_SET(pc) ((pc) & C_MASK) -#define V_IS_SET(pc) ((pc) & V_MASK) -#define I_IS_SET(pc) ((pc) & I_MASK) -#define F_IS_SET(pc) ((pc) & F_MASK) -#define T_IS_SET(pc) ((pc) & T_MASK) - -#define N_IS_CLEAR(pc) (!N_IS_SET(pc)) -#define Z_IS_CLEAR(pc) (!Z_IS_SET(pc)) -#define C_IS_CLEAR(pc) (!C_IS_SET(pc)) -#define V_IS_CLEAR(pc) (!V_IS_SET(pc)) -#define I_IS_CLEAR(pc) (!I_IS_SET(pc)) -#define F_IS_CLEAR(pc) (!F_IS_SET(pc)) -#define T_IS_CLEAR(pc) (!T_IS_SET(pc)) - -/* Deconstructing an instruction */ -// todo: use these in all places (including dasm file) -#define INSN_COND ((UINT32)0xf0000000u) -#define INSN_SDT_L ((UINT32)0x00100000u) -#define INSN_SDT_W ((UINT32)0x00200000u) -#define INSN_SDT_B ((UINT32)0x00400000u) -#define INSN_SDT_U ((UINT32)0x00800000u) -#define INSN_SDT_P ((UINT32)0x01000000u) -#define INSN_BDT_L ((UINT32)0x00100000u) -#define INSN_BDT_W ((UINT32)0x00200000u) -#define INSN_BDT_S ((UINT32)0x00400000u) -#define INSN_BDT_U ((UINT32)0x00800000u) -#define INSN_BDT_P ((UINT32)0x01000000u) -#define INSN_BDT_REGS ((UINT32)0x0000ffffu) -#define INSN_SDT_IMM ((UINT32)0x00000fffu) -#define INSN_MUL_A ((UINT32)0x00200000u) -#define INSN_MUL_RM ((UINT32)0x0000000fu) -#define INSN_MUL_RS ((UINT32)0x00000f00u) -#define INSN_MUL_RN ((UINT32)0x0000f000u) -#define INSN_MUL_RD ((UINT32)0x000f0000u) -#define INSN_I ((UINT32)0x02000000u) -#define INSN_OPCODE ((UINT32)0x01e00000u) -#define INSN_S ((UINT32)0x00100000u) -#define INSN_BL ((UINT32)0x01000000u) -#define INSN_BRANCH ((UINT32)0x00ffffffu) -#define INSN_SWI ((UINT32)0x00ffffffu) -#define INSN_RN ((UINT32)0x000f0000u) -#define INSN_RD ((UINT32)0x0000f000u) -#define INSN_OP2 ((UINT32)0x00000fffu) -#define INSN_OP2_SHIFT ((UINT32)0x00000f80u) -#define INSN_OP2_SHIFT_TYPE ((UINT32)0x00000070u) -#define INSN_OP2_RM ((UINT32)0x0000000fu) -#define INSN_OP2_ROTATE ((UINT32)0x00000f00u) -#define INSN_OP2_IMM ((UINT32)0x000000ffu) -#define INSN_OP2_SHIFT_TYPE_SHIFT 4 -#define INSN_OP2_SHIFT_SHIFT 7 -#define INSN_OP2_ROTATE_SHIFT 8 -#define INSN_MUL_RS_SHIFT 8 -#define INSN_MUL_RN_SHIFT 12 -#define INSN_MUL_RD_SHIFT 16 -#define INSN_OPCODE_SHIFT 21 -#define INSN_RN_SHIFT 16 -#define INSN_RD_SHIFT 12 -#define INSN_COND_SHIFT 28 - -#define THUMB_INSN_TYPE ((UINT16)0xf000) -#define THUMB_COND_TYPE ((UINT16)0x0f00) -#define THUMB_GROUP4_TYPE ((UINT16)0x0c00) -#define THUMB_GROUP5_TYPE ((UINT16)0x0e00) -#define THUMB_GROUP5_RM ((UINT16)0x01c0) -#define THUMB_GROUP5_RN ((UINT16)0x0038) -#define THUMB_GROUP5_RD ((UINT16)0x0007) -#define THUMB_ADDSUB_RNIMM ((UINT16)0x01c0) -#define THUMB_ADDSUB_RS ((UINT16)0x0038) -#define THUMB_ADDSUB_RD ((UINT16)0x0007) -#define THUMB_INSN_ADDSUB ((UINT16)0x0800) -#define THUMB_INSN_CMP ((UINT16)0x0800) -#define THUMB_INSN_SUB ((UINT16)0x0800) -#define THUMB_INSN_IMM_RD ((UINT16)0x0700) -#define THUMB_INSN_IMM_S ((UINT16)0x0080) -#define THUMB_INSN_IMM ((UINT16)0x00ff) -#define THUMB_ADDSUB_TYPE ((UINT16)0x0600) -#define THUMB_HIREG_OP ((UINT16)0x0300) -#define THUMB_HIREG_H ((UINT16)0x00c0) -#define THUMB_HIREG_RS ((UINT16)0x0038) -#define THUMB_HIREG_RD ((UINT16)0x0007) -#define THUMB_STACKOP_TYPE ((UINT16)0x0f00) -#define THUMB_STACKOP_L ((UINT16)0x0800) -#define THUMB_STACKOP_RD ((UINT16)0x0700) -#define THUMB_ALUOP_TYPE ((UINT16)0x03c0) -#define THUMB_BLOP_LO ((UINT16)0x0800) -#define THUMB_BLOP_OFFS ((UINT16)0x07ff) -#define THUMB_SHIFT_R ((UINT16)0x0800) -#define THUMB_SHIFT_AMT ((UINT16)0x07c0) -#define THUMB_HALFOP_L ((UINT16)0x0800) -#define THUMB_HALFOP_OFFS ((UINT16)0x07c0) -#define THUMB_BRANCH_OFFS ((UINT16)0x07ff) -#define THUMB_LSOP_L ((UINT16)0x0800) -#define THUMB_LSOP_OFFS ((UINT16)0x07c0) -#define THUMB_MULTLS ((UINT16)0x0800) -#define THUMB_MULTLS_BASE ((UINT16)0x0700) -#define THUMB_RELADDR_SP ((UINT16)0x0800) -#define THUMB_RELADDR_RD ((UINT16)0x0700) -#define THUMB_INSN_TYPE_SHIFT 12 -#define THUMB_COND_TYPE_SHIFT 8 -#define THUMB_GROUP4_TYPE_SHIFT 10 -#define THUMB_GROUP5_TYPE_SHIFT 9 -#define THUMB_ADDSUB_TYPE_SHIFT 9 -#define THUMB_INSN_IMM_RD_SHIFT 8 -#define THUMB_STACKOP_TYPE_SHIFT 8 -#define THUMB_HIREG_OP_SHIFT 8 -#define THUMB_STACKOP_RD_SHIFT 8 -#define THUMB_MULTLS_BASE_SHIFT 8 -#define THUMB_RELADDR_RD_SHIFT 8 -#define THUMB_HIREG_H_SHIFT 6 -#define THUMB_HIREG_RS_SHIFT 3 -#define THUMB_ALUOP_TYPE_SHIFT 6 -#define THUMB_SHIFT_AMT_SHIFT 6 -#define THUMB_HALFOP_OFFS_SHIFT 6 -#define THUMB_LSOP_OFFS_SHIFT 6 -#define THUMB_GROUP5_RM_SHIFT 6 -#define THUMB_GROUP5_RN_SHIFT 3 -#define THUMB_GROUP5_RD_SHIFT 0 -#define THUMB_ADDSUB_RNIMM_SHIFT 6 -#define THUMB_ADDSUB_RS_SHIFT 3 -#define THUMB_ADDSUB_RD_SHIFT 0 - -enum -{ - OPCODE_AND, /* 0000 */ - OPCODE_EOR, /* 0001 */ - OPCODE_SUB, /* 0010 */ - OPCODE_RSB, /* 0011 */ - OPCODE_ADD, /* 0100 */ - OPCODE_ADC, /* 0101 */ - OPCODE_SBC, /* 0110 */ - OPCODE_RSC, /* 0111 */ - OPCODE_TST, /* 1000 */ - OPCODE_TEQ, /* 1001 */ - OPCODE_CMP, /* 1010 */ - OPCODE_CMN, /* 1011 */ - OPCODE_ORR, /* 1100 */ - OPCODE_MOV, /* 1101 */ - OPCODE_BIC, /* 1110 */ - OPCODE_MVN /* 1111 */ -}; - -enum -{ - COND_EQ = 0, /* Z equal */ - COND_NE, /* ~Z not equal */ - COND_CS, COND_HS = 2, /* C unsigned higher or same */ - COND_CC, COND_LO = 3, /* ~C unsigned lower */ - COND_MI, /* N negative */ - COND_PL, /* ~N positive or zero */ - COND_VS, /* V overflow */ - COND_VC, /* ~V no overflow */ - COND_HI, /* C && ~Z unsigned higher */ - COND_LS, /* ~C || Z unsigned lower or same */ - COND_GE, /* N == V greater or equal */ - COND_LT, /* N != V less than */ - COND_GT, /* ~Z && N == V greater than */ - COND_LE, /* Z || N != V less than or equal */ - COND_AL, /* 1 always */ - COND_NV /* 0 never */ -}; - -#define LSL(v, s) ((v) << (s)) -#define LSR(v, s) ((v) >> (s)) -#define ROL(v, s) (LSL((v), (s)) | (LSR((v), 32u - (s)))) -#define ROR(v, s) (LSR((v), (s)) | (LSL((v), 32u - (s)))) - -/* Convenience Macros */ -#define R15 ARM7REG(eR15) -#define SPSR 17 // SPSR is always the 18th register in our 0 based array sRegisterTable[][18] -#define GET_CPSR ARM7REG(eCPSR) -#define SET_CPSR(v) (GET_CPSR = (v)) -#define MODE_FLAG 0xF // Mode bits are 4:0 of CPSR, but we ignore bit 4. -#define GET_MODE (GET_CPSR & MODE_FLAG) -#define SIGN_BIT ((UINT32)(1 << 31)) -#define SIGN_BITS_DIFFER(a, b) (((a) ^ (b)) >> 31) -/* I really don't know why these were set to 16-bit, the thumb registers are still 32-bit ... */ -#define THUMB_SIGN_BIT ((UINT32)(1 << 31)) -#define THUMB_SIGN_BITS_DIFFER(a, b) (((a)^(b)) >> 31) - -/* At one point I thought these needed to be cpu implementation specific, but they don't.. */ -#define GET_REGISTER(reg) GetRegister(reg) -#define SET_REGISTER(reg, val) SetRegister(reg, val) -#define ARM7_CHECKIRQ arm7_check_irq_state() - -extern void((*arm7_coproc_do_callback)(unsigned int, unsigned int)); -extern unsigned int((*arm7_coproc_rt_r_callback)(unsigned int)); -extern void((*arm7_coproc_rt_w_callback)(unsigned int, unsigned int)); -extern void (*arm7_coproc_dt_r_callback)(UINT32 insn, UINT32* prn, UINT32 (*read32)(UINT32 addr)); -extern void (*arm7_coproc_dt_w_callback)(UINT32 insn, UINT32* prn, void (*write32)(UINT32 addr, UINT32 data)); - -#endif /* __ARM7CORE_H__ */ diff --git a/jan/src/cpu/arm7/arm7exec.c b/jan/src/cpu/arm7/arm7exec.c deleted file mode 100644 index c17884d34..000000000 --- a/jan/src/cpu/arm7/arm7exec.c +++ /dev/null @@ -1,1366 +0,0 @@ -/***************************************************************************** - * - * arm7exec.c - * Portable ARM7TDMI Core Emulator - * - * Copyright Steve Ellenoff, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - * This work is based on: - * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' - * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) - * - *****************************************************************************/ - -/****************************************************************************** - * Notes: - * This file contains the code to run during the CPU EXECUTE METHOD. - * It has been split into it's own file (from the arm7core.c) so it can be - * directly compiled into any cpu core that wishes to use it. - * - * It should be included as follows in your cpu core: - * - * int arm7_execute(int cycles) - * { - * #include "arm7exec.c" - * } - * -*****************************************************************************/ - -/* This implementation uses an improved switch() for hopefully faster opcode fetches compared to my last version -.. though there's still room for improvement. */ -{ - UINT32 pc; - UINT32 insn; - - ARM7_ICOUNT = cycles; - curr_cycles = total_cycles; - - do - { - /* handle Thumb instructions if active */ - if (T_IS_SET(GET_CPSR)) - { - UINT32 readword; - UINT32 addr; - UINT32 rm, rn, rs, rd, op2, imm, rrs, rrd; - INT32 offs; - - pc = R15; - insn = cpu_readop16(pc & (~1)); - ARM7_ICOUNT -= (3 - thumbCycles[insn >> 8]); - switch ((insn & THUMB_INSN_TYPE) >> THUMB_INSN_TYPE_SHIFT) - { - case 0x0: /* Logical shifting */ - SET_CPSR(GET_CPSR & ~(N_MASK | Z_MASK)); - if (insn & THUMB_SHIFT_R) /* Shift right */ - { - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rrs = GET_REGISTER(rs); - offs = (insn & THUMB_SHIFT_AMT) >> THUMB_SHIFT_AMT_SHIFT; - if (offs != 0) - { - SET_REGISTER(rd, rrs >> offs); - if (rrs & (1 << (offs - 1))) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - } - else - { - SET_REGISTER(rd, 0); - if (rrs & 0x80000000) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - } - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - } - else /* Shift left */ - { - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rrs = GET_REGISTER(rs); - offs = (insn & THUMB_SHIFT_AMT) >> THUMB_SHIFT_AMT_SHIFT; - if (offs != 0) - { - SET_REGISTER(rd, rrs << offs); - if (rrs & (1 << (31 - (offs - 1)))) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - } - else - { - SET_REGISTER(rd, rrs); - } - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - } - break; - case 0x1: /* Arithmetic */ - if (insn & THUMB_INSN_ADDSUB) - { - switch ((insn & THUMB_ADDSUB_TYPE) >> THUMB_ADDSUB_TYPE_SHIFT) - { - case 0x0: /* ADD Rd, Rs, Rn */ - rn = GET_REGISTER((insn & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT); - rs = GET_REGISTER((insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_REGISTER(rd, rs + rn); - HandleThumbALUAddFlags(GET_REGISTER(rd), rs, rn); - break; - case 0x1: /* SUB Rd, Rs, Rn */ - rn = GET_REGISTER((insn & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT); - rs = GET_REGISTER((insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_REGISTER(rd, rs - rn); - HandleThumbALUSubFlags(GET_REGISTER(rd), rs, rn); - break; - case 0x2: /* ADD Rd, Rs, #imm */ - imm = (insn & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; - rs = GET_REGISTER((insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_REGISTER(rd, rs + imm); - HandleThumbALUAddFlags(GET_REGISTER(rd), rs, imm); - break; - case 0x3: /* SUB Rd, Rs, #imm */ - imm = (insn & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; - rs = GET_REGISTER((insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_REGISTER(rd, rs - imm); - HandleThumbALUSubFlags(GET_REGISTER(rd), rs,imm); - break; - default: - fatalerror("%08x: G1 Undefined Thumb instruction: %04x\n", pc, insn); - R15 += 2; - break; - } - } - else - { - /* ASR.. */ - //if (insn & THUMB_SHIFT_R) /* Shift right */ - { - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rrs = GET_REGISTER(rs); - offs = (insn & THUMB_SHIFT_AMT) >> THUMB_SHIFT_AMT_SHIFT; - if (offs == 0) - { - offs = 32; - } - if (offs >= 32) - { - if (rrs >> 31) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - SET_REGISTER(rd, (rrs & 0x80000000) ? 0xFFFFFFFF : 0x00000000); - } - else - { - if ((rrs >> (offs - 1)) & 1) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - SET_REGISTER(rd, - (rrs & 0x80000000) - ? ((0xFFFFFFFF << (32 - offs)) | (rrs >> offs)) - : (rrs >> offs)); - } - SET_CPSR(GET_CPSR & ~(N_MASK | Z_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - } - } - break; - case 0x2: /* CMP / MOV */ - if (insn & THUMB_INSN_CMP) - { - rn = GET_REGISTER((insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT); - op2 = insn & THUMB_INSN_IMM; - rd = rn - op2; - HandleThumbALUSubFlags(rd, rn, op2); - //mame_printf_debug("%08x: xxx Thumb instruction: CMP R%d (%08x), %02x (N=%d, Z=%d, C=%d, V=%d)\n", pc, (insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT, GET_REGISTER((insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT), op2, N_IS_SET(GET_CPSR) ? 1 : 0, Z_IS_SET(GET_CPSR) ? 1 : 0, C_IS_SET(GET_CPSR) ? 1 : 0, V_IS_SET(GET_CPSR) ? 1 : 0); - } - else - { - rd = (insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; - op2 = (insn & THUMB_INSN_IMM); - SET_REGISTER(rd, op2); - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - } - break; - case 0x3: /* ADD/SUB immediate */ - if (insn & THUMB_INSN_SUB) /* SUB Rd, #Offset8 */ - { - rn = GET_REGISTER((insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT); - op2 = insn & THUMB_INSN_IMM; - //mame_printf_debug("%08x: Thumb instruction: SUB R%d, %02x\n", pc, (insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT, op2); - rd = rn - op2; - SET_REGISTER((insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT, rd); - HandleThumbALUSubFlags(rd, rn, op2); - } - else /* ADD Rd, #Offset8 */ - { - rn = GET_REGISTER((insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT); - op2 = insn & THUMB_INSN_IMM; - rd = rn + op2; - //mame_printf_debug("%08x: Thumb instruction: ADD R%d, %02x\n", pc, (insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT, op2); - SET_REGISTER((insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT, rd); - HandleThumbALUAddFlags(rd, rn, op2); - } - break; - case 0x4: /* Rd & Rm instructions */ - switch ((insn & THUMB_GROUP4_TYPE) >> THUMB_GROUP4_TYPE_SHIFT) - { - case 0x0: - switch ((insn & THUMB_ALUOP_TYPE) >> THUMB_ALUOP_TYPE_SHIFT) - { - case 0x0: /* AND Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_REGISTER(rd, GET_REGISTER(rd) & GET_REGISTER(rs)); - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - break; - case 0x1: /* EOR Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_REGISTER(rd, GET_REGISTER(rd) ^ GET_REGISTER(rs)); - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - break; - case 0x2: /* LSL Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rrd = GET_REGISTER(rd); - offs = GET_REGISTER(rs) & 0x000000ff; - if (offs > 0) - { - if (offs < 32) - { - SET_REGISTER(rd, rrd << offs); - if (rrd & (1 << (31 - (offs - 1)))) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - } - else if (offs == 32) - { - SET_REGISTER(rd, 0); - if (rrd & 1) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - } - else - { - SET_REGISTER(rd, 0); - SET_CPSR(GET_CPSR & ~C_MASK); - } - } - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - break; - case 0x3: /* LSR Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rrd = GET_REGISTER(rd); - offs = GET_REGISTER(rs) & 0x000000ff; - if (offs > 0) - { - if (offs < 32) - { - SET_REGISTER(rd, rrd >> offs); - if (rrd & (1 << (offs - 1))) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - } - else if (offs == 32) - { - SET_REGISTER(rd, 0); - if (rrd & 0x80000000) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - } - else - { - SET_REGISTER(rd, 0); - SET_CPSR(GET_CPSR & ~C_MASK); - } - } - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - break; - case 0x4: /* ASR Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rrs = GET_REGISTER(rs)&0xff; - rrd = GET_REGISTER(rd); - if (rrs != 0) - { - if (rrs >= 32) - { - if (rrd >> 31) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - SET_REGISTER(rd, (GET_REGISTER(rd) & 0x80000000) ? 0xFFFFFFFF : 0x00000000); - } - else - { - if ((rrd >> (rrs-1)) & 1) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - SET_REGISTER(rd, (rrd & 0x80000000) - ? ((0xFFFFFFFF << (32 - rrs)) | (rrd >> rrs)) - : (rrd >> rrs)); - } - } - SET_CPSR(GET_CPSR & ~(N_MASK | Z_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - break; - case 0x5: /* ADC Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - op2=(GET_CPSR & C_MASK) ? 1 : 0; - rn=GET_REGISTER(rd) + GET_REGISTER(rs) + op2; - HandleThumbALUAddFlags(rn, GET_REGISTER(rd), (GET_REGISTER(rs))); // ? - SET_REGISTER(rd, rn); - break; - case 0x6: /* SBC Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - op2=(GET_CPSR & C_MASK) ? 0 : 1; - rn=GET_REGISTER(rd) - GET_REGISTER(rs) - op2; - HandleThumbALUSubFlags(rn, GET_REGISTER(rd), (GET_REGISTER(rs))); //? - SET_REGISTER(rd, rn); - break; - case 0x7: /* ROR Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rrd = GET_REGISTER(rd); - imm = GET_REGISTER(rs) & 0x0000001f; - SET_REGISTER(rd, (rrd >> imm) | (rrd << (32 - imm))); - if (rrd & (1 << (imm - 1))) - { - SET_CPSR(GET_CPSR | C_MASK); - } - else - { - SET_CPSR(GET_CPSR & ~C_MASK); - } - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - break; - case 0x8: /* TST Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd) & GET_REGISTER(rs))); - R15 += 2; - break; - case 0x9: /* NEG Rd, Rs - todo: check me */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rrs = GET_REGISTER(rs); - rn = 0 - rrs; - SET_REGISTER(rd, rn); - HandleThumbALUSubFlags(GET_REGISTER(rd), 0, rrs); - break; - case 0xa: /* CMP Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rn = GET_REGISTER(rd) - GET_REGISTER(rs); - HandleThumbALUSubFlags(rn, GET_REGISTER(rd), GET_REGISTER(rs)); - break; - case 0xb: /* CMN Rd, Rs - check flags, add dasm */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rn = GET_REGISTER(rd) + GET_REGISTER(rs); - HandleThumbALUAddFlags(rn, GET_REGISTER(rd), GET_REGISTER(rs)); - break; - case 0xc: /* ORR Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_REGISTER(rd, GET_REGISTER(rd) | GET_REGISTER(rs)); - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - break; - case 0xd: /* MUL Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - rn = GET_REGISTER(rd) * GET_REGISTER(rs); - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_REGISTER(rd, rn); - SET_CPSR(GET_CPSR | HandleALUNZFlags(rn)); - R15 += 2; - break; - case 0xe: /* BIC Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_REGISTER(rd, GET_REGISTER(rd) & (~GET_REGISTER(rs))); - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - break; - case 0xf: /* MVN Rd, Rs */ - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - op2 = GET_REGISTER(rs); - SET_REGISTER(rd, ~op2); - SET_CPSR(GET_CPSR & ~(Z_MASK | N_MASK)); - SET_CPSR(GET_CPSR | HandleALUNZFlags(GET_REGISTER(rd))); - R15 += 2; - break; - default: - fatalerror("%08x: G4-0 Undefined Thumb instruction: %04x %x\n", pc, insn, (insn & THUMB_ALUOP_TYPE) >> THUMB_ALUOP_TYPE_SHIFT); - R15 += 2; - break; - } - break; - case 0x1: - switch ((insn & THUMB_HIREG_OP) >> THUMB_HIREG_OP_SHIFT) - { - case 0x0: /* ADD Rd, Rs */ - rs = (insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - rd = insn & THUMB_HIREG_RD; - switch ((insn & THUMB_HIREG_H) >> THUMB_HIREG_H_SHIFT) - { - case 0x1: /* ADD Rd, HRs */ - SET_REGISTER(rd, GET_REGISTER(rd) + GET_REGISTER(rs+8)); - // emulate the effects of pre-fetch - if (rs == 7) - { - SET_REGISTER(rd, GET_REGISTER(rd) + 4); - } - break; - case 0x2: /* ADD HRd, Rs */ - SET_REGISTER(rd+8, GET_REGISTER(rd+8) + GET_REGISTER(rs)); - if (rd == 7) - { - R15 += 2; - // change_pc(R15); - } - break; - case 0x3: /* Add HRd, HRs */ - SET_REGISTER(rd+8, GET_REGISTER(rd+8) + GET_REGISTER(rs+8)); - // emulate the effects of pre-fetch - if (rs == 7) - { - SET_REGISTER(rd+8, GET_REGISTER(rd+8) + 4); - } - if (rd == 7) - { - R15 += 2; - // change_pc(R15); - } - break; - default: - fatalerror("%08x: G4-1-0 Undefined Thumb instruction: %04x %x\n", pc, insn, (insn & THUMB_HIREG_H) >> THUMB_HIREG_H_SHIFT); - break; - } - R15 += 2; - break; - case 0x1: /* CMP */ - switch ((insn & THUMB_HIREG_H) >> THUMB_HIREG_H_SHIFT) - { - case 0x0: /* CMP Rd, Rs */ - rs = GET_REGISTER(((insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT)); - rd = GET_REGISTER(insn & THUMB_HIREG_RD); - rn = rd - rs; - HandleThumbALUSubFlags(rn, rd, rs); - break; - case 0x1: /* CMP Rd, Hs */ - rs = GET_REGISTER(((insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT) + 8); - rd = GET_REGISTER(insn & THUMB_HIREG_RD); - rn = rd - rs; - HandleThumbALUSubFlags(rn, rd, rs); - break; - case 0x2: /* CMP Hd, Rs */ - rs = GET_REGISTER(((insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT)); - rd = GET_REGISTER((insn & THUMB_HIREG_RD) + 8); - rn = rd - rs; - HandleThumbALUSubFlags(rn, rd, rs); - break; - case 0x3: /* CMP Hd, Hs */ - rs = GET_REGISTER(((insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT) + 8); - rd = GET_REGISTER((insn & THUMB_HIREG_RD) + 8); - rn = rd - rs; - HandleThumbALUSubFlags(rn, rd, rs); - break; - default: - fatalerror("%08x: G4-1 Undefined Thumb instruction: %04x %x\n", pc, insn, (insn & THUMB_HIREG_H) >> THUMB_HIREG_H_SHIFT); - R15 += 2; - break; - } - break; - case 0x2: /* MOV */ - switch ((insn & THUMB_HIREG_H) >> THUMB_HIREG_H_SHIFT) - { - case 0x1: // MOV Rd, Hs - rs = (insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - rd = insn & THUMB_HIREG_RD; - if (rs == 7) - { - SET_REGISTER(rd, GET_REGISTER(rs + 8) + 4); - } - else - { - SET_REGISTER(rd, GET_REGISTER(rs + 8)); - } - R15 += 2; - break; - case 0x2: // MOV Hd, Rs - rs = (insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - rd = insn & THUMB_HIREG_RD; - SET_REGISTER(rd + 8, GET_REGISTER(rs)); - if (rd != 7) - { - R15 += 2; - } - else - { - R15 &= ~1; - // change_pc(R15); - } - break; - case 0x3: // MOV Hd, Hs - rs = (insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - rd = insn & THUMB_HIREG_RD; - if (rs == 7) - { - SET_REGISTER(rd + 8, GET_REGISTER(rs+8)+4); - } - else - { - SET_REGISTER(rd + 8, GET_REGISTER(rs+8)); - } - if (rd != 7) - { - R15 += 2; - } - if (rd == 7) - { - R15 &= ~1; - // change_pc(R15); - } - break; - default: - fatalerror("%08x: G4-2 Undefined Thumb instruction: %04x (%x)\n", pc, insn, (insn & THUMB_HIREG_H) >> THUMB_HIREG_H_SHIFT); - R15 += 2; - break; - } - break; - case 0x3: - switch ((insn & THUMB_HIREG_H) >> THUMB_HIREG_H_SHIFT) - { - case 0x0: - rd = (insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - addr = GET_REGISTER(rd); - if (addr & 1) - { - addr &= ~1; - } - else - { - SET_CPSR(GET_CPSR & ~T_MASK); - if (addr & 2) - { - addr += 2; - } - } - R15 = addr; - break; - case 0x1: - addr = GET_REGISTER(((insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT) + 8); - if ((((insn & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT) + 8) == 15) - { - addr += 2; - } - if (addr & 1) - { - addr &= ~1; - } - else - { - SET_CPSR(GET_CPSR & ~T_MASK); - if (addr & 2) - { - addr += 2; - } - } - R15 = addr; - break; - default: - fatalerror("%08x: G4-3 Undefined Thumb instruction: %04x\n", pc, insn); - R15 += 2; - break; - } - break; - default: - fatalerror("%08x: G4-x Undefined Thumb instruction: %04x\n", pc, insn); - R15 += 2; - break; - } - break; - case 0x2: - case 0x3: - readword = READ32((R15 & ~2) + 4 + ((insn & THUMB_INSN_IMM) << 2)); - SET_REGISTER((insn & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT, readword); - R15 += 2; - break; - default: - fatalerror("%08x: G4-y Undefined Thumb instruction: %04x\n", pc, insn); - R15 += 2; - break; - } - break; - case 0x5: /* LDR* STR* */ - switch ((insn & THUMB_GROUP5_TYPE) >> THUMB_GROUP5_TYPE_SHIFT) - { - case 0x0: /* STR Rd, [Rn, Rm] */ - rm = (insn & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - rn = (insn & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - rd = (insn & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - addr = GET_REGISTER(rn) + GET_REGISTER(rm); - WRITE32(addr, GET_REGISTER(rd)); - R15 += 2; - break; - case 0x1: /* STRH Rd, [Rn, Rm] */ - rm = (insn & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - rn = (insn & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - rd = (insn & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - addr = GET_REGISTER(rn) + GET_REGISTER(rm); - WRITE16(addr, GET_REGISTER(rd)); - R15 += 2; - break; - case 0x2: /* STRB Rd, [Rn, Rm] */ - rm = (insn & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - rn = (insn & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - rd = (insn & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - addr = GET_REGISTER(rn) + GET_REGISTER(rm); - WRITE8(addr, GET_REGISTER(rd)); - R15 += 2; - break; - case 0x3: /* LDSB Rd, [Rn, Rm] todo, add dasm */ - rm = (insn & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - rn = (insn & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - rd = (insn & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - addr = GET_REGISTER(rn) + GET_REGISTER(rm); - op2 = READ8(addr); - if (op2 & 0x00000080) - { - op2 |= 0xffffff00; - } - SET_REGISTER(rd, op2); - R15 += 2; - break; - case 0x4: /* LDR Rd, [Rn, Rm] */ - rm = (insn & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - rn = (insn & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - rd = (insn & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - addr = GET_REGISTER(rn) + GET_REGISTER(rm); - op2 = READ32(addr); - SET_REGISTER(rd, op2); - R15 += 2; - break; - case 0x5: /* LDRH Rd, [Rn, Rm] */ - rm = (insn & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - rn = (insn & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - rd = (insn & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - addr = GET_REGISTER(rn) + GET_REGISTER(rm); - op2 = READ16(addr); - SET_REGISTER(rd, op2); - R15 += 2; - break; - case 0x6: /* LDRB Rd, [Rn, Rm] */ - rm = (insn & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - rn = (insn & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - rd = (insn & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - addr = GET_REGISTER(rn) + GET_REGISTER(rm); - op2 = READ8(addr); - SET_REGISTER(rd, op2); - R15 += 2; - break; - case 0x7: /* LDSH Rd, [Rn, Rm] */ - rm = (insn & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - rn = (insn & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - rd = (insn & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - addr = GET_REGISTER(rn) + GET_REGISTER(rm); - op2 = READ16(addr); - if (op2 & 0x00008000) - { - op2 |= 0xffff0000; - } - SET_REGISTER(rd, op2); - R15 += 2; - break; - default: - fatalerror("%08x: G5 Undefined Thumb instruction: %04x\n", pc, insn); - R15 += 2; - break; - } - break; - case 0x6: /* Word Store w/ Immediate Offset */ - if (insn & THUMB_LSOP_L) /* Load */ - { - rn = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = insn & THUMB_ADDSUB_RD; - offs = ((insn & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; - SET_REGISTER(rd, READ32(GET_REGISTER(rn) + offs)); // fix - R15 += 2; - } - else /* Store */ - { - rn = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = insn & THUMB_ADDSUB_RD; - offs = ((insn & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; - WRITE32(GET_REGISTER(rn) + offs, GET_REGISTER(rd)); - R15 += 2; - } - break; - case 0x7: /* Byte Store w/ Immeidate Offset */ - if (insn & THUMB_LSOP_L) /* Load */ - { - rn = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = insn & THUMB_ADDSUB_RD; - offs = (insn & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; - SET_REGISTER(rd, READ8(GET_REGISTER(rn) + offs)); - R15 += 2; - } - else /* Store */ - { - rn = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = insn & THUMB_ADDSUB_RD; - offs = (insn & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; - WRITE8(GET_REGISTER(rn) + offs, GET_REGISTER(rd)); - R15 += 2; - } - break; - case 0x8: /* Load/Store Halfword */ - if (insn & THUMB_HALFOP_L) /* Load */ - { - imm = (insn & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - SET_REGISTER(rd, READ16(GET_REGISTER(rs) + (imm << 1))); - R15 += 2; - } - else /* Store */ - { - imm = (insn & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; - rs = (insn & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - rd = (insn & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - WRITE16(GET_REGISTER(rs) + (imm << 1), GET_REGISTER(rd)); - R15 += 2; - } - break; - case 0x9: /* Stack-Relative Load/Store */ - if (insn & THUMB_STACKOP_L) - { - rd = (insn & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; - offs = (UINT8)(insn & THUMB_INSN_IMM); - readword = READ32(GET_REGISTER(13) + ((UINT32)offs << 2)); - SET_REGISTER(rd, readword); - R15 += 2; - } - else - { - rd = (insn & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; - offs = (UINT8)(insn & THUMB_INSN_IMM); - WRITE32(GET_REGISTER(13) + ((UINT32)offs << 2), GET_REGISTER(rd)); - R15 += 2; - } - break; - case 0xa: /* Get relative address */ - if (insn & THUMB_RELADDR_SP) /* ADD Rd, SP, #nn */ - { - rd = (insn & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; - offs = (UINT8)(insn & THUMB_INSN_IMM) << 2; - SET_REGISTER(rd, GET_REGISTER(13) + offs); - R15 += 2; - } - else /* ADD Rd, PC, #nn */ - { - rd = (insn & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; - offs = (UINT8)(insn & THUMB_INSN_IMM) << 2; - SET_REGISTER(rd, ((R15 + 4) & ~2) + offs); - R15 += 2; - } - break; - case 0xb: /* Stack-Related Opcodes */ - switch ((insn & THUMB_STACKOP_TYPE) >> THUMB_STACKOP_TYPE_SHIFT) - { - case 0x0: /* ADD SP, #imm */ - addr = (insn & THUMB_INSN_IMM); - addr &= ~THUMB_INSN_IMM_S; - SET_REGISTER(13, GET_REGISTER(13) + ((insn & THUMB_INSN_IMM_S) ? -(addr << 2) : (addr << 2))); - R15 += 2; - break; - case 0x4: /* PUSH {Rlist} */ - for (offs = 7; offs >= 0; offs--) - { - if (insn & (1 << offs)) - { - SET_REGISTER(13, GET_REGISTER(13) - 4); - WRITE32(GET_REGISTER(13), GET_REGISTER(offs)); - } - } - R15 += 2; - break; - case 0x5: /* PUSH {Rlist}{LR} */ - SET_REGISTER(13, GET_REGISTER(13) - 4); - WRITE32(GET_REGISTER(13), GET_REGISTER(14)); - for (offs = 7; offs >= 0; offs--) - { - if (insn & (1 << offs)) - { - SET_REGISTER(13, GET_REGISTER(13) - 4); - WRITE32(GET_REGISTER(13), GET_REGISTER(offs)); - } - } - R15 += 2; - break; - case 0xc: /* POP {Rlist} */ - for (offs = 0; offs < 8; offs++) - { - if (insn & (1 << offs)) - { - SET_REGISTER(offs, READ32(GET_REGISTER(13))); - SET_REGISTER(13, GET_REGISTER(13) + 4); - } - } - R15 += 2; - break; - case 0xd: /* POP {Rlist}{PC} */ - for (offs = 0; offs < 8; offs++) - { - if (insn & (1 << offs)) - { - SET_REGISTER(offs, READ32(GET_REGISTER(13))); - SET_REGISTER(13, GET_REGISTER(13) + 4); - } - } - R15 = READ32(GET_REGISTER(13)) & ~1; - SET_REGISTER(13, GET_REGISTER(13) + 4); - break; - default: - fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, insn); - R15 += 2; - break; - } - break; - case 0xc: /* Multiple Load/Store */ - { - UINT32 ld_st_address; - - rd = (insn & THUMB_MULTLS_BASE) >> THUMB_MULTLS_BASE_SHIFT; - ld_st_address = GET_REGISTER(rd) & 0xfffffffc; - - if (insn & THUMB_MULTLS) /* Load */ - { - int rd_in_list; - - rd_in_list = insn & (1 << rd); - for (offs = 0; offs < 8; offs++) - { - if (insn & (1 << offs)) - { - SET_REGISTER(offs, READ32(ld_st_address)); - ld_st_address += 4; - } - } - if (!rd_in_list) - SET_REGISTER(rd, ld_st_address); - R15 += 2; - } - else /* Store */ - { - for (offs = 0; offs < 8; offs++) - { - if (insn & (1 << offs)) - { - WRITE32(ld_st_address, GET_REGISTER(offs)); - ld_st_address += 4; - } - } - SET_REGISTER(rd, ld_st_address); - R15 += 2; - } - } - break; - case 0xd: /* Conditional Branch */ - offs = (INT8)(insn & THUMB_INSN_IMM); - switch ((insn & THUMB_COND_TYPE) >> THUMB_COND_TYPE_SHIFT) - { - case COND_EQ: - if (Z_IS_SET(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_NE: - if (Z_IS_CLEAR(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_CS: - if (C_IS_SET(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_CC: - if (C_IS_CLEAR(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_MI: - if (N_IS_SET(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_PL: - if (N_IS_CLEAR(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_VS: - if (V_IS_SET(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_VC: - if (V_IS_CLEAR(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_HI: - if (C_IS_SET(GET_CPSR) && Z_IS_CLEAR(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_LS: - if (C_IS_CLEAR(GET_CPSR) || Z_IS_SET(GET_CPSR)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_GE: - if (!(GET_CPSR & N_MASK) == !(GET_CPSR & V_MASK)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_LT: - if (!(GET_CPSR & N_MASK) != !(GET_CPSR & V_MASK)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_GT: - if (Z_IS_CLEAR(GET_CPSR) && !(GET_CPSR & N_MASK) == !(GET_CPSR & V_MASK)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_LE: - if (Z_IS_SET(GET_CPSR) || !(GET_CPSR & N_MASK) != !(GET_CPSR & V_MASK)) - { - R15 += 4 + (offs << 1); - } - else - { - R15 += 2; - } - break; - case COND_AL: - fatalerror("%08x: Undefined Thumb instruction: %04x (ARM9 reserved)\n", pc, insn); - R15 += 2; - break; - case COND_NV: // SWI (this is sort of a "hole" in the opcode encoding) - ARM7.pendingSwi = 1; - ARM7_CHECKIRQ; - break; - } - break; - case 0xe: /* B #offs */ - if (insn & THUMB_BLOP_LO) - { - addr = GET_REGISTER(14); - addr += (insn & THUMB_BLOP_OFFS) << 1; - addr &= 0xfffffffc; - SET_REGISTER(14, (R15 + 4) | 1); - R15 = addr; - } - else - { - offs = (insn & THUMB_BRANCH_OFFS) << 1; - if (offs & 0x00000800) - { - offs |= 0xfffff800; - } - R15 += 4 + offs; - } - break; - case 0xf: /* BL */ - if (insn & THUMB_BLOP_LO) - { - addr = GET_REGISTER(14); - addr += (insn & THUMB_BLOP_OFFS) << 1; - SET_REGISTER(14, (R15 + 2) | 1); - R15 = addr; - //R15 += 2; - } - else - { - addr = (insn & THUMB_BLOP_OFFS) << 12; - if (addr & (1 << 22)) - { - addr |= 0xff800000; - } - addr += R15 + 4; - SET_REGISTER(14, addr); - R15 += 2; - } - break; - default: - fatalerror("%08x: Undefined Thumb instruction: %04x\n", pc, insn); - R15 += 2; - break; - } - } - else - { - - /* load 32 bit instruction */ - pc = R15; - insn = cpu_readop32(pc); - - /* process condition codes for this instruction */ - switch (insn >> INSN_COND_SHIFT) - { - case COND_EQ: - if (Z_IS_CLEAR(GET_CPSR)) - goto L_Next; - break; - case COND_NE: - if (Z_IS_SET(GET_CPSR)) - goto L_Next; - break; - case COND_CS: - if (C_IS_CLEAR(GET_CPSR)) - goto L_Next; - break; - case COND_CC: - if (C_IS_SET(GET_CPSR)) - goto L_Next; - break; - case COND_MI: - if (N_IS_CLEAR(GET_CPSR)) - goto L_Next; - break; - case COND_PL: - if (N_IS_SET(GET_CPSR)) - goto L_Next; - break; - case COND_VS: - if (V_IS_CLEAR(GET_CPSR)) - goto L_Next; - break; - case COND_VC: - if (V_IS_SET(GET_CPSR)) - goto L_Next; - break; - case COND_HI: - if (C_IS_CLEAR(GET_CPSR) || Z_IS_SET(GET_CPSR)) - goto L_Next; - break; - case COND_LS: - if (C_IS_SET(GET_CPSR) && Z_IS_CLEAR(GET_CPSR)) - goto L_Next; - break; - case COND_GE: - if (!(GET_CPSR & N_MASK) != !(GET_CPSR & V_MASK)) /* Use x ^ (x >> ...) method */ - goto L_Next; - break; - case COND_LT: - if (!(GET_CPSR & N_MASK) == !(GET_CPSR & V_MASK)) - goto L_Next; - break; - case COND_GT: - if (Z_IS_SET(GET_CPSR) || (!(GET_CPSR & N_MASK) != !(GET_CPSR & V_MASK))) - goto L_Next; - break; - case COND_LE: - if (Z_IS_CLEAR(GET_CPSR) && (!(GET_CPSR & N_MASK) == !(GET_CPSR & V_MASK))) - goto L_Next; - break; - case COND_NV: - goto L_Next; - } - /*******************************************************************/ - /* If we got here - condition satisfied, so decode the instruction */ - /*******************************************************************/ - switch ((insn & 0xF000000) >> 24) - { - case 0: - case 1: - case 2: - case 3: - /* Branch and Exchange (BX) */ - if ((insn & 0x0ffffff0) == 0x012fff10) // bits 27-4 == 000100101111111111110001 - { - R15 = GET_REGISTER(insn & 0x0f); - // If new PC address has A0 set, switch to Thumb mode - if (R15 & 1) { - SET_CPSR(GET_CPSR|T_MASK); - R15--; - } - } - else - /* Multiply OR Swap OR Half Word Data Transfer */ - if ((insn & 0x0e000000) == 0 && (insn & 0x80) && (insn & 0x10)) // bits 27-25=000 bit 7=1 bit 4=1 - { - /* Half Word Data Transfer */ - if (insn & 0x60) // bits = 6-5 != 00 - { - HandleHalfWordDT(insn); - } - else - /* Swap */ - if (insn & 0x01000000) // bit 24 = 1 - { - HandleSwap(insn); - } - /* Multiply Or Multiply Long */ - else - { - /* multiply long */ - if (insn & 0x800000) // Bit 23 = 1 for Multiply Long - { - /* Signed? */ - if (insn & 0x00400000) - HandleSMulLong(insn); - else - HandleUMulLong(insn); - } - /* multiply */ - else - { - HandleMul(insn); - } - R15 += 4; - } - } - else - /* Data Processing OR PSR Transfer */ - if ((insn & 0x0c000000) == 0) // bits 27-26 == 00 - This check can only exist properly after Multiplication check above - { - /* PSR Transfer (MRS & MSR) */ - if (((insn & 0x00100000) == 0) && ((insn & 0x01800000) == 0x01000000)) // S bit must be clear, and bit 24,23 = 10 - { - HandlePSRTransfer(insn); - ARM7_ICOUNT += 2; // PSR only takes 1 - S Cycle, so we add + 2, since at end, we -3.. - R15 += 4; - } - /* Data Processing */ - else - { - HandleALU(insn); - } - } - break; - /* Data Transfer - Single Data Access */ - case 4: - case 5: - case 6: - case 7: - HandleMemSingle(insn); - R15 += 4; - break; - /* Block Data Transfer/Access */ - case 8: - case 9: - HandleMemBlock(insn); - R15 += 4; - break; - /* Branch or Branch & Link */ - case 0xa: - case 0xb: - HandleBranch(insn); - break; - /* Co-Processor Data Transfer */ - case 0xc: - case 0xd: - HandleCoProcDT(insn); - R15 += 4; - break; - /* Co-Processor Data Operation or Register Transfer */ - case 0xe: - if (insn & 0x10) - HandleCoProcRT(insn); - else - HandleCoProcDO(insn); - R15 += 4; - break; - /* Software Interrupt */ - case 0x0f: - ARM7.pendingSwi = 1; - ARM7_CHECKIRQ; - //couldn't find any cycle counts for SWI - break; - /* Undefined */ - default: - ARM7.pendingSwi = 1; - ARM7_CHECKIRQ; - ARM7_ICOUNT -= 1; //undefined takes 4 cycles (page 77) - LOG(("%08x: Undefined instruction\n",pc-4)); - L_Next: - R15 += 4; - ARM7_ICOUNT +=2; //Any unexecuted instruction only takes 1 cycle (page 193) - } - } - - ARM7_CHECKIRQ; - - /* All instructions remove 3 cycles.. Others taking less / more will have adjusted this # prior to here */ - ARM7_ICOUNT -= 3; - total_cycles = curr_cycles + cycles - ARM7_ICOUNT; - } while (ARM7_ICOUNT > 0); - - return cycles - ARM7_ICOUNT; -} diff --git a/jan/src/cpu/arm7_intf.cpp b/jan/src/cpu/arm7_intf.cpp deleted file mode 100644 index dbe650077..000000000 --- a/jan/src/cpu/arm7_intf.cpp +++ /dev/null @@ -1,397 +0,0 @@ -#include "burnint.h" -#include "arm7_intf.h" - -//#define DEBUG_LOG - -#define MAX_MEMORY 0x80000000 // more than good enough for pgm -#define MAX_MEMORY_AND (MAX_MEMORY - 1) -#define PAGE_SIZE 0x00001000 // 400 would be better... -#define PAGE_COUNT (MAX_MEMORY/PAGE_SIZE) -#define PAGE_SHIFT 12 // 0x1000 -> 12 bits -#define PAGE_BYTE_AND 0x00fff // 0x1000 - 1 (byte align) -#define PAGE_WORD_AND 0x00ffe // 0x1000 - 2 (word align) -#define PAGE_LONG_AND 0x00ffc // 0x1000 - 4 (ignore last 4 bytes, long align) - -#define READ 0 -#define WRITE 1 -#define FETCH 2 - -static UINT8 **membase[3]; // 0 read, 1, write, 2 opcode - -static void (*pWriteLongHandler)(UINT32, UINT32) = NULL; -static void (*pWriteWordHandler)(UINT32, UINT16) = NULL; -static void (*pWriteByteHandler)(UINT32, UINT8 ) = NULL; - -static UINT16 (*pReadWordHandler)(UINT32) = NULL; -static UINT32 (*pReadLongHandler)(UINT32) = NULL; -static UINT8 (*pReadByteHandler)(UINT32) = NULL; - -static UINT32 Arm7IdleLoop = ~0; - -extern void arm7_set_irq_line(INT32 irqline, INT32 state); - -INT32 Arm7GetActive() -{ - return 0; -} - -void Arm7Exit() // only one cpu supported -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7Exit called without init\n")); -#endif - - for (INT32 i = 0; i < 3; i++) { - if (membase[i]) { - free (membase[i]); - membase[i] = NULL; - } - } - - Arm7IdleLoop = ~0; - - DebugCPU_ARM7Initted = 0; -} - -void Arm7MapMemory(UINT8 *src, UINT32 start, UINT32 finish, INT32 type) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7MapMemory called without init\n")); - if (start >= MAX_MEMORY || finish >= MAX_MEMORY) bprintf (PRINT_ERROR, _T("Arm7MapMemory memory range unsupported 0x%8.8x-0x%8.8x\n"), start, finish); -#endif - - UINT32 len = (finish-start) >> PAGE_SHIFT; - - for (UINT32 i = 0; i < len+1; i++) - { - UINT32 offset = i + (start >> PAGE_SHIFT); - if (type & (1 << READ)) membase[ READ][offset] = src + (i << PAGE_SHIFT); - if (type & (1 << WRITE)) membase[WRITE][offset] = src + (i << PAGE_SHIFT); - if (type & (1 << FETCH)) membase[FETCH][offset] = src + (i << PAGE_SHIFT); - } -} - -void Arm7SetWriteByteHandler(void (*write)(UINT32, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7SetWriteByteHandler called without init\n")); -#endif - - pWriteByteHandler = write; -} - -void Arm7SetWriteWordHandler(void (*write)(UINT32, UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7SetWriteWordHandler called without init\n")); -#endif - - pWriteWordHandler = write; -} - -void Arm7SetWriteLongHandler(void (*write)(UINT32, UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7SetWriteLongHandler called without init\n")); -#endif - - pWriteLongHandler = write; -} - -void Arm7SetReadByteHandler(UINT8 (*read)(UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7SetReadByteHandler called without init\n")); -#endif - - pReadByteHandler = read; -} - -void Arm7SetReadWordHandler(UINT16 (*read)(UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7SetReadWordHandler called without init\n")); -#endif - - pReadWordHandler = read; -} - -void Arm7SetReadLongHandler(UINT32 (*read)(UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7SetReadLongHandler called without init\n")); -#endif - - pReadLongHandler = read; -} - -void Arm7WriteByte(UINT32 addr, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7WriteByte called without init\n")); -#endif - - addr &= MAX_MEMORY_AND; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, %2.2x wb\n"), addr, data); -#endif - - if (membase[WRITE][addr >> PAGE_SHIFT] != NULL) { - membase[WRITE][addr >> PAGE_SHIFT][addr & PAGE_BYTE_AND] = data; - return; - } - - if (pWriteByteHandler) { - pWriteByteHandler(addr, data); - } -} - -void Arm7WriteWord(UINT32 addr, UINT16 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7WriteWord called without init\n")); -#endif - - addr &= MAX_MEMORY_AND; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, %8.8x wd\n"), addr, data); -#endif - - if (membase[WRITE][addr >> PAGE_SHIFT] != NULL) { - *((UINT16*)(membase[WRITE][addr >> PAGE_SHIFT] + (addr & PAGE_WORD_AND))) = data; - return; - } - - if (pWriteWordHandler) { - pWriteWordHandler(addr, data); - } -} - -void Arm7WriteLong(UINT32 addr, UINT32 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7WriteLong called without init\n")); -#endif - - addr &= MAX_MEMORY_AND; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, %8.8x wd\n"), addr, data); -#endif - - if (membase[WRITE][addr >> PAGE_SHIFT] != NULL) { - *((UINT32*)(membase[WRITE][addr >> PAGE_SHIFT] + (addr & PAGE_LONG_AND))) = data; - return; - } - - if (pWriteLongHandler) { - pWriteLongHandler(addr, data); - } -} - - -UINT8 Arm7ReadByte(UINT32 addr) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7ReadByte called without init\n")); -#endif - - addr &= MAX_MEMORY_AND; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, rb\n"), addr); -#endif - - if (membase[ READ][addr >> PAGE_SHIFT] != NULL) { - return membase[READ][addr >> PAGE_SHIFT][addr & PAGE_BYTE_AND]; - } - - if (pReadByteHandler) { - return pReadByteHandler(addr); - } - - return 0; -} - -UINT16 Arm7ReadWord(UINT32 addr) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7ReadWord called without init\n")); -#endif - - addr &= MAX_MEMORY_AND; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, rl\n"), addr); -#endif - - if (membase[ READ][addr >> PAGE_SHIFT] != NULL) { - return *((UINT16*)(membase[ READ][addr >> PAGE_SHIFT] + (addr & PAGE_WORD_AND))); - } - - if (pReadWordHandler) { - return pReadWordHandler(addr); - } - - return 0; -} - -UINT32 Arm7ReadLong(UINT32 addr) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7ReadLong called without init\n")); -#endif - - addr &= MAX_MEMORY_AND; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, rl\n"), addr); -#endif - - if (membase[ READ][addr >> PAGE_SHIFT] != NULL) { - return *((UINT32*)(membase[ READ][addr >> PAGE_SHIFT] + (addr & PAGE_LONG_AND))); - } - - if (pReadLongHandler) { - return pReadLongHandler(addr); - } - - return 0; -} - -UINT16 Arm7FetchWord(UINT32 addr) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7FetchWord called without init\n")); -#endif - - addr &= MAX_MEMORY_AND; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, rwo\n"), addr); -#endif - - // speed hack -- skip idle loop... - if (addr == Arm7IdleLoop) { - Arm7RunEnd(); - } - - if (membase[FETCH][addr >> PAGE_SHIFT] != NULL) { - return *((UINT16*)(membase[FETCH][addr >> PAGE_SHIFT] + (addr & PAGE_WORD_AND))); - } - - // good enough for now... - if (pReadWordHandler) { - return pReadWordHandler(addr); - } - - return 0; -} - -UINT32 Arm7FetchLong(UINT32 addr) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7FetchLong called without init\n")); -#endif - - addr &= MAX_MEMORY_AND; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, rlo\n"), addr); -#endif - - // speed hack - skip idle loop... - if (addr == Arm7IdleLoop) { - Arm7RunEnd(); - } - - if (membase[FETCH][addr >> PAGE_SHIFT] != NULL) { - return *((UINT32*)(membase[FETCH][addr >> PAGE_SHIFT] + (addr & PAGE_LONG_AND))); - } - - // good enough for now... - if (pReadLongHandler) { - return pReadLongHandler(addr); - } - - return 0; -} - -void Arm7SetIRQLine(INT32 line, INT32 state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7SetIRQLine called without init\n")); -#endif - - if (state == CPU_IRQSTATUS_NONE || state == CPU_IRQSTATUS_ACK) { - arm7_set_irq_line(line, state); - } - else if (CPU_IRQSTATUS_AUTO) { - arm7_set_irq_line(line, CPU_IRQSTATUS_ACK); - Arm7Run(0); - arm7_set_irq_line(line, CPU_IRQSTATUS_NONE); - } -} - -// Set address of idle loop start - speed hack -void Arm7SetIdleLoopAddress(UINT32 address) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7SetIdleLoopAddress called without init\n")); -#endif - - Arm7IdleLoop = address; -} - - -// For cheats/etc - -static void Arm7_write_rom_byte(UINT32 addr, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARM7Initted) bprintf(PRINT_ERROR, _T("Arm7_write_rom_byte called without init\n")); -#endif - addr &= MAX_MEMORY_AND; - - // write to rom & ram - if (membase[WRITE][addr >> PAGE_SHIFT] != NULL) { - membase[WRITE][addr >> PAGE_SHIFT][addr & PAGE_BYTE_AND] = data; - } - - if (membase[READ][addr >> PAGE_SHIFT] != NULL) { - membase[READ][addr >> PAGE_SHIFT][addr & PAGE_BYTE_AND] = data; - } - - if (pWriteByteHandler) { - pWriteByteHandler(addr, data); - } -} - -static cpu_core_config Arm7CheatCpuConfig = -{ - Arm7Open, - Arm7Close, - Arm7ReadByte, - Arm7_write_rom_byte, - Arm7GetActive, - Arm7TotalCycles, - Arm7NewFrame, - Arm7Run, - Arm7RunEnd, - Arm7Reset, - MAX_MEMORY, - 0 -}; - -void Arm7Init( INT32 nCPU ) // only one cpu supported -{ - DebugCPU_ARM7Initted = 1; - - for (INT32 i = 0; i < 3; i++) { - membase[i] = (UINT8**)malloc(PAGE_COUNT * sizeof(UINT8*)); - } - - CpuCheatRegister(nCPU, &Arm7CheatCpuConfig); -} diff --git a/jan/src/cpu/arm7_intf.h b/jan/src/cpu/arm7_intf.h deleted file mode 100644 index c97fd8343..000000000 --- a/jan/src/cpu/arm7_intf.h +++ /dev/null @@ -1,41 +0,0 @@ - -void Arm7WriteByte(UINT32 addr, UINT8 data); -void Arm7WriteWord(UINT32 addr, UINT16 data); -void Arm7WriteLong(UINT32 addr, UINT32 data); -UINT8 Arm7ReadByte(UINT32 addr); -UINT16 Arm7ReadWord(UINT32 addr); -UINT32 Arm7ReadLong(UINT32 addr); -UINT16 Arm7FetchWord(UINT32 addr); -UINT32 Arm7FetchLong(UINT32 addr); - -void Arm7RunEnd(); -void Arm7BurnCycles(INT32 cycles); -INT32 Arm7TotalCycles(); -void Arm7NewFrame(); - -void Arm7Init(INT32 nCPU); -void Arm7Reset(); -INT32 Arm7Run(INT32 cycles); -void Arm7Exit(); -void Arm7Open(INT32 ); -void Arm7Close(); - -INT32 Arm7Scan(INT32 nAction); - -#define ARM7_IRQ_LINE 0 -#define ARM7_FIRQ_LINE 1 - -void Arm7SetIRQLine(INT32 line, INT32 state); - -void Arm7MapMemory(UINT8 *src, UINT32 start, UINT32 finish, INT32 type); - -void Arm7SetWriteByteHandler(void (*write)(UINT32, UINT8)); -void Arm7SetWriteWordHandler(void (*write)(UINT32, UINT16)); -void Arm7SetWriteLongHandler(void (*write)(UINT32, UINT32)); -void Arm7SetReadByteHandler(UINT8 (*read)(UINT32)); -void Arm7SetReadWordHandler(UINT16 (*read)(UINT32)); -void Arm7SetReadLongHandler(UINT32 (*read)(UINT32)); - -// speed hack function -void Arm7SetIdleLoopAddress(UINT32 address); - diff --git a/jan/src/cpu/arm_intf.cpp b/jan/src/cpu/arm_intf.cpp deleted file mode 100644 index 10a6e8e68..000000000 --- a/jan/src/cpu/arm_intf.cpp +++ /dev/null @@ -1,333 +0,0 @@ -#include "burnint.h" -#include "arm_intf.h" - -//#define DEBUG_LOG - -#define MAX_MEMORY 0x04000000 // max -#define MAX_MASK 0x03ffffff // max-1 -#define PAGE_SIZE 0x00001000 // 400 would be better... -#define PAGE_COUNT (MAX_MEMORY/PAGE_SIZE) -#define PAGE_SHIFT 12 // 0x1000 -> 12 bits -#define PAGE_BYTE_AND 0x00fff // 0x1000 - 1 (byte align) -#define PAGE_LONG_AND 0x00ffc // 0x1000 - 4 (ignore last 4 bytes, long align) - -#define READ 0 -#define WRITE 1 -#define FETCH 2 - -static UINT8 **membase[3]; // 0 read, 1, write, 2 opcode - -static void (*pWriteLongHandler)(UINT32, UINT32 ) = NULL; -static void (*pWriteByteHandler)(UINT32, UINT8 ) = NULL; - -static UINT32 (*pReadLongHandler)(UINT32) = NULL; -static UINT8 (*pReadByteHandler)(UINT32) = NULL; - -UINT32 ArmSpeedHackAddress; -static void (*pArmSpeedHackCallback)(); - -extern void arm_set_irq_line(INT32 irqline, INT32 state); - -void ArmSetSpeedHack(UINT32 address, void (*pCallback)()) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmSetSpeedHack called without init\n")); -#endif - - ArmSpeedHackAddress = address; - - pArmSpeedHackCallback = pCallback; -} - -void ArmOpen(INT32) -{ - -} - -void ArmClose() -{ - -} - -void ArmMapMemory(UINT8 *src, INT32 start, INT32 finish, INT32 type) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmMapMemory called without init\n")); -#endif - - UINT32 len = (finish-start) >> PAGE_SHIFT; - - for (UINT32 i = 0; i < len+1; i++) - { - UINT32 offset = i + (start >> PAGE_SHIFT); - if (type & (1 << READ)) membase[ READ][offset] = src + (i << PAGE_SHIFT); - if (type & (1 << WRITE)) membase[WRITE][offset] = src + (i << PAGE_SHIFT); - if (type & (1 << FETCH)) membase[FETCH][offset] = src + (i << PAGE_SHIFT); - } -} - -void ArmSetWriteByteHandler(void (*write)(UINT32, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmSetWriteByteHandler called without init\n")); -#endif - - pWriteByteHandler = write; -} - -void ArmSetWriteLongHandler(void (*write)(UINT32, UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmSetWriteLongHandler called without init\n")); -#endif - - pWriteLongHandler = write; -} - -void ArmSetReadByteHandler(UINT8 (*read)(UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmSetReadByteHandler called without init\n")); -#endif - - pReadByteHandler = read; -} - -void ArmSetReadLongHandler(UINT32 (*read)(UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmSetReadLongHandler called without init\n")); -#endif - - pReadLongHandler = read; -} - -void ArmWriteByte(UINT32 addr, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmWriteByte called without init\n")); -#endif - - addr &= MAX_MASK; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, %2.2x wb\n"), addr, data); -#endif - - if (membase[WRITE][addr >> PAGE_SHIFT] != NULL) { - membase[WRITE][addr >> PAGE_SHIFT][addr & PAGE_BYTE_AND] = data; - return; - } - - if (pWriteByteHandler) { - pWriteByteHandler(addr, data); - } -} - -void ArmWriteLong(UINT32 addr, UINT32 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmWriteLong called without init\n")); -#endif - - addr &= MAX_MASK; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, %8.8x wd\n"), addr, data); -#endif - - if (membase[WRITE][addr >> PAGE_SHIFT] != NULL) { - *((UINT32*)(membase[WRITE][addr >> PAGE_SHIFT] + (addr & PAGE_LONG_AND))) = BURN_ENDIAN_SWAP_INT32(data); - return; - } - - if (pWriteLongHandler) { - pWriteLongHandler(addr, data); - } -} - - -UINT8 ArmReadByte(UINT32 addr) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmReadByte called without init\n")); -#endif - - addr &= MAX_MASK; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, rb\n"), addr); -#endif - - if (membase[ READ][addr >> PAGE_SHIFT] != NULL) { - return membase[READ][addr >> PAGE_SHIFT][addr & PAGE_BYTE_AND]; - } - - if (pReadByteHandler) { - return pReadByteHandler(addr); - } - - return 0; -} - -UINT32 ArmReadLong(UINT32 addr) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmReadLong called without init\n")); -#endif - - addr &= MAX_MASK; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, rl\n"), addr); -#endif - - if (membase[ READ][addr >> PAGE_SHIFT] != NULL) { - return BURN_ENDIAN_SWAP_INT32(*((UINT32*)(membase[ READ][addr >> PAGE_SHIFT] + (addr & PAGE_LONG_AND)))); - } - - if (pReadLongHandler) { - return pReadLongHandler(addr); - } - - return 0; -} - -UINT32 ArmFetchLong(UINT32 addr) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmFetchLong called without init\n")); -#endif - - addr &= MAX_MASK; - -#ifdef DEBUG_LOG - bprintf (PRINT_NORMAL, _T("%5.5x, rlo\n"), addr); -#endif - -#if 1 - if (ArmSpeedHackAddress == addr) { -// bprintf (0, _T("speed hack activated! %d cycles killed!\n"), ArmRemainingCycles()); - if (pArmSpeedHackCallback) { - pArmSpeedHackCallback(); - } else { - ArmRunEnd(); - } - } -#else - if (ArmSpeedHackAddress) { - bprintf (0, _T("%x, %d\n"), ArmGetPC(0), ArmRemainingCycles()); - ArmRunEnd(); - } -#endif - - if (membase[FETCH][addr >> PAGE_SHIFT] != NULL) { - return BURN_ENDIAN_SWAP_INT32(*((UINT32*)(membase[FETCH][addr >> PAGE_SHIFT] + (addr & PAGE_LONG_AND)))); - } - - // good enough for now... - if (pReadLongHandler) { - return pReadLongHandler(addr); - } - - return 0; -} - -void ArmSetIRQLine(INT32 line, INT32 state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmSetIRQLine called without init\n")); -#endif - - if (state == CPU_IRQSTATUS_NONE || state == CPU_IRQSTATUS_ACK) { - arm_set_irq_line(line, state); - } - else if (CPU_IRQSTATUS_AUTO) { - arm_set_irq_line(line, CPU_IRQSTATUS_ACK); - ArmRun(0); - arm_set_irq_line(line, CPU_IRQSTATUS_NONE); - } -} - -// For cheats/etc - -static void Arm_write_rom_byte(UINT32 addr, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("Arm_write_rom_byte called without init\n")); -#endif - - addr &= MAX_MASK; - - // write to rom & ram - if (membase[WRITE][addr >> PAGE_SHIFT] != NULL) { - membase[WRITE][addr >> PAGE_SHIFT][addr & PAGE_BYTE_AND] = data; - } - - if (membase[READ][addr >> PAGE_SHIFT] != NULL) { - membase[READ][addr >> PAGE_SHIFT][addr & PAGE_BYTE_AND] = data; - } - - if (pWriteByteHandler) { - pWriteByteHandler(addr, data); - } -} - -INT32 ArmGetActive() -{ - return 0; // only one cpu supported -} - -static cpu_core_config ArmCheatCpuConfig = -{ - ArmOpen, - ArmClose, - ArmReadByte, - Arm_write_rom_byte, - ArmGetActive, - ArmGetTotalCycles, - ArmNewFrame, - ArmRun, - ArmRunEnd, - ArmReset, - MAX_MEMORY, - 0 -}; - -void ArmInit(INT32 /*CPU*/) // only one cpu supported -{ - DebugCPU_ARMInitted = 1; - - for (INT32 i = 0; i < 3; i++) { - membase[i] = (UINT8**)malloc(PAGE_COUNT * sizeof(UINT8**)); - memset (membase[i], 0, PAGE_COUNT * sizeof(UINT8**)); - } - - pWriteLongHandler = NULL; - pWriteByteHandler = NULL; - pReadLongHandler = NULL; - pReadByteHandler = NULL; - - CpuCheatRegister(0, &ArmCheatCpuConfig); - - pArmSpeedHackCallback = NULL; - ArmSpeedHackAddress = ~0; -} - -void ArmExit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ARMInitted) bprintf(PRINT_ERROR, _T("ArmExit called without init\n")); -#endif - - if (!DebugCPU_ARMInitted) return; - - for (INT32 i = 0; i < 3; i++) { - if (membase[i]) { - free (membase[i]); - membase[i] = NULL; - } - } - - DebugCPU_ARMInitted = 0; -} diff --git a/jan/src/cpu/arm_intf.h b/jan/src/cpu/arm_intf.h deleted file mode 100644 index bd542bd90..000000000 --- a/jan/src/cpu/arm_intf.h +++ /dev/null @@ -1,72 +0,0 @@ -void ArmWriteByte(UINT32 addr, UINT8 data); -void ArmWriteLong(UINT32 addr, UINT32 data); -UINT8 ArmReadByte(UINT32 addr); -UINT32 ArmReadLong(UINT32 addr); -UINT32 ArmFetchLong(UINT32 addr); - -void ArmMapMemory(UINT8 *src, INT32 start, INT32 finish, INT32 type); - -void ArmSetWriteByteHandler(void (*write)(UINT32, UINT8)); -void ArmSetWriteLongHandler(void (*write)(UINT32, UINT32)); -void ArmSetReadByteHandler(UINT8 (*read)(UINT32)); -void ArmSetReadLongHandler(UINT32 (*read)(UINT32)); - -void ArmInit(INT32 nCPU); -void ArmOpen(INT32); -void ArmReset(); -INT32 ArmRun(INT32 cycles); -INT32 ArmScan(INT32 nAction); - -#define ARM_IRQ_LINE 0 -#define ARM_FIRQ_LINE 1 - -void ArmSetIRQLine(INT32 line, INT32 state); - -void ArmExit(); -void ArmClose(); - -extern UINT32 ArmSpeedHackAddress; -void ArmIdleCycles(INT32 cycles); -void ArmSetSpeedHack(UINT32 address, void (*pCallback)()); - -UINT32 ArmGetPC(INT32); - -UINT32 ArmRemainingCycles(); -INT32 ArmGetTotalCycles(); -void ArmRunEnd(); -void ArmNewFrame(); - - - -//----------------------------------------------------------------------------------------------------------------------------------------------- -// Macros for reading/writing to 16-bit RAM regions - -#define Write16Long(ram, a, b) \ - if (address >= a && address <= b) { \ - *((UINT16*)(ram + (((address - a) & ~3)/2))) = BURN_ENDIAN_SWAP_INT16(data); \ - return; \ - } - -#define Write16Byte(ram, a, b) \ - if (address >= a && address <= b) { \ - if (~address & 2) { \ - INT32 offset = address - a; \ - ram[(offset & 1) | ((offset & ~3) / 2)] = data; \ - } \ - return; \ - } - -#define Read16Long(ram, a, b) \ - if (address >= a && address <= b) { \ - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(ram + (((address - a) & ~3)/2)))) | ~0xffff; \ - } - -#define Read16Byte(ram, a, b) \ - if (address >= a && address <= b) { \ - if (~address & 2) { \ - INT32 offset = address - a; \ - return ram[(offset & 1) | ((offset & ~3) / 2)]; \ - } else { \ - return 0xff; \ - } \ - } diff --git a/jan/src/cpu/h6280/h6280.cpp b/jan/src/cpu/h6280/h6280.cpp deleted file mode 100644 index 3153ccb59..000000000 --- a/jan/src/cpu/h6280/h6280.cpp +++ /dev/null @@ -1,624 +0,0 @@ -/***************************************************************************** - - h6280.c - Portable HuC6280 emulator - - Copyright Bryan McPhail, mish@tendril.co.uk - - This source code is based (with permission!) on the 6502 emulator by - Juergen Buchmueller. It is released as part of the Mame emulator project. - Let me know if you intend to use this code in any other project. - - - NOTICE: - - This code is around 99% complete! Several things are unimplemented, - some due to lack of time, some due to lack of documentation, mainly - due to lack of programs using these features. - - csh, csl opcodes are not supported. - - I am unsure if flag B is set upon execution of rti. - - Cycle counts should be quite accurate. - - - Changelog, version 1.02: - JMP + indirect X (0x7c) opcode fixed. - SMB + RMB opcodes fixed in disassembler. - change_pc function calls removed. - TSB & TRB now set flags properly. - BIT opcode altered. - - Changelog, version 1.03: - Swapped IRQ mask for IRQ1 & IRQ2 (thanks Yasuhiro) - - Changelog, version 1.04, 28/9/99-22/10/99: - Adjusted RTI (thanks Karl) - TST opcodes fixed in disassembler (missing break statements in a case!). - TST behaviour fixed. - SMB/RMB/BBS/BBR fixed in disassembler. - - Changelog, version 1.05, 8/12/99-16/12/99: - Added CAB's timer implementation (note: irq ack & timer reload are changed). - Fixed STA IDX. - Fixed B flag setting on BRK. - Assumed CSH & CSL to take 2 cycles each. - - Todo: Performance could be improved by precalculating timer fire position. - - Changelog, version 1.06, 4/5/00 - last opcode bug found? - JMP indirect was doing a EAL++; instead of EAD++; - Obviously causing - a corrupt read when L = 0xff! This fixes Bloody Wolf and Trio The Punch! - - Changelog, version 1.07, 3/9/00: - Changed timer to be single shot - fixes Crude Buster music in level 1. - - Changelog, version 1.08, 8/11/05: (Charles MacDonald) - - Changed timer implementation, no longer single shot and reading the - timer registers returns the count only. Fixes the following: - - Mesopotamia: Music tempo & in-game timer - - Dragon Saber: DDA effects - - Magical Chase: Music tempo and speed regulation - - Cadash: Allows the first level to start - - Turrican: Allows the game to start - - Changed PLX and PLY to set NZ flags. Fixes: - - Afterburner: Graphics unpacking - - Aoi Blink: Collision detection with background - - Fixed the decimal version of ADC/SBC to *not* update the V flag, - only the binary ones do. - - Fixed B flag handling so it is always set outside of an interrupt; - even after being set by PLP and RTI. - - Fixed P state after reset to set I and B, leaving T, D cleared and - NVZC randomized (cleared in this case). - - Fixed interrupt processing order (Timer has highest priority followed - by IRQ1 and finally IRQ2). - - Changelog, version 1.09, 1/07/06: (Rob Bohms) - - Added emulation of the T flag, fixes PCE Ankuku Densetsu title screen - - Changelog, version 1.10, 5/09/07: (Wilbert Pol) - - - Taking of interrupts is delayed to respect a pending instruction already - in the instruction pipeline; fixes After Burner. - - Added 1 cycle for decimal mode ADC and SBC instructions. - - Changed cycle counts for CSH and CSL instructions to 3. - - Added T flag support to the SBC instruction. - - Fixed ADC T flag to set the Z flag based on the value read. - - Added 3 cycle penalty to ADC, AND, EOR, ORA, and SBC instructions - when the T flag is set. - - Fixed cycle count and support for 65536 byte blocks for the TAI, TDD, - TIA, TII, and TIN instructions. - - Fixed RDWORD macro in the disassembler. - - Fixed setting of N and V flags in the TST instructions. - - Removed unneeded debug_mmr code. - - Fixed TSB and TRB instructions. - - Added 1 delay when accessing the VDC or VCE areas. - - Implemented low and high speed cpu modes. - - Changelog, version 1.11, 18/09/07: (Wilbert Pol) - - - Improvements to the handling of taking of delayed interrupts. - -******************************************************************************/ -//#include "debugger.h" -//#include "deprecat.h" -#include "burnint.h" -#include "h6280.h" -#include "h6280_intf.h" -//#include "driver.h" - -#define offs_t unsigned int -#define change_pc(x) PCW = (x) - -#define CLEAR_LINE 0 -#define ASSERT_LINE 1 -#define INPUT_LINE_NMI 0x20 - -#define H6280_INLINE static - -extern INT32 nh6280CpuActive; - -static int h6280_ICount = 0; -//static unsigned int h6280_totalcycles = 0; - -static h6280_Regs h6280; - -void h6280_set_irq_line(INT32 irqline, INT32 state); -#define set_irq_line h6280_set_irq_line - -/* include the macros */ -#include "h6280ops.h" - -/* include the opcode macros, functions and function pointer tables */ -#include "tblh6280.c" - -#if 0 -/*****************************************************************************/ -static void h6280_init(int index, int clock, const void *config, int (*irqcallback)(int)) -{ - state_save_register_item("h6280", index, h6280.ppc.w.l); - state_save_register_item("h6280", index, h6280.pc.w.l); - state_save_register_item("h6280", index, h6280.sp.w.l); - state_save_register_item("h6280", index, h6280.zp.w.l); - state_save_register_item("h6280", index, h6280.ea.w.l); - state_save_register_item("h6280", index, h6280.a); - state_save_register_item("h6280", index, h6280.x); - state_save_register_item("h6280", index, h6280.y); - state_save_register_item("h6280", index, h6280.p); - state_save_register_item_array("h6280", index, h6280.mmr); - state_save_register_item("h6280", index, h6280.irq_mask); - state_save_register_item("h6280", index, h6280.timer_status); - state_save_register_item("h6280", index, h6280.timer_ack); - state_save_register_item("h6280", index, h6280.clocks_per_cycle); - state_save_register_item("h6280", index, h6280.timer_value); - state_save_register_item("h6280", index, h6280.timer_load); - state_save_register_item("h6280", index, h6280.nmi_state); - state_save_register_item("h6280", index, h6280.irq_state[0]); - state_save_register_item("h6280", index, h6280.irq_state[1]); - state_save_register_item("h6280", index, h6280.irq_state[2]); - state_save_register_item("h6280", index, h6280.irq_pending); - - #if LAZY_FLAGS - state_save_register_item("h6280", index, h6280.NZ); - #endif - state_save_register_item("h6280", index, h6280.io_buffer); - - h6280.irq_callback = irqcallback; -} -#endif - -void h6280_irqcallback(int (*irqcallback)(int)) -{ - h6280.irq_callback = irqcallback; -} - -void h6280Reset(void) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280Reset called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280Reset called with no CPU open\n")); -#endif - - int (*save_irqcallback)(int); - int i; - - /* wipe out the h6280 structure */ - save_irqcallback = h6280.irq_callback; - memset(&h6280, 0, sizeof(h6280_Regs)); - h6280.irq_callback = save_irqcallback; - - /* set I and B flags */ - P = _fI | _fB; - - /* stack starts at 0x01ff */ - h6280.sp.d = 0x1ff; - - /* read the reset vector into PC */ - PCL = RDMEM(H6280_RESET_VEC); - PCH = RDMEM((H6280_RESET_VEC+1)); - CHANGE_PC; - - /* CPU starts in low speed mode */ - h6280.clocks_per_cycle = 4; - - /* timer off by default */ - h6280.timer_status=0; - h6280.timer_load = 128 * 1024; - - /* clear pending interrupts */ - for (i = 0; i < 3; i++) - h6280.irq_state[i] = CLEAR_LINE; - h6280.nmi_state = CLEAR_LINE; - - h6280.irq_pending = 0; - - h6280.h6280_totalcycles = 0; -} - -#if 0 -static void h6280_exit(void) -{ - /* nothing */ -} -#endif - -int h6280Run(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280Run called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280Run called with no CPU open\n")); -#endif - - int in; - h6280_ICount = cycles; - h6280.h6280_iCycles = cycles; - - if ( h6280.irq_pending == 2 ) { - h6280.irq_pending--; - } - - /* Execute instructions */ - do - { - if ((h6280.ppc.w.l ^ h6280.pc.w.l) & 0xe000) - CHANGE_PC; - h6280.ppc = h6280.pc; - -// debugger_instruction_hook(Machine, PCW); - - /* Execute 1 instruction */ - in=RDOP(); - PCW++; - insnh6280[in](); - - if ( h6280.irq_pending ) { - if ( h6280.irq_pending == 1 ) { - if ( !(P & _fI) ) { - h6280.irq_pending--; - CHECK_AND_TAKE_IRQ_LINES; - } - } else { - h6280.irq_pending--; - } - } - - /* Check internal timer */ - if(h6280.timer_status) - { - if(h6280.timer_value<=0) - { - if ( ! h6280.irq_pending ) - h6280.irq_pending = 1; - while( h6280.timer_value <= 0 ) - h6280.timer_value += h6280.timer_load; - set_irq_line(2,ASSERT_LINE); - } - } - } while (h6280_ICount > 0); - - h6280.h6280_totalcycles += cycles - h6280_ICount; - h6280_ICount = 0; - h6280.h6280_iCycles = 0; - - return cycles - h6280_ICount; -} - -void h6280_get_context(void *dst) -{ - if( dst ) - *(h6280_Regs*)dst = h6280; -} - -void h6280_set_context(void *src) -{ - if( src ) - h6280 = *(h6280_Regs*)src; - CHANGE_PC; -} - -int h6280TotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280TotalCycles called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280TotalCycles called with no CPU open\n")); -#endif - - return h6280.h6280_totalcycles; -} - -void h6280RunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280RunEnd called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280RunEnd called with no CPU open\n")); -#endif - - h6280_ICount = 0; -} - -/*****************************************************************************/ - -void h6280_set_irq_line(int irqline, int state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_set_irq_line called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_set_irq_line called with no CPU open\n")); -#endif - - if (irqline == INPUT_LINE_NMI) - { - if ( state != ASSERT_LINE ) return; - h6280.nmi_state = state; - CHECK_IRQ_LINES; - } - else if (irqline < 3) - { - if (state == CPU_IRQSTATUS_HOLD) { - state = CPU_IRQSTATUS_ACK; - h6280.irq_hold = 1; - } - /* If the state has not changed, just return */ - if ( h6280.irq_state[irqline] == state ) - return; - - h6280.irq_state[irqline] = state; - - CHECK_IRQ_LINES; - } -} - - - -/*****************************************************************************/ - -unsigned char h6280_irq_status_r(unsigned int offset) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_irq_status_r called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_irq_status_r called with no CPU open\n")); -#endif - - int status; - - switch (offset&3) - { - default:return h6280.io_buffer;break; - case 3: - { - status=0; - if(h6280.irq_state[1]!=CLEAR_LINE) status|=1; /* IRQ 2 */ - if(h6280.irq_state[0]!=CLEAR_LINE) status|=2; /* IRQ 1 */ - if(h6280.irq_state[2]!=CLEAR_LINE) status|=4; /* TIMER */ - return status|(h6280.io_buffer&(~H6280_IRQ_MASK)); - } - case 2: return h6280.irq_mask|(h6280.io_buffer&(~H6280_IRQ_MASK));break; - } -} - -void h6280_irq_status_w(unsigned int offset, unsigned char data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_irq_status_w called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_irq_status_w called with no CPU open\n")); -#endif - - h6280.io_buffer=data; - switch (offset&3) - { - default:h6280.io_buffer=data;break; - case 2: /* Write irq mask */ - h6280.irq_mask=data&0x7; - CHECK_IRQ_LINES; - break; - - case 3: /* Timer irq ack */ - set_irq_line(2,CLEAR_LINE); - break; - } -} - -unsigned char h6280_timer_r(unsigned int) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_timer_r called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_timer_r called with no CPU open\n")); -#endif - - /* only returns countdown */ - return ((h6280.timer_value>>10)&0x7F)|(h6280.io_buffer&0x80); -} - -void h6280_timer_w(unsigned int offset, unsigned char data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_timer_w called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_timer_w called with no CPU open\n")); -#endif - - h6280.io_buffer=data; - switch (offset&1) { - case 0: /* Counter preload */ - h6280.timer_load=h6280.timer_value=((data&127)+1)*1024; - return; - - case 1: /* Counter enable */ - if(data&1) - { /* stop -> start causes reload */ - if(h6280.timer_status==0) h6280.timer_value=h6280.timer_load; - } - h6280.timer_status=data&1; - return; - } -} - -#if 0 -static int h6280_translate(int space, int intention, offs_t *addr) -{ -#if 0 - if (space == ADDRESS_SPACE_PROGRAM) - *addr = TRANSLATED(*addr); - return TRUE; -#else - if (space == 0) - *addr = TRANSLATED(*addr); - return 1; -#endif -} -#endif - -UINT8 h6280io_get_buffer() -{ - return h6280.io_buffer; -} -void h6280io_set_buffer(UINT8 data) -{ - h6280.io_buffer=data; -} - -#if 0 -/*****************************************************************************/ - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static void h6280_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(0, info->i); break; - case CPUINFO_INT_INPUT_STATE + 1: set_irq_line(1, info->i); break; - case CPUINFO_INT_INPUT_STATE + 2: set_irq_line(2, info->i); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI:set_irq_line(INPUT_LINE_NMI, info->i); break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + H6280_PC: PCW = info->i; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + H6280_S: S = info->i; break; - case CPUINFO_INT_REGISTER + H6280_P: P = info->i; break; - case CPUINFO_INT_REGISTER + H6280_A: A = info->i; break; - case CPUINFO_INT_REGISTER + H6280_X: X = info->i; break; - case CPUINFO_INT_REGISTER + H6280_Y: Y = info->i; break; - case CPUINFO_INT_REGISTER + H6280_IRQ_MASK: h6280.irq_mask = info->i; CHECK_IRQ_LINES; break; - case CPUINFO_INT_REGISTER + H6280_TIMER_STATE: h6280.timer_status = info->i; break; - case CPUINFO_INT_REGISTER + H6280_NMI_STATE: set_irq_line( INPUT_LINE_NMI, info->i ); break; - case CPUINFO_INT_REGISTER + H6280_IRQ1_STATE: set_irq_line( 0, info->i ); break; - case CPUINFO_INT_REGISTER + H6280_IRQ2_STATE: set_irq_line( 1, info->i ); break; - case CPUINFO_INT_REGISTER + H6280_IRQT_STATE: set_irq_line( 2, info->i ); break; - case CPUINFO_INT_REGISTER + H6280_M1: h6280.mmr[0] = info->i; break; - case CPUINFO_INT_REGISTER + H6280_M2: h6280.mmr[1] = info->i; break; - case CPUINFO_INT_REGISTER + H6280_M3: h6280.mmr[2] = info->i; break; - case CPUINFO_INT_REGISTER + H6280_M4: h6280.mmr[3] = info->i; break; - case CPUINFO_INT_REGISTER + H6280_M5: h6280.mmr[4] = info->i; break; - case CPUINFO_INT_REGISTER + H6280_M6: h6280.mmr[5] = info->i; break; - case CPUINFO_INT_REGISTER + H6280_M7: h6280.mmr[6] = info->i; break; - case CPUINFO_INT_REGISTER + H6280_M8: h6280.mmr[7] = info->i; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void h6280_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(h6280); break; - case CPUINFO_INT_INPUT_LINES: info->i = 3; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 7; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 17 + 6*65536; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 21; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 2; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + 0: info->i = h6280.irq_state[0]; break; - case CPUINFO_INT_INPUT_STATE + 1: info->i = h6280.irq_state[1]; break; - case CPUINFO_INT_INPUT_STATE + 2: info->i = h6280.irq_state[2]; break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = h6280.nmi_state; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = h6280.ppc.d; break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + H6280_PC: info->i = PCD; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + H6280_S: info->i = S; break; - case CPUINFO_INT_REGISTER + H6280_P: info->i = P; break; - case CPUINFO_INT_REGISTER + H6280_A: info->i = A; break; - case CPUINFO_INT_REGISTER + H6280_X: info->i = X; break; - case CPUINFO_INT_REGISTER + H6280_Y: info->i = Y; break; - case CPUINFO_INT_REGISTER + H6280_IRQ_MASK: info->i = h6280.irq_mask; break; - case CPUINFO_INT_REGISTER + H6280_TIMER_STATE: info->i = h6280.timer_status; break; - case CPUINFO_INT_REGISTER + H6280_NMI_STATE: info->i = h6280.nmi_state; break; - case CPUINFO_INT_REGISTER + H6280_IRQ1_STATE: info->i = h6280.irq_state[0]; break; - case CPUINFO_INT_REGISTER + H6280_IRQ2_STATE: info->i = h6280.irq_state[1]; break; - case CPUINFO_INT_REGISTER + H6280_IRQT_STATE: info->i = h6280.irq_state[2]; break; - case CPUINFO_INT_REGISTER + H6280_M1: info->i = h6280.mmr[0]; break; - case CPUINFO_INT_REGISTER + H6280_M2: info->i = h6280.mmr[1]; break; - case CPUINFO_INT_REGISTER + H6280_M3: info->i = h6280.mmr[2]; break; - case CPUINFO_INT_REGISTER + H6280_M4: info->i = h6280.mmr[3]; break; - case CPUINFO_INT_REGISTER + H6280_M5: info->i = h6280.mmr[4]; break; - case CPUINFO_INT_REGISTER + H6280_M6: info->i = h6280.mmr[5]; break; - case CPUINFO_INT_REGISTER + H6280_M7: info->i = h6280.mmr[6]; break; - case CPUINFO_INT_REGISTER + H6280_M8: info->i = h6280.mmr[7]; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = h6280_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = h6280_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = h6280_set_context; break; - case CPUINFO_PTR_INIT: info->init = h6280_init; break; - case CPUINFO_PTR_RESET: info->reset = h6280_reset; break; - case CPUINFO_PTR_EXIT: info->exit = h6280_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = h6280_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = h6280_dasm; break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &h6280_ICount; break; - case CPUINFO_PTR_TRANSLATE: info->translate = h6280_translate; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "HuC6280"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Hudsonsoft 6280"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.11"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Bryan McPhail, mish@tendril.co.uk"); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c%c%c%c%c%c%c%c", - h6280.p & 0x80 ? 'N':'.', - h6280.p & 0x40 ? 'V':'.', - h6280.p & 0x20 ? 'R':'.', - h6280.p & 0x10 ? 'B':'.', - h6280.p & 0x08 ? 'D':'.', - h6280.p & 0x04 ? 'I':'.', - h6280.p & 0x02 ? 'Z':'.', - h6280.p & 0x01 ? 'C':'.'); - break; - - case CPUINFO_STR_REGISTER + H6280_PC: sprintf(info->s, "PC:%04X", h6280.pc.d); break; - case CPUINFO_STR_REGISTER + H6280_S: sprintf(info->s, "S:%02X", h6280.sp.b.l); break; - case CPUINFO_STR_REGISTER + H6280_P: sprintf(info->s, "P:%02X", h6280.p); break; - case CPUINFO_STR_REGISTER + H6280_A: sprintf(info->s, "A:%02X", h6280.a); break; - case CPUINFO_STR_REGISTER + H6280_X: sprintf(info->s, "X:%02X", h6280.x); break; - case CPUINFO_STR_REGISTER + H6280_Y: sprintf(info->s, "Y:%02X", h6280.y); break; - case CPUINFO_STR_REGISTER + H6280_IRQ_MASK: sprintf(info->s, "IM:%02X", h6280.irq_mask); break; - case CPUINFO_STR_REGISTER + H6280_TIMER_STATE: sprintf(info->s, "TMR:%02X", h6280.timer_status); break; - case CPUINFO_STR_REGISTER + H6280_NMI_STATE: sprintf(info->s, "NMI:%X", h6280.nmi_state); break; - case CPUINFO_STR_REGISTER + H6280_IRQ1_STATE: sprintf(info->s, "IRQ1:%X", h6280.irq_state[0]); break; - case CPUINFO_STR_REGISTER + H6280_IRQ2_STATE: sprintf(info->s, "IRQ2:%X", h6280.irq_state[1]); break; - case CPUINFO_STR_REGISTER + H6280_IRQT_STATE: sprintf(info->s, "IRQT:%X", h6280.irq_state[2]); break; - case CPUINFO_STR_REGISTER + H6280_M1: sprintf(info->s, "M1:%02X", h6280.mmr[0]); break; - case CPUINFO_STR_REGISTER + H6280_M2: sprintf(info->s, "M2:%02X", h6280.mmr[1]); break; - case CPUINFO_STR_REGISTER + H6280_M3: sprintf(info->s, "M3:%02X", h6280.mmr[2]); break; - case CPUINFO_STR_REGISTER + H6280_M4: sprintf(info->s, "M4:%02X", h6280.mmr[3]); break; - case CPUINFO_STR_REGISTER + H6280_M5: sprintf(info->s, "M5:%02X", h6280.mmr[4]); break; - case CPUINFO_STR_REGISTER + H6280_M6: sprintf(info->s, "M6:%02X", h6280.mmr[5]); break; - case CPUINFO_STR_REGISTER + H6280_M7: sprintf(info->s, "M7:%02X", h6280.mmr[6]); break; - case CPUINFO_STR_REGISTER + H6280_M8: sprintf(info->s, "M8:%02X", h6280.mmr[7]); break; - } -} -#endif diff --git a/jan/src/cpu/h6280/h6280.h b/jan/src/cpu/h6280/h6280.h deleted file mode 100644 index edaafc72b..000000000 --- a/jan/src/cpu/h6280/h6280.h +++ /dev/null @@ -1,92 +0,0 @@ -/***************************************************************************** - - h6280.h Portable Hu6280 emulator interface - - Copyright Bryan McPhail, mish@tendril.co.uk - - This source code is based (with permission!) on the 6502 emulator by - Juergen Buchmueller. It is released as part of the Mame emulator project. - Let me know if you intend to use this code in any other project. - -******************************************************************************/ - -#pragma once - -#ifndef __H6280_H__ -#define __H6280_H__ - - -#define LAZY_FLAGS 0 - -/**************************************************************************** - * The 6280 registers. - ****************************************************************************/ -typedef struct -{ - PAIR ppc; /* previous program counter */ - PAIR pc; /* program counter */ - PAIR sp; /* stack pointer (always 100 - 1FF) */ - PAIR zp; /* zero page address */ - PAIR ea; /* effective address */ - UINT8 a; /* Accumulator */ - UINT8 x; /* X index register */ - UINT8 y; /* Y index register */ - UINT8 p; /* Processor status */ - UINT8 mmr[8]; /* Hu6280 memory mapper registers */ - UINT8 irq_mask; /* interrupt enable/disable */ - UINT8 timer_status; /* timer status */ - UINT8 timer_ack; /* timer acknowledge */ - UINT8 clocks_per_cycle; /* 4 = low speed mode, 1 = high speed mode */ - INT32 timer_value; /* timer interrupt */ - INT32 timer_load; /* reload value */ - UINT8 nmi_state; - UINT8 irq_state[3]; - UINT8 irq_pending; - INT32 irq_hold; - - ALIGN_VAR(8) int (*irq_callback)(int irqline); - - unsigned int h6280_iCycles; - unsigned int h6280_totalcycles; - -#if LAZY_FLAGS - INT32 NZ; /* last value (lazy N and Z flag) */ -#endif - UINT8 io_buffer; /* last value written to the PSG, timer, and interrupt pages */ -} h6280_Regs; - -void h6280_set_context(void *ptr); -void h6280_get_context(void *ptr); - -enum -{ - H6280_PC=1, H6280_S, H6280_P, H6280_A, H6280_X, H6280_Y, - H6280_IRQ_MASK, H6280_TIMER_STATE, - H6280_NMI_STATE, H6280_IRQ1_STATE, H6280_IRQ2_STATE, H6280_IRQT_STATE, - H6280_M1, H6280_M2, H6280_M3, H6280_M4, - H6280_M5, H6280_M6, H6280_M7, H6280_M8 -}; - -#define H6280_RESET_VEC 0xfffe -#define H6280_NMI_VEC 0xfffc -#define H6280_TIMER_VEC 0xfffa -#define H6280_IRQ1_VEC 0xfff8 -#define H6280_IRQ2_VEC 0xfff6 /* Aka BRK vector */ - -//void h6280_get_info(UINT32 state, cpuinfo *info); - -#if 0 -READ8_HANDLER( h6280_irq_status_r ); -WRITE8_HANDLER( h6280_irq_status_w ); - -READ8_HANDLER( h6280_timer_r ); -WRITE8_HANDLER( h6280_timer_w ); - -/* functions for use by the PSG and joypad port only! */ -UINT8 h6280io_get_buffer(void); -void h6280io_set_buffer(UINT8); -#endif - -//offs_t h6280_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - -#endif /* __H6280_H__ */ diff --git a/jan/src/cpu/h6280/h6280ops.h b/jan/src/cpu/h6280/h6280ops.h deleted file mode 100644 index 3818142b6..000000000 --- a/jan/src/cpu/h6280/h6280ops.h +++ /dev/null @@ -1,1387 +0,0 @@ -/***************************************************************************** - - h6280ops.h - Addressing modes and opcode macros for the Hu6820 cpu - - Copyright Bryan McPhail, mish@tendril.co.uk - - This source code is based (with permission!) on the 6502 emulator by - Juergen Buchmueller. It is released as part of the Mame emulator project. - Let me know if you intend to use this code in any other project. - -******************************************************************************/ - -/* 6280 flags */ -#define _fC 0x01 -#define _fZ 0x02 -#define _fI 0x04 -#define _fD 0x08 -#define _fB 0x10 -#define _fT 0x20 -#define _fV 0x40 -#define _fN 0x80 - -/* some shortcuts for improved readability */ -#define A h6280.a -#define X h6280.x -#define Y h6280.y -#define P h6280.p -#define S h6280.sp.b.l - -#define TRANSLATED(addr) ((h6280.mmr[((addr)>>13)&7] << 13) | ((addr)&0x1fff)) -#define CHANGE_PC change_pc(PCW) -#define H6280_CYCLES(cyc) \ - { \ - h6280_ICount -= ((cyc) * h6280.clocks_per_cycle); \ - h6280.timer_value -= ((cyc) * h6280.clocks_per_cycle); \ - } - -#if LAZY_FLAGS - -#define NZ h6280.NZ -#define SET_NZ(n) \ - P &= ~_fT; \ - NZ = ((n & _fN) << 8) | n - -#else - -#define SET_NZ(n) \ - P = (P & ~(_fN|_fT|_fZ)) | \ - (n & _fN) | \ - ((n == 0) ? _fZ : 0) - -#endif - -#define EAL h6280.ea.b.l -#define EAH h6280.ea.b.h -#define EAW h6280.ea.w.l -#define EAD h6280.ea.d - -#define ZPL h6280.zp.b.l -#define ZPH h6280.zp.b.h -#define ZPW h6280.zp.w.l -#define ZPD h6280.zp.d - -#define PCL h6280.pc.b.l -#define PCH h6280.pc.b.h -#define PCW h6280.pc.w.l -#define PCD h6280.pc.d - -#define CLEAR_T \ - P &= ~_fT; - -#define DO_INTERRUPT(vector) \ -{ \ - H6280_CYCLES(7); /* 7 cycles for an int */ \ - PUSH(PCH); \ - PUSH(PCL); \ - COMPOSE_P(0,_fB); \ - PUSH(P); \ - P = (P & ~_fD) | _fI; /* knock out D and set I flag */ \ - PCL = RDMEM(vector); \ - PCH = RDMEM((vector+1)); \ - CHANGE_PC; \ -} - -#define CHECK_AND_TAKE_IRQ_LINES \ - if ( h6280.nmi_state != CLEAR_LINE ) { \ - h6280.nmi_state = CLEAR_LINE; \ - DO_INTERRUPT(H6280_NMI_VEC); \ - } \ - else if( !(P & _fI) ) \ - { \ - if ( h6280.irq_state[2] != CLEAR_LINE && \ - !(h6280.irq_mask & 0x4) ) \ - { \ - DO_INTERRUPT(H6280_TIMER_VEC); \ - } else \ - if ( h6280.irq_state[0] != CLEAR_LINE && \ - !(h6280.irq_mask & 0x2) ) \ - { \ - DO_INTERRUPT(H6280_IRQ1_VEC); \ - if (h6280.irq_hold) { \ - h6280.irq_hold = 0; \ - h6280_set_irq_line(0, CPU_IRQSTATUS_NONE); \ - } \ - if (h6280.irq_callback) (*h6280.irq_callback)(0); \ - } else \ - if ( h6280.irq_state[1] != CLEAR_LINE && \ - !(h6280.irq_mask & 0x1) ) \ - { \ - DO_INTERRUPT(H6280_IRQ2_VEC); \ - if (h6280.irq_hold) { \ - h6280.irq_hold = 0; \ - h6280_set_irq_line(1, CPU_IRQSTATUS_NONE); \ - } \ - if (h6280.irq_callback) (*h6280.irq_callback)(1); \ - } \ - } - -#define CHECK_IRQ_LINES \ - if ( ! h6280.irq_pending ) \ - h6280.irq_pending = 2; - -/*************************************************************** - * CHECK_VDC_VCE_PENALTY - * The CPU inserts 1 clock delay when accessing the VDC or VCE - * area. - ***************************************************************/ -#define CHECK_VDC_VCE_PENALTY(addr) \ - if ( ( TRANSLATED(addr) & 0x1FF800 ) == 0x1FE000 ) { \ - H6280_CYCLES(1); \ - } - -/*************************************************************** - * RDMEM read memory - ***************************************************************/ -H6280_INLINE UINT8 RDMEM(offs_t addr) { - CHECK_VDC_VCE_PENALTY(addr); - return h6280Read(TRANSLATED(addr)); -} - -/*************************************************************** - * WRMEM write memory - ***************************************************************/ -H6280_INLINE void WRMEM(offs_t addr, UINT8 data) { - CHECK_VDC_VCE_PENALTY(addr); - h6280Write(TRANSLATED(addr),data); -} - -/*************************************************************** - * RDMEMZ read memory - zero page - ***************************************************************/ -#define RDMEMZ(addr) \ - h6280Read( (h6280.mmr[1] << 13) | ((addr)&0x1fff)); - -/*************************************************************** - * WRMEMZ write memory - zero page - ***************************************************************/ -#define WRMEMZ(addr,data) \ - h6280Write( (h6280.mmr[1] << 13) | ((addr)&0x1fff),data); - -/*************************************************************** - * RDMEMW read word from memory - ***************************************************************/ -#define RDMEMW(addr) \ - h6280Read(TRANSLATED(addr)) \ -| ( h6280Read(TRANSLATED(addr+1)) << 8 ) - -/*************************************************************** - * RDZPWORD read a word from a zero page address - ***************************************************************/ -#define RDZPWORD(addr) \ - ((addr&0xff)==0xff) ? \ - h6280Read( (h6280.mmr[1] << 13) | ((addr)&0x1fff)) \ - +(h6280Read( (h6280.mmr[1] << 13) | ((addr-0xff)&0x1fff))<<8) : \ - h6280Read( (h6280.mmr[1] << 13) | ((addr)&0x1fff)) \ - +(h6280Read( (h6280.mmr[1] << 13) | ((addr+1)&0x1fff))<<8) - - -/*************************************************************** - * push a register onto the stack - ***************************************************************/ -#define PUSH(Rg) h6280Write( (h6280.mmr[1] << 13) | h6280.sp.d,Rg); S-- - -/*************************************************************** - * pull a register from the stack - ***************************************************************/ -#define PULL(Rg) S++; Rg = h6280Read( (h6280.mmr[1] << 13) | h6280.sp.d) - -/*************************************************************** - * RDOP read an opcode - ***************************************************************/ -#define RDOP() \ - h6280Fetch(TRANSLATED(PCW)) - -/*************************************************************** - * RDOPARG read an opcode argument - ***************************************************************/ -#define RDOPARG() \ - h6280Fetch(TRANSLATED(PCW)) - -/*************************************************************** - * BRA branch relative - ***************************************************************/ -#define BRA(cond) \ - CLEAR_T; \ - if (cond) \ - { \ - H6280_CYCLES(4); \ - tmp = RDOPARG(); \ - PCW++; \ - EAW = PCW + (signed char)tmp; \ - PCD = EAD; \ - CHANGE_PC; \ - } \ - else \ - { \ - PCW++; \ - H6280_CYCLES(2); \ - } - -/*************************************************************** - * - * Helper macros to build the effective address - * - ***************************************************************/ - -/*************************************************************** - * EA = zero page address - ***************************************************************/ -#define EA_ZPG \ - ZPL = RDOPARG(); \ - PCW++; \ - EAD = ZPD - -/*************************************************************** - * EA = zero page address - T flag - ***************************************************************/ -#define EA_TFLG \ - ZPL = X; \ - EAD = ZPD - -/*************************************************************** - * EA = zero page address + X - ***************************************************************/ -#define EA_ZPX \ - ZPL = RDOPARG() + X; \ - PCW++; \ - EAD = ZPD - -/*************************************************************** - * EA = zero page address + Y - ***************************************************************/ -#define EA_ZPY \ - ZPL = RDOPARG() + Y; \ - PCW++; \ - EAD = ZPD - -/*************************************************************** - * EA = absolute address - ***************************************************************/ -#define EA_ABS \ - EAL = RDOPARG(); \ - PCW++; \ - EAH = RDOPARG(); \ - PCW++ - -/*************************************************************** - * EA = absolute address + X - ***************************************************************/ -#define EA_ABX \ - EA_ABS; \ - EAW += X - -/*************************************************************** - * EA = absolute address + Y - ***************************************************************/ -#define EA_ABY \ - EA_ABS; \ - EAW += Y - -/*************************************************************** - * EA = zero page indirect (65c02 pre indexed w/o X) - ***************************************************************/ -#define EA_ZPI \ - ZPL = RDOPARG(); \ - PCW++; \ - EAD = RDZPWORD(ZPD) - -/*************************************************************** - * EA = zero page + X indirect (pre indexed) - ***************************************************************/ -#define EA_IDX \ - ZPL = RDOPARG() + X; \ - PCW++; \ - EAD = RDZPWORD(ZPD); - -/*************************************************************** - * EA = zero page indirect + Y (post indexed) - ***************************************************************/ -#define EA_IDY \ - ZPL = RDOPARG(); \ - PCW++; \ - EAD = RDZPWORD(ZPD); \ - EAW += Y - -/*************************************************************** - * EA = indirect (only used by JMP) - ***************************************************************/ -#define EA_IND \ - EA_ABS; \ - tmp = RDMEM(EAD); \ - EAD++; \ - EAH = RDMEM(EAD); \ - EAL = tmp - -/*************************************************************** - * EA = indirect plus x (only used by JMP) - ***************************************************************/ -#define EA_IAX \ - EA_ABS; \ - EAD+=X; \ - tmp = RDMEM(EAD); \ - EAD++; \ - EAH = RDMEM(EAD); \ - EAL = tmp - -/* read a value into tmp */ -#define RD_IMM tmp = RDOPARG(); PCW++ -#define RD_IMM2 tmp2 = RDOPARG(); PCW++ -#define RD_ACC tmp = A -#define RD_ZPG EA_ZPG; tmp = RDMEMZ(EAD) -#define RD_ZPX EA_ZPX; tmp = RDMEMZ(EAD) -#define RD_ZPY EA_ZPY; tmp = RDMEMZ(EAD) -#define RD_ABS EA_ABS; tmp = RDMEM(EAD) -#define RD_ABX EA_ABX; tmp = RDMEM(EAD) -#define RD_ABY EA_ABY; tmp = RDMEM(EAD) -#define RD_ZPI EA_ZPI; tmp = RDMEM(EAD) -#define RD_IDX EA_IDX; tmp = RDMEM(EAD) -#define RD_IDY EA_IDY; tmp = RDMEM(EAD) -#define RD_TFL EA_TFLG; tflagtemp = RDMEMZ(EAD) - -/* write a value from tmp */ -#define WR_ZPG EA_ZPG; WRMEMZ(EAD, tmp) -#define WR_ZPX EA_ZPX; WRMEMZ(EAD, tmp) -#define WR_ZPY EA_ZPY; WRMEMZ(EAD, tmp) -#define WR_ABS EA_ABS; WRMEM(EAD, tmp) -#define WR_ABX EA_ABX; WRMEM(EAD, tmp) -#define WR_ABY EA_ABY; WRMEM(EAD, tmp) -#define WR_ZPI EA_ZPI; WRMEM(EAD, tmp) -#define WR_IDX EA_IDX; WRMEM(EAD, tmp) -#define WR_IDY EA_IDY; WRMEM(EAD, tmp) - -/* write back a value from tmp to the last EA */ -#define WB_ACC A = (UINT8)tmp; -#define WB_EA WRMEM(EAD, tmp) -#define WB_EAZ WRMEMZ(EAD, tmp) -#define WB_TFL WRMEMZ(EAD, tflagtemp) - -/*************************************************************** - * - * Macros to emulate the 6280 opcodes - * - ***************************************************************/ - -/*************************************************************** - * compose the real flag register by - * including N and Z and set any - * SET and clear any CLR bits also - ***************************************************************/ -#if LAZY_FLAGS - -#define COMPOSE_P(SET,CLR) \ - P = (P & ~(_fN | _fZ | CLR)) | \ - (NZ >> 8) | \ - ((NZ & 0xff) ? 0 : _fZ) | \ - SET - -#else - -#define COMPOSE_P(SET,CLR) \ - P = (P & ~CLR) | SET - -#endif - -/* 6280 ******************************************************** - * ADC Add with carry - ***************************************************************/ -#define TADC \ - { \ - int tflagtemp; \ - CLEAR_T; \ - RD_TFL; \ - if (P & _fD) \ - { \ - int c = (P & _fC); \ - int lo = (tflagtemp & 0x0f) + (tmp & 0x0f) + c; \ - int hi = (tflagtemp & 0xf0) + (tmp & 0xf0); \ - P &= ~_fC; \ - if (lo > 0x09) \ - { \ - hi += 0x10; \ - lo += 0x06; \ - } \ - if (hi > 0x90) \ - hi += 0x60; \ - if (hi & 0xff00) \ - P |= _fC; \ - tflagtemp = (lo & 0x0f) + (hi & 0xf0); \ - H6280_CYCLES(1); \ - } \ - else \ - { \ - int c = (P & _fC); \ - int sum = tflagtemp + tmp + c; \ - P &= ~(_fV | _fC); \ - if (~(tflagtemp^tmp) & (tflagtemp^sum) & _fN) \ - P |= _fV; \ - if (sum & 0xff00) \ - P |= _fC; \ - tflagtemp = (UINT8) sum; \ - } \ - SET_NZ(tflagtemp); \ - WB_TFL; \ - H6280_CYCLES(3); \ - } - - -#define ADC \ - if(P & _fT) \ - TADC \ - else { \ - if (P & _fD) \ - { \ - int c = (P & _fC); \ - int lo = (A & 0x0f) + (tmp & 0x0f) + c; \ - int hi = (A & 0xf0) + (tmp & 0xf0); \ - P &= ~_fC; \ - if (lo > 0x09) \ - { \ - hi += 0x10; \ - lo += 0x06; \ - } \ - if (hi > 0x90) \ - hi += 0x60; \ - if (hi & 0xff00) \ - P |= _fC; \ - A = (lo & 0x0f) + (hi & 0xf0); \ - H6280_CYCLES(1); \ - } \ - else \ - { \ - int c = (P & _fC); \ - int sum = A + tmp + c; \ - P &= ~(_fV | _fC); \ - if (~(A^tmp) & (A^sum) & _fN) \ - P |= _fV; \ - if (sum & 0xff00) \ - P |= _fC; \ - A = (UINT8) sum; \ - } \ - SET_NZ(A); \ - } - -/* 6280 ******************************************************** - * AND Logical and - ***************************************************************/ -#define TAND \ - { \ - int tflagtemp; \ - CLEAR_T; \ - RD_TFL; \ - tflagtemp = (UINT8)(tflagtemp & tmp); \ - WB_TFL; \ - SET_NZ(tflagtemp); \ - H6280_CYCLES(3); \ - } - -#define AND \ - if(P & _fT) \ - TAND \ - else { \ - A = (UINT8)(A & tmp); \ - SET_NZ(A); \ - } - -/* 6280 ******************************************************** - * ASL Arithmetic shift left - ***************************************************************/ -#define ASL \ - CLEAR_T; \ - P = (P & ~_fC) | ((tmp >> 7) & _fC); \ - tmp = (UINT8)(tmp << 1); \ - SET_NZ(tmp) - -/* 6280 ******************************************************** - * BBR Branch if bit is reset - ***************************************************************/ -#define BBR(bit) \ - BRA(!(tmp & (1<= tmp) \ - P |= _fC; \ - SET_NZ((UINT8)(A - tmp)) - -/* 6280 ******************************************************** - * CPX Compare index X - ***************************************************************/ -#define CPX \ - CLEAR_T; \ - P &= ~_fC; \ - if (X >= tmp) \ - P |= _fC; \ - SET_NZ((UINT8)(X - tmp)) - -/* 6280 ******************************************************** - * CPY Compare index Y - ***************************************************************/ -#define CPY \ - CLEAR_T; \ - P &= ~_fC; \ - if (Y >= tmp) \ - P |= _fC; \ - SET_NZ((UINT8)(Y - tmp)) - -/* 6280 ******************************************************** - * DEA Decrement accumulator - ***************************************************************/ -#define DEA \ - CLEAR_T; \ - A = (UINT8)--A; \ - SET_NZ(A) - -/* 6280 ******************************************************** - * DEC Decrement memory - ***************************************************************/ -#define DEC \ - CLEAR_T; \ - tmp = (UINT8)(tmp-1); \ - SET_NZ(tmp) - -/* 6280 ******************************************************** - * DEX Decrement index X - ***************************************************************/ -#define DEX \ - CLEAR_T; \ - X = (UINT8)--X; \ - SET_NZ(X) - -/* 6280 ******************************************************** - * DEY Decrement index Y - ***************************************************************/ -#define DEY \ - CLEAR_T; \ - Y = (UINT8)--Y; \ - SET_NZ(Y) - -/* 6280 ******************************************************** - * EOR Logical exclusive or - ***************************************************************/ -#define TEOR \ - { \ - int tflagtemp; \ - CLEAR_T; \ - RD_TFL; \ - tflagtemp = (UINT8)(tflagtemp ^ tmp); \ - WB_TFL; \ - SET_NZ(tflagtemp); \ - H6280_CYCLES(3); \ - } - -#define EOR \ - if(P & _fT) \ - TEOR \ - else { \ - A = (UINT8)(A ^ tmp); \ - SET_NZ(A); \ - } - -/* 6280 ******************************************************** - * INA Increment accumulator - ***************************************************************/ -#define INA \ - CLEAR_T; \ - A = (UINT8)++A; \ - SET_NZ(A) - -/* 6280 ******************************************************** - * INC Increment memory - ***************************************************************/ -#define INC \ - CLEAR_T; \ - tmp = (UINT8)(tmp+1); \ - SET_NZ(tmp) - -/* 6280 ******************************************************** - * INX Increment index X - ***************************************************************/ -#define INX \ - CLEAR_T; \ - X = (UINT8)++X; \ - SET_NZ(X) - -/* 6280 ******************************************************** - * INY Increment index Y - ***************************************************************/ -#define INY \ - CLEAR_T; \ - Y = (UINT8)++Y; \ - SET_NZ(Y) - -/* 6280 ******************************************************** - * JMP Jump to address - * set PC to the effective address - ***************************************************************/ -#define JMP \ - CLEAR_T; \ - PCD = EAD; \ - CHANGE_PC - -/* 6280 ******************************************************** - * JSR Jump to subroutine - * decrement PC (sic!) push PC hi, push PC lo and set - * PC to the effective address - ***************************************************************/ -#define JSR \ - CLEAR_T; \ - PCW--; \ - PUSH(PCH); \ - PUSH(PCL); \ - PCD = EAD; \ - CHANGE_PC - -/* 6280 ******************************************************** - * LDA Load accumulator - ***************************************************************/ -#define LDA \ - CLEAR_T; \ - A = (UINT8)tmp; \ - SET_NZ(A) - -/* 6280 ******************************************************** - * LDX Load index X - ***************************************************************/ -#define LDX \ - CLEAR_T; \ - X = (UINT8)tmp; \ - SET_NZ(X) - -/* 6280 ******************************************************** - * LDY Load index Y - ***************************************************************/ -#define LDY \ - CLEAR_T; \ - Y = (UINT8)tmp; \ - SET_NZ(Y) - -/* 6280 ******************************************************** - * LSR Logic shift right - * 0 -> [7][6][5][4][3][2][1][0] -> C - ***************************************************************/ -#define LSR \ - CLEAR_T; \ - P = (P & ~_fC) | (tmp & _fC); \ - tmp = (UINT8)tmp >> 1; \ - SET_NZ(tmp) - -/* 6280 ******************************************************** - * NOP No operation - ***************************************************************/ -#define NOP CLEAR_T; - -/* 6280 ******************************************************** - * ORA Logical inclusive or - ***************************************************************/ - -#define TORA \ - { \ - int tflagtemp; \ - CLEAR_T; \ - RD_TFL; \ - tflagtemp = (UINT8)(tflagtemp | tmp); \ - WB_TFL; \ - SET_NZ(tflagtemp); \ - H6280_CYCLES(3); \ - } - -#define ORA \ - if(P & _fT) \ - TORA \ - else { \ - A = (UINT8)(A | tmp); \ - SET_NZ(A); \ - } - -/* 6280 ******************************************************** - * PHA Push accumulator - ***************************************************************/ -#define PHA \ - CLEAR_T; \ - PUSH(A) - -/* 6280 ******************************************************** - * PHP Push processor status (flags) - ***************************************************************/ -#define PHP \ - CLEAR_T; \ - COMPOSE_P(0,0); \ - PUSH(P) - -/* 6280 ******************************************************** - * PHX Push index X - ***************************************************************/ -#define PHX \ - CLEAR_T; \ - PUSH(X) - -/* 6280 ******************************************************** - * PHY Push index Y - ***************************************************************/ -#define PHY \ - CLEAR_T; \ - PUSH(Y) - -/* 6280 ******************************************************** - * PLA Pull accumulator - ***************************************************************/ -#define PLA \ - CLEAR_T; \ - PULL(A); \ - SET_NZ(A) - -/* 6280 ******************************************************** - * PLP Pull processor status (flags) - ***************************************************************/ -#if LAZY_FLAGS - -#define PLP \ - PULL(P); \ - P |= _fB; \ - NZ = ((P & _fN) << 8) | \ - ((P & _fZ) ^ _fZ); \ - CHECK_IRQ_LINES - -#else - -#define PLP \ - PULL(P); \ - P |= _fB; \ - CHECK_IRQ_LINES -#endif - -/* 6280 ******************************************************** - * PLX Pull index X - ***************************************************************/ -#define PLX \ - CLEAR_T; \ - PULL(X); \ - SET_NZ(X) - -/* 6280 ******************************************************** - * PLY Pull index Y - ***************************************************************/ -#define PLY \ - CLEAR_T; \ - PULL(Y); \ - SET_NZ(Y) - -/* 6280 ******************************************************** - * RMB Reset memory bit - ***************************************************************/ -#define RMB(bit) \ - CLEAR_T; \ - tmp &= ~(1<> 8) & _fC); \ - tmp = (UINT8)tmp; \ - SET_NZ(tmp) - -/* 6280 ******************************************************** - * ROR Rotate right - * C -> [7][6][5][4][3][2][1][0] -> new C - ***************************************************************/ -#define ROR \ - CLEAR_T; \ - tmp |= (P & _fC) << 8; \ - P = (P & ~_fC) | (tmp & _fC); \ - tmp = (UINT8)(tmp >> 1); \ - SET_NZ(tmp) - -/* 6280 ******************************************************** - * RTI Return from interrupt - * pull flags, pull PC lo, pull PC hi and increment PC - ***************************************************************/ -#if LAZY_FLAGS - -#define RTI \ - PULL(P); \ - P |= _fB; \ - NZ = ((P & _fN) << 8) | \ - ((P & _fZ) ^ _fZ); \ - PULL(PCL); \ - PULL(PCH); \ - CHANGE_PC; \ - CHECK_IRQ_LINES -#else - -#define RTI \ - PULL(P); \ - P |= _fB; \ - PULL(PCL); \ - PULL(PCH); \ - CHANGE_PC; \ - CHECK_IRQ_LINES -#endif - -/* 6280 ******************************************************** - * RTS Return from subroutine - * pull PC lo, PC hi and increment PC - ***************************************************************/ -#define RTS \ - CLEAR_T; \ - PULL(PCL); \ - PULL(PCH); \ - PCW++; \ - CHANGE_PC - -/* 6280 ******************************************************** - * SAX Swap accumulator and index X - ***************************************************************/ -#define SAX \ - CLEAR_T; \ - tmp = X; \ - X = A; \ - A = tmp - -/* 6280 ******************************************************** - * SAY Swap accumulator and index Y - ***************************************************************/ -#define SAY \ - CLEAR_T; \ - tmp = Y; \ - Y = A; \ - A = tmp - -/* 6280 ******************************************************** - * SBC Subtract with carry - ***************************************************************/ -#define TSBC \ - { \ - int tflagtemp; \ - CLEAR_T; \ - RD_TFL; \ - if (P & _fD) \ - { \ - int c = (P & _fC) ^ _fC; \ - int sum = tflagtemp - tmp -c; \ - int lo = (tflagtemp & 0x0f) - (tmp & 0x0f) - c; \ - int hi = (tflagtemp & 0xf0) - (tmp & 0xf0); \ - P &= ~_fC; \ - if (lo & 0xf0) \ - lo -= 6; \ - if (lo & 0x80) \ - hi -= 0x10; \ - if (hi & 0x0f00) \ - hi -= 0x60; \ - if ((sum & 0xff00) == 0) \ - P |= _fC; \ - tflagtemp = (lo & 0x0f) + (hi & 0xf0); \ - H6280_CYCLES(1); \ - } \ - else \ - { \ - int c = (P & _fC) ^ _fC; \ - int sum = tflagtemp - tmp - c; \ - P &= ~(_fV | _fC); \ - if ((tflagtemp^tmp) & (tflagtemp^sum) & _fN) \ - P |= _fV; \ - if ((sum & 0xff00) == 0) \ - P |= _fC; \ - tflagtemp = (UINT8) sum; \ - } \ - SET_NZ(tflagtemp); \ - WB_TFL; \ - H6280_CYCLES(3); \ - } - -#define SBC \ - if(P & _fT) \ - TSBC \ - else { \ - if (P & _fD) \ - { \ - int c = (P & _fC) ^ _fC; \ - int sum = A - tmp - c; \ - int lo = (A & 0x0f) - (tmp & 0x0f) - c; \ - int hi = (A & 0xf0) - (tmp & 0xf0); \ - P &= ~_fC; \ - if (lo & 0xf0) \ - lo -= 6; \ - if (lo & 0x80) \ - hi -= 0x10; \ - if (hi & 0x0f00) \ - hi -= 0x60; \ - if ((sum & 0xff00) == 0) \ - P |= _fC; \ - A = (lo & 0x0f) + (hi & 0xf0); \ - H6280_CYCLES(1); \ - } \ - else \ - { \ - int c = (P & _fC) ^ _fC; \ - int sum = A - tmp - c; \ - P &= ~(_fV | _fC); \ - if ((A^tmp) & (A^sum) & _fN) \ - P |= _fV; \ - if ((sum & 0xff00) == 0) \ - P |= _fC; \ - A = (UINT8) sum; \ - } \ - SET_NZ(A); \ - } - -/* 6280 ******************************************************** - * SEC Set carry flag - ***************************************************************/ -#if defined(SEC) -#undef SEC -#endif -#define SEC \ - CLEAR_T; \ - P |= _fC - -/* 6280 ******************************************************** - * SED Set decimal flag - ***************************************************************/ -#define SED \ - CLEAR_T; \ - P |= _fD - -/* 6280 ******************************************************** - * SEI Set interrupt flag - ***************************************************************/ -#define SEI \ - CLEAR_T; \ - P |= _fI - -/* 6280 ******************************************************** - * SET Set t flag - ***************************************************************/ -#define SET \ - P |= _fT; - -/* 6280 ******************************************************** - * SMB Set memory bit - ***************************************************************/ -#define SMB(bit) \ - CLEAR_T; \ - tmp |= (1<> PAGE_SHIFT; - - for (UINT32 i = 0; i < len+1; i++) - { - UINT32 offset = i + (start >> PAGE_SHIFT); - if (type & (1 << READ)) sPointer->mem[ READ][offset] = src + (i << PAGE_SHIFT); - if (type & (1 << WRITE)) sPointer->mem[WRITE][offset] = src + (i << PAGE_SHIFT); - if (type & (1 << FETCH)) sPointer->mem[FETCH][offset] = src + (i << PAGE_SHIFT); - } -} - -INT32 h6280DummyIrqCallback(INT32) -{ - return 0; -} - -void h6280SetIrqCallbackHandler(INT32 (*callback)(INT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280SetIrqCallbackHandler called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280SetIrqCallbackHandler called with no CPU open\n")); -#endif - - h6280_irqcallback(callback); -} - -void h6280SetWriteHandler(void (*write)(UINT32, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280SetWriteHandler called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280SetWriteHandler called with no CPU open\n")); -#endif - - sPointer->h6280Write = write; -} - -void h6280SetWritePortHandler(void (*write)(UINT8, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280SetWritePortHandler called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280SetWritePortHandler called with no CPU open\n")); -#endif - - sPointer->h6280WriteIO = write; -} - -void h6280SetReadHandler(UINT8 (*read)(UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280SetReadHandler called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280SetReadPortHandler called with no CPU open\n")); -#endif - - sPointer->h6280Read = read; -} - -static void h6280_write_rom(UINT32 address, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_write_rom called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_write_rom called with no CPU open\n")); -#endif - - address &= 0x1fffff; - - if (sPointer->mem[READ][address >> PAGE_SHIFT] != NULL) { - sPointer->mem[READ][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - } - - if (sPointer->mem[FETCH][address >> PAGE_SHIFT] != NULL) { - sPointer->mem[FETCH][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - } - - if (sPointer->mem[WRITE][address >> PAGE_SHIFT] != NULL) { - sPointer->mem[WRITE][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - } - - if (sPointer->h6280Write != NULL) { - sPointer->h6280Write(address, data); - } -} - -void h6280WritePort(UINT8 port, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_write_port called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_write_port called with no CPU open\n")); -#endif - -// bprintf (0, _T("%5.5x write port\n"), port); - - if (sPointer->h6280WriteIO != NULL) { - sPointer->h6280WriteIO(port, data); - return; - } - - return; -} - -void h6280Write(UINT32 address, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_write called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_write called with no CPU open\n")); -#endif - - address &= 0x1fffff; - -// bprintf (0, _T("%5.5x write\n"), address); - - if (sPointer->mem[WRITE][address >> PAGE_SHIFT] != NULL) { - sPointer->mem[WRITE][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - return; - } - - if (sPointer->h6280Write != NULL) { - sPointer->h6280Write(address, data); - return; - } - - return; -} - -UINT8 h6280Read(UINT32 address) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_read called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_read called with no CPU open\n")); -#endif - - address &= 0x1fffff; - -// bprintf (0, _T("%5.5x read\n"), address); - - if (sPointer->mem[ READ][address >> PAGE_SHIFT] != NULL) { - return sPointer->mem[ READ][address >> PAGE_SHIFT][address & PAGE_MASK]; - } - - if (sPointer->h6280Read != NULL) { - return sPointer->h6280Read(address); - } - - return 0; -} - -UINT8 h6280Fetch(UINT32 address) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280_fetch1 called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280_fetch1 called with no CPU open\n")); -#endif - - address &= 0x1fffff; - - if (sPointer->mem[FETCH][address >> PAGE_SHIFT] != NULL) { - return sPointer->mem[FETCH][address >> PAGE_SHIFT][address & PAGE_MASK]; - } - - if (sPointer->h6280Read != NULL) { - return sPointer->h6280Read(address); - } - - return 0; -} - -void h6280SetIRQLine(INT32 line, INT32 state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280SetIRQLine called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280SetIRQLine called with no CPU open\n")); -#endif - - if (state == CPU_IRQSTATUS_AUTO) { - h6280_set_irq_line(line, 1); - h6280Run(10); - h6280_set_irq_line(line, 0); - } else { - h6280_set_irq_line(line, state); - } -} - -static cpu_core_config H6280CheatCpuConfig = -{ - h6280Open, - h6280Close, - h6280Read, - h6280_write_rom, - h6280GetActive, - h6280TotalCycles, - h6280NewFrame, - h6280Run, - h6280RunEnd, - h6280Reset, - MEMORY_SPACE, - 0 -}; - -void h6280Init(INT32 nCpu) -{ - DebugCPU_H6280Initted = 1; - -#if defined FBA_DEBUG - if (nCpu >= MAX_H6280) bprintf(PRINT_ERROR, _T("h6280Init nCpu is more than MAX_CPU %d (MAX is %d)\n"), nCpu, MAX_H6280); -#endif - - sPointer = &sHandler[nCpu]; - - sPointer->h6280 = (h6280_Regs*)BurnMalloc(sizeof(h6280_Regs)); - - if (nCpu >= nh6280CpuCount) nh6280CpuCount = nCpu+1; - - for (INT32 i = 0; i < 3; i++) { - for (INT32 j = 0; j < (MEMORY_SPACE / PAGE_SIZE); j++) { - sPointer->mem[i][j] = NULL; - } - } - - sPointer->h6280Write = NULL; - sPointer->h6280Read = NULL; - sPointer->h6280WriteIO = NULL; - - CpuCheatRegister(nCpu, &H6280CheatCpuConfig); -} - -void h6280Exit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280Exit called without init\n")); -#endif - - if (!DebugCPU_H6280Initted) return; - - for (INT32 i = 0; i < MAX_H6280; i++) { - sPointer = &sHandler[i]; - - sPointer->h6280Write = NULL; - sPointer->h6280Read = NULL; - sPointer->h6280WriteIO = NULL; - - if (sPointer->h6280) { - BurnFree(sPointer->h6280); - } - } - - nh6280CpuCount = 0; - DebugCPU_H6280Initted = 0; -} - -void h6280Open(INT32 num) -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280Open called without init\n")); - if (num >= nh6280CpuCount) bprintf(PRINT_ERROR, _T("h6280Open called with invalid index %x\n"), num); - if (nh6280CpuActive != -1) bprintf(PRINT_ERROR, _T("h6280Open called with CPU already open with index %x\n"), num); -#endif - - sPointer = &sHandler[num % MAX_H6280]; - - h6280_set_context(sPointer->h6280); - - nh6280CpuActive = num; -} - -void h6280Close() -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280Close called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280Close called with no CPU open\n")); -#endif - - h6280_get_context(sPointer->h6280); - -// sPointer = NULL; // not safe... - - nh6280CpuActive = -1; -} - -INT32 h6280GetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280GetActive called without init\n")); - if (nh6280CpuActive == -1) bprintf(PRINT_ERROR, _T("h6280GetActive called with no CPU open\n")); -#endif - - return nh6280CpuActive; -} - -void h6280NewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_H6280Initted) bprintf(PRINT_ERROR, _T("h6280NewFrame called without init\n")); -#endif - - h6280_handler *ptr; - - for (INT32 i = 0; i < MAX_H6280; i++) - { - ptr = &sHandler[i % MAX_H6280]; - sHandler->h6280->h6280_totalcycles = 0; - } -} - -INT32 h6280CpuScan(INT32 nAction) -{ - struct BurnArea ba; - - char name[128]; - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i < MAX_H6280; i++) - { - h6280_handler *ptr = &sHandler[i]; - h6280_Regs *p = ptr->h6280; - - if (p == NULL) continue; - - int (*irq_callback)(int); - - irq_callback = p->irq_callback; - - memset(&ba, 0, sizeof(ba)); - ba.Data = p; - ba.nLen = sizeof(h6280_Regs); - sprintf (name, "h6280 Registers for Chip #%d", i); - ba.szName = name; - BurnAcb(&ba); - - p->irq_callback = irq_callback; - } - } - - return 0; -} diff --git a/jan/src/cpu/h6280_intf.h b/jan/src/cpu/h6280_intf.h deleted file mode 100644 index 9a888de61..000000000 --- a/jan/src/cpu/h6280_intf.h +++ /dev/null @@ -1,46 +0,0 @@ - -void h6280WritePort(UINT8 port, UINT8 data); -void h6280Write(UINT32 address, UINT8 data); -UINT8 h6280Read(UINT32 address); -UINT8 h6280Fetch(UINT32 address); - -void h6280MapMemory(UINT8 *src, UINT32 start, UINT32 finish, INT32 type); - -void h6280SetIrqCallbackHandler(INT32 (*callback)(INT32)); -void h6280SetlinesCallback(void (*setlines_callback)(INT32 lines)); - -void h6280SetWritePortHandler(void (*write)(UINT8, UINT8)); -void h6280SetWriteHandler(void (*write)(UINT32, UINT8)); -void h6280SetReadHandler(UINT8 (*read)(UINT32)); - -void h6280Init(INT32 nCPU); -void h6280Open(INT32); -void h6280Reset(); -INT32 h6280Run(INT32 cycles); -void h6280Close(); -void h6280Exit(); - -extern INT32 nh6280CpuCount; - -#define H6280_INPUT_LINE_NMI 0x20 - -void h6280SetIRQLine(INT32 line, INT32 state); - -INT32 h6280CpuScan(INT32 nAction); - -INT32 h6280TotalCycles(); -void h6280NewFrame(); -void h6280RunEnd(); - -INT32 h6280GetActive(); - -UINT8 h6280_irq_status_r(UINT32 offset); -void h6280_irq_status_w(UINT32 offset, UINT8 data); -void h6280_irqcallback(int (*irqcallback)(int)); - -UINT8 h6280_timer_r(UINT32); -void h6280_timer_w(UINT32 offset, UINT8 data); - -// functions for use by the PSG and joypad port only! -UINT8 h6280io_get_buffer(void); -void h6280io_set_buffer(UINT8); diff --git a/jan/src/cpu/hd6309/6309ops.c b/jan/src/cpu/hd6309/6309ops.c deleted file mode 100644 index 3e113b915..000000000 --- a/jan/src/cpu/hd6309/6309ops.c +++ /dev/null @@ -1,5599 +0,0 @@ -/* - -HNZVC - -? = undefined -* = affected -- = unaffected -0 = cleared -1 = set -# = CCr directly affected by instruction -@ = special - carry set if bit 7 is set - -*/ - -HD6309_INLINE void illegal( void ) -{ -// LOG(("HD6309: illegal opcode at %04x\nVectoring to [$fff0]\n",PC)); - - CC |= CC_E; - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - - if ( MD & MD_EM ) - { - PUSHBYTE(F); - PUSHBYTE(E); - hd6309_ICount -= 2; - } - - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - - PCD = RM16(0xfff0); - CHANGE_PC; -} - -static void IIError(void) -{ - SEII; // Set illegal Instruction Flag - illegal(); // Vector to Trap handler -} - -static void DZError(void) -{ - SEDZ; // Set Division by Zero Flag - illegal(); // Vector to Trap handler -} - -/* $00 NEG direct ?**** */ -HD6309_INLINE void neg_di( void ) -{ - UINT16 r,t; - DIRBYTE(t); - r = -t; - CLR_NZVC; - SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $01 OIM direct ?**** */ -HD6309_INLINE void oim_di( void ) -{ - UINT8 r,t,im; - IMMBYTE(im); - DIRBYTE(t); - r = im | t; - CLR_NZV; - SET_NZ8(r); - WM(EAD,r); -} - -/* $02 AIM direct */ -HD6309_INLINE void aim_di( void ) -{ - UINT8 r,t,im; - IMMBYTE(im); - DIRBYTE(t); - r = im & t; - CLR_NZV; - SET_NZ8(r); - WM(EAD,r); -} - -/* $03 COM direct -**01 */ -HD6309_INLINE void com_di( void ) -{ - UINT8 t; - DIRBYTE(t); - t = ~t; - CLR_NZV; - SET_NZ8(t); - SEC; - WM(EAD,t); -} - -/* $04 LSR direct -0*-* */ -HD6309_INLINE void lsr_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZC; - CC |= (t & CC_C); - t >>= 1; - SET_Z8(t); - WM(EAD,t); -} - -/* $05 EIM direct */ -HD6309_INLINE void eim_di( void ) -{ - UINT8 r,t,im; - IMMBYTE(im); - DIRBYTE(t); - r = im ^ t; - CLR_NZV; - SET_NZ8(r); - WM(EAD,r); -} - -/* $06 ROR direct -**-* */ -HD6309_INLINE void ror_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r= (CC & CC_C) << 7; - CLR_NZC; - CC |= (t & CC_C); - r |= t>>1; - SET_NZ8(r); - WM(EAD,r); -} - -/* $07 ASR direct ?**-* */ -HD6309_INLINE void asr_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZC; - CC |= (t & CC_C); - t = (t & 0x80) | (t >> 1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $08 ASL direct ?**** */ -HD6309_INLINE void asl_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $09 ROL direct -**** */ -HD6309_INLINE void rol_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = (CC & CC_C) | (t << 1); - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $0A DEC direct -***- */ -HD6309_INLINE void dec_di( void ) -{ - UINT8 t; - DIRBYTE(t); - --t; - CLR_NZV; - SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $0B TIM direct */ -HD6309_INLINE void tim_di( void ) -{ - UINT8 r,t,im; - IMMBYTE(im); - DIRBYTE(t); - r = im & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $OC INC direct -***- */ -HD6309_INLINE void inc_di( void ) -{ - UINT8 t; - DIRBYTE(t); - ++t; - CLR_NZV; - SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $OD TST direct -**0- */ -HD6309_INLINE void tst_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZV; - SET_NZ8(t); -} - -/* $0E JMP direct ----- */ -HD6309_INLINE void jmp_di( void ) -{ - DIRECT; - PCD = EAD; - CHANGE_PC; -} - -/* $0F CLR direct -0100 */ -HD6309_INLINE void clr_di( void ) -{ - UINT32 dummy; - DIRECT; - dummy = RM(EAD); - WM(EAD,0); - CLR_NZVC; - SEZ; -} - -/* $10 FLAG */ - -/* $11 FLAG */ - -/* $12 NOP inherent ----- */ -HD6309_INLINE void nop( void ) -{ - ; -} - -/* $13 SYNC inherent ----- */ -HD6309_INLINE void sync( void ) -{ - /* SYNC stops processing instructions until an interrupt request happens. */ - /* This doesn't require the corresponding interrupt to be enabled: if it */ - /* is disabled, execution continues with the next instruction. */ - hd6309.int_state |= HD6309_SYNC; /* HJB 990227 */ - CHECK_IRQ_LINES(); - /* if HD6309_SYNC has not been cleared by CHECK_IRQ_LINES(), - * stop execution until the interrupt lines change. */ - if( hd6309.int_state & HD6309_SYNC ) - if (hd6309_ICount > 0) hd6309_ICount = 0; -} - -/* $14 sexw inherent */ -HD6309_INLINE void sexw( void ) -{ - PAIR q; - q.d = SIGNED_16(W); - D = q.w.h; - W = q.w.l; - CLR_NZ; - SET_N16(D); - SET_Z(q.d); -} - -/* $15 ILLEGAL */ - -/* $16 LBRA relative ----- */ -HD6309_INLINE void lbra( void ) -{ - IMMWORD(ea); - PC += EA; - CHANGE_PC; - - if ( EA == 0xfffd ) /* EHC 980508 speed up busy loop */ - if ( hd6309_ICount > 0) - hd6309_ICount = 0; -} - -/* $17 LBSR relative ----- */ -HD6309_INLINE void lbsr( void ) -{ - IMMWORD(ea); - PUSHWORD(pPC); - PC += EA; - CHANGE_PC; -} - -/* $18 ILLEGAL */ - -/* $19 DAA inherent (A) -**0* */ -HD6309_INLINE void daa( void ) -{ - UINT8 msn, lsn; - UINT16 t, cf = 0; - msn = A & 0xf0; lsn = A & 0x0f; - if( lsn>0x09 || CC & CC_H) cf |= 0x06; - if( msn>0x80 && lsn>0x09 ) cf |= 0x60; - if( msn>0x90 || CC & CC_C) cf |= 0x60; - t = cf + A; - CLR_NZV; /* keep carry from previous operation */ - SET_NZ8((UINT8)t); SET_C8(t); - A = t; -} - -/* $1A ORCC immediate ##### */ -HD6309_INLINE void orcc( void ) -{ - UINT8 t; - IMMBYTE(t); - CC |= t; - CHECK_IRQ_LINES(); /* HJB 990116 */ -} - -/* $1B ILLEGAL */ - -/* $1C ANDCC immediate ##### */ -HD6309_INLINE void andcc( void ) -{ - UINT8 t; - IMMBYTE(t); - CC &= t; - CHECK_IRQ_LINES(); /* HJB 990116 */ -} - -/* $1D SEX inherent -**0- */ -HD6309_INLINE void sex( void ) -{ - UINT16 t; - t = SIGNED(B); - D = t; - CLR_NZ; - SET_NZ16(t); -} - -HD6309_INLINE void exg( void ) -{ - UINT16 t1,t2; - UINT8 tb; - int promote = FALSE; - - IMMBYTE(tb); - if( (tb^(tb>>4)) & 0x08 ) /* HJB 990225: mixed 8/16 bit case? */ - { - promote = TRUE; - } - - switch(tb>>4) { - case 0: t1 = D; break; - case 1: t1 = X; break; - case 2: t1 = Y; break; - case 3: t1 = U; break; - case 4: t1 = S; break; - case 5: t1 = PC; break; - case 6: t1 = W; break; - case 7: t1 = V; break; - case 8: t1 = (promote ? A + ((A) << 8) : A); break; - case 9: t1 = (promote ? B + ((B) << 8) : B); break; - case 10: t1 = (promote ? CC + ((CC) << 8) : CC); break; - case 11: t1 = (promote ? DP + ((DP) << 8) : DP); break; - case 12: t1 = 0; break; - case 13: t1 = 0; break; - case 14: t1 = (promote ? E + ((E) << 8) : E); break; - default: t1 = (promote ? F + ((F) << 8) : F); break; - } - switch(tb&15) { - case 0: t2 = D; break; - case 1: t2 = X; break; - case 2: t2 = Y; break; - case 3: t2 = U; break; - case 4: t2 = S; break; - case 5: t2 = PC; break; - case 6: t2 = W; break; - case 7: t2 = V; break; - case 8: t2 = (promote ? A + ((A) << 8) : A); break; - case 9: t2 = (promote ? B + ((B) << 8) : B); break; - case 10: t2 = (promote ? CC + ((CC) << 8) : CC); break; - case 11: t2 = (promote ? DP + ((DP) << 8) : DP); break; - case 12: t2 = 0; break; - case 13: t2 = 0; break; - case 14: t2 = (promote ? E + ((E) << 8) : E); break; - default: t2 = (promote ? F + ((F) << 8) : F); break; - } - - switch(tb>>4) { - case 0: D = t2; break; - case 1: X = t2; break; - case 2: Y = t2; break; - case 3: U = t2; break; - case 4: S = t2; break; - case 5: PC = t2; CHANGE_PC; break; - case 6: W = t2; break; - case 7: V = t2; break; - case 8: A = (promote ? t2 >> 8 : t2); break; - case 9: B = (promote ? t2 & 0xff : t2); break; - case 10: CC = (promote ? t2 & 0xff : t2); break; - case 11: DP = (promote ? t2 >> 8 : t2); break; - case 12: /* 0 = t2 */ break; - case 13: /* 0 = t2 */ break; - case 14: E = (promote ? t2 >> 8 : t2); break; - case 15: F = (promote ? t2 & 0xff : t2); break; - } - switch(tb&15) { - case 0: D = t1; break; - case 1: X = t1; break; - case 2: Y = t1; break; - case 3: U = t1; break; - case 4: S = t1; break; - case 5: PC = t1; CHANGE_PC; break; - case 6: W = t1; break; - case 7: V = t1; break; - case 8: A = (promote ? t1 >> 8 : t1); break; - case 9: B = (promote ? t1 & 0xff : t1); break; - case 10: CC = (promote ? t1 & 0xff : t1); break; - case 11: DP = (promote ? t1 >> 8 : t1); break; - case 12: /* 0 = t1 */ break; - case 13: /* 0 = t1 */ break; - case 14: E = (promote ? t1 >> 8 : t1); break; - case 15: F = (promote ? t1 & 0xff : t1); break; - } -} - -/* $1F TFR inherent ----- */ -HD6309_INLINE void tfr( void ) -{ - UINT8 tb; - UINT16 t; - int promote = FALSE; - - IMMBYTE(tb); - if( (tb^(tb>>4)) & 0x08 ) - { - promote = TRUE; - } - - switch(tb>>4) { - case 0: t = D; break; - case 1: t = X; break; - case 2: t = Y; break; - case 3: t = U; break; - case 4: t = S; break; - case 5: t = PC; break; - case 6: t = W; break; - case 7: t = V; break; - case 8: t = (promote ? A + ((A) << 8) : A); break; - case 9: t = (promote ? B + ((B) << 8) : B); break; - case 10: t = (promote ? CC + ((CC) << 8) : CC); break; - case 11: t = (promote ? DP + ((DP) << 8) : DP); break; - case 12: t = 0; break; - case 13: t = 0; break; - case 14: t = (promote ? E + ((E) << 8) : E); break; - default: t = (promote ? F + ((F) << 8) : F); break; - } - - switch(tb&15) { - case 0: D = t; break; - case 1: X = t; break; - case 2: Y = t; break; - case 3: U = t; break; - case 4: S = t; break; - case 5: PC = t; CHANGE_PC; break; - case 6: W = t; break; - case 7: V = t; break; - case 8: A = (promote ? t >> 8 : t); break; - case 9: B = (promote ? t & 0xff : t); break; - case 10: CC = (promote ? t & 0xff : t); break; - case 11: DP = (promote ? t >> 8 : t); break; - case 12: /* 0 = t */ break; - case 13: /* 0 = t */ break; - case 14: E = (promote ? t >> 8 : t); break; - case 15: F = (promote ? t & 0xff : t); break; - } -} - -/* $20 BRA relative ----- */ -HD6309_INLINE void bra( void ) -{ - UINT8 t; - IMMBYTE(t); - PC += SIGNED(t); - CHANGE_PC; - /* JB 970823 - speed up busy loops */ - if( t == 0xfe ) - if( hd6309_ICount > 0 ) hd6309_ICount = 0; -} - -/* $21 BRN relative ----- */ -HD6309_INLINE void brn( void ) -{ - UINT8 t; - IMMBYTE(t); -} - -/* $1021 LBRN relative ----- */ -HD6309_INLINE void lbrn( void ) -{ - IMMWORD(ea); -} - -/* $22 BHI relative ----- */ -HD6309_INLINE void bhi( void ) -{ - BRANCH( !(CC & (CC_Z|CC_C)) ); -} - -/* $1022 LBHI relative ----- */ -HD6309_INLINE void lbhi( void ) -{ - LBRANCH( !(CC & (CC_Z|CC_C)) ); -} - -/* $23 BLS relative ----- */ -HD6309_INLINE void bls( void ) -{ - BRANCH( (CC & (CC_Z|CC_C)) ); -} - -/* $1023 LBLS relative ----- */ -HD6309_INLINE void lbls( void ) -{ - LBRANCH( (CC&(CC_Z|CC_C)) ); -} - -/* $24 BCC relative ----- */ -HD6309_INLINE void bcc( void ) -{ - BRANCH( !(CC&CC_C) ); -} - -/* $1024 LBCC relative ----- */ -HD6309_INLINE void lbcc( void ) -{ - LBRANCH( !(CC&CC_C) ); -} - -/* $25 BCS relative ----- */ -HD6309_INLINE void bcs( void ) -{ - BRANCH( (CC&CC_C) ); -} - -/* $1025 LBCS relative ----- */ -HD6309_INLINE void lbcs( void ) -{ - LBRANCH( (CC&CC_C) ); -} - -/* $26 BNE relative ----- */ -HD6309_INLINE void bne( void ) -{ - BRANCH( !(CC&CC_Z) ); -} - -/* $1026 LBNE relative ----- */ -HD6309_INLINE void lbne( void ) -{ - LBRANCH( !(CC&CC_Z) ); -} - -/* $27 BEQ relative ----- */ -HD6309_INLINE void beq( void ) -{ - BRANCH( (CC&CC_Z) ); -} - -/* $1027 LBEQ relative ----- */ -HD6309_INLINE void lbeq( void ) -{ - LBRANCH( (CC&CC_Z) ); -} - -/* $28 BVC relative ----- */ -HD6309_INLINE void bvc( void ) -{ - BRANCH( !(CC&CC_V) ); -} - -/* $1028 LBVC relative ----- */ -HD6309_INLINE void lbvc( void ) -{ - LBRANCH( !(CC&CC_V) ); -} - -/* $29 BVS relative ----- */ -HD6309_INLINE void bvs( void ) -{ - BRANCH( (CC&CC_V) ); -} - -/* $1029 LBVS relative ----- */ -HD6309_INLINE void lbvs( void ) -{ - LBRANCH( (CC&CC_V) ); -} - -/* $2A BPL relative ----- */ -HD6309_INLINE void bpl( void ) -{ - BRANCH( !(CC&CC_N) ); -} - -/* $102A LBPL relative ----- */ -HD6309_INLINE void lbpl( void ) -{ - LBRANCH( !(CC&CC_N) ); -} - -/* $2B BMI relative ----- */ -HD6309_INLINE void bmi( void ) -{ - BRANCH( (CC&CC_N) ); -} - -/* $102B LBMI relative ----- */ -HD6309_INLINE void lbmi( void ) -{ - LBRANCH( (CC&CC_N) ); -} - -/* $2C BGE relative ----- */ -HD6309_INLINE void bge( void ) -{ - BRANCH( !NXORV ); -} - -/* $102C LBGE relative ----- */ -HD6309_INLINE void lbge( void ) -{ - LBRANCH( !NXORV ); -} - -/* $2D BLT relative ----- */ -HD6309_INLINE void blt( void ) -{ - BRANCH( NXORV ); -} - -/* $102D LBLT relative ----- */ -HD6309_INLINE void lblt( void ) -{ - LBRANCH( NXORV ); -} - -/* $2E BGT relative ----- */ -HD6309_INLINE void bgt( void ) -{ - BRANCH( !(NXORV || (CC&CC_Z)) ); -} - -/* $102E LBGT relative ----- */ -HD6309_INLINE void lbgt( void ) -{ - LBRANCH( !(NXORV || (CC&CC_Z)) ); -} - -/* $2F BLE relative ----- */ -HD6309_INLINE void ble( void ) -{ - BRANCH( (NXORV || (CC&CC_Z)) ); -} - -/* $102F LBLE relative ----- */ -HD6309_INLINE void lble( void ) -{ - LBRANCH( (NXORV || (CC&CC_Z)) ); -} - -#define REGREG_PREAMBLE \ - IMMBYTE(tb); \ - if( (tb^(tb>>4)) & 0x08 ) \ - {promote = TRUE;} \ - switch(tb>>4) { \ - case 0: src16Reg = &D; large = TRUE; break; \ - case 1: src16Reg = &X; large = TRUE; break; \ - case 2: src16Reg = &Y; large = TRUE; break; \ - case 3: src16Reg = &U; large = TRUE; break; \ - case 4: src16Reg = &S; large = TRUE; break; \ - case 5: src16Reg = &PC; large = TRUE; break; \ - case 6: src16Reg = &W; large = TRUE; break; \ - case 7: src16Reg = &V; large = TRUE; break; \ - case 8: if (promote) src16Reg = &D; else src8Reg = &A; break; \ - case 9: if (promote) src16Reg = &D; else src8Reg = &B; break; \ - case 10: if (promote) src16Reg = &z16; else src8Reg = &CC; break; \ - case 11: if (promote) src16Reg = &z16; else src8Reg = &DP; break; \ - case 12: if (promote) src16Reg = &z16; else src8Reg = &z8; break; \ - case 13: if (promote) src16Reg = &z16; else src8Reg = &z8; break; \ - case 14: if (promote) src16Reg = &W; else src8Reg = &E; break; \ - default: if (promote) src16Reg = &W; else src8Reg = &F; break; \ - } \ - switch(tb&15) { \ - case 0: dst16Reg = &D; large = TRUE; break; \ - case 1: dst16Reg = &X; large = TRUE; break; \ - case 2: dst16Reg = &Y; large = TRUE; break; \ - case 3: dst16Reg = &U; large = TRUE; break; \ - case 4: dst16Reg = &S; large = TRUE; break; \ - case 5: dst16Reg = &PC; large = TRUE; break; \ - case 6: dst16Reg = &W; large = TRUE; break; \ - case 7: dst16Reg = &V; large = TRUE; break; \ - case 8: if (promote) dst16Reg = &D; else dst8Reg = &A; break; \ - case 9: if (promote) dst16Reg = &D; else dst8Reg = &B; break; \ - case 10: if (promote) dst16Reg = &z16; else dst8Reg = &CC; break; \ - case 11: if (promote) dst16Reg = &z16; else dst8Reg = &DP; break; \ - case 12: if (promote) dst16Reg = &z16; else dst8Reg = &z8; break; \ - case 13: if (promote) dst16Reg = &z16; else dst8Reg = &z8; break; \ - case 14: if (promote) dst16Reg = &W; else dst8Reg = &E; break; \ - default: if (promote) dst16Reg = &W; else dst8Reg = &F; break; \ - } \ - -/* $1030 addr_r r1 + r2 -> r2 */ - -HD6309_INLINE void addr_r( void ) -{ - UINT8 tb, z8 = 0; - UINT16 z16 = 0, r8; - UINT32 r16; - UINT8 *src8Reg = NULL, *dst8Reg = NULL; - UINT16 *src16Reg = NULL, *dst16Reg = NULL; - int promote = FALSE, large = FALSE; - - REGREG_PREAMBLE; - - if ( large ) - { - r16 = *src16Reg + *dst16Reg; - CLR_NZVC; - *dst16Reg = r16; - SET_FLAGS16(*src16Reg,*dst16Reg,r16); - - if ( (tb&15) == 5 ) - { - CHANGE_PC; - } - } - else - { - r8 = *src8Reg + *dst8Reg; - CLR_NZVC; - /* SET_H(*src8Reg,*src8Reg,r8);*/ /*Experimentation prooved this not to be the case */ - *dst8Reg = r8; - SET_FLAGS8(*src8Reg,*dst8Reg,r8); - } -} - -HD6309_INLINE void adcr( void ) -{ - UINT8 tb, z8 = 0; - UINT16 z16 = 0, r8; - UINT32 r16; - UINT8 *src8Reg = NULL, *dst8Reg = NULL; - UINT16 *src16Reg = NULL, *dst16Reg = NULL; - int promote = FALSE, large = FALSE; - - REGREG_PREAMBLE; - - if ( large ) - { - r16 = *src16Reg + *dst16Reg + (CC & CC_C); - CLR_NZVC; - *dst16Reg = r16; - SET_FLAGS16(*src16Reg,*dst16Reg,r16); - - if ( (tb&15) == 5 ) - { - CHANGE_PC; - } - } - else - { - r8 = *src8Reg + *dst8Reg + (CC & CC_C); - CLR_NZVC; - /* SET_H(*src8Reg,*src8Reg,r8);*/ /*Experimentation prooved this not to be the case */ - *dst8Reg = r8; - SET_FLAGS8(*src8Reg,*dst8Reg,r8); - } -} - -/* $1032 SUBR r1 - r2 -> r2 */ -HD6309_INLINE void subr( void ) -{ - UINT8 tb, z8 = 0; - UINT16 z16 = 0, r8; - UINT32 r16; - UINT8 *src8Reg = NULL, *dst8Reg = NULL; - UINT16 *src16Reg = NULL, *dst16Reg = NULL; - int promote = FALSE, large = FALSE; - - REGREG_PREAMBLE; - - if ( large ) - { - r16 = (UINT32)*dst16Reg - (UINT32)*src16Reg; - CLR_NZVC; - *dst16Reg = r16; - SET_FLAGS16((UINT32)*dst16Reg,(UINT32)*src16Reg,r16); - - if ( (tb&15) == 5 ) - { - CHANGE_PC; - } - } - else - { - r8 = *dst8Reg - *src8Reg; - CLR_NZVC; - *dst8Reg = r8; - SET_FLAGS8(*dst8Reg,*src8Reg,r8); - } -} - -/* $1033 SBCR r1 - r2 - C -> r2 */ -HD6309_INLINE void sbcr( void ) -{ - UINT8 tb, z8 = 0; - UINT16 z16 = 0, r8; - UINT32 r16; - UINT8 *src8Reg = NULL, *dst8Reg = NULL; - UINT16 *src16Reg = NULL, *dst16Reg = NULL; - int promote = FALSE, large = FALSE; - - REGREG_PREAMBLE; - - if ( large ) - { - r16 = (UINT32)*dst16Reg - (UINT32)*src16Reg - (CC & CC_C); - CLR_NZVC; - *dst16Reg = r16; - SET_FLAGS16((UINT32)*dst16Reg,(UINT32)*src16Reg,r16); - - if ( (tb&15) == 5 ) - { - CHANGE_PC; - } - } - else - { - r8 = *dst8Reg - *src8Reg - (CC & CC_C); - CLR_NZVC; - *dst8Reg = r8; - SET_FLAGS8(*dst8Reg,*src8Reg,r8); - } -} - -/* $1034 ANDR r1 & r2 -> r2 */ -HD6309_INLINE void andr( void ) -{ - UINT8 tb, z8 = 0; - UINT16 z16 = 0, r8; - UINT32 r16; - UINT8 *src8Reg = NULL, *dst8Reg = NULL; - UINT16 *src16Reg = NULL, *dst16Reg = NULL; - int promote = FALSE, large = FALSE; - - REGREG_PREAMBLE; - - if ( large ) - { - r16 = *src16Reg & *dst16Reg; - CLR_NZV; - *dst16Reg = r16; - SET_NZ16(r16); - - if ( (tb&15) == 5 ) - { - CHANGE_PC; - } - } - else - { - r8 = *src8Reg & *dst8Reg; - CLR_NZV; - *dst8Reg = r8; - SET_NZ8(r8); - } -} - -/* $1035 ORR r1 | r2 -> r2 */ -HD6309_INLINE void orr( void ) -{ - UINT8 tb, z8 = 0; - UINT16 z16 = 0, r8; - UINT32 r16; - UINT8 *src8Reg = NULL, *dst8Reg = NULL; - UINT16 *src16Reg = NULL, *dst16Reg = NULL; - int promote = FALSE, large = FALSE; - - REGREG_PREAMBLE; - - if ( large ) - { - r16 = *src16Reg | *dst16Reg; - CLR_NZV; - *dst16Reg = r16; - SET_NZ16(r16); - - if ( (tb&15) == 5 ) - { - CHANGE_PC; - } - } - else - { - r8 = *src8Reg | *dst8Reg; - CLR_NZV; - *dst8Reg = r8; - SET_NZ8(r8); - } -} - -/* $1036 EORR r1 ^ r2 -> r2 */ -HD6309_INLINE void eorr( void ) -{ - UINT8 tb, z8 = 0; - UINT16 z16 = 0, r8; - UINT32 r16; - UINT8 *src8Reg = NULL, *dst8Reg = NULL; - UINT16 *src16Reg = NULL, *dst16Reg = NULL; - int promote = FALSE, large = FALSE; - - REGREG_PREAMBLE; - - if ( large ) - { - r16 = *src16Reg ^ *dst16Reg; - CLR_NZV; - *dst16Reg = r16; - SET_NZ16(r16); - - if ( (tb&15) == 5 ) - { - CHANGE_PC; - } - } - else - { - r8 = *src8Reg ^ *dst8Reg; - CLR_NZV; - *dst8Reg = r8; - SET_NZ8(r8); - } -} - -/* $1037 CMPR r1 - r2 */ -HD6309_INLINE void cmpr( void ) -{ - UINT8 tb, z8 = 0; - UINT16 z16 = 0, r8; - UINT32 r16; - UINT8 *src8Reg = NULL, *dst8Reg = NULL; - UINT16 *src16Reg = NULL, *dst16Reg = NULL; - int promote = FALSE, large = FALSE; - - REGREG_PREAMBLE; - - if ( large ) - { - r16 = (UINT32)*dst16Reg - (UINT32)*src16Reg; - CLR_NZVC; - SET_FLAGS16((UINT32)*dst16Reg,(UINT32)*src16Reg,r16); - } - else - { - r8 = *dst8Reg - *src8Reg; - CLR_NZVC; - SET_FLAGS8(*dst8Reg,*src8Reg,r8); - } -} - -/* $1138 TFM R0+,R1+ */ -HD6309_INLINE void tfmpp( void ) -{ - UINT8 tb, srcValue = 0; - - IMMBYTE(tb); - - if ( W != 0 ) - { - switch(tb>>4) { - case 0: srcValue = RM(D++); break; - case 1: srcValue = RM(X++); break; - case 2: srcValue = RM(Y++); break; - case 3: srcValue = RM(U++); break; - case 4: srcValue = RM(S++); break; - default: IIError(); return; break; /* reg PC thru F */ - } - - switch(tb&15) { - case 0: WM(D++, srcValue); break; - case 1: WM(X++, srcValue); break; - case 2: WM(Y++, srcValue); break; - case 3: WM(U++, srcValue); break; - case 4: WM(S++, srcValue); break; - default: IIError(); return; break; /* reg PC thru F */ - } - - PCD = PCD - 3; - CHANGE_PC; - W--; - } - else - hd6309_ICount -= 6; /* Needs six aditional cycles to get the 6+3n */ -} - -/* $1139 TFM R0-,R1- */ -HD6309_INLINE void tfmmm( void ) -{ - UINT8 tb, srcValue = 0; - - IMMBYTE(tb); - - if ( W != 0 ) - { - switch(tb>>4) { - case 0: srcValue = RM(D--); break; - case 1: srcValue = RM(X--); break; - case 2: srcValue = RM(Y--); break; - case 3: srcValue = RM(U--); break; - case 4: srcValue = RM(S--); break; - default: IIError(); return; break; /* reg PC thru F */ - } - - switch(tb&15) { - case 0: WM(D--, srcValue); break; - case 1: WM(X--, srcValue); break; - case 2: WM(Y--, srcValue); break; - case 3: WM(U--, srcValue); break; - case 4: WM(S--, srcValue); break; - default: IIError(); return; break; /* reg PC thru F */ - } - - PCD = PCD - 3; - CHANGE_PC; - W--; - } - else - hd6309_ICount -= 6; /* Needs six aditional cycles to get the 6+3n */ -} - -/* $113A TFM R0+,R1 */ -HD6309_INLINE void tfmpc( void ) -{ - UINT8 tb, srcValue = 0; - - IMMBYTE(tb); - - if ( W != 0 ) - { - switch(tb>>4) { - case 0: srcValue = RM(D++); break; - case 1: srcValue = RM(X++); break; - case 2: srcValue = RM(Y++); break; - case 3: srcValue = RM(U++); break; - case 4: srcValue = RM(S++); break; - default: IIError(); return; break; /* reg PC thru F */ - } - - switch(tb&15) { - case 0: WM(D, srcValue); break; - case 1: WM(X, srcValue); break; - case 2: WM(Y, srcValue); break; - case 3: WM(U, srcValue); break; - case 4: WM(S, srcValue); break; - default: IIError(); return; break; /* reg PC thru F */ - } - - PCD = PCD - 3; - CHANGE_PC; - W--; - } - else - hd6309_ICount -= 6; /* Needs six aditional cycles to get the 6+3n */ -} - -/* $113B TFM R0,R1+ */ -HD6309_INLINE void tfmcp( void ) -{ - UINT8 tb, srcValue = 0; - - IMMBYTE(tb); - - if ( W != 0 ) - { - switch(tb>>4) { - case 0: srcValue = RM(D); break; - case 1: srcValue = RM(X); break; - case 2: srcValue = RM(Y); break; - case 3: srcValue = RM(U); break; - case 4: srcValue = RM(S); break; - default: IIError(); return; break; /* reg PC thru F */ - } - - switch(tb&15) { - case 0: WM(D++, srcValue); break; - case 1: WM(X++, srcValue); break; - case 2: WM(Y++, srcValue); break; - case 3: WM(U++, srcValue); break; - case 4: WM(S++, srcValue); break; - default: IIError(); return; break; /* reg PC thru F */ - } - - PCD = PCD - 3; - CHANGE_PC; - W--; - } - else - hd6309_ICount -= 6; /* Needs six aditional cycles to get the 6+3n */ -} - -/* $30 LEAX indexed --*-- */ -HD6309_INLINE void leax( void ) -{ - fetch_effective_address(); - X = EA; - CLR_Z; - SET_Z(X); -} - -/* $31 LEAY indexed --*-- */ -HD6309_INLINE void leay( void ) -{ - fetch_effective_address(); - Y = EA; - CLR_Z; - SET_Z(Y); -} - -/* $32 LEAS indexed ----- */ -HD6309_INLINE void leas( void ) -{ - fetch_effective_address(); - S = EA; - hd6309.int_state |= HD6309_LDS; -} - -/* $33 LEAU indexed ----- */ -HD6309_INLINE void leau( void ) -{ - fetch_effective_address(); - U = EA; -} - -/* $34 PSHS inherent ----- */ -HD6309_INLINE void pshs( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x80 ) { PUSHWORD(pPC); hd6309_ICount -= 2; } - if( t&0x40 ) { PUSHWORD(pU); hd6309_ICount -= 2; } - if( t&0x20 ) { PUSHWORD(pY); hd6309_ICount -= 2; } - if( t&0x10 ) { PUSHWORD(pX); hd6309_ICount -= 2; } - if( t&0x08 ) { PUSHBYTE(DP); hd6309_ICount -= 1; } - if( t&0x04 ) { PUSHBYTE(B); hd6309_ICount -= 1; } - if( t&0x02 ) { PUSHBYTE(A); hd6309_ICount -= 1; } - if( t&0x01 ) { PUSHBYTE(CC); hd6309_ICount -= 1; } -} - -/* $1038 PSHSW inherent ----- */ -HD6309_INLINE void pshsw( void ) -{ - PUSHWORD(pW); -} - -/* $103a PSHUW inherent ----- */ -HD6309_INLINE void pshuw( void ) -{ - PSHUWORD(pW); -} - -/* $35 PULS inherent ----- */ -HD6309_INLINE void puls( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x01 ) { PULLBYTE(CC); hd6309_ICount -= 1; } - if( t&0x02 ) { PULLBYTE(A); hd6309_ICount -= 1; } - if( t&0x04 ) { PULLBYTE(B); hd6309_ICount -= 1; } - if( t&0x08 ) { PULLBYTE(DP); hd6309_ICount -= 1; } - if( t&0x10 ) { PULLWORD(XD); hd6309_ICount -= 2; } - if( t&0x20 ) { PULLWORD(YD); hd6309_ICount -= 2; } - if( t&0x40 ) { PULLWORD(UD); hd6309_ICount -= 2; } - if( t&0x80 ) { PULLWORD(PCD); CHANGE_PC; hd6309_ICount -= 2; } - - /* HJB 990225: moved check after all PULLs */ - if( t&0x01 ) { CHECK_IRQ_LINES(); } -} - -/* $1039 PULSW inherent ----- */ -HD6309_INLINE void pulsw( void ) -{ - PULLWORD(W); -} - -/* $103b PULUW inherent ----- */ -HD6309_INLINE void puluw( void ) -{ - PULUWORD(W); -} - -/* $36 PSHU inherent ----- */ -HD6309_INLINE void pshu( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x80 ) { PSHUWORD(pPC); hd6309_ICount -= 2; } - if( t&0x40 ) { PSHUWORD(pS); hd6309_ICount -= 2; } - if( t&0x20 ) { PSHUWORD(pY); hd6309_ICount -= 2; } - if( t&0x10 ) { PSHUWORD(pX); hd6309_ICount -= 2; } - if( t&0x08 ) { PSHUBYTE(DP); hd6309_ICount -= 1; } - if( t&0x04 ) { PSHUBYTE(B); hd6309_ICount -= 1; } - if( t&0x02 ) { PSHUBYTE(A); hd6309_ICount -= 1; } - if( t&0x01 ) { PSHUBYTE(CC); hd6309_ICount -= 1; } -} - -/* 37 PULU inherent ----- */ -HD6309_INLINE void pulu( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x01 ) { PULUBYTE(CC); hd6309_ICount -= 1; } - if( t&0x02 ) { PULUBYTE(A); hd6309_ICount -= 1; } - if( t&0x04 ) { PULUBYTE(B); hd6309_ICount -= 1; } - if( t&0x08 ) { PULUBYTE(DP); hd6309_ICount -= 1; } - if( t&0x10 ) { PULUWORD(XD); hd6309_ICount -= 2; } - if( t&0x20 ) { PULUWORD(YD); hd6309_ICount -= 2; } - if( t&0x40 ) { PULUWORD(SD); hd6309_ICount -= 2; } - if( t&0x80 ) { PULUWORD(PCD); CHANGE_PC; hd6309_ICount -= 2; } - - /* HJB 990225: moved check after all PULLs */ - if( t&0x01 ) { CHECK_IRQ_LINES(); } -} - -/* $38 ILLEGAL */ - -/* $39 RTS inherent ----- */ -HD6309_INLINE void rts( void ) -{ - PULLWORD(PCD); - CHANGE_PC; -} - -/* $3A ABX inherent ----- */ -HD6309_INLINE void abx( void ) -{ - X += B; -} - -/* $3B RTI inherent ##### */ -HD6309_INLINE void rti( void ) -{ - UINT8 t; - PULLBYTE(CC); - t = CC & CC_E; /* HJB 990225: entire state saved? */ - if(t) - { - hd6309_ICount -= 9; - PULLBYTE(A); - PULLBYTE(B); - if ( MD & MD_EM ) - { - PULLBYTE(E); - PULLBYTE(F); - hd6309_ICount -= 2; - } - PULLBYTE(DP); - PULLWORD(XD); - PULLWORD(YD); - PULLWORD(UD); - } - PULLWORD(PCD); - CHANGE_PC; - CHECK_IRQ_LINES(); /* HJB 990116 */ -} - -/* $3C CWAI inherent ----1 */ -HD6309_INLINE void cwai( void ) -{ - UINT8 t; - IMMBYTE(t); - CC &= t; - /* - * CWAI stacks the entire machine state on the hardware stack, - * then waits for an interrupt; when the interrupt is taken - * later, the state is *not* saved again after CWAI. - */ - CC |= CC_E; /* HJB 990225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - if ( MD & MD_EM ) - { - PUSHBYTE(E); - PUSHBYTE(F); - } - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - hd6309.int_state |= HD6309_CWAI; /* HJB 990228 */ - CHECK_IRQ_LINES(); /* HJB 990116 */ - if( hd6309.int_state & HD6309_CWAI ) - if( hd6309_ICount > 0 ) - hd6309_ICount = 0; -} - -/* $3D MUL inherent --*-@ */ -HD6309_INLINE void mul( void ) -{ - UINT16 t; - t = A * B; - CLR_ZC; SET_Z16(t); if(t&0x80) SEC; - D = t; -} - -/* $3E ILLEGAL */ - -/* $3F SWI (SWI2 SWI3) absolute indirect ----- */ -HD6309_INLINE void swi( void ) -{ - CC |= CC_E; /* HJB 980225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - if ( MD & MD_EM ) - { - PUSHBYTE(F); - PUSHBYTE(E); - } - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - CC |= CC_IF | CC_II; /* inhibit FIRQ and IRQ */ - PCD=RM16(0xfffa); - CHANGE_PC; -} - -/* $1130 BAND */ - -#define decodePB_tReg(n) (((n) >> 6) & 0x03) -#define decodePB_src(n) (((n) >> 3) & 0x07) -#define decodePB_dst(n) (((n) >> 0) & 0x07) - -static UINT8 dummy_byte; -static unsigned char *const regTable[4] = { &(CC), &(A), &(B), &dummy_byte }; - -static const UINT8 bitTable[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; - -HD6309_INLINE void band( void ) -{ - UINT8 pb; - UINT16 db; - - IMMBYTE(pb); - - DIRBYTE(db); - - if ( ( *(regTable[decodePB_tReg(pb)]) & bitTable[decodePB_dst(pb)] ) && ( db & bitTable[decodePB_src(pb)] )) - *(regTable[decodePB_tReg(pb)]) |= bitTable[decodePB_dst(pb)]; - else - *(regTable[decodePB_tReg(pb)]) &= (~bitTable[decodePB_dst(pb)]); -} - -/* $1131 BIAND */ - -HD6309_INLINE void biand( void ) -{ - UINT8 pb; - UINT16 db; - - IMMBYTE(pb); - - DIRBYTE(db); - - if ( ( *(regTable[decodePB_tReg(pb)]) & bitTable[decodePB_dst(pb)] ) && ( (~db) & bitTable[decodePB_src(pb)] )) - *(regTable[decodePB_tReg(pb)]) |= bitTable[decodePB_dst(pb)]; - else - *(regTable[decodePB_tReg(pb)]) &= (~bitTable[decodePB_dst(pb)]); -} - -/* $1132 BOR */ - -HD6309_INLINE void bor( void ) -{ - UINT8 pb; - UINT16 db; - - IMMBYTE(pb); - - DIRBYTE(db); - - if ( ( *(regTable[decodePB_tReg(pb)]) & bitTable[decodePB_dst(pb)] ) || ( db & bitTable[decodePB_src(pb)] )) - *(regTable[decodePB_tReg(pb)]) |= bitTable[decodePB_dst(pb)]; - else - *(regTable[decodePB_tReg(pb)]) &= (~bitTable[decodePB_dst(pb)]); -} - -/* $1133 BIOR */ - -HD6309_INLINE void bior( void ) -{ - UINT8 pb; - UINT16 db; - - IMMBYTE(pb); - - DIRBYTE(db); - - if ( ( *(regTable[decodePB_tReg(pb)]) & bitTable[decodePB_dst(pb)] ) || ( (~db) & bitTable[decodePB_src(pb)] )) - *(regTable[decodePB_tReg(pb)]) |= bitTable[decodePB_dst(pb)]; - else - *(regTable[decodePB_tReg(pb)]) &= (~bitTable[decodePB_dst(pb)]); -} - -/* $1134 BEOR */ - -HD6309_INLINE void beor( void ) -{ - UINT8 pb; - UINT16 db; - UINT8 tReg, tMem; - - IMMBYTE(pb); - - DIRBYTE(db); - - tReg = *(regTable[decodePB_tReg(pb)]) & bitTable[decodePB_dst(pb)]; - tMem = db & bitTable[decodePB_src(pb)]; - - if ( (tReg || tMem ) && !(tReg && tMem) ) - *(regTable[decodePB_tReg(pb)]) |= bitTable[decodePB_dst(pb)]; - else - *(regTable[decodePB_tReg(pb)]) &= (~bitTable[decodePB_dst(pb)]); -} - -/* $1135 BIEOR */ - -HD6309_INLINE void bieor( void ) -{ - UINT8 pb; - UINT16 db; - UINT8 tReg, tMem; - - IMMBYTE(pb); - - DIRBYTE(db); - - tReg = *(regTable[decodePB_tReg(pb)]) & bitTable[decodePB_dst(pb)]; - tMem = (~db) & bitTable[decodePB_src(pb)]; - - if ( (tReg || tMem ) && !(tReg && tMem) ) - *(regTable[decodePB_tReg(pb)]) |= bitTable[decodePB_dst(pb)]; - else - *(regTable[decodePB_tReg(pb)]) &= (~bitTable[decodePB_dst(pb)]); -} - -/* $1133 LDBT */ - -HD6309_INLINE void ldbt( void ) -{ - UINT8 pb; - UINT16 db; - - IMMBYTE(pb); - - DIRBYTE(db); - - if ( ( db & bitTable[decodePB_src(pb)] ) ) - *(regTable[decodePB_tReg(pb)]) |= bitTable[decodePB_dst(pb)]; - else - *(regTable[decodePB_tReg(pb)]) &= (~bitTable[decodePB_dst(pb)]); -} - -/* $1134 STBT */ - -HD6309_INLINE void stbt( void ) -{ - UINT8 pb; - UINT16 db; - - IMMBYTE(pb); - - DIRBYTE(db); - - if ( ( *(regTable[decodePB_tReg(pb)]) & bitTable[decodePB_dst(pb)] ) ) - WM( EAD, db | bitTable[decodePB_src(pb)] ); - else - WM( EAD, db & (~bitTable[decodePB_src(pb)]) ); -} - -/* $103F SWI2 absolute indirect ----- */ -HD6309_INLINE void swi2( void ) -{ - CC |= CC_E; /* HJB 980225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - if ( MD & MD_EM ) - { - PUSHBYTE(F); - PUSHBYTE(E); - } - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - PCD = RM16(0xfff4); - CHANGE_PC; -} - -/* $113F SWI3 absolute indirect ----- */ -HD6309_INLINE void swi3( void ) -{ - CC |= CC_E; /* HJB 980225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - if ( MD & MD_EM ) - { - PUSHBYTE(F); - PUSHBYTE(E); - } - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - PCD = RM16(0xfff2); - CHANGE_PC; -} - -/* $40 NEGA inherent ?**** */ -HD6309_INLINE void nega( void ) -{ - UINT16 r; - r = -A; - CLR_NZVC; - SET_FLAGS8(0,A,r); - A = r; -} - -/* $41 ILLEGAL */ - -/* $42 ILLEGAL */ - -/* $43 COMA inherent -**01 */ -HD6309_INLINE void coma( void ) -{ - A = ~A; - CLR_NZV; - SET_NZ8(A); - SEC; -} - -/* $44 LSRA inherent -0*-* */ -HD6309_INLINE void lsra( void ) -{ - CLR_NZC; - CC |= (A & CC_C); - A >>= 1; - SET_Z8(A); -} - -/* $45 ILLEGAL */ - -/* $46 RORA inherent -**-* */ -HD6309_INLINE void rora( void ) -{ - UINT8 r; - r = (CC & CC_C) << 7; - CLR_NZC; - CC |= (A & CC_C); - r |= A >> 1; - SET_NZ8(r); - A = r; -} - -/* $47 ASRA inherent ?**-* */ -HD6309_INLINE void asra( void ) -{ - CLR_NZC; - CC |= (A & CC_C); - A = (A & 0x80) | (A >> 1); - SET_NZ8(A); -} - -/* $48 ASLA inherent ?**** */ -HD6309_INLINE void asla( void ) -{ - UINT16 r; - r = A << 1; - CLR_NZVC; - SET_FLAGS8(A,A,r); - A = r; -} - -/* $49 ROLA inherent -**** */ -HD6309_INLINE void rola( void ) -{ - UINT16 t,r; - t = A; - r = (CC & CC_C) | (t<<1); - CLR_NZVC; SET_FLAGS8(t,t,r); - A = r; -} - -/* $4A DECA inherent -***- */ -HD6309_INLINE void deca( void ) -{ - --A; - CLR_NZV; - SET_FLAGS8D(A); -} - -/* $4B ILLEGAL */ - -/* $4C INCA inherent -***- */ -HD6309_INLINE void inca( void ) -{ - ++A; - CLR_NZV; - SET_FLAGS8I(A); -} - -/* $4D TSTA inherent -**0- */ -HD6309_INLINE void tsta( void ) -{ - CLR_NZV; - SET_NZ8(A); -} - -/* $4E ILLEGAL */ - -/* $4F CLRA inherent -0100 */ -HD6309_INLINE void clra( void ) -{ - A = 0; - CLR_NZVC; SEZ; -} - -/* $50 NEGB inherent ?**** */ -HD6309_INLINE void negb( void ) -{ - UINT16 r; - r = -B; - CLR_NZVC; - SET_FLAGS8(0,B,r); - B = r; -} - -/* $1040 NEGD inherent ?**** */ -HD6309_INLINE void negd( void ) -{ - UINT32 r; - r = -D; - CLR_NZVC; - SET_FLAGS16(0,D,r); - D = r; -} - -/* $51 ILLEGAL */ - -/* $52 ILLEGAL */ - -/* $53 COMB inherent -**01 */ -HD6309_INLINE void comb( void ) -{ - B = ~B; - CLR_NZV; - SET_NZ8(B); - SEC; -} - -/* $1143 COME inherent -**01 */ -HD6309_INLINE void come( void ) -{ - E = ~E; - CLR_NZV; - SET_NZ8(E); - SEC; -} - -/* $1153 COMF inherent -**01 */ -HD6309_INLINE void comf( void ) -{ - F = ~F; - CLR_NZV; - SET_NZ8(F); - SEC; -} - -/* $1043 COMD inherent -**01 */ -HD6309_INLINE void comd( void ) -{ - D = ~D; - CLR_NZV; - SET_NZ16(D); - SEC; -} - -/* $1053 COMW inherent -**01 */ -HD6309_INLINE void comw( void ) -{ - W = ~W; - CLR_NZV; - SET_NZ16(W); - SEC; -} - -/* $54 LSRB inherent -0*-* */ -HD6309_INLINE void lsrb( void ) -{ - CLR_NZC; - CC |= (B & CC_C); - B >>= 1; - SET_Z8(B); -} - -/* $1044 LSRD inherent -0*-* */ -HD6309_INLINE void lsrd( void ) -{ - CLR_NZC; - CC |= (B & CC_C); - D >>= 1; - SET_Z16(D); -} - -/* $1054 LSRW inherent -0*-* */ -HD6309_INLINE void lsrw( void ) -{ - CLR_NZC; - CC |= (F & CC_C); - W >>= 1; - SET_Z16(W); -} - -/* $55 ILLEGAL */ - -/* $56 RORB inherent -**-* */ -HD6309_INLINE void rorb( void ) -{ - UINT8 r; - r = (CC & CC_C) << 7; - CLR_NZC; - CC |= (B & CC_C); - r |= B >> 1; - SET_NZ8(r); - B = r; -} - -/* $1046 RORD inherent -**-* */ -HD6309_INLINE void rord( void ) -{ - UINT16 r; - r = (CC & CC_C) << 15; - CLR_NZC; - CC |= (D & CC_C); - r |= D >> 1; - SET_NZ16(r); - D = r; -} - -/* $1056 RORW inherent -**-* */ -HD6309_INLINE void rorw( void ) -{ - UINT16 r; - r = (CC & CC_C) << 15; - CLR_NZC; - CC |= (W & CC_C); - r |= W >> 1; - SET_NZ16(r); - W = r; -} - -/* $57 ASRB inherent ?**-* */ -HD6309_INLINE void asrb( void ) -{ - CLR_NZC; - CC |= (B & CC_C); - B= (B & 0x80) | (B >> 1); - SET_NZ8(B); -} - -/* $1047 ASRD inherent ?**-* */ -HD6309_INLINE void asrd( void ) -{ - CLR_NZC; - CC |= (D & CC_C); - D= (D & 0x8000) | (D >> 1); - SET_NZ16(D); -} - -/* $58 ASLB inherent ?**** */ -HD6309_INLINE void aslb( void ) -{ - UINT16 r; - r = B << 1; - CLR_NZVC; - SET_FLAGS8(B,B,r); - B = r; -} - -/* $1048 ASLD inherent ?**** */ -HD6309_INLINE void asld( void ) -{ - UINT32 r; - r = D << 1; - CLR_NZVC; - SET_FLAGS16(D,D,r); - D = r; -} - -/* $59 ROLB inherent -**** */ -HD6309_INLINE void rolb( void ) -{ - UINT16 t,r; - t = B; - r = CC & CC_C; - r |= t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - B = r; -} - -/* $1049 ROLD inherent -**** */ -HD6309_INLINE void rold( void ) -{ - UINT32 t,r; - t = D; - r = CC & CC_C; - r |= t << 1; - CLR_NZVC; - SET_FLAGS16(t,t,r); - D = r; -} - -/* $1059 ROLW inherent -**** */ -HD6309_INLINE void rolw( void ) -{ - UINT32 t,r; - t = W; - r = CC & CC_C; - r |= t << 1; - CLR_NZVC; - SET_FLAGS16(t,t,r); - W = r; -} - -/* $5A DECB inherent -***- */ -HD6309_INLINE void decb( void ) -{ - --B; - CLR_NZV; - SET_FLAGS8D(B); -} - -/* $114a DECE inherent -***- */ -HD6309_INLINE void dece( void ) -{ - --E; - CLR_NZV; - SET_FLAGS8D(E); -} - -/* $115a DECF inherent -***- */ -HD6309_INLINE void decf( void ) -{ - --F; - CLR_NZV; - SET_FLAGS8D(F); -} - -/* $104a DECD inherent -***- */ -HD6309_INLINE void decd( void ) -{ - UINT32 r; - r = D - 1; - CLR_NZVC; - SET_FLAGS16(D,D,r) - D = r; -} - -/* $105a DECW inherent -***- */ -HD6309_INLINE void decw( void ) -{ - UINT32 r; - r = W - 1; - CLR_NZVC; - SET_FLAGS16(W,W,r) - W = r; -} - -/* $5B ILLEGAL */ - -/* $5C INCB inherent -***- */ -HD6309_INLINE void incb( void ) -{ - ++B; - CLR_NZV; - SET_FLAGS8I(B); -} - -/* $114c INCE inherent -***- */ -HD6309_INLINE void ince( void ) -{ - ++E; - CLR_NZV; - SET_FLAGS8I(E); -} - -/* $115c INCF inherent -***- */ -HD6309_INLINE void incf( void ) -{ - ++F; - CLR_NZV; - SET_FLAGS8I(F); -} - -/* $104c INCD inherent -***- */ -HD6309_INLINE void incd( void ) -{ - UINT32 r; - r = D + 1; - CLR_NZVC; - SET_FLAGS16(D,D,r) - D = r; -} - -/* $105c INCW inherent -***- */ -HD6309_INLINE void incw( void ) -{ - UINT32 r; - r = W + 1; - CLR_NZVC; - SET_FLAGS16(W,W,r) - W = r; -} - -/* $5D TSTB inherent -**0- */ -HD6309_INLINE void tstb( void ) -{ - CLR_NZV; - SET_NZ8(B); -} - -/* $104d TSTD inherent -**0- */ -HD6309_INLINE void tstd( void ) -{ - CLR_NZV; - SET_NZ16(D); -} - -/* $105d TSTW inherent -**0- */ -HD6309_INLINE void tstw( void ) -{ - CLR_NZV; - SET_NZ16(W); -} - -/* $114d TSTE inherent -**0- */ -HD6309_INLINE void tste( void ) -{ - CLR_NZV; - SET_NZ8(E); -} - -/* $115d TSTF inherent -**0- */ -HD6309_INLINE void tstf( void ) -{ - CLR_NZV; - SET_NZ8(F); -} - -/* $5E ILLEGAL */ - -/* $5F CLRB inherent -0100 */ -HD6309_INLINE void clrb( void ) -{ - B = 0; - CLR_NZVC; SEZ; -} - -/* $104f CLRD inherent -0100 */ -HD6309_INLINE void clrd( void ) -{ - D = 0; - CLR_NZVC; SEZ; -} - -/* $114f CLRE inherent -0100 */ -HD6309_INLINE void clre( void ) -{ - E = 0; - CLR_NZVC; SEZ; -} - -/* $115f CLRF inherent -0100 */ -HD6309_INLINE void clrf( void ) -{ - F = 0; - CLR_NZVC; SEZ; -} - -/* $105f CLRW inherent -0100 */ -HD6309_INLINE void clrw( void ) -{ - W = 0; - CLR_NZVC; SEZ; -} - -/* $60 NEG indexed ?**** */ -HD6309_INLINE void neg_ix( void ) -{ - UINT16 r,t; - fetch_effective_address(); - t = RM(EAD); - r=-t; - CLR_NZVC; - SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $61 OIM indexed */ -HD6309_INLINE void oim_ix( void ) -{ - UINT8 r,im; - IMMBYTE(im); - fetch_effective_address(); - r = im | RM(EAD); - CLR_NZV; - SET_NZ8(r); - WM(EAD,r); -} - -/* $62 AIM indexed */ -HD6309_INLINE void aim_ix( void ) -{ - UINT8 r,im; - IMMBYTE(im); - fetch_effective_address(); - r = im & RM(EAD); - CLR_NZV; - SET_NZ8(r); - WM(EAD,r); -} - -/* $63 COM indexed -**01 */ -HD6309_INLINE void com_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t = ~RM(EAD); - CLR_NZV; - SET_NZ8(t); - SEC; - WM(EAD,t); -} - -/* $64 LSR indexed -0*-* */ -HD6309_INLINE void lsr_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t=RM(EAD); - CLR_NZC; - CC |= (t & CC_C); - t>>=1; SET_Z8(t); - WM(EAD,t); -} - -/* $65 EIM indexed */ -HD6309_INLINE void eim_ix( void ) -{ - UINT8 r,im; - IMMBYTE(im); - fetch_effective_address(); - r = im ^ RM(EAD); - CLR_NZV; - SET_NZ8(r); - WM(EAD,r); -} -/* $66 ROR indexed -**-* */ -HD6309_INLINE void ror_ix( void ) -{ - UINT8 t,r; - fetch_effective_address(); - t=RM(EAD); - r = (CC & CC_C) << 7; - CLR_NZC; - CC |= (t & CC_C); - r |= t>>1; SET_NZ8(r); - WM(EAD,r); -} - -/* $67 ASR indexed ?**-* */ -HD6309_INLINE void asr_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t=RM(EAD); - CLR_NZC; - CC |= (t & CC_C); - t=(t&0x80)|(t>>1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $68 ASL indexed ?**** */ -HD6309_INLINE void asl_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t=RM(EAD); - r = t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $69 ROL indexed -**** */ -HD6309_INLINE void rol_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t=RM(EAD); - r = CC & CC_C; - r |= t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $6A DEC indexed -***- */ -HD6309_INLINE void dec_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t = RM(EAD) - 1; - CLR_NZV; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $6B TIM indexed */ -HD6309_INLINE void tim_ix( void ) -{ - UINT8 r,im,m; - IMMBYTE(im); - fetch_effective_address(); - m = RM(EAD); - r = im & m; - CLR_NZV; - SET_NZ8(r); -} - -/* $6C INC indexed -***- */ -HD6309_INLINE void inc_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t = RM(EAD) + 1; - CLR_NZV; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $6D TST indexed -**0- */ -HD6309_INLINE void tst_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t = RM(EAD); - CLR_NZV; - SET_NZ8(t); -} - -/* $6E JMP indexed ----- */ -HD6309_INLINE void jmp_ix( void ) -{ - fetch_effective_address(); - PCD = EAD; - CHANGE_PC; -} - -/* $6F CLR indexed -0100 */ -HD6309_INLINE void clr_ix( void ) -{ - UINT32 dummy; - fetch_effective_address(); - dummy = RM(EAD); - WM(EAD,0); - CLR_NZVC; SEZ; -} - -/* $70 NEG extended ?**** */ -HD6309_INLINE void neg_ex( void ) -{ - UINT16 r,t; - EXTBYTE(t); r=-t; - CLR_NZVC; SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $71 OIM extended */ -HD6309_INLINE void oim_ex( void ) -{ - UINT8 r,t,im; - IMMBYTE(im); - EXTBYTE(t); - r = im | t; - CLR_NZV; - SET_NZ8(r); - WM(EAD,r); -} - -/* $72 AIM extended */ -HD6309_INLINE void aim_ex( void ) -{ - UINT8 r,t,im; - IMMBYTE(im); - EXTBYTE(t); - r = im & t; - CLR_NZV; - SET_NZ8(r); - WM(EAD,r); -} - -/* $73 COM extended -**01 */ -HD6309_INLINE void com_ex( void ) -{ - UINT8 t; - EXTBYTE(t); t = ~t; - CLR_NZV; SET_NZ8(t); SEC; - WM(EAD,t); -} - -/* $74 LSR extended -0*-* */ -HD6309_INLINE void lsr_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZC; CC |= (t & CC_C); - t>>=1; SET_Z8(t); - WM(EAD,t); -} - -/* $75 EIM extended */ -HD6309_INLINE void eim_ex( void ) -{ - UINT8 r,t,im; - IMMBYTE(im); - EXTBYTE(t); - r = im ^ t; - CLR_NZV; - SET_NZ8(r); - WM(EAD,r); -} - -/* $76 ROR extended -**-* */ -HD6309_INLINE void ror_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); r=(CC & CC_C) << 7; - CLR_NZC; CC |= (t & CC_C); - r |= t>>1; SET_NZ8(r); - WM(EAD,r); -} - -/* $77 ASR extended ?**-* */ -HD6309_INLINE void asr_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZC; CC |= (t & CC_C); - t=(t&0x80)|(t>>1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $78 ASL extended ?**** */ -HD6309_INLINE void asl_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r=t<<1; - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $79 ROL extended -**** */ -HD6309_INLINE void rol_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = (CC & CC_C) | (t << 1); - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $7A DEC extended -***- */ -HD6309_INLINE void dec_ex( void ) -{ - UINT8 t; - EXTBYTE(t); --t; - CLR_NZV; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $7B TIM extended */ -HD6309_INLINE void tim_ex( void ) -{ - UINT8 r,t,im; - IMMBYTE(im); - EXTBYTE(t); - r = im & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $7C INC extended -***- */ -HD6309_INLINE void inc_ex( void ) -{ - UINT8 t; - EXTBYTE(t); ++t; - CLR_NZV; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $7D TST extended -**0- */ -HD6309_INLINE void tst_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZV; SET_NZ8(t); -} - -/* $7E JMP extended ----- */ -HD6309_INLINE void jmp_ex( void ) -{ - EXTENDED; - PCD = EAD; - CHANGE_PC; -} - -/* $7F CLR extended -0100 */ -HD6309_INLINE void clr_ex( void ) -{ - UINT32 dummy; - EXTENDED; - dummy = RM(EAD); - WM(EAD,0); - CLR_NZVC; SEZ; -} - -/* $80 SUBA immediate ?**** */ -HD6309_INLINE void suba_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $81 CMPA immediate ?**** */ -HD6309_INLINE void cmpa_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $82 SBCA immediate ?**** */ -HD6309_INLINE void sbca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $83 SUBD (CMPD CMPU) immediate -**** */ -HD6309_INLINE void subd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $1080 SUBW immediate -**** */ -HD6309_INLINE void subw_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = W; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - W = r; -} - -/* $1083 CMPD immediate -**** */ -HD6309_INLINE void cmpd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $1081 CMPW immediate -**** */ -HD6309_INLINE void cmpw_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = W; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $1183 CMPU immediate -**** */ -HD6309_INLINE void cmpu_im( void ) -{ - UINT32 r, d; - PAIR b; - IMMWORD(b); - d = U; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $84 ANDA immediate -**0- */ -HD6309_INLINE void anda_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A &= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $85 BITA immediate -**0- */ -HD6309_INLINE void bita_im( void ) -{ - UINT8 t,r; - IMMBYTE(t); - r = A & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $86 LDA immediate -**0- */ -HD6309_INLINE void lda_im( void ) -{ - IMMBYTE(A); - CLR_NZV; - SET_NZ8(A); -} - -/* $88 EORA immediate -**0- */ -HD6309_INLINE void eora_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A ^= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $89 ADCA immediate ***** */ -HD6309_INLINE void adca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $8A ORA immediate -**0- */ -HD6309_INLINE void ora_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A |= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $8B ADDA immediate ***** */ -HD6309_INLINE void adda_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $8C CMPX (CMPY CMPS) immediate -**** */ -HD6309_INLINE void cmpx_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $108C CMPY immediate -**** */ -HD6309_INLINE void cmpy_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $118C CMPS immediate -**** */ -HD6309_INLINE void cmps_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $8D BSR ----- */ -HD6309_INLINE void bsr( void ) -{ - UINT8 t; - IMMBYTE(t); - PUSHWORD(pPC); - PC += SIGNED(t); - CHANGE_PC; -} - -/* $8E LDX (LDY) immediate -**0- */ -HD6309_INLINE void ldx_im( void ) -{ - IMMWORD(pX); - CLR_NZV; - SET_NZ16(X); -} - -/* $CD LDQ immediate -**0- */ -HD6309_INLINE void ldq_im( void ) -{ - PAIR q; - - IMMLONG(q); - D = q.w.h; - W = q.w.l; - CLR_NZV; - SET_N8(A); - SET_Z(q.d); -} - -/* $108E LDY immediate -**0- */ -HD6309_INLINE void ldy_im( void ) -{ - IMMWORD(pY); - CLR_NZV; - SET_NZ16(Y); -} - -/* $118f MULD immediate */ -HD6309_INLINE void muld_im( void ) -{ - PAIR t, q; - - IMMWORD( t ); - q.d = (INT16) D * (INT16)t.w.l; - D = q.w.h; - W = q.w.l; - CLR_NZVC; - SET_NZ16(D); -} - -/* $118d DIVD immediate */ -HD6309_INLINE void divd_im( void ) -{ - UINT8 t; - INT16 v, oldD; - - IMMBYTE( t ); - - if( t != 0 ) - { - oldD = D; - v = (INT16) D / (INT8) t; - A = (INT16) D % (INT8) t; - B = v; - - CLR_NZVC; - SET_NZ8(B); - - if( B & 0x01 ) - SEC; - - if( (INT16)D < 0 ) - SEN; - - if ( (v > 127) || (v < -128) ) /* soft overflow */ - { - SEV; - - if( (v > 255) || (v < -256) ) /* hard overflow - division is aborted */ - { - SET_NZ16( oldD ); - D = abs( oldD ); - } - } - } - else - { - hd6309_ICount -= 8; - DZError(); - } -} - -/* $118e DIVQ immediate */ -HD6309_INLINE void divq_im( void ) -{ - PAIR t,q, oldQ; - INT32 v; - - IMMWORD( t ); - - q.w.h = D; - q.w.l = W; - - if( t.w.l != 0 ) - { - oldQ = q; - - v = (INT32) q.d / (INT16) t.w.l; - D = (INT32) q.d % (INT16) t.w.l; - W = v; - - CLR_NZVC; - SET_NZ16(W); - - if( W & 0x0001 ) - SEC; - - if ( (v > 32768) || (v < -32767) ) /* soft overflow */ - { - SEV; - - if( (v > 65536 ) || (v < -65535 ) ) /* hard overflow - division is aborted */ - { - if( (INT32)oldQ.d < 0 ) - SEN; - else if( oldQ.d == 0 ) - SEZ; - - t.w.l = abs( t.w.l ); - D = oldQ.w.h; - W = oldQ.w.l; - } - } - } - else - DZError(); -} - -/* $90 SUBA direct ?**** */ -HD6309_INLINE void suba_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $91 CMPA direct ?**** */ -HD6309_INLINE void cmpa_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $92 SBCA direct ?**** */ -HD6309_INLINE void sbca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $93 SUBD (CMPD CMPU) direct -**** */ -HD6309_INLINE void subd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $1090 SUBW direct -**** */ -HD6309_INLINE void subw_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = W; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - W = r; -} - -/* $1093 CMPD direct -**** */ -HD6309_INLINE void cmpd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $1091 CMPW direct -**** */ -HD6309_INLINE void cmpw_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = W; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $1193 CMPU direct -**** */ -HD6309_INLINE void cmpu_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = U; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(U,b.d,r); -} - -/* $94 ANDA direct -**0- */ -HD6309_INLINE void anda_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A &= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $95 BITA direct -**0- */ -HD6309_INLINE void bita_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r = A & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $96 LDA direct -**0- */ -HD6309_INLINE void lda_di( void ) -{ - DIRBYTE(A); - CLR_NZV; - SET_NZ8(A); -} - -/* $97 STA direct -**0- */ -HD6309_INLINE void sta_di( void ) -{ - CLR_NZV; - SET_NZ8(A); - DIRECT; - WM(EAD,A); -} - -/* $98 EORA direct -**0- */ -HD6309_INLINE void eora_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A ^= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $99 ADCA direct ***** */ -HD6309_INLINE void adca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $9A ORA direct -**0- */ -HD6309_INLINE void ora_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A |= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $9B ADDA direct ***** */ -HD6309_INLINE void adda_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $9C CMPX (CMPY CMPS) direct -**** */ -HD6309_INLINE void cmpx_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $109C CMPY direct -**** */ -HD6309_INLINE void cmpy_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $119C CMPS direct -**** */ -HD6309_INLINE void cmps_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $9D JSR direct ----- */ -HD6309_INLINE void jsr_di( void ) -{ - DIRECT; - PUSHWORD(pPC); - PCD = EAD; - CHANGE_PC; -} - -/* $9E LDX (LDY) direct -**0- */ -HD6309_INLINE void ldx_di( void ) -{ - DIRWORD(pX); - CLR_NZV; - SET_NZ16(X); -} - -/* $119f MULD direct -**0- */ -HD6309_INLINE void muld_di( void ) -{ - PAIR t,q; - - DIRWORD(t); - q.d = (INT16) D * (INT16)t.w.l; - - D = q.w.h; - W = q.w.l; - CLR_NZVC; - SET_NZ16(D); -} - -/* $119d DIVD direct -**0- */ -HD6309_INLINE void divd_di( void ) -{ - UINT8 t; - INT16 v, oldD; - - DIRBYTE(t); - - if( t != 0 ) - { - oldD = D; - v = (INT16) D / (INT8) t; - A = (INT16) D % (INT8) t; - B = v; - - CLR_NZVC; - SET_NZ8(B); - - if( B & 0x01 ) - SEC; - - if( (INT16)D < 0 ) - SEN; - - if ( (v > 127) || (v < -128) ) /* soft overflow */ - { - SEV; - - if( (v > 255) || (v < -256) ) /* hard overflow - division is aborted */ - { - SET_NZ16( oldD ); - D = abs( oldD ); - } - } - } - else - { - hd6309_ICount -= 8; - DZError(); - } -} - -/* $119e DIVQ direct -**0- */ -HD6309_INLINE void divq_di( void ) -{ - PAIR t,q, oldQ; - INT32 v; - - DIRWORD(t); - - q.w.h = D; - q.w.l = W; - - if( t.w.l != 0 ) - { - oldQ = q; - - v = (INT32) q.d / (INT16) t.w.l; - D = (INT32) q.d % (INT16) t.w.l; - W = v; - - CLR_NZVC; - SET_NZ16(W); - - if( W & 0x0001 ) - SEC; - - if ( (v > 32767) || (v < -32768) ) /* soft overflow */ - { - SEV; - - if( (v > 65535 ) || (v < -65536 ) ) /* hard overflow - division is aborted */ - { - if( (INT32)oldQ.d < 0 ) - SEN; - else if( oldQ.d == 0 ) - SEZ; - - t.w.l = abs( t.w.l ); - D = oldQ.w.h; - W = oldQ.w.l; - } - } - } - else - DZError(); -} -/* $10dc LDQ direct -**0- */ -HD6309_INLINE void ldq_di( void ) -{ - PAIR q; - - DIRLONG(q); - D = q.w.h; - W = q.w.l; - CLR_NZV; - SET_N8(A); - SET_Z(q.d); -} - -/* $109E LDY direct -**0- */ -HD6309_INLINE void ldy_di( void ) -{ - DIRWORD(pY); - CLR_NZV; - SET_NZ16(Y); -} - -/* $9F STX (STY) direct -**0- */ -HD6309_INLINE void stx_di( void ) -{ - CLR_NZV; - SET_NZ16(X); - DIRECT; - WM16(EAD,&pX); -} - -/* $10dd STQ direct -**0- */ -HD6309_INLINE void stq_di( void ) -{ - PAIR q; - - q.w.h = D; - q.w.l = W; - DIRECT; - WM32(EAD,&q); - CLR_NZV; - SET_N8(A); - SET_Z(q.d); -} - -/* $109F STY direct -**0- */ -HD6309_INLINE void sty_di( void ) -{ - CLR_NZV; - SET_NZ16(Y); - DIRECT; - WM16(EAD,&pY); -} - -/* $a0 SUBA indexed ?**** */ -HD6309_INLINE void suba_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $a1 CMPA indexed ?**** */ -HD6309_INLINE void cmpa_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $a2 SBCA indexed ?**** */ -HD6309_INLINE void sbca_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $a3 SUBD (CMPD CMPU) indexed -**** */ -HD6309_INLINE void subd_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $10a0 SUBW indexed -**** */ -HD6309_INLINE void subw_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = W; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - W = r; -} - -/* $10a3 CMPD indexed -**** */ -HD6309_INLINE void cmpd_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $10a1 CMPW indexed -**** */ -HD6309_INLINE void cmpw_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = W; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11a3 CMPU indexed -**** */ -HD6309_INLINE void cmpu_ix( void ) -{ - UINT32 r; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - r = U - b.d; - CLR_NZVC; - SET_FLAGS16(U,b.d,r); -} - -/* $a4 ANDA indexed -**0- */ -HD6309_INLINE void anda_ix( void ) -{ - fetch_effective_address(); - A &= RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $a5 BITA indexed -**0- */ -HD6309_INLINE void bita_ix( void ) -{ - UINT8 r; - fetch_effective_address(); - r = A & RM(EAD); - CLR_NZV; - SET_NZ8(r); -} - -/* $a6 LDA indexed -**0- */ -HD6309_INLINE void lda_ix( void ) -{ - fetch_effective_address(); - A = RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $a7 STA indexed -**0- */ -HD6309_INLINE void sta_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ8(A); - WM(EAD,A); -} - -/* $a8 EORA indexed -**0- */ -HD6309_INLINE void eora_ix( void ) -{ - fetch_effective_address(); - A ^= RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $a9 ADCA indexed ***** */ -HD6309_INLINE void adca_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $aA ORA indexed -**0- */ -HD6309_INLINE void ora_ix( void ) -{ - fetch_effective_address(); - A |= RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $aB ADDA indexed ***** */ -HD6309_INLINE void adda_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $aC CMPX (CMPY CMPS) indexed -**** */ -HD6309_INLINE void cmpx_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $10aC CMPY indexed -**** */ -HD6309_INLINE void cmpy_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11aC CMPS indexed -**** */ -HD6309_INLINE void cmps_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $aD JSR indexed ----- */ -HD6309_INLINE void jsr_ix( void ) -{ - fetch_effective_address(); - PUSHWORD(pPC); - PCD = EAD; - CHANGE_PC; -} - -/* $aE LDX (LDY) indexed -**0- */ -HD6309_INLINE void ldx_ix( void ) -{ - fetch_effective_address(); - X=RM16(EAD); - CLR_NZV; - SET_NZ16(X); -} - -/* $11af MULD indexed -**0- */ -HD6309_INLINE void muld_ix( void ) -{ - PAIR q; - UINT16 t; - - fetch_effective_address(); - t=RM16(EAD); - q.d = (INT16) D * (INT16)t; - - D = q.w.h; - W = q.w.l; - CLR_NZVC; - SET_NZ16(D); -} - -/* $11ad DIVD indexed -**0- */ -HD6309_INLINE void divd_ix( void ) -{ - UINT8 t; - INT16 v, oldD; - - fetch_effective_address(); - t=RM(EAD); - - if( t != 0 ) - { - oldD = D; - v = (INT16) D / (INT8) t; - A = (INT16) D % (INT8) t; - B = v; - - CLR_NZVC; - SET_NZ8(B); - - if( B & 0x01 ) - SEC; - - if( (INT16)D < 0 ) - SEN; - - if ( (v > 127) || (v < -128) ) /* soft overflow */ - { - SEV; - - if( (v > 255) || (v < -256) ) /* hard overflow - division is aborted */ - { - SET_NZ16( oldD ); - D = abs( oldD ); - } - } - } - else - { - hd6309_ICount -= 8; - DZError(); - } -} - -/* $11ae DIVQ indexed -**0- */ -HD6309_INLINE void divq_ix( void ) -{ - PAIR t,q, oldQ; - INT32 v; - - fetch_effective_address(); - t.w.l=RM16(EAD); - - q.w.h = D; - q.w.l = W; - - if( t.w.l != 0 ) - { - oldQ = q; - - v = (INT32) q.d / (INT16) t.w.l; - D = (INT32) q.d % (INT16) t.w.l; - W = v; - - CLR_NZVC; - SET_NZ16(W); - - if( W & 0x0001 ) - SEC; - - if ( (v > 32767) || (v < -32768) ) /* soft overflow */ - { - SEV; - - if( (v > 65535 ) || (v < -65536 ) ) /* hard overflow - division is aborted */ - { - if( (INT32)oldQ.d < 0 ) - SEN; - else if( oldQ.d == 0 ) - SEZ; - - t.w.l = abs( t.w.l ); - D = oldQ.w.h; - W = oldQ.w.l; - } - } - } - else - DZError(); -} - -/* $10ec LDQ indexed -**0- */ -HD6309_INLINE void ldq_ix( void ) -{ - PAIR q; - - fetch_effective_address(); - q.d=RM32(EAD); - D = q.w.h; - W = q.w.l; - CLR_NZV; - SET_N8(A); - SET_Z(q.d); -} - -/* $10aE LDY indexed -**0- */ -HD6309_INLINE void ldy_ix( void ) -{ - fetch_effective_address(); - Y=RM16(EAD); - CLR_NZV; - SET_NZ16(Y); -} - -/* $aF STX (STY) indexed -**0- */ -HD6309_INLINE void stx_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(X); - WM16(EAD,&pX); -} - -/* $10ed STQ indexed -**0- */ -HD6309_INLINE void stq_ix( void ) -{ - PAIR q; - - q.w.h = D; - q.w.l = W; - fetch_effective_address(); - WM32(EAD,&q); - CLR_NZV; - SET_N8(A); - SET_Z(q.d); -} - -/* $10aF STY indexed -**0- */ -HD6309_INLINE void sty_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(Y); - WM16(EAD,&pY); -} - -/* $b0 SUBA extended ?**** */ -HD6309_INLINE void suba_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $b1 CMPA extended ?**** */ -HD6309_INLINE void cmpa_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $b2 SBCA extended ?**** */ -HD6309_INLINE void sbca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $b3 SUBD (CMPD CMPU) extended -**** */ -HD6309_INLINE void subd_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $10b0 SUBW extended -**** */ -HD6309_INLINE void subw_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = W; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - W = r; -} - -/* $10b3 CMPD extended -**** */ -HD6309_INLINE void cmpd_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $10b1 CMPW extended -**** */ -HD6309_INLINE void cmpw_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = W; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11b3 CMPU extended -**** */ -HD6309_INLINE void cmpu_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = U; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $b4 ANDA extended -**0- */ -HD6309_INLINE void anda_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A &= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $b5 BITA extended -**0- */ -HD6309_INLINE void bita_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); - r = A & t; - CLR_NZV; SET_NZ8(r); -} - -/* $b6 LDA extended -**0- */ -HD6309_INLINE void lda_ex( void ) -{ - EXTBYTE(A); - CLR_NZV; - SET_NZ8(A); -} - -/* $b7 STA extended -**0- */ -HD6309_INLINE void sta_ex( void ) -{ - CLR_NZV; - SET_NZ8(A); - EXTENDED; - WM(EAD,A); -} - -/* $b8 EORA extended -**0- */ -HD6309_INLINE void eora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A ^= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $b9 ADCA extended ***** */ -HD6309_INLINE void adca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $bA ORA extended -**0- */ -HD6309_INLINE void ora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A |= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $bB ADDA extended ***** */ -HD6309_INLINE void adda_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $bC CMPX (CMPY CMPS) extended -**** */ -HD6309_INLINE void cmpx_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $10bC CMPY extended -**** */ -HD6309_INLINE void cmpy_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11bC CMPS extended -**** */ -HD6309_INLINE void cmps_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $bD JSR extended ----- */ -HD6309_INLINE void jsr_ex( void ) -{ - EXTENDED; - PUSHWORD(pPC); - PCD = EAD; - CHANGE_PC; -} - -/* $bE LDX (LDY) extended -**0- */ -HD6309_INLINE void ldx_ex( void ) -{ - EXTWORD(pX); - CLR_NZV; - SET_NZ16(X); -} - -/* $11bf MULD extended -**0- */ -HD6309_INLINE void muld_ex( void ) -{ - PAIR t, q; - - EXTWORD(t); - q.d = (INT16) D * (INT16)t.w.l; - - D = q.w.h; - W = q.w.l; - CLR_NZVC; - SET_NZ16(D); -} - -/* $11bd DIVD extended -**0- */ -HD6309_INLINE void divd_ex( void ) -{ - UINT8 t; - INT16 v, oldD; - - EXTBYTE(t); - - if( t != 0 ) - { - oldD = D; - v = (INT16) D / (INT8) t; - A = (INT16) D % (INT8) t; - B = v; - - CLR_NZVC; - SET_NZ8(B); - - if( B & 0x01 ) - SEC; - - if( (INT16)D < 0 ) - SEN; - - if ( (v > 127) || (v < -128) ) /* soft overflow */ - { - SEV; - - if( (v > 255) || (v < -256) ) /* hard overflow - division is aborted */ - { - SET_NZ16( oldD ); - D = abs( oldD ); - } - } - } - else - { - hd6309_ICount -= 8; - DZError(); - } -} - -/* $11be DIVQ extended -**0- */ -HD6309_INLINE void divq_ex( void ) -{ - PAIR t,q, oldQ; - INT32 v; - - EXTWORD(t); - - q.w.h = D; - q.w.l = W; - - if( t.w.l != 0 ) - { - oldQ = q; - - v = (INT32) q.d / (INT16) t.w.l; - D = (INT32) q.d % (INT16) t.w.l; - W = v; - - CLR_NZVC; - SET_NZ16(W); - - if( W & 0x0001 ) - SEC; - - if ( (v > 32767) || (v < -32768) ) /* soft overflow */ - { - SEV; - - if( (v > 65535 ) || (v < -65536 ) ) /* hard overflow - division is aborted */ - { - if( (INT32)oldQ.d < 0 ) - SEN; - else if( oldQ.d == 0 ) - SEZ; - - t.w.l = abs( t.w.l ); - D = oldQ.w.h; - W = oldQ.w.l; - } - } - } - else - DZError(); -} - -/* $10fc LDQ extended -**0- */ -HD6309_INLINE void ldq_ex( void ) -{ - PAIR q; - - EXTLONG(q); - D = q.w.h; - W = q.w.l; - CLR_NZV; - SET_N8(A); - SET_Z(q.d); -} - -/* $10bE LDY extended -**0- */ -HD6309_INLINE void ldy_ex( void ) -{ - EXTWORD(pY); - CLR_NZV; - SET_NZ16(Y); -} - -/* $bF STX (STY) extended -**0- */ -HD6309_INLINE void stx_ex( void ) -{ - CLR_NZV; - SET_NZ16(X); - EXTENDED; - WM16(EAD,&pX); -} - -/* $10fd STQ extended -**0- */ -HD6309_INLINE void stq_ex( void ) -{ - PAIR q; - - q.w.h = D; - q.w.l = W; - EXTENDED; - WM32(EAD,&q); - CLR_NZV; - SET_N8(A); - SET_Z(q.d); -} - -/* $10bF STY extended -**0- */ -HD6309_INLINE void sty_ex( void ) -{ - CLR_NZV; - SET_NZ16(Y); - EXTENDED; - WM16(EAD,&pY); -} - -/* $c0 SUBB immediate ?**** */ -HD6309_INLINE void subb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $1180 SUBE immediate ?**** */ -HD6309_INLINE void sube_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = E - t; - CLR_NZVC; - SET_FLAGS8(E,t,r); - E = r; -} - -/* $11C0 SUBF immediate ?**** */ -HD6309_INLINE void subf_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = F - t; - CLR_NZVC; - SET_FLAGS8(F,t,r); - F = r; -} - -/* $c1 CMPB immediate ?**** */ -HD6309_INLINE void cmpb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B - t; - CLR_NZVC; SET_FLAGS8(B,t,r); -} - -/* $1181 CMPE immediate ?**** */ -HD6309_INLINE void cmpe_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = E - t; - CLR_NZVC; SET_FLAGS8(E,t,r); -} - -/* $11C1 CMPF immediate ?**** */ -HD6309_INLINE void cmpf_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = F - t; - CLR_NZVC; SET_FLAGS8(F,t,r); -} - -/* $c2 SBCB immediate ?**** */ -HD6309_INLINE void sbcb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $1082 SBCD immediate ?**** */ -HD6309_INLINE void sbcd_im( void ) -{ - PAIR t; - UINT32 r; - IMMWORD(t); - r = D - t.w.l - (CC & CC_C); - CLR_NZVC; - SET_FLAGS16(D,t.w.l,r); - D = r; -} - -/* $c3 ADDD immediate -**** */ -HD6309_INLINE void addd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $108b ADDW immediate -**** */ -HD6309_INLINE void addw_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = W; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - W = r; -} - -/* $118b ADDE immediate -**** */ -HD6309_INLINE void adde_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = E + t; - CLR_HNZVC; - SET_FLAGS8(E,t,r); - SET_H(E,t,r); - E = r; -} - -/* $11Cb ADDF immediate -**** */ -HD6309_INLINE void addf_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = F + t; - CLR_HNZVC; - SET_FLAGS8(F,t,r); - SET_H(F,t,r); - F = r; -} - -/* $c4 ANDB immediate -**0- */ -HD6309_INLINE void andb_im( void ) -{ - UINT8 t; - IMMBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $1084 ANDD immediate -**0- */ -HD6309_INLINE void andd_im( void ) -{ - PAIR t; - IMMWORD(t); - D &= t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $c5 BITB immediate -**0- */ -HD6309_INLINE void bitb_im( void ) -{ - UINT8 t,r; - IMMBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $1085 BITD immediate -**0- */ -HD6309_INLINE void bitd_im( void ) -{ - PAIR t; - UINT16 r; - IMMWORD(t); - r = B & t.w.l; - CLR_NZV; - SET_NZ16(r); -} - -/* $113c BITMD immediate -**0- */ -HD6309_INLINE void bitmd_im( void ) -{ - /* - The following is from Darren A. - - The Z flag is the only condition code that should be affected by BITMD. - For example, when the "Divide-By-Zero" flag (bit 7) is set, BITMD should - not set the N flag. It should also NOT clear the V flag (unlike the other - BIT instructions). - - His comments come from experimentation and differ from Chris Burke - */ - - UINT8 t,r; - IMMBYTE(t); - r = MD & t; - CLR_Z; - SET_Z8(r); - - MD &= ~(r & 0xc0); /* clear the tested high bits */ - -} - -/* $c6 LDB immediate -**0- */ -HD6309_INLINE void ldb_im( void ) -{ - IMMBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* $113d LDMD immediate -**0- */ -HD6309_INLINE void ldmd_im( void ) -{ - IMMBYTE(MD); - UpdateState(); -} - -/* $1186 LDE immediate -**0- */ -HD6309_INLINE void lde_im( void ) -{ - IMMBYTE(E); - CLR_NZV; - SET_NZ8(E); -} - -/* $11C6 LDF immediate -**0- */ -HD6309_INLINE void ldf_im( void ) -{ - IMMBYTE(F); - CLR_NZV; - SET_NZ8(F); -} - -/* $c8 EORB immediate -**0- */ -HD6309_INLINE void eorb_im( void ) -{ - UINT8 t; - IMMBYTE(t); - B ^= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $1088 EORD immediate -**0- */ -HD6309_INLINE void eord_im( void ) -{ - PAIR t; - IMMWORD(t); - D ^= t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $c9 ADCB immediate ***** */ -HD6309_INLINE void adcb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $1089 ADCD immediate ***** */ -HD6309_INLINE void adcd_im( void ) -{ - PAIR t; - UINT32 r; - IMMWORD(t); - r = D + t.w.l + (CC & CC_C); - CLR_NZVC; - SET_FLAGS16(D,t.w.l,r); - D = r; -} - -/* $cA ORB immediate -**0- */ -HD6309_INLINE void orb_im( void ) -{ - UINT8 t; - IMMBYTE(t); - B |= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $108a ORD immediate -**0- */ -HD6309_INLINE void ord_im( void ) -{ - PAIR t; - IMMWORD(t); - D |= t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $cB ADDB immediate ***** */ -HD6309_INLINE void addb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $cC LDD immediate -**0- */ -HD6309_INLINE void ldd_im( void ) -{ - PAIR t; - - IMMWORD(t); - D=t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $1086 LDW immediate -**0- */ -HD6309_INLINE void ldw_im( void ) -{ - PAIR t; - IMMWORD(t); - W=t.w.l; - CLR_NZV; - SET_NZ16(W); -} - -/* $cE LDU (LDS) immediate -**0- */ -HD6309_INLINE void ldu_im( void ) -{ - IMMWORD(pU); - CLR_NZV; - SET_NZ16(U); -} - -/* $10cE LDS immediate -**0- */ -HD6309_INLINE void lds_im( void ) -{ - IMMWORD(pS); - CLR_NZV; - SET_NZ16(S); - hd6309.int_state |= HD6309_LDS; -} - -/* $d0 SUBB direct ?**** */ -HD6309_INLINE void subb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $1190 SUBE direct ?**** */ -HD6309_INLINE void sube_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = E - t; - CLR_NZVC; - SET_FLAGS8(E,t,r); - E = r; -} - -/* $11d0 SUBF direct ?**** */ -HD6309_INLINE void subf_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = F - t; - CLR_NZVC; - SET_FLAGS8(F,t,r); - F = r; -} - -/* $d1 CMPB direct ?**** */ -HD6309_INLINE void cmpb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); -} - -/* $1191 CMPE direct ?**** */ -HD6309_INLINE void cmpe_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = E - t; - CLR_NZVC; - SET_FLAGS8(E,t,r); -} - -/* $11D1 CMPF direct ?**** */ -HD6309_INLINE void cmpf_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = F - t; - CLR_NZVC; - SET_FLAGS8(F,t,r); -} - -/* $d2 SBCB direct ?**** */ -HD6309_INLINE void sbcb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $1092 SBCD direct ?**** */ -HD6309_INLINE void sbcd_di( void ) -{ - PAIR t; - UINT32 r; - DIRWORD(t); - r = D - t.w.l - (CC & CC_C); - CLR_NZVC; - SET_FLAGS16(D,t.w.l,r); - D = r; -} - -/* $d3 ADDD direct -**** */ -HD6309_INLINE void addd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $109b ADDW direct -**** */ -HD6309_INLINE void addw_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = W; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - W = r; -} - -/* $119b ADDE direct -**** */ -HD6309_INLINE void adde_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = E + t; - CLR_HNZVC; - SET_FLAGS8(E,t,r); - SET_H(E,t,r); - E = r; -} - -/* $11db ADDF direct -**** */ -HD6309_INLINE void addf_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = F + t; - CLR_HNZVC; - SET_FLAGS8(F,t,r); - SET_H(F,t,r); - F = r; -} - -/* $d4 ANDB direct -**0- */ -HD6309_INLINE void andb_di( void ) -{ - UINT8 t; - DIRBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $1094 ANDD direct -**0- */ -HD6309_INLINE void andd_di( void ) -{ - PAIR t; - DIRWORD(t); - D &= t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $d5 BITB direct -**0- */ -HD6309_INLINE void bitb_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $1095 BITD direct -**0- */ -HD6309_INLINE void bitd_di( void ) -{ - PAIR t; - UINT16 r; - DIRWORD(t); - r = B & t.w.l; - CLR_NZV; - SET_NZ16(r); -} - -/* $d6 LDB direct -**0- */ -HD6309_INLINE void ldb_di( void ) -{ - DIRBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* $1196 LDE direct -**0- */ -HD6309_INLINE void lde_di( void ) -{ - DIRBYTE(E); - CLR_NZV; - SET_NZ8(E); -} - -/* $11d6 LDF direct -**0- */ -HD6309_INLINE void ldf_di( void ) -{ - DIRBYTE(F); - CLR_NZV; - SET_NZ8(F); -} - -/* $d7 STB direct -**0- */ -HD6309_INLINE void stb_di( void ) -{ - CLR_NZV; - SET_NZ8(B); - DIRECT; - WM(EAD,B); -} - -/* $1197 STE direct -**0- */ -HD6309_INLINE void ste_di( void ) -{ - CLR_NZV; - SET_NZ8(E); - DIRECT; - WM(EAD,E); -} - -/* $11D7 STF direct -**0- */ -HD6309_INLINE void stf_di( void ) -{ - CLR_NZV; - SET_NZ8(F); - DIRECT; - WM(EAD,F); -} - -/* $d8 EORB direct -**0- */ -HD6309_INLINE void eorb_di( void ) -{ - UINT8 t; - DIRBYTE(t); - B ^= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $1098 EORD direct -**0- */ -HD6309_INLINE void eord_di( void ) -{ - PAIR t; - DIRWORD(t); - D ^= t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $d9 ADCB direct ***** */ -HD6309_INLINE void adcb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $1099 adcd direct ***** */ -HD6309_INLINE void adcd_di( void ) -{ - UINT32 r; - PAIR t; - - DIRWORD(t); - r = D + t.w.l + (CC & CC_C); - CLR_NZVC; - SET_FLAGS16(D,t.w.l,r); - D = r; -} - -/* $dA ORB direct -**0- */ -HD6309_INLINE void orb_di( void ) -{ - UINT8 t; - DIRBYTE(t); - B |= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $109a ORD direct -**0- */ -HD6309_INLINE void ord_di( void ) -{ - PAIR t; - DIRWORD(t); - D |= t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $dB ADDB direct ***** */ -HD6309_INLINE void addb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $dC LDD direct -**0- */ -HD6309_INLINE void ldd_di( void ) -{ - PAIR t; - DIRWORD(t); - D=t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $1096 LDW direct -**0- */ -HD6309_INLINE void ldw_di( void ) -{ - PAIR t; - DIRWORD(t); - W=t.w.l; - CLR_NZV; - SET_NZ16(W); -} - -/* $dD STD direct -**0- */ -HD6309_INLINE void std_di( void ) -{ - CLR_NZV; - SET_NZ16(D); - DIRECT; - WM16(EAD,&pD); -} - -/* $1097 STW direct -**0- */ -HD6309_INLINE void stw_di( void ) -{ - CLR_NZV; - SET_NZ16(W); - DIRECT; - WM16(EAD,&pW); -} - -/* $dE LDU (LDS) direct -**0- */ -HD6309_INLINE void ldu_di( void ) -{ - DIRWORD(pU); - CLR_NZV; - SET_NZ16(U); -} - -/* $10dE LDS direct -**0- */ -HD6309_INLINE void lds_di( void ) -{ - DIRWORD(pS); - CLR_NZV; - SET_NZ16(S); - hd6309.int_state |= HD6309_LDS; -} - -/* $dF STU (STS) direct -**0- */ -HD6309_INLINE void stu_di( void ) -{ - CLR_NZV; - SET_NZ16(U); - DIRECT; - WM16(EAD,&pU); -} - -/* $10dF STS direct -**0- */ -HD6309_INLINE void sts_di( void ) -{ - CLR_NZV; - SET_NZ16(S); - DIRECT; - WM16(EAD,&pS); -} - -/* $e0 SUBB indexed ?**** */ -HD6309_INLINE void subb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $11a0 SUBE indexed ?**** */ -HD6309_INLINE void sube_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = E - t; - CLR_NZVC; - SET_FLAGS8(E,t,r); - E = r; -} - -/* $11e0 SUBF indexed ?**** */ -HD6309_INLINE void subf_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = F - t; - CLR_NZVC; - SET_FLAGS8(F,t,r); - F = r; -} - -/* $e1 CMPB indexed ?**** */ -HD6309_INLINE void cmpb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); -} - -/* $11a1 CMPE indexed ?**** */ -HD6309_INLINE void cmpe_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = E - t; - CLR_NZVC; - SET_FLAGS8(E,t,r); -} - -/* $11e1 CMPF indexed ?**** */ -HD6309_INLINE void cmpf_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = F - t; - CLR_NZVC; - SET_FLAGS8(F,t,r); -} - -/* $e2 SBCB indexed ?**** */ -HD6309_INLINE void sbcb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $10a2 SBCD indexed ?**** */ -HD6309_INLINE void sbcd_ix( void ) -{ - UINT32 t,r; - fetch_effective_address(); - t = RM16(EAD); - r = D - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS16(D,t,r); - D = r; -} - -/* $e3 ADDD indexed -**** */ -HD6309_INLINE void addd_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $10ab ADDW indexed -**** */ -HD6309_INLINE void addw_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = W; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - W = r; -} - -/* $11ab ADDE indexed -**** */ -HD6309_INLINE void adde_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = E + t; - CLR_HNZVC; - SET_FLAGS8(E,t,r); - SET_H(E,t,r); - E = r; -} - -/* $11eb ADDF indexed -**** */ -HD6309_INLINE void addf_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = F + t; - CLR_HNZVC; - SET_FLAGS8(F,t,r); - SET_H(F,t,r); - F = r; -} - -/* $e4 ANDB indexed -**0- */ -HD6309_INLINE void andb_ix( void ) -{ - fetch_effective_address(); - B &= RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $10a4 ANDD indexed -**0- */ -HD6309_INLINE void andd_ix( void ) -{ - fetch_effective_address(); - D &= RM16(EAD); - CLR_NZV; - SET_NZ16(D); -} - -/* $e5 BITB indexed -**0- */ -HD6309_INLINE void bitb_ix( void ) -{ - UINT8 r; - fetch_effective_address(); - r = B & RM(EAD); - CLR_NZV; - SET_NZ8(r); -} - -/* $10a5 BITD indexed -**0- */ -HD6309_INLINE void bitd_ix( void ) -{ - UINT16 r; - fetch_effective_address(); - r = D & RM16(EAD); - CLR_NZV; - SET_NZ16(r); -} - -/* $e6 LDB indexed -**0- */ -HD6309_INLINE void ldb_ix( void ) -{ - fetch_effective_address(); - B = RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $11a6 LDE indexed -**0- */ -HD6309_INLINE void lde_ix( void ) -{ - fetch_effective_address(); - E = RM(EAD); - CLR_NZV; - SET_NZ8(E); -} - -/* $11e6 LDF indexed -**0- */ -HD6309_INLINE void ldf_ix( void ) -{ - fetch_effective_address(); - F = RM(EAD); - CLR_NZV; - SET_NZ8(F); -} - -/* $e7 STB indexed -**0- */ -HD6309_INLINE void stb_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ8(B); - WM(EAD,B); -} - -/* $11a7 STE indexed -**0- */ -HD6309_INLINE void ste_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ8(E); - WM(EAD,E); -} - -/* $11e7 STF indexed -**0- */ -HD6309_INLINE void stf_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ8(F); - WM(EAD,F); -} - -/* $e8 EORB indexed -**0- */ -HD6309_INLINE void eorb_ix( void ) -{ - fetch_effective_address(); - B ^= RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $10a8 EORD indexed -**0- */ -HD6309_INLINE void eord_ix( void ) -{ - fetch_effective_address(); - D ^= RM16(EAD); - CLR_NZV; - SET_NZ16(D); -} - -/* $e9 ADCB indexed ***** */ -HD6309_INLINE void adcb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $10a9 ADCD indexed ***** */ -HD6309_INLINE void adcd_ix( void ) -{ - UINT32 r; - PAIR t; - fetch_effective_address(); - t.d = RM16(EAD); - r = D + t.d + (CC & CC_C); - CLR_NZVC; - SET_FLAGS16(D,t.d,r); - D = r; -} - -/* $eA ORB indexed -**0- */ -HD6309_INLINE void orb_ix( void ) -{ - fetch_effective_address(); - B |= RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $10aa ORD indexed -**0- */ -HD6309_INLINE void ord_ix( void ) -{ - fetch_effective_address(); - D |= RM16(EAD); - CLR_NZV; - SET_NZ16(D); -} - -/* $eB ADDB indexed ***** */ -HD6309_INLINE void addb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $eC LDD indexed -**0- */ -HD6309_INLINE void ldd_ix( void ) -{ - fetch_effective_address(); - D=RM16(EAD); - CLR_NZV; SET_NZ16(D); -} - -/* $10a6 LDW indexed -**0- */ -HD6309_INLINE void ldw_ix( void ) -{ - fetch_effective_address(); - W=RM16(EAD); - CLR_NZV; SET_NZ16(W); -} - -/* $eD STD indexed -**0- */ -HD6309_INLINE void std_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(D); - WM16(EAD,&pD); -} - -/* $10a7 STW indexed -**0- */ -HD6309_INLINE void stw_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(W); - WM16(EAD,&pW); -} - -/* $eE LDU (LDS) indexed -**0- */ -HD6309_INLINE void ldu_ix( void ) -{ - fetch_effective_address(); - U=RM16(EAD); - CLR_NZV; - SET_NZ16(U); -} - -/* $10eE LDS indexed -**0- */ -HD6309_INLINE void lds_ix( void ) -{ - fetch_effective_address(); - S=RM16(EAD); - CLR_NZV; - SET_NZ16(S); - hd6309.int_state |= HD6309_LDS; -} - -/* $eF STU (STS) indexed -**0- */ -HD6309_INLINE void stu_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(U); - WM16(EAD,&pU); -} - -/* $10eF STS indexed -**0- */ -HD6309_INLINE void sts_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(S); - WM16(EAD,&pS); -} - -/* $f0 SUBB extended ?**** */ -HD6309_INLINE void subb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $11b0 SUBE extended ?**** */ -HD6309_INLINE void sube_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = E - t; - CLR_NZVC; - SET_FLAGS8(E,t,r); - E = r; -} - -/* $11f0 SUBF extended ?**** */ -HD6309_INLINE void subf_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = F - t; - CLR_NZVC; - SET_FLAGS8(F,t,r); - F = r; -} - -/* $f1 CMPB extended ?**** */ -HD6309_INLINE void cmpb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); -} - -/* $11b1 CMPE extended ?**** */ -HD6309_INLINE void cmpe_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = E - t; - CLR_NZVC; - SET_FLAGS8(E,t,r); -} - -/* $11f1 CMPF extended ?**** */ -HD6309_INLINE void cmpf_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = F - t; - CLR_NZVC; - SET_FLAGS8(F,t,r); -} - -/* $f2 SBCB extended ?**** */ -HD6309_INLINE void sbcb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $10b2 SBCD extended ?**** */ -HD6309_INLINE void sbcd_ex( void ) -{ - PAIR t = {{0,0,0,0}}; - UINT32 r; - - EXTWORD(t); - r = D - t.w.l - (CC & CC_C); - CLR_NZVC; - SET_FLAGS16(D,t.w.l,r); - D = r; -} - -/* $f3 ADDD extended -**** */ -HD6309_INLINE void addd_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $10bb ADDW extended -**** */ -HD6309_INLINE void addw_ex( void ) -{ - UINT32 r,d; - PAIR b = {{0,0,0,0}}; - EXTWORD(b); - d = W; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - W = r; -} - -/* $11bb ADDE extended -**** */ -HD6309_INLINE void adde_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = E + t; - CLR_HNZVC; - SET_FLAGS8(E,t,r); - SET_H(E,t,r); - E = r; -} - -/* $11fb ADDF extended -**** */ -HD6309_INLINE void addf_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = F + t; - CLR_HNZVC; - SET_FLAGS8(F,t,r); - SET_H(F,t,r); - F = r; -} - -/* $f4 ANDB extended -**0- */ -HD6309_INLINE void andb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $10b4 ANDD extended -**0- */ -HD6309_INLINE void andd_ex( void ) -{ - PAIR t = {{0,0,0,0}}; - EXTWORD(t); - D &= t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $f5 BITB extended -**0- */ -HD6309_INLINE void bitb_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $10b5 BITD extended -**0- */ -HD6309_INLINE void bitd_ex( void ) -{ - PAIR t = {{0,0,0,0}}; - UINT8 r; - EXTWORD(t); - r = B & t.w.l; - CLR_NZV; - SET_NZ16(r); -} - -/* $f6 LDB extended -**0- */ -HD6309_INLINE void ldb_ex( void ) -{ - EXTBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* $11b6 LDE extended -**0- */ -HD6309_INLINE void lde_ex( void ) -{ - EXTBYTE(E); - CLR_NZV; - SET_NZ8(E); -} - -/* $11f6 LDF extended -**0- */ -HD6309_INLINE void ldf_ex( void ) -{ - EXTBYTE(F); - CLR_NZV; - SET_NZ8(F); -} - -/* $f7 STB extended -**0- */ -HD6309_INLINE void stb_ex( void ) -{ - CLR_NZV; - SET_NZ8(B); - EXTENDED; - WM(EAD,B); -} - -/* $11b7 STE extended -**0- */ -HD6309_INLINE void ste_ex( void ) -{ - CLR_NZV; - SET_NZ8(E); - EXTENDED; - WM(EAD,E); -} - -/* $11f7 STF extended -**0- */ -HD6309_INLINE void stf_ex( void ) -{ - CLR_NZV; - SET_NZ8(F); - EXTENDED; - WM(EAD,F); -} - -/* $f8 EORB extended -**0- */ -HD6309_INLINE void eorb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B ^= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $10b8 EORD extended -**0- */ -HD6309_INLINE void eord_ex( void ) -{ - PAIR t = {{0,0,0,0}}; - EXTWORD(t); - D ^= t.w.l; - CLR_NZV; - SET_NZ16(D); -} - -/* $f9 ADCB extended ***** */ -HD6309_INLINE void adcb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $10b9 ADCD extended ***** */ -HD6309_INLINE void adcd_ex( void ) -{ - UINT32 r; - PAIR t; - EXTWORD(t); - r = D + t.w.l + (CC & CC_C); - CLR_NZVC; - SET_FLAGS16(D,t.w.l,r); - D = r; -} - -/* $fA ORB extended -**0- */ -HD6309_INLINE void orb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B |= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $10ba ORD extended -**0- */ -HD6309_INLINE void ord_ex( void ) -{ - PAIR t = {{0,0,0,0}}; - EXTWORD(t); - D |= t.w.l; - CLR_NZV; - SET_NZ8(D); -} - -/* $fB ADDB extended ***** */ -HD6309_INLINE void addb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $fC LDD extended -**0- */ -HD6309_INLINE void ldd_ex( void ) -{ - EXTWORD(pD); - CLR_NZV; - SET_NZ16(D); -} - -/* $10b6 LDW extended -**0- */ -HD6309_INLINE void ldw_ex( void ) -{ - EXTWORD(pW); - CLR_NZV; - SET_NZ16(W); -} - -/* $fD STD extended -**0- */ -HD6309_INLINE void std_ex( void ) -{ - CLR_NZV; - SET_NZ16(D); - EXTENDED; - WM16(EAD,&pD); -} - -/* $10b7 STW extended -**0- */ -HD6309_INLINE void stw_ex( void ) -{ - CLR_NZV; - SET_NZ16(W); - EXTENDED; - WM16(EAD,&pW); -} - -/* $fE LDU (LDS) extended -**0- */ -HD6309_INLINE void ldu_ex( void ) -{ - EXTWORD(pU); - CLR_NZV; - SET_NZ16(U); -} - -/* $10fE LDS extended -**0- */ -HD6309_INLINE void lds_ex( void ) -{ - EXTWORD(pS); - CLR_NZV; - SET_NZ16(S); - hd6309.int_state |= HD6309_LDS; -} - -/* $fF STU (STS) extended -**0- */ -HD6309_INLINE void stu_ex( void ) -{ - CLR_NZV; - SET_NZ16(U); - EXTENDED; - WM16(EAD,&pU); -} - -/* $10fF STS extended -**0- */ -HD6309_INLINE void sts_ex( void ) -{ - CLR_NZV; - SET_NZ16(S); - EXTENDED; - WM16(EAD,&pS); -} - -/* $10xx opcodes */ -HD6309_INLINE void pref10( void ) -{ - UINT8 ireg2 = ROP(PCD); - PC++; - -#ifdef BIG_SWITCH - switch( ireg2 ) - { - case 0x21: lbrn(); break; - case 0x22: lbhi(); break; - case 0x23: lbls(); break; - case 0x24: lbcc(); break; - case 0x25: lbcs(); break; - case 0x26: lbne(); break; - case 0x27: lbeq(); break; - case 0x28: lbvc(); break; - case 0x29: lbvs(); break; - case 0x2a: lbpl(); break; - case 0x2b: lbmi(); break; - case 0x2c: lbge(); break; - case 0x2d: lblt(); break; - case 0x2e: lbgt(); break; - case 0x2f: lble(); break; - - case 0x30: addr_r(); break; - case 0x31: adcr(); break; - case 0x32: subr(); break; - case 0x33: sbcr(); break; - case 0x34: andr(); break; - case 0x35: orr(); break; - case 0x36: eorr(); break; - case 0x37: cmpr(); break; - case 0x38: pshsw(); break; - case 0x39: pulsw(); break; - case 0x3a: pshuw(); break; - case 0x3b: puluw(); break; - case 0x3f: swi2(); break; - - case 0x40: negd(); break; - case 0x43: comd(); break; - case 0x44: lsrd(); break; - case 0x46: rord(); break; - case 0x47: asrd(); break; - case 0x48: asld(); break; - case 0x49: rold(); break; - case 0x4a: decd(); break; - case 0x4c: incd(); break; - case 0x4d: tstd(); break; - case 0x4f: clrd(); break; - - case 0x53: comw(); break; - case 0x54: lsrw(); break; - case 0x56: rorw(); break; - case 0x59: rolw(); break; - case 0x5a: decw(); break; - case 0x5c: incw(); break; - case 0x5d: tstw(); break; - case 0x5f: clrw(); break; - - case 0x80: subw_im(); break; - case 0x81: cmpw_im(); break; - case 0x82: sbcd_im(); break; - case 0x83: cmpd_im(); break; - case 0x84: andd_im(); break; - case 0x85: bitd_im(); break; - case 0x86: ldw_im(); break; - case 0x88: eord_im(); break; - case 0x89: adcd_im(); break; - case 0x8a: ord_im(); break; - case 0x8b: addw_im(); break; - case 0x8c: cmpy_im(); break; - case 0x8e: ldy_im(); break; - - case 0x90: subw_di(); break; - case 0x91: cmpw_di(); break; - case 0x92: sbcd_di(); break; - case 0x93: cmpd_di(); break; - case 0x94: andd_di(); break; - case 0x95: bitd_di(); break; - case 0x96: ldw_di(); break; - case 0x97: stw_di(); break; - case 0x98: eord_di(); break; - case 0x99: adcd_di(); break; - case 0x9a: ord_di(); break; - case 0x9b: addw_di(); break; - case 0x9c: cmpy_di(); break; - case 0x9e: ldy_di(); break; - case 0x9f: sty_di(); break; - - case 0xa0: subw_ix(); break; - case 0xa1: cmpw_ix(); break; - case 0xa2: sbcd_ix(); break; - case 0xa3: cmpd_ix(); break; - case 0xa4: andd_ix(); break; - case 0xa5: bitd_ix(); break; - case 0xa6: ldw_ix(); break; - case 0xa7: stw_ix(); break; - case 0xa8: eord_ix(); break; - case 0xa9: adcd_ix(); break; - case 0xaa: ord_ix(); break; - case 0xab: addw_ix(); break; - case 0xac: cmpy_ix(); break; - case 0xae: ldy_ix(); break; - case 0xaf: sty_ix(); break; - - case 0xb0: subw_ex(); break; - case 0xb1: cmpw_ex(); break; - case 0xb2: sbcd_ex(); break; - case 0xb3: cmpd_ex(); break; - case 0xb4: andd_ex(); break; - case 0xb5: bitd_ex(); break; - case 0xb6: ldw_ex(); break; - case 0xb7: stw_ex(); break; - case 0xb8: eord_ex(); break; - case 0xb9: adcd_ex(); break; - case 0xba: ord_ex(); break; - case 0xbb: addw_ex(); break; - case 0xbc: cmpy_ex(); break; - case 0xbe: ldy_ex(); break; - case 0xbf: sty_ex(); break; - - case 0xce: lds_im(); break; - - case 0xdc: ldq_di(); break; - case 0xdd: stq_di(); break; - case 0xde: lds_di(); break; - case 0xdf: sts_di(); break; - - case 0xec: ldq_ix(); break; - case 0xed: stq_ix(); break; - case 0xee: lds_ix(); break; - case 0xef: sts_ix(); break; - - case 0xfc: ldq_ex(); break; - case 0xfd: stq_ex(); break; - case 0xfe: lds_ex(); break; - case 0xff: sts_ex(); break; - - default: IIError(); break; - } -#else - - (*hd6309_page01[ireg2])(); - -#endif /* BIG_SWITCH */ - - hd6309_ICount -= cycle_counts_page01[ireg2]; -} - -/* $11xx opcodes */ -HD6309_INLINE void pref11( void ) -{ - UINT8 ireg2 = ROP(PCD); - PC++; - -#ifdef BIG_SWITCH - switch( ireg2 ) - { - case 0x30: band(); break; - case 0x31: biand(); break; - case 0x32: bor(); break; - case 0x33: bior(); break; - case 0x34: beor(); break; - case 0x35: bieor(); break; - case 0x36: ldbt(); break; - case 0x37: stbt(); break; - case 0x38: tfmpp(); break; /* Timing for TFM is actually 6+3n. */ - case 0x39: tfmmm(); break; /* To avoid saving the state, I decided */ - case 0x3a: tfmpc(); break; /* to push the initial 6 cycles to the end */ - case 0x3b: tfmcp(); break; /* We will soon see how this fairs! */ - case 0x3c: bitmd_im(); break; - case 0x3d: ldmd_im(); break; - case 0x3f: swi3(); break; - - case 0x43: come(); break; - case 0x4a: dece(); break; - case 0x4c: ince(); break; - case 0x4d: tste(); break; - case 0x4f: clre(); break; - - case 0x53: comf(); break; - case 0x5a: decf(); break; - case 0x5c: incf(); break; - case 0x5d: tstf(); break; - case 0x5f: clrf(); break; - - case 0x80: sube_im(); break; - case 0x81: cmpe_im(); break; - case 0x83: cmpu_im(); break; - case 0x86: lde_im(); break; - case 0x8b: adde_im(); break; - case 0x8c: cmps_im(); break; - case 0x8d: divd_im(); break; - case 0x8e: divq_im(); break; - case 0x8f: muld_im(); break; - - case 0x90: sube_di(); break; - case 0x91: cmpe_di(); break; - case 0x93: cmpu_di(); break; - case 0x96: lde_di(); break; - case 0x97: ste_di(); break; - case 0x9b: adde_di(); break; - case 0x9c: cmps_di(); break; - case 0x9d: divd_di(); break; - case 0x9e: divq_di(); break; - case 0x9f: muld_di(); break; - - case 0xa0: sube_ix(); break; - case 0xa1: cmpe_ix(); break; - case 0xa3: cmpu_ix(); break; - case 0xa6: lde_ix(); break; - case 0xa7: ste_ix(); break; - case 0xab: adde_ix(); break; - case 0xac: cmps_ix(); break; - case 0xad: divd_ix(); break; - case 0xae: divq_ix(); break; - case 0xaf: muld_ix(); break; - - case 0xb0: sube_ex(); break; - case 0xb1: cmpe_ex(); break; - case 0xb3: cmpu_ex(); break; - case 0xb6: lde_ex(); break; - case 0xb7: ste_ex(); break; - case 0xbb: adde_ex(); break; - case 0xbc: cmps_ex(); break; - case 0xbd: divd_ex(); break; - case 0xbe: divq_ex(); break; - case 0xbf: muld_ex(); break; - - case 0xc0: subf_im(); break; - case 0xc1: cmpf_im(); break; - case 0xc6: ldf_im(); break; - case 0xcb: addf_im(); break; - - case 0xd0: subf_di(); break; - case 0xd1: cmpf_di(); break; - case 0xd6: ldf_di(); break; - case 0xd7: stf_di(); break; - case 0xdb: addf_di(); break; - - case 0xe0: subf_ix(); break; - case 0xe1: cmpf_ix(); break; - case 0xe6: ldf_ix(); break; - case 0xe7: stf_ix(); break; - case 0xeb: addf_ix(); break; - - case 0xf0: subf_ex(); break; - case 0xf1: cmpf_ex(); break; - case 0xf6: ldf_ex(); break; - case 0xf7: stf_ex(); break; - case 0xfb: addf_ex(); break; - - default: IIError(); break; - } -#else - - (*hd6309_page11[ireg2])(); - -#endif /* BIG_SWITCH */ - hd6309_ICount -= cycle_counts_page11[ireg2]; -} - diff --git a/jan/src/cpu/hd6309/6309tbl.c b/jan/src/cpu/hd6309/6309tbl.c deleted file mode 100644 index 38537614b..000000000 --- a/jan/src/cpu/hd6309/6309tbl.c +++ /dev/null @@ -1,814 +0,0 @@ -HD6309_INLINE void illegal( void ); -HD6309_INLINE void neg_di( void ); -HD6309_INLINE void oim_di( void ); -HD6309_INLINE void aim_di( void ); -HD6309_INLINE void com_di( void ); -HD6309_INLINE void lsr_di( void ); -HD6309_INLINE void eim_di( void ); -HD6309_INLINE void ror_di( void ); -HD6309_INLINE void asr_di( void ); -HD6309_INLINE void asl_di( void ); -HD6309_INLINE void rol_di( void ); -HD6309_INLINE void dec_di( void ); -HD6309_INLINE void tim_di( void ); -HD6309_INLINE void inc_di( void ); -HD6309_INLINE void tst_di( void ); -HD6309_INLINE void jmp_di( void ); -HD6309_INLINE void clr_di( void ); -HD6309_INLINE void nop( void ); -HD6309_INLINE void sync( void ); -HD6309_INLINE void sexw( void ); -HD6309_INLINE void lbra( void ); -HD6309_INLINE void lbsr( void ); -HD6309_INLINE void daa( void ); -HD6309_INLINE void daa( void ); -HD6309_INLINE void orcc( void ); -HD6309_INLINE void andcc( void ); -HD6309_INLINE void sex( void ); -HD6309_INLINE void exg( void ); -HD6309_INLINE void tfr( void ); -HD6309_INLINE void bra( void ); -HD6309_INLINE void brn( void ); -HD6309_INLINE void lbrn( void ); -HD6309_INLINE void bhi( void ); -HD6309_INLINE void lbhi( void ); -HD6309_INLINE void bls( void ); -HD6309_INLINE void lbls( void ); -HD6309_INLINE void bcc( void ); -HD6309_INLINE void lbcc( void ); -HD6309_INLINE void bcs( void ); -HD6309_INLINE void lbcs( void ); -HD6309_INLINE void bne( void ); -HD6309_INLINE void lbne( void ); -HD6309_INLINE void beq( void ); -HD6309_INLINE void lbeq( void ); -HD6309_INLINE void bvc( void ); -HD6309_INLINE void lbvc( void ); -HD6309_INLINE void bvs( void ); -HD6309_INLINE void lbvs( void ); -HD6309_INLINE void bpl( void ); -HD6309_INLINE void lbpl( void ); -HD6309_INLINE void bmi( void ); -HD6309_INLINE void lbmi( void ); -HD6309_INLINE void bge( void ); -HD6309_INLINE void lbge( void ); -HD6309_INLINE void blt( void ); -HD6309_INLINE void lblt( void ); -HD6309_INLINE void bgt( void ); -HD6309_INLINE void lbgt( void ); -HD6309_INLINE void ble( void ); -HD6309_INLINE void lble( void ); -HD6309_INLINE void addr_r( void ); -HD6309_INLINE void adcr( void ); -HD6309_INLINE void subr( void ); -HD6309_INLINE void sbcr( void ); -HD6309_INLINE void andr( void ); -HD6309_INLINE void orr( void ); -HD6309_INLINE void eorr( void ); -HD6309_INLINE void cmpr( void ); -HD6309_INLINE void tfmpp( void ); -HD6309_INLINE void tfmmm( void ); -HD6309_INLINE void tfmpc( void ); -HD6309_INLINE void tfmcp( void ); -HD6309_INLINE void bitmd_im( void ); -HD6309_INLINE void leax( void ); -HD6309_INLINE void leay( void ); -HD6309_INLINE void leas( void ); -HD6309_INLINE void leau( void ); -HD6309_INLINE void pshs( void ); -HD6309_INLINE void ldmd_im( void ); -HD6309_INLINE void pshsw( void ); -HD6309_INLINE void pshuw( void ); -HD6309_INLINE void puls( void ); -HD6309_INLINE void pulsw( void ); -HD6309_INLINE void puluw( void ); -HD6309_INLINE void pshu( void ); -HD6309_INLINE void pulu( void ); -HD6309_INLINE void rts( void ); -HD6309_INLINE void abx( void ); -HD6309_INLINE void rti( void ); -HD6309_INLINE void cwai( void ); -HD6309_INLINE void bitd_di( void ); -HD6309_INLINE void bitd_ix( void ); -HD6309_INLINE void bitd_ex( void ); -HD6309_INLINE void mul( void ); -HD6309_INLINE void swi( void ); -HD6309_INLINE void band( void ); -HD6309_INLINE void bitd_im( void ); -HD6309_INLINE void biand( void ); -HD6309_INLINE void bor( void ); -HD6309_INLINE void bior( void ); -HD6309_INLINE void beor( void ); -HD6309_INLINE void bieor( void ); -HD6309_INLINE void ldbt( void ); -HD6309_INLINE void stbt( void ); -HD6309_INLINE void swi2( void ); -HD6309_INLINE void swi3( void ); -HD6309_INLINE void nega( void ); -HD6309_INLINE void coma( void ); -HD6309_INLINE void lsra( void ); -HD6309_INLINE void rora( void ); -HD6309_INLINE void asra( void ); -HD6309_INLINE void asla( void ); -HD6309_INLINE void rola( void ); -HD6309_INLINE void deca( void ); -HD6309_INLINE void inca( void ); -HD6309_INLINE void tsta( void ); -HD6309_INLINE void clra( void ); -HD6309_INLINE void negb( void ); -HD6309_INLINE void negd( void ); -HD6309_INLINE void comb( void ); -HD6309_INLINE void come( void ); -HD6309_INLINE void comf( void ); -HD6309_INLINE void comd( void ); -HD6309_INLINE void comw( void ); -HD6309_INLINE void lsrb( void ); -HD6309_INLINE void lsrd( void ); -HD6309_INLINE void lsrw( void ); -HD6309_INLINE void rorb( void ); -HD6309_INLINE void rord( void ); -HD6309_INLINE void rorw( void ); -HD6309_INLINE void asrb( void ); -HD6309_INLINE void asrd( void ); -HD6309_INLINE void aslb( void ); -HD6309_INLINE void asld( void ); -HD6309_INLINE void rolb( void ); -HD6309_INLINE void rold( void ); -HD6309_INLINE void rolw( void ); -HD6309_INLINE void decb( void ); -HD6309_INLINE void dece( void ); -HD6309_INLINE void decf( void ); -HD6309_INLINE void decd( void ); -HD6309_INLINE void decw( void ); -HD6309_INLINE void incb( void ); -HD6309_INLINE void ince( void ); -HD6309_INLINE void incf( void ); -HD6309_INLINE void incd( void ); -HD6309_INLINE void incw( void ); -HD6309_INLINE void tstb( void ); -HD6309_INLINE void tstd( void ); -HD6309_INLINE void tstw( void ); -HD6309_INLINE void tste( void ); -HD6309_INLINE void tstf( void ); -HD6309_INLINE void clrb( void ); -HD6309_INLINE void clrd( void ); -HD6309_INLINE void clre( void ); -HD6309_INLINE void clrf( void ); -HD6309_INLINE void clrw( void ); -HD6309_INLINE void neg_ix( void ); -HD6309_INLINE void oim_ix( void ); -HD6309_INLINE void aim_ix( void ); -HD6309_INLINE void com_ix( void ); -HD6309_INLINE void lsr_ix( void ); -HD6309_INLINE void eim_ix( void ); -HD6309_INLINE void ror_ix( void ); -HD6309_INLINE void asr_ix( void ); -HD6309_INLINE void asl_ix( void ); -HD6309_INLINE void rol_ix( void ); -HD6309_INLINE void dec_ix( void ); -HD6309_INLINE void tim_ix( void ); -HD6309_INLINE void inc_ix( void ); -HD6309_INLINE void tst_ix( void ); -HD6309_INLINE void jmp_ix( void ); -HD6309_INLINE void clr_ix( void ); -HD6309_INLINE void neg_ex( void ); -HD6309_INLINE void oim_ex( void ); -HD6309_INLINE void aim_ex( void ); -HD6309_INLINE void com_ex( void ); -HD6309_INLINE void lsr_ex( void ); -HD6309_INLINE void eim_ex( void ); -HD6309_INLINE void ror_ex( void ); -HD6309_INLINE void asr_ex( void ); -HD6309_INLINE void asl_ex( void ); -HD6309_INLINE void rol_ex( void ); -HD6309_INLINE void dec_ex( void ); -HD6309_INLINE void tim_ex( void ); -HD6309_INLINE void inc_ex( void ); -HD6309_INLINE void tst_ex( void ); -HD6309_INLINE void jmp_ex( void ); -HD6309_INLINE void clr_ex( void ); -HD6309_INLINE void suba_im( void ); -HD6309_INLINE void cmpa_im( void ); -HD6309_INLINE void sbca_im( void ); -HD6309_INLINE void subd_im( void ); -HD6309_INLINE void subw_im( void ); -HD6309_INLINE void cmpd_im( void ); -HD6309_INLINE void cmpw_im( void ); -HD6309_INLINE void cmpu_im( void ); -HD6309_INLINE void anda_im( void ); -HD6309_INLINE void bita_im( void ); -HD6309_INLINE void lda_im( void ); -HD6309_INLINE void eora_im( void ); -HD6309_INLINE void adca_im( void ); -HD6309_INLINE void ora_im( void ); -HD6309_INLINE void adda_im( void ); -HD6309_INLINE void cmpx_im( void ); -HD6309_INLINE void cmpy_im( void ); -HD6309_INLINE void cmps_im( void ); -HD6309_INLINE void bsr( void ); -HD6309_INLINE void ldx_im( void ); -HD6309_INLINE void ldq_im( void ); -HD6309_INLINE void ldy_im( void ); -HD6309_INLINE void suba_di( void ); -HD6309_INLINE void cmpa_di( void ); -HD6309_INLINE void sbca_di( void ); -HD6309_INLINE void subd_di( void ); -HD6309_INLINE void subw_di( void ); -HD6309_INLINE void cmpd_di( void ); -HD6309_INLINE void cmpw_di( void ); -HD6309_INLINE void cmpu_di( void ); -HD6309_INLINE void anda_di( void ); -HD6309_INLINE void bita_di( void ); -HD6309_INLINE void lda_di( void ); -HD6309_INLINE void sta_di( void ); -HD6309_INLINE void eora_di( void ); -HD6309_INLINE void adca_di( void ); -HD6309_INLINE void ora_di( void ); -HD6309_INLINE void adda_di( void ); -HD6309_INLINE void cmpx_di( void ); -HD6309_INLINE void cmpy_di( void ); -HD6309_INLINE void cmps_di( void ); -HD6309_INLINE void jsr_di( void ); -HD6309_INLINE void ldx_di( void ); -HD6309_INLINE void muld_di( void ); -HD6309_INLINE void divd_im( void ); -HD6309_INLINE void divq_im( void ); -HD6309_INLINE void muld_im( void ); -HD6309_INLINE void divd_di( void ); -HD6309_INLINE void divq_di( void ); -HD6309_INLINE void ldq_di( void ); -HD6309_INLINE void ldy_di( void ); -HD6309_INLINE void stx_di( void ); -HD6309_INLINE void stq_di( void ); -HD6309_INLINE void sty_di( void ); -HD6309_INLINE void suba_ix( void ); -HD6309_INLINE void cmpa_ix( void ); -HD6309_INLINE void sbca_ix( void ); -HD6309_INLINE void subd_ix( void ); -HD6309_INLINE void subw_ix( void ); -HD6309_INLINE void cmpd_ix( void ); -HD6309_INLINE void cmpw_ix( void ); -HD6309_INLINE void cmpu_ix( void ); -HD6309_INLINE void anda_ix( void ); -HD6309_INLINE void bita_ix( void ); -HD6309_INLINE void lda_ix( void ); -HD6309_INLINE void sta_ix( void ); -HD6309_INLINE void eora_ix( void ); -HD6309_INLINE void adca_ix( void ); -HD6309_INLINE void ora_ix( void ); -HD6309_INLINE void adda_ix( void ); -HD6309_INLINE void cmpx_ix( void ); -HD6309_INLINE void cmpy_ix( void ); -HD6309_INLINE void cmps_ix( void ); -HD6309_INLINE void jsr_ix( void ); -HD6309_INLINE void ldx_ix( void ); -HD6309_INLINE void muld_ix( void ); -HD6309_INLINE void divd_ix( void ); -HD6309_INLINE void divq_ix( void ); -HD6309_INLINE void ldq_ix( void ); -HD6309_INLINE void ldy_ix( void ); -HD6309_INLINE void stx_ix( void ); -HD6309_INLINE void stq_ix( void ); -HD6309_INLINE void sty_ix( void ); -HD6309_INLINE void suba_ex( void ); -HD6309_INLINE void cmpa_ex( void ); -HD6309_INLINE void sbca_ex( void ); -HD6309_INLINE void subd_ex( void ); -HD6309_INLINE void subw_ex( void ); -HD6309_INLINE void cmpd_ex( void ); -HD6309_INLINE void cmpw_ex( void ); -HD6309_INLINE void cmpu_ex( void ); -HD6309_INLINE void anda_ex( void ); -HD6309_INLINE void bita_ex( void ); -HD6309_INLINE void lda_ex( void ); -HD6309_INLINE void sta_ex( void ); -HD6309_INLINE void eora_ex( void ); -HD6309_INLINE void adca_ex( void ); -HD6309_INLINE void ora_ex( void ); -HD6309_INLINE void adda_ex( void ); -HD6309_INLINE void cmpx_ex( void ); -HD6309_INLINE void cmpy_ex( void ); -HD6309_INLINE void cmps_ex( void ); -HD6309_INLINE void jsr_ex( void ); -HD6309_INLINE void ldx_ex( void ); -HD6309_INLINE void muld_ex( void ); -HD6309_INLINE void divd_ex( void ); -HD6309_INLINE void divq_ex( void ); -HD6309_INLINE void ldq_ex( void ); -HD6309_INLINE void ldy_ex( void ); -HD6309_INLINE void stx_ex( void ); -HD6309_INLINE void stq_ex( void ); -HD6309_INLINE void sty_ex( void ); -HD6309_INLINE void subb_im( void ); -HD6309_INLINE void sube_im( void ); -HD6309_INLINE void subf_im( void ); -HD6309_INLINE void cmpb_im( void ); -HD6309_INLINE void cmpe_im( void ); -HD6309_INLINE void cmpf_im( void ); -HD6309_INLINE void sbcb_im( void ); -HD6309_INLINE void sbcd_im( void ); -HD6309_INLINE void addd_im( void ); -HD6309_INLINE void addw_im( void ); -HD6309_INLINE void adde_im( void ); -HD6309_INLINE void addf_im( void ); -HD6309_INLINE void andb_im( void ); -HD6309_INLINE void andd_im( void ); -HD6309_INLINE void bitb_im( void ); -HD6309_INLINE void ldb_im( void ); -HD6309_INLINE void lde_im( void ); -HD6309_INLINE void ldf_im( void ); -HD6309_INLINE void eorb_im( void ); -HD6309_INLINE void eord_im( void ); -HD6309_INLINE void adcb_im( void ); -HD6309_INLINE void adcd_im( void ); -HD6309_INLINE void orb_im( void ); -HD6309_INLINE void ord_im( void ); -HD6309_INLINE void addb_im( void ); -HD6309_INLINE void ldd_im( void ); -HD6309_INLINE void ldw_im( void ); -HD6309_INLINE void ldu_im( void ); -HD6309_INLINE void lds_im( void ); -HD6309_INLINE void subb_di( void ); -HD6309_INLINE void sube_di( void ); -HD6309_INLINE void subf_di( void ); -HD6309_INLINE void cmpb_di( void ); -HD6309_INLINE void cmpe_di( void ); -HD6309_INLINE void cmpf_di( void ); -HD6309_INLINE void sbcb_di( void ); -HD6309_INLINE void sbcd_di( void ); -HD6309_INLINE void addd_di( void ); -HD6309_INLINE void addw_di( void ); -HD6309_INLINE void adde_di( void ); -HD6309_INLINE void addf_di( void ); -HD6309_INLINE void andb_di( void ); -HD6309_INLINE void andd_di( void ); -HD6309_INLINE void bitb_di( void ); -HD6309_INLINE void ldb_di( void ); -HD6309_INLINE void lde_di( void ); -HD6309_INLINE void ldf_di( void ); -HD6309_INLINE void stb_di( void ); -HD6309_INLINE void ste_di( void ); -HD6309_INLINE void stf_di( void ); -HD6309_INLINE void eorb_di( void ); -HD6309_INLINE void eord_di( void ); -HD6309_INLINE void adcb_di( void ); -HD6309_INLINE void adcd_di( void ); -HD6309_INLINE void orb_di( void ); -HD6309_INLINE void ord_di( void ); -HD6309_INLINE void addb_di( void ); -HD6309_INLINE void ldd_di( void ); -HD6309_INLINE void ldw_di( void ); -HD6309_INLINE void std_di( void ); -HD6309_INLINE void stw_di( void ); -HD6309_INLINE void ldu_di( void ); -HD6309_INLINE void lds_di( void ); -HD6309_INLINE void stu_di( void ); -HD6309_INLINE void sts_di( void ); -HD6309_INLINE void subb_ix( void ); -HD6309_INLINE void sube_ix( void ); -HD6309_INLINE void subf_ix( void ); -HD6309_INLINE void cmpb_ix( void ); -HD6309_INLINE void cmpe_ix( void ); -HD6309_INLINE void cmpf_ix( void ); -HD6309_INLINE void sbcb_ix( void ); -HD6309_INLINE void sbcd_ix( void ); -HD6309_INLINE void addd_ix( void ); -HD6309_INLINE void addw_ix( void ); -HD6309_INLINE void adde_ix( void ); -HD6309_INLINE void addf_ix( void ); -HD6309_INLINE void andb_ix( void ); -HD6309_INLINE void andd_ix( void ); -HD6309_INLINE void bitb_ix( void ); -HD6309_INLINE void ldb_ix( void ); -HD6309_INLINE void lde_ix( void ); -HD6309_INLINE void ldf_ix( void ); -HD6309_INLINE void stb_ix( void ); -HD6309_INLINE void ste_ix( void ); -HD6309_INLINE void stf_ix( void ); -HD6309_INLINE void eorb_ix( void ); -HD6309_INLINE void eord_ix( void ); -HD6309_INLINE void adcb_ix( void ); -HD6309_INLINE void adcd_ix( void ); -HD6309_INLINE void orb_ix( void ); -HD6309_INLINE void ord_ix( void ); -HD6309_INLINE void addb_ix( void ); -HD6309_INLINE void ldd_ix( void ); -HD6309_INLINE void ldw_ix( void ); -HD6309_INLINE void std_ix( void ); -HD6309_INLINE void stw_ix( void ); -HD6309_INLINE void ldu_ix( void ); -HD6309_INLINE void lds_ix( void ); -HD6309_INLINE void stu_ix( void ); -HD6309_INLINE void sts_ix( void ); -HD6309_INLINE void subb_ex( void ); -HD6309_INLINE void sube_ex( void ); -HD6309_INLINE void subf_ex( void ); -HD6309_INLINE void cmpb_ex( void ); -HD6309_INLINE void cmpe_ex( void ); -HD6309_INLINE void cmpf_ex( void ); -HD6309_INLINE void sbcb_ex( void ); -HD6309_INLINE void sbcd_ex( void ); -HD6309_INLINE void addd_ex( void ); -HD6309_INLINE void addw_ex( void ); -HD6309_INLINE void adde_ex( void ); -HD6309_INLINE void addf_ex( void ); -HD6309_INLINE void andb_ex( void ); -HD6309_INLINE void andd_ex( void ); -HD6309_INLINE void bitb_ex( void ); -HD6309_INLINE void ldb_ex( void ); -HD6309_INLINE void lde_ex( void ); -HD6309_INLINE void ldf_ex( void ); -HD6309_INLINE void stb_ex( void ); -HD6309_INLINE void ste_ex( void ); -HD6309_INLINE void stf_ex( void ); -HD6309_INLINE void eorb_ex( void ); -HD6309_INLINE void eord_ex( void ); -HD6309_INLINE void adcb_ex( void ); -HD6309_INLINE void adcd_ex( void ); -HD6309_INLINE void orb_ex( void ); -HD6309_INLINE void ord_ex( void ); -HD6309_INLINE void addb_ex( void ); -HD6309_INLINE void ldd_ex( void ); -HD6309_INLINE void ldw_ex( void ); -HD6309_INLINE void std_ex( void ); -HD6309_INLINE void stw_ex( void ); -HD6309_INLINE void ldu_ex( void ); -HD6309_INLINE void lds_ex( void ); -HD6309_INLINE void stu_ex( void ); -HD6309_INLINE void sts_ex( void ); -HD6309_INLINE void pref10( void ); -HD6309_INLINE void pref11( void ); - -static const UINT8 flags8i[256]= /* increment */ -{ -CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -CC_N|CC_V,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N -}; -static const UINT8 flags8d[256]= /* decrement */ -{ -CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,CC_V, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N -}; - -static const UINT8 index_cycle_em[256] = { /* Index Loopup cycle counts, emulated 6809 */ -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ - -/* 0x0X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x1X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x2X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x3X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x4X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x5X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x6X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x7X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x8X */ 2, 3, 2, 3, 0, 1, 1, 1, 1, 4, 1, 4, 1, 5, 4, 0, -/* 0x9X */ 3, 6, 20, 6, 3, 4, 4, 4, 4, 7, 4, 7, 4, 8, 7, 5, -/* 0xAX */ 2, 3, 2, 3, 0, 1, 1, 1, 1, 4, 1, 4, 1, 5, 4, 5, -/* 0xBX */ 5, 6, 20, 6, 3, 4, 4, 4, 4, 7, 4, 7, 4, 8, 7, 20, -/* 0xCX */ 2, 3, 2, 3, 0, 1, 1, 1, 1, 4, 1, 4, 1, 5, 4, 3, -/* 0xDX */ 4, 6, 20, 6, 3, 4, 4, 4, 4, 7, 4, 7, 4, 8, 7, 20, -/* 0xEX */ 2, 3, 2, 3, 0, 1, 1, 1, 1, 4, 1, 4, 1, 5, 4, 3, -/* 0xFX */ 4, 6, 20, 6, 3, 4, 4, 4, 4, 7, 4, 7, 4, 8, 7, 20 -}; - -static const UINT8 index_cycle_na[256] = { /* Index Loopup cycle counts, -native 6309 */ -/* X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, XA, XB, XC, XD, XE, XF */ - -/* 0x0X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x1X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x2X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x3X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x4X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x5X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x6X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x7X */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* 0x8X */ 1, 2, 1, 2, 0, 1, 1, 1, 1, 3, 1, 2, 1, 3, 1, 0, -/* 0x9X */ 3, 5, 19, 5, 3, 4, 4, 4, 4, 7, 4, 5, 4, 6, 4, 5, -/* 0xAX */ 1, 2, 1, 2, 0, 1, 1, 1, 1, 3, 1, 2, 1, 3, 1, 2, -/* 0xBX */ 5, 5, 19, 5, 3, 4, 4, 4, 4, 7, 4, 5, 4, 6, 4, 19, -/* 0xCX */ 1, 2, 1, 2, 0, 1, 1, 1, 1, 3, 1, 2, 1, 3, 1, 1, -/* 0xDX */ 4, 5, 19, 5, 3, 4, 4, 4, 4, 7, 4, 5, 4, 6, 4, 19, -/* 0xEX */ 1, 2, 1, 2, 0, 1, 1, 1, 1, 3, 1, 2, 1, 3, 1, 1, -/* 0xFX */ 4, 5, 19, 5, 3, 4, 4, 4, 4, 7, 4, 5, 4, 6, 4, 19 -}; - -#define IIP0 19 /* Illegal instruction cycle count page 0 */ -#define IIP1 20 /* Illegal instruction cycle count page 01 & 11 */ - -static const UINT8 ccounts_page0_em[256] = /* Cycle Counts Page zero, Emulated 6809 */ -{ -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ -/* 0x0X */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, -/* 0x1X */ 0, 0, 2, 4, 4, IIP0, 5, 9, IIP0, 2, 3, IIP0, 3, 2, 8, 6, -/* 0x2X */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -/* 0x3X */ 4, 4, 4, 4, 5, 5, 5, 5, IIP0, 5, 3, 6, 20, 11, IIP0, 19, -/* 0x4X */ 2, IIP0, IIP0, 2, 2, IIP0, 2, 2, 2, 2, 2, IIP0, 2, 2, IIP0, 2, -/* 0x5X */ 2, IIP0, IIP0, 2, 2, IIP0, 2, 2, 2, 2, 2, IIP0, 2, 2, IIP0, 2, -/* 0x6X */ 6, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 3, 6, -/* 0x7X */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 7, 7, 4, 7, -/* 0x8X */ 2, 2, 2, 4, 2, 2, 2, IIP0, 2, 2, 2, 2, 4, 7, 3, IIP0, -/* 0x9X */ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 6, 7, 5, 5, -/* 0xAX */ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 6, 7, 5, 5, -/* 0xBX */ 5, 5, 5, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 8, 6, 6, -/* 0xCX */ 2, 2, 2, 4, 2, 2, 2, IIP0, 2, 2, 2, 2, 3, 5, 3, IIP0, -/* 0xDX */ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, -/* 0xEX */ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, -/* 0xFX */ 5, 5, 5, 7, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6 -}; - -static const UINT8 ccounts_page0_na[256] = /* Cycle Counts Page zero, Native 6309 */ -{ -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ -/* 0x0X */ 5, 6, 6, 5, 5, 6, 5, 5, 5, 5, 5, 6, 5, 4, 2, 5, -/* 0x1X */ 0, 0, 1, 4, 4, IIP0, 4, 7, IIP0, 1, 2, IIP0, 3, 1, 5, 4, -/* 0x2X */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -/* 0x3X */ 4, 4, 4, 4, 4, 4, 4, 4, IIP0, 4, 1, 6, 22, 10, IIP0, 21, -/* 0x4X */ 1, IIP0, IIP0, 1, 1, IIP0, 1, 1, 1, 1, 1, IIP0, 1, 1, IIP0, 1, -/* 0x5X */ 1, IIP0, IIP0, 1, 1, IIP0, 1, 1, 1, 1, 1, IIP0, 1, 1, IIP0, 1, -/* 0x6X */ 6, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 5, 3, 6, -/* 0x7X */ 6, 7, 7, 6, 6, 7, 6, 6, 6, 6, 6, 5, 6, 5, 3, 6, -/* 0x8X */ 2, 2, 2, 3, 2, 2, 2, IIP0, 2, 2, 2, 2, 3, 6, 3, IIP0, -/* 0x9X */ 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 6, 4, 4, -/* 0xAX */ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 5, 5, -/* 0xBX */ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 7, 5, 5, -/* 0xCX */ 2, 2, 2, 3, 2, 2, 2, IIP0, 2, 2, 2, 2, 3, 5, 3, IIP0, -/* 0xDX */ 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, -/* 0xEX */ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, -/* 0xFX */ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 -}; - -static const UINT8 ccounts_page01_em[256] = /* Cycle Counts Page 01, Emulated 6809 */ -{ -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ -/* 0x0X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x1X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x2X */ IIP1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -/* 0x3X */ 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, IIP1, IIP1, IIP1, 20, -/* 0x4X */ 2, IIP1,IIP1, 2, 2, IIP1, 2, 2, 2, 2, 2, IIP1, 2, 2, IIP1, 2, -/* 0x5X */ IIP1, IIP1, IIP1, 3, 3, IIP1, 3, IIP1, IIP1, 3, 3, IIP1, 3, 3, IIP1, 3, -/* 0x6X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x7X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x8X */ 5, 5, 5, 5, 5, 5, 4, IIP1, 5, 5, 5, 5, 5, IIP1, 4, IIP1, -/* 0x9X */ 7, 7, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 7, IIP1, 6, 6, -/* 0xAX */ 7, 7, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 7, IIP1, 6, 6, -/* 0xBX */ 8, 8, 8, 8, 8, 8, 7, 7, 8, 8, 8, 8, 8, IIP1, 7, 7, -/* 0xCX */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 4, IIP1, -/* 0xDX */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 8, 8, 6, 6, -/* 0xEX */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 8, 8, 6, 6, -/* 0xFX */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 9, 9, 7, 7 -}; - -static const UINT8 ccounts_page01_na[256] = /* Cycle Counts Page 01, Native 6309 */ -{ -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ -/* 0x0X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x1X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x2X */ IIP1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -/* 0x3X */ 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, IIP1, IIP1, IIP1, 22, -/* 0x4X */ 1, IIP1, IIP1, 1, 1, IIP1, 1, 1, 1, 1, 1, IIP1, 1, 1, IIP1, 1, -/* 0x5X */ IIP1, IIP1, IIP1, 2, 2, IIP1, 2, IIP1, IIP1, 2, 2, IIP1, 2, 2, IIP1, 1, -/* 0x6X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x7X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x8X */ 4, 4, 4, 4, 4, 4, 4, IIP1, 4, 4, 4, 4, 4, IIP1, 4, IIP1, -/* 0x9X */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, IIP1, 5, 5, -/* 0xAX */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, IIP1, 6, 6, -/* 0xBX */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, IIP1, 6, 6, -/* 0xCX */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 4, IIP1, -/* 0xDX */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 7, 7, 5, 5, -/* 0xEX */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 8, 8, 6, 6, -/* 0xFX */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 8, 8, 6, 6 -}; - -static const UINT8 ccounts_page11_em[256] = /* Cycle Counts Page 11, Emulated 6809 */ -{ -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ -/* 0x0X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x1X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x2X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x3X */ 7, 7, 7, 7, 7, 7, 7, 8, 3, 3, 3, 3, 4, 5, IIP1, 20, -/* 0x4X */ IIP1, IIP1, IIP1, 2, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 2, IIP1, 2, 2, IIP1, 2, -/* 0x5X */ IIP1, IIP1, IIP1, 2, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 2, IIP1, 2, 2, IIP1, 2, -/* 0x6X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x7X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x8X */ 3, 3, IIP1, 5, IIP1, IIP1, 3, IIP1, IIP1, IIP1, IIP1, 3, 5, 25, 34, 28, -/* 0x9X */ 5, 5, IIP1, 7, IIP1, IIP1, 5, 5, IIP1, IIP1, IIP1, 5, 7, 27, 36, 30, -/* 0xAX */ 5, 5, IIP1, 7, IIP1, IIP1, 5, 5, IIP1, IIP1, IIP1, 5, 7, 27, 36, 30, -/* 0xBX */ 6, 6, IIP1, 8, IIP1, IIP1, 6, 6, IIP1, IIP1, IIP1, 6, 8, 28, 37, 31, -/* 0xCX */ 3, 3, IIP1, IIP1, IIP1, IIP1, 3, IIP1, IIP1, IIP1, IIP1, 3, IIP1, IIP1, IIP1, IIP1, -/* 0xDX */ 5, 5, IIP1, IIP1, IIP1, IIP1, 5, 5, IIP1, IIP1, IIP1, 5, IIP1, IIP1, IIP1, IIP1, -/* 0xEX */ 5, 5, IIP1, IIP1, IIP1, IIP1, 5, 5, IIP1, IIP1, IIP1, 5, IIP1, IIP1, IIP1, IIP1, -/* 0xFX */ 6, 6, IIP1, IIP1, IIP1, IIP1, 6, 6, IIP1, IIP1, IIP1, 6, IIP1, IIP1, IIP1, IIP1 -}; - -static const UINT8 ccounts_page11_na[256] = /* Cycle Counts Page 11, Native 6309 */ -{ -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ -/* 0x0X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x1X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x2X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x3X */ 6, 6, 6, 6, 6, 6, 6, 7, 3, 3, 3, 3, 4, 5, IIP1, 22, -/* 0x4X */ IIP1, IIP1, IIP1, 2, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 2, IIP1, 2, 2, IIP1, 2, -/* 0x5X */ IIP1, IIP1, IIP1, 2, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, 2, IIP1, 2, 2, IIP1, 2, -/* 0x6X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x7X */ IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, -/* 0x8X */ 3, 3, IIP1, 4, IIP1, IIP1, 3, IIP1, IIP1, IIP1, IIP1, 3, 4, 25, 34, 28, -/* 0x9X */ 4, 4, IIP1, 5, IIP1, IIP1, 4, 4, IIP1, IIP1, IIP1, 4, 5, 26, 35, 29, -/* 0xAX */ 5, 5, IIP1, 6, IIP1, IIP1, 5, 5, IIP1, IIP1, IIP1, 5, 6, 27, 36, 30, -/* 0xBX */ 5, 5, IIP1, 6, IIP1, IIP1, 5, 5, IIP1, IIP1, IIP1, 5, 6, 27, 36, 30, -/* 0xCX */ 3, 3, IIP1, IIP1, IIP1, IIP1, 3, IIP1, IIP1, IIP1, IIP1, 3, IIP1, IIP1, IIP1, IIP1, -/* 0xDX */ 4, 4, IIP1, IIP1, IIP1, IIP1, 4, 4, IIP1, IIP1, IIP1, 4, IIP1, IIP1, IIP1, IIP1, -/* 0xEX */ 5, 5, IIP1, IIP1, IIP1, IIP1, 5, 5, IIP1, IIP1, IIP1, 5, IIP1, IIP1, IIP1, IIP1, -/* 0xFX */ 5, 5, IIP1, IIP1, IIP1, IIP1, 5, 5, IIP1, IIP1, IIP1, 5, IIP1, IIP1, IIP1, IIP1 -}; - -#ifndef BIG_SWITCH - -static void (*const hd6309_main[0x100])(void) = { -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, - 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ - -/* 0x0X */ neg_di, oim_di, aim_di, com_di, lsr_di, eim_di, ror_di, asr_di, - asl_di, rol_di, dec_di, tim_di, inc_di, tst_di, jmp_di, clr_di, - -/* 0x1X */ pref10, pref11, nop, sync, sexw, IIError, lbra, lbsr, - IIError, daa, orcc, IIError, andcc, sex, exg, tfr, - -/* 0x2X */ bra, brn, bhi, bls, bcc, bcs, bne, beq, - bvc, bvs, bpl, bmi, bge, blt, bgt, ble, - -/* 0x3X */ leax, leay, leas, leau, pshs, puls, pshu, pulu, - IIError, rts, abx, rti, cwai, mul, IIError, swi, - -/* 0x4X */ nega, IIError, IIError, coma, lsra, IIError, rora, asra, - asla, rola, deca, IIError, inca, tsta, IIError, clra, - -/* 0x5X */ negb, IIError, IIError, comb, lsrb, IIError, rorb, asrb, - aslb, rolb, decb, IIError, incb, tstb, IIError, clrb, - -/* 0x6X */ neg_ix, oim_ix, aim_ix, com_ix, lsr_ix, eim_ix, ror_ix, asr_ix, - asl_ix, rol_ix, dec_ix, tim_ix, inc_ix, tst_ix, jmp_ix, clr_ix, - -/* 0x7X */ neg_ex, oim_ex, aim_ex, com_ex, lsr_ex, eim_ex, ror_ex, asr_ex, - asl_ex, rol_ex, dec_ex, tim_ex, inc_ex, tst_ex, jmp_ex, clr_ex, - -/* 0x8X */ suba_im, cmpa_im, sbca_im, subd_im, anda_im, bita_im, lda_im, IIError, - eora_im, adca_im, ora_im, adda_im, cmpx_im, bsr, ldx_im, IIError, - -/* 0x9X */ suba_di, cmpa_di, sbca_di, subd_di, anda_di, bita_di, lda_di, sta_di, - eora_di, adca_di, ora_di, adda_di, cmpx_di, jsr_di, ldx_di, stx_di, - -/* 0xAX */ suba_ix, cmpa_ix, sbca_ix, subd_ix, anda_ix, bita_ix, lda_ix, sta_ix, - eora_ix, adca_ix, ora_ix, adda_ix, cmpx_ix, jsr_ix, ldx_ix, stx_ix, - -/* 0xBX */ suba_ex, cmpa_ex, sbca_ex, subd_ex, anda_ex, bita_ex, lda_ex, sta_ex, - eora_ex, adca_ex, ora_ex, adda_ex, cmpx_ex, jsr_ex, ldx_ex, stx_ex, - -/* 0xCX */ subb_im, cmpb_im, sbcb_im, addd_im, andb_im, bitb_im, ldb_im, IIError, - eorb_im, adcb_im, orb_im, addb_im, ldd_im, ldq_im, ldu_im, IIError, - -/* 0xDX */ subb_di, cmpb_di, sbcb_di, addd_di, andb_di, bitb_di, ldb_di, stb_di, - eorb_di, adcb_di, orb_di, addb_di, ldd_di, std_di, ldu_di, stu_di, - -/* 0xEX */ subb_ix, cmpb_ix, sbcb_ix, addd_ix, andb_ix, bitb_ix, ldb_ix, stb_ix, - eorb_ix, adcb_ix, orb_ix, addb_ix, ldd_ix, std_ix, ldu_ix, stu_ix, - -/* 0xFX */ subb_ex, cmpb_ex, sbcb_ex, addd_ex, andb_ex, bitb_ex, ldb_ex, stb_ex, - eorb_ex, adcb_ex, orb_ex, addb_ex, ldd_ex, std_ex, ldu_ex, stu_ex -}; - -static void (*const hd6309_page01[0x100])(void) = { -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, - 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ - -/* 0x0X */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - -/* 0x1X */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - -/* 0x2X */ IIError, lbrn, lbhi, lbls, lbcc, lbcs, lbne, lbeq, - lbvc, lbvs, lbpl, lbmi, lbge, lblt, lbgt, lble, - -/* 0x3X */ addr_r, adcr, subr, sbcr, andr, orr, eorr, cmpr, - pshsw, pulsw, pshuw, puluw, IIError, IIError, IIError, swi2, - -/* 0x4X */ negd, IIError, IIError, comd, lsrd, IIError, rord, asrd, - asld, rold, decd, IIError, incd, tstd, IIError, clrd, - -/* 0x5X */ IIError, IIError, IIError, comw, lsrw, IIError, rorw, IIError, - IIError, rolw, decw, IIError, incw, tstw, IIError, clrw, - -/* 0x6X */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - -/* 0x7X */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - -/* 0x8X */ subw_im, cmpw_im, sbcd_im, cmpd_im, andd_im, bitd_im, ldw_im, IIError, - eord_im, adcd_im, ord_im, addw_im, cmpy_im, IIError, ldy_im, IIError, - -/* 0x9X */ subw_di, cmpw_di, sbcd_di, cmpd_di, andd_di, bitd_di, ldw_di, stw_di, - eord_di, adcd_di, ord_di, addw_di, cmpy_di, IIError, ldy_di, sty_di, - -/* 0xAX */ subw_ix, cmpw_ix, sbcd_ix, cmpd_ix, andd_ix, bitd_ix, ldw_ix, stw_ix, - eord_ix, adcd_ix, ord_ix, addw_ix, cmpy_ix, IIError, ldy_ix, sty_ix, - -/* 0xBX */ subw_ex, cmpw_ex, sbcd_ex, cmpd_ex, andd_ex, bitd_ex, ldw_ex, stw_ex, - eord_ex, adcd_ex, ord_ex, addw_ex, cmpy_ex, IIError, ldy_ex, sty_ex, - -/* 0xCX */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, lds_im, IIError, - -/* 0xDX */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, ldq_di, stq_di, lds_di, sts_di, - -/* 0xEX */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, ldq_ix, stq_ix, lds_ix, sts_ix, - -/* 0xFX */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, ldq_ex, stq_ex, lds_ex, sts_ex -}; -static void (*const hd6309_page11[0x100])(void) = { -/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, - 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */ - -/* 0x0X */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - -/* 0x1X */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - -/* 0x2X */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - -/* 0x3X */ band, biand, bor, bior, beor, bieor, ldbt, stbt, - tfmpp, tfmmm, tfmpc, tfmcp, bitmd_im,ldmd_im, IIError, swi3, - -/* 0x4X */ IIError, IIError, IIError, come, IIError, IIError, IIError, IIError, - IIError, IIError, dece, IIError, ince, tste, IIError, clre, - -/* 0x5X */ IIError, IIError, IIError, comf, IIError, IIError, IIError, IIError, - IIError, IIError, decf, IIError, incf, tstf, IIError, clrf, - -/* 0x6X */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - -/* 0x7X */ IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError, - -/* 0x8X */ sube_im, cmpe_im, IIError, cmpu_im, IIError, IIError, lde_im, IIError, - IIError, IIError, IIError, adde_im, cmps_im, divd_im, divq_im, muld_im, - -/* 0x9X */ sube_di, cmpe_di, IIError, cmpu_di, IIError, IIError, lde_di, ste_di, - IIError, IIError, IIError, adde_di, cmps_di, divd_di, divq_di, muld_di, - -/* 0xAX */ sube_ix, cmpe_ix, IIError, cmpu_ix, IIError, IIError, lde_ix, ste_ix, - IIError, IIError, IIError, adde_ix, cmps_ix, divd_ix, divq_ix, muld_ix, - -/* 0xBX */ sube_ex, cmpe_ex, IIError, cmpu_ex, IIError, IIError, lde_ex, ste_ex, - IIError, IIError, IIError, adde_ex, cmps_ex, divd_ex, divq_ex, muld_ex, - -/* 0xCX */ subf_im, cmpf_im, IIError, IIError, IIError, IIError, ldf_im, IIError, - IIError, IIError, IIError, addf_im, IIError, IIError, IIError, IIError, - -/* 0xDX */ subf_di, cmpf_di, IIError, IIError, IIError, IIError, ldf_di, stf_di, - IIError, IIError, IIError, addf_di, IIError, IIError, IIError, IIError, - -/* 0xEX */ subf_ix, cmpf_ix, IIError, IIError, IIError, IIError, ldf_ix, stf_ix, - IIError, IIError, IIError, addf_ix, IIError, IIError, IIError, IIError, - -/* 0xFX */ subf_ex, cmpf_ex, IIError, IIError, IIError, IIError, ldf_ex, stf_ex, - IIError, IIError, IIError, addf_ex, IIError, IIError, IIError, IIError - -}; - -#endif /* BIG_SWITCH */ diff --git a/jan/src/cpu/hd6309/hd6309.cpp b/jan/src/cpu/hd6309/hd6309.cpp deleted file mode 100644 index 5c4150229..000000000 --- a/jan/src/cpu/hd6309/hd6309.cpp +++ /dev/null @@ -1,1333 +0,0 @@ -/*** hd6309: Portable 6309 emulator ****************************************** - - Copyright John Butler - Copyright Tim Lindner - - References: - - HD63B09EP Technical Refrence Guide, by Chet Simpson with addition - by Alan Dekok - 6809 Simulator V09, By L.C. Benschop, Eidnhoven The Netherlands. - - m6809: Portable 6809 emulator, DS (6809 code in MAME, derived from - the 6809 Simulator V09) - - 6809 Microcomputer Programming & Interfacing with Experiments" - by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits - arrays up to 65536 bytes must be supported - machine must be twos complement - - History: -070614 ZV: - Fixed N flag setting in DIV overflow - -991026 HJB: - Fixed missing calls to cpu_changepc() for the TFR and EXG ocpodes. - Replaced m6809_slapstic checks by a macro (CHANGE_PC). ESB still - needs the tweaks. - -991024 HJB: - Tried to improve speed: Using bit7 of cycles1/2 as flag for multi - byte opcodes is gone, those opcodes now call fetch_effective_address(). - Got rid of the slow/fast flags for stack (S and U) memory accesses. - Minor changes to use 32 bit values as arguments to memory functions - and added defines for that purpose (e.g. X = 16bit XD = 32bit). - -990312 HJB: - Added bugfixes according to Aaron's findings. - Reset only sets CC_II and CC_IF, DP to zero and PC from reset vector. -990311 HJB: - Added _info functions. Now uses static m6808_Regs struct instead - of single statics. Changed the 16 bit registers to use the generic - PAIR union. Registers defined using macros. Split the core into - four execution loops for M6802, M6803, M6808 and HD63701. - TST, TSTA and TSTB opcodes reset carry flag. - Modified the read/write stack handlers to push LSB first then MSB - and pull MSB first then LSB. - -990228 HJB: - Changed the interrupt handling again. Now interrupts are taken - either right at the moment the lines are asserted or whenever - an interrupt is enabled and the corresponding line is still - asserted. That way the pending_interrupts checks are not - needed anymore. However, the CWAI and SYNC flags still need - some flags, so I changed the name to 'int_state'. - This core also has the code for the old interrupt system removed. - -990225 HJB: - Cleaned up the code here and there, added some comments. - Slightly changed the SAR opcodes (similiar to other CPU cores). - Added symbolic names for the flag bits. - Changed the way CWAI/Interrupt() handle CPU state saving. - A new flag M6809_STATE in pending_interrupts is used to determine - if a state save is needed on interrupt entry or already done by CWAI. - Added M6809_IRQ_LINE and M6809_FIRQ_LINE defines to m6809.h - Moved the internal interrupt_pending flags from m6809.h to m6809.c - Changed CWAI cycles2[0x3c] to be 2 (plus all or at least 19 if - CWAI actually pushes the entire state). - Implemented undocumented TFR/EXG for undefined source and mixed 8/16 - bit transfers (they should transfer/exchange the constant $ff). - Removed unused jmp/jsr _slap functions from 6809ops.c, - m6809_slapstick check moved into the opcode functions. - -000809 TJL: - Started converting m6809 into hd6309 - -001217 TJL: - Finished: - All opcodes - Dual Timing - To Do: - Verify new DIV opcodes. - -070805 TJL: - Fixed ADDR and ADCR opcodes not to clear the H condition code. Fixed ANDR, - EORR, ORR, ADDR, ADCR, SBCR, and SUBR to evaluate condition codes after - the destination register was set. Fixed BITMD opcode to only effect the Z - condition code. Fixed BITMD opcode to clear only tested flags. Fixed EXG - and TFR register promotion and demotion. Fixed illegal instruction handler - to not set I and F condition codes. Credit to Darren Atkinson for the - discovery of these bugs. - -090907 TJL: - The SEXW instruction is clearing the Overflow flag (V). It should not do - that. When an invalid source or destination register is specified for - the TFM instructions, real hardware invokes the Illegal Instruction - trap, whereas the emulator simply ignores the instruction. Credit to - Darren Atkinson for the discovery of these bugs. - -*****************************************************************************/ - -//#include "debugger.h" -//#include "deprecat.h" -#include "burnint.h" -#include "hd6309.h" - -#define VERBOSE 0 - -#define LOG(x) do { if (VERBOSE) logerror x; } while (0) - -#ifndef true -#define true 1 -#endif - -#ifndef false -#define false 0 -#endif - -#define HD6309_INLINE static -#define change_pc(newpc) hd6309.pc.w.l = (newpc) -#define HD6309_CLEAR_LINE 0 - -//extern offs_t hd6309_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - -/*#define BIG_SWITCH*/ - -static void CHECK_IRQ_LINES( void ); -static void IIError(void); -static void DZError(void); - -HD6309_INLINE void fetch_effective_address( void ); - -/* flag bits in the cc register */ -#define CC_C 0x01 /* Carry */ -#define CC_V 0x02 /* Overflow */ -#define CC_Z 0x04 /* Zero */ -#define CC_N 0x08 /* Negative */ -#define CC_II 0x10 /* Inhibit IRQ */ -#define CC_H 0x20 /* Half (auxiliary) carry */ -#define CC_IF 0x40 /* Inhibit FIRQ */ -#define CC_E 0x80 /* entire state pushed */ - -/* flag bits in the md register */ -#define MD_EM 0x01 /* Execution mode */ -#define MD_FM 0x02 /* FIRQ mode */ -#define MD_II 0x40 /* Illegal instruction */ -#define MD_DZ 0x80 /* Division by zero */ - -/* 6309 registers */ -static hd6309_Regs hd6309; -//static int hd6309_slapstic = 0; - -#define pPPC hd6309.ppc -#define pPC hd6309.pc -#define pU hd6309.u -#define pS hd6309.s -#define pX hd6309.x -#define pY hd6309.y -#define pV hd6309.v -/*#define pQ hd6309.q*/ -#define pD hd6309.d -#define pW hd6309.w -#define pZ hd6309.z - -#define PPC hd6309.ppc.w.l -#define PC hd6309.pc.w.l -#define PCD hd6309.pc.d -#define U hd6309.u.w.l -#define UD hd6309.u.d -#define S hd6309.s.w.l -#define SD hd6309.s.d -#define X hd6309.x.w.l -#define XD hd6309.x.d -#define Y hd6309.y.w.l -#define YD hd6309.y.d -#define V hd6309.v.w.l -#define VD hd6309.v.d -#define D hd6309.d.w.l -#define A hd6309.d.b.h -#define B hd6309.d.b.l -#define W hd6309.w.w.l -#define E hd6309.w.b.h -#define F hd6309.w.b.l -#define DP hd6309.dp.b.h -#define DPD hd6309.dp.d -#define CC hd6309.cc -#define MD hd6309.md - -static PAIR ea; /* effective address */ -#define EA ea.w.l -#define EAD ea.d - -#define CHANGE_PC change_pc(PCD) -#if 0 -#define CHANGE_PC { \ - if( hd6309_slapstic ) \ - cpu_setOPbase16(PCD); \ - else \ - change_pc(PCD); \ - } -#endif - -#define HD6309_CWAI 8 /* set when CWAI is waiting for an interrupt */ -#define HD6309_SYNC 16 /* set when SYNC is waiting for an interrupt */ -#define HD6309_LDS 32 /* set when LDS occured at least once */ - -/* public globals */ -static int hd6309_ICount; - -/* these are re-defined in hd6309.h TO RAM, ROM or functions in cpuintrf.c */ -#define RM(mAddr) HD6309_RDMEM(mAddr) -#define WM(mAddr,Value) HD6309_WRMEM(mAddr,Value) -#define ROP(mAddr) HD6309_RDOP(mAddr) -#define ROP_ARG(mAddr) HD6309_RDOP_ARG(mAddr) - -/* macros to access memory */ -#define IMMBYTE(b) b = ROP_ARG(PCD); PC++ -#define IMMWORD(w) w.d = (ROP_ARG(PCD)<<8) | ROP_ARG((PCD+1)&0xffff); PC+=2 -#define IMMLONG(w) w.d = (ROP_ARG(PCD)<<24) + (ROP_ARG(PCD+1)<<16) + (ROP_ARG(PCD+2)<<8) + (ROP_ARG(PCD+3)); PC+=4 - -#define PUSHBYTE(b) --S; WM(SD,b) -#define PUSHWORD(w) --S; WM(SD,w.b.l); --S; WM(SD,w.b.h) -#define PULLBYTE(b) b = RM(SD); S++ -#define PULLWORD(w) w = RM(SD)<<8; S++; w |= RM(SD); S++ - -#define PSHUBYTE(b) --U; WM(UD,b); -#define PSHUWORD(w) --U; WM(UD,w.b.l); --U; WM(UD,w.b.h) -#define PULUBYTE(b) b = RM(UD); U++ -#define PULUWORD(w) w = RM(UD)<<8; U++; w |= RM(UD); U++ - -#define CLR_HNZVC CC&=~(CC_H|CC_N|CC_Z|CC_V|CC_C) -#define CLR_NZV CC&=~(CC_N|CC_Z|CC_V) -#define CLR_NZ CC&=~(CC_N|CC_Z) -#define CLR_HNZC CC&=~(CC_H|CC_N|CC_Z|CC_C) -#define CLR_NZVC CC&=~(CC_N|CC_Z|CC_V|CC_C) -#define CLR_Z CC&=~(CC_Z) -#define CLR_N CC&=~(CC_N) -#define CLR_NZC CC&=~(CC_N|CC_Z|CC_C) -#define CLR_ZC CC&=~(CC_Z|CC_C) - -/* macros for CC -- CC bits affected should be reset before calling */ -#define SET_Z(a) if(!a)SEZ -#define SET_Z8(a) SET_Z((UINT8)a) -#define SET_Z16(a) SET_Z((UINT16)a) -#define SET_N8(a) CC|=((a&0x80)>>4) -#define SET_N16(a) CC|=((a&0x8000)>>12) -#define SET_N32(a) CC|=((a&0x8000)>>20) -#define SET_H(a,b,r) CC|=(((a^b^r)&0x10)<<1) -#define SET_C8(a) CC|=((a&0x100)>>8) -#define SET_C16(a) CC|=((a&0x10000)>>16) -#define SET_V8(a,b,r) CC|=(((a^b^r^(r>>1))&0x80)>>6) -#define SET_V16(a,b,r) CC|=(((a^b^r^(r>>1))&0x8000)>>14) - -#define SET_FLAGS8I(a) {CC|=flags8i[(a)&0xff];} -#define SET_FLAGS8D(a) {CC|=flags8d[(a)&0xff];} - -static UINT8 const *cycle_counts_page0; -static UINT8 const *cycle_counts_page01; -static UINT8 const *cycle_counts_page11; -static UINT8 const *index_cycle; - -/* combos */ -#define SET_NZ8(a) {SET_N8(a);SET_Z(a);} -#define SET_NZ16(a) {SET_N16(a);SET_Z(a);} -#define SET_FLAGS8(a,b,r) {SET_N8(r);SET_Z8(r);SET_V8(a,b,r);SET_C8(r);} -#define SET_FLAGS16(a,b,r) {SET_N16(r);SET_Z16(r);SET_V16(a,b,r);SET_C16(r);} - -#define NXORV ((CC&CC_N)^((CC&CC_V)<<2)) - -/* for treating an unsigned byte as a signed word */ -#define SIGNED(b) ((UINT16)(b&0x80?b|0xff00:b)) -/* for treating an unsigned short as a signed long */ -#define SIGNED_16(b) ((UINT32)(b&0x8000?b|0xffff0000:b)) - -/* macros for addressing modes (postbytes have their own code) */ -#define DIRECT EAD = DPD; IMMBYTE(ea.b.l) -#define IMM8 EAD = PCD; PC++ -#define IMM16 EAD = PCD; PC+=2 -#define EXTENDED IMMWORD(ea) - -/* macros to set status flags */ -#if defined(SEC) -#undef SEC -#endif -#define SEC CC|=CC_C -#define CLC CC&=~CC_C -#define SEZ CC|=CC_Z -#define CLZ CC&=~CC_Z -#define SEN CC|=CC_N -#define CLN CC&=~CC_N -#define SEV CC|=CC_V -#define CLV CC&=~CC_V -#define SEH CC|=CC_H -#define CLH CC&=~CC_H - -/* Macros to set mode flags */ -#define SEDZ MD|=MD_DZ -#define CLDZ MD&=~MD_DZ -#define SEII MD|=MD_II -#define CLII MD&=~MD_II -#define SEFM MD|=MD_FM -#define CLFM MD&=~MD_FM -#define SEEM MD|=MD_EM -#define CLEM MD&=~MD_EM - -/* macros for convenience */ -#define DIRBYTE(b) {DIRECT;b=RM(EAD);} -#define DIRWORD(w) {DIRECT;w.d=RM16(EAD);} -#define DIRLONG(lng) {DIRECT;lng.w.h=RM16(EAD);lng.w.l=RM16(EAD+2);} -#define EXTBYTE(b) {EXTENDED;b=RM(EAD);} -#define EXTWORD(w) {EXTENDED;w.d=RM16(EAD);} -#define EXTLONG(lng) {EXTENDED;lng.w.h=RM16(EAD);lng.w.l=RM16(EAD+2);} - -/* includes the static function prototypes and other tables */ -#include "6309tbl.c" - -/* macros for branch instructions */ -#define BRANCH(f) { \ - UINT8 t; \ - IMMBYTE(t); \ - if( f ) \ - { \ - PC += SIGNED(t); \ - CHANGE_PC; \ - } \ -} - -#define LBRANCH(f) { \ - PAIR t; \ - IMMWORD(t); \ - if( f ) \ - { \ - if( !(MD & MD_EM) ) \ - hd6309_ICount -= 1; \ - PC += t.w.l; \ - CHANGE_PC; \ - } \ -} - -HD6309_INLINE UINT32 RM16( UINT32 mAddr ); -HD6309_INLINE UINT32 RM16( UINT32 mAddr ) -{ - UINT32 result = RM(mAddr) << 8; - return result | RM((mAddr+1)&0xffff); -} - -HD6309_INLINE UINT32 RM32( UINT32 mAddr ); -HD6309_INLINE UINT32 RM32( UINT32 mAddr ) -{ - UINT32 result = RM(mAddr) << 24; - result += RM(mAddr+1) << 16; - result += RM(mAddr+2) << 8; - result += RM(mAddr+3); - return result; -} - -HD6309_INLINE void WM16( UINT32 mAddr, PAIR *p ); -HD6309_INLINE void WM16( UINT32 mAddr, PAIR *p ) -{ - WM( mAddr, p->b.h ); - WM( (mAddr+1)&0xffff, p->b.l ); -} - -HD6309_INLINE void WM32( UINT32 mAddr, PAIR *p ); -HD6309_INLINE void WM32( UINT32 mAddr, PAIR *p ) -{ - WM( mAddr, p->b.h3 ); - WM( (mAddr+1)&0xffff, p->b.h2 ); - WM( (mAddr+2)&0xffff, p->b.h ); - WM( (mAddr+3)&0xffff, p->b.l ); -} - -static void UpdateState(void) -{ - if ( hd6309.md & MD_EM ) - { - cycle_counts_page0 = ccounts_page0_na; - cycle_counts_page01 = ccounts_page01_na; - cycle_counts_page11 = ccounts_page11_na; - index_cycle = index_cycle_na; - } - else - { - cycle_counts_page0 = ccounts_page0_em; - cycle_counts_page01 = ccounts_page01_em; - cycle_counts_page11 = ccounts_page11_em; - index_cycle = index_cycle_em; - } -} - -static void CHECK_IRQ_LINES( void ) -{ - if( hd6309.irq_state[HD6309_IRQ_LINE] != HD6309_CLEAR_LINE || - hd6309.irq_state[HD6309_FIRQ_LINE] != HD6309_CLEAR_LINE ) - hd6309.int_state &= ~HD6309_SYNC; /* clear SYNC flag */ - if( hd6309.irq_state[HD6309_FIRQ_LINE]!=HD6309_CLEAR_LINE && !(CC & CC_IF)) - { - /* fast IRQ */ - /* HJB 990225: state already saved by CWAI? */ - if( hd6309.int_state & HD6309_CWAI ) - { - hd6309.int_state &= ~HD6309_CWAI; - hd6309.extra_cycles += 7; /* subtract +7 cycles */ - } - else - { - if ( MD & MD_FM ) - { - CC |= CC_E; /* save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - if ( MD & MD_EM ) - { - PUSHBYTE(F); - PUSHBYTE(E); - hd6309.extra_cycles += 2; /* subtract +2 cycles */ - } - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - hd6309.extra_cycles += 19; /* subtract +19 cycles */ - } - else - { - CC &= ~CC_E; /* save 'short' state */ - PUSHWORD(pPC); - PUSHBYTE(CC); - hd6309.extra_cycles += 10; /* subtract +10 cycles */ - } - } - CC |= CC_IF | CC_II; /* inhibit FIRQ and IRQ */ - PCD=RM16(0xfff6); - CHANGE_PC; -// (void)(*hd6309.irq_callback)(HD6309_FIRQ_LINE); - } - else - if( hd6309.irq_state[HD6309_IRQ_LINE]!=HD6309_CLEAR_LINE && !(CC & CC_II) ) - { - /* standard IRQ */ - /* HJB 990225: state already saved by CWAI? */ - if( hd6309.int_state & HD6309_CWAI ) - { - hd6309.int_state &= ~HD6309_CWAI; /* clear CWAI flag */ - hd6309.extra_cycles += 7; /* subtract +7 cycles */ - } - else - { - CC |= CC_E; /* save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - if ( MD & MD_EM ) - { - PUSHBYTE(F); - PUSHBYTE(E); - hd6309.extra_cycles += 2; /* subtract +2 cycles */ - } - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - hd6309.extra_cycles += 19; /* subtract +19 cycles */ - } - CC |= CC_II; /* inhibit IRQ */ - PCD=RM16(0xfff8); - CHANGE_PC; -// (void)(*hd6309.irq_callback)(HD6309_IRQ_LINE); - } -} - -/**************************************************************************** - * Get all registers in given buffer - ****************************************************************************/ -void hd6309_get_context(void *dst) -{ - if( dst ) - *(hd6309_Regs*)dst = hd6309; -} - -/**************************************************************************** - * Set all registers to given values - ****************************************************************************/ -void hd6309_set_context(void *src) -{ - if( src ) - hd6309 = *(hd6309_Regs*)src; - CHANGE_PC; - - CHECK_IRQ_LINES(); - UpdateState(); -} - -//static STATE_POSTLOAD( hd6309_postload ) -//{ -// UpdateState(); -//} - -void hd6309_init() -{ -// hd6309.irq_callback = irqcallback; - -// state_save_register_item("hd6309", index, PC); -// state_save_register_item("hd6309", index, U); -// state_save_register_item("hd6309", index, S); -// state_save_register_item("hd6309", index, X); -// state_save_register_item("hd6309", index, Y); -// state_save_register_item("hd6309", index, V); -// state_save_register_item("hd6309", index, DP); -// state_save_register_item("hd6309", index, CC); -// state_save_register_item("hd6309", index, MD); -// state_save_register_postload(Machine, hd6309_postload, NULL); -// state_save_register_item("hd6309", index, hd6309.int_state); -// state_save_register_item("hd6309", index, hd6309.nmi_state); -// state_save_register_item("hd6309", index, hd6309.irq_state[0]); -// state_save_register_item("hd6309", index, hd6309.irq_state[1]); -} - -/****************************************************************************/ -/* Reset registers to their initial values */ -/****************************************************************************/ -void hd6309_reset(void) -{ - hd6309.int_state = 0; - hd6309.nmi_state = HD6309_CLEAR_LINE; - hd6309.irq_state[0] = HD6309_CLEAR_LINE; - hd6309.irq_state[0] = HD6309_CLEAR_LINE; - - DPD = 0; /* Reset direct page register */ - - MD = 0; /* Mode register gets reset */ - CC |= CC_II; /* IRQ disabled */ - CC |= CC_IF; /* FIRQ disabled */ - - PCD = RM16(0xfffe); - CHANGE_PC; - UpdateState(); -} - -int hd6309_get_pc() -{ - return PC; -} - -/* -static void hd6309_exit(void) -{ - -}*/ - -/* Generate interrupts */ -/**************************************************************************** - * Set IRQ line state - ****************************************************************************/ -void hd6309_set_irq_line(int irqline, int state) -{ - if (irqline == HD6309_INPUT_LINE_NMI) - { - if (hd6309.nmi_state == state) return; - hd6309.nmi_state = state; -// LOG(("HD6309#%d set_irq_line (NMI) %d (PC=%4.4X)\n", cpu_getactivecpu(), state, pPC.d)); - if( state == HD6309_CLEAR_LINE ) return; - - /* if the stack was not yet initialized */ - if( !(hd6309.int_state & HD6309_LDS) ) return; - - hd6309.int_state &= ~HD6309_SYNC; - /* HJB 990225: state already saved by CWAI? */ - if( hd6309.int_state & HD6309_CWAI ) - { - hd6309.int_state &= ~HD6309_CWAI; - hd6309.extra_cycles += 7; /* subtract +7 cycles next time */ - } - else - { - CC |= CC_E; /* save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - if ( MD & MD_EM ) - { - PUSHBYTE(F); - PUSHBYTE(E); - hd6309.extra_cycles += 2; /* subtract +2 cycles */ - } - - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - hd6309.extra_cycles += 19; /* subtract +19 cycles next time */ - } - CC |= CC_IF | CC_II; /* inhibit FIRQ and IRQ */ - PCD = RM16(0xfffc); - CHANGE_PC; - } - else if (irqline < 2) - { -// LOG(("HD6309#%d set_irq_line %d, %d (PC=%4.4X)\n", cpu_getactivecpu(), irqline, state, pPC.d)); - hd6309.irq_state[irqline] = state; - if (state == HD6309_CLEAR_LINE) return; - CHECK_IRQ_LINES(); - } -} - -/* includes the actual opcode implementations */ -#include "6309ops.c" - -/* execute instructions on this CPU until icount expires */ -int hd6309_execute(int cycles) /* NS 970908 */ -{ - hd6309_ICount = cycles - hd6309.extra_cycles; - hd6309.extra_cycles = 0; - - if (hd6309.int_state & (HD6309_CWAI | HD6309_SYNC)) - { -// debugger_instruction_hook(Machine, PCD); - hd6309_ICount = 0; - } - else - { - do - { - pPPC = pPC; - -// debugger_instruction_hook(Machine, PCD); - - hd6309.ireg = ROP(PCD); - PC++; - -#ifdef BIG_SWITCH - switch( hd6309.ireg ) - { - case 0x00: neg_di(); break; - case 0x01: oim_di(); break; - case 0x02: aim_di(); break; - case 0x03: com_di(); break; - case 0x04: lsr_di(); break; - case 0x05: eim_di(); break; - case 0x06: ror_di(); break; - case 0x07: asr_di(); break; - case 0x08: asl_di(); break; - case 0x09: rol_di(); break; - case 0x0a: dec_di(); break; - case 0x0b: tim_di(); break; - case 0x0c: inc_di(); break; - case 0x0d: tst_di(); break; - case 0x0e: jmp_di(); break; - case 0x0f: clr_di(); break; - case 0x10: pref10(); break; - case 0x11: pref11(); break; - case 0x12: nop(); break; - case 0x13: sync(); break; - case 0x14: sexw(); break; - case 0x15: IIError(); break; - case 0x16: lbra(); break; - case 0x17: lbsr(); break; - case 0x18: IIError(); break; - case 0x19: daa(); break; - case 0x1a: orcc(); break; - case 0x1b: IIError(); break; - case 0x1c: andcc(); break; - case 0x1d: sex(); break; - case 0x1e: exg(); break; - case 0x1f: tfr(); break; - case 0x20: bra(); break; - case 0x21: brn(); break; - case 0x22: bhi(); break; - case 0x23: bls(); break; - case 0x24: bcc(); break; - case 0x25: bcs(); break; - case 0x26: bne(); break; - case 0x27: beq(); break; - case 0x28: bvc(); break; - case 0x29: bvs(); break; - case 0x2a: bpl(); break; - case 0x2b: bmi(); break; - case 0x2c: bge(); break; - case 0x2d: blt(); break; - case 0x2e: bgt(); break; - case 0x2f: ble(); break; - case 0x30: leax(); break; - case 0x31: leay(); break; - case 0x32: leas(); break; - case 0x33: leau(); break; - case 0x34: pshs(); break; - case 0x35: puls(); break; - case 0x36: pshu(); break; - case 0x37: pulu(); break; - case 0x38: IIError(); break; - case 0x39: rts(); break; - case 0x3a: abx(); break; - case 0x3b: rti(); break; - case 0x3c: cwai(); break; - case 0x3d: mul(); break; - case 0x3e: IIError(); break; - case 0x3f: swi(); break; - case 0x40: nega(); break; - case 0x41: IIError(); break; - case 0x42: IIError(); break; - case 0x43: coma(); break; - case 0x44: lsra(); break; - case 0x45: IIError(); break; - case 0x46: rora(); break; - case 0x47: asra(); break; - case 0x48: asla(); break; - case 0x49: rola(); break; - case 0x4a: deca(); break; - case 0x4b: IIError(); break; - case 0x4c: inca(); break; - case 0x4d: tsta(); break; - case 0x4e: IIError(); break; - case 0x4f: clra(); break; - case 0x50: negb(); break; - case 0x51: IIError(); break; - case 0x52: IIError(); break; - case 0x53: comb(); break; - case 0x54: lsrb(); break; - case 0x55: IIError(); break; - case 0x56: rorb(); break; - case 0x57: asrb(); break; - case 0x58: aslb(); break; - case 0x59: rolb(); break; - case 0x5a: decb(); break; - case 0x5b: IIError(); break; - case 0x5c: incb(); break; - case 0x5d: tstb(); break; - case 0x5e: IIError(); break; - case 0x5f: clrb(); break; - case 0x60: neg_ix(); break; - case 0x61: oim_ix(); break; - case 0x62: aim_ix(); break; - case 0x63: com_ix(); break; - case 0x64: lsr_ix(); break; - case 0x65: eim_ix(); break; - case 0x66: ror_ix(); break; - case 0x67: asr_ix(); break; - case 0x68: asl_ix(); break; - case 0x69: rol_ix(); break; - case 0x6a: dec_ix(); break; - case 0x6b: tim_ix(); break; - case 0x6c: inc_ix(); break; - case 0x6d: tst_ix(); break; - case 0x6e: jmp_ix(); break; - case 0x6f: clr_ix(); break; - case 0x70: neg_ex(); break; - case 0x71: oim_ex(); break; - case 0x72: aim_ex(); break; - case 0x73: com_ex(); break; - case 0x74: lsr_ex(); break; - case 0x75: eim_ex(); break; - case 0x76: ror_ex(); break; - case 0x77: asr_ex(); break; - case 0x78: asl_ex(); break; - case 0x79: rol_ex(); break; - case 0x7a: dec_ex(); break; - case 0x7b: tim_ex(); break; - case 0x7c: inc_ex(); break; - case 0x7d: tst_ex(); break; - case 0x7e: jmp_ex(); break; - case 0x7f: clr_ex(); break; - case 0x80: suba_im(); break; - case 0x81: cmpa_im(); break; - case 0x82: sbca_im(); break; - case 0x83: subd_im(); break; - case 0x84: anda_im(); break; - case 0x85: bita_im(); break; - case 0x86: lda_im(); break; - case 0x87: IIError(); break; - case 0x88: eora_im(); break; - case 0x89: adca_im(); break; - case 0x8a: ora_im(); break; - case 0x8b: adda_im(); break; - case 0x8c: cmpx_im(); break; - case 0x8d: bsr(); break; - case 0x8e: ldx_im(); break; - case 0x8f: IIError(); break; - case 0x90: suba_di(); break; - case 0x91: cmpa_di(); break; - case 0x92: sbca_di(); break; - case 0x93: subd_di(); break; - case 0x94: anda_di(); break; - case 0x95: bita_di(); break; - case 0x96: lda_di(); break; - case 0x97: sta_di(); break; - case 0x98: eora_di(); break; - case 0x99: adca_di(); break; - case 0x9a: ora_di(); break; - case 0x9b: adda_di(); break; - case 0x9c: cmpx_di(); break; - case 0x9d: jsr_di(); break; - case 0x9e: ldx_di(); break; - case 0x9f: stx_di(); break; - case 0xa0: suba_ix(); break; - case 0xa1: cmpa_ix(); break; - case 0xa2: sbca_ix(); break; - case 0xa3: subd_ix(); break; - case 0xa4: anda_ix(); break; - case 0xa5: bita_ix(); break; - case 0xa6: lda_ix(); break; - case 0xa7: sta_ix(); break; - case 0xa8: eora_ix(); break; - case 0xa9: adca_ix(); break; - case 0xaa: ora_ix(); break; - case 0xab: adda_ix(); break; - case 0xac: cmpx_ix(); break; - case 0xad: jsr_ix(); break; - case 0xae: ldx_ix(); break; - case 0xaf: stx_ix(); break; - case 0xb0: suba_ex(); break; - case 0xb1: cmpa_ex(); break; - case 0xb2: sbca_ex(); break; - case 0xb3: subd_ex(); break; - case 0xb4: anda_ex(); break; - case 0xb5: bita_ex(); break; - case 0xb6: lda_ex(); break; - case 0xb7: sta_ex(); break; - case 0xb8: eora_ex(); break; - case 0xb9: adca_ex(); break; - case 0xba: ora_ex(); break; - case 0xbb: adda_ex(); break; - case 0xbc: cmpx_ex(); break; - case 0xbd: jsr_ex(); break; - case 0xbe: ldx_ex(); break; - case 0xbf: stx_ex(); break; - case 0xc0: subb_im(); break; - case 0xc1: cmpb_im(); break; - case 0xc2: sbcb_im(); break; - case 0xc3: addd_im(); break; - case 0xc4: andb_im(); break; - case 0xc5: bitb_im(); break; - case 0xc6: ldb_im(); break; - case 0xc7: IIError(); break; - case 0xc8: eorb_im(); break; - case 0xc9: adcb_im(); break; - case 0xca: orb_im(); break; - case 0xcb: addb_im(); break; - case 0xcc: ldd_im(); break; - case 0xcd: ldq_im(); break; /* in m6809 was std_im */ - case 0xce: ldu_im(); break; - case 0xcf: IIError(); break; - case 0xd0: subb_di(); break; - case 0xd1: cmpb_di(); break; - case 0xd2: sbcb_di(); break; - case 0xd3: addd_di(); break; - case 0xd4: andb_di(); break; - case 0xd5: bitb_di(); break; - case 0xd6: ldb_di(); break; - case 0xd7: stb_di(); break; - case 0xd8: eorb_di(); break; - case 0xd9: adcb_di(); break; - case 0xda: orb_di(); break; - case 0xdb: addb_di(); break; - case 0xdc: ldd_di(); break; - case 0xdd: std_di(); break; - case 0xde: ldu_di(); break; - case 0xdf: stu_di(); break; - case 0xe0: subb_ix(); break; - case 0xe1: cmpb_ix(); break; - case 0xe2: sbcb_ix(); break; - case 0xe3: addd_ix(); break; - case 0xe4: andb_ix(); break; - case 0xe5: bitb_ix(); break; - case 0xe6: ldb_ix(); break; - case 0xe7: stb_ix(); break; - case 0xe8: eorb_ix(); break; - case 0xe9: adcb_ix(); break; - case 0xea: orb_ix(); break; - case 0xeb: addb_ix(); break; - case 0xec: ldd_ix(); break; - case 0xed: std_ix(); break; - case 0xee: ldu_ix(); break; - case 0xef: stu_ix(); break; - case 0xf0: subb_ex(); break; - case 0xf1: cmpb_ex(); break; - case 0xf2: sbcb_ex(); break; - case 0xf3: addd_ex(); break; - case 0xf4: andb_ex(); break; - case 0xf5: bitb_ex(); break; - case 0xf6: ldb_ex(); break; - case 0xf7: stb_ex(); break; - case 0xf8: eorb_ex(); break; - case 0xf9: adcb_ex(); break; - case 0xfa: orb_ex(); break; - case 0xfb: addb_ex(); break; - case 0xfc: ldd_ex(); break; - case 0xfd: std_ex(); break; - case 0xfe: ldu_ex(); break; - case 0xff: stu_ex(); break; - } -#else - (*hd6309_main[hd6309.ireg])(); -#endif /* BIG_SWITCH */ - - hd6309_ICount -= cycle_counts_page0[hd6309.ireg]; - - } while( hd6309_ICount > 0 ); - - hd6309_ICount -= hd6309.extra_cycles; - hd6309.extra_cycles = 0; - } - - return cycles - hd6309_ICount; /* NS 970908 */ -} - -HD6309_INLINE void fetch_effective_address( void ) -{ - UINT8 postbyte = ROP_ARG(PCD); - PC++; - - switch(postbyte) - { - case 0x00: EA=X; break; - case 0x01: EA=X+1; break; - case 0x02: EA=X+2; break; - case 0x03: EA=X+3; break; - case 0x04: EA=X+4; break; - case 0x05: EA=X+5; break; - case 0x06: EA=X+6; break; - case 0x07: EA=X+7; break; - case 0x08: EA=X+8; break; - case 0x09: EA=X+9; break; - case 0x0a: EA=X+10; break; - case 0x0b: EA=X+11; break; - case 0x0c: EA=X+12; break; - case 0x0d: EA=X+13; break; - case 0x0e: EA=X+14; break; - case 0x0f: EA=X+15; break; - - case 0x10: EA=X-16; break; - case 0x11: EA=X-15; break; - case 0x12: EA=X-14; break; - case 0x13: EA=X-13; break; - case 0x14: EA=X-12; break; - case 0x15: EA=X-11; break; - case 0x16: EA=X-10; break; - case 0x17: EA=X-9; break; - case 0x18: EA=X-8; break; - case 0x19: EA=X-7; break; - case 0x1a: EA=X-6; break; - case 0x1b: EA=X-5; break; - case 0x1c: EA=X-4; break; - case 0x1d: EA=X-3; break; - case 0x1e: EA=X-2; break; - case 0x1f: EA=X-1; break; - - case 0x20: EA=Y; break; - case 0x21: EA=Y+1; break; - case 0x22: EA=Y+2; break; - case 0x23: EA=Y+3; break; - case 0x24: EA=Y+4; break; - case 0x25: EA=Y+5; break; - case 0x26: EA=Y+6; break; - case 0x27: EA=Y+7; break; - case 0x28: EA=Y+8; break; - case 0x29: EA=Y+9; break; - case 0x2a: EA=Y+10; break; - case 0x2b: EA=Y+11; break; - case 0x2c: EA=Y+12; break; - case 0x2d: EA=Y+13; break; - case 0x2e: EA=Y+14; break; - case 0x2f: EA=Y+15; break; - - case 0x30: EA=Y-16; break; - case 0x31: EA=Y-15; break; - case 0x32: EA=Y-14; break; - case 0x33: EA=Y-13; break; - case 0x34: EA=Y-12; break; - case 0x35: EA=Y-11; break; - case 0x36: EA=Y-10; break; - case 0x37: EA=Y-9; break; - case 0x38: EA=Y-8; break; - case 0x39: EA=Y-7; break; - case 0x3a: EA=Y-6; break; - case 0x3b: EA=Y-5; break; - case 0x3c: EA=Y-4; break; - case 0x3d: EA=Y-3; break; - case 0x3e: EA=Y-2; break; - case 0x3f: EA=Y-1; break; - - case 0x40: EA=U; break; - case 0x41: EA=U+1; break; - case 0x42: EA=U+2; break; - case 0x43: EA=U+3; break; - case 0x44: EA=U+4; break; - case 0x45: EA=U+5; break; - case 0x46: EA=U+6; break; - case 0x47: EA=U+7; break; - case 0x48: EA=U+8; break; - case 0x49: EA=U+9; break; - case 0x4a: EA=U+10; break; - case 0x4b: EA=U+11; break; - case 0x4c: EA=U+12; break; - case 0x4d: EA=U+13; break; - case 0x4e: EA=U+14; break; - case 0x4f: EA=U+15; break; - - case 0x50: EA=U-16; break; - case 0x51: EA=U-15; break; - case 0x52: EA=U-14; break; - case 0x53: EA=U-13; break; - case 0x54: EA=U-12; break; - case 0x55: EA=U-11; break; - case 0x56: EA=U-10; break; - case 0x57: EA=U-9; break; - case 0x58: EA=U-8; break; - case 0x59: EA=U-7; break; - case 0x5a: EA=U-6; break; - case 0x5b: EA=U-5; break; - case 0x5c: EA=U-4; break; - case 0x5d: EA=U-3; break; - case 0x5e: EA=U-2; break; - case 0x5f: EA=U-1; break; - - case 0x60: EA=S; break; - case 0x61: EA=S+1; break; - case 0x62: EA=S+2; break; - case 0x63: EA=S+3; break; - case 0x64: EA=S+4; break; - case 0x65: EA=S+5; break; - case 0x66: EA=S+6; break; - case 0x67: EA=S+7; break; - case 0x68: EA=S+8; break; - case 0x69: EA=S+9; break; - case 0x6a: EA=S+10; break; - case 0x6b: EA=S+11; break; - case 0x6c: EA=S+12; break; - case 0x6d: EA=S+13; break; - case 0x6e: EA=S+14; break; - case 0x6f: EA=S+15; break; - - case 0x70: EA=S-16; break; - case 0x71: EA=S-15; break; - case 0x72: EA=S-14; break; - case 0x73: EA=S-13; break; - case 0x74: EA=S-12; break; - case 0x75: EA=S-11; break; - case 0x76: EA=S-10; break; - case 0x77: EA=S-9; break; - case 0x78: EA=S-8; break; - case 0x79: EA=S-7; break; - case 0x7a: EA=S-6; break; - case 0x7b: EA=S-5; break; - case 0x7c: EA=S-4; break; - case 0x7d: EA=S-3; break; - case 0x7e: EA=S-2; break; - case 0x7f: EA=S-1; break; - - case 0x80: EA=X; X++; break; - case 0x81: EA=X; X+=2; break; - case 0x82: X--; EA=X; break; - case 0x83: X-=2; EA=X; break; - case 0x84: EA=X; break; - case 0x85: EA=X+SIGNED(B); break; - case 0x86: EA=X+SIGNED(A); break; - case 0x87: EA=X+SIGNED(E); break; - case 0x88: IMMBYTE(EA); EA=X+SIGNED(EA); break; - case 0x89: IMMWORD(ea); EA+=X; break; - case 0x8a: EA=X+SIGNED(F); break; - case 0x8b: EA=X+D; break; - case 0x8c: IMMBYTE(EA); EA=PC+SIGNED(EA); break; - case 0x8d: IMMWORD(ea); EA+=PC; break; - case 0x8e: EA=X+W; break; - case 0x8f: EA=W; break; - - case 0x90: EA=W; EAD=RM16(EAD); break; - case 0x91: EA=X; X+=2; EAD=RM16(EAD); break; - case 0x92: IIError(); break; - case 0x93: X-=2; EA=X; EAD=RM16(EAD); break; - case 0x94: EA=X; EAD=RM16(EAD); break; - case 0x95: EA=X+SIGNED(B); EAD=RM16(EAD); break; - case 0x96: EA=X+SIGNED(A); EAD=RM16(EAD); break; - case 0x97: EA=X+SIGNED(E); EAD=RM16(EAD); break; - case 0x98: IMMBYTE(EA); EA=X+SIGNED(EA); EAD=RM16(EAD); break; - case 0x99: IMMWORD(ea); EA+=X; EAD=RM16(EAD); break; - case 0x9a: EA=X+SIGNED(F); EAD=RM16(EAD); break; - case 0x9b: EA=X+D; EAD=RM16(EAD); break; - case 0x9c: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); break; - case 0x9d: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); break; - case 0x9e: EA=X+W; EAD=RM16(EAD); break; - case 0x9f: IMMWORD(ea); EAD=RM16(EAD); break; - - case 0xa0: EA=Y; Y++; break; - case 0xa1: EA=Y; Y+=2; break; - case 0xa2: Y--; EA=Y; break; - case 0xa3: Y-=2; EA=Y; break; - case 0xa4: EA=Y; break; - case 0xa5: EA=Y+SIGNED(B); break; - case 0xa6: EA=Y+SIGNED(A); break; - case 0xa7: EA=Y+SIGNED(E); break; - case 0xa8: IMMBYTE(EA); EA=Y+SIGNED(EA); break; - case 0xa9: IMMWORD(ea); EA+=Y; break; - case 0xaa: EA=Y+SIGNED(F); break; - case 0xab: EA=Y+D; break; - case 0xac: IMMBYTE(EA); EA=PC+SIGNED(EA); break; - case 0xad: IMMWORD(ea); EA+=PC; break; - case 0xae: EA=Y+W; break; - case 0xaf: IMMWORD(ea); EA+=W; break; - - case 0xb0: IMMWORD(ea); EA+=W; EAD=RM16(EAD); break; - case 0xb1: EA=Y; Y+=2; EAD=RM16(EAD); break; - case 0xb2: IIError(); break; - case 0xb3: Y-=2; EA=Y; EAD=RM16(EAD); break; - case 0xb4: EA=Y; EAD=RM16(EAD); break; - case 0xb5: EA=Y+SIGNED(B); EAD=RM16(EAD); break; - case 0xb6: EA=Y+SIGNED(A); EAD=RM16(EAD); break; - case 0xb7: EA=Y+SIGNED(E); EAD=RM16(EAD); break; - case 0xb8: IMMBYTE(EA); EA=Y+SIGNED(EA); EAD=RM16(EAD); break; - case 0xb9: IMMWORD(ea); EA+=Y; EAD=RM16(EAD); break; - case 0xba: EA=Y+SIGNED(F); EAD=RM16(EAD); break; - case 0xbb: EA=Y+D; EAD=RM16(EAD); break; - case 0xbc: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); break; - case 0xbd: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); break; - case 0xbe: EA=Y+W; EAD=RM16(EAD); break; - case 0xbf: IIError(); break; - - case 0xc0: EA=U; U++; break; - case 0xc1: EA=U; U+=2; break; - case 0xc2: U--; EA=U; break; - case 0xc3: U-=2; EA=U; break; - case 0xc4: EA=U; break; - case 0xc5: EA=U+SIGNED(B); break; - case 0xc6: EA=U+SIGNED(A); break; - case 0xc7: EA=U+SIGNED(E); break; - case 0xc8: IMMBYTE(EA); EA=U+SIGNED(EA); break; - case 0xc9: IMMWORD(ea); EA+=U; break; - case 0xca: EA=U+SIGNED(F); break; - case 0xcb: EA=U+D; break; - case 0xcc: IMMBYTE(EA); EA=PC+SIGNED(EA); break; - case 0xcd: IMMWORD(ea); EA+=PC; break; - case 0xce: EA=U+W; break; - case 0xcf: EA=W; W+=2; break; - - case 0xd0: EA=W; W+=2; EAD=RM16(EAD); break; - case 0xd1: EA=U; U+=2; EAD=RM16(EAD); break; - case 0xd2: IIError(); break; - case 0xd3: U-=2; EA=U; EAD=RM16(EAD); break; - case 0xd4: EA=U; EAD=RM16(EAD); break; - case 0xd5: EA=U+SIGNED(B); EAD=RM16(EAD); break; - case 0xd6: EA=U+SIGNED(A); EAD=RM16(EAD); break; - case 0xd7: EA=U+SIGNED(E); EAD=RM16(EAD); break; - case 0xd8: IMMBYTE(EA); EA=U+SIGNED(EA); EAD=RM16(EAD); break; - case 0xd9: IMMWORD(ea); EA+=U; EAD=RM16(EAD); break; - case 0xda: EA=U+SIGNED(F); EAD=RM16(EAD); break; - case 0xdb: EA=U+D; EAD=RM16(EAD); break; - case 0xdc: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); break; - case 0xdd: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); break; - case 0xde: EA=U+W; EAD=RM16(EAD); break; - case 0xdf: IIError(); break; - - case 0xe0: EA=S; S++; break; - case 0xe1: EA=S; S+=2; break; - case 0xe2: S--; EA=S; break; - case 0xe3: S-=2; EA=S; break; - case 0xe4: EA=S; break; - case 0xe5: EA=S+SIGNED(B); break; - case 0xe6: EA=S+SIGNED(A); break; - case 0xe7: EA=S+SIGNED(E); break; - case 0xe8: IMMBYTE(EA); EA=S+SIGNED(EA); break; - case 0xe9: IMMWORD(ea); EA+=S; break; - case 0xea: EA=S+SIGNED(F); break; - case 0xeb: EA=S+D; break; - case 0xec: IMMBYTE(EA); EA=PC+SIGNED(EA); break; - case 0xed: IMMWORD(ea); EA+=PC; break; - case 0xee: EA=S+W; break; - case 0xef: W-=2; EA=W; break; - - case 0xf0: W-=2; EA=W; EAD=RM16(EAD); break; - case 0xf1: EA=S; S+=2; EAD=RM16(EAD); break; - case 0xf2: IIError(); break; - case 0xf3: S-=2; EA=S; EAD=RM16(EAD); break; - case 0xf4: EA=S; EAD=RM16(EAD); break; - case 0xf5: EA=S+SIGNED(B); EAD=RM16(EAD); break; - case 0xf6: EA=S+SIGNED(A); EAD=RM16(EAD); break; - case 0xf7: EA=S+SIGNED(E); EAD=RM16(EAD); break; - case 0xf8: IMMBYTE(EA); EA=S+SIGNED(EA); EAD=RM16(EAD); break; - case 0xf9: IMMWORD(ea); EA+=S; EAD=RM16(EAD); break; - case 0xfa: EA=S+SIGNED(F); EAD=RM16(EAD); break; - case 0xfb: EA=S+D; EAD=RM16(EAD); break; - case 0xfc: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); break; - case 0xfd: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); break; - case 0xfe: EA=S+W; EAD=RM16(EAD); break; - case 0xff: IIError(); break; - } - - hd6309_ICount -= index_cycle[postbyte]; -} - -#if 0 -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static void hd6309_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + HD6309_IRQ_LINE: set_irq_line(HD6309_IRQ_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + HD6309_FIRQ_LINE:set_irq_line(HD6309_FIRQ_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + HD6309_INPUT_LINE_NMI: set_irq_line(HD6309_INPUT_LINE_NMI, info->i); break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + HD6309_PC: PC = info->i; CHANGE_PC; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + HD6309_S: S = info->i; break; - case CPUINFO_INT_REGISTER + HD6309_CC: CC = info->i; CHECK_IRQ_LINES(); break; - case CPUINFO_INT_REGISTER + HD6309_MD: MD = info->i; UpdateState(); break; - case CPUINFO_INT_REGISTER + HD6309_U: U = info->i; break; - case CPUINFO_INT_REGISTER + HD6309_A: A = info->i; break; - case CPUINFO_INT_REGISTER + HD6309_B: B = info->i; break; - case CPUINFO_INT_REGISTER + HD6309_E: E = info->i; break; - case CPUINFO_INT_REGISTER + HD6309_F: F = info->i; break; - case CPUINFO_INT_REGISTER + HD6309_X: X = info->i; break; - case CPUINFO_INT_REGISTER + HD6309_Y: Y = info->i; break; - case CPUINFO_INT_REGISTER + HD6309_V: V = info->i; break; - case CPUINFO_INT_REGISTER + HD6309_DP: DP = info->i; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void hd6309_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(hd6309); break; - case CPUINFO_INT_INPUT_LINES: info->i = 2; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 5; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 20; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + HD6309_IRQ_LINE: info->i = hd6309.irq_state[HD6309_IRQ_LINE]; break; - case CPUINFO_INT_INPUT_STATE + HD6309_FIRQ_LINE:info->i = hd6309.irq_state[HD6309_FIRQ_LINE]; break; - case CPUINFO_INT_INPUT_STATE + HD6309_INPUT_LINE_NMI: info->i = hd6309.nmi_state; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = PPC; break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + HD6309_PC: info->i = PC; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + HD6309_S: info->i = S; break; - case CPUINFO_INT_REGISTER + HD6309_CC: info->i = CC; break; - case CPUINFO_INT_REGISTER + HD6309_MD: info->i = MD; break; - case CPUINFO_INT_REGISTER + HD6309_U: info->i = U; break; - case CPUINFO_INT_REGISTER + HD6309_A: info->i = A; break; - case CPUINFO_INT_REGISTER + HD6309_B: info->i = B; break; - case CPUINFO_INT_REGISTER + HD6309_E: info->i = E; break; - case CPUINFO_INT_REGISTER + HD6309_F: info->i = F; break; - case CPUINFO_INT_REGISTER + HD6309_X: info->i = X; break; - case CPUINFO_INT_REGISTER + HD6309_Y: info->i = Y; break; - case CPUINFO_INT_REGISTER + HD6309_V: info->i = V; break; - case CPUINFO_INT_REGISTER + HD6309_DP: info->i = DP; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = hd6309_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = hd6309_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = hd6309_set_context; break; - case CPUINFO_PTR_INIT: info->init = hd6309_init; break; - case CPUINFO_PTR_RESET: info->reset = hd6309_reset; break; - case CPUINFO_PTR_EXIT: info->exit = hd6309_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = hd6309_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = hd6309_dasm; break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &hd6309_ICount; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "HD6309"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Hitachi 6309"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.01"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright John Butler and Tim Lindner"); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c%c%c%c%c%c%c%c (MD:%c%c%c%c)", - hd6309.cc & 0x80 ? 'E':'.', - hd6309.cc & 0x40 ? 'F':'.', - hd6309.cc & 0x20 ? 'H':'.', - hd6309.cc & 0x10 ? 'I':'.', - hd6309.cc & 0x08 ? 'N':'.', - hd6309.cc & 0x04 ? 'Z':'.', - hd6309.cc & 0x02 ? 'V':'.', - hd6309.cc & 0x01 ? 'C':'.', - - hd6309.md & 0x80 ? 'E':'e', - hd6309.md & 0x40 ? 'F':'f', - hd6309.md & 0x02 ? 'I':'i', - hd6309.md & 0x01 ? 'Z':'z'); - break; - - case CPUINFO_STR_REGISTER + HD6309_PC: sprintf(info->s, "PC:%04X", hd6309.pc.w.l); break; - case CPUINFO_STR_REGISTER + HD6309_S: sprintf(info->s, "S:%04X", hd6309.s.w.l); break; - case CPUINFO_STR_REGISTER + HD6309_CC: sprintf(info->s, "CC:%02X", hd6309.cc); break; - case CPUINFO_STR_REGISTER + HD6309_MD: sprintf(info->s, "MD:%02X", hd6309.md); break; - case CPUINFO_STR_REGISTER + HD6309_U: sprintf(info->s, "U:%04X", hd6309.u.w.l); break; - case CPUINFO_STR_REGISTER + HD6309_A: sprintf(info->s, "A:%02X", hd6309.d.b.h); break; - case CPUINFO_STR_REGISTER + HD6309_B: sprintf(info->s, "B:%02X", hd6309.d.b.l); break; - case CPUINFO_STR_REGISTER + HD6309_E: sprintf(info->s, "E:%02X", hd6309.w.b.h); break; - case CPUINFO_STR_REGISTER + HD6309_F: sprintf(info->s, "F:%02X", hd6309.w.b.l); break; - case CPUINFO_STR_REGISTER + HD6309_X: sprintf(info->s, "X:%04X", hd6309.x.w.l); break; - case CPUINFO_STR_REGISTER + HD6309_Y: sprintf(info->s, "Y:%04X", hd6309.y.w.l); break; - case CPUINFO_STR_REGISTER + HD6309_V: sprintf(info->s, "V:%04X", hd6309.v.w.l); break; - case CPUINFO_STR_REGISTER + HD6309_DP: sprintf(info->s, "DP:%02X", hd6309.dp.b.h); break; - } -} -#endif diff --git a/jan/src/cpu/hd6309/hd6309.h b/jan/src/cpu/hd6309/hd6309.h deleted file mode 100644 index bb5d3e112..000000000 --- a/jan/src/cpu/hd6309/hd6309.h +++ /dev/null @@ -1,89 +0,0 @@ -/*** hd6309: Portable 6309 emulator ******************************************/ - -//#pragma once - -#ifndef __HD6309_H__ -#define __HD6309_H__ - -//#include "cpuintrf.h" - -enum -{ - HD6309_PC=1, HD6309_S, HD6309_CC ,HD6309_A, HD6309_B, HD6309_U, HD6309_X, HD6309_Y, HD6309_DP, - HD6309_E, HD6309_F, HD6309_V, HD6309_MD -}; - -#define HD6309_IRQ_LINE 0 /* IRQ line number */ -#define HD6309_FIRQ_LINE 1 /* FIRQ line number */ -#define HD6309_INPUT_LINE_NMI 32 - -/* 6309 Registers */ -typedef struct -{ - PAIR pc; /* Program counter */ - PAIR ppc; /* Previous program counter */ - PAIR d,w; /* Accumlator d and w (ab = d, ef = w, abef = q) */ - PAIR dp; /* Direct Page register (page in MSB) */ - PAIR u, s; /* Stack pointers */ - PAIR x, y; /* Index registers */ - PAIR v; /* New 6309 register */ - UINT8 cc; - UINT8 md; /* Special mode register */ - UINT8 ireg; /* First opcode */ - UINT8 irq_state[2]; - int extra_cycles; /* cycles used up by interrupts */ - ALIGN_VAR(8) int (*irq_callback)(int irqline); - UINT8 int_state; /* SYNC and CWAI flags */ - UINT8 nmi_state; -} hd6309_Regs; - -unsigned char HD6309ReadByte(unsigned short Address); -void HD6309WriteByte(unsigned short Address, unsigned char Data); -unsigned char HD6309ReadOp(unsigned short Address); -unsigned char HD6309ReadOpArg(unsigned short Address); - -void hd6309_init(); -void hd6309_reset(void); -int hd6309_get_pc(); -int hd6309_execute(int cycles); -void hd6309_set_irq_line(int irqline, int state); -void hd6309_get_context(void *dst); -void hd6309_set_context(void *src); - - -/* PUBLIC FUNCTIONS */ -//void hd6309_get_info(UINT32 state, cpuinfo *info); - -/****************************************************************************/ -/* Read a byte from given memory location */ -/****************************************************************************/ -/* ASG 971005 -- changed to program_read_byte_8/cpu_writemem16 */ -#define HD6309_RDMEM(Addr) ((unsigned)HD6309ReadByte(Addr)) - -/****************************************************************************/ -/* Write a byte to given memory location */ -/****************************************************************************/ -#define HD6309_WRMEM(Addr,Value) (HD6309WriteByte(Addr,Value)) - -/****************************************************************************/ -/* Z80_RDOP() is identical to Z80_RDMEM() except it is used for reading */ -/* opcodes. In case of system with memory mapped I/O, this function can be */ -/* used to greatly speed up emulation */ -/****************************************************************************/ -#define HD6309_RDOP(Addr) ((unsigned)HD6309ReadOp(Addr)) - -/****************************************************************************/ -/* Z80_RDOP_ARG() is identical to Z80_RDOP() except it is used for reading */ -/* opcode arguments. This difference can be used to support systems that */ -/* use different encoding mechanisms for opcodes and opcode arguments */ -/****************************************************************************/ -#define HD6309_RDOP_ARG(Addr) ((unsigned)HD6309ReadOpArg(Addr)) - -#ifndef FALSE -# define FALSE 0 -#endif -#ifndef TRUE -# define TRUE (!FALSE) -#endif - -#endif /* __HD6309_H__ */ diff --git a/jan/src/cpu/hd6309_intf.cpp b/jan/src/cpu/hd6309_intf.cpp deleted file mode 100644 index 8eda2d811..000000000 --- a/jan/src/cpu/hd6309_intf.cpp +++ /dev/null @@ -1,447 +0,0 @@ -#include "burnint.h" -#include "hd6309_intf.h" - -#define MAX_CPU 8 - -INT32 nHD6309Count = 0; -static INT32 nActiveCPU = 0; - -static HD6309Ext *HD6309CPUContext = NULL; - -static INT32 nHD6309CyclesDone[MAX_CPU]; -INT32 nHD6309CyclesTotal; - -static UINT8 HD6309ReadByteDummyHandler(UINT16) -{ - return 0; -} - -static void HD6309WriteByteDummyHandler(UINT16, UINT8) -{ -} - -static UINT8 HD6309ReadOpDummyHandler(UINT16) -{ - return 0; -} - -static UINT8 HD6309ReadOpArgDummyHandler(UINT16) -{ - return 0; -} - -void HD6309Reset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309Reset called without init\n")); -#endif - - hd6309_reset(); -} - -void HD6309NewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309NewFrame called without init\n")); -#endif - - for (INT32 i = 0; i < nHD6309Count; i++) { - nHD6309CyclesDone[i] = 0; - } - nHD6309CyclesTotal = 0; -} - - -static UINT8 HD6309CheatRead(UINT32 a) -{ - return HD6309ReadByte(a); -} - -static void HD6309CheatWriteRom(UINT32 a, UINT8 d) -{ - HD6309WriteRom(a, d); -} - -static cpu_core_config HD6309CheatCpuConfig = -{ - HD6309Open, - HD6309Close, - HD6309CheatRead, - HD6309CheatWriteRom, - HD6309GetActive, - HD6309TotalCycles, - HD6309NewFrame, - HD6309Run, - HD6309RunEnd, - HD6309Reset, - 1<<16, - 0 -}; - -INT32 HD6309Init(INT32 nCPU) -{ - DebugCPU_HD6309Initted = 1; - - nActiveCPU = -1; - if ((nCPU+1) > nHD6309Count) nHD6309Count = nCPU+1; - -#if defined FBA_DEBUG - if (nCPU >= MAX_CPU) bprintf(PRINT_ERROR, _T("HD6309Init called too many CPUs! %d, %d is MAX\n"), nCPU, MAX_CPU); -#endif - - if (HD6309CPUContext == NULL) { - HD6309CPUContext = (HD6309Ext*)malloc(MAX_CPU * sizeof(HD6309Ext)); - if (HD6309CPUContext == NULL) { - return 1; - } - - memset(HD6309CPUContext, 0, MAX_CPU * sizeof(HD6309Ext)); - } - - HD6309CPUContext[nCPU].ReadByte = HD6309ReadByteDummyHandler; - HD6309CPUContext[nCPU].WriteByte = HD6309WriteByteDummyHandler; - HD6309CPUContext[nCPU].ReadOp = HD6309ReadOpDummyHandler; - HD6309CPUContext[nCPU].ReadOpArg = HD6309ReadOpArgDummyHandler; - - nHD6309CyclesDone[nCPU] = 0; - - for (INT32 j = 0; j < (0x0100 * 3); j++) { - HD6309CPUContext[nCPU].pMemMap[j] = NULL; - } - - nHD6309CyclesTotal = 0; - - //hd6309_init(); // does nothing. - - CpuCheatRegister(nCPU, &HD6309CheatCpuConfig); - - return 0; -} - -void HD6309Exit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309Exit called without init\n")); -#endif - - nHD6309Count = 0; - - if (HD6309CPUContext) { - free(HD6309CPUContext); - HD6309CPUContext = NULL; - } - - DebugCPU_HD6309Initted = 0; -} - -void HD6309Open(INT32 num) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309Open called without init\n")); - if (num >= nHD6309Count) bprintf(PRINT_ERROR, _T("HD6309Open called with invalid index %x\n"), num); - if (nActiveCPU != -1) bprintf(PRINT_ERROR, _T("HD6309Open called when CPU already open with index %x\n"), num); -#endif - - nActiveCPU = num; - - hd6309_set_context(&HD6309CPUContext[nActiveCPU].reg); - - nHD6309CyclesTotal = nHD6309CyclesDone[nActiveCPU]; -} - -void HD6309Close() -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309Close called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309Close called when no CPU open\n")); -#endif - - hd6309_get_context(&HD6309CPUContext[nActiveCPU].reg); - - nHD6309CyclesDone[nActiveCPU] = nHD6309CyclesTotal; - - nActiveCPU = -1; -} - -INT32 HD6309GetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309GetActive called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309GetActive called when no CPU open\n")); -#endif - - return nActiveCPU; -} - -void HD6309SetIRQLine(INT32 vector, INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309SetIRQLine called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309SetIRQLine called when no CPU open\n")); -#endif - - if (status == CPU_IRQSTATUS_NONE) { - hd6309_set_irq_line(vector, 0); - } - - if (status == CPU_IRQSTATUS_ACK) { - hd6309_set_irq_line(vector, 1); - } - - if (status == CPU_IRQSTATUS_AUTO) { - hd6309_set_irq_line(vector, 1); - hd6309_execute(0); - hd6309_set_irq_line(vector, 0); - hd6309_execute(0); - } -} - -INT32 HD6309Run(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309Run called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309Run called when no CPU open\n")); -#endif - - cycles = hd6309_execute(cycles); - - nHD6309CyclesTotal += cycles; - - return cycles; -} - -void HD6309RunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309RunEnd called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309RunEnd called when no CPU open\n")); -#endif -} - -UINT32 HD6309GetPC(INT32) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309GetPC called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309GetPC called when no CPU open\n")); -#endif - - return hd6309_get_pc(); -} - -INT32 HD6309MapMemory(UINT8* pMemory, UINT16 nStart, UINT16 nEnd, INT32 nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309MapMemory called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309MapMemory called when no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = HD6309CPUContext[nActiveCPU].pMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - if (nType & MAP_READ) { - pMemMap[0 + i] = pMemory + ((i - cStart) << 8); - } - if (nType & MAP_WRITE) { - pMemMap[0x100 + i] = pMemory + ((i - cStart) << 8); - } - if (nType & MAP_FETCH) { - pMemMap[0x200 + i] = pMemory + ((i - cStart) << 8); - } - } - return 0; - -} - -INT32 HD6309MemCallback(UINT16 nStart, UINT16 nEnd, INT32 nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309MemCallback called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309MemCallback called when no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = HD6309CPUContext[nActiveCPU].pMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - if (nType & MAP_READ) { - pMemMap[0 + i] = NULL; - } - if (nType & MAP_WRITE) { - pMemMap[0x100 + i] = NULL; - } - if (nType & MAP_FETCH) { - pMemMap[0x200 + i] = NULL; - } - } - return 0; - -} - -void HD6309SetReadHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309SetReadHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309SetReadHandler called when no CPU open\n")); -#endif - - HD6309CPUContext[nActiveCPU].ReadByte = pHandler; -} - -void HD6309SetWriteHandler(void (*pHandler)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309SetWriteHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309SetWriteHandler called when no CPU open\n")); -#endif - - HD6309CPUContext[nActiveCPU].WriteByte = pHandler; -} - -void HD6309SetReadOpHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309SetReadOpHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309SetReadOpHandler called when no CPU open\n")); -#endif - - HD6309CPUContext[nActiveCPU].ReadOp = pHandler; -} - -void HD6309SetReadOpArgHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309SetReadOpArgHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309SetReadOpArgHandler called when no CPU open\n")); -#endif - - HD6309CPUContext[nActiveCPU].ReadOpArg = pHandler; -} - -UINT8 HD6309ReadByte(UINT16 Address) -{ - // check mem map - UINT8 * pr = HD6309CPUContext[nActiveCPU].pMemMap[0x000 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (HD6309CPUContext[nActiveCPU].ReadByte != NULL) { - return HD6309CPUContext[nActiveCPU].ReadByte(Address); - } - - return 0; -} - -void HD6309WriteByte(UINT16 Address, UINT8 Data) -{ - // check mem map - UINT8 * pr = HD6309CPUContext[nActiveCPU].pMemMap[0x100 | (Address >> 8)]; - if (pr != NULL) { - pr[Address & 0xff] = Data; - return; - } - - // check handler - if (HD6309CPUContext[nActiveCPU].WriteByte != NULL) { - HD6309CPUContext[nActiveCPU].WriteByte(Address, Data); - return; - } -} - -UINT8 HD6309ReadOp(UINT16 Address) -{ - // check mem map - UINT8 * pr = HD6309CPUContext[nActiveCPU].pMemMap[0x200 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (HD6309CPUContext[nActiveCPU].ReadOp != NULL) { - return HD6309CPUContext[nActiveCPU].ReadOp(Address); - } - - return 0; -} - -UINT8 HD6309ReadOpArg(UINT16 Address) -{ - // check mem map - UINT8 * pr = HD6309CPUContext[nActiveCPU].pMemMap[0x200 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (HD6309CPUContext[nActiveCPU].ReadOpArg != NULL) { - return HD6309CPUContext[nActiveCPU].ReadOpArg(Address); - } - - return 0; -} - -void HD6309WriteRom(UINT16 Address, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309WriteRom called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("HD6309WriteRom called when no CPU open\n")); -#endif - - // check mem map - UINT8 * pr = HD6309CPUContext[nActiveCPU].pMemMap[0x000 | (Address >> 8)]; - UINT8 * pw = HD6309CPUContext[nActiveCPU].pMemMap[0x100 | (Address >> 8)]; - UINT8 * pf = HD6309CPUContext[nActiveCPU].pMemMap[0x200 | (Address >> 8)]; - - if (pr != NULL) { - pr[Address & 0xff] = Data; - } - - if (pw != NULL) { - pw[Address & 0xff] = Data; - } - - if (pf != NULL) { - pf[Address & 0xff] = Data; - } - - // check handler - if (HD6309CPUContext[nActiveCPU].WriteByte != NULL) { - HD6309CPUContext[nActiveCPU].WriteByte(Address, Data); - return; - } -} - -INT32 HD6309Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309Scan called without init\n")); -#endif - - struct BurnArea ba; - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - for (INT32 i = 0; i < nHD6309Count; i++) { - char szName[] = "HD6309 #n"; - szName[7] = '0' + i; - - memset(&ba, 0, sizeof(ba)); - ba.Data = &HD6309CPUContext[i].reg; - ba.nLen = sizeof(HD6309CPUContext[i].reg); - ba.szName = szName; - BurnAcb(&ba); - - SCAN_VAR(HD6309CPUContext[i].nCyclesTotal); - SCAN_VAR(HD6309CPUContext[i].nCyclesSegment); - SCAN_VAR(HD6309CPUContext[i].nCyclesLeft); - SCAN_VAR(nHD6309CyclesDone[i]); - } - - SCAN_VAR(nHD6309CyclesTotal); - - return 0; -} diff --git a/jan/src/cpu/hd6309_intf.h b/jan/src/cpu/hd6309_intf.h deleted file mode 100644 index b9085b96b..000000000 --- a/jan/src/cpu/hd6309_intf.h +++ /dev/null @@ -1,56 +0,0 @@ -#include "hd6309/hd6309.h" - -typedef UINT8 (*pReadByteHandler)(UINT16 a); -typedef void (*pWriteByteHandler)(UINT16 a, UINT8 d); -typedef UINT8 (*pReadOpHandler)(UINT16 a); -typedef UINT8 (*pReadOpArgHandler)(UINT16 a); - -struct HD6309Ext { - - hd6309_Regs reg; - - UINT8* pMemMap[0x100 * 3]; - - pReadByteHandler ReadByte; - pWriteByteHandler WriteByte; - pReadOpHandler ReadOp; - pReadOpArgHandler ReadOpArg; - - INT32 nCyclesTotal; - INT32 nCyclesSegment; - INT32 nCyclesLeft; -}; - -extern INT32 nHD6309Count; - -extern INT32 nHD6309CyclesTotal; - -void HD6309Reset(); -void HD6309NewFrame(); -INT32 HD6309Init(INT32 nCPU); -void HD6309Exit(); -void HD6309Open(INT32 num); -void HD6309Close(); -INT32 HD6309GetActive(); -void HD6309SetIRQLine(INT32 vector, INT32 status); -INT32 HD6309Run(INT32 cycles); -void HD6309RunEnd(); -UINT32 HD6309GetPC(INT32); -INT32 HD6309MapMemory(UINT8* pMemory, UINT16 nStart, UINT16 nEnd, INT32 nType); -INT32 HD6309MemCallback(UINT16 nStart, UINT16 nEnd, INT32 nType); -void HD6309SetReadHandler(UINT8 (*pHandler)(UINT16)); -void HD6309SetWriteHandler(void (*pHandler)(UINT16, UINT8)); -void HD6309SetReadOpHandler(UINT8 (*pHandler)(UINT16)); -void HD6309SetReadOpArgHandler(UINT8 (*pHandler)(UINT16)); -INT32 HD6309Scan(INT32 nAction); - -void HD6309WriteRom(UINT16 Address, UINT8 Data); - -inline static INT32 HD6309TotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_HD6309Initted) bprintf(PRINT_ERROR, _T("HD6309TotalCycles called without init\n")); -#endif - - return nHD6309CyclesTotal; -} diff --git a/jan/src/cpu/i8039/i8039.cpp b/jan/src/cpu/i8039/i8039.cpp deleted file mode 100644 index 9b2e32302..000000000 --- a/jan/src/cpu/i8039/i8039.cpp +++ /dev/null @@ -1,1350 +0,0 @@ -/**************************************************************************** - * Intel 8039 Portable Emulator * - * * - * Copyright Mirko Buffoni * - * Based on the original work Copyright Dan Boris, an 8048 emulator * - * You are not allowed to distribute this software commercially * - * Please, notify me, if you make any changes to this file * - * * - * * - * **** Change Log **** * - * * - * TLP (19-Jun-2001) * - * - Changed Ports 1 and 2 to quasi bidirectional output latched ports * - * - Added the Port 1 & 2 output latch data to the debugger window * - * TLP (02-Jan-2002) * - * - External IRQs no longer go pending (sampled as a level state) * - * - Timer IRQs do not go pending if Timer interrupts are disabled * - * - Timer IRQs made pending, were incorrectly being cleared if the * - * external interrupt was being serviced * - * - External interrupts now take precedence when simultaneous * - * internal and external interrupt requests occur * - * - 'DIS TCNTI' now removes pending timer IRQs * - * - Nested IRQs of any sort are no longer allowed * - * - T_flag was not being set in the right place of execution, which * - * could have lead to it being incorrectly set after being cleared * - * - Counter overflows now also set the T_flag * - * - Added the Timer/Counter register to the debugger window * - * TLP (09-Jan-2002) * - * - Changed Interrupt system to instant servicing * - * - The Timer and Counter can no longer be 'on' simultaneously * - * - Added Save State * - * TLP (15-Feb-2002) * - * - Corrected Positive signal edge sensing (used on the T1 input) * - ****************************************************************************/ - - -#include "burnint.h" -#include "i8039.h" - -typedef union -{ - struct { UINT8 l,h,h2,h3; } b; - struct { UINT16 l,h; } w; - UINT32 d; -} I8039_PAIR; - -/*** Cycle times for the jump on condition instructions, are unusual. - Condition is tested during the first cycle, so if condition is not - met, second address fetch cycle may not really be taken. For now we - just use the cycle counts as listed in the i8048 user manual. -***/ - -#if 0 -#define ADJUST_CYCLES { inst_cycles -= 1; } /* Possible real cycles setting */ -#else -#define ADJUST_CYCLES { } /* User Manual cycles setting */ -#endif - -/* There are certain differences between the processors */ -#define FEATURE_M58715 1 - -/* HJB 01/05/99 changed to positive values to use pending_irq as a flag */ -#define I8039_NO_INT 0 /* No Interrupts pending or executing */ -#define I8039_EXTERNAL_INT 1 /* Execute a normal external interrupt */ -#define I8039_TIMCNT_INT 2 /* Execute a Timer/Counter interrupt */ - - -static int Ext_IRQ(void); -static int Timer_IRQ(void); - -#define M_RDMEM(A) I8039_RDMEM(A) -//#define M_RDOP(A) I8039_RDOP(A) -//#define M_RDOP_ARG(A) I8039_RDOP_ARG(A) -#define M_IN(A) I8039_In(A) -#define M_OUT(A,V) I8039_Out(A,V) - -#define port_r(A) I8039_In(I8039_p0 + A) -#define port_w(A,V) I8039_Out(I8039_p0 + A,V) -#define test_r(A) I8039_In(I8039_t0 + A) -#define test_w(A,V) I8039_Out(I8039_t0 + A,V) -#define bus_r() I8039_In(I8039_bus) -#define bus_w(V) I8039_Out(I8039_bus,V) - -#define INTRAM_R(A) (intRAM[(A) & R.ram_mask]) -#define INTRAM_W(A,V) do { intRAM[(A) & R.ram_mask] = V; } while (0); - -#define C_FLAG 0x80 -#define A_FLAG 0x40 -#define F_FLAG 0x20 -#define B_FLAG 0x10 - -typedef struct -{ - I8039_PAIR PREVPC; /* previous program counter */ - I8039_PAIR PC; /* program counter */ - UINT8 A, SP, PSW; - UINT8 bus, f1; /* Bus data, and flag1 */ - UINT8 P1, P2; /* Internal Port 1 and 2 latched outputs */ - UINT8 EA; /* latched EA input */ - UINT8 cpu_feature; /* process feature */ - UINT8 ram_mask; /* internal ram size - 1 */ - UINT16 int_rom_size; /* internal rom size */ - UINT8 pending_irq, irq_executing, masterClock, regPtr; - UINT8 t_flag, timer, timerON, countON, xirq_en, tirq_en; - UINT16 A11; - UINT8 irq_state, irq_extra_cycles; - ALIGN_VAR(8) int (*irq_callback)(int irqline); - int inst_cycles; - UINT8 Old_T1; - double total_cycles; -} I8039_Regs; - -static I8039_Regs R; -static int i8039_ICount; -static int i8039_ICount_cycles; - -static UINT8 *RAM; - -#define I8039_INLINE static inline -#define change_pc(newpc) R.PC.w.l = (newpc) - -i8039ReadIoHandler I8039IORead; -i8039WriteIoHandler I8039IOWrite; -i8039ReadProgHandler I8039ProgramRead; -i8039WriteProgHandler I8039ProgramWrite; -i8039ReadOpHandler I8039CPUReadOp; -i8039ReadOpArgHandler I8039CPUReadOpArg; - -unsigned char __fastcall I8039DummyReadIo(unsigned int) -{ - return 0; -} - -void __fastcall I8039DummyWriteIo(unsigned int, unsigned char) -{ -} - -unsigned char __fastcall I8039DummyReadProg(unsigned int) -{ - return 0; -} - -void __fastcall I8039DummyWriteProg(unsigned int, unsigned char) -{ -} - -unsigned char __fastcall I8039DummyReadOp(unsigned int) -{ - return 0; -} - -unsigned char __fastcall I8039DummyReadOpArg(unsigned int) -{ - return 0; -} - -/* The opcode table now is a combination of cycle counts and function pointers */ -typedef struct { - unsigned cycles; - void (*function) (void); -} s_opcode; - -#define POSITIVE_EDGE_T1 (( (int)(T1-R.Old_T1) > 0) ? 1 : 0) -#define NEGATIVE_EDGE_T1 (( (int)(R.Old_T1-T1) > 0) ? 1 : 0) - -#define M_Cy ((R.PSW & C_FLAG) >> 7) -#define M_Cn (!M_Cy) -#define M_Ay ((R.PSW & A_FLAG)) -#define M_An (!M_Ay) -#define M_F0y ((R.PSW & F_FLAG)) -#define M_F0n (!M_F0y) -#define M_By ((R.PSW & B_FLAG)) -#define M_Bn (!M_By) - -#define intRAM RAM -#define regPTR R.regPtr - -#define R0 intRAM[regPTR ] -#define R1 intRAM[regPTR+1] -#define R2 intRAM[regPTR+2] -#define R3 intRAM[regPTR+3] -#define R4 intRAM[regPTR+4] -#define R5 intRAM[regPTR+5] -#define R6 intRAM[regPTR+6] -#define R7 intRAM[regPTR+7] - -I8039_INLINE UINT8 ea_r(void) -{ - R.EA = I8039_In(I8039_ea); - return R.EA; -} - -I8039_INLINE UINT8 M_RDOP(int A) -{ - if (R.cpu_feature & FEATURE_M58715) - if ((A> 1); -} - -I8039_INLINE UINT8 pull(void) { - R.SP = (R.SP + 15) & 0x0f; /* if (--R.SP < 0) R.SP = 15; */ - R.PSW = R.PSW & 0xf8; - R.PSW = R.PSW | (R.SP >> 1); - /* regPTR = ((M_By) ? 24 : 0); regPTR should not change */ - return intRAM[8+R.SP]; -} - -I8039_INLINE void daa_a(void) -{ - if ((R.A & 0x0f) > 0x09 || (R.PSW & A_FLAG)) - { - R.A += 0x06; - if ( ! ( R.A & 0xf0 ) ) - SET(C_FLAG); - } - if ((R.A & 0xf0) > 0x90 || (R.PSW & C_FLAG)) - { - R.A += 0x60; - SET(C_FLAG); - } else CLR(C_FLAG); -} - -I8039_INLINE void M_ADD(UINT8 dat) -{ - UINT16 temp; - - CLR(C_FLAG | A_FLAG); - if ((R.A & 0xf) + (dat & 0xf) > 0xf) SET(A_FLAG); - temp = R.A + dat; - if (temp > 0xff) SET(C_FLAG); - R.A = temp & 0xff; -} - -I8039_INLINE void M_ADDC(UINT8 dat) -{ - UINT16 temp; - - CLR(A_FLAG); - if ((R.A & 0xf) + (dat & 0xf) + M_Cy > 0xf) SET(A_FLAG); - temp = R.A + dat + M_Cy; - CLR(C_FLAG); - if (temp > 0xff) SET(C_FLAG); - R.A = temp & 0xff; -} - -I8039_INLINE void M_CALL(UINT16 addr) -{ - push(R.PC.b.l); - push((R.PC.b.h & 0x0f) | (R.PSW & 0xf0)); - R.PC.w.l = addr; - change_pc(addr); -} - -I8039_INLINE void M_XCHD(UINT8 addr) -{ - UINT8 dat = R.A & 0x0f; - UINT8 val = INTRAM_R(addr); - R.A &= 0xf0; - R.A |= val & 0x0f; - val &= 0xf0; - val |= dat; - INTRAM_W(addr, val); -} - - -I8039_INLINE void M_ILLEGAL(void) -{ -// logerror("I8039: PC = %04x, Illegal opcode = %02x\n", R.PC.w.l-1, M_RDMEM(R.PC.w.l-1)); -} - -I8039_INLINE void M_UNDEFINED(void) -{ -// logerror("I8039: PC = %04x, Unimplemented opcode = %02x\n", R.PC.w.l-1, M_RDMEM(R.PC.w.l-1)); -} - -static void illegal(void) { M_ILLEGAL(); } - -static void add_a_n(void) { M_ADD(M_RDMEM_OPCODE()); } -static void add_a_r0(void) { M_ADD(R0); } -static void add_a_r1(void) { M_ADD(R1); } -static void add_a_r2(void) { M_ADD(R2); } -static void add_a_r3(void) { M_ADD(R3); } -static void add_a_r4(void) { M_ADD(R4); } -static void add_a_r5(void) { M_ADD(R5); } -static void add_a_r6(void) { M_ADD(R6); } -static void add_a_r7(void) { M_ADD(R7); } -static void add_a_xr0(void) { M_ADD(INTRAM_R(R0)); } -static void add_a_xr1(void) { M_ADD(INTRAM_R(R1)); } -static void adc_a_n(void) { M_ADDC(M_RDMEM_OPCODE()); } -static void adc_a_r0(void) { M_ADDC(R0); } -static void adc_a_r1(void) { M_ADDC(R1); } -static void adc_a_r2(void) { M_ADDC(R2); } -static void adc_a_r3(void) { M_ADDC(R3); } -static void adc_a_r4(void) { M_ADDC(R4); } -static void adc_a_r5(void) { M_ADDC(R5); } -static void adc_a_r6(void) { M_ADDC(R6); } -static void adc_a_r7(void) { M_ADDC(R7); } -static void adc_a_xr0(void) { M_ADDC(INTRAM_R(R0)); } -static void adc_a_xr1(void) { M_ADDC(INTRAM_R(R1)); } -static void anl_a_n(void) { R.A &= M_RDMEM_OPCODE(); } -static void anl_a_r0(void) { R.A &= R0; } -static void anl_a_r1(void) { R.A &= R1; } -static void anl_a_r2(void) { R.A &= R2; } -static void anl_a_r3(void) { R.A &= R3; } -static void anl_a_r4(void) { R.A &= R4; } -static void anl_a_r5(void) { R.A &= R5; } -static void anl_a_r6(void) { R.A &= R6; } -static void anl_a_r7(void) { R.A &= R7; } -static void anl_a_xr0(void) { R.A &= INTRAM_R(R0); } -static void anl_a_xr1(void) { R.A &= INTRAM_R(R1); } -static void anl_bus_n(void) { bus_w( bus_r() & M_RDMEM_OPCODE() ); } - -static void anl_p1_n(void) -{ - R.P1 &= M_RDMEM_OPCODE(); - port_w( 1, R.P1 ); -} - -static void anl_p2_n(void) -{ - R.P2 &= M_RDMEM_OPCODE(); - port_w( 2, R.P2 ); -} - -static void anld_p4_a(void) { port_w( 4, (port_r(4) & M_RDMEM_OPCODE()) & 0x0f ); } -static void anld_p5_a(void) { port_w( 5, (port_r(5) & M_RDMEM_OPCODE()) & 0x0f ); } -static void anld_p6_a(void) { port_w( 6, (port_r(6) & M_RDMEM_OPCODE()) & 0x0f ); } -static void anld_p7_a(void) { port_w( 7, (port_r(7) & M_RDMEM_OPCODE()) & 0x0f ); } -static void call(void) { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | a11); } -static void call_1(void) { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | 0x100 | a11); } -static void call_2(void) { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | 0x200 | a11); } -static void call_3(void) { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | 0x300 | a11); } -static void call_4(void) { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | 0x400 | a11); } -static void call_5(void) { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | 0x500 | a11); } -static void call_6(void) { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | 0x600 | a11); } -static void call_7(void) { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | 0x700 | a11); } -static void clr_a(void) { R.A=0; } -static void clr_c(void) { CLR(C_FLAG); } -static void clr_f0(void) { CLR(F_FLAG); } -static void clr_f1(void) { R.f1 = 0; } -static void cpl_a(void) { R.A ^= 0xff; } -static void cpl_c(void) { R.PSW ^= C_FLAG; } -static void cpl_f0(void) { R.PSW ^= F_FLAG; } -static void cpl_f1(void) { R.f1 ^= 1; } -static void dec_a(void) { R.A--; } -static void dec_r0(void) { R0--; } -static void dec_r1(void) { R1--; } -static void dec_r2(void) { R2--; } -static void dec_r3(void) { R3--; } -static void dec_r4(void) { R4--; } -static void dec_r5(void) { R5--; } -static void dec_r6(void) { R6--; } -static void dec_r7(void) { R7--; } -static void dis_i(void) { R.xirq_en = 0; } -static void dis_tcnti(void) { R.tirq_en = 0; R.pending_irq &= ~I8039_TIMCNT_INT; } -static void djnz_r0(void) { UINT8 i=M_RDMEM_OPCODE(); R0--; if (R0 != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void djnz_r1(void) { UINT8 i=M_RDMEM_OPCODE(); R1--; if (R1 != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void djnz_r2(void) { UINT8 i=M_RDMEM_OPCODE(); R2--; if (R2 != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void djnz_r3(void) { UINT8 i=M_RDMEM_OPCODE(); R3--; if (R3 != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void djnz_r4(void) { UINT8 i=M_RDMEM_OPCODE(); R4--; if (R4 != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void djnz_r5(void) { UINT8 i=M_RDMEM_OPCODE(); R5--; if (R5 != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void djnz_r6(void) { UINT8 i=M_RDMEM_OPCODE(); R6--; if (R6 != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void djnz_r7(void) { UINT8 i=M_RDMEM_OPCODE(); R7--; if (R7 != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void en_i(void) { R.xirq_en = 1; if (R.irq_state == I8039_EXTERNAL_INT) { R.irq_extra_cycles += Ext_IRQ(); } } -static void en_tcnti(void) { R.tirq_en = 1; } -static void ento_clk(void) { M_UNDEFINED(); } -static void in_a_p1(void) { R.A = port_r(1) & R.P1; } -static void in_a_p2(void) { R.A = port_r(2) & R.P2; } -static void ins_a_bus(void) { R.A = bus_r(); } -static void inc_a(void) { R.A++; } -static void inc_r0(void) { R0++; } -static void inc_r1(void) { R1++; } -static void inc_r2(void) { R2++; } -static void inc_r3(void) { R3++; } -static void inc_r4(void) { R4++; } -static void inc_r5(void) { R5++; } -static void inc_r6(void) { R6++; } -static void inc_r7(void) { R7++; } -static void inc_xr0(void) { INTRAM_W(R0, INTRAM_R(R0) + 1); } -static void inc_xr1(void) { INTRAM_W(R1, INTRAM_R(R1) + 1); } - -static void jmp(void) -{ - UINT8 i=M_RDOP(R.PC.w.l); - UINT16 oldpc,newpc; - UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; - - oldpc = R.PC.w.l-1; - R.PC.w.l = i | a11; - change_pc(R.PC.w.l); - newpc = R.PC.w.l; - if (newpc == oldpc) { if (i8039_ICount > 0) i8039_ICount = 0; } /* speed up busy loop */ - else if (newpc == oldpc-1 && M_RDOP(newpc) == 0x00) /* NOP - Gyruss */ - { if (i8039_ICount > 0) i8039_ICount = 0; } -} - -static void jmp_1(void) { UINT8 i=M_RDOP(R.PC.w.l); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; R.PC.w.l = i | 0x100 | a11; change_pc(R.PC.w.l); } -static void jmp_2(void) { UINT8 i=M_RDOP(R.PC.w.l); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; R.PC.w.l = i | 0x200 | a11; change_pc(R.PC.w.l); } -static void jmp_3(void) { UINT8 i=M_RDOP(R.PC.w.l); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; R.PC.w.l = i | 0x300 | a11; change_pc(R.PC.w.l); } -static void jmp_4(void) { UINT8 i=M_RDOP(R.PC.w.l); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; R.PC.w.l = i | 0x400 | a11; change_pc(R.PC.w.l); } -static void jmp_5(void) { UINT8 i=M_RDOP(R.PC.w.l); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; R.PC.w.l = i | 0x500 | a11; change_pc(R.PC.w.l); } -static void jmp_6(void) { UINT8 i=M_RDOP(R.PC.w.l); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; R.PC.w.l = i | 0x600 | a11; change_pc(R.PC.w.l); } -static void jmp_7(void) { UINT8 i=M_RDOP(R.PC.w.l); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; R.PC.w.l = i | 0x700 | a11; change_pc(R.PC.w.l); } -static void jmpp_xa(void) { UINT16 addr = (R.PC.w.l & 0xf00) | R.A; R.PC.w.l = (R.PC.w.l & 0xf00) | M_RDMEM(addr); change_pc(R.PC.w.l); } -static void jb_0(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A & 0x01) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jb_1(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A & 0x02) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jb_2(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A & 0x04) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jb_3(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A & 0x08) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jb_4(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A & 0x10) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jb_5(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A & 0x20) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jb_6(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A & 0x40) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jb_7(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A & 0x80) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jf0(void) { UINT8 i=M_RDMEM_OPCODE(); if (M_F0y) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jf1(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.f1) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jnc(void) { UINT8 i=M_RDMEM_OPCODE(); if (M_Cn) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jc(void) { UINT8 i=M_RDMEM_OPCODE(); if (M_Cy) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jni(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.irq_state == I8039_EXTERNAL_INT) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jnt_0(void) { UINT8 i=M_RDMEM_OPCODE(); if (!test_r(0)) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jt_0(void) { UINT8 i=M_RDMEM_OPCODE(); if (test_r(0)) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jnt_1(void) { UINT8 i=M_RDMEM_OPCODE(); if (!test_r(1)) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jt_1(void) { UINT8 i=M_RDMEM_OPCODE(); if (test_r(1)) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jnz(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A != 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jz(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.A == 0) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); } else ADJUST_CYCLES } -static void jtf(void) { UINT8 i=M_RDMEM_OPCODE(); if (R.t_flag) { R.PC.w.l = ((R.PC.w.l-1) & 0xf00) | i; change_pc(R.PC.w.l); R.t_flag = 0; } else ADJUST_CYCLES } -static void mov_a_n(void) { R.A = M_RDMEM_OPCODE(); } -static void mov_a_r0(void) { R.A = R0; } -static void mov_a_r1(void) { R.A = R1; } -static void mov_a_r2(void) { R.A = R2; } -static void mov_a_r3(void) { R.A = R3; } -static void mov_a_r4(void) { R.A = R4; } -static void mov_a_r5(void) { R.A = R5; } -static void mov_a_r6(void) { R.A = R6; } -static void mov_a_r7(void) { R.A = R7; } -static void mov_a_psw(void) { R.A = R.PSW; } -static void mov_a_xr0(void) { R.A = INTRAM_R(R0); } -static void mov_a_xr1(void) { R.A = INTRAM_R(R1); } -static void mov_r0_a(void) { R0 = R.A; } -static void mov_r1_a(void) { R1 = R.A; } -static void mov_r2_a(void) { R2 = R.A; } -static void mov_r3_a(void) { R3 = R.A; } -static void mov_r4_a(void) { R4 = R.A; } -static void mov_r5_a(void) { R5 = R.A; } -static void mov_r6_a(void) { R6 = R.A; } -static void mov_r7_a(void) { R7 = R.A; } -static void mov_psw_a(void) { R.PSW = R.A; regPTR = ((M_By) ? 24 : 0); R.SP = (R.PSW & 7) << 1; } -static void mov_r0_n(void) { R0 = M_RDMEM_OPCODE(); } -static void mov_r1_n(void) { R1 = M_RDMEM_OPCODE(); } -static void mov_r2_n(void) { R2 = M_RDMEM_OPCODE(); } -static void mov_r3_n(void) { R3 = M_RDMEM_OPCODE(); } -static void mov_r4_n(void) { R4 = M_RDMEM_OPCODE(); } -static void mov_r5_n(void) { R5 = M_RDMEM_OPCODE(); } -static void mov_r6_n(void) { R6 = M_RDMEM_OPCODE(); } -static void mov_r7_n(void) { R7 = M_RDMEM_OPCODE(); } -static void mov_a_t(void) { R.A = R.timer; } -static void mov_t_a(void) { R.timer = R.A; } -static void mov_xr0_a(void) { INTRAM_W(R0, R.A); } -static void mov_xr1_a(void) { INTRAM_W(R1, R.A); } -static void mov_xr0_n(void) { INTRAM_W(R0, M_RDMEM_OPCODE()); } -static void mov_xr1_n(void) { INTRAM_W(R1, M_RDMEM_OPCODE()); } -static void movd_a_p4(void) { R.A = port_r(4) & 0x0F; } -static void movd_a_p5(void) { R.A = port_r(5) & 0x0F; } -static void movd_a_p6(void) { R.A = port_r(6) & 0x0F; } -static void movd_a_p7(void) { R.A = port_r(7) & 0x0F; } -static void movd_p4_a(void) { port_w(4, R.A & 0x0F); } -static void movd_p5_a(void) { port_w(5, R.A & 0x0F); } -static void movd_p6_a(void) { port_w(6, R.A & 0x0F); } -static void movd_p7_a(void) { port_w(7, R.A & 0x0F); } -static void movp_a_xa(void) { R.A = M_RDMEM((R.PC.w.l & 0x0f00) | R.A); } -static void movp3_a_xa(void) { R.A = M_RDMEM(0x300 | R.A); } -static void movx_a_xr0(void) { R.A = M_IN(R0); } -static void movx_a_xr1(void) { R.A = M_IN(R1); } -static void movx_xr0_a(void) { M_OUT(R0, R.A); } -static void movx_xr1_a(void) { M_OUT(R1, R.A); } -static void nop(void) { } -static void orl_a_n(void) { R.A |= M_RDMEM_OPCODE(); } -static void orl_a_r0(void) { R.A |= R0; } -static void orl_a_r1(void) { R.A |= R1; } -static void orl_a_r2(void) { R.A |= R2; } -static void orl_a_r3(void) { R.A |= R3; } -static void orl_a_r4(void) { R.A |= R4; } -static void orl_a_r5(void) { R.A |= R5; } -static void orl_a_r6(void) { R.A |= R6; } -static void orl_a_r7(void) { R.A |= R7; } -static void orl_a_xr0(void) { R.A |= INTRAM_R(R0); } -static void orl_a_xr1(void) { R.A |= INTRAM_R(R1); } -static void orl_bus_n(void) { bus_w( bus_r() | M_RDMEM_OPCODE() ); } -static void orl_p1_n(void) -{ - R.P1 |= M_RDMEM_OPCODE(); - port_w(1, R.P1); -} - -static void orl_p2_n(void) -{ - R.P2 |= M_RDMEM_OPCODE(); - port_w(2, R.P2); -} - -static void orld_p4_a(void) { port_w(4, port_r(4) | R.A ); } -static void orld_p5_a(void) { port_w(5, port_r(5) | R.A ); } -static void orld_p6_a(void) { port_w(6, port_r(6) | R.A ); } -static void orld_p7_a(void) { port_w(7, port_r(7) | R.A ); } -static void outl_bus_a(void) { bus_w(R.A); } -static void outl_p1_a(void) { port_w(1, R.A); R.P1 = R.A; } -static void outl_p2_a(void) { port_w(2, R.A); R.P2 = R.A; } -static void ret(void) { R.PC.w.l = ((pull() & 0x0f) << 8); R.PC.w.l |= pull(); change_pc(R.PC.w.l); } - -static void retr(void) -{ - UINT8 i=pull(); - R.PC.w.l = ((i & 0x0f) << 8) | pull(); - change_pc(R.PC.w.l); - R.PSW = (R.PSW & 0x0f) | (i & 0xf0); /* Stack is already changed by pull */ - regPTR = ((M_By) ? 24 : 0); - - R.irq_executing = I8039_NO_INT; - - /* Take an interrupt if a request is still being made */ - if (R.irq_state == I8039_EXTERNAL_INT) { - R.irq_extra_cycles += Ext_IRQ(); /* Service External IRQ */ - } - else if (R.pending_irq == I8039_TIMCNT_INT) { - R.irq_extra_cycles += Timer_IRQ(); /* Service pending Timer/Counter IRQ */ - } -} -static void rl_a(void) { UINT8 i=R.A & 0x80; R.A <<= 1; if (i) R.A |= 0x01; else R.A &= 0xfe; } -/* NS990113 */ -static void rlc_a(void) { UINT8 i=M_Cy; if (R.A & 0x80) SET(C_FLAG); else CLR(C_FLAG); R.A <<= 1; if (i) R.A |= 0x01; else R.A &= 0xfe; } -static void rr_a(void) { UINT8 i=R.A & 1; R.A >>= 1; if (i) R.A |= 0x80; else R.A &= 0x7f; } -/* NS990113 */ -static void rrc_a(void) { UINT8 i=M_Cy; if (R.A & 1) SET(C_FLAG); else CLR(C_FLAG); R.A >>= 1; if (i) R.A |= 0x80; else R.A &= 0x7f; } -static void sel_mb0(void) { R.A11 = 0x000; } -static void sel_mb1(void) { R.A11 = 0x800; } -static void sel_rb0(void) { CLR(B_FLAG); regPTR = 0; } -static void sel_rb1(void) { SET(B_FLAG); regPTR = 24; } -static void stop_tcnt(void) { R.timerON = R.countON = 0; } -static void strt_cnt(void) { R.countON = 1; R.timerON = 0; R.Old_T1 = test_r(1); } /* NS990113 */ -static void strt_t(void) { R.timerON = 1; R.countON = 0; R.masterClock = 0; } /* NS990113 */ -static void swap_a(void) { UINT8 i=R.A >> 4; R.A <<= 4; R.A |= i; } -static void xch_a_r0(void) { UINT8 i=R.A; R.A=R0; R0=i; } -static void xch_a_r1(void) { UINT8 i=R.A; R.A=R1; R1=i; } -static void xch_a_r2(void) { UINT8 i=R.A; R.A=R2; R2=i; } -static void xch_a_r3(void) { UINT8 i=R.A; R.A=R3; R3=i; } -static void xch_a_r4(void) { UINT8 i=R.A; R.A=R4; R4=i; } -static void xch_a_r5(void) { UINT8 i=R.A; R.A=R5; R5=i; } -static void xch_a_r6(void) { UINT8 i=R.A; R.A=R6; R6=i; } -static void xch_a_r7(void) { UINT8 i=R.A; R.A=R7; R7=i; } -static void xch_a_xr0(void) { UINT8 i=R.A; R.A=INTRAM_R(R0); INTRAM_W(R0, i); } -static void xch_a_xr1(void) { UINT8 i=R.A; R.A=INTRAM_R(R1); INTRAM_W(R1, i); } -static void xchd_a_xr0(void) { M_XCHD(R0); } -static void xchd_a_xr1(void) { M_XCHD(R1); } -static void xrl_a_n(void) { R.A ^= M_RDMEM_OPCODE(); } -static void xrl_a_r0(void) { R.A ^= R0; } -static void xrl_a_r1(void) { R.A ^= R1; } -static void xrl_a_r2(void) { R.A ^= R2; } -static void xrl_a_r3(void) { R.A ^= R3; } -static void xrl_a_r4(void) { R.A ^= R4; } -static void xrl_a_r5(void) { R.A ^= R5; } -static void xrl_a_r6(void) { R.A ^= R6; } -static void xrl_a_r7(void) { R.A ^= R7; } -static void xrl_a_xr0(void) { R.A ^= INTRAM_R(R0); } -static void xrl_a_xr1(void) { R.A ^= INTRAM_R(R1); } - -static const s_opcode opcode_main[256]= -{ - {1, nop },{0, illegal },{2, outl_bus_a},{2, add_a_n },{2, jmp },{1, en_i },{0, illegal },{1, dec_a }, - {2, ins_a_bus },{2, in_a_p1 },{2, in_a_p2 },{0, illegal },{2, movd_a_p4 },{2, movd_a_p5 },{2, movd_a_p6 },{2, movd_a_p7 }, - {1, inc_xr0 },{1, inc_xr1 },{2, jb_0 },{2, adc_a_n },{2, call },{1, dis_i },{2, jtf },{1, inc_a }, - {1, inc_r0 },{1, inc_r1 },{1, inc_r2 },{1, inc_r3 },{1, inc_r4 },{1, inc_r5 },{1, inc_r6 },{1, inc_r7 }, - {1, xch_a_xr0 },{1, xch_a_xr1 },{0, illegal },{2, mov_a_n },{2, jmp_1 },{1, en_tcnti },{2, jnt_0 },{1, clr_a }, - {1, xch_a_r0 },{1, xch_a_r1 },{1, xch_a_r2 },{1, xch_a_r3 },{1, xch_a_r4 },{1, xch_a_r5 },{1, xch_a_r6 },{1, xch_a_r7 }, - {1, xchd_a_xr0 },{1, xchd_a_xr1 },{2, jb_1 },{0, illegal },{2, call_1 },{1, dis_tcnti },{2, jt_0 },{1, cpl_a }, - {0, illegal },{2, outl_p1_a },{2, outl_p2_a },{0, illegal },{2, movd_p4_a },{2, movd_p5_a },{2, movd_p6_a },{2, movd_p7_a }, - {1, orl_a_xr0 },{1, orl_a_xr1 },{1, mov_a_t },{2, orl_a_n },{2, jmp_2 },{1, strt_cnt },{2, jnt_1 },{1, swap_a }, - {1, orl_a_r0 },{1, orl_a_r1 },{1, orl_a_r2 },{1, orl_a_r3 },{1, orl_a_r4 },{1, orl_a_r5 },{1, orl_a_r6 },{1, orl_a_r7 }, - {1, anl_a_xr0 },{1, anl_a_xr1 },{2, jb_2 },{2, anl_a_n },{2, call_2 },{1, strt_t },{2, jt_1 },{1, daa_a }, - {1, anl_a_r0 },{1, anl_a_r1 },{1, anl_a_r2 },{1, anl_a_r3 },{1, anl_a_r4 },{1, anl_a_r5 },{1, anl_a_r6 },{1, anl_a_r7 }, - {1, add_a_xr0 },{1, add_a_xr1 },{1, mov_t_a },{0, illegal },{2, jmp_3 },{1, stop_tcnt },{0, illegal },{1, rrc_a }, - {1, add_a_r0 },{1, add_a_r1 },{1, add_a_r2 },{1, add_a_r3 },{1, add_a_r4 },{1, add_a_r5 },{1, add_a_r6 },{1, add_a_r7 }, - {1, adc_a_xr0 },{1, adc_a_xr1 },{2, jb_3 },{0, illegal },{2, call_3 },{1, ento_clk },{2, jf1 },{1, rr_a }, - {1, adc_a_r0 },{1, adc_a_r1 },{1, adc_a_r2 },{1, adc_a_r3 },{1, adc_a_r4 },{1, adc_a_r5 },{1, adc_a_r6 },{1, adc_a_r7 }, - {2, movx_a_xr0 },{2, movx_a_xr1 },{0, illegal },{2, ret },{2, jmp_4 },{1, clr_f0 },{2, jni },{0, illegal }, - {2, orl_bus_n },{2, orl_p1_n },{2, orl_p2_n },{0, illegal },{2, orld_p4_a },{2, orld_p5_a },{2, orld_p6_a },{2, orld_p7_a }, - {2, movx_xr0_a },{2, movx_xr1_a },{2, jb_4 },{2, retr },{2, call_4 },{1, cpl_f0 },{2, jnz },{1, clr_c }, - {2, anl_bus_n },{2, anl_p1_n },{2, anl_p2_n },{0, illegal },{2, anld_p4_a },{2, anld_p5_a },{2, anld_p6_a },{2, anld_p7_a }, - {1, mov_xr0_a },{1, mov_xr1_a },{0, illegal },{2, movp_a_xa },{2, jmp_5 },{1, clr_f1 },{0, illegal },{1, cpl_c }, - {1, mov_r0_a },{1, mov_r1_a },{1, mov_r2_a },{1, mov_r3_a },{1, mov_r4_a },{1, mov_r5_a },{1, mov_r6_a },{1, mov_r7_a }, - {2, mov_xr0_n },{2, mov_xr1_n },{2, jb_5 },{2, jmpp_xa },{2, call_5 },{1, cpl_f1 },{2, jf0 },{0, illegal }, - {2, mov_r0_n },{2, mov_r1_n },{2, mov_r2_n },{2, mov_r3_n },{2, mov_r4_n },{2, mov_r5_n },{2, mov_r6_n },{2, mov_r7_n }, - {0, illegal },{0, illegal },{0, illegal },{0, illegal },{2, jmp_6 },{1, sel_rb0 },{2, jz },{1, mov_a_psw }, - {1, dec_r0 },{1, dec_r1 },{1, dec_r2 },{1, dec_r3 },{1, dec_r4 },{1, dec_r5 },{1, dec_r6 },{1, dec_r7 }, - {1, xrl_a_xr0 },{1, xrl_a_xr1 },{2, jb_6 },{2, xrl_a_n },{2, call_6 },{1, sel_rb1 },{0, illegal },{1, mov_psw_a }, - {1, xrl_a_r0 },{1, xrl_a_r1 },{1, xrl_a_r2 },{1, xrl_a_r3 },{1, xrl_a_r4 },{1, xrl_a_r5 },{1, xrl_a_r6 },{1, xrl_a_r7 }, - {0, illegal },{0, illegal },{0, illegal },{2, movp3_a_xa},{2, jmp_7 },{1, sel_mb0 },{2, jnc },{1, rl_a }, - {2, djnz_r0 },{2, djnz_r1 },{2, djnz_r2 },{2, djnz_r3 },{2, djnz_r4 },{2, djnz_r5 },{2, djnz_r6 },{2, djnz_r7 }, - {1, mov_a_xr0 },{1, mov_a_xr1 },{2, jb_7 },{0, illegal },{2, call_7 },{1, sel_mb1 },{2, jc },{1, rlc_a }, - {1, mov_a_r0 },{1, mov_a_r1 },{1, mov_a_r2 },{1, mov_a_r3 },{1, mov_a_r4 },{1, mov_a_r5 },{1, mov_a_r6 },{1, mov_a_r7 } -}; - - -static int Ext_IRQ(void) -{ - int extra_cycles = 0; - - if (R.xirq_en) { - if (R.irq_executing == I8039_NO_INT) { -// logerror("I8039: EXT INTERRUPT being serviced\n"); - R.irq_executing = I8039_EXTERNAL_INT; - push(R.PC.b.l); - push((R.PC.b.h & 0x0f) | (R.PSW & 0xf0)); - R.PC.w.l = 0x03; - - extra_cycles = 2; /* 2 clock cycles used */ - - if (R.timerON) /* NS990113 */ - R.masterClock += extra_cycles; - if (R.irq_callback) (*R.irq_callback)(0); - } - } - - return extra_cycles; -} - -static int Timer_IRQ(void) -{ - int extra_cycles = 0; - - if (R.tirq_en) { - if (R.irq_executing == I8039_NO_INT) { -// logerror("I8039: TIMER/COUNTER INTERRUPT\n"); - R.irq_executing = I8039_TIMCNT_INT; - R.pending_irq &= ~I8039_TIMCNT_INT; - push(R.PC.b.l); - push((R.PC.b.h & 0x0f) | (R.PSW & 0xf0)); - R.PC.w.l = 0x07; - change_pc(0x07); - - extra_cycles = 2; /* 2 clock cycles used */ - - if (R.timerON) /* NS990113 */ - R.masterClock += extra_cycles; - } - else { - if (R.irq_executing == I8039_EXTERNAL_INT) { - R.pending_irq |= I8039_TIMCNT_INT; - } - } - } - - R.t_flag = 1; - - return extra_cycles; -} - -void I8039Init(int (*irqcallback)(int)) -{ - DebugCPU_I8039Initted = 1; - - RAM = (UINT8*)malloc(128 * sizeof(UINT8)); - - R.irq_callback = irqcallback; - - R.cpu_feature = 0; - R.ram_mask = 0x7F; - R.int_rom_size = 0x800; - /* not changed on reset*/ - memset(RAM, 0x00, 128); - R.timer = 0; - - I8039IORead = I8039DummyReadIo; - I8039IOWrite = I8039DummyWriteIo; - I8039ProgramRead = I8039DummyReadProg; - I8039ProgramWrite = I8039DummyWriteProg; - I8039CPUReadOp = I8039DummyReadOp; - I8039CPUReadOpArg = I8039DummyReadOpArg; -} - -void N7751Init(int (*irqcallback)(int)) -{ - I8039Init(irqcallback); -} - -void I8039SetIOReadHandler(i8039ReadIoHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039SetIOReadHandler called without init\n")); -#endif - - I8039IORead = handler; -} - -void I8039SetIOWriteHandler(i8039WriteIoHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039SetIOWriteHandler called without init\n")); -#endif - - I8039IOWrite = handler; -} - -void I8039SetProgramReadHandler(i8039ReadProgHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039SetProgramReadHandler called without init\n")); -#endif - - I8039ProgramRead = handler; -} - -void I8039SetProgramWriteHandler(i8039WriteProgHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039SetProgramWriteHandler called without init\n")); -#endif - - I8039ProgramWrite = handler; -} - -void I8039SetCPUOpReadHandler(i8039ReadOpHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039SetCPUOpReadHandler called without init\n")); -#endif - - I8039CPUReadOp = handler; -} - -void I8039SetCPUOpReadArgHandler(i8039ReadOpArgHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039SetCPUOpArgReadHandler called without init\n")); -#endif - - I8039CPUReadOpArg = handler; -} - -void N7751SetIOReadHandler(i8039ReadIoHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("N7751SetIOReadHandler called without init\n")); -#endif - - I8039IORead = handler; -} - -void N7751SetIOWriteHandler(i8039WriteIoHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("N7751SetIOWriteHandler called without init\n")); -#endif - - I8039IOWrite = handler; -} - -void N7751SetProgramReadHandler(i8039ReadProgHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("N7751SetProgramReadHandler called without init\n")); -#endif - - I8039ProgramRead = handler; -} - -void N7751SetProgramWriteHandler(i8039WriteProgHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("N7751SetProgramWriteHandler called without init\n")); -#endif - - I8039ProgramWrite = handler; -} - -void N7751SetCPUOpReadHandler(i8039ReadOpHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("N7751SetCPUOpReadHandler called without init\n")); -#endif - - I8039CPUReadOp = handler; -} - -void N7751SetCPUOpReadArgHandler(i8039ReadOpArgHandler handler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("N7751SetCPUOpReadArgHandler called without init\n")); -#endif - - I8039CPUReadOpArg = handler; -} - -void I8039Exit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039Exit called without init\n")); -#endif - - if (RAM) { - free(RAM); - RAM = NULL; - } - - i8039_ICount = 0; - - DebugCPU_I8039Initted = 0; -} - -void N7751Exit() -{ - I8039Exit(); -} - -int I8039Run(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039Run called without init\n")); -#endif - - unsigned opcode, T1, timerInt; - int count; - - i8039_ICount_cycles = cycles; - i8039_ICount = (cycles - R.irq_extra_cycles); - R.irq_extra_cycles = 0; - - do - { - R.PREVPC = R.PC; - -// CALL_DEBUGGER(R.PC.w.l); - - opcode=M_RDOP(R.PC.w.l); - -/* logerror("I8039: PC = %04x, opcode = %02x\n", R.PC.w.l, opcode); */ - - R.PC.w.l++; - R.inst_cycles = opcode_main[opcode].cycles; - (*(opcode_main[opcode].function))(); - i8039_ICount -= R.inst_cycles; /// - - timerInt = 0; - if (R.countON) /* NS990113 */ - { - for ( ; R.inst_cycles > 0; R.inst_cycles-- ) - { - T1 = test_r(1); - if (POSITIVE_EDGE_T1) - { - R.timer++; - if (R.timer == 0) - timerInt = 1; - } - R.Old_T1 = T1; - } - } - - if (R.timerON) { - R.masterClock += opcode_main[opcode].cycles; - if (R.masterClock >= 32) { /* NS990113 */ - R.masterClock -= 32; - R.timer++; - if (R.timer == 0) - timerInt = 1; - } - } - - if (timerInt) - { - count = Timer_IRQ(); /* Handle Timer IRQ */ - i8039_ICount -= count; - } - - } while (i8039_ICount>0); - - i8039_ICount -= R.irq_extra_cycles; - R.total_cycles += cycles - i8039_ICount; - R.irq_extra_cycles = 0; - - return cycles - i8039_ICount; -} - -INT32 I8039TotalCycles() -{ - return (INT32)R.total_cycles + (i8039_ICount_cycles - i8039_ICount); -} - -void I8039NewFrame() -{ - R.total_cycles = 0; -} - -int N7751Run(int cycles) -{ - return I8039Run(cycles); -} - -void I8039Reset (void) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039Reset called without init\n")); -#endif - - R.PC.w.l = 0; - R.SP = 0; - R.A = 0; - R.PSW = 0x08; /* Start with No Carry, Bit 4 is always SET */ - //R.PSW = C_FLAG | 0x08; - R.P1 = 0xff; - R.P2 = 0xff; - R.bus = 0; - R.irq_executing = I8039_NO_INT; - R.pending_irq = I8039_NO_INT; - - R.A11 = 0; - R.tirq_en = R.xirq_en = 0; - R.timerON = R.countON = 0; - - if (R.cpu_feature & FEATURE_M58715) - { - //R.timerON = 1; /* Mario Bros. doesn't work without this */ - //R.PSW |= C_FLAG; //MB will play startup sound, but wrong # */ - } - R.irq_extra_cycles = 0; - R.masterClock = 0; -} - -void N7751Reset() -{ - I8039Reset(); -} - -void I8039SetIrqState(int state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039SetIrqState called without init\n")); -#endif - - if (state != 0) { - R.irq_state = I8039_EXTERNAL_INT; - R.irq_extra_cycles += Ext_IRQ(); /* Handle External IRQ */ - } - else { - R.irq_state = I8039_NO_INT; - } -} - -void N7751SetIrqState(int state) -{ - I8039SetIrqState(state); -} - -int I8039Scan(int nAction, int *pnMin) -{ -#if defined FBA_DEBUG - if (!DebugCPU_I8039Initted) bprintf(PRINT_ERROR, _T("I8039Scan called without init\n")); -#endif - - struct BurnArea ba; - char szName[16]; - - if (pnMin != NULL) { - *pnMin = 0x029719; - } - - if (nAction & ACB_DRIVER_DATA) { - ScanVar(&R, sizeof(I8039_Regs), "I8039Regs"); - - sprintf(szName, "I8039RAM"); - memset(&ba, 0, sizeof(ba)); - ba.Data = RAM; - ba.nLen = 128; - ba.szName = szName; - BurnAcb(&ba); - - SCAN_VAR(i8039_ICount); - } - - return 0; -} - -int N7751Scan(int nAction, int *pnMin) -{ - return I8039Scan(nAction, pnMin); -} - -#if 0 - -/**************************************************************************** - * Initialize emulation - ****************************************************************************/ - - -#if (HAS_I8035||HAS_I8048||HAS_MB8884) -static void i8035_init (int index, int clock, const void *config, int (*irqcallback)(int)) -{ - i8039_init(index, clock, config, irqcallback); - R.ram_mask = 0x3F; - R.int_rom_size = 0x400; -} -#endif - -#if (HAS_I8749) -static void i8749_init (int index, int clock, const void *config, int (*irqcallback)(int)) -{ - i8039_init(index, clock, config, irqcallback); - - R.ram_mask = 0x7f; - R.int_rom_size = 0x800; -} -#endif - -#if (HAS_M58715) -static void m58715_init (int index, int clock, const void *config, int (*irqcallback)(int)) -{ - i8039_init(index, clock, config, irqcallback); - R.cpu_feature = FEATURE_M58715; -} -#endif /* HAS_M58715 */ - -/**************************************************************************** - * Reset registers to their initial values - ****************************************************************************/ - -/**************************************************************************** - * Shut down CPU emulation - ****************************************************************************/ -static void i8039_exit (void) -{ - /* nothing to do ? */ -} - -/**************************************************************************** - * Issue an interrupt if necessary - ****************************************************************************/ - - -/**************************************************************************** - * Execute cycles CPU cycles. Return number of cycles really executed - ****************************************************************************/ -/**************************************************************************** - * Get all registers in given buffer - ****************************************************************************/ -static void i8039_get_context (void *dst) -{ - if( dst ) - *(I8039_Regs*)dst = R; -} - - -/**************************************************************************** - * Set all registers to given values - ****************************************************************************/ -static void i8039_set_context (void *src) -{ - if( src ) - { - R = *(I8039_Regs*)src; - regPTR = ((M_By) ? 24 : 0); - R.SP = (R.PSW << 1) & 0x0f; - change_pc(R.PC.w.l); - } - /* Handle forced Interrupts throught the Debugger */ - if (R.irq_state != I8039_NO_INT) { - R.irq_extra_cycles += Ext_IRQ(); /* Handle External IRQ */ - } - if (R.timer == 0) { - R.irq_extra_cycles += Timer_IRQ(); /* Handle Timer IRQ */ - } -} - - -/**************************************************************************** - * Set IRQ line state - ****************************************************************************/ - - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static void i8039_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(0, info->i); break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + I8039_PC: R.PC.w.l = info->i; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + I8039_SP: R.SP = info->i; break; - case CPUINFO_INT_REGISTER + I8039_PSW: R.PSW = info->i; break; - case CPUINFO_INT_REGISTER + I8039_A: R.A = info->i; break; - case CPUINFO_INT_REGISTER + I8039_TC: R.timer = info->i; break; - case CPUINFO_INT_REGISTER + I8039_P1: R.P1 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_P2: R.P2 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_R0: R0 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_R1: R1 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_R2: R2 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_R3: R3 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_R4: R4 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_R5: R5 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_R6: R6 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_R7: R7 = info->i; break; - case CPUINFO_INT_REGISTER + I8039_EA: R.EA = info->i; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void i8039_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(R); break; - case CPUINFO_INT_INPUT_LINES: info->i = 1; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 3*5; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 2; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 3; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 12; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + 0: info->i = (R.irq_state == I8039_EXTERNAL_INT) ? ASSERT_LINE : CLEAR_LINE; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = R.PREVPC.w.l; break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + I8039_PC: info->i = R.PC.w.l; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + I8039_SP: info->i = R.SP; break; - case CPUINFO_INT_REGISTER + I8039_PSW: info->i = R.PSW; break; - case CPUINFO_INT_REGISTER + I8039_A: info->i = R.A; break; - case CPUINFO_INT_REGISTER + I8039_TC: info->i = R.timer; break; - case CPUINFO_INT_REGISTER + I8039_P1: info->i = R.P1; break; - case CPUINFO_INT_REGISTER + I8039_P2: info->i = R.P2; break; - case CPUINFO_INT_REGISTER + I8039_R0: info->i = R0; break; - case CPUINFO_INT_REGISTER + I8039_R1: info->i = R1; break; - case CPUINFO_INT_REGISTER + I8039_R2: info->i = R2; break; - case CPUINFO_INT_REGISTER + I8039_R3: info->i = R3; break; - case CPUINFO_INT_REGISTER + I8039_R4: info->i = R4; break; - case CPUINFO_INT_REGISTER + I8039_R5: info->i = R5; break; - case CPUINFO_INT_REGISTER + I8039_R6: info->i = R6; break; - case CPUINFO_INT_REGISTER + I8039_R7: info->i = R7; break; - case CPUINFO_INT_REGISTER + I8039_EA: info->i = R.EA; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = i8039_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = i8039_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = i8039_set_context; break; - case CPUINFO_PTR_INIT: info->init = i8039_init; break; - case CPUINFO_PTR_RESET: info->reset = i8039_reset; break; - case CPUINFO_PTR_EXIT: info->exit = i8039_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = i8039_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; -#ifdef ENABLE_DEBUGGER - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = i8039_dasm; break; -#endif /* ENABLE_DEBUGGER */ - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &i8039_ICount; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "I8039"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Intel 8039"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.2"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Mirko Buffoni\nBased on the original work Copyright Dan Boris"); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c %c%c%c%c%c%c%c%c", - R.A11 ? 'M':'.', - R.PSW & 0x80 ? 'C':'.', - R.PSW & 0x40 ? 'A':'.', - R.PSW & 0x20 ? 'F':'.', - R.PSW & 0x10 ? 'B':'.', - R.PSW & 0x08 ? '?':'.', - R.PSW & 0x04 ? '4':'.', - R.PSW & 0x02 ? '2':'.', - R.PSW & 0x01 ? '1':'.'); - break; - - case CPUINFO_STR_REGISTER + I8039_PC: sprintf(info->s, "PC:%04X", R.PC.w.l); break; - case CPUINFO_STR_REGISTER + I8039_SP: sprintf(info->s, "SP:%02X", R.SP); break; - case CPUINFO_STR_REGISTER + I8039_PSW: sprintf(info->s, "PSW:%02X", R.PSW); break; - case CPUINFO_STR_REGISTER + I8039_A: sprintf(info->s, "A:%02X", R.A); break; - case CPUINFO_STR_REGISTER + I8039_TC: sprintf(info->s, "TC:%02X", R.timer); break; - case CPUINFO_STR_REGISTER + I8039_P1: sprintf(info->s, "P1:%02X", R.P1); break; - case CPUINFO_STR_REGISTER + I8039_P2: sprintf(info->s, "P2:%02X", R.P2); break; - case CPUINFO_STR_REGISTER + I8039_R0: sprintf(info->s, "R0:%02X", R.RAM[R.regPtr+0]); break; - case CPUINFO_STR_REGISTER + I8039_R1: sprintf(info->s, "R1:%02X", R.RAM[R.regPtr+1]); break; - case CPUINFO_STR_REGISTER + I8039_R2: sprintf(info->s, "R2:%02X", R.RAM[R.regPtr+2]); break; - case CPUINFO_STR_REGISTER + I8039_R3: sprintf(info->s, "R3:%02X", R.RAM[R.regPtr+3]); break; - case CPUINFO_STR_REGISTER + I8039_R4: sprintf(info->s, "R4:%02X", R.RAM[R.regPtr+4]); break; - case CPUINFO_STR_REGISTER + I8039_R5: sprintf(info->s, "R5:%02X", R.RAM[R.regPtr+5]); break; - case CPUINFO_STR_REGISTER + I8039_R6: sprintf(info->s, "R6:%02X", R.RAM[R.regPtr+6]); break; - case CPUINFO_STR_REGISTER + I8039_R7: sprintf(info->s, "R7:%02X", R.RAM[R.regPtr+7]); break; - case CPUINFO_STR_REGISTER + I8039_EA: sprintf(info->s, "EA:%02X", R.EA); break; - } -} - - - -#if (HAS_I8035) -/************************************************************************** - * CPU-specific get_info/set_info - **************************************************************************/ -void i8035_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "I8035"); break; - case CPUINFO_PTR_INIT: info->init = i8035_init; break; - - default: i8039_get_info(state, info); break; - } -} -#endif - - -#if (HAS_I8048) -/************************************************************************** - * CPU-specific get_info/set_info - **************************************************************************/ -void i8048_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "I8048"); break; - case CPUINFO_PTR_INIT: info->init = i8035_init; break; - - default: i8039_get_info(state, info); break; - } -} -#endif - -#if (HAS_I8749) -/************************************************************************** - * CPU-specific get_info/set_info - **************************************************************************/ -void i8749_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "I8749"); break; - case CPUINFO_PTR_INIT: info->init = i8749_init; break; - - default: i8039_get_info(state, info); break; - } -} -#endif - -#if (HAS_N7751) -/************************************************************************** - * CPU-specific get_info/set_info - **************************************************************************/ -void n7751_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "N7751"); break; - case CPUINFO_PTR_INIT: info->init = i8039_init; break; - - default: i8039_get_info(state, info); break; - } -} -#endif - -#if (HAS_MB8884) -/************************************************************************** - * CPU-specific get_info/set_info - **************************************************************************/ -void mb8884_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "MB8884"); break; - case CPUINFO_PTR_INIT: info->init = i8035_init; break; - - default: i8039_get_info(state, info); break; - } -} -#endif - -#if (HAS_M58715) -/************************************************************************** - * CPU-specific get_info/set_info - **************************************************************************/ -void m58715_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M58715"); break; - case CPUINFO_PTR_INIT: info->init = m58715_init; break; - - default: i8039_get_info(state, info); break; - } -} -#endif -#endif diff --git a/jan/src/cpu/i8039/i8039.h b/jan/src/cpu/i8039/i8039.h deleted file mode 100644 index 6d5401f91..000000000 --- a/jan/src/cpu/i8039/i8039.h +++ /dev/null @@ -1,296 +0,0 @@ -/************************************************************************** - * Intel 8039 Portable Emulator * - * * - * Copyright Mirko Buffoni * - * Based on the original work Copyright Dan Boris, an 8048 emulator * - * You are not allowed to distribute this software commercially * - * Please, notify me, if you make any changes to this file * - **************************************************************************/ - -#include "driver.h" - -#define HAS_N7751 1 -#define HAS_I8035 0 -#define HAS_I8048 0 -#define HAS_I8749 0 -#define HAS_MB8884 0 -#define HAS_M58715 0 - -/************************************************************************** - Internal Clock divisor - - External Clock is divided internally by 3 to produce the machine state - generator. This is then divided by 5 for the instruction cycle times. - (Each instruction cycle passes through 5 machine states). -*/ - - -enum { I8039_PC=1, I8039_SP, I8039_PSW, I8039_A, I8039_TC, - I8039_P1, I8039_P2, I8039_R0, I8039_R1, I8039_R2, - I8039_R3, I8039_R4, I8039_R5, I8039_R6, I8039_R7, - I8039_EA -}; - -typedef unsigned char (__fastcall *i8039ReadIoHandler)(unsigned int a); -typedef void (__fastcall *i8039WriteIoHandler)(unsigned int a, unsigned char v); -typedef unsigned char (__fastcall *i8039ReadProgHandler)(unsigned int a); -typedef void (__fastcall *i8039WriteProgHandler)(unsigned int a, unsigned char v); -typedef unsigned char (__fastcall *i8039ReadOpHandler)(unsigned int a); -typedef unsigned char (__fastcall *i8039ReadOpArgHandler)(unsigned int a); -extern i8039ReadIoHandler I8039IORead; -extern i8039WriteIoHandler I8039IOWrite; -extern i8039ReadProgHandler I8039ProgramRead; -extern i8039WriteProgHandler I8039ProgramWrite; -extern i8039ReadOpHandler I8039CPUReadOp; -extern i8039ReadOpArgHandler I8039CPUReadOpArg; - -extern int I8039Run(int cycles); -extern void I8039Init(int (*irqcallback)(int)); -extern void I8039SetIOReadHandler(i8039ReadIoHandler handler); -extern void I8039SetIOWriteHandler(i8039WriteIoHandler handler); -extern void I8039SetProgramReadHandler(i8039ReadProgHandler handler); -extern void I8039SetProgramWriteHandler(i8039WriteProgHandler handler); -extern void I8039SetCPUOpReadHandler(i8039ReadOpHandler handler); -extern void I8039SetCPUOpReadArgHandler(i8039ReadOpArgHandler handler); -extern void I8039Exit(); -extern void I8039Reset (void); -extern void I8039SetIrqState(int state); -extern int I8039Scan(int nAction,int *pnMin); - -extern int N7751Run(int cycles); -extern void N7751Init(int (*irqcallback)(int)); -extern void N7751SetIOReadHandler(i8039ReadIoHandler handler); -extern void N7751SetIOWriteHandler(i8039WriteIoHandler handler); -extern void N7751SetProgramReadHandler(i8039ReadProgHandler handler); -extern void N7751SetProgramWriteHandler(i8039WriteProgHandler handler); -extern void N7751SetCPUOpReadHandler(i8039ReadOpHandler handler); -extern void N7751SetCPUOpReadArgHandler(i8039ReadOpArgHandler handler); -extern void N7751Exit(); -extern void N7751Reset (void); -extern void N7751SetIrqState(int state); -extern int N7751Scan(int nAction,int *pnMin); - -extern INT32 I8039TotalCycles(); -extern void I8039NewFrame(); - -/* - * Input a UINT8 from given I/O port - */ -#define I8039_In(Port) ((UINT8)I8039IORead(Port)) - - -/* - * Output a UINT8 to given I/O port - */ -#define I8039_Out(Port,Value) (I8039IOWrite(Port,Value)) - - -/* - * Read a UINT8 from given memory location - */ -#define I8039_RDMEM(A) ((unsigned)I8039ProgramRead(A)) - - -/* - * Write a UINT8 to given memory location - */ -#define I8039_WRMEM(A,V) (I8039ProgramWrite(A,V)) - - -/* - * I8039_RDOP() is identical to I8039_RDMEM() except it is used for reading - * opcodes. In case of system with memory mapped I/O, this function can be - * used to greatly speed up emulation - */ -#define I8039_RDOP(A) ((unsigned)I8039CPUReadOp(A)) - - -/* - * I8039_RDOP_ARG() is identical to I8039_RDOP() except it is used for reading - * opcode arguments. This difference can be used to support systems that - * use different encoding mechanisms for opcodes and opcode arguments - */ -#define I8039_RDOP_ARG(A) ((unsigned)I8039CPUReadOpArg(A)) - - - - - -#if 0 -extern void i8039_get_info(UINT32 state, cpuinfo *info); -#endif - -/* This handling of special I/O ports should be better for actual MAME - * architecture. (i.e., define access to ports { I8039_p1, I8039_p1, dkong_out_w }) - */ - -#define I8039_p0 0x100 /* Not used */ -#define I8039_p1 0x101 -#define I8039_p2 0x102 -#define I8039_p4 0x104 -#define I8039_p5 0x105 -#define I8039_p6 0x106 -#define I8039_p7 0x107 -#define I8039_t0 0x110 -#define I8039_t1 0x111 -/* EA is activelow input on real hardware. It is treated - * as active high here to remain compatible with existing drivers! */ -#define I8039_ea 0x112 -#define I8039_bus 0x120 - -/************************************************************************** - * I8035 section - **************************************************************************/ -#if (HAS_I8035) -#define I8035_PC I8039_PC -#define I8035_SP I8039_SP -#define I8035_PSW I8039_PSW -#define I8035_A I8039_A -#define I8035_TC I8039_TC -#define I8035_P1 I8039_P1 -#define I8035_P2 I8039_P2 -#define I8035_R0 I8039_R0 -#define I8035_R1 I8039_R1 -#define I8035_R2 I8039_R2 -#define I8035_R3 I8039_R3 -#define I8035_R4 I8039_R4 -#define I8035_R5 I8039_R5 -#define I8035_R6 I8039_R6 -#define I8035_R7 I8039_R7 - -#define i8035_ICount i8039_ICount - -extern void i8035_get_info(UINT32 state, cpuinfo *info); -#endif - -/************************************************************************** - * I8048 section - **************************************************************************/ -#if (HAS_I8048) -#define I8048_PC I8039_PC -#define I8048_SP I8039_SP -#define I8048_PSW I8039_PSW -#define I8048_A I8039_A -#define I8048_TC I8039_TC -#define I8048_P1 I8039_P1 -#define I8048_P2 I8039_P2 -#define I8048_R0 I8039_R0 -#define I8048_R1 I8039_R1 -#define I8048_R2 I8039_R2 -#define I8048_R3 I8039_R3 -#define I8048_R4 I8039_R4 -#define I8048_R5 I8039_R5 -#define I8048_R6 I8039_R6 -#define I8048_R7 I8039_R7 - -#define i8048_ICount i8039_ICount - -extern void i8048_get_info(UINT32 state, cpuinfo *info); -#endif - -/************************************************************************** - * I8749 section - **************************************************************************/ -#if (HAS_I8749) -#define I8749_PC I8039_PC -#define I8749_SP I8039_SP -#define I8749_PSW I8039_PSW -#define I8749_A I8039_A -#define I8749_TC I8039_TC -#define I8749_P1 I8039_P1 -#define I8749_P2 I8039_P2 -#define I8749_R0 I8039_R0 -#define I8749_R1 I8039_R1 -#define I8749_R2 I8039_R2 -#define I8749_R3 I8039_R3 -#define I8749_R4 I8039_R4 -#define I8749_R5 I8039_R5 -#define I8749_R6 I8039_R6 -#define I8749_R7 I8039_R7 - -#define i8749_ICount i8039_ICount - -extern void i8749_get_info(UINT32 state, cpuinfo *info); -#endif - -/************************************************************************** - * N7751 section - **************************************************************************/ -#if (HAS_N7751) -#define N7751_PC I8039_PC -#define N7751_SP I8039_SP -#define N7751_PSW I8039_PSW -#define N7751_A I8039_A -#define N7751_TC I8039_TC -#define N7751_P1 I8039_P1 -#define N7751_P2 I8039_P2 -#define N7751_R0 I8039_R0 -#define N7751_R1 I8039_R1 -#define N7751_R2 I8039_R2 -#define N7751_R3 I8039_R3 -#define N7751_R4 I8039_R4 -#define N7751_R5 I8039_R5 -#define N7751_R6 I8039_R6 -#define N7751_R7 I8039_R7 - -#define n7751_ICount i8039_ICount - -#if 0 -extern void n7751_get_info(UINT32 state, cpuinfo *info); -#endif -#endif - -/************************************************************************** - * MB8884 section - **************************************************************************/ -#if (HAS_MB8884) -#define MB8884_PC I8039_PC -#define MB8884_SP I8039_SP -#define MB8884_PSW I8039_PSW -#define MB8884_A I8039_A -#define MB8884_TC I8039_TC -#define MB8884_P1 I8039_P1 -#define MB8884_P2 I8039_P2 -#define MB8884_R0 I8039_R0 -#define MB8884_R1 I8039_R1 -#define MB8884_R2 I8039_R2 -#define MB8884_R3 I8039_R3 -#define MB8884_R4 I8039_R4 -#define MB8884_R5 I8039_R5 -#define MB8884_R6 I8039_R6 -#define MB8884_R7 I8039_R7 - -#define mb8884_ICount i8039_ICount - -extern void mb8884_get_info(UINT32 state, cpuinfo *info); -#endif - -/************************************************************************** - * M58715 section - **************************************************************************/ -#if (HAS_M58715) -#define M58715_PC I8039_PC -#define M58715_SP I8039_SP -#define M58715_PSW I8039_PSW -#define M58715_A I8039_A -#define M58715_TC I8039_TC -#define M58715_P1 I8039_P1 -#define M58715_P2 I8039_P2 -#define M58715_R0 I8039_R0 -#define M58715_R1 I8039_R1 -#define M58715_R2 I8039_R2 -#define M58715_R3 I8039_R3 -#define M58715_R4 I8039_R4 -#define M58715_R5 I8039_R5 -#define M58715_R6 I8039_R6 -#define M58715_R7 I8039_R7 - -#define m58715_ICount i8039_ICount - -extern void m58715_get_info(UINT32 state, cpuinfo *info); -#endif - -#ifdef ENABLE_DEBUGGER -offs_t i8039_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -#endif - diff --git a/jan/src/cpu/i8051/mcs51.cpp b/jan/src/cpu/i8051/mcs51.cpp deleted file mode 100644 index 57c92949f..000000000 --- a/jan/src/cpu/i8051/mcs51.cpp +++ /dev/null @@ -1,2826 +0,0 @@ -/***************************************************************************** - * - * i8051.c - * Portable MCS-51 Family Emulator - * - * Chips in the family: - * 8051 Product Line (8031,8051,8751) - * 8052 Product Line (8032,8052,8752) - * 8054 Product Line (8054) - * 8058 Product Line (8058) - * - * Copyright Steve Ellenoff, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - * This work is based on: - * #1) 'Intel(tm) MC51 Microcontroller Family Users Manual' and - * #2) 8051 simulator by Travis Marlatte - * #3) Portable UPI-41/8041/8741/8042/8742 emulator V0.1 by Juergen Buchmueller (MAME CORE) - * - *****************************************************************************/ - -/***************************************************************************** - * DS5002FP emulator by Manuel Abadia - * - * October 2008, couriersud: Merged back in mcs51 - * - * What has been added? - * - Extra SFRs - * - Bytewide Bus Support - * - Memory Partition and Memory Range - * - Bootstrap Configuration - * - Power Fail Interrupt - * - Timed Access - * - Stop Mode - * - Idle Mode - * - * What is not implemented? - * - Peripherals and Reprogrammable Peripheral Controller - * - CRC-16 - * - Watchdog timer - * - * The main features of the DS5002FP are: - * - 100% code-compatible with 8051 - * - Directly addresses 64kB program/64kB data memory - * - Nonvolatile memory control circuitry - * - 10-year data retention in the absence of power - * - In-system reprogramming via serial port - * - Dedicated memory bus, preserving four 8-bit ports for general purpose I/O - * - Power-fail reset - * - Early warning power-fail interrupt - * - Watchdog timer - * - Accesses up to 128kB on the bytewide bus - * - Decodes memory for 32kB x 8 or 128kB x 8 SRAMs - * - Four additional decoded peripheral-chip enables - * - CRC hardware for checking memory validity - * - Optionally emulates an 8042-style slave interface - * - Memory encryption using an 80-bit encryption key - * - Automatic random generation of encryption keys - * - Self-destruct input for tamper protection - * - Optional top-coating prevents microprobe - * - *****************************************************************************/ - -/****************************************************************************** - * Notes: - * - * The term cycles is used here to really refer to clock oscilations, because 1 machine cycle - * actually takes 12 oscilations. - * - * Read/Write/Modify Instruction - - * Data is read from the Port Latch (not the Port Pin!), possibly modified, and - * written back to (the pin? and) the latch! - * - * The following all perform this on a port address.. - * (anl, orl, xrl, jbc, cpl, inc, dec, djnz, mov px.y,c, clr px.y, setb px.y) - * - * Serial UART emulation is not really accurate, but faked enough to work as far as i can tell - * - * August 27,2003: Currently support for only 8031/8051/8751 chips (ie 128 RAM) - * October 14,2003: Added initial support for the 8752 (ie 256 RAM) - * October 22,2003: Full support for the 8752 (ie 256 RAM) - * July 28,2004: Fixed MOVX command and added External Ram Paging Support - * July 31,2004: Added Serial Mode 0 Support & Fixed Interrupt Flags for Serial Port - * - * October, 2008, Couriersud - Major rewrite - * - *****************************************************************************/ - -/* TODO: Varios - * - EA pin - defined by architecture, must implement: - * 1 means external access, bypassing internal ROM - * - T0 output clock ? - * - * - Implement 80C52 extended serial capabilities - * - Fix serial communication - This is a big hack (but working) right now. - * - Implement 83C751 in sslam.c - * - Fix cardline.c - * most likely due to different behaviour of I/O pins. The boards - * actually use 80CXX, i.e. CMOS versions. - * "Normal" 805X will return a 0 if reading from a output port which has - * a 0 written to it's latch. At least cardline expects a 1 here. - * - * Done: (Couriersud) - * - Merged DS5002FP - * - Disassembler now uses type specific memory names - * - Merged DS5002FP disasm - * - added 83C751 memory names to disassembler - * - Pointer-ified - * - Implemented cmos features - * - Implemented 80C52 interrupt handling - * - Fix segas18.c (segaic16.c) memory handling. - * - Fix sslam.c - * - Fix limenko.c videopkr.c : Issue with core allocation of ram (duplicate savestate) - * - Handle internal ram better (debugger visible) - * - Fixed port reading - * - Rewrote Macros for better readibility - * - Fixed and rewrote Interrupt handling - * - Now returns INTERNAL_DIVIDER, adjusted cycle counts - * - Remove unnecessary and duplicated code - * - Remove unnecessary functions - * - Rewrite to have sfr-registers stored in int_ram. - * - Debugger may now watch sfr-registers as well. - * - implemented interrupt callbacks (HOLD_LINE now supported) - * - Runtime switch for processor type - remove ifdefs - * - internal memory maps for internal rom versions (internal ram now displayed in debugger) - * - more timer cleanups from manual - */ - -#include "burnint.h" -#include "mcs51.h" - -#define VERBOSE 0 -#define CLEAR_LINE 0 -#define INLINE inline -//#define LOG(x) do { if (VERBOSE) logerror x; } while (0) -#define LOG(x) -#define fatalerror(x) - -/*************************************************************************** - CONSTANTS -***************************************************************************/ - -enum -{ - FEATURE_NONE = 0x00, - FEATURE_I8052 = 0x01, - FEATURE_CMOS = 0x02, - FEATURE_I80C52 = 0x04, - FEATURE_DS5002FP = 0x08 -}; - -/* Internal address in SFR of registers */ -enum -{ - ADDR_PSW = 0xd0, - ADDR_ACC = 0xe0, - ADDR_B = 0xf0, - - ADDR_P0 = 0x80, - ADDR_SP = 0x81, - ADDR_DPL = 0x82, - ADDR_DPH = 0x83, - ADDR_PCON = 0x87, - ADDR_TCON = 0x88, - ADDR_TMOD = 0x89, - ADDR_TL0 = 0x8a, - ADDR_TL1 = 0x8b, - ADDR_TH0 = 0x8c, - ADDR_TH1 = 0x8d, - ADDR_P1 = 0x90, - ADDR_SCON = 0x98, - ADDR_SBUF = 0x99, - ADDR_P2 = 0xa0, - ADDR_IE = 0xa8, - ADDR_P3 = 0xb0, - ADDR_IP = 0xb8, - - /* 8052 Only registers */ - ADDR_T2CON = 0xc8, - ADDR_RCAP2L = 0xca, - ADDR_RCAP2H = 0xcb, - ADDR_TL2 = 0xcc, - ADDR_TH2 = 0xcd, - - /* 80C52 Only registers */ - ADDR_IPH = 0xb7, - ADDR_SADDR = 0xa9, - ADDR_SADEN = 0xb9, - - /* Philips 80C52 */ - ADDR_AUXR = 0x8e, - ADDR_AUXR1 = 0xa2, - - /* DS5002FP */ - ADDR_CRCR = 0xc1, - ADDR_CRCL = 0xc2, - ADDR_CRCH = 0xc3, - ADDR_MCON = 0xc6, - ADDR_TA = 0xc7, - ADDR_RNR = 0xcf, - ADDR_RPCTL = 0xd8, - ADDR_RPS = 0xda - -}; - -/* PC vectors */ - -enum -{ - V_RESET = 0x000, /* power on address */ - V_IE0 = 0x003, /* External Interrupt 0 */ - V_TF0 = 0x00b, /* Timer 0 Overflow */ - V_IE1 = 0x013, /* External Interrupt 1 */ - V_TF1 = 0x01b, /* Timer 1 Overflow */ - V_RITI = 0x023, /* Serial Receive/Transmit */ - - /* 8052 Only Vectors */ - V_TF2 = 0x02b, /* Timer 2 Overflow */ - - /* DS5002FP */ - V_PFI = 0x02b /* Power Failure Interrupt */ -}; - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -typedef struct _mcs51_uart mcs51_uart; -struct _mcs51_uart -{ - UINT8 data_out; //Data to send out - UINT8 bits_to_send; //How many bits left to send when transmitting out the serial port - - int smod_div; /* signal divided by 2^SMOD */ - int rx_clk; /* rx clock */ - int tx_clk; /* tx clock */ - UINT8 delay_cycles; //Gross Hack; -}; - -UINT8 *mcs51_program_data = NULL; -static UINT8 (*cpu_readop_arg_dat)(INT32) = NULL; -static void (*mcs51_write_port)(INT32,UINT8) = NULL; -static UINT8 (*mcs51_read_port)(INT32) = NULL; - -static UINT8 mcs51_readop_arg_dat(INT32 address) -{ - return mcs51_program_data[((address)&0xfff)]; -} - -static UINT8 ds5002fp_readop_arg_dat(INT32 address) -{ - return mcs51_program_data[((address)&0x7fff)]; -} - -void mcs51_set_write_handler(void (*pointer)(INT32,UINT8)) -{ - mcs51_write_port = pointer; -} - -void mcs51_set_read_handler(UINT8 (*pointer)(INT32)) -{ - mcs51_read_port = pointer; -} - -static UINT8 io_read_byte(INT32 offset) -{ - if (mcs51_read_port) { - return mcs51_read_port(offset); - } - - return 0; -} - -static void io_write_byte(INT32 offset, UINT8 data) -{ - if (mcs51_write_port) { - mcs51_write_port(offset,data); - return; - } -} - -typedef struct _mcs51_state_t mcs51_state_t; -struct _mcs51_state_t -{ - //Internal stuff - UINT16 ppc; //previous pc - UINT16 pc; //current pc - UINT16 features; //features of this cpu - UINT8 rwm; //Signals that the current instruction is a read/write/modify instruction - - int inst_cycles; /* cycles for the current instruction */ - int ram_mask; /* second ram bank for indirect access available ? */ - int num_interrupts; /* number of interrupts supported */ - int recalc_parity; /* recalculate parity before next instruction */ - UINT32 last_line_state; /* last state of input lines line */ - int t0_cnt; /* number of 0->1 transistions on T0 line */ - int t1_cnt; /* number of 0->1 transistions on T1 line */ - int t2_cnt; /* number of 0->1 transistions on T2 line */ - int t2ex_cnt; /* number of 0->1 transistions on T2EX line */ - int cur_irq_prio; /* Holds value of the current IRQ Priority Level; -1 if no irq */ - UINT8 irqHOLD; // Auto-Clear IRQ (CPU_IRQSTATUS_HOLD mode) - UINT8 irq_active; /* mask which irq levels are serviced */ - UINT8 irq_prio[8]; /* interrupt priority */ - - int icount; - - mcs51_uart uart; /* internal uart */ - - /* Internal Ram */ - UINT8 internal_ram[0xff+1]; /* 128 RAM (8031/51) + 128 RAM in second bank (8032/52) */ - UINT8 sfr_ram[0xff]; /* 128 SFR - these are in 0x80 - 0xFF */ - - /* SFR Callbacks */ - ALIGN_VAR(8) void (*sfr_write)(INT32 offset, UINT8 data); - ALIGN_VAR(8) UINT8 (*sfr_read)(INT32 offset); - - /* Interrupt Callback */ - //device_irq_callback irq_callback; - - /* Serial Port TX/RX Callbacks */ - // TODO: Move to special port r/w - //mcs51_serial_tx_func serial_tx_callback; //Call back funciton when sending data out of serial port - //mcs51_serial_rx_func serial_rx_callback; //Call back function to retrieve data when receiving serial port data - - /* DS5002FP */ - struct { - UINT8 previous_ta; /* Previous Timed Access value */ - UINT8 ta_window; /* Limed Access window */ - UINT8 range; /* Memory Range */ - ds5002fp_config config; /* Bootstrap Configuration */ - } ds5002fp; -}; - -mcs51_state_t mcs51_state; - -/*************************************************************************** - MACROS -***************************************************************************/ - -/* Read Opcode/Opcode Arguments from Program Code */ -#define ROP(pc) cpu_readop_arg_dat(pc) -#define ROP_ARG(pc) cpu_readop_arg_dat(pc) - -/* Read a byte from External Code Memory (Usually Program Rom(s) Space) */ -#define CODEMEM_R(a) (UINT8)cpu_readop_arg_dat(a) - -/* Read/Write a byte from/to External Data Memory (Usually RAM or other I/O) */ -#define DATAMEM_R(a) ((UINT8)io_read_byte(a)) -#define DATAMEM_W(a,v) io_write_byte(a,v) - -/* Read/Write a byte from/to the Internal RAM */ - -#define IRAM_R(a) iram_read(a) -#define IRAM_W(a, d) iram_write(a, d) - -/* Read/Write a byte from/to the Internal RAM indirectly */ -/* (called from indirect addressing) */ -static INLINE UINT8 iram_iread(INT32 a) { return (a <= mcs51_state.ram_mask) ? mcs51_state.internal_ram[a] : 0xff; } -static INLINE void iram_iwrite(INT32 a, UINT8 d) { if (a <= mcs51_state.ram_mask) mcs51_state.internal_ram[a] = d; } - -#define IRAM_IR(a) iram_iread(a) -#define IRAM_IW(a, d) iram_iwrite(a, d) - -/* Form an Address to Read/Write to External RAM indirectly */ -/* (called from indirect addressing) */ -#define ERAM_ADDR(a,m) external_ram_iaddr(a,m) - -/* Read/Write a bit from Bit Addressable Memory */ -#define BIT_R(a) bit_address_r(a) -#define BIT_W(a,v) bit_address_w(a, v) - -/* Input/Output a byte from given I/O port */ -#define IN(port) ((UINT8)io_read_byte(port)) -#define OUT(port,value) io_write_byte(port,value) - - -/*************************************************************************** - SHORTCUTS -***************************************************************************/ - -#define PPC mcs51_state.ppc -#define PC mcs51_state.pc -#define RWM mcs51_state.rwm - -/* SFR Registers - These are accessed directly for speed on read */ -/* Read accessors */ - -#define SFR_A(a) mcs51_state.sfr_ram[(a)] -#define SET_SFR_A(a,v) do { SFR_A(a) = (v); } while (0) - -#define ACC ((const UINT8) SFR_A(ADDR_ACC)) -#define PSW ((const UINT8) SFR_A(ADDR_PSW)) - -#define P0 ((const UINT8) SFR_A(ADDR_P0)) -#define P1 ((const UINT8) SFR_A(ADDR_P1)) -#define P2 ((const UINT8) SFR_A(ADDR_P2)) -#define P3 ((const UINT8) SFR_A(ADDR_P3)) - -#define SP SFR_A(ADDR_SP) -#define DPL SFR_A(ADDR_DPL) -#define DPH SFR_A(ADDR_DPH) -#define PCON SFR_A(ADDR_PCON) -#define TCON SFR_A(ADDR_TCON) -#define TMOD SFR_A(ADDR_TMOD) -#define TL0 SFR_A(ADDR_TL0) -#define TL1 SFR_A(ADDR_TL1) -#define TH0 SFR_A(ADDR_TH0) -#define TH1 SFR_A(ADDR_TH1) -#define SCON SFR_A(ADDR_SCON) -#define IE SFR_A(ADDR_IE) -#define IP SFR_A(ADDR_IP) -#define B SFR_A(ADDR_B) -#define SBUF SFR_A(ADDR_SBUF) - -#define R_REG(r) mcs51_state.internal_ram[(r) | (PSW & 0x18)] -#define DPTR ((DPH<<8) | DPL) - -/* 8052 Only registers */ -#define T2CON SFR_A(ADDR_T2CON) -#define RCAP2L SFR_A(ADDR_RCAP2L) -#define RCAP2H SFR_A(ADDR_RCAP2H) -#define TL2 SFR_A(ADDR_TL2) -#define TH2 SFR_A(ADDR_TH2) - -/* 80C52 Only registers */ -#define IPH SFR_A(ADDR_IPH) -#define SADDR SFR_A(ADDR_SADDR) -#define SADEN SFR_A(ADDR_SADEN) - -/* Philips 80C52 */ -/* ============= */ -/* Reduced EMI Mode - * The AO bit (AUXR.0) in the AUXR register when set disables the - * ALE output. - */ -#define AUXR SFR_A(ADDR_AUXR) - -/* The dual DPTR structure (see Figure 12) is a way by which the - * 80C52/54/58 will specify the address of an external data memory - * location. There are two 16-bit DPTR registers that address the - * external memory, and a single bit called DPS = AUXR1/bit0 that - * allows the program code to switch between them. - */ -#define AUXR1 SFR_A(ADDR_AUXR1) - -/* DS5002FP only registers */ -#define CRCR SFR_A(ADDR_CRCR) -#define CRCL SFR_A(ADDR_CRCL) -#define CRCH SFR_A(ADDR_CRCH) -#define MCON SFR_A(ADDR_MCON) -#define TA SFR_A(ADDR_TA) -#define RNR SFR_A(ADDR_RNR) -#define RPCTL SFR_A(ADDR_RPCTL) -#define RPS SFR_A(ADDR_RPS) - - -/* WRITE accessors */ - -/* Shortcuts */ - -#define SET_PSW(v) do { SFR_A(ADDR_PSW) = (v); SET_PARITY(); } while (0) -#define SET_ACC(v) do { SFR_A(ADDR_ACC) = (v); SET_PARITY(); } while (0) - -/* These trigger actions on modification and have to be written through SFR_W */ -#define SET_P0(v) IRAM_W(ADDR_P0, v) -#define SET_P1(v) IRAM_W(ADDR_P1, v) -#define SET_P2(v) IRAM_W(ADDR_P2, v) -#define SET_P3(v) IRAM_W(ADDR_P3, v) - -/* Within the cpu core, do not trigger a send */ -#define SET_SBUF(v) SET_SFR_A(ADDR_SBUF, v) - -/* No actions triggered on write */ -#define SET_REG(r, v) do { mcs51_state.internal_ram[(r) | (PSW & 0x18)] = (v); } while (0) - -#define SET_DPTR(n) do { DPH = ((n) >> 8) & 0xff; DPL = (n) & 0xff; } while (0) - -/* Macros for Setting Flags */ -#define SET_X(R, v) do { R = (v);} while (0) - -#define SET_CY(n) SET_PSW((PSW & 0x7f) | (n<<7)) //Carry Flag -#define SET_AC(n) SET_PSW((PSW & 0xbf) | (n<<6)) //Aux.Carry Flag -#define SET_FO(n) SET_PSW((PSW & 0xdf) | (n<<5)) //User Flag -#define SET_RS(n) SET_PSW((PSW & 0xe7) | (n<<3)) //R Bank Select -#define SET_OV(n) SET_PSW((PSW & 0xfb) | (n<<2)) //Overflow Flag -#define SET_P(n) SET_PSW((PSW & 0xfe) | (n<<0)) //Parity Flag - -#define SET_BIT(R, n, v) do { R = (R & ~(1<<(n))) | ((v) << (n));} while (0) -#define GET_BIT(R, n) (((R)>>(n)) & 0x01) - -#define SET_EA(n) SET_BIT(IE, 7, n) //Global Interrupt Enable/Disable -#define SET_ES(n) SET_BIT(IE, 4, v) //Serial Interrupt Enable/Disable -#define SET_ET1(n) SET_BIT(IE, 3, n) //Timer 1 Interrupt Enable/Disable -#define SET_EX1(n) SET_BIT(IE, 2, n) //External Int 1 Interrupt Enable/Disable -#define SET_ET0(n) SET_BIT(IE, 1, n) //Timer 0 Interrupt Enable/Disable -#define SET_EX0(n) SET_BIT(IE, 0, n) //External Int 0 Interrupt Enable/Disable -/* 8052 Only flags */ -#define SET_ET2(n) SET_BIT(IE, 5, n) //Timer 2 Interrupt Enable/Disable - -/* 8052 Only flags */ -#define SET_PT2(n) SET_BIT(IP, 5, n); //Set Timer 2 Priority Level - -#define SET_PS0(n) SET_BIT(IP, 4, n) //Set Serial Priority Level -#define SET_PT1(n) SET_BIT(IP, 3, n) //Set Timer 1 Priority Level -#define SET_PX1(n) SET_BIT(IP, 2, n) //Set External Int 1 Priority Level -#define SET_PT0(n) SET_BIT(IP, 1, n) //Set Timer 0 Priority Level -#define SET_PX0(n) SET_BIT(IP, 0, n) //Set External Int 0 Priority Level - -#define SET_TF1(n) SET_BIT(TCON, 7, n) //Indicated Timer 1 Overflow Int Triggered -#define SET_TR1(n) SET_BIT(TCON, 6, n) //IndicateS Timer 1 is running -#define SET_TF0(n) SET_BIT(TCON, 5, n) //Indicated Timer 0 Overflow Int Triggered -#define SET_TR0(n) SET_BIT(TCON, 4, n) //IndicateS Timer 0 is running -#define SET_IE1(n) SET_BIT(TCON, 3, n) //Indicated External Int 1 Triggered -#define SET_IT1(n) SET_BIT(TCON, 2, n) //Indicates how External Int 1 is Triggered -#define SET_IE0(n) SET_BIT(TCON, 1, n) //Indicated External Int 0 Triggered -#define SET_IT0(n) SET_BIT(TCON, 0, n) //Indicates how External Int 0 is Triggered - -#define SET_SM0(n) SET_BIT(SCON, 7, n) //Sets Serial Port Mode -#define SET_SM1(n) SET_BIT(SCON, 6, n) //Sets Serial Port Mode -#define SET_SM2(n) SET_BIT(SCON, 5, n) //Sets Serial Port Mode (Multiprocesser mode) -#define SET_REN(n) SET_BIT(SCON, 4, n) //Sets Serial Port Receive Enable -#define SET_TB8(n) SET_BIT(SCON, 3, n) //Transmit 8th Bit -#define SET_RB8(n) SET_BIT(SCON, 2, n) //Receive 8th Bit -#define SET_TI(n) SET_BIT(SCON, 1, n) //Indicates Transmit Interrupt Occurred -#define SET_RI(n) SET_BIT(SCON, 0, n) //Indicates Receive Interrupt Occurred - -#define SET_GATE1(n) SET_BIT(TMOD, 7, n) //Timer 1 Gate Mode -#define SET_CT1(n) SET_BIT(TMOD, 6, n) //Timer 1 Counter Mode -#define SET_M1_1(n) SET_BIT(TMOD, 5, n) //Timer 1 Timer Mode Bit 1 -#define SET_M1_0(n) SET_BIT(TMOD, 4, n) //Timer 1 Timer Mode Bit 0 -#define SET_GATE0(n) SET_BIT(TMOD, 3, n) //Timer 0 Gate Mode -#define SET_CT0(n) SET_BIT(TMOD, 2, n) //Timer 0 Counter Mode -#define SET_M0_1(n) SET_BIT(TMOD, 1, n) //Timer 0 Timer Mode Bit 1 -#define SET_M0_0(n) SET_BIT(TMOD, 0, n) //Timer 0 Timer Mode Bit 0 - - - -/* 8052 Only flags - T2CON Flags */ -#define SET_TF2(n) SET_BIT(T2CON, 7, n) //Indicated Timer 2 Overflow Int Triggered -#define SET_EXF2(n) SET_BIT(T2CON, 6, n) //Indicates Timer 2 External Flag -#define SET_RCLK(n) SET_BIT(T2CON, 5, n) //Receive Clock -#define SET_TCLK(n) SET_BIT(T2CON, 4, n) //Transmit Clock -#define SET_EXEN2(n) SET_BIT(T2CON, 3, n) //Timer 2 External Interrupt Enable -#define SET_TR2(n) SET_BIT(T2CON, 2, n) //Indicates Timer 2 is running -#define SET_CT2(n) SET_BIT(T2CON, 1, n) //Sets Timer 2 Counter/Timer Mode -#define SET_CP(n) SET_BIT(T2CON, 0, n) //Sets Timer 2 Capture/Reload Mode - -#define SET_GF1(n) SET_BIT(PCON, 3, n) -#define SET_GF0(n) SET_BIT(PCON, 2, n) -#define SET_PD(n) SET_BIT(PCON, 1, n) -#define SET_IDL(n) SET_BIT(PCON, 0, n) - -/* Macros for accessing flags */ - -#define GET_CY GET_BIT(PSW, 7) -#define GET_AC GET_BIT(PSW, 6) -#define GET_FO GET_BIT(PSW, 5) -#define GET_RS GET_BIT(PSW, 3) -#define GET_OV GET_BIT(PSW, 2) -#define GET_P GET_BIT(PSW, 0) - -#define GET_EA GET_BIT(IE, 7) -#define GET_ET2 GET_BIT(IE, 5) -#define GET_ES GET_BIT(IE, 4) -#define GET_ET1 GET_BIT(IE, 3) -#define GET_EX1 GET_BIT(IE, 2) -#define GET_ET0 GET_BIT(IE, 1) -#define GET_EX0 GET_BIT(IE, 0) - -/* 8052 Only flags */ -#define GET_PT2 GET_BIT(IP, 5) - -#define GET_PS GET_BIT(IP, 4) -#define GET_PT1 GET_BIT(IP, 3) -#define GET_PX1 GET_BIT(IP, 2) -#define GET_PT0 GET_BIT(IP, 1) -#define GET_PX0 GET_BIT(IP, 0) - -#define GET_TF1 GET_BIT(TCON, 7) -#define GET_TR1 GET_BIT(TCON, 6) -#define GET_TF0 GET_BIT(TCON, 5) -#define GET_TR0 GET_BIT(TCON, 4) -#define GET_IE1 GET_BIT(TCON, 3) -#define GET_IT1 GET_BIT(TCON, 2) -#define GET_IE0 GET_BIT(TCON, 1) -#define GET_IT0 GET_BIT(TCON, 0) - -#define GET_SM0 GET_BIT(SCON, 7) -#define GET_SM1 GET_BIT(SCON, 6) -#define GET_SM2 GET_BIT(SCON, 5) -#define GET_REN GET_BIT(SCON, 4) -#define GET_TB8 GET_BIT(SCON, 3) -#define GET_RB8 GET_BIT(SCON, 2) -#define GET_TI GET_BIT(SCON, 1) -#define GET_RI GET_BIT(SCON, 0) - -#define GET_GATE1 GET_BIT(TMOD, 7) -#define GET_CT1 GET_BIT(TMOD, 6) -#define GET_M1_1 GET_BIT(TMOD, 5) -#define GET_M1_0 GET_BIT(TMOD, 4) -#define GET_GATE0 GET_BIT(TMOD, 3) -#define GET_CT0 GET_BIT(TMOD, 2) -#define GET_M0_1 GET_BIT(TMOD, 1) -#define GET_M0_0 GET_BIT(TMOD, 0) - -#define GET_SMOD GET_BIT(PCON, 7) - -/* Only in 80C51BH & other cmos */ - -#define GET_GF1 GET_BIT(PCON, 3) -#define GET_GF0 GET_BIT(PCON, 2) -#define GET_PD GET_BIT(PCON, 1) -#define GET_IDL (GET_BIT(PCON, 0) & ~(GET_PD)) /* PD takes precedence! */ - -/* 8052 Only flags */ -#define GET_TF2 GET_BIT(T2CON, 7) -#define GET_EXF2 GET_BIT(T2CON, 6) -#define GET_RCLK GET_BIT(T2CON, 5) -#define GET_TCLK GET_BIT(T2CON, 4) -#define GET_EXEN2 GET_BIT(T2CON, 3) -#define GET_TR2 GET_BIT(T2CON, 2) -#define GET_CT2 GET_BIT(T2CON, 1) -#define GET_CP GET_BIT(T2CON, 0) - -/* DS5002FP Only flags */ - -/* PCON Flags - DS5002FP */ - -#define GET_POR GET_BIT(PCON, 6) -#define GET_PFW GET_BIT(PCON, 5) -#define GET_WTR GET_BIT(PCON, 4) -#define GET_EPFW GET_BIT(PCON, 3) -#define GET_EWT GET_BIT(PCON, 2) - -#define SET_PFW(n) SET_BIT(PCON, 5, n) - -/* MCON Flags - DS5002FP */ - -#define GET_PA ((MCON & 0xf0)>>4) -#define GET_RG1 GET_BIT(MCON, 3) -#define GET_PES GET_BIT(MCON, 2) -#define GET_PM GET_BIT(MCON, 1) -#define GET_SL GET_BIT(MCON, 0) - -/* RPCTL Flags - DS5002FP */ -#define GET_RNR GET_BIT(RPCTL, 7) /* Bit 6 ?? */ -#define GET_EXBS GET_BIT(RPCTL, 5) -#define GET_AE GET_BIT(RPCTL, 4) -#define GET_IBI GET_BIT(RPCTL, 3) -#define GET_DMA GET_BIT(RPCTL, 2) -#define GET_RPCON GET_BIT(RPCTL, 1) -#define GET_RG0 GET_BIT(RPCTL, 0) - - -/*Add and Subtract Flag settings*/ -#define DO_ADD_FLAGS(a,d,c) do_add_flags(a, d, c) -#define DO_SUB_FLAGS(a,d,c) do_sub_flags(a, d, c) - -#define SET_PARITY() do {mcs51_state.recalc_parity |= 1;} while (0) -#define PUSH_PC() push_pc() -#define POP_PC() pop_pc() - -/* Clear Current IRQ */ -#define CLEAR_CURRENT_IRQ() clear_current_irq() - -/*************************************************************************** - FUNCTION PROTOTYPES -***************************************************************************/ - -static void check_irqs(); -static INLINE void serial_transmit(UINT8 data); - -/* Hold callback functions so they can be set by caller (before the cpu reset) */ - -/*************************************************************************** - INLINE FUNCTIONS -***************************************************************************/ - -static INLINE void clear_current_irq() -{ - if (mcs51_state.cur_irq_prio >= 0) - mcs51_state.irq_active &= ~(1 << mcs51_state.cur_irq_prio); - if (mcs51_state.irq_active & 4) - mcs51_state.cur_irq_prio = 2; - else if (mcs51_state.irq_active & 2) - mcs51_state.cur_irq_prio = 1; - else if (mcs51_state.irq_active & 1) - mcs51_state.cur_irq_prio = 0; - else - mcs51_state.cur_irq_prio = -1; - LOG(("New: %d %02x\n", mcs51_state.cur_irq_prio, mcs51_state.irq_active)); -} - -//INLINE UINT8 r_acc() { return SFR_A(ADDR_ACC); } - -//INLINE UINT8 r_psw() { return SFR_A(ADDR_PSW); } - -static INLINE void update_ptrs() -{ - //mcs51_state.internal_ram = (UINT8 *)mcs51_state.data->get_write_ptr(0x00); - //mcs51_state.sfr_ram = (UINT8 *)mcs51_state.data->get_write_ptr(0x100); - // note: statically mapped in mcs51_state -dink -} - - -/* Generate an external ram address for read/writing using indirect addressing mode */ - -/*The lowest 8 bits of the address are passed in (from the R0/R1 register), however - the hardware can be configured to set the rest of the address lines to any available output port pins, which - means the only way we can implement this is to allow the driver to setup a callback to generate the - address as defined by the specific hardware setup. We'll assume the address won't be bigger than 32 bits - - Couriersud, October 2008: - There is no way external hardware can distinguish between 8bit access and 16 bit access. - During 16bit access the high order byte of the address is output on port 2. We therefore - assume that most hardware will use port 2 for 8bit access as well. - - On configurations where 8 bit access in conjunction with other ports is used, - it is up to the driver to use AM_MIRROR to mask out the high level address and - provide it's own mapping. -*/ - -/* - The DS5002FP has 2 16 bits data address buses (the byte-wide bus and the expanded bus). The exact memory position accessed depends on the - partition mode, the memory range and the expanded bus select. The partition mode and the expanded bus select can be changed at any time. - - In order to simplify memory mapping to the data address bus, the following address map is assumed for partitioned mode: - - 0x00000-0x0ffff -> data memory on the expanded bus - 0x10000-0x1ffff -> data memory on the byte-wide bus - - For non-partitioned mode the following memory map is assumed: - - 0x0000-0xffff -> data memory (the bus used to access it does not matter) -*/ - -static INLINE INT32 external_ram_iaddr(INT32 offset, INT32 mem_mask) -{ - /* Memory Range (RG1 and RG0 @ MCON and RPCTL registers) */ - static const UINT16 ds5002fp_ranges[4] = { 0x1fff, 0x3fff, 0x7fff, 0xffff }; - /* Memory Partition Table (RG1 & RG0 @ MCON & RPCTL registers) */ - static const UINT32 ds5002fp_partitions[16] = { - 0x0000, 0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x6000, 0x7000, - 0x8000, 0x9000, 0xa000, 0xb000, 0xc000, 0xd000, 0xe000, 0x10000 }; - - /* if partition mode is set, adjust offset based on the bus */ - if (mcs51_state.features & FEATURE_DS5002FP) - { - if (!GET_PM) { - if (!GET_EXBS) { - if (((UINT32)offset >= ds5002fp_partitions[GET_PA]) && ((UINT32)offset <= ds5002fp_ranges[mcs51_state.ds5002fp.range])) { - offset += 0x10000; - } - } - } - } - else - { - if (mem_mask == 0x00ff) - return (offset & mem_mask) | (P2 << 8); - } - return offset; -} - -/* Internal ram read/write */ - -static INLINE UINT8 iram_read(INT32 offset) -{ - return (((offset) < 0x80) ? mcs51_state.internal_ram[offset] : mcs51_state.sfr_read(offset)); -} - -static INLINE void iram_write(INT32 offset, UINT8 data) -{ - if ((offset) < 0x80) - mcs51_state.internal_ram[offset] = data; - else - mcs51_state.sfr_write(offset, data); -} - -/*Push the current PC to the stack*/ -static INLINE void push_pc() -{ - UINT8 tmpSP = SP+1; //Grab and Increment Stack Pointer - IRAM_IW(tmpSP, (PC & 0xff)); //Store low byte of PC to Internal Ram (Use IRAM_IW to store stack above 128 bytes) - tmpSP++; // "" - SP = tmpSP; // "" - IRAM_IW(tmpSP, ( (PC & 0xff00) >> 8)); //Store hi byte of PC to next address in Internal Ram (Use IRAM_IW to store stack above 128 bytes) -} - -/*Pop the current PC off the stack and into the pc*/ -static INLINE void pop_pc() -{ - UINT8 tmpSP = SP; //Grab Stack Pointer - PC = (IRAM_IR(tmpSP--) & 0xff) << 8; //Store hi byte to PC (must use IRAM_IR to access stack pointing above 128 bytes) - PC = PC | IRAM_IR(tmpSP--); //Store lo byte to PC (must use IRAM_IR to access stack pointing above 128 bytes) - SP = tmpSP; //Decrement Stack Pointer -} - -//Set the PSW Parity Flag -static INLINE void set_parity() -{ - //This flag will be set when the accumulator contains an odd # of bits set.. - UINT8 p = 0; - int i; - UINT8 a = ACC; - - for (i=0; i<8; i++) { //Test for each of the 8 bits in the ACC! - p ^= (a & 1); - a = (a >> 1); - } - - SET_P(p & 1); -} - -static INLINE UINT8 bit_address_r(UINT8 offset) -{ - UINT8 word; - UINT8 mask; - int bit_pos; - int distance; /* distance between bit addressable words */ - /* 1 for normal bits, 8 for sfr bit addresses */ - - //User defined bit addresses 0x20-0x2f (values are 0x0-0x7f) - if (offset < 0x80) { - distance = 1; - word = ( (offset & 0x78) >> 3) * distance + 0x20; - bit_pos = offset & 0x7; - mask = (0x1 << bit_pos); - return((IRAM_R(word) & mask) >> bit_pos); - } - //SFR bit addressable registers - else { - distance = 8; - word = ( (offset & 0x78) >> 3) * distance + 0x80; - bit_pos = offset & 0x7; - mask = (0x1 << bit_pos); - return ((IRAM_R(word) & mask) >> bit_pos); - } -} - - -static INLINE void bit_address_w(UINT8 offset, UINT8 bit) -{ - int word; - UINT8 mask; - int bit_pos; - UINT8 result; - int distance; - - /* User defined bit addresses 0x20-0x2f (values are 0x0-0x7f) */ - if (offset < 0x80) { - distance = 1; - word = ((offset & 0x78) >> 3) * distance + 0x20; - bit_pos = offset & 0x7; - bit = (bit & 0x1) << bit_pos; - mask = ~(1 << bit_pos) & 0xff; - result = IRAM_R(word) & mask; - result = result | bit; - IRAM_W(word, result); - } - /* SFR bit addressable registers */ - else { - distance = 8; - word = ((offset & 0x78) >> 3) * distance + 0x80; - bit_pos = offset & 0x7; - bit = (bit & 0x1) << bit_pos; - mask = ~(1 << bit_pos) & 0xff; - result = IRAM_R(word) & mask; - result = result | bit; - IRAM_W(word, result); - } -} - -static INLINE void do_add_flags(UINT8 a, UINT8 data, UINT8 c) -{ - UINT16 result = a+data+c; - INT16 result1 = (INT8)a+(INT8)data+c; - - SET_CY((result & 0x100) >> 8); - result = (a&0x0f)+(data&0x0f)+c; - SET_AC((result & 0x10) >> 4); - SET_OV(result1 < -128 || result1 > 127); -} - -static INLINE void do_sub_flags(UINT8 a, UINT8 data, UINT8 c) -{ - UINT16 result = a-(data+c); - INT16 result1 = (INT8)a-(INT8)(data+c); - - SET_CY((result & 0x100) >> 8); - result = (a&0x0f)-((data&0x0f)+c); - SET_AC((result & 0x10) >> 4); - SET_OV((result1 < -128 || result1 > 127)); -} - -static INLINE void transmit_receive(int source) -{ - int mode = (GET_SM0<<1) | GET_SM1; - - if (source == 1) /* timer1 */ - mcs51_state.uart.smod_div = (mcs51_state.uart.smod_div + 1) & (2-GET_SMOD); - - switch(mode) { - //8 bit shifter ( + start,stop bit ) - baud set by clock freq / 12 - case 0: - mcs51_state.uart.rx_clk += (source == 0) ? 16 : 0; /* clock / 12 */ - mcs51_state.uart.tx_clk += (source == 0) ? 16 : 0; /* clock / 12 */ - break; - //8 bit uart ( + start,stop bit ) - baud set by timer1 or timer2 - case 1: - case 3: - if (source == 1) - { - mcs51_state.uart.tx_clk += (GET_TCLK ? 0 : !mcs51_state.uart.smod_div); - mcs51_state.uart.rx_clk += (GET_RCLK ? 0 : !mcs51_state.uart.smod_div); - } - if (source == 2) - { - mcs51_state.uart.tx_clk += (GET_TCLK ? 1 : 0); - mcs51_state.uart.rx_clk += (GET_RCLK ? 1 : 0); - } - break; - //9 bit uart - case 2: - mcs51_state.uart.rx_clk += (source == 0) ? (GET_SMOD ? 6 : 3) : 0; /* clock / 12 * 3 / 8 (16) = clock / 32 (64)*/ - mcs51_state.uart.tx_clk += (source == 0) ? (GET_SMOD ? 6 : 3) : 0; /* clock / 12 */ - break; - } - /* transmit ? */ - if (mcs51_state.uart.tx_clk >= 16) - { - mcs51_state.uart.tx_clk &= 0x0f; - if(mcs51_state.uart.bits_to_send) - { - mcs51_state.uart.bits_to_send--; - if(mcs51_state.uart.bits_to_send == 0) { - //Call the callback function - //if(mcs51_state.serial_tx_callback) - // mcs51_state.serial_tx_callback(mcs51_state.device, mcs51_state.uart.data_out); - //Set Interrupt Flag - SET_TI(1); - } - } - - } - /* receive */ - if (mcs51_state.uart.rx_clk >= 16) - { - mcs51_state.uart.rx_clk &= 0x0f; - if (mcs51_state.uart.delay_cycles>0) - { - mcs51_state.uart.delay_cycles--; - if (mcs51_state.uart.delay_cycles == 0) - { - int data = 0; - //Call our callball function to retrieve the data - //if(mcs51_state.serial_rx_callback) - // data = mcs51_state.serial_rx_callback(mcs51_state.device); - LOG(("RX Deliver %d\n", data)); - SET_SBUF(data); - //Flag the IRQ - SET_RI(1); - SET_RB8(1); // HACK force 2nd stop bit - } - } - } -} - - -static INLINE void update_timer_t0(int cycles) -{ - int mode = (GET_M0_1<<1) | GET_M0_0; - UINT32 count = 0; - - if (GET_TR0) - { - UINT32 delta; - - /* counter / external input */ - delta = GET_CT0 ? mcs51_state.t0_cnt : cycles; - /* taken, reset */ - mcs51_state.t0_cnt = 0; - /* TODO: Not sure about IE0. The manual specifies INT0=high, - * which in turn means CLEAR_LINE. - * IE0 may be edge triggered depending on IT0 */ - if (GET_GATE0 && !GET_IE0) - delta = 0; - - switch(mode) { - case 0: /* 13 Bit Timer Mode */ - count = ((TH0<<5) | ( TL0 & 0x1f ) ); - count += delta; - if ( count & 0xffffe000 ) /* Check for overflow */ - SET_TF0(1); - TH0 = (count>>5) & 0xff; - TL0 = count & 0x1f ; - break; - case 1: /* 16 Bit Timer Mode */ - count = ((TH0<<8) | TL0); - count += delta; - if ( count & 0xffff0000 ) /* Check for overflow */ - SET_TF0(1); - TH0 = (count>>8) & 0xff; - TL0 = count & 0xff; - break; - case 2: /* 8 Bit Autoreload */ - count = ((UINT32) TL0) + delta; - if ( count & 0xffffff00 ) /* Check for overflow */ - { - SET_TF0(1); - count += TH0; /* Reload timer */ - } - /* Update new values of the counter */ - TL0 = count & 0xff; - break; - case 3: - /* Split Timer 1 */ - count = ((UINT32) TL0) + delta; - if ( count & 0xffffff00 ) /* Check for overflow */ - SET_TF0(1); - TL0 = count & 0xff; /* Update new values of the counter */ - break; - } - } - if (GET_TR1) - { - switch(mode) - { - case 3: - /* Split Timer 2 */ - count = ((UINT32) TH0) + cycles; /* No gate control or counting !*/ - if ( count & 0xffffff00 ) /* Check for overflow */ - SET_TF1(1); - TH0 = count & 0xff; /* Update new values of the counter */ - break; - } - } -} - -/* From the DS5002FP User Manual -When Timer 1 is selected for operation in Mode 3, it stops counting and holds its current value. This -action is the same as setting TR1 = 0. When Timer 0 is selected in Mode 3, Timer 1???s control bits are -stolen as described above. As a result, Timer 1???s functions are limited in this MODE. It is forced to -operate as a timer whose clock in-put is 12 tCLK and it cannot generate an interrupt on overflow. In -addition, it also cannot be used with the GATE function. However, it can be started and stopped by -switching it into or out of Mode 3 or it can be assigned as a baud rate generator for the serial port. -*/ - -/* Intel documentation: - * Timer 1 may still be used in modes 0, 1, and 2, while timer 0 - * is in mode 3. With one important exception: No interrupts - * will be generated by timer 1 while timer 0 is using the TF1 - * overflow flag - */ - -static INLINE void update_timer_t1(int cycles) -{ - UINT8 mode = (GET_M1_1<<1) | GET_M1_0; - UINT8 mode_0 = (GET_M0_1<<1) | GET_M0_0; - UINT32 count = 0; - - if (mode_0 != 3) - { - if (GET_TR1) - { - UINT32 delta; - UINT32 overflow = 0; - - /* counter / external input */ - delta = GET_CT1 ? mcs51_state.t1_cnt : cycles; - /* taken, reset */ - mcs51_state.t1_cnt = 0; - /* TODO: Not sure about IE0. The manual specifies INT0=high, - * which in turn means CLEAR_LINE. Change to access last_state? - * IE0 may be edge triggered depending on IT0 */ - if (GET_GATE1 && !GET_IE1) - delta = 0; - - switch(mode) { - case 0: /* 13 Bit Timer Mode */ - count = ((TH1<<5) | ( TL1 & 0x1f ) ); - count += delta; - overflow = count & 0xffffe000; /* Check for overflow */ - TH1 = (count>>5) & 0xff; - TL1 = count & 0x1f ; - break; - case 1: /* 16 Bit Timer Mode */ - count = ((TH1<<8) | TL1); - count += delta; - overflow = count & 0xffff0000; /* Check for overflow */ - TH1 = (count>>8) & 0xff; - TL1 = count & 0xff; - break; - case 2: /* 8 Bit Autoreload */ - count = ((UINT32) TL1) + delta; - overflow = count & 0xffffff00; /* Check for overflow */ - if ( overflow ) - { - count += TH1; /* Reload timer */ - } - /* Update new values of the counter */ - TL1 = count & 0xff; - break; - case 3: - /* do nothing */ - break; - } - if (overflow) - { - SET_TF1(1); - transmit_receive(1); - } - } - } - else - { - UINT32 delta; - UINT32 overflow = 0; - - delta = cycles; - /* taken, reset */ - mcs51_state.t1_cnt = 0; - switch(mode) { - case 0: /* 13 Bit Timer Mode */ - count = ((TH1<<5) | ( TL1 & 0x1f ) ); - count += delta; - overflow = count & 0xffffe000; /* Check for overflow */ - TH1 = (count>>5) & 0xff; - TL1 = count & 0x1f ; - break; - case 1: /* 16 Bit Timer Mode */ - count = ((TH1<<8) | TL1); - count += delta; - overflow = count & 0xffff0000; /* Check for overflow */ - TH1 = (count>>8) & 0xff; - TL1 = count & 0xff; - break; - case 2: /* 8 Bit Autoreload */ - count = ((UINT32) TL1) + delta; - overflow = count & 0xffffff00; /* Check for overflow */ - if ( overflow ) - { - count += TH1; /* Reload timer */ - } - /* Update new values of the counter */ - TL1 = count & 0xff; - break; - case 3: - /* do nothing */ - break; - } - if (overflow) - { - transmit_receive(1); - } - } -} - -static INLINE void update_timer_t2(int cycles) -{ - /* Update Timer 2 */ - if(GET_TR2) { - int mode = ((GET_TCLK | GET_RCLK) << 1) | GET_CP; - int delta = GET_CT2 ? mcs51_state.t2_cnt : (mode & 2) ? cycles * (12/2) : cycles; - - UINT32 count = ((TH2<<8) | TL2) + delta; - mcs51_state.t2_cnt = 0; - - switch (mode) - { - case 0: /* 16 Bit Auto Reload */ - if ( count & 0xffff0000 ) - { - SET_TF2(1); - count += ((RCAP2H<<8) | RCAP2L); - } - else if (GET_EXEN2 && mcs51_state.t2ex_cnt>0) - { - count += ((RCAP2H<<8) | RCAP2L); - mcs51_state.t2ex_cnt = 0; - } - TH2 = (count>>8) & 0xff; - TL2 = count & 0xff; - break; - case 1: /* 16 Bit Capture */ - if ( count & 0xffff0000 ) - SET_TF2(1); - TH2 = (count>>8) & 0xff; - TL2 = count & 0xff; - - if (GET_EXEN2 && mcs51_state.t2ex_cnt>0) - { - RCAP2H = TH2; - RCAP2L = TL2; - mcs51_state.t2ex_cnt = 0; - } - break; - case 2: - case 3: /* Baud rate */ - if ( count & 0xffff0000 ) - { - count += ((RCAP2H<<8) | RCAP2L); - transmit_receive(2); - } - TH2 = (count>>8) & 0xff; - TL2 = count & 0xff; - break; - } - } -} - -static INLINE void update_timers(int cycles) -{ - while (cycles--) - { - update_timer_t0(1); - update_timer_t1(1); - - if (mcs51_state.features & FEATURE_I8052) - { - update_timer_t2(1); - } - } -} - -//Set up to transmit data out of serial port -//NOTE: Enable Serial Port Interrupt bit is NOT required to send/receive data! - -static INLINE void serial_transmit(UINT8 data) -{ - int mode = (GET_SM0<<1) | GET_SM1; - - //Flag that we're sending data - mcs51_state.uart.data_out = data; - LOG(("serial_tansmit: %x %x\n", mode, data)); - switch(mode) { - //8 bit shifter ( + start,stop bit ) - baud set by clock freq / 12 - case 0: - mcs51_state.uart.bits_to_send = 8+2; - break; - //8 bit uart ( + start,stop bit ) - baud set by timer1 or timer2 - case 1: - mcs51_state.uart.bits_to_send = 8+2; - break; - //9 bit uart - case 2: - case 3: - LOG(("Serial mode %d not supported in mcs51!\n", mode)); - break; - } -} - -static INLINE void serial_receive() -{ - int mode = (GET_SM0<<1) | GET_SM1; - - if (GET_REN) { - switch(mode) { - //8 bit shifter ( + start,stop bit ) - baud set by clock freq / 12 - case 0: - mcs51_state.uart.delay_cycles = 8+2; - break; - //8 bit uart ( + start,stop bit ) - baud set by timer1 or timer2 - case 1: - mcs51_state.uart.delay_cycles = 8+2; - break; - //9 bit uart - case 2: - case 3: - LOG(("Serial mode %d not supported in mcs51!\n", mode)); - break; - } - } -} - -/* Check and update status of serial port */ -static INLINE void update_serial(int cycles) -{ - while (--cycles>=0) - transmit_receive(0); -} - -/* Check and update status of serial port */ -static INLINE void update_irq_prio(UINT8 ipl, UINT8 iph) -{ - int i; - for (i=0; i<8; i++) - mcs51_state.irq_prio[i] = ((ipl >> i) & 1) | (((iph >>i ) & 1) << 1); -} - - -/*************************************************************************** - OPCODES -***************************************************************************/ - -#define OPHANDLER( _name ) static INLINE void _name (UINT8 r) - -#include "mcs51ops.c" - - -static void execute_op(UINT8 op) -{ - if (mcs51_state.recalc_parity) - { - set_parity(); - mcs51_state.recalc_parity = 0; - } - - switch( op ) - { - - case 0x00: nop(op); break; //NOP - case 0x01: ajmp(op); break; //AJMP code addr - case 0x02: ljmp(op); break; //LJMP code addr - case 0x03: rr_a(op); break; //RR A - case 0x04: inc_a(op); break; //INC A - case 0x05: RWM=1; inc_mem(op); RWM=0; break; //INC data addr - - case 0x06: - case 0x07: inc_ir(op&1); break; //INC @R0/@R1 - - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: - case 0x0c: - case 0x0d: - case 0x0e: - case 0x0f: inc_r(op&7); break; //INC R0 to R7 - - case 0x10: RWM=1; jbc(op); RWM=0; break; //JBC bit addr, code addr - case 0x11: acall(op); break; //ACALL code addr - case 0x12: lcall(op); break; //LCALL code addr - case 0x13: rrc_a(op); break; //RRC A - case 0x14: dec_a(op); break; //DEC A - case 0x15: RWM=1; dec_mem(op); RWM=0; break; //DEC data addr - - case 0x16: - case 0x17: dec_ir(op&1); break; //DEC @R0/@R1 - - case 0x18: - case 0x19: - case 0x1a: - case 0x1b: - case 0x1c: - case 0x1d: - case 0x1e: - case 0x1f: dec_r(op&7); break; //DEC R0 to R7 - - case 0x20: jb(op); break; //JB bit addr, code addr - case 0x21: ajmp(op); break; //AJMP code addr - case 0x22: ret(op); break; //RET - case 0x23: rl_a(op); break; //RL A - case 0x24: add_a_byte(op); break; //ADD A, #data - case 0x25: add_a_mem(op); break; //ADD A, data addr - - case 0x26: - case 0x27: add_a_ir(op&1); break; //ADD A, @R0/@R1 - - case 0x28: - case 0x29: - case 0x2a: - case 0x2b: - case 0x2c: - case 0x2d: - case 0x2e: - case 0x2f: add_a_r(op&7); break; //ADD A, R0 to R7 - - case 0x30: jnb(op); break; //JNB bit addr, code addr - case 0x31: acall(op); break; //ACALL code addr - case 0x32: reti(op); break; //RETI - case 0x33: rlc_a(op); break; //RLC A - case 0x34: addc_a_byte(op); break; //ADDC A, #data - case 0x35: addc_a_mem(op); break; //ADDC A, data addr - - case 0x36: - case 0x37: addc_a_ir(op&1); break; //ADDC A, @R0/@R1 - - case 0x38: - case 0x39: - case 0x3a: - case 0x3b: - case 0x3c: - case 0x3d: - case 0x3e: - case 0x3f: addc_a_r(op&7); break; //ADDC A, R0 to R7 - - case 0x40: jc(op); break; //JC code addr - case 0x41: ajmp(op); break; //AJMP code addr - case 0x42: RWM=1; orl_mem_a(op); RWM=0; break; //ORL data addr, A - case 0x43: RWM=1; orl_mem_byte(op); RWM=0; break; //ORL data addr, #data - case 0x44: orl_a_byte(op); break; - case 0x45: orl_a_mem(op); break; //ORL A, data addr - - case 0x46: - case 0x47: orl_a_ir(op&1); break; //ORL A, @RO/@R1 - - case 0x48: - case 0x49: - case 0x4a: - case 0x4b: - case 0x4c: - case 0x4d: - case 0x4e: - case 0x4f: orl_a_r(op&7); break; //ORL A, RO to R7 - - case 0x50: jnc(op); break; //JNC code addr - case 0x51: acall(op); break; //ACALL code addr - case 0x52: RWM=1; anl_mem_a(op); RWM=0; break; //ANL data addr, A - case 0x53: RWM=1; anl_mem_byte(op); RWM=0; break; //ANL data addr, #data - case 0x54: anl_a_byte(op); break; //ANL A, #data - case 0x55: anl_a_mem(op); break; //ANL A, data addr - - case 0x56: - case 0x57: anl_a_ir(op&1); break; //ANL A, @RO/@R1 - - case 0x58: - case 0x59: - case 0x5a: - case 0x5b: - case 0x5c: - case 0x5d: - case 0x5e: - case 0x5f: anl_a_r(op&7); break; //ANL A, RO to R7 - - case 0x60: jz(op); break; //JZ code addr - case 0x61: ajmp(op); break; //AJMP code addr - case 0x62: RWM=1; xrl_mem_a(op); RWM=0; break; //XRL data addr, A - case 0x63: RWM=1; xrl_mem_byte(op); RWM=0; break; //XRL data addr, #data - case 0x64: xrl_a_byte(op); break; //XRL A, #data - case 0x65: xrl_a_mem(op); break; //XRL A, data addr - - case 0x66: - case 0x67: xrl_a_ir(op&1); break; //XRL A, @R0/@R1 - - case 0x68: - case 0x69: - case 0x6a: - case 0x6b: - case 0x6c: - case 0x6d: - case 0x6e: - case 0x6f: xrl_a_r(op&7); break; //XRL A, R0 to R7 - - case 0x70: jnz(op); break; //JNZ code addr - case 0x71: acall(op); break; //ACALL code addr - case 0x72: orl_c_bitaddr(op); break; //ORL C, bit addr - case 0x73: jmp_iadptr(op); break; //JMP @A+DPTR - case 0x74: mov_a_byte(op); break; //MOV A, #data - case 0x75: mov_mem_byte(op); break; //MOV data addr, #data - - case 0x76: - case 0x77: mov_ir_byte(op&1); break; //MOV @R0/@R1, #data - - case 0x78: - case 0x79: - case 0x7a: - case 0x7b: - case 0x7c: - case 0x7d: - case 0x7e: - case 0x7f: mov_r_byte(op&7); break; //MOV R0 to R7, #data - - case 0x80: sjmp(op); break; //SJMP code addr - case 0x81: ajmp(op); break; //AJMP code addr - case 0x82: anl_c_bitaddr(op); break; //ANL C, bit addr - case 0x83: movc_a_iapc(op); break; //MOVC A, @A + PC - case 0x84: div_ab(op); break; //DIV AB - case 0x85: mov_mem_mem(op); break; //MOV data addr, data addr - - case 0x86: - case 0x87: mov_mem_ir(op&1); break; //MOV data addr, @R0/@R1 - - case 0x88: - case 0x89: - case 0x8a: - case 0x8b: - case 0x8c: - case 0x8d: - case 0x8e: - case 0x8f: mov_mem_r(op&7); break; //MOV data addr,R0 to R7 - - case 0x90: mov_dptr_byte(op); break; //MOV DPTR, #data - case 0x91: acall(op); break; //ACALL code addr - case 0x92: RWM = 1; mov_bitaddr_c(op); RWM = 0; break; //MOV bit addr, C - case 0x93: movc_a_iadptr(op); break; //MOVC A, @A + DPTR - case 0x94: subb_a_byte(op); break; //SUBB A, #data - case 0x95: subb_a_mem(op); break; //SUBB A, data addr - - case 0x96: - case 0x97: subb_a_ir(op&1); break; //SUBB A, @R0/@R1 - - case 0x98: - case 0x99: - case 0x9a: - case 0x9b: - case 0x9c: - case 0x9d: - case 0x9e: - case 0x9f: subb_a_r(op&7); break; //SUBB A, R0 to R7 - - case 0xa0: orl_c_nbitaddr(op); break; //ORL C, /bit addr - case 0xa1: ajmp(op); break; //AJMP code addr - case 0xa2: mov_c_bitaddr(op); break; //MOV C, bit addr - case 0xa3: inc_dptr(op); break; //INC DPTR - case 0xa4: mul_ab(op); break; //MUL AB - case 0xa5: illegal(op); break; //reserved - - case 0xa6: - case 0xa7: mov_ir_mem(op&1); break; //MOV @R0/@R1, data addr - - case 0xa8: - case 0xa9: - case 0xaa: - case 0xab: - case 0xac: - case 0xad: - case 0xae: - case 0xaf: mov_r_mem(op&7); break; //MOV R0 to R7, data addr - - case 0xb0: anl_c_nbitaddr(op); break; //ANL C,/bit addr - case 0xb1: acall(op); break; //ACALL code addr - case 0xb2: RWM=1; cpl_bitaddr(op); RWM=0; break; //CPL bit addr - case 0xb3: cpl_c(op); break; //CPL C - case 0xb4: cjne_a_byte(op); break; //CJNE A, #data, code addr - case 0xb5: cjne_a_mem(op); break; //CJNE A, data addr, code addr - - case 0xb6: - case 0xb7: cjne_ir_byte(op&1); break; //CJNE @R0/@R1, #data, code addr - - case 0xb8: - case 0xb9: - case 0xba: - case 0xbb: - case 0xbc: - case 0xbd: - case 0xbe: - case 0xbf: cjne_r_byte(op&7); break; //CJNE R0 to R7, #data, code addr - - case 0xc0: push(op); break; //PUSH data addr - case 0xc1: ajmp(op); break; //AJMP code addr - case 0xc2: RWM=1; clr_bitaddr(op); RWM=0; break; //CLR bit addr - case 0xc3: clr_c(op); break; //CLR C - case 0xc4: swap_a(op); break; //SWAP A - case 0xc5: xch_a_mem(op); break; //XCH A, data addr - - case 0xc6: - case 0xc7: xch_a_ir(op&1); break; //XCH A, @RO/@R1 - - case 0xc8: - case 0xc9: - case 0xca: - case 0xcb: - case 0xcc: - case 0xcd: - case 0xce: - case 0xcf: xch_a_r(op&7); break; //XCH A, RO to R7 - - case 0xd0: pop(op); break; //POP data addr - case 0xd1: acall(op); break; //ACALL code addr - case 0xd2: RWM=1; setb_bitaddr(op); RWM=0; break; //SETB bit addr - case 0xd3: setb_c(op); break; //SETB C - case 0xd4: da_a(op); break; //DA A - case 0xd5: RWM=1; djnz_mem(op); RWM=0; break; //DJNZ data addr, code addr - - case 0xd6: - case 0xd7: xchd_a_ir(op&1); break; //XCHD A, @R0/@R1 - - case 0xd8: - case 0xd9: - case 0xda: - case 0xdb: - case 0xdc: - case 0xdd: - case 0xde: - case 0xdf: djnz_r(op&7); break; //DJNZ R0 to R7,code addr - - case 0xe0: movx_a_idptr(op); break; //MOVX A,@DPTR - case 0xe1: ajmp(op); break; //AJMP code addr - - case 0xe2: - case 0xe3: movx_a_ir(op&1); break; //MOVX A, @R0/@R1 - - case 0xe4: clr_a(op); break; //CLR A - case 0xe5: mov_a_mem(op); break; //MOV A, data addr - case 0xe6: - case 0xe7: mov_a_ir(op&1); break; //MOV A,@RO/@R1 - - case 0xe8: - case 0xe9: - case 0xea: - case 0xeb: - case 0xec: - case 0xed: - case 0xee: - case 0xef: mov_a_r(op&7); break; //MOV A,R0 to R7 - - case 0xf0: movx_idptr_a(op); break; //MOVX @DPTR,A - case 0xf1: acall(op); break; //ACALL code addr - - case 0xf2: - case 0xf3: movx_ir_a(op&1); break; //MOVX @R0/@R1,A - - case 0xf4: cpl_a(op); break; //CPL A - case 0xf5: mov_mem_a(op); break; //MOV data addr, A - - case 0xf6: - case 0xf7: mov_ir_a(op&1); break; //MOV @R0/@R1, A - - case 0xf8: - case 0xf9: - case 0xfa: - case 0xfb: - case 0xfc: - case 0xfd: - case 0xfe: - case 0xff: mov_r_a(op&7); break; //MOV R0 to R7, A - default: - illegal(op); - } -} - -/*************************************************************************** - OPCODE CYCLES -***************************************************************************/ - -/* # of oscilations each opcode requires*/ -static const UINT8 mcs51_cycles[] = { - 1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,1,2,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,4,2,2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,1,2,4,1,2,2,2,2,2,2,2,2,2,2, - 2,2,1,1,2,2,2,2,2,2,2,2,2,2,2,2, - 2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,1,1,1,2,1,1,2,2,2,2,2,2,2,2, - 2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1 -}; - -/*********************************************************************************** - Check for pending Interrupts and process - returns # of cycles used for the int - - Note about priority & interrupting interrupts.. - 1) A high priority interrupt cannot be interrupted by anything! - 2) A low priority interrupt can ONLY be interrupted by a high priority interrupt - 3) If more than 1 Interrupt Flag is set (ie, 2 simultaneous requests occur), - the following logic works as follows: - 1) If two requests come in of different priority levels, the higher one is selected.. - 2) If the requests are of the same level, an internal order is used: - a) IEO - b) TFO - c) IE1 - d) TF1 - e) RI+TI - f) TF2+EXF2 - **********************************************************************************/ -static void check_irqs() -{ - UINT8 ints = (GET_IE0 | (GET_TF0<<1) | (GET_IE1<<2) | (GET_TF1<<3) - | ((GET_RI|GET_TI)<<4)); - UINT8 int_vec = 0; - UINT8 int_mask = 0; - int priority_request = -1; - int i; - - //If All Inerrupts Disabled or no pending abort.. - int_mask = (GET_EA ? IE : 0x00); - - if (mcs51_state.features & FEATURE_I8052) - ints |= ((GET_TF2|GET_EXF2)<<5); - - if (mcs51_state.features & FEATURE_DS5002FP) - { - ints |= ((GET_PFW)<<5); - mcs51_state.irq_prio[6] = 3; /* force highest priority */ - /* mask out interrupts not enabled */ - ints &= ((int_mask & 0x1f) | ((GET_EPFW)<<5)); - } - else - { - /* mask out interrupts not enabled */ - ints &= int_mask; - } - - if (!ints) return; - - /* CLear IDL - got enabled interrupt */ - if (mcs51_state.features & FEATURE_CMOS) - { - /* any interrupt terminates idle mode */ - SET_IDL(0); - /* external interrupt wakes up */ - if (ints & (GET_IE0 | GET_IE1)) - /* but not the DS5002FP */ - if (!(mcs51_state.features & FEATURE_DS5002FP)) - SET_PD(0); - } - - for (i=0; i priority_request) - { - priority_request = mcs51_state.irq_prio[i]; - int_vec = (i<<3) | 3; - } - } - } - - /* Skip the interrupt request if currently processing interrupt - * and the new request does not have a higher priority - */ - - LOG(("Request: %d\n", priority_request)); - if (mcs51_state.irq_active && (priority_request <= mcs51_state.cur_irq_prio)) - { - LOG(("higher or equal priority irq in progress already, skipping ...\n")); - return; - } - - /* also break out of jb int0, loops */ - if (ROP(PC) == 0x20 && ROP_ARG(PC+1) == 0xb2 && ROP_ARG(PC+2) == 0xfd) - PC += 3; - - //Save current pc to stack, set pc to new interrupt vector - push_pc(); - PC = int_vec; - - /* interrupts take 24 cycles */ - mcs51_state.inst_cycles += 2; - - //Set current Irq & Priority being serviced - mcs51_state.cur_irq_prio = priority_request; - mcs51_state.irq_active |= (1 << priority_request); - - LOG(("Take: %d %02x\n", mcs51_state.cur_irq_prio, mcs51_state.irq_active)); - - //Clear any interrupt flags that should be cleared since we're servicing the irq! - switch(int_vec) { - case V_IE0: - //External Int Flag only cleared when configured as Edge Triggered.. - if(GET_IT0) /* for some reason having this, breaks alving dmd games */ - SET_IE0(0); - - if (mcs51_state.irqHOLD) { - mcs51_set_irq_line(MCS51_INT0_LINE, 0); - mcs51_state.irqHOLD = 0; - } - - /* indicate we took the external IRQ */ - //if (mcs51_state.irq_callback != NULL) - // (*mcs51_state.irq_callback)(mcs51_state.device, 0); - - break; - case V_TF0: - //Timer 0 - Always clear Flag - SET_TF0(0); - break; - case V_IE1: - //External Int Flag only cleared when configured as Edge Triggered.. - if(GET_IT1) /* for some reason having this, breaks alving dmd games */ - SET_IE1(0); - - if (mcs51_state.irqHOLD) { - mcs51_set_irq_line(MCS51_INT1_LINE, 0); - mcs51_state.irqHOLD = 0; - } - - /* indicate we took the external IRQ */ - //if (mcs51_state.irq_callback != NULL) - // (*mcs51_state.irq_callback)(mcs51_state.device, 1); - - break; - case V_TF1: - //Timer 1 - Always clear Flag - SET_TF1(0); - break; - case V_RITI: - /* no flags are cleared, TI and RI remain set until reset by software */ - break; - /* I8052 specific */ - case V_TF2: - /* no flags are cleared according to manual */ - break; - /* DS5002FP specific */ - /* case V_PFI: - * no flags are cleared, PFW is reset by software - * This has the same vector as V_TF2. - */ - - } -} - -static INLINE void burn_cycles(int cycles) -{ - /* Update Timer (if any timers are running) */ - update_timers(cycles); - - /* Update Serial (only for mode 0) */ - update_serial(cycles); - - /* check_irqs */ - check_irqs(); -} - -void mcs51_set_irq_line(int irqline, int state) -{ - /* From the manual: - * - * In operation all the interrupt flags are latched into the - * interrupt control system during State 5 of every machine cycle. - * The samples are polled during the following machine cycle. - * - * ==> Since we do not emulate sub-states, this assumes that the signal is present - * for at least one cycle (12 states) - * - */ - - if (state == CPU_IRQSTATUS_AUTO) state = CPU_IRQSTATUS_HOLD; // for compatibility - - UINT32 new_state = (mcs51_state.last_line_state & ~(1 << irqline)) | ((state != CLEAR_LINE) << irqline); - /* detect 0->1 transistions */ - UINT32 tr_state = (~mcs51_state.last_line_state) & new_state; - - switch( irqline ) - { - //External Interrupt 0 - case MCS51_INT0_LINE: - //Line Asserted? - if (state != CLEAR_LINE) { - if (state == CPU_IRQSTATUS_HOLD) mcs51_state.irqHOLD = 1; - //Need cleared->active line transition? (Logical 1-0 Pulse on the line) - CLEAR->ASSERT Transition since INT0 active lo! - if (GET_IT0) { - if (GET_BIT(tr_state, MCS51_INT0_LINE)) - SET_IE0(1); - } - else - SET_IE0(1); //Nope, just set it.. - } - else - { - if (!GET_IT0) /* clear if level triggered */ - SET_IE0(0); - } - - break; - - //External Interrupt 1 - case MCS51_INT1_LINE: - - //Line Asserted? - if (state != CLEAR_LINE) { - if (state == CPU_IRQSTATUS_HOLD) mcs51_state.irqHOLD = 1; - //Need cleared->active line transition? (Logical 1-0 Pulse on the line) - CLEAR->ASSERT Transition since INT1 active lo! - if(GET_IT1){ - if (GET_BIT(tr_state, MCS51_INT1_LINE)) - SET_IE1(1); - } - else - SET_IE1(1); //Nope, just set it.. - } - else - { - if (!GET_IT1) /* clear if level triggered */ - SET_IE1(0); - } - break; - - case MCS51_T0_LINE: - if (GET_BIT(tr_state, MCS51_T0_LINE) && GET_TR0) - mcs51_state.t0_cnt++; - break; - - case MCS51_T1_LINE: - if (GET_BIT(tr_state, MCS51_T1_LINE) && GET_TR1) - mcs51_state.t1_cnt++; - break; - - case MCS51_T2_LINE: - if (mcs51_state.features & FEATURE_I8052) - { - if (GET_BIT(tr_state, MCS51_T2_LINE) && GET_TR1) - mcs51_state.t2_cnt++; - } - else - fatalerror("mcs51: Trying to set T2_LINE on a non I8052 type cpu.\n"); - break; - - case MCS51_T2EX_LINE: - if (mcs51_state.features & FEATURE_I8052) - { - if (GET_BIT(tr_state, MCS51_T2EX_LINE)) - { - SET_EXF2(1); - mcs51_state.t2ex_cnt++; - } - } - else - fatalerror("mcs51: Trying to set T2EX_LINE on a non I8052 type cpu.\n"); - break; - - case MCS51_RX_LINE: /* Serial Port Receive */ - /* Is the enable flags for this interrupt set? */ - if (state != CLEAR_LINE) - { - serial_receive(); - } - break; - - /* Power Fail Interrupt */ - case DS5002FP_PFI_LINE: - if (mcs51_state.features & FEATURE_DS5002FP) - { - /* Need cleared->active line transition? (Logical 1-0 Pulse on the line) - CLEAR->ASSERT Transition since INT1 active lo! */ - if (GET_BIT(tr_state, MCS51_INT1_LINE)) - SET_PFW(1); - } - else - fatalerror("mcs51: Trying to set DS5002FP_PFI_LINE on a non DS5002FP type cpu.\n"); - break; - } - mcs51_state.last_line_state = new_state; -} - -/* Execute cycles - returns number of cycles actually run */ -INT32 mcs51Run(int cycles) // divide cycles by 12! -dink -{ - UINT8 op; - - mcs51_state.icount = cycles; - /* external interrupts may have been set since we last checked */ - mcs51_state.inst_cycles = 0; - check_irqs(); - - /* if in powerdown, just return */ - if ((mcs51_state.features & FEATURE_CMOS) && GET_PD) - { - mcs51_state.icount = 0; - return 0; - } - - mcs51_state.icount -= mcs51_state.inst_cycles; - burn_cycles(mcs51_state.inst_cycles); - - if ((mcs51_state.features & FEATURE_CMOS) && GET_IDL) - { - do - { - /* burn the cycles */ - mcs51_state.icount--; - burn_cycles(1); - } while( mcs51_state.icount > 0 ); - return 0; - } - - do - { - /* Read next opcode */ - PPC = PC; - //debugger_instruction_hook(device, PC); - op = cpu_readop_arg_dat(PC++); - - /* process opcode and count cycles */ - mcs51_state.inst_cycles = mcs51_cycles[op]; - execute_op(op); - - /* burn the cycles */ - mcs51_state.icount -= mcs51_state.inst_cycles; - - /* if in powerdown, just return */ - if ((mcs51_state.features & FEATURE_CMOS) && GET_PD) - return 0; - - burn_cycles(mcs51_state.inst_cycles); - - /* decrement the timed access window */ - if (mcs51_state.features & FEATURE_DS5002FP) - mcs51_state.ds5002fp.ta_window = (mcs51_state.ds5002fp.ta_window ? (mcs51_state.ds5002fp.ta_window - 1) : 0x00); - - /* If the chip entered in idle mode, end the loop */ - if ((mcs51_state.features & FEATURE_CMOS) && GET_IDL) - return 0; - - } while( mcs51_state.icount > 0 ); - - return cycles - mcs51_state.icount; -} - -void mcs51RunEnd(void) -{ - mcs51_state.icount = 0; -} - -void mcs51_scan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - void (*sfr_write_save)(INT32 offset, UINT8 data); - UINT8 (*sfr_read_save)(INT32 offset); - - sfr_write_save = mcs51_state.sfr_write; - sfr_read_save = mcs51_state.sfr_read; - - struct BurnArea ba; - memset(&ba, 0, sizeof(ba)); - ba.Data = &mcs51_state; - ba.nLen = sizeof(mcs51_state); - ba.szName = "i8051 Regs"; - BurnAcb(&ba); - - mcs51_state.sfr_write = sfr_write_save; - mcs51_state.sfr_read = sfr_read_save; - } -} - - -/**************************************************************************** - * MCS51/8051 Section - ****************************************************************************/ - -static void mcs51_sfr_write(INT32 offset, UINT8 data) -{ - /* update register */ - //assert(offset >= 0x80 && offset <= 0xff); - - switch (offset) - { - case ADDR_P0: OUT(MCS51_PORT_P0,data); break; - case ADDR_P1: OUT(MCS51_PORT_P1,data); break; - case ADDR_P2: OUT(MCS51_PORT_P2,data); break; - case ADDR_P3: OUT(MCS51_PORT_P3,data); break; - case ADDR_SBUF: serial_transmit(data); break; - case ADDR_PSW: SET_PARITY(); break; - case ADDR_ACC: SET_PARITY(); break; - case ADDR_IP: update_irq_prio(data, 0); break; - /* R_SBUF = data; //This register is used only for "Receiving data coming in!" */ - - case ADDR_B: - case ADDR_SP: - case ADDR_DPL: - case ADDR_DPH: - case ADDR_PCON: - case ADDR_TCON: - case ADDR_TMOD: - case ADDR_IE: - case ADDR_TL0: - case ADDR_TL1: - case ADDR_TH0: - case ADDR_TH1: - case ADDR_SCON: - break; - default: - LOG(("mcs51 '%s': attemping to write to an invalid/non-implemented SFR address: %x at 0x%04x, data=%x\n", mcs51_state.device->tag(), (UINT32)offset,PC,data)); - /* no write in this case according to manual */ - return; - } - mcs51_state.sfr_ram[offset] = data; -} - -static UINT8 mcs51_sfr_read(INT32 offset) -{ - //assert(offset >= 0x80 && offset <= 0xff); - - switch (offset) - { - /* Read/Write/Modify operations read the port latch ! */ - /* Move to memory map */ - case ADDR_P0: return RWM ? P0 : P0 & IN(MCS51_PORT_P0); - case ADDR_P1: return RWM ? P1 : P1 & IN(MCS51_PORT_P1); - case ADDR_P2: return RWM ? P2 : P2 & IN(MCS51_PORT_P2); - case ADDR_P3: return RWM ? P3 : P3 & IN(MCS51_PORT_P3); - - case ADDR_PSW: - case ADDR_ACC: - case ADDR_B: - case ADDR_SP: - case ADDR_DPL: - case ADDR_DPH: - case ADDR_PCON: - case ADDR_TCON: - case ADDR_TMOD: - case ADDR_TL0: - case ADDR_TL1: - case ADDR_TH0: - case ADDR_TH1: - case ADDR_SCON: - case ADDR_SBUF: - case ADDR_IE: - case ADDR_IP: - return mcs51_state.sfr_ram[offset]; - /* Illegal or non-implemented sfr */ - default: - LOG(("mcs51 '%s': attemping to read an invalid/non-implemented SFR address: %x at 0x%04x\n", mcs51_state.device->tag(), (UINT32)offset,PC)); - /* according to the manual, the read may return random bits */ - return 0xff; - } -} - - -void mcs51_init (void) -{ - //mcs51_state.irq_callback = irqcallback; - - memset(&mcs51_state, 0, sizeof(mcs51_state)); - - mcs51_state.features = FEATURE_NONE; - mcs51_state.ram_mask = 0x7F; /* 128 bytes of ram */ - mcs51_state.num_interrupts = 5; /* 5 interrupts */ - mcs51_state.sfr_read = mcs51_sfr_read; - mcs51_state.sfr_write = mcs51_sfr_write; - - cpu_readop_arg_dat = mcs51_readop_arg_dat; - -#if 0 - /* ensure these pointers are set before get_info is called */ - update_ptrs(); - /* Save states */ - - device->save_item(NAME(mcs51_state.ppc)); - device->save_item(NAME(mcs51_state.pc)); - device->save_item(NAME(mcs51_state.rwm) ); - device->save_item(NAME(mcs51_state.cur_irq_prio) ); - device->save_item(NAME(mcs51_state.last_line_state) ); - device->save_item(NAME(mcs51_state.t0_cnt) ); - device->save_item(NAME(mcs51_state.t1_cnt) ); - device->save_item(NAME(mcs51_state.t2_cnt) ); - device->save_item(NAME(mcs51_state.t2ex_cnt) ); - device->save_item(NAME(mcs51_state.recalc_parity) ); - device->save_item(NAME(mcs51_state.irq_prio) ); - device->save_item(NAME(mcs51_state.irq_active) ); -#endif -} - -/*static CPU_INIT( i80c51 ) -{ - CPU_INIT_CALL(mcs51); - mcs51_state.features |= FEATURE_CMOS; -}*/ - -/* Reset registers to the initial values */ -void mcs51_reset (void) -{ - //update_ptrs(); - mcs51_state.last_line_state = 0; - mcs51_state.t0_cnt = 0; - mcs51_state.t1_cnt = 0; - mcs51_state.t2_cnt = 0; - mcs51_state.t2ex_cnt = 0; - /* Flag as NO IRQ in Progress */ - mcs51_state.irq_active = 0; - mcs51_state.cur_irq_prio = -1; - - //Clear Ram (w/0xff) - memset(&mcs51_state.internal_ram,0xff,sizeof(mcs51_state.internal_ram)); - - /* these are all defined reset states */ - PC = 0; - SP = 0x7; - SET_PSW(0); - SET_ACC(0); - DPH = 0; - DPL = 0; - B = 0; - IP = 0; - update_irq_prio(IP, 0); - IE = 0; - SCON = 0; - TCON = 0; - TMOD = 0; - PCON = 0; - TH1 = 0; - TH0 = 0; - TL1 = 0; - TL0 = 0; - /* set the port configurations to all 1's */ - SET_P3(0xff); - SET_P2(0xff); - SET_P1(0xff); - SET_P0(0xff); - - /* 8052 Only registers */ - if (mcs51_state.features & FEATURE_I8052) - { - T2CON = 0; - RCAP2L = 0; - RCAP2H = 0; - TL2 = 0; - TH2 = 0; - } - - /* 80C52 Only registers */ - if (mcs51_state.features & FEATURE_I80C52) - { - IPH = 0; - update_irq_prio(IP, IPH); - SADDR = 0; - SADEN = 0; - } - - /* DS5002FP Only registers */ - if (mcs51_state.features & FEATURE_DS5002FP) - { - // set initial values (some of them are set using the bootstrap loader) - PCON = 0; - MCON = mcs51_state.ds5002fp.config.mcon & 0xfb; - RPCTL = mcs51_state.ds5002fp.config.rpctl & 0x01; - RPS = 0; - RNR = 0; - CRCR = mcs51_state.ds5002fp.config.crc & 0xf0; - CRCL = 0; - CRCH = 0; - TA = 0; - - // set internal CPU state - mcs51_state.ds5002fp.previous_ta = 0; - mcs51_state.ds5002fp.ta_window = 0; - mcs51_state.ds5002fp.range = (GET_RG1 << 1) | GET_RG0; - } - -} - -/* Shut down CPU core */ -void mcs51_exit(void) -{ - mcs51_read_port = NULL; - mcs51_write_port = NULL; - mcs51_program_data = NULL; - cpu_readop_arg_dat = NULL; -} - -/**************************************************************************** - * DS5002FP Section - ****************************************************************************/ - - -#define DS5_LOGW(a, d) LOG(("ds5002fp '%s': write to " # a " register at 0x%04x, data=%x\n", mcs51_state.device->tag(), PC, d)) -#define DS5_LOGR(a, d) LOG(("ds5002fp '%s': read from " # a " register at 0x%04x\n", mcs51_state.device->tag(), PC)) - -static INLINE UINT8 ds5002fp_protected(INT32 offset, UINT8 data, UINT8 ta_mask, UINT8 mask) -{ - UINT8 is_timed_access; - - is_timed_access = (mcs51_state.ds5002fp.ta_window > 0) && (TA == 0x55); - if (is_timed_access) - { - ta_mask = 0xff; - } - data = (mcs51_state.sfr_ram[offset] & (~ta_mask)) | (data & ta_mask); - return (mcs51_state.sfr_ram[offset] & (~mask)) | (data & mask); -} - -static void ds5002fp_sfr_write(INT32 offset, UINT8 data) -{ - switch (offset) - { - - case ADDR_TA: - mcs51_state.ds5002fp.previous_ta = TA; - /* init the time window after having wrote 0xaa */ - if ((data == 0xaa) && (mcs51_state.ds5002fp.ta_window == 0)) - { - mcs51_state.ds5002fp.ta_window = 6; /* 4*12 + 2*12 */ - LOG(("ds5002fp '%s': TA window initiated at 0x%04x\n", mcs51_state.device->tag(), PC)); - } - break; - case ADDR_MCON: data = ds5002fp_protected(ADDR_MCON, data, 0x0f, 0xf7); DS5_LOGW(MCON, data); break; - case ADDR_RPCTL: data = ds5002fp_protected(ADDR_RPCTL, data, 0xef, 0xfe); DS5_LOGW(RPCTL, data); break; - case ADDR_CRCR: data = ds5002fp_protected(ADDR_CRCR, data, 0xff, 0x0f); DS5_LOGW(CRCR, data); break; - case ADDR_PCON: data = ds5002fp_protected(ADDR_PCON, data, 0xb9, 0xff); break; - case ADDR_IP: data = ds5002fp_protected(ADDR_IP, data, 0x7f, 0xff); break; - case ADDR_CRCL: DS5_LOGW(CRCL, data); break; - case ADDR_CRCH: DS5_LOGW(CRCH, data); break; - case ADDR_RNR: DS5_LOGW(RNR, data); break; - case ADDR_RPS: DS5_LOGW(RPS, data); break; - default: - mcs51_sfr_write(offset, data); - return; - } - mcs51_state.sfr_ram[offset] = data; - //mcs51_state.data->write_byte((INT32) offset | 0x100, data); -} - -static UINT8 ds5002fp_sfr_read(INT32 offset) -{ - switch (offset) - { - case ADDR_CRCR: DS5_LOGR(CRCR, data); break; - case ADDR_CRCL: DS5_LOGR(CRCL, data); break; - case ADDR_CRCH: DS5_LOGR(CRCH, data); break; - case ADDR_MCON: DS5_LOGR(MCON, data); break; - case ADDR_TA: DS5_LOGR(TA, data); break; - case ADDR_RNR: DS5_LOGR(RNR, data); break; - case ADDR_RPCTL: DS5_LOGR(RPCTL, data); break; - case ADDR_RPS: DS5_LOGR(RPS, data); break; - case ADDR_PCON: - SET_PFW(0); /* reset PFW flag */ - return mcs51_sfr_read(offset); - default: - return mcs51_sfr_read(offset); - } - return mcs51_state.sfr_ram[offset]; - //return mcs51_state.data->read_byte((INT32) offset | 0x100); -} - -void ds5002fp_init (UINT8 mcon, UINT8 rpctl, UINT8 crc) -{ - /* default configuration */ - // mcon = 0x00, rpctl = 0x00, crc = 0x00 - - mcs51_init(); - - cpu_readop_arg_dat = ds5002fp_readop_arg_dat; - - mcs51_state.ds5002fp.config.mcon = mcon; - mcs51_state.ds5002fp.config.rpctl = rpctl; - mcs51_state.ds5002fp.config.crc = crc; - - mcs51_state.features |= (FEATURE_DS5002FP | FEATURE_CMOS); - mcs51_state.sfr_read = ds5002fp_sfr_read; - mcs51_state.sfr_write = ds5002fp_sfr_write; - -#if 0 - device->save_item(NAME(mcs51_state.ds5002fp.previous_ta) ); - device->save_item(NAME(mcs51_state.ds5002fp.ta_window) ); - device->save_item(NAME(mcs51_state.ds5002fp.range) ); -#endif -} - - - - -#if 0 -/**************************************************************************** - * 8052 Section - ****************************************************************************/ - -static void i8052_sfr_write(INT32 offset, UINT8 data) -{ - switch (offset) - { - /* 8052 family specific */ - case ADDR_T2CON: - case ADDR_RCAP2L: - case ADDR_RCAP2H: - case ADDR_TL2: - case ADDR_TH2: - mcs51_state.data->write_byte((INT32) offset | 0x100, data); - break; - - default: - mcs51_sfr_write(offset, data); - } -} - -static UINT8 i8052_sfr_read(INT32 offset) -{ - switch (offset) - { - /* 8052 family specific */ - case ADDR_T2CON: - case ADDR_RCAP2L: - case ADDR_RCAP2H: - case ADDR_TL2: - case ADDR_TH2: - return mcs51_state.data->read_byte((INT32) offset | 0x100); - default: - return mcs51_sfr_read(offset); - } -} - -static CPU_INIT( i8052 ) -{ - = get_safe_token(device); - CPU_INIT_CALL(mcs51); - - mcs51_state.ram_mask = 0xFF; /* 256 bytes of ram */ - mcs51_state.num_interrupts = 6; /* 6 interrupts */ - - mcs51_state.features |= FEATURE_I8052; - mcs51_state.sfr_read = i8052_sfr_read; - mcs51_state.sfr_write = i8052_sfr_write; -} - -/**************************************************************************** - * 80C52 Section - ****************************************************************************/ - -static void i80c52_sfr_write(INT32 offset, UINT8 data) -{ - switch (offset) - { - /* 80c52 family specific */ - case ADDR_IP: - update_irq_prio(data, IPH); - break; - case ADDR_IPH: - update_irq_prio(IP, data); - break; - case ADDR_SADDR: - case ADDR_SADEN: - break; - - default: - i8052_sfr_write(offset, data); - return; - } - mcs51_state.data->write_byte((INT32) offset | 0x100, data); -} - -static UINT8 i80c52_sfr_read(INT32 offset) -{ - switch (offset) - { - /* 80c52 family specific */ - case ADDR_IPH: - case ADDR_SADDR: - case ADDR_SADEN: - return mcs51_state.data->read_byte((INT32) offset | 0x100); - default: - return i8052_sfr_read(offset); - } -} - -static CPU_INIT( i80c52 ) -{ - = get_safe_token(device); - CPU_INIT_CALL(i8052); - - mcs51_state.features |= (FEATURE_I80C52 | FEATURE_CMOS); - mcs51_state.sfr_read = i80c52_sfr_read; - mcs51_state.sfr_write = i80c52_sfr_write; -} - -static CPU_INIT( i80c31 ) -{ - = get_safe_token(device); - CPU_INIT_CALL(i8052); - - mcs51_state.ram_mask = 0x7F; /* 128 bytes of ram */ -} - - -/*************************************************************************** - ADDRESS MAPS -***************************************************************************/ - -static ADDRESS_MAP_START(program_12bit, AS_PROGRAM, 8) - AM_RANGE(0x00, 0x0fff) AM_ROM -ADDRESS_MAP_END - -static ADDRESS_MAP_START(program_13bit, AS_PROGRAM, 8) - AM_RANGE(0x00, 0x1fff) AM_ROM -ADDRESS_MAP_END - -static ADDRESS_MAP_START(data_7bit, AS_DATA, 8) - AM_RANGE(0x0000, 0x007f) AM_RAM - AM_RANGE(0x0100, 0x01ff) AM_RAM /* SFR */ -ADDRESS_MAP_END - -static ADDRESS_MAP_START(data_8bit, AS_DATA, 8) - AM_RANGE(0x0000, 0x00ff) AM_RAM - AM_RANGE(0x0100, 0x01ff) AM_RAM /* SFR */ -ADDRESS_MAP_END - - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static CPU_SET_INFO( mcs51 ) -{ - = get_safe_token(device); - - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_PC: PC = info->i; break; - case CPUINFO_INT_SP: SP = info->i; break; - - case CPUINFO_INT_INPUT_STATE + MCS51_INT0_LINE: mcs51_set_irq_line(MCS51_INT0_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + MCS51_INT1_LINE: mcs51_set_irq_line(MCS51_INT1_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + MCS51_T0_LINE: mcs51_set_irq_line(MCS51_T0_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + MCS51_T1_LINE: mcs51_set_irq_line(MCS51_T1_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + MCS51_RX_LINE: mcs51_set_irq_line(MCS51_RX_LINE, info->i); break; - - case CPUINFO_INT_REGISTER + MCS51_PC: PC = info->i; break; - case CPUINFO_INT_REGISTER + MCS51_SP: SP = info->i; break; - case CPUINFO_INT_REGISTER + MCS51_PSW: SET_PSW(info->i); break; - case CPUINFO_INT_REGISTER + MCS51_ACC: SET_ACC(info->i); break; - case CPUINFO_INT_REGISTER + MCS51_B: B = info->i; break; - case CPUINFO_INT_REGISTER + MCS51_DPH: DPH = info->i; break; - case CPUINFO_INT_REGISTER + MCS51_DPL: DPL = info->i; break; - case CPUINFO_INT_REGISTER + MCS51_IE: IE = info->i; break; - case CPUINFO_INT_REGISTER + MCS51_R0: SET_REG(0, info->i); break; - case CPUINFO_INT_REGISTER + MCS51_R1: SET_REG(1, info->i); break; - case CPUINFO_INT_REGISTER + MCS51_R2: SET_REG(2, info->i); break; - case CPUINFO_INT_REGISTER + MCS51_R3: SET_REG(3, info->i); break; - case CPUINFO_INT_REGISTER + MCS51_R4: SET_REG(4, info->i); break; - case CPUINFO_INT_REGISTER + MCS51_R5: SET_REG(5, info->i); break; - case CPUINFO_INT_REGISTER + MCS51_R6: SET_REG(6, info->i); break; - case CPUINFO_INT_REGISTER + MCS51_R7: SET_REG(7, info->i); break; - case CPUINFO_INT_REGISTER + MCS51_RB: SET_RS(info->i); break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -static CPU_GET_INFO( mcs51 ) -{ - = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; - - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(mcs51_state_t); break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case DEVINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 12; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 5; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 20; /* rough guess */ break; - case CPUINFO_INT_INPUT_LINES: info->i = 3; break; - - case DEVINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 8; break; - case DEVINFO_INT_ADDRBUS_WIDTH + AS_PROGRAM: info->i = 16; break; - case DEVINFO_INT_ADDRBUS_SHIFT + AS_PROGRAM: info->i = 0; break; - case DEVINFO_INT_DATABUS_WIDTH + AS_DATA: info->i = 8; break; - case DEVINFO_INT_ADDRBUS_WIDTH + AS_DATA: info->i = 9; /* due to sfr mapping */ break; - case DEVINFO_INT_ADDRBUS_SHIFT + AS_DATA: info->i = 0; break; - case DEVINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 8; break; - case DEVINFO_INT_ADDRBUS_WIDTH + AS_IO: info->i = 18; /* 128k for ds5002fp */ break; - case DEVINFO_INT_ADDRBUS_SHIFT + AS_IO: info->i = 0; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = PPC; break; - case CPUINFO_INT_PC: info->i = PC; break; - case CPUINFO_INT_SP: info->i = SP; break; - - case CPUINFO_INT_REGISTER + MCS51_PC: info->i = PC; break; - case CPUINFO_INT_REGISTER + MCS51_SP: info->i = SP; break; - case CPUINFO_INT_REGISTER + MCS51_PSW: info->i = PSW; break; - case CPUINFO_INT_REGISTER + MCS51_ACC: info->i = ACC; break; - case CPUINFO_INT_REGISTER + MCS51_B: info->i = B; break; - case CPUINFO_INT_REGISTER + MCS51_DPH: info->i = DPH; break; - case CPUINFO_INT_REGISTER + MCS51_DPL: info->i = DPL; break; - case CPUINFO_INT_REGISTER + MCS51_IE: info->i = IE; break; - case CPUINFO_INT_REGISTER + MCS51_R0: info->i = R_REG(0); break; - case CPUINFO_INT_REGISTER + MCS51_R1: info->i = R_REG(1); break; - case CPUINFO_INT_REGISTER + MCS51_R2: info->i = R_REG(2); break; - case CPUINFO_INT_REGISTER + MCS51_R3: info->i = R_REG(3); break; - case CPUINFO_INT_REGISTER + MCS51_R4: info->i = R_REG(4); break; - case CPUINFO_INT_REGISTER + MCS51_R5: info->i = R_REG(5); break; - case CPUINFO_INT_REGISTER + MCS51_R6: info->i = R_REG(6); break; - case CPUINFO_INT_REGISTER + MCS51_R7: info->i = R_REG(7); break; - case CPUINFO_INT_REGISTER + MCS51_RB: info->i = R_REG(8); break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mcs51); break; - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(mcs51); break; - case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(mcs51); break; - case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(mcs51); break; - case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(mcs51); break; - case CPUINFO_FCT_BURN: info->burn = NULL; break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8051); break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &mcs51_state.icount; break; - - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = NULL; break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_DATA: info->internal_map8 = NULL; break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_IO: info->internal_map8 = NULL; break; - - case DEVINFO_STR_NAME: strcpy(info->s, "I8051"); break; - case DEVINFO_STR_FAMILY: strcpy(info->s, "MCS-51"); break; - case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; - case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; - case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Steve Ellenoff"); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c%c%c%c%c%c%c%c", - PSW & 0x80 ? 'C':'.', - PSW & 0x40 ? 'A':'.', - PSW & 0x20 ? 'F':'.', - PSW & 0x10 ? '0':'.', - PSW & 0x08 ? '1':'.', - PSW & 0x04 ? 'V':'.', - PSW & 0x02 ? '?':'.', - PSW & 0x01 ? 'P':'.'); - break; - - case CPUINFO_STR_REGISTER + MCS51_PC: sprintf(info->s, "PC:%04X", mcs51_state.pc); break; - case CPUINFO_STR_REGISTER + MCS51_SP: sprintf(info->s, "SP:%02X", SP); break; - case CPUINFO_STR_REGISTER + MCS51_PSW: sprintf(info->s, "PSW:%02X", PSW); break; - case CPUINFO_STR_REGISTER + MCS51_ACC: sprintf(info->s, "A:%02X", ACC); break; - case CPUINFO_STR_REGISTER + MCS51_B: sprintf(info->s, "B:%02X", B); break; - case CPUINFO_STR_REGISTER + MCS51_DPH: sprintf(info->s, "DPH:%02X", DPH); break; - case CPUINFO_STR_REGISTER + MCS51_DPL: sprintf(info->s, "DPL:%02X", DPL); break; - case CPUINFO_STR_REGISTER + MCS51_IE: sprintf(info->s, "IE:%02X", IE); break; - case CPUINFO_STR_REGISTER + MCS51_R0: sprintf(info->s, "R0:%02X", R_REG(0)); break; - case CPUINFO_STR_REGISTER + MCS51_R1: sprintf(info->s, "R1:%02X", R_REG(1)); break; - case CPUINFO_STR_REGISTER + MCS51_R2: sprintf(info->s, "R2:%02X", R_REG(2)); break; - case CPUINFO_STR_REGISTER + MCS51_R3: sprintf(info->s, "R3:%02X", R_REG(3)); break; - case CPUINFO_STR_REGISTER + MCS51_R4: sprintf(info->s, "R4:%02X", R_REG(4)); break; - case CPUINFO_STR_REGISTER + MCS51_R5: sprintf(info->s, "R5:%02X", R_REG(5)); break; - case CPUINFO_STR_REGISTER + MCS51_R6: sprintf(info->s, "R6:%02X", R_REG(6)); break; - case CPUINFO_STR_REGISTER + MCS51_R7: sprintf(info->s, "R7:%02X", R_REG(7)); break; - case CPUINFO_STR_REGISTER + MCS51_RB: sprintf(info->s, "RB:%02X", ((PSW & 0x18)>>3)); break; - } -} - -/************************************************************************** - * Specific get_info - **************************************************************************/ - -CPU_GET_INFO( i8031 ) -{ - switch (state) - { - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I8031"); break; - default: CPU_GET_INFO_CALL(mcs51); break; - } - /* --- the following bits of info are returned as NULL-terminated strings --- */ -} - -CPU_GET_INFO( i8051 ) -{ - switch (state) - { - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_12bit); break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I8051"); break; - default: CPU_GET_INFO_CALL(mcs51); break; - } - /* --- the following bits of info are returned as NULL-terminated strings --- */ -} - -CPU_GET_INFO( i8032 ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8052); break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8052); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I8032"); break; - default: CPU_GET_INFO_CALL(mcs51); break; - } -} - -CPU_GET_INFO( i8052 ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8052); break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_13bit); break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8052); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I8052"); break; - default: CPU_GET_INFO_CALL(mcs51); break; - } -} - -CPU_GET_INFO( i8751 ) -{ - switch (state) - { - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_12bit); break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I8751"); break; - default: CPU_GET_INFO_CALL(mcs51); break; - } -} - -CPU_GET_INFO( i8752 ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8052); break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_13bit); break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8052); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I8752"); break; - default: CPU_GET_INFO_CALL(mcs51); break; - } -} - -/************************************************************************** - * CMOS get_info - **************************************************************************/ - -CPU_GET_INFO( i80c31 ) -{ - /* according to PHILIPS datasheet this is a stripped down version - * of i80c52 with 128 bytes internal ram */ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c31); break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = NULL; break; - case DEVINFO_PTR_INTERNAL_MEMORY_MAP + AS_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c51); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I80C31"); break; - default: CPU_GET_INFO_CALL(i8031); break; - } -} - -CPU_GET_INFO( i80c51 ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c51); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c51); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I80C51"); break; - default: CPU_GET_INFO_CALL(i8051); break; - } -} - -CPU_GET_INFO( i80c32 ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c52); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c52); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I80C32"); break; - default: CPU_GET_INFO_CALL(i8032); break; - } -} - -CPU_GET_INFO( i80c52 ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c52); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I80C52"); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c52); break; - default: CPU_GET_INFO_CALL(i8052); break; - } -} - -CPU_GET_INFO( i87c51 ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c51); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I87C51"); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c51); break; - default: CPU_GET_INFO_CALL(i8751); break; - } -} - -CPU_GET_INFO( i87c52 ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c52); break; - case DEVINFO_STR_NAME: strcpy(info->s, "I87C52"); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c52); break; - default: CPU_GET_INFO_CALL(i8752); break; - } -} - -/************************************************************************** - * Other variants get_info - **************************************************************************/ - -CPU_GET_INFO( at89c4051 ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c51); break; - case DEVINFO_STR_NAME: strcpy(info->s, "AT89C4051"); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c51); break; - default: CPU_GET_INFO_CALL(i8051); break; - } -} - -CPU_GET_INFO( ds5002fp ) -{ - switch (state) - { - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ds5002fp); break; - case DEVINFO_STR_NAME: strcpy(info->s, "DS5002FP"); break; - case DEVINFO_STR_FAMILY: strcpy(info->s, "Dallas"); break; - case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; - case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; - case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Manuel Abadia"); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(ds5002fp); break; - default: CPU_GET_INFO_CALL(i8051); break; - } -} - -DEFINE_LEGACY_CPU_DEVICE(I8031, i8031); -DEFINE_LEGACY_CPU_DEVICE(I8032, i8032); -DEFINE_LEGACY_CPU_DEVICE(I8051, i8051); -DEFINE_LEGACY_CPU_DEVICE(I8751, i8751); -DEFINE_LEGACY_CPU_DEVICE(I8052, i8052); -DEFINE_LEGACY_CPU_DEVICE(I8752, i8752); -DEFINE_LEGACY_CPU_DEVICE(I80C31, i80c31); -DEFINE_LEGACY_CPU_DEVICE(I80C51, i80c51); -DEFINE_LEGACY_CPU_DEVICE(I87C51, i87c51); -DEFINE_LEGACY_CPU_DEVICE(I80C32, i80c32); -DEFINE_LEGACY_CPU_DEVICE(I80C52, i80c52); -DEFINE_LEGACY_CPU_DEVICE(I87C52, i87c52); -DEFINE_LEGACY_CPU_DEVICE(AT89C4051, at89c4051); -DEFINE_LEGACY_CPU_DEVICE(DS5002FP, ds5002fp); -#endif diff --git a/jan/src/cpu/i8051/mcs51.h b/jan/src/cpu/i8051/mcs51.h deleted file mode 100644 index 2940c9d09..000000000 --- a/jan/src/cpu/i8051/mcs51.h +++ /dev/null @@ -1,176 +0,0 @@ -/***************************************************************************** - * - * mcs51.h - * Portable MCS-51 Family Emulator - * - * Chips in the family: - * 8051 Product Line (8031,8051,8751) - * 8052 Product Line (8032,8052,8752) - * 8054 Product Line (8054) - * 8058 Product Line (8058) - * - * Copyright Steve Ellenoff, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - * This work is based on: - * #1) 'Intel(tm) MC51 Microcontroller Family Users Manual' and - * #2) 8051 simulator by Travis Marlatte - * #3) Portable UPI-41/8041/8741/8042/8742 emulator V0.1 by Juergen Buchmueller (MAME CORE) - * - * 2008, October, Couriersud - * - Rewrite of timer, interrupt and serial code - * - addition of CMOS features - * - internal memory maps - * - addition of new processor types - * - full emulation of 8xCx2 processors - *****************************************************************************/ - -#pragma once - -#ifndef __MCS51_H__ -#define __MCS51_H__ - - -enum -{ - MCS51_PC=1, MCS51_SP, MCS51_PSW, MCS51_ACC, MCS51_B, MCS51_DPH, MCS51_DPL, MCS51_IE, - MCS51_R0, MCS51_R1, MCS51_R2, MCS51_R3, MCS51_R4, MCS51_R5, MCS51_R6, MCS51_R7, MCS51_RB -}; - -enum -{ - MCS51_INT0_LINE = 0, /* P3.2: External Interrupt 0 */ - MCS51_INT1_LINE, /* P3.3: External Interrupt 1 */ - MCS51_RX_LINE, /* P3.0: Serial Port Receive Line */ - MCS51_T0_LINE, /* P3,4: Timer 0 External Input */ - MCS51_T1_LINE, /* P3.5: Timer 1 External Input */ - MCS51_T2_LINE, /* P1.0: Timer 2 External Input */ - MCS51_T2EX_LINE, /* P1.1: Timer 2 Capture Reload Trigger */ - - DS5002FP_PFI_LINE /* DS5002FP Power fail interrupt */ -}; - -/* special I/O space ports */ - -enum -{ - MCS51_PORT_P0 = 0x20000, - MCS51_PORT_P1 = 0x20001, - MCS51_PORT_P2 = 0x20002, - MCS51_PORT_P3 = 0x20003, - MCS51_PORT_TX = 0x20004 /* P3.1 */ -}; - -/*************************************************************************** - CONFIGURATION -***************************************************************************/ - -/* configuration of the DS5002FP */ -typedef struct _ds5002fp_config ds5002fp_config; -struct _ds5002fp_config -{ - UINT8 mcon; /* bootstrap loader MCON register */ - UINT8 rpctl; /* bootstrap loader RPCTL register */ - UINT8 crc; /* bootstrap loader CRC register */ -}; - -/*************************************************************************** - FUNCTION PROTOTYPES -***************************************************************************/ -extern void mcs51_init(void); /* Initialize cpu */ -extern void mcs51_reset(void); /* Reset registers to the initial values */ -extern void mcs51_exit(void); /* Shut down CPU core */ -extern INT32 mcs51Run(int cycles); /* /12 ! Execute cycles - returns number of cycles actually run */ -extern void mcs51RunEnd(void); /* stop execution */ -extern void mcs51_set_irq_line(int irqline, int state); -void mcs51_set_write_handler(void (*pointer)(INT32,UINT8)); -void mcs51_set_read_handler(UINT8 (*pointer)(INT32)); -void mcs51_scan(INT32 nAction); -extern UINT8 *mcs51_program_data; - -extern void ds5002fp_init(UINT8 mcon, UINT8 rpctl, UINT8 crc); // default: 0, 0, 0 -#define ds5002fp_reset mcs51_reset -#define ds5002fp_exit mcs51_exit -#define ds5002fpRun mcs51Run -#define ds5002fpRunEnd mcs51RunEnd -#define ds5002fp_set_irq_line mcs51_set_irq_line -#define ds5002fp_set_write_handler mcs51_set_write_handler -#define ds5002fp_set_read_handler mcs51_set_read_handler -#define ds5002fp_scan mcs51_scan -#define ds5002fp_program_data mcs51_program_data - -#if 0 -typedef void (*mcs51_serial_tx_func)(device_t *device, int data); -typedef int (*mcs51_serial_rx_func)(device_t *device); - -extern void i8051_set_serial_tx_callback(device_t *device, mcs51_serial_tx_func tx_func); -extern void i8051_set_serial_rx_callback(device_t *device, mcs51_serial_rx_func rx_func); - -/* variants with no internal rom and 128 byte internal memory */ -DECLARE_LEGACY_CPU_DEVICE(I8031, i8031); - -/* variants with no internal rom and 256 byte internal memory */ -DECLARE_LEGACY_CPU_DEVICE(I8032, i8032); - -/* variants 4k internal rom and 128 byte internal memory */ -DECLARE_LEGACY_CPU_DEVICE(I8051, i8051); -DECLARE_LEGACY_CPU_DEVICE(I8751, i8751); - -/* variants 8k internal rom and 256 byte internal memory and more registers */ -DECLARE_LEGACY_CPU_DEVICE(I8052, i8052); -DECLARE_LEGACY_CPU_DEVICE(I8752, i8752); - -/* cmos variants */ -DECLARE_LEGACY_CPU_DEVICE(I80C31, i80c31); -DECLARE_LEGACY_CPU_DEVICE(I80C51, i80c51); -DECLARE_LEGACY_CPU_DEVICE(I87C51, i87c51); - -DECLARE_LEGACY_CPU_DEVICE(I80C32, i80c32); -DECLARE_LEGACY_CPU_DEVICE(I80C52, i80c52); -DECLARE_LEGACY_CPU_DEVICE(I87C52, i87c52); - -/* 4k internal perom and 128 internal ram and 2 analog comparators */ -DECLARE_LEGACY_CPU_DEVICE(AT89C4051, at89c4051); - -/* - * The DS5002FP has 2 16 bits data address buses (the byte-wide bus and the expanded bus). The exact memory position accessed depends on the - * partition mode, the memory range and the expanded bus select. The partition mode and the expanded bus select can be changed at any time. - * - * In order to simplify memory mapping to the data address bus, the following address map is assumed for partitioned mode: - - * 0x00000-0x0ffff -> data memory on the expanded bus - * 0x10000-0x1ffff -> data memory on the byte-wide bus - - * For non-partitioned mode the following memory map is assumed: - - * 0x0000-0xffff -> data memory (the bus used to access it does not matter) - * - * Internal ram 128k and security features - */ - -DECLARE_LEGACY_CPU_DEVICE(DS5002FP, ds5002fp); - - -/**************************************************************************** - * Disassembler - ****************************************************************************/ - -CPU_DISASSEMBLE( i8051 ); -CPU_DISASSEMBLE( i80c51 ); -CPU_DISASSEMBLE( i8052 ); -CPU_DISASSEMBLE( i80c52 ); -CPU_DISASSEMBLE( ds5002fp ); -#endif - -#endif /* __MCS51_H__ */ diff --git a/jan/src/cpu/i8051/mcs51ops.c b/jan/src/cpu/i8051/mcs51ops.c deleted file mode 100644 index 85babdd70..000000000 --- a/jan/src/cpu/i8051/mcs51ops.c +++ /dev/null @@ -1,980 +0,0 @@ -/******************************************************************************************* - NOTE: All registers are accessed directly, instead of using the SFR_R() function for speed - Direct register access is availabe from the R_(register name) macros.. ex: ACC for the ACC - with the exception of the PC -********************************************************************************************/ - -//ACALL code addr /* 1: aaa1 0001 */ -OPHANDLER( acall ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab code address byte - PUSH_PC(); //Save PC to the stack - //Thanks Gerrit for help with this! :) - PC = (PC & 0xf800) | ((r & 0xe0) << 3) | addr; -} - -//ADD A, #data /* 1: 0010 0100 */ -OPHANDLER( add_a_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 result = ACC + data; //Add data to accumulator - DO_ADD_FLAGS(ACC,data,0); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//ADD A, data addr /* 1: 0010 0101 */ -OPHANDLER( add_a_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - UINT8 result = ACC + data; //Add data to accumulator - DO_ADD_FLAGS(ACC,data,0); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//ADD A, @R0/@R1 /* 1: 0010 011i */ -OPHANDLER( add_a_ir ) -{ - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from memory pointed to by R0 or R1 - UINT8 result = ACC + data; //Add data to accumulator - DO_ADD_FLAGS(ACC,data,0); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//ADD A, R0 to R7 /* 1: 0010 1rrr */ -OPHANDLER( add_a_r ) -{ - UINT8 data = R_REG(r); //Grab data from R0 - R7 - UINT8 result = ACC + data; //Add data to accumulator - DO_ADD_FLAGS(ACC,data,0); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//ADDC A, #data /* 1: 0011 0100 */ -OPHANDLER( addc_a_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 result = ACC + data + GET_CY; //Add data + carry flag to accumulator - DO_ADD_FLAGS(ACC,data,GET_CY); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//ADDC A, data addr /* 1: 0011 0101 */ -OPHANDLER( addc_a_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - UINT8 result = ACC + data + GET_CY; //Add data + carry flag to accumulator - DO_ADD_FLAGS(ACC,data,GET_CY); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//ADDC A, @R0/@R1 /* 1: 0011 011i */ -OPHANDLER( addc_a_ir ) -{ - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from memory pointed to by R0 or R1 - UINT8 result = ACC + data + GET_CY; //Add data + carry flag to accumulator - DO_ADD_FLAGS(ACC,data,GET_CY); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//ADDC A, R0 to R7 /* 1: 0011 1rrr */ -OPHANDLER( addc_a_r ) -{ - UINT8 data = R_REG(r); //Grab data from R0 - R7 - UINT8 result = ACC + data + GET_CY; //Add data + carry flag to accumulator - DO_ADD_FLAGS(ACC,data,GET_CY); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//AJMP code addr /* 1: aaa0 0001 */ -OPHANDLER( ajmp ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab code address byte - //Thanks Gerrit for help with this! :) - PC = (PC & 0xf800) | ((r & 0xe0) << 3) | addr; -} - -//ANL data addr, A /* 1: 0101 0010 */ -OPHANDLER( anl_mem_a ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - IRAM_W(addr,data & ACC); //Set data address value to it's value Logical AND with ACC -} - -//ANL data addr, #data /* 1: 0101 0011 */ -OPHANDLER( anl_mem_byte ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 srcdata = IRAM_R(addr); //Grab data from data address - IRAM_W(addr,srcdata & data); //Set data address value to it's value Logical AND with Data -} - -//ANL A, #data /* 1: 0101 0100 */ -OPHANDLER( anl_a_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - SET_ACC(ACC & data); //Set ACC to value of ACC Logical AND with Data -} - -//ANL A, data addr /* 1: 0101 0101 */ -OPHANDLER( anl_a_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - SET_ACC(ACC & data); //Set ACC to value of ACC Logical AND with Data -} - -//ANL A, @RO/@R1 /* 1: 0101 011i */ -OPHANDLER( anl_a_ir ) -{ - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from address R0 or R1 points to - SET_ACC(ACC & data); //Set ACC to value of ACC Logical AND with Data -} - -//ANL A, RO to R7 /* 1: 0101 1rrr */ -OPHANDLER( anl_a_r ) -{ - UINT8 data = R_REG(r); //Grab data from R0 - R7 - SET_ACC(ACC & data); //Set ACC to value of ACC Logical AND with Data -} - -//ANL C, bit addr /* 1: 1000 0010 */ -OPHANDLER( anl_c_bitaddr ) -{ - int cy = GET_CY; - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 bit = BIT_R(addr); //Grab bit data from bit address - SET_CY( (cy & bit) ); //Set Carry flag to Carry Flag Value Logical AND with Bit -} - -//ANL C,/bit addr /* 1: 1011 0000 */ -OPHANDLER( anl_c_nbitaddr ) -{ - int cy = GET_CY; - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 bit = BIT_R(addr); //Grab bit data from bit address - bit = ((~bit)&1); //Complement bit - SET_CY( (cy & bit) ); //Set Carry flag to Carry Flag Value Logical AND with Complemented Bit -} - -//CJNE A, #data, code addr /* 1: 1011 0100 */ -OPHANDLER( cjne_a_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - - if(ACC != data) //Jump if values are not equal - { - PC = PC + rel_addr; - } - - //Set carry flag to 1 if 1st compare value is < 2nd compare value - SET_CY( (ACC < data) ); -} - -//CJNE A, data addr, code addr /* 1: 1011 0101 */ -OPHANDLER( cjne_a_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - UINT8 data = IRAM_R(addr); //Pull value from data address - - if(ACC != data) //Jump if values are not equal - { - PC = PC + rel_addr; - } - - //Set carry flag to 1 if 1st compare value is < 2nd compare value - SET_CY( (ACC < data) ); -} - -//CJNE @R0/@R1, #data, code addr /* 1: 1011 011i */ -OPHANDLER( cjne_ir_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - UINT8 srcdata = IRAM_IR(R_REG(r)); //Grab value pointed to by R0 or R1 - - if(srcdata != data) //Jump if values are not equal - { - PC = PC + rel_addr; - } - - //Set carry flag to 1 if 1st compare value is < 2nd compare value - SET_CY( (srcdata < data) ); -} - -//CJNE R0 to R7, #data, code addr /* 1: 1011 1rrr */ -OPHANDLER( cjne_r_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - UINT8 srcdata = R_REG(r); //Grab value of R0 - R7 - - if(srcdata != data) //Jump if values are not equal - { - PC = PC + rel_addr; - } - - //Set carry flag to 1 if 1st compare value is < 2nd compare value - SET_CY( (srcdata < data) ); -} - -//CLR bit addr /* 1: 1100 0010 */ -OPHANDLER( clr_bitaddr ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab bit address - BIT_W(addr,0); //Clear bit at specified bit address -} - -//CLR C /* 1: 1100 0011 */ -OPHANDLER( clr_c ) -{ - SET_CY(0); //Clear Carry Flag -} - -//CLR A /* 1: 1110 0100 */ -OPHANDLER( clr_a ) -{ - SET_ACC(0); //Clear Accumulator -} - -//CPL bit addr /* 1: 1011 0010 */ -OPHANDLER( cpl_bitaddr ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 data = (~BIT_R(addr))&1; - BIT_W(addr,data); //Complement bit at specified bit address -} - -//CPL C /* 1: 1011 0011 */ -OPHANDLER( cpl_c ) -{ - UINT8 bit = (~GET_CY)&1; //Complement Carry Flag - SET_CY(bit); -} - -//CPL A /* 1: 1111 0100 */ -OPHANDLER( cpl_a ) -{ - UINT8 data = ((~ACC)&0xff); - SET_ACC(data); //Complement Accumulator -} - -//DA A /* 1: 1101 0100 */ -OPHANDLER( da_a ) -{ -/*From several sources, since none said the same thing: - The decimal adjust instruction is associated with the use of the ADD and ADDC instructions. - The eight-bit value in the accumulator is adjusted to form two BCD digits of four bits each. - If the accumulator contents bits 0-3 are greater than 9, OR the AC flag is set, then six is added to - produce a proper BCD digit. - If the carry is set, OR the four high bits 4-7 exceed nine, six is added to the value of these bits. - The carry flag will be set if the result is > 0x99, but not cleared otherwise */ - - UINT16 new_acc = ACC & 0xff; - if(GET_AC || (new_acc & 0x0f) > 0x09) - new_acc += 0x06; - if(GET_CY || ((new_acc & 0xf0) > 0x90) || (new_acc & ~0xff)) - new_acc += 0x60; - SET_ACC(new_acc&0xff); - if(new_acc & ~0xff) - SET_CY(1); -} - -//DEC A /* 1: 0001 0100 */ -OPHANDLER( dec_a ) -{ - SET_ACC(ACC-1); -} - -//DEC data addr /* 1: 0001 0101 */ -OPHANDLER( dec_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); - IRAM_W(addr,data-1); -} - -//DEC @R0/@R1 /* 1: 0001 011i */ -OPHANDLER( dec_ir ) -{ - UINT8 data = IRAM_IR(R_REG(r)); - IRAM_W(R_REG(r),data-1); -} - -//DEC R0 to R7 /* 1: 0001 1rrr */ -OPHANDLER( dec_r ) -{ - SET_REG(r, R_REG(r) - 1); -} - -//DIV AB /* 1: 1000 0100 */ -OPHANDLER( div_ab ) -{ - if( B == 0 ) { - //Overflow flag is set! - SET_OV(1); - //Really the values are undefined according to the manual, but we'll just leave them as is.. - //SET_ACC(0xff); - //SFR_W(B,0xff); - } - else { - int a = (int)ACC / B; - int b = (int)ACC % B; - //A gets quotient byte, B gets remainder byte - SET_ACC(a); - B = b; - //Overflow flag is cleared - SET_OV(0); - } - //Carry Flag is always cleared - SET_CY(0); -} - -//DJNZ data addr, code addr /* 1: 1101 0101 */ -OPHANDLER( djnz_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - IRAM_W(addr,IRAM_R(addr) - 1); //Decrement value contained at data address - if(IRAM_R(addr) != 0) //Branch if contents of data address is not 0 - { - PC = PC + rel_addr; - } -} - -//DJNZ R0 to R7,code addr /* 1: 1101 1rrr */ -OPHANDLER( djnz_r ) -{ - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - SET_REG(r ,R_REG(r) - 1); //Decrement value - if(R_REG(r) != 0) //Branch if contents of R0 - R7 is not 0 - { - PC = PC + rel_addr; - } -} - -//INC A /* 1: 0000 0100 */ -OPHANDLER( inc_a ) -{ - SET_ACC(ACC+1); -} - -//INC data addr /* 1: 0000 0101 */ -OPHANDLER( inc_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); - IRAM_W(addr,data+1); -} - -//INC @R0/@R1 /* 1: 0000 011i */ -OPHANDLER( inc_ir ) -{ - UINT8 data = IRAM_IR(R_REG(r)); - IRAM_W(R_REG(r),data+1); -} - -//INC R0 to R7 /* 1: 0000 1rrr */ -OPHANDLER( inc_r ) -{ - UINT8 data = R_REG(r); - SET_REG(r, data + 1); -} - -//INC DPTR /* 1: 1010 0011 */ -OPHANDLER( inc_dptr ) -{ - UINT16 dptr = (DPTR)+1; - SET_DPTR(dptr); -} - -//JB bit addr, code addr /* 1: 0010 0000 */ -OPHANDLER( jb ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab bit address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - if(BIT_R(addr)) //If bit set at specified bit address, jump - { - PC = PC + rel_addr; - } -} - -//JBC bit addr, code addr /* 1: 0001 0000 */ -OPHANDLER( jbc ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab bit address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - if(BIT_R(addr)) { //If bit set at specified bit address, jump - PC = PC + rel_addr; - BIT_W(addr,0); //Clear Bit also - } -} - -//JC code addr /* 1: 0100 0000 */ -OPHANDLER( jc ) -{ - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - if(GET_CY) //Jump if Carry Flag Set - { - PC = PC + rel_addr; - } -} - -//JMP @A+DPTR /* 1: 0111 0011 */ -OPHANDLER( jmp_iadptr ) -{ - PC = ACC + DPTR; -} - -//JNB bit addr, code addr /* 1: 0011 0000 */ -OPHANDLER( jnb ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab bit address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - if(!BIT_R(addr)) //If bit NOT set at specified bit address, jump - { - PC = PC + rel_addr; - } -} - -//JNC code addr /* 1: 0101 0000 */ -OPHANDLER( jnc ) -{ - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - if(!GET_CY) //Jump if Carry Flag not set - { - PC = PC + rel_addr; - } -} - -//JNZ code addr /* 1: 0111 0000 */ -OPHANDLER( jnz ) -{ - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - if(ACC != 0) //Branch if ACC is not 0 - { - PC = PC+rel_addr; - } -} - -//JZ code addr /* 1: 0110 0000 */ -OPHANDLER( jz ) -{ - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - if(ACC == 0) //Branch if ACC is 0 - { - PC = PC+rel_addr; - } -} - -//LCALL code addr /* 1: 0001 0010 */ -OPHANDLER( lcall ) -{ - UINT8 addr_hi, addr_lo; - addr_hi = ROP_ARG(PC++); - addr_lo = ROP_ARG(PC++); - PUSH_PC(); - PC = (UINT16)((addr_hi<<8) | addr_lo); -} - -//LJMP code addr /* 1: 0000 0010 */ -OPHANDLER( ljmp ) -{ - UINT8 addr_hi, addr_lo; - addr_hi = ROP_ARG(PC++); - addr_lo = ROP_ARG(PC++); - PC = (UINT16)((addr_hi<<8) | addr_lo); -} - -//MOV A, #data /* 1: 0111 0100 */ -OPHANDLER( mov_a_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - SET_ACC(data); //Store data to ACC -} - -//MOV A, data addr /* 1: 1110 0101 */ -OPHANDLER( mov_a_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - SET_ACC(IRAM_R(addr)); //Store contents of data address to ACC -} - -//MOV A,@RO/@R1 /* 1: 1110 011i */ -OPHANDLER( mov_a_ir ) -{ - SET_ACC(IRAM_IR(R_REG(r))); //Store contents of address pointed by R0 or R1 to ACC -} - -//MOV A,R0 to R7 /* 1: 1110 1rrr */ -OPHANDLER( mov_a_r ) -{ - SET_ACC(R_REG(r)); //Store contents of R0 - R7 to ACC -} - -//MOV data addr, #data /* 1: 0111 0101 */ -OPHANDLER( mov_mem_byte ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = ROP_ARG(PC++); //Grab data - IRAM_W(addr,data); //Store data to data address location -} - -//MOV data addr, data addr /* 1: 1000 0101 */ -OPHANDLER( mov_mem_mem ) -{ - //1st address is src, 2nd is dst, but the mov command works as mov dst,src) - UINT8 src,dst; - src = ROP_ARG(PC++); //Grab source data address - dst = ROP_ARG(PC++); //Grab destination data address - IRAM_W(dst,IRAM_R(src)); //Read source address contents and store to destination address -} - -//MOV @R0/@R1, #data /* 1: 0111 011i */ -OPHANDLER( mov_ir_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - IRAM_IW(R_REG(r),data); //Store data to address pointed by R0 or R1 -} - -//MOV R0 to R7, #data /* 1: 0111 1rrr */ -OPHANDLER( mov_r_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - SET_REG(r, data); //Store to R0 - R7 -} - -//MOV data addr, @R0/@R1 /* 1: 1000 011i */ -OPHANDLER( mov_mem_ir ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - IRAM_W(addr,IRAM_IR(R_REG(r))); //Store contents pointed to by R0 or R1 to data address -} - -//MOV data addr,R0 to R7 /* 1: 1000 1rrr */ -OPHANDLER( mov_mem_r ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - IRAM_W(addr,R_REG(r)); //Store contents of R0 - R7 to data address -} - -//MOV DPTR, #data16 /* 1: 1001 0000 */ -OPHANDLER( mov_dptr_byte ) -{ - UINT8 data_hi, data_lo; - data_hi = ROP_ARG(PC++); //Grab hi byte - data_lo = ROP_ARG(PC++); //Grab lo byte - SET_DPTR((UINT16)((data_hi<<8)|data_lo)); //Store to DPTR -} - -//MOV bit addr, C /* 1: 1001 0010 */ -OPHANDLER( mov_bitaddr_c ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab bit address - BIT_W(addr,GET_CY); //Store Carry Flag to Bit Address -} - -//MOV @R0/@R1, data addr /* 1: 1010 011i */ -OPHANDLER( mov_ir_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - IRAM_IW(R_REG(r),IRAM_R(addr)); //Store data from data address to address pointed to by R0 or R1 -} - -//MOV R0 to R7, data addr /* 1: 1010 1rrr */ -OPHANDLER( mov_r_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - SET_REG(r, IRAM_R(addr)); //Store to R0 - R7 -} - -//MOV data addr, A /* 1: 1111 0101 */ -OPHANDLER( mov_mem_a ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - IRAM_W(addr,ACC); //Store A to data address -} - -//MOV @R0/@R1, A /* 1: 1111 011i */ -OPHANDLER( mov_ir_a ) -{ - IRAM_IW(R_REG(r),ACC); //Store A to location pointed to by R0 or R1 -} - -//MOV R0 to R7, A /* 1: 1111 1rrr */ -OPHANDLER( mov_r_a ) -{ - SET_REG(r, ACC); //Store A to R0-R7 -} - -//MOVC A, @A + PC /* 1: 1000 0011 */ -OPHANDLER( movc_a_iapc ) -{ - UINT8 data; - data = CODEMEM_R(ACC+PC); //Move a byte from CODE(Program) Memory and store to ACC - SET_ACC(data); -} - -//MOV C, bit addr /* 1: 1010 0010 */ -OPHANDLER( mov_c_bitaddr ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab bit address - SET_CY( (BIT_R(addr)) ); //Store Bit from Bit Address to Carry Flag -} - -//MOVC A, @A + DPTR /* 1: 1001 0011 */ -OPHANDLER( movc_a_iadptr ) -{ - UINT8 data; - data = CODEMEM_R(ACC + DPTR); //Move a byte from CODE(Program) Memory and store to ACC - SET_ACC(data); -} - -//MOVX A,@DPTR /* 1: 1110 0000 */ -//(Move External Ram 16 bit address to A) -OPHANDLER( movx_a_idptr ) -{ -// UINT8 byte = DATAMEM_R(R_DPTR); //Grab 1 byte from External DATA memory pointed to by dptr - UINT32 addr = ERAM_ADDR(DPTR, 0xFFFF); - UINT8 byte = DATAMEM_R(addr); //Grab 1 byte from External DATA memory pointed to by dptr - SET_ACC(byte); //Store to ACC -} - -//MOVX A, @R0/@R1 /* 1: 1110 001i */ -//(Move External Ram 8 bit address to A) -OPHANDLER( movx_a_ir ) -{ - UINT32 addr = ERAM_ADDR(R_REG(r),0xFF); //Grab address by reading location pointed to by R0 or R1 - UINT8 byte = DATAMEM_R(addr); //Grab 1 byte from External DATA memory pointed to by address - SET_ACC(byte); //Store to ACC -} - -//MOVX @DPTR,A /* 1: 1111 0000 */ -//(Move A to External Ram 16 bit address) -OPHANDLER( movx_idptr_a ) -{ -// DATAMEM_W(R_DPTR, ACC); //Store ACC to External DATA memory address pointed to by DPTR - UINT32 addr = ERAM_ADDR(DPTR, 0xFFFF); - DATAMEM_W(addr, ACC); //Store ACC to External DATA memory address pointed to by DPTR -} - -//MOVX @R0/@R1,A /* 1: 1111 001i */ -//(Move A to External Ram 8 bit address) -OPHANDLER( movx_ir_a ) -{ - UINT32 addr = ERAM_ADDR(R_REG(r),0xFF); //Grab address by reading location pointed to by R0 or R1 - DATAMEM_W(addr, ACC); //Store ACC to External DATA memory address -} - -//MUL AB /* 1: 1010 0100 */ -OPHANDLER( mul_ab ) -{ - UINT16 result = ACC * B; - //A gets lo bits, B gets hi bits of result - B = (UINT8) ((result & 0xFF00) >> 8); - SET_ACC((UINT8)(result & 0x00FF)); - //Set flags - SET_OV( ((result & 0x100) >> 8) ); //Set/Clear Overflow Flag if result > 255 - SET_CY(0); //Carry Flag always cleared -} - -//NOP /* 1: 0000 0000 */ -OPHANDLER( nop ) -{ -} - -//ORL data addr, A /* 1: 0100 0010 */ -OPHANDLER( orl_mem_a ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - IRAM_W(addr,data | ACC); //Set data address value to it's value Logical OR with ACC -} - -//ORL data addr, #data /* 1: 0100 0011 */ -OPHANDLER( orl_mem_byte ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 srcdata = IRAM_R(addr); //Grab data from data address - IRAM_W(addr,srcdata | data); //Set data address value to it's value Logical OR with Data -} - -//ORL A, #data /* 1: 0100 0100 */ -OPHANDLER( orl_a_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - SET_ACC(ACC | data); //Set ACC to value of ACC Logical OR with Data -} - -//ORL A, data addr /* 1: 0100 0101 */ -OPHANDLER( orl_a_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - SET_ACC(ACC | data); //Set ACC to value of ACC Logical OR with Data -} - -//ORL A, @RO/@R1 /* 1: 0100 011i */ -OPHANDLER( orl_a_ir ) -{ - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from address R0 or R1 points to - SET_ACC(ACC | data); //Set ACC to value of ACC Logical OR with Data -} - -//ORL A, RO to R7 /* 1: 0100 1rrr */ -OPHANDLER( orl_a_r ) -{ - UINT8 data = R_REG(r); //Grab data from R0 - R7 - SET_ACC(ACC | data); //Set ACC to value of ACC Logical OR with Data -} - -//ORL C, bit addr /* 1: 0111 0010 */ -OPHANDLER( orl_c_bitaddr ) -{ - int cy = GET_CY; - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 bit = BIT_R(addr); //Grab bit data from bit address - SET_CY( (cy | bit) ); //Set Carry flag to Carry Flag Value Logical OR with Bit -} - -//ORL C, /bit addr /* 1: 1010 0000 */ -OPHANDLER( orl_c_nbitaddr ) -{ - int cy = GET_CY; - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 bit = BIT_R(addr); //Grab bit data from bit address - bit = ((~bit)&1); //Complement bit - SET_CY( (cy | bit) ); //Set Carry flag to Carry Flag Value Logical OR with Complemented Bit -} - -//POP data addr /* 1: 1101 0000 */ -OPHANDLER( pop ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - IRAM_W(addr, IRAM_IR(SP)); //Store to contents of data addr, data pointed to by Stack - IRAM_IR needed to access upper 128 bytes of stack - //IRAM_IW(addr, IRAM_IR(R_SP)); //Store to contents of data addr, data pointed to by Stack - doesn't work, sfr's are not restored this way and it's not an indirect access anyway - SP = SP-1; //Decrement SP -} - -//PUSH data addr /* 1: 1100 0000 */ -OPHANDLER( push ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 tmpSP = SP+1; //Grab and Increment Stack Pointer - SP = tmpSP; // "" - IRAM_IW(tmpSP, IRAM_R(addr)); //Store to stack contents of data address - IRAM_IW needed to store to upper 128 bytes of stack, however, can't use IRAM_IR because that won't store the sfrs and it's not an indirect access anyway -} - -//RET /* 1: 0010 0010 */ -OPHANDLER( ret ) -{ - POP_PC(); -} - -//RETI /* 1: 0011 0010 */ -OPHANDLER( reti ) -{ - POP_PC(); - CLEAR_CURRENT_IRQ(); -} - -//RL A /* 1: 0010 0011 */ -OPHANDLER( rl_a ) -{ - //Left Shift A, Bit 7 carries to Bit 0 - int carry = ((ACC & 0x80) >> 7); - int data = (ACC<<1) & 0xfe; - SET_ACC( data | carry); -} - -//RLC A /* 1: 0011 0011 */ -OPHANDLER( rlc_a ) -{ - //Left Shift A, Bit 7 goes to Carry Flag, Original Carry Flag goes to Bit 0 of ACC - int carry = ((ACC & 0x80) >> 7); - int data = ((ACC<<1) & 0xfe) | GET_CY; - SET_ACC( data); - SET_CY(carry); -} - -//RR A /* 1: 0000 0011 */ -OPHANDLER( rr_a ) -{ - //Right Shift A, Bit 0 carries to Bit 7 - int carry = ((ACC & 1) << 7); - int data = (ACC>>1) & 0x7f; - SET_ACC( data | carry); -} - -//RRC A /* 1: 0001 0011 */ -OPHANDLER( rrc_a ) -{ - //Right Shift A, Bit 0 goes to Carry Flag, Bit 7 of ACC gets set to original Carry Flag - int carry = (ACC & 1); - int data = ((ACC>>1) & 0x7f) | (GET_CY<<7); - SET_ACC( data); - SET_CY(carry); -} - -//SETB C /* 1: 1101 0011 */ -OPHANDLER( setb_c ) -{ - SET_CY(1); //Set Carry Flag -} - -//SETB bit addr /* 1: 1101 0010 */ -OPHANDLER( setb_bitaddr ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab bit address - BIT_W(addr,1); //Set Bit at Bit Address -} - -//SJMP code addr /* 1: 1000 0000 */ -OPHANDLER( sjmp ) -{ - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - PC = PC + rel_addr; //Update PC -} - -//SUBB A, #data /* 1: 1001 0100 */ -OPHANDLER( subb_a_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator - DO_SUB_FLAGS(ACC,data,GET_CY); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC - -} - -//SUBB A, data addr /* 1: 1001 0101 */ -OPHANDLER( subb_a_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - UINT8 result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator - DO_SUB_FLAGS(ACC,data,GET_CY); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//SUBB A, @R0/@R1 /* 1: 1001 011i */ -OPHANDLER( subb_a_ir ) -{ - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from memory pointed to by R0 or R1 - UINT8 result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator - DO_SUB_FLAGS(ACC,data,GET_CY); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//SUBB A, R0 to R7 /* 1: 1001 1rrr */ -OPHANDLER( subb_a_r ) -{ - UINT8 data = R_REG(r); //Grab data from R0 - R7 - UINT8 result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator - DO_SUB_FLAGS(ACC,data,GET_CY); //Set Flags - SET_ACC(result); //Store 8 bit result of addtion in ACC -} - -//SWAP A /* 1: 1100 0100 */ -OPHANDLER( swap_a ) -{ - UINT8 a_nib_lo, a_nib_hi; - a_nib_hi = (ACC & 0x0f) << 4; //Grab lo byte of ACC and move to hi - a_nib_lo = (ACC & 0xf0) >> 4; //Grab hi byte of ACC and move to lo - SET_ACC( a_nib_hi | a_nib_lo); -} - -//XCH A, data addr /* 1: 1100 0101 */ -OPHANDLER( xch_a_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data - UINT8 oldACC = ACC; //Hold value of ACC - SET_ACC(data); //Sets ACC to data - IRAM_W(addr,oldACC); //Sets data address to old value of ACC -} - -//XCH A, @RO/@R1 /* 1: 1100 011i */ -OPHANDLER( xch_a_ir ) -{ - UINT8 data = IRAM_IR(R_REG(r)); //Grab data pointed to by R0 or R1 - UINT8 oldACC = ACC; //Hold value of ACC - SET_ACC(data); //Sets ACC to data - IRAM_W(R_REG(r),oldACC); //Sets data address to old value of ACC -} - -//XCH A, RO to R7 /* 1: 1100 1rrr */ -OPHANDLER( xch_a_r ) -{ - UINT8 data = R_REG(r); //Grab data from R0-R7 - UINT8 oldACC = ACC; //Hold value of ACC - SET_ACC(data); //Sets ACC to data - SET_REG(r, oldACC); //Sets data address to old value of ACC -} - -//XCHD A, @R0/@R1 /* 1: 1101 011i */ -OPHANDLER( xchd_a_ir ) -{ - UINT8 acc, ir_data; - ir_data = IRAM_IR(R_REG(r)); //Grab data pointed to by R0 or R1 - acc = ACC; //Grab ACC value - SET_ACC( (acc & 0xf0) | (ir_data & 0x0f) ); //Set ACC to lower nibble of data pointed to by R0 or R1 - IRAM_W(R_REG(r), (ir_data & 0xf0) | (acc & 0x0f) ); //Set data pointed to by R0 or R1 to lower nibble of ACC -} - -//XRL data addr, A /* 1: 0110 0010 */ -OPHANDLER( xrl_mem_a ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - IRAM_W(addr,data ^ ACC); //Set data address value to it's value Logical XOR with ACC -} - -//XRL data addr, #data /* 1: 0110 0011 */ -OPHANDLER( xrl_mem_byte ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 srcdata = IRAM_R(addr); //Grab data from data address - IRAM_W(addr,srcdata ^ data); //Set data address value to it's value Logical XOR with Data -} - -//XRL A, #data /* 1: 0110 0100 */ -OPHANDLER( xrl_a_byte ) -{ - UINT8 data = ROP_ARG(PC++); //Grab data - SET_ACC(ACC ^ data); //Set ACC to value of ACC Logical XOR with Data -} - -//XRL A, data addr /* 1: 0110 0101 */ -OPHANDLER( xrl_a_mem ) -{ - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - SET_ACC(ACC ^ data); //Set ACC to value of ACC Logical XOR with Data -} - -//XRL A, @R0/@R1 /* 1: 0110 011i */ -OPHANDLER( xrl_a_ir ) -{ - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from address R0 or R1 points to - SET_ACC(ACC ^ data); //Set ACC to value of ACC Logical XOR with Data -} - -//XRL A, R0 to R7 /* 1: 0110 1rrr */ -OPHANDLER( xrl_a_r ) -{ - UINT8 data = R_REG(r); //Grab data from R0 - R7 - SET_ACC(ACC ^ data); //Set ACC to value of ACC Logical XOR with Data -} - -//illegal opcodes -OPHANDLER( illegal ) -{ - LOG(("i8051 '%s': illegal opcode at 0x%03x: %02x\n", mcs51_state->device->tag(), PC-1, r)); -} diff --git a/jan/src/cpu/konami/konami.cpp b/jan/src/cpu/konami/konami.cpp deleted file mode 100644 index 7c357be2c..000000000 --- a/jan/src/cpu/konami/konami.cpp +++ /dev/null @@ -1,601 +0,0 @@ -/*** konami: Portable Konami cpu emulator ****************************************** - - Copyright Nicola Salmoria and the MAME Team - - Based on M6809 cpu core copyright John Butler - - References: - - 6809 Simulator V09, By L.C. Benschop, Eidnhoven The Netherlands. - - m6809: Portable 6809 emulator, DS (6809 code in MAME, derived from - the 6809 Simulator V09) - - 6809 Microcomputer Programming & Interfacing with Experiments" - by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits - arrays up to 65536 bytes must be supported - machine must be twos complement - - History: -991022 HJB: - Tried to improve speed: Using bit7 of cycles1 as flag for multi - byte opcodes is gone, those opcodes now instead go through opcode2(). - KONAMI_INLINEd fetch_effective_address() into that function as well. - Got rid of the slow/fast flags for stack (S and U) memory accesses. - Minor changes to use 32 bit values as arguments to memory functions - and added defines for that purpose (e.g. X = 16bit XD = 32bit). - -990720 EHC: - Created this file - -*****************************************************************************/ - -#include "burnint.h" -#include "konami.h" -#include "konami_intf.h" -#define VERBOSE 0 - -#define change_pc(x) PC=x -#define logerror printf - -#define LOG(x) do { if (VERBOSE) logerror x; } while (0) - -#define KONAMI_INLINE inline - -/* Konami Registers */ -typedef struct -{ - PAIR pc; /* Program counter */ - PAIR ppc; /* Previous program counter */ - PAIR d; /* Accumulator a and b */ - PAIR dp; /* Direct Page register (page in MSB) */ - PAIR u, s; /* Stack pointers */ - PAIR x, y; /* Index registers */ - UINT8 cc; - UINT8 ireg; /* first opcode */ - UINT8 irq_state[2]; - int extra_cycles; /* cycles used up by interrupts */ - UINT8 int_state; /* SYNC and CWAI flags */ - UINT8 nmi_state; - int nTotalCycles; - int hold_irq; - ALIGN_VAR(8) int (*irq_callback)(int irqline); - ALIGN_VAR(8) void (*setlines_callback)( int lines ); /* callback called when A16-A23 are set */ -} konami_Regs; - -/* flag bits in the cc register */ -#define CC_C 0x01 /* Carry */ -#define CC_V 0x02 /* Overflow */ -#define CC_Z 0x04 /* Zero */ -#define CC_N 0x08 /* Negative */ -#define CC_II 0x10 /* Inhibit IRQ */ -#define CC_H 0x20 /* Half (auxiliary) carry */ -#define CC_IF 0x40 /* Inhibit FIRQ */ -#define CC_E 0x80 /* entire state pushed */ - -/* Konami registers */ -static konami_Regs konami; - -#define pPPC konami.ppc -#define pPC konami.pc -#define pU konami.u -#define pS konami.s -#define pX konami.x -#define pY konami.y -#define pD konami.d - -#define PPC konami.ppc.w.l -#define PC konami.pc.w.l -#define PCD konami.pc.d -#define U konami.u.w.l -#define UD konami.u.d -#define S konami.s.w.l -#define SD konami.s.d -#define X konami.x.w.l -#define XD konami.x.d -#define Y konami.y.w.l -#define YD konami.y.d -#define D konami.d.w.l -#define A konami.d.b.h -#define B konami.d.b.l -#define DP konami.dp.b.h -#define DPD konami.dp.d -#define CC konami.cc - -static PAIR ea; /* effective address */ -#define EA ea.w.l -#define EAD ea.d - -#define KONAMI_CWAI 8 /* set when CWAI is waiting for an interrupt */ -#define KONAMI_SYNC 16 /* set when SYNC is waiting for an interrupt */ -#define KONAMI_LDS 32 /* set when LDS occured at least once */ - -static int nCyclesToDo = 0; - -#define CHECK_IRQ_LINES \ - if( konami.irq_state[KONAMI_IRQ_LINE] != CPU_IRQSTATUS_NONE || \ - konami.irq_state[KONAMI_FIRQ_LINE] != CPU_IRQSTATUS_NONE ) \ - konami.int_state &= ~KONAMI_SYNC; /* clear SYNC flag */ \ - if( konami.irq_state[KONAMI_FIRQ_LINE]!=CPU_IRQSTATUS_NONE && !(CC & CC_IF) ) \ - { \ - /* fast IRQ */ \ - /* state already saved by CWAI? */ \ - if( konami.int_state & KONAMI_CWAI ) \ - { \ - konami.int_state &= ~KONAMI_CWAI; /* clear CWAI */ \ - konami.extra_cycles += 7; /* subtract +7 cycles */ \ - } \ - else \ - { \ - CC &= ~CC_E; /* save 'short' state */ \ - PUSHWORD(pPC); \ - PUSHBYTE(CC); \ - konami.extra_cycles += 10; /* subtract +10 cycles */ \ - } \ - CC |= CC_IF | CC_II; /* inhibit FIRQ and IRQ */ \ - PCD = RM16(0xfff6); \ - change_pc(PC); /* TS 971002 */ \ - if (konami.hold_irq == (1 << KONAMI_FIRQ_LINE)) { \ - konami.hold_irq = 0; \ - konami.irq_state[KONAMI_FIRQ_LINE] = 0; \ - } \ - (void)(*konami.irq_callback)(KONAMI_FIRQ_LINE); \ - } \ - else \ - if( konami.irq_state[KONAMI_IRQ_LINE]!=CPU_IRQSTATUS_NONE && !(CC & CC_II) )\ - { \ - /* standard IRQ */ \ - /* state already saved by CWAI? */ \ - if( konami.int_state & KONAMI_CWAI ) \ - { \ - konami.int_state &= ~KONAMI_CWAI; /* clear CWAI flag */ \ - konami.extra_cycles += 7; /* subtract +7 cycles */ \ - } \ - else \ - { \ - CC |= CC_E; /* save entire state */ \ - PUSHWORD(pPC); \ - PUSHWORD(pU); \ - PUSHWORD(pY); \ - PUSHWORD(pX); \ - PUSHBYTE(DP); \ - PUSHBYTE(B); \ - PUSHBYTE(A); \ - PUSHBYTE(CC); \ - konami.extra_cycles += 19; /* subtract +19 cycles */ \ - } \ - CC |= CC_II; /* inhibit IRQ */ \ - PCD = RM16(0xfff8); \ - change_pc(PC); /* TS 971002 */ \ - if (konami.hold_irq == (1 << KONAMI_IRQ_LINE)) { \ - konami.hold_irq = 0; \ - konami.irq_state[KONAMI_IRQ_LINE] = 0; \ - } \ - (void)(*konami.irq_callback)(KONAMI_IRQ_LINE); \ - } - -/* public globals */ -static int konami_ICount; -//int konami_Flags; /* flags for speed optimization (obsolete!!) */ - -/* these are re-defined in konami.h TO RAM, ROM or functions in memory.c */ -#define RM(Addr) KONAMI_RDMEM(Addr) -#define WM(Addr,Value) KONAMI_WRMEM(Addr,Value) -#define ROP(Addr) KONAMI_RDOP(Addr) -#define ROP_ARG(Addr) KONAMI_RDOP_ARG(Addr) - -#define SIGNED(a) (UINT16)(INT16)(INT8)(a) - -/* macros to access memory */ -#define IMMBYTE(b) { b = ROP_ARG(PCD); PC++; } -#define IMMWORD(w) { w.d = (ROP_ARG(PCD)<<8) | ROP_ARG(PCD+1); PC += 2; } - -#define PUSHBYTE(b) --S; WM(SD,b) -#define PUSHWORD(w) --S; WM(SD,w.b.l); --S; WM(SD,w.b.h) -#define PULLBYTE(b) b=KONAMI_RDMEM(SD); S++ -#define PULLWORD(w) w=KONAMI_RDMEM(SD)<<8; S++; w|=KONAMI_RDMEM(SD); S++ - -#define PSHUBYTE(b) --U; WM(UD,b); -#define PSHUWORD(w) --U; WM(UD,w.b.l); --U; WM(UD,w.b.h) -#define PULUBYTE(b) b=KONAMI_RDMEM(UD); U++ -#define PULUWORD(w) w=KONAMI_RDMEM(UD)<<8; U++; w|=KONAMI_RDMEM(UD); U++ - -#define CLR_HNZVC CC&=~(CC_H|CC_N|CC_Z|CC_V|CC_C) -#define CLR_NZV CC&=~(CC_N|CC_Z|CC_V) -#define CLR_NZ CC&=~(CC_N|CC_Z) -#define CLR_HNZC CC&=~(CC_H|CC_N|CC_Z|CC_C) -#define CLR_NZVC CC&=~(CC_N|CC_Z|CC_V|CC_C) -#define CLR_Z CC&=~(CC_Z) -#define CLR_NZC CC&=~(CC_N|CC_Z|CC_C) -#define CLR_ZC CC&=~(CC_Z|CC_C) - -/* macros for CC -- CC bits affected should be reset before calling */ -#define SET_Z(a) if(!a)SEZ -#define SET_Z8(a) SET_Z((UINT8)a) -#define SET_Z16(a) SET_Z((UINT16)a) -#define SET_N8(a) CC|=((a&0x80)>>4) -#define SET_N16(a) CC|=((a&0x8000)>>12) -#define SET_H(a,b,r) CC|=(((a^b^r)&0x10)<<1) -#define SET_C8(a) CC|=((a&0x100)>>8) -#define SET_C16(a) CC|=((a&0x10000)>>16) -#define SET_V8(a,b,r) CC|=(((a^b^r^(r>>1))&0x80)>>6) -#define SET_V16(a,b,r) CC|=(((a^b^r^(r>>1))&0x8000)>>14) - -static const UINT8 flags8i[256]= /* increment */ -{ -CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -CC_N|CC_V,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N -}; -static const UINT8 flags8d[256]= /* decrement */ -{ -CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,CC_V, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N -}; -#define SET_FLAGS8I(a) {CC|=flags8i[(a)&0xff];} -#define SET_FLAGS8D(a) {CC|=flags8d[(a)&0xff];} - -/* combos */ -#define SET_NZ8(a) {SET_N8(a);SET_Z(a);} -#define SET_NZ16(a) {SET_N16(a);SET_Z(a);} -#define SET_FLAGS8(a,b,r) {SET_N8(r);SET_Z8(r);SET_V8(a,b,r);SET_C8(r);} -#define SET_FLAGS16(a,b,r) {SET_N16(r);SET_Z16(r);SET_V16(a,b,r);SET_C16(r);} - -/* macros for addressing modes (postbytes have their own code) */ -#define DIRECT EAD = DPD; IMMBYTE(ea.b.l) -#define IMM8 EAD = PCD; PC++ -#define IMM16 EAD = PCD; PC+=2 -#define EXTENDED IMMWORD(ea) - -/* macros to set status flags */ -#if defined(SEC) -#undef SEC -#endif -#define SEC CC|=CC_C -#define CLC CC&=~CC_C -#define SEZ CC|=CC_Z -#define CLZ CC&=~CC_Z -#define SEN CC|=CC_N -#define CLN CC&=~CC_N -#define SEV CC|=CC_V -#define CLV CC&=~CC_V -#define SEH CC|=CC_H -#define CLH CC&=~CC_H - -/* macros for convenience */ -#define DIRBYTE(b) DIRECT; b=RM(EAD) -#define DIRWORD(w) DIRECT; w.d=RM16(EAD) -#define EXTBYTE(b) EXTENDED; b=RM(EAD) -#define EXTWORD(w) EXTENDED; w.d=RM16(EAD) - -/* macros for branch instructions */ -#define BRANCH(f) { \ - UINT8 t; \ - IMMBYTE(t); \ - if( f ) \ - { \ - PC += SIGNED(t); \ - change_pc(PC); /* TS 971002 */ \ - } \ -} - -#define LBRANCH(f) { \ - PAIR t; \ - IMMWORD(t); \ - if( f ) \ - { \ - konami_ICount -= 1; \ - PC += t.w.l; \ - change_pc(PC); /* TS 971002 */ \ - } \ -} - -#define NXORV ((CC&CC_N)^((CC&CC_V)<<2)) - -/* macros for setting/getting registers in TFR/EXG instructions */ -#define GETREG(val,reg) \ - switch(reg) { \ - case 0: val = A; break; \ - case 1: val = B; break; \ - case 2: val = X; break; \ - case 3: val = Y; break; \ - case 4: val = S; break; /* ? */ \ - case 5: val = U; break; \ - default: val = 0xff; logerror("Unknown TFR/EXG idx at PC:%04x\n", PC ); break; \ -} - -#define SETREG(val,reg) \ - switch(reg) { \ - case 0: A = val; break; \ - case 1: B = val; break; \ - case 2: X = val; break; \ - case 3: Y = val; break; \ - case 4: S = val; break; /* ? */ \ - case 5: U = val; break; \ - default: logerror("Unknown TFR/EXG idx at PC:%04x\n", PC ); break; \ -} - -/* opcode timings */ -static const UINT8 cycles1[] = -{ - /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ - /*0*/ 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 5, 5, 5, 5, - /*1*/ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - /*2*/ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - /*3*/ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 7, 6, - /*4*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 4, 4, - /*5*/ 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 1, 1, 1, - /*6*/ 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, - /*7*/ 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, - /*8*/ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, - /*9*/ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, - /*A*/ 2, 2, 2, 4, 4, 4, 4, 4, 2, 2, 2, 2, 3, 3, 2, 1, - /*B*/ 3, 2, 2,11,22,11, 2, 4, 3, 3, 3, 3, 3, 3, 3, 3, - /*C*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 2, - /*D*/ 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /*E*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /*F*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 -}; - -KONAMI_INLINE UINT32 RM16( UINT32 Addr ) -{ - UINT32 result = RM(Addr) << 8; - return result | RM((Addr+1)&0xffff); -} - -KONAMI_INLINE void WM16( UINT32 Addr, PAIR *p ) -{ - WM( Addr, p->b.h ); - WM( (Addr+1)&0xffff, p->b.l ); -} - -/**************************************************************************** - * Get all registers in given buffer - ****************************************************************************/ -#if 0 -static void konami_get_context(void *dst) -{ - if( dst ) - *(konami_Regs*)dst = konami; -} -#endif - -/**************************************************************************** - * Set all registers to given values - ****************************************************************************/ -#if 0 -static void konami_set_context(void *src) -{ - if( src ) - konami = *(konami_Regs*)src; - change_pc(PC); /* TS 971002 */ - - CHECK_IRQ_LINES; -} -#endif - -/****************************************************************************/ -/* Reset registers to their initial values */ -/****************************************************************************/ -void konami_init(int (*irqcallback)(int)) -{ - konami.irq_callback = irqcallback; -} - -void konamiReset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiReset called without init\n")); -#endif - - konami.nTotalCycles = 0; - konami.int_state = 0; - konami.nmi_state = CPU_IRQSTATUS_NONE; - konami.irq_state[0] = CPU_IRQSTATUS_NONE; - konami.irq_state[1] = CPU_IRQSTATUS_NONE; - - DPD = 0; /* Reset direct page register */ - - CC |= CC_II; /* IRQ disabled */ - CC |= CC_IF; /* FIRQ disabled */ - - PCD = RM16(0xfffe); - change_pc(PC); /* TS 971002 */ -} - -#if 0 -static void konami_exit(void) -{ -} -#endif - -/* Generate interrupts */ -/**************************************************************************** - * Set IRQ line state - ****************************************************************************/ -void konami_set_irq_hold(INT32 irq) -{ - konami.hold_irq = 1 << irq; -} - -void konami_set_irq_line(int irqline, int state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konami_set_irq_line called without init\n")); -#endif - - if (irqline == KONAMI_INPUT_LINE_NMI) - { - if (konami.nmi_state == state) return; - konami.nmi_state = state; - // LOG(("KONAMI#%d set_nmi_line %d\n", cpu_getactivecpu(), state)); - if( state == CPU_IRQSTATUS_NONE ) return; - - /* if the stack was not yet initialized */ - if( !(konami.int_state & KONAMI_LDS) ) return; - - konami.int_state &= ~KONAMI_SYNC; - /* state already saved by CWAI? */ - if( konami.int_state & KONAMI_CWAI ) - { - konami.int_state &= ~KONAMI_CWAI; - konami.extra_cycles += 7; /* subtract +7 cycles next time */ - } - else - { - CC |= CC_E; /* save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - konami.extra_cycles += 19; /* subtract +19 cycles next time */ - } - CC |= CC_IF | CC_II; /* inhibit FIRQ and IRQ */ - PCD = RM16(0xfffc); - change_pc(PC); /* TS 971002 */ - } - else if (irqline < 2) - { - // LOG(("KONAMI#%d set_irq_line %d, %d\n", cpu_getactivecpu(), irqline, state)); - konami.irq_state[irqline] = state; - if (state == CPU_IRQSTATUS_NONE) return; - CHECK_IRQ_LINES; - } -} - -/* includes the static function prototypes and the master opcode table */ -#include "konamtbl.c" - -/* includes the actual opcode implementations */ -#include "konamops.c" - -/* execute instructions on this CPU until icount expires */ -int konamiRun(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiRun called without init\n")); -#endif - - konami_ICount = cycles - konami.extra_cycles; - nCyclesToDo = konami_ICount; - konami.extra_cycles = 0; - - if( konami.int_state & (KONAMI_CWAI | KONAMI_SYNC) ) - { - konami_ICount = 0; - } - else - { - do - { - pPPC = pPC; - - konami.ireg = ROP(PCD); - PC++; - - (*konami_main[konami.ireg])(); - - konami_ICount -= cycles1[konami.ireg]; - - } while( konami_ICount > 0 ); - - konami_ICount -= konami.extra_cycles; - konami.extra_cycles = 0; - } - - konami.nTotalCycles += cycles - konami_ICount; - return cycles - konami_ICount; -} - -int konamiCpuScan(int nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiCpuScan called without init\n")); -#endif - - struct BurnArea ba; - - int (*irq_callback)(int irqline); - void (*setlines_callback)( int lines ); - - irq_callback = konami.irq_callback; - setlines_callback = konami.setlines_callback; - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - ba.Data = (unsigned char*)&konami; - ba.nLen = sizeof(konami_Regs); - ba.szName = "All Registers"; - BurnAcb(&ba); - - SCAN_VAR(ea.w.l); - SCAN_VAR(ea.d); - } - - konami.irq_callback = irq_callback; - konami.setlines_callback = setlines_callback; - - return 0; -} - -void konamiSetlinesCallback(void (*setlines_callback)(int lines)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiSetlinesCallback called without init\n")); -#endif - - konami.setlines_callback = setlines_callback; -} - -int konamiTotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiTotalCycles called without init\n")); -#endif - - return konami.nTotalCycles; -} - -void konamiNewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiNewFrame called without init\n")); -#endif - - konami.nTotalCycles = 0; -} diff --git a/jan/src/cpu/konami/konami.h b/jan/src/cpu/konami/konami.h deleted file mode 100644 index fafa65097..000000000 --- a/jan/src/cpu/konami/konami.h +++ /dev/null @@ -1,48 +0,0 @@ -/*** konami: Portable Konami cpu emulator ******************************************/ - - -#ifndef __KONAMI_H__ -#define __KONAMI_H__ - - -enum -{ - KONAMI_PC=1, KONAMI_S, KONAMI_CC ,KONAMI_A, KONAMI_B, KONAMI_U, KONAMI_X, KONAMI_Y, - KONAMI_DP -}; - -/* PUBLIC FUNCTIONS */ - -/****************************************************************************/ -/* Read a byte from given memory location */ -/****************************************************************************/ -#define KONAMI_RDMEM(Addr) konamiRead(Addr) - -/****************************************************************************/ -/* Write a byte to given memory location */ -/****************************************************************************/ -#define KONAMI_WRMEM(Addr,Value) konamiWrite(Addr,Value) - -/****************************************************************************/ -/* Z80_RDOP() is identical to Z80_RDMEM() except it is used for reading */ -/* opcodes. In case of system with memory mapped I/O, this function can be */ -/* used to greatly speed up emulation */ -/****************************************************************************/ -#define KONAMI_RDOP(Addr) konamiFetch(Addr) - -/****************************************************************************/ -/* Z80_RDOP_ARG() is identical to Z80_RDOP() except it is used for reading */ -/* opcode arguments. This difference can be used to support systems that */ -/* use different encoding mechanisms for opcodes and opcode arguments */ -/****************************************************************************/ -#define KONAMI_RDOP_ARG(Addr) konamiFetch(Addr) - -#ifndef FALSE -# define FALSE 0 -#endif -#ifndef TRUE -# define TRUE (!FALSE) -#endif - - -#endif /* __KONAMI_H__ */ diff --git a/jan/src/cpu/konami/konamops.c b/jan/src/cpu/konami/konamops.c deleted file mode 100644 index 5216f6fc0..000000000 --- a/jan/src/cpu/konami/konamops.c +++ /dev/null @@ -1,4361 +0,0 @@ -/* - -HNZVC - -? = undefined -* = affected -- = unaffected -0 = cleared -1 = set -# = CCr directly affected by instruction -@ = special - carry set if bit 7 is set - -*/ - -#ifdef NEW -static void illegal( void ) -#else -KONAMI_INLINE void illegal( void ) -#endif -{ - logerror("KONAMI: illegal opcode at %04x\n",PC); -} - -/* $00 NEG direct ?**** */ -KONAMI_INLINE void neg_di( void ) -{ - UINT16 r,t; - DIRBYTE(t); - r = -t; - CLR_NZVC; - SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $01 ILLEGAL */ - -/* $02 ILLEGAL */ - -/* $03 COM direct -**01 */ -KONAMI_INLINE void com_di( void ) -{ - UINT8 t; - DIRBYTE(t); - t = ~t; - CLR_NZV; - SET_NZ8(t); - SEC; - WM(EAD,t); -} - -/* $04 LSR direct -0*-* */ -KONAMI_INLINE void lsr_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZC; - CC |= (t & CC_C); - t >>= 1; - SET_Z8(t); - WM(EAD,t); -} - -/* $05 ILLEGAL */ - -/* $06 ROR direct -**-* */ -KONAMI_INLINE void ror_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r= (CC & CC_C) << 7; - CLR_NZC; - CC |= (t & CC_C); - r |= t>>1; - SET_NZ8(r); - WM(EAD,r); -} - -/* $07 ASR direct ?**-* */ -KONAMI_INLINE void asr_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZC; - CC |= (t & CC_C); - t = (t & 0x80) | (t >> 1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $08 ASL direct ?**** */ -KONAMI_INLINE void asl_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $09 ROL direct -**** */ -KONAMI_INLINE void rol_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = (CC & CC_C) | (t << 1); - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $0A DEC direct -***- */ -KONAMI_INLINE void dec_di( void ) -{ - UINT8 t; - DIRBYTE(t); - --t; - CLR_NZV; - SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $0B ILLEGAL */ - -/* $OC INC direct -***- */ -KONAMI_INLINE void inc_di( void ) -{ - UINT8 t; - DIRBYTE(t); - ++t; - CLR_NZV; - SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $OD TST direct -**0- */ -KONAMI_INLINE void tst_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZV; - SET_NZ8(t); -} - -/* $0E JMP direct ----- */ -KONAMI_INLINE void jmp_di( void ) -{ - DIRECT; - PCD=EAD; - change_pc(PCD); -} - -/* $0F CLR direct -0100 */ -KONAMI_INLINE void clr_di( void ) -{ - DIRECT; - WM(EAD,0); - CLR_NZVC; - SEZ; -} - -/* $10 FLAG */ - -/* $11 FLAG */ - -/* $12 NOP inherent ----- */ -KONAMI_INLINE void nop( void ) -{ - ; -} - -/* $13 SYNC inherent ----- */ -KONAMI_INLINE void sync( void ) -{ - /* SYNC stops processing instructions until an interrupt request happens. */ - /* This doesn't require the corresponding interrupt to be enabled: if it */ - /* is disabled, execution continues with the next instruction. */ - konami.int_state |= KONAMI_SYNC; - CHECK_IRQ_LINES; - /* if KONAMI_SYNC has not been cleared by CHECK_IRQ_LINES, - * stop execution until the interrupt lines change. */ - if( (konami.int_state & KONAMI_SYNC) && konami_ICount > 0 ) - konami_ICount = 0; -} - -/* $14 ILLEGAL */ - -/* $15 ILLEGAL */ - -/* $16 LBRA relative ----- */ -KONAMI_INLINE void lbra( void ) -{ - IMMWORD(ea); - PC += EA; - change_pc(PCD); - - /* EHC 980508 speed up busy loop */ - if( EA == 0xfffd && konami_ICount > 0 ) - konami_ICount = 0; -} - -/* $17 LBSR relative ----- */ -KONAMI_INLINE void lbsr( void ) -{ - IMMWORD(ea); - PUSHWORD(pPC); - PC += EA; - change_pc(PCD); -} - -/* $18 ILLEGAL */ - -#if 1 -/* $19 DAA inherent (A) -**0* */ -KONAMI_INLINE void daa( void ) -{ - UINT8 msn, lsn; - UINT16 t, cf = 0; - msn = A & 0xf0; lsn = A & 0x0f; - if( lsn>0x09 || CC & CC_H) cf |= 0x06; - if( msn>0x80 && lsn>0x09 ) cf |= 0x60; - if( msn>0x90 || CC & CC_C) cf |= 0x60; - t = cf + A; - CLR_NZV; /* keep carry from previous operation */ - SET_NZ8((UINT8)t); SET_C8(t); - A = t; -} -#else -/* $19 DAA inherent (A) -**0* */ -KONAMI_INLINE void daa( void ) -{ - UINT16 t; - t = A; - if (CC & CC_H) t+=0x06; - if ((t&0x0f)>9) t+=0x06; /* ASG -- this code is broken! $66+$99=$FF -> DAA should = $65, we get $05! */ - if (CC & CC_C) t+=0x60; - if ((t&0xf0)>0x90) t+=0x60; - if (t&0x100) SEC; - A = t; -} -#endif - -/* $1A ORCC immediate ##### */ -KONAMI_INLINE void orcc( void ) -{ - UINT8 t; - IMMBYTE(t); - CC |= t; - CHECK_IRQ_LINES; -} - -/* $1B ILLEGAL */ - -/* $1C ANDCC immediate ##### */ -KONAMI_INLINE void andcc( void ) -{ - UINT8 t; - IMMBYTE(t); - CC &= t; - CHECK_IRQ_LINES; -} - -/* $1D SEX inherent -**0- */ -KONAMI_INLINE void sex( void ) -{ - UINT16 t; - t = SIGNED(B); - D = t; -// CLR_NZV; NS 20020905: applying the same fix that was applied to 6809 and 6309 - CLR_NZ; - SET_NZ16(t); -} - -/* $1E EXG inherent ----- */ -KONAMI_INLINE void exg( void ) -{ - UINT16 t1 = 0, t2 = 0; - UINT8 tb; - - IMMBYTE(tb); - - GETREG( t1, tb >> 4 ); - GETREG( t2, tb & 0x0f ); - - SETREG( t2, tb >> 4 ); - SETREG( t1, tb & 0x0f ); -} - -/* $1F TFR inherent ----- */ -KONAMI_INLINE void tfr( void ) -{ - UINT8 tb; - UINT16 t = 0; - - IMMBYTE(tb); - - GETREG( t, tb & 0x0f ); - SETREG( t, ( tb >> 4 ) & 0x07 ); -} - -/* $20 BRA relative ----- */ -KONAMI_INLINE void bra( void ) -{ - UINT8 t; - IMMBYTE(t); - PC += SIGNED(t); - change_pc(PCD); - /* JB 970823 - speed up busy loops */ - if( t == 0xfe && konami_ICount > 0 ) - konami_ICount = 0; -} - -/* $21 BRN relative ----- */ -KONAMI_INLINE void brn( void ) -{ - UINT8 t; - IMMBYTE(t); -} - -/* $1021 LBRN relative ----- */ -KONAMI_INLINE void lbrn( void ) -{ - IMMWORD(ea); -} - -/* $22 BHI relative ----- */ -KONAMI_INLINE void bhi( void ) -{ - BRANCH( !(CC & (CC_Z|CC_C)) ); -} - -/* $1022 LBHI relative ----- */ -KONAMI_INLINE void lbhi( void ) -{ - LBRANCH( !(CC & (CC_Z|CC_C)) ); -} - -/* $23 BLS relative ----- */ -KONAMI_INLINE void bls( void ) -{ - BRANCH( (CC & (CC_Z|CC_C)) ); -} - -/* $1023 LBLS relative ----- */ -KONAMI_INLINE void lbls( void ) -{ - LBRANCH( (CC&(CC_Z|CC_C)) ); -} - -/* $24 BCC relative ----- */ -KONAMI_INLINE void bcc( void ) -{ - BRANCH( !(CC&CC_C) ); -} - -/* $1024 LBCC relative ----- */ -KONAMI_INLINE void lbcc( void ) -{ - LBRANCH( !(CC&CC_C) ); -} - -/* $25 BCS relative ----- */ -KONAMI_INLINE void bcs( void ) -{ - BRANCH( (CC&CC_C) ); -} - -/* $1025 LBCS relative ----- */ -KONAMI_INLINE void lbcs( void ) -{ - LBRANCH( (CC&CC_C) ); -} - -/* $26 BNE relative ----- */ -KONAMI_INLINE void bne( void ) -{ - BRANCH( !(CC&CC_Z) ); -} - -/* $1026 LBNE relative ----- */ -KONAMI_INLINE void lbne( void ) -{ - LBRANCH( !(CC&CC_Z) ); -} - -/* $27 BEQ relative ----- */ -KONAMI_INLINE void beq( void ) -{ - BRANCH( (CC&CC_Z) ); -} - -/* $1027 LBEQ relative ----- */ -KONAMI_INLINE void lbeq( void ) -{ - LBRANCH( (CC&CC_Z) ); -} - -/* $28 BVC relative ----- */ -KONAMI_INLINE void bvc( void ) -{ - BRANCH( !(CC&CC_V) ); -} - -/* $1028 LBVC relative ----- */ -KONAMI_INLINE void lbvc( void ) -{ - LBRANCH( !(CC&CC_V) ); -} - -/* $29 BVS relative ----- */ -KONAMI_INLINE void bvs( void ) -{ - BRANCH( (CC&CC_V) ); -} - -/* $1029 LBVS relative ----- */ -KONAMI_INLINE void lbvs( void ) -{ - LBRANCH( (CC&CC_V) ); -} - -/* $2A BPL relative ----- */ -KONAMI_INLINE void bpl( void ) -{ - BRANCH( !(CC&CC_N) ); -} - -/* $102A LBPL relative ----- */ -KONAMI_INLINE void lbpl( void ) -{ - LBRANCH( !(CC&CC_N) ); -} - -/* $2B BMI relative ----- */ -KONAMI_INLINE void bmi( void ) -{ - BRANCH( (CC&CC_N) ); -} - -/* $102B LBMI relative ----- */ -KONAMI_INLINE void lbmi( void ) -{ - LBRANCH( (CC&CC_N) ); -} - -/* $2C BGE relative ----- */ -KONAMI_INLINE void bge( void ) -{ - BRANCH( !NXORV ); -} - -/* $102C LBGE relative ----- */ -KONAMI_INLINE void lbge( void ) -{ - LBRANCH( !NXORV ); -} - -/* $2D BLT relative ----- */ -KONAMI_INLINE void blt( void ) -{ - BRANCH( NXORV ); -} - -/* $102D LBLT relative ----- */ -KONAMI_INLINE void lblt( void ) -{ - LBRANCH( NXORV ); -} - -/* $2E BGT relative ----- */ -KONAMI_INLINE void bgt( void ) -{ - BRANCH( !(NXORV || (CC&CC_Z)) ); -} - -/* $102E LBGT relative ----- */ -KONAMI_INLINE void lbgt( void ) -{ - LBRANCH( !(NXORV || (CC&CC_Z)) ); -} - -/* $2F BLE relative ----- */ -KONAMI_INLINE void ble( void ) -{ - BRANCH( (NXORV || (CC&CC_Z)) ); -} - -/* $102F LBLE relative ----- */ -KONAMI_INLINE void lble( void ) -{ - LBRANCH( (NXORV || (CC&CC_Z)) ); -} - -/* $30 LEAX indexed --*-- */ -KONAMI_INLINE void leax( void ) -{ - X = EA; - CLR_Z; - SET_Z(X); -} - -/* $31 LEAY indexed --*-- */ -KONAMI_INLINE void leay( void ) -{ - Y = EA; - CLR_Z; - SET_Z(Y); -} - -/* $32 LEAS indexed ----- */ -KONAMI_INLINE void leas( void ) -{ - S = EA; - konami.int_state |= KONAMI_LDS; -} - -/* $33 LEAU indexed ----- */ -KONAMI_INLINE void leau( void ) -{ - U = EA; -} - -/* $34 PSHS inherent ----- */ -KONAMI_INLINE void pshs( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x80 ) { PUSHWORD(pPC); konami_ICount -= 2; } - if( t&0x40 ) { PUSHWORD(pU); konami_ICount -= 2; } - if( t&0x20 ) { PUSHWORD(pY); konami_ICount -= 2; } - if( t&0x10 ) { PUSHWORD(pX); konami_ICount -= 2; } - if( t&0x08 ) { PUSHBYTE(DP); konami_ICount -= 1; } - if( t&0x04 ) { PUSHBYTE(B); konami_ICount -= 1; } - if( t&0x02 ) { PUSHBYTE(A); konami_ICount -= 1; } - if( t&0x01 ) { PUSHBYTE(CC); konami_ICount -= 1; } -} - -/* 35 PULS inherent ----- */ -KONAMI_INLINE void puls( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x01 ) { PULLBYTE(CC); konami_ICount -= 1; } - if( t&0x02 ) { PULLBYTE(A); konami_ICount -= 1; } - if( t&0x04 ) { PULLBYTE(B); konami_ICount -= 1; } - if( t&0x08 ) { PULLBYTE(DP); konami_ICount -= 1; } - if( t&0x10 ) { PULLWORD(XD); konami_ICount -= 2; } - if( t&0x20 ) { PULLWORD(YD); konami_ICount -= 2; } - if( t&0x40 ) { PULLWORD(UD); konami_ICount -= 2; } - if( t&0x80 ) { PULLWORD(PCD); change_pc(PCD); konami_ICount -= 2; } - - /* check after all PULLs */ - if( t&0x01 ) { CHECK_IRQ_LINES; } -} - -/* $36 PSHU inherent ----- */ -KONAMI_INLINE void pshu( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x80 ) { PSHUWORD(pPC); konami_ICount -= 2; } - if( t&0x40 ) { PSHUWORD(pS); konami_ICount -= 2; } - if( t&0x20 ) { PSHUWORD(pY); konami_ICount -= 2; } - if( t&0x10 ) { PSHUWORD(pX); konami_ICount -= 2; } - if( t&0x08 ) { PSHUBYTE(DP); konami_ICount -= 1; } - if( t&0x04 ) { PSHUBYTE(B); konami_ICount -= 1; } - if( t&0x02 ) { PSHUBYTE(A); konami_ICount -= 1; } - if( t&0x01 ) { PSHUBYTE(CC); konami_ICount -= 1; } -} - -/* 37 PULU inherent ----- */ -KONAMI_INLINE void pulu( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x01 ) { PULUBYTE(CC); konami_ICount -= 1; } - if( t&0x02 ) { PULUBYTE(A); konami_ICount -= 1; } - if( t&0x04 ) { PULUBYTE(B); konami_ICount -= 1; } - if( t&0x08 ) { PULUBYTE(DP); konami_ICount -= 1; } - if( t&0x10 ) { PULUWORD(XD); konami_ICount -= 2; } - if( t&0x20 ) { PULUWORD(YD); konami_ICount -= 2; } - if( t&0x40 ) { PULUWORD(SD); konami_ICount -= 2; } - if( t&0x80 ) { PULUWORD(PCD); change_pc(PCD); konami_ICount -= 2; } - - /* check after all PULLs */ - if( t&0x01 ) { CHECK_IRQ_LINES; } -} - -/* $38 ILLEGAL */ - -/* $39 RTS inherent ----- */ -KONAMI_INLINE void rts( void ) -{ - PULLWORD(PCD); - change_pc(PCD); -} - -/* $3A ABX inherent ----- */ -KONAMI_INLINE void abx( void ) -{ - X += B; -} - -/* $3B RTI inherent ##### */ -KONAMI_INLINE void rti( void ) -{ - PULLBYTE(CC); - if( CC & CC_E ) /* entire state saved? */ - { - konami_ICount -= 9; - PULLBYTE(A); - PULLBYTE(B); - PULLBYTE(DP); - PULLWORD(XD); - PULLWORD(YD); - PULLWORD(UD); - } - PULLWORD(PCD); - change_pc(PCD); - CHECK_IRQ_LINES; -} - -/* $3C CWAI inherent ----1 */ -KONAMI_INLINE void cwai( void ) -{ - UINT8 t; - IMMBYTE(t); - CC &= t; - /* - * CWAI stacks the entire machine state on the hardware stack, - * then waits for an interrupt; when the interrupt is taken - * later, the state is *not* saved again after CWAI. - */ - CC |= CC_E; /* HJB 990225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - konami.int_state |= KONAMI_CWAI; - CHECK_IRQ_LINES; - if( (konami.int_state & KONAMI_CWAI) && konami_ICount > 0 ) - konami_ICount = 0; -} - -/* $3D MUL inherent --*-@ */ -KONAMI_INLINE void mul( void ) -{ - UINT16 t; - t = A * B; - CLR_ZC; SET_Z16(t); if(t&0x80) SEC; - D = t; -} - -/* $3E ILLEGAL */ - -/* $3F SWI (SWI2 SWI3) absolute indirect ----- */ -KONAMI_INLINE void swi( void ) -{ - CC |= CC_E; /* HJB 980225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - CC |= CC_IF | CC_II; /* inhibit FIRQ and IRQ */ - PCD=RM16(0xfffa); - change_pc(PCD); -} - -/* $103F SWI2 absolute indirect ----- */ -KONAMI_INLINE void swi2( void ) -{ - CC |= CC_E; /* HJB 980225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - PCD=RM16(0xfff4); - change_pc(PCD); -} - -/* $113F SWI3 absolute indirect ----- */ -KONAMI_INLINE void swi3( void ) -{ - CC |= CC_E; /* HJB 980225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - PCD=RM16(0xfff2); - change_pc(PCD); -} - -/* $40 NEGA inherent ?**** */ -KONAMI_INLINE void nega( void ) -{ - UINT16 r; - r = -A; - CLR_NZVC; - SET_FLAGS8(0,A,r); - A = r; -} - -/* $41 ILLEGAL */ - -/* $42 ILLEGAL */ - -/* $43 COMA inherent -**01 */ -KONAMI_INLINE void coma( void ) -{ - A = ~A; - CLR_NZV; - SET_NZ8(A); - SEC; -} - -/* $44 LSRA inherent -0*-* */ -KONAMI_INLINE void lsra( void ) -{ - CLR_NZC; - CC |= (A & CC_C); - A >>= 1; - SET_Z8(A); -} - -/* $45 ILLEGAL */ - -/* $46 RORA inherent -**-* */ -KONAMI_INLINE void rora( void ) -{ - UINT8 r; - r = (CC & CC_C) << 7; - CLR_NZC; - CC |= (A & CC_C); - r |= A >> 1; - SET_NZ8(r); - A = r; -} - -/* $47 ASRA inherent ?**-* */ -KONAMI_INLINE void asra( void ) -{ - CLR_NZC; - CC |= (A & CC_C); - A = (A & 0x80) | (A >> 1); - SET_NZ8(A); -} - -/* $48 ASLA inherent ?**** */ -KONAMI_INLINE void asla( void ) -{ - UINT16 r; - r = A << 1; - CLR_NZVC; - SET_FLAGS8(A,A,r); - A = r; -} - -/* $49 ROLA inherent -**** */ -KONAMI_INLINE void rola( void ) -{ - UINT16 t,r; - t = A; - r = (CC & CC_C) | (t<<1); - CLR_NZVC; SET_FLAGS8(t,t,r); - A = r; -} - -/* $4A DECA inherent -***- */ -KONAMI_INLINE void deca( void ) -{ - --A; - CLR_NZV; - SET_FLAGS8D(A); -} - -/* $4B ILLEGAL */ - -/* $4C INCA inherent -***- */ -KONAMI_INLINE void inca( void ) -{ - ++A; - CLR_NZV; - SET_FLAGS8I(A); -} - -/* $4D TSTA inherent -**0- */ -KONAMI_INLINE void tsta( void ) -{ - CLR_NZV; - SET_NZ8(A); -} - -/* $4E ILLEGAL */ - -/* $4F CLRA inherent -0100 */ -KONAMI_INLINE void clra( void ) -{ - A = 0; - CLR_NZVC; SEZ; -} - -/* $50 NEGB inherent ?**** */ -KONAMI_INLINE void negb( void ) -{ - UINT16 r; - r = -B; - CLR_NZVC; - SET_FLAGS8(0,B,r); - B = r; -} - -/* $51 ILLEGAL */ - -/* $52 ILLEGAL */ - -/* $53 COMB inherent -**01 */ -KONAMI_INLINE void comb( void ) -{ - B = ~B; - CLR_NZV; - SET_NZ8(B); - SEC; -} - -/* $54 LSRB inherent -0*-* */ -KONAMI_INLINE void lsrb( void ) -{ - CLR_NZC; - CC |= (B & CC_C); - B >>= 1; - SET_Z8(B); -} - -/* $55 ILLEGAL */ - -/* $56 RORB inherent -**-* */ -KONAMI_INLINE void rorb( void ) -{ - UINT8 r; - r = (CC & CC_C) << 7; - CLR_NZC; - CC |= (B & CC_C); - r |= B >> 1; - SET_NZ8(r); - B = r; -} - -/* $57 ASRB inherent ?**-* */ -KONAMI_INLINE void asrb( void ) -{ - CLR_NZC; - CC |= (B & CC_C); - B= (B & 0x80) | (B >> 1); - SET_NZ8(B); -} - -/* $58 ASLB inherent ?**** */ -KONAMI_INLINE void aslb( void ) -{ - UINT16 r; - r = B << 1; - CLR_NZVC; - SET_FLAGS8(B,B,r); - B = r; -} - -/* $59 ROLB inherent -**** */ -KONAMI_INLINE void rolb( void ) -{ - UINT16 t,r; - t = B; - r = CC & CC_C; - r |= t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - B = r; -} - -/* $5A DECB inherent -***- */ -KONAMI_INLINE void decb( void ) -{ - --B; - CLR_NZV; - SET_FLAGS8D(B); -} - -/* $5B ILLEGAL */ - -/* $5C INCB inherent -***- */ -KONAMI_INLINE void incb( void ) -{ - ++B; - CLR_NZV; - SET_FLAGS8I(B); -} - -/* $5D TSTB inherent -**0- */ -KONAMI_INLINE void tstb( void ) -{ - CLR_NZV; - SET_NZ8(B); -} - -/* $5E ILLEGAL */ - -/* $5F CLRB inherent -0100 */ -KONAMI_INLINE void clrb( void ) -{ - B = 0; - CLR_NZVC; SEZ; -} - -/* $60 NEG indexed ?**** */ -KONAMI_INLINE void neg_ix( void ) -{ - UINT16 r,t; - t = RM(EAD); - r = -t; - CLR_NZVC; - SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $61 ILLEGAL */ - -/* $62 ILLEGAL */ - -/* $63 COM indexed -**01 */ -KONAMI_INLINE void com_ix( void ) -{ - UINT8 t; - t = ~RM(EAD); - CLR_NZV; - SET_NZ8(t); - SEC; - WM(EAD,t); -} - -/* $64 LSR indexed -0*-* */ -KONAMI_INLINE void lsr_ix( void ) -{ - UINT8 t; - t = RM(EAD); - CLR_NZC; - CC |= (t & CC_C); - t>>=1; SET_Z8(t); - WM(EAD,t); -} - -/* $65 ILLEGAL */ - -/* $66 ROR indexed -**-* */ -KONAMI_INLINE void ror_ix( void ) -{ - UINT8 t,r; - t = RM(EAD); - r = (CC & CC_C) << 7; - CLR_NZC; - CC |= (t & CC_C); - r |= t>>1; SET_NZ8(r); - WM(EAD,r); -} - -/* $67 ASR indexed ?**-* */ -KONAMI_INLINE void asr_ix( void ) -{ - UINT8 t; - t = RM(EAD); - CLR_NZC; - CC |= (t & CC_C); - t=(t&0x80)|(t>>1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $68 ASL indexed ?**** */ -KONAMI_INLINE void asl_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $69 ROL indexed -**** */ -KONAMI_INLINE void rol_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = CC & CC_C; - r |= t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $6A DEC indexed -***- */ -KONAMI_INLINE void dec_ix( void ) -{ - UINT8 t; - t = RM(EAD) - 1; - CLR_NZV; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $6B ILLEGAL */ - -/* $6C INC indexed -***- */ -KONAMI_INLINE void inc_ix( void ) -{ - UINT8 t; - t = RM(EAD) + 1; - CLR_NZV; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $6D TST indexed -**0- */ -KONAMI_INLINE void tst_ix( void ) -{ - UINT8 t; - t = RM(EAD); - CLR_NZV; - SET_NZ8(t); -} - -/* $6E JMP indexed ----- */ -KONAMI_INLINE void jmp_ix( void ) -{ - PCD=EAD; - change_pc(PCD); -} - -/* $6F CLR indexed -0100 */ -KONAMI_INLINE void clr_ix( void ) -{ - WM(EAD,0); - CLR_NZVC; SEZ; -} - -/* $70 NEG extended ?**** */ -KONAMI_INLINE void neg_ex( void ) -{ - UINT16 r,t; - EXTBYTE(t); r=-t; - CLR_NZVC; SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $71 ILLEGAL */ - -/* $72 ILLEGAL */ - -/* $73 COM extended -**01 */ -KONAMI_INLINE void com_ex( void ) -{ - UINT8 t; - EXTBYTE(t); t = ~t; - CLR_NZV; SET_NZ8(t); SEC; - WM(EAD,t); -} - -/* $74 LSR extended -0*-* */ -KONAMI_INLINE void lsr_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZC; CC |= (t & CC_C); - t>>=1; SET_Z8(t); - WM(EAD,t); -} - -/* $75 ILLEGAL */ - -/* $76 ROR extended -**-* */ -KONAMI_INLINE void ror_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); r=(CC & CC_C) << 7; - CLR_NZC; CC |= (t & CC_C); - r |= t>>1; SET_NZ8(r); - WM(EAD,r); -} - -/* $77 ASR extended ?**-* */ -KONAMI_INLINE void asr_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZC; CC |= (t & CC_C); - t=(t&0x80)|(t>>1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $78 ASL extended ?**** */ -KONAMI_INLINE void asl_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r=t<<1; - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $79 ROL extended -**** */ -KONAMI_INLINE void rol_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = (CC & CC_C) | (t << 1); - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $7A DEC extended -***- */ -KONAMI_INLINE void dec_ex( void ) -{ - UINT8 t; - EXTBYTE(t); --t; - CLR_NZV; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $7B ILLEGAL */ - -/* $7C INC extended -***- */ -KONAMI_INLINE void inc_ex( void ) -{ - UINT8 t; - EXTBYTE(t); ++t; - CLR_NZV; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $7D TST extended -**0- */ -KONAMI_INLINE void tst_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZV; SET_NZ8(t); -} - -/* $7E JMP extended ----- */ -KONAMI_INLINE void jmp_ex( void ) -{ - EXTENDED; - PCD=EAD; - change_pc(PCD); -} - -/* $7F CLR extended -0100 */ -KONAMI_INLINE void clr_ex( void ) -{ - EXTENDED; - WM(EAD,0); - CLR_NZVC; SEZ; -} - -/* $80 SUBA immediate ?**** */ -KONAMI_INLINE void suba_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $81 CMPA immediate ?**** */ -KONAMI_INLINE void cmpa_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $82 SBCA immediate ?**** */ -KONAMI_INLINE void sbca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $83 SUBD (CMPD CMPU) immediate -**** */ -KONAMI_INLINE void subd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $1083 CMPD immediate -**** */ -KONAMI_INLINE void cmpd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $1183 CMPU immediate -**** */ -KONAMI_INLINE void cmpu_im( void ) -{ - UINT32 r, d; - PAIR b; - IMMWORD(b); - d = U; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $84 ANDA immediate -**0- */ -KONAMI_INLINE void anda_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A &= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $85 BITA immediate -**0- */ -KONAMI_INLINE void bita_im( void ) -{ - UINT8 t,r; - IMMBYTE(t); - r = A & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $86 LDA immediate -**0- */ -KONAMI_INLINE void lda_im( void ) -{ - IMMBYTE(A); - CLR_NZV; - SET_NZ8(A); -} - -/* is this a legal instruction? */ -/* $87 STA immediate -**0- */ -KONAMI_INLINE void sta_im( void ) -{ - CLR_NZV; - SET_NZ8(A); - IMM8; - WM(EAD,A); -} - -/* $88 EORA immediate -**0- */ -KONAMI_INLINE void eora_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A ^= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $89 ADCA immediate ***** */ -KONAMI_INLINE void adca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $8A ORA immediate -**0- */ -KONAMI_INLINE void ora_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A |= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $8B ADDA immediate ***** */ -KONAMI_INLINE void adda_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $8C CMPX (CMPY CMPS) immediate -**** */ -KONAMI_INLINE void cmpx_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $108C CMPY immediate -**** */ -KONAMI_INLINE void cmpy_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $118C CMPS immediate -**** */ -KONAMI_INLINE void cmps_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $8D BSR ----- */ -KONAMI_INLINE void bsr( void ) -{ - UINT8 t; - IMMBYTE(t); - PUSHWORD(pPC); - PC += SIGNED(t); - change_pc(PCD); -} - -/* $8E LDX (LDY) immediate -**0- */ -KONAMI_INLINE void ldx_im( void ) -{ - IMMWORD(pX); - CLR_NZV; - SET_NZ16(X); -} - -/* $108E LDY immediate -**0- */ -KONAMI_INLINE void ldy_im( void ) -{ - IMMWORD(pY); - CLR_NZV; - SET_NZ16(Y); -} - -/* is this a legal instruction? */ -/* $8F STX (STY) immediate -**0- */ -KONAMI_INLINE void stx_im( void ) -{ - CLR_NZV; - SET_NZ16(X); - IMM16; - WM16(EAD,&pX); -} - -/* is this a legal instruction? */ -/* $108F STY immediate -**0- */ -KONAMI_INLINE void sty_im( void ) -{ - CLR_NZV; - SET_NZ16(Y); - IMM16; - WM16(EAD,&pY); -} - -/* $90 SUBA direct ?**** */ -KONAMI_INLINE void suba_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $91 CMPA direct ?**** */ -KONAMI_INLINE void cmpa_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $92 SBCA direct ?**** */ -KONAMI_INLINE void sbca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $93 SUBD (CMPD CMPU) direct -**** */ -KONAMI_INLINE void subd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $1093 CMPD direct -**** */ -KONAMI_INLINE void cmpd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $1193 CMPU direct -**** */ -KONAMI_INLINE void cmpu_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = U; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(U,b.d,r); -} - -/* $94 ANDA direct -**0- */ -KONAMI_INLINE void anda_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A &= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $95 BITA direct -**0- */ -KONAMI_INLINE void bita_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r = A & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $96 LDA direct -**0- */ -KONAMI_INLINE void lda_di( void ) -{ - DIRBYTE(A); - CLR_NZV; - SET_NZ8(A); -} - -/* $97 STA direct -**0- */ -KONAMI_INLINE void sta_di( void ) -{ - CLR_NZV; - SET_NZ8(A); - DIRECT; - WM(EAD,A); -} - -/* $98 EORA direct -**0- */ -KONAMI_INLINE void eora_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A ^= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $99 ADCA direct ***** */ -KONAMI_INLINE void adca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $9A ORA direct -**0- */ -KONAMI_INLINE void ora_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A |= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $9B ADDA direct ***** */ -KONAMI_INLINE void adda_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $9C CMPX (CMPY CMPS) direct -**** */ -KONAMI_INLINE void cmpx_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $109C CMPY direct -**** */ -KONAMI_INLINE void cmpy_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $119C CMPS direct -**** */ -KONAMI_INLINE void cmps_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $9D JSR direct ----- */ -KONAMI_INLINE void jsr_di( void ) -{ - DIRECT; - PUSHWORD(pPC); - PCD=EAD; - change_pc(PCD); -} - -/* $9E LDX (LDY) direct -**0- */ -KONAMI_INLINE void ldx_di( void ) -{ - DIRWORD(pX); - CLR_NZV; - SET_NZ16(X); -} - -/* $109E LDY direct -**0- */ -KONAMI_INLINE void ldy_di( void ) -{ - DIRWORD(pY); - CLR_NZV; - SET_NZ16(Y); -} - -/* $9F STX (STY) direct -**0- */ -KONAMI_INLINE void stx_di( void ) -{ - CLR_NZV; - SET_NZ16(X); - DIRECT; - WM16(EAD,&pX); -} - -/* $109F STY direct -**0- */ -KONAMI_INLINE void sty_di( void ) -{ - CLR_NZV; - SET_NZ16(Y); - DIRECT; - WM16(EAD,&pY); -} - -/* $a0 SUBA indexed ?**** */ -KONAMI_INLINE void suba_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $a1 CMPA indexed ?**** */ -KONAMI_INLINE void cmpa_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $a2 SBCA indexed ?**** */ -KONAMI_INLINE void sbca_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $a3 SUBD (CMPD CMPU) indexed -**** */ -KONAMI_INLINE void subd_ix( void ) -{ - UINT32 r,d; - PAIR b; - b.d=RM16(EAD); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $10a3 CMPD indexed -**** */ -KONAMI_INLINE void cmpd_ix( void ) -{ - UINT32 r,d; - PAIR b; - b.d=RM16(EAD); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11a3 CMPU indexed -**** */ -KONAMI_INLINE void cmpu_ix( void ) -{ - UINT32 r; - PAIR b; - b.d=RM16(EAD); - r = U - b.d; - CLR_NZVC; - SET_FLAGS16(U,b.d,r); -} - -/* $a4 ANDA indexed -**0- */ -KONAMI_INLINE void anda_ix( void ) -{ - A &= RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $a5 BITA indexed -**0- */ -KONAMI_INLINE void bita_ix( void ) -{ - UINT8 r; - r = A & RM(EAD); - CLR_NZV; - SET_NZ8(r); -} - -/* $a6 LDA indexed -**0- */ -KONAMI_INLINE void lda_ix( void ) -{ - A = RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $a7 STA indexed -**0- */ -KONAMI_INLINE void sta_ix( void ) -{ - CLR_NZV; - SET_NZ8(A); - WM(EAD,A); -} - -/* $a8 EORA indexed -**0- */ -KONAMI_INLINE void eora_ix( void ) -{ - A ^= RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $a9 ADCA indexed ***** */ -KONAMI_INLINE void adca_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $aA ORA indexed -**0- */ -KONAMI_INLINE void ora_ix( void ) -{ - A |= RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $aB ADDA indexed ***** */ -KONAMI_INLINE void adda_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $aC CMPX (CMPY CMPS) indexed -**** */ -KONAMI_INLINE void cmpx_ix( void ) -{ - UINT32 r,d; - PAIR b; - b.d=RM16(EAD); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $10aC CMPY indexed -**** */ -KONAMI_INLINE void cmpy_ix( void ) -{ - UINT32 r,d; - PAIR b; - b.d=RM16(EAD); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11aC CMPS indexed -**** */ -KONAMI_INLINE void cmps_ix( void ) -{ - UINT32 r,d; - PAIR b; - b.d=RM16(EAD); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $aD JSR indexed ----- */ -KONAMI_INLINE void jsr_ix( void ) -{ - PUSHWORD(pPC); - PCD=EAD; - change_pc(PCD); -} - -/* $aE LDX (LDY) indexed -**0- */ -KONAMI_INLINE void ldx_ix( void ) -{ - X=RM16(EAD); - CLR_NZV; - SET_NZ16(X); -} - -/* $10aE LDY indexed -**0- */ -KONAMI_INLINE void ldy_ix( void ) -{ - Y=RM16(EAD); - CLR_NZV; - SET_NZ16(Y); -} - -/* $aF STX (STY) indexed -**0- */ -KONAMI_INLINE void stx_ix( void ) -{ - CLR_NZV; - SET_NZ16(X); - WM16(EAD,&pX); -} - -/* $10aF STY indexed -**0- */ -KONAMI_INLINE void sty_ix( void ) -{ - CLR_NZV; - SET_NZ16(Y); - WM16(EAD,&pY); -} - -/* $b0 SUBA extended ?**** */ -KONAMI_INLINE void suba_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $b1 CMPA extended ?**** */ -KONAMI_INLINE void cmpa_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $b2 SBCA extended ?**** */ -KONAMI_INLINE void sbca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $b3 SUBD (CMPD CMPU) extended -**** */ -KONAMI_INLINE void subd_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $10b3 CMPD extended -**** */ -KONAMI_INLINE void cmpd_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11b3 CMPU extended -**** */ -KONAMI_INLINE void cmpu_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = U; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $b4 ANDA extended -**0- */ -KONAMI_INLINE void anda_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A &= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $b5 BITA extended -**0- */ -KONAMI_INLINE void bita_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); - r = A & t; - CLR_NZV; SET_NZ8(r); -} - -/* $b6 LDA extended -**0- */ -KONAMI_INLINE void lda_ex( void ) -{ - EXTBYTE(A); - CLR_NZV; - SET_NZ8(A); -} - -/* $b7 STA extended -**0- */ -KONAMI_INLINE void sta_ex( void ) -{ - CLR_NZV; - SET_NZ8(A); - EXTENDED; - WM(EAD,A); -} - -/* $b8 EORA extended -**0- */ -KONAMI_INLINE void eora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A ^= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $b9 ADCA extended ***** */ -KONAMI_INLINE void adca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $bA ORA extended -**0- */ -KONAMI_INLINE void ora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A |= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $bB ADDA extended ***** */ -KONAMI_INLINE void adda_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $bC CMPX (CMPY CMPS) extended -**** */ -KONAMI_INLINE void cmpx_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $10bC CMPY extended -**** */ -KONAMI_INLINE void cmpy_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11bC CMPS extended -**** */ -KONAMI_INLINE void cmps_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $bD JSR extended ----- */ -KONAMI_INLINE void jsr_ex( void ) -{ - EXTENDED; - PUSHWORD(pPC); - PCD=EAD; - change_pc(PCD); -} - -/* $bE LDX (LDY) extended -**0- */ -KONAMI_INLINE void ldx_ex( void ) -{ - EXTWORD(pX); - CLR_NZV; - SET_NZ16(X); -} - -/* $10bE LDY extended -**0- */ -KONAMI_INLINE void ldy_ex( void ) -{ - EXTWORD(pY); - CLR_NZV; - SET_NZ16(Y); -} - -/* $bF STX (STY) extended -**0- */ -KONAMI_INLINE void stx_ex( void ) -{ - CLR_NZV; - SET_NZ16(X); - EXTENDED; - WM16(EAD,&pX); -} - -/* $10bF STY extended -**0- */ -KONAMI_INLINE void sty_ex( void ) -{ - CLR_NZV; - SET_NZ16(Y); - EXTENDED; - WM16(EAD,&pY); -} - -/* $c0 SUBB immediate ?**** */ -KONAMI_INLINE void subb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $c1 CMPB immediate ?**** */ -KONAMI_INLINE void cmpb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B - t; - CLR_NZVC; SET_FLAGS8(B,t,r); -} - -/* $c2 SBCB immediate ?**** */ -KONAMI_INLINE void sbcb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $c3 ADDD immediate -**** */ -KONAMI_INLINE void addd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $c4 ANDB immediate -**0- */ -KONAMI_INLINE void andb_im( void ) -{ - UINT8 t; - IMMBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $c5 BITB immediate -**0- */ -KONAMI_INLINE void bitb_im( void ) -{ - UINT8 t,r; - IMMBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $c6 LDB immediate -**0- */ -KONAMI_INLINE void ldb_im( void ) -{ - IMMBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* is this a legal instruction? */ -/* $c7 STB immediate -**0- */ -KONAMI_INLINE void stb_im( void ) -{ - CLR_NZV; - SET_NZ8(B); - IMM8; - WM(EAD,B); -} - -/* $c8 EORB immediate -**0- */ -KONAMI_INLINE void eorb_im( void ) -{ - UINT8 t; - IMMBYTE(t); - B ^= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $c9 ADCB immediate ***** */ -KONAMI_INLINE void adcb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $cA ORB immediate -**0- */ -KONAMI_INLINE void orb_im( void ) -{ - UINT8 t; - IMMBYTE(t); - B |= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $cB ADDB immediate ***** */ -KONAMI_INLINE void addb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $cC LDD immediate -**0- */ -KONAMI_INLINE void ldd_im( void ) -{ - IMMWORD(pD); - CLR_NZV; - SET_NZ16(D); -} - -/* is this a legal instruction? */ -/* $cD STD immediate -**0- */ -KONAMI_INLINE void std_im( void ) -{ - CLR_NZV; - SET_NZ16(D); - IMM16; - WM16(EAD,&pD); -} - -/* $cE LDU (LDS) immediate -**0- */ -KONAMI_INLINE void ldu_im( void ) -{ - IMMWORD(pU); - CLR_NZV; - SET_NZ16(U); -} - -/* $10cE LDS immediate -**0- */ -KONAMI_INLINE void lds_im( void ) -{ - IMMWORD(pS); - CLR_NZV; - SET_NZ16(S); - konami.int_state |= KONAMI_LDS; -} - -/* is this a legal instruction? */ -/* $cF STU (STS) immediate -**0- */ -KONAMI_INLINE void stu_im( void ) -{ - CLR_NZV; - SET_NZ16(U); - IMM16; - WM16(EAD,&pU); -} - -/* is this a legal instruction? */ -/* $10cF STS immediate -**0- */ -KONAMI_INLINE void sts_im( void ) -{ - CLR_NZV; - SET_NZ16(S); - IMM16; - WM16(EAD,&pS); -} - -/* $d0 SUBB direct ?**** */ -KONAMI_INLINE void subb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $d1 CMPB direct ?**** */ -KONAMI_INLINE void cmpb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); -} - -/* $d2 SBCB direct ?**** */ -KONAMI_INLINE void sbcb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $d3 ADDD direct -**** */ -KONAMI_INLINE void addd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $d4 ANDB direct -**0- */ -KONAMI_INLINE void andb_di( void ) -{ - UINT8 t; - DIRBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $d5 BITB direct -**0- */ -KONAMI_INLINE void bitb_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $d6 LDB direct -**0- */ -KONAMI_INLINE void ldb_di( void ) -{ - DIRBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* $d7 STB direct -**0- */ -KONAMI_INLINE void stb_di( void ) -{ - CLR_NZV; - SET_NZ8(B); - DIRECT; - WM(EAD,B); -} - -/* $d8 EORB direct -**0- */ -KONAMI_INLINE void eorb_di( void ) -{ - UINT8 t; - DIRBYTE(t); - B ^= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $d9 ADCB direct ***** */ -KONAMI_INLINE void adcb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $dA ORB direct -**0- */ -KONAMI_INLINE void orb_di( void ) -{ - UINT8 t; - DIRBYTE(t); - B |= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $dB ADDB direct ***** */ -KONAMI_INLINE void addb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $dC LDD direct -**0- */ -KONAMI_INLINE void ldd_di( void ) -{ - DIRWORD(pD); - CLR_NZV; - SET_NZ16(D); -} - -/* $dD STD direct -**0- */ -KONAMI_INLINE void std_di( void ) -{ - CLR_NZV; - SET_NZ16(D); - DIRECT; - WM16(EAD,&pD); -} - -/* $dE LDU (LDS) direct -**0- */ -KONAMI_INLINE void ldu_di( void ) -{ - DIRWORD(pU); - CLR_NZV; - SET_NZ16(U); -} - -/* $10dE LDS direct -**0- */ -KONAMI_INLINE void lds_di( void ) -{ - DIRWORD(pS); - CLR_NZV; - SET_NZ16(S); - konami.int_state |= KONAMI_LDS; -} - -/* $dF STU (STS) direct -**0- */ -KONAMI_INLINE void stu_di( void ) -{ - CLR_NZV; - SET_NZ16(U); - DIRECT; - WM16(EAD,&pU); -} - -/* $10dF STS direct -**0- */ -KONAMI_INLINE void sts_di( void ) -{ - CLR_NZV; - SET_NZ16(S); - DIRECT; - WM16(EAD,&pS); -} - -/* $e0 SUBB indexed ?**** */ -KONAMI_INLINE void subb_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $e1 CMPB indexed ?**** */ -KONAMI_INLINE void cmpb_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); -} - -/* $e2 SBCB indexed ?**** */ -KONAMI_INLINE void sbcb_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $e3 ADDD indexed -**** */ -KONAMI_INLINE void addd_ix( void ) -{ - UINT32 r,d; - PAIR b; - b.d=RM16(EAD); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $e4 ANDB indexed -**0- */ -KONAMI_INLINE void andb_ix( void ) -{ - B &= RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $e5 BITB indexed -**0- */ -KONAMI_INLINE void bitb_ix( void ) -{ - UINT8 r; - r = B & RM(EAD); - CLR_NZV; - SET_NZ8(r); -} - -/* $e6 LDB indexed -**0- */ -KONAMI_INLINE void ldb_ix( void ) -{ - B = RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $e7 STB indexed -**0- */ -KONAMI_INLINE void stb_ix( void ) -{ - CLR_NZV; - SET_NZ8(B); - WM(EAD,B); -} - -/* $e8 EORB indexed -**0- */ -KONAMI_INLINE void eorb_ix( void ) -{ - B ^= RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $e9 ADCB indexed ***** */ -KONAMI_INLINE void adcb_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $eA ORB indexed -**0- */ -KONAMI_INLINE void orb_ix( void ) -{ - B |= RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $eb ADDB indexed ***** */ -KONAMI_INLINE void addb_ix( void ) -{ - UINT16 t,r; - t = RM(EAD); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $ec LDD indexed -**0- */ -KONAMI_INLINE void ldd_ix( void ) -{ - D=RM16(EAD); - CLR_NZV; SET_NZ16(D); -} - -/* $eD STD indexed -**0- */ -KONAMI_INLINE void std_ix( void ) -{ - CLR_NZV; - SET_NZ16(D); - WM16(EAD,&pD); -} - -/* $eE LDU (LDS) indexed -**0- */ -KONAMI_INLINE void ldu_ix( void ) -{ - U=RM16(EAD); - CLR_NZV; - SET_NZ16(U); -} - -/* $10eE LDS indexed -**0- */ -KONAMI_INLINE void lds_ix( void ) -{ - S=RM16(EAD); - CLR_NZV; - SET_NZ16(S); - konami.int_state |= KONAMI_LDS; -} - -/* $eF STU (STS) indexed -**0- */ -KONAMI_INLINE void stu_ix( void ) -{ - CLR_NZV; - SET_NZ16(U); - WM16(EAD,&pU); -} - -/* $10eF STS indexed -**0- */ -KONAMI_INLINE void sts_ix( void ) -{ - CLR_NZV; - SET_NZ16(S); - WM16(EAD,&pS); -} - -/* $f0 SUBB extended ?**** */ -KONAMI_INLINE void subb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $f1 CMPB extended ?**** */ -KONAMI_INLINE void cmpb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); -} - -/* $f2 SBCB extended ?**** */ -KONAMI_INLINE void sbcb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $f3 ADDD extended -**** */ -KONAMI_INLINE void addd_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $f4 ANDB extended -**0- */ -KONAMI_INLINE void andb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $f5 BITB extended -**0- */ -KONAMI_INLINE void bitb_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $f6 LDB extended -**0- */ -KONAMI_INLINE void ldb_ex( void ) -{ - EXTBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* $f7 STB extended -**0- */ -KONAMI_INLINE void stb_ex( void ) -{ - CLR_NZV; - SET_NZ8(B); - EXTENDED; - WM(EAD,B); -} - -/* $f8 EORB extended -**0- */ -KONAMI_INLINE void eorb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B ^= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $f9 ADCB extended ***** */ -KONAMI_INLINE void adcb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $fA ORB extended -**0- */ -KONAMI_INLINE void orb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B |= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $fB ADDB extended ***** */ -KONAMI_INLINE void addb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $fC LDD extended -**0- */ -KONAMI_INLINE void ldd_ex( void ) -{ - EXTWORD(pD); - CLR_NZV; - SET_NZ16(D); -} - -/* $fD STD extended -**0- */ -KONAMI_INLINE void std_ex( void ) -{ - CLR_NZV; - SET_NZ16(D); - EXTENDED; - WM16(EAD,&pD); -} - -/* $fE LDU (LDS) extended -**0- */ -KONAMI_INLINE void ldu_ex( void ) -{ - EXTWORD(pU); - CLR_NZV; - SET_NZ16(U); -} - -/* $10fE LDS extended -**0- */ -KONAMI_INLINE void lds_ex( void ) -{ - EXTWORD(pS); - CLR_NZV; - SET_NZ16(S); - konami.int_state |= KONAMI_LDS; -} - -/* $fF STU (STS) extended -**0- */ -KONAMI_INLINE void stu_ex( void ) -{ - CLR_NZV; - SET_NZ16(U); - EXTENDED; - WM16(EAD,&pU); -} - -/* $10fF STS extended -**0- */ -KONAMI_INLINE void sts_ex( void ) -{ - CLR_NZV; - SET_NZ16(S); - EXTENDED; - WM16(EAD,&pS); -} - -KONAMI_INLINE void setline_im( void ) -{ - UINT8 t; - IMMBYTE(t); - - if ( konami.setlines_callback ) - (*konami.setlines_callback)( t ); -} - -KONAMI_INLINE void setline_ix( void ) -{ - UINT8 t; - t = RM(EA); - - if ( konami.setlines_callback ) - (*konami.setlines_callback)( t ); -} - -KONAMI_INLINE void setline_di( void ) -{ - UINT8 t; - DIRBYTE(t); - - if ( konami.setlines_callback ) - (*konami.setlines_callback)( t ); -} - -KONAMI_INLINE void setline_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - - if ( konami.setlines_callback ) - (*konami.setlines_callback)( t ); -} - -KONAMI_INLINE void bmove( void ) -{ - UINT8 t; - - while( U != 0 ) { - t = RM(Y); - WM(X,t); - Y++; - X++; - U--; - konami_ICount -= 2; - } -} - -KONAMI_INLINE void move( void ) -{ - UINT8 t; - - t = RM(Y); - WM(X,t); - Y++; - X++; - U--; -} - -/* CLRD inherent -0100 */ -KONAMI_INLINE void clrd( void ) -{ - D = 0; - CLR_NZVC; SEZ; -} - -/* CLRW indexed -0100 */ -KONAMI_INLINE void clrw_ix( void ) -{ - PAIR t; - t.d = 0; - WM16(EAD,&t); - CLR_NZVC; SEZ; -} - -/* CLRW direct -0100 */ -KONAMI_INLINE void clrw_di( void ) -{ - PAIR t; - t.d = 0; - DIRECT; - WM16(EAD,&t); - CLR_NZVC; - SEZ; -} - -/* CLRW extended -0100 */ -KONAMI_INLINE void clrw_ex( void ) -{ - PAIR t; - t.d = 0; - EXTENDED; - WM16(EAD,&t); - CLR_NZVC; SEZ; -} - -/* LSRD immediate -0*-* */ -KONAMI_INLINE void lsrd( void ) -{ - UINT8 t; - - IMMBYTE( t ); - - while ( t-- ) { - CLR_NZC; - CC |= (D & CC_C); - D >>= 1; - SET_Z16(D); - } -} - -/* RORD immediate -**-* */ -KONAMI_INLINE void rord( void ) -{ - UINT16 r; - UINT8 t; - - IMMBYTE(t); - - while ( t-- ) { - r = (CC & CC_C) << 15; - CLR_NZC; - CC |= (D & CC_C); - r |= D >> 1; - SET_NZ16(r); - D = r; - } -} - -/* ASRD immediate ?**-* */ -KONAMI_INLINE void asrd( void ) -{ - UINT8 t; - - IMMBYTE(t); - - while ( t-- ) { - CLR_NZC; - CC |= (D & CC_C); - D = (D & 0x8000) | (D >> 1); - SET_NZ16(D); - } -} - -/* ASLD immediate ?**** */ -KONAMI_INLINE void asld( void ) -{ - UINT32 r; - UINT8 t; - - IMMBYTE( t ); - - while ( t-- ) { - r = D << 1; - CLR_NZVC; - SET_FLAGS16(D,D,r); - D = r; - } -} - -/* ROLD immediate -**-* */ -KONAMI_INLINE void rold( void ) -{ - UINT16 r; - UINT8 t; - - IMMBYTE(t); - - while ( t-- ) { - CLR_NZC; - if ( D & 0x8000 ) SEC; - r = CC & CC_C; - r |= D << 1; - SET_NZ16(r); - D = r; - } -} - -/* DECB,JNZ relative ----- */ -KONAMI_INLINE void decbjnz( void ) -{ - --B; - CLR_NZV; - SET_FLAGS8D(B); - BRANCH( !(CC&CC_Z) ); -} - -/* DECX,JNZ relative ----- */ -KONAMI_INLINE void decxjnz( void ) -{ - --X; - CLR_NZV; - SET_NZ16(X); /* should affect V as well? */ - BRANCH( !(CC&CC_Z) ); -} - -KONAMI_INLINE void bset( void ) -{ - UINT8 t; - - while( U != 0 ) { - t = A; - WM(XD,t); - X++; - U--; - konami_ICount -= 2; - } -} - -KONAMI_INLINE void bset2( void ) -{ - while( U != 0 ) { - WM16(XD,&pD); - X += 2; - U--; - konami_ICount -= 3; - } -} - -/* LMUL inherent --*-@ */ -KONAMI_INLINE void lmul( void ) -{ - UINT32 t; - t = X * Y; - X = (t >> 16); - Y = (t & 0xffff); - CLR_ZC; SET_Z(t); if( t & 0x8000 ) SEC; -} - -/* DIVX inherent --*-@ */ -KONAMI_INLINE void divx( void ) -{ - UINT16 t; - UINT8 r; - if ( B != 0 ) - { - t = X / B; - r = X % B; - } - else - { - /* ?? */ - t = 0; - r = 0; - } - CLR_ZC; SET_Z16(t); if ( t & 0x80 ) SEC; - X = t; - B = r; -} - -/* INCD inherent -***- */ -KONAMI_INLINE void incd( void ) -{ - UINT32 r; - r = D + 1; - CLR_NZV; - SET_FLAGS16(D,D,r); - D = r; -} - -/* INCW direct -***- */ -KONAMI_INLINE void incw_di( void ) -{ - PAIR t,r; - DIRWORD(t); - r = t; - ++r.d; - CLR_NZV; - SET_FLAGS16(t.d, t.d, r.d); - WM16(EAD,&r); -} - -/* INCW indexed -***- */ -KONAMI_INLINE void incw_ix( void ) -{ - PAIR t,r; - t.d=RM16(EAD); - r = t; - ++r.d; - CLR_NZV; - SET_FLAGS16(t.d, t.d, r.d); - WM16(EAD,&r); -} - -/* INCW extended -***- */ -KONAMI_INLINE void incw_ex( void ) -{ - PAIR t, r; - EXTWORD(t); - r = t; - ++r.d; - CLR_NZV; SET_FLAGS16(t.d,t.d,r.d); - WM16(EAD,&r); -} - -/* DECD inherent -***- */ -KONAMI_INLINE void decd( void ) -{ - UINT32 r; - r = D - 1; - CLR_NZV; - SET_FLAGS16(D,D,r); - D = r; -} - -/* DECW direct -***- */ -KONAMI_INLINE void decw_di( void ) -{ - PAIR t,r; - DIRWORD(t); - r = t; - --r.d; - CLR_NZV; - SET_FLAGS16(t.d, t.d, r.d); - WM16(EAD,&r); -} - -/* DECW indexed -***- */ -KONAMI_INLINE void decw_ix( void ) -{ - PAIR t, r; - t.d=RM16(EAD); - r = t; - --r.d; - CLR_NZV; SET_FLAGS16(t.d, t.d, r.d); - WM16(EAD,&r); -} - -/* DECW extended -***- */ -KONAMI_INLINE void decw_ex( void ) -{ - PAIR t, r; - EXTWORD(t); - r = t; - --r.d; - CLR_NZV; SET_FLAGS16(t.d,t.d,r.d); - WM16(EAD,&r); -} - -/* TSTD inherent -**0- */ -KONAMI_INLINE void tstd( void ) -{ - CLR_NZV; - SET_NZ16(D); -} - -/* TSTW direct -**0- */ -KONAMI_INLINE void tstw_di( void ) -{ - PAIR t; - CLR_NZV; - DIRWORD(t); - SET_NZ16(t.d); -} - -/* TSTW indexed -**0- */ -KONAMI_INLINE void tstw_ix( void ) -{ - PAIR t; - CLR_NZV; - t.d=RM16(EAD); - SET_NZ16(t.d); -} - -/* TSTW extended -**0- */ -KONAMI_INLINE void tstw_ex( void ) -{ - PAIR t; - CLR_NZV; - EXTWORD(t); - SET_NZ16(t.d); -} - -/* LSRW direct -0*-* */ -KONAMI_INLINE void lsrw_di( void ) -{ - PAIR t; - DIRWORD(t); - CLR_NZC; - CC |= (t.d & CC_C); - t.d >>= 1; - SET_Z16(t.d); - WM16(EAD,&t); -} - -/* LSRW indexed -0*-* */ -KONAMI_INLINE void lsrw_ix( void ) -{ - PAIR t; - t.d=RM16(EAD); - CLR_NZC; - CC |= (t.d & CC_C); - t.d >>= 1; - SET_Z16(t.d); - WM16(EAD,&t); -} - -/* LSRW extended -0*-* */ -KONAMI_INLINE void lsrw_ex( void ) -{ - PAIR t; - EXTWORD(t); - CLR_NZC; - CC |= (t.d & CC_C); - t.d >>= 1; - SET_Z16(t.d); - WM16(EAD,&t); -} - -/* RORW direct -**-* */ -KONAMI_INLINE void rorw_di( void ) -{ - PAIR t,r; - DIRWORD(t); - r.d = (CC & CC_C) << 15; - CLR_NZC; - CC |= (t.d & CC_C); - r.d |= t.d>>1; - SET_NZ16(r.d); - WM16(EAD,&r); -} - -/* RORW indexed -**-* */ -KONAMI_INLINE void rorw_ix( void ) -{ - PAIR t,r; - t.d=RM16(EAD); - r.d = (CC & CC_C) << 15; - CLR_NZC; - CC |= (t.d & CC_C); - r.d |= t.d>>1; - SET_NZ16(r.d); - WM16(EAD,&r); -} - -/* RORW extended -**-* */ -KONAMI_INLINE void rorw_ex( void ) -{ - PAIR t,r; - EXTWORD(t); - r.d = (CC & CC_C) << 15; - CLR_NZC; - CC |= (t.d & CC_C); - r.d |= t.d>>1; - SET_NZ16(r.d); - WM16(EAD,&r); -} - -/* ASRW direct ?**-* */ -KONAMI_INLINE void asrw_di( void ) -{ - PAIR t; - DIRWORD(t); - CLR_NZC; - CC |= (t.d & CC_C); - t.d = (t.d & 0x8000) | (t.d >> 1); - SET_NZ16(t.d); - WM16(EAD,&t); -} - -/* ASRW indexed ?**-* */ -KONAMI_INLINE void asrw_ix( void ) -{ - PAIR t; - t.d=RM16(EAD); - CLR_NZC; - CC |= (t.d & CC_C); - t.d = (t.d & 0x8000) | (t.d >> 1); - SET_NZ16(t.d); - WM16(EAD,&t); -} - -/* ASRW extended ?**-* */ -KONAMI_INLINE void asrw_ex( void ) -{ - PAIR t; - EXTWORD(t); - CLR_NZC; - CC |= (t.d & CC_C); - t.d = (t.d & 0x8000) | (t.d >> 1); - SET_NZ16(t.d); - WM16(EAD,&t); -} - -/* ASLW direct ?**** */ -KONAMI_INLINE void aslw_di( void ) -{ - PAIR t,r; - DIRWORD(t); - r.d = t.d << 1; - CLR_NZVC; - SET_FLAGS16(t.d,t.d,r.d); - WM16(EAD,&r); -} - -/* ASLW indexed ?**** */ -KONAMI_INLINE void aslw_ix( void ) -{ - PAIR t,r; - t.d=RM16(EAD); - r.d = t.d << 1; - CLR_NZVC; - SET_FLAGS16(t.d,t.d,r.d); - WM16(EAD,&r); -} - -/* ASLW extended ?**** */ -KONAMI_INLINE void aslw_ex( void ) -{ - PAIR t,r; - EXTWORD(t); - r.d = t.d << 1; - CLR_NZVC; - SET_FLAGS16(t.d,t.d,r.d); - WM16(EAD,&r); -} - -/* ROLW direct -**** */ -KONAMI_INLINE void rolw_di( void ) -{ - PAIR t,r; - DIRWORD(t); - r.d = (CC & CC_C) | (t.d << 1); - CLR_NZVC; - SET_FLAGS16(t.d,t.d,r.d); - WM16(EAD,&r); -} - -/* ROLW indexed -**** */ -KONAMI_INLINE void rolw_ix( void ) -{ - PAIR t,r; - t.d=RM16(EAD); - r.d = (CC & CC_C) | (t.d << 1); - CLR_NZVC; - SET_FLAGS16(t.d,t.d,r.d); - WM16(EAD,&r); -} - -/* ROLW extended -**** */ -KONAMI_INLINE void rolw_ex( void ) -{ - PAIR t,r; - EXTWORD(t); - r.d = (CC & CC_C) | (t.d << 1); - CLR_NZVC; - SET_FLAGS16(t.d,t.d,r.d); - WM16(EAD,&r); -} - -/* NEGD inherent ?**** */ -KONAMI_INLINE void negd( void ) -{ - UINT32 r; - r = -D; - CLR_NZVC; - SET_FLAGS16(0,D,r); - D = r; -} - -/* NEGW direct ?**** */ -KONAMI_INLINE void negw_di( void ) -{ - PAIR r,t; - DIRWORD(t); - r.d = -t.d; - CLR_NZVC; - SET_FLAGS16(0,t.d,r.d); - WM16(EAD,&r); -} - -/* NEGW indexed ?**** */ -KONAMI_INLINE void negw_ix( void ) -{ - PAIR r,t; - t.d=RM16(EAD); - r.d = -t.d; - CLR_NZVC; - SET_FLAGS16(0,t.d,r.d); - WM16(EAD,&r); -} - -/* NEGW extended ?**** */ -KONAMI_INLINE void negw_ex( void ) -{ - PAIR r,t; - EXTWORD(t); - r.d = -t.d; - CLR_NZVC; - SET_FLAGS16(0,t.d,r.d); - WM16(EAD,&r); -} - -/* ABSA inherent ?**** */ -KONAMI_INLINE void absa( void ) -{ - UINT16 r; - if (A & 0x80) - r = -A; - else - r = A; - CLR_NZVC; - SET_FLAGS8(0,A,r); - A = r; -} - -/* ABSB inherent ?**** */ -KONAMI_INLINE void absb( void ) -{ - UINT16 r; - if (B & 0x80) - r = -B; - else - r = B; - CLR_NZVC; - SET_FLAGS8(0,B,r); - B = r; -} - -/* ABSD inherent ?**** */ -KONAMI_INLINE void absd( void ) -{ - UINT32 r; - if (D & 0x8000) - r = -D; - else - r = D; - CLR_NZVC; - SET_FLAGS16(0,D,r); - D = r; -} - -/* LSRD direct -0*-* */ -KONAMI_INLINE void lsrd_di( void ) -{ - UINT8 t; - - DIRBYTE( t ); - - while ( t-- ) { - CLR_NZC; - CC |= (D & CC_C); - D >>= 1; - SET_Z16(D); - } -} - -/* RORD direct -**-* */ -KONAMI_INLINE void rord_di( void ) -{ - UINT16 r; - UINT8 t; - - DIRBYTE(t); - - while ( t-- ) { - r = (CC & CC_C) << 15; - CLR_NZC; - CC |= (D & CC_C); - r |= D >> 1; - SET_NZ16(r); - D = r; - } -} - -/* ASRD direct ?**-* */ -KONAMI_INLINE void asrd_di( void ) -{ - UINT8 t; - - DIRBYTE(t); - - while ( t-- ) { - CLR_NZC; - CC |= (D & CC_C); - D = (D & 0x8000) | (D >> 1); - SET_NZ16(D); - } -} - -/* ASLD direct ?**** */ -KONAMI_INLINE void asld_di( void ) -{ - UINT32 r; - UINT8 t; - - DIRBYTE( t ); - - while ( t-- ) { - r = D << 1; - CLR_NZVC; - SET_FLAGS16(D,D,r); - D = r; - } -} - -/* ROLD direct -**-* */ -KONAMI_INLINE void rold_di( void ) -{ - UINT16 r; - UINT8 t; - - DIRBYTE(t); - - while ( t-- ) { - CLR_NZC; - if ( D & 0x8000 ) SEC; - r = CC & CC_C; - r |= D << 1; - SET_NZ16(r); - D = r; - } -} - -/* LSRD indexed -0*-* */ -KONAMI_INLINE void lsrd_ix( void ) -{ - UINT8 t; - - t=RM(EA); - - while ( t-- ) { - CLR_NZC; - CC |= (D & CC_C); - D >>= 1; - SET_Z16(D); - } -} - -/* RORD indexed -**-* */ -KONAMI_INLINE void rord_ix( void ) -{ - UINT16 r; - UINT8 t; - - t=RM(EA); - - while ( t-- ) { - r = (CC & CC_C) << 15; - CLR_NZC; - CC |= (D & CC_C); - r |= D >> 1; - SET_NZ16(r); - D = r; - } -} - -/* ASRD indexed ?**-* */ -KONAMI_INLINE void asrd_ix( void ) -{ - UINT8 t; - - t=RM(EA); - - while ( t-- ) { - CLR_NZC; - CC |= (D & CC_C); - D = (D & 0x8000) | (D >> 1); - SET_NZ16(D); - } -} - -/* ASLD indexed ?**** */ -KONAMI_INLINE void asld_ix( void ) -{ - UINT32 r; - UINT8 t; - - t=RM(EA); - - while ( t-- ) { - r = D << 1; - CLR_NZVC; - SET_FLAGS16(D,D,r); - D = r; - } -} - -/* ROLD indexed -**-* */ -KONAMI_INLINE void rold_ix( void ) -{ - UINT16 r; - UINT8 t; - - t=RM(EA); - - while ( t-- ) { - CLR_NZC; - if ( D & 0x8000 ) SEC; - r = CC & CC_C; - r |= D << 1; - SET_NZ16(r); - D = r; - } -} - -/* LSRD extended -0*-* */ -KONAMI_INLINE void lsrd_ex( void ) -{ - UINT8 t; - - EXTBYTE(t); - - while ( t-- ) { - CLR_NZC; - CC |= (D & CC_C); - D >>= 1; - SET_Z16(D); - } -} - -/* RORD extended -**-* */ -KONAMI_INLINE void rord_ex( void ) -{ - UINT16 r; - UINT8 t; - - EXTBYTE(t); - - while ( t-- ) { - r = (CC & CC_C) << 15; - CLR_NZC; - CC |= (D & CC_C); - r |= D >> 1; - SET_NZ16(r); - D = r; - } -} - -/* ASRD extended ?**-* */ -KONAMI_INLINE void asrd_ex( void ) -{ - UINT8 t; - - EXTBYTE(t); - - while ( t-- ) { - CLR_NZC; - CC |= (D & CC_C); - D = (D & 0x8000) | (D >> 1); - SET_NZ16(D); - } -} - -/* ASLD extended ?**** */ -KONAMI_INLINE void asld_ex( void ) -{ - UINT32 r; - UINT8 t; - - EXTBYTE(t); - - while ( t-- ) { - r = D << 1; - CLR_NZVC; - SET_FLAGS16(D,D,r); - D = r; - } -} - -/* ROLD extended -**-* */ -KONAMI_INLINE void rold_ex( void ) -{ - UINT16 r; - UINT8 t; - - EXTBYTE(t); - - while ( t-- ) { - CLR_NZC; - if ( D & 0x8000 ) SEC; - r = CC & CC_C; - r |= D << 1; - SET_NZ16(r); - D = r; - } -} - -KONAMI_INLINE void opcode2( void ) -{ - UINT8 ireg2 = ROP_ARG(PCD); - PC++; - - switch ( ireg2 ) { -// case 0x00: EA=0; break; /* auto increment */ -// case 0x01: EA=0; break; /* double auto increment */ -// case 0x02: EA=0; break; /* auto decrement */ -// case 0x03: EA=0; break; /* double auto decrement */ -// case 0x04: EA=0; break; /* postbyte offs */ -// case 0x05: EA=0; break; /* postword offs */ -// case 0x06: EA=0; break; /* normal */ - case 0x07: - EAD=0; - (*konami_extended[konami.ireg])(); - konami_ICount -= 2; - return; -// case 0x08: EA=0; break; /* indirect - auto increment */ -// case 0x09: EA=0; break; /* indirect - double auto increment */ -// case 0x0a: EA=0; break; /* indirect - auto decrement */ -// case 0x0b: EA=0; break; /* indirect - double auto decrement */ -// case 0x0c: EA=0; break; /* indirect - postbyte offs */ -// case 0x0d: EA=0; break; /* indirect - postword offs */ -// case 0x0e: EA=0; break; /* indirect - normal */ - case 0x0f: /* indirect - extended */ - IMMWORD(ea); - EA=RM16(EAD); - konami_ICount-=4; - break; -// case 0x10: EA=0; break; /* auto increment */ -// case 0x11: EA=0; break; /* double auto increment */ -// case 0x12: EA=0; break; /* auto decrement */ -// case 0x13: EA=0; break; /* double auto decrement */ -// case 0x14: EA=0; break; /* postbyte offs */ -// case 0x15: EA=0; break; /* postword offs */ -// case 0x16: EA=0; break; /* normal */ -// case 0x17: EA=0; break; /* extended */ -// case 0x18: EA=0; break; /* indirect - auto increment */ -// case 0x19: EA=0; break; /* indirect - double auto increment */ -// case 0x1a: EA=0; break; /* indirect - auto decrement */ -// case 0x1b: EA=0; break; /* indirect - double auto decrement */ -// case 0x1c: EA=0; break; /* indirect - postbyte offs */ -// case 0x1d: EA=0; break; /* indirect - postword offs */ -// case 0x1e: EA=0; break; /* indirect - normal */ -// case 0x1f: EA=0; break; /* indirect - extended */ - -/* base X */ - case 0x20: /* auto increment */ - EA=X; - X++; - konami_ICount-=2; - break; - case 0x21: /* double auto increment */ - EA=X; - X+=2; - konami_ICount-=3; - break; - case 0x22: /* auto decrement */ - X--; - EA=X; - konami_ICount-=2; - break; - case 0x23: /* double auto decrement */ - X-=2; - EA=X; - konami_ICount-=3; - break; - case 0x24: /* postbyte offs */ - IMMBYTE(EA); - EA=X+SIGNED(EA); - konami_ICount-=2; - break; - case 0x25: /* postword offs */ - IMMWORD(ea); - EA+=X; - konami_ICount-=4; - break; - case 0x26: /* normal */ - EA=X; - break; -// case 0x27: EA=0; break; /* extended */ - case 0x28: /* indirect - auto increment */ - EA=X; - X++; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x29: /* indirect - double auto increment */ - EA=X; - X+=2; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x2a: /* indirect - auto decrement */ - X--; - EA=X; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x2b: /* indirect - double auto decrement */ - X-=2; - EA=X; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x2c: /* indirect - postbyte offs */ - IMMBYTE(EA); - EA=X+SIGNED(EA); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0x2d: /* indirect - postword offs */ - IMMWORD(ea); - EA+=X; - EA=RM16(EAD); - konami_ICount-=7; - break; - case 0x2e: /* indirect - normal */ - EA=X; - EA=RM16(EAD); - konami_ICount-=3; - break; -// case 0x2f: EA=0; break; /* indirect - extended */ - -/* base Y */ - case 0x30: /* auto increment */ - EA=Y; - Y++; - konami_ICount-=2; - break; - case 0x31: /* double auto increment */ - EA=Y; - Y+=2; - konami_ICount-=3; - break; - case 0x32: /* auto decrement */ - Y--; - EA=Y; - konami_ICount-=2; - break; - case 0x33: /* double auto decrement */ - Y-=2; - EA=Y; - konami_ICount-=3; - break; - case 0x34: /* postbyte offs */ - IMMBYTE(EA); - EA=Y+SIGNED(EA); - konami_ICount-=2; - break; - case 0x35: /* postword offs */ - IMMWORD(ea); - EA+=Y; - konami_ICount-=4; - break; - case 0x36: /* normal */ - EA=Y; - break; -// case 0x37: EA=0; break; /* extended */ - case 0x38: /* indirect - auto increment */ - EA=Y; - Y++; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x39: /* indirect - double auto increment */ - EA=Y; - Y+=2; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x3a: /* indirect - auto decrement */ - Y--; - EA=Y; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x3b: /* indirect - double auto decrement */ - Y-=2; - EA=Y; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x3c: /* indirect - postbyte offs */ - IMMBYTE(EA); - EA=Y+SIGNED(EA); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0x3d: /* indirect - postword offs */ - IMMWORD(ea); - EA+=Y; - EA=RM16(EAD); - konami_ICount-=7; - break; - case 0x3e: /* indirect - normal */ - EA=Y; - EA=RM16(EAD); - konami_ICount-=3; - break; -// case 0x3f: EA=0; break; /* indirect - extended */ - -// case 0x40: EA=0; break; /* auto increment */ -// case 0x41: EA=0; break; /* double auto increment */ -// case 0x42: EA=0; break; /* auto decrement */ -// case 0x43: EA=0; break; /* double auto decrement */ -// case 0x44: EA=0; break; /* postbyte offs */ -// case 0x45: EA=0; break; /* postword offs */ -// case 0x46: EA=0; break; /* normal */ -// case 0x47: EA=0; break; /* extended */ -// case 0x48: EA=0; break; /* indirect - auto increment */ -// case 0x49: EA=0; break; /* indirect - double auto increment */ -// case 0x4a: EA=0; break; /* indirect - auto decrement */ -// case 0x4b: EA=0; break; /* indirect - double auto decrement */ -// case 0x4c: EA=0; break; /* indirect - postbyte offs */ -// case 0x4d: EA=0; break; /* indirect - postword offs */ -// case 0x4e: EA=0; break; /* indirect - normal */ -// case 0x4f: EA=0; break; /* indirect - extended */ - -/* base U */ - case 0x50: /* auto increment */ - EA=U; - U++; - konami_ICount-=2; - break; - case 0x51: /* double auto increment */ - EA=U; - U+=2; - konami_ICount-=3; - break; - case 0x52: /* auto decrement */ - U--; - EA=U; - konami_ICount-=2; - break; - case 0x53: /* double auto decrement */ - U-=2; - EA=U; - konami_ICount-=3; - break; - case 0x54: /* postbyte offs */ - IMMBYTE(EA); - EA=U+SIGNED(EA); - konami_ICount-=2; - break; - case 0x55: /* postword offs */ - IMMWORD(ea); - EA+=U; - konami_ICount-=4; - break; - case 0x56: /* normal */ - EA=U; - break; -// case 0x57: EA=0; break; /* extended */ - case 0x58: /* indirect - auto increment */ - EA=U; - U++; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x59: /* indirect - double auto increment */ - EA=U; - U+=2; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x5a: /* indirect - auto decrement */ - U--; - EA=U; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x5b: /* indirect - double auto decrement */ - U-=2; - EA=U; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x5c: /* indirect - postbyte offs */ - IMMBYTE(EA); - EA=U+SIGNED(EA); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0x5d: /* indirect - postword offs */ - IMMWORD(ea); - EA+=U; - EA=RM16(EAD); - konami_ICount-=7; - break; - case 0x5e: /* indirect - normal */ - EA=U; - EA=RM16(EAD); - konami_ICount-=3; - break; -// case 0x5f: EA=0; break; /* indirect - extended */ - -/* base S */ - case 0x60: /* auto increment */ - EAD=SD; - S++; - konami_ICount-=2; - break; - case 0x61: /* double auto increment */ - EAD=SD; - S+=2; - konami_ICount-=3; - break; - case 0x62: /* auto decrement */ - S--; - EAD=SD; - konami_ICount-=2; - break; - case 0x63: /* double auto decrement */ - S-=2; - EAD=SD; - konami_ICount-=3; - break; - case 0x64: /* postbyte offs */ - IMMBYTE(EA); - EA=S+SIGNED(EA); - konami_ICount-=2; - break; - case 0x65: /* postword offs */ - IMMWORD(ea); - EA+=S; - konami_ICount-=4; - break; - case 0x66: /* normal */ - EAD=SD; - break; -// case 0x67: EA=0; break; /* extended */ - case 0x68: /* indirect - auto increment */ - EAD=SD; - S++; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x69: /* indirect - double auto increment */ - EAD=SD; - S+=2; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x6a: /* indirect - auto decrement */ - S--; - EAD=SD; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x6b: /* indirect - double auto decrement */ - S-=2; - EAD=SD; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x6c: /* indirect - postbyte offs */ - IMMBYTE(EA); - EA=S+SIGNED(EA); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0x6d: /* indirect - postword offs */ - IMMWORD(ea); - EA+=S; - EA=RM16(EAD); - konami_ICount-=7; - break; - case 0x6e: /* indirect - normal */ - EAD=SD; - EA=RM16(EAD); - konami_ICount-=3; - break; -// case 0x6f: EA=0; break; /* indirect - extended */ - -/* base PC */ - case 0x70: /* auto increment */ - EAD=PCD; - PC++; - konami_ICount-=2; - break; - case 0x71: /* double auto increment */ - EAD=PCD; - PC+=2; - konami_ICount-=3; - break; - case 0x72: /* auto decrement */ - PC--; - EAD=PCD; - konami_ICount-=2; - break; - case 0x73: /* double auto decrement */ - PC-=2; - EAD=PCD; - konami_ICount-=3; - break; - case 0x74: /* postbyte offs */ - IMMBYTE(EA); - EA=PC-1+SIGNED(EA); - konami_ICount-=2; - break; - case 0x75: /* postword offs */ - IMMWORD(ea); - EA+=PC-2; - konami_ICount-=4; - break; - case 0x76: /* normal */ - EAD=PCD; - break; -// case 0x77: EA=0; break; /* extended */ - case 0x78: /* indirect - auto increment */ - EAD=PCD; - PC++; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x79: /* indirect - double auto increment */ - EAD=PCD; - PC+=2; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x7a: /* indirect - auto decrement */ - PC--; - EAD=PCD; - EA=RM16(EAD); - konami_ICount-=5; - break; - case 0x7b: /* indirect - double auto decrement */ - PC-=2; - EAD=PCD; - EA=RM16(EAD); - konami_ICount-=6; - break; - case 0x7c: /* indirect - postbyte offs */ - IMMBYTE(EA); - EA=PC-1+SIGNED(EA); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0x7d: /* indirect - postword offs */ - IMMWORD(ea); - EA+=PC-2; - EA=RM16(EAD); - konami_ICount-=7; - break; - case 0x7e: /* indirect - normal */ - EAD=PCD; - EA=RM16(EAD); - konami_ICount-=3; - break; -// case 0x7f: EA=0; break; /* indirect - extended */ - -// case 0x80: EA=0; break; /* register a */ -// case 0x81: EA=0; break; /* register b */ -// case 0x82: EA=0; break; /* ???? */ -// case 0x83: EA=0; break; /* ???? */ -// case 0x84: EA=0; break; /* ???? */ -// case 0x85: EA=0; break; /* ???? */ -// case 0x86: EA=0; break; /* ???? */ -// case 0x87: EA=0; break; /* register d */ -// case 0x88: EA=0; break; /* indirect - register a */ -// case 0x89: EA=0; break; /* indirect - register b */ -// case 0x8a: EA=0; break; /* indirect - ???? */ -// case 0x8b: EA=0; break; /* indirect - ???? */ -// case 0x8c: EA=0; break; /* indirect - ???? */ -// case 0x8d: EA=0; break; /* indirect - ???? */ -// case 0x8e: EA=0; break; /* indirect - register d */ -// case 0x8f: EA=0; break; /* indirect - ???? */ -// case 0x90: EA=0; break; /* register a */ -// case 0x91: EA=0; break; /* register b */ -// case 0x92: EA=0; break; /* ???? */ -// case 0x93: EA=0; break; /* ???? */ -// case 0x94: EA=0; break; /* ???? */ -// case 0x95: EA=0; break; /* ???? */ -// case 0x96: EA=0; break; /* ???? */ -// case 0x97: EA=0; break; /* register d */ -// case 0x98: EA=0; break; /* indirect - register a */ -// case 0x99: EA=0; break; /* indirect - register b */ -// case 0x9a: EA=0; break; /* indirect - ???? */ -// case 0x9b: EA=0; break; /* indirect - ???? */ -// case 0x9c: EA=0; break; /* indirect - ???? */ -// case 0x9d: EA=0; break; /* indirect - ???? */ -// case 0x9e: EA=0; break; /* indirect - register d */ -// case 0x9f: EA=0; break; /* indirect - ???? */ - case 0xa0: /* register a */ - EA=X+SIGNED(A); - konami_ICount-=1; - break; - case 0xa1: /* register b */ - EA=X+SIGNED(B); - konami_ICount-=1; - break; -// case 0xa2: EA=0; break; /* ???? */ -// case 0xa3: EA=0; break; /* ???? */ -// case 0xa4: EA=0; break; /* ???? */ -// case 0xa5: EA=0; break; /* ???? */ -// case 0xa6: EA=0; break; /* ???? */ - case 0xa7: /* register d */ - EA=X+D; - konami_ICount-=4; - break; - case 0xa8: /* indirect - register a */ - EA=X+SIGNED(A); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0xa9: /* indirect - register b */ - EA=X+SIGNED(B); - EA=RM16(EAD); - konami_ICount-=4; - break; -// case 0xaa: EA=0; break; /* indirect - ???? */ -// case 0xab: EA=0; break; /* indirect - ???? */ -// case 0xac: EA=0; break; /* indirect - ???? */ -// case 0xad: EA=0; break; /* indirect - ???? */ -// case 0xae: EA=0; break; /* indirect - ???? */ - case 0xaf: /* indirect - register d */ - EA=X+D; - EA=RM16(EAD); - konami_ICount-=7; - break; - case 0xb0: /* register a */ - EA=Y+SIGNED(A); - konami_ICount-=1; - break; - case 0xb1: /* register b */ - EA=Y+SIGNED(B); - konami_ICount-=1; - break; -// case 0xb2: EA=0; break; /* ???? */ -// case 0xb3: EA=0; break; /* ???? */ -// case 0xb4: EA=0; break; /* ???? */ -// case 0xb5: EA=0; break; /* ???? */ -// case 0xb6: EA=0; break; /* ???? */ - case 0xb7: /* register d */ - EA=Y+D; - konami_ICount-=4; - break; - case 0xb8: /* indirect - register a */ - EA=Y+SIGNED(A); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0xb9: /* indirect - register b */ - EA=Y+SIGNED(B); - EA=RM16(EAD); - konami_ICount-=4; - break; -// case 0xba: EA=0; break; /* indirect - ???? */ -// case 0xbb: EA=0; break; /* indirect - ???? */ -// case 0xbc: EA=0; break; /* indirect - ???? */ -// case 0xbd: EA=0; break; /* indirect - ???? */ -// case 0xbe: EA=0; break; /* indirect - ???? */ - case 0xbf: /* indirect - register d */ - EA=Y+D; - EA=RM16(EAD); - konami_ICount-=7; - break; -// case 0xc0: EA=0; break; /* register a */ -// case 0xc1: EA=0; break; /* register b */ -// case 0xc2: EA=0; break; /* ???? */ -// case 0xc3: EA=0; break; /* ???? */ - case 0xc4: - EAD=0; - (*konami_direct[konami.ireg])(); - konami_ICount -= 1; - return; -// case 0xc5: EA=0; break; /* ???? */ -// case 0xc6: EA=0; break; /* ???? */ -// case 0xc7: EA=0; break; /* register d */ -// case 0xc8: EA=0; break; /* indirect - register a */ -// case 0xc9: EA=0; break; /* indirect - register b */ -// case 0xca: EA=0; break; /* indirect - ???? */ -// case 0xcb: EA=0; break; /* indirect - ???? */ - case 0xcc: /* indirect - direct */ - DIRWORD(ea); - konami_ICount-=4; - break; -// case 0xcd: EA=0; break; /* indirect - ???? */ -// case 0xce: EA=0; break; /* indirect - register d */ -// case 0xcf: EA=0; break; /* indirect - ???? */ - case 0xd0: /* register a */ - EA=U+SIGNED(A); - konami_ICount-=1; - break; - case 0xd1: /* register b */ - EA=U+SIGNED(B); - konami_ICount-=1; - break; -// case 0xd2: EA=0; break; /* ???? */ -// case 0xd3: EA=0; break; /* ???? */ -// case 0xd4: EA=0; break; /* ???? */ -// case 0xd5: EA=0; break; /* ???? */ -// case 0xd6: EA=0; break; /* ???? */ - case 0xd7: /* register d */ - EA=U+D; - konami_ICount-=4; - break; - case 0xd8: /* indirect - register a */ - EA=U+SIGNED(A); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0xd9: /* indirect - register b */ - EA=U+SIGNED(B); - EA=RM16(EAD); - konami_ICount-=4; - break; -// case 0xda: EA=0; break; /* indirect - ???? */ -// case 0xdb: EA=0; break; /* indirect - ???? */ -// case 0xdc: EA=0; break; /* indirect - ???? */ -// case 0xdd: EA=0; break; /* indirect - ???? */ -// case 0xde: EA=0; break; /* indirect - ???? */ - case 0xdf: /* indirect - register d */ - EA=U+D; - EA=RM16(EAD); - konami_ICount-=7; - break; - case 0xe0: /* register a */ - EA=S+SIGNED(A); - konami_ICount-=1; - break; - case 0xe1: /* register b */ - EA=S+SIGNED(B); - konami_ICount-=1; - break; -// case 0xe2: EA=0; break; /* ???? */ -// case 0xe3: EA=0; break; /* ???? */ -// case 0xe4: EA=0; break; /* ???? */ -// case 0xe5: EA=0; break; /* ???? */ -// case 0xe6: EA=0; break; /* ???? */ - case 0xe7: /* register d */ - EA=S+D; - konami_ICount-=4; - break; - case 0xe8: /* indirect - register a */ - EA=S+SIGNED(A); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0xe9: /* indirect - register b */ - EA=S+SIGNED(B); - EA=RM16(EAD); - konami_ICount-=4; - break; -// case 0xea: EA=0; break; /* indirect - ???? */ -// case 0xeb: EA=0; break; /* indirect - ???? */ -// case 0xec: EA=0; break; /* indirect - ???? */ -// case 0xed: EA=0; break; /* indirect - ???? */ -// case 0xee: EA=0; break; /* indirect - ???? */ - case 0xef: /* indirect - register d */ - EA=S+D; - EA=RM16(EAD); - konami_ICount-=7; - break; - case 0xf0: /* register a */ - EA=PC+SIGNED(A); - konami_ICount-=1; - break; - case 0xf1: /* register b */ - EA=PC+SIGNED(B); - konami_ICount-=1; - break; -// case 0xf2: EA=0; break; /* ???? */ -// case 0xf3: EA=0; break; /* ???? */ -// case 0xf4: EA=0; break; /* ???? */ -// case 0xf5: EA=0; break; /* ???? */ -// case 0xf6: EA=0; break; /* ???? */ - case 0xf7: /* register d */ - EA=PC+D; - konami_ICount-=4; - break; - case 0xf8: /* indirect - register a */ - EA=PC+SIGNED(A); - EA=RM16(EAD); - konami_ICount-=4; - break; - case 0xf9: /* indirect - register b */ - EA=PC+SIGNED(B); - EA=RM16(EAD); - konami_ICount-=4; - break; -// case 0xfa: EA=0; break; /* indirect - ???? */ -// case 0xfb: EA=0; break; /* indirect - ???? */ -// case 0xfc: EA=0; break; /* indirect - ???? */ -// case 0xfd: EA=0; break; /* indirect - ???? */ -// case 0xfe: EA=0; break; /* indirect - ???? */ - case 0xff: /* indirect - register d */ - EA=PC+D; - EA=RM16(EAD); - konami_ICount-=7; - break; - default: - logerror("KONAMI: Unknown/Invalid postbyte at PC = %04x\n", PC -1 ); - EAD = 0; - } - (*konami_indexed[konami.ireg])(); -} diff --git a/jan/src/cpu/konami/konamtbl.c b/jan/src/cpu/konami/konamtbl.c deleted file mode 100644 index 3b9e11777..000000000 --- a/jan/src/cpu/konami/konamtbl.c +++ /dev/null @@ -1,491 +0,0 @@ -KONAMI_INLINE void abx(void); -KONAMI_INLINE void adca_di(void); -KONAMI_INLINE void adca_ex(void); -KONAMI_INLINE void adca_im(void); -KONAMI_INLINE void adca_ix(void); -KONAMI_INLINE void adcb_di(void); -KONAMI_INLINE void adcb_ex(void); -KONAMI_INLINE void adcb_im(void); -KONAMI_INLINE void adcb_ix(void); -KONAMI_INLINE void adda_di(void); -KONAMI_INLINE void adda_ex(void); -KONAMI_INLINE void adda_im(void); -KONAMI_INLINE void adda_ix(void); -KONAMI_INLINE void addb_di(void); -KONAMI_INLINE void addb_ex(void); -KONAMI_INLINE void addb_im(void); -KONAMI_INLINE void addb_ix(void); -KONAMI_INLINE void addd_di(void); -KONAMI_INLINE void addd_ex(void); -KONAMI_INLINE void addd_im(void); -KONAMI_INLINE void addd_ix(void); -KONAMI_INLINE void anda_di(void); -KONAMI_INLINE void anda_ex(void); -KONAMI_INLINE void anda_im(void); -KONAMI_INLINE void anda_ix(void); -KONAMI_INLINE void andb_di(void); -KONAMI_INLINE void andb_ex(void); -KONAMI_INLINE void andb_im(void); -KONAMI_INLINE void andb_ix(void); -KONAMI_INLINE void andcc(void); -KONAMI_INLINE void asl_di(void); -KONAMI_INLINE void asl_ex(void); -KONAMI_INLINE void asl_ix(void); -KONAMI_INLINE void asla(void); -KONAMI_INLINE void aslb(void); -KONAMI_INLINE void asr_di(void); -KONAMI_INLINE void asr_ex(void); -KONAMI_INLINE void asr_ix(void); -KONAMI_INLINE void asra(void); -KONAMI_INLINE void asrb(void); -KONAMI_INLINE void bcc(void); -KONAMI_INLINE void bcs(void); -KONAMI_INLINE void beq(void); -KONAMI_INLINE void bge(void); -KONAMI_INLINE void bgt(void); -KONAMI_INLINE void bhi(void); -KONAMI_INLINE void bita_di(void); -KONAMI_INLINE void bita_ex(void); -KONAMI_INLINE void bita_im(void); -KONAMI_INLINE void bita_ix(void); -KONAMI_INLINE void bitb_di(void); -KONAMI_INLINE void bitb_ex(void); -KONAMI_INLINE void bitb_im(void); -KONAMI_INLINE void bitb_ix(void); -KONAMI_INLINE void ble(void); -KONAMI_INLINE void bls(void); -KONAMI_INLINE void blt(void); -KONAMI_INLINE void bmi(void); -KONAMI_INLINE void bne(void); -KONAMI_INLINE void bpl(void); -KONAMI_INLINE void bra(void); -KONAMI_INLINE void brn(void); -KONAMI_INLINE void bsr(void); -KONAMI_INLINE void bvc(void); -KONAMI_INLINE void bvs(void); -KONAMI_INLINE void clr_di(void); -KONAMI_INLINE void clr_ex(void); -KONAMI_INLINE void clr_ix(void); -KONAMI_INLINE void clra(void); -KONAMI_INLINE void clrb(void); -KONAMI_INLINE void cmpa_di(void); -KONAMI_INLINE void cmpa_ex(void); -KONAMI_INLINE void cmpa_im(void); -KONAMI_INLINE void cmpa_ix(void); -KONAMI_INLINE void cmpb_di(void); -KONAMI_INLINE void cmpb_ex(void); -KONAMI_INLINE void cmpb_im(void); -KONAMI_INLINE void cmpb_ix(void); -KONAMI_INLINE void cmpd_di(void); -KONAMI_INLINE void cmpd_ex(void); -KONAMI_INLINE void cmpd_im(void); -KONAMI_INLINE void cmpd_ix(void); -KONAMI_INLINE void cmps_di(void); -KONAMI_INLINE void cmps_ex(void); -KONAMI_INLINE void cmps_im(void); -KONAMI_INLINE void cmps_ix(void); -KONAMI_INLINE void cmpu_di(void); -KONAMI_INLINE void cmpu_ex(void); -KONAMI_INLINE void cmpu_im(void); -KONAMI_INLINE void cmpu_ix(void); -KONAMI_INLINE void cmpx_di(void); -KONAMI_INLINE void cmpx_ex(void); -KONAMI_INLINE void cmpx_im(void); -KONAMI_INLINE void cmpx_ix(void); -KONAMI_INLINE void cmpy_di(void); -KONAMI_INLINE void cmpy_ex(void); -KONAMI_INLINE void cmpy_im(void); -KONAMI_INLINE void cmpy_ix(void); -KONAMI_INLINE void com_di(void); -KONAMI_INLINE void com_ex(void); -KONAMI_INLINE void com_ix(void); -KONAMI_INLINE void coma(void); -KONAMI_INLINE void comb(void); -KONAMI_INLINE void cwai(void); -KONAMI_INLINE void daa(void); -KONAMI_INLINE void dec_di(void); -KONAMI_INLINE void dec_ex(void); -KONAMI_INLINE void dec_ix(void); -KONAMI_INLINE void deca(void); -KONAMI_INLINE void decb(void); -KONAMI_INLINE void eora_di(void); -KONAMI_INLINE void eora_ex(void); -KONAMI_INLINE void eora_im(void); -KONAMI_INLINE void eora_ix(void); -KONAMI_INLINE void eorb_di(void); -KONAMI_INLINE void eorb_ex(void); -KONAMI_INLINE void eorb_im(void); -KONAMI_INLINE void eorb_ix(void); -KONAMI_INLINE void exg(void); -KONAMI_INLINE void illegal(void); -KONAMI_INLINE void inc_di(void); -KONAMI_INLINE void inc_ex(void); -KONAMI_INLINE void inc_ix(void); -KONAMI_INLINE void inca(void); -KONAMI_INLINE void incb(void); -KONAMI_INLINE void jmp_di(void); -KONAMI_INLINE void jmp_ex(void); -KONAMI_INLINE void jmp_ix(void); -KONAMI_INLINE void jsr_di(void); -KONAMI_INLINE void jsr_ex(void); -KONAMI_INLINE void jsr_ix(void); -KONAMI_INLINE void lbcc(void); -KONAMI_INLINE void lbcs(void); -KONAMI_INLINE void lbeq(void); -KONAMI_INLINE void lbge(void); -KONAMI_INLINE void lbgt(void); -KONAMI_INLINE void lbhi(void); -KONAMI_INLINE void lble(void); -KONAMI_INLINE void lbls(void); -KONAMI_INLINE void lblt(void); -KONAMI_INLINE void lbmi(void); -KONAMI_INLINE void lbne(void); -KONAMI_INLINE void lbpl(void); -KONAMI_INLINE void lbra(void); -KONAMI_INLINE void lbrn(void); -KONAMI_INLINE void lbsr(void); -KONAMI_INLINE void lbvc(void); -KONAMI_INLINE void lbvs(void); -KONAMI_INLINE void lda_di(void); -KONAMI_INLINE void lda_ex(void); -KONAMI_INLINE void lda_im(void); -KONAMI_INLINE void lda_ix(void); -KONAMI_INLINE void ldb_di(void); -KONAMI_INLINE void ldb_ex(void); -KONAMI_INLINE void ldb_im(void); -KONAMI_INLINE void ldb_ix(void); -KONAMI_INLINE void ldd_di(void); -KONAMI_INLINE void ldd_ex(void); -KONAMI_INLINE void ldd_im(void); -KONAMI_INLINE void ldd_ix(void); -KONAMI_INLINE void lds_di(void); -KONAMI_INLINE void lds_ex(void); -KONAMI_INLINE void lds_im(void); -KONAMI_INLINE void lds_ix(void); -KONAMI_INLINE void ldu_di(void); -KONAMI_INLINE void ldu_ex(void); -KONAMI_INLINE void ldu_im(void); -KONAMI_INLINE void ldu_ix(void); -KONAMI_INLINE void ldx_di(void); -KONAMI_INLINE void ldx_ex(void); -KONAMI_INLINE void ldx_im(void); -KONAMI_INLINE void ldx_ix(void); -KONAMI_INLINE void ldy_di(void); -KONAMI_INLINE void ldy_ex(void); -KONAMI_INLINE void ldy_im(void); -KONAMI_INLINE void ldy_ix(void); -KONAMI_INLINE void leas(void); -KONAMI_INLINE void leau(void); -KONAMI_INLINE void leax(void); -KONAMI_INLINE void leay(void); -KONAMI_INLINE void lsr_di(void); -KONAMI_INLINE void lsr_ex(void); -KONAMI_INLINE void lsr_ix(void); -KONAMI_INLINE void lsra(void); -KONAMI_INLINE void lsrb(void); -KONAMI_INLINE void mul(void); -KONAMI_INLINE void neg_di(void); -KONAMI_INLINE void neg_ex(void); -KONAMI_INLINE void neg_ix(void); -KONAMI_INLINE void nega(void); -KONAMI_INLINE void negb(void); -KONAMI_INLINE void nop(void); -KONAMI_INLINE void ora_di(void); -KONAMI_INLINE void ora_ex(void); -KONAMI_INLINE void ora_im(void); -KONAMI_INLINE void ora_ix(void); -KONAMI_INLINE void orb_di(void); -KONAMI_INLINE void orb_ex(void); -KONAMI_INLINE void orb_im(void); -KONAMI_INLINE void orb_ix(void); -KONAMI_INLINE void orcc(void); -KONAMI_INLINE void pshs(void); -KONAMI_INLINE void pshu(void); -KONAMI_INLINE void puls(void); -KONAMI_INLINE void pulu(void); -KONAMI_INLINE void rol_di(void); -KONAMI_INLINE void rol_ex(void); -KONAMI_INLINE void rol_ix(void); -KONAMI_INLINE void rola(void); -KONAMI_INLINE void rolb(void); -KONAMI_INLINE void ror_di(void); -KONAMI_INLINE void ror_ex(void); -KONAMI_INLINE void ror_ix(void); -KONAMI_INLINE void rora(void); -KONAMI_INLINE void rorb(void); -KONAMI_INLINE void rti(void); -KONAMI_INLINE void rts(void); -KONAMI_INLINE void sbca_di(void); -KONAMI_INLINE void sbca_ex(void); -KONAMI_INLINE void sbca_im(void); -KONAMI_INLINE void sbca_ix(void); -KONAMI_INLINE void sbcb_di(void); -KONAMI_INLINE void sbcb_ex(void); -KONAMI_INLINE void sbcb_im(void); -KONAMI_INLINE void sbcb_ix(void); -KONAMI_INLINE void sex(void); -KONAMI_INLINE void sta_di(void); -KONAMI_INLINE void sta_ex(void); -KONAMI_INLINE void sta_im(void); -KONAMI_INLINE void sta_ix(void); -KONAMI_INLINE void stb_di(void); -KONAMI_INLINE void stb_ex(void); -KONAMI_INLINE void stb_im(void); -KONAMI_INLINE void stb_ix(void); -KONAMI_INLINE void std_di(void); -KONAMI_INLINE void std_ex(void); -KONAMI_INLINE void std_im(void); -KONAMI_INLINE void std_ix(void); -KONAMI_INLINE void sts_di(void); -KONAMI_INLINE void sts_ex(void); -KONAMI_INLINE void sts_im(void); -KONAMI_INLINE void sts_ix(void); -KONAMI_INLINE void stu_di(void); -KONAMI_INLINE void stu_ex(void); -KONAMI_INLINE void stu_im(void); -KONAMI_INLINE void stu_ix(void); -KONAMI_INLINE void stx_di(void); -KONAMI_INLINE void stx_ex(void); -KONAMI_INLINE void stx_im(void); -KONAMI_INLINE void stx_ix(void); -KONAMI_INLINE void sty_di(void); -KONAMI_INLINE void sty_ex(void); -KONAMI_INLINE void sty_im(void); -KONAMI_INLINE void sty_ix(void); -KONAMI_INLINE void suba_di(void); -KONAMI_INLINE void suba_ex(void); -KONAMI_INLINE void suba_im(void); -KONAMI_INLINE void suba_ix(void); -KONAMI_INLINE void subb_di(void); -KONAMI_INLINE void subb_ex(void); -KONAMI_INLINE void subb_im(void); -KONAMI_INLINE void subb_ix(void); -KONAMI_INLINE void subd_di(void); -KONAMI_INLINE void subd_ex(void); -KONAMI_INLINE void subd_im(void); -KONAMI_INLINE void subd_ix(void); -KONAMI_INLINE void swi(void); -KONAMI_INLINE void swi2(void); -KONAMI_INLINE void swi3(void); -KONAMI_INLINE void sync(void); -KONAMI_INLINE void tfr(void); -KONAMI_INLINE void tst_di(void); -KONAMI_INLINE void tst_ex(void); -KONAMI_INLINE void tst_ix(void); -KONAMI_INLINE void tsta(void); -KONAMI_INLINE void tstb(void); - -KONAMI_INLINE void clrd(void); /* 6309 */ -KONAMI_INLINE void clrw_ix(void); /* 6309 ? */ -KONAMI_INLINE void clrw_di(void); /* 6309 ? */ -KONAMI_INLINE void clrw_ex(void); /* 6309 ? */ -KONAMI_INLINE void negd(void); -KONAMI_INLINE void negw_ix(void); /* 6309 ? */ -KONAMI_INLINE void negw_di(void); /* 6309 ? */ -KONAMI_INLINE void negw_ex(void); /* 6309 ? */ -KONAMI_INLINE void lsrd( void ); /* 6309 */ -KONAMI_INLINE void lsrd_di( void ); /* 6309 */ -KONAMI_INLINE void lsrd_ix( void ); /* 6309 */ -KONAMI_INLINE void lsrd_ex( void ); /* 6309 */ -KONAMI_INLINE void rord( void ); /* 6309 ? */ -KONAMI_INLINE void rord_di( void ); /* 6309 */ -KONAMI_INLINE void rord_ix( void ); /* 6309 */ -KONAMI_INLINE void rord_ex( void ); /* 6309 */ -KONAMI_INLINE void asrd( void ); /* 6309 ? */ -KONAMI_INLINE void asrd_di( void ); /* 6309 */ -KONAMI_INLINE void asrd_ix( void ); /* 6309 */ -KONAMI_INLINE void asrd_ex( void ); /* 6309 */ -KONAMI_INLINE void asld( void ); /* 6309 */ -KONAMI_INLINE void asld_di( void ); /* 6309 */ -KONAMI_INLINE void asld_ix( void ); /* 6309 */ -KONAMI_INLINE void asld_ex( void ); /* 6309 */ -KONAMI_INLINE void rold( void ); /* 6309 ? */ -KONAMI_INLINE void rold_di( void ); /* 6309 */ -KONAMI_INLINE void rold_ix( void ); /* 6309 */ -KONAMI_INLINE void rold_ex( void ); /* 6309 */ -KONAMI_INLINE void tstd(void); -KONAMI_INLINE void tstw_di( void ); -KONAMI_INLINE void tstw_ix( void ); -KONAMI_INLINE void tstw_ex( void ); - -/* Custom opcodes */ -KONAMI_INLINE void setline_im( void ); -KONAMI_INLINE void setline_ix( void ); -KONAMI_INLINE void setline_di( void ); -KONAMI_INLINE void setline_ex( void ); -KONAMI_INLINE void bmove( void ); -KONAMI_INLINE void move( void ); -KONAMI_INLINE void decbjnz( void ); -KONAMI_INLINE void decxjnz( void ); -KONAMI_INLINE void bset( void ); -KONAMI_INLINE void bset2( void ); -KONAMI_INLINE void lmul(void); -KONAMI_INLINE void divx( void ); -KONAMI_INLINE void incd( void ); -KONAMI_INLINE void incw_di( void ); -KONAMI_INLINE void incw_ix( void ); -KONAMI_INLINE void incw_ex( void ); -KONAMI_INLINE void decd( void ); -KONAMI_INLINE void decw_di( void ); -KONAMI_INLINE void decw_ix( void ); -KONAMI_INLINE void decw_ex( void ); -KONAMI_INLINE void lsrw_di( void ); -KONAMI_INLINE void lsrw_ix( void ); -KONAMI_INLINE void lsrw_ex( void ); -KONAMI_INLINE void rorw_di( void ); -KONAMI_INLINE void rorw_ix( void ); -KONAMI_INLINE void rorw_ex( void ); -KONAMI_INLINE void asrw_di( void ); -KONAMI_INLINE void asrw_ix( void ); -KONAMI_INLINE void asrw_ex( void ); -KONAMI_INLINE void aslw_di( void ); -KONAMI_INLINE void aslw_ix( void ); -KONAMI_INLINE void aslw_ex( void ); -KONAMI_INLINE void rolw_di( void ); -KONAMI_INLINE void rolw_ix( void ); -KONAMI_INLINE void rolw_ex( void ); -KONAMI_INLINE void absa( void ); -KONAMI_INLINE void absb( void ); -KONAMI_INLINE void absd( void ); - -KONAMI_INLINE void opcode2( void ); - -static void (*const konami_main[0x100])(void) = { - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 00 */ - opcode2,opcode2,opcode2,opcode2,pshs ,pshu ,puls ,pulu , - lda_im ,ldb_im ,opcode2,opcode2,adda_im,addb_im,opcode2,opcode2, /* 10 */ - adca_im,adcb_im,opcode2,opcode2,suba_im,subb_im,opcode2,opcode2, - sbca_im,sbcb_im,opcode2,opcode2,anda_im,andb_im,opcode2,opcode2, /* 20 */ - bita_im,bitb_im,opcode2,opcode2,eora_im,eorb_im,opcode2,opcode2, - ora_im ,orb_im ,opcode2,opcode2,cmpa_im,cmpb_im,opcode2,opcode2, /* 30 */ - setline_im,opcode2,opcode2,opcode2,andcc,orcc ,exg ,tfr , - ldd_im ,opcode2,ldx_im ,opcode2,ldy_im ,opcode2,ldu_im ,opcode2, /* 40 */ - lds_im ,opcode2,cmpd_im,opcode2,cmpx_im,opcode2,cmpy_im,opcode2, - cmpu_im,opcode2,cmps_im,opcode2,addd_im,opcode2,subd_im,opcode2, /* 50 */ - opcode2,opcode2,opcode2,opcode2,opcode2,illegal,illegal,illegal, - bra ,bhi ,bcc ,bne ,bvc ,bpl ,bge ,bgt , /* 60 */ - lbra ,lbhi ,lbcc ,lbne ,lbvc ,lbpl ,lbge ,lbgt , - brn ,bls ,bcs ,beq ,bvs ,bmi ,blt ,ble , /* 70 */ - lbrn ,lbls ,lbcs ,lbeq ,lbvs ,lbmi ,lblt ,lble , - clra ,clrb ,opcode2,coma ,comb ,opcode2,nega ,negb , /* 80 */ - opcode2,inca ,incb ,opcode2,deca ,decb ,opcode2,rts , - tsta ,tstb ,opcode2,lsra ,lsrb ,opcode2,rora ,rorb , /* 90 */ - opcode2,asra ,asrb ,opcode2,asla ,aslb ,opcode2,rti , - rola ,rolb ,opcode2,opcode2,opcode2,opcode2,opcode2,opcode2, /* a0 */ - opcode2,opcode2,bsr ,lbsr ,decbjnz,decxjnz,nop ,illegal, - abx ,daa ,sex ,mul ,lmul ,divx ,bmove ,move , /* b0 */ - lsrd ,opcode2,rord ,opcode2,asrd ,opcode2,asld ,opcode2, - rold ,opcode2,clrd ,opcode2,negd ,opcode2,incd ,opcode2, /* c0 */ - decd ,opcode2,tstd ,opcode2,absa ,absb ,absd ,bset , - bset2 ,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* d0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* e0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* f0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal -}; - -static void (*const konami_indexed[0x100])(void) = { - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 00 */ - leax ,leay ,leau ,leas ,illegal,illegal,illegal,illegal, - illegal,illegal,lda_ix ,ldb_ix ,illegal,illegal,adda_ix,addb_ix, /* 10 */ - illegal,illegal,adca_ix,adcb_ix,illegal,illegal,suba_ix,subb_ix, - illegal,illegal,sbca_ix,sbcb_ix,illegal,illegal,anda_ix,andb_ix, /* 20 */ - illegal,illegal,bita_ix,bitb_ix,illegal,illegal,eora_ix,eorb_ix, - illegal,illegal,ora_ix ,orb_ix ,illegal,illegal,cmpa_ix,cmpb_ix, /* 30 */ - illegal,setline_ix,sta_ix,stb_ix,illegal,illegal,illegal,illegal, - illegal,ldd_ix ,illegal,ldx_ix ,illegal,ldy_ix ,illegal,ldu_ix , /* 40 */ - illegal,lds_ix ,illegal,cmpd_ix,illegal,cmpx_ix,illegal,cmpy_ix, - illegal,cmpu_ix,illegal,cmps_ix,illegal,addd_ix,illegal,subd_ix, /* 50 */ - std_ix ,stx_ix ,sty_ix ,stu_ix ,sts_ix ,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 60 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 70 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,clr_ix ,illegal,illegal,com_ix ,illegal,illegal, /* 80 */ - neg_ix ,illegal,illegal,inc_ix ,illegal,illegal,dec_ix ,illegal, - illegal,illegal,tst_ix ,illegal,illegal,lsr_ix ,illegal,illegal, /* 90 */ - ror_ix ,illegal,illegal,asr_ix ,illegal,illegal,asl_ix ,illegal, - illegal,illegal,rol_ix ,lsrw_ix,rorw_ix,asrw_ix,aslw_ix,rolw_ix, /* a0 */ - jmp_ix ,jsr_ix ,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* b0 */ - illegal,lsrd_ix,illegal,rord_ix,illegal,asrd_ix,illegal,asld_ix, - illegal,rold_ix,illegal,clrw_ix,illegal,negw_ix,illegal,incw_ix, /* c0 */ - illegal,decw_ix,illegal,tstw_ix,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* d0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* e0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* f0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal -}; - -static void (*const konami_direct[0x100])(void) = { - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 00 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,lda_di ,ldb_di ,illegal,illegal,adda_di,addb_di, /* 10 */ - illegal,illegal,adca_di,adcb_di,illegal,illegal,suba_di,subb_di, - illegal,illegal,sbca_di,sbcb_di,illegal,illegal,anda_di,andb_di, /* 20 */ - illegal,illegal,bita_di,bitb_di,illegal,illegal,eora_di,eorb_di, - illegal,illegal,ora_di ,orb_di ,illegal,illegal,cmpa_di,cmpb_di, /* 30 */ - illegal,setline_di,sta_di,stb_di,illegal,illegal,illegal,illegal, - illegal,ldd_di ,illegal,ldx_di ,illegal,ldy_di ,illegal,ldu_di , /* 40 */ - illegal,lds_di ,illegal,cmpd_di,illegal,cmpx_di,illegal,cmpy_di, - illegal,cmpu_di,illegal,cmps_di,illegal,addd_di,illegal,subd_di, /* 50 */ - std_di ,stx_di ,sty_di ,stu_di ,sts_di ,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 60 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 70 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,clr_di ,illegal,illegal,com_di ,illegal,illegal, /* 80 */ - neg_di ,illegal,illegal,inc_di ,illegal,illegal,dec_di ,illegal, - illegal,illegal,tst_di ,illegal,illegal,lsr_di ,illegal,illegal, /* 90 */ - ror_di ,illegal,illegal,asr_di ,illegal,illegal,asl_di ,illegal, - illegal,illegal,rol_di ,lsrw_di,rorw_di,asrw_di,aslw_di,rolw_di, /* a0 */ - jmp_di ,jsr_di ,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* b0 */ - illegal,lsrd_di,illegal,rord_di,illegal,asrd_di,illegal,asld_di, - illegal,rold_di,illegal,clrw_di,illegal,negw_di,illegal,incw_di, /* c0 */ - illegal,decw_di,illegal,tstw_di,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* d0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* e0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* f0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal -}; - -static void (*const konami_extended[0x100])(void) = { - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 00 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,lda_ex ,ldb_ex ,illegal,illegal,adda_ex,addb_ex, /* 10 */ - illegal,illegal,adca_ex,adcb_ex,illegal,illegal,suba_ex,subb_ex, - illegal,illegal,sbca_ex,sbcb_ex,illegal,illegal,anda_ex,andb_ex, /* 20 */ - illegal,illegal,bita_ex,bitb_ex,illegal,illegal,eora_ex,eorb_ex, - illegal,illegal,ora_ex ,orb_ex ,illegal,illegal,cmpa_ex,cmpb_ex, /* 30 */ - illegal,setline_ex,sta_ex,stb_ex,illegal,illegal,illegal,illegal, - illegal,ldd_ex ,illegal,ldx_ex ,illegal,ldy_ex ,illegal,ldu_ex , /* 40 */ - illegal,lds_ex ,illegal,cmpd_ex,illegal,cmpx_ex,illegal,cmpy_ex, - illegal,cmpu_ex,illegal,cmps_ex,illegal,addd_ex,illegal,subd_ex, /* 50 */ - std_ex ,stx_ex ,sty_ex ,stu_ex ,sts_ex ,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 60 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 70 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,clr_ex ,illegal,illegal,com_ex ,illegal,illegal, /* 80 */ - neg_ex ,illegal,illegal,inc_ex ,illegal,illegal,dec_ex ,illegal, - illegal,illegal,tst_ex ,illegal,illegal,lsr_ex ,illegal,illegal, /* 90 */ - ror_ex ,illegal,illegal,asr_ex ,illegal,illegal,asl_ex ,illegal, - illegal,illegal,rol_ex ,lsrw_ex,rorw_ex,asrw_ex,aslw_ex,rolw_ex, /* a0 */ - jmp_ex ,jsr_ex ,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* b0 */ - illegal,lsrd_ex,illegal,rord_ex,illegal,asrd_ex,illegal,asld_ex, - illegal,rold_ex,illegal,clrw_ex,illegal,negw_ex,illegal,incw_ex, /* c0 */ - illegal,decw_ex,illegal,tstw_ex,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* d0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* e0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* f0 */ - illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal -}; diff --git a/jan/src/cpu/konami_intf.cpp b/jan/src/cpu/konami_intf.cpp deleted file mode 100644 index 4550a83e5..000000000 --- a/jan/src/cpu/konami_intf.cpp +++ /dev/null @@ -1,252 +0,0 @@ -#include "burnint.h" -#include "konami_intf.h" - -#define MAX_CPU 1 - -#define MEMORY_SPACE 0x10000 -#define PAGE_SIZE 0x100 -#define PAGE_MASK 0xff -#define PAGE_SHIFT 8 -#define PAGE_COUNT MEMORY_SPACE / PAGE_SIZE - -#define READ 0 -#define WRITE 1 -#define FETCH 2 - -INT32 nKonamiCpuCount = 0; -static INT32 nKonamiCpuActive = -1; - -static UINT8 *mem[3][PAGE_COUNT]; - -static UINT8 (*pkonamiRead)(UINT16 address); -static void (*pkonamiWrite)(UINT16 address, UINT8 data); - -static INT32 (*irqcallback)(INT32); - -void konami_set_irq_line(INT32 irqline, INT32 state); -void konami_init(INT32 (*irqcallback)(INT32)); -void konami_set_irq_hold(INT32 irq); - -void konamiMapMemory(UINT8 *src, UINT16 start, UINT16 finish, INT32 type) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiMapMemory called without init\n")); -#endif - - UINT16 len = (finish-start) >> PAGE_SHIFT; - - for (UINT16 i = 0; i < len+1; i++) - { - UINT32 offset = i + (start >> PAGE_SHIFT); - if (type & (1 << READ)) mem[ READ][offset] = src + (i << PAGE_SHIFT); - if (type & (1 << WRITE)) mem[WRITE][offset] = src + (i << PAGE_SHIFT); - if (type & (1 << FETCH)) mem[FETCH][offset] = src + (i << PAGE_SHIFT); - } -} - -INT32 konamiDummyIrqCallback(INT32) -{ - return 0; -} - -void konamiSetIrqCallbackHandler(INT32 (*callback)(INT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiSetIrqCallbackHandler called without init\n")); -#endif - - irqcallback = callback; -} - -void konamiSetWriteHandler(void (*write)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiSetWriteHandler called without init\n")); -#endif - - pkonamiWrite = write; -} - -void konamiSetReadHandler(UINT8 (*read)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiSetReadHandler called without init\n")); -#endif - - pkonamiRead = read; -} - -static void konami_write_rom(UINT32 address, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konami_write_rom called without init\n")); -#endif - - address &= 0xffff; - - if (mem[READ][address >> PAGE_SHIFT] != NULL) { - mem[READ][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - } - - if (mem[FETCH][address >> PAGE_SHIFT] != NULL) { - mem[FETCH][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - } - - if (mem[WRITE][address >> PAGE_SHIFT] != NULL) { - mem[WRITE][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - } - - if (pkonamiWrite != NULL) { - pkonamiWrite(address, data); - } -} - -void konamiWrite(UINT16 address, UINT8 data) -{ - if (mem[WRITE][address >> PAGE_SHIFT] != NULL) { - mem[WRITE][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - return; - } - - if (pkonamiWrite != NULL) { - pkonamiWrite(address, data); - return; - } - - return; -} - -UINT8 konamiRead(UINT16 address) -{ - if (mem[ READ][address >> PAGE_SHIFT] != NULL) { - return mem[ READ][address >> PAGE_SHIFT][address & PAGE_MASK]; - } - - if (pkonamiRead != NULL) { - return pkonamiRead(address); - } - - return 0; -} - -UINT8 konamiFetch(UINT16 address) -{ - if (mem[FETCH][address >> PAGE_SHIFT] != NULL) { - return mem[FETCH][address >> PAGE_SHIFT][address & PAGE_MASK]; - } - - if (pkonamiRead != NULL) { - return pkonamiRead(address); - } - - return 0; -} - -void konamiSetIrqLine(INT32 line, INT32 state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiSetIrqLine called without init\n")); -#endif - - if (state == CPU_IRQSTATUS_HOLD) { - konami_set_irq_line(line, CPU_IRQSTATUS_ACK); - konami_set_irq_hold(line); - } else - if (state == CPU_IRQSTATUS_AUTO) { - konami_set_irq_line(line, CPU_IRQSTATUS_ACK); - konamiRun(0); - konami_set_irq_line(line, CPU_IRQSTATUS_NONE); - } else { - konami_set_irq_line(line, state); - } -} - -void konamiRunEnd() -{ - // nothing atm -} - -static UINT8 konami_cheat_read(UINT32 a) -{ - return konamiRead(a); -} - -static cpu_core_config konamiCheatCpuConfig = -{ - konamiOpen, - konamiClose, - konami_cheat_read, - konami_write_rom, - konamiGetActive, - konamiTotalCycles, - konamiNewFrame, - konamiRun, - konamiRunEnd, - konamiReset, - 1<<16, - 0 -}; - -#if defined FBA_DEBUG -void konamiInit(INT32 nCpu) // only 1 cpu (No examples exist of multi-cpu konami games) -#else -void konamiInit(INT32 /*nCpu*/) // only 1 cpu (No examples exist of multi-cpu konami games) -#endif -{ - DebugCPU_KonamiInitted = 1; - -#if defined FBA_DEBUG - if (nCpu >= MAX_CPU) bprintf(PRINT_ERROR, _T("konamiInit nCpu is more than MAX_CPU (%d), MAX IS %d\n"), nCpu, MAX_CPU); -#endif - - nKonamiCpuCount = 1; - konami_init(konamiDummyIrqCallback); - - for (INT32 i = 0; i < 3; i++) { - for (INT32 j = 0; j < (MEMORY_SPACE / PAGE_SIZE); j++) { - mem[i][j] = NULL; - } - } - - CpuCheatRegister(0, &konamiCheatCpuConfig); -} - -void konamiExit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiExit called without init\n")); -#endif - - nKonamiCpuCount = 0; - pkonamiWrite = NULL; - pkonamiRead = NULL; - - DebugCPU_KonamiInitted = 0; -} - -void konamiOpen(INT32 num) -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiOpen called without init\n")); -#endif - - nKonamiCpuActive = num; -} - -void konamiClose() -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiClose called without init\n")); -#endif - - nKonamiCpuActive = -1; -} - -INT32 konamiGetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_KonamiInitted) bprintf(PRINT_ERROR, _T("konamiGetActive called without init\n")); -#endif - - return nKonamiCpuActive; -} diff --git a/jan/src/cpu/konami_intf.h b/jan/src/cpu/konami_intf.h deleted file mode 100644 index 063a6d054..000000000 --- a/jan/src/cpu/konami_intf.h +++ /dev/null @@ -1,33 +0,0 @@ -void konamiWrite(UINT16 address, UINT8 data); -UINT8 konamiRead(UINT16 address); -UINT8 konamiFetch(UINT16 address); - -void konamiMapMemory(UINT8 *src, UINT16 start, UINT16 finish, INT32 type); - -void konamiSetIrqCallbackHandler(INT32 (*callback)(INT32)); -void konamiSetlinesCallback(void (*setlines_callback)(INT32 lines)); - -void konamiSetWriteHandler(void (*write)(UINT16, UINT8)); -void konamiSetReadHandler(UINT8 (*read)(UINT16)); - -void konamiInit(INT32 nCpu); -void konamiOpen(INT32 ); -void konamiReset(); -INT32 konamiRun(INT32 cycles); -void konamiClose(); -void konamiExit(); - -extern INT32 nKonamiCpuCount; - -#define KONAMI_IRQ_LINE 0 -#define KONAMI_FIRQ_LINE 1 -#define KONAMI_INPUT_LINE_NMI 0x20 - -void konamiSetIrqLine(INT32 line, INT32 state); - -INT32 konamiCpuScan(INT32 nAction); - -INT32 konamiTotalCycles(); -void konamiNewFrame(); - -INT32 konamiGetActive(); diff --git a/jan/src/cpu/m6502/ill02.h b/jan/src/cpu/m6502/ill02.h deleted file mode 100644 index 86ecee8fc..000000000 --- a/jan/src/cpu/m6502/ill02.h +++ /dev/null @@ -1,335 +0,0 @@ -#pragma once - -#ifndef __ILL02_H__ -#define __ILL02_H__ - -/***************************************************************************** - * - * ill02.h - * Addressing mode and opcode macros for the NMOS 6502 illegal opcodes - * - * Copyright Juergen Buchmueller, all rights reserved. - * 65sc02 core Copyright Peter Trauner, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * pullmoll@t-online.de - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - *****************************************************************************/ - -/* test with the excellent C64 Emulator test suite - ? at www.funet.fi/pub/cbm/documents/chipdata/tsuit215.zip - good reference in the vice emulator (source) distribution doc/64doc.txt - - $ab=OAL like in 6502-NMOS.extra.opcodes, vice so in vice (lxa) -*/ - -/*************************************************************** - *************************************************************** - * Macros to emulate the 6510 opcodes - *************************************************************** - ***************************************************************/ - -/* 6510 ******************************************************** - * ANC logical and, set carry from bit of A - ***************************************************************/ -#define ANC \ - P &= ~F_C; \ - A = (UINT8)(A & tmp); \ - if (A & 0x80) \ - P |= F_C; \ - SET_NZ(A) - -/* 6510 ******************************************************** - * ASR logical and, logical shift right - ***************************************************************/ -#define ASR \ - tmp &= A; \ - LSR - -/* 6510 ******************************************************** - * AST and stack; transfer to accumulator and index X - * logical and stack (LSB) with data, transfer result to S - * transfer result to accumulator and index X also - ***************************************************************/ -#define AST \ - S &= tmp; \ - A = X = S; \ - SET_NZ(A) - -/* 6510 ******************************************************** - * ARR logical and, rotate right - ***************************************************************/ -#define ARR \ - if( P & F_D ) \ - { \ - int lo, hi, t; \ - tmp &= A; \ - t = tmp; \ - hi = tmp &0xf0; \ - lo = tmp &0x0f; \ - if( P & F_C ) \ - { \ - tmp = (tmp >> 1) | 0x80; \ - P |= F_N; \ - } \ - else \ - { \ - tmp >>= 1; \ - P &= ~F_N; \ - } \ - if( tmp ) \ - P &= ~F_Z; \ - else \ - P |= F_Z; \ - if( (t^tmp) & 0x40 ) \ - P|=F_V; \ - else \ - P &= ~F_V; \ - if( lo + (lo & 0x01) > 0x05 ) \ - tmp = (tmp & 0xf0) | ((tmp+6) & 0xf); \ - if( hi + (hi & 0x10) > 0x50 ) \ - { \ - P |= F_C; \ - tmp = (tmp+0x60) & 0xff; \ - } \ - else \ - P &= ~F_C; \ - } \ - else \ - { \ - tmp &= A; \ - ROR; \ - P &=~(F_V|F_C); \ - if( tmp & 0x40 ) \ - P|=F_C; \ - if( (tmp & 0x60) == 0x20 || (tmp & 0x60) == 0x40 ) \ - P|=F_V; \ - } - -/* 6510 ******************************************************** - * ASX logical and X w/ A, subtract data from X - ***************************************************************/ -#define ASX \ - P &= ~F_C; \ - X &= A; \ - if (X >= tmp) \ - P |= F_C; \ - X = (UINT8)(X - tmp); \ - SET_NZ(X) - -/* 6510 ******************************************************** - * AXA transfer index X to accumulator, logical and - * depends on the data of the dma device (videochip) fetched - * between opcode read and operand read - ***************************************************************/ -#define AXA \ - A = (UINT8)( (A|0xee)& X & tmp); \ - SET_NZ(A) - -/* 6510 ******************************************************** - * DCP decrement data and compare - ***************************************************************/ -#define DCP \ - tmp = (UINT8)(tmp-1); \ - P &= ~F_C; \ - if (A >= tmp) \ - P |= F_C; \ - SET_NZ((UINT8)(A - tmp)) - -/* 6502 ******************************************************** - * DOP double no operation - ***************************************************************/ -#define DOP \ - RDOPARG() - -/* 6510 ******************************************************** - * ISB increment and subtract with carry - ***************************************************************/ -#define ISB \ - tmp = (UINT8)(tmp+1); \ - SBC - -/* 6510 ******************************************************** - * LAX load accumulator and index X - ***************************************************************/ -#define LAX \ - A = X = (UINT8)tmp; \ - SET_NZ(A) - -/* 6510 ******************************************************** - * OAL load accumulator and index X - ***************************************************************/ -#define OAL \ - A = X = (UINT8)((A|0xee)&tmp); \ - SET_NZ(A) - -/* 6510 ******************************************************** - * RLA rotate left and logical and accumulator - * new C <- [7][6][5][4][3][2][1][0] <- C - ***************************************************************/ -#define RLA \ - tmp = (tmp << 1) | (P & F_C); \ - P = (P & ~F_C) | ((tmp >> 8) & F_C); \ - tmp = (UINT8)tmp; \ - A &= tmp; \ - SET_NZ(A) - -/* 6510 ******************************************************** - * RRA rotate right and add with carry - * C -> [7][6][5][4][3][2][1][0] -> C - ***************************************************************/ -#define RRA \ - tmp |= (P & F_C) << 8; \ - P = (P & ~F_C) | (tmp & F_C); \ - tmp = (UINT8)(tmp >> 1); \ - ADC - -/* 6510 ******************************************************** - * SAX logical and accumulator with index X and store - ***************************************************************/ -#define SAX \ - tmp = A & X - -/* 6510 ******************************************************** - * SLO shift left and logical or - ***************************************************************/ -#define SLO \ - P = (P & ~F_C) | ((tmp >> 7) & F_C); \ - tmp = (UINT8)(tmp << 1); \ - A |= tmp; \ - SET_NZ(A) - -/* 6510 ******************************************************** - * SRE logical shift right and logical exclusive or - * 0 -> [7][6][5][4][3][2][1][0] -> C - ***************************************************************/ -#define SRE \ - P = (P & ~F_C) | (tmp & F_C); \ - tmp = (UINT8)tmp >> 1; \ - A ^= tmp; \ - SET_NZ(A) - -/* 6510 ******************************************************** - * SAH store accumulator and index X and high + 1 - * result = accumulator and index X and memory [PC+1] + 1 - ***************************************************************/ -#define SAH tmp = A & X & (EAH+1) - -/* 6510 ******************************************************** - * SSH store stack high - * logical and accumulator with index X, transfer result to S - * logical and result with memory [PC+1] + 1 - ***************************************************************/ -#define SSH \ - S = A & X; \ - tmp = S & (EAH+1) -#if 0 -#define SSH \ - tmp = S = A & X; \ - tmp &= (UINT8)(cpu_readop_arg((PCW + 1) & 0xffff) + 1) -#endif - -/* 6510 ******************************************************** - * SXH store index X high - * logical and index X with memory[PC+1] and store the result - ***************************************************************/ -#define SXH tmp = X & (EAH+1) - -/* 6510 ******************************************************** - * SYH store index Y and (high + 1) - * logical and index Y with memory[PC+1] + 1 and store the result - ***************************************************************/ -#define SYH tmp = Y & (EAH+1) - -/* 6510 ******************************************************** - * TOP triple no operation - ***************************************************************/ -#define TOP \ - PCW+=2 - -/* 6510 ******************************************************** - * KIL Illegal opcode - * processor halted: no hardware interrupt will help, - * only reset - ***************************************************************/ -#define KIL \ - PCW--; \ - -/* N2A03 ******************************************************* - * ARR logical and, rotate right - no decimal mode - ***************************************************************/ -#define ARR_NES \ - { \ - tmp &= A; \ - ROR; \ - P &=~(F_V|F_C); \ - if( tmp & 0x40 ) \ - P|=F_C; \ - if( (tmp & 0x60) == 0x20 || (tmp & 0x60) == 0x40 ) \ - P|=F_V; \ - } - -/* N2A03 ******************************************************* - * ISB increment and subtract with carry - ***************************************************************/ -#define ISB_NES \ - tmp = (UINT8)(tmp+1); \ - SBC_NES - -/* N2A03 ******************************************************* - * RRA rotate right and add with carry - * C -> [7][6][5][4][3][2][1][0] -> C - ***************************************************************/ -#define RRA_NES \ - tmp |= (P & F_C) << 8; \ - P = (P & ~F_C) | (tmp & F_C); \ - tmp = (UINT8)(tmp >> 1); \ - ADC_NES - -/* N2A03 ******************************************************* - * OAL load accumulator and index X - ***************************************************************/ -#define OAL_NES \ - A = X = (UINT8)((A|0xff)&tmp); \ - SET_NZ(A) - -/* N2A03 ******************************************************* - * SXH store index X high - * logical and index X with memory[PC+1] and store the result - * - * This instruction writes to an odd address when crossing - * a page boundary. The one known test case can be explained - * with a shift of Y. More testing will be needed to determine - * if this is correct. - * - ***************************************************************/ -#define SXH_NES \ - if ( Y && Y > EAL ) \ - EAH |= ( Y << 1 ); \ - tmp = X & (EAH+1) - -/* N2A03 ******************************************************* - * SYH store index Y and (high + 1) - * logical and index Y with memory[PC+1] + 1 and store the result - * - * This instruction writs to an odd address when crossing a - * a page boundary. The one known test case can be explained - * with a shoft of X. More testing will be needed to determine - * if this is correct. - * - ***************************************************************/ -#define SYH_NES \ - if ( X && X > EAL ) \ - EAH |= ( X << 1 ); \ - tmp = Y & (EAH+1) - -#endif /* __ILL02_H__ */ diff --git a/jan/src/cpu/m6502/m6502.cpp b/jan/src/cpu/m6502/m6502.cpp deleted file mode 100644 index cdcb6f906..000000000 --- a/jan/src/cpu/m6502/m6502.cpp +++ /dev/null @@ -1,1121 +0,0 @@ -/***************************************************************************** - * - * m6502.c - * Portable 6502/65c02/65sc02/6510/n2a03 emulator V1.2 - * - * Copyright Juergen Buchmueller, all rights reserved. - * 65sc02 core Copyright Peter Trauner. - * Deco16 portions Copyright Bryan McPhail. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * pullmoll@t-online.de - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - *****************************************************************************/ -/* 2.February 2000 PeT added 65sc02 subtype */ -/* 10.March 2000 PeT added 6502 set overflow input line */ -/* 13.September 2000 PeT N2A03 jmp indirect */ - -#include "burnint.h" -#include "m6502.h" - -#define M6502_INLINE - -#if ((HAS_M65SC02 || HAS_DECO16) && !HAS_M65C02) -#undef HAS_M65C02 -#define HAS_M65C02 1 -#endif - -#define change_pc(newpc) m6502.pc.d = (newpc) - -void (*const *insnActive)(void); - - -typedef UINT8 (*deco_function)(UINT16 address, UINT8 opcode); - -static INT32 Cpu7Written[8]; -static deco_function Cpu7Write[8] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - -extern INT32 M6502GetActive(); - -#include "ops02.h" -#include "ill02.h" - - -#define M6502_NMI_VEC 0xfffa -#define M6502_RST_VEC 0xfffc -#define M6502_IRQ_VEC 0xfffe - -#define DECO16_RST_VEC 0xfff0 -#define DECO16_IRQ_VEC 0xfff2 -#define DECO16_NMI_VEC 0xfff4 - -#define VERBOSE 0 - -#define LOG(x) do { if (VERBOSE) logerror x; } while (0) - -/**************************************************************************** - * The 6502 registers. - ****************************************************************************/ - - static int m6502_IntOccured = 0; -static int m6502_ICount = 0; - -static m6502_Regs m6502; - -void DecoCpu7SetDecode(UINT8 (*write)(UINT16,UINT8)) -{ - Cpu7Write[M6502GetActive()] = write; -} - - -//static READ8_HANDLER( default_rdmem_id ) { return program_read_byte_8le(offset); } -//static WRITE8_HANDLER( default_wdmem_id ) { program_write_byte_8le(offset, data); } - -/*************************************************************** - * include the opcode macros, functions and tables - ***************************************************************/ -#include "t6502.c" - -#if (HAS_M6510) -//#include "t6510.c" -#define insn6510 insn6502 -#endif - -#include "opsn2a03.h" - -#if (HAS_N2A03) -#include "tn2a03.c" -#endif - -#include "opsc02.h" - -#if (HAS_M65C02) -#include "t65c02.c" -#endif - -#if (HAS_M65SC02) -#include "t65sc02.c" -#endif - -#if (HAS_DECO16) -#include "tdeco16.c" -#endif - -/***************************************************************************** - * - * 6502 CPU interface functions - * - *****************************************************************************/ - -void m6502_core_exit() -{ - for (INT32 i = 0; i < 8; i++) { - Cpu7Write[i] = NULL; - } -} - -static void m6502_common_init(UINT8 subtype, void (*const *insn)(void)/*, const char *type*/) -{ - memset(&m6502, 0, sizeof(m6502)); -// m6502.irq_callback = irqcallback; - m6502.subtype = subtype; - //m6502.insn = insn; - insnActive = insn; -// m6502.rdmem_id = default_rdmem_id; -// m6502.wrmem_id = default_wdmem_id; - -// state_save_register_item(type, index, m6502.pc.w.l); -// state_save_register_item(type, index, m6502.sp.w.l); -// state_save_register_item(type, index, m6502.p); -// state_save_register_item(type, index, m6502.a); -// state_save_register_item(type, index, m6502.x); -// state_save_register_item(type, index, m6502.y); -// state_save_register_item(type, index, m6502.pending_irq); -// state_save_register_item(type, index, m6502.after_cli); -// state_save_register_item(type, index, m6502.nmi_state); -// state_save_register_item(type, index, m6502.irq_state); -// state_save_register_item(type, index, m6502.so_state); - -#if (HAS_M6510) || (HAS_M6510T) || (HAS_M8502) || (HAS_M7501) - if (subtype == SUBTYPE_6510) - { -// state_save_register_item(type, index, m6502.port); -// state_save_register_item(type, index, m6502.ddr); - } -#endif -} - -void m6502_init() -{ - m6502_common_init(SUBTYPE_6502, insn6502/*, "m6502"*/); -} - -void m6502_reset(void) -{ - /* wipe out the rest of the m6502 structure */ - /* read the reset vector into PC */ - PCL = RDMEM(M6502_RST_VEC); - PCH = RDMEM(M6502_RST_VEC+1); - - m6502.sp.d = 0x01ff; /* stack pointer starts at page 1 offset FF */ - m6502.p = F_T|F_I|F_Z|F_B|(P&F_D); /* set T, I and Z flags */ - m6502.pending_irq = 0; /* nonzero if an IRQ is pending */ - m6502.after_cli = 0; /* pending IRQ and last insn cleared I */ - m6502.irq_state = 0; - m6502.nmi_state = 0; - Cpu7Written[M6502GetActive()] = 0; - - change_pc(PCD); -} - -void m6502_exit(void) -{ - /* nothing to do yet */ -} - -void m6502_get_context (void *dst) -{ - if( dst ) - *(m6502_Regs*)dst = m6502; -} - -void m6502_set_context (void *src) -{ - if( src ) - { - m6502 = *(m6502_Regs*)src; - if (m6502.subtype == SUBTYPE_6502) insnActive = insn6502; - if (m6502.subtype == SUBTYPE_65C02) insnActive = insn65c02; - if (m6502.subtype == SUBTYPE_2A03) insnActive = insn2a03; - if (m6502.subtype == SUBTYPE_65SC02)insnActive = insn65sc02; - if (m6502.subtype == SUBTYPE_DECO16)insnActive = insndeco16; - if (m6502.subtype == SUBTYPE_6510) insnActive = insn6510; - change_pc(PCD); - } -} - -void m6502_set_irq_hold() -{ - m6502.hold_irq = 1; -} - -M6502_INLINE void m6502_take_irq(void) -{ - if( !(P & F_I) ) - { - EAD = M6502_IRQ_VEC; - m6502_ICount -= 2; - PUSH(PCH); - PUSH(PCL); - PUSH(P & ~F_B); - P |= F_I; /* set I flag */ - PCL = RDMEM(EAD); - PCH = RDMEM(EAD+1); -// LOG(("M6502#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); - /* call back the cpuintrf to let it clear the line */ - - if (m6502.hold_irq) { - m6502.hold_irq = 0; - m6502.irq_state = M6502_CLEAR_LINE; - } - - if (m6502.irq_callback) (*m6502.irq_callback)(0); - change_pc(PCD); - - Cpu7Written[M6502GetActive()] = 0; - } - m6502.pending_irq = 0; -} - -int m6502_releaseslice() -{ - m6502_ICount = 0; - - return 0; -} - -int m6502_execute(int cycles) -{ - m6502_ICount = cycles; - - change_pc(PCD); - - do - { - UINT8 op; - PPC = PCD; - -// debugger_instruction_hook(Machine, PCD); - - /* if an irq is pending, take it now */ - if( m6502.pending_irq ) - m6502_take_irq(); - - op = RDOP(); - - //(*m6502.insn[op])(); - (*insnActive[op])(); - - /* check if the I flag was just reset (interrupts enabled) */ - if( m6502.after_cli ) - { -// LOG(("M6502#%d after_cli was >0", cpu_getactivecpu())); - m6502.after_cli = 0; - if (m6502.irq_state != M6502_CLEAR_LINE) - { -// LOG((": irq line is asserted: set pending IRQ\n")); - m6502.pending_irq = 1; - } - else - { -// LOG((": irq line is clear\n")); - } - } - else { - if ( m6502.pending_irq == 2 ) { - if ( m6502_IntOccured - m6502_ICount > 1 ) { - m6502.pending_irq = 1; - } - } - if( m6502.pending_irq == 1 ) - m6502_take_irq(); - if ( m6502.pending_irq == 2 ) { - m6502.pending_irq = 1; - } - } - - } while (m6502_ICount > 0); - - return cycles - m6502_ICount; -} - -int decocpu7_execute(int cycles) -{ - m6502_ICount = cycles; - - change_pc(PCD); - - do - { - UINT8 op; - PPC = PCD; - -// debugger_instruction_hook(Machine, PCD); - - /* if an irq is pending, take it now */ - if( m6502.pending_irq ) - m6502_take_irq(); - - op = RDOP(); - - if (Cpu7Written[M6502GetActive()]) { - if ((PPC & 0x0104) == 0x0104) { - op = Cpu7Write[M6502GetActive()](PPC,op); - } - Cpu7Written[M6502GetActive()] = 0; - } - - //(*m6502.insn[op])(); - (*insnActive[op])(); - - /* check if the I flag was just reset (interrupts enabled) */ - if( m6502.after_cli ) - { -// LOG(("M6502#%d after_cli was >0", cpu_getactivecpu())); - m6502.after_cli = 0; - if (m6502.irq_state != M6502_CLEAR_LINE) - { -// LOG((": irq line is asserted: set pending IRQ\n")); - m6502.pending_irq = 1; - } - else - { -// LOG((": irq line is clear\n")); - } - } - else { - if ( m6502.pending_irq == 2 ) { - if ( m6502_IntOccured - m6502_ICount > 1 ) { - m6502.pending_irq = 1; - } - } - if( m6502.pending_irq == 1 ) - m6502_take_irq(); - if ( m6502.pending_irq == 2 ) { - m6502.pending_irq = 1; - } - } - - } while (m6502_ICount > 0); - - return cycles - m6502_ICount; -} - -void m6502_set_irq_line(int irqline, int state) -{ - if (irqline == M6502_INPUT_LINE_NMI) - { - if (m6502.nmi_state == state) return; - m6502.nmi_state = state; - if( state != M6502_CLEAR_LINE ) - { -// LOG(( "M6502#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); - EAD = M6502_NMI_VEC; - m6502_ICount -= 2; - PUSH(PCH); - PUSH(PCL); - PUSH(P & ~F_B); - P |= F_I; /* set I flag */ - PCL = RDMEM(EAD); - PCH = RDMEM(EAD+1); -// LOG(("M6502#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); - change_pc(PCD); - } - } - else - { - if( irqline == M6502_SET_OVERFLOW ) - { - if( m6502.so_state && !state ) - { -// LOG(( "M6502#%d set overflow\n", cpu_getactivecpu())); - P|=F_V; - } - m6502.so_state=state; - return; - } - m6502.irq_state = state; - if( state != M6502_CLEAR_LINE ) - { -// LOG(( "M6502#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); - m6502.pending_irq = 1; -// m6502.pending_irq = 2; - m6502_IntOccured = m6502_ICount; - } - } -} - -UINT32 m6502_get_pc() -{ - return m6502.pc.d; -} - -UINT32 m6502_get_prev_pc() -{ - return m6502.ppc.d; -} - -/**************************************************************************** - * 2A03 section - ****************************************************************************/ -#if (HAS_N2A03) - -void n2a03_init() -{ - m6502_common_init(SUBTYPE_2A03, insn2a03); -} - -/* The N2A03 is integrally tied to its PSG (they're on the same die). - Bit 7 of address $4011 (the PSG's DPCM control register), when set, - causes an IRQ to be generated. This function allows the IRQ to be called - from the PSG core when such an occasion arises. */ -void n2a03_irq(void) -{ - m6502_take_irq(); -} - - -/**************************************************************************** - * 6510 section - ****************************************************************************/ -#if (HAS_M6510) - -void m6510_init () -{ - m6502_common_init(SUBTYPE_6510, insn6510); -} - -void m6510_reset(void) -{ - m6502_reset(); - m6502.port = 0xff; - m6502.ddr = 0x00; -} - -//static UINT8 m6510_get_port(void) -//{ -// return (m6502.port & m6502.ddr) | (m6502.ddr ^ 0xff); -//} - -unsigned char m6510_read_0000(unsigned short address) -{ - UINT8 result = 0x00; - - switch (address) - { - case 0x0000: /* DDR */ - result = m6502.ddr; - break; - case 0x0001: /* Data Port */ - if (m6502.port_read) - result = M6502ReadPort( m6502.ddr ); - result = (m6502.ddr & m6502.port) | (~m6502.ddr & result); - break; - } - return result; -} - -void m6510_write_0000(unsigned short address, unsigned char data) -{ - switch (address) - { - case 0x0000: /* DDR */ - m6502.ddr = data; - break; - case 0x0001: /* Data Port */ - m6502.port = data; - break; - } - - M6502WritePort( m6502.ddr, m6502.port & m6502.ddr ); -} - -//static ADDRESS_MAP_START(m6510_mem, ADDRESS_SPACE_PROGRAM, 8) -// AM_RANGE(0x0000, 0x0001) AM_READWRITE(m6510_read_0000, m6510_write_0000) -//ADDRESS_MAP_END - -#endif - -#endif - -/**************************************************************************** - * 65C02 section - ****************************************************************************/ -#if (HAS_M65C02) - -void m65c02_init() -{ - m6502_common_init(SUBTYPE_65C02, insn65c02); -} - -void m65c02_reset() -{ - m6502_reset(); - P &=~F_D; -} - -M6502_INLINE void m65c02_take_irq(void) -{ - if( !(P & F_I) ) - { - EAD = M6502_IRQ_VEC; - m6502_ICount -= 2; - PUSH(PCH); - PUSH(PCL); - PUSH(P & ~F_B); - P = (P & ~F_D) | F_I; /* knock out D and set I flag */ - PCL = RDMEM(EAD); - PCH = RDMEM(EAD+1); - //LOG(("M65c02#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); - /* call back the cpuintrf to let it clear the line */ - if (m6502.irq_callback) (*m6502.irq_callback)(0); - - if (m6502.hold_irq) { - m6502.hold_irq = 0; - m6502.irq_state = M6502_CLEAR_LINE; - } - - change_pc(PCD); - } - m6502.pending_irq = 0; -} - -int m65c02_execute(int cycles) -{ - m6502_ICount = cycles; - - change_pc(PCD); - - do - { - UINT8 op; - PPC = PCD; - - //debugger_instruction_hook(Machine, PCD); - - op = RDOP(); - - //(*m6502.insn[op])(); - (*insnActive[op])(); - - /* if an irq is pending, take it now */ - if( m6502.pending_irq ) - m65c02_take_irq(); - - - /* check if the I flag was just reset (interrupts enabled) */ - if( m6502.after_cli ) - { - //LOG(("M6502#%d after_cli was >0", cpu_getactivecpu())); - m6502.after_cli = 0; - if (m6502.irq_state != M6502_CLEAR_LINE) - { - // LOG((": irq line is asserted: set pending IRQ\n")); - m6502.pending_irq = 1; - } - //else - //{ - // LOG((": irq line is clear\n")); - //} - } - else - if( m6502.pending_irq ) - m65c02_take_irq(); - - } while (m6502_ICount > 0); - - return cycles - m6502_ICount; -} - -void m65c02_set_irq_line(int irqline, int state) -{ - if (irqline == M6502_INPUT_LINE_NMI) - { - if (m6502.nmi_state == state) return; - m6502.nmi_state = state; - if( state != M6502_CLEAR_LINE ) - { - // LOG(( "M6502#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); - EAD = M6502_NMI_VEC; - m6502_ICount -= 2; - PUSH(PCH); - PUSH(PCL); - PUSH(P & ~F_B); - P = (P & ~F_D) | F_I; /* knock out D and set I flag */ - PCL = RDMEM(EAD); - PCH = RDMEM(EAD+1); - // LOG(("M6502#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); - change_pc(PCD); - } - } - else - m6502_set_irq_line(irqline,state); -} -#endif - -/**************************************************************************** - * 65SC02 section - ****************************************************************************/ -#if (HAS_M65SC02) -void m65sc02_init() -{ - m6502_common_init(SUBTYPE_65SC02, insn65sc02); -} -#endif - -/**************************************************************************** - * DECO16 section - ****************************************************************************/ -#if (HAS_DECO16) - -void deco16_init() -{ - m6502_common_init(SUBTYPE_DECO16, insndeco16); -} - - -void deco16_reset (void) -{ - m6502_reset(); - m6502.subtype = SUBTYPE_DECO16; - insnActive = insndeco16; - - PCL = RDMEM(DECO16_RST_VEC+1); - PCH = RDMEM(DECO16_RST_VEC); - - m6502.sp.d = 0x01ff; /* stack pointer starts at page 1 offset FF */ - m6502.p = F_T|F_I|F_Z|F_B|(P&F_D); /* set T, I and Z flags */ - m6502.pending_irq = 0; /* nonzero if an IRQ is pending */ - m6502.after_cli = 0; /* pending IRQ and last insn cleared I */ - - change_pc(PCD); -} - -M6502_INLINE void deco16_take_irq(void) -{ - if( !(P & F_I) ) - { - EAD = DECO16_IRQ_VEC; - m6502_ICount -= 2; - PUSH(PCH); - PUSH(PCL); - PUSH(P & ~F_B); - P |= F_I; /* set I flag */ - PCL = RDMEM(EAD+1); - PCH = RDMEM(EAD); - //LOG(("M6502#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); - /* call back the cpuintrf to let it clear the line */ - if (m6502.irq_callback) (*m6502.irq_callback)(0); - - if (m6502.hold_irq) { - m6502.hold_irq = 0; - m6502.irq_state = M6502_CLEAR_LINE; - } - - change_pc(PCD); - } - m6502.pending_irq = 0; -} - -void deco16_set_irq_line(int irqline, int state) -{ - if (irqline == M6502_INPUT_LINE_NMI) - { - if (m6502.nmi_state == state) return; - m6502.nmi_state = state; - if( state != M6502_CLEAR_LINE ) - { - //LOG(( "M6502#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); - EAD = DECO16_NMI_VEC; - m6502_ICount -= 7; - PUSH(PCH); - PUSH(PCL); - PUSH(P & ~F_B); - P |= F_I; /* set I flag */ - PCL = RDMEM(EAD+1); - PCH = RDMEM(EAD); - //LOG(("M6502#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); - change_pc(PCD); - } - } - else - { - if( irqline == M6502_SET_OVERFLOW ) - { - if( m6502.so_state && !state ) - { - // LOG(( "M6502#%d set overflow\n", cpu_getactivecpu())); - P|=F_V; - } - m6502.so_state=state; - return; - } - m6502.irq_state = state; - if( state != M6502_CLEAR_LINE ) - { - //LOG(( "M6502#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); - m6502.pending_irq = 1; - } - } -} - -int deco16_execute(int cycles) -{ - m6502_ICount = cycles; - - change_pc(PCD); - - do - { - UINT8 op; - PPC = PCD; - - //debugger_instruction_hook(Machine, PCD); - - op = RDOP(); - //(*m6502.insn[op])(); - (*insnActive[op])(); - - /* if an irq is pending, take it now */ - if( m6502.pending_irq ) - deco16_take_irq(); - - - /* check if the I flag was just reset (interrupts enabled) */ - if( m6502.after_cli ) - { - //LOG(("M6502#%d after_cli was >0", cpu_getactivecpu())); - m6502.after_cli = 0; - if (m6502.irq_state != M6502_CLEAR_LINE) - { - // LOG((": irq line is asserted: set pending IRQ\n")); - m6502.pending_irq = 1; - } - //else - //{ - // LOG((": irq line is clear\n")); - //} - } - else - if( m6502.pending_irq ) - deco16_take_irq(); - - } while (m6502_ICount > 0); - - return cycles - m6502_ICount; -} - -#endif - - -#if 0 - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static void m6502_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + M6502_IRQ_LINE: m6502_set_irq_line(M6502_IRQ_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + M6502_SET_OVERFLOW: m6502_set_irq_line(M6502_SET_OVERFLOW, info->i); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: m6502_set_irq_line(INPUT_LINE_NMI, info->i); break; - - case CPUINFO_INT_PC: PCW = info->i; change_pc(PCD); break; - case CPUINFO_INT_REGISTER + M6502_PC: m6502.pc.w.l = info->i; break; - case CPUINFO_INT_SP: S = info->i; break; - case CPUINFO_INT_REGISTER + M6502_S: m6502.sp.b.l = info->i; break; - case CPUINFO_INT_REGISTER + M6502_P: m6502.p = info->i; break; - case CPUINFO_INT_REGISTER + M6502_A: m6502.a = info->i; break; - case CPUINFO_INT_REGISTER + M6502_X: m6502.x = info->i; break; - case CPUINFO_INT_REGISTER + M6502_Y: m6502.y = info->i; break; - case CPUINFO_INT_REGISTER + M6502_EA: m6502.ea.w.l = info->i; break; - case CPUINFO_INT_REGISTER + M6502_ZP: m6502.zp.w.l = info->i; break; - - /* --- the following bits of info are set as pointers to data or functions --- */ - case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: m6502.rdmem_id = (read8_machine_func) info->f; break; - case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: m6502.wrmem_id = (write8_machine_func) info->f; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void m6502_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(m6502); break; - case CPUINFO_INT_INPUT_LINES: info->i = 2; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 10; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + M6502_IRQ_LINE: info->i = m6502.irq_state; break; - case CPUINFO_INT_INPUT_STATE + M6502_SET_OVERFLOW: info->i = m6502.so_state; break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = m6502.nmi_state; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = m6502.ppc.w.l; break; - - case CPUINFO_INT_PC: info->i = PCD; break; - case CPUINFO_INT_REGISTER + M6502_PC: info->i = m6502.pc.w.l; break; - case CPUINFO_INT_SP: info->i = S; break; - case CPUINFO_INT_REGISTER + M6502_S: info->i = m6502.sp.b.l; break; - case CPUINFO_INT_REGISTER + M6502_P: info->i = m6502.p; break; - case CPUINFO_INT_REGISTER + M6502_A: info->i = m6502.a; break; - case CPUINFO_INT_REGISTER + M6502_X: info->i = m6502.x; break; - case CPUINFO_INT_REGISTER + M6502_Y: info->i = m6502.y; break; - case CPUINFO_INT_REGISTER + M6502_EA: info->i = m6502.ea.w.l; break; - case CPUINFO_INT_REGISTER + M6502_ZP: info->i = m6502.zp.w.l; break; - case CPUINFO_INT_REGISTER + M6502_SUBTYPE: info->i = m6502.subtype; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = m6502_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = m6502_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = m6502_set_context; break; - case CPUINFO_PTR_INIT: info->init = m6502_init; break; - case CPUINFO_PTR_RESET: info->reset = m6502_reset; break; - case CPUINFO_PTR_EXIT: info->exit = m6502_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = m6502_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m6502_dasm; break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &m6502_ICount; break; - case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: info->f = (genf *) m6502.rdmem_id; break; - case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: info->f = (genf *) m6502.wrmem_id; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6502"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Mostek 6502"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.2"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c%c%c%c%c%c%c%c", - m6502.p & 0x80 ? 'N':'.', - m6502.p & 0x40 ? 'V':'.', - m6502.p & 0x20 ? 'R':'.', - m6502.p & 0x10 ? 'B':'.', - m6502.p & 0x08 ? 'D':'.', - m6502.p & 0x04 ? 'I':'.', - m6502.p & 0x02 ? 'Z':'.', - m6502.p & 0x01 ? 'C':'.'); - break; - - case CPUINFO_STR_REGISTER + M6502_PC: sprintf(info->s, "PC:%04X", m6502.pc.w.l); break; - case CPUINFO_STR_REGISTER + M6502_S: sprintf(info->s, "S:%02X", m6502.sp.b.l); break; - case CPUINFO_STR_REGISTER + M6502_P: sprintf(info->s, "P:%02X", m6502.p); break; - case CPUINFO_STR_REGISTER + M6502_A: sprintf(info->s, "A:%02X", m6502.a); break; - case CPUINFO_STR_REGISTER + M6502_X: sprintf(info->s, "X:%02X", m6502.x); break; - case CPUINFO_STR_REGISTER + M6502_Y: sprintf(info->s, "Y:%02X", m6502.y); break; - case CPUINFO_STR_REGISTER + M6502_EA: sprintf(info->s, "EA:%04X", m6502.ea.w.l); break; - case CPUINFO_STR_REGISTER + M6502_ZP: sprintf(info->s, "ZP:%03X", m6502.zp.w.l); break; - } -} - - -#if (HAS_N2A03) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void n2a03_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_INIT: info->init = n2a03_init; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "N2A03"); break; - - default: m6502_get_info(state, info); break; - } -} -#endif - - -#if (HAS_M6510) || (HAS_M6510T) || (HAS_M8502) || (HAS_M7501) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -static void m6510_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as pointers to data or functions --- */ - case CPUINFO_PTR_M6510_PORTREAD: m6502.port_read = (UINT8 (*)(UINT8)) info->f; break; - case CPUINFO_PTR_M6510_PORTWRITE: m6502.port_write = (void (*)(UINT8,UINT8)) info->f; break; - - default: m6502_set_info(state, info); break; - } -} - -void m6510_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = m6510_set_info; break; - case CPUINFO_PTR_INIT: info->init = m6510_init; break; - case CPUINFO_PTR_RESET: info->reset = m6510_reset; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m6510_dasm; break; - case CPUINFO_PTR_INTERNAL_MEMORY_MAP: info->internal_map8 = address_map_m6510_mem; break; - case CPUINFO_PTR_M6510_PORTREAD: info->f = (genf *) m6502.port_read; break; - case CPUINFO_PTR_M6510_PORTWRITE: info->f = (genf *) m6502.port_write; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6510"); break; - - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_M6510_PORT: info->i = m6510_get_port(); break; - - default: m6502_get_info(state, info); break; - } -} -#endif - - -#if (HAS_M6510T) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void m6510t_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6510T"); break; - - default: m6510_get_info(state, info); break; - } -} -#endif - - -#if (HAS_M7501) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void m7501_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M7501"); break; - - default: m6510_get_info(state, info); break; - } -} -#endif - - -#if (HAS_M8502) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void m8502_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M8502"); break; - - default: m6510_get_info(state, info); break; - } -} -#endif - - -#if (HAS_M65C02) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -static void m65c02_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: m65c02_set_irq_line(INPUT_LINE_NMI, info->i); break; - - default: m6502_set_info(state, info); break; - } -} - -void m65c02_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = m65c02_set_info; break; - case CPUINFO_PTR_INIT: info->init = m65c02_init; break; - case CPUINFO_PTR_RESET: info->reset = m65c02_reset; break; - case CPUINFO_PTR_EXECUTE: info->execute = m65c02_execute; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m65c02_dasm; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M65C02"); break; - - default: m6502_get_info(state, info); break; - } -} -#endif - - -#if (HAS_M65SC02) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void m65sc02_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_INIT: info->init = m65sc02_init; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m65sc02_dasm; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M65SC02"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Metal Oxid Semiconductor MOS 6502"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.0beta"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Juergen Buchmueller\nCopyright Peter Trauner\nall rights reserved."); break; - - default: m65c02_get_info(state, info); break; - } -} -#endif - - -#if (HAS_DECO16) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -static void deco16_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + M6502_IRQ_LINE: deco16_set_irq_line(M6502_IRQ_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + M6502_SET_OVERFLOW: deco16_set_irq_line(M6502_SET_OVERFLOW, info->i); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: deco16_set_irq_line(INPUT_LINE_NMI, info->i); break; - - default: m6502_set_info(state, info); break; - } -} - -void deco16_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = deco16_set_info; break; - case CPUINFO_PTR_INIT: info->init = deco16_init; break; - case CPUINFO_PTR_RESET: info->reset = deco16_reset; break; - case CPUINFO_PTR_EXECUTE: info->execute = deco16_execute; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = deco16_dasm; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "DECO CPU16"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "DECO"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "0.1"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Juergen Buchmueller\nCopyright Bryan McPhail\nall rights reserved."); break; - - default: m6502_get_info(state, info); break; - } -} -#endif - -#endif diff --git a/jan/src/cpu/m6502/m6502.h b/jan/src/cpu/m6502/m6502.h deleted file mode 100644 index cffaade2a..000000000 --- a/jan/src/cpu/m6502/m6502.h +++ /dev/null @@ -1,347 +0,0 @@ -/***************************************************************************** - * - * m6502.h - * Portable 6502/65c02/65sc02/6510/n2a03 emulator interface - * - * Copyright Juergen Buchmueller, all rights reserved. - * 65sc02 core Copyright Peter Trauner. - * Deco16 portions Copyright Bryan McPhail. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * pullmoll@t-online.de - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - *****************************************************************************/ -/* 2.February 2000 PeT added 65sc02 subtype */ - -#pragma once - -#ifndef __M6502_H__ -#define __M6502_H__ - -//#include "cpuintrf.h" - -#define HAS_M65C02 1 -#define HAS_M6510 1 -#define HAS_N2A03 1 -#define HAS_M65SC02 1 -#define HAS_DECO16 1 -#define HAS_M6510T 1 -#define HAS_M7501 1 -#define HAS_M8502 1 - -typedef struct -{ - UINT8 subtype; /* currently selected cpu sub type */ -// void (*const *insn)(void); /* pointer to the function pointer table */ - PAIR ppc; /* previous program counter */ - PAIR pc; /* program counter */ - PAIR sp; /* stack pointer (always 100 - 1FF) */ - PAIR zp; /* zero page address */ - PAIR ea; /* effective address */ - UINT8 a; /* Accumulator */ - UINT8 x; /* X index register */ - UINT8 y; /* Y index register */ - UINT8 p; /* Processor status */ - UINT8 pending_irq; /* nonzero if an IRQ is pending */ - UINT8 after_cli; /* pending IRQ and last insn cleared I */ - UINT8 nmi_state; - UINT8 irq_state; - UINT8 so_state; - UINT8 hold_irq; - ALIGN_VAR(8) int (*irq_callback)(int irqline); /* IRQ callback */ -// read8_machine_func rdmem_id; /* readmem callback for indexed instructions */ -// write8_machine_func wrmem_id; /* writemem callback for indexed instructions */ - -#if (HAS_M6510) || (HAS_M6510T) || (HAS_M8502) || (HAS_M7501) - UINT8 ddr; - UINT8 port; - ALIGN_VAR(8) UINT8 (*port_read)(UINT8 direction); - ALIGN_VAR(8) void (*port_write)(UINT8 direction, UINT8 data); -#endif - -} m6502_Regs; - -#define M6502_CLEAR_LINE 0 -#define M6502_ASSERT_LINE 1 -#define M6502_INPUT_LINE_NMI 32 - -/* set to 1 to test cur_mrhard/cur_wmhard to avoid calls */ -#define FAST_MEMORY 0 - -#define SUBTYPE_6502 0 -#if (HAS_M65C02) -#define SUBTYPE_65C02 1 -#endif -#if (HAS_M6510) -#define SUBTYPE_6510 2 -#endif -#if (HAS_N2A03) -#define SUBTYPE_2A03 3 -#endif -#if (HAS_M65SC02) -#define SUBTYPE_65SC02 4 -#endif -#if (HAS_DECO16) -#define SUBTYPE_DECO16 5 -#endif - -enum -{ - M6502_PC=1, M6502_S, M6502_P, M6502_A, M6502_X, M6502_Y, - M6502_EA, M6502_ZP, - M6502_SUBTYPE -}; - -#define M6502_IRQ_LINE 0 -/* use cpunum_set_input_line(machine, cpu, M6502_SET_OVERFLOW, level) - to change level of the so input line - positiv edge sets overflow flag */ -#define M6502_SET_OVERFLOW 1 - -/*typedef unsigned char (*M6502ReadIoHandler)(unsigned short a); -typedef void (*M6502WriteIoHandler)(unsigned short a, unsigned char v); -typedef unsigned char (*M6502ReadProgHandler)(unsigned short a); -typedef void (*M6502WriteProgHandler)(unsigned short a, unsigned char v); -typedef unsigned char (*M6502ReadMemIndexHandler)(unsigned short a); -typedef void (*M6502WriteMemIndexHandler)(unsigned short a, unsigned char v); -typedef unsigned char (*M6502ReadOpHandler)(unsigned short a); -typedef unsigned char (*M6502ReadOpArgHandler)(unsigned short a);*/ - -unsigned char M6502ReadPort(unsigned short Address); -void M6502WritePort(unsigned short Address, unsigned char Data); -unsigned char M6502ReadByte(unsigned short Address); -void M6502WriteByte(unsigned short Address, unsigned char Data); -//unsigned char M6502ReadMemIndex(unsigned short Address); -//void M6502WriteMemIndex(unsigned short Address, unsigned char Data); -unsigned char M6502ReadOp(unsigned short Address); -unsigned char M6502ReadOpArg(unsigned short Address); - -void m6502_init(); -void m6502_reset(void); -void m6502_exit(void); -void m6502_core_exit(); -void m6502_get_context (void *dst); -void m6502_set_context (void *src); -int m6502_execute(int cycles); -void m6502_set_irq_line(int irqline, int state); -void m6502_set_irq_hold(); -UINT32 m6502_get_pc(); -UINT32 m6502_get_prev_pc(); -int m6502_releaseslice(); - -void m65c02_init(); -void m65c02_reset(); -int m65c02_execute(int cycles); -void m65c02_set_irq_line(int irqline, int state); - -void m65sc02_init(); - -void n2a03_init(); -void n2a03_irq(void); // used for PSG!! - -void deco16_init(); -void deco16_reset(); -int deco16_execute(int cycles); -void deco16_set_irq_line(int irqline, int state); - -void m6510_init(); -void m6510_reset(void); - -int decocpu7_execute(int cycles); - -/*enum -{ - CPUINFO_PTR_M6502_READINDEXED_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC, - CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK, - CPUINFO_PTR_M6510_PORTREAD, - CPUINFO_PTR_M6510_PORTWRITE, - - CPUINFO_INT_M6510_PORT = CPUINFO_INT_CPU_SPECIFIC -};*/ - -//extern void m6502_get_info(UINT32 state, cpuinfo *info); - -//extern unsigned m6502_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - -/**************************************************************************** - * The 6510 - ****************************************************************************/ -#if (HAS_M6510) -#define M6510_A M6502_A -#define M6510_X M6502_X -#define M6510_Y M6502_Y -#define M6510_S M6502_S -#define M6510_PC M6502_PC -#define M6510_P M6502_P -#define M6510_EA M6502_EA -#define M6510_ZP M6502_ZP -#define M6510_NMI_STATE M6502_NMI_STATE -#define M6510_IRQ_STATE M6502_IRQ_STATE - -#define M6510_IRQ_LINE M6502_IRQ_LINE - -//extern void m6510_get_info(UINT32 state, cpuinfo *info); - -//extern unsigned m6510_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - -#endif - -#if (HAS_M6510T) -#define M6510T_A M6502_A -#define M6510T_X M6502_X -#define M6510T_Y M6502_Y -#define M6510T_S M6502_S -#define M6510T_PC M6502_PC -#define M6510T_P M6502_P -#define M6510T_EA M6502_EA -#define M6510T_ZP M6502_ZP -#define M6510T_NMI_STATE M6502_NMI_STATE -#define M6510T_IRQ_STATE M6502_IRQ_STATE - -#define M6510T_IRQ_LINE M6502_IRQ_LINE - -//extern void m6510t_get_info(UINT32 state, cpuinfo *info); - -#endif - -#if (HAS_M7501) -#define M7501_A M6502_A -#define M7501_X M6502_X -#define M7501_Y M6502_Y -#define M7501_S M6502_S -#define M7501_PC M6502_PC -#define M7501_P M6502_P -#define M7501_EA M6502_EA -#define M7501_ZP M6502_ZP -#define M7501_NMI_STATE M6502_NMI_STATE -#define M7501_IRQ_STATE M6502_IRQ_STATE - -#define M7501_IRQ_LINE M6502_IRQ_LINE - -//extern void m7501_get_info(UINT32 state, cpuinfo *info); -#endif - -#if (HAS_M8502) -#define M8502_A M6502_A -#define M8502_X M6502_X -#define M8502_Y M6502_Y -#define M8502_S M6502_S -#define M8502_PC M6502_PC -#define M8502_P M6502_P -#define M8502_EA M6502_EA -#define M8502_ZP M6502_ZP -#define M8502_NMI_STATE M6502_NMI_STATE -#define M8502_IRQ_STATE M6502_IRQ_STATE - -#define M8502_IRQ_LINE M6502_IRQ_LINE - -//extern void m8502_get_info(UINT32 state, cpuinfo *info); -#endif - - -/**************************************************************************** - * The 2A03 (NES 6502 without decimal mode ADC/SBC) - ****************************************************************************/ -#if (HAS_N2A03) -#define N2A03_A M6502_A -#define N2A03_X M6502_X -#define N2A03_Y M6502_Y -#define N2A03_S M6502_S -#define N2A03_PC M6502_PC -#define N2A03_P M6502_P -#define N2A03_EA M6502_EA -#define N2A03_ZP M6502_ZP -#define N2A03_NMI_STATE M6502_NMI_STATE -#define N2A03_IRQ_STATE M6502_IRQ_STATE - -#define N2A03_IRQ_LINE M6502_IRQ_LINE - -//extern void n2a03_get_info(UINT32 state, cpuinfo *info); - -#define N2A03_DEFAULTCLOCK (21477272.724 / 12) - -/* The N2A03 is integrally tied to its PSG (they're on the same die). - Bit 7 of address $4011 (the PSG's DPCM control register), when set, - causes an IRQ to be generated. This function allows the IRQ to be called - from the PSG core when such an occasion arises. */ -//extern void n2a03_irq(void); -#endif - - -/**************************************************************************** - * The 65C02 - ****************************************************************************/ -#if (HAS_M65C02) -#define M65C02_A M6502_A -#define M65C02_X M6502_X -#define M65C02_Y M6502_Y -#define M65C02_S M6502_S -#define M65C02_PC M6502_PC -#define M65C02_P M6502_P -#define M65C02_EA M6502_EA -#define M65C02_ZP M6502_ZP -#define M65C02_NMI_STATE M6502_NMI_STATE -#define M65C02_IRQ_STATE M6502_IRQ_STATE - -#define M65C02_IRQ_LINE M6502_IRQ_LINE - -//extern void m65c02_get_info(UINT32 state, cpuinfo *info); - -//extern unsigned m65c02_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - -#endif - -/**************************************************************************** - * The 65SC02 - ****************************************************************************/ -#if (HAS_M65SC02) -#define M65SC02_A M6502_A -#define M65SC02_X M6502_X -#define M65SC02_Y M6502_Y -#define M65SC02_S M6502_S -#define M65SC02_PC M6502_PC -#define M65SC02_P M6502_P -#define M65SC02_EA M6502_EA -#define M65SC02_ZP M6502_ZP -#define M65SC02_NMI_STATE M6502_NMI_STATE -#define M65SC02_IRQ_STATE M6502_IRQ_STATE - -#define M65SC02_IRQ_LINE M6502_IRQ_LINE - -//extern void m65sc02_get_info(UINT32 state, cpuinfo *info); - -//extern unsigned m65sc02_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -#endif - -/**************************************************************************** - * The DECO CPU16 - ****************************************************************************/ -#if (HAS_DECO16) -#define DECO16_A M6502_A -#define DECO16_X M6502_X -#define DECO16_Y M6502_Y -#define DECO16_S M6502_S -#define DECO16_PC M6502_PC -#define DECO16_P M6502_P -#define DECO16_EA M6502_EA -#define DECO16_ZP M6502_ZP -#define DECO16_NMI_STATE M6502_NMI_STATE -#define DECO16_IRQ_STATE M6502_IRQ_STATE - -#define DECO16_IRQ_LINE M6502_IRQ_LINE - -//extern void deco16_get_info(UINT32 state, cpuinfo *info); -#endif - -//extern unsigned deco16_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - -#endif /* __M6502_H__ */ diff --git a/jan/src/cpu/m6502/ops02.h b/jan/src/cpu/m6502/ops02.h deleted file mode 100644 index fbc45eb68..000000000 --- a/jan/src/cpu/m6502/ops02.h +++ /dev/null @@ -1,813 +0,0 @@ -/***************************************************************************** - * - * ops02.h - * Addressing mode and opcode macros for 6502,65c02,65sc02,6510,n2a03 CPUs - * - * Copyright Juergen Buchmueller, all rights reserved. - * 65sc02 core Copyright Peter Trauner, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * pullmoll@t-online.de - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - *****************************************************************************/ - - -/* 6502 flags */ -#define F_C 0x01 -#define F_Z 0x02 -#define F_I 0x04 -#define F_D 0x08 -#define F_B 0x10 -#define F_T 0x20 -#define F_V 0x40 -#define F_N 0x80 - -/* some shortcuts for improved readability */ -#define A m6502.a -#define X m6502.x -#define Y m6502.y -#define P m6502.p -#define S m6502.sp.b.l -#define SPD m6502.sp.d - -#define NZ m6502.nz - -#define SET_NZ(n) \ - if ((n) == 0) P = (P & ~F_N) | F_Z; else P = (P & ~(F_N | F_Z)) | ((n) & F_N) - -#define SET_Z(n) \ - if ((n) == 0) P |= F_Z; else P &= ~F_Z - -#define EAL m6502.ea.b.l -#define EAH m6502.ea.b.h -#define EAW m6502.ea.w.l -#define EAD m6502.ea.d - -#define ZPL m6502.zp.b.l -#define ZPH m6502.zp.b.h -#define ZPW m6502.zp.w.l -#define ZPD m6502.zp.d - -#define PCL m6502.pc.b.l -#define PCH m6502.pc.b.h -#define PCW m6502.pc.w.l -#define PCD m6502.pc.d - -#define PPC m6502.ppc.d - -#define RDMEM_ID(a) M6502ReadByte(a) -#define WRMEM_ID(a,d) M6502WriteByte(a, d); Cpu7Written[M6502GetActive()] = 1 - -#define CHANGE_PC change_pc(PCD) - -/*************************************************************** - * RDOP read an opcode - ***************************************************************/ -//#define RDOP() cpu_readop(PCW++); m6502_ICount -= 1 -#define RDOP() M6502ReadOp(PCW++); m6502_ICount -= 1 -#define PEEKOP() M6502ReadOp(PCW) - -/*************************************************************** - * RDOPARG read an opcode argument - ***************************************************************/ -//#define RDOPARG() cpu_readop_arg(PCW++); m6502_ICount -= 1 -#define RDOPARG() M6502ReadOpArg(PCW++); m6502_ICount -= 1 - -/*************************************************************** - * RDMEM read memory - ***************************************************************/ -//#define RDMEM(addr) program_read_byte_8le(addr); m6502_ICount -= 1 -#define RDMEM(addr) M6502ReadByte(addr); m6502_ICount -= 1 - -/*************************************************************** - * WRMEM write memory - ***************************************************************/ -//#define WRMEM(addr,data) program_write_byte_8le(addr,data); m6502_ICount -= 1 -#define WRMEM(addr,data) M6502WriteByte(addr, data); m6502_ICount -= 1; Cpu7Written[M6502GetActive()] = 1 - -/*************************************************************** - * BRA branch relative - * extra cycle if page boundary is crossed - ***************************************************************/ -#define BRA(cond) \ - { \ - INT8 tmp2 = RDOPARG(); \ - if (cond) \ - { \ - RDMEM(PCW); \ - EAW = PCW + (signed char)tmp2; \ - if ( EAH != PCH ) { \ - RDMEM( (PCH << 8 ) | EAL) ; \ - } \ - PCD = EAD; \ - CHANGE_PC; \ - } \ - } - -/*************************************************************** - * - * Helper macros to build the effective address - * - ***************************************************************/ - -/*************************************************************** - * EA = zero page address - ***************************************************************/ -#define EA_ZPG \ - ZPL = RDOPARG(); \ - EAD = ZPD - -/*************************************************************** - * EA = zero page address + X - ***************************************************************/ -#define EA_ZPX \ - ZPL = RDOPARG(); \ - RDMEM(ZPD); \ - ZPL = X + ZPL; \ - EAD = ZPD - -/*************************************************************** - * EA = zero page address + Y - ***************************************************************/ -#define EA_ZPY \ - ZPL = RDOPARG(); \ - RDMEM(ZPD); \ - ZPL = Y + ZPL; \ - EAD = ZPD - -/*************************************************************** - * EA = absolute address - ***************************************************************/ -#define EA_ABS \ - EAL = RDOPARG(); \ - EAH = RDOPARG() - -/*************************************************************** - * EA = absolute address + X - * one additional read if page boundary is crossed - ***************************************************************/ -#define EA_ABX_P \ - EA_ABS; \ - if ( EAL + X > 0xff ) { \ - RDMEM( ( EAH << 8 ) | ( ( EAL + X ) & 0xff ) ); \ - } \ - EAW += X; - -/*************************************************************** - * EA = absolute address + X - ***************************************************************/ -#define EA_ABX_NP \ - EA_ABS; \ - RDMEM( ( EAH << 8 ) | ( ( EAL + X ) & 0xff ) ); \ - EAW += X - -/*************************************************************** - * EA = absolute address + Y - * one additional read if page boundary is crossed - ***************************************************************/ -#define EA_ABY_P \ - EA_ABS; \ - if ( EAL + Y > 0xff ) { \ - RDMEM( ( EAH << 8 ) | ( ( EAL + Y ) & 0xff ) ); \ - } \ - EAW += Y; - -/*************************************************************** - * EA = absolute address + Y - ***************************************************************/ -#define EA_ABY_NP \ - EA_ABS; \ - RDMEM( ( EAH << 8 ) | ( ( EAL + Y ) & 0xff ) ); \ - EAW += Y - -/*************************************************************** - * EA = zero page + X indirect (pre indexed) - ***************************************************************/ -#define EA_IDX \ - ZPL = RDOPARG(); \ - RDMEM(ZPD); \ - ZPL = ZPL + X; \ - EAL = RDMEM(ZPD); \ - ZPL++; \ - EAH = RDMEM(ZPD) - -/*************************************************************** - * EA = zero page indirect + Y (post indexed) - * subtract 1 cycle if page boundary is crossed - ***************************************************************/ -#define EA_IDY_P \ - ZPL = RDOPARG(); \ - EAL = RDMEM(ZPD); \ - ZPL++; \ - EAH = RDMEM(ZPD); \ - if (EAL + Y > 0xff) { \ - RDMEM( ( EAH << 8 ) | ( ( EAL + Y ) & 0xff ) ); \ - } \ - EAW += Y; - -/*************************************************************** - * EA = zero page indirect + Y - ***************************************************************/ -#define EA_IDY_NP \ - ZPL = RDOPARG(); \ - EAL = RDMEM(ZPD); \ - ZPL++; \ - EAH = RDMEM(ZPD); \ - RDMEM( ( EAH << 8 ) | ( ( EAL + Y ) & 0xff ) ); \ - EAW += Y - -/*************************************************************** - * EA = zero page indirect (65c02 pre indexed w/o X) - ***************************************************************/ -#define EA_ZPI \ - ZPL = RDOPARG(); \ - EAL = RDMEM(ZPD); \ - ZPL++; \ - EAH = RDMEM(ZPD) - -/*************************************************************** - * EA = indirect (only used by JMP) - ***************************************************************/ -#define EA_IND \ - EA_ABS; \ - tmp = RDMEM(EAD); \ - EAL++; /* booby trap: stay in same page! ;-) */ \ - EAH = RDMEM(EAD); \ - EAL = tmp - - -/* read a value into tmp */ -/* Base number of cycles taken for each mode (including reading of opcode): - RD_IMM 2 - RD_DUM 2 - RD_ACC 0 - RD_ZPG/WR_ZPG 3 - RD_ZPX/WR_ZPX 4 - RD_ZPY/WR_ZPY 4 - RD_ABS/WR_ABS 4 - RD_ABX_P 4/5 - RD_ABX_NP/WR_ABX_NP 5 - RD_ABY_P 4/5 - RD_ABY_NP/WR_ABY_NP 5 - RD_IDX/WR_IDX 6 - RD_IDY_P 5/6 - RD_IDY_NP/WR_IDY_NP 6 - RD_ZPI/WR_ZPI 5 - */ -#define RD_IMM tmp = RDOPARG() -#define RD_DUM RDMEM(PCW) -#define RD_ACC tmp = A -#define RD_ZPG EA_ZPG; tmp = RDMEM(EAD) -#define RD_ZPX EA_ZPX; tmp = RDMEM(EAD) -#define RD_ZPY EA_ZPY; tmp = RDMEM(EAD) -#define RD_ABS EA_ABS; tmp = RDMEM(EAD) -#define RD_ABX_P EA_ABX_P; tmp = RDMEM(EAD) -#define RD_ABX_NP EA_ABX_NP; tmp = RDMEM(EAD) -#define RD_ABY_P EA_ABY_P; tmp = RDMEM(EAD) -#define RD_ABY_NP EA_ABY_NP; tmp = RDMEM(EAD) -#define RD_IDX EA_IDX; tmp = RDMEM_ID(EAD); m6502_ICount -= 1 -#define RD_IDY_P EA_IDY_P; tmp = RDMEM_ID(EAD); m6502_ICount -= 1 -#define RD_IDY_NP EA_IDY_NP; tmp = RDMEM_ID(EAD); m6502_ICount -= 1 -#define RD_ZPI EA_ZPI; tmp = RDMEM(EAD) - -/* write a value from tmp */ -#define WR_ZPG EA_ZPG; WRMEM(EAD, tmp) -#define WR_ZPX EA_ZPX; WRMEM(EAD, tmp) -#define WR_ZPY EA_ZPY; WRMEM(EAD, tmp) -#define WR_ABS EA_ABS; WRMEM(EAD, tmp) -#define WR_ABX_NP EA_ABX_NP; WRMEM(EAD, tmp) -#define WR_ABY_NP EA_ABY_NP; WRMEM(EAD, tmp) -#define WR_IDX EA_IDX; WRMEM_ID(EAD, tmp); m6502_ICount -= 1 -#define WR_IDY_NP EA_IDY_NP; WRMEM_ID(EAD, tmp); m6502_ICount -= 1 -#define WR_ZPI EA_ZPI; WRMEM(EAD, tmp) - -/* dummy read from the last EA */ -#define RD_EA RDMEM(EAD) - -/* write back a value from tmp to the last EA */ -#define WB_ACC A = (UINT8)tmp; -#define WB_EA WRMEM(EAD, tmp) - -/*************************************************************** - *************************************************************** - * Macros to emulate the plain 6502 opcodes - *************************************************************** - ***************************************************************/ - -/*************************************************************** - * push a register onto the stack - ***************************************************************/ -#define PUSH(Rg) WRMEM(SPD, Rg); S-- - -/*************************************************************** - * pull a register from the stack - ***************************************************************/ -#define PULL(Rg) S++; Rg = RDMEM(SPD) - -/* 6502 ******************************************************** - * ADC Add with carry - ***************************************************************/ -#define ADC \ - if (P & F_D) { \ - int c = (P & F_C); \ - int lo = (A & 0x0f) + (tmp & 0x0f) + c; \ - int hi = (A & 0xf0) + (tmp & 0xf0); \ - P &= ~(F_V | F_C|F_N|F_Z); \ - if (!((lo+hi)&0xff)) P|=F_Z; \ - if (lo > 0x09) { \ - hi += 0x10; \ - lo += 0x06; \ - } \ - if (hi&0x80) P|=F_N; \ - if (~(A^tmp) & (A^hi) & F_N) \ - P |= F_V; \ - if (hi > 0x90) \ - hi += 0x60; \ - if (hi & 0xff00) \ - P |= F_C; \ - A = (lo & 0x0f) + (hi & 0xf0); \ - } else { \ - int c = (P & F_C); \ - int sum = A + tmp + c; \ - P &= ~(F_V | F_C); \ - if (~(A^tmp) & (A^sum) & F_N) \ - P |= F_V; \ - if (sum & 0xff00) \ - P |= F_C; \ - A = (UINT8) sum; \ - SET_NZ(A); \ - } - -/* 6502 ******************************************************** - * AND Logical and - ***************************************************************/ -#define AND \ - A = (UINT8)(A & tmp); \ - SET_NZ(A) - -/* 6502 ******************************************************** - * ASL Arithmetic shift left - ***************************************************************/ -#define ASL \ - P = (P & ~F_C) | ((tmp >> 7) & F_C); \ - tmp = (UINT8)(tmp << 1); \ - SET_NZ(tmp) - -/* 6502 ******************************************************** - * BCC Branch if carry clear - ***************************************************************/ -#define BCC BRA(!(P & F_C)) - -/* 6502 ******************************************************** - * BCS Branch if carry set - ***************************************************************/ -#define BCS BRA(P & F_C) - -/* 6502 ******************************************************** - * BEQ Branch if equal - ***************************************************************/ -#define BEQ BRA(P & F_Z) - -/* 6502 ******************************************************** - * BIT Bit test - ***************************************************************/ -#undef BIT -#define BIT \ - P &= ~(F_N|F_V|F_Z); \ - P |= tmp & (F_N|F_V); \ - if ((tmp & A) == 0) \ - P |= F_Z - -/* 6502 ******************************************************** - * BMI Branch if minus - ***************************************************************/ -#define BMI BRA(P & F_N) - -/* 6502 ******************************************************** - * BNE Branch if not equal - ***************************************************************/ -#define BNE BRA(!(P & F_Z)) - -/* 6502 ******************************************************** - * BPL Branch if plus - ***************************************************************/ -#define BPL BRA(!(P & F_N)) - -/* 6502 ******************************************************** - * BRK Break - * increment PC, push PC hi, PC lo, flags (with B bit set), - * set I flag, jump via IRQ vector - ***************************************************************/ -#define BRK \ - RDOPARG(); \ - PUSH(PCH); \ - PUSH(PCL); \ - PUSH(P | F_B); \ - P = (P | F_I); \ - PCL = RDMEM(M6502_IRQ_VEC); \ - PCH = RDMEM(M6502_IRQ_VEC+1); \ - CHANGE_PC - -/* 6502 ******************************************************** - * BVC Branch if overflow clear - ***************************************************************/ -#define BVC BRA(!(P & F_V)) - -/* 6502 ******************************************************** - * BVS Branch if overflow set - ***************************************************************/ -#define BVS BRA(P & F_V) - -/* 6502 ******************************************************** - * CLC Clear carry flag - ***************************************************************/ -#define CLC \ - P &= ~F_C - -/* 6502 ******************************************************** - * CLD Clear decimal flag - ***************************************************************/ -#define CLD \ - P &= ~F_D - -/* 6502 ******************************************************** - * CLI Clear interrupt flag - ***************************************************************/ -#define CLI \ - if ((m6502.irq_state != M6502_CLEAR_LINE) && (P & F_I)) { \ - /* kludge for now until IRQ rewrite: ignore if RTI follows */ \ - if (PEEKOP() != 0x40) \ - m6502.after_cli = 1; \ - } \ - P &= ~F_I - -/* 6502 ******************************************************** - * CLV Clear overflow flag - ***************************************************************/ -#define CLV \ - P &= ~F_V - -/* 6502 ******************************************************** - * CMP Compare accumulator - ***************************************************************/ -#define CMP \ - P &= ~F_C; \ - if (A >= tmp) \ - P |= F_C; \ - SET_NZ((UINT8)(A - tmp)) - -/* 6502 ******************************************************** - * CPX Compare index X - ***************************************************************/ -#define CPX \ - P &= ~F_C; \ - if (X >= tmp) \ - P |= F_C; \ - SET_NZ((UINT8)(X - tmp)) - -/* 6502 ******************************************************** - * CPY Compare index Y - ***************************************************************/ -#define CPY \ - P &= ~F_C; \ - if (Y >= tmp) \ - P |= F_C; \ - SET_NZ((UINT8)(Y - tmp)) - -/* 6502 ******************************************************** - * DEC Decrement memory - ***************************************************************/ -#define DEC \ - tmp = (UINT8)(tmp-1); \ - SET_NZ(tmp) - -/* 6502 ******************************************************** - * DEX Decrement index X - ***************************************************************/ -#define DEX \ - X = (UINT8)(X-1); \ - SET_NZ(X) - -/* 6502 ******************************************************** - * DEY Decrement index Y - ***************************************************************/ -#define DEY \ - Y = (UINT8)(Y-1); \ - SET_NZ(Y) - -/* 6502 ******************************************************** - * EOR Logical exclusive or - ***************************************************************/ -#define EOR \ - A = (UINT8)(A ^ tmp); \ - SET_NZ(A) - -/* 6502 ******************************************************** - * ILL Illegal opcode - ***************************************************************/ -#define ILL -// logerror("M6502 illegal opcode %04x: %02x\n",(PCW-1)&0xffff, cpu_readop((PCW-1)&0xffff)) - -/* 6502 ******************************************************** - * INC Increment memory - ***************************************************************/ -#define INC \ - tmp = (UINT8)(tmp+1); \ - SET_NZ(tmp) - -/* 6502 ******************************************************** - * INX Increment index X - ***************************************************************/ -#define INX \ - X = (UINT8)(X+1); \ - SET_NZ(X) - -/* 6502 ******************************************************** - * INY Increment index Y - ***************************************************************/ -#define INY \ - Y = (UINT8)(Y+1); \ - SET_NZ(Y) - -/* 6502 ******************************************************** - * JMP Jump to address - * set PC to the effective address - ***************************************************************/ -#define JMP \ - if( EAD == PPC && !m6502.pending_irq && !m6502.after_cli ) \ - if( m6502_ICount > 0 ) m6502_ICount = 0; \ - PCD = EAD; \ - CHANGE_PC - -/* 6502 ******************************************************** - * JSR Jump to subroutine - * decrement PC (sic!) push PC hi, push PC lo and set - * PC to the effective address - ***************************************************************/ -#define JSR \ - EAL = RDOPARG(); \ - RDMEM(SPD); \ - PUSH(PCH); \ - PUSH(PCL); \ - EAH = RDOPARG(); \ - PCD = EAD; \ - CHANGE_PC - -/* 6502 ******************************************************** - * LDA Load accumulator - ***************************************************************/ -#define LDA \ - A = (UINT8)tmp; \ - SET_NZ(A) - -/* 6502 ******************************************************** - * LDX Load index X - ***************************************************************/ -#define LDX \ - X = (UINT8)tmp; \ - SET_NZ(X) - -/* 6502 ******************************************************** - * LDY Load index Y - ***************************************************************/ -#define LDY \ - Y = (UINT8)tmp; \ - SET_NZ(Y) - -/* 6502 ******************************************************** - * LSR Logic shift right - * 0 -> [7][6][5][4][3][2][1][0] -> C - ***************************************************************/ -#define LSR \ - P = (P & ~F_C) | (tmp & F_C); \ - tmp = (UINT8)tmp >> 1; \ - SET_NZ(tmp) - -/* 6502 ******************************************************** - * NOP No operation - ***************************************************************/ -#define NOP - -/* 6502 ******************************************************** - * ORA Logical inclusive or - ***************************************************************/ -#define ORA \ - A = (UINT8)(A | tmp); \ - SET_NZ(A) - -/* 6502 ******************************************************** - * PHA Push accumulator - ***************************************************************/ -#define PHA \ - PUSH(A) - -/* 6502 ******************************************************** - * PHP Push processor status (flags) - ***************************************************************/ -#define PHP \ - PUSH(P) - -/* 6502 ******************************************************** - * PLA Pull accumulator - ***************************************************************/ -#define PLA \ - RDMEM(SPD); \ - PULL(A); \ - SET_NZ(A) - - -/* 6502 ******************************************************** - * PLP Pull processor status (flags) - ***************************************************************/ -#define PLP \ - RDMEM(SPD); \ - if ( P & F_I ) { \ - PULL(P); \ - if ((m6502.irq_state != M6502_CLEAR_LINE) && !(P & F_I)) { \ - m6502.after_cli = 1; \ - } \ - } else { \ - PULL(P); \ - } \ - P |= (F_T|F_B); - -/* 6502 ******************************************************** - * ROL Rotate left - * new C <- [7][6][5][4][3][2][1][0] <- C - ***************************************************************/ -#define ROL \ - tmp = (tmp << 1) | (P & F_C); \ - P = (P & ~F_C) | ((tmp >> 8) & F_C); \ - tmp = (UINT8)tmp; \ - SET_NZ(tmp) - -/* 6502 ******************************************************** - * ROR Rotate right - * C -> [7][6][5][4][3][2][1][0] -> new C - ***************************************************************/ -#define ROR \ - tmp |= (P & F_C) << 8; \ - P = (P & ~F_C) | (tmp & F_C); \ - tmp = (UINT8)(tmp >> 1); \ - SET_NZ(tmp) - -/* 6502 ******************************************************** - * RTI Return from interrupt - * pull flags, pull PC lo, pull PC hi and increment PC - * PCW++; - ***************************************************************/ -#define RTI \ - RDOPARG(); \ - RDMEM(SPD); \ - PULL(P); \ - PULL(PCL); \ - PULL(PCH); \ - P |= F_T | F_B; \ - if( (m6502.irq_state != M6502_CLEAR_LINE) && !(P & F_I) ) \ - { \ - m6502.after_cli = 1; \ - } \ - CHANGE_PC - -/* 6502 ******************************************************** - * RTS Return from subroutine - * pull PC lo, PC hi and increment PC - ***************************************************************/ -#define RTS \ - RDOPARG(); \ - RDMEM(SPD); \ - PULL(PCL); \ - PULL(PCH); \ - RDMEM(PCW); PCW++; \ - CHANGE_PC - -/* 6502 ******************************************************** - * SBC Subtract with carry - ***************************************************************/ -#define SBC \ - if (P & F_D) \ - { \ - int c = (P & F_C) ^ F_C; \ - int sum = A - tmp - c; \ - int lo = (A & 0x0f) - (tmp & 0x0f) - c; \ - int hi = (A & 0xf0) - (tmp & 0xf0); \ - if (lo & 0x10) \ - { \ - lo -= 6; \ - hi--; \ - } \ - P &= ~(F_V | F_C|F_Z|F_N); \ - if( (A^tmp) & (A^sum) & F_N ) \ - P |= F_V; \ - if( hi & 0x0100 ) \ - hi -= 0x60; \ - if( (sum & 0xff00) == 0 ) \ - P |= F_C; \ - if( !((A-tmp-c) & 0xff) ) \ - P |= F_Z; \ - if( (A-tmp-c) & 0x80 ) \ - P |= F_N; \ - A = (lo & 0x0f) | (hi & 0xf0); \ - } \ - else \ - { \ - int c = (P & F_C) ^ F_C; \ - int sum = A - tmp - c; \ - P &= ~(F_V | F_C); \ - if( (A^tmp) & (A^sum) & F_N ) \ - P |= F_V; \ - if( (sum & 0xff00) == 0 ) \ - P |= F_C; \ - A = (UINT8) sum; \ - SET_NZ(A); \ - } - -/* 6502 ******************************************************** - * SEC Set carry flag - ***************************************************************/ -#if defined(SEC) -#undef SEC -#endif -#define SEC \ - P |= F_C - -/* 6502 ******************************************************** - * SED Set decimal flag - ***************************************************************/ -#define SED \ - P |= F_D - -/* 6502 ******************************************************** - * SEI Set interrupt flag - ***************************************************************/ -#define SEI \ - P |= F_I - -/* 6502 ******************************************************** - * STA Store accumulator - ***************************************************************/ -#define STA \ - tmp = A - -/* 6502 ******************************************************** - * STX Store index X - ***************************************************************/ -#define STX \ - tmp = X - -/* 6502 ******************************************************** - * STY Store index Y - ***************************************************************/ -#define STY \ - tmp = Y - -/* 6502 ******************************************************** - * TAX Transfer accumulator to index X - ***************************************************************/ -#define TAX \ - X = A; \ - SET_NZ(X) - -/* 6502 ******************************************************** - * TAY Transfer accumulator to index Y - ***************************************************************/ -#define TAY \ - Y = A; \ - SET_NZ(Y) - -/* 6502 ******************************************************** - * TSX Transfer stack LSB to index X - ***************************************************************/ -#define TSX \ - X = S; \ - SET_NZ(X) - -/* 6502 ******************************************************** - * TXA Transfer index X to accumulator - ***************************************************************/ -#define TXA \ - A = X; \ - SET_NZ(A) - -/* 6502 ******************************************************** - * TXS Transfer index X to stack LSB - * no flags changed (sic!) - ***************************************************************/ -#define TXS \ - S = X - -/* 6502 ******************************************************** - * TYA Transfer index Y to accumulator - ***************************************************************/ -#define TYA \ - A = Y; \ - SET_NZ(A) diff --git a/jan/src/cpu/m6502/opsc02.h b/jan/src/cpu/m6502/opsc02.h deleted file mode 100644 index 628c4cbce..000000000 --- a/jan/src/cpu/m6502/opsc02.h +++ /dev/null @@ -1,362 +0,0 @@ -/***************************************************************************** - * - * m6502ops.h - * Addressing mode and opcode macros for 6502,65c02,65sc02,6510,n2a03 CPUs - * - * Copyright Juergen Buchmueller, all rights reserved. - * 65sc02 core Copyright Peter Trauner, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * pullmoll@t-online.de - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - *****************************************************************************/ - - -/*************************************************************** - *************************************************************** - * Macros to emulate the 65C02 opcodes - *************************************************************** - ***************************************************************/ - -/* 65C02 ******************************************************* - * EA = absolute address + X - * one additional read if page boundary is crossed - ***************************************************************/ -#define EA_ABX_C02_P \ - EA_ABS; \ - if ( EAL + X > 0xff ) { \ - RDMEM( PCW - 1 ); \ - } \ - EAW += X; - -/* 65C02 ******************************************************* - * EA = absolute address + X - ***************************************************************/ -#define EA_ABX_C02_NP \ - EA_ABS; \ - RDMEM( PCW - 1 ); \ - EAW += X; - -/*************************************************************** - * EA = absolute address + Y - * one additional read if page boundary is crossed - ***************************************************************/ -#define EA_ABY_C02_P \ - EA_ABS; \ - if ( EAL + Y > 0xff ) { \ - RDMEM( PCW - 1 ); \ - } \ - EAW += Y; - -/* 65C02 ******************************************************* - * EA = absolute address + Y - ***************************************************************/ -#define EA_ABY_C02_NP \ - EA_ABS; \ - RDMEM( PCW - 1 ); \ - EAW += Y - -/* 65C02 ******************************************************* - * EA = zero page indirect + Y (post indexed) - * subtract 1 cycle if page boundary is crossed - ***************************************************************/ -#define EA_IDY_C02_P \ - ZPL = RDOPARG(); \ - EAL = RDMEM(ZPD); \ - ZPL++; \ - EAH = RDMEM(ZPD); \ - if (EAL + Y > 0xff) { \ - RDMEM( PCW - 1 ); \ - } \ - EAW += Y; - -/* 65C02 ******************************************************* - * EA = zero page indirect + Y - ***************************************************************/ -#define EA_IDY_C02_NP \ - ZPL = RDOPARG(); \ - EAL = RDMEM(ZPD); \ - ZPL++; \ - EAH = RDMEM(ZPD); \ - RDMEM( PCW - 1 ); \ - EAW += Y - -/* 65C02 ******************************************************* - * EA = indirect (only used by JMP) - * correct overflow handling - ***************************************************************/ -#define EA_IND_C02 \ - EA_ABS; \ - tmp = RDMEM(EAD); \ - RDMEM(PCW-1); \ - EAD++; \ - EAH = RDMEM(EAD); \ - EAL = tmp - -/* 65C02 ******************************************************* - * EA = indirect plus x (only used by 65c02 JMP) - ***************************************************************/ -#define EA_IAX \ - EA_ABS; \ - RDMEM( PCW - 1 ); \ - if (EAL + X > 0xff) { \ - RDMEM( PCW - 1 ); \ - } \ - EAW += X; \ - tmp = RDMEM(EAD); \ - EAD++; \ - EAH = RDMEM(EAD); \ - EAL = tmp - -/* read a value into tmp */ -/* Base number of cycles taken for each mode (including reading of opcode): - RD_ABX_C02_P 4/5 - RD_ABX_C02_NP/WR_ABX_C02_NP 5 - RD_ABY_C02_P 4/5 - RD_IDY_C02_P 5/6 - WR_IDY_C02_NP 6 - */ -#define RD_ABX_C02_P EA_ABX_C02_P; tmp = RDMEM(EAD) -#define RD_ABX_C02_NP EA_ABX_C02_NP; tmp = RDMEM(EAD) -#define RD_ABX_C02_NP_DISCARD EA_ABX_C02_NP; RDMEM(EAD) -#define RD_ABY_C02_P EA_ABY_C02_P; tmp = RDMEM(EAD) -#define RD_IDY_C02_P EA_IDY_C02_P; tmp = RDMEM_ID(EAD); m6502_ICount -= 1 - -#define WR_ABX_C02_NP EA_ABX_C02_NP; WRMEM(EAD, tmp) -#define WR_ABY_C02_NP EA_ABY_C02_NP; WRMEM(EAD, tmp) -#define WR_IDY_C02_NP EA_IDY_C02_NP; WRMEM_ID(EAD, tmp); m6502_ICount -= 1 - - -/* 65C02******************************************************** - * BRA branch relative - * extra cycle if page boundary is crossed - ***************************************************************/ -#define BRA_C02(cond) \ - tmp = RDOPARG(); \ - if (cond) \ - { \ - RDMEM(PCW); \ - EAW = PCW + (signed char)tmp; \ - if ( EAH != PCH ) { \ - RDMEM( PCW - 1 ); \ - } \ - PCD = EAD; \ - CHANGE_PC; \ - } - -/* 65C02 ******************************************************** - * ADC Add with carry - * different setting of flags in decimal mode - ***************************************************************/ -#define ADC_C02 \ - if (P & F_D) \ - { \ - int c = (P & F_C); \ - int lo = (A & 0x0f) + (tmp & 0x0f) + c; \ - int hi = (A & 0xf0) + (tmp & 0xf0); \ - P &= ~(F_V | F_C); \ - if( lo > 0x09 ) \ - { \ - hi += 0x10; \ - lo += 0x06; \ - } \ - if( ~(A^tmp) & (A^hi) & F_N ) \ - P |= F_V; \ - if( hi > 0x90 ) \ - hi += 0x60; \ - if( hi & 0xff00 ) \ - P |= F_C; \ - A = (lo & 0x0f) + (hi & 0xf0); \ - RDMEM( PCW - 1 ); \ - } \ - else \ - { \ - int c = (P & F_C); \ - int sum = A + tmp + c; \ - P &= ~(F_V | F_C); \ - if( ~(A^tmp) & (A^sum) & F_N ) \ - P |= F_V; \ - if( sum & 0xff00 ) \ - P |= F_C; \ - A = (UINT8) sum; \ - } \ - SET_NZ(A) - -/* 65C02 ******************************************************** - * SBC Subtract with carry - * different setting of flags in decimal mode - ***************************************************************/ -#define SBC_C02 \ - if (P & F_D) \ - { \ - int c = (P & F_C) ^ F_C; \ - int sum = A - tmp - c; \ - int lo = (A & 0x0f) - (tmp & 0x0f) - c; \ - int hi = (A & 0xf0) - (tmp & 0xf0); \ - P &= ~(F_V | F_C); \ - if( (A^tmp) & (A^sum) & F_N ) \ - P |= F_V; \ - if( lo & 0xf0 ) \ - lo -= 6; \ - if( lo & 0x80 ) \ - hi -= 0x10; \ - if( hi & 0x0f00 ) \ - hi -= 0x60; \ - if( (sum & 0xff00) == 0 ) \ - P |= F_C; \ - A = (lo & 0x0f) + (hi & 0xf0); \ - RDMEM( PCW - 1 ); \ - } \ - else \ - { \ - int c = (P & F_C) ^ F_C; \ - int sum = A - tmp - c; \ - P &= ~(F_V | F_C); \ - if( (A^tmp) & (A^sum) & F_N ) \ - P |= F_V; \ - if( (sum & 0xff00) == 0 ) \ - P |= F_C; \ - A = (UINT8) sum; \ - } \ - SET_NZ(A) - -/* 65C02 ******************************************************* - * BBR Branch if bit is reset - ***************************************************************/ -#define BBR(bit) \ - BRA(!(tmp & (1<reset(); -} - -void M6502NewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502NewFrame called without init\n")); -#endif - - for (INT32 i = 0; i < nM6502Count; i++) { - nM6502CyclesDone[i] = 0; - } - nM6502CyclesTotal = 0; -} - -static UINT8 M6502CheatRead(UINT32 a) -{ - return M6502ReadByte(a); -} - -static UINT8 deco222Decode(UINT16 /*address*/,UINT8 op) -{ - return (op & 0x13) | ((op & 0x80) >> 5) | ((op & 0x64) << 1) | ((op & 0x08) << 2); -} - -static cpu_core_config M6502CheatCpuConfig = -{ - M6502Open, - M6502Close, - M6502CheatRead, - M6502WriteRom, - M6502GetActive, - M6502TotalCycles, - M6502NewFrame, - M6502Run, - M6502RunEnd, - M6502Reset, - 1<<16, - 0 -}; - -INT32 M6502Init(INT32 cpu, INT32 type) -{ - DebugCPU_M6502Initted = 1; - - nM6502Count++; - nActiveCPU = -1; - - m6502CPUContext[cpu] = (M6502Ext*)BurnMalloc(sizeof(M6502Ext)); - - pCurrentCPU = m6502CPUContext[cpu]; - - memset(pCurrentCPU, 0, sizeof(M6502Ext)); - - for (INT32 i = 0; i < 0x100; i++) { - pCurrentCPU->opcode_reorder[i] = i; - } - - switch (type) - { - case TYPE_M6502: - case TYPE_M6504: - pCurrentCPU->execute = m6502_execute; - pCurrentCPU->reset = m6502_reset; - pCurrentCPU->init = m6502_init; - pCurrentCPU->set_irq_line = m6502_set_irq_line; - break; - - case TYPE_DECOCPU7: - pCurrentCPU->execute = decocpu7_execute; - pCurrentCPU->reset = m6502_reset; - pCurrentCPU->init = m6502_init; - pCurrentCPU->set_irq_line = m6502_set_irq_line; - break; - - case TYPE_DECO222: - case TYPE_DECOC10707: - { - pCurrentCPU->execute = m6502_execute; - pCurrentCPU->reset = m6502_reset; - pCurrentCPU->init = m6502_init; - pCurrentCPU->set_irq_line = m6502_set_irq_line; - - for (INT32 i = 0; i < 0x100; i++) { - pCurrentCPU->opcode_reorder[i] = (i & 0x9f) | ((i >> 1) & 0x20) | ((i & 0x20) << 1); - } - } - break; - - case TYPE_M65C02: - pCurrentCPU->execute = m65c02_execute; - pCurrentCPU->reset = m65c02_reset; - pCurrentCPU->init = m65c02_init; - pCurrentCPU->set_irq_line = m65c02_set_irq_line; - break; - - case TYPE_DECO16: - pCurrentCPU->execute = deco16_execute; - pCurrentCPU->reset = deco16_reset; - pCurrentCPU->init = deco16_init; - pCurrentCPU->set_irq_line = deco16_set_irq_line; - break; - - case TYPE_N2A03: - pCurrentCPU->execute = m6502_execute; - pCurrentCPU->reset = m6502_reset; - pCurrentCPU->init = n2a03_init; // different - pCurrentCPU->set_irq_line = m6502_set_irq_line; - break; - - case TYPE_M65SC02: - pCurrentCPU->execute = m65c02_execute; - pCurrentCPU->reset = m65c02_reset; - pCurrentCPU->init = m65sc02_init; // different - pCurrentCPU->set_irq_line = m65c02_set_irq_line; - break; - - case TYPE_M6510: - case TYPE_M6510T: - case TYPE_M7501: - case TYPE_M8502: - pCurrentCPU->execute = m6502_execute; - pCurrentCPU->reset = m6510_reset; // different - pCurrentCPU->init = m6510_init; // different - pCurrentCPU->set_irq_line = m6502_set_irq_line; - break; - } - - pCurrentCPU->ReadPort = M6502ReadPortDummyHandler; - pCurrentCPU->WritePort = M6502WritePortDummyHandler; - pCurrentCPU->ReadByte = M6502ReadByteDummyHandler; - pCurrentCPU->WriteByte = M6502WriteByteDummyHandler; - pCurrentCPU->ReadOp = M6502ReadOpDummyHandler; - pCurrentCPU->ReadOpArg = M6502ReadOpArgDummyHandler; - - nM6502CyclesDone[cpu] = 0; - - for (INT32 j = 0; j < (0x0100 * 3); j++) { - pCurrentCPU->pMemMap[j] = NULL; - } - - nM6502CyclesTotal = 0; - - M6502Open(cpu); - pCurrentCPU->init(); - M6502Close(); - - if (type == TYPE_DECOCPU7) { - M6502Open(cpu); - DecoCpu7SetDecode(deco222Decode); - M6502Close(); - } - - CpuCheatRegister(cpu, &M6502CheatCpuConfig); - - return 0; -} - -void M6502Exit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502Exit called without init\n")); -#endif - - if (!DebugCPU_M6502Initted) return; - - for (INT32 i = 0; i < MAX_CPU; i++) { - if (m6502CPUContext[i]) { - BurnFree(m6502CPUContext[i]); - m6502CPUContext[i] = NULL; - } - } - - m6502_core_exit(); - - nM6502Count = 0; - - DebugCPU_M6502Initted = 0; -} - -void M6502Open(INT32 num) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502Open called without init\n")); - if (num >= nM6502Count) bprintf(PRINT_ERROR, _T("M6502Open called with invalid index %x\n"), num); - if (nActiveCPU != -1) bprintf(PRINT_ERROR, _T("M6502Open called with CPU already open with index %x\n"), num); -#endif - - nActiveCPU = num; - - pCurrentCPU = m6502CPUContext[num]; - - m6502_set_context(&pCurrentCPU->reg); - - nM6502CyclesTotal = nM6502CyclesDone[nActiveCPU]; -} - -void M6502Close() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502Close called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502Close called with no CPU open\n")); -#endif - - m6502_get_context(&pCurrentCPU->reg); - - nM6502CyclesDone[nActiveCPU] = nM6502CyclesTotal; - - pCurrentCPU = NULL; // cause problems! - - nActiveCPU = -1; -} - -INT32 M6502GetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502GetActive called without init\n")); - //if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502GetActive called with no CPU open\n")); -#endif - - return nActiveCPU; -} - -void M6502Idle(INT32 nCycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502Idle called without init\n")); -#endif - - nM6502CyclesTotal += nCycles; -} - -void M6502ReleaseSlice() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502ReleaseSlice called without init\n")); -#endif - - m6502_releaseslice(); -} - -void M6502SetIRQLine(INT32 vector, INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502SetIRQLineLine called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502SetIRQLineLine called with no CPU open\n")); -#endif - - if (status == CPU_IRQSTATUS_NONE) { - pCurrentCPU->set_irq_line(vector, 0); - return; - } - - if (status == CPU_IRQSTATUS_ACK) { - pCurrentCPU->set_irq_line(vector, 1); - return; - } - - if (status == CPU_IRQSTATUS_AUTO) { - if (vector == CPU_IRQLINE_NMI /* 0x20 */) { - pCurrentCPU->set_irq_line(vector, 1); - pCurrentCPU->set_irq_line(vector, 0); - return; - } else { - pCurrentCPU->set_irq_line(vector, 1); - pCurrentCPU->execute(0); - pCurrentCPU->set_irq_line(vector, 0); - pCurrentCPU->execute(0); - return; - } - } - - if (status == CPU_IRQSTATUS_HOLD) { - m6502_set_irq_hold(); - pCurrentCPU->set_irq_line(vector, 1); - return; - } -} - -INT32 M6502Run(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502Run called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502Run called with no CPU open\n")); -#endif - - cycles = pCurrentCPU->execute(cycles); - - nM6502CyclesTotal += cycles; - - return cycles; -} - -void M6502RunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502RunEnd called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502RunEnd called with no CPU open\n")); -#endif -} - -INT32 M6502MapMemory(UINT8* pMemory, UINT16 nStart, UINT16 nEnd, INT32 nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502MapMemory called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502MapMemory called with no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = pCurrentCPU->pMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - if (nType & MAP_READ) { - pMemMap[0 + i] = pMemory + ((i - cStart) << 8); - } - if (nType & MAP_WRITE) { - pMemMap[0x100 + i] = pMemory + ((i - cStart) << 8); - } - if (nType & MAP_FETCH) { - pMemMap[0x200 + i] = pMemory + ((i - cStart) << 8); - } - } - return 0; - -} - -void M6502SetReadPortHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502SetReadPortHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502SetReadPortHandler called with no CPU open\n")); -#endif - - pCurrentCPU->ReadPort = pHandler; -} - -void M6502SetWritePortHandler(void (*pHandler)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502SetWritePortHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502SetWritePortHandler called with no CPU open\n")); -#endif - - pCurrentCPU->WritePort = pHandler; -} - -void M6502SetReadHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502SetReadHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502SetReadHandler called with no CPU open\n")); -#endif - - pCurrentCPU->ReadByte = pHandler; -} - -void M6502SetWriteHandler(void (*pHandler)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502SetWriteHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502SetWriteHandler called with no CPU open\n")); -#endif - - pCurrentCPU->WriteByte = pHandler; -} - -void M6502SetReadOpHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502SetReadOpHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502SetReadOpHandler called with no CPU open\n")); -#endif - - pCurrentCPU->ReadOp = pHandler; -} - -void M6502SetReadOpArgHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502SetReadOpArgHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502SetReadOpArgHandler called with no CPU open\n")); -#endif - - pCurrentCPU->ReadOpArg = pHandler; -} - -UINT8 M6502ReadPort(UINT16 Address) -{ - // check handler - if (pCurrentCPU->ReadPort != NULL) { - return pCurrentCPU->ReadPort(Address); - } - - return 0; -} - -void M6502WritePort(UINT16 Address, UINT8 Data) -{ - // check handler - if (pCurrentCPU->WritePort != NULL) { - pCurrentCPU->WritePort(Address, Data); - return; - } -} - -UINT8 M6502ReadByte(UINT16 Address) -{ - // check mem map - UINT8 * pr = pCurrentCPU->pMemMap[0x000 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (pCurrentCPU->ReadByte != NULL) { - return pCurrentCPU->ReadByte(Address); - } - - return 0; -} - -void M6502WriteByte(UINT16 Address, UINT8 Data) -{ - // check mem map - UINT8 * pr = pCurrentCPU->pMemMap[0x100 | (Address >> 8)]; - if (pr != NULL) { - pr[Address & 0xff] = Data; - return; - } - - // check handler - if (pCurrentCPU->WriteByte != NULL) { - pCurrentCPU->WriteByte(Address, Data); - return; - } -} - -UINT8 M6502ReadOp(UINT16 Address) -{ - // check mem map - UINT8 * pr = pCurrentCPU->pMemMap[0x200 | (Address >> 8)]; - if (pr != NULL) { - return pCurrentCPU->opcode_reorder[pr[Address & 0xff]]; - } - - // check handler - if (pCurrentCPU->ReadOp != NULL) { - return pCurrentCPU->opcode_reorder[pCurrentCPU->ReadOp(Address)]; - } - - return 0; -} - -UINT8 M6502ReadOpArg(UINT16 Address) -{ - // check mem map - UINT8 * pr = pCurrentCPU->pMemMap[0x000 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (pCurrentCPU->ReadOpArg != NULL) { - return pCurrentCPU->ReadOpArg(Address); - } - - return 0; -} - -void M6502WriteRom(UINT32 Address, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502WriteRom called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502WriteRom called with no CPU open\n")); -#endif - - Address &= 0xffff; - - UINT8 * pr = pCurrentCPU->pMemMap[0x000 | (Address >> 8)]; - UINT8 * pw = pCurrentCPU->pMemMap[0x100 | (Address >> 8)]; - UINT8 * pf = pCurrentCPU->pMemMap[0x200 | (Address >> 8)]; - - if (pr != NULL) { - pr[Address & 0xff] = Data; - } - - if (pw != NULL) { - pw[Address & 0xff] = Data; - } - - if (pf != NULL) { - pf[Address & 0xff] = Data; - } - - // check handler - if (pCurrentCPU->WriteByte != NULL) { - pCurrentCPU->WriteByte(Address, Data); - return; - } -} - -UINT32 M6502GetPC(INT32) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502GetPC called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502GetPC called with no CPU open\n")); -#endif - - return m6502_get_pc(); -} - -UINT32 M6502GetPrevPC(INT32) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502GetPrevPC called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6502GetPrevPC called with no CPU open\n")); -#endif - - return m6502_get_prev_pc(); -} - -INT32 M6502Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502Scan called without init\n")); -#endif - - struct BurnArea ba; - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - for (INT32 i = 0; i < nM6502Count; i++) { - - M6502Ext *ptr = m6502CPUContext[i]; - - INT32 (*Callback)(INT32 irqline); - - Callback = ptr->reg.irq_callback; - - char szName[] = "M6502 #n"; - szName[7] = '0' + i; - - ba.Data = &ptr->reg; - ba.nLen = sizeof(m6502_Regs); - ba.szName = szName; - BurnAcb(&ba); - - // necessary? - SCAN_VAR(ptr->nCyclesTotal); - SCAN_VAR(ptr->nCyclesSegment); - SCAN_VAR(ptr->nCyclesLeft); - - ptr->reg.irq_callback = Callback; - } - - return 0; -} diff --git a/jan/src/cpu/m6502_intf.h b/jan/src/cpu/m6502_intf.h deleted file mode 100644 index efedeadda..000000000 --- a/jan/src/cpu/m6502_intf.h +++ /dev/null @@ -1,90 +0,0 @@ -#include "m6502/m6502.h" - -typedef UINT8 (*pReadPortHandler)(UINT16 a); -typedef void (*pWritePortHandler)(UINT16 a, UINT8 d); -typedef UINT8 (*pReadByteHandler)(UINT16 a); -typedef void (*pWriteByteHandler)(UINT16 a, UINT8 d); -typedef UINT8 (*pReadOpHandler)(UINT16 a); -typedef UINT8 (*pReadOpArgHandler)(UINT16 a); - -struct M6502Ext { - - m6502_Regs reg; - - INT32 (*execute)(INT32 cycles); - void (*reset)(); - void (*init)(); - void (*set_irq_line)(INT32 irqline, INT32 state); - - UINT8* pMemMap[0x100 * 3]; - UINT8 opcode_reorder[0x100]; - - pReadPortHandler ReadPort; - pWritePortHandler WritePort; - pReadByteHandler ReadByte; - pWriteByteHandler WriteByte; - pReadOpHandler ReadOp; - pReadOpArgHandler ReadOpArg; - - INT32 nCyclesTotal; - INT32 nCyclesSegment; - INT32 nCyclesLeft; -}; - -extern INT32 nM6502Count; - -extern INT32 nM6502CyclesTotal; - -void M6502Reset(); -void M6502NewFrame(); - -void n2a03_irq(void); // USED FOR PSG!! - -// use these at addresses 0 and 1 for M6510, M6510T, M7501, M8502 map! -UINT8 m6510_read_0000(UINT16 offset); -void m6510_write_0000(UINT16 address, UINT8 data); - -// The M6504 only has 13 address bits! use address mirroring! - -enum { TYPE_M6502=0, TYPE_M6504, TYPE_M65C02, TYPE_M65SC02, TYPE_N2A03, TYPE_DECO16, -// these are the same! - TYPE_M6510, TYPE_M6510T, TYPE_M7501, TYPE_M8502, -// these involve encryption - TYPE_DECOCPU7, TYPE_DECO222, TYPE_DECOC10707 -}; - -INT32 M6502Init(INT32 cpu, INT32 type); // if you're using more than one type -void M6502Exit(); -void M6502Open(INT32 num); -void M6502Close(); -INT32 M6502GetActive(); -void M6502Idle(INT32 nCycles); -void M6502ReleaseSlice(); -void M6502SetIRQLine(INT32 vector, INT32 status); -INT32 M6502Run(INT32 cycles); -void M6502RunEnd(); -INT32 M6502MapMemory(UINT8* pMemory, UINT16 nStart, UINT16 nEnd, INT32 nType); -void M6502SetReadPortHandler(UINT8 (*pHandler)(UINT16)); -void M6502SetWritePortHandler(void (*pHandler)(UINT16, UINT8)); -void M6502SetReadHandler(UINT8 (*pHandler)(UINT16)); -void M6502SetWriteHandler(void (*pHandler)(UINT16, UINT8)); -void M6502SetReadOpHandler(UINT8 (*pHandler)(UINT16)); -void M6502SetReadOpArgHandler(UINT8 (*pHandler)(UINT16)); -INT32 M6502Scan(INT32 nAction); - -UINT32 M6502GetPC(INT32); -UINT32 M6502GetPrevPC(INT32); - -void M6502WriteRom(UINT32 Address, UINT8 Data); - -inline static INT32 M6502TotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6502Initted) bprintf(PRINT_ERROR, _T("M6502TotalCycles called without init\n")); -#endif - - return nM6502CyclesTotal; -} - -// m6502.cpp used for Data East encrypted CPUs. -void DecoCpu7SetDecode(UINT8 (*write)(UINT16,UINT8)); diff --git a/jan/src/cpu/m6800/6800ops.c b/jan/src/cpu/m6800/6800ops.c deleted file mode 100644 index 342348421..000000000 --- a/jan/src/cpu/m6800/6800ops.c +++ /dev/null @@ -1,2140 +0,0 @@ - -/* - -HNZVC - -? = undefined -* = affected -- = unaffected -0 = cleared -1 = set -# = ccr directly affected by instruction -@ = special - carry set if bit 7 is set - -*/ - -//M6800_INLINE void illegal( void ) -static void illegal( void ) -{ -// logerror("M6808: illegal opcode: address %04X, op %02X\n",PC,(int) M_RDOP_ARG(PC)&0xFF); -} - -/* HD63701 only */ -#if (HAS_HD63701) -//M6800_INLINE void trap( void ) -static void trap( void ) -{ -// logerror("M6808: illegal opcode: address %04X, op %02X\n",PC,(int) M_RDOP_ARG(PC)&0xFF); - TAKE_TRAP; -} -#endif - -/* $00 ILLEGAL */ - -/* $01 NOP */ -M6800_INLINE void nop( void ) -{ -} - -/* $02 ILLEGAL */ - -/* $03 ILLEGAL */ - -/* $04 LSRD inherent -0*-* */ -M6800_INLINE void lsrd (void) -{ - UINT16 t; - CLR_NZC; t = D; CC|=(t&0x0001); - t>>=1; SET_Z16(t); D=t; -} - -/* $05 ASLD inherent ?**** */ -M6800_INLINE void asld (void) -{ - int r; - UINT16 t; - t = D; r=t<<1; - CLR_NZVC; SET_FLAGS16(t,t,r); - D=r; -} - -/* $06 TAP inherent ##### */ -M6800_INLINE void tap (void) -{ - CC=A; - ONE_MORE_INSN(); - CHECK_IRQ_LINES(); /* HJB 990417 */ -} - -/* $07 TPA inherent ----- */ -M6800_INLINE void tpa (void) -{ - A=CC; -} - -/* $08 INX inherent --*-- */ -M6800_INLINE void inx (void) -{ - ++X; - CLR_Z; SET_Z16(X); -} - -/* $09 DEX inherent --*-- */ -M6800_INLINE void dex (void) -{ - --X; - CLR_Z; SET_Z16(X); -} - -/* $0a CLV */ -M6800_INLINE void clv (void) -{ - CLV; -} - -/* $0b SEV */ -M6800_INLINE void sev (void) -{ - SEV; -} - -/* $0c CLC */ -M6800_INLINE void clc (void) -{ - CLC; -} - -/* $0d SEC */ -M6800_INLINE void sec (void) -{ - SEC; -} - -/* $0e CLI */ -M6800_INLINE void cli (void) -{ - CLI; - ONE_MORE_INSN(); - CHECK_IRQ_LINES(); /* HJB 990417 */ -} - -/* $0f SEI */ -M6800_INLINE void sei (void) -{ - SEI; - ONE_MORE_INSN(); - CHECK_IRQ_LINES(); /* HJB 990417 */ -} - -/* $10 SBA inherent -**** */ -M6800_INLINE void sba (void) -{ - UINT16 t; - t=A-B; - CLR_NZVC; SET_FLAGS8(A,B,t); - A=t; -} - -/* $11 CBA inherent -**** */ -M6800_INLINE void cba (void) -{ - UINT16 t; - t=A-B; - CLR_NZVC; SET_FLAGS8(A,B,t); -} - -/* $12 ILLEGAL */ -M6800_INLINE void undoc1 (void) -{ - X += RM( S + 1 ); -} - -/* $13 ILLEGAL */ -M6800_INLINE void undoc2 (void) -{ - X += RM( S + 1 ); -} - - -/* $14 ILLEGAL */ - -/* $15 ILLEGAL */ - -/* $16 TAB inherent -**0- */ -M6800_INLINE void tab (void) -{ - B=A; - CLR_NZV; SET_NZ8(B); -} - -/* $17 TBA inherent -**0- */ -M6800_INLINE void tba (void) -{ - A=B; - CLR_NZV; SET_NZ8(A); -} - -/* $18 XGDX inherent ----- */ /* HD63701YO only */ -M6800_INLINE void xgdx( void ) -{ - UINT16 t = X; - X = D; - D=t; -} - -/* $19 DAA inherent (A) -**0* */ -M6800_INLINE void daa( void ) -{ - UINT8 msn, lsn; - UINT16 t, cf = 0; - msn=A & 0xf0; lsn=A & 0x0f; - if( lsn>0x09 || CC&0x20 ) cf |= 0x06; - if( msn>0x80 && lsn>0x09 ) cf |= 0x60; - if( msn>0x90 || CC&0x01 ) cf |= 0x60; - t = cf + A; - CLR_NZV; /* keep carry from previous operation */ - SET_NZ8((UINT8)t); SET_C8(t); - A = t; -} - -/* $1a ILLEGAL */ - -#if (HAS_HD63701) -/* $1a SLP */ /* HD63701YO only */ -M6800_INLINE void slp (void) -{ - /* wait for next IRQ (same as waiting of wai) */ - m6808.wai_state |= HD63701_SLP; - EAT_CYCLES; -} -#endif - -/* $1b ABA inherent ***** */ -M6800_INLINE void aba (void) -{ - UINT16 t; - t=A+B; - CLR_HNZVC; SET_FLAGS8(A,B,t); SET_H(A,B,t); - A=t; -} - -/* $1c ILLEGAL */ - -/* $1d ILLEGAL */ - -/* $1e ILLEGAL */ - -/* $1f ILLEGAL */ - -/* $20 BRA relative ----- */ -M6800_INLINE void bra( void ) -{ - UINT8 t; - IMMBYTE(t);PC+=SIGNED(t);CHANGE_PC(); - /* speed up busy loops */ - if (t==0xfe) EAT_CYCLES; -} - -/* $21 BRN relative ----- */ -M6800_INLINE void brn( void ) -{ - UINT8 t; - IMMBYTE(t); -} - -/* $22 BHI relative ----- */ -M6800_INLINE void bhi( void ) -{ - UINT8 t; - BRANCH(!(CC&0x05)); -} - -/* $23 BLS relative ----- */ -M6800_INLINE void bls( void ) -{ - UINT8 t; - BRANCH(CC&0x05); -} - -/* $24 BCC relative ----- */ -M6800_INLINE void bcc( void ) -{ - UINT8 t; - BRANCH(!(CC&0x01)); -} - -/* $25 BCS relative ----- */ -M6800_INLINE void bcs( void ) -{ - UINT8 t; - BRANCH(CC&0x01); -} - -/* $26 BNE relative ----- */ -M6800_INLINE void bne( void ) -{ - UINT8 t; - BRANCH(!(CC&0x04)); -} - -/* $27 BEQ relative ----- */ -M6800_INLINE void beq( void ) -{ - UINT8 t; - BRANCH(CC&0x04); -} - -/* $28 BVC relative ----- */ -M6800_INLINE void bvc( void ) -{ - UINT8 t; - BRANCH(!(CC&0x02)); -} - -/* $29 BVS relative ----- */ -M6800_INLINE void bvs( void ) -{ - UINT8 t; - BRANCH(CC&0x02); -} - -/* $2a BPL relative ----- */ -M6800_INLINE void bpl( void ) -{ - UINT8 t; - BRANCH(!(CC&0x08)); -} - -/* $2b BMI relative ----- */ -M6800_INLINE void bmi( void ) -{ - UINT8 t; - BRANCH(CC&0x08); -} - -/* $2c BGE relative ----- */ -M6800_INLINE void bge( void ) -{ - UINT8 t; - BRANCH(!NXORV); -} - -/* $2d BLT relative ----- */ -M6800_INLINE void blt( void ) -{ - UINT8 t; - BRANCH(NXORV); -} - -/* $2e BGT relative ----- */ -M6800_INLINE void bgt( void ) -{ - UINT8 t; - BRANCH(!(NXORV||CC&0x04)); -} - -/* $2f BLE relative ----- */ -M6800_INLINE void ble( void ) -{ - UINT8 t; - BRANCH(NXORV||CC&0x04); -} - -/* $30 TSX inherent ----- */ -M6800_INLINE void tsx (void) -{ - X = ( S + 1 ); -} - -/* $31 INS inherent ----- */ -M6800_INLINE void ins (void) -{ - ++S; -} - -/* $32 PULA inherent ----- */ -M6800_INLINE void pula (void) -{ - PULLBYTE(m6808.d.b.h); -} - -/* $33 PULB inherent ----- */ -M6800_INLINE void pulb (void) -{ - PULLBYTE(m6808.d.b.l); -} - -/* $34 DES inherent ----- */ -M6800_INLINE void des (void) -{ - --S; -} - -/* $35 TXS inherent ----- */ -M6800_INLINE void txs (void) -{ - S = ( X - 1 ); -} - -/* $36 PSHA inherent ----- */ -M6800_INLINE void psha (void) -{ - PUSHBYTE(m6808.d.b.h); -} - -/* $37 PSHB inherent ----- */ -M6800_INLINE void pshb (void) -{ - PUSHBYTE(m6808.d.b.l); -} - -/* $38 PULX inherent ----- */ -M6800_INLINE void pulx (void) -{ - PULLWORD(pX); -} - -/* $39 RTS inherent ----- */ -M6800_INLINE void rts( void ) -{ - PULLWORD(pPC); - CHANGE_PC(); -} - -/* $3a ABX inherent ----- */ -M6800_INLINE void abx( void ) -{ - X += B; -} - -/* $3b RTI inherent ##### */ -M6800_INLINE void rti( void ) -{ - PULLBYTE(CC); - PULLBYTE(B); - PULLBYTE(A); - PULLWORD(pX); - PULLWORD(pPC); - CHANGE_PC(); - CHECK_IRQ_LINES(); /* HJB 990417 */ -} - -/* $3c PSHX inherent ----- */ -M6800_INLINE void pshx (void) -{ - PUSHWORD(pX); -} - -/* $3d MUL inherent --*-@ */ -M6800_INLINE void mul( void ) -{ - UINT16 t; - t=A*B; - CLR_C; if(t&0x80) SEC; - D=t; -} - -/* $3e WAI inherent ----- */ -M6800_INLINE void wai( void ) -{ - /* - * WAI stacks the entire machine state on the - * hardware stack, then waits for an interrupt. - */ - m6808.wai_state |= M6800_WAI; - PUSHWORD(pPC); - PUSHWORD(pX); - PUSHBYTE(A); - PUSHBYTE(B); - PUSHBYTE(CC); - CHECK_IRQ_LINES(); - if (m6808.wai_state & M6800_WAI) EAT_CYCLES; -} - -/* $3f SWI absolute indirect ----- */ -M6800_INLINE void swi( void ) -{ - PUSHWORD(pPC); - PUSHWORD(pX); - PUSHBYTE(A); - PUSHBYTE(B); - PUSHBYTE(CC); - SEI; - PCD = RM16(0xfffa); - CHANGE_PC(); -} - -/* $40 NEGA inherent ?**** */ -M6800_INLINE void nega( void ) -{ - UINT16 r; - r=-A; - CLR_NZVC; SET_FLAGS8(0,A,r); - A=r; -} - -/* $41 ILLEGAL */ - -/* $42 ILLEGAL */ - -/* $43 COMA inherent -**01 */ -M6800_INLINE void coma( void ) -{ - A = ~A; - CLR_NZV; SET_NZ8(A); SEC; -} - -/* $44 LSRA inherent -0*-* */ -M6800_INLINE void lsra( void ) -{ - CLR_NZC; CC|=(A&0x01); - A>>=1; SET_Z8(A); -} - -/* $45 ILLEGAL */ - -/* $46 RORA inherent -**-* */ -M6800_INLINE void rora( void ) -{ - UINT8 r; - r=(CC&0x01)<<7; - CLR_NZC; CC|=(A&0x01); - r |= A>>1; SET_NZ8(r); - A=r; -} - -/* $47 ASRA inherent ?**-* */ -M6800_INLINE void asra( void ) -{ - CLR_NZC; CC|=(A&0x01); - A>>=1; A|=((A&0x40)<<1); - SET_NZ8(A); -} - -/* $48 ASLA inherent ?**** */ -M6800_INLINE void asla( void ) -{ - UINT16 r; - r=A<<1; - CLR_NZVC; SET_FLAGS8(A,A,r); - A=r; -} - -/* $49 ROLA inherent -**** */ -M6800_INLINE void rola( void ) -{ - UINT16 t,r; - t = A; r = CC&0x01; r |= t<<1; - CLR_NZVC; SET_FLAGS8(t,t,r); - A=r; -} - -/* $4a DECA inherent -***- */ -M6800_INLINE void deca( void ) -{ - --A; - CLR_NZV; SET_FLAGS8D(A); -} - -/* $4b ILLEGAL */ - -/* $4c INCA inherent -***- */ -M6800_INLINE void inca( void ) -{ - ++A; - CLR_NZV; SET_FLAGS8I(A); -} - -/* $4d TSTA inherent -**0- */ -M6800_INLINE void tsta( void ) -{ - CLR_NZVC; SET_NZ8(A); -} - -/* $4e ILLEGAL */ - -/* $4f CLRA inherent -0100 */ -M6800_INLINE void clra( void ) -{ - A=0; - CLR_NZVC; SEZ; -} - -/* $50 NEGB inherent ?**** */ -M6800_INLINE void negb( void ) -{ - UINT16 r; - r=-B; - CLR_NZVC; SET_FLAGS8(0,B,r); - B=r; -} - -/* $51 ILLEGAL */ - -/* $52 ILLEGAL */ - -/* $53 COMB inherent -**01 */ -M6800_INLINE void comb( void ) -{ - B = ~B; - CLR_NZV; SET_NZ8(B); SEC; -} - -/* $54 LSRB inherent -0*-* */ -M6800_INLINE void lsrb( void ) -{ - CLR_NZC; CC|=(B&0x01); - B>>=1; SET_Z8(B); -} - -/* $55 ILLEGAL */ - -/* $56 RORB inherent -**-* */ -M6800_INLINE void rorb( void ) -{ - UINT8 r; - r=(CC&0x01)<<7; - CLR_NZC; CC|=(B&0x01); - r |= B>>1; SET_NZ8(r); - B=r; -} - -/* $57 ASRB inherent ?**-* */ -M6800_INLINE void asrb( void ) -{ - CLR_NZC; CC|=(B&0x01); - B>>=1; B|=((B&0x40)<<1); - SET_NZ8(B); -} - -/* $58 ASLB inherent ?**** */ -M6800_INLINE void aslb( void ) -{ - UINT16 r; - r=B<<1; - CLR_NZVC; SET_FLAGS8(B,B,r); - B=r; -} - -/* $59 ROLB inherent -**** */ -M6800_INLINE void rolb( void ) -{ - UINT16 t,r; - t = B; r = CC&0x01; r |= t<<1; - CLR_NZVC; SET_FLAGS8(t,t,r); - B=r; -} - -/* $5a DECB inherent -***- */ -M6800_INLINE void decb( void ) -{ - --B; - CLR_NZV; SET_FLAGS8D(B); -} - -/* $5b ILLEGAL */ - -/* $5c INCB inherent -***- */ -M6800_INLINE void incb( void ) -{ - ++B; - CLR_NZV; SET_FLAGS8I(B); -} - -/* $5d TSTB inherent -**0- */ -M6800_INLINE void tstb( void ) -{ - CLR_NZVC; SET_NZ8(B); -} - -/* $5e ILLEGAL */ - -/* $5f CLRB inherent -0100 */ -M6800_INLINE void clrb( void ) -{ - B=0; - CLR_NZVC; SEZ; -} - -/* $60 NEG indexed ?**** */ -M6800_INLINE void neg_ix( void ) -{ - UINT16 r,t; - IDXBYTE(t); r=-t; - CLR_NZVC; SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $61 AIM --**0- */ /* HD63701YO only */ -M6800_INLINE void aim_ix( void ) -{ - UINT8 t, r; - IMMBYTE(t); - IDXBYTE(r); - r &= t; - CLR_NZV; SET_NZ8(r); - WM(EAD,r); -} - -/* $62 OIM --**0- */ /* HD63701YO only */ -M6800_INLINE void oim_ix( void ) -{ - UINT8 t, r; - IMMBYTE(t); - IDXBYTE(r); - r |= t; - CLR_NZV; SET_NZ8(r); - WM(EAD,r); -} - -/* $63 COM indexed -**01 */ -M6800_INLINE void com_ix( void ) -{ - UINT8 t; - IDXBYTE(t); t = ~t; - CLR_NZV; SET_NZ8(t); SEC; - WM(EAD,t); -} - -/* $64 LSR indexed -0*-* */ -M6800_INLINE void lsr_ix( void ) -{ - UINT8 t; - IDXBYTE(t); CLR_NZC; CC|=(t&0x01); - t>>=1; SET_Z8(t); - WM(EAD,t); -} - -/* $65 EIM --**0- */ /* HD63701YO only */ -M6800_INLINE void eim_ix( void ) -{ - UINT8 t, r; - IMMBYTE(t); - IDXBYTE(r); - r ^= t; - CLR_NZV; SET_NZ8(r); - WM(EAD,r); -} - -/* $66 ROR indexed -**-* */ -M6800_INLINE void ror_ix( void ) -{ - UINT8 t,r; - IDXBYTE(t); r=(CC&0x01)<<7; - CLR_NZC; CC|=(t&0x01); - r |= t>>1; SET_NZ8(r); - WM(EAD,r); -} - -/* $67 ASR indexed ?**-* */ -M6800_INLINE void asr_ix( void ) -{ - UINT8 t; - IDXBYTE(t); CLR_NZC; CC|=(t&0x01); - t>>=1; t|=((t&0x40)<<1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $68 ASL indexed ?**** */ -M6800_INLINE void asl_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r=t<<1; - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $69 ROL indexed -**** */ -M6800_INLINE void rol_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = CC&0x01; r |= t<<1; - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $6a DEC indexed -***- */ -M6800_INLINE void dec_ix( void ) -{ - UINT8 t; - IDXBYTE(t); --t; - CLR_NZV; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $6b TIM --**0- */ /* HD63701YO only */ -M6800_INLINE void tim_ix( void ) -{ - UINT8 t, r; - IMMBYTE(t); - IDXBYTE(r); - r &= t; - CLR_NZV; SET_NZ8(r); -} - -/* $6c INC indexed -***- */ -M6800_INLINE void inc_ix( void ) -{ - UINT8 t; - IDXBYTE(t); ++t; - CLR_NZV; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $6d TST indexed -**0- */ -M6800_INLINE void tst_ix( void ) -{ - UINT8 t; - IDXBYTE(t); CLR_NZVC; SET_NZ8(t); -} - -/* $6e JMP indexed ----- */ -M6800_INLINE void jmp_ix( void ) -{ - INDEXED; PC=EA; CHANGE_PC(); -} - -/* $6f CLR indexed -0100 */ -M6800_INLINE void clr_ix( void ) -{ - INDEXED; WM(EAD,0); - CLR_NZVC; SEZ; -} - -/* $70 NEG extended ?**** */ -M6800_INLINE void neg_ex( void ) -{ - UINT16 r,t; - EXTBYTE(t); r=-t; - CLR_NZVC; SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $71 AIM --**0- */ /* HD63701YO only */ -M6800_INLINE void aim_di( void ) -{ - UINT8 t, r; - IMMBYTE(t); - DIRBYTE(r); - r &= t; - CLR_NZV; SET_NZ8(r); - WM(EAD,r); -} - -/* $72 OIM --**0- */ /* HD63701YO only */ -M6800_INLINE void oim_di( void ) -{ - UINT8 t, r; - IMMBYTE(t); - DIRBYTE(r); - r |= t; - CLR_NZV; SET_NZ8(r); - WM(EAD,r); -} - -/* $73 COM extended -**01 */ -M6800_INLINE void com_ex( void ) -{ - UINT8 t; - EXTBYTE(t); t = ~t; - CLR_NZV; SET_NZ8(t); SEC; - WM(EAD,t); -} - -/* $74 LSR extended -0*-* */ -M6800_INLINE void lsr_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - CLR_NZC; - CC|=(t&0x01); - t>>=1; - SET_Z8(t); - WM(EAD,t); -} - -/* $75 EIM --**0- */ /* HD63701YO only */ -M6800_INLINE void eim_di( void ) -{ - UINT8 t, r; - IMMBYTE(t); - DIRBYTE(r); - r ^= t; - CLR_NZV; SET_NZ8(r); - WM(EAD,r); -} - -/* $76 ROR extended -**-* */ -M6800_INLINE void ror_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); r=(CC&0x01)<<7; - CLR_NZC; CC|=(t&0x01); - r |= t>>1; SET_NZ8(r); - WM(EAD,r); -} - -/* $77 ASR extended ?**-* */ -M6800_INLINE void asr_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZC; CC|=(t&0x01); - t>>=1; t|=((t&0x40)<<1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $78 ASL extended ?**** */ -M6800_INLINE void asl_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r=t<<1; - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $79 ROL extended -**** */ -M6800_INLINE void rol_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = CC&0x01; r |= t<<1; - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $7a DEC extended -***- */ -M6800_INLINE void dec_ex( void ) -{ - UINT8 t; - EXTBYTE(t); --t; - CLR_NZV; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $7b TIM --**0- */ /* HD63701YO only */ -M6800_INLINE void tim_di( void ) -{ - UINT8 t, r; - IMMBYTE(t); - DIRBYTE(r); - r &= t; - CLR_NZV; SET_NZ8(r); -} - -/* $7c INC extended -***- */ -M6800_INLINE void inc_ex( void ) -{ - UINT8 t; - EXTBYTE(t); ++t; - CLR_NZV; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $7d TST extended -**0- */ -M6800_INLINE void tst_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZVC; SET_NZ8(t); -} - -/* $7e JMP extended ----- */ -M6800_INLINE void jmp_ex( void ) -{ - EXTENDED; PC=EA; CHANGE_PC(); /* TS 971002 */ -} - -/* $7f CLR extended -0100 */ -M6800_INLINE void clr_ex( void ) -{ - EXTENDED; WM(EAD,0); - CLR_NZVC; SEZ; -} - -/* $80 SUBA immediate ?**** */ -M6800_INLINE void suba_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = A-t; - CLR_NZVC; SET_FLAGS8(A,t,r); - A = r; -} - -/* $81 CMPA immediate ?**** */ -M6800_INLINE void cmpa_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = A-t; - CLR_NZVC; SET_FLAGS8(A,t,r); -} - -/* $82 SBCA immediate ?**** */ -M6800_INLINE void sbca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = A-t-(CC&0x01); - CLR_NZVC; SET_FLAGS8(A,t,r); - A = r; -} - -/* $83 SUBD immediate -**** */ -M6800_INLINE void subd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $84 ANDA immediate -**0- */ -M6800_INLINE void anda_im( void ) -{ - UINT8 t; - IMMBYTE(t); A &= t; - CLR_NZV; SET_NZ8(A); -} - -/* $85 BITA immediate -**0- */ -M6800_INLINE void bita_im( void ) -{ - UINT8 t,r; - IMMBYTE(t); r = A&t; - CLR_NZV; SET_NZ8(r); -} - -/* $86 LDA immediate -**0- */ -M6800_INLINE void lda_im( void ) -{ - IMMBYTE(A); - CLR_NZV; SET_NZ8(A); -} - -/* is this a legal instruction? */ -/* $87 STA immediate -**0- */ -M6800_INLINE void sta_im( void ) -{ - CLR_NZV; SET_NZ8(A); - IMM8; WM(EAD,A); -} - -/* $88 EORA immediate -**0- */ -M6800_INLINE void eora_im( void ) -{ - UINT8 t; - IMMBYTE(t); A ^= t; - CLR_NZV; SET_NZ8(A); -} - -/* $89 ADCA immediate ***** */ -M6800_INLINE void adca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = A+t+(CC&0x01); - CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); - A = r; -} - -/* $8a ORA immediate -**0- */ -M6800_INLINE void ora_im( void ) -{ - UINT8 t; - IMMBYTE(t); A |= t; - CLR_NZV; SET_NZ8(A); -} - -/* $8b ADDA immediate ***** */ -M6800_INLINE void adda_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = A+t; - CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); - A = r; -} - -/* $8c CMPX immediate -***- */ -M6800_INLINE void cmpx_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = X; - r = d - b.d; - CLR_NZV; - SET_NZ16(r); SET_V16(d,b.d,r); -} - -/* $8c CPX immediate -**** (6803) */ -M6800_INLINE void cpx_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; SET_FLAGS16(d,b.d,r); -} - - -/* $8d BSR ----- */ -M6800_INLINE void bsr( void ) -{ - UINT8 t; - IMMBYTE(t); - PUSHWORD(pPC); - PC += SIGNED(t); - CHANGE_PC(); /* TS 971002 */ -} - -/* $8e LDS immediate -**0- */ -M6800_INLINE void lds_im( void ) -{ - IMMWORD(m6808.s); - CLR_NZV; - SET_NZ16(S); -} - -/* $8f STS immediate -**0- */ -M6800_INLINE void sts_im( void ) -{ - CLR_NZV; - SET_NZ16(S); - IMM16; - WM16(EAD,&m6808.s); -} - -/* $90 SUBA direct ?**** */ -M6800_INLINE void suba_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = A-t; - CLR_NZVC; SET_FLAGS8(A,t,r); - A = r; -} - -/* $91 CMPA direct ?**** */ -M6800_INLINE void cmpa_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = A-t; - CLR_NZVC; SET_FLAGS8(A,t,r); -} - -/* $92 SBCA direct ?**** */ -M6800_INLINE void sbca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = A-t-(CC&0x01); - CLR_NZVC; SET_FLAGS8(A,t,r); - A = r; -} - -/* $93 SUBD direct -**** */ -M6800_INLINE void subd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D=r; -} - -/* $94 ANDA direct -**0- */ -M6800_INLINE void anda_di( void ) -{ - UINT8 t; - DIRBYTE(t); A &= t; - CLR_NZV; SET_NZ8(A); -} - -/* $95 BITA direct -**0- */ -M6800_INLINE void bita_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); r = A&t; - CLR_NZV; SET_NZ8(r); -} - -/* $96 LDA direct -**0- */ -M6800_INLINE void lda_di( void ) -{ - DIRBYTE(A); - CLR_NZV; SET_NZ8(A); -} - -/* $97 STA direct -**0- */ -M6800_INLINE void sta_di( void ) -{ - CLR_NZV; SET_NZ8(A); - DIRECT; WM(EAD,A); -} - -/* $98 EORA direct -**0- */ -M6800_INLINE void eora_di( void ) -{ - UINT8 t; - DIRBYTE(t); A ^= t; - CLR_NZV; SET_NZ8(A); -} - -/* $99 ADCA direct ***** */ -M6800_INLINE void adca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = A+t+(CC&0x01); - CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); - A = r; -} - -/* $9a ORA direct -**0- */ -M6800_INLINE void ora_di( void ) -{ - UINT8 t; - DIRBYTE(t); A |= t; - CLR_NZV; SET_NZ8(A); -} - -/* $9b ADDA direct ***** */ -M6800_INLINE void adda_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = A+t; - CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); - A = r; -} - -/* $9c CMPX direct -***- */ -M6800_INLINE void cmpx_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = X; - r = d - b.d; - CLR_NZV; - SET_NZ16(r); SET_V16(d,b.d,r); -} - -/* $9c CPX direct -**** (6803) */ -M6800_INLINE void cpx_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; SET_FLAGS16(d,b.d,r); -} - -/* $9d JSR direct ----- */ -M6800_INLINE void jsr_di( void ) -{ - DIRECT; - PUSHWORD(pPC); - PC = EA; - CHANGE_PC(); -} - -/* $9e LDS direct -**0- */ -M6800_INLINE void lds_di( void ) -{ - DIRWORD(m6808.s); - CLR_NZV; - SET_NZ16(S); -} - -/* $9f STS direct -**0- */ -M6800_INLINE void sts_di( void ) -{ - CLR_NZV; - SET_NZ16(S); - DIRECT; - WM16(EAD,&m6808.s); -} - -/* $a0 SUBA indexed ?**** */ -M6800_INLINE void suba_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = A-t; - CLR_NZVC; SET_FLAGS8(A,t,r); - A = r; -} - -/* $a1 CMPA indexed ?**** */ -M6800_INLINE void cmpa_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = A-t; - CLR_NZVC; SET_FLAGS8(A,t,r); -} - -/* $a2 SBCA indexed ?**** */ -M6800_INLINE void sbca_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = A-t-(CC&0x01); - CLR_NZVC; SET_FLAGS8(A,t,r); - A = r; -} - -/* $a3 SUBD indexed -**** */ -M6800_INLINE void subd_ix( void ) -{ - UINT32 r,d; - PAIR b; - IDXWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $a4 ANDA indexed -**0- */ -M6800_INLINE void anda_ix( void ) -{ - UINT8 t; - IDXBYTE(t); A &= t; - CLR_NZV; SET_NZ8(A); -} - -/* $a5 BITA indexed -**0- */ -M6800_INLINE void bita_ix( void ) -{ - UINT8 t,r; - IDXBYTE(t); r = A&t; - CLR_NZV; SET_NZ8(r); -} - -/* $a6 LDA indexed -**0- */ -M6800_INLINE void lda_ix( void ) -{ - IDXBYTE(A); - CLR_NZV; SET_NZ8(A); -} - -/* $a7 STA indexed -**0- */ -M6800_INLINE void sta_ix( void ) -{ - CLR_NZV; SET_NZ8(A); - INDEXED; WM(EAD,A); -} - -/* $a8 EORA indexed -**0- */ -M6800_INLINE void eora_ix( void ) -{ - UINT8 t; - IDXBYTE(t); A ^= t; - CLR_NZV; SET_NZ8(A); -} - -/* $a9 ADCA indexed ***** */ -M6800_INLINE void adca_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = A+t+(CC&0x01); - CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); - A = r; -} - -/* $aa ORA indexed -**0- */ -M6800_INLINE void ora_ix( void ) -{ - UINT8 t; - IDXBYTE(t); A |= t; - CLR_NZV; SET_NZ8(A); -} - -/* $ab ADDA indexed ***** */ -M6800_INLINE void adda_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = A+t; - CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); - A = r; -} - -/* $ac CMPX indexed -***- */ -M6800_INLINE void cmpx_ix( void ) -{ - UINT32 r,d; - PAIR b; - IDXWORD(b); - d = X; - r = d - b.d; - CLR_NZV; - SET_NZ16(r); SET_V16(d,b.d,r); -} - -/* $ac CPX indexed -**** (6803)*/ -M6800_INLINE void cpx_ix( void ) -{ - UINT32 r,d; - PAIR b; - IDXWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; SET_FLAGS16(d,b.d,r); -} - -/* $ad JSR indexed ----- */ -M6800_INLINE void jsr_ix( void ) -{ - INDEXED; - PUSHWORD(pPC); - PC = EA; - CHANGE_PC(); -} - -/* $ae LDS indexed -**0- */ -M6800_INLINE void lds_ix( void ) -{ - IDXWORD(m6808.s); - CLR_NZV; - SET_NZ16(S); -} - -/* $af STS indexed -**0- */ -M6800_INLINE void sts_ix( void ) -{ - CLR_NZV; - SET_NZ16(S); - INDEXED; - WM16(EAD,&m6808.s); -} - -/* $b0 SUBA extended ?**** */ -M6800_INLINE void suba_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = A-t; - CLR_NZVC; SET_FLAGS8(A,t,r); - A = r; -} - -/* $b1 CMPA extended ?**** */ -M6800_INLINE void cmpa_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = A-t; - CLR_NZVC; SET_FLAGS8(A,t,r); -} - -/* $b2 SBCA extended ?**** */ -M6800_INLINE void sbca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = A-t-(CC&0x01); - CLR_NZVC; SET_FLAGS8(A,t,r); - A = r; -} - -/* $b3 SUBD extended -**** */ -M6800_INLINE void subd_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D=r; -} - -/* $b4 ANDA extended -**0- */ -M6800_INLINE void anda_ex( void ) -{ - UINT8 t; - EXTBYTE(t); A &= t; - CLR_NZV; SET_NZ8(A); -} - -/* $b5 BITA extended -**0- */ -M6800_INLINE void bita_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); r = A&t; - CLR_NZV; SET_NZ8(r); -} - -/* $b6 LDA extended -**0- */ -M6800_INLINE void lda_ex( void ) -{ - EXTBYTE(A); - CLR_NZV; SET_NZ8(A); -} - -/* $b7 STA extended -**0- */ -M6800_INLINE void sta_ex( void ) -{ - CLR_NZV; SET_NZ8(A); - EXTENDED; WM(EAD,A); -} - -/* $b8 EORA extended -**0- */ -M6800_INLINE void eora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); A ^= t; - CLR_NZV; SET_NZ8(A); -} - -/* $b9 ADCA extended ***** */ -M6800_INLINE void adca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = A+t+(CC&0x01); - CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); - A = r; -} - -/* $ba ORA extended -**0- */ -M6800_INLINE void ora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); A |= t; - CLR_NZV; SET_NZ8(A); -} - -/* $bb ADDA extended ***** */ -M6800_INLINE void adda_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = A+t; - CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); - A = r; -} - -/* $bc CMPX extended -***- */ -M6800_INLINE void cmpx_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = X; - r = d - b.d; - CLR_NZV; - SET_NZ16(r); SET_V16(d,b.d,r); -} - -/* $bc CPX extended -**** (6803) */ -M6800_INLINE void cpx_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; SET_FLAGS16(d,b.d,r); -} - -/* $bd JSR extended ----- */ -M6800_INLINE void jsr_ex( void ) -{ - EXTENDED; - PUSHWORD(pPC); - PC = EA; - CHANGE_PC(); -} - -/* $be LDS extended -**0- */ -M6800_INLINE void lds_ex( void ) -{ - EXTWORD(m6808.s); - CLR_NZV; - SET_NZ16(S); -} - -/* $bf STS extended -**0- */ -M6800_INLINE void sts_ex( void ) -{ - CLR_NZV; - SET_NZ16(S); - EXTENDED; - WM16(EAD,&m6808.s); -} - -/* $c0 SUBB immediate ?**** */ -M6800_INLINE void subb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = B-t; - CLR_NZVC; SET_FLAGS8(B,t,r); - B = r; -} - -/* $c1 CMPB immediate ?**** */ -M6800_INLINE void cmpb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = B-t; - CLR_NZVC; SET_FLAGS8(B,t,r); -} - -/* $c2 SBCB immediate ?**** */ -M6800_INLINE void sbcb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = B-t-(CC&0x01); - CLR_NZVC; SET_FLAGS8(B,t,r); - B = r; -} - -/* $c3 ADDD immediate -**** */ -M6800_INLINE void addd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $c4 ANDB immediate -**0- */ -M6800_INLINE void andb_im( void ) -{ - UINT8 t; - IMMBYTE(t); B &= t; - CLR_NZV; SET_NZ8(B); -} - -/* $c5 BITB immediate -**0- */ -M6800_INLINE void bitb_im( void ) -{ - UINT8 t,r; - IMMBYTE(t); r = B&t; - CLR_NZV; SET_NZ8(r); -} - -/* $c6 LDB immediate -**0- */ -M6800_INLINE void ldb_im( void ) -{ - IMMBYTE(B); - CLR_NZV; SET_NZ8(B); -} - -/* is this a legal instruction? */ -/* $c7 STB immediate -**0- */ -M6800_INLINE void stb_im( void ) -{ - CLR_NZV; SET_NZ8(B); - IMM8; WM(EAD,B); -} - -/* $c8 EORB immediate -**0- */ -M6800_INLINE void eorb_im( void ) -{ - UINT8 t; - IMMBYTE(t); B ^= t; - CLR_NZV; SET_NZ8(B); -} - -/* $c9 ADCB immediate ***** */ -M6800_INLINE void adcb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = B+t+(CC&0x01); - CLR_HNZVC; SET_FLAGS8(B,t,r); SET_H(B,t,r); - B = r; -} - -/* $ca ORB immediate -**0- */ -M6800_INLINE void orb_im( void ) -{ - UINT8 t; - IMMBYTE(t); B |= t; - CLR_NZV; SET_NZ8(B); -} - -/* $cb ADDB immediate ***** */ -M6800_INLINE void addb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = B+t; - CLR_HNZVC; SET_FLAGS8(B,t,r); SET_H(B,t,r); - B = r; -} - -/* $CC LDD immediate -**0- */ -M6800_INLINE void ldd_im( void ) -{ - IMMWORD(m6808.d); - CLR_NZV; - SET_NZ16(D); -} - -/* is this a legal instruction? */ -/* $cd STD immediate -**0- */ -M6800_INLINE void std_im( void ) -{ - IMM16; - CLR_NZV; - SET_NZ16(D); - WM16(EAD,&m6808.d); -} - -/* $ce LDX immediate -**0- */ -M6800_INLINE void ldx_im( void ) -{ - IMMWORD(m6808.x); - CLR_NZV; - SET_NZ16(X); -} - -/* $cf STX immediate -**0- */ -M6800_INLINE void stx_im( void ) -{ - CLR_NZV; - SET_NZ16(X); - IMM16; - WM16(EAD,&m6808.x); -} - -/* $d0 SUBB direct ?**** */ -M6800_INLINE void subb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = B-t; - CLR_NZVC; SET_FLAGS8(B,t,r); - B = r; -} - -/* $d1 CMPB direct ?**** */ -M6800_INLINE void cmpb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = B-t; - CLR_NZVC; SET_FLAGS8(B,t,r); -} - -/* $d2 SBCB direct ?**** */ -M6800_INLINE void sbcb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = B-t-(CC&0x01); - CLR_NZVC; SET_FLAGS8(B,t,r); - B = r; -} - -/* $d3 ADDD direct -**** */ -M6800_INLINE void addd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $d4 ANDB direct -**0- */ -M6800_INLINE void andb_di( void ) -{ - UINT8 t; - DIRBYTE(t); B &= t; - CLR_NZV; SET_NZ8(B); -} - -/* $d5 BITB direct -**0- */ -M6800_INLINE void bitb_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); r = B&t; - CLR_NZV; SET_NZ8(r); -} - -/* $d6 LDB direct -**0- */ -M6800_INLINE void ldb_di( void ) -{ - DIRBYTE(B); - CLR_NZV; SET_NZ8(B); -} - -/* $d7 STB direct -**0- */ -M6800_INLINE void stb_di( void ) -{ - CLR_NZV; SET_NZ8(B); - DIRECT; WM(EAD,B); -} - -/* $d8 EORB direct -**0- */ -M6800_INLINE void eorb_di( void ) -{ - UINT8 t; - DIRBYTE(t); B ^= t; - CLR_NZV; SET_NZ8(B); -} - -/* $d9 ADCB direct ***** */ -M6800_INLINE void adcb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = B+t+(CC&0x01); - CLR_HNZVC; SET_FLAGS8(B,t,r); SET_H(B,t,r); - B = r; -} - -/* $da ORB direct -**0- */ -M6800_INLINE void orb_di( void ) -{ - UINT8 t; - DIRBYTE(t); B |= t; - CLR_NZV; SET_NZ8(B); -} - -/* $db ADDB direct ***** */ -M6800_INLINE void addb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); r = B+t; - CLR_HNZVC; SET_FLAGS8(B,t,r); SET_H(B,t,r); - B = r; -} - -/* $dc LDD direct -**0- */ -M6800_INLINE void ldd_di( void ) -{ - DIRWORD(m6808.d); - CLR_NZV; - SET_NZ16(D); -} - -/* $dd STD direct -**0- */ -M6800_INLINE void std_di( void ) -{ - DIRECT; - CLR_NZV; - SET_NZ16(D); - WM16(EAD,&m6808.d); -} - -/* $de LDX direct -**0- */ -M6800_INLINE void ldx_di( void ) -{ - DIRWORD(m6808.x); - CLR_NZV; - SET_NZ16(X); -} - -/* $dF STX direct -**0- */ -M6800_INLINE void stx_di( void ) -{ - CLR_NZV; - SET_NZ16(X); - DIRECT; - WM16(EAD,&m6808.x); -} - -/* $e0 SUBB indexed ?**** */ -M6800_INLINE void subb_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = B-t; - CLR_NZVC; SET_FLAGS8(B,t,r); - B = r; -} - -/* $e1 CMPB indexed ?**** */ -M6800_INLINE void cmpb_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = B-t; - CLR_NZVC; SET_FLAGS8(B,t,r); -} - -/* $e2 SBCB indexed ?**** */ -M6800_INLINE void sbcb_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = B-t-(CC&0x01); - CLR_NZVC; SET_FLAGS8(B,t,r); - B = r; -} - -/* $e3 ADDD indexed -**** */ -M6800_INLINE void addd_ix( void ) -{ - UINT32 r,d; - PAIR b; - IDXWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $e4 ANDB indexed -**0- */ -M6800_INLINE void andb_ix( void ) -{ - UINT8 t; - IDXBYTE(t); B &= t; - CLR_NZV; SET_NZ8(B); -} - -/* $e5 BITB indexed -**0- */ -M6800_INLINE void bitb_ix( void ) -{ - UINT8 t,r; - IDXBYTE(t); r = B&t; - CLR_NZV; SET_NZ8(r); -} - -/* $e6 LDB indexed -**0- */ -M6800_INLINE void ldb_ix( void ) -{ - IDXBYTE(B); - CLR_NZV; SET_NZ8(B); -} - -/* $e7 STB indexed -**0- */ -M6800_INLINE void stb_ix( void ) -{ - CLR_NZV; SET_NZ8(B); - INDEXED; WM(EAD,B); -} - -/* $e8 EORB indexed -**0- */ -M6800_INLINE void eorb_ix( void ) -{ - UINT8 t; - IDXBYTE(t); B ^= t; - CLR_NZV; SET_NZ8(B); -} - -/* $e9 ADCB indexed ***** */ -M6800_INLINE void adcb_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = B+t+(CC&0x01); - CLR_HNZVC; SET_FLAGS8(B,t,r); SET_H(B,t,r); - B = r; -} - -/* $ea ORB indexed -**0- */ -M6800_INLINE void orb_ix( void ) -{ - UINT8 t; - IDXBYTE(t); B |= t; - CLR_NZV; SET_NZ8(B); -} - -/* $eb ADDB indexed ***** */ -M6800_INLINE void addb_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); r = B+t; - CLR_HNZVC; SET_FLAGS8(B,t,r); SET_H(B,t,r); - B = r; -} - -/* $ec LDD indexed -**0- */ -M6800_INLINE void ldd_ix( void ) -{ - IDXWORD(m6808.d); - CLR_NZV; - SET_NZ16(D); -} - -/* $ec ADCX immediate -**** NSC8105 only. Flags are a guess - copied from addb_im() */ -M6800_INLINE void adcx_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); r = X+t+(CC&0x01); - CLR_HNZVC; SET_FLAGS8(X,t,r); SET_H(X,t,r); - X = r; -} - -/* $ed STD indexed -**0- */ -M6800_INLINE void std_ix( void ) -{ - INDEXED; - CLR_NZV; - SET_NZ16(D); - WM16(EAD,&m6808.d); -} - -/* $ee LDX indexed -**0- */ -M6800_INLINE void ldx_ix( void ) -{ - IDXWORD(m6808.x); - CLR_NZV; - SET_NZ16(X); -} - -/* $ef STX indexed -**0- */ -M6800_INLINE void stx_ix( void ) -{ - CLR_NZV; - SET_NZ16(X); - INDEXED; - WM16(EAD,&m6808.x); -} - -/* $f0 SUBB extended ?**** */ -M6800_INLINE void subb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = B-t; - CLR_NZVC; SET_FLAGS8(B,t,r); - B = r; -} - -/* $f1 CMPB extended ?**** */ -M6800_INLINE void cmpb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = B-t; - CLR_NZVC; SET_FLAGS8(B,t,r); -} - -/* $f2 SBCB extended ?**** */ -M6800_INLINE void sbcb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = B-t-(CC&0x01); - CLR_NZVC; SET_FLAGS8(B,t,r); - B = r; -} - -/* $f3 ADDD extended -**** */ -M6800_INLINE void addd_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $f4 ANDB extended -**0- */ -M6800_INLINE void andb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $f5 BITB extended -**0- */ -M6800_INLINE void bitb_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $f6 LDB extended -**0- */ -M6800_INLINE void ldb_ex( void ) -{ - EXTBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* $f7 STB extended -**0- */ -M6800_INLINE void stb_ex( void ) -{ - CLR_NZV; SET_NZ8(B); - EXTENDED; WM(EAD,B); -} - -/* $f8 EORB extended -**0- */ -M6800_INLINE void eorb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); B ^= t; - CLR_NZV; SET_NZ8(B); -} - -/* $f9 ADCB extended ***** */ -M6800_INLINE void adcb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = B+t+(CC&0x01); - CLR_HNZVC; SET_FLAGS8(B,t,r); SET_H(B,t,r); - B = r; -} - -/* $fa ORB extended -**0- */ -M6800_INLINE void orb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); B |= t; - CLR_NZV; SET_NZ8(B); -} - -/* $fb ADDB extended ***** */ -M6800_INLINE void addb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = B+t; - CLR_HNZVC; SET_FLAGS8(B,t,r); SET_H(B,t,r); - B = r; -} - -/* $fc LDD extended -**0- */ -M6800_INLINE void ldd_ex( void ) -{ - EXTWORD(m6808.d); - CLR_NZV; - SET_NZ16(D); -} - -/* $fc ADDX extended -**** NSC8105 only. Flags are a guess */ -M6800_INLINE void addx_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = X; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - X = r; -} - -/* $fd STD extended -**0- */ -M6800_INLINE void std_ex( void ) -{ - EXTENDED; - CLR_NZV; - SET_NZ16(D); - WM16(EAD,&m6808.d); -} - -/* $fe LDX extended -**0- */ -M6800_INLINE void ldx_ex( void ) -{ - EXTWORD(m6808.x); - CLR_NZV; - SET_NZ16(X); -} - -/* $ff STX extended -**0- */ -M6800_INLINE void stx_ex( void ) -{ - CLR_NZV; - SET_NZ16(X); - EXTENDED; - WM16(EAD,&m6808.x); -} diff --git a/jan/src/cpu/m6800/6800tbl.c b/jan/src/cpu/m6800/6800tbl.c deleted file mode 100644 index 04f72f597..000000000 --- a/jan/src/cpu/m6800/6800tbl.c +++ /dev/null @@ -1,398 +0,0 @@ -M6800_INLINE void aba(void); -M6800_INLINE void abx(void); -M6800_INLINE void adca_di(void); -M6800_INLINE void adca_ex(void); -M6800_INLINE void adca_im(void); -M6800_INLINE void adca_ix(void); -M6800_INLINE void adcb_di(void); -M6800_INLINE void adcb_ex(void); -M6800_INLINE void adcb_im(void); -M6800_INLINE void adcb_ix(void); -M6800_INLINE void adcx_im(void); -M6800_INLINE void adda_di(void); -M6800_INLINE void adda_ex(void); -M6800_INLINE void adda_im(void); -M6800_INLINE void adda_ix(void); -M6800_INLINE void addb_di(void); -M6800_INLINE void addb_ex(void); -M6800_INLINE void addb_im(void); -M6800_INLINE void addb_ix(void); -M6800_INLINE void addd_di(void); -M6800_INLINE void addd_ex(void); -M6800_INLINE void addx_ex(void); -M6800_INLINE void addd_im(void); -M6800_INLINE void addd_ix(void); -M6800_INLINE void aim_di(void); -M6800_INLINE void aim_ix(void); -M6800_INLINE void anda_di(void); -M6800_INLINE void anda_ex(void); -M6800_INLINE void anda_im(void); -M6800_INLINE void anda_ix(void); -M6800_INLINE void andb_di(void); -M6800_INLINE void andb_ex(void); -M6800_INLINE void andb_im(void); -M6800_INLINE void andb_ix(void); -M6800_INLINE void asl_ex(void); -M6800_INLINE void asl_ix(void); -M6800_INLINE void asla(void); -M6800_INLINE void aslb(void); -M6800_INLINE void asld(void); -M6800_INLINE void asr_ex(void); -M6800_INLINE void asr_ix(void); -M6800_INLINE void asra(void); -M6800_INLINE void asrb(void); -M6800_INLINE void bcc(void); -M6800_INLINE void bcs(void); -M6800_INLINE void beq(void); -M6800_INLINE void bge(void); -M6800_INLINE void bgt(void); -M6800_INLINE void bhi(void); -M6800_INLINE void bita_di(void); -M6800_INLINE void bita_ex(void); -M6800_INLINE void bita_im(void); -M6800_INLINE void bita_ix(void); -M6800_INLINE void bitb_di(void); -M6800_INLINE void bitb_ex(void); -M6800_INLINE void bitb_im(void); -M6800_INLINE void bitb_ix(void); -M6800_INLINE void ble(void); -M6800_INLINE void bls(void); -M6800_INLINE void blt(void); -M6800_INLINE void bmi(void); -M6800_INLINE void bne(void); -M6800_INLINE void bpl(void); -M6800_INLINE void bra(void); -M6800_INLINE void brn(void); -M6800_INLINE void bsr(void); -M6800_INLINE void bvc(void); -M6800_INLINE void bvs(void); -M6800_INLINE void cba(void); -M6800_INLINE void clc(void); -M6800_INLINE void cli(void); -M6800_INLINE void clr_ex(void); -M6800_INLINE void clr_ix(void); -M6800_INLINE void clra(void); -M6800_INLINE void clrb(void); -M6800_INLINE void clv(void); -M6800_INLINE void cmpa_di(void); -M6800_INLINE void cmpa_ex(void); -M6800_INLINE void cmpa_im(void); -M6800_INLINE void cmpa_ix(void); -M6800_INLINE void cmpb_di(void); -M6800_INLINE void cmpb_ex(void); -M6800_INLINE void cmpb_im(void); -M6800_INLINE void cmpb_ix(void); -M6800_INLINE void cmpx_di(void); -M6800_INLINE void cmpx_ex(void); -M6800_INLINE void cmpx_im(void); -M6800_INLINE void cmpx_ix(void); -M6800_INLINE void com_ex(void); -M6800_INLINE void com_ix(void); -M6800_INLINE void coma(void); -M6800_INLINE void comb(void); -M6800_INLINE void daa(void); -M6800_INLINE void dec_ex(void); -M6800_INLINE void dec_ix(void); -M6800_INLINE void deca(void); -M6800_INLINE void decb(void); -M6800_INLINE void des(void); -M6800_INLINE void dex(void); -M6800_INLINE void eim_di(void); -M6800_INLINE void eim_ix(void); -M6800_INLINE void eora_di(void); -M6800_INLINE void eora_ex(void); -M6800_INLINE void eora_im(void); -M6800_INLINE void eora_ix(void); -M6800_INLINE void eorb_di(void); -M6800_INLINE void eorb_ex(void); -M6800_INLINE void eorb_im(void); -M6800_INLINE void eorb_ix(void); -//M6800_INLINE void illegal(void); -static void illegal(void); -M6800_INLINE void inc_ex(void); -M6800_INLINE void inc_ix(void); -M6800_INLINE void inca(void); -M6800_INLINE void incb(void); -M6800_INLINE void ins(void); -M6800_INLINE void inx(void); -M6800_INLINE void jmp_ex(void); -M6800_INLINE void jmp_ix(void); -M6800_INLINE void jsr_di(void); -M6800_INLINE void jsr_ex(void); -M6800_INLINE void jsr_ix(void); -M6800_INLINE void lda_di(void); -M6800_INLINE void lda_ex(void); -M6800_INLINE void lda_im(void); -M6800_INLINE void lda_ix(void); -M6800_INLINE void ldb_di(void); -M6800_INLINE void ldb_ex(void); -M6800_INLINE void ldb_im(void); -M6800_INLINE void ldb_ix(void); -M6800_INLINE void ldd_di(void); -M6800_INLINE void ldd_ex(void); -M6800_INLINE void ldd_im(void); -M6800_INLINE void ldd_ix(void); -M6800_INLINE void lds_di(void); -M6800_INLINE void lds_ex(void); -M6800_INLINE void lds_im(void); -M6800_INLINE void lds_ix(void); -M6800_INLINE void ldx_di(void); -M6800_INLINE void ldx_ex(void); -M6800_INLINE void ldx_im(void); -M6800_INLINE void ldx_ix(void); -M6800_INLINE void lsr_ex(void); -M6800_INLINE void lsr_ix(void); -M6800_INLINE void lsra(void); -M6800_INLINE void lsrb(void); -M6800_INLINE void lsrd(void); -M6800_INLINE void mul(void); -M6800_INLINE void neg_ex(void); -M6800_INLINE void neg_ix(void); -M6800_INLINE void nega(void); -M6800_INLINE void negb(void); -M6800_INLINE void nop(void); -M6800_INLINE void oim_di(void); -M6800_INLINE void oim_ix(void); -M6800_INLINE void ora_di(void); -M6800_INLINE void ora_ex(void); -M6800_INLINE void ora_im(void); -M6800_INLINE void ora_ix(void); -M6800_INLINE void orb_di(void); -M6800_INLINE void orb_ex(void); -M6800_INLINE void orb_im(void); -M6800_INLINE void orb_ix(void); -M6800_INLINE void psha(void); -M6800_INLINE void pshb(void); -M6800_INLINE void pshx(void); -M6800_INLINE void pula(void); -M6800_INLINE void pulb(void); -M6800_INLINE void pulx(void); -M6800_INLINE void rol_ex(void); -M6800_INLINE void rol_ix(void); -M6800_INLINE void rola(void); -M6800_INLINE void rolb(void); -M6800_INLINE void ror_ex(void); -M6800_INLINE void ror_ix(void); -M6800_INLINE void rora(void); -M6800_INLINE void rorb(void); -M6800_INLINE void rti(void); -M6800_INLINE void rts(void); -M6800_INLINE void sba(void); -M6800_INLINE void sbca_di(void); -M6800_INLINE void sbca_ex(void); -M6800_INLINE void sbca_im(void); -M6800_INLINE void sbca_ix(void); -M6800_INLINE void sbcb_di(void); -M6800_INLINE void sbcb_ex(void); -M6800_INLINE void sbcb_im(void); -M6800_INLINE void sbcb_ix(void); -M6800_INLINE void sec(void); -M6800_INLINE void sei(void); -M6800_INLINE void sev(void); -#if (HAS_HD63701) -M6800_INLINE void slp(void); -#endif -M6800_INLINE void sta_di(void); -M6800_INLINE void sta_ex(void); -M6800_INLINE void sta_im(void); -M6800_INLINE void sta_ix(void); -M6800_INLINE void stb_di(void); -M6800_INLINE void stb_ex(void); -M6800_INLINE void stb_im(void); -M6800_INLINE void stb_ix(void); -M6800_INLINE void std_di(void); -M6800_INLINE void std_ex(void); -M6800_INLINE void std_im(void); -M6800_INLINE void std_ix(void); -M6800_INLINE void sts_di(void); -M6800_INLINE void sts_ex(void); -M6800_INLINE void sts_im(void); -M6800_INLINE void sts_ix(void); -M6800_INLINE void stx_di(void); -M6800_INLINE void stx_ex(void); -M6800_INLINE void stx_im(void); -M6800_INLINE void stx_ix(void); -M6800_INLINE void suba_di(void); -M6800_INLINE void suba_ex(void); -M6800_INLINE void suba_im(void); -M6800_INLINE void suba_ix(void); -M6800_INLINE void subb_di(void); -M6800_INLINE void subb_ex(void); -M6800_INLINE void subb_im(void); -M6800_INLINE void subb_ix(void); -M6800_INLINE void subd_di(void); -M6800_INLINE void subd_ex(void); -M6800_INLINE void subd_im(void); -M6800_INLINE void subd_ix(void); -M6800_INLINE void swi(void); -M6800_INLINE void tab(void); -M6800_INLINE void tap(void); -M6800_INLINE void tba(void); -M6800_INLINE void tim_di(void); -M6800_INLINE void tim_ix(void); -M6800_INLINE void tpa(void); -M6800_INLINE void tst_ex(void); -M6800_INLINE void tst_ix(void); -M6800_INLINE void tsta(void); -M6800_INLINE void tstb(void); -M6800_INLINE void tsx(void); -M6800_INLINE void txs(void); -M6800_INLINE void undoc1(void); -M6800_INLINE void undoc2(void); -M6800_INLINE void wai(void); -M6800_INLINE void xgdx(void); - -M6800_INLINE void cpx_di(void); -M6800_INLINE void cpx_ex(void); -M6800_INLINE void cpx_im(void); -M6800_INLINE void cpx_ix(void); -#if (HAS_HD63701) -//M6800_INLINE void trap(void); -static void trap(void); -#endif - -static void (*m6800_insn[0x100])(void) = { -illegal,nop, illegal,illegal,illegal,illegal,tap, tpa, -inx, dex, clv, sev, clc, sec, cli, sei, -sba, cba, illegal,illegal,illegal,illegal,tab, tba, -illegal,daa, illegal,aba, illegal,illegal,illegal,illegal, -bra, brn, bhi, bls, bcc, bcs, bne, beq, -bvc, bvs, bpl, bmi, bge, blt, bgt, ble, -tsx, ins, pula, pulb, des, txs, psha, pshb, -illegal,rts, illegal,rti, illegal,illegal,wai, swi, -nega, illegal,illegal,coma, lsra, illegal,rora, asra, -asla, rola, deca, illegal,inca, tsta, illegal,clra, -negb, illegal,illegal,comb, lsrb, illegal,rorb, asrb, -aslb, rolb, decb, illegal,incb, tstb, illegal,clrb, -neg_ix, illegal,illegal,com_ix, lsr_ix, illegal,ror_ix, asr_ix, -asl_ix, rol_ix, dec_ix, illegal,inc_ix, tst_ix, jmp_ix, clr_ix, -neg_ex, illegal,illegal,com_ex, lsr_ex, illegal,ror_ex, asr_ex, -asl_ex, rol_ex, dec_ex, illegal,inc_ex, tst_ex, jmp_ex, clr_ex, -suba_im,cmpa_im,sbca_im,illegal,anda_im,bita_im,lda_im, sta_im, -eora_im,adca_im,ora_im, adda_im,cmpx_im,bsr, lds_im, sts_im, -suba_di,cmpa_di,sbca_di,illegal,anda_di,bita_di,lda_di, sta_di, -eora_di,adca_di,ora_di, adda_di,cmpx_di,jsr_di, lds_di, sts_di, -suba_ix,cmpa_ix,sbca_ix,illegal,anda_ix,bita_ix,lda_ix, sta_ix, -eora_ix,adca_ix,ora_ix, adda_ix,cmpx_ix,jsr_ix, lds_ix, sts_ix, -suba_ex,cmpa_ex,sbca_ex,illegal,anda_ex,bita_ex,lda_ex, sta_ex, -eora_ex,adca_ex,ora_ex, adda_ex,cmpx_ex,jsr_ex, lds_ex, sts_ex, -subb_im,cmpb_im,sbcb_im,illegal,andb_im,bitb_im,ldb_im, stb_im, -eorb_im,adcb_im,orb_im, addb_im,illegal,illegal,ldx_im, stx_im, -subb_di,cmpb_di,sbcb_di,illegal,andb_di,bitb_di,ldb_di, stb_di, -eorb_di,adcb_di,orb_di, addb_di,illegal,illegal,ldx_di, stx_di, -subb_ix,cmpb_ix,sbcb_ix,illegal,andb_ix,bitb_ix,ldb_ix, stb_ix, -eorb_ix,adcb_ix,orb_ix, addb_ix,illegal,illegal,ldx_ix, stx_ix, -subb_ex,cmpb_ex,sbcb_ex,illegal,andb_ex,bitb_ex,ldb_ex, stb_ex, -eorb_ex,adcb_ex,orb_ex, addb_ex,illegal,illegal,ldx_ex, stx_ex -}; - -#if (HAS_M6801||HAS_M6803) -static void (*m6803_insn[0x100])(void) = { -illegal,nop, illegal,illegal,lsrd, asld, tap, tpa, -inx, dex, clv, sev, clc, sec, cli, sei, -sba, cba, illegal,illegal,illegal,illegal,tab, tba, -illegal,daa, illegal,aba, illegal,illegal,illegal,illegal, -bra, brn, bhi, bls, bcc, bcs, bne, beq, -bvc, bvs, bpl, bmi, bge, blt, bgt, ble, -tsx, ins, pula, pulb, des, txs, psha, pshb, -pulx, rts, abx, rti, pshx, mul, wai, swi, -nega, illegal,illegal,coma, lsra, illegal,rora, asra, -asla, rola, deca, illegal,inca, tsta, illegal,clra, -negb, illegal,illegal,comb, lsrb, illegal,rorb, asrb, -aslb, rolb, decb, illegal,incb, tstb, illegal,clrb, -neg_ix, illegal,illegal,com_ix, lsr_ix, illegal,ror_ix, asr_ix, -asl_ix, rol_ix, dec_ix, illegal,inc_ix, tst_ix, jmp_ix, clr_ix, -neg_ex, illegal,illegal,com_ex, lsr_ex, illegal,ror_ex, asr_ex, -asl_ex, rol_ex, dec_ex, illegal,inc_ex, tst_ex, jmp_ex, clr_ex, -suba_im,cmpa_im,sbca_im,subd_im,anda_im,bita_im,lda_im, sta_im, -eora_im,adca_im,ora_im, adda_im,cpx_im ,bsr, lds_im, sts_im, -suba_di,cmpa_di,sbca_di,subd_di,anda_di,bita_di,lda_di, sta_di, -eora_di,adca_di,ora_di, adda_di,cpx_di ,jsr_di, lds_di, sts_di, -suba_ix,cmpa_ix,sbca_ix,subd_ix,anda_ix,bita_ix,lda_ix, sta_ix, -eora_ix,adca_ix,ora_ix, adda_ix,cpx_ix ,jsr_ix, lds_ix, sts_ix, -suba_ex,cmpa_ex,sbca_ex,subd_ex,anda_ex,bita_ex,lda_ex, sta_ex, -eora_ex,adca_ex,ora_ex, adda_ex,cpx_ex ,jsr_ex, lds_ex, sts_ex, -subb_im,cmpb_im,sbcb_im,addd_im,andb_im,bitb_im,ldb_im, stb_im, -eorb_im,adcb_im,orb_im, addb_im,ldd_im, std_im, ldx_im, stx_im, -subb_di,cmpb_di,sbcb_di,addd_di,andb_di,bitb_di,ldb_di, stb_di, -eorb_di,adcb_di,orb_di, addb_di,ldd_di, std_di, ldx_di, stx_di, -subb_ix,cmpb_ix,sbcb_ix,addd_ix,andb_ix,bitb_ix,ldb_ix, stb_ix, -eorb_ix,adcb_ix,orb_ix, addb_ix,ldd_ix, std_ix, ldx_ix, stx_ix, -subb_ex,cmpb_ex,sbcb_ex,addd_ex,andb_ex,bitb_ex,ldb_ex, stb_ex, -eorb_ex,adcb_ex,orb_ex, addb_ex,ldd_ex, std_ex, ldx_ex, stx_ex -}; -#endif - -#if (HAS_HD63701) -static void (*hd63701_insn[0x100])(void) = { -trap ,nop, trap ,trap ,lsrd, asld, tap, tpa, -inx, dex, clv, sev, clc, sec, cli, sei, -sba, cba, undoc1, undoc2, trap ,trap ,tab, tba, -xgdx, daa, slp ,aba, trap ,trap ,trap ,trap , -bra, brn, bhi, bls, bcc, bcs, bne, beq, -bvc, bvs, bpl, bmi, bge, blt, bgt, ble, -tsx, ins, pula, pulb, des, txs, psha, pshb, -pulx, rts, abx, rti, pshx, mul, wai, swi, -nega, trap ,trap ,coma, lsra, trap ,rora, asra, -asla, rola, deca, trap ,inca, tsta, trap ,clra, -negb, trap ,trap ,comb, lsrb, trap ,rorb, asrb, -aslb, rolb, decb, trap ,incb, tstb, trap ,clrb, -neg_ix, aim_ix, oim_ix, com_ix, lsr_ix, eim_ix, ror_ix, asr_ix, -asl_ix, rol_ix, dec_ix, tim_ix, inc_ix, tst_ix, jmp_ix, clr_ix, -neg_ex, aim_di, oim_di, com_ex, lsr_ex, eim_di, ror_ex, asr_ex, -asl_ex, rol_ex, dec_ex, tim_di, inc_ex, tst_ex, jmp_ex, clr_ex, -suba_im,cmpa_im,sbca_im,subd_im,anda_im,bita_im,lda_im, sta_im, -eora_im,adca_im,ora_im, adda_im,cpx_im ,bsr, lds_im, sts_im, -suba_di,cmpa_di,sbca_di,subd_di,anda_di,bita_di,lda_di, sta_di, -eora_di,adca_di,ora_di, adda_di,cpx_di ,jsr_di, lds_di, sts_di, -suba_ix,cmpa_ix,sbca_ix,subd_ix,anda_ix,bita_ix,lda_ix, sta_ix, -eora_ix,adca_ix,ora_ix, adda_ix,cpx_ix ,jsr_ix, lds_ix, sts_ix, -suba_ex,cmpa_ex,sbca_ex,subd_ex,anda_ex,bita_ex,lda_ex, sta_ex, -eora_ex,adca_ex,ora_ex, adda_ex,cpx_ex ,jsr_ex, lds_ex, sts_ex, -subb_im,cmpb_im,sbcb_im,addd_im,andb_im,bitb_im,ldb_im, stb_im, -eorb_im,adcb_im,orb_im, addb_im,ldd_im, std_im, ldx_im, stx_im, -subb_di,cmpb_di,sbcb_di,addd_di,andb_di,bitb_di,ldb_di, stb_di, -eorb_di,adcb_di,orb_di, addb_di,ldd_di, std_di, ldx_di, stx_di, -subb_ix,cmpb_ix,sbcb_ix,addd_ix,andb_ix,bitb_ix,ldb_ix, stb_ix, -eorb_ix,adcb_ix,orb_ix, addb_ix,ldd_ix, std_ix, ldx_ix, stx_ix, -subb_ex,cmpb_ex,sbcb_ex,addd_ex,andb_ex,bitb_ex,ldb_ex, stb_ex, -eorb_ex,adcb_ex,orb_ex, addb_ex,ldd_ex, std_ex, ldx_ex, stx_ex -}; -#endif - -#if (HAS_NSC8105) -static void (*nsc8105_insn[0x100])(void) = { -illegal,illegal,nop, illegal,illegal,tap, illegal,tpa, -inx, clv, dex, sev, clc, cli, sec, sei, -sba, illegal,cba, illegal,illegal,tab, illegal,tba, -illegal,illegal,daa, aba, illegal,illegal,illegal,illegal, -bra, bhi, brn, bls, bcc, bne, bcs, beq, -bvc, bpl, bvs, bmi, bge, bgt, blt, ble, -tsx, pula, ins, pulb, des, psha, txs, pshb, -illegal,illegal,rts, rti, illegal,wai, illegal,swi, -suba_im,sbca_im,cmpa_im,illegal,anda_im,lda_im, bita_im,sta_im, -eora_im,ora_im, adca_im,adda_im,cmpx_im,lds_im, bsr, sts_im, -suba_di,sbca_di,cmpa_di,illegal,anda_di,lda_di, bita_di,sta_di, -eora_di,ora_di, adca_di,adda_di,cmpx_di,lds_di, jsr_di, sts_di, -suba_ix,sbca_ix,cmpa_ix,illegal,anda_ix,lda_ix, bita_ix,sta_ix, -eora_ix,ora_ix, adca_ix,adda_ix,cmpx_ix,lds_ix, jsr_ix, sts_ix, -suba_ex,sbca_ex,cmpa_ex,illegal,anda_ex,lda_ex, bita_ex,sta_ex, -eora_ex,ora_ex, adca_ex,adda_ex,cmpx_ex,lds_ex, jsr_ex, sts_ex, -nega, illegal,illegal,coma, lsra, rora, illegal,asra, -asla, deca, rola, illegal,inca, illegal,tsta, clra, -negb, illegal,illegal,comb, lsrb, rorb, illegal,asrb, -aslb, decb, rolb, illegal,incb, illegal,tstb, clrb, -neg_ix, illegal,illegal,com_ix, lsr_ix, ror_ix, illegal,asr_ix, -asl_ix, dec_ix, rol_ix, illegal,inc_ix, jmp_ix, tst_ix, clr_ix, -neg_ex, illegal,illegal,com_ex, lsr_ex, ror_ex, illegal,asr_ex, -asl_ex, dec_ex, rol_ex, illegal,inc_ex, jmp_ex, tst_ex, clr_ex, -subb_im,sbcb_im,cmpb_im,illegal,andb_im,ldb_im, bitb_im,stb_im, -eorb_im,orb_im, adcb_im,addb_im,illegal,ldx_im, illegal,stx_im, -subb_di,sbcb_di,cmpb_di,illegal,andb_di,ldb_di, bitb_di,stb_di, -eorb_di,orb_di, adcb_di,addb_di,illegal,ldx_di, illegal,stx_di, -subb_ix,sbcb_ix,cmpb_ix,illegal,andb_ix,ldb_ix, bitb_ix,stb_ix, -eorb_ix,orb_ix, adcb_ix,addb_ix,adcx_im,ldx_ix, illegal,stx_ix, -subb_ex,sbcb_ex,cmpb_ex,illegal,andb_ex,ldb_ex, bitb_ex,stb_ex, -eorb_ex,orb_ex, adcb_ex,addb_ex,addx_ex,ldx_ex, illegal,stx_ex -}; -#endif diff --git a/jan/src/cpu/m6800/m6800.cpp b/jan/src/cpu/m6800/m6800.cpp deleted file mode 100644 index 1bc73c9f5..000000000 --- a/jan/src/cpu/m6800/m6800.cpp +++ /dev/null @@ -1,2465 +0,0 @@ -/*** m6800: Portable 6800 class emulator ************************************* - - m6800.c - - References: - - 6809 Simulator V09, By L.C. Benschop, Eidnhoven The Netherlands. - - m6809: Portable 6809 emulator, DS (6809 code in MAME, derived from - the 6809 Simulator V09) - - 6809 Microcomputer Programming & Interfacing with Experiments" - by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits - arrays up to 65536 bytes must be supported - machine must be twos complement - -History -991031 ZV - Added NSC-8105 support - -990319 HJB - Fixed wrong LSB/MSB order for push/pull word. - Subtract .extra_cycles at the beginning/end of the exectuion loops. - -990316 HJB - Renamed to 6800, since that's the basic CPU. - Added different cycle count tables for M6800/2/8, M6801/3 and HD63701. - -990314 HJB - Also added the M6800 subtype. - -990311 HJB - Added _info functions. Now uses static m6808_Regs struct instead - of single statics. Changed the 16 bit registers to use the generic - PAIR union. Registers defined using macros. Split the core into - four execution loops for M6802, M6803, M6808 and HD63701. - TST, TSTA and TSTB opcodes reset carry flag. -TODO: - Verify invalid opcodes for the different CPU types. - Add proper credits to _info functions. - Integrate m6808_Flags into the registers (multiple m6808 type CPUs?) - -990301 HJB - Modified the interrupt handling. No more pending interrupt checks. - WAI opcode saves state, when an interrupt is taken (IRQ or OCI), - the state is only saved if not already done by WAI. - -*****************************************************************************/ - - -//#include "debugger.h" -#include "burnint.h" -#include "m6800.h" - -#define VERBOSE 0 - -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif - -#define M6800_INLINE static -#define change_pc(newpc) m6800.pc.w.l = (newpc) -#define M6800_CLEAR_LINE 0 - -#if 0 -/* CPU subtypes, needed for extra insn after TAP/CLI/SEI */ -enum { - SUBTYPE_M6800, - SUBTYPE_M6801, - SUBTYPE_M6802, - SUBTYPE_M6803, - SUBTYPE_M6808, - SUBTYPE_HD63701, - SUBTYPE_NSC8105 -}; -#endif - -/* 680x registers */ -static m6800_Regs m6800; - -#define m6801 m6800 -#define m6802 m6800 -#define m6803 m6800 -#define m6808 m6800 -#define hd63701 m6800 -#define nsc8105 m6800 - -#define pPPC m6800.ppc -#define pPC m6800.pc -#define pS m6800.s -#define pX m6800.x -#define pD m6800.d - -#define PC m6800.pc.w.l -#define PCD m6800.pc.d -#define S m6800.s.w.l -#define SD m6800.s.d -#define X m6800.x.w.l -#define D m6800.d.w.l -#define A m6800.d.b.h -#define B m6800.d.b.l -#define CC m6800.cc - -#define CT m6800.counter.w.l -#define CTH m6800.counter.w.h -#define CTD m6800.counter.d -#define OC m6800.output_compare.w.l -#define OCH m6800.output_compare.w.h -#define OCD m6800.output_compare.d -#define TOH m6800.timer_over.w.l -#define TOD m6800.timer_over.d - -//static PAIR ea; /* effective address */ -#define ea m6800.ea -#define EAD ea.d -#define EA ea.w.l - -/* public globals */ -#define m6800_ICount m6800.m6800_ICount - -/* point of next timer event */ -#define timer_next m6800.timer_next - -/* DS -- THESE ARE RE-DEFINED IN m6800.h TO RAM, ROM or FUNCTIONS IN cpuintrf.c */ -#define RM M6800_RDMEM -#define WM M6800_WRMEM -#define M_RDOP M6800_RDOP -#define M_RDOP_ARG M6800_RDOP_ARG - -/* macros to access memory */ -#define IMMBYTE(b) b = M_RDOP_ARG(PCD); PC++ -#define IMMWORD(w) w.d = (M_RDOP_ARG(PCD)<<8) | M_RDOP_ARG((PCD+1)&0xffff); PC+=2 - -#define PUSHBYTE(b) WM(SD,b); --S -#define PUSHWORD(w) WM(SD,w.b.l); --S; WM(SD,w.b.h); --S -#define PULLBYTE(b) S++; b = RM(SD) -#define PULLWORD(w) S++; w.d = RM(SD)<<8; S++; w.d |= RM(SD) - -#define MODIFIED_tcsr { \ - m6800.irq2 = (m6800.tcsr&(m6800.tcsr<<3))&(TCSR_ICF|TCSR_OCF|TCSR_TOF); \ -} - -#define SET_TIMER_EVENT { \ - timer_next = (OCD - CTD < TOD - CTD) ? OCD : TOD; \ -} - -/* cleanup high-word of counters */ -#define CLEANUP_conters { \ - OCH -= CTH; \ - TOH -= CTH; \ - CTH = 0; \ - SET_TIMER_EVENT; \ -} - -/* when change freerunningcounter or outputcapture */ -#define MODIFIED_counters { \ - OCH = (OC >= CT) ? CTH : CTH+1; \ - SET_TIMER_EVENT; \ -} - -/* take interrupt */ -#define TAKE_ICI ENTER_INTERRUPT("M6800#%d take ICI\n",0xfff6) -#define TAKE_OCI ENTER_INTERRUPT("M6800#%d take OCI\n",0xfff4) -#define TAKE_TOI ENTER_INTERRUPT("M6800#%d take TOI\n",0xfff2) -#define TAKE_SCI ENTER_INTERRUPT("M6800#%d take SCI\n",0xfff0) -#define TAKE_TRAP ENTER_INTERRUPT("M6800#%d take TRAP\n",0xffee) - -/* check IRQ2 (internal irq) */ -#define CHECK_IRQ2 { \ - if(m6800.irq2&(TCSR_ICF|TCSR_OCF|TCSR_TOF)) \ - { \ - if(m6800.irq2&TCSR_ICF) \ - { \ - TAKE_ICI; \ - } \ - else if(m6800.irq2&TCSR_OCF) \ - { \ - TAKE_OCI; \ - } \ - else if(m6800.irq2&TCSR_TOF) \ - { \ - TAKE_TOI; \ - } \ - } \ -} - -/* operate one instruction for */ -#define ONE_MORE_INSN() { \ - UINT8 ireg; \ - pPPC = pPC; \ - ireg=M_RDOP(PCD); \ - PC++; \ - (*m6800.insn[ireg])(); \ - INCREMENT_COUNTER(m6800.cycles[ireg]); \ -} - -/* check the IRQ lines for pending interrupts */ -#define CHECK_IRQ_LINES() { \ - if( !(CC & 0x10) ) \ - { \ - if( m6800.irq_state[M6800_IRQ_LINE] != M6800_CLEAR_LINE ) \ - { /* standard IRQ */ \ - ENTER_INTERRUPT("M6800#%d take IRQ1\n",0xfff8); \ - } \ - else \ - CHECK_IRQ2; \ - } \ -} - -/* CC masks HI NZVC - 7654 3210 */ -#define CLR_HNZVC CC&=0xd0 -#define CLR_NZV CC&=0xf1 -#define CLR_HNZC CC&=0xd2 -#define CLR_NZVC CC&=0xf0 -#define CLR_Z CC&=0xfb -#define CLR_NZC CC&=0xf2 -#define CLR_ZC CC&=0xfa -#define CLR_C CC&=0xfe - -/* macros for CC -- CC bits affected should be reset before calling */ -#define SET_Z(a) if(!(a))SEZ -#define SET_Z8(a) SET_Z((UINT8)(a)) -#define SET_Z16(a) SET_Z((UINT16)(a)) -#define SET_N8(a) CC|=(((a)&0x80)>>4) -#define SET_N16(a) CC|=(((a)&0x8000)>>12) -#define SET_H(a,b,r) CC|=((((a)^(b)^(r))&0x10)<<1) -#define SET_C8(a) CC|=(((a)&0x100)>>8) -#define SET_C16(a) CC|=(((a)&0x10000)>>16) -#define SET_V8(a,b,r) CC|=((((a)^(b)^(r)^((r)>>1))&0x80)>>6) -#define SET_V16(a,b,r) CC|=((((a)^(b)^(r)^((r)>>1))&0x8000)>>14) - -static const UINT8 flags8i[256]= /* increment */ -{ -0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x0a,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 -}; -static const UINT8 flags8d[256]= /* decrement */ -{ -0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 -}; -#define SET_FLAGS8I(a) {CC|=flags8i[(a)&0xff];} -#define SET_FLAGS8D(a) {CC|=flags8d[(a)&0xff];} - -/* combos */ -#define SET_NZ8(a) {SET_N8(a);SET_Z8(a);} -#define SET_NZ16(a) {SET_N16(a);SET_Z16(a);} -#define SET_FLAGS8(a,b,r) {SET_N8(r);SET_Z8(r);SET_V8(a,b,r);SET_C8(r);} -#define SET_FLAGS16(a,b,r) {SET_N16(r);SET_Z16(r);SET_V16(a,b,r);SET_C16(r);} - -/* for treating an UINT8 as a signed INT16 */ -#define SIGNED(b) ((INT16)(b&0x80?b|0xff00:b)) - -/* Macros for addressing modes */ -#define DIRECT IMMBYTE(EAD) -#define IMM8 EA=PC++ -#define IMM16 {EA=PC;PC+=2;} -#define EXTENDED IMMWORD(ea) -#define INDEXED {EA=X+(UINT8)M_RDOP_ARG(PCD);PC++;} - -/* macros to set status flags */ -#define SEC CC|=0x01 -#define CLC CC&=0xfe -#define SEZ CC|=0x04 -#define CLZ CC&=0xfb -#define SEN CC|=0x08 -#define CLN CC&=0xf7 -#define SEV CC|=0x02 -#define CLV CC&=0xfd -#define SEH CC|=0x20 -#define CLH CC&=0xdf -#define SEI CC|=0x10 -#define CLI CC&=~0x10 - -/* mnemonicos for the Timer Control and Status Register bits */ -#define TCSR_OLVL 0x01 -#define TCSR_IEDG 0x02 -#define TCSR_ETOI 0x04 -#define TCSR_EOCI 0x08 -#define TCSR_EICI 0x10 -#define TCSR_TOF 0x20 -#define TCSR_OCF 0x40 -#define TCSR_ICF 0x80 - -#define INCREMENT_COUNTER(amount) \ -{ \ - m6800_ICount -= amount; \ - CTD += amount; \ - if( CTD >= timer_next) \ - check_timer_event(); \ -} - -#define EAT_CYCLES \ -{ \ - int cycles_to_eat; \ - \ - cycles_to_eat = timer_next - CTD; \ - if( cycles_to_eat > m6800_ICount) cycles_to_eat = m6800_ICount; \ - if (cycles_to_eat > 0) \ - { \ - INCREMENT_COUNTER(cycles_to_eat); \ - } \ -} - -/* macros for convenience */ -#define DIRBYTE(b) {DIRECT;b=RM(EAD);} -#define DIRWORD(w) {DIRECT;w.d=RM16(EAD);} -#define EXTBYTE(b) {EXTENDED;b=RM(EAD);} -#define EXTWORD(w) {EXTENDED;w.d=RM16(EAD);} - -#define IDXBYTE(b) {INDEXED;b=RM(EAD);} -#define IDXWORD(w) {INDEXED;w.d=RM16(EAD);} - -/* Macros for branch instructions */ -#define CHANGE_PC() change_pc(PCD) -#define BRANCH(f) {IMMBYTE(t);if(f){PC+=SIGNED(t);CHANGE_PC();}} -#define NXORV ((CC&0x08)^((CC&0x02)<<2)) - -/* Note: we use 99 cycles here for invalid opcodes so that we don't */ -/* hang in an infinite loop if we hit one */ -static const UINT8 cycles_6800[] = -{ - /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ - /*0*/ 99, 2,99,99,99,99, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, - /*1*/ 2, 2,99,99,99,99, 2, 2,99, 2,99, 2,99,99,99,99, - /*2*/ 4,99, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - /*3*/ 4, 4, 4, 4, 4, 4, 4, 4,99, 5,99,10,99,99, 9,12, - /*4*/ 2,99,99, 2, 2,99, 2, 2, 2, 2, 2,99, 2, 2,99, 2, - /*5*/ 2,99,99, 2, 2,99, 2, 2, 2, 2, 2,99, 2, 2,99, 2, - /*6*/ 7,99,99, 7, 7,99, 7, 7, 7, 7, 7,99, 7, 7, 4, 7, - /*7*/ 6,99,99, 6, 6,99, 6, 6, 6, 6, 6,99, 6, 6, 3, 6, - /*8*/ 2, 2, 2,99, 2, 2, 2,99, 2, 2, 2, 2, 3, 8, 3,99, - /*9*/ 3, 3, 3,99, 3, 3, 3, 4, 3, 3, 3, 3, 4,99, 4, 5, - /*A*/ 5, 5, 5,99, 5, 5, 5, 6, 5, 5, 5, 5, 6, 8, 6, 7, - /*B*/ 4, 4, 4,99, 4, 4, 4, 5, 4, 4, 4, 4, 5, 9, 5, 6, - /*C*/ 2, 2, 2,99, 2, 2, 2,99, 2, 2, 2, 2,99,99, 3,99, - /*D*/ 3, 3, 3,99, 3, 3, 3, 4, 3, 3, 3, 3,99,99, 4, 5, - /*E*/ 5, 5, 5,99, 5, 5, 5, 6, 5, 5, 5, 5,99,99, 6, 7, - /*F*/ 4, 4, 4,99, 4, 4, 4, 5, 4, 4, 4, 4,99,99, 5, 6 -}; - -static const UINT8 cycles_6803[] = -{ - /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ - /*0*/ 99, 2,99,99, 3, 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, - /*1*/ 2, 2,99,99,99,99, 2, 2,99, 2,99, 2,99,99,99,99, - /*2*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - /*3*/ 3, 3, 4, 4, 3, 3, 3, 3, 5, 5, 3,10, 4,10, 9,12, - /*4*/ 2,99,99, 2, 2,99, 2, 2, 2, 2, 2,99, 2, 2,99, 2, - /*5*/ 2,99,99, 2, 2,99, 2, 2, 2, 2, 2,99, 2, 2,99, 2, - /*6*/ 6,99,99, 6, 6,99, 6, 6, 6, 6, 6,99, 6, 6, 3, 6, - /*7*/ 6,99,99, 6, 6,99, 6, 6, 6, 6, 6,99, 6, 6, 3, 6, - /*8*/ 2, 2, 2, 4, 2, 2, 2,99, 2, 2, 2, 2, 4, 6, 3,99, - /*9*/ 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 4, 4, - /*A*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 5, 5, - /*B*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 5, 5, - /*C*/ 2, 2, 2, 4, 2, 2, 2,99, 2, 2, 2, 2, 3,99, 3,99, - /*D*/ 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, - /*E*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, - /*F*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 -}; - -static const UINT8 cycles_63701[] = -{ - /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ - /*0*/ 99, 1,99,99, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /*1*/ 1, 1,99,99,99,99, 1, 1, 2, 2, 4, 1,99,99,99,99, - /*2*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - /*3*/ 1, 1, 3, 3, 1, 1, 4, 4, 4, 5, 1,10, 5, 7, 9,12, - /*4*/ 1,99,99, 1, 1,99, 1, 1, 1, 1, 1,99, 1, 1,99, 1, - /*5*/ 1,99,99, 1, 1,99, 1, 1, 1, 1, 1,99, 1, 1,99, 1, - /*6*/ 6, 7, 7, 6, 6, 7, 6, 6, 6, 6, 6, 5, 6, 4, 3, 5, - /*7*/ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 4, 3, 5, - /*8*/ 2, 2, 2, 3, 2, 2, 2,99, 2, 2, 2, 2, 3, 5, 3,99, - /*9*/ 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 4, 4, - /*A*/ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, - /*B*/ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 5, 5, - /*C*/ 2, 2, 2, 3, 2, 2, 2,99, 2, 2, 2, 2, 3,99, 3,99, - /*D*/ 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, - /*E*/ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, - /*F*/ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 -}; - -static const UINT8 cycles_nsc8105[] = -{ - /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ - /*0*/ 99,99, 2,99,99, 2,99, 2, 4, 2, 4, 2, 2, 2, 2, 2, - /*1*/ 2,99, 2,99,99, 2,99, 2,99,99, 2, 2,99,99,99,99, - /*2*/ 4, 4,99, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - /*3*/ 4, 4, 4, 4, 4, 4, 4, 4,99,99, 5,10,99, 9,99,12, - /*4*/ 2,99,99, 2, 2, 2,99, 2, 2, 2, 2,99, 2,99, 2, 2, - /*5*/ 2,99,99, 2, 2, 2,99, 2, 2, 2, 2,99, 2,99, 2, 2, - /*6*/ 7,99,99, 7, 7, 7,99, 7, 7, 7, 7,99, 7, 4, 7, 7, - /*7*/ 6,99,99, 6, 6, 6,99, 6, 6, 6, 6,99, 6, 3, 6, 6, - /*8*/ 2, 2, 2,99, 2, 2, 2,99, 2, 2, 2, 2, 3, 3, 8,99, - /*9*/ 3, 3, 3,99, 3, 3, 3, 4, 3, 3, 3, 3, 4, 4,99, 5, - /*A*/ 5, 5, 5,99, 5, 5, 5, 6, 5, 5, 5, 5, 6, 6, 8, 7, - /*B*/ 4, 4, 4,99, 4, 4, 4, 5, 4, 4, 4, 4, 5, 5, 9, 6, - /*C*/ 2, 2, 2,99, 2, 2, 2,99, 2, 2, 2, 2,99, 3,99,99, - /*D*/ 3, 3, 3,99, 3, 3, 3, 4, 3, 3, 3, 3,99, 4,99, 5, - /*E*/ 5, 5, 5,99, 5, 5, 5, 6, 5, 5, 5, 5, 5, 6,99, 7, - /*F*/ 4, 4, 4,99, 4, 4, 4, 5, 4, 4, 4, 4, 4, 5,99, 6 -}; - -M6800_INLINE UINT32 RM16( UINT32 Addr ) -{ - UINT32 result = RM(Addr) << 8; - return result | RM((Addr+1)&0xffff); -} - -M6800_INLINE void WM16( UINT32 Addr, PAIR *p ) -{ - WM( Addr, p->b.h ); - WM( (Addr+1)&0xffff, p->b.l ); -} - -/* IRQ enter */ -static void ENTER_INTERRUPT(const char *,UINT16 irq_vector) -{ -// LOG((message, cpu_getactivecpu())); - if( m6800.wai_state & (M6800_WAI|M6800_SLP) ) - { - if( m6800.wai_state & M6800_WAI ) - m6800.extra_cycles += 4; - m6800.wai_state &= ~(M6800_WAI|M6800_SLP); - } - else - { - PUSHWORD(pPC); - PUSHWORD(pX); - PUSHBYTE(A); - PUSHBYTE(B); - PUSHBYTE(CC); - m6800.extra_cycles += 12; - } - SEI; - PCD = RM16( irq_vector ); - CHANGE_PC(); -} - -/* check OCI or TOI */ -static void check_timer_event(void) -{ - /* OCI */ - if( CTD >= OCD) - { - OCH++; // next IRQ point - m6800.tcsr |= TCSR_OCF; - m6800.pending_tcsr |= TCSR_OCF; - MODIFIED_tcsr; - if ( !(CC & 0x10) && (m6800.tcsr & TCSR_EOCI)) - TAKE_OCI; - } - /* TOI */ - if( CTD >= TOD) - { - TOH++; // next IRQ point -#if 0 - CLEANUP_conters; -#endif - m6800.tcsr |= TCSR_TOF; - m6800.pending_tcsr |= TCSR_TOF; - MODIFIED_tcsr; - if ( !(CC & 0x10) && (m6800.tcsr & TCSR_ETOI)) - TAKE_TOI; - } - /* set next event */ - SET_TIMER_EVENT; -} - -/* include the opcode prototypes and function pointer tables */ -#include "6800tbl.c" - -/* include the opcode functions */ -#include "6800ops.c" - -/**************************************************************************** - * Reset registers to their initial values - ****************************************************************************/ - -void m6800_init() -{ -// m6800.subtype = SUBTYPE_M6800; - m6800.insn = m6800_insn; - m6800.cycles = cycles_6800; -// m6800.irq_callback = irqcallback; -// state_register("m6800", index); -} - -void m6800_reset(void) -{ - // save pointers, clear context, restore pointers - void (* const * insn)(void) = m6800.insn; - const UINT8 *cycles = m6800.cycles; - //memset(&m6800, 0, sizeof(m6800)); - m6800.insn = insn; - m6800.cycles = cycles; - - SEI; /* IRQ disabled */ - PCD = RM16( 0xfffe ); - CHANGE_PC(); - - m6800.wai_state = 0; - m6800.nmi_state = 0; - m6800.irq_state[M6800_IRQ_LINE] = 0; - m6800.irq_state[M6800_TIN_LINE] = 0; - m6800.ic_eddge = 0; - - m6800.port1_ddr = 0x00; - m6800.port2_ddr = 0x00; - /* TODO: on reset port 2 should be read to determine the operating mode (bits 0-2) */ - m6800.tcsr = 0x00; - m6800.pending_tcsr = 0x00; - m6800.irq2 = 0; - CTD = 0x0000; - OCD = 0xffff; - TOD = 0xffff; - m6800.ram_ctrl |= 0x40; -} - -void m6800_reset_hard(void) -{ - // save pointers, clear context, restore pointers - void (* const * insn)(void) = m6800.insn; - const UINT8 *cycles = m6800.cycles; - //memset(&m6800, 0, sizeof(m6800)); - m6800.insn = insn; - m6800.cycles = cycles; - - m6800_reset(); -} - -int m6800_get_pc() -{ - return PC; -} - -/**************************************************************************** - * Shut down CPU emulatio - ****************************************************************************/ -/* -static void m6800_exit(void) -{ - -}*/ - -/**************************************************************************** - * Get all registers in given buffer - ****************************************************************************/ -void m6800_get_context(void *dst) -{ - if( dst ) - memmove(dst, (void *)&m6800, sizeof(m6800_Regs)); //*(m6800_Regs*)dst = m6800; -} - - -/**************************************************************************** - * Set all registers to given values - ****************************************************************************/ -void m6800_set_context(void *src) -{ - if( src ) - memmove((void *)&m6800, src, sizeof(m6800_Regs)); //m6800 = *(m6800_Regs*)src; - //CHANGE_PC(); - //CHECK_IRQ_LINES(); /* HJB 990417 */ -} - - -void m6800_set_irq_line(int irqline, int state) -{ - if (irqline == M6800_INPUT_LINE_NMI) - { - if (m6800.nmi_state == state) return; - LOG(("M6800#%d set_nmi_line %d \n", cpu_getactivecpu(), state)); - m6800.nmi_state = state; - if (state == M6800_CLEAR_LINE) return; - - /* NMI */ - ENTER_INTERRUPT("M6800#%d take NMI\n",0xfffc); - } - else - { - int eddge; - - if (m6800.irq_state[irqline] == state) return; - LOG(("M6800#%d set_irq_line %d,%d\n", cpu_getactivecpu(), irqline, state)); - m6800.irq_state[irqline] = state; - - switch(irqline) - { - case M6800_IRQ_LINE: - if (state == M6800_CLEAR_LINE) return; - break; - case M6800_TIN_LINE: - eddge = (state == M6800_CLEAR_LINE ) ? 2 : 0; - if( ((m6800.tcsr&TCSR_IEDG) ^ (state==M6800_CLEAR_LINE ? TCSR_IEDG : 0))==0 ) - return; - /* active edge in */ - m6800.tcsr |= TCSR_ICF; - m6800.pending_tcsr |= TCSR_ICF; - m6800.input_capture = CT; - MODIFIED_tcsr; - if( !(CC & 0x10) ) - CHECK_IRQ2 - break; - default: - return; - } - CHECK_IRQ_LINES(); /* HJB 990417 */ - } -} - -/**************************************************************************** - * Execute cycles CPU cycles. Return number of cycles really executed - ****************************************************************************/ -int m6800_execute(int cycles) -{ - UINT8 ireg; - m6800_ICount = cycles; - - CLEANUP_conters; - INCREMENT_COUNTER(m6800.extra_cycles); - m6800.extra_cycles = 0; - - do - { - if( m6800.wai_state & M6800_WAI ) - { - EAT_CYCLES; - } - else - { - pPPC = pPC; -// CALL_MAME_DEBUG; - ireg=M_RDOP(PCD); - PC++; - - switch( ireg ) - { - case 0x00: illegal(); break; - case 0x01: nop(); break; - case 0x02: illegal(); break; - case 0x03: illegal(); break; - case 0x04: illegal(); break; - case 0x05: illegal(); break; - case 0x06: tap(); break; - case 0x07: tpa(); break; - case 0x08: inx(); break; - case 0x09: dex(); break; - case 0x0A: CLV; break; - case 0x0B: SEV; break; - case 0x0C: CLC; break; - case 0x0D: SEC; break; - case 0x0E: cli(); break; - case 0x0F: sei(); break; - case 0x10: sba(); break; - case 0x11: cba(); break; - case 0x12: illegal(); break; - case 0x13: illegal(); break; - case 0x14: illegal(); break; - case 0x15: illegal(); break; - case 0x16: tab(); break; - case 0x17: tba(); break; - case 0x18: illegal(); break; - case 0x19: daa(); break; - case 0x1a: illegal(); break; - case 0x1b: aba(); break; - case 0x1c: illegal(); break; - case 0x1d: illegal(); break; - case 0x1e: illegal(); break; - case 0x1f: illegal(); break; - case 0x20: bra(); break; - case 0x21: brn(); break; - case 0x22: bhi(); break; - case 0x23: bls(); break; - case 0x24: bcc(); break; - case 0x25: bcs(); break; - case 0x26: bne(); break; - case 0x27: beq(); break; - case 0x28: bvc(); break; - case 0x29: bvs(); break; - case 0x2a: bpl(); break; - case 0x2b: bmi(); break; - case 0x2c: bge(); break; - case 0x2d: blt(); break; - case 0x2e: bgt(); break; - case 0x2f: ble(); break; - case 0x30: tsx(); break; - case 0x31: ins(); break; - case 0x32: pula(); break; - case 0x33: pulb(); break; - case 0x34: des(); break; - case 0x35: txs(); break; - case 0x36: psha(); break; - case 0x37: pshb(); break; - case 0x38: illegal(); break; - case 0x39: rts(); break; - case 0x3a: illegal(); break; - case 0x3b: rti(); break; - case 0x3c: illegal(); break; - case 0x3d: illegal(); break; - case 0x3e: wai(); break; - case 0x3f: swi(); break; - case 0x40: nega(); break; - case 0x41: illegal(); break; - case 0x42: illegal(); break; - case 0x43: coma(); break; - case 0x44: lsra(); break; - case 0x45: illegal(); break; - case 0x46: rora(); break; - case 0x47: asra(); break; - case 0x48: asla(); break; - case 0x49: rola(); break; - case 0x4a: deca(); break; - case 0x4b: illegal(); break; - case 0x4c: inca(); break; - case 0x4d: tsta(); break; - case 0x4e: illegal(); break; - case 0x4f: clra(); break; - case 0x50: negb(); break; - case 0x51: illegal(); break; - case 0x52: illegal(); break; - case 0x53: comb(); break; - case 0x54: lsrb(); break; - case 0x55: illegal(); break; - case 0x56: rorb(); break; - case 0x57: asrb(); break; - case 0x58: aslb(); break; - case 0x59: rolb(); break; - case 0x5a: decb(); break; - case 0x5b: illegal(); break; - case 0x5c: incb(); break; - case 0x5d: tstb(); break; - case 0x5e: illegal(); break; - case 0x5f: clrb(); break; - case 0x60: neg_ix(); break; - case 0x61: illegal(); break; - case 0x62: illegal(); break; - case 0x63: com_ix(); break; - case 0x64: lsr_ix(); break; - case 0x65: illegal(); break; - case 0x66: ror_ix(); break; - case 0x67: asr_ix(); break; - case 0x68: asl_ix(); break; - case 0x69: rol_ix(); break; - case 0x6a: dec_ix(); break; - case 0x6b: illegal(); break; - case 0x6c: inc_ix(); break; - case 0x6d: tst_ix(); break; - case 0x6e: jmp_ix(); break; - case 0x6f: clr_ix(); break; - case 0x70: neg_ex(); break; - case 0x71: illegal(); break; - case 0x72: illegal(); break; - case 0x73: com_ex(); break; - case 0x74: lsr_ex(); break; - case 0x75: illegal(); break; - case 0x76: ror_ex(); break; - case 0x77: asr_ex(); break; - case 0x78: asl_ex(); break; - case 0x79: rol_ex(); break; - case 0x7a: dec_ex(); break; - case 0x7b: illegal(); break; - case 0x7c: inc_ex(); break; - case 0x7d: tst_ex(); break; - case 0x7e: jmp_ex(); break; - case 0x7f: clr_ex(); break; - case 0x80: suba_im(); break; - case 0x81: cmpa_im(); break; - case 0x82: sbca_im(); break; - case 0x83: illegal(); break; - case 0x84: anda_im(); break; - case 0x85: bita_im(); break; - case 0x86: lda_im(); break; - case 0x87: sta_im(); break; - case 0x88: eora_im(); break; - case 0x89: adca_im(); break; - case 0x8a: ora_im(); break; - case 0x8b: adda_im(); break; - case 0x8c: cmpx_im(); break; - case 0x8d: bsr(); break; - case 0x8e: lds_im(); break; - case 0x8f: sts_im(); /* orthogonality */ break; - case 0x90: suba_di(); break; - case 0x91: cmpa_di(); break; - case 0x92: sbca_di(); break; - case 0x93: illegal(); break; - case 0x94: anda_di(); break; - case 0x95: bita_di(); break; - case 0x96: lda_di(); break; - case 0x97: sta_di(); break; - case 0x98: eora_di(); break; - case 0x99: adca_di(); break; - case 0x9a: ora_di(); break; - case 0x9b: adda_di(); break; - case 0x9c: cmpx_di(); break; - case 0x9d: jsr_di(); break; - case 0x9e: lds_di(); break; - case 0x9f: sts_di(); break; - case 0xa0: suba_ix(); break; - case 0xa1: cmpa_ix(); break; - case 0xa2: sbca_ix(); break; - case 0xa3: illegal(); break; - case 0xa4: anda_ix(); break; - case 0xa5: bita_ix(); break; - case 0xa6: lda_ix(); break; - case 0xa7: sta_ix(); break; - case 0xa8: eora_ix(); break; - case 0xa9: adca_ix(); break; - case 0xaa: ora_ix(); break; - case 0xab: adda_ix(); break; - case 0xac: cmpx_ix(); break; - case 0xad: jsr_ix(); break; - case 0xae: lds_ix(); break; - case 0xaf: sts_ix(); break; - case 0xb0: suba_ex(); break; - case 0xb1: cmpa_ex(); break; - case 0xb2: sbca_ex(); break; - case 0xb3: illegal(); break; - case 0xb4: anda_ex(); break; - case 0xb5: bita_ex(); break; - case 0xb6: lda_ex(); break; - case 0xb7: sta_ex(); break; - case 0xb8: eora_ex(); break; - case 0xb9: adca_ex(); break; - case 0xba: ora_ex(); break; - case 0xbb: adda_ex(); break; - case 0xbc: cmpx_ex(); break; - case 0xbd: jsr_ex(); break; - case 0xbe: lds_ex(); break; - case 0xbf: sts_ex(); break; - case 0xc0: subb_im(); break; - case 0xc1: cmpb_im(); break; - case 0xc2: sbcb_im(); break; - case 0xc3: illegal(); break; - case 0xc4: andb_im(); break; - case 0xc5: bitb_im(); break; - case 0xc6: ldb_im(); break; - case 0xc7: stb_im(); break; - case 0xc8: eorb_im(); break; - case 0xc9: adcb_im(); break; - case 0xca: orb_im(); break; - case 0xcb: addb_im(); break; - case 0xcc: illegal(); break; - case 0xcd: illegal(); break; - case 0xce: ldx_im(); break; - case 0xcf: stx_im(); break; - case 0xd0: subb_di(); break; - case 0xd1: cmpb_di(); break; - case 0xd2: sbcb_di(); break; - case 0xd3: illegal(); break; - case 0xd4: andb_di(); break; - case 0xd5: bitb_di(); break; - case 0xd6: ldb_di(); break; - case 0xd7: stb_di(); break; - case 0xd8: eorb_di(); break; - case 0xd9: adcb_di(); break; - case 0xda: orb_di(); break; - case 0xdb: addb_di(); break; - case 0xdc: illegal(); break; - case 0xdd: illegal(); break; - case 0xde: ldx_di(); break; - case 0xdf: stx_di(); break; - case 0xe0: subb_ix(); break; - case 0xe1: cmpb_ix(); break; - case 0xe2: sbcb_ix(); break; - case 0xe3: illegal(); break; - case 0xe4: andb_ix(); break; - case 0xe5: bitb_ix(); break; - case 0xe6: ldb_ix(); break; - case 0xe7: stb_ix(); break; - case 0xe8: eorb_ix(); break; - case 0xe9: adcb_ix(); break; - case 0xea: orb_ix(); break; - case 0xeb: addb_ix(); break; - case 0xec: illegal(); break; - case 0xed: illegal(); break; - case 0xee: ldx_ix(); break; - case 0xef: stx_ix(); break; - case 0xf0: subb_ex(); break; - case 0xf1: cmpb_ex(); break; - case 0xf2: sbcb_ex(); break; - case 0xf3: illegal(); break; - case 0xf4: andb_ex(); break; - case 0xf5: bitb_ex(); break; - case 0xf6: ldb_ex(); break; - case 0xf7: stb_ex(); break; - case 0xf8: eorb_ex(); break; - case 0xf9: adcb_ex(); break; - case 0xfa: orb_ex(); break; - case 0xfb: addb_ex(); break; - case 0xfc: addx_ex(); break; - case 0xfd: illegal(); break; - case 0xfe: ldx_ex(); break; - case 0xff: stx_ex(); break; - } - INCREMENT_COUNTER(cycles_6800[ireg]); - } - } while( m6800_ICount>0 ); - - INCREMENT_COUNTER(m6800.extra_cycles); - m6800.extra_cycles = 0; - - return cycles - m6800_ICount; -} - -/**************************************************************************** - * M6801 almost (fully?) equal to the M6803 - ****************************************************************************/ -#if (HAS_M6801) -void m6801_init() -{ -// m6800.subtype = SUBTYPE_M6801; - m6800.insn = m6803_insn; - m6800.cycles = cycles_6803; -// m6800.irq_callback = irqcallback; -// state_register("m6801", index); -} -#endif - -/**************************************************************************** - * M6802 almost (fully?) equal to the M6800 - ****************************************************************************/ -#if (HAS_M6802) -static void m6802_init(int index, int clock, const void *config, int (*irqcallback)(int)) -{ -// m6800.subtype = SUBTYPE_M6802; - m6800.insn = m6800_insn; - m6800.cycles = cycles_6800; - m6800.irq_callback = irqcallback; - state_register("m6802", index); -} -#endif - -/**************************************************************************** - * M6803 almost (fully?) equal to the M6801 - ****************************************************************************/ -#if (HAS_M6803) -void m6803_init() -{ -// m6800.subtype = SUBTYPE_M6803; - m6800.insn = m6803_insn; - m6800.cycles = cycles_6803; -// m6800.irq_callback = irqcallback; -// state_register("m6803", index); -} -#endif - -/**************************************************************************** - * Execute cycles CPU cycles. Return number of cycles really executed - ****************************************************************************/ -#if (HAS_M6803||HAS_M6801) -int m6803_execute(int cycles) -{ - UINT8 ireg; - m6800_ICount = cycles; - - CLEANUP_conters; - INCREMENT_COUNTER(m6803.extra_cycles); - m6803.extra_cycles = 0; - - do - { - if( m6803.wai_state & M6800_WAI ) - { - EAT_CYCLES; - } - else - { - pPPC = pPC; -// CALL_MAME_DEBUG; - ireg=M_RDOP(PCD); - PC++; - - switch( ireg ) - { - case 0x00: illegal(); break; - case 0x01: nop(); break; - case 0x02: illegal(); break; - case 0x03: illegal(); break; - case 0x04: lsrd(); /* 6803 only */; break; - case 0x05: asld(); /* 6803 only */; break; - case 0x06: tap(); break; - case 0x07: tpa(); break; - case 0x08: inx(); break; - case 0x09: dex(); break; - case 0x0A: CLV; break; - case 0x0B: SEV; break; - case 0x0C: CLC; break; - case 0x0D: SEC; break; - case 0x0E: cli(); break; - case 0x0F: sei(); break; - case 0x10: sba(); break; - case 0x11: cba(); break; - case 0x12: illegal(); break; - case 0x13: illegal(); break; - case 0x14: illegal(); break; - case 0x15: illegal(); break; - case 0x16: tab(); break; - case 0x17: tba(); break; - case 0x18: illegal(); break; - case 0x19: daa(); break; - case 0x1a: illegal(); break; - case 0x1b: aba(); break; - case 0x1c: illegal(); break; - case 0x1d: illegal(); break; - case 0x1e: illegal(); break; - case 0x1f: illegal(); break; - case 0x20: bra(); break; - case 0x21: brn(); break; - case 0x22: bhi(); break; - case 0x23: bls(); break; - case 0x24: bcc(); break; - case 0x25: bcs(); break; - case 0x26: bne(); break; - case 0x27: beq(); break; - case 0x28: bvc(); break; - case 0x29: bvs(); break; - case 0x2a: bpl(); break; - case 0x2b: bmi(); break; - case 0x2c: bge(); break; - case 0x2d: blt(); break; - case 0x2e: bgt(); break; - case 0x2f: ble(); break; - case 0x30: tsx(); break; - case 0x31: ins(); break; - case 0x32: pula(); break; - case 0x33: pulb(); break; - case 0x34: des(); break; - case 0x35: txs(); break; - case 0x36: psha(); break; - case 0x37: pshb(); break; - case 0x38: pulx(); /* 6803 only */ break; - case 0x39: rts(); break; - case 0x3a: abx(); /* 6803 only */ break; - case 0x3b: rti(); break; - case 0x3c: pshx(); /* 6803 only */ break; - case 0x3d: mul(); /* 6803 only */ break; - case 0x3e: wai(); break; - case 0x3f: swi(); break; - case 0x40: nega(); break; - case 0x41: illegal(); break; - case 0x42: illegal(); break; - case 0x43: coma(); break; - case 0x44: lsra(); break; - case 0x45: illegal(); break; - case 0x46: rora(); break; - case 0x47: asra(); break; - case 0x48: asla(); break; - case 0x49: rola(); break; - case 0x4a: deca(); break; - case 0x4b: illegal(); break; - case 0x4c: inca(); break; - case 0x4d: tsta(); break; - case 0x4e: illegal(); break; - case 0x4f: clra(); break; - case 0x50: negb(); break; - case 0x51: illegal(); break; - case 0x52: illegal(); break; - case 0x53: comb(); break; - case 0x54: lsrb(); break; - case 0x55: illegal(); break; - case 0x56: rorb(); break; - case 0x57: asrb(); break; - case 0x58: aslb(); break; - case 0x59: rolb(); break; - case 0x5a: decb(); break; - case 0x5b: illegal(); break; - case 0x5c: incb(); break; - case 0x5d: tstb(); break; - case 0x5e: illegal(); break; - case 0x5f: clrb(); break; - case 0x60: neg_ix(); break; - case 0x61: illegal(); break; - case 0x62: illegal(); break; - case 0x63: com_ix(); break; - case 0x64: lsr_ix(); break; - case 0x65: illegal(); break; - case 0x66: ror_ix(); break; - case 0x67: asr_ix(); break; - case 0x68: asl_ix(); break; - case 0x69: rol_ix(); break; - case 0x6a: dec_ix(); break; - case 0x6b: illegal(); break; - case 0x6c: inc_ix(); break; - case 0x6d: tst_ix(); break; - case 0x6e: jmp_ix(); break; - case 0x6f: clr_ix(); break; - case 0x70: neg_ex(); break; - case 0x71: illegal(); break; - case 0x72: illegal(); break; - case 0x73: com_ex(); break; - case 0x74: lsr_ex(); break; - case 0x75: illegal(); break; - case 0x76: ror_ex(); break; - case 0x77: asr_ex(); break; - case 0x78: asl_ex(); break; - case 0x79: rol_ex(); break; - case 0x7a: dec_ex(); break; - case 0x7b: illegal(); break; - case 0x7c: inc_ex(); break; - case 0x7d: tst_ex(); break; - case 0x7e: jmp_ex(); break; - case 0x7f: clr_ex(); break; - case 0x80: suba_im(); break; - case 0x81: cmpa_im(); break; - case 0x82: sbca_im(); break; - case 0x83: subd_im(); /* 6803 only */ break; - case 0x84: anda_im(); break; - case 0x85: bita_im(); break; - case 0x86: lda_im(); break; - case 0x87: sta_im(); break; - case 0x88: eora_im(); break; - case 0x89: adca_im(); break; - case 0x8a: ora_im(); break; - case 0x8b: adda_im(); break; - case 0x8c: cpx_im(); /* 6803 difference */ break; - case 0x8d: bsr(); break; - case 0x8e: lds_im(); break; - case 0x8f: sts_im(); /* orthogonality */ break; - case 0x90: suba_di(); break; - case 0x91: cmpa_di(); break; - case 0x92: sbca_di(); break; - case 0x93: subd_di(); /* 6803 only */ break; - case 0x94: anda_di(); break; - case 0x95: bita_di(); break; - case 0x96: lda_di(); break; - case 0x97: sta_di(); break; - case 0x98: eora_di(); break; - case 0x99: adca_di(); break; - case 0x9a: ora_di(); break; - case 0x9b: adda_di(); break; - case 0x9c: cpx_di(); /* 6803 difference */ break; - case 0x9d: jsr_di(); break; - case 0x9e: lds_di(); break; - case 0x9f: sts_di(); break; - case 0xa0: suba_ix(); break; - case 0xa1: cmpa_ix(); break; - case 0xa2: sbca_ix(); break; - case 0xa3: subd_ix(); /* 6803 only */ break; - case 0xa4: anda_ix(); break; - case 0xa5: bita_ix(); break; - case 0xa6: lda_ix(); break; - case 0xa7: sta_ix(); break; - case 0xa8: eora_ix(); break; - case 0xa9: adca_ix(); break; - case 0xaa: ora_ix(); break; - case 0xab: adda_ix(); break; - case 0xac: cpx_ix(); /* 6803 difference */ break; - case 0xad: jsr_ix(); break; - case 0xae: lds_ix(); break; - case 0xaf: sts_ix(); break; - case 0xb0: suba_ex(); break; - case 0xb1: cmpa_ex(); break; - case 0xb2: sbca_ex(); break; - case 0xb3: subd_ex(); /* 6803 only */ break; - case 0xb4: anda_ex(); break; - case 0xb5: bita_ex(); break; - case 0xb6: lda_ex(); break; - case 0xb7: sta_ex(); break; - case 0xb8: eora_ex(); break; - case 0xb9: adca_ex(); break; - case 0xba: ora_ex(); break; - case 0xbb: adda_ex(); break; - case 0xbc: cpx_ex(); /* 6803 difference */ break; - case 0xbd: jsr_ex(); break; - case 0xbe: lds_ex(); break; - case 0xbf: sts_ex(); break; - case 0xc0: subb_im(); break; - case 0xc1: cmpb_im(); break; - case 0xc2: sbcb_im(); break; - case 0xc3: addd_im(); /* 6803 only */ break; - case 0xc4: andb_im(); break; - case 0xc5: bitb_im(); break; - case 0xc6: ldb_im(); break; - case 0xc7: stb_im(); break; - case 0xc8: eorb_im(); break; - case 0xc9: adcb_im(); break; - case 0xca: orb_im(); break; - case 0xcb: addb_im(); break; - case 0xcc: ldd_im(); /* 6803 only */ break; - case 0xcd: std_im(); /* 6803 only -- orthogonality */ break; - case 0xce: ldx_im(); break; - case 0xcf: stx_im(); break; - case 0xd0: subb_di(); break; - case 0xd1: cmpb_di(); break; - case 0xd2: sbcb_di(); break; - case 0xd3: addd_di(); /* 6803 only */ break; - case 0xd4: andb_di(); break; - case 0xd5: bitb_di(); break; - case 0xd6: ldb_di(); break; - case 0xd7: stb_di(); break; - case 0xd8: eorb_di(); break; - case 0xd9: adcb_di(); break; - case 0xda: orb_di(); break; - case 0xdb: addb_di(); break; - case 0xdc: ldd_di(); /* 6803 only */ break; - case 0xdd: std_di(); /* 6803 only */ break; - case 0xde: ldx_di(); break; - case 0xdf: stx_di(); break; - case 0xe0: subb_ix(); break; - case 0xe1: cmpb_ix(); break; - case 0xe2: sbcb_ix(); break; - case 0xe3: addd_ix(); /* 6803 only */ break; - case 0xe4: andb_ix(); break; - case 0xe5: bitb_ix(); break; - case 0xe6: ldb_ix(); break; - case 0xe7: stb_ix(); break; - case 0xe8: eorb_ix(); break; - case 0xe9: adcb_ix(); break; - case 0xea: orb_ix(); break; - case 0xeb: addb_ix(); break; - case 0xec: ldd_ix(); /* 6803 only */ break; - case 0xed: std_ix(); /* 6803 only */ break; - case 0xee: ldx_ix(); break; - case 0xef: stx_ix(); break; - case 0xf0: subb_ex(); break; - case 0xf1: cmpb_ex(); break; - case 0xf2: sbcb_ex(); break; - case 0xf3: addd_ex(); /* 6803 only */ break; - case 0xf4: andb_ex(); break; - case 0xf5: bitb_ex(); break; - case 0xf6: ldb_ex(); break; - case 0xf7: stb_ex(); break; - case 0xf8: eorb_ex(); break; - case 0xf9: adcb_ex(); break; - case 0xfa: orb_ex(); break; - case 0xfb: addb_ex(); break; - case 0xfc: ldd_ex(); /* 6803 only */ break; - case 0xfd: std_ex(); /* 6803 only */ break; - case 0xfe: ldx_ex(); break; - case 0xff: stx_ex(); break; - } - INCREMENT_COUNTER(cycles_6803[ireg]); - } - } while( m6800_ICount>0 ); - - INCREMENT_COUNTER(m6803.extra_cycles); - m6803.extra_cycles = 0; - - return cycles - m6800_ICount; -} -#endif - -#if (HAS_M6803) - -//static READ8_HANDLER( m6803_internal_registers_r ); -//static WRITE8_HANDLER( m6803_internal_registers_w ); - -//static ADDRESS_MAP_START(m6803_mem, ADDRESS_SPACE_PROGRAM, 8) -// AM_RANGE(0x0000, 0x001f) AM_READWRITE(m6803_internal_registers_r, m6803_internal_registers_w) -// AM_RANGE(0x0020, 0x007f) AM_NOP /* unused */ -// AM_RANGE(0x0080, 0x00ff) AM_RAM /* 6803 internal RAM */ -//ADDRESS_MAP_END - -#endif - -/**************************************************************************** - * M6808 almost (fully?) equal to the M6800 - ****************************************************************************/ -#if (HAS_M6808) -static void m6808_init(int index, int clock, const void *config, int (*irqcallback)(int)) -{ -// m6800.subtype = SUBTYPE_M6808; - m6800.insn = m6800_insn; - m6800.cycles = cycles_6800; - m6800.irq_callback = irqcallback; - state_register("m6808", index); -} -#endif - -/**************************************************************************** - * HD63701 similiar to the M6800 - ****************************************************************************/ -#if (HAS_HD63701) -void hd63701_init() -{ -// m6800.subtype = SUBTYPE_HD63701; - m6800.insn = hd63701_insn; - m6800.cycles = cycles_63701; -// m6800.irq_callback = irqcallback; -// state_register("hd63701", index); -} -/**************************************************************************** - * Execute cycles CPU cycles. Return number of cycles really executed - ****************************************************************************/ -int hd63701_execute(int cycles) -{ - UINT8 ireg; - m6800_ICount = cycles; - - CLEANUP_conters; - INCREMENT_COUNTER(hd63701.extra_cycles); - hd63701.extra_cycles = 0; - - do - { - if( hd63701.wai_state & (HD63701_WAI|HD63701_SLP) ) - { - EAT_CYCLES; - } - else - { - pPPC = pPC; -// CALL_MAME_DEBUG; - ireg=M_RDOP(PCD); - PC++; - - switch( ireg ) - { - case 0x00: trap(); break; - case 0x01: nop(); break; - case 0x02: trap(); break; - case 0x03: trap(); break; - case 0x04: lsrd(); /* 6803 only */; break; - case 0x05: asld(); /* 6803 only */; break; - case 0x06: tap(); break; - case 0x07: tpa(); break; - case 0x08: inx(); break; - case 0x09: dex(); break; - case 0x0A: CLV; break; - case 0x0B: SEV; break; - case 0x0C: CLC; break; - case 0x0D: SEC; break; - case 0x0E: cli(); break; - case 0x0F: sei(); break; - case 0x10: sba(); break; - case 0x11: cba(); break; - case 0x12: undoc1(); break; - case 0x13: undoc2(); break; - case 0x14: trap(); break; - case 0x15: trap(); break; - case 0x16: tab(); break; - case 0x17: tba(); break; - case 0x18: xgdx(); /* HD63701YO only */; break; - case 0x19: daa(); break; - case 0x1a: slp(); break; - case 0x1b: aba(); break; - case 0x1c: trap(); break; - case 0x1d: trap(); break; - case 0x1e: trap(); break; - case 0x1f: trap(); break; - case 0x20: bra(); break; - case 0x21: brn(); break; - case 0x22: bhi(); break; - case 0x23: bls(); break; - case 0x24: bcc(); break; - case 0x25: bcs(); break; - case 0x26: bne(); break; - case 0x27: beq(); break; - case 0x28: bvc(); break; - case 0x29: bvs(); break; - case 0x2a: bpl(); break; - case 0x2b: bmi(); break; - case 0x2c: bge(); break; - case 0x2d: blt(); break; - case 0x2e: bgt(); break; - case 0x2f: ble(); break; - case 0x30: tsx(); break; - case 0x31: ins(); break; - case 0x32: pula(); break; - case 0x33: pulb(); break; - case 0x34: des(); break; - case 0x35: txs(); break; - case 0x36: psha(); break; - case 0x37: pshb(); break; - case 0x38: pulx(); /* 6803 only */ break; - case 0x39: rts(); break; - case 0x3a: abx(); /* 6803 only */ break; - case 0x3b: rti(); break; - case 0x3c: pshx(); /* 6803 only */ break; - case 0x3d: mul(); /* 6803 only */ break; - case 0x3e: wai(); break; - case 0x3f: swi(); break; - case 0x40: nega(); break; - case 0x41: trap(); break; - case 0x42: trap(); break; - case 0x43: coma(); break; - case 0x44: lsra(); break; - case 0x45: trap(); break; - case 0x46: rora(); break; - case 0x47: asra(); break; - case 0x48: asla(); break; - case 0x49: rola(); break; - case 0x4a: deca(); break; - case 0x4b: trap(); break; - case 0x4c: inca(); break; - case 0x4d: tsta(); break; - case 0x4e: trap(); break; - case 0x4f: clra(); break; - case 0x50: negb(); break; - case 0x51: trap(); break; - case 0x52: trap(); break; - case 0x53: comb(); break; - case 0x54: lsrb(); break; - case 0x55: trap(); break; - case 0x56: rorb(); break; - case 0x57: asrb(); break; - case 0x58: aslb(); break; - case 0x59: rolb(); break; - case 0x5a: decb(); break; - case 0x5b: trap(); break; - case 0x5c: incb(); break; - case 0x5d: tstb(); break; - case 0x5e: trap(); break; - case 0x5f: clrb(); break; - case 0x60: neg_ix(); break; - case 0x61: aim_ix(); /* HD63701YO only */; break; - case 0x62: oim_ix(); /* HD63701YO only */; break; - case 0x63: com_ix(); break; - case 0x64: lsr_ix(); break; - case 0x65: eim_ix(); /* HD63701YO only */; break; - case 0x66: ror_ix(); break; - case 0x67: asr_ix(); break; - case 0x68: asl_ix(); break; - case 0x69: rol_ix(); break; - case 0x6a: dec_ix(); break; - case 0x6b: tim_ix(); /* HD63701YO only */; break; - case 0x6c: inc_ix(); break; - case 0x6d: tst_ix(); break; - case 0x6e: jmp_ix(); break; - case 0x6f: clr_ix(); break; - case 0x70: neg_ex(); break; - case 0x71: aim_di(); /* HD63701YO only */; break; - case 0x72: oim_di(); /* HD63701YO only */; break; - case 0x73: com_ex(); break; - case 0x74: lsr_ex(); break; - case 0x75: eim_di(); /* HD63701YO only */; break; - case 0x76: ror_ex(); break; - case 0x77: asr_ex(); break; - case 0x78: asl_ex(); break; - case 0x79: rol_ex(); break; - case 0x7a: dec_ex(); break; - case 0x7b: tim_di(); /* HD63701YO only */; break; - case 0x7c: inc_ex(); break; - case 0x7d: tst_ex(); break; - case 0x7e: jmp_ex(); break; - case 0x7f: clr_ex(); break; - case 0x80: suba_im(); break; - case 0x81: cmpa_im(); break; - case 0x82: sbca_im(); break; - case 0x83: subd_im(); /* 6803 only */ break; - case 0x84: anda_im(); break; - case 0x85: bita_im(); break; - case 0x86: lda_im(); break; - case 0x87: sta_im(); break; - case 0x88: eora_im(); break; - case 0x89: adca_im(); break; - case 0x8a: ora_im(); break; - case 0x8b: adda_im(); break; - case 0x8c: cpx_im(); /* 6803 difference */ break; - case 0x8d: bsr(); break; - case 0x8e: lds_im(); break; - case 0x8f: sts_im(); /* orthogonality */ break; - case 0x90: suba_di(); break; - case 0x91: cmpa_di(); break; - case 0x92: sbca_di(); break; - case 0x93: subd_di(); /* 6803 only */ break; - case 0x94: anda_di(); break; - case 0x95: bita_di(); break; - case 0x96: lda_di(); break; - case 0x97: sta_di(); break; - case 0x98: eora_di(); break; - case 0x99: adca_di(); break; - case 0x9a: ora_di(); break; - case 0x9b: adda_di(); break; - case 0x9c: cpx_di(); /* 6803 difference */ break; - case 0x9d: jsr_di(); break; - case 0x9e: lds_di(); break; - case 0x9f: sts_di(); break; - case 0xa0: suba_ix(); break; - case 0xa1: cmpa_ix(); break; - case 0xa2: sbca_ix(); break; - case 0xa3: subd_ix(); /* 6803 only */ break; - case 0xa4: anda_ix(); break; - case 0xa5: bita_ix(); break; - case 0xa6: lda_ix(); break; - case 0xa7: sta_ix(); break; - case 0xa8: eora_ix(); break; - case 0xa9: adca_ix(); break; - case 0xaa: ora_ix(); break; - case 0xab: adda_ix(); break; - case 0xac: cpx_ix(); /* 6803 difference */ break; - case 0xad: jsr_ix(); break; - case 0xae: lds_ix(); break; - case 0xaf: sts_ix(); break; - case 0xb0: suba_ex(); break; - case 0xb1: cmpa_ex(); break; - case 0xb2: sbca_ex(); break; - case 0xb3: subd_ex(); /* 6803 only */ break; - case 0xb4: anda_ex(); break; - case 0xb5: bita_ex(); break; - case 0xb6: lda_ex(); break; - case 0xb7: sta_ex(); break; - case 0xb8: eora_ex(); break; - case 0xb9: adca_ex(); break; - case 0xba: ora_ex(); break; - case 0xbb: adda_ex(); break; - case 0xbc: cpx_ex(); /* 6803 difference */ break; - case 0xbd: jsr_ex(); break; - case 0xbe: lds_ex(); break; - case 0xbf: sts_ex(); break; - case 0xc0: subb_im(); break; - case 0xc1: cmpb_im(); break; - case 0xc2: sbcb_im(); break; - case 0xc3: addd_im(); /* 6803 only */ break; - case 0xc4: andb_im(); break; - case 0xc5: bitb_im(); break; - case 0xc6: ldb_im(); break; - case 0xc7: stb_im(); break; - case 0xc8: eorb_im(); break; - case 0xc9: adcb_im(); break; - case 0xca: orb_im(); break; - case 0xcb: addb_im(); break; - case 0xcc: ldd_im(); /* 6803 only */ break; - case 0xcd: std_im(); /* 6803 only -- orthogonality */ break; - case 0xce: ldx_im(); break; - case 0xcf: stx_im(); break; - case 0xd0: subb_di(); break; - case 0xd1: cmpb_di(); break; - case 0xd2: sbcb_di(); break; - case 0xd3: addd_di(); /* 6803 only */ break; - case 0xd4: andb_di(); break; - case 0xd5: bitb_di(); break; - case 0xd6: ldb_di(); break; - case 0xd7: stb_di(); break; - case 0xd8: eorb_di(); break; - case 0xd9: adcb_di(); break; - case 0xda: orb_di(); break; - case 0xdb: addb_di(); break; - case 0xdc: ldd_di(); /* 6803 only */ break; - case 0xdd: std_di(); /* 6803 only */ break; - case 0xde: ldx_di(); break; - case 0xdf: stx_di(); break; - case 0xe0: subb_ix(); break; - case 0xe1: cmpb_ix(); break; - case 0xe2: sbcb_ix(); break; - case 0xe3: addd_ix(); /* 6803 only */ break; - case 0xe4: andb_ix(); break; - case 0xe5: bitb_ix(); break; - case 0xe6: ldb_ix(); break; - case 0xe7: stb_ix(); break; - case 0xe8: eorb_ix(); break; - case 0xe9: adcb_ix(); break; - case 0xea: orb_ix(); break; - case 0xeb: addb_ix(); break; - case 0xec: ldd_ix(); /* 6803 only */ break; - case 0xed: std_ix(); /* 6803 only */ break; - case 0xee: ldx_ix(); break; - case 0xef: stx_ix(); break; - case 0xf0: subb_ex(); break; - case 0xf1: cmpb_ex(); break; - case 0xf2: sbcb_ex(); break; - case 0xf3: addd_ex(); /* 6803 only */ break; - case 0xf4: andb_ex(); break; - case 0xf5: bitb_ex(); break; - case 0xf6: ldb_ex(); break; - case 0xf7: stb_ex(); break; - case 0xf8: eorb_ex(); break; - case 0xf9: adcb_ex(); break; - case 0xfa: orb_ex(); break; - case 0xfb: addb_ex(); break; - case 0xfc: ldd_ex(); /* 6803 only */ break; - case 0xfd: std_ex(); /* 6803 only */ break; - case 0xfe: ldx_ex(); break; - case 0xff: stx_ex(); break; - } - INCREMENT_COUNTER(cycles_63701[ireg]); - } - } while( m6800_ICount>0 ); - - INCREMENT_COUNTER(hd63701.extra_cycles); - hd63701.extra_cycles = 0; - - return cycles - m6800_ICount; -} - -/* - if change_pc() direccted these areas ,Call hd63701_trap_pc(). - 'mode' is selected by the sense of p2.0,p2.1,and p2.3 at reset timming. - mode 0,1,2,4,6 : $0000-$001f - mode 5 : $0000-$001f,$0200-$efff - mode 7 : $0000-$001f,$0100-$efff -*/ -void hd63701_trap_pc(void) -{ - TAKE_TRAP; -} - -//static READ8_HANDLER( m6803_internal_registers_r ); -//static WRITE8_HANDLER( m6803_internal_registers_w ); - -//READ8_HANDLER( hd63701_internal_registers_r ) -//{ -// return m6803_internal_registers_r(offset); -//} - -//WRITE8_HANDLER( hd63701_internal_registers_w ) -//{ -// m6803_internal_registers_w(offset,data); -//} -#endif - -/**************************************************************************** - * NSC-8105 similiar to the M6800, but the opcodes are scrambled and there - * is at least one new opcode ($fc) - ****************************************************************************/ -#if (HAS_NSC8105) -void nsc8105_init() -{ -// m6800.subtype = SUBTYPE_NSC8105; - m6800.insn = nsc8105_insn; - m6800.cycles = cycles_nsc8105; - //state_register("nsc8105", index); -} -/**************************************************************************** - * Execute cycles CPU cycles. Return number of cycles really executed - ****************************************************************************/ -int nsc8105_execute(int cycles) -{ - UINT8 ireg; - m6800_ICount = cycles; - - CLEANUP_conters; - INCREMENT_COUNTER(nsc8105.extra_cycles); - nsc8105.extra_cycles = 0; - - do - { - if( nsc8105.wai_state & NSC8105_WAI ) - { - EAT_CYCLES; - } - else - { - pPPC = pPC; - //CALL_MAME_DEBUG; - ireg=M_RDOP(PCD); - PC++; - - switch( ireg ) - { - case 0x00: illegal(); break; - case 0x01: illegal(); break; - case 0x02: nop(); break; - case 0x03: illegal(); break; - case 0x04: illegal(); break; - case 0x05: tap(); break; - case 0x06: illegal(); break; - case 0x07: tpa(); break; - case 0x08: inx(); break; - case 0x09: CLV; break; - case 0x0a: dex(); break; - case 0x0b: SEV; break; - case 0x0c: CLC; break; - case 0x0d: cli(); break; - case 0x0e: SEC; break; - case 0x0f: sei(); break; - case 0x10: sba(); break; - case 0x11: illegal(); break; - case 0x12: cba(); break; - case 0x13: illegal(); break; - case 0x14: illegal(); break; - case 0x15: tab(); break; - case 0x16: illegal(); break; - case 0x17: tba(); break; - case 0x18: illegal(); break; - case 0x19: illegal(); break; - case 0x1a: daa(); break; - case 0x1b: aba(); break; - case 0x1c: illegal(); break; - case 0x1d: illegal(); break; - case 0x1e: illegal(); break; - case 0x1f: illegal(); break; - case 0x20: bra(); break; - case 0x21: bhi(); break; - case 0x22: brn(); break; - case 0x23: bls(); break; - case 0x24: bcc(); break; - case 0x25: bne(); break; - case 0x26: bcs(); break; - case 0x27: beq(); break; - case 0x28: bvc(); break; - case 0x29: bpl(); break; - case 0x2a: bvs(); break; - case 0x2b: bmi(); break; - case 0x2c: bge(); break; - case 0x2d: bgt(); break; - case 0x2e: blt(); break; - case 0x2f: ble(); break; - case 0x30: tsx(); break; - case 0x31: pula(); break; - case 0x32: ins(); break; - case 0x33: pulb(); break; - case 0x34: des(); break; - case 0x35: psha(); break; - case 0x36: txs(); break; - case 0x37: pshb(); break; - case 0x38: illegal(); break; - case 0x39: illegal(); break; - case 0x3a: rts(); break; - case 0x3b: rti(); break; - case 0x3c: illegal(); break; - case 0x3d: wai(); break; - case 0x3e: illegal(); break; - case 0x3f: swi(); break; - case 0x40: suba_im(); break; - case 0x41: sbca_im(); break; - case 0x42: cmpa_im(); break; - case 0x43: illegal(); break; - case 0x44: anda_im(); break; - case 0x45: lda_im(); break; - case 0x46: bita_im(); break; - case 0x47: sta_im(); break; - case 0x48: eora_im(); break; - case 0x49: ora_im(); break; - case 0x4a: adca_im(); break; - case 0x4b: adda_im(); break; - case 0x4c: cmpx_im(); break; - case 0x4d: lds_im(); break; - case 0x4e: bsr(); break; - case 0x4f: sts_im(); /* orthogonality */ break; - case 0x50: suba_di(); break; - case 0x51: sbca_di(); break; - case 0x52: cmpa_di(); break; - case 0x53: illegal(); break; - case 0x54: anda_di(); break; - case 0x55: lda_di(); break; - case 0x56: bita_di(); break; - case 0x57: sta_di(); break; - case 0x58: eora_di(); break; - case 0x59: ora_di(); break; - case 0x5a: adca_di(); break; - case 0x5b: adda_di(); break; - case 0x5c: cmpx_di(); break; - case 0x5d: lds_di(); break; - case 0x5e: jsr_di(); break; - case 0x5f: sts_di(); break; - case 0x60: suba_ix(); break; - case 0x61: sbca_ix(); break; - case 0x62: cmpa_ix(); break; - case 0x63: illegal(); break; - case 0x64: anda_ix(); break; - case 0x65: lda_ix(); break; - case 0x66: bita_ix(); break; - case 0x67: sta_ix(); break; - case 0x68: eora_ix(); break; - case 0x69: ora_ix(); break; - case 0x6a: adca_ix(); break; - case 0x6b: adda_ix(); break; - case 0x6c: cmpx_ix(); break; - case 0x6d: lds_ix(); break; - case 0x6e: jsr_ix(); break; - case 0x6f: sts_ix(); break; - case 0x70: suba_ex(); break; - case 0x71: sbca_ex(); break; - case 0x72: cmpa_ex(); break; - case 0x73: illegal(); break; - case 0x74: anda_ex(); break; - case 0x75: lda_ex(); break; - case 0x76: bita_ex(); break; - case 0x77: sta_ex(); break; - case 0x78: eora_ex(); break; - case 0x79: ora_ex(); break; - case 0x7a: adca_ex(); break; - case 0x7b: adda_ex(); break; - case 0x7c: cmpx_ex(); break; - case 0x7d: lds_ex(); break; - case 0x7e: jsr_ex(); break; - case 0x7f: sts_ex(); break; - case 0x80: nega(); break; - case 0x81: illegal(); break; - case 0x82: illegal(); break; - case 0x83: coma(); break; - case 0x84: lsra(); break; - case 0x85: rora(); break; - case 0x86: illegal(); break; - case 0x87: asra(); break; - case 0x88: asla(); break; - case 0x89: deca(); break; - case 0x8a: rola(); break; - case 0x8b: illegal(); break; - case 0x8c: inca(); break; - case 0x8d: illegal(); break; - case 0x8e: tsta(); break; - case 0x8f: clra(); break; - case 0x90: negb(); break; - case 0x91: illegal(); break; - case 0x92: illegal(); break; - case 0x93: comb(); break; - case 0x94: lsrb(); break; - case 0x95: rorb(); break; - case 0x96: illegal(); break; - case 0x97: asrb(); break; - case 0x98: aslb(); break; - case 0x99: decb(); break; - case 0x9a: rolb(); break; - case 0x9b: illegal(); break; - case 0x9c: incb(); break; - case 0x9d: illegal(); break; - case 0x9e: tstb(); break; - case 0x9f: clrb(); break; - case 0xa0: neg_ix(); break; - case 0xa1: illegal(); break; - case 0xa2: illegal(); break; - case 0xa3: com_ix(); break; - case 0xa4: lsr_ix(); break; - case 0xa5: ror_ix(); break; - case 0xa6: illegal(); break; - case 0xa7: asr_ix(); break; - case 0xa8: asl_ix(); break; - case 0xa9: dec_ix(); break; - case 0xaa: rol_ix(); break; - case 0xab: illegal(); break; - case 0xac: inc_ix(); break; - case 0xad: jmp_ix(); break; - case 0xae: tst_ix(); break; - case 0xaf: clr_ix(); break; - case 0xb0: neg_ex(); break; - case 0xb1: illegal(); break; - case 0xb2: illegal(); break; - case 0xb3: com_ex(); break; - case 0xb4: lsr_ex(); break; - case 0xb5: ror_ex(); break; - case 0xb6: illegal(); break; - case 0xb7: asr_ex(); break; - case 0xb8: asl_ex(); break; - case 0xb9: dec_ex(); break; - case 0xba: rol_ex(); break; - case 0xbb: illegal(); break; - case 0xbc: inc_ex(); break; - case 0xbd: jmp_ex(); break; - case 0xbe: tst_ex(); break; - case 0xbf: clr_ex(); break; - case 0xc0: subb_im(); break; - case 0xc1: sbcb_im(); break; - case 0xc2: cmpb_im(); break; - case 0xc3: illegal(); break; - case 0xc4: andb_im(); break; - case 0xc5: ldb_im(); break; - case 0xc6: bitb_im(); break; - case 0xc7: stb_im(); break; - case 0xc8: eorb_im(); break; - case 0xc9: orb_im(); break; - case 0xca: adcb_im(); break; - case 0xcb: addb_im(); break; - case 0xcc: illegal(); break; - case 0xcd: ldx_im(); break; - case 0xce: illegal(); break; - case 0xcf: stx_im(); break; - case 0xd0: subb_di(); break; - case 0xd1: sbcb_di(); break; - case 0xd2: cmpb_di(); break; - case 0xd3: illegal(); break; - case 0xd4: andb_di(); break; - case 0xd5: ldb_di(); break; - case 0xd6: bitb_di(); break; - case 0xd7: stb_di(); break; - case 0xd8: eorb_di(); break; - case 0xd9: orb_di(); break; - case 0xda: adcb_di(); break; - case 0xdb: addb_di(); break; - case 0xdc: illegal(); break; - case 0xdd: ldx_di(); break; - case 0xde: illegal(); break; - case 0xdf: stx_di(); break; - case 0xe0: subb_ix(); break; - case 0xe1: sbcb_ix(); break; - case 0xe2: cmpb_ix(); break; - case 0xe3: illegal(); break; - case 0xe4: andb_ix(); break; - case 0xe5: ldb_ix(); break; - case 0xe6: bitb_ix(); break; - case 0xe7: stb_ix(); break; - case 0xe8: eorb_ix(); break; - case 0xe9: orb_ix(); break; - case 0xea: adcb_ix(); break; - case 0xeb: addb_ix(); break; - case 0xec: adcx_im(); break; /* NSC8105 only */ - case 0xed: ldx_ix(); break; - case 0xee: illegal(); break; - case 0xef: stx_ix(); break; - case 0xf0: subb_ex(); break; - case 0xf1: sbcb_ex(); break; - case 0xf2: cmpb_ex(); break; - case 0xf3: illegal(); break; - case 0xf4: andb_ex(); break; - case 0xf5: ldb_ex(); break; - case 0xf6: bitb_ex(); break; - case 0xf7: stb_ex(); break; - case 0xf8: eorb_ex(); break; - case 0xf9: orb_ex(); break; - case 0xfa: adcb_ex(); break; - case 0xfb: addb_ex(); break; - case 0xfc: addx_ex(); break; - case 0xfd: ldx_ex(); break; - case 0xfe: illegal(); break; - case 0xff: stx_ex(); break; - } - INCREMENT_COUNTER(cycles_nsc8105[ireg]); - } - } while( m6800_ICount>0 ); - - INCREMENT_COUNTER(nsc8105.extra_cycles); - nsc8105.extra_cycles = 0; - - return cycles - m6800_ICount; -} -#endif - - -#if (HAS_M6803||HAS_HD63701) - -unsigned char m6803_internal_registers_r(unsigned short offset) -{ - switch (offset) - { - case 0x00: - return m6800.port1_ddr; - case 0x01: - return m6800.port2_ddr; - case 0x02: - return (M6800_io_read_byte_8(M6803_PORT1) & (m6800.port1_ddr ^ 0xff)) - | (m6800.port1_data & m6800.port1_ddr); - case 0x03: - return (M6800_io_read_byte_8(M6803_PORT2) & (m6800.port2_ddr ^ 0xff)) - | (m6800.port2_data & m6800.port2_ddr); - case 0x04: - return m6800.port3_ddr; - case 0x05: - return m6800.port4_ddr; - case 0x06: - return (M6800_io_read_byte_8(M6803_PORT3) & (m6800.port3_ddr ^ 0xff)) - | (m6800.port3_data & m6800.port3_ddr); - case 0x07: - return (M6800_io_read_byte_8(M6803_PORT4) & (m6800.port4_ddr ^ 0xff)) - | (m6800.port4_data & m6800.port4_ddr); - case 0x08: - m6800.pending_tcsr = 0; -//logerror("CPU #%d PC %04x: warning - read TCSR register\n",cpu_getactivecpu(),activecpu_get_pc()); - return m6800.tcsr; - case 0x09: - if(!(m6800.pending_tcsr&TCSR_TOF)) - { - m6800.tcsr &= ~TCSR_TOF; - MODIFIED_tcsr; - } - return m6800.counter.b.h; - case 0x0a: - return m6800.counter.b.l; - case 0x0b: - if(!(m6800.pending_tcsr&TCSR_OCF)) - { - m6800.tcsr &= ~TCSR_OCF; - MODIFIED_tcsr; - } - return m6800.output_compare.b.h; - case 0x0c: - if(!(m6800.pending_tcsr&TCSR_OCF)) - { - m6800.tcsr &= ~TCSR_OCF; - MODIFIED_tcsr; - } - return m6800.output_compare.b.l; - case 0x0d: - if(!(m6800.pending_tcsr&TCSR_ICF)) - { - m6800.tcsr &= ~TCSR_ICF; - MODIFIED_tcsr; - } - return (m6800.input_capture >> 0) & 0xff; - case 0x0e: - return (m6800.input_capture >> 8) & 0xff; - case 0x0f: - case 0x10: - case 0x11: - case 0x12: - case 0x13: -// logerror("CPU #%d PC %04x: warning - read from unsupported internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); - return 0; - case 0x14: -// logerror("CPU #%d PC %04x: read RAM control register\n",cpu_getactivecpu(),activecpu_get_pc()); - return m6800.ram_ctrl; - case 0x15: - case 0x16: - case 0x17: - case 0x18: - case 0x19: - case 0x1a: - case 0x1b: - case 0x1c: - case 0x1d: - case 0x1e: - case 0x1f: - default: -// logerror("CPU #%d PC %04x: warning - read from reserved internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); - return 0; - } -} - -void m6803_internal_registers_w(unsigned short offset, unsigned char data) -{ - static int latch09; - - switch (offset) - { - case 0x00: - if (m6800.port1_ddr != data) - { - m6800.port1_ddr = data; - if(m6800.port1_ddr == 0xff) - M6800_io_write_byte_8(M6803_PORT1,m6800.port1_data); - else - M6800_io_write_byte_8(M6803_PORT1,(m6800.port1_data & m6800.port1_ddr) - | (M6800_io_read_byte_8(M6803_PORT1) & (m6800.port1_ddr ^ 0xff))); - } - break; - case 0x01: - if (m6800.port2_ddr != data) - { - m6800.port2_ddr = data; - if(m6800.port2_ddr == 0xff) - M6800_io_write_byte_8(M6803_PORT2,m6800.port2_data); - else - M6800_io_write_byte_8(M6803_PORT2,(m6800.port2_data & m6800.port2_ddr) - | (M6800_io_read_byte_8(M6803_PORT2) & (m6800.port2_ddr ^ 0xff))); - -// if (m6800.port2_ddr & 2) -// logerror("CPU #%d PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n",cpu_getactivecpu(),activecpu_get_pc()); - } - break; - case 0x02: - m6800.port1_data = data; - if(m6800.port1_ddr == 0xff) - M6800_io_write_byte_8(M6803_PORT1,m6800.port1_data); - else - M6800_io_write_byte_8(M6803_PORT1,(m6800.port1_data & m6800.port1_ddr) - | (M6800_io_read_byte_8(M6803_PORT1) & (m6800.port1_ddr ^ 0xff))); - break; - case 0x03: - m6800.port2_data = data; - m6800.port2_ddr = data; - if(m6800.port2_ddr == 0xff) - M6800_io_write_byte_8(M6803_PORT2,m6800.port2_data); - else - M6800_io_write_byte_8(M6803_PORT2,(m6800.port2_data & m6800.port2_ddr) - | (M6800_io_read_byte_8(M6803_PORT2) & (m6800.port2_ddr ^ 0xff))); - break; - case 0x04: - if (m6800.port3_ddr != data) - { - m6800.port3_ddr = data; - if(m6800.port3_ddr == 0xff) - M6800_io_write_byte_8(M6803_PORT3,m6800.port3_data); - else - M6800_io_write_byte_8(M6803_PORT3,(m6800.port3_data & m6800.port3_ddr) - | (M6800_io_read_byte_8(M6803_PORT3) & (m6800.port3_ddr ^ 0xff))); - } - break; - case 0x05: - if (m6800.port4_ddr != data) - { - m6800.port4_ddr = data; - if(m6800.port4_ddr == 0xff) - M6800_io_write_byte_8(M6803_PORT4,m6800.port4_data); - else - M6800_io_write_byte_8(M6803_PORT4,(m6800.port4_data & m6800.port4_ddr) - | (M6800_io_read_byte_8(M6803_PORT4) & (m6800.port4_ddr ^ 0xff))); - } - break; - case 0x06: - m6800.port3_data = data; - if(m6800.port3_ddr == 0xff) - M6800_io_write_byte_8(M6803_PORT3,m6800.port3_data); - else - M6800_io_write_byte_8(M6803_PORT3,(m6800.port3_data & m6800.port3_ddr) - | (M6800_io_read_byte_8(M6803_PORT3) & (m6800.port3_ddr ^ 0xff))); - break; - case 0x07: - m6800.port4_data = data; - if(m6800.port4_ddr == 0xff) - M6800_io_write_byte_8(M6803_PORT4,m6800.port4_data); - else - M6800_io_write_byte_8(M6803_PORT4,(m6800.port4_data & m6800.port4_ddr) - | (M6800_io_read_byte_8(M6803_PORT4) & (m6800.port4_ddr ^ 0xff))); - break; - case 0x08: - m6800.tcsr = data; - m6800.pending_tcsr &= m6800.tcsr; - MODIFIED_tcsr; - if( !(CC & 0x10) ) - CHECK_IRQ2; -//logerror("CPU #%d PC %04x: TCSR = %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data); - break; - case 0x09: - latch09 = data & 0xff; /* 6301 only */ - CT = 0xfff8; - TOH = CTH; - MODIFIED_counters; - break; - case 0x0a: /* 6301 only */ - CT = (latch09 << 8) | (data & 0xff); - TOH = CTH; - MODIFIED_counters; - break; - case 0x0b: - if( m6800.output_compare.b.h != data) - { - m6800.output_compare.b.h = data; - MODIFIED_counters; - } - break; - case 0x0c: - if( m6800.output_compare.b.l != data) - { - m6800.output_compare.b.l = data; - MODIFIED_counters; - } - break; - case 0x0d: - case 0x0e: -// logerror("CPU #%d PC %04x: warning - write %02x to read only internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); - break; - case 0x0f: - case 0x10: - case 0x11: - case 0x12: - case 0x13: -// logerror("CPU #%d PC %04x: warning - write %02x to unsupported internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); - break; - case 0x14: -// logerror("CPU #%d PC %04x: write %02x to RAM control register\n",cpu_getactivecpu(),activecpu_get_pc(),data); - m6800.ram_ctrl = data; - break; - case 0x15: - case 0x16: - case 0x17: - case 0x18: - case 0x19: - case 0x1a: - case 0x1b: - case 0x1c: - case 0x1d: - case 0x1e: - case 0x1f: - default: -// logerror("CPU #%d PC %04x: warning - write %02x to reserved internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); - break; - } -} -#endif - -#if 0 -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static void m6800_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + M6800_IRQ_LINE: set_irq_line(M6800_IRQ_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + M6800_TIN_LINE: set_irq_line(M6800_TIN_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + M6800_INPUT_LINE_NMI: set_irq_line(M6800_INPUT_LINE_NMI, info->i); break; - - case CPUINFO_INT_PC: PC = info->i; CHANGE_PC(); break; - case CPUINFO_INT_REGISTER + M6800_PC: m6800.pc.w.l = info->i; break; - case CPUINFO_INT_SP: S = info->i; break; - case CPUINFO_INT_REGISTER + M6800_S: m6800.s.w.l = info->i; break; - case CPUINFO_INT_REGISTER + M6800_CC: m6800.cc = info->i; break; - case CPUINFO_INT_REGISTER + M6800_A: m6800.d.b.h = info->i; break; - case CPUINFO_INT_REGISTER + M6800_B: m6800.d.b.l = info->i; break; - case CPUINFO_INT_REGISTER + M6800_X: m6800.x.w.l = info->i; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void m6800_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(m6800); break; - case CPUINFO_INT_INPUT_LINES: info->i = 2; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 12; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + M6800_IRQ_LINE: info->i = m6800.irq_state[M6800_IRQ_LINE]; break; - case CPUINFO_INT_INPUT_STATE + M6800_TIN_LINE: info->i = m6800.irq_state[M6800_TIN_LINE]; break; - case CPUINFO_INT_INPUT_STATE + M6800_INPUT_LINE_NMI: info->i = m6800.nmi_state; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = m6800.ppc.w.l; break; - - case CPUINFO_INT_PC: info->i = PC; break; - case CPUINFO_INT_REGISTER + M6800_PC: info->i = m6800.pc.w.l; break; - case CPUINFO_INT_SP: info->i = S; break; - case CPUINFO_INT_REGISTER + M6800_S: info->i = m6800.s.w.l; break; - case CPUINFO_INT_REGISTER + M6800_CC: info->i = m6800.cc; break; - case CPUINFO_INT_REGISTER + M6800_A: info->i = m6800.d.b.h; break; - case CPUINFO_INT_REGISTER + M6800_B: info->i = m6800.d.b.l; break; - case CPUINFO_INT_REGISTER + M6800_X: info->i = m6800.x.w.l; break; - case CPUINFO_INT_REGISTER + M6800_WAI_STATE: info->i = m6800.wai_state; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = m6800_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = m6800_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = m6800_set_context; break; - case CPUINFO_PTR_INIT: info->init = m6800_init; break; - case CPUINFO_PTR_RESET: info->reset = m6800_reset; break; - case CPUINFO_PTR_EXIT: info->exit = m6800_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = m6800_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; -#ifdef MAME_DEBUG - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m6800_dasm; break; -#endif /* MAME_DEBUG */ - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &m6800_ICount; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6800"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Motorola 6800"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.1"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "The MAME team."); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c%c%c%c%c%c%c%c", - m6800.cc & 0x80 ? '?':'.', - m6800.cc & 0x40 ? '?':'.', - m6800.cc & 0x20 ? 'H':'.', - m6800.cc & 0x10 ? 'I':'.', - m6800.cc & 0x08 ? 'N':'.', - m6800.cc & 0x04 ? 'Z':'.', - m6800.cc & 0x02 ? 'V':'.', - m6800.cc & 0x01 ? 'C':'.'); - break; - - case CPUINFO_STR_REGISTER + M6800_A: sprintf(info->s, "A:%02X", m6800.d.b.h); break; - case CPUINFO_STR_REGISTER + M6800_B: sprintf(info->s, "B:%02X", m6800.d.b.l); break; - case CPUINFO_STR_REGISTER + M6800_PC: sprintf(info->s, "PC:%04X", m6800.pc.w.l); break; - case CPUINFO_STR_REGISTER + M6800_S: sprintf(info->s, "S:%04X", m6800.s.w.l); break; - case CPUINFO_STR_REGISTER + M6800_X: sprintf(info->s, "X:%04X", m6800.x.w.l); break; - case CPUINFO_STR_REGISTER + M6800_CC: sprintf(info->s, "CC:%02X", m6800.cc); break; - case CPUINFO_STR_REGISTER + M6800_WAI_STATE: sprintf(info->s, "WAI:%X", m6800.wai_state); break; - } -} - - -#if (HAS_M6801) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void m6801_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_INIT: info->init = m6801_init; break; - case CPUINFO_PTR_EXECUTE: info->execute = m6803_execute; break; -#ifdef MAME_DEBUG - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m6801_dasm; break; -#endif /* MAME_DEBUG */ - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6801"); break; - - default: m6800_get_info(state, info); break; - } -} -#endif - - -#if (HAS_M6802) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void m6802_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_INIT: info->init = m6802_init; break; -#ifdef MAME_DEBUG - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m6802_dasm; break; -#endif /* MAME_DEBUG */ - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6802"); break; - - default: m6800_get_info(state, info); break; - } -} -#endif - - -#if (HAS_M6803) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void m6803_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_INIT: info->init = m6803_init; break; - case CPUINFO_PTR_EXECUTE: info->execute = m6803_execute; break; -#ifdef MAME_DEBUG - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m6803_dasm; break; -#endif /* MAME_DEBUG */ - - case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_m6803_mem; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6803"); break; - - default: m6800_get_info(state, info); break; - } -} -#endif - - -#if (HAS_M6808) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void m6808_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_INIT: info->init = m6808_init; break; -#ifdef MAME_DEBUG - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m6808_dasm; break; -#endif /* MAME_DEBUG */ - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6808"); break; - - default: m6800_get_info(state, info); break; - } -} -#endif - - -#if (HAS_HD63701) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void hd63701_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_INIT: info->init = hd63701_init; break; - case CPUINFO_PTR_EXECUTE: info->execute = hd63701_execute; break; -#ifdef MAME_DEBUG - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = hd63701_dasm; break; -#endif /* MAME_DEBUG */ - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "HD63701"); break; - - default: m6800_get_info(state, info); break; - } -} -#endif - - -#if (HAS_NSC8105) -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void nsc8105_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_INIT: info->init = nsc8105_init; break; - case CPUINFO_PTR_EXECUTE: info->execute = nsc8105_execute; break; -#ifdef MAME_DEBUG - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = nsc8105_dasm; break; -#endif /* MAME_DEBUG */ - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "NSC8105"); break; - - default: m6800_get_info(state, info); break; - } -} -#endif - -#endif diff --git a/jan/src/cpu/m6800/m6800.h b/jan/src/cpu/m6800/m6800.h deleted file mode 100644 index 64bd4b662..000000000 --- a/jan/src/cpu/m6800/m6800.h +++ /dev/null @@ -1,304 +0,0 @@ -/*** m6800: Portable 6800 class emulator *************************************/ - -#define HAS_M6801 1 -#define HAS_M6802 0 -#define HAS_M6803 1 -#define HAS_M6808 0 -#define HAS_HD63701 1 -#define HAS_NSC8105 1 - -#ifndef _M6800_H -#define _M6800_H - -//#include "cpuintrf.h" - -/* 6800 Registers */ -typedef struct -{ -// int subtype; /* CPU subtype */ - PAIR ea; /* effective address */ - int m6800_ICount; - UINT32 timer_next; - PAIR ppc; /* Previous program counter */ - PAIR pc; /* Program counter */ - PAIR s; /* Stack pointer */ - PAIR x; /* Index register */ - PAIR d; /* Accumulators */ - UINT8 cc; /* Condition codes */ - UINT8 wai_state; /* WAI opcode state ,(or sleep opcode state) */ - UINT8 nmi_state; /* NMI line state */ - UINT8 irq_state[2]; /* IRQ line state [IRQ1,TIN] */ - UINT8 ic_eddge; /* InputCapture eddge , b.0=fall,b.1=raise */ - -// int (*irq_callback)(int irqline); - ALIGN_VAR(8) void (* const * insn)(void); /* instruction table */ - ALIGN_VAR(8) const UINT8 *cycles; /* clock cycle of instruction table */ - int extra_cycles; /* cycles used for interrupts */ - /* internal registers */ - UINT8 port1_ddr; - UINT8 port2_ddr; - UINT8 port3_ddr; - UINT8 port4_ddr; - UINT8 port1_data; - UINT8 port2_data; - UINT8 port3_data; - UINT8 port4_data; - UINT8 tcsr, rmcr; /* Timer Control and Status Register */ - UINT8 pending_tcsr; /* pending IRQ flag for clear IRQflag process */ - UINT8 irq2; /* IRQ2 flags */ - UINT8 ram_ctrl; - PAIR counter; /* free running counter */ - PAIR output_compare; /* output compare */ - UINT16 input_capture; /* input capture */ - - PAIR timer_over; -} m6800_Regs; - -enum { - M6800_PC=1, M6800_S, M6800_A, M6800_B, M6800_X, M6800_CC, - M6800_WAI_STATE }; - -#define M6800_WAI 8 /* set when WAI is waiting for an interrupt */ -#define M6800_SLP 0x10 /* HD63701 only */ - - -#define M6800_IRQ_LINE 0 /* IRQ line number */ -#define M6800_TIN_LINE 1 /* P20/Tin Input Capture line (eddge sense) */ - /* Active eddge is selecrable by internal reg. */ - /* raise eddge : CLEAR_LINE -> ASSERT_LINE */ - /* fall eddge : ASSERT_LINE -> CLEAR_LINE */ - /* it is usuali to use PULSE_LINE state */ -#define M6800_INPUT_LINE_NMI 32 - -unsigned char M6800ReadByte(unsigned short Address); -void M6800WriteByte(unsigned short Address, unsigned char Data); -unsigned char M6800ReadOp(unsigned short Address); -unsigned char M6800ReadOpArg(unsigned short Address); -unsigned char M6800ReadPort(unsigned short Address); -void M6800WritePort(unsigned short Address, unsigned char Data); - -void m6800_init(); -void hd63701_init(); -void m6803_init(); -void m6801_init(); -void nsc8105_init(); - -void m6800_reset(void); -void m6800_reset_hard(void); -int m6800_get_pc(); -void m6800_get_context(void *dst); -void m6800_set_context(void *src); -int m6800_execute(int cycles); -int m6803_execute(int cycles); -int hd63701_execute(int cycles); -int nsc8105_execute(int cycles); - -void m6800_set_irq_line(int irqline, int state); - -void m6803_internal_registers_w(unsigned short offset, unsigned char data); -unsigned char m6803_internal_registers_r(unsigned short offset); - -//extern void m6800_get_info(UINT32 state, cpuinfo *info); - -/**************************************************************************** - * For now make the 6801 using the m6800 variables and functions - ****************************************************************************/ -#if (HAS_M6801) -#define M6801_A M6800_A -#define M6801_B M6800_B -#define M6801_PC M6800_PC -#define M6801_S M6800_S -#define M6801_X M6800_X -#define M6801_CC M6800_CC -#define M6801_WAI_STATE M6800_WAI_STATE -#define M6801_NMI_STATE M6800_NMI_STATE -#define M6801_IRQ_STATE M6800_IRQ_STATE - -#define M6801_WAI M6800_WAI -#define M6801_IRQ_LINE M6800_IRQ_LINE - -//extern void m6801_get_info(UINT32 state, cpuinfo *info); -#endif - -/**************************************************************************** - * For now make the 6802 using the m6800 variables and functions - ****************************************************************************/ -#if (HAS_M6802) -#define M6802_A M6800_A -#define M6802_B M6800_B -#define M6802_PC M6800_PC -#define M6802_S M6800_S -#define M6802_X M6800_X -#define M6802_CC M6800_CC -#define M6802_WAI_STATE M6800_WAI_STATE -#define M6802_NMI_STATE M6800_NMI_STATE -#define M6802_IRQ_STATE M6800_IRQ_STATE - -#define M6802_WAI M6800_WAI -#define M6802_IRQ_LINE M6800_IRQ_LINE - -extern void m6802_get_info(UINT32 state, cpuinfo *info); -#endif - -/**************************************************************************** - * For now make the 6803 using the m6800 variables and functions - ****************************************************************************/ -#if (HAS_M6803) -#define M6803_A M6800_A -#define M6803_B M6800_B -#define M6803_PC M6800_PC -#define M6803_S M6800_S -#define M6803_X M6800_X -#define M6803_CC M6800_CC -#define M6803_WAI_STATE M6800_WAI_STATE -#define M6803_NMI_STATE M6800_NMI_STATE -#define M6803_IRQ_STATE M6800_IRQ_STATE - -#define M6803_WAI M6800_WAI -#define M6803_IRQ_LINE M6800_IRQ_LINE -#define M6803_TIN_LINE M6800_TIN_LINE - -//extern void m6803_get_info(UINT32 state, cpuinfo *info); -#endif - -#if (HAS_M6803||HAS_HD63701) -/* By default, on a port write port bits which are not set as output in the DDR */ -/* are set to the value returned by a read from the same port. If you need to */ -/* know the DDR for e.g. port 1, do m6803_internal_registers_r(M6801_DDR1) */ - -#define M6803_DDR1 0x00 -#define M6803_DDR2 0x01 -#define M6803_DDR3 0x04 -#define M6803_DDR4 0x05 - -#define M6803_PORT1 0x100 -#define M6803_PORT2 0x101 -#define M6803_PORT3 0x102 -#define M6803_PORT4 0x103 -#endif - -/**************************************************************************** - * For now make the 6808 using the m6800 variables and functions - ****************************************************************************/ -#if (HAS_M6808) -#define M6808_A M6800_A -#define M6808_B M6800_B -#define M6808_PC M6800_PC -#define M6808_S M6800_S -#define M6808_X M6800_X -#define M6808_CC M6800_CC -#define M6808_WAI_STATE M6800_WAI_STATE -#define M6808_NMI_STATE M6800_NMI_STATE -#define M6808_IRQ_STATE M6800_IRQ_STATE - -#define M6808_WAI M6800_WAI -#define M6808_IRQ_LINE M6800_IRQ_LINE - -extern void m6808_get_info(UINT32 state, cpuinfo *info); -#endif - -/**************************************************************************** - * For now make the HD63701 using the m6800 variables and functions - ****************************************************************************/ -#if (HAS_HD63701) -#define HD63701_A M6800_A -#define HD63701_B M6800_B -#define HD63701_PC M6800_PC -#define HD63701_S M6800_S -#define HD63701_X M6800_X -#define HD63701_CC M6800_CC -#define HD63701_WAI_STATE M6800_WAI_STATE -#define HD63701_NMI_STATE M6800_NMI_STATE -#define HD63701_IRQ_STATE M6800_IRQ_STATE - -#define HD63701_WAI M6800_WAI -#define HD63701_SLP M6800_SLP -#define HD63701_IRQ_LINE M6800_IRQ_LINE -#define HD63701_TIN_LINE M6800_TIN_LINE - -//extern void hd63701_get_info(UINT32 state, cpuinfo *info); - -void hd63701_trap_pc(void); - -#define HD63701_DDR1 M6803_DDR1 -#define HD63701_DDR2 M6803_DDR2 -#define HD63701_DDR3 M6803_DDR3 -#define HD63701_DDR4 M6803_DDR4 - -#define HD63701_PORT1 M6803_PORT1 -#define HD63701_PORT2 M6803_PORT2 -#define HD63701_PORT3 M6803_PORT3 -#define HD63701_PORT4 M6803_PORT4 - -//READ8_HANDLER( hd63701_internal_registers_r ); -//WRITE8_HANDLER( hd63701_internal_registers_w ); - -#endif - -/**************************************************************************** - * For now make the NSC8105 using the m6800 variables and functions - ****************************************************************************/ -#if (HAS_NSC8105) -#define NSC8105_A M6800_A -#define NSC8105_B M6800_B -#define NSC8105_PC M6800_PC -#define NSC8105_S M6800_S -#define NSC8105_X M6800_X -#define NSC8105_CC M6800_CC -#define NSC8105_WAI_STATE M6800_WAI_STATE -#define NSC8105_NMI_STATE M6800_NMI_STATE -#define NSC8105_IRQ_STATE M6800_IRQ_STATE - -#define NSC8105_WAI M6800_WAI -#define NSC8105_IRQ_LINE M6800_IRQ_LINE -#define NSC8105_TIN_LINE M6800_TIN_LINE - -//extern void nsc8105_get_info(UINT32 state, cpuinfo *info); -#endif - -/****************************************************************************/ -/* Read a byte from given memory location */ -/****************************************************************************/ -/* ASG 971005 -- changed to program_read_byte_8/program_write_byte_8 */ -#define M6800_RDMEM(Addr) ((unsigned)M6800ReadByte(Addr)) - -/****************************************************************************/ -/* Write a byte to given memory location */ -/****************************************************************************/ -#define M6800_WRMEM(Addr,Value) (M6800WriteByte(Addr,Value)) - -/****************************************************************************/ -/* M6800_RDOP() is identical to M6800_RDMEM() except it is used for reading */ -/* opcodes. In case of system with memory mapped I/O, this function can be */ -/* used to greatly speed up emulation */ -/****************************************************************************/ -#define M6800_RDOP(Addr) ((unsigned)M6800ReadOp(Addr)) - -/****************************************************************************/ -/* M6800_RDOP_ARG() is identical to M6800_RDOP() but it's used for reading */ -/* opcode arguments. This difference can be used to support systems that */ -/* use different encoding mechanisms for opcodes and opcode arguments */ -/****************************************************************************/ -#define M6800_RDOP_ARG(Addr) ((unsigned)M6800ReadOpArg(Addr)) - -#define M6800_io_read_byte_8(Port) ((unsigned)M6800ReadPort(Port)) -#define M6800_io_write_byte_8(Port,Value) (M6800WritePort(Port, Value)) - -#ifndef FALSE -# define FALSE 0 -#endif -#ifndef TRUE -# define TRUE (!FALSE) -#endif - -#ifdef MAME_DEBUG -offs_t m6800_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -offs_t m6801_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -offs_t m6802_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -ffs_t m6803_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -offs_t m6808_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -offs_t hd63701_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -offs_t nsc8105_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -#endif - -#endif /* _M6800_H */ diff --git a/jan/src/cpu/m68000_debug.h b/jan/src/cpu/m68000_debug.h deleted file mode 100644 index d726442cb..000000000 --- a/jan/src/cpu/m68000_debug.h +++ /dev/null @@ -1,27 +0,0 @@ -enum SekRegister { - SEK_REG_D0, SEK_REG_D1, SEK_REG_D2, SEK_REG_D3, SEK_REG_D4, SEK_REG_D5, SEK_REG_D6, SEK_REG_D7, - SEK_REG_A0, SEK_REG_A1, SEK_REG_A2, SEK_REG_A3, SEK_REG_A4, SEK_REG_A5, SEK_REG_A6, SEK_REG_A7, - SEK_REG_PC, - SEK_REG_SR, - SEK_REG_SP, SEK_REG_USP, SEK_REG_ISP, SEK_REG_MSP, - SEK_REG_VBR, - SEK_REG_SFC, SEK_REG_DFC, - SEK_REG_CACR, SEK_REG_CAAR -}; - -extern void (*SekDbgBreakpointHandlerRead)(UINT32, INT32); -extern void (*SekDbgBreakpointHandlerFetch)(UINT32, INT32); -extern void (*SekDbgBreakpointHandlerWrite)(UINT32, INT32); - -void SekDbgDisableBreakpoints(); -void SekDbgEnableBreakpoints(); -void SekDbgEnableSingleStep(); - -INT32 SekDbgSetBreakpointDataRead(UINT32 nAddress, INT32 nIdentifier); -INT32 SekDbgSetBreakpointDataWrite(UINT32 nAddress, INT32 nIdentifier); -INT32 SekDbgSetBreakpointFetch(UINT32 nAddress, INT32 nIdentifier); - -INT32 SekDbgGetCPUType(); -INT32 SekDbgGetPendingIRQ(); -UINT32 SekDbgGetRegister(SekRegister nRegister); -bool SekDbgSetRegister(SekRegister nRegister, UINT32 nValue); diff --git a/jan/src/cpu/m68000_intf.cpp b/jan/src/cpu/m68000_intf.cpp deleted file mode 100644 index b17f5858c..000000000 --- a/jan/src/cpu/m68000_intf.cpp +++ /dev/null @@ -1,2174 +0,0 @@ -// 680x0 (Sixty Eight K) Interface -#include "burnint.h" -#include "m68000_intf.h" -#include "m68000_debug.h" - -#ifdef EMU_M68K -INT32 nSekM68KContextSize[SEK_MAX]; -INT8* SekM68KContext[SEK_MAX]; -#endif - -INT32 nSekCount = -1; // Number of allocated 68000s -struct SekExt *SekExt[SEK_MAX] = { NULL, }, *pSekExt = NULL; - -INT32 nSekActive = -1; // The cpu which is currently being emulated -INT32 nSekCyclesTotal, nSekCyclesScanline, nSekCyclesSegment, nSekCyclesDone, nSekCyclesToDo; - -INT32 nSekCPUType[SEK_MAX], nSekCycles[SEK_MAX], nSekIRQPending[SEK_MAX]; - -#if defined (FBA_DEBUG) - -void (*SekDbgBreakpointHandlerRead)(UINT32, INT32); -void (*SekDbgBreakpointHandlerFetch)(UINT32, INT32); -void (*SekDbgBreakpointHandlerWrite)(UINT32, INT32); - -UINT32 (*SekDbgFetchByteDisassembler)(UINT32); -UINT32 (*SekDbgFetchWordDisassembler)(UINT32); -UINT32 (*SekDbgFetchLongDisassembler)(UINT32); - -static struct { UINT32 address; INT32 id; } BreakpointDataRead[9] = { { 0, 0 }, }; -static struct { UINT32 address; INT32 id; } BreakpointDataWrite[9] = { { 0, 0 }, }; -static struct { UINT32 address; INT32 id; } BreakpointFetch[9] = { { 0, 0 }, }; - -#endif - -#if defined (EMU_A68K) -static void UpdateA68KContext() -{ - if (M68000_regs.srh & 20) { // Supervisor mode - M68000_regs.isp = M68000_regs.a[7]; - } else { // User mode - M68000_regs.usp = M68000_regs.a[7]; - } - - M68000_regs.sr = (M68000_regs.srh << 8) & 0xFF00; // T, S, M, I - M68000_regs.sr |= (M68000_regs.xc << 4) & 0x0010; // X - M68000_regs.sr |= (M68000_regs.ccr >> 4) & 0x0008; // N - M68000_regs.sr |= (M68000_regs.ccr >> 4) & 0x0004; // Z - M68000_regs.sr |= (M68000_regs.ccr >> 10) & 0x0002; // V - M68000_regs.sr |= (M68000_regs.ccr ) & 0x0001; // C -} - -static UINT32 GetA68KSR() -{ - UpdateA68KContext(); - - return M68000_regs.sr; -} - -static UINT32 GetA68KISP() -{ - UpdateA68KContext(); - - return M68000_regs.isp; -} - -static UINT32 GetA68KUSP() -{ - UpdateA68KContext(); - - return M68000_regs.usp; -} -#endif - -#if defined (FBA_DEBUG) - -inline static void CheckBreakpoint_R(UINT32 a, const UINT32 m) -{ - a &= m; - - for (INT32 i = 0; BreakpointDataRead[i].address; i++) { - if ((BreakpointDataRead[i].address & m) == a) { - -#ifdef EMU_A68K - UpdateA68KContext(); -#endif - - SekDbgBreakpointHandlerRead(a, BreakpointDataRead[i].id); - return; - } - } -} - -inline static void CheckBreakpoint_W(UINT32 a, const UINT32 m) -{ - a &= m; - - for (INT32 i = 0; BreakpointDataWrite[i].address; i++) { - if ((BreakpointDataWrite[i].address & m) == a) { - -#ifdef EMU_A68K - UpdateA68KContext(); -#endif - - SekDbgBreakpointHandlerWrite(a, BreakpointDataWrite[i].id); - return; - } - } -} - -inline static void CheckBreakpoint_PC(unsigned int /*pc*/) -{ - for (INT32 i = 0; BreakpointFetch[i].address; i++) { - if (BreakpointFetch[i].address == (UINT32)SekGetPC(-1)) { - -#ifdef EMU_A68K - UpdateA68KContext(); -#endif - - SekDbgBreakpointHandlerFetch(SekGetPC(-1), BreakpointFetch[i].id); - return; - } - } -} - -inline static void SingleStep_PC(unsigned int /*pc*/) -{ -#ifdef EMU_A68K - UpdateA68KContext(); -#endif - - SekDbgBreakpointHandlerFetch(SekGetPC(-1), 0); -} - -#endif - -// ---------------------------------------------------------------------------- -// Default memory access handlers - -UINT8 __fastcall DefReadByte(UINT32) { return 0; } -void __fastcall DefWriteByte(UINT32, UINT8) { } - -#define DEFWORDHANDLERS(i) \ - UINT16 __fastcall DefReadWord##i(UINT32 a) { SEK_DEF_READ_WORD(i, a) } \ - void __fastcall DefWriteWord##i(UINT32 a, UINT16 d) { SEK_DEF_WRITE_WORD(i, a ,d) } -#define DEFLONGHANDLERS(i) \ - UINT32 __fastcall DefReadLong##i(UINT32 a) { SEK_DEF_READ_LONG(i, a) } \ - void __fastcall DefWriteLong##i(UINT32 a, UINT32 d) { SEK_DEF_WRITE_LONG(i, a , d) } - -DEFWORDHANDLERS(0) -DEFLONGHANDLERS(0) - -#if SEK_MAXHANDLER >= 2 - DEFWORDHANDLERS(1) - DEFLONGHANDLERS(1) -#endif - -#if SEK_MAXHANDLER >= 3 - DEFWORDHANDLERS(2) - DEFLONGHANDLERS(2) -#endif - -#if SEK_MAXHANDLER >= 4 - DEFWORDHANDLERS(3) - DEFLONGHANDLERS(3) -#endif - -#if SEK_MAXHANDLER >= 5 - DEFWORDHANDLERS(4) - DEFLONGHANDLERS(4) -#endif - -#if SEK_MAXHANDLER >= 6 - DEFWORDHANDLERS(5) - DEFLONGHANDLERS(5) -#endif - -#if SEK_MAXHANDLER >= 7 - DEFWORDHANDLERS(6) - DEFLONGHANDLERS(6) -#endif - -#if SEK_MAXHANDLER >= 8 - DEFWORDHANDLERS(7) - DEFLONGHANDLERS(7) -#endif - -#if SEK_MAXHANDLER >= 9 - DEFWORDHANDLERS(8) - DEFLONGHANDLERS(8) -#endif - -#if SEK_MAXHANDLER >= 10 - DEFWORDHANDLERS(9) - DEFLONGHANDLERS(9) -#endif - -// ---------------------------------------------------------------------------- -// Memory access functions - -// Mapped Memory lookup ( for read) -#define FIND_R(x) pSekExt->MemMap[ x >> SEK_SHIFT] -// Mapped Memory lookup (+ SEK_WADD for write) -#define FIND_W(x) pSekExt->MemMap[(x >> SEK_SHIFT) + SEK_WADD] -// Mapped Memory lookup (+ SEK_WADD * 2 for fetch) -#define FIND_F(x) pSekExt->MemMap[(x >> SEK_SHIFT) + SEK_WADD * 2] - -// Normal memory access functions -inline static UINT8 ReadByte(UINT32 a) -{ - UINT8* pr; - - a &= 0xFFFFFF; - -// bprintf(PRINT_NORMAL, _T("read8 0x%08X\n"), a); - - pr = FIND_R(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - a ^= 1; - return pr[a & SEK_PAGEM]; - } - return pSekExt->ReadByte[(uintptr_t)pr](a); -} - -inline static UINT8 FetchByte(UINT32 a) -{ - UINT8* pr; - - a &= 0xFFFFFF; - -// bprintf(PRINT_NORMAL, _T("fetch8 0x%08X\n"), a); - - pr = FIND_F(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - a ^= 1; - return pr[a & SEK_PAGEM]; - } - return pSekExt->ReadByte[(uintptr_t)pr](a); -} - -inline static void WriteByte(UINT32 a, UINT8 d) -{ - UINT8* pr; - - a &= 0xFFFFFF; - -// bprintf(PRINT_NORMAL, _T("write8 0x%08X\n"), a); - - pr = FIND_W(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - a ^= 1; - pr[a & SEK_PAGEM] = (UINT8)d; - return; - } - pSekExt->WriteByte[(uintptr_t)pr](a, d); -} - -inline static void WriteByteROM(UINT32 a, UINT8 d) -{ - UINT8* pr; - - a &= 0xFFFFFF; - - pr = FIND_R(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - a ^= 1; - pr[a & SEK_PAGEM] = (UINT8)d; - return; - } - pSekExt->WriteByte[(uintptr_t)pr](a, d); -} - -inline static UINT16 ReadWord(UINT32 a) -{ - UINT8* pr; - - a &= 0xFFFFFF; - -// bprintf(PRINT_NORMAL, _T("read16 0x%08X\n"), a); - - pr = FIND_R(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) - { - if (a & 1) - { - return BURN_ENDIAN_SWAP_INT16((ReadByte(a + 0) * 256) + ReadByte(a + 1)); - } - else - { - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pr + (a & SEK_PAGEM)))); - } - } - - return pSekExt->ReadWord[(uintptr_t)pr](a); -} - -inline static UINT16 FetchWord(UINT32 a) -{ - UINT8* pr; - - a &= 0xFFFFFF; - -// bprintf(PRINT_NORMAL, _T("fetch16 0x%08X\n"), a); - - pr = FIND_F(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pr + (a & SEK_PAGEM)))); - } - - return pSekExt->ReadWord[(uintptr_t)pr](a); -} - -inline static void WriteWord(UINT32 a, UINT16 d) -{ - UINT8* pr; - - a &= 0xFFFFFF; - -// bprintf(PRINT_NORMAL, _T("write16 0x%08X\n"), a); - - pr = FIND_W(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) - { - if (a & 1) - { - // bprintf(PRINT_NORMAL, _T("write16 0x%08X\n"), a); - - d = BURN_ENDIAN_SWAP_INT16(d); - - WriteByte(a + 0, d / 0x100); - WriteByte(a + 1, d); - - return; - } - else - { - *((UINT16*)(pr + (a & SEK_PAGEM))) = (UINT16)BURN_ENDIAN_SWAP_INT16(d); - return; - } - } - - pSekExt->WriteWord[(uintptr_t)pr](a, d); -} - -inline static void WriteWordROM(UINT32 a, UINT16 d) -{ - UINT8* pr; - - a &= 0xFFFFFF; - - pr = FIND_R(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - *((UINT16*)(pr + (a & SEK_PAGEM))) = (UINT16)d; - return; - } - pSekExt->WriteWord[(uintptr_t)pr](a, d); -} - -inline static UINT32 ReadLong(UINT32 a) -{ - UINT8* pr; - - a &= 0xFFFFFF; - -// bprintf(PRINT_NORMAL, _T("read32 0x%08X\n"), a); - - pr = FIND_R(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) - { - if (a & 1) - { - UINT32 r = 0; - - if (a & 2) - { - r = ReadByte((a + 0)) * 0x1000000; - r += ReadByte((a + 1) ^ 1) * 0x100; - r += ReadByte((a + 2) ^ 1) * 0x10000; - r += ReadByte((a + 3)); - } - else - { - r = ReadByte((a + 0)) * 0x1000000; - r += ReadByte((a + 1)) * 0x100; - r += ReadByte((a + 2)) * 0x10000; - r += ReadByte((a + 3)); - } - - //bprintf(PRINT_NORMAL, _T("read32 0x%08X 0x%8.8x\n"), a, r); - - return BURN_ENDIAN_SWAP_INT32(r); - } - else - { - UINT32 r = *((UINT32*)(pr + (a & SEK_PAGEM))); - r = (r >> 16) | (r << 16); - return BURN_ENDIAN_SWAP_INT32(r); - } - } - - return pSekExt->ReadLong[(uintptr_t)pr](a); -} - -inline static UINT32 FetchLong(UINT32 a) -{ - UINT8* pr; - - a &= 0xFFFFFF; - -// bprintf(PRINT_NORMAL, _T("fetch32 0x%08X\n"), a); - - pr = FIND_F(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - UINT32 r = *((UINT32*)(pr + (a & SEK_PAGEM))); - r = (r >> 16) | (r << 16); - return BURN_ENDIAN_SWAP_INT32(r); - } - return pSekExt->ReadLong[(uintptr_t)pr](a); -} - -inline static void WriteLong(UINT32 a, UINT32 d) -{ - UINT8* pr; - - a &= 0xFFFFFF; - -// bprintf(PRINT_NORMAL, _T("write32 0x%08X\n"), a); - - pr = FIND_W(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) - { - if (a & 1) - { - // bprintf(PRINT_NORMAL, _T("write32 0x%08X 0x%8.8x\n"), a,d); - - d = BURN_ENDIAN_SWAP_INT32(d); - - if (a & 2) - { - WriteByte((a + 0), d / 0x1000000); - WriteByte((a + 1) ^ 1, d / 0x100); - WriteByte((a + 2) ^ 1, d / 0x10000); - WriteByte((a + 3), d); - } - else - { - WriteByte(a + 0, d / 0x1000000); - WriteByte(a + 1, d / 0x100); - WriteByte(a + 2, d / 0x10000); - WriteByte(a + 3, d); - } - - return; - } - else - { - d = (d >> 16) | (d << 16); - *((UINT32*)(pr + (a & SEK_PAGEM))) = BURN_ENDIAN_SWAP_INT32(d); - return; - } - } - pSekExt->WriteLong[(uintptr_t)pr](a, d); -} - -inline static void WriteLongROM(UINT32 a, UINT32 d) -{ - UINT8* pr; - - a &= 0xFFFFFF; - - pr = FIND_R(a); - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - d = (d >> 16) | (d << 16); - *((UINT32*)(pr + (a & SEK_PAGEM))) = d; - return; - } - pSekExt->WriteLong[(uintptr_t)pr](a, d); -} - -#if defined (FBA_DEBUG) - -// Breakpoint checking memory access functions -UINT8 __fastcall ReadByteBP(UINT32 a) -{ - UINT8* pr; - - a &= 0xFFFFFF; - - pr = FIND_R(a); - - CheckBreakpoint_R(a, ~0); - - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - a ^= 1; - return pr[a & SEK_PAGEM]; - } - return pSekExt->ReadByte[(uintptr_t)pr](a); -} - -void __fastcall WriteByteBP(UINT32 a, UINT8 d) -{ - UINT8* pr; - - a &= 0xFFFFFF; - - pr = FIND_W(a); - - CheckBreakpoint_W(a, ~0); - - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - a ^= 1; - pr[a & SEK_PAGEM] = (UINT8)d; - return; - } - pSekExt->WriteByte[(uintptr_t)pr](a, d); -} - -UINT16 __fastcall ReadWordBP(UINT32 a) -{ - UINT8* pr; - - a &= 0xFFFFFF; - - pr = FIND_R(a); - - CheckBreakpoint_R(a, ~1); - - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - return *((UINT16*)(pr + (a & SEK_PAGEM))); - } - return pSekExt->ReadWord[(uintptr_t)pr](a); -} - -void __fastcall WriteWordBP(UINT32 a, UINT16 d) -{ - UINT8* pr; - - a &= 0xFFFFFF; - - pr = FIND_W(a); - - CheckBreakpoint_W(a, ~1); - - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - *((UINT16*)(pr + (a & SEK_PAGEM))) = (UINT16)d; - return; - } - pSekExt->WriteWord[(uintptr_t)pr](a, d); -} - -UINT32 __fastcall ReadLongBP(UINT32 a) -{ - UINT8* pr; - - a &= 0xFFFFFF; - - pr = FIND_R(a); - - CheckBreakpoint_R(a, ~1); - - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - UINT32 r = *((UINT32*)(pr + (a & SEK_PAGEM))); - r = (r >> 16) | (r << 16); - return r; - } - return pSekExt->ReadLong[(uintptr_t)pr](a); -} - -void __fastcall WriteLongBP(UINT32 a, UINT32 d) -{ - UINT8* pr; - - a &= 0xFFFFFF; - - pr = FIND_W(a); - - CheckBreakpoint_W(a, ~1); - - if ((uintptr_t)pr >= SEK_MAXHANDLER) { - d = (d >> 16) | (d << 16); - *((UINT32*)(pr + (a & SEK_PAGEM))) = d; - return; - } - pSekExt->WriteLong[(uintptr_t)pr](a, d); -} - -#endif - -// ---------------------------------------------------------------------------- -// A68K variables - -#ifdef EMU_A68K -struct A68KContext* SekRegs[SEK_MAX] = { NULL, }; -#endif - -struct A68KInter { - void (__fastcall *DebugCallback) (unsigned int pc); - UINT8 (__fastcall *Read8) (UINT32 a); - UINT16 (__fastcall *Read16)(UINT32 a); - UINT32 (__fastcall *Read32)(UINT32 a); - void (__fastcall *Write8) (UINT32 a, UINT8 d); - void (__fastcall *Write16) (UINT32 a, UINT16 d); - void (__fastcall *Write32) (UINT32 a, UINT32 d); - void (__fastcall *ChangePc)(UINT32 a); - UINT8 (__fastcall *PcRel8) (UINT32 a); - UINT16 (__fastcall *PcRel16)(UINT32 a); - UINT32 (__fastcall *PcRel32)(UINT32 a); - UINT16 (__fastcall *Dir16)(UINT32 a); - UINT32 (__fastcall *Dir32)(UINT32 a); -}; - -extern "C" { - -#ifdef EMU_A68K - UINT8* OP_ROM = NULL; - UINT8* OP_RAM = NULL; - -#ifndef EMU_M68K - INT32 m68k_ICount = 0; -#endif - - UINT32 mem_amask = 0xFFFFFF; // 24-bit bus -#endif - - UINT32 mame_debug = 0, cur_mrhard = 0, m68k_illegal_opcode = 0, illegal_op = 0, illegal_pc = 0, opcode_entry = 0; - - struct A68KInter a68k_memory_intf; -} - -UINT8 __fastcall A68KRead8 (UINT32 a) { return ReadByte(a);} -UINT16 __fastcall A68KRead16(UINT32 a) { return ReadWord(a);} -UINT32 __fastcall A68KRead32(UINT32 a) { return ReadLong(a);} -UINT8 __fastcall A68KFetch8 (UINT32 a) { return FetchByte(a);} -UINT16 __fastcall A68KFetch16(UINT32 a) { return FetchWord(a);} -UINT32 __fastcall A68KFetch32(UINT32 a) { return FetchLong(a);} -void __fastcall A68KWrite8 (UINT32 a,UINT8 d) { WriteByte(a,d);} -void __fastcall A68KWrite16(UINT32 a,UINT16 d) { WriteWord(a,d);} -void __fastcall A68KWrite32(UINT32 a,UINT32 d) { WriteLong(a,d);} - -#if defined (FBA_DEBUG) -void __fastcall A68KCheckBreakpoint(unsigned int pc) { CheckBreakpoint_PC(pc); } -void __fastcall A68KSingleStep(unsigned int pc) { SingleStep_PC(pc); } -#endif - -#ifdef EMU_A68K -void __fastcall A68KChangePC(UINT32 pc) -{ - pc &= 0xFFFFFF; - - // Adjust OP_ROM to the current bank - OP_ROM = FIND_F(pc) - (pc & ~SEK_PAGEM); - - // Set the current bank number - M68000_regs.nAsmBank = pc >> SEK_BITS; -} -#endif - -#ifdef EMU_M68K -extern "C" { -UINT32 __fastcall M68KReadByte(UINT32 a) { return (UINT32)ReadByte(a); } -UINT32 __fastcall M68KReadWord(UINT32 a) { return (UINT32)ReadWord(a); } -UINT32 __fastcall M68KReadLong(UINT32 a) { return ReadLong(a); } - -UINT32 __fastcall M68KFetchByte(UINT32 a) { return (UINT32)FetchByte(a); } -UINT32 __fastcall M68KFetchWord(UINT32 a) { return (UINT32)FetchWord(a); } -UINT32 __fastcall M68KFetchLong(UINT32 a) { return FetchLong(a); } - -#ifdef FBA_DEBUG -UINT32 __fastcall M68KReadByteBP(UINT32 a) { return (UINT32)ReadByteBP(a); } -UINT32 __fastcall M68KReadWordBP(UINT32 a) { return (UINT32)ReadWordBP(a); } -UINT32 __fastcall M68KReadLongBP(UINT32 a) { return ReadLongBP(a); } - -void __fastcall M68KWriteByteBP(UINT32 a, UINT32 d) { WriteByteBP(a, d); } -void __fastcall M68KWriteWordBP(UINT32 a, UINT32 d) { WriteWordBP(a, d); } -void __fastcall M68KWriteLongBP(UINT32 a, UINT32 d) { WriteLongBP(a, d); } - -void M68KCheckBreakpoint(unsigned int pc) { CheckBreakpoint_PC(pc); } -void M68KSingleStep(unsigned int pc) { SingleStep_PC(pc); } - -UINT32 (__fastcall *M68KReadByteDebug)(UINT32); -UINT32 (__fastcall *M68KReadWordDebug)(UINT32); -UINT32 (__fastcall *M68KReadLongDebug)(UINT32); - -void (__fastcall *M68KWriteByteDebug)(UINT32, UINT32); -void (__fastcall *M68KWriteWordDebug)(UINT32, UINT32); -void (__fastcall *M68KWriteLongDebug)(UINT32, UINT32); -#endif - -void __fastcall M68KWriteByte(UINT32 a, UINT32 d) { WriteByte(a, d); } -void __fastcall M68KWriteWord(UINT32 a, UINT32 d) { WriteWord(a, d); } -void __fastcall M68KWriteLong(UINT32 a, UINT32 d) { WriteLong(a, d); } -} -#endif - -#if defined EMU_A68K -struct A68KInter a68k_inter_normal = { - NULL, - A68KRead8, - A68KRead16, - A68KRead32, - A68KWrite8, - A68KWrite16, - A68KWrite32, - A68KChangePC, - A68KFetch8, - A68KFetch16, - A68KFetch32, - A68KRead16, // unused - A68KRead32, // unused -}; - -#if defined (FBA_DEBUG) - -struct A68KInter a68k_inter_breakpoint = { - NULL, - ReadByteBP, - ReadWordBP, - ReadLongBP, - WriteByteBP, - WriteWordBP, - WriteLongBP, - A68KChangePC, - A68KFetch8, - A68KFetch16, - A68KFetch32, - A68KRead16, // unused - A68KRead32, // unused -}; - -#endif - -#endif - -// ---------------------------------------------------------------------------- -// Memory accesses (non-emu specific) - -UINT32 SekReadByte(UINT32 a) { return (UINT32)ReadByte(a); } -UINT32 SekReadWord(UINT32 a) { return (UINT32)ReadWord(a); } -UINT32 SekReadLong(UINT32 a) { return ReadLong(a); } - -UINT32 SekFetchByte(UINT32 a) { return (UINT32)FetchByte(a); } -UINT32 SekFetchWord(UINT32 a) { return (UINT32)FetchWord(a); } -UINT32 SekFetchLong(UINT32 a) { return FetchLong(a); } - -void SekWriteByte(UINT32 a, UINT8 d) { WriteByte(a, d); } -void SekWriteWord(UINT32 a, UINT16 d) { WriteWord(a, d); } -void SekWriteLong(UINT32 a, UINT32 d) { WriteLong(a, d); } - -void SekWriteByteROM(UINT32 a, UINT8 d) { WriteByteROM(a, d); } -void SekWriteWordROM(UINT32 a, UINT16 d) { WriteWordROM(a, d); } -void SekWriteLongROM(UINT32 a, UINT32 d) { WriteLongROM(a, d); } - -// ---------------------------------------------------------------------------- -// Callbacks for A68K - -#ifdef EMU_A68K -static INT32 A68KIRQAcknowledge(INT32 nIRQ) -{ - if (nSekIRQPending[nSekActive] & SEK_IRQSTATUS_AUTO) { - M68000_regs.irq &= 0x78; - nSekIRQPending[nSekActive] = 0; - } - - nSekIRQPending[nSekActive] = 0; - - if (pSekExt->IrqCallback) { - return pSekExt->IrqCallback(nIRQ); - } - - return -1; -} - -static INT32 A68KResetCallback() -{ - if (pSekExt->ResetCallback == NULL) { - return 0; - } - return pSekExt->ResetCallback(); -} - -static INT32 A68KRTECallback() -{ - if (pSekExt->RTECallback == NULL) { - return 0; - } - return pSekExt->RTECallback(); -} - -static INT32 A68KCmpCallback(UINT32 val, INT32 reg) -{ - if (pSekExt->CmpCallback == NULL) { - return 0; - } - return pSekExt->CmpCallback(val, reg); -} - -static INT32 SekSetup(struct A68KContext* psr) -{ - psr->IrqCallback = A68KIRQAcknowledge; - psr->ResetCallback = A68KResetCallback; - psr->RTECallback = A68KRTECallback; - psr->CmpCallback = A68KCmpCallback; - - return 0; -} -#endif - -// ---------------------------------------------------------------------------- -// Callbacks for Musashi - -#ifdef EMU_M68K -extern "C" INT32 M68KIRQAcknowledge(INT32 nIRQ) -{ - if (nSekIRQPending[nSekActive] & SEK_IRQSTATUS_AUTO) { - m68k_set_irq(0); - nSekIRQPending[nSekActive] = 0; - } - - if (pSekExt->IrqCallback) { - return pSekExt->IrqCallback(nIRQ); - } - - return M68K_INT_ACK_AUTOVECTOR; -} - -extern "C" void M68KResetCallback() -{ - if (pSekExt->ResetCallback) { - pSekExt->ResetCallback(); - } -} - -extern "C" void M68KRTECallback() -{ - if (pSekExt->RTECallback) { - pSekExt->RTECallback(); - } -} - -extern "C" void M68KcmpildCallback(UINT32 val, INT32 reg) -{ - if (pSekExt->CmpCallback) { - pSekExt->CmpCallback(val, reg); - } -} - -extern "C" INT32 M68KTASCallback() -{ - if (pSekExt->TASCallback) { - return pSekExt->TASCallback(); - } - - return 1; // enable by default -} -#endif - -// ---------------------------------------------------------------------------- -// Initialisation/exit/reset - -#ifdef EMU_A68K -static INT32 SekInitCPUA68K(INT32 nCount, INT32 nCPUType) -{ - if (nCPUType != 0x68000) { - return 1; - } - - nSekCPUType[nCount] = 0; - - // Allocate emu-specific cpu states - SekRegs[nCount] = (struct A68KContext*)malloc(sizeof(struct A68KContext)); - if (SekRegs[nCount] == NULL) { - return 1; - } - - // Setup each cpu context - memset(SekRegs[nCount], 0, sizeof(struct A68KContext)); - SekSetup(SekRegs[nCount]); - - // Init cpu emulator - M68000_RESET(); - - return 0; -} -#endif - -#ifdef EMU_M68K -static INT32 SekInitCPUM68K(INT32 nCount, INT32 nCPUType) -{ - nSekCPUType[nCount] = nCPUType; - - switch (nCPUType) { - case 0x68000: - m68k_set_cpu_type(M68K_CPU_TYPE_68000); - break; - case 0x68010: - m68k_set_cpu_type(M68K_CPU_TYPE_68010); - break; - case 0x68EC020: - m68k_set_cpu_type(M68K_CPU_TYPE_68EC020); - break; - default: - return 1; - } - - nSekM68KContextSize[nCount] = m68k_context_size(); - SekM68KContext[nCount] = (INT8*)malloc(nSekM68KContextSize[nCount]); - if (SekM68KContext[nCount] == NULL) { - return 1; - } - memset(SekM68KContext[nCount], 0, nSekM68KContextSize[nCount]); - m68k_get_context(SekM68KContext[nCount]); - - return 0; -} -#endif - -void SekNewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekNewFrame called without init\n")); -#endif - - for (INT32 i = 0; i <= nSekCount; i++) { - nSekCycles[i] = 0; - } - - nSekCyclesTotal = 0; -} - -void SekSetCyclesScanline(INT32 nCycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetCyclesScanline called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetCyclesScanline called when no CPU open\n")); -#endif - - nSekCyclesScanline = nCycles; -} - -static UINT8 SekCheatRead(UINT32 a) -{ - return SekReadByte(a); -} - -static cpu_core_config SekCheatCpuConfig = -{ - SekOpen, - SekClose, - SekCheatRead, - SekWriteByteROM, - SekGetActive, - SekTotalCycles, - SekNewFrame, - SekRun, - SekRunEnd, - SekReset, - (1<<24), // 0x1000000 - 0 -}; - -INT32 SekInit(INT32 nCount, INT32 nCPUType) -{ - DebugCPU_SekInitted = 1; - - struct SekExt* ps = NULL; - -/*#if !defined BUILD_A68K - bBurnUseASMCPUEmulation = false; -#endif*/ - - if (nSekActive >= 0) { - SekClose(); - nSekActive = -1; - } - - if (nCount > nSekCount) { - nSekCount = nCount; - } - - // Allocate cpu extenal data (memory map etc) - SekExt[nCount] = (struct SekExt*)malloc(sizeof(struct SekExt)); - if (SekExt[nCount] == NULL) { - SekExit(); - return 1; - } - memset(SekExt[nCount], 0, sizeof(struct SekExt)); - - // Put in default memory handlers - ps = SekExt[nCount]; - - for (INT32 j = 0; j < SEK_MAXHANDLER; j++) { - ps->ReadByte[j] = DefReadByte; - ps->WriteByte[j] = DefWriteByte; - } - - ps->ReadWord[0] = DefReadWord0; - ps->WriteWord[0] = DefWriteWord0; - ps->ReadLong[0] = DefReadLong0; - ps->WriteLong[0] = DefWriteLong0; - -#if SEK_MAXHANDLER >= 2 - ps->ReadWord[1] = DefReadWord1; - ps->WriteWord[1] = DefWriteWord1; - ps->ReadLong[1] = DefReadLong1; - ps->WriteLong[1] = DefWriteLong1; -#endif - -#if SEK_MAXHANDLER >= 3 - ps->ReadWord[2] = DefReadWord2; - ps->WriteWord[2] = DefWriteWord2; - ps->ReadLong[2] = DefReadLong2; - ps->WriteLong[2] = DefWriteLong2; -#endif - -#if SEK_MAXHANDLER >= 4 - ps->ReadWord[3] = DefReadWord3; - ps->WriteWord[3] = DefWriteWord3; - ps->ReadLong[3] = DefReadLong3; - ps->WriteLong[3] = DefWriteLong3; -#endif - -#if SEK_MAXHANDLER >= 5 - ps->ReadWord[4] = DefReadWord4; - ps->WriteWord[4] = DefWriteWord4; - ps->ReadLong[4] = DefReadLong4; - ps->WriteLong[4] = DefWriteLong4; -#endif - -#if SEK_MAXHANDLER >= 6 - ps->ReadWord[5] = DefReadWord5; - ps->WriteWord[5] = DefWriteWord5; - ps->ReadLong[5] = DefReadLong5; - ps->WriteLong[5] = DefWriteLong5; -#endif - -#if SEK_MAXHANDLER >= 7 - ps->ReadWord[6] = DefReadWord6; - ps->WriteWord[6] = DefWriteWord6; - ps->ReadLong[6] = DefReadLong6; - ps->WriteLong[6] = DefWriteLong6; -#endif - -#if SEK_MAXHANDLER >= 8 - ps->ReadWord[7] = DefReadWord7; - ps->WriteWord[7] = DefWriteWord7; - ps->ReadLong[7] = DefReadLong7; - ps->WriteLong[7] = DefWriteLong7; -#endif - -#if SEK_MAXHANDLER >= 9 - ps->ReadWord[8] = DefReadWord8; - ps->WriteWord[8] = DefWriteWord8; - ps->ReadLong[8] = DefReadLong8; - ps->WriteLong[8] = DefWriteLong8; -#endif - -#if SEK_MAXHANDLER >= 10 - ps->ReadWord[9] = DefReadWord9; - ps->WriteWord[9] = DefWriteWord9; - ps->ReadLong[9] = DefReadLong9; - ps->WriteLong[9] = DefWriteLong9; -#endif - -#if SEK_MAXHANDLER >= 11 - for (int j = 10; j < SEK_MAXHANDLER; j++) { - ps->ReadWord[j] = DefReadWord0; - ps->WriteWord[j] = DefWriteWord0; - ps->ReadLong[j] = DefReadLong0; - ps->WriteLong[j] = DefWriteLong0; - } -#endif - - // Map the normal memory handlers - SekDbgDisableBreakpoints(); - -#ifdef EMU_A68K - if (bBurnUseASMCPUEmulation && nCPUType == 0x68000) { - if (SekInitCPUA68K(nCount, nCPUType)) { - SekExit(); - return 1; - } - } else { -#endif - -#ifdef EMU_M68K - m68k_init(); - if (SekInitCPUM68K(nCount, nCPUType)) { - SekExit(); - return 1; - } -#endif - -#ifdef EMU_A68K - } -#endif - - nSekCycles[nCount] = 0; - nSekIRQPending[nCount] = 0; - - nSekCyclesTotal = 0; - nSekCyclesScanline = 0; - - CpuCheatRegister(nCount, &SekCheatCpuConfig); - - return 0; -} - -#ifdef EMU_A68K -static void SekCPUExitA68K(INT32 i) -{ - if (SekRegs[i]) { - free(SekRegs[i]); - SekRegs[i] = NULL; - } -} -#endif - -#ifdef EMU_M68K -static void SekCPUExitM68K(INT32 i) -{ - if(SekM68KContext[i]) { - free(SekM68KContext[i]); - SekM68KContext[i] = NULL; - } -} -#endif - -INT32 SekExit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekExit called without init\n")); -#endif - - if (!DebugCPU_SekInitted) return 1; - - // Deallocate cpu extenal data (memory map etc) - for (INT32 i = 0; i <= nSekCount; i++) { - -#ifdef EMU_A68K - SekCPUExitA68K(i); -#endif - -#ifdef EMU_M68K - SekCPUExitM68K(i); -#endif - - // Deallocate other context data - if (SekExt[i]) { - free(SekExt[i]); - SekExt[i] = NULL; - } - } - - pSekExt = NULL; - - nSekActive = -1; - nSekCount = -1; - - DebugCPU_SekInitted = 0; - - return 0; -} - -void SekReset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekReset called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekReset called when no CPU open\n")); -#endif - -#ifdef EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - // A68K has no internal support for resetting the processor, so do what's needed ourselves - M68000_regs.a[7] = FetchLong(0); // Get initial stackpointer (register A7) - M68000_regs.pc = FetchLong(4); // Get initial PC - M68000_regs.srh = 0x27; // start in supervisor state - A68KChangePC(M68000_regs.pc); - } else { -#endif - -#ifdef EMU_M68K - m68k_pulse_reset(); -#endif - -#ifdef EMU_A68K - } -#endif - -} - -// ---------------------------------------------------------------------------- -// Control the active CPU - -// Open a CPU -void SekOpen(const INT32 i) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekOpen called without init\n")); - if (i > nSekCount) bprintf(PRINT_ERROR, _T("SekOpen called with invalid index %x\n"), i); - if (nSekActive != -1) bprintf(PRINT_ERROR, _T("SekOpen called when CPU already open with index %x\n"), i); -#endif - - if (i != nSekActive) { - nSekActive = i; - - pSekExt = SekExt[nSekActive]; // Point to cpu context - -#ifdef EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - memcpy(&M68000_regs, SekRegs[nSekActive], sizeof(M68000_regs)); - A68KChangePC(M68000_regs.pc); - } else { -#endif - -#ifdef EMU_M68K - m68k_set_context(SekM68KContext[nSekActive]); -#endif - -#ifdef EMU_A68K - } -#endif - - nSekCyclesTotal = nSekCycles[nSekActive]; - } -} - -// Close the active cpu -void SekClose() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekClose called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekClose called when no CPU open\n")); -#endif - -#ifdef EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - memcpy(SekRegs[nSekActive], &M68000_regs, sizeof(M68000_regs)); - } else { -#endif - -#ifdef EMU_M68K - m68k_get_context(SekM68KContext[nSekActive]); -#endif - -#ifdef EMU_A68K - } -#endif - - nSekCycles[nSekActive] = nSekCyclesTotal; - - nSekActive = -1; -} - -// Get the current CPU -INT32 SekGetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekGetActive called without init\n")); -#endif - - return nSekActive; -} - -// For Megadrive - check if the vdp controlport should set IRQ -INT32 SekShouldInterrupt() -{ - return m68k_check_shouldinterrupt(); -} - -void SekBurnUntilInt() -{ - m68k_burn_until_irq(1); -} - -// Set the status of an IRQ line on the active CPU -void SekSetIRQLine(const INT32 line, const INT32 nstatus) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetIRQLine called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetIRQLine called when no CPU open\n")); -#endif - - INT32 status = nstatus << 12; // needed for compatibility - -// bprintf(PRINT_NORMAL, _T(" - irq line %i -> %i\n"), line, status); - - if (status) { - nSekIRQPending[nSekActive] = line | status; - -#ifdef EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - nSekCyclesTotal += (nSekCyclesToDo - nSekCyclesDone) - m68k_ICount; - nSekCyclesDone += (nSekCyclesToDo - nSekCyclesDone) - m68k_ICount; - - M68000_regs.irq = line; - m68k_ICount = nSekCyclesToDo = -1; // Force A68K to exit - } else { -#endif - -#ifdef EMU_M68K - m68k_set_irq(line); -#endif - -#ifdef EMU_A68K - } -#endif - - return; - } - - nSekIRQPending[nSekActive] = 0; - -#ifdef EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - M68000_regs.irq &= 0x78; - } else { -#endif - -#ifdef EMU_M68K - m68k_set_irq(0); -#endif - -#ifdef EMU_A68K - } -#endif - -} - -// Adjust the active CPU's timeslice -void SekRunAdjust(const INT32 nCycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekRunAdjust called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekRunAdjust called when no CPU open\n")); -#endif - - if (nCycles < 0 && m68k_ICount < -nCycles) { - SekRunEnd(); - return; - } - -#ifdef EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - m68k_ICount += nCycles; - nSekCyclesToDo += nCycles; - nSekCyclesSegment += nCycles; - } else { -#endif - -#ifdef EMU_M68K - nSekCyclesToDo += nCycles; - m68k_modify_timeslice(nCycles); -#endif - -#ifdef EMU_A68K - } -#endif - -} - -// End the active CPU's timeslice -void SekRunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekRunEnd called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekRunEnd called when no CPU open\n")); -#endif - -#ifdef EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - nSekCyclesTotal += (nSekCyclesToDo - nSekCyclesDone) - m68k_ICount; - nSekCyclesDone += (nSekCyclesToDo - nSekCyclesDone) - m68k_ICount; - nSekCyclesSegment = nSekCyclesDone; - m68k_ICount = nSekCyclesToDo = -1; // Force A68K to exit - } else { -#endif - -#ifdef EMU_M68K - m68k_end_timeslice(); -#endif - -#ifdef EMU_A68K - } -#endif - -} - -// Run the active CPU -INT32 SekRun(const INT32 nCycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekRun called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekRun called when no CPU open\n")); -#endif - -#ifdef EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - nSekCyclesDone = 0; - nSekCyclesSegment = nCycles; - do { - m68k_ICount = nSekCyclesToDo = nSekCyclesSegment - nSekCyclesDone; - - if (M68000_regs.irq == 0x80) { // Cpu is in stopped state till interrupt - nSekCyclesDone = nSekCyclesSegment; - nSekCyclesTotal += nSekCyclesSegment; - } else { - M68000_RUN(); - nSekCyclesDone += nSekCyclesToDo - m68k_ICount; - nSekCyclesTotal += nSekCyclesToDo - m68k_ICount; - } - } while (nSekCyclesDone < nSekCyclesSegment); - - nSekCyclesSegment = nSekCyclesDone; - nSekCyclesToDo = m68k_ICount = -1; - nSekCyclesDone = 0; - - return nSekCyclesSegment; // Return the number of cycles actually done - } else { -#endif - -#ifdef EMU_M68K - nSekCyclesToDo = nCycles; - - nSekCyclesSegment = m68k_execute(nCycles); - - nSekCyclesTotal += nSekCyclesSegment; - nSekCyclesToDo = m68k_ICount = -1; - - return nSekCyclesSegment; -#else - return 0; -#endif - -#ifdef EMU_A68K - } -#endif - -} - -// ---------------------------------------------------------------------------- -// Breakpoint support - -void SekDbgDisableBreakpoints() -{ -#if defined FBA_DEBUG && defined EMU_M68K - m68k_set_instr_hook_callback(NULL); - - M68KReadByteDebug = M68KReadByte; - M68KReadWordDebug = M68KReadWord; - M68KReadLongDebug = M68KReadLong; - - M68KWriteByteDebug = M68KWriteByte; - M68KWriteWordDebug = M68KWriteWord; - M68KWriteLongDebug = M68KWriteLong; -#endif - -#ifdef EMU_A68K - a68k_memory_intf = a68k_inter_normal; -#endif - - mame_debug = 0; -} - -#if defined (FBA_DEBUG) - -void SekDbgEnableBreakpoints() -{ - if (BreakpointDataRead[0].address || BreakpointDataWrite[0].address || BreakpointFetch[0].address) { -#if defined FBA_DEBUG && defined EMU_M68K - SekDbgDisableBreakpoints(); - - if (BreakpointFetch[0].address) { - m68k_set_instr_hook_callback(M68KCheckBreakpoint); - } - - if (BreakpointDataRead[0].address) { - M68KReadByteDebug = M68KReadByteBP; - M68KReadWordDebug = M68KReadWordBP; - M68KReadLongDebug = M68KReadLongBP; - } - - if (BreakpointDataWrite[0].address) { - M68KWriteByteDebug = M68KWriteByteBP; - M68KWriteWordDebug = M68KWriteWordBP; - M68KWriteLongDebug = M68KWriteLongBP; - } -#endif - -#ifdef EMU_A68K - a68k_memory_intf = a68k_inter_breakpoint; - if (BreakpointFetch[0].address) { - a68k_memory_intf.DebugCallback = A68KCheckBreakpoint; - mame_debug = 255; - } else { - a68k_memory_intf.DebugCallback = NULL; - mame_debug = 0; - } -#endif - } else { - SekDbgDisableBreakpoints(); - } -} - -void SekDbgEnableSingleStep() -{ -#if defined FBA_DEBUG && defined EMU_M68K - m68k_set_instr_hook_callback(M68KSingleStep); -#endif - -#ifdef EMU_A68K - a68k_memory_intf.DebugCallback = A68KSingleStep; - mame_debug = 254; -#endif -} - -INT32 SekDbgSetBreakpointDataRead(UINT32 nAddress, INT32 nIdentifier) -{ - for (INT32 i = 0; i < 8; i++) { - if (BreakpointDataRead[i].id == nIdentifier) { - - if (nAddress) { // Change breakpoint - BreakpointDataRead[i].address = nAddress; - } else { // Delete breakpoint - for ( ; i < 8; i++) { - BreakpointDataRead[i] = BreakpointDataRead[i + 1]; - } - } - - SekDbgEnableBreakpoints(); - return 0; - } - } - - // No breakpoints present, add it to the 1st slot - BreakpointDataRead[0].address = nAddress; - BreakpointDataRead[0].id = nIdentifier; - - SekDbgEnableBreakpoints(); - return 0; -} - -INT32 SekDbgSetBreakpointDataWrite(UINT32 nAddress, INT32 nIdentifier) -{ - for (INT32 i = 0; i < 8; i++) { - if (BreakpointDataWrite[i].id == nIdentifier) { - - if (nAddress) { // Change breakpoint - BreakpointDataWrite[i].address = nAddress; - } else { // Delete breakpoint - for ( ; i < 8; i++) { - BreakpointDataWrite[i] = BreakpointDataWrite[i + 1]; - } - } - - SekDbgEnableBreakpoints(); - return 0; - } - } - - // No breakpoints present, add it to the 1st slot - BreakpointDataWrite[0].address = nAddress; - BreakpointDataWrite[0].id = nIdentifier; - - SekDbgEnableBreakpoints(); - return 0; -} - -INT32 SekDbgSetBreakpointFetch(UINT32 nAddress, INT32 nIdentifier) -{ - for (INT32 i = 0; i < 8; i++) { - if (BreakpointFetch[i].id == nIdentifier) { - - if (nAddress) { // Change breakpoint - BreakpointFetch[i].address = nAddress; - } else { // Delete breakpoint - for ( ; i < 8; i++) { - BreakpointFetch[i] = BreakpointFetch[i + 1]; - } - } - - SekDbgEnableBreakpoints(); - return 0; - } - } - - // No breakpoints present, add it to the 1st slot - BreakpointFetch[0].address = nAddress; - BreakpointFetch[0].id = nIdentifier; - - SekDbgEnableBreakpoints(); - return 0; -} - -#endif - -// ---------------------------------------------------------------------------- -// Memory map setup - -// Note - each page is 1 << SEK_BITS. -INT32 SekMapMemory(UINT8* pMemory, UINT32 nStart, UINT32 nEnd, INT32 nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekMapMemory called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekMapMemory called when no CPU open\n")); -#endif - - UINT8* Ptr = pMemory - nStart; - UINT8** pMemMap = pSekExt->MemMap + (nStart >> SEK_SHIFT); - - // Special case for ROM banks - if (nType == MAP_ROM) { - for (UINT32 i = (nStart & ~SEK_PAGEM); i <= nEnd; i += SEK_PAGE_SIZE, pMemMap++) { - pMemMap[0] = Ptr + i; - pMemMap[SEK_WADD * 2] = Ptr + i; - } - - return 0; - } - - for (UINT32 i = (nStart & ~SEK_PAGEM); i <= nEnd; i += SEK_PAGE_SIZE, pMemMap++) { - - if (nType & MAP_READ) { // Read - pMemMap[0] = Ptr + i; - } - if (nType & MAP_WRITE) { // Write - pMemMap[SEK_WADD] = Ptr + i; - } - if (nType & MAP_FETCH) { // Fetch - pMemMap[SEK_WADD * 2] = Ptr + i; - } - } - - return 0; -} - -INT32 SekMapHandler(uintptr_t nHandler, UINT32 nStart, UINT32 nEnd, INT32 nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekMapHander called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekMapHandler called when no CPU open\n")); -#endif - - UINT8** pMemMap = pSekExt->MemMap + (nStart >> SEK_SHIFT); - - // Add to memory map - for (UINT32 i = (nStart & ~SEK_PAGEM); i <= nEnd; i += SEK_PAGE_SIZE, pMemMap++) { - - if (nType & MAP_READ) { // Read - pMemMap[0] = (UINT8*)nHandler; - } - if (nType & MAP_WRITE) { // Write - pMemMap[SEK_WADD] = (UINT8*)nHandler; - } - if (nType & MAP_FETCH) { // Fetch - pMemMap[SEK_WADD * 2] = (UINT8*)nHandler; - } - } - - return 0; -} - -// Set callbacks -INT32 SekSetResetCallback(pSekResetCallback pCallback) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetResetCallback called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetResetCallback called when no CPU open\n")); -#endif - - pSekExt->ResetCallback = pCallback; - - return 0; -} - -INT32 SekSetRTECallback(pSekRTECallback pCallback) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetRTECallback called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetRTECallback called when no CPU open\n")); -#endif - - pSekExt->RTECallback = pCallback; - - return 0; -} - -INT32 SekSetIrqCallback(pSekIrqCallback pCallback) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetIrqCallback called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetIrqCallback called when no CPU open\n")); -#endif - - pSekExt->IrqCallback = pCallback; - - return 0; -} - -INT32 SekSetCmpCallback(pSekCmpCallback pCallback) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetCmpCallback called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetCmpCallback called when no CPU open\n")); -#endif - - pSekExt->CmpCallback = pCallback; - - return 0; -} - -INT32 SekSetTASCallback(pSekTASCallback pCallback) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetTASCallback called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetTASCallback called when no CPU open\n")); -#endif - - pSekExt->TASCallback = pCallback; - - return 0; -} - -// Set handlers -INT32 SekSetReadByteHandler(INT32 i, pSekReadByteHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetReadByteHandler called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetReadByteHandler called when no CPU open\n")); -#endif - - if (i >= SEK_MAXHANDLER) { - return 1; - } - - pSekExt->ReadByte[i] = pHandler; - - return 0; -} - -INT32 SekSetWriteByteHandler(INT32 i, pSekWriteByteHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetWriteByteHandler called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetWriteByteHandler called when no CPU open\n")); -#endif - - if (i >= SEK_MAXHANDLER) { - return 1; - } - - pSekExt->WriteByte[i] = pHandler; - - return 0; -} - -INT32 SekSetReadWordHandler(INT32 i, pSekReadWordHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetReadWordHandler called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetReadWordHandler called when no CPU open\n")); -#endif - - if (i >= SEK_MAXHANDLER) { - return 1; - } - - pSekExt->ReadWord[i] = pHandler; - - return 0; -} - -INT32 SekSetWriteWordHandler(INT32 i, pSekWriteWordHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetWriteWordHandler called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetWriteWordHandler called when no CPU open\n")); -#endif - - if (i >= SEK_MAXHANDLER) { - return 1; - } - - pSekExt->WriteWord[i] = pHandler; - - return 0; -} - -INT32 SekSetReadLongHandler(INT32 i, pSekReadLongHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetReadLongHandler called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetReadLongHandler called when no CPU open\n")); -#endif - - if (i >= SEK_MAXHANDLER) { - return 1; - } - - pSekExt->ReadLong[i] = pHandler; - - return 0; -} - -INT32 SekSetWriteLongHandler(INT32 i, pSekWriteLongHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekSetWriteLongHandler called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekSetWriteLongHandler called when no CPU open\n")); -#endif - - if (i >= SEK_MAXHANDLER) { - return 1; - } - - pSekExt->WriteLong[i] = pHandler; - - return 0; -} - -// ---------------------------------------------------------------------------- -// Query register values - -#ifdef EMU_A68K -UINT32 SekGetPC(INT32 n) -#else -UINT32 SekGetPC(INT32) -#endif -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekGetPC called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekGetPC called when no CPU open\n")); -#endif - -#ifdef EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - if (n < 0) { // Currently active CPU - return M68000_regs.pc; - } else { - return SekRegs[n]->pc; // Any CPU - } - } else { -#endif - -#ifdef EMU_M68K - return m68k_get_reg(NULL, M68K_REG_PC); -#else - return 0; -#endif - -#ifdef EMU_A68K - } -#endif - -} - -INT32 SekDbgGetCPUType() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekDbgGetCPUType called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekDbgGetCPUType called when no CPU open\n")); -#endif - - switch (nSekCPUType[nSekActive]) { - case 0: - case 0x68000: - return M68K_CPU_TYPE_68000; - case 0x68010: - return M68K_CPU_TYPE_68010; - case 0x68EC020: - return M68K_CPU_TYPE_68EC020; - } - - return 0; -} - -INT32 SekDbgGetPendingIRQ() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekDbgGetPendingIRQ called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekDbgGetPendingIRQ called when no CPU open\n")); -#endif - - return nSekIRQPending[nSekActive] & 7; -} - -UINT32 SekDbgGetRegister(SekRegister nRegister) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekDbgGetRegister called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekDbgGetRegister called when no CPU open\n")); -#endif - -#if defined EMU_A68K - if (nSekCPUType[nSekActive] == 0) { - switch (nRegister) { - case SEK_REG_D0: - return M68000_regs.d[0]; - case SEK_REG_D1: - return M68000_regs.d[1]; - case SEK_REG_D2: - return M68000_regs.d[2]; - case SEK_REG_D3: - return M68000_regs.d[3]; - case SEK_REG_D4: - return M68000_regs.d[4]; - case SEK_REG_D5: - return M68000_regs.d[5]; - case SEK_REG_D6: - return M68000_regs.d[6]; - case SEK_REG_D7: - return M68000_regs.d[7]; - - case SEK_REG_A0: - return M68000_regs.a[0]; - case SEK_REG_A1: - return M68000_regs.a[1]; - case SEK_REG_A2: - return M68000_regs.a[2]; - case SEK_REG_A3: - return M68000_regs.a[3]; - case SEK_REG_A4: - return M68000_regs.a[4]; - case SEK_REG_A5: - return M68000_regs.a[5]; - case SEK_REG_A6: - return M68000_regs.a[6]; - case SEK_REG_A7: - return M68000_regs.a[7]; - - case SEK_REG_PC: - return M68000_regs.pc; - - case SEK_REG_SR: - return GetA68KSR(); - - case SEK_REG_SP: - return M68000_regs.a[7]; - case SEK_REG_USP: - return GetA68KUSP(); - case SEK_REG_ISP: - return GetA68KISP(); - - default: - return 0; - } - } -#endif - - switch (nRegister) { - case SEK_REG_D0: - return m68k_get_reg(NULL, M68K_REG_D0); - case SEK_REG_D1: - return m68k_get_reg(NULL, M68K_REG_D1); - case SEK_REG_D2: - return m68k_get_reg(NULL, M68K_REG_D2); - case SEK_REG_D3: - return m68k_get_reg(NULL, M68K_REG_D3); - case SEK_REG_D4: - return m68k_get_reg(NULL, M68K_REG_D4); - case SEK_REG_D5: - return m68k_get_reg(NULL, M68K_REG_D5); - case SEK_REG_D6: - return m68k_get_reg(NULL, M68K_REG_D6); - case SEK_REG_D7: - return m68k_get_reg(NULL, M68K_REG_D7); - - case SEK_REG_A0: - return m68k_get_reg(NULL, M68K_REG_A0); - case SEK_REG_A1: - return m68k_get_reg(NULL, M68K_REG_A1); - case SEK_REG_A2: - return m68k_get_reg(NULL, M68K_REG_A2); - case SEK_REG_A3: - return m68k_get_reg(NULL, M68K_REG_A3); - case SEK_REG_A4: - return m68k_get_reg(NULL, M68K_REG_A4); - case SEK_REG_A5: - return m68k_get_reg(NULL, M68K_REG_A5); - case SEK_REG_A6: - return m68k_get_reg(NULL, M68K_REG_A6); - case SEK_REG_A7: - return m68k_get_reg(NULL, M68K_REG_A7); - - case SEK_REG_PC: - return m68k_get_reg(NULL, M68K_REG_PC); - - case SEK_REG_SR: - return m68k_get_reg(NULL, M68K_REG_SR); - - case SEK_REG_SP: - return m68k_get_reg(NULL, M68K_REG_SP); - case SEK_REG_USP: - return m68k_get_reg(NULL, M68K_REG_USP); - case SEK_REG_ISP: - return m68k_get_reg(NULL, M68K_REG_ISP); - case SEK_REG_MSP: - return m68k_get_reg(NULL, M68K_REG_MSP); - - case SEK_REG_VBR: - return m68k_get_reg(NULL, M68K_REG_VBR); - - case SEK_REG_SFC: - return m68k_get_reg(NULL, M68K_REG_SFC); - case SEK_REG_DFC: - return m68k_get_reg(NULL, M68K_REG_DFC); - - case SEK_REG_CACR: - return m68k_get_reg(NULL, M68K_REG_CACR); - case SEK_REG_CAAR: - return m68k_get_reg(NULL, M68K_REG_CAAR); - - default: - return 0; - } -} - -bool SekDbgSetRegister(SekRegister nRegister, UINT32 nValue) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekDbgSetRegister called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, _T("SekDbgSetRegister called when no CPU open\n")); -#endif - - switch (nRegister) { - case SEK_REG_D0: - case SEK_REG_D1: - case SEK_REG_D2: - case SEK_REG_D3: - case SEK_REG_D4: - case SEK_REG_D5: - case SEK_REG_D6: - case SEK_REG_D7: - break; - - case SEK_REG_A0: - case SEK_REG_A1: - case SEK_REG_A2: - case SEK_REG_A3: - case SEK_REG_A4: - case SEK_REG_A5: - case SEK_REG_A6: - case SEK_REG_A7: - break; - - case SEK_REG_PC: - if (nSekCPUType[nSekActive] == 0) { -#if defined EMU_A68K - M68000_regs.pc = nValue; - A68KChangePC(M68000_regs.pc); -#endif - } else { - m68k_set_reg(M68K_REG_PC, nValue); - } - SekClose(); - return true; - - case SEK_REG_SR: - break; - - case SEK_REG_SP: - case SEK_REG_USP: - case SEK_REG_ISP: - case SEK_REG_MSP: - break; - - case SEK_REG_VBR: - break; - - case SEK_REG_SFC: - case SEK_REG_DFC: - break; - - case SEK_REG_CACR: - case SEK_REG_CAAR: - break; - - default: - break; - } - - return false; -} - -// ---------------------------------------------------------------------------- -// Savestate support - -INT32 SekScan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, _T("SekScan called without init\n")); -#endif - - // Scan the 68000 states - struct BurnArea ba; - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - memset(&ba, 0, sizeof(ba)); - - nSekActive = -1; - - for (INT32 i = 0; i <= nSekCount; i++) { - char szName[] = "MC68000 #n"; -#if defined EMU_A68K && defined EMU_M68K - INT32 nType = nSekCPUType[i]; -#endif - - szName[9] = '0' + i; - - SCAN_VAR(nSekCPUType[i]); - SCAN_VAR(nSekIRQPending[i]); // fix for Gradius 2 s.states -dink feb.3.2015 - -#if defined EMU_A68K && defined EMU_M68K - // Switch to another core if needed - if ((nAction & ACB_WRITE) && nType != nSekCPUType[i]) { - if (nType != 0 && nType != 0x68000 && nSekCPUType[i] != 0 && nSekCPUType[i] != 0x68000) { - continue; - } - - if (nSekCPUType[i] == 0x68000) { - SekCPUExitA68K(i); - if (SekInitCPUM68K(i, 0x68000)) { - return 1; - } - } else { - SekCPUExitM68K(i); - if (SekInitCPUA68K(i, 0x68000)) { - return 1; - } - } - } -#endif - -#ifdef EMU_A68K - if (nSekCPUType[i] == 0) { - ba.Data = SekRegs[i]; - ba.nLen = sizeof(A68KContext); - ba.szName = szName; - - if (nAction & ACB_READ) { - // Blank pointers - SekRegs[i]->IrqCallback = NULL; - SekRegs[i]->ResetCallback = NULL; - } - - BurnAcb(&ba); - - // Re-setup each cpu on read/write - if (nAction & ACB_ACCESSMASK) { - SekSetup(SekRegs[i]); - } - } else { -#endif - -#ifdef EMU_M68K - if (nSekCPUType[i] != 0) { - ba.Data = SekM68KContext[i]; - // for savestate portability: preserve our cpu's pointers, they are set up in DrvInit() and can be specific to different systems. - // Therefore we scan the cpu context structure up until right before the pointers - ba.nLen = m68k_context_size_no_pointers(); - ba.szName = szName; - BurnAcb(&ba); - } -#endif - -#ifdef EMU_A68K - } -#endif - - } - - return 0; -} diff --git a/jan/src/cpu/m68000_intf.h b/jan/src/cpu/m68000_intf.h deleted file mode 100644 index 9d46c8011..000000000 --- a/jan/src/cpu/m68000_intf.h +++ /dev/null @@ -1,232 +0,0 @@ -// 68000 (Sixty Eight K) Interface - header file -#include -#ifndef FASTCALL - #undef __fastcall - #define __fastcall -#endif - -#if defined BUILD_A68K - #define EMU_A68K // Use A68K Assembler 68000 emulator -#endif - -#define EMU_M68K // Use Musashi 68000 emulator - -#define SEK_MAX (4) // Maximum number of CPUs supported - -#if defined EMU_M68K - #include "m68k/m68k.h" -#endif - -// Number of bits used for each page in the fast memory map -#define SEK_BITS (10) // 10 = 0x0400 page size -#define SEK_PAGE_COUNT (1 << (24 - SEK_BITS)) // Number of pages -#define SEK_SHIFT (SEK_BITS) // Shift value = page bits -#define SEK_PAGE_SIZE (1 << SEK_BITS) // Page size -#define SEK_PAGEM (SEK_PAGE_SIZE - 1) -#define SEK_WADD (SEK_PAGE_COUNT) // Value to add for write section = Number of pages -#define SEK_MASK (SEK_WADD - 1) -#define SEK_MAXHANDLER (10) // Max. number of handlers for memory access - -#if SEK_MAXHANDLER < 1 - #error At least one set of handlers for memory access must be used. -#endif - -#ifdef EMU_A68K - extern "C" void __cdecl M68000_RUN(); - extern "C" void __cdecl M68000_RESET(); -#endif - -#ifdef EMU_A68K - // The format of the data in a68k.asm (at the _M68000_regs location) - struct A68KContext { - UINT32 d[8], a[8]; - UINT32 isp, srh, ccr, xc, pc, irq, sr; - INT32 (*IrqCallback) (INT32 nIrq); - UINT32 ppc; - INT32 (*ResetCallback)(); - INT32 (*RTECallback)(); - INT32 (*CmpCallback)(UINT32 val, INT32 reg); - UINT32 sfc, dfc, usp, vbr; - UINT32 nAsmBank, nCpuVersion; - }; - extern "C" struct A68KContext M68000_regs; - extern struct A68KContext* SekRegs[SEK_MAX]; - - extern "C" UINT8* OP_ROM; - extern "C" UINT8* OP_RAM; - - void __fastcall AsekChangePc(UINT32 pc); -#endif - -#ifdef EMU_M68K - extern "C" INT32 nSekM68KContextSize[SEK_MAX]; - extern "C" INT8* SekM68KContext[SEK_MAX]; - extern "C" INT32 m68k_ICount; -#endif - -typedef UINT8 (__fastcall *pSekReadByteHandler)(UINT32 a); -typedef void (__fastcall *pSekWriteByteHandler)(UINT32 a, UINT8 d); -typedef UINT16 (__fastcall *pSekReadWordHandler)(UINT32 a); -typedef void (__fastcall *pSekWriteWordHandler)(UINT32 a, UINT16 d); -typedef UINT32 (__fastcall *pSekReadLongHandler)(UINT32 a); -typedef void (__fastcall *pSekWriteLongHandler)(UINT32 a, UINT32 d); - -typedef INT32 (__fastcall *pSekResetCallback)(); -typedef INT32 (__fastcall *pSekRTECallback)(); -typedef INT32 (__fastcall *pSekIrqCallback)(INT32 irq); -typedef INT32 (__fastcall *pSekCmpCallback)(UINT32 val, INT32 reg); -typedef INT32 (__fastcall *pSekTASCallback)(); - -extern INT32 nSekCycles[SEK_MAX], nSekCPUType[SEK_MAX]; - -// Mapped memory pointers to Rom and Ram areas (Read then Write) -// These memory areas must be allocated multiples of the page size -// with a 4 byte over-run area lookup for each page (*3 for read, write and fetch) -struct SekExt { - UINT8* MemMap[SEK_PAGE_COUNT * 3]; - - // If MemMap[i] < SEK_MAXHANDLER, use the handler functions - pSekReadByteHandler ReadByte[SEK_MAXHANDLER]; - pSekWriteByteHandler WriteByte[SEK_MAXHANDLER]; - pSekReadWordHandler ReadWord[SEK_MAXHANDLER]; - pSekWriteWordHandler WriteWord[SEK_MAXHANDLER]; - pSekReadLongHandler ReadLong[SEK_MAXHANDLER]; - pSekWriteLongHandler WriteLong[SEK_MAXHANDLER]; - - pSekResetCallback ResetCallback; - pSekRTECallback RTECallback; - pSekIrqCallback IrqCallback; - pSekCmpCallback CmpCallback; - pSekTASCallback TASCallback; -}; - -#define SEK_DEF_READ_WORD(i, a) { UINT16 d; d = (UINT16)(pSekExt->ReadByte[i](a) << 8); d |= (UINT16)(pSekExt->ReadByte[i]((a) + 1)); return d; } -#define SEK_DEF_WRITE_WORD(i, a, d) { pSekExt->WriteByte[i]((a),(UINT8)((d) >> 8)); pSekExt->WriteByte[i]((a) + 1, (UINT8)((d) & 0xff)); } -#define SEK_DEF_READ_LONG(i, a) { UINT32 d; d = pSekExt->ReadWord[i](a) << 16; d |= pSekExt->ReadWord[i]((a) + 2); return d; } -#define SEK_DEF_WRITE_LONG(i, a, d) { pSekExt->WriteWord[i]((a),(UINT16)((d) >> 16)); pSekExt->WriteWord[i]((a) + 2,(UINT16)((d) & 0xffff)); } - -extern struct SekExt *SekExt[SEK_MAX], *pSekExt; -extern INT32 nSekActive; // The cpu which is currently being emulated -extern INT32 nSekCyclesTotal, nSekCyclesScanline, nSekCyclesSegment, nSekCyclesDone, nSekCyclesToDo; - -UINT32 SekReadByte(UINT32 a); -UINT32 SekReadWord(UINT32 a); -UINT32 SekReadLong(UINT32 a); - -UINT32 SekFetchByte(UINT32 a); -UINT32 SekFetchWord(UINT32 a); -UINT32 SekFetchLong(UINT32 a); - -void SekWriteByte(UINT32 a, UINT8 d); -void SekWriteWord(UINT32 a, UINT16 d); -void SekWriteLong(UINT32 a, UINT32 d); - -void SekWriteByteROM(UINT32 a, UINT8 d); -void SekWriteWordROM(UINT32 a, UINT16 d); -void SekWriteLongROM(UINT32 a, UINT32 d); - -INT32 SekInit(INT32 nCount, INT32 nCPUType); -INT32 SekExit(); - -void SekNewFrame(); -void SekSetCyclesScanline(INT32 nCycles); - -void SekClose(); -void SekOpen(const INT32 i); -INT32 SekGetActive(); -INT32 SekShouldInterrupt(); -void SekBurnUntilInt(); - -#define SEK_IRQSTATUS_NONE (0x0000) -#define SEK_IRQSTATUS_AUTO (0x2000) -#define SEK_IRQSTATUS_ACK (0x1000) - -void SekSetIRQLine(const INT32 line, const INT32 status); -void SekReset(); - -void SekRunEnd(); -void SekRunAdjust(const INT32 nCycles); -INT32 SekRun(const INT32 nCycles); - -inline static INT32 SekIdle(INT32 nCycles) -{ -#if defined FBA_DEBUG - extern UINT8 DebugCPU_SekInitted; - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, (TCHAR*)_T("SekIdle called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, (TCHAR*)_T("SekIdle called when no CPU open\n")); -#endif - - nSekCyclesTotal += nCycles; - - return nCycles; -} - -inline static INT32 SekSegmentCycles() -{ -#if defined FBA_DEBUG - extern UINT8 DebugCPU_SekInitted; - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, (TCHAR*)_T("SekSegmentCycles called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, (TCHAR*)_T("SekSegmentCycles called when no CPU open\n")); -#endif - -#ifdef EMU_M68K - return nSekCyclesDone + nSekCyclesToDo - m68k_ICount; -#else - return nSekCyclesDone + nSekCyclesToDo; -#endif -} - -#if defined FBA_DEBUG -static INT32 SekTotalCycles() -#else -inline static INT32 SekTotalCycles() -#endif -{ -#if defined FBA_DEBUG - extern UINT8 DebugCPU_SekInitted; - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, (TCHAR*)_T("SekTotalCycles called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, (TCHAR*)_T("SekTotalCycles called when no CPU open\n")); -#endif - -#ifdef EMU_M68K - return nSekCyclesTotal + nSekCyclesToDo - m68k_ICount; -#else - return nSekCyclesTotal + nSekCyclesToDo; -#endif -} - -inline static INT32 SekCurrentScanline() -{ -#if defined FBA_DEBUG - extern UINT8 DebugCPU_SekInitted; - if (!DebugCPU_SekInitted) bprintf(PRINT_ERROR, (TCHAR*)_T("SekCurrentScanline called without init\n")); - if (nSekActive == -1) bprintf(PRINT_ERROR, (TCHAR*)_T("SekCurrentScanline called when no CPU open\n")); -#endif - - return SekTotalCycles() / nSekCyclesScanline; -} - - -// Map areas of memory -INT32 SekMapMemory(UINT8* pMemory, UINT32 nStart, UINT32 nEnd, INT32 nType); -INT32 SekMapHandler(uintptr_t nHandler, UINT32 nStart, UINT32 nEnd, INT32 nType); - -// Set handlers -INT32 SekSetReadByteHandler(INT32 i, pSekReadByteHandler pHandler); -INT32 SekSetWriteByteHandler(INT32 i, pSekWriteByteHandler pHandler); -INT32 SekSetReadWordHandler(INT32 i, pSekReadWordHandler pHandler); -INT32 SekSetWriteWordHandler(INT32 i, pSekWriteWordHandler pHandler); -INT32 SekSetReadLongHandler(INT32 i, pSekReadLongHandler pHandler); -INT32 SekSetWriteLongHandler(INT32 i, pSekWriteLongHandler pHandler); - -// Set callbacks -INT32 SekSetResetCallback(pSekResetCallback pCallback); -INT32 SekSetRTECallback(pSekRTECallback pCallback); -INT32 SekSetIrqCallback(pSekIrqCallback pCallback); -INT32 SekSetCmpCallback(pSekCmpCallback pCallback); -INT32 SekSetTASCallback(pSekTASCallback pCallback); - -// Get a CPU's PC -UINT32 SekGetPC(INT32 n); - -INT32 SekScan(INT32 nAction); diff --git a/jan/src/cpu/m6800_intf.cpp b/jan/src/cpu/m6800_intf.cpp deleted file mode 100644 index 6c3d96373..000000000 --- a/jan/src/cpu/m6800_intf.cpp +++ /dev/null @@ -1,664 +0,0 @@ -#include "burnint.h" -#include "m6800_intf.h" - -#define MAX_CPU 1 - -INT32 nM6800Count = 0; // note: is 0 when 1 cpu is in use. also, 0 when no cpus are in use. -static INT32 nCpuType = 0; - -static M6800Ext *M6800CPUContext = NULL; - -static INT32 nM6800CyclesDone[MAX_CPU]; -INT32 nM6800CyclesTotal; - -static UINT8 M6800ReadByteDummyHandler(UINT16) -{ - return 0; -} - -static void M6800WriteByteDummyHandler(UINT16, UINT8) -{ -} - -static UINT8 M6800ReadOpDummyHandler(UINT16) -{ - return 0; -} - -static UINT8 M6800ReadOpArgDummyHandler(UINT16) -{ - return 0; -} - -static UINT8 M6800ReadPortDummyHandler(UINT16) -{ - return 0; -} - -static void M6800WritePortDummyHandler(UINT16, UINT8) -{ -} - -void M6800Reset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800Reset called without init\n")); -#endif - - m6800_reset(); -} - -void M6800NewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800NewFrame called without init\n")); -#endif - - for (INT32 i = 0; i <= nM6800Count; i++) { - nM6800CyclesDone[i] = 0; - } - nM6800CyclesTotal = 0; -} - -static UINT8 M6800CheatRead(UINT32 a) -{ - return M6800ReadByte(a); -} - -void M6800Open(INT32 ) {} // does nothing -void M6800Close() {} // "" - -INT32 M6800GetActive() -{ - return 0; -} - -static cpu_core_config M6800CheatCpuConfig = -{ - M6800Open, - M6800Close, - M6800CheatRead, - M6800WriteRom, - M6800GetActive, - M6800TotalCycles, - M6800NewFrame, - M6800Run, // different - M6800RunEnd, - M6800Reset, - 1<<16, - 0 -}; - -static cpu_core_config HD63701CheatCpuConfig = -{ - M6800Open, - M6800Close, - M6800CheatRead, - M6800WriteRom, - M6800GetActive, - M6800TotalCycles, - M6800NewFrame, - HD63701Run, // different - M6800RunEnd, - M6800Reset, - 1<<16, - 0 -}; - -static cpu_core_config M6803CheatCpuConfig = -{ - M6800Open, - M6800Close, - M6800CheatRead, - M6800WriteRom, - M6800GetActive, - M6800TotalCycles, - M6800NewFrame, - M6803Run, // different - M6800RunEnd, - M6800Reset, - 1<<16, - 0 -}; - -static cpu_core_config NSC8105CheatCpuConfig = -{ - M6800Open, - M6800Close, - M6800CheatRead, - M6800WriteRom, - M6800GetActive, - M6800TotalCycles, - M6800NewFrame, - NSC8105Run, // different - M6800RunEnd, - M6800Reset, - 1<<16, - 0 -}; - -INT32 M6800CoreInit(INT32 num, INT32 type) -{ - DebugCPU_M6800Initted = 1; - - nM6800Count = num % MAX_CPU; - - M6800CPUContext = (M6800Ext*)malloc(num * sizeof(M6800Ext)); - if (M6800CPUContext == NULL) { - return 1; - } - - memset(M6800CPUContext, 0, num * sizeof(M6800Ext)); - - for (INT32 i = 0; i < num; i++) { - M6800CPUContext[i].ReadByte = M6800ReadByteDummyHandler; - M6800CPUContext[i].WriteByte = M6800WriteByteDummyHandler; - M6800CPUContext[i].ReadOp = M6800ReadOpDummyHandler; - M6800CPUContext[i].ReadOpArg = M6800ReadOpArgDummyHandler; - M6800CPUContext[i].ReadPort = M6800ReadPortDummyHandler; - M6800CPUContext[i].WritePort = M6800WritePortDummyHandler; - - nM6800CyclesDone[i] = 0; - - for (INT32 j = 0; j < (0x0100 * 3); j++) { - M6800CPUContext[i].pMemMap[j] = NULL; - } - } - - nM6800CyclesTotal = 0; - nCpuType = type; - - if (type == CPU_TYPE_M6800) { - m6800_init(); - - for (INT32 i = 0; i < num; i++) - CpuCheatRegister(i, &M6800CheatCpuConfig); - } - - if (type == CPU_TYPE_HD63701) { - hd63701_init(); - - for (INT32 i = 0; i < num; i++) - CpuCheatRegister(i, &HD63701CheatCpuConfig); - } - - if (type == CPU_TYPE_M6803) { - m6803_init(); - - for (INT32 i = 0; i < num; i++) - CpuCheatRegister(i, &M6803CheatCpuConfig); - } - - if (type == CPU_TYPE_M6801) { - m6801_init(); - - for (INT32 i = 0; i < num; i++) - CpuCheatRegister(i, &M6803CheatCpuConfig); - } - - if (type == CPU_TYPE_NSC8105) { - nsc8105_init(); - - for (INT32 i = 0; i < num; i++) - CpuCheatRegister(i, &NSC8105CheatCpuConfig); - } - - return 0; -} - -INT32 M6800Init(INT32 num) -{ - return M6800CoreInit(num, CPU_TYPE_M6800); -} - -INT32 HD63701Init(INT32 num) -{ - return M6800CoreInit(num, CPU_TYPE_HD63701); -} - -INT32 M6803Init(INT32 num) -{ - return M6800CoreInit(num, CPU_TYPE_M6803); -} - -INT32 M6801Init(INT32 num) -{ - return M6800CoreInit(num, CPU_TYPE_M6801); -} - -INT32 NSC8105Init(INT32 num) -{ - return M6800CoreInit(num, CPU_TYPE_NSC8105); -} - -void M6800Exit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800Exit called without init\n")); -#endif - - nM6800Count = 0; - nCpuType = 0; - - if (M6800CPUContext) { - free(M6800CPUContext); - M6800CPUContext = NULL; - } - - DebugCPU_M6800Initted = 0; -} - -void M6800SetIRQLine(INT32 vector, INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800SetIRQLine called without init\n")); - if (nCpuType != CPU_TYPE_M6800) bprintf(PRINT_ERROR, _T("M6800SetIRQLine called with invalid CPU Type\n")); -#endif - - if (status == CPU_IRQSTATUS_NONE) { - m6800_set_irq_line(vector, 0); - } - - if (status == CPU_IRQSTATUS_ACK) { - m6800_set_irq_line(vector, 1); - } - - if (status == CPU_IRQSTATUS_AUTO) { - m6800_set_irq_line(vector, 1); - m6800_execute(0); - m6800_set_irq_line(vector, 0); - m6800_execute(0); - } -} - -void HD63701SetIRQLine(INT32 vector, INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("HD63701SetIRQLine called without init\n")); - if (nCpuType != CPU_TYPE_HD63701) bprintf(PRINT_ERROR, _T("HD63701SetIRQLine called with invalid CPU Type\n")); -#endif - - if (status == CPU_IRQSTATUS_NONE) { - m6800_set_irq_line(vector, 0); - } - - if (status == CPU_IRQSTATUS_ACK) { - m6800_set_irq_line(vector, 1); - } - - if (status == CPU_IRQSTATUS_AUTO) { - m6800_set_irq_line(vector, 1); - hd63701_execute(0); - m6800_set_irq_line(vector, 0); - hd63701_execute(0); - } -} - -void M6803SetIRQLine(INT32 vector, INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6803SetIRQLine called without init\n")); - if (nCpuType != CPU_TYPE_M6803) bprintf(PRINT_ERROR, _T("M6803SetIRQLine called with invalid CPU Type\n")); -#endif - - if (status == CPU_IRQSTATUS_NONE) { - m6800_set_irq_line(vector, 0); - } - - if (status == CPU_IRQSTATUS_ACK) { - m6800_set_irq_line(vector, 1); - } - - if (status == CPU_IRQSTATUS_AUTO) { - m6800_set_irq_line(vector, 1); - m6803_execute(0); - m6800_set_irq_line(vector, 0); - m6803_execute(0); - } -} - -void M6801SetIRQLine(INT32 vector, INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6801SetIRQLine called without init\n")); - if (nCpuType != CPU_TYPE_M6801) bprintf(PRINT_ERROR, _T("M6800SetIRQLine called with invalid CPU Type\n")); -#endif - - if (status == CPU_IRQSTATUS_NONE) { - m6800_set_irq_line(vector, 0); - } - - if (status == CPU_IRQSTATUS_ACK) { - m6800_set_irq_line(vector, 1); - } - - if (status == CPU_IRQSTATUS_AUTO) { - m6800_set_irq_line(vector, 1); - m6803_execute(0); - m6800_set_irq_line(vector, 0); - m6803_execute(0); - } -} - -void NSC8105SetIRQLine(INT32 vector, INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("NSC8105SetIRQLine called without init\n")); - if (nCpuType != CPU_TYPE_M6801) bprintf(PRINT_ERROR, _T("NSC8105SetIRQLine called with invalid CPU Type\n")); -#endif - - if (status == CPU_IRQSTATUS_NONE) { - m6800_set_irq_line(vector, 0); - } - - if (status == CPU_IRQSTATUS_ACK) { - m6800_set_irq_line(vector, 1); - } - - if (status == CPU_IRQSTATUS_AUTO) { - m6800_set_irq_line(vector, 1); - nsc8105_execute(0); - m6800_set_irq_line(vector, 0); - nsc8105_execute(0); - } -} - -INT32 M6800Run(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800Run called without init\n")); - if (nCpuType != CPU_TYPE_M6800) bprintf(PRINT_ERROR, _T("M6800Run called with invalid CPU Type\n")); -#endif - - cycles = m6800_execute(cycles); - - nM6800CyclesTotal += cycles; - - return cycles; -} - -INT32 HD63701Run(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("HD63701Run called without init\n")); - if (nCpuType != CPU_TYPE_HD63701) bprintf(PRINT_ERROR, _T("HD63701Run called with invalid CPU Type\n")); -#endif - - cycles = hd63701_execute(cycles); - - nM6800CyclesTotal += cycles; - - return cycles; -} - -INT32 M6803Run(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6803Run called without init\n")); - if (nCpuType != CPU_TYPE_M6803 && nCpuType != CPU_TYPE_M6801) bprintf(PRINT_ERROR, _T("M6803Run called with invalid CPU Type\n")); -#endif - - cycles = m6803_execute(cycles); - - nM6800CyclesTotal += cycles; - - return cycles; -} - -INT32 NSC8105Run(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("NSC8105Run called without init\n")); - if (nCpuType != CPU_TYPE_NSC8105) bprintf(PRINT_ERROR, _T("NSC8105Run called with invalid CPU Type\n")); -#endif - - cycles = nsc8105_execute(cycles); - - nM6800CyclesTotal += cycles; - - return cycles; -} - -void M6800RunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800RunEnd called without init\n")); -#endif -} - -UINT32 M6800GetPC(INT32) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800GetPC called without init\n")); -#endif - - return m6800_get_pc(); -} - -INT32 M6800MapMemory(UINT8* pMemory, UINT16 nStart, UINT16 nEnd, INT32 nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800MapMemory called without init\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = M6800CPUContext[0].pMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - if (nType & MAP_READ) { - pMemMap[0 + i] = pMemory + ((i - cStart) << 8); - } - if (nType & MAP_WRITE) { - pMemMap[0x100 + i] = pMemory + ((i - cStart) << 8); - } - if (nType & MAP_FETCH) { - pMemMap[0x200 + i] = pMemory + ((i - cStart) << 8); - } - } - return 0; - -} - -void M6800SetReadHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800SetReadHandler called without init\n")); -#endif - - M6800CPUContext[0].ReadByte = pHandler; -} - -void M6800SetWriteHandler(void (*pHandler)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800SetWriteHandler called without init\n")); -#endif - - M6800CPUContext[0].WriteByte = pHandler; -} - -void M6800SetReadOpHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800SetReadOpHandler called without init\n")); -#endif - - M6800CPUContext[0].ReadOp = pHandler; -} - -void M6800SetReadOpArgHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800SetReadOpArgHandler called without init\n")); -#endif - - M6800CPUContext[0].ReadOpArg = pHandler; -} - -void M6800SetReadPortHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800SetReadPortHandler called without init\n")); -#endif - - M6800CPUContext[0].ReadPort = pHandler; -} - -void M6800SetWritePortHandler(void (*pHandler)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800SetWritePortHandler called without init\n")); -#endif - - M6800CPUContext[0].WritePort = pHandler; -} - -UINT8 M6800ReadByte(UINT16 Address) -{ - // check mem map - UINT8 * pr = M6800CPUContext[0].pMemMap[0x000 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (M6800CPUContext[0].ReadByte != NULL) { - return M6800CPUContext[0].ReadByte(Address); - } - - return 0; -} - -void M6800WriteByte(UINT16 Address, UINT8 Data) -{ - // check mem map - UINT8 * pr = M6800CPUContext[0].pMemMap[0x100 | (Address >> 8)]; - if (pr != NULL) { - pr[Address & 0xff] = Data; - return; - } - - // check handler - if (M6800CPUContext[0].WriteByte != NULL) { - M6800CPUContext[0].WriteByte(Address, Data); - return; - } -} - -UINT8 M6800ReadOp(UINT16 Address) -{ - // check mem map - UINT8 * pr = M6800CPUContext[0].pMemMap[0x200 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (M6800CPUContext[0].ReadOp != NULL) { - return M6800CPUContext[0].ReadOp(Address); - } - - return 0; -} - -UINT8 M6800ReadOpArg(UINT16 Address) -{ - // check mem map - UINT8 * pr = M6800CPUContext[0].pMemMap[0x200 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (M6800CPUContext[0].ReadOpArg != NULL) { - return M6800CPUContext[0].ReadOpArg(Address); - } - - return 0; -} - -UINT8 M6800ReadPort(UINT16 Address) -{ - // check handler - if (M6800CPUContext[0].ReadPort != NULL) { - return M6800CPUContext[0].ReadPort(Address); - } - - return 0; -} - -void M6800WritePort(UINT16 Address, UINT8 Data) -{ - // check handler - if (M6800CPUContext[0].WritePort != NULL) { - M6800CPUContext[0].WritePort(Address, Data); - return; - } -} - -void M6800WriteRom(UINT32 Address, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800WriteRom called without init\n")); -#endif - - Address &= 0xffff; - - // check mem map - UINT8 * pr = M6800CPUContext[0].pMemMap[0x000 | (Address >> 8)]; - UINT8 * pw = M6800CPUContext[0].pMemMap[0x100 | (Address >> 8)]; - UINT8 * pf = M6800CPUContext[0].pMemMap[0x200 | (Address >> 8)]; - - if (pr != NULL) { - pr[Address & 0xff] = Data; - } - - if (pw != NULL) { - pw[Address & 0xff] = Data; - } - - if (pf != NULL) { - pf[Address & 0xff] = Data; - } - - // check handler - if (M6800CPUContext[0].WriteByte != NULL) { - M6800CPUContext[0].WriteByte(Address, Data); - return; - } -} - -INT32 M6800Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800Scan called without init\n")); -#endif - - if (nAction & ACB_DRIVER_DATA) { - for (INT32 i = 0; i <= nM6800Count; i++) { - m6800_Regs *R = &M6800CPUContext[i].reg; - - m6800_get_context((void *)&M6800CPUContext[i].reg); - void (* const * insn)(void) = R->insn; /* instruction table - save pointers */ - const UINT8 *cycles = R->cycles; /* clock cycle of instruction table */ - - SCAN_VAR(M6800CPUContext[i].reg); - - R->insn = insn; // restore pointers -dink - R->cycles = cycles; - - if (nAction & ACB_WRITE) { - m6800_set_context((void *)&M6800CPUContext[i].reg); - } - - SCAN_VAR(M6800CPUContext[i].nCyclesTotal); - SCAN_VAR(M6800CPUContext[i].nCyclesSegment); - SCAN_VAR(M6800CPUContext[i].nCyclesLeft); - SCAN_VAR(nM6800CyclesDone[i]); - } - - SCAN_VAR(nM6800CyclesTotal); - } - - return 0; -} diff --git a/jan/src/cpu/m6800_intf.h b/jan/src/cpu/m6800_intf.h deleted file mode 100644 index 64d76bd56..000000000 --- a/jan/src/cpu/m6800_intf.h +++ /dev/null @@ -1,173 +0,0 @@ -#include "m6800/m6800.h" - -typedef UINT8 (*pReadByteHandler)(UINT16 a); -typedef void (*pWriteByteHandler)(UINT16 a, UINT8 d); -typedef UINT8 (*pReadOpHandler)(UINT16 a); -typedef UINT8 (*pReadOpArgHandler)(UINT16 a); -typedef UINT8 (*pReadPortHandler)(UINT16 a); -typedef void (*pWritePortHandler)(UINT16 a, UINT8 d); - -struct M6800Ext { - - m6800_Regs reg; - - UINT8* pMemMap[0x100 * 3]; - - pReadByteHandler ReadByte; - pWriteByteHandler WriteByte; - pReadOpHandler ReadOp; - pReadOpArgHandler ReadOpArg; - pReadPortHandler ReadPort; - pWritePortHandler WritePort; - - INT32 nCyclesTotal; - INT32 nCyclesSegment; - INT32 nCyclesLeft; -}; - - - -#define HD63701_INPUT_LINE_NMI M6800_INPUT_LINE_NMI -#define HD63701_IRQ_LINE M6800_IRQ_LINE -#define HD63701_TIN_LINE M6800_TIN_LINE - -#define M6801_INPUT_LINE_NMI M6800_INPUT_LINE_NMI -#define M6801_IRQ_LINE M6800_IRQ_LINE -#define M6801_TIN_LINE M6800_TIN_LINE - -#define M6803_INPUT_LINE_NMI M6800_INPUT_LINE_NMI -#define M6803_IRQ_LINE M6800_IRQ_LINE -#define M6803_TIN_LINE M6800_TIN_LINE - -#define NSC8105_INPUT_LINE_NMI M6800_INPUT_LINE_NMI -#define NSC8105_IRQ_LINE M6800_IRQ_LINE -#define NSC8105_TIN_LINE M6800_TIN_LINE - -#define CPU_TYPE_M6800 1 -#define CPU_TYPE_HD63701 2 -#define CPU_TYPE_M6803 3 -#define CPU_TYPE_M6801 4 -#define CPU_TYPE_NSC8105 5 - -extern INT32 nM6800Count; - -extern INT32 nM6800CyclesTotal; - -void M6800Reset(); -#define HD63701Reset M6800Reset -#define M6803Reset M6800Reset -#define M6801Reset M6800Reset -#define NSC8105Reset M6800Reset - -void M6800NewFrame(); -#define HD63701NewFrame M6800NewFrame -#define M6803NewFrame M6800NewFrame -#define M6801NewFrame M6800NewFrame -#define NSC8105NewFrame M6800NewFrame - -INT32 M6800CoreInit(INT32 num, INT32 type); -INT32 M6800Init(INT32 num); -INT32 HD63701Init(INT32 num); -INT32 M6803Init(INT32 num); -INT32 M6801Init(INT32 num); -INT32 NSC8105Init(INT32 num); - -void M6800Exit(); -#define HD63701Exit M6800Exit -#define M6803Exit M6800Exit -#define M6801Exit M6800Exit -#define NSC8105Exit M6800Exit - -void M6800SetIRQLine(INT32 vector, INT32 status); -void HD63701SetIRQLine(INT32 vector, INT32 status); -void M6803SetIRQLine(INT32 vector, INT32 status); -void M6801SetIRQLine(INT32 vector, INT32 status); -void NSC8105SetIRQLine(INT32 vector, INT32 status); - -INT32 M6800Run(INT32 cycles); -INT32 HD63701Run(INT32 cycles); -INT32 M6803Run(INT32 cycles); -#define M6801Run(nCycles) M6803Run(nCycles) -INT32 NSC8105Run(INT32 cycles); - -void M6800RunEnd(); -#define HD63701RunEnd M6800RunEnd -#define M6803RunEnd M6800RunEnd -#define M6801RunEnd M6800RunEnd -#define NSC8105RunEnd M6800RunEnd - -UINT32 M6800GetPC(INT32); -#define HD63701GetPC M6800GetPC -#define M6803GetPC M6800GetPC -#define M6801GetPC M6800GetPC -#define NSC8105GetPC M6800GetPC - -INT32 M6800MapMemory(UINT8* pMemory, UINT16 nStart, UINT16 nEnd, INT32 nType); -#define HD63701MapMemory M6800MapMemory -#define M6803MapMemory M6800MapMemory -#define M6801MapMemory M6800MapMemory -#define NSC8105MapMemory M6800MapMemory - -void M6800SetReadHandler(UINT8 (*pHandler)(UINT16)); -#define HD63701SetReadHandler M6800SetReadHandler -#define M6803SetReadHandler M6800SetReadHandler -#define M6801SetReadHandler M6800SetReadHandler -#define NSC8105SetReadHandler M6800SetReadHandler - -void M6800SetWriteHandler(void (*pHandler)(UINT16, UINT8)); -#define HD63701SetWriteHandler M6800SetWriteHandler -#define M6803SetWriteHandler M6800SetWriteHandler -#define M6801SetWriteHandler M6800SetWriteHandler -#define NSC8105SetWriteHandler M6800SetWriteHandler - -void M6800SetReadOpHandler(UINT8 (*pHandler)(UINT16)); -#define HD63701SetReadOpHandler M6800SetReadOpHandler -#define M6803SetReadOpHandler M6800SetReadOpHandler -#define M6801SetReadOpHandler M6800SetReadOpHandler -#define NSC8105SetReadOpHandler M6800SetReadOpHandler - -void M6800SetReadOpArgHandler(UINT8 (*pHandler)(UINT16)); -#define HD63701SetReadOpArgHandler M6800SetReadOpArgHandler -#define M6803SetReadOpArgHandler M6800SetReadOpArgHandler -#define M6801SetReadOpArgHandler M6800SetReadOpArgHandler -#define NSC8105SetReadOpArgHandler M6800SetReadOpArgHandler - -void M6800SetReadPortHandler(UINT8 (*pHandler)(UINT16)); -#define HD63701SetReadPortHandler M6800SetReadPortHandler -#define M6803SetReadPortHandler M6800SetReadPortHandler -#define M6801SetReadPortHandler M6800SetReadPortHandler -#define NSC8105SetReadPortHandler M6800SetReadPortHandler - -void M6800SetWritePortHandler(void (*pHandler)(UINT16, UINT8)); -#define HD63701SetWritePortHandler M6800SetWritePortHandler -#define M6803SetWritePortHandler M6800SetWritePortHandler -#define M6801SetWritePortHandler M6800SetWritePortHandler -#define NSC8105SetWritePortHandler M6800SetWritePortHandler - -INT32 M6800Scan(INT32 nAction); -#define HD63701Scan M6800Scan -#define M6803Scan M6800Scan -#define M6801Scan M6800Scan -#define NSC8105Scan M6800Scan - -void M6800WriteRom(UINT32 Address, UINT8 Data); - -inline static INT32 M6800TotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800TotalCycles called without init\n")); -#endif - - return nM6800CyclesTotal; -} - -inline static INT32 M6800Idle(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6800Initted) bprintf(PRINT_ERROR, _T("M6800Idle called without init\n")); -#endif - - nM6800CyclesTotal += cycles; - - return cycles; -} diff --git a/jan/src/cpu/m6805/6805ops.c b/jan/src/cpu/m6805/6805ops.c deleted file mode 100644 index 76028566a..000000000 --- a/jan/src/cpu/m6805/6805ops.c +++ /dev/null @@ -1,1822 +0,0 @@ - -/* - -HNZC - -? = undefined -* = affected -- = unaffected -0 = cleared -1 = set -# = ccr directly affected by instruction -@ = special - carry set if bit 7 is set - -*/ - -static void illegal( void ) -{ -// logerror("M6805: illegal opcode\n"); -} - -/* $00/$02/$04/$06/$08/$0A/$0C/$0E BRSET direct,relative ---- */ -M6805_INLINE void brset (UINT8 bit) -{ - UINT8 t,r; - DIRBYTE(r); - IMMBYTE(t); - - CLC; - - if (r&bit) { - SEC; - PC+=SIGNED(t); - - if (t==0xfd) - { - /* speed up busy loops */ - if(m6805_ICount > 0) - m6805_ICount = 0; - } - } -} - -/* $01/$03/$05/$07/$09/$0B/$0D/$0F BRCLR direct,relative ---- */ -M6805_INLINE void brclr (UINT8 bit) -{ - UINT8 t,r; - DIRBYTE(r); - IMMBYTE(t); - - SEC; - - if (!(r&bit)) { - CLC; - PC+=SIGNED(t); - - if (t==0xfd) - { - /* speed up busy loops */ - if(m6805_ICount > 0) - m6805_ICount = 0; - } - } -} - -/* $10/$12/$14/$16/$18/$1A/$1C/$1E BSET direct ---- */ -M6805_INLINE void bset (UINT8 bit) -{ - UINT8 t,r; - DIRBYTE(t); r=t|bit; - WM(EAD,r); -} - -/* $11/$13/$15/$17/$19/$1B/$1D/$1F BCLR direct ---- */ -M6805_INLINE void bclr (UINT8 bit) -{ - UINT8 t,r; - DIRBYTE(t); r=t&(~bit); - WM(EAD,r); -} - -/* $20 BRA relative ---- */ -M6805_INLINE void bra( void ) -{ - UINT8 t; - IMMBYTE(t);PC+=SIGNED(t); - if (t==0xfe) - { - /* speed up busy loops */ - if(m6805_ICount > 0) - m6805_ICount = 0; - } -} - -/* $21 BRN relative ---- */ -M6805_INLINE void brn( void ) -{ - UINT8 t; - IMMBYTE(t); -} - -/* $22 BHI relative ---- */ -M6805_INLINE void bhi( void ) -{ - BRANCH( !(CC&(CFLAG|ZFLAG)) ); -} - -/* $23 BLS relative ---- */ -M6805_INLINE void bls( void ) -{ - BRANCH( CC&(CFLAG|ZFLAG) ); -} - -/* $24 BCC relative ---- */ -M6805_INLINE void bcc( void ) -{ - BRANCH( !(CC&CFLAG) ); -} - -/* $25 BCS relative ---- */ -M6805_INLINE void bcs( void ) -{ - BRANCH( CC&CFLAG ); -} - -/* $26 BNE relative ---- */ -M6805_INLINE void bne( void ) -{ - BRANCH( !(CC&ZFLAG) ); -} - -/* $27 BEQ relative ---- */ -M6805_INLINE void beq( void ) -{ - BRANCH( CC&ZFLAG ); -} - -/* $28 BHCC relative ---- */ -M6805_INLINE void bhcc( void ) -{ - BRANCH( !(CC&HFLAG) ); -} - -/* $29 BHCS relative ---- */ -M6805_INLINE void bhcs( void ) -{ - BRANCH( CC&HFLAG ); -} - -/* $2a BPL relative ---- */ -M6805_INLINE void bpl( void ) -{ - BRANCH( !(CC&NFLAG) ); -} - -/* $2b BMI relative ---- */ -M6805_INLINE void bmi( void ) -{ - BRANCH( CC&NFLAG ); -} - -/* $2c BMC relative ---- */ -M6805_INLINE void bmc( void ) -{ - BRANCH( !(CC&IFLAG) ); -} - -/* $2d BMS relative ---- */ -M6805_INLINE void bms( void ) -{ - BRANCH( CC&IFLAG ); -} - -/* $2e BIL relative ---- */ -M6805_INLINE void bil( void ) -{ - if(SUBTYPE==SUBTYPE_HD63705) - { - BRANCH( m6805.nmi_state!=CLEAR_LINE ); - } - else - { - BRANCH( m6805.irq_state[0]!=CLEAR_LINE ); - } -} - -/* $2f BIH relative ---- */ -M6805_INLINE void bih( void ) -{ - if(SUBTYPE==SUBTYPE_HD63705) - { - BRANCH( m6805.nmi_state==CLEAR_LINE ); - } - else - { - BRANCH( m6805.irq_state[0]==CLEAR_LINE ); - } -} - -/* $30 NEG direct -*** */ -M6805_INLINE void neg_di( void ) -{ - UINT8 t; - UINT16 r; - DIRBYTE(t); r=-t; - CLR_NZC; SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $31 ILLEGAL */ - -/* $32 ILLEGAL */ - -/* $33 COM direct -**1 */ -M6805_INLINE void com_di( void ) -{ - UINT8 t; - DIRBYTE(t); t = ~t; - CLR_NZ; SET_NZ8(t); SEC; - WM(EAD,t); -} - -/* $34 LSR direct -0** */ -M6805_INLINE void lsr_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZC; - CC |= (t&0x01); - t >>= 1; - SET_Z8(t); - WM(EAD,t); -} - -/* $35 ILLEGAL */ - -/* $36 ROR direct -*** */ -M6805_INLINE void ror_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r = (CC & 0x01) << 7; - CLR_NZC; - CC |= (t & 0x01); - r |= t>>1; - SET_NZ8(r); - WM(EAD,r); -} - -/* $37 ASR direct ?*** */ -M6805_INLINE void asr_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZC; CC|=(t&0x01); - t>>=1; t|=((t&0x40)<<1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $38 LSL direct ?*** */ -M6805_INLINE void lsl_di( void ) -{ - UINT8 t; - UINT16 r; - DIRBYTE(t); - r = t << 1; - CLR_NZC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $39 ROL direct -*** */ -M6805_INLINE void rol_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = CC & 0x01; - r |= t << 1; - CLR_NZC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $3a DEC direct -**- */ -M6805_INLINE void dec_di( void ) -{ - UINT8 t; - DIRBYTE(t); - --t; - CLR_NZ; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $3b ILLEGAL */ - -/* $3c INC direct -**- */ -M6805_INLINE void inc_di( void ) -{ - UINT8 t; - DIRBYTE(t); - ++t; - CLR_NZ; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $3d TST direct -**- */ -M6805_INLINE void tst_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZ; SET_NZ8(t); -} - -/* $3e ILLEGAL */ - -/* $3f CLR direct -0100 */ -M6805_INLINE void clr_di( void ) -{ - DIRECT; - CLR_NZC; SEZ; - WM(EAD,0); -} - -/* $40 NEGA inherent ?*** */ -M6805_INLINE void nega( void ) -{ - UINT16 r; - r = -A; - CLR_NZC; SET_FLAGS8(0,A,r); - A = r; -} - -/* $41 ILLEGAL */ - -/* $42 ILLEGAL */ - -/* $43 COMA inherent -**1 */ -M6805_INLINE void coma( void ) -{ - A = ~A; - CLR_NZ; - SET_NZ8(A); - SEC; -} - -/* $44 LSRA inherent -0** */ -M6805_INLINE void lsra( void ) -{ - CLR_NZC; - CC |= (A & 0x01); - A >>= 1; - SET_Z8(A); -} - -/* $45 ILLEGAL */ - -/* $46 RORA inherent -*** */ -M6805_INLINE void rora( void ) -{ - UINT8 r; - r = (CC & 0x01) << 7; - CLR_NZC; - CC |= (A & 0x01); - r |= A >> 1; - SET_NZ8(r); - A = r; -} - -/* $47 ASRA inherent ?*** */ -M6805_INLINE void asra( void ) -{ - CLR_NZC; - CC |= (A & 0x01); - A = (A & 0x80) | (A >> 1); - SET_NZ8(A); -} - -/* $48 LSLA inherent ?*** */ -M6805_INLINE void lsla( void ) -{ - UINT16 r; - r = A << 1; - CLR_NZC; - SET_FLAGS8(A,A,r); - A = r; -} - -/* $49 ROLA inherent -*** */ -M6805_INLINE void rola( void ) -{ - UINT16 t,r; - t = A; - r = CC & 0x01; - r |= t << 1; - CLR_NZC; - SET_FLAGS8(t,t,r); - A = r; -} - -/* $4a DECA inherent -**- */ -M6805_INLINE void deca( void ) -{ - --A; - CLR_NZ; - SET_FLAGS8D(A); -} - -/* $4b ILLEGAL */ - -/* $4c INCA inherent -**- */ -M6805_INLINE void inca( void ) -{ - ++A; - CLR_NZ; - SET_FLAGS8I(A); -} - -/* $4d TSTA inherent -**- */ -M6805_INLINE void tsta( void ) -{ - CLR_NZ; - SET_NZ8(A); -} - -/* $4e ILLEGAL */ - -/* $4f CLRA inherent -010 */ -M6805_INLINE void clra( void ) -{ - A = 0; - CLR_NZ; - SEZ; -} - -/* $50 NEGX inherent ?*** */ -M6805_INLINE void negx( void ) -{ - UINT16 r; - r = -X; - CLR_NZC; - SET_FLAGS8(0,X,r); - X = r; -} - -/* $51 ILLEGAL */ - -/* $52 ILLEGAL */ - -/* $53 COMX inherent -**1 */ -M6805_INLINE void comx( void ) -{ - X = ~X; - CLR_NZ; - SET_NZ8(X); - SEC; -} - -/* $54 LSRX inherent -0** */ -M6805_INLINE void lsrx( void ) -{ - CLR_NZC; - CC |= (X & 0x01); - X >>= 1; - SET_Z8(X); -} - -/* $55 ILLEGAL */ - -/* $56 RORX inherent -*** */ -M6805_INLINE void rorx( void ) -{ - UINT8 r; - r = (CC & 0x01) << 7; - CLR_NZC; - CC |= (X & 0x01); - r |= X>>1; - SET_NZ8(r); - X = r; -} - -/* $57 ASRX inherent ?*** */ -M6805_INLINE void asrx( void ) -{ - CLR_NZC; - CC |= (X & 0x01); - X = (X & 0x80) | (X >> 1); - SET_NZ8(X); -} - -/* $58 ASLX inherent ?*** */ -M6805_INLINE void aslx( void ) -{ - UINT16 r; - r = X << 1; - CLR_NZC; - SET_FLAGS8(X,X,r); - X = r; -} - -/* $59 ROLX inherent -*** */ -M6805_INLINE void rolx( void ) -{ - UINT16 t,r; - t = X; - r = CC & 0x01; - r |= t<<1; - CLR_NZC; - SET_FLAGS8(t,t,r); - X = r; -} - -/* $5a DECX inherent -**- */ -M6805_INLINE void decx( void ) -{ - --X; - CLR_NZ; - SET_FLAGS8D(X); -} - -/* $5b ILLEGAL */ - -/* $5c INCX inherent -**- */ -M6805_INLINE void incx( void ) -{ - ++X; - CLR_NZ; - SET_FLAGS8I(X); -} - -/* $5d TSTX inherent -**- */ -M6805_INLINE void tstx( void ) -{ - CLR_NZ; - SET_NZ8(X); -} - -/* $5e ILLEGAL */ - -/* $5f CLRX inherent -010 */ -M6805_INLINE void clrx( void ) -{ - X = 0; - CLR_NZC; - SEZ; -} - -/* $60 NEG indexed, 1 byte offset -*** */ -M6805_INLINE void neg_ix1( void ) -{ - UINT8 t; - UINT16 r; - IDX1BYTE(t); r=-t; - CLR_NZC; SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $61 ILLEGAL */ - -/* $62 ILLEGAL */ - -/* $63 COM indexed, 1 byte offset -**1 */ -M6805_INLINE void com_ix1( void ) -{ - UINT8 t; - IDX1BYTE(t); t = ~t; - CLR_NZ; SET_NZ8(t); SEC; - WM(EAD,t); -} - -/* $64 LSR indexed, 1 byte offset -0** */ -M6805_INLINE void lsr_ix1( void ) -{ - UINT8 t; - IDX1BYTE(t); - CLR_NZC; - CC |= (t & 0x01); - t >>= 1; - SET_Z8(t); - WM(EAD,t); -} - -/* $65 ILLEGAL */ - -/* $66 ROR indexed, 1 byte offset -*** */ -M6805_INLINE void ror_ix1( void ) -{ - UINT8 t,r; - IDX1BYTE(t); - r = (CC & 0x01) << 7; - CLR_NZC; - CC |= (t & 0x01); - r |= t>>1; - SET_NZ8(r); - WM(EAD,r); -} - -/* $67 ASR indexed, 1 byte offset ?*** */ -M6805_INLINE void asr_ix1( void ) -{ - UINT8 t; - IDX1BYTE(t); - CLR_NZC; CC|=(t&0x01); - t>>=1; t|=((t&0x40)<<1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $68 LSL indexed, 1 byte offset ?*** */ -M6805_INLINE void lsl_ix1( void ) -{ - UINT8 t; - UINT16 r; - IDX1BYTE(t); - r = t << 1; - CLR_NZC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $69 ROL indexed, 1 byte offset -*** */ -M6805_INLINE void rol_ix1( void ) -{ - UINT16 t,r; - IDX1BYTE(t); - r = CC & 0x01; - r |= t << 1; - CLR_NZC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $6a DEC indexed, 1 byte offset -**- */ -M6805_INLINE void dec_ix1( void ) -{ - UINT8 t; - IDX1BYTE(t); - --t; - CLR_NZ; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $6b ILLEGAL */ - -/* $6c INC indexed, 1 byte offset -**- */ -M6805_INLINE void inc_ix1( void ) -{ - UINT8 t; - IDX1BYTE(t); - ++t; - CLR_NZ; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $6d TST indexed, 1 byte offset -**- */ -M6805_INLINE void tst_ix1( void ) -{ - UINT8 t; - IDX1BYTE(t); - CLR_NZ; SET_NZ8(t); -} - -/* $6e ILLEGAL */ - -/* $6f CLR indexed, 1 byte offset -0100 */ -M6805_INLINE void clr_ix1( void ) -{ - INDEXED1; - CLR_NZC; SEZ; - WM(EAD,0); -} - -/* $70 NEG indexed -*** */ -M6805_INLINE void neg_ix( void ) -{ - UINT8 t; - UINT16 r; - IDXBYTE(t); r=-t; - CLR_NZC; SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $71 ILLEGAL */ - -/* $72 ILLEGAL */ - -/* $73 COM indexed -**1 */ -M6805_INLINE void com_ix( void ) -{ - UINT8 t; - IDXBYTE(t); t = ~t; - CLR_NZ; SET_NZ8(t); SEC; - WM(EAD,t); -} - -/* $74 LSR indexed -0** */ -M6805_INLINE void lsr_ix( void ) -{ - UINT8 t; - IDXBYTE(t); - CLR_NZC; - CC |= (t & 0x01); - t >>= 1; - SET_Z8(t); - WM(EAD,t); -} - -/* $75 ILLEGAL */ - -/* $76 ROR indexed -*** */ -M6805_INLINE void ror_ix( void ) -{ - UINT8 t,r; - IDXBYTE(t); - r = (CC & 0x01) << 7; - CLR_NZC; - CC |= (t & 0x01); - r |= t >> 1; - SET_NZ8(r); - WM(EAD,r); -} - -/* $77 ASR indexed ?*** */ -M6805_INLINE void asr_ix( void ) -{ - UINT8 t; - IDXBYTE(t); - CLR_NZC; - CC |= (t & 0x01); - t = (t & 0x80) | (t >> 1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $78 LSL indexed ?*** */ -M6805_INLINE void lsl_ix( void ) -{ - UINT8 t; - UINT16 r; - IDXBYTE(t); r=t<<1; - CLR_NZC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $79 ROL indexed -*** */ -M6805_INLINE void rol_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); - r = CC & 0x01; - r |= t << 1; - CLR_NZC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $7a DEC indexed -**- */ -M6805_INLINE void dec_ix( void ) -{ - UINT8 t; - IDXBYTE(t); - --t; - CLR_NZ; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $7b ILLEGAL */ - -/* $7c INC indexed -**- */ -M6805_INLINE void inc_ix( void ) -{ - UINT8 t; - IDXBYTE(t); - ++t; - CLR_NZ; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $7d TST indexed -**- */ -M6805_INLINE void tst_ix( void ) -{ - UINT8 t; - IDXBYTE(t); - CLR_NZ; SET_NZ8(t); -} - -/* $7e ILLEGAL */ - -/* $7f CLR indexed -0100 */ -M6805_INLINE void clr_ix( void ) -{ - INDEXED; - CLR_NZC; SEZ; - WM(EAD,0); -} - -/* $80 RTI inherent #### */ -M6805_INLINE void rti( void ) -{ - PULLBYTE(CC); - PULLBYTE(A); - PULLBYTE(X); - PULLWORD(pPC); - change_pc(PC); -#if IRQ_LEVEL_DETECT - if( m6805.irq_state != CLEAR_LINE && (CC & IFLAG) == 0 ) - m6805.pending_interrupts |= M6805_INT_IRQ; -#endif -} - -/* $81 RTS inherent ---- */ -M6805_INLINE void rts( void ) -{ - PULLWORD(pPC); - change_pc(PC); -} - -/* $82 ILLEGAL */ - -/* $83 SWI absolute indirect ---- */ -M6805_INLINE void swi( void ) -{ - PUSHWORD(m6805.pc); - PUSHBYTE(m6805.x); - PUSHBYTE(m6805.a); - PUSHBYTE(m6805.cc); - SEI; - if(SUBTYPE==SUBTYPE_HD63705) RM16( 0x1ffa, &pPC ); else RM16( 0xfffc, &pPC ); - change_pc(PC); -} - -/* $84 ILLEGAL */ - -/* $85 ILLEGAL */ - -/* $86 ILLEGAL */ - -/* $87 ILLEGAL */ - -/* $88 ILLEGAL */ - -/* $89 ILLEGAL */ - -/* $8A ILLEGAL */ - -/* $8B ILLEGAL */ - -/* $8C ILLEGAL */ - -/* $8D ILLEGAL */ - -/* $8E ILLEGAL */ - -/* $8F ILLEGAL */ - -/* $90 ILLEGAL */ - -/* $91 ILLEGAL */ - -/* $92 ILLEGAL */ - -/* $93 ILLEGAL */ - -/* $94 ILLEGAL */ - -/* $95 ILLEGAL */ - -/* $96 ILLEGAL */ - -/* $97 TAX inherent ---- */ -M6805_INLINE void tax (void) -{ - X = A; -} - -/* $98 CLC */ - -/* $99 SEC */ - -/* $9A CLI */ - -/* $9B SEI */ - -/* $9C RSP inherent ---- */ -M6805_INLINE void rsp (void) -{ - S = SP_MASK; -} - -/* $9D NOP inherent ---- */ -M6805_INLINE void nop (void) -{ -} - -/* $9E ILLEGAL */ - -/* $9F TXA inherent ---- */ -M6805_INLINE void txa (void) -{ - A = X; -} - -/* $a0 SUBA immediate ?*** */ -M6805_INLINE void suba_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $a1 CMPA immediate ?*** */ -M6805_INLINE void cmpa_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); -} - -/* $a2 SBCA immediate ?*** */ -M6805_INLINE void sbca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t - (CC & 0x01); - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $a3 CPX immediate -*** */ -M6805_INLINE void cpx_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = X - t; - CLR_NZC; - SET_FLAGS8(X,t,r); -} - -/* $a4 ANDA immediate -**- */ -M6805_INLINE void anda_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A &= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $a5 BITA immediate -**- */ -M6805_INLINE void bita_im( void ) -{ - UINT8 t,r; - IMMBYTE(t); - r = A & t; - CLR_NZ; - SET_NZ8(r); -} - -/* $a6 LDA immediate -**- */ -M6805_INLINE void lda_im( void ) -{ - IMMBYTE(A); - CLR_NZ; - SET_NZ8(A); -} - -/* $a7 ILLEGAL */ - -/* $a8 EORA immediate -**- */ -M6805_INLINE void eora_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A ^= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $a9 ADCA immediate **** */ -M6805_INLINE void adca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A + t + (CC & 0x01); - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $aa ORA immediate -**- */ -M6805_INLINE void ora_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A |= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $ab ADDA immediate **** */ -M6805_INLINE void adda_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A + t; - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $ac ILLEGAL */ - -/* $ad BSR ---- */ -M6805_INLINE void bsr( void ) -{ - UINT8 t; - IMMBYTE(t); - PUSHWORD(m6805.pc); - PC += SIGNED(t); -} - -/* $ae LDX immediate -**- */ -M6805_INLINE void ldx_im( void ) -{ - IMMBYTE(X); - CLR_NZ; - SET_NZ8(X); -} - -/* $af ILLEGAL */ - -/* $b0 SUBA direct ?*** */ -M6805_INLINE void suba_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $b1 CMPA direct ?*** */ -M6805_INLINE void cmpa_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); -} - -/* $b2 SBCA direct ?*** */ -M6805_INLINE void sbca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t - (CC & 0x01); - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $b3 CPX direct -*** */ -M6805_INLINE void cpx_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = X - t; - CLR_NZC; - SET_FLAGS8(X,t,r); -} - -/* $b4 ANDA direct -**- */ -M6805_INLINE void anda_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A &= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $b5 BITA direct -**- */ -M6805_INLINE void bita_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r = A & t; - CLR_NZ; - SET_NZ8(r); -} - -/* $b6 LDA direct -**- */ -M6805_INLINE void lda_di( void ) -{ - DIRBYTE(A); - CLR_NZ; - SET_NZ8(A); -} - -/* $b7 STA direct -**- */ -M6805_INLINE void sta_di( void ) -{ - CLR_NZ; - SET_NZ8(A); - DIRECT; - WM(EAD,A); -} - -/* $b8 EORA direct -**- */ -M6805_INLINE void eora_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A ^= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $b9 ADCA direct **** */ -M6805_INLINE void adca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A + t + (CC & 0x01); - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $ba ORA direct -**- */ -M6805_INLINE void ora_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A |= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $bb ADDA direct **** */ -M6805_INLINE void adda_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A + t; - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $bc JMP direct -*** */ -M6805_INLINE void jmp_di( void ) -{ - DIRECT; - PC = EA; - change_pc(PC); -} - -/* $bd JSR direct ---- */ -M6805_INLINE void jsr_di( void ) -{ - DIRECT; - PUSHWORD(m6805.pc); - PC = EA; - change_pc(PC); -} - -/* $be LDX direct -**- */ -M6805_INLINE void ldx_di( void ) -{ - DIRBYTE(X); - CLR_NZ; - SET_NZ8(X); -} - -/* $bf STX direct -**- */ -M6805_INLINE void stx_di( void ) -{ - CLR_NZ; - SET_NZ8(X); - DIRECT; - WM(EAD,X); -} - -/* $c0 SUBA extended ?*** */ -M6805_INLINE void suba_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $c1 CMPA extended ?*** */ -M6805_INLINE void cmpa_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); -} - -/* $c2 SBCA extended ?*** */ -M6805_INLINE void sbca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t - (CC & 0x01); - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $c3 CPX extended -*** */ -M6805_INLINE void cpx_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = X - t; - CLR_NZC; - SET_FLAGS8(X,t,r); -} - -/* $c4 ANDA extended -**- */ -M6805_INLINE void anda_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A &= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $c5 BITA extended -**- */ -M6805_INLINE void bita_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); - r = A & t; - CLR_NZ; - SET_NZ8(r); -} - -/* $c6 LDA extended -**- */ -M6805_INLINE void lda_ex( void ) -{ - EXTBYTE(A); - CLR_NZ; - SET_NZ8(A); -} - -/* $c7 STA extended -**- */ -M6805_INLINE void sta_ex( void ) -{ - CLR_NZ; - SET_NZ8(A); - EXTENDED; - WM(EAD,A); -} - -/* $c8 EORA extended -**- */ -M6805_INLINE void eora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A ^= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $c9 ADCA extended **** */ -M6805_INLINE void adca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A + t + (CC & 0x01); - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $ca ORA extended -**- */ -M6805_INLINE void ora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A |= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $cb ADDA extended **** */ -M6805_INLINE void adda_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A + t; - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $cc JMP extended -*** */ -M6805_INLINE void jmp_ex( void ) -{ - EXTENDED; - PC = EA; - change_pc(PC); -} - -/* $cd JSR extended ---- */ -M6805_INLINE void jsr_ex( void ) -{ - EXTENDED; - PUSHWORD(m6805.pc); - PC = EA; - change_pc(PC); -} - -/* $ce LDX extended -**- */ -M6805_INLINE void ldx_ex( void ) -{ - EXTBYTE(X); - CLR_NZ; - SET_NZ8(X); -} - -/* $cf STX extended -**- */ -M6805_INLINE void stx_ex( void ) -{ - CLR_NZ; - SET_NZ8(X); - EXTENDED; - WM(EAD,X); -} - -/* $d0 SUBA indexed, 2 byte offset ?*** */ -M6805_INLINE void suba_ix2( void ) -{ - UINT16 t,r; - IDX2BYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $d1 CMPA indexed, 2 byte offset ?*** */ -M6805_INLINE void cmpa_ix2( void ) -{ - UINT16 t,r; - IDX2BYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); -} - -/* $d2 SBCA indexed, 2 byte offset ?*** */ -M6805_INLINE void sbca_ix2( void ) -{ - UINT16 t,r; - IDX2BYTE(t); - r = A - t - (CC & 0x01); - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $d3 CPX indexed, 2 byte offset -*** */ -M6805_INLINE void cpx_ix2( void ) -{ - UINT16 t,r; - IDX2BYTE(t); - r = X - t; - CLR_NZC; - SET_FLAGS8(X,t,r); -} - -/* $d4 ANDA indexed, 2 byte offset -**- */ -M6805_INLINE void anda_ix2( void ) -{ - UINT8 t; - IDX2BYTE(t); - A &= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $d5 BITA indexed, 2 byte offset -**- */ -M6805_INLINE void bita_ix2( void ) -{ - UINT8 t,r; - IDX2BYTE(t); - r = A & t; - CLR_NZ; - SET_NZ8(r); -} - -/* $d6 LDA indexed, 2 byte offset -**- */ -M6805_INLINE void lda_ix2( void ) -{ - IDX2BYTE(A); - CLR_NZ; - SET_NZ8(A); -} - -/* $d7 STA indexed, 2 byte offset -**- */ -M6805_INLINE void sta_ix2( void ) -{ - CLR_NZ; - SET_NZ8(A); - INDEXED2; - WM(EAD,A); -} - -/* $d8 EORA indexed, 2 byte offset -**- */ -M6805_INLINE void eora_ix2( void ) -{ - UINT8 t; - IDX2BYTE(t); - A ^= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $d9 ADCA indexed, 2 byte offset **** */ -M6805_INLINE void adca_ix2( void ) -{ - UINT16 t,r; - IDX2BYTE(t); - r = A + t + (CC & 0x01); - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $da ORA indexed, 2 byte offset -**- */ -M6805_INLINE void ora_ix2( void ) -{ - UINT8 t; - IDX2BYTE(t); - A |= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $db ADDA indexed, 2 byte offset **** */ -M6805_INLINE void adda_ix2( void ) -{ - UINT16 t,r; - IDX2BYTE(t); - r = A + t; - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $dc JMP indexed, 2 byte offset -*** */ -M6805_INLINE void jmp_ix2( void ) -{ - INDEXED2; - PC = EA; - change_pc(PC); -} - -/* $dd JSR indexed, 2 byte offset ---- */ -M6805_INLINE void jsr_ix2( void ) -{ - INDEXED2; - PUSHWORD(m6805.pc); - PC = EA; - change_pc(PC); -} - -/* $de LDX indexed, 2 byte offset -**- */ -M6805_INLINE void ldx_ix2( void ) -{ - IDX2BYTE(X); - CLR_NZ; - SET_NZ8(X); -} - -/* $df STX indexed, 2 byte offset -**- */ -M6805_INLINE void stx_ix2( void ) -{ - CLR_NZ; - SET_NZ8(X); - INDEXED2; - WM(EAD,X); -} - -/* $e0 SUBA indexed, 1 byte offset ?*** */ -M6805_INLINE void suba_ix1( void ) -{ - UINT16 t,r; - IDX1BYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $e1 CMPA indexed, 1 byte offset ?*** */ -M6805_INLINE void cmpa_ix1( void ) -{ - UINT16 t,r; - IDX1BYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); -} - -/* $e2 SBCA indexed, 1 byte offset ?*** */ -M6805_INLINE void sbca_ix1( void ) -{ - UINT16 t,r; - IDX1BYTE(t); - r = A - t - (CC & 0x01); - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $e3 CPX indexed, 1 byte offset -*** */ -M6805_INLINE void cpx_ix1( void ) -{ - UINT16 t,r; - IDX1BYTE(t); - r = X - t; - CLR_NZC; - SET_FLAGS8(X,t,r); -} - -/* $e4 ANDA indexed, 1 byte offset -**- */ -M6805_INLINE void anda_ix1( void ) -{ - UINT8 t; - IDX1BYTE(t); - A &= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $e5 BITA indexed, 1 byte offset -**- */ -M6805_INLINE void bita_ix1( void ) -{ - UINT8 t,r; - IDX1BYTE(t); - r = A & t; - CLR_NZ; - SET_NZ8(r); -} - -/* $e6 LDA indexed, 1 byte offset -**- */ -M6805_INLINE void lda_ix1( void ) -{ - IDX1BYTE(A); - CLR_NZ; - SET_NZ8(A); -} - -/* $e7 STA indexed, 1 byte offset -**- */ -M6805_INLINE void sta_ix1( void ) -{ - CLR_NZ; - SET_NZ8(A); - INDEXED1; - WM(EAD,A); -} - -/* $e8 EORA indexed, 1 byte offset -**- */ -M6805_INLINE void eora_ix1( void ) -{ - UINT8 t; - IDX1BYTE(t); - A ^= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $e9 ADCA indexed, 1 byte offset **** */ -M6805_INLINE void adca_ix1( void ) -{ - UINT16 t,r; - IDX1BYTE(t); - r = A + t + (CC & 0x01); - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $ea ORA indexed, 1 byte offset -**- */ -M6805_INLINE void ora_ix1( void ) -{ - UINT8 t; - IDX1BYTE(t); - A |= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $eb ADDA indexed, 1 byte offset **** */ -M6805_INLINE void adda_ix1( void ) -{ - UINT16 t,r; - IDX1BYTE(t); - r = A + t; - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $ec JMP indexed, 1 byte offset -*** */ -M6805_INLINE void jmp_ix1( void ) -{ - INDEXED1; - PC = EA; - change_pc(PC); -} - -/* $ed JSR indexed, 1 byte offset ---- */ -M6805_INLINE void jsr_ix1( void ) -{ - INDEXED1; - PUSHWORD(m6805.pc); - PC = EA; - change_pc(PC); -} - -/* $ee LDX indexed, 1 byte offset -**- */ -M6805_INLINE void ldx_ix1( void ) -{ - IDX1BYTE(X); - CLR_NZ; - SET_NZ8(X); -} - -/* $ef STX indexed, 1 byte offset -**- */ -M6805_INLINE void stx_ix1( void ) -{ - CLR_NZ; - SET_NZ8(X); - INDEXED1; - WM(EAD,X); -} - -/* $f0 SUBA indexed ?*** */ -M6805_INLINE void suba_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $f1 CMPA indexed ?*** */ -M6805_INLINE void cmpa_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); - r = A - t; - CLR_NZC; - SET_FLAGS8(A,t,r); -} - -/* $f2 SBCA indexed ?*** */ -M6805_INLINE void sbca_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); - r = A - t - (CC & 0x01); - CLR_NZC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $f3 CPX indexed -*** */ -M6805_INLINE void cpx_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); - r = X - t; - CLR_NZC; - SET_FLAGS8(X,t,r); -} - -/* $f4 ANDA indexed -**- */ -M6805_INLINE void anda_ix( void ) -{ - UINT8 t; - IDXBYTE(t); - A &= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $f5 BITA indexed -**- */ -M6805_INLINE void bita_ix( void ) -{ - UINT8 t,r; - IDXBYTE(t); - r = A & t; - CLR_NZ; - SET_NZ8(r); -} - -/* $f6 LDA indexed -**- */ -M6805_INLINE void lda_ix( void ) -{ - IDXBYTE(A); - CLR_NZ; - SET_NZ8(A); -} - -/* $f7 STA indexed -**- */ -M6805_INLINE void sta_ix( void ) -{ - CLR_NZ; - SET_NZ8(A); - INDEXED; - WM(EAD,A); -} - -/* $f8 EORA indexed -**- */ -M6805_INLINE void eora_ix( void ) -{ - UINT8 t; - IDXBYTE(t); - A ^= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $f9 ADCA indexed **** */ -M6805_INLINE void adca_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); - r = A + t + (CC & 0x01); - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $fa ORA indexed -**- */ -M6805_INLINE void ora_ix( void ) -{ - UINT8 t; - IDXBYTE(t); - A |= t; - CLR_NZ; - SET_NZ8(A); -} - -/* $fb ADDA indexed **** */ -M6805_INLINE void adda_ix( void ) -{ - UINT16 t,r; - IDXBYTE(t); - r = A + t; - CLR_HNZC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $fc JMP indexed -*** */ -M6805_INLINE void jmp_ix( void ) -{ - INDEXED; - PC = EA; - change_pc(PC); -} - -/* $fd JSR indexed ---- */ -M6805_INLINE void jsr_ix( void ) -{ - INDEXED; - PUSHWORD(m6805.pc); - PC = EA; - change_pc(PC); -} - -/* $fe LDX indexed -**- */ -M6805_INLINE void ldx_ix( void ) -{ - IDXBYTE(X); - CLR_NZ; - SET_NZ8(X); -} - -/* $ff STX indexed -**- */ -M6805_INLINE void stx_ix( void ) -{ - CLR_NZ; - SET_NZ8(X); - INDEXED; - WM(EAD,X); -} diff --git a/jan/src/cpu/m6805/m6805.cpp b/jan/src/cpu/m6805/m6805.cpp deleted file mode 100644 index 222c57b82..000000000 --- a/jan/src/cpu/m6805/m6805.cpp +++ /dev/null @@ -1,908 +0,0 @@ -/*** m6805: Portable 6805 emulator ****************************************** - - m6805.c (Also supports hd68705 and hd63705 variants) - - References: - - 6809 Simulator V09, By L.C. Benschop, Eidnhoven The Netherlands. - - m6809: Portable 6809 emulator, DS (6809 code in MAME, derived from - the 6809 Simulator V09) - - 6809 Microcomputer Programming & Interfacing with Experiments" - by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits - arrays up to 65536 bytes must be supported - machine must be twos complement - - Additional Notes: - - K.Wilkins 18/03/99 - Added 63705 functonality and modified all CPU functions - necessary to support: - Variable width address bus - Different stack pointer - Alternate boot vectors - Alternate interrups vectors - - -*****************************************************************************/ - -#include "burnint.h" -#include "driver.h" -#include "m6805.h" -#include "m6805_intf.h" - -#define change_pc(x) PC = x - -#define IRQ_LEVEL_DETECT 0 - -#define M6805_INLINE static - -enum -{ - SUBTYPE_M6805, - SUBTYPE_M68705, - SUBTYPE_HD63705 -}; - -/* 6805 Registers */ -typedef struct -{ - int subtype; /* Which sub-type is being emulated */ - UINT32 sp_mask; /* Stack pointer address mask */ - UINT32 sp_low; /* Stack pointer low water mark (or floor) */ - PAIR pc; /* Program counter */ - PAIR s; /* Stack pointer */ - UINT8 a; /* Accumulator */ - UINT8 x; /* Index register */ - UINT8 cc; /* Condition codes */ - - UINT16 pending_interrupts; /* MB */ - ALIGN_VAR(8) int (*irq_callback)(int irqline); - int irq_state[9]; /* KW Additional lines for HD63705 */ - int nmi_state; - int nTotalCycles; -} m6805_Regs; - -/* 6805 registers */ -static m6805_Regs m6805; - -#define SUBTYPE m6805.subtype /* CPU Type */ -#define SP_MASK m6805.sp_mask /* stack pointer mask */ -#define SP_LOW m6805.sp_low /* stack pointer low water mark */ -#define pPC m6805.pc /* program counter PAIR */ -#define PC m6805.pc.w.l /* program counter lower word */ -#define S m6805.s.w.l /* stack pointer lower word */ -#define A m6805.a /* accumulator */ -#define X m6805.x /* index register */ -#define CC m6805.cc /* condition codes */ - -static PAIR ea; /* effective address */ -#define EAD ea.d -#define EA ea.w.l - -/* public globals */ -static int m6805_ICount=50000; - -/* DS -- THESE ARE RE-DEFINED IN m6805.h TO RAM, ROM or FUNCTIONS IN cpuintrf.c */ -#define RM(Addr) M6805_RDMEM(Addr) -#define WM(Addr,Value) M6805_WRMEM(Addr,Value) -#define M_RDOP(Addr) M6805_RDOP(Addr) -#define M_RDOP_ARG(Addr) M6805_RDOP_ARG(Addr) - -/* macros to tweak the PC and SP */ -#define SP_INC if( ++S > SP_MASK) S = SP_LOW -#define SP_DEC if( --S < SP_LOW) S = SP_MASK -#define SP_ADJUST(s) ( ( (s) & SP_MASK ) | SP_LOW ) - -/* macros to access memory */ -#define IMMBYTE(b) {b = M_RDOP_ARG(PC++);} -#define IMMWORD(w) {w.d = 0; w.b.h = M_RDOP_ARG(PC); w.b.l = M_RDOP_ARG(PC+1); PC+=2;} - -#define PUSHBYTE(b) wr_s_handler_b(&b) -#define PUSHWORD(w) wr_s_handler_w(&w) -#define PULLBYTE(b) rd_s_handler_b(&b) -#define PULLWORD(w) rd_s_handler_w(&w) - -/* CC masks H INZC - 7654 3210 */ -#define CFLAG 0x01 -#define ZFLAG 0x02 -#define NFLAG 0x04 -#define IFLAG 0x08 -#define HFLAG 0x10 - -#define CLR_NZ CC&=~(NFLAG|ZFLAG) -#define CLR_HNZC CC&=~(HFLAG|NFLAG|ZFLAG|CFLAG) -#define CLR_Z CC&=~(ZFLAG) -#define CLR_NZC CC&=~(NFLAG|ZFLAG|CFLAG) -#define CLR_ZC CC&=~(ZFLAG|CFLAG) - -/* macros for CC -- CC bits affected should be reset before calling */ -#define SET_Z(a) if(!a)SEZ -#define SET_Z8(a) SET_Z((UINT8)a) -#define SET_N8(a) CC|=((a&0x80)>>5) -#define SET_H(a,b,r) CC|=((a^b^r)&0x10) -#define SET_C8(a) CC|=((a&0x100)>>8) - -static const UINT8 flags8i[256]= /* increment */ -{ -0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04 -}; -static const UINT8 flags8d[256]= /* decrement */ -{ -0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04 -}; -#define SET_FLAGS8I(a) {CC|=flags8i[(a)&0xff];} -#define SET_FLAGS8D(a) {CC|=flags8d[(a)&0xff];} - -/* combos */ -#define SET_NZ8(a) {SET_N8(a);SET_Z(a);} -#define SET_FLAGS8(a,b,r) {SET_N8(r);SET_Z8(r);SET_C8(r);} - -/* for treating an unsigned UINT8 as a signed INT16 */ -#define SIGNED(b) ((INT16)(b&0x80?b|0xff00:b)) - -/* Macros for addressing modes */ -#define DIRECT EAD=0;IMMBYTE(ea.b.l) -#define IMM8 EA=PC++ -#define EXTENDED IMMWORD(ea) -#define INDEXED EA=X -#define INDEXED1 {EAD=0; IMMBYTE(ea.b.l); EA+=X;} -#define INDEXED2 {IMMWORD(ea); EA+=X;} - -/* macros to set status flags */ -#if defined(SEC) -#undef SEC -#endif -#define SEC CC|=CFLAG -#define CLC CC&=~CFLAG -#define SEZ CC|=ZFLAG -#define CLZ CC&=~ZFLAG -#define SEN CC|=NFLAG -#define CLN CC&=~NFLAG -#define SEH CC|=HFLAG -#define CLH CC&=~HFLAG -#define SEI CC|=IFLAG -#define CLI CC&=~IFLAG - -/* macros for convenience */ -#define DIRBYTE(b) {DIRECT;b=RM(EAD);} -#define EXTBYTE(b) {EXTENDED;b=RM(EAD);} -#define IDXBYTE(b) {INDEXED;b=RM(EAD);} -#define IDX1BYTE(b) {INDEXED1;b=RM(EAD);} -#define IDX2BYTE(b) {INDEXED2;b=RM(EAD);} -/* Macros for branch instructions */ -#define BRANCH(f) { UINT8 t; IMMBYTE(t); if(f) { PC+=SIGNED(t); change_pc(PC); if (t==0xfe) { /* speed up busy loops */ if(m6805_ICount > 0) m6805_ICount = 0; } } } - -/* what they say it is ... */ -static const unsigned char cycles1[] = -{ - /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ - /*0*/ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, - /*1*/ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - /*2*/ 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - /*3*/ 6, 0, 0, 6, 6, 0, 6, 6, 6, 6, 6, 6, 0, 6, 6, 0, - /*4*/ 4, 0, 0, 4, 4, 0, 4, 4, 4, 4, 4, 0, 4, 4, 0, 4, - /*5*/ 4, 0, 0, 4, 4, 0, 4, 4, 4, 4, 4, 0, 4, 4, 0, 4, - /*6*/ 7, 0, 0, 7, 7, 0, 7, 7, 7, 7, 7, 0, 7, 7, 0, 7, - /*7*/ 6, 0, 0, 6, 6, 0, 6, 6, 6, 6, 6, 0, 6, 6, 0, 6, - /*8*/ 9, 6, 0,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /*9*/ 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, - /*A*/ 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 8, 2, 0, - /*B*/ 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 3, 7, 4, 5, - /*C*/ 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 4, 8, 5, 6, - /*D*/ 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 5, 9, 6, 7, - /*E*/ 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 4, 8, 5, 6, - /*F*/ 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 3, 7, 4, 5 -}; - - -/* pre-clear a PAIR union; clearing h2 and h3 only might be faster? */ -#define CLEAR_PAIR(p) p->d = 0 - -M6805_INLINE void rd_s_handler_b( UINT8 *b ) -{ - SP_INC; - *b = RM( S ); -} - -M6805_INLINE void rd_s_handler_w( PAIR *p ) -{ - CLEAR_PAIR(p); - SP_INC; - p->b.h = RM( S ); - SP_INC; - p->b.l = RM( S ); -} - -M6805_INLINE void wr_s_handler_b( UINT8 *b ) -{ - WM( S, *b ); - SP_DEC; -} - -M6805_INLINE void wr_s_handler_w( PAIR *p ) -{ - WM( S, p->b.l ); - SP_DEC; - WM( S, p->b.h ); - SP_DEC; -} - -M6805_INLINE void RM16( UINT32 Addr, PAIR *p ) -{ - CLEAR_PAIR(p); - p->b.h = RM(Addr); - ++Addr; -// if( ++Addr > AMASK ) Addr = 0; - p->b.l = RM(Addr); -} - -#ifdef UNUSED_FUNCTION -M6805_INLINE void WM16( UINT32 Addr, PAIR *p ) -{ - WM( Addr, p->b.h ); - ++Addr; -// if( ++Addr > AMASK ) Addr = 0; - WM( Addr, p->b.l ); -} -#endif - - -/* Generate interrupt - m68705 version */ -static void m68705_Interrupt(void) -{ - if( (m6805.pending_interrupts & ((1< 0 ); - - return cycles - m6805_ICount; -} - -void m6805RunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805RunEnd called without init\n")); -#endif - - m6805_ICount = 0; -} - -void m6805NewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805NewFrame called without init\n")); -#endif - - m6805.nTotalCycles = 0; -} - -int m6805TotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805TotalCycles called without init\n")); -#endif - - return m6805.nTotalCycles; -} - -int m6805Scan(int nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805Scan called without init\n")); -#endif - - struct BurnArea ba; - - int (*save_irqcallback)(int) = m6805.irq_callback; - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = &m6805; - ba.nLen = sizeof(m6805); - ba.szName = "m6805 Registers"; - BurnAcb(&ba); - } - - m6805.irq_callback = save_irqcallback; - - return 0; -} - - -/**************************************************************************** - * M68705 section - ****************************************************************************/ - -void m68705Reset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m68705Reset called without init\n")); -#endif - - m6805_reset(); - /* Overide default 6805 type */ - m6805.subtype = SUBTYPE_M68705; - RM16( 0xfffe, &m6805.pc ); -} - -void m68705SetIrqLine(int irqline, int state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m68705SetIrqLine called without init\n")); -#endif - - if (m6805.irq_state[irqline] == state ) return; - m6805.irq_state[irqline] = state; - if (state != CLEAR_LINE) m6805.pending_interrupts |= 1<> PAGE_SHIFT] != NULL) { - mem[WRITE][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - return; - } - - if (m6805WriteFunction != NULL) { - m6805WriteFunction(address, data); - return; - } - - return; -} - -UINT8 m6805Read(UINT16 address) -{ - address &= ADDRESS_MASK; - - if (mem[READ][address >> PAGE_SHIFT] != NULL) { - return mem[READ][address >> PAGE_SHIFT][address & PAGE_MASK]; - } - - if (m6805ReadFunction != NULL) { - return m6805ReadFunction(address); - } - - return 0; -} - -UINT8 m6805Fetch(UINT16 address) -{ - address &= ADDRESS_MASK; - - if (mem[FETCH][address >> PAGE_SHIFT] != NULL) { - return mem[FETCH][address >> PAGE_SHIFT][address & PAGE_MASK]; - } - - return m6805Read(address); -} - -static void m6805_write_rom(UINT32 address, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805_write_rom called without init\n")); -#endif - - address &= ADDRESS_MASK; - - if (mem[READ][address >> PAGE_SHIFT] != NULL) { - mem[READ][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - } - - if (mem[WRITE][address >> PAGE_SHIFT] != NULL) { - mem[WRITE][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - } - - if (mem[FETCH][address >> PAGE_SHIFT] != NULL) { - mem[FETCH][address >> PAGE_SHIFT][address & PAGE_MASK] = data; - } - - if (m6805WriteFunction != NULL) { - m6805WriteFunction(address, data); - return; - } - - return; -} - -INT32 m6805GetActive() -{ - return 0; -} - -static UINT8 m6805CheatRead(UINT32 a) -{ - return m6805Read(a); -} - -static cpu_core_config M6805CheatCpuConfig = -{ - m6805Open, - m6805Close, - m6805CheatRead, - m6805_write_rom, - m6805GetActive, - m6805TotalCycles, - m6805NewFrame, - m6805Run, - m6805RunEnd, - m6805Reset, // different for differen types... - 1<<16, - 0 -}; - -void m6805Init(INT32 num, INT32 max) -{ - DebugCPU_M6805Initted = 1; - - ADDRESS_MAX = max; - ADDRESS_MASK = ADDRESS_MAX - 1; - PAGE = ADDRESS_MAX / 0x100; - PAGE_MASK = PAGE - 1; - PAGE_SHIFT = 0; - for (PAGE_SHIFT = 0; (1 << PAGE_SHIFT) < PAGE; PAGE_SHIFT++) {} - - memset (mem[0], 0, PAGE * sizeof(UINT8 *)); - memset (mem[1], 0, PAGE * sizeof(UINT8 *)); - memset (mem[2], 0, PAGE * sizeof(UINT8 *)); - - for (INT32 i = 0; i < num; i++) - CpuCheatRegister(i, &M6805CheatCpuConfig); -} - -void m6805Exit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805Exit called without init\n")); -#endif - - ADDRESS_MAX = 0; - ADDRESS_MASK = 0; - PAGE = 0; - PAGE_MASK = 0; - PAGE_SHIFT = 0; - - DebugCPU_M6805Initted = 0; -} - -void m6805Open(INT32) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805Open called without init\n")); -#endif -} - -void m6805Close() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805Close called without init\n")); -#endif -} diff --git a/jan/src/cpu/m6805_intf.h b/jan/src/cpu/m6805_intf.h deleted file mode 100644 index 17cd62715..000000000 --- a/jan/src/cpu/m6805_intf.h +++ /dev/null @@ -1,30 +0,0 @@ -void m6805Write(UINT16 address, UINT8 data); -UINT8 m6805Read(UINT16 address); -UINT8 m6805Fetch(UINT16 address); - -void m6805MapMemory(UINT8 *ptr, INT32 nStart, INT32 nEnd, INT32 nType); - -void m6805SetWriteHandler(void (*write)(UINT16, UINT8)); -void m6805SetReadHandler(UINT8 (*read)(UINT16)); - -void m6805Init(INT32 num, INT32 address_range); -void m6805Exit(); -void m6805Open(INT32 ); -void m6805Close(); - -INT32 m6805Scan(INT32 nAction); - -void m6805Reset(); -void m6805SetIrqLine(INT32 , INT32 state); -INT32 m6805Run(INT32 cycles); - -void m6805RunEnd(); - -void m68705Reset(); -void m68705SetIrqLine(INT32 irqline, INT32 state); - -void hd63705Reset(); -void hd63705SetIrqLine(INT32 irqline, INT32 state); - -void m6805NewFrame(); -INT32 m6805TotalCycles(); diff --git a/jan/src/cpu/m6809/6809ops.c b/jan/src/cpu/m6809/6809ops.c deleted file mode 100644 index 30f2971b7..000000000 --- a/jan/src/cpu/m6809/6809ops.c +++ /dev/null @@ -1,2997 +0,0 @@ -/* - -HNZVC - -? = undefined -* = affected -- = unaffected -0 = cleared -1 = set -# = CCr directly affected by instruction -@ = special - carry set if bit 7 is set - -*/ - -#ifdef NEW -static void illegal( void ) -#else -M6809_INLINE void illegal( void ) -#endif -{ -// logerror("M6809: illegal opcode at %04x\n",PC); -} - -/* $00 NEG direct ?**** */ -M6809_INLINE void neg_di( void ) -{ - UINT16 r,t; - DIRBYTE(t); - r = -t; - CLR_NZVC; - SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $01 ILLEGAL */ - -/* $02 ILLEGAL */ - -/* $03 COM direct -**01 */ -M6809_INLINE void com_di( void ) -{ - UINT8 t; - DIRBYTE(t); - t = ~t; - CLR_NZV; - SET_NZ8(t); - SEC; - WM(EAD,t); -} - -/* $04 LSR direct -0*-* */ -M6809_INLINE void lsr_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZC; - CC |= (t & CC_C); - t >>= 1; - SET_Z8(t); - WM(EAD,t); -} - -/* $05 ILLEGAL */ - -/* $06 ROR direct -**-* */ -M6809_INLINE void ror_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r= (CC & CC_C) << 7; - CLR_NZC; - CC |= (t & CC_C); - r |= t>>1; - SET_NZ8(r); - WM(EAD,r); -} - -/* $07 ASR direct ?**-* */ -M6809_INLINE void asr_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZC; - CC |= (t & CC_C); - t = (t & 0x80) | (t >> 1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $08 ASL direct ?**** */ -M6809_INLINE void asl_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $09 ROL direct -**** */ -M6809_INLINE void rol_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = (CC & CC_C) | (t << 1); - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $0A DEC direct -***- */ -M6809_INLINE void dec_di( void ) -{ - UINT8 t; - DIRBYTE(t); - --t; - CLR_NZV; - SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $0B ILLEGAL */ - -/* $OC INC direct -***- */ -M6809_INLINE void inc_di( void ) -{ - UINT8 t; - DIRBYTE(t); - ++t; - CLR_NZV; - SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $OD TST direct -**0- */ -M6809_INLINE void tst_di( void ) -{ - UINT8 t; - DIRBYTE(t); - CLR_NZV; - SET_NZ8(t); -} - -/* $0E JMP direct ----- */ -M6809_INLINE void jmp_di( void ) -{ - DIRECT; - PCD = EAD; - CHANGE_PC; -} - -/* $0F CLR direct -0100 */ -M6809_INLINE void clr_di( void ) -{ - DIRECT; - (void)RM(EAD); - WM(EAD,0); - CLR_NZVC; - SEZ; -} - -/* $10 FLAG */ - -/* $11 FLAG */ - -/* $12 NOP inherent ----- */ -M6809_INLINE void nop( void ) -{ - ; -} - -/* $13 SYNC inherent ----- */ -M6809_INLINE void sync( void ) -{ - /* SYNC stops processing instructions until an interrupt request happens. */ - /* This doesn't require the corresponding interrupt to be enabled: if it */ - /* is disabled, execution continues with the next instruction. */ - m6809.int_state |= M6809_SYNC; /* HJB 990227 */ - CHECK_IRQ_LINES; - /* if M6809_SYNC has not been cleared by CHECK_IRQ_LINES, - * stop execution until the interrupt lines change. */ - if( m6809.int_state & M6809_SYNC ) - if (m6809_ICount > 0) m6809_ICount = 0; -} - -/* $14 ILLEGAL */ - -/* $15 ILLEGAL */ - -/* $16 LBRA relative ----- */ -M6809_INLINE void lbra( void ) -{ - IMMWORD(ea); - PC += EA; - CHANGE_PC; - - if ( EA == 0xfffd ) /* EHC 980508 speed up busy loop */ - if ( m6809_ICount > 0) - m6809_ICount = 0; -} - -/* $17 LBSR relative ----- */ -M6809_INLINE void lbsr( void ) -{ - IMMWORD(ea); - PUSHWORD(pPC); - PC += EA; - CHANGE_PC; -} - -/* $18 ILLEGAL */ - -/* $19 DAA inherent (A) -**0* */ -M6809_INLINE void daa( void ) -{ - UINT8 msn, lsn; - UINT16 t, cf = 0; - msn = A & 0xf0; lsn = A & 0x0f; - if( lsn>0x09 || CC & CC_H) cf |= 0x06; - if( msn>0x80 && lsn>0x09 ) cf |= 0x60; - if( msn>0x90 || CC & CC_C) cf |= 0x60; - t = cf + A; - CLR_NZV; /* keep carry from previous operation */ - SET_NZ8((UINT8)t); SET_C8(t); - A = t; -} - -/* $1A ORCC immediate ##### */ -M6809_INLINE void orcc( void ) -{ - UINT8 t; - IMMBYTE(t); - CC |= t; - CHECK_IRQ_LINES; /* HJB 990116 */ -} - -/* $1B ILLEGAL */ - -/* $1C ANDCC immediate ##### */ -M6809_INLINE void andcc( void ) -{ - UINT8 t; - IMMBYTE(t); - CC &= t; - CHECK_IRQ_LINES; /* HJB 990116 */ -} - -/* $1D SEX inherent -**-- */ -M6809_INLINE void sex( void ) -{ - UINT16 t; - t = SIGNED(B); - D = t; -// CLR_NZV; Tim Lindner 20020905: verified that V flag is not affected - CLR_NZ; - SET_NZ16(t); -} - -/* $1E EXG inherent ----- */ -M6809_INLINE void exg( void ) -{ - UINT16 t1,t2; - UINT8 tb; - - IMMBYTE(tb); - if( (tb^(tb>>4)) & 0x08 ) /* HJB 990225: mixed 8/16 bit case? */ - { - /* transfer $ff to both registers */ - t1 = t2 = 0xff; - } - else - { - switch(tb>>4) { - case 0: t1 = D; break; - case 1: t1 = X; break; - case 2: t1 = Y; break; - case 3: t1 = U; break; - case 4: t1 = S; break; - case 5: t1 = PC; break; - case 8: t1 = A; break; - case 9: t1 = B; break; - case 10: t1 = CC; break; - case 11: t1 = DP; break; - default: t1 = 0xff; - } - switch(tb&15) { - case 0: t2 = D; break; - case 1: t2 = X; break; - case 2: t2 = Y; break; - case 3: t2 = U; break; - case 4: t2 = S; break; - case 5: t2 = PC; break; - case 8: t2 = A; break; - case 9: t2 = B; break; - case 10: t2 = CC; break; - case 11: t2 = DP; break; - default: t2 = 0xff; - } - } - switch(tb>>4) { - case 0: D = t2; break; - case 1: X = t2; break; - case 2: Y = t2; break; - case 3: U = t2; break; - case 4: S = t2; break; - case 5: PC = t2; CHANGE_PC; break; - case 8: A = t2; break; - case 9: B = t2; break; - case 10: CC = t2; break; - case 11: DP = t2; break; - } - switch(tb&15) { - case 0: D = t1; break; - case 1: X = t1; break; - case 2: Y = t1; break; - case 3: U = t1; break; - case 4: S = t1; break; - case 5: PC = t1; CHANGE_PC; break; - case 8: A = t1; break; - case 9: B = t1; break; - case 10: CC = t1; break; - case 11: DP = t1; break; - } -} - -/* $1F TFR inherent ----- */ -M6809_INLINE void tfr( void ) -{ - UINT8 tb; - UINT16 t; - - IMMBYTE(tb); - if( (tb^(tb>>4)) & 0x08 ) /* HJB 990225: mixed 8/16 bit case? */ - { - /* transfer $ff to register */ - t = 0xff; - } - else - { - switch(tb>>4) { - case 0: t = D; break; - case 1: t = X; break; - case 2: t = Y; break; - case 3: t = U; break; - case 4: t = S; break; - case 5: t = PC; break; - case 8: t = A; break; - case 9: t = B; break; - case 10: t = CC; break; - case 11: t = DP; break; - default: t = 0xff; - } - } - switch(tb&15) { - case 0: D = t; break; - case 1: X = t; break; - case 2: Y = t; break; - case 3: U = t; break; - case 4: S = t; break; - case 5: PC = t; CHANGE_PC; break; - case 8: A = t; break; - case 9: B = t; break; - case 10: CC = t; break; - case 11: DP = t; break; - } -} - -/* $20 BRA relative ----- */ -M6809_INLINE void bra( void ) -{ - UINT8 t; - IMMBYTE(t); - PC += SIGNED(t); - CHANGE_PC; - /* JB 970823 - speed up busy loops */ - if( t == 0xfe ) - if( m6809_ICount > 0 ) m6809_ICount = 0; -} - -/* $21 BRN relative ----- */ -M6809_INLINE void brn( void ) -{ - UINT8 t; - IMMBYTE(t); -} - -/* $1021 LBRN relative ----- */ -M6809_INLINE void lbrn( void ) -{ - IMMWORD(ea); -} - -/* $22 BHI relative ----- */ -M6809_INLINE void bhi( void ) -{ - BRANCH( !(CC & (CC_Z|CC_C)) ); -} - -/* $1022 LBHI relative ----- */ -M6809_INLINE void lbhi( void ) -{ - LBRANCH( !(CC & (CC_Z|CC_C)) ); -} - -/* $23 BLS relative ----- */ -M6809_INLINE void bls( void ) -{ - BRANCH( (CC & (CC_Z|CC_C)) ); -} - -/* $1023 LBLS relative ----- */ -M6809_INLINE void lbls( void ) -{ - LBRANCH( (CC&(CC_Z|CC_C)) ); -} - -/* $24 BCC relative ----- */ -M6809_INLINE void bcc( void ) -{ - BRANCH( !(CC&CC_C) ); -} - -/* $1024 LBCC relative ----- */ -M6809_INLINE void lbcc( void ) -{ - LBRANCH( !(CC&CC_C) ); -} - -/* $25 BCS relative ----- */ -M6809_INLINE void bcs( void ) -{ - BRANCH( (CC&CC_C) ); -} - -/* $1025 LBCS relative ----- */ -M6809_INLINE void lbcs( void ) -{ - LBRANCH( (CC&CC_C) ); -} - -/* $26 BNE relative ----- */ -M6809_INLINE void bne( void ) -{ - BRANCH( !(CC&CC_Z) ); -} - -/* $1026 LBNE relative ----- */ -M6809_INLINE void lbne( void ) -{ - LBRANCH( !(CC&CC_Z) ); -} - -/* $27 BEQ relative ----- */ -M6809_INLINE void beq( void ) -{ - BRANCH( (CC&CC_Z) ); -} - -/* $1027 LBEQ relative ----- */ -M6809_INLINE void lbeq( void ) -{ - LBRANCH( (CC&CC_Z) ); -} - -/* $28 BVC relative ----- */ -M6809_INLINE void bvc( void ) -{ - BRANCH( !(CC&CC_V) ); -} - -/* $1028 LBVC relative ----- */ -M6809_INLINE void lbvc( void ) -{ - LBRANCH( !(CC&CC_V) ); -} - -/* $29 BVS relative ----- */ -M6809_INLINE void bvs( void ) -{ - BRANCH( (CC&CC_V) ); -} - -/* $1029 LBVS relative ----- */ -M6809_INLINE void lbvs( void ) -{ - LBRANCH( (CC&CC_V) ); -} - -/* $2A BPL relative ----- */ -M6809_INLINE void bpl( void ) -{ - BRANCH( !(CC&CC_N) ); -} - -/* $102A LBPL relative ----- */ -M6809_INLINE void lbpl( void ) -{ - LBRANCH( !(CC&CC_N) ); -} - -/* $2B BMI relative ----- */ -M6809_INLINE void bmi( void ) -{ - BRANCH( (CC&CC_N) ); -} - -/* $102B LBMI relative ----- */ -M6809_INLINE void lbmi( void ) -{ - LBRANCH( (CC&CC_N) ); -} - -/* $2C BGE relative ----- */ -M6809_INLINE void bge( void ) -{ - BRANCH( !NXORV ); -} - -/* $102C LBGE relative ----- */ -M6809_INLINE void lbge( void ) -{ - LBRANCH( !NXORV ); -} - -/* $2D BLT relative ----- */ -M6809_INLINE void blt( void ) -{ - BRANCH( NXORV ); -} - -/* $102D LBLT relative ----- */ -M6809_INLINE void lblt( void ) -{ - LBRANCH( NXORV ); -} - -/* $2E BGT relative ----- */ -M6809_INLINE void bgt( void ) -{ - BRANCH( !(NXORV || (CC&CC_Z)) ); -} - -/* $102E LBGT relative ----- */ -M6809_INLINE void lbgt( void ) -{ - LBRANCH( !(NXORV || (CC&CC_Z)) ); -} - -/* $2F BLE relative ----- */ -M6809_INLINE void ble( void ) -{ - BRANCH( (NXORV || (CC&CC_Z)) ); -} - -/* $102F LBLE relative ----- */ -M6809_INLINE void lble( void ) -{ - LBRANCH( (NXORV || (CC&CC_Z)) ); -} - -/* $30 LEAX indexed --*-- */ -M6809_INLINE void leax( void ) -{ - fetch_effective_address(); - X = EA; - CLR_Z; - SET_Z(X); -} - -/* $31 LEAY indexed --*-- */ -M6809_INLINE void leay( void ) -{ - fetch_effective_address(); - Y = EA; - CLR_Z; - SET_Z(Y); -} - -/* $32 LEAS indexed ----- */ -M6809_INLINE void leas( void ) -{ - fetch_effective_address(); - S = EA; - m6809.int_state |= M6809_LDS; -} - -/* $33 LEAU indexed ----- */ -M6809_INLINE void leau( void ) -{ - fetch_effective_address(); - U = EA; -} - -/* $34 PSHS inherent ----- */ -M6809_INLINE void pshs( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x80 ) { PUSHWORD(pPC); m6809_ICount -= 2; } - if( t&0x40 ) { PUSHWORD(pU); m6809_ICount -= 2; } - if( t&0x20 ) { PUSHWORD(pY); m6809_ICount -= 2; } - if( t&0x10 ) { PUSHWORD(pX); m6809_ICount -= 2; } - if( t&0x08 ) { PUSHBYTE(DP); m6809_ICount -= 1; } - if( t&0x04 ) { PUSHBYTE(B); m6809_ICount -= 1; } - if( t&0x02 ) { PUSHBYTE(A); m6809_ICount -= 1; } - if( t&0x01 ) { PUSHBYTE(CC); m6809_ICount -= 1; } -} - -/* 35 PULS inherent ----- */ -M6809_INLINE void puls( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x01 ) { PULLBYTE(CC); m6809_ICount -= 1; } - if( t&0x02 ) { PULLBYTE(A); m6809_ICount -= 1; } - if( t&0x04 ) { PULLBYTE(B); m6809_ICount -= 1; } - if( t&0x08 ) { PULLBYTE(DP); m6809_ICount -= 1; } - if( t&0x10 ) { PULLWORD(XD); m6809_ICount -= 2; } - if( t&0x20 ) { PULLWORD(YD); m6809_ICount -= 2; } - if( t&0x40 ) { PULLWORD(UD); m6809_ICount -= 2; } - if( t&0x80 ) { PULLWORD(PCD); CHANGE_PC; m6809_ICount -= 2; } - - /* HJB 990225: moved check after all PULLs */ - if( t&0x01 ) { CHECK_IRQ_LINES; } -} - -/* $36 PSHU inherent ----- */ -M6809_INLINE void pshu( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x80 ) { PSHUWORD(pPC); m6809_ICount -= 2; } - if( t&0x40 ) { PSHUWORD(pS); m6809_ICount -= 2; } - if( t&0x20 ) { PSHUWORD(pY); m6809_ICount -= 2; } - if( t&0x10 ) { PSHUWORD(pX); m6809_ICount -= 2; } - if( t&0x08 ) { PSHUBYTE(DP); m6809_ICount -= 1; } - if( t&0x04 ) { PSHUBYTE(B); m6809_ICount -= 1; } - if( t&0x02 ) { PSHUBYTE(A); m6809_ICount -= 1; } - if( t&0x01 ) { PSHUBYTE(CC); m6809_ICount -= 1; } -} - -/* 37 PULU inherent ----- */ -M6809_INLINE void pulu( void ) -{ - UINT8 t; - IMMBYTE(t); - if( t&0x01 ) { PULUBYTE(CC); m6809_ICount -= 1; } - if( t&0x02 ) { PULUBYTE(A); m6809_ICount -= 1; } - if( t&0x04 ) { PULUBYTE(B); m6809_ICount -= 1; } - if( t&0x08 ) { PULUBYTE(DP); m6809_ICount -= 1; } - if( t&0x10 ) { PULUWORD(XD); m6809_ICount -= 2; } - if( t&0x20 ) { PULUWORD(YD); m6809_ICount -= 2; } - if( t&0x40 ) { PULUWORD(SD); m6809_ICount -= 2; } - if( t&0x80 ) { PULUWORD(PCD); CHANGE_PC; m6809_ICount -= 2; } - - /* HJB 990225: moved check after all PULLs */ - if( t&0x01 ) { CHECK_IRQ_LINES; } -} - -/* $38 ILLEGAL */ - -/* $39 RTS inherent ----- */ -M6809_INLINE void rts( void ) -{ - PULLWORD(PCD); - CHANGE_PC; -} - -/* $3A ABX inherent ----- */ -M6809_INLINE void abx( void ) -{ - X += B; -} - -/* $3B RTI inherent ##### */ -M6809_INLINE void rti( void ) -{ - UINT8 t; - PULLBYTE(CC); - t = CC & CC_E; /* HJB 990225: entire state saved? */ - if(t) - { - m6809_ICount -= 9; - PULLBYTE(A); - PULLBYTE(B); - PULLBYTE(DP); - PULLWORD(XD); - PULLWORD(YD); - PULLWORD(UD); - } - PULLWORD(PCD); - CHANGE_PC; - CHECK_IRQ_LINES; /* HJB 990116 */ -} - -/* $3C CWAI inherent ----1 */ -M6809_INLINE void cwai( void ) -{ - UINT8 t; - IMMBYTE(t); - CC &= t; - /* - * CWAI stacks the entire machine state on the hardware stack, - * then waits for an interrupt; when the interrupt is taken - * later, the state is *not* saved again after CWAI. - */ - CC |= CC_E; /* HJB 990225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - m6809.int_state |= M6809_CWAI; /* HJB 990228 */ - CHECK_IRQ_LINES; /* HJB 990116 */ - if( m6809.int_state & M6809_CWAI ) - if( m6809_ICount > 0 ) - m6809_ICount = 0; -} - -/* $3D MUL inherent --*-@ */ -M6809_INLINE void mul( void ) -{ - UINT16 t; - t = A * B; - CLR_ZC; SET_Z16(t); if(t&0x80) SEC; - D = t; -} - -/* $3E ILLEGAL */ - -/* $3F SWI (SWI2 SWI3) absolute indirect ----- */ -M6809_INLINE void swi( void ) -{ - CC |= CC_E; /* HJB 980225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - CC |= CC_IF | CC_II; /* inhibit FIRQ and IRQ */ - PCD=RM16(0xfffa); - CHANGE_PC; -} - -/* $103F SWI2 absolute indirect ----- */ -M6809_INLINE void swi2( void ) -{ - CC |= CC_E; /* HJB 980225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - PCD = RM16(0xfff4); - CHANGE_PC; -} - -/* $113F SWI3 absolute indirect ----- */ -M6809_INLINE void swi3( void ) -{ - CC |= CC_E; /* HJB 980225: save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - PCD = RM16(0xfff2); - CHANGE_PC; -} - -/* $40 NEGA inherent ?**** */ -M6809_INLINE void nega( void ) -{ - UINT16 r; - r = -A; - CLR_NZVC; - SET_FLAGS8(0,A,r); - A = r; -} - -/* $41 ILLEGAL */ - -/* $42 ILLEGAL */ - -/* $43 COMA inherent -**01 */ -M6809_INLINE void coma( void ) -{ - A = ~A; - CLR_NZV; - SET_NZ8(A); - SEC; -} - -/* $44 LSRA inherent -0*-* */ -M6809_INLINE void lsra( void ) -{ - CLR_NZC; - CC |= (A & CC_C); - A >>= 1; - SET_Z8(A); -} - -/* $45 ILLEGAL */ - -/* $46 RORA inherent -**-* */ -M6809_INLINE void rora( void ) -{ - UINT8 r; - r = (CC & CC_C) << 7; - CLR_NZC; - CC |= (A & CC_C); - r |= A >> 1; - SET_NZ8(r); - A = r; -} - -/* $47 ASRA inherent ?**-* */ -M6809_INLINE void asra( void ) -{ - CLR_NZC; - CC |= (A & CC_C); - A = (A & 0x80) | (A >> 1); - SET_NZ8(A); -} - -/* $48 ASLA inherent ?**** */ -M6809_INLINE void asla( void ) -{ - UINT16 r; - r = A << 1; - CLR_NZVC; - SET_FLAGS8(A,A,r); - A = r; -} - -/* $49 ROLA inherent -**** */ -M6809_INLINE void rola( void ) -{ - UINT16 t,r; - t = A; - r = (CC & CC_C) | (t<<1); - CLR_NZVC; SET_FLAGS8(t,t,r); - A = r; -} - -/* $4A DECA inherent -***- */ -M6809_INLINE void deca( void ) -{ - --A; - CLR_NZV; - SET_FLAGS8D(A); -} - -/* $4B ILLEGAL */ - -/* $4C INCA inherent -***- */ -M6809_INLINE void inca( void ) -{ - ++A; - CLR_NZV; - SET_FLAGS8I(A); -} - -/* $4D TSTA inherent -**0- */ -M6809_INLINE void tsta( void ) -{ - CLR_NZV; - SET_NZ8(A); -} - -/* $4E ILLEGAL */ - -/* $4F CLRA inherent -0100 */ -M6809_INLINE void clra( void ) -{ - A = 0; - CLR_NZVC; SEZ; -} - -/* $50 NEGB inherent ?**** */ -M6809_INLINE void negb( void ) -{ - UINT16 r; - r = -B; - CLR_NZVC; - SET_FLAGS8(0,B,r); - B = r; -} - -/* $51 ILLEGAL */ - -/* $52 ILLEGAL */ - -/* $53 COMB inherent -**01 */ -M6809_INLINE void comb( void ) -{ - B = ~B; - CLR_NZV; - SET_NZ8(B); - SEC; -} - -/* $54 LSRB inherent -0*-* */ -M6809_INLINE void lsrb( void ) -{ - CLR_NZC; - CC |= (B & CC_C); - B >>= 1; - SET_Z8(B); -} - -/* $55 ILLEGAL */ - -/* $56 RORB inherent -**-* */ -M6809_INLINE void rorb( void ) -{ - UINT8 r; - r = (CC & CC_C) << 7; - CLR_NZC; - CC |= (B & CC_C); - r |= B >> 1; - SET_NZ8(r); - B = r; -} - -/* $57 ASRB inherent ?**-* */ -M6809_INLINE void asrb( void ) -{ - CLR_NZC; - CC |= (B & CC_C); - B= (B & 0x80) | (B >> 1); - SET_NZ8(B); -} - -/* $58 ASLB inherent ?**** */ -M6809_INLINE void aslb( void ) -{ - UINT16 r; - r = B << 1; - CLR_NZVC; - SET_FLAGS8(B,B,r); - B = r; -} - -/* $59 ROLB inherent -**** */ -M6809_INLINE void rolb( void ) -{ - UINT16 t,r; - t = B; - r = CC & CC_C; - r |= t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - B = r; -} - -/* $5A DECB inherent -***- */ -M6809_INLINE void decb( void ) -{ - --B; - CLR_NZV; - SET_FLAGS8D(B); -} - -/* $5B ILLEGAL */ - -/* $5C INCB inherent -***- */ -M6809_INLINE void incb( void ) -{ - ++B; - CLR_NZV; - SET_FLAGS8I(B); -} - -/* $5D TSTB inherent -**0- */ -M6809_INLINE void tstb( void ) -{ - CLR_NZV; - SET_NZ8(B); -} - -/* $5E ILLEGAL */ - -/* $5F CLRB inherent -0100 */ -M6809_INLINE void clrb( void ) -{ - B = 0; - CLR_NZVC; SEZ; -} - -/* $60 NEG indexed ?**** */ -M6809_INLINE void neg_ix( void ) -{ - UINT16 r,t; - fetch_effective_address(); - t = RM(EAD); - r=-t; - CLR_NZVC; - SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $61 ILLEGAL */ - -/* $62 ILLEGAL */ - -/* $63 COM indexed -**01 */ -M6809_INLINE void com_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t = ~RM(EAD); - CLR_NZV; - SET_NZ8(t); - SEC; - WM(EAD,t); -} - -/* $64 LSR indexed -0*-* */ -M6809_INLINE void lsr_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t=RM(EAD); - CLR_NZC; - CC |= (t & CC_C); - t>>=1; SET_Z8(t); - WM(EAD,t); -} - -/* $65 ILLEGAL */ - -/* $66 ROR indexed -**-* */ -M6809_INLINE void ror_ix( void ) -{ - UINT8 t,r; - fetch_effective_address(); - t=RM(EAD); - r = (CC & CC_C) << 7; - CLR_NZC; - CC |= (t & CC_C); - r |= t>>1; SET_NZ8(r); - WM(EAD,r); -} - -/* $67 ASR indexed ?**-* */ -M6809_INLINE void asr_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t=RM(EAD); - CLR_NZC; - CC |= (t & CC_C); - t=(t&0x80)|(t>>1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $68 ASL indexed ?**** */ -M6809_INLINE void asl_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t=RM(EAD); - r = t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $69 ROL indexed -**** */ -M6809_INLINE void rol_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t=RM(EAD); - r = CC & CC_C; - r |= t << 1; - CLR_NZVC; - SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $6A DEC indexed -***- */ -M6809_INLINE void dec_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t = RM(EAD) - 1; - CLR_NZV; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $6B ILLEGAL */ - -/* $6C INC indexed -***- */ -M6809_INLINE void inc_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t = RM(EAD) + 1; - CLR_NZV; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $6D TST indexed -**0- */ -M6809_INLINE void tst_ix( void ) -{ - UINT8 t; - fetch_effective_address(); - t = RM(EAD); - CLR_NZV; - SET_NZ8(t); -} - -/* $6E JMP indexed ----- */ -M6809_INLINE void jmp_ix( void ) -{ - fetch_effective_address(); - PCD = EAD; - CHANGE_PC; -} - -/* $6F CLR indexed -0100 */ -M6809_INLINE void clr_ix( void ) -{ - fetch_effective_address(); - (void)RM(EAD); - WM(EAD,0); - CLR_NZVC; SEZ; -} - -/* $70 NEG extended ?**** */ -M6809_INLINE void neg_ex( void ) -{ - UINT16 r,t; - EXTBYTE(t); r=-t; - CLR_NZVC; SET_FLAGS8(0,t,r); - WM(EAD,r); -} - -/* $71 ILLEGAL */ - -/* $72 ILLEGAL */ - -/* $73 COM extended -**01 */ -M6809_INLINE void com_ex( void ) -{ - UINT8 t; - EXTBYTE(t); t = ~t; - CLR_NZV; SET_NZ8(t); SEC; - WM(EAD,t); -} - -/* $74 LSR extended -0*-* */ -M6809_INLINE void lsr_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZC; CC |= (t & CC_C); - t>>=1; SET_Z8(t); - WM(EAD,t); -} - -/* $75 ILLEGAL */ - -/* $76 ROR extended -**-* */ -M6809_INLINE void ror_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); r=(CC & CC_C) << 7; - CLR_NZC; CC |= (t & CC_C); - r |= t>>1; SET_NZ8(r); - WM(EAD,r); -} - -/* $77 ASR extended ?**-* */ -M6809_INLINE void asr_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZC; CC |= (t & CC_C); - t=(t&0x80)|(t>>1); - SET_NZ8(t); - WM(EAD,t); -} - -/* $78 ASL extended ?**** */ -M6809_INLINE void asl_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r=t<<1; - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $79 ROL extended -**** */ -M6809_INLINE void rol_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); r = (CC & CC_C) | (t << 1); - CLR_NZVC; SET_FLAGS8(t,t,r); - WM(EAD,r); -} - -/* $7A DEC extended -***- */ -M6809_INLINE void dec_ex( void ) -{ - UINT8 t; - EXTBYTE(t); --t; - CLR_NZV; SET_FLAGS8D(t); - WM(EAD,t); -} - -/* $7B ILLEGAL */ - -/* $7C INC extended -***- */ -M6809_INLINE void inc_ex( void ) -{ - UINT8 t; - EXTBYTE(t); ++t; - CLR_NZV; SET_FLAGS8I(t); - WM(EAD,t); -} - -/* $7D TST extended -**0- */ -M6809_INLINE void tst_ex( void ) -{ - UINT8 t; - EXTBYTE(t); CLR_NZV; SET_NZ8(t); -} - -/* $7E JMP extended ----- */ -M6809_INLINE void jmp_ex( void ) -{ - EXTENDED; - PCD = EAD; - CHANGE_PC; -} - -/* $7F CLR extended -0100 */ -M6809_INLINE void clr_ex( void ) -{ - EXTENDED; - (void)RM(EAD); - WM(EAD,0); - CLR_NZVC; SEZ; -} - -/* $80 SUBA immediate ?**** */ -M6809_INLINE void suba_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $81 CMPA immediate ?**** */ -M6809_INLINE void cmpa_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $82 SBCA immediate ?**** */ -M6809_INLINE void sbca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $83 SUBD (CMPD CMPU) immediate -**** */ -M6809_INLINE void subd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $1083 CMPD immediate -**** */ -M6809_INLINE void cmpd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $1183 CMPU immediate -**** */ -M6809_INLINE void cmpu_im( void ) -{ - UINT32 r, d; - PAIR b; - IMMWORD(b); - d = U; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $84 ANDA immediate -**0- */ -M6809_INLINE void anda_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A &= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $85 BITA immediate -**0- */ -M6809_INLINE void bita_im( void ) -{ - UINT8 t,r; - IMMBYTE(t); - r = A & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $86 LDA immediate -**0- */ -M6809_INLINE void lda_im( void ) -{ - IMMBYTE(A); - CLR_NZV; - SET_NZ8(A); -} - -/* is this a legal instruction? */ -/* $87 STA immediate -**0- */ -M6809_INLINE void sta_im( void ) -{ - CLR_NZV; - SET_NZ8(A); - IMM8; - WM(EAD,A); -} - -/* $88 EORA immediate -**0- */ -M6809_INLINE void eora_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A ^= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $89 ADCA immediate ***** */ -M6809_INLINE void adca_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $8A ORA immediate -**0- */ -M6809_INLINE void ora_im( void ) -{ - UINT8 t; - IMMBYTE(t); - A |= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $8B ADDA immediate ***** */ -M6809_INLINE void adda_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $8C CMPX (CMPY CMPS) immediate -**** */ -M6809_INLINE void cmpx_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $108C CMPY immediate -**** */ -M6809_INLINE void cmpy_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $118C CMPS immediate -**** */ -M6809_INLINE void cmps_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $8D BSR ----- */ -M6809_INLINE void bsr( void ) -{ - UINT8 t; - IMMBYTE(t); - PUSHWORD(pPC); - PC += SIGNED(t); - CHANGE_PC; -} - -/* $8E LDX (LDY) immediate -**0- */ -M6809_INLINE void ldx_im( void ) -{ - IMMWORD(pX); - CLR_NZV; - SET_NZ16(X); -} - -/* $108E LDY immediate -**0- */ -M6809_INLINE void ldy_im( void ) -{ - IMMWORD(pY); - CLR_NZV; - SET_NZ16(Y); -} - -/* is this a legal instruction? */ -/* $8F STX (STY) immediate -**0- */ -M6809_INLINE void stx_im( void ) -{ - CLR_NZV; - SET_NZ16(X); - IMM16; - WM16(EAD,&pX); -} - -/* is this a legal instruction? */ -/* $108F STY immediate -**0- */ -M6809_INLINE void sty_im( void ) -{ - CLR_NZV; - SET_NZ16(Y); - IMM16; - WM16(EAD,&pY); -} - -/* $90 SUBA direct ?**** */ -M6809_INLINE void suba_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $91 CMPA direct ?**** */ -M6809_INLINE void cmpa_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $92 SBCA direct ?**** */ -M6809_INLINE void sbca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $93 SUBD (CMPD CMPU) direct -**** */ -M6809_INLINE void subd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $1093 CMPD direct -**** */ -M6809_INLINE void cmpd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $1193 CMPU direct -**** */ -M6809_INLINE void cmpu_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = U; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(U,b.d,r); -} - -/* $94 ANDA direct -**0- */ -M6809_INLINE void anda_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A &= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $95 BITA direct -**0- */ -M6809_INLINE void bita_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r = A & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $96 LDA direct -**0- */ -M6809_INLINE void lda_di( void ) -{ - DIRBYTE(A); - CLR_NZV; - SET_NZ8(A); -} - -/* $97 STA direct -**0- */ -M6809_INLINE void sta_di( void ) -{ - CLR_NZV; - SET_NZ8(A); - DIRECT; - WM(EAD,A); -} - -/* $98 EORA direct -**0- */ -M6809_INLINE void eora_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A ^= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $99 ADCA direct ***** */ -M6809_INLINE void adca_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $9A ORA direct -**0- */ -M6809_INLINE void ora_di( void ) -{ - UINT8 t; - DIRBYTE(t); - A |= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $9B ADDA direct ***** */ -M6809_INLINE void adda_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $9C CMPX (CMPY CMPS) direct -**** */ -M6809_INLINE void cmpx_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $109C CMPY direct -**** */ -M6809_INLINE void cmpy_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $119C CMPS direct -**** */ -M6809_INLINE void cmps_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $9D JSR direct ----- */ -M6809_INLINE void jsr_di( void ) -{ - DIRECT; - PUSHWORD(pPC); - PCD = EAD; - CHANGE_PC; -} - -/* $9E LDX (LDY) direct -**0- */ -M6809_INLINE void ldx_di( void ) -{ - DIRWORD(pX); - CLR_NZV; - SET_NZ16(X); -} - -/* $109E LDY direct -**0- */ -M6809_INLINE void ldy_di( void ) -{ - DIRWORD(pY); - CLR_NZV; - SET_NZ16(Y); -} - -/* $9F STX (STY) direct -**0- */ -M6809_INLINE void stx_di( void ) -{ - CLR_NZV; - SET_NZ16(X); - DIRECT; - WM16(EAD,&pX); -} - -/* $109F STY direct -**0- */ -M6809_INLINE void sty_di( void ) -{ - CLR_NZV; - SET_NZ16(Y); - DIRECT; - WM16(EAD,&pY); -} - -/* $a0 SUBA indexed ?**** */ -M6809_INLINE void suba_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $a1 CMPA indexed ?**** */ -M6809_INLINE void cmpa_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $a2 SBCA indexed ?**** */ -M6809_INLINE void sbca_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $a3 SUBD (CMPD CMPU) indexed -**** */ -M6809_INLINE void subd_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $10a3 CMPD indexed -**** */ -M6809_INLINE void cmpd_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11a3 CMPU indexed -**** */ -M6809_INLINE void cmpu_ix( void ) -{ - UINT32 r; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - r = U - b.d; - CLR_NZVC; - SET_FLAGS16(U,b.d,r); -} - -/* $a4 ANDA indexed -**0- */ -M6809_INLINE void anda_ix( void ) -{ - fetch_effective_address(); - A &= RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $a5 BITA indexed -**0- */ -M6809_INLINE void bita_ix( void ) -{ - UINT8 r; - fetch_effective_address(); - r = A & RM(EAD); - CLR_NZV; - SET_NZ8(r); -} - -/* $a6 LDA indexed -**0- */ -M6809_INLINE void lda_ix( void ) -{ - fetch_effective_address(); - A = RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $a7 STA indexed -**0- */ -M6809_INLINE void sta_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ8(A); - WM(EAD,A); -} - -/* $a8 EORA indexed -**0- */ -M6809_INLINE void eora_ix( void ) -{ - fetch_effective_address(); - A ^= RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $a9 ADCA indexed ***** */ -M6809_INLINE void adca_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $aA ORA indexed -**0- */ -M6809_INLINE void ora_ix( void ) -{ - fetch_effective_address(); - A |= RM(EAD); - CLR_NZV; - SET_NZ8(A); -} - -/* $aB ADDA indexed ***** */ -M6809_INLINE void adda_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $aC CMPX (CMPY CMPS) indexed -**** */ -M6809_INLINE void cmpx_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $10aC CMPY indexed -**** */ -M6809_INLINE void cmpy_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11aC CMPS indexed -**** */ -M6809_INLINE void cmps_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $aD JSR indexed ----- */ -M6809_INLINE void jsr_ix( void ) -{ - fetch_effective_address(); - PUSHWORD(pPC); - PCD = EAD; - CHANGE_PC; -} - -/* $aE LDX (LDY) indexed -**0- */ -M6809_INLINE void ldx_ix( void ) -{ - fetch_effective_address(); - X=RM16(EAD); - CLR_NZV; - SET_NZ16(X); -} - -/* $10aE LDY indexed -**0- */ -M6809_INLINE void ldy_ix( void ) -{ - fetch_effective_address(); - Y=RM16(EAD); - CLR_NZV; - SET_NZ16(Y); -} - -/* $aF STX (STY) indexed -**0- */ -M6809_INLINE void stx_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(X); - WM16(EAD,&pX); -} - -/* $10aF STY indexed -**0- */ -M6809_INLINE void sty_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(Y); - WM16(EAD,&pY); -} - -/* $b0 SUBA extended ?**** */ -M6809_INLINE void suba_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $b1 CMPA extended ?**** */ -M6809_INLINE void cmpa_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t; - CLR_NZVC; - SET_FLAGS8(A,t,r); -} - -/* $b2 SBCA extended ?**** */ -M6809_INLINE void sbca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(A,t,r); - A = r; -} - -/* $b3 SUBD (CMPD CMPU) extended -**** */ -M6809_INLINE void subd_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $10b3 CMPD extended -**** */ -M6809_INLINE void cmpd_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = D; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11b3 CMPU extended -**** */ -M6809_INLINE void cmpu_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = U; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $b4 ANDA extended -**0- */ -M6809_INLINE void anda_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A &= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $b5 BITA extended -**0- */ -M6809_INLINE void bita_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); - r = A & t; - CLR_NZV; SET_NZ8(r); -} - -/* $b6 LDA extended -**0- */ -M6809_INLINE void lda_ex( void ) -{ - EXTBYTE(A); - CLR_NZV; - SET_NZ8(A); -} - -/* $b7 STA extended -**0- */ -M6809_INLINE void sta_ex( void ) -{ - CLR_NZV; - SET_NZ8(A); - EXTENDED; - WM(EAD,A); -} - -/* $b8 EORA extended -**0- */ -M6809_INLINE void eora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A ^= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $b9 ADCA extended ***** */ -M6809_INLINE void adca_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $bA ORA extended -**0- */ -M6809_INLINE void ora_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - A |= t; - CLR_NZV; - SET_NZ8(A); -} - -/* $bB ADDA extended ***** */ -M6809_INLINE void adda_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = A + t; - CLR_HNZVC; - SET_FLAGS8(A,t,r); - SET_H(A,t,r); - A = r; -} - -/* $bC CMPX (CMPY CMPS) extended -**** */ -M6809_INLINE void cmpx_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = X; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $10bC CMPY extended -**** */ -M6809_INLINE void cmpy_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = Y; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $11bC CMPS extended -**** */ -M6809_INLINE void cmps_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = S; - r = d - b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); -} - -/* $bD JSR extended ----- */ -M6809_INLINE void jsr_ex( void ) -{ - EXTENDED; - PUSHWORD(pPC); - PCD = EAD; - CHANGE_PC; -} - -/* $bE LDX (LDY) extended -**0- */ -M6809_INLINE void ldx_ex( void ) -{ - EXTWORD(pX); - CLR_NZV; - SET_NZ16(X); -} - -/* $10bE LDY extended -**0- */ -M6809_INLINE void ldy_ex( void ) -{ - EXTWORD(pY); - CLR_NZV; - SET_NZ16(Y); -} - -/* $bF STX (STY) extended -**0- */ -M6809_INLINE void stx_ex( void ) -{ - CLR_NZV; - SET_NZ16(X); - EXTENDED; - WM16(EAD,&pX); -} - -/* $10bF STY extended -**0- */ -M6809_INLINE void sty_ex( void ) -{ - CLR_NZV; - SET_NZ16(Y); - EXTENDED; - WM16(EAD,&pY); -} - -/* $c0 SUBB immediate ?**** */ -M6809_INLINE void subb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $c1 CMPB immediate ?**** */ -M6809_INLINE void cmpb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B - t; - CLR_NZVC; SET_FLAGS8(B,t,r); -} - -/* $c2 SBCB immediate ?**** */ -M6809_INLINE void sbcb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $c3 ADDD immediate -**** */ -M6809_INLINE void addd_im( void ) -{ - UINT32 r,d; - PAIR b; - IMMWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $c4 ANDB immediate -**0- */ -M6809_INLINE void andb_im( void ) -{ - UINT8 t; - IMMBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $c5 BITB immediate -**0- */ -M6809_INLINE void bitb_im( void ) -{ - UINT8 t,r; - IMMBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $c6 LDB immediate -**0- */ -M6809_INLINE void ldb_im( void ) -{ - IMMBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* is this a legal instruction? */ -/* $c7 STB immediate -**0- */ -M6809_INLINE void stb_im( void ) -{ - CLR_NZV; - SET_NZ8(B); - IMM8; - WM(EAD,B); -} - -/* $c8 EORB immediate -**0- */ -M6809_INLINE void eorb_im( void ) -{ - UINT8 t; - IMMBYTE(t); - B ^= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $c9 ADCB immediate ***** */ -M6809_INLINE void adcb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $cA ORB immediate -**0- */ -M6809_INLINE void orb_im( void ) -{ - UINT8 t; - IMMBYTE(t); - B |= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $cB ADDB immediate ***** */ -M6809_INLINE void addb_im( void ) -{ - UINT16 t,r; - IMMBYTE(t); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $cC LDD immediate -**0- */ -M6809_INLINE void ldd_im( void ) -{ - IMMWORD(pD); - CLR_NZV; - SET_NZ16(D); -} - -/* is this a legal instruction? */ -/* $cD STD immediate -**0- */ -M6809_INLINE void std_im( void ) -{ - CLR_NZV; - SET_NZ16(D); - IMM16; - WM16(EAD,&pD); -} - -/* $cE LDU (LDS) immediate -**0- */ -M6809_INLINE void ldu_im( void ) -{ - IMMWORD(pU); - CLR_NZV; - SET_NZ16(U); -} - -/* $10cE LDS immediate -**0- */ -M6809_INLINE void lds_im( void ) -{ - IMMWORD(pS); - CLR_NZV; - SET_NZ16(S); - m6809.int_state |= M6809_LDS; -} - -/* is this a legal instruction? */ -/* $cF STU (STS) immediate -**0- */ -M6809_INLINE void stu_im( void ) -{ - CLR_NZV; - SET_NZ16(U); - IMM16; - WM16(EAD,&pU); -} - -/* is this a legal instruction? */ -/* $10cF STS immediate -**0- */ -M6809_INLINE void sts_im( void ) -{ - CLR_NZV; - SET_NZ16(S); - IMM16; - WM16(EAD,&pS); -} - -/* $d0 SUBB direct ?**** */ -M6809_INLINE void subb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $d1 CMPB direct ?**** */ -M6809_INLINE void cmpb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); -} - -/* $d2 SBCB direct ?**** */ -M6809_INLINE void sbcb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $d3 ADDD direct -**** */ -M6809_INLINE void addd_di( void ) -{ - UINT32 r,d; - PAIR b; - DIRWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $d4 ANDB direct -**0- */ -M6809_INLINE void andb_di( void ) -{ - UINT8 t; - DIRBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $d5 BITB direct -**0- */ -M6809_INLINE void bitb_di( void ) -{ - UINT8 t,r; - DIRBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $d6 LDB direct -**0- */ -M6809_INLINE void ldb_di( void ) -{ - DIRBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* $d7 STB direct -**0- */ -M6809_INLINE void stb_di( void ) -{ - CLR_NZV; - SET_NZ8(B); - DIRECT; - WM(EAD,B); -} - -/* $d8 EORB direct -**0- */ -M6809_INLINE void eorb_di( void ) -{ - UINT8 t; - DIRBYTE(t); - B ^= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $d9 ADCB direct ***** */ -M6809_INLINE void adcb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $dA ORB direct -**0- */ -M6809_INLINE void orb_di( void ) -{ - UINT8 t; - DIRBYTE(t); - B |= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $dB ADDB direct ***** */ -M6809_INLINE void addb_di( void ) -{ - UINT16 t,r; - DIRBYTE(t); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $dC LDD direct -**0- */ -M6809_INLINE void ldd_di( void ) -{ - DIRWORD(pD); - CLR_NZV; - SET_NZ16(D); -} - -/* $dD STD direct -**0- */ -M6809_INLINE void std_di( void ) -{ - CLR_NZV; - SET_NZ16(D); - DIRECT; - WM16(EAD,&pD); -} - -/* $dE LDU (LDS) direct -**0- */ -M6809_INLINE void ldu_di( void ) -{ - DIRWORD(pU); - CLR_NZV; - SET_NZ16(U); -} - -/* $10dE LDS direct -**0- */ -M6809_INLINE void lds_di( void ) -{ - DIRWORD(pS); - CLR_NZV; - SET_NZ16(S); - m6809.int_state |= M6809_LDS; -} - -/* $dF STU (STS) direct -**0- */ -M6809_INLINE void stu_di( void ) -{ - CLR_NZV; - SET_NZ16(U); - DIRECT; - WM16(EAD,&pU); -} - -/* $10dF STS direct -**0- */ -M6809_INLINE void sts_di( void ) -{ - CLR_NZV; - SET_NZ16(S); - DIRECT; - WM16(EAD,&pS); -} - -/* $e0 SUBB indexed ?**** */ -M6809_INLINE void subb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $e1 CMPB indexed ?**** */ -M6809_INLINE void cmpb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); -} - -/* $e2 SBCB indexed ?**** */ -M6809_INLINE void sbcb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $e3 ADDD indexed -**** */ -M6809_INLINE void addd_ix( void ) -{ - UINT32 r,d; - PAIR b; - fetch_effective_address(); - b.d=RM16(EAD); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $e4 ANDB indexed -**0- */ -M6809_INLINE void andb_ix( void ) -{ - fetch_effective_address(); - B &= RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $e5 BITB indexed -**0- */ -M6809_INLINE void bitb_ix( void ) -{ - UINT8 r; - fetch_effective_address(); - r = B & RM(EAD); - CLR_NZV; - SET_NZ8(r); -} - -/* $e6 LDB indexed -**0- */ -M6809_INLINE void ldb_ix( void ) -{ - fetch_effective_address(); - B = RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $e7 STB indexed -**0- */ -M6809_INLINE void stb_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ8(B); - WM(EAD,B); -} - -/* $e8 EORB indexed -**0- */ -M6809_INLINE void eorb_ix( void ) -{ - fetch_effective_address(); - B ^= RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $e9 ADCB indexed ***** */ -M6809_INLINE void adcb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $eA ORB indexed -**0- */ -M6809_INLINE void orb_ix( void ) -{ - fetch_effective_address(); - B |= RM(EAD); - CLR_NZV; - SET_NZ8(B); -} - -/* $eB ADDB indexed ***** */ -M6809_INLINE void addb_ix( void ) -{ - UINT16 t,r; - fetch_effective_address(); - t = RM(EAD); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $eC LDD indexed -**0- */ -M6809_INLINE void ldd_ix( void ) -{ - fetch_effective_address(); - D=RM16(EAD); - CLR_NZV; SET_NZ16(D); -} - -/* $eD STD indexed -**0- */ -M6809_INLINE void std_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(D); - WM16(EAD,&pD); -} - -/* $eE LDU (LDS) indexed -**0- */ -M6809_INLINE void ldu_ix( void ) -{ - fetch_effective_address(); - U=RM16(EAD); - CLR_NZV; - SET_NZ16(U); -} - -/* $10eE LDS indexed -**0- */ -M6809_INLINE void lds_ix( void ) -{ - fetch_effective_address(); - S=RM16(EAD); - CLR_NZV; - SET_NZ16(S); - m6809.int_state |= M6809_LDS; -} - -/* $eF STU (STS) indexed -**0- */ -M6809_INLINE void stu_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(U); - WM16(EAD,&pU); -} - -/* $10eF STS indexed -**0- */ -M6809_INLINE void sts_ix( void ) -{ - fetch_effective_address(); - CLR_NZV; - SET_NZ16(S); - WM16(EAD,&pS); -} - -/* $f0 SUBB extended ?**** */ -M6809_INLINE void subb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $f1 CMPB extended ?**** */ -M6809_INLINE void cmpb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B - t; - CLR_NZVC; - SET_FLAGS8(B,t,r); -} - -/* $f2 SBCB extended ?**** */ -M6809_INLINE void sbcb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B - t - (CC & CC_C); - CLR_NZVC; - SET_FLAGS8(B,t,r); - B = r; -} - -/* $f3 ADDD extended -**** */ -M6809_INLINE void addd_ex( void ) -{ - UINT32 r,d; - PAIR b; - EXTWORD(b); - d = D; - r = d + b.d; - CLR_NZVC; - SET_FLAGS16(d,b.d,r); - D = r; -} - -/* $f4 ANDB extended -**0- */ -M6809_INLINE void andb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B &= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $f5 BITB extended -**0- */ -M6809_INLINE void bitb_ex( void ) -{ - UINT8 t,r; - EXTBYTE(t); - r = B & t; - CLR_NZV; - SET_NZ8(r); -} - -/* $f6 LDB extended -**0- */ -M6809_INLINE void ldb_ex( void ) -{ - EXTBYTE(B); - CLR_NZV; - SET_NZ8(B); -} - -/* $f7 STB extended -**0- */ -M6809_INLINE void stb_ex( void ) -{ - CLR_NZV; - SET_NZ8(B); - EXTENDED; - WM(EAD,B); -} - -/* $f8 EORB extended -**0- */ -M6809_INLINE void eorb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B ^= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $f9 ADCB extended ***** */ -M6809_INLINE void adcb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B + t + (CC & CC_C); - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $fA ORB extended -**0- */ -M6809_INLINE void orb_ex( void ) -{ - UINT8 t; - EXTBYTE(t); - B |= t; - CLR_NZV; - SET_NZ8(B); -} - -/* $fB ADDB extended ***** */ -M6809_INLINE void addb_ex( void ) -{ - UINT16 t,r; - EXTBYTE(t); - r = B + t; - CLR_HNZVC; - SET_FLAGS8(B,t,r); - SET_H(B,t,r); - B = r; -} - -/* $fC LDD extended -**0- */ -M6809_INLINE void ldd_ex( void ) -{ - EXTWORD(pD); - CLR_NZV; - SET_NZ16(D); -} - -/* $fD STD extended -**0- */ -M6809_INLINE void std_ex( void ) -{ - CLR_NZV; - SET_NZ16(D); - EXTENDED; - WM16(EAD,&pD); -} - -/* $fE LDU (LDS) extended -**0- */ -M6809_INLINE void ldu_ex( void ) -{ - EXTWORD(pU); - CLR_NZV; - SET_NZ16(U); -} - -/* $10fE LDS extended -**0- */ -M6809_INLINE void lds_ex( void ) -{ - EXTWORD(pS); - CLR_NZV; - SET_NZ16(S); - m6809.int_state |= M6809_LDS; -} - -/* $fF STU (STS) extended -**0- */ -M6809_INLINE void stu_ex( void ) -{ - CLR_NZV; - SET_NZ16(U); - EXTENDED; - WM16(EAD,&pU); -} - -/* $10fF STS extended -**0- */ -M6809_INLINE void sts_ex( void ) -{ - CLR_NZV; - SET_NZ16(S); - EXTENDED; - WM16(EAD,&pS); -} - -/* $10xx opcodes */ -M6809_INLINE void pref10( void ) -{ - UINT8 ireg2 = ROP(PCD); - PC++; - switch( ireg2 ) - { - case 0x21: lbrn(); m6809_ICount-=5; break; - case 0x22: lbhi(); m6809_ICount-=5; break; - case 0x23: lbls(); m6809_ICount-=5; break; - case 0x24: lbcc(); m6809_ICount-=5; break; - case 0x25: lbcs(); m6809_ICount-=5; break; - case 0x26: lbne(); m6809_ICount-=5; break; - case 0x27: lbeq(); m6809_ICount-=5; break; - case 0x28: lbvc(); m6809_ICount-=5; break; - case 0x29: lbvs(); m6809_ICount-=5; break; - case 0x2a: lbpl(); m6809_ICount-=5; break; - case 0x2b: lbmi(); m6809_ICount-=5; break; - case 0x2c: lbge(); m6809_ICount-=5; break; - case 0x2d: lblt(); m6809_ICount-=5; break; - case 0x2e: lbgt(); m6809_ICount-=5; break; - case 0x2f: lble(); m6809_ICount-=5; break; - - case 0x3f: swi2(); m6809_ICount-=20; break; - - case 0x83: cmpd_im(); m6809_ICount-=5; break; - case 0x8c: cmpy_im(); m6809_ICount-=5; break; - case 0x8e: ldy_im(); m6809_ICount-=4; break; - case 0x8f: sty_im(); m6809_ICount-=4; break; - - case 0x93: cmpd_di(); m6809_ICount-=7; break; - case 0x9c: cmpy_di(); m6809_ICount-=7; break; - case 0x9e: ldy_di(); m6809_ICount-=6; break; - case 0x9f: sty_di(); m6809_ICount-=6; break; - - case 0xa3: cmpd_ix(); m6809_ICount-=7; break; - case 0xac: cmpy_ix(); m6809_ICount-=7; break; - case 0xae: ldy_ix(); m6809_ICount-=6; break; - case 0xaf: sty_ix(); m6809_ICount-=6; break; - - case 0xb3: cmpd_ex(); m6809_ICount-=8; break; - case 0xbc: cmpy_ex(); m6809_ICount-=8; break; - case 0xbe: ldy_ex(); m6809_ICount-=7; break; - case 0xbf: sty_ex(); m6809_ICount-=7; break; - - case 0xce: lds_im(); m6809_ICount-=4; break; - case 0xcf: sts_im(); m6809_ICount-=4; break; - - case 0xde: lds_di(); m6809_ICount-=6; break; - case 0xdf: sts_di(); m6809_ICount-=6; break; - - case 0xee: lds_ix(); m6809_ICount-=6; break; - case 0xef: sts_ix(); m6809_ICount-=6; break; - - case 0xfe: lds_ex(); m6809_ICount-=7; break; - case 0xff: sts_ex(); m6809_ICount-=7; break; - - default: illegal(); break; - } -} - -/* $11xx opcodes */ -M6809_INLINE void pref11( void ) -{ - UINT8 ireg2 = ROP(PCD); - PC++; - switch( ireg2 ) - { - case 0x3f: swi3(); m6809_ICount-=20; break; - - case 0x83: cmpu_im(); m6809_ICount-=5; break; - case 0x8c: cmps_im(); m6809_ICount-=5; break; - - case 0x93: cmpu_di(); m6809_ICount-=7; break; - case 0x9c: cmps_di(); m6809_ICount-=7; break; - - case 0xa3: cmpu_ix(); m6809_ICount-=7; break; - case 0xac: cmps_ix(); m6809_ICount-=7; break; - - case 0xb3: cmpu_ex(); m6809_ICount-=8; break; - case 0xbc: cmps_ex(); m6809_ICount-=8; break; - - default: illegal(); break; - } -} - - diff --git a/jan/src/cpu/m6809/6809tbl.c b/jan/src/cpu/m6809/6809tbl.c deleted file mode 100644 index fec237f19..000000000 --- a/jan/src/cpu/m6809/6809tbl.c +++ /dev/null @@ -1,316 +0,0 @@ -M6809_INLINE void abx(void); -M6809_INLINE void adca_di(void); -M6809_INLINE void adca_ex(void); -M6809_INLINE void adca_im(void); -M6809_INLINE void adca_ix(void); -M6809_INLINE void adcb_di(void); -M6809_INLINE void adcb_ex(void); -M6809_INLINE void adcb_im(void); -M6809_INLINE void adcb_ix(void); -M6809_INLINE void adda_di(void); -M6809_INLINE void adda_ex(void); -M6809_INLINE void adda_im(void); -M6809_INLINE void adda_ix(void); -M6809_INLINE void addb_di(void); -M6809_INLINE void addb_ex(void); -M6809_INLINE void addb_im(void); -M6809_INLINE void addb_ix(void); -M6809_INLINE void addd_di(void); -M6809_INLINE void addd_ex(void); -M6809_INLINE void addd_im(void); -M6809_INLINE void addd_ix(void); -M6809_INLINE void anda_di(void); -M6809_INLINE void anda_ex(void); -M6809_INLINE void anda_im(void); -M6809_INLINE void anda_ix(void); -M6809_INLINE void andb_di(void); -M6809_INLINE void andb_ex(void); -M6809_INLINE void andb_im(void); -M6809_INLINE void andb_ix(void); -M6809_INLINE void andcc(void); -M6809_INLINE void asl_di(void); -M6809_INLINE void asl_ex(void); -M6809_INLINE void asl_ix(void); -M6809_INLINE void asla(void); -M6809_INLINE void aslb(void); -M6809_INLINE void asr_di(void); -M6809_INLINE void asr_ex(void); -M6809_INLINE void asr_ix(void); -M6809_INLINE void asra(void); -M6809_INLINE void asrb(void); -M6809_INLINE void bcc(void); -M6809_INLINE void bcs(void); -M6809_INLINE void beq(void); -M6809_INLINE void bge(void); -M6809_INLINE void bgt(void); -M6809_INLINE void bhi(void); -M6809_INLINE void bita_di(void); -M6809_INLINE void bita_ex(void); -M6809_INLINE void bita_im(void); -M6809_INLINE void bita_ix(void); -M6809_INLINE void bitb_di(void); -M6809_INLINE void bitb_ex(void); -M6809_INLINE void bitb_im(void); -M6809_INLINE void bitb_ix(void); -M6809_INLINE void ble(void); -M6809_INLINE void bls(void); -M6809_INLINE void blt(void); -M6809_INLINE void bmi(void); -M6809_INLINE void bne(void); -M6809_INLINE void bpl(void); -M6809_INLINE void bra(void); -M6809_INLINE void brn(void); -M6809_INLINE void bsr(void); -M6809_INLINE void bvc(void); -M6809_INLINE void bvs(void); -M6809_INLINE void clr_di(void); -M6809_INLINE void clr_ex(void); -M6809_INLINE void clr_ix(void); -M6809_INLINE void clra(void); -M6809_INLINE void clrb(void); -M6809_INLINE void cmpa_di(void); -M6809_INLINE void cmpa_ex(void); -M6809_INLINE void cmpa_im(void); -M6809_INLINE void cmpa_ix(void); -M6809_INLINE void cmpb_di(void); -M6809_INLINE void cmpb_ex(void); -M6809_INLINE void cmpb_im(void); -M6809_INLINE void cmpb_ix(void); -M6809_INLINE void cmpd_di(void); -M6809_INLINE void cmpd_ex(void); -M6809_INLINE void cmpd_im(void); -M6809_INLINE void cmpd_ix(void); -M6809_INLINE void cmps_di(void); -M6809_INLINE void cmps_ex(void); -M6809_INLINE void cmps_im(void); -M6809_INLINE void cmps_ix(void); -M6809_INLINE void cmpu_di(void); -M6809_INLINE void cmpu_ex(void); -M6809_INLINE void cmpu_im(void); -M6809_INLINE void cmpu_ix(void); -M6809_INLINE void cmpx_di(void); -M6809_INLINE void cmpx_ex(void); -M6809_INLINE void cmpx_im(void); -M6809_INLINE void cmpx_ix(void); -M6809_INLINE void cmpy_di(void); -M6809_INLINE void cmpy_ex(void); -M6809_INLINE void cmpy_im(void); -M6809_INLINE void cmpy_ix(void); -M6809_INLINE void com_di(void); -M6809_INLINE void com_ex(void); -M6809_INLINE void com_ix(void); -M6809_INLINE void coma(void); -M6809_INLINE void comb(void); -M6809_INLINE void cwai(void); -M6809_INLINE void daa(void); -M6809_INLINE void dec_di(void); -M6809_INLINE void dec_ex(void); -M6809_INLINE void dec_ix(void); -M6809_INLINE void deca(void); -M6809_INLINE void decb(void); -M6809_INLINE void eora_di(void); -M6809_INLINE void eora_ex(void); -M6809_INLINE void eora_im(void); -M6809_INLINE void eora_ix(void); -M6809_INLINE void eorb_di(void); -M6809_INLINE void eorb_ex(void); -M6809_INLINE void eorb_im(void); -M6809_INLINE void eorb_ix(void); -M6809_INLINE void exg(void); -M6809_INLINE void illegal(void); -M6809_INLINE void inc_di(void); -M6809_INLINE void inc_ex(void); -M6809_INLINE void inc_ix(void); -M6809_INLINE void inca(void); -M6809_INLINE void incb(void); -M6809_INLINE void jmp_di(void); -M6809_INLINE void jmp_ex(void); -M6809_INLINE void jmp_ix(void); -M6809_INLINE void jsr_di(void); -M6809_INLINE void jsr_ex(void); -M6809_INLINE void jsr_ix(void); -M6809_INLINE void lbcc(void); -M6809_INLINE void lbcs(void); -M6809_INLINE void lbeq(void); -M6809_INLINE void lbge(void); -M6809_INLINE void lbgt(void); -M6809_INLINE void lbhi(void); -M6809_INLINE void lble(void); -M6809_INLINE void lbls(void); -M6809_INLINE void lblt(void); -M6809_INLINE void lbmi(void); -M6809_INLINE void lbne(void); -M6809_INLINE void lbpl(void); -M6809_INLINE void lbra(void); -M6809_INLINE void lbrn(void); -M6809_INLINE void lbsr(void); -M6809_INLINE void lbvc(void); -M6809_INLINE void lbvs(void); -M6809_INLINE void lda_di(void); -M6809_INLINE void lda_ex(void); -M6809_INLINE void lda_im(void); -M6809_INLINE void lda_ix(void); -M6809_INLINE void ldb_di(void); -M6809_INLINE void ldb_ex(void); -M6809_INLINE void ldb_im(void); -M6809_INLINE void ldb_ix(void); -M6809_INLINE void ldd_di(void); -M6809_INLINE void ldd_ex(void); -M6809_INLINE void ldd_im(void); -M6809_INLINE void ldd_ix(void); -M6809_INLINE void lds_di(void); -M6809_INLINE void lds_ex(void); -M6809_INLINE void lds_im(void); -M6809_INLINE void lds_ix(void); -M6809_INLINE void ldu_di(void); -M6809_INLINE void ldu_ex(void); -M6809_INLINE void ldu_im(void); -M6809_INLINE void ldu_ix(void); -M6809_INLINE void ldx_di(void); -M6809_INLINE void ldx_ex(void); -M6809_INLINE void ldx_im(void); -M6809_INLINE void ldx_ix(void); -M6809_INLINE void ldy_di(void); -M6809_INLINE void ldy_ex(void); -M6809_INLINE void ldy_im(void); -M6809_INLINE void ldy_ix(void); -M6809_INLINE void leas(void); -M6809_INLINE void leau(void); -M6809_INLINE void leax(void); -M6809_INLINE void leay(void); -M6809_INLINE void lsr_di(void); -M6809_INLINE void lsr_ex(void); -M6809_INLINE void lsr_ix(void); -M6809_INLINE void lsra(void); -M6809_INLINE void lsrb(void); -M6809_INLINE void mul(void); -M6809_INLINE void neg_di(void); -M6809_INLINE void neg_ex(void); -M6809_INLINE void neg_ix(void); -M6809_INLINE void nega(void); -M6809_INLINE void negb(void); -M6809_INLINE void nop(void); -M6809_INLINE void ora_di(void); -M6809_INLINE void ora_ex(void); -M6809_INLINE void ora_im(void); -M6809_INLINE void ora_ix(void); -M6809_INLINE void orb_di(void); -M6809_INLINE void orb_ex(void); -M6809_INLINE void orb_im(void); -M6809_INLINE void orb_ix(void); -M6809_INLINE void orcc(void); -M6809_INLINE void pshs(void); -M6809_INLINE void pshu(void); -M6809_INLINE void puls(void); -M6809_INLINE void pulu(void); -M6809_INLINE void rol_di(void); -M6809_INLINE void rol_ex(void); -M6809_INLINE void rol_ix(void); -M6809_INLINE void rola(void); -M6809_INLINE void rolb(void); -M6809_INLINE void ror_di(void); -M6809_INLINE void ror_ex(void); -M6809_INLINE void ror_ix(void); -M6809_INLINE void rora(void); -M6809_INLINE void rorb(void); -M6809_INLINE void rti(void); -M6809_INLINE void rts(void); -M6809_INLINE void sbca_di(void); -M6809_INLINE void sbca_ex(void); -M6809_INLINE void sbca_im(void); -M6809_INLINE void sbca_ix(void); -M6809_INLINE void sbcb_di(void); -M6809_INLINE void sbcb_ex(void); -M6809_INLINE void sbcb_im(void); -M6809_INLINE void sbcb_ix(void); -M6809_INLINE void sex(void); -M6809_INLINE void sta_di(void); -M6809_INLINE void sta_ex(void); -M6809_INLINE void sta_im(void); -M6809_INLINE void sta_ix(void); -M6809_INLINE void stb_di(void); -M6809_INLINE void stb_ex(void); -M6809_INLINE void stb_im(void); -M6809_INLINE void stb_ix(void); -M6809_INLINE void std_di(void); -M6809_INLINE void std_ex(void); -M6809_INLINE void std_im(void); -M6809_INLINE void std_ix(void); -M6809_INLINE void sts_di(void); -M6809_INLINE void sts_ex(void); -M6809_INLINE void sts_im(void); -M6809_INLINE void sts_ix(void); -M6809_INLINE void stu_di(void); -M6809_INLINE void stu_ex(void); -M6809_INLINE void stu_im(void); -M6809_INLINE void stu_ix(void); -M6809_INLINE void stx_di(void); -M6809_INLINE void stx_ex(void); -M6809_INLINE void stx_im(void); -M6809_INLINE void stx_ix(void); -M6809_INLINE void sty_di(void); -M6809_INLINE void sty_ex(void); -M6809_INLINE void sty_im(void); -M6809_INLINE void sty_ix(void); -M6809_INLINE void suba_di(void); -M6809_INLINE void suba_ex(void); -M6809_INLINE void suba_im(void); -M6809_INLINE void suba_ix(void); -M6809_INLINE void subb_di(void); -M6809_INLINE void subb_ex(void); -M6809_INLINE void subb_im(void); -M6809_INLINE void subb_ix(void); -M6809_INLINE void subd_di(void); -M6809_INLINE void subd_ex(void); -M6809_INLINE void subd_im(void); -M6809_INLINE void subd_ix(void); -M6809_INLINE void swi(void); -M6809_INLINE void swi2(void); -M6809_INLINE void swi3(void); -M6809_INLINE void sync(void); -M6809_INLINE void tfr(void); -M6809_INLINE void tst_di(void); -M6809_INLINE void tst_ex(void); -M6809_INLINE void tst_ix(void); -M6809_INLINE void tsta(void); -M6809_INLINE void tstb(void); - -M6809_INLINE void pref10(void); -M6809_INLINE void pref11(void); - -#if (BIG_SWITCH==0) -static void (*const m6809_main[0x100])(void) = { - neg_di, neg_di, illegal,com_di, lsr_di, illegal,ror_di, asr_di, /* 00 */ - asl_di, rol_di, dec_di, illegal,inc_di, tst_di, jmp_di, clr_di, - pref10, pref11, nop, sync, illegal,illegal,lbra, lbsr, /* 10 */ - illegal,daa, orcc, illegal,andcc, sex, exg, tfr, - bra, brn, bhi, bls, bcc, bcs, bne, beq, /* 20 */ - bvc, bvs, bpl, bmi, bge, blt, bgt, ble, - leax, leay, leas, leau, pshs, puls, pshu, pulu, /* 30 */ - illegal,rts, abx, rti, cwai, mul, illegal,swi, - nega, illegal,illegal,coma, lsra, illegal,rora, asra, /* 40 */ - asla, rola, deca, illegal,inca, tsta, illegal,clra, - negb, illegal,illegal,comb, lsrb, illegal,rorb, asrb, /* 50 */ - aslb, rolb, decb, illegal,incb, tstb, illegal,clrb, - neg_ix, illegal,illegal,com_ix, lsr_ix, illegal,ror_ix, asr_ix, /* 60 */ - asl_ix, rol_ix, dec_ix, illegal,inc_ix, tst_ix, jmp_ix, clr_ix, - neg_ex, illegal,illegal,com_ex, lsr_ex, illegal,ror_ex, asr_ex, /* 70 */ - asl_ex, rol_ex, dec_ex, illegal,inc_ex, tst_ex, jmp_ex, clr_ex, - suba_im,cmpa_im,sbca_im,subd_im,anda_im,bita_im,lda_im, sta_im, /* 80 */ - eora_im,adca_im,ora_im, adda_im,cmpx_im,bsr, ldx_im, stx_im, - suba_di,cmpa_di,sbca_di,subd_di,anda_di,bita_di,lda_di, sta_di, /* 90 */ - eora_di,adca_di,ora_di, adda_di,cmpx_di,jsr_di, ldx_di, stx_di, - suba_ix,cmpa_ix,sbca_ix,subd_ix,anda_ix,bita_ix,lda_ix, sta_ix, /* a0 */ - eora_ix,adca_ix,ora_ix, adda_ix,cmpx_ix,jsr_ix, ldx_ix, stx_ix, - suba_ex,cmpa_ex,sbca_ex,subd_ex,anda_ex,bita_ex,lda_ex, sta_ex, /* b0 */ - eora_ex,adca_ex,ora_ex, adda_ex,cmpx_ex,jsr_ex, ldx_ex, stx_ex, - subb_im,cmpb_im,sbcb_im,addd_im,andb_im,bitb_im,ldb_im, stb_im, /* c0 */ - eorb_im,adcb_im,orb_im, addb_im,ldd_im, std_im, ldu_im, stu_im, - subb_di,cmpb_di,sbcb_di,addd_di,andb_di,bitb_di,ldb_di, stb_di, /* d0 */ - eorb_di,adcb_di,orb_di, addb_di,ldd_di, std_di, ldu_di, stu_di, - subb_ix,cmpb_ix,sbcb_ix,addd_ix,andb_ix,bitb_ix,ldb_ix, stb_ix, /* e0 */ - eorb_ix,adcb_ix,orb_ix, addb_ix,ldd_ix, std_ix, ldu_ix, stu_ix, - subb_ex,cmpb_ex,sbcb_ex,addd_ex,andb_ex,bitb_ex,ldb_ex, stb_ex, /* f0 */ - eorb_ex,adcb_ex,orb_ex, addb_ex,ldd_ex, std_ex, ldu_ex, stu_ex -}; -#endif diff --git a/jan/src/cpu/m6809/m6809.cpp b/jan/src/cpu/m6809/m6809.cpp deleted file mode 100644 index 73f57b8d8..000000000 --- a/jan/src/cpu/m6809/m6809.cpp +++ /dev/null @@ -1,1241 +0,0 @@ -/*** m6809: Portable 6809 emulator ****************************************** - - Copyright John Butler - - References: - - 6809 Simulator V09, By L.C. Benschop, Eidnhoven The Netherlands. - - m6809: Portable 6809 emulator, DS (6809 code in MAME, derived from - the 6809 Simulator V09) - - 6809 Microcomputer Programming & Interfacing with Experiments" - by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits - arrays up to 65536 bytes must be supported - machine must be twos complement - - History: -991026 HJB: - Fixed missing calls to cpu_changepc() for the TFR and EXG ocpodes. - Replaced m6809_slapstic checks by a macro (CHANGE_PC). ESB still - needs the tweaks. - -991024 HJB: - Tried to improve speed: Using bit7 of cycles1/2 as flag for multi - byte opcodes is gone, those opcodes now call fetch_effective_address(). - Got rid of the slow/fast flags for stack (S and U) memory accesses. - Minor changes to use 32 bit values as arguments to memory functions - and added defines for that purpose (e.g. X = 16bit XD = 32bit). - -990312 HJB: - Added bugfixes according to Aaron's findings. - Reset only sets CC_II and CC_IF, DP to zero and PC from reset vector. -990311 HJB: - Added _info functions. Now uses static m6808_Regs struct instead - of single statics. Changed the 16 bit registers to use the generic - PAIR union. Registers defined using macros. Split the core into - four execution loops for M6802, M6803, M6808 and HD63701. - TST, TSTA and TSTB opcodes reset carry flag. - Modified the read/write stack handlers to push LSB first then MSB - and pull MSB first then LSB. - -990228 HJB: - Changed the interrupt handling again. Now interrupts are taken - either right at the moment the lines are asserted or whenever - an interrupt is enabled and the corresponding line is still - asserted. That way the pending_interrupts checks are not - needed anymore. However, the CWAI and SYNC flags still need - some flags, so I changed the name to 'int_state'. - This core also has the code for the old interrupt system removed. - -990225 HJB: - Cleaned up the code here and there, added some comments. - Slightly changed the SAR opcodes (similiar to other CPU cores). - Added symbolic names for the flag bits. - Changed the way CWAI/Interrupt() handle CPU state saving. - A new flag M6809_STATE in pending_interrupts is used to determine - if a state save is needed on interrupt entry or already done by CWAI. - Added M6809_IRQ_LINE and M6809_FIRQ_LINE defines to m6809.h - Moved the internal interrupt_pending flags from m6809.h to m6809.c - Changed CWAI cycles2[0x3c] to be 2 (plus all or at least 19 if - CWAI actually pushes the entire state). - Implemented undocumented TFR/EXG for undefined source and mixed 8/16 - bit transfers (they should transfer/exchange the constant $ff). - Removed unused jmp/jsr _slap functions from 6809ops.c, - m6809_slapstick check moved into the opcode functions. - -*****************************************************************************/ - -//#include "debugger.h" -#include "burnint.h" -#include "m6809.h" - -/* Enable big switch statement for the main opcodes */ -#ifndef BIG_SWITCH -#define BIG_SWITCH 1 -#endif - -#define VERBOSE 0 - -#define LOG(x) do { if (VERBOSE) logerror x; } while (0) - -//extern offs_t m6809_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - -#define M6809_INLINE static -#define change_pc(newpc) m6809.pc.w.l = (newpc) -#define M6809_CLEAR_LINE 0 -#define M6809_INPUT_LINE_NMI 32 - -M6809_INLINE void fetch_effective_address( void ); - -/* flag bits in the cc register */ -#define CC_C 0x01 /* Carry */ -#define CC_V 0x02 /* Overflow */ -#define CC_Z 0x04 /* Zero */ -#define CC_N 0x08 /* Negative */ -#define CC_II 0x10 /* Inhibit IRQ */ -#define CC_H 0x20 /* Half (auxiliary) carry */ -#define CC_IF 0x40 /* Inhibit FIRQ */ -#define CC_E 0x80 /* entire state pushed */ - -/* 6809 registers */ -static m6809_Regs m6809; - -#define pPPC m6809.ppc -#define pPC m6809.pc -#define pU m6809.u -#define pS m6809.s -#define pX m6809.x -#define pY m6809.y -#define pD m6809.d - -#define PPC m6809.ppc.w.l -#define PC m6809.pc.w.l -#define PCD m6809.pc.d -#define U m6809.u.w.l -#define UD m6809.u.d -#define S m6809.s.w.l -#define SD m6809.s.d -#define X m6809.x.w.l -#define XD m6809.x.d -#define Y m6809.y.w.l -#define YD m6809.y.d -#define D m6809.d.w.l -#define A m6809.d.b.h -#define B m6809.d.b.l -#define DP m6809.dp.b.h -#define DPD m6809.dp.d -#define CC m6809.cc - -#define ea m6809.ea -#define EA ea.w.l -#define EAD ea.d -#define EAB ea.b.l - -#define CHANGE_PC change_pc(PCD) - -#define M6809_CWAI 8 /* set when CWAI is waiting for an interrupt */ -#define M6809_SYNC 16 /* set when SYNC is waiting for an interrupt */ -#define M6809_LDS 32 /* set when LDS occured at least once */ - -#define CHECK_IRQ_LINES \ - if( m6809.irq_state[M6809_IRQ_LINE] != M6809_CLEAR_LINE || \ - m6809.irq_state[M6809_FIRQ_LINE] != M6809_CLEAR_LINE ) \ - m6809.int_state &= ~M6809_SYNC; /* clear SYNC flag */ \ - if( m6809.irq_state[M6809_FIRQ_LINE]!=M6809_CLEAR_LINE && !(CC & CC_IF) ) \ - { \ - /* fast IRQ */ \ - /* HJB 990225: state already saved by CWAI? */ \ - if( m6809.int_state & M6809_CWAI ) \ - { \ - m6809.int_state &= ~M6809_CWAI; /* clear CWAI */ \ - m6809.extra_cycles += 7; /* subtract +7 cycles */ \ - } \ - else \ - { \ - CC &= ~CC_E; /* save 'short' state */ \ - PUSHWORD(pPC); \ - PUSHBYTE(CC); \ - m6809.extra_cycles += 10; /* subtract +10 cycles */ \ - } \ - CC |= CC_IF | CC_II; /* inhibit FIRQ and IRQ */ \ - PCD=RM16(0xfff6); \ - CHANGE_PC; \ - if (m6809.irq_hold[M6809_FIRQ_LINE]) \ - m6809_set_irq_line(M6809_FIRQ_LINE, 0); \ - } \ - else \ - if( m6809.irq_state[M6809_IRQ_LINE]!=M6809_CLEAR_LINE && !(CC & CC_II) ) \ - { \ - /* standard IRQ */ \ - /* HJB 990225: state already saved by CWAI? */ \ - if( m6809.int_state & M6809_CWAI ) \ - { \ - m6809.int_state &= ~M6809_CWAI; /* clear CWAI flag */ \ - m6809.extra_cycles += 7; /* subtract +7 cycles */ \ - } \ - else \ - { \ - CC |= CC_E; /* save entire state */ \ - PUSHWORD(pPC); \ - PUSHWORD(pU); \ - PUSHWORD(pY); \ - PUSHWORD(pX); \ - PUSHBYTE(DP); \ - PUSHBYTE(B); \ - PUSHBYTE(A); \ - PUSHBYTE(CC); \ - m6809.extra_cycles += 19; /* subtract +19 cycles */ \ - } \ - CC |= CC_II; /* inhibit IRQ */ \ - PCD=RM16(0xfff8); \ - CHANGE_PC; \ - if (m6809.irq_hold[M6809_IRQ_LINE]) \ - m6809_set_irq_line(M6809_IRQ_LINE, 0); \ - } - -/* public globals */ -static int m6809_ICount; - -/* these are re-defined in m6809.h TO RAM, ROM or functions in cpuintrf.c */ -#define RM(Addr) M6809_RDMEM(Addr) -#define WM(Addr,Value) M6809_WRMEM(Addr,Value) -#define ROP(Addr) M6809_RDOP(Addr) -#define ROP_ARG(Addr) M6809_RDOP_ARG(Addr) - -/* macros to access memory */ -#define IMMBYTE(b) b = ROP_ARG(PCD); PC++ -#define IMMWORD(w) w.d = (ROP_ARG(PCD)<<8) | ROP_ARG((PCD+1)&0xffff); PC+=2 - -#define PUSHBYTE(b) --S; WM(SD,b) -#define PUSHWORD(w) --S; WM(SD,w.b.l); --S; WM(SD,w.b.h) -#define PULLBYTE(b) b = RM(SD); S++ -#define PULLWORD(w) w = RM(SD)<<8; S++; w |= RM(SD); S++ - -#define PSHUBYTE(b) --U; WM(UD,b); -#define PSHUWORD(w) --U; WM(UD,w.b.l); --U; WM(UD,w.b.h) -#define PULUBYTE(b) b = RM(UD); U++ -#define PULUWORD(w) w = RM(UD)<<8; U++; w |= RM(UD); U++ - -#define CLR_HNZVC CC&=~(CC_H|CC_N|CC_Z|CC_V|CC_C) -#define CLR_NZV CC&=~(CC_N|CC_Z|CC_V) -#define CLR_NZ CC&=~(CC_N|CC_Z) -#define CLR_HNZC CC&=~(CC_H|CC_N|CC_Z|CC_C) -#define CLR_NZVC CC&=~(CC_N|CC_Z|CC_V|CC_C) -#define CLR_Z CC&=~(CC_Z) -#define CLR_NZC CC&=~(CC_N|CC_Z|CC_C) -#define CLR_ZC CC&=~(CC_Z|CC_C) - -/* macros for CC -- CC bits affected should be reset before calling */ -#define SET_Z(a) if(!a)SEZ -#define SET_Z8(a) SET_Z((UINT8)a) -#define SET_Z16(a) SET_Z((UINT16)a) -#define SET_N8(a) CC|=((a&0x80)>>4) -#define SET_N16(a) CC|=((a&0x8000)>>12) -#define SET_H(a,b,r) CC|=(((a^b^r)&0x10)<<1) -#define SET_C8(a) CC|=((a&0x100)>>8) -#define SET_C16(a) CC|=((a&0x10000)>>16) -#define SET_V8(a,b,r) CC|=(((a^b^r^(r>>1))&0x80)>>6) -#define SET_V16(a,b,r) CC|=(((a^b^r^(r>>1))&0x8000)>>14) - -static const UINT8 flags8i[256]= /* increment */ -{ -CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -CC_N|CC_V,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N -}; -static const UINT8 flags8d[256]= /* decrement */ -{ -CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,CC_V, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N, -CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N -}; -#define SET_FLAGS8I(a) {CC|=flags8i[(a)&0xff];} -#define SET_FLAGS8D(a) {CC|=flags8d[(a)&0xff];} - -/* combos */ -#define SET_NZ8(a) {SET_N8(a);SET_Z(a);} -#define SET_NZ16(a) {SET_N16(a);SET_Z(a);} -#define SET_FLAGS8(a,b,r) {SET_N8(r);SET_Z8(r);SET_V8(a,b,r);SET_C8(r);} -#define SET_FLAGS16(a,b,r) {SET_N16(r);SET_Z16(r);SET_V16(a,b,r);SET_C16(r);} - -/* for treating an unsigned byte as a signed word */ -#define SIGNED(b) ((UINT16)(b&0x80?b|0xff00:b)) - -/* macros for addressing modes (postbytes have their own code) */ -#define DIRECT EAD = DPD; IMMBYTE(EAB) -#define IMM8 EAD = PCD; PC++ -#define IMM16 EAD = PCD; PC+=2 -#define EXTENDED IMMWORD(ea) - -/* macros to set status flags */ -#if defined(SEC) -#undef SEC -#endif -#define SEC CC|=CC_C -#define CLC CC&=~CC_C -#define SEZ CC|=CC_Z -#define CLZ CC&=~CC_Z -#define SEN CC|=CC_N -#define CLN CC&=~CC_N -#define SEV CC|=CC_V -#define CLV CC&=~CC_V -#define SEH CC|=CC_H -#define CLH CC&=~CC_H - -/* macros for convenience */ -#define DIRBYTE(b) {DIRECT;b=RM(EAD);} -#define DIRWORD(w) {DIRECT;w.d=RM16(EAD);} -#define EXTBYTE(b) {EXTENDED;b=RM(EAD);} -#define EXTWORD(w) {EXTENDED;w.d=RM16(EAD);} - -/* macros for branch instructions */ -#define BRANCH(f) { \ - UINT8 t; \ - IMMBYTE(t); \ - if( f ) \ - { \ - PC += SIGNED(t); \ - CHANGE_PC; \ - } \ -} - -#define LBRANCH(f) { \ - PAIR t; \ - IMMWORD(t); \ - if( f ) \ - { \ - m6809_ICount -= 1; \ - PC += t.w.l; \ - CHANGE_PC; \ - } \ -} - -#define NXORV ((CC&CC_N)^((CC&CC_V)<<2)) - -/* macros for setting/getting registers in TFR/EXG instructions */ - -#if (!BIG_SWITCH) -/* timings for 1-byte opcodes */ -static const UINT8 cycles1[] = -{ - /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ - /*0*/ 6, 0, 0, 6, 6, 0, 6, 6, 6, 6, 6, 0, 6, 6, 3, 6, - /*1*/ 0, 0, 2, 4, 0, 0, 5, 9, 0, 2, 3, 0, 3, 2, 8, 6, - /*2*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - /*3*/ 4, 4, 4, 4, 5, 5, 5, 5, 0, 5, 3, 6,20,11, 0,19, - /*4*/ 2, 0, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 0, 2, - /*5*/ 2, 0, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 0, 2, - /*6*/ 6, 0, 0, 6, 6, 0, 6, 6, 6, 6, 6, 0, 6, 6, 3, 6, - /*7*/ 7, 0, 0, 7, 7, 0, 7, 7, 7, 7, 7, 0, 7, 7, 4, 7, - /*8*/ 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 4, 7, 3, 0, - /*9*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 6, 7, 5, 5, - /*A*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 6, 7, 5, 5, - /*B*/ 5, 5, 5, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 8, 6, 6, - /*C*/ 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 3, 3, - /*D*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, - /*E*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, - /*F*/ 5, 5, 5, 7, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6 -}; -#endif - -M6809_INLINE UINT32 RM16( UINT32 Addr ) -{ - UINT32 result = RM(Addr) << 8; - return result | RM((Addr+1)&0xffff); -} - -M6809_INLINE void WM16( UINT32 Addr, PAIR *p ) -{ - WM( Addr, p->b.h ); - WM( (Addr+1)&0xffff, p->b.l ); -} - -/**************************************************************************** - * Get all registers in given buffer - ****************************************************************************/ -void m6809_get_context(void *dst) -{ - if( dst ) - *(m6809_Regs*)dst = m6809; -} - -/**************************************************************************** - * Set all registers to given values - ****************************************************************************/ -void m6809_set_context(void *src) -{ - if( src ) - m6809 = *(m6809_Regs*)src; - CHANGE_PC; - - CHECK_IRQ_LINES; -} - - -/****************************************************************************/ -/* Reset registers to their initial values */ -/****************************************************************************/ -void m6809_init(int (*irqcallback)(int)) -{ -// state_save_register_item("m6809", index, PC); -// state_save_register_item("m6809", index, PPC); -// state_save_register_item("m6809", index, D); -// state_save_register_item("m6809", index, DP); -// state_save_register_item("m6809", index, U); -// state_save_register_item("m6809", index, S); -// state_save_register_item("m6809", index, X); -// state_save_register_item("m6809", index, Y); -// state_save_register_item("m6809", index, CC); -// state_save_register_item_array("m6809", index, m6809.irq_state); -// state_save_register_item("m6809", index, m6809.int_state); -// state_save_register_item("m6809", index, m6809.nmi_state); - - m6809.irq_callback = irqcallback; -} - -void m6809_reset(void) -{ - m6809.int_state = 0; - m6809.nmi_state = M6809_CLEAR_LINE; - m6809.irq_state[0] = M6809_CLEAR_LINE; - m6809.irq_state[1] = M6809_CLEAR_LINE; - - DPD = 0; /* Reset direct page register */ - - CC |= CC_II; /* IRQ disabled */ - CC |= CC_IF; /* FIRQ disabled */ - - PCD = RM16(0xfffe); - CHANGE_PC; -} - -void m6809_reset_hard(void) -{ - int (*irq_callback)(int irqline) = m6809.irq_callback; - memset(&m6809, 0, sizeof(m6809)); - m6809.irq_callback = irq_callback; - - m6809_reset(); -} - -/* -static void m6809_exit(void) -{ - -}*/ - -/* Generate interrupts */ -/**************************************************************************** - * Set IRQ line state - ****************************************************************************/ -void m6809_set_irq_line(int irqline, int state) -{ - int hold = 0; - - if (state == 2) { hold = 1; state = 1; } - - if (irqline == M6809_INPUT_LINE_NMI) - { - if (m6809.nmi_state == state) return; - m6809.nmi_state = state; -// LOG(("M6809#%d set_irq_line (NMI) %d\n", cpu_getactivecpu(), state)); - if( state == M6809_CLEAR_LINE ) return; - - /* if the stack was not yet initialized */ - if( !(m6809.int_state & M6809_LDS) ) return; - - m6809.int_state &= ~M6809_SYNC; - /* HJB 990225: state already saved by CWAI? */ - if( m6809.int_state & M6809_CWAI ) - { - m6809.int_state &= ~M6809_CWAI; - m6809.extra_cycles += 7; /* subtract +7 cycles next time */ - } - else - { - CC |= CC_E; /* save entire state */ - PUSHWORD(pPC); - PUSHWORD(pU); - PUSHWORD(pY); - PUSHWORD(pX); - PUSHBYTE(DP); - PUSHBYTE(B); - PUSHBYTE(A); - PUSHBYTE(CC); - m6809.extra_cycles += 19; /* subtract +19 cycles next time */ - } - CC |= CC_IF | CC_II; /* inhibit FIRQ and IRQ */ - PCD = RM16(0xfffc); - CHANGE_PC; - } - else if (irqline < 2) - { -// LOG(("M6809#%d set_irq_line %d, %d\n", cpu_getactivecpu(), irqline, state)); - m6809.irq_state[irqline] = state; - m6809.irq_hold[irqline] = hold; - if (state == M6809_CLEAR_LINE) return; - CHECK_IRQ_LINES; - } -} - -/* includes the static function prototypes and the master opcode table */ -#include "6809tbl.c" - -/* includes the actual opcode implementations */ -#include "6809ops.c" - -UINT16 m6809_get_pc() -{ - return m6809.pc.w.l; -} - -/* execute instructions on this CPU until icount expires */ -int m6809_execute(int cycles) /* NS 970908 */ -{ - m6809_ICount = cycles - m6809.extra_cycles; - m6809.extra_cycles = 0; - - if (m6809.int_state & (M6809_CWAI | M6809_SYNC)) - { -// debugger_instruction_hook(Machine, PCD); - m6809_ICount = 0; - } - else - { - do - { - pPPC = pPC; - -// debugger_instruction_hook(Machine, PCD); - - m6809.ireg = ROP(PCD); - PC++; -#if BIG_SWITCH - switch( m6809.ireg ) - { - case 0x00: neg_di(); m6809_ICount-= 6; break; - case 0x01: neg_di(); m6809_ICount-= 6; break; /* undocumented */ - case 0x02: illegal(); m6809_ICount-= 2; break; - case 0x03: com_di(); m6809_ICount-= 6; break; - case 0x04: lsr_di(); m6809_ICount-= 6; break; - case 0x05: illegal(); m6809_ICount-= 2; break; - case 0x06: ror_di(); m6809_ICount-= 6; break; - case 0x07: asr_di(); m6809_ICount-= 6; break; - case 0x08: asl_di(); m6809_ICount-= 6; break; - case 0x09: rol_di(); m6809_ICount-= 6; break; - case 0x0a: dec_di(); m6809_ICount-= 6; break; - case 0x0b: illegal(); m6809_ICount-= 2; break; - case 0x0c: inc_di(); m6809_ICount-= 6; break; - case 0x0d: tst_di(); m6809_ICount-= 6; break; - case 0x0e: jmp_di(); m6809_ICount-= 3; break; - case 0x0f: clr_di(); m6809_ICount-= 6; break; - case 0x10: pref10(); break; - case 0x11: pref11(); break; - case 0x12: nop(); m6809_ICount-= 2; break; - case 0x13: sync(); m6809_ICount-= 4; break; - case 0x14: illegal(); m6809_ICount-= 2; break; - case 0x15: illegal(); m6809_ICount-= 2; break; - case 0x16: lbra(); m6809_ICount-= 5; break; - case 0x17: lbsr(); m6809_ICount-= 9; break; - case 0x18: illegal(); m6809_ICount-= 2; break; - case 0x19: daa(); m6809_ICount-= 2; break; - case 0x1a: orcc(); m6809_ICount-= 3; break; - case 0x1b: illegal(); m6809_ICount-= 2; break; - case 0x1c: andcc(); m6809_ICount-= 3; break; - case 0x1d: sex(); m6809_ICount-= 2; break; - case 0x1e: exg(); m6809_ICount-= 8; break; - case 0x1f: tfr(); m6809_ICount-= 6; break; - case 0x20: bra(); m6809_ICount-= 3; break; - case 0x21: brn(); m6809_ICount-= 3; break; - case 0x22: bhi(); m6809_ICount-= 3; break; - case 0x23: bls(); m6809_ICount-= 3; break; - case 0x24: bcc(); m6809_ICount-= 3; break; - case 0x25: bcs(); m6809_ICount-= 3; break; - case 0x26: bne(); m6809_ICount-= 3; break; - case 0x27: beq(); m6809_ICount-= 3; break; - case 0x28: bvc(); m6809_ICount-= 3; break; - case 0x29: bvs(); m6809_ICount-= 3; break; - case 0x2a: bpl(); m6809_ICount-= 3; break; - case 0x2b: bmi(); m6809_ICount-= 3; break; - case 0x2c: bge(); m6809_ICount-= 3; break; - case 0x2d: blt(); m6809_ICount-= 3; break; - case 0x2e: bgt(); m6809_ICount-= 3; break; - case 0x2f: ble(); m6809_ICount-= 3; break; - case 0x30: leax(); m6809_ICount-= 4; break; - case 0x31: leay(); m6809_ICount-= 4; break; - case 0x32: leas(); m6809_ICount-= 4; break; - case 0x33: leau(); m6809_ICount-= 4; break; - case 0x34: pshs(); m6809_ICount-= 5; break; - case 0x35: puls(); m6809_ICount-= 5; break; - case 0x36: pshu(); m6809_ICount-= 5; break; - case 0x37: pulu(); m6809_ICount-= 5; break; - case 0x38: illegal(); m6809_ICount-= 2; break; - case 0x39: rts(); m6809_ICount-= 5; break; - case 0x3a: abx(); m6809_ICount-= 3; break; - case 0x3b: rti(); m6809_ICount-= 6; break; - case 0x3c: cwai(); m6809_ICount-=20; break; - case 0x3d: mul(); m6809_ICount-=11; break; - case 0x3e: illegal(); m6809_ICount-= 2; break; - case 0x3f: swi(); m6809_ICount-=19; break; - case 0x40: nega(); m6809_ICount-= 2; break; - case 0x41: illegal(); m6809_ICount-= 2; break; - case 0x42: illegal(); m6809_ICount-= 2; break; - case 0x43: coma(); m6809_ICount-= 2; break; - case 0x44: lsra(); m6809_ICount-= 2; break; - case 0x45: illegal(); m6809_ICount-= 2; break; - case 0x46: rora(); m6809_ICount-= 2; break; - case 0x47: asra(); m6809_ICount-= 2; break; - case 0x48: asla(); m6809_ICount-= 2; break; - case 0x49: rola(); m6809_ICount-= 2; break; - case 0x4a: deca(); m6809_ICount-= 2; break; - case 0x4b: illegal(); m6809_ICount-= 2; break; - case 0x4c: inca(); m6809_ICount-= 2; break; - case 0x4d: tsta(); m6809_ICount-= 2; break; - case 0x4e: illegal(); m6809_ICount-= 2; break; - case 0x4f: clra(); m6809_ICount-= 2; break; - case 0x50: negb(); m6809_ICount-= 2; break; - case 0x51: illegal(); m6809_ICount-= 2; break; - case 0x52: illegal(); m6809_ICount-= 2; break; - case 0x53: comb(); m6809_ICount-= 2; break; - case 0x54: lsrb(); m6809_ICount-= 2; break; - case 0x55: illegal(); m6809_ICount-= 2; break; - case 0x56: rorb(); m6809_ICount-= 2; break; - case 0x57: asrb(); m6809_ICount-= 2; break; - case 0x58: aslb(); m6809_ICount-= 2; break; - case 0x59: rolb(); m6809_ICount-= 2; break; - case 0x5a: decb(); m6809_ICount-= 2; break; - case 0x5b: illegal(); m6809_ICount-= 2; break; - case 0x5c: incb(); m6809_ICount-= 2; break; - case 0x5d: tstb(); m6809_ICount-= 2; break; - case 0x5e: illegal(); m6809_ICount-= 2; break; - case 0x5f: clrb(); m6809_ICount-= 2; break; - case 0x60: neg_ix(); m6809_ICount-= 6; break; - case 0x61: illegal(); m6809_ICount-= 2; break; - case 0x62: illegal(); m6809_ICount-= 2; break; - case 0x63: com_ix(); m6809_ICount-= 6; break; - case 0x64: lsr_ix(); m6809_ICount-= 6; break; - case 0x65: illegal(); m6809_ICount-= 2; break; - case 0x66: ror_ix(); m6809_ICount-= 6; break; - case 0x67: asr_ix(); m6809_ICount-= 6; break; - case 0x68: asl_ix(); m6809_ICount-= 6; break; - case 0x69: rol_ix(); m6809_ICount-= 6; break; - case 0x6a: dec_ix(); m6809_ICount-= 6; break; - case 0x6b: illegal(); m6809_ICount-= 2; break; - case 0x6c: inc_ix(); m6809_ICount-= 6; break; - case 0x6d: tst_ix(); m6809_ICount-= 6; break; - case 0x6e: jmp_ix(); m6809_ICount-= 3; break; - case 0x6f: clr_ix(); m6809_ICount-= 6; break; - case 0x70: neg_ex(); m6809_ICount-= 7; break; - case 0x71: illegal(); m6809_ICount-= 2; break; - case 0x72: illegal(); m6809_ICount-= 2; break; - case 0x73: com_ex(); m6809_ICount-= 7; break; - case 0x74: lsr_ex(); m6809_ICount-= 7; break; - case 0x75: illegal(); m6809_ICount-= 2; break; - case 0x76: ror_ex(); m6809_ICount-= 7; break; - case 0x77: asr_ex(); m6809_ICount-= 7; break; - case 0x78: asl_ex(); m6809_ICount-= 7; break; - case 0x79: rol_ex(); m6809_ICount-= 7; break; - case 0x7a: dec_ex(); m6809_ICount-= 7; break; - case 0x7b: illegal(); m6809_ICount-= 2; break; - case 0x7c: inc_ex(); m6809_ICount-= 7; break; - case 0x7d: tst_ex(); m6809_ICount-= 7; break; - case 0x7e: jmp_ex(); m6809_ICount-= 4; break; - case 0x7f: clr_ex(); m6809_ICount-= 7; break; - case 0x80: suba_im(); m6809_ICount-= 2; break; - case 0x81: cmpa_im(); m6809_ICount-= 2; break; - case 0x82: sbca_im(); m6809_ICount-= 2; break; - case 0x83: subd_im(); m6809_ICount-= 4; break; - case 0x84: anda_im(); m6809_ICount-= 2; break; - case 0x85: bita_im(); m6809_ICount-= 2; break; - case 0x86: lda_im(); m6809_ICount-= 2; break; - case 0x87: sta_im(); m6809_ICount-= 2; break; - case 0x88: eora_im(); m6809_ICount-= 2; break; - case 0x89: adca_im(); m6809_ICount-= 2; break; - case 0x8a: ora_im(); m6809_ICount-= 2; break; - case 0x8b: adda_im(); m6809_ICount-= 2; break; - case 0x8c: cmpx_im(); m6809_ICount-= 4; break; - case 0x8d: bsr(); m6809_ICount-= 7; break; - case 0x8e: ldx_im(); m6809_ICount-= 3; break; - case 0x8f: stx_im(); m6809_ICount-= 2; break; - case 0x90: suba_di(); m6809_ICount-= 4; break; - case 0x91: cmpa_di(); m6809_ICount-= 4; break; - case 0x92: sbca_di(); m6809_ICount-= 4; break; - case 0x93: subd_di(); m6809_ICount-= 6; break; - case 0x94: anda_di(); m6809_ICount-= 4; break; - case 0x95: bita_di(); m6809_ICount-= 4; break; - case 0x96: lda_di(); m6809_ICount-= 4; break; - case 0x97: sta_di(); m6809_ICount-= 4; break; - case 0x98: eora_di(); m6809_ICount-= 4; break; - case 0x99: adca_di(); m6809_ICount-= 4; break; - case 0x9a: ora_di(); m6809_ICount-= 4; break; - case 0x9b: adda_di(); m6809_ICount-= 4; break; - case 0x9c: cmpx_di(); m6809_ICount-= 6; break; - case 0x9d: jsr_di(); m6809_ICount-= 7; break; - case 0x9e: ldx_di(); m6809_ICount-= 5; break; - case 0x9f: stx_di(); m6809_ICount-= 5; break; - case 0xa0: suba_ix(); m6809_ICount-= 4; break; - case 0xa1: cmpa_ix(); m6809_ICount-= 4; break; - case 0xa2: sbca_ix(); m6809_ICount-= 4; break; - case 0xa3: subd_ix(); m6809_ICount-= 6; break; - case 0xa4: anda_ix(); m6809_ICount-= 4; break; - case 0xa5: bita_ix(); m6809_ICount-= 4; break; - case 0xa6: lda_ix(); m6809_ICount-= 4; break; - case 0xa7: sta_ix(); m6809_ICount-= 4; break; - case 0xa8: eora_ix(); m6809_ICount-= 4; break; - case 0xa9: adca_ix(); m6809_ICount-= 4; break; - case 0xaa: ora_ix(); m6809_ICount-= 4; break; - case 0xab: adda_ix(); m6809_ICount-= 4; break; - case 0xac: cmpx_ix(); m6809_ICount-= 6; break; - case 0xad: jsr_ix(); m6809_ICount-= 7; break; - case 0xae: ldx_ix(); m6809_ICount-= 5; break; - case 0xaf: stx_ix(); m6809_ICount-= 5; break; - case 0xb0: suba_ex(); m6809_ICount-= 5; break; - case 0xb1: cmpa_ex(); m6809_ICount-= 5; break; - case 0xb2: sbca_ex(); m6809_ICount-= 5; break; - case 0xb3: subd_ex(); m6809_ICount-= 7; break; - case 0xb4: anda_ex(); m6809_ICount-= 5; break; - case 0xb5: bita_ex(); m6809_ICount-= 5; break; - case 0xb6: lda_ex(); m6809_ICount-= 5; break; - case 0xb7: sta_ex(); m6809_ICount-= 5; break; - case 0xb8: eora_ex(); m6809_ICount-= 5; break; - case 0xb9: adca_ex(); m6809_ICount-= 5; break; - case 0xba: ora_ex(); m6809_ICount-= 5; break; - case 0xbb: adda_ex(); m6809_ICount-= 5; break; - case 0xbc: cmpx_ex(); m6809_ICount-= 7; break; - case 0xbd: jsr_ex(); m6809_ICount-= 8; break; - case 0xbe: ldx_ex(); m6809_ICount-= 6; break; - case 0xbf: stx_ex(); m6809_ICount-= 6; break; - case 0xc0: subb_im(); m6809_ICount-= 2; break; - case 0xc1: cmpb_im(); m6809_ICount-= 2; break; - case 0xc2: sbcb_im(); m6809_ICount-= 2; break; - case 0xc3: addd_im(); m6809_ICount-= 4; break; - case 0xc4: andb_im(); m6809_ICount-= 2; break; - case 0xc5: bitb_im(); m6809_ICount-= 2; break; - case 0xc6: ldb_im(); m6809_ICount-= 2; break; - case 0xc7: stb_im(); m6809_ICount-= 2; break; - case 0xc8: eorb_im(); m6809_ICount-= 2; break; - case 0xc9: adcb_im(); m6809_ICount-= 2; break; - case 0xca: orb_im(); m6809_ICount-= 2; break; - case 0xcb: addb_im(); m6809_ICount-= 2; break; - case 0xcc: ldd_im(); m6809_ICount-= 3; break; - case 0xcd: std_im(); m6809_ICount-= 2; break; - case 0xce: ldu_im(); m6809_ICount-= 3; break; - case 0xcf: stu_im(); m6809_ICount-= 3; break; - case 0xd0: subb_di(); m6809_ICount-= 4; break; - case 0xd1: cmpb_di(); m6809_ICount-= 4; break; - case 0xd2: sbcb_di(); m6809_ICount-= 4; break; - case 0xd3: addd_di(); m6809_ICount-= 6; break; - case 0xd4: andb_di(); m6809_ICount-= 4; break; - case 0xd5: bitb_di(); m6809_ICount-= 4; break; - case 0xd6: ldb_di(); m6809_ICount-= 4; break; - case 0xd7: stb_di(); m6809_ICount-= 4; break; - case 0xd8: eorb_di(); m6809_ICount-= 4; break; - case 0xd9: adcb_di(); m6809_ICount-= 4; break; - case 0xda: orb_di(); m6809_ICount-= 4; break; - case 0xdb: addb_di(); m6809_ICount-= 4; break; - case 0xdc: ldd_di(); m6809_ICount-= 5; break; - case 0xdd: std_di(); m6809_ICount-= 5; break; - case 0xde: ldu_di(); m6809_ICount-= 5; break; - case 0xdf: stu_di(); m6809_ICount-= 5; break; - case 0xe0: subb_ix(); m6809_ICount-= 4; break; - case 0xe1: cmpb_ix(); m6809_ICount-= 4; break; - case 0xe2: sbcb_ix(); m6809_ICount-= 4; break; - case 0xe3: addd_ix(); m6809_ICount-= 6; break; - case 0xe4: andb_ix(); m6809_ICount-= 4; break; - case 0xe5: bitb_ix(); m6809_ICount-= 4; break; - case 0xe6: ldb_ix(); m6809_ICount-= 4; break; - case 0xe7: stb_ix(); m6809_ICount-= 4; break; - case 0xe8: eorb_ix(); m6809_ICount-= 4; break; - case 0xe9: adcb_ix(); m6809_ICount-= 4; break; - case 0xea: orb_ix(); m6809_ICount-= 4; break; - case 0xeb: addb_ix(); m6809_ICount-= 4; break; - case 0xec: ldd_ix(); m6809_ICount-= 5; break; - case 0xed: std_ix(); m6809_ICount-= 5; break; - case 0xee: ldu_ix(); m6809_ICount-= 5; break; - case 0xef: stu_ix(); m6809_ICount-= 5; break; - case 0xf0: subb_ex(); m6809_ICount-= 5; break; - case 0xf1: cmpb_ex(); m6809_ICount-= 5; break; - case 0xf2: sbcb_ex(); m6809_ICount-= 5; break; - case 0xf3: addd_ex(); m6809_ICount-= 7; break; - case 0xf4: andb_ex(); m6809_ICount-= 5; break; - case 0xf5: bitb_ex(); m6809_ICount-= 5; break; - case 0xf6: ldb_ex(); m6809_ICount-= 5; break; - case 0xf7: stb_ex(); m6809_ICount-= 5; break; - case 0xf8: eorb_ex(); m6809_ICount-= 5; break; - case 0xf9: adcb_ex(); m6809_ICount-= 5; break; - case 0xfa: orb_ex(); m6809_ICount-= 5; break; - case 0xfb: addb_ex(); m6809_ICount-= 5; break; - case 0xfc: ldd_ex(); m6809_ICount-= 6; break; - case 0xfd: std_ex(); m6809_ICount-= 6; break; - case 0xfe: ldu_ex(); m6809_ICount-= 6; break; - case 0xff: stu_ex(); m6809_ICount-= 6; break; - } -#else - (*m6809_main[m6809.ireg])(); - m6809_ICount -= cycles1[m6809.ireg]; -#endif - - } while( m6809_ICount > 0 ); - - m6809_ICount -= m6809.extra_cycles; - m6809.extra_cycles = 0; - } - - return cycles - m6809_ICount; /* NS 970908 */ -} - -M6809_INLINE void fetch_effective_address( void ) -{ - UINT8 postbyte = ROP_ARG(PCD); - PC++; - - switch(postbyte) - { - case 0x00: EA=X; m6809_ICount-=1; break; - case 0x01: EA=X+1; m6809_ICount-=1; break; - case 0x02: EA=X+2; m6809_ICount-=1; break; - case 0x03: EA=X+3; m6809_ICount-=1; break; - case 0x04: EA=X+4; m6809_ICount-=1; break; - case 0x05: EA=X+5; m6809_ICount-=1; break; - case 0x06: EA=X+6; m6809_ICount-=1; break; - case 0x07: EA=X+7; m6809_ICount-=1; break; - case 0x08: EA=X+8; m6809_ICount-=1; break; - case 0x09: EA=X+9; m6809_ICount-=1; break; - case 0x0a: EA=X+10; m6809_ICount-=1; break; - case 0x0b: EA=X+11; m6809_ICount-=1; break; - case 0x0c: EA=X+12; m6809_ICount-=1; break; - case 0x0d: EA=X+13; m6809_ICount-=1; break; - case 0x0e: EA=X+14; m6809_ICount-=1; break; - case 0x0f: EA=X+15; m6809_ICount-=1; break; - - case 0x10: EA=X-16; m6809_ICount-=1; break; - case 0x11: EA=X-15; m6809_ICount-=1; break; - case 0x12: EA=X-14; m6809_ICount-=1; break; - case 0x13: EA=X-13; m6809_ICount-=1; break; - case 0x14: EA=X-12; m6809_ICount-=1; break; - case 0x15: EA=X-11; m6809_ICount-=1; break; - case 0x16: EA=X-10; m6809_ICount-=1; break; - case 0x17: EA=X-9; m6809_ICount-=1; break; - case 0x18: EA=X-8; m6809_ICount-=1; break; - case 0x19: EA=X-7; m6809_ICount-=1; break; - case 0x1a: EA=X-6; m6809_ICount-=1; break; - case 0x1b: EA=X-5; m6809_ICount-=1; break; - case 0x1c: EA=X-4; m6809_ICount-=1; break; - case 0x1d: EA=X-3; m6809_ICount-=1; break; - case 0x1e: EA=X-2; m6809_ICount-=1; break; - case 0x1f: EA=X-1; m6809_ICount-=1; break; - - case 0x20: EA=Y; m6809_ICount-=1; break; - case 0x21: EA=Y+1; m6809_ICount-=1; break; - case 0x22: EA=Y+2; m6809_ICount-=1; break; - case 0x23: EA=Y+3; m6809_ICount-=1; break; - case 0x24: EA=Y+4; m6809_ICount-=1; break; - case 0x25: EA=Y+5; m6809_ICount-=1; break; - case 0x26: EA=Y+6; m6809_ICount-=1; break; - case 0x27: EA=Y+7; m6809_ICount-=1; break; - case 0x28: EA=Y+8; m6809_ICount-=1; break; - case 0x29: EA=Y+9; m6809_ICount-=1; break; - case 0x2a: EA=Y+10; m6809_ICount-=1; break; - case 0x2b: EA=Y+11; m6809_ICount-=1; break; - case 0x2c: EA=Y+12; m6809_ICount-=1; break; - case 0x2d: EA=Y+13; m6809_ICount-=1; break; - case 0x2e: EA=Y+14; m6809_ICount-=1; break; - case 0x2f: EA=Y+15; m6809_ICount-=1; break; - - case 0x30: EA=Y-16; m6809_ICount-=1; break; - case 0x31: EA=Y-15; m6809_ICount-=1; break; - case 0x32: EA=Y-14; m6809_ICount-=1; break; - case 0x33: EA=Y-13; m6809_ICount-=1; break; - case 0x34: EA=Y-12; m6809_ICount-=1; break; - case 0x35: EA=Y-11; m6809_ICount-=1; break; - case 0x36: EA=Y-10; m6809_ICount-=1; break; - case 0x37: EA=Y-9; m6809_ICount-=1; break; - case 0x38: EA=Y-8; m6809_ICount-=1; break; - case 0x39: EA=Y-7; m6809_ICount-=1; break; - case 0x3a: EA=Y-6; m6809_ICount-=1; break; - case 0x3b: EA=Y-5; m6809_ICount-=1; break; - case 0x3c: EA=Y-4; m6809_ICount-=1; break; - case 0x3d: EA=Y-3; m6809_ICount-=1; break; - case 0x3e: EA=Y-2; m6809_ICount-=1; break; - case 0x3f: EA=Y-1; m6809_ICount-=1; break; - - case 0x40: EA=U; m6809_ICount-=1; break; - case 0x41: EA=U+1; m6809_ICount-=1; break; - case 0x42: EA=U+2; m6809_ICount-=1; break; - case 0x43: EA=U+3; m6809_ICount-=1; break; - case 0x44: EA=U+4; m6809_ICount-=1; break; - case 0x45: EA=U+5; m6809_ICount-=1; break; - case 0x46: EA=U+6; m6809_ICount-=1; break; - case 0x47: EA=U+7; m6809_ICount-=1; break; - case 0x48: EA=U+8; m6809_ICount-=1; break; - case 0x49: EA=U+9; m6809_ICount-=1; break; - case 0x4a: EA=U+10; m6809_ICount-=1; break; - case 0x4b: EA=U+11; m6809_ICount-=1; break; - case 0x4c: EA=U+12; m6809_ICount-=1; break; - case 0x4d: EA=U+13; m6809_ICount-=1; break; - case 0x4e: EA=U+14; m6809_ICount-=1; break; - case 0x4f: EA=U+15; m6809_ICount-=1; break; - - case 0x50: EA=U-16; m6809_ICount-=1; break; - case 0x51: EA=U-15; m6809_ICount-=1; break; - case 0x52: EA=U-14; m6809_ICount-=1; break; - case 0x53: EA=U-13; m6809_ICount-=1; break; - case 0x54: EA=U-12; m6809_ICount-=1; break; - case 0x55: EA=U-11; m6809_ICount-=1; break; - case 0x56: EA=U-10; m6809_ICount-=1; break; - case 0x57: EA=U-9; m6809_ICount-=1; break; - case 0x58: EA=U-8; m6809_ICount-=1; break; - case 0x59: EA=U-7; m6809_ICount-=1; break; - case 0x5a: EA=U-6; m6809_ICount-=1; break; - case 0x5b: EA=U-5; m6809_ICount-=1; break; - case 0x5c: EA=U-4; m6809_ICount-=1; break; - case 0x5d: EA=U-3; m6809_ICount-=1; break; - case 0x5e: EA=U-2; m6809_ICount-=1; break; - case 0x5f: EA=U-1; m6809_ICount-=1; break; - - case 0x60: EA=S; m6809_ICount-=1; break; - case 0x61: EA=S+1; m6809_ICount-=1; break; - case 0x62: EA=S+2; m6809_ICount-=1; break; - case 0x63: EA=S+3; m6809_ICount-=1; break; - case 0x64: EA=S+4; m6809_ICount-=1; break; - case 0x65: EA=S+5; m6809_ICount-=1; break; - case 0x66: EA=S+6; m6809_ICount-=1; break; - case 0x67: EA=S+7; m6809_ICount-=1; break; - case 0x68: EA=S+8; m6809_ICount-=1; break; - case 0x69: EA=S+9; m6809_ICount-=1; break; - case 0x6a: EA=S+10; m6809_ICount-=1; break; - case 0x6b: EA=S+11; m6809_ICount-=1; break; - case 0x6c: EA=S+12; m6809_ICount-=1; break; - case 0x6d: EA=S+13; m6809_ICount-=1; break; - case 0x6e: EA=S+14; m6809_ICount-=1; break; - case 0x6f: EA=S+15; m6809_ICount-=1; break; - - case 0x70: EA=S-16; m6809_ICount-=1; break; - case 0x71: EA=S-15; m6809_ICount-=1; break; - case 0x72: EA=S-14; m6809_ICount-=1; break; - case 0x73: EA=S-13; m6809_ICount-=1; break; - case 0x74: EA=S-12; m6809_ICount-=1; break; - case 0x75: EA=S-11; m6809_ICount-=1; break; - case 0x76: EA=S-10; m6809_ICount-=1; break; - case 0x77: EA=S-9; m6809_ICount-=1; break; - case 0x78: EA=S-8; m6809_ICount-=1; break; - case 0x79: EA=S-7; m6809_ICount-=1; break; - case 0x7a: EA=S-6; m6809_ICount-=1; break; - case 0x7b: EA=S-5; m6809_ICount-=1; break; - case 0x7c: EA=S-4; m6809_ICount-=1; break; - case 0x7d: EA=S-3; m6809_ICount-=1; break; - case 0x7e: EA=S-2; m6809_ICount-=1; break; - case 0x7f: EA=S-1; m6809_ICount-=1; break; - - case 0x80: EA=X; X++; m6809_ICount-=2; break; - case 0x81: EA=X; X+=2; m6809_ICount-=3; break; - case 0x82: X--; EA=X; m6809_ICount-=2; break; - case 0x83: X-=2; EA=X; m6809_ICount-=3; break; - case 0x84: EA=X; break; - case 0x85: EA=X+SIGNED(B); m6809_ICount-=1; break; - case 0x86: EA=X+SIGNED(A); m6809_ICount-=1; break; - case 0x87: EA=0; break; /* ILLEGAL*/ - case 0x88: IMMBYTE(EA); EA=X+SIGNED(EA); m6809_ICount-=1; break; /* this is a hack to make Vectrex work. It should be m6809_ICount-=1. Dunno where the cycle was lost :( */ - case 0x89: IMMWORD(ea); EA+=X; m6809_ICount-=4; break; - case 0x8a: EA=0; break; /* ILLEGAL*/ - case 0x8b: EA=X+D; m6809_ICount-=4; break; - case 0x8c: IMMBYTE(EA); EA=PC+SIGNED(EA); m6809_ICount-=1; break; - case 0x8d: IMMWORD(ea); EA+=PC; m6809_ICount-=5; break; - case 0x8e: EA=0; break; /* ILLEGAL*/ - case 0x8f: IMMWORD(ea); m6809_ICount-=5; break; - - case 0x90: EA=X; X++; EAD=RM16(EAD); m6809_ICount-=5; break; /* Indirect ,R+ not in my specs */ - case 0x91: EA=X; X+=2; EAD=RM16(EAD); m6809_ICount-=6; break; - case 0x92: X--; EA=X; EAD=RM16(EAD); m6809_ICount-=5; break; - case 0x93: X-=2; EA=X; EAD=RM16(EAD); m6809_ICount-=6; break; - case 0x94: EA=X; EAD=RM16(EAD); m6809_ICount-=3; break; - case 0x95: EA=X+SIGNED(B); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0x96: EA=X+SIGNED(A); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0x97: EA=0; break; /* ILLEGAL*/ - case 0x98: IMMBYTE(EA); EA=X+SIGNED(EA); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0x99: IMMWORD(ea); EA+=X; EAD=RM16(EAD); m6809_ICount-=7; break; - case 0x9a: EA=0; break; /* ILLEGAL*/ - case 0x9b: EA=X+D; EAD=RM16(EAD); m6809_ICount-=7; break; - case 0x9c: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0x9d: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); m6809_ICount-=8; break; - case 0x9e: EA=0; break; /* ILLEGAL*/ - case 0x9f: IMMWORD(ea); EAD=RM16(EAD); m6809_ICount-=8; break; - - case 0xa0: EA=Y; Y++; m6809_ICount-=2; break; - case 0xa1: EA=Y; Y+=2; m6809_ICount-=3; break; - case 0xa2: Y--; EA=Y; m6809_ICount-=2; break; - case 0xa3: Y-=2; EA=Y; m6809_ICount-=3; break; - case 0xa4: EA=Y; break; - case 0xa5: EA=Y+SIGNED(B); m6809_ICount-=1; break; - case 0xa6: EA=Y+SIGNED(A); m6809_ICount-=1; break; - case 0xa7: EA=0; break; /* ILLEGAL*/ - case 0xa8: IMMBYTE(EA); EA=Y+SIGNED(EA); m6809_ICount-=1; break; - case 0xa9: IMMWORD(ea); EA+=Y; m6809_ICount-=4; break; - case 0xaa: EA=0; break; /* ILLEGAL*/ - case 0xab: EA=Y+D; m6809_ICount-=4; break; - case 0xac: IMMBYTE(EA); EA=PC+SIGNED(EA); m6809_ICount-=1; break; - case 0xad: IMMWORD(ea); EA+=PC; m6809_ICount-=5; break; - case 0xae: EA=0; break; /* ILLEGAL*/ - case 0xaf: IMMWORD(ea); m6809_ICount-=5; break; - - case 0xb0: EA=Y; Y++; EAD=RM16(EAD); m6809_ICount-=5; break; - case 0xb1: EA=Y; Y+=2; EAD=RM16(EAD); m6809_ICount-=6; break; - case 0xb2: Y--; EA=Y; EAD=RM16(EAD); m6809_ICount-=5; break; - case 0xb3: Y-=2; EA=Y; EAD=RM16(EAD); m6809_ICount-=6; break; - case 0xb4: EA=Y; EAD=RM16(EAD); m6809_ICount-=3; break; - case 0xb5: EA=Y+SIGNED(B); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xb6: EA=Y+SIGNED(A); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xb7: EA=0; break; /* ILLEGAL*/ - case 0xb8: IMMBYTE(EA); EA=Y+SIGNED(EA); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xb9: IMMWORD(ea); EA+=Y; EAD=RM16(EAD); m6809_ICount-=7; break; - case 0xba: EA=0; break; /* ILLEGAL*/ - case 0xbb: EA=Y+D; EAD=RM16(EAD); m6809_ICount-=7; break; - case 0xbc: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xbd: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); m6809_ICount-=8; break; - case 0xbe: EA=0; break; /* ILLEGAL*/ - case 0xbf: IMMWORD(ea); EAD=RM16(EAD); m6809_ICount-=8; break; - - case 0xc0: EA=U; U++; m6809_ICount-=2; break; - case 0xc1: EA=U; U+=2; m6809_ICount-=3; break; - case 0xc2: U--; EA=U; m6809_ICount-=2; break; - case 0xc3: U-=2; EA=U; m6809_ICount-=3; break; - case 0xc4: EA=U; break; - case 0xc5: EA=U+SIGNED(B); m6809_ICount-=1; break; - case 0xc6: EA=U+SIGNED(A); m6809_ICount-=1; break; - case 0xc7: EA=0; break; /*ILLEGAL*/ - case 0xc8: IMMBYTE(EA); EA=U+SIGNED(EA); m6809_ICount-=1; break; - case 0xc9: IMMWORD(ea); EA+=U; m6809_ICount-=4; break; - case 0xca: EA=0; break; /*ILLEGAL*/ - case 0xcb: EA=U+D; m6809_ICount-=4; break; - case 0xcc: IMMBYTE(EA); EA=PC+SIGNED(EA); m6809_ICount-=1; break; - case 0xcd: IMMWORD(ea); EA+=PC; m6809_ICount-=5; break; - case 0xce: EA=0; break; /*ILLEGAL*/ - case 0xcf: IMMWORD(ea); m6809_ICount-=5; break; - - case 0xd0: EA=U; U++; EAD=RM16(EAD); m6809_ICount-=5; break; - case 0xd1: EA=U; U+=2; EAD=RM16(EAD); m6809_ICount-=6; break; - case 0xd2: U--; EA=U; EAD=RM16(EAD); m6809_ICount-=5; break; - case 0xd3: U-=2; EA=U; EAD=RM16(EAD); m6809_ICount-=6; break; - case 0xd4: EA=U; EAD=RM16(EAD); m6809_ICount-=3; break; - case 0xd5: EA=U+SIGNED(B); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xd6: EA=U+SIGNED(A); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xd7: EA=0; break; /*ILLEGAL*/ - case 0xd8: IMMBYTE(EA); EA=U+SIGNED(EA); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xd9: IMMWORD(ea); EA+=U; EAD=RM16(EAD); m6809_ICount-=7; break; - case 0xda: EA=0; break; /*ILLEGAL*/ - case 0xdb: EA=U+D; EAD=RM16(EAD); m6809_ICount-=7; break; - case 0xdc: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xdd: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); m6809_ICount-=8; break; - case 0xde: EA=0; break; /*ILLEGAL*/ - case 0xdf: IMMWORD(ea); EAD=RM16(EAD); m6809_ICount-=8; break; - - case 0xe0: EA=S; S++; m6809_ICount-=2; break; - case 0xe1: EA=S; S+=2; m6809_ICount-=3; break; - case 0xe2: S--; EA=S; m6809_ICount-=2; break; - case 0xe3: S-=2; EA=S; m6809_ICount-=3; break; - case 0xe4: EA=S; break; - case 0xe5: EA=S+SIGNED(B); m6809_ICount-=1; break; - case 0xe6: EA=S+SIGNED(A); m6809_ICount-=1; break; - case 0xe7: EA=0; break; /*ILLEGAL*/ - case 0xe8: IMMBYTE(EA); EA=S+SIGNED(EA); m6809_ICount-=1; break; - case 0xe9: IMMWORD(ea); EA+=S; m6809_ICount-=4; break; - case 0xea: EA=0; break; /*ILLEGAL*/ - case 0xeb: EA=S+D; m6809_ICount-=4; break; - case 0xec: IMMBYTE(EA); EA=PC+SIGNED(EA); m6809_ICount-=1; break; - case 0xed: IMMWORD(ea); EA+=PC; m6809_ICount-=5; break; - case 0xee: EA=0; break; /*ILLEGAL*/ - case 0xef: IMMWORD(ea); m6809_ICount-=5; break; - - case 0xf0: EA=S; S++; EAD=RM16(EAD); m6809_ICount-=5; break; - case 0xf1: EA=S; S+=2; EAD=RM16(EAD); m6809_ICount-=6; break; - case 0xf2: S--; EA=S; EAD=RM16(EAD); m6809_ICount-=5; break; - case 0xf3: S-=2; EA=S; EAD=RM16(EAD); m6809_ICount-=6; break; - case 0xf4: EA=S; EAD=RM16(EAD); m6809_ICount-=3; break; - case 0xf5: EA=S+SIGNED(B); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xf6: EA=S+SIGNED(A); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xf7: EA=0; break; /*ILLEGAL*/ - case 0xf8: IMMBYTE(EA); EA=S+SIGNED(EA); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xf9: IMMWORD(ea); EA+=S; EAD=RM16(EAD); m6809_ICount-=7; break; - case 0xfa: EA=0; break; /*ILLEGAL*/ - case 0xfb: EA=S+D; EAD=RM16(EAD); m6809_ICount-=7; break; - case 0xfc: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); m6809_ICount-=4; break; - case 0xfd: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); m6809_ICount-=8; break; - case 0xfe: EA=0; break; /*ILLEGAL*/ - case 0xff: IMMWORD(ea); EAD=RM16(EAD); m6809_ICount-=8; break; - } -} - -#if 0 - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static void m6809_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + M6809_IRQ_LINE: set_irq_line(M6809_IRQ_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + M6809_FIRQ_LINE: set_irq_line(M6809_FIRQ_LINE, info->i); break; - case CPUINFO_INT_INPUT_STATE + M6809_INPUT_LINE_NMI: set_irq_line(M6809_INPUT_LINE_NMI, info->i); break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + M6809_PC: PC = info->i; CHANGE_PC; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + M6809_S: S = info->i; break; - case CPUINFO_INT_REGISTER + M6809_CC: CC = info->i; CHECK_IRQ_LINES; break; - case CPUINFO_INT_REGISTER + M6809_U: U = info->i; break; - case CPUINFO_INT_REGISTER + M6809_A: A = info->i; break; - case CPUINFO_INT_REGISTER + M6809_B: B = info->i; break; - case CPUINFO_INT_REGISTER + M6809_X: X = info->i; break; - case CPUINFO_INT_REGISTER + M6809_Y: Y = info->i; break; - case CPUINFO_INT_REGISTER + M6809_DP: DP = info->i; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void m6809_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(m6809); break; - case CPUINFO_INT_INPUT_LINES: info->i = 2; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 5; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 19; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + M6809_IRQ_LINE: info->i = m6809.irq_state[M6809_IRQ_LINE]; break; - case CPUINFO_INT_INPUT_STATE + M6809_FIRQ_LINE: info->i = m6809.irq_state[M6809_FIRQ_LINE]; break; - case CPUINFO_INT_INPUT_STATE + M6809_INPUT_LINE_NMI: info->i = m6809.nmi_state; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = PPC; break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + M6809_PC: info->i = PC; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + M6809_S: info->i = S; break; - case CPUINFO_INT_REGISTER + M6809_CC: info->i = CC; break; - case CPUINFO_INT_REGISTER + M6809_U: info->i = U; break; - case CPUINFO_INT_REGISTER + M6809_A: info->i = A; break; - case CPUINFO_INT_REGISTER + M6809_B: info->i = B; break; - case CPUINFO_INT_REGISTER + M6809_X: info->i = X; break; - case CPUINFO_INT_REGISTER + M6809_Y: info->i = Y; break; - case CPUINFO_INT_REGISTER + M6809_DP: info->i = DP; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = m6809_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = m6809_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = m6809_set_context; break; - case CPUINFO_PTR_INIT: info->init = m6809_init; break; - case CPUINFO_PTR_RESET: info->reset = m6809_reset; break; - case CPUINFO_PTR_EXIT: info->exit = m6809_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = m6809_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = m6809_dasm; break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &m6809_ICount; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6809"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Motorola 6809"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.11"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright John Butler"); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c%c%c%c%c%c%c%c", - m6809.cc & 0x80 ? 'E':'.', - m6809.cc & 0x40 ? 'F':'.', - m6809.cc & 0x20 ? 'H':'.', - m6809.cc & 0x10 ? 'I':'.', - m6809.cc & 0x08 ? 'N':'.', - m6809.cc & 0x04 ? 'Z':'.', - m6809.cc & 0x02 ? 'V':'.', - m6809.cc & 0x01 ? 'C':'.'); - break; - - case CPUINFO_STR_REGISTER + M6809_PC: sprintf(info->s, "PC:%04X", m6809.pc.w.l); break; - case CPUINFO_STR_REGISTER + M6809_S: sprintf(info->s, "S:%04X", m6809.s.w.l); break; - case CPUINFO_STR_REGISTER + M6809_CC: sprintf(info->s, "CC:%02X", m6809.cc); break; - case CPUINFO_STR_REGISTER + M6809_U: sprintf(info->s, "U:%04X", m6809.u.w.l); break; - case CPUINFO_STR_REGISTER + M6809_A: sprintf(info->s, "A:%02X", m6809.d.b.h); break; - case CPUINFO_STR_REGISTER + M6809_B: sprintf(info->s, "B:%02X", m6809.d.b.l); break; - case CPUINFO_STR_REGISTER + M6809_X: sprintf(info->s, "X:%04X", m6809.x.w.l); break; - case CPUINFO_STR_REGISTER + M6809_Y: sprintf(info->s, "Y:%04X", m6809.y.w.l); break; - case CPUINFO_STR_REGISTER + M6809_DP: sprintf(info->s, "DP:%02X", m6809.dp.b.h); break; - } -} - - -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void m6809e_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "M6809E"); break; - - default: m6809_get_info(state, info); break; - } -} - -#endif diff --git a/jan/src/cpu/m6809/m6809.h b/jan/src/cpu/m6809/m6809.h deleted file mode 100644 index 0a547eba1..000000000 --- a/jan/src/cpu/m6809/m6809.h +++ /dev/null @@ -1,87 +0,0 @@ -/*** m6809: Portable 6809 emulator ******************************************/ - -//#pragma once - -#ifndef __M6809_H__ -#define __M6809_H__ - -//#include "cpuintrf.h" - -/* 6809 Registers */ -typedef struct -{ - PAIR pc; /* Program counter */ - PAIR ppc; /* Previous program counter */ - PAIR ea; /* effective address */ - PAIR d; /* Accumulator a and b */ - PAIR dp; /* Direct Page register (page in MSB) */ - PAIR u, s; /* Stack pointers */ - PAIR x, y; /* Index registers */ - UINT8 cc; - UINT8 ireg; /* First opcode */ - UINT8 irq_state[2]; - UINT8 irq_hold[2]; - int extra_cycles; /* cycles used up by interrupts */ - ALIGN_VAR(8) int (*irq_callback)(int irqline); - UINT8 int_state; /* SYNC and CWAI flags */ - UINT8 nmi_state; -} m6809_Regs; - -enum -{ - M6809_PC=1, M6809_S, M6809_CC ,M6809_A, M6809_B, M6809_U, M6809_X, M6809_Y, - M6809_DP -}; - -#define M6809_IRQ_LINE 0 /* IRQ line number */ -#define M6809_FIRQ_LINE 1 /* FIRQ line number */ - -//void m6809_get_info(UINT32 state, cpuinfo *info); -//void m6809e_get_info(UINT32 state, cpuinfo *info); - -void m6809_init(int (*irqcallback)(int)); -void m6809_reset(void); -void m6809_reset_hard(void); -int m6809_execute(int cycles); -void m6809_set_irq_line(int irqline, int state); -void m6809_get_context(void *dst); -void m6809_set_context(void *src); -UINT16 m6809_get_pc(); - -unsigned char M6809ReadByte(unsigned short Address); -void M6809WriteByte(unsigned short Address, unsigned char Data); -unsigned char M6809ReadOp(unsigned short Address); -unsigned char M6809ReadOpArg(unsigned short Address); - -/****************************************************************************/ -/* Read a byte from given memory location */ -/****************************************************************************/ -#define M6809_RDMEM(Addr) ((unsigned)M6809ReadByte(Addr)) - -/****************************************************************************/ -/* Write a byte to given memory location */ -/****************************************************************************/ -#define M6809_WRMEM(Addr,Value) (M6809WriteByte(Addr,Value)) - -/****************************************************************************/ -/* Z80_RDOP() is identical to Z80_RDMEM() except it is used for reading */ -/* opcodes. In case of system with memory mapped I/O, this function can be */ -/* used to greatly speed up emulation */ -/****************************************************************************/ -#define M6809_RDOP(Addr) ((unsigned)M6809ReadOp(Addr)) - -/****************************************************************************/ -/* Z80_RDOP_ARG() is identical to Z80_RDOP() except it is used for reading */ -/* opcode arguments. This difference can be used to support systems that */ -/* use different encoding mechanisms for opcodes and opcode arguments */ -/****************************************************************************/ -#define M6809_RDOP_ARG(Addr) ((unsigned)M6809ReadOpArg(Addr)) - -#ifndef FALSE -# define FALSE 0 -#endif -#ifndef TRUE -# define TRUE (!FALSE) -#endif - -#endif /* __M6809_H__ */ diff --git a/jan/src/cpu/m6809_intf.cpp b/jan/src/cpu/m6809_intf.cpp deleted file mode 100644 index 1669811cc..000000000 --- a/jan/src/cpu/m6809_intf.cpp +++ /dev/null @@ -1,449 +0,0 @@ -#include "burnint.h" -#include "m6809_intf.h" - -#define MAX_CPU 8 - -INT32 nM6809Count = 0; -static INT32 nActiveCPU = 0; - -static M6809Ext *m6809CPUContext = NULL; - -static INT32 nM6809CyclesDone[MAX_CPU]; -INT32 nM6809CyclesTotal; - -static UINT8 M6809ReadByteDummyHandler(UINT16) -{ - return 0; -} - -static void M6809WriteByteDummyHandler(UINT16, UINT8) -{ -} - -static UINT8 M6809ReadOpDummyHandler(UINT16) -{ - return 0; -} - -static UINT8 M6809ReadOpArgDummyHandler(UINT16) -{ - return 0; -} - -void M6809Reset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809Reset called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809Reset called when no CPU open\n")); -#endif - - m6809_reset(); -} - -UINT16 M6809GetPC() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809GetPC called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809GetPC called when no CPU open\n")); -#endif - - return m6809_get_pc(); -} - -void M6809NewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809NewFrame called without init\n")); -#endif - - for (INT32 i = 0; i < nM6809Count; i++) { - nM6809CyclesDone[i] = 0; - } - nM6809CyclesTotal = 0; -} - -static UINT8 M6809CheatRead(UINT32 a) -{ - return M6809ReadByte(a); -} - -static cpu_core_config M6809CheatCpuConfig = -{ - M6809Open, - M6809Close, - M6809CheatRead, - M6809WriteRom, - M6809GetActive, - M6809TotalCycles, - M6809NewFrame, - M6809Run, - M6809RunEnd, - M6809Reset, - 1<<16, - 0 -}; - -INT32 M6809Init(INT32 num) -{ - DebugCPU_M6809Initted = 1; - - nActiveCPU = -1; - nM6809Count = num % MAX_CPU; - - m6809CPUContext = (M6809Ext*)malloc(num * sizeof(M6809Ext)); - if (m6809CPUContext == NULL) { - return 1; - } - - memset(m6809CPUContext, 0, num * sizeof(M6809Ext)); - - for (INT32 i = 0; i < num; i++) { - m6809CPUContext[i].ReadByte = M6809ReadByteDummyHandler; - m6809CPUContext[i].WriteByte = M6809WriteByteDummyHandler; - m6809CPUContext[i].ReadOp = M6809ReadOpDummyHandler; - m6809CPUContext[i].ReadOpArg = M6809ReadOpArgDummyHandler; - - nM6809CyclesDone[i] = 0; - - for (INT32 j = 0; j < (0x0100 * 3); j++) { - m6809CPUContext[i].pMemMap[j] = NULL; - } - } - - nM6809CyclesTotal = 0; - - m6809_init(NULL); - - for (INT32 i = 0; i < num; i++) - CpuCheatRegister(i, &M6809CheatCpuConfig); - - return 0; -} - -void M6809Exit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809Exit called without init\n")); -#endif - - nM6809Count = 0; - - if (m6809CPUContext) { - free(m6809CPUContext); - m6809CPUContext = NULL; - } - - DebugCPU_M6809Initted = 0; -} - -void M6809Open(INT32 num) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809Open called without init\n")); - if (num >= nM6809Count) bprintf(PRINT_ERROR, _T("M6809Open called with invalid index %x\n"), num); - if (nActiveCPU != -1) bprintf(PRINT_ERROR, _T("M6809Open called when CPU already open with index %x\n"), num); -#endif - - nActiveCPU = num; - - m6809_set_context(&m6809CPUContext[nActiveCPU].reg); - - nM6809CyclesTotal = nM6809CyclesDone[nActiveCPU]; -} - -void M6809Close() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809Close called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809Close called when no CPU open\n")); -#endif - - m6809_get_context(&m6809CPUContext[nActiveCPU].reg); - - nM6809CyclesDone[nActiveCPU] = nM6809CyclesTotal; - - nActiveCPU = -1; -} - -INT32 M6809GetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809GetActive called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809GetActive called when no CPU open\n")); -#endif - - return nActiveCPU; -} - -void M6809SetIRQLine(INT32 vector, INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809SetIRQLine called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809SetIRQLine called when no CPU open\n")); -#endif - - if (status == CPU_IRQSTATUS_NONE) { - m6809_set_irq_line(vector, 0); - } - - if (status == CPU_IRQSTATUS_ACK) { - m6809_set_irq_line(vector, 1); - } - - if (status == CPU_IRQSTATUS_HOLD) { - m6809_set_irq_line(vector, 2); - } - - if (status == CPU_IRQSTATUS_AUTO) { - m6809_set_irq_line(vector, 1); - m6809_execute(0); - m6809_set_irq_line(vector, 0); - m6809_execute(0); - } -} - -INT32 M6809Run(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809Run called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809Run called when no CPU open\n")); -#endif - - cycles = m6809_execute(cycles); - - nM6809CyclesTotal += cycles; - - return cycles; -} - -void M6809RunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809RunEnd called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809RunEnd called when no CPU open\n")); -#endif -} - -INT32 M6809MapMemory(UINT8* pMemory, UINT16 nStart, UINT16 nEnd, INT32 nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809MapMemory called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809MapMemory called when no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = m6809CPUContext[nActiveCPU].pMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - if (nType & MAP_READ) { - pMemMap[0 + i] = pMemory + ((i - cStart) << 8); - } - if (nType & MAP_WRITE) { - pMemMap[0x100 + i] = pMemory + ((i - cStart) << 8); - } - if (nType & MAP_FETCH) { - pMemMap[0x200 + i] = pMemory + ((i - cStart) << 8); - } - } - return 0; - -} - -INT32 M6809UnmapMemory(UINT16 nStart, UINT16 nEnd, INT32 nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809UnmapMemory called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809UnmapMemory called when no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = m6809CPUContext[nActiveCPU].pMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - if (nType & MAP_READ) { - pMemMap[0 + i] = NULL; - } - if (nType & MAP_WRITE) { - pMemMap[0x100 + i] = NULL; - } - if (nType & MAP_FETCH) { - pMemMap[0x200 + i] = NULL; - } - } - return 0; - -} - -void M6809SetReadHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809SetReadHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809SetReadHandler called when no CPU open\n")); -#endif - - m6809CPUContext[nActiveCPU].ReadByte = pHandler; -} - -void M6809SetWriteHandler(void (*pHandler)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809SetWriteHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809SetWriteHandler called when no CPU open\n")); -#endif - - m6809CPUContext[nActiveCPU].WriteByte = pHandler; -} - -void M6809SetReadOpHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809SetReadOpHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809SetReadOpHandler called when no CPU open\n")); -#endif - - m6809CPUContext[nActiveCPU].ReadOp = pHandler; -} - -void M6809SetReadOpArgHandler(UINT8 (*pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809SetReadOpArgHandler called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809SetReadOpArgHandler called when no CPU open\n")); -#endif - - m6809CPUContext[nActiveCPU].ReadOpArg = pHandler; -} - -UINT8 M6809ReadByte(UINT16 Address) -{ - // check mem map - UINT8 * pr = m6809CPUContext[nActiveCPU].pMemMap[0x000 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (m6809CPUContext[nActiveCPU].ReadByte != NULL) { - return m6809CPUContext[nActiveCPU].ReadByte(Address); - } - - return 0; -} - -void M6809WriteByte(UINT16 Address, UINT8 Data) -{ - // check mem map - UINT8 * pr = m6809CPUContext[nActiveCPU].pMemMap[0x100 | (Address >> 8)]; - if (pr != NULL) { - pr[Address & 0xff] = Data; - return; - } - - // check handler - if (m6809CPUContext[nActiveCPU].WriteByte != NULL) { - m6809CPUContext[nActiveCPU].WriteByte(Address, Data); - return; - } -} - -UINT8 M6809ReadOp(UINT16 Address) -{ - // check mem map - UINT8 * pr = m6809CPUContext[nActiveCPU].pMemMap[0x200 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (m6809CPUContext[nActiveCPU].ReadOp != NULL) { - return m6809CPUContext[nActiveCPU].ReadOp(Address); - } - - return 0; -} - -UINT8 M6809ReadOpArg(UINT16 Address) -{ - // check mem map - UINT8 * pr = m6809CPUContext[nActiveCPU].pMemMap[0x000 | (Address >> 8)]; - if (pr != NULL) { - return pr[Address & 0xff]; - } - - // check handler - if (m6809CPUContext[nActiveCPU].ReadOpArg != NULL) { - return m6809CPUContext[nActiveCPU].ReadOpArg(Address); - } - - return 0; -} - -void M6809WriteRom(UINT32 Address, UINT8 Data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809WriteRom called without init\n")); - if (nActiveCPU == -1) bprintf(PRINT_ERROR, _T("M6809WriteRom called when no CPU open\n")); -#endif - Address &= 0xffff; - - UINT8 * pr = m6809CPUContext[nActiveCPU].pMemMap[0x000 | (Address >> 8)]; - UINT8 * pw = m6809CPUContext[nActiveCPU].pMemMap[0x100 | (Address >> 8)]; - UINT8 * pf = m6809CPUContext[nActiveCPU].pMemMap[0x200 | (Address >> 8)]; - - if (pr != NULL) { - pr[Address & 0xff] = Data; - } - - if (pw != NULL) { - pw[Address & 0xff] = Data; - } - - if (pf != NULL) { - pf[Address & 0xff] = Data; - } - - // check handler - if (m6809CPUContext[nActiveCPU].WriteByte != NULL) { - m6809CPUContext[nActiveCPU].WriteByte(Address, Data); - return; - } -} - -INT32 M6809Scan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809Scan called without init\n")); -#endif - - struct BurnArea ba; - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - for (INT32 i = 0; i < nM6809Count; i++) { - - M6809Ext *ptr = &m6809CPUContext[i]; - - INT32 (*Callback)(INT32 irqline); - - Callback = ptr->reg.irq_callback; - - char szName[] = "M6809 #n"; - szName[7] = '0' + i; - - ba.Data = &m6809CPUContext[i].reg; - ba.nLen = sizeof(m6809CPUContext[i].reg); - ba.szName = szName; - BurnAcb(&ba); - - // necessary? - SCAN_VAR(ptr->nCyclesTotal); - SCAN_VAR(ptr->nCyclesSegment); - SCAN_VAR(ptr->nCyclesLeft); - - ptr->reg.irq_callback = Callback; - } - - return 0; -} diff --git a/jan/src/cpu/m6809_intf.h b/jan/src/cpu/m6809_intf.h deleted file mode 100644 index 0d7a7bd01..000000000 --- a/jan/src/cpu/m6809_intf.h +++ /dev/null @@ -1,67 +0,0 @@ -#include "m6809/m6809.h" - -typedef UINT8 (*pReadByteHandler)(UINT16 a); -typedef void (*pWriteByteHandler)(UINT16 a, UINT8 d); -typedef UINT8 (*pReadOpHandler)(UINT16 a); -typedef UINT8 (*pReadOpArgHandler)(UINT16 a); - -struct M6809Ext { - - m6809_Regs reg; - - UINT8* pMemMap[0x100 * 3]; - - pReadByteHandler ReadByte; - pWriteByteHandler WriteByte; - pReadOpHandler ReadOp; - pReadOpArgHandler ReadOpArg; - - INT32 nCyclesTotal; - INT32 nCyclesSegment; - INT32 nCyclesLeft; -}; - -extern INT32 nM6809Count; - -extern INT32 nM6809CyclesTotal; - -void M6809Reset(); -void M6809NewFrame(); -INT32 M6809Init(INT32 num); -void M6809Exit(); -void M6809Open(INT32 num); -void M6809Close(); -INT32 M6809GetActive(); -void M6809SetIRQLine(INT32 vector, INT32 status); -INT32 M6809Run(INT32 cycles); -void M6809RunEnd(); -INT32 M6809MapMemory(UINT8* pMemory, UINT16 nStart, UINT16 nEnd, INT32 nType); -INT32 M6809UnmapMemory(UINT16 nStart, UINT16 nEnd, INT32 nType); -void M6809SetReadHandler(UINT8 (*pHandler)(UINT16)); -void M6809SetWriteHandler(void (*pHandler)(UINT16, UINT8)); -void M6809SetReadOpHandler(UINT8 (*pHandler)(UINT16)); -void M6809SetReadOpArgHandler(UINT8 (*pHandler)(UINT16)); -INT32 M6809Scan(INT32 nAction); -UINT16 M6809GetPC(); - -void M6809WriteRom(UINT32 Address, UINT8 Data); - -inline static INT32 M6809TotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809TotalCycles called without init\n")); -#endif - - return nM6809CyclesTotal; -} - -inline static INT32 M6809Idle(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_M6809Initted) bprintf(PRINT_ERROR, _T("M6809Idle called without init\n")); -#endif - - nM6809CyclesTotal += cycles; - - return cycles; -} diff --git a/jan/src/cpu/m68k/m68k.h b/jan/src/cpu/m68k/m68k.h deleted file mode 100644 index b7a93abd7..000000000 --- a/jan/src/cpu/m68k/m68k.h +++ /dev/null @@ -1,395 +0,0 @@ -#ifndef M68K__HEADER -#define M68K__HEADER - -#ifdef __cplusplus - extern "C" { -#endif - -/* ======================================================================== */ -/* ========================= LICENSING & COPYRIGHT ======================== */ -/* ======================================================================== */ -/* - * MUSASHI - * Version 3.32 - * - * A portable Motorola M680x0 processor emulation engine. - * Copyright Karl Stenerud. All rights reserved. - * - * This code may be freely used for non-commercial purposes as long as this - * copyright notice remains unaltered in the source code and any binary files - * containing this code in compiled form. - * - * All other licensing terms must be negotiated with the author - * (Karl Stenerud). - * - * The latest version of this code can be obtained at: - * http://kstenerud.cjb.net - */ - - - -/* ============================ GENERAL DEFINES =========================== */ - -/* ======================================================================== */ - -/* There are 7 levels of interrupt to the 68K. - * A transition from < 7 to 7 will cause a non-maskable interrupt (NMI). - */ -#define M68K_IRQ_NONE 0 -#define M68K_IRQ_1 1 -#define M68K_IRQ_2 2 -#define M68K_IRQ_3 3 -#define M68K_IRQ_4 4 -#define M68K_IRQ_5 5 -#define M68K_IRQ_6 6 -#define M68K_IRQ_7 7 - - -/* Special interrupt acknowledge values. - * Use these as special returns from the interrupt acknowledge callback - * (specified later in this header). - */ - -/* Causes an interrupt autovector (0x18 + interrupt level) to be taken. - * This happens in a real 68K if VPA or AVEC is asserted during an interrupt - * acknowledge cycle instead of DTACK. - */ -#define M68K_INT_ACK_AUTOVECTOR 0xffffffff - -/* Causes the spurious interrupt vector (0x18) to be taken - * This happens in a real 68K if BERR is asserted during the interrupt - * acknowledge cycle (i.e. no devices responded to the acknowledge). - */ -#define M68K_INT_ACK_SPURIOUS 0xfffffffe - - -/* CPU types for use in m68k_set_cpu_type() */ -enum -{ - M68K_CPU_TYPE_INVALID, - M68K_CPU_TYPE_68000, - M68K_CPU_TYPE_68008, - M68K_CPU_TYPE_68010, - M68K_CPU_TYPE_68EC020, - M68K_CPU_TYPE_68020, - M68K_CPU_TYPE_68030, /* Supported by disassembler ONLY */ - M68K_CPU_TYPE_68040 /* Supported by disassembler ONLY */ -}; - -/* Registers used by m68k_get_reg() and m68k_set_reg() */ -enum _m68k_register_t -{ - /* Real registers */ - M68K_REG_D0, /* Data registers */ - M68K_REG_D1, - M68K_REG_D2, - M68K_REG_D3, - M68K_REG_D4, - M68K_REG_D5, - M68K_REG_D6, - M68K_REG_D7, - M68K_REG_A0, /* Address registers */ - M68K_REG_A1, - M68K_REG_A2, - M68K_REG_A3, - M68K_REG_A4, - M68K_REG_A5, - M68K_REG_A6, - M68K_REG_A7, - M68K_REG_PC, /* Program Counter */ - M68K_REG_SR, /* Status Register */ - M68K_REG_SP, /* The current Stack Pointer (located in A7) */ - M68K_REG_USP, /* User Stack Pointer */ - M68K_REG_ISP, /* Interrupt Stack Pointer */ - M68K_REG_MSP, /* Master Stack Pointer */ - M68K_REG_SFC, /* Source Function Code */ - M68K_REG_DFC, /* Destination Function Code */ - M68K_REG_VBR, /* Vector Base Register */ - M68K_REG_CACR, /* Cache Control Register */ - M68K_REG_CAAR, /* Cache Address Register */ - - /* Assumed registers */ - /* These are cheat registers which emulate the 1-longword prefetch - * present in the 68000 and 68010. - */ - M68K_REG_PREF_ADDR, /* Last prefetch address */ - M68K_REG_PREF_DATA, /* Last prefetch data */ - - /* Convenience registers */ - M68K_REG_PPC, /* Previous value in the program counter */ - M68K_REG_IR, /* Instruction register */ - M68K_REG_CPU_TYPE /* Type of CPU being run */ -}; -typedef enum _m68k_register_t m68k_register_t; - - - -/* ======================================================================== */ -/* ====================== FUNCTIONS CALLED BY THE CPU ===================== */ -/* ======================================================================== */ - -/* You will have to implement these functions */ - -/* read/write functions called by the CPU to access memory. - * while values used are 32 bits, only the appropriate number - * of bits are relevant (i.e. in write_memory_8, only the lower 8 bits - * of value should be written to memory). - * - * NOTE: I have separated the immediate and PC-relative memory fetches - * from the other memory fetches because some systems require - * differentiation between PROGRAM and DATA fetches (usually - * for security setups such as encryption). - * This separation can either be achieved by setting - * M68K_SEPARATE_READS in m68kconf.h and defining - * the read functions, or by setting M68K_EMULATE_FC and - * making a function code callback function. - * Using the callback offers better emulation coverage - * because you can also monitor whether the CPU is in SYSTEM or - * USER mode, but it is also slower. - */ - -/* Read from anywhere */ -unsigned int m68k_read_memory_8(unsigned int address); -unsigned int m68k_read_memory_16(unsigned int address); -unsigned int m68k_read_memory_32(unsigned int address); - -/* Read data immediately following the PC */ -unsigned int m68k_read_immediate_16(unsigned int address); -unsigned int m68k_read_immediate_32(unsigned int address); - -/* Read data relative to the PC */ -unsigned int m68k_read_pcrelative_8(unsigned int address); -unsigned int m68k_read_pcrelative_16(unsigned int address); -unsigned int m68k_read_pcrelative_32(unsigned int address); - -/* Memory access for the disassembler */ -unsigned int m68k_read_disassembler_8 (unsigned int address); -unsigned int m68k_read_disassembler_16 (unsigned int address); -unsigned int m68k_read_disassembler_32 (unsigned int address); - -/* Write to anywhere */ -void m68k_write_memory_8(unsigned int address, unsigned int value); -void m68k_write_memory_16(unsigned int address, unsigned int value); -void m68k_write_memory_32(unsigned int address, unsigned int value); - -/* Special call to simulate undocumented 68k behavior when move.l with a - * predecrement destination mode is executed. - * To simulate real 68k behavior, first write the high word to - * [address+2], and then write the low word to [address]. - * - * Enable this functionality with M68K_SIMULATE_PD_WRITES in m68kconf.h. - */ -void m68k_write_memory_32_pd(unsigned int address, unsigned int value); - - - -/* ======================================================================== */ -/* ============================== CALLBACKS =============================== */ -/* ======================================================================== */ - -/* These functions allow you to set callbacks to the host when specific events - * occur. Note that you must enable the corresponding value in m68kconf.h - * in order for these to do anything useful. - * Note: I have defined default callbacks which are used if you have enabled - * the corresponding #define in m68kconf.h but either haven't assigned a - * callback or have assigned a callback of NULL. - */ - -/* Set the callback for an interrupt acknowledge. - * You must enable M68K_EMULATE_INT_ACK in m68kconf.h. - * The CPU will call the callback with the interrupt level being acknowledged. - * The host program must return either a vector from 0x02-0xff, or one of the - * special interrupt acknowledge values specified earlier in this header. - * If this is not implemented, the CPU will always assume an autovectored - * interrupt, and will automatically clear the interrupt request when it - * services the interrupt. - * Default behavior: return M68K_INT_ACK_AUTOVECTOR. - */ -void m68k_set_int_ack_callback(int (*callback)(int int_level)); - - -/* Set the callback for a breakpoint acknowledge (68010+). - * You must enable M68K_EMULATE_BKPT_ACK in m68kconf.h. - * The CPU will call the callback with whatever was in the data field of the - * BKPT instruction for 68020+, or 0 for 68010. - * Default behavior: do nothing. - */ -void m68k_set_bkpt_ack_callback(void (*callback)(unsigned int data)); - - -/* Set the callback for the RESET instruction. - * You must enable M68K_EMULATE_RESET in m68kconf.h. - * The CPU calls this callback every time it encounters a RESET instruction. - * Default behavior: do nothing. - */ -void m68k_set_reset_instr_callback(void (*callback)(void)); - - -/* Set the callback for the CMPI.L #v, Dn instruction. - * You must enable M68K_CMPILD_HAS_CALLBACK in m68kconf.h. - * The CPU calls this callback every time it encounters a CMPI.L #v, Dn instruction. - * Default behavior: do nothing. - */ -void m68k_set_cmpild_instr_callback(void (*callback)(unsigned int val, int reg)); - - -/* Set the callback for the RTE instruction. - * You must enable M68K_RTE_HAS_CALLBACK in m68kconf.h. - * The CPU calls this callback every time it encounters a RTE instruction. - * Default behavior: do nothing. - */ -void m68k_set_rte_instr_callback(void (*callback)(void)); - -/* Set the callback for the TAS instruction. - * You must enable M68K_TAS_HAS_CALLBACK in m68kconf.h. - * The CPU calls this callback every time it encounters a TAS instruction. - * Default behavior: return 1, allow writeback. - */ -void m68k_set_tas_instr_callback(int (*callback)(void)); - - - -/* Set the callback for informing of a large PC change. - * You must enable M68K_MONITOR_PC in m68kconf.h. - * The CPU calls this callback with the new PC value every time the PC changes - * by a large value (currently set for changes by longwords). - * Default behavior: do nothing. - */ -void m68k_set_pc_changed_callback(void (*callback)(unsigned int new_pc)); - - -/* Set the callback for CPU function code changes. - * You must enable M68K_EMULATE_FC in m68kconf.h. - * The CPU calls this callback with the function code before every memory - * access to set the CPU's function code according to what kind of memory - * access it is (supervisor/user, program/data and such). - * Default behavior: do nothing. - */ -void m68k_set_fc_callback(void (*callback)(unsigned int new_fc)); - - -/* Set a callback for the instruction cycle of the CPU. - * You must enable M68K_INSTRUCTION_HOOK in m68kconf.h. - * The CPU calls this callback just before fetching the opcode in the - * instruction cycle. - * Default behavior: do nothing. - */ -void m68k_set_instr_hook_callback(void (*callback)(unsigned int pc)); - - - -/* ======================================================================== */ -/* ====================== FUNCTIONS TO ACCESS THE CPU ===================== */ -/* ======================================================================== */ - -/* Use this function to set the CPU type you want to emulate. - * Currently supported types are: M68K_CPU_TYPE_68000, M68K_CPU_TYPE_68008, - * M68K_CPU_TYPE_68010, M68K_CPU_TYPE_EC020, and M68K_CPU_TYPE_68020. - */ -void m68k_set_cpu_type(unsigned int cpu_type); - -/* Do whatever initialisations the core requires. Should be called - * at least once at init time. - */ -void m68k_init(void); - -/* Pulse the RESET pin on the CPU. - * You *MUST* reset the CPU at least once to initialize the emulation - * Note: If you didn't call m68k_set_cpu_type() before resetting - * the CPU for the first time, the CPU will be set to - * M68K_CPU_TYPE_68000. - */ -void m68k_pulse_reset(void); - -/* execute num_cycles worth of instructions. returns number of cycles used */ -int m68k_execute(int num_cycles); - -/* These functions let you read/write/modify the number of cycles left to run - * while m68k_execute() is running. - * These are useful if the 68k accesses a memory-mapped port on another device - * that requires immediate processing by another CPU. - */ -int m68k_cycles_run(void); /* Number of cycles run so far */ -int m68k_cycles_remaining(void); /* Number of cycles left */ -void m68k_modify_timeslice(int cycles); /* Modify cycles left */ -void m68k_end_timeslice(void); /* End timeslice now */ -void m68k_burn_until_irq(int enabled); /* Sleep until INT (speedhacks) */ - -/* Set the IPL0-IPL2 pins on the CPU (IRQ). - * A transition from < 7 to 7 will cause a non-maskable interrupt (NMI). - * Setting IRQ to 0 will clear an interrupt request. - */ -void m68k_set_irq(unsigned int int_level); - -/* Set the virtual irq lines, where the highest level - * active line is automatically selected. If you use this function, - * do not use m68k_set_irq. - */ -void m68k_set_virq(unsigned int level, unsigned int active); -unsigned int m68k_get_virq(unsigned int level); - -/* For Megadrive -dink */ -int m68k_check_shouldinterrupt(void); - -/* Halt the CPU as if you pulsed the HALT pin. */ -void m68k_pulse_halt(void); - - -/* Context switching to allow multiple CPUs */ - -/* Get the size of the cpu context in bytes */ -unsigned int m68k_context_size(void); - -/* Get the size of the cpu context without the pointer-block, for savestates */ -unsigned int m68k_context_size_no_pointers(void); - -/* Get a cpu context */ -unsigned int m68k_get_context(void* dst); - -/* set the current cpu context */ -void m68k_set_context(void* dst); - -/* Register the CPU state information */ -void m68k_state_register(const char *type, int index); - - -/* Peek at the internals of a CPU context. This can either be a context - * retrieved using m68k_get_context() or the currently running context. - * If context is NULL, the currently running CPU context will be used. - */ -unsigned int m68k_get_reg(void* context, m68k_register_t reg); - -/* Poke values into the internals of the currently running CPU context */ -void m68k_set_reg(m68k_register_t reg, unsigned int value); - -/* Check if an instruction is valid for the specified CPU type */ -unsigned int m68k_is_valid_instruction(unsigned int instruction, unsigned int cpu_type); - -/* Disassemble 1 instruction using the epecified CPU type at pc. Stores - * disassembly in str_buff and returns the size of the instruction in bytes. - */ -unsigned int m68k_disassemble(char* str_buff, unsigned int pc, unsigned int cpu_type); - -/* Same as above but accepts raw opcode data directly rather than fetching - * via the read/write interfaces. - */ -unsigned int m68k_disassemble_raw(char* str_buff, unsigned int pc, const unsigned char* opdata, const unsigned char* argdata, unsigned int cpu_type); - - -/* ======================================================================== */ -/* ============================= CONFIGURATION ============================ */ -/* ======================================================================== */ - -/* Import the configuration for this build */ -#include "m68kconf.h" - - -/* ======================================================================== */ -/* ============================== END OF FILE ============================= */ -/* ======================================================================== */ - -#ifdef __cplusplus - } -#endif - -#endif /* M68K__HEADER */ diff --git a/jan/src/cpu/m68k/m68k_in.c b/jan/src/cpu/m68k/m68k_in.c deleted file mode 100644 index 295f3519b..000000000 --- a/jan/src/cpu/m68k/m68k_in.c +++ /dev/null @@ -1,10687 +0,0 @@ -/* -must fix: - callm - chk -*/ -/* ======================================================================== */ -/* ========================= LICENSING & COPYRIGHT ======================== */ -/* ======================================================================== */ -/* - * MUSASHI - * Version 3.32 - * - * A portable Motorola M680x0 processor emulation engine. - * Copyright Karl Stenerud. All rights reserved. - * - * This code may be freely used for non-commercial purposes as long as this - * copyright notice remains unaltered in the source code and any binary files - * containing this code in compiled form. - * - * All other licensing terms must be negotiated with the author - * (Karl Stenerud). - * - * The latest version of this code can be obtained at: - * http://kstenerud.cjb.net - */ - -/* Special thanks to Bart Trzynadlowski for his insight into the - * undocumented features of this chip: - * - * http://dynarec.com/~bart/files/68knotes.txt - */ - - -/* Input file for m68kmake - * ----------------------- - * - * All sections begin with 80 X's in a row followed by an end-of-line - * sequence. - * After this, m68kmake will expect to find one of the following section - * identifiers: - * M68KMAKE_PROTOTYPE_HEADER - header for opcode handler prototypes - * M68KMAKE_PROTOTYPE_FOOTER - footer for opcode handler prototypes - * M68KMAKE_TABLE_HEADER - header for opcode handler jumptable - * M68KMAKE_TABLE_FOOTER - footer for opcode handler jumptable - * M68KMAKE_TABLE_BODY - the table itself - * M68KMAKE_OPCODE_HANDLER_HEADER - header for opcode handler implementation - * M68KMAKE_OPCODE_HANDLER_FOOTER - footer for opcode handler implementation - * M68KMAKE_OPCODE_HANDLER_BODY - body section for opcode handler implementation - * - * NOTE: M68KMAKE_OPCODE_HANDLER_BODY must be last in the file and - * M68KMAKE_TABLE_BODY must be second last in the file. - * - * The M68KMAKE_OPHANDLER_BODY section contains the opcode handler - * primitives themselves. Each opcode handler begins with: - * M68KMAKE_OP(A, B, C, D) - * - * where A is the opcode handler name, B is the size of the operation, - * C denotes any special processing mode, and D denotes a specific - * addressing mode. - * For C and D where nothing is specified, use "." - * - * Example: - * M68KMAKE_OP(abcd, 8, rr, .) abcd, size 8, register to register, default EA - * M68KMAKE_OP(abcd, 8, mm, ax7) abcd, size 8, memory to memory, register X is A7 - * M68KMAKE_OP(tst, 16, ., pcix) tst, size 16, PCIX addressing - * - * All opcode handler primitives end with a closing curly brace "}" at column 1 - * - * NOTE: Do not place a M68KMAKE_OP() directive inside the opcode handler, - * and do not put a closing curly brace at column 1 unless it is - * marking the end of the handler! - * - * Inside the handler, m68kmake will recognize M68KMAKE_GET_OPER_xx_xx, - * M68KMAKE_GET_EA_xx_xx, and M68KMAKE_CC directives, and create multiple - * opcode handlers to handle variations in the opcode handler. - * Note: M68KMAKE_CC will only be interpreted in condition code opcodes. - * As well, M68KMAKE_GET_EA_xx_xx and M68KMAKE_GET_OPER_xx_xx will only - * be interpreted on instructions where the corresponding table entry - * specifies multiple effective addressing modes. - * Example: - * clr 32 . . 0100001010...... A+-DXWL... U U U 12 6 4 - * - * This table entry says that the clr.l opcde has 7 variations (A+-DXWL). - * It is run in user or supervisor mode for all CPUs, and uses 12 cycles for - * 68000, 6 cycles for 68010, and 4 cycles for 68020. - */ - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -M68KMAKE_PROTOTYPE_HEADER - -#ifndef M68KOPS__HEADER -#define M68KOPS__HEADER - -/* ======================================================================== */ -/* ============================ OPCODE HANDLERS =========================== */ -/* ======================================================================== */ - - - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -M68KMAKE_PROTOTYPE_FOOTER - - -/* Build the opcode handler table */ -void m68ki_build_opcode_table(void); - -extern void (*m68ki_instruction_jump_table[0x10000])(void); /* opcode handler jump table */ -extern unsigned char m68ki_cycles[][0x10000]; - - -/* ======================================================================== */ -/* ============================== END OF FILE ============================= */ -/* ======================================================================== */ - -#endif /* M68KOPS__HEADER */ - - - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -M68KMAKE_TABLE_HEADER - -/* ======================================================================== */ -/* ========================= OPCODE TABLE BUILDER ========================= */ -/* ======================================================================== */ - -#include "m68kops.h" - -#define NUM_CPU_TYPES 4 - -void (*m68ki_instruction_jump_table[0x10000])(void); /* opcode handler jump table */ -unsigned char m68ki_cycles[NUM_CPU_TYPES][0x10000]; /* Cycles used by CPU type */ - -/* This is used to generate the opcode handler jump table */ -typedef struct -{ - void (*opcode_handler)(void); /* handler function */ - unsigned int mask; /* mask on opcode */ - unsigned int match; /* what to match after masking */ - unsigned char cycles[NUM_CPU_TYPES]; /* cycles each cpu type takes */ -} opcode_handler_struct; - - -/* Opcode handler table */ -static const opcode_handler_struct m68k_opcode_handler_table[] = -{ -/* function mask match 000 010 020 040 */ - - - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -M68KMAKE_TABLE_FOOTER - - {0, 0, 0, {0, 0, 0, 0}} -}; - - -/* Build the opcode handler jump table */ -void m68ki_build_opcode_table(void) -{ - const opcode_handler_struct *ostruct; - int instr; - int i; - int j; - int k; - - for(i = 0; i < 0x10000; i++) - { - /* default to illegal */ - m68ki_instruction_jump_table[i] = m68k_op_illegal; - for(k=0;kmask != 0xff00) - { - for(i = 0;i < 0x10000;i++) - { - if((i & ostruct->mask) == ostruct->match) - { - m68ki_instruction_jump_table[i] = ostruct->opcode_handler; - for(k=0;kcycles[k]; - } - } - ostruct++; - } - while(ostruct->mask == 0xff00) - { - for(i = 0;i <= 0xff;i++) - { - m68ki_instruction_jump_table[ostruct->match | i] = ostruct->opcode_handler; - for(k=0;kmatch | i] = ostruct->cycles[k]; - } - ostruct++; - } - while(ostruct->mask == 0xf1f8) - { - for(i = 0;i < 8;i++) - { - for(j = 0;j < 8;j++) - { - instr = ostruct->match | (i << 9) | j; - m68ki_instruction_jump_table[instr] = ostruct->opcode_handler; - for(k=0;kcycles[k]; - } - } - ostruct++; - } - while(ostruct->mask == 0xfff0) - { - for(i = 0;i <= 0x0f;i++) - { - m68ki_instruction_jump_table[ostruct->match | i] = ostruct->opcode_handler; - for(k=0;kmatch | i] = ostruct->cycles[k]; - } - ostruct++; - } - while(ostruct->mask == 0xf1ff) - { - for(i = 0;i <= 0x07;i++) - { - m68ki_instruction_jump_table[ostruct->match | (i << 9)] = ostruct->opcode_handler; - for(k=0;kmatch | (i << 9)] = ostruct->cycles[k]; - } - ostruct++; - } - while(ostruct->mask == 0xfff8) - { - for(i = 0;i <= 0x07;i++) - { - m68ki_instruction_jump_table[ostruct->match | i] = ostruct->opcode_handler; - for(k=0;kmatch | i] = ostruct->cycles[k]; - } - ostruct++; - } - while(ostruct->mask == 0xffff) - { - m68ki_instruction_jump_table[ostruct->match] = ostruct->opcode_handler; - for(k=0;kmatch] = ostruct->cycles[k]; - ostruct++; - } -} - - -/* ======================================================================== */ -/* ============================== END OF FILE ============================= */ -/* ======================================================================== */ - - - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -M68KMAKE_OPCODE_HANDLER_HEADER - -#include "m68kcpu.h" -extern void m68040_fpu_op0(void); -extern void m68040_fpu_op1(void); - -/* ======================================================================== */ -/* ========================= INSTRUCTION HANDLERS ========================= */ -/* ======================================================================== */ - - - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -M68KMAKE_OPCODE_HANDLER_FOOTER - -/* ======================================================================== */ -/* ============================== END OF FILE ============================= */ -/* ======================================================================== */ - - - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -M68KMAKE_TABLE_BODY - -The following table is arranged as follows: - -name: Opcode mnemonic - -size: Operation size - -spec proc: Special processing mode: - .: normal - s: static operand - r: register operand - rr: register to register - mm: memory to memory - er: effective address to register - re: register to effective address - dd: data register to data register - da: data register to address register - aa: address register to address register - cr: control register to register - rc: register to control register - toc: to condition code register - tos: to status register - tou: to user stack pointer - frc: from condition code register - frs: from status register - fru: from user stack pointer - * for move.x, the special processing mode is a specific - destination effective addressing mode. - -spec ea: Specific effective addressing mode: - .: normal - i: immediate - d: data register - a: address register - ai: address register indirect - pi: address register indirect with postincrement - pd: address register indirect with predecrement - di: address register indirect with displacement - ix: address register indirect with index - aw: absolute word address - al: absolute long address - pcdi: program counter relative with displacement - pcix: program counter relative with index - a7: register specified in instruction is A7 - ax7: register field X of instruction is A7 - ay7: register field Y of instruction is A7 - axy7: register fields X and Y of instruction are A7 - -bit pattern: Pattern to recognize this opcode. "." means don't care. - -allowed ea: List of allowed addressing modes: - .: not present - A: address register indirect - +: ARI (address register indirect) with postincrement - -: ARI with predecrement - D: ARI with displacement - X: ARI with index - W: absolute word address - L: absolute long address - d: program counter indirect with displacement - x: program counter indirect with index - I: immediate -mode: CPU operating mode for each cpu type. U = user or supervisor, - S = supervisor only, "." = opcode not present. - -cpu cycles: Base number of cycles required to execute this opcode on the - specified CPU type. - Use "." if CPU does not have this opcode. - - - - spec spec allowed ea mode cpu cycles -name size proc ea bit pattern A+-DXWLdxI 0 1 2 4 000 010 020 040 comments -====== ==== ==== ==== ================ ========== = = = = === === === === ============= -M68KMAKE_TABLE_START -1010 0 . . 1010............ .......... U U U U 4 4 4 4 -1111 0 . . 1111............ .......... U U U U 4 4 4 4 -040fpu0 32 . . 11110010........ .......... . . . U . . . 0 -040fpu1 32 . . 11110011........ .......... . . . U . . . 0 -abcd 8 rr . 1100...100000... .......... U U U U 6 6 4 4 -abcd 8 mm ax7 1100111100001... .......... U U U U 18 18 16 16 -abcd 8 mm ay7 1100...100001111 .......... U U U U 18 18 16 16 -abcd 8 mm axy7 1100111100001111 .......... U U U U 18 18 16 16 -abcd 8 mm . 1100...100001... .......... U U U U 18 18 16 16 -add 8 er d 1101...000000... .......... U U U U 4 4 2 2 -add 8 er . 1101...000...... A+-DXWLdxI U U U U 4 4 2 2 -add 16 er d 1101...001000... .......... U U U U 4 4 2 2 -add 16 er a 1101...001001... .......... U U U U 4 4 2 2 -add 16 er . 1101...001...... A+-DXWLdxI U U U U 4 4 2 2 -add 32 er d 1101...010000... .......... U U U U 6 6 2 2 -add 32 er a 1101...010001... .......... U U U U 6 6 2 2 -add 32 er . 1101...010...... A+-DXWLdxI U U U U 6 6 2 2 -add 8 re . 1101...100...... A+-DXWL... U U U U 8 8 4 4 -add 16 re . 1101...101...... A+-DXWL... U U U U 8 8 4 4 -add 32 re . 1101...110...... A+-DXWL... U U U U 12 12 4 4 -adda 16 . d 1101...011000... .......... U U U U 8 8 2 2 -adda 16 . a 1101...011001... .......... U U U U 8 8 2 2 -adda 16 . . 1101...011...... A+-DXWLdxI U U U U 8 8 2 2 -adda 32 . d 1101...111000... .......... U U U U 6 6 2 2 -adda 32 . a 1101...111001... .......... U U U U 6 6 2 2 -adda 32 . . 1101...111...... A+-DXWLdxI U U U U 6 6 2 2 -addi 8 . d 0000011000000... .......... U U U U 8 8 2 2 -addi 8 . . 0000011000...... A+-DXWL... U U U U 12 12 4 4 -addi 16 . d 0000011001000... .......... U U U U 8 8 2 2 -addi 16 . . 0000011001...... A+-DXWL... U U U U 12 12 4 4 -addi 32 . d 0000011010000... .......... U U U U 16 14 2 2 -addi 32 . . 0000011010...... A+-DXWL... U U U U 20 20 4 4 -addq 8 . d 0101...000000... .......... U U U U 4 4 2 2 -addq 8 . . 0101...000...... A+-DXWL... U U U U 8 8 4 4 -addq 16 . d 0101...001000... .......... U U U U 4 4 2 2 -addq 16 . a 0101...001001... .......... U U U U 4 4 2 2 -addq 16 . . 0101...001...... A+-DXWL... U U U U 8 8 4 4 -addq 32 . d 0101...010000... .......... U U U U 8 8 2 2 -addq 32 . a 0101...010001... .......... U U U U 8 8 2 2 -addq 32 . . 0101...010...... A+-DXWL... U U U U 12 12 4 4 -addx 8 rr . 1101...100000... .......... U U U U 4 4 2 2 -addx 16 rr . 1101...101000... .......... U U U U 4 4 2 2 -addx 32 rr . 1101...110000... .......... U U U U 8 6 2 2 -addx 8 mm ax7 1101111100001... .......... U U U U 18 18 12 12 -addx 8 mm ay7 1101...100001111 .......... U U U U 18 18 12 12 -addx 8 mm axy7 1101111100001111 .......... U U U U 18 18 12 12 -addx 8 mm . 1101...100001... .......... U U U U 18 18 12 12 -addx 16 mm . 1101...101001... .......... U U U U 18 18 12 12 -addx 32 mm . 1101...110001... .......... U U U U 30 30 12 12 -and 8 er d 1100...000000... .......... U U U U 4 4 2 2 -and 8 er . 1100...000...... A+-DXWLdxI U U U U 4 4 2 2 -and 16 er d 1100...001000... .......... U U U U 4 4 2 2 -and 16 er . 1100...001...... A+-DXWLdxI U U U U 4 4 2 2 -and 32 er d 1100...010000... .......... U U U U 6 6 2 2 -and 32 er . 1100...010...... A+-DXWLdxI U U U U 6 6 2 2 -and 8 re . 1100...100...... A+-DXWL... U U U U 8 8 4 4 -and 16 re . 1100...101...... A+-DXWL... U U U U 8 8 4 4 -and 32 re . 1100...110...... A+-DXWL... U U U U 12 12 4 4 -andi 16 toc . 0000001000111100 .......... U U U U 20 16 12 12 -andi 16 tos . 0000001001111100 .......... S S S S 20 16 12 12 -andi 8 . d 0000001000000... .......... U U U U 8 8 2 2 -andi 8 . . 0000001000...... A+-DXWL... U U U U 12 12 4 4 -andi 16 . d 0000001001000... .......... U U U U 8 8 2 2 -andi 16 . . 0000001001...... A+-DXWL... U U U U 12 12 4 4 -andi 32 . d 0000001010000... .......... U U U U 14 14 2 2 -andi 32 . . 0000001010...... A+-DXWL... U U U U 20 20 4 4 -asr 8 s . 1110...000000... .......... U U U U 6 6 6 6 -asr 16 s . 1110...001000... .......... U U U U 6 6 6 6 -asr 32 s . 1110...010000... .......... U U U U 8 8 6 6 -asr 8 r . 1110...000100... .......... U U U U 6 6 6 6 -asr 16 r . 1110...001100... .......... U U U U 6 6 6 6 -asr 32 r . 1110...010100... .......... U U U U 8 8 6 6 -asr 16 . . 1110000011...... A+-DXWL... U U U U 8 8 5 5 -asl 8 s . 1110...100000... .......... U U U U 6 6 8 8 -asl 16 s . 1110...101000... .......... U U U U 6 6 8 8 -asl 32 s . 1110...110000... .......... U U U U 8 8 8 8 -asl 8 r . 1110...100100... .......... U U U U 6 6 8 8 -asl 16 r . 1110...101100... .......... U U U U 6 6 8 8 -asl 32 r . 1110...110100... .......... U U U U 8 8 8 8 -asl 16 . . 1110000111...... A+-DXWL... U U U U 8 8 6 6 -bcc 8 . . 0110............ .......... U U U U 10 10 6 6 -bcc 16 . . 0110....00000000 .......... U U U U 10 10 6 6 -bcc 32 . . 0110....11111111 .......... U U U U 10 10 6 6 -bchg 8 r . 0000...101...... A+-DXWL... U U U U 8 8 4 4 -bchg 32 r d 0000...101000... .......... U U U U 8 8 4 4 -bchg 8 s . 0000100001...... A+-DXWL... U U U U 12 12 4 4 -bchg 32 s d 0000100001000... .......... U U U U 12 12 4 4 -bclr 8 r . 0000...110...... A+-DXWL... U U U U 8 10 4 4 -bclr 32 r d 0000...110000... .......... U U U U 10 10 4 4 -bclr 8 s . 0000100010...... A+-DXWL... U U U U 12 12 4 4 -bclr 32 s d 0000100010000... .......... U U U U 14 14 4 4 -bfchg 32 . d 1110101011000... .......... . . U U . . 12 12 timing not quite correct -bfchg 32 . . 1110101011...... A..DXWL... . . U U . . 20 20 -bfclr 32 . d 1110110011000... .......... . . U U . . 12 12 -bfclr 32 . . 1110110011...... A..DXWL... . . U U . . 20 20 -bfexts 32 . d 1110101111000... .......... . . U U . . 8 8 -bfexts 32 . . 1110101111...... A..DXWLdx. . . U U . . 15 15 -bfextu 32 . d 1110100111000... .......... . . U U . . 8 8 -bfextu 32 . . 1110100111...... A..DXWLdx. . . U U . . 15 15 -bfffo 32 . d 1110110111000... .......... . . U U . . 18 18 -bfffo 32 . . 1110110111...... A..DXWLdx. . . U U . . 28 28 -bfins 32 . d 1110111111000... .......... . . U U . . 10 10 -bfins 32 . . 1110111111...... A..DXWL... . . U U . . 17 17 -bfset 32 . d 1110111011000... .......... . . U U . . 12 12 -bfset 32 . . 1110111011...... A..DXWL... . . U U . . 20 20 -bftst 32 . d 1110100011000... .......... . . U U . . 6 6 -bftst 32 . . 1110100011...... A..DXWLdx. . . U U . . 13 13 -bkpt 0 . . 0100100001001... .......... . U U U . 10 10 10 -bra 8 . . 01100000........ .......... U U U U 10 10 10 10 -bra 16 . . 0110000000000000 .......... U U U U 10 10 10 10 -bra 32 . . 0110000011111111 .......... U U U U 10 10 10 10 -bset 32 r d 0000...111000... .......... U U U U 8 8 4 4 -bset 8 r . 0000...111...... A+-DXWL... U U U U 8 8 4 4 -bset 8 s . 0000100011...... A+-DXWL... U U U U 12 12 4 4 -bset 32 s d 0000100011000... .......... U U U U 12 12 4 4 -bsr 8 . . 01100001........ .......... U U U U 18 18 7 7 -bsr 16 . . 0110000100000000 .......... U U U U 18 18 7 7 -bsr 32 . . 0110000111111111 .......... U U U U 18 18 7 7 -btst 8 r . 0000...100...... A+-DXWLdxI U U U U 4 4 4 4 -btst 32 r d 0000...100000... .......... U U U U 6 6 4 4 -btst 8 s . 0000100000...... A+-DXWLdx. U U U U 8 8 4 4 -btst 32 s d 0000100000000... .......... U U U U 10 10 4 4 -callm 32 . . 0000011011...... A..DXWLdx. . . U U . . 60 60 not properly emulated -cas 8 . . 0000101011...... A+-DXWL... . . U U . . 12 12 -cas 16 . . 0000110011...... A+-DXWL... . . U U . . 12 12 -cas 32 . . 0000111011...... A+-DXWL... . . U U . . 12 12 -cas2 16 . . 0000110011111100 .......... . . U U . . 12 12 -cas2 32 . . 0000111011111100 .......... . . U U . . 12 12 -chk 16 . d 0100...110000... .......... U U U U 10 8 8 8 -chk 16 . . 0100...110...... A+-DXWLdxI U U U U 10 8 8 8 -chk 32 . d 0100...100000... .......... . . U U . . 8 8 -chk 32 . . 0100...100...... A+-DXWLdxI . . U U . . 8 8 -chk2cmp2 8 . pcdi 0000000011111010 .......... . . U U . . 23 23 -chk2cmp2 8 . pcix 0000000011111011 .......... . . U U . . 23 23 -chk2cmp2 8 . . 0000000011...... A..DXWL... . . U U . . 18 18 -chk2cmp2 16 . pcdi 0000001011111010 .......... . . U U . . 23 23 -chk2cmp2 16 . pcix 0000001011111011 .......... . . U U . . 23 23 -chk2cmp2 16 . . 0000001011...... A..DXWL... . . U U . . 18 18 -chk2cmp2 32 . pcdi 0000010011111010 .......... . . U U . . 23 23 -chk2cmp2 32 . pcix 0000010011111011 .......... . . U U . . 23 23 -chk2cmp2 32 . . 0000010011...... A..DXWL... . . U U . . 18 18 -clr 8 . d 0100001000000... .......... U U U U 4 4 2 2 -clr 8 . . 0100001000...... A+-DXWL... U U U U 8 4 4 4 -clr 16 . d 0100001001000... .......... U U U U 4 4 2 2 -clr 16 . . 0100001001...... A+-DXWL... U U U U 8 4 4 4 -clr 32 . d 0100001010000... .......... U U U U 6 6 2 2 -clr 32 . . 0100001010...... A+-DXWL... U U U U 12 6 4 4 -cmp 8 . d 1011...000000... .......... U U U U 4 4 2 2 -cmp 8 . . 1011...000...... A+-DXWLdxI U U U U 4 4 2 2 -cmp 16 . d 1011...001000... .......... U U U U 4 4 2 2 -cmp 16 . a 1011...001001... .......... U U U U 4 4 2 2 -cmp 16 . . 1011...001...... A+-DXWLdxI U U U U 4 4 2 2 -cmp 32 . d 1011...010000... .......... U U U U 6 6 2 2 -cmp 32 . a 1011...010001... .......... U U U U 6 6 2 2 -cmp 32 . . 1011...010...... A+-DXWLdxI U U U U 6 6 2 2 -cmpa 16 . d 1011...011000... .......... U U U U 6 6 4 4 -cmpa 16 . a 1011...011001... .......... U U U U 6 6 4 4 -cmpa 16 . . 1011...011...... A+-DXWLdxI U U U U 6 6 4 4 -cmpa 32 . d 1011...111000... .......... U U U U 6 6 4 4 -cmpa 32 . a 1011...111001... .......... U U U U 6 6 4 4 -cmpa 32 . . 1011...111...... A+-DXWLdxI U U U U 6 6 4 4 -cmpi 8 . d 0000110000000... .......... U U U U 8 8 2 2 -cmpi 8 . . 0000110000...... A+-DXWL... U U U U 8 8 2 2 -cmpi 8 . pcdi 0000110000111010 .......... . . U U . . 7 7 -cmpi 8 . pcix 0000110000111011 .......... . . U U . . 9 9 -cmpi 16 . d 0000110001000... .......... U U U U 8 8 2 2 -cmpi 16 . . 0000110001...... A+-DXWL... U U U U 8 8 2 2 -cmpi 16 . pcdi 0000110001111010 .......... . . U U . . 7 7 -cmpi 16 . pcix 0000110001111011 .......... . . U U . . 9 9 -cmpi 32 . d 0000110010000... .......... U U U U 14 12 2 2 -cmpi 32 . . 0000110010...... A+-DXWL... U U U U 12 12 2 2 -cmpi 32 . pcdi 0000110010111010 .......... . . U U . . 7 7 -cmpi 32 . pcix 0000110010111011 .......... . . U U . . 9 9 -cmpm 8 . ax7 1011111100001... .......... U U U U 12 12 9 9 -cmpm 8 . ay7 1011...100001111 .......... U U U U 12 12 9 9 -cmpm 8 . axy7 1011111100001111 .......... U U U U 12 12 9 9 -cmpm 8 . . 1011...100001... .......... U U U U 12 12 9 9 -cmpm 16 . . 1011...101001... .......... U U U U 12 12 9 9 -cmpm 32 . . 1011...110001... .......... U U U U 20 20 9 9 -cpbcc 32 . . 1111...01....... .......... . . U . . . 4 . unemulated -cpdbcc 32 . . 1111...001001... .......... . . U . . . 4 . unemulated -cpgen 32 . . 1111...000...... .......... . . U . . . 4 . unemulated -cpscc 32 . . 1111...001...... .......... . . U . . . 4 . unemulated -cptrapcc 32 . . 1111...001111... .......... . . U . . . 4 . unemulated -dbt 16 . . 0101000011001... .......... U U U U 12 12 6 6 -dbf 16 . . 0101000111001... .......... U U U U 12 12 6 6 -dbcc 16 . . 0101....11001... .......... U U U U 12 12 6 6 -divs 16 . d 1000...111000... .......... U U U U 158 122 56 56 -divs 16 . . 1000...111...... A+-DXWLdxI U U U U 158 122 56 56 -divu 16 . d 1000...011000... .......... U U U U 140 108 44 44 -divu 16 . . 1000...011...... A+-DXWLdxI U U U U 140 108 44 44 -divl 32 . d 0100110001000... .......... . . U U . . 84 84 -divl 32 . . 0100110001...... A+-DXWLdxI . . U U . . 84 84 -eor 8 . d 1011...100000... .......... U U U U 4 4 2 2 -eor 8 . . 1011...100...... A+-DXWL... U U U U 8 8 4 4 -eor 16 . d 1011...101000... .......... U U U U 4 4 2 2 -eor 16 . . 1011...101...... A+-DXWL... U U U U 8 8 4 4 -eor 32 . d 1011...110000... .......... U U U U 8 6 2 2 -eor 32 . . 1011...110...... A+-DXWL... U U U U 12 12 4 4 -eori 16 toc . 0000101000111100 .......... U U U U 20 16 12 12 -eori 16 tos . 0000101001111100 .......... S S S S 20 16 12 12 -eori 8 . d 0000101000000... .......... U U U U 8 8 2 2 -eori 8 . . 0000101000...... A+-DXWL... U U U U 12 12 4 4 -eori 16 . d 0000101001000... .......... U U U U 8 8 2 2 -eori 16 . . 0000101001...... A+-DXWL... U U U U 12 12 4 4 -eori 32 . d 0000101010000... .......... U U U U 16 14 2 2 -eori 32 . . 0000101010...... A+-DXWL... U U U U 20 20 4 4 -exg 32 dd . 1100...101000... .......... U U U U 6 6 2 2 -exg 32 aa . 1100...101001... .......... U U U U 6 6 2 2 -exg 32 da . 1100...110001... .......... U U U U 6 6 2 2 -ext 16 . . 0100100010000... .......... U U U U 4 4 4 4 -ext 32 . . 0100100011000... .......... U U U U 4 4 4 4 -extb 32 . . 0100100111000... .......... . . U U . . 4 4 -illegal 0 . . 0100101011111100 .......... U U U U 4 4 4 4 -jmp 32 . . 0100111011...... A..DXWLdx. U U U U 4 4 0 0 -jsr 32 . . 0100111010...... A..DXWLdx. U U U U 12 12 0 0 -lea 32 . . 0100...111...... A..DXWLdx. U U U U 0 0 2 2 -link 16 . a7 0100111001010111 .......... U U U U 16 16 5 5 -link 16 . . 0100111001010... .......... U U U U 16 16 5 5 -link 32 . a7 0100100000001111 .......... . . U U . . 6 6 -link 32 . . 0100100000001... .......... . . U U . . 6 6 -lsr 8 s . 1110...000001... .......... U U U U 6 6 4 4 -lsr 16 s . 1110...001001... .......... U U U U 6 6 4 4 -lsr 32 s . 1110...010001... .......... U U U U 8 8 4 4 -lsr 8 r . 1110...000101... .......... U U U U 6 6 6 6 -lsr 16 r . 1110...001101... .......... U U U U 6 6 6 6 -lsr 32 r . 1110...010101... .......... U U U U 8 8 6 6 -lsr 16 . . 1110001011...... A+-DXWL... U U U U 8 8 5 5 -lsl 8 s . 1110...100001... .......... U U U U 6 6 4 4 -lsl 16 s . 1110...101001... .......... U U U U 6 6 4 4 -lsl 32 s . 1110...110001... .......... U U U U 8 8 4 4 -lsl 8 r . 1110...100101... .......... U U U U 6 6 6 6 -lsl 16 r . 1110...101101... .......... U U U U 6 6 6 6 -lsl 32 r . 1110...110101... .......... U U U U 8 8 6 6 -lsl 16 . . 1110001111...... A+-DXWL... U U U U 8 8 5 5 -move 8 d d 0001...000000... .......... U U U U 4 4 2 2 -move 8 d . 0001...000...... A+-DXWLdxI U U U U 4 4 2 2 -move 8 ai d 0001...010000... .......... U U U U 8 8 4 4 -move 8 ai . 0001...010...... A+-DXWLdxI U U U U 8 8 4 4 -move 8 pi d 0001...011000... .......... U U U U 8 8 4 4 -move 8 pi . 0001...011...... A+-DXWLdxI U U U U 8 8 4 4 -move 8 pi7 d 0001111011000... .......... U U U U 8 8 4 4 -move 8 pi7 . 0001111011...... A+-DXWLdxI U U U U 8 8 4 4 -move 8 pd d 0001...100000... .......... U U U U 8 8 5 5 -move 8 pd . 0001...100...... A+-DXWLdxI U U U U 8 8 5 5 -move 8 pd7 d 0001111100000... .......... U U U U 8 8 5 5 -move 8 pd7 . 0001111100...... A+-DXWLdxI U U U U 8 8 5 5 -move 8 di d 0001...101000... .......... U U U U 12 12 5 5 -move 8 di . 0001...101...... A+-DXWLdxI U U U U 12 12 5 5 -move 8 ix d 0001...110000... .......... U U U U 14 14 7 7 -move 8 ix . 0001...110...... A+-DXWLdxI U U U U 14 14 7 7 -move 8 aw d 0001000111000... .......... U U U U 12 12 4 4 -move 8 aw . 0001000111...... A+-DXWLdxI U U U U 12 12 4 4 -move 8 al d 0001001111000... .......... U U U U 16 16 6 6 -move 8 al . 0001001111...... A+-DXWLdxI U U U U 16 16 6 6 -move 16 d d 0011...000000... .......... U U U U 4 4 2 2 -move 16 d a 0011...000001... .......... U U U U 4 4 2 2 -move 16 d . 0011...000...... A+-DXWLdxI U U U U 4 4 2 2 -move 16 ai d 0011...010000... .......... U U U U 8 8 4 4 -move 16 ai a 0011...010001... .......... U U U U 8 8 4 4 -move 16 ai . 0011...010...... A+-DXWLdxI U U U U 8 8 4 4 -move 16 pi d 0011...011000... .......... U U U U 8 8 4 4 -move 16 pi a 0011...011001... .......... U U U U 8 8 4 4 -move 16 pi . 0011...011...... A+-DXWLdxI U U U U 8 8 4 4 -move 16 pd d 0011...100000... .......... U U U U 8 8 5 5 -move 16 pd a 0011...100001... .......... U U U U 8 8 5 5 -move 16 pd . 0011...100...... A+-DXWLdxI U U U U 8 8 5 5 -move 16 di d 0011...101000... .......... U U U U 12 12 5 5 -move 16 di a 0011...101001... .......... U U U U 12 12 5 5 -move 16 di . 0011...101...... A+-DXWLdxI U U U U 12 12 5 5 -move 16 ix d 0011...110000... .......... U U U U 14 14 7 7 -move 16 ix a 0011...110001... .......... U U U U 14 14 7 7 -move 16 ix . 0011...110...... A+-DXWLdxI U U U U 14 14 7 7 -move 16 aw d 0011000111000... .......... U U U U 12 12 4 4 -move 16 aw a 0011000111001... .......... U U U U 12 12 4 4 -move 16 aw . 0011000111...... A+-DXWLdxI U U U U 12 12 4 4 -move 16 al d 0011001111000... .......... U U U U 16 16 6 6 -move 16 al a 0011001111001... .......... U U U U 16 16 6 6 -move 16 al . 0011001111...... A+-DXWLdxI U U U U 16 16 6 6 -move 32 d d 0010...000000... .......... U U U U 4 4 2 2 -move 32 d a 0010...000001... .......... U U U U 4 4 2 2 -move 32 d . 0010...000...... A+-DXWLdxI U U U U 4 4 2 2 -move 32 ai d 0010...010000... .......... U U U U 12 12 4 4 -move 32 ai a 0010...010001... .......... U U U U 12 12 4 4 -move 32 ai . 0010...010...... A+-DXWLdxI U U U U 12 12 4 4 -move 32 pi d 0010...011000... .......... U U U U 12 12 4 4 -move 32 pi a 0010...011001... .......... U U U U 12 12 4 4 -move 32 pi . 0010...011...... A+-DXWLdxI U U U U 12 12 4 4 -move 32 pd d 0010...100000... .......... U U U U 12 14 5 5 -move 32 pd a 0010...100001... .......... U U U U 12 14 5 5 -move 32 pd . 0010...100...... A+-DXWLdxI U U U U 12 14 5 5 -move 32 di d 0010...101000... .......... U U U U 16 16 5 5 -move 32 di a 0010...101001... .......... U U U U 16 16 5 5 -move 32 di . 0010...101...... A+-DXWLdxI U U U U 16 16 5 5 -move 32 ix d 0010...110000... .......... U U U U 18 18 7 7 -move 32 ix a 0010...110001... .......... U U U U 18 18 7 7 -move 32 ix . 0010...110...... A+-DXWLdxI U U U U 18 18 7 7 -move 32 aw d 0010000111000... .......... U U U U 16 16 4 4 -move 32 aw a 0010000111001... .......... U U U U 16 16 4 4 -move 32 aw . 0010000111...... A+-DXWLdxI U U U U 16 16 4 4 -move 32 al d 0010001111000... .......... U U U U 20 20 6 6 -move 32 al a 0010001111001... .......... U U U U 20 20 6 6 -move 32 al . 0010001111...... A+-DXWLdxI U U U U 20 20 6 6 -movea 16 . d 0011...001000... .......... U U U U 4 4 2 2 -movea 16 . a 0011...001001... .......... U U U U 4 4 2 2 -movea 16 . . 0011...001...... A+-DXWLdxI U U U U 4 4 2 2 -movea 32 . d 0010...001000... .......... U U U U 4 4 2 2 -movea 32 . a 0010...001001... .......... U U U U 4 4 2 2 -movea 32 . . 0010...001...... A+-DXWLdxI U U U U 4 4 2 2 -move 16 frc d 0100001011000... .......... . U U U . 4 4 4 -move 16 frc . 0100001011...... A+-DXWL... . U U U . 8 4 4 -move 16 toc d 0100010011000... .......... U U U U 12 12 4 4 -move 16 toc . 0100010011...... A+-DXWLdxI U U U U 12 12 4 4 -move 16 frs d 0100000011000... .......... U S S S 6 4 8 8 U only for 000 -move 16 frs . 0100000011...... A+-DXWL... U S S S 8 8 8 8 U only for 000 -move 16 tos d 0100011011000... .......... S S S S 12 12 8 8 -move 16 tos . 0100011011...... A+-DXWLdxI S S S S 12 12 8 8 -move 32 fru . 0100111001101... .......... S S S S 4 6 2 2 -move 32 tou . 0100111001100... .......... S S S S 4 6 2 2 -movec 32 cr . 0100111001111010 .......... . S S S . 12 6 6 -movec 32 rc . 0100111001111011 .......... . S S S . 10 12 12 -movem 16 re pd 0100100010100... .......... U U U U 8 8 4 4 -movem 16 re . 0100100010...... A..DXWL... U U U U 8 8 4 4 -movem 32 re pd 0100100011100... .......... U U U U 8 8 4 4 -movem 32 re . 0100100011...... A..DXWL... U U U U 8 8 4 4 -movem 16 er pi 0100110010011... .......... U U U U 12 12 8 8 -movem 16 er pcdi 0100110010111010 .......... U U U U 16 16 9 9 -movem 16 er pcix 0100110010111011 .......... U U U U 18 18 11 11 -movem 16 er . 0100110010...... A..DXWL... U U U U 12 12 8 8 -movem 32 er pi 0100110011011... .......... U U U U 12 12 8 8 -movem 32 er pcdi 0100110011111010 .......... U U U U 16 16 9 9 -movem 32 er pcix 0100110011111011 .......... U U U U 18 18 11 11 -movem 32 er . 0100110011...... A..DXWL... U U U U 12 12 8 8 -movep 16 er . 0000...100001... .......... U U U U 16 16 12 12 -movep 32 er . 0000...101001... .......... U U U U 24 24 18 18 -movep 16 re . 0000...110001... .......... U U U U 16 16 11 11 -movep 32 re . 0000...111001... .......... U U U U 24 24 17 17 -moveq 32 . . 0111...0........ .......... U U U U 4 4 2 2 -moves 8 . . 0000111000...... A+-DXWL... . S S S . 14 5 5 -moves 16 . . 0000111001...... A+-DXWL... . S S S . 14 5 5 -moves 32 . . 0000111010...... A+-DXWL... . S S S . 16 5 5 -move16 32 . . 1111011000100... .......... . . . U . . . 4 TODO: correct timing -muls 16 . d 1100...111000... .......... U U U U 54 32 27 27 -muls 16 . . 1100...111...... A+-DXWLdxI U U U U 54 32 27 27 -mulu 16 . d 1100...011000... .......... U U U U 54 30 27 27 -mulu 16 . . 1100...011...... A+-DXWLdxI U U U U 54 30 27 27 -mull 32 . d 0100110000000... .......... . . U U . . 43 43 -mull 32 . . 0100110000...... A+-DXWLdxI . . U U . . 43 43 -nbcd 8 . d 0100100000000... .......... U U U U 6 6 6 6 -nbcd 8 . . 0100100000...... A+-DXWL... U U U U 8 8 6 6 -neg 8 . d 0100010000000... .......... U U U U 4 4 2 2 -neg 8 . . 0100010000...... A+-DXWL... U U U U 8 8 4 4 -neg 16 . d 0100010001000... .......... U U U U 4 4 2 2 -neg 16 . . 0100010001...... A+-DXWL... U U U U 8 8 4 4 -neg 32 . d 0100010010000... .......... U U U U 6 6 2 2 -neg 32 . . 0100010010...... A+-DXWL... U U U U 12 12 4 4 -negx 8 . d 0100000000000... .......... U U U U 4 4 2 2 -negx 8 . . 0100000000...... A+-DXWL... U U U U 8 8 4 4 -negx 16 . d 0100000001000... .......... U U U U 4 4 2 2 -negx 16 . . 0100000001...... A+-DXWL... U U U U 8 8 4 4 -negx 32 . d 0100000010000... .......... U U U U 6 6 2 2 -negx 32 . . 0100000010...... A+-DXWL... U U U U 12 12 4 4 -nop 0 . . 0100111001110001 .......... U U U U 4 4 2 2 -not 8 . d 0100011000000... .......... U U U U 4 4 2 2 -not 8 . . 0100011000...... A+-DXWL... U U U U 8 8 4 4 -not 16 . d 0100011001000... .......... U U U U 4 4 2 2 -not 16 . . 0100011001...... A+-DXWL... U U U U 8 8 4 4 -not 32 . d 0100011010000... .......... U U U U 6 6 2 2 -not 32 . . 0100011010...... A+-DXWL... U U U U 12 12 4 4 -or 8 er d 1000...000000... .......... U U U U 4 4 2 2 -or 8 er . 1000...000...... A+-DXWLdxI U U U U 4 4 2 2 -or 16 er d 1000...001000... .......... U U U U 4 4 2 2 -or 16 er . 1000...001...... A+-DXWLdxI U U U U 4 4 2 2 -or 32 er d 1000...010000... .......... U U U U 6 6 2 2 -or 32 er . 1000...010...... A+-DXWLdxI U U U U 6 6 2 2 -or 8 re . 1000...100...... A+-DXWL... U U U U 8 8 4 4 -or 16 re . 1000...101...... A+-DXWL... U U U U 8 8 4 4 -or 32 re . 1000...110...... A+-DXWL... U U U U 12 12 4 4 -ori 16 toc . 0000000000111100 .......... U U U U 20 16 12 12 -ori 16 tos . 0000000001111100 .......... S S S S 20 16 12 12 -ori 8 . d 0000000000000... .......... U U U U 8 8 2 2 -ori 8 . . 0000000000...... A+-DXWL... U U U U 12 12 4 4 -ori 16 . d 0000000001000... .......... U U U U 8 8 2 2 -ori 16 . . 0000000001...... A+-DXWL... U U U U 12 12 4 4 -ori 32 . d 0000000010000... .......... U U U U 16 14 2 2 -ori 32 . . 0000000010...... A+-DXWL... U U U U 20 20 4 4 -pack 16 rr . 1000...101000... .......... . . U U . . 6 6 -pack 16 mm ax7 1000111101001... .......... . . U U . . 13 13 -pack 16 mm ay7 1000...101001111 .......... . . U U . . 13 13 -pack 16 mm axy7 1000111101001111 .......... . . U U . . 13 13 -pack 16 mm . 1000...101001... .......... . . U U . . 13 13 -pea 32 . . 0100100001...... A..DXWLdx. U U U U 6 6 5 5 -pflush 32 . . 1111010100011000 .......... . . . S . . . 4 TODO: correct timing -reset 0 . . 0100111001110000 .......... S S S S 0 0 0 0 -ror 8 s . 1110...000011... .......... U U U U 6 6 8 8 -ror 16 s . 1110...001011... .......... U U U U 6 6 8 8 -ror 32 s . 1110...010011... .......... U U U U 8 8 8 8 -ror 8 r . 1110...000111... .......... U U U U 6 6 8 8 -ror 16 r . 1110...001111... .......... U U U U 6 6 8 8 -ror 32 r . 1110...010111... .......... U U U U 8 8 8 8 -ror 16 . . 1110011011...... A+-DXWL... U U U U 8 8 7 7 -rol 8 s . 1110...100011... .......... U U U U 6 6 8 8 -rol 16 s . 1110...101011... .......... U U U U 6 6 8 8 -rol 32 s . 1110...110011... .......... U U U U 8 8 8 8 -rol 8 r . 1110...100111... .......... U U U U 6 6 8 8 -rol 16 r . 1110...101111... .......... U U U U 6 6 8 8 -rol 32 r . 1110...110111... .......... U U U U 8 8 8 8 -rol 16 . . 1110011111...... A+-DXWL... U U U U 8 8 7 7 -roxr 8 s . 1110...000010... .......... U U U U 6 6 12 12 -roxr 16 s . 1110...001010... .......... U U U U 6 6 12 12 -roxr 32 s . 1110...010010... .......... U U U U 8 8 12 12 -roxr 8 r . 1110...000110... .......... U U U U 6 6 12 12 -roxr 16 r . 1110...001110... .......... U U U U 6 6 12 12 -roxr 32 r . 1110...010110... .......... U U U U 8 8 12 12 -roxr 16 . . 1110010011...... A+-DXWL... U U U U 8 8 5 5 -roxl 8 s . 1110...100010... .......... U U U U 6 6 12 12 -roxl 16 s . 1110...101010... .......... U U U U 6 6 12 12 -roxl 32 s . 1110...110010... .......... U U U U 8 8 12 12 -roxl 8 r . 1110...100110... .......... U U U U 6 6 12 12 -roxl 16 r . 1110...101110... .......... U U U U 6 6 12 12 -roxl 32 r . 1110...110110... .......... U U U U 8 8 12 12 -roxl 16 . . 1110010111...... A+-DXWL... U U U U 8 8 5 5 -rtd 32 . . 0100111001110100 .......... . U U U . 16 10 10 -rte 32 . . 0100111001110011 .......... S S S S 20 24 20 20 bus fault not emulated -rtm 32 . . 000001101100.... .......... . . U U . . 19 19 not properly emulated -rtr 32 . . 0100111001110111 .......... U U U U 20 20 14 14 -rts 32 . . 0100111001110101 .......... U U U U 16 16 10 10 -sbcd 8 rr . 1000...100000... .......... U U U U 6 6 4 4 -sbcd 8 mm ax7 1000111100001... .......... U U U U 18 18 16 16 -sbcd 8 mm ay7 1000...100001111 .......... U U U U 18 18 16 16 -sbcd 8 mm axy7 1000111100001111 .......... U U U U 18 18 16 16 -sbcd 8 mm . 1000...100001... .......... U U U U 18 18 16 16 -st 8 . d 0101000011000... .......... U U U U 6 4 4 4 -st 8 . . 0101000011...... A+-DXWL... U U U U 8 8 6 6 -sf 8 . d 0101000111000... .......... U U U U 4 4 4 4 -sf 8 . . 0101000111...... A+-DXWL... U U U U 8 8 6 6 -scc 8 . d 0101....11000... .......... U U U U 4 4 4 4 -scc 8 . . 0101....11...... A+-DXWL... U U U U 8 8 6 6 -stop 0 . . 0100111001110010 .......... S S S S 4 4 8 8 -sub 8 er d 1001...000000... .......... U U U U 4 4 2 2 -sub 8 er . 1001...000...... A+-DXWLdxI U U U U 4 4 2 2 -sub 16 er d 1001...001000... .......... U U U U 4 4 2 2 -sub 16 er a 1001...001001... .......... U U U U 4 4 2 2 -sub 16 er . 1001...001...... A+-DXWLdxI U U U U 4 4 2 2 -sub 32 er d 1001...010000... .......... U U U U 6 6 2 2 -sub 32 er a 1001...010001... .......... U U U U 6 6 2 2 -sub 32 er . 1001...010...... A+-DXWLdxI U U U U 6 6 2 2 -sub 8 re . 1001...100...... A+-DXWL... U U U U 8 8 4 4 -sub 16 re . 1001...101...... A+-DXWL... U U U U 8 8 4 4 -sub 32 re . 1001...110...... A+-DXWL... U U U U 12 12 4 4 -suba 16 . d 1001...011000... .......... U U U U 8 8 2 2 -suba 16 . a 1001...011001... .......... U U U U 8 8 2 2 -suba 16 . . 1001...011...... A+-DXWLdxI U U U U 8 8 2 2 -suba 32 . d 1001...111000... .......... U U U U 6 6 2 2 -suba 32 . a 1001...111001... .......... U U U U 6 6 2 2 -suba 32 . . 1001...111...... A+-DXWLdxI U U U U 6 6 2 2 -subi 8 . d 0000010000000... .......... U U U U 8 8 2 2 -subi 8 . . 0000010000...... A+-DXWL... U U U U 12 12 4 4 -subi 16 . d 0000010001000... .......... U U U U 8 8 2 2 -subi 16 . . 0000010001...... A+-DXWL... U U U U 12 12 4 4 -subi 32 . d 0000010010000... .......... U U U U 16 14 2 2 -subi 32 . . 0000010010...... A+-DXWL... U U U U 20 20 4 4 -subq 8 . d 0101...100000... .......... U U U U 4 4 2 2 -subq 8 . . 0101...100...... A+-DXWL... U U U U 8 8 4 4 -subq 16 . d 0101...101000... .......... U U U U 4 4 2 2 -subq 16 . a 0101...101001... .......... U U U U 8 4 2 2 -subq 16 . . 0101...101...... A+-DXWL... U U U U 8 8 4 4 -subq 32 . d 0101...110000... .......... U U U U 8 8 2 2 -subq 32 . a 0101...110001... .......... U U U U 8 8 2 2 -subq 32 . . 0101...110...... A+-DXWL... U U U U 12 12 4 4 -subx 8 rr . 1001...100000... .......... U U U U 4 4 2 2 -subx 16 rr . 1001...101000... .......... U U U U 4 4 2 2 -subx 32 rr . 1001...110000... .......... U U U U 8 6 2 2 -subx 8 mm ax7 1001111100001... .......... U U U U 18 18 12 12 -subx 8 mm ay7 1001...100001111 .......... U U U U 18 18 12 12 -subx 8 mm axy7 1001111100001111 .......... U U U U 18 18 12 12 -subx 8 mm . 1001...100001... .......... U U U U 18 18 12 12 -subx 16 mm . 1001...101001... .......... U U U U 18 18 12 12 -subx 32 mm . 1001...110001... .......... U U U U 30 30 12 12 -swap 32 . . 0100100001000... .......... U U U U 4 4 4 4 -tas 8 . d 0100101011000... .......... U U U U 4 4 4 4 -tas 8 . . 0100101011...... A+-DXWL... U U U U 14 14 12 12 -trap 0 . . 010011100100.... .......... U U U U 4 4 4 4 -trapt 0 . . 0101000011111100 .......... . . U U . . 4 4 -trapt 16 . . 0101000011111010 .......... . . U U . . 6 6 -trapt 32 . . 0101000011111011 .......... . . U U . . 8 8 -trapf 0 . . 0101000111111100 .......... . . U U . . 4 4 -trapf 16 . . 0101000111111010 .......... . . U U . . 6 6 -trapf 32 . . 0101000111111011 .......... . . U U . . 8 8 -trapcc 0 . . 0101....11111100 .......... . . U U . . 4 4 -trapcc 16 . . 0101....11111010 .......... . . U U . . 6 6 -trapcc 32 . . 0101....11111011 .......... . . U U . . 8 8 -trapv 0 . . 0100111001110110 .......... U U U U 4 4 4 4 -tst 8 . d 0100101000000... .......... U U U U 4 4 2 2 -tst 8 . . 0100101000...... A+-DXWL... U U U U 4 4 2 2 -tst 8 . pcdi 0100101000111010 .......... . . U U . . 7 7 -tst 8 . pcix 0100101000111011 .......... . . U U . . 9 9 -tst 8 . i 0100101000111100 .......... . . U U . . 6 6 -tst 16 . d 0100101001000... .......... U U U U 4 4 2 2 -tst 16 . a 0100101001001... .......... . . U U . . 2 2 -tst 16 . . 0100101001...... A+-DXWL... U U U U 4 4 2 2 -tst 16 . pcdi 0100101001111010 .......... . . U U . . 7 7 -tst 16 . pcix 0100101001111011 .......... . . U U . . 9 9 -tst 16 . i 0100101001111100 .......... . . U U . . 6 6 -tst 32 . d 0100101010000... .......... U U U U 4 4 2 2 -tst 32 . a 0100101010001... .......... . . U U . . 2 2 -tst 32 . . 0100101010...... A+-DXWL... U U U U 4 4 2 2 -tst 32 . pcdi 0100101010111010 .......... . . U U . . 7 7 -tst 32 . pcix 0100101010111011 .......... . . U U . . 9 9 -tst 32 . i 0100101010111100 .......... . . U U . . 6 6 -unlk 32 . a7 0100111001011111 .......... U U U U 12 12 6 6 -unlk 32 . . 0100111001011... .......... U U U U 12 12 6 6 -unpk 16 rr . 1000...110000... .......... . . U U . . 8 8 -unpk 16 mm ax7 1000111110001... .......... . . U U . . 13 13 -unpk 16 mm ay7 1000...110001111 .......... . . U U . . 13 13 -unpk 16 mm axy7 1000111110001111 .......... . . U U . . 13 13 -unpk 16 mm . 1000...110001... .......... . . U U . . 13 13 - - - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -M68KMAKE_OPCODE_HANDLER_BODY - -M68KMAKE_OP(1010, 0, ., .) -{ - m68ki_exception_1010(); -} - - -M68KMAKE_OP(1111, 0, ., .) -{ - m68ki_exception_1111(); -} - - -M68KMAKE_OP(040fpu0, 32, ., .) -{ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - m68040_fpu_op0(); - return; - } - m68ki_exception_1111(); -} - - -M68KMAKE_OP(040fpu1, 32, ., .) -{ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - m68040_fpu_op1(); - return; - } - m68ki_exception_1111(); -} - - - -M68KMAKE_OP(abcd, 8, rr, .) -{ - uint* r_dst = &DX; - uint src = DY; - uint dst = *r_dst; - uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); - - FLAG_V = ~res; /* Undefined V behavior */ - - if(res > 9) - res += 6; - res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); - FLAG_X = FLAG_C = (res > 0x99) << 8; - if(FLAG_C) - res -= 0xa0; - - FLAG_V &= res; /* Undefined V behavior part II */ - FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; -} - - -M68KMAKE_OP(abcd, 8, mm, ax7) -{ - uint src = OPER_AY_PD_8(); - uint ea = EA_A7_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); - - FLAG_V = ~res; /* Undefined V behavior */ - - if(res > 9) - res += 6; - res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); - FLAG_X = FLAG_C = (res > 0x99) << 8; - if(FLAG_C) - res -= 0xa0; - - FLAG_V &= res; /* Undefined V behavior part II */ - FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(abcd, 8, mm, ay7) -{ - uint src = OPER_A7_PD_8(); - uint ea = EA_AX_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); - - FLAG_V = ~res; /* Undefined V behavior */ - - if(res > 9) - res += 6; - res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); - FLAG_X = FLAG_C = (res > 0x99) << 8; - if(FLAG_C) - res -= 0xa0; - - FLAG_V &= res; /* Undefined V behavior part II */ - FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(abcd, 8, mm, axy7) -{ - uint src = OPER_A7_PD_8(); - uint ea = EA_A7_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); - - FLAG_V = ~res; /* Undefined V behavior */ - - if(res > 9) - res += 6; - res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); - FLAG_X = FLAG_C = (res > 0x99) << 8; - if(FLAG_C) - res -= 0xa0; - - FLAG_V &= res; /* Undefined V behavior part II */ - FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(abcd, 8, mm, .) -{ - uint src = OPER_AY_PD_8(); - uint ea = EA_AX_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); - - FLAG_V = ~res; /* Undefined V behavior */ - - if(res > 9) - res += 6; - res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); - FLAG_X = FLAG_C = (res > 0x99) << 8; - if(FLAG_C) - res -= 0xa0; - - FLAG_V &= res; /* Undefined V behavior part II */ - FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(add, 8, er, d) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_8(DY); - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = src + dst; - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(add, 8, er, .) -{ - uint* r_dst = &DX; - uint src = M68KMAKE_GET_OPER_AY_8; - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = src + dst; - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(add, 16, er, d) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_16(DY); - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = src + dst; - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(add, 16, er, a) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_16(AY); - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = src + dst; - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(add, 16, er, .) -{ - uint* r_dst = &DX; - uint src = M68KMAKE_GET_OPER_AY_16; - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = src + dst; - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(add, 32, er, d) -{ - uint* r_dst = &DX; - uint src = DY; - uint dst = *r_dst; - uint res = src + dst; - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(add, 32, er, a) -{ - uint* r_dst = &DX; - uint src = AY; - uint dst = *r_dst; - uint res = src + dst; - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(add, 32, er, .) -{ - uint* r_dst = &DX; - uint src = M68KMAKE_GET_OPER_AY_32; - uint dst = *r_dst; - uint res = src + dst; - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(add, 8, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = MASK_OUT_ABOVE_8(DX); - uint dst = m68ki_read_8(ea); - uint res = src + dst; - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - - m68ki_write_8(ea, FLAG_Z); -} - - -M68KMAKE_OP(add, 16, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = MASK_OUT_ABOVE_16(DX); - uint dst = m68ki_read_16(ea); - uint res = src + dst; - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - m68ki_write_16(ea, FLAG_Z); -} - - -M68KMAKE_OP(add, 32, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - uint src = DX; - uint dst = m68ki_read_32(ea); - uint res = src + dst; - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - m68ki_write_32(ea, FLAG_Z); -} - - -M68KMAKE_OP(adda, 16, ., d) -{ - uint* r_dst = &AX; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(DY)); -} - - -M68KMAKE_OP(adda, 16, ., a) -{ - uint* r_dst = &AX; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(AY)); -} - - -M68KMAKE_OP(adda, 16, ., .) -{ - uint* r_dst = &AX; - uint src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); - - *r_dst = MASK_OUT_ABOVE_32(*r_dst + src); -} - - -M68KMAKE_OP(adda, 32, ., d) -{ - uint* r_dst = &AX; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst + DY); -} - - -M68KMAKE_OP(adda, 32, ., a) -{ - uint* r_dst = &AX; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst + AY); -} - - -M68KMAKE_OP(adda, 32, ., .) -{ - uint* r_dst = &AX; - uint src = M68KMAKE_GET_OPER_AY_32; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst + src); -} - - -M68KMAKE_OP(addi, 8, ., d) -{ - uint* r_dst = &DY; - uint src = OPER_I_8(); - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = src + dst; - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(addi, 8, ., .) -{ - uint src = OPER_I_8(); - uint ea = M68KMAKE_GET_EA_AY_8; - uint dst = m68ki_read_8(ea); - uint res = src + dst; - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - - m68ki_write_8(ea, FLAG_Z); -} - - -M68KMAKE_OP(addi, 16, ., d) -{ - uint* r_dst = &DY; - uint src = OPER_I_16(); - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = src + dst; - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(addi, 16, ., .) -{ - uint src = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_16; - uint dst = m68ki_read_16(ea); - uint res = src + dst; - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - m68ki_write_16(ea, FLAG_Z); -} - - -M68KMAKE_OP(addi, 32, ., d) -{ - uint* r_dst = &DY; - uint src = OPER_I_32(); - uint dst = *r_dst; - uint res = src + dst; - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(addi, 32, ., .) -{ - uint src = OPER_I_32(); - uint ea = M68KMAKE_GET_EA_AY_32; - uint dst = m68ki_read_32(ea); - uint res = src + dst; - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - m68ki_write_32(ea, FLAG_Z); -} - - -M68KMAKE_OP(addq, 8, ., d) -{ - uint* r_dst = &DY; - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = src + dst; - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(addq, 8, ., .) -{ - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint ea = M68KMAKE_GET_EA_AY_8; - uint dst = m68ki_read_8(ea); - uint res = src + dst; - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - - m68ki_write_8(ea, FLAG_Z); -} - - -M68KMAKE_OP(addq, 16, ., d) -{ - uint* r_dst = &DY; - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = src + dst; - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(addq, 16, ., a) -{ - uint* r_dst = &AY; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst + (((REG_IR >> 9) - 1) & 7) + 1); -} - - -M68KMAKE_OP(addq, 16, ., .) -{ - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint ea = M68KMAKE_GET_EA_AY_16; - uint dst = m68ki_read_16(ea); - uint res = src + dst; - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - m68ki_write_16(ea, FLAG_Z); -} - - -M68KMAKE_OP(addq, 32, ., d) -{ - uint* r_dst = &DY; - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint dst = *r_dst; - uint res = src + dst; - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(addq, 32, ., a) -{ - uint* r_dst = &AY; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst + (((REG_IR >> 9) - 1) & 7) + 1); -} - - -M68KMAKE_OP(addq, 32, ., .) -{ - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint ea = M68KMAKE_GET_EA_AY_32; - uint dst = m68ki_read_32(ea); - uint res = src + dst; - - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - m68ki_write_32(ea, FLAG_Z); -} - - -M68KMAKE_OP(addx, 8, rr, .) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_8(DY); - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = src + dst + XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; -} - - -M68KMAKE_OP(addx, 16, rr, .) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_16(DY); - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = src + dst + XFLAG_AS_1(); - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - - res = MASK_OUT_ABOVE_16(res); - FLAG_Z |= res; - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; -} - - -M68KMAKE_OP(addx, 32, rr, .) -{ - uint* r_dst = &DX; - uint src = DY; - uint dst = *r_dst; - uint res = src + dst + XFLAG_AS_1(); - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - - res = MASK_OUT_ABOVE_32(res); - FLAG_Z |= res; - - *r_dst = res; -} - - -M68KMAKE_OP(addx, 8, mm, ax7) -{ - uint src = OPER_AY_PD_8(); - uint ea = EA_A7_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = src + dst + XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(addx, 8, mm, ay7) -{ - uint src = OPER_A7_PD_8(); - uint ea = EA_AX_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = src + dst + XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(addx, 8, mm, axy7) -{ - uint src = OPER_A7_PD_8(); - uint ea = EA_A7_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = src + dst + XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(addx, 8, mm, .) -{ - uint src = OPER_AY_PD_8(); - uint ea = EA_AX_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = src + dst + XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_V = VFLAG_ADD_8(src, dst, res); - FLAG_X = FLAG_C = CFLAG_8(res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(addx, 16, mm, .) -{ - uint src = OPER_AY_PD_16(); - uint ea = EA_AX_PD_16(); - uint dst = m68ki_read_16(ea); - uint res = src + dst + XFLAG_AS_1(); - - FLAG_N = NFLAG_16(res); - FLAG_V = VFLAG_ADD_16(src, dst, res); - FLAG_X = FLAG_C = CFLAG_16(res); - - res = MASK_OUT_ABOVE_16(res); - FLAG_Z |= res; - - m68ki_write_16(ea, res); -} - - -M68KMAKE_OP(addx, 32, mm, .) -{ - uint src = OPER_AY_PD_32(); - uint ea = EA_AX_PD_32(); - uint dst = m68ki_read_32(ea); - uint res = src + dst + XFLAG_AS_1(); - - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_ADD_32(src, dst, res); - FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); - - res = MASK_OUT_ABOVE_32(res); - FLAG_Z |= res; - - m68ki_write_32(ea, res); -} - - -M68KMAKE_OP(and, 8, er, d) -{ - FLAG_Z = MASK_OUT_ABOVE_8(DX &= (DY | 0xffffff00)); - - FLAG_N = NFLAG_8(FLAG_Z); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(and, 8, er, .) -{ - FLAG_Z = MASK_OUT_ABOVE_8(DX &= (M68KMAKE_GET_OPER_AY_8 | 0xffffff00)); - - FLAG_N = NFLAG_8(FLAG_Z); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(and, 16, er, d) -{ - FLAG_Z = MASK_OUT_ABOVE_16(DX &= (DY | 0xffff0000)); - - FLAG_N = NFLAG_16(FLAG_Z); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(and, 16, er, .) -{ - FLAG_Z = MASK_OUT_ABOVE_16(DX &= (M68KMAKE_GET_OPER_AY_16 | 0xffff0000)); - - FLAG_N = NFLAG_16(FLAG_Z); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(and, 32, er, d) -{ - FLAG_Z = DX &= DY; - - FLAG_N = NFLAG_32(FLAG_Z); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(and, 32, er, .) -{ - FLAG_Z = DX &= M68KMAKE_GET_OPER_AY_32; - - FLAG_N = NFLAG_32(FLAG_Z); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(and, 8, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint res = DX & m68ki_read_8(ea); - - FLAG_N = NFLAG_8(res); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_Z = MASK_OUT_ABOVE_8(res); - - m68ki_write_8(ea, FLAG_Z); -} - - -M68KMAKE_OP(and, 16, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint res = DX & m68ki_read_16(ea); - - FLAG_N = NFLAG_16(res); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_Z = MASK_OUT_ABOVE_16(res); - - m68ki_write_16(ea, FLAG_Z); -} - - -M68KMAKE_OP(and, 32, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - uint res = DX & m68ki_read_32(ea); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - - m68ki_write_32(ea, res); -} - - -M68KMAKE_OP(andi, 8, ., d) -{ - FLAG_Z = MASK_OUT_ABOVE_8(DY &= (OPER_I_8() | 0xffffff00)); - - FLAG_N = NFLAG_8(FLAG_Z); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(andi, 8, ., .) -{ - uint src = OPER_I_8(); - uint ea = M68KMAKE_GET_EA_AY_8; - uint res = src & m68ki_read_8(ea); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(andi, 16, ., d) -{ - FLAG_Z = MASK_OUT_ABOVE_16(DY &= (OPER_I_16() | 0xffff0000)); - - FLAG_N = NFLAG_16(FLAG_Z); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(andi, 16, ., .) -{ - uint src = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_16; - uint res = src & m68ki_read_16(ea); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - - m68ki_write_16(ea, res); -} - - -M68KMAKE_OP(andi, 32, ., d) -{ - FLAG_Z = DY &= (OPER_I_32()); - - FLAG_N = NFLAG_32(FLAG_Z); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(andi, 32, ., .) -{ - uint src = OPER_I_32(); - uint ea = M68KMAKE_GET_EA_AY_32; - uint res = src & m68ki_read_32(ea); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - - m68ki_write_32(ea, res); -} - - -M68KMAKE_OP(andi, 16, toc, .) -{ - m68ki_set_ccr(m68ki_get_ccr() & OPER_I_16()); -} - - -M68KMAKE_OP(andi, 16, tos, .) -{ - if(FLAG_S) - { - uint src = OPER_I_16(); - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_set_sr(m68ki_get_sr() & src); - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(asr, 8, s, .) -{ - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = src >> shift; - - if(shift != 0) - USE_CYCLES(shift<> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_16(*r_dst); - uint res = src >> shift; - - if(shift != 0) - USE_CYCLES(shift<> 9) - 1) & 7) + 1; - uint src = *r_dst; - uint res = src >> shift; - - if(shift != 0) - USE_CYCLES(shift<> shift; - - if(shift != 0) - { - USE_CYCLES(shift<> shift; - - if(shift != 0) - { - USE_CYCLES(shift<> (shift - 1))<<8; - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - if(GET_MSB_16(src)) - { - *r_dst |= 0xffff; - FLAG_C = CFLAG_SET; - FLAG_X = XFLAG_SET; - FLAG_N = NFLAG_SET; - FLAG_Z = ZFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - return; - } - - *r_dst &= 0xffff0000; - FLAG_C = CFLAG_CLEAR; - FLAG_X = XFLAG_CLEAR; - FLAG_N = NFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_16(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(asr, 32, r, .) -{ - uint* r_dst = &DY; - uint shift = DX & 0x3f; - uint src = *r_dst; - uint res = src >> shift; - - if(shift != 0) - { - USE_CYCLES(shift<> (shift - 1))<<8; - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - if(GET_MSB_32(src)) - { - *r_dst = 0xffffffff; - FLAG_C = CFLAG_SET; - FLAG_X = XFLAG_SET; - FLAG_N = NFLAG_SET; - FLAG_Z = ZFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - return; - } - - *r_dst = 0; - FLAG_C = CFLAG_CLEAR; - FLAG_X = XFLAG_CLEAR; - FLAG_N = NFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_32(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(asr, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = m68ki_read_16(ea); - uint res = src >> 1; - - if(GET_MSB_16(src)) - res |= 0x8000; - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = FLAG_X = src << 8; -} - - -M68KMAKE_OP(asl, 8, s, .) -{ - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = MASK_OUT_ABOVE_8(src << shift); - - if(shift != 0) - USE_CYCLES(shift<> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_16(*r_dst); - uint res = MASK_OUT_ABOVE_16(src << shift); - - if(shift != 0) - USE_CYCLES(shift<> (8-shift); - src &= m68ki_shift_16_table[shift + 1]; - FLAG_V = (!(src == 0 || src == m68ki_shift_16_table[shift + 1]))<<7; -} - - -M68KMAKE_OP(asl, 32, s, .) -{ - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = *r_dst; - uint res = MASK_OUT_ABOVE_32(src << shift); - - if(shift != 0) - USE_CYCLES(shift<> (24-shift); - src &= m68ki_shift_32_table[shift + 1]; - FLAG_V = (!(src == 0 || src == m68ki_shift_32_table[shift + 1]))<<7; -} - - -M68KMAKE_OP(asl, 8, r, .) -{ - uint* r_dst = &DY; - uint shift = DX & 0x3f; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = MASK_OUT_ABOVE_8(src << shift); - - if(shift != 0) - { - USE_CYCLES(shift<> 8; - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - src &= m68ki_shift_16_table[shift + 1]; - FLAG_V = (!(src == 0 || src == m68ki_shift_16_table[shift + 1]))<<7; - return; - } - - *r_dst &= 0xffff0000; - FLAG_X = FLAG_C = ((shift == 16 ? src & 1 : 0))<<8; - FLAG_N = NFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; - FLAG_V = (!(src == 0))<<7; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_16(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(asl, 32, r, .) -{ - uint* r_dst = &DY; - uint shift = DX & 0x3f; - uint src = *r_dst; - uint res = MASK_OUT_ABOVE_32(src << shift); - - if(shift != 0) - { - USE_CYCLES(shift<> (32 - shift)) << 8; - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - src &= m68ki_shift_32_table[shift + 1]; - FLAG_V = (!(src == 0 || src == m68ki_shift_32_table[shift + 1]))<<7; - return; - } - - *r_dst = 0; - FLAG_X = FLAG_C = ((shift == 32 ? src & 1 : 0))<<8; - FLAG_N = NFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; - FLAG_V = (!(src == 0))<<7; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_32(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(asl, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = m68ki_read_16(ea); - uint res = MASK_OUT_ABOVE_16(src << 1); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_X = FLAG_C = src >> 7; - src &= 0xc000; - FLAG_V = (!(src == 0 || src == 0xc000))<<7; -} - - -M68KMAKE_OP(bcc, 8, ., .) -{ - if(M68KMAKE_CC) - { - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); - return; - } - USE_CYCLES(CYC_BCC_NOTAKE_B); -} - - -M68KMAKE_OP(bcc, 16, ., .) -{ - if(M68KMAKE_CC) - { - uint offset = OPER_I_16(); - REG_PC -= 2; - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_16(offset); - return; - } - REG_PC += 2; - USE_CYCLES(CYC_BCC_NOTAKE_W); -} - - -M68KMAKE_OP(bcc, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - if(M68KMAKE_CC) - { - uint offset = OPER_I_32(); - REG_PC -= 4; - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_32(offset); - return; - } - REG_PC += 4; - return; - } - else - { - if(M68KMAKE_CC) - { - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); - return; - } - USE_CYCLES(CYC_BCC_NOTAKE_B); - } -} - - -M68KMAKE_OP(bchg, 32, r, d) -{ - uint* r_dst = &DY; - uint mask = 1 << (DX & 0x1f); - - FLAG_Z = *r_dst & mask; - *r_dst ^= mask; -} - - -M68KMAKE_OP(bchg, 8, r, .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = m68ki_read_8(ea); - uint mask = 1 << (DX & 7); - - FLAG_Z = src & mask; - m68ki_write_8(ea, src ^ mask); -} - - -M68KMAKE_OP(bchg, 32, s, d) -{ - uint* r_dst = &DY; - uint mask = 1 << (OPER_I_8() & 0x1f); - - FLAG_Z = *r_dst & mask; - *r_dst ^= mask; -} - - -M68KMAKE_OP(bchg, 8, s, .) -{ - uint mask = 1 << (OPER_I_8() & 7); - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = m68ki_read_8(ea); - - FLAG_Z = src & mask; - m68ki_write_8(ea, src ^ mask); -} - - -M68KMAKE_OP(bclr, 32, r, d) -{ - uint* r_dst = &DY; - uint mask = 1 << (DX & 0x1f); - - FLAG_Z = *r_dst & mask; - *r_dst &= ~mask; -} - - -M68KMAKE_OP(bclr, 8, r, .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = m68ki_read_8(ea); - uint mask = 1 << (DX & 7); - - FLAG_Z = src & mask; - m68ki_write_8(ea, src & ~mask); -} - - -M68KMAKE_OP(bclr, 32, s, d) -{ - uint* r_dst = &DY; - uint mask = 1 << (OPER_I_8() & 0x1f); - - FLAG_Z = *r_dst & mask; - *r_dst &= ~mask; -} - - -M68KMAKE_OP(bclr, 8, s, .) -{ - uint mask = 1 << (OPER_I_8() & 7); - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = m68ki_read_8(ea); - - FLAG_Z = src & mask; - m68ki_write_8(ea, src & ~mask); -} - - -M68KMAKE_OP(bfchg, 32, ., d) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint offset = (word2>>6)&31; - uint width = word2; - uint* data = &DY; - uint64 mask; - - - if(BIT_B(word2)) - offset = REG_D[offset&7]; - if(BIT_5(word2)) - width = REG_D[width&7]; - - offset &= 31; - width = ((width-1) & 31) + 1; - - mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask = ROR_32(mask, offset); - - FLAG_N = NFLAG_32(*data<>6)&31; - uint width = word2; - uint mask_base; - uint data_long; - uint mask_long; - uint data_byte = 0; - uint mask_byte = 0; - uint ea = M68KMAKE_GET_EA_AY_8; - - - if(BIT_B(word2)) - offset = MAKE_INT_32(REG_D[offset&7]); - if(BIT_5(word2)) - width = REG_D[width&7]; - - /* Offset is signed so we have to use ugly math =( */ - ea += offset / 8; - offset %= 8; - if(offset < 0) - { - offset += 8; - ea--; - } - width = ((width-1) & 31) + 1; - - mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask_long = mask_base >> offset; - - data_long = m68ki_read_32(ea); - FLAG_N = NFLAG_32(data_long << offset); - FLAG_Z = data_long & mask_long; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - m68ki_write_32(ea, data_long ^ mask_long); - - if((width + offset) > 32) - { - mask_byte = MASK_OUT_ABOVE_8(mask_base); - data_byte = m68ki_read_8(ea+4); - FLAG_Z |= (data_byte & mask_byte); - m68ki_write_8(ea+4, data_byte ^ mask_byte); - } - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfclr, 32, ., d) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint offset = (word2>>6)&31; - uint width = word2; - uint* data = &DY; - uint64 mask; - - - if(BIT_B(word2)) - offset = REG_D[offset&7]; - if(BIT_5(word2)) - width = REG_D[width&7]; - - - offset &= 31; - width = ((width-1) & 31) + 1; - - - mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask = ROR_32(mask, offset); - - FLAG_N = NFLAG_32(*data<>6)&31; - uint width = word2; - uint mask_base; - uint data_long; - uint mask_long; - uint data_byte = 0; - uint mask_byte = 0; - uint ea = M68KMAKE_GET_EA_AY_8; - - - if(BIT_B(word2)) - offset = MAKE_INT_32(REG_D[offset&7]); - if(BIT_5(word2)) - width = REG_D[width&7]; - - /* Offset is signed so we have to use ugly math =( */ - ea += offset / 8; - offset %= 8; - if(offset < 0) - { - offset += 8; - ea--; - } - width = ((width-1) & 31) + 1; - - mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask_long = mask_base >> offset; - - data_long = m68ki_read_32(ea); - FLAG_N = NFLAG_32(data_long << offset); - FLAG_Z = data_long & mask_long; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - m68ki_write_32(ea, data_long & ~mask_long); - - if((width + offset) > 32) - { - mask_byte = MASK_OUT_ABOVE_8(mask_base); - data_byte = m68ki_read_8(ea+4); - FLAG_Z |= (data_byte & mask_byte); - m68ki_write_8(ea+4, data_byte & ~mask_byte); - } - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfexts, 32, ., d) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint offset = (word2>>6)&31; - uint width = word2; - uint64 data = DY; - - - if(BIT_B(word2)) - offset = REG_D[offset&7]; - if(BIT_5(word2)) - width = REG_D[width&7]; - - offset &= 31; - width = ((width-1) & 31) + 1; - - data = ROL_32(data, offset); - FLAG_N = NFLAG_32(data); - data = MAKE_INT_32(data) >> (32 - width); - - FLAG_Z = data; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - REG_D[(word2>>12)&7] = data; - - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfexts, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - sint offset = (word2>>6)&31; - uint width = word2; - uint data; - uint ea = M68KMAKE_GET_EA_AY_8; - - - if(BIT_B(word2)) - offset = MAKE_INT_32(REG_D[offset&7]); - if(BIT_5(word2)) - width = REG_D[width&7]; - - /* Offset is signed so we have to use ugly math =( */ - ea += offset / 8; - offset %= 8; - if(offset < 0) - { - offset += 8; - ea--; - } - width = ((width-1) & 31) + 1; - - data = m68ki_read_32(ea); - - data = MASK_OUT_ABOVE_32(data< 32) - data |= (m68ki_read_8(ea+4) << offset) >> 8; - - FLAG_N = NFLAG_32(data); - data = MAKE_INT_32(data) >> (32 - width); - - FLAG_Z = data; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - REG_D[(word2 >> 12) & 7] = data; - - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfextu, 32, ., d) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint offset = (word2>>6)&31; - uint width = word2; - uint64 data = DY; - - - if(BIT_B(word2)) - offset = REG_D[offset&7]; - if(BIT_5(word2)) - width = REG_D[width&7]; - - offset &= 31; - width = ((width-1) & 31) + 1; - - data = ROL_32(data, offset); - FLAG_N = NFLAG_32(data); - data >>= 32 - width; - - FLAG_Z = data; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - REG_D[(word2>>12)&7] = data; - - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfextu, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - sint offset = (word2>>6)&31; - uint width = word2; - uint data; - uint ea = M68KMAKE_GET_EA_AY_8; - - - if(BIT_B(word2)) - offset = MAKE_INT_32(REG_D[offset&7]); - if(BIT_5(word2)) - width = REG_D[width&7]; - - /* Offset is signed so we have to use ugly math =( */ - ea += offset / 8; - offset %= 8; - if(offset < 0) - { - offset += 8; - ea--; - } - width = ((width-1) & 31) + 1; - - data = m68ki_read_32(ea); - data = MASK_OUT_ABOVE_32(data< 32) - data |= (m68ki_read_8(ea+4) << offset) >> 8; - - FLAG_N = NFLAG_32(data); - data >>= (32 - width); - - FLAG_Z = data; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - REG_D[(word2 >> 12) & 7] = data; - - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfffo, 32, ., d) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint offset = (word2>>6)&31; - uint width = word2; - uint64 data = DY; - uint bit; - - - if(BIT_B(word2)) - offset = REG_D[offset&7]; - if(BIT_5(word2)) - width = REG_D[width&7]; - - offset &= 31; - width = ((width-1) & 31) + 1; - - data = ROL_32(data, offset); - FLAG_N = NFLAG_32(data); - data >>= 32 - width; - - FLAG_Z = data; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) - offset++; - - REG_D[(word2>>12)&7] = offset; - - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfffo, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - sint offset = (word2>>6)&31; - sint local_offset; - uint width = word2; - uint data; - uint bit; - uint ea = M68KMAKE_GET_EA_AY_8; - - - if(BIT_B(word2)) - offset = MAKE_INT_32(REG_D[offset&7]); - if(BIT_5(word2)) - width = REG_D[width&7]; - - /* Offset is signed so we have to use ugly math =( */ - ea += offset / 8; - local_offset = offset % 8; - if(local_offset < 0) - { - local_offset += 8; - ea--; - } - width = ((width-1) & 31) + 1; - - data = m68ki_read_32(ea); - data = MASK_OUT_ABOVE_32(data< 32) - data |= (m68ki_read_8(ea+4) << local_offset) >> 8; - - FLAG_N = NFLAG_32(data); - data >>= (32 - width); - - FLAG_Z = data; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) - offset++; - - REG_D[(word2>>12)&7] = offset; - - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfins, 32, ., d) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint offset = (word2>>6)&31; - uint width = word2; - uint* data = &DY; - uint64 mask; - uint64 insert = REG_D[(word2>>12)&7]; - - - if(BIT_B(word2)) - offset = REG_D[offset&7]; - if(BIT_5(word2)) - width = REG_D[width&7]; - - - offset &= 31; - width = ((width-1) & 31) + 1; - - - mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask = ROR_32(mask, offset); - - insert = MASK_OUT_ABOVE_32(insert << (32 - width)); - FLAG_N = NFLAG_32(insert); - FLAG_Z = insert; - insert = ROR_32(insert, offset); - - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - *data &= ~mask; - *data |= insert; - - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfins, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - sint offset = (word2>>6)&31; - uint width = word2; - uint insert_base = REG_D[(word2>>12)&7]; - uint insert_long; - uint insert_byte; - uint mask_base; - uint data_long; - uint mask_long; - uint data_byte = 0; - uint mask_byte = 0; - uint ea = M68KMAKE_GET_EA_AY_8; - - - if(BIT_B(word2)) - offset = MAKE_INT_32(REG_D[offset&7]); - if(BIT_5(word2)) - width = REG_D[width&7]; - - /* Offset is signed so we have to use ugly math =( */ - ea += offset / 8; - offset %= 8; - if(offset < 0) - { - offset += 8; - ea--; - } - width = ((width-1) & 31) + 1; - - mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask_long = mask_base >> offset; - - insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width)); - FLAG_N = NFLAG_32(insert_base); - FLAG_Z = insert_base; - insert_long = insert_base >> offset; - - data_long = m68ki_read_32(ea); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - m68ki_write_32(ea, (data_long & ~mask_long) | insert_long); - - if((width + offset) > 32) - { - mask_byte = MASK_OUT_ABOVE_8(mask_base); - insert_byte = MASK_OUT_ABOVE_8(insert_base); - data_byte = m68ki_read_8(ea+4); - FLAG_Z |= (data_byte & mask_byte); - m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte); - } - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bfset, 32, ., d) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint offset = (word2>>6)&31; - uint width = word2; - uint* data = &DY; - uint64 mask; - - - if(BIT_B(word2)) - offset = REG_D[offset&7]; - if(BIT_5(word2)) - width = REG_D[width&7]; - - - offset &= 31; - width = ((width-1) & 31) + 1; - - - mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask = ROR_32(mask, offset); - - FLAG_N = NFLAG_32(*data<>6)&31; - uint width = word2; - uint mask_base; - uint data_long; - uint mask_long; - uint data_byte = 0; - uint mask_byte = 0; - uint ea = M68KMAKE_GET_EA_AY_8; - - - if(BIT_B(word2)) - offset = MAKE_INT_32(REG_D[offset&7]); - if(BIT_5(word2)) - width = REG_D[width&7]; - - /* Offset is signed so we have to use ugly math =( */ - ea += offset / 8; - offset %= 8; - if(offset < 0) - { - offset += 8; - ea--; - } - width = ((width-1) & 31) + 1; - - - mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask_long = mask_base >> offset; - - data_long = m68ki_read_32(ea); - FLAG_N = NFLAG_32(data_long << offset); - FLAG_Z = data_long & mask_long; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - m68ki_write_32(ea, data_long | mask_long); - - if((width + offset) > 32) - { - mask_byte = MASK_OUT_ABOVE_8(mask_base); - data_byte = m68ki_read_8(ea+4); - FLAG_Z |= (data_byte & mask_byte); - m68ki_write_8(ea+4, data_byte | mask_byte); - } - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bftst, 32, ., d) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint offset = (word2>>6)&31; - uint width = word2; - uint* data = &DY; - uint64 mask; - - - if(BIT_B(word2)) - offset = REG_D[offset&7]; - if(BIT_5(word2)) - width = REG_D[width&7]; - - - offset &= 31; - width = ((width-1) & 31) + 1; - - - mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask = ROR_32(mask, offset); - - FLAG_N = NFLAG_32(*data<>6)&31; - uint width = word2; - uint mask_base; - uint data_long; - uint mask_long; - uint data_byte = 0; - uint mask_byte = 0; - uint ea = M68KMAKE_GET_EA_AY_8; - - if(BIT_B(word2)) - offset = MAKE_INT_32(REG_D[offset&7]); - if(BIT_5(word2)) - width = REG_D[width&7]; - - /* Offset is signed so we have to use ugly math =( */ - ea += offset / 8; - offset %= 8; - if(offset < 0) - { - offset += 8; - ea--; - } - width = ((width-1) & 31) + 1; - - - mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); - mask_long = mask_base >> offset; - - data_long = m68ki_read_32(ea); - FLAG_N = ((data_long & (0x80000000 >> offset))<>24; - FLAG_Z = data_long & mask_long; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - if((width + offset) > 32) - { - mask_byte = MASK_OUT_ABOVE_8(mask_base); - data_byte = m68ki_read_8(ea+4); - FLAG_Z |= (data_byte & mask_byte); - } - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bkpt, 0, ., .) -{ - if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) - { - m68ki_bkpt_ack(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE) ? REG_IR & 7 : 0); /* auto-disable (see m68kcpu.h) */ - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(bra, 8, ., .) -{ - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); - if(REG_PC == REG_PPC) - USE_ALL_CYCLES(); -} - - -M68KMAKE_OP(bra, 16, ., .) -{ - uint offset = OPER_I_16(); - REG_PC -= 2; - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_16(offset); - if(REG_PC == REG_PPC) - USE_ALL_CYCLES(); -} - - -M68KMAKE_OP(bra, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint offset = OPER_I_32(); - REG_PC -= 4; - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_32(offset); - if(REG_PC == REG_PPC) - USE_ALL_CYCLES(); - return; - } - else - { - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); - if(REG_PC == REG_PPC) - USE_ALL_CYCLES(); - } -} - - -M68KMAKE_OP(bset, 32, r, d) -{ - uint* r_dst = &DY; - uint mask = 1 << (DX & 0x1f); - - FLAG_Z = *r_dst & mask; - *r_dst |= mask; -} - - -M68KMAKE_OP(bset, 8, r, .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = m68ki_read_8(ea); - uint mask = 1 << (DX & 7); - - FLAG_Z = src & mask; - m68ki_write_8(ea, src | mask); -} - - -M68KMAKE_OP(bset, 32, s, d) -{ - uint* r_dst = &DY; - uint mask = 1 << (OPER_I_8() & 0x1f); - - FLAG_Z = *r_dst & mask; - *r_dst |= mask; -} - - -M68KMAKE_OP(bset, 8, s, .) -{ - uint mask = 1 << (OPER_I_8() & 7); - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = m68ki_read_8(ea); - - FLAG_Z = src & mask; - m68ki_write_8(ea, src | mask); -} - - -M68KMAKE_OP(bsr, 8, ., .) -{ - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_push_32(REG_PC); - m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); -} - - -M68KMAKE_OP(bsr, 16, ., .) -{ - uint offset = OPER_I_16(); - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_push_32(REG_PC); - REG_PC -= 2; - m68ki_branch_16(offset); -} - - -M68KMAKE_OP(bsr, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint offset = OPER_I_32(); - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_push_32(REG_PC); - REG_PC -= 4; - m68ki_branch_32(offset); - return; - } - else - { - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_push_32(REG_PC); - m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); - } -} - - -M68KMAKE_OP(btst, 32, r, d) -{ - FLAG_Z = DY & (1 << (DX & 0x1f)); -} - - -M68KMAKE_OP(btst, 8, r, .) -{ - FLAG_Z = M68KMAKE_GET_OPER_AY_8 & (1 << (DX & 7)); -} - - -M68KMAKE_OP(btst, 32, s, d) -{ - FLAG_Z = DY & (1 << (OPER_I_8() & 0x1f)); -} - - -M68KMAKE_OP(btst, 8, s, .) -{ - uint bit = OPER_I_8() & 7; - - FLAG_Z = M68KMAKE_GET_OPER_AY_8 & (1 << bit); -} - - -M68KMAKE_OP(callm, 32, ., .) -{ - /* note: watch out for pcrelative modes */ - if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) - { - uint ea = M68KMAKE_GET_EA_AY_32; - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - REG_PC += 2; -(void)ea; /* just to avoid an 'unused variable' warning */ - M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, - m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cas, 8, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_8; - uint dest = m68ki_read_8(ea); - uint* compare = ®_D[word2 & 7]; - uint res = dest - MASK_OUT_ABOVE_8(*compare); - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(*compare, dest, res); - FLAG_C = CFLAG_8(res); - - if(COND_NE()) - *compare = MASK_OUT_BELOW_8(*compare) | dest; - else - { - USE_CYCLES(3); - m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); - } - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cas, 16, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_16; - uint dest = m68ki_read_16(ea); - uint* compare = ®_D[word2 & 7]; - uint res = dest - MASK_OUT_ABOVE_16(*compare); - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_V = VFLAG_SUB_16(*compare, dest, res); - FLAG_C = CFLAG_16(res); - - if(COND_NE()) - *compare = MASK_OUT_BELOW_16(*compare) | dest; - else - { - USE_CYCLES(3); - m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7])); - } - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cas, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_32; - uint dest = m68ki_read_32(ea); - uint* compare = ®_D[word2 & 7]; - uint res = dest - *compare; - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(*compare, dest, res); - FLAG_C = CFLAG_SUB_32(*compare, dest, res); - - if(COND_NE()) - *compare = dest; - else - { - USE_CYCLES(3); - m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]); - } - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cas2, 16, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_32(); - uint* compare1 = ®_D[(word2 >> 16) & 7]; - uint ea1 = REG_DA[(word2 >> 28) & 15]; - uint dest1 = m68ki_read_16(ea1); - uint res1 = dest1 - MASK_OUT_ABOVE_16(*compare1); - uint* compare2 = ®_D[word2 & 7]; - uint ea2 = REG_DA[(word2 >> 12) & 15]; - uint dest2 = m68ki_read_16(ea2); - uint res2; - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - FLAG_N = NFLAG_16(res1); - FLAG_Z = MASK_OUT_ABOVE_16(res1); - FLAG_V = VFLAG_SUB_16(*compare1, dest1, res1); - FLAG_C = CFLAG_16(res1); - - if(COND_EQ()) - { - res2 = dest2 - MASK_OUT_ABOVE_16(*compare2); - - FLAG_N = NFLAG_16(res2); - FLAG_Z = MASK_OUT_ABOVE_16(res2); - FLAG_V = VFLAG_SUB_16(*compare2, dest2, res2); - FLAG_C = CFLAG_16(res2); - - if(COND_EQ()) - { - USE_CYCLES(3); - m68ki_write_16(ea1, REG_D[(word2 >> 22) & 7]); - m68ki_write_16(ea2, REG_D[(word2 >> 6) & 7]); - return; - } - } - *compare1 = BIT_1F(word2) ? MAKE_INT_16(dest1) : MASK_OUT_BELOW_16(*compare1) | dest1; - *compare2 = BIT_F(word2) ? MAKE_INT_16(dest2) : MASK_OUT_BELOW_16(*compare2) | dest2; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cas2, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_32(); - uint* compare1 = ®_D[(word2 >> 16) & 7]; - uint ea1 = REG_DA[(word2 >> 28) & 15]; - uint dest1 = m68ki_read_32(ea1); - uint res1 = dest1 - *compare1; - uint* compare2 = ®_D[word2 & 7]; - uint ea2 = REG_DA[(word2 >> 12) & 15]; - uint dest2 = m68ki_read_32(ea2); - uint res2; - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - FLAG_N = NFLAG_32(res1); - FLAG_Z = MASK_OUT_ABOVE_32(res1); - FLAG_V = VFLAG_SUB_32(*compare1, dest1, res1); - FLAG_C = CFLAG_SUB_32(*compare1, dest1, res1); - - if(COND_EQ()) - { - res2 = dest2 - *compare2; - - FLAG_N = NFLAG_32(res2); - FLAG_Z = MASK_OUT_ABOVE_32(res2); - FLAG_V = VFLAG_SUB_32(*compare2, dest2, res2); - FLAG_C = CFLAG_SUB_32(*compare2, dest2, res2); - - if(COND_EQ()) - { - USE_CYCLES(3); - m68ki_write_32(ea1, REG_D[(word2 >> 22) & 7]); - m68ki_write_32(ea2, REG_D[(word2 >> 6) & 7]); - return; - } - } - *compare1 = dest1; - *compare2 = dest2; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk, 16, ., d) -{ - sint src = MAKE_INT_16(DX); - sint bound = MAKE_INT_16(DY); - - FLAG_Z = ZFLAG_16(src); /* Undocumented */ - FLAG_V = VFLAG_CLEAR; /* Undocumented */ - FLAG_C = CFLAG_CLEAR; /* Undocumented */ - - if(src >= 0 && src <= bound) - { - return; - } - FLAG_N = (src < 0)<<7; - m68ki_exception_trap(EXCEPTION_CHK); -} - - -M68KMAKE_OP(chk, 16, ., .) -{ - sint src = MAKE_INT_16(DX); - sint bound = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); - - FLAG_Z = ZFLAG_16(src); /* Undocumented */ - FLAG_V = VFLAG_CLEAR; /* Undocumented */ - FLAG_C = CFLAG_CLEAR; /* Undocumented */ - - if(src >= 0 && src <= bound) - { - return; - } - FLAG_N = (src < 0)<<7; - m68ki_exception_trap(EXCEPTION_CHK); -} - - -M68KMAKE_OP(chk, 32, ., d) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - sint src = MAKE_INT_32(DX); - sint bound = MAKE_INT_32(DY); - - FLAG_Z = ZFLAG_32(src); /* Undocumented */ - FLAG_V = VFLAG_CLEAR; /* Undocumented */ - FLAG_C = CFLAG_CLEAR; /* Undocumented */ - - if(src >= 0 && src <= bound) - { - return; - } - FLAG_N = (src < 0)<<7; - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - sint src = MAKE_INT_32(DX); - sint bound = MAKE_INT_32(M68KMAKE_GET_OPER_AY_32); - - FLAG_Z = ZFLAG_32(src); /* Undocumented */ - FLAG_V = VFLAG_CLEAR; /* Undocumented */ - FLAG_C = CFLAG_CLEAR; /* Undocumented */ - - if(src >= 0 && src <= bound) - { - return; - } - FLAG_N = (src < 0)<<7; - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk2cmp2, 8, ., pcdi) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint compare = REG_DA[(word2 >> 12) & 15]&0xff; - uint ea = EA_PCDI_8(); - uint lower_bound = m68ki_read_pcrel_8(ea); - uint upper_bound = m68ki_read_pcrel_8(ea + 1); - - if(!BIT_F(word2)) - FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound); - else - FLAG_C = compare - lower_bound; - FLAG_Z = !((upper_bound==compare) | (lower_bound==compare)); - if(COND_CS()) - { - if(BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - - FLAG_C = upper_bound - compare; - if(COND_CS() && BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk2cmp2, 8, ., pcix) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint compare = REG_DA[(word2 >> 12) & 15]&0xff; - uint ea = EA_PCIX_8(); - uint lower_bound = m68ki_read_pcrel_8(ea); - uint upper_bound = m68ki_read_pcrel_8(ea + 1); - - if(!BIT_F(word2)) - FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound); - else - FLAG_C = compare - lower_bound; - FLAG_Z = !((upper_bound==compare) | (lower_bound==compare)); - if(COND_CS()) - { - if(BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - - FLAG_C = upper_bound - compare; - if(COND_CS() && BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk2cmp2, 8, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint compare = REG_DA[(word2 >> 12) & 15]&0xff; - uint ea = M68KMAKE_GET_EA_AY_8; - uint lower_bound = m68ki_read_8(ea); - uint upper_bound = m68ki_read_8(ea + 1); - - if(!BIT_F(word2)) - FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound); - else - FLAG_C = compare - lower_bound; - FLAG_Z = !((upper_bound==compare) | (lower_bound==compare)); - if(COND_CS()) - { - if(BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - - FLAG_C = upper_bound - compare; - if(COND_CS() && BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk2cmp2, 16, ., pcdi) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint compare = REG_DA[(word2 >> 12) & 15]&0xffff; - uint ea = EA_PCDI_16(); - uint lower_bound = m68ki_read_pcrel_16(ea); - uint upper_bound = m68ki_read_pcrel_16(ea + 2); - - if(!BIT_F(word2)) - FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound); - else - FLAG_C = compare - lower_bound; - FLAG_Z = !((upper_bound==compare) | (lower_bound==compare)); - FLAG_C = CFLAG_16(FLAG_C); - if(COND_CS()) - { - if(BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - - if(!BIT_F(word2)) - FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare); - else - FLAG_C = upper_bound - compare; - FLAG_C = CFLAG_16(FLAG_C); - if(COND_CS() && BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk2cmp2, 16, ., pcix) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint compare = REG_DA[(word2 >> 12) & 15]&0xffff; - uint ea = EA_PCIX_16(); - uint lower_bound = m68ki_read_pcrel_16(ea); - uint upper_bound = m68ki_read_pcrel_16(ea + 2); - - if(!BIT_F(word2)) - FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound); - else - FLAG_C = compare - lower_bound; - FLAG_Z = !((upper_bound==compare) | (lower_bound==compare)); - FLAG_C = CFLAG_16(FLAG_C); - if(COND_CS()) - { - if(BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - - if(!BIT_F(word2)) - FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare); - else - FLAG_C = upper_bound - compare; - FLAG_C = CFLAG_16(FLAG_C); - if(COND_CS() && BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk2cmp2, 16, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint compare = REG_DA[(word2 >> 12) & 15]&0xffff; - uint ea = M68KMAKE_GET_EA_AY_16; - uint lower_bound = m68ki_read_16(ea); - uint upper_bound = m68ki_read_16(ea + 2); - - if(!BIT_F(word2)) - FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound); - else - FLAG_C = compare - lower_bound; - - FLAG_Z = !((upper_bound==compare) | (lower_bound==compare)); - FLAG_C = CFLAG_16(FLAG_C); - if(COND_CS()) - { - if(BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - if(!BIT_F(word2)) - FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare); - else - FLAG_C = upper_bound - compare; - - FLAG_C = CFLAG_16(FLAG_C); - if(COND_CS() && BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk2cmp2, 32, ., pcdi) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint compare = REG_DA[(word2 >> 12) & 15]; - uint ea = EA_PCDI_32(); - uint lower_bound = m68ki_read_pcrel_32(ea); - uint upper_bound = m68ki_read_pcrel_32(ea + 4); - - FLAG_C = compare - lower_bound; - FLAG_Z = !((upper_bound==compare) | (lower_bound==compare)); - FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); - if(COND_CS()) - { - if(BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - - FLAG_C = upper_bound - compare; - FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); - if(COND_CS() && BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk2cmp2, 32, ., pcix) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint compare = REG_DA[(word2 >> 12) & 15]; - uint ea = EA_PCIX_32(); - uint lower_bound = m68ki_read_pcrel_32(ea); - uint upper_bound = m68ki_read_pcrel_32(ea + 4); - - FLAG_C = compare - lower_bound; - FLAG_Z = !((upper_bound==compare) | (lower_bound==compare)); - FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); - if(COND_CS()) - { - if(BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - - FLAG_C = upper_bound - compare; - FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); - if(COND_CS() && BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(chk2cmp2, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint compare = REG_DA[(word2 >> 12) & 15]; - uint ea = M68KMAKE_GET_EA_AY_32; - uint lower_bound = m68ki_read_32(ea); - uint upper_bound = m68ki_read_32(ea + 4); - - FLAG_C = compare - lower_bound; - FLAG_Z = !((upper_bound==compare) | (lower_bound==compare)); - FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); - if(COND_CS()) - { - if(BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - - FLAG_C = upper_bound - compare; - FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); - if(COND_CS() && BIT_B(word2)) - m68ki_exception_trap(EXCEPTION_CHK); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(clr, 8, ., d) -{ - DY &= 0xffffff00; - - FLAG_N = NFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; -} - - -M68KMAKE_OP(clr, 8, ., .) -{ - m68ki_write_8(M68KMAKE_GET_EA_AY_8, 0); - - FLAG_N = NFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; -} - - -M68KMAKE_OP(clr, 16, ., d) -{ - DY &= 0xffff0000; - - FLAG_N = NFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; -} - - -M68KMAKE_OP(clr, 16, ., .) -{ - m68ki_write_16(M68KMAKE_GET_EA_AY_16, 0); - - FLAG_N = NFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; -} - - -M68KMAKE_OP(clr, 32, ., d) -{ - DY = 0; - - FLAG_N = NFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; -} - - -M68KMAKE_OP(clr, 32, ., .) -{ - m68ki_write_32(M68KMAKE_GET_EA_AY_32, 0); - - FLAG_N = NFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; -} - - -M68KMAKE_OP(cmp, 8, ., d) -{ - uint src = MASK_OUT_ABOVE_8(DY); - uint dst = MASK_OUT_ABOVE_8(DX); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); -} - - -M68KMAKE_OP(cmp, 8, ., .) -{ - uint src = M68KMAKE_GET_OPER_AY_8; - uint dst = MASK_OUT_ABOVE_8(DX); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); -} - - -M68KMAKE_OP(cmp, 16, ., d) -{ - uint src = MASK_OUT_ABOVE_16(DY); - uint dst = MASK_OUT_ABOVE_16(DX); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_C = CFLAG_16(res); -} - - -M68KMAKE_OP(cmp, 16, ., a) -{ - uint src = MASK_OUT_ABOVE_16(AY); - uint dst = MASK_OUT_ABOVE_16(DX); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_C = CFLAG_16(res); -} - - -M68KMAKE_OP(cmp, 16, ., .) -{ - uint src = M68KMAKE_GET_OPER_AY_16; - uint dst = MASK_OUT_ABOVE_16(DX); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_C = CFLAG_16(res); -} - - -M68KMAKE_OP(cmp, 32, ., d) -{ - uint src = DY; - uint dst = DX; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmp, 32, ., a) -{ - uint src = AY; - uint dst = DX; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmp, 32, ., .) -{ - uint src = M68KMAKE_GET_OPER_AY_32; - uint dst = DX; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmpa, 16, ., d) -{ - uint src = MAKE_INT_16(DY); - uint dst = AX; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmpa, 16, ., a) -{ - uint src = MAKE_INT_16(AY); - uint dst = AX; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmpa, 16, ., .) -{ - uint src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); - uint dst = AX; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmpa, 32, ., d) -{ - uint src = DY; - uint dst = AX; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmpa, 32, ., a) -{ - uint src = AY; - uint dst = AX; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmpa, 32, ., .) -{ - uint src = M68KMAKE_GET_OPER_AY_32; - uint dst = AX; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmpi, 8, ., d) -{ - uint src = OPER_I_8(); - uint dst = MASK_OUT_ABOVE_8(DY); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); -} - - -M68KMAKE_OP(cmpi, 8, ., .) -{ - uint src = OPER_I_8(); - uint dst = M68KMAKE_GET_OPER_AY_8; - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); -} - - -M68KMAKE_OP(cmpi, 8, ., pcdi) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint src = OPER_I_8(); - uint dst = OPER_PCDI_8(); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cmpi, 8, ., pcix) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint src = OPER_I_8(); - uint dst = OPER_PCIX_8(); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cmpi, 16, ., d) -{ - uint src = OPER_I_16(); - uint dst = MASK_OUT_ABOVE_16(DY); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_C = CFLAG_16(res); -} - - -M68KMAKE_OP(cmpi, 16, ., .) -{ - uint src = OPER_I_16(); - uint dst = M68KMAKE_GET_OPER_AY_16; - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_C = CFLAG_16(res); -} - - -M68KMAKE_OP(cmpi, 16, ., pcdi) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint src = OPER_I_16(); - uint dst = OPER_PCDI_16(); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_C = CFLAG_16(res); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cmpi, 16, ., pcix) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint src = OPER_I_16(); - uint dst = OPER_PCIX_16(); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_C = CFLAG_16(res); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cmpi, 32, ., d) -{ - uint src = OPER_I_32(); - uint dst = DY; - uint res = dst - src; - - m68ki_cmpild_callback(src, REG_IR & 7); /* auto-disable (see m68kcpu.h) */ - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmpi, 32, ., .) -{ - uint src = OPER_I_32(); - uint dst = M68KMAKE_GET_OPER_AY_32; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cmpi, 32, ., pcdi) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint src = OPER_I_32(); - uint dst = OPER_PCDI_32(); - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cmpi, 32, ., pcix) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint src = OPER_I_32(); - uint dst = OPER_PCIX_32(); - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(cmpm, 8, ., ax7) -{ - uint src = OPER_AY_PI_8(); - uint dst = OPER_A7_PI_8(); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); -} - - -M68KMAKE_OP(cmpm, 8, ., ay7) -{ - uint src = OPER_A7_PI_8(); - uint dst = OPER_AX_PI_8(); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); -} - - -M68KMAKE_OP(cmpm, 8, ., axy7) -{ - uint src = OPER_A7_PI_8(); - uint dst = OPER_A7_PI_8(); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); -} - - -M68KMAKE_OP(cmpm, 8, ., .) -{ - uint src = OPER_AY_PI_8(); - uint dst = OPER_AX_PI_8(); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_C = CFLAG_8(res); -} - - -M68KMAKE_OP(cmpm, 16, ., .) -{ - uint src = OPER_AY_PI_16(); - uint dst = OPER_AX_PI_16(); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_C = CFLAG_16(res); -} - - -M68KMAKE_OP(cmpm, 32, ., .) -{ - uint src = OPER_AY_PI_32(); - uint dst = OPER_AX_PI_32(); - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_C = CFLAG_SUB_32(src, dst, res); -} - - -M68KMAKE_OP(cpbcc, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, - m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); - return; - } - m68ki_exception_1111(); -} - - -M68KMAKE_OP(cpdbcc, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, - m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); - return; - } - m68ki_exception_1111(); -} - - -M68KMAKE_OP(cpgen, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, - m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); - return; - } - m68ki_exception_1111(); -} - - -M68KMAKE_OP(cpscc, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, - m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); - return; - } - m68ki_exception_1111(); -} - - -M68KMAKE_OP(cptrapcc, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, - m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); - return; - } - m68ki_exception_1111(); -} - - -M68KMAKE_OP(dbt, 16, ., .) -{ - REG_PC += 2; -} - - -M68KMAKE_OP(dbf, 16, ., .) -{ - uint* r_dst = &DY; - uint res = MASK_OUT_ABOVE_16(*r_dst - 1); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - if(res != 0xffff) - { - uint offset = OPER_I_16(); - REG_PC -= 2; - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_16(offset); - USE_CYCLES(CYC_DBCC_F_NOEXP); - return; - } - REG_PC += 2; - USE_CYCLES(CYC_DBCC_F_EXP); -} - - -M68KMAKE_OP(dbcc, 16, ., .) -{ - if(M68KMAKE_NOT_CC) - { - uint* r_dst = &DY; - uint res = MASK_OUT_ABOVE_16(*r_dst - 1); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - if(res != 0xffff) - { - uint offset = OPER_I_16(); - REG_PC -= 2; - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_16(offset); - USE_CYCLES(CYC_DBCC_F_NOEXP); - return; - } - REG_PC += 2; - USE_CYCLES(CYC_DBCC_F_EXP); - return; - } - REG_PC += 2; -} - - -M68KMAKE_OP(divs, 16, ., d) -{ - uint* r_dst = &DX; - sint src = MAKE_INT_16(DY); - sint quotient; - sint remainder; - - if(src != 0) - { - if((uint32)*r_dst == 0x80000000 && src == -1) - { - FLAG_Z = 0; - FLAG_N = NFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - *r_dst = 0; - return; - } - - quotient = MAKE_INT_32(*r_dst) / src; - remainder = MAKE_INT_32(*r_dst) % src; - - if(quotient == MAKE_INT_16(quotient)) - { - FLAG_Z = quotient; - FLAG_N = NFLAG_16(quotient); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); - return; - } - FLAG_V = VFLAG_SET; - return; - } - m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); -} - - -M68KMAKE_OP(divs, 16, ., .) -{ - uint* r_dst = &DX; - sint src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); - sint quotient; - sint remainder; - - if(src != 0) - { - if((uint32)*r_dst == 0x80000000 && src == -1) - { - FLAG_Z = 0; - FLAG_N = NFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - *r_dst = 0; - return; - } - - quotient = MAKE_INT_32(*r_dst) / src; - remainder = MAKE_INT_32(*r_dst) % src; - - if(quotient == MAKE_INT_16(quotient)) - { - FLAG_Z = quotient; - FLAG_N = NFLAG_16(quotient); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); - return; - } - FLAG_V = VFLAG_SET; - return; - } - m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); -} - - -M68KMAKE_OP(divu, 16, ., d) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_16(DY); - - if(src != 0) - { - uint quotient = *r_dst / src; - uint remainder = *r_dst % src; - - if(quotient < 0x10000) - { - FLAG_Z = quotient; - FLAG_N = NFLAG_16(quotient); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); - return; - } - FLAG_V = VFLAG_SET; - return; - } - m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); -} - - -M68KMAKE_OP(divu, 16, ., .) -{ - uint* r_dst = &DX; - uint src = M68KMAKE_GET_OPER_AY_16; - - if(src != 0) - { - uint quotient = *r_dst / src; - uint remainder = *r_dst % src; - - if(quotient < 0x10000) - { - FLAG_Z = quotient; - FLAG_N = NFLAG_16(quotient); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); - return; - } - FLAG_V = VFLAG_SET; - return; - } - m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); -} - - -M68KMAKE_OP(divl, 32, ., d) -{ -#if M68K_USE_64_BIT - - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint64 divisor = DY; - uint64 dividend = 0; - uint64 quotient = 0; - uint64 remainder = 0; - - if(divisor != 0) - { - if(BIT_A(word2)) /* 64 bit */ - { - dividend = REG_D[word2 & 7]; - dividend <<= 32; - dividend |= REG_D[(word2 >> 12) & 7]; - - if(BIT_B(word2)) /* signed */ - { - quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); - remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); - if((sint64)quotient != (sint64)((sint32)quotient)) - { - FLAG_V = VFLAG_SET; - return; - } - } - else /* unsigned */ - { - quotient = dividend / divisor; - if(quotient > 0xffffffff) - { - FLAG_V = VFLAG_SET; - return; - } - remainder = dividend % divisor; - } - } - else /* 32 bit */ - { - dividend = REG_D[(word2 >> 12) & 7]; - if(BIT_B(word2)) /* signed */ - { - quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); - remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); - } - else /* unsigned */ - { - quotient = dividend / divisor; - remainder = dividend % divisor; - } - } - - REG_D[word2 & 7] = remainder; - REG_D[(word2 >> 12) & 7] = quotient; - - FLAG_N = NFLAG_32(quotient); - FLAG_Z = quotient; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); - return; - } - m68ki_exception_illegal(); - -#else - - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint divisor = DY; - uint dividend_hi = REG_D[word2 & 7]; - uint dividend_lo = REG_D[(word2 >> 12) & 7]; - uint quotient = 0; - uint remainder = 0; - uint dividend_neg = 0; - uint divisor_neg = 0; - sint i; - uint overflow; - - if(divisor != 0) - { - /* quad / long : long quotient, long remainder */ - if(BIT_A(word2)) - { - if(BIT_B(word2)) /* signed */ - { - /* special case in signed divide */ - if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) - { - REG_D[word2 & 7] = 0; - REG_D[(word2 >> 12) & 7] = 0x80000000; - - FLAG_N = NFLAG_SET; - FLAG_Z = ZFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - if(GET_MSB_32(dividend_hi)) - { - dividend_neg = 1; - dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); - dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); - } - if(GET_MSB_32(divisor)) - { - divisor_neg = 1; - divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); - - } - } - - /* if the upper long is greater than the divisor, we're overflowing. */ - if(dividend_hi >= divisor) - { - FLAG_V = VFLAG_SET; - return; - } - - for(i = 31; i >= 0; i--) - { - quotient <<= 1; - remainder = (remainder << 1) + ((dividend_hi >> i) & 1); - if(remainder >= divisor) - { - remainder -= divisor; - quotient++; - } - } - for(i = 31; i >= 0; i--) - { - quotient <<= 1; - overflow = GET_MSB_32(remainder); - remainder = (remainder << 1) + ((dividend_lo >> i) & 1); - if(remainder >= divisor || overflow) - { - remainder -= divisor; - quotient++; - } - } - - if(BIT_B(word2)) /* signed */ - { - if(quotient > 0x7fffffff) - { - FLAG_V = VFLAG_SET; - return; - } - if(dividend_neg) - { - remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); - quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); - } - if(divisor_neg) - quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); - } - - REG_D[word2 & 7] = remainder; - REG_D[(word2 >> 12) & 7] = quotient; - - FLAG_N = NFLAG_32(quotient); - FLAG_Z = quotient; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - - /* long / long: long quotient, maybe long remainder */ - if(BIT_B(word2)) /* signed */ - { - /* Special case in divide */ - if(dividend_lo == 0x80000000 && divisor == 0xffffffff) - { - FLAG_N = NFLAG_SET; - FLAG_Z = ZFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - REG_D[(word2 >> 12) & 7] = 0x80000000; - REG_D[word2 & 7] = 0; - return; - } - REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); - quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); - } - else - { - REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); - quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); - } - - FLAG_N = NFLAG_32(quotient); - FLAG_Z = quotient; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); - return; - } - m68ki_exception_illegal(); - -#endif -} - - -M68KMAKE_OP(divl, 32, ., .) -{ -#if M68K_USE_64_BIT - - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint64 divisor = M68KMAKE_GET_OPER_AY_32; - uint64 dividend = 0; - uint64 quotient = 0; - uint64 remainder = 0; - - if(divisor != 0) - { - if(BIT_A(word2)) /* 64 bit */ - { - dividend = REG_D[word2 & 7]; - dividend <<= 32; - dividend |= REG_D[(word2 >> 12) & 7]; - - if(BIT_B(word2)) /* signed */ - { - quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); - remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); - if((sint64)quotient != (sint64)((sint32)quotient)) - { - FLAG_V = VFLAG_SET; - return; - } - } - else /* unsigned */ - { - quotient = dividend / divisor; - if(quotient > 0xffffffff) - { - FLAG_V = VFLAG_SET; - return; - } - remainder = dividend % divisor; - } - } - else /* 32 bit */ - { - dividend = REG_D[(word2 >> 12) & 7]; - if(BIT_B(word2)) /* signed */ - { - quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); - remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); - } - else /* unsigned */ - { - quotient = dividend / divisor; - remainder = dividend % divisor; - } - } - - REG_D[word2 & 7] = remainder; - REG_D[(word2 >> 12) & 7] = quotient; - - FLAG_N = NFLAG_32(quotient); - FLAG_Z = quotient; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); - return; - } - m68ki_exception_illegal(); - -#else - - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint divisor = M68KMAKE_GET_OPER_AY_32; - uint dividend_hi = REG_D[word2 & 7]; - uint dividend_lo = REG_D[(word2 >> 12) & 7]; - uint quotient = 0; - uint remainder = 0; - uint dividend_neg = 0; - uint divisor_neg = 0; - sint i; - uint overflow; - - if(divisor != 0) - { - /* quad / long : long quotient, long remainder */ - if(BIT_A(word2)) - { - if(BIT_B(word2)) /* signed */ - { - /* special case in signed divide */ - if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) - { - REG_D[word2 & 7] = 0; - REG_D[(word2 >> 12) & 7] = 0x80000000; - - FLAG_N = NFLAG_SET; - FLAG_Z = ZFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - if(GET_MSB_32(dividend_hi)) - { - dividend_neg = 1; - dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); - dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); - } - if(GET_MSB_32(divisor)) - { - divisor_neg = 1; - divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); - - } - } - - /* if the upper long is greater than the divisor, we're overflowing. */ - if(dividend_hi >= divisor) - { - FLAG_V = VFLAG_SET; - return; - } - - for(i = 31; i >= 0; i--) - { - quotient <<= 1; - remainder = (remainder << 1) + ((dividend_hi >> i) & 1); - if(remainder >= divisor) - { - remainder -= divisor; - quotient++; - } - } - for(i = 31; i >= 0; i--) - { - quotient <<= 1; - overflow = GET_MSB_32(remainder); - remainder = (remainder << 1) + ((dividend_lo >> i) & 1); - if(remainder >= divisor || overflow) - { - remainder -= divisor; - quotient++; - } - } - - if(BIT_B(word2)) /* signed */ - { - if(quotient > 0x7fffffff) - { - FLAG_V = VFLAG_SET; - return; - } - if(dividend_neg) - { - remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); - quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); - } - if(divisor_neg) - quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); - } - - REG_D[word2 & 7] = remainder; - REG_D[(word2 >> 12) & 7] = quotient; - - FLAG_N = NFLAG_32(quotient); - FLAG_Z = quotient; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - - /* long / long: long quotient, maybe long remainder */ - if(BIT_B(word2)) /* signed */ - { - /* Special case in divide */ - if(dividend_lo == 0x80000000 && divisor == 0xffffffff) - { - FLAG_N = NFLAG_SET; - FLAG_Z = ZFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - REG_D[(word2 >> 12) & 7] = 0x80000000; - REG_D[word2 & 7] = 0; - return; - } - REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); - quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); - } - else - { - REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); - quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); - } - - FLAG_N = NFLAG_32(quotient); - FLAG_Z = quotient; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); - return; - } - m68ki_exception_illegal(); - -#endif -} - - -M68KMAKE_OP(eor, 8, ., d) -{ - uint res = MASK_OUT_ABOVE_8(DY ^= MASK_OUT_ABOVE_8(DX)); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eor, 8, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eor, 16, ., d) -{ - uint res = MASK_OUT_ABOVE_16(DY ^= MASK_OUT_ABOVE_16(DX)); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eor, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint res = MASK_OUT_ABOVE_16(DX ^ m68ki_read_16(ea)); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eor, 32, ., d) -{ - uint res = DY ^= DX; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eor, 32, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - uint res = DX ^ m68ki_read_32(ea); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eori, 8, ., d) -{ - uint res = MASK_OUT_ABOVE_8(DY ^= OPER_I_8()); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eori, 8, ., .) -{ - uint src = OPER_I_8(); - uint ea = M68KMAKE_GET_EA_AY_8; - uint res = src ^ m68ki_read_8(ea); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eori, 16, ., d) -{ - uint res = MASK_OUT_ABOVE_16(DY ^= OPER_I_16()); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eori, 16, ., .) -{ - uint src = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_16; - uint res = src ^ m68ki_read_16(ea); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eori, 32, ., d) -{ - uint res = DY ^= OPER_I_32(); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eori, 32, ., .) -{ - uint src = OPER_I_32(); - uint ea = M68KMAKE_GET_EA_AY_32; - uint res = src ^ m68ki_read_32(ea); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(eori, 16, toc, .) -{ - m68ki_set_ccr(m68ki_get_ccr() ^ OPER_I_16()); -} - - -M68KMAKE_OP(eori, 16, tos, .) -{ - if(FLAG_S) - { - uint src = OPER_I_16(); - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_set_sr(m68ki_get_sr() ^ src); - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(exg, 32, dd, .) -{ - uint* reg_a = &DX; - uint* reg_b = &DY; - uint tmp = *reg_a; - *reg_a = *reg_b; - *reg_b = tmp; -} - - -M68KMAKE_OP(exg, 32, aa, .) -{ - uint* reg_a = &AX; - uint* reg_b = &AY; - uint tmp = *reg_a; - *reg_a = *reg_b; - *reg_b = tmp; -} - - -M68KMAKE_OP(exg, 32, da, .) -{ - uint* reg_a = &DX; - uint* reg_b = &AY; - uint tmp = *reg_a; - *reg_a = *reg_b; - *reg_b = tmp; -} - - -M68KMAKE_OP(ext, 16, ., .) -{ - uint* r_dst = &DY; - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | MASK_OUT_ABOVE_8(*r_dst) | (GET_MSB_8(*r_dst) ? 0xff00 : 0); - - FLAG_N = NFLAG_16(*r_dst); - FLAG_Z = MASK_OUT_ABOVE_16(*r_dst); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(ext, 32, ., .) -{ - uint* r_dst = &DY; - - *r_dst = MASK_OUT_ABOVE_16(*r_dst) | (GET_MSB_16(*r_dst) ? 0xffff0000 : 0); - - FLAG_N = NFLAG_32(*r_dst); - FLAG_Z = *r_dst; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(extb, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint* r_dst = &DY; - - *r_dst = MASK_OUT_ABOVE_8(*r_dst) | (GET_MSB_8(*r_dst) ? 0xffffff00 : 0); - - FLAG_N = NFLAG_32(*r_dst); - FLAG_Z = *r_dst; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(illegal, 0, ., .) -{ - m68ki_exception_illegal(); -} - -M68KMAKE_OP(jmp, 32, ., .) -{ - m68ki_jump(M68KMAKE_GET_EA_AY_32); - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - if(REG_PC == REG_PPC) - USE_ALL_CYCLES(); -} - - -M68KMAKE_OP(jsr, 32, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_push_32(REG_PC); - m68ki_jump(ea); -} - - -M68KMAKE_OP(lea, 32, ., .) -{ - AX = M68KMAKE_GET_EA_AY_32; -} - - -M68KMAKE_OP(link, 16, ., a7) -{ - REG_A[7] -= 4; - m68ki_write_32(REG_A[7], REG_A[7]); - REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + MAKE_INT_16(OPER_I_16())); -} - - -M68KMAKE_OP(link, 16, ., .) -{ - uint* r_dst = &AY; - - m68ki_push_32(*r_dst); - *r_dst = REG_A[7]; - REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + MAKE_INT_16(OPER_I_16())); -} - - -M68KMAKE_OP(link, 32, ., a7) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - REG_A[7] -= 4; - m68ki_write_32(REG_A[7], REG_A[7]); - REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + OPER_I_32()); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(link, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint* r_dst = &AY; - - m68ki_push_32(*r_dst); - *r_dst = REG_A[7]; - REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + OPER_I_32()); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(lsr, 8, s, .) -{ - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = src >> shift; - - if(shift != 0) - USE_CYCLES(shift<> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_16(*r_dst); - uint res = src >> shift; - - if(shift != 0) - USE_CYCLES(shift<> 9) - 1) & 7) + 1; - uint src = *r_dst; - uint res = src >> shift; - - if(shift != 0) - USE_CYCLES(shift<> shift; - - if(shift != 0) - { - USE_CYCLES(shift<> shift; - - if(shift != 0) - { - USE_CYCLES(shift<> (shift - 1))<<8; - FLAG_N = NFLAG_CLEAR; - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - *r_dst &= 0xffff0000; - FLAG_X = XFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_16(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(lsr, 32, r, .) -{ - uint* r_dst = &DY; - uint shift = DX & 0x3f; - uint src = *r_dst; - uint res = src >> shift; - - if(shift != 0) - { - USE_CYCLES(shift<> (shift - 1))<<8; - FLAG_N = NFLAG_CLEAR; - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - *r_dst = 0; - FLAG_X = FLAG_C = (shift == 32 ? GET_MSB_32(src)>>23 : 0); - FLAG_N = NFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_32(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(lsr, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = m68ki_read_16(ea); - uint res = src >> 1; - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_CLEAR; - FLAG_Z = res; - FLAG_C = FLAG_X = src << 8; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(lsl, 8, s, .) -{ - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = MASK_OUT_ABOVE_8(src << shift); - - if(shift != 0) - USE_CYCLES(shift<> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_16(*r_dst); - uint res = MASK_OUT_ABOVE_16(src << shift); - - if(shift != 0) - USE_CYCLES(shift<> (8-shift); - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(lsl, 32, s, .) -{ - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = *r_dst; - uint res = MASK_OUT_ABOVE_32(src << shift); - - if(shift != 0) - USE_CYCLES(shift<> (24-shift); - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(lsl, 8, r, .) -{ - uint* r_dst = &DY; - uint shift = DX & 0x3f; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = MASK_OUT_ABOVE_8(src << shift); - - if(shift != 0) - { - USE_CYCLES(shift<> 8; - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - *r_dst &= 0xffff0000; - FLAG_X = XFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_16(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(lsl, 32, r, .) -{ - uint* r_dst = &DY; - uint shift = DX & 0x3f; - uint src = *r_dst; - uint res = MASK_OUT_ABOVE_32(src << shift); - - if(shift != 0) - { - USE_CYCLES(shift<> (32 - shift)) << 8; - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - *r_dst = 0; - FLAG_X = FLAG_C = ((shift == 32 ? src & 1 : 0))<<8; - FLAG_N = NFLAG_CLEAR; - FLAG_Z = ZFLAG_SET; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_32(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(lsl, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = m68ki_read_16(ea); - uint res = MASK_OUT_ABOVE_16(src << 1); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_X = FLAG_C = src >> 7; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, d, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint* r_dst = &DX; - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, d, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint* r_dst = &DX; - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, ai, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint ea = EA_AX_AI_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, ai, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint ea = EA_AX_AI_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, pi7, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint ea = EA_A7_PI_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, pi, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint ea = EA_AX_PI_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, pi7, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint ea = EA_A7_PI_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, pi, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint ea = EA_AX_PI_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, pd7, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint ea = EA_A7_PD_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, pd, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint ea = EA_AX_PD_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, pd7, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint ea = EA_A7_PD_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, pd, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint ea = EA_AX_PD_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, di, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint ea = EA_AX_DI_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, di, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint ea = EA_AX_DI_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, ix, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint ea = EA_AX_IX_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, ix, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint ea = EA_AX_IX_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, aw, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint ea = EA_AW_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, aw, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint ea = EA_AW_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, al, d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - uint ea = EA_AL_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 8, al, .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - uint ea = EA_AL_8(); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, d, d) -{ - uint res = MASK_OUT_ABOVE_16(DY); - uint* r_dst = &DX; - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, d, a) -{ - uint res = MASK_OUT_ABOVE_16(AY); - uint* r_dst = &DX; - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, d, .) -{ - uint res = M68KMAKE_GET_OPER_AY_16; - uint* r_dst = &DX; - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, ai, d) -{ - uint res = MASK_OUT_ABOVE_16(DY); - uint ea = EA_AX_AI_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, ai, a) -{ - uint res = MASK_OUT_ABOVE_16(AY); - uint ea = EA_AX_AI_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, ai, .) -{ - uint res = M68KMAKE_GET_OPER_AY_16; - uint ea = EA_AX_AI_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, pi, d) -{ - uint res = MASK_OUT_ABOVE_16(DY); - uint ea = EA_AX_PI_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, pi, a) -{ - uint res = MASK_OUT_ABOVE_16(AY); - uint ea = EA_AX_PI_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, pi, .) -{ - uint res = M68KMAKE_GET_OPER_AY_16; - uint ea = EA_AX_PI_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, pd, d) -{ - uint res = MASK_OUT_ABOVE_16(DY); - uint ea = EA_AX_PD_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, pd, a) -{ - uint res = MASK_OUT_ABOVE_16(AY); - uint ea = EA_AX_PD_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, pd, .) -{ - uint res = M68KMAKE_GET_OPER_AY_16; - uint ea = EA_AX_PD_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, di, d) -{ - uint res = MASK_OUT_ABOVE_16(DY); - uint ea = EA_AX_DI_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, di, a) -{ - uint res = MASK_OUT_ABOVE_16(AY); - uint ea = EA_AX_DI_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, di, .) -{ - uint res = M68KMAKE_GET_OPER_AY_16; - uint ea = EA_AX_DI_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, ix, d) -{ - uint res = MASK_OUT_ABOVE_16(DY); - uint ea = EA_AX_IX_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, ix, a) -{ - uint res = MASK_OUT_ABOVE_16(AY); - uint ea = EA_AX_IX_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, ix, .) -{ - uint res = M68KMAKE_GET_OPER_AY_16; - uint ea = EA_AX_IX_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, aw, d) -{ - uint res = MASK_OUT_ABOVE_16(DY); - uint ea = EA_AW_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, aw, a) -{ - uint res = MASK_OUT_ABOVE_16(AY); - uint ea = EA_AW_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, aw, .) -{ - uint res = M68KMAKE_GET_OPER_AY_16; - uint ea = EA_AW_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, al, d) -{ - uint res = MASK_OUT_ABOVE_16(DY); - uint ea = EA_AL_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, al, a) -{ - uint res = MASK_OUT_ABOVE_16(AY); - uint ea = EA_AL_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 16, al, .) -{ - uint res = M68KMAKE_GET_OPER_AY_16; - uint ea = EA_AL_16(); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, d, d) -{ - uint res = DY; - uint* r_dst = &DX; - - *r_dst = res; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, d, a) -{ - uint res = AY; - uint* r_dst = &DX; - - *r_dst = res; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, d, .) -{ - uint res = M68KMAKE_GET_OPER_AY_32; - uint* r_dst = &DX; - - *r_dst = res; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, ai, d) -{ - uint res = DY; - uint ea = EA_AX_AI_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, ai, a) -{ - uint res = AY; - uint ea = EA_AX_AI_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, ai, .) -{ - uint res = M68KMAKE_GET_OPER_AY_32; - uint ea = EA_AX_AI_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, pi, d) -{ - uint res = DY; - uint ea = EA_AX_PI_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, pi, a) -{ - uint res = AY; - uint ea = EA_AX_PI_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, pi, .) -{ - uint res = M68KMAKE_GET_OPER_AY_32; - uint ea = EA_AX_PI_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, pd, d) -{ - uint res = DY; - uint ea = EA_AX_PD_32(); - - m68ki_write_16(ea+2, res & 0xFFFF ); - m68ki_write_16(ea, (res >> 16) & 0xFFFF ); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, pd, a) -{ - uint res = AY; - uint ea = EA_AX_PD_32(); - - m68ki_write_16(ea+2, res & 0xFFFF ); - m68ki_write_16(ea, (res >> 16) & 0xFFFF ); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, pd, .) -{ - uint res = M68KMAKE_GET_OPER_AY_32; - uint ea = EA_AX_PD_32(); - - m68ki_write_16(ea+2, res & 0xFFFF ); - m68ki_write_16(ea, (res >> 16) & 0xFFFF ); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, di, d) -{ - uint res = DY; - uint ea = EA_AX_DI_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, di, a) -{ - uint res = AY; - uint ea = EA_AX_DI_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, di, .) -{ - uint res = M68KMAKE_GET_OPER_AY_32; - uint ea = EA_AX_DI_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, ix, d) -{ - uint res = DY; - uint ea = EA_AX_IX_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, ix, a) -{ - uint res = AY; - uint ea = EA_AX_IX_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, ix, .) -{ - uint res = M68KMAKE_GET_OPER_AY_32; - uint ea = EA_AX_IX_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, aw, d) -{ - uint res = DY; - uint ea = EA_AW_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, aw, a) -{ - uint res = AY; - uint ea = EA_AW_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, aw, .) -{ - uint res = M68KMAKE_GET_OPER_AY_32; - uint ea = EA_AW_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, al, d) -{ - uint res = DY; - uint ea = EA_AL_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, al, a) -{ - uint res = AY; - uint ea = EA_AL_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move, 32, al, .) -{ - uint res = M68KMAKE_GET_OPER_AY_32; - uint ea = EA_AL_32(); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(movea, 16, ., d) -{ - AX = MAKE_INT_16(DY); -} - - -M68KMAKE_OP(movea, 16, ., a) -{ - AX = MAKE_INT_16(AY); -} - - -M68KMAKE_OP(movea, 16, ., .) -{ - AX = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); -} - - -M68KMAKE_OP(movea, 32, ., d) -{ - AX = DY; -} - - -M68KMAKE_OP(movea, 32, ., a) -{ - AX = AY; -} - - -M68KMAKE_OP(movea, 32, ., .) -{ - AX = M68KMAKE_GET_OPER_AY_32; -} - - -M68KMAKE_OP(move, 16, frc, d) -{ - if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) - { - DY = MASK_OUT_BELOW_16(DY) | m68ki_get_ccr(); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(move, 16, frc, .) -{ - if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) - { - m68ki_write_16(M68KMAKE_GET_EA_AY_16, m68ki_get_ccr()); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(move, 16, toc, d) -{ - m68ki_set_ccr(DY); -} - - -M68KMAKE_OP(move, 16, toc, .) -{ - m68ki_set_ccr(M68KMAKE_GET_OPER_AY_16); -} - - -M68KMAKE_OP(move, 16, frs, d) -{ - if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ - { - DY = MASK_OUT_BELOW_16(DY) | m68ki_get_sr(); - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(move, 16, frs, .) -{ - if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ - { - uint ea = M68KMAKE_GET_EA_AY_16; - m68ki_write_16(ea, m68ki_get_sr()); - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(move, 16, tos, d) -{ - if(FLAG_S) - { - m68ki_set_sr(DY); - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(move, 16, tos, .) -{ - if(FLAG_S) - { - uint new_sr = M68KMAKE_GET_OPER_AY_16; - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_set_sr(new_sr); - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(move, 32, fru, .) -{ - if(FLAG_S) - { - AY = REG_USP; - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(move, 32, tou, .) -{ - if(FLAG_S) - { - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - REG_USP = AY; - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(movec, 32, cr, .) -{ - if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) - { - if(FLAG_S) - { - uint word2 = OPER_I_16(); - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - switch (word2 & 0xfff) - { - case 0x000: /* SFC */ - REG_DA[(word2 >> 12) & 15] = REG_SFC; - return; - case 0x001: /* DFC */ - REG_DA[(word2 >> 12) & 15] = REG_DFC; - return; - case 0x002: /* CACR */ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - REG_DA[(word2 >> 12) & 15] = REG_CACR; - return; - } - return; - case 0x800: /* USP */ - REG_DA[(word2 >> 12) & 15] = REG_USP; - return; - case 0x801: /* VBR */ - REG_DA[(word2 >> 12) & 15] = REG_VBR; - return; - case 0x802: /* CAAR */ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - REG_DA[(word2 >> 12) & 15] = REG_CAAR; - return; - } - m68ki_exception_illegal(); - break; - case 0x803: /* MSP */ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - REG_DA[(word2 >> 12) & 15] = FLAG_M ? REG_SP : REG_MSP; - return; - } - m68ki_exception_illegal(); - return; - case 0x804: /* ISP */ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - REG_DA[(word2 >> 12) & 15] = FLAG_M ? REG_ISP : REG_SP; - return; - } - m68ki_exception_illegal(); - return; - case 0x003: /* TC */ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x004: /* ITT0 */ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x005: /* ITT1 */ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x006: /* DTT0 */ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x007: /* DTT1 */ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x805: /* MMUSR */ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x806: /* URP */ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x807: /* SRP */ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - default: - m68ki_exception_illegal(); - return; - } - } - m68ki_exception_privilege_violation(); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(movec, 32, rc, .) -{ - if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) - { - if(FLAG_S) - { - uint word2 = OPER_I_16(); - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - switch (word2 & 0xfff) - { - case 0x000: /* SFC */ - REG_SFC = REG_DA[(word2 >> 12) & 15] & 7; - return; - case 0x001: /* DFC */ - REG_DFC = REG_DA[(word2 >> 12) & 15] & 7; - return; - case 0x002: /* CACR */ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - if (CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - REG_CACR = REG_DA[(word2 >> 12) & 15]; - } - else - { - /* non 68040 can only set the lower 4 bits (C,CE,F,E) */ - REG_CACR = REG_DA[(word2 >> 12) & 15] & 0x0f; - } - return; - } - m68ki_exception_illegal(); - return; - case 0x800: /* USP */ - REG_USP = REG_DA[(word2 >> 12) & 15]; - return; - case 0x801: /* VBR */ - REG_VBR = REG_DA[(word2 >> 12) & 15]; - return; - case 0x802: /* CAAR */ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - REG_CAAR = REG_DA[(word2 >> 12) & 15]; - return; - } - m68ki_exception_illegal(); - return; - case 0x803: /* MSP */ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* we are in supervisor mode so just check for M flag */ - if(!FLAG_M) - { - REG_MSP = REG_DA[(word2 >> 12) & 15]; - return; - } - REG_SP = REG_DA[(word2 >> 12) & 15]; - return; - } - m68ki_exception_illegal(); - return; - case 0x804: /* ISP */ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - if(!FLAG_M) - { - REG_SP = REG_DA[(word2 >> 12) & 15]; - return; - } - REG_ISP = REG_DA[(word2 >> 12) & 15]; - return; - } - m68ki_exception_illegal(); - return; - case 0x003: /* TC */ - if (CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x004: /* ITT0 */ - if (CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x005: /* ITT1 */ - if (CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x006: /* DTT0 */ - if (CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x007: /* DTT1 */ - if (CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x805: /* MMUSR */ - if (CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x806: /* URP */ - if (CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - case 0x807: /* SRP */ - if (CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - /* TODO */ - return; - } - m68ki_exception_illegal(); - return; - default: - m68ki_exception_illegal(); - return; - } - } - m68ki_exception_privilege_violation(); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(movem, 16, re, pd) -{ - uint i = 0; - uint register_list = OPER_I_16(); - uint ea = AY; - uint count = 0; - - for(; i < 16; i++) - if(register_list & (1 << i)) - { - ea -= 2; - m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_DA[15-i])); - count++; - } - AY = ea; - - USE_CYCLES(count<> 16) & 0xFFFF ); - count++; - } - AY = ea; - - USE_CYCLES(count<> 8)); - m68ki_write_8(ea += 2, MASK_OUT_ABOVE_8(src)); -} - - -M68KMAKE_OP(movep, 32, re, .) -{ - uint ea = EA_AY_DI_32(); - uint src = DX; - - m68ki_write_8(ea, MASK_OUT_ABOVE_8(src >> 24)); - m68ki_write_8(ea += 2, MASK_OUT_ABOVE_8(src >> 16)); - m68ki_write_8(ea += 2, MASK_OUT_ABOVE_8(src >> 8)); - m68ki_write_8(ea += 2, MASK_OUT_ABOVE_8(src)); -} - - -M68KMAKE_OP(movep, 16, er, .) -{ - uint ea = EA_AY_DI_16(); - uint* r_dst = &DX; - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | ((m68ki_read_8(ea) << 8) + m68ki_read_8(ea + 2)); -} - - -M68KMAKE_OP(movep, 32, er, .) -{ - uint ea = EA_AY_DI_32(); - - DX = (m68ki_read_8(ea) << 24) + (m68ki_read_8(ea + 2) << 16) - + (m68ki_read_8(ea + 4) << 8) + m68ki_read_8(ea + 6); -} - - -M68KMAKE_OP(moves, 8, ., .) -{ - if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) - { - if(FLAG_S) - { - uint word2 = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_8; - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - if(BIT_B(word2)) /* Register to memory */ - { - m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); - return; - } - if(BIT_F(word2)) /* Memory to address register */ - { - REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); - if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) - USE_CYCLES(2); - return; - } - /* Memory to data register */ - REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); - if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) - USE_CYCLES(2); - return; - } - m68ki_exception_privilege_violation(); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(moves, 16, ., .) -{ - if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) - { - if(FLAG_S) - { - uint word2 = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_16; - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - if(BIT_B(word2)) /* Register to memory */ - { - m68ki_write_16_fc(ea, REG_DFC, MASK_OUT_ABOVE_16(REG_DA[(word2 >> 12) & 15])); - return; - } - if(BIT_F(word2)) /* Memory to address register */ - { - REG_A[(word2 >> 12) & 7] = MAKE_INT_16(m68ki_read_16_fc(ea, REG_SFC)); - if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) - USE_CYCLES(2); - return; - } - /* Memory to data register */ - REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_16(REG_D[(word2 >> 12) & 7]) | m68ki_read_16_fc(ea, REG_SFC); - if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) - USE_CYCLES(2); - return; - } - m68ki_exception_privilege_violation(); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(moves, 32, ., .) -{ - if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) - { - if(FLAG_S) - { - uint word2 = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_32; - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - if(BIT_B(word2)) /* Register to memory */ - { - m68ki_write_32_fc(ea, REG_DFC, REG_DA[(word2 >> 12) & 15]); - if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) - USE_CYCLES(2); - return; - } - /* Memory to register */ - REG_DA[(word2 >> 12) & 15] = m68ki_read_32_fc(ea, REG_SFC); - if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) - USE_CYCLES(2); - return; - } - m68ki_exception_privilege_violation(); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(moveq, 32, ., .) -{ - uint res = DX = MAKE_INT_8(MASK_OUT_ABOVE_8(REG_IR)); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(move16, 32, ., .) -{ - UINT16 w2 = OPER_I_16(); - int ax = REG_IR & 7; - int ay = (w2 >> 12) & 7; - - m68ki_write_32(REG_A[ay], m68ki_read_32(REG_A[ax])); - m68ki_write_32(REG_A[ay]+4, m68ki_read_32(REG_A[ax]+4)); - m68ki_write_32(REG_A[ay]+8, m68ki_read_32(REG_A[ax]+8)); - m68ki_write_32(REG_A[ay]+12, m68ki_read_32(REG_A[ax]+12)); - - REG_A[ax] += 16; - REG_A[ay] += 16; -} - - -M68KMAKE_OP(muls, 16, ., d) -{ - uint* r_dst = &DX; - uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(DY) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); - - *r_dst = res; - - FLAG_Z = res; - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(muls, 16, ., .) -{ - uint* r_dst = &DX; - uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(M68KMAKE_GET_OPER_AY_16) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); - - *r_dst = res; - - FLAG_Z = res; - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(mulu, 16, ., d) -{ - uint* r_dst = &DX; - uint res = MASK_OUT_ABOVE_16(DY) * MASK_OUT_ABOVE_16(*r_dst); - - *r_dst = res; - - FLAG_Z = res; - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(mulu, 16, ., .) -{ - uint* r_dst = &DX; - uint res = M68KMAKE_GET_OPER_AY_16 * MASK_OUT_ABOVE_16(*r_dst); - - *r_dst = res; - - FLAG_Z = res; - FLAG_N = NFLAG_32(res); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(mull, 32, ., d) -{ -#if M68K_USE_64_BIT - - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint64 src = DY; - uint64 dst = REG_D[(word2 >> 12) & 7]; - uint64 res; - - FLAG_C = CFLAG_CLEAR; - - if(BIT_B(word2)) /* signed */ - { - res = (sint64)((sint32)src) * (sint64)((sint32)dst); - if(!BIT_A(word2)) - { - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_N = NFLAG_32(res); - FLAG_V = ((sint64)res != (sint32)res)<<7; - REG_D[(word2 >> 12) & 7] = FLAG_Z; - return; - } - FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); - FLAG_N = NFLAG_64(res); - FLAG_V = VFLAG_CLEAR; - REG_D[word2 & 7] = (res >> 32); - REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); - return; - } - - res = src * dst; - if(!BIT_A(word2)) - { - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_N = NFLAG_32(res); - FLAG_V = (res > 0xffffffff)<<7; - REG_D[(word2 >> 12) & 7] = FLAG_Z; - return; - } - FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); - FLAG_N = NFLAG_64(res); - FLAG_V = VFLAG_CLEAR; - REG_D[word2 & 7] = (res >> 32); - REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); - return; - } - m68ki_exception_illegal(); - -#else - - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint src = DY; - uint dst = REG_D[(word2 >> 12) & 7]; - uint neg = GET_MSB_32(src ^ dst); - uint src1; - uint src2; - uint dst1; - uint dst2; - uint r1; - uint r2; - uint r3; - uint r4; - uint lo; - uint hi; - - FLAG_C = CFLAG_CLEAR; - - if(BIT_B(word2)) /* signed */ - { - if(GET_MSB_32(src)) - src = (uint)MASK_OUT_ABOVE_32(-(sint)src); - if(GET_MSB_32(dst)) - dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); - } - - src1 = MASK_OUT_ABOVE_16(src); - src2 = src>>16; - dst1 = MASK_OUT_ABOVE_16(dst); - dst2 = dst>>16; - - - r1 = src1 * dst1; - r2 = src1 * dst2; - r3 = src2 * dst1; - r4 = src2 * dst2; - - lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); - hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); - - if(BIT_B(word2) && neg) - { - hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); - lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); - } - - if(BIT_A(word2)) - { - REG_D[word2 & 7] = hi; - REG_D[(word2 >> 12) & 7] = lo; - FLAG_N = NFLAG_32(hi); - FLAG_Z = hi | lo; - FLAG_V = VFLAG_CLEAR; - return; - } - - REG_D[(word2 >> 12) & 7] = lo; - FLAG_N = NFLAG_32(lo); - FLAG_Z = lo; - if(BIT_B(word2)) - FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; - else - FLAG_V = (hi != 0) << 7; - return; - } - m68ki_exception_illegal(); - -#endif -} - - -M68KMAKE_OP(mull, 32, ., .) -{ -#if M68K_USE_64_BIT - - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint64 src = M68KMAKE_GET_OPER_AY_32; - uint64 dst = REG_D[(word2 >> 12) & 7]; - uint64 res; - - FLAG_C = CFLAG_CLEAR; - - if(BIT_B(word2)) /* signed */ - { - res = (sint64)((sint32)src) * (sint64)((sint32)dst); - if(!BIT_A(word2)) - { - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_N = NFLAG_32(res); - FLAG_V = ((sint64)res != (sint32)res)<<7; - REG_D[(word2 >> 12) & 7] = FLAG_Z; - return; - } - FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); - FLAG_N = NFLAG_64(res); - FLAG_V = VFLAG_CLEAR; - REG_D[word2 & 7] = (res >> 32); - REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); - return; - } - - res = src * dst; - if(!BIT_A(word2)) - { - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_N = NFLAG_32(res); - FLAG_V = (res > 0xffffffff)<<7; - REG_D[(word2 >> 12) & 7] = FLAG_Z; - return; - } - FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); - FLAG_N = NFLAG_64(res); - FLAG_V = VFLAG_CLEAR; - REG_D[word2 & 7] = (res >> 32); - REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); - return; - } - m68ki_exception_illegal(); - -#else - - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint word2 = OPER_I_16(); - uint src = M68KMAKE_GET_OPER_AY_32; - uint dst = REG_D[(word2 >> 12) & 7]; - uint neg = GET_MSB_32(src ^ dst); - uint src1; - uint src2; - uint dst1; - uint dst2; - uint r1; - uint r2; - uint r3; - uint r4; - uint lo; - uint hi; - - FLAG_C = CFLAG_CLEAR; - - if(BIT_B(word2)) /* signed */ - { - if(GET_MSB_32(src)) - src = (uint)MASK_OUT_ABOVE_32(-(sint)src); - if(GET_MSB_32(dst)) - dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); - } - - src1 = MASK_OUT_ABOVE_16(src); - src2 = src>>16; - dst1 = MASK_OUT_ABOVE_16(dst); - dst2 = dst>>16; - - - r1 = src1 * dst1; - r2 = src1 * dst2; - r3 = src2 * dst1; - r4 = src2 * dst2; - - lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); - hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); - - if(BIT_B(word2) && neg) - { - hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); - lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); - } - - if(BIT_A(word2)) - { - REG_D[word2 & 7] = hi; - REG_D[(word2 >> 12) & 7] = lo; - FLAG_N = NFLAG_32(hi); - FLAG_Z = hi | lo; - FLAG_V = VFLAG_CLEAR; - return; - } - - REG_D[(word2 >> 12) & 7] = lo; - FLAG_N = NFLAG_32(lo); - FLAG_Z = lo; - if(BIT_B(word2)) - FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; - else - FLAG_V = (hi != 0) << 7; - return; - } - m68ki_exception_illegal(); - -#endif -} - - -M68KMAKE_OP(nbcd, 8, ., d) -{ - uint* r_dst = &DY; - uint dst = *r_dst; - uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); - - if(res != 0x9a) - { - FLAG_V = ~res; /* Undefined V behavior */ - - if((res & 0x0f) == 0xa) - res = (res & 0xf0) + 0x10; - - res = MASK_OUT_ABOVE_8(res); - - FLAG_V &= res; /* Undefined V behavior part II */ - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; - - FLAG_Z |= res; - FLAG_C = CFLAG_SET; - FLAG_X = XFLAG_SET; - } - else - { - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_X = XFLAG_CLEAR; - } - FLAG_N = NFLAG_8(res); /* Undefined N behavior */ -} - - -M68KMAKE_OP(nbcd, 8, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint dst = m68ki_read_8(ea); - uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); - - if(res != 0x9a) - { - FLAG_V = ~res; /* Undefined V behavior */ - - if((res & 0x0f) == 0xa) - res = (res & 0xf0) + 0x10; - - res = MASK_OUT_ABOVE_8(res); - - FLAG_V &= res; /* Undefined V behavior part II */ - - m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); - - FLAG_Z |= res; - FLAG_C = CFLAG_SET; - FLAG_X = XFLAG_SET; - } - else - { - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - FLAG_X = XFLAG_CLEAR; - } - FLAG_N = NFLAG_8(res); /* Undefined N behavior */ -} - - -M68KMAKE_OP(neg, 8, ., d) -{ - uint* r_dst = &DY; - uint res = 0 - MASK_OUT_ABOVE_8(*r_dst); - - FLAG_N = NFLAG_8(res); - FLAG_C = FLAG_X = CFLAG_8(res); - FLAG_V = *r_dst & res; - FLAG_Z = MASK_OUT_ABOVE_8(res); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(neg, 8, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = m68ki_read_8(ea); - uint res = 0 - src; - - FLAG_N = NFLAG_8(res); - FLAG_C = FLAG_X = CFLAG_8(res); - FLAG_V = src & res; - FLAG_Z = MASK_OUT_ABOVE_8(res); - - m68ki_write_8(ea, FLAG_Z); -} - - -M68KMAKE_OP(neg, 16, ., d) -{ - uint* r_dst = &DY; - uint res = 0 - MASK_OUT_ABOVE_16(*r_dst); - - FLAG_N = NFLAG_16(res); - FLAG_C = FLAG_X = CFLAG_16(res); - FLAG_V = (*r_dst & res)>>8; - FLAG_Z = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(neg, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = m68ki_read_16(ea); - uint res = 0 - src; - - FLAG_N = NFLAG_16(res); - FLAG_C = FLAG_X = CFLAG_16(res); - FLAG_V = (src & res)>>8; - FLAG_Z = MASK_OUT_ABOVE_16(res); - - m68ki_write_16(ea, FLAG_Z); -} - - -M68KMAKE_OP(neg, 32, ., d) -{ - uint* r_dst = &DY; - uint res = 0 - *r_dst; - - FLAG_N = NFLAG_32(res); - FLAG_C = FLAG_X = CFLAG_SUB_32(*r_dst, 0, res); - FLAG_V = (*r_dst & res)>>24; - FLAG_Z = MASK_OUT_ABOVE_32(res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(neg, 32, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - uint src = m68ki_read_32(ea); - uint res = 0 - src; - - FLAG_N = NFLAG_32(res); - FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res); - FLAG_V = (src & res)>>24; - FLAG_Z = MASK_OUT_ABOVE_32(res); - - m68ki_write_32(ea, FLAG_Z); -} - - -M68KMAKE_OP(negx, 8, ., d) -{ - uint* r_dst = &DY; - uint res = 0 - MASK_OUT_ABOVE_8(*r_dst) - XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = *r_dst & res; - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; -} - - -M68KMAKE_OP(negx, 8, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = m68ki_read_8(ea); - uint res = 0 - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = src & res; - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(negx, 16, ., d) -{ - uint* r_dst = &DY; - uint res = 0 - MASK_OUT_ABOVE_16(*r_dst) - XFLAG_AS_1(); - - FLAG_N = NFLAG_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = (*r_dst & res)>>8; - - res = MASK_OUT_ABOVE_16(res); - FLAG_Z |= res; - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; -} - - -M68KMAKE_OP(negx, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = m68ki_read_16(ea); - uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(); - - FLAG_N = NFLAG_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = (src & res)>>8; - - res = MASK_OUT_ABOVE_16(res); - FLAG_Z |= res; - - m68ki_write_16(ea, res); -} - - -M68KMAKE_OP(negx, 32, ., d) -{ - uint* r_dst = &DY; - uint res = 0 - MASK_OUT_ABOVE_32(*r_dst) - XFLAG_AS_1(); - - FLAG_N = NFLAG_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(*r_dst, 0, res); - FLAG_V = (*r_dst & res)>>24; - - res = MASK_OUT_ABOVE_32(res); - FLAG_Z |= res; - - *r_dst = res; -} - - -M68KMAKE_OP(negx, 32, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - uint src = m68ki_read_32(ea); - uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(); - - FLAG_N = NFLAG_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res); - FLAG_V = (src & res)>>24; - - res = MASK_OUT_ABOVE_32(res); - FLAG_Z |= res; - - m68ki_write_32(ea, res); -} - - -M68KMAKE_OP(nop, 0, ., .) -{ - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ -} - - -M68KMAKE_OP(not, 8, ., d) -{ - uint* r_dst = &DY; - uint res = MASK_OUT_ABOVE_8(~*r_dst); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(not, 8, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(not, 16, ., d) -{ - uint* r_dst = &DY; - uint res = MASK_OUT_ABOVE_16(~*r_dst); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(not, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea)); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(not, 32, ., d) -{ - uint* r_dst = &DY; - uint res = *r_dst = MASK_OUT_ABOVE_32(~*r_dst); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(not, 32, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea)); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(or, 8, er, d) -{ - uint res = MASK_OUT_ABOVE_8((DX |= MASK_OUT_ABOVE_8(DY))); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(or, 8, er, .) -{ - uint res = MASK_OUT_ABOVE_8((DX |= M68KMAKE_GET_OPER_AY_8)); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(or, 16, er, d) -{ - uint res = MASK_OUT_ABOVE_16((DX |= MASK_OUT_ABOVE_16(DY))); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(or, 16, er, .) -{ - uint res = MASK_OUT_ABOVE_16((DX |= M68KMAKE_GET_OPER_AY_16)); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(or, 32, er, d) -{ - uint res = DX |= DY; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(or, 32, er, .) -{ - uint res = DX |= M68KMAKE_GET_OPER_AY_32; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(or, 8, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(or, 16, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea)); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(or, 32, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - uint res = DX | m68ki_read_32(ea); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(ori, 8, ., d) -{ - uint res = MASK_OUT_ABOVE_8((DY |= OPER_I_8())); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(ori, 8, ., .) -{ - uint src = OPER_I_8(); - uint ea = M68KMAKE_GET_EA_AY_8; - uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); - - m68ki_write_8(ea, res); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(ori, 16, ., d) -{ - uint res = MASK_OUT_ABOVE_16(DY |= OPER_I_16()); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(ori, 16, ., .) -{ - uint src = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_16; - uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea)); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(ori, 32, ., d) -{ - uint res = DY |= OPER_I_32(); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(ori, 32, ., .) -{ - uint src = OPER_I_32(); - uint ea = M68KMAKE_GET_EA_AY_32; - uint res = src | m68ki_read_32(ea); - - m68ki_write_32(ea, res); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(ori, 16, toc, .) -{ - m68ki_set_ccr(m68ki_get_ccr() | OPER_I_16()); -} - - -M68KMAKE_OP(ori, 16, tos, .) -{ - if(FLAG_S) - { - uint src = OPER_I_16(); - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_set_sr(m68ki_get_sr() | src); - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(pack, 16, rr, .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* Note: DX and DY are reversed in Motorola's docs */ - uint src = DY + OPER_I_16(); - uint* r_dst = &DX; - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | ((src >> 4) & 0x00f0) | (src & 0x000f); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(pack, 16, mm, ax7) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* Note: AX and AY are reversed in Motorola's docs */ - uint ea_src = EA_AY_PD_8(); - uint src = m68ki_read_8(ea_src); - ea_src = EA_AY_PD_8(); - src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16(); - - m68ki_write_8(EA_A7_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f)); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(pack, 16, mm, ay7) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* Note: AX and AY are reversed in Motorola's docs */ - uint ea_src = EA_A7_PD_8(); - uint src = m68ki_read_8(ea_src); - ea_src = EA_A7_PD_8(); - src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16(); - - m68ki_write_8(EA_AX_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f)); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(pack, 16, mm, axy7) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint ea_src = EA_A7_PD_8(); - uint src = m68ki_read_8(ea_src); - ea_src = EA_A7_PD_8(); - src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16(); - - m68ki_write_8(EA_A7_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f)); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(pack, 16, mm, .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* Note: AX and AY are reversed in Motorola's docs */ - uint ea_src = EA_AY_PD_8(); - uint src = m68ki_read_8(ea_src); - ea_src = EA_AY_PD_8(); - src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16(); - - m68ki_write_8(EA_AX_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f)); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(pea, 32, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - - m68ki_push_32(ea); -} - - -M68KMAKE_OP(pflush, 32, ., .) -{ - if(CPU_TYPE_IS_040_PLUS(CPU_TYPE)) - { - // Nothing to do, unless address translation cache is emulated - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(reset, 0, ., .) -{ - if(FLAG_S) - { - m68ki_output_reset(); /* auto-disable (see m68kcpu.h) */ - USE_CYCLES(CYC_RESET); - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(ror, 8, s, .) -{ - uint* r_dst = &DY; - uint orig_shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint shift = orig_shift & 7; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = ROR_8(src, shift); - - if(orig_shift != 0) - USE_CYCLES(orig_shift<> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_16(*r_dst); - uint res = ROR_16(src, shift); - - if(shift != 0) - USE_CYCLES(shift<> 9) - 1) & 7) + 1; - uint64 src = *r_dst; - uint res = ROR_32(src, shift); - - if(shift != 0) - USE_CYCLES(shift<> ((shift - 1) & 15)) << 8; - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_16(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(ror, 32, r, .) -{ - uint* r_dst = &DY; - uint orig_shift = DX & 0x3f; - uint shift = orig_shift & 31; - uint64 src = *r_dst; - uint res = ROR_32(src, shift); - - if(orig_shift != 0) - { - USE_CYCLES(orig_shift<> ((shift - 1) & 31)) << 8; - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_32(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(ror, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = m68ki_read_16(ea); - uint res = ROR_16(src, 1); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = src << 8; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(rol, 8, s, .) -{ - uint* r_dst = &DY; - uint orig_shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint shift = orig_shift & 7; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = ROL_8(src, shift); - - if(orig_shift != 0) - USE_CYCLES(orig_shift<> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_16(*r_dst); - uint res = ROL_16(src, shift); - - if(shift != 0) - USE_CYCLES(shift<> (8-shift); - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(rol, 32, s, .) -{ - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint64 src = *r_dst; - uint res = ROL_32(src, shift); - - if(shift != 0) - USE_CYCLES(shift<> (24-shift); - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(rol, 8, r, .) -{ - uint* r_dst = &DY; - uint orig_shift = DX & 0x3f; - uint shift = orig_shift & 7; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = ROL_8(src, shift); - - if(orig_shift != 0) - { - USE_CYCLES(orig_shift<> 8; - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - FLAG_C = (src & 1)<<8; - FLAG_N = NFLAG_16(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_16(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(rol, 32, r, .) -{ - uint* r_dst = &DY; - uint orig_shift = DX & 0x3f; - uint shift = orig_shift & 31; - uint64 src = *r_dst; - uint res = ROL_32(src, shift); - - if(orig_shift != 0) - { - USE_CYCLES(orig_shift<> ((32 - shift) & 0x1f)) << 8; - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = CFLAG_CLEAR; - FLAG_N = NFLAG_32(src); - FLAG_Z = src; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(rol, 16, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = m68ki_read_16(ea); - uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_C = src >> 7; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(roxr, 8, s, .) -{ - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = ROR_9(src | (XFLAG_AS_1() << 8), shift); - - if(shift != 0) - USE_CYCLES(shift<> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_16(*r_dst); - uint res = ROR_17(src | (XFLAG_AS_1() << 16), shift); - - if(shift != 0) - USE_CYCLES(shift<> 8; - res = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(roxr, 32, s, .) -{ -#if M68K_USE_64_BIT - - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint64 src = *r_dst; - uint64 res = src | (((uint64)XFLAG_AS_1()) << 32); - - if(shift != 0) - USE_CYCLES(shift<> 24; - res = MASK_OUT_ABOVE_32(res); - - *r_dst = res; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - -#else - - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = *r_dst; - uint res = MASK_OUT_ABOVE_32((ROR_33(src, shift) & ~(1 << (32 - shift))) | (XFLAG_AS_1() << (32 - shift))); - uint new_x_flag = src & (1 << (shift - 1)); - - if(shift != 0) - USE_CYCLES(shift<> 8; - res = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = FLAG_X; - FLAG_N = NFLAG_16(*r_dst); - FLAG_Z = MASK_OUT_ABOVE_16(*r_dst); - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(roxr, 32, r, .) -{ -#if M68K_USE_64_BIT - - uint* r_dst = &DY; - uint orig_shift = DX & 0x3f; - - if(orig_shift != 0) - { - uint shift = orig_shift % 33; - uint64 src = *r_dst; - uint64 res = src | (((uint64)XFLAG_AS_1()) << 32); - - res = ROR_33_64(res, shift); - - USE_CYCLES(orig_shift<> 24; - res = MASK_OUT_ABOVE_32(res); - - *r_dst = res; - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = FLAG_X; - FLAG_N = NFLAG_32(*r_dst); - FLAG_Z = *r_dst; - FLAG_V = VFLAG_CLEAR; - -#else - - uint* r_dst = &DY; - uint orig_shift = DX & 0x3f; - uint shift = orig_shift % 33; - uint src = *r_dst; - uint res = MASK_OUT_ABOVE_32((ROR_33(src, shift) & ~(1 << (32 - shift))) | (XFLAG_AS_1() << (32 - shift))); - uint new_x_flag = src & (1 << (shift - 1)); - - if(orig_shift != 0) - USE_CYCLES(orig_shift<> 8; - res = MASK_OUT_ABOVE_16(res); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(roxl, 8, s, .) -{ - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_8(*r_dst); - uint res = ROL_9(src | (XFLAG_AS_1() << 8), shift); - - if(shift != 0) - USE_CYCLES(shift<> 9) - 1) & 7) + 1; - uint src = MASK_OUT_ABOVE_16(*r_dst); - uint res = ROL_17(src | (XFLAG_AS_1() << 16), shift); - - if(shift != 0) - USE_CYCLES(shift<> 8; - res = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(roxl, 32, s, .) -{ -#if M68K_USE_64_BIT - - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint64 src = *r_dst; - uint64 res = src | (((uint64)XFLAG_AS_1()) << 32); - - if(shift != 0) - USE_CYCLES(shift<> 24; - res = MASK_OUT_ABOVE_32(res); - - *r_dst = res; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - -#else - - uint* r_dst = &DY; - uint shift = (((REG_IR >> 9) - 1) & 7) + 1; - uint src = *r_dst; - uint res = MASK_OUT_ABOVE_32((ROL_33(src, shift) & ~(1 << (shift - 1))) | (XFLAG_AS_1() << (shift - 1))); - uint new_x_flag = src & (1 << (32 - shift)); - - if(shift != 0) - USE_CYCLES(shift<> 8; - res = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = FLAG_X; - FLAG_N = NFLAG_16(*r_dst); - FLAG_Z = MASK_OUT_ABOVE_16(*r_dst); - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(roxl, 32, r, .) -{ -#if M68K_USE_64_BIT - - uint* r_dst = &DY; - uint orig_shift = DX & 0x3f; - - if(orig_shift != 0) - { - uint shift = orig_shift % 33; - uint64 src = *r_dst; - uint64 res = src | (((uint64)XFLAG_AS_1()) << 32); - - res = ROL_33_64(res, shift); - - USE_CYCLES(orig_shift<> 24; - res = MASK_OUT_ABOVE_32(res); - - *r_dst = res; - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - return; - } - - FLAG_C = FLAG_X; - FLAG_N = NFLAG_32(*r_dst); - FLAG_Z = *r_dst; - FLAG_V = VFLAG_CLEAR; - -#else - - uint* r_dst = &DY; - uint orig_shift = DX & 0x3f; - uint shift = orig_shift % 33; - uint src = *r_dst; - uint res = MASK_OUT_ABOVE_32((ROL_33(src, shift) & ~(1 << (shift - 1))) | (XFLAG_AS_1() << (shift - 1))); - uint new_x_flag = src & (1 << (32 - shift)); - - if(orig_shift != 0) - USE_CYCLES(orig_shift<> 8; - res = MASK_OUT_ABOVE_16(res); - - m68ki_write_16(ea, res); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(rtd, 32, ., .) -{ - if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) - { - uint new_pc = m68ki_pull_32(); - - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + MAKE_INT_16(OPER_I_16())); - m68ki_jump(new_pc); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(rte, 32, ., .) -{ - if(FLAG_S) - { - uint new_sr; - uint new_pc; - uint format_word; - - m68ki_rte_callback(); /* auto-disable (see m68kcpu.h) */ - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - - if(CPU_TYPE_IS_000(CPU_TYPE)) - { - new_sr = m68ki_pull_16(); - new_pc = m68ki_pull_32(); - m68ki_jump(new_pc); - m68ki_set_sr(new_sr); - - CPU_INSTR_MODE = INSTRUCTION_YES; - CPU_RUN_MODE = RUN_MODE_NORMAL; - - return; - } - - if(CPU_TYPE_IS_010(CPU_TYPE)) - { - format_word = m68ki_read_16(REG_A[7]+6) >> 12; - if(format_word == 0) - { - new_sr = m68ki_pull_16(); - new_pc = m68ki_pull_32(); - m68ki_fake_pull_16(); /* format word */ - m68ki_jump(new_pc); - m68ki_set_sr(new_sr); - CPU_INSTR_MODE = INSTRUCTION_YES; - CPU_RUN_MODE = RUN_MODE_NORMAL; - return; - } - CPU_INSTR_MODE = INSTRUCTION_YES; - CPU_RUN_MODE = RUN_MODE_NORMAL; - /* Not handling bus fault (9) */ - m68ki_exception_format_error(); - return; - } - - /* Otherwise it's 020 */ -rte_loop: - format_word = m68ki_read_16(REG_A[7]+6) >> 12; - switch(format_word) - { - case 0: /* Normal */ - new_sr = m68ki_pull_16(); - new_pc = m68ki_pull_32(); - m68ki_fake_pull_16(); /* format word */ - m68ki_jump(new_pc); - m68ki_set_sr(new_sr); - CPU_INSTR_MODE = INSTRUCTION_YES; - CPU_RUN_MODE = RUN_MODE_NORMAL; - return; - case 1: /* Throwaway */ - new_sr = m68ki_pull_16(); - m68ki_fake_pull_32(); /* program counter */ - m68ki_fake_pull_16(); /* format word */ - m68ki_set_sr_noint(new_sr); - goto rte_loop; - case 2: /* Trap */ - new_sr = m68ki_pull_16(); - new_pc = m68ki_pull_32(); - m68ki_fake_pull_16(); /* format word */ - m68ki_fake_pull_32(); /* address */ - m68ki_jump(new_pc); - m68ki_set_sr(new_sr); - CPU_INSTR_MODE = INSTRUCTION_YES; - CPU_RUN_MODE = RUN_MODE_NORMAL; - return; - } - /* Not handling long or short bus fault */ - CPU_INSTR_MODE = INSTRUCTION_YES; - CPU_RUN_MODE = RUN_MODE_NORMAL; - m68ki_exception_format_error(); - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(rtm, 32, ., .) -{ - if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) - { - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, - m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(rtr, 32, ., .) -{ - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_set_ccr(m68ki_pull_16()); - m68ki_jump(m68ki_pull_32()); -} - - -M68KMAKE_OP(rts, 32, ., .) -{ - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_jump(m68ki_pull_32()); -} - - -M68KMAKE_OP(sbcd, 8, rr, .) -{ - uint* r_dst = &DX; - uint src = DY; - uint dst = *r_dst; - uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); - -// FLAG_V = ~res; /* Undefined V behavior */ - FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to assume cleared. */ - - if(res > 9) - res -= 6; - res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); - if(res > 0x99) - { - res += 0xa0; - FLAG_X = FLAG_C = CFLAG_SET; - FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */ - } - else - FLAG_N = FLAG_X = FLAG_C = 0; - - res = MASK_OUT_ABOVE_8(res); - -// FLAG_V &= res; /* Undefined V behavior part II */ -// FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - FLAG_Z |= res; - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; -} - - -M68KMAKE_OP(sbcd, 8, mm, ax7) -{ - uint src = OPER_AY_PD_8(); - uint ea = EA_A7_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); - -// FLAG_V = ~res; /* Undefined V behavior */ - FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */ - - if(res > 9) - res -= 6; - res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); - if(res > 0x99) - { - res += 0xa0; - FLAG_X = FLAG_C = CFLAG_SET; - FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */ - } - else - FLAG_N = FLAG_X = FLAG_C = 0; - - res = MASK_OUT_ABOVE_8(res); - -// FLAG_V &= res; /* Undefined V behavior part II */ -// FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(sbcd, 8, mm, ay7) -{ - uint src = OPER_A7_PD_8(); - uint ea = EA_AX_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); - -// FLAG_V = ~res; /* Undefined V behavior */ - FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */ - - if(res > 9) - res -= 6; - res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); - if(res > 0x99) - { - res += 0xa0; - FLAG_X = FLAG_C = CFLAG_SET; - FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */ - } - else - FLAG_N = FLAG_X = FLAG_C = 0; - - res = MASK_OUT_ABOVE_8(res); - -// FLAG_V &= res; /* Undefined V behavior part II */ -// FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(sbcd, 8, mm, axy7) -{ - uint src = OPER_A7_PD_8(); - uint ea = EA_A7_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); - -// FLAG_V = ~res; /* Undefined V behavior */ - FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */ - - if(res > 9) - res -= 6; - res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); - if(res > 0x99) - { - res += 0xa0; - FLAG_X = FLAG_C = CFLAG_SET; - FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */ - } - else - FLAG_N = FLAG_X = FLAG_C = 0; - - res = MASK_OUT_ABOVE_8(res); - -// FLAG_V &= res; /* Undefined V behavior part II */ -// FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(sbcd, 8, mm, .) -{ - uint src = OPER_AY_PD_8(); - uint ea = EA_AX_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); - -// FLAG_V = ~res; /* Undefined V behavior */ - FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */ - - if(res > 9) - res -= 6; - res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); - if(res > 0x99) - { - res += 0xa0; - FLAG_X = FLAG_C = CFLAG_SET; - FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */ - } - else - FLAG_N = FLAG_X = FLAG_C = 0; - - res = MASK_OUT_ABOVE_8(res); - -// FLAG_V &= res; /* Undefined V behavior part II */ -// FLAG_N = NFLAG_8(res); /* Undefined N behavior */ - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(st, 8, ., d) -{ - DY |= 0xff; -} - - -M68KMAKE_OP(st, 8, ., .) -{ - m68ki_write_8(M68KMAKE_GET_EA_AY_8, 0xff); -} - - -M68KMAKE_OP(sf, 8, ., d) -{ - DY &= 0xffffff00; -} - - -M68KMAKE_OP(sf, 8, ., .) -{ - m68ki_write_8(M68KMAKE_GET_EA_AY_8, 0); -} - - -M68KMAKE_OP(scc, 8, ., d) -{ - if(M68KMAKE_CC) - { - DY |= 0xff; - USE_CYCLES(CYC_SCC_R_TRUE); - return; - } - DY &= 0xffffff00; -} - - -M68KMAKE_OP(scc, 8, ., .) -{ - m68ki_write_8(M68KMAKE_GET_EA_AY_8, M68KMAKE_CC ? 0xff : 0); -} - - -M68KMAKE_OP(stop, 0, ., .) -{ - if(FLAG_S) - { - uint new_sr = OPER_I_16(); - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - CPU_STOPPED |= STOP_LEVEL_STOP; - m68ki_set_sr(new_sr); - m68ki_remaining_cycles = 0; - return; - } - m68ki_exception_privilege_violation(); -} - - -M68KMAKE_OP(sub, 8, er, d) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_8(DY); - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(sub, 8, er, .) -{ - uint* r_dst = &DX; - uint src = M68KMAKE_GET_OPER_AY_8; - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(sub, 16, er, d) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_16(DY); - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(sub, 16, er, a) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_16(AY); - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(sub, 16, er, .) -{ - uint* r_dst = &DX; - uint src = M68KMAKE_GET_OPER_AY_16; - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(sub, 32, er, d) -{ - uint* r_dst = &DX; - uint src = DY; - uint dst = *r_dst; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(sub, 32, er, a) -{ - uint* r_dst = &DX; - uint src = AY; - uint dst = *r_dst; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(sub, 32, er, .) -{ - uint* r_dst = &DX; - uint src = M68KMAKE_GET_OPER_AY_32; - uint dst = *r_dst; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(sub, 8, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint src = MASK_OUT_ABOVE_8(DX); - uint dst = m68ki_read_8(ea); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - m68ki_write_8(ea, FLAG_Z); -} - - -M68KMAKE_OP(sub, 16, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_16; - uint src = MASK_OUT_ABOVE_16(DX); - uint dst = m68ki_read_16(ea); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - - m68ki_write_16(ea, FLAG_Z); -} - - -M68KMAKE_OP(sub, 32, re, .) -{ - uint ea = M68KMAKE_GET_EA_AY_32; - uint src = DX; - uint dst = m68ki_read_32(ea); - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - - m68ki_write_32(ea, FLAG_Z); -} - - -M68KMAKE_OP(suba, 16, ., d) -{ - uint* r_dst = &AX; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(DY)); -} - - -M68KMAKE_OP(suba, 16, ., a) -{ - uint* r_dst = &AX; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(AY)); -} - - -M68KMAKE_OP(suba, 16, ., .) -{ - uint* r_dst = &AX; - uint src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); - - *r_dst = MASK_OUT_ABOVE_32(*r_dst - src); -} - - -M68KMAKE_OP(suba, 32, ., d) -{ - uint* r_dst = &AX; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst - DY); -} - - -M68KMAKE_OP(suba, 32, ., a) -{ - uint* r_dst = &AX; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst - AY); -} - - -M68KMAKE_OP(suba, 32, ., .) -{ - uint* r_dst = &AX; - uint src = M68KMAKE_GET_OPER_AY_32; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst - src); -} - - -M68KMAKE_OP(subi, 8, ., d) -{ - uint* r_dst = &DY; - uint src = OPER_I_8(); - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(subi, 8, ., .) -{ - uint src = OPER_I_8(); - uint ea = M68KMAKE_GET_EA_AY_8; - uint dst = m68ki_read_8(ea); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - m68ki_write_8(ea, FLAG_Z); -} - - -M68KMAKE_OP(subi, 16, ., d) -{ - uint* r_dst = &DY; - uint src = OPER_I_16(); - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(subi, 16, ., .) -{ - uint src = OPER_I_16(); - uint ea = M68KMAKE_GET_EA_AY_16; - uint dst = m68ki_read_16(ea); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - - m68ki_write_16(ea, FLAG_Z); -} - - -M68KMAKE_OP(subi, 32, ., d) -{ - uint* r_dst = &DY; - uint src = OPER_I_32(); - uint dst = *r_dst; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(subi, 32, ., .) -{ - uint src = OPER_I_32(); - uint ea = M68KMAKE_GET_EA_AY_32; - uint dst = m68ki_read_32(ea); - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - - m68ki_write_32(ea, FLAG_Z); -} - - -M68KMAKE_OP(subq, 8, ., d) -{ - uint* r_dst = &DY; - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(subq, 8, ., .) -{ - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint ea = M68KMAKE_GET_EA_AY_8; - uint dst = m68ki_read_8(ea); - uint res = dst - src; - - FLAG_N = NFLAG_8(res); - FLAG_Z = MASK_OUT_ABOVE_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - m68ki_write_8(ea, FLAG_Z); -} - - -M68KMAKE_OP(subq, 16, ., d) -{ - uint* r_dst = &DY; - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; -} - - -M68KMAKE_OP(subq, 16, ., a) -{ - uint* r_dst = &AY; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst - ((((REG_IR >> 9) - 1) & 7) + 1)); -} - - -M68KMAKE_OP(subq, 16, ., .) -{ - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint ea = M68KMAKE_GET_EA_AY_16; - uint dst = m68ki_read_16(ea); - uint res = dst - src; - - FLAG_N = NFLAG_16(res); - FLAG_Z = MASK_OUT_ABOVE_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - - m68ki_write_16(ea, FLAG_Z); -} - - -M68KMAKE_OP(subq, 32, ., d) -{ - uint* r_dst = &DY; - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint dst = *r_dst; - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - - *r_dst = FLAG_Z; -} - - -M68KMAKE_OP(subq, 32, ., a) -{ - uint* r_dst = &AY; - - *r_dst = MASK_OUT_ABOVE_32(*r_dst - ((((REG_IR >> 9) - 1) & 7) + 1)); -} - - -M68KMAKE_OP(subq, 32, ., .) -{ - uint src = (((REG_IR >> 9) - 1) & 7) + 1; - uint ea = M68KMAKE_GET_EA_AY_32; - uint dst = m68ki_read_32(ea); - uint res = dst - src; - - FLAG_N = NFLAG_32(res); - FLAG_Z = MASK_OUT_ABOVE_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - - m68ki_write_32(ea, FLAG_Z); -} - - -M68KMAKE_OP(subx, 8, rr, .) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_8(DY); - uint dst = MASK_OUT_ABOVE_8(*r_dst); - uint res = dst - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; -} - - -M68KMAKE_OP(subx, 16, rr, .) -{ - uint* r_dst = &DX; - uint src = MASK_OUT_ABOVE_16(DY); - uint dst = MASK_OUT_ABOVE_16(*r_dst); - uint res = dst - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - - res = MASK_OUT_ABOVE_16(res); - FLAG_Z |= res; - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; -} - - -M68KMAKE_OP(subx, 32, rr, .) -{ - uint* r_dst = &DX; - uint src = DY; - uint dst = *r_dst; - uint res = dst - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - - res = MASK_OUT_ABOVE_32(res); - FLAG_Z |= res; - - *r_dst = res; -} - - -M68KMAKE_OP(subx, 8, mm, ax7) -{ - uint src = OPER_AY_PD_8(); - uint ea = EA_A7_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = dst - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(subx, 8, mm, ay7) -{ - uint src = OPER_A7_PD_8(); - uint ea = EA_AX_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = dst - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(subx, 8, mm, axy7) -{ - uint src = OPER_A7_PD_8(); - uint ea = EA_A7_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = dst - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(subx, 8, mm, .) -{ - uint src = OPER_AY_PD_8(); - uint ea = EA_AX_PD_8(); - uint dst = m68ki_read_8(ea); - uint res = dst - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_8(res); - FLAG_X = FLAG_C = CFLAG_8(res); - FLAG_V = VFLAG_SUB_8(src, dst, res); - - res = MASK_OUT_ABOVE_8(res); - FLAG_Z |= res; - - m68ki_write_8(ea, res); -} - - -M68KMAKE_OP(subx, 16, mm, .) -{ - uint src = OPER_AY_PD_16(); - uint ea = EA_AX_PD_16(); - uint dst = m68ki_read_16(ea); - uint res = dst - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_16(res); - FLAG_X = FLAG_C = CFLAG_16(res); - FLAG_V = VFLAG_SUB_16(src, dst, res); - - res = MASK_OUT_ABOVE_16(res); - FLAG_Z |= res; - - m68ki_write_16(ea, res); -} - - -M68KMAKE_OP(subx, 32, mm, .) -{ - uint src = OPER_AY_PD_32(); - uint ea = EA_AX_PD_32(); - uint dst = m68ki_read_32(ea); - uint res = dst - src - XFLAG_AS_1(); - - FLAG_N = NFLAG_32(res); - FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); - FLAG_V = VFLAG_SUB_32(src, dst, res); - - res = MASK_OUT_ABOVE_32(res); - FLAG_Z |= res; - - m68ki_write_32(ea, res); -} - - -M68KMAKE_OP(swap, 32, ., .) -{ - uint* r_dst = &DY; - - FLAG_Z = MASK_OUT_ABOVE_32(*r_dst<<16); - *r_dst = (*r_dst>>16) | FLAG_Z; - - FLAG_Z = *r_dst; - FLAG_N = NFLAG_32(*r_dst); - FLAG_C = CFLAG_CLEAR; - FLAG_V = VFLAG_CLEAR; -} - - -M68KMAKE_OP(tas, 8, ., d) -{ - uint* r_dst = &DY; - - FLAG_Z = MASK_OUT_ABOVE_8(*r_dst); - FLAG_N = NFLAG_8(*r_dst); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - *r_dst |= 0x80; -} - - -M68KMAKE_OP(tas, 8, ., .) -{ - uint ea = M68KMAKE_GET_EA_AY_8; - uint dst = m68ki_read_8(ea); - uint allow_writeback; - - FLAG_Z = dst; - FLAG_N = NFLAG_8(dst); - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - - /* The Genesis/Megadrive games Gargoyles and Ex-Mutants need the TAS writeback - disabled in order to function properly. Some Amiga software may also rely - on this, but only when accessing specific addresses so additional functionality - will be needed. */ - allow_writeback = m68ki_tas_callback(); - - if (allow_writeback==1) m68ki_write_8(ea, dst | 0x80); -} - - -M68KMAKE_OP(trap, 0, ., .) -{ - /* Trap#n stacks exception frame type 0 */ - m68ki_exception_trapN(EXCEPTION_TRAP_BASE + (REG_IR & 0xf)); /* HJB 990403 */ -} - - -M68KMAKE_OP(trapt, 0, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(trapt, 16, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(trapt, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(trapf, 0, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(trapf, 16, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - REG_PC += 2; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(trapf, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - REG_PC += 4; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(trapcc, 0, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - if(M68KMAKE_CC) - m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(trapcc, 16, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - if(M68KMAKE_CC) - { - m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ - return; - } - REG_PC += 2; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(trapcc, 32, ., .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - if(M68KMAKE_CC) - { - m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ - return; - } - REG_PC += 4; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(trapv, 0, ., .) -{ - if(COND_VC()) - { - return; - } - m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ -} - - -M68KMAKE_OP(tst, 8, ., d) -{ - uint res = MASK_OUT_ABOVE_8(DY); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(tst, 8, ., .) -{ - uint res = M68KMAKE_GET_OPER_AY_8; - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(tst, 8, ., pcdi) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = OPER_PCDI_8(); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 8, ., pcix) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = OPER_PCIX_8(); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 8, ., i) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = OPER_I_8(); - - FLAG_N = NFLAG_8(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 16, ., d) -{ - uint res = MASK_OUT_ABOVE_16(DY); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(tst, 16, ., a) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = MAKE_INT_16(AY); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 16, ., .) -{ - uint res = M68KMAKE_GET_OPER_AY_16; - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(tst, 16, ., pcdi) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = OPER_PCDI_16(); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 16, ., pcix) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = OPER_PCIX_16(); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 16, ., i) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = OPER_I_16(); - - FLAG_N = NFLAG_16(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 32, ., d) -{ - uint res = DY; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(tst, 32, ., a) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = AY; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 32, ., .) -{ - uint res = M68KMAKE_GET_OPER_AY_32; - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; -} - - -M68KMAKE_OP(tst, 32, ., pcdi) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = OPER_PCDI_32(); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 32, ., pcix) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = OPER_PCIX_32(); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(tst, 32, ., i) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint res = OPER_I_32(); - - FLAG_N = NFLAG_32(res); - FLAG_Z = res; - FLAG_V = VFLAG_CLEAR; - FLAG_C = CFLAG_CLEAR; - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(unlk, 32, ., a7) -{ - REG_A[7] = m68ki_read_32(REG_A[7]); -} - - -M68KMAKE_OP(unlk, 32, ., .) -{ - uint* r_dst = &AY; - - REG_A[7] = *r_dst; - *r_dst = m68ki_pull_32(); -} - - -M68KMAKE_OP(unpk, 16, rr, .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* Note: DX and DY are reversed in Motorola's docs */ - uint src = DY; - uint* r_dst = &DX; - - *r_dst = MASK_OUT_BELOW_16(*r_dst) | (((((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16()) & 0xffff); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(unpk, 16, mm, ax7) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* Note: AX and AY are reversed in Motorola's docs */ - uint src = OPER_AY_PD_8(); - uint ea_dst; - - src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(); - ea_dst = EA_A7_PD_8(); - m68ki_write_8(ea_dst, (src >> 8) & 0xff); - ea_dst = EA_A7_PD_8(); - m68ki_write_8(ea_dst, src & 0xff); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(unpk, 16, mm, ay7) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* Note: AX and AY are reversed in Motorola's docs */ - uint src = OPER_A7_PD_8(); - uint ea_dst; - - src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(); - ea_dst = EA_AX_PD_8(); - m68ki_write_8(ea_dst, (src >> 8) & 0xff); - ea_dst = EA_AX_PD_8(); - m68ki_write_8(ea_dst, src & 0xff); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(unpk, 16, mm, axy7) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - uint src = OPER_A7_PD_8(); - uint ea_dst; - - src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(); - ea_dst = EA_A7_PD_8(); - m68ki_write_8(ea_dst, (src >> 8) & 0xff); - ea_dst = EA_A7_PD_8(); - m68ki_write_8(ea_dst, src & 0xff); - return; - } - m68ki_exception_illegal(); -} - - -M68KMAKE_OP(unpk, 16, mm, .) -{ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* Note: AX and AY are reversed in Motorola's docs */ - uint src = OPER_AY_PD_8(); - uint ea_dst; - - src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(); - ea_dst = EA_AX_PD_8(); - m68ki_write_8(ea_dst, (src >> 8) & 0xff); - ea_dst = EA_AX_PD_8(); - m68ki_write_8(ea_dst, src & 0xff); - return; - } - m68ki_exception_illegal(); -} - - - -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -M68KMAKE_END diff --git a/jan/src/cpu/m68k/m68kconf.h b/jan/src/cpu/m68k/m68kconf.h deleted file mode 100644 index b9618485e..000000000 --- a/jan/src/cpu/m68k/m68kconf.h +++ /dev/null @@ -1,301 +0,0 @@ -/* ======================================================================== */ -/* ========================= LICENSING & COPYRIGHT ======================== */ -/* ======================================================================== */ -/* - * MUSASHI - * Version 3.32 - * - * A portable Motorola M680x0 processor emulation engine. - * Copyright Karl Stenerud. All rights reserved. - * - * This code may be freely used for non-commercial purposes as long as this - * copyright notice remains unaltered in the source code and any binary files - * containing this code in compiled form. - * - * All other licensing terms must be negotiated with the author - * (Karl Stenerud). - * - * The latest version of this code can be obtained at: - * http://kstenerud.cjb.net - */ - - -#pragma once - -#ifndef M68KCONF__HEADER -#define M68KCONF__HEADER - -#define M68K_COMPILE_FOR_MAME OPT_OFF - -/* Configuration switches. - * Use OPT_SPECIFY_HANDLER for configuration options that allow callbacks. - * OPT_SPECIFY_HANDLER causes the core to link directly to the function - * or macro you specify, rather than using callback functions whose pointer - * must be passed in using m68k_set_xxx_callback(). - */ -#define OPT_OFF 0 -#define OPT_ON 1 -#define OPT_SPECIFY_HANDLER 2 - - -/* ======================================================================== */ -/* ============================== MAME STUFF ============================== */ -/* ======================================================================== */ - -/* If you're compiling this for MAME, only change M68K_COMPILE_FOR_MAME - * to OPT_ON and use m68kmame.h to configure the 68k core. - */ -#ifndef M68K_COMPILE_FOR_MAME -#define M68K_COMPILE_FOR_MAME OPT_ON -#endif /* M68K_COMPILE_FOR_MAME */ - - -#if M68K_COMPILE_FOR_MAME == OPT_OFF - -#ifndef FALSE -# define FALSE 0 -#endif -#ifndef TRUE -# define TRUE 1 -#endif - -#include "driver.h" - - -/* ======================================================================== */ -/* ============================= CONFIGURATION ============================ */ -/* ======================================================================== */ - -/* Turn ON if you want to use the following M68K variants */ -#define M68K_EMULATE_008 OPT_OFF -#define M68K_EMULATE_010 OPT_ON -#define M68K_EMULATE_EC020 OPT_ON -#define M68K_EMULATE_020 OPT_OFF -#define M68K_EMULATE_040 OPT_OFF - - -/* If ON, the CPU will call m68k_read_immediate_xx() for immediate addressing - * and m68k_read_pcrelative_xx() for PC-relative addressing. - * If off, all read requests from the CPU will be redirected to m68k_read_xx() - */ -#define M68K_SEPARATE_READS OPT_ON - -/* If ON, the CPU will call m68k_write_32_pd() when it executes move.l with a - * predecrement destination EA mode instead of m68k_write_32(). - * To simulate real 68k behavior, m68k_write_32_pd() must first write the high - * word to [address+2], and then write the low word to [address]. - */ -#define M68K_SIMULATE_PD_WRITES OPT_OFF - -/* If ON, CPU will call the interrupt acknowledge callback when it services an - * interrupt. - * If off, all interrupts will be autovectored and all interrupt requests will - * auto-clear when the interrupt is serviced. - */ -#define M68K_EMULATE_INT_ACK OPT_SPECIFY_HANDLER -#define M68K_INT_ACK_CALLBACK(A) M68KIRQAcknowledge(A) - - -/* If ON, CPU will call the breakpoint acknowledge callback when it encounters - * a breakpoint instruction and it is running a 68010+. - */ -#define M68K_EMULATE_BKPT_ACK OPT_OFF -#define M68K_BKPT_ACK_CALLBACK() your_bkpt_ack_handler_function() - - -/* If ON, the CPU will monitor the trace flags and take trace exceptions - */ -#define M68K_EMULATE_TRACE OPT_OFF - - -/* If ON, CPU will call the output reset callback when it encounters a reset - * instruction. - */ -#define M68K_EMULATE_RESET OPT_SPECIFY_HANDLER -#define M68K_RESET_CALLBACK() M68KResetCallback() - - -/* If ON, CPU will call the callback when it encounters a cmpi.l #v, dn - * instruction. - */ -#define M68K_CMPILD_HAS_CALLBACK OPT_SPECIFY_HANDLER -#define M68K_CMPILD_CALLBACK(v, r) M68KcmpildCallback(v, r) - -/* If ON, CPU will call the callback when it encounters a rte - * instruction. - */ -#define M68K_RTE_HAS_CALLBACK OPT_SPECIFY_HANDLER -#define M68K_RTE_CALLBACK() M68KRTECallback() - -/* If ON, CPU will call the callback when it encounters a tas - * instruction. - */ -#define M68K_TAS_HAS_CALLBACK OPT_SPECIFY_HANDLER -#define M68K_TAS_CALLBACK() M68KTASCallback() - - -/* If ON, CPU will call the set fc callback on every memory access to - * differentiate between user/supervisor, program/data access like a real - * 68000 would. This should be enabled and the callback should be set if you - * want to properly emulate the m68010 or higher. (moves uses function codes - * to read/write data from different address spaces) - */ -#define M68K_EMULATE_FC OPT_OFF -#define M68K_SET_FC_CALLBACK(A) your_set_fc_handler_function(A) - - -/* If ON, CPU will call the pc changed callback when it changes the PC by a - * large value. This allows host programs to be nicer when it comes to - * fetching immediate data and instructions on a banked memory system. - */ -#define M68K_MONITOR_PC OPT_OFF -#define M68K_SET_PC_CALLBACK(A) your_pc_changed_handler_function(A) - - -/* If ON, CPU will call the instruction hook callback before every - * instruction. - */ -#ifdef FBA_DEBUG - #define M68K_INSTRUCTION_HOOK OPT_ON -#else - #define M68K_INSTRUCTION_HOOK OPT_OFF -#endif -#define M68K_INSTRUCTION_CALLBACK() your_instruction_hook_function() - - -/* If ON, the CPU will emulate the 4-byte prefetch queue of a real 68000 */ -#define M68K_EMULATE_PREFETCH OPT_ON - - -/* If ON, the CPU will generate address error exceptions if it tries to - * access a word or longword at an odd address. - * NOTE: This is only emulated properly for 68000 mode. - */ -#define M68K_EMULATE_ADDRESS_ERROR OPT_OFF - - -/* Turn ON to enable logging of illegal instruction calls. - * M68K_LOG_FILEHANDLE must be #defined to a stdio file stream. - * Turn on M68K_LOG_1010_1111 to log all 1010 and 1111 calls. - */ -#define M68K_LOG_ENABLE OPT_OFF -#define M68K_LOG_1010_1111 OPT_OFF -#define M68K_LOG_FILEHANDLE some_file_handle - - -/* ----------------------------- COMPATIBILITY ---------------------------- */ - -/* The following options set optimizations that violate the current ANSI - * standard, but will be compliant under the forthcoming C9X standard. - */ - - -/* If ON, the enulation core will use 64-bit integers to speed up some - * operations. -*/ -#define M68K_USE_64_BIT OPT_OFF - - -/* Set to your compiler's static inline keyword to enable it, or - * set it to blank to disable it. - * If you define INLINE in the makefile, it will override this value. - * NOTE: not enabling inline functions will SEVERELY slow down emulation. - */ -#ifndef INLINE -#define INLINE static __inline__ -#endif /* INLINE */ - -/* --------------------------- FB Alpha handlers -------------------------- */ - -#ifdef __cplusplus - extern "C" { -#endif - -#ifndef FASTCALL - #undef __fastcall - #define __fastcall -#endif - -/* Reset callback */ -void M68KResetCallback(void); -int M68KIRQAcknowledge(int nIRQ); -void M68KRTECallback(void); -void M68KcmpildCallback(unsigned int val, int reg); -int M68KTASCallback(void); - -unsigned int __fastcall M68KFetchByte(unsigned int a); -unsigned int __fastcall M68KFetchWord(unsigned int a); -unsigned int __fastcall M68KFetchLong(unsigned int a); - -extern unsigned int (*SekDbgFetchByteDisassembler)(unsigned int); -extern unsigned int (*SekDbgFetchWordDisassembler)(unsigned int); -extern unsigned int (*SekDbgFetchLongDisassembler)(unsigned int); - -#if defined FBA_DEBUG -extern unsigned int (__fastcall *M68KReadByteDebug)(unsigned int); -extern unsigned int (__fastcall *M68KReadWordDebug)(unsigned int); -extern unsigned int (__fastcall *M68KReadLongDebug)(unsigned int); - -extern void (__fastcall *M68KWriteByteDebug)(unsigned int, unsigned int); -extern void (__fastcall *M68KWriteWordDebug)(unsigned int, unsigned int); -extern void (__fastcall *M68KWriteLongDebug)(unsigned int, unsigned int); -#else -unsigned int __fastcall M68KReadByte(unsigned int a); -unsigned int __fastcall M68KReadWord(unsigned int a); -unsigned int __fastcall M68KReadLong(unsigned int a); - -void __fastcall M68KWriteByte(unsigned int a, unsigned int d); -void __fastcall M68KWriteWord(unsigned int a, unsigned int d); -void __fastcall M68KWriteLong(unsigned int a, unsigned int d); -#endif - -#ifdef __cplusplus - } -#endif - -#define m68ki_remaining_cycles m68k_ICount - -/* Read data relative to the PC */ -#define m68k_read_pcrelative_8(address) M68KFetchByte(address) -#define m68k_read_pcrelative_16(address) M68KFetchWord(address) -#define m68k_read_pcrelative_32(address) M68KFetchLong(address) - -/* Read data immediately following the PC */ -#define m68k_read_immediate_16(address) M68KFetchWord(address) -#define m68k_read_immediate_32(address) M68KFetchLong(address) - -/* Memory access for the disassembler */ -#define m68k_read_disassembler_8(address) SekDbgFetchByteDisassembler(address) -#define m68k_read_disassembler_16(address) SekDbgFetchWordDisassembler(address) -#define m68k_read_disassembler_32(address) SekDbgFetchLongDisassembler(address) - -#if defined FBA_DEBUG -/* Read from anywhere */ -#define m68k_read_memory_8(address) M68KReadByteDebug(address) -#define m68k_read_memory_16(address) M68KReadWordDebug(address) -#define m68k_read_memory_32(address) M68KReadLongDebug(address) - -/* Write to anywhere */ -#define m68k_write_memory_8(address, value) M68KWriteByteDebug(address, value) -#define m68k_write_memory_16(address, value) M68KWriteWordDebug(address, value) -#define m68k_write_memory_32(address, value) M68KWriteLongDebug(address, value) -#else -/* Read from anywhere */ -#define m68k_read_memory_8(address) M68KReadByte(address) -#define m68k_read_memory_16(address) M68KReadWord(address) -#define m68k_read_memory_32(address) M68KReadLong(address) - -/* Write to anywhere */ -#define m68k_write_memory_8(address, value) M68KWriteByte(address, value) -#define m68k_write_memory_16(address, value) M68KWriteWord(address, value) -#define m68k_write_memory_32(address, value) M68KWriteLong(address, value) -#endif /* FBA_DEBUG */ - -#endif /* M68K_COMPILE_FOR_MAME */ - - -/* ======================================================================== */ -/* ============================== END OF FILE ============================= */ -/* ======================================================================== */ - -#endif /* M68KCONF__HEADER */ diff --git a/jan/src/cpu/m68k/m68kcpu.c b/jan/src/cpu/m68k/m68kcpu.c deleted file mode 100644 index 81673b814..000000000 --- a/jan/src/cpu/m68k/m68kcpu.c +++ /dev/null @@ -1,1059 +0,0 @@ -/* ======================================================================== */ -/* ========================= LICENSING & COPYRIGHT ======================== */ -/* ======================================================================== */ - -#if 1 -static const char copyright_notice[] = -"MUSASHI\n" -"Version 3.32 (2007-12-15)\n" -"A portable Motorola M680x0 processor emulation engine.\n" -"Copyright Karl Stenerud. All rights reserved.\n" -"\n" -"This code may be freely used for non-commercial purpooses as long as this\n" -"copyright notice remains unaltered in the source code and any binary files\n" -"containing this code in compiled form.\n" -"\n" -"All other licensing terms must be negotiated with the author\n" -"(Karl Stenerud).\n" -"\n" -"The latest version of this code can be obtained at:\n" -"http://kstenerud.cjb.net\n" -; -#endif - - -/* ======================================================================== */ -/* ================================= NOTES ================================ */ -/* ======================================================================== */ - - - -/* ======================================================================== */ -/* ================================ INCLUDES ============================== */ -/* ======================================================================== */ - -extern void m68040_fpu_op0(void); -extern void m68040_fpu_op1(void); - -#include "m68kops.h" -#include "m68kcpu.h" -#include "m68kfpu.c" - -/* ======================================================================== */ -/* ================================= DATA ================================= */ -/* ======================================================================== */ - -int m68ki_initial_cycles; -int m68ki_remaining_cycles = 0; /* Number of clocks remaining */ -uint m68ki_tracing = 0; -uint m68ki_address_space; - -#ifdef M68K_LOG_ENABLE -const char *const m68ki_cpu_names[] = -{ - "Invalid CPU", - "M68000", - "M68008", - "Invalid CPU", - "M68010", - "Invalid CPU", - "Invalid CPU", - "Invalid CPU", - "M68EC020", - "Invalid CPU", - "Invalid CPU", - "Invalid CPU", - "Invalid CPU", - "Invalid CPU", - "Invalid CPU", - "Invalid CPU", - "M68020" -}; -#endif /* M68K_LOG_ENABLE */ - -/* The CPU core */ -m68ki_cpu_core m68ki_cpu = {0}; - -#if M68K_EMULATE_ADDRESS_ERROR -jmp_buf m68ki_aerr_trap; -#endif /* M68K_EMULATE_ADDRESS_ERROR */ - -uint m68ki_aerr_address; -uint m68ki_aerr_write_mode; -uint m68ki_aerr_fc; - -/* Used by shift & rotate instructions */ -const uint8 m68ki_shift_8_table[65] = -{ - 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff -}; -const uint16 m68ki_shift_16_table[65] = -{ - 0x0000, 0x8000, 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, - 0xff80, 0xffc0, 0xffe0, 0xfff0, 0xfff8, 0xfffc, 0xfffe, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff -}; -const uint m68ki_shift_32_table[65] = -{ - 0x00000000, 0x80000000, 0xc0000000, 0xe0000000, 0xf0000000, 0xf8000000, - 0xfc000000, 0xfe000000, 0xff000000, 0xff800000, 0xffc00000, 0xffe00000, - 0xfff00000, 0xfff80000, 0xfffc0000, 0xfffe0000, 0xffff0000, 0xffff8000, - 0xffffc000, 0xffffe000, 0xfffff000, 0xfffff800, 0xfffffc00, 0xfffffe00, - 0xffffff00, 0xffffff80, 0xffffffc0, 0xffffffe0, 0xfffffff0, 0xfffffff8, - 0xfffffffc, 0xfffffffe, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff -}; - - -/* Number of clock cycles to use for exception processing. - * I used 4 for any vectors that are undocumented for processing times. - */ -const uint8 m68ki_exception_cycle_table[4][256] = -{ - { /* 000 */ - 4, /* 0: Reset - Initial Stack Pointer */ - 4, /* 1: Reset - Initial Program Counter */ - 50, /* 2: Bus Error (unemulated) */ - 50, /* 3: Address Error (unemulated) */ - 34, /* 4: Illegal Instruction */ - 38, /* 5: Divide by Zero -- ASG: changed from 42 */ - 40, /* 6: CHK -- ASG: chanaged from 44 */ - 34, /* 7: TRAPV */ - 34, /* 8: Privilege Violation */ - 34, /* 9: Trace */ - 4, /* 10: 1010 */ - 4, /* 11: 1111 */ - 4, /* 12: RESERVED */ - 4, /* 13: Coprocessor Protocol Violation (unemulated) */ - 4, /* 14: Format Error */ - 44, /* 15: Uninitialized Interrupt */ - 4, /* 16: RESERVED */ - 4, /* 17: RESERVED */ - 4, /* 18: RESERVED */ - 4, /* 19: RESERVED */ - 4, /* 20: RESERVED */ - 4, /* 21: RESERVED */ - 4, /* 22: RESERVED */ - 4, /* 23: RESERVED */ - 44, /* 24: Spurious Interrupt */ - 44, /* 25: Level 1 Interrupt Autovector */ - 44, /* 26: Level 2 Interrupt Autovector */ - 44, /* 27: Level 3 Interrupt Autovector */ - 44, /* 28: Level 4 Interrupt Autovector */ - 44, /* 29: Level 5 Interrupt Autovector */ - 44, /* 30: Level 6 Interrupt Autovector */ - 44, /* 31: Level 7 Interrupt Autovector */ - 34, /* 32: TRAP #0 -- ASG: chanaged from 38 */ - 34, /* 33: TRAP #1 */ - 34, /* 34: TRAP #2 */ - 34, /* 35: TRAP #3 */ - 34, /* 36: TRAP #4 */ - 34, /* 37: TRAP #5 */ - 34, /* 38: TRAP #6 */ - 34, /* 39: TRAP #7 */ - 34, /* 40: TRAP #8 */ - 34, /* 41: TRAP #9 */ - 34, /* 42: TRAP #10 */ - 34, /* 43: TRAP #11 */ - 34, /* 44: TRAP #12 */ - 34, /* 45: TRAP #13 */ - 34, /* 46: TRAP #14 */ - 34, /* 47: TRAP #15 */ - 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */ - 4, /* 49: FP Inexact Result (unemulated) */ - 4, /* 50: FP Divide by Zero (unemulated) */ - 4, /* 51: FP Underflow (unemulated) */ - 4, /* 52: FP Operand Error (unemulated) */ - 4, /* 53: FP Overflow (unemulated) */ - 4, /* 54: FP Signaling NAN (unemulated) */ - 4, /* 55: FP Unimplemented Data Type (unemulated) */ - 4, /* 56: MMU Configuration Error (unemulated) */ - 4, /* 57: MMU Illegal Operation Error (unemulated) */ - 4, /* 58: MMU Access Level Violation Error (unemulated) */ - 4, /* 59: RESERVED */ - 4, /* 60: RESERVED */ - 4, /* 61: RESERVED */ - 4, /* 62: RESERVED */ - 4, /* 63: RESERVED */ - /* 64-255: User Defined */ - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 - }, - { /* 010 */ - 4, /* 0: Reset - Initial Stack Pointer */ - 4, /* 1: Reset - Initial Program Counter */ - 126, /* 2: Bus Error (unemulated) */ - 126, /* 3: Address Error (unemulated) */ - 38, /* 4: Illegal Instruction */ - 44, /* 5: Divide by Zero */ - 44, /* 6: CHK */ - 34, /* 7: TRAPV */ - 38, /* 8: Privilege Violation */ - 38, /* 9: Trace */ - 4, /* 10: 1010 */ - 4, /* 11: 1111 */ - 4, /* 12: RESERVED */ - 4, /* 13: Coprocessor Protocol Violation (unemulated) */ - 4, /* 14: Format Error */ - 44, /* 15: Uninitialized Interrupt */ - 4, /* 16: RESERVED */ - 4, /* 17: RESERVED */ - 4, /* 18: RESERVED */ - 4, /* 19: RESERVED */ - 4, /* 20: RESERVED */ - 4, /* 21: RESERVED */ - 4, /* 22: RESERVED */ - 4, /* 23: RESERVED */ - 46, /* 24: Spurious Interrupt */ - 46, /* 25: Level 1 Interrupt Autovector */ - 46, /* 26: Level 2 Interrupt Autovector */ - 46, /* 27: Level 3 Interrupt Autovector */ - 46, /* 28: Level 4 Interrupt Autovector */ - 46, /* 29: Level 5 Interrupt Autovector */ - 46, /* 30: Level 6 Interrupt Autovector */ - 46, /* 31: Level 7 Interrupt Autovector */ - 38, /* 32: TRAP #0 */ - 38, /* 33: TRAP #1 */ - 38, /* 34: TRAP #2 */ - 38, /* 35: TRAP #3 */ - 38, /* 36: TRAP #4 */ - 38, /* 37: TRAP #5 */ - 38, /* 38: TRAP #6 */ - 38, /* 39: TRAP #7 */ - 38, /* 40: TRAP #8 */ - 38, /* 41: TRAP #9 */ - 38, /* 42: TRAP #10 */ - 38, /* 43: TRAP #11 */ - 38, /* 44: TRAP #12 */ - 38, /* 45: TRAP #13 */ - 38, /* 46: TRAP #14 */ - 38, /* 47: TRAP #15 */ - 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */ - 4, /* 49: FP Inexact Result (unemulated) */ - 4, /* 50: FP Divide by Zero (unemulated) */ - 4, /* 51: FP Underflow (unemulated) */ - 4, /* 52: FP Operand Error (unemulated) */ - 4, /* 53: FP Overflow (unemulated) */ - 4, /* 54: FP Signaling NAN (unemulated) */ - 4, /* 55: FP Unimplemented Data Type (unemulated) */ - 4, /* 56: MMU Configuration Error (unemulated) */ - 4, /* 57: MMU Illegal Operation Error (unemulated) */ - 4, /* 58: MMU Access Level Violation Error (unemulated) */ - 4, /* 59: RESERVED */ - 4, /* 60: RESERVED */ - 4, /* 61: RESERVED */ - 4, /* 62: RESERVED */ - 4, /* 63: RESERVED */ - /* 64-255: User Defined */ - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 - }, - { /* 020 */ - 4, /* 0: Reset - Initial Stack Pointer */ - 4, /* 1: Reset - Initial Program Counter */ - 50, /* 2: Bus Error (unemulated) */ - 50, /* 3: Address Error (unemulated) */ - 20, /* 4: Illegal Instruction */ - 38, /* 5: Divide by Zero */ - 40, /* 6: CHK */ - 20, /* 7: TRAPV */ - 34, /* 8: Privilege Violation */ - 25, /* 9: Trace */ - 20, /* 10: 1010 */ - 20, /* 11: 1111 */ - 4, /* 12: RESERVED */ - 4, /* 13: Coprocessor Protocol Violation (unemulated) */ - 4, /* 14: Format Error */ - 30, /* 15: Uninitialized Interrupt */ - 4, /* 16: RESERVED */ - 4, /* 17: RESERVED */ - 4, /* 18: RESERVED */ - 4, /* 19: RESERVED */ - 4, /* 20: RESERVED */ - 4, /* 21: RESERVED */ - 4, /* 22: RESERVED */ - 4, /* 23: RESERVED */ - 30, /* 24: Spurious Interrupt */ - 30, /* 25: Level 1 Interrupt Autovector */ - 30, /* 26: Level 2 Interrupt Autovector */ - 30, /* 27: Level 3 Interrupt Autovector */ - 30, /* 28: Level 4 Interrupt Autovector */ - 30, /* 29: Level 5 Interrupt Autovector */ - 30, /* 30: Level 6 Interrupt Autovector */ - 30, /* 31: Level 7 Interrupt Autovector */ - 20, /* 32: TRAP #0 */ - 20, /* 33: TRAP #1 */ - 20, /* 34: TRAP #2 */ - 20, /* 35: TRAP #3 */ - 20, /* 36: TRAP #4 */ - 20, /* 37: TRAP #5 */ - 20, /* 38: TRAP #6 */ - 20, /* 39: TRAP #7 */ - 20, /* 40: TRAP #8 */ - 20, /* 41: TRAP #9 */ - 20, /* 42: TRAP #10 */ - 20, /* 43: TRAP #11 */ - 20, /* 44: TRAP #12 */ - 20, /* 45: TRAP #13 */ - 20, /* 46: TRAP #14 */ - 20, /* 47: TRAP #15 */ - 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */ - 4, /* 49: FP Inexact Result (unemulated) */ - 4, /* 50: FP Divide by Zero (unemulated) */ - 4, /* 51: FP Underflow (unemulated) */ - 4, /* 52: FP Operand Error (unemulated) */ - 4, /* 53: FP Overflow (unemulated) */ - 4, /* 54: FP Signaling NAN (unemulated) */ - 4, /* 55: FP Unimplemented Data Type (unemulated) */ - 4, /* 56: MMU Configuration Error (unemulated) */ - 4, /* 57: MMU Illegal Operation Error (unemulated) */ - 4, /* 58: MMU Access Level Violation Error (unemulated) */ - 4, /* 59: RESERVED */ - 4, /* 60: RESERVED */ - 4, /* 61: RESERVED */ - 4, /* 62: RESERVED */ - 4, /* 63: RESERVED */ - /* 64-255: User Defined */ - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 - }, - { /* 040 */ // TODO: these values are not correct - 4, /* 0: Reset - Initial Stack Pointer */ - 4, /* 1: Reset - Initial Program Counter */ - 50, /* 2: Bus Error (unemulated) */ - 50, /* 3: Address Error (unemulated) */ - 20, /* 4: Illegal Instruction */ - 38, /* 5: Divide by Zero */ - 40, /* 6: CHK */ - 20, /* 7: TRAPV */ - 34, /* 8: Privilege Violation */ - 25, /* 9: Trace */ - 20, /* 10: 1010 */ - 20, /* 11: 1111 */ - 4, /* 12: RESERVED */ - 4, /* 13: Coprocessor Protocol Violation (unemulated) */ - 4, /* 14: Format Error */ - 30, /* 15: Uninitialized Interrupt */ - 4, /* 16: RESERVED */ - 4, /* 17: RESERVED */ - 4, /* 18: RESERVED */ - 4, /* 19: RESERVED */ - 4, /* 20: RESERVED */ - 4, /* 21: RESERVED */ - 4, /* 22: RESERVED */ - 4, /* 23: RESERVED */ - 30, /* 24: Spurious Interrupt */ - 30, /* 25: Level 1 Interrupt Autovector */ - 30, /* 26: Level 2 Interrupt Autovector */ - 30, /* 27: Level 3 Interrupt Autovector */ - 30, /* 28: Level 4 Interrupt Autovector */ - 30, /* 29: Level 5 Interrupt Autovector */ - 30, /* 30: Level 6 Interrupt Autovector */ - 30, /* 31: Level 7 Interrupt Autovector */ - 20, /* 32: TRAP #0 */ - 20, /* 33: TRAP #1 */ - 20, /* 34: TRAP #2 */ - 20, /* 35: TRAP #3 */ - 20, /* 36: TRAP #4 */ - 20, /* 37: TRAP #5 */ - 20, /* 38: TRAP #6 */ - 20, /* 39: TRAP #7 */ - 20, /* 40: TRAP #8 */ - 20, /* 41: TRAP #9 */ - 20, /* 42: TRAP #10 */ - 20, /* 43: TRAP #11 */ - 20, /* 44: TRAP #12 */ - 20, /* 45: TRAP #13 */ - 20, /* 46: TRAP #14 */ - 20, /* 47: TRAP #15 */ - 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */ - 4, /* 49: FP Inexact Result (unemulated) */ - 4, /* 50: FP Divide by Zero (unemulated) */ - 4, /* 51: FP Underflow (unemulated) */ - 4, /* 52: FP Operand Error (unemulated) */ - 4, /* 53: FP Overflow (unemulated) */ - 4, /* 54: FP Signaling NAN (unemulated) */ - 4, /* 55: FP Unimplemented Data Type (unemulated) */ - 4, /* 56: MMU Configuration Error (unemulated) */ - 4, /* 57: MMU Illegal Operation Error (unemulated) */ - 4, /* 58: MMU Access Level Violation Error (unemulated) */ - 4, /* 59: RESERVED */ - 4, /* 60: RESERVED */ - 4, /* 61: RESERVED */ - 4, /* 62: RESERVED */ - 4, /* 63: RESERVED */ - /* 64-255: User Defined */ - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 - } -}; - -const uint8 m68ki_ea_idx_cycle_table[64] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, /* ..01.000 no memory indirect, base NULL */ - 5, /* ..01..01 memory indirect, base NULL, outer NULL */ - 7, /* ..01..10 memory indirect, base NULL, outer 16 */ - 7, /* ..01..11 memory indirect, base NULL, outer 32 */ - 0, 5, 7, 7, 0, 5, 7, 7, 0, 5, 7, 7, - 2, /* ..10.000 no memory indirect, base 16 */ - 7, /* ..10..01 memory indirect, base 16, outer NULL */ - 9, /* ..10..10 memory indirect, base 16, outer 16 */ - 9, /* ..10..11 memory indirect, base 16, outer 32 */ - 0, 7, 9, 9, 0, 7, 9, 9, 0, 7, 9, 9, - 6, /* ..11.000 no memory indirect, base 32 */ - 11, /* ..11..01 memory indirect, base 32, outer NULL */ - 13, /* ..11..10 memory indirect, base 32, outer 16 */ - 13, /* ..11..11 memory indirect, base 32, outer 32 */ - 0, 11, 13, 13, 0, 11, 13, 13, 0, 11, 13, 13 -}; - - - -/* ======================================================================== */ -/* =============================== CALLBACKS ============================== */ -/* ======================================================================== */ - -/* Default callbacks used if the callback hasn't been set yet, or if the - * callback is set to NULL - */ - -/* Interrupt acknowledge */ -static int default_int_ack_callback_data; -static int default_int_ack_callback(int int_level) -{ - default_int_ack_callback_data = int_level; - CPU_INT_LEVEL = 0; - return M68K_INT_ACK_AUTOVECTOR; -} - -/* Breakpoint acknowledge */ -static unsigned int default_bkpt_ack_callback_data; -static void default_bkpt_ack_callback(unsigned int data) -{ - default_bkpt_ack_callback_data = data; -} - -/* Called when a reset instruction is executed */ -static void default_reset_instr_callback(void) -{ -} - -/* Called when a cmpi.l #v, dn instruction is executed */ -static void default_cmpild_instr_callback(unsigned int val, int reg) -{ -} - -/* Called when a rte instruction is executed */ -static void default_rte_instr_callback(void) -{ -} - -/* Called when a tas instruction is executed */ -static int default_tas_instr_callback(void) -{ - return 1; // allow writeback -} - -/* Called when the program counter changed by a large value */ -static unsigned int default_pc_changed_callback_data; -static void default_pc_changed_callback(unsigned int new_pc) -{ - default_pc_changed_callback_data = new_pc; -} - -/* Called every time there's bus activity (read/write to/from memory */ -static unsigned int default_set_fc_callback_data; -static void default_set_fc_callback(unsigned int new_fc) -{ - default_set_fc_callback_data = new_fc; -} - -/* Called every instruction cycle prior to execution */ -static void default_instr_hook_callback(unsigned int pc) -{ -} - - -#if M68K_EMULATE_ADDRESS_ERROR - #include - jmp_buf m68ki_aerr_trap; -#endif /* M68K_EMULATE_ADDRESS_ERROR */ - - -/* ======================================================================== */ -/* ================================= API ================================== */ -/* ======================================================================== */ - -/* Access the internals of the CPU */ -unsigned int m68k_get_reg(void* context, m68k_register_t regnum) -{ - m68ki_cpu_core* cpu = context != NULL ?(m68ki_cpu_core*)context : &m68ki_cpu; - - switch(regnum) - { - case M68K_REG_D0: return cpu->dar[0]; - case M68K_REG_D1: return cpu->dar[1]; - case M68K_REG_D2: return cpu->dar[2]; - case M68K_REG_D3: return cpu->dar[3]; - case M68K_REG_D4: return cpu->dar[4]; - case M68K_REG_D5: return cpu->dar[5]; - case M68K_REG_D6: return cpu->dar[6]; - case M68K_REG_D7: return cpu->dar[7]; - case M68K_REG_A0: return cpu->dar[8]; - case M68K_REG_A1: return cpu->dar[9]; - case M68K_REG_A2: return cpu->dar[10]; - case M68K_REG_A3: return cpu->dar[11]; - case M68K_REG_A4: return cpu->dar[12]; - case M68K_REG_A5: return cpu->dar[13]; - case M68K_REG_A6: return cpu->dar[14]; - case M68K_REG_A7: return cpu->dar[15]; - case M68K_REG_PC: return MASK_OUT_ABOVE_32(cpu->pc); - case M68K_REG_SR: return cpu->t1_flag | - cpu->t0_flag | - (cpu->s_flag << 11) | - (cpu->m_flag << 11) | - cpu->int_mask | - ((cpu->x_flag & XFLAG_SET) >> 4) | - ((cpu->n_flag & NFLAG_SET) >> 4) | - ((!cpu->not_z_flag) << 2) | - ((cpu->v_flag & VFLAG_SET) >> 6) | - ((cpu->c_flag & CFLAG_SET) >> 8); - case M68K_REG_SP: return cpu->dar[15]; - case M68K_REG_USP: return cpu->s_flag ? cpu->sp[0] : cpu->dar[15]; - case M68K_REG_ISP: return cpu->s_flag && !cpu->m_flag ? cpu->dar[15] : cpu->sp[4]; - case M68K_REG_MSP: return cpu->s_flag && cpu->m_flag ? cpu->dar[15] : cpu->sp[6]; - case M68K_REG_SFC: return cpu->sfc; - case M68K_REG_DFC: return cpu->dfc; - case M68K_REG_VBR: return cpu->vbr; - case M68K_REG_CACR: return cpu->cacr; - case M68K_REG_CAAR: return cpu->caar; - case M68K_REG_PREF_ADDR: return cpu->pref_addr; - case M68K_REG_PREF_DATA: return cpu->pref_data; - case M68K_REG_PPC: return MASK_OUT_ABOVE_32(cpu->ppc); - case M68K_REG_IR: return cpu->ir; - case M68K_REG_CPU_TYPE: - switch(cpu->cpu_type) - { - case CPU_TYPE_000: return (unsigned int)M68K_CPU_TYPE_68000; - case CPU_TYPE_008: return (unsigned int)M68K_CPU_TYPE_68008; - case CPU_TYPE_010: return (unsigned int)M68K_CPU_TYPE_68010; - case CPU_TYPE_EC020: return (unsigned int)M68K_CPU_TYPE_68EC020; - case CPU_TYPE_020: return (unsigned int)M68K_CPU_TYPE_68020; - case CPU_TYPE_040: return (unsigned int)M68K_CPU_TYPE_68040; - } - return M68K_CPU_TYPE_INVALID; - default: return 0; - } -} - -void m68k_set_reg(m68k_register_t regnum, unsigned int value) -{ - switch(regnum) - { - case M68K_REG_D0: REG_D[0] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_D1: REG_D[1] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_D2: REG_D[2] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_D3: REG_D[3] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_D4: REG_D[4] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_D5: REG_D[5] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_D6: REG_D[6] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_D7: REG_D[7] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_A0: REG_A[0] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_A1: REG_A[1] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_A2: REG_A[2] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_A3: REG_A[3] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_A4: REG_A[4] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_A5: REG_A[5] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_A6: REG_A[6] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_A7: REG_A[7] = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_PC: m68ki_jump(MASK_OUT_ABOVE_32(value)); return; - case M68K_REG_SR: m68ki_set_sr(value); return; - case M68K_REG_SP: REG_SP = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_USP: if(FLAG_S) - REG_USP = MASK_OUT_ABOVE_32(value); - else - REG_SP = MASK_OUT_ABOVE_32(value); - return; - case M68K_REG_ISP: if(FLAG_S && !FLAG_M) - REG_SP = MASK_OUT_ABOVE_32(value); - else - REG_ISP = MASK_OUT_ABOVE_32(value); - return; - case M68K_REG_MSP: if(FLAG_S && FLAG_M) - REG_SP = MASK_OUT_ABOVE_32(value); - else - REG_MSP = MASK_OUT_ABOVE_32(value); - return; - case M68K_REG_VBR: REG_VBR = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_SFC: REG_SFC = value & 7; return; - case M68K_REG_DFC: REG_DFC = value & 7; return; - case M68K_REG_CACR: REG_CACR = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_CAAR: REG_CAAR = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_PPC: REG_PPC = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_IR: REG_IR = MASK_OUT_ABOVE_16(value); return; - case M68K_REG_PREF_ADDR: CPU_PREF_ADDR = MASK_OUT_ABOVE_32(value); return; - case M68K_REG_CPU_TYPE: m68k_set_cpu_type(value); return; - default: return; - } -} - -/* Set the callbacks */ -void m68k_set_int_ack_callback(int (*callback)(int int_level)) -{ - CALLBACK_INT_ACK = callback ? callback : default_int_ack_callback; -} - -void m68k_set_bkpt_ack_callback(void (*callback)(unsigned int data)) -{ - CALLBACK_BKPT_ACK = callback ? callback : default_bkpt_ack_callback; -} - -void m68k_set_reset_instr_callback(void (*callback)(void)) -{ - CALLBACK_RESET_INSTR = callback ? callback : default_reset_instr_callback; -} - -void m68k_set_cmpild_instr_callback(void (*callback)(unsigned int, int)) -{ - CALLBACK_CMPILD_INSTR = callback ? callback : default_cmpild_instr_callback; -} - -void m68k_set_rte_instr_callback(void (*callback)(void)) -{ - CALLBACK_RTE_INSTR = callback ? callback : default_rte_instr_callback; -} - -void m68k_set_tas_instr_callback(int (*callback)(void)) -{ - CALLBACK_TAS_INSTR = callback ? callback : default_tas_instr_callback; -} - -void m68k_set_pc_changed_callback(void (*callback)(unsigned int new_pc)) -{ - CALLBACK_PC_CHANGED = callback ? callback : default_pc_changed_callback; -} - -void m68k_set_fc_callback(void (*callback)(unsigned int new_fc)) -{ - CALLBACK_SET_FC = callback ? callback : default_set_fc_callback; -} - -void m68k_set_instr_hook_callback(void (*callback)(unsigned int pc)) -{ - CALLBACK_INSTR_HOOK = callback ? callback : default_instr_hook_callback; -} - -#include -/* Set the CPU type. */ -void m68k_set_cpu_type(unsigned int cpu_type) -{ - switch(cpu_type) - { - case M68K_CPU_TYPE_68000: - CPU_TYPE = CPU_TYPE_000; - CPU_ADDRESS_MASK = 0x00ffffff; - CPU_SR_MASK = 0xa71f; /* T1 -- S -- -- I2 I1 I0 -- -- -- X N Z V C */ - CYC_INSTRUCTION = m68ki_cycles[0]; - CYC_EXCEPTION = m68ki_exception_cycle_table[0]; - CYC_BCC_NOTAKE_B = -2; - CYC_BCC_NOTAKE_W = 2; - CYC_DBCC_F_NOEXP = -2; - CYC_DBCC_F_EXP = 2; - CYC_SCC_R_TRUE = 2; - CYC_MOVEM_W = 2; - CYC_MOVEM_L = 3; - CYC_SHIFT = 1; - CYC_RESET = 132; - return; - case M68K_CPU_TYPE_68008: - CPU_TYPE = CPU_TYPE_008; - CPU_ADDRESS_MASK = 0x003fffff; - CPU_SR_MASK = 0xa71f; /* T1 -- S -- -- I2 I1 I0 -- -- -- X N Z V C */ - CYC_INSTRUCTION = m68ki_cycles[0]; - CYC_EXCEPTION = m68ki_exception_cycle_table[0]; - CYC_BCC_NOTAKE_B = -2; - CYC_BCC_NOTAKE_W = 2; - CYC_DBCC_F_NOEXP = -2; - CYC_DBCC_F_EXP = 2; - CYC_SCC_R_TRUE = 2; - CYC_MOVEM_W = 2; - CYC_MOVEM_L = 3; - CYC_SHIFT = 1; - CYC_RESET = 132; - return; - case M68K_CPU_TYPE_68010: - CPU_TYPE = CPU_TYPE_010; - CPU_ADDRESS_MASK = 0x00ffffff; - CPU_SR_MASK = 0xa71f; /* T1 -- S -- -- I2 I1 I0 -- -- -- X N Z V C */ - CYC_INSTRUCTION = m68ki_cycles[1]; - CYC_EXCEPTION = m68ki_exception_cycle_table[1]; - CYC_BCC_NOTAKE_B = -4; - CYC_BCC_NOTAKE_W = 0; - CYC_DBCC_F_NOEXP = 0; - CYC_DBCC_F_EXP = 6; - CYC_SCC_R_TRUE = 0; - CYC_MOVEM_W = 2; - CYC_MOVEM_L = 3; - CYC_SHIFT = 1; - CYC_RESET = 130; - return; - case M68K_CPU_TYPE_68EC020: - CPU_TYPE = CPU_TYPE_EC020; - CPU_ADDRESS_MASK = 0x00ffffff; - CPU_SR_MASK = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */ - CYC_INSTRUCTION = m68ki_cycles[2]; - CYC_EXCEPTION = m68ki_exception_cycle_table[2]; - CYC_BCC_NOTAKE_B = -2; - CYC_BCC_NOTAKE_W = 0; - CYC_DBCC_F_NOEXP = 0; - CYC_DBCC_F_EXP = 4; - CYC_SCC_R_TRUE = 0; - CYC_MOVEM_W = 2; - CYC_MOVEM_L = 2; - CYC_SHIFT = 0; - CYC_RESET = 518; - return; - case M68K_CPU_TYPE_68020: - CPU_TYPE = CPU_TYPE_020; - CPU_ADDRESS_MASK = 0xffffffff; - CPU_SR_MASK = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */ - CYC_INSTRUCTION = m68ki_cycles[2]; - CYC_EXCEPTION = m68ki_exception_cycle_table[2]; - CYC_BCC_NOTAKE_B = -2; - CYC_BCC_NOTAKE_W = 0; - CYC_DBCC_F_NOEXP = 0; - CYC_DBCC_F_EXP = 4; - CYC_SCC_R_TRUE = 0; - CYC_MOVEM_W = 2; - CYC_MOVEM_L = 2; - CYC_SHIFT = 0; - CYC_RESET = 518; - return; - case M68K_CPU_TYPE_68040: // TODO: these values are not correct - CPU_TYPE = CPU_TYPE_040; - CPU_ADDRESS_MASK = 0xffffffff; - CPU_SR_MASK = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */ - CYC_INSTRUCTION = m68ki_cycles[2]; - CYC_EXCEPTION = m68ki_exception_cycle_table[2]; - CYC_BCC_NOTAKE_B = -2; - CYC_BCC_NOTAKE_W = 0; - CYC_DBCC_F_NOEXP = 0; - CYC_DBCC_F_EXP = 4; - CYC_SCC_R_TRUE = 0; - CYC_MOVEM_W = 2; - CYC_MOVEM_L = 2; - CYC_SHIFT = 0; - CYC_RESET = 518; - return; - } -} - -int m68k_check_shouldinterrupt(void) -{ - return (CPU_INT_LEVEL > FLAG_INT_MASK); -} - -/* Execute some instructions until we use up num_cycles clock cycles */ -/* ASG: removed per-instruction interrupt checks */ -int m68k_execute(int num_cycles) -{ - if (m68ki_cpu.sleepuntilint) { - return num_cycles; - } - - /* Set our pool of clock cycles available */ - SET_CYCLES(num_cycles); - m68ki_initial_cycles = num_cycles; - - /* See if interrupts came in */ - m68ki_check_interrupts(); - - /* Make sure we're not stopped */ - if(!CPU_STOPPED) - { - /* Return point if we had an address error */ - m68ki_set_address_error_trap(); /* auto-disable (see m68kcpu.h) */ - - /* Main loop. Keep going until we run out of clock cycles */ - do - { - /* Set tracing accodring to T1. (T0 is done inside instruction) */ - m68ki_trace_t1(); /* auto-disable (see m68kcpu.h) */ - - /* Set the address space for reads */ - m68ki_use_data_space(); /* auto-disable (see m68kcpu.h) */ - - /* Call external hook to peek at CPU */ - m68ki_instr_hook(REG_PC); /* auto-disable (see m68kcpu.h) */ - - /* Record previous program counter */ - REG_PPC = REG_PC; - - /* Read an instruction and call its handler */ - REG_IR = m68ki_read_imm_16(); - m68ki_instruction_jump_table[REG_IR](); - USE_CYCLES(CYC_INSTRUCTION[REG_IR]); - - /* Trace m68k_exception, if necessary */ - m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */ - } while(GET_CYCLES() > 0); - - /* set previous PC to current PC for the next entry into the loop */ - REG_PPC = REG_PC; - } - else - SET_CYCLES(0); - - /* return how many clocks we used */ - return m68ki_initial_cycles - GET_CYCLES(); -} - - -int m68k_cycles_run(void) -{ - return m68ki_initial_cycles - GET_CYCLES(); -} - -int m68k_cycles_remaining(void) -{ - return GET_CYCLES(); -} - -/* Change the timeslice */ -void m68k_modify_timeslice(int cycles) -{ - m68ki_initial_cycles += cycles; - ADD_CYCLES(cycles); -} - - -void m68k_end_timeslice(void) -{ - m68ki_initial_cycles = GET_CYCLES(); - SET_CYCLES(0); -} - -void m68k_burn_until_irq(int enabled) -{ - m68ki_cpu.sleepuntilint = enabled; -} - -/* ASG: rewrote so that the int_level is a mask of the IPL0/IPL1/IPL2 bits */ -/* KS: Modified so that IPL* bits match with mask positions in the SR - * and cleaned out remenants of the interrupt controller. - */ -void m68k_set_irq(unsigned int int_level) -{ - uint old_level = CPU_INT_LEVEL; - CPU_INT_LEVEL = int_level << 8; - - /* A transition from < 7 to 7 always interrupts (NMI) */ - /* Note: Level 7 can also level trigger like a normal IRQ */ - if(old_level != 0x0700 && CPU_INT_LEVEL == 0x0700) - m68ki_cpu.nmi_pending = TRUE; - - m68ki_cpu.sleepuntilint = 0; -} - -void m68k_set_virq(unsigned int level, unsigned int active) -{ - uint state = m68ki_cpu.virq_state; - uint blevel; - - if(active) - state |= 1 << level; - else - state &= ~(1 << level); - m68ki_cpu.virq_state = state; - - for(blevel = 7; blevel > 0; blevel--) - if(state & (1 << blevel)) - break; - m68k_set_irq(blevel); -} - -unsigned int m68k_get_virq(unsigned int level) -{ - return (m68ki_cpu.virq_state & (1 << level)) ? 1 : 0; -} - -void m68k_init(void) -{ - static uint emulation_initialized = 0; - - /* The first call to this function initializes the opcode handler jump table */ - if(!emulation_initialized) - { - m68ki_build_opcode_table(); - emulation_initialized = 1; - } - - m68k_set_int_ack_callback(NULL); - m68k_set_bkpt_ack_callback(NULL); - m68k_set_reset_instr_callback(NULL); - m68k_set_cmpild_instr_callback(NULL); - m68k_set_rte_instr_callback(NULL); - m68k_set_tas_instr_callback(NULL); - m68k_set_pc_changed_callback(NULL); - m68k_set_fc_callback(NULL); - m68k_set_instr_hook_callback(NULL); -} - -/* Pulse the RESET line on the CPU */ -void m68k_pulse_reset(void) -{ - /* Clear all stop levels and eat up all remaining cycles */ - CPU_STOPPED = 0; - SET_CYCLES(0); - - CPU_RUN_MODE = RUN_MODE_BERR_AERR_RESET; - - /* Turn off tracing */ - FLAG_T1 = FLAG_T0 = 0; - m68ki_clear_trace(); - /* Interrupt mask to level 7 */ - FLAG_INT_MASK = 0x0700; - CPU_INT_LEVEL = 0; - m68ki_cpu.virq_state = 0; - /* Reset VBR */ - REG_VBR = 0; - /* Go to supervisor mode */ - m68ki_set_sm_flag(SFLAG_SET | MFLAG_CLEAR); - - /* Invalidate the prefetch queue */ -#if M68K_EMULATE_PREFETCH - /* Set to arbitrary number since our first fetch is from 0 */ - CPU_PREF_ADDR = 0x1000; -#endif /* M68K_EMULATE_PREFETCH */ - - /* Read the initial stack pointer and program counter */ - m68ki_jump(0); - REG_SP = m68ki_read_imm_32(); - REG_PC = m68ki_read_imm_32(); - m68ki_jump(REG_PC); - - CPU_RUN_MODE = RUN_MODE_NORMAL; -} - -/* Pulse the HALT line on the CPU */ -void m68k_pulse_halt(void) -{ - CPU_STOPPED |= STOP_LEVEL_HALT; -} - - -/* Get and set the current CPU context */ -/* This is to allow for multiple CPUs */ -unsigned int m68k_context_size() -{ - return sizeof(m68ki_cpu_core); -} - -/* Used to calculate the context size minus the system-specific pointers, for savestates */ -unsigned int m68k_context_size_no_pointers() -{ - return (int)&m68ki_cpu.pointer_block_divider - (int)&m68ki_cpu; -} - -unsigned int m68k_get_context(void* dst) -{ - if(dst) *(m68ki_cpu_core*)dst = m68ki_cpu; - return sizeof(m68ki_cpu_core); -} - -void m68k_set_context(void* src) -{ - if(src) m68ki_cpu = *(m68ki_cpu_core*)src; -} - - - -/* ======================================================================== */ -/* ============================== MAME STUFF ============================== */ -/* ======================================================================== */ - -#if M68K_COMPILE_FOR_MAME == OPT_ON - -#include "deprecat.h" - -static struct { - UINT16 sr; - UINT8 stopped; - UINT8 halted; -} m68k_substate; - -static void m68k_prepare_substate(running_machine *machine, void *param) -{ - m68k_substate.sr = m68ki_get_sr(); - m68k_substate.stopped = (CPU_STOPPED & STOP_LEVEL_STOP) != 0; - m68k_substate.halted = (CPU_STOPPED & STOP_LEVEL_HALT) != 0; -} - -static void m68k_post_load(running_machine *machine, void *param) -{ - m68ki_set_sr_noint_nosp(m68k_substate.sr); - CPU_STOPPED = m68k_substate.stopped ? STOP_LEVEL_STOP : 0 - | m68k_substate.halted ? STOP_LEVEL_HALT : 0; - m68ki_jump(REG_PC); -} - -void m68k_state_register(const char *type, int index) -{ - /* Note, D covers A because the dar array is common, REG_A=REG_D+8 */ - state_save_register_item_array(type, index, REG_D); - state_save_register_item(type, index, REG_PPC); - state_save_register_item(type, index, REG_PC); - state_save_register_item(type, index, REG_USP); - state_save_register_item(type, index, REG_ISP); - state_save_register_item(type, index, REG_MSP); - state_save_register_item(type, index, REG_VBR); - state_save_register_item(type, index, REG_SFC); - state_save_register_item(type, index, REG_DFC); - state_save_register_item(type, index, REG_CACR); - state_save_register_item(type, index, REG_CAAR); - state_save_register_item(type, index, m68k_substate.sr); - state_save_register_item(type, index, CPU_INT_LEVEL); - state_save_register_item(type, index, m68k_substate.stopped); - state_save_register_item(type, index, m68k_substate.halted); - state_save_register_item(type, index, CPU_PREF_ADDR); - state_save_register_item(type, index, CPU_PREF_DATA); - state_save_register_presave(Machine, m68k_prepare_substate, NULL); - state_save_register_postload(Machine, m68k_post_load, NULL); -} - -#endif /* M68K_COMPILE_FOR_MAME */ - -/* ======================================================================== */ -/* ============================== END OF FILE ============================= */ -/* ======================================================================== */ diff --git a/jan/src/cpu/m68k/m68kcpu.h b/jan/src/cpu/m68k/m68kcpu.h deleted file mode 100644 index 8666ee6d5..000000000 --- a/jan/src/cpu/m68k/m68kcpu.h +++ /dev/null @@ -1,2057 +0,0 @@ -#include -/* ======================================================================== */ -/* ========================= LICENSING & COPYRIGHT ======================== */ -/* ======================================================================== */ -/* - * MUSASHI - * Version 3.32 - * - * A portable Motorola M680x0 processor emulation engine. - * Copyright Karl Stenerud. All rights reserved. - * - * This code may be freely used for non-commercial purposes as long as this - * copyright notice remains unaltered in the source code and any binary files - * containing this code in compiled form. - * - * All other licensing terms must be negotiated with the author - * (Karl Stenerud). - * - * The latest version of this code can be obtained at: - * http://kstenerud.cjb.net - */ - - -#pragma once - -#ifndef M68KCPU__HEADER -#define M68KCPU__HEADER - -#include "m68k.h" -#include - -#if M68K_EMULATE_ADDRESS_ERROR -#include -#endif /* M68K_EMULATE_ADDRESS_ERROR */ - -/* ======================================================================== */ -/* ==================== ARCHITECTURE-DEPENDANT DEFINES ==================== */ -/* ======================================================================== */ - -/* Check for > 32bit sizes */ -#if UINT_MAX > 0xffffffff - #define M68K_INT_GT_32_BIT 1 -#else - #define M68K_INT_GT_32_BIT 0 -#endif - -/* Data types used in this emulation core */ -#undef sint8 -#undef sint16 -#undef sint32 -#undef sint64 -#undef uint8 -#undef uint16 -#undef uint32 -#undef uint64 -#undef sint -#undef uint - -#define sint8 signed char /* ASG: changed from char to signed char */ -#define sint16 signed short -#define sint32 signed int /* AWJ: changed from long to int */ -#define uint8 unsigned char -#define uint16 unsigned short -#define uint32 unsigned int /* AWJ: changed from long to int */ - -/* signed and unsigned int must be at least 32 bits wide */ -#define sint signed int -#define uint unsigned int - - -#if M68K_USE_64_BIT -#define sint64 signed long long -#define uint64 unsigned long long -#else -#define sint64 sint32 -#define uint64 uint32 -#endif /* M68K_USE_64_BIT */ - - - -/* Allow for architectures that don't have 8-bit sizes */ -#if UCHAR_MAX == 0xff - #define MAKE_INT_8(A) (sint8)(A) -#else - #undef sint8 - #define sint8 signed int - #undef uint8 - #define uint8 unsigned int - INLINE sint MAKE_INT_8(uint value) - { - return (value & 0x80) ? value | ~0xff : value & 0xff; - } -#endif /* UCHAR_MAX == 0xff */ - - -/* Allow for architectures that don't have 16-bit sizes */ -#if USHRT_MAX == 0xffff - #define MAKE_INT_16(A) (sint16)(A) -#else - #undef sint16 - #define sint16 signed int - #undef uint16 - #define uint16 unsigned int - INLINE sint MAKE_INT_16(uint value) - { - return (value & 0x8000) ? value | ~0xffff : value & 0xffff; - } -#endif /* USHRT_MAX == 0xffff */ - - -/* Allow for architectures that don't have 32-bit sizes */ -#if UINT_MAX == 0xffffffff - #define MAKE_INT_32(A) (sint32)(A) -#else - #undef sint32 - #define sint32 signed int - #undef uint32 - #define uint32 unsigned int - INLINE sint MAKE_INT_32(uint value) - { - return (value & 0x80000000) ? value | ~0xffffffff : value & 0xffffffff; - } -#endif /* UINT_MAX == 0xffffffff */ - - - - -/* ======================================================================== */ -/* ============================ GENERAL DEFINES =========================== */ -/* ======================================================================== */ - -/* Exception Vectors handled by emulation */ -#define EXCEPTION_BUS_ERROR 2 /* This one is not emulated! */ -#define EXCEPTION_ADDRESS_ERROR 3 /* This one is partially emulated (doesn't stack a proper frame yet) */ -#define EXCEPTION_ILLEGAL_INSTRUCTION 4 -#define EXCEPTION_ZERO_DIVIDE 5 -#define EXCEPTION_CHK 6 -#define EXCEPTION_TRAPV 7 -#define EXCEPTION_PRIVILEGE_VIOLATION 8 -#define EXCEPTION_TRACE 9 -#define EXCEPTION_1010 10 -#define EXCEPTION_1111 11 -#define EXCEPTION_FORMAT_ERROR 14 -#define EXCEPTION_UNINITIALIZED_INTERRUPT 15 -#define EXCEPTION_SPURIOUS_INTERRUPT 24 -#define EXCEPTION_INTERRUPT_AUTOVECTOR 24 -#define EXCEPTION_TRAP_BASE 32 - -/* Function codes set by CPU during data/address bus activity */ -#define FUNCTION_CODE_USER_DATA 1 -#define FUNCTION_CODE_USER_PROGRAM 2 -#define FUNCTION_CODE_SUPERVISOR_DATA 5 -#define FUNCTION_CODE_SUPERVISOR_PROGRAM 6 -#define FUNCTION_CODE_CPU_SPACE 7 - -/* CPU types for deciding what to emulate */ -#define CPU_TYPE_000 1 -#define CPU_TYPE_008 2 -#define CPU_TYPE_010 4 -#define CPU_TYPE_EC020 8 -#define CPU_TYPE_020 16 -#define CPU_TYPE_040 32 - -/* Different ways to stop the CPU */ -#define STOP_LEVEL_STOP 1 -#define STOP_LEVEL_HALT 2 - -/* Used for 68000 address error processing */ -#define INSTRUCTION_YES 0 -#define INSTRUCTION_NO 0x08 -#define MODE_READ 0x10 -#define MODE_WRITE 0 - -#define RUN_MODE_NORMAL 0 -#define RUN_MODE_BERR_AERR_RESET 1 - -#ifndef NULL -#define NULL ((void*)0) -#endif - -/* ======================================================================== */ -/* ================================ MACROS ================================ */ -/* ======================================================================== */ - - -/* ---------------------------- General Macros ---------------------------- */ - -/* Bit Isolation Macros */ -#define BIT_0(A) ((A) & 0x00000001) -#define BIT_1(A) ((A) & 0x00000002) -#define BIT_2(A) ((A) & 0x00000004) -#define BIT_3(A) ((A) & 0x00000008) -#define BIT_4(A) ((A) & 0x00000010) -#define BIT_5(A) ((A) & 0x00000020) -#define BIT_6(A) ((A) & 0x00000040) -#define BIT_7(A) ((A) & 0x00000080) -#define BIT_8(A) ((A) & 0x00000100) -#define BIT_9(A) ((A) & 0x00000200) -#define BIT_A(A) ((A) & 0x00000400) -#define BIT_B(A) ((A) & 0x00000800) -#define BIT_C(A) ((A) & 0x00001000) -#define BIT_D(A) ((A) & 0x00002000) -#define BIT_E(A) ((A) & 0x00004000) -#define BIT_F(A) ((A) & 0x00008000) -#define BIT_10(A) ((A) & 0x00010000) -#define BIT_11(A) ((A) & 0x00020000) -#define BIT_12(A) ((A) & 0x00040000) -#define BIT_13(A) ((A) & 0x00080000) -#define BIT_14(A) ((A) & 0x00100000) -#define BIT_15(A) ((A) & 0x00200000) -#define BIT_16(A) ((A) & 0x00400000) -#define BIT_17(A) ((A) & 0x00800000) -#define BIT_18(A) ((A) & 0x01000000) -#define BIT_19(A) ((A) & 0x02000000) -#define BIT_1A(A) ((A) & 0x04000000) -#define BIT_1B(A) ((A) & 0x08000000) -#define BIT_1C(A) ((A) & 0x10000000) -#define BIT_1D(A) ((A) & 0x20000000) -#define BIT_1E(A) ((A) & 0x40000000) -#define BIT_1F(A) ((A) & 0x80000000) - -/* Get the most significant bit for specific sizes */ -#define GET_MSB_8(A) ((A) & 0x80) -#define GET_MSB_9(A) ((A) & 0x100) -#define GET_MSB_16(A) ((A) & 0x8000) -#define GET_MSB_17(A) ((A) & 0x10000) -#define GET_MSB_32(A) ((A) & 0x80000000) -#if M68K_USE_64_BIT -#define GET_MSB_33(A) ((A) & 0x100000000) -#endif /* M68K_USE_64_BIT */ - -/* Isolate nibbles */ -#define LOW_NIBBLE(A) ((A) & 0x0f) -#define HIGH_NIBBLE(A) ((A) & 0xf0) - -/* These are used to isolate 8, 16, and 32 bit sizes */ -#define MASK_OUT_ABOVE_2(A) ((A) & 3) -#define MASK_OUT_ABOVE_8(A) ((A) & 0xff) -#define MASK_OUT_ABOVE_16(A) ((A) & 0xffff) -#define MASK_OUT_BELOW_2(A) ((A) & ~3) -#define MASK_OUT_BELOW_8(A) ((A) & ~0xff) -#define MASK_OUT_BELOW_16(A) ((A) & ~0xffff) - -/* No need to mask if we are 32 bit */ -#if M68K_INT_GT_32_BIT || M68K_USE_64_BIT - #define MASK_OUT_ABOVE_32(A) ((A) & 0xffffffff) - #define MASK_OUT_BELOW_32(A) ((A) & ~0xffffffff) -#else - #define MASK_OUT_ABOVE_32(A) (A) - #define MASK_OUT_BELOW_32(A) 0 -#endif /* M68K_INT_GT_32_BIT || M68K_USE_64_BIT */ - -/* Simulate address lines of 68k family */ -#define ADDRESS_68K(A) ((A)&CPU_ADDRESS_MASK) - - -/* Shift & Rotate Macros. */ -#define LSL(A, C) ((A) << (C)) -#define LSR(A, C) ((A) >> (C)) - -/* Some > 32-bit optimizations */ -#if M68K_INT_GT_32_BIT - /* Shift left and right */ - #define LSR_32(A, C) ((A) >> (C)) - #define LSL_32(A, C) ((A) << (C)) -#else - /* We have to do this because the morons at ANSI decided that shifts - * by >= data size are undefined. - */ - #define LSR_32(A, C) ((C) < 32 ? (A) >> (C) : 0) - #define LSL_32(A, C) ((C) < 32 ? (A) << (C) : 0) -#endif /* M68K_INT_GT_32_BIT */ - -#if M68K_USE_64_BIT - #define LSL_32_64(A, C) ((A) << (C)) - #define LSR_32_64(A, C) ((A) >> (C)) - #define ROL_33_64(A, C) (LSL_32_64(A, C) | LSR_32_64(A, 33-(C))) - #define ROR_33_64(A, C) (LSR_32_64(A, C) | LSL_32_64(A, 33-(C))) -#endif /* M68K_USE_64_BIT */ - -#define ROL_8(A, C) MASK_OUT_ABOVE_8(LSL(A, C) | LSR(A, 8-(C))) -#define ROL_9(A, C) (LSL(A, C) | LSR(A, 9-(C))) -#define ROL_16(A, C) MASK_OUT_ABOVE_16(LSL(A, C) | LSR(A, 16-(C))) -#define ROL_17(A, C) (LSL(A, C) | LSR(A, 17-(C))) -#define ROL_32(A, C) MASK_OUT_ABOVE_32(LSL_32(A, C) | LSR_32(A, 32-(C))) -#define ROL_33(A, C) (LSL_32(A, C) | LSR_32(A, 33-(C))) - -#define ROR_8(A, C) MASK_OUT_ABOVE_8(LSR(A, C) | LSL(A, 8-(C))) -#define ROR_9(A, C) (LSR(A, C) | LSL(A, 9-(C))) -#define ROR_16(A, C) MASK_OUT_ABOVE_16(LSR(A, C) | LSL(A, 16-(C))) -#define ROR_17(A, C) (LSR(A, C) | LSL(A, 17-(C))) -#define ROR_32(A, C) MASK_OUT_ABOVE_32(LSR_32(A, C) | LSL_32(A, 32-(C))) -#define ROR_33(A, C) (LSR_32(A, C) | LSL_32(A, 33-(C))) - - - -/* ------------------------------ CPU Access ------------------------------ */ - -/* Access the CPU registers */ -#define CPU_TYPE m68ki_cpu.cpu_type - -#define REG_DA m68ki_cpu.dar /* easy access to data and address regs */ -#define REG_D m68ki_cpu.dar -#define REG_A (m68ki_cpu.dar+8) -#define REG_PPC m68ki_cpu.ppc -#define REG_PC m68ki_cpu.pc -#define REG_SP_BASE m68ki_cpu.sp -#define REG_USP m68ki_cpu.sp[0] -#define REG_ISP m68ki_cpu.sp[4] -#define REG_MSP m68ki_cpu.sp[6] -#define REG_SP m68ki_cpu.dar[15] -#define REG_VBR m68ki_cpu.vbr -#define REG_SFC m68ki_cpu.sfc -#define REG_DFC m68ki_cpu.dfc -#define REG_CACR m68ki_cpu.cacr -#define REG_CAAR m68ki_cpu.caar -#define REG_IR m68ki_cpu.ir - -#define REG_FP m68ki_cpu.fpr -#define REG_FPCR m68ki_cpu.fpcr -#define REG_FPSR m68ki_cpu.fpsr -#define REG_FPIAR m68ki_cpu.fpiar - -#define FLAG_T1 m68ki_cpu.t1_flag -#define FLAG_T0 m68ki_cpu.t0_flag -#define FLAG_S m68ki_cpu.s_flag -#define FLAG_M m68ki_cpu.m_flag -#define FLAG_X m68ki_cpu.x_flag -#define FLAG_N m68ki_cpu.n_flag -#define FLAG_Z m68ki_cpu.not_z_flag -#define FLAG_V m68ki_cpu.v_flag -#define FLAG_C m68ki_cpu.c_flag -#define FLAG_INT_MASK m68ki_cpu.int_mask - -#define CPU_INT_LEVEL m68ki_cpu.int_level /* ASG: changed from CPU_INTS_PENDING */ -#define CPU_STOPPED m68ki_cpu.stopped -#define CPU_PREF_ADDR m68ki_cpu.pref_addr -#define CPU_PREF_DATA m68ki_cpu.pref_data -#define CPU_ADDRESS_MASK m68ki_cpu.address_mask -#define CPU_SR_MASK m68ki_cpu.sr_mask -#define CPU_INSTR_MODE m68ki_cpu.instr_mode -#define CPU_RUN_MODE m68ki_cpu.run_mode - -#define CYC_INSTRUCTION m68ki_cpu.cyc_instruction -#define CYC_EXCEPTION m68ki_cpu.cyc_exception -#define CYC_BCC_NOTAKE_B m68ki_cpu.cyc_bcc_notake_b -#define CYC_BCC_NOTAKE_W m68ki_cpu.cyc_bcc_notake_w -#define CYC_DBCC_F_NOEXP m68ki_cpu.cyc_dbcc_f_noexp -#define CYC_DBCC_F_EXP m68ki_cpu.cyc_dbcc_f_exp -#define CYC_SCC_R_TRUE m68ki_cpu.cyc_scc_r_true -#define CYC_MOVEM_W m68ki_cpu.cyc_movem_w -#define CYC_MOVEM_L m68ki_cpu.cyc_movem_l -#define CYC_SHIFT m68ki_cpu.cyc_shift -#define CYC_RESET m68ki_cpu.cyc_reset - - -#define CALLBACK_INT_ACK m68ki_cpu.int_ack_callback -#define CALLBACK_BKPT_ACK m68ki_cpu.bkpt_ack_callback -#define CALLBACK_RESET_INSTR m68ki_cpu.reset_instr_callback -#define CALLBACK_CMPILD_INSTR m68ki_cpu.cmpild_instr_callback -#define CALLBACK_RTE_INSTR m68ki_cpu.rte_instr_callback -#define CALLBACK_TAS_INSTR m68ki_cpu.tas_instr_callback -#define CALLBACK_PC_CHANGED m68ki_cpu.pc_changed_callback -#define CALLBACK_SET_FC m68ki_cpu.set_fc_callback -#define CALLBACK_INSTR_HOOK m68ki_cpu.instr_hook_callback - - - -/* ----------------------------- Configuration ---------------------------- */ - -/* These defines are dependant on the configuration defines in m68kconf.h */ - -/* Disable certain comparisons if we're not using all CPU types */ -#if M68K_EMULATE_040 - #define CPU_TYPE_IS_040_PLUS(A) ((A) & CPU_TYPE_040) - #define CPU_TYPE_IS_040_LESS(A) 1 -#else - #define CPU_TYPE_IS_040_PLUS(A) 0 - #define CPU_TYPE_IS_040_LESS(A) 1 -#endif - -#if M68K_EMULATE_020 - #define CPU_TYPE_IS_020_PLUS(A) ((A) & (CPU_TYPE_020 | CPU_TYPE_040)) - #define CPU_TYPE_IS_020_LESS(A) 1 -#else - #define CPU_TYPE_IS_020_PLUS(A) 0 - #define CPU_TYPE_IS_020_LESS(A) 1 -#endif - -#if M68K_EMULATE_EC020 - #define CPU_TYPE_IS_EC020_PLUS(A) ((A) & (CPU_TYPE_EC020 | CPU_TYPE_020 | CPU_TYPE_040)) - #define CPU_TYPE_IS_EC020_LESS(A) ((A) & (CPU_TYPE_000 | CPU_TYPE_008 | CPU_TYPE_010 | CPU_TYPE_EC020)) -#else - #define CPU_TYPE_IS_EC020_PLUS(A) CPU_TYPE_IS_020_PLUS(A) - #define CPU_TYPE_IS_EC020_LESS(A) CPU_TYPE_IS_020_LESS(A) -#endif - -#if M68K_EMULATE_010 - #define CPU_TYPE_IS_010(A) ((A) == CPU_TYPE_010) - #define CPU_TYPE_IS_010_PLUS(A) ((A) & (CPU_TYPE_010 | CPU_TYPE_EC020 | CPU_TYPE_020 | CPU_TYPE_040)) - #define CPU_TYPE_IS_010_LESS(A) ((A) & (CPU_TYPE_000 | CPU_TYPE_008 | CPU_TYPE_010)) -#else - #define CPU_TYPE_IS_010(A) 0 - #define CPU_TYPE_IS_010_PLUS(A) CPU_TYPE_IS_EC020_PLUS(A) - #define CPU_TYPE_IS_010_LESS(A) CPU_TYPE_IS_EC020_LESS(A) -#endif - -#if M68K_EMULATE_020 || M68K_EMULATE_EC020 - #define CPU_TYPE_IS_020_VARIANT(A) ((A) & (CPU_TYPE_EC020 | CPU_TYPE_020)) -#else - #define CPU_TYPE_IS_020_VARIANT(A) 0 -#endif - -#if M68K_EMULATE_040 || M68K_EMULATE_020 || M68K_EMULATE_EC020 || M68K_EMULATE_010 - #define CPU_TYPE_IS_000(A) ((A) == CPU_TYPE_000 || (A) == CPU_TYPE_008) -#else - #define CPU_TYPE_IS_000(A) 1 -#endif - - -#if !M68K_SEPARATE_READS -#define m68k_read_immediate_16(A) m68ki_read_program_16(A) -#define m68k_read_immediate_32(A) m68ki_read_program_32(A) - -#define m68k_read_pcrelative_8(A) m68ki_read_program_8(A) -#define m68k_read_pcrelative_16(A) m68ki_read_program_16(A) -#define m68k_read_pcrelative_32(A) m68ki_read_program_32(A) -#endif /* M68K_SEPARATE_READS */ - - -/* Enable or disable callback functions */ -#if M68K_EMULATE_INT_ACK - #if M68K_EMULATE_INT_ACK == OPT_SPECIFY_HANDLER - #define m68ki_int_ack(A) M68K_INT_ACK_CALLBACK(A) - #else - #define m68ki_int_ack(A) CALLBACK_INT_ACK(A) - #endif -#else - /* Default action is to used autovector mode, which is most common */ - #define m68ki_int_ack(A) M68K_INT_ACK_AUTOVECTOR -#endif /* M68K_EMULATE_INT_ACK */ - -#if M68K_EMULATE_BKPT_ACK - #if M68K_EMULATE_BKPT_ACK == OPT_SPECIFY_HANDLER - #define m68ki_bkpt_ack(A) M68K_BKPT_ACK_CALLBACK(A) - #else - #define m68ki_bkpt_ack(A) CALLBACK_BKPT_ACK(A) - #endif -#else - #define m68ki_bkpt_ack(A) -#endif /* M68K_EMULATE_BKPT_ACK */ - -#if M68K_EMULATE_RESET - #if M68K_EMULATE_RESET == OPT_SPECIFY_HANDLER - #define m68ki_output_reset() M68K_RESET_CALLBACK() - #else - #define m68ki_output_reset() CALLBACK_RESET_INSTR() - #endif -#else - #define m68ki_output_reset() -#endif /* M68K_EMULATE_RESET */ - -#if M68K_CMPILD_HAS_CALLBACK - #if M68K_CMPILD_HAS_CALLBACK == OPT_SPECIFY_HANDLER - #define m68ki_cmpild_callback(v,r) M68K_CMPILD_CALLBACK(v,r) - #else - #define m68ki_cmpild_callback(v,r) CALLBACK_CMPILD_INSTR(v,r) - #endif -#else - #define m68ki_cmpild_callback(v,r) -#endif /* M68K_CMPILD_HAS_CALLBACK */ - -#if M68K_RTE_HAS_CALLBACK - #if M68K_RTE_HAS_CALLBACK == OPT_SPECIFY_HANDLER - #define m68ki_rte_callback() M68K_RTE_CALLBACK() - #else - #define m68ki_rte_callback() CALLBACK_RTE_INSTR() - #endif -#else - #define m68ki_rte_callback() -#endif /* M68K_RTE_HAS_CALLBACK */ - -#if M68K_TAS_HAS_CALLBACK - #if M68K_TAS_HAS_CALLBACK == OPT_SPECIFY_HANDLER - #define m68ki_tas_callback() M68K_TAS_CALLBACK() - #else - #define m68ki_tas_callback() CALLBACK_TAS_INSTR() - #endif -#else - #define m68ki_tas_callback() -#endif /* M68K_TAS_HAS_CALLBACK */ - - -#if M68K_INSTRUCTION_HOOK - #if M68K_INSTRUCTION_HOOK == OPT_SPECIFY_HANDLER - #define m68ki_instr_hook(pc) M68K_INSTRUCTION_CALLBACK(pc) - #else - #define m68ki_instr_hook(pc) CALLBACK_INSTR_HOOK(pc) - #endif -#else - #define m68ki_instr_hook(pc) -#endif /* M68K_INSTRUCTION_HOOK */ - -#if M68K_MONITOR_PC - #if M68K_MONITOR_PC == OPT_SPECIFY_HANDLER - #define m68ki_pc_changed(A) M68K_SET_PC_CALLBACK(ADDRESS_68K(A)) - #else - #define m68ki_pc_changed(A) CALLBACK_PC_CHANGED(ADDRESS_68K(A)) - #endif -#else - #define m68ki_pc_changed(A) -#endif /* M68K_MONITOR_PC */ - - -/* Enable or disable function code emulation */ -#if M68K_EMULATE_FC - #if M68K_EMULATE_FC == OPT_SPECIFY_HANDLER - #define m68ki_set_fc(A) M68K_SET_FC_CALLBACK(A) - #else - #define m68ki_set_fc(A) CALLBACK_SET_FC(A) - #endif - #define m68ki_use_data_space() m68ki_address_space = FUNCTION_CODE_USER_DATA - #define m68ki_use_program_space() m68ki_address_space = FUNCTION_CODE_USER_PROGRAM - #define m68ki_get_address_space() m68ki_address_space -#else - #define m68ki_set_fc(A) - #define m68ki_use_data_space() - #define m68ki_use_program_space() - #define m68ki_get_address_space() FUNCTION_CODE_USER_DATA -#endif /* M68K_EMULATE_FC */ - - -/* Enable or disable trace emulation */ -#if M68K_EMULATE_TRACE - /* Initiates trace checking before each instruction (t1) */ - #define m68ki_trace_t1() m68ki_tracing = FLAG_T1 - /* adds t0 to trace checking if we encounter change of flow */ - #define m68ki_trace_t0() m68ki_tracing |= FLAG_T0 - /* Clear all tracing */ - #define m68ki_clear_trace() m68ki_tracing = 0 - /* Cause a trace exception if we are tracing */ - #define m68ki_exception_if_trace() if(m68ki_tracing) m68ki_exception_trace() -#else - #define m68ki_trace_t1() - #define m68ki_trace_t0() - #define m68ki_clear_trace() - #define m68ki_exception_if_trace() -#endif /* M68K_EMULATE_TRACE */ - - - -/* Address error */ -#if M68K_EMULATE_ADDRESS_ERROR - #include - extern jmp_buf m68ki_aerr_trap; - - #define m68ki_set_address_error_trap() \ - if(setjmp(m68ki_aerr_trap) != 0) \ - { \ - m68ki_exception_address_error(); \ - if(CPU_STOPPED) \ - { \ - SET_CYCLES(0); \ - return m68ki_initial_cycles; \ - } \ - } - - #define m68ki_check_address_error(ADDR, WRITE_MODE, FC) \ - if((ADDR)&1) \ - { \ - m68ki_aerr_address = ADDR; \ - m68ki_aerr_write_mode = WRITE_MODE; \ - m68ki_aerr_fc = FC; \ - longjmp(m68ki_aerr_trap, 1); \ - } - - #define m68ki_check_address_error_010_less(ADDR, WRITE_MODE, FC) \ - if (CPU_TYPE_IS_010_LESS(CPU_TYPE)) \ - { \ - m68ki_check_address_error(ADDR, WRITE_MODE, FC) \ - } -#else - #define m68ki_set_address_error_trap() - #define m68ki_check_address_error(ADDR, WRITE_MODE, FC) - #define m68ki_check_address_error_010_less(ADDR, WRITE_MODE, FC) -#endif /* M68K_ADDRESS_ERROR */ - -/* Logging */ -#if M68K_LOG_ENABLE - #include - extern FILE* M68K_LOG_FILEHANDLE - extern const char *const m68ki_cpu_names[]; - - #define M68K_DO_LOG(A) if(M68K_LOG_FILEHANDLE) fprintf A - #if M68K_LOG_1010_1111 - #define M68K_DO_LOG_EMU(A) if(M68K_LOG_FILEHANDLE) fprintf A - #else - #define M68K_DO_LOG_EMU(A) - #endif -#else - #define M68K_DO_LOG(A) - #define M68K_DO_LOG_EMU(A) -#endif - - - -/* -------------------------- EA / Operand Access ------------------------- */ - -/* - * The general instruction format follows this pattern: - * .... XXX. .... .YYY - * where XXX is register X and YYY is register Y - */ -/* Data Register Isolation */ -#define DX (REG_D[(REG_IR >> 9) & 7]) -#define DY (REG_D[REG_IR & 7]) -/* Address Register Isolation */ -#define AX (REG_A[(REG_IR >> 9) & 7]) -#define AY (REG_A[REG_IR & 7]) - - -/* Effective Address Calculations */ -#define EA_AY_AI_8() AY /* address register indirect */ -#define EA_AY_AI_16() EA_AY_AI_8() -#define EA_AY_AI_32() EA_AY_AI_8() -#define EA_AY_PI_8() (AY++) /* postincrement (size = byte) */ -#define EA_AY_PI_16() ((AY+=2)-2) /* postincrement (size = word) */ -#define EA_AY_PI_32() ((AY+=4)-4) /* postincrement (size = long) */ -#define EA_AY_PD_8() (--AY) /* predecrement (size = byte) */ -#define EA_AY_PD_16() (AY-=2) /* predecrement (size = word) */ -#define EA_AY_PD_32() (AY-=4) /* predecrement (size = long) */ -#define EA_AY_DI_8() (AY+MAKE_INT_16(m68ki_read_imm_16())) /* displacement */ -#define EA_AY_DI_16() EA_AY_DI_8() -#define EA_AY_DI_32() EA_AY_DI_8() -#define EA_AY_IX_8() m68ki_get_ea_ix(AY) /* indirect + index */ -#define EA_AY_IX_16() EA_AY_IX_8() -#define EA_AY_IX_32() EA_AY_IX_8() - -#define EA_AX_AI_8() AX -#define EA_AX_AI_16() EA_AX_AI_8() -#define EA_AX_AI_32() EA_AX_AI_8() -#define EA_AX_PI_8() (AX++) -#define EA_AX_PI_16() ((AX+=2)-2) -#define EA_AX_PI_32() ((AX+=4)-4) -#define EA_AX_PD_8() (--AX) -#define EA_AX_PD_16() (AX-=2) -#define EA_AX_PD_32() (AX-=4) -#define EA_AX_DI_8() (AX+MAKE_INT_16(m68ki_read_imm_16())) -#define EA_AX_DI_16() EA_AX_DI_8() -#define EA_AX_DI_32() EA_AX_DI_8() -#define EA_AX_IX_8() m68ki_get_ea_ix(AX) -#define EA_AX_IX_16() EA_AX_IX_8() -#define EA_AX_IX_32() EA_AX_IX_8() - -#define EA_A7_PI_8() ((REG_A[7]+=2)-2) -#define EA_A7_PD_8() (REG_A[7]-=2) - -#define EA_AW_8() MAKE_INT_16(m68ki_read_imm_16()) /* absolute word */ -#define EA_AW_16() EA_AW_8() -#define EA_AW_32() EA_AW_8() -#define EA_AL_8() m68ki_read_imm_32() /* absolute long */ -#define EA_AL_16() EA_AL_8() -#define EA_AL_32() EA_AL_8() -#define EA_PCDI_8() m68ki_get_ea_pcdi() /* pc indirect + displacement */ -#define EA_PCDI_16() EA_PCDI_8() -#define EA_PCDI_32() EA_PCDI_8() -#define EA_PCIX_8() m68ki_get_ea_pcix() /* pc indirect + index */ -#define EA_PCIX_16() EA_PCIX_8() -#define EA_PCIX_32() EA_PCIX_8() - - -#define OPER_I_8() m68ki_read_imm_8() -#define OPER_I_16() m68ki_read_imm_16() -#define OPER_I_32() m68ki_read_imm_32() - - - -/* --------------------------- Status Register ---------------------------- */ - -/* Flag Calculation Macros */ -#define CFLAG_8(A) (A) -#define CFLAG_16(A) ((A)>>8) - -#if M68K_INT_GT_32_BIT - #define CFLAG_ADD_32(S, D, R) ((R)>>24) - #define CFLAG_SUB_32(S, D, R) ((R)>>24) -#else - #define CFLAG_ADD_32(S, D, R) (((S & D) | (~R & (S | D)))>>23) - #define CFLAG_SUB_32(S, D, R) (((S & R) | (~D & (S | R)))>>23) -#endif /* M68K_INT_GT_32_BIT */ - -#define VFLAG_ADD_8(S, D, R) ((S^R) & (D^R)) -#define VFLAG_ADD_16(S, D, R) (((S^R) & (D^R))>>8) -#define VFLAG_ADD_32(S, D, R) (((S^R) & (D^R))>>24) - -#define VFLAG_SUB_8(S, D, R) ((S^D) & (R^D)) -#define VFLAG_SUB_16(S, D, R) (((S^D) & (R^D))>>8) -#define VFLAG_SUB_32(S, D, R) (((S^D) & (R^D))>>24) - -#define NFLAG_8(A) (A) -#define NFLAG_16(A) ((A)>>8) -#define NFLAG_32(A) ((A)>>24) -#define NFLAG_64(A) ((A)>>56) - -#define ZFLAG_8(A) MASK_OUT_ABOVE_8(A) -#define ZFLAG_16(A) MASK_OUT_ABOVE_16(A) -#define ZFLAG_32(A) MASK_OUT_ABOVE_32(A) - - -/* Flag values */ -#define NFLAG_SET 0x80 -#define NFLAG_CLEAR 0 -#define CFLAG_SET 0x100 -#define CFLAG_CLEAR 0 -#define XFLAG_SET 0x100 -#define XFLAG_CLEAR 0 -#define VFLAG_SET 0x80 -#define VFLAG_CLEAR 0 -#define ZFLAG_SET 0 -#define ZFLAG_CLEAR 0xffffffff - -#define SFLAG_SET 4 -#define SFLAG_CLEAR 0 -#define MFLAG_SET 2 -#define MFLAG_CLEAR 0 - -/* Turn flag values into 1 or 0 */ -#define XFLAG_AS_1() ((FLAG_X>>8)&1) -#define NFLAG_AS_1() ((FLAG_N>>7)&1) -#define VFLAG_AS_1() ((FLAG_V>>7)&1) -#define ZFLAG_AS_1() (!FLAG_Z) -#define CFLAG_AS_1() ((FLAG_C>>8)&1) - - -/* Conditions */ -#define COND_CS() (FLAG_C&0x100) -#define COND_CC() (!COND_CS()) -#define COND_VS() (FLAG_V&0x80) -#define COND_VC() (!COND_VS()) -#define COND_NE() FLAG_Z -#define COND_EQ() (!COND_NE()) -#define COND_MI() (FLAG_N&0x80) -#define COND_PL() (!COND_MI()) -#define COND_LT() ((FLAG_N^FLAG_V)&0x80) -#define COND_GE() (!COND_LT()) -#define COND_HI() (COND_CC() && COND_NE()) -#define COND_LS() (COND_CS() || COND_EQ()) -#define COND_GT() (COND_GE() && COND_NE()) -#define COND_LE() (COND_LT() || COND_EQ()) - -/* Reversed conditions */ -#define COND_NOT_CS() COND_CC() -#define COND_NOT_CC() COND_CS() -#define COND_NOT_VS() COND_VC() -#define COND_NOT_VC() COND_VS() -#define COND_NOT_NE() COND_EQ() -#define COND_NOT_EQ() COND_NE() -#define COND_NOT_MI() COND_PL() -#define COND_NOT_PL() COND_MI() -#define COND_NOT_LT() COND_GE() -#define COND_NOT_GE() COND_LT() -#define COND_NOT_HI() COND_LS() -#define COND_NOT_LS() COND_HI() -#define COND_NOT_GT() COND_LE() -#define COND_NOT_LE() COND_GT() - -/* Not real conditions, but here for convenience */ -#define COND_XS() (FLAG_X&0x100) -#define COND_XC() (!COND_XS) - - -/* Get the condition code register */ -#define m68ki_get_ccr() ((COND_XS() >> 4) | \ - (COND_MI() >> 4) | \ - (COND_EQ() << 2) | \ - (COND_VS() >> 6) | \ - (COND_CS() >> 8)) - -/* Get the status register */ -#define m68ki_get_sr() ( FLAG_T1 | \ - FLAG_T0 | \ - (FLAG_S << 11) | \ - (FLAG_M << 11) | \ - FLAG_INT_MASK | \ - m68ki_get_ccr()) - - - -/* ---------------------------- Cycle Counting ---------------------------- */ - -#define ADD_CYCLES(A) m68ki_remaining_cycles += (A) -#define USE_CYCLES(A) m68ki_remaining_cycles -= (A) -#define SET_CYCLES(A) m68ki_remaining_cycles = A -#define GET_CYCLES() m68ki_remaining_cycles -#define USE_ALL_CYCLES() m68ki_remaining_cycles = 0 - - - -/* ----------------------------- Read / Write ----------------------------- */ - -/* Read from the current address space */ -#define m68ki_read_8(A) m68ki_read_8_fc (A, FLAG_S | m68ki_get_address_space()) -#define m68ki_read_16(A) m68ki_read_16_fc(A, FLAG_S | m68ki_get_address_space()) -#define m68ki_read_32(A) m68ki_read_32_fc(A, FLAG_S | m68ki_get_address_space()) - -/* Write to the current data space */ -#define m68ki_write_8(A, V) m68ki_write_8_fc (A, FLAG_S | FUNCTION_CODE_USER_DATA, V) -#define m68ki_write_16(A, V) m68ki_write_16_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA, V) -#define m68ki_write_32(A, V) m68ki_write_32_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA, V) - -#if M68K_SIMULATE_PD_WRITES -#define m68ki_write_32_pd(A, V) m68ki_write_32_pd_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA, V) -#else -#define m68ki_write_32_pd(A, V) m68ki_write_32_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA, V) -#endif - -/* map read immediate 8 to read immediate 16 */ -#define m68ki_read_imm_8() MASK_OUT_ABOVE_8(m68ki_read_imm_16()) - -/* Map PC-relative reads */ -#define m68ki_read_pcrel_8(A) m68k_read_pcrelative_8(A) -#define m68ki_read_pcrel_16(A) m68k_read_pcrelative_16(A) -#define m68ki_read_pcrel_32(A) m68k_read_pcrelative_32(A) - -/* Read from the program space */ -#define m68ki_read_program_8(A) m68ki_read_8_fc(A, FLAG_S | FUNCTION_CODE_USER_PROGRAM) -#define m68ki_read_program_16(A) m68ki_read_16_fc(A, FLAG_S | FUNCTION_CODE_USER_PROGRAM) -#define m68ki_read_program_32(A) m68ki_read_32_fc(A, FLAG_S | FUNCTION_CODE_USER_PROGRAM) - -/* Read from the data space */ -#define m68ki_read_data_8(A) m68ki_read_8_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA) -#define m68ki_read_data_16(A) m68ki_read_16_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA) -#define m68ki_read_data_32(A) m68ki_read_32_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA) - - - -/* ======================================================================== */ -/* =============================== PROTOTYPES ============================= */ -/* ======================================================================== */ - -typedef union _fp_reg fp_reg; -union _fp_reg -{ - uint64 i; - double f; -}; - - -typedef struct _m68ki_cpu_core m68ki_cpu_core; -struct _m68ki_cpu_core -{ - uint cpu_type; /* CPU Type: 68000, 68008, 68010, 68EC020, or 68020 */ - uint dar[16]; /* Data and Address Registers */ - uint ppc; /* Previous program counter */ - uint pc; /* Program Counter */ - uint sp[7]; /* User, Interrupt, and Master Stack Pointers */ - uint vbr; /* Vector Base Register (m68010+) */ - uint sfc; /* Source Function Code Register (m68010+) */ - uint dfc; /* Destination Function Code Register (m68010+) */ - uint cacr; /* Cache Control Register (m68020, unemulated) */ - uint caar; /* Cache Address Register (m68020, unemulated) */ - uint ir; /* Instruction Register */ - fp_reg fpr[8]; /* FPU Data Register (m68040) */ - uint fpiar; /* FPU Instruction Address Register (m68040) */ - uint fpsr; /* FPU Status Register (m68040) */ - uint fpcr; /* FPU Control Register (m68040) */ - uint t1_flag; /* Trace 1 */ - uint t0_flag; /* Trace 0 */ - uint s_flag; /* Supervisor */ - uint m_flag; /* Master/Interrupt state */ - uint x_flag; /* Extend */ - uint n_flag; /* Negative */ - uint not_z_flag; /* Zero, inverted for speedups */ - uint v_flag; /* Overflow */ - uint c_flag; /* Carry */ - uint int_mask; /* I0-I2 */ - uint int_level; /* State of interrupt pins IPL0-IPL2 -- ASG: changed from ints_pending */ - uint stopped; /* Stopped state */ - uint pref_addr; /* Last prefetch address */ - uint pref_data; /* Data in the prefetch queue */ - uint address_mask; /* Available address pins */ - uint sr_mask; /* Implemented status register bits */ - uint instr_mode; /* Stores whether we are in instruction mode or group 0/1 exception mode */ - uint run_mode; /* Stores whether we are processing a reset, bus error, address error, or something else */ - - /* Clocks required for instructions / exceptions */ - uint cyc_bcc_notake_b; - uint cyc_bcc_notake_w; - uint cyc_dbcc_f_noexp; - uint cyc_dbcc_f_exp; - uint cyc_scc_r_true; - uint cyc_movem_w; - uint cyc_movem_l; - uint cyc_shift; - uint cyc_reset; - - /* Virtual IRQ lines state */ - uint virq_state; - uint nmi_pending; - - uint sleepuntilint; - - /* Designates the end of the CPU context variables and beginning of system-specific pointers */ - uint8 pointer_block_divider; /* Used to calculate the context-size for savestates */ - - const uint8* cyc_instruction; - const uint8* cyc_exception; - - /* Callbacks to host */ - int (*int_ack_callback)(int int_line); /* Interrupt Acknowledge */ - void (*bkpt_ack_callback)(unsigned int data); /* Breakpoint Acknowledge */ - void (*reset_instr_callback)(void); /* Called when a RESET instruction is encountered */ - void (*cmpild_instr_callback)(unsigned int, int); /* Called when a CMPI.L #v, Dn instruction is encountered */ - void (*rte_instr_callback)(void); /* Called when a RTE instruction is encountered */ - int (*tas_instr_callback)(void); /* Called when a TAS instruction is encountered, allows / disallows writeback */ - void (*pc_changed_callback)(unsigned int new_pc); /* Called when the PC changes by a large amount */ - void (*set_fc_callback)(unsigned int new_fc); /* Called when the CPU function code changes */ - void (*instr_hook_callback)(unsigned int pc); /* Called every instruction cycle prior to execution */ - -}; - - -extern m68ki_cpu_core m68ki_cpu; -extern sint m68ki_remaining_cycles; -extern uint m68ki_tracing; -extern const uint8 m68ki_shift_8_table[]; -extern const uint16 m68ki_shift_16_table[]; -extern const uint m68ki_shift_32_table[]; -extern const uint8 m68ki_exception_cycle_table[][256]; -extern uint m68ki_address_space; -extern const uint8 m68ki_ea_idx_cycle_table[]; - -extern uint m68ki_aerr_address; -extern uint m68ki_aerr_write_mode; -extern uint m68ki_aerr_fc; - -/* Read data immediately after the program counter */ -INLINE uint m68ki_read_imm_16(void); -INLINE uint m68ki_read_imm_32(void); - -/* Read data with specific function code */ -INLINE uint m68ki_read_8_fc (uint address, uint fc); -INLINE uint m68ki_read_16_fc (uint address, uint fc); -INLINE uint m68ki_read_32_fc (uint address, uint fc); - -/* Write data with specific function code */ -INLINE void m68ki_write_8_fc (uint address, uint fc, uint value); -INLINE void m68ki_write_16_fc(uint address, uint fc, uint value); -INLINE void m68ki_write_32_fc(uint address, uint fc, uint value); -#if M68K_SIMULATE_PD_WRITES -INLINE void m68ki_write_32_pd_fc(uint address, uint fc, uint value); -#endif /* M68K_SIMULATE_PD_WRITES */ - -/* Indexed and PC-relative ea fetching */ -INLINE uint m68ki_get_ea_pcdi(void); -INLINE uint m68ki_get_ea_pcix(void); -INLINE uint m68ki_get_ea_ix(uint An); - -/* Operand fetching */ -INLINE uint OPER_AY_AI_8(void); -INLINE uint OPER_AY_AI_16(void); -INLINE uint OPER_AY_AI_32(void); -INLINE uint OPER_AY_PI_8(void); -INLINE uint OPER_AY_PI_16(void); -INLINE uint OPER_AY_PI_32(void); -INLINE uint OPER_AY_PD_8(void); -INLINE uint OPER_AY_PD_16(void); -INLINE uint OPER_AY_PD_32(void); -INLINE uint OPER_AY_DI_8(void); -INLINE uint OPER_AY_DI_16(void); -INLINE uint OPER_AY_DI_32(void); -INLINE uint OPER_AY_IX_8(void); -INLINE uint OPER_AY_IX_16(void); -INLINE uint OPER_AY_IX_32(void); - -INLINE uint OPER_AX_AI_8(void); -INLINE uint OPER_AX_AI_16(void); -INLINE uint OPER_AX_AI_32(void); -INLINE uint OPER_AX_PI_8(void); -INLINE uint OPER_AX_PI_16(void); -INLINE uint OPER_AX_PI_32(void); -INLINE uint OPER_AX_PD_8(void); -INLINE uint OPER_AX_PD_16(void); -INLINE uint OPER_AX_PD_32(void); -INLINE uint OPER_AX_DI_8(void); -INLINE uint OPER_AX_DI_16(void); -INLINE uint OPER_AX_DI_32(void); -INLINE uint OPER_AX_IX_8(void); -INLINE uint OPER_AX_IX_16(void); -INLINE uint OPER_AX_IX_32(void); - -INLINE uint OPER_A7_PI_8(void); -INLINE uint OPER_A7_PD_8(void); - -INLINE uint OPER_AW_8(void); -INLINE uint OPER_AW_16(void); -INLINE uint OPER_AW_32(void); -INLINE uint OPER_AL_8(void); -INLINE uint OPER_AL_16(void); -INLINE uint OPER_AL_32(void); -INLINE uint OPER_PCDI_8(void); -INLINE uint OPER_PCDI_16(void); -INLINE uint OPER_PCDI_32(void); -INLINE uint OPER_PCIX_8(void); -INLINE uint OPER_PCIX_16(void); -INLINE uint OPER_PCIX_32(void); - -/* Stack operations */ -INLINE void m68ki_push_16(uint value); -INLINE void m68ki_push_32(uint value); -INLINE uint m68ki_pull_16(void); -INLINE uint m68ki_pull_32(void); - -/* Program flow operations */ -INLINE void m68ki_jump(uint new_pc); -INLINE void m68ki_jump_vector(uint vector); -INLINE void m68ki_branch_8(uint offset); -INLINE void m68ki_branch_16(uint offset); -INLINE void m68ki_branch_32(uint offset); - -/* Status register operations. */ -INLINE void m68ki_set_s_flag(uint value); /* Only bit 2 of value should be set (i.e. 4 or 0) */ -INLINE void m68ki_set_sm_flag(uint value); /* only bits 1 and 2 of value should be set */ -INLINE void m68ki_set_ccr(uint value); /* set the condition code register */ -INLINE void m68ki_set_sr(uint value); /* set the status register */ -INLINE void m68ki_set_sr_noint(uint value); /* set the status register */ - -/* Exception processing */ -INLINE uint m68ki_init_exception(void); /* Initial exception processing */ - -INLINE void m68ki_stack_frame_3word(uint pc, uint sr); /* Stack various frame types */ -INLINE void m68ki_stack_frame_buserr(uint sr); - -INLINE void m68ki_stack_frame_0000(uint pc, uint sr, uint vector); -INLINE void m68ki_stack_frame_0001(uint pc, uint sr, uint vector); -INLINE void m68ki_stack_frame_0010(uint sr, uint vector); -INLINE void m68ki_stack_frame_1000(uint pc, uint sr, uint vector); -INLINE void m68ki_stack_frame_1010(uint sr, uint vector, uint pc); -INLINE void m68ki_stack_frame_1011(uint sr, uint vector, uint pc); - -INLINE void m68ki_exception_trap(uint vector); -INLINE void m68ki_exception_trapN(uint vector); -INLINE void m68ki_exception_trace(void); -INLINE void m68ki_exception_privilege_violation(void); -INLINE void m68ki_exception_1010(void); -INLINE void m68ki_exception_1111(void); -INLINE void m68ki_exception_illegal(void); -INLINE void m68ki_exception_format_error(void); -INLINE void m68ki_exception_address_error(void); -INLINE void m68ki_exception_interrupt(uint int_level); -INLINE void m68ki_check_interrupts(void); /* ASG: check for interrupts */ - -/* quick disassembly (used for logging) */ -char* m68ki_disassemble_quick(unsigned int pc, unsigned int cpu_type); - - -/* ======================================================================== */ -/* =========================== UTILITY FUNCTIONS ========================== */ -/* ======================================================================== */ - - -/* ---------------------------- Read Immediate ---------------------------- */ - -/* Handles all immediate reads, does address error check, function code setting, - * and prefetching if they are enabled in m68kconf.h - */ -INLINE uint m68ki_read_imm_16(void) -{ - m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ - m68ki_check_address_error(REG_PC, MODE_READ, FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ -#if M68K_EMULATE_PREFETCH -{ - uint result; - if(REG_PC != CPU_PREF_ADDR) - { - CPU_PREF_ADDR = REG_PC; - CPU_PREF_DATA = m68k_read_immediate_16(ADDRESS_68K(CPU_PREF_ADDR)); - } - result = MASK_OUT_ABOVE_16(CPU_PREF_DATA); - REG_PC += 2; - CPU_PREF_ADDR = REG_PC; - CPU_PREF_DATA = m68k_read_immediate_16(ADDRESS_68K(CPU_PREF_ADDR)); - return result; -} -#else - REG_PC += 2; - return m68k_read_immediate_16(ADDRESS_68K(REG_PC-2)); -#endif /* M68K_EMULATE_PREFETCH */ -} -INLINE uint m68ki_read_imm_32(void) -{ -#if M68K_EMULATE_PREFETCH - uint temp_val; - - m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ - m68ki_check_address_error(REG_PC, MODE_READ, FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ - - if(REG_PC != CPU_PREF_ADDR) - { - CPU_PREF_ADDR = REG_PC; - CPU_PREF_DATA = m68k_read_immediate_16(ADDRESS_68K(CPU_PREF_ADDR)); - } - temp_val = MASK_OUT_ABOVE_16(CPU_PREF_DATA); - REG_PC += 2; - CPU_PREF_ADDR = REG_PC; - CPU_PREF_DATA = m68k_read_immediate_16(ADDRESS_68K(CPU_PREF_ADDR)); - - temp_val = MASK_OUT_ABOVE_32((temp_val << 16) | MASK_OUT_ABOVE_16(CPU_PREF_DATA)); - REG_PC += 2; - CPU_PREF_ADDR = REG_PC; - CPU_PREF_DATA = m68k_read_immediate_16(ADDRESS_68K(CPU_PREF_ADDR)); - - return temp_val; -#else - m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ - m68ki_check_address_error(REG_PC, MODE_READ, FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ - REG_PC += 4; - return m68k_read_immediate_32(ADDRESS_68K(REG_PC-4)); -#endif /* M68K_EMULATE_PREFETCH */ -} - - - -/* ------------------------- Top level read/write ------------------------- */ - -/* Handles all memory accesses (except for immediate reads if they are - * configured to use separate functions in m68kconf.h). - * All memory accesses must go through these top level functions. - * These functions will also check for address error and set the function - * code if they are enabled in m68kconf.h. - */ -INLINE uint m68ki_read_8_fc(uint address, uint fc) -{ - m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ - return m68k_read_memory_8(ADDRESS_68K(address)); -} -INLINE uint m68ki_read_16_fc(uint address, uint fc) -{ - m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ - m68ki_check_address_error_010_less(address, MODE_READ, fc); /* auto-disable (see m68kcpu.h) */ - return m68k_read_memory_16(ADDRESS_68K(address)); -} -INLINE uint m68ki_read_32_fc(uint address, uint fc) -{ - m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ - m68ki_check_address_error_010_less(address, MODE_READ, fc); /* auto-disable (see m68kcpu.h) */ - return m68k_read_memory_32(ADDRESS_68K(address)); -} - -INLINE void m68ki_write_8_fc(uint address, uint fc, uint value) -{ - m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ - m68k_write_memory_8(ADDRESS_68K(address), value); -} -INLINE void m68ki_write_16_fc(uint address, uint fc, uint value) -{ - m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ - m68ki_check_address_error_010_less(address, MODE_WRITE, fc); /* auto-disable (see m68kcpu.h) */ - m68k_write_memory_16(ADDRESS_68K(address), value); -} -INLINE void m68ki_write_32_fc(uint address, uint fc, uint value) -{ - m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ - m68ki_check_address_error_010_less(address, MODE_WRITE, fc); /* auto-disable (see m68kcpu.h) */ - m68k_write_memory_32(ADDRESS_68K(address), value); -} - -#if M68K_SIMULATE_PD_WRITES -INLINE void m68ki_write_32_pd_fc(uint address, uint fc, uint value) -{ - m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ - m68ki_check_address_error_010_less(address, MODE_WRITE, fc); /* auto-disable (see m68kcpu.h) */ - m68k_write_memory_32_pd(ADDRESS_68K(address), value); -} -#endif - - -/* --------------------- Effective Address Calculation -------------------- */ - -/* The program counter relative addressing modes cause operands to be - * retrieved from program space, not data space. - */ -INLINE uint m68ki_get_ea_pcdi(void) -{ - uint old_pc = REG_PC; - m68ki_use_program_space(); /* auto-disable */ - return old_pc + MAKE_INT_16(m68ki_read_imm_16()); -} - - -INLINE uint m68ki_get_ea_pcix(void) -{ - m68ki_use_program_space(); /* auto-disable */ - return m68ki_get_ea_ix(REG_PC); -} - -/* Indexed addressing modes are encoded as follows: - * - * Base instruction format: - * F E D C B A 9 8 7 6 | 5 4 3 | 2 1 0 - * x x x x x x x x x x | 1 1 0 | BASE REGISTER (An) - * - * Base instruction format for destination EA in move instructions: - * F E D C | B A 9 | 8 7 6 | 5 4 3 2 1 0 - * x x x x | BASE REG | 1 1 0 | X X X X X X (An) - * - * Brief extension format: - * F | E D C | B | A 9 | 8 | 7 6 5 4 3 2 1 0 - * D/A | REGISTER | W/L | SCALE | 0 | DISPLACEMENT - * - * Full extension format: - * F E D C B A 9 8 7 6 5 4 3 2 1 0 - * D/A | REGISTER | W/L | SCALE | 1 | BS | IS | BD SIZE | 0 | I/IS - * BASE DISPLACEMENT (0, 16, 32 bit) (bd) - * OUTER DISPLACEMENT (0, 16, 32 bit) (od) - * - * D/A: 0 = Dn, 1 = An (Xn) - * W/L: 0 = W (sign extend), 1 = L (.SIZE) - * SCALE: 00=1, 01=2, 10=4, 11=8 (*SCALE) - * BS: 0=add base reg, 1=suppress base reg (An suppressed) - * IS: 0=add index, 1=suppress index (Xn suppressed) - * BD SIZE: 00=reserved, 01=NULL, 10=Word, 11=Long (size of bd) - * - * IS I/IS Operation - * 0 000 No Memory Indirect - * 0 001 indir prex with null outer - * 0 010 indir prex with word outer - * 0 011 indir prex with long outer - * 0 100 reserved - * 0 101 indir postx with null outer - * 0 110 indir postx with word outer - * 0 111 indir postx with long outer - * 1 000 no memory indirect - * 1 001 mem indir with null outer - * 1 010 mem indir with word outer - * 1 011 mem indir with long outer - * 1 100-111 reserved - */ -INLINE uint m68ki_get_ea_ix(uint An) -{ - /* An = base register */ - uint extension = m68ki_read_imm_16(); - uint Xn = 0; /* Index register */ - uint bd = 0; /* Base Displacement */ - uint od = 0; /* Outer Displacement */ - - if(CPU_TYPE_IS_010_LESS(CPU_TYPE)) - { - /* Calculate index */ - Xn = REG_DA[extension>>12]; /* Xn */ - if(!BIT_B(extension)) /* W/L */ - Xn = MAKE_INT_16(Xn); - - /* Add base register and displacement and return */ - return An + Xn + MAKE_INT_8(extension); - } - - /* Brief extension format */ - if(!BIT_8(extension)) - { - /* Calculate index */ - Xn = REG_DA[extension>>12]; /* Xn */ - if(!BIT_B(extension)) /* W/L */ - Xn = MAKE_INT_16(Xn); - /* Add scale if proper CPU type */ - if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - Xn <<= (extension>>9) & 3; /* SCALE */ - - /* Add base register and displacement and return */ - return An + Xn + MAKE_INT_8(extension); - } - - /* Full extension format */ - - USE_CYCLES(m68ki_ea_idx_cycle_table[extension&0x3f]); - - /* Check if base register is present */ - if(BIT_7(extension)) /* BS */ - An = 0; /* An */ - - /* Check if index is present */ - if(!BIT_6(extension)) /* IS */ - { - Xn = REG_DA[extension>>12]; /* Xn */ - if(!BIT_B(extension)) /* W/L */ - Xn = MAKE_INT_16(Xn); - Xn <<= (extension>>9) & 3; /* SCALE */ - } - - /* Check if base displacement is present */ - if(BIT_5(extension)) /* BD SIZE */ - bd = BIT_4(extension) ? m68ki_read_imm_32() : MAKE_INT_16(m68ki_read_imm_16()); - - /* If no indirect action, we are done */ - if(!(extension&7)) /* No Memory Indirect */ - return An + bd + Xn; - - /* Check if outer displacement is present */ - if(BIT_1(extension)) /* I/IS: od */ - od = BIT_0(extension) ? m68ki_read_imm_32() : MAKE_INT_16(m68ki_read_imm_16()); - - /* Postindex */ - if(BIT_2(extension)) /* I/IS: 0 = preindex, 1 = postindex */ - return m68ki_read_32(An + bd) + Xn + od; - - /* Preindex */ - return m68ki_read_32(An + bd + Xn) + od; -} - - -/* Fetch operands */ -INLINE uint OPER_AY_AI_8(void) {uint ea = EA_AY_AI_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AY_AI_16(void) {uint ea = EA_AY_AI_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AY_AI_32(void) {uint ea = EA_AY_AI_32(); return m68ki_read_32(ea);} -INLINE uint OPER_AY_PI_8(void) {uint ea = EA_AY_PI_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AY_PI_16(void) {uint ea = EA_AY_PI_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AY_PI_32(void) {uint ea = EA_AY_PI_32(); return m68ki_read_32(ea);} -INLINE uint OPER_AY_PD_8(void) {uint ea = EA_AY_PD_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AY_PD_16(void) {uint ea = EA_AY_PD_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AY_PD_32(void) {uint ea = EA_AY_PD_32(); return m68ki_read_32(ea);} -INLINE uint OPER_AY_DI_8(void) {uint ea = EA_AY_DI_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AY_DI_16(void) {uint ea = EA_AY_DI_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AY_DI_32(void) {uint ea = EA_AY_DI_32(); return m68ki_read_32(ea);} -INLINE uint OPER_AY_IX_8(void) {uint ea = EA_AY_IX_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AY_IX_16(void) {uint ea = EA_AY_IX_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AY_IX_32(void) {uint ea = EA_AY_IX_32(); return m68ki_read_32(ea);} - -INLINE uint OPER_AX_AI_8(void) {uint ea = EA_AX_AI_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AX_AI_16(void) {uint ea = EA_AX_AI_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AX_AI_32(void) {uint ea = EA_AX_AI_32(); return m68ki_read_32(ea);} -INLINE uint OPER_AX_PI_8(void) {uint ea = EA_AX_PI_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AX_PI_16(void) {uint ea = EA_AX_PI_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AX_PI_32(void) {uint ea = EA_AX_PI_32(); return m68ki_read_32(ea);} -INLINE uint OPER_AX_PD_8(void) {uint ea = EA_AX_PD_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AX_PD_16(void) {uint ea = EA_AX_PD_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AX_PD_32(void) {uint ea = EA_AX_PD_32(); return m68ki_read_32(ea);} -INLINE uint OPER_AX_DI_8(void) {uint ea = EA_AX_DI_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AX_DI_16(void) {uint ea = EA_AX_DI_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AX_DI_32(void) {uint ea = EA_AX_DI_32(); return m68ki_read_32(ea);} -INLINE uint OPER_AX_IX_8(void) {uint ea = EA_AX_IX_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AX_IX_16(void) {uint ea = EA_AX_IX_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AX_IX_32(void) {uint ea = EA_AX_IX_32(); return m68ki_read_32(ea);} - -INLINE uint OPER_A7_PI_8(void) {uint ea = EA_A7_PI_8(); return m68ki_read_8(ea); } -INLINE uint OPER_A7_PD_8(void) {uint ea = EA_A7_PD_8(); return m68ki_read_8(ea); } - -INLINE uint OPER_AW_8(void) {uint ea = EA_AW_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AW_16(void) {uint ea = EA_AW_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AW_32(void) {uint ea = EA_AW_32(); return m68ki_read_32(ea);} -INLINE uint OPER_AL_8(void) {uint ea = EA_AL_8(); return m68ki_read_8(ea); } -INLINE uint OPER_AL_16(void) {uint ea = EA_AL_16(); return m68ki_read_16(ea);} -INLINE uint OPER_AL_32(void) {uint ea = EA_AL_32(); return m68ki_read_32(ea);} -INLINE uint OPER_PCDI_8(void) {uint ea = EA_PCDI_8(); return m68ki_read_pcrel_8(ea); } -INLINE uint OPER_PCDI_16(void) {uint ea = EA_PCDI_16(); return m68ki_read_pcrel_16(ea);} -INLINE uint OPER_PCDI_32(void) {uint ea = EA_PCDI_32(); return m68ki_read_pcrel_32(ea);} -INLINE uint OPER_PCIX_8(void) {uint ea = EA_PCIX_8(); return m68ki_read_pcrel_8(ea); } -INLINE uint OPER_PCIX_16(void) {uint ea = EA_PCIX_16(); return m68ki_read_pcrel_16(ea);} -INLINE uint OPER_PCIX_32(void) {uint ea = EA_PCIX_32(); return m68ki_read_pcrel_32(ea);} - - - -/* ---------------------------- Stack Functions --------------------------- */ - -/* Push/pull data from the stack */ -INLINE void m68ki_push_16(uint value) -{ - REG_SP = MASK_OUT_ABOVE_32(REG_SP - 2); - m68ki_write_16(REG_SP, value); -} - -INLINE void m68ki_push_32(uint value) -{ - REG_SP = MASK_OUT_ABOVE_32(REG_SP - 4); - m68ki_write_32(REG_SP, value); -} - -INLINE uint m68ki_pull_16(void) -{ - REG_SP = MASK_OUT_ABOVE_32(REG_SP + 2); - return m68ki_read_16(REG_SP-2); -} - -INLINE uint m68ki_pull_32(void) -{ - REG_SP = MASK_OUT_ABOVE_32(REG_SP + 4); - return m68ki_read_32(REG_SP-4); -} - - -/* Increment/decrement the stack as if doing a push/pull but - * don't do any memory access. - */ -INLINE void m68ki_fake_push_16(void) -{ - REG_SP = MASK_OUT_ABOVE_32(REG_SP - 2); -} - -INLINE void m68ki_fake_push_32(void) -{ - REG_SP = MASK_OUT_ABOVE_32(REG_SP - 4); -} - -INLINE void m68ki_fake_pull_16(void) -{ - REG_SP = MASK_OUT_ABOVE_32(REG_SP + 2); -} - -INLINE void m68ki_fake_pull_32(void) -{ - REG_SP = MASK_OUT_ABOVE_32(REG_SP + 4); -} - - -/* ----------------------------- Program Flow ----------------------------- */ - -/* Jump to a new program location or vector. - * These functions will also call the pc_changed callback if it was enabled - * in m68kconf.h. - */ -INLINE void m68ki_jump(uint new_pc) -{ - REG_PC = new_pc; - m68ki_pc_changed(REG_PC); -} - -INLINE void m68ki_jump_vector(uint vector) -{ - REG_PC = (vector<<2) + REG_VBR; - REG_PC = m68ki_read_data_32(REG_PC); - m68ki_pc_changed(REG_PC); -} - - -/* Branch to a new memory location. - * The 32-bit branch will call pc_changed if it was enabled in m68kconf.h. - * So far I've found no problems with not calling pc_changed for 8 or 16 - * bit branches. - */ -INLINE void m68ki_branch_8(uint offset) -{ - REG_PC += MAKE_INT_8(offset); -} - -INLINE void m68ki_branch_16(uint offset) -{ - REG_PC += MAKE_INT_16(offset); -} - -INLINE void m68ki_branch_32(uint offset) -{ - REG_PC += offset; - m68ki_pc_changed(REG_PC); -} - - - -/* ---------------------------- Status Register --------------------------- */ - -/* Set the S flag and change the active stack pointer. - * Note that value MUST be 4 or 0. - */ -INLINE void m68ki_set_s_flag(uint value) -{ - /* Backup the old stack pointer */ - REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)] = REG_SP; - /* Set the S flag */ - FLAG_S = value; - /* Set the new stack pointer */ - REG_SP = REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)]; -} - -/* Set the S and M flags and change the active stack pointer. - * Note that value MUST be 0, 2, 4, or 6 (bit2 = S, bit1 = M). - */ -INLINE void m68ki_set_sm_flag(uint value) -{ - /* Backup the old stack pointer */ - REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)] = REG_SP; - /* Set the S and M flags */ - FLAG_S = value & SFLAG_SET; - FLAG_M = value & MFLAG_SET; - /* Set the new stack pointer */ - REG_SP = REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)]; -} - -/* Set the S and M flags. Don't touch the stack pointer. */ -INLINE void m68ki_set_sm_flag_nosp(uint value) -{ - /* Set the S and M flags */ - FLAG_S = value & SFLAG_SET; - FLAG_M = value & MFLAG_SET; -} - - -/* Set the condition code register */ -INLINE void m68ki_set_ccr(uint value) -{ - FLAG_X = BIT_4(value) << 4; - FLAG_N = BIT_3(value) << 4; - FLAG_Z = !BIT_2(value); - FLAG_V = BIT_1(value) << 6; - FLAG_C = BIT_0(value) << 8; -} - -/* Set the status register but don't check for interrupts */ -INLINE void m68ki_set_sr_noint(uint value) -{ - /* Mask out the "unimplemented" bits */ - value &= CPU_SR_MASK; - - /* Now set the status register */ - FLAG_T1 = BIT_F(value); - FLAG_T0 = BIT_E(value); - FLAG_INT_MASK = value & 0x0700; - m68ki_set_ccr(value); - m68ki_set_sm_flag((value >> 11) & 6); -} - -/* Set the status register but don't check for interrupts nor - * change the stack pointer - */ -INLINE void m68ki_set_sr_noint_nosp(uint value) -{ - /* Mask out the "unimplemented" bits */ - value &= CPU_SR_MASK; - - /* Now set the status register */ - FLAG_T1 = BIT_F(value); - FLAG_T0 = BIT_E(value); - FLAG_INT_MASK = value & 0x0700; - m68ki_set_ccr(value); - m68ki_set_sm_flag_nosp((value >> 11) & 6); -} - -/* Set the status register and check for interrupts */ -INLINE void m68ki_set_sr(uint value) -{ - m68ki_set_sr_noint(value); - m68ki_check_interrupts(); -} - - -/* ------------------------- Exception Processing ------------------------- */ - -/* Initiate exception processing */ -INLINE uint m68ki_init_exception(void) -{ - /* Save the old status register */ - uint sr = m68ki_get_sr(); - - /* Turn off trace flag, clear pending traces */ - FLAG_T1 = FLAG_T0 = 0; - m68ki_clear_trace(); - /* Enter supervisor mode */ - m68ki_set_s_flag(SFLAG_SET); - - return sr; -} - -/* 3 word stack frame (68000 only) */ -INLINE void m68ki_stack_frame_3word(uint pc, uint sr) -{ - m68ki_push_32(pc); - m68ki_push_16(sr); -} - -/* Format 0 stack frame. - * This is the standard stack frame for 68010+. - */ -INLINE void m68ki_stack_frame_0000(uint pc, uint sr, uint vector) -{ - /* Stack a 3-word frame if we are 68000 */ - if(CPU_TYPE == CPU_TYPE_000 || CPU_TYPE == CPU_TYPE_008) - { - m68ki_stack_frame_3word(pc, sr); - return; - } - m68ki_push_16(vector<<2); - m68ki_push_32(pc); - m68ki_push_16(sr); -} - -/* Format 1 stack frame (68020). - * For 68020, this is the 4 word throwaway frame. - */ -INLINE void m68ki_stack_frame_0001(uint pc, uint sr, uint vector) -{ - m68ki_push_16(0x1000 | (vector<<2)); - m68ki_push_32(pc); - m68ki_push_16(sr); -} - -/* Format 2 stack frame. - * This is used only by 68020 for trap exceptions. - */ -INLINE void m68ki_stack_frame_0010(uint sr, uint vector) -{ - m68ki_push_32(REG_PPC); - m68ki_push_16(0x2000 | (vector<<2)); - m68ki_push_32(REG_PC); - m68ki_push_16(sr); -} - - -/* Bus error stack frame (68000 only). - */ -INLINE void m68ki_stack_frame_buserr(uint sr) -{ - m68ki_push_32(REG_PC); - m68ki_push_16(sr); - m68ki_push_16(REG_IR); - m68ki_push_32(m68ki_aerr_address); /* access address */ - /* 0 0 0 0 0 0 0 0 0 0 0 R/W I/N FC - * R/W 0 = write, 1 = read - * I/N 0 = instruction, 1 = not - * FC 3-bit function code - */ - m68ki_push_16(m68ki_aerr_write_mode | CPU_INSTR_MODE | m68ki_aerr_fc); -} - -/* Format 8 stack frame (68010). - * 68010 only. This is the 29 word bus/address error frame. - */ -void m68ki_stack_frame_1000(uint pc, uint sr, uint vector) -{ - /* VERSION - * NUMBER - * INTERNAL INFORMATION, 16 WORDS - */ - m68ki_fake_push_32(); - m68ki_fake_push_32(); - m68ki_fake_push_32(); - m68ki_fake_push_32(); - m68ki_fake_push_32(); - m68ki_fake_push_32(); - m68ki_fake_push_32(); - m68ki_fake_push_32(); - - /* INSTRUCTION INPUT BUFFER */ - m68ki_push_16(0); - - /* UNUSED, RESERVED (not written) */ - m68ki_fake_push_16(); - - /* DATA INPUT BUFFER */ - m68ki_push_16(0); - - /* UNUSED, RESERVED (not written) */ - m68ki_fake_push_16(); - - /* DATA OUTPUT BUFFER */ - m68ki_push_16(0); - - /* UNUSED, RESERVED (not written) */ - m68ki_fake_push_16(); - - /* FAULT ADDRESS */ - m68ki_push_32(0); - - /* SPECIAL STATUS WORD */ - m68ki_push_16(0); - - /* 1000, VECTOR OFFSET */ - m68ki_push_16(0x8000 | (vector<<2)); - - /* PROGRAM COUNTER */ - m68ki_push_32(pc); - - /* STATUS REGISTER */ - m68ki_push_16(sr); -} - -/* Format A stack frame (short bus fault). - * This is used only by 68020 for bus fault and address error - * if the error happens at an instruction boundary. - * PC stacked is address of next instruction. - */ -void m68ki_stack_frame_1010(uint sr, uint vector, uint pc) -{ - /* INTERNAL REGISTER */ - m68ki_push_16(0); - - /* INTERNAL REGISTER */ - m68ki_push_16(0); - - /* DATA OUTPUT BUFFER (2 words) */ - m68ki_push_32(0); - - /* INTERNAL REGISTER */ - m68ki_push_16(0); - - /* INTERNAL REGISTER */ - m68ki_push_16(0); - - /* DATA CYCLE FAULT ADDRESS (2 words) */ - m68ki_push_32(0); - - /* INSTRUCTION PIPE STAGE B */ - m68ki_push_16(0); - - /* INSTRUCTION PIPE STAGE C */ - m68ki_push_16(0); - - /* SPECIAL STATUS REGISTER */ - m68ki_push_16(0); - - /* INTERNAL REGISTER */ - m68ki_push_16(0); - - /* 1010, VECTOR OFFSET */ - m68ki_push_16(0xa000 | (vector<<2)); - - /* PROGRAM COUNTER */ - m68ki_push_32(pc); - - /* STATUS REGISTER */ - m68ki_push_16(sr); -} - -/* Format B stack frame (long bus fault). - * This is used only by 68020 for bus fault and address error - * if the error happens during instruction execution. - * PC stacked is address of instruction in progress. - */ -void m68ki_stack_frame_1011(uint sr, uint vector, uint pc) -{ - /* INTERNAL REGISTERS (18 words) */ - m68ki_push_32(0); - m68ki_push_32(0); - m68ki_push_32(0); - m68ki_push_32(0); - m68ki_push_32(0); - m68ki_push_32(0); - m68ki_push_32(0); - m68ki_push_32(0); - m68ki_push_32(0); - - /* VERSION# (4 bits), INTERNAL INFORMATION */ - m68ki_push_16(0); - - /* INTERNAL REGISTERS (3 words) */ - m68ki_push_32(0); - m68ki_push_16(0); - - /* DATA INTPUT BUFFER (2 words) */ - m68ki_push_32(0); - - /* INTERNAL REGISTERS (2 words) */ - m68ki_push_32(0); - - /* STAGE B ADDRESS (2 words) */ - m68ki_push_32(0); - - /* INTERNAL REGISTER (4 words) */ - m68ki_push_32(0); - m68ki_push_32(0); - - /* DATA OUTPUT BUFFER (2 words) */ - m68ki_push_32(0); - - /* INTERNAL REGISTER */ - m68ki_push_16(0); - - /* INTERNAL REGISTER */ - m68ki_push_16(0); - - /* DATA CYCLE FAULT ADDRESS (2 words) */ - m68ki_push_32(0); - - /* INSTRUCTION PIPE STAGE B */ - m68ki_push_16(0); - - /* INSTRUCTION PIPE STAGE C */ - m68ki_push_16(0); - - /* SPECIAL STATUS REGISTER */ - m68ki_push_16(0); - - /* INTERNAL REGISTER */ - m68ki_push_16(0); - - /* 1011, VECTOR OFFSET */ - m68ki_push_16(0xb000 | (vector<<2)); - - /* PROGRAM COUNTER */ - m68ki_push_32(pc); - - /* STATUS REGISTER */ - m68ki_push_16(sr); -} - - -/* Used for Group 2 exceptions. - * These stack a type 2 frame on the 020. - */ -INLINE void m68ki_exception_trap(uint vector) -{ - uint sr = m68ki_init_exception(); - - if(CPU_TYPE_IS_010_LESS(CPU_TYPE)) - m68ki_stack_frame_0000(REG_PC, sr, vector); - else - m68ki_stack_frame_0010(sr, vector); - - m68ki_jump_vector(vector); - - /* Use up some clock cycles */ - USE_CYCLES(CYC_EXCEPTION[vector]); -} - -/* Trap#n stacks a 0 frame but behaves like group2 otherwise */ -INLINE void m68ki_exception_trapN(uint vector) -{ - uint sr = m68ki_init_exception(); - m68ki_stack_frame_0000(REG_PC, sr, vector); - m68ki_jump_vector(vector); - - /* Use up some clock cycles */ - USE_CYCLES(CYC_EXCEPTION[vector]); -} - -/* Exception for trace mode */ -INLINE void m68ki_exception_trace(void) -{ - uint sr = m68ki_init_exception(); - - if(CPU_TYPE_IS_010_LESS(CPU_TYPE)) - { - #if M68K_EMULATE_ADDRESS_ERROR == OPT_ON - if(CPU_TYPE_IS_000(CPU_TYPE)) - { - CPU_INSTR_MODE = INSTRUCTION_NO; - } - #endif /* M68K_EMULATE_ADDRESS_ERROR */ - m68ki_stack_frame_0000(REG_PC, sr, EXCEPTION_TRACE); - } - else - m68ki_stack_frame_0010(sr, EXCEPTION_TRACE); - - m68ki_jump_vector(EXCEPTION_TRACE); - - /* Trace nullifies a STOP instruction */ - CPU_STOPPED &= ~STOP_LEVEL_STOP; - - /* Use up some clock cycles */ - USE_CYCLES(CYC_EXCEPTION[EXCEPTION_TRACE]); -} - -/* Exception for privilege violation */ -INLINE void m68ki_exception_privilege_violation(void) -{ - uint sr = m68ki_init_exception(); - - #if M68K_EMULATE_ADDRESS_ERROR == OPT_ON - if(CPU_TYPE_IS_000(CPU_TYPE)) - { - CPU_INSTR_MODE = INSTRUCTION_NO; - } - #endif /* M68K_EMULATE_ADDRESS_ERROR */ - - m68ki_stack_frame_0000(REG_PPC, sr, EXCEPTION_PRIVILEGE_VIOLATION); - m68ki_jump_vector(EXCEPTION_PRIVILEGE_VIOLATION); - - /* Use up some clock cycles and undo the instruction's cycles */ - USE_CYCLES(CYC_EXCEPTION[EXCEPTION_PRIVILEGE_VIOLATION] - CYC_INSTRUCTION[REG_IR]); -} - -/* Exception for A-Line instructions */ -INLINE void m68ki_exception_1010(void) -{ - uint sr; -#if M68K_LOG_1010_1111 == OPT_ON - M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: called 1010 instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PPC), REG_IR, - m68ki_disassemble_quick(ADDRESS_68K(REG_PPC)))); -#endif - - sr = m68ki_init_exception(); - m68ki_stack_frame_0000(REG_PPC, sr, EXCEPTION_1010); - m68ki_jump_vector(EXCEPTION_1010); - - /* Use up some clock cycles and undo the instruction's cycles */ - USE_CYCLES(CYC_EXCEPTION[EXCEPTION_1010] - CYC_INSTRUCTION[REG_IR]); -} - -/* Exception for F-Line instructions */ -INLINE void m68ki_exception_1111(void) -{ - uint sr; - -#if M68K_LOG_1010_1111 == OPT_ON - M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: called 1111 instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PPC), REG_IR, - m68ki_disassemble_quick(ADDRESS_68K(REG_PPC)))); -#endif - - sr = m68ki_init_exception(); - m68ki_stack_frame_0000(REG_PPC, sr, EXCEPTION_1111); - m68ki_jump_vector(EXCEPTION_1111); - - /* Use up some clock cycles and undo the instruction's cycles */ - USE_CYCLES(CYC_EXCEPTION[EXCEPTION_1111] - CYC_INSTRUCTION[REG_IR]); -} - -/* Exception for illegal instructions */ -INLINE void m68ki_exception_illegal(void) -{ - uint sr; - - M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: illegal instruction %04x (%s)\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PPC), REG_IR, - m68ki_disassemble_quick(ADDRESS_68K(REG_PPC)))); - - sr = m68ki_init_exception(); - - #if M68K_EMULATE_ADDRESS_ERROR == OPT_ON - if(CPU_TYPE_IS_000(CPU_TYPE)) - { - CPU_INSTR_MODE = INSTRUCTION_NO; - } - #endif /* M68K_EMULATE_ADDRESS_ERROR */ - - m68ki_stack_frame_0000(REG_PPC, sr, EXCEPTION_ILLEGAL_INSTRUCTION); - m68ki_jump_vector(EXCEPTION_ILLEGAL_INSTRUCTION); - - /* Use up some clock cycles and undo the instruction's cycles */ - USE_CYCLES(CYC_EXCEPTION[EXCEPTION_ILLEGAL_INSTRUCTION] - CYC_INSTRUCTION[REG_IR]); -} - -/* Exception for format errror in RTE */ -INLINE void m68ki_exception_format_error(void) -{ - uint sr = m68ki_init_exception(); - m68ki_stack_frame_0000(REG_PC, sr, EXCEPTION_FORMAT_ERROR); - m68ki_jump_vector(EXCEPTION_FORMAT_ERROR); - - /* Use up some clock cycles and undo the instruction's cycles */ - USE_CYCLES(CYC_EXCEPTION[EXCEPTION_FORMAT_ERROR] - CYC_INSTRUCTION[REG_IR]); -} - -/* Exception for address error */ -INLINE void m68ki_exception_address_error(void) -{ - uint sr = m68ki_init_exception(); - - /* If we were processing a bus error, address error, or reset, - * this is a catastrophic failure. - * Halt the CPU - */ - if(CPU_RUN_MODE == RUN_MODE_BERR_AERR_RESET) - { - m68k_read_memory_8(0x00ffff01); - CPU_STOPPED = STOP_LEVEL_HALT; - return; - } - CPU_RUN_MODE = RUN_MODE_BERR_AERR_RESET; - - /* Note: This is implemented for 68000 only! */ - m68ki_stack_frame_buserr(sr); - - m68ki_jump_vector(EXCEPTION_ADDRESS_ERROR); - - /* Use up some clock cycles and undo the instruction's cycles */ - USE_CYCLES(CYC_EXCEPTION[EXCEPTION_ADDRESS_ERROR] - CYC_INSTRUCTION[REG_IR]); -} - - -/* Service an interrupt request and start exception processing */ -void m68ki_exception_interrupt(uint int_level) -{ - uint vector; - uint sr; - uint new_pc; - - #if M68K_EMULATE_ADDRESS_ERROR == OPT_ON - if(CPU_TYPE_IS_000(CPU_TYPE)) - { - CPU_INSTR_MODE = INSTRUCTION_NO; - } - #endif /* M68K_EMULATE_ADDRESS_ERROR */ - - /* Turn off the stopped state */ - CPU_STOPPED &= ~STOP_LEVEL_STOP; - - /* If we are halted, don't do anything */ - if(CPU_STOPPED) - return; - - /* Acknowledge the interrupt */ - vector = m68ki_int_ack(int_level); - - /* Get the interrupt vector */ - if(vector == M68K_INT_ACK_AUTOVECTOR) - /* Use the autovectors. This is the most commonly used implementation */ - vector = EXCEPTION_INTERRUPT_AUTOVECTOR+int_level; - else if(vector == M68K_INT_ACK_SPURIOUS) - /* Called if no devices respond to the interrupt acknowledge */ - vector = EXCEPTION_SPURIOUS_INTERRUPT; - else if(vector > 255) - { - M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: Interrupt acknowledge returned invalid vector $%x\n", - m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC), vector)); - return; - } - - /* Start exception processing */ - sr = m68ki_init_exception(); - - /* Set the interrupt mask to the level of the one being serviced */ - FLAG_INT_MASK = int_level<<8; - - /* Get the new PC */ - new_pc = m68ki_read_data_32((vector<<2) + REG_VBR); - - /* If vector is uninitialized, call the uninitialized interrupt vector */ - if(new_pc == 0) - new_pc = m68ki_read_data_32((EXCEPTION_UNINITIALIZED_INTERRUPT<<2) + REG_VBR); - - /* Generate a stack frame */ - m68ki_stack_frame_0000(REG_PC, sr, vector); - if(FLAG_M && CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) - { - /* Create throwaway frame */ - m68ki_set_sm_flag(FLAG_S); /* clear M */ - sr |= 0x2000; /* Same as SR in master stack frame except S is forced high */ - m68ki_stack_frame_0001(REG_PC, sr, vector); - } - - m68ki_jump(new_pc); - - /* Defer cycle counting until later */ - USE_CYCLES(CYC_EXCEPTION[vector]); - -#if !M68K_EMULATE_INT_ACK - /* Automatically clear IRQ if we are not using an acknowledge scheme */ - CPU_INT_LEVEL = 0; -#endif /* M68K_EMULATE_INT_ACK */ -} - - -/* ASG: Check for interrupts */ -INLINE void m68ki_check_interrupts(void) -{ - if(m68ki_cpu.nmi_pending) - { - m68ki_cpu.nmi_pending = FALSE; - m68ki_exception_interrupt(7); - } - else if(CPU_INT_LEVEL > FLAG_INT_MASK) - m68ki_exception_interrupt(CPU_INT_LEVEL>>8); -} - -/* ======================================================================== */ -/* ============================== END OF FILE ============================= */ -/* ======================================================================== */ - -#endif /* M68KCPU__HEADER */ diff --git a/jan/src/cpu/m68k/m68kdasm.c b/jan/src/cpu/m68k/m68kdasm.c deleted file mode 100644 index 5dca4c104..000000000 --- a/jan/src/cpu/m68k/m68kdasm.c +++ /dev/null @@ -1,3533 +0,0 @@ -/* ======================================================================== */ -/* ========================= LICENSING & COPYRIGHT ======================== */ -/* ======================================================================== */ -/* - * MUSASHI - * Version 3.3 - * - * A portable Motorola M680x0 processor emulation engine. - * Copyright 1998-2001 Karl Stenerud. All rights reserved. - * - * This code may be freely used for non-commercial purposes as long as this - * copyright notice remains unaltered in the source code and any binary files - * containing this code in compiled form. - * - * All other lisencing terms must be negotiated with the author - * (Karl Stenerud). - * - * The latest version of this code can be obtained at: - * http://kstenerud.cjb.net - */ - - - -/* ======================================================================== */ -/* ================================ INCLUDES ============================== */ -/* ======================================================================== */ - -#include -#include -#include -#include "m68k.h" - -#ifndef DECL_SPEC -#define DECL_SPEC -#endif - -/* ======================================================================== */ -/* ============================ GENERAL DEFINES =========================== */ -/* ======================================================================== */ - -/* unsigned int and int must be at least 32 bits wide */ -#undef uint -#define uint unsigned int - -/* Bit Isolation Functions */ -#define BIT_0(A) ((A) & 0x00000001) -#define BIT_1(A) ((A) & 0x00000002) -#define BIT_2(A) ((A) & 0x00000004) -#define BIT_3(A) ((A) & 0x00000008) -#define BIT_4(A) ((A) & 0x00000010) -#define BIT_5(A) ((A) & 0x00000020) -#define BIT_6(A) ((A) & 0x00000040) -#define BIT_7(A) ((A) & 0x00000080) -#define BIT_8(A) ((A) & 0x00000100) -#define BIT_9(A) ((A) & 0x00000200) -#define BIT_A(A) ((A) & 0x00000400) -#define BIT_B(A) ((A) & 0x00000800) -#define BIT_C(A) ((A) & 0x00001000) -#define BIT_D(A) ((A) & 0x00002000) -#define BIT_E(A) ((A) & 0x00004000) -#define BIT_F(A) ((A) & 0x00008000) -#define BIT_10(A) ((A) & 0x00010000) -#define BIT_11(A) ((A) & 0x00020000) -#define BIT_12(A) ((A) & 0x00040000) -#define BIT_13(A) ((A) & 0x00080000) -#define BIT_14(A) ((A) & 0x00100000) -#define BIT_15(A) ((A) & 0x00200000) -#define BIT_16(A) ((A) & 0x00400000) -#define BIT_17(A) ((A) & 0x00800000) -#define BIT_18(A) ((A) & 0x01000000) -#define BIT_19(A) ((A) & 0x02000000) -#define BIT_1A(A) ((A) & 0x04000000) -#define BIT_1B(A) ((A) & 0x08000000) -#define BIT_1C(A) ((A) & 0x10000000) -#define BIT_1D(A) ((A) & 0x20000000) -#define BIT_1E(A) ((A) & 0x40000000) -#define BIT_1F(A) ((A) & 0x80000000) - -/* These are the CPU types understood by this disassembler */ -#define TYPE_68000 1 -#define TYPE_68008 2 -#define TYPE_68010 4 -#define TYPE_68020 8 -#define TYPE_68030 16 -#define TYPE_68040 32 - -#define M68000_ONLY (TYPE_68000 | TYPE_68008) - -#define M68010_ONLY TYPE_68010 -#define M68010_LESS (TYPE_68000 | TYPE_68008 | TYPE_68010) -#define M68010_PLUS (TYPE_68010 | TYPE_68020 | TYPE_68030 | TYPE_68040) - -#define M68020_ONLY TYPE_68020 -#define M68020_LESS (TYPE_68010 | TYPE_68020) -#define M68020_PLUS (TYPE_68020 | TYPE_68030 | TYPE_68040) - -#define M68030_ONLY TYPE_68030 -#define M68030_LESS (TYPE_68010 | TYPE_68020 | TYPE_68030) -#define M68030_PLUS (TYPE_68030 | TYPE_68040) - -#define M68040_PLUS TYPE_68040 - - -/* Extension word formats */ -#define EXT_8BIT_DISPLACEMENT(A) ((A)&0xff) -#define EXT_FULL(A) BIT_8(A) -#define EXT_EFFECTIVE_ZERO(A) (((A)&0xe4) == 0xc4 || ((A)&0xe2) == 0xc0) -#define EXT_BASE_REGISTER_PRESENT(A) (!BIT_7(A)) -#define EXT_INDEX_REGISTER_PRESENT(A) (!BIT_6(A)) -#define EXT_INDEX_REGISTER(A) (((A)>>12)&7) -#define EXT_INDEX_PRE_POST(A) (EXT_INDEX_PRESENT(A) && (A)&3) -#define EXT_INDEX_PRE(A) (EXT_INDEX_PRESENT(A) && ((A)&7) < 4 && ((A)&7) != 0) -#define EXT_INDEX_POST(A) (EXT_INDEX_PRESENT(A) && ((A)&7) > 4) -#define EXT_INDEX_SCALE(A) (((A)>>9)&3) -#define EXT_INDEX_LONG(A) BIT_B(A) -#define EXT_INDEX_AR(A) BIT_F(A) -#define EXT_BASE_DISPLACEMENT_PRESENT(A) (((A)&0x30) > 0x10) -#define EXT_BASE_DISPLACEMENT_WORD(A) (((A)&0x30) == 0x20) -#define EXT_BASE_DISPLACEMENT_LONG(A) (((A)&0x30) == 0x30) -#define EXT_OUTER_DISPLACEMENT_PRESENT(A) (((A)&3) > 1 && ((A)&0x47) < 0x44) -#define EXT_OUTER_DISPLACEMENT_WORD(A) (((A)&3) == 2 && ((A)&0x47) < 0x44) -#define EXT_OUTER_DISPLACEMENT_LONG(A) (((A)&3) == 3 && ((A)&0x47) < 0x44) - - -/* Opcode flags */ -#if M68K_COMPILE_FOR_MAME == OPT_ON -#define SET_OPCODE_FLAGS(x) g_opcode_type = x; -#define COMBINE_OPCODE_FLAGS(x) ((x) | g_opcode_type | DASMFLAG_SUPPORTED) -#else -#define SET_OPCODE_FLAGS(x) -#define COMBINE_OPCODE_FLAGS(x) (x) -#endif - - -/* ======================================================================== */ -/* =============================== PROTOTYPES ============================= */ -/* ======================================================================== */ - -/* Read data at the PC and increment PC */ -uint read_imm_8(void); -uint read_imm_16(void); -uint read_imm_32(void); - -/* Read data at the PC but don't imcrement the PC */ -uint peek_imm_8(void); -uint peek_imm_16(void); -uint peek_imm_32(void); - -/* make signed integers 100% portably */ -static int make_int_8(int value); -static int make_int_16(int value); - -/* make a string of a hex value */ -static char* make_signed_hex_str_8(uint val); -static char* make_signed_hex_str_16(uint val); -static char* make_signed_hex_str_32(uint val); - -/* make string of ea mode */ -static char* get_ea_mode_str(uint instruction, uint size); - -char* get_ea_mode_str_8(uint instruction); -char* get_ea_mode_str_16(uint instruction); -char* get_ea_mode_str_32(uint instruction); - -/* make string of immediate value */ -static char* get_imm_str_s(uint size); -static char* get_imm_str_u(uint size); - -char* get_imm_str_s8(void); -char* get_imm_str_s16(void); -char* get_imm_str_s32(void); - -/* Stuff to build the opcode handler jump table */ -static void build_opcode_table(void); -static int valid_ea(uint opcode, uint mask); -static int DECL_SPEC compare_nof_true_bits(const void *aptr, const void *bptr); - -/* used to build opcode handler jump table */ -typedef struct -{ - void (*opcode_handler)(void); /* handler function */ - uint mask; /* mask on opcode */ - uint match; /* what to match after masking */ - uint ea_mask; /* what ea modes are allowed */ -} opcode_struct; - - - -/* ======================================================================== */ -/* ================================= DATA ================================= */ -/* ======================================================================== */ - -/* Opcode handler jump table */ -static void (*g_instruction_table[0x10000])(void); -/* Flag if disassembler initialized */ -static int g_initialized = 0; - -/* Address mask to simulate address lines */ -static unsigned int g_address_mask = 0xffffffff; - -static char g_dasm_str[100]; /* string to hold disassembly */ -static char g_helper_str[100]; /* string to hold helpful info */ -static uint g_cpu_pc; /* program counter */ -static uint g_cpu_ir; /* instruction register */ -static uint g_cpu_type; -static uint g_opcode_type; - -/* used by ops like asr, ror, addq, etc */ -static uint g_3bit_qdata_table[8] = {8, 1, 2, 3, 4, 5, 6, 7}; - -static uint g_5bit_data_table[32] = -{ - 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 -}; - -static const char* g_cc[16] = -{"t", "f", "hi", "ls", "cc", "cs", "ne", "eq", "vc", "vs", "pl", "mi", "ge", "lt", "gt", "le"}; - -static const char* g_cpcc[64] = -{/* 000 001 010 011 100 101 110 111 */ - "f", "eq", "ogt", "oge", "olt", "ole", "ogl", "or", /* 000 */ - "un", "ueq", "ugt", "uge", "ult", "ule", "ne", "t", /* 001 */ - "sf", "seq", "gt", "ge", "lt", "le", "gl" "gle", /* 010 */ - "ngle", "ngl", "nle", "nlt", "nge", "ngt", "sne", "st", /* 011 */ - "?", "?", "?", "?", "?", "?", "?", "?", /* 100 */ - "?", "?", "?", "?", "?", "?", "?", "?", /* 101 */ - "?", "?", "?", "?", "?", "?", "?", "?", /* 110 */ - "?", "?", "?", "?", "?", "?", "?", "?" /* 111 */ -}; - - -/* ======================================================================== */ -/* =========================== UTILITY FUNCTIONS ========================== */ -/* ======================================================================== */ - -#define LIMIT_CPU_TYPES(ALLOWED_CPU_TYPES) \ - if(!(g_cpu_type & ALLOWED_CPU_TYPES)) \ - { \ - d68000_illegal(); \ - return; \ - } - -#define read_imm_8() (m68k_read_disassembler_16(((g_cpu_pc+=2)-2)&g_address_mask)&0xff) -#define read_imm_16() m68k_read_disassembler_16(((g_cpu_pc+=2)-2)&g_address_mask) -#define read_imm_32() m68k_read_disassembler_32(((g_cpu_pc+=4)-4)&g_address_mask) - -#define peek_imm_8() (m68k_read_disassembler_16(g_cpu_pc & g_address_mask)&0xff) -#define peek_imm_16() m68k_read_disassembler_16(g_cpu_pc & g_address_mask) -#define peek_imm_32() m68k_read_disassembler_32(g_cpu_pc & g_address_mask) - -/* Fake a split interface */ -#define get_ea_mode_str_8(instruction) get_ea_mode_str(instruction, 0) -#define get_ea_mode_str_16(instruction) get_ea_mode_str(instruction, 1) -#define get_ea_mode_str_32(instruction) get_ea_mode_str(instruction, 2) - -#define get_imm_str_s8() get_imm_str_s(0) -#define get_imm_str_s16() get_imm_str_s(1) -#define get_imm_str_s32() get_imm_str_s(2) - -#define get_imm_str_u8() get_imm_str_u(0) -#define get_imm_str_u16() get_imm_str_u(1) -#define get_imm_str_u32() get_imm_str_u(2) - - -/* 100% portable signed int generators */ -static int make_int_8(int value) -{ - return (value & 0x80) ? value | ~0xff : value & 0xff; -} - -static int make_int_16(int value) -{ - return (value & 0x8000) ? value | ~0xffff : value & 0xffff; -} - - -/* Get string representation of hex values */ -static char* make_signed_hex_str_8(uint val) -{ - static char str[20]; - - val &= 0xff; - - if(val == 0x80) - sprintf(str, "-$80"); - else if(val & 0x80) - sprintf(str, "-$%x", (0-val) & 0x7f); - else - sprintf(str, "$%x", val & 0x7f); - - return str; -} - -static char* make_signed_hex_str_16(uint val) -{ - static char str[20]; - - val &= 0xffff; - - if(val == 0x8000) - sprintf(str, "-$8000"); - else if(val & 0x8000) - sprintf(str, "-$%x", (0-val) & 0x7fff); - else - sprintf(str, "$%x", val & 0x7fff); - - return str; -} - -static char* make_signed_hex_str_32(uint val) -{ - static char str[20]; - - val &= 0xffffffff; - - if(val == 0x80000000) - sprintf(str, "-$80000000"); - else if(val & 0x80000000) - sprintf(str, "-$%x", (0-val) & 0x7fffffff); - else - sprintf(str, "$%x", val & 0x7fffffff); - - return str; -} - - -/* make string of immediate value */ -static char* get_imm_str_s(uint size) -{ - static char str[15]; - if(size == 0) - sprintf(str, "#%s", make_signed_hex_str_8(read_imm_8())); - else if(size == 1) - sprintf(str, "#%s", make_signed_hex_str_16(read_imm_16())); - else - sprintf(str, "#%s", make_signed_hex_str_32(read_imm_32())); - return str; -} - -static char* get_imm_str_u(uint size) -{ - static char str[15]; - if(size == 0) - sprintf(str, "#$%x", read_imm_8() & 0xff); - else if(size == 1) - sprintf(str, "#$%x", read_imm_16() & 0xffff); - else - sprintf(str, "#$%x", read_imm_32() & 0xffffffff); - return str; -} - -/* Make string of effective address mode */ -static char* get_ea_mode_str(uint instruction, uint size) -{ - static char b1[64]; - static char b2[64]; - static char* mode = b2; - uint extension; - uint base; - uint outer; - char base_reg[4]; - char index_reg[8]; - uint preindex; - uint postindex; - uint comma = 0; - uint temp_value; - char invalid_mode = 0; - - /* Switch buffers so we don't clobber on a double-call to this function */ - mode = mode == b1 ? b2 : b1; - - switch(instruction & 0x3f) - { - case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: - /* data register direct */ - sprintf(mode, "D%d", instruction&7); - break; - case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: - /* address register direct */ - sprintf(mode, "A%d", instruction&7); - break; - case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: - /* address register indirect */ - sprintf(mode, "(A%d)", instruction&7); - break; - case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: - /* address register indirect with postincrement */ - sprintf(mode, "(A%d)+", instruction&7); - break; - case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: - /* address register indirect with predecrement */ - sprintf(mode, "-(A%d)", instruction&7); - break; - case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: - /* address register indirect with displacement*/ - sprintf(mode, "(%s,A%d)", make_signed_hex_str_16(read_imm_16()), instruction&7); - break; - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: - /* address register indirect with index */ - extension = read_imm_16(); - - if((g_cpu_type & M68010_LESS) && EXT_INDEX_SCALE(extension)) - { - invalid_mode = 1; - break; - } - - if(EXT_FULL(extension)) - { - if(g_cpu_type & M68010_LESS) - { - invalid_mode = 1; - break; - } - - if(EXT_EFFECTIVE_ZERO(extension)) - { - strcpy(mode, "0"); - break; - } - - base = EXT_BASE_DISPLACEMENT_PRESENT(extension) ? (EXT_BASE_DISPLACEMENT_LONG(extension) ? read_imm_32() : read_imm_16()) : 0; - outer = EXT_OUTER_DISPLACEMENT_PRESENT(extension) ? (EXT_OUTER_DISPLACEMENT_LONG(extension) ? read_imm_32() : read_imm_16()) : 0; - if(EXT_BASE_REGISTER_PRESENT(extension)) - sprintf(base_reg, "A%d", instruction&7); - else - *base_reg = 0; - if(EXT_INDEX_REGISTER_PRESENT(extension)) - { - sprintf(index_reg, "%c%d.%c", EXT_INDEX_AR(extension) ? 'A' : 'D', EXT_INDEX_REGISTER(extension), EXT_INDEX_LONG(extension) ? 'l' : 'w'); - if(EXT_INDEX_SCALE(extension)) - sprintf(index_reg+strlen(index_reg), "*%d", 1 << EXT_INDEX_SCALE(extension)); - } - else - *index_reg = 0; - preindex = (extension&7) > 0 && (extension&7) < 4; - postindex = (extension&7) > 4; - - strcpy(mode, "("); - if(preindex || postindex) - strcat(mode, "["); - if(base) - { - strcat(mode, make_signed_hex_str_16(base)); - comma = 1; - } - if(*base_reg) - { - if(comma) - strcat(mode, ","); - strcat(mode, base_reg); - comma = 1; - } - if(postindex) - { - strcat(mode, "]"); - comma = 1; - } - if(*index_reg) - { - if(comma) - strcat(mode, ","); - strcat(mode, index_reg); - comma = 1; - } - if(preindex) - { - strcat(mode, "]"); - comma = 1; - } - if(outer) - { - if(comma) - strcat(mode, ","); - strcat(mode, make_signed_hex_str_16(outer)); - } - strcat(mode, ")"); - break; - } - - if(EXT_8BIT_DISPLACEMENT(extension) == 0) - sprintf(mode, "(A%d,%c%d.%c", instruction&7, EXT_INDEX_AR(extension) ? 'A' : 'D', EXT_INDEX_REGISTER(extension), EXT_INDEX_LONG(extension) ? 'l' : 'w'); - else - sprintf(mode, "(%s,A%d,%c%d.%c", make_signed_hex_str_8(extension), instruction&7, EXT_INDEX_AR(extension) ? 'A' : 'D', EXT_INDEX_REGISTER(extension), EXT_INDEX_LONG(extension) ? 'l' : 'w'); - if(EXT_INDEX_SCALE(extension)) - sprintf(mode+strlen(mode), "*%d", 1 << EXT_INDEX_SCALE(extension)); - strcat(mode, ")"); - break; - case 0x38: - /* absolute short address */ - sprintf(mode, "$%x.w", read_imm_16()); - break; - case 0x39: - /* absolute long address */ - sprintf(mode, "$%x.l", read_imm_32()); - break; - case 0x3a: - /* program counter with displacement */ - temp_value = read_imm_16(); - sprintf(mode, "(%s,PC)", make_signed_hex_str_16(temp_value)); - sprintf(g_helper_str, "; ($%x)", (make_int_16(temp_value) + g_cpu_pc-2) & 0xffffffff); - break; - case 0x3b: - /* program counter with index */ - extension = read_imm_16(); - - if((g_cpu_type & M68010_LESS) && EXT_INDEX_SCALE(extension)) - { - invalid_mode = 1; - break; - } - - if(EXT_FULL(extension)) - { - if(g_cpu_type & M68010_LESS) - { - invalid_mode = 1; - break; - } - - if(EXT_EFFECTIVE_ZERO(extension)) - { - strcpy(mode, "0"); - break; - } - base = EXT_BASE_DISPLACEMENT_PRESENT(extension) ? (EXT_BASE_DISPLACEMENT_LONG(extension) ? read_imm_32() : read_imm_16()) : 0; - outer = EXT_OUTER_DISPLACEMENT_PRESENT(extension) ? (EXT_OUTER_DISPLACEMENT_LONG(extension) ? read_imm_32() : read_imm_16()) : 0; - if(EXT_BASE_REGISTER_PRESENT(extension)) - strcpy(base_reg, "PC"); - else - *base_reg = 0; - if(EXT_INDEX_REGISTER_PRESENT(extension)) - { - sprintf(index_reg, "%c%d.%c", EXT_INDEX_AR(extension) ? 'A' : 'D', EXT_INDEX_REGISTER(extension), EXT_INDEX_LONG(extension) ? 'l' : 'w'); - if(EXT_INDEX_SCALE(extension)) - sprintf(index_reg+strlen(index_reg), "*%d", 1 << EXT_INDEX_SCALE(extension)); - } - else - *index_reg = 0; - preindex = (extension&7) > 0 && (extension&7) < 4; - postindex = (extension&7) > 4; - - strcpy(mode, "("); - if(preindex || postindex) - strcat(mode, "["); - if(base) - { - strcat(mode, make_signed_hex_str_16(base)); - comma = 1; - } - if(*base_reg) - { - if(comma) - strcat(mode, ","); - strcat(mode, base_reg); - comma = 1; - } - if(postindex) - { - strcat(mode, "]"); - comma = 1; - } - if(*index_reg) - { - if(comma) - strcat(mode, ","); - strcat(mode, index_reg); - comma = 1; - } - if(preindex) - { - strcat(mode, "]"); - comma = 1; - } - if(outer) - { - if(comma) - strcat(mode, ","); - strcat(mode, make_signed_hex_str_16(outer)); - } - strcat(mode, ")"); - break; - } - - if(EXT_8BIT_DISPLACEMENT(extension) == 0) - sprintf(mode, "(PC,%c%d.%c", EXT_INDEX_AR(extension) ? 'A' : 'D', EXT_INDEX_REGISTER(extension), EXT_INDEX_LONG(extension) ? 'l' : 'w'); - else - sprintf(mode, "(%s,PC,%c%d.%c", make_signed_hex_str_8(extension), EXT_INDEX_AR(extension) ? 'A' : 'D', EXT_INDEX_REGISTER(extension), EXT_INDEX_LONG(extension) ? 'l' : 'w'); - if(EXT_INDEX_SCALE(extension)) - sprintf(mode+strlen(mode), "*%d", 1 << EXT_INDEX_SCALE(extension)); - strcat(mode, ")"); - break; - case 0x3c: - /* Immediate */ - sprintf(mode, "%s", get_imm_str_u(size)); - break; - default: - invalid_mode = 1; - } - - if(invalid_mode) - sprintf(mode, "INVALID %x", instruction & 0x3f); - - return mode; -} - - - -/* ======================================================================== */ -/* ========================= INSTRUCTION HANDLERS ========================= */ -/* ======================================================================== */ -/* Instruction handler function names follow this convention: - * - * d68000_NAME_EXTENSIONS(void) - * where NAME is the name of the opcode it handles and EXTENSIONS are any - * extensions for special instances of that opcode. - * - * Examples: - * d68000_add_er_8(): add opcode, from effective address to register, - * size = byte - * - * d68000_asr_s_8(): arithmetic shift right, static count, size = byte - * - * - * Common extensions: - * 8 : size = byte - * 16 : size = word - * 32 : size = long - * rr : register to register - * mm : memory to memory - * r : register - * s : static - * er : effective address -> register - * re : register -> effective address - * ea : using effective address mode of operation - * d : data register direct - * a : address register direct - * ai : address register indirect - * pi : address register indirect with postincrement - * pd : address register indirect with predecrement - * di : address register indirect with displacement - * ix : address register indirect with index - * aw : absolute word - * al : absolute long - */ - -static void d68000_illegal(void) -{ - sprintf(g_dasm_str, "dc.w $%04x; ILLEGAL", g_cpu_ir); -} - -static void d68000_1010(void) -{ - sprintf(g_dasm_str, "dc.w $%04x; opcode 1010", g_cpu_ir); -} - - -static void d68000_1111(void) -{ - sprintf(g_dasm_str, "dc.w $%04x; opcode 1111", g_cpu_ir); -} - - -static void d68000_abcd_rr(void) -{ - sprintf(g_dasm_str, "abcd D%d, D%d", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - - -static void d68000_abcd_mm(void) -{ - sprintf(g_dasm_str, "abcd -(A%d), -(A%d)", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_add_er_8(void) -{ - sprintf(g_dasm_str, "add.b %s, D%d", get_ea_mode_str_8(g_cpu_ir), (g_cpu_ir>>9)&7); -} - - -static void d68000_add_er_16(void) -{ - sprintf(g_dasm_str, "add.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_add_er_32(void) -{ - sprintf(g_dasm_str, "add.l %s, D%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_add_re_8(void) -{ - sprintf(g_dasm_str, "add.b D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_add_re_16(void) -{ - sprintf(g_dasm_str, "add.w D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_add_re_32(void) -{ - sprintf(g_dasm_str, "add.l D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_adda_16(void) -{ - sprintf(g_dasm_str, "adda.w %s, A%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_adda_32(void) -{ - sprintf(g_dasm_str, "adda.l %s, A%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_addi_8(void) -{ - char* str = get_imm_str_s8(); - sprintf(g_dasm_str, "addi.b %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_addi_16(void) -{ - char* str = get_imm_str_s16(); - sprintf(g_dasm_str, "addi.w %s, %s", str, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_addi_32(void) -{ - char* str = get_imm_str_s32(); - sprintf(g_dasm_str, "addi.l %s, %s", str, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_addq_8(void) -{ - sprintf(g_dasm_str, "addq.b #%d, %s", g_3bit_qdata_table[(g_cpu_ir>>9)&7], get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_addq_16(void) -{ - sprintf(g_dasm_str, "addq.w #%d, %s", g_3bit_qdata_table[(g_cpu_ir>>9)&7], get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_addq_32(void) -{ - sprintf(g_dasm_str, "addq.l #%d, %s", g_3bit_qdata_table[(g_cpu_ir>>9)&7], get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_addx_rr_8(void) -{ - sprintf(g_dasm_str, "addx.b D%d, D%d", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_addx_rr_16(void) -{ - sprintf(g_dasm_str, "addx.w D%d, D%d", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_addx_rr_32(void) -{ - sprintf(g_dasm_str, "addx.l D%d, D%d", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_addx_mm_8(void) -{ - sprintf(g_dasm_str, "addx.b -(A%d), -(A%d)", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_addx_mm_16(void) -{ - sprintf(g_dasm_str, "addx.w -(A%d), -(A%d)", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_addx_mm_32(void) -{ - sprintf(g_dasm_str, "addx.l -(A%d), -(A%d)", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_and_er_8(void) -{ - sprintf(g_dasm_str, "and.b %s, D%d", get_ea_mode_str_8(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_and_er_16(void) -{ - sprintf(g_dasm_str, "and.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_and_er_32(void) -{ - sprintf(g_dasm_str, "and.l %s, D%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_and_re_8(void) -{ - sprintf(g_dasm_str, "and.b D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_and_re_16(void) -{ - sprintf(g_dasm_str, "and.w D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_and_re_32(void) -{ - sprintf(g_dasm_str, "and.l D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_andi_8(void) -{ - char* str = get_imm_str_u8(); - sprintf(g_dasm_str, "andi.b %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_andi_16(void) -{ - char* str = get_imm_str_u16(); - sprintf(g_dasm_str, "andi.w %s, %s", str, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_andi_32(void) -{ - char* str = get_imm_str_u32(); - sprintf(g_dasm_str, "andi.l %s, %s", str, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_andi_to_ccr(void) -{ - sprintf(g_dasm_str, "andi %s, CCR", get_imm_str_u8()); -} - -static void d68000_andi_to_sr(void) -{ - sprintf(g_dasm_str, "andi %s, SR", get_imm_str_u16()); -} - -static void d68000_asr_s_8(void) -{ - sprintf(g_dasm_str, "asr.b #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_asr_s_16(void) -{ - sprintf(g_dasm_str, "asr.w #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_asr_s_32(void) -{ - sprintf(g_dasm_str, "asr.l #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_asr_r_8(void) -{ - sprintf(g_dasm_str, "asr.b D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_asr_r_16(void) -{ - sprintf(g_dasm_str, "asr.w D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_asr_r_32(void) -{ - sprintf(g_dasm_str, "asr.l D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_asr_ea(void) -{ - sprintf(g_dasm_str, "asr.w %s", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_asl_s_8(void) -{ - sprintf(g_dasm_str, "asl.b #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_asl_s_16(void) -{ - sprintf(g_dasm_str, "asl.w #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_asl_s_32(void) -{ - sprintf(g_dasm_str, "asl.l #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_asl_r_8(void) -{ - sprintf(g_dasm_str, "asl.b D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_asl_r_16(void) -{ - sprintf(g_dasm_str, "asl.w D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_asl_r_32(void) -{ - sprintf(g_dasm_str, "asl.l D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_asl_ea(void) -{ - sprintf(g_dasm_str, "asl.w %s", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_bcc_8(void) -{ - uint temp_pc = g_cpu_pc; - sprintf(g_dasm_str, "b%-2s %x", g_cc[(g_cpu_ir>>8)&0xf], temp_pc + make_int_8(g_cpu_ir)); -} - -static void d68000_bcc_16(void) -{ - uint temp_pc = g_cpu_pc; - sprintf(g_dasm_str, "b%-2s %x", g_cc[(g_cpu_ir>>8)&0xf], temp_pc + make_int_16(read_imm_16())); -} - -static void d68020_bcc_32(void) -{ - uint temp_pc = g_cpu_pc; - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "b%-2s %x; (2+)", g_cc[(g_cpu_ir>>8)&0xf], temp_pc + read_imm_32()); -} - -static void d68000_bchg_r(void) -{ - sprintf(g_dasm_str, "bchg D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_bchg_s(void) -{ - char* str = get_imm_str_u8(); - sprintf(g_dasm_str, "bchg %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_bclr_r(void) -{ - sprintf(g_dasm_str, "bclr D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_bclr_s(void) -{ - char* str = get_imm_str_u8(); - sprintf(g_dasm_str, "bclr %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68010_bkpt(void) -{ - LIMIT_CPU_TYPES(M68010_PLUS); - sprintf(g_dasm_str, "bkpt #%d; (1+)", g_cpu_ir&7); -} - -static void d68020_bfchg(void) -{ - uint extension; - char offset[3]; - char width[3]; - - LIMIT_CPU_TYPES(M68020_PLUS); - - extension = read_imm_16(); - - if(BIT_B(extension)) - sprintf(offset, "D%d", (extension>>6)&7); - else - sprintf(offset, "%d", (extension>>6)&31); - if(BIT_5(extension)) - sprintf(width, "D%d", extension&7); - else - sprintf(width, "%d", g_5bit_data_table[extension&31]); - sprintf(g_dasm_str, "bfchg %s {%s:%s}; (2+)", get_ea_mode_str_8(g_cpu_ir), offset, width); -} - -static void d68020_bfclr(void) -{ - uint extension; - char offset[3]; - char width[3]; - - LIMIT_CPU_TYPES(M68020_PLUS); - - extension = read_imm_16(); - - if(BIT_B(extension)) - sprintf(offset, "D%d", (extension>>6)&7); - else - sprintf(offset, "%d", (extension>>6)&31); - if(BIT_5(extension)) - sprintf(width, "D%d", extension&7); - else - sprintf(width, "%d", g_5bit_data_table[extension&31]); - sprintf(g_dasm_str, "bfclr %s {%s:%s}; (2+)", get_ea_mode_str_8(g_cpu_ir), offset, width); -} - -static void d68020_bfexts(void) -{ - uint extension; - char offset[3]; - char width[3]; - - LIMIT_CPU_TYPES(M68020_PLUS); - - extension = read_imm_16(); - - if(BIT_B(extension)) - sprintf(offset, "D%d", (extension>>6)&7); - else - sprintf(offset, "%d", (extension>>6)&31); - if(BIT_5(extension)) - sprintf(width, "D%d", extension&7); - else - sprintf(width, "%d", g_5bit_data_table[extension&31]); - sprintf(g_dasm_str, "bfexts D%d, %s {%s:%s}; (2+)", (extension>>12)&7, get_ea_mode_str_8(g_cpu_ir), offset, width); -} - -static void d68020_bfextu(void) -{ - uint extension; - char offset[3]; - char width[3]; - - LIMIT_CPU_TYPES(M68020_PLUS); - - extension = read_imm_16(); - - if(BIT_B(extension)) - sprintf(offset, "D%d", (extension>>6)&7); - else - sprintf(offset, "%d", (extension>>6)&31); - if(BIT_5(extension)) - sprintf(width, "D%d", extension&7); - else - sprintf(width, "%d", g_5bit_data_table[extension&31]); - sprintf(g_dasm_str, "bfextu D%d, %s {%s:%s}; (2+)", (extension>>12)&7, get_ea_mode_str_8(g_cpu_ir), offset, width); -} - -static void d68020_bfffo(void) -{ - uint extension; - char offset[3]; - char width[3]; - - LIMIT_CPU_TYPES(M68020_PLUS); - - extension = read_imm_16(); - - if(BIT_B(extension)) - sprintf(offset, "D%d", (extension>>6)&7); - else - sprintf(offset, "%d", (extension>>6)&31); - if(BIT_5(extension)) - sprintf(width, "D%d", extension&7); - else - sprintf(width, "%d", g_5bit_data_table[extension&31]); - sprintf(g_dasm_str, "bfffo D%d, %s {%s:%s}; (2+)", (extension>>12)&7, get_ea_mode_str_8(g_cpu_ir), offset, width); -} - -static void d68020_bfins(void) -{ - uint extension; - char offset[3]; - char width[3]; - - LIMIT_CPU_TYPES(M68020_PLUS); - - extension = read_imm_16(); - - if(BIT_B(extension)) - sprintf(offset, "D%d", (extension>>6)&7); - else - sprintf(offset, "%d", (extension>>6)&31); - if(BIT_5(extension)) - sprintf(width, "D%d", extension&7); - else - sprintf(width, "%d", g_5bit_data_table[extension&31]); - sprintf(g_dasm_str, "bfins D%d, %s {%s:%s}; (2+)", (extension>>12)&7, get_ea_mode_str_8(g_cpu_ir), offset, width); -} - -static void d68020_bfset(void) -{ - uint extension; - char offset[3]; - char width[3]; - - LIMIT_CPU_TYPES(M68020_PLUS); - - extension = read_imm_16(); - - if(BIT_B(extension)) - sprintf(offset, "D%d", (extension>>6)&7); - else - sprintf(offset, "%d", (extension>>6)&31); - if(BIT_5(extension)) - sprintf(width, "D%d", extension&7); - else - sprintf(width, "%d", g_5bit_data_table[extension&31]); - sprintf(g_dasm_str, "bfset %s {%s:%s}; (2+)", get_ea_mode_str_8(g_cpu_ir), offset, width); -} - -static void d68020_bftst(void) -{ - uint extension; - char offset[3]; - char width[3]; - - LIMIT_CPU_TYPES(M68020_PLUS); - - extension = read_imm_16(); - - if(BIT_B(extension)) - sprintf(offset, "D%d", (extension>>6)&7); - else - sprintf(offset, "%d", (extension>>6)&31); - if(BIT_5(extension)) - sprintf(width, "D%d", extension&7); - else - sprintf(width, "%d", g_5bit_data_table[extension&31]); - sprintf(g_dasm_str, "bftst %s {%s:%s}; (2+)", get_ea_mode_str_8(g_cpu_ir), offset, width); -} - -static void d68000_bra_8(void) -{ - uint temp_pc = g_cpu_pc; - sprintf(g_dasm_str, "bra %x", temp_pc + make_int_8(g_cpu_ir)); -} - -static void d68000_bra_16(void) -{ - uint temp_pc = g_cpu_pc; - sprintf(g_dasm_str, "bra %x", temp_pc + make_int_16(read_imm_16())); -} - -static void d68020_bra_32(void) -{ - uint temp_pc = g_cpu_pc; - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "bra %x; (2+)", temp_pc + read_imm_32()); -} - -static void d68000_bset_r(void) -{ - sprintf(g_dasm_str, "bset D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_bset_s(void) -{ - char* str = get_imm_str_u8(); - sprintf(g_dasm_str, "bset %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_bsr_8(void) -{ - uint temp_pc = g_cpu_pc; - sprintf(g_dasm_str, "bsr %x", temp_pc + make_int_8(g_cpu_ir)); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68000_bsr_16(void) -{ - uint temp_pc = g_cpu_pc; - sprintf(g_dasm_str, "bsr %x", temp_pc + make_int_16(read_imm_16())); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68020_bsr_32(void) -{ - uint temp_pc = g_cpu_pc; - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "bsr %x; (2+)", temp_pc + peek_imm_32()); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68000_btst_r(void) -{ - sprintf(g_dasm_str, "btst D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_btst_s(void) -{ - char* str = get_imm_str_u8(); - sprintf(g_dasm_str, "btst %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_callm(void) -{ - char* str; - LIMIT_CPU_TYPES(M68020_ONLY); - str = get_imm_str_u8(); - - sprintf(g_dasm_str, "callm %s, %s; (2)", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_cas_8(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - sprintf(g_dasm_str, "cas.b D%d, D%d, %s; (2+)", extension&7, (extension>>8)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_cas_16(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - sprintf(g_dasm_str, "cas.w D%d, D%d, %s; (2+)", extension&7, (extension>>8)&7, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68020_cas_32(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - sprintf(g_dasm_str, "cas.l D%d, D%d, %s; (2+)", extension&7, (extension>>8)&7, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68020_cas2_16(void) -{ -/* CAS2 Dc1:Dc2,Du1:Dc2:(Rn1):(Rn2) -f e d c b a 9 8 7 6 5 4 3 2 1 0 - DARn1 0 0 0 Du1 0 0 0 Dc1 - DARn2 0 0 0 Du2 0 0 0 Dc2 -*/ - - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_32(); - sprintf(g_dasm_str, "cas2.w D%d:D%d:D%d:D%d, (%c%d):(%c%d); (2+)", - (extension>>16)&7, extension&7, (extension>>22)&7, (extension>>6)&7, - BIT_1F(extension) ? 'A' : 'D', (extension>>28)&7, - BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); -} - -static void d68020_cas2_32(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_32(); - sprintf(g_dasm_str, "cas2.l D%d:D%d:D%d:D%d, (%c%d):(%c%d); (2+)", - (extension>>16)&7, extension&7, (extension>>22)&7, (extension>>6)&7, - BIT_1F(extension) ? 'A' : 'D', (extension>>28)&7, - BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); -} - -static void d68000_chk_16(void) -{ - sprintf(g_dasm_str, "chk.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68020_chk_32(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "chk.l %s, D%d; (2+)", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68020_chk2_cmp2_8(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - sprintf(g_dasm_str, "%s.b %s, %c%d; (2+)", BIT_B(extension) ? "chk2" : "cmp2", get_ea_mode_str_8(g_cpu_ir), BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); -} - -static void d68020_chk2_cmp2_16(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - sprintf(g_dasm_str, "%s.w %s, %c%d; (2+)", BIT_B(extension) ? "chk2" : "cmp2", get_ea_mode_str_16(g_cpu_ir), BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); -} - -static void d68020_chk2_cmp2_32(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - sprintf(g_dasm_str, "%s.l %s, %c%d; (2+)", BIT_B(extension) ? "chk2" : "cmp2", get_ea_mode_str_32(g_cpu_ir), BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); -} - -static void d68040_cinv(void) -{ - LIMIT_CPU_TYPES(M68040_PLUS); - switch((g_cpu_ir>>3)&3) - { - case 0: - sprintf(g_dasm_str, "cinv (illegal scope); (4)"); - break; - case 1: - sprintf(g_dasm_str, "cinvl %d, (A%d); (4)", (g_cpu_ir>>6)&3, g_cpu_ir&7); - break; - case 2: - sprintf(g_dasm_str, "cinvp %d, (A%d); (4)", (g_cpu_ir>>6)&3, g_cpu_ir&7); - break; - case 3: - sprintf(g_dasm_str, "cinva %d; (4)", (g_cpu_ir>>6)&3); - break; - } -} - -static void d68000_clr_8(void) -{ - sprintf(g_dasm_str, "clr.b %s", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_clr_16(void) -{ - sprintf(g_dasm_str, "clr.w %s", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_clr_32(void) -{ - sprintf(g_dasm_str, "clr.l %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_cmp_8(void) -{ - sprintf(g_dasm_str, "cmp.b %s, D%d", get_ea_mode_str_8(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_cmp_16(void) -{ - sprintf(g_dasm_str, "cmp.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_cmp_32(void) -{ - sprintf(g_dasm_str, "cmp.l %s, D%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_cmpa_16(void) -{ - sprintf(g_dasm_str, "cmpa.w %s, A%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_cmpa_32(void) -{ - sprintf(g_dasm_str, "cmpa.l %s, A%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_cmpi_8(void) -{ - char* str = get_imm_str_s8(); - sprintf(g_dasm_str, "cmpi.b %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_cmpi_pcdi_8(void) -{ - char* str; - LIMIT_CPU_TYPES(M68010_PLUS); - str = get_imm_str_s8(); - sprintf(g_dasm_str, "cmpi.b %s, %s; (2+)", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_cmpi_pcix_8(void) -{ - char* str; - LIMIT_CPU_TYPES(M68010_PLUS); - str = get_imm_str_s8(); - sprintf(g_dasm_str, "cmpi.b %s, %s; (2+)", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_cmpi_16(void) -{ - char* str; - str = get_imm_str_s16(); - sprintf(g_dasm_str, "cmpi.w %s, %s", str, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68020_cmpi_pcdi_16(void) -{ - char* str; - LIMIT_CPU_TYPES(M68010_PLUS); - str = get_imm_str_s16(); - sprintf(g_dasm_str, "cmpi.w %s, %s; (2+)", str, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68020_cmpi_pcix_16(void) -{ - char* str; - LIMIT_CPU_TYPES(M68010_PLUS); - str = get_imm_str_s16(); - sprintf(g_dasm_str, "cmpi.w %s, %s; (2+)", str, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_cmpi_32(void) -{ - char* str; - str = get_imm_str_s32(); - sprintf(g_dasm_str, "cmpi.l %s, %s", str, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68020_cmpi_pcdi_32(void) -{ - char* str; - LIMIT_CPU_TYPES(M68010_PLUS); - str = get_imm_str_s32(); - sprintf(g_dasm_str, "cmpi.l %s, %s; (2+)", str, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68020_cmpi_pcix_32(void) -{ - char* str; - LIMIT_CPU_TYPES(M68010_PLUS); - str = get_imm_str_s32(); - sprintf(g_dasm_str, "cmpi.l %s, %s; (2+)", str, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_cmpm_8(void) -{ - sprintf(g_dasm_str, "cmpm.b (A%d)+, (A%d)+", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_cmpm_16(void) -{ - sprintf(g_dasm_str, "cmpm.w (A%d)+, (A%d)+", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_cmpm_32(void) -{ - sprintf(g_dasm_str, "cmpm.l (A%d)+, (A%d)+", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68020_cpbcc_16(void) -{ - uint extension; - uint new_pc = g_cpu_pc; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - new_pc += make_int_16(peek_imm_16()); - sprintf(g_dasm_str, "%db%-4s %s; %x (extension = %x) (2-3)", (g_cpu_ir>>9)&7, g_cpcc[g_cpu_ir&0x3f], get_imm_str_s16(), new_pc, extension); -} - -static void d68020_cpbcc_32(void) -{ - uint extension; - uint new_pc = g_cpu_pc; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - new_pc += peek_imm_32(); - sprintf(g_dasm_str, "%db%-4s %s; %x (extension = %x) (2-3)", (g_cpu_ir>>9)&7, g_cpcc[g_cpu_ir&0x3f], get_imm_str_s16(), new_pc, extension); -} - -static void d68020_cpdbcc(void) -{ - uint extension1; - uint extension2; - uint new_pc = g_cpu_pc; - LIMIT_CPU_TYPES(M68020_PLUS); - extension1 = read_imm_16(); - extension2 = read_imm_16(); - new_pc += make_int_16(peek_imm_16()); - sprintf(g_dasm_str, "%ddb%-4s D%d,%s; %x (extension = %x) (2-3)", (g_cpu_ir>>9)&7, g_cpcc[extension1&0x3f], g_cpu_ir&7, get_imm_str_s16(), new_pc, extension2); -} - -static void d68020_cpgen(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "%dgen %s; (2-3)", (g_cpu_ir>>9)&7, get_imm_str_u32()); -} - -static void d68020_cprestore(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "%drestore %s; (2-3)", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_cpsave(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "%dsave %s; (2-3)", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_cpscc(void) -{ - uint extension1; - uint extension2; - LIMIT_CPU_TYPES(M68020_PLUS); - extension1 = read_imm_16(); - extension2 = read_imm_16(); - sprintf(g_dasm_str, "%ds%-4s %s; (extension = %x) (2-3)", (g_cpu_ir>>9)&7, g_cpcc[extension1&0x3f], get_ea_mode_str_8(g_cpu_ir), extension2); -} - -static void d68020_cptrapcc_0(void) -{ - uint extension1; - uint extension2; - LIMIT_CPU_TYPES(M68020_PLUS); - extension1 = read_imm_16(); - extension2 = read_imm_16(); - sprintf(g_dasm_str, "%dtrap%-4s; (extension = %x) (2-3)", (g_cpu_ir>>9)&7, g_cpcc[extension1&0x3f], extension2); -} - -static void d68020_cptrapcc_16(void) -{ - uint extension1; - uint extension2; - LIMIT_CPU_TYPES(M68020_PLUS); - extension1 = read_imm_16(); - extension2 = read_imm_16(); - sprintf(g_dasm_str, "%dtrap%-4s %s; (extension = %x) (2-3)", (g_cpu_ir>>9)&7, g_cpcc[extension1&0x3f], get_imm_str_u16(), extension2); -} - -static void d68020_cptrapcc_32(void) -{ - uint extension1; - uint extension2; - LIMIT_CPU_TYPES(M68020_PLUS); - extension1 = read_imm_16(); - extension2 = read_imm_16(); - sprintf(g_dasm_str, "%dtrap%-4s %s; (extension = %x) (2-3)", (g_cpu_ir>>9)&7, g_cpcc[extension1&0x3f], get_imm_str_u32(), extension2); -} - -static void d68040_cpush(void) -{ - LIMIT_CPU_TYPES(M68040_PLUS); - switch((g_cpu_ir>>3)&3) - { - case 0: - sprintf(g_dasm_str, "cpush (illegal scope); (4)"); - break; - case 1: - sprintf(g_dasm_str, "cpushl %d, (A%d); (4)", (g_cpu_ir>>6)&3, g_cpu_ir&7); - break; - case 2: - sprintf(g_dasm_str, "cpushp %d, (A%d); (4)", (g_cpu_ir>>6)&3, g_cpu_ir&7); - break; - case 3: - sprintf(g_dasm_str, "cpusha %d; (4)", (g_cpu_ir>>6)&3); - break; - } -} - -static void d68000_dbra(void) -{ - uint temp_pc = g_cpu_pc; - sprintf(g_dasm_str, "dbra D%d, %x", g_cpu_ir & 7, temp_pc + make_int_16(read_imm_16())); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68000_dbcc(void) -{ - uint temp_pc = g_cpu_pc; - sprintf(g_dasm_str, "db%-2s D%d, %x", g_cc[(g_cpu_ir>>8)&0xf], g_cpu_ir & 7, temp_pc + make_int_16(read_imm_16())); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68000_divs(void) -{ - sprintf(g_dasm_str, "divs.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_divu(void) -{ - sprintf(g_dasm_str, "divu.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68020_divl(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - - if(BIT_A(extension)) - sprintf(g_dasm_str, "div%c.l %s, D%d:D%d; (2+)", BIT_B(extension) ? 's' : 'u', get_ea_mode_str_32(g_cpu_ir), extension&7, (extension>>12)&7); - else if((extension&7) == ((extension>>12)&7)) - sprintf(g_dasm_str, "div%c.l %s, D%d; (2+)", BIT_B(extension) ? 's' : 'u', get_ea_mode_str_32(g_cpu_ir), (extension>>12)&7); - else - sprintf(g_dasm_str, "div%cl.l %s, D%d:D%d; (2+)", BIT_B(extension) ? 's' : 'u', get_ea_mode_str_32(g_cpu_ir), extension&7, (extension>>12)&7); -} - -static void d68000_eor_8(void) -{ - sprintf(g_dasm_str, "eor.b D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_eor_16(void) -{ - sprintf(g_dasm_str, "eor.w D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_eor_32(void) -{ - sprintf(g_dasm_str, "eor.l D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_eori_8(void) -{ - char* str = get_imm_str_u8(); - sprintf(g_dasm_str, "eori.b %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_eori_16(void) -{ - char* str = get_imm_str_u16(); - sprintf(g_dasm_str, "eori.w %s, %s", str, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_eori_32(void) -{ - char* str = get_imm_str_u32(); - sprintf(g_dasm_str, "eori.l %s, %s", str, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_eori_to_ccr(void) -{ - sprintf(g_dasm_str, "eori %s, CCR", get_imm_str_u8()); -} - -static void d68000_eori_to_sr(void) -{ - sprintf(g_dasm_str, "eori %s, SR", get_imm_str_u16()); -} - -static void d68000_exg_dd(void) -{ - sprintf(g_dasm_str, "exg D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_exg_aa(void) -{ - sprintf(g_dasm_str, "exg A%d, A%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_exg_da(void) -{ - sprintf(g_dasm_str, "exg D%d, A%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_ext_16(void) -{ - sprintf(g_dasm_str, "ext.w D%d", g_cpu_ir&7); -} - -static void d68000_ext_32(void) -{ - sprintf(g_dasm_str, "ext.l D%d", g_cpu_ir&7); -} - -static void d68020_extb_32(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "extb.l D%d; (2+)", g_cpu_ir&7); -} - -static void d68000_jmp(void) -{ - sprintf(g_dasm_str, "jmp %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_jsr(void) -{ - sprintf(g_dasm_str, "jsr %s", get_ea_mode_str_32(g_cpu_ir)); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68000_lea(void) -{ - sprintf(g_dasm_str, "lea %s, A%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_link_16(void) -{ - sprintf(g_dasm_str, "link A%d, %s", g_cpu_ir&7, get_imm_str_s16()); -} - -static void d68020_link_32(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "link A%d, %s; (2+)", g_cpu_ir&7, get_imm_str_s32()); -} - -static void d68000_lsr_s_8(void) -{ - sprintf(g_dasm_str, "lsr.b #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_lsr_s_16(void) -{ - sprintf(g_dasm_str, "lsr.w #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_lsr_s_32(void) -{ - sprintf(g_dasm_str, "lsr.l #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_lsr_r_8(void) -{ - sprintf(g_dasm_str, "lsr.b D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_lsr_r_16(void) -{ - sprintf(g_dasm_str, "lsr.w D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_lsr_r_32(void) -{ - sprintf(g_dasm_str, "lsr.l D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_lsr_ea(void) -{ - sprintf(g_dasm_str, "lsr.w %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_lsl_s_8(void) -{ - sprintf(g_dasm_str, "lsl.b #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_lsl_s_16(void) -{ - sprintf(g_dasm_str, "lsl.w #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_lsl_s_32(void) -{ - sprintf(g_dasm_str, "lsl.l #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_lsl_r_8(void) -{ - sprintf(g_dasm_str, "lsl.b D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_lsl_r_16(void) -{ - sprintf(g_dasm_str, "lsl.w D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_lsl_r_32(void) -{ - sprintf(g_dasm_str, "lsl.l D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_lsl_ea(void) -{ - sprintf(g_dasm_str, "lsl.w %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_move_8(void) -{ - char* str = get_ea_mode_str_8(g_cpu_ir); - sprintf(g_dasm_str, "move.b %s, %s", str, get_ea_mode_str_8(((g_cpu_ir>>9) & 7) | ((g_cpu_ir>>3) & 0x38))); -} - -static void d68000_move_16(void) -{ - char* str = get_ea_mode_str_16(g_cpu_ir); - sprintf(g_dasm_str, "move.w %s, %s", str, get_ea_mode_str_16(((g_cpu_ir>>9) & 7) | ((g_cpu_ir>>3) & 0x38))); -} - -static void d68000_move_32(void) -{ - char* str = get_ea_mode_str_32(g_cpu_ir); - sprintf(g_dasm_str, "move.l %s, %s", str, get_ea_mode_str_32(((g_cpu_ir>>9) & 7) | ((g_cpu_ir>>3) & 0x38))); -} - -static void d68000_movea_16(void) -{ - sprintf(g_dasm_str, "movea.w %s, A%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_movea_32(void) -{ - sprintf(g_dasm_str, "movea.l %s, A%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_move_to_ccr(void) -{ - sprintf(g_dasm_str, "move %s, CCR", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68010_move_fr_ccr(void) -{ - LIMIT_CPU_TYPES(M68010_PLUS); - sprintf(g_dasm_str, "move CCR, %s; (1+)", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_move_fr_sr(void) -{ - sprintf(g_dasm_str, "move SR, %s", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_move_to_sr(void) -{ - sprintf(g_dasm_str, "move %s, SR", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_move_fr_usp(void) -{ - sprintf(g_dasm_str, "move USP, A%d", g_cpu_ir&7); -} - -static void d68000_move_to_usp(void) -{ - sprintf(g_dasm_str, "move A%d, USP", g_cpu_ir&7); -} - -static void d68010_movec(void) -{ - uint extension; - const char* reg_name; - const char* processor; - LIMIT_CPU_TYPES(M68010_PLUS); - extension = read_imm_16(); - - switch(extension & 0xfff) - { - case 0x000: - reg_name = "SFC"; - processor = "1+"; - break; - case 0x001: - reg_name = "DFC"; - processor = "1+"; - break; - case 0x800: - reg_name = "USP"; - processor = "1+"; - break; - case 0x801: - reg_name = "VBR"; - processor = "1+"; - break; - case 0x002: - reg_name = "CACR"; - processor = "2+"; - break; - case 0x802: - reg_name = "CAAR"; - processor = "2,3"; - break; - case 0x803: - reg_name = "MSP"; - processor = "2+"; - break; - case 0x804: - reg_name = "ISP"; - processor = "2+"; - break; - case 0x003: - reg_name = "TC"; - processor = "4+"; - break; - case 0x004: - reg_name = "ITT0"; - processor = "4+"; - break; - case 0x005: - reg_name = "ITT1"; - processor = "4+"; - break; - case 0x006: - reg_name = "DTT0"; - processor = "4+"; - break; - case 0x007: - reg_name = "DTT1"; - processor = "4+"; - break; - case 0x805: - reg_name = "MMUSR"; - processor = "4+"; - break; - case 0x806: - reg_name = "URP"; - processor = "4+"; - break; - case 0x807: - reg_name = "SRP"; - processor = "4+"; - break; - default: - reg_name = make_signed_hex_str_16(extension & 0xfff); - processor = "?"; - } - - if(BIT_1(g_cpu_ir)) - sprintf(g_dasm_str, "movec %c%d, %s; (%s)", BIT_F(extension) ? 'A' : 'D', (extension>>12)&7, reg_name, processor); - else - sprintf(g_dasm_str, "movec %s, %c%d; (%s)", reg_name, BIT_F(extension) ? 'A' : 'D', (extension>>12)&7, processor); -} - -static void d68000_movem_pd_16(void) -{ - uint data = read_imm_16(); - char buffer[40]; - uint first; - uint run_length; - uint i; - - buffer[0] = 0; - for(i=0;i<8;i++) - { - if(data&(1<<(15-i))) - { - first = i; - run_length = 0; - while(i<7 && (data&(1<<(15-(i+1))))) - { - i++; - run_length++; - } - if(buffer[0] != 0) - strcat(buffer, "/"); - sprintf(buffer+strlen(buffer), "D%d", first); - if(run_length > 0) - sprintf(buffer+strlen(buffer), "-D%d", first + run_length); - } - } - for(i=0;i<8;i++) - { - if(data&(1<<(7-i))) - { - first = i; - run_length = 0; - while(i<7 && (data&(1<<(7-(i+1))))) - { - i++; - run_length++; - } - if(buffer[0] != 0) - strcat(buffer, "/"); - sprintf(buffer+strlen(buffer), "A%d", first); - if(run_length > 0) - sprintf(buffer+strlen(buffer), "-A%d", first + run_length); - } - } - sprintf(g_dasm_str, "movem.w %s, %s", buffer, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_movem_pd_32(void) -{ - uint data = read_imm_16(); - char buffer[40]; - uint first; - uint run_length; - uint i; - - buffer[0] = 0; - for(i=0;i<8;i++) - { - if(data&(1<<(15-i))) - { - first = i; - run_length = 0; - while(i<7 && (data&(1<<(15-(i+1))))) - { - i++; - run_length++; - } - if(buffer[0] != 0) - strcat(buffer, "/"); - sprintf(buffer+strlen(buffer), "D%d", first); - if(run_length > 0) - sprintf(buffer+strlen(buffer), "-D%d", first + run_length); - } - } - for(i=0;i<8;i++) - { - if(data&(1<<(7-i))) - { - first = i; - run_length = 0; - while(i<7 && (data&(1<<(7-(i+1))))) - { - i++; - run_length++; - } - if(buffer[0] != 0) - strcat(buffer, "/"); - sprintf(buffer+strlen(buffer), "A%d", first); - if(run_length > 0) - sprintf(buffer+strlen(buffer), "-A%d", first + run_length); - } - } - sprintf(g_dasm_str, "movem.l %s, %s", buffer, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_movem_er_16(void) -{ - uint data = read_imm_16(); - char buffer[40]; - uint first; - uint run_length; - uint i; - - buffer[0] = 0; - for(i=0;i<8;i++) - { - if(data&(1< 0) - sprintf(buffer+strlen(buffer), "-D%d", first + run_length); - } - } - for(i=0;i<8;i++) - { - if(data&(1<<(i+8))) - { - first = i; - run_length = 0; - while(i<7 && (data&(1<<(i+8+1)))) - { - i++; - run_length++; - } - if(buffer[0] != 0) - strcat(buffer, "/"); - sprintf(buffer+strlen(buffer), "A%d", first); - if(run_length > 0) - sprintf(buffer+strlen(buffer), "-A%d", first + run_length); - } - } - sprintf(g_dasm_str, "movem.w %s, %s", get_ea_mode_str_16(g_cpu_ir), buffer); -} - -static void d68000_movem_er_32(void) -{ - uint data = read_imm_16(); - char buffer[40]; - uint first; - uint run_length; - uint i; - - buffer[0] = 0; - for(i=0;i<8;i++) - { - if(data&(1< 0) - sprintf(buffer+strlen(buffer), "-D%d", first + run_length); - } - } - for(i=0;i<8;i++) - { - if(data&(1<<(i+8))) - { - first = i; - run_length = 0; - while(i<7 && (data&(1<<(i+8+1)))) - { - i++; - run_length++; - } - if(buffer[0] != 0) - strcat(buffer, "/"); - sprintf(buffer+strlen(buffer), "A%d", first); - if(run_length > 0) - sprintf(buffer+strlen(buffer), "-A%d", first + run_length); - } - } - sprintf(g_dasm_str, "movem.l %s, %s", get_ea_mode_str_32(g_cpu_ir), buffer); -} - -static void d68000_movem_re_16(void) -{ - uint data = read_imm_16(); - char buffer[40]; - uint first; - uint run_length; - uint i; - - buffer[0] = 0; - for(i=0;i<8;i++) - { - if(data&(1< 0) - sprintf(buffer+strlen(buffer), "-D%d", first + run_length); - } - } - for(i=0;i<8;i++) - { - if(data&(1<<(i+8))) - { - first = i; - run_length = 0; - while(i<7 && (data&(1<<(i+8+1)))) - { - i++; - run_length++; - } - if(buffer[0] != 0) - strcat(buffer, "/"); - sprintf(buffer+strlen(buffer), "A%d", first); - if(run_length > 0) - sprintf(buffer+strlen(buffer), "-A%d", first + run_length); - } - } - sprintf(g_dasm_str, "movem.w %s, %s", buffer, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_movem_re_32(void) -{ - uint data = read_imm_16(); - char buffer[40]; - uint first; - uint run_length; - uint i; - - buffer[0] = 0; - for(i=0;i<8;i++) - { - if(data&(1< 0) - sprintf(buffer+strlen(buffer), "-D%d", first + run_length); - } - } - for(i=0;i<8;i++) - { - if(data&(1<<(i+8))) - { - first = i; - run_length = 0; - while(i<7 && (data&(1<<(i+8+1)))) - { - i++; - run_length++; - } - if(buffer[0] != 0) - strcat(buffer, "/"); - sprintf(buffer+strlen(buffer), "A%d", first); - if(run_length > 0) - sprintf(buffer+strlen(buffer), "-A%d", first + run_length); - } - } - sprintf(g_dasm_str, "movem.l %s, %s", buffer, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_movep_re_16(void) -{ - sprintf(g_dasm_str, "movep.w D%d, ($%x,A%d)", (g_cpu_ir>>9)&7, read_imm_16(), g_cpu_ir&7); -} - -static void d68000_movep_re_32(void) -{ - sprintf(g_dasm_str, "movep.l D%d, ($%x,A%d)", (g_cpu_ir>>9)&7, read_imm_16(), g_cpu_ir&7); -} - -static void d68000_movep_er_16(void) -{ - sprintf(g_dasm_str, "movep.w ($%x,A%d), D%d", read_imm_16(), g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_movep_er_32(void) -{ - sprintf(g_dasm_str, "movep.l ($%x,A%d), D%d", read_imm_16(), g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68010_moves_8(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68010_PLUS); - extension = read_imm_16(); - if(BIT_B(extension)) - sprintf(g_dasm_str, "moves.b %c%d, %s; (1+)", BIT_F(extension) ? 'A' : 'D', (extension>>12)&7, get_ea_mode_str_8(g_cpu_ir)); - else - sprintf(g_dasm_str, "moves.b %s, %c%d; (1+)", get_ea_mode_str_8(g_cpu_ir), BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); -} - -static void d68010_moves_16(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68010_PLUS); - extension = read_imm_16(); - if(BIT_B(extension)) - sprintf(g_dasm_str, "moves.w %c%d, %s; (1+)", BIT_F(extension) ? 'A' : 'D', (extension>>12)&7, get_ea_mode_str_16(g_cpu_ir)); - else - sprintf(g_dasm_str, "moves.w %s, %c%d; (1+)", get_ea_mode_str_16(g_cpu_ir), BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); -} - -static void d68010_moves_32(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68010_PLUS); - extension = read_imm_16(); - if(BIT_B(extension)) - sprintf(g_dasm_str, "moves.l %c%d, %s; (1+)", BIT_F(extension) ? 'A' : 'D', (extension>>12)&7, get_ea_mode_str_32(g_cpu_ir)); - else - sprintf(g_dasm_str, "moves.l %s, %c%d; (1+)", get_ea_mode_str_32(g_cpu_ir), BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); -} - -static void d68000_moveq(void) -{ - sprintf(g_dasm_str, "moveq #%s, D%d", make_signed_hex_str_8(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68040_move16_pi_pi(void) -{ - LIMIT_CPU_TYPES(M68040_PLUS); - sprintf(g_dasm_str, "move16 (A%d)+, (A%d)+; (4)", g_cpu_ir&7, (read_imm_16()>>12)&7); -} - -static void d68040_move16_pi_al(void) -{ - LIMIT_CPU_TYPES(M68040_PLUS); - sprintf(g_dasm_str, "move16 (A%d)+, %s; (4)", g_cpu_ir&7, get_imm_str_u32()); -} - -static void d68040_move16_al_pi(void) -{ - LIMIT_CPU_TYPES(M68040_PLUS); - sprintf(g_dasm_str, "move16 %s, (A%d)+; (4)", get_imm_str_u32(), g_cpu_ir&7); -} - -static void d68040_move16_ai_al(void) -{ - LIMIT_CPU_TYPES(M68040_PLUS); - sprintf(g_dasm_str, "move16 (A%d), %s; (4)", g_cpu_ir&7, get_imm_str_u32()); -} - -static void d68040_move16_al_ai(void) -{ - LIMIT_CPU_TYPES(M68040_PLUS); - sprintf(g_dasm_str, "move16 %s, (A%d); (4)", get_imm_str_u32(), g_cpu_ir&7); -} - -static void d68000_muls(void) -{ - sprintf(g_dasm_str, "muls.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_mulu(void) -{ - sprintf(g_dasm_str, "mulu.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68020_mull(void) -{ - uint extension; - LIMIT_CPU_TYPES(M68020_PLUS); - extension = read_imm_16(); - - if(BIT_A(extension)) - sprintf(g_dasm_str, "mul%c.l %s, D%d-D%d; (2+)", BIT_B(extension) ? 's' : 'u', get_ea_mode_str_32(g_cpu_ir), extension&7, (extension>>12)&7); - else - sprintf(g_dasm_str, "mul%c.l %s, D%d; (2+)", BIT_B(extension) ? 's' : 'u', get_ea_mode_str_32(g_cpu_ir), (extension>>12)&7); -} - -static void d68000_nbcd(void) -{ - sprintf(g_dasm_str, "nbcd %s", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_neg_8(void) -{ - sprintf(g_dasm_str, "neg.b %s", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_neg_16(void) -{ - sprintf(g_dasm_str, "neg.w %s", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_neg_32(void) -{ - sprintf(g_dasm_str, "neg.l %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_negx_8(void) -{ - sprintf(g_dasm_str, "negx.b %s", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_negx_16(void) -{ - sprintf(g_dasm_str, "negx.w %s", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_negx_32(void) -{ - sprintf(g_dasm_str, "negx.l %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_nop(void) -{ - sprintf(g_dasm_str, "nop"); -} - -static void d68000_not_8(void) -{ - sprintf(g_dasm_str, "not.b %s", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_not_16(void) -{ - sprintf(g_dasm_str, "not.w %s", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_not_32(void) -{ - sprintf(g_dasm_str, "not.l %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_or_er_8(void) -{ - sprintf(g_dasm_str, "or.b %s, D%d", get_ea_mode_str_8(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_or_er_16(void) -{ - sprintf(g_dasm_str, "or.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_or_er_32(void) -{ - sprintf(g_dasm_str, "or.l %s, D%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_or_re_8(void) -{ - sprintf(g_dasm_str, "or.b D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_or_re_16(void) -{ - sprintf(g_dasm_str, "or.w D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_or_re_32(void) -{ - sprintf(g_dasm_str, "or.l D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_ori_8(void) -{ - char* str = get_imm_str_u8(); - sprintf(g_dasm_str, "ori.b %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_ori_16(void) -{ - char* str = get_imm_str_u16(); - sprintf(g_dasm_str, "ori.w %s, %s", str, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_ori_32(void) -{ - char* str = get_imm_str_u32(); - sprintf(g_dasm_str, "ori.l %s, %s", str, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_ori_to_ccr(void) -{ - sprintf(g_dasm_str, "ori %s, CCR", get_imm_str_u8()); -} - -static void d68000_ori_to_sr(void) -{ - sprintf(g_dasm_str, "ori %s, SR", get_imm_str_u16()); -} - -static void d68020_pack_rr(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "pack D%d, D%d, %s; (2+)", g_cpu_ir&7, (g_cpu_ir>>9)&7, get_imm_str_u16()); -} - -static void d68020_pack_mm(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "pack -(A%d), -(A%d), %s; (2+)", g_cpu_ir&7, (g_cpu_ir>>9)&7, get_imm_str_u16()); -} - -static void d68000_pea(void) -{ - sprintf(g_dasm_str, "pea %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_reset(void) -{ - sprintf(g_dasm_str, "reset"); -} - -static void d68000_ror_s_8(void) -{ - sprintf(g_dasm_str, "ror.b #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_ror_s_16(void) -{ - sprintf(g_dasm_str, "ror.w #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7],g_cpu_ir&7); -} - -static void d68000_ror_s_32(void) -{ - sprintf(g_dasm_str, "ror.l #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_ror_r_8(void) -{ - sprintf(g_dasm_str, "ror.b D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_ror_r_16(void) -{ - sprintf(g_dasm_str, "ror.w D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_ror_r_32(void) -{ - sprintf(g_dasm_str, "ror.l D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_ror_ea(void) -{ - sprintf(g_dasm_str, "ror.w %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_rol_s_8(void) -{ - sprintf(g_dasm_str, "rol.b #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_rol_s_16(void) -{ - sprintf(g_dasm_str, "rol.w #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_rol_s_32(void) -{ - sprintf(g_dasm_str, "rol.l #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_rol_r_8(void) -{ - sprintf(g_dasm_str, "rol.b D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_rol_r_16(void) -{ - sprintf(g_dasm_str, "rol.w D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_rol_r_32(void) -{ - sprintf(g_dasm_str, "rol.l D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_rol_ea(void) -{ - sprintf(g_dasm_str, "rol.w %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_roxr_s_8(void) -{ - sprintf(g_dasm_str, "roxr.b #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_roxr_s_16(void) -{ - sprintf(g_dasm_str, "roxr.w #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - - -static void d68000_roxr_s_32(void) -{ - sprintf(g_dasm_str, "roxr.l #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_roxr_r_8(void) -{ - sprintf(g_dasm_str, "roxr.b D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_roxr_r_16(void) -{ - sprintf(g_dasm_str, "roxr.w D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_roxr_r_32(void) -{ - sprintf(g_dasm_str, "roxr.l D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_roxr_ea(void) -{ - sprintf(g_dasm_str, "roxr.w %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_roxl_s_8(void) -{ - sprintf(g_dasm_str, "roxl.b #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_roxl_s_16(void) -{ - sprintf(g_dasm_str, "roxl.w #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_roxl_s_32(void) -{ - sprintf(g_dasm_str, "roxl.l #%d, D%d", g_3bit_qdata_table[(g_cpu_ir>>9)&7], g_cpu_ir&7); -} - -static void d68000_roxl_r_8(void) -{ - sprintf(g_dasm_str, "roxl.b D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_roxl_r_16(void) -{ - sprintf(g_dasm_str, "roxl.w D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_roxl_r_32(void) -{ - sprintf(g_dasm_str, "roxl.l D%d, D%d", (g_cpu_ir>>9)&7, g_cpu_ir&7); -} - -static void d68000_roxl_ea(void) -{ - sprintf(g_dasm_str, "roxl.w %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68010_rtd(void) -{ - LIMIT_CPU_TYPES(M68010_PLUS); - sprintf(g_dasm_str, "rtd %s; (1+)", get_imm_str_s16()); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OUT); -} - -static void d68000_rte(void) -{ - sprintf(g_dasm_str, "rte"); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OUT); -} - -static void d68020_rtm(void) -{ - LIMIT_CPU_TYPES(M68020_ONLY); - sprintf(g_dasm_str, "rtm %c%d; (2+)", BIT_3(g_cpu_ir) ? 'A' : 'D', g_cpu_ir&7); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OUT); -} - -static void d68000_rtr(void) -{ - sprintf(g_dasm_str, "rtr"); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OUT); -} - -static void d68000_rts(void) -{ - sprintf(g_dasm_str, "rts"); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OUT); -} - -static void d68000_sbcd_rr(void) -{ - sprintf(g_dasm_str, "sbcd D%d, D%d", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_sbcd_mm(void) -{ - sprintf(g_dasm_str, "sbcd -(A%d), -(A%d)", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_scc(void) -{ - sprintf(g_dasm_str, "s%-2s %s", g_cc[(g_cpu_ir>>8)&0xf], get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_stop(void) -{ - sprintf(g_dasm_str, "stop %s", get_imm_str_s16()); -} - -static void d68000_sub_er_8(void) -{ - sprintf(g_dasm_str, "sub.b %s, D%d", get_ea_mode_str_8(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_sub_er_16(void) -{ - sprintf(g_dasm_str, "sub.w %s, D%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_sub_er_32(void) -{ - sprintf(g_dasm_str, "sub.l %s, D%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_sub_re_8(void) -{ - sprintf(g_dasm_str, "sub.b D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_sub_re_16(void) -{ - sprintf(g_dasm_str, "sub.w D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_sub_re_32(void) -{ - sprintf(g_dasm_str, "sub.l D%d, %s", (g_cpu_ir>>9)&7, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_suba_16(void) -{ - sprintf(g_dasm_str, "suba.w %s, A%d", get_ea_mode_str_16(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_suba_32(void) -{ - sprintf(g_dasm_str, "suba.l %s, A%d", get_ea_mode_str_32(g_cpu_ir), (g_cpu_ir>>9)&7); -} - -static void d68000_subi_8(void) -{ - char* str = get_imm_str_s8(); - sprintf(g_dasm_str, "subi.b %s, %s", str, get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_subi_16(void) -{ - char* str = get_imm_str_s16(); - sprintf(g_dasm_str, "subi.w %s, %s", str, get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_subi_32(void) -{ - char* str = get_imm_str_s32(); - sprintf(g_dasm_str, "subi.l %s, %s", str, get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_subq_8(void) -{ - sprintf(g_dasm_str, "subq.b #%d, %s", g_3bit_qdata_table[(g_cpu_ir>>9)&7], get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_subq_16(void) -{ - sprintf(g_dasm_str, "subq.w #%d, %s", g_3bit_qdata_table[(g_cpu_ir>>9)&7], get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_subq_32(void) -{ - sprintf(g_dasm_str, "subq.l #%d, %s", g_3bit_qdata_table[(g_cpu_ir>>9)&7], get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_subx_rr_8(void) -{ - sprintf(g_dasm_str, "subx.b D%d, D%d", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_subx_rr_16(void) -{ - sprintf(g_dasm_str, "subx.w D%d, D%d", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_subx_rr_32(void) -{ - sprintf(g_dasm_str, "subx.l D%d, D%d", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_subx_mm_8(void) -{ - sprintf(g_dasm_str, "subx.b -(A%d), -(A%d)", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_subx_mm_16(void) -{ - sprintf(g_dasm_str, "subx.w -(A%d), -(A%d)", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_subx_mm_32(void) -{ - sprintf(g_dasm_str, "subx.l -(A%d), -(A%d)", g_cpu_ir&7, (g_cpu_ir>>9)&7); -} - -static void d68000_swap(void) -{ - sprintf(g_dasm_str, "swap D%d", g_cpu_ir&7); -} - -static void d68000_tas(void) -{ - sprintf(g_dasm_str, "tas %s", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_trap(void) -{ - sprintf(g_dasm_str, "trap #$%x", g_cpu_ir&0xf); -} - -static void d68020_trapcc_0(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "trap%-2s; (2+)", g_cc[(g_cpu_ir>>8)&0xf]); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68020_trapcc_16(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "trap%-2s %s; (2+)", g_cc[(g_cpu_ir>>8)&0xf], get_imm_str_u16()); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68020_trapcc_32(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "trap%-2s %s; (2+)", g_cc[(g_cpu_ir>>8)&0xf], get_imm_str_u32()); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68000_trapv(void) -{ - sprintf(g_dasm_str, "trapv"); - SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); -} - -static void d68000_tst_8(void) -{ - sprintf(g_dasm_str, "tst.b %s", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_tst_pcdi_8(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.b %s; (2+)", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_tst_pcix_8(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.b %s; (2+)", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68020_tst_i_8(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.b %s; (2+)", get_ea_mode_str_8(g_cpu_ir)); -} - -static void d68000_tst_16(void) -{ - sprintf(g_dasm_str, "tst.w %s", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68020_tst_a_16(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.w %s; (2+)", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68020_tst_pcdi_16(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.w %s; (2+)", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68020_tst_pcix_16(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.w %s; (2+)", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68020_tst_i_16(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.w %s; (2+)", get_ea_mode_str_16(g_cpu_ir)); -} - -static void d68000_tst_32(void) -{ - sprintf(g_dasm_str, "tst.l %s", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68020_tst_a_32(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.l %s; (2+)", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68020_tst_pcdi_32(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.l %s; (2+)", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68020_tst_pcix_32(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.l %s; (2+)", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68020_tst_i_32(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "tst.l %s; (2+)", get_ea_mode_str_32(g_cpu_ir)); -} - -static void d68000_unlk(void) -{ - sprintf(g_dasm_str, "unlk A%d", g_cpu_ir&7); -} - -static void d68020_unpk_rr(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "unpk D%d, D%d, %s; (2+)", g_cpu_ir&7, (g_cpu_ir>>9)&7, get_imm_str_u16()); -} - -static void d68020_unpk_mm(void) -{ - LIMIT_CPU_TYPES(M68020_PLUS); - sprintf(g_dasm_str, "unpk -(A%d), -(A%d), %s; (2+)", g_cpu_ir&7, (g_cpu_ir>>9)&7, get_imm_str_u16()); -} - - - -/* ======================================================================== */ -/* ======================= INSTRUCTION TABLE BUILDER ====================== */ -/* ======================================================================== */ - -/* EA Masks: -800 = data register direct -400 = address register direct -200 = address register indirect -100 = ARI postincrement - 80 = ARI pre-decrement - 40 = ARI displacement - 20 = ARI index - 10 = absolute short - 8 = absolute long - 4 = immediate / sr - 2 = pc displacement - 1 = pc idx -*/ - -static opcode_struct g_opcode_info[] = -{ -/* opcode handler mask match ea mask */ - {d68000_1010 , 0xf000, 0xa000, 0x000}, - {d68000_1111 , 0xf000, 0xf000, 0x000}, - {d68000_abcd_rr , 0xf1f8, 0xc100, 0x000}, - {d68000_abcd_mm , 0xf1f8, 0xc108, 0x000}, - {d68000_add_er_8 , 0xf1c0, 0xd000, 0xbff}, - {d68000_add_er_16 , 0xf1c0, 0xd040, 0xfff}, - {d68000_add_er_32 , 0xf1c0, 0xd080, 0xfff}, - {d68000_add_re_8 , 0xf1c0, 0xd100, 0x3f8}, - {d68000_add_re_16 , 0xf1c0, 0xd140, 0x3f8}, - {d68000_add_re_32 , 0xf1c0, 0xd180, 0x3f8}, - {d68000_adda_16 , 0xf1c0, 0xd0c0, 0xfff}, - {d68000_adda_32 , 0xf1c0, 0xd1c0, 0xfff}, - {d68000_addi_8 , 0xffc0, 0x0600, 0xbf8}, - {d68000_addi_16 , 0xffc0, 0x0640, 0xbf8}, - {d68000_addi_32 , 0xffc0, 0x0680, 0xbf8}, - {d68000_addq_8 , 0xf1c0, 0x5000, 0xbf8}, - {d68000_addq_16 , 0xf1c0, 0x5040, 0xff8}, - {d68000_addq_32 , 0xf1c0, 0x5080, 0xff8}, - {d68000_addx_rr_8 , 0xf1f8, 0xd100, 0x000}, - {d68000_addx_rr_16 , 0xf1f8, 0xd140, 0x000}, - {d68000_addx_rr_32 , 0xf1f8, 0xd180, 0x000}, - {d68000_addx_mm_8 , 0xf1f8, 0xd108, 0x000}, - {d68000_addx_mm_16 , 0xf1f8, 0xd148, 0x000}, - {d68000_addx_mm_32 , 0xf1f8, 0xd188, 0x000}, - {d68000_and_er_8 , 0xf1c0, 0xc000, 0xbff}, - {d68000_and_er_16 , 0xf1c0, 0xc040, 0xbff}, - {d68000_and_er_32 , 0xf1c0, 0xc080, 0xbff}, - {d68000_and_re_8 , 0xf1c0, 0xc100, 0x3f8}, - {d68000_and_re_16 , 0xf1c0, 0xc140, 0x3f8}, - {d68000_and_re_32 , 0xf1c0, 0xc180, 0x3f8}, - {d68000_andi_to_ccr , 0xffff, 0x023c, 0x000}, - {d68000_andi_to_sr , 0xffff, 0x027c, 0x000}, - {d68000_andi_8 , 0xffc0, 0x0200, 0xbf8}, - {d68000_andi_16 , 0xffc0, 0x0240, 0xbf8}, - {d68000_andi_32 , 0xffc0, 0x0280, 0xbf8}, - {d68000_asr_s_8 , 0xf1f8, 0xe000, 0x000}, - {d68000_asr_s_16 , 0xf1f8, 0xe040, 0x000}, - {d68000_asr_s_32 , 0xf1f8, 0xe080, 0x000}, - {d68000_asr_r_8 , 0xf1f8, 0xe020, 0x000}, - {d68000_asr_r_16 , 0xf1f8, 0xe060, 0x000}, - {d68000_asr_r_32 , 0xf1f8, 0xe0a0, 0x000}, - {d68000_asr_ea , 0xffc0, 0xe0c0, 0x3f8}, - {d68000_asl_s_8 , 0xf1f8, 0xe100, 0x000}, - {d68000_asl_s_16 , 0xf1f8, 0xe140, 0x000}, - {d68000_asl_s_32 , 0xf1f8, 0xe180, 0x000}, - {d68000_asl_r_8 , 0xf1f8, 0xe120, 0x000}, - {d68000_asl_r_16 , 0xf1f8, 0xe160, 0x000}, - {d68000_asl_r_32 , 0xf1f8, 0xe1a0, 0x000}, - {d68000_asl_ea , 0xffc0, 0xe1c0, 0x3f8}, - {d68000_bcc_8 , 0xf000, 0x6000, 0x000}, - {d68000_bcc_16 , 0xf0ff, 0x6000, 0x000}, - {d68020_bcc_32 , 0xf0ff, 0x60ff, 0x000}, - {d68000_bchg_r , 0xf1c0, 0x0140, 0xbf8}, - {d68000_bchg_s , 0xffc0, 0x0840, 0xbf8}, - {d68000_bclr_r , 0xf1c0, 0x0180, 0xbf8}, - {d68000_bclr_s , 0xffc0, 0x0880, 0xbf8}, - {d68020_bfchg , 0xffc0, 0xeac0, 0xa78}, - {d68020_bfclr , 0xffc0, 0xecc0, 0xa78}, - {d68020_bfexts , 0xffc0, 0xebc0, 0xa7b}, - {d68020_bfextu , 0xffc0, 0xe9c0, 0xa7b}, - {d68020_bfffo , 0xffc0, 0xedc0, 0xa7b}, - {d68020_bfins , 0xffc0, 0xefc0, 0xa78}, - {d68020_bfset , 0xffc0, 0xeec0, 0xa78}, - {d68020_bftst , 0xffc0, 0xe8c0, 0xa7b}, - {d68010_bkpt , 0xfff8, 0x4848, 0x000}, - {d68000_bra_8 , 0xff00, 0x6000, 0x000}, - {d68000_bra_16 , 0xffff, 0x6000, 0x000}, - {d68020_bra_32 , 0xffff, 0x60ff, 0x000}, - {d68000_bset_r , 0xf1c0, 0x01c0, 0xbf8}, - {d68000_bset_s , 0xffc0, 0x08c0, 0xbf8}, - {d68000_bsr_8 , 0xff00, 0x6100, 0x000}, - {d68000_bsr_16 , 0xffff, 0x6100, 0x000}, - {d68020_bsr_32 , 0xffff, 0x61ff, 0x000}, - {d68000_btst_r , 0xf1c0, 0x0100, 0xbff}, - {d68000_btst_s , 0xffc0, 0x0800, 0xbfb}, - {d68020_callm , 0xffc0, 0x06c0, 0x27b}, - {d68020_cas_8 , 0xffc0, 0x0ac0, 0x3f8}, - {d68020_cas_16 , 0xffc0, 0x0cc0, 0x3f8}, - {d68020_cas_32 , 0xffc0, 0x0ec0, 0x3f8}, - {d68020_cas2_16 , 0xffff, 0x0cfc, 0x000}, - {d68020_cas2_32 , 0xffff, 0x0efc, 0x000}, - {d68000_chk_16 , 0xf1c0, 0x4180, 0xbff}, - {d68020_chk_32 , 0xf1c0, 0x4100, 0xbff}, - {d68020_chk2_cmp2_8 , 0xffc0, 0x00c0, 0x27b}, - {d68020_chk2_cmp2_16 , 0xffc0, 0x02c0, 0x27b}, - {d68020_chk2_cmp2_32 , 0xffc0, 0x04c0, 0x27b}, - {d68040_cinv , 0xff20, 0xf400, 0x000}, - {d68000_clr_8 , 0xffc0, 0x4200, 0xbf8}, - {d68000_clr_16 , 0xffc0, 0x4240, 0xbf8}, - {d68000_clr_32 , 0xffc0, 0x4280, 0xbf8}, - {d68000_cmp_8 , 0xf1c0, 0xb000, 0xbff}, - {d68000_cmp_16 , 0xf1c0, 0xb040, 0xfff}, - {d68000_cmp_32 , 0xf1c0, 0xb080, 0xfff}, - {d68000_cmpa_16 , 0xf1c0, 0xb0c0, 0xfff}, - {d68000_cmpa_32 , 0xf1c0, 0xb1c0, 0xfff}, - {d68000_cmpi_8 , 0xffc0, 0x0c00, 0xbf8}, - {d68020_cmpi_pcdi_8 , 0xffff, 0x0c3a, 0x000}, - {d68020_cmpi_pcix_8 , 0xffff, 0x0c3b, 0x000}, - {d68000_cmpi_16 , 0xffc0, 0x0c40, 0xbf8}, - {d68020_cmpi_pcdi_16 , 0xffff, 0x0c7a, 0x000}, - {d68020_cmpi_pcix_16 , 0xffff, 0x0c7b, 0x000}, - {d68000_cmpi_32 , 0xffc0, 0x0c80, 0xbf8}, - {d68020_cmpi_pcdi_32 , 0xffff, 0x0cba, 0x000}, - {d68020_cmpi_pcix_32 , 0xffff, 0x0cbb, 0x000}, - {d68000_cmpm_8 , 0xf1f8, 0xb108, 0x000}, - {d68000_cmpm_16 , 0xf1f8, 0xb148, 0x000}, - {d68000_cmpm_32 , 0xf1f8, 0xb188, 0x000}, - {d68020_cpbcc_16 , 0xf1c0, 0xf080, 0x000}, - {d68020_cpbcc_32 , 0xf1c0, 0xf0c0, 0x000}, - {d68020_cpdbcc , 0xf1f8, 0xf048, 0x000}, - {d68020_cpgen , 0xf1c0, 0xf000, 0x000}, - {d68020_cprestore , 0xf1c0, 0xf140, 0x37f}, - {d68020_cpsave , 0xf1c0, 0xf100, 0x2f8}, - {d68020_cpscc , 0xf1c0, 0xf040, 0xbf8}, - {d68020_cptrapcc_0 , 0xf1ff, 0xf07c, 0x000}, - {d68020_cptrapcc_16 , 0xf1ff, 0xf07a, 0x000}, - {d68020_cptrapcc_32 , 0xf1ff, 0xf07b, 0x000}, - {d68040_cpush , 0xff20, 0xf420, 0x000}, - {d68000_dbcc , 0xf0f8, 0x50c8, 0x000}, - {d68000_dbra , 0xfff8, 0x51c8, 0x000}, - {d68000_divs , 0xf1c0, 0x81c0, 0xbff}, - {d68000_divu , 0xf1c0, 0x80c0, 0xbff}, - {d68020_divl , 0xffc0, 0x4c40, 0xbff}, - {d68000_eor_8 , 0xf1c0, 0xb100, 0xbf8}, - {d68000_eor_16 , 0xf1c0, 0xb140, 0xbf8}, - {d68000_eor_32 , 0xf1c0, 0xb180, 0xbf8}, - {d68000_eori_to_ccr , 0xffff, 0x0a3c, 0x000}, - {d68000_eori_to_sr , 0xffff, 0x0a7c, 0x000}, - {d68000_eori_8 , 0xffc0, 0x0a00, 0xbf8}, - {d68000_eori_16 , 0xffc0, 0x0a40, 0xbf8}, - {d68000_eori_32 , 0xffc0, 0x0a80, 0xbf8}, - {d68000_exg_dd , 0xf1f8, 0xc140, 0x000}, - {d68000_exg_aa , 0xf1f8, 0xc148, 0x000}, - {d68000_exg_da , 0xf1f8, 0xc188, 0x000}, - {d68020_extb_32 , 0xfff8, 0x49c0, 0x000}, - {d68000_ext_16 , 0xfff8, 0x4880, 0x000}, - {d68000_ext_32 , 0xfff8, 0x48c0, 0x000}, - {d68000_illegal , 0xffff, 0x4afc, 0x000}, - {d68000_jmp , 0xffc0, 0x4ec0, 0x27b}, - {d68000_jsr , 0xffc0, 0x4e80, 0x27b}, - {d68000_lea , 0xf1c0, 0x41c0, 0x27b}, - {d68000_link_16 , 0xfff8, 0x4e50, 0x000}, - {d68020_link_32 , 0xfff8, 0x4808, 0x000}, - {d68000_lsr_s_8 , 0xf1f8, 0xe008, 0x000}, - {d68000_lsr_s_16 , 0xf1f8, 0xe048, 0x000}, - {d68000_lsr_s_32 , 0xf1f8, 0xe088, 0x000}, - {d68000_lsr_r_8 , 0xf1f8, 0xe028, 0x000}, - {d68000_lsr_r_16 , 0xf1f8, 0xe068, 0x000}, - {d68000_lsr_r_32 , 0xf1f8, 0xe0a8, 0x000}, - {d68000_lsr_ea , 0xffc0, 0xe2c0, 0x3f8}, - {d68000_lsl_s_8 , 0xf1f8, 0xe108, 0x000}, - {d68000_lsl_s_16 , 0xf1f8, 0xe148, 0x000}, - {d68000_lsl_s_32 , 0xf1f8, 0xe188, 0x000}, - {d68000_lsl_r_8 , 0xf1f8, 0xe128, 0x000}, - {d68000_lsl_r_16 , 0xf1f8, 0xe168, 0x000}, - {d68000_lsl_r_32 , 0xf1f8, 0xe1a8, 0x000}, - {d68000_lsl_ea , 0xffc0, 0xe3c0, 0x3f8}, - {d68000_move_8 , 0xf000, 0x1000, 0xbff}, - {d68000_move_16 , 0xf000, 0x3000, 0xfff}, - {d68000_move_32 , 0xf000, 0x2000, 0xfff}, - {d68000_movea_16 , 0xf1c0, 0x3040, 0xfff}, - {d68000_movea_32 , 0xf1c0, 0x2040, 0xfff}, - {d68000_move_to_ccr , 0xffc0, 0x44c0, 0xbff}, - {d68010_move_fr_ccr , 0xffc0, 0x42c0, 0xbf8}, - {d68000_move_to_sr , 0xffc0, 0x46c0, 0xbff}, - {d68000_move_fr_sr , 0xffc0, 0x40c0, 0xbf8}, - {d68000_move_to_usp , 0xfff8, 0x4e60, 0x000}, - {d68000_move_fr_usp , 0xfff8, 0x4e68, 0x000}, - {d68010_movec , 0xfffe, 0x4e7a, 0x000}, - {d68000_movem_pd_16 , 0xfff8, 0x48a0, 0x000}, - {d68000_movem_pd_32 , 0xfff8, 0x48e0, 0x000}, - {d68000_movem_re_16 , 0xffc0, 0x4880, 0x2f8}, - {d68000_movem_re_32 , 0xffc0, 0x48c0, 0x2f8}, - {d68000_movem_er_16 , 0xffc0, 0x4c80, 0x37b}, - {d68000_movem_er_32 , 0xffc0, 0x4cc0, 0x37b}, - {d68000_movep_er_16 , 0xf1f8, 0x0108, 0x000}, - {d68000_movep_er_32 , 0xf1f8, 0x0148, 0x000}, - {d68000_movep_re_16 , 0xf1f8, 0x0188, 0x000}, - {d68000_movep_re_32 , 0xf1f8, 0x01c8, 0x000}, - {d68010_moves_8 , 0xffc0, 0x0e00, 0x3f8}, - {d68010_moves_16 , 0xffc0, 0x0e40, 0x3f8}, - {d68010_moves_32 , 0xffc0, 0x0e80, 0x3f8}, - {d68000_moveq , 0xf100, 0x7000, 0x000}, - {d68040_move16_pi_pi , 0xfff8, 0xf620, 0x000}, - {d68040_move16_pi_al , 0xfff8, 0xf600, 0x000}, - {d68040_move16_al_pi , 0xfff8, 0xf608, 0x000}, - {d68040_move16_ai_al , 0xfff8, 0xf610, 0x000}, - {d68040_move16_al_ai , 0xfff8, 0xf618, 0x000}, - {d68000_muls , 0xf1c0, 0xc1c0, 0xbff}, - {d68000_mulu , 0xf1c0, 0xc0c0, 0xbff}, - {d68020_mull , 0xffc0, 0x4c00, 0xbff}, - {d68000_nbcd , 0xffc0, 0x4800, 0xbf8}, - {d68000_neg_8 , 0xffc0, 0x4400, 0xbf8}, - {d68000_neg_16 , 0xffc0, 0x4440, 0xbf8}, - {d68000_neg_32 , 0xffc0, 0x4480, 0xbf8}, - {d68000_negx_8 , 0xffc0, 0x4000, 0xbf8}, - {d68000_negx_16 , 0xffc0, 0x4040, 0xbf8}, - {d68000_negx_32 , 0xffc0, 0x4080, 0xbf8}, - {d68000_nop , 0xffff, 0x4e71, 0x000}, - {d68000_not_8 , 0xffc0, 0x4600, 0xbf8}, - {d68000_not_16 , 0xffc0, 0x4640, 0xbf8}, - {d68000_not_32 , 0xffc0, 0x4680, 0xbf8}, - {d68000_or_er_8 , 0xf1c0, 0x8000, 0xbff}, - {d68000_or_er_16 , 0xf1c0, 0x8040, 0xbff}, - {d68000_or_er_32 , 0xf1c0, 0x8080, 0xbff}, - {d68000_or_re_8 , 0xf1c0, 0x8100, 0x3f8}, - {d68000_or_re_16 , 0xf1c0, 0x8140, 0x3f8}, - {d68000_or_re_32 , 0xf1c0, 0x8180, 0x3f8}, - {d68000_ori_to_ccr , 0xffff, 0x003c, 0x000}, - {d68000_ori_to_sr , 0xffff, 0x007c, 0x000}, - {d68000_ori_8 , 0xffc0, 0x0000, 0xbf8}, - {d68000_ori_16 , 0xffc0, 0x0040, 0xbf8}, - {d68000_ori_32 , 0xffc0, 0x0080, 0xbf8}, - {d68020_pack_rr , 0xf1f8, 0x8140, 0x000}, - {d68020_pack_mm , 0xf1f8, 0x8148, 0x000}, - {d68000_pea , 0xffc0, 0x4840, 0x27b}, - {d68000_reset , 0xffff, 0x4e70, 0x000}, - {d68000_ror_s_8 , 0xf1f8, 0xe018, 0x000}, - {d68000_ror_s_16 , 0xf1f8, 0xe058, 0x000}, - {d68000_ror_s_32 , 0xf1f8, 0xe098, 0x000}, - {d68000_ror_r_8 , 0xf1f8, 0xe038, 0x000}, - {d68000_ror_r_16 , 0xf1f8, 0xe078, 0x000}, - {d68000_ror_r_32 , 0xf1f8, 0xe0b8, 0x000}, - {d68000_ror_ea , 0xffc0, 0xe6c0, 0x3f8}, - {d68000_rol_s_8 , 0xf1f8, 0xe118, 0x000}, - {d68000_rol_s_16 , 0xf1f8, 0xe158, 0x000}, - {d68000_rol_s_32 , 0xf1f8, 0xe198, 0x000}, - {d68000_rol_r_8 , 0xf1f8, 0xe138, 0x000}, - {d68000_rol_r_16 , 0xf1f8, 0xe178, 0x000}, - {d68000_rol_r_32 , 0xf1f8, 0xe1b8, 0x000}, - {d68000_rol_ea , 0xffc0, 0xe7c0, 0x3f8}, - {d68000_roxr_s_8 , 0xf1f8, 0xe010, 0x000}, - {d68000_roxr_s_16 , 0xf1f8, 0xe050, 0x000}, - {d68000_roxr_s_32 , 0xf1f8, 0xe090, 0x000}, - {d68000_roxr_r_8 , 0xf1f8, 0xe030, 0x000}, - {d68000_roxr_r_16 , 0xf1f8, 0xe070, 0x000}, - {d68000_roxr_r_32 , 0xf1f8, 0xe0b0, 0x000}, - {d68000_roxr_ea , 0xffc0, 0xe4c0, 0x3f8}, - {d68000_roxl_s_8 , 0xf1f8, 0xe110, 0x000}, - {d68000_roxl_s_16 , 0xf1f8, 0xe150, 0x000}, - {d68000_roxl_s_32 , 0xf1f8, 0xe190, 0x000}, - {d68000_roxl_r_8 , 0xf1f8, 0xe130, 0x000}, - {d68000_roxl_r_16 , 0xf1f8, 0xe170, 0x000}, - {d68000_roxl_r_32 , 0xf1f8, 0xe1b0, 0x000}, - {d68000_roxl_ea , 0xffc0, 0xe5c0, 0x3f8}, - {d68010_rtd , 0xffff, 0x4e74, 0x000}, - {d68000_rte , 0xffff, 0x4e73, 0x000}, - {d68020_rtm , 0xfff0, 0x06c0, 0x000}, - {d68000_rtr , 0xffff, 0x4e77, 0x000}, - {d68000_rts , 0xffff, 0x4e75, 0x000}, - {d68000_sbcd_rr , 0xf1f8, 0x8100, 0x000}, - {d68000_sbcd_mm , 0xf1f8, 0x8108, 0x000}, - {d68000_scc , 0xf0c0, 0x50c0, 0xbf8}, - {d68000_stop , 0xffff, 0x4e72, 0x000}, - {d68000_sub_er_8 , 0xf1c0, 0x9000, 0xbff}, - {d68000_sub_er_16 , 0xf1c0, 0x9040, 0xfff}, - {d68000_sub_er_32 , 0xf1c0, 0x9080, 0xfff}, - {d68000_sub_re_8 , 0xf1c0, 0x9100, 0x3f8}, - {d68000_sub_re_16 , 0xf1c0, 0x9140, 0x3f8}, - {d68000_sub_re_32 , 0xf1c0, 0x9180, 0x3f8}, - {d68000_suba_16 , 0xf1c0, 0x90c0, 0xfff}, - {d68000_suba_32 , 0xf1c0, 0x91c0, 0xfff}, - {d68000_subi_8 , 0xffc0, 0x0400, 0xbf8}, - {d68000_subi_16 , 0xffc0, 0x0440, 0xbf8}, - {d68000_subi_32 , 0xffc0, 0x0480, 0xbf8}, - {d68000_subq_8 , 0xf1c0, 0x5100, 0xbf8}, - {d68000_subq_16 , 0xf1c0, 0x5140, 0xff8}, - {d68000_subq_32 , 0xf1c0, 0x5180, 0xff8}, - {d68000_subx_rr_8 , 0xf1f8, 0x9100, 0x000}, - {d68000_subx_rr_16 , 0xf1f8, 0x9140, 0x000}, - {d68000_subx_rr_32 , 0xf1f8, 0x9180, 0x000}, - {d68000_subx_mm_8 , 0xf1f8, 0x9108, 0x000}, - {d68000_subx_mm_16 , 0xf1f8, 0x9148, 0x000}, - {d68000_subx_mm_32 , 0xf1f8, 0x9188, 0x000}, - {d68000_swap , 0xfff8, 0x4840, 0x000}, - {d68000_tas , 0xffc0, 0x4ac0, 0xbf8}, - {d68000_trap , 0xfff0, 0x4e40, 0x000}, - {d68020_trapcc_0 , 0xf0ff, 0x50fc, 0x000}, - {d68020_trapcc_16 , 0xf0ff, 0x50fa, 0x000}, - {d68020_trapcc_32 , 0xf0ff, 0x50fb, 0x000}, - {d68000_trapv , 0xffff, 0x4e76, 0x000}, - {d68000_tst_8 , 0xffc0, 0x4a00, 0xbf8}, - {d68020_tst_pcdi_8 , 0xffff, 0x4a3a, 0x000}, - {d68020_tst_pcix_8 , 0xffff, 0x4a3b, 0x000}, - {d68020_tst_i_8 , 0xffff, 0x4a3c, 0x000}, - {d68000_tst_16 , 0xffc0, 0x4a40, 0xbf8}, - {d68020_tst_a_16 , 0xfff8, 0x4a48, 0x000}, - {d68020_tst_pcdi_16 , 0xffff, 0x4a7a, 0x000}, - {d68020_tst_pcix_16 , 0xffff, 0x4a7b, 0x000}, - {d68020_tst_i_16 , 0xffff, 0x4a7c, 0x000}, - {d68000_tst_32 , 0xffc0, 0x4a80, 0xbf8}, - {d68020_tst_a_32 , 0xfff8, 0x4a88, 0x000}, - {d68020_tst_pcdi_32 , 0xffff, 0x4aba, 0x000}, - {d68020_tst_pcix_32 , 0xffff, 0x4abb, 0x000}, - {d68020_tst_i_32 , 0xffff, 0x4abc, 0x000}, - {d68000_unlk , 0xfff8, 0x4e58, 0x000}, - {d68020_unpk_rr , 0xf1f8, 0x8180, 0x000}, - {d68020_unpk_mm , 0xf1f8, 0x8188, 0x000}, - {0, 0, 0, 0} -}; - -/* Check if opcode is using a valid ea mode */ -static int valid_ea(uint opcode, uint mask) -{ - if(mask == 0) - return 1; - - switch(opcode & 0x3f) - { - case 0x00: case 0x01: case 0x02: case 0x03: - case 0x04: case 0x05: case 0x06: case 0x07: - return (mask & 0x800) != 0; - case 0x08: case 0x09: case 0x0a: case 0x0b: - case 0x0c: case 0x0d: case 0x0e: case 0x0f: - return (mask & 0x400) != 0; - case 0x10: case 0x11: case 0x12: case 0x13: - case 0x14: case 0x15: case 0x16: case 0x17: - return (mask & 0x200) != 0; - case 0x18: case 0x19: case 0x1a: case 0x1b: - case 0x1c: case 0x1d: case 0x1e: case 0x1f: - return (mask & 0x100) != 0; - case 0x20: case 0x21: case 0x22: case 0x23: - case 0x24: case 0x25: case 0x26: case 0x27: - return (mask & 0x080) != 0; - case 0x28: case 0x29: case 0x2a: case 0x2b: - case 0x2c: case 0x2d: case 0x2e: case 0x2f: - return (mask & 0x040) != 0; - case 0x30: case 0x31: case 0x32: case 0x33: - case 0x34: case 0x35: case 0x36: case 0x37: - return (mask & 0x020) != 0; - case 0x38: - return (mask & 0x010) != 0; - case 0x39: - return (mask & 0x008) != 0; - case 0x3a: - return (mask & 0x002) != 0; - case 0x3b: - return (mask & 0x001) != 0; - case 0x3c: - return (mask & 0x004) != 0; - } - return 0; - -} - -/* Used by qsort */ -static int DECL_SPEC compare_nof_true_bits(const void *aptr, const void *bptr) -{ - uint a = ((const opcode_struct*)aptr)->mask; - uint b = ((const opcode_struct*)bptr)->mask; - - a = ((a & 0xAAAA) >> 1) + (a & 0x5555); - a = ((a & 0xCCCC) >> 2) + (a & 0x3333); - a = ((a & 0xF0F0) >> 4) + (a & 0x0F0F); - a = ((a & 0xFF00) >> 8) + (a & 0x00FF); - - b = ((b & 0xAAAA) >> 1) + (b & 0x5555); - b = ((b & 0xCCCC) >> 2) + (b & 0x3333); - b = ((b & 0xF0F0) >> 4) + (b & 0x0F0F); - b = ((b & 0xFF00) >> 8) + (b & 0x00FF); - - return b - a; /* reversed to get greatest to least sorting */ -} - -/* build the opcode handler jump table */ -static void build_opcode_table(void) -{ - uint i; - uint opcode; - opcode_struct* ostruct; - uint opcode_info_length = 0; - - for(ostruct = g_opcode_info;ostruct->opcode_handler != 0;ostruct++) - opcode_info_length++; - - qsort((void *)g_opcode_info, opcode_info_length, sizeof(g_opcode_info[0]), compare_nof_true_bits); - - for(i=0;i<0x10000;i++) - { - g_instruction_table[i] = d68000_illegal; /* default to illegal */ - opcode = i; - /* search through opcode info for a match */ - for(ostruct = g_opcode_info;ostruct->opcode_handler != 0;ostruct++) - { - /* match opcode mask and allowed ea modes */ - if((opcode & ostruct->mask) == ostruct->match) - { - /* Handle destination ea for move instructions */ - if((ostruct->opcode_handler == d68000_move_8 || - ostruct->opcode_handler == d68000_move_16 || - ostruct->opcode_handler == d68000_move_32) && - !valid_ea(((opcode>>9)&7) | ((opcode>>3)&0x38), 0xbf8)) - continue; - if(valid_ea(opcode, ostruct->ea_mask)) - { - g_instruction_table[i] = ostruct->opcode_handler; - break; - } - } - } - } -} - - - -/* ======================================================================== */ -/* ================================= API ================================== */ -/* ======================================================================== */ - -/* Disasemble one instruction at pc and store in str_buff */ -unsigned int m68k_disassemble(char* str_buff, unsigned int pc, unsigned int cpu_type) -{ - if(!g_initialized) - { - build_opcode_table(); - g_initialized = 1; - } - switch(cpu_type) - { - case M68K_CPU_TYPE_68000: - g_cpu_type = TYPE_68000; - g_address_mask = 0x00ffffff; - break; - case M68K_CPU_TYPE_68008: - g_cpu_type = TYPE_68008; - g_address_mask = 0x003fffff; - break; - case M68K_CPU_TYPE_68010: - g_cpu_type = TYPE_68010; - g_address_mask = 0x00ffffff; - break; - case M68K_CPU_TYPE_68EC020: - g_cpu_type = TYPE_68020; - g_address_mask = 0x00ffffff; - break; - case M68K_CPU_TYPE_68020: - g_cpu_type = TYPE_68020; - g_address_mask = 0xffffffff; - break; - case M68K_CPU_TYPE_68030: - g_cpu_type = TYPE_68030; - g_address_mask = 0xffffffff; - break; - case M68K_CPU_TYPE_68040: - g_cpu_type = TYPE_68040; - g_address_mask = 0xffffffff; - break; - default: - return 0; - } - - g_cpu_pc = pc; - g_helper_str[0] = 0; - g_cpu_ir = read_imm_16(); - g_opcode_type = 0; - g_instruction_table[g_cpu_ir](); - sprintf(str_buff, "%s%s", g_dasm_str, g_helper_str); - return COMBINE_OPCODE_FLAGS(g_cpu_pc - pc); -} - -char* m68ki_disassemble_quick(unsigned int pc, unsigned int cpu_type) -{ - static char buff[100]; - buff[0] = 0; - m68k_disassemble(buff, pc, cpu_type); - return buff; -} - -/* Check if the instruction is a valid one */ -unsigned int m68k_is_valid_instruction(unsigned int instruction, unsigned int cpu_type) -{ - if(!g_initialized) - { - build_opcode_table(); - g_initialized = 1; - } - - instruction &= 0xffff; - if(g_instruction_table[instruction] == d68000_illegal) - return 0; - - switch(cpu_type) - { - case M68K_CPU_TYPE_68000: - case M68K_CPU_TYPE_68008: - if(g_instruction_table[instruction] == d68010_bkpt) - return 0; - if(g_instruction_table[instruction] == d68010_move_fr_ccr) - return 0; - if(g_instruction_table[instruction] == d68010_movec) - return 0; - if(g_instruction_table[instruction] == d68010_moves_8) - return 0; - if(g_instruction_table[instruction] == d68010_moves_16) - return 0; - if(g_instruction_table[instruction] == d68010_moves_32) - return 0; - if(g_instruction_table[instruction] == d68010_rtd) - return 0; - case M68K_CPU_TYPE_68010: - if(g_instruction_table[instruction] == d68020_bcc_32) - return 0; - if(g_instruction_table[instruction] == d68020_bfchg) - return 0; - if(g_instruction_table[instruction] == d68020_bfclr) - return 0; - if(g_instruction_table[instruction] == d68020_bfexts) - return 0; - if(g_instruction_table[instruction] == d68020_bfextu) - return 0; - if(g_instruction_table[instruction] == d68020_bfffo) - return 0; - if(g_instruction_table[instruction] == d68020_bfins) - return 0; - if(g_instruction_table[instruction] == d68020_bfset) - return 0; - if(g_instruction_table[instruction] == d68020_bftst) - return 0; - if(g_instruction_table[instruction] == d68020_bra_32) - return 0; - if(g_instruction_table[instruction] == d68020_bsr_32) - return 0; - if(g_instruction_table[instruction] == d68020_callm) - return 0; - if(g_instruction_table[instruction] == d68020_cas_8) - return 0; - if(g_instruction_table[instruction] == d68020_cas_16) - return 0; - if(g_instruction_table[instruction] == d68020_cas_32) - return 0; - if(g_instruction_table[instruction] == d68020_cas2_16) - return 0; - if(g_instruction_table[instruction] == d68020_cas2_32) - return 0; - if(g_instruction_table[instruction] == d68020_chk_32) - return 0; - if(g_instruction_table[instruction] == d68020_chk2_cmp2_8) - return 0; - if(g_instruction_table[instruction] == d68020_chk2_cmp2_16) - return 0; - if(g_instruction_table[instruction] == d68020_chk2_cmp2_32) - return 0; - if(g_instruction_table[instruction] == d68020_cmpi_pcdi_8) - return 0; - if(g_instruction_table[instruction] == d68020_cmpi_pcix_8) - return 0; - if(g_instruction_table[instruction] == d68020_cmpi_pcdi_16) - return 0; - if(g_instruction_table[instruction] == d68020_cmpi_pcix_16) - return 0; - if(g_instruction_table[instruction] == d68020_cmpi_pcdi_32) - return 0; - if(g_instruction_table[instruction] == d68020_cmpi_pcix_32) - return 0; - if(g_instruction_table[instruction] == d68020_cpbcc_16) - return 0; - if(g_instruction_table[instruction] == d68020_cpbcc_32) - return 0; - if(g_instruction_table[instruction] == d68020_cpdbcc) - return 0; - if(g_instruction_table[instruction] == d68020_cpgen) - return 0; - if(g_instruction_table[instruction] == d68020_cprestore) - return 0; - if(g_instruction_table[instruction] == d68020_cpsave) - return 0; - if(g_instruction_table[instruction] == d68020_cpscc) - return 0; - if(g_instruction_table[instruction] == d68020_cptrapcc_0) - return 0; - if(g_instruction_table[instruction] == d68020_cptrapcc_16) - return 0; - if(g_instruction_table[instruction] == d68020_cptrapcc_32) - return 0; - if(g_instruction_table[instruction] == d68020_divl) - return 0; - if(g_instruction_table[instruction] == d68020_extb_32) - return 0; - if(g_instruction_table[instruction] == d68020_link_32) - return 0; - if(g_instruction_table[instruction] == d68020_mull) - return 0; - if(g_instruction_table[instruction] == d68020_pack_rr) - return 0; - if(g_instruction_table[instruction] == d68020_pack_mm) - return 0; - if(g_instruction_table[instruction] == d68020_rtm) - return 0; - if(g_instruction_table[instruction] == d68020_trapcc_0) - return 0; - if(g_instruction_table[instruction] == d68020_trapcc_16) - return 0; - if(g_instruction_table[instruction] == d68020_trapcc_32) - return 0; - if(g_instruction_table[instruction] == d68020_tst_pcdi_8) - return 0; - if(g_instruction_table[instruction] == d68020_tst_pcix_8) - return 0; - if(g_instruction_table[instruction] == d68020_tst_i_8) - return 0; - if(g_instruction_table[instruction] == d68020_tst_a_16) - return 0; - if(g_instruction_table[instruction] == d68020_tst_pcdi_16) - return 0; - if(g_instruction_table[instruction] == d68020_tst_pcix_16) - return 0; - if(g_instruction_table[instruction] == d68020_tst_i_16) - return 0; - if(g_instruction_table[instruction] == d68020_tst_a_32) - return 0; - if(g_instruction_table[instruction] == d68020_tst_pcdi_32) - return 0; - if(g_instruction_table[instruction] == d68020_tst_pcix_32) - return 0; - if(g_instruction_table[instruction] == d68020_tst_i_32) - return 0; - if(g_instruction_table[instruction] == d68020_unpk_rr) - return 0; - if(g_instruction_table[instruction] == d68020_unpk_mm) - return 0; - case M68K_CPU_TYPE_68EC020: - case M68K_CPU_TYPE_68020: - case M68K_CPU_TYPE_68030: - if(g_instruction_table[instruction] == d68040_cinv) - return 0; - if(g_instruction_table[instruction] == d68040_cpush) - return 0; - if(g_instruction_table[instruction] == d68040_move16_pi_pi) - return 0; - if(g_instruction_table[instruction] == d68040_move16_pi_al) - return 0; - if(g_instruction_table[instruction] == d68040_move16_al_pi) - return 0; - if(g_instruction_table[instruction] == d68040_move16_ai_al) - return 0; - if(g_instruction_table[instruction] == d68040_move16_al_ai) - return 0; - } - if(cpu_type != M68K_CPU_TYPE_68020 && cpu_type != M68K_CPU_TYPE_68EC020 && - (g_instruction_table[instruction] == d68020_callm || - g_instruction_table[instruction] == d68020_rtm)) - return 0; - - return 1; -} - - - -/* ======================================================================== */ -/* ============================== END OF FILE ============================= */ -/* ======================================================================== */ diff --git a/jan/src/cpu/m68k/m68kfpu.c b/jan/src/cpu/m68k/m68kfpu.c deleted file mode 100644 index 8cf7a4fcc..000000000 --- a/jan/src/cpu/m68k/m68kfpu.c +++ /dev/null @@ -1,828 +0,0 @@ -#define fatalerror printf - -#define FPCC_N 0x08000000 -#define FPCC_Z 0x04000000 -#define FPCC_I 0x02000000 -#define FPCC_NAN 0x01000000 - -#define DOUBLE_INFINITY U64(0x7ff0000000000000) -#define DOUBLE_EXPONENT U64(0x7ff0000000000000) -#define DOUBLE_MANTISSA U64(0x000fffffffffffff) - -INLINE void SET_CONDITION_CODES(fp_reg reg) -{ - REG_FPSR &= ~(FPCC_N|FPCC_Z|FPCC_I|FPCC_NAN); - - // sign flag - if (reg.i & U64(0x8000000000000000)) - { - REG_FPSR |= FPCC_N; - } - - // zero flag - if ((reg.i & U64(0x7fffffffffffffff)) == 0) - { - REG_FPSR |= FPCC_Z; - } - - // infinity flag - if ((reg.i & U64(0x7fffffffffffffff)) == DOUBLE_INFINITY) - { - REG_FPSR |= FPCC_I; - } - - // NaN flag - if (((reg.i & DOUBLE_EXPONENT) == DOUBLE_EXPONENT) && ((reg.i & DOUBLE_MANTISSA) != 0)) - { - REG_FPSR |= FPCC_NAN; - } -} - -INLINE int TEST_CONDITION(int condition) -{ - int n = (REG_FPSR & FPCC_N) != 0; - int z = (REG_FPSR & FPCC_Z) != 0; - int nan = (REG_FPSR & FPCC_NAN) != 0; - int r = 0; - switch (condition) - { - case 0x00: return 0; // False - case 0x01: return (z); // Equal - case 0x0e: return (!z); // Not Equal - case 0x0f: return 1; // True - case 0x12: return (!(nan || z || n)); // Greater Than - case 0x13: return (z || !(nan || n)); // Greater or Equal - case 0x14: return (n && !(nan || z)); // Less Than - case 0x15: return (z || (n && !nan)); // Less Than or Equal - case 0x1a: return (nan || !(n || z)); // Not Less Than or Equal - case 0x1b: return (nan || z || !n); // Not Less Than - case 0x1c: return (nan || (n && !z)); // Not Greater or Equal Than - case 0x1d: return (nan || z || n); // Not Greater Than - - default: fatalerror("M68040: test_condition: unhandled condition %02X\n", condition); - } - - return r; -} - -static UINT8 READ_EA_8(int ea) -{ - int mode = (ea >> 3) & 0x7; - int reg = (ea & 0x7); - - switch (mode) - { - case 0: // Dn - { - return REG_D[reg]; - } - case 5: // (d16, An) - { - UINT32 ea = EA_AY_DI_8(); - return m68ki_read_8(ea); - } - case 6: // (An) + (Xn) + d8 - { - UINT32 ea = EA_AY_IX_8(); - return m68ki_read_8(ea); - } - case 7: - { - switch (reg) - { - case 1: // (xxx).L - { - UINT32 d1 = OPER_I_16(); - UINT32 d2 = OPER_I_16(); - UINT32 ea = (d1 << 16) | d2; - return m68ki_read_8(ea); - } - case 4: // # - { - return OPER_I_8(); - } - default: fatalerror("MC68040: READ_EA_8: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC); - } - break; - } - default: fatalerror("MC68040: READ_EA_8: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC); - } - - return 0; -} - -static UINT16 READ_EA_16(int ea) -{ - int mode = (ea >> 3) & 0x7; - int reg = (ea & 0x7); - - switch (mode) - { - case 0: // Dn - { - return (UINT16)(REG_D[reg]); - } - case 2: // (An) - { - UINT32 ea = REG_A[reg]; - return m68ki_read_16(ea); - } - case 5: // (d16, An) - { - UINT32 ea = EA_AY_DI_16(); - return m68ki_read_16(ea); - } - case 6: // (An) + (Xn) + d8 - { - UINT32 ea = EA_AY_IX_16(); - return m68ki_read_16(ea); - } - case 7: - { - switch (reg) - { - case 1: // (xxx).L - { - UINT32 d1 = OPER_I_16(); - UINT32 d2 = OPER_I_16(); - UINT32 ea = (d1 << 16) | d2; - return m68ki_read_16(ea); - } - case 4: // # - { - return OPER_I_16(); - } - - default: fatalerror("MC68040: READ_EA_16: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC); - } - break; - } - default: fatalerror("MC68040: READ_EA_16: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC); - } - - return 0; -} - -static UINT32 READ_EA_32(int ea) -{ - int mode = (ea >> 3) & 0x7; - int reg = (ea & 0x7); - - switch (mode) - { - case 0: // Dn - { - return REG_D[reg]; - } - case 2: // (An) - { - UINT32 ea = REG_A[reg]; - return m68ki_read_32(ea); - } - case 3: // (An)+ - { - UINT32 ea = EA_AY_PI_32(); - return m68ki_read_32(ea); - } - case 5: // (d16, An) - { - UINT32 ea = EA_AY_DI_32(); - return m68ki_read_32(ea); - } - case 6: // (An) + (Xn) + d8 - { - UINT32 ea = EA_AY_IX_32(); - return m68ki_read_32(ea); - } - case 7: - { - switch (reg) - { - case 1: // (xxx).L - { - UINT32 d1 = OPER_I_16(); - UINT32 d2 = OPER_I_16(); - UINT32 ea = (d1 << 16) | d2; - return m68ki_read_32(ea); - } - case 2: // (d16, PC) - { - UINT32 ea = EA_PCDI_32(); - return m68ki_read_32(ea); - } - case 4: // # - { - return OPER_I_32(); - } - default: fatalerror("MC68040: READ_EA_32: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC); - } - break; - } - default: fatalerror("MC68040: READ_EA_32: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC); - } - return 0; -} - -static void WRITE_EA_32(int ea, UINT32 data) -{ - int mode = (ea >> 3) & 0x7; - int reg = (ea & 0x7); - - switch (mode) - { - case 0: // Dn - { - REG_D[reg] = data; - break; - } - case 2: // (An) - { - UINT32 ea = REG_A[reg]; - m68ki_write_32(ea, data); - break; - } - case 3: // (An)+ - { - UINT32 ea = EA_AY_PI_32(); - m68ki_write_32(ea, data); - break; - } - case 4: // -(An) - { - UINT32 ea = EA_AY_PD_32(); - m68ki_write_32(ea, data); - break; - } - case 5: // (d16, An) - { - UINT32 ea = EA_AY_DI_32(); - m68ki_write_32(ea, data); - break; - } - case 6: // (An) + (Xn) + d8 - { - UINT32 ea = EA_AY_IX_32(); - m68ki_write_32(ea, data); - break; - } - case 7: - { - switch (reg) - { - case 1: // (xxx).L - { - UINT32 d1 = OPER_I_16(); - UINT32 d2 = OPER_I_16(); - UINT32 ea = (d1 << 16) | d2; - m68ki_write_32(ea, data); - break; - } - case 2: // (d16, PC) - { - UINT32 ea = EA_PCDI_32(); - m68ki_write_32(ea, data); - break; - } - default: fatalerror("MC68040: WRITE_EA_32: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC); - } - break; - } - default: fatalerror("MC68040: WRITE_EA_32: unhandled mode %d, reg %d, data %08X at %08X\n", mode, reg, data, REG_PC); - } -} - -static UINT64 READ_EA_64(int ea) -{ - int mode = (ea >> 3) & 0x7; - int reg = (ea & 0x7); - UINT32 h1, h2; - - switch (mode) - { - case 2: // (An) - { - UINT32 ea = REG_A[reg]; - h1 = m68ki_read_32(ea+0); - h2 = m68ki_read_32(ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); - } - case 3: // (An)+ - { - UINT32 ea = REG_A[reg]; - REG_A[reg] += 8; - h1 = m68ki_read_32(ea+0); - h2 = m68ki_read_32(ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); - } - case 5: // (d16, An) - { - UINT32 ea = EA_AY_DI_32(); - h1 = m68ki_read_32(ea+0); - h2 = m68ki_read_32(ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); - } - case 7: - { - switch (reg) - { - case 4: // # - { - h1 = OPER_I_32(); - h2 = OPER_I_32(); - return (UINT64)(h1) << 32 | (UINT64)(h2); - } - case 2: // (d16, PC) - { - UINT32 ea = EA_PCDI_32(); - h1 = m68ki_read_32(ea+0); - h2 = m68ki_read_32(ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); - } - default: fatalerror("MC68040: READ_EA_64: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC); - } - break; - } - default: fatalerror("MC68040: READ_EA_64: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC); - } - - return 0; -} - -static void WRITE_EA_64(int ea, UINT64 data) -{ - int mode = (ea >> 3) & 0x7; - int reg = (ea & 0x7); - - switch (mode) - { - case 2: // (An) - { - UINT32 ea = REG_A[reg]; - m68ki_write_32(ea, (UINT32)(data >> 32)); - m68ki_write_32(ea, (UINT32)(data)); - break; - } - case 4: // -(An) - { - UINT32 ea; - REG_A[reg] -= 8; - ea = REG_A[reg]; - m68ki_write_32(ea+0, (UINT32)(data >> 32)); - m68ki_write_32(ea+4, (UINT32)(data)); - break; - } - case 5: // (d16, An) - { - UINT32 ea = EA_AY_DI_32(); - m68ki_write_32(ea+0, (UINT32)(data >> 32)); - m68ki_write_32(ea+4, (UINT32)(data)); - break; - } - default: fatalerror("MC68040: WRITE_EA_64: unhandled mode %d, reg %d, data %08X%08X at %08X\n", mode, reg, (UINT32)(data >> 32), (UINT32)(data), REG_PC); - } -} - -static fp_reg READ_EA_FPE(int ea) -{ - fp_reg r; - int mode = (ea >> 3) & 0x7; - int reg = (ea & 0x7); - - // TODO: convert to extended floating-point! - - switch (mode) - { - case 3: // (An)+ - { - UINT32 d1,d2,d3; - UINT32 ea = REG_A[reg]; - REG_A[reg] += 12; - d1 = m68ki_read_32(ea+0); - d2 = m68ki_read_32(ea+4); - d3 = m68ki_read_32(ea+8); - r.i = (UINT64)(d1) << 32 | (UINT64)(d2); - break; - } - default: fatalerror("MC68040: READ_EA_FPE: unhandled mode %d, reg %d, at %08X\n", mode, reg, REG_PC); - } - - return r; -} - -static void WRITE_EA_FPE(int ea, fp_reg fpr) -{ - int mode = (ea >> 3) & 0x7; - int reg = (ea & 0x7); - - // TODO: convert to extended floating-point! - - switch (mode) - { - case 4: // -(An) - { - UINT32 ea; - REG_A[reg] -= 12; - ea = REG_A[reg]; - m68ki_write_32(ea+0, (UINT32)((UINT64)fpr.i >> 32)); - m68ki_write_32(ea+4, (UINT32)(fpr.i)); - m68ki_write_32(ea+8, 0); - break; - } - default: fatalerror("MC68040: WRITE_EA_FPE: unhandled mode %d, reg %d, data %f at %08X\n", mode, reg, fpr.f, REG_PC); - } -} - - -static void fpgen_rm_reg(UINT16 w2) -{ - int ea = REG_IR & 0x3f; - int rm = (w2 >> 14) & 0x1; - int src = (w2 >> 10) & 0x7; - int dst = (w2 >> 7) & 0x7; - int opmode = w2 & 0x7f; - double source; - - if (rm) - { - switch (src) - { - case 0: // Long-Word Integer - { - INT32 d = READ_EA_32(ea); - source = (double)(d); - break; - } - case 1: // Single-precision Real - { - UINT32 d = READ_EA_32(ea); - source = (double)(*(float*)&d); - break; - } - case 2: // Extended-precision Real - { - fatalerror("fpgen_rm_reg: extended-precision real load unimplemented at %08X\n", REG_PC-4); - break; - } - case 3: // Packed-decimal Real - { - fatalerror("fpgen_rm_reg: packed-decimal real load unimplemented at %08X\n", REG_PC-4); - break; - } - case 4: // Word Integer - { - INT16 d = READ_EA_16(ea); - source = (double)(d); - break; - } - case 5: // Double-precision Real - { - UINT64 d = READ_EA_64(ea); - source = *(double*)&d; - break; - } - case 6: // Byte Integer - { - INT8 d = READ_EA_8(ea); - source = (double)(d); - break; - } - default: fatalerror("fmove_rm_reg: invalid source specifier at %08X\n", REG_PC-4); - } - } - else - { - source = REG_FP[src].f; - } - - switch (opmode) - { - case 0x00: // FMOVE - { - REG_FP[dst].f = source; - USE_CYCLES(4); - break; - } - case 0x04: // FSQRT - { - REG_FP[dst].f = sqrt(source); - SET_CONDITION_CODES(REG_FP[dst]); - USE_CYCLES(109); - break; - } - case 0x18: // FABS - { - REG_FP[dst].f = fabs(source); - SET_CONDITION_CODES(REG_FP[dst]); - USE_CYCLES(3); - break; - } - case 0x1a: // FNEG - { - REG_FP[dst].f = -source; - SET_CONDITION_CODES(REG_FP[dst]); - USE_CYCLES(3); - break; - } - case 0x20: // FDIV - { - REG_FP[dst].f /= source; - USE_CYCLES(43); - break; - } - case 0x22: // FADD - { - REG_FP[dst].f += source; - SET_CONDITION_CODES(REG_FP[dst]); - USE_CYCLES(9); - break; - } - case 0x23: // FMUL - { - REG_FP[dst].f *= source; - SET_CONDITION_CODES(REG_FP[dst]); - USE_CYCLES(11); - break; - } - case 0x28: // FSUB - { - REG_FP[dst].f -= source; - SET_CONDITION_CODES(REG_FP[dst]); - USE_CYCLES(9); - break; - } - case 0x38: // FCMP - { - fp_reg res; - res.f = REG_FP[dst].f - source; - SET_CONDITION_CODES(res); - USE_CYCLES(7); - break; - } - case 0x3a: // FTST - { - fp_reg res; - res.f = source; - SET_CONDITION_CODES(res); - USE_CYCLES(7); - break; - } - - default: fatalerror("fpgen_rm_reg: unimplemented opmode %02X at %08X\n", opmode, REG_PC-4); - } -} - -static void fmove_reg_mem(UINT16 w2) -{ - int ea = REG_IR & 0x3f; - int src = (w2 >> 7) & 0x7; - int dst = (w2 >> 10) & 0x7; - //int kfactor = w2 & 0x7f; - - switch (dst) - { - case 0: // Long-Word Integer - { - INT32 d = (INT32)(REG_FP[src].f); - WRITE_EA_32(ea, d); - break; - } - case 1: // Single-precision Real - { - float f = (float)(REG_FP[src].f); - UINT32 d = *(UINT32 *)&f; - WRITE_EA_32(ea, d); - break; - } - case 2: // Extended-precision Real - { - fatalerror("fmove_reg_mem: extended-precision real store unimplemented at %08X\n", REG_PC-4); - break; - } - case 3: // Packed-decimal Real with Static K-factor - { - fatalerror("fmove_reg_mem: packed-decimal real store unimplemented at %08X\n", REG_PC-4); - break; - } - case 4: // Word Integer - { - fatalerror("fmove_reg_mem: word integer store unimplemented at %08X\n", REG_PC-4); - break; - } - case 5: // Double-precision Real - { - UINT64 d = REG_FP[src].i; - WRITE_EA_64(ea, d); - break; - } - case 6: // Byte Integer - { - fatalerror("fmove_reg_mem: byte integer store unimplemented at %08X\n", REG_PC-4); - break; - } - case 7: // Packed-decimal Real with Dynamic K-factor - { - fatalerror("fmove_reg_mem: packed-decimal real store unimplemented at %08X\n", REG_PC-4); - break; - } - } - - USE_CYCLES(12); -} - -static void fmove_fpcr(UINT16 w2) -{ - int ea = REG_IR & 0x3f; - int dir = (w2 >> 13) & 0x1; - int reg = (w2 >> 10) & 0x7; - - if (dir) // From system control reg to - { - switch (reg) - { - case 1: WRITE_EA_32(ea, REG_FPIAR); break; - case 2: WRITE_EA_32(ea, REG_FPSR); break; - case 4: WRITE_EA_32(ea, REG_FPCR); break; - default: fatalerror("fmove_fpcr: unknown reg %d, dir %d\n", reg, dir); - } - } - else // From to system control reg - { - switch (reg) - { - case 1: REG_FPIAR = READ_EA_32(ea); break; - case 2: REG_FPSR = READ_EA_32(ea); break; - case 4: REG_FPCR = READ_EA_32(ea); break; - default: fatalerror("fmove_fpcr: unknown reg %d, dir %d\n", reg, dir); - } - } - - USE_CYCLES(10); -} - -static void fmovem(UINT16 w2) -{ - int i; - int ea = REG_IR & 0x3f; - int dir = (w2 >> 13) & 0x1; - int mode = (w2 >> 11) & 0x3; - int reglist = w2 & 0xff; - - if (dir) // From FP regs to mem - { - switch (mode) - { - case 0: // Static register list, predecrement addressing mode - { - for (i=0; i < 8; i++) - { - if (reglist & (1 << i)) - { - WRITE_EA_FPE(ea, REG_FP[i]); - USE_CYCLES(2); - } - } - break; - } - - default: fatalerror("040fpu0: FMOVEM: mode %d unimplemented at %08X\n", mode, REG_PC-4); - } - } - else // From mem to FP regs - { - switch (mode) - { - case 2: // Static register list, postincrement addressing mode - { - for (i=0; i < 8; i++) - { - if (reglist & (1 << i)) - { - REG_FP[7-i] = READ_EA_FPE(ea); - USE_CYCLES(2); - } - } - break; - } - - default: fatalerror("040fpu0: FMOVEM: mode %d unimplemented at %08X\n", mode, REG_PC-4); - } - } -} - -static void fbcc16(void) -{ - INT32 offset; - int condition = REG_IR & 0x3f; - - offset = (INT16)(OPER_I_16()); - - // TODO: condition and jump!!! - if (TEST_CONDITION(condition)) - { - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_16(offset-2); - } - - USE_CYCLES(7); -} - -static void fbcc32(void) -{ - INT32 offset; - int condition = REG_IR & 0x3f; - - offset = OPER_I_32(); - - // TODO: condition and jump!!! - if (TEST_CONDITION(condition)) - { - m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ - m68ki_branch_32(offset-4); - } - - USE_CYCLES(7); -} - - -void m68040_fpu_op0(void) -{ - switch ((REG_IR >> 6) & 0x3) - { - case 0: - { - UINT16 w2 = OPER_I_16(); - switch ((w2 >> 13) & 0x7) - { - case 0x0: // FPU ALU FP, FP - case 0x2: // FPU ALU ea, FP - { - fpgen_rm_reg(w2); - break; - } - - case 0x3: // FMOVE FP, ea - { - fmove_reg_mem(w2); - break; - } - - case 0x4: // FMOVE ea, FPCR - case 0x5: // FMOVE FPCR, ea - { - fmove_fpcr(w2); - break; - } - - case 0x6: // FMOVEM ea, list - case 0x7: // FMOVEM list, ea - { - fmovem(w2); - break; - } - - default: fatalerror("m68040_fpu_op0: unimplemented subop %d at %08X\n", (w2 >> 13) & 0x7, REG_PC-4); - } - break; - } - - case 2: // FBcc disp16 - { - fbcc16(); - break; - } - case 3: // FBcc disp32 - { - fbcc32(); - break; - } - - default: fatalerror("m68040_fpu_op0: unimplemented main op %d\n", (REG_IR >> 6) & 0x3); - } -} - -void m68040_fpu_op1(void) -{ - int ea = REG_IR & 0x3f; - - switch ((REG_IR >> 6) & 0x3) - { - case 0: // FSAVE - { - WRITE_EA_32(ea, 0x00000000); - // TODO: correct state frame - break; - } - - case 1: // FRESTORE - { - READ_EA_32(ea); - // TODO: correct state frame - break; - } - - default: fatalerror("m68040_fpu_op1: unimplemented op %d at %08X\n", (REG_IR >> 6) & 0x3, REG_PC-2); - } -} - - - diff --git a/jan/src/cpu/m68k/m68kmake.c b/jan/src/cpu/m68k/m68kmake.c deleted file mode 100644 index 4bfea7909..000000000 --- a/jan/src/cpu/m68k/m68kmake.c +++ /dev/null @@ -1,1426 +0,0 @@ -/* ======================================================================== */ -/* ========================= LICENSING & COPYRIGHT ======================== */ -/* ======================================================================== */ -/* - * MUSASHI - * Version 3.32 - * - * A portable Motorola M680x0 processor emulation engine. - * Copyright Karl Stenerud. All rights reserved. - * - * This code may be freely used for non-commercial purposes as long as this - * copyright notice remains unaltered in the source code and any binary files - * containing this code in compiled form. - * - * All other licensing terms must be negotiated with the author - * (Karl Stenerud). - * - * The latest version of this code can be obtained at: - * http://kstenerud.cjb.net - */ - -/* - * Modified For OpenVMS By: Robert Alan Byer - * byer@mail.ourservers.net - */ - - -/* ======================================================================== */ -/* ============================ CODE GENERATOR ============================ */ -/* ======================================================================== */ -/* - * This is the code generator program which will generate the opcode table - * and the final opcode handlers. - * - * It requires an input file to function (default m68k_in.c), but you can - * specify your own like so: - * - * m68kmake - * - * where output path is the path where the output files should be placed, and - * input file is the file to use for input. - * - * If you modify the input file greatly from its released form, you may have - * to tweak the configuration section a bit since I'm using static allocation - * to keep things simple. - * - * - * TODO: - build a better code generator for the move instruction. - * - Add callm and rtm instructions - * - Fix RTE to handle other format words - * - Add address error (and bus error?) handling - */ - - -static const char g_version[] = "3.32"; - -/* ======================================================================== */ -/* =============================== INCLUDES =============================== */ -/* ======================================================================== */ - -#include -#include -#include -#include -#include - - - -/* ======================================================================== */ -/* ============================= CONFIGURATION ============================ */ -/* ======================================================================== */ - -#define M68K_MAX_PATH 1024 -#define M68K_MAX_DIR 1024 - -#define MAX_LINE_LENGTH 200 /* length of 1 line */ -#define MAX_BODY_LENGTH 300 /* Number of lines in 1 function */ -#define MAX_REPLACE_LENGTH 30 /* Max number of replace strings */ -#define MAX_INSERT_LENGTH 5000 /* Max size of insert piece */ -#define MAX_NAME_LENGTH 30 /* Max length of ophandler name */ -#define MAX_SPEC_PROC_LENGTH 4 /* Max length of special processing str */ -#define MAX_SPEC_EA_LENGTH 5 /* Max length of specified EA str */ -#define EA_ALLOWED_LENGTH 11 /* Max length of ea allowed str */ -#define MAX_OPCODE_INPUT_TABLE_LENGTH 1000 /* Max length of opcode handler tbl */ -#define MAX_OPCODE_OUTPUT_TABLE_LENGTH 3000 /* Max length of opcode handler tbl */ - -/* Default filenames */ -#define FILENAME_INPUT "m68k_in.c" -#define FILENAME_PROTOTYPE "m68kops.h" -#define FILENAME_TABLE "m68kops.c" - - -/* Identifier sequences recognized by this program */ - -#define ID_INPUT_SEPARATOR "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - -#define ID_BASE "M68KMAKE" -#define ID_PROTOTYPE_HEADER ID_BASE "_PROTOTYPE_HEADER" -#define ID_PROTOTYPE_FOOTER ID_BASE "_PROTOTYPE_FOOTER" -#define ID_TABLE_HEADER ID_BASE "_TABLE_HEADER" -#define ID_TABLE_FOOTER ID_BASE "_TABLE_FOOTER" -#define ID_TABLE_BODY ID_BASE "_TABLE_BODY" -#define ID_TABLE_START ID_BASE "_TABLE_START" -#define ID_OPHANDLER_HEADER ID_BASE "_OPCODE_HANDLER_HEADER" -#define ID_OPHANDLER_FOOTER ID_BASE "_OPCODE_HANDLER_FOOTER" -#define ID_OPHANDLER_BODY ID_BASE "_OPCODE_HANDLER_BODY" -#define ID_END ID_BASE "_END" - -#define ID_OPHANDLER_NAME ID_BASE "_OP" -#define ID_OPHANDLER_EA_AY_8 ID_BASE "_GET_EA_AY_8" -#define ID_OPHANDLER_EA_AY_16 ID_BASE "_GET_EA_AY_16" -#define ID_OPHANDLER_EA_AY_32 ID_BASE "_GET_EA_AY_32" -#define ID_OPHANDLER_OPER_AY_8 ID_BASE "_GET_OPER_AY_8" -#define ID_OPHANDLER_OPER_AY_16 ID_BASE "_GET_OPER_AY_16" -#define ID_OPHANDLER_OPER_AY_32 ID_BASE "_GET_OPER_AY_32" -#define ID_OPHANDLER_CC ID_BASE "_CC" -#define ID_OPHANDLER_NOT_CC ID_BASE "_NOT_CC" - - -#ifndef DECL_SPEC -#define DECL_SPEC -#endif /* DECL_SPEC */ - - - -/* ======================================================================== */ -/* ============================== PROTOTYPES ============================== */ -/* ======================================================================== */ - -enum -{ - CPU_TYPE_000 = 0, - CPU_TYPE_010, - CPU_TYPE_020, - CPU_TYPE_040, - NUM_CPUS -}; - -#define UNSPECIFIED "." -#define UNSPECIFIED_CH '.' - -#define HAS_NO_EA_MODE(A) (strcmp(A, "..........") == 0) -#define HAS_EA_AI(A) ((A)[0] == 'A') -#define HAS_EA_PI(A) ((A)[1] == '+') -#define HAS_EA_PD(A) ((A)[2] == '-') -#define HAS_EA_DI(A) ((A)[3] == 'D') -#define HAS_EA_IX(A) ((A)[4] == 'X') -#define HAS_EA_AW(A) ((A)[5] == 'W') -#define HAS_EA_AL(A) ((A)[6] == 'L') -#define HAS_EA_PCDI(A) ((A)[7] == 'd') -#define HAS_EA_PCIX(A) ((A)[8] == 'x') -#define HAS_EA_I(A) ((A)[9] == 'I') - -enum -{ - EA_MODE_NONE, /* No special addressing mode */ - EA_MODE_AI, /* Address register indirect */ - EA_MODE_PI, /* Address register indirect with postincrement */ - EA_MODE_PI7, /* Address register 7 indirect with postincrement */ - EA_MODE_PD, /* Address register indirect with predecrement */ - EA_MODE_PD7, /* Address register 7 indirect with predecrement */ - EA_MODE_DI, /* Address register indirect with displacement */ - EA_MODE_IX, /* Address register indirect with index */ - EA_MODE_AW, /* Absolute word */ - EA_MODE_AL, /* Absolute long */ - EA_MODE_PCDI, /* Program counter indirect with displacement */ - EA_MODE_PCIX, /* Program counter indirect with index */ - EA_MODE_I /* Immediate */ -}; - - -/* Everything we need to know about an opcode */ -typedef struct -{ - char name[MAX_NAME_LENGTH]; /* opcode handler name */ - unsigned char size; /* Size of operation */ - char spec_proc[MAX_SPEC_PROC_LENGTH]; /* Special processing mode */ - char spec_ea[MAX_SPEC_EA_LENGTH]; /* Specified effective addressing mode */ - unsigned char bits; /* Number of significant bits (used for sorting the table) */ - unsigned short op_mask; /* Mask to apply for matching an opcode to a handler */ - unsigned short op_match; /* Value to match after masking */ - char ea_allowed[EA_ALLOWED_LENGTH]; /* Effective addressing modes allowed */ - char cpu_mode[NUM_CPUS]; /* User or supervisor mode */ - char cpus[NUM_CPUS+1]; /* Allowed CPUs */ - unsigned char cycles[NUM_CPUS]; /* cycles for 000, 010, 020 */ -} opcode_struct; - - -/* All modifications necessary for a specific EA mode of an instruction */ -typedef struct -{ - const char* fname_add; - const char* ea_add; - unsigned int mask_add; - unsigned int match_add; -} ea_info_struct; - - -/* Holds the body of a function */ -typedef struct -{ - char body[MAX_BODY_LENGTH][MAX_LINE_LENGTH+1]; - int length; -} body_struct; - - -/* Holds a sequence of search / replace strings */ -typedef struct -{ - char replace[MAX_REPLACE_LENGTH][2][MAX_LINE_LENGTH+1]; - int length; -} replace_struct; - - -/* Function Prototypes */ -void error_exit(const char* fmt, ...); -void perror_exit(const char* fmt, ...); -int check_strsncpy(char* dst, char* src, int maxlength); -int check_atoi(char* str, int *result); -int skip_spaces(char* str); -int num_bits(int value); -int atoh(char* buff); -int fgetline(char* buff, int nchars, FILE* file); -int get_oper_cycles(opcode_struct* op, int ea_mode, int cpu_type); -opcode_struct* find_opcode(char* name, int size, char* spec_proc, char* spec_ea); -opcode_struct* find_illegal_opcode(void); -int extract_opcode_info(char* src, char* name, int* size, char* spec_proc, char* spec_ea); -void add_replace_string(replace_struct* replace, const char* search_str, const char* replace_str); -void write_body(FILE* filep, body_struct* body, replace_struct* replace); -void get_base_name(char* base_name, opcode_struct* op); -void write_function_name(FILE* filep, char* base_name); -void add_opcode_output_table_entry(opcode_struct* op, char* name); -static int DECL_SPEC compare_nof_true_bits(const void* aptr, const void* bptr); -void print_opcode_output_table(FILE* filep); -void write_table_entry(FILE* filep, opcode_struct* op); -void set_opcode_struct(opcode_struct* src, opcode_struct* dst, int ea_mode); -void generate_opcode_handler(FILE* filep, body_struct* body, replace_struct* replace, opcode_struct* opinfo, int ea_mode); -void generate_opcode_ea_variants(FILE* filep, body_struct* body, replace_struct* replace, opcode_struct* op); -void generate_opcode_cc_variants(FILE* filep, body_struct* body, replace_struct* replace, opcode_struct* op_in, int offset); -void process_opcode_handlers(FILE* filep); -void populate_table(void); -void read_insert(char* insert); - - - -/* ======================================================================== */ -/* ================================= DATA ================================= */ -/* ======================================================================== */ - -/* Name of the input file */ -char g_input_filename[M68K_MAX_PATH] = FILENAME_INPUT; - -/* File handles */ -FILE* g_input_file = NULL; -FILE* g_prototype_file = NULL; -FILE* g_table_file = NULL; - -int g_num_functions = 0; /* Number of functions processed */ -int g_num_primitives = 0; /* Number of function primitives read */ -int g_line_number = 1; /* Current line number */ - -/* Opcode handler table */ -opcode_struct g_opcode_input_table[MAX_OPCODE_INPUT_TABLE_LENGTH]; - -opcode_struct g_opcode_output_table[MAX_OPCODE_OUTPUT_TABLE_LENGTH]; -int g_opcode_output_table_length = 0; - -const ea_info_struct g_ea_info_table[13] = -{/* fname ea mask match */ - {"", "", 0x00, 0x00}, /* EA_MODE_NONE */ - {"ai", "AY_AI", 0x38, 0x10}, /* EA_MODE_AI */ - {"pi", "AY_PI", 0x38, 0x18}, /* EA_MODE_PI */ - {"pi7", "A7_PI", 0x3f, 0x1f}, /* EA_MODE_PI7 */ - {"pd", "AY_PD", 0x38, 0x20}, /* EA_MODE_PD */ - {"pd7", "A7_PD", 0x3f, 0x27}, /* EA_MODE_PD7 */ - {"di", "AY_DI", 0x38, 0x28}, /* EA_MODE_DI */ - {"ix", "AY_IX", 0x38, 0x30}, /* EA_MODE_IX */ - {"aw", "AW", 0x3f, 0x38}, /* EA_MODE_AW */ - {"al", "AL", 0x3f, 0x39}, /* EA_MODE_AL */ - {"pcdi", "PCDI", 0x3f, 0x3a}, /* EA_MODE_PCDI */ - {"pcix", "PCIX", 0x3f, 0x3b}, /* EA_MODE_PCIX */ - {"i", "I", 0x3f, 0x3c}, /* EA_MODE_I */ -}; - - -const char *const g_cc_table[16][2] = -{ - { "t", "T"}, /* 0000 */ - { "f", "F"}, /* 0001 */ - {"hi", "HI"}, /* 0010 */ - {"ls", "LS"}, /* 0011 */ - {"cc", "CC"}, /* 0100 */ - {"cs", "CS"}, /* 0101 */ - {"ne", "NE"}, /* 0110 */ - {"eq", "EQ"}, /* 0111 */ - {"vc", "VC"}, /* 1000 */ - {"vs", "VS"}, /* 1001 */ - {"pl", "PL"}, /* 1010 */ - {"mi", "MI"}, /* 1011 */ - {"ge", "GE"}, /* 1100 */ - {"lt", "LT"}, /* 1101 */ - {"gt", "GT"}, /* 1110 */ - {"le", "LE"}, /* 1111 */ -}; - -/* size to index translator (0 -> 0, 8 and 16 -> 1, 32 -> 2) */ -const int g_size_select_table[33] = -{ - 0, /* unsized */ - 0, 0, 0, 0, 0, 0, 0, 1, /* 8 */ - 0, 0, 0, 0, 0, 0, 0, 1, /* 16 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 /* 32 */ -}; - -/* Extra cycles required for certain EA modes */ -/* TODO: correct timings for 040 */ -const int g_ea_cycle_table[13][NUM_CPUS][3] = -{/* 000 010 020 040 */ - {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}}, /* EA_MODE_NONE */ - {{ 0, 4, 8}, { 0, 4, 8}, { 0, 4, 4}, { 0, 4, 4}}, /* EA_MODE_AI */ - {{ 0, 4, 8}, { 0, 4, 8}, { 0, 4, 4}, { 0, 4, 4}}, /* EA_MODE_PI */ - {{ 0, 4, 8}, { 0, 4, 8}, { 0, 4, 4}, { 0, 4, 4}}, /* EA_MODE_PI7 */ - {{ 0, 6, 10}, { 0, 6, 10}, { 0, 5, 5}, { 0, 5, 5}}, /* EA_MODE_PD */ - {{ 0, 6, 10}, { 0, 6, 10}, { 0, 5, 5}, { 0, 5, 5}}, /* EA_MODE_PD7 */ - {{ 0, 8, 12}, { 0, 8, 12}, { 0, 5, 5}, { 0, 5, 5}}, /* EA_MODE_DI */ - {{ 0, 10, 14}, { 0, 10, 14}, { 0, 7, 7}, { 0, 7, 7}}, /* EA_MODE_IX */ - {{ 0, 8, 12}, { 0, 8, 12}, { 0, 4, 4}, { 0, 4, 4}}, /* EA_MODE_AW */ - {{ 0, 12, 16}, { 0, 12, 16}, { 0, 4, 4}, { 0, 4, 4}}, /* EA_MODE_AL */ - {{ 0, 8, 12}, { 0, 8, 12}, { 0, 5, 5}, { 0, 5, 5}}, /* EA_MODE_PCDI */ - {{ 0, 10, 14}, { 0, 10, 14}, { 0, 7, 7}, { 0, 7, 7}}, /* EA_MODE_PCIX */ - {{ 0, 4, 8}, { 0, 4, 8}, { 0, 2, 4}, { 0, 2, 4}}, /* EA_MODE_I */ -}; - -/* Extra cycles for JMP instruction (000, 010) */ -const int g_jmp_cycle_table[13] = -{ - 0, /* EA_MODE_NONE */ - 4, /* EA_MODE_AI */ - 0, /* EA_MODE_PI */ - 0, /* EA_MODE_PI7 */ - 0, /* EA_MODE_PD */ - 0, /* EA_MODE_PD7 */ - 6, /* EA_MODE_DI */ - 10, /* EA_MODE_IX */ - 6, /* EA_MODE_AW */ - 8, /* EA_MODE_AL */ - 6, /* EA_MODE_PCDI */ - 10, /* EA_MODE_PCIX */ - 0, /* EA_MODE_I */ -}; - -/* Extra cycles for JSR instruction (000, 010) */ -const int g_jsr_cycle_table[13] = -{ - 0, /* EA_MODE_NONE */ - 4, /* EA_MODE_AI */ - 0, /* EA_MODE_PI */ - 0, /* EA_MODE_PI7 */ - 0, /* EA_MODE_PD */ - 0, /* EA_MODE_PD7 */ - 6, /* EA_MODE_DI */ - 10, /* EA_MODE_IX */ - 6, /* EA_MODE_AW */ - 8, /* EA_MODE_AL */ - 6, /* EA_MODE_PCDI */ - 10, /* EA_MODE_PCIX */ - 0, /* EA_MODE_I */ -}; - -/* Extra cycles for LEA instruction (000, 010) */ -const int g_lea_cycle_table[13] = -{ - 0, /* EA_MODE_NONE */ - 4, /* EA_MODE_AI */ - 0, /* EA_MODE_PI */ - 0, /* EA_MODE_PI7 */ - 0, /* EA_MODE_PD */ - 0, /* EA_MODE_PD7 */ - 8, /* EA_MODE_DI */ - 12, /* EA_MODE_IX */ - 8, /* EA_MODE_AW */ - 12, /* EA_MODE_AL */ - 8, /* EA_MODE_PCDI */ - 12, /* EA_MODE_PCIX */ - 0, /* EA_MODE_I */ -}; - -/* Extra cycles for PEA instruction (000, 010) */ -const int g_pea_cycle_table[13] = -{ - 0, /* EA_MODE_NONE */ - 6, /* EA_MODE_AI */ - 0, /* EA_MODE_PI */ - 0, /* EA_MODE_PI7 */ - 0, /* EA_MODE_PD */ - 0, /* EA_MODE_PD7 */ - 10, /* EA_MODE_DI */ - 14, /* EA_MODE_IX */ - 10, /* EA_MODE_AW */ - 14, /* EA_MODE_AL */ - 10, /* EA_MODE_PCDI */ - 14, /* EA_MODE_PCIX */ - 0, /* EA_MODE_I */ -}; - -/* Extra cycles for MOVEM instruction (000, 010) */ -const int g_movem_cycle_table[13] = -{ - 0, /* EA_MODE_NONE */ - 0, /* EA_MODE_AI */ - 0, /* EA_MODE_PI */ - 0, /* EA_MODE_PI7 */ - 0, /* EA_MODE_PD */ - 0, /* EA_MODE_PD7 */ - 4, /* EA_MODE_DI */ - 6, /* EA_MODE_IX */ - 4, /* EA_MODE_AW */ - 8, /* EA_MODE_AL */ - 0, /* EA_MODE_PCDI */ - 0, /* EA_MODE_PCIX */ - 0, /* EA_MODE_I */ -}; - -/* Extra cycles for MOVES instruction (010) */ -const int g_moves_cycle_table[13][3] = -{ - { 0, 0, 0}, /* EA_MODE_NONE */ - { 0, 4, 6}, /* EA_MODE_AI */ - { 0, 4, 6}, /* EA_MODE_PI */ - { 0, 4, 6}, /* EA_MODE_PI7 */ - { 0, 6, 12}, /* EA_MODE_PD */ - { 0, 6, 12}, /* EA_MODE_PD7 */ - { 0, 12, 16}, /* EA_MODE_DI */ - { 0, 16, 20}, /* EA_MODE_IX */ - { 0, 12, 16}, /* EA_MODE_AW */ - { 0, 16, 20}, /* EA_MODE_AL */ - { 0, 0, 0}, /* EA_MODE_PCDI */ - { 0, 0, 0}, /* EA_MODE_PCIX */ - { 0, 0, 0}, /* EA_MODE_I */ -}; - -/* Extra cycles for CLR instruction (010) */ -const int g_clr_cycle_table[13][3] = -{ - { 0, 0, 0}, /* EA_MODE_NONE */ - { 0, 4, 6}, /* EA_MODE_AI */ - { 0, 4, 6}, /* EA_MODE_PI */ - { 0, 4, 6}, /* EA_MODE_PI7 */ - { 0, 6, 8}, /* EA_MODE_PD */ - { 0, 6, 8}, /* EA_MODE_PD7 */ - { 0, 8, 10}, /* EA_MODE_DI */ - { 0, 10, 14}, /* EA_MODE_IX */ - { 0, 8, 10}, /* EA_MODE_AW */ - { 0, 10, 14}, /* EA_MODE_AL */ - { 0, 0, 0}, /* EA_MODE_PCDI */ - { 0, 0, 0}, /* EA_MODE_PCIX */ - { 0, 0, 0}, /* EA_MODE_I */ -}; - - - -/* ======================================================================== */ -/* =========================== UTILITY FUNCTIONS ========================== */ -/* ======================================================================== */ - -/* Print an error message and exit with status error */ -void error_exit(const char* fmt, ...) -{ - va_list args; - fprintf(stderr, "In %s, near or on line %d:\n\t", g_input_filename, g_line_number); - va_start(args, fmt); - vfprintf(stderr, fmt, args); - va_end(args); - fprintf(stderr, "\n"); - - if(g_prototype_file) fclose(g_prototype_file); - if(g_table_file) fclose(g_table_file); - if(g_input_file) fclose(g_input_file); - - exit(EXIT_FAILURE); -} - -/* Print an error message, call perror(), and exit with status error */ -void perror_exit(const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - vfprintf(stderr, fmt, args); - va_end(args); - perror(""); - - if(g_prototype_file) fclose(g_prototype_file); - if(g_table_file) fclose(g_table_file); - if(g_input_file) fclose(g_input_file); - - exit(EXIT_FAILURE); -} - - -/* copy until 0 or space and exit with error if we read too far */ -int check_strsncpy(char* dst, char* src, int maxlength) -{ - char* p = dst; - while(*src && *src != ' ') - { - *p++ = *src++; - if(p - dst > maxlength) - error_exit("Field too long"); - } - *p = 0; - return p - dst; -} - -/* copy until 0 or specified character and exit with error if we read too far */ -int check_strcncpy(char* dst, char* src, char delim, int maxlength) -{ - char* p = dst; - while(*src && *src != delim) - { - *p++ = *src++; - if(p - dst > maxlength) - error_exit("Field too long"); - } - *p = 0; - return p - dst; -} - -/* convert ascii to integer and exit with error if we find invalid data */ -int check_atoi(char* str, int *result) -{ - int accum = 0; - char* p = str; - while(*p >= '0' && *p <= '9') - { - accum *= 10; - accum += *p++ - '0'; - } - if(*p != ' ' && *p != 0) - error_exit("Malformed integer value (%c)", *p); - *result = accum; - return p - str; -} - -/* Skip past spaces in a string */ -int skip_spaces(char* str) -{ - char* p = str; - - while(*p == ' ') - p++; - - return p - str; -} - -/* Count the number of set bits in a value */ -int num_bits(int value) -{ - value = ((value & 0xaaaa) >> 1) + (value & 0x5555); - value = ((value & 0xcccc) >> 2) + (value & 0x3333); - value = ((value & 0xf0f0) >> 4) + (value & 0x0f0f); - value = ((value & 0xff00) >> 8) + (value & 0x00ff); - return value; -} - -/* Convert a hex value written in ASCII */ -int atoh(char* buff) -{ - int accum = 0; - - for(;;buff++) - { - if(*buff >= '0' && *buff <= '9') - { - accum <<= 4; - accum += *buff - '0'; - } - else if(*buff >= 'a' && *buff <= 'f') - { - accum <<= 4; - accum += *buff - 'a' + 10; - } - else break; - } - return accum; -} - -/* Get a line of text from a file, discarding any end-of-line characters */ -int fgetline(char* buff, int nchars, FILE* file) -{ - int length; - - if(fgets(buff, nchars, file) == NULL) - return -1; - if(buff[0] == '\r') - memmove(buff, buff + 1, nchars - 1); - - length = strlen(buff); - while(length && (buff[length-1] == '\r' || buff[length-1] == '\n')) - length--; - buff[length] = 0; - g_line_number++; - - return length; -} - - - -/* ======================================================================== */ -/* =========================== HELPER FUNCTIONS =========================== */ -/* ======================================================================== */ - -/* Calculate the number of cycles an opcode requires */ -int get_oper_cycles(opcode_struct* op, int ea_mode, int cpu_type) -{ - int size = g_size_select_table[op->size]; - - if(op->cpus[cpu_type] == '.') - return 0; - - if(cpu_type < CPU_TYPE_020) - { - if(cpu_type == CPU_TYPE_010) - { - if(strcmp(op->name, "moves") == 0) - return op->cycles[cpu_type] + g_moves_cycle_table[ea_mode][size]; - if(strcmp(op->name, "clr") == 0) - return op->cycles[cpu_type] + g_clr_cycle_table[ea_mode][size]; - } - - /* ASG: added these cases -- immediate modes take 2 extra cycles here */ - /* SV: but only when operating on long, and also on register direct mode */ - if(cpu_type == CPU_TYPE_000 && (ea_mode == EA_MODE_I || ea_mode == EA_MODE_NONE) && op->size == 32 && - ((strcmp(op->name, "add") == 0 && strcmp(op->spec_proc, "er") == 0) || - strcmp(op->name, "adda") == 0 || - (strcmp(op->name, "and") == 0 && strcmp(op->spec_proc, "er") == 0) || - (strcmp(op->name, "or") == 0 && strcmp(op->spec_proc, "er") == 0) || - (strcmp(op->name, "sub") == 0 && strcmp(op->spec_proc, "er") == 0) || - strcmp(op->name, "suba") == 0)) - return op->cycles[cpu_type] + g_ea_cycle_table[ea_mode][cpu_type][size] + 2; - - if(strcmp(op->name, "jmp") == 0) - return op->cycles[cpu_type] + g_jmp_cycle_table[ea_mode]; - if(strcmp(op->name, "jsr") == 0) - return op->cycles[cpu_type] + g_jsr_cycle_table[ea_mode]; - if(strcmp(op->name, "lea") == 0) - return op->cycles[cpu_type] + g_lea_cycle_table[ea_mode]; - if(strcmp(op->name, "pea") == 0) - return op->cycles[cpu_type] + g_pea_cycle_table[ea_mode]; - if(strcmp(op->name, "movem") == 0) - return op->cycles[cpu_type] + g_movem_cycle_table[ea_mode]; - } - return op->cycles[cpu_type] + g_ea_cycle_table[ea_mode][cpu_type][size]; -} - -/* Find an opcode in the opcode handler list */ -opcode_struct* find_opcode(char* name, int size, char* spec_proc, char* spec_ea) -{ - opcode_struct* op; - - - for(op = g_opcode_input_table;op->name != NULL;op++) - { - if( strcmp(name, op->name) == 0 && - (size == op->size) && - strcmp(spec_proc, op->spec_proc) == 0 && - strcmp(spec_ea, op->spec_ea) == 0) - return op; - } - return NULL; -} - -/* Specifically find the illegal opcode in the list */ -opcode_struct* find_illegal_opcode(void) -{ - opcode_struct* op; - - for(op = g_opcode_input_table;op->name != NULL;op++) - { - if(strcmp(op->name, "illegal") == 0) - return op; - } - return NULL; -} - -/* Parse an opcode handler name */ -int extract_opcode_info(char* src, char* name, int* size, char* spec_proc, char* spec_ea) -{ - char* ptr = strstr(src, ID_OPHANDLER_NAME); - - if(ptr == NULL) - return 0; - - ptr += strlen(ID_OPHANDLER_NAME) + 1; - - ptr += check_strcncpy(name, ptr, ',', MAX_NAME_LENGTH); - if(*ptr != ',') return 0; - ptr++; - ptr += skip_spaces(ptr); - - *size = atoi(ptr); - ptr = strstr(ptr, ","); - if(ptr == NULL) return 0; - ptr++; - ptr += skip_spaces(ptr); - - ptr += check_strcncpy(spec_proc, ptr, ',', MAX_SPEC_PROC_LENGTH); - if(*ptr != ',') return 0; - ptr++; - ptr += skip_spaces(ptr); - - ptr += check_strcncpy(spec_ea, ptr, ')', MAX_SPEC_EA_LENGTH); - if(*ptr != ')') return 0; - ptr++; - ptr += skip_spaces(ptr); - - return 1; -} - - -/* Add a search/replace pair to a replace structure */ -void add_replace_string(replace_struct* replace, const char* search_str, const char* replace_str) -{ - if(replace->length >= MAX_REPLACE_LENGTH) - error_exit("overflow in replace structure"); - - strcpy(replace->replace[replace->length][0], search_str); - strcpy(replace->replace[replace->length++][1], replace_str); -} - -/* Write a function body while replacing any selected strings */ -void write_body(FILE* filep, body_struct* body, replace_struct* replace) -{ - int i; - int j; - char* ptr; - char output[MAX_LINE_LENGTH+1]; - char temp_buff[MAX_LINE_LENGTH+1]; - int found; - - for(i=0;ilength;i++) - { - strcpy(output, body->body[i]); - /* Check for the base directive header */ - if(strstr(output, ID_BASE) != NULL) - { - /* Search for any text we need to replace */ - found = 0; - for(j=0;jlength;j++) - { - ptr = strstr(output, replace->replace[j][0]); - if(ptr) - { - /* We found something to replace */ - found = 1; - strcpy(temp_buff, ptr+strlen(replace->replace[j][0])); - strcpy(ptr, replace->replace[j][1]); - strcat(ptr, temp_buff); - } - } - /* Found a directive with no matching replace string */ - if(!found) - error_exit("Unknown " ID_BASE " directive"); - } - fprintf(filep, "%s\n", output); - } - fprintf(filep, "\n\n"); -} - -/* Generate a base function name from an opcode struct */ -void get_base_name(char* base_name, opcode_struct* op) -{ - sprintf(base_name, "m68k_op_%s", op->name); - if(op->size > 0) - sprintf(base_name+strlen(base_name), "_%d", op->size); - if(strcmp(op->spec_proc, UNSPECIFIED) != 0) - sprintf(base_name+strlen(base_name), "_%s", op->spec_proc); - if(strcmp(op->spec_ea, UNSPECIFIED) != 0) - sprintf(base_name+strlen(base_name), "_%s", op->spec_ea); -} - -/* Write the name of an opcode handler function */ -void write_function_name(FILE* filep, char* base_name) -{ - fprintf(filep, "static void %s(void)\n", base_name); -} - -void add_opcode_output_table_entry(opcode_struct* op, char* name) -{ - opcode_struct* ptr; - if(g_opcode_output_table_length > MAX_OPCODE_OUTPUT_TABLE_LENGTH) - error_exit("Opcode output table overflow"); - - ptr = g_opcode_output_table + g_opcode_output_table_length++; - - *ptr = *op; - strcpy(ptr->name, name); - ptr->bits = num_bits(ptr->op_mask); -} - -/* - * Comparison function for qsort() - * For entries with an equal number of set bits in - * the mask compare the match values - */ -static int DECL_SPEC compare_nof_true_bits(const void* aptr, const void* bptr) -{ - const opcode_struct *a = aptr, *b = bptr; - if(a->bits != b->bits) - return a->bits - b->bits; - if(a->op_mask != b->op_mask) - return a->op_mask - b->op_mask; - return a->op_match - b->op_match; -} - -void print_opcode_output_table(FILE* filep) -{ - int i; - qsort((void *)g_opcode_output_table, g_opcode_output_table_length, sizeof(g_opcode_output_table[0]), compare_nof_true_bits); - - for(i=0;iname, op->op_mask, op->op_match); - - for(i=0;icycles[i]); - if(i < NUM_CPUS-1) - fprintf(filep, ", "); - } - - fprintf(filep, "}},\n"); -} - -/* Fill out an opcode struct with a specific addressing mode of the source opcode struct */ -void set_opcode_struct(opcode_struct* src, opcode_struct* dst, int ea_mode) -{ - int i; - - *dst = *src; - - for(i=0;icycles[i] = get_oper_cycles(dst, ea_mode, i); - if(strcmp(dst->spec_ea, UNSPECIFIED) == 0 && ea_mode != EA_MODE_NONE) - sprintf(dst->spec_ea, "%s", g_ea_info_table[ea_mode].fname_add); - dst->op_mask |= g_ea_info_table[ea_mode].mask_add; - dst->op_match |= g_ea_info_table[ea_mode].match_add; -} - - -/* Generate a final opcode handler from the provided data */ -void generate_opcode_handler(FILE* filep, body_struct* body, replace_struct* replace, opcode_struct* opinfo, int ea_mode) -{ - char str[MAX_LINE_LENGTH+1]; - opcode_struct* op = malloc(sizeof(opcode_struct)); - - /* Set the opcode structure and write the tables, prototypes, etc */ - set_opcode_struct(opinfo, op, ea_mode); - get_base_name(str, op); - add_opcode_output_table_entry(op, str); - write_function_name(filep, str); - - /* Add any replace strings needed */ - if(ea_mode != EA_MODE_NONE) - { - sprintf(str, "EA_%s_8()", g_ea_info_table[ea_mode].ea_add); - add_replace_string(replace, ID_OPHANDLER_EA_AY_8, str); - sprintf(str, "EA_%s_16()", g_ea_info_table[ea_mode].ea_add); - add_replace_string(replace, ID_OPHANDLER_EA_AY_16, str); - sprintf(str, "EA_%s_32()", g_ea_info_table[ea_mode].ea_add); - add_replace_string(replace, ID_OPHANDLER_EA_AY_32, str); - sprintf(str, "OPER_%s_8()", g_ea_info_table[ea_mode].ea_add); - add_replace_string(replace, ID_OPHANDLER_OPER_AY_8, str); - sprintf(str, "OPER_%s_16()", g_ea_info_table[ea_mode].ea_add); - add_replace_string(replace, ID_OPHANDLER_OPER_AY_16, str); - sprintf(str, "OPER_%s_32()", g_ea_info_table[ea_mode].ea_add); - add_replace_string(replace, ID_OPHANDLER_OPER_AY_32, str); - } - - /* Now write the function body with the selected replace strings */ - write_body(filep, body, replace); - g_num_functions++; - free(op); -} - -/* Generate opcode variants based on available addressing modes */ -void generate_opcode_ea_variants(FILE* filep, body_struct* body, replace_struct* replace, opcode_struct* op) -{ - int old_length = replace->length; - - /* No ea modes available for this opcode */ - if(HAS_NO_EA_MODE(op->ea_allowed)) - { - generate_opcode_handler(filep, body, replace, op, EA_MODE_NONE); - return; - } - - /* Check for and create specific opcodes for each available addressing mode */ - if(HAS_EA_AI(op->ea_allowed)) - generate_opcode_handler(filep, body, replace, op, EA_MODE_AI); - replace->length = old_length; - if(HAS_EA_PI(op->ea_allowed)) - { - generate_opcode_handler(filep, body, replace, op, EA_MODE_PI); - replace->length = old_length; - if(op->size == 8) - generate_opcode_handler(filep, body, replace, op, EA_MODE_PI7); - } - replace->length = old_length; - if(HAS_EA_PD(op->ea_allowed)) - { - generate_opcode_handler(filep, body, replace, op, EA_MODE_PD); - replace->length = old_length; - if(op->size == 8) - generate_opcode_handler(filep, body, replace, op, EA_MODE_PD7); - } - replace->length = old_length; - if(HAS_EA_DI(op->ea_allowed)) - generate_opcode_handler(filep, body, replace, op, EA_MODE_DI); - replace->length = old_length; - if(HAS_EA_IX(op->ea_allowed)) - generate_opcode_handler(filep, body, replace, op, EA_MODE_IX); - replace->length = old_length; - if(HAS_EA_AW(op->ea_allowed)) - generate_opcode_handler(filep, body, replace, op, EA_MODE_AW); - replace->length = old_length; - if(HAS_EA_AL(op->ea_allowed)) - generate_opcode_handler(filep, body, replace, op, EA_MODE_AL); - replace->length = old_length; - if(HAS_EA_PCDI(op->ea_allowed)) - generate_opcode_handler(filep, body, replace, op, EA_MODE_PCDI); - replace->length = old_length; - if(HAS_EA_PCIX(op->ea_allowed)) - generate_opcode_handler(filep, body, replace, op, EA_MODE_PCIX); - replace->length = old_length; - if(HAS_EA_I(op->ea_allowed)) - generate_opcode_handler(filep, body, replace, op, EA_MODE_I); - replace->length = old_length; -} - -/* Generate variants of condition code opcodes */ -void generate_opcode_cc_variants(FILE* filep, body_struct* body, replace_struct* replace, opcode_struct* op_in, int offset) -{ - char repl[20]; - char replnot[20]; - int i; - int old_length = replace->length; - opcode_struct* op = malloc(sizeof(opcode_struct)); - - *op = *op_in; - - op->op_mask |= 0x0f00; - - /* Do all condition codes except t and f */ - for(i=2;i<16;i++) - { - /* Add replace strings for this condition code */ - sprintf(repl, "COND_%s()", g_cc_table[i][1]); - sprintf(replnot, "COND_NOT_%s()", g_cc_table[i][1]); - - add_replace_string(replace, ID_OPHANDLER_CC, repl); - add_replace_string(replace, ID_OPHANDLER_NOT_CC, replnot); - - /* Set the new opcode info */ - strcpy(op->name+offset, g_cc_table[i][0]); - - op->op_match = (op->op_match & 0xf0ff) | (i<<8); - - /* Generate all opcode variants for this modified opcode */ - generate_opcode_ea_variants(filep, body, replace, op); - /* Remove the above replace strings */ - replace->length = old_length; - } - free(op); -} - -/* Process the opcode handlers section of the input file */ -void process_opcode_handlers(FILE* filep) -{ - FILE* input_file = g_input_file; - char func_name[MAX_LINE_LENGTH+1]; - char oper_name[MAX_LINE_LENGTH+1]; - int oper_size; - char oper_spec_proc[MAX_LINE_LENGTH+1]; - char oper_spec_ea[MAX_LINE_LENGTH+1]; - opcode_struct* opinfo; - replace_struct* replace = malloc(sizeof(replace_struct)); - body_struct* body = malloc(sizeof(body_struct)); - - for(;;) - { - /* Find the first line of the function */ - func_name[0] = 0; - while(strstr(func_name, ID_OPHANDLER_NAME) == NULL) - { - if(strcmp(func_name, ID_INPUT_SEPARATOR) == 0) - { - free(replace); - free(body); - return; /* all done */ - } - if(fgetline(func_name, MAX_LINE_LENGTH, input_file) < 0) - error_exit("Premature end of file when getting function name"); - } - /* Get the rest of the function */ - for(body->length=0;;body->length++) - { - if(body->length > MAX_BODY_LENGTH) - error_exit("Function too long"); - - if(fgetline(body->body[body->length], MAX_LINE_LENGTH, input_file) < 0) - error_exit("Premature end of file when getting function body"); - - if(body->body[body->length][0] == '}') - { - body->length++; - break; - } - } - - g_num_primitives++; - - /* Extract the function name information */ - if(!extract_opcode_info(func_name, oper_name, &oper_size, oper_spec_proc, oper_spec_ea)) - error_exit("Invalid " ID_OPHANDLER_NAME " format"); - - /* Find the corresponding table entry */ - opinfo = find_opcode(oper_name, oper_size, oper_spec_proc, oper_spec_ea); - if(opinfo == NULL) - error_exit("Unable to find matching table entry for %s", func_name); - - replace->length = 0; - - /* Generate opcode variants */ - if(strcmp(opinfo->name, "bcc") == 0 || strcmp(opinfo->name, "scc") == 0) - generate_opcode_cc_variants(filep, body, replace, opinfo, 1); - else if(strcmp(opinfo->name, "dbcc") == 0) - generate_opcode_cc_variants(filep, body, replace, opinfo, 2); - else if(strcmp(opinfo->name, "trapcc") == 0) - generate_opcode_cc_variants(filep, body, replace, opinfo, 4); - else - generate_opcode_ea_variants(filep, body, replace, opinfo); - } - - free(replace); - free(body); -} - - -/* Populate the opcode handler table from the input file */ -void populate_table(void) -{ - char* ptr; - char bitpattern[17]; - opcode_struct* op; - char buff[MAX_LINE_LENGTH]; - int i; - int temp; - - buff[0] = 0; - - /* Find the start of the table */ - while(strcmp(buff, ID_TABLE_START) != 0) - if(fgetline(buff, MAX_LINE_LENGTH, g_input_file) < 0) - error_exit("Premature EOF while reading table"); - - /* Process the entire table */ - for(op = g_opcode_input_table;;op++) - { - if(fgetline(buff, MAX_LINE_LENGTH, g_input_file) < 0) - error_exit("Premature EOF while reading table"); - if(strlen(buff) == 0) - continue; - /* We finish when we find an input separator */ - if(strcmp(buff, ID_INPUT_SEPARATOR) == 0) - break; - - /* Extract the info from the table */ - ptr = buff; - - /* Name */ - ptr += skip_spaces(ptr); - ptr += check_strsncpy(op->name, ptr, MAX_NAME_LENGTH); - - /* Size */ - ptr += skip_spaces(ptr); - ptr += check_atoi(ptr, &temp); - op->size = (unsigned char)temp; - - /* Special processing */ - ptr += skip_spaces(ptr); - ptr += check_strsncpy(op->spec_proc, ptr, MAX_SPEC_PROC_LENGTH); - - /* Specified EA Mode */ - ptr += skip_spaces(ptr); - ptr += check_strsncpy(op->spec_ea, ptr, MAX_SPEC_EA_LENGTH); - - /* Bit Pattern (more processing later) */ - ptr += skip_spaces(ptr); - ptr += check_strsncpy(bitpattern, ptr, 17); - - /* Allowed Addressing Mode List */ - ptr += skip_spaces(ptr); - ptr += check_strsncpy(op->ea_allowed, ptr, EA_ALLOWED_LENGTH); - - /* CPU operating mode (U = user or supervisor, S = supervisor only */ - ptr += skip_spaces(ptr); - for(i=0;icpu_mode[i] = *ptr++; - ptr += skip_spaces(ptr); - } - - /* Allowed CPUs for this instruction */ - for(i=0;icpus[i] = UNSPECIFIED_CH; - op->cycles[i] = 0; - ptr++; - } - else - { - op->cpus[i] = '0' + i; - ptr += check_atoi(ptr, &temp); - op->cycles[i] = (unsigned char)temp; - } - } - - /* generate mask and match from bitpattern */ - op->op_mask = 0; - op->op_match = 0; - for(i=0;i<16;i++) - { - op->op_mask |= (bitpattern[i] != '.') << (15-i); - op->op_match |= (bitpattern[i] == '1') << (15-i); - } - } - /* Terminate the list */ - op->name[0] = 0; -} - -/* Read a header or footer insert from the input file */ -void read_insert(char* insert) -{ - char* ptr = insert; - char* overflow = insert + MAX_INSERT_LENGTH - MAX_LINE_LENGTH; - int length; - char* first_blank = NULL; - - first_blank = NULL; - - /* Skip any leading blank lines */ - for(length = 0;length == 0;length = fgetline(ptr, MAX_LINE_LENGTH, g_input_file)) - if(ptr >= overflow) - error_exit("Buffer overflow reading inserts"); - if(length < 0) - error_exit("Premature EOF while reading inserts"); - - /* Advance and append newline */ - ptr += length; - strcpy(ptr++, "\n"); - - /* Read until next separator */ - for(;;) - { - /* Read a new line */ - if(ptr >= overflow) - error_exit("Buffer overflow reading inserts"); - if((length = fgetline(ptr, MAX_LINE_LENGTH, g_input_file)) < 0) - error_exit("Premature EOF while reading inserts"); - - /* Stop if we read a separator */ - if(strcmp(ptr, ID_INPUT_SEPARATOR) == 0) - break; - - /* keep track in case there are trailing blanks */ - if(length == 0) - { - if(first_blank == NULL) - first_blank = ptr; - } - else - first_blank = NULL; - - /* Advance and append newline */ - ptr += length; - strcpy(ptr++, "\n"); - } - - /* kill any trailing blank lines */ - if(first_blank) - ptr = first_blank; - *ptr++ = 0; -} - - - -/* ======================================================================== */ -/* ============================= MAIN FUNCTION ============================ */ -/* ======================================================================== */ - -int main(int argc, char **argv) -{ - /* File stuff */ - char output_path[M68K_MAX_DIR] = ""; - char filename[M68K_MAX_PATH]; - /* Section identifier */ - char section_id[MAX_LINE_LENGTH+1]; - /* Inserts */ - char temp_insert[MAX_INSERT_LENGTH+1]; - char prototype_footer_insert[MAX_INSERT_LENGTH+1]; - char table_header_insert[MAX_INSERT_LENGTH+1]; - char table_footer_insert[MAX_INSERT_LENGTH+1]; - char ophandler_header_insert[MAX_INSERT_LENGTH+1]; - char ophandler_footer_insert[MAX_INSERT_LENGTH+1]; - /* Flags if we've processed certain parts already */ - int prototype_header_read = 0; - int prototype_footer_read = 0; - int table_header_read = 0; - int table_footer_read = 0; - int ophandler_header_read = 0; - int ophandler_footer_read = 0; - int table_body_read = 0; - int ophandler_body_read = 0; - - printf("\n\tMusashi v%s 68000, 68008, 68010, 68EC020, 68020, 68040 emulator\n", g_version); - printf("\tCopyright Karl Stenerud (karl@mame.net)\n\n"); - - /* Check if output path and source for the input file are given */ - if(argc > 1) - { - char *ptr; - strcpy(output_path, argv[1]); - - for(ptr = strchr(output_path, '\\'); ptr; ptr = strchr(ptr, '\\')) - *ptr = '/'; - -#if !(defined(__DECC) && defined(VMS)) - if(output_path[strlen(output_path)-1] != '/') - strcat(output_path, "/"); -#endif - - if(argc > 2) - strcpy(g_input_filename, argv[2]); - } - - -#if defined(__DECC) && defined(VMS) - - /* Open the files we need */ - sprintf(filename, "%s%s", output_path, FILENAME_PROTOTYPE); - if((g_prototype_file = fopen(filename, "w")) == NULL) - perror_exit("Unable to create prototype file (%s)\n", filename); - - sprintf(filename, "%s%s", output_path, FILENAME_TABLE); - if((g_table_file = fopen(filename, "w")) == NULL) - perror_exit("Unable to create table file (%s)\n", filename); - - if((g_input_file=fopen(g_input_filename, "r")) == NULL) - perror_exit("can't open %s for input", g_input_filename); - -#else - - - /* Open the files we need */ - sprintf(filename, "%s%s", output_path, FILENAME_PROTOTYPE); - if((g_prototype_file = fopen(filename, "wt")) == NULL) - perror_exit("Unable to create prototype file (%s)\n", filename); - - sprintf(filename, "%s%s", output_path, FILENAME_TABLE); - if((g_table_file = fopen(filename, "wt")) == NULL) - perror_exit("Unable to create table file (%s)\n", filename); - - if((g_input_file=fopen(g_input_filename, "rt")) == NULL) - perror_exit("can't open %s for input", g_input_filename); - -#endif - - /* Get to the first section of the input file */ - section_id[0] = 0; - while(strcmp(section_id, ID_INPUT_SEPARATOR) != 0) - if(fgetline(section_id, MAX_LINE_LENGTH, g_input_file) < 0) - error_exit("Premature EOF while reading input file"); - - /* Now process all sections */ - for(;;) - { - if(fgetline(section_id, MAX_LINE_LENGTH, g_input_file) < 0) - error_exit("Premature EOF while reading input file"); - if(strcmp(section_id, ID_PROTOTYPE_HEADER) == 0) - { - if(prototype_header_read) - error_exit("Duplicate prototype header"); - read_insert(temp_insert); - fprintf(g_prototype_file, "%s\n\n", temp_insert); - prototype_header_read = 1; - } - else if(strcmp(section_id, ID_TABLE_HEADER) == 0) - { - if(table_header_read) - error_exit("Duplicate table header"); - read_insert(table_header_insert); - table_header_read = 1; - } - else if(strcmp(section_id, ID_OPHANDLER_HEADER) == 0) - { - if(ophandler_header_read) - error_exit("Duplicate opcode handler header"); - read_insert(ophandler_header_insert); - ophandler_header_read = 1; - } - else if(strcmp(section_id, ID_PROTOTYPE_FOOTER) == 0) - { - if(prototype_footer_read) - error_exit("Duplicate prototype footer"); - read_insert(prototype_footer_insert); - prototype_footer_read = 1; - } - else if(strcmp(section_id, ID_TABLE_FOOTER) == 0) - { - if(table_footer_read) - error_exit("Duplicate table footer"); - read_insert(table_footer_insert); - table_footer_read = 1; - } - else if(strcmp(section_id, ID_OPHANDLER_FOOTER) == 0) - { - if(ophandler_footer_read) - error_exit("Duplicate opcode handler footer"); - read_insert(ophandler_footer_insert); - ophandler_footer_read = 1; - } - else if(strcmp(section_id, ID_TABLE_BODY) == 0) - { - if(!prototype_header_read) - error_exit("Table body encountered before prototype header"); - if(!table_header_read) - error_exit("Table body encountered before table header"); - if(!ophandler_header_read) - error_exit("Table body encountered before opcode handler header"); - - if(table_body_read) - error_exit("Duplicate table body"); - - populate_table(); - table_body_read = 1; - } - else if(strcmp(section_id, ID_OPHANDLER_BODY) == 0) - { - if(!prototype_header_read) - error_exit("Opcode handlers encountered before prototype header"); - if(!table_header_read) - error_exit("Opcode handlers encountered before table header"); - if(!ophandler_header_read) - error_exit("Opcode handlers encountered before opcode handler header"); - if(!table_body_read) - error_exit("Opcode handlers encountered before table body"); - - if(ophandler_body_read) - error_exit("Duplicate opcode handler section"); - - fprintf(g_table_file, "%s\n\n", ophandler_header_insert); - process_opcode_handlers(g_table_file); - fprintf(g_table_file, "%s\n\n", ophandler_footer_insert); - - ophandler_body_read = 1; - } - else if(strcmp(section_id, ID_END) == 0) - { - /* End of input file. Do a sanity check and then write footers */ - if(!prototype_header_read) - error_exit("Missing prototype header"); - if(!prototype_footer_read) - error_exit("Missing prototype footer"); - if(!table_header_read) - error_exit("Missing table header"); - if(!table_footer_read) - error_exit("Missing table footer"); - if(!table_body_read) - error_exit("Missing table body"); - if(!ophandler_header_read) - error_exit("Missing opcode handler header"); - if(!ophandler_footer_read) - error_exit("Missing opcode handler footer"); - if(!ophandler_body_read) - error_exit("Missing opcode handler body"); - - fprintf(g_table_file, "%s\n\n", table_header_insert); - print_opcode_output_table(g_table_file); - fprintf(g_table_file, "%s\n\n", table_footer_insert); - - fprintf(g_prototype_file, "%s\n\n", prototype_footer_insert); - - break; - } - else - { - error_exit("Unknown section identifier: %s", section_id); - } - } - - /* Close all files and exit */ - fclose(g_prototype_file); - fclose(g_table_file); - fclose(g_input_file); - - printf("Generated %d opcode handlers from %d primitives\n", g_num_functions, g_num_primitives); - - return 0; -} - - - -/* ======================================================================== */ -/* ============================== END OF FILE ============================= */ -/* ======================================================================== */ diff --git a/jan/src/cpu/mips3/cop0.cpp b/jan/src/cpu/mips3/cop0.cpp deleted file mode 100644 index f3862e89d..000000000 --- a/jan/src/cpu/mips3/cop0.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#include -#include -#include "mips3.h" -#include "mipsdef.h" -#include "mips3_memory.h" - -namespace mips -{ - -const char *mips3::cop0_reg_names[32] = { - "Index", "Random", "EntryLo0", "EntryLo1", "Context", - "PageMask", "Wired", "--", "BadVAddr", "Count", "EntryHi", - "Compare", "SR", "Cause", "EPC", "PRId", "Config", "LLAddr", - "WatchLo", "WatchHi", "XContext", "--", "--", "--", "--","--", - "ECC", "CacheErr", "TagLo", "TagHi", "ErrorEPC", "--" -}; - -#define CR(x) m_state.cpr[0][x] - -void mips3::tlb_init() -{ - m_tlb = new tlb_entry[m_tlb_entries]; -} - -void mips3::tlb_flush() -{ - for (int i = 0; i < m_tlb_entries; i++) { - m_tlb[i].v[0] = 0; - m_tlb[i].v[1] = 0; - } -} - - -void mips3::cop0_execute(uint32_t opcode) -{ - switch (RSNUM) { - // MFC - case 0x00: - if (RTNUM) { - if (RDNUM == COP0_Count) { - RT = (uint32_t) ((m_state.total_cycles - m_state.reset_cycle) / 2); - return; - } - RT = CR(RDNUM); - } - break; - - // MTC - case 0x04: - m_state.cpr[0][RDNUM] = RT; - if (RDNUM == COP0_Count) { - m_state.reset_cycle = m_state.total_cycles - ((uint64_t)(uint32_t)RT * 2); - } - break; - - // TLBWI - case 0x10: { - unsigned char idx = CR(COP0_Index); - if (idx >= 48) { - cout << "TLBWI index > 48" << endl; - return; - } - tlb_entry *e = &m_tlb[idx]; - e->b.even_lo = CR(COP0_EntryLo0); - e->b.odd_lo = CR(COP0_EntryLo1); - e->b.hi = CR(COP0_EntryHi); - e->b.pagemask = CR(COP0_PageMask); - break; - } - - default: - cout << "Op: " << RSNUM << " [COP0]" << endl; - break; - } -} - -void mips3::cop0_reset() -{ - for (int i = 0; i < 32; i++) - m_state.cpr[0][i] = 0; -} - -} diff --git a/jan/src/cpu/mips3/cop1.cpp b/jan/src/cpu/mips3/cop1.cpp deleted file mode 100644 index 133ad5cef..000000000 --- a/jan/src/cpu/mips3/cop1.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#include -#include -#include -#include "mips3.h" -#include "mipsdef.h" -#include "mips3_memory.h" -//#include - -#define FPR_s(n) (*(float *) ((void *)&m_state.cpr[1][n])) -#define FPR_d(n) (*(double *) ((void *)&m_state.cpr[1][n])) - -#define FD_d FPR_d(FDNUM) -#define FS_d FPR_d(FSNUM) -#define FT_d FPR_d(FTNUM) - -#define FD_s FPR_s(FDNUM) -#define FS_s FPR_s(FSNUM) -#define FT_s FPR_s(FTNUM) - -#define FD_w (*(uint32_t *) &m_state.cpr[1][FDNUM]) -#define FS_w (*(uint32_t *) &m_state.cpr[1][FSNUM]) -#define FT_w (*(uint32_t *) &m_state.cpr[1][FTNUM]) - -#define FD_l m_state.cpr[1][FDNUM] -#define FS_l m_state.cpr[1][FSNUM] -#define FT_l m_state.cpr[1][FTNUM] - -#define FCR31 m_state.fcr[31] - -#define FLOAT (RSNUM == 16 || RSNUM == 17) -// Double/Single precision -#define DP (RSNUM == 17 || RSNUM == 21) -#define SP (RSNUM == 16 || RSNUM == 20) - -#define INTEGER (RSNUM == 20 || RSNUM == 21) -// Word/Long precision -#define WT (RSNUM == 20) -#define LT (RSNUM == 21) - -namespace mips -{ - -void mips3::cop1_reset() -{ - for (int i = 0; i < 32; i++) { - FPR_d(i) = -1.0; - m_state.fcr[i] = 0; - } -} - -void mips3::cop1_execute_16(uint32_t opcode) -{ - //qDebug() << QString::number(m_state.pc, 16) << "Op:" << RSNUM << (opcode & 0x3F) << "[FPU16]"; -} - -void mips3::cop1_execute_32(uint32_t opcode) -{ - //qDebug() << QString(dasm(opcode, m_prev_pc).c_str()); - switch (RSNUM) { - // MFC1 rt, rd - case 0x00: - if (RTNUM) - RT = (int32_t) m_state.cpr[1][RDNUM]; - break; - - // DMFC1 rt, rd - case 0x01: - if (RTNUM) - RT = (uint64_t) m_state.cpr[1][RDNUM]; - break; - - // CFC1 rt, fs - case 0x02: - if (RTNUM) - RT = (int32_t) m_state.fcr[FSNUM]; - break; - - // MTC1 rt, fs - case 0x04: - m_state.cpr[1][FSNUM] = (uint32_t) RT; - break; - - // DMTC1 rt, fs - case 0x05: - m_state.cpr[1][FSNUM] = RT; - break; - - // CTC1 rt, fs - case 0x06: - m_state.fcr[FSNUM] = (int32_t) RT; - break; - - // BC - case 0x08: - { - switch ((opcode >> 16) & 3) { - // BC1F offset - case 0x00: - if (~FCR31 & 0x800000) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } - break; - - // BC1FL offset - case 0x02: - if (~FCR31 & 0x800000) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } else - m_state.pc += 4; - break; - - // BC1T offset - case 0x01: - if (FCR31 & 0x800000) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } - break; - - // BC1TL offset - case 0x03: - if (FCR31 & 0x800000) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } else - m_state.pc += 4; - break; - - default: - //qDebug() << QString::number(m_state.pc, 16) << "OpBC:" << ((opcode >> 16) & 0x1F) << "[FPU32][COP]"; - break; - } - break; - } - - default: - { - switch (opcode & 0x3F) { - - // ADD.fmt - case 0x00: - if (SP) FD_s = FS_s + FT_s; - else FD_d = FS_d + FT_d; - break; - - // SUB.fmt - case 0x01: - if (SP) FD_s = FS_s - FT_s; - else FD_d = FS_d - FT_d; - break; - - // MUL.fmt - case 0x02: - if (SP) FD_s = FS_s * FT_s; - else FD_d = FS_d * FT_d; - break; - - // DIV.fmt - case 0x03: - if (SP) FD_s = FS_s / FT_s; - else FD_d = FS_d / FT_d; - break; - - // SQRT.fmt - case 0x04: - if (SP) FD_s = sqrt(FS_s); - else FD_d = sqrt(FS_d); - break; - - // ABS.fmt - case 0x05: - if (SP) FD_s = abs(FS_s); - else FD_d = abs(FS_d); - break; - - // MOV.fmt - case 0x06: - if (SP) FD_s = FS_s; - else FD_d = FS_d; - break; - - // NEG.fmt - case 0x07: - if (SP) FD_s = -FS_s; - else FD_d = -FS_d; - break; - - // CVT.S.x - case 0x20: - if (INTEGER) { - if (SP) FD_s = (int32_t) FS_w; - else FD_s = (int64_t) FS_l; - } else - FD_s = FS_d; - break; - - // CVT.W.x - case 0x24: - if (SP) FD_w = (int32_t) FS_s; - else FD_w = (int32_t) FS_d; - break; - - // C.UN.x fs, ft - case 0x32: - if (SP) FCR31 = (isnan(FS_s) || isnan(FT_s)) ? FCR31 | 0x800000 : FCR31 & ~0x800000; - else FCR31 &= ~0x800000; - break; - - // C.OLT.x fs, ft - case 0x34: - if (SP) FCR31 = (FS_s < FT_s) ? FCR31 | 0x800000 : FCR31 & ~0x800000; - else FCR31 = (FS_d < FT_d) ? FCR31 | 0x800000 : FCR31 & ~0x800000; - break; - - // C.F fs, ft - case 0x3C: - FCR31 &= ~0x800000; - break; - - default: - //qDebug() << QString::number(m_state.pc, 16) << "Op:" << RSNUM << (opcode & 0x3F) << "[FPU32]"; - //exit(-6); - break; - } - } - } -} - -} diff --git a/jan/src/cpu/mips3/mips3.cpp b/jan/src/cpu/mips3/mips3.cpp deleted file mode 100644 index a71ae39bb..000000000 --- a/jan/src/cpu/mips3/mips3.cpp +++ /dev/null @@ -1,446 +0,0 @@ -/* - * - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -/* - * TODO: - * Fix TLB emulation - * COP1 FR0 opcodes - * Exceptions!!! - **/ - -//#include -#include -#include -#include "mips3.h" -#include "mipsdef.h" -#include "mips3_memory.h" -#include "mips3_rw.h" -#include "mips3_branch.h" -#include "mips3_bitops.h" -#include "mips3_arithm.h" -#include "mips3_shift.h" -#include "mips3_misc.h" - -namespace mips -{ - -const char *mips3::reg_names[32] = { - "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", - "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", - "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", - "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31" -}; - - -mips3::mips3() : m_tlb_entries(48) -{ - tlb_init(); - m_state.total_cycles = 0; -} - -mips3::~mips3() -{ -} - -void mips3::reset() -{ - m_state.pc = 0xBFC00000; - m_state.hi = 0; - m_state.lo = 0; - for (int i = 0; i < 32; i++) - m_state.r[i] = 0; - - m_next_pc = ~0; - m_delay_slot = false; - cop0_reset(); - cop1_reset(); - tlb_flush(); - m_counter = 0; - m_state.reset_cycle = m_state.total_cycles; -} - - -inline addr_t mips3::tlb_translate(addr_t address) -{ - for (int i = 0; i < 48; i++) { - tlb_entry *entry = &m_tlb[i]; - - uint32_t vpn2 = (entry->b.hi & ~entry->b.pagemask) >> 13; - uint32_t vpn = (address & ~entry->b.pagemask) >> 13; - - if (vpn2 == vpn) { - if (address & 0x1000) - return (address & 0xFFF) | ((entry->b.odd_lo >> 6) << 12); - else - return (address & 0xFFF) | ((entry->b.even_lo >> 6) << 12); - } - } - // qDebug() << "Address error" << QString::number(address,16); - return address; -} - - -uint32_t mips3::translate(addr_t addr, addr_t *out) -{ - switch (addr & 0xE0000000) { - case 0x80000000: *out = addr - 0x80000000; break; /* cached */ - case 0xA0000000: *out = addr - 0xA0000000; break; - default: - /* traduzir pela TLB */ - *out = tlb_translate(addr); - return 1; - break; - } - return 0; -} - - -#if MIPS3_ENABLE_BREAKPOINTS - -void mips3::bp_insert(addr_t address) -{ - m_breakpoints.insert(address); -} - -void mips3::bp_remove(addr_t address) -{ - m_breakpoints.erase(m_breakpoints.find(address)); -} - -inline bool mips3::check_breakpoint() -{ - return (m_breakpoints.find(m_state.pc) != m_breakpoints.end()); -} - -#endif - -bool mips3::run(int cycles, bool skip_bps) -{ - m_counter = 0; - int last_icounter = 0; - - // endereço efetivo - addr_t eaddr = 0; - -#if MIPS3_ENABLE_BREAKPOINTS - if (!skip_bps && check_breakpoint()) - return true; -#endif - - while (m_counter < cycles) { - - if (translate(m_state.pc, &eaddr)) { - /* TODO: handle exceptions */ - } - m_prev_pc = m_state.pc; - uint32_t opcode = mem::read_word(eaddr); - - // We always execute delay slot - if (m_delay_slot) { - m_state.pc = m_next_pc; - m_delay_slot = false; - m_next_pc = ~0; - } else { - m_state.pc += 4; - } - - last_icounter = m_counter; - - switch (opcode >> 26) { - - // SPECIAL - case 0x00: - { - switch (opcode & 0x3F) { - // SLL rd, rt, shamt - case 0x00: SLL(opcode); break; - - // SRL rd, rt, shamt - case 0x02: SRL(opcode); break; - - // SRA rd, rt, shamt - case 0x03: SRA(opcode); break; - - // SLLV rd, rt, rs - case 0x04: SLLV(opcode); break; - - // SRLV rd, rt, rs - case 0x06: SRLV(opcode); break; - - // SRAV rd, rt, rs - case 0x07: SRAV(opcode); break; - - // JR rs - case 0x08: JR(opcode); break; - - // JALR rs, rd - case 0x09: JALR(opcode); break; - - // SYSCALL > TODO - case 0x0C: - break; - - // MFHI rd - case 0x10: MFHI(opcode); break; - - // MTHI rs - case 0x11: MTHI(opcode); break; - - // MFLO rd - case 0x12: MFLO(opcode); break; - - // MTLO rs - case 0x13: MTLO(opcode); break; - - // DSLLV rd, rt, rs - case 0x14: DSLLV(opcode); break; - - // DSLRV rd, rt, rs - case 0x16: DSLRV(opcode); break; - - // DSRAV rd, rt, rs - case 0x17: DSRAV(opcode); break; - - // MULT rs, rt - case 0x18: MULT(opcode); break; - - // MULTU rs, rt - case 0x19: MULTU(opcode); break; - - // DIV rs, rt - case 0x1A: DIV(opcode); break; - - // DIVU rs, rt - case 0x1B: DIVU(opcode); break; - - // DMULT rs, rt - case 0x1C: DMULT(opcode); break; - - // DDIV rs, rt - case 0x1E: DDIV(opcode); break; - - // DDIVU rs, rt - case 0x1F: DDIVU(opcode); break; - - // ADD rd, rs, rt - case 0x20: ADD(opcode); break; - - // ADDU rd, rs, rt - case 0x21: ADDU(opcode); break; - - // SUB rd, rs, rt - case 0x22: SUB(opcode); break; - - // SUBU rd, rs, rt - case 0x23: SUBU(opcode); break; - - // AND rd, rs, rt - case 0x24: AND(opcode); break; - - // OR rd, rs, rt - case 0x25: OR(opcode); break; - - // XOR rd, rs, rt - case 0x26: XOR(opcode); break; - - // NOR rd, rs, rt - case 0x27: NOR(opcode); break; - - // SLT rd, rs, rt - case 0x2A: SLT(opcode); break; - - // SLTU rd, rs, rt - case 0x2B: SLTU(opcode); break; - - // DADDU rd, rs, rt - case 0x2D: DADDU(opcode); break; - - // DSUBU rd, rs, rt - case 0x2F: DSUBU(opcode); break; - - // DSLL rd, rt, shamt - case 0x38: DSLL(opcode); break; - - // DSRL rd, rt, shamt - case 0x3A: DSRL(opcode); break; - - // DSRA rd, rt, shamt - case 0x3B: DSRA(opcode); break; - - // DSLL32 rd, rt, shamt - case 0x3C: DSLL32(opcode); break; - - // DSRL32 rd, rt, shamt - case 0x3E: DSRL32(opcode); break; - - // DSRA32 rd, rt, shamt - case 0x3F: DSRA32(opcode); break; - - default: - cout << "Op: " << (opcode & 0x3F) << " [SPECIAL]" << endl; - break; - } - break; - } - - // REGIMM - case 0x01: - { - switch ((opcode >> 16) & 0x1F) { - // BLTZ rs, offset - case 0x00: BLTZ(opcode); break; - - // BGEZ rs, offset - case 0x01: BGEZ(opcode); break; - - // BLTZAL rs, offset - case 0x10: BLTZAL(opcode); break; - - // BGEZAL rs, offset - case 0x11: BGEZAL(opcode); break; - - default: - cout << "Op: " << ((opcode >> 16) & 0x1F) << " [REGIMM]" << endl; - break; - } - - break; - } - - // J target - case 0x02: J(opcode); break; - - // JAL target - case 0x03: JAL(opcode); break; - - // BEQ rs, rt, offset - case 0x04: BEQ(opcode); break; - - // BNE rs, rt, offset - case 0x05: BNE(opcode); break; - - // BLEZ rs, rt, offset - case 0x06: BLEZ(opcode); break; - - // BGTZ rs, offset - case 0x07: BGTZ(opcode); break; - - // ADDI rt, rs, imm - case 0x08: ADDI(opcode); break; - - // ADDIU rt, rs, imm - case 0x09: ADDIU(opcode); break; - - // SLTI rt, rs, imm - case 0x0A: SLTI(opcode); break; - - // SLTIU rt, rs, imm - case 0x0B: SLTIU(opcode); break; - - // ANDI rt, rs, imm - case 0x0C: ANDI(opcode); break; - - // ORI rt, rs, imm - case 0x0D: ORI(opcode); break; - - // XORI rt, rs, imm - case 0x0E: XORI(opcode); break; - - // LUI rt, imm - case 0x0F: LUI(opcode); break; - - // COP0 - case 0x10: cop0_execute(opcode); break; - - // COP1 (FPU) > TODO - case 0x11: - if (m_state.cpr[0][COP0_SR] & (1 << 26)) - cop1_execute_32(opcode); - else - cop1_execute_16(opcode); - break; - - // DADDI rt, rs, imm - case 0x18: DADDI(opcode); break; - - // DADDIU rt, rs, imm - case 0x19: DADDIU(opcode); break; - - // LDL rt, offset(base) - case 0x1A: LDL(opcode); break; - - // LDR rt, offset(base) - case 0x1B: LDR(opcode); break; - - // LB rt, offset(base) - case 0x20: LB(opcode); break; - - // LH rt, offset(base) - case 0x21: LH(opcode); break; - - // LWL rt, offset(base) - case 0x22: LWL(opcode); break; - - // LW rt, offset(base) - case 0x23: LW(opcode); break; - - // LBU rt, offset(base) - case 0x24: LBU(opcode); break; - - // LHU rt, offset(base) - case 0x25: LHU(opcode); break; - - // LWR rt, offset(base) - case 0x26: LWR(opcode); break; - - // LWU rt, offset(base) - case 0x27: LWU(opcode); break; - - // SB rt, offset(base) - case 0x28: SB(opcode); break; - - // SB rt, offset(base) - case 0x29: SH(opcode); break; - - // SW rt, offset(base) - case 0x2B: SW(opcode); break; - - // SDL rt, offset(base) - case 0x2C: SDL(opcode); break; - - // SDR rt, offset(base) - case 0x2D: SDR(opcode); break; - - // CACHE - case 0x2F: break; - - // LWC1 rt, offset(base) - case 0x31: LWC1(opcode); break; - - // LD rt, offset(base) - case 0x37: LD(opcode); break; - - // SWC1 rt, offset(base) - case 0x39: SWC1(opcode); break; - - // SD rt, offset(base) - case 0x3F: SD(opcode); break; - - default: - cout << "Op: " << (opcode >> 26) << endl; - break; - } - - m_counter++; - m_state.total_cycles += m_counter - last_icounter; -#if MIPS3_ENABLE_BREAKPOINTS - if (!skip_bps && check_breakpoint()) - return true; -#endif - } - return false; -} - -} diff --git a/jan/src/cpu/mips3/mips3.h b/jan/src/cpu/mips3/mips3.h deleted file mode 100644 index f9c803b39..000000000 --- a/jan/src/cpu/mips3/mips3.h +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_H -#define MIPS3_H - -#define MIPS3_ENABLE_BREAKPOINTS 0 - -#include "mips3_common.h" - -#include -#include - -namespace mips -{ - -enum COP0_Registers { - COP0_Index = 0, - COP0_Random, - COP0_EntryLo0, - COP0_EntryLo1, - COP0_Context, - COP0_PageMask, - COP0_Wired, - COP0_Unused0, - COP0_BadVAddr, - COP0_Count, - COP0_EntryHi, - COP0_Compare, - COP0_SR, - COP0_Cause, - COP0_EPC, - COP0_PRId, - COP0_Config, - COP0_LLAddr, - COP0_WatchLo, - COP0_WatchHi, - COP0_XContext, - COP0_Unused1, - COP0_Unused2, - COP0_Unused3, - COP0_Unused4, - COP0_Unused5, - COP0_ECC, - COP0_CacheErr, - COP0_TagLo, - COP0_TagHi, - COP0_ErrorEPC -}; - -#ifdef MIPS3_X64_DRC -class mips3_x64; -#endif - -class mips3 -{ -#ifdef MIPS3_X64_DRC - friend class mips3_x64; -#endif -public: - mips3(); - ~mips3(); - - void reset(); - bool run(int cycles, bool skip_bps=true); - - string dasm(uint32_t opcode, uint64_t pc); - - enum { - LR = 31 - }; - - addr_t m_next_pc; - bool m_delay_slot; - - - struct tlb_entry { - union { - struct { - uint32_t even_lo; - uint32_t odd_lo; - uint32_t hi; - uint32_t pagemask; - } b; - uint64_t v[2]; - }; - }; - - tlb_entry *m_tlb; - - struct cpu_state { - uint64_t r[32]; - uint64_t pc; - uint64_t lo, hi; - - // coprocessadores - uint64_t cpr[3][32]; - // fpu control registers (FCR) - uint64_t fcr[32]; - uint64_t reset_cycle; - uint64_t total_cycles; - }; - ALIGN_DECL(16) cpu_state m_state; - addr_t m_prev_pc; - - static const char *reg_names[]; - static const char *cop0_reg_names[]; - uint32_t translate(addr_t addr, addr_t *out); - const int m_tlb_entries; - -#if MIPS3_ENABLE_BREAKPOINTS - void bp_insert(addr_t address); - void bp_remove(addr_t address); -#endif -private: - int m_counter; - addr_t tlb_translate(addr_t address); - -#if MIPS3_ENABLE_BREAKPOINTS - unordered_set m_breakpoints; - bool check_breakpoint(); -#endif - void tlb_init(); - void tlb_flush(); - void cop0_reset(); - void cop0_execute(uint32_t opcode); - void cop1_reset(); - void cop1_execute_16(uint32_t opcode); - void cop1_execute_32(uint32_t opcode); - - // Arithmetic - void ADD(uint32_t opcode); - void SUB(uint32_t opcode); - void MULT(uint32_t opcode); - void DIV(uint32_t opcode); - void ADDU(uint32_t opcode); - void SUBU(uint32_t opcode); - void MULTU(uint32_t opcode); - void DIVU(uint32_t opcode); - - void ADDI(uint32_t opcode); - void ADDIU(uint32_t opcode); - void DADDI(uint32_t opcode); - void DADDIU(uint32_t opcode); - - void DADD(uint32_t opcode); - void DSUB(uint32_t opcode); - void DMULT(uint32_t opcode); - void DDIV(uint32_t opcode); - void DADDU(uint32_t opcode); - void DSUBU(uint32_t opcode); - void DMULTU(uint32_t opcode); - void DDIVU(uint32_t opcode); - - // Bitwise - void AND(uint32_t opcode); - void XOR(uint32_t opcode); - void OR(uint32_t opcode); - void NOR(uint32_t opcode); - void ANDI(uint32_t opcode); - void XORI(uint32_t opcode); - void ORI(uint32_t opcode); - - // Shifts - void SLL(uint32_t opcode); - void SRL(uint32_t opcode); - void SRA(uint32_t opcode); - void SLLV(uint32_t opcode); - void SRLV(uint32_t opcode); - void SRAV(uint32_t opcode); - void DSLLV(uint32_t opcode); - void DSLRV(uint32_t opcode); - void DSRAV(uint32_t opcode); - void SLT(uint32_t opcode); - void SLTU(uint32_t opcode); - void DSLL(uint32_t opcode); - void DSRL(uint32_t opcode); - void DSRA(uint32_t opcode); - void DSLL32(uint32_t opcode); - void DSRL32(uint32_t opcode); - void DSRA32(uint32_t opcode); - - // Jump & Branchs - void J(uint32_t opcode); - void JR(uint32_t opcode); - void JAL(uint32_t opcode); - void JALR(uint32_t opcode); - void BLTZ(uint32_t opcode); - void BLTZAL(uint32_t opcode); - void BGEZ(uint32_t opcode); - void BGEZAL(uint32_t opcode); - void BEQ(uint32_t opcode); - void BNE(uint32_t opcode); - void BLEZ(uint32_t opcode); - void BGTZ(uint32_t opcode); - - // Load & Store - void LUI(uint32_t opcode); - void SB(uint32_t opcode); - void SH(uint32_t opcode); - void SW(uint32_t opcode); - void SD(uint32_t opcode); - void SDL(uint32_t opcode); - void SDR(uint32_t opcode); - void LWL(uint32_t opcode); - void LWR(uint32_t opcode); - void LDL(uint32_t opcode); - void LDR(uint32_t opcode); - void LB(uint32_t opcode); - void LBU(uint32_t opcode); - void LH(uint32_t opcode); - void LHU(uint32_t opcode); - void LW(uint32_t opcode); - void LWU(uint32_t opcode); - void LD(uint32_t opcode); - void LL(uint32_t opcode); - void LWC1(uint32_t opcode); - void SWC1(uint32_t opcode); - - // Misc - void SLTI(uint32_t opcode); - void SLTIU(uint32_t opcode); - void MFHI(uint32_t opcode); - void MTHI(uint32_t opcode); - void MFLO(uint32_t opcode); - void MTLO(uint32_t opcode); - - string dasm_cop0(uint32_t opcode, uint64_t pc); - string dasm_cop1(uint32_t opcode, uint64_t pc); -}; - -extern mips3 *g_mips; - -} - -#endif // MIPS3_H diff --git a/jan/src/cpu/mips3/mips3_arithm.h b/jan/src/cpu/mips3/mips3_arithm.h deleted file mode 100644 index 8e35451e6..000000000 --- a/jan/src/cpu/mips3/mips3_arithm.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_ARITHM -#define MIPS3_ARITHM - - -#include "mips3.h" -#include "mipsdef.h" -#include "mips3_memory.h" - -namespace mips -{ - -// TODO: Overflow exception -void mips3::ADD(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)(RS_u32 + RT_u32); -} - -void mips3::ADDU(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)(RS_u32 + RT_u32); -} - -// TODO: Overflow exception -void mips3::ADDI(uint32_t opcode) -{ - if (RTNUM) - RT = (int32_t)(RS_u32 + SIMM); -} - -void mips3::ADDIU(uint32_t opcode) -{ - if (RTNUM) - RT = (int32_t)(RS_u32 + SIMM); -} - -void mips3::DADDI(uint32_t opcode) -{ - if (RTNUM) - RT = RS + IMM_s64; -} - -void mips3::DADDIU(uint32_t opcode) -{ - if (RTNUM) - RT = RS + (uint64_t) SIMM; -} - -// TODO: Overflow exception -void mips3::DADD(uint32_t opcode) -{ - if (RDNUM) - RD = RS + RT; -} - -void mips3::DADDU(uint32_t opcode) -{ - if (RDNUM) - RD = RS + RT; -} - - -// TODO: Overflow exception -void mips3::SUB(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)(RS_u32 - RT_u32); -} - -void mips3::SUBU(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)(RS_u32 - RT_u32); -} - - -// TODO: Overflow exception -void mips3::DSUB(uint32_t opcode) -{ - if (RDNUM) - RD = RS - RT; -} - - -void mips3::DSUBU(uint32_t opcode) -{ - if (RDNUM) - RD = RS - RT; -} - - -void mips3::MULT(uint32_t opcode) -{ - int64_t value = (int64_t)RS_s32 * (int64_t)RT_s32; - LO = (int32_t) value; - HI = (int32_t) (value >> 32); -} - -void mips3::MULTU(uint32_t opcode) -{ - uint64_t value = (uint64_t) RS_u32 * (uint64_t) RT_u32; - LO = (int32_t) value; - HI = (int32_t) (value >> 32); -} - -void mips3::DIV(uint32_t opcode) -{ - if (RT) { - LO = (int32_t)(RS_s32 / RT_s32); - HI = (int32_t)(RS_s32 % RT_s32); - } -} - - -void mips3::DIVU(uint32_t opcode) -{ - if (RT) { - LO = (int32_t)(RS_u32 / RT_u32); - HI = (int32_t)(RS_u32 % RT_u32); - } -} - - -// TODO: 128bit multiplication -void mips3::DMULT(uint32_t opcode) -{ - uint64_t value = ((uint64_t) RS) * ((uint64_t) RT); - LO = value; - HI = (int64_t) (value >> 63); -} - -void mips3::DDIV(uint32_t opcode) -{ - if (RT) { - LO = RS / RT; - HI = RS % RT; - } -} - -void mips3::DMULTU(uint32_t opcode) -{ - -} - -void mips3::DDIVU(uint32_t opcode) -{ - if (RTNUM) { - LO = RS / RT; - HI = RS % RT; - } -} - -} - -#endif // MIPS3_ARITHM - diff --git a/jan/src/cpu/mips3/mips3_bitops.h b/jan/src/cpu/mips3/mips3_bitops.h deleted file mode 100644 index 2b0733537..000000000 --- a/jan/src/cpu/mips3/mips3_bitops.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_BITOPS -#define MIPS3_BITOPS - -#include "mips3.h" -#include "mipsdef.h" -#include "mips3_memory.h" - -namespace mips -{ - -void mips3::AND(uint32_t opcode) -{ - if (RDNUM) - RD = RS & RT; -} - -void mips3::XOR(uint32_t opcode) -{ - if (RDNUM) - RD = RS ^ RT; -} - -void mips3::OR(uint32_t opcode) -{ - if (RDNUM) - RD = RS | RT; -} - -void mips3::NOR(uint32_t opcode) -{ - if (RDNUM) - RD = ~(RS | RT); -} - -void mips3::ANDI(uint32_t opcode) -{ - if (RTNUM) - RT = RS & IMM; -} - -void mips3::XORI(uint32_t opcode) -{ - if (RTNUM) - RT = RS ^ IMM; -} - -void mips3::ORI(uint32_t opcode) -{ - if (RTNUM) - RT = RS | IMM; -} - -} - -#endif // MIPS3_BITOPS - diff --git a/jan/src/cpu/mips3/mips3_branch.h b/jan/src/cpu/mips3/mips3_branch.h deleted file mode 100644 index aba48ab10..000000000 --- a/jan/src/cpu/mips3/mips3_branch.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_BRANCH -#define MIPS3_BRANCH - -#include "mips3.h" -#include "mipsdef.h" -#include "mips3_memory.h" - -namespace mips -{ - -inline void mips3::J(uint32_t opcode) -{ - m_next_pc = (m_state.pc & 0xF0000000) | (TARGET << 2); - m_delay_slot = true; -} - -inline void mips3::JR(uint32_t opcode) -{ - m_next_pc = (uint32_t)RS; - m_delay_slot = true; -} - -inline void mips3::JAL(uint32_t opcode) -{ - m_next_pc = (m_state.pc & 0xF0000000) | (TARGET << 2); - m_delay_slot = true; - m_state.r[LR] = (int32_t)(m_state.pc + 4); -} - -inline void mips3::JALR(uint32_t opcode) -{ - m_next_pc = (uint32_t)RS; - m_delay_slot = true; - m_state.r[LR] = (int32_t)(m_state.pc + 4); -} - -inline void mips3::BLTZ(uint32_t opcode) -{ - if ((int64_t)RS < 0) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } -} - -inline void mips3::BLTZAL(uint32_t opcode) -{ - if ((int64_t)RS < 0) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - m_state.r[LR] = (int32_t)(m_state.pc + 4); - } -} - -inline void mips3::BGEZ(uint32_t opcode) -{ - if ((int64_t)RS >= 0) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } -} - -inline void mips3::BGEZAL(uint32_t opcode) -{ - if ((int64_t)RS >= 0) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - m_state.r[LR] = (int32_t)(m_state.pc + 4); - } -} - -inline void mips3::BEQ(uint32_t opcode) -{ - if (RS == RT) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } -} - -inline void mips3::BNE(uint32_t opcode) -{ - if (RS != RT) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } -} - -inline void mips3::BLEZ(uint32_t opcode) -{ - if ((int64_t)RS <= 0) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } -} - -inline void mips3::BGTZ(uint32_t opcode) -{ - if ((int64_t)RS > 0) { - m_next_pc = m_state.pc + ((int32_t)(SIMM) << 2); - m_delay_slot = true; - } -} - -} - -#endif // MIPS3_BRANCH - diff --git a/jan/src/cpu/mips3/mips3_common.h b/jan/src/cpu/mips3/mips3_common.h deleted file mode 100644 index 9fd4100df..000000000 --- a/jan/src/cpu/mips3/mips3_common.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef COMMON -#define COMMON - -#include - -#ifdef __GNUC__ -#define ALIGN_DECL(n) __attribute__ ((aligned (n))) -#elif __MSVC__ -#else -#define ALIGN_DECL(n) __declspec(align(n)) -#endif -namespace mips -{ -using namespace std; - -typedef uint64_t addr_t; - -} - -#endif // COMMON - diff --git a/jan/src/cpu/mips3/mips3_dasm.cpp b/jan/src/cpu/mips3/mips3_dasm.cpp deleted file mode 100644 index 62157f1d8..000000000 --- a/jan/src/cpu/mips3/mips3_dasm.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#include -#include -#include "mips3.h" -#include "mipsdef.h" - -namespace mips -{ - -const int dasm_buf_size = 128; -const int dasm_pc_size = 10; - -string mips3::dasm(uint32_t opcode, uint64_t pc) -{ - const int size = 128; - char buf[size]; - char pcb[10]; - - buf[0] = '\0'; - - snprintf(pcb, dasm_pc_size, "%08X\t", pc); - - switch (opcode >> 26) { - // SPECIAL - case 0x00: - if (opcode == 0) { - snprintf(buf, dasm_buf_size, "nop"); - break; - } - - switch (opcode & 0x3F) { - case 0x00: snprintf(buf, dasm_buf_size, "sll\tr%d, r%d, %d", RDNUM, RTNUM, SHAMT); break; - case 0x02: snprintf(buf, dasm_buf_size, "srl\tr%d, r%d, %d", RDNUM, RTNUM, SHAMT); break; - case 0x03: snprintf(buf, dasm_buf_size, "sra\tr%d, r%d, %d", RDNUM, RTNUM, SHAMT); break; - case 0x04: snprintf(buf, dasm_buf_size, "sllv\tr%d, r%d, r%d", RDNUM, RTNUM, RSNUM); break; - case 0x06: snprintf(buf, dasm_buf_size, "srlv\tr%d, r%d, r%d", RDNUM, RTNUM, RSNUM); break; - case 0x07: snprintf(buf, dasm_buf_size, "srav\tr%d, r%d, r%d", RDNUM, RTNUM, RSNUM); break; - case 0x08: snprintf(buf, dasm_buf_size, "jr\tr%d", RSNUM); break; - case 0x09: snprintf(buf, dasm_buf_size, "jalr\tr%d, r%d", RDNUM, RSNUM); break; - case 0x0C: snprintf(buf, dasm_buf_size, "syscall"); break; - case 0x0D: snprintf(buf, dasm_buf_size, "break"); break; - case 0x0F: snprintf(buf, dasm_buf_size, "sync"); break; - case 0x10: snprintf(buf, dasm_buf_size, "mfhi\tr%d", RDNUM); break; - case 0x11: snprintf(buf, dasm_buf_size, "mthi\tr%d", RSNUM); break; - case 0x12: snprintf(buf, dasm_buf_size, "mflo\tr%d", RDNUM); break; - case 0x13: snprintf(buf, dasm_buf_size, "mtlo\tr%d", RSNUM); break; - case 0x14: snprintf(buf, dasm_buf_size, "dsllv\tr%d, r%d, r%d", RDNUM, RTNUM, RSNUM); break; - case 0x16: snprintf(buf, dasm_buf_size, "dsrlv\tr%d, r%d, r%d", RDNUM, RTNUM, RSNUM); break; - case 0x17: snprintf(buf, dasm_buf_size, "dsrav\tr%d, r%d, r%d", RDNUM, RTNUM, RSNUM); break; - case 0x18: snprintf(buf, dasm_buf_size, "mult\tr%d, r%d", RSNUM, RTNUM); break; - case 0x19: snprintf(buf, dasm_buf_size, "multu\tr%d, r%d", RSNUM, RTNUM); break; - case 0x1A: snprintf(buf, dasm_buf_size, "div\tr%d, r%d", RSNUM, RTNUM); break; - case 0x1B: snprintf(buf, dasm_buf_size, "divu\tr%d, r%d", RSNUM, RTNUM); break; - case 0x1C: snprintf(buf, dasm_buf_size, "dmult\tr%d, r%d", RSNUM, RTNUM); break; - case 0x1D: snprintf(buf, dasm_buf_size, "dmultu\tr%d, r%d", RSNUM, RTNUM); break; - case 0x1E: snprintf(buf, dasm_buf_size, "ddiv\tr%d, r%d", RSNUM, RTNUM); break; - case 0x1F: snprintf(buf, dasm_buf_size, "ddivu\tr%d, r%d", RSNUM, RTNUM); break; - case 0x20: snprintf(buf, dasm_buf_size, "add\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x21: snprintf(buf, dasm_buf_size, "addu\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x22: snprintf(buf, dasm_buf_size, "sub\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x23: snprintf(buf, dasm_buf_size, "subu\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x24: snprintf(buf, dasm_buf_size, "and\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x25: snprintf(buf, dasm_buf_size, "or\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x26: snprintf(buf, dasm_buf_size, "xor\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x27: snprintf(buf, dasm_buf_size, "nor\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x2A: snprintf(buf, dasm_buf_size, "slt\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x2B: snprintf(buf, dasm_buf_size, "sltu\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x2C: snprintf(buf, dasm_buf_size, "dadd\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x2D: snprintf(buf, dasm_buf_size, "daddu\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x2E: snprintf(buf, dasm_buf_size, "dsub\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x2F: snprintf(buf, dasm_buf_size, "dsubu\tr%d, r%d, r%d", RDNUM, RSNUM, RTNUM); break; - case 0x30: snprintf(buf, dasm_buf_size, "tge\tr%d, r%d", RSNUM, RTNUM); break; - case 0x31: snprintf(buf, dasm_buf_size, "tgeu\tr%d, r%d", RSNUM, RTNUM); break; - case 0x32: snprintf(buf, dasm_buf_size, "tlt\tr%d, r%d", RSNUM, RTNUM); break; - case 0x33: snprintf(buf, dasm_buf_size, "tltu\tr%d, r%d", RSNUM, RTNUM); break; - case 0x34: snprintf(buf, dasm_buf_size, "teq\tr%d, r%d", RSNUM, RTNUM); break; - case 0x36: snprintf(buf, dasm_buf_size, "tne\tr%d, r%d", RSNUM, RTNUM); break; - case 0x38: snprintf(buf, dasm_buf_size, "dsll\tr%d, r%d, %d", RDNUM, RTNUM, SHAMT); break; - case 0x3A: snprintf(buf, dasm_buf_size, "dsrl\tr%d, r%d, %d", RDNUM, RTNUM, SHAMT); break; - case 0x3B: snprintf(buf, dasm_buf_size, "dsra\tr%d, r%d, %d", RDNUM, RTNUM, SHAMT); break; - case 0x3C: snprintf(buf, dasm_buf_size, "dsll32\tr%d, r%d, %d", RDNUM, RTNUM, SHAMT); break; - case 0x3E: snprintf(buf, dasm_buf_size, "dsrl32\tr%d, r%d, %d", RDNUM, RTNUM, SHAMT); break; - case 0x3F: snprintf(buf, dasm_buf_size, "dsra32\tr%d, r%d, %d", RDNUM, RTNUM, SHAMT); break; - default: - snprintf(buf, dasm_buf_size, "??? [SPECIAL] %08X", opcode); - break; - } - - break; - - // REGIMM - case 0x01: - switch ((opcode >> 16) & 0x1F) { - case 0x00: snprintf(buf, dasm_buf_size, "bltz\tr%d, 0x%08X", RSNUM, pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x01: snprintf(buf, dasm_buf_size, "bgez\tr%d, 0x%08X", RSNUM, pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x10: snprintf(buf, dasm_buf_size, "bltzal\tr%d, 0x%08X", RSNUM, pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x11: snprintf(buf, dasm_buf_size, "bgezal\tr%d, 0x%08X", RSNUM, pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - - default: - snprintf(buf, dasm_buf_size, "??? [REGIMM] %08X", opcode); - break; - } - - break; - - case 0x02: snprintf(buf, dasm_buf_size, "j\t0x%08X", (pc & 0xF0000000) | (opcode & 0x03FFFFFF) << 2); break; - case 0x03: snprintf(buf, dasm_buf_size, "jal\t0x%08X", (pc & 0xF0000000) | (opcode & 0x03FFFFFF) << 2); break; - case 0x04: snprintf(buf, dasm_buf_size, "beq\tr%d, r%d, 0x%08X", RSNUM, RTNUM, pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x05: snprintf(buf, dasm_buf_size, "bne\tr%d, r%d, 0x%08X", RSNUM, RTNUM, pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x06: snprintf(buf, dasm_buf_size, "blez\tr%d, r%d, 0x%08X", RSNUM, RTNUM, pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x07: snprintf(buf, dasm_buf_size, "bgtz\tr%d, 0x%08X", RSNUM, pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x08: snprintf(buf, dasm_buf_size, "addi\tr%d, r%d, 0x%04X", RTNUM, RSNUM, SIMM); break; - case 0x09: snprintf(buf, dasm_buf_size, "addiu\tr%d, r%d, 0x%04X", RTNUM, RSNUM, SIMM); break; - case 0x0A: snprintf(buf, dasm_buf_size, "slti\tr%d, r%d, 0x%04X", RTNUM, RSNUM, SIMM); break; - case 0x0B: snprintf(buf, dasm_buf_size, "sltiu\tr%d, r%d, 0x%04X", RTNUM, RSNUM, SIMM); break; - case 0x0C: snprintf(buf, dasm_buf_size, "andi\tr%d, r%d, 0x%04X", RTNUM, RSNUM, IMM); break; - case 0x0D: snprintf(buf, dasm_buf_size, "ori\tr%d, r%d, 0x%04X", RTNUM, RSNUM, IMM); break; - case 0x0E: snprintf(buf, dasm_buf_size, "xori\tr%d, r%d, 0x%04X", RTNUM, RSNUM, IMM); break; - case 0x0F: snprintf(buf, dasm_buf_size, "lui\tr%d, 0x%04X", RTNUM, IMM); break; - case 0x10: return string(pcb) + dasm_cop0(opcode, pc); - case 0x11: return string(pcb) + dasm_cop1(opcode, pc); - - case 0x18: snprintf(buf, dasm_buf_size, "daddi\tr%d, r%d, 0x%04X", RTNUM, RSNUM, SIMM); break; - - case 0x1A: snprintf(buf, dasm_buf_size, "ldl\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x1B: snprintf(buf, dasm_buf_size, "ldr\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x20: snprintf(buf, dasm_buf_size, "lb\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x21: snprintf(buf, dasm_buf_size, "lh\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x22: snprintf(buf, dasm_buf_size, "lwl\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x23: snprintf(buf, dasm_buf_size, "lw\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x24: snprintf(buf, dasm_buf_size, "lbu\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x25: snprintf(buf, dasm_buf_size, "lhu\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x26: snprintf(buf, dasm_buf_size, "lwr\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x27: snprintf(buf, dasm_buf_size, "lwu\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x28: snprintf(buf, dasm_buf_size, "sb\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x29: snprintf(buf, dasm_buf_size, "sh\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x2B: snprintf(buf, dasm_buf_size, "sw\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x2F: snprintf(buf, dasm_buf_size, "cache\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x31: snprintf(buf, dasm_buf_size, "lwc1\tf%d, 0x%04X(r%d)", FTNUM, IMM, RSNUM); break; - case 0x37: snprintf(buf, dasm_buf_size, "ld\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - case 0x39: snprintf(buf, dasm_buf_size, "swc1\tf%d, 0x%04X(r%d)", FTNUM, IMM, RSNUM); break; - case 0x3F: snprintf(buf, dasm_buf_size, "sd\tr%d, 0x%04X(r%d)", RTNUM, IMM, RSNUM); break; - - default: - snprintf(buf, dasm_buf_size, "??? %08X - %02X", opcode, opcode >> 26); - break; - } - return string(pcb) + buf; -} - - -string mips3::dasm_cop0(uint32_t opcode, uint64_t pc) -{ - char buf[128]; - switch (RSNUM) { - case 0x00: snprintf(buf, dasm_buf_size, "mfc0\tr%d, %s", RTNUM, cop0_reg_names[RDNUM]); break; - case 0x04: snprintf(buf, dasm_buf_size, "mtc0\tr%d, %s", RTNUM, cop0_reg_names[RDNUM]); break; - case 0x10: snprintf(buf, dasm_buf_size, "tlbwi"); break; - default: - snprintf(buf, dasm_buf_size, "??? [COP0] %08X\n"); - break; - } - return buf; -} - -static inline const char * const fmt_string(uint32_t opcode) -{ - if (RSNUM == 16) - return "s"; - if (RSNUM == 17) - return "d"; - if (RSNUM == 20) - return "w"; - if (RSNUM == 21) - return "l"; - return "#"; -} - -string mips3::dasm_cop1(uint32_t opcode, uint64_t pc) -{ - char buf[128]; - // MFC1 rt, rd -#if 0 - -#endif - switch (RSNUM) { - case 0x00: snprintf(buf, dasm_buf_size, "mfc1\tr%d, f%d", RTNUM, FSNUM); break; - case 0x01: snprintf(buf, dasm_buf_size, "dmfc1\tr%d, f%d", RTNUM, FSNUM); break; - case 0x02: snprintf(buf, dasm_buf_size, "cfc1\tr%d, fcr%d", RTNUM, FSNUM); break; - case 0x04: snprintf(buf, dasm_buf_size, "mtc1\tr%d, f%d", RTNUM, FSNUM); break; - case 0x05: snprintf(buf, dasm_buf_size, "dmtc1\tr%d, f%d", RTNUM, FSNUM); break; - case 0x06: snprintf(buf, dasm_buf_size, "ctc1\tr%d, fcr%d", RTNUM, FSNUM); break; - case 0x08: - { - switch ((opcode >> 16) & 3) { - case 0x00: snprintf(buf, dasm_buf_size, "bc1f\t0x%08X", pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x01: snprintf(buf, dasm_buf_size, "bc1t\t0x%08X", pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x02: snprintf(buf, dasm_buf_size, "bc1fl\t0x%08X", pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - case 0x03: snprintf(buf, dasm_buf_size, "bc1tl\t0x%08X", pc + 4 + (int32_t)((int16_t) (IMM << 2))); break; - } - break; - } - default: - switch (opcode & 0x3F) { - case 0x00: snprintf(buf, dasm_buf_size, "add.%s\tf%d, f%d, f%d", fmt_string(opcode), FDNUM, FSNUM, FTNUM); break; - case 0x01: snprintf(buf, dasm_buf_size, "sub.%s\tf%d, f%d, f%d", fmt_string(opcode), FDNUM, FSNUM, FTNUM); break; - case 0x02: snprintf(buf, dasm_buf_size, "mul.%s\tf%d, f%d, f%d", fmt_string(opcode), FDNUM, FSNUM, FTNUM); break; - case 0x03: snprintf(buf, dasm_buf_size, "div.%s\tf%d, f%d, f%d", fmt_string(opcode), FDNUM, FSNUM, FTNUM); break; - case 0x04: snprintf(buf, dasm_buf_size, "sqrt.%s\tf%d, f%d", fmt_string(opcode), FDNUM, FSNUM); break; - case 0x05: snprintf(buf, dasm_buf_size, "abs.%s\tf%d, f%d", fmt_string(opcode), FDNUM, FSNUM); break; - case 0x06: snprintf(buf, dasm_buf_size, "mov.%s\tf%d, f%d", fmt_string(opcode), FDNUM, FSNUM); break; - case 0x07: snprintf(buf, dasm_buf_size, "neg.%s\tf%d, f%d", fmt_string(opcode), FDNUM, FSNUM); break; - case 0x20: snprintf(buf, dasm_buf_size, "cvt.s.%s\tf%d, f%d", fmt_string(opcode), FDNUM, FSNUM); break; - case 0x24: snprintf(buf, dasm_buf_size, "cvt.w.%s\tf%d, f%d", fmt_string(opcode), FDNUM, FSNUM); break; - case 0x34: snprintf(buf, dasm_buf_size, "c.olt.%s\tf%d, f%d", fmt_string(opcode), FSNUM, FTNUM); break; - default: - snprintf(buf, dasm_buf_size, "??? [COP1] %08X"); - break; - } - - break; - } - - return buf; -} - - -} diff --git a/jan/src/cpu/mips3/mips3_memory.h b/jan/src/cpu/mips3/mips3_memory.h deleted file mode 100644 index 2643bb23d..000000000 --- a/jan/src/cpu/mips3/mips3_memory.h +++ /dev/null @@ -1,28 +0,0 @@ - -#ifndef MEMORY -#define MEMORY - -#include "mips3_common.h" - -namespace mips -{ - -namespace mem -{ - -extern void write_byte(addr_t address, uint8_t value); -extern void write_half(addr_t address, uint16_t value); -extern void write_word(addr_t address, uint32_t value); -extern void write_dword(addr_t address, uint64_t value); - -extern uint8_t read_byte(addr_t address); -extern uint16_t read_half(addr_t address); -extern uint32_t read_word(addr_t address); -extern uint64_t read_dword(addr_t address); - -} - -} - -#endif // MEMORY - diff --git a/jan/src/cpu/mips3/mips3_misc.h b/jan/src/cpu/mips3/mips3_misc.h deleted file mode 100644 index a5da07da4..000000000 --- a/jan/src/cpu/mips3/mips3_misc.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_MISC -#define MIPS3_MISC - -#include "mips3.h" -#include "mipsdef.h" -#include "mips3_memory.h" - -namespace mips -{ - -void mips3::SLT(uint32_t opcode) -{ - if (RDNUM) - RD = RS_s64 < RT_s64; -} - -void mips3::SLTU(uint32_t opcode) -{ - if (RDNUM) - RD = RS < RT; -} - -void mips3::SLTI(uint32_t opcode) -{ - if (RTNUM) - RT = RS_s64 < IMM_s64 ? 1 : 0; -} - -void mips3::SLTIU(uint32_t opcode) -{ - if (RTNUM) - RT = RS < (uint64_t)SIMM ? 1 : 0; -} - -void mips3::MFHI(uint32_t opcode) -{ - if (RDNUM) - RD = HI; -} - -void mips3::MTHI(uint32_t opcode) -{ - HI = RS; -} - -void mips3::MFLO(uint32_t opcode) -{ - if (RDNUM) - RD = LO; -} - -void mips3::MTLO(uint32_t opcode) -{ - LO = RS; -} - - -} - -#endif // MIPS3_MISC - diff --git a/jan/src/cpu/mips3/mips3_rw.h b/jan/src/cpu/mips3/mips3_rw.h deleted file mode 100644 index b96d358f6..000000000 --- a/jan/src/cpu/mips3/mips3_rw.h +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_RW -#define MIPS3_RW - -#include "mips3.h" -#include "mipsdef.h" -#include "mips3_memory.h" - -namespace mips -{ - - -void mips3::LUI(uint32_t opcode) -{ - if (RTNUM) - RT = (int32_t)(IMM << 16); -} - -void mips3::SB(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr, &eaddr)) { - } - - mem::write_byte(eaddr, RT); -} - -void mips3::SH(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr, &eaddr)) { - } - - mem::write_half(eaddr & ~1, RT); -} - -void mips3::SW(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr & ~3, &eaddr)) { - } - - mem::write_word(eaddr, RT); -} - -void mips3::SD(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr & ~7, &eaddr)) { - } - - mem::write_dword(eaddr, RT); -} - -void mips3::SDL(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - - int shift = 8 * (~vaddr & 7); - uint64_t mask = 0xFFFFFFFFFFFFFFFFULL >> shift; - - if (translate(vaddr & ~7, &eaddr)) { - } - - uint64_t rdata = mem::read_dword(eaddr); - mem::write_dword(eaddr, ((RT >> shift) & mask) | (rdata & ~mask)); - -} - -void mips3::SDR(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - - int shift = 8 * (vaddr & 7); - uint64_t mask = 0xFFFFFFFFFFFFFFFFULL << shift; - - if (translate(vaddr & ~7, &eaddr)) { - } - uint64_t rdata = mem::read_dword(eaddr); - mem::write_dword(eaddr, ((RT << shift) & mask) | (rdata & ~mask)); -} - - -void mips3::LWL(uint32_t opcode) -{ - uint32_t vaddr = ((int32_t)SIMM) + RS; - - int shift = ((~vaddr & 3)) * 8; - uint32_t mask = (0xFFFFFFFF << shift); - - addr_t eaddr; - if (translate(vaddr & ~3, &eaddr)) { - } - - uint32_t data = mem::read_word(eaddr) & (mask >> shift); - - if (RTNUM) - RT = (int32_t)((RT_u32 & ~mask) | (data << shift)); -} - -void mips3::LWR(uint32_t opcode) -{ - uint32_t vaddr = ((int32_t)SIMM) + RS; - - int shift = (vaddr & 3) * 8; - uint32_t mask = (0xFFFFFFFF >> shift); - - addr_t eaddr; - if (translate(vaddr & ~3, &eaddr)) { - } - //d18 - uint32_t data = mem::read_word(eaddr) & (mask << shift); - - if (RTNUM) - RT = (int32_t)((RT_u32 & ~mask) | (data >> shift)); -} - -// Válido apenas para little endian. -void mips3::LDL(uint32_t opcode) -{ - uint32_t vaddr = ((int32_t)SIMM) + RS; - - int shift = (~vaddr & 7) * 8; - uint64_t mask = (0xFFFFFFFFFFFFFFFFULL << shift); - - addr_t eaddr; - if (translate(vaddr & ~7, &eaddr)) { - } - - uint64_t data = mem::read_dword(eaddr) & (mask >> shift); - - if (RTNUM) - RT = (RT & ~mask) | (data << shift); -} - -// Válido apenas para little endian. -void mips3::LDR(uint32_t opcode) -{ - uint32_t vaddr = ((int32_t)SIMM) + RS; - - int shift = (vaddr & 7) * 8; - uint64_t mask = (0xFFFFFFFFFFFFFFFFULL >> shift); - - addr_t eaddr; - if (translate(vaddr & ~7, &eaddr)) { - } - //d18 - uint64_t data = mem::read_dword(eaddr) & (mask << shift); - - if (RTNUM) - RT = (RT & ~mask) | (data >> shift); -} - -void mips3::LW(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr, &eaddr)) { - } - - if (RTNUM) - RT = (int32_t) mem::read_word(eaddr); -} - -void mips3::LWU(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr & ~3, &eaddr)) { - } - - if (RTNUM) - RT = (uint32_t) mem::read_word(eaddr); -} - -void mips3::LD(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr & ~7, &eaddr)) { - } - - if (RTNUM) - RT = mem::read_dword(eaddr); -} - -void mips3::LL(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr & ~3, &eaddr)) { - } - - if (RTNUM) - RT = (int32_t) mem::read_word(eaddr); -} - -// TODO: FIX IT -void mips3::LWC1(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr & ~3, &eaddr)) { - } - m_state.cpr[1][RTNUM] = (uint32_t) mem::read_word(eaddr); -} - -// TODO: FIX IT -void mips3::SWC1(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr & ~3, &eaddr)) { - } - mem::write_word(eaddr, m_state.cpr[1][RTNUM]); -} - -void mips3::LB(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr, &eaddr)) { - } - - if (RTNUM) - RT = (int8_t) mem::read_byte(eaddr); -} - -void mips3::LBU(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr, &eaddr)) { - } - - if (RTNUM) - RT = (uint8_t) mem::read_byte(eaddr); -} - -void mips3::LH(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr & ~1, &eaddr)) { - } - - if (RTNUM) - RT = (int16_t) mem::read_word(eaddr); -} - -void mips3::LHU(uint32_t opcode) -{ - addr_t vaddr = ((int32_t)SIMM) + RS; - addr_t eaddr; - if (translate(vaddr & ~1, &eaddr)) { - } - - if (RTNUM) - RT = (uint16_t) mem::read_word(eaddr); -} - -} - -#endif // MIPS3_RW - diff --git a/jan/src/cpu/mips3/mips3_shift.h b/jan/src/cpu/mips3/mips3_shift.h deleted file mode 100644 index a5e7496fc..000000000 --- a/jan/src/cpu/mips3/mips3_shift.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_SHIFT -#define MIPS3_SHIFT - -#include "mips3.h" -#include "mipsdef.h" -#include "mips3_memory.h" - -namespace mips -{ - -void mips3::SLL(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)(RT_u32 << SHAMT); -} - -void mips3::SRL(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)(RT_u32 >> SHAMT); -} - -void mips3::SRA(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)RT_u32 >> SHAMT; -} - -void mips3::SLLV(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)(RT_u32 << (RS & 0x1F)); -} - -void mips3::SRLV(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)(RT_u32 >> (RS & 0x1F)); -} - -void mips3::SRAV(uint32_t opcode) -{ - if (RDNUM) - RD = (int32_t)RT_u32 >> (RS & 0x1F); -} - -void mips3::DSLLV(uint32_t opcode) -{ - if (RDNUM) - RD = RT << (RS & 0x3F); -} - -void mips3::DSLRV(uint32_t opcode) -{ - if (RDNUM) - RD = RT >> (RS & 0x3F); -} - -void mips3::DSRAV(uint32_t opcode) -{ - if (RDNUM) - RD = (int64_t)RT >> (RS & 0x3F); -} - -void mips3::DSLL(uint32_t opcode) -{ - if (RDNUM) - RD = RT << SHAMT; -} - -void mips3::DSRL(uint32_t opcode) -{ - if (RDNUM) - RD = RT >> SHAMT; -} - -void mips3::DSRA(uint32_t opcode) -{ - if (RDNUM) - RD = (int64_t)RT >> SHAMT; -} - -void mips3::DSLL32(uint32_t opcode) -{ - if (RDNUM) - RD = RT << (SHAMT + 32); -} - -void mips3::DSRL32(uint32_t opcode) -{ - if (RDNUM) - RD = RT >> (SHAMT + 32); -} - -void mips3::DSRA32(uint32_t opcode) -{ - if (RDNUM) - RD = (int64_t)RT >> (SHAMT + 32); -} - - - -} - -#endif // MIPS3_SHIFT - diff --git a/jan/src/cpu/mips3/mipsdef.h b/jan/src/cpu/mips3/mipsdef.h deleted file mode 100644 index 3e69acb3d..000000000 --- a/jan/src/cpu/mips3/mipsdef.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPSDEFS -#define MIPSDEFS - - -#define IMM ((uint16_t) opcode) -#define SIMM ((int16_t) opcode) -#define TARGET (opcode & 0x03FFFFFF) - -#define IMM_s64 ((int64_t) SIMM) - -#define RSNUM ((opcode >> 21) & 0x1F) -#define RTNUM ((opcode >> 16) & 0x1F) -#define RDNUM ((opcode >> 11) & 0x1F) - -#define SHAMT ((opcode >> 6) & 0x1F) -#define FUNCT ((opcode >> 0) & 0x3F) - -#define RS m_state.r[RSNUM] -#define RT m_state.r[RTNUM] -#define RD m_state.r[RDNUM] -#define LO m_state.lo -#define HI m_state.hi - -#define RS32 ((uint32_t) RS) -#define RT32 ((uint32_t) RT) -#define RD32 ((uint32_t) RD) - -#define RS_u32 ((uint32_t) RS) -#define RT_u32 ((uint32_t) RT) -#define RD_u32 ((uint32_t) RD) - -#define RS_s32 ((int32_t) RS) -#define RT_s32 ((int32_t) RT) -#define RD_s32 ((int32_t) RD) - - -#define RS_s64 ((int64_t) RS) -#define RT_s64 ((int64_t) RT) -#define RD_s64 ((int64_t) RD) - -#define FDNUM ((opcode >> 6) & 0x1F) -#define FSNUM ((opcode >> 11) & 0x1F) -#define FTNUM ((opcode >> 16) & 0x1F) - -#endif // MIPSDEFS - diff --git a/jan/src/cpu/mips3/x64/mips3_x64.cpp b/jan/src/cpu/mips3/x64/mips3_x64.cpp deleted file mode 100644 index 32e61cbe1..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64.cpp +++ /dev/null @@ -1,522 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#include -#include "mips3_x64.h" -#include "xbyak/xbyak.h" -#include "../mips3.h" -#include "../mipsdef.h" -#include "../mips3_memory.h" -#include "mips3_x64_defs.h" -#include "mips3_x64_rw.h" -#include "mips3_x64_branch.h" -#include "mips3_x64_bitops.h" -#include "mips3_x64_arithm.h" -#include "mips3_x64_shift.h" -#include "mips3_x64_misc.h" -#include "mips3_x64_cop0.h" -#include "mips3_x64_cop1.h" - -#ifdef HAS_UDIS86 -#include "udis86/udis86.h" -#endif - -#define LOG_DYNAREC 0 -#define LOG_DYNAREC_DASM 0 -#define FULL_FALLBACK 0 - -namespace mips -{ - - -mips3_x64::mips3_x64(mips3 *interpreter) : CodeGenerator(1024 * 1024 * 16) -{ - m_core = interpreter; - m_blocks.clear(); - -#ifdef HAS_UDIS86 - ud_init(&m_udobj); - ud_set_mode(&m_udobj, 64); - ud_set_syntax(&m_udobj, UD_SYN_INTEL); -#endif -} - -inline void *mips3_x64::get_block(addr_t pc) -{ - if (m_blocks.find(pc) == m_blocks.end()) - return nullptr; - return m_blocks[pc]; -} - - -void mips3_x64::run(int cycles) -{ - m_icounter = cycles; - m_stop_translation = false; - m_translate_failed = false; - m_is_delay_slot = false; - - void *recompiled_code; - while (m_icounter > 0) { - recompiled_code = get_block(m_core->m_state.pc); - - if (recompiled_code == nullptr) { - try { - auto ptr = compile_block(m_core->m_state.pc); - if (m_translate_failed) - break; - - m_blocks[m_core->m_state.pc] = ptr; - recompiled_code = ptr; - } catch(Xbyak::Error& e) { - // code flush - if (e == Xbyak::ERR_CODE_IS_TOO_BIG) { - drc_log("Flushing recompiler cache...\n"); - m_blocks.clear(); - reset(); - recompiled_code = nullptr; - } else { - drc_log("%s", e.what()); - exit(-1); - } - } - } - if (recompiled_code) - Xbyak::CastTo(recompiled_code)(); - } - - if (m_translate_failed) - drc_log_error("Translation failed at PC: %X", m_drc_pc); -} - - - -void mips3_x64::prolog() -{ - // R15 = cycle counter - // RBX = cpu_state base - push(rbp); - push(rbx); -#ifdef _WIN32 - push(rsi); - push(rdi); -#endif - push(r15); - mov(rbp, rsp); - sub(rsp, 16); - mov(rbx, ADR(m_core->m_state)); - mov(r15, ADR(m_icounter)); - mov(r15, ptr[r15]); - - check_icounter(); -} - -void mips3_x64::epilog(bool do_ret) -{ - add(rsp, 16); - mov(rax, ADR(m_icounter)); - mov(ptr[rax], r15); - pop(r15); -#if _WIN32 - pop(rdi); - pop(rsi); -#endif - pop(rbx); - pop(rbp); - if (do_ret) - ret(); -} - - - -void *mips3_x64::compile_block(addr_t pc) -{ - static int depth = 0; - m_drc_pc = pc; - -#if LOG_DYNAREC - drc_log("Recompile block at %X\n", m_drc_pc); -#endif - - uint32_t opcode; - addr_t eaddr; - bool do_recompile = true; - - void *block_ptr = Xbyak::CastTo(getCurr()); - - prolog(); - - m_block_icounter = 0; - - while (do_recompile) { - m_core->translate(m_drc_pc, &eaddr); - opcode = mem::read_word(eaddr); - m_drc_pc += 4; - m_block_icounter++; - if (compile_instruction(opcode)) { - // Jump Instr - do_recompile = false; - } - } - - ready(); - -#if LOG_DYNAREC && defined(HAS_UDIS86) - if (!depth) { - drc_log("=======================================\n"); - drc_log("Generated code for %x\n", pc); - drc_log("=======================================\n"); - // show recompiled code - ud_set_input_buffer(&m_udobj, (unsigned char *) block_ptr, - (Xbyak::CastTo(getCurr()) - Xbyak::CastTo(block_ptr))); - ud_set_pc(&m_udobj, (uint64_t) block_ptr); - uint64_t dasm_pc = (uint64_t) block_ptr; - unsigned k; - while ((k = ud_disassemble(&m_udobj))) { - drc_log("%08X %s\n", dasm_pc, ud_insn_asm(&m_udobj)); - dasm_pc += k; - } - } -#endif - return block_ptr; -} - - -bool mips3_x64::compile_instruction(uint32_t opcode) -{ -#if LOG_DYNAREC_DASM - drc_log("%s\n", m_core->dasm(opcode, m_drc_pc - 4).c_str()); -#endif - - bool result = false; - switch (opcode >> 26) { - // SPECIAL - case 0x00: - { - switch (opcode & 0x3F) { - - -#if !FULL_FALLBACK - case 0x00: result = SLL(opcode); break; - case 0x02: result = SRL(opcode); break; - case 0x03: result = SRA(opcode); break; - case 0x04: result = SLLV(opcode); break; - case 0x06: result = SRLV(opcode); break; - case 0x07: result = SRAV(opcode); break; - case 0x14: result = DSLLV(opcode); break; - case 0x16: result = DSLRV(opcode); break; - case 0x17: result = DSRAV(opcode); break; - case 0x38: result = DSLL(opcode); break; - case 0x3A: result = DSRL(opcode); break; - case 0x3B: result = DSRA(opcode); break; - case 0x3C: result = DSLL32(opcode); break; - case 0x3E: result = DSRL32(opcode); break; - case 0x3F: result = DSRA32(opcode); break; - - case 0x10: result = MFHI(opcode); break; - case 0x11: result = MTHI(opcode); break; - case 0x12: result = MFLO(opcode); break; - case 0x13: result = MTLO(opcode); break; - - case 0x18: result = MULT(opcode); break; - case 0x19: result = MULTU(opcode); break; - case 0x1A: result = DIV(opcode); break; - case 0x1B: result = DIVU(opcode); break; - case 0x1C: result = DMULT(opcode); break; - case 0x1E: result = DDIV(opcode); break; - case 0x1F: result = DDIVU(opcode); break; - - case 0x20: result = ADD(opcode); break; - case 0x21: result = ADDU(opcode); break; - case 0x22: result = SUB(opcode); break; - case 0x23: result = SUBU(opcode); break; - case 0x2C: result = DADD(opcode); break; - case 0x2D: result = DADDU(opcode); break; - case 0x2F: result = DSUBU(opcode); break; - - case 0x24: result = AND(opcode); break; - case 0x25: result = OR(opcode); break; - case 0x26: result = XOR(opcode); break; - case 0x27: result = NOR(opcode); break; - - case 0x2A: result = SLT(opcode); break; - case 0x2B: result = SLTU(opcode); break; - -#else - case 0x00: fallback(opcode, &mips3::SLL); break; - case 0x02: fallback(opcode, &mips3::SRL); break; - case 0x03: fallback(opcode, &mips3::SRA); break; - case 0x04: fallback(opcode, &mips3::SLLV); break; - case 0x06: fallback(opcode, &mips3::SRLV); break; - case 0x07: fallback(opcode, &mips3::SRAV); break; - case 0x14: fallback(opcode, &mips3::DSLLV); break; - case 0x16: fallback(opcode, &mips3::DSLRV); break; - case 0x38: fallback(opcode, &mips3::DSLL); break; - case 0x3A: fallback(opcode, &mips3::DSRL); break; - case 0x3B: fallback(opcode, &mips3::DSRA); break; - case 0x3C: fallback(opcode, &mips3::DSLL32); break; - case 0x3E: fallback(opcode, &mips3::DSRL32); break; - case 0x3F: fallback(opcode, &mips3::DSRA32); break; - - case 0x10: fallback(opcode, &mips3::MFHI); break; - case 0x11: fallback(opcode, &mips3::MTHI); break; - case 0x12: fallback(opcode, &mips3::MFLO); break; - case 0x13: fallback(opcode, &mips3::MTLO); break; - - case 0x18: fallback(opcode, &mips3::MULT); break; - case 0x19: fallback(opcode, &mips3::MULTU); break; - case 0x1A: fallback(opcode, &mips3::DIV); break; - case 0x1B: fallback(opcode, &mips3::DIVU); break; - case 0x1C: fallback(opcode, &mips3::DMULT); break; - case 0x1E: fallback(opcode, &mips3::DDIV); break; - case 0x1F: fallback(opcode, &mips3::DDIVU); break; - case 0x20: fallback(opcode, &mips3::ADD); break; - case 0x21: fallback(opcode, &mips3::ADDU); break; - case 0x22: fallback(opcode, &mips3::SUB); break; - case 0x23: fallback(opcode, &mips3::SUBU); break; - case 0x2D: fallback(opcode, &mips3::DADDU); break; - case 0x2F: fallback(opcode, &mips3::DSUBU); break; - - case 0x24: fallback(opcode, &mips3::AND); break; - case 0x25: fallback(opcode, &mips3::OR); break; - case 0x26: fallback(opcode, &mips3::XOR); break; - case 0x27: fallback(opcode, &mips3::NOR); break; - - case 0x2A: fallback(opcode, &mips3::SLT); break; - case 0x2B: fallback(opcode, &mips3::SLTU); break; - -#endif - - case 0x08: result = JR(opcode); break; - case 0x09: result = JALR(opcode); break; - case 0x0C: drc_log("syscall %08X\n", m_drc_pc); break; - case 0x0D: drc_log("break %08X\n", m_drc_pc); break; - default: - drc_log_error("%08X %X [special]\n", m_drc_pc, opcode & 0x3F); - translate_failed(); - result = true; - exit(-3); - break; - } - break; - } - - // REGIMM - case 0x01: - { - switch ((opcode >> 16) & 0x1F) { - case 0x00: result = BLTZ(opcode); break; - case 0x01: result = BGEZ(opcode); break; - case 0x10: result = BLTZAL(opcode); break; - case 0x11: result = BGEZAL(opcode); break; - default: - drc_log_error("%08X %X [regimm]\n", m_drc_pc, (opcode >> 16) & 0x1F); - translate_failed(); - result = true; - exit(-3); - break; - } - - break; - } - - case 0x02: result = J(opcode); break; - case 0x03: result = JAL(opcode); break; - case 0x04: result = BEQ(opcode); break; - case 0x05: result = BNE(opcode); break; - case 0x06: result = BLEZ(opcode); break; - case 0x07: result = BGTZ(opcode); break; - -#if !FULL_FALLBACK - case 0x08: result = ADDI(opcode); break; - case 0x09: result = ADDIU(opcode); break; - case 0x0A: result = SLTI(opcode); break; - case 0x0B: result = SLTIU(opcode); break; - case 0x0C: result = ANDI(opcode); break; - case 0x0D: result = ORI(opcode); break; - case 0x0E: result = XORI(opcode); break; - case 0x0F: result = LUI(opcode); break; -#else - case 0x08: fallback(opcode, &mips3::ADDI); break; - case 0x09: fallback(opcode, &mips3::ADDIU); break; - case 0x0A: fallback(opcode, &mips3::SLTI); break; - case 0x0B: fallback(opcode, &mips3::SLTIU); break; - case 0x0C: fallback(opcode, &mips3::ANDI); break; - case 0x0D: fallback(opcode, &mips3::ORI); break; - case 0x0E: fallback(opcode, &mips3::XORI); break; - case 0x0F: fallback(opcode, &mips3::LUI); break; -#endif - case 0x10: result = compile_cop0(opcode); break; -#if !FULL_FALLBACK - case 0x11: result = compile_cop1(opcode); break; - case 0x18: result = DADDI(opcode); break; - case 0x19: result = DADDIU(opcode); break; -#else - case 0x11: fallback(opcode, &mips3::cop1_execute_32); break; - case 0x18: fallback(opcode, &mips3::DADDI); break; - case 0x19: fallback(opcode, &mips3::DADDIU); break; -#endif - - case 0x2F: break; - - // Load & Store fallbacks -#if 0 /* !FULL_FALLBACK */ /* Use fallbacks */ - case 0x20: LB(opcode); break; - case 0x24: LBU(opcode); break; - case 0x21: LH(opcode); break; - case 0x25: LHU(opcode); break; - case 0x23: LW(opcode); break; - case 0x27: LWU(opcode); break; - case 0x37: LD(opcode); break; - - case 0x28: SB(opcode); break; - case 0x29: SH(opcode); break; - case 0x2B: SW(opcode); break; - case 0x3F: SD(opcode); break; - - case 0x22: LWL(opcode); break; - case 0x26: LWR(opcode); break; - - case 0x1A: fallback(opcode, &mips3::LDL); break; - case 0x1B: fallback(opcode, &mips3::LDR); break; - - case 0x2C: fallback(opcode, &mips3::SDL); break; - case 0x2D: fallback(opcode, &mips3::SDR); break; - - case 0x31: fallback(opcode, &mips3::LWC1); break; - case 0x39: fallback(opcode, &mips3::SWC1); break; - -#else - case 0x20: fallback(opcode, &mips3::LB); break; - case 0x24: fallback(opcode, &mips3::LBU); break; - case 0x21: fallback(opcode, &mips3::LH); break; - case 0x25: fallback(opcode, &mips3::LHU); break; - case 0x23: fallback(opcode, &mips3::LW); break; - case 0x27: fallback(opcode, &mips3::LWU); break; - case 0x37: fallback(opcode, &mips3::LD); break; - - case 0x28: fallback(opcode, &mips3::SB); break; - case 0x29: fallback(opcode, &mips3::SH); break; - case 0x2B: fallback(opcode, &mips3::SW); break; - case 0x3F: fallback(opcode, &mips3::SD); break; - - case 0x22: fallback(opcode, &mips3::LWL); break; - case 0x26: fallback(opcode, &mips3::LWR); break; - - case 0x1A: fallback(opcode, &mips3::LDL); break; - case 0x1B: fallback(opcode, &mips3::LDR); break; - - case 0x2C: fallback(opcode, &mips3::SDL); break; - case 0x2D: fallback(opcode, &mips3::SDR); break; - - case 0x31: fallback(opcode, &mips3::LWC1); break; - case 0x39: fallback(opcode, &mips3::SWC1); break; -#endif - - default: - drc_log_error("%08X Op %X\n", m_drc_pc, opcode >> 26); - translate_failed(); - result = true; - exit(-3); - break; - } - - return result; -} - -void mips3_x64::check_icounter() -{ - inLocalLabel(); - cmp(r15, 0); - jg(".l"); - set_next_pc(m_drc_pc); - epilog(); - L(".l"); - outLocalLabel(); -} - -bool mips3_x64::cop1_fallback(uint32_t opcode) -{ - inLocalLabel(); - mov(rax, COP0_x(COP0_SR)); - - mov(rcx, 1 << 26); - test(rax, rcx); - jne(".fr0"); - fallback(opcode, &mips3::cop1_execute_32); - jmp(".end"); - L(".fr0"); - fallback(opcode, &mips3::cop1_execute_16); - L(".end"); - - outLocalLabel(); - return false; -} - -void mips3_x64::set_next_pc(addr_t addr) -{ - mov(PC_q, addr); -} - -void mips3_x64::fallback(uint32_t opcode, void (mips3::*f)(uint32_t)) -{ -#ifdef _WIN32 - // WIN64 ABI - MICROSOFT - mov(rcx, (size_t) m_core); - mov(edx, opcode); -#else - // SysV AMD64 ABI - GNU - mov(rdi, (size_t) m_core); - mov(esi, opcode); -#endif - - mov(rax, (size_t) (void*&)f); - call(rax); -} - -void mips3_x64::update_icounter() -{ - sub(r15, m_block_icounter); - mov(rax, ADR(m_core->m_state.total_cycles)); - add(qword[rax], m_block_icounter); - m_block_icounter = 0; -} - -void mips3_x64::jmp_to_block(uint64_t addr) -{ - // Simple block linking - void *next_ptr = get_block(addr); - if (next_ptr) { -#if LOG_DYNAREC - drc_log("Block link: %08X to %08X\n", CORE_PC, addr); -#endif - epilog(false); - mov(rax, (size_t) next_ptr); - jmp(rax); - return; - } else { - set_next_pc(addr); - } - epilog(); -} - -void mips3_x64::jmp_to_register(int reg) -{ - mov(ecx, Rn_x(reg)); - mov(PC_x, rcx); - epilog(); -} - -void mips3_x64::translate_failed() -{ - m_translate_failed = true; - update_icounter(); - epilog(); -} - - - -} - - diff --git a/jan/src/cpu/mips3/x64/mips3_x64.h b/jan/src/cpu/mips3/x64/mips3_x64.h deleted file mode 100644 index e4d2ef686..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_X64 -#define MIPS3_X64 - -#include -#include "xbyak/xbyak.h" -#include "../mips3.h" - -#ifdef HAS_UDIS86 -#include "udis86/udis86.h" -#endif - -namespace mips -{ - - -class mips3_x64 : public Xbyak::CodeGenerator -{ -public: - mips3_x64(mips3 *interpreter); - void run(int cycles); - -private: - int64_t m_icounter; - addr_t m_drc_pc; - bool m_is_delay_slot; - void run_this(void *ptr); - void *compile_block(addr_t pc); - void *get_block(addr_t pc); - bool compile_special(uint32_t opcode); - bool compile_regimm(uint32_t opcode); - bool compile_instruction(uint32_t opcode); - bool compile_cop0(uint32_t opcode); - bool compile_cop1(uint32_t opcode); - void check_icounter(); - bool cop1_fallback(uint32_t opcode); - void set_next_pc(addr_t addr); - void fallback(uint32_t opcode, void (mips3::*f)(uint32_t)); - void update_icounter(); - void jmp_to_block(uint64_t addr); - void jmp_to_register(int reg); - void translate_failed(); - void update_cp0_count(); - void prolog(); - void epilog(bool do_ret=true); - - uint8_t *m_cache; - mips3 *m_core; - void *m_current_block; - uint64_t m_block_icounter; - bool m_translate_failed; - bool m_stop_translation; - unordered_map m_blocks; -#ifdef HAS_UDIS86 - ud_t m_udobj; -#endif - - // COP1 branch - bool BC1F(uint32_t opcode); - bool BC1FL(uint32_t opcode); - bool BC1T(uint32_t opcode); - bool BC1TL(uint32_t opcode); - - // Arithmetic - bool ADD(uint32_t opcode); - bool SUB(uint32_t opcode); - bool MULT(uint32_t opcode); - bool DIV(uint32_t opcode); - bool ADDU(uint32_t opcode); - bool SUBU(uint32_t opcode); - bool MULTU(uint32_t opcode); - bool DIVU(uint32_t opcode); - - bool ADDI(uint32_t opcode); - bool ADDIU(uint32_t opcode); - bool DADDI(uint32_t opcode); - bool DADDIU(uint32_t opcode); - - bool DADD(uint32_t opcode); - bool DSUB(uint32_t opcode); - bool DMULT(uint32_t opcode); - bool DDIV(uint32_t opcode); - bool DADDU(uint32_t opcode); - bool DSUBU(uint32_t opcode); - bool DMULTU(uint32_t opcode); - bool DDIVU(uint32_t opcode); - - // Bitwise - bool AND(uint32_t opcode); - bool XOR(uint32_t opcode); - bool OR(uint32_t opcode); - bool NOR(uint32_t opcode); - bool ANDI(uint32_t opcode); - bool XORI(uint32_t opcode); - bool ORI(uint32_t opcode); - - // Shifts - bool SLL(uint32_t opcode); - bool SRL(uint32_t opcode); - bool SRA(uint32_t opcode); - bool SLLV(uint32_t opcode); - bool SRLV(uint32_t opcode); - bool SRAV(uint32_t opcode); - bool DSLLV(uint32_t opcode); - bool DSLRV(uint32_t opcode); - bool SLT(uint32_t opcode); - bool SLTU(uint32_t opcode); - bool DSLL(uint32_t opcode); - bool DSRL(uint32_t opcode); - bool DSRA(uint32_t opcode); - bool DSRAV(uint32_t opcode); - bool DSLL32(uint32_t opcode); - bool DSRL32(uint32_t opcode); - bool DSRA32(uint32_t opcode); - - // Jump & Branchs - bool J(uint32_t opcode); - bool JR(uint32_t opcode); - bool JAL(uint32_t opcode); - bool JALR(uint32_t opcode); - bool BLTZ(uint32_t opcode); - bool BLTZAL(uint32_t opcode); - bool BGEZ(uint32_t opcode); - bool BGEZAL(uint32_t opcode); - bool BEQ(uint32_t opcode); - bool BNE(uint32_t opcode); - bool BLEZ(uint32_t opcode); - bool BGTZ(uint32_t opcode); - - // Load & Store - bool LUI(uint32_t opcode); - bool SB(uint32_t opcode); - bool SH(uint32_t opcode); - bool SW(uint32_t opcode); - bool SD(uint32_t opcode); - bool SDL(uint32_t opcode); - bool SDR(uint32_t opcode); - bool LWL(uint32_t opcode); - bool LWR(uint32_t opcode); - bool LDL(uint32_t opcode); - bool LDR(uint32_t opcode); - bool LB(uint32_t opcode); - bool LBU(uint32_t opcode); - bool LH(uint32_t opcode); - bool LHU(uint32_t opcode); - bool LW(uint32_t opcode); - bool LWU(uint32_t opcode); - bool LD(uint32_t opcode); - bool LL(uint32_t opcode); - bool LWC1(uint32_t opcode); - bool SWC1(uint32_t opcode); - - // Misc - bool SLTI(uint32_t opcode); - bool SLTIU(uint32_t opcode); - bool MFHI(uint32_t opcode); - bool MTHI(uint32_t opcode); - bool MFLO(uint32_t opcode); - bool MTLO(uint32_t opcode); - -}; - -} - -#endif // MIPS3_X64 - diff --git a/jan/src/cpu/mips3/x64/mips3_x64_arithm.h b/jan/src/cpu/mips3/x64/mips3_x64_arithm.h deleted file mode 100644 index 5bbb5e206..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64_arithm.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_X64_ARITHM -#define MIPS3_X64_ARITHM - - -#include "../mips3.h" -#include "mips3_x64_defs.h" -#include "mips3_x64.h" -#include "xbyak/xbyak.h" - -namespace mips -{ - -inline bool mips3_x64::ADD(uint32_t opcode) -{ - if (RDNUM) { - mov(eax, RS_x); - add(eax, RT_x); - cdqe(); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::ADDU(uint32_t opcode) -{ - if (RDNUM) { - mov(eax, RS_x); - add(eax, RT_x); - cdqe(); - mov(RD_x, rax); - } - return false; -} - -// TODO: Overflow exception -inline bool mips3_x64::ADDI(uint32_t opcode) -{ - if (RTNUM) { - mov(eax, RS_x); - add(eax, (int32_t)SIMM); - cdqe(); - mov(RT_x, rax); - } - return false; -} - -inline bool mips3_x64::ADDIU(uint32_t opcode) -{ - if (RTNUM) { - mov(eax, RS_x); - add(eax, (int32_t)SIMM); - cdqe(); - mov(RT_x, rax); - } - return false; -} - -inline bool mips3_x64::DADDI(uint32_t opcode) -{ - if (RTNUM) { - mov(rax, RS_x); - add(rax, (size_t)(int32_t)SIMM); - mov(RT_x, rax); - } - return false; -} - -inline bool mips3_x64::DADDIU(uint32_t opcode) -{ - if (RTNUM) { - mov(rax, RS_x); - add(rax, (size_t)(int32_t)SIMM); - mov(RT_x, rax); - } - return false; -} - -// TODO: Overflow exception -inline bool mips3_x64::DADD(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - add(rax, RT_x); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::DADDU(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - add(rax, RT_x); - mov(RD_x, rax); - } - return false; -} - - -// TODO: Overflow exception -inline bool mips3_x64::SUB(uint32_t opcode) -{ - if (RDNUM) { - mov(eax, RS_x); - sub(eax, RT_x); - cdqe(); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::SUBU(uint32_t opcode) -{ - if (RDNUM) { - mov(eax, RS_x); - sub(eax, RT_x); - cdqe(); - mov(RD_x, rax); - } - return false; -} - - -// TODO: Overflow exception -inline bool mips3_x64::DSUB(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - sub(rax, RT_x); - mov(RD_x, rax); - } - return false; -} - - -inline bool mips3_x64::DSUBU(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - sub(rax, RT_x); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::MULT(uint32_t opcode) -{ - mov(eax, RS_x); - mov(ecx, RT_x); - imul(ecx); - movsxd(rdx, edx); - movsxd(rax, eax); - mov(HI_x, rdx); - mov(LO_x, rax); - - m_block_icounter += 2; - return false; -} - -inline bool mips3_x64::MULTU(uint32_t opcode) -{ - mov(eax, RS_x); - mov(ecx, RT_x); - mul(ecx); - movsxd(rdx, edx); - movsxd(rax, eax); - mov(HI_x, rdx); - mov(LO_x, rax); - - m_block_icounter += 2; - return false; -} - - -inline bool mips3_x64::DIV(uint32_t opcode) -{ - if (RTNUM) { - inLocalLabel(); - mov(rcx, RT_x); - cmp(rcx, 0); - je(".end"); - - mov(eax, RS_x); - cdq(); - idiv(ecx); - cdqe(); - - mov(LO_x, rax); - movsxd(rcx, edx); - mov(HI_x, rdx); - L(".end"); - outLocalLabel(); - - } - m_block_icounter += 34; - return false; -} - - -inline bool mips3_x64::DIVU(uint32_t opcode) -{ - if (RTNUM) { - inLocalLabel(); - mov(ecx, RT_x); - cmp(ecx, 0); - je(".end"); - - mov(eax, RS_x); - xor_(edx, edx); - div(ecx); - cdqe(); - - mov(LO_x, rax); - movsxd(rcx, edx); - mov(HI_x, rdx); - L(".end"); - outLocalLabel(); - - } - m_block_icounter += 34; - return false; -} - -inline bool mips3_x64::DMULT(uint32_t opcode) -{ - mov(rax, RS_x); - mov(rcx, RT_x); - imul(rcx); - mov(HI_x, rdx); - mov(LO_x, rax); - m_block_icounter += 6; - return false; -} - -inline bool mips3_x64::DDIV(uint32_t opcode) -{ - if (RTNUM) { - inLocalLabel(); - mov(rcx, RT_x); - cmp(rcx, 0); - je(".end"); - - mov(rax, RS_x); - cqo(); - idiv(rcx); - - mov(LO_x, rax); - mov(HI_x, rdx); - L(".end"); - outLocalLabel(); - - } - m_block_icounter += 66; - return false; -} - -inline bool mips3_x64::DMULTU(uint32_t opcode) -{ - mov(rax, RS_x); - mov(rcx, RT_x); - mul(rcx); - mov(HI_x, rdx); - mov(LO_x, rax); - m_block_icounter += 6; - return false; -} - -inline bool mips3_x64::DDIVU(uint32_t opcode) -{ - if (RTNUM) { - inLocalLabel(); - mov(rcx, RT_x); - cmp(rcx, 0); - je(".end"); - - mov(rax, RS_x); - cqo(); - div(rcx); - - mov(LO_x, rax); - mov(HI_x, rdx); - L(".end"); - outLocalLabel(); - - } - m_block_icounter += 66; - return false; -} - -} - -#endif // MIPS3_X64_ARITHM - diff --git a/jan/src/cpu/mips3/x64/mips3_x64_bitops.h b/jan/src/cpu/mips3/x64/mips3_x64_bitops.h deleted file mode 100644 index 34361fd6b..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64_bitops.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef MIPS3_X64_BITOPS -#define MIPS3_X64_BITOPS - -#include "../mips3.h" -#include "mips3_x64_defs.h" -#include "mips3_x64.h" -#include "xbyak/xbyak.h" - -namespace mips -{ - - -inline bool mips3_x64::AND(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - and_(rax, RT_x); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::XOR(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - xor_(rax, RT_x); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::OR(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - or_(rax, RT_x); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::NOR(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - or_(rax, RT_x); - not_(rax); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::ANDI(uint32_t opcode) -{ - if (RTNUM) { - mov(rax, RS_x); - and_(rax, IMM); - mov(RT_x, rax); - } - return false; -} - -inline bool mips3_x64::XORI(uint32_t opcode) -{ - if (RTNUM) { - mov(rax, RS_x); - xor_(rax, IMM); - mov(RT_x, rax); - } - return false; -} - -inline bool mips3_x64::ORI(uint32_t opcode) -{ - if (RTNUM) { - mov(rax, RS_x); - or_(rax, IMM); - mov(RT_x, rax); - } - return false; -} - -} - -#endif // MIPS3_X64_BITOPS - diff --git a/jan/src/cpu/mips3/x64/mips3_x64_branch.h b/jan/src/cpu/mips3/x64/mips3_x64_branch.h deleted file mode 100644 index d47e2526a..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64_branch.h +++ /dev/null @@ -1,396 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_X64_BRANCH -#define MIPS3_X64_BRANCH - -#include "../mips3.h" -#include "../mips3_memory.h" -#include "mips3_x64_defs.h" -#include "mips3_x64.h" -#include "xbyak/xbyak.h" - -namespace mips -{ - -bool mips3_x64::J(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t eaddr = 0; - addr_t nextpc = (m_drc_pc & 0xF0000000) | (TARGET << 2); - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - m_is_delay_slot = true; - if (compile_instruction(next_opcode)) { - drc_log("Branch on delay slot!!! aborting..."); - exit(-1); - } - m_is_delay_slot = false; - - update_icounter(); - - jmp_to_block(nextpc); - return true; -} - -inline bool mips3_x64::JR(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t eaddr; - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - m_is_delay_slot = true; - if (compile_instruction(next_opcode)) { - drc_log("Branch on delay slot!!! aborting..."); - exit(-1); - } - m_is_delay_slot = false; - - update_icounter(); - - jmp_to_register(RSNUM); - return true; -} - -inline bool mips3_x64::JAL(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t eaddr = 0; - addr_t nextpc = (m_drc_pc & 0xF0000000) | (TARGET << 2); - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - m_is_delay_slot = true; - if (compile_instruction(next_opcode)) { - drc_log("Branch on delay slot!!! aborting..."); - exit(-1); - } - m_is_delay_slot = false; - - update_icounter(); - - mov(eax, (uint32_t)m_drc_pc); - cdqe(); - mov(rcx, R_ref(31)); - mov(ptr[rcx], rax); - - jmp_to_block(nextpc); - return true; -} - -inline bool mips3_x64::JALR(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t eaddr; - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - m_is_delay_slot = true; - if (compile_instruction(next_opcode)) { - drc_log("Branch on delay slot!!! aborting..."); - exit(-1); - } - m_is_delay_slot = false; - - update_icounter(); - - mov(eax, (uint32_t)m_drc_pc); - cdqe(); - mov(rcx, R_ref(31)); - mov(ptr[rcx], rax); - - jmp_to_register(RSNUM); - return true; -} - -inline bool mips3_x64::BLTZ(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - - cmp(RS_q, 0); - jge(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; -} - -inline bool mips3_x64::BLTZAL(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - - cmp(RS_q, 0); - jge(".false"); - { - mov(eax, (uint32_t)m_drc_pc); - cdqe(); - mov(Rn_x(31), rax); - - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; -} - - -inline bool mips3_x64::BGEZ(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - cmp(RS_q, 0); - jl(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; -} - -inline bool mips3_x64::BGEZAL(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - cmp(RS_q, 0); - jl(".false"); - { - mov(eax, (uint32_t)m_drc_pc); - cdqe(); - mov(Rn_x(31), rax); - - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; -} - -inline bool mips3_x64::BEQ(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - mov(rax, RS_x); - cmp(rax, RT_x); - jne(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; -} - - -inline bool mips3_x64::BNE(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - mov(rax, RS_x); - cmp(rax, RT_x); - je(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; -} - -inline bool mips3_x64::BLEZ(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - cmp(RS_q, 0); - jg(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; -} - -inline bool mips3_x64::BGTZ(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - cmp(RS_q, 0); - jle(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; -} - -} - -#endif // MIPS3_X64_BRANCH - diff --git a/jan/src/cpu/mips3/x64/mips3_x64_cop0.h b/jan/src/cpu/mips3/x64/mips3_x64_cop0.h deleted file mode 100644 index cc587fc98..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64_cop0.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_X64_COP0 -#define MIPS3_X64_COP0 - - -#include "../mips3.h" -#include "mips3_x64_defs.h" -#include "mips3_x64.h" -#include "xbyak/xbyak.h" - -namespace mips -{ - - -bool mips3_x64::compile_cop0(uint32_t opcode) -{ - bool result = false; - - switch (RSNUM) { - // MFC0 rt, rd - case 0x00: - if (RTNUM) { - switch (RDNUM) { - - case COP0_Count: - m_block_icounter += 250; - mov(rax, TOTAL_x); - sub(rax, RSTCYC_x); - shr(rax, 1); - and_(eax, ~0); - mov(RT_x, rax); - return false; - - case COP0_Cause: - m_block_icounter += 250; - break; - } - mov(rax, COP0_x(RDNUM)); - cdqe(); - mov(RT_x, rax); - } - break; - // MTC0 rd, rt - case 0x04: - if (RDNUM == COP0_Count) { - mov(rax, RT_x); - mov(COP0_x(COP0_Count), rax); - mov(rcx, TOTAL_x); - shl(eax, 1); - sub(rcx, rax); - mov(RSTCYC_q, rax); - return false; - } - default: - fallback(opcode, &mips3::cop0_execute); - break; - } - return result; -} - -} - -#endif // MIPS3_X64_COP0 - diff --git a/jan/src/cpu/mips3/x64/mips3_x64_cop1.h b/jan/src/cpu/mips3/x64/mips3_x64_cop1.h deleted file mode 100644 index 14a0589de..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64_cop1.h +++ /dev/null @@ -1,450 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_X64_COP1 -#define MIPS3_X64_COP1 - - -#include "../mips3.h" -#include "mips3_x64_defs.h" -#include "mips3_x64.h" -#include "xbyak/xbyak.h" - -namespace mips -{ - -#define DP (RSNUM == 17 || RSNUM == 21) -#define SP (RSNUM == 16 || RSNUM == 20) - -#define INTEGER (RSNUM == 20 || RSNUM == 21) -// Word/Long precision -#define WT (RSNUM == 20) -#define LT (RSNUM == 21) - -bool mips3_x64::BC1F(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - mov(rcx, FCR_ref(31)); - mov(rcx, ptr[rcx]); - not_(ecx); - and_(ecx, 0x800000); - test(ecx, ecx); - je(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; - -} - -bool mips3_x64::BC1FL(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - mov(rcx, FCR_ref(31)); - mov(rcx, ptr[rcx]); - not_(ecx); - and_(ecx, 0x800000); - test(ecx, ecx); - je(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - outLocalLabel(); - check_icounter(); - return false; - - return false; -} - -bool mips3_x64::BC1T(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - mov(rcx, FCR_ref(31)); - mov(rcx, ptr[rcx]); - and_(ecx, 0x800000); - test(ecx, ecx); - je(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - compile_instruction(next_opcode); - outLocalLabel(); - check_icounter(); - return false; - -} - -bool mips3_x64::BC1TL(uint32_t opcode) -{ - if (m_is_delay_slot) - return true; - - addr_t nextpc = m_drc_pc + ((int32_t)(SIMM) << 2); - addr_t eaddr = 0; - - m_core->translate(m_drc_pc, &eaddr); - uint32_t next_opcode = mem::read_word(eaddr); - - m_drc_pc += 4; - - update_icounter(); - - inLocalLabel(); - mov(rcx, FCR_ref(31)); - mov(rcx, ptr[rcx]); - and_(ecx, 0x800000); - test(ecx, ecx); - je(".false"); - { - m_is_delay_slot = true; - compile_instruction(next_opcode); - m_is_delay_slot = false; - jmp_to_block(nextpc); - } - - L(".false"); - outLocalLabel(); - check_icounter(); - return false; -} - -bool mips3_x64::compile_cop1(uint32_t opcode) -{ - bool result = false; - - switch (RSNUM) { - // MFC1 rt, rd - case 0x00: - if (RTNUM) { - mov(rax, FPR_ref(RDNUM)); - mov(rcx, RT_ref); - mov(eax, ptr[rax]); - cdqe(); - mov(ptr[rcx], rax); - } - break; - - // DMFC1 rt, rd - case 0x01: - if (RTNUM) { - mov(rax, FPR_ref(RDNUM)); - mov(rcx, RT_ref); - mov(rax, ptr[rax]); - mov(ptr[rcx], rax); - } - break; - - // CFC1 rt, fs - case 0x02: - if (RTNUM) { - mov(rax, FCR_ref(FSNUM)); - mov(rcx, RT_ref); - mov(eax, ptr[rax]); - cdqe(); - mov(ptr[rcx], rax); - } - break; - - // MTC1 rt, fs - case 0x04: - mov(rax, FPR_ref(FSNUM)); - mov(rcx, RT_ref); - mov(ecx, ptr[rcx]); - mov(ptr[rax], rcx); - break; - - // DMTC1 rt, fs - case 0x05: - mov(rax, FPR_ref(FSNUM)); - mov(rcx, RT_ref); - mov(rcx, ptr[rcx]); - mov(ptr[rax], rcx); - break; - - // CTC1 rt, fs - case 0x06: - mov(rcx, FCR_ref(FSNUM)); - mov(rax, RT_ref); - mov(eax, ptr[rax]); - cdqe(); - mov(ptr[rcx], rax); - break; - - // BC - case 0x08: - { - switch ((opcode >> 16) & 3) { - // BC1F offset - case 0x00: result = BC1F(opcode); break; - - // BC1FL offset - case 0x02: result = BC1FL(opcode); break; - - // BC1T offset - case 0x01: result = BC1T(opcode); break; - break; - - // BC1TL offset - case 0x03: result = BC1TL(opcode); break; - } - break; - } - - default: - switch (opcode & 0x3F) { - // ADD.fmt - case 0x00: - if (SP) { - movss(xmm0, FS_x); - movss(xmm1, FT_x); - addss(xmm0, xmm1); - movss(FD_x, xmm0); - } - else { - movsd(xmm0, FS_x); - movsd(xmm1, FT_x); - addsd(xmm0, xmm1); - movsd(FD_x, xmm0); - } - break; - // SUB.fmt - case 0x01: - if (SP) { - movss(xmm0, FS_x); - movss(xmm1, FT_x); - subss(xmm0, xmm1); - movss(FD_x, xmm0); - } - else { - movsd(xmm0, FS_x); - movsd(xmm1, FT_x); - subsd(xmm0, xmm1); - movsd(FD_x, xmm0); - } - break; - - // MUL.fmt - case 0x02: - if (SP) { - movss(xmm0, FS_x); - movss(xmm1, FT_x); - mulss(xmm0, xmm1); - movss(FD_x, xmm0); - } - else { - movsd(xmm0, FS_x); - movsd(xmm1, FT_x); - mulsd(xmm0, xmm1); - movsd(FD_x, xmm0); - } - break; - // DIV.fmt - case 0x03: - if (SP) { - movss(xmm0, FS_x); - movss(xmm1, FT_x); - divss(xmm0, xmm1); - movss(FD_x, xmm0); - } - else { - movsd(xmm0, FS_x); - movsd(xmm1, FT_x); - divsd(xmm0, xmm1); - movsd(FD_x, xmm0); - } - break; - // SQRT.fmt - case 0x04: - if (SP) { - movss(xmm0, FS_x); - sqrtss(xmm1, xmm0); - movss(FD_x, xmm1); - } - else { - movsd(xmm0, FS_x); - sqrtsd(xmm1, xmm0); - movsd(FD_x, xmm1); - } - break; - // ABS.fmt - case 0x05: { - static const size_t s_mask = 0x7FFFFFFF; - static const size_t d_mask = 0x7FFFFFFFFFFFFFFFULL; - if (SP) { - movss(xmm0, FS_x); - movss(xmm2, ptr[&s_mask]); - andps(xmm0, xmm2); - movss(FD_x, xmm0); - } - else { - movsd(xmm0, FS_x); - movsd(xmm2, ptr[&d_mask]); - andpd(xmm0, xmm2); - movsd(FD_x, xmm0); - } - break; - } - - // MOV.fmt - case 0x06: - if (SP) { - mov(eax, FS_x); - mov(FD_x, eax); - } - else { - mov(rax, FS_x); - mov(FD_x, rax); - } - break; - // NEG.fmt - case 0x07: { - static const size_t s_mask = 0x80000000; - static const size_t d_mask = 0x8000000000000000ULL; - if (SP) { - movss(xmm0, FS_x); - movss(xmm2, ptr[&s_mask]); - xorps(xmm0, xmm2); - movss(FD_x, xmm0); - } - else { - movsd(xmm0, FS_x); - movsd(xmm2, ptr[&d_mask]); - xorpd(xmm0, xmm2); - movsd(FD_x, xmm0); - } - break; - } - - // CVT.S.x - case 0x20: { - mov(rax, FS_x); - pxor(xmm0, xmm0); - if (INTEGER) { - if (SP) { - cvtsi2ss(xmm0, eax); - } else { - cvtsi2ss(xmm0, rax); - } - } else { - movss(xmm0, FS_x); - } - movss(FD_x, xmm0); - break; - } - - // CVT.W.x - case 0x24: { - if (SP) { - movss(xmm0, FS_x); - } - else { - movsd(xmm0, FS_x); - } - cvtss2si(eax, xmm0); - mov(FD_x, eax); - break; - } - - // C.UN.x fs, ft - case 0x32: - // C.F fs, ft - case 0x3C: - mov(rax, FCR31_x); - and_(rax,~(0x800000ULL)); - mov(FCR31_x, rax); - break; - - - // C.OLT.x fs, ft - case 0x34: { - mov(rax, FCR31_x); - mov(rcx, rax); - and_(rcx,~(0x800000ULL)); - or_(rax, 0x800000ULL); - if (SP) { - movss(xmm0, FS_x); - movss(xmm1, FT_x); - ucomiss(xmm0, xmm1); - } - else { - movsd(xmm0, FS_x); - movsd(xmm1, FT_x); - ucomisd(xmm0, xmm1); - } - cmovnb(eax, ecx); - mov(FCR31_x, rax); - break; - } - - default: - drc_log("COP1 fallback for %x\n", opcode); - fallback(opcode, &mips3::cop1_execute_32); - break; - } - break; - } - return result; -} - -} - -#endif // MIPS3_X64_COP1 - diff --git a/jan/src/cpu/mips3/x64/mips3_x64_defs.h b/jan/src/cpu/mips3/x64/mips3_x64_defs.h deleted file mode 100644 index 29177bb03..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64_defs.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_X64_DEFS -#define MIPS3_X64_DEFS - -#include -#include "../mipsdef.h" - -#define DEBUG_DRC 1 - -#if DEBUG_DRC -# define drc_log(...) printf("drc: " __VA_ARGS__); fflush(stdout) -#else -# define drc_log(...) -#endif - -#define drc_log_error(...) printf("drc_err: " __VA_ARGS__); fflush(stdout) - -#define DEBUG_CALL(f) \ - mov(rax, (size_t)(void*)&f); \ - call(rax); - -#define CORE_PC (m_core->m_state.pc) -#define RS_ref ((size_t)&m_core->m_state.r[RSNUM]) -#define RD_ref ((size_t)&m_core->m_state.r[RDNUM]) -#define RT_ref ((size_t)&m_core->m_state.r[RTNUM]) -#define LO_ref ((size_t)&m_core->m_state.lo) -#define HI_ref ((size_t)&m_core->m_state.hi) -#define R_ref(n) ((size_t)&m_core->m_state.r[n]) -#define ADR(n) ((size_t)&n) - -namespace mips { -template -size_t get_method_addr(R (C::*f)(Args...)) { - return reinterpret_cast((void* &)f); -} -} - -#define F_ADR(f) ((size_t)(void*)&f) -#define M_ADR(f) (mips::get_method_addr(&f)) - -#define FPR_ref(n) ((size_t)&m_core->m_state.cpr[1][n]) -#define FCR_ref(n) ((size_t)&m_core->m_state.fcr[n]) - -#define Rn_x(n) ptr[rbx + ((size_t)offsetof(mips3::cpu_state, r[n]))] -#define RS_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, r[RSNUM]))] -#define RD_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, r[RDNUM]))] -#define RT_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, r[RTNUM]))] -#define LO_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, lo))] -#define HI_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, hi))] -#define PC_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, pc))] - -#define COP0_x(n) ptr[rbx + ((size_t)offsetof(mips3::cpu_state, cpr[0][n]))] -#define COP1_x(n) ptr[rbx + ((size_t)offsetof(mips3::cpu_state, cpr[1][n]))] - -#define TOTAL_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, total_cycles))] -#define RSTCYC_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, reset_cycle))] - -#define RS_q qword[rbx + ((size_t)offsetof(mips3::cpu_state, r[RSNUM]))] -#define RD_q qword[rbx + ((size_t)offsetof(mips3::cpu_state, r[RDNUM]))] -#define RT_q qword[rbx + ((size_t)offsetof(mips3::cpu_state, r[RTNUM]))] -#define PC_q qword[rbx + ((size_t)offsetof(mips3::cpu_state, pc))] - -#define COP0_q(n) qword[rbx + ((size_t)offsetof(mips3::cpu_state, cpr[0][n]))] -#define COP1_q(n) qword[rbx + ((size_t)offsetof(mips3::cpu_state, cpr[1][n]))] - -#define FD_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, cpr[1][FDNUM]))] -#define FS_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, cpr[1][FSNUM]))] -#define FT_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, cpr[1][FTNUM]))] -#define FCR31_x ptr[rbx + ((size_t)offsetof(mips3::cpu_state, fcr[31]))] - -#define TOTAL_q qword[rbx + ((size_t)offsetof(mips3::cpu_state, total_cycles))] -#define RSTCYC_q qword[rbx + ((size_t)offsetof(mips3::cpu_state, reset_cycle))] - -#endif // MIPS3_X64_DEFS - diff --git a/jan/src/cpu/mips3/x64/mips3_x64_misc.h b/jan/src/cpu/mips3/x64/mips3_x64_misc.h deleted file mode 100644 index 6c78b2871..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64_misc.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_X64_MISC -#define MIPS3_X64_MISC - - -#include "../mips3.h" -#include "mips3_x64_defs.h" -#include "mips3_x64.h" -#include "xbyak/xbyak.h" - - -namespace mips -{ - -inline bool mips3_x64::SLT(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - cmp(rax, RT_x); - setl(dl); - movzx(edx, dl); - mov(RD_x, rdx); - } - return false; -} - -inline bool mips3_x64::SLTU(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RS_x); - cmp(rax, RT_x); - setb(dl); - movzx(edx, dl); - mov(RD_x, rdx); - } - return false; -} - -inline bool mips3_x64::SLTI(uint32_t opcode) -{ - if (RTNUM) { - mov(rax, RS_x); - cmp(rax, IMM_s64); - setl(dl); - movzx(edx, dl); - mov(RT_x, rdx); - } - return false; -} - -inline bool mips3_x64::SLTIU(uint32_t opcode) -{ - if (RTNUM) { - mov(rax, RS_x); - cmp(rax, IMM); - setb(dl); - movzx(edx, dl); - mov(RT_x, rdx); - } - return false; -} - -inline bool mips3_x64::MFHI(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, HI_x); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::MTHI(uint32_t opcode) -{ - mov(rax, RS_x); - mov(HI_x, rax); - return false; -} - -inline bool mips3_x64::MFLO(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, LO_x); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::MTLO(uint32_t opcode) -{ - mov(rax, RS_x); - mov(LO_x, rax); - return false; -} - - -} - -#endif // MIPS3_X64_MISC - diff --git a/jan/src/cpu/mips3/x64/mips3_x64_rw.h b/jan/src/cpu/mips3/x64/mips3_x64_rw.h deleted file mode 100644 index 98c0edea5..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64_rw.h +++ /dev/null @@ -1,394 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_X64_RW -#define MIPS3_X64_RW - - -#include "../mips3.h" -#include "mips3_x64_defs.h" -#include "mips3_x64.h" -#include "xbyak/xbyak.h" -#include "../mips3_memory.h" - - -namespace mips -{ - -#define GET_EADDR_IN_RDX(ignore) \ - do { \ - auto eaddr = ptr[rbp-8];\ - mov(rdi, (size_t) m_core);\ - mov(rsi, (int64_t)(int32_t)SIMM);\ - add(rsi, RS_x);\ - and_(rsi, ~((uint64_t)ignore));\ - lea(rdx, eaddr);\ - size_t madr = M_ADR(mips3::translate);\ - mov(rax, madr);\ - call(rax);\ - mov(rdx, eaddr);\ - } while (0) - -#define GET_EA_RDX_VA_RCX(ignore) \ - do { \ - auto eaddr = ptr[rbp-8];\ - auto vaddr = ptr[rbp-16];\ - mov(rdi, (size_t) m_core);\ - mov(rsi, (int64_t)(int32_t)SIMM);\ - add(rsi, RS_x);\ - and_(rsi, ~((uint64_t)ignore));\ - lea(rdx, eaddr);\ - mov(vaddr, rsi);\ - mov(rax, M_ADR(mips3::translate));\ - call(rax);\ - mov(rdx, eaddr);\ - mov(rcx, vaddr);\ - } while (0) - -bool mips3_x64::LUI(uint32_t opcode) -{ - if (RTNUM) { - int64_t value = (int32_t)(IMM << 16); - mov(RT_q, value); - } - return false; -} - -bool mips3_x64::SB(uint32_t opcode) -{ - GET_EADDR_IN_RDX(0); - mov(rdi, rdx); - mov(rsi, RT_x); - mov(rax, F_ADR(mem::write_byte)); - call(rax); - return false; -} - -bool mips3_x64::SH(uint32_t opcode) -{ - GET_EADDR_IN_RDX(1); - mov(rdi, rdx); - mov(rsi, RT_x); - mov(rax, F_ADR(mem::write_half)); - call(rax); - return false; -} - -bool mips3_x64::SW(uint32_t opcode) -{ - GET_EADDR_IN_RDX(3); - mov(rdi, rdx); - mov(rsi, RT_x); - mov(rax, F_ADR(mem::write_word)); - call(rax); - return false; -} - -bool mips3_x64::SD(uint32_t opcode) -{ - GET_EADDR_IN_RDX(7); - mov(rdi, rdx); - mov(rsi, RT_x); - mov(rax, F_ADR(mem::write_dword)); - call(rax); - return false; -} - -// TODO: FIX IT -bool mips3_x64::SDL(uint32_t opcode) -{ - return false; -} - -// TODO: FIX IT -bool mips3_x64::SDR(uint32_t opcode) -{ - return false; -} - - -bool mips3_x64::LWL(uint32_t opcode) -{ - if (RTNUM) { - GET_EA_RDX_VA_RCX(3); - auto shift = ptr[rbp-8]; - auto mask = ptr[rbp-16]; - - mov(rax, rcx); - and_(rax, 3); - xor_(rax, 3); - shl(rax, 3); - mov(shift, rax); - - mov(rax, 0); - not_(rax); - mov(rcx, shift); - shl(rax, cl); - mov(mask, rax); - - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_dword)); - call(rax); - - mov(rcx, shift); - shl(rax, cl); - - mov(rcx, RT_x); - mov(rdi, mask); - not_(rdi); - and_(rcx, rdi); - or_(rax, rcx); - - cdqe(); - mov(RT_x, rax); - - } - return false; -} - - -bool mips3_x64::LWR(uint32_t opcode) -{ - if (RTNUM) { - GET_EA_RDX_VA_RCX(3); - - auto shift = ptr[rbp-8]; - auto mask = ptr[rbp-16]; - - mov(rax, rcx); - and_(rax, 3); - shl(rax, 3); - mov(shift, rax); - - xor_(rax, rax); - not_(rax); - mov(rcx, shift); - shr(rax, cl); - mov(mask, rax); - - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_word)); - call(rax); - - mov(rcx, shift); - shr(rax, cl); - - mov(rcx, RT_x); - mov(rdi, mask); - not_(rdi); - and_(rcx, rdi); - or_(rax, rcx); - - cdqe(); - mov(RT_x, rax); - - } - return false; -} - - -// Válido apenas para little endian. -bool mips3_x64::LDL(uint32_t opcode) -{ - if (RTNUM) { - GET_EA_RDX_VA_RCX(7); - auto shift = ptr[rbp-8]; - auto mask = ptr[rbp-16]; - - mov(rax, rcx); - and_(rax, 7); - xor_(rax, 7); - shl(rax, 3); - mov(shift, rax); - - mov(rax, 0); - not_(rax); - mov(rcx, shift); - shl(rax, cl); - mov(mask, rax); - - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_dword)); - call(rax); - - mov(rcx, shift); - shl(rax, cl); - - mov(rcx, RT_x); - mov(rdi, mask); - not_(rdi); - and_(rcx, rdi); - or_(rax, rcx); - - mov(RT_x, rax); - - } - return false; -} - -// Válido apenas para little endian. -/* - uint32_t vaddr = ((int32_t)SIMM) + RS; - - int shift = (vaddr & 7) * 8; - uint64_t mask = (0xFFFFFFFFFFFFFFFFULL >> shift); - - addr_t eaddr; - if (translate(vaddr & ~7, &eaddr)) { - } - //d18 - auto data = mem::read_dword(eaddr); - - if (RTNUM) - RT = (RT & ~mask) | (data >> shift);*/ -bool mips3_x64::LDR(uint32_t opcode) -{ - if (RTNUM) { - GET_EA_RDX_VA_RCX(7); - - auto shift = ptr[rbp-8]; - auto mask = ptr[rbp-16]; - - mov(rax, rcx); - and_(rax, 7); - shl(rax, 3); - mov(shift, rax); - - xor_(rax, rax); - not_(rax); - mov(rcx, shift); - shr(rax, cl); - mov(mask, rax); - - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_dword)); - call(rax); - - mov(rcx, shift); - shr(rax, cl); - - mov(rcx, RT_x); - mov(rdi, mask); - not_(rdi); - and_(rcx, rdi); - or_(rax, rcx); - - mov(RT_x, rax); - } - return false; -} - - -bool mips3_x64::LW(uint32_t opcode) -{ - if (RTNUM) { - GET_EADDR_IN_RDX(3); - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_word)); - call(rax); - cdqe(); - mov(RT_x, rax); - } - return false; -} - -bool mips3_x64::LWU(uint32_t opcode) -{ - if (RTNUM) { - GET_EADDR_IN_RDX(3); - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_word)); - call(rax); - mov(RT_x, rax); - } - return false; -} - -bool mips3_x64::LD(uint32_t opcode) -{ - if (RTNUM) { - GET_EADDR_IN_RDX(7); - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_dword)); - call(rax); - mov(RT_x, rax); - } - return false; -} - -bool mips3_x64::LL(uint32_t opcode) -{ - return false; -} - -// TODO: FIX IT -bool mips3_x64::LWC1(uint32_t opcode) -{ - return false; -} - -// TODO: FIX IT -bool mips3_x64::SWC1(uint32_t opcode) -{ - return false; -} - -bool mips3_x64::LB(uint32_t opcode) -{ - if (RTNUM) { - GET_EADDR_IN_RDX(0); - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_byte)); - call(rax); - movsx(eax, al); - cdqe(); - mov(RT_x, rax); - } - return false; -} - -bool mips3_x64::LBU(uint32_t opcode) -{ - if (RTNUM) { - GET_EADDR_IN_RDX(0); - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_byte)); - call(rax); - movzx(eax, al); - mov(RT_x, rax); - } - return false; -} - -bool mips3_x64::LH(uint32_t opcode) -{ - if (RTNUM) { - GET_EADDR_IN_RDX(1); - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_half)); - call(rax); - movsx(eax, ax); - cdqe(); - mov(RT_x, rax); - } - return false; -} - -bool mips3_x64::LHU(uint32_t opcode) -{ - if (RTNUM) { - GET_EADDR_IN_RDX(1); - mov(rdi, rdx); - mov(rax, F_ADR(mem::read_half)); - call(rax); - movzx(eax, ax); - mov(RT_x, rax); - } - return false; -} - -} - -#endif // MIPS3_X64_RW - diff --git a/jan/src/cpu/mips3/x64/mips3_x64_shift.h b/jan/src/cpu/mips3/x64/mips3_x64_shift.h deleted file mode 100644 index da95f5aca..000000000 --- a/jan/src/cpu/mips3/x64/mips3_x64_shift.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef MIPS3_X64_SHIFT -#define MIPS3_X64_SHIFT - - -#include "../mips3.h" -#include "mips3_x64_defs.h" -#include "mips3_x64.h" -#include "xbyak/xbyak.h" - - -namespace mips -{ - -inline bool mips3_x64::SLL(uint32_t opcode) -{ - if (RDNUM && SHAMT) { - mov(eax, RT_x); - shl(eax, SHAMT); - cdqe(); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::SRL(uint32_t opcode) -{ - if (RDNUM && SHAMT) { - mov(eax, RT_x); - shr(eax, SHAMT); - cdqe(); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::SRA(uint32_t opcode) -{ - if (RDNUM) { - mov(eax, RT_x); - sar(eax, SHAMT); - cdqe(); - mov(RD_x, rax); - } - return false; -} - - -inline bool mips3_x64::SLLV(uint32_t opcode) -{ - if (RDNUM) { - mov(eax, RT_x); - mov(ecx, RS_x); - and_(ecx, 31); - shl(eax, cl); - cdqe(); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::SRLV(uint32_t opcode) -{ - if (RDNUM) { - mov(eax, RT_x); - mov(ecx, RS_x); - and_(ecx, 31); - shr(eax, cl); - cdqe(); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::SRAV(uint32_t opcode) -{ - if (RDNUM) { - mov(eax, RT_x); - mov(ecx, RS_x); - and_(ecx, 31); - sar(eax, cl); - cdqe(); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::DSLLV(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RT_x); - mov(rcx, RS_x); - and_(rcx, 63); - shl(rax, cl); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::DSLRV(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RT_x); - mov(rcx, RS_x); - and_(rcx, 63); - shr(rax, cl); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::DSRAV(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RT_x); - mov(rcx, RS_x); - and_(rcx, 63); - sar(rax, cl); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::DSLL(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RT_x); - shl(rax, SHAMT); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::DSRL(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RT_x); - shr(rax, SHAMT); - mov(RD_x, rax); - - } - return false; -} - -inline bool mips3_x64::DSRA(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RT_x); - sar(rax, SHAMT & 63); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::DSLL32(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RT_x); - shl(rax, SHAMT + 32); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::DSRL32(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RT_x); - shr(rax, SHAMT + 32); - mov(RD_x, rax); - } - return false; -} - -inline bool mips3_x64::DSRA32(uint32_t opcode) -{ - if (RDNUM) { - mov(rax, RT_x); - sar(rax, SHAMT + 32); - mov(RD_x, rax); - } - return false; -} - - - -} - -#endif // MIPS3_X64_SHIFT - diff --git a/jan/src/cpu/mips3/x64/xbyak/xbyak.h b/jan/src/cpu/mips3/x64/xbyak/xbyak.h deleted file mode 100644 index 5147e590a..000000000 --- a/jan/src/cpu/mips3/x64/xbyak/xbyak.h +++ /dev/null @@ -1,2118 +0,0 @@ -#pragma once -#ifndef XBYAK_XBYAK_H_ -#define XBYAK_XBYAK_H_ -/*! - @file xbyak.h - @brief Xbyak ; JIT assembler for x86(IA32)/x64 by C++ - @author herumi - @url https://github.com/herumi/xbyak, http://homepage1.nifty.com/herumi/soft/xbyak_e.html - @note modified new BSD license - http://opensource.org/licenses/BSD-3-Clause -*/ -#ifndef XBYAK_NO_OP_NAMES - #if not +0 // trick to detect whether 'not' is operator or not - #error "use -fno-operator-names option if you want to use and(), or(), xor(), not() as function names, Or define XBYAK_NO_OP_NAMES and use and_(), or_(), xor_(), not_()." - #endif -#endif - -#include // for debug print -#include -#include -#include -#include -#ifndef NDEBUG -#include -#endif - -//#define XBYAK_USE_MMAP_ALLOCATOR -#if !defined(__GNUC__) || defined(__MINGW32__) - #undef XBYAK_USE_MMAP_ALLOCATOR -#endif - -// This covers -std=(gnu|c)++(0x|11|1y), -stdlib=libc++, and modern Microsoft. -#if ((defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(_LIBCPP_VERSION) ||\ - ((__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__))) - #include - #define XBYAK_STD_UNORDERED_MAP std::unordered_map - #define XBYAK_STD_UNORDERED_MULTIMAP std::unordered_multimap - -// Clang/llvm-gcc and ICC-EDG in 'GCC-mode' always claim to be GCC 4.2, using -// libstdcxx 20070719 (from GCC 4.2.1, the last GPL 2 version). -// These headers have been expanded/fixed in various forks. -// In F.S.F. 'real' GCC, issues with the tr headers were resolved in GCC 4.5. -#elif defined(__GNUC__) && (__GNUC__ >= 4) && ((__GNUC_MINOR__ >= 5) || \ - ((__GLIBCXX__ >= 20070719) && (__GNUC_MINOR__ >= 2) && \ - (defined(__INTEL_COMPILER) || defined(__llvm__)))) - #include - #define XBYAK_STD_UNORDERED_MAP std::tr1::unordered_map - #define XBYAK_STD_UNORDERED_MULTIMAP std::tr1::unordered_multimap - -#elif defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER < 1600) - #include - #define XBYAK_STD_UNORDERED_MAP std::tr1::unordered_map - #define XBYAK_STD_UNORDERED_MULTIMAP std::tr1::unordered_multimap - -#else - #include - #define XBYAK_STD_UNORDERED_MAP std::map - #define XBYAK_STD_UNORDERED_MULTIMAP std::multimap -#endif -#ifdef _WIN32 - #include - #include -#elif defined(__GNUC__) - #include - #include - #include -#endif -#if !defined(_MSC_VER) || (_MSC_VER >= 1600) - #include -#endif - -#if defined(_WIN64) || defined(__MINGW64__) || (defined(__CYGWIN__) && defined(__x86_64__)) - #define XBYAK64_WIN -#elif defined(__x86_64__) - #define XBYAK64_GCC -#endif -#if !defined(XBYAK64) && !defined(XBYAK32) - #if defined(XBYAK64_GCC) || defined(XBYAK64_WIN) - #define XBYAK64 - #else - #define XBYAK32 - #endif -#endif - -#ifdef _MSC_VER - #pragma warning(push) - #pragma warning(disable : 4514) /* remove inline function */ - #pragma warning(disable : 4786) /* identifier is too long */ - #pragma warning(disable : 4503) /* name is too long */ - #pragma warning(disable : 4127) /* constant expresison */ -#endif - -namespace Xbyak { - -#include "xbyak_bin2hex.h" - -enum { - DEFAULT_MAX_CODE_SIZE = 4096, - VERSION = 0x4810 /* 0xABCD = A.BC(D) */ -}; - -#ifndef MIE_INTEGER_TYPE_DEFINED -#define MIE_INTEGER_TYPE_DEFINED -#ifdef _MSC_VER - typedef unsigned __int64 uint64; - typedef __int64 sint64; -#else - typedef uint64_t uint64; - typedef int64_t sint64; -#endif -typedef unsigned int uint32; -typedef unsigned short uint16; -typedef unsigned char uint8; -#endif - -#ifndef MIE_ALIGN - #ifdef _MSC_VER - #define MIE_ALIGN(x) __declspec(align(x)) - #else - #define MIE_ALIGN(x) __attribute__((aligned(x))) - #endif -#endif -#ifndef MIE_PACK // for shufps - #define MIE_PACK(x, y, z, w) ((x) * 64 + (y) * 16 + (z) * 4 + (w)) -#endif - -enum { - ERR_NONE = 0, - ERR_BAD_ADDRESSING, - ERR_CODE_IS_TOO_BIG, - ERR_BAD_SCALE, - ERR_ESP_CANT_BE_INDEX, - ERR_BAD_COMBINATION, - ERR_BAD_SIZE_OF_REGISTER, - ERR_IMM_IS_TOO_BIG, - ERR_BAD_ALIGN, - ERR_LABEL_IS_REDEFINED, - ERR_LABEL_IS_TOO_FAR, - ERR_LABEL_IS_NOT_FOUND, - ERR_CODE_ISNOT_COPYABLE, - ERR_BAD_PARAMETER, - ERR_CANT_PROTECT, - ERR_CANT_USE_64BIT_DISP, - ERR_OFFSET_IS_TOO_BIG, - ERR_MEM_SIZE_IS_NOT_SPECIFIED, - ERR_BAD_MEM_SIZE, - ERR_BAD_ST_COMBINATION, - ERR_OVER_LOCAL_LABEL, // not used - ERR_UNDER_LOCAL_LABEL, - ERR_CANT_ALLOC, - ERR_ONLY_T_NEAR_IS_SUPPORTED_IN_AUTO_GROW, - ERR_BAD_PROTECT_MODE, - ERR_BAD_PNUM, - ERR_BAD_TNUM, - ERR_BAD_VSIB_ADDRESSING, - ERR_CANT_CONVERT, - ERR_LABEL_ISNOT_SET_BY_L, - ERR_LABEL_IS_ALREADY_SET_BY_L, - ERR_BAD_LABEL_STR, - ERR_MUNMAP, - ERR_INTERNAL -}; - -class Error : public std::exception { - int err_; -public: - explicit Error(int err) : err_(err) - { - if (err_ < 0 || err_ > ERR_INTERNAL) { - fprintf(stderr, "bad err=%d in Xbyak::Error\n", err_); - exit(1); - } - } - operator int() const { return err_; } - const char *what() const throw() - { - static const char *errTbl[] = { - "none", - "bad addressing", - "code is too big", - "bad scale", - "esp can't be index", - "bad combination", - "bad size of register", - "imm is too big", - "bad align", - "label is redefined", - "label is too far", - "label is not found", - "code is not copyable", - "bad parameter", - "can't protect", - "can't use 64bit disp(use (void*))", - "offset is too big", - "MEM size is not specified", - "bad mem size", - "bad st combination", - "over local label", - "under local label", - "can't alloc", - "T_SHORT is not supported in AutoGrow", - "bad protect mode", - "bad pNum", - "bad tNum", - "bad vsib addressing", - "can't convert", - "label is not set by L()", - "label is already set by L()", - "bad label string", - "err munmap", - "internal error", - }; - assert((size_t)err_ < sizeof(errTbl) / sizeof(*errTbl)); - return errTbl[err_]; - } -}; - -inline const char *ConvertErrorToString(Error err) -{ - return err.what(); -} - -inline void *AlignedMalloc(size_t size, size_t alignment) -{ -#ifdef __MINGW32__ - return __mingw_aligned_malloc(size, alignment); -#elif defined(_WIN32) - return _aligned_malloc(size, alignment); -#else - void *p; - int ret = posix_memalign(&p, alignment, size); - return (ret == 0) ? p : 0; -#endif -} - -inline void AlignedFree(void *p) -{ -#ifdef __MINGW32__ - __mingw_aligned_free(p); -#elif defined(_MSC_VER) - _aligned_free(p); -#else - free(p); -#endif -} - -template -inline const To CastTo(From p) throw() -{ - return (const To)(size_t)(p); -} -namespace inner { - -static const size_t ALIGN_PAGE_SIZE = 4096; - -inline bool IsInDisp8(uint32 x) { return 0xFFFFFF80 <= x || x <= 0x7F; } -inline bool IsInInt32(uint64 x) { return ~uint64(0x7fffffffu) <= x || x <= 0x7FFFFFFFU; } - -inline uint32 VerifyInInt32(uint64 x) -{ -#ifdef XBYAK64 - if (!IsInInt32(x)) throw Error(ERR_OFFSET_IS_TOO_BIG); -#endif - return static_cast(x); -} - -enum LabelMode { - LasIs, // as is - Labs, // absolute - LaddTop // (addr + top) for mov(reg, label) with AutoGrow -}; - -} // inner - -/* - custom allocator -*/ -struct Allocator { - virtual uint8 *alloc(size_t size) { return reinterpret_cast(AlignedMalloc(size, inner::ALIGN_PAGE_SIZE)); } - virtual void free(uint8 *p) { AlignedFree(p); } - virtual ~Allocator() {} - /* override to return false if you call protect() manually */ - virtual bool useProtect() const { return true; } -}; - -#ifdef XBYAK_USE_MMAP_ALLOCATOR -class MmapAllocator : Allocator { - typedef XBYAK_STD_UNORDERED_MAP SizeList; - SizeList sizeList_; -public: - uint8 *alloc(size_t size) - { - const size_t alignedSizeM1 = inner::ALIGN_PAGE_SIZE - 1; - size = (size + alignedSizeM1) & ~alignedSizeM1; -#ifdef MAP_ANONYMOUS - const int mode = MAP_PRIVATE | MAP_ANONYMOUS; -#elif defined(MAP_ANON) - const int mode = MAP_PRIVATE | MAP_ANON; -#else - #error "not supported" -#endif - void *p = mmap(NULL, size, PROT_READ | PROT_WRITE, mode, -1, 0); - if (p == MAP_FAILED) throw Error(ERR_CANT_ALLOC); - assert(p); - sizeList_[(uintptr_t)p] = size; - return (uint8*)p; - } - void free(uint8 *p) - { - if (p == 0) return; - SizeList::iterator i = sizeList_.find((uintptr_t)p); - if (i == sizeList_.end()) throw Error(ERR_BAD_PARAMETER); - if (munmap((void*)i->first, i->second) < 0) throw Error(ERR_MUNMAP); - sizeList_.erase(i); - } -}; -#endif - -class Operand { -private: - uint8 idx_; // 0..15, MSB = 1 if spl/bpl/sil/dil - uint8 kind_; - uint16 bit_; -public: - enum Kind { - NONE = 0, - MEM = 1 << 1, - IMM = 1 << 2, - REG = 1 << 3, - _MMX = 1 << 4, - XMM = 1 << 5, - FPU = 1 << 6, - YMM = 1 << 7 - }; - enum Code { -#ifdef XBYAK64 - RAX = 0, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15, - R8D = 8, R9D, R10D, R11D, R12D, R13D, R14D, R15D, - R8W = 8, R9W, R10W, R11W, R12W, R13W, R14W, R15W, - R8B = 8, R9B, R10B, R11B, R12B, R13B, R14B, R15B, - SPL = 4, BPL, SIL, DIL, -#endif - EAX = 0, ECX, EDX, EBX, ESP, EBP, ESI, EDI, - AX = 0, CX, DX, BX, SP, BP, SI, DI, - AL = 0, CL, DL, BL, AH, CH, DH, BH - }; - Operand() : idx_(0), kind_(0), bit_(0) { } - Operand(int idx, Kind kind, int bit, bool ext8bit = 0) - : idx_(static_cast(idx | (ext8bit ? 0x80 : 0))) - , kind_(static_cast(kind)) - , bit_(static_cast(bit)) - { - assert((bit_ & (bit_ - 1)) == 0); // bit must be power of two - } - Kind getKind() const { return static_cast(kind_); } - int getIdx() const { return idx_ & 15; } - bool isNone() const { return kind_ == 0; } - bool isMMX() const { return is(_MMX); } - bool isXMM() const { return is(XMM); } - bool isYMM() const { return is(YMM); } - bool isREG(int bit = 0) const { return is(REG, bit); } - bool isMEM(int bit = 0) const { return is(MEM, bit); } - bool isFPU() const { return is(FPU); } - bool isExt8bit() const { return (idx_ & 0x80) != 0; } - // ah, ch, dh, bh? - bool isHigh8bit() const - { - if (!isBit(8)) return false; - if (isExt8bit()) return false; - const int idx = getIdx(); - return AH <= idx && idx <= BH; - } - // any bit is accetable if bit == 0 - bool is(int kind, uint32 bit = 0) const - { - return (kind_ & kind) && (bit == 0 || (bit_ & bit)); // cf. you can set (8|16) - } - bool isBit(uint32 bit) const { return (bit_ & bit) != 0; } - uint32 getBit() const { return bit_; } - const char *toString() const - { - const int idx = getIdx(); - if (kind_ == REG) { - if (isExt8bit()) { - static const char *tbl[4] = { "spl", "bpl", "sil", "dil" }; - return tbl[idx - 4]; - } - static const char *tbl[4][16] = { - { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh", "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }, - { "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }, - { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }, - { "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }, - }; - return tbl[bit_ == 8 ? 0 : bit_ == 16 ? 1 : bit_ == 32 ? 2 : 3][idx]; - } else if (isYMM()) { - static const char *tbl[16] = { "ym0", "ym1", "ym2", "ym3", "ym4", "ym5", "ym6", "ym7", "ym8", "ym9", "ym10", "ym11", "ym12", "ym13", "ym14", "ym15" }; - return tbl[idx]; - } else if (isXMM()) { - static const char *tbl[16] = { "xm0", "xm1", "xm2", "xm3", "xm4", "xm5", "xm6", "xm7", "xm8", "xm9", "xm10", "xm11", "xm12", "xm13", "xm14", "xm15" }; - return tbl[idx]; - } else if (isMMX()) { - static const char *tbl[8] = { "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7" }; - return tbl[idx]; - } else if (isFPU()) { - static const char *tbl[8] = { "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7" }; - return tbl[idx]; - } - throw Error(ERR_INTERNAL); - } - bool operator==(const Operand& rhs) const { return idx_ == rhs.idx_ && kind_ == rhs.kind_ && bit_ == rhs.bit_; } - bool operator!=(const Operand& rhs) const { return !operator==(rhs); } -}; - -class Label; - -struct Reg8; -struct Reg16; -struct Reg32; -#ifdef XBYAK64 -struct Reg64; -#endif -class Reg : public Operand { - bool hasRex() const { return isExt8bit() | isREG(64) | isExtIdx(); } -public: - Reg() { } - Reg(int idx, Kind kind, int bit = 0, bool ext8bit = false) : Operand(idx, kind, bit, ext8bit) { } - Reg changeBit(int bit) const { return Reg(getIdx(), getKind(), bit, isExt8bit()); } - bool isExtIdx() const { return getIdx() > 7; } - uint8 getRex(const Reg& base = Reg()) const - { - return (hasRex() || base.hasRex()) ? uint8(0x40 | ((isREG(64) | base.isREG(64)) ? 8 : 0) | (isExtIdx() ? 4 : 0)| (base.isExtIdx() ? 1 : 0)) : 0; - } - Reg8 cvt8() const; - Reg16 cvt16() const; - Reg32 cvt32() const; -#ifdef XBYAK64 - Reg64 cvt64() const; -#endif -}; - -struct Reg8 : public Reg { - explicit Reg8(int idx = 0, bool ext8bit = false) : Reg(idx, Operand::REG, 8, ext8bit) { } -}; - -struct Reg16 : public Reg { - explicit Reg16(int idx = 0) : Reg(idx, Operand::REG, 16) { } -}; - -struct Mmx : public Reg { - explicit Mmx(int idx = 0, Kind kind = Operand::_MMX, int bit = 64) : Reg(idx, kind, bit) { } -}; - -struct Xmm : public Mmx { - explicit Xmm(int idx = 0, Kind kind = Operand::XMM, int bit = 128) : Mmx(idx, kind, bit) { } -}; - -struct Ymm : public Xmm { - explicit Ymm(int idx = 0) : Xmm(idx, Operand::YMM, 256) { } -}; - -struct Fpu : public Reg { - explicit Fpu(int idx = 0) : Reg(idx, Operand::FPU, 32) { } -}; - -struct Reg32e : public Reg { - explicit Reg32e(int idx, int bit) : Reg(idx, Operand::REG, bit) {} -}; -struct Reg32 : public Reg32e { - explicit Reg32(int idx = 0) : Reg32e(idx, 32) {} -}; -#ifdef XBYAK64 -struct Reg64 : public Reg32e { - explicit Reg64(int idx = 0) : Reg32e(idx, 64) {} -}; -struct RegRip { - sint64 disp_; - Label* label_; - explicit RegRip(sint64 disp = 0, Label* label = 0) : disp_(disp), label_(label) {} - friend const RegRip operator+(const RegRip& r, sint64 disp) { - return RegRip(r.disp_ + disp, r.label_); - } - friend const RegRip operator-(const RegRip& r, sint64 disp) { - return RegRip(r.disp_ - disp, r.label_); - } - friend const RegRip operator+(const RegRip& r, Label& label) { - if (r.label_) throw Error(ERR_BAD_ADDRESSING); - return RegRip(r.disp_, &label); - } -}; -#endif - -inline Reg8 Reg::cvt8() const -{ - const int idx = getIdx(); - if (isBit(8)) return Reg8(idx, isExt8bit()); -#ifdef XBYAK32 - if (idx >= 4) throw Error(ERR_CANT_CONVERT); -#endif - return Reg8(idx, 4 <= idx && idx < 8); -} - -inline Reg16 Reg::cvt16() const -{ - const int idx = getIdx(); - if (isBit(8) && (4 <= idx && idx < 8) && !isExt8bit()) throw Error(ERR_CANT_CONVERT); - return Reg16(idx); -} - -inline Reg32 Reg::cvt32() const -{ - const int idx = getIdx(); - if (isBit(8) && (4 <= idx && idx < 8) && !isExt8bit()) throw Error(ERR_CANT_CONVERT); - return Reg32(idx); -} - -#ifdef XBYAK64 -inline Reg64 Reg::cvt64() const -{ - const int idx = getIdx(); - if (isBit(8) && (4 <= idx && idx < 8) && !isExt8bit()) throw Error(ERR_CANT_CONVERT); - return Reg64(idx); -} -#endif - -class RegExp { -public: - struct SReg { - uint16 bit:9; // 32/64/128/256 none if 0 - uint16 idx:7; - SReg() : bit(0), idx(0) { } - void set(const Reg& r) { this->bit = uint16(r.getBit()); this->idx = uint16(r.getIdx()); } - bool operator==(const SReg& rhs) const { return bit == rhs.bit && idx == rhs.idx; } - }; - RegExp(size_t disp = 0) : disp_(disp), scale_(0) { } - RegExp(const Reg& r, int scale = 1) - : disp_(0) - , scale_(scale) - { - if (!r.is(Reg::REG, 32|64) && !r.is(Reg::XMM|Reg::YMM)) throw Error(ERR_BAD_SIZE_OF_REGISTER); - if (scale != 1 && scale != 2 && scale != 4 && scale != 8) throw Error(ERR_BAD_SCALE); - if (r.getBit() >= 128 || scale != 1) { // xmm/ymm is always index - index_.set(r); - } else { - base_.set(r); - } - } - bool isVsib() const { return index_.bit >= 128; } - bool isYMM() const { return index_.bit >= 256; } - RegExp optimize() const // select smaller size - { - // [reg * 2] => [reg + reg] - if (!isVsib() && !base_.bit && index_.bit && scale_ == 2) { - RegExp ret = *this; - ret.base_ = index_; - ret.scale_ = 1; - return ret; - } - return *this; - } - bool operator==(const RegExp& rhs) const - { - return base_ == rhs.base_ && index_ == rhs.index_ && disp_ == rhs.disp_; - } - const SReg& getBase() const { return base_; } - const SReg& getIndex() const { return index_; } - int getScale() const { return scale_; } - uint32 getDisp() const { return uint32(disp_); } - void verify() const - { - if (base_.bit >= 128) throw Error(ERR_BAD_SIZE_OF_REGISTER); - if (index_.bit && index_.bit <= 64) { - if (index_.idx == Operand::ESP) throw Error(ERR_ESP_CANT_BE_INDEX); - if (base_.bit && base_.bit != index_.bit) throw Error(ERR_BAD_SIZE_OF_REGISTER); - } - } -private: - friend RegExp operator+(const RegExp& a, const RegExp& b); - friend RegExp operator-(const RegExp& e, size_t disp); - /* - [base_ + index_ * scale_ + disp_] - base : Reg32e, index : Reg32e(w/o esp), Xmm, Ymm - */ - size_t disp_; - int scale_; - SReg base_; - SReg index_; -}; - -inline RegExp operator+(const RegExp& a, const RegExp& b) -{ - if (a.index_.bit && b.index_.bit) throw Error(ERR_BAD_ADDRESSING); - RegExp ret = a; - if (!ret.index_.bit) { ret.index_ = b.index_; ret.scale_ = b.scale_; } - if (b.base_.bit) { - if (ret.base_.bit) { - if (ret.index_.bit) throw Error(ERR_BAD_ADDRESSING); - // base + base => base + index * 1 - ret.index_ = b.base_; - // [reg + esp] => [esp + reg] - if (ret.index_.idx == Operand::ESP) std::swap(ret.base_, ret.index_); - ret.scale_ = 1; - } else { - ret.base_ = b.base_; - } - } - ret.disp_ += b.disp_; - return ret; -} -inline RegExp operator*(const Reg& r, int scale) -{ - return RegExp(r, scale); -} -inline RegExp operator-(const RegExp& e, size_t disp) -{ - RegExp ret = e; - ret.disp_ -= disp; - return ret; -} - -// 2nd parameter for constructor of CodeArray(maxSize, userPtr, alloc) -void *const AutoGrow = (void*)1; - -class CodeArray { - enum Type { - USER_BUF = 1, // use userPtr(non alignment, non protect) - ALLOC_BUF, // use new(alignment, protect) - AUTO_GROW // automatically move and grow memory if necessary - }; - CodeArray(const CodeArray& rhs); - void operator=(const CodeArray&); - bool isAllocType() const { return type_ == ALLOC_BUF || type_ == AUTO_GROW; } - struct AddrInfo { - size_t codeOffset; // position to write - size_t jmpAddr; // value to write - int jmpSize; // size of jmpAddr - inner::LabelMode mode; - AddrInfo(size_t _codeOffset, size_t _jmpAddr, int _jmpSize, inner::LabelMode _mode) - : codeOffset(_codeOffset), jmpAddr(_jmpAddr), jmpSize(_jmpSize), mode(_mode) {} - uint64 getVal(const uint8 *top) const - { - uint64 disp = (mode == inner::LaddTop) ? jmpAddr + size_t(top) : (mode == inner::LasIs) ? jmpAddr : jmpAddr - size_t(top); - if (jmpSize == 4) disp = inner::VerifyInInt32(disp); - return disp; - } - }; - typedef std::list AddrInfoList; - AddrInfoList addrInfoList_; - const Type type_; -#ifdef XBYAK_USE_MMAP_ALLOCATOR - MmapAllocator defaultAllocator_; -#else - Allocator defaultAllocator_; -#endif - Allocator *alloc_; -protected: - size_t maxSize_; - uint8 *top_; - size_t size_; - - /* - allocate new memory and copy old data to the new area - */ - void growMemory() - { - const size_t newSize = (std::max)(DEFAULT_MAX_CODE_SIZE, maxSize_ * 2); - uint8 *newTop = alloc_->alloc(newSize); - if (newTop == 0) throw Error(ERR_CANT_ALLOC); - for (size_t i = 0; i < size_; i++) newTop[i] = top_[i]; - alloc_->free(top_); - top_ = newTop; - maxSize_ = newSize; - } - /* - calc jmp address for AutoGrow mode - */ - void calcJmpAddress() - { - for (AddrInfoList::const_iterator i = addrInfoList_.begin(), ie = addrInfoList_.end(); i != ie; ++i) { - uint64 disp = i->getVal(top_); - rewrite(i->codeOffset, disp, i->jmpSize); - } - if (alloc_->useProtect() && !protect(top_, size_, true)) throw Error(ERR_CANT_PROTECT); - } -public: - explicit CodeArray(size_t maxSize, void *userPtr = 0, Allocator *allocator = 0) - : type_(userPtr == AutoGrow ? AUTO_GROW : userPtr ? USER_BUF : ALLOC_BUF) - , alloc_(allocator ? allocator : (Allocator*)&defaultAllocator_) - , maxSize_(maxSize) - , top_(type_ == USER_BUF ? reinterpret_cast(userPtr) : alloc_->alloc((std::max)(maxSize, 1))) - , size_(0) - { - if (maxSize_ > 0 && top_ == 0) throw Error(ERR_CANT_ALLOC); - if ((type_ == ALLOC_BUF && alloc_->useProtect()) && !protect(top_, maxSize, true)) { - alloc_->free(top_); - throw Error(ERR_CANT_PROTECT); - } - } - virtual ~CodeArray() - { - if (isAllocType()) { - if (alloc_->useProtect()) protect(top_, maxSize_, false); - alloc_->free(top_); - } - } - void resetSize() - { - size_ = 0; - addrInfoList_.clear(); - } - void db(int code) - { - if (size_ >= maxSize_) { - if (type_ == AUTO_GROW) { - growMemory(); - } else { - throw Error(ERR_CODE_IS_TOO_BIG); - } - } - top_[size_++] = static_cast(code); - } - void db(const uint8 *code, int codeSize) - { - for (int i = 0; i < codeSize; i++) db(code[i]); - } - void db(uint64 code, int codeSize) - { - if (codeSize > 8) throw Error(ERR_BAD_PARAMETER); - for (int i = 0; i < codeSize; i++) db(static_cast(code >> (i * 8))); - } - void dw(uint32 code) { db(code, 2); } - void dd(uint32 code) { db(code, 4); } - void dq(uint64 code) { db(code, 8); } - const uint8 *getCode() const { return top_; } - template - const F getCode() const { return CastTo(top_); } - const uint8 *getCurr() const { return &top_[size_]; } - template - const F getCurr() const { return CastTo(&top_[size_]); } - size_t getSize() const { return size_; } - void setSize(size_t size) - { - if (size > maxSize_) throw Error(ERR_OFFSET_IS_TOO_BIG); - size_ = size; - } - void dump() const - { - const uint8 *p = getCode(); - size_t bufSize = getSize(); - size_t remain = bufSize; - for (int i = 0; i < 4; i++) { - size_t disp = 16; - if (remain < 16) { - disp = remain; - } - for (size_t j = 0; j < 16; j++) { - if (j < disp) { - printf("%02X", p[i * 16 + j]); - } - } - putchar('\n'); - remain -= disp; - if (remain <= 0) { - break; - } - } - } - /* - @param offset [in] offset from top - @param disp [in] offset from the next of jmp - @param size [in] write size(1, 2, 4, 8) - */ - void rewrite(size_t offset, uint64 disp, size_t size) - { - assert(offset < maxSize_); - if (size != 1 && size != 2 && size != 4 && size != 8) throw Error(ERR_BAD_PARAMETER); - uint8 *const data = top_ + offset; - for (size_t i = 0; i < size; i++) { - data[i] = static_cast(disp >> (i * 8)); - } - } - void save(size_t offset, size_t val, int size, inner::LabelMode mode) - { - addrInfoList_.push_back(AddrInfo(offset, val, size, mode)); - } - bool isAutoGrow() const { return type_ == AUTO_GROW; } - /** - change exec permission of memory - @param addr [in] buffer address - @param size [in] buffer size - @param canExec [in] true(enable to exec), false(disable to exec) - @return true(success), false(failure) - */ - static inline bool protect(const void *addr, size_t size, bool canExec) - { -#if defined(_WIN32) - DWORD oldProtect; - return VirtualProtect(const_cast(addr), size, canExec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, &oldProtect) != 0; -#elif defined(__GNUC__) - size_t pageSize = sysconf(_SC_PAGESIZE); - size_t iaddr = reinterpret_cast(addr); - size_t roundAddr = iaddr & ~(pageSize - static_cast(1)); - int mode = PROT_READ | PROT_WRITE | (canExec ? PROT_EXEC : 0); - return mprotect(reinterpret_cast(roundAddr), size + (iaddr - roundAddr), mode) == 0; -#else - return true; -#endif - } - /** - get aligned memory pointer - @param addr [in] address - @param alingedSize [in] power of two - @return aligned addr by alingedSize - */ - static inline uint8 *getAlignedAddress(uint8 *addr, size_t alignedSize = 16) - { - return reinterpret_cast((reinterpret_cast(addr) + alignedSize - 1) & ~(alignedSize - static_cast(1))); - } -}; - -class Address : public Operand { - mutable uint8 top_[6]; // 6 = 1(ModRM) + 1(SIB) + 4(disp) - uint8 size_; - uint8 rex_; - uint64 disp_; - const Label* label_; - bool isOnlyDisp_; - bool is64bitDisp_; - bool is32bit_; - mutable bool isVsib_; - bool isYMM_; - void verify() const { if (isVsib_) throw Error(ERR_BAD_VSIB_ADDRESSING); } -public: - Address(uint32 sizeBit, bool isOnlyDisp, uint64 disp, bool is32bit, bool is64bitDisp = false, bool isVsib = false, bool isYMM = false) - : Operand(0, MEM, sizeBit) - , size_(0) - , rex_(0) - , disp_(disp) - , label_(0) - , isOnlyDisp_(isOnlyDisp) - , is64bitDisp_(is64bitDisp) - , is32bit_(is32bit) - , isVsib_(isVsib) - , isYMM_(isYMM) - { - } - void db(int code) - { - if (size_ >= sizeof(top_)) throw Error(ERR_CODE_IS_TOO_BIG); - top_[size_++] = static_cast(code); - } - void dd(uint32 code) { for (int i = 0; i < 4; i++) db(code >> (i * 8)); } - const uint8 *getCode() const { return top_; } - size_t getSize() const { return size_; } - void updateRegField(uint8 regIdx) const - { - *top_ = (*top_ & B11000111) | ((regIdx << 3) & B00111000); - } - void setVsib(bool isVsib) const { isVsib_ = isVsib; } - bool isVsib() const { return isVsib_; } - bool isYMM() const { return isYMM_; } - bool is32bit() const { verify(); return is32bit_; } - bool isOnlyDisp() const { verify(); return isOnlyDisp_; } // for mov eax - uint64 getDisp() const { verify(); return disp_; } - uint8 getRex() const { verify(); return rex_; } - bool is64bitDisp() const { verify(); return is64bitDisp_; } // for moffset - void setRex(uint8 rex) { rex_ = rex; } - void setLabel(const Label* label) { label_ = label; } - const Label* getLabel() const { return label_; } -}; - -class AddressFrame { -private: - void operator=(const AddressFrame&); - Address makeAddress(const RegExp& e) const - { - e.verify(); - const bool isVsib = e.isVsib(); - const bool isYMM = e.isYMM(); - const RegExp::SReg& base = e.getBase(); - const RegExp::SReg& index = e.getIndex(); - const uint32 disp = e.getDisp(); - Address frame(bit_, (!base.bit && !index.bit), disp, base.bit == 32 || index.bit == 32, false, isVsib, isYMM); - enum { - mod00 = 0, mod01 = 1, mod10 = 2 - }; - int mod; - if (!base.bit || ((base.idx & 7) != Operand::EBP && disp == 0)) { - mod = mod00; - } else if (inner::IsInDisp8(disp)) { - mod = mod01; - } else { - mod = mod10; - } - const int baseIdx = base.bit ? (base.idx & 7) : Operand::EBP; - /* ModR/M = [2:3:3] = [Mod:reg/code:R/M] */ - bool hasSIB = index.bit || (base.idx & 7) == Operand::ESP; -#ifdef XBYAK64 - if (!base.bit && !index.bit) hasSIB = true; -#endif - if (hasSIB) { - frame.db((mod << 6) | Operand::ESP); - /* SIB = [2:3:3] = [SS:index:base(=rm)] */ - const int indexIdx = index.bit ? (index.idx & 7) : Operand::ESP; - const int scale = e.getScale(); - const int ss = (scale == 8) ? 3 : (scale == 4) ? 2 : (scale == 2) ? 1 : 0; - frame.db((ss << 6) | (indexIdx << 3) | baseIdx); - } else { - frame.db((mod << 6) | baseIdx); - } - if (mod == mod01) { - frame.db(disp); - } else if (mod == mod10 || (mod == mod00 && !base.bit)) { - frame.dd(disp); - } - int rex = ((index.idx >> 3) << 1) | (base.idx >> 3); - if (rex) rex |= 0x40; - frame.setRex(uint8(rex)); - return frame; - } -public: - const uint32 bit_; - explicit AddressFrame(uint32 bit) : bit_(bit) { } - Address operator[](const void *disp) const - { - size_t adr = reinterpret_cast(disp); -#ifdef XBYAK64 - if (adr > 0xFFFFFFFFU) throw Error(ERR_OFFSET_IS_TOO_BIG); -#endif - RegExp e(static_cast(adr)); - return operator[](e); - } -#ifdef XBYAK64 - Address operator[](uint64 disp) const - { - return Address(64, true, disp, false, true); - } - Address operator[](const RegRip& addr) const - { - Address frame(bit_, true, addr.disp_, false); - frame.db(0x05); - if (addr.label_) { - frame.setLabel(addr.label_); - } else { - frame.dd(inner::VerifyInInt32(addr.disp_)); - } - return frame; - } -#endif - Address operator[](const RegExp& e) const - { - return makeAddress(e.optimize()); - } -}; - -struct JmpLabel { - size_t endOfJmp; /* offset from top to the end address of jmp */ - int jmpSize; - inner::LabelMode mode; - uint64 disp; // disp for [rip + disp] - explicit JmpLabel(size_t endOfJmp = 0, int jmpSize = 0, inner::LabelMode mode = inner::LasIs, uint64 disp = 0) - : endOfJmp(endOfJmp), jmpSize(jmpSize), mode(mode), disp(disp) - { - } -}; - -class LabelManager; - -class Label { - mutable LabelManager *mgr; - mutable int id; - friend class LabelManager; -public: - Label() : mgr(0), id(0) {} - Label(const Label& rhs); - Label& operator=(const Label& rhs); - ~Label(); - int getId() const { return id; } - - // backward compatibility - static std::string toStr(int num) - { - char buf[16]; -#ifdef _MSC_VER - _snprintf_s -#else - snprintf -#endif - (buf, sizeof(buf), ".%08x", num); - return buf; - } -}; - -class LabelManager { - // for string label - struct SlabelVal { - size_t offset; - SlabelVal(size_t offset) : offset(offset) {} - }; - typedef XBYAK_STD_UNORDERED_MAP SlabelDefList; - typedef XBYAK_STD_UNORDERED_MULTIMAP SlabelUndefList; - struct SlabelState { - SlabelDefList defList; - SlabelUndefList undefList; - }; - typedef std::list StateList; - // for Label class - struct ClabelVal { - ClabelVal(size_t offset = 0) : offset(offset), refCount(1) {} - size_t offset; - int refCount; - }; - typedef XBYAK_STD_UNORDERED_MAP ClabelDefList; - typedef XBYAK_STD_UNORDERED_MULTIMAP ClabelUndefList; - - CodeArray *base_; - // global : stateList_.front(), local : stateList_.back() - StateList stateList_; - mutable int labelId_; - ClabelDefList clabelDefList_; - ClabelUndefList clabelUndefList_; - - int getId(const Label& label) const - { - if (label.id == 0) label.id = labelId_++; - return label.id; - } - template - void define_inner(DefList& defList, UndefList& undefList, const T& labelId, size_t addrOffset) - { - // add label - typename DefList::value_type item(labelId, addrOffset); - std::pair ret = defList.insert(item); - if (!ret.second) throw Error(ERR_LABEL_IS_REDEFINED); - // search undefined label - for (;;) { - typename UndefList::iterator itr = undefList.find(labelId); - if (itr == undefList.end()) break; - const JmpLabel *jmp = &itr->second; - const size_t offset = jmp->endOfJmp - jmp->jmpSize; - size_t disp; - if (jmp->mode == inner::LaddTop) { - disp = addrOffset; - } else if (jmp->mode == inner::Labs) { - disp = size_t(base_->getCurr()); - } else { - disp = addrOffset - jmp->endOfJmp + jmp->disp; -#ifdef XBYAK64 - if (jmp->jmpSize <= 4 && !inner::IsInInt32(disp)) throw Error(ERR_OFFSET_IS_TOO_BIG); -#endif - if (jmp->jmpSize == 1 && !inner::IsInDisp8((uint32)disp)) throw Error(ERR_LABEL_IS_TOO_FAR); - } - if (base_->isAutoGrow()) { - base_->save(offset, disp, jmp->jmpSize, jmp->mode); - } else { - base_->rewrite(offset, disp, jmp->jmpSize); - } - undefList.erase(itr); - } - } - template - bool getOffset_inner(const DefList& defList, size_t *offset, const T& label) const - { - typename DefList::const_iterator i = defList.find(label); - if (i == defList.end()) return false; - *offset = i->second.offset; - return true; - } - friend class Label; - void incRefCount(int id) { clabelDefList_[id].refCount++; } - void decRefCount(int id) - { - ClabelDefList::iterator i = clabelDefList_.find(id); - if (i == clabelDefList_.end()) return; - if (i->second.refCount == 1) { - clabelDefList_.erase(id); - } else { - --i->second.refCount; - } - } - template - bool hasUndefinedLabel_inner(const T& list) const - { -#ifndef NDEBUG - for (typename T::const_iterator i = list.begin(); i != list.end(); ++i) { - std::cerr << "undefined label:" << i->first << std::endl; - } -#endif - return !list.empty(); - } -public: - LabelManager() - { - reset(); - } - void reset() - { - base_ = 0; - labelId_ = 1; - stateList_.clear(); - stateList_.push_back(SlabelState()); - stateList_.push_back(SlabelState()); - } - void enterLocal() - { - stateList_.push_back(SlabelState()); - } - void leaveLocal() - { - if (stateList_.size() <= 2) throw Error(ERR_UNDER_LOCAL_LABEL); - if (hasUndefinedLabel_inner(stateList_.back().undefList)) throw Error(ERR_LABEL_IS_NOT_FOUND); - stateList_.pop_back(); - } - void set(CodeArray *base) { base_ = base; } - void defineSlabel(std::string label) - { - if (label == "@b" || label == "@f") throw Error(ERR_BAD_LABEL_STR); - if (label == "@@") { - SlabelDefList& defList = stateList_.front().defList; - SlabelDefList::iterator i = defList.find("@f"); - if (i != defList.end()) { - defList.erase(i); - label = "@b"; - } else { - i = defList.find("@b"); - if (i != defList.end()) { - defList.erase(i); - } - label = "@f"; - } - } - SlabelState& st = *label.c_str() == '.' ? stateList_.back() : stateList_.front(); - define_inner(st.defList, st.undefList, label, base_->getSize()); - } - void defineClabel(const Label& label) - { - define_inner(clabelDefList_, clabelUndefList_, getId(label), base_->getSize()); - label.mgr = this; - } - void assign(Label& dst, const Label& src) - { - ClabelDefList::const_iterator i = clabelDefList_.find(src.id); - if (i == clabelDefList_.end()) throw Error(ERR_LABEL_ISNOT_SET_BY_L); - define_inner(clabelDefList_, clabelUndefList_, dst.id, i->second.offset); - dst.mgr = this; - } - bool getOffset(size_t *offset, std::string& label) const - { - const SlabelDefList& defList = stateList_.front().defList; - if (label == "@b") { - if (defList.find("@f") != defList.end()) { - label = "@f"; - } else if (defList.find("@b") == defList.end()) { - throw Error(ERR_LABEL_IS_NOT_FOUND); - } - } else if (label == "@f") { - if (defList.find("@f") != defList.end()) { - label = "@b"; - } - } - const SlabelState& st = *label.c_str() == '.' ? stateList_.back() : stateList_.front(); - return getOffset_inner(st.defList, offset, label); - } - bool getOffset(size_t *offset, const Label& label) const - { - return getOffset_inner(clabelDefList_, offset, getId(label)); - } - void addUndefinedLabel(const std::string& label, const JmpLabel& jmp) - { - SlabelState& st = *label.c_str() == '.' ? stateList_.back() : stateList_.front(); - st.undefList.insert(SlabelUndefList::value_type(label, jmp)); - } - void addUndefinedLabel(const Label& label, const JmpLabel& jmp) - { - clabelUndefList_.insert(ClabelUndefList::value_type(label.id, jmp)); - } - bool hasUndefSlabel() const - { - for (StateList::const_iterator i = stateList_.begin(), ie = stateList_.end(); i != ie; ++i) { - if (hasUndefinedLabel_inner(i->undefList)) return true; - } - return false; - } - bool hasUndefClabel() const { return hasUndefinedLabel_inner(clabelUndefList_); } -}; - -inline Label::Label(const Label& rhs) -{ - id = rhs.id; - mgr = rhs.mgr; - if (mgr) mgr->incRefCount(id); -} -inline Label& Label::operator=(const Label& rhs) -{ - if (id) throw Error(ERR_LABEL_IS_ALREADY_SET_BY_L); - id = rhs.id; - mgr = rhs.mgr; - if (mgr) mgr->incRefCount(id); - return *this; -} -inline Label::~Label() -{ - if (id && mgr) mgr->decRefCount(id); -} - -class CodeGenerator : public CodeArray { -public: - enum LabelType { - T_SHORT, - T_NEAR, - T_AUTO // T_SHORT if possible - }; -private: - CodeGenerator operator=(const CodeGenerator&); // don't call -#ifdef XBYAK64 - enum { i32e = 32 | 64, BIT = 64 }; - static const size_t dummyAddr = (size_t(0x11223344) << 32) | 55667788; - typedef Reg64 NativeReg; -#else - enum { i32e = 32, BIT = 32 }; - static const size_t dummyAddr = 0x12345678; - typedef Reg32 NativeReg; -#endif - // (XMM, XMM|MEM) - static inline bool isXMM_XMMorMEM(const Operand& op1, const Operand& op2) - { - return op1.isXMM() && (op2.isXMM() || op2.isMEM()); - } - // (MMX, MMX|MEM) or (XMM, XMM|MEM) - static inline bool isXMMorMMX_MEM(const Operand& op1, const Operand& op2) - { - return (op1.isMMX() && (op2.isMMX() || op2.isMEM())) || isXMM_XMMorMEM(op1, op2); - } - // (XMM, MMX|MEM) - static inline bool isXMM_MMXorMEM(const Operand& op1, const Operand& op2) - { - return op1.isXMM() && (op2.isMMX() || op2.isMEM()); - } - // (MMX, XMM|MEM) - static inline bool isMMX_XMMorMEM(const Operand& op1, const Operand& op2) - { - return op1.isMMX() && (op2.isXMM() || op2.isMEM()); - } - // (XMM, REG32|MEM) - static inline bool isXMM_REG32orMEM(const Operand& op1, const Operand& op2) - { - return op1.isXMM() && (op2.isREG(i32e) || op2.isMEM()); - } - // (REG32, XMM|MEM) - static inline bool isREG32_XMMorMEM(const Operand& op1, const Operand& op2) - { - return op1.isREG(i32e) && (op2.isXMM() || op2.isMEM()); - } - // (REG32, REG32|MEM) - static inline bool isREG32_REG32orMEM(const Operand& op1, const Operand& op2) - { - return op1.isREG(i32e) && ((op2.isREG(i32e) && op1.getBit() == op2.getBit()) || op2.isMEM()); - } - void rex(const Operand& op1, const Operand& op2 = Operand()) - { - uint8 rex = 0; - const Operand *p1 = &op1, *p2 = &op2; - if (p1->isMEM()) std::swap(p1, p2); - if (p1->isMEM()) throw Error(ERR_BAD_COMBINATION); - if (p2->isMEM()) { - const Address& addr = static_cast(*p2); - if (BIT == 64 && addr.is32bit()) db(0x67); - rex = addr.getRex() | static_cast(*p1).getRex(); - } else { - // ModRM(reg, base); - rex = static_cast(op2).getRex(static_cast(op1)); - } - // except movsx(16bit, 32/64bit) - if ((op1.isBit(16) && !op2.isBit(i32e)) || (op2.isBit(16) && !op1.isBit(i32e))) db(0x66); - if (rex) db(rex); - } - enum AVXtype { - PP_NONE = 1 << 0, - PP_66 = 1 << 1, - PP_F3 = 1 << 2, - PP_F2 = 1 << 3, - MM_RESERVED = 1 << 4, - MM_0F = 1 << 5, - MM_0F38 = 1 << 6, - MM_0F3A = 1 << 7 - }; - void vex(bool r, int idx, bool is256, int type, bool x = false, bool b = false, int w = 1) - { - uint32 pp = (type & PP_66) ? 1 : (type & PP_F3) ? 2 : (type & PP_F2) ? 3 : 0; - uint32 vvvv = (((~idx) & 15) << 3) | (is256 ? 4 : 0) | pp; - if (!b && !x && !w && (type & MM_0F)) { - db(0xC5); db((r ? 0 : 0x80) | vvvv); - } else { - uint32 mmmm = (type & MM_0F) ? 1 : (type & MM_0F38) ? 2 : (type & MM_0F3A) ? 3 : 0; - db(0xC4); db((r ? 0 : 0x80) | (x ? 0 : 0x40) | (b ? 0 : 0x20) | mmmm); db((w << 7) | vvvv); - } - } - LabelManager labelMgr_; - bool isInDisp16(uint32 x) const { return 0xFFFF8000 <= x || x <= 0x7FFF; } - uint8 getModRM(int mod, int r1, int r2) const { return static_cast((mod << 6) | ((r1 & 7) << 3) | (r2 & 7)); } - void opModR(const Reg& reg1, const Reg& reg2, int code0, int code1 = NONE, int code2 = NONE) - { - rex(reg2, reg1); - db(code0 | (reg1.isBit(8) ? 0 : 1)); if (code1 != NONE) db(code1); if (code2 != NONE) db(code2); - db(getModRM(3, reg1.getIdx(), reg2.getIdx())); - } - void opModM(const Address& addr, const Reg& reg, int code0, int code1 = NONE, int code2 = NONE) - { - if (addr.is64bitDisp()) throw Error(ERR_CANT_USE_64BIT_DISP); - rex(addr, reg); - db(code0 | (reg.isBit(8) ? 0 : 1)); if (code1 != NONE) db(code1); if (code2 != NONE) db(code2); - addr.updateRegField(static_cast(reg.getIdx())); - opAddr(addr); - } - void makeJmp(uint32 disp, LabelType type, uint8 shortCode, uint8 longCode, uint8 longPref) - { - const int shortJmpSize = 2; - const int longHeaderSize = longPref ? 2 : 1; - const int longJmpSize = longHeaderSize + 4; - if (type != T_NEAR && inner::IsInDisp8(disp - shortJmpSize)) { - db(shortCode); db(disp - shortJmpSize); - } else { - if (type == T_SHORT) throw Error(ERR_LABEL_IS_TOO_FAR); - if (longPref) db(longPref); - db(longCode); dd(disp - longJmpSize); - } - } - template - void opJmp(T& label, LabelType type, uint8 shortCode, uint8 longCode, uint8 longPref) - { - if (isAutoGrow() && size_ + 16 >= maxSize_) growMemory(); /* avoid splitting code of jmp */ - size_t offset = 0; - if (labelMgr_.getOffset(&offset, label)) { /* label exists */ - makeJmp(inner::VerifyInInt32(offset - size_), type, shortCode, longCode, longPref); - } else { - int jmpSize = 0; - if (type == T_NEAR) { - jmpSize = 4; - if (longPref) db(longPref); - db(longCode); dd(0); - } else { - jmpSize = 1; - db(shortCode); db(0); - } - JmpLabel jmp(size_, jmpSize, inner::LasIs); - labelMgr_.addUndefinedLabel(label, jmp); - } - } - void opJmpAbs(const void *addr, LabelType type, uint8 shortCode, uint8 longCode) - { - if (isAutoGrow()) { - if (type != T_NEAR) throw Error(ERR_ONLY_T_NEAR_IS_SUPPORTED_IN_AUTO_GROW); - if (size_ + 16 >= maxSize_) growMemory(); - db(longCode); - dd(0); - save(size_ - 4, size_t(addr) - size_, 4, inner::Labs); - } else { - makeJmp(inner::VerifyInInt32(reinterpret_cast(addr) - getCurr()), type, shortCode, longCode, 0); - } - - } - void opAddr(const Address &addr) - { - db(addr.getCode(), static_cast(addr.getSize())); - if (addr.getLabel()) { // [rip + Label] - putL_inner(*addr.getLabel(), true, addr.getDisp()); - } - } - /* preCode is for SSSE3/SSE4 */ - void opGen(const Operand& reg, const Operand& op, int code, int pref, bool isValid(const Operand&, const Operand&), int imm8 = NONE, int preCode = NONE) - { - if (isValid && !isValid(reg, op)) throw Error(ERR_BAD_COMBINATION); - if (pref != NONE) db(pref); - if (op.isMEM()) { - opModM(static_cast(op), static_cast(reg), 0x0F, preCode, code); - } else { - opModR(static_cast(reg), static_cast(op), 0x0F, preCode, code); - } - if (imm8 != NONE) db(imm8); - } - void opMMX_IMM(const Mmx& mmx, int imm8, int code, int ext) - { - if (mmx.isXMM()) db(0x66); - opModR(Reg32(ext), mmx, 0x0F, code); - db(imm8); - } - void opMMX(const Mmx& mmx, const Operand& op, int code, int pref = 0x66, int imm8 = NONE, int preCode = NONE) - { - opGen(mmx, op, code, mmx.isXMM() ? pref : NONE, isXMMorMMX_MEM, imm8, preCode); - } - void opMovXMM(const Operand& op1, const Operand& op2, int code, int pref) - { - if (pref != NONE) db(pref); - if (op1.isXMM() && op2.isMEM()) { - opModM(static_cast(op2), static_cast(op1), 0x0F, code); - } else if (op1.isMEM() && op2.isXMM()) { - opModM(static_cast(op1), static_cast(op2), 0x0F, code | 1); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void opExt(const Operand& op, const Mmx& mmx, int code, int imm, bool hasMMX2 = false) - { - if (hasMMX2 && op.isREG(i32e)) { /* pextrw is special */ - if (mmx.isXMM()) db(0x66); - opModR(static_cast(op), mmx, 0x0F, B11000101); db(imm); - } else { - opGen(mmx, op, code, 0x66, isXMM_REG32orMEM, imm, B00111010); - } - } - void opR_ModM(const Operand& op, int bit, int ext, int code0, int code1 = NONE, int code2 = NONE, bool disableRex = false) - { - int opBit = op.getBit(); - if (disableRex && opBit == 64) opBit = 32; - if (op.isREG(bit)) { - opModR(Reg(ext, Operand::REG, opBit), static_cast(op).changeBit(opBit), code0, code1, code2); - } else if (op.isMEM()) { - opModM(static_cast(op), Reg(ext, Operand::REG, opBit), code0, code1, code2); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void opShift(const Operand& op, int imm, int ext) - { - verifyMemHasSize(op); - opR_ModM(op, 0, ext, (B11000000 | ((imm == 1 ? 1 : 0) << 4))); - if (imm != 1) db(imm); - } - void opShift(const Operand& op, const Reg8& cl, int ext) - { - if (cl.getIdx() != Operand::CL) throw Error(ERR_BAD_COMBINATION); - opR_ModM(op, 0, ext, B11010010); - } - void opModRM(const Operand& op1, const Operand& op2, bool condR, bool condM, int code0, int code1 = NONE, int code2 = NONE) - { - if (condR) { - opModR(static_cast(op1), static_cast(op2), code0, code1, code2); - } else if (condM) { - opModM(static_cast(op2), static_cast(op1), code0, code1, code2); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void opShxd(const Operand& op, const Reg& reg, uint8 imm, int code, const Reg8 *cl = 0) - { - if (cl && cl->getIdx() != Operand::CL) throw Error(ERR_BAD_COMBINATION); - opModRM(reg, op, (op.isREG(16 | i32e) && op.getBit() == reg.getBit()), op.isMEM() && (reg.isREG(16 | i32e)), 0x0F, code | (cl ? 1 : 0)); - if (!cl) db(imm); - } - // (REG, REG|MEM), (MEM, REG) - void opRM_RM(const Operand& op1, const Operand& op2, int code) - { - if (op1.isREG() && op2.isMEM()) { - opModM(static_cast(op2), static_cast(op1), code | 2); - } else { - opModRM(op2, op1, op1.isREG() && op1.getKind() == op2.getKind(), op1.isMEM() && op2.isREG(), code); - } - } - // (REG|MEM, IMM) - void opRM_I(const Operand& op, uint32 imm, int code, int ext) - { - verifyMemHasSize(op); - uint32 immBit = inner::IsInDisp8(imm) ? 8 : isInDisp16(imm) ? 16 : 32; - if (op.isBit(8)) immBit = 8; - if (op.getBit() < immBit) throw Error(ERR_IMM_IS_TOO_BIG); - if (op.isBit(32|64) && immBit == 16) immBit = 32; /* don't use MEM16 if 32/64bit mode */ - if (op.isREG() && op.getIdx() == 0 && (op.getBit() == immBit || (op.isBit(64) && immBit == 32))) { // rax, eax, ax, al - rex(op); - db(code | 4 | (immBit == 8 ? 0 : 1)); - } else { - int tmp = immBit < (std::min)(op.getBit(), 32U) ? 2 : 0; - opR_ModM(op, 0, ext, B10000000 | tmp); - } - db(imm, immBit / 8); - } - void opIncDec(const Operand& op, int code, int ext) - { - verifyMemHasSize(op); -#ifndef XBYAK64 - if (op.isREG() && !op.isBit(8)) { - rex(op); db(code | op.getIdx()); - return; - } -#endif - code = B11111110; - if (op.isREG()) { - opModR(Reg(ext, Operand::REG, op.getBit()), static_cast(op), code); - } else { - opModM(static_cast(op), Reg(ext, Operand::REG, op.getBit()), code); - } - } - void opPushPop(const Operand& op, int code, int ext, int alt) - { - if (op.isREG()) { - if (op.isBit(16)) db(0x66); - if (static_cast(op).getIdx() >= 8) db(0x41); - db(alt | (op.getIdx() & 7)); - } else if (op.isMEM()) { - opModM(static_cast(op), Reg(ext, Operand::REG, op.getBit()), code); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void verifyMemHasSize(const Operand& op) const - { - if (op.isMEM() && op.getBit() == 0) throw Error(ERR_MEM_SIZE_IS_NOT_SPECIFIED); - } - void opMovxx(const Reg& reg, const Operand& op, uint8 code) - { - if (op.isBit(32)) throw Error(ERR_BAD_COMBINATION); - int w = op.isBit(16); -#ifdef XBYAK64 - if (op.isHigh8bit()) throw Error(ERR_BAD_COMBINATION); -#endif - bool cond = reg.isREG() && (reg.getBit() > op.getBit()); - opModRM(reg, op, cond && op.isREG(), cond && op.isMEM(), 0x0F, code | w); - } - void opFpuMem(const Address& addr, uint8 m16, uint8 m32, uint8 m64, uint8 ext, uint8 m64ext) - { - if (addr.is64bitDisp()) throw Error(ERR_CANT_USE_64BIT_DISP); - uint8 code = addr.isBit(16) ? m16 : addr.isBit(32) ? m32 : addr.isBit(64) ? m64 : 0; - if (!code) throw Error(ERR_BAD_MEM_SIZE); - if (m64ext && addr.isBit(64)) ext = m64ext; - - rex(addr, st0); - db(code); - addr.updateRegField(ext); - opAddr(addr); - } - // use code1 if reg1 == st0 - // use code2 if reg1 != st0 && reg2 == st0 - void opFpuFpu(const Fpu& reg1, const Fpu& reg2, uint32 code1, uint32 code2) - { - uint32 code = reg1.getIdx() == 0 ? code1 : reg2.getIdx() == 0 ? code2 : 0; - if (!code) throw Error(ERR_BAD_ST_COMBINATION); - db(uint8(code >> 8)); - db(uint8(code | (reg1.getIdx() | reg2.getIdx()))); - } - void opFpu(const Fpu& reg, uint8 code1, uint8 code2) - { - db(code1); db(code2 | reg.getIdx()); - } - void opVex(const Reg& r, const Operand *p1, const Operand *p2, int type, int code, int w) - { - bool x, b; - if (p2->isMEM()) { - const Address& addr = static_cast(*p2); - uint8 rex = addr.getRex(); - x = (rex & 2) != 0; - b = (rex & 1) != 0; - if (BIT == 64 && addr.is32bit()) db(0x67); - if (BIT == 64 && w == -1) w = (rex & 4) ? 1 : 0; - } else { - x = false; - b = static_cast(*p2).isExtIdx(); - } - if (w == -1) w = 0; - vex(r.isExtIdx(), p1 ? p1->getIdx() : 0, r.isYMM(), type, x, b, w); - db(code); - if (p2->isMEM()) { - const Address& addr = static_cast(*p2); - addr.updateRegField(static_cast(r.getIdx())); - opAddr(addr); - } else { - db(getModRM(3, r.getIdx(), p2->getIdx())); - } - } - // (r, r, r/m) if isR_R_RM - // (r, r/m, r) - void opGpr(const Reg32e& r, const Operand& op1, const Operand& op2, int type, uint8 code, bool isR_R_RM) - { - const Operand *p1 = &op1; - const Operand *p2 = &op2; - if (!isR_R_RM) std::swap(p1, p2); - const unsigned int bit = r.getBit(); - if (p1->getBit() != bit || (p2->isREG() && p2->getBit() != bit)) throw Error(ERR_BAD_COMBINATION); - int w = bit == 64; - opVex(r, p1, p2, type, code, w); - } - void opAVX_X_X_XM(const Xmm& x1, const Operand& op1, const Operand& op2, int type, int code0, bool supportYMM, int w = -1) - { - const Xmm *x2; - const Operand *op; - if (op2.isNone()) { - x2 = &x1; - op = &op1; - } else { - if (!(op1.isXMM() || (supportYMM && op1.isYMM()))) throw Error(ERR_BAD_COMBINATION); - x2 = static_cast(&op1); - op = &op2; - } - // (x1, x2, op) - if (!((x1.isXMM() && x2->isXMM()) || (supportYMM && x1.isYMM() && x2->isYMM()))) throw Error(ERR_BAD_COMBINATION); - opVex(x1, x2, op, type, code0, w); - } - // if cvt then return pointer to Xmm(idx) (or Ymm(idx)), otherwise return op - void opAVX_X_X_XMcvt(const Xmm& x1, const Operand& op1, const Operand& op2, bool cvt, Operand::Kind kind, int type, int code0, bool supportYMM, int w = -1) - { - // use static_cast to avoid calling unintentional copy constructor on gcc - opAVX_X_X_XM(x1, op1, cvt ? kind == Operand::XMM ? static_cast(Xmm(op2.getIdx())) : static_cast(Ymm(op2.getIdx())) : op2, type, code0, supportYMM, w); - } - // support (x, x/m, imm), (y, y/m, imm) - void opAVX_X_XM_IMM(const Xmm& x, const Operand& op, int type, int code, bool supportYMM, int w = -1, int imm = NONE) - { - opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, op, type, code, supportYMM, w); if (imm != NONE) db((uint8)imm); - } - // QQQ:need to refactor - void opSp1(const Reg& reg, const Operand& op, uint8 pref, uint8 code0, uint8 code1) - { - if (reg.isBit(8)) throw Error(ERR_BAD_SIZE_OF_REGISTER); - bool is16bit = reg.isREG(16) && (op.isREG(16) || op.isMEM()); - if (!is16bit && !(reg.isREG(i32e) && (op.isREG(reg.getBit()) || op.isMEM()))) throw Error(ERR_BAD_COMBINATION); - if (is16bit) db(0x66); - db(pref); opModRM(reg.changeBit(i32e == 32 ? 32 : reg.getBit()), op, op.isREG(), true, code0, code1); - } - void opGather(const Xmm& x1, const Address& addr, const Xmm& x2, int type, uint8 code, int w, int mode) - { - if (!addr.isVsib()) throw Error(ERR_BAD_VSIB_ADDRESSING); - const int y_vx_y = 0; - const int y_vy_y = 1; -// const int x_vy_x = 2; - const bool isAddrYMM = addr.isYMM(); - if (!x1.isXMM() || isAddrYMM || !x2.isXMM()) { - bool isOK = false; - if (mode == y_vx_y) { - isOK = x1.isYMM() && !isAddrYMM && x2.isYMM(); - } else if (mode == y_vy_y) { - isOK = x1.isYMM() && isAddrYMM && x2.isYMM(); - } else { // x_vy_x - isOK = !x1.isYMM() && isAddrYMM && !x2.isYMM(); - } - if (!isOK) throw Error(ERR_BAD_VSIB_ADDRESSING); - } - addr.setVsib(false); - opAVX_X_X_XM(isAddrYMM ? Ymm(x1.getIdx()) : x1, isAddrYMM ? Ymm(x2.getIdx()) : x2, addr, type, code, true, w); - addr.setVsib(true); - } -public: - unsigned int getVersion() const { return VERSION; } - using CodeArray::db; - const Mmx mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7; - const Xmm xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; - const Ymm ymm0, ymm1, ymm2, ymm3, ymm4, ymm5, ymm6, ymm7; - const Xmm &xm0, &xm1, &xm2, &xm3, &xm4, &xm5, &xm6, &xm7; - const Ymm &ym0, &ym1, &ym2, &ym3, &ym4, &ym5, &ym6, &ym7; - const Reg32 eax, ecx, edx, ebx, esp, ebp, esi, edi; - const Reg16 ax, cx, dx, bx, sp, bp, si, di; - const Reg8 al, cl, dl, bl, ah, ch, dh, bh; - const AddressFrame ptr, byte, word, dword, qword; - const Fpu st0, st1, st2, st3, st4, st5, st6, st7; -#ifdef XBYAK64 - const Reg64 rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15; - const Reg32 r8d, r9d, r10d, r11d, r12d, r13d, r14d, r15d; - const Reg16 r8w, r9w, r10w, r11w, r12w, r13w, r14w, r15w; - const Reg8 r8b, r9b, r10b, r11b, r12b, r13b, r14b, r15b; - const Reg8 spl, bpl, sil, dil; - const Xmm xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15; - const Ymm ymm8, ymm9, ymm10, ymm11, ymm12, ymm13, ymm14, ymm15; - const Xmm &xm8, &xm9, &xm10, &xm11, &xm12, &xm13, &xm14, &xm15; // for my convenience - const Ymm &ym8, &ym9, &ym10, &ym11, &ym12, &ym13, &ym14, &ym15; - const RegRip rip; -#endif - void L(const std::string& label) { labelMgr_.defineSlabel(label); } - void L(const Label& label) { labelMgr_.defineClabel(label); } - /* - assign src to dst - require - dst : does not used by L() - src : used by L() - */ - void assignL(Label& dst, const Label& src) { labelMgr_.assign(dst, src); } - void inLocalLabel() { labelMgr_.enterLocal(); } - void outLocalLabel() { labelMgr_.leaveLocal(); } - void jmp(std::string label, LabelType type = T_AUTO) - { - opJmp(label, type, B11101011, B11101001, 0); - } - void jmp(const Label& label, LabelType type = T_AUTO) - { - opJmp(label, type, B11101011, B11101001, 0); - } - void jmp(const char *label, LabelType type = T_AUTO) { jmp(std::string(label), type); } - void jmp(const void *addr, LabelType type = T_AUTO) - { - opJmpAbs(addr, type, B11101011, B11101001); - } - void jmp(const Operand& op) - { - opR_ModM(op, BIT, 4, 0xFF, NONE, NONE, true); - } - void call(const Operand& op) - { - opR_ModM(op, 16 | i32e, 2, 0xFF, NONE, NONE, true); - } - // (REG|MEM, REG) - void test(const Operand& op, const Reg& reg) - { - opModRM(reg, op, op.isREG() && (op.getKind() == reg.getKind()), op.isMEM(), B10000100); - } - // (REG|MEM, IMM) - void test(const Operand& op, uint32 imm) - { - verifyMemHasSize(op); - if (op.isREG() && op.getIdx() == 0) { // al, ax, eax - rex(op); - db(B10101000 | (op.isBit(8) ? 0 : 1)); - } else { - opR_ModM(op, 0, 0, B11110110); - } - db(imm, (std::min)(op.getBit() / 8, 4U)); - } - void ret(int imm = 0) - { - if (imm) { - db(B11000010); dw(imm); - } else { - db(B11000011); - } - } - // (REG16|REG32, REG16|REG32|MEM) - void imul(const Reg& reg, const Operand& op) - { - opModRM(reg, op, op.isREG() && (reg.getKind() == op.getKind()), op.isMEM(), 0x0F, B10101111); - } - void imul(const Reg& reg, const Operand& op, int imm) - { - int s = inner::IsInDisp8(imm) ? 1 : 0; - opModRM(reg, op, op.isREG() && (reg.getKind() == op.getKind()), op.isMEM(), B01101001 | (s << 1)); - int size = s ? 1 : reg.isREG(16) ? 2 : 4; - db(imm, size); - } - void pop(const Operand& op) - { - opPushPop(op, B10001111, 0, B01011000); - } - void push(const Operand& op) - { - opPushPop(op, B11111111, 6, B01010000); - } - void push(const AddressFrame& af, uint32 imm) - { - if (af.bit_ == 8 && inner::IsInDisp8(imm)) { - db(B01101010); db(imm); - } else if (af.bit_ == 16 && isInDisp16(imm)) { - db(0x66); db(B01101000); dw(imm); - } else { - db(B01101000); dd(imm); - } - } - /* use "push(word, 4)" if you want "push word 4" */ - void push(uint32 imm) - { - if (inner::IsInDisp8(imm)) { - push(byte, imm); - } else { - push(dword, imm); - } - } - void bswap(const Reg32e& reg) - { - opModR(Reg32(1), reg, 0x0F); - } - void mov(const Operand& reg1, const Operand& reg2) - { - const Reg *reg = 0; - const Address *addr = 0; - uint8 code = 0; - if (reg1.isREG() && reg1.getIdx() == 0 && reg2.isMEM()) { // mov eax|ax|al, [disp] - reg = &static_cast(reg1); - addr= &static_cast(reg2); - code = B10100000; - } else - if (reg1.isMEM() && reg2.isREG() && reg2.getIdx() == 0) { // mov [disp], eax|ax|al - reg = &static_cast(reg2); - addr= &static_cast(reg1); - code = B10100010; - } -#ifdef XBYAK64 - if (addr && addr->is64bitDisp()) { - if (code) { - rex(*reg); - db(reg1.isREG(8) ? 0xA0 : reg1.isREG() ? 0xA1 : reg2.isREG(8) ? 0xA2 : 0xA3); - db(addr->getDisp(), 8); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } else -#else - if (code && addr->isOnlyDisp()) { - rex(*reg, *addr); - db(code | (reg->isBit(8) ? 0 : 1)); - dd(static_cast(addr->getDisp())); - } else -#endif - { - opRM_RM(reg1, reg2, B10001000); - } - } -private: - /* - mov(r, imm) = db(imm, mov_imm(r, imm)) - */ - int mov_imm(const Reg& reg, size_t imm) - { - int bit = reg.getBit(); - const int idx = reg.getIdx(); - int code = B10110000 | ((bit == 8 ? 0 : 1) << 3); - if (bit == 64 && (imm & ~size_t(0xffffffffu)) == 0) { - rex(Reg32(idx)); - bit = 32; - } else { - rex(reg); - if (bit == 64 && inner::IsInInt32(imm)) { - db(B11000111); - code = B11000000; - bit = 32; - } - } - db(code | (idx & 7)); - return bit / 8; - } - template - void putL_inner(T& label, bool relative = false, uint64 disp = 0) - { - const int jmpSize = relative ? 4 : (int)sizeof(size_t); - if (isAutoGrow() && size_ + 16 >= maxSize_) growMemory(); - size_t offset = 0; - if (labelMgr_.getOffset(&offset, label)) { - if (relative) { - db(inner::VerifyInInt32(offset + disp - size_ - jmpSize), jmpSize); - } else if (isAutoGrow()) { - db(uint64(0), jmpSize); - save(size_ - jmpSize, offset, jmpSize, inner::LaddTop); - } else { - db(size_t(top_) + offset, jmpSize); - } - return; - } - db(uint64(0), jmpSize); - JmpLabel jmp(size_, jmpSize, (relative ? inner::LasIs : isAutoGrow() ? inner::LaddTop : inner::Labs), disp); - labelMgr_.addUndefinedLabel(label, jmp); - } -public: - void mov(const Operand& op, size_t imm) - { - verifyMemHasSize(op); - if (op.isREG()) { - const int size = mov_imm(static_cast(op), imm); - db(imm, size); - } else if (op.isMEM()) { - opModM(static_cast(op), Reg(0, Operand::REG, op.getBit()), B11000110); - int size = op.getBit() / 8; if (size > 4) size = 4; - db(static_cast(imm), size); - } else { - throw Error(ERR_BAD_COMBINATION); - } - } - void mov(const NativeReg& reg, const char *label) // can't use std::string - { - if (label == 0) { - mov(static_cast(reg), 0); // call imm - return; - } - mov_imm(reg, dummyAddr); - putL(label); - } - void mov(const NativeReg& reg, const Label& label) - { - mov_imm(reg, dummyAddr); - putL(label); - } - /* - put address of label to buffer - @note the put size is 4(32-bit), 8(64-bit) - */ - void putL(std::string label) { putL_inner(label); } - void putL(const Label& label) { putL_inner(label); } - void adcx(const Reg32e& reg, const Operand& op) { opGen(reg, op, 0xF6, 0x66, isREG32_REG32orMEM, NONE, 0x38); } - void adox(const Reg32e& reg, const Operand& op) { opGen(reg, op, 0xF6, 0xF3, isREG32_REG32orMEM, NONE, 0x38); } - void cmpxchg8b(const Address& addr) { opModM(addr, Reg32(1), 0x0F, B11000111); } -#ifdef XBYAK64 - void cmpxchg16b(const Address& addr) { opModM(addr, Reg64(1), 0x0F, B11000111); } -#endif - void xadd(const Operand& op, const Reg& reg) - { - opModRM(reg, op, (op.isREG() && reg.isREG() && op.getBit() == reg.getBit()), op.isMEM(), 0x0F, B11000000 | (reg.isBit(8) ? 0 : 1)); - } - void cmpxchg(const Operand& op, const Reg& reg) - { - opModRM(reg, op, (op.isREG() && reg.isREG() && op.getBit() == reg.getBit()), op.isMEM(), 0x0F, 0xb0 | (reg.isBit(8) ? 0 : 1)); - } - void xchg(const Operand& op1, const Operand& op2) - { - const Operand *p1 = &op1, *p2 = &op2; - if (p1->isMEM() || (p2->isREG(16 | i32e) && p2->getIdx() == 0)) { - p1 = &op2; p2 = &op1; - } - if (p1->isMEM()) throw Error(ERR_BAD_COMBINATION); - if (p2->isREG() && (p1->isREG(16 | i32e) && p1->getIdx() == 0) -#ifdef XBYAK64 - && (p2->getIdx() != 0 || !p1->isREG(32)) -#endif - ) { - rex(*p2, *p1); db(0x90 | (p2->getIdx() & 7)); - return; - } - opModRM(*p1, *p2, (p1->isREG() && p2->isREG() && (p1->getBit() == p2->getBit())), p2->isMEM(), B10000110 | (p1->isBit(8) ? 0 : 1)); - } - void call(std::string label) { opJmp(label, T_NEAR, 0, B11101000, 0); } - // call(string label) - void call(const char *label) { call(std::string(label)); } - void call(const Label& label) { opJmp(label, T_NEAR, 0, B11101000, 0); } - // call(function pointer) - void call(const void *addr) { opJmpAbs(addr, T_NEAR, 0, B11101000); } - // special case - void movd(const Address& addr, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModM(addr, mmx, 0x0F, B01111110); - } - void movd(const Reg32& reg, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModR(mmx, reg, 0x0F, B01111110); - } - void movd(const Mmx& mmx, const Address& addr) - { - if (mmx.isXMM()) db(0x66); - opModM(addr, mmx, 0x0F, B01101110); - } - void movd(const Mmx& mmx, const Reg32& reg) - { - if (mmx.isXMM()) db(0x66); - opModR(mmx, reg, 0x0F, B01101110); - } - void movq2dq(const Xmm& xmm, const Mmx& mmx) - { - db(0xF3); opModR(xmm, mmx, 0x0F, B11010110); - } - void movdq2q(const Mmx& mmx, const Xmm& xmm) - { - db(0xF2); opModR(mmx, xmm, 0x0F, B11010110); - } - void movq(const Mmx& mmx, const Operand& op) - { - if (mmx.isXMM()) db(0xF3); - opModRM(mmx, op, (mmx.getKind() == op.getKind()), op.isMEM(), 0x0F, mmx.isXMM() ? B01111110 : B01101111); - } - void movq(const Address& addr, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModM(addr, mmx, 0x0F, mmx.isXMM() ? B11010110 : B01111111); - } -#ifdef XBYAK64 - void movq(const Reg64& reg, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModR(mmx, reg, 0x0F, B01111110); - } - void movq(const Mmx& mmx, const Reg64& reg) - { - if (mmx.isXMM()) db(0x66); - opModR(mmx, reg, 0x0F, B01101110); - } - void pextrq(const Operand& op, const Xmm& xmm, uint8 imm) - { - if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); - opGen(Reg64(xmm.getIdx()), op, 0x16, 0x66, 0, imm, B00111010); // force to 64bit - } - void pinsrq(const Xmm& xmm, const Operand& op, uint8 imm) - { - if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); - opGen(Reg64(xmm.getIdx()), op, 0x22, 0x66, 0, imm, B00111010); // force to 64bit - } - void movsxd(const Reg64& reg, const Operand& op) - { - if (!op.isBit(32)) throw Error(ERR_BAD_COMBINATION); - opModRM(reg, op, op.isREG(), op.isMEM(), 0x63); - } -#endif - // MMX2 : pextrw : reg, mmx/xmm, imm - // SSE4 : pextrw, pextrb, pextrd, extractps : reg/mem, mmx/xmm, imm - void pextrw(const Operand& op, const Mmx& xmm, uint8 imm) { opExt(op, xmm, 0x15, imm, true); } - void pextrb(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x14, imm); } - void pextrd(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x16, imm); } - void extractps(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x17, imm); } - void pinsrw(const Mmx& mmx, const Operand& op, int imm) - { - if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); - opGen(mmx, op, B11000100, mmx.isXMM() ? 0x66 : NONE, 0, imm); - } - void insertps(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x21, 0x66, isXMM_XMMorMEM, imm, B00111010); } - void pinsrb(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x20, 0x66, isXMM_REG32orMEM, imm, B00111010); } - void pinsrd(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x22, 0x66, isXMM_REG32orMEM, imm, B00111010); } - - void pmovmskb(const Reg32e& reg, const Mmx& mmx) - { - if (mmx.isXMM()) db(0x66); - opModR(reg, mmx, 0x0F, B11010111); - } - void maskmovq(const Mmx& reg1, const Mmx& reg2) - { - if (!reg1.isMMX() || !reg2.isMMX()) throw Error(ERR_BAD_COMBINATION); - opModR(reg1, reg2, 0x0F, B11110111); - } - void lea(const Reg32e& reg, const Address& addr) { opModM(addr, reg, B10001101); } - - void movmskps(const Reg32e& reg, const Xmm& xmm) { opModR(reg, xmm, 0x0F, B01010000); } - void movmskpd(const Reg32e& reg, const Xmm& xmm) { db(0x66); movmskps(reg, xmm); } - void movntps(const Address& addr, const Xmm& xmm) { opModM(addr, Mmx(xmm.getIdx()), 0x0F, B00101011); } - void movntdqa(const Xmm& xmm, const Address& addr) { db(0x66); opModM(addr, xmm, 0x0F, 0x38, 0x2A); } - void lddqu(const Xmm& xmm, const Address& addr) { db(0xF2); opModM(addr, xmm, 0x0F, B11110000); } - void movnti(const Address& addr, const Reg32e& reg) { opModM(addr, reg, 0x0F, B11000011); } - void movntq(const Address& addr, const Mmx& mmx) - { - if (!mmx.isMMX()) throw Error(ERR_BAD_COMBINATION); - opModM(addr, mmx, 0x0F, B11100111); - } - void crc32(const Reg32e& reg, const Operand& op) - { - if (reg.isBit(32) && op.isBit(16)) db(0x66); - db(0xF2); - opModRM(reg, op, op.isREG(), op.isMEM(), 0x0F, 0x38, 0xF0 | (op.isBit(8) ? 0 : 1)); - } - void rdrand(const Reg& r) { if (r.isBit(8)) throw Error(ERR_BAD_SIZE_OF_REGISTER); opModR(Reg(6, Operand::REG, r.getBit()), r, 0x0f, 0xc7); } - void rdseed(const Reg& r) { if (r.isBit(8)) throw Error(ERR_BAD_SIZE_OF_REGISTER); opModR(Reg(7, Operand::REG, r.getBit()), r, 0x0f, 0xc7); } - void rorx(const Reg32e& r, const Operand& op, uint8 imm) { opGpr(r, op, Reg32e(0, r.getBit()), MM_0F3A | PP_F2, 0xF0, false); db(imm); } - enum { NONE = 256 }; - CodeGenerator(size_t maxSize = DEFAULT_MAX_CODE_SIZE, void *userPtr = 0, Allocator *allocator = 0) - : CodeArray(maxSize, userPtr, allocator) - , mm0(0), mm1(1), mm2(2), mm3(3), mm4(4), mm5(5), mm6(6), mm7(7) - , xmm0(0), xmm1(1), xmm2(2), xmm3(3), xmm4(4), xmm5(5), xmm6(6), xmm7(7) - , ymm0(0), ymm1(1), ymm2(2), ymm3(3), ymm4(4), ymm5(5), ymm6(6), ymm7(7) - , xm0(xmm0), xm1(xmm1), xm2(xmm2), xm3(xmm3), xm4(xmm4), xm5(xmm5), xm6(xmm6), xm7(xmm7) // for my convenience - , ym0(ymm0), ym1(ymm1), ym2(ymm2), ym3(ymm3), ym4(ymm4), ym5(ymm5), ym6(ymm6), ym7(ymm7) // for my convenience - , eax(Operand::EAX), ecx(Operand::ECX), edx(Operand::EDX), ebx(Operand::EBX), esp(Operand::ESP), ebp(Operand::EBP), esi(Operand::ESI), edi(Operand::EDI) - , ax(Operand::AX), cx(Operand::CX), dx(Operand::DX), bx(Operand::BX), sp(Operand::SP), bp(Operand::BP), si(Operand::SI), di(Operand::DI) - , al(Operand::AL), cl(Operand::CL), dl(Operand::DL), bl(Operand::BL), ah(Operand::AH), ch(Operand::CH), dh(Operand::DH), bh(Operand::BH) - , ptr(0), byte(8), word(16), dword(32), qword(64) - , st0(0), st1(1), st2(2), st3(3), st4(4), st5(5), st6(6), st7(7) -#ifdef XBYAK64 - , rax(Operand::RAX), rcx(Operand::RCX), rdx(Operand::RDX), rbx(Operand::RBX), rsp(Operand::RSP), rbp(Operand::RBP), rsi(Operand::RSI), rdi(Operand::RDI), r8(Operand::R8), r9(Operand::R9), r10(Operand::R10), r11(Operand::R11), r12(Operand::R12), r13(Operand::R13), r14(Operand::R14), r15(Operand::R15) - , r8d(Operand::R8D), r9d(Operand::R9D), r10d(Operand::R10D), r11d(Operand::R11D), r12d(Operand::R12D), r13d(Operand::R13D), r14d(Operand::R14D), r15d(Operand::R15D) - , r8w(Operand::R8W), r9w(Operand::R9W), r10w(Operand::R10W), r11w(Operand::R11W), r12w(Operand::R12W), r13w(Operand::R13W), r14w(Operand::R14W), r15w(Operand::R15W) - , r8b(Operand::R8B), r9b(Operand::R9B), r10b(Operand::R10B), r11b(Operand::R11B), r12b(Operand::R12B), r13b(Operand::R13B), r14b(Operand::R14B), r15b(Operand::R15B) - , spl(Operand::SPL, true), bpl(Operand::BPL, true), sil(Operand::SIL, true), dil(Operand::DIL, true) - , xmm8(8), xmm9(9), xmm10(10), xmm11(11), xmm12(12), xmm13(13), xmm14(14), xmm15(15) - , ymm8(8), ymm9(9), ymm10(10), ymm11(11), ymm12(12), ymm13(13), ymm14(14), ymm15(15) - , xm8(xmm8), xm9(xmm9), xm10(xmm10), xm11(xmm11), xm12(xmm12), xm13(xmm13), xm14(xmm14), xm15(xmm15) // for my convenience - , ym8(ymm8), ym9(ymm9), ym10(ymm10), ym11(ymm11), ym12(ymm12), ym13(ymm13), ym14(ymm14), ym15(ymm15) // for my convenience - , rip() -#endif - { - labelMgr_.set(this); - } - void reset() - { - resetSize(); - labelMgr_.reset(); - labelMgr_.set(this); - } - bool hasUndefinedLabel() const { return labelMgr_.hasUndefSlabel() || labelMgr_.hasUndefClabel(); } - /* - call ready() to complete generating code on AutoGrow - */ - void ready() - { - if (hasUndefinedLabel()) throw Error(ERR_LABEL_IS_NOT_FOUND); - calcJmpAddress(); - } -#ifdef XBYAK_TEST - void dump(bool doClear = true) - { - CodeArray::dump(); - if (doClear) size_ = 0; - } -#endif - -#ifndef XBYAK_DONT_READ_LIST -#include "xbyak_mnemonic.h" - void align(int x = 16) - { - if (x == 1) return; - if (x < 1 || (x & (x - 1))) throw Error(ERR_BAD_ALIGN); - if (isAutoGrow() && x > (int)inner::ALIGN_PAGE_SIZE) fprintf(stderr, "warning:autoGrow mode does not support %d align\n", x); - while (size_t(getCurr()) % x) { - nop(); - } - } -#endif -}; - -namespace util { -static const Mmx mm0(0), mm1(1), mm2(2), mm3(3), mm4(4), mm5(5), mm6(6), mm7(7); -static const Xmm xmm0(0), xmm1(1), xmm2(2), xmm3(3), xmm4(4), xmm5(5), xmm6(6), xmm7(7); -static const Ymm ymm0(0), ymm1(1), ymm2(2), ymm3(3), ymm4(4), ymm5(5), ymm6(6), ymm7(7); -static const Reg32 eax(Operand::EAX), ecx(Operand::ECX), edx(Operand::EDX), ebx(Operand::EBX), esp(Operand::ESP), ebp(Operand::EBP), esi(Operand::ESI), edi(Operand::EDI); -static const Reg16 ax(Operand::AX), cx(Operand::CX), dx(Operand::DX), bx(Operand::BX), sp(Operand::SP), bp(Operand::BP), si(Operand::SI), di(Operand::DI); -static const Reg8 al(Operand::AL), cl(Operand::CL), dl(Operand::DL), bl(Operand::BL), ah(Operand::AH), ch(Operand::CH), dh(Operand::DH), bh(Operand::BH); -static const AddressFrame ptr(0), byte(8), word(16), dword(32), qword(64); -static const Fpu st0(0), st1(1), st2(2), st3(3), st4(4), st5(5), st6(6), st7(7); -#ifdef XBYAK64 -static const Reg64 rax(Operand::RAX), rcx(Operand::RCX), rdx(Operand::RDX), rbx(Operand::RBX), rsp(Operand::RSP), rbp(Operand::RBP), rsi(Operand::RSI), rdi(Operand::RDI), r8(Operand::R8), r9(Operand::R9), r10(Operand::R10), r11(Operand::R11), r12(Operand::R12), r13(Operand::R13), r14(Operand::R14), r15(Operand::R15); -static const Reg32 r8d(Operand::R8D), r9d(Operand::R9D), r10d(Operand::R10D), r11d(Operand::R11D), r12d(Operand::R12D), r13d(Operand::R13D), r14d(Operand::R14D), r15d(Operand::R15D); -static const Reg16 r8w(Operand::R8W), r9w(Operand::R9W), r10w(Operand::R10W), r11w(Operand::R11W), r12w(Operand::R12W), r13w(Operand::R13W), r14w(Operand::R14W), r15w(Operand::R15W); -static const Reg8 r8b(Operand::R8B), r9b(Operand::R9B), r10b(Operand::R10B), r11b(Operand::R11B), r12b(Operand::R12B), r13b(Operand::R13B), r14b(Operand::R14B), r15b(Operand::R15B), spl(Operand::SPL, 1), bpl(Operand::BPL, 1), sil(Operand::SIL, 1), dil(Operand::DIL, 1); -static const Xmm xmm8(8), xmm9(9), xmm10(10), xmm11(11), xmm12(12), xmm13(13), xmm14(14), xmm15(15); -static const Ymm ymm8(8), ymm9(9), ymm10(10), ymm11(11), ymm12(12), ymm13(13), ymm14(14), ymm15(15); -static const RegRip rip; -#endif -} // util - -#ifdef _MSC_VER - #pragma warning(pop) -#endif - -} // end of namespace - -#endif // XBYAK_XBYAK_H_ diff --git a/jan/src/cpu/mips3/x64/xbyak/xbyak_bin2hex.h b/jan/src/cpu/mips3/x64/xbyak/xbyak_bin2hex.h deleted file mode 100644 index 69ecdbfed..000000000 --- a/jan/src/cpu/mips3/x64/xbyak/xbyak_bin2hex.h +++ /dev/null @@ -1,258 +0,0 @@ -enum { - B00000000= 0, - B00000001= 1, - B00000010= 2, - B00000011= 3, - B00000100= 4, - B00000101= 5, - B00000110= 6, - B00000111= 7, - B00001000= 8, - B00001001= 9, - B00001010= 10, - B00001011= 11, - B00001100= 12, - B00001101= 13, - B00001110= 14, - B00001111= 15, - B00010000= 16, - B00010001= 17, - B00010010= 18, - B00010011= 19, - B00010100= 20, - B00010101= 21, - B00010110= 22, - B00010111= 23, - B00011000= 24, - B00011001= 25, - B00011010= 26, - B00011011= 27, - B00011100= 28, - B00011101= 29, - B00011110= 30, - B00011111= 31, - B00100000= 32, - B00100001= 33, - B00100010= 34, - B00100011= 35, - B00100100= 36, - B00100101= 37, - B00100110= 38, - B00100111= 39, - B00101000= 40, - B00101001= 41, - B00101010= 42, - B00101011= 43, - B00101100= 44, - B00101101= 45, - B00101110= 46, - B00101111= 47, - B00110000= 48, - B00110001= 49, - B00110010= 50, - B00110011= 51, - B00110100= 52, - B00110101= 53, - B00110110= 54, - B00110111= 55, - B00111000= 56, - B00111001= 57, - B00111010= 58, - B00111011= 59, - B00111100= 60, - B00111101= 61, - B00111110= 62, - B00111111= 63, - B01000000= 64, - B01000001= 65, - B01000010= 66, - B01000011= 67, - B01000100= 68, - B01000101= 69, - B01000110= 70, - B01000111= 71, - B01001000= 72, - B01001001= 73, - B01001010= 74, - B01001011= 75, - B01001100= 76, - B01001101= 77, - B01001110= 78, - B01001111= 79, - B01010000= 80, - B01010001= 81, - B01010010= 82, - B01010011= 83, - B01010100= 84, - B01010101= 85, - B01010110= 86, - B01010111= 87, - B01011000= 88, - B01011001= 89, - B01011010= 90, - B01011011= 91, - B01011100= 92, - B01011101= 93, - B01011110= 94, - B01011111= 95, - B01100000= 96, - B01100001= 97, - B01100010= 98, - B01100011= 99, - B01100100= 100, - B01100101= 101, - B01100110= 102, - B01100111= 103, - B01101000= 104, - B01101001= 105, - B01101010= 106, - B01101011= 107, - B01101100= 108, - B01101101= 109, - B01101110= 110, - B01101111= 111, - B01110000= 112, - B01110001= 113, - B01110010= 114, - B01110011= 115, - B01110100= 116, - B01110101= 117, - B01110110= 118, - B01110111= 119, - B01111000= 120, - B01111001= 121, - B01111010= 122, - B01111011= 123, - B01111100= 124, - B01111101= 125, - B01111110= 126, - B01111111= 127, - B10000000= 128, - B10000001= 129, - B10000010= 130, - B10000011= 131, - B10000100= 132, - B10000101= 133, - B10000110= 134, - B10000111= 135, - B10001000= 136, - B10001001= 137, - B10001010= 138, - B10001011= 139, - B10001100= 140, - B10001101= 141, - B10001110= 142, - B10001111= 143, - B10010000= 144, - B10010001= 145, - B10010010= 146, - B10010011= 147, - B10010100= 148, - B10010101= 149, - B10010110= 150, - B10010111= 151, - B10011000= 152, - B10011001= 153, - B10011010= 154, - B10011011= 155, - B10011100= 156, - B10011101= 157, - B10011110= 158, - B10011111= 159, - B10100000= 160, - B10100001= 161, - B10100010= 162, - B10100011= 163, - B10100100= 164, - B10100101= 165, - B10100110= 166, - B10100111= 167, - B10101000= 168, - B10101001= 169, - B10101010= 170, - B10101011= 171, - B10101100= 172, - B10101101= 173, - B10101110= 174, - B10101111= 175, - B10110000= 176, - B10110001= 177, - B10110010= 178, - B10110011= 179, - B10110100= 180, - B10110101= 181, - B10110110= 182, - B10110111= 183, - B10111000= 184, - B10111001= 185, - B10111010= 186, - B10111011= 187, - B10111100= 188, - B10111101= 189, - B10111110= 190, - B10111111= 191, - B11000000= 192, - B11000001= 193, - B11000010= 194, - B11000011= 195, - B11000100= 196, - B11000101= 197, - B11000110= 198, - B11000111= 199, - B11001000= 200, - B11001001= 201, - B11001010= 202, - B11001011= 203, - B11001100= 204, - B11001101= 205, - B11001110= 206, - B11001111= 207, - B11010000= 208, - B11010001= 209, - B11010010= 210, - B11010011= 211, - B11010100= 212, - B11010101= 213, - B11010110= 214, - B11010111= 215, - B11011000= 216, - B11011001= 217, - B11011010= 218, - B11011011= 219, - B11011100= 220, - B11011101= 221, - B11011110= 222, - B11011111= 223, - B11100000= 224, - B11100001= 225, - B11100010= 226, - B11100011= 227, - B11100100= 228, - B11100101= 229, - B11100110= 230, - B11100111= 231, - B11101000= 232, - B11101001= 233, - B11101010= 234, - B11101011= 235, - B11101100= 236, - B11101101= 237, - B11101110= 238, - B11101111= 239, - B11110000= 240, - B11110001= 241, - B11110010= 242, - B11110011= 243, - B11110100= 244, - B11110101= 245, - B11110110= 246, - B11110111= 247, - B11111000= 248, - B11111001= 249, - B11111010= 250, - B11111011= 251, - B11111100= 252, - B11111101= 253, - B11111110= 254, - B11111111= 255 -}; diff --git a/jan/src/cpu/mips3/x64/xbyak/xbyak_mnemonic.h b/jan/src/cpu/mips3/x64/xbyak/xbyak_mnemonic.h deleted file mode 100644 index 2005ad070..000000000 --- a/jan/src/cpu/mips3/x64/xbyak/xbyak_mnemonic.h +++ /dev/null @@ -1,1461 +0,0 @@ -const char *getVersionString() const { return "4.81"; } -void packssdw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x6B); } -void packsswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x63); } -void packuswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x67); } -void pand(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDB); } -void pandn(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDF); } -void pmaddwd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF5); } -void pmulhuw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE4); } -void pmulhw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE5); } -void pmullw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD5); } -void por(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEB); } -void punpckhbw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x68); } -void punpckhwd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x69); } -void punpckhdq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x6A); } -void punpcklbw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x60); } -void punpcklwd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x61); } -void punpckldq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x62); } -void pxor(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEF); } -void pavgb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE0); } -void pavgw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE3); } -void pmaxsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEE); } -void pmaxub(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDE); } -void pminsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEA); } -void pminub(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDA); } -void psadbw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF6); } -void paddq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD4); } -void pmuludq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF4); } -void psubq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFB); } -void paddb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFC); } -void paddw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFD); } -void paddd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFE); } -void paddsb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xEC); } -void paddsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xED); } -void paddusb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDC); } -void paddusw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDD); } -void pcmpeqb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x74); } -void pcmpeqw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x75); } -void pcmpeqd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x76); } -void pcmpgtb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x64); } -void pcmpgtw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x65); } -void pcmpgtd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x66); } -void psllw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF1); } -void pslld(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF2); } -void psllq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF3); } -void psraw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE1); } -void psrad(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE2); } -void psrlw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD1); } -void psrld(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD2); } -void psrlq(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD3); } -void psubb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF8); } -void psubw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF9); } -void psubd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFA); } -void psubsb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE8); } -void psubsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE9); } -void psubusb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD8); } -void psubusw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xD9); } -void psllw(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x71, 6); } -void pslld(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x72, 6); } -void psllq(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x73, 6); } -void psraw(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x71, 4); } -void psrad(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x72, 4); } -void psrlw(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x71, 2); } -void psrld(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x72, 2); } -void psrlq(const Mmx& mmx, int imm8) { opMMX_IMM(mmx, imm8, 0x73, 2); } -void pslldq(const Xmm& xmm, int imm8) { opMMX_IMM(xmm, imm8, 0x73, 7); } -void psrldq(const Xmm& xmm, int imm8) { opMMX_IMM(xmm, imm8, 0x73, 3); } -void pshufw(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0x00, imm8); } -void pshuflw(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0xF2, imm8); } -void pshufhw(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0xF3, imm8); } -void pshufd(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0x66, imm8); } -void movdqa(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x6F, 0x66); } -void movdqa(const Address& addr, const Xmm& xmm) { db(0x66); opModM(addr, xmm, 0x0F, 0x7F); } -void movdqu(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x6F, 0xF3); } -void movdqu(const Address& addr, const Xmm& xmm) { db(0xF3); opModM(addr, xmm, 0x0F, 0x7F); } -void movaps(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x28, 0x100); } -void movaps(const Address& addr, const Xmm& xmm) { opModM(addr, xmm, 0x0F, 0x29); } -void movss(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0xF3); } -void movss(const Address& addr, const Xmm& xmm) { db(0xF3); opModM(addr, xmm, 0x0F, 0x11); } -void movups(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0x100); } -void movups(const Address& addr, const Xmm& xmm) { opModM(addr, xmm, 0x0F, 0x11); } -void movapd(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x28, 0x66); } -void movapd(const Address& addr, const Xmm& xmm) { db(0x66); opModM(addr, xmm, 0x0F, 0x29); } -void movsd(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0xF2); } -void movsd(const Address& addr, const Xmm& xmm) { db(0xF2); opModM(addr, xmm, 0x0F, 0x11); } -void movupd(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0x66); } -void movupd(const Address& addr, const Xmm& xmm) { db(0x66); opModM(addr, xmm, 0x0F, 0x11); } -void addps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0x100, isXMM_XMMorMEM); } -void addss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0xF3, isXMM_XMMorMEM); } -void addpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0x66, isXMM_XMMorMEM); } -void addsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0xF2, isXMM_XMMorMEM); } -void andnps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x55, 0x100, isXMM_XMMorMEM); } -void andnpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x55, 0x66, isXMM_XMMorMEM); } -void andps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x54, 0x100, isXMM_XMMorMEM); } -void andpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x54, 0x66, isXMM_XMMorMEM); } -void cmpps(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0x100, isXMM_XMMorMEM, imm8); } -void cmpss(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0xF3, isXMM_XMMorMEM, imm8); } -void cmppd(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0x66, isXMM_XMMorMEM, imm8); } -void cmpsd(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0xF2, isXMM_XMMorMEM, imm8); } -void divps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0x100, isXMM_XMMorMEM); } -void divss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0xF3, isXMM_XMMorMEM); } -void divpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0x66, isXMM_XMMorMEM); } -void divsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0xF2, isXMM_XMMorMEM); } -void maxps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5F, 0x100, isXMM_XMMorMEM); } -void maxss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5F, 0xF3, isXMM_XMMorMEM); } -void maxpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5F, 0x66, isXMM_XMMorMEM); } -void maxsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5F, 0xF2, isXMM_XMMorMEM); } -void minps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5D, 0x100, isXMM_XMMorMEM); } -void minss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5D, 0xF3, isXMM_XMMorMEM); } -void minpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5D, 0x66, isXMM_XMMorMEM); } -void minsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5D, 0xF2, isXMM_XMMorMEM); } -void mulps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0x100, isXMM_XMMorMEM); } -void mulss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0xF3, isXMM_XMMorMEM); } -void mulpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0x66, isXMM_XMMorMEM); } -void mulsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0xF2, isXMM_XMMorMEM); } -void orps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x56, 0x100, isXMM_XMMorMEM); } -void orpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x56, 0x66, isXMM_XMMorMEM); } -void rcpps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x53, 0x100, isXMM_XMMorMEM); } -void rcpss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x53, 0xF3, isXMM_XMMorMEM); } -void rsqrtps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x52, 0x100, isXMM_XMMorMEM); } -void rsqrtss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x52, 0xF3, isXMM_XMMorMEM); } -void shufps(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC6, 0x100, isXMM_XMMorMEM, imm8); } -void shufpd(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC6, 0x66, isXMM_XMMorMEM, imm8); } -void sqrtps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0x100, isXMM_XMMorMEM); } -void sqrtss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0xF3, isXMM_XMMorMEM); } -void sqrtpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0x66, isXMM_XMMorMEM); } -void sqrtsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0xF2, isXMM_XMMorMEM); } -void subps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0x100, isXMM_XMMorMEM); } -void subss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0xF3, isXMM_XMMorMEM); } -void subpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0x66, isXMM_XMMorMEM); } -void subsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0xF2, isXMM_XMMorMEM); } -void unpckhps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x15, 0x100, isXMM_XMMorMEM); } -void unpckhpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x15, 0x66, isXMM_XMMorMEM); } -void unpcklps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x14, 0x100, isXMM_XMMorMEM); } -void unpcklpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x14, 0x66, isXMM_XMMorMEM); } -void xorps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x57, 0x100, isXMM_XMMorMEM); } -void xorpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x57, 0x66, isXMM_XMMorMEM); } -void maskmovdqu(const Xmm& reg1, const Xmm& reg2) { db(0x66); opModR(reg1, reg2, 0x0F, 0xF7); } -void movhlps(const Xmm& reg1, const Xmm& reg2) { opModR(reg1, reg2, 0x0F, 0x12); } -void movlhps(const Xmm& reg1, const Xmm& reg2) { opModR(reg1, reg2, 0x0F, 0x16); } -void punpckhqdq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x6D, 0x66, isXMM_XMMorMEM); } -void punpcklqdq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x6C, 0x66, isXMM_XMMorMEM); } -void comiss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2F, 0x100, isXMM_XMMorMEM); } -void ucomiss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2E, 0x100, isXMM_XMMorMEM); } -void comisd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2F, 0x66, isXMM_XMMorMEM); } -void ucomisd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2E, 0x66, isXMM_XMMorMEM); } -void cvtpd2ps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5A, 0x66, isXMM_XMMorMEM); } -void cvtps2pd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5A, 0x100, isXMM_XMMorMEM); } -void cvtsd2ss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5A, 0xF2, isXMM_XMMorMEM); } -void cvtss2sd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5A, 0xF3, isXMM_XMMorMEM); } -void cvtpd2dq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xE6, 0xF2, isXMM_XMMorMEM); } -void cvttpd2dq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xE6, 0x66, isXMM_XMMorMEM); } -void cvtdq2pd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xE6, 0xF3, isXMM_XMMorMEM); } -void cvtps2dq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5B, 0x66, isXMM_XMMorMEM); } -void cvttps2dq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5B, 0xF3, isXMM_XMMorMEM); } -void cvtdq2ps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5B, 0x100, isXMM_XMMorMEM); } -void addsubpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xD0, 0x66, isXMM_XMMorMEM); } -void addsubps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xD0, 0xF2, isXMM_XMMorMEM); } -void haddpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7C, 0x66, isXMM_XMMorMEM); } -void haddps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7C, 0xF2, isXMM_XMMorMEM); } -void hsubpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7D, 0x66, isXMM_XMMorMEM); } -void hsubps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7D, 0xF2, isXMM_XMMorMEM); } -void movddup(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x12, 0xF2, isXMM_XMMorMEM); } -void movshdup(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x16, 0xF3, isXMM_XMMorMEM); } -void movsldup(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x12, 0xF3, isXMM_XMMorMEM); } -void cvtpi2ps(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2A, 0x100, isXMM_MMXorMEM); } -void cvtps2pi(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2D, 0x100, isMMX_XMMorMEM); } -void cvtsi2ss(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2A, 0xF3, isXMM_REG32orMEM); } -void cvtss2si(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2D, 0xF3, isREG32_XMMorMEM); } -void cvttps2pi(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2C, 0x100, isMMX_XMMorMEM); } -void cvttss2si(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2C, 0xF3, isREG32_XMMorMEM); } -void cvtpi2pd(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2A, 0x66, isXMM_MMXorMEM); } -void cvtpd2pi(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2D, 0x66, isMMX_XMMorMEM); } -void cvtsi2sd(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2A, 0xF2, isXMM_REG32orMEM); } -void cvtsd2si(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2D, 0xF2, isREG32_XMMorMEM); } -void cvttpd2pi(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2C, 0x66, isMMX_XMMorMEM); } -void cvttsd2si(const Operand& reg, const Operand& op) { opGen(reg, op, 0x2C, 0xF2, isREG32_XMMorMEM); } -void prefetcht0(const Address& addr) { opModM(addr, Reg32(1), 0x0F, B00011000); } -void prefetcht1(const Address& addr) { opModM(addr, Reg32(2), 0x0F, B00011000); } -void prefetcht2(const Address& addr) { opModM(addr, Reg32(3), 0x0F, B00011000); } -void prefetchnta(const Address& addr) { opModM(addr, Reg32(0), 0x0F, B00011000); } -void movhps(const Operand& op1, const Operand& op2) { opMovXMM(op1, op2, 0x16, 0x100); } -void movlps(const Operand& op1, const Operand& op2) { opMovXMM(op1, op2, 0x12, 0x100); } -void movhpd(const Operand& op1, const Operand& op2) { opMovXMM(op1, op2, 0x16, 0x66); } -void movlpd(const Operand& op1, const Operand& op2) { opMovXMM(op1, op2, 0x12, 0x66); } -void cmovo(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 0); } -void jo(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x70, 0x80, 0x0F); } -void jo(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x70, 0x80, 0x0F); } -void seto(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 0); } -void cmovno(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 1); } -void jno(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x71, 0x81, 0x0F); } -void jno(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x71, 0x81, 0x0F); } -void setno(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 1); } -void cmovb(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 2); } -void jb(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void jb(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void setb(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 2); } -void cmovc(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 2); } -void jc(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void jc(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void setc(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 2); } -void cmovnae(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 2); } -void jnae(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void jnae(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } -void setnae(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 2); } -void cmovnb(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 3); } -void jnb(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void jnb(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void setnb(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 3); } -void cmovae(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 3); } -void jae(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void jae(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void setae(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 3); } -void cmovnc(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 3); } -void jnc(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void jnc(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } -void setnc(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 3); } -void cmove(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 4); } -void je(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x74, 0x84, 0x0F); } -void je(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x74, 0x84, 0x0F); } -void sete(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 4); } -void cmovz(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 4); } -void jz(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x74, 0x84, 0x0F); } -void jz(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x74, 0x84, 0x0F); } -void setz(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 4); } -void cmovne(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 5); } -void jne(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x75, 0x85, 0x0F); } -void jne(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x75, 0x85, 0x0F); } -void setne(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 5); } -void cmovnz(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 5); } -void jnz(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x75, 0x85, 0x0F); } -void jnz(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x75, 0x85, 0x0F); } -void setnz(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 5); } -void cmovbe(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 6); } -void jbe(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x76, 0x86, 0x0F); } -void jbe(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x76, 0x86, 0x0F); } -void setbe(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 6); } -void cmovna(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 6); } -void jna(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x76, 0x86, 0x0F); } -void jna(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x76, 0x86, 0x0F); } -void setna(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 6); } -void cmovnbe(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 7); } -void jnbe(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x77, 0x87, 0x0F); } -void jnbe(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x77, 0x87, 0x0F); } -void setnbe(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 7); } -void cmova(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 7); } -void ja(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x77, 0x87, 0x0F); } -void ja(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x77, 0x87, 0x0F); } -void seta(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 7); } -void cmovs(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 8); } -void js(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x78, 0x88, 0x0F); } -void js(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x78, 0x88, 0x0F); } -void sets(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 8); } -void cmovns(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 9); } -void jns(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x79, 0x89, 0x0F); } -void jns(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x79, 0x89, 0x0F); } -void setns(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 9); } -void cmovp(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 10); } -void jp(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7A, 0x8A, 0x0F); } -void jp(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7A, 0x8A, 0x0F); } -void setp(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 10); } -void cmovpe(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 10); } -void jpe(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7A, 0x8A, 0x0F); } -void jpe(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7A, 0x8A, 0x0F); } -void setpe(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 10); } -void cmovnp(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 11); } -void jnp(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7B, 0x8B, 0x0F); } -void jnp(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7B, 0x8B, 0x0F); } -void setnp(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 11); } -void cmovpo(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 11); } -void jpo(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7B, 0x8B, 0x0F); } -void jpo(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7B, 0x8B, 0x0F); } -void setpo(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 11); } -void cmovl(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 12); } -void jl(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7C, 0x8C, 0x0F); } -void jl(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7C, 0x8C, 0x0F); } -void setl(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 12); } -void cmovnge(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 12); } -void jnge(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7C, 0x8C, 0x0F); } -void jnge(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7C, 0x8C, 0x0F); } -void setnge(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 12); } -void cmovnl(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 13); } -void jnl(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7D, 0x8D, 0x0F); } -void jnl(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7D, 0x8D, 0x0F); } -void setnl(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 13); } -void cmovge(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 13); } -void jge(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7D, 0x8D, 0x0F); } -void jge(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7D, 0x8D, 0x0F); } -void setge(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 13); } -void cmovle(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 14); } -void jle(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7E, 0x8E, 0x0F); } -void jle(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7E, 0x8E, 0x0F); } -void setle(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 14); } -void cmovng(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 14); } -void jng(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7E, 0x8E, 0x0F); } -void jng(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7E, 0x8E, 0x0F); } -void setng(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 14); } -void cmovnle(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 15); } -void jnle(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7F, 0x8F, 0x0F); } -void jnle(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7F, 0x8F, 0x0F); } -void setnle(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 15); } -void cmovg(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 15); } -void jg(std::string label, LabelType type = T_AUTO) { opJmp(label, type, 0x7F, 0x8F, 0x0F); } -void jg(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x7F, 0x8F, 0x0F); } -void setg(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, B10010000 | 15); } -#ifdef XBYAK32 -void jcxz(std::string label) { db(0x67); opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jcxz(const Label& label) { db(0x67); opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jecxz(std::string label) { opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jecxz(const Label& label) { opJmp(label, T_SHORT, 0xe3, 0, 0); } -#else -void jecxz(std::string label) { db(0x67); opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jecxz(const Label& label) { db(0x67); opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jrcxz(std::string label) { opJmp(label, T_SHORT, 0xe3, 0, 0); } -void jrcxz(const Label& label) { opJmp(label, T_SHORT, 0xe3, 0, 0); } -#endif -#ifdef XBYAK64 -void cdqe() { db(0x48); db(0x98); } -void cqo() { db(0x48); db(0x99); } -#else -void aaa() { db(0x37); } -void aad() { db(0xD5); db(0x0A); } -void aam() { db(0xD4); db(0x0A); } -void aas() { db(0x3F); } -void daa() { db(0x27); } -void das() { db(0x2F); } -void popad() { db(0x61); } -void popfd() { db(0x9D); } -void pusha() { db(0x60); } -void pushad() { db(0x60); } -void pushfd() { db(0x9C); } -void popa() { db(0x61); } -#endif -void cbw() { db(0x66); db(0x98); } -void cdq() { db(0x99); } -void clc() { db(0xF8); } -void cld() { db(0xFC); } -void cli() { db(0xFA); } -void cmc() { db(0xF5); } -void cpuid() { db(0x0F); db(0xA2); } -void cwd() { db(0x66); db(0x99); } -void cwde() { db(0x98); } -void lahf() { db(0x9F); } -void lock() { db(0xF0); } -void nop() { db(0x90); } -void sahf() { db(0x9E); } -void stc() { db(0xF9); } -void std() { db(0xFD); } -void sti() { db(0xFB); } -void emms() { db(0x0F); db(0x77); } -void pause() { db(0xF3); db(0x90); } -void sfence() { db(0x0F); db(0xAE); db(0xF8); } -void lfence() { db(0x0F); db(0xAE); db(0xE8); } -void mfence() { db(0x0F); db(0xAE); db(0xF0); } -void monitor() { db(0x0F); db(0x01); db(0xC8); } -void mwait() { db(0x0F); db(0x01); db(0xC9); } -void rdmsr() { db(0x0F); db(0x32); } -void rdpmc() { db(0x0F); db(0x33); } -void rdtsc() { db(0x0F); db(0x31); } -void rdtscp() { db(0x0F); db(0x01); db(0xF9); } -void ud2() { db(0x0F); db(0x0B); } -void wait() { db(0x9B); } -void fwait() { db(0x9B); } -void wbinvd() { db(0x0F); db(0x09); } -void wrmsr() { db(0x0F); db(0x30); } -void xlatb() { db(0xD7); } -void popf() { db(0x9D); } -void pushf() { db(0x9C); } -void stac() { db(0x0F); db(0x01); db(0xCB); } -void vzeroall() { db(0xC5); db(0xFC); db(0x77); } -void vzeroupper() { db(0xC5); db(0xF8); db(0x77); } -void xgetbv() { db(0x0F); db(0x01); db(0xD0); } -void f2xm1() { db(0xD9); db(0xF0); } -void fabs() { db(0xD9); db(0xE1); } -void faddp() { db(0xDE); db(0xC1); } -void fchs() { db(0xD9); db(0xE0); } -void fcom() { db(0xD8); db(0xD1); } -void fcomp() { db(0xD8); db(0xD9); } -void fcompp() { db(0xDE); db(0xD9); } -void fcos() { db(0xD9); db(0xFF); } -void fdecstp() { db(0xD9); db(0xF6); } -void fdivp() { db(0xDE); db(0xF9); } -void fdivrp() { db(0xDE); db(0xF1); } -void fincstp() { db(0xD9); db(0xF7); } -void finit() { db(0x9B); db(0xDB); db(0xE3); } -void fninit() { db(0xDB); db(0xE3); } -void fld1() { db(0xD9); db(0xE8); } -void fldl2t() { db(0xD9); db(0xE9); } -void fldl2e() { db(0xD9); db(0xEA); } -void fldpi() { db(0xD9); db(0xEB); } -void fldlg2() { db(0xD9); db(0xEC); } -void fldln2() { db(0xD9); db(0xED); } -void fldz() { db(0xD9); db(0xEE); } -void fmulp() { db(0xDE); db(0xC9); } -void fnop() { db(0xD9); db(0xD0); } -void fpatan() { db(0xD9); db(0xF3); } -void fprem() { db(0xD9); db(0xF8); } -void fprem1() { db(0xD9); db(0xF5); } -void fptan() { db(0xD9); db(0xF2); } -void frndint() { db(0xD9); db(0xFC); } -void fscale() { db(0xD9); db(0xFD); } -void fsin() { db(0xD9); db(0xFE); } -void fsincos() { db(0xD9); db(0xFB); } -void fsqrt() { db(0xD9); db(0xFA); } -void fsubp() { db(0xDE); db(0xE9); } -void fsubrp() { db(0xDE); db(0xE1); } -void ftst() { db(0xD9); db(0xE4); } -void fucom() { db(0xDD); db(0xE1); } -void fucomp() { db(0xDD); db(0xE9); } -void fucompp() { db(0xDA); db(0xE9); } -void fxam() { db(0xD9); db(0xE5); } -void fxch() { db(0xD9); db(0xC9); } -void fxtract() { db(0xD9); db(0xF4); } -void fyl2x() { db(0xD9); db(0xF1); } -void fyl2xp1() { db(0xD9); db(0xF9); } -void adc(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x10); } -void adc(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x10, 2); } -void add(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x00); } -void add(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x00, 0); } -void and_(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x20); } -void and_(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x20, 4); } -#ifndef XBYAK_NO_OP_NAMES -void and(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x20); } -void and(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x20, 4); } -#endif -void cmp(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x38); } -void cmp(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x38, 7); } -void or_(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x08); } -void or_(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x08, 1); } -#ifndef XBYAK_NO_OP_NAMES -void or(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x08); } -void or(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x08, 1); } -#endif -void sbb(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x18); } -void sbb(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x18, 3); } -void sub(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x28); } -void sub(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x28, 5); } -void xor_(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x30); } -void xor_(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x30, 6); } -#ifndef XBYAK_NO_OP_NAMES -void xor(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x30); } -void xor(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x30, 6); } -#endif -void dec(const Operand& op) { opIncDec(op, 0x48, 1); } -void inc(const Operand& op) { opIncDec(op, 0x40, 0); } -void bt(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xa3); } -void bt(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 4, 0x0f, 0xba); db(imm); } -void bts(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xab); } -void bts(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 5, 0x0f, 0xba); db(imm); } -void btr(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xb3); } -void btr(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 6, 0x0f, 0xba); db(imm); } -void btc(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xbb); } -void btc(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 7, 0x0f, 0xba); db(imm); } -void div(const Operand& op) { opR_ModM(op, 0, 6, 0xF6); } -void idiv(const Operand& op) { opR_ModM(op, 0, 7, 0xF6); } -void imul(const Operand& op) { opR_ModM(op, 0, 5, 0xF6); } -void mul(const Operand& op) { opR_ModM(op, 0, 4, 0xF6); } -void neg(const Operand& op) { opR_ModM(op, 0, 3, 0xF6); } -void not_(const Operand& op) { opR_ModM(op, 0, 2, 0xF6); } -#ifndef XBYAK_NO_OP_NAMES -void not(const Operand& op) { opR_ModM(op, 0, 2, 0xF6); } -#endif -void rcl(const Operand& op, int imm) { opShift(op, imm, 2); } -void rcl(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 2); } -void rcr(const Operand& op, int imm) { opShift(op, imm, 3); } -void rcr(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 3); } -void rol(const Operand& op, int imm) { opShift(op, imm, 0); } -void rol(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 0); } -void ror(const Operand& op, int imm) { opShift(op, imm, 1); } -void ror(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 1); } -void sar(const Operand& op, int imm) { opShift(op, imm, 7); } -void sar(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 7); } -void shl(const Operand& op, int imm) { opShift(op, imm, 4); } -void shl(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 4); } -void shr(const Operand& op, int imm) { opShift(op, imm, 5); } -void shr(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 5); } -void sal(const Operand& op, int imm) { opShift(op, imm, 4); } -void sal(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 4); } -void shld(const Operand& op, const Reg& reg, uint8 imm) { opShxd(op, reg, imm, 0xA4); } -void shld(const Operand& op, const Reg& reg, const Reg8& _cl) { opShxd(op, reg, 0, 0xA4, &_cl); } -void shrd(const Operand& op, const Reg& reg, uint8 imm) { opShxd(op, reg, imm, 0xAC); } -void shrd(const Operand& op, const Reg& reg, const Reg8& _cl) { opShxd(op, reg, 0, 0xAC, &_cl); } -void bsf(const Reg®, const Operand& op) { opModRM(reg, op, op.isREG(16 | i32e), op.isMEM(), 0x0F, 0xBC); } -void bsr(const Reg®, const Operand& op) { opModRM(reg, op, op.isREG(16 | i32e), op.isMEM(), 0x0F, 0xBD); } -void popcnt(const Reg®, const Operand& op) { opSp1(reg, op, 0xF3, 0x0F, 0xB8); } -void tzcnt(const Reg®, const Operand& op) { opSp1(reg, op, 0xF3, 0x0F, 0xBC); } -void lzcnt(const Reg®, const Operand& op) { opSp1(reg, op, 0xF3, 0x0F, 0xBD); } -void pshufb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x00, 0x66, NONE, 0x38); } -void phaddw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x01, 0x66, NONE, 0x38); } -void phaddd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x02, 0x66, NONE, 0x38); } -void phaddsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x03, 0x66, NONE, 0x38); } -void pmaddubsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x04, 0x66, NONE, 0x38); } -void phsubw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x05, 0x66, NONE, 0x38); } -void phsubd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x06, 0x66, NONE, 0x38); } -void phsubsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x07, 0x66, NONE, 0x38); } -void psignb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x08, 0x66, NONE, 0x38); } -void psignw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x09, 0x66, NONE, 0x38); } -void psignd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x0A, 0x66, NONE, 0x38); } -void pmulhrsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x0B, 0x66, NONE, 0x38); } -void pabsb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x1C, 0x66, NONE, 0x38); } -void pabsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x1D, 0x66, NONE, 0x38); } -void pabsd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x1E, 0x66, NONE, 0x38); } -void palignr(const Mmx& mmx, const Operand& op, int imm) { opMMX(mmx, op, 0x0f, 0x66, static_cast(imm), 0x3a); } -void blendvpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x15, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void blendvps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x14, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void packusdw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x2B, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pblendvb(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x10, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pcmpeqq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x29, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void ptest(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x17, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxbw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x20, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxbd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x21, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxbq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x22, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxwd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x23, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxwq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x24, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovsxdq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x25, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxbw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x30, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxbd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x31, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxbq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x32, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxwd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x33, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxwq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x34, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmovzxdq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x35, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pminsb(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x38, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pminsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x39, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pminuw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3A, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pminud(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3B, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmaxsb(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3C, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmaxsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3D, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmaxuw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3E, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmaxud(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x3F, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmuldq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x28, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pmulld(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x40, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void phminposuw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x41, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void pcmpgtq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x37, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesdec(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDE, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesdeclast(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDF, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesenc(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDC, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesenclast(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDD, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void aesimc(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDB, 0x66, isXMM_XMMorMEM, NONE, 0x38); } -void blendpd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0D, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void blendps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0C, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void dppd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x41, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void dpps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x40, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void mpsadbw(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x42, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pblendw(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0E, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void roundps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x08, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void roundpd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x09, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void roundss(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0A, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void roundsd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0B, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pcmpestrm(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x60, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pcmpestri(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x61, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pcmpistrm(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x62, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pcmpistri(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x63, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pclmulqdq(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x44, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void aeskeygenassist(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0xDF, 0x66, isXMM_XMMorMEM, static_cast(imm), 0x3A); } -void pclmullqlqdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x00); } -void pclmulhqlqdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x01); } -void pclmullqhdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x10); } -void pclmulhqhdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x11); } -void ldmxcsr(const Address& addr) { opModM(addr, Reg32(2), 0x0F, 0xAE); } -void stmxcsr(const Address& addr) { opModM(addr, Reg32(3), 0x0F, 0xAE); } -void clflush(const Address& addr) { opModM(addr, Reg32(7), 0x0F, 0xAE); } -void fldcw(const Address& addr) { opModM(addr, Reg32(5), 0xD9, 0x100); } -void fstcw(const Address& addr) { db(0x9B); opModM(addr, Reg32(7), 0xD9, NONE); } -void movntpd(const Address& addr, const Xmm& reg) { opModM(addr, Reg16(reg.getIdx()), 0x0F, 0x2B); } -void movntdq(const Address& addr, const Xmm& reg) { opModM(addr, Reg16(reg.getIdx()), 0x0F, 0xE7); } -void movsx(const Reg& reg, const Operand& op) { opMovxx(reg, op, 0xBE); } -void movzx(const Reg& reg, const Operand& op) { opMovxx(reg, op, 0xB6); } -void fadd(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 0, 0); } -void fiadd(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 0, 0); } -void fcom(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 2, 0); } -void fcomp(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 3, 0); } -void fdiv(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 6, 0); } -void fidiv(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 6, 0); } -void fdivr(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 7, 0); } -void fidivr(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 7, 0); } -void ficom(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 2, 0); } -void ficomp(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 3, 0); } -void fild(const Address& addr) { opFpuMem(addr, 0xDF, 0xDB, 0xDF, 0, 5); } -void fist(const Address& addr) { opFpuMem(addr, 0xDF, 0xDB, 0x00, 2, 0); } -void fistp(const Address& addr) { opFpuMem(addr, 0xDF, 0xDB, 0xDF, 3, 7); } -void fisttp(const Address& addr) { opFpuMem(addr, 0xDF, 0xDB, 0xDD, 1, 0); } -void fld(const Address& addr) { opFpuMem(addr, 0x00, 0xD9, 0xDD, 0, 0); } -void fmul(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 1, 0); } -void fimul(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 1, 0); } -void fst(const Address& addr) { opFpuMem(addr, 0x00, 0xD9, 0xDD, 2, 0); } -void fstp(const Address& addr) { opFpuMem(addr, 0x00, 0xD9, 0xDD, 3, 0); } -void fsub(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 4, 0); } -void fisub(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 4, 0); } -void fsubr(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 5, 0); } -void fisubr(const Address& addr) { opFpuMem(addr, 0xDE, 0xDA, 0x00, 5, 0); } -void fadd(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8C0, 0xDCC0); } -void fadd(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8C0, 0xDCC0); } -void faddp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEC0); } -void faddp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEC0); } -void fcmovb(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDAC0, 0x00C0); } -void fcmovb(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDAC0, 0x00C0); } -void fcmove(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDAC8, 0x00C8); } -void fcmove(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDAC8, 0x00C8); } -void fcmovbe(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDAD0, 0x00D0); } -void fcmovbe(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDAD0, 0x00D0); } -void fcmovu(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDAD8, 0x00D8); } -void fcmovu(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDAD8, 0x00D8); } -void fcmovnb(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBC0, 0x00C0); } -void fcmovnb(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBC0, 0x00C0); } -void fcmovne(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBC8, 0x00C8); } -void fcmovne(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBC8, 0x00C8); } -void fcmovnbe(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBD0, 0x00D0); } -void fcmovnbe(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBD0, 0x00D0); } -void fcmovnu(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBD8, 0x00D8); } -void fcmovnu(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBD8, 0x00D8); } -void fcomi(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBF0, 0x00F0); } -void fcomi(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBF0, 0x00F0); } -void fcomip(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDFF0, 0x00F0); } -void fcomip(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDFF0, 0x00F0); } -void fucomi(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDBE8, 0x00E8); } -void fucomi(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDBE8, 0x00E8); } -void fucomip(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xDFE8, 0x00E8); } -void fucomip(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xDFE8, 0x00E8); } -void fdiv(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8F0, 0xDCF8); } -void fdiv(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8F0, 0xDCF8); } -void fdivp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEF8); } -void fdivp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEF8); } -void fdivr(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8F8, 0xDCF0); } -void fdivr(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8F8, 0xDCF0); } -void fdivrp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEF0); } -void fdivrp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEF0); } -void fmul(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8C8, 0xDCC8); } -void fmul(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8C8, 0xDCC8); } -void fmulp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEC8); } -void fmulp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEC8); } -void fsub(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8E0, 0xDCE8); } -void fsub(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8E0, 0xDCE8); } -void fsubp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEE8); } -void fsubp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEE8); } -void fsubr(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0xD8E8, 0xDCE0); } -void fsubr(const Fpu& reg1) { opFpuFpu(st0, reg1, 0xD8E8, 0xDCE0); } -void fsubrp(const Fpu& reg1, const Fpu& reg2) { opFpuFpu(reg1, reg2, 0x0000, 0xDEE0); } -void fsubrp(const Fpu& reg1) { opFpuFpu(reg1, st0, 0x0000, 0xDEE0); } -void fcom(const Fpu& reg) { opFpu(reg, 0xD8, 0xD0); } -void fcomp(const Fpu& reg) { opFpu(reg, 0xD8, 0xD8); } -void ffree(const Fpu& reg) { opFpu(reg, 0xDD, 0xC0); } -void fld(const Fpu& reg) { opFpu(reg, 0xD9, 0xC0); } -void fst(const Fpu& reg) { opFpu(reg, 0xDD, 0xD0); } -void fstp(const Fpu& reg) { opFpu(reg, 0xDD, 0xD8); } -void fucom(const Fpu& reg) { opFpu(reg, 0xDD, 0xE0); } -void fucomp(const Fpu& reg) { opFpu(reg, 0xDD, 0xE8); } -void fxch(const Fpu& reg) { opFpu(reg, 0xD9, 0xC8); } -void vaddpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x58, true); } -void vaddps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x58, true); } -void vaddsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x58, false); } -void vaddss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x58, false); } -void vsubpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x5C, true); } -void vsubps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x5C, true); } -void vsubsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x5C, false); } -void vsubss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x5C, false); } -void vmulpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x59, true); } -void vmulps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x59, true); } -void vmulsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x59, false); } -void vmulss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x59, false); } -void vdivpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x5E, true); } -void vdivps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x5E, true); } -void vdivsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x5E, false); } -void vdivss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x5E, false); } -void vmaxpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x5F, true); } -void vmaxps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x5F, true); } -void vmaxsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x5F, false); } -void vmaxss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x5F, false); } -void vminpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x5D, true); } -void vminps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x5D, true); } -void vminsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x5D, false); } -void vminss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F3, 0x5D, false); } -void vandpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x54, true); } -void vandps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x54, true); } -void vandnpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x55, true); } -void vandnps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x55, true); } -void vorpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x56, true); } -void vorps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x56, true); } -void vxorpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x57, true); } -void vxorps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F, 0x57, true); } -void vblendpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0D, true, 0); db(imm); } -void vblendpd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0D, true, 0); db(imm); } -void vblendps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0C, true, 0); db(imm); } -void vblendps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0C, true, 0); db(imm); } -void vdppd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x41, false, 0); db(imm); } -void vdppd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x41, false, 0); db(imm); } -void vdpps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x40, true, 0); db(imm); } -void vdpps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x40, true, 0); db(imm); } -void vmpsadbw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x42, true, 0); db(imm); } -void vmpsadbw(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x42, true, 0); db(imm); } -void vpblendw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0E, true, 0); db(imm); } -void vpblendw(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0E, true, 0); db(imm); } -void vpblendd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x02, true, 0); db(imm); } -void vpblendd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x02, true, 0); db(imm); } -void vroundsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0B, false, 0); db(imm); } -void vroundsd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0B, false, 0); db(imm); } -void vroundss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0A, false, 0); db(imm); } -void vroundss(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0A, false, 0); db(imm); } -void vpclmulqdq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x44, false, 0); db(imm); } -void vpclmulqdq(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x44, false, 0); db(imm); } -void vpermilps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x0C, true, 0); } -void vpermilpd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x0D, true, 0); } -void vpsllvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x47, true, 0); } -void vpsllvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x47, true, 1); } -void vpsravd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x46, true, 0); } -void vpsrlvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x45, true, 0); } -void vpsrlvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x45, true, 1); } -void vcmppd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xC2, true, -1); db(imm); } -void vcmppd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xC2, true, -1); db(imm); } -void vcmpps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F, 0xC2, true, -1); db(imm); } -void vcmpps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F, 0xC2, true, -1); db(imm); } -void vcmpsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F2, 0xC2, false, -1); db(imm); } -void vcmpsd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F2, 0xC2, false, -1); db(imm); } -void vcmpss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0xC2, false, -1); db(imm); } -void vcmpss(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0xC2, false, -1); db(imm); } -void vcvtsd2ss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F2, 0x5A, false, -1); } -void vcvtsd2ss(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F2, 0x5A, false, -1); } -void vcvtss2sd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x5A, false, -1); } -void vcvtss2sd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0x5A, false, -1); } -void vinsertps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x21, false, 0); db(imm); } -void vinsertps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x21, false, 0); db(imm); } -void vpacksswb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x63, true, -1); } -void vpacksswb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x63, true, -1); } -void vpackssdw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x6B, true, -1); } -void vpackssdw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x6B, true, -1); } -void vpackuswb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x67, true, -1); } -void vpackuswb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x67, true, -1); } -void vpackusdw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x2B, true, -1); } -void vpackusdw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x2B, true, -1); } -void vpaddb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFC, true, -1); } -void vpaddb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFC, true, -1); } -void vpaddw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFD, true, -1); } -void vpaddw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFD, true, -1); } -void vpaddd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFE, true, -1); } -void vpaddd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFE, true, -1); } -void vpaddq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD4, true, -1); } -void vpaddq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD4, true, -1); } -void vpaddsb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEC, true, -1); } -void vpaddsb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEC, true, -1); } -void vpaddsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xED, true, -1); } -void vpaddsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xED, true, -1); } -void vpaddusb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDC, true, -1); } -void vpaddusb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDC, true, -1); } -void vpaddusw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDD, true, -1); } -void vpaddusw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDD, true, -1); } -void vpalignr(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x0F, true, -1); db(imm); } -void vpalignr(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F3A | PP_66, 0x0F, true, -1); db(imm); } -void vpand(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDB, true, -1); } -void vpand(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDB, true, -1); } -void vpandn(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDF, true, -1); } -void vpandn(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDF, true, -1); } -void vpavgb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE0, true, -1); } -void vpavgb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE0, true, -1); } -void vpavgw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE3, true, -1); } -void vpavgw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE3, true, -1); } -void vpcmpeqb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x74, true, -1); } -void vpcmpeqb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x74, true, -1); } -void vpcmpeqw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x75, true, -1); } -void vpcmpeqw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x75, true, -1); } -void vpcmpeqd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x76, true, -1); } -void vpcmpeqd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x76, true, -1); } -void vpcmpeqq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x29, true, -1); } -void vpcmpeqq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x29, true, -1); } -void vpcmpgtb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x64, true, -1); } -void vpcmpgtb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x64, true, -1); } -void vpcmpgtw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x65, true, -1); } -void vpcmpgtw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x65, true, -1); } -void vpcmpgtd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x66, true, -1); } -void vpcmpgtd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x66, true, -1); } -void vpcmpgtq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x37, true, -1); } -void vpcmpgtq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x37, true, -1); } -void vphaddw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x01, true, -1); } -void vphaddw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x01, true, -1); } -void vphaddd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x02, true, -1); } -void vphaddd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x02, true, -1); } -void vphaddsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x03, true, -1); } -void vphaddsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x03, true, -1); } -void vphsubw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x05, true, -1); } -void vphsubw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x05, true, -1); } -void vphsubd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x06, true, -1); } -void vphsubd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x06, true, -1); } -void vphsubsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x07, true, -1); } -void vphsubsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x07, true, -1); } -void vpmaddwd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF5, true, -1); } -void vpmaddwd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF5, true, -1); } -void vpmaddubsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x04, true, -1); } -void vpmaddubsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x04, true, -1); } -void vpmaxsb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3C, true, -1); } -void vpmaxsb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3C, true, -1); } -void vpmaxsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEE, true, -1); } -void vpmaxsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEE, true, -1); } -void vpmaxsd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3D, true, -1); } -void vpmaxsd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3D, true, -1); } -void vpmaxub(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDE, true, -1); } -void vpmaxub(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDE, true, -1); } -void vpmaxuw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3E, true, -1); } -void vpmaxuw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3E, true, -1); } -void vpmaxud(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3F, true, -1); } -void vpmaxud(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3F, true, -1); } -void vpminsb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x38, true, -1); } -void vpminsb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x38, true, -1); } -void vpminsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEA, true, -1); } -void vpminsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEA, true, -1); } -void vpminsd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x39, true, -1); } -void vpminsd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x39, true, -1); } -void vpminub(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xDA, true, -1); } -void vpminub(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xDA, true, -1); } -void vpminuw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3A, true, -1); } -void vpminuw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3A, true, -1); } -void vpminud(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x3B, true, -1); } -void vpminud(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x3B, true, -1); } -void vpmulhuw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE4, true, -1); } -void vpmulhuw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE4, true, -1); } -void vpmulhrsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x0B, true, -1); } -void vpmulhrsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x0B, true, -1); } -void vpmulhw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE5, true, -1); } -void vpmulhw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE5, true, -1); } -void vpmullw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD5, true, -1); } -void vpmullw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD5, true, -1); } -void vpmulld(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x40, true, -1); } -void vpmulld(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x40, true, -1); } -void vpmuludq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF4, false, -1); } -void vpmuludq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF4, false, -1); } -void vpmuldq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x28, true, -1); } -void vpmuldq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x28, true, -1); } -void vpor(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEB, true, -1); } -void vpor(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEB, true, -1); } -void vpsadbw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF6, true, -1); } -void vpsadbw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF6, true, -1); } -void vpshufb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x00, true, -1); } -void vpsignb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x08, true, -1); } -void vpsignb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x08, true, -1); } -void vpsignw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x09, true, -1); } -void vpsignw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x09, true, -1); } -void vpsignd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F38 | PP_66, 0x0A, true, -1); } -void vpsignd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F38 | PP_66, 0x0A, true, -1); } -void vpsllw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF1, true, -1); } -void vpsllw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF1, true, -1); } -void vpslld(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF2, true, -1); } -void vpslld(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF2, true, -1); } -void vpsllq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF3, true, -1); } -void vpsllq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF3, true, -1); } -void vpsraw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE1, true, -1); } -void vpsraw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE1, true, -1); } -void vpsrad(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE2, true, -1); } -void vpsrad(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE2, true, -1); } -void vpsrlw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD1, true, -1); } -void vpsrlw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD1, true, -1); } -void vpsrld(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD2, true, -1); } -void vpsrld(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD2, true, -1); } -void vpsrlq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD3, true, -1); } -void vpsrlq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD3, true, -1); } -void vpsubb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF8, true, -1); } -void vpsubb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF8, true, -1); } -void vpsubw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xF9, true, -1); } -void vpsubw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xF9, true, -1); } -void vpsubd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFA, true, -1); } -void vpsubd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFA, true, -1); } -void vpsubq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xFB, true, -1); } -void vpsubq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xFB, true, -1); } -void vpsubsb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE8, true, -1); } -void vpsubsb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE8, true, -1); } -void vpsubsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xE9, true, -1); } -void vpsubsw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xE9, true, -1); } -void vpsubusb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD8, true, -1); } -void vpsubusb(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD8, true, -1); } -void vpsubusw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xD9, true, -1); } -void vpsubusw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xD9, true, -1); } -void vpunpckhbw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x68, true, -1); } -void vpunpckhbw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x68, true, -1); } -void vpunpckhwd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x69, true, -1); } -void vpunpckhwd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x69, true, -1); } -void vpunpckhdq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x6A, true, -1); } -void vpunpckhdq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x6A, true, -1); } -void vpunpckhqdq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x6D, true, -1); } -void vpunpckhqdq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x6D, true, -1); } -void vpunpcklbw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x60, true, -1); } -void vpunpcklbw(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x60, true, -1); } -void vpunpcklwd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x61, true, -1); } -void vpunpcklwd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x61, true, -1); } -void vpunpckldq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x62, true, -1); } -void vpunpckldq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x62, true, -1); } -void vpunpcklqdq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x6C, true, -1); } -void vpunpcklqdq(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x6C, true, -1); } -void vpxor(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xEF, true, -1); } -void vpxor(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xEF, true, -1); } -void vrcpss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x53, false, -1); } -void vrcpss(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0x53, false, -1); } -void vrsqrtss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x52, false, -1); } -void vrsqrtss(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0x52, false, -1); } -void vshufpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0xC6, true, -1); db(imm); } -void vshufpd(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0xC6, true, -1); db(imm); } -void vshufps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, MM_0F, 0xC6, true, -1); db(imm); } -void vshufps(const Xmm& xmm, const Operand& op, uint8 imm) { opAVX_X_X_XM(xmm, xmm, op, MM_0F, 0xC6, true, -1); db(imm); } -void vsqrtsd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F2, 0x51, false, -1); } -void vsqrtsd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F2, 0x51, false, -1); } -void vsqrtss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x51, false, -1); } -void vsqrtss(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_F3, 0x51, false, -1); } -void vunpckhpd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x15, true, -1); } -void vunpckhpd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x15, true, -1); } -void vunpckhps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F, 0x15, true, -1); } -void vunpckhps(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F, 0x15, true, -1); } -void vunpcklpd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F | PP_66, 0x14, true, -1); } -void vunpcklpd(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F | PP_66, 0x14, true, -1); } -void vunpcklps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, MM_0F, 0x14, true, -1); } -void vunpcklps(const Xmm& xmm, const Operand& op) { opAVX_X_X_XM(xmm, xmm, op, MM_0F, 0x14, true, -1); } -void vaeskeygenassist(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0xDF, false, 0, imm); } -void vroundpd(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x09, true, 0, imm); } -void vroundps(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x08, true, 0, imm); } -void vpermilpd(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x05, true, 0, imm); } -void vpermilps(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x04, true, 0, imm); } -void vpcmpestri(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x61, false, 0, imm); } -void vpcmpestrm(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x60, false, 0, imm); } -void vpcmpistri(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x63, false, 0, imm); } -void vpcmpistrm(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F3A | PP_66, 0x62, false, 0, imm); } -void vtestps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x0E, true, 0); } -void vtestpd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x0F, true, 0); } -void vcomisd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x2F, false, -1); } -void vcomiss(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x2F, false, -1); } -void vcvtdq2ps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x5B, true, -1); } -void vcvtps2dq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x5B, true, -1); } -void vcvttps2dq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x5B, true, -1); } -void vmovapd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x28, true, -1); } -void vmovaps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x28, true, -1); } -void vmovddup(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F2, 0x12, true, -1); } -void vmovdqa(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x6F, true, -1); } -void vmovdqu(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x6F, true, -1); } -void vmovshdup(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x16, true, -1); } -void vmovsldup(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x12, true, -1); } -void vmovupd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x10, true, -1); } -void vmovups(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x10, true, -1); } -void vpabsb(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x1C, true, -1); } -void vpabsw(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x1D, true, -1); } -void vpabsd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x1E, true, -1); } -void vphminposuw(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x41, false, -1); } -void vpmovsxbw(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x20, true, -1); } -void vpmovsxbd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x21, true, -1); } -void vpmovsxbq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x22, true, -1); } -void vpmovsxwd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x23, true, -1); } -void vpmovsxwq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x24, true, -1); } -void vpmovsxdq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x25, true, -1); } -void vpmovzxbw(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x30, true, -1); } -void vpmovzxbd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x31, true, -1); } -void vpmovzxbq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x32, true, -1); } -void vpmovzxwd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x33, true, -1); } -void vpmovzxwq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x34, true, -1); } -void vpmovzxdq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x35, true, -1); } -void vpshufd(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x70, true, -1, imm); } -void vpshufhw(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F3, 0x70, true, -1, imm); } -void vpshuflw(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_F2, 0x70, true, -1, imm); } -void vptest(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F38 | PP_66, 0x17, false, -1); } -void vrcpps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x53, true, -1); } -void vrsqrtps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x52, true, -1); } -void vsqrtpd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x51, true, -1); } -void vsqrtps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x51, true, -1); } -void vucomisd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F | PP_66, 0x2E, false, -1); } -void vucomiss(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, MM_0F, 0x2E, false, -1); } -void vmovapd(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F | PP_66, 0x29, true, -1); } -void vmovaps(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F, 0x29, true, -1); } -void vmovdqa(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F | PP_66, 0x7F, true, -1); } -void vmovdqu(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F | PP_F3, 0x7F, true, -1); } -void vmovupd(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F | PP_66, 0x11, true, -1); } -void vmovups(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, MM_0F, 0x11, true, -1); } -void vaddsubpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0xD0, true, -1); } -void vaddsubps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0xD0, true, -1); } -void vhaddpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x7C, true, -1); } -void vhaddps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x7C, true, -1); } -void vhsubpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_66, 0x7D, true, -1); } -void vhsubps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F | PP_F2, 0x7D, true, -1); } -void vaesenc(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xDC, false, 0); } -void vaesenclast(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xDD, false, 0); } -void vaesdec(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xDE, false, 0); } -void vaesdeclast(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xDF, false, 0); } -void vmaskmovps(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, MM_0F38 | PP_66, 0x2C, true, 0); } -void vmaskmovps(const Address& addr, const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x2, x1, addr, MM_0F38 | PP_66, 0x2E, true, 0); } -void vmaskmovpd(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, MM_0F38 | PP_66, 0x2D, true, 0); } -void vmaskmovpd(const Address& addr, const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x2, x1, addr, MM_0F38 | PP_66, 0x2F, true, 0); } -void vpmaskmovd(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, MM_0F38 | PP_66, 0x8C, true, 0); } -void vpmaskmovd(const Address& addr, const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x2, x1, addr, MM_0F38 | PP_66, 0x8E, true, 0); } -void vpmaskmovq(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, MM_0F38 | PP_66, 0x8C, true, 1); } -void vpmaskmovq(const Address& addr, const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x2, x1, addr, MM_0F38 | PP_66, 0x8E, true, 1); } -void vpermd(const Ymm& y1, const Ymm& y2, const Operand& op) { opAVX_X_X_XM(y1, y2, op, MM_0F38 | PP_66, 0x36, true, 0); } -void vpermps(const Ymm& y1, const Ymm& y2, const Operand& op) { opAVX_X_X_XM(y1, y2, op, MM_0F38 | PP_66, 0x16, true, 0); } -void vpermq(const Ymm& y, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(y, op, MM_0F3A | PP_66, 0x00, true, 1, imm); } -void vpermpd(const Ymm& y, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(y, op, MM_0F3A | PP_66, 0x01, true, 1, imm); } -void cmpeqpd(const Xmm& x, const Operand& op) { cmppd(x, op, 0); } -void vcmpeqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 0); } -void vcmpeqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 0); } -void cmpltpd(const Xmm& x, const Operand& op) { cmppd(x, op, 1); } -void vcmpltpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 1); } -void vcmpltpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 1); } -void cmplepd(const Xmm& x, const Operand& op) { cmppd(x, op, 2); } -void vcmplepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 2); } -void vcmplepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 2); } -void cmpunordpd(const Xmm& x, const Operand& op) { cmppd(x, op, 3); } -void vcmpunordpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 3); } -void vcmpunordpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 3); } -void cmpneqpd(const Xmm& x, const Operand& op) { cmppd(x, op, 4); } -void vcmpneqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 4); } -void vcmpneqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 4); } -void cmpnltpd(const Xmm& x, const Operand& op) { cmppd(x, op, 5); } -void vcmpnltpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 5); } -void vcmpnltpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 5); } -void cmpnlepd(const Xmm& x, const Operand& op) { cmppd(x, op, 6); } -void vcmpnlepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 6); } -void vcmpnlepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 6); } -void cmpordpd(const Xmm& x, const Operand& op) { cmppd(x, op, 7); } -void vcmpordpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 7); } -void vcmpordpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 7); } -void vcmpeq_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 8); } -void vcmpeq_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 8); } -void vcmpngepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 9); } -void vcmpngepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 9); } -void vcmpngtpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 10); } -void vcmpngtpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 10); } -void vcmpfalsepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 11); } -void vcmpfalsepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 11); } -void vcmpneq_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 12); } -void vcmpneq_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 12); } -void vcmpgepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 13); } -void vcmpgepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 13); } -void vcmpgtpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 14); } -void vcmpgtpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 14); } -void vcmptruepd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 15); } -void vcmptruepd(const Xmm& x, const Operand& op) { vcmppd(x, op, 15); } -void vcmpeq_ospd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 16); } -void vcmpeq_ospd(const Xmm& x, const Operand& op) { vcmppd(x, op, 16); } -void vcmplt_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 17); } -void vcmplt_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 17); } -void vcmple_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 18); } -void vcmple_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 18); } -void vcmpunord_spd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 19); } -void vcmpunord_spd(const Xmm& x, const Operand& op) { vcmppd(x, op, 19); } -void vcmpneq_uspd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 20); } -void vcmpneq_uspd(const Xmm& x, const Operand& op) { vcmppd(x, op, 20); } -void vcmpnlt_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 21); } -void vcmpnlt_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 21); } -void vcmpnle_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 22); } -void vcmpnle_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 22); } -void vcmpord_spd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 23); } -void vcmpord_spd(const Xmm& x, const Operand& op) { vcmppd(x, op, 23); } -void vcmpeq_uspd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 24); } -void vcmpeq_uspd(const Xmm& x, const Operand& op) { vcmppd(x, op, 24); } -void vcmpnge_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 25); } -void vcmpnge_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 25); } -void vcmpngt_uqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 26); } -void vcmpngt_uqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 26); } -void vcmpfalse_ospd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 27); } -void vcmpfalse_ospd(const Xmm& x, const Operand& op) { vcmppd(x, op, 27); } -void vcmpneq_ospd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 28); } -void vcmpneq_ospd(const Xmm& x, const Operand& op) { vcmppd(x, op, 28); } -void vcmpge_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 29); } -void vcmpge_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 29); } -void vcmpgt_oqpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 30); } -void vcmpgt_oqpd(const Xmm& x, const Operand& op) { vcmppd(x, op, 30); } -void vcmptrue_uspd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 31); } -void vcmptrue_uspd(const Xmm& x, const Operand& op) { vcmppd(x, op, 31); } -void cmpeqps(const Xmm& x, const Operand& op) { cmpps(x, op, 0); } -void vcmpeqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 0); } -void vcmpeqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 0); } -void cmpltps(const Xmm& x, const Operand& op) { cmpps(x, op, 1); } -void vcmpltps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 1); } -void vcmpltps(const Xmm& x, const Operand& op) { vcmpps(x, op, 1); } -void cmpleps(const Xmm& x, const Operand& op) { cmpps(x, op, 2); } -void vcmpleps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 2); } -void vcmpleps(const Xmm& x, const Operand& op) { vcmpps(x, op, 2); } -void cmpunordps(const Xmm& x, const Operand& op) { cmpps(x, op, 3); } -void vcmpunordps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 3); } -void vcmpunordps(const Xmm& x, const Operand& op) { vcmpps(x, op, 3); } -void cmpneqps(const Xmm& x, const Operand& op) { cmpps(x, op, 4); } -void vcmpneqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 4); } -void vcmpneqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 4); } -void cmpnltps(const Xmm& x, const Operand& op) { cmpps(x, op, 5); } -void vcmpnltps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 5); } -void vcmpnltps(const Xmm& x, const Operand& op) { vcmpps(x, op, 5); } -void cmpnleps(const Xmm& x, const Operand& op) { cmpps(x, op, 6); } -void vcmpnleps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 6); } -void vcmpnleps(const Xmm& x, const Operand& op) { vcmpps(x, op, 6); } -void cmpordps(const Xmm& x, const Operand& op) { cmpps(x, op, 7); } -void vcmpordps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 7); } -void vcmpordps(const Xmm& x, const Operand& op) { vcmpps(x, op, 7); } -void vcmpeq_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 8); } -void vcmpeq_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 8); } -void vcmpngeps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 9); } -void vcmpngeps(const Xmm& x, const Operand& op) { vcmpps(x, op, 9); } -void vcmpngtps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 10); } -void vcmpngtps(const Xmm& x, const Operand& op) { vcmpps(x, op, 10); } -void vcmpfalseps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 11); } -void vcmpfalseps(const Xmm& x, const Operand& op) { vcmpps(x, op, 11); } -void vcmpneq_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 12); } -void vcmpneq_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 12); } -void vcmpgeps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 13); } -void vcmpgeps(const Xmm& x, const Operand& op) { vcmpps(x, op, 13); } -void vcmpgtps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 14); } -void vcmpgtps(const Xmm& x, const Operand& op) { vcmpps(x, op, 14); } -void vcmptrueps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 15); } -void vcmptrueps(const Xmm& x, const Operand& op) { vcmpps(x, op, 15); } -void vcmpeq_osps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 16); } -void vcmpeq_osps(const Xmm& x, const Operand& op) { vcmpps(x, op, 16); } -void vcmplt_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 17); } -void vcmplt_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 17); } -void vcmple_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 18); } -void vcmple_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 18); } -void vcmpunord_sps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 19); } -void vcmpunord_sps(const Xmm& x, const Operand& op) { vcmpps(x, op, 19); } -void vcmpneq_usps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 20); } -void vcmpneq_usps(const Xmm& x, const Operand& op) { vcmpps(x, op, 20); } -void vcmpnlt_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 21); } -void vcmpnlt_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 21); } -void vcmpnle_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 22); } -void vcmpnle_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 22); } -void vcmpord_sps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 23); } -void vcmpord_sps(const Xmm& x, const Operand& op) { vcmpps(x, op, 23); } -void vcmpeq_usps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 24); } -void vcmpeq_usps(const Xmm& x, const Operand& op) { vcmpps(x, op, 24); } -void vcmpnge_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 25); } -void vcmpnge_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 25); } -void vcmpngt_uqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 26); } -void vcmpngt_uqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 26); } -void vcmpfalse_osps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 27); } -void vcmpfalse_osps(const Xmm& x, const Operand& op) { vcmpps(x, op, 27); } -void vcmpneq_osps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 28); } -void vcmpneq_osps(const Xmm& x, const Operand& op) { vcmpps(x, op, 28); } -void vcmpge_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 29); } -void vcmpge_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 29); } -void vcmpgt_oqps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 30); } -void vcmpgt_oqps(const Xmm& x, const Operand& op) { vcmpps(x, op, 30); } -void vcmptrue_usps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 31); } -void vcmptrue_usps(const Xmm& x, const Operand& op) { vcmpps(x, op, 31); } -void cmpeqsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 0); } -void vcmpeqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 0); } -void vcmpeqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 0); } -void cmpltsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 1); } -void vcmpltsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 1); } -void vcmpltsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 1); } -void cmplesd(const Xmm& x, const Operand& op) { cmpsd(x, op, 2); } -void vcmplesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 2); } -void vcmplesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 2); } -void cmpunordsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 3); } -void vcmpunordsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 3); } -void vcmpunordsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 3); } -void cmpneqsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 4); } -void vcmpneqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 4); } -void vcmpneqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 4); } -void cmpnltsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 5); } -void vcmpnltsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 5); } -void vcmpnltsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 5); } -void cmpnlesd(const Xmm& x, const Operand& op) { cmpsd(x, op, 6); } -void vcmpnlesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 6); } -void vcmpnlesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 6); } -void cmpordsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 7); } -void vcmpordsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 7); } -void vcmpordsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 7); } -void vcmpeq_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 8); } -void vcmpeq_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 8); } -void vcmpngesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 9); } -void vcmpngesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 9); } -void vcmpngtsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 10); } -void vcmpngtsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 10); } -void vcmpfalsesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 11); } -void vcmpfalsesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 11); } -void vcmpneq_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 12); } -void vcmpneq_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 12); } -void vcmpgesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 13); } -void vcmpgesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 13); } -void vcmpgtsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 14); } -void vcmpgtsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 14); } -void vcmptruesd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 15); } -void vcmptruesd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 15); } -void vcmpeq_ossd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 16); } -void vcmpeq_ossd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 16); } -void vcmplt_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 17); } -void vcmplt_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 17); } -void vcmple_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 18); } -void vcmple_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 18); } -void vcmpunord_ssd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 19); } -void vcmpunord_ssd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 19); } -void vcmpneq_ussd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 20); } -void vcmpneq_ussd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 20); } -void vcmpnlt_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 21); } -void vcmpnlt_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 21); } -void vcmpnle_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 22); } -void vcmpnle_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 22); } -void vcmpord_ssd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 23); } -void vcmpord_ssd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 23); } -void vcmpeq_ussd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 24); } -void vcmpeq_ussd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 24); } -void vcmpnge_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 25); } -void vcmpnge_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 25); } -void vcmpngt_uqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 26); } -void vcmpngt_uqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 26); } -void vcmpfalse_ossd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 27); } -void vcmpfalse_ossd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 27); } -void vcmpneq_ossd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 28); } -void vcmpneq_ossd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 28); } -void vcmpge_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 29); } -void vcmpge_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 29); } -void vcmpgt_oqsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 30); } -void vcmpgt_oqsd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 30); } -void vcmptrue_ussd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 31); } -void vcmptrue_ussd(const Xmm& x, const Operand& op) { vcmpsd(x, op, 31); } -void cmpeqss(const Xmm& x, const Operand& op) { cmpss(x, op, 0); } -void vcmpeqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 0); } -void vcmpeqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 0); } -void cmpltss(const Xmm& x, const Operand& op) { cmpss(x, op, 1); } -void vcmpltss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 1); } -void vcmpltss(const Xmm& x, const Operand& op) { vcmpss(x, op, 1); } -void cmpless(const Xmm& x, const Operand& op) { cmpss(x, op, 2); } -void vcmpless(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 2); } -void vcmpless(const Xmm& x, const Operand& op) { vcmpss(x, op, 2); } -void cmpunordss(const Xmm& x, const Operand& op) { cmpss(x, op, 3); } -void vcmpunordss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 3); } -void vcmpunordss(const Xmm& x, const Operand& op) { vcmpss(x, op, 3); } -void cmpneqss(const Xmm& x, const Operand& op) { cmpss(x, op, 4); } -void vcmpneqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 4); } -void vcmpneqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 4); } -void cmpnltss(const Xmm& x, const Operand& op) { cmpss(x, op, 5); } -void vcmpnltss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 5); } -void vcmpnltss(const Xmm& x, const Operand& op) { vcmpss(x, op, 5); } -void cmpnless(const Xmm& x, const Operand& op) { cmpss(x, op, 6); } -void vcmpnless(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 6); } -void vcmpnless(const Xmm& x, const Operand& op) { vcmpss(x, op, 6); } -void cmpordss(const Xmm& x, const Operand& op) { cmpss(x, op, 7); } -void vcmpordss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 7); } -void vcmpordss(const Xmm& x, const Operand& op) { vcmpss(x, op, 7); } -void vcmpeq_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 8); } -void vcmpeq_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 8); } -void vcmpngess(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 9); } -void vcmpngess(const Xmm& x, const Operand& op) { vcmpss(x, op, 9); } -void vcmpngtss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 10); } -void vcmpngtss(const Xmm& x, const Operand& op) { vcmpss(x, op, 10); } -void vcmpfalsess(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 11); } -void vcmpfalsess(const Xmm& x, const Operand& op) { vcmpss(x, op, 11); } -void vcmpneq_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 12); } -void vcmpneq_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 12); } -void vcmpgess(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 13); } -void vcmpgess(const Xmm& x, const Operand& op) { vcmpss(x, op, 13); } -void vcmpgtss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 14); } -void vcmpgtss(const Xmm& x, const Operand& op) { vcmpss(x, op, 14); } -void vcmptruess(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 15); } -void vcmptruess(const Xmm& x, const Operand& op) { vcmpss(x, op, 15); } -void vcmpeq_osss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 16); } -void vcmpeq_osss(const Xmm& x, const Operand& op) { vcmpss(x, op, 16); } -void vcmplt_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 17); } -void vcmplt_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 17); } -void vcmple_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 18); } -void vcmple_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 18); } -void vcmpunord_sss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 19); } -void vcmpunord_sss(const Xmm& x, const Operand& op) { vcmpss(x, op, 19); } -void vcmpneq_usss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 20); } -void vcmpneq_usss(const Xmm& x, const Operand& op) { vcmpss(x, op, 20); } -void vcmpnlt_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 21); } -void vcmpnlt_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 21); } -void vcmpnle_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 22); } -void vcmpnle_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 22); } -void vcmpord_sss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 23); } -void vcmpord_sss(const Xmm& x, const Operand& op) { vcmpss(x, op, 23); } -void vcmpeq_usss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 24); } -void vcmpeq_usss(const Xmm& x, const Operand& op) { vcmpss(x, op, 24); } -void vcmpnge_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 25); } -void vcmpnge_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 25); } -void vcmpngt_uqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 26); } -void vcmpngt_uqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 26); } -void vcmpfalse_osss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 27); } -void vcmpfalse_osss(const Xmm& x, const Operand& op) { vcmpss(x, op, 27); } -void vcmpneq_osss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 28); } -void vcmpneq_osss(const Xmm& x, const Operand& op) { vcmpss(x, op, 28); } -void vcmpge_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 29); } -void vcmpge_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 29); } -void vcmpgt_oqss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 30); } -void vcmpgt_oqss(const Xmm& x, const Operand& op) { vcmpss(x, op, 30); } -void vcmptrue_usss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 31); } -void vcmptrue_usss(const Xmm& x, const Operand& op) { vcmpss(x, op, 31); } -void vmovhpd(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !op2.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x, op1, op2, MM_0F | PP_66, 0x16, false); } -void vmovhpd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0x17, false); } -void vmovhps(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !op2.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x, op1, op2, MM_0F, 0x16, false); } -void vmovhps(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F, 0x17, false); } -void vmovlpd(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !op2.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x, op1, op2, MM_0F | PP_66, 0x12, false); } -void vmovlpd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0x13, false); } -void vmovlps(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !op2.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x, op1, op2, MM_0F, 0x12, false); } -void vmovlps(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F, 0x13, false); } -void vfmadd132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x98, true, 1); } -void vfmadd213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA8, true, 1); } -void vfmadd231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB8, true, 1); } -void vfmadd132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x98, true, 0); } -void vfmadd213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA8, true, 0); } -void vfmadd231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB8, true, 0); } -void vfmadd132sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x99, false, 1); } -void vfmadd213sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA9, false, 1); } -void vfmadd231sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB9, false, 1); } -void vfmadd132ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x99, false, 0); } -void vfmadd213ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA9, false, 0); } -void vfmadd231ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB9, false, 0); } -void vfmaddsub132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x96, true, 1); } -void vfmaddsub213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA6, true, 1); } -void vfmaddsub231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB6, true, 1); } -void vfmaddsub132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x96, true, 0); } -void vfmaddsub213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA6, true, 0); } -void vfmaddsub231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB6, true, 0); } -void vfmsubadd132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x97, true, 1); } -void vfmsubadd213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA7, true, 1); } -void vfmsubadd231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB7, true, 1); } -void vfmsubadd132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x97, true, 0); } -void vfmsubadd213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xA7, true, 0); } -void vfmsubadd231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xB7, true, 0); } -void vfmsub132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9A, true, 1); } -void vfmsub213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAA, true, 1); } -void vfmsub231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBA, true, 1); } -void vfmsub132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9A, true, 0); } -void vfmsub213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAA, true, 0); } -void vfmsub231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBA, true, 0); } -void vfmsub132sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9B, false, 1); } -void vfmsub213sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAB, false, 1); } -void vfmsub231sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBB, false, 1); } -void vfmsub132ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9B, false, 0); } -void vfmsub213ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAB, false, 0); } -void vfmsub231ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBB, false, 0); } -void vfnmadd132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9C, true, 1); } -void vfnmadd213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAC, true, 1); } -void vfnmadd231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBC, true, 1); } -void vfnmadd132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9C, true, 0); } -void vfnmadd213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAC, true, 0); } -void vfnmadd231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBC, true, 0); } -void vfnmadd132sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9D, false, 1); } -void vfnmadd213sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAD, false, 1); } -void vfnmadd231sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBD, false, 1); } -void vfnmadd132ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9D, false, 0); } -void vfnmadd213ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAD, false, 0); } -void vfnmadd231ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBD, false, 0); } -void vfnmsub132pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9E, true, 1); } -void vfnmsub213pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAE, true, 1); } -void vfnmsub231pd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBE, true, 1); } -void vfnmsub132ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9E, true, 0); } -void vfnmsub213ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAE, true, 0); } -void vfnmsub231ps(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBE, true, 0); } -void vfnmsub132sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9F, false, 1); } -void vfnmsub213sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAF, false, 1); } -void vfnmsub231sd(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBF, false, 1); } -void vfnmsub132ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0x9F, false, 0); } -void vfnmsub213ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xAF, false, 0); } -void vfnmsub231ss(const Xmm& xmm, const Xmm& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, MM_0F38 | PP_66, 0xBF, false, 0); } -void vaesimc(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0xDB, false, 0); } -void vbroadcastf128(const Ymm& y, const Address& addr) { opAVX_X_XM_IMM(y, addr, MM_0F38 | PP_66, 0x1A, true, 0); } -void vbroadcasti128(const Ymm& y, const Address& addr) { opAVX_X_XM_IMM(y, addr, MM_0F38 | PP_66, 0x5A, true, 0); } -void vbroadcastsd(const Ymm& y, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(y, op, MM_0F38 | PP_66, 0x19, true, 0); } -void vbroadcastss(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x18, true, 0); } -void vpbroadcastb(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x78, true, 0); } -void vpbroadcastw(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x79, true, 0); } -void vpbroadcastd(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x58, true, 0); } -void vpbroadcastq(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_XM_IMM(x, op, MM_0F38 | PP_66, 0x59, true, 0); } -void vextractf128(const Operand& op, const Ymm& y, uint8 imm) { opAVX_X_X_XMcvt(y, y.isXMM() ? xm0 : ym0, op, op.isXMM(), Operand::YMM, MM_0F3A | PP_66, 0x19, true, 0); db(imm); } -void vextracti128(const Operand& op, const Ymm& y, uint8 imm) { opAVX_X_X_XMcvt(y, y.isXMM() ? xm0 : ym0, op, op.isXMM(), Operand::YMM, MM_0F3A | PP_66, 0x39, true, 0); db(imm); } -void vextractps(const Operand& op, const Xmm& x, uint8 imm) { if (!(op.isREG(32) || op.isMEM()) || x.isYMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x.isXMM() ? xm0 : ym0, op, op.isREG(), Operand::XMM, MM_0F3A | PP_66, 0x17, false, 0); db(imm); } -void vinsertf128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XMcvt(y1, y2, op, op.isXMM(), Operand::YMM, MM_0F3A | PP_66, 0x18, true, 0); db(imm); } -void vinserti128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XMcvt(y1, y2, op, op.isXMM(), Operand::YMM, MM_0F3A | PP_66, 0x38, true, 0); db(imm); } -void vperm2f128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, MM_0F3A | PP_66, 0x06, true, 0); db(imm); } -void vperm2i128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, MM_0F3A | PP_66, 0x46, true, 0); db(imm); } -void vlddqu(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, addr, MM_0F | PP_F2, 0xF0, true, 0); } -void vldmxcsr(const Address& addr) { opAVX_X_X_XM(xm2, xm0, addr, MM_0F, 0xAE, false, -1); } -void vstmxcsr(const Address& addr) { opAVX_X_X_XM(xm3, xm0, addr, MM_0F, 0xAE, false, -1); } -void vmaskmovdqu(const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x1, xm0, x2, MM_0F | PP_66, 0xF7, false, -1); } -void vpextrb(const Operand& op, const Xmm& x, uint8 imm) { if (!op.isREG(i32e) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, xm0, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x14, false); db(imm); } -void vpextrw(const Reg& r, const Xmm& x, uint8 imm) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, x, MM_0F | PP_66, 0xC5, false, r.isBit(64) ? 1 : 0); db(imm); } -void vpextrw(const Address& addr, const Xmm& x, uint8 imm) { opAVX_X_X_XM(x, xm0, addr, MM_0F3A | PP_66, 0x15, false); db(imm); } -void vpextrd(const Operand& op, const Xmm& x, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, xm0, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x16, false, 0); db(imm); } -void vpinsrb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x1, x2, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x20, false); db(imm); } -void vpinsrb(const Xmm& x, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x20, false); db(imm); } -void vpinsrw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x1, x2, op, !op.isMEM(), Operand::XMM, MM_0F | PP_66, 0xC4, false); db(imm); } -void vpinsrw(const Xmm& x, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x, op, !op.isMEM(), Operand::XMM, MM_0F | PP_66, 0xC4, false); db(imm); } -void vpinsrd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x1, x2, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x22, false, 0); db(imm); } -void vpinsrd(const Xmm& x, const Operand& op, uint8 imm) { if (!op.isREG(32) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x22, false, 0); db(imm); } -void vpmovmskb(const Reg32e& r, const Xmm& x) { bool isYMM= x.isYMM(); opAVX_X_X_XM(isYMM ? Ymm(r.getIdx()) : Xmm(r.getIdx()), isYMM ? ym0 : xm0, x, MM_0F | PP_66, 0xD7, true); } -void vpslldq(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym7 : xm7, x1, x2, MM_0F | PP_66, 0x73, true); db(imm); } -void vpslldq(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym7 : xm7, x, x, MM_0F | PP_66, 0x73, true); db(imm); } -void vpsrldq(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym3 : xm3, x1, x2, MM_0F | PP_66, 0x73, true); db(imm); } -void vpsrldq(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym3 : xm3, x, x, MM_0F | PP_66, 0x73, true); db(imm); } -void vpsllw(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym6 : xm6, x1, x2, MM_0F | PP_66, 0x71, true); db(imm); } -void vpsllw(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym6 : xm6, x, x, MM_0F | PP_66, 0x71, true); db(imm); } -void vpslld(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym6 : xm6, x1, x2, MM_0F | PP_66, 0x72, true); db(imm); } -void vpslld(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym6 : xm6, x, x, MM_0F | PP_66, 0x72, true); db(imm); } -void vpsllq(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym6 : xm6, x1, x2, MM_0F | PP_66, 0x73, true); db(imm); } -void vpsllq(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym6 : xm6, x, x, MM_0F | PP_66, 0x73, true); db(imm); } -void vpsraw(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym4 : xm4, x1, x2, MM_0F | PP_66, 0x71, true); db(imm); } -void vpsraw(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym4 : xm4, x, x, MM_0F | PP_66, 0x71, true); db(imm); } -void vpsrad(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym4 : xm4, x1, x2, MM_0F | PP_66, 0x72, true); db(imm); } -void vpsrad(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym4 : xm4, x, x, MM_0F | PP_66, 0x72, true); db(imm); } -void vpsrlw(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym2 : xm2, x1, x2, MM_0F | PP_66, 0x71, true); db(imm); } -void vpsrlw(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym2 : xm2, x, x, MM_0F | PP_66, 0x71, true); db(imm); } -void vpsrld(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym2 : xm2, x1, x2, MM_0F | PP_66, 0x72, true); db(imm); } -void vpsrld(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym2 : xm2, x, x, MM_0F | PP_66, 0x72, true); db(imm); } -void vpsrlq(const Xmm& x1, const Xmm& x2, uint8 imm) { opAVX_X_X_XM(x1.isYMM() ? ym2 : xm2, x1, x2, MM_0F | PP_66, 0x73, true); db(imm); } -void vpsrlq(const Xmm& x, uint8 imm) { opAVX_X_X_XM(x.isYMM() ? ym2 : xm2, x, x, MM_0F | PP_66, 0x73, true); db(imm); } -void vblendvpd(const Xmm& x1, const Xmm& x2, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x4B, true); db(x4.getIdx() << 4); } -void vblendvpd(const Xmm& x1, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x1, op, MM_0F3A | PP_66, 0x4B, true); db(x4.getIdx() << 4); } -void vblendvps(const Xmm& x1, const Xmm& x2, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x4A, true); db(x4.getIdx() << 4); } -void vblendvps(const Xmm& x1, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x1, op, MM_0F3A | PP_66, 0x4A, true); db(x4.getIdx() << 4); } -void vpblendvb(const Xmm& x1, const Xmm& x2, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x2, op, MM_0F3A | PP_66, 0x4C, false); db(x4.getIdx() << 4); } -void vpblendvb(const Xmm& x1, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x1, op, MM_0F3A | PP_66, 0x4C, false); db(x4.getIdx() << 4); } -void vmovd(const Xmm& x, const Reg32& reg) { opAVX_X_X_XM(x, xm0, Xmm(reg.getIdx()), MM_0F | PP_66, 0x6E, false, 0); } -void vmovd(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0x6E, false, 0); } -void vmovd(const Reg32& reg, const Xmm& x) { opAVX_X_X_XM(x, xm0, Xmm(reg.getIdx()), MM_0F | PP_66, 0x7E, false, 0); } -void vmovd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0x7E, false, 0); } -void vmovq(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F3, 0x7E, false, -1); } -void vmovq(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_66, 0xD6, false, -1); } -void vmovq(const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x1, xm0, x2, MM_0F | PP_F3, 0x7E, false, -1); } -void vmovhlps(const Xmm& x1, const Xmm& x2, const Operand& op = Operand()) { if (!op.isNone() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x1, x2, op, MM_0F, 0x12, false); } -void vmovlhps(const Xmm& x1, const Xmm& x2, const Operand& op = Operand()) { if (!op.isNone() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x1, x2, op, MM_0F, 0x16, false); } -void vmovmskpd(const Reg& r, const Xmm& x) { if (!r.isBit(i32e)) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x.isXMM() ? Xmm(r.getIdx()) : Ymm(r.getIdx()), x.isXMM() ? xm0 : ym0, x, MM_0F | PP_66, 0x50, true, 0); } -void vmovmskps(const Reg& r, const Xmm& x) { if (!r.isBit(i32e)) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x.isXMM() ? Xmm(r.getIdx()) : Ymm(r.getIdx()), x.isXMM() ? xm0 : ym0, x, MM_0F, 0x50, true, 0); } -void vmovntdq(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, addr, MM_0F | PP_66, 0xE7, true); } -void vmovntpd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, addr, MM_0F | PP_66, 0x2B, true); } -void vmovntps(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ym0, addr, MM_0F, 0x2B, true); } -void vmovntdqa(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, x.isXMM() ? xm0 : ymm0, addr, MM_0F38 | PP_66, 0x2A, true); } -void vmovsd(const Xmm& x1, const Xmm& x2, const Operand& op = Operand()) { if (!op.isNone() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F2, 0x10, false); } -void vmovsd(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F2, 0x10, false); } -void vmovsd(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F2, 0x11, false); } -void vmovss(const Xmm& x1, const Xmm& x2, const Operand& op = Operand()) { if (!op.isNone() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(x1, x2, op, MM_0F | PP_F3, 0x10, false); } -void vmovss(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F3, 0x10, false); } -void vmovss(const Address& addr, const Xmm& x) { opAVX_X_X_XM(x, xm0, addr, MM_0F | PP_F3, 0x11, false); } -void vcvtss2si(const Reg32& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F3, 0x2D, false, 0); } -void vcvttss2si(const Reg32& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F3, 0x2C, false, 0); } -void vcvtsd2si(const Reg32& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F2, 0x2D, false, 0); } -void vcvttsd2si(const Reg32& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F2, 0x2C, false, 0); } -void vcvtsi2ss(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !(op2.isREG(i32e) || op2.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, op1, op2, op2.isREG(), Operand::XMM, MM_0F | PP_F3, 0x2A, false, (op1.isMEM() || op2.isMEM()) ? -1 : (op1.isREG(32) || op2.isREG(32)) ? 0 : 1); } -void vcvtsi2sd(const Xmm& x, const Operand& op1, const Operand& op2 = Operand()) { if (!op2.isNone() && !(op2.isREG(i32e) || op2.isMEM())) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, op1, op2, op2.isREG(), Operand::XMM, MM_0F | PP_F2, 0x2A, false, (op1.isMEM() || op2.isMEM()) ? -1 : (op1.isREG(32) || op2.isREG(32)) ? 0 : 1); } -void vcvtps2pd(const Xmm& x, const Operand& op) { if (!op.isMEM() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x.isXMM() ? xm0 : ym0, op, !op.isMEM(), x.isXMM() ? Operand::XMM : Operand::YMM, MM_0F, 0x5A, true); } -void vcvtdq2pd(const Xmm& x, const Operand& op) { if (!op.isMEM() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x.isXMM() ? xm0 : ym0, op, !op.isMEM(), x.isXMM() ? Operand::XMM : Operand::YMM, MM_0F | PP_F3, 0xE6, true); } -void vcvtpd2ps(const Xmm& x, const Operand& op) { if (x.isYMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(op.isYMM() ? Ymm(x.getIdx()) : x, op.isYMM() ? ym0 : xm0, op, MM_0F | PP_66, 0x5A, true); } -void vcvtpd2dq(const Xmm& x, const Operand& op) { if (x.isYMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(op.isYMM() ? Ymm(x.getIdx()) : x, op.isYMM() ? ym0 : xm0, op, MM_0F | PP_F2, 0xE6, true); } -void vcvttpd2dq(const Xmm& x, const Operand& op) { if (x.isYMM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XM(op.isYMM() ? Ymm(x.getIdx()) : x, op.isYMM() ? ym0 : xm0, op, MM_0F | PP_66, 0xE6, true); } -void vcvtph2ps(const Xmm& x, const Operand& op) { if (!op.isMEM() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opVex(x, NULL, &op, MM_0F38 | PP_66, 0x13, 0); } -void vcvtps2ph(const Operand& op, const Xmm& x, uint8 imm) { if (!op.isMEM() && !op.isXMM()) throw Error(ERR_BAD_COMBINATION); opVex(x, NULL, &op, MM_0F3A | PP_66, 0x1d, 0); db(imm); } -#ifdef XBYAK64 -void vmovq(const Xmm& x, const Reg64& reg) { opAVX_X_X_XM(x, xm0, Xmm(reg.getIdx()), MM_0F | PP_66, 0x6E, false, 1); } -void vmovq(const Reg64& reg, const Xmm& x) { opAVX_X_X_XM(x, xm0, Xmm(reg.getIdx()), MM_0F | PP_66, 0x7E, false, 1); } -void vpextrq(const Operand& op, const Xmm& x, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, xm0, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x16, false, 1); db(imm); } -void vpinsrq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x1, x2, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x22, false, 1); db(imm); } -void vpinsrq(const Xmm& x, const Operand& op, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) throw Error(ERR_BAD_COMBINATION); opAVX_X_X_XMcvt(x, x, op, !op.isMEM(), Operand::XMM, MM_0F3A | PP_66, 0x22, false, 1); db(imm); } -void vcvtss2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F3, 0x2D, false, 1); } -void vcvttss2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F3, 0x2C, false, 1); } -void vcvtsd2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F2, 0x2D, false, 1); } -void vcvttsd2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, MM_0F | PP_F2, 0x2C, false, 1); } -#endif -void andn(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, MM_0F38, 0xf2, true); } -void mulx(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, MM_0F38 | PP_F2, 0xf6, true); } -void pdep(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, MM_0F38 | PP_F2, 0xf5, true); } -void pext(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, MM_0F38 | PP_F3, 0xf5, true); } -void bextr(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38, 0xf7, false); } -void bzhi(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38, 0xf5, false); } -void sarx(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38 | PP_F3, 0xf7, false); } -void shlx(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38 | PP_66, 0xf7, false); } -void shrx(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, MM_0F38 | PP_F2, 0xf7, false); } -void blsi(const Reg32e& r, const Operand& op) { opGpr(Reg32e(3, r.getBit()), op, r, MM_0F38, 0xf3, false); } -void blsmsk(const Reg32e& r, const Operand& op) { opGpr(Reg32e(2, r.getBit()), op, r, MM_0F38, 0xf3, false); } -void blsr(const Reg32e& r, const Operand& op) { opGpr(Reg32e(1, r.getBit()), op, r, MM_0F38, 0xf3, false); } -void vgatherdpd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x92, 1, 0); } -void vgatherqpd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x93, 1, 1); } -void vgatherdps(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x92, 0, 1); } -void vgatherqps(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x93, 0, 2); } -void vpgatherdd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x90, 0, 1); } -void vpgatherqd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x91, 0, 2); } -void vpgatherdq(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x90, 1, 0); } -void vpgatherqq(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, MM_0F38 | PP_66, 0x91, 1, 1); } diff --git a/jan/src/cpu/mips3/x64/xbyak/xbyak_util.h b/jan/src/cpu/mips3/x64/xbyak/xbyak_util.h deleted file mode 100644 index 166f3e346..000000000 --- a/jan/src/cpu/mips3/x64/xbyak/xbyak_util.h +++ /dev/null @@ -1,529 +0,0 @@ -#ifndef XBYAK_XBYAK_UTIL_H_ -#define XBYAK_XBYAK_UTIL_H_ - -/** - utility class and functions for Xbyak - Xbyak::util::Clock ; rdtsc timer - Xbyak::util::Cpu ; detect CPU - @note this header is UNDER CONSTRUCTION! -*/ -#include "xbyak.h" - -#ifdef _MSC_VER - #if (_MSC_VER < 1400) && defined(XBYAK32) - static inline __declspec(naked) void __cpuid(int[4], int) - { - __asm { - push ebx - push esi - mov eax, dword ptr [esp + 4 * 2 + 8] // eaxIn - cpuid - mov esi, dword ptr [esp + 4 * 2 + 4] // data - mov dword ptr [esi], eax - mov dword ptr [esi + 4], ebx - mov dword ptr [esi + 8], ecx - mov dword ptr [esi + 12], edx - pop esi - pop ebx - ret - } - } - #else - #include // for __cpuid - #endif -#else - #ifndef __GNUC_PREREQ - #define __GNUC_PREREQ(major, minor) ((((__GNUC__) << 16) + (__GNUC_MINOR__)) >= (((major) << 16) + (minor))) - #endif - #if __GNUC_PREREQ(4, 3) && !defined(__APPLE__) - #include - #else - #if defined(__APPLE__) && defined(XBYAK32) // avoid err : can't find a register in class `BREG' while reloading `asm' - #define __cpuid(eaxIn, a, b, c, d) __asm__ __volatile__("pushl %%ebx\ncpuid\nmovl %%ebp, %%esi\npopl %%ebx" : "=a"(a), "=S"(b), "=c"(c), "=d"(d) : "0"(eaxIn)) - #define __cpuid_count(eaxIn, ecxIn, a, b, c, d) __asm__ __volatile__("pushl %%ebx\ncpuid\nmovl %%ebp, %%esi\npopl %%ebx" : "=a"(a), "=S"(b), "=c"(c), "=d"(d) : "0"(eaxIn), "2"(ecxIn)) - #else - #define __cpuid(eaxIn, a, b, c, d) __asm__ __volatile__("cpuid\n" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(eaxIn)) - #define __cpuid_count(eaxIn, ecxIn, a, b, c, d) __asm__ __volatile__("cpuid\n" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(eaxIn), "2"(ecxIn)) - #endif - #endif -#endif - -#ifdef _MSC_VER -extern "C" unsigned __int64 __xgetbv(int); -#endif - -namespace Xbyak { namespace util { - -/** - CPU detection class -*/ -class Cpu { - uint64 type_; - unsigned int get32bitAsBE(const char *x) const - { - return x[0] | (x[1] << 8) | (x[2] << 16) | (x[3] << 24); - } - unsigned int mask(int n) const - { - return (1U << n) - 1; - } - void setFamily() - { - unsigned int data[4]; - getCpuid(1, data); - stepping = data[0] & mask(4); - model = (data[0] >> 4) & mask(4); - family = (data[0] >> 8) & mask(4); - // type = (data[0] >> 12) & mask(2); - extModel = (data[0] >> 16) & mask(4); - extFamily = (data[0] >> 20) & mask(8); - if (family == 0x0f) { - displayFamily = family + extFamily; - } else { - displayFamily = family; - } - if (family == 6 || family == 0x0f) { - displayModel = (extModel << 4) + model; - } else { - displayModel = model; - } - } -public: - int model; - int family; - int stepping; - int extModel; - int extFamily; - int displayFamily; // family + extFamily - int displayModel; // model + extModel - static inline void getCpuid(unsigned int eaxIn, unsigned int data[4]) - { -#ifdef _MSC_VER - __cpuid(reinterpret_cast(data), eaxIn); -#else - __cpuid(eaxIn, data[0], data[1], data[2], data[3]); -#endif - } - static inline void getCpuidEx(unsigned int eaxIn, unsigned int ecxIn, unsigned int data[4]) - { -#ifdef _MSC_VER - __cpuidex(reinterpret_cast(data), eaxIn, ecxIn); -#else - __cpuid_count(eaxIn, ecxIn, data[0], data[1], data[2], data[3]); -#endif - } - static inline uint64 getXfeature() - { -#ifdef _MSC_VER - return __xgetbv(0); -#else - unsigned int eax, edx; - // xgetvb is not support on gcc 4.2 -// __asm__ volatile("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0)); - __asm__ volatile(".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(0)); - return ((uint64)edx << 32) | eax; -#endif - } - typedef uint64 Type; - static const Type NONE = 0; - static const Type tMMX = 1 << 0; - static const Type tMMX2 = 1 << 1; - static const Type tCMOV = 1 << 2; - static const Type tSSE = 1 << 3; - static const Type tSSE2 = 1 << 4; - static const Type tSSE3 = 1 << 5; - static const Type tSSSE3 = 1 << 6; - static const Type tSSE41 = 1 << 7; - static const Type tSSE42 = 1 << 8; - static const Type tPOPCNT = 1 << 9; - static const Type tAESNI = 1 << 10; - static const Type tSSE5 = 1 << 11; - static const Type tOSXSAVE = 1 << 12; - static const Type tPCLMULQDQ = 1 << 13; - static const Type tAVX = 1 << 14; - static const Type tFMA = 1 << 15; - - static const Type t3DN = 1 << 16; - static const Type tE3DN = 1 << 17; - static const Type tSSE4a = 1 << 18; - static const Type tRDTSCP = 1 << 19; - static const Type tAVX2 = 1 << 20; - static const Type tBMI1 = 1 << 21; // andn, bextr, blsi, blsmsk, blsr, tzcnt - static const Type tBMI2 = 1 << 22; // bzhi, mulx, pdep, pext, rorx, sarx, shlx, shrx - static const Type tLZCNT = 1 << 23; - - static const Type tINTEL = 1 << 24; - static const Type tAMD = 1 << 25; - - static const Type tENHANCED_REP = 1 << 26; // enhanced rep movsb/stosb - static const Type tRDRAND = 1 << 27; - static const Type tADX = 1 << 28; // adcx, adox - static const Type tRDSEED = 1 << 29; // rdseed - static const Type tSMAP = 1 << 30; // stac - static const Type tHLE = uint64(1) << 31; // xacquire, xrelease, xtest - static const Type tRTM = uint64(1) << 32; // xbegin, xend, xabort - - Cpu() - : type_(NONE) - { - unsigned int data[4]; - getCpuid(0, data); - const unsigned int maxNum = data[0]; - static const char intel[] = "ntel"; - static const char amd[] = "cAMD"; - if (data[2] == get32bitAsBE(amd)) { - type_ |= tAMD; - getCpuid(0x80000001, data); - if (data[3] & (1U << 31)) type_ |= t3DN; - if (data[3] & (1U << 15)) type_ |= tCMOV; - if (data[3] & (1U << 30)) type_ |= tE3DN; - if (data[3] & (1U << 22)) type_ |= tMMX2; - if (data[3] & (1U << 27)) type_ |= tRDTSCP; - } - if (data[2] == get32bitAsBE(intel)) { - type_ |= tINTEL; - getCpuid(0x80000001, data); - if (data[3] & (1U << 27)) type_ |= tRDTSCP; - if (data[2] & (1U << 5)) type_ |= tLZCNT; - } - getCpuid(1, data); - if (data[2] & (1U << 0)) type_ |= tSSE3; - if (data[2] & (1U << 9)) type_ |= tSSSE3; - if (data[2] & (1U << 19)) type_ |= tSSE41; - if (data[2] & (1U << 20)) type_ |= tSSE42; - if (data[2] & (1U << 23)) type_ |= tPOPCNT; - if (data[2] & (1U << 25)) type_ |= tAESNI; - if (data[2] & (1U << 1)) type_ |= tPCLMULQDQ; - if (data[2] & (1U << 27)) type_ |= tOSXSAVE; - if (data[2] & (1U << 30)) type_ |= tRDRAND; - - if (data[3] & (1U << 15)) type_ |= tCMOV; - if (data[3] & (1U << 23)) type_ |= tMMX; - if (data[3] & (1U << 25)) type_ |= tMMX2 | tSSE; - if (data[3] & (1U << 26)) type_ |= tSSE2; - - if (type_ & tOSXSAVE) { - // check XFEATURE_ENABLED_MASK[2:1] = '11b' - uint64 bv = getXfeature(); - if ((bv & 6) == 6) { - if (data[2] & (1U << 28)) type_ |= tAVX; - if (data[2] & (1U << 12)) type_ |= tFMA; - } - } - if (maxNum >= 7) { - getCpuidEx(7, 0, data); - if (type_ & tAVX && data[1] & 0x20) type_ |= tAVX2; - if (data[1] & (1U << 3)) type_ |= tBMI1; - if (data[1] & (1U << 8)) type_ |= tBMI2; - if (data[1] & (1U << 9)) type_ |= tENHANCED_REP; - if (data[1] & (1U << 18)) type_ |= tRDSEED; - if (data[1] & (1U << 19)) type_ |= tADX; - if (data[1] & (1U << 20)) type_ |= tSMAP; - if (data[1] & (1U << 4)) type_ |= tHLE; - if (data[1] & (1U << 11)) type_ |= tRTM; - } - setFamily(); - } - void putFamily() - { - printf("family=%d, model=%X, stepping=%d, extFamily=%d, extModel=%X\n", - family, model, stepping, extFamily, extModel); - printf("display:family=%X, model=%X\n", displayFamily, displayModel); - } - bool has(Type type) const - { - return (type & type_) != 0; - } -}; - -class Clock { -public: - static inline uint64 getRdtsc() - { -#ifdef _MSC_VER - return __rdtsc(); -#else - unsigned int eax, edx; - __asm__ volatile("rdtsc" : "=a"(eax), "=d"(edx)); - return ((uint64)edx << 32) | eax; -#endif - } - Clock() - : clock_(0) - , count_(0) - { - } - void begin() - { - clock_ -= getRdtsc(); - } - void end() - { - clock_ += getRdtsc(); - count_++; - } - int getCount() const { return count_; } - uint64 getClock() const { return clock_; } - void clear() { count_ = 0; clock_ = 0; } -private: - uint64 clock_; - int count_; -}; - -#ifdef XBYAK64 -const int UseRCX = 1 << 6; -const int UseRDX = 1 << 7; - -class Pack { - static const size_t maxTblNum = 10; - const Xbyak::Reg64 *tbl_[maxTblNum]; - size_t n_; -public: - Pack() : n_(0) {} - Pack(const Xbyak::Reg64 *tbl, size_t n) { init(tbl, n); } - Pack(const Pack& rhs) - : n_(rhs.n_) - { - if (n_ > maxTblNum) throw Error(ERR_INTERNAL); - for (size_t i = 0; i < n_; i++) tbl_[i] = rhs.tbl_[i]; - } - Pack(const Xbyak::Reg64& t0) - { n_ = 1; tbl_[0] = &t0; } - Pack(const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 2; tbl_[0] = &t0; tbl_[1] = &t1; } - Pack(const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 3; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; } - Pack(const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 4; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; } - Pack(const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 5; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; } - Pack(const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 6; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; } - Pack(const Xbyak::Reg64& t6, const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 7; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; tbl_[6] = &t6; } - Pack(const Xbyak::Reg64& t7, const Xbyak::Reg64& t6, const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 8; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; tbl_[6] = &t6; tbl_[7] = &t7; } - Pack(const Xbyak::Reg64& t8, const Xbyak::Reg64& t7, const Xbyak::Reg64& t6, const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 9; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; tbl_[6] = &t6; tbl_[7] = &t7; tbl_[8] = &t8; } - Pack(const Xbyak::Reg64& t9, const Xbyak::Reg64& t8, const Xbyak::Reg64& t7, const Xbyak::Reg64& t6, const Xbyak::Reg64& t5, const Xbyak::Reg64& t4, const Xbyak::Reg64& t3, const Xbyak::Reg64& t2, const Xbyak::Reg64& t1, const Xbyak::Reg64& t0) - { n_ = 10; tbl_[0] = &t0; tbl_[1] = &t1; tbl_[2] = &t2; tbl_[3] = &t3; tbl_[4] = &t4; tbl_[5] = &t5; tbl_[6] = &t6; tbl_[7] = &t7; tbl_[8] = &t8; tbl_[9] = &t9; } - Pack& append(const Xbyak::Reg64& t) - { - if (n_ == 10) { - fprintf(stderr, "ERR Pack::can't append\n"); - throw Error(ERR_BAD_PARAMETER); - } - tbl_[n_++] = &t; - return *this; - } - void init(const Xbyak::Reg64 *tbl, size_t n) - { - if (n > maxTblNum) { - fprintf(stderr, "ERR Pack::init bad n=%d\n", (int)n); - throw Error(ERR_BAD_PARAMETER); - } - n_ = n; - for (size_t i = 0; i < n; i++) { - tbl_[i] = &tbl[i]; - } - } - const Xbyak::Reg64& operator[](size_t n) const - { - if (n >= n_) { - fprintf(stderr, "ERR Pack bad n=%d\n", (int)n); - throw Error(ERR_BAD_PARAMETER); - } - return *tbl_[n]; - } - size_t size() const { return n_; } - /* - get tbl[pos, pos + num) - */ - Pack sub(size_t pos, size_t num = size_t(-1)) const - { - if (num == size_t(-1)) num = n_ - pos; - if (pos + num > n_) { - fprintf(stderr, "ERR Pack::sub bad pos=%d, num=%d\n", (int)pos, (int)num); - throw Error(ERR_BAD_PARAMETER); - } - Pack pack; - pack.n_ = num; - for (size_t i = 0; i < num; i++) { - pack.tbl_[i] = tbl_[pos + i]; - } - return pack; - } - void put() const - { - for (size_t i = 0; i < n_; i++) { - printf("%s ", tbl_[i]->toString()); - } - printf("\n"); - } -}; - -class StackFrame { -#ifdef XBYAK64_WIN - static const int noSaveNum = 6; - static const int rcxPos = 0; - static const int rdxPos = 1; -#else - static const int noSaveNum = 8; - static const int rcxPos = 3; - static const int rdxPos = 2; -#endif - Xbyak::CodeGenerator *code_; - int pNum_; - int tNum_; - bool useRcx_; - bool useRdx_; - int saveNum_; - int P_; - bool makeEpilog_; - Xbyak::Reg64 pTbl_[4]; - Xbyak::Reg64 tTbl_[10]; - Pack p_; - Pack t_; - StackFrame(const StackFrame&); - void operator=(const StackFrame&); -public: - const Pack& p; - const Pack& t; - /* - make stack frame - @param sf [in] this - @param pNum [in] num of function parameter(0 <= pNum <= 4) - @param tNum [in] num of temporary register(0 <= tNum <= 10, with UseRCX, UseRDX) - @param stackSizeByte [in] local stack size - @param makeEpilog [in] automatically call close() if true - - you can use - rax - gp0, ..., gp(pNum - 1) - gt0, ..., gt(tNum-1) - rcx if tNum & UseRCX - rdx if tNum & UseRDX - rsp[0..stackSizeByte - 1] - */ - StackFrame(Xbyak::CodeGenerator *code, int pNum, int tNum = 0, int stackSizeByte = 0, bool makeEpilog = true) - : code_(code) - , pNum_(pNum) - , tNum_(tNum & ~(UseRCX | UseRDX)) - , useRcx_((tNum & UseRCX) != 0) - , useRdx_((tNum & UseRDX) != 0) - , saveNum_(0) - , P_(0) - , makeEpilog_(makeEpilog) - , p(p_) - , t(t_) - { - using namespace Xbyak; - if (pNum < 0 || pNum > 4) throw Error(ERR_BAD_PNUM); - const int allRegNum = pNum + tNum_ + (useRcx_ ? 1 : 0) + (useRdx_ ? 1 : 0); - if (allRegNum < pNum || allRegNum > 14) throw Error(ERR_BAD_TNUM); - const Reg64& _rsp = code->rsp; - const AddressFrame& _ptr = code->ptr; - saveNum_ = (std::max)(0, allRegNum - noSaveNum); - const int *tbl = getOrderTbl() + noSaveNum; - P_ = saveNum_ + (stackSizeByte + 7) / 8; - if (P_ > 0 && (P_ & 1) == 0) P_++; // here (rsp % 16) == 8, then increment P_ for 16 byte alignment - P_ *= 8; - if (P_ > 0) code->sub(_rsp, P_); -#ifdef XBYAK64_WIN - for (int i = 0; i < (std::min)(saveNum_, 4); i++) { - code->mov(_ptr [_rsp + P_ + (i + 1) * 8], Reg64(tbl[i])); - } - for (int i = 4; i < saveNum_; i++) { - code->mov(_ptr [_rsp + P_ - 8 * (saveNum_ - i)], Reg64(tbl[i])); - } -#else - for (int i = 0; i < saveNum_; i++) { - code->mov(_ptr [_rsp + P_ - 8 * (saveNum_ - i)], Reg64(tbl[i])); - } -#endif - int pos = 0; - for (int i = 0; i < pNum; i++) { - pTbl_[i] = Xbyak::Reg64(getRegIdx(pos)); - } - for (int i = 0; i < tNum_; i++) { - tTbl_[i] = Xbyak::Reg64(getRegIdx(pos)); - } - if (useRcx_ && rcxPos < pNum) code_->mov(code_->r10, code_->rcx); - if (useRdx_ && rdxPos < pNum) code_->mov(code_->r11, code_->rdx); - p_.init(pTbl_, pNum); - t_.init(tTbl_, tNum_); - } - /* - make epilog manually - @param callRet [in] call ret() if true - */ - void close(bool callRet = true) - { - using namespace Xbyak; - const Reg64& _rsp = code_->rsp; - const AddressFrame& _ptr = code_->ptr; - const int *tbl = getOrderTbl() + noSaveNum; -#ifdef XBYAK64_WIN - for (int i = 0; i < (std::min)(saveNum_, 4); i++) { - code_->mov(Reg64(tbl[i]), _ptr [_rsp + P_ + (i + 1) * 8]); - } - for (int i = 4; i < saveNum_; i++) { - code_->mov(Reg64(tbl[i]), _ptr [_rsp + P_ - 8 * (saveNum_ - i)]); - } -#else - for (int i = 0; i < saveNum_; i++) { - code_->mov(Reg64(tbl[i]), _ptr [_rsp + P_ - 8 * (saveNum_ - i)]); - } -#endif - if (P_ > 0) code_->add(_rsp, P_); - - if (callRet) code_->ret(); - } - ~StackFrame() - { - if (!makeEpilog_) return; - try { - close(); - } catch (std::exception& e) { - printf("ERR:StackFrame %s\n", e.what()); - exit(1); - } catch (...) { - printf("ERR:StackFrame otherwise\n"); - exit(1); - } - } -private: - const int *getOrderTbl() const - { - using namespace Xbyak; - static const int tbl[] = { -#ifdef XBYAK64_WIN - Operand::RCX, Operand::RDX, Operand::R8, Operand::R9, Operand::R10, Operand::R11, Operand::RDI, Operand::RSI, -#else - Operand::RDI, Operand::RSI, Operand::RDX, Operand::RCX, Operand::R8, Operand::R9, Operand::R10, Operand::R11, -#endif - Operand::RBX, Operand::RBP, Operand::R12, Operand::R13, Operand::R14, Operand::R15 - }; - return &tbl[0]; - } - int getRegIdx(int& pos) const - { - assert(pos < 14); - using namespace Xbyak; - const int *tbl = getOrderTbl(); - int r = tbl[pos++]; - if (useRcx_) { - if (r == Operand::RCX) { return Operand::R10; } - if (r == Operand::R10) { r = tbl[pos++]; } - } - if (useRdx_) { - if (r == Operand::RDX) { return Operand::R11; } - if (r == Operand::R11) { return tbl[pos++]; } - } - return r; - } -}; -#endif - -} } // end of util -#endif diff --git a/jan/src/cpu/mips3_intf.cpp b/jan/src/cpu/mips3_intf.cpp deleted file mode 100644 index bc9a86bd0..000000000 --- a/jan/src/cpu/mips3_intf.cpp +++ /dev/null @@ -1,354 +0,0 @@ -#include "mips3_intf.h" -#include "mips3/mips3.h" -#include "burnint.h" -#include - -#ifdef MIPS3_X64_DRC -#include "mips3/x64/mips3_x64.h" -#endif - -#define ADDR_BITS 32 -#define PAGE_SIZE 0x1000 -#define PAGE_SHIFT 12 -#define PAGE_MASK 0xFFF -#define PAGE_COUNT (1 << (ADDR_BITS - PAGE_SHIFT)) -#define PAGE_WADD (PAGE_COUNT) -#define MIPS_MAXHANDLER 10 -#define PFN(x) ((x >> PAGE_SHIFT) & 0xFFFFF) - -struct Mips3MemoryMap -{ - UINT8 *MemMap[PAGE_COUNT * 2]; - - pMips3ReadByteHandler ReadByte[MIPS_MAXHANDLER]; - pMips3WriteByteHandler WriteByte[MIPS_MAXHANDLER]; - pMips3ReadHalfHandler ReadHalf[MIPS_MAXHANDLER]; - pMips3WriteHalfHandler WriteHalf[MIPS_MAXHANDLER]; - pMips3ReadWordHandler ReadWord[MIPS_MAXHANDLER]; - pMips3WriteWordHandler WriteWord[MIPS_MAXHANDLER]; - pMips3ReadDoubleHandler ReadDouble[MIPS_MAXHANDLER]; - pMips3WriteDoubleHandler WriteDouble[MIPS_MAXHANDLER]; -}; - - -static mips::mips3 *g_mips = nullptr; -static Mips3MemoryMap *g_mmap = nullptr; -static bool g_useRecompiler = false; - -#ifdef MIPS3_X64_DRC -static mips::mips3_x64 *g_mips_x64 = nullptr; -#endif - -static unsigned char DefReadByte(unsigned int a) { return 0; } -static unsigned short DefReadHalf(unsigned int a) { return 0; } -static unsigned int DefReadWord(unsigned int a) { return 0; } -static unsigned long long DefReadDouble(unsigned int a) { return 0; } -static void DefWriteByte(unsigned int a, unsigned char value) { } -static void DefWriteHalf(unsigned int a, unsigned short value) { } -static void DefWriteWord(unsigned int a, unsigned int value) { } -static void DefWriteDouble(unsigned int a, unsigned long long value) { } - -static void ResetMemoryMap() -{ - for (int page = 0; page < PAGE_COUNT; page++) { - g_mmap->MemMap[page] = (unsigned char*) 0; - g_mmap->MemMap[PAGE_WADD + page] = (unsigned char*) 0; - - } - - for (int i = 0; i < MIPS_MAXHANDLER; i++) { - g_mmap->ReadByte[i] = DefReadByte; - g_mmap->ReadHalf[i] = DefReadHalf; - g_mmap->ReadWord[i] = DefReadWord; - g_mmap->ReadDouble[i] = DefReadDouble; - g_mmap->WriteByte[i] = DefWriteByte; - g_mmap->WriteHalf[i] = DefWriteHalf; - g_mmap->WriteWord[i] = DefWriteWord; - g_mmap->WriteDouble[i] = DefWriteDouble; - } -} - -int Mips3Init() -{ - g_mips = new mips::mips3(); - g_mmap = new Mips3MemoryMap(); - -#ifdef MIPS3_X64_DRC - g_mips_x64 = new mips::mips3_x64(g_mips); -#endif - - ResetMemoryMap(); - - return 0; -} - -int Mips3UseRecompiler(bool use) -{ - g_useRecompiler = use; - - return 0; -} - -int Mips3Exit() -{ -#ifdef MIPS3_X64_DRC - delete g_mips_x64; -#endif - delete g_mips; - delete g_mmap; - g_mips = nullptr; - g_mmap = nullptr; - - return 0; -} - - -void Mips3Reset() -{ - if (g_mips) - g_mips->reset(); -} - -int Mips3Run(int cycles) -{ -#ifdef MIPS3_X64_DRC - if (g_mips) { - if (g_useRecompiler && g_mips_x64) { - g_mips_x64->run(cycles); - } else { - g_mips->run(cycles); - } - } -#else - if (g_mips) - g_mips->run(cycles); -#endif - return 0; -} - -int Mips3MapMemory(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd, int nType) -{ - const int maxPages = (PFN(nEnd) - PFN(nStart)) + 1; - - int page = PFN(nStart); - for (int i = 0; i < maxPages; i++, page++) { - - if (nType & MAP_READ) - g_mmap->MemMap[page] = pMemory + (PAGE_SIZE * i); - - if (nType & MAP_WRITE) - g_mmap->MemMap[PAGE_WADD + page] = pMemory + (PAGE_SIZE * i); - } - return 0; -} - -int Mips3MapHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType) -{ - const int maxPages = (PFN(nEnd) - PFN(nStart)) + 1; - - int page = PFN(nStart); - for (int i = 0; i < maxPages; i++, page++) { - - if (nType & MAP_READ) - g_mmap->MemMap[page] = (UINT8*) nHandler; - - if (nType & MAP_WRITE) - g_mmap->MemMap[PAGE_WADD + page] = (UINT8*) nHandler; - } - return 0; -} - -int Mips3SetReadByteHandler(int i, pMips3ReadByteHandler pHandler) -{ - if (i >= MIPS_MAXHANDLER) - return 1; - g_mmap->ReadByte[i] = pHandler; - return 0; -} - -int Mips3SetWriteByteHandler(int i, pMips3WriteByteHandler pHandler) -{ - if (i >= MIPS_MAXHANDLER) - return 1; - g_mmap->WriteByte[i] = pHandler; - return 0; -} - -int Mips3SetReadHalfHandler(int i, pMips3ReadHalfHandler pHandler) -{ - if (i >= MIPS_MAXHANDLER) - return 1; - g_mmap->ReadHalf[i] = pHandler; - return 0; -} - -int Mips3SetWriteHalfHandler(int i, pMips3WriteHalfHandler pHandler) -{ - if (i >= MIPS_MAXHANDLER) - return 1; - g_mmap->WriteHalf[i] = pHandler; - return 0; -} - -int Mips3SetReadWordHandler(int i, pMips3ReadWordHandler pHandler) -{ - if (i >= MIPS_MAXHANDLER) - return 1; - g_mmap->ReadWord[i] = pHandler; - return 0; -} - -int Mips3SetWriteWordHandler(int i, pMips3WriteWordHandler pHandler) -{ - if (i >= MIPS_MAXHANDLER) - return 1; - g_mmap->WriteWord[i] = pHandler; - return 0; -} - -int Mips3SetReadDoubleHandler(int i, pMips3ReadDoubleHandler pHandler) -{ - if (i >= MIPS_MAXHANDLER) - return 1; - g_mmap->ReadDouble[i] = pHandler; - return 0; -} - -int Mips3SetWriteDoubleHandler(int i, pMips3WriteDoubleHandler pHandler) -{ - if (i >= MIPS_MAXHANDLER) - return 1; - g_mmap->WriteDouble[i] = pHandler; - return 0; -} - -void Mips3SetIRQLine(const int line, const int state) -{ - if (g_mips) { - if (state) { - g_mips->m_state.cpr[0][13] |= (0x400 << line); - } else { - g_mips->m_state.cpr[0][13] &= ~(0x400 << line); - } - } -} - -namespace mips -{ -namespace mem -{ - - -template -inline T fast_read(uint8_t *ptr, unsigned adr) { - return *((T*) ((uint8_t*) ptr + (adr & PAGE_MASK))); -} - -template -inline void fast_write(uint8_t *xptr, unsigned adr, T value) { - T *ptr = ((T*) ((uint8_t*) xptr + (adr & PAGE_MASK))); - *ptr = value; -} - - -uint8_t read_byte(addr_t address) -{ - address &= 0xFFFFFFFF; - - UINT8 *pr = g_mmap->MemMap[PFN(address)]; - if ((uintptr_t)pr >= MIPS_MAXHANDLER) { - return pr[address & PAGE_MASK]; - } - return g_mmap->ReadByte[(uintptr_t)pr](address); -} - -uint16_t read_half(addr_t address) -{ - address &= 0xFFFFFFFF; - - UINT8 *pr = g_mmap->MemMap[PFN(address)]; - if ((uintptr_t)pr >= MIPS_MAXHANDLER) { - return BURN_ENDIAN_SWAP_INT16(fast_read(pr, address)); - } - return g_mmap->ReadHalf[(uintptr_t)pr](address); -} - -uint32_t read_word(addr_t address) -{ - address &= 0xFFFFFFFF; - - UINT8 *pr = g_mmap->MemMap[PFN(address)]; - if ((uintptr_t)pr >= MIPS_MAXHANDLER) { - return BURN_ENDIAN_SWAP_INT32(fast_read(pr, address)); - } - return g_mmap->ReadWord[(uintptr_t)pr](address); -} - -uint64_t read_dword(addr_t address) -{ - address &= 0xFFFFFFFF; - - UINT8 *pr = g_mmap->MemMap[PFN(address)]; - if ((uintptr_t)pr >= MIPS_MAXHANDLER) { - return BURN_ENDIAN_SWAP_INT64(fast_read(pr, address)); - } - return g_mmap->ReadDouble[(uintptr_t)pr](address); -} - - -void write_byte(addr_t address, uint8_t value) -{ - address &= 0xFFFFFFFF; - - UINT8 *pr = g_mmap->MemMap[PAGE_WADD + PFN(address)]; - if ((uintptr_t)pr >= MIPS_MAXHANDLER) { - pr[address & PAGE_MASK] = value; - return; - } - g_mmap->WriteByte[(uintptr_t)pr](address, value); -} - -void write_half(addr_t address, uint16_t value) -{ - address &= 0xFFFFFFFF; - - UINT8 *pr = g_mmap->MemMap[PAGE_WADD + PFN(address)]; - if ((uintptr_t)pr >= MIPS_MAXHANDLER) { - fast_write(pr, address, BURN_ENDIAN_SWAP_INT16(value)); - return; - } - g_mmap->WriteHalf[(uintptr_t)pr](address, value); -} - -void write_word(addr_t address, uint32_t value) -{ - address &= 0xFFFFFFFF; - - UINT8 *pr = g_mmap->MemMap[PAGE_WADD + PFN(address)]; - if ((uintptr_t)pr >= MIPS_MAXHANDLER) { - fast_write(pr, address, BURN_ENDIAN_SWAP_INT32(value)); - return; - } - g_mmap->WriteWord[(uintptr_t)pr](address, value); -} - -void write_dword(addr_t address, uint64_t value) -{ - address &= 0xFFFFFFFF; - - UINT8 *pr = g_mmap->MemMap[PAGE_WADD + PFN(address)]; - if ((uintptr_t)pr >= MIPS_MAXHANDLER) { - fast_write(pr, address, BURN_ENDIAN_SWAP_INT64(value)); - return; - } - g_mmap->WriteDouble[(uintptr_t)pr](address, value); -} - -} -} - - -unsigned int Mips3GetPC() -{ - return g_mips->m_prev_pc; -} diff --git a/jan/src/cpu/mips3_intf.h b/jan/src/cpu/mips3_intf.h deleted file mode 100644 index 55f3701cb..000000000 --- a/jan/src/cpu/mips3_intf.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef MIPS3_INTF -#define MIPS3_INTF - -#include "mips3/mips3_common.h" - -typedef unsigned char (*pMips3ReadByteHandler)(unsigned int a); -typedef void (*pMips3WriteByteHandler)(unsigned int a, unsigned char d); - -typedef unsigned short (*pMips3ReadHalfHandler)(unsigned int a); -typedef void (*pMips3WriteHalfHandler)(unsigned int a, unsigned short d); - -typedef unsigned int (*pMips3ReadWordHandler)(unsigned int a); -typedef void (*pMips3WriteWordHandler)(unsigned int a, unsigned int d); - -typedef unsigned long long (*pMips3ReadDoubleHandler)(unsigned int a); -typedef void (*pMips3WriteDoubleHandler)(unsigned int a, unsigned long long d); - -int Mips3Init(); -int Mips3UseRecompiler(bool use); -int Mips3Exit(); -void Mips3Reset(); -int Mips3Run(int cycles); -unsigned int Mips3GetPC(); - -int Mips3MapMemory(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd, int nType); -int Mips3MapHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType); - -int Mips3SetReadByteHandler(int i, pMips3ReadByteHandler pHandler); -int Mips3SetWriteByteHandler(int i, pMips3WriteByteHandler pHandler); - -int Mips3SetReadHalfHandler(int i, pMips3ReadHalfHandler pHandler); -int Mips3SetWriteHalfHandler(int i, pMips3WriteHalfHandler pHandler); - -int Mips3SetReadWordHandler(int i, pMips3ReadWordHandler pHandler); -int Mips3SetWriteWordHandler(int i, pMips3WriteWordHandler pHandler); - -int Mips3SetReadDoubleHandler(int i, pMips3ReadDoubleHandler pHandler); -int Mips3SetWriteDoubleHandler(int i, pMips3WriteDoubleHandler pHandler); - -void Mips3SetIRQLine(const int line, const int state); - -#endif // MIPS3_INTF - diff --git a/jan/src/cpu/nec/nec.cpp b/jan/src/cpu/nec/nec.cpp deleted file mode 100644 index f4702f3ae..000000000 --- a/jan/src/cpu/nec/nec.cpp +++ /dev/null @@ -1,755 +0,0 @@ -/**************************************************************************** - - NEC V20/V30/V33 emulator - - --------------------------------------------- - - V20 = uPD70108 = 8-bit data bus @ 5MHz or 8MHz - V20HL = uPD70108H = V20 with EMS support (24-bit address bus) - - V25 = uPD70320 = V20 with on-chip features: - - 256 bytes on-chip RAM - - 8 register banks - - 4-bit input port - - 20-bit I/O port - - 2 channel serial interface - - interrupt controller - - 2 channel DMA controller - - 2 channel 16-bit timer - - new instructions: BTCLR, RETRBI, STOP, BRKCS, TSKSW, - MOVSPA, MOVSPB - - V25+ = uPD70325 = V25 @ 8MHz or 10MHz plus changes: - - faster DMA - - improved serial interface - - --------------------------------------------- - - V30 = uPD70116 = 16-bit data bus version of V20 - V30HL = uPD70116H = 16-bit data bus version of V20HL - V30MX = V30HL with separate address and data busses - - V35 = uPD70330 = 16-bit data bus version of V25 - - V35+ = uPD70335 = 16-bit data bus version of V25+ - - --------------------------------------------- - - V40 = uPD70208 = 8-bit data bus @ 10MHz - V40HL = uPD70208H = V40 with support up to 20Mhz - - --------------------------------------------- - - V50 = uPD70216 = 16-bit data bus version of V40 - V50HL = uPD70216H = 16-bit data bus version of V40HL - - --------------------------------------------- - - V41 = uPD70270 - - V51 = uPD70280 - - - - V33A = uPD70136A - - V53A = uPD70236A - - - - Instruction differences: - V20, V30, V40, V50 have dedicated emulation instructions - (BRKEM, RETEM, CALLN) - - V33A, V53A has dedicated address mode instructions - (BRKXA, RETXA) - - - - (Re)Written June-September 2000 by Bryan McPhail (mish@tendril.co.uk) based - on code by Oliver Bergmann (Raul_Bloodworth@hotmail.com) who based code - on the i286 emulator by Fabrice Frances which had initial work based on - David Hedley's pcemu(!). - - This new core features 99% accurate cycle counts for each processor, - there are still some complex situations where cycle counts are wrong, - typically where a few instructions have differing counts for odd/even - source and odd/even destination memory operands. - - Flag settings are also correct for the NEC processors rather than the - I86 versions. - - Changelist: - - 22/02/2003: - Removed cycle counts from memory accesses - they are certainly wrong, - and there is already a memory access cycle penalty in the opcodes - using them. - - Fixed save states. - - Fixed ADJBA/ADJBS/ADJ4A/ADJ4S flags/return values for all situations. - (Fixes bugs in Geostorm and Thunderblaster) - - Fixed carry flag on NEG (I thought this had been fixed circa Mame 0.58, - but it seems I never actually submitted the fix). - - Fixed many cycle counts in instructions and bug in cycle count - macros (odd word cases were testing for odd instruction word address - not data address). - - Todo! - Double check cycle timing is 100%. - -****************************************************************************/ - -#include -#include -#include "driver.h" -#include "state.h" -#include "nec_intf.h" -#include "bitswap.h" - -#define offs_t int //? -#define INPUT_LINE_NMI 0x20 // nmi - -#define NEC_INLINE -#define NEC_CPU_CPP - -unsigned char cpu_readmem20_op(unsigned int); -unsigned char cpu_readmem20_arg(unsigned int); -unsigned char cpu_readport(unsigned int); -void cpu_writeport(unsigned int,unsigned int); - -static NEC_INLINE void write_mem_word(unsigned int a, unsigned short d) -{ - cpu_writemem20((a),(unsigned char)(d)); - cpu_writemem20((a)+1,(d)>>8); -} - -static NEC_INLINE void write_port_word(unsigned int a, unsigned short d) -{ - cpu_writeport((a),(unsigned char)(d)); - cpu_writeport((a)+1,(d)>>8); -} - -typedef UINT8 BOOLEAN; -typedef UINT8 BYTE; -typedef UINT16 WORD; -typedef UINT32 DWORD; - -#include "nec.h" -#include "necpriv.h" - -static nec_state_t sChips[4]; // 4 cpus should be plenty! -static nec_state_t *sChipsPtr; - -NEC_INLINE void prefetch(nec_state_t *nec_state) -{ - nec_state->prefetch_count--; -} - -static void do_prefetch(nec_state_t *nec_state, int previous_ICount) -{ - int diff = previous_ICount - (int) nec_state->icount; - - /* The implementation is not accurate, but comes close. - * It does not respect that the V30 will fetch two bytes - * at once directly, but instead uses only 2 cycles instead - * of 4. There are however only very few sources publicly - * available and they are vague. - */ - while (nec_state->prefetch_count<0) - { - nec_state->prefetch_count++; - if (diff>nec_state->prefetch_cycles) - diff -= nec_state->prefetch_cycles; - else - nec_state->icount -= nec_state->prefetch_cycles; - } - - if (nec_state->prefetch_reset) - { - nec_state->prefetch_count = 0; - nec_state->prefetch_reset = 0; - return; - } - - while (diff>=nec_state->prefetch_cycles && nec_state->prefetch_count < nec_state->prefetch_size) - { - diff -= nec_state->prefetch_cycles; - nec_state->prefetch_count++; - } - -} - -NEC_INLINE UINT8 fetch(nec_state_t *nec_state) -{ - prefetch(nec_state); - return cpu_readop_arg(((Sreg(PS)<<4)+nec_state->ip++) ^ nec_state->fetch_xor); // ^ fetch_xor? -} - -NEC_INLINE UINT16 fetchword(nec_state_t *nec_state) -{ - UINT16 r = FETCH(); - r |= (FETCH()<<8); - return r; -} - -#include "necinstr.h" -#include "necmacro.h" -#include "necea.h" -#include "necmodrm.h" - -static UINT8 parity_table[256]; - -static UINT8 fetchop(nec_state_t *nec_state) -{ - prefetch(nec_state); - return cpu_readop(((Sreg(PS)<<4)+nec_state->ip++) ^ nec_state->fetch_xor); -} - - -/***************************************************************************/ - -int nec_reset() -{ - nec_state_t *nec_state = sChipsPtr; - - memset( &nec_state->regs.w, 0, sizeof(nec_state->regs.w)); - - nec_state->ip = 0; - nec_state->TF = 0; - nec_state->IF = 0; - nec_state->DF = 0; - nec_state->MF = 1; // brkem should set to 0 when implemented - nec_state->SignVal = 0; - nec_state->AuxVal = 0; - nec_state->OverVal = 0; - nec_state->ZeroVal = 1; - nec_state->CarryVal = 0; - nec_state->ParityVal = 1; - nec_state->pending_irq = 0; - nec_state->nmi_state = 0; - nec_state->irq_state = 0; - nec_state->poll_state = 1; - nec_state->halted = 0; - nec_state->cycles_total = 0; - nec_state->cycles_remaining = 0; - nec_state->vector = 0xff; //default vector - - Sreg(PS) = 0xffff; - Sreg(SS) = 0; - Sreg(DS0) = 0; - Sreg(DS1) = 0; - - CHANGE_PC; - - return 0; -} - -static void nec_interrupt(nec_state_t *nec_state, unsigned int_num, INTSOURCES source) -{ - UINT32 dest_seg, dest_off; - - i_pushf(nec_state); - nec_state->TF = nec_state->IF = 0; - - if (source == INT_IRQ) /* get vector */ - int_num = nec_state->vector; - - dest_off = read_mem_word(int_num*4); - dest_seg = read_mem_word(int_num*4+2); - - PUSH(Sreg(PS)); - PUSH(nec_state->ip); - nec_state->ip = (WORD)dest_off; - Sreg(PS) = (WORD)dest_seg; - CHANGE_PC; -} - -static void nec_trap(nec_state_t *nec_state) -{ - nec_instruction[fetchop(nec_state)](nec_state); - nec_interrupt(nec_state, NEC_TRAP_VECTOR, BRK); -} - -static void external_int(nec_state_t *nec_state) -{ - if (nec_state->pending_irq & NMI_IRQ) - { - nec_interrupt(nec_state, NEC_NMI_VECTOR, NMI_IRQ); - nec_state->pending_irq &= ~NMI_IRQ; - } - else if (nec_state->pending_irq) - { - /* the actual vector is retrieved after pushing flags */ - /* and clearing the IF */ - nec_interrupt(nec_state, (UINT32)-1, INT_IRQ); - nec_state->irq_state = CLEAR_LINE; - nec_state->pending_irq &= ~INT_IRQ; - } -} - -/****************************************************************************/ -/* OPCODES */ -/****************************************************************************/ - -#include "necinstr.c" - -/*****************************************************************************/ - -void nec_set_irq_line_and_vector(int irqline, int vector, int state) -{ - nec_state_t *nec_state = sChipsPtr; - - switch (irqline) - { - case 0: - nec_state->irq_state = state; - if (state == CLEAR_LINE) - nec_state->pending_irq &= ~INT_IRQ; - else - { - nec_state->vector = vector; - nec_state->pending_irq |= INT_IRQ; - nec_state->halted = 0; - } - break; - case INPUT_LINE_NMI: - if (nec_state->nmi_state == (unsigned int)state) return; - nec_state->nmi_state = state; - if (state != CLEAR_LINE) - { - nec_state->vector = vector; - nec_state->pending_irq |= NMI_IRQ; - nec_state->halted = 0; - } - break; - case NEC_INPUT_LINE_POLL: - nec_state->vector = vector; - nec_state->poll_state = state; - break; - } -} - -void nec_init(int cpu) -{ - nec_state_t *nec_state = &sChips[cpu]; - - unsigned int i, j, c; - - static const WREGS wreg_name[8]={ AW, CW, DW, BW, SP, BP, IX, IY }; - static const BREGS breg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH }; - - for (i = 0; i < 256; i++) - { - for (j = i, c = 0; j > 0; j >>= 1) - if (j & 1) c++; - parity_table[i] = !(c & 1); - } - - for (i = 0; i < 256; i++) - { - Mod_RM.reg.b[i] = breg_name[(i & 0x38) >> 3]; - Mod_RM.reg.w[i] = wreg_name[(i & 0x38) >> 3]; - } - - for (i = 0xc0; i < 0x100; i++) - { - Mod_RM.RM.w[i] = wreg_name[i & 7]; - Mod_RM.RM.b[i] = breg_name[i & 7]; - } - - memset(nec_state, 0, sizeof(*nec_state)); -} - -void necCpuOpen(int cpu) -{ - sChipsPtr = &sChips[cpu]; -} - -void necCpuClose() -{ - sChipsPtr = NULL; -} - -unsigned int nec_total_cycles() -{ - return sChipsPtr->cycles_total + (sChipsPtr->cycles_remaining - sChipsPtr->icount); -} - -void nec_new_frame() -{ - for (int i = 0; i < 4; i++) { - nec_state_t *nec_state = &sChips[i]; - nec_state->cycles_total = 0; - } -} - -void nec_set_vector(int vector) -{ - nec_state_t *nec_state = sChipsPtr; - nec_state->vector = vector; -} - -void necRunEnd() -{ - sChipsPtr->stop_run = 1; -} - -void necIdle(int cycles) -{ - sChipsPtr->icount -= cycles; -} - -int nec_execute(int cycles) -{ - nec_state_t *nec_state = sChipsPtr; - int prev_ICount; - - nec_state->icount = cycles; - nec_state->cycles_remaining = cycles; - - if (nec_state->halted) - { - nec_state->icount = 0; - //debugger_instruction_hook(device, (Sreg(PS)<<4) + nec_state->ip); - return cycles; - } - - while((nec_state->icount>0) && (!nec_state->stop_run)) { - /* Dispatch IRQ */ - if (nec_state->pending_irq && nec_state->no_interrupt==0) - { - if (nec_state->pending_irq & NMI_IRQ) - external_int(nec_state); - else if (nec_state->IF) - external_int(nec_state); - } - - /* No interrupt allowed between last instruction and this one */ - if (nec_state->no_interrupt) - nec_state->no_interrupt--; - - //debugger_instruction_hook(device, (Sreg(PS)<<4) + nec_state->ip); - prev_ICount = nec_state->icount; - nec_instruction[fetchop(nec_state)](nec_state); - do_prefetch(nec_state, prev_ICount); - } - - nec_state->cycles_total += cycles - nec_state->icount; - nec_state->cycles_remaining = 0; - nec_state->stop_run = 0; - - return (cycles - nec_state->icount); -} - -void necInit(int cpu, int type) -{ - nec_state_t *nec_state = &sChips[cpu]; - - nec_init(cpu); - - switch (type) - { - case V20_TYPE: - { - nec_state->fetch_xor = 0; - nec_state->chip_type=V20_TYPE; - nec_state->prefetch_size = 4; /* 3 words */ - nec_state->prefetch_cycles = 4; /* four cycles per byte */ - } - break; - - case V30_TYPE: - { - nec_state->fetch_xor = 0; - nec_state->chip_type=V30_TYPE; - nec_state->prefetch_size = 6; /* 3 words */ - nec_state->prefetch_cycles = 2; /* two cycles per byte / four per word */ - } - break; - - case V33_TYPE: - { - nec_state->fetch_xor = 0; - nec_state->chip_type=V33_TYPE; - nec_state->prefetch_size = 6; - /* FIXME: Need information about prefetch size and cycles for V33. - * complete guess below, nbbatman will not work - * properly without. */ - nec_state->prefetch_cycles = 1; /* two cycles per byte / four per word */ - } - break; - } -} - -int necGetPC(int n) -{ - if (n == -1) { // current cpu - return ((sChipsPtr->sregs[PS]<<4) + sChipsPtr->ip); - } else { - nec_state_t *nec_state = &sChips[n]; - return ((nec_state->sregs[PS]<<4) + nec_state->ip); - } -} - -void necScan(int cpu, int nAction) -{ - nec_state_t *nec_state = &sChips[cpu]; - - if (nAction & ACB_DRIVER_DATA) { - struct BurnArea ba; - char szText[] = "NEC #0"; - szText[5] = '1' + cpu; - - memset(&ba, 0, sizeof(ba)); - - ba.Data = (unsigned char*)nec_state; - ba.nLen = sizeof(nec_state_t); - ba.szName = szText; - BurnAcb(&ba); - } -} - - -#if 0 - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static CPU_SET_INFO( nec ) -{ - nec_state_t *nec_state = get_safe_token(device); - - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(nec_state, 0, info->i); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(nec_state, INPUT_LINE_NMI, info->i); break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_POLL: set_irq_line(nec_state, NEC_INPUT_LINE_POLL, info->i); break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + NEC_PC: - if( info->i - (Sreg(PS)<<4) < 0x10000 ) - { - nec_state->ip = info->i - (Sreg(PS)<<4); - } - else - { - Sreg(PS) = info->i >> 4; - nec_state->ip = info->i & 0x0000f; - } - break; - case CPUINFO_INT_REGISTER + NEC_IP: nec_state->ip = info->i; break; - case CPUINFO_INT_SP: - if( info->i - (Sreg(SS)<<4) < 0x10000 ) - { - Wreg(SP) = info->i - (Sreg(SS)<<4); - } - else - { - Sreg(SS) = info->i >> 4; - Wreg(SP) = info->i & 0x0000f; - } - break; - case CPUINFO_INT_REGISTER + NEC_SP: Wreg(SP) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_FLAGS: ExpandFlags(info->i); break; - case CPUINFO_INT_REGISTER + NEC_AW: Wreg(AW) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_CW: Wreg(CW) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_DW: Wreg(DW) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_BW: Wreg(BW) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_BP: Wreg(BP) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_IX: Wreg(IX) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_IY: Wreg(IY) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_ES: Sreg(DS1) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_CS: Sreg(PS) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_SS: Sreg(SS) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_DS: Sreg(DS0) = info->i; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -static CPU_GET_INFO( nec ) -{ - nec_state_t *nec_state = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; - int flags; - - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(nec_state_t); break; - case CPUINFO_INT_INPUT_LINES: info->i = 1; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0xff; break; - case DEVINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 8; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 80; break; - - case DEVINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; - case DEVINFO_INT_ADDRBUS_WIDTH + AS_PROGRAM: info->i = 20; break; - case DEVINFO_INT_ADDRBUS_SHIFT + AS_PROGRAM: info->i = 0; break; - case DEVINFO_INT_DATABUS_WIDTH + AS_DATA: info->i = 0; break; - case DEVINFO_INT_ADDRBUS_WIDTH + AS_DATA: info->i = 0; break; - case DEVINFO_INT_ADDRBUS_SHIFT + AS_DATA: info->i = 0; break; - case DEVINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break; - case DEVINFO_INT_ADDRBUS_WIDTH + AS_IO: info->i = 16; break; - case DEVINFO_INT_ADDRBUS_SHIFT + AS_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + 0: info->i = (nec_state->pending_irq & INT_IRQ) ? ASSERT_LINE : CLEAR_LINE; break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = nec_state->nmi_state; break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_POLL: info->i = nec_state->poll_state; break; - - case CPUINFO_INT_PREVIOUSPC: /* not supported */ break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + NEC_PC: info->i = ((Sreg(PS)<<4) + nec_state->ip); break; - case CPUINFO_INT_REGISTER + NEC_IP: info->i = nec_state->ip; break; - case CPUINFO_INT_SP: info->i = (Sreg(SS)<<4) + Wreg(SP); break; - case CPUINFO_INT_REGISTER + NEC_SP: info->i = Wreg(SP); break; - case CPUINFO_INT_REGISTER + NEC_FLAGS: info->i = CompressFlags(); break; - case CPUINFO_INT_REGISTER + NEC_AW: info->i = Wreg(AW); break; - case CPUINFO_INT_REGISTER + NEC_CW: info->i = Wreg(CW); break; - case CPUINFO_INT_REGISTER + NEC_DW: info->i = Wreg(DW); break; - case CPUINFO_INT_REGISTER + NEC_BW: info->i = Wreg(BW); break; - case CPUINFO_INT_REGISTER + NEC_BP: info->i = Wreg(BP); break; - case CPUINFO_INT_REGISTER + NEC_IX: info->i = Wreg(IX); break; - case CPUINFO_INT_REGISTER + NEC_IY: info->i = Wreg(IY); break; - case CPUINFO_INT_REGISTER + NEC_ES: info->i = Sreg(DS1); break; - case CPUINFO_INT_REGISTER + NEC_CS: info->i = Sreg(PS); break; - case CPUINFO_INT_REGISTER + NEC_SS: info->i = Sreg(SS); break; - case CPUINFO_INT_REGISTER + NEC_DS: info->i = Sreg(DS0); break; - case CPUINFO_INT_REGISTER + NEC_PENDING: info->i = nec_state->pending_irq; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(nec); break; - case CPUINFO_FCT_INIT: /* set per-CPU */ break; - case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(nec); break; - case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(nec); break; - case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(necv); break; - case CPUINFO_FCT_BURN: info->burn = NULL; break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(nec); break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &nec_state->icount; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "NEC"); break; - case DEVINFO_STR_FAMILY: strcpy(info->s, "NEC V-Series"); break; - case DEVINFO_STR_VERSION: strcpy(info->s, "2.0"); break; - case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; - case DEVINFO_STR_CREDITS: strcpy(info->s, "Bryan McPhail (V25/V35 support added by Alex W. Jackson)"); break; - - case CPUINFO_STR_FLAGS: - flags = CompressFlags(); - sprintf(info->s, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", - flags & 0x8000 ? 'N':'E', - flags & 0x4000 ? '?':'.', - flags & 0x2000 ? '?':'.', - flags & 0x1000 ? '?':'.', - flags & 0x0800 ? 'O':'.', - flags & 0x0400 ? 'D':'.', - flags & 0x0200 ? 'I':'.', - flags & 0x0100 ? 'T':'.', - flags & 0x0080 ? 'S':'.', - flags & 0x0040 ? 'Z':'.', - flags & 0x0020 ? '?':'.', - flags & 0x0010 ? 'A':'.', - flags & 0x0008 ? '?':'.', - flags & 0x0004 ? 'P':'.', - flags & 0x0002 ? '.':'?', - flags & 0x0001 ? 'C':'.'); - break; - - case CPUINFO_STR_REGISTER + NEC_PC: sprintf(info->s, "PC:%05X", (Sreg(PS)<<4) + nec_state->ip); break; - case CPUINFO_STR_REGISTER + NEC_IP: sprintf(info->s, "IP:%04X", nec_state->ip); break; - case CPUINFO_STR_REGISTER + NEC_SP: sprintf(info->s, "SP:%04X", Wreg(SP)); break; - case CPUINFO_STR_REGISTER + NEC_FLAGS: sprintf(info->s, "F:%04X", CompressFlags()); break; - case CPUINFO_STR_REGISTER + NEC_AW: sprintf(info->s, "AW:%04X", Wreg(AW)); break; - case CPUINFO_STR_REGISTER + NEC_CW: sprintf(info->s, "CW:%04X", Wreg(CW)); break; - case CPUINFO_STR_REGISTER + NEC_DW: sprintf(info->s, "DW:%04X", Wreg(DW)); break; - case CPUINFO_STR_REGISTER + NEC_BW: sprintf(info->s, "BW:%04X", Wreg(BW)); break; - case CPUINFO_STR_REGISTER + NEC_BP: sprintf(info->s, "BP:%04X", Wreg(BP)); break; - case CPUINFO_STR_REGISTER + NEC_IX: sprintf(info->s, "IX:%04X", Wreg(IX)); break; - case CPUINFO_STR_REGISTER + NEC_IY: sprintf(info->s, "IY:%04X", Wreg(IY)); break; - case CPUINFO_STR_REGISTER + NEC_ES: sprintf(info->s, "DS1:%04X", Sreg(DS1)); break; - case CPUINFO_STR_REGISTER + NEC_CS: sprintf(info->s, "PS:%04X", Sreg(PS)); break; - case CPUINFO_STR_REGISTER + NEC_SS: sprintf(info->s, "SS:%04X", Sreg(SS)); break; - case CPUINFO_STR_REGISTER + NEC_DS: sprintf(info->s, "DS0:%04X", Sreg(DS0)); break; - } -} - - -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -CPU_GET_INFO( v20 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case DEVINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 8; break; - case DEVINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 8; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(v20); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "V20"); break; - - default: CPU_GET_INFO_CALL(nec); break; - } -} - - -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -CPU_GET_INFO( v30 ) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(v30); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "V30"); break; - - default: CPU_GET_INFO_CALL(nec); break; - } -} - - -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -CPU_GET_INFO( v33 ) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(v33); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "V33"); break; - - default: CPU_GET_INFO_CALL(nec); break; - } -} - -DEFINE_LEGACY_CPU_DEVICE(V20, v20); -DEFINE_LEGACY_CPU_DEVICE(V30, v30); -DEFINE_LEGACY_CPU_DEVICE(V33, v33); - -#endif diff --git a/jan/src/cpu/nec/nec.h b/jan/src/cpu/nec/nec.h deleted file mode 100644 index 1b22c8081..000000000 --- a/jan/src/cpu/nec/nec.h +++ /dev/null @@ -1,37 +0,0 @@ -/* ASG 971222 -- rewrote this interface */ -#ifndef __NEC_H_ -#define __NEC_H_ - - -typedef struct _nec_config nec_config; -struct _nec_config -{ - const UINT8* v25v35_decryptiontable; // internal decryption table -}; - -#define NEC_INPUT_LINE_INTP0 10 -#define NEC_INPUT_LINE_INTP1 11 -#define NEC_INPUT_LINE_INTP2 12 -#define NEC_INPUT_LINE_POLL 20 - -#define V25_PORT_P0 0x10000 -#define V25_PORT_P1 0x10002 -#define V25_PORT_P2 0x10004 -#define V25_PORT_PT 0x10006 - -enum -{ - NEC_PC=0, - NEC_IP, NEC_AW, NEC_CW, NEC_DW, NEC_BW, NEC_SP, NEC_BP, NEC_IX, NEC_IY, - NEC_FLAGS, NEC_ES, NEC_CS, NEC_SS, NEC_DS, - NEC_PENDING -}; - -/* Public functions */ -//DECLARE_LEGACY_CPU_DEVICE(V20, v20); -//DECLARE_LEGACY_CPU_DEVICE(V25, v25); -//DECLARE_LEGACY_CPU_DEVICE(V30, v30); -//DECLARE_LEGACY_CPU_DEVICE(V33, v33); -//DECLARE_LEGACY_CPU_DEVICE(V35, v35); - -#endif diff --git a/jan/src/cpu/nec/necea.h b/jan/src/cpu/nec/necea.h deleted file mode 100644 index cafbb27a6..000000000 --- a/jan/src/cpu/nec/necea.h +++ /dev/null @@ -1,60 +0,0 @@ - -static UINT32 EA; -static UINT16 EO; -static UINT16 E16; - -static unsigned EA_000(nec_state_t *nec_state) { EO=Wreg(BW)+Wreg(IX); EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_001(nec_state_t *nec_state) { EO=Wreg(BW)+Wreg(IY); EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_002(nec_state_t *nec_state) { EO=Wreg(BP)+Wreg(IX); EA=DefaultBase(SS)+EO; return EA; } -static unsigned EA_003(nec_state_t *nec_state) { EO=Wreg(BP)+Wreg(IY); EA=DefaultBase(SS)+EO; return EA; } -static unsigned EA_004(nec_state_t *nec_state) { EO=Wreg(IX); EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_005(nec_state_t *nec_state) { EO=Wreg(IY); EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_006(nec_state_t *nec_state) { EO=FETCH(); EO+=FETCH()<<8; EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_007(nec_state_t *nec_state) { EO=Wreg(BW); EA=DefaultBase(DS0)+EO; return EA; } - -static unsigned EA_100(nec_state_t *nec_state) { EO=(Wreg(BW)+Wreg(IX)+(INT8)FETCH()); EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_101(nec_state_t *nec_state) { EO=(Wreg(BW)+Wreg(IY)+(INT8)FETCH()); EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_102(nec_state_t *nec_state) { EO=(Wreg(BP)+Wreg(IX)+(INT8)FETCH()); EA=DefaultBase(SS)+EO; return EA; } -static unsigned EA_103(nec_state_t *nec_state) { EO=(Wreg(BP)+Wreg(IY)+(INT8)FETCH()); EA=DefaultBase(SS)+EO; return EA; } -static unsigned EA_104(nec_state_t *nec_state) { EO=(Wreg(IX)+(INT8)FETCH()); EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_105(nec_state_t *nec_state) { EO=(Wreg(IY)+(INT8)FETCH()); EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_106(nec_state_t *nec_state) { EO=(Wreg(BP)+(INT8)FETCH()); EA=DefaultBase(SS)+EO; return EA; } -static unsigned EA_107(nec_state_t *nec_state) { EO=(Wreg(BW)+(INT8)FETCH()); EA=DefaultBase(DS0)+EO; return EA; } - -static unsigned EA_200(nec_state_t *nec_state) { E16=FETCH(); E16+=FETCH()<<8; EO=Wreg(BW)+Wreg(IX)+(INT16)E16; EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_201(nec_state_t *nec_state) { E16=FETCH(); E16+=FETCH()<<8; EO=Wreg(BW)+Wreg(IY)+(INT16)E16; EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_202(nec_state_t *nec_state) { E16=FETCH(); E16+=FETCH()<<8; EO=Wreg(BP)+Wreg(IX)+(INT16)E16; EA=DefaultBase(SS)+EO; return EA; } -static unsigned EA_203(nec_state_t *nec_state) { E16=FETCH(); E16+=FETCH()<<8; EO=Wreg(BP)+Wreg(IY)+(INT16)E16; EA=DefaultBase(SS)+EO; return EA; } -static unsigned EA_204(nec_state_t *nec_state) { E16=FETCH(); E16+=FETCH()<<8; EO=Wreg(IX)+(INT16)E16; EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_205(nec_state_t *nec_state) { E16=FETCH(); E16+=FETCH()<<8; EO=Wreg(IY)+(INT16)E16; EA=DefaultBase(DS0)+EO; return EA; } -static unsigned EA_206(nec_state_t *nec_state) { E16=FETCH(); E16+=FETCH()<<8; EO=Wreg(BP)+(INT16)E16; EA=DefaultBase(SS)+EO; return EA; } -static unsigned EA_207(nec_state_t *nec_state) { E16=FETCH(); E16+=FETCH()<<8; EO=Wreg(BW)+(INT16)E16; EA=DefaultBase(DS0)+EO; return EA; } - -static unsigned (*const GetEA[192])(nec_state_t *)={ - EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, - EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, - EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, - EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, - EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, - EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, - EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, - EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007, - - EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, - EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, - EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, - EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, - EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, - EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, - EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, - EA_100, EA_101, EA_102, EA_103, EA_104, EA_105, EA_106, EA_107, - - EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, - EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, - EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, - EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, - EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, - EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, - EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207, - EA_200, EA_201, EA_202, EA_203, EA_204, EA_205, EA_206, EA_207 -}; diff --git a/jan/src/cpu/nec/necinstr.c b/jan/src/cpu/nec/necinstr.c deleted file mode 100644 index ac8e8a7b6..000000000 --- a/jan/src/cpu/nec/necinstr.c +++ /dev/null @@ -1,673 +0,0 @@ -#define OP(num,func_name) static void func_name(nec_state_t *nec_state) - -OP( 0x00, i_add_br8 ) { DEF_br8; ADDB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,16,7); } -OP( 0x01, i_add_wr16 ) { DEF_wr16; ADDW; PutbackRMWord(ModRM,dst); CLKR(24,24,11,24,16,7,2,EA);} -OP( 0x02, i_add_r8b ) { DEF_r8b; ADDB; RegByte(ModRM)=dst; CLKM(2,2,2,11,11,6); } -OP( 0x03, i_add_r16w ) { DEF_r16w; ADDW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } -OP( 0x04, i_add_ald8 ) { DEF_ald8; ADDB; Breg(AL)=dst; CLKS(4,4,2); } -OP( 0x05, i_add_axd16) { DEF_axd16; ADDW; Wreg(AW)=dst; CLKS(4,4,2); } -OP( 0x06, i_push_es ) { PUSH(Sreg(DS1)); CLKS(12,8,3); } -OP( 0x07, i_pop_es ) { POP(Sreg(DS1)); CLKS(12,8,5); } - -OP( 0x08, i_or_br8 ) { DEF_br8; ORB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,16,7); } -OP( 0x09, i_or_wr16 ) { DEF_wr16; ORW; PutbackRMWord(ModRM,dst); CLKR(24,24,11,24,16,7,2,EA);} -OP( 0x0a, i_or_r8b ) { DEF_r8b; ORB; RegByte(ModRM)=dst; CLKM(2,2,2,11,11,6); } -OP( 0x0b, i_or_r16w ) { DEF_r16w; ORW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } -OP( 0x0c, i_or_ald8 ) { DEF_ald8; ORB; Breg(AL)=dst; CLKS(4,4,2); } -OP( 0x0d, i_or_axd16 ) { DEF_axd16; ORW; Wreg(AW)=dst; CLKS(4,4,2); } -OP( 0x0e, i_push_cs ) { PUSH(Sreg(PS)); CLKS(12,8,3); } -#if defined NEC_CPU_CPP -OP( 0x0f, i_pre_nec ) { UINT32 ModRM, tmp, tmp2; - switch (FETCH()) { - case 0x10 : BITOP_BYTE; CLKS(3,3,4); tmp2 = Breg(CL) & 0x7; nec_state->ZeroVal = (tmp & (1<CarryVal=nec_state->OverVal=0; break; /* Test */ - case 0x11 : BITOP_WORD; CLKS(3,3,4); tmp2 = Breg(CL) & 0xf; nec_state->ZeroVal = (tmp & (1<CarryVal=nec_state->OverVal=0; break; /* Test */ - case 0x12 : BITOP_BYTE; CLKS(5,5,4); tmp2 = Breg(CL) & 0x7; tmp &= ~(1<ZeroVal = (tmp & (1<CarryVal=nec_state->OverVal=0; break; /* Test */ - case 0x19 : BITOP_WORD; CLKS(4,4,4); tmp2 = (FETCH()) & 0xf; nec_state->ZeroVal = (tmp & (1<CarryVal=nec_state->OverVal=0; break; /* Test */ - case 0x1a : BITOP_BYTE; CLKS(6,6,4); tmp2 = (FETCH()) & 0x7; tmp &= ~(1<>8)&0xf); tmp &= 0xff; PutbackRMByte(ModRM,tmp); CLKM(13,13,9,28,28,15); break; - case 0x2a : ModRM = FETCH(); tmp = GetRMByte(ModRM); tmp2 = (Breg(AL) & 0xf)<<4; Breg(AL) = (Breg(AL) & 0xf0) | (tmp&0xf); tmp = tmp2 | (tmp>>4); PutbackRMByte(ModRM,tmp); CLKM(17,17,13,32,32,19); break; - case 0x31 : ModRM = FETCH(); ModRM=0; break; - case 0x33 : ModRM = FETCH(); ModRM=0; break; - case 0xe0 : ModRM = FETCH(); ModRM=0; break; - case 0xf0 : ModRM = FETCH(); ModRM=0; break; - case 0xff : ModRM = FETCH(); ModRM=0; break; -// default: logerror("%06x: Unknown V20 instruction\n",PC(nec_state)); break; - } -} -#endif - -OP( 0x10, i_adc_br8 ) { DEF_br8; src+=CF; ADDB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,16,7); } -OP( 0x11, i_adc_wr16 ) { DEF_wr16; src+=CF; ADDW; PutbackRMWord(ModRM,dst); CLKR(24,24,11,24,16,7,2,EA);} -OP( 0x12, i_adc_r8b ) { DEF_r8b; src+=CF; ADDB; RegByte(ModRM)=dst; CLKM(2,2,2,11,11,6); } -OP( 0x13, i_adc_r16w ) { DEF_r16w; src+=CF; ADDW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } -OP( 0x14, i_adc_ald8 ) { DEF_ald8; src+=CF; ADDB; Breg(AL)=dst; CLKS(4,4,2); } -OP( 0x15, i_adc_axd16) { DEF_axd16; src+=CF; ADDW; Wreg(AW)=dst; CLKS(4,4,2); } -OP( 0x16, i_push_ss ) { PUSH(Sreg(SS)); CLKS(12,8,3); } -OP( 0x17, i_pop_ss ) { POP(Sreg(SS)); CLKS(12,8,5); nec_state->no_interrupt=1; } - -OP( 0x18, i_sbb_br8 ) { DEF_br8; src+=CF; SUBB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,16,7); } -OP( 0x19, i_sbb_wr16 ) { DEF_wr16; src+=CF; SUBW; PutbackRMWord(ModRM,dst); CLKR(24,24,11,24,16,7,2,EA);} -OP( 0x1a, i_sbb_r8b ) { DEF_r8b; src+=CF; SUBB; RegByte(ModRM)=dst; CLKM(2,2,2,11,11,6); } -OP( 0x1b, i_sbb_r16w ) { DEF_r16w; src+=CF; SUBW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } -OP( 0x1c, i_sbb_ald8 ) { DEF_ald8; src+=CF; SUBB; Breg(AL)=dst; CLKS(4,4,2); } -OP( 0x1d, i_sbb_axd16) { DEF_axd16; src+=CF; SUBW; Wreg(AW)=dst; CLKS(4,4,2); } -OP( 0x1e, i_push_ds ) { PUSH(Sreg(DS0)); CLKS(12,8,3); } -OP( 0x1f, i_pop_ds ) { POP(Sreg(DS0)); CLKS(12,8,5); } - -OP( 0x20, i_and_br8 ) { DEF_br8; ANDB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,16,7); } -OP( 0x21, i_and_wr16 ) { DEF_wr16; ANDW; PutbackRMWord(ModRM,dst); CLKR(24,24,11,24,16,7,2,EA);} -OP( 0x22, i_and_r8b ) { DEF_r8b; ANDB; RegByte(ModRM)=dst; CLKM(2,2,2,11,11,6); } -OP( 0x23, i_and_r16w ) { DEF_r16w; ANDW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } -OP( 0x24, i_and_ald8 ) { DEF_ald8; ANDB; Breg(AL)=dst; CLKS(4,4,2); } -OP( 0x25, i_and_axd16) { DEF_axd16; ANDW; Wreg(AW)=dst; CLKS(4,4,2); } -OP( 0x26, i_es ) { nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS1)<<4; CLK(2); nec_instruction[fetchop(nec_state)](nec_state); nec_state->seg_prefix=FALSE; } -OP( 0x27, i_daa ) { ADJ4(6,0x60); CLKS(3,3,2); } - -OP( 0x28, i_sub_br8 ) { DEF_br8; SUBB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,16,7); } -OP( 0x29, i_sub_wr16 ) { DEF_wr16; SUBW; PutbackRMWord(ModRM,dst); CLKR(24,24,11,24,16,7,2,EA);} -OP( 0x2a, i_sub_r8b ) { DEF_r8b; SUBB; RegByte(ModRM)=dst; CLKM(2,2,2,11,11,6); } -OP( 0x2b, i_sub_r16w ) { DEF_r16w; SUBW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } -OP( 0x2c, i_sub_ald8 ) { DEF_ald8; SUBB; Breg(AL)=dst; CLKS(4,4,2); } -OP( 0x2d, i_sub_axd16) { DEF_axd16; SUBW; Wreg(AW)=dst; CLKS(4,4,2); } -OP( 0x2e, i_cs ) { nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(PS)<<4; CLK(2); nec_instruction[fetchop(nec_state)](nec_state); nec_state->seg_prefix=FALSE; } -OP( 0x2f, i_das ) { ADJ4(-6,-0x60); CLKS(3,3,2); } - -OP( 0x30, i_xor_br8 ) { DEF_br8; XORB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,16,7); } -OP( 0x31, i_xor_wr16 ) { DEF_wr16; XORW; PutbackRMWord(ModRM,dst); CLKR(24,24,11,24,16,7,2,EA);} -OP( 0x32, i_xor_r8b ) { DEF_r8b; XORB; RegByte(ModRM)=dst; CLKM(2,2,2,11,11,6); } -OP( 0x33, i_xor_r16w ) { DEF_r16w; XORW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } -OP( 0x34, i_xor_ald8 ) { DEF_ald8; XORB; Breg(AL)=dst; CLKS(4,4,2); } -OP( 0x35, i_xor_axd16) { DEF_axd16; XORW; Wreg(AW)=dst; CLKS(4,4,2); } -OP( 0x36, i_ss ) { nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(SS)<<4; CLK(2); nec_instruction[fetchop(nec_state)](nec_state); nec_state->seg_prefix=FALSE; } -OP( 0x37, i_aaa ) { ADJB(6, (Breg(AL) > 0xf9) ? 2 : 1); CLKS(7,7,4); } - -OP( 0x38, i_cmp_br8 ) { DEF_br8; SUBB; CLKM(2,2,2,11,11,6); } -OP( 0x39, i_cmp_wr16 ) { DEF_wr16; SUBW; CLKR(15,15,8,15,11,6,2,EA);} -OP( 0x3a, i_cmp_r8b ) { DEF_r8b; SUBB; CLKM(2,2,2,11,11,6); } -OP( 0x3b, i_cmp_r16w ) { DEF_r16w; SUBW; CLKR(15,15,8,15,11,6,2,EA); } -OP( 0x3c, i_cmp_ald8 ) { DEF_ald8; SUBB; CLKS(4,4,2); } -OP( 0x3d, i_cmp_axd16) { DEF_axd16; SUBW; CLKS(4,4,2); } -OP( 0x3e, i_ds ) { nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS0)<<4; CLK(2); nec_instruction[fetchop(nec_state)](nec_state); nec_state->seg_prefix=FALSE; } -OP( 0x3f, i_aas ) { ADJB(-6, (Breg(AL) < 6) ? -2 : -1); CLKS(7,7,4); } - -OP( 0x40, i_inc_ax ) { IncWordReg(AW); CLK(2); } -OP( 0x41, i_inc_cx ) { IncWordReg(CW); CLK(2); } -OP( 0x42, i_inc_dx ) { IncWordReg(DW); CLK(2); } -OP( 0x43, i_inc_bx ) { IncWordReg(BW); CLK(2); } -OP( 0x44, i_inc_sp ) { IncWordReg(SP); CLK(2); } -OP( 0x45, i_inc_bp ) { IncWordReg(BP); CLK(2); } -OP( 0x46, i_inc_si ) { IncWordReg(IX); CLK(2); } -OP( 0x47, i_inc_di ) { IncWordReg(IY); CLK(2); } - -OP( 0x48, i_dec_ax ) { DecWordReg(AW); CLK(2); } -OP( 0x49, i_dec_cx ) { DecWordReg(CW); CLK(2); } -OP( 0x4a, i_dec_dx ) { DecWordReg(DW); CLK(2); } -OP( 0x4b, i_dec_bx ) { DecWordReg(BW); CLK(2); } -OP( 0x4c, i_dec_sp ) { DecWordReg(SP); CLK(2); } -OP( 0x4d, i_dec_bp ) { DecWordReg(BP); CLK(2); } -OP( 0x4e, i_dec_si ) { DecWordReg(IX); CLK(2); } -OP( 0x4f, i_dec_di ) { DecWordReg(IY); CLK(2); } - -OP( 0x50, i_push_ax ) { PUSH(Wreg(AW)); CLKS(12,8,3); } -OP( 0x51, i_push_cx ) { PUSH(Wreg(CW)); CLKS(12,8,3); } -OP( 0x52, i_push_dx ) { PUSH(Wreg(DW)); CLKS(12,8,3); } -OP( 0x53, i_push_bx ) { PUSH(Wreg(BW)); CLKS(12,8,3); } -OP( 0x54, i_push_sp ) { PUSH(Wreg(SP)); CLKS(12,8,3); } -OP( 0x55, i_push_bp ) { PUSH(Wreg(BP)); CLKS(12,8,3); } -OP( 0x56, i_push_si ) { PUSH(Wreg(IX)); CLKS(12,8,3); } -OP( 0x57, i_push_di ) { PUSH(Wreg(IY)); CLKS(12,8,3); } - -OP( 0x58, i_pop_ax ) { POP(Wreg(AW)); CLKS(12,8,5); } -OP( 0x59, i_pop_cx ) { POP(Wreg(CW)); CLKS(12,8,5); } -OP( 0x5a, i_pop_dx ) { POP(Wreg(DW)); CLKS(12,8,5); } -OP( 0x5b, i_pop_bx ) { POP(Wreg(BW)); CLKS(12,8,5); } -OP( 0x5c, i_pop_sp ) { POP(Wreg(SP)); CLKS(12,8,5); } -OP( 0x5d, i_pop_bp ) { POP(Wreg(BP)); CLKS(12,8,5); } -OP( 0x5e, i_pop_si ) { POP(Wreg(IX)); CLKS(12,8,5); } -OP( 0x5f, i_pop_di ) { POP(Wreg(IY)); CLKS(12,8,5); } - -OP( 0x60, i_pusha ) { - unsigned tmp=Wreg(SP); - PUSH(Wreg(AW)); - PUSH(Wreg(CW)); - PUSH(Wreg(DW)); - PUSH(Wreg(BW)); - PUSH(tmp); - PUSH(Wreg(BP)); - PUSH(Wreg(IX)); - PUSH(Wreg(IY)); - CLKS(67,35,20); -} -static unsigned nec_popa_tmp; -OP( 0x61, i_popa ) { - POP(Wreg(IY)); - POP(Wreg(IX)); - POP(Wreg(BP)); - POP(nec_popa_tmp); - POP(Wreg(BW)); - POP(Wreg(DW)); - POP(Wreg(CW)); - POP(Wreg(AW)); - CLKS(75,43,22); -} -OP( 0x62, i_chkind ) { - UINT32 low,high,tmp; - GetModRM; - low = GetRMWord(ModRM); - high= GetnextRMWord; - tmp= RegWord(ModRM); - if (tmphigh) { - nec_interrupt(nec_state, NEC_CHKIND_VECTOR, BRK); - } - nec_state->icount-=20; -// logerror("%06x: bound %04x high %04x low %04x tmp\n",PC(nec_state),high,low,tmp); -} -OP( 0x64, i_repnc ) { UINT32 next = fetchop(nec_state); UINT16 c = Wreg(CW); - switch(next) { /* Segments */ - case 0x26: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS1)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x2e: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(PS)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x36: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(SS)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x3e: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS0)<<4; next = fetchop(nec_state); CLK(2); break; - } - - switch(next) { - case 0x6c: CLK(2); if (c) do { i_insb(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0x6d: CLK(2); if (c) do { i_insw(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0x6e: CLK(2); if (c) do { i_outsb(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0x6f: CLK(2); if (c) do { i_outsw(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xa4: CLK(2); if (c) do { i_movsb(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xa5: CLK(2); if (c) do { i_movsw(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xa6: CLK(2); if (c) do { i_cmpsb(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xa7: CLK(2); if (c) do { i_cmpsw(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xaa: CLK(2); if (c) do { i_stosb(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xab: CLK(2); if (c) do { i_stosw(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xac: CLK(2); if (c) do { i_lodsb(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xad: CLK(2); if (c) do { i_lodsw(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xae: CLK(2); if (c) do { i_scasb(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - case 0xaf: CLK(2); if (c) do { i_scasw(nec_state); c--; } while (c>0 && !CF); Wreg(CW)=c; break; - default: nec_instruction[next](nec_state); - } - nec_state->seg_prefix=FALSE; -} - -OP( 0x65, i_repc ) { UINT32 next = fetchop(nec_state); UINT16 c = Wreg(CW); - switch(next) { /* Segments */ - case 0x26: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS1)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x2e: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(PS)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x36: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(SS)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x3e: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS0)<<4; next = fetchop(nec_state); CLK(2); break; - } - - switch(next) { - case 0x6c: CLK(2); if (c) do { i_insb(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0x6d: CLK(2); if (c) do { i_insw(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0x6e: CLK(2); if (c) do { i_outsb(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0x6f: CLK(2); if (c) do { i_outsw(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xa4: CLK(2); if (c) do { i_movsb(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xa5: CLK(2); if (c) do { i_movsw(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xa6: CLK(2); if (c) do { i_cmpsb(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xa7: CLK(2); if (c) do { i_cmpsw(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xaa: CLK(2); if (c) do { i_stosb(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xab: CLK(2); if (c) do { i_stosw(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xac: CLK(2); if (c) do { i_lodsb(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xad: CLK(2); if (c) do { i_lodsw(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xae: CLK(2); if (c) do { i_scasb(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - case 0xaf: CLK(2); if (c) do { i_scasw(nec_state); c--; } while (c>0 && CF); Wreg(CW)=c; break; - default: nec_instruction[next](nec_state); - } - nec_state->seg_prefix=FALSE; -} - -OP( 0x68, i_push_d16 ) { UINT32 tmp; tmp = FETCHWORD(); PUSH(tmp); CLKW(12,12,5,12,8,5,Wreg(SP)); } -OP( 0x69, i_imul_d16 ) { UINT32 tmp; DEF_r16w; tmp = FETCHWORD(); dst = (INT32)((INT16)src)*(INT32)((INT16)tmp); nec_state->CarryVal = nec_state->OverVal = (((INT32)dst) >> 15 != 0) && (((INT32)dst) >> 15 != -1); RegWord(ModRM)=(WORD)dst; nec_state->icount-=(ModRM >=0xc0 )?38:47;} -OP( 0x6a, i_push_d8 ) { UINT32 tmp = (WORD)((INT16)((INT8)FETCH())); PUSH(tmp); CLKW(11,11,5,11,7,3,Wreg(SP)); } -OP( 0x6b, i_imul_d8 ) { UINT32 src2; DEF_r16w; src2= (WORD)((INT16)((INT8)FETCH())); dst = (INT32)((INT16)src)*(INT32)((INT16)src2); nec_state->CarryVal = nec_state->OverVal = (((INT32)dst) >> 15 != 0) && (((INT32)dst) >> 15 != -1); RegWord(ModRM)=(WORD)dst; nec_state->icount-=(ModRM >=0xc0 )?31:39; } -OP( 0x6c, i_insb ) { PutMemB(DS1,Wreg(IY),read_port_byte(Wreg(DW))); Wreg(IY)+= -2 * nec_state->DF + 1; CLK(8); } -OP( 0x6d, i_insw ) { PutMemW(DS1,Wreg(IY),read_port_word(Wreg(DW))); Wreg(IY)+= -4 * nec_state->DF + 2; CLKS(18,10,8); } -OP( 0x6e, i_outsb ) { write_port_byte(Wreg(DW),GetMemB(DS0,Wreg(IX))); Wreg(IX)+= -2 * nec_state->DF + 1; CLK(8); } -OP( 0x6f, i_outsw ) { write_port_word(Wreg(DW),GetMemW(DS0,Wreg(IX))); Wreg(IX)+= -4 * nec_state->DF + 2; CLKS(18,10,8); } - -OP( 0x70, i_jo ) { JMP( OF); CLKS(4,4,3); } -OP( 0x71, i_jno ) { JMP(!OF); CLKS(4,4,3); } -OP( 0x72, i_jc ) { JMP( CF); CLKS(4,4,3); } -OP( 0x73, i_jnc ) { JMP(!CF); CLKS(4,4,3); } -OP( 0x74, i_jz ) { JMP( ZF); CLKS(4,4,3); } -OP( 0x75, i_jnz ) { JMP(!ZF); CLKS(4,4,3); } -OP( 0x76, i_jce ) { JMP(CF || ZF); CLKS(4,4,3); } -OP( 0x77, i_jnce ) { JMP(!(CF || ZF)); CLKS(4,4,3); } -OP( 0x78, i_js ) { JMP( SF); CLKS(4,4,3); } -OP( 0x79, i_jns ) { JMP(!SF); CLKS(4,4,3); } -OP( 0x7a, i_jp ) { JMP( PF); CLKS(4,4,3); } -OP( 0x7b, i_jnp ) { JMP(!PF); CLKS(4,4,3); } -OP( 0x7c, i_jl ) { JMP((SF!=OF)&&(!ZF)); CLKS(4,4,3); } -OP( 0x7d, i_jnl ) { JMP((ZF)||(SF==OF)); CLKS(4,4,3); } -OP( 0x7e, i_jle ) { JMP((ZF)||(SF!=OF)); CLKS(4,4,3); } -OP( 0x7f, i_jnle ) { JMP((SF==OF)&&(!ZF)); CLKS(4,4,3); } - -OP( 0x80, i_80pre ) { UINT32 dst, src; GetModRM; dst = GetRMByte(ModRM); src = FETCH(); - if (ModRM >=0xc0 ) CLKS(4,4,2) else if ((ModRM & 0x38)==0x38) CLKS(13,13,6) else CLKS(18,18,7) - switch (ModRM & 0x38) { - case 0x00: ADDB; PutbackRMByte(ModRM,dst); break; - case 0x08: ORB; PutbackRMByte(ModRM,dst); break; - case 0x10: src+=CF; ADDB; PutbackRMByte(ModRM,dst); break; - case 0x18: src+=CF; SUBB; PutbackRMByte(ModRM,dst); break; - case 0x20: ANDB; PutbackRMByte(ModRM,dst); break; - case 0x28: SUBB; PutbackRMByte(ModRM,dst); break; - case 0x30: XORB; PutbackRMByte(ModRM,dst); break; - case 0x38: SUBB; break; /* CMP */ - } -} - -OP( 0x81, i_81pre ) { UINT32 dst, src; GetModRM; dst = GetRMWord(ModRM); src = FETCH(); src+= (FETCH() << 8); - if (ModRM >=0xc0 ) CLKS(4,4,2) else if ((ModRM & 0x38)==0x38) CLKW(17,17,8,17,13,6,EA) else CLKW(26,26,11,26,18,7,EA) - switch (ModRM & 0x38) { - case 0x00: ADDW; PutbackRMWord(ModRM,dst); break; - case 0x08: ORW; PutbackRMWord(ModRM,dst); break; - case 0x10: src+=CF; ADDW; PutbackRMWord(ModRM,dst); break; - case 0x18: src+=CF; SUBW; PutbackRMWord(ModRM,dst); break; - case 0x20: ANDW; PutbackRMWord(ModRM,dst); break; - case 0x28: SUBW; PutbackRMWord(ModRM,dst); break; - case 0x30: XORW; PutbackRMWord(ModRM,dst); break; - case 0x38: SUBW; break; /* CMP */ - } -} - -OP( 0x82, i_82pre ) { UINT32 dst, src; GetModRM; dst = GetRMByte(ModRM); src = (BYTE)((INT8)FETCH()); - if (ModRM >=0xc0 ) CLKS(4,4,2) else if ((ModRM & 0x38)==0x38) CLKS(13,13,6) else CLKS(18,18,7) - switch (ModRM & 0x38) { - case 0x00: ADDB; PutbackRMByte(ModRM,dst); break; - case 0x08: ORB; PutbackRMByte(ModRM,dst); break; - case 0x10: src+=CF; ADDB; PutbackRMByte(ModRM,dst); break; - case 0x18: src+=CF; SUBB; PutbackRMByte(ModRM,dst); break; - case 0x20: ANDB; PutbackRMByte(ModRM,dst); break; - case 0x28: SUBB; PutbackRMByte(ModRM,dst); break; - case 0x30: XORB; PutbackRMByte(ModRM,dst); break; - case 0x38: SUBB; break; /* CMP */ - } -} - -OP( 0x83, i_83pre ) { UINT32 dst, src; GetModRM; dst = GetRMWord(ModRM); src = (WORD)((INT16)((INT8)FETCH())); - if (ModRM >=0xc0 ) CLKS(4,4,2) else if ((ModRM & 0x38)==0x38) CLKW(17,17,8,17,13,6,EA) else CLKW(26,26,11,26,18,7,EA) - switch (ModRM & 0x38) { - case 0x00: ADDW; PutbackRMWord(ModRM,dst); break; - case 0x08: ORW; PutbackRMWord(ModRM,dst); break; - case 0x10: src+=CF; ADDW; PutbackRMWord(ModRM,dst); break; - case 0x18: src+=CF; SUBW; PutbackRMWord(ModRM,dst); break; - case 0x20: ANDW; PutbackRMWord(ModRM,dst); break; - case 0x28: SUBW; PutbackRMWord(ModRM,dst); break; - case 0x30: XORW; PutbackRMWord(ModRM,dst); break; - case 0x38: SUBW; break; /* CMP */ - } -} - -OP( 0x84, i_test_br8 ) { DEF_br8; ANDB; CLKM(2,2,2,10,10,6); } -OP( 0x85, i_test_wr16 ) { DEF_wr16; ANDW; CLKR(14,14,8,14,10,6,2,EA); } -OP( 0x86, i_xchg_br8 ) { DEF_br8; RegByte(ModRM)=dst; PutbackRMByte(ModRM,src); CLKM(3,3,3,16,18,8); } -OP( 0x87, i_xchg_wr16 ) { DEF_wr16; RegWord(ModRM)=dst; PutbackRMWord(ModRM,src); CLKR(24,24,12,24,16,8,3,EA); } - -OP( 0x88, i_mov_br8 ) { UINT8 src; GetModRM; src = RegByte(ModRM); PutRMByte(ModRM,src); CLKM(2,2,2,9,9,3); } -OP( 0x89, i_mov_wr16 ) { UINT16 src; GetModRM; src = RegWord(ModRM); PutRMWord(ModRM,src); CLKR(13,13,5,13,9,3,2,EA); } -OP( 0x8a, i_mov_r8b ) { UINT8 src; GetModRM; src = GetRMByte(ModRM); RegByte(ModRM)=src; CLKM(2,2,2,11,11,5); } -OP( 0x8b, i_mov_r16w ) { UINT16 src; GetModRM; src = GetRMWord(ModRM); RegWord(ModRM)=src; CLKR(15,15,7,15,11,5,2,EA); } -OP( 0x8c, i_mov_wsreg ) { GetModRM; - switch (ModRM & 0x38) { - case 0x00: PutRMWord(ModRM,Sreg(DS1)); CLKR(14,14,5,14,10,3,2,EA); break; - case 0x08: PutRMWord(ModRM,Sreg(PS)); CLKR(14,14,5,14,10,3,2,EA); break; - case 0x10: PutRMWord(ModRM,Sreg(SS)); CLKR(14,14,5,14,10,3,2,EA); break; - case 0x18: PutRMWord(ModRM,Sreg(DS0)); CLKR(14,14,5,14,10,3,2,EA); break; -// default: logerror("%06x: MOV Sreg - Invalid register\n",PC(nec_state)); - } -} -OP( 0x8d, i_lea ) { UINT16 ModRM = FETCH(); (void)(*GetEA[ModRM])(nec_state); RegWord(ModRM)=EO; CLKS(4,4,2); } -OP( 0x8e, i_mov_sregw ) { UINT16 src; GetModRM; src = GetRMWord(ModRM); CLKR(15,15,7,15,11,5,2,EA); - switch (ModRM & 0x38) { - case 0x00: Sreg(DS1) = src; break; /* mov es,ew */ - case 0x08: Sreg(PS) = src; break; /* mov cs,ew */ - case 0x10: Sreg(SS) = src; break; /* mov ss,ew */ - case 0x18: Sreg(DS0) = src; break; /* mov ds,ew */ -// default: logerror("%06x: MOV Sreg - Invalid register\n",PC(nec_state)); - } - nec_state->no_interrupt=1; -} -OP( 0x8f, i_popw ) { UINT16 tmp; GetModRM; POP(tmp); PutRMWord(ModRM,tmp); nec_state->icount-=21; } -OP( 0x90, i_nop ) { CLK(3); /* { if (nec_state->MF == 0) printf("90 -> %06x: \n",PC(nec_state)); } */ } -OP( 0x91, i_xchg_axcx ) { XchgAWReg(CW); CLK(3); } -OP( 0x92, i_xchg_axdx ) { XchgAWReg(DW); CLK(3); } -OP( 0x93, i_xchg_axbx ) { XchgAWReg(BW); CLK(3); } -OP( 0x94, i_xchg_axsp ) { XchgAWReg(SP); CLK(3); } -OP( 0x95, i_xchg_axbp ) { XchgAWReg(BP); CLK(3); } -OP( 0x96, i_xchg_axsi ) { XchgAWReg(IX); CLK(3); } -OP( 0x97, i_xchg_axdi ) { XchgAWReg(IY); CLK(3); } - -OP( 0x98, i_cbw ) { Breg(AH) = (Breg(AL) & 0x80) ? 0xff : 0; CLK(2); } -OP( 0x99, i_cwd ) { Wreg(DW) = (Breg(AH) & 0x80) ? 0xffff : 0; CLK(4); } -OP( 0x9a, i_call_far ) { UINT32 tmp, tmp2; tmp = FETCHWORD(); tmp2 = FETCHWORD(); PUSH(Sreg(PS)); PUSH(nec_state->ip); nec_state->ip = (WORD)tmp; Sreg(PS) = (WORD)tmp2; CHANGE_PC; CLKW(29,29,13,29,21,9,Wreg(SP)); } -OP( 0x9b, i_wait ) { if (!nec_state->poll_state) nec_state->ip--; CLK(5); } -OP( 0x9c, i_pushf ) { UINT16 tmp = CompressFlags(); PUSH( tmp ); CLKS(12,8,3); } -OP( 0x9d, i_popf ) { UINT32 tmp; POP(tmp); ExpandFlags(tmp); CLKS(12,8,5); if (nec_state->TF) nec_trap(nec_state); } -OP( 0x9e, i_sahf ) { UINT32 tmp = (CompressFlags() & 0xff00) | (Breg(AH) & 0xd5); ExpandFlags(tmp); CLKS(3,3,2); } -OP( 0x9f, i_lahf ) { Breg(AH) = CompressFlags() & 0xff; CLKS(3,3,2); } - -OP( 0xa0, i_mov_aldisp ) { UINT32 addr; addr = FETCHWORD(); Breg(AL) = GetMemB(DS0, addr); CLKS(10,10,5); } -OP( 0xa1, i_mov_axdisp ) { UINT32 addr; addr = FETCHWORD(); Wreg(AW) = GetMemW(DS0, addr); CLKW(14,14,7,14,10,5,addr); } -OP( 0xa2, i_mov_dispal ) { UINT32 addr; addr = FETCHWORD(); PutMemB(DS0, addr, Breg(AL)); CLKS(9,9,3); } -OP( 0xa3, i_mov_dispax ) { UINT32 addr; addr = FETCHWORD(); PutMemW(DS0, addr, Wreg(AW)); CLKW(13,13,5,13,9,3,addr); } -OP( 0xa4, i_movsb ) { UINT32 tmp = GetMemB(DS0,Wreg(IX)); PutMemB(DS1,Wreg(IY), tmp); Wreg(IY) += -2 * nec_state->DF + 1; Wreg(IX) += -2 * nec_state->DF + 1; CLKS(8,8,6); } -OP( 0xa5, i_movsw ) { UINT32 tmp = GetMemW(DS0,Wreg(IX)); PutMemW(DS1,Wreg(IY), tmp); Wreg(IY) += -4 * nec_state->DF + 2; Wreg(IX) += -4 * nec_state->DF + 2; CLKS(16,16,10); } -OP( 0xa6, i_cmpsb ) { UINT32 src = GetMemB(DS1, Wreg(IY)); UINT32 dst = GetMemB(DS0, Wreg(IX)); SUBB; Wreg(IY) += -2 * nec_state->DF + 1; Wreg(IX) += -2 * nec_state->DF + 1; CLKS(14,14,14); } -OP( 0xa7, i_cmpsw ) { UINT32 src = GetMemW(DS1, Wreg(IY)); UINT32 dst = GetMemW(DS0, Wreg(IX)); SUBW; Wreg(IY) += -4 * nec_state->DF + 2; Wreg(IX) += -4 * nec_state->DF + 2; CLKS(14,14,14); } - -OP( 0xa8, i_test_ald8 ) { DEF_ald8; ANDB; CLKS(4,4,2); } -OP( 0xa9, i_test_axd16 ) { DEF_axd16; ANDW; CLKS(4,4,2); } -OP( 0xaa, i_stosb ) { PutMemB(DS1,Wreg(IY),Breg(AL)); Wreg(IY) += -2 * nec_state->DF + 1; CLKS(4,4,3); } -OP( 0xab, i_stosw ) { PutMemW(DS1,Wreg(IY),Wreg(AW)); Wreg(IY) += -4 * nec_state->DF + 2; CLKW(8,8,5,8,4,3,Wreg(IY)); } -OP( 0xac, i_lodsb ) { Breg(AL) = GetMemB(DS0,Wreg(IX)); Wreg(IX) += -2 * nec_state->DF + 1; CLKS(4,4,3); } -OP( 0xad, i_lodsw ) { Wreg(AW) = GetMemW(DS0,Wreg(IX)); Wreg(IX) += -4 * nec_state->DF + 2; CLKW(8,8,5,8,4,3,Wreg(IX)); } -OP( 0xae, i_scasb ) { UINT32 src = GetMemB(DS1, Wreg(IY)); UINT32 dst = Breg(AL); SUBB; Wreg(IY) += -2 * nec_state->DF + 1; CLKS(4,4,3); } -OP( 0xaf, i_scasw ) { UINT32 src = GetMemW(DS1, Wreg(IY)); UINT32 dst = Wreg(AW); SUBW; Wreg(IY) += -4 * nec_state->DF + 2; CLKW(8,8,5,8,4,3,Wreg(IY)); } - -OP( 0xb0, i_mov_ald8 ) { Breg(AL) = FETCH(); CLKS(4,4,2); } -OP( 0xb1, i_mov_cld8 ) { Breg(CL) = FETCH(); CLKS(4,4,2); } -OP( 0xb2, i_mov_dld8 ) { Breg(DL) = FETCH(); CLKS(4,4,2); } -OP( 0xb3, i_mov_bld8 ) { Breg(BL) = FETCH(); CLKS(4,4,2); } -OP( 0xb4, i_mov_ahd8 ) { Breg(AH) = FETCH(); CLKS(4,4,2); } -OP( 0xb5, i_mov_chd8 ) { Breg(CH) = FETCH(); CLKS(4,4,2); } -OP( 0xb6, i_mov_dhd8 ) { Breg(DH) = FETCH(); CLKS(4,4,2); } -OP( 0xb7, i_mov_bhd8 ) { Breg(BH) = FETCH(); CLKS(4,4,2); } - -OP( 0xb8, i_mov_axd16 ) { Breg(AL) = FETCH(); Breg(AH) = FETCH(); CLKS(4,4,2); } -OP( 0xb9, i_mov_cxd16 ) { Breg(CL) = FETCH(); Breg(CH) = FETCH(); CLKS(4,4,2); } -OP( 0xba, i_mov_dxd16 ) { Breg(DL) = FETCH(); Breg(DH) = FETCH(); CLKS(4,4,2); } -OP( 0xbb, i_mov_bxd16 ) { Breg(BL) = FETCH(); Breg(BH) = FETCH(); CLKS(4,4,2); } -OP( 0xbc, i_mov_spd16 ) { Wreg(SP) = FETCHWORD(); CLKS(4,4,2); } -OP( 0xbd, i_mov_bpd16 ) { Wreg(BP) = FETCHWORD(); CLKS(4,4,2); } -OP( 0xbe, i_mov_sid16 ) { Wreg(IX) = FETCHWORD(); CLKS(4,4,2); } -OP( 0xbf, i_mov_did16 ) { Wreg(IY) = FETCHWORD(); CLKS(4,4,2); } - -OP( 0xc0, i_rotshft_bd8 ) { - UINT32 src, dst; UINT8 c; - GetModRM; src = (unsigned)GetRMByte(ModRM); dst=src; - c=FETCH(); - CLKM(7,7,2,19,19,6); - if (c) switch (ModRM & 0x38) { - case 0x00: do { ROL_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; - case 0x08: do { ROR_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; - case 0x10: do { ROLC_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; - case 0x18: do { RORC_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; - case 0x20: SHL_BYTE(c); break; - case 0x28: SHR_BYTE(c); break; -// case 0x30: logerror("%06x: Undefined opcode 0xc0 0x30 (SHLA)\n",PC(nec_state)); break; - case 0x38: SHRA_BYTE(c); break; - } -} - -OP( 0xc1, i_rotshft_wd8 ) { - UINT32 src, dst; UINT8 c; - GetModRM; src = (unsigned)GetRMWord(ModRM); dst=src; - c=FETCH(); - CLKM(7,7,2,27,19,6); - if (c) switch (ModRM & 0x38) { - case 0x00: do { ROL_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; - case 0x08: do { ROR_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; - case 0x10: do { ROLC_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; - case 0x18: do { RORC_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; - case 0x20: SHL_WORD(c); break; - case 0x28: SHR_WORD(c); break; -// case 0x30: logerror("%06x: Undefined opcode 0xc1 0x30 (SHLA)\n",PC(nec_state)); break; - case 0x38: SHRA_WORD(c); break; - } -} - -OP( 0xc2, i_ret_d16 ) { UINT32 count = FETCH(); count += FETCH() << 8; POP(nec_state->ip); Wreg(SP)+=count; CHANGE_PC; CLKS(24,24,10); } -OP( 0xc3, i_ret ) { POP(nec_state->ip); CHANGE_PC; CLKS(19,19,10); } -OP( 0xc4, i_les_dw ) { GetModRM; WORD tmp = GetRMWord(ModRM); RegWord(ModRM)=tmp; Sreg(DS1) = GetnextRMWord; CLKW(26,26,14,26,18,10,EA); } -OP( 0xc5, i_lds_dw ) { GetModRM; WORD tmp = GetRMWord(ModRM); RegWord(ModRM)=tmp; Sreg(DS0) = GetnextRMWord; CLKW(26,26,14,26,18,10,EA); } -OP( 0xc6, i_mov_bd8 ) { GetModRM; PutImmRMByte(ModRM); nec_state->icount-=(ModRM >=0xc0 )?4:11; } -OP( 0xc7, i_mov_wd16 ) { GetModRM; PutImmRMWord(ModRM); nec_state->icount-=(ModRM >=0xc0 )?4:15; } - -OP( 0xc8, i_enter ) { - UINT32 nb = FETCH(); - UINT32 i,level; - - nec_state->icount-=23; - nb += FETCH() << 8; - level = FETCH(); - PUSH(Wreg(BP)); - Wreg(BP)=Wreg(SP); - Wreg(SP) -= nb; - for (i=1;iicount-=16; - } - if (level) PUSH(Wreg(BP)); -} -OP( 0xc9, i_leave ) { - Wreg(SP)=Wreg(BP); - POP(Wreg(BP)); - nec_state->icount-=8; -} -OP( 0xca, i_retf_d16 ) { UINT32 count = FETCH(); count += FETCH() << 8; POP(nec_state->ip); POP(Sreg(PS)); Wreg(SP)+=count; CHANGE_PC; CLKS(32,32,16); } -OP( 0xcb, i_retf ) { POP(nec_state->ip); POP(Sreg(PS)); CHANGE_PC; CLKS(29,29,16); } -OP( 0xcc, i_int3 ) { nec_interrupt(nec_state, 3, BRK); CLKS(50,50,24); } -OP( 0xcd, i_int ) { nec_interrupt(nec_state, FETCH(), BRK); CLKS(50,50,24); } -OP( 0xce, i_into ) { if (OF) { nec_interrupt(nec_state, NEC_BRKV_VECTOR, BRK); CLKS(52,52,26); } else CLK(3); } -OP( 0xcf, i_iret ) { POP(nec_state->ip); POP(Sreg(PS)); i_popf(nec_state); CHANGE_PC; CLKS(39,39,19); } - -OP( 0xd0, i_rotshft_b ) { - UINT32 src, dst; GetModRM; src = (UINT32)GetRMByte(ModRM); dst=src; - CLKM(6,6,2,16,16,7); - switch (ModRM & 0x38) { - case 0x00: ROL_BYTE; PutbackRMByte(ModRM,(BYTE)dst); nec_state->OverVal = (src^dst)&0x80; break; - case 0x08: ROR_BYTE; PutbackRMByte(ModRM,(BYTE)dst); nec_state->OverVal = (src^dst)&0x80; break; - case 0x10: ROLC_BYTE; PutbackRMByte(ModRM,(BYTE)dst); nec_state->OverVal = (src^dst)&0x80; break; - case 0x18: RORC_BYTE; PutbackRMByte(ModRM,(BYTE)dst); nec_state->OverVal = (src^dst)&0x80; break; - case 0x20: SHL_BYTE(1); nec_state->OverVal = (src^dst)&0x80; break; - case 0x28: SHR_BYTE(1); nec_state->OverVal = (src^dst)&0x80; break; -// case 0x30: logerror("%06x: Undefined opcode 0xd0 0x30 (SHLA)\n",PC(nec_state)); break; - case 0x38: SHRA_BYTE(1); nec_state->OverVal = 0; break; - } -} - -OP( 0xd1, i_rotshft_w ) { - UINT32 src, dst; GetModRM; src = (UINT32)GetRMWord(ModRM); dst=src; - CLKM(6,6,2,24,16,7); - switch (ModRM & 0x38) { - case 0x00: ROL_WORD; PutbackRMWord(ModRM,(WORD)dst); nec_state->OverVal = (src^dst)&0x8000; break; - case 0x08: ROR_WORD; PutbackRMWord(ModRM,(WORD)dst); nec_state->OverVal = (src^dst)&0x8000; break; - case 0x10: ROLC_WORD; PutbackRMWord(ModRM,(WORD)dst); nec_state->OverVal = (src^dst)&0x8000; break; - case 0x18: RORC_WORD; PutbackRMWord(ModRM,(WORD)dst); nec_state->OverVal = (src^dst)&0x8000; break; - case 0x20: SHL_WORD(1); nec_state->OverVal = (src^dst)&0x8000; break; - case 0x28: SHR_WORD(1); nec_state->OverVal = (src^dst)&0x8000; break; -// case 0x30: logerror("%06x: Undefined opcode 0xd1 0x30 (SHLA)\n",PC(nec_state)); break; - case 0x38: SHRA_WORD(1); nec_state->OverVal = 0; break; - } -} - -OP( 0xd2, i_rotshft_bcl ) { - UINT32 src, dst; UINT8 c; GetModRM; src = (UINT32)GetRMByte(ModRM); dst=src; - c=Breg(CL); - CLKM(7,7,2,19,19,6); - if (c) switch (ModRM & 0x38) { - case 0x00: do { ROL_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; - case 0x08: do { ROR_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; - case 0x10: do { ROLC_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; - case 0x18: do { RORC_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; - case 0x20: SHL_BYTE(c); break; - case 0x28: SHR_BYTE(c); break; -// case 0x30: logerror("%06x: Undefined opcode 0xd2 0x30 (SHLA)\n",PC(nec_state)); break; - case 0x38: SHRA_BYTE(c); break; - } -} - -OP( 0xd3, i_rotshft_wcl ) { - UINT32 src, dst; UINT8 c; GetModRM; src = (UINT32)GetRMWord(ModRM); dst=src; - c=Breg(CL); - CLKM(7,7,2,27,19,6); - if (c) switch (ModRM & 0x38) { - case 0x00: do { ROL_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; - case 0x08: do { ROR_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; - case 0x10: do { ROLC_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; - case 0x18: do { RORC_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; - case 0x20: SHL_WORD(c); break; - case 0x28: SHR_WORD(c); break; -// case 0x30: logerror("%06x: Undefined opcode 0xd3 0x30 (SHLA)\n",PC(nec_state)); break; - case 0x38: SHRA_WORD(c); break; - } -} - -OP( 0xd4, i_aam ) { FETCH(); Breg(AH) = Breg(AL) / 10; Breg(AL) %= 10; SetSZPF_Word(Wreg(AW)); CLKS(15,15,12); } -OP( 0xd5, i_aad ) { FETCH(); Breg(AL) = Breg(AH) * 10 + Breg(AL); Breg(AH) = 0; SetSZPF_Byte(Breg(AL)); CLKS(7,7,8); } -OP( 0xd6, i_setalc ) { Breg(AL) = (CF)?0xff:0x00; nec_state->icount-=3; } -OP( 0xd7, i_trans ) { UINT32 dest = (Wreg(BW)+Breg(AL))&0xffff; Breg(AL) = GetMemB(DS0, dest); CLKS(9,9,5); } -OP( 0xd8, i_fpo ) { GetModRM; ModRM = ModRM; nec_state->icount-=2; } - -OP( 0xe0, i_loopne ) { INT8 disp = (INT8)FETCH(); Wreg(CW)--; if (!ZF && Wreg(CW)) { nec_state->ip = (WORD)(nec_state->ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } -OP( 0xe1, i_loope ) { INT8 disp = (INT8)FETCH(); Wreg(CW)--; if ( ZF && Wreg(CW)) { nec_state->ip = (WORD)(nec_state->ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } -OP( 0xe2, i_loop ) { INT8 disp = (INT8)FETCH(); Wreg(CW)--; if (Wreg(CW)) { nec_state->ip = (WORD)(nec_state->ip+disp); /*CHANGE_PC;*/ CLKS(13,13,6); } else CLKS(5,5,3); } -OP( 0xe3, i_jcxz ) { INT8 disp = (INT8)FETCH(); if (Wreg(CW) == 0) { nec_state->ip = (WORD)(nec_state->ip+disp); /*CHANGE_PC;*/ CLKS(13,13,6); } else CLKS(5,5,3); } -OP( 0xe4, i_inal ) { UINT8 port = FETCH(); Breg(AL) = read_port_byte(port); CLKS(9,9,5); } -OP( 0xe5, i_inax ) { UINT8 port = FETCH(); Wreg(AW) = read_port_word(port); CLKW(13,13,7,13,9,5,port); } -OP( 0xe6, i_outal ) { UINT8 port = FETCH(); write_port_byte(port, Breg(AL)); CLKS(8,8,3); } -OP( 0xe7, i_outax ) { UINT8 port = FETCH(); write_port_word(port, Wreg(AW)); CLKW(12,12,5,12,8,3,port); } - -OP( 0xe8, i_call_d16 ) { UINT32 tmp; tmp = FETCHWORD(); PUSH(nec_state->ip); nec_state->ip = (WORD)(nec_state->ip+(INT16)tmp); CHANGE_PC; nec_state->icount-=24; } -OP( 0xe9, i_jmp_d16 ) { UINT32 tmp; tmp = FETCHWORD(); nec_state->ip = (WORD)(nec_state->ip+(INT16)tmp); CHANGE_PC; nec_state->icount-=15; } -OP( 0xea, i_jmp_far ) { UINT32 tmp,tmp1; tmp = FETCHWORD(); tmp1 = FETCHWORD(); Sreg(PS) = (WORD)tmp1; nec_state->ip = (WORD)tmp; CHANGE_PC; nec_state->icount-=27; } -OP( 0xeb, i_jmp_d8 ) { int tmp = (int)((INT8)FETCH()); nec_state->icount-=12; nec_state->ip = (WORD)(nec_state->ip+tmp); } -OP( 0xec, i_inaldx ) { Breg(AL) = read_port_byte(Wreg(DW)); CLKS(8,8,5);} -OP( 0xed, i_inaxdx ) { Wreg(AW) = read_port_word(Wreg(DW)); CLKW(12,12,7,12,8,5,Wreg(DW)); } -OP( 0xee, i_outdxal ) { write_port_byte(Wreg(DW), Breg(AL)); CLKS(8,8,3); } -OP( 0xef, i_outdxax ) { write_port_word(Wreg(DW), Wreg(AW)); CLKW(12,12,5,12,8,3,Wreg(DW)); } - -OP( 0xf0, i_lock ) { nec_state->no_interrupt=1; CLK(2); } -OP( 0xf2, i_repne ) { UINT32 next = fetchop(nec_state); UINT16 c = Wreg(CW); - switch(next) { /* Segments */ - case 0x26: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS1)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x2e: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(PS)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x36: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(SS)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x3e: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS0)<<4; next = fetchop(nec_state); CLK(2); break; - } - - switch(next) { - case 0x6c: CLK(2); if (c) do { i_insb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0x6d: CLK(2); if (c) do { i_insw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0x6e: CLK(2); if (c) do { i_outsb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0x6f: CLK(2); if (c) do { i_outsw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xa4: CLK(2); if (c) do { i_movsb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xa5: CLK(2); if (c) do { i_movsw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xa6: CLK(2); if (c) do { i_cmpsb(nec_state); c--; } while (c>0 && ZF==0); Wreg(CW)=c; break; - case 0xa7: CLK(2); if (c) do { i_cmpsw(nec_state); c--; } while (c>0 && ZF==0); Wreg(CW)=c; break; - case 0xaa: CLK(2); if (c) do { i_stosb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xab: CLK(2); if (c) do { i_stosw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xac: CLK(2); if (c) do { i_lodsb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xad: CLK(2); if (c) do { i_lodsw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xae: CLK(2); if (c) do { i_scasb(nec_state); c--; } while (c>0 && ZF==0); Wreg(CW)=c; break; - case 0xaf: CLK(2); if (c) do { i_scasw(nec_state); c--; } while (c>0 && ZF==0); Wreg(CW)=c; break; - default: nec_instruction[next](nec_state); - } - nec_state->seg_prefix=FALSE; -} -OP( 0xf3, i_repe ) { UINT32 next = fetchop(nec_state); UINT16 c = Wreg(CW); - switch(next) { /* Segments */ - case 0x26: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS1)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x2e: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(PS)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x36: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(SS)<<4; next = fetchop(nec_state); CLK(2); break; - case 0x3e: nec_state->seg_prefix=TRUE; nec_state->prefix_base=Sreg(DS0)<<4; next = fetchop(nec_state); CLK(2); break; - } - - switch(next) { - case 0x6c: CLK(2); if (c) do { i_insb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0x6d: CLK(2); if (c) do { i_insw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0x6e: CLK(2); if (c) do { i_outsb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0x6f: CLK(2); if (c) do { i_outsw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xa4: CLK(2); if (c) do { i_movsb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xa5: CLK(2); if (c) do { i_movsw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xa6: CLK(2); if (c) do { i_cmpsb(nec_state); c--; } while (c>0 && ZF==1); Wreg(CW)=c; break; - case 0xa7: CLK(2); if (c) do { i_cmpsw(nec_state); c--; } while (c>0 && ZF==1); Wreg(CW)=c; break; - case 0xaa: CLK(2); if (c) do { i_stosb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xab: CLK(2); if (c) do { i_stosw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xac: CLK(2); if (c) do { i_lodsb(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xad: CLK(2); if (c) do { i_lodsw(nec_state); c--; } while (c>0); Wreg(CW)=c; break; - case 0xae: CLK(2); if (c) do { i_scasb(nec_state); c--; } while (c>0 && ZF==1); Wreg(CW)=c; break; - case 0xaf: CLK(2); if (c) do { i_scasw(nec_state); c--; } while (c>0 && ZF==1); Wreg(CW)=c; break; - default: nec_instruction[next](nec_state); - } - nec_state->seg_prefix=FALSE; -} -OP( 0xf4, i_hlt ) { nec_state->halted=1; nec_state->icount=0; } -OP( 0xf5, i_cmc ) { nec_state->CarryVal = !CF; CLK(2); } -OP( 0xf6, i_f6pre ) { UINT32 tmp; UINT32 uresult,uresult2; INT32 result,result2; - GetModRM; tmp = GetRMByte(ModRM); - switch (ModRM & 0x38) { - case 0x00: tmp &= FETCH(); nec_state->CarryVal = nec_state->OverVal = 0; SetSZPF_Byte(tmp); nec_state->icount-=(ModRM >=0xc0 )?4:11; break; /* TEST */ -// case 0x08: logerror("%06x: Undefined opcode 0xf6 0x08\n",PC(nec_state)); break; - case 0x10: PutbackRMByte(ModRM,~tmp); nec_state->icount-=(ModRM >=0xc0 )?2:16; break; /* NOT */ - case 0x18: nec_state->CarryVal=(tmp!=0); tmp=(~tmp)+1; SetSZPF_Byte(tmp); PutbackRMByte(ModRM,tmp&0xff); nec_state->icount-=(ModRM >=0xc0 )?2:16; break; /* NEG */ - case 0x20: uresult = Breg(AL)*tmp; Wreg(AW)=(WORD)uresult; nec_state->CarryVal=nec_state->OverVal=(Breg(AH)!=0); nec_state->icount-=(ModRM >=0xc0 )?30:36; break; /* MULU */ - case 0x28: result = (INT16)((INT8)Breg(AL))*(INT16)((INT8)tmp); Wreg(AW)=(WORD)result; nec_state->CarryVal=nec_state->OverVal=(Breg(AH)!=0); nec_state->icount-=(ModRM >=0xc0 )?30:36; break; /* MUL */ - case 0x30: if (tmp) { DIVUB; } else nec_interrupt(nec_state, NEC_DIVIDE_VECTOR, BRK); nec_state->icount-=(ModRM >=0xc0 )?43:53; break; - case 0x38: if (tmp) { DIVB; } else nec_interrupt(nec_state, NEC_DIVIDE_VECTOR, BRK); nec_state->icount-=(ModRM >=0xc0 )?43:53; break; - } -} - -OP( 0xf7, i_f7pre ) { UINT32 tmp,tmp2; UINT32 uresult,uresult2; INT32 result,result2; - GetModRM; tmp = GetRMWord(ModRM); - switch (ModRM & 0x38) { - case 0x00: tmp2 = FETCHWORD(); tmp &= tmp2; nec_state->CarryVal = nec_state->OverVal = 0; SetSZPF_Word(tmp); nec_state->icount-=(ModRM >=0xc0 )?4:11; break; /* TEST */ -// case 0x08: logerror("%06x: Undefined opcode 0xf7 0x08\n",PC(nec_state)); break; - case 0x10: PutbackRMWord(ModRM,~tmp); nec_state->icount-=(ModRM >=0xc0 )?2:16; break; /* NOT */ - case 0x18: nec_state->CarryVal=(tmp!=0); tmp=(~tmp)+1; SetSZPF_Word(tmp); PutbackRMWord(ModRM,tmp&0xffff); nec_state->icount-=(ModRM >=0xc0 )?2:16; break; /* NEG */ - case 0x20: uresult = Wreg(AW)*tmp; Wreg(AW)=uresult&0xffff; Wreg(DW)=((UINT32)uresult)>>16; nec_state->CarryVal=nec_state->OverVal=(Wreg(DW)!=0); nec_state->icount-=(ModRM >=0xc0 )?30:36; break; /* MULU */ - case 0x28: result = (INT32)((INT16)Wreg(AW))*(INT32)((INT16)tmp); Wreg(AW)=result&0xffff; Wreg(DW)=result>>16; nec_state->CarryVal=nec_state->OverVal=(Wreg(DW)!=0); nec_state->icount-=(ModRM >=0xc0 )?30:36; break; /* MUL */ - case 0x30: if (tmp) { DIVUW; } else nec_interrupt(nec_state, NEC_DIVIDE_VECTOR, BRK); nec_state->icount-=(ModRM >=0xc0 )?43:53; break; - case 0x38: if (tmp) { DIVW; } else nec_interrupt(nec_state, NEC_DIVIDE_VECTOR, BRK); nec_state->icount-=(ModRM >=0xc0 )?43:53; break; - } -} - -OP( 0xf8, i_clc ) { nec_state->CarryVal = 0; CLK(2); } -OP( 0xf9, i_stc ) { nec_state->CarryVal = 1; CLK(2); } -OP( 0xfa, i_di ) { SetIF(0); CLK(2); } -OP( 0xfb, i_ei ) { SetIF(1); CLK(2); } -OP( 0xfc, i_cld ) { SetDF(0); CLK(2); } -OP( 0xfd, i_std ) { SetDF(1); CLK(2); } -OP( 0xfe, i_fepre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMByte(ModRM); - switch(ModRM & 0x38) { - case 0x00: tmp1 = tmp+1; nec_state->OverVal = (tmp==0x7f); SetAF(tmp1,tmp,1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM,(BYTE)tmp1); CLKM(2,2,2,16,16,7); break; /* INC */ - case 0x08: tmp1 = tmp-1; nec_state->OverVal = (tmp==0x80); SetAF(tmp1,tmp,1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM,(BYTE)tmp1); CLKM(2,2,2,16,16,7); break; /* DEC */ -// default: logerror("%06x: FE Pre with unimplemented mod\n",PC(nec_state)); - } -} -OP( 0xff, i_ffpre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMWord(ModRM); - switch(ModRM & 0x38) { - case 0x00: tmp1 = tmp+1; nec_state->OverVal = (tmp==0x7fff); SetAF(tmp1,tmp,1); SetSZPF_Word(tmp1); PutbackRMWord(ModRM,(WORD)tmp1); CLKM(2,2,2,24,16,7); break; /* INC */ - case 0x08: tmp1 = tmp-1; nec_state->OverVal = (tmp==0x8000); SetAF(tmp1,tmp,1); SetSZPF_Word(tmp1); PutbackRMWord(ModRM,(WORD)tmp1); CLKM(2,2,2,24,16,7); break; /* DEC */ - case 0x10: PUSH(nec_state->ip); nec_state->ip = (WORD)tmp; CHANGE_PC; nec_state->icount-=(ModRM >=0xc0 )?16:20; break; /* CALL */ - case 0x18: tmp1 = Sreg(PS); Sreg(PS) = GetnextRMWord; PUSH(tmp1); PUSH(nec_state->ip); nec_state->ip = tmp; CHANGE_PC; nec_state->icount-=(ModRM >=0xc0 )?16:26; break; /* CALL FAR */ - case 0x20: nec_state->ip = tmp; CHANGE_PC; nec_state->icount-=13; break; /* JMP */ - case 0x28: nec_state->ip = tmp; Sreg(PS) = GetnextRMWord; CHANGE_PC; nec_state->icount-=15; break; /* JMP FAR */ - case 0x30: PUSH(tmp); nec_state->icount-=4; break; -// default: logerror("%06x: FF Pre with unimplemented mod\n",PC(nec_state)); - } -} - -static void i_invalid(nec_state_t *nec_state) -{ - nec_state->icount-=10; -// logerror("%06x: Invalid Opcode\n",PC(nec_state)); -} diff --git a/jan/src/cpu/nec/necinstr.h b/jan/src/cpu/nec/necinstr.h deleted file mode 100644 index 30bc3ffcb..000000000 --- a/jan/src/cpu/nec/necinstr.h +++ /dev/null @@ -1,507 +0,0 @@ -static void i_add_br8(nec_state_t *nec_state); -static void i_add_wr16(nec_state_t *nec_state); -static void i_add_r8b(nec_state_t *nec_state); -static void i_add_r16w(nec_state_t *nec_state); -static void i_add_ald8(nec_state_t *nec_state); -static void i_add_axd16(nec_state_t *nec_state); -static void i_push_es(nec_state_t *nec_state); -static void i_pop_es(nec_state_t *nec_state); -static void i_or_br8(nec_state_t *nec_state); -static void i_or_r8b(nec_state_t *nec_state); -static void i_or_wr16(nec_state_t *nec_state); -static void i_or_r16w(nec_state_t *nec_state); -static void i_or_ald8(nec_state_t *nec_state); -static void i_or_axd16(nec_state_t *nec_state); -static void i_push_cs(nec_state_t *nec_state); -static void i_pre_nec(nec_state_t *nec_state); -static void i_adc_br8(nec_state_t *nec_state); -static void i_adc_wr16(nec_state_t *nec_state); -static void i_adc_r8b(nec_state_t *nec_state); -static void i_adc_r16w(nec_state_t *nec_state); -static void i_adc_ald8(nec_state_t *nec_state); -static void i_adc_axd16(nec_state_t *nec_state); -static void i_push_ss(nec_state_t *nec_state); -static void i_pop_ss(nec_state_t *nec_state); -static void i_sbb_br8(nec_state_t *nec_state); -static void i_sbb_wr16(nec_state_t *nec_state); -static void i_sbb_r8b(nec_state_t *nec_state); -static void i_sbb_r16w(nec_state_t *nec_state); -static void i_sbb_ald8(nec_state_t *nec_state); -static void i_sbb_axd16(nec_state_t *nec_state); -static void i_push_ds(nec_state_t *nec_state); -static void i_pop_ds(nec_state_t *nec_state); -static void i_and_br8(nec_state_t *nec_state); -static void i_and_r8b(nec_state_t *nec_state); -static void i_and_wr16(nec_state_t *nec_state); -static void i_and_r16w(nec_state_t *nec_state); -static void i_and_ald8(nec_state_t *nec_state); -static void i_and_axd16(nec_state_t *nec_state); -static void i_es(nec_state_t *nec_state); -static void i_daa(nec_state_t *nec_state); -static void i_sub_br8(nec_state_t *nec_state); -static void i_sub_wr16(nec_state_t *nec_state); -static void i_sub_r8b(nec_state_t *nec_state); -static void i_sub_r16w(nec_state_t *nec_state); -static void i_sub_ald8(nec_state_t *nec_state); -static void i_sub_axd16(nec_state_t *nec_state); -static void i_cs(nec_state_t *nec_state); -static void i_das(nec_state_t *nec_state); -static void i_xor_br8(nec_state_t *nec_state); -static void i_xor_r8b(nec_state_t *nec_state); -static void i_xor_wr16(nec_state_t *nec_state); -static void i_xor_r16w(nec_state_t *nec_state); -static void i_xor_ald8(nec_state_t *nec_state); -static void i_xor_axd16(nec_state_t *nec_state); -static void i_ss(nec_state_t *nec_state); -static void i_aaa(nec_state_t *nec_state); -static void i_cmp_br8(nec_state_t *nec_state); -static void i_cmp_wr16(nec_state_t *nec_state); -static void i_cmp_r8b(nec_state_t *nec_state); -static void i_cmp_r16w(nec_state_t *nec_state); -static void i_cmp_ald8(nec_state_t *nec_state); -static void i_cmp_axd16(nec_state_t *nec_state); -static void i_ds(nec_state_t *nec_state); -static void i_aas(nec_state_t *nec_state); -static void i_inc_ax(nec_state_t *nec_state); -static void i_inc_cx(nec_state_t *nec_state); -static void i_inc_dx(nec_state_t *nec_state); -static void i_inc_bx(nec_state_t *nec_state); -static void i_inc_sp(nec_state_t *nec_state); -static void i_inc_bp(nec_state_t *nec_state); -static void i_inc_si(nec_state_t *nec_state); -static void i_inc_di(nec_state_t *nec_state); -static void i_dec_ax(nec_state_t *nec_state); -static void i_dec_cx(nec_state_t *nec_state); -static void i_dec_dx(nec_state_t *nec_state); -static void i_dec_bx(nec_state_t *nec_state); -static void i_dec_sp(nec_state_t *nec_state); -static void i_dec_bp(nec_state_t *nec_state); -static void i_dec_si(nec_state_t *nec_state); -static void i_dec_di(nec_state_t *nec_state); -static void i_push_ax(nec_state_t *nec_state); -static void i_push_cx(nec_state_t *nec_state); -static void i_push_dx(nec_state_t *nec_state); -static void i_push_bx(nec_state_t *nec_state); -static void i_push_sp(nec_state_t *nec_state); -static void i_push_bp(nec_state_t *nec_state); -static void i_push_si(nec_state_t *nec_state); -static void i_push_di(nec_state_t *nec_state); -static void i_pop_ax(nec_state_t *nec_state); -static void i_pop_cx(nec_state_t *nec_state); -static void i_pop_dx(nec_state_t *nec_state); -static void i_pop_bx(nec_state_t *nec_state); -static void i_pop_sp(nec_state_t *nec_state); -static void i_pop_bp(nec_state_t *nec_state); -static void i_pop_si(nec_state_t *nec_state); -static void i_pop_di(nec_state_t *nec_state); -static void i_pusha(nec_state_t *nec_state); -static void i_popa(nec_state_t *nec_state); -static void i_chkind(nec_state_t *nec_state); -static void i_repnc(nec_state_t *nec_state); -static void i_repc(nec_state_t *nec_state); -static void i_push_d16(nec_state_t *nec_state); -static void i_imul_d16(nec_state_t *nec_state); -static void i_push_d8(nec_state_t *nec_state); -static void i_imul_d8(nec_state_t *nec_state); -static void i_insb(nec_state_t *nec_state); -static void i_insw(nec_state_t *nec_state); -static void i_outsb(nec_state_t *nec_state); -static void i_outsw(nec_state_t *nec_state); -static void i_jo(nec_state_t *nec_state); -static void i_jno(nec_state_t *nec_state); -static void i_jc(nec_state_t *nec_state); -static void i_jnc(nec_state_t *nec_state); -static void i_jz(nec_state_t *nec_state); -static void i_jnz(nec_state_t *nec_state); -static void i_jce(nec_state_t *nec_state); -static void i_jnce(nec_state_t *nec_state); -static void i_js(nec_state_t *nec_state); -static void i_jns(nec_state_t *nec_state); -static void i_jp(nec_state_t *nec_state); -static void i_jnp(nec_state_t *nec_state); -static void i_jl(nec_state_t *nec_state); -static void i_jnl(nec_state_t *nec_state); -static void i_jle(nec_state_t *nec_state); -static void i_jnle(nec_state_t *nec_state); -static void i_80pre(nec_state_t *nec_state); -static void i_82pre(nec_state_t *nec_state); -static void i_81pre(nec_state_t *nec_state); -static void i_83pre(nec_state_t *nec_state); -static void i_test_br8(nec_state_t *nec_state); -static void i_test_wr16(nec_state_t *nec_state); -static void i_xchg_br8(nec_state_t *nec_state); -static void i_xchg_wr16(nec_state_t *nec_state); -static void i_mov_br8(nec_state_t *nec_state); -static void i_mov_r8b(nec_state_t *nec_state); -static void i_mov_wr16(nec_state_t *nec_state); -static void i_mov_r16w(nec_state_t *nec_state); -static void i_mov_wsreg(nec_state_t *nec_state); -static void i_lea(nec_state_t *nec_state); -static void i_mov_sregw(nec_state_t *nec_state); -static void i_invalid(nec_state_t *nec_state); -static void i_popw(nec_state_t *nec_state); -static void i_nop(nec_state_t *nec_state); -static void i_xchg_axcx(nec_state_t *nec_state); -static void i_xchg_axdx(nec_state_t *nec_state); -static void i_xchg_axbx(nec_state_t *nec_state); -static void i_xchg_axsp(nec_state_t *nec_state); -static void i_xchg_axbp(nec_state_t *nec_state); -static void i_xchg_axsi(nec_state_t *nec_state); -static void i_xchg_axdi(nec_state_t *nec_state); -static void i_cbw(nec_state_t *nec_state); -static void i_cwd(nec_state_t *nec_state); -static void i_call_far(nec_state_t *nec_state); -static void i_pushf(nec_state_t *nec_state); -static void i_popf(nec_state_t *nec_state); -static void i_sahf(nec_state_t *nec_state); -static void i_lahf(nec_state_t *nec_state); -static void i_mov_aldisp(nec_state_t *nec_state); -static void i_mov_axdisp(nec_state_t *nec_state); -static void i_mov_dispal(nec_state_t *nec_state); -static void i_mov_dispax(nec_state_t *nec_state); -static void i_movsb(nec_state_t *nec_state); -static void i_movsw(nec_state_t *nec_state); -static void i_cmpsb(nec_state_t *nec_state); -static void i_cmpsw(nec_state_t *nec_state); -static void i_test_ald8(nec_state_t *nec_state); -static void i_test_axd16(nec_state_t *nec_state); -static void i_stosb(nec_state_t *nec_state); -static void i_stosw(nec_state_t *nec_state); -static void i_lodsb(nec_state_t *nec_state); -static void i_lodsw(nec_state_t *nec_state); -static void i_scasb(nec_state_t *nec_state); -static void i_scasw(nec_state_t *nec_state); -static void i_mov_ald8(nec_state_t *nec_state); -static void i_mov_cld8(nec_state_t *nec_state); -static void i_mov_dld8(nec_state_t *nec_state); -static void i_mov_bld8(nec_state_t *nec_state); -static void i_mov_ahd8(nec_state_t *nec_state); -static void i_mov_chd8(nec_state_t *nec_state); -static void i_mov_dhd8(nec_state_t *nec_state); -static void i_mov_bhd8(nec_state_t *nec_state); -static void i_mov_axd16(nec_state_t *nec_state); -static void i_mov_cxd16(nec_state_t *nec_state); -static void i_mov_dxd16(nec_state_t *nec_state); -static void i_mov_bxd16(nec_state_t *nec_state); -static void i_mov_spd16(nec_state_t *nec_state); -static void i_mov_bpd16(nec_state_t *nec_state); -static void i_mov_sid16(nec_state_t *nec_state); -static void i_mov_did16(nec_state_t *nec_state); -static void i_rotshft_bd8(nec_state_t *nec_state); -static void i_rotshft_wd8(nec_state_t *nec_state); -static void i_ret_d16(nec_state_t *nec_state); -static void i_ret(nec_state_t *nec_state); -static void i_les_dw(nec_state_t *nec_state); -static void i_lds_dw(nec_state_t *nec_state); -static void i_mov_bd8(nec_state_t *nec_state); -static void i_mov_wd16(nec_state_t *nec_state); -static void i_enter(nec_state_t *nec_state); -static void i_leave(nec_state_t *nec_state); -static void i_retf_d16(nec_state_t *nec_state); -static void i_retf(nec_state_t *nec_state); -static void i_int3(nec_state_t *nec_state); -static void i_int(nec_state_t *nec_state); -static void i_into(nec_state_t *nec_state); -static void i_iret(nec_state_t *nec_state); -static void i_rotshft_b(nec_state_t *nec_state); -static void i_rotshft_w(nec_state_t *nec_state); -static void i_rotshft_bcl(nec_state_t *nec_state); -static void i_rotshft_wcl(nec_state_t *nec_state); -static void i_aam(nec_state_t *nec_state); -static void i_aad(nec_state_t *nec_state); -static void i_setalc(nec_state_t *nec_state); -static void i_trans(nec_state_t *nec_state); -static void i_fpo(nec_state_t *nec_state); -static void i_loopne(nec_state_t *nec_state); -static void i_loope(nec_state_t *nec_state); -static void i_loop(nec_state_t *nec_state); -static void i_jcxz(nec_state_t *nec_state); -static void i_inal(nec_state_t *nec_state); -static void i_inax(nec_state_t *nec_state); -static void i_outal(nec_state_t *nec_state); -static void i_outax(nec_state_t *nec_state); -static void i_call_d16(nec_state_t *nec_state); -static void i_jmp_d16(nec_state_t *nec_state); -static void i_jmp_far(nec_state_t *nec_state); -static void i_jmp_d8(nec_state_t *nec_state); -static void i_inaldx(nec_state_t *nec_state); -static void i_inaxdx(nec_state_t *nec_state); -static void i_outdxal(nec_state_t *nec_state); -static void i_outdxax(nec_state_t *nec_state); -static void i_lock(nec_state_t *nec_state); -static void i_repne(nec_state_t *nec_state); -static void i_repe(nec_state_t *nec_state); -static void i_hlt(nec_state_t *nec_state); -static void i_cmc(nec_state_t *nec_state); -static void i_f6pre(nec_state_t *nec_state); -static void i_f7pre(nec_state_t *nec_state); -static void i_clc(nec_state_t *nec_state); -static void i_stc(nec_state_t *nec_state); -static void i_di(nec_state_t *nec_state); -static void i_ei(nec_state_t *nec_state); -static void i_cld(nec_state_t *nec_state); -static void i_std(nec_state_t *nec_state); -static void i_fepre(nec_state_t *nec_state); -static void i_ffpre(nec_state_t *nec_state); - -static void i_wait(nec_state_t *nec_state); - -static void (*const nec_instruction[256])(nec_state_t *nec_state) = -{ - i_add_br8, /* 0x00 */ - i_add_wr16, /* 0x01 */ - i_add_r8b, /* 0x02 */ - i_add_r16w, /* 0x03 */ - i_add_ald8, /* 0x04 */ - i_add_axd16, /* 0x05 */ - i_push_es, /* 0x06 */ - i_pop_es, /* 0x07 */ - i_or_br8, /* 0x08 */ - i_or_wr16, /* 0x09 */ - i_or_r8b, /* 0x0a */ - i_or_r16w, /* 0x0b */ - i_or_ald8, /* 0x0c */ - i_or_axd16, /* 0x0d */ - i_push_cs, /* 0x0e */ - i_pre_nec, /* 0x0f */ - i_adc_br8, /* 0x10 */ - i_adc_wr16, /* 0x11 */ - i_adc_r8b, /* 0x12 */ - i_adc_r16w, /* 0x13 */ - i_adc_ald8, /* 0x14 */ - i_adc_axd16, /* 0x15 */ - i_push_ss, /* 0x16 */ - i_pop_ss, /* 0x17 */ - i_sbb_br8, /* 0x18 */ - i_sbb_wr16, /* 0x19 */ - i_sbb_r8b, /* 0x1a */ - i_sbb_r16w, /* 0x1b */ - i_sbb_ald8, /* 0x1c */ - i_sbb_axd16, /* 0x1d */ - i_push_ds, /* 0x1e */ - i_pop_ds, /* 0x1f */ - i_and_br8, /* 0x20 */ - i_and_wr16, /* 0x21 */ - i_and_r8b, /* 0x22 */ - i_and_r16w, /* 0x23 */ - i_and_ald8, /* 0x24 */ - i_and_axd16, /* 0x25 */ - i_es, /* 0x26 */ - i_daa, /* 0x27 */ - i_sub_br8, /* 0x28 */ - i_sub_wr16, /* 0x29 */ - i_sub_r8b, /* 0x2a */ - i_sub_r16w, /* 0x2b */ - i_sub_ald8, /* 0x2c */ - i_sub_axd16, /* 0x2d */ - i_cs, /* 0x2e */ - i_das, /* 0x2f */ - i_xor_br8, /* 0x30 */ - i_xor_wr16, /* 0x31 */ - i_xor_r8b, /* 0x32 */ - i_xor_r16w, /* 0x33 */ - i_xor_ald8, /* 0x34 */ - i_xor_axd16, /* 0x35 */ - i_ss, /* 0x36 */ - i_aaa, /* 0x37 */ - i_cmp_br8, /* 0x38 */ - i_cmp_wr16, /* 0x39 */ - i_cmp_r8b, /* 0x3a */ - i_cmp_r16w, /* 0x3b */ - i_cmp_ald8, /* 0x3c */ - i_cmp_axd16, /* 0x3d */ - i_ds, /* 0x3e */ - i_aas, /* 0x3f */ - i_inc_ax, /* 0x40 */ - i_inc_cx, /* 0x41 */ - i_inc_dx, /* 0x42 */ - i_inc_bx, /* 0x43 */ - i_inc_sp, /* 0x44 */ - i_inc_bp, /* 0x45 */ - i_inc_si, /* 0x46 */ - i_inc_di, /* 0x47 */ - i_dec_ax, /* 0x48 */ - i_dec_cx, /* 0x49 */ - i_dec_dx, /* 0x4a */ - i_dec_bx, /* 0x4b */ - i_dec_sp, /* 0x4c */ - i_dec_bp, /* 0x4d */ - i_dec_si, /* 0x4e */ - i_dec_di, /* 0x4f */ - i_push_ax, /* 0x50 */ - i_push_cx, /* 0x51 */ - i_push_dx, /* 0x52 */ - i_push_bx, /* 0x53 */ - i_push_sp, /* 0x54 */ - i_push_bp, /* 0x55 */ - i_push_si, /* 0x56 */ - i_push_di, /* 0x57 */ - i_pop_ax, /* 0x58 */ - i_pop_cx, /* 0x59 */ - i_pop_dx, /* 0x5a */ - i_pop_bx, /* 0x5b */ - i_pop_sp, /* 0x5c */ - i_pop_bp, /* 0x5d */ - i_pop_si, /* 0x5e */ - i_pop_di, /* 0x5f */ - i_pusha, /* 0x60 */ - i_popa, /* 0x61 */ - i_chkind, /* 0x62 */ - i_invalid, /* 0x63 */ - i_repnc, /* 0x64 */ - i_repc, /* 0x65 */ - i_invalid, /* 0x66 */ - i_invalid, /* 0x67 */ - i_push_d16, /* 0x68 */ - i_imul_d16, /* 0x69 */ - i_push_d8, /* 0x6a */ - i_imul_d8, /* 0x6b */ - i_insb, /* 0x6c */ - i_insw, /* 0x6d */ - i_outsb, /* 0x6e */ - i_outsw, /* 0x6f */ - i_jo, /* 0x70 */ - i_jno, /* 0x71 */ - i_jc, /* 0x72 */ - i_jnc, /* 0x73 */ - i_jz, /* 0x74 */ - i_jnz, /* 0x75 */ - i_jce, /* 0x76 */ - i_jnce, /* 0x77 */ - i_js, /* 0x78 */ - i_jns, /* 0x79 */ - i_jp, /* 0x7a */ - i_jnp, /* 0x7b */ - i_jl, /* 0x7c */ - i_jnl, /* 0x7d */ - i_jle, /* 0x7e */ - i_jnle, /* 0x7f */ - i_80pre, /* 0x80 */ - i_81pre, /* 0x81 */ - i_82pre, /* 0x82 */ - i_83pre, /* 0x83 */ - i_test_br8, /* 0x84 */ - i_test_wr16, /* 0x85 */ - i_xchg_br8, /* 0x86 */ - i_xchg_wr16, /* 0x87 */ - i_mov_br8, /* 0x88 */ - i_mov_wr16, /* 0x89 */ - i_mov_r8b, /* 0x8a */ - i_mov_r16w, /* 0x8b */ - i_mov_wsreg, /* 0x8c */ - i_lea, /* 0x8d */ - i_mov_sregw, /* 0x8e */ - i_popw, /* 0x8f */ - i_nop, /* 0x90 */ - i_xchg_axcx, /* 0x91 */ - i_xchg_axdx, /* 0x92 */ - i_xchg_axbx, /* 0x93 */ - i_xchg_axsp, /* 0x94 */ - i_xchg_axbp, /* 0x95 */ - i_xchg_axsi, /* 0x96 */ - i_xchg_axdi, /* 0x97 */ - i_cbw, /* 0x98 */ - i_cwd, /* 0x99 */ - i_call_far, /* 0x9a */ - i_wait, /* 0x9b */ - i_pushf, /* 0x9c */ - i_popf, /* 0x9d */ - i_sahf, /* 0x9e */ - i_lahf, /* 0x9f */ - i_mov_aldisp, /* 0xa0 */ - i_mov_axdisp, /* 0xa1 */ - i_mov_dispal, /* 0xa2 */ - i_mov_dispax, /* 0xa3 */ - i_movsb, /* 0xa4 */ - i_movsw, /* 0xa5 */ - i_cmpsb, /* 0xa6 */ - i_cmpsw, /* 0xa7 */ - i_test_ald8, /* 0xa8 */ - i_test_axd16, /* 0xa9 */ - i_stosb, /* 0xaa */ - i_stosw, /* 0xab */ - i_lodsb, /* 0xac */ - i_lodsw, /* 0xad */ - i_scasb, /* 0xae */ - i_scasw, /* 0xaf */ - i_mov_ald8, /* 0xb0 */ - i_mov_cld8, /* 0xb1 */ - i_mov_dld8, /* 0xb2 */ - i_mov_bld8, /* 0xb3 */ - i_mov_ahd8, /* 0xb4 */ - i_mov_chd8, /* 0xb5 */ - i_mov_dhd8, /* 0xb6 */ - i_mov_bhd8, /* 0xb7 */ - i_mov_axd16, /* 0xb8 */ - i_mov_cxd16, /* 0xb9 */ - i_mov_dxd16, /* 0xba */ - i_mov_bxd16, /* 0xbb */ - i_mov_spd16, /* 0xbc */ - i_mov_bpd16, /* 0xbd */ - i_mov_sid16, /* 0xbe */ - i_mov_did16, /* 0xbf */ - i_rotshft_bd8, /* 0xc0 */ - i_rotshft_wd8, /* 0xc1 */ - i_ret_d16, /* 0xc2 */ - i_ret, /* 0xc3 */ - i_les_dw, /* 0xc4 */ - i_lds_dw, /* 0xc5 */ - i_mov_bd8, /* 0xc6 */ - i_mov_wd16, /* 0xc7 */ - i_enter, /* 0xc8 */ - i_leave, /* 0xc9 */ - i_retf_d16, /* 0xca */ - i_retf, /* 0xcb */ - i_int3, /* 0xcc */ - i_int, /* 0xcd */ - i_into, /* 0xce */ - i_iret, /* 0xcf */ - i_rotshft_b, /* 0xd0 */ - i_rotshft_w, /* 0xd1 */ - i_rotshft_bcl, /* 0xd2 */ - i_rotshft_wcl, /* 0xd3 */ - i_aam, /* 0xd4 */ - i_aad, /* 0xd5 */ - i_setalc, /* 0xd6 */ - i_trans, /* 0xd7 */ - i_fpo, /* 0xd8 */ - i_fpo, /* 0xd9 */ - i_fpo, /* 0xda */ - i_fpo, /* 0xdb */ - i_fpo, /* 0xdc */ - i_fpo, /* 0xdd */ - i_fpo, /* 0xde */ - i_fpo, /* 0xdf */ - i_loopne, /* 0xe0 */ - i_loope, /* 0xe1 */ - i_loop, /* 0xe2 */ - i_jcxz, /* 0xe3 */ - i_inal, /* 0xe4 */ - i_inax, /* 0xe5 */ - i_outal, /* 0xe6 */ - i_outax, /* 0xe7 */ - i_call_d16, /* 0xe8 */ - i_jmp_d16, /* 0xe9 */ - i_jmp_far, /* 0xea */ - i_jmp_d8, /* 0xeb */ - i_inaldx, /* 0xec */ - i_inaxdx, /* 0xed */ - i_outdxal, /* 0xee */ - i_outdxax, /* 0xef */ - i_lock, /* 0xf0 */ - i_invalid, /* 0xf1 */ - i_repne, /* 0xf2 */ - i_repe, /* 0xf3 */ - i_hlt, /* 0xf4 */ - i_cmc, /* 0xf5 */ - i_f6pre, /* 0xf6 */ - i_f7pre, /* 0xf7 */ - i_clc, /* 0xf8 */ - i_stc, /* 0xf9 */ - i_di, /* 0xfa */ - i_ei, /* 0xfb */ - i_cld, /* 0xfc */ - i_std, /* 0xfd */ - i_fepre, /* 0xfe */ - i_ffpre /* 0xff */ -}; diff --git a/jan/src/cpu/nec/necmacro.h b/jan/src/cpu/nec/necmacro.h deleted file mode 100644 index af71d04bf..000000000 --- a/jan/src/cpu/nec/necmacro.h +++ /dev/null @@ -1,266 +0,0 @@ -/* parameter x = result, y = source 1, z = source 2 */ - -#define SetTF(x) (nec_state->TF = (x)) -#define SetIF(x) (nec_state->IF = (x)) -#define SetDF(x) (nec_state->DF = (x)) -#define SetMD(x) (nec_state->MF = (x)) /* OB [19.07.99] Mode Flag V30 */ - -#define SetCFB(x) (nec_state->CarryVal = (x) & 0x100) -#define SetCFW(x) (nec_state->CarryVal = (x) & 0x10000) -#define SetAF(x,y,z) (nec_state->AuxVal = ((x) ^ ((y) ^ (z))) & 0x10) -#define SetSF(x) (nec_state->SignVal = (x)) -#define SetZF(x) (nec_state->ZeroVal = (x)) -#define SetPF(x) (nec_state->ParityVal = (x)) - -#define SetSZPF_Byte(x) (nec_state->SignVal=nec_state->ZeroVal=nec_state->ParityVal=(INT8)(x)) -#define SetSZPF_Word(x) (nec_state->SignVal=nec_state->ZeroVal=nec_state->ParityVal=(INT16)(x)) - -#define SetOFW_Add(x,y,z) (nec_state->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x8000) -#define SetOFB_Add(x,y,z) (nec_state->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x80) -#define SetOFW_Sub(x,y,z) (nec_state->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x8000) -#define SetOFB_Sub(x,y,z) (nec_state->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x80) - -#define ADDB { UINT32 res=dst+src; SetCFB(res); SetOFB_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } -#define ADDW { UINT32 res=dst+src; SetCFW(res); SetOFW_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } - -#define SUBB { UINT32 res=dst-src; SetCFB(res); SetOFB_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } -#define SUBW { UINT32 res=dst-src; SetCFW(res); SetOFW_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } - -#define ORB dst|=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Byte(dst) -#define ORW dst|=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Word(dst) - -#define ANDB dst&=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Byte(dst) -#define ANDW dst&=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Word(dst) - -#define XORB dst^=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Byte(dst) -#define XORW dst^=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Word(dst) - -#define IncWordReg(Reg) \ - unsigned tmp = (unsigned)Wreg(Reg); \ - unsigned tmp1 = tmp+1; \ - nec_state->OverVal = (tmp == 0x7fff); \ - SetAF(tmp1,tmp,1); \ - SetSZPF_Word(tmp1); \ - Wreg(Reg)=tmp1 - -#define DecWordReg(Reg) \ - unsigned tmp = (unsigned)Wreg(Reg); \ - unsigned tmp1 = tmp-1; \ - nec_state->OverVal = (tmp == 0x8000); \ - SetAF(tmp1,tmp,1); \ - SetSZPF_Word(tmp1); \ - Wreg(Reg)=tmp1 - -#define JMP(flag) \ - int tmp; \ - EMPTY_PREFETCH(); \ - tmp = (int)((INT8)FETCH()); \ - if (flag) \ - { \ - static const UINT8 table[3]={3,10,10}; \ - nec_state->ip = (WORD)(nec_state->ip+tmp); \ - nec_state->icount-=table[nec_state->chip_type/8]; \ - CHANGE_PC; \ - return; \ - } - -#define ADJ4(param1,param2) \ - if (AF || ((Breg(AL) & 0xf) > 9)) \ - { \ - UINT16 tmp; \ - tmp = Breg(AL) + param1; \ - Breg(AL) = tmp; \ - nec_state->AuxVal = 1; \ - nec_state->CarryVal |= tmp & 0x100; \ - } \ - if (CF || (Breg(AL)>0x9f)) \ - { \ - Breg(AL) += param2; \ - nec_state->CarryVal = 1; \ - } \ - SetSZPF_Byte(Breg(AL)) - -#define ADJB(param1,param2) \ - if (AF || ((Breg(AL) & 0xf) > 9)) \ - { \ - Breg(AL) += param1; \ - Breg(AH) += param2; \ - nec_state->AuxVal = 1; \ - nec_state->CarryVal = 1; \ - } \ - else \ - { \ - nec_state->AuxVal = 0; \ - nec_state->CarryVal = 0; \ - } \ - Breg(AL) &= 0x0F - -#define BITOP_BYTE \ - ModRM = FETCH(); \ - if (ModRM >= 0xc0) { \ - tmp=Breg(Mod_RM.RM.b[ModRM]); \ - } \ - else { \ - (*GetEA[ModRM])(nec_state); \ - tmp=read_mem_byte(EA); \ - } - -#define BITOP_WORD \ - ModRM = FETCH(); \ - if (ModRM >= 0xc0) { \ - tmp=Wreg(Mod_RM.RM.w[ModRM]); \ - } \ - else { \ - (*GetEA[ModRM])(nec_state); \ - tmp=read_mem_word(EA); \ - } - -#define BIT_NOT \ - if (tmp & (1<CarryVal = dst & 0x80; dst = (dst << 1)+CF -#define ROL_WORD nec_state->CarryVal = dst & 0x8000; dst = (dst << 1)+CF -#define ROR_BYTE nec_state->CarryVal = dst & 0x1; dst = (dst >> 1)+(CF<<7) -#define ROR_WORD nec_state->CarryVal = dst & 0x1; dst = (dst >> 1)+(CF<<15) -#define ROLC_BYTE dst = (dst << 1) + CF; SetCFB(dst) -#define ROLC_WORD dst = (dst << 1) + CF; SetCFW(dst) -#define RORC_BYTE dst = (CF<<8)+dst; nec_state->CarryVal = dst & 0x01; dst >>= 1 -#define RORC_WORD dst = (CF<<16)+dst; nec_state->CarryVal = dst & 0x01; dst >>= 1 -#define SHL_BYTE(c) nec_state->icount-=c; dst <<= c; SetCFB(dst); SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) -#define SHL_WORD(c) nec_state->icount-=c; dst <<= c; SetCFW(dst); SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) -#define SHR_BYTE(c) nec_state->icount-=c; dst >>= c-1; nec_state->CarryVal = dst & 0x1; dst >>= 1; SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) -#define SHR_WORD(c) nec_state->icount-=c; dst >>= c-1; nec_state->CarryVal = dst & 0x1; dst >>= 1; SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) -#define SHRA_BYTE(c) nec_state->icount-=c; dst = ((INT8)dst) >> (c-1); nec_state->CarryVal = dst & 0x1; dst = ((INT8)((BYTE)dst)) >> 1; SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) -#define SHRA_WORD(c) nec_state->icount-=c; dst = ((INT16)dst) >> (c-1); nec_state->CarryVal = dst & 0x1; dst = ((INT16)((WORD)dst)) >> 1; SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) - -#define DIVUB \ - uresult = Wreg(AW); \ - uresult2 = uresult % tmp; \ - if ((uresult /= tmp) > 0xff) { \ - nec_interrupt(nec_state, NEC_DIVIDE_VECTOR, BRK); break; \ - } else { \ - Breg(AL) = uresult; \ - Breg(AH) = uresult2; \ - } - -#define DIVB \ - result = (INT16)Wreg(AW); \ - result2 = result % (INT16)((INT8)tmp); \ - if ((result /= (INT16)((INT8)tmp)) > 0xff) { \ - nec_interrupt(nec_state, NEC_DIVIDE_VECTOR, BRK); break; \ - } else { \ - Breg(AL) = result; \ - Breg(AH) = result2; \ - } - -#define DIVUW \ - uresult = (((UINT32)Wreg(DW)) << 16) | Wreg(AW);\ - uresult2 = uresult % tmp; \ - if ((uresult /= tmp) > 0xffff) { \ - nec_interrupt(nec_state, NEC_DIVIDE_VECTOR, BRK); break; \ - } else { \ - Wreg(AW)=uresult; \ - Wreg(DW)=uresult2; \ - } - -#define DIVW \ - result = ((UINT32)Wreg(DW) << 16) + Wreg(AW); \ - result2 = result % (INT32)((INT16)tmp); \ - if ((result /= (INT32)((INT16)tmp)) > 0xffff) { \ - nec_interrupt(nec_state, NEC_DIVIDE_VECTOR, BRK); break; \ - } else { \ - Wreg(AW)=result; \ - Wreg(DW)=result2; \ - } - -#define ADD4S { \ - int i,v1,v2,result; \ - int count = (Breg(CL)+1)/2; \ - unsigned di = Wreg(IY); \ - unsigned si = Wreg(IX); \ - static const UINT8 table[3]={18,19,19}; \ - nec_state->ZeroVal = nec_state->CarryVal = 0; \ - for (i=0;iicount-=table[nec_state->chip_type/8]; \ - tmp = GetMemB(DS0, si); \ - tmp2 = GetMemB(DS1, di); \ - v1 = (tmp>>4)*10 + (tmp&0xf); \ - v2 = (tmp2>>4)*10 + (tmp2&0xf); \ - result = v1+v2+nec_state->CarryVal; \ - nec_state->CarryVal = result > 99 ? 1 : 0; \ - result = result % 100; \ - v1 = ((result/10)<<4) | (result % 10); \ - PutMemB(DS1, di,v1); \ - if (v1) nec_state->ZeroVal = 1; \ - si++; \ - di++; \ - } \ -} - -#define SUB4S { \ - int count = (Breg(CL)+1)/2; \ - int i; \ - unsigned int v1,v2,result; \ - unsigned di = Wreg(IY); \ - unsigned si = Wreg(IX); \ - static const UINT8 table[3]={18,19,19}; \ - nec_state->ZeroVal = nec_state->CarryVal = 0; \ - for (i=0;iicount-=table[nec_state->chip_type/8]; \ - tmp = GetMemB(DS1, di); \ - tmp2 = GetMemB(DS0, si); \ - v1 = (tmp>>4)*10 + (tmp&0xf); \ - v2 = (tmp2>>4)*10 + (tmp2&0xf); \ - if (v1 < (v2+nec_state->CarryVal)) { \ - v1+=100; \ - result = v1-(v2+nec_state->CarryVal); \ - nec_state->CarryVal = 1; \ - } else { \ - result = v1-(v2+nec_state->CarryVal); \ - nec_state->CarryVal = 0; \ - } \ - v1 = ((result/10)<<4) | (result % 10); \ - PutMemB(DS1, di,v1); \ - if (v1) nec_state->ZeroVal = 1; \ - si++; \ - di++; \ - } \ -} - -#define CMP4S { \ - int count = (Breg(CL)+1)/2; \ - int i; \ - unsigned int v1,v2,result; \ - unsigned di = Wreg(IY); \ - unsigned si = Wreg(IX); \ - static const UINT8 table[3]={14,19,19}; \ - nec_state->ZeroVal = nec_state->CarryVal = 0; \ - for (i=0;iicount-=table[nec_state->chip_type/8]; \ - tmp = GetMemB(DS1, di); \ - tmp2 = GetMemB(DS0, si); \ - v1 = (tmp>>4)*10 + (tmp&0xf); \ - v2 = (tmp2>>4)*10 + (tmp2&0xf); \ - if (v1 < (v2+nec_state->CarryVal)) { \ - v1+=100; \ - result = v1-(v2+nec_state->CarryVal); \ - nec_state->CarryVal = 1; \ - } else { \ - result = v1-(v2+nec_state->CarryVal); \ - nec_state->CarryVal = 0; \ - } \ - v1 = ((result/10)<<4) | (result % 10); \ - if (v1) nec_state->ZeroVal = 1; \ - si++; \ - di++; \ - } \ -} diff --git a/jan/src/cpu/nec/necmodrm.h b/jan/src/cpu/nec/necmodrm.h deleted file mode 100644 index cf8956b81..000000000 --- a/jan/src/cpu/nec/necmodrm.h +++ /dev/null @@ -1,104 +0,0 @@ -static struct { - struct { - WREGS w[256]; - BREGS b[256]; - } reg; - struct { - WREGS w[256]; - BREGS b[256]; - } RM; -} Mod_RM; - -#define RegWord(ModRM) Wreg(Mod_RM.reg.w[ModRM]) -#define RegByte(ModRM) Breg(Mod_RM.reg.b[ModRM]) - -#define GetRMWord(ModRM) \ - ((ModRM) >= 0xc0 ? Wreg(Mod_RM.RM.w[ModRM]) : ( (*GetEA[ModRM])(nec_state), read_mem_word( EA ) )) - -#define PutbackRMWord(ModRM,val) \ -{ \ - if (ModRM >= 0xc0) Wreg(Mod_RM.RM.w[ModRM])=val; \ - else write_mem_word(EA,val); \ -} - -#define GetnextRMWord read_mem_word((EA&0xf0000)|((EA+2)&0xffff)) - -#define PutRMWord(ModRM,val) \ -{ \ - if (ModRM >= 0xc0) \ - Wreg(Mod_RM.RM.w[ModRM])=val; \ - else { \ - (*GetEA[ModRM])(nec_state); \ - write_mem_word( EA ,val); \ - } \ -} - -#define PutImmRMWord(ModRM) \ -{ \ - WORD val; \ - if (ModRM >= 0xc0) \ - Wreg(Mod_RM.RM.w[ModRM]) = FETCHWORD(); \ - else { \ - (*GetEA[ModRM])(nec_state); \ - val = FETCHWORD(); \ - write_mem_word( EA , val); \ - } \ -} - -#define GetRMByte(ModRM) \ - ((ModRM) >= 0xc0 ? Breg(Mod_RM.RM.b[ModRM]) : read_mem_byte( (*GetEA[ModRM])(nec_state) )) - -#define PutRMByte(ModRM,val) \ -{ \ - if (ModRM >= 0xc0) \ - Breg(Mod_RM.RM.b[ModRM])=val; \ - else \ - write_mem_byte( (*GetEA[ModRM])(nec_state) ,val); \ -} - -#define PutImmRMByte(ModRM) \ -{ \ - if (ModRM >= 0xc0) \ - Breg(Mod_RM.RM.b[ModRM])=FETCH(); \ - else { \ - (*GetEA[ModRM])(nec_state); \ - write_mem_byte( EA , FETCH() ); \ - } \ -} - -#define PutbackRMByte(ModRM,val) \ -{ \ - if (ModRM >= 0xc0) \ - Breg(Mod_RM.RM.b[ModRM])=val; \ - else \ - write_mem_byte(EA,val); \ -} - -#define DEF_br8 \ - UINT32 ModRM = FETCH(),src,dst; \ - src = RegByte(ModRM); \ - dst = GetRMByte(ModRM) - -#define DEF_wr16 \ - UINT32 ModRM = FETCH(),src,dst; \ - src = RegWord(ModRM); \ - dst = GetRMWord(ModRM) - -#define DEF_r8b \ - UINT32 ModRM = FETCH(),src,dst; \ - dst = RegByte(ModRM); \ - src = GetRMByte(ModRM) - -#define DEF_r16w \ - UINT32 ModRM = FETCH(),src,dst; \ - dst = RegWord(ModRM); \ - src = GetRMWord(ModRM) - -#define DEF_ald8 \ - UINT32 src = FETCH(); \ - UINT32 dst = Breg(AL) - -#define DEF_axd16 \ - UINT32 src = FETCH(); \ - UINT32 dst = Wreg(AW); \ - src += (FETCH() << 8) diff --git a/jan/src/cpu/nec/necpriv.h b/jan/src/cpu/nec/necpriv.h deleted file mode 100644 index fe8c28f40..000000000 --- a/jan/src/cpu/nec/necpriv.h +++ /dev/null @@ -1,192 +0,0 @@ -/* Cpu types, steps of 8 to help the cycle count calculation */ -#define V33_TYPE 0 -#define V30_TYPE 8 -#define V20_TYPE 16 - -#ifndef FALSE -#define FALSE 0 -#define TRUE 1 -#endif - -#define cpu_readop cpu_readmem20_op -#define cpu_readop_arg cpu_readmem20_arg - -/* interrupt vectors */ -enum -{ - NEC_DIVIDE_VECTOR = 0, - NEC_TRAP_VECTOR = 1, - NEC_NMI_VECTOR = 2, - NEC_BRKV_VECTOR = 4, - NEC_CHKIND_VECTOR = 5 -}; - -/* interrupt sources */ -typedef enum -{ - BRK = 0, - INT_IRQ = 1, - NMI_IRQ = 2 -} INTSOURCES; - -/* NEC registers */ -typedef union -{ /* eight general registers */ - UINT16 w[8]; /* viewed as 16 bits registers */ - UINT8 b[16]; /* or as 8 bit registers */ -} necbasicregs; - -typedef struct _nec_state_t nec_state_t; -struct _nec_state_t -{ - necbasicregs regs; - offs_t fetch_xor; - UINT16 sregs[4]; - - UINT16 ip; - - /* PSW flags */ - INT32 SignVal; - UINT32 AuxVal, OverVal, ZeroVal, CarryVal, ParityVal; /* 0 or non-0 valued flags */ - UINT8 TF, IF, DF, MF; /* 0 or 1 valued flags */ - - /* interrupt related */ - UINT32 vector; - UINT32 pending_irq; - UINT32 nmi_state; - UINT32 irq_state; - UINT32 poll_state; - UINT8 no_interrupt; - UINT8 halted; - - int icount; - - UINT8 prefetch_size; - UINT8 prefetch_cycles; - INT8 prefetch_count; - UINT8 prefetch_reset; - UINT32 chip_type; - - UINT32 prefix_base; /* base address of the latest prefix segment */ - UINT8 seg_prefix; /* prefix segment indicator */ - UINT32 cycles_total; - INT32 cycles_remaining; - INT8 stop_run; -}; - -typedef enum { DS1, PS, SS, DS0 } SREGS; -typedef enum { AW, CW, DW, BW, SP, BP, IX, IY } WREGS; - -#ifdef LSB_FIRST -typedef enum { - AL = 0, //NATIVE_ENDIAN_VALUE_LE_BE(0x0, 0x1), - AH = 1, //NATIVE_ENDIAN_VALUE_LE_BE(0x1, 0x0), - CL = 2, //NATIVE_ENDIAN_VALUE_LE_BE(0x2, 0x3), - CH = 3, //NATIVE_ENDIAN_VALUE_LE_BE(0x3, 0x2), - DL = 4, //NATIVE_ENDIAN_VALUE_LE_BE(0x4, 0x5), - DH = 5, //NATIVE_ENDIAN_VALUE_LE_BE(0x5, 0x4), - BL = 6, //NATIVE_ENDIAN_VALUE_LE_BE(0x6, 0x7), - BH = 7 //NATIVE_ENDIAN_VALUE_LE_BE(0x7, 0x6), -} BREGS; -#else -typedef enum { - AL = 1, //NATIVE_ENDIAN_VALUE_LE_BE(0x0, 0x1), - AH = 0, //NATIVE_ENDIAN_VALUE_LE_BE(0x1, 0x0), - CL = 3, //NATIVE_ENDIAN_VALUE_LE_BE(0x2, 0x3), - CH = 2, //NATIVE_ENDIAN_VALUE_LE_BE(0x3, 0x2), - DL = 5, //NATIVE_ENDIAN_VALUE_LE_BE(0x4, 0x5), - DH = 4, //NATIVE_ENDIAN_VALUE_LE_BE(0x5, 0x4), - BL = 7, //NATIVE_ENDIAN_VALUE_LE_BE(0x6, 0x7), - BH = 6 //NATIVE_ENDIAN_VALUE_LE_BE(0x7, 0x6), -} BREGS; -#endif - -#define Sreg(x) nec_state->sregs[x] -#define Wreg(x) nec_state->regs.w[x] -#define Breg(x) nec_state->regs.b[x] - -#define PC(n) ((Sreg(PS)<<4)+(n)->ip) - -#define CF (nec_state->CarryVal!=0) -#define SF (nec_state->SignVal<0) -#define ZF (nec_state->ZeroVal==0) -#define PF parity_table[(BYTE)nec_state->ParityVal] -#define AF (nec_state->AuxVal!=0) -#define OF (nec_state->OverVal!=0) - -/************************************************************************/ - -#define read_mem_byte(a) cpu_readmem20(a) -#define read_mem_word(a) (cpu_readmem20(a)+(cpu_readmem20((a)+1)<<8)) //nec_state->program->read_word_unaligned(a) -#define write_mem_byte(a,d) cpu_writemem20((a),(d)) -//#define write_mem_word(a,d) {cpu_writemem20((a),(unsigned char)(d)); cpu_writemem20((a)+1,(d)>>8); } //nec_state->program->write_word_unaligned((a),(d)) - -#define read_port_byte(a) cpu_readport(a) -#define read_port_word(a) (cpu_readport(a)+cpu_readport((a)+1)*256) -#define write_port_byte(a,d) cpu_writeport((a),(d)) -//#define write_port_word(a,d) { cpu_writeport((a),(unsigned char)(d)); (cpu_writeport((a)+1,(d)>>8); } // nec_state->io->write_word_unaligned((a),(d)) - -/************************************************************************/ - -#define CHANGE_PC do { EMPTY_PREFETCH(); } while (0) - -#define SegBase(Seg) (Sreg(Seg) << 4) - -#define DefaultBase(Seg) ((nec_state->seg_prefix && (Seg==DS0 || Seg==SS)) ? nec_state->prefix_base : Sreg(Seg) << 4) - -#define GetMemB(Seg,Off) (read_mem_byte(DefaultBase(Seg) + (Off))) -#define GetMemW(Seg,Off) (read_mem_word(DefaultBase(Seg) + (Off))) - -#define PutMemB(Seg,Off,x) { write_mem_byte(DefaultBase(Seg) + (Off), (x)); } -#define PutMemW(Seg,Off,x) { write_mem_word(DefaultBase(Seg) + (Off), (x)); } - -/* prefetch timing */ - -//#define FETCHWORD() (cpu_readop_arg((Sreg(PS)<<4) + sChipsPtr->ip)+(cpu_readop_arg(((Sreg(PS)<<4) + sChipsPtr->ip+1))<<8)); sChipsPtr->ip+=2 -#define FETCH() cpu_readop_arg((Sreg(PS)<<4) + sChipsPtr->ip++) -#define FETCHWORD() (FETCH() + FETCH() * 256) -#define EMPTY_PREFETCH() nec_state->prefetch_reset = 1 - - -#define PUSH(val) { Wreg(SP) -= 2; write_mem_word(((Sreg(SS)<<4)+Wreg(SP)), val); } -#define POP(var) { Wreg(SP) += 2; var = read_mem_word(((Sreg(SS)<<4) + ((Wreg(SP)-2) & 0xffff))); } - - -#define GetModRM UINT32 ModRM=FETCH() - -/* Cycle count macros: - CLK - cycle count is the same on all processors - CLKS - cycle count differs between processors, list all counts - CLKW - cycle count for word read/write differs for odd/even source/destination address - CLKM - cycle count for reg/mem instructions - CLKR - cycle count for reg/mem instructions with different counts for odd/even addresses - - - Prefetch & buswait time is not emulated. - Extra cycles for PUSH'ing or POP'ing registers to odd addresses is not emulated. -*/ - -#define CLK(all) nec_state->icount-=all -#define CLKS(v20,v30,v33) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33; nec_state->icount-=(ccount>>nec_state->chip_type)&0x7f; } -#define CLKW(v20o,v30o,v33o,v20e,v30e,v33e,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; nec_state->icount-=(addr&1)?((ocount>>nec_state->chip_type)&0x7f):((ecount>>nec_state->chip_type)&0x7f); } -#define CLKM(v20,v30,v33,v20m,v30m,v33m) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33, mcount=(v20m<<16)|(v30m<<8)|v33m; nec_state->icount-=( ModRM >=0xc0 )?((ccount>>nec_state->chip_type)&0x7f):((mcount>>nec_state->chip_type)&0x7f); } -#define CLKR(v20o,v30o,v33o,v20e,v30e,v33e,vall,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; if (ModRM >=0xc0) nec_state->icount-=vall; else nec_state->icount-=(addr&1)?((ocount>>nec_state->chip_type)&0x7f):((ecount>>nec_state->chip_type)&0x7f); } - -/************************************************************************/ -#define CompressFlags() (WORD)(int(CF) | 0x02 | (int(PF) << 2) | (int(AF) << 4) | (int(ZF) << 6) \ - | (int(SF) << 7) | (nec_state->TF << 8) | (nec_state->IF << 9) \ - | (nec_state->DF << 10) | (int(OF) << 11) | 0x7000 | (nec_state->MF << 15)) - -#define ExpandFlags(f) \ -{ \ - nec_state->CarryVal = (f) & 0x0001; \ - nec_state->ParityVal = !((f) & 0x0004); \ - nec_state->AuxVal = (f) & 0x0010; \ - nec_state->ZeroVal = !((f) & 0x0040); \ - nec_state->SignVal = (f) & 0x0080 ? -1 : 0; \ - nec_state->TF = ((f) & 0x0100) == 0x0100; \ - nec_state->IF = ((f) & 0x0200) == 0x0200; \ - nec_state->DF = ((f) & 0x0400) == 0x0400; \ - nec_state->OverVal = (f) & 0x0800; \ - nec_state->MF = ((f) & 0x8000) == 0x8000; \ -} diff --git a/jan/src/cpu/nec/v25.cpp b/jan/src/cpu/nec/v25.cpp deleted file mode 100644 index d8769f597..000000000 --- a/jan/src/cpu/nec/v25.cpp +++ /dev/null @@ -1,865 +0,0 @@ -/**************************************************************************** - - NEC V25/V35 emulator - - --------------------------------------------- - - TODO: - - Using V20/V30 cycle counts for now. V25/V35 cycle counts - vary based on whether internal RAM access is enabled (RAMEN). - Likewise, the programmable clock divider (PCK) currently only - affects the timers, not instruction execution. - - BTCLR and STOP instructions not implemented. - - IBRK flag (trap I/O instructions) not implemented. - - Interrupt macro service function not implemented. - - Port implementation is incomplete: mode control registers are ignored. - - Timer implementation is incomplete: polling is not implemented - (reading any of the registers just returns the last value written) - - Serial interface and DMA functions not implemented. - Note that these functions differ considerably between - the V25/35 and the V25+/35+. - - Make internal RAM into a real RAM region, and use an - internal address map (remapped when IDB is written to) - instead of memory access wrapper functions. - That way the internal RAM would be visible to the debugger, - among other benefits. - -****************************************************************************/ - -#include -#include -#include "driver.h" -#include "state.h" -#include "nec_intf.h" -#include "bitswap.h" - -unsigned char cpu_readmem20_op(unsigned int); -unsigned char cpu_readmem20_arg(unsigned int); -unsigned char cpu_readport(unsigned int); -void cpu_writeport(unsigned int,unsigned int); - -static inline void write_port_word(unsigned int a, unsigned short d) -{ - cpu_writeport((a),(unsigned char)(d)); - cpu_writeport((a)+1,(d)>>8); -} - -#define cpu_readop cpu_readmem20_op -#define cpu_readop_arg cpu_readmem20_arg - -#define offs_t int -#define INPUT_LINE_NMI 0x20 // nmi - -#define NEC_INLINE - -typedef UINT8 BOOLEAN; -typedef UINT8 BYTE; -typedef UINT16 WORD; -typedef UINT32 DWORD; - -#include "v25priv.h" - -static void add_timer(v25_state_t *nec_state, int timer, double tmp, int param, int flags) -{ - float cycles = (nec_state->clock / 2) * (tmp * (1.000000000 / nec_state->clock)); - - nec_state->timer_param[timer] = param; - nec_state->timer_enabled[timer] = 1; - nec_state->timer_flags[timer] = flags; // 1 = periodic, 0 = oneshot - nec_state->timer_cycles_period[timer] = (int)cycles; - nec_state->timer_cycles_until_trigger[timer] = (int)cycles; -} - -#include "v25sfr.c" - -static v25_state_t sChips[4]; // 4 cpus should be plenty! -static v25_state_t *sChipsPtr; - -static void v25_timer_callback(int param) -{ - v25_state_t *nec_state = sChipsPtr; - nec_state->pending_irq |= param; -} - -NEC_INLINE void prefetch(v25_state_t *nec_state) -{ - nec_state->prefetch_count--; -} - -static void do_prefetch(v25_state_t *nec_state, int previous_ICount) -{ - int diff = previous_ICount - (int) nec_state->icount; - - /* The implementation is not accurate, but comes close. - * It does not respect that the V30 will fetch two bytes - * at once directly, but instead uses only 2 cycles instead - * of 4. There are however only very few sources publicly - * available and they are vague. - */ - while (nec_state->prefetch_count<0) - { - nec_state->prefetch_count++; - if (diff>nec_state->prefetch_cycles) - diff -= nec_state->prefetch_cycles; - else - nec_state->icount -= nec_state->prefetch_cycles; - } - - if (nec_state->prefetch_reset) - { - nec_state->prefetch_count = 0; - nec_state->prefetch_reset = 0; - return; - } - - while (diff>=nec_state->prefetch_cycles && nec_state->prefetch_count < nec_state->prefetch_size) - { - diff -= nec_state->prefetch_cycles; - nec_state->prefetch_count++; - } - -} - -NEC_INLINE UINT8 fetch(v25_state_t *nec_state) -{ - prefetch(nec_state); - return cpu_readop_arg(((Sreg(PS)<<4)+nec_state->ip++) ^ nec_state->fetch_xor); -} - -NEC_INLINE UINT16 fetchword(v25_state_t *nec_state) -{ - UINT16 r = FETCH(); - r |= (FETCH()<<8); - return r; -} - -#define nec_state_t v25_state_t - -#include "v25instr.h" -#include "necmacro.h" -#include "necea.h" -#include "necmodrm.h" - -static UINT8 parity_table[256]; - -static UINT8 fetchop(v25_state_t *nec_state) -{ - UINT8 ret; - - prefetch(nec_state); - ret = cpu_readop(((Sreg(PS)<<4)+nec_state->ip++) ^ nec_state->fetch_xor); - - if (nec_state->MF == 0) - if (nec_state->decode) - { - ret = nec_state->decode[ret]; - } - return ret; -} - - -void v25_open(int cpu) -{ - sChipsPtr = &sChips[cpu]; -} - -void v25_close() -{ - sChipsPtr = NULL; -} - - -/***************************************************************************/ - -int v25_reset() -{ - v25_state_t *nec_state = sChipsPtr; - int tmp; - - nec_state->ip = 0; - nec_state->IBRK = 1; - nec_state->F0 = 0; - nec_state->F1 = 0; - nec_state->TF = 0; - nec_state->IF = 0; - nec_state->DF = 0; - nec_state->SignVal = 0; - nec_state->AuxVal = 0; - nec_state->OverVal = 0; - nec_state->ZeroVal = 1; - nec_state->CarryVal = 0; - nec_state->ParityVal = 1; - nec_state->pending_irq = 0; - nec_state->unmasked_irq = INT_IRQ | NMI_IRQ; - nec_state->bankswitch_irq = 0; - nec_state->priority_inttu = 7; - nec_state->priority_intd = 7; - nec_state->priority_intp = 7; - nec_state->priority_ints0 = 7; - nec_state->priority_ints1 = 7; - nec_state->IRQS = nec_state->ISPR = 0; - nec_state->nmi_state = 0; - nec_state->irq_state = 0; - nec_state->poll_state = 1; - nec_state->intp_state[0] = 0; - nec_state->intp_state[1] = 0; - nec_state->intp_state[2] = 0; - nec_state->halted = 0; - nec_state->vector = 0xff; // default - nec_state->cycles_total = 0; - - nec_state->TM0 = nec_state->MD0 = nec_state->TM1 = nec_state->MD1 = 0; - nec_state->TMC0 = nec_state->TMC1 = 0; - - nec_state->RAMEN = 1; - nec_state->TB = 20; - nec_state->PCK = 8; - nec_state->IDB = 0xFFE00; - - memset (nec_state->timer_enabled, 0, sizeof(char) * 4); - - tmp = nec_state->PCK << nec_state->TB; - add_timer(nec_state, 3, tmp, INTTB, 1); - - SetRB(7); - Sreg(PS) = 0xffff; - Sreg(SS) = 0; - Sreg(DS0) = 0; - Sreg(DS1) = 0; - - CHANGE_PC; - - return 0; -} - -static void nec_interrupt(v25_state_t *nec_state, unsigned int_num, INTSOURCES source) -{ - UINT32 dest_seg, dest_off; - - i_pushf(nec_state); - nec_state->TF = nec_state->IF = 0; - nec_state->MF = nec_state->mode_state; - - switch(source) - { - case BRKN: /* force native mode */ - nec_state->MF = 1; - break; - case BRKS: /* force secure mode */ - if (nec_state->decode) - nec_state->MF = 0; -// else -// logerror("%06x: BRKS executed with no decryption table\n",PC(nec_state)); - break; - case INT_IRQ: /* get vector */ - int_num = nec_state->vector; //(*nec_state->irq_callback)(0); - break; - default: - break; - } - - dest_off = read_mem_word(int_num*4); - dest_seg = read_mem_word(int_num*4+2); - - PUSH(Sreg(PS)); - PUSH(nec_state->ip); - nec_state->ip = (WORD)dest_off; - Sreg(PS) = (WORD)dest_seg; - CHANGE_PC; -} - -static void nec_bankswitch(v25_state_t *nec_state, unsigned bank_num) -{ - int tmp = CompressFlags(); - - nec_state->TF = nec_state->IF = 0; - nec_state->MF = nec_state->mode_state; - - SetRB(bank_num); - - Wreg(PSW_SAVE) = tmp; - Wreg(PC_SAVE) = nec_state->ip; - nec_state->ip = Wreg(VECTOR_PC); - CHANGE_PC; -} - -static void nec_trap(v25_state_t *nec_state) -{ - nec_instruction[fetchop(nec_state)](nec_state); - nec_interrupt(nec_state, NEC_TRAP_VECTOR, BRK); -} - -#define INTERRUPT(source, vector, priority) \ - if(pending & (source)) { \ - nec_state->IRQS = vector; \ - nec_state->ISPR |= (1 << (priority)); \ - nec_state->pending_irq &= ~(source); \ - if(nec_state->bankswitch_irq & (source)) \ - nec_bankswitch(nec_state, priority); \ - else \ - nec_interrupt(nec_state, vector, source); \ - break; /* break out of loop */ \ - } - -/* interrupt sources subject to priority control */ -#define SOURCES (INTTU0 | INTTU1 | INTTU2 | INTD0 | INTD1 | INTP0 | INTP1 | INTP2 \ - | INTSER0 | INTSR0 | INTST0 | INTSER1 | INTSR1 | INTST1 | INTTB) - -static void external_int(v25_state_t *nec_state) -{ - int pending = nec_state->pending_irq & nec_state->unmasked_irq; - - if (pending & NMI_IRQ) - { - nec_interrupt(nec_state, NEC_NMI_VECTOR, NMI_IRQ); - nec_state->pending_irq &= ~NMI_IRQ; - } - else if (pending & SOURCES) - { - for(int i = 0; i < 8; i++) - { - if (nec_state->ISPR & (1 << i)) break; - - if (nec_state->priority_inttu == i) - { - INTERRUPT(INTTU0, NEC_INTTU0_VECTOR, i) - INTERRUPT(INTTU1, NEC_INTTU1_VECTOR, i) - INTERRUPT(INTTU2, NEC_INTTU2_VECTOR, i) - } - - if (nec_state->priority_intd == i) - { - INTERRUPT(INTD0, NEC_INTD0_VECTOR, i) - INTERRUPT(INTD1, NEC_INTD1_VECTOR, i) - } - - if (nec_state->priority_intp == i) - { - INTERRUPT(INTP0, NEC_INTP0_VECTOR, i) - INTERRUPT(INTP1, NEC_INTP1_VECTOR, i) - INTERRUPT(INTP2, NEC_INTP2_VECTOR, i) - } - - if (nec_state->priority_ints0 == i) - { - INTERRUPT(INTSER0, NEC_INTSER0_VECTOR, i) - INTERRUPT(INTSR0, NEC_INTSR0_VECTOR, i) - INTERRUPT(INTST0, NEC_INTST0_VECTOR, i) - } - - if (nec_state->priority_ints1 == i) - { - INTERRUPT(INTSER1, NEC_INTSER1_VECTOR, i) - INTERRUPT(INTSR1, NEC_INTSR1_VECTOR, i) - INTERRUPT(INTST1, NEC_INTST1_VECTOR, i) - } - - if (i == 7) - INTERRUPT(INTTB, NEC_INTTB_VECTOR, 7) - } - } - else if (pending & INT_IRQ) - { - /* the actual vector is retrieved after pushing flags */ - /* and clearing the IF */ - nec_interrupt(nec_state, (UINT32)-1, INT_IRQ); - nec_state->irq_state = CLEAR_LINE; - nec_state->pending_irq &= ~INT_IRQ; - } -} - -/****************************************************************************/ -/* OPCODES */ -/****************************************************************************/ - -#include "necinstr.c" -#include "v25instr.c" - -/*****************************************************************************/ - -void v25_set_irq_line_and_vector(int irqline, int vector, int state) -{ - v25_state_t *nec_state = sChipsPtr; - - switch (irqline) - { - case 0: - nec_state->vector = vector; - nec_state->irq_state = state; - if (state == CLEAR_LINE) - nec_state->pending_irq &= ~INT_IRQ; - else - { - nec_state->pending_irq |= INT_IRQ; - nec_state->halted = 0;; - } - break; - case INPUT_LINE_NMI: - nec_state->vector = vector; - if (nec_state->nmi_state == (unsigned int)state) return; - nec_state->nmi_state = state; - if (state != CLEAR_LINE) - { - nec_state->pending_irq |= NMI_IRQ; - nec_state->halted = 0; - } - break; - case NEC_INPUT_LINE_INTP0: - case NEC_INPUT_LINE_INTP1: - case NEC_INPUT_LINE_INTP2: - nec_state->vector = vector; - irqline -= NEC_INPUT_LINE_INTP0; - if (nec_state->intp_state[irqline] == (unsigned int)state) return; - nec_state->intp_state[irqline] = state; - if (state != CLEAR_LINE) - nec_state->pending_irq |= (INTP0 << irqline); - break; - case NEC_INPUT_LINE_POLL: - nec_state->vector = vector; - nec_state->poll_state = state; - break; - } -} - -void v25_common_init(int) -{ - v25_state_t *nec_state = sChipsPtr; - - unsigned int i, j, c; - - static const WREGS wreg_name[8]={ AW, CW, DW, BW, SP, BP, IX, IY }; - static const BREGS breg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH }; - - for (i = 0; i < 256; i++) - { - for (j = i, c = 0; j > 0; j >>= 1) - if (j & 1) c++; - parity_table[i] = !(c & 1); - } - - for (i = 0; i < 256; i++) - { - Mod_RM.reg.b[i] = breg_name[(i & 0x38) >> 3]; - Mod_RM.reg.w[i] = wreg_name[(i & 0x38) >> 3]; - } - - for (i = 0xc0; i < 0x100; i++) - { - Mod_RM.RM.w[i] = wreg_name[i & 7]; - Mod_RM.RM.b[i] = breg_name[i & 7]; - } - - memset(nec_state, 0, sizeof(*nec_state)); - - nec_state->decode = NULL; -} - -void v25_set_decode(unsigned char *table) -{ - sChipsPtr->decode = table; - sChipsPtr->mode_state = sChipsPtr->MF = (table != NULL) ? 0 : 1; -} - -unsigned int v25_total_cycles() -{ - return sChipsPtr->cycles_total + (sChipsPtr->cycles_remaining - sChipsPtr->icount); -} - -void v25_new_frame() -{ - for (int i = 0; i < 4; i++) { - nec_state_t *nec_state = &sChips[i]; - nec_state->cycles_total = 0; - } -} - -int v25_execute(int cycles) -{ - v25_state_t *nec_state = sChipsPtr; - int prev_ICount; - - int pending = nec_state->pending_irq & nec_state->unmasked_irq; - - if (nec_state->halted && pending) - { - for(int i = 0; i < 8; i++) - { - if (nec_state->ISPR & (1 << i)) break; - - if (nec_state->priority_inttu == i && (pending & (INTTU0|INTTU1|INTTU2))) - nec_state->halted = 0; - - if (nec_state->priority_intd == i && (pending & (INTD0|INTD1))) - nec_state->halted = 0; - - if (nec_state->priority_intp == i && (pending & (INTP0|INTP1|INTP2))) - nec_state->halted = 0; - - if (nec_state->priority_ints0 == i && (pending & (INTSER0|INTSR0|INTST0))) - nec_state->halted = 0; - - if (nec_state->priority_ints1 == i && (pending & (INTSER1|INTSR1|INTST1))) - nec_state->halted = 0; - - if (i == 7 && (pending & INTTB)) - nec_state->halted = 0; - } - } - - if (nec_state->halted) - { - nec_state->icount = 0; - return 0; - } - - nec_state->icount = cycles; - nec_state->cycles_remaining = cycles; - - while(nec_state->icount>0 && !nec_state->stop_run) { - /* Dispatch IRQ */ - if (nec_state->no_interrupt==0 && (nec_state->pending_irq & nec_state->unmasked_irq)) - { - if (nec_state->pending_irq & NMI_IRQ) - external_int(nec_state); - else if (nec_state->IF) - external_int(nec_state); - } - - /* No interrupt allowed between last instruction and this one */ - if (nec_state->no_interrupt) - nec_state->no_interrupt--; - - prev_ICount = nec_state->icount; - nec_instruction[fetchop(nec_state)](nec_state); - do_prefetch(nec_state, prev_ICount); - - for (int i = 0; i < 4; i++) { // timers! - if (nec_state->timer_enabled[i]) { - nec_state->timer_cycles_until_trigger[i] -= prev_ICount - nec_state->icount; - - if (nec_state->timer_cycles_until_trigger[i] <= 0) { - if (nec_state->timer_flags[i]) { // periodic - nec_state->timer_cycles_until_trigger[i] = nec_state->timer_cycles_period[i]; - } else { // oneshot - nec_state->timer_enabled[i] = 0; // disabled - } - - v25_timer_callback(nec_state->timer_param[i]); - } - } - } - } - - nec_state->stop_run = 0; - nec_state->cycles_total += cycles - nec_state->icount; - - return cycles - nec_state->icount; -} - -void v25Init(int cpu, int type, int clock) -{ - sChipsPtr = &sChips[cpu]; - v25_state_t *nec_state = sChipsPtr; - - v25_common_init(cpu); - - nec_state->clock = clock; // not divided! - - switch (type) - { - case V20_TYPE: // v25 - { - nec_state->fetch_xor = 0; - nec_state->chip_type=V20_TYPE; - nec_state->prefetch_size = 4; /* 3 words */ - nec_state->prefetch_cycles = 4; /* four cycles per byte */ - } - break; - - case V30_TYPE: // v35 - { - nec_state->fetch_xor = 0; - nec_state->chip_type=V30_TYPE; - nec_state->prefetch_size = 6; /* 3 words */ - nec_state->prefetch_cycles = 2; /* two cycles per byte / four per word */ - } - break; - } -} - -void v25RunEnd() -{ - sChipsPtr->stop_run = 1; -} - -void v25Idle(int cycles) -{ - sChipsPtr->icount -= cycles; -} - -int v25GetPC(int n) -{ - if (n == -1) { // current cpu - return ((sChipsPtr->ram.w[sChipsPtr->RBW + (PS)]<<4) + sChipsPtr->ip); - } else { - v25_state_t *nec_state = &sChips[n]; - return ((nec_state->ram.w[nec_state->RBW + (PS)]<<4) + nec_state->ip); - } -} - -void v25Scan(int cpu, int nAction) -{ - v25_state_t *nec_state = &sChips[cpu]; - - if (nAction & ACB_DRIVER_DATA) { - struct BurnArea ba; - char szText[] = "V25 #0"; - szText[5] = '1' + cpu; - unsigned char *decode_save = nec_state->decode; - - memset(&ba, 0, sizeof(ba)); - - ba.Data = (unsigned char*)nec_state; - ba.nLen = sizeof(nec_state_t); - ba.szName = szText; - BurnAcb(&ba); - - nec_state->decode = decode_save; - } -} - -#if 0 - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static CPU_SET_INFO( v25 ) -{ - v25_state_t *nec_state = get_safe_token(device); - - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(nec_state, 0, info->i); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(nec_state, INPUT_LINE_NMI, info->i); break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_INTP0: set_irq_line(nec_state, NEC_INPUT_LINE_INTP0, info->i); break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_INTP1: set_irq_line(nec_state, NEC_INPUT_LINE_INTP1, info->i); break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_INTP2: set_irq_line(nec_state, NEC_INPUT_LINE_INTP2, info->i); break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_POLL: set_irq_line(nec_state, NEC_INPUT_LINE_POLL, info->i); break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + NEC_PC: - if( info->i - (Sreg(PS)<<4) < 0x10000 ) - { - nec_state->ip = info->i - (Sreg(PS)<<4); - } - else - { - Sreg(PS) = info->i >> 4; - nec_state->ip = info->i & 0x0000f; - } - break; - case CPUINFO_INT_REGISTER + NEC_IP: nec_state->ip = info->i; break; - case CPUINFO_INT_SP: - if( info->i - (Sreg(SS)<<4) < 0x10000 ) - { - Wreg(SP) = info->i - (Sreg(SS)<<4); - } - else - { - Sreg(SS) = info->i >> 4; - Wreg(SP) = info->i & 0x0000f; - } - break; - case CPUINFO_INT_REGISTER + NEC_SP: Wreg(SP) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_FLAGS: ExpandFlags(info->i); break; - case CPUINFO_INT_REGISTER + NEC_AW: Wreg(AW) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_CW: Wreg(CW) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_DW: Wreg(DW) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_BW: Wreg(BW) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_BP: Wreg(BP) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_IX: Wreg(IX) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_IY: Wreg(IY) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_ES: Sreg(DS1) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_CS: Sreg(PS) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_SS: Sreg(SS) = info->i; break; - case CPUINFO_INT_REGISTER + NEC_DS: Sreg(DS0) = info->i; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -static CPU_GET_INFO( v25v35 ) -{ - v25_state_t *nec_state = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; - int flags; - - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(v25_state_t); break; - case CPUINFO_INT_INPUT_LINES: info->i = 1; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0xff; break; - case DEVINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 2; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 8; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 80; break; - - case DEVINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; - case DEVINFO_INT_ADDRBUS_WIDTH + AS_PROGRAM: info->i = 20; break; - case DEVINFO_INT_ADDRBUS_SHIFT + AS_PROGRAM: info->i = 0; break; - case DEVINFO_INT_DATABUS_WIDTH + AS_DATA: info->i = 0; break; - case DEVINFO_INT_ADDRBUS_WIDTH + AS_DATA: info->i = 0; break; - case DEVINFO_INT_ADDRBUS_SHIFT + AS_DATA: info->i = 0; break; - case DEVINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break; - case DEVINFO_INT_ADDRBUS_WIDTH + AS_IO: info->i = 17; break; - case DEVINFO_INT_ADDRBUS_SHIFT + AS_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + 0: info->i = (nec_state->pending_irq & INT_IRQ) ? ASSERT_LINE : CLEAR_LINE; break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = nec_state->nmi_state; break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_INTP0: info->i = nec_state->intp_state[0]; break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_INTP1: info->i = nec_state->intp_state[1]; break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_INTP2: info->i = nec_state->intp_state[2]; break; - case CPUINFO_INT_INPUT_STATE + NEC_INPUT_LINE_POLL: info->i = nec_state->poll_state; break; - - case CPUINFO_INT_PREVIOUSPC: /* not supported */ break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + NEC_PC: info->i = ((Sreg(PS)<<4) + nec_state->ip); break; - case CPUINFO_INT_REGISTER + NEC_IP: info->i = nec_state->ip; break; - case CPUINFO_INT_SP: info->i = (Sreg(SS)<<4) + Wreg(SP); break; - case CPUINFO_INT_REGISTER + NEC_SP: info->i = Wreg(SP); break; - case CPUINFO_INT_REGISTER + NEC_FLAGS: info->i = CompressFlags(); break; - case CPUINFO_INT_REGISTER + NEC_AW: info->i = Wreg(AW); break; - case CPUINFO_INT_REGISTER + NEC_CW: info->i = Wreg(CW); break; - case CPUINFO_INT_REGISTER + NEC_DW: info->i = Wreg(DW); break; - case CPUINFO_INT_REGISTER + NEC_BW: info->i = Wreg(BW); break; - case CPUINFO_INT_REGISTER + NEC_BP: info->i = Wreg(BP); break; - case CPUINFO_INT_REGISTER + NEC_IX: info->i = Wreg(IX); break; - case CPUINFO_INT_REGISTER + NEC_IY: info->i = Wreg(IY); break; - case CPUINFO_INT_REGISTER + NEC_ES: info->i = Sreg(DS1); break; - case CPUINFO_INT_REGISTER + NEC_CS: info->i = Sreg(PS); break; - case CPUINFO_INT_REGISTER + NEC_SS: info->i = Sreg(SS); break; - case CPUINFO_INT_REGISTER + NEC_DS: info->i = Sreg(DS0); break; - case CPUINFO_INT_REGISTER + NEC_PENDING: info->i = nec_state->pending_irq; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(v25); break; - case CPUINFO_FCT_INIT: /* set per-CPU */ break; - case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(v25); break; - case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(v25); break; - case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(v25); break; - case CPUINFO_FCT_BURN: info->burn = NULL; break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(v25); break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &nec_state->icount; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "NEC"); break; - case DEVINFO_STR_FAMILY: strcpy(info->s, "NEC V-Series"); break; - case DEVINFO_STR_VERSION: strcpy(info->s, "2.0"); break; - case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; - case DEVINFO_STR_CREDITS: strcpy(info->s, "Bryan McPhail (V25/V35 support added by Alex W. Jackson)"); break; - - case CPUINFO_STR_FLAGS: - flags = CompressFlags(); - sprintf(info->s, "%c %d %c%c%c%c%c%c%c%c%c%c%c%c", - flags & 0x8000 ? 'N':'S', - (flags & 0x7000) >> 12, - flags & 0x0800 ? 'O':'.', - flags & 0x0400 ? 'D':'.', - flags & 0x0200 ? 'I':'.', - flags & 0x0100 ? 'T':'.', - flags & 0x0080 ? 'S':'.', - flags & 0x0040 ? 'Z':'.', - flags & 0x0020 ? '1':'.', - flags & 0x0010 ? 'A':'.', - flags & 0x0008 ? '0':'.', - flags & 0x0004 ? 'P':'.', - flags & 0x0002 ? '.':'I', - flags & 0x0001 ? 'C':'.'); - break; - - case CPUINFO_STR_REGISTER + NEC_PC: sprintf(info->s, "PC:%05X", (Sreg(PS)<<4) + nec_state->ip); break; - case CPUINFO_STR_REGISTER + NEC_IP: sprintf(info->s, "IP:%04X", nec_state->ip); break; - case CPUINFO_STR_REGISTER + NEC_SP: sprintf(info->s, "SP:%04X", Wreg(SP)); break; - case CPUINFO_STR_REGISTER + NEC_FLAGS: sprintf(info->s, "F:%04X", CompressFlags()); break; - case CPUINFO_STR_REGISTER + NEC_AW: sprintf(info->s, "AW:%04X", Wreg(AW)); break; - case CPUINFO_STR_REGISTER + NEC_CW: sprintf(info->s, "CW:%04X", Wreg(CW)); break; - case CPUINFO_STR_REGISTER + NEC_DW: sprintf(info->s, "DW:%04X", Wreg(DW)); break; - case CPUINFO_STR_REGISTER + NEC_BW: sprintf(info->s, "BW:%04X", Wreg(BW)); break; - case CPUINFO_STR_REGISTER + NEC_BP: sprintf(info->s, "BP:%04X", Wreg(BP)); break; - case CPUINFO_STR_REGISTER + NEC_IX: sprintf(info->s, "IX:%04X", Wreg(IX)); break; - case CPUINFO_STR_REGISTER + NEC_IY: sprintf(info->s, "IY:%04X", Wreg(IY)); break; - case CPUINFO_STR_REGISTER + NEC_ES: sprintf(info->s, "DS1:%04X", Sreg(DS1)); break; - case CPUINFO_STR_REGISTER + NEC_CS: sprintf(info->s, "PS:%04X", Sreg(PS)); break; - case CPUINFO_STR_REGISTER + NEC_SS: sprintf(info->s, "SS:%04X", Sreg(SS)); break; - case CPUINFO_STR_REGISTER + NEC_DS: sprintf(info->s, "DS0:%04X", Sreg(DS0)); break; - } -} - - -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -CPU_GET_INFO( v25 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case DEVINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 8; break; - case DEVINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 8; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(v25); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "V25"); break; - - default: CPU_GET_INFO_CALL(v25v35); break; - } -} - - -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -CPU_GET_INFO( v35 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case DEVINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; - case DEVINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(v35); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, "V35"); break; - - default: CPU_GET_INFO_CALL(v25v35); break; - } -} - -DEFINE_LEGACY_CPU_DEVICE(V25, v25); -DEFINE_LEGACY_CPU_DEVICE(V35, v35); - -#endif diff --git a/jan/src/cpu/nec/v25instr.c b/jan/src/cpu/nec/v25instr.c deleted file mode 100644 index 5aa257ff8..000000000 --- a/jan/src/cpu/nec/v25instr.c +++ /dev/null @@ -1,81 +0,0 @@ -#define GetRB \ - ModRM = FETCH(); \ - if (ModRM >= 0xc0) \ - tmp = Wreg(Mod_RM.RM.w[ModRM]) & 0x7; \ - else { \ - tmp = 0; \ - } - -#define RETRBI \ - tmp = (Wreg(PSW_SAVE) & 0x7000) >> 12; \ - nec_state->ip = Wreg(PC_SAVE); \ - ExpandFlags(Wreg(PSW_SAVE)); \ - SetRB(tmp); \ - CHANGE_PC - -#define TSKSW \ - Wreg(PSW_SAVE) = CompressFlags(); \ - Wreg(PC_SAVE) = nec_state->ip; \ - SetRB(tmp); \ - nec_state->ip = Wreg(PC_SAVE); \ - ExpandFlags(Wreg(PSW_SAVE)); \ - CHANGE_PC - -#define MOVSPA \ - tmp = (Wreg(PSW_SAVE) & 0x7000) >> 8; \ - Sreg(SS) = nec_state->ram.w[tmp+SS]; \ - Wreg(SP) = nec_state->ram.w[tmp+SP] - -#define MOVSPB \ - tmp <<= 4; \ - nec_state->ram.w[tmp+SS] = Sreg(SS); \ - nec_state->ram.w[tmp+SP] = Wreg(SP) - -#define FINT \ - for(tmp = 1; tmp < 0x100; tmp <<= 1) { \ - if(nec_state->ISPR & tmp) { \ - nec_state->ISPR &= ~tmp; \ - break; \ - } \ - } - -OP( 0x0f, i_pre_v25 ) { UINT32 ModRM, tmp, tmp2; - switch (FETCH()) { - case 0x10 : BITOP_BYTE; CLKS(3,3,4); tmp2 = Breg(CL) & 0x7; nec_state->ZeroVal = (tmp & (1<CarryVal=nec_state->OverVal=0; break; /* Test */ - case 0x11 : BITOP_WORD; CLKS(3,3,4); tmp2 = Breg(CL) & 0xf; nec_state->ZeroVal = (tmp & (1<CarryVal=nec_state->OverVal=0; break; /* Test */ - case 0x12 : BITOP_BYTE; CLKS(5,5,4); tmp2 = Breg(CL) & 0x7; tmp &= ~(1<ZeroVal = (tmp & (1<CarryVal=nec_state->OverVal=0; break; /* Test */ - case 0x19 : BITOP_WORD; CLKS(4,4,4); tmp2 = (FETCH()) & 0xf; nec_state->ZeroVal = (tmp & (1<CarryVal=nec_state->OverVal=0; break; /* Test */ - case 0x1a : BITOP_BYTE; CLKS(6,6,4); tmp2 = (FETCH()) & 0x7; tmp &= ~(1<>8)&0xf); tmp &= 0xff; PutbackRMByte(ModRM,tmp); CLKM(13,13,9,28,28,15); break; - case 0x2a : ModRM = FETCH(); tmp = GetRMByte(ModRM); tmp2 = (Breg(AL) & 0xf)<<4; Breg(AL) = (Breg(AL) & 0xf0) | (tmp&0xf); tmp = tmp2 | (tmp>>4); PutbackRMByte(ModRM,tmp); CLKM(17,17,13,32,32,19); break; - case 0x2d : GetRB; nec_bankswitch(nec_state, tmp); CLK(15); break; - case 0x31 : ModRM = FETCH(); ModRM=0; break; - case 0x33 : ModRM = FETCH(); ModRM=0; break; - case 0x91 : RETRBI; CLK(12); break; - case 0x92 : FINT; CLK(2); nec_state->no_interrupt = 1; break; - case 0x94 : GetRB; TSKSW; CLK(20); break; - case 0x95 : GetRB; MOVSPB; CLK(11); break; - case 0x9e : nec_state->icount=0; break; - default: break; - } -} - -OP( 0x63, i_brkn ) { nec_interrupt(nec_state, FETCH(), BRKN); CLKS(50,50,24); } -OP( 0xF1, i_brks ) { nec_interrupt(nec_state, FETCH(), BRKS); CLKS(50,50,24); } diff --git a/jan/src/cpu/nec/v25instr.h b/jan/src/cpu/nec/v25instr.h deleted file mode 100644 index 2e73b0227..000000000 --- a/jan/src/cpu/nec/v25instr.h +++ /dev/null @@ -1,510 +0,0 @@ -static void i_add_br8(nec_state_t *nec_state); -static void i_add_wr16(nec_state_t *nec_state); -static void i_add_r8b(nec_state_t *nec_state); -static void i_add_r16w(nec_state_t *nec_state); -static void i_add_ald8(nec_state_t *nec_state); -static void i_add_axd16(nec_state_t *nec_state); -static void i_push_es(nec_state_t *nec_state); -static void i_pop_es(nec_state_t *nec_state); -static void i_or_br8(nec_state_t *nec_state); -static void i_or_r8b(nec_state_t *nec_state); -static void i_or_wr16(nec_state_t *nec_state); -static void i_or_r16w(nec_state_t *nec_state); -static void i_or_ald8(nec_state_t *nec_state); -static void i_or_axd16(nec_state_t *nec_state); -static void i_push_cs(nec_state_t *nec_state); -//ATTR_UNUSED static void i_pre_nec(nec_state_t *nec_state); -static void i_pre_v25(nec_state_t *nec_state); -static void i_adc_br8(nec_state_t *nec_state); -static void i_adc_wr16(nec_state_t *nec_state); -static void i_adc_r8b(nec_state_t *nec_state); -static void i_adc_r16w(nec_state_t *nec_state); -static void i_adc_ald8(nec_state_t *nec_state); -static void i_adc_axd16(nec_state_t *nec_state); -static void i_push_ss(nec_state_t *nec_state); -static void i_pop_ss(nec_state_t *nec_state); -static void i_sbb_br8(nec_state_t *nec_state); -static void i_sbb_wr16(nec_state_t *nec_state); -static void i_sbb_r8b(nec_state_t *nec_state); -static void i_sbb_r16w(nec_state_t *nec_state); -static void i_sbb_ald8(nec_state_t *nec_state); -static void i_sbb_axd16(nec_state_t *nec_state); -static void i_push_ds(nec_state_t *nec_state); -static void i_pop_ds(nec_state_t *nec_state); -static void i_and_br8(nec_state_t *nec_state); -static void i_and_r8b(nec_state_t *nec_state); -static void i_and_wr16(nec_state_t *nec_state); -static void i_and_r16w(nec_state_t *nec_state); -static void i_and_ald8(nec_state_t *nec_state); -static void i_and_axd16(nec_state_t *nec_state); -static void i_es(nec_state_t *nec_state); -static void i_daa(nec_state_t *nec_state); -static void i_sub_br8(nec_state_t *nec_state); -static void i_sub_wr16(nec_state_t *nec_state); -static void i_sub_r8b(nec_state_t *nec_state); -static void i_sub_r16w(nec_state_t *nec_state); -static void i_sub_ald8(nec_state_t *nec_state); -static void i_sub_axd16(nec_state_t *nec_state); -static void i_cs(nec_state_t *nec_state); -static void i_das(nec_state_t *nec_state); -static void i_xor_br8(nec_state_t *nec_state); -static void i_xor_r8b(nec_state_t *nec_state); -static void i_xor_wr16(nec_state_t *nec_state); -static void i_xor_r16w(nec_state_t *nec_state); -static void i_xor_ald8(nec_state_t *nec_state); -static void i_xor_axd16(nec_state_t *nec_state); -static void i_ss(nec_state_t *nec_state); -static void i_aaa(nec_state_t *nec_state); -static void i_cmp_br8(nec_state_t *nec_state); -static void i_cmp_wr16(nec_state_t *nec_state); -static void i_cmp_r8b(nec_state_t *nec_state); -static void i_cmp_r16w(nec_state_t *nec_state); -static void i_cmp_ald8(nec_state_t *nec_state); -static void i_cmp_axd16(nec_state_t *nec_state); -static void i_ds(nec_state_t *nec_state); -static void i_aas(nec_state_t *nec_state); -static void i_inc_ax(nec_state_t *nec_state); -static void i_inc_cx(nec_state_t *nec_state); -static void i_inc_dx(nec_state_t *nec_state); -static void i_inc_bx(nec_state_t *nec_state); -static void i_inc_sp(nec_state_t *nec_state); -static void i_inc_bp(nec_state_t *nec_state); -static void i_inc_si(nec_state_t *nec_state); -static void i_inc_di(nec_state_t *nec_state); -static void i_dec_ax(nec_state_t *nec_state); -static void i_dec_cx(nec_state_t *nec_state); -static void i_dec_dx(nec_state_t *nec_state); -static void i_dec_bx(nec_state_t *nec_state); -static void i_dec_sp(nec_state_t *nec_state); -static void i_dec_bp(nec_state_t *nec_state); -static void i_dec_si(nec_state_t *nec_state); -static void i_dec_di(nec_state_t *nec_state); -static void i_push_ax(nec_state_t *nec_state); -static void i_push_cx(nec_state_t *nec_state); -static void i_push_dx(nec_state_t *nec_state); -static void i_push_bx(nec_state_t *nec_state); -static void i_push_sp(nec_state_t *nec_state); -static void i_push_bp(nec_state_t *nec_state); -static void i_push_si(nec_state_t *nec_state); -static void i_push_di(nec_state_t *nec_state); -static void i_pop_ax(nec_state_t *nec_state); -static void i_pop_cx(nec_state_t *nec_state); -static void i_pop_dx(nec_state_t *nec_state); -static void i_pop_bx(nec_state_t *nec_state); -static void i_pop_sp(nec_state_t *nec_state); -static void i_pop_bp(nec_state_t *nec_state); -static void i_pop_si(nec_state_t *nec_state); -static void i_pop_di(nec_state_t *nec_state); -static void i_pusha(nec_state_t *nec_state); -static void i_popa(nec_state_t *nec_state); -static void i_chkind(nec_state_t *nec_state); -static void i_brkn(nec_state_t *nec_state); -static void i_repnc(nec_state_t *nec_state); -static void i_repc(nec_state_t *nec_state); -static void i_push_d16(nec_state_t *nec_state); -static void i_imul_d16(nec_state_t *nec_state); -static void i_push_d8(nec_state_t *nec_state); -static void i_imul_d8(nec_state_t *nec_state); -static void i_insb(nec_state_t *nec_state); -static void i_insw(nec_state_t *nec_state); -static void i_outsb(nec_state_t *nec_state); -static void i_outsw(nec_state_t *nec_state); -static void i_jo(nec_state_t *nec_state); -static void i_jno(nec_state_t *nec_state); -static void i_jc(nec_state_t *nec_state); -static void i_jnc(nec_state_t *nec_state); -static void i_jz(nec_state_t *nec_state); -static void i_jnz(nec_state_t *nec_state); -static void i_jce(nec_state_t *nec_state); -static void i_jnce(nec_state_t *nec_state); -static void i_js(nec_state_t *nec_state); -static void i_jns(nec_state_t *nec_state); -static void i_jp(nec_state_t *nec_state); -static void i_jnp(nec_state_t *nec_state); -static void i_jl(nec_state_t *nec_state); -static void i_jnl(nec_state_t *nec_state); -static void i_jle(nec_state_t *nec_state); -static void i_jnle(nec_state_t *nec_state); -static void i_80pre(nec_state_t *nec_state); -static void i_82pre(nec_state_t *nec_state); -static void i_81pre(nec_state_t *nec_state); -static void i_83pre(nec_state_t *nec_state); -static void i_test_br8(nec_state_t *nec_state); -static void i_test_wr16(nec_state_t *nec_state); -static void i_xchg_br8(nec_state_t *nec_state); -static void i_xchg_wr16(nec_state_t *nec_state); -static void i_mov_br8(nec_state_t *nec_state); -static void i_mov_r8b(nec_state_t *nec_state); -static void i_mov_wr16(nec_state_t *nec_state); -static void i_mov_r16w(nec_state_t *nec_state); -static void i_mov_wsreg(nec_state_t *nec_state); -static void i_lea(nec_state_t *nec_state); -static void i_mov_sregw(nec_state_t *nec_state); -static void i_invalid(nec_state_t *nec_state); -static void i_popw(nec_state_t *nec_state); -static void i_nop(nec_state_t *nec_state); -static void i_xchg_axcx(nec_state_t *nec_state); -static void i_xchg_axdx(nec_state_t *nec_state); -static void i_xchg_axbx(nec_state_t *nec_state); -static void i_xchg_axsp(nec_state_t *nec_state); -static void i_xchg_axbp(nec_state_t *nec_state); -static void i_xchg_axsi(nec_state_t *nec_state); -static void i_xchg_axdi(nec_state_t *nec_state); -static void i_cbw(nec_state_t *nec_state); -static void i_cwd(nec_state_t *nec_state); -static void i_call_far(nec_state_t *nec_state); -static void i_pushf(nec_state_t *nec_state); -static void i_popf(nec_state_t *nec_state); -static void i_sahf(nec_state_t *nec_state); -static void i_lahf(nec_state_t *nec_state); -static void i_mov_aldisp(nec_state_t *nec_state); -static void i_mov_axdisp(nec_state_t *nec_state); -static void i_mov_dispal(nec_state_t *nec_state); -static void i_mov_dispax(nec_state_t *nec_state); -static void i_movsb(nec_state_t *nec_state); -static void i_movsw(nec_state_t *nec_state); -static void i_cmpsb(nec_state_t *nec_state); -static void i_cmpsw(nec_state_t *nec_state); -static void i_test_ald8(nec_state_t *nec_state); -static void i_test_axd16(nec_state_t *nec_state); -static void i_stosb(nec_state_t *nec_state); -static void i_stosw(nec_state_t *nec_state); -static void i_lodsb(nec_state_t *nec_state); -static void i_lodsw(nec_state_t *nec_state); -static void i_scasb(nec_state_t *nec_state); -static void i_scasw(nec_state_t *nec_state); -static void i_mov_ald8(nec_state_t *nec_state); -static void i_mov_cld8(nec_state_t *nec_state); -static void i_mov_dld8(nec_state_t *nec_state); -static void i_mov_bld8(nec_state_t *nec_state); -static void i_mov_ahd8(nec_state_t *nec_state); -static void i_mov_chd8(nec_state_t *nec_state); -static void i_mov_dhd8(nec_state_t *nec_state); -static void i_mov_bhd8(nec_state_t *nec_state); -static void i_mov_axd16(nec_state_t *nec_state); -static void i_mov_cxd16(nec_state_t *nec_state); -static void i_mov_dxd16(nec_state_t *nec_state); -static void i_mov_bxd16(nec_state_t *nec_state); -static void i_mov_spd16(nec_state_t *nec_state); -static void i_mov_bpd16(nec_state_t *nec_state); -static void i_mov_sid16(nec_state_t *nec_state); -static void i_mov_did16(nec_state_t *nec_state); -static void i_rotshft_bd8(nec_state_t *nec_state); -static void i_rotshft_wd8(nec_state_t *nec_state); -static void i_ret_d16(nec_state_t *nec_state); -static void i_ret(nec_state_t *nec_state); -static void i_les_dw(nec_state_t *nec_state); -static void i_lds_dw(nec_state_t *nec_state); -static void i_mov_bd8(nec_state_t *nec_state); -static void i_mov_wd16(nec_state_t *nec_state); -static void i_enter(nec_state_t *nec_state); -static void i_leave(nec_state_t *nec_state); -static void i_retf_d16(nec_state_t *nec_state); -static void i_retf(nec_state_t *nec_state); -static void i_int3(nec_state_t *nec_state); -static void i_int(nec_state_t *nec_state); -static void i_into(nec_state_t *nec_state); -static void i_iret(nec_state_t *nec_state); -static void i_rotshft_b(nec_state_t *nec_state); -static void i_rotshft_w(nec_state_t *nec_state); -static void i_rotshft_bcl(nec_state_t *nec_state); -static void i_rotshft_wcl(nec_state_t *nec_state); -static void i_aam(nec_state_t *nec_state); -static void i_aad(nec_state_t *nec_state); -static void i_setalc(nec_state_t *nec_state); -static void i_trans(nec_state_t *nec_state); -static void i_fpo(nec_state_t *nec_state); -static void i_loopne(nec_state_t *nec_state); -static void i_loope(nec_state_t *nec_state); -static void i_loop(nec_state_t *nec_state); -static void i_jcxz(nec_state_t *nec_state); -static void i_inal(nec_state_t *nec_state); -static void i_inax(nec_state_t *nec_state); -static void i_outal(nec_state_t *nec_state); -static void i_outax(nec_state_t *nec_state); -static void i_call_d16(nec_state_t *nec_state); -static void i_jmp_d16(nec_state_t *nec_state); -static void i_jmp_far(nec_state_t *nec_state); -static void i_jmp_d8(nec_state_t *nec_state); -static void i_inaldx(nec_state_t *nec_state); -static void i_inaxdx(nec_state_t *nec_state); -static void i_outdxal(nec_state_t *nec_state); -static void i_outdxax(nec_state_t *nec_state); -static void i_lock(nec_state_t *nec_state); -static void i_brks(nec_state_t *nec_state); -static void i_repne(nec_state_t *nec_state); -static void i_repe(nec_state_t *nec_state); -static void i_hlt(nec_state_t *nec_state); -static void i_cmc(nec_state_t *nec_state); -static void i_f6pre(nec_state_t *nec_state); -static void i_f7pre(nec_state_t *nec_state); -static void i_clc(nec_state_t *nec_state); -static void i_stc(nec_state_t *nec_state); -static void i_di(nec_state_t *nec_state); -static void i_ei(nec_state_t *nec_state); -static void i_cld(nec_state_t *nec_state); -static void i_std(nec_state_t *nec_state); -static void i_fepre(nec_state_t *nec_state); -static void i_ffpre(nec_state_t *nec_state); - -static void i_wait(nec_state_t *nec_state); - -static void (*const nec_instruction[256])(nec_state_t *nec_state) = -{ - i_add_br8, /* 0x00 */ - i_add_wr16, /* 0x01 */ - i_add_r8b, /* 0x02 */ - i_add_r16w, /* 0x03 */ - i_add_ald8, /* 0x04 */ - i_add_axd16, /* 0x05 */ - i_push_es, /* 0x06 */ - i_pop_es, /* 0x07 */ - i_or_br8, /* 0x08 */ - i_or_wr16, /* 0x09 */ - i_or_r8b, /* 0x0a */ - i_or_r16w, /* 0x0b */ - i_or_ald8, /* 0x0c */ - i_or_axd16, /* 0x0d */ - i_push_cs, /* 0x0e */ - i_pre_v25, /* 0x0f */ - i_adc_br8, /* 0x10 */ - i_adc_wr16, /* 0x11 */ - i_adc_r8b, /* 0x12 */ - i_adc_r16w, /* 0x13 */ - i_adc_ald8, /* 0x14 */ - i_adc_axd16, /* 0x15 */ - i_push_ss, /* 0x16 */ - i_pop_ss, /* 0x17 */ - i_sbb_br8, /* 0x18 */ - i_sbb_wr16, /* 0x19 */ - i_sbb_r8b, /* 0x1a */ - i_sbb_r16w, /* 0x1b */ - i_sbb_ald8, /* 0x1c */ - i_sbb_axd16, /* 0x1d */ - i_push_ds, /* 0x1e */ - i_pop_ds, /* 0x1f */ - i_and_br8, /* 0x20 */ - i_and_wr16, /* 0x21 */ - i_and_r8b, /* 0x22 */ - i_and_r16w, /* 0x23 */ - i_and_ald8, /* 0x24 */ - i_and_axd16, /* 0x25 */ - i_es, /* 0x26 */ - i_daa, /* 0x27 */ - i_sub_br8, /* 0x28 */ - i_sub_wr16, /* 0x29 */ - i_sub_r8b, /* 0x2a */ - i_sub_r16w, /* 0x2b */ - i_sub_ald8, /* 0x2c */ - i_sub_axd16, /* 0x2d */ - i_cs, /* 0x2e */ - i_das, /* 0x2f */ - i_xor_br8, /* 0x30 */ - i_xor_wr16, /* 0x31 */ - i_xor_r8b, /* 0x32 */ - i_xor_r16w, /* 0x33 */ - i_xor_ald8, /* 0x34 */ - i_xor_axd16, /* 0x35 */ - i_ss, /* 0x36 */ - i_aaa, /* 0x37 */ - i_cmp_br8, /* 0x38 */ - i_cmp_wr16, /* 0x39 */ - i_cmp_r8b, /* 0x3a */ - i_cmp_r16w, /* 0x3b */ - i_cmp_ald8, /* 0x3c */ - i_cmp_axd16, /* 0x3d */ - i_ds, /* 0x3e */ - i_aas, /* 0x3f */ - i_inc_ax, /* 0x40 */ - i_inc_cx, /* 0x41 */ - i_inc_dx, /* 0x42 */ - i_inc_bx, /* 0x43 */ - i_inc_sp, /* 0x44 */ - i_inc_bp, /* 0x45 */ - i_inc_si, /* 0x46 */ - i_inc_di, /* 0x47 */ - i_dec_ax, /* 0x48 */ - i_dec_cx, /* 0x49 */ - i_dec_dx, /* 0x4a */ - i_dec_bx, /* 0x4b */ - i_dec_sp, /* 0x4c */ - i_dec_bp, /* 0x4d */ - i_dec_si, /* 0x4e */ - i_dec_di, /* 0x4f */ - i_push_ax, /* 0x50 */ - i_push_cx, /* 0x51 */ - i_push_dx, /* 0x52 */ - i_push_bx, /* 0x53 */ - i_push_sp, /* 0x54 */ - i_push_bp, /* 0x55 */ - i_push_si, /* 0x56 */ - i_push_di, /* 0x57 */ - i_pop_ax, /* 0x58 */ - i_pop_cx, /* 0x59 */ - i_pop_dx, /* 0x5a */ - i_pop_bx, /* 0x5b */ - i_pop_sp, /* 0x5c */ - i_pop_bp, /* 0x5d */ - i_pop_si, /* 0x5e */ - i_pop_di, /* 0x5f */ - i_pusha, /* 0x60 */ - i_popa, /* 0x61 */ - i_chkind, /* 0x62 */ - i_brkn, /* 0x63 - V25S/V35S only */ - i_repnc, /* 0x64 */ - i_repc, /* 0x65 */ - i_invalid, /* 0x66 */ - i_invalid, /* 0x67 */ - i_push_d16, /* 0x68 */ - i_imul_d16, /* 0x69 */ - i_push_d8, /* 0x6a */ - i_imul_d8, /* 0x6b */ - i_insb, /* 0x6c */ - i_insw, /* 0x6d */ - i_outsb, /* 0x6e */ - i_outsw, /* 0x6f */ - i_jo, /* 0x70 */ - i_jno, /* 0x71 */ - i_jc, /* 0x72 */ - i_jnc, /* 0x73 */ - i_jz, /* 0x74 */ - i_jnz, /* 0x75 */ - i_jce, /* 0x76 */ - i_jnce, /* 0x77 */ - i_js, /* 0x78 */ - i_jns, /* 0x79 */ - i_jp, /* 0x7a */ - i_jnp, /* 0x7b */ - i_jl, /* 0x7c */ - i_jnl, /* 0x7d */ - i_jle, /* 0x7e */ - i_jnle, /* 0x7f */ - i_80pre, /* 0x80 */ - i_81pre, /* 0x81 */ - i_82pre, /* 0x82 */ - i_83pre, /* 0x83 */ - i_test_br8, /* 0x84 */ - i_test_wr16, /* 0x85 */ - i_xchg_br8, /* 0x86 */ - i_xchg_wr16, /* 0x87 */ - i_mov_br8, /* 0x88 */ - i_mov_wr16, /* 0x89 */ - i_mov_r8b, /* 0x8a */ - i_mov_r16w, /* 0x8b */ - i_mov_wsreg, /* 0x8c */ - i_lea, /* 0x8d */ - i_mov_sregw, /* 0x8e */ - i_popw, /* 0x8f */ - i_nop, /* 0x90 */ - i_xchg_axcx, /* 0x91 */ - i_xchg_axdx, /* 0x92 */ - i_xchg_axbx, /* 0x93 */ - i_xchg_axsp, /* 0x94 */ - i_xchg_axbp, /* 0x95 */ - i_xchg_axsi, /* 0x96 */ - i_xchg_axdi, /* 0x97 */ - i_cbw, /* 0x98 */ - i_cwd, /* 0x99 */ - i_call_far, /* 0x9a */ - i_wait, /* 0x9b */ - i_pushf, /* 0x9c */ - i_popf, /* 0x9d */ - i_sahf, /* 0x9e */ - i_lahf, /* 0x9f */ - i_mov_aldisp, /* 0xa0 */ - i_mov_axdisp, /* 0xa1 */ - i_mov_dispal, /* 0xa2 */ - i_mov_dispax, /* 0xa3 */ - i_movsb, /* 0xa4 */ - i_movsw, /* 0xa5 */ - i_cmpsb, /* 0xa6 */ - i_cmpsw, /* 0xa7 */ - i_test_ald8, /* 0xa8 */ - i_test_axd16, /* 0xa9 */ - i_stosb, /* 0xaa */ - i_stosw, /* 0xab */ - i_lodsb, /* 0xac */ - i_lodsw, /* 0xad */ - i_scasb, /* 0xae */ - i_scasw, /* 0xaf */ - i_mov_ald8, /* 0xb0 */ - i_mov_cld8, /* 0xb1 */ - i_mov_dld8, /* 0xb2 */ - i_mov_bld8, /* 0xb3 */ - i_mov_ahd8, /* 0xb4 */ - i_mov_chd8, /* 0xb5 */ - i_mov_dhd8, /* 0xb6 */ - i_mov_bhd8, /* 0xb7 */ - i_mov_axd16, /* 0xb8 */ - i_mov_cxd16, /* 0xb9 */ - i_mov_dxd16, /* 0xba */ - i_mov_bxd16, /* 0xbb */ - i_mov_spd16, /* 0xbc */ - i_mov_bpd16, /* 0xbd */ - i_mov_sid16, /* 0xbe */ - i_mov_did16, /* 0xbf */ - i_rotshft_bd8, /* 0xc0 */ - i_rotshft_wd8, /* 0xc1 */ - i_ret_d16, /* 0xc2 */ - i_ret, /* 0xc3 */ - i_les_dw, /* 0xc4 */ - i_lds_dw, /* 0xc5 */ - i_mov_bd8, /* 0xc6 */ - i_mov_wd16, /* 0xc7 */ - i_enter, /* 0xc8 */ - i_leave, /* 0xc9 */ - i_retf_d16, /* 0xca */ - i_retf, /* 0xcb */ - i_int3, /* 0xcc */ - i_int, /* 0xcd */ - i_into, /* 0xce */ - i_iret, /* 0xcf */ - i_rotshft_b, /* 0xd0 */ - i_rotshft_w, /* 0xd1 */ - i_rotshft_bcl, /* 0xd2 */ - i_rotshft_wcl, /* 0xd3 */ - i_aam, /* 0xd4 */ - i_aad, /* 0xd5 */ - i_setalc, /* 0xd6 */ - i_trans, /* 0xd7 */ - i_fpo, /* 0xd8 */ - i_fpo, /* 0xd9 */ - i_fpo, /* 0xda */ - i_fpo, /* 0xdb */ - i_fpo, /* 0xdc */ - i_fpo, /* 0xdd */ - i_fpo, /* 0xde */ - i_fpo, /* 0xdf */ - i_loopne, /* 0xe0 */ - i_loope, /* 0xe1 */ - i_loop, /* 0xe2 */ - i_jcxz, /* 0xe3 */ - i_inal, /* 0xe4 */ - i_inax, /* 0xe5 */ - i_outal, /* 0xe6 */ - i_outax, /* 0xe7 */ - i_call_d16, /* 0xe8 */ - i_jmp_d16, /* 0xe9 */ - i_jmp_far, /* 0xea */ - i_jmp_d8, /* 0xeb */ - i_inaldx, /* 0xec */ - i_inaxdx, /* 0xed */ - i_outdxal, /* 0xee */ - i_outdxax, /* 0xef */ - i_lock, /* 0xf0 */ - i_brks, /* 0xf1 */ - i_repne, /* 0xf2 */ - i_repe, /* 0xf3 */ - i_hlt, /* 0xf4 */ - i_cmc, /* 0xf5 */ - i_f6pre, /* 0xf6 */ - i_f7pre, /* 0xf7 */ - i_clc, /* 0xf8 */ - i_stc, /* 0xf9 */ - i_di, /* 0xfa */ - i_ei, /* 0xfb */ - i_cld, /* 0xfc */ - i_std, /* 0xfd */ - i_fepre, /* 0xfe */ - i_ffpre /* 0xff */ -}; diff --git a/jan/src/cpu/nec/v25priv.h b/jan/src/cpu/nec/v25priv.h deleted file mode 100644 index f9a7a3740..000000000 --- a/jan/src/cpu/nec/v25priv.h +++ /dev/null @@ -1,278 +0,0 @@ -/* Cpu types, steps of 8 to help the cycle count calculation */ -#define V33_TYPE 0 -#define V30_TYPE 8 -#define V20_TYPE 16 - -#ifndef FALSE -#define FALSE 0 -#define TRUE 1 -#endif - -/* interrupt vectors */ -enum -{ - NEC_DIVIDE_VECTOR = 0, - NEC_TRAP_VECTOR = 1, - NEC_NMI_VECTOR = 2, - NEC_BRKV_VECTOR = 4, - NEC_CHKIND_VECTOR = 5, - NEC_IBRK_VECTOR = 19, - NEC_INTTU0_VECTOR = 28, - NEC_INTTU1_VECTOR = 29, - NEC_INTTU2_VECTOR = 30, - NEC_INTD0_VECTOR = 20, - NEC_INTD1_VECTOR = 21, - NEC_INTP0_VECTOR = 24, - NEC_INTP1_VECTOR = 25, - NEC_INTP2_VECTOR = 26, - NEC_INTSER0_VECTOR = 12, - NEC_INTSR0_VECTOR = 13, - NEC_INTST0_VECTOR = 14, - NEC_INTSER1_VECTOR = 16, - NEC_INTSR1_VECTOR = 17, - NEC_INTST1_VECTOR = 18, - NEC_INTTB_VECTOR = 31 -}; - -/* interrupt sources */ -typedef enum -{ - BRK = 0, - INT_IRQ = 1, - NMI_IRQ = 1 << 1, - INTTU0 = 1 << 2, - INTTU1 = 1 << 3, - INTTU2 = 1 << 4, - INTD0 = 1 << 5, - INTD1 = 1 << 6, - INTP0 = 1 << 7, - INTP1 = 1 << 8, - INTP2 = 1 << 9, - INTSER0 = 1 << 10, - INTSR0 = 1 << 11, - INTST0 = 1 << 12, - INTSER1 = 1 << 13, - INTSR1 = 1 << 14, - INTST1 = 1 << 15, - INTTB = 1 << 16, - BRKN = 1 << 17, - BRKS = 1 << 18 -} INTSOURCES; - -/* internal RAM and register banks */ -typedef union -{ - UINT16 w[128]; - UINT8 b[256]; -} internalram; - -typedef struct _v25_state_t v25_state_t; -struct _v25_state_t -{ - internalram ram; - offs_t fetch_xor; - - UINT16 ip; - - /* PSW flags */ - INT32 SignVal; - UINT32 AuxVal, OverVal, ZeroVal, CarryVal, ParityVal; /* 0 or non-0 valued flags */ - UINT8 IBRK, F0, F1, TF, IF, DF, MF; /* 0 or 1 valued flags */ - UINT8 RBW, RBB; /* current register bank base, preshifted for word and byte registers */ - - /* interrupt related */ - UINT32 vector; - UINT32 pending_irq; - UINT32 unmasked_irq; - UINT32 bankswitch_irq; - UINT8 priority_inttu, priority_intd, priority_intp, priority_ints0, priority_ints1; - UINT8 IRQS, ISPR; - UINT32 nmi_state; - UINT32 irq_state; - UINT32 poll_state; - UINT32 mode_state; - UINT32 intp_state[3]; - UINT8 no_interrupt; - UINT8 halted; - - /* timer related */ - UINT16 TM0, MD0, TM1, MD1; - UINT8 TMC0, TMC1; -// emu_timer *timers[4]; - int timer_param[4]; - int timer_cycles_period[4]; - int timer_cycles_until_trigger[4]; - unsigned char timer_enabled[4]; - unsigned char timer_flags[4]; - unsigned int clock; // unscaled! - - /* system control */ - UINT8 RAMEN, TB, PCK; /* PRC register */ - UINT32 IDB; - - int icount; - - //const nec_config *config; - unsigned char *decode; - - UINT8 prefetch_size; - UINT8 prefetch_cycles; - INT8 prefetch_count; - UINT8 prefetch_reset; - UINT32 chip_type; - - UINT32 prefix_base; /* base address of the latest prefix segment */ - UINT8 seg_prefix; /* prefix segment indicator */ - - UINT32 cycles_total; - UINT32 cycles_remaining; - INT8 stop_run; -}; - -enum { - VECTOR_PC = 0x02/2, - PSW_SAVE = 0x04/2, - PC_SAVE = 0x06/2 -}; - -typedef enum { - DS1 = 0x0E/2, - PS = 0x0C/2, - SS = 0x0A/2, - DS0 = 0x08/2 -} SREGS; - -typedef enum { - AW = 0x1E/2, - CW = 0x1C/2, - DW = 0x1A/2, - BW = 0x18/2, - SP = 0x16/2, - BP = 0x14/2, - IX = 0x12/2, - IY = 0x10/2 -} WREGS; - -#ifdef LSB_FIRST -typedef enum { - AL = 0x1e, //NATIVE_ENDIAN_VALUE_LE_BE(0x1E, 0x1F), - AH = 0x1f, //NATIVE_ENDIAN_VALUE_LE_BE(0x1F, 0x1E), - CL = 0x1c, //NATIVE_ENDIAN_VALUE_LE_BE(0x1C, 0x1D), - CH = 0x1d, //NATIVE_ENDIAN_VALUE_LE_BE(0x1D, 0x1C), - DL = 0x1a, //NATIVE_ENDIAN_VALUE_LE_BE(0x1A, 0x1B), - DH = 0x1b, //NATIVE_ENDIAN_VALUE_LE_BE(0x1B, 0x1A), - BL = 0x18, //NATIVE_ENDIAN_VALUE_LE_BE(0x18, 0x19), - BH = 0x19 //NATIVE_ENDIAN_VALUE_LE_BE(0x19, 0x18) -} BREGS; -#else -typedef enum { - AL = 0x1f, //NATIVE_ENDIAN_VALUE_LE_BE(0x1E, 0x1F), - AH = 0x1e, //NATIVE_ENDIAN_VALUE_LE_BE(0x1F, 0x1E), - CL = 0x1d, //NATIVE_ENDIAN_VALUE_LE_BE(0x1C, 0x1D), - CH = 0x1c, //NATIVE_ENDIAN_VALUE_LE_BE(0x1D, 0x1C), - DL = 0x1b, //NATIVE_ENDIAN_VALUE_LE_BE(0x1A, 0x1B), - DH = 0x1a, //NATIVE_ENDIAN_VALUE_LE_BE(0x1B, 0x1A), - BL = 0x19, //NATIVE_ENDIAN_VALUE_LE_BE(0x18, 0x19), - BH = 0x18 //NATIVE_ENDIAN_VALUE_LE_BE(0x19, 0x18) -} BREGS; -#endif - -#define SetRB(x) do { nec_state->RBW = (x) << 4; nec_state->RBB = (x) << 5; } while (0) - -#define Sreg(x) nec_state->ram.w[nec_state->RBW + (x)] -#define Wreg(x) nec_state->ram.w[nec_state->RBW + (x)] -#define Breg(x) nec_state->ram.b[nec_state->RBB + (x)] - -#define PC(n) ((Sreg(PS)<<4)+(n)->ip) - -#define CF (nec_state->CarryVal!=0) -#define SF (nec_state->SignVal<0) -#define ZF (nec_state->ZeroVal==0) -#define PF parity_table[(BYTE)nec_state->ParityVal] -#define AF (nec_state->AuxVal!=0) -#define OF (nec_state->OverVal!=0) -#define RB (nec_state->RBW >> 4) - -/************************************************************************/ - -UINT8 v25_read_byte(v25_state_t *nec_state, unsigned a); -UINT16 v25_read_word(v25_state_t *nec_state, unsigned a); -void v25_write_byte(v25_state_t *nec_state, unsigned a, UINT8 d); -void v25_write_word(v25_state_t *nec_state, unsigned a, UINT16 d); - -#define read_mem_byte(a) v25_read_byte(nec_state,(a)) -#define read_mem_word(a) v25_read_word(nec_state,(a)) -#define write_mem_byte(a,d) v25_write_byte(nec_state,(a),(d)) -#define write_mem_word(a,d) v25_write_word(nec_state,(a),(d)) - -#define read_port_byte(a) cpu_readport(a) -#define read_port_word(a) (cpu_readport(a)+cpu_readport((a)+1)*256) -#define write_port_byte(a,d) cpu_writeport((a),(d)) -//#define write_port_word(a,d) { cpu_writeport((a),(unsigned char)(d)); (cpu_writeport((a)+1,(d)>>8); } - -/************************************************************************/ - -#define CHANGE_PC do { EMPTY_PREFETCH(); } while (0) - -#define SegBase(Seg) (Sreg(Seg) << 4) - -#define DefaultBase(Seg) ((nec_state->seg_prefix && (Seg==DS0 || Seg==SS)) ? nec_state->prefix_base : Sreg(Seg) << 4) - -#define GetMemB(Seg,Off) (read_mem_byte(DefaultBase(Seg) + (Off))) -#define GetMemW(Seg,Off) (read_mem_word(DefaultBase(Seg) + (Off))) - -#define PutMemB(Seg,Off,x) { write_mem_byte(DefaultBase(Seg) + (Off), (x)); } -#define PutMemW(Seg,Off,x) { write_mem_word(DefaultBase(Seg) + (Off), (x)); } - -/* prefetch timing */ - -#define FETCH() fetch(nec_state) -#define FETCHWORD() fetchword(nec_state) -#define EMPTY_PREFETCH() nec_state->prefetch_reset = 1 - - -#define PUSH(val) { Wreg(SP) -= 2; write_mem_word(((Sreg(SS)<<4)+Wreg(SP)), val); } -#define POP(var) { Wreg(SP) += 2; var = read_mem_word(((Sreg(SS)<<4) + ((Wreg(SP)-2) & 0xffff))); } - -#define GetModRM UINT32 ModRM=FETCH() - -/* Cycle count macros: - CLK - cycle count is the same on all processors - CLKS - cycle count differs between processors, list all counts - CLKW - cycle count for word read/write differs for odd/even source/destination address - CLKM - cycle count for reg/mem instructions - CLKR - cycle count for reg/mem instructions with different counts for odd/even addresses - - - Prefetch & buswait time is not emulated. - Extra cycles for PUSH'ing or POP'ing registers to odd addresses is not emulated. -*/ - -#define CLK(all) nec_state->icount-=all -#define CLKS(v20,v30,v33) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33; nec_state->icount-=(ccount>>nec_state->chip_type)&0x7f; } -#define CLKW(v20o,v30o,v33o,v20e,v30e,v33e,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; nec_state->icount-=(addr&1)?((ocount>>nec_state->chip_type)&0x7f):((ecount>>nec_state->chip_type)&0x7f); } -#define CLKM(v20,v30,v33,v20m,v30m,v33m) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33, mcount=(v20m<<16)|(v30m<<8)|v33m; nec_state->icount-=( ModRM >=0xc0 )?((ccount>>nec_state->chip_type)&0x7f):((mcount>>nec_state->chip_type)&0x7f); } -#define CLKR(v20o,v30o,v33o,v20e,v30e,v33e,vall,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; if (ModRM >=0xc0) nec_state->icount-=vall; else nec_state->icount-=(addr&1)?((ocount>>nec_state->chip_type)&0x7f):((ecount>>nec_state->chip_type)&0x7f); } - -/************************************************************************/ -#define CompressFlags() (WORD)(CF | (nec_state->IBRK << 1) | (PF << 2) | (nec_state->F0 << 3) | (AF << 4) \ - | (nec_state->F1 << 5) | (ZF << 6) | (SF << 7) | (nec_state->TF << 8) | (nec_state->IF << 9) \ - | (nec_state->DF << 10) | (OF << 11) | (RB << 12) | (nec_state->MF << 15)) - -#define ExpandFlags(f) \ -{ \ - nec_state->CarryVal = (f) & 0x0001; \ - nec_state->IBRK = ((f) & 0x0002) == 0x0002; \ - nec_state->ParityVal = !((f) & 0x0004); \ - nec_state->F0 = ((f) & 0x0008) == 0x0008; \ - nec_state->AuxVal = (f) & 0x0010; \ - nec_state->F1 = ((f) & 0x0020) == 0x0020; \ - nec_state->ZeroVal = !((f) & 0x0040); \ - nec_state->SignVal = (f) & 0x0080 ? -1 : 0; \ - nec_state->TF = ((f) & 0x0100) == 0x0100; \ - nec_state->IF = ((f) & 0x0200) == 0x0200; \ - nec_state->DF = ((f) & 0x0400) == 0x0400; \ - nec_state->OverVal = (f) & 0x0800; \ - /* RB only changes on BRKCS/RETRBI/TSKSW, so skip it */ \ - nec_state->MF = ((f) & 0x8000) == 0x8000; \ -} diff --git a/jan/src/cpu/nec/v25sfr.c b/jan/src/cpu/nec/v25sfr.c deleted file mode 100644 index bc49dcd10..000000000 --- a/jan/src/cpu/nec/v25sfr.c +++ /dev/null @@ -1,412 +0,0 @@ -/**************************************************************************** - - NEC V25/V35 special function registers and internal ram access - -****************************************************************************/ - -//#include "emu.h" -//#include "nec.h" -//#include "v25priv.h" - -static UINT8 read_irqcontrol(v25_state_t *nec_state, INTSOURCES source, UINT8 priority) -{ - return (((nec_state->pending_irq & source) ? 0x80 : 0x00) - | ((nec_state->unmasked_irq & source) ? 0x00 : 0x40) - | ((nec_state->bankswitch_irq & source) ? 0x10 : 0x00) - | priority); -} - -static UINT8 read_sfr(v25_state_t *nec_state, unsigned o) -{ - UINT8 ret; - - switch(o) - { - case 0x00: /* P0 */ - ret = cpu_readport(V25_PORT_P0); - break; - case 0x08: /* P1 */ - /* P1 is combined with the interrupt lines */ - ret = ((cpu_readport(V25_PORT_P1) & 0xF0) - | (nec_state->nmi_state ? 0x00 : 0x01) - | (nec_state->intp_state[0] ? 0x00 : 0x02) - | (nec_state->intp_state[1] ? 0x00 : 0x04) - | (nec_state->intp_state[2] ? 0x00 : 0x08)); - break; - case 0x10: /* P2 */ - ret = cpu_readport(V25_PORT_P2); - break; - case 0x38: /* PT */ - ret = cpu_readport(V25_PORT_PT); - break; - case 0x4C: /* EXIC0 */ - ret = read_irqcontrol(nec_state, INTP0, nec_state->priority_intp); - break; - case 0x4D: /* EXIC1 */ - ret = read_irqcontrol(nec_state, INTP1, 7); - break; - case 0x4E: /* EXIC2 */ - ret = read_irqcontrol(nec_state, INTP2, 7); - break; - case 0x9C: /* TMIC0 */ - ret = read_irqcontrol(nec_state, INTTU0, nec_state->priority_inttu); - break; - case 0x9D: /* TMIC1 */ - ret = read_irqcontrol(nec_state, INTTU1, 7); - break; - case 0x9E: /* TMIC2 */ - ret = read_irqcontrol(nec_state, INTTU2, 7); - break; - case 0xEA: /* FLAG */ - ret = ((nec_state->F0 << 3) | (nec_state->F1 << 5)); - break; - case 0xEB: /* PRC */ - ret = (nec_state->RAMEN ? 0x40 : 0); - switch (nec_state->TB) - { - case 10: - break; - case 13: - ret |= 0x04; - break; - case 16: - ret |= 0x08; - break; - case 20: - ret |= 0x0C; - break; - } - switch (nec_state->PCK) - { - case 2: - break; - case 4: - ret |= 0x01; - break; - case 8: - ret |= 0x02; - break; - } - break; - case 0xEC: /* TBIC */ - ret = read_irqcontrol(nec_state, INTTB, 7); - break; - case 0xEF: /* IRQS */ - ret = nec_state->IRQS; - break; - case 0xFC: /* ISPR */ - ret = nec_state->ISPR; - break; - case 0xFF: /* IDB */ - ret = (nec_state->IDB >> 12); - break; - default: -// logerror("%06x: Read from special function register %02x\n",PC(nec_state),o); - ret = 0; - } - return ret; -} - -static UINT16 read_sfr_word(v25_state_t *nec_state, unsigned o) -{ - UINT16 ret; - - switch(o) - { - case 0x80: /* TM0 */ -// logerror("%06x: Warning: read back TM0\n",PC(nec_state)); - ret = nec_state->TM0; - break; - case 0x82: /* MD0 */ -// logerror("%06x: Warning: read back MD0\n",PC(nec_state)); - ret = nec_state->MD0; - break; - case 0x88: /* TM1 */ -// logerror("%06x: Warning: read back TM1\n",PC(nec_state)); - ret = nec_state->TM1; - break; - case 0x8A: /* MD1 */ -// logerror("%06x: Warning: read back MD1\n",PC(nec_state)); - ret = nec_state->MD1; - break; - default: - ret = (read_sfr(nec_state, o) | (read_sfr(nec_state, o+1) << 8)); - } - return ret; -} - -static void write_irqcontrol(v25_state_t *nec_state, INTSOURCES source, UINT8 d) -{ - if(d & 0x80) - nec_state->pending_irq |= source; - else - nec_state->pending_irq &= ~source; - - if(d & 0x40) - nec_state->unmasked_irq &= ~source; - else - nec_state->unmasked_irq |= source; - -// if(d & 0x20) -// logerror("%06x: Warning: macro service function not implemented\n",PC(nec_state)); - - if(d & 0x10) - nec_state->bankswitch_irq |= source; - else - nec_state->bankswitch_irq &= ~source; -} - -static void write_sfr(v25_state_t *nec_state, unsigned o, UINT8 d) -{ - int tmp; - - static const int timebases[4] = { 10, 13, 16, 20 }; - static const int clocks[4] = { 2, 4, 8, 0 }; - - switch(o) - { - case 0x00: /* P0 */ - cpu_writeport(V25_PORT_P0, d); - break; - case 0x08: /* P1 */ - /* only the upper four bits of P1 can be used as output */ - cpu_writeport(V25_PORT_P1, d & 0xF0); - break; - case 0x10: /* P2 */ - cpu_writeport(V25_PORT_P2, d); - break; - case 0x4C: /* EXIC0 */ - write_irqcontrol(nec_state, INTP0, d); - nec_state->priority_intp = d & 0x7; - break; - case 0x4D: /* EXIC1 */ - write_irqcontrol(nec_state, INTP1, d); - break; - case 0x4E: /* EXIC2 */ - write_irqcontrol(nec_state, INTP2, d); - break; - case 0x90: /* TMC0 */ - nec_state->TMC0 = d; - if(d & 1) /* oneshot mode */ - { - if(d & 0x80) - { - tmp = nec_state->TM0 * nec_state->PCK * ((d & 0x40) ? 128 : 12 ); - //bprintf (0, _T("A0, TIME: %d\n"), tmp); - add_timer(nec_state, 0, tmp, INTTU0, 0/*oneshot*/); -// time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp; -// nec_state->timers[0]->adjust(time, INTTU0); - } - else - nec_state->timer_enabled[0] = 0; - - if(d & 0x20) - { - tmp = nec_state->MD0 * nec_state->PCK * ((d & 0x10) ? 128 : 12 ); - //bprintf (0, _T("A1, TIME: %d\n"), tmp); - add_timer(nec_state, 1, tmp, INTTU1, 0/*oneshot*/); -// time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp; -// nec_state->timers[1]->adjust(time, INTTU1); - } - else - nec_state->timer_enabled[1] = 0; - } - else /* interval mode */ - { - if(d & 0x80) - { - tmp = nec_state->MD0 * nec_state->PCK * ((d & 0x40) ? 128 : 6 ); - //bprintf (0, _T("B0, TIME: %d\n"), tmp); - add_timer(nec_state, 0, tmp, INTTU0, 1/*repeat*/); -// time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp; -// nec_state->timers[0]->adjust(time, INTTU0, time); - nec_state->timer_enabled[1] = 0; - nec_state->TM0 = nec_state->MD0; - } - else - { - nec_state->timer_enabled[0] = 0; - nec_state->timer_enabled[1] = 0; - } - } - break; - case 0x91: /* TMC1 */ - nec_state->TMC1 = d & 0xC0; - if(d & 0x80) - { - tmp = nec_state->MD1 * nec_state->PCK * ((d & 0x40) ? 128 : 6 ); - //bprintf (0, _T("C2, TIME: %d\n"), tmp); - add_timer(nec_state, 2, tmp, INTTU2, 1/*repeat*/); -// time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp; -// nec_state->timers[2]->adjust(time, INTTU2, time); - nec_state->TM1 = nec_state->MD1; - } - else - nec_state->timer_enabled[2] = 0; - break; - case 0x9C: /* TMIC0 */ - write_irqcontrol(nec_state, INTTU0, d); - nec_state->priority_inttu = d & 0x7; - break; - case 0x9D: /* TMIC1 */ - write_irqcontrol(nec_state, INTTU1, d); - break; - case 0x9E: /* TMIC2 */ - write_irqcontrol(nec_state, INTTU2, d); - break; - case 0xEA: /* FLAG */ - nec_state->F0 = ((d & 0x08) == 0x08); - nec_state->F1 = ((d & 0x20) == 0x20); - break; - case 0xEB: /* PRC */ -// logerror("%06x: PRC set to %02x\n", PC(nec_state), d); - nec_state->RAMEN = ((d & 0x40) == 0x40); - nec_state->TB = timebases[(d & 0x0C) >> 2]; - nec_state->PCK = clocks[d & 0x03]; - if (nec_state->PCK == 0) - { -// logerror(" Warning: invalid clock divider\n"); - nec_state->PCK = 8; - } - tmp = nec_state->PCK << nec_state->TB; - //bprintf (0, _T("d3, TIME: %d\n"), tmp); - add_timer(nec_state, 3, tmp, INTTB, 1/*repeat*/); -// time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp; -// nec_state->timers[3]->adjust(time, INTTB, time); -// logerror(" Internal RAM %sabled\n", (nec_state->RAMEN ? "en" : "dis")); -// logerror(" Time base set to 2^%d\n", nec_state->TB); -// logerror(" Clock divider set to %d\n", nec_state->PCK); - break; - case 0xEC: /* TBIC */ - /* time base interrupt doesn't support macro service, bank switching or priority control */ - write_irqcontrol(nec_state, INTTB, d & 0xC0); - break; - case 0xFF: /* IDB */ - nec_state->IDB = (d << 12) | 0xE00; -// logerror("%06x: IDB set to %02x\n",PC(nec_state),d); - break; -// default: -// logerror("%06x: Wrote %02x to special function register %02x\n",PC(nec_state),d,o); - } -} - -static void write_sfr_word(v25_state_t *nec_state, unsigned o, UINT16 d) -{ - switch(o) - { - case 0x80: /* TM0 */ - nec_state->TM0 = d; - break; - case 0x82: /* MD0 */ - nec_state->MD0 = d; - break; - case 0x88: /* TM1 */ - nec_state->TM1 = d; - break; - case 0x8A: /* MD1 */ - nec_state->MD1 = d; - break; - default: - write_sfr(nec_state, o, d); - write_sfr(nec_state, o+1, d >> 8); - } -} - -UINT8 v25_read_byte(v25_state_t *nec_state, unsigned a) -{ - if((a & 0xFFE00) == nec_state->IDB || a == 0xFFFFF) - { - unsigned o = a & 0x1FF; - - if(nec_state->RAMEN && o < 0x100) - return nec_state->ram.b[BYTE_XOR_LE(o)]; - - if(o >= 0x100) - return read_sfr(nec_state, o-0x100); - } - - return cpu_readmem20(a); -} - -UINT16 v25_read_word(v25_state_t *nec_state, unsigned a) -{ - if( a & 1 ) - return (v25_read_byte(nec_state, a) | (v25_read_byte(nec_state, a + 1) << 8)); - - if((a & 0xFFE00) == nec_state->IDB) - { - unsigned o = a & 0x1FF; - - if(nec_state->RAMEN && o < 0x100) - return nec_state->ram.w[o/2]; - - if(o >= 0x100) - return read_sfr_word(nec_state, o-0x100); - } - - if(a == 0xFFFFE) /* not sure about this - manual says FFFFC-FFFFE are "reserved" */ - return (cpu_readmem20(a) | (read_sfr(nec_state, 0xFF) << 8)); - - return (cpu_readmem20(a) | (cpu_readmem20(a + 1) << 8)); - //return nec_state->program->read_word(a); -} - -void v25_write_byte(v25_state_t *nec_state, unsigned a, UINT8 d) -{ - if((a & 0xFFE00) == nec_state->IDB || a == 0xFFFFF) - { - unsigned o = a & 0x1FF; - - if(nec_state->RAMEN && o < 0x100) - { - nec_state->ram.b[BYTE_XOR_LE(o)] = d; - return; - } - - if(o >= 0x100) - { - write_sfr(nec_state, o-0x100, d); - return; - } - } - - cpu_writemem20(a, d); -} - -void v25_write_word(v25_state_t *nec_state, unsigned a, UINT16 d) -{ - if( a & 1 ) - { - v25_write_byte(nec_state, a, d); - v25_write_byte(nec_state, a + 1, d >> 8); - return; - } - - if((a & 0xFFE00) == nec_state->IDB) - { - unsigned o = a & 0x1FF; - - if(nec_state->RAMEN && o < 0x100) - { - nec_state->ram.w[o/2] = d; - return; - } - - if(o >= 0x100) - { - write_sfr_word(nec_state, o-0x100, d); - return; - } - } - - if(a == 0xFFFFE) /* not sure about this - manual says FFFFC-FFFFE are "reserved" */ - { - cpu_writemem20(a, d); - write_sfr(nec_state, 0xFF, d >> 8); - return; - } - - //nec_state->program->write_word(a, d); - cpu_writemem20(a, d); - cpu_writemem20(a+1, d>>8); -} diff --git a/jan/src/cpu/nec_intf.cpp b/jan/src/cpu/nec_intf.cpp deleted file mode 100644 index 4fb8460ba..000000000 --- a/jan/src/cpu/nec_intf.cpp +++ /dev/null @@ -1,652 +0,0 @@ -// Nec V20/V30/V33/V25/V35 interface -// Written by OopsWare -// http://oopsware.googlepages.com -// Heavily modified by iq_132 (Nov, 2011) - -#include "burnint.h" -#include "nec_intf.h" - -#define MAX_VEZ 4 - -//---------------------------------------------------------------------------------- -// nec.cpp -void necInit(INT32 cpu, INT32 type); -void necCpuOpen(INT32 cpu); -void necCpuClose(); -INT32 nec_reset(); -INT32 nec_execute(INT32 cycles); -void nec_set_irq_line_and_vector(INT32 irqline, INT32 vector, INT32 state); -UINT32 nec_total_cycles(); -void nec_new_frame(); -INT32 necGetPC(INT32 n); -void necScan(INT32 cpu, INT32 nAction); -void necRunEnd(); -void necIdle(INT32 cycles); - -// v25.cpp -INT32 v25_reset(); -void v25_open(INT32 cpu); -void v25_close(); -void v25_set_irq_line_and_vector(INT32 irqline, INT32 vector, INT32 state); -INT32 v25_execute(INT32 cycles); -void v25Init(INT32 cpu, INT32 type, INT32 clock); -void v25_set_decode(UINT8 *table); -UINT32 v25_total_cycles(); -void v25_new_frame(); -INT32 v25GetPC(INT32 n); -void v25Scan(INT32 cpu, INT32 nAction); -void v25RunEnd(); -void v25Idle(INT32 cycles); - -//---------------------------------------------------------------------------------- - -struct VezContext { - void (*cpu_open)(INT32); - void (*cpu_close)(); - INT32 (*cpu_reset)(); - INT32 (*cpu_execute)(INT32); - void (*cpu_set_irq_line)(INT32, INT32, INT32); - void (*decode)(UINT8*); - UINT32 (*total_cycles)(); - INT32 (*get_pc)(INT32); - void (*scan)(INT32, INT32); - void (*runend)(); - void (*idle)(INT32); - - UINT8 * ppMemRead[2048]; - UINT8 * ppMemWrite[2048]; - UINT8 * ppMemFetch[2048]; - UINT8 * ppMemFetchData[2048]; - - // Handlers - #ifdef FASTCALL - UINT8 (__fastcall *ReadHandler)(UINT32 a); - void (__fastcall *WriteHandler)(UINT32 a, UINT8 d); - UINT8 (__fastcall *ReadPort)(UINT32 a); - void (__fastcall *WritePort)(UINT32 a, UINT8 d); - #else - UINT8 (__cdecl *ReadHandler)(UINT32 a); - void (__cdecl *WriteHandler)(UINT32 a, UINT8 d); - UINT8 (__cdecl *ReadPort)(UINT32 a); - void (__cdecl *WritePort)(UINT32 a, UINT8 d); - #endif -}; - -static struct VezContext *VezCPUContext[MAX_VEZ] = { NULL, NULL, NULL, NULL }; -struct VezContext *VezCurrentCPU = 0; - -#define VEZ_MEM_SHIFT 9 -#define VEZ_MEM_MASK ((1 << VEZ_MEM_SHIFT) - 1) - -static INT32 nCPUCount = 0; -static INT32 nOpenedCPU = -1; -INT32 nVezCount; - -UINT8 __fastcall VezDummyReadHandler(UINT32) { return 0; } -void __fastcall VezDummyWriteHandler(UINT32, UINT8) { } -UINT8 __fastcall VezDummyReadPort(UINT32) { return 0; } -void __fastcall VezDummyWritePort(UINT32, UINT8) { } - -UINT8 cpu_readport(UINT32 p) -{ - return VezCurrentCPU->ReadPort(p); -} - -void cpu_writeport(UINT32 p,UINT32 d) -{ - VezCurrentCPU->WritePort(p, d); -} - -UINT8 cpu_readmem20(UINT32 a) -{ - a &= 0xFFFFF; - - UINT8 * p = VezCurrentCPU->ppMemRead[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - return *(p + a); - else - return VezCurrentCPU->ReadHandler(a); -} - -UINT8 cpu_readmem20_op(UINT32 a) -{ - a &= 0xFFFFF; - - UINT8 * p = VezCurrentCPU->ppMemFetch[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - return *(p + a); - else - return VezCurrentCPU->ReadHandler(a); -} - -UINT8 cpu_readmem20_arg(UINT32 a) -{ - a &= 0xFFFFF; - - UINT8 * p = VezCurrentCPU->ppMemFetchData[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - return *(p + a); - else - return VezCurrentCPU->ReadHandler(a); -} - -void cpu_writemem20(UINT32 a, UINT8 d) -{ - a &= 0xFFFFF; - - UINT8 * p = VezCurrentCPU->ppMemWrite[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - *(p + a) = d; - else - VezCurrentCPU->WriteHandler(a, d); -} - -void VezWriteByte(UINT32 a, UINT8 d) -{ - a &= 0xFFFFF; - - UINT8 * p = VezCurrentCPU->ppMemWrite[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - *(p + a) = d; - else - VezCurrentCPU->WriteHandler(a, d); -} - -void VezWriteWord(UINT32 a, UINT16 d) -{ - a &= 0xFFFFF; - - UINT16 * p = (UINT16*)VezCurrentCPU->ppMemWrite[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - *(p + (a / 2)) = d; - else { - VezCurrentCPU->WriteHandler(a, d); - VezCurrentCPU->WriteHandler(a+1, d >> 8); - } -} - -void VezWriteLong(UINT32 a, UINT32 d) -{ - a &= 0xFFFFF; - - UINT32 * p = (UINT32*)VezCurrentCPU->ppMemWrite[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - *(p + (a / 4)) = d; - else { - VezCurrentCPU->WriteHandler(a, d); - VezCurrentCPU->WriteHandler(a+1, d >> 8); - VezCurrentCPU->WriteHandler(a+2, d >> 16); - VezCurrentCPU->WriteHandler(a+3, d >> 24); - - } -} - -UINT8 VezReadByte(UINT32 a) -{ - a &= 0xFFFFF; - - UINT8 * p = VezCurrentCPU->ppMemRead[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - return *(p + a); - else - return VezCurrentCPU->ReadHandler(a); -} - -UINT16 VezReadWord(UINT32 a) -{ - a &= 0xFFFFF; - - UINT16 * p = (UINT16*)VezCurrentCPU->ppMemRead[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - return *(p + (a / 2)); - else - return VezCurrentCPU->ReadHandler(a) + (VezCurrentCPU->ReadHandler(a+1) * 0x100); -} - -UINT32 VezReadLong(UINT32 a) -{ - a &= 0xFFFFF; - - UINT32 * p = (UINT32*)VezCurrentCPU->ppMemRead[ a >> VEZ_MEM_SHIFT ]; - if ( p ) - return *(p + (a / 4)); - else - return VezCurrentCPU->ReadHandler(a) + (VezCurrentCPU->ReadHandler(a+1) * 0x100) + - (VezCurrentCPU->ReadHandler(a+2) * 0x10000) + (VezCurrentCPU->ReadHandler(a+3) * 0x1000000); -} - -static void VezCheatWrite(UINT32 a, UINT8 d) -{ - a &= 0xfffff; - - UINT8 * p; - - p = VezCurrentCPU->ppMemWrite[ a >> VEZ_MEM_SHIFT ]; - if ( p ) *(p + a) = d; - - p = VezCurrentCPU->ppMemRead[ a >> VEZ_MEM_SHIFT ]; - if ( p ) *(p + a) = d; - - p = VezCurrentCPU->ppMemFetch[ a >> VEZ_MEM_SHIFT ]; - if ( p ) *(p + a) = d; - - p = VezCurrentCPU->ppMemFetchData[ a >> VEZ_MEM_SHIFT ]; - if ( p ) *(p + a) = d; - - VezCurrentCPU->WriteHandler(a, d); -} - -void VezSetReadHandler(UINT8 (__fastcall *pHandler)(UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezSetReadHandler called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezSetReadHandler called when no CPU open\n")); -#endif - - VezCurrentCPU->ReadHandler = pHandler; -} - -void VezSetWriteHandler(void (__fastcall *pHandler)(UINT32, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezSetWriteHandler called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezSetWriteHandler called when no CPU open\n")); -#endif - - VezCurrentCPU->WriteHandler = pHandler; -} - -void VezSetReadPort(UINT8 (__fastcall *pHandler)(UINT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezSetReadPort called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezSetReadPort called when no CPU open\n")); -#endif - - VezCurrentCPU->ReadPort = pHandler; -} - -void VezSetWritePort(void (__fastcall *pHandler)(UINT32, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezSetWritePort called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezSetWritePort called when no CPU open\n")); -#endif - - VezCurrentCPU->WritePort = pHandler; -} - -void VezSetDecode(UINT8 *table) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezSetDecode called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezSetDcode called when no CPU open\n")); -#endif - - if (VezCurrentCPU->decode) { - VezCurrentCPU->decode(table); - } -} - -static cpu_core_config VezCheatCpuConfig = -{ - VezOpen, - VezClose, - cpu_readmem20, - VezCheatWrite, - VezGetActive, - VezTotalCycles, - VezNewFrame, - VezRun, - VezRunEnd, - VezReset, - 1<<20, - 0 -}; - -INT32 VezInit(INT32 cpu, INT32 type, INT32 clock) -{ - DebugCPU_VezInitted = 1; - - if (cpu >= MAX_VEZ) { - bprintf (0, _T("Only %d Vez available! Increase MAX_VEZ in vez.cpp.\n"), MAX_VEZ); - } - - VezCPUContext[cpu] = (VezContext*)BurnMalloc(sizeof(VezContext)); - - VezCurrentCPU = VezCPUContext[cpu]; - - memset(VezCurrentCPU, 0, sizeof(struct VezContext)); - - switch (type) - { - case V20_TYPE: - case V30_TYPE: - case V33_TYPE: - { - necInit(cpu, type); - - VezCurrentCPU->cpu_open = necCpuOpen; - VezCurrentCPU->cpu_close = necCpuClose; - VezCurrentCPU->cpu_reset = nec_reset; - VezCurrentCPU->cpu_execute = nec_execute; - VezCurrentCPU->cpu_set_irq_line = nec_set_irq_line_and_vector; - VezCurrentCPU->decode = NULL; // ? - VezCurrentCPU->total_cycles = nec_total_cycles; - VezCurrentCPU->get_pc = necGetPC; - VezCurrentCPU->scan = necScan; - VezCurrentCPU->runend = necRunEnd; - VezCurrentCPU->idle = necIdle; - } - break; - - case V25_TYPE: - case V35_TYPE: - { - v25Init(cpu, type&0xff, clock); - - VezCurrentCPU->cpu_open = v25_open; - VezCurrentCPU->cpu_close = v25_close; - VezCurrentCPU->cpu_reset = v25_reset; - VezCurrentCPU->cpu_execute = v25_execute; - VezCurrentCPU->cpu_set_irq_line = v25_set_irq_line_and_vector; - VezCurrentCPU->decode = v25_set_decode; - VezCurrentCPU->total_cycles = v25_total_cycles; - VezCurrentCPU->get_pc = v25GetPC; - VezCurrentCPU->scan = v25Scan; - VezCurrentCPU->runend = v25RunEnd; - VezCurrentCPU->idle = v25Idle; - - } - break; - } - - VezCurrentCPU->ReadHandler = VezDummyReadHandler; - VezCurrentCPU->WriteHandler = VezDummyWriteHandler; - VezCurrentCPU->ReadPort = VezDummyReadPort; - VezCurrentCPU->WritePort = VezDummyWritePort; - - INT32 nCount = nVezCount+1; - - nVezCount = nCPUCount = nCount; - - CpuCheatRegister(cpu, &VezCheatCpuConfig); - - return 0; -} - -INT32 VezInit(INT32 cpu, INT32 type) -{ - return VezInit(cpu, type, 0); -} - -void VezExit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezExit called without init\n")); -#endif - - for (INT32 i = 0; i < MAX_VEZ; i++) { - if (VezCPUContext[i]) { - BurnFree(VezCPUContext[i]); - VezCPUContext[i] = NULL; - } - } - - nCPUCount = 0; - nOpenedCPU = -1; - nVezCount = 0; - - nOpenedCPU = -1; - - DebugCPU_VezInitted = 0; -} - -void VezOpen(INT32 nCPU) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezOpen called without init\n")); - if (nCPU > nCPUCount) bprintf(PRINT_ERROR, _T("VezOpen called with invalid index %x\n"), nCPU); - if (nOpenedCPU != -1) bprintf(PRINT_ERROR, _T("VezOpen called when CPU already open with index %x\n"), nCPU); -#endif - - if (nCPU >= MAX_VEZ || nCPU < 0) nCPU = 0; - - nOpenedCPU = nCPU; - VezCurrentCPU = VezCPUContext[nCPU]; - VezCurrentCPU->cpu_open(nCPU); -} - -void VezClose() -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezClose called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezClose called when no CPU open\n")); -#endif - - nOpenedCPU = -1; - VezCurrentCPU->cpu_close(); - VezCurrentCPU = 0; -} - -void VezNewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezNewFrame called without init\n")); -#endif - - // should be separated? - v25_new_frame(); - nec_new_frame(); -} - -void VezRunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezRunEnd called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezRunEnd called when no CPU open\n")); -#endif - - VezCurrentCPU->runend(); -} - -void VezIdle(INT32 cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezIdle called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezIdle called when no CPU open\n")); -#endif - - VezCurrentCPU->idle(cycles); -} - -INT32 VezTotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezTotalCycles called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezTotalCycles called when no CPU open\n")); -#endif - - return VezCurrentCPU->total_cycles(); -} - -INT32 VezGetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezGetActive called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezGetActive called when no CPU open\n")); -#endif - - return nOpenedCPU; -} - -INT32 VezMemCallback(INT32 nStart,INT32 nEnd,INT32 nMode) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezMemCallback called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezMemCallback called when no CPU open\n")); -#endif - - nStart >>= VEZ_MEM_SHIFT; - nEnd += VEZ_MEM_MASK; - nEnd >>= VEZ_MEM_SHIFT; - - for (INT32 i = nStart; i < nEnd; i++) { - switch (nMode) { - case 0: - VezCurrentCPU->ppMemRead[i] = NULL; - break; - case 1: - VezCurrentCPU->ppMemWrite[i] = NULL; - break; - case 2: - VezCurrentCPU->ppMemFetch[i] = NULL; - VezCurrentCPU->ppMemFetchData[i] = NULL; - break; - } - } - return 0; -} - -INT32 VezMapArea(INT32 nStart, INT32 nEnd, INT32 nMode, UINT8 *Mem) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezMapArea called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezMapArea called when no CPU open\n")); -#endif - - INT32 s = nStart >> VEZ_MEM_SHIFT; - INT32 e = (nEnd + VEZ_MEM_MASK) >> VEZ_MEM_SHIFT; - - for (INT32 i = s; i < e; i++) { - switch (nMode) { - case 0: - VezCurrentCPU->ppMemRead[i] = Mem - nStart; - break; - case 1: - VezCurrentCPU->ppMemWrite[i] = Mem - nStart; - break; - case 2: - VezCurrentCPU->ppMemFetch[i] = Mem - nStart; - VezCurrentCPU->ppMemFetchData[i] = Mem - nStart; - break; - } - } - - return 0; -} - -INT32 VezMapArea(INT32 nStart, INT32 nEnd, INT32 nMode, UINT8 *Mem1, UINT8 *Mem2) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezMapArea called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezMapArea called when no CPU open\n")); -#endif - - INT32 s = nStart >> VEZ_MEM_SHIFT; - INT32 e = (nEnd + VEZ_MEM_MASK) >> VEZ_MEM_SHIFT; - - if (nMode != 2) return 1; - - for (INT32 i = s; i < e; i++) { - VezCurrentCPU->ppMemFetch[i] = Mem1 - nStart; - VezCurrentCPU->ppMemFetchData[i] = Mem2 - nStart; - } - - return 0; -} - -INT32 VezMapMemory(UINT8 *Mem, INT32 nStart, INT32 nEnd, INT32 nMode) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezMapMemory called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezMapMemory called when no CPU open\n")); -#endif - - for (INT32 i = 0; i < 3; i++) { - if (nMode & (1 << i)) { - VezMapArea(nStart, nEnd, i, Mem); - } - } - - return 0; -} - -void VezReset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezReset called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezReset called when no CPU open\n")); -#endif - - VezCurrentCPU->cpu_reset(); -} - -INT32 VezRun(INT32 nCycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezRun called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezRun called when no CPU open\n")); -#endif - - if (nCycles <= 0) return 0; - - return VezCurrentCPU->cpu_execute(nCycles); -} - -UINT32 VezGetPC(INT32 n) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezGetPc called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezGetPc called when no CPU open\n")); -#endif - - if (n == -1) { - return VezCurrentCPU->get_pc(-1); - } else { - if (n >= MAX_VEZ) return 0; - struct VezContext *CPU = VezCPUContext[n]; - return CPU->get_pc(n); - } - - return 0; -} - -INT32 VezScan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezScan called without init\n")); -#endif - - if ((nAction & ACB_DRIVER_DATA) == 0) - return 0; - - for (INT32 i = 0; i < nCPUCount; i++) { - struct VezContext *CPU = VezCPUContext[i]; - if (CPU->scan) { - CPU->scan(i, nAction); - } - } - - return 0; -} - -void VezSetIRQLineAndVector(const INT32 line, const INT32 vector, const INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_VezInitted) bprintf(PRINT_ERROR, _T("VezSetIRQLineAndVector called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("VezSetIRQLineAndVector called when no CPU open\n")); -#endif - - if (status == CPU_IRQSTATUS_AUTO) - { - VezCurrentCPU->cpu_set_irq_line(line, vector, CPU_IRQSTATUS_ACK); - VezCurrentCPU->cpu_execute(100); - VezCurrentCPU->cpu_set_irq_line(line, vector, CPU_IRQSTATUS_NONE); - VezCurrentCPU->cpu_execute(100); - } - else - { - VezCurrentCPU->cpu_set_irq_line(line, vector, status); - } -} diff --git a/jan/src/cpu/nec_intf.h b/jan/src/cpu/nec_intf.h deleted file mode 100644 index 56e1b6d0a..000000000 --- a/jan/src/cpu/nec_intf.h +++ /dev/null @@ -1,69 +0,0 @@ -// Nec V20/V30/V33 interface - -#ifndef FASTCALL - #undef __fastcall - #define __fastcall -#endif - -#define V33_TYPE 0 -#define V30_TYPE 8 -#define V20_TYPE 16 -#define V25_TYPE (V20_TYPE|(1<<16)) -#define V35_TYPE (V30_TYPE|(1<<16)) - -UINT8 cpu_readmem20(UINT32 a); -void cpu_writemem20(UINT32 a, UINT8 d); - -extern INT32 nVezCount; - -INT32 VezTotalCycles(); -void VezNewFrame(); -void VezRunEnd(); -void VezIdle(INT32 cycles); - -INT32 VezInit(INT32 nCPU, INT32 type, INT32 clock); // v20/v25/v30/v33/v35 -INT32 VezInit(INT32 cpu, INT32 type); // v20/v30/v33 only -void VezExit(); -void VezOpen(INT32 nCPU); -void VezClose(); -INT32 VezGetActive(); - -void VezSetDecode(UINT8 *decode); // set opcode decode - -INT32 VezMemCallback(INT32 nStart,INT32 nEnd,INT32 nMode); -INT32 VezMapArea(INT32 nStart, INT32 nEnd, INT32 nMode, UINT8 *Mem); -INT32 VezMapArea(INT32 nStart, INT32 nEnd, INT32 nMode, UINT8 *Mem1, UINT8 *Mem2); -INT32 VezMapMemory(UINT8 *Mem, INT32 nStart, INT32 nEnd, INT32 nMode); - -void VezSetReadHandler(UINT8 (__fastcall*)(UINT32)); -void VezSetWriteHandler(void (__fastcall*)(UINT32, UINT8)); - -void VezWriteByte(UINT32 a, UINT8 d); -void VezWriteWord(UINT32 a, UINT16 d); -void VezWriteLong(UINT32 a, UINT32 d); -UINT8 VezReadByte(UINT32 a); -UINT16 VezReadWord(UINT32 a); -UINT32 VezReadLong(UINT32 a); - -#define V25_PORT_P0 0x10000 -#define V25_PORT_P1 0x10002 -#define V25_PORT_P2 0x10004 -#define V25_PORT_PT 0x10006 - -void VezSetReadPort(UINT8 (__fastcall*)(UINT32)); -void VezSetWritePort(void (__fastcall*)(UINT32, UINT8)); -void VezSetIrqCallBack(INT32 (*cb)(INT32)); - -void VezReset(); -UINT32 VezGetPC(INT32 n); -INT32 VezScan(INT32 nAction); - -INT32 VezRun(INT32 nCycles); - -#define NEC_INPUT_LINE_INTP0 10 -#define NEC_INPUT_LINE_INTP1 11 -#define NEC_INPUT_LINE_INTP2 12 -#define NEC_INPUT_LINE_POLL 20 - -void VezSetIRQLineAndVector(const INT32 line, const INT32 vector, const INT32 status); - diff --git a/jan/src/cpu/pic16c5x/pic16c5x.cpp b/jan/src/cpu/pic16c5x/pic16c5x.cpp deleted file mode 100644 index fc05f1535..000000000 --- a/jan/src/cpu/pic16c5x/pic16c5x.cpp +++ /dev/null @@ -1,1018 +0,0 @@ - /**************************************************************************\ - * Microchip PIC16C5x Emulator * - * * - * Copyright Tony La Porta * - * Originally written for the MAME project. * - * * - * * - * Addressing architecture is based on the Harvard addressing scheme. * - * * - * * - * **** Change Log **** * - * TLP (06-Apr-2003) * - * - First Public release. * - * BO (07-Apr-2003) Ver 1.01 * - * - Renamed 'sleep' function to 'sleepic' to avoid C conflicts. * - * TLP (09-Apr-2003) Ver 1.10 * - * - Fixed modification of file register $03 (Status). * - * - Corrected support for 7FFh (12-bit) size ROMs. * - * - The 'call' and 'goto' instructions weren't correctly handling the * - * STATUS page info correctly. * - * - The FSR register was incorrectly oring the data with 0xe0 when read. * - * - Prescaler masking information was set to 3 instead of 7. * - * - Prescaler assign bit was set to 4 instead of 8. * - * - Timer source and edge select flags/masks were wrong. * - * - Corrected the memory bank selection in GET/SET_REGFILE and also the * - * indirect register addressing. * - * BMP (18-May-2003) Ver 1.11 * - * - pic16c5x_get_reg functions were missing 'returns'. * - * TLP (27-May-2003) Ver 1.12 * - * - Fixed the WatchDog timer count. * - * - The Prescaler rate was incorrectly being zeroed, instead of the * - * actual Prescaler counter in the CLRWDT and SLEEP instructions. * - * - Added masking to the FSR register. Upper unused bits are always 1. * - * TLP (27-Aug-2009) Ver 1.13 * - * - Indirect addressing was not taking into account special purpose * - * memory mapped locations. * - * - 'iorlw' instruction was saving the result to memory instead of * - * the W register. * - * - 'tris' instruction no longer modifies Port-C on PIC models that * - * do not have Port-C implemented. * - * TLP (07-Sep-2009) Ver 1.14 * - * - Edge sense control for the T0 count input was incorrectly reversed * - * * - * * - * **** Notes: **** * - * PIC WatchDog Timer has a seperate internal clock. For the moment, we're * - * basing the count on a 4MHz input clock, since 4MHz is the typical * - * input frequency (but by no means always). * - * A single scaler is available for the Counter/Timer or WatchDog Timer. * - * When connected to the Counter/Timer, it functions as a Prescaler, * - * hence prescale overflows, tick the Counter/Timer. * - * When connected to the WatchDog Timer, it functions as a Postscaler * - * hence WatchDog Timer overflows, tick the Postscaler. This scenario * - * means that the WatchDog timeout occurs when the Postscaler has * - * reached the scaler rate value, not when the WatchDog reaches zero. * - * CLRWDT should prevent the WatchDog Timer from timing out and generating * - * a device reset, but how is not known. The manual also mentions that * - * the WatchDog Timer can only be disabled during ROM programming, and * - * no other means seem to exist??? * - * * - \**************************************************************************/ - - - -//#include "debugger.h" -#include "burnint.h" -#include "pic16c5x.h" - -#define CLK 1 /* 1 cycle equals 4 Q-clock ticks */ - - -#ifndef INLINE -#define INLINE static inline -#endif - - -#define M_RDRAM(A) (((A) < 8) ? R.internalram[A] : PIC16C5x_RAM_RDMEM(A)) -#define M_WRTRAM(A,V) do { if ((A) < 8) R.internalram[A] = (V); else PIC16C5x_RAM_WRMEM(A,V); } while (0) -#define M_RDOP(A) PIC16C5x_RDOP(A) -#define M_RDOP_ARG(A) PIC16C5x_RDOP_ARG(A) -#define P_IN(A) PIC16C5x_In(A) -#define P_OUT(A,V) PIC16C5x_Out(A,V) -#define S_T0_IN PIC16C5x_T0_In -#define ADDR_MASK 0x7ff - -#define offs_t unsigned int - - -typedef struct -{ - /******************** CPU Internal Registers *******************/ - UINT16 PC; - UINT16 PREVPC; /* previous program counter */ - UINT8 W; - UINT8 OPTION; - UINT16 CONFIG; - UINT8 ALU; - UINT16 WDT; - UINT8 TRISA; - UINT8 TRISB; - UINT8 TRISC; - UINT16 STACK[2]; - UINT16 prescaler; /* Note: this is really an 8-bit register */ - PAIR opcode; - UINT8 internalram[8]; -} pic16C5x_Regs; - -static pic16C5x_Regs R; -static UINT16 temp_config; -static UINT8 old_T0; -static INT8 old_data; -static UINT8 picRAMmask; -static int inst_cycles; -static int delay_timer; -static int picmodel; -static int pic16C5x_reset_vector; -static int pic16C5x_icount; -typedef void (*opcode_fn) (void); - -static const unsigned cycles_000_other[16]= -{ -/*00*/ 1*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK -}; - -#define TMR0 internalram[1] -#define PCL internalram[2] -#define STATUS internalram[3] -#define FSR internalram[4] -#define PORTA internalram[5] -#define PORTB internalram[6] -#define PORTC internalram[7] -#define INDF M_RDRAM(R.FSR) - -#define ADDR (R.opcode.b.l & 0x1f) - -#define RISING_EDGE_T0 (( (int)(T0_in-old_T0) > 0) ? 1 : 0) -#define FALLING_EDGE_T0 (( (int)(T0_in-old_T0) < 0) ? 1 : 0) - - -/******** The following is the Status Flag register definition. *********/ - /* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | */ - /* | PA | TO | PD | Z | DC | C | */ -#define PA_REG 0xe0 /* PA Program Page Preselect - bit 8 is unused here */ -#define TO_FLAG 0x10 /* TO Time Out flag (WatchDog) */ -#define PD_FLAG 0x08 /* PD Power Down flag */ -#define Z_FLAG 0x04 /* Z Zero Flag */ -#define DC_FLAG 0x02 /* DC Digit Carry/Borrow flag (Nibble) */ -#define C_FLAG 0x01 /* C Carry/Borrow Flag (Byte) */ - -#define PA (R.STATUS & PA_REG) -#define TO (R.STATUS & TO_FLAG) -#define PD (R.STATUS & PD_FLAG) -#define ZERO (R.STATUS & Z_FLAG) -#define DC (R.STATUS & DC_FLAG) -#define CARRY (R.STATUS & C_FLAG) - - -/******** The following is the Option Flag register definition. *********/ - /* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | */ - /* | 0 | 0 | TOCS | TOSE | PSA | PS | */ -#define T0CS_FLAG 0x20 /* TOCS Timer 0 clock source select */ -#define T0SE_FLAG 0x10 /* TOSE Timer 0 clock source edge select */ -#define PSA_FLAG 0x08 /* PSA Prescaler Assignment bit */ -#define PS_REG 0x07 /* PS Prescaler Rate select */ - -#define T0CS (R.OPTION & T0CS_FLAG) -#define T0SE (R.OPTION & T0SE_FLAG) -#define PSA (R.OPTION & PSA_FLAG) -#define PS (R.OPTION & PS_REG) - - -/******** The following is the Config Flag register definition. *********/ - /* | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | */ - /* | CP | WDTE | FOSC | */ - /* CP Code Protect (ROM read protect) */ -#define WDTE_FLAG 0x04 /* WDTE WatchDog Timer enable */ -#define FOSC_FLAG 0x03 /* FOSC Oscillator source select */ - -#define WDTE (R.CONFIG & WDTE_FLAG) -#define FOSC (R.CONFIG & FOSC_FLAG) - - -/************************************************************************ - * Shortcuts - ************************************************************************/ - -/* Easy bit position selectors */ -#define POS ((R.opcode.b.l >> 5) & 7) -static const unsigned int bit_clr[8] = { 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f }; -static const unsigned int bit_set[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; - - -INLINE void CLR(UINT16 flag) { R.STATUS &= (UINT8)(~flag); } -INLINE void SET(UINT16 flag) { R.STATUS |= flag; } - - - -INLINE void CALCULATE_Z_FLAG(void) -{ - if (R.ALU == 0) SET(Z_FLAG); - else CLR(Z_FLAG); -} - -INLINE void CALCULATE_ADD_CARRY(void) -{ - if ((UINT8)(old_data) > (UINT8)(R.ALU)) { - SET(C_FLAG); - } - else { - CLR(C_FLAG); - } -} - -INLINE void CALCULATE_ADD_DIGITCARRY(void) -{ - if (((UINT8)(old_data) & 0x0f) > ((UINT8)(R.ALU) & 0x0f)) { - SET(DC_FLAG); - } - else { - CLR(DC_FLAG); - } -} - -INLINE void CALCULATE_SUB_CARRY(void) -{ - if ((UINT8)(old_data) < (UINT8)(R.ALU)) { - CLR(C_FLAG); - } - else { - SET(C_FLAG); - } -} - -INLINE void CALCULATE_SUB_DIGITCARRY(void) -{ - if (((UINT8)(old_data) & 0x0f) < ((UINT8)(R.ALU) & 0x0f)) { - CLR(DC_FLAG); - } - else { - SET(DC_FLAG); - } -} - - - -INLINE UINT16 POP_STACK(void) -{ - UINT16 data = R.STACK[1]; - R.STACK[1] = R.STACK[0]; - return (data & ADDR_MASK); -} -INLINE void PUSH_STACK(UINT16 data) -{ - R.STACK[0] = R.STACK[1]; - R.STACK[1] = (data & ADDR_MASK); -} - - -//INLINE -UINT8 GET_REGFILE(offs_t addr) /* Read from internal memory */ -{ - UINT8 data; - - if (addr == 0) { /* Indirect addressing */ - addr = (R.FSR & picRAMmask); - } - - if ((picmodel == 0x16C57) || (picmodel == 0x16C58)) - { - addr |= (R.FSR & 0x60); /* FSR bits 6-5 are used for banking in direct mode */ - } - if ((addr & 0x10) == 0) addr &= 0x0f; - - switch(addr) - { - case 00: /* Not an actual register, so return 0 */ - data = 0; - break; - case 04: data = (R.FSR | (UINT8)(~picRAMmask)); - break; - case 05: data = P_IN(0); - data &= R.TRISA; - data |= ((UINT8)(~R.TRISA) & R.PORTA); - data &= 0xf; /* 4-bit port (only lower 4 bits used) */ - break; - case 06: data = P_IN(1); - data &= R.TRISB; - data |= ((UINT8)(~R.TRISB) & R.PORTB); - break; - case 07: if ((picmodel == 0x16C55) || (picmodel == 0x16C57)) { - data = P_IN(2); - data &= R.TRISC; - data |= ((UINT8)(~R.TRISC) & R.PORTC); - } - else { /* PIC16C54, PIC16C56, PIC16C58 */ - data = M_RDRAM(addr); - } - break; - default: data = M_RDRAM(addr); - break; - } - - return data; -} - -//INLINE -void STORE_REGFILE(offs_t addr, UINT8 data) /* Write to internal memory */ -{ - if (addr == 0) { /* Indirect addressing */ - addr = (R.FSR & picRAMmask); - } - - if ((picmodel == 0x16C57) || (picmodel == 0x16C58)) - { - addr |= (R.FSR & 0x60); /* FSR bits 6-5 are used for banking in direct mode */ - } - if ((addr & 0x10) == 0) addr &= 0x0f; - - switch(addr) - { - case 00: /* Not an actual register, nothing to save */ - break; - case 01: delay_timer = 2; /* Timer starts after next two instructions */ - if (PSA == 0) R.prescaler = 0; /* Must clear the Prescaler */ - R.TMR0 = data; - break; - case 02: R.PCL = data; - R.PC = ((R.STATUS & PA_REG) << 4) | data; - break; - case 03: R.STATUS &= (UINT8)(~PA_REG); R.STATUS |= (data & PA_REG); - break; - case 04: R.FSR = (data | (UINT8)(~picRAMmask)); - break; - case 05: data &= 0xf; /* 4-bit port (only lower 4 bits used) */ - P_OUT(0,data & (UINT8)(~R.TRISA)); R.PORTA = data; - break; - case 06: P_OUT(1,data & (UINT8)(~R.TRISB)); R.PORTB = data; - break; - case 07: if ((picmodel == 0x16C55) || (picmodel == 0x16C57)) { - P_OUT(2,data & (UINT8)(~R.TRISC)); - R.PORTC = data; - } - else { /* PIC16C54, PIC16C56, PIC16C58 */ - M_WRTRAM(addr, data); - } - break; - default: M_WRTRAM(addr, data); - break; - } -} - - -INLINE void STORE_RESULT(offs_t addr, UINT8 data) -{ - if (R.opcode.b.l & 0x20) - { - STORE_REGFILE(addr, data); - } - else - { - R.W = data; - } -} - - -/************************************************************************ - * Emulate the Instructions - ************************************************************************/ - -/* This following function is here to fill in the void for */ -/* the opcode call function. This function is never called. */ - - -static void illegal(void) -{ - -} - - -static void addwf(void) -{ - old_data = GET_REGFILE(ADDR); - R.ALU = old_data + R.W; - STORE_RESULT(ADDR, R.ALU); - CALCULATE_Z_FLAG(); - CALCULATE_ADD_CARRY(); - CALCULATE_ADD_DIGITCARRY(); -} - -static void andwf(void) -{ - R.ALU = GET_REGFILE(ADDR) & R.W; - STORE_RESULT(ADDR, R.ALU); - CALCULATE_Z_FLAG(); -} - -static void andlw(void) -{ - R.ALU = R.opcode.b.l & R.W; - R.W = R.ALU; - CALCULATE_Z_FLAG(); -} - -static void bcf(void) -{ - R.ALU = GET_REGFILE(ADDR); - R.ALU &= bit_clr[POS]; - STORE_REGFILE(ADDR, R.ALU); -} - -static void bsf(void) -{ - R.ALU = GET_REGFILE(ADDR); - R.ALU |= bit_set[POS]; - STORE_REGFILE(ADDR, R.ALU); -} - -static void btfss(void) -{ - if ((GET_REGFILE(ADDR) & bit_set[POS]) == bit_set[POS]) - { - R.PC++ ; - R.PCL = R.PC & 0xff; - inst_cycles += 1; /* Add NOP cycles */ - } -} - -static void btfsc(void) -{ - if ((GET_REGFILE(ADDR) & bit_set[POS]) == 0) - { - R.PC++ ; - R.PCL = R.PC & 0xff; - inst_cycles += 1; /* Add NOP cycles */ - } -} - -static void call(void) -{ - PUSH_STACK(R.PC); - R.PC = ((R.STATUS & PA_REG) << 4) | R.opcode.b.l; - R.PC &= 0x6ff; - R.PCL = R.PC & 0xff; -} - -static void clrw(void) -{ - R.W = 0; - SET(Z_FLAG); -} - -static void clrf(void) -{ - STORE_REGFILE(ADDR, 0); - SET(Z_FLAG); -} - -static void clrwdt(void) -{ - R.WDT = 0; - if (PSA) R.prescaler = 0; - SET(TO_FLAG); - SET(PD_FLAG); -} - -static void comf(void) -{ - R.ALU = (UINT8)(~(GET_REGFILE(ADDR))); - STORE_RESULT(ADDR, R.ALU); - CALCULATE_Z_FLAG(); -} - -static void decf(void) -{ - R.ALU = GET_REGFILE(ADDR) - 1; - STORE_RESULT(ADDR, R.ALU); - CALCULATE_Z_FLAG(); -} - -static void decfsz(void) -{ - R.ALU = GET_REGFILE(ADDR) - 1; - STORE_RESULT(ADDR, R.ALU); - if (R.ALU == 0) - { - R.PC++ ; - R.PCL = R.PC & 0xff; - inst_cycles += 1; /* Add NOP cycles */ - } -} - -static void goto_op(void) -{ - R.PC = ((R.STATUS & PA_REG) << 4) | (R.opcode.w.l & 0x1ff); - R.PC &= ADDR_MASK; - R.PCL = R.PC & 0xff; -} - -static void incf(void) -{ - R.ALU = GET_REGFILE(ADDR) + 1; - STORE_RESULT(ADDR, R.ALU); - CALCULATE_Z_FLAG(); -} - -static void incfsz(void) -{ - R.ALU = GET_REGFILE(ADDR) + 1; - STORE_RESULT(ADDR, R.ALU); - if (R.ALU == 0) - { - R.PC++ ; - R.PCL = R.PC & 0xff; - inst_cycles += 1; /* Add NOP cycles */ - } -} - -static void iorlw(void) -{ - R.ALU = R.opcode.b.l | R.W; - R.W = R.ALU; - CALCULATE_Z_FLAG(); -} - -static void iorwf(void) -{ - R.ALU = GET_REGFILE(ADDR) | R.W; - STORE_RESULT(ADDR, R.ALU); - CALCULATE_Z_FLAG(); -} - -static void movf(void) -{ - R.ALU = GET_REGFILE(ADDR); - STORE_RESULT(ADDR, R.ALU); - CALCULATE_Z_FLAG(); -} - -static void movlw(void) -{ - R.W = R.opcode.b.l; -} - -static void movwf(void) -{ - STORE_REGFILE(ADDR, R.W); -} - -static void nop(void) -{ - /* Do nothing */ -} - -static void option(void) -{ - R.OPTION = R.W & (T0CS_FLAG | T0SE_FLAG | PSA_FLAG | PS_REG); -} - -static void retlw(void) -{ - R.W = R.opcode.b.l; - R.PC = POP_STACK(); - R.PCL = R.PC & 0xff; -} - -static void rlf(void) -{ - R.ALU = GET_REGFILE(ADDR); - R.ALU <<= 1; - if (R.STATUS & C_FLAG) R.ALU |= 1; - if (GET_REGFILE(ADDR) & 0x80) SET(C_FLAG); - else CLR(C_FLAG); - STORE_RESULT(ADDR, R.ALU); -} - -static void rrf(void) -{ - R.ALU = GET_REGFILE(ADDR); - R.ALU >>= 1; - if (R.STATUS & C_FLAG) R.ALU |= 0x80; - if (GET_REGFILE(ADDR) & 1) SET(C_FLAG); - else CLR(C_FLAG); - STORE_RESULT(ADDR, R.ALU); -} - -static void sleepic(void) -{ - if (WDTE) R.WDT = 0; - if (PSA) R.prescaler = 0; - SET(TO_FLAG); - CLR(PD_FLAG); -} - -static void subwf(void) -{ - old_data = GET_REGFILE(ADDR); - R.ALU = old_data - R.W; - STORE_RESULT(ADDR, R.ALU); - CALCULATE_Z_FLAG(); - CALCULATE_SUB_CARRY(); - CALCULATE_SUB_DIGITCARRY(); -} - -static void swapf(void) -{ - R.ALU = ((GET_REGFILE(ADDR) << 4) & 0xf0); - R.ALU |= ((GET_REGFILE(ADDR) >> 4) & 0x0f); - STORE_RESULT(ADDR, R.ALU); -} - -static void tris(void) -{ - switch(R.opcode.b.l & 0x7) - { - case 05: if (R.TRISA == R.W) break; - else R.TRISA = R.W | 0xf0; P_OUT(0,R.PORTA & (UINT8)(~R.TRISA) & 0xf); break; - case 06: if (R.TRISB == R.W) break; - else R.TRISB = R.W; P_OUT(1,R.PORTB & (UINT8)(~R.TRISB)); break; - case 07: if ((picmodel == 0x16C55) || (picmodel == 0x16C57)) { - if (R.TRISC == R.W) break; - else R.TRISC = R.W; P_OUT(2,R.PORTC & (UINT8)(~R.TRISC)); break; - } else { - illegal(); break; - } - default: illegal(); break; - } -} - -static void xorlw(void) -{ - R.ALU = R.W ^ R.opcode.b.l; - R.W = R.ALU; - CALCULATE_Z_FLAG(); -} - -static void xorwf(void) -{ - R.ALU = GET_REGFILE(ADDR) ^ R.W; - STORE_RESULT(ADDR, R.ALU); - CALCULATE_Z_FLAG(); -} - - - -/*********************************************************************** - * Cycle Timings - ***********************************************************************/ - -static const unsigned cycles_main[256]= -{ -/*00*/ 1*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*10*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*20*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, - - -/*30*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*40*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*50*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*60*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*70*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*80*/ 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, -/*90*/ 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, -/*A0*/ 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, -/*B0*/ 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, -/*C0*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*D0*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*E0*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*F0*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK -}; - -static const opcode_fn opcode_main[256]= -{ -/*00*/ nop, illegal,movwf, movwf, clrw, illegal,clrf, clrf, -/*08*/ subwf, subwf, subwf, subwf, decf, decf, decf, decf, -/*10*/ iorwf, iorwf, iorwf, iorwf, andwf, andwf, andwf, andwf, -/*18*/ xorwf, xorwf, xorwf, xorwf, addwf, addwf, addwf, addwf, -/*20*/ movf, movf, movf, movf, comf, comf, comf, comf, -/*28*/ incf, incf, incf, incf, decfsz, decfsz, decfsz, decfsz, -/*30*/ rrf, rrf, rrf, rrf, rlf, rlf, rlf, rlf, -/*38*/ swapf, swapf, swapf, swapf, incfsz, incfsz, incfsz, incfsz, -/*40*/ bcf, bcf, bcf, bcf, bcf, bcf, bcf, bcf, -/*48*/ bcf, bcf, bcf, bcf, bcf, bcf, bcf, bcf, -/*50*/ bsf, bsf, bsf, bsf, bsf, bsf, bsf, bsf, -/*58*/ bsf, bsf, bsf, bsf, bsf, bsf, bsf, bsf, -/*60*/ btfsc, btfsc, btfsc, btfsc, btfsc, btfsc, btfsc, btfsc, -/*68*/ btfsc, btfsc, btfsc, btfsc, btfsc, btfsc, btfsc, btfsc, -/*70*/ btfss, btfss, btfss, btfss, btfss, btfss, btfss, btfss, -/*78*/ btfss, btfss, btfss, btfss, btfss, btfss, btfss, btfss, -/*80*/ retlw, retlw, retlw, retlw, retlw, retlw, retlw, retlw, -/*88*/ retlw, retlw, retlw, retlw, retlw, retlw, retlw, retlw, -/*90*/ call, call, call, call, call, call, call, call, -/*98*/ call, call, call, call, call, call, call, call, -/*A0*/ goto_op,goto_op,goto_op,goto_op,goto_op,goto_op,goto_op,goto_op, -/*A8*/ goto_op,goto_op,goto_op,goto_op,goto_op,goto_op,goto_op,goto_op, -/*B0*/ goto_op,goto_op,goto_op,goto_op,goto_op,goto_op,goto_op,goto_op, -/*B8*/ goto_op,goto_op,goto_op,goto_op,goto_op,goto_op,goto_op,goto_op, -/*C0*/ movlw, movlw, movlw, movlw, movlw, movlw, movlw, movlw, -/*C8*/ movlw, movlw, movlw, movlw, movlw, movlw, movlw, movlw, -/*D0*/ iorlw, iorlw, iorlw, iorlw, iorlw, iorlw, iorlw, iorlw, -/*D8*/ iorlw, iorlw, iorlw, iorlw, iorlw, iorlw, iorlw, iorlw, -/*E0*/ andlw, andlw, andlw, andlw, andlw, andlw, andlw, andlw, -/*E8*/ andlw, andlw, andlw, andlw, andlw, andlw, andlw, andlw, -/*F0*/ xorlw, xorlw, xorlw, xorlw, xorlw, xorlw, xorlw, xorlw, -/*F8*/ xorlw, xorlw, xorlw, xorlw, xorlw, xorlw, xorlw, xorlw -}; - - -//static const unsigned cycles_000_other[16]= -//{ -///*00*/ 1*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK -//}; - -static const opcode_fn opcode_000_other[16]= -{ -/*00*/ nop, illegal,option, sleepic,clrwdt, tris, tris, tris, -/*08*/ illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal -}; - -/**************************************************************************** - * Reset registers to their initial values - ****************************************************************************/ - -static void pic16C5x_reset_regs(void) -{ - R.PC = pic16C5x_reset_vector; - R.CONFIG = temp_config; - R.TRISA = 0xff; - R.TRISB = 0xff; - R.TRISC = 0xff; - R.OPTION = (T0CS_FLAG | T0SE_FLAG | PSA_FLAG | PS_REG); - R.PCL = 0xff; - R.FSR |= (UINT8)(~picRAMmask); - R.PORTA &= 0x0f; - R.prescaler = 0; - delay_timer = 0; - old_T0 = 0; - inst_cycles = 0; -} - -static void pic16C5x_soft_reset(void) -{ -// R.STATUS &= 0x1f; - SET((TO_FLAG | PD_FLAG | Z_FLAG | DC_FLAG | C_FLAG)); - pic16C5x_reset_regs(); -} - -void pic16c5x_config(int data) -{ -// logerror("Writing %04x to the PIC16C5x config register\n",data); - temp_config = (data & 0xfff); -} - - -/**************************************************************************** - * Shut down CPU emulation - ****************************************************************************/ - -void pic16C5x_exit (void) -{ - /* nothing to do */ -} - - -/**************************************************************************** - * WatchDog - ****************************************************************************/ - -static void pic16C5x_update_watchdog(int counts) -{ - /* WatchDog is set up to count 18,000 (0x464f hex) ticks to provide */ - /* the timeout period of 0.018ms based on a 4MHz input clock. */ - /* Note: the 4MHz clock should be divided by the PIC16C5x_CLOCK_DIVIDER */ - /* which effectively makes the PIC run at 1MHz internally. */ - - /* If the current instruction is CLRWDT or SLEEP, don't update the WDT */ - - if ((R.opcode.w.l != 3) && (R.opcode.w.l != 4)) - { - UINT16 old_WDT = R.WDT; - - R.WDT -= counts; - - if (R.WDT > 0x464f) { - R.WDT = 0x464f - (0xffff - R.WDT); - } - - if (((old_WDT != 0) && (old_WDT < R.WDT)) || (R.WDT == 0)) - { - if (PSA) { - R.prescaler++; - if (R.prescaler >= (1 << PS)) { /* Prescale values from 1 to 128 */ - R.prescaler = 0; - CLR(TO_FLAG); - pic16C5x_soft_reset(); - } - } - else { - CLR(TO_FLAG); - pic16C5x_soft_reset(); - } - } - } -} - - -/**************************************************************************** - * Update Timer - ****************************************************************************/ - -static void pic16C5x_update_timer(int counts) -{ - if (PSA == 0) { - R.prescaler += counts; - if (R.prescaler >= (2 << PS)) { /* Prescale values from 2 to 256 */ - R.TMR0 += (R.prescaler / (2 << PS)); - R.prescaler %= (2 << PS); /* Overflow prescaler */ - } - } - else { - R.TMR0 += counts; - } -} - - -/**************************************************************************** - * Execute IPeriod. Return 0 if emulation should be stopped - ****************************************************************************/ - -int pic16c5xRun(int cycles) -{ - UINT8 T0_in; - pic16C5x_icount = cycles; - - do - { - if (PD == 0) /* Sleep Mode */ - { - inst_cycles = (1*CLK); - - if (WDTE) { - pic16C5x_update_watchdog(1*CLK); - } - } - else - { - R.PREVPC = R.PC; - R.opcode.d = M_RDOP(R.PC); - - R.PC++; - R.PCL++; - - if ((R.opcode.w.l & 0xff0) != 0x000) { /* Do all opcodes except the 00? ones */ - inst_cycles = cycles_main[((R.opcode.w.l >> 4) & 0xff)]; - (*(opcode_main[((R.opcode.w.l >> 4) & 0xff)]))(); - } - else { /* Opcode 0x00? has many opcodes in its minor nibble */ - inst_cycles = cycles_000_other[(R.opcode.b.l & 0x1f)]; - (*(opcode_000_other[(R.opcode.b.l & 0x1f)]))(); - } - - if (T0CS) { /* Count mode */ - T0_in = S_T0_IN; - if (T0_in) T0_in = 1; - if (T0SE) { /* Count falling edge T0 input */ - if (FALLING_EDGE_T0) { - pic16C5x_update_timer(1); - } - } - else { /* Count rising edge T0 input */ - if (RISING_EDGE_T0) { - pic16C5x_update_timer(1); - } - } - old_T0 = T0_in; - } - else { /* Timer mode */ - if (delay_timer) { - delay_timer--; - } - else { - pic16C5x_update_timer((inst_cycles/CLK)); - } - } - if (WDTE) { - pic16C5x_update_watchdog((inst_cycles/CLK)); - } - } - - pic16C5x_icount -= inst_cycles; - - } while (pic16C5x_icount>0); - - return (cycles - pic16C5x_icount); -} - - -static void pic16C54_reset(void) -{ - picmodel = 0x16C54; - picRAMmask = 0x1f; - pic16C5x_reset_vector = 0x1ff; - pic16C5x_reset_regs(); - CLR(PA_REG); - SET((TO_FLAG | PD_FLAG)); -} - -static void pic16C55_reset(void) -{ - picmodel = 0x16C55; - picRAMmask = 0x1f; - pic16C5x_reset_vector = 0x1ff; - pic16C5x_reset_regs(); - CLR(PA_REG); - SET((TO_FLAG | PD_FLAG)); -} - -static void pic16C56_reset(void) -{ - picmodel = 0x16C56; - picRAMmask = 0x1f; - pic16C5x_reset_vector = 0x3ff; - pic16C5x_reset_regs(); - CLR(PA_REG); - SET((TO_FLAG | PD_FLAG)); -} - -static void pic16C57_reset(void) -{ - picmodel = 0x16C57; - picRAMmask = 0x7f; - pic16C5x_reset_vector = 0x7ff; - pic16C5x_reset_regs(); - CLR(PA_REG); - SET((TO_FLAG | PD_FLAG)); -} - -static void pic16C58_reset(void) -{ - picmodel = 0x16C58; - picRAMmask = 0x7f; - pic16C5x_reset_vector = 0x7ff; - pic16C5x_reset_regs(); - CLR(PA_REG); - SET((TO_FLAG | PD_FLAG)); -} - - -void pic16c5xDoReset(int type, int *romlen, int *ramlen) -{ - switch (type) - { - case 0x16C54: - pic16C54_reset(); - *romlen = 0x1ff; - *ramlen = 0x01f; - return; - - case 0x16C55: - pic16C55_reset(); - *romlen = 0x3ff; // correct? - *ramlen = 0x01f; - return; - - case 0x16C56: - pic16C56_reset(); - *romlen = 0x3ff; - *ramlen = 0x01f; - return; - - case 0x16C57: - pic16C57_reset(); - *romlen = 0x7ff; - *ramlen = 0x07f; - return; - - case 0x16C58: - pic16C58_reset(); - *romlen = 0x7ff; - *ramlen = 0x07f; - return; - } -} - -void pic16c5xRunEnd() -{ - pic16C5x_icount = 0; -} - -int pic16c5xScanCpu(int nAction,int */*pnMin*/) -{ - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - SCAN_VAR(R.PC); - SCAN_VAR(R.PREVPC); - SCAN_VAR(R.W); - SCAN_VAR(R.OPTION); - SCAN_VAR(R.CONFIG); - SCAN_VAR(R.ALU); - SCAN_VAR(R.WDT); - SCAN_VAR(R.TRISA); - SCAN_VAR(R.TRISC); - SCAN_VAR(R.STACK[0]); - SCAN_VAR(R.STACK[1]); - SCAN_VAR(R.prescaler); - SCAN_VAR(R.opcode); - } - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = R.internalram; - ba.nLen = 8; - ba.nAddress = 0; - ba.szName = "Internal RAM"; - BurnAcb(&ba); - } - - return 0; -} diff --git a/jan/src/cpu/pic16c5x/pic16c5x.h b/jan/src/cpu/pic16c5x/pic16c5x.h deleted file mode 100644 index 9fce65a1b..000000000 --- a/jan/src/cpu/pic16c5x/pic16c5x.h +++ /dev/null @@ -1,108 +0,0 @@ - /**************************************************************************\ - * Microchip PIC16C5x Emulator * - * * - * Copyright Tony La Porta * - * Originally written for the MAME project. * - * * - * * - * Addressing architecture is based on the Harvard addressing scheme. * - * * - \**************************************************************************/ - - -#ifndef __PIC16C5X_H__ -#define __PIC16C5X_H__ - -#include "pic16c5x_intf.h" - - -/************************************************************************** - * Internal Clock divisor - * - * External Clock is divided internally by 4 for the instruction cycle - * times. (Each instruction cycle passes through 4 machine states). This - * is handled by the cpu execution engine. - */ - -enum -{ - PIC16C5x_PC=1, PIC16C5x_STK0, PIC16C5x_STK1, PIC16C5x_FSR, - PIC16C5x_W, PIC16C5x_ALU, PIC16C5x_STR, PIC16C5x_OPT, - PIC16C5x_TMR0, PIC16C5x_PRTA, PIC16C5x_PRTB, PIC16C5x_PRTC, - PIC16C5x_WDT, PIC16C5x_TRSA, PIC16C5x_TRSB, PIC16C5x_TRSC, - PIC16C5x_PSCL -}; - - - - -/**************************************************************************** - * Function to configure the CONFIG register. This is actually hard-wired - * during ROM programming, so should be called in the driver INIT, with - * the value if known (available in HEX dumps of the ROM). - */ - -void pic16c5x_config(int data); - - -/**************************************************************************** - * Read the state of the T0 Clock input signal - */ - -#define PIC16C5x_T0 0x10 -#define PIC16C5x_T0_In (pic16c5xReadPort((PIC16C5x_T0))) - - - -/**************************************************************************** - * Input a word from given I/O port - */ - -#define PIC16C5x_In(Port) (pic16c5xReadPort((Port))) - - - -/**************************************************************************** - * Output a word to given I/O port - */ - -#define PIC16C5x_Out(Port,Value) (pic16c5xWritePort(Port, Value)) - - - -/**************************************************************************** - * Read a word from given RAM memory location - */ - -#define PIC16C5x_RAM_RDMEM(A) (pic16c5xRead(A)) - - - -/**************************************************************************** - * Write a word to given RAM memory location - */ - -#define PIC16C5x_RAM_WRMEM(A,V) (pic16c5xWrite(A, V)) - - - -/**************************************************************************** - * PIC16C5X_RDOP() is identical to PIC16C5X_RDMEM() except it is used for - * reading opcodes. In case of system with memory mapped I/O, this function - * can be used to greatly speed up emulation - */ - -#define PIC16C5x_RDOP(A) pic16c5xFetch(A) - - -/**************************************************************************** - * PIC16C5X_RDOP_ARG() is identical to PIC16C5X_RDOP() except it is used - * for reading opcode arguments. This difference can be used to support systems - * that use different encoding mechanisms for opcodes and opcode arguments - */ - -#define PIC16C5x_RDOP_ARG(A) (pic16c5xFetch(A)) - - - -#endif /* __PIC16C5X_H__ */ diff --git a/jan/src/cpu/pic16c5x_intf.cpp b/jan/src/cpu/pic16c5x_intf.cpp deleted file mode 100644 index 1ac802993..000000000 --- a/jan/src/cpu/pic16c5x_intf.cpp +++ /dev/null @@ -1,257 +0,0 @@ -#include "burnint.h" - -void pic16c5xDoReset(INT32 type, INT32 *rom, INT32 *ram); -extern INT32 pic16c5xScanCpu(INT32 nAction, INT32* pnMin); - -// masks -static INT32 rom_address_mask = 0x7ff; -static INT32 ram_address_mask = 0x07f; - -INT32 nPic16c5xCpuType = -1; -static UINT8 *pic16c5x_rom = NULL; -static UINT8 *pic16c5x_ram = NULL; - -static UINT8 (*pPic16c5xReadPort)(UINT16 port) = NULL; -static void (*pPic16c5xWritePort)(UINT16 port, UINT8 data) = NULL; - -UINT16 pic16c5xFetch(UINT16 address) -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5x_read_op called without init\n")); -#endif - - UINT16 *ROM = (UINT16*)pic16c5x_rom; - - address &= rom_address_mask; - - return ROM[address]; -} - -UINT8 pic16c5xRead(UINT16 address) -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5x_read_byte called without init\n")); -#endif - - address &= ram_address_mask; - - if (nPic16c5xCpuType == 0x16C57 || nPic16c5xCpuType == 0x16C58) { - if (address >= 0x60 && address <= 0x6f) { - // mirror - return pic16c5x_ram[address & 0x0f]; - } - } - return pic16c5x_ram[address]; -} - -void pic16c5xWrite(UINT16 address, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5x_write_byte called without init\n")); -#endif - - address &= ram_address_mask; - - if (nPic16c5xCpuType == 0x16C57 || nPic16c5xCpuType == 0x16C58) { - if (address >= 0x60 && address <= 0x6f) { - // mirror - pic16c5x_ram[address & 0x0f] = data; - return; - } - } - - pic16c5x_ram[address] = data; -} - -UINT8 pic16c5xReadPort(UINT16 port) -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5x_read_port called without init\n")); -#endif - - if (pPic16c5xReadPort) { - return pPic16c5xReadPort(port); - } - - return 0; -} - -void pic16c5xWritePort(UINT16 port, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5x_write_port called without init\n")); -#endif - - if (pPic16c5xWritePort) { - pPic16c5xWritePort(port, data); - return; - } -} - -void pic16c5xSetReadPortHandler(UINT8 (*pReadPort)(UINT16 port)) -{ - pPic16c5xReadPort = pReadPort; -} - -void pic16c5xSetWritePortHandler(void (*pWritePort)(UINT16 port, UINT8 data)) -{ - pPic16c5xWritePort = pWritePort; -} - -void pic16c5xReset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5xReset called without init\n")); -#endif - - pic16c5xDoReset(nPic16c5xCpuType, &rom_address_mask, &ram_address_mask); -} - -void pic16c5xInit(INT32 /*nCPU*/, INT32 type, UINT8 *mem) -{ - DebugCPU_PIC16C5XInitted = 1; - - nPic16c5xCpuType = type; - - pic16c5xDoReset(type, &rom_address_mask, &ram_address_mask); - - pic16c5x_rom = mem; - - pic16c5x_ram = (UINT8*)BurnMalloc(ram_address_mask + 1); -} - -void pic16c5xExit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5xExit called without init\n")); -#endif - - pic16c5x_rom = NULL; - nPic16c5xCpuType = -1; - - if (pic16c5x_ram) { - BurnFree(pic16c5x_ram); - pic16c5x_ram = NULL; - } - - pPic16c5xReadPort = NULL; - pPic16c5xWritePort = NULL; - - DebugCPU_PIC16C5XInitted = 0; -} - -void pic16c5xOpen(INT32) -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5xOpen called without init\n")); -#endif -} - -void pic16c5xClose() -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5xClose called without init\n")); -#endif -} - -INT32 pic16c5xScan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_PIC16C5XInitted) bprintf(PRINT_ERROR, _T("pic16c5xScan called without init\n")); -#endif - - struct BurnArea ba; - - pic16c5xScanCpu(nAction, 0); - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = pic16c5x_ram; - ba.nLen = ram_address_mask + 1; - ba.nAddress = 0; - ba.szName = "Internal RAM"; - BurnAcb(&ba); - } - - return 0; -} - - -static UINT8 asciitohex(UINT8 data) -{ - /* Convert ASCII data to HEX */ - - if ((data >= 0x30) && (data < 0x3a)) data -= 0x30; - data &= 0xdf; /* remove case sensitivity */ - if ((data >= 0x41) && (data < 0x5b)) data -= 0x37; - - return data; -} - -extern void pic16c5x_config(INT32 data); - -INT32 BurnLoadPicROM(UINT8 *src, INT32 offset, INT32 len) -{ - UINT8 *PICROM_HEX = (UINT8*)BurnMalloc(len); - UINT16 *PICROM = (UINT16*)src; - INT32 offs, data; - UINT16 src_pos = 0; - UINT16 dst_pos = 0; - UINT8 data_hi, data_lo; - - if (BurnLoadRom(PICROM_HEX, offset, 1)) return 1; - - // Convert the PIC16C57 ASCII HEX dump to pure HEX - do - { - if ((PICROM_HEX[src_pos + 0] == ':') && - (PICROM_HEX[src_pos + 1] == '1') && - (PICROM_HEX[src_pos + 2] == '0')) - { - src_pos += 9; - - for (offs = 0; offs < 32; offs += 4) - { - data_hi = asciitohex((PICROM_HEX[src_pos + offs + 0])); - data_lo = asciitohex((PICROM_HEX[src_pos + offs + 1])); - if ((data_hi <= 0x0f) && (data_lo <= 0x0f)) { - data = (data_hi << 4) | (data_lo << 0); - data_hi = asciitohex((PICROM_HEX[src_pos + offs + 2])); - data_lo = asciitohex((PICROM_HEX[src_pos + offs + 3])); - - if ((data_hi <= 0x0f) && (data_lo <= 0x0f)) { - data |= (data_hi << 12) | (data_lo << 8); - PICROM[dst_pos] = data; - dst_pos += 1; - } - } - } - src_pos += 32; - } - - /* Get the PIC16C57 Config register data */ - - if ((PICROM_HEX[src_pos + 0] == ':') && - (PICROM_HEX[src_pos + 1] == '0') && - (PICROM_HEX[src_pos + 2] == '2') && - (PICROM_HEX[src_pos + 3] == '1')) - { - src_pos += 9; - - data_hi = asciitohex((PICROM_HEX[src_pos + 0])); - data_lo = asciitohex((PICROM_HEX[src_pos + 1])); - data = (data_hi << 4) | (data_lo << 0); - data_hi = asciitohex((PICROM_HEX[src_pos + 2])); - data_lo = asciitohex((PICROM_HEX[src_pos + 3])); - data |= (data_hi << 12) | (data_lo << 8); - - pic16c5x_config(data); - src_pos = 0x7fff; /* Force Exit */ - } - src_pos += 1; - } while (src_pos < len); /* 0x2d4c is the size of the HEX rom loaded */ - - BurnFree (PICROM_HEX); - - return 0; -} - diff --git a/jan/src/cpu/pic16c5x_intf.h b/jan/src/cpu/pic16c5x_intf.h deleted file mode 100644 index 721734983..000000000 --- a/jan/src/cpu/pic16c5x_intf.h +++ /dev/null @@ -1,21 +0,0 @@ - -UINT16 pic16c5xFetch(UINT16 address); -UINT8 pic16c5xRead(UINT16 address); -void pic16c5xWrite(UINT16 address, UINT8 data); -UINT8 pic16c5xReadPort(UINT16 port); -void pic16c5xWritePort(UINT16 port, UINT8 data); - -void pic16c5xSetReadPortHandler(UINT8 (*pReadPort)(UINT16 port)); -void pic16c5xSetWritePortHandler(void (*pWritePort)(UINT16 port, UINT8 data)); - -INT32 pic16c5xRun(INT32 cycles); -void pic16c5xReset(); -void pic16c5xExit(); -void pic16c5xInit(INT32 nCpu, INT32 type, UINT8 *mem); -void pic16c5xOpen(INT32 nCpu); -void pic16c5xClose(); - -extern INT32 pic16c5xScan(INT32 nAction); -extern void pic16c5xRunEnd(); - -INT32 BurnLoadPicROM(UINT8 *src, INT32 offset, INT32 len); diff --git a/jan/src/cpu/s2650/s2650.cpp b/jan/src/cpu/s2650/s2650.cpp deleted file mode 100644 index b53263446..000000000 --- a/jan/src/cpu/s2650/s2650.cpp +++ /dev/null @@ -1,1515 +0,0 @@ -/************************************************************************* - * - * Portable Signetics 2650 cpu emulation - * - * Written by Juergen Buchmueller for use with MAME - * - * Version 1.2 - * - changed to clock cycle counts from machine cycles - * - replaced cycle table with S2650_INLINE code (M_RET conditional case) - * - removed wrong distinct add/sub CC and OVF handling - * - cosmetics, readability - * - *************************************************************************/ - -#include "s2650.h" -#include "burnint.h" -#include "s2650_intf.h" - -#define CLEAR_LINE 0 -#define change_pc(x) \ - S.page = x & PAGE; \ - S.iar = x & PMSK; \ - -/* define this to have some interrupt information logged */ -#define VERBOSE 0 - -/* define this to expand all EA calculations S2650_INLINE */ -#define INLINE_EA 1 - -#define S2650_INLINE static inline - -static int s2650_ICount = 0; -enum -{ - S2650_PC=1, S2650_PS, S2650_R0, S2650_R1, S2650_R2, S2650_R3, - S2650_R1A, S2650_R2A, S2650_R3A, - S2650_HALT, S2650_SI, S2650_FO -}; - -typedef struct { - UINT16 ppc; /* previous program counter (page + iar) */ - UINT16 page; /* 8K page select register (A14..A13) */ - UINT16 iar; /* instruction address register (A12..A0) */ - UINT16 ea; /* effective address (A14..A0) */ - UINT8 psl; /* processor status lower */ - UINT8 psu; /* processor status upper */ - UINT8 r; /* absolute addressing dst/src register */ - UINT8 reg[7]; /* 7 general purpose registers */ - UINT8 halt; /* 1 if cpu is halted */ - UINT8 ir; /* instruction register */ - UINT16 ras[8]; /* 8 return address stack entries */ - UINT8 irq_state; -} s2650_Regs; - -static s2650_Regs S; -static s2650_Regs Store[MAX_S2650]; -int nActiveS2650 = -1; - -/* condition code changes for a byte */ -static const UINT8 ccc[0x200] = { - 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x04,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84 -}; - -static void s2650_set_sense(int state); - -#define CHECK_IRQ_LINE \ - if (S.irq_state != CLEAR_LINE) \ - { \ - if( (S.psu & II) == 0 ) \ - { \ - int vector; \ - if (S.halt) \ - { \ - S.halt = 0; \ - S.iar = (S.iar + 1) & PMSK; \ - } \ - if (s2650_irqcallback[nActiveS2650]) { \ - vector = s2650_irqcallback[nActiveS2650](0) & 0xff; \ - } else { \ - vector = 0; \ - } \ - /* build effective address within first 8K page */ \ - S.ea = S2650_relative[vector] & PMSK; \ - if (vector & 0x80) /* indirect bit set ? */ \ - { \ - int addr = S.ea; \ - s2650_ICount -= 6; \ - /* build indirect 32K address */ \ - S.ea = RDMEM(addr) << 8; \ - if (!(++addr & PMSK)) addr -= PLEN; \ - S.ea = (S.ea + RDMEM(addr)) & AMSK; \ - } \ - S.psu = (S.psu & ~SP) | ((S.psu + 1) & SP) | II; \ - S.ras[S.psu & SP] = S.page + S.iar; \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - } \ - } - -/*************************************************************** - * - * set condition code (zero,plus,minus) from result - ***************************************************************/ -#define SET_CC(result) \ - S.psl = (S.psl & ~CC) | ccc[result] - -/*************************************************************** - * - * set condition code (zero,plus,minus) and overflow - ***************************************************************/ -#define SET_CC_OVF(result,value) \ - S.psl = (S.psl & ~(OVF+CC)) | \ - ccc[result + (((value) & 0x80) << 1)] - -#define SET_CC_OVF_ADD(result,value1,value2) SET_CC_OVF(result,~((value1) ^ (value2)) & ((value1) ^ (result))) -#define SET_CC_OVF_SUB(result,value1,value2) SET_CC_OVF(result,~((value1) ^ (value2)) & ((value1) ^ (result))) - -/*************************************************************** - * ROP - * read next opcode - ***************************************************************/ -S2650_INLINE UINT8 ROP(void) -{ - UINT8 result = s2650Fetch(S.page + S.iar); - S.iar = (S.iar + 1) & PMSK; - return result; -} - -/*************************************************************** - * ARG - * read next opcode argument - ***************************************************************/ -S2650_INLINE UINT8 ARG(void) -{ - UINT8 result = s2650Fetch(S.page + S.iar); - S.iar = (S.iar + 1) & PMSK; - return result; -} - -/*************************************************************** - * RDMEM - * read memory byte from addr - ***************************************************************/ -#define RDMEM(addr) s2650Read(addr) - -/*************************************************************** - * handy table to build PC relative offsets - * from HR (holding register) - ***************************************************************/ -static const int S2650_relative[0x100] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, - -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, - -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, - -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, - -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, - -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, - -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, -}; - -/*************************************************************** - * _REL_EA - * build effective address with relative addressing - ***************************************************************/ -#define _REL_EA(page) \ -{ \ - UINT8 hr = ARG(); /* get 'holding register' */ \ - /* build effective address within current 8K page */ \ - S.ea = page + ((S.iar + S2650_relative[hr]) & PMSK); \ - if (hr & 0x80) { /* indirect bit set ? */ \ - int addr = S.ea; \ - s2650_ICount -= 6; \ - /* build indirect 32K address */ \ - S.ea = RDMEM(addr) << 8; \ - if( (++addr & PMSK) == 0 ) addr -= PLEN; /* page wrap */\ - S.ea = (S.ea + RDMEM(addr)) & AMSK; \ - } \ -} - -/*************************************************************** - * _REL_ZERO - * build effective address with zero relative addressing - ***************************************************************/ -#define _REL_ZERO(page) \ -{ \ - UINT8 hr = ARG(); /* get 'holding register' */ \ - /* build effective address from 0 */ \ - S.ea = (S2650_relative[hr] & PMSK); \ - if (hr & 0x80) { /* indirect bit set ? */ \ - int addr = S.ea; \ - s2650_ICount -= 6; \ - /* build indirect 32K address */ \ - S.ea = RDMEM(addr) << 8; \ - if( (++addr & PMSK) == 0 ) addr -= PLEN; /* page wrap */\ - S.ea = (S.ea + RDMEM(addr)) & AMSK; \ - } \ -} - -/*************************************************************** - * _ABS_EA - * build effective address with absolute addressing - ***************************************************************/ -#define _ABS_EA() \ -{ \ - UINT8 hr, dr; \ - hr = ARG(); /* get 'holding register' */ \ - dr = ARG(); /* get 'data bus register' */ \ - /* build effective address within current 8K page */ \ - S.ea = S.page + (((hr << 8) + dr) & PMSK); \ - /* indirect addressing ? */ \ - if (hr & 0x80) { \ - int addr = S.ea; \ - s2650_ICount -= 6; \ - /* build indirect 32K address */ \ - /* build indirect 32K address */ \ - S.ea = RDMEM(addr) << 8; \ - if( (++addr & PMSK) == 0 ) addr -= PLEN; /* page wrap */\ - S.ea = (S.ea + RDMEM(addr)) & AMSK; \ - } \ - /* check indexed addressing modes */ \ - switch (hr & 0x60) { \ - case 0x00: /* not indexed */ \ - break; \ - case 0x20: /* auto increment indexed */ \ - S.reg[S.r] += 1; \ - S.ea = (S.ea & PAGE)+((S.ea+S.reg[S.r]) & PMSK); \ - S.r = 0; /* absolute addressing reg is R0 */ \ - break; \ - case 0x40: /* auto decrement indexed */ \ - S.reg[S.r] -= 1; \ - S.ea = (S.ea & PAGE)+((S.ea+S.reg[S.r]) & PMSK); \ - S.r = 0; /* absolute addressing reg is R0 */ \ - break; \ - case 0x60: /* indexed */ \ - S.ea = (S.ea & PAGE)+((S.ea+S.reg[S.r]) & PMSK); \ - S.r = 0; /* absolute addressing reg is R0 */ \ - break; \ - } \ -} - -/*************************************************************** - * _BRA_EA - * build effective address with absolute addressing (branch) - ***************************************************************/ -#define _BRA_EA() \ -{ \ - UINT8 hr, dr; \ - hr = ARG(); /* get 'holding register' */ \ - dr = ARG(); /* get 'data bus register' */ \ - /* build address in 32K address space */ \ - S.ea = ((hr << 8) + dr) & AMSK; \ - /* indirect addressing ? */ \ - if (hr & 0x80) { \ - int addr = S.ea; \ - s2650_ICount -= 6; \ - /* build indirect 32K address */ \ - S.ea = RDMEM(addr) << 8; \ - if( (++addr & PMSK) == 0 ) addr -= PLEN; /* page wrap */\ - S.ea = (S.ea + RDMEM(addr)) & AMSK; \ - } \ -} - -/*************************************************************** - * SWAP_REGS - * Swap registers r1-r3 with r4-r6 (the second set) - * This is done everytime the RS bit in PSL changes - ***************************************************************/ -#define SWAP_REGS \ -{ \ - UINT8 tmp; \ - tmp = S.reg[1]; \ - S.reg[1] = S.reg[4]; \ - S.reg[4] = tmp; \ - tmp = S.reg[2]; \ - S.reg[2] = S.reg[5]; \ - S.reg[5] = tmp; \ - tmp = S.reg[3]; \ - S.reg[3] = S.reg[6]; \ - S.reg[6] = tmp; \ -} - -/*************************************************************** - * M_BRR - * Branch relative if cond is true - ***************************************************************/ -#define M_BRR(cond) \ -{ \ - if (cond) \ - { \ - REL_EA( S.page ); \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ - } else S.iar = (S.iar + 1) & PMSK; \ -} - -/*************************************************************** - * M_ZBRR - * Branch relative to page zero - ***************************************************************/ -#define M_ZBRR() \ -{ \ - REL_ZERO( 0 ); \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ -} - -/*************************************************************** - * M_BRA - * Branch absolute if cond is true - ***************************************************************/ -#define M_BRA(cond) \ -{ \ - if( cond ) \ - { \ - BRA_EA(); \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ - } else S.iar = (S.iar + 2) & PMSK; \ -} - -/*************************************************************** - * M_BXA - * Branch indexed absolute (EA + R3) - ***************************************************************/ -#define M_BXA() \ -{ \ - BRA_EA(); \ - S.ea = (S.ea + S.reg[3]) & AMSK; \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ -} - -/*************************************************************** - * M_BSR - * Branch to subroutine relative if cond is true - ***************************************************************/ -#define M_BSR(cond) \ -{ \ - if( cond ) \ - { \ - REL_EA(S.page); \ - S.psu = (S.psu & ~SP) | ((S.psu + 1) & SP); \ - S.ras[S.psu & SP] = S.page + S.iar; \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ - } else S.iar = (S.iar + 1) & PMSK; \ -} - -/*************************************************************** - * M_ZBSR - * Branch to subroutine relative to page zero - ***************************************************************/ -#define M_ZBSR() \ -{ \ - REL_ZERO(0); \ - S.psu = (S.psu & ~SP) | ((S.psu + 1) & SP); \ - S.ras[S.psu & SP] = S.page + S.iar; \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ -} - -/*************************************************************** - * M_BSA - * Branch to subroutine absolute - ***************************************************************/ -#define M_BSA(cond) \ -{ \ - if( cond ) \ - { \ - BRA_EA(); \ - S.psu = (S.psu & ~SP) | ((S.psu + 1) & SP); \ - S.ras[S.psu & SP] = S.page + S.iar; \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ - } else S.iar = (S.iar + 2) & PMSK; \ -} - -/*************************************************************** - * M_BSXA - * Branch to subroutine indexed absolute (EA + R3) - ***************************************************************/ -#define M_BSXA() \ -{ \ - BRA_EA(); \ - S.ea = (S.ea + S.reg[3]) & AMSK; \ - S.psu = (S.psu & ~SP) | ((S.psu + 1) & SP); \ - S.ras[S.psu & SP] = S.page + S.iar; \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ -} - -/*************************************************************** - * M_RET - * Return from subroutine if cond is true - ***************************************************************/ -#define M_RET(cond) \ -{ \ - if( cond ) \ - { \ - s2650_ICount -= 6; \ - S.ea = S.ras[S.psu & SP]; \ - S.psu = (S.psu & ~SP) | ((S.psu - 1) & SP); \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ - } \ -} - -/*************************************************************** - * M_RETE - * Return from subroutine if cond is true - * and enable interrupts; afterwards check IRQ line - * state and eventually take next interrupt - ***************************************************************/ -#define M_RETE(cond) \ -{ \ - if( cond ) \ - { \ - S.ea = S.ras[S.psu & SP]; \ - S.psu = (S.psu & ~SP) | ((S.psu - 1) & SP); \ - S.page = S.ea & PAGE; \ - S.iar = S.ea & PMSK; \ - change_pc(S.ea); \ - S.psu &= ~II; \ - CHECK_IRQ_LINE; \ - } \ -} - -/*************************************************************** - * M_LOD - * Load destination with source register - ***************************************************************/ -#define M_LOD(dest,source) \ -{ \ - dest = source; \ - SET_CC(dest); \ -} - -/*************************************************************** - * M_STR - * Store source register to memory addr (CC unchanged) - ***************************************************************/ -#define M_STR(address,source) \ - s2650Write(address, source) - -/*************************************************************** - * M_AND - * Logical and destination with source - ***************************************************************/ -#define M_AND(dest,source) \ -{ \ - dest &= source; \ - SET_CC(dest); \ -} - -/*************************************************************** - * M_IOR - * Logical inclusive or destination with source - ***************************************************************/ -#define M_IOR(dest,source) \ -{ \ - dest |= source; \ - SET_CC(dest); \ -} - -/*************************************************************** - * M_EOR - * Logical exclusive or destination with source - ***************************************************************/ -#define M_EOR(dest,source) \ -{ \ - dest ^= source; \ - SET_CC(dest); \ -} - -/*************************************************************** - * M_ADD - * Add source to destination - * Add with carry if WC flag of PSL is set - ***************************************************************/ -#define M_ADD(dest,_source) \ -{ \ - UINT8 source = _source; \ - UINT8 before = dest; \ - /* add source; carry only if WC is set */ \ - UINT16 res = dest + source + ((S.psl >> 3) & S.psl & C); \ - S.psl &= ~(C | OVF | IDC); \ - if(res & 0x100) S.psl |= C; \ - dest = res & 0xff; \ - if( (dest & 15) < (before & 15) ) S.psl |= IDC; \ - SET_CC_OVF_ADD(dest,before,source); \ -} - -/*************************************************************** - * M_SUB - * Subtract source from destination - * Subtract with borrow if WC flag of PSL is set - ***************************************************************/ -#define M_SUB(dest,_source) \ -{ \ - UINT8 source = _source; \ - UINT8 before = dest; \ - /* subtract source; borrow only if WC is set */ \ - UINT16 res = dest - source - ((S.psl >> 3) & (S.psl ^ C) & C); \ - S.psl &= ~(C | OVF | IDC); \ - if((res & 0x100)==0) S.psl |= C; \ - dest = res & 0xff; \ - if( (dest & 15) <= (before & 15) ) S.psl |= IDC; \ - SET_CC_OVF_SUB(dest,before,source); \ -} - -/*************************************************************** - * M_COM - * Compare register against value. If COM of PSL is set, - * use unsigned, else signed comparison - ***************************************************************/ -#define M_COM(reg,val) \ -{ \ - int d; \ - S.psl &= ~CC; \ - if (S.psl & COM) d = (UINT8)reg - (UINT8)val; \ - else d = (INT8)reg - (INT8)val; \ - if( d < 0 ) S.psl |= 0x80; \ - else \ - if( d > 0 ) S.psl |= 0x40; \ -} - -/*************************************************************** - * M_DAR - * Decimal adjust register - ***************************************************************/ -#define M_DAR(dest) \ -{ \ - if ((S.psl & C) == 0) dest += 0xA0; \ - if ((S.psl & IDC) == 0) dest = (dest & 0xF0) | ((dest + 0x0A) & 0x0F);\ -} - -/*************************************************************** - * M_RRL - * Rotate register left; If WC of PSL is set, rotate - * through carry, else rotate circular - ***************************************************************/ -#define M_RRL(dest) \ -{ \ - UINT8 before = dest; \ - if( S.psl & WC ) \ - { \ - UINT8 c = S.psl & C; \ - S.psl &= ~(C + IDC); \ - dest = (before << 1) | c; \ - S.psl |= (before >> 7) + (dest & IDC); \ - } \ - else \ - { \ - dest = (before << 1) | (before >> 7); \ - } \ - SET_CC(dest); \ - S.psl = (S.psl & ~OVF) | (((dest ^ before) >> 5) & OVF); \ -} - -/*************************************************************** - * M_RRR - * Rotate register right; If WC of PSL is set, rotate - * through carry, else rotate circular - ***************************************************************/ -#define M_RRR(dest) \ -{ \ - UINT8 before = dest; \ - if (S.psl & WC) \ - { \ - UINT8 c = S.psl & C; \ - S.psl &= ~(C + IDC); \ - dest = (before >> 1) | (c << 7); \ - S.psl |= (before & C) + (dest & IDC); \ - } else dest = (before >> 1) | (before << 7); \ - SET_CC(dest); \ - S.psl = (S.psl & ~OVF) | (((dest ^ before) >> 5) & OVF); \ -} - -// bxd() not necessary - -/*************************************************************** - * M_SPSU - * Store processor status upper (PSU) to register R0 - * Checks for External Sense IO port - ***************************************************************/ -#define M_SPSU() \ -{ \ - R0 = ((S.psu & ~PSU34) | (s2650ReadPort(S2650_SENSE_PORT) & SI)); \ - SET_CC(R0); \ -} - -/*************************************************************** - * M_SPSL - * Store processor status lower (PSL) to register R0 - ***************************************************************/ -#define M_SPSL() \ -{ \ - R0 = S.psl; \ - SET_CC(R0); \ -} - -/*************************************************************** - * M_CPSU - * Clear processor status upper (PSU), selective - ***************************************************************/ -#define M_CPSU() \ -{ \ - UINT8 cpsu = ARG(); \ - S.psu = S.psu & ~cpsu; \ - CHECK_IRQ_LINE; \ -} - -/*************************************************************** - * M_CPSL - * Clear processor status lower (PSL), selective - ***************************************************************/ -#define M_CPSL() \ -{ \ - UINT8 cpsl = ARG(); \ - /* select other register set now ? */ \ - if( (cpsl & RS) && (S.psl & RS) ) \ - SWAP_REGS; \ - S.psl = S.psl & ~cpsl; \ - CHECK_IRQ_LINE; \ -} - -/*************************************************************** - * M_PPSU - * Preset processor status upper (PSU), selective - * Unused bits 3 and 4 can't be set - ***************************************************************/ -#define M_PPSU() \ -{ \ - UINT8 ppsu = (ARG() & ~PSU34) & ~SI; \ - S.psu = S.psu | ppsu; \ -} - -/*************************************************************** - * M_PPSL - * Preset processor status lower (PSL), selective - ***************************************************************/ -#define M_PPSL() \ -{ \ - UINT8 ppsl = ARG(); \ - /* select 2nd register set now ? */ \ - if ((ppsl & RS) && !(S.psl & RS)) \ - SWAP_REGS; \ - S.psl = S.psl | ppsl; \ -} - -/*************************************************************** - * M_TPSU - * Test processor status upper (PSU) - ***************************************************************/ -#define M_TPSU() \ -{ \ - UINT8 tpsu = ARG(); \ - UINT8 rpsu = (S.psu | (s2650ReadPort(S2650_SENSE_PORT) & SI)); \ - S.psl &= ~CC; \ - if( (rpsu & tpsu) != tpsu ) \ - S.psl |= 0x80; \ -} - -/*************************************************************** - * M_TPSL - * Test processor status lower (PSL) - ***************************************************************/ -#define M_TPSL() \ -{ \ - UINT8 tpsl = ARG(); \ - if( (S.psl & tpsl) != tpsl ) \ - S.psl = (S.psl & ~CC) | 0x80; \ - else \ - S.psl &= ~CC; \ -} - -/*************************************************************** - * M_TMI - * Test under mask immediate - ***************************************************************/ -#define M_TMI(value) \ -{ \ - UINT8 tmi = ARG(); \ - S.psl &= ~CC; \ - if( (value & tmi) != tmi ) \ - S.psl |= 0x80; \ -} - -#if INLINE_EA -#define REL_EA(page) _REL_EA(page) -#define REL_ZERO(page) _REL_ZERO(page) -#define ABS_EA() _ABS_EA() -#define BRA_EA() _BRA_EA() -#else -static void REL_EA(unsigned short page) _REL_EA(page) -static void REL_ZERO(unsigned short page) _REL_ZERO(page) -static void ABS_EA(void) _ABS_EA() -static void BRA_EA(void) _BRA_EA() -#endif - -void s2650_reset(void) -{ - memset(&S, 0, sizeof(S)); - S.psl = COM | WC; - S.psu = 0; -} -/* -static void s2650_get_context(void *dst) -{ - if( dst ) - *(s2650_Regs*)dst = S; -} - -static void s2650_set_context(void *src) -{ - if( src ) - { - S = *(s2650_Regs*)src; - S.page = S.page & PAGE; - S.iar = S.iar & PMSK; - change_pc(S.page + S.iar); - } -} -*/ -void s2650SetIRQLine(int irqline, int state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650SetIRQLine called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650SetIRQLine called when no CPU open\n")); -#endif - - if (irqline == 1) - { - if (state == CLEAR_LINE) - s2650_set_sense(0); - else - s2650_set_sense(1); - return; - } - - S.irq_state = state; - CHECK_IRQ_LINE; -} -/* -static void s2650_set_flag(int state) -{ - if (state) - S.psu |= FO; - else - S.psu &= ~FO; -} - -static int s2650_get_flag(void) -{ - return (S.psu & FO) ? 1 : 0; -} -*/ -static void s2650_set_sense(int state) -{ - if (state) - S.psu |= SI; - else - S.psu &= ~SI; -} -/* -static int s2650_get_sense(void) -{ - return (((S.psu & SI) ? 1 : 0) | ((s2650ReadPort(S2650_SENSE_PORT) & SI) ? 1 : 0)); -}*/ - -int s2650Run(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650Run called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650Run called when no CPU open\n")); -#endif - - s2650_ICount = cycles; - do - { - S.ppc = S.page + S.iar; - - S.ir = ROP(); - S.r = S.ir & 3; /* register / value */ - switch (S.ir) { - case 0x00: /* LODZ,0 */ - case 0x01: /* LODZ,1 */ - case 0x02: /* LODZ,2 */ - case 0x03: /* LODZ,3 */ - s2650_ICount -= 6; - M_LOD( R0, S.reg[S.r] ); - break; - - case 0x04: /* LODI,0 v */ - case 0x05: /* LODI,1 v */ - case 0x06: /* LODI,2 v */ - case 0x07: /* LODI,3 v */ - s2650_ICount -= 6; - M_LOD( S.reg[S.r], ARG() ); - break; - - case 0x08: /* LODR,0 (*)a */ - case 0x09: /* LODR,1 (*)a */ - case 0x0a: /* LODR,2 (*)a */ - case 0x0b: /* LODR,3 (*)a */ - s2650_ICount -= 9; - REL_EA( S.page ); - M_LOD( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0x0c: /* LODA,0 (*)a(,X) */ - case 0x0d: /* LODA,1 (*)a(,X) */ - case 0x0e: /* LODA,2 (*)a(,X) */ - case 0x0f: /* LODA,3 (*)a(,X) */ - s2650_ICount -= 12; - ABS_EA(); - M_LOD( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0x10: /* illegal */ - case 0x11: /* illegal */ - s2650_ICount -= 7; - break; - case 0x12: /* SPSU */ - s2650_ICount -= 6; - M_SPSU(); - break; - case 0x13: /* SPSL */ - s2650_ICount -= 6; - M_SPSL(); - break; - - case 0x14: /* RETC,0 (zero) */ - case 0x15: /* RETC,1 (plus) */ - case 0x16: /* RETC,2 (minus) */ - s2650_ICount -= 9; /* +2 cycles if condition is true */ - M_RET( (S.psl >> 6) == S.r ); - break; - case 0x17: /* RETC,3 (always) */ - s2650_ICount -= 9; /* +2 cycles if condition is true */ - M_RET( 1 ); - break; - - case 0x18: /* BCTR,0 (*)a */ - case 0x19: /* BCTR,1 (*)a */ - case 0x1a: /* BCTR,2 (*)a */ - s2650_ICount -= 9; - M_BRR( (S.psl >> 6) == S.r ); - break; - case 0x1b: /* BCTR,3 (*)a */ - s2650_ICount -= 9; - M_BRR( 1 ); - break; - - case 0x1c: /* BCTA,0 (*)a */ - case 0x1d: /* BCTA,1 (*)a */ - case 0x1e: /* BCTA,2 (*)a */ - s2650_ICount -= 9; - M_BRA( (S.psl >> 6) == S.r ); - break; - case 0x1f: /* BCTA,3 (*)a */ - s2650_ICount -= 9; - M_BRA( 1 ); - break; - - case 0x20: /* EORZ,0 */ - case 0x21: /* EORZ,1 */ - case 0x22: /* EORZ,2 */ - case 0x23: /* EORZ,3 */ - s2650_ICount -= 6; - M_EOR( R0, S.reg[S.r] ); - break; - - case 0x24: /* EORI,0 v */ - case 0x25: /* EORI,1 v */ - case 0x26: /* EORI,2 v */ - case 0x27: /* EORI,3 v */ - s2650_ICount -= 6; - M_EOR( S.reg[S.r], ARG() ); - break; - - case 0x28: /* EORR,0 (*)a */ - case 0x29: /* EORR,1 (*)a */ - case 0x2a: /* EORR,2 (*)a */ - case 0x2b: /* EORR,3 (*)a */ - s2650_ICount -= 9; - REL_EA( S.page ); - M_EOR( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0x2c: /* EORA,0 (*)a(,X) */ - case 0x2d: /* EORA,1 (*)a(,X) */ - case 0x2e: /* EORA,2 (*)a(,X) */ - case 0x2f: /* EORA,3 (*)a(,X) */ - s2650_ICount -= 12; - ABS_EA(); - M_EOR( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0x30: /* REDC,0 */ - case 0x31: /* REDC,1 */ - case 0x32: /* REDC,2 */ - case 0x33: /* REDC,3 */ - s2650_ICount -= 6; - S.reg[S.r] = s2650ReadPort(S2650_CTRL_PORT); - SET_CC( S.reg[S.r] ); - break; - - case 0x34: /* RETE,0 */ - case 0x35: /* RETE,1 */ - case 0x36: /* RETE,2 */ - s2650_ICount -= 9; - M_RETE( (S.psl >> 6) == S.r ); - break; - case 0x37: /* RETE,3 */ - s2650_ICount -= 9; - M_RETE( 1 ); - break; - - case 0x38: /* BSTR,0 (*)a */ - case 0x39: /* BSTR,1 (*)a */ - case 0x3a: /* BSTR,2 (*)a */ - s2650_ICount -= 9; - M_BSR( (S.psl >> 6) == S.r ); - break; - case 0x3b: /* BSTR,R3 (*)a */ - s2650_ICount -= 9; - M_BSR( 1 ); - break; - - case 0x3c: /* BSTA,0 (*)a */ - case 0x3d: /* BSTA,1 (*)a */ - case 0x3e: /* BSTA,2 (*)a */ - s2650_ICount -= 9; - M_BSA( (S.psl >> 6) == S.r ); - break; - case 0x3f: /* BSTA,3 (*)a */ - s2650_ICount -= 9; - M_BSA( 1 ); - break; - - case 0x40: /* HALT */ - s2650_ICount -= 6; - S.iar = (S.iar - 1) & PMSK; - S.halt = 1; - if (s2650_ICount > 0) - s2650_ICount = 0; - break; - case 0x41: /* ANDZ,1 */ - case 0x42: /* ANDZ,2 */ - case 0x43: /* ANDZ,3 */ - s2650_ICount -= 6; - M_AND( R0, S.reg[S.r] ); - break; - - case 0x44: /* ANDI,0 v */ - case 0x45: /* ANDI,1 v */ - case 0x46: /* ANDI,2 v */ - case 0x47: /* ANDI,3 v */ - s2650_ICount -= 6; - M_AND( S.reg[S.r], ARG() ); - break; - - case 0x48: /* ANDR,0 (*)a */ - case 0x49: /* ANDR,1 (*)a */ - case 0x4a: /* ANDR,2 (*)a */ - case 0x4b: /* ANDR,3 (*)a */ - s2650_ICount -= 9; - REL_EA( S.page ); - M_AND( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0x4c: /* ANDA,0 (*)a(,X) */ - case 0x4d: /* ANDA,1 (*)a(,X) */ - case 0x4e: /* ANDA,2 (*)a(,X) */ - case 0x4f: /* ANDA,3 (*)a(,X) */ - s2650_ICount -= 12; - ABS_EA(); - M_AND( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0x50: /* RRR,0 */ - case 0x51: /* RRR,1 */ - case 0x52: /* RRR,2 */ - case 0x53: /* RRR,3 */ - s2650_ICount -= 6; - M_RRR( S.reg[S.r] ); - break; - - case 0x54: /* REDE,0 v */ - case 0x55: /* REDE,1 v */ - case 0x56: /* REDE,2 v */ - case 0x57: /* REDE,3 v */ - s2650_ICount -= 9; - S.reg[S.r] = s2650ReadPort( ARG() ); - SET_CC(S.reg[S.r]); - break; - - case 0x58: /* BRNR,0 (*)a */ - case 0x59: /* BRNR,1 (*)a */ - case 0x5a: /* BRNR,2 (*)a */ - case 0x5b: /* BRNR,3 (*)a */ - s2650_ICount -= 9; - M_BRR( S.reg[S.r] ); - break; - - case 0x5c: /* BRNA,0 (*)a */ - case 0x5d: /* BRNA,1 (*)a */ - case 0x5e: /* BRNA,2 (*)a */ - case 0x5f: /* BRNA,3 (*)a */ - s2650_ICount -= 9; - M_BRA( S.reg[S.r] ); - break; - - case 0x60: /* IORZ,0 */ - case 0x61: /* IORZ,1 */ - case 0x62: /* IORZ,2 */ - case 0x63: /* IORZ,3 */ - s2650_ICount -= 6; - M_IOR( R0, S.reg[S.r] ); - break; - - case 0x64: /* IORI,0 v */ - case 0x65: /* IORI,1 v */ - case 0x66: /* IORI,2 v */ - case 0x67: /* IORI,3 v */ - s2650_ICount -= 6; - M_IOR( S.reg[S.r], ARG() ); - break; - - case 0x68: /* IORR,0 (*)a */ - case 0x69: /* IORR,1 (*)a */ - case 0x6a: /* IORR,2 (*)a */ - case 0x6b: /* IORR,3 (*)a */ - s2650_ICount -= 9; - REL_EA( S.page ); - M_IOR( S.reg[S. r],RDMEM(S.ea) ); - break; - - case 0x6c: /* IORA,0 (*)a(,X) */ - case 0x6d: /* IORA,1 (*)a(,X) */ - case 0x6e: /* IORA,2 (*)a(,X) */ - case 0x6f: /* IORA,3 (*)a(,X) */ - s2650_ICount -= 12; - ABS_EA(); - M_IOR( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0x70: /* REDD,0 */ - case 0x71: /* REDD,1 */ - case 0x72: /* REDD,2 */ - case 0x73: /* REDD,3 */ - s2650_ICount -= 6; - S.reg[S.r] = s2650ReadPort(S2650_DATA_PORT); - SET_CC(S.reg[S.r]); - break; - - case 0x74: /* CPSU */ - s2650_ICount -= 9; - M_CPSU(); - break; - case 0x75: /* CPSL */ - s2650_ICount -= 9; - M_CPSL(); - break; - case 0x76: /* PPSU */ - s2650_ICount -= 9; - M_PPSU(); - break; - case 0x77: /* PPSL */ - s2650_ICount -= 9; - M_PPSL(); - break; - - case 0x78: /* BSNR,0 (*)a */ - case 0x79: /* BSNR,1 (*)a */ - case 0x7a: /* BSNR,2 (*)a */ - case 0x7b: /* BSNR,3 (*)a */ - s2650_ICount -= 9; - M_BSR( S.reg[S.r] ); - break; - - case 0x7c: /* BSNA,0 (*)a */ - case 0x7d: /* BSNA,1 (*)a */ - case 0x7e: /* BSNA,2 (*)a */ - case 0x7f: /* BSNA,3 (*)a */ - s2650_ICount -= 9; - M_BSA( S.reg[S.r] ); - break; - - case 0x80: /* ADDZ,0 */ - case 0x81: /* ADDZ,1 */ - case 0x82: /* ADDZ,2 */ - case 0x83: /* ADDZ,3 */ - s2650_ICount -= 6; - M_ADD( R0,S.reg[S.r] ); - break; - - case 0x84: /* ADDI,0 v */ - case 0x85: /* ADDI,1 v */ - case 0x86: /* ADDI,2 v */ - case 0x87: /* ADDI,3 v */ - s2650_ICount -= 6; - M_ADD( S.reg[S.r], ARG() ); - break; - - case 0x88: /* ADDR,0 (*)a */ - case 0x89: /* ADDR,1 (*)a */ - case 0x8a: /* ADDR,2 (*)a */ - case 0x8b: /* ADDR,3 (*)a */ - s2650_ICount -= 9; - REL_EA(S.page); - M_ADD( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0x8c: /* ADDA,0 (*)a(,X) */ - case 0x8d: /* ADDA,1 (*)a(,X) */ - case 0x8e: /* ADDA,2 (*)a(,X) */ - case 0x8f: /* ADDA,3 (*)a(,X) */ - s2650_ICount -= 12; - ABS_EA(); - M_ADD( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0x90: /* illegal */ - case 0x91: /* illegal */ - s2650_ICount -= 7; - break; - case 0x92: /* LPSU */ - s2650_ICount -= 6; - S.psu = (R0 & ~PSU34) & ~SI; - break; - case 0x93: /* LPSL */ - s2650_ICount -= 6; - /* change register set ? */ - if ((S.psl ^ R0) & RS) - SWAP_REGS; - S.psl = R0; - break; - - case 0x94: /* DAR,0 */ - case 0x95: /* DAR,1 */ - case 0x96: /* DAR,2 */ - case 0x97: /* DAR,3 */ - s2650_ICount -= 9; - M_DAR( S.reg[S.r] ); - break; - - case 0x98: /* BCFR,0 (*)a */ - case 0x99: /* BCFR,1 (*)a */ - case 0x9a: /* BCFR,2 (*)a */ - s2650_ICount -= 9; - M_BRR( (S.psl >> 6) != S.r ); - break; - case 0x9b: /* ZBRR (*)a */ - s2650_ICount -= 9; - M_ZBRR(); - break; - - case 0x9c: /* BCFA,0 (*)a */ - case 0x9d: /* BCFA,1 (*)a */ - case 0x9e: /* BCFA,2 (*)a */ - s2650_ICount -= 9; - M_BRA( (S.psl >> 6) != S.r ); - break; - case 0x9f: /* BXA (*)a */ - s2650_ICount -= 9; - M_BXA(); - break; - - case 0xa0: /* SUBZ,0 */ - case 0xa1: /* SUBZ,1 */ - case 0xa2: /* SUBZ,2 */ - case 0xa3: /* SUBZ,3 */ - s2650_ICount -= 6; - M_SUB( R0, S.reg[S.r] ); - break; - - case 0xa4: /* SUBI,0 v */ - case 0xa5: /* SUBI,1 v */ - case 0xa6: /* SUBI,2 v */ - case 0xa7: /* SUBI,3 v */ - s2650_ICount -= 6; - M_SUB( S.reg[S.r], ARG() ); - break; - - case 0xa8: /* SUBR,0 (*)a */ - case 0xa9: /* SUBR,1 (*)a */ - case 0xaa: /* SUBR,2 (*)a */ - case 0xab: /* SUBR,3 (*)a */ - s2650_ICount -= 9; - REL_EA(S.page); - M_SUB( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0xac: /* SUBA,0 (*)a(,X) */ - case 0xad: /* SUBA,1 (*)a(,X) */ - case 0xae: /* SUBA,2 (*)a(,X) */ - case 0xaf: /* SUBA,3 (*)a(,X) */ - s2650_ICount -= 12; - ABS_EA(); - M_SUB( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0xb0: /* WRTC,0 */ - case 0xb1: /* WRTC,1 */ - case 0xb2: /* WRTC,2 */ - case 0xb3: /* WRTC,3 */ - s2650_ICount -= 6; - s2650WritePort(S2650_CTRL_PORT,S.reg[S.r]); - break; - - case 0xb4: /* TPSU */ - s2650_ICount -= 9; - M_TPSU(); - break; - case 0xb5: /* TPSL */ - s2650_ICount -= 9; - M_TPSL(); - break; - case 0xb6: /* illegal */ - case 0xb7: /* illegal */ - s2650_ICount -= 7; - break; - - case 0xb8: /* BSFR,0 (*)a */ - case 0xb9: /* BSFR,1 (*)a */ - case 0xba: /* BSFR,2 (*)a */ - s2650_ICount -= 9; - M_BSR( (S.psl >> 6) != S.r ); - break; - case 0xbb: /* ZBSR (*)a */ - s2650_ICount -= 9; - M_ZBSR(); - break; - - case 0xbc: /* BSFA,0 (*)a */ - case 0xbd: /* BSFA,1 (*)a */ - case 0xbe: /* BSFA,2 (*)a */ - s2650_ICount -= 9; - M_BSA( (S.psl >> 6) != S.r ); - break; - case 0xbf: /* BSXA (*)a */ - s2650_ICount -= 9; - M_BSXA(); - break; - - case 0xc0: /* NOP */ - s2650_ICount -= 6; - break; - case 0xc1: /* STRZ,1 */ - case 0xc2: /* STRZ,2 */ - case 0xc3: /* STRZ,3 */ - s2650_ICount -= 6; - M_LOD( S.reg[S.r], R0 ); - break; - - case 0xc4: /* illegal */ - case 0xc5: /* illegal */ - case 0xc6: /* illegal */ - case 0xc7: /* illegal */ - s2650_ICount -= 7; - break; - - case 0xc8: /* STRR,0 (*)a */ - case 0xc9: /* STRR,1 (*)a */ - case 0xca: /* STRR,2 (*)a */ - case 0xcb: /* STRR,3 (*)a */ - s2650_ICount -= 9; - REL_EA(S.page); - M_STR( S.ea, S.reg[S.r] ); - break; - - case 0xcc: /* STRA,0 (*)a(,X) */ - case 0xcd: /* STRA,1 (*)a(,X) */ - case 0xce: /* STRA,2 (*)a(,X) */ - case 0xcf: /* STRA,3 (*)a(,X) */ - s2650_ICount -= 12; - ABS_EA(); - M_STR( S.ea, S.reg[S.r] ); - break; - - case 0xd0: /* RRL,0 */ - case 0xd1: /* RRL,1 */ - case 0xd2: /* RRL,2 */ - case 0xd3: /* RRL,3 */ - s2650_ICount -= 6; - M_RRL( S.reg[S.r] ); - break; - - case 0xd4: /* WRTE,0 v */ - case 0xd5: /* WRTE,1 v */ - case 0xd6: /* WRTE,2 v */ - case 0xd7: /* WRTE,3 v */ - s2650_ICount -= 9; - s2650WritePort( ARG(), S.reg[S.r] ); - break; - - case 0xd8: /* BIRR,0 (*)a */ - case 0xd9: /* BIRR,1 (*)a */ - case 0xda: /* BIRR,2 (*)a */ - case 0xdb: /* BIRR,3 (*)a */ - s2650_ICount -= 9; - M_BRR( ++S.reg[S.r] ); - break; - - case 0xdc: /* BIRA,0 (*)a */ - case 0xdd: /* BIRA,1 (*)a */ - case 0xde: /* BIRA,2 (*)a */ - case 0xdf: /* BIRA,3 (*)a */ - s2650_ICount -= 9; - M_BRA( ++S.reg[S.r] ); - break; - - case 0xe0: /* COMZ,0 */ - case 0xe1: /* COMZ,1 */ - case 0xe2: /* COMZ,2 */ - case 0xe3: /* COMZ,3 */ - s2650_ICount -= 6; - M_COM( R0, S.reg[S.r] ); - break; - - case 0xe4: /* COMI,0 v */ - case 0xe5: /* COMI,1 v */ - case 0xe6: /* COMI,2 v */ - case 0xe7: /* COMI,3 v */ - s2650_ICount -= 6; - M_COM( S.reg[S.r], ARG() ); - break; - - case 0xe8: /* COMR,0 (*)a */ - case 0xe9: /* COMR,1 (*)a */ - case 0xea: /* COMR,2 (*)a */ - case 0xeb: /* COMR,3 (*)a */ - s2650_ICount -= 9; - REL_EA(S.page); - M_COM( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0xec: /* COMA,0 (*)a(,X) */ - case 0xed: /* COMA,1 (*)a(,X) */ - case 0xee: /* COMA,2 (*)a(,X) */ - case 0xef: /* COMA,3 (*)a(,X) */ - s2650_ICount -= 12; - ABS_EA(); - M_COM( S.reg[S.r], RDMEM(S.ea) ); - break; - - case 0xf0: /* WRTD,0 */ - case 0xf1: /* WRTD,1 */ - case 0xf2: /* WRTD,2 */ - case 0xf3: /* WRTD,3 */ - s2650_ICount -= 6; - s2650WritePort(S2650_DATA_PORT, S.reg[S.r]); - break; - - case 0xf4: /* TMI,0 v */ - case 0xf5: /* TMI,1 v */ - case 0xf6: /* TMI,2 v */ - case 0xf7: /* TMI,3 v */ - s2650_ICount -= 9; - M_TMI( S.reg[S.r] ); - break; - - case 0xf8: /* BDRR,0 (*)a */ - case 0xf9: /* BDRR,1 (*)a */ - case 0xfa: /* BDRR,2 (*)a */ - case 0xfb: /* BDRR,3 (*)a */ - s2650_ICount -= 9; - M_BRR( --S.reg[S.r] ); - break; - - case 0xfc: /* BDRA,0 (*)a */ - case 0xfd: /* BDRA,1 (*)a */ - case 0xfe: /* BDRA,2 (*)a */ - case 0xff: /* BDRA,3 (*)a */ - s2650_ICount -= 9; - M_BRA( --S.reg[S.r] ); - break; - } - } while( s2650_ICount > 0 ); - - return cycles - s2650_ICount; -} - -int s2650Scan(int nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650Scan called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650Scan called when no CPU open\n")); -#endif - - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) { - memset(&ba, 0, sizeof(ba)); - - ba.Data = &Store; - ba.nLen = sizeof(S) * MAX_S2650; - ba.szName = "All Ram"; - BurnAcb(&ba); - } - - return 0; -} - -void s2650_open(int num) -{ - nActiveS2650 = num; - memcpy (&S, &Store[nActiveS2650], sizeof (S)); -} - -void s2650_close() -{ - memcpy (&Store[nActiveS2650], &S, sizeof (S)); - nActiveS2650 = -1; -} - -void s2650_init(int num) -{ - memset (&S, 0, sizeof(S)); - memset (&Store, 0, sizeof(S) * num); -} - -void s2650_exit() -{ - memset (&S, 0, sizeof(S)); - memset (&Store, 0, sizeof(S) * MAX_S2650); -} - -int s2650_get_pc() -{ - return S.page + S.iar; -} diff --git a/jan/src/cpu/s2650/s2650.h b/jan/src/cpu/s2650/s2650.h deleted file mode 100644 index edd2c5f92..000000000 --- a/jan/src/cpu/s2650/s2650.h +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************* - * - * Portable Signetics 2650 cpu emulation - * - * Written by Juergen Buchmueller for use with MAME - * - *******************************************************/ - -#define PMSK 0x1fff /* mask page offset */ -#define PLEN 0x2000 /* page length */ -#define PAGE 0x6000 /* mask page */ -#define AMSK 0x7fff /* mask address range */ - -/* processor status lower */ -#define C 0x01 /* carry flag */ -#define COM 0x02 /* compare: 0 binary, 1 2s complement */ -#define OVF 0x04 /* 2s complement overflow */ -#define WC 0x08 /* with carry: use carry in arithmetic / rotate ops */ -#define RS 0x10 /* register select 0: R0/R1/R2/R3 1: R0/R4/R5/R6 */ -#define IDC 0x20 /* inter digit carry: bit-3-to-bit-4 carry */ -#define CC 0xc0 /* condition code */ - -/* processor status upper */ -#define SP 0x07 /* stack pointer: indexing 8 15bit words */ -#define PSU34 0x18 /* unused bits */ -#define II 0x20 /* interrupt inhibit 0: allow, 1: inhibit */ -#define FO 0x40 /* flag output */ -#define SI 0x80 /* sense input */ - -#define R0 S.reg[0] -#define R1 S.reg[1] -#define R2 S.reg[2] -#define R3 S.reg[3] diff --git a/jan/src/cpu/s2650_intf.cpp b/jan/src/cpu/s2650_intf.cpp deleted file mode 100644 index 9211c9d8d..000000000 --- a/jan/src/cpu/s2650_intf.cpp +++ /dev/null @@ -1,310 +0,0 @@ -#include "burnint.h" -#include "s2650_intf.h" - -#define ADDRESS_MAX 0x8000 -#define ADDRESS_MASK 0x7fff -#define PAGE 0x0100 -#define PAGE_MASK 0x00ff - -#define READ 0 -#define WRITE 1 -#define FETCH 2 - -INT32 s2650Count; - -struct s2650_handler -{ - UINT8 (*s2650Read)(UINT16 address); - void (*s2650Write)(UINT16 address, UINT8 data); - - UINT8 (*s2650ReadPort)(UINT16 port); - void (*s2650WritePort)(UINT16 port, UINT8 data); - - UINT8 *mem[3][ADDRESS_MAX / PAGE]; -}; - -struct s2650_handler sHandler[MAX_S2650]; -struct s2650_handler *sPointer; - -s2650irqcallback s2650_irqcallback[MAX_S2650]; - -extern void s2650_open(INT32 num); -extern void s2650_close(); -extern void s2650_init(INT32 num); -extern void s2650_exit(); -extern void s2650_reset(void); -extern INT32 s2650_get_pc(); - -void s2650MapMemory(UINT8 *ptr, INT32 nStart, INT32 nEnd, INT32 nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650MapMemory called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650MapMemory called when no CPU open\n")); -#endif - - nStart &= ADDRESS_MASK; - nEnd &= ADDRESS_MASK; - - for (INT32 i = nStart / PAGE; i < (nEnd / PAGE) + 1; i++) - { - if (nType & (1 << READ)) sPointer->mem[ READ][i] = ptr + ((i * PAGE) - nStart); - if (nType & (1 << WRITE)) sPointer->mem[WRITE][i] = ptr + ((i * PAGE) - nStart); - if (nType & (1 << FETCH)) sPointer->mem[FETCH][i] = ptr + ((i * PAGE) - nStart); - } -} - -void s2650SetWriteHandler(void (*write)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650SetWriteHandler called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650SetWriteHandler called when no CPU open\n")); -#endif - - sPointer->s2650Write = write; -} - -void s2650SetReadHandler(UINT8 (*read)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650SetReadHandler called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650SetReadHandler called when no CPU open\n")); -#endif - - sPointer->s2650Read = read; -} - -void s2650SetOutHandler(void (*write)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650SetOutHandler called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650SetOutHandler called when no CPU open\n")); -#endif - - sPointer->s2650WritePort = write; -} - -void s2650SetInHandler(UINT8 (*read)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650SetInHandler called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650SetInHandler called when no CPU open\n")); -#endif - - sPointer->s2650ReadPort = read; -} - -void s2650Write(UINT16 address, UINT8 data) -{ - address &= ADDRESS_MASK; - - if (sPointer->mem[WRITE][address / PAGE] != NULL) { - sPointer->mem[WRITE][address / PAGE][address & PAGE_MASK] = data; - return; - } - - if (sPointer->s2650Write != NULL) { - sPointer->s2650Write(address, data); - return; - } - - return; -} - -UINT8 s2650Read(UINT16 address) -{ - address &= ADDRESS_MASK; - - if (sPointer->mem[READ][address / PAGE] != NULL) { - return sPointer->mem[READ][address / PAGE][address & PAGE_MASK]; - } - - if (sPointer->s2650Read != NULL) { - return sPointer->s2650Read(address); - } - - return 0; -} - -UINT8 s2650Fetch(UINT16 address) -{ - address &= ADDRESS_MASK; - - if (sPointer->mem[FETCH][address / PAGE] != NULL) { - return sPointer->mem[FETCH][address / PAGE][address & PAGE_MASK]; - } - - return s2650Read(address); -} - -void s2650WritePort(UINT16 port, UINT8 data) -{ - if (sPointer->s2650WritePort != NULL) { - sPointer->s2650WritePort(port, data); - return; - } - - return; -} - -UINT8 s2650ReadPort(UINT16 port) -{ - if (sPointer->s2650ReadPort != NULL) { - return sPointer->s2650ReadPort(port); - } - - return 0; -} - -static void s2650WriteROM(UINT32 address, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650WriteRom called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650WriteRom called when no CPU open\n")); -#endif - - address &= ADDRESS_MASK; - - if (sPointer->mem[READ][address / PAGE] != NULL) { - sPointer->mem[READ][address / PAGE][address & PAGE_MASK] = data; - } - - if (sPointer->mem[WRITE][address / PAGE] != NULL) { - sPointer->mem[WRITE][address / PAGE][address & PAGE_MASK] = data; - } - - if (sPointer->mem[FETCH][address / PAGE] != NULL) { - sPointer->mem[FETCH][address / PAGE][address & PAGE_MASK] = data; - } - - if (sPointer->s2650Write != NULL) { - sPointer->s2650Write(address, data); - return; - } - - return; -} - -void s2650SetIrqCallback(INT32 (*irqcallback)(INT32)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650SetIrqCallback called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650SetIrqCallback called when no CPU open\n")); -#endif - - s2650_irqcallback[nActiveS2650] = irqcallback; -} - -static UINT8 s2650ReadCheat(UINT32 a) -{ - return s2650Read(a); -} - -INT32 s2650TotalCycles() -{ - return 0; // unimplemented -} - -void s2650NewFrame() -{ - // unimplemented -} - -void s2650RunEnd() -{ - // unimplemented -} - -static cpu_core_config s2650CheatCpuConfig = -{ - s2650Open, - s2650Close, - s2650ReadCheat, - s2650WriteROM, - s2650GetActive, - s2650TotalCycles, - s2650NewFrame, - s2650Run, - s2650RunEnd, - s2650Reset, - ADDRESS_MAX, - 0 -}; - -void s2650Init(INT32 num) -{ - DebugCPU_S2650Initted = 1; - - s2650Count = num; - memset (&sHandler, 0, sizeof (s2650_handler) * (num % MAX_S2650)); - s2650_init(num); - - for (INT32 i = 0; i < num; i++) - CpuCheatRegister(i, &s2650CheatCpuConfig); -} - -void s2650Exit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650Exit called without init\n")); -#endif - - if (!DebugCPU_S2650Initted) return; - - memset (&sHandler, 0, sizeof (sHandler)); - s2650Count = 0; - s2650_exit(); - - DebugCPU_S2650Initted = 0; -} - -void s2650Open(INT32 num) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650Open called without init\n")); - if (num > s2650Count) bprintf(PRINT_ERROR, _T("s2650Open called with invalid index %x\n"), num); - if (nActiveS2650 != -1) bprintf(PRINT_ERROR, _T("s2650Open called when CPU already open with index %x\n"), num); -#endif - - sPointer = &sHandler[num % MAX_S2650]; - s2650_open(num); -} - -void s2650Close() -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650Close called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650Close called when no CPU open\n")); -#endif - - s2650_close(); -} - -UINT32 s2650GetPC(INT32) -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650GetPC called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650GetPC called when no CPU open\n")); -#endif - - return s2650_get_pc(); -} - -INT32 s2650GetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650GetActive called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650GetActive called when no CPU open\n")); -#endif - - return nActiveS2650; -} - -void s2650Reset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_S2650Initted) bprintf(PRINT_ERROR, _T("s2650Reset called without init\n")); - if (nActiveS2650 == -1) bprintf(PRINT_ERROR, _T("s2650Reset called when no CPU open\n")); -#endif - - s2650_reset(); -} diff --git a/jan/src/cpu/s2650_intf.h b/jan/src/cpu/s2650_intf.h deleted file mode 100644 index 8ca000b63..000000000 --- a/jan/src/cpu/s2650_intf.h +++ /dev/null @@ -1,40 +0,0 @@ -#define MAX_S2650 4 -extern INT32 nActiveS2650; -extern INT32 s2650Count; - -void s2650Write(UINT16 address, UINT8 data); -UINT8 s2650Read(UINT16 address); -UINT8 s2650Fetch(UINT16 address); -void s2650WritePort(UINT16 port, UINT8 data); -UINT8 s2650ReadPort(UINT16 port); - -typedef INT32 (*s2650irqcallback)(INT32); -extern s2650irqcallback s2650_irqcallback[MAX_S2650]; -void s2650SetIrqCallback(INT32 (*irqcallback)(INT32)); - -void s2650MapMemory(UINT8 *src, INT32 start, INT32 end, INT32 type); - -void s2650SetIRQLine(INT32 irqline, INT32 state); - -void s2650SetWriteHandler(void (*write)(UINT16, UINT8)); -void s2650SetReadHandler(UINT8 (*read)(UINT16)); -void s2650SetOutHandler(void (*write)(UINT16, UINT8)); -void s2650SetInHandler(UINT8 (*read)(UINT16)); - -INT32 s2650Run(INT32 cycles); -void s2650Reset(); -void s2650Open(INT32 num); -void s2650Close(); -void s2650Exit(); -void s2650Init(INT32 num); - -UINT32 s2650GetPC(INT32); - -INT32 s2650GetActive(); - -INT32 s2650Scan(INT32 nAction); - -#define S2650_CTRL_PORT 0x100 -#define S2650_DATA_PORT 0x101 -#define S2650_EXT_PORT 0xff -#define S2650_SENSE_PORT 0x102 diff --git a/jan/src/cpu/sh2/sh2.cpp b/jan/src/cpu/sh2/sh2.cpp deleted file mode 100644 index 7cfa44d5d..000000000 --- a/jan/src/cpu/sh2/sh2.cpp +++ /dev/null @@ -1,3495 +0,0 @@ -/***************************************************************************** - * - * Portable Hitachi SH-2 (SH7600 family) emulator - * - * Copyright (c) 2000 Juergen Buchmueller , - * all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * pullmoll@t-online.de - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - * This work is based on C/C++ implementation of - * the SH-2 CPU core and was adapted to the MAME CPU core requirements. - * Thanks also go to Chuck Mason and Olivier Galibert - * for letting me peek into their SEMU code :-) - * - ***************************************************************************** - * - * Port to Finalburn Alpha by OopsWare - * http://oopsware.googlepages.com/ - * - *****************************************************************************/ - -#include "burnint.h" -#include "sh2_intf.h" - -int has_sh2; -INT32 cps3speedhack; // must be set _after_ Sh2Init(); -INT32 sh2_suprnova_speedhack; -INT32 sh2_busyloop_speedhack_mode2; - -#define BUSY_LOOP_HACKS 1 -#define FAST_OP_FETCH 1 -#define USE_JUMPTABLE 0 - -#define SH2_INT_15 15 - -#ifndef SH2_INLINE -#define SH2_INLINE inline -#endif - -#if FAST_OP_FETCH - static unsigned char * readop_pr; // for FAST_OP_FETCH cpu_readop16() - - #define change_pc(newpc) \ - sh2->pc = (newpc); \ - readop_pr = pSh2Ext->MemMap[ (sh2->pc >> SH2_SHIFT) + SH2_WADD * 2 ]; \ - pSh2Ext->opbase = readop_pr - (sh2->pc & ~SH2_PAGEM); - -#else - - #define change_pc(newpc) sh2->pc = (newpc); - -#endif - -#define COMBINE_DATA(varptr) (*(varptr) = (*(varptr) & mem_mask) | (data & ~mem_mask)) - - - -typedef struct -{ - int irq_vector; - int irq_priority; -} irq_entry; - -typedef struct -{ - UINT32 ppc; - UINT32 pc; - UINT32 pr; - UINT32 sr; - UINT32 gbr, vbr; - UINT32 mach, macl; - UINT32 r[16]; - UINT32 ea; - UINT32 delay; - UINT32 cpu_off; - UINT32 dvsr, dvdnth, dvdntl, dvcr; - UINT32 pending_irq; - UINT32 test_irq; - irq_entry irq_queue[16]; - - INT8 irq_line_state[17]; - UINT32 m[0x200]; - INT8 nmi_line_state; - - UINT16 frc; - UINT16 ocra, ocrb, icr; - UINT32 frc_base; - - int frt_input; - int internal_irq_level; - int internal_irq_vector; - -// emu_timer *timer; - UINT32 timer_cycles; - UINT32 timer_base; - int timer_active; - -// emu_timer *dma_timer[2]; - UINT32 dma_timer_cycles[2]; - UINT32 dma_timer_base[2]; - int dma_timer_active[2]; - -// int is_slave, cpu_number; - - UINT32 cycle_counts; // used internally for timers / sh2_GetTotalCycles() - UINT32 sh2_cycles_to_run; - INT32 sh2_icount; - int sh2_total_cycles; // used externally (drivers/etc) - - ALIGN_VAR(8) int (*irq_callback)(int irqline); - -} SH2; - -static SH2 * sh2; - -static UINT32 sh2_GetTotalCycles() -{ - return sh2->cycle_counts + sh2->sh2_cycles_to_run - sh2->sh2_icount; -} - -static const int div_tab[4] = { 3, 5, 7, 0 }; - -enum { - ICF = 0x00800000, - OCFA = 0x00080000, - OCFB = 0x00040000, - OVF = 0x00020000 -}; - -//static TIMER_CALLBACK( sh2_timer_callback ); - -#define T 0x00000001 -#define S 0x00000002 -#define I 0x000000f0 -#define Q 0x00000100 -#define M 0x00000200 - -#define AM 0xc7ffffff - -#define FLAGS (M|Q|I|S|T) - -#define Rn ((opcode>>8)&15) -#define Rm ((opcode>>4)&15) - -static UINT32 sh2_internal_r(UINT32 A, UINT32 mask); -static void sh2_internal_w(UINT32 offset, UINT32 data, UINT32 mem_mask); - -//-- sh2 memory handler for Finalburn Alpha --------------------- - -#define SH2_BITS (16) // 16 = 0x10000 page size -#define SH2_PAGE_COUNT (1 << (32 - SH2_BITS)) // Number of pages -#define SH2_SHIFT (SH2_BITS) // Shift value = page bits -#define SH2_PAGE_SIZE (1 << SH2_BITS) // Page size -#define SH2_PAGEM (SH2_PAGE_SIZE - 1) -#define SH2_WADD (SH2_PAGE_COUNT) // Value to add for write section = Number of pages -#define SH2_MASK (SH2_WADD - 1) - -#define SH2_MAXHANDLER (8) - - -typedef struct -{ - SH2 sh2; - unsigned char * MemMap[SH2_PAGE_COUNT * 3]; - pSh2ReadByteHandler ReadByte[SH2_MAXHANDLER]; - pSh2WriteByteHandler WriteByte[SH2_MAXHANDLER]; - pSh2ReadWordHandler ReadWord[SH2_MAXHANDLER]; - pSh2WriteWordHandler WriteWord[SH2_MAXHANDLER]; - pSh2ReadLongHandler ReadLong[SH2_MAXHANDLER]; - pSh2WriteLongHandler WriteLong[SH2_MAXHANDLER]; - - unsigned char * opbase; - int suspend; -} SH2EXT; - -static SH2EXT * pSh2Ext; -static SH2EXT * Sh2Ext = NULL; - -/* SH-2 Memory Map: - * 0x00000000 ~ 0x07ffffff : user - * 0x08000000 ~ 0x0fffffff : user ( mirror ) - * 0x10000000 ~ 0x17ffffff : user ( mirror ) - * 0x18000000 ~ 0x1fffffff : user ( mirror ) - * 0x20000000 ~ 0x27ffffff : user ( mirror ) - * 0x28000000 ~ 0x2fffffff : user ( mirror ) - * 0x30000000 ~ 0x37ffffff : user ( mirror ) - * 0x38000000 ~ 0x3fffffff : user ( mirror ) - * 0x40000000 ~ 0xbfffffff : fill with 0xa5 - * 0xc0000000 ~ 0xdfffffff : extend user - * 0xe0000000 ~ 0xffffffff : internal mem - */ - -int Sh2MapMemory(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd, int nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2MapMemory called without init\n")); -#endif - - unsigned char* Ptr = pMemory - nStart; - unsigned char** pMemMap = pSh2Ext->MemMap + (nStart >> SH2_SHIFT); - int need_mirror = (nStart < 0x08000000) ? 1 : 0; - - for (unsigned long long i = (nStart & ~SH2_PAGEM); i <= nEnd; i += SH2_PAGE_SIZE, pMemMap++) { - if (nType & 0x01 /*SM_READ*/) pMemMap[0] = Ptr + i; - if (nType & 0x02 /*SM_WRITE*/) pMemMap[SH2_WADD] = Ptr + i; - if (nType & 0x04 /*SM_FETCH*/) pMemMap[SH2_WADD*2] = Ptr + i; - - if ( need_mirror ) { - if (nType & 0x01 /*SM_READ*/) { - pMemMap[0 + (0x08000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[0 + (0x10000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[0 + (0x18000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[0 + (0x20000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[0 + (0x28000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[0 + (0x30000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[0 + (0x38000000 >> SH2_SHIFT)] = Ptr + i; - } - if (nType & 0x02 /*SM_WRITE*/) { - pMemMap[SH2_WADD + (0x08000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD + (0x10000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD + (0x18000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD + (0x20000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD + (0x28000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD + (0x30000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD + (0x38000000 >> SH2_SHIFT)] = Ptr + i; - } - if (nType & 0x04 /*SM_FETCH*/) { - pMemMap[SH2_WADD*2 + (0x08000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD*2 + (0x10000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD*2 + (0x18000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD*2 + (0x20000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD*2 + (0x28000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD*2 + (0x30000000 >> SH2_SHIFT)] = Ptr + i; - pMemMap[SH2_WADD*2 + (0x38000000 >> SH2_SHIFT)] = Ptr + i; - } - } - } - return 0; -} - -int Sh2MapHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2MapHandler called without init\n")); -#endif - - unsigned char** pMemMap = pSh2Ext->MemMap + (nStart >> SH2_SHIFT); - int need_mirror = (nStart < 0x08000000) ? 1 : 0; - - for (unsigned long long i = (nStart & ~SH2_PAGEM); i <= nEnd; i += SH2_PAGE_SIZE, pMemMap++) { - if (nType & 0x01 /*SM_READ*/) pMemMap[0] = (unsigned char*)nHandler; - if (nType & 0x02 /*SM_WRITE*/) pMemMap[SH2_WADD] = (unsigned char*)nHandler; - if (nType & 0x04 /*SM_FETCH*/) pMemMap[SH2_WADD*2] = (unsigned char*)nHandler; - - if ( need_mirror ) { - if (nType & 0x01 /*SM_READ*/) { - pMemMap[0 + (0x08000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[0 + (0x10000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[0 + (0x18000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[0 + (0x20000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[0 + (0x28000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[0 + (0x30000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[0 + (0x38000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - } - if (nType & 0x02 /*SM_WRITE*/) { - pMemMap[SH2_WADD + (0x08000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD + (0x10000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD + (0x18000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD + (0x20000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD + (0x28000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD + (0x30000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD + (0x38000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - } - if (nType & 0x04 /*SM_FETCH*/) { - pMemMap[SH2_WADD*2 + (0x08000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD*2 + (0x10000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD*2 + (0x18000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD*2 + (0x20000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD*2 + (0x28000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD*2 + (0x30000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - pMemMap[SH2_WADD*2 + (0x38000000 >> SH2_SHIFT)] = (unsigned char*)nHandler; - } - } - - } - return 0; -} - -int Sh2SetReadByteHandler(int i, pSh2ReadByteHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2SetReadByteHandler called without init\n")); - if (i >= SH2_MAXHANDLER) bprintf(PRINT_ERROR, _T("Sh2SetReadByteHandler called with invalid index %x\n"), i); -#endif - - if (i >= SH2_MAXHANDLER) return 1; - pSh2Ext->ReadByte[i] = pHandler; - return 0; -} - -int Sh2SetWriteByteHandler(int i, pSh2WriteByteHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2SetWriteByteHandler called without init\n")); - if (i >= SH2_MAXHANDLER) bprintf(PRINT_ERROR, _T("Sh2SetWriteByteHandler called with invalid index %x\n"), i); -#endif - - if (i >= SH2_MAXHANDLER) return 1; - pSh2Ext->WriteByte[i] = pHandler; - return 0; -} - -int Sh2SetReadWordHandler(int i, pSh2ReadWordHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2SetReadWordHandler called without init\n")); - if (i >= SH2_MAXHANDLER) bprintf(PRINT_ERROR, _T("Sh2SetReadWordHandler called with invalid index %x\n"), i); -#endif - - if (i >= SH2_MAXHANDLER) return 1; - pSh2Ext->ReadWord[i] = pHandler; - return 0; -} - -int Sh2SetWriteWordHandler(int i, pSh2WriteWordHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2SetWriteWordHandler called without init\n")); - if (i >= SH2_MAXHANDLER) bprintf(PRINT_ERROR, _T("Sh2SetWriteWordHandler called with invalid index %x\n"), i); -#endif - - if (i >= SH2_MAXHANDLER) return 1; - pSh2Ext->WriteWord[i] = pHandler; - return 0; -} - -int Sh2SetReadLongHandler(int i, pSh2ReadLongHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2SetReadLongHandler called without init\n")); - if (i >= SH2_MAXHANDLER) bprintf(PRINT_ERROR, _T("Sh2SetReadLongHandler called with invalid index %x\n"), i); -#endif - - if (i >= SH2_MAXHANDLER) return 1; - pSh2Ext->ReadLong[i] = pHandler; - return 0; -} - -int Sh2SetWriteLongHandler(int i, pSh2WriteLongHandler pHandler) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2SetWriteLongHandler called without init\n")); - if (i >= SH2_MAXHANDLER) bprintf(PRINT_ERROR, _T("Sh2SetWriteLongHandler called with invalid index %x\n"), i); -#endif - - if (i >= SH2_MAXHANDLER) return 1; - pSh2Ext->WriteLong[i] = pHandler; - return 0; -} - -unsigned char __fastcall Sh2InnerReadByte(unsigned int a) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2InnerReadByte called without init\n")); -#endif - - return sh2_internal_r((a & 0x1fc)>>2, ~(0xff << (((~a) & 3)*8))) >> (((~a) & 3)*8); -} - -unsigned short __fastcall Sh2InnerReadWord(unsigned int a) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2InnerReadWord called without init\n")); -#endif - - return sh2_internal_r((a & 0x1fc)>>2, ~(0xffff << (((~a) & 2)*8))) >> (((~a) & 2)*8); -} - -unsigned int __fastcall Sh2InnerReadLong(unsigned int a) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2InnerReadLong called without init\n")); -#endif - - return sh2_internal_r((a & 0x1fc)>>2, 0); -} - -void __fastcall Sh2InnerWriteByte(unsigned int a, unsigned char d) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2InnerWriteByte called without init\n")); -#endif - - //bprintf(0, _T("Attempt to write byte value %02x to location %8x offset: %04x\n"), d, a, (a & 0x1fc)>>2); - sh2_internal_w((a & 0x1fc)>>2, d << (((~a) & 3)*8), ~(0xff << (((~a) & 3)*8))); -} - -void __fastcall Sh2InnerWriteWord(unsigned int a, unsigned short d) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2InnerWriteWord called without init\n")); -#endif - - sh2_internal_w((a & 0x1fc)>>2, d << (((~a) & 2)*8), ~(0xffff << (((~a) & 2)*8))); -} - -void __fastcall Sh2InnerWriteLong(unsigned int a, unsigned int d) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2InnerWriteLong called without init\n")); -#endif - - sh2_internal_w((a & 0x1fc)>>2, d, 0); -} - -unsigned char __fastcall Sh2EmptyReadByte(unsigned int) { return 0xa5; } -unsigned short __fastcall Sh2EmptyReadWord(unsigned int) { return 0xa5a5; } -unsigned int __fastcall Sh2EmptyReadLong(unsigned int) { return 0xa5a5a5a5; } -void __fastcall Sh2EmptyWriteByte(unsigned int, unsigned char) { } -void __fastcall Sh2EmptyWriteWord(unsigned int, unsigned short) { } -void __fastcall Sh2EmptyWriteLong(unsigned int, unsigned int) { } - -int Sh2Exit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2Exit called without init\n")); -#endif - - has_sh2 = 0; - - if (Sh2Ext) { - free(Sh2Ext); - Sh2Ext = NULL; - } - pSh2Ext = NULL; - - DebugCPU_SH2Initted = 0; - - return 0; -} - -static void Sh2CheatWriteByte(UINT32 a, UINT8 d) -{ - Sh2WriteByte(a,d); -} - -static UINT8 Sh2CheatReadByte(UINT32 a) -{ - return Sh2ReadByte(a); -} - -static cpu_core_config Sh2CheatCpuConfig = -{ - Sh2Open, - Sh2Close, - Sh2CheatReadByte, - Sh2CheatWriteByte, - Sh2GetActive, - Sh2TotalCycles, - Sh2NewFrame, - Sh2Run, - Sh2StopRun, - Sh2Reset, - 0xffffffff, - 0 -}; - -int Sh2Init(int nCount) -{ - DebugCPU_SH2Initted = 1; - - has_sh2 = 1; - cps3speedhack = 0; - sh2_suprnova_speedhack = 0; - sh2_busyloop_speedhack_mode2 = 0; - - Sh2Ext = (SH2EXT *)malloc(sizeof(SH2EXT) * nCount); - if (Sh2Ext == NULL) { - Sh2Exit(); - return 1; - } - memset(Sh2Ext, 0, sizeof(SH2EXT) * nCount); - - // init default memory handler - for (int i=0; ish2; - - Sh2MapHandler(SH2_MAXHANDLER - 1, 0xE0000000, 0xFFFFFFFF, 0x07); - Sh2MapHandler(SH2_MAXHANDLER - 2, 0x40000000, 0xBFFFFFFF, 0x07); -// Sh2MapHandler(SH2_MAXHANDLER - 3, 0xC0000000, 0xDFFFFFFF, 0x07); - - Sh2SetReadByteHandler (SH2_MAXHANDLER - 1, Sh2InnerReadByte); - Sh2SetReadWordHandler (SH2_MAXHANDLER - 1, Sh2InnerReadWord); - Sh2SetReadLongHandler (SH2_MAXHANDLER - 1, Sh2InnerReadLong); - Sh2SetWriteByteHandler(SH2_MAXHANDLER - 1, Sh2InnerWriteByte); - Sh2SetWriteWordHandler(SH2_MAXHANDLER - 1, Sh2InnerWriteWord); - Sh2SetWriteLongHandler(SH2_MAXHANDLER - 1, Sh2InnerWriteLong); - - Sh2SetReadByteHandler (SH2_MAXHANDLER - 2, Sh2EmptyReadByte); - Sh2SetReadWordHandler (SH2_MAXHANDLER - 2, Sh2EmptyReadWord); - Sh2SetReadLongHandler (SH2_MAXHANDLER - 2, Sh2EmptyReadLong); - Sh2SetWriteByteHandler(SH2_MAXHANDLER - 2, Sh2EmptyWriteByte); - Sh2SetWriteWordHandler(SH2_MAXHANDLER - 2, Sh2EmptyWriteWord); - Sh2SetWriteLongHandler(SH2_MAXHANDLER - 2, Sh2EmptyWriteLong); - - CpuCheatRegister(i, &Sh2CheatCpuConfig); - } - - return 0; -} - -void Sh2Open(const int i) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2Open called without init\n")); -#endif - - pSh2Ext = Sh2Ext + i; - sh2 = & (pSh2Ext->sh2); -} - -void Sh2Close() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2Close called without init\n")); -#endif -} - -int Sh2GetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2GetActive called without init\n")); -#endif - - return 0; -} - -void Sh2Reset(unsigned int pc, unsigned r15) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2Reset called without init\n")); -#endif - - memset(sh2, 0, sizeof(SH2) - 4); - - sh2->pc = pc; - sh2->r[15] = r15; - sh2->sr = I; - - change_pc(sh2->pc & AM); - - sh2->internal_irq_level = -1; -} - -//---------------------------------------------------------------- - -unsigned char program_read_byte_32be(unsigned int /*A*/) -{ - return 0; -} - -unsigned short program_read_word_32be(unsigned int /*A*/) -{ - return 0; -} - -unsigned int program_read_dword_32be(unsigned int /*A*/) -{ - return 0; -} - -void program_write_byte_32be(unsigned int /*A*/, unsigned char /*V*/) -{ -} - -void program_write_word_32be(unsigned int /*A*/, unsigned short /*V*/) -{ -} - -void program_write_dword_32be(unsigned int /*A*/, unsigned int /*V*/) -{ -} - -//pSh2Ext->opbase - -#if FAST_OP_FETCH - -#ifdef LSB_FIRST -#define cpu_readop16(A) ((uintptr_t)readop_pr >= SH2_MAXHANDLER) ? *(unsigned short *)(pSh2Ext->opbase + ((A) ^ 0x02)) : pSh2Ext->ReadWord[(uintptr_t)readop_pr](A); -#else -#define cpu_readop16(A) ((uintptr_t)readop_pr >= SH2_MAXHANDLER) ? *(unsigned short *)(pSh2Ext->opbase + ((A))) : pSh2Ext->ReadWord[(uintptr_t)readop_pr](A); -#endif - -#else - -SH2_INLINE unsigned short cpu_readop16(unsigned int A) -{ - unsigned char * pr; - pr = pSh2Ext->MemMap[ (A >> SH2_SHIFT) + SH2_WADD * 2 ]; - if ( (uintptr_t)pr >= SH2_MAXHANDLER ) { -#ifdef LSB_FIRST - A ^= 2; -#endif - return *((unsigned short *)(pr + (A & SH2_PAGEM))); - } - return pSh2Ext->ReadWord[pr](A); -} - -#endif - -// ------------------------------------------------------ - -SH2_INLINE UINT8 RB(UINT32 A) -{ -/* if (A >= 0xe0000000) return sh2_internal_r((A & 0x1fc)>>2, ~(0xff << (((~A) & 3)*8))) >> (((~A) & 3)*8); - if (A >= 0xc0000000) return program_read_byte_32be(A); - if (A >= 0x40000000) return 0xa5; - return program_read_byte_32be(A & AM); */ - - unsigned char * pr; - pr = pSh2Ext->MemMap[ A >> SH2_SHIFT ]; - if ( (uintptr_t)pr >= SH2_MAXHANDLER ) { -#ifdef LSB_FIRST - A ^= 3; -#endif - return pr[A & SH2_PAGEM]; - } - return pSh2Ext->ReadByte[(uintptr_t)pr](A); -} - -SH2_INLINE UINT16 RW(UINT32 A) -{ -/* if (A >= 0xe0000000) return sh2_internal_r((A & 0x1fc)>>2, ~(0xffff << (((~A) & 2)*8))) >> (((~A) & 2)*8); - if (A >= 0xc0000000) return program_read_word_32be(A); - if (A >= 0x40000000) return 0xa5a5; - return program_read_word_32be(A & AM); */ - - unsigned char * pr; - pr = pSh2Ext->MemMap[ A >> SH2_SHIFT ]; - if ( (uintptr_t)pr >= SH2_MAXHANDLER ) { -#ifdef LSB_FIRST - A ^= 2; -#endif - //return (pr[A & SH2_PAGEM] << 8) | pr[(A & SH2_PAGEM) + 1]; - return *((unsigned short *)(pr + (A & SH2_PAGEM))); - } - return pSh2Ext->ReadWord[(uintptr_t)pr](A); -} - -SH2_INLINE UINT16 OPRW(UINT32 A) -{ - - unsigned char * pr; - pr = pSh2Ext->MemMap[ (A >> SH2_SHIFT) + SH2_WADD * 2 ]; - if ( (uintptr_t)pr >= SH2_MAXHANDLER ) { -#ifdef LSB_FIRST - A ^= 2; -#endif - return *((unsigned short *)(pr + (A & SH2_PAGEM))); - } - - return 0x0000; -} - -SH2_INLINE UINT32 RL(UINT32 A) -{ -/* if (A >= 0xe0000000) return sh2_internal_r((A & 0x1fc)>>2, 0); - if (A >= 0xc0000000) return program_read_dword_32be(A); - if (A >= 0x40000000) return 0xa5a5a5a5; - return program_read_dword_32be(A & AM); */ - - unsigned char * pr; - pr = pSh2Ext->MemMap[ A >> SH2_SHIFT ]; - if ( (uintptr_t)pr >= SH2_MAXHANDLER ) { - //return (pr[(A & SH2_PAGEM) + 0] << 24) | (pr[(A & SH2_PAGEM) + 1] << 16) | (pr[(A & SH2_PAGEM) + 2] << 8) | (pr[(A & SH2_PAGEM) + 3] << 0); - return *((unsigned int *)(pr + (A & SH2_PAGEM))); - } - return pSh2Ext->ReadLong[(uintptr_t)pr](A); -} - -SH2_INLINE void WB(UINT32 A, UINT8 V) -{ -/* if (A >= 0xe0000000) { sh2_internal_w((A & 0x1fc)>>2, V << (((~A) & 3)*8), ~(0xff << (((~A) & 3)*8))); return; } - if (A >= 0xc0000000) { program_write_byte_32be(A,V); return; } - if (A >= 0x40000000) return; - program_write_byte_32be(A & AM,V); */ - - unsigned char* pr; - pr = pSh2Ext->MemMap[(A >> SH2_SHIFT) + SH2_WADD]; - if ((uintptr_t)pr >= SH2_MAXHANDLER) { -#ifdef LSB_FIRST - A ^= 3; -#endif - pr[A & SH2_PAGEM] = (unsigned char)V; - return; - } - pSh2Ext->WriteByte[(uintptr_t)pr](A, V); -} - -SH2_INLINE void WW(UINT32 A, UINT16 V) -{ -/* if (A >= 0xe0000000) { sh2_internal_w((A & 0x1fc)>>2, V << (((~A) & 2)*8), ~(0xffff << (((~A) & 2)*8))); return; } - if (A >= 0xc0000000) { program_write_word_32be(A,V); return; } - if (A >= 0x40000000) return; - program_write_word_32be(A & AM,V); */ - - unsigned char * pr; - pr = pSh2Ext->MemMap[(A >> SH2_SHIFT) + SH2_WADD]; - if ((uintptr_t)pr >= SH2_MAXHANDLER) { -#ifdef LSB_FIRST - A ^= 2; -#endif - *((unsigned short *)(pr + (A & SH2_PAGEM))) = (unsigned short)V; - return; - } - pSh2Ext->WriteWord[(uintptr_t)pr](A, V); -} - -SH2_INLINE void WL(UINT32 A, UINT32 V) -{ -/* if (A >= 0xe0000000) { sh2_internal_w((A & 0x1fc)>>2, V, 0); return; } - if (A >= 0xc0000000) { program_write_dword_32be(A,V); return; } - if (A >= 0x40000000) return; - program_write_dword_32be(A & AM,V); */ - unsigned char * pr; - pr = pSh2Ext->MemMap[(A >> SH2_SHIFT) + SH2_WADD]; - if ((uintptr_t)pr >= SH2_MAXHANDLER) { - *((unsigned int *)(pr + (A & SH2_PAGEM))) = (unsigned int)V; - return; - } - pSh2Ext->WriteLong[(uintptr_t)pr](A, V); -} - -SH2_INLINE void sh2_exception(/*const char *message,*/ int irqline) -{ - int vector; - - if (irqline != 16) - { - if (irqline <= (signed int)((sh2->sr >> 4) & 15)) /* If the cpu forbids this interrupt */ - return; - - // if this is an sh2 internal irq, use its vector - if (sh2->internal_irq_level == irqline) - { - vector = sh2->internal_irq_vector; - //LOG(("SH-2 #%d exception #%d (internal vector: $%x) after [%s]\n", cpu_getactivecpu(), irqline, vector, message)); - } - else - { - if(sh2->m[0x38] & 0x00010000) - { - //vector = sh2->irq_callback(irqline); - //LOG(("SH-2 #%d exception #%d (external vector: $%x) after [%s]\n", cpu_getactivecpu(), irqline, vector, message)); - //bprintf(0, _T("SH-2 exception #%d (external vector: $%x)\n"), irqline, vector); - vector = 64 + irqline/2; - - } - else - { - //sh2->irq_callback(irqline); - vector = 64 + irqline/2; - //LOG(("SH-2 #%d exception #%d (autovector: $%x) after [%s]\n", cpu_getactivecpu(), irqline, vector, message)); - } - } - } - else - { - vector = 11; - //LOG(("SH-2 #%d nmi exception (autovector: $%x) after [%s]\n", cpu_getactivecpu(), vector, message)); - } - - sh2->r[15] -= 4; - WL( sh2->r[15], sh2->sr ); /* push SR onto stack */ - sh2->r[15] -= 4; - WL( sh2->r[15], sh2->pc ); /* push PC onto stack */ - - /* set I flags in SR */ - if (irqline > SH2_INT_15) - sh2->sr = sh2->sr | I; - else - sh2->sr = (sh2->sr & ~I) | (irqline << 4); - - /* fetch PC */ - sh2->pc = RL( sh2->vbr + vector * 4 ); - change_pc(sh2->pc & AM); -} - -#define CHECK_PENDING_IRQ(/*message*/) \ -do { \ - int irq = -1; \ - if (sh2->pending_irq & (1 << 0)) irq = 0; \ - if (sh2->pending_irq & (1 << 1)) irq = 1; \ - if (sh2->pending_irq & (1 << 2)) irq = 2; \ - if (sh2->pending_irq & (1 << 3)) irq = 3; \ - if (sh2->pending_irq & (1 << 4)) irq = 4; \ - if (sh2->pending_irq & (1 << 5)) irq = 5; \ - if (sh2->pending_irq & (1 << 6)) irq = 6; \ - if (sh2->pending_irq & (1 << 7)) irq = 7; \ - if (sh2->pending_irq & (1 << 8)) irq = 8; \ - if (sh2->pending_irq & (1 << 9)) irq = 9; \ - if (sh2->pending_irq & (1 << 10)) irq = 10; \ - if (sh2->pending_irq & (1 << 11)) irq = 11; \ - if (sh2->pending_irq & (1 << 12)) irq = 12; \ - if (sh2->pending_irq & (1 << 13)) irq = 13; \ - if (sh2->pending_irq & (1 << 14)) irq = 14; \ - if (sh2->pending_irq & (1 << 15)) irq = 15; \ - if ((sh2->internal_irq_level != -1) && (sh2->internal_irq_level > irq)) irq = sh2->internal_irq_level; \ - if (irq >= 0) \ - sh2_exception(/*message,*/irq); \ -} while(0) - - -#if USE_JUMPTABLE - - #include "sh2op.c" - -#else - -/* code cycles t-bit - * 0011 nnnn mmmm 1100 1 - - * ADD Rm,Rn - */ -SH2_INLINE void ADD(UINT32 m, UINT32 n) -{ - sh2->r[n] += sh2->r[m]; -} - -/* code cycles t-bit - * 0111 nnnn iiii iiii 1 - - * ADD #imm,Rn - */ -SH2_INLINE void ADDI(UINT32 i, UINT32 n) -{ - sh2->r[n] += (INT32)(INT16)(INT8)i; -} - -/* code cycles t-bit - * 0011 nnnn mmmm 1110 1 carry - * ADDC Rm,Rn - */ -SH2_INLINE void ADDC(UINT32 m, UINT32 n) -{ - UINT32 tmp0, tmp1; - - tmp1 = sh2->r[n] + sh2->r[m]; - tmp0 = sh2->r[n]; - sh2->r[n] = tmp1 + (sh2->sr & T); - if (tmp0 > tmp1) - sh2->sr |= T; - else - sh2->sr &= ~T; - if (tmp1 > sh2->r[n]) - sh2->sr |= T; -} - -/* code cycles t-bit - * 0011 nnnn mmmm 1111 1 overflow - * ADDV Rm,Rn - */ -SH2_INLINE void ADDV(UINT32 m, UINT32 n) -{ - INT32 dest, src, ans; - - if ((INT32) sh2->r[n] >= 0) - dest = 0; - else - dest = 1; - if ((INT32) sh2->r[m] >= 0) - src = 0; - else - src = 1; - src += dest; - sh2->r[n] += sh2->r[m]; - if ((INT32) sh2->r[n] >= 0) - ans = 0; - else - ans = 1; - ans += dest; - if (src == 0 || src == 2) - { - if (ans == 1) - sh2->sr |= T; - else - sh2->sr &= ~T; - } - else - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0010 nnnn mmmm 1001 1 - - * AND Rm,Rn - */ -SH2_INLINE void AND(UINT32 m, UINT32 n) -{ - sh2->r[n] &= sh2->r[m]; -} - - -/* code cycles t-bit - * 1100 1001 iiii iiii 1 - - * AND #imm,R0 - */ -SH2_INLINE void ANDI(UINT32 i) -{ - sh2->r[0] &= i; -} - -/* code cycles t-bit - * 1100 1101 iiii iiii 1 - - * AND.B #imm,@(R0,GBR) - */ -SH2_INLINE void ANDM(UINT32 i) -{ - UINT32 temp; - - sh2->ea = sh2->gbr + sh2->r[0]; - temp = i & RB( sh2->ea ); - WB( sh2->ea, temp ); - sh2->sh2_icount -= 2; -} - -/* code cycles t-bit - * 1000 1011 dddd dddd 3/1 - - * BF disp8 - */ -SH2_INLINE void BF(UINT32 d) -{ - if ((sh2->sr & T) == 0) - { - INT32 disp = ((INT32)d << 24) >> 24; - sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2; - change_pc(sh2->pc & AM); - sh2->sh2_icount -= 2; - } -} - -/* code cycles t-bit - * 1000 1111 dddd dddd 3/1 - - * BFS disp8 - */ -SH2_INLINE void BFS(UINT32 d) -{ - if ((sh2->sr & T) == 0) - { - INT32 disp = ((INT32)d << 24) >> 24; - sh2->delay = sh2->pc; - sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2; - sh2->sh2_icount--; - } -} - -/* code cycles t-bit - * 1010 dddd dddd dddd 2 - - * BRA disp12 - */ -SH2_INLINE void BRA(UINT32 d) -{ - INT32 disp = ((INT32)d << 20) >> 20; - -#if BUSY_LOOP_HACKS - if (disp == -2) - { - UINT32 next_opcode = RW(sh2->ppc & AM); - /* BRA $ - * NOP - */ - if (next_opcode == 0x0009) { - //bprintf(0, _T("SH2: BUSY_LOOP_HACKS: %d\n"), sh2->sh2_icount); - if (sh2_busyloop_speedhack_mode2) { - sh2->sh2_icount -= 10; - } else { - sh2->sh2_total_cycles += sh2->sh2_icount; - sh2->sh2_icount %= 3; /* cycles for BRA $ and NOP taken (3) */ - } - } - } -#endif - sh2->delay = sh2->pc; - sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2; - sh2->sh2_icount--; -} - -/* code cycles t-bit - * 0000 mmmm 0010 0011 2 - - * BRAF Rm - */ -SH2_INLINE void BRAF(UINT32 m) -{ - sh2->delay = sh2->pc; - sh2->pc += sh2->r[m] + 2; - sh2->sh2_icount--; -} - -/* code cycles t-bit - * 1011 dddd dddd dddd 2 - - * BSR disp12 - */ -SH2_INLINE void BSR(UINT32 d) -{ - INT32 disp = ((INT32)d << 20) >> 20; - - sh2->pr = sh2->pc + 2; - sh2->delay = sh2->pc; - sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2; - sh2->sh2_icount--; -} - -/* code cycles t-bit - * 0000 mmmm 0000 0011 2 - - * BSRF Rm - */ -SH2_INLINE void BSRF(UINT32 m) -{ - sh2->pr = sh2->pc + 2; - sh2->delay = sh2->pc; - sh2->pc += sh2->r[m] + 2; - sh2->sh2_icount--; -} - -/* code cycles t-bit - * 1000 1001 dddd dddd 3/1 - - * BT disp8 - */ -SH2_INLINE void BT(UINT32 d) -{ - if ((sh2->sr & T) != 0) - { - INT32 disp = ((INT32)d << 24) >> 24; - sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2; - change_pc(sh2->pc & AM); - sh2->sh2_icount -= 2; - } -} - -/* code cycles t-bit - * 1000 1101 dddd dddd 2/1 - - * BTS disp8 - */ -SH2_INLINE void BTS(UINT32 d) -{ - if ((sh2->sr & T) != 0) - { - INT32 disp = ((INT32)d << 24) >> 24; - sh2->delay = sh2->pc; - sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2; - sh2->sh2_icount--; - } -} - -/* code cycles t-bit - * 0000 0000 0010 1000 1 - - * CLRMAC - */ -SH2_INLINE void CLRMAC(void) -{ - sh2->mach = 0; - sh2->macl = 0; -} - -/* code cycles t-bit - * 0000 0000 0000 1000 1 - - * CLRT - */ -SH2_INLINE void CLRT(void) -{ - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0011 nnnn mmmm 0000 1 comparison result - * CMP_EQ Rm,Rn - */ -SH2_INLINE void CMPEQ(UINT32 m, UINT32 n) -{ - if (sh2->r[n] == sh2->r[m]) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0011 nnnn mmmm 0011 1 comparison result - * CMP_GE Rm,Rn - */ -SH2_INLINE void CMPGE(UINT32 m, UINT32 n) -{ - if ((INT32) sh2->r[n] >= (INT32) sh2->r[m]) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0011 nnnn mmmm 0111 1 comparison result - * CMP_GT Rm,Rn - */ -SH2_INLINE void CMPGT(UINT32 m, UINT32 n) -{ - if ((INT32) sh2->r[n] > (INT32) sh2->r[m]) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0011 nnnn mmmm 0110 1 comparison result - * CMP_HI Rm,Rn - */ -SH2_INLINE void CMPHI(UINT32 m, UINT32 n) -{ - if ((UINT32) sh2->r[n] > (UINT32) sh2->r[m]) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0011 nnnn mmmm 0010 1 comparison result - * CMP_HS Rm,Rn - */ -SH2_INLINE void CMPHS(UINT32 m, UINT32 n) -{ - if ((UINT32) sh2->r[n] >= (UINT32) sh2->r[m]) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - - -/* code cycles t-bit - * 0100 nnnn 0001 0101 1 comparison result - * CMP_PL Rn - */ -SH2_INLINE void CMPPL(UINT32 n) -{ - if ((INT32) sh2->r[n] > 0) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0100 nnnn 0001 0001 1 comparison result - * CMP_PZ Rn - */ -SH2_INLINE void CMPPZ(UINT32 n) -{ - if ((INT32) sh2->r[n] >= 0) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0010 nnnn mmmm 1100 1 comparison result - * CMP_STR Rm,Rn - */ -SH2_INLINE void CMPSTR(UINT32 m, UINT32 n) - { - UINT32 temp; - INT32 HH, HL, LH, LL; - temp = sh2->r[n] ^ sh2->r[m]; - HH = (temp >> 24) & 0xff; - HL = (temp >> 16) & 0xff; - LH = (temp >> 8) & 0xff; - LL = temp & 0xff; - if (HH && HL && LH && LL) - sh2->sr &= ~T; - else - sh2->sr |= T; - } - - -/* code cycles t-bit - * 1000 1000 iiii iiii 1 comparison result - * CMP/EQ #imm,R0 - */ -SH2_INLINE void CMPIM(UINT32 i) -{ - UINT32 imm = (UINT32)(INT32)(INT16)(INT8)i; - - if (sh2->r[0] == imm) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0010 nnnn mmmm 0111 1 calculation result - * DIV0S Rm,Rn - */ -SH2_INLINE void DIV0S(UINT32 m, UINT32 n) -{ - if ((sh2->r[n] & 0x80000000) == 0) - sh2->sr &= ~Q; - else - sh2->sr |= Q; - if ((sh2->r[m] & 0x80000000) == 0) - sh2->sr &= ~M; - else - sh2->sr |= M; - if ((sh2->r[m] ^ sh2->r[n]) & 0x80000000) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* code cycles t-bit - * 0000 0000 0001 1001 1 0 - * DIV0U - */ -SH2_INLINE void DIV0U(void) -{ - sh2->sr &= ~(M | Q | T); -} - -/* code cycles t-bit - * 0011 nnnn mmmm 0100 1 calculation result - * DIV1 Rm,Rn - */ -SH2_INLINE void DIV1(UINT32 m, UINT32 n) -{ - UINT32 tmp0; - UINT32 old_q; - - old_q = sh2->sr & Q; - if (0x80000000 & sh2->r[n]) - sh2->sr |= Q; - else - sh2->sr &= ~Q; - - sh2->r[n] = (sh2->r[n] << 1) | (sh2->sr & T); - - if (!old_q) - { - if (!(sh2->sr & M)) - { - tmp0 = sh2->r[n]; - sh2->r[n] -= sh2->r[m]; - if(!(sh2->sr & Q)) - if(sh2->r[n] > tmp0) - sh2->sr |= Q; - else - sh2->sr &= ~Q; - else - if(sh2->r[n] > tmp0) - sh2->sr &= ~Q; - else - sh2->sr |= Q; - } - else - { - tmp0 = sh2->r[n]; - sh2->r[n] += sh2->r[m]; - if(!(sh2->sr & Q)) - { - if(sh2->r[n] < tmp0) - sh2->sr &= ~Q; - else - sh2->sr |= Q; - } - else - { - if(sh2->r[n] < tmp0) - sh2->sr |= Q; - else - sh2->sr &= ~Q; - } - } - } - else - { - if (!(sh2->sr & M)) - { - tmp0 = sh2->r[n]; - sh2->r[n] += sh2->r[m]; - if(!(sh2->sr & Q)) - if(sh2->r[n] < tmp0) - sh2->sr |= Q; - else - sh2->sr &= ~Q; - else - if(sh2->r[n] < tmp0) - sh2->sr &= ~Q; - else - sh2->sr |= Q; - } - else - { - tmp0 = sh2->r[n]; - sh2->r[n] -= sh2->r[m]; - if(!(sh2->sr & Q)) - if(sh2->r[n] > tmp0) - sh2->sr &= ~Q; - else - sh2->sr |= Q; - else - if(sh2->r[n] > tmp0) - sh2->sr |= Q; - else - sh2->sr &= ~Q; - } - } - - tmp0 = (sh2->sr & (Q | M)); - if((!tmp0) || (tmp0 == 0x300)) /* if Q == M set T else clear T */ - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* DMULS.L Rm,Rn */ -SH2_INLINE void DMULS(UINT32 m, UINT32 n) -{ - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; - INT32 tempm, tempn, fnLmL; - - tempn = (INT32) sh2->r[n]; - tempm = (INT32) sh2->r[m]; - if (tempn < 0) - tempn = 0 - tempn; - if (tempm < 0) - tempm = 0 - tempm; - if ((INT32) (sh2->r[n] ^ sh2->r[m]) < 0) - fnLmL = -1; - else - fnLmL = 0; - temp1 = (UINT32) tempn; - temp2 = (UINT32) tempm; - RnL = temp1 & 0x0000ffff; - RnH = (temp1 >> 16) & 0x0000ffff; - RmL = temp2 & 0x0000ffff; - RmH = (temp2 >> 16) & 0x0000ffff; - temp0 = RmL * RnL; - temp1 = RmH * RnL; - temp2 = RmL * RnH; - temp3 = RmH * RnH; - Res2 = 0; - Res1 = temp1 + temp2; - if (Res1 < temp1) - Res2 += 0x00010000; - temp1 = (Res1 << 16) & 0xffff0000; - Res0 = temp0 + temp1; - if (Res0 < temp0) - Res2++; - Res2 = Res2 + ((Res1 >> 16) & 0x0000ffff) + temp3; - if (fnLmL < 0) - { - Res2 = ~Res2; - if (Res0 == 0) - Res2++; - else - Res0 = (~Res0) + 1; - } - sh2->mach = Res2; - sh2->macl = Res0; - sh2->sh2_icount--; -} - -/* DMULU.L Rm,Rn */ -SH2_INLINE void DMULU(UINT32 m, UINT32 n) -{ - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; - - RnL = sh2->r[n] & 0x0000ffff; - RnH = (sh2->r[n] >> 16) & 0x0000ffff; - RmL = sh2->r[m] & 0x0000ffff; - RmH = (sh2->r[m] >> 16) & 0x0000ffff; - temp0 = RmL * RnL; - temp1 = RmH * RnL; - temp2 = RmL * RnH; - temp3 = RmH * RnH; - Res2 = 0; - Res1 = temp1 + temp2; - if (Res1 < temp1) - Res2 += 0x00010000; - temp1 = (Res1 << 16) & 0xffff0000; - Res0 = temp0 + temp1; - if (Res0 < temp0) - Res2++; - Res2 = Res2 + ((Res1 >> 16) & 0x0000ffff) + temp3; - sh2->mach = Res2; - sh2->macl = Res0; - sh2->sh2_icount--; -} - -/* DT Rn */ -SH2_INLINE void DT(UINT32 n) -{ - sh2->r[n]--; - if (sh2->r[n] == 0) - sh2->sr |= T; - else - sh2->sr &= ~T; -#if BUSY_LOOP_HACKS - { - UINT32 next_opcode = RW(sh2->ppc & AM); - /* DT Rn - * BF $-2 - */ - if (next_opcode == 0x8bfd) - { - //bprintf(0, _T("SH2: BUSY_LOOP_HACKS %d (%d)--; \n"), sh2->r[n], sh2->sh2_icount); - while (sh2->r[n] > 1 && sh2->sh2_icount > 4) - { - sh2->r[n]--; - sh2->sh2_icount -= 4; /* cycles for DT (1) and BF taken (3) */ - sh2->sh2_total_cycles += 4; - } - } - } -#endif -} - -/* EXTS.B Rm,Rn */ -SH2_INLINE void EXTSB(UINT32 m, UINT32 n) -{ - sh2->r[n] = ((INT32)sh2->r[m] << 24) >> 24; -} - -/* EXTS.W Rm,Rn */ -SH2_INLINE void EXTSW(UINT32 m, UINT32 n) -{ - sh2->r[n] = ((INT32)sh2->r[m] << 16) >> 16; -} - -/* EXTU.B Rm,Rn */ -SH2_INLINE void EXTUB(UINT32 m, UINT32 n) -{ - sh2->r[n] = sh2->r[m] & 0x000000ff; -} - -/* EXTU.W Rm,Rn */ -SH2_INLINE void EXTUW(UINT32 m, UINT32 n) -{ - sh2->r[n] = sh2->r[m] & 0x0000ffff; -} - -/* JMP @Rm */ -SH2_INLINE void JMP(UINT32 m) -{ - sh2->delay = sh2->pc; - sh2->pc = sh2->ea = sh2->r[m]; -} - -/* JSR @Rm */ -SH2_INLINE void JSR(UINT32 m) -{ - sh2->delay = sh2->pc; - sh2->pr = sh2->pc + 2; - sh2->pc = sh2->ea = sh2->r[m]; - sh2->sh2_icount--; -} - - -/* LDC Rm,SR */ -SH2_INLINE void LDCSR(UINT32 m) -{ - sh2->sr = sh2->r[m] & FLAGS; - sh2->test_irq = 1; -} - -/* LDC Rm,GBR */ -SH2_INLINE void LDCGBR(UINT32 m) -{ - sh2->gbr = sh2->r[m]; -} - -/* LDC Rm,VBR */ -SH2_INLINE void LDCVBR(UINT32 m) -{ - sh2->vbr = sh2->r[m]; -} - -/* LDC.L @Rm+,SR */ -SH2_INLINE void LDCMSR(UINT32 m) -{ - sh2->ea = sh2->r[m]; - sh2->sr = RL( sh2->ea ) & FLAGS; - sh2->r[m] += 4; - sh2->sh2_icount -= 2; - sh2->test_irq = 1; -} - -/* LDC.L @Rm+,GBR */ -SH2_INLINE void LDCMGBR(UINT32 m) -{ - sh2->ea = sh2->r[m]; - sh2->gbr = RL( sh2->ea ); - sh2->r[m] += 4; - sh2->sh2_icount -= 2; -} - -/* LDC.L @Rm+,VBR */ -SH2_INLINE void LDCMVBR(UINT32 m) -{ - sh2->ea = sh2->r[m]; - sh2->vbr = RL( sh2->ea ); - sh2->r[m] += 4; - sh2->sh2_icount -= 2; -} - -/* LDS Rm,MACH */ -SH2_INLINE void LDSMACH(UINT32 m) -{ - sh2->mach = sh2->r[m]; -} - -/* LDS Rm,MACL */ -SH2_INLINE void LDSMACL(UINT32 m) -{ - sh2->macl = sh2->r[m]; -} - -/* LDS Rm,PR */ -SH2_INLINE void LDSPR(UINT32 m) -{ - sh2->pr = sh2->r[m]; -} - -/* LDS.L @Rm+,MACH */ -SH2_INLINE void LDSMMACH(UINT32 m) -{ - sh2->ea = sh2->r[m]; - sh2->mach = RL( sh2->ea ); - sh2->r[m] += 4; -} - -/* LDS.L @Rm+,MACL */ -SH2_INLINE void LDSMMACL(UINT32 m) -{ - sh2->ea = sh2->r[m]; - sh2->macl = RL( sh2->ea ); - sh2->r[m] += 4; -} - -/* LDS.L @Rm+,PR */ -SH2_INLINE void LDSMPR(UINT32 m) -{ - sh2->ea = sh2->r[m]; - sh2->pr = RL( sh2->ea ); - sh2->r[m] += 4; -} - -/* MAC.L @Rm+,@Rn+ */ -SH2_INLINE void MAC_L(UINT32 m, UINT32 n) -{ - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; - INT32 tempm, tempn, fnLmL; - - tempn = (INT32) RL( sh2->r[n] ); - sh2->r[n] += 4; - tempm = (INT32) RL( sh2->r[m] ); - sh2->r[m] += 4; - if ((INT32) (tempn ^ tempm) < 0) - fnLmL = -1; - else - fnLmL = 0; - if (tempn < 0) - tempn = 0 - tempn; - if (tempm < 0) - tempm = 0 - tempm; - temp1 = (UINT32) tempn; - temp2 = (UINT32) tempm; - RnL = temp1 & 0x0000ffff; - RnH = (temp1 >> 16) & 0x0000ffff; - RmL = temp2 & 0x0000ffff; - RmH = (temp2 >> 16) & 0x0000ffff; - temp0 = RmL * RnL; - temp1 = RmH * RnL; - temp2 = RmL * RnH; - temp3 = RmH * RnH; - Res2 = 0; - Res1 = temp1 + temp2; - if (Res1 < temp1) - Res2 += 0x00010000; - temp1 = (Res1 << 16) & 0xffff0000; - Res0 = temp0 + temp1; - if (Res0 < temp0) - Res2++; - Res2 = Res2 + ((Res1 >> 16) & 0x0000ffff) + temp3; - if (fnLmL < 0) - { - Res2 = ~Res2; - if (Res0 == 0) - Res2++; - else - Res0 = (~Res0) + 1; - } - if (sh2->sr & S) - { - Res0 = sh2->macl + Res0; - if (sh2->macl > Res0) - Res2++; - Res2 += (sh2->mach & 0x0000ffff); - if (((INT32) Res2 < 0) && (Res2 < 0xffff8000)) - { - Res2 = 0x00008000; - Res0 = 0x00000000; - } - else if (((INT32) Res2 > 0) && (Res2 > 0x00007fff)) - { - Res2 = 0x00007fff; - Res0 = 0xffffffff; - } - sh2->mach = Res2; - sh2->macl = Res0; - } - else - { - Res0 = sh2->macl + Res0; - if (sh2->macl > Res0) - Res2++; - Res2 += sh2->mach; - sh2->mach = Res2; - sh2->macl = Res0; - } - sh2->sh2_icount -= 2; -} - -/* MAC.W @Rm+,@Rn+ */ -SH2_INLINE void MAC_W(UINT32 m, UINT32 n) -{{ - INT32 tempm, tempn, dest, src, ans; - UINT32 templ; - - tempn = (INT32) RW( sh2->r[n] ); - sh2->r[n] += 2; - tempm = (INT32) RW( sh2->r[m] ); - sh2->r[m] += 2; - templ = sh2->macl; - tempm = ((INT32) (short) tempn * (INT32) (short) tempm); - if ((INT32) sh2->macl >= 0) - dest = 0; - else - dest = 1; - if ((INT32) tempm >= 0) - { - src = 0; - tempn = 0; - } - else - { - src = 1; - tempn = 0xffffffff; - } - src += dest; - sh2->macl += tempm; - if ((INT32) sh2->macl >= 0) - ans = 0; - else - ans = 1; - ans += dest; - if (sh2->sr & S) - { - if (ans == 1) - { - if (src == 0) - sh2->macl = 0x7fffffff; - if (src == 2) - sh2->macl = 0x80000000; - } - } - else - { - sh2->mach += tempn; - if (templ > sh2->macl) - sh2->mach += 1; - } - sh2->sh2_icount -= 2; -}} - -/* MOV Rm,Rn */ -SH2_INLINE void MOV(UINT32 m, UINT32 n) -{ - sh2->r[n] = sh2->r[m]; -} - -/* MOV.B Rm,@Rn */ -SH2_INLINE void MOVBS(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[n]; - WB( sh2->ea, sh2->r[m] & 0x000000ff); -} - -/* MOV.W Rm,@Rn */ -SH2_INLINE void MOVWS(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[n]; - WW( sh2->ea, sh2->r[m] & 0x0000ffff); -} - -/* MOV.L Rm,@Rn */ -SH2_INLINE void MOVLS(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[n]; - WL( sh2->ea, sh2->r[m] ); -} - -/* MOV.B @Rm,Rn */ -SH2_INLINE void MOVBL(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[m]; - sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->ea ); -} - -/* MOV.W @Rm,Rn */ -SH2_INLINE void MOVWL(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[m]; - sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2->ea ); -} - -/* MOV.L @Rm,Rn */ -SH2_INLINE void MOVLL(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[m]; - sh2->r[n] = RL( sh2->ea ); -} - -/* MOV.B Rm,@-Rn */ -SH2_INLINE void MOVBM(UINT32 m, UINT32 n) -{ - /* SMG : bug fix, was reading sh2->r[n] */ - UINT32 data = sh2->r[m] & 0x000000ff; - - sh2->r[n] -= 1; - WB( sh2->r[n], data ); -} - -/* MOV.W Rm,@-Rn */ -SH2_INLINE void MOVWM(UINT32 m, UINT32 n) -{ - UINT32 data = sh2->r[m] & 0x0000ffff; - - sh2->r[n] -= 2; - WW( sh2->r[n], data ); -} - -/* MOV.L Rm,@-Rn */ -SH2_INLINE void MOVLM(UINT32 m, UINT32 n) -{ - UINT32 data = sh2->r[m]; - - sh2->r[n] -= 4; - WL( sh2->r[n], data ); -} - -/* MOV.B @Rm+,Rn */ -SH2_INLINE void MOVBP(UINT32 m, UINT32 n) -{ - sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->r[m] ); - if (n != m) - sh2->r[m] += 1; -} - -/* MOV.W @Rm+,Rn */ -SH2_INLINE void MOVWP(UINT32 m, UINT32 n) -{ - sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2->r[m] ); - if (n != m) - sh2->r[m] += 2; -} - -/* MOV.L @Rm+,Rn */ -SH2_INLINE void MOVLP(UINT32 m, UINT32 n) -{ - sh2->r[n] = RL( sh2->r[m] ); - if (n != m) - sh2->r[m] += 4; -} - -/* MOV.B Rm,@(R0,Rn) */ -SH2_INLINE void MOVBS0(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[n] + sh2->r[0]; - WB( sh2->ea, sh2->r[m] & 0x000000ff ); -} - -/* MOV.W Rm,@(R0,Rn) */ -SH2_INLINE void MOVWS0(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[n] + sh2->r[0]; - WW( sh2->ea, sh2->r[m] & 0x0000ffff ); -} - -/* MOV.L Rm,@(R0,Rn) */ -SH2_INLINE void MOVLS0(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[n] + sh2->r[0]; - WL( sh2->ea, sh2->r[m] ); -} - -/* MOV.B @(R0,Rm),Rn */ -SH2_INLINE void MOVBL0(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[m] + sh2->r[0]; - sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->ea ); -} - -/* MOV.W @(R0,Rm),Rn */ -SH2_INLINE void MOVWL0(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[m] + sh2->r[0]; - sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2->ea ); -} - -/* MOV.L @(R0,Rm),Rn */ -SH2_INLINE void MOVLL0(UINT32 m, UINT32 n) -{ - sh2->ea = sh2->r[m] + sh2->r[0]; - sh2->r[n] = RL( sh2->ea ); -} - -/* MOV #imm,Rn */ -SH2_INLINE void MOVI(UINT32 i, UINT32 n) -{ - sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) i; -} - -/* MOV.W @(disp8,PC),Rn */ -SH2_INLINE void MOVWI(UINT32 d, UINT32 n) -{ - UINT32 disp = d & 0xff; - sh2->ea = sh2->pc + disp * 2 + 2; - sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2->ea ); -} - -/* MOV.L @(disp8,PC),Rn */ -SH2_INLINE void MOVLI(UINT32 d, UINT32 n) -{ - UINT32 disp = d & 0xff; - sh2->ea = ((sh2->pc + 2) & ~3) + disp * 4; - sh2->r[n] = RL( sh2->ea ); -} - -/* MOV.B @(disp8,GBR),R0 */ -SH2_INLINE void MOVBLG(UINT32 d) -{ - UINT32 disp = d & 0xff; - sh2->ea = sh2->gbr + disp; - sh2->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->ea ); -} - -/* MOV.W @(disp8,GBR),R0 */ -SH2_INLINE void MOVWLG(UINT32 d) -{ - UINT32 disp = d & 0xff; - sh2->ea = sh2->gbr + disp * 2; - sh2->r[0] = (INT32)(INT16) RW( sh2->ea ); -} - -/* MOV.L @(disp8,GBR),R0 */ -SH2_INLINE void MOVLLG(UINT32 d) -{ - UINT32 disp = d & 0xff; - sh2->ea = sh2->gbr + disp * 4; - sh2->r[0] = RL( sh2->ea ); -} - -/* MOV.B R0,@(disp8,GBR) */ -SH2_INLINE void MOVBSG(UINT32 d) -{ - UINT32 disp = d & 0xff; - sh2->ea = sh2->gbr + disp; - WB( sh2->ea, sh2->r[0] & 0x000000ff ); -} - -/* MOV.W R0,@(disp8,GBR) */ -SH2_INLINE void MOVWSG(UINT32 d) -{ - UINT32 disp = d & 0xff; - sh2->ea = sh2->gbr + disp * 2; - WW( sh2->ea, sh2->r[0] & 0x0000ffff ); -} - -/* MOV.L R0,@(disp8,GBR) */ -SH2_INLINE void MOVLSG(UINT32 d) -{ - UINT32 disp = d & 0xff; - sh2->ea = sh2->gbr + disp * 4; - WL( sh2->ea, sh2->r[0] ); -} - -/* MOV.B R0,@(disp4,Rn) */ -SH2_INLINE void MOVBS4(UINT32 d, UINT32 n) -{ - UINT32 disp = d & 0x0f; - sh2->ea = sh2->r[n] + disp; - WB( sh2->ea, sh2->r[0] & 0x000000ff ); -} - -/* MOV.W R0,@(disp4,Rn) */ -SH2_INLINE void MOVWS4(UINT32 d, UINT32 n) -{ - UINT32 disp = d & 0x0f; - sh2->ea = sh2->r[n] + disp * 2; - WW( sh2->ea, sh2->r[0] & 0x0000ffff ); -} - -/* MOV.L Rm,@(disp4,Rn) */ -SH2_INLINE void MOVLS4(UINT32 m, UINT32 d, UINT32 n) -{ - UINT32 disp = d & 0x0f; - sh2->ea = sh2->r[n] + disp * 4; - WL( sh2->ea, sh2->r[m] ); -} - -/* MOV.B @(disp4,Rm),R0 */ -SH2_INLINE void MOVBL4(UINT32 m, UINT32 d) -{ - UINT32 disp = d & 0x0f; - sh2->ea = sh2->r[m] + disp; - sh2->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->ea ); -} - -/* MOV.W @(disp4,Rm),R0 */ -SH2_INLINE void MOVWL4(UINT32 m, UINT32 d) -{ - UINT32 disp = d & 0x0f; - sh2->ea = sh2->r[m] + disp * 2; - sh2->r[0] = (UINT32)(INT32)(INT16) RW( sh2->ea ); -} - -/* MOV.L @(disp4,Rm),Rn */ -SH2_INLINE void MOVLL4(UINT32 m, UINT32 d, UINT32 n) -{ - UINT32 disp = d & 0x0f; - sh2->ea = sh2->r[m] + disp * 4; - sh2->r[n] = RL( sh2->ea ); -} - -/* MOVA @(disp8,PC),R0 */ -SH2_INLINE void MOVA(UINT32 d) -{ - UINT32 disp = d & 0xff; - sh2->ea = ((sh2->pc + 2) & ~3) + disp * 4; - sh2->r[0] = sh2->ea; -} - -/* MOVT Rn */ -SH2_INLINE void MOVT(UINT32 n) -{ - sh2->r[n] = sh2->sr & T; -} - -/* MUL.L Rm,Rn */ -SH2_INLINE void MULL(UINT32 m, UINT32 n) -{ - sh2->macl = sh2->r[n] * sh2->r[m]; - sh2->sh2_icount--; -} - -/* MULS Rm,Rn */ -SH2_INLINE void MULS(UINT32 m, UINT32 n) -{ - sh2->macl = (INT16) sh2->r[n] * (INT16) sh2->r[m]; -} - -/* MULU Rm,Rn */ -SH2_INLINE void MULU(UINT32 m, UINT32 n) -{ - sh2->macl = (UINT16) sh2->r[n] * (UINT16) sh2->r[m]; -} - -/* NEG Rm,Rn */ -SH2_INLINE void NEG(UINT32 m, UINT32 n) -{ - sh2->r[n] = 0 - sh2->r[m]; -} - -/* NEGC Rm,Rn */ -SH2_INLINE void NEGC(UINT32 m, UINT32 n) -{ - UINT32 temp; - - temp = sh2->r[m]; - sh2->r[n] = -temp - (sh2->sr & T); - if (temp || (sh2->sr & T)) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* NOP */ -SH2_INLINE void NOP(void) -{ -} - -/* NOT Rm,Rn */ -SH2_INLINE void NOT(UINT32 m, UINT32 n) -{ - sh2->r[n] = ~sh2->r[m]; -} - -/* OR Rm,Rn */ -SH2_INLINE void OR(UINT32 m, UINT32 n) -{ - sh2->r[n] |= sh2->r[m]; -} - -/* OR #imm,R0 */ -SH2_INLINE void ORI(UINT32 i) -{ - sh2->r[0] |= i; -} - -/* OR.B #imm,@(R0,GBR) */ -SH2_INLINE void ORM(UINT32 i) -{ - UINT32 temp; - - sh2->ea = sh2->gbr + sh2->r[0]; - temp = RB( sh2->ea ); - temp |= i; - WB( sh2->ea, temp ); - sh2->sh2_icount -= 2; -} - -/* ROTCL Rn */ -SH2_INLINE void ROTCL(UINT32 n) -{ - UINT32 temp; - - temp = (sh2->r[n] >> 31) & T; - sh2->r[n] = (sh2->r[n] << 1) | (sh2->sr & T); - sh2->sr = (sh2->sr & ~T) | temp; -} - -/* ROTCR Rn */ -SH2_INLINE void ROTCR(UINT32 n) -{ - UINT32 temp; - temp = (sh2->sr & T) << 31; - if (sh2->r[n] & T) - sh2->sr |= T; - else - sh2->sr &= ~T; - sh2->r[n] = (sh2->r[n] >> 1) | temp; -} - -/* ROTL Rn */ -SH2_INLINE void ROTL(UINT32 n) -{ - sh2->sr = (sh2->sr & ~T) | ((sh2->r[n] >> 31) & T); - sh2->r[n] = (sh2->r[n] << 1) | (sh2->r[n] >> 31); -} - -/* ROTR Rn */ -SH2_INLINE void ROTR(UINT32 n) -{ - sh2->sr = (sh2->sr & ~T) | (sh2->r[n] & T); - sh2->r[n] = (sh2->r[n] >> 1) | (sh2->r[n] << 31); -} - -/* RTE */ -SH2_INLINE void RTE(void) -{ - sh2->ea = sh2->r[15]; - sh2->delay = sh2->pc; - sh2->pc = RL( sh2->ea ); - sh2->r[15] += 4; - sh2->ea = sh2->r[15]; - sh2->sr = RL( sh2->ea ) & FLAGS; - sh2->r[15] += 4; - sh2->sh2_icount -= 3; - sh2->test_irq = 1; -} - -/* RTS */ -SH2_INLINE void RTS(void) -{ - sh2->delay = sh2->pc; - sh2->pc = sh2->ea = sh2->pr; - sh2->sh2_icount--; -} - -/* SETT */ -SH2_INLINE void SETT(void) -{ - sh2->sr |= T; -} - -/* SHAL Rn (same as SHLL) */ -SH2_INLINE void SHAL(UINT32 n) -{ - sh2->sr = (sh2->sr & ~T) | ((sh2->r[n] >> 31) & T); - sh2->r[n] <<= 1; -} - -/* SHAR Rn */ -SH2_INLINE void SHAR(UINT32 n) -{ - sh2->sr = (sh2->sr & ~T) | (sh2->r[n] & T); - sh2->r[n] = (UINT32)((INT32)sh2->r[n] >> 1); -} - -/* SHLL Rn (same as SHAL) */ -SH2_INLINE void SHLL(UINT32 n) -{ - sh2->sr = (sh2->sr & ~T) | ((sh2->r[n] >> 31) & T); - sh2->r[n] <<= 1; -} - -/* SHLL2 Rn */ -SH2_INLINE void SHLL2(UINT32 n) -{ - sh2->r[n] <<= 2; -} - -/* SHLL8 Rn */ -SH2_INLINE void SHLL8(UINT32 n) -{ - sh2->r[n] <<= 8; -} - -/* SHLL16 Rn */ -SH2_INLINE void SHLL16(UINT32 n) -{ - sh2->r[n] <<= 16; -} - -/* SHLR Rn */ -SH2_INLINE void SHLR(UINT32 n) -{ - sh2->sr = (sh2->sr & ~T) | (sh2->r[n] & T); - sh2->r[n] >>= 1; -} - -/* SHLR2 Rn */ -SH2_INLINE void SHLR2(UINT32 n) -{ - sh2->r[n] >>= 2; -} - -/* SHLR8 Rn */ -SH2_INLINE void SHLR8(UINT32 n) -{ - sh2->r[n] >>= 8; -} - -/* SHLR16 Rn */ -SH2_INLINE void SHLR16(UINT32 n) -{ - sh2->r[n] >>= 16; -} - -/* SLEEP */ -SH2_INLINE void SLEEP(void) -{ - sh2->pc -= 2; - sh2->sh2_icount -= 2; - /* Wait_for_exception; */ -} - -/* STC SR,Rn */ -SH2_INLINE void STCSR(UINT32 n) -{ - sh2->r[n] = sh2->sr; -} - -/* STC GBR,Rn */ -SH2_INLINE void STCGBR(UINT32 n) -{ - sh2->r[n] = sh2->gbr; -} - -/* STC VBR,Rn */ -SH2_INLINE void STCVBR(UINT32 n) -{ - sh2->r[n] = sh2->vbr; -} - -/* STC.L SR,@-Rn */ -SH2_INLINE void STCMSR(UINT32 n) -{ - sh2->r[n] -= 4; - sh2->ea = sh2->r[n]; - WL( sh2->ea, sh2->sr ); - sh2->sh2_icount--; -} - -/* STC.L GBR,@-Rn */ -SH2_INLINE void STCMGBR(UINT32 n) -{ - sh2->r[n] -= 4; - sh2->ea = sh2->r[n]; - WL( sh2->ea, sh2->gbr ); - sh2->sh2_icount--; -} - -/* STC.L VBR,@-Rn */ -SH2_INLINE void STCMVBR(UINT32 n) -{ - sh2->r[n] -= 4; - sh2->ea = sh2->r[n]; - WL( sh2->ea, sh2->vbr ); - sh2->sh2_icount--; -} - -/* STS MACH,Rn */ -SH2_INLINE void STSMACH(UINT32 n) -{ - sh2->r[n] = sh2->mach; -} - -/* STS MACL,Rn */ -SH2_INLINE void STSMACL(UINT32 n) -{ - sh2->r[n] = sh2->macl; -} - -/* STS PR,Rn */ -SH2_INLINE void STSPR(UINT32 n) -{ - sh2->r[n] = sh2->pr; -} - -/* STS.L MACH,@-Rn */ -SH2_INLINE void STSMMACH(UINT32 n) -{ - sh2->r[n] -= 4; - sh2->ea = sh2->r[n]; - WL( sh2->ea, sh2->mach ); -} - -/* STS.L MACL,@-Rn */ -SH2_INLINE void STSMMACL(UINT32 n) -{ - sh2->r[n] -= 4; - sh2->ea = sh2->r[n]; - WL( sh2->ea, sh2->macl ); -} - -/* STS.L PR,@-Rn */ -SH2_INLINE void STSMPR(UINT32 n) -{ - sh2->r[n] -= 4; - sh2->ea = sh2->r[n]; - WL( sh2->ea, sh2->pr ); -} - -/* SUB Rm,Rn */ -SH2_INLINE void SUB(UINT32 m, UINT32 n) -{ - sh2->r[n] -= sh2->r[m]; -} - -/* SUBC Rm,Rn */ -SH2_INLINE void SUBC(UINT32 m, UINT32 n) -{ - UINT32 tmp0, tmp1; - - tmp1 = sh2->r[n] - sh2->r[m]; - tmp0 = sh2->r[n]; - sh2->r[n] = tmp1 - (sh2->sr & T); - if (tmp0 < tmp1) - sh2->sr |= T; - else - sh2->sr &= ~T; - if (tmp1 < sh2->r[n]) - sh2->sr |= T; -} - -/* SUBV Rm,Rn */ -SH2_INLINE void SUBV(UINT32 m, UINT32 n) -{ - INT32 dest, src, ans; - - if ((INT32) sh2->r[n] >= 0) - dest = 0; - else - dest = 1; - if ((INT32) sh2->r[m] >= 0) - src = 0; - else - src = 1; - src += dest; - sh2->r[n] -= sh2->r[m]; - if ((INT32) sh2->r[n] >= 0) - ans = 0; - else - ans = 1; - ans += dest; - if (src == 1) - { - if (ans == 1) - sh2->sr |= T; - else - sh2->sr &= ~T; - } - else - sh2->sr &= ~T; -} - -/* SWAP.B Rm,Rn */ -SH2_INLINE void SWAPB(UINT32 m, UINT32 n) -{ - UINT32 temp0, temp1; - - temp0 = sh2->r[m] & 0xffff0000; - temp1 = (sh2->r[m] & 0x000000ff) << 8; - sh2->r[n] = (sh2->r[m] >> 8) & 0x000000ff; - sh2->r[n] = sh2->r[n] | temp1 | temp0; -} - -/* SWAP.W Rm,Rn */ -SH2_INLINE void SWAPW(UINT32 m, UINT32 n) -{ - UINT32 temp; - - temp = (sh2->r[m] >> 16) & 0x0000ffff; - sh2->r[n] = (sh2->r[m] << 16) | temp; -} - -/* TAS.B @Rn */ -SH2_INLINE void TAS(UINT32 n) -{ - UINT32 temp; - sh2->ea = sh2->r[n]; - /* Bus Lock enable */ - temp = RB( sh2->ea ); - if (temp == 0) - sh2->sr |= T; - else - sh2->sr &= ~T; - temp |= 0x80; - /* Bus Lock disable */ - WB( sh2->ea, temp ); - sh2->sh2_icount -= 3; -} - -/* TRAPA #imm */ -SH2_INLINE void TRAPA(UINT32 i) -{ - UINT32 imm = i & 0xff; - - sh2->ea = sh2->vbr + imm * 4; - - sh2->r[15] -= 4; - WL( sh2->r[15], sh2->sr ); - sh2->r[15] -= 4; - WL( sh2->r[15], sh2->pc ); - - sh2->pc = RL( sh2->ea ); - change_pc(sh2->pc & AM); - - sh2->sh2_icount -= 7; -} - -/* TST Rm,Rn */ -SH2_INLINE void TST(UINT32 m, UINT32 n) -{ - if ((sh2->r[n] & sh2->r[m]) == 0) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* TST #imm,R0 */ -SH2_INLINE void TSTI(UINT32 i) -{ - UINT32 imm = i & 0xff; - - if ((imm & sh2->r[0]) == 0) - sh2->sr |= T; - else - sh2->sr &= ~T; -} - -/* TST.B #imm,@(R0,GBR) */ -SH2_INLINE void TSTM(UINT32 i) -{ - UINT32 imm = i & 0xff; - - sh2->ea = sh2->gbr + sh2->r[0]; - if ((imm & RB( sh2->ea )) == 0) - sh2->sr |= T; - else - sh2->sr &= ~T; - sh2->sh2_icount -= 2; -} - -/* XOR Rm,Rn */ -SH2_INLINE void XOR(UINT32 m, UINT32 n) -{ - sh2->r[n] ^= sh2->r[m]; -} - -/* XOR #imm,R0 */ -SH2_INLINE void XORI(UINT32 i) -{ - UINT32 imm = i & 0xff; - sh2->r[0] ^= imm; -} - -/* XOR.B #imm,@(R0,GBR) */ -SH2_INLINE void XORM(UINT32 i) -{ - UINT32 imm = i & 0xff; - UINT32 temp; - - sh2->ea = sh2->gbr + sh2->r[0]; - temp = RB( sh2->ea ); - temp ^= imm; - WB( sh2->ea, temp ); - sh2->sh2_icount -= 2; -} - -/* XTRCT Rm,Rn */ -SH2_INLINE void XTRCT(UINT32 m, UINT32 n) -{ - UINT32 temp; - - temp = (sh2->r[m] << 16) & 0xffff0000; - sh2->r[n] = (sh2->r[n] >> 16) & 0x0000ffff; - sh2->r[n] |= temp; -} - -/***************************************************************************** - * OPCODE DISPATCHERS - *****************************************************************************/ - -SH2_INLINE void op0000(UINT16 opcode) -{ - switch (opcode & 0x3F) - { - case 0x00: NOP(); break; - case 0x01: NOP(); break; - case 0x02: STCSR(Rn); break; - case 0x03: BSRF(Rn); break; - case 0x04: MOVBS0(Rm, Rn); break; - case 0x05: MOVWS0(Rm, Rn); break; - case 0x06: MOVLS0(Rm, Rn); break; - case 0x07: MULL(Rm, Rn); break; - case 0x08: CLRT(); break; - case 0x09: NOP(); break; - case 0x0a: STSMACH(Rn); break; - case 0x0b: RTS(); break; - case 0x0c: MOVBL0(Rm, Rn); break; - case 0x0d: MOVWL0(Rm, Rn); break; - case 0x0e: MOVLL0(Rm, Rn); break; - case 0x0f: MAC_L(Rm, Rn); break; - - case 0x10: NOP(); break; - case 0x11: NOP(); break; - case 0x12: STCGBR(Rn); break; - case 0x13: NOP(); break; - case 0x14: MOVBS0(Rm, Rn); break; - case 0x15: MOVWS0(Rm, Rn); break; - case 0x16: MOVLS0(Rm, Rn); break; - case 0x17: MULL(Rm, Rn); break; - case 0x18: SETT(); break; - case 0x19: DIV0U(); break; - case 0x1a: STSMACL(Rn); break; - case 0x1b: SLEEP(); break; - case 0x1c: MOVBL0(Rm, Rn); break; - case 0x1d: MOVWL0(Rm, Rn); break; - case 0x1e: MOVLL0(Rm, Rn); break; - case 0x1f: MAC_L(Rm, Rn); break; - - case 0x20: NOP(); break; - case 0x21: NOP(); break; - case 0x22: STCVBR(Rn); break; - case 0x23: BRAF(Rn); break; - case 0x24: MOVBS0(Rm, Rn); break; - case 0x25: MOVWS0(Rm, Rn); break; - case 0x26: MOVLS0(Rm, Rn); break; - case 0x27: MULL(Rm, Rn); break; - case 0x28: CLRMAC(); break; - case 0x29: MOVT(Rn); break; - case 0x2a: STSPR(Rn); break; - case 0x2b: RTE(); break; - case 0x2c: MOVBL0(Rm, Rn); break; - case 0x2d: MOVWL0(Rm, Rn); break; - case 0x2e: MOVLL0(Rm, Rn); break; - case 0x2f: MAC_L(Rm, Rn); break; - - case 0x30: NOP(); break; - case 0x31: NOP(); break; - case 0x32: NOP(); break; - case 0x33: NOP(); break; - case 0x34: MOVBS0(Rm, Rn); break; - case 0x35: MOVWS0(Rm, Rn); break; - case 0x36: MOVLS0(Rm, Rn); break; - case 0x37: MULL(Rm, Rn); break; - case 0x38: NOP(); break; - case 0x39: NOP(); break; - case 0x3a: NOP(); break; - case 0x3b: NOP(); break; - case 0x3c: MOVBL0(Rm, Rn); break; - case 0x3d: MOVWL0(Rm, Rn); break; - case 0x3e: MOVLL0(Rm, Rn); break; - case 0x3f: MAC_L(Rm, Rn); break; - - - - } -} - -SH2_INLINE void op0001(UINT16 opcode) -{ - MOVLS4(Rm, opcode & 0x0f, Rn); -} - -SH2_INLINE void op0010(UINT16 opcode) -{ - switch (opcode & 15) - { - case 0: MOVBS(Rm, Rn); break; - case 1: MOVWS(Rm, Rn); break; - case 2: MOVLS(Rm, Rn); break; - case 3: NOP(); break; - case 4: MOVBM(Rm, Rn); break; - case 5: MOVWM(Rm, Rn); break; - case 6: MOVLM(Rm, Rn); break; - case 7: DIV0S(Rm, Rn); break; - case 8: TST(Rm, Rn); break; - case 9: AND(Rm, Rn); break; - case 10: XOR(Rm, Rn); break; - case 11: OR(Rm, Rn); break; - case 12: CMPSTR(Rm, Rn); break; - case 13: XTRCT(Rm, Rn); break; - case 14: MULU(Rm, Rn); break; - case 15: MULS(Rm, Rn); break; - } -} - -SH2_INLINE void op0011(UINT16 opcode) -{ - switch (opcode & 15) - { - case 0: CMPEQ(Rm, Rn); break; - case 1: NOP(); break; - case 2: CMPHS(Rm, Rn); break; - case 3: CMPGE(Rm, Rn); break; - case 4: DIV1(Rm, Rn); break; - case 5: DMULU(Rm, Rn); break; - case 6: CMPHI(Rm, Rn); break; - case 7: CMPGT(Rm, Rn); break; - case 8: SUB(Rm, Rn); break; - case 9: NOP(); break; - case 10: SUBC(Rm, Rn); break; - case 11: SUBV(Rm, Rn); break; - case 12: ADD(Rm, Rn); break; - case 13: DMULS(Rm, Rn); break; - case 14: ADDC(Rm, Rn); break; - case 15: ADDV(Rm, Rn); break; - } -} - -SH2_INLINE void op0100(UINT16 opcode) -{ - switch (opcode & 0x3F) - { - case 0x00: SHLL(Rn); break; - case 0x01: SHLR(Rn); break; - case 0x02: STSMMACH(Rn); break; - case 0x03: STCMSR(Rn); break; - case 0x04: ROTL(Rn); break; - case 0x05: ROTR(Rn); break; - case 0x06: LDSMMACH(Rn); break; - case 0x07: LDCMSR(Rn); break; - case 0x08: SHLL2(Rn); break; - case 0x09: SHLR2(Rn); break; - case 0x0a: LDSMACH(Rn); break; - case 0x0b: JSR(Rn); break; - case 0x0c: NOP(); break; - case 0x0d: NOP(); break; - case 0x0e: LDCSR(Rn); break; - case 0x0f: MAC_W(Rm, Rn); break; - - case 0x10: DT(Rn); break; - case 0x11: CMPPZ(Rn); break; - case 0x12: STSMMACL(Rn); break; - case 0x13: STCMGBR(Rn); break; - case 0x14: NOP(); break; - case 0x15: CMPPL(Rn); break; - case 0x16: LDSMMACL(Rn); break; - case 0x17: LDCMGBR(Rn); break; - case 0x18: SHLL8(Rn); break; - case 0x19: SHLR8(Rn); break; - case 0x1a: LDSMACL(Rn); break; - case 0x1b: TAS(Rn); break; - case 0x1c: NOP(); break; - case 0x1d: NOP(); break; - case 0x1e: LDCGBR(Rn); break; - case 0x1f: MAC_W(Rm, Rn); break; - - case 0x20: SHAL(Rn); break; - case 0x21: SHAR(Rn); break; - case 0x22: STSMPR(Rn); break; - case 0x23: STCMVBR(Rn); break; - case 0x24: ROTCL(Rn); break; - case 0x25: ROTCR(Rn); break; - case 0x26: LDSMPR(Rn); break; - case 0x27: LDCMVBR(Rn); break; - case 0x28: SHLL16(Rn); break; - case 0x29: SHLR16(Rn); break; - case 0x2a: LDSPR(Rn); break; - case 0x2b: JMP(Rn); break; - case 0x2c: NOP(); break; - case 0x2d: NOP(); break; - case 0x2e: LDCVBR(Rn); break; - case 0x2f: MAC_W(Rm, Rn); break; - - case 0x30: NOP(); break; - case 0x31: NOP(); break; - case 0x32: NOP(); break; - case 0x33: NOP(); break; - case 0x34: NOP(); break; - case 0x35: NOP(); break; - case 0x36: NOP(); break; - case 0x37: NOP(); break; - case 0x38: NOP(); break; - case 0x39: NOP(); break; - case 0x3a: NOP(); break; - case 0x3b: NOP(); break; - case 0x3c: NOP(); break; - case 0x3d: NOP(); break; - case 0x3e: NOP(); break; - case 0x3f: MAC_W(Rm, Rn); break; - - } -} - -SH2_INLINE void op0101(UINT16 opcode) -{ - MOVLL4(Rm, opcode & 0x0f, Rn); -} - -SH2_INLINE void op0110(UINT16 opcode) -{ - switch (opcode & 15) - { - case 0: MOVBL(Rm, Rn); break; - case 1: MOVWL(Rm, Rn); break; - case 2: MOVLL(Rm, Rn); break; - case 3: MOV(Rm, Rn); break; - case 4: MOVBP(Rm, Rn); break; - case 5: MOVWP(Rm, Rn); break; - case 6: MOVLP(Rm, Rn); break; - case 7: NOT(Rm, Rn); break; - case 8: SWAPB(Rm, Rn); break; - case 9: SWAPW(Rm, Rn); break; - case 10: NEGC(Rm, Rn); break; - case 11: NEG(Rm, Rn); break; - case 12: EXTUB(Rm, Rn); break; - case 13: EXTUW(Rm, Rn); break; - case 14: EXTSB(Rm, Rn); break; - case 15: EXTSW(Rm, Rn); break; - } -} - -SH2_INLINE void op0111(UINT16 opcode) -{ - ADDI(opcode & 0xff, Rn); -} - -SH2_INLINE void op1000(UINT16 opcode) -{ - switch ( opcode & (15<<8) ) - { - case 0 << 8: MOVBS4(opcode & 0x0f, Rm); break; - case 1 << 8: MOVWS4(opcode & 0x0f, Rm); break; - case 2<< 8: NOP(); break; - case 3<< 8: NOP(); break; - case 4<< 8: MOVBL4(Rm, opcode & 0x0f); break; - case 5<< 8: MOVWL4(Rm, opcode & 0x0f); break; - case 6<< 8: NOP(); break; - case 7<< 8: NOP(); break; - case 8<< 8: CMPIM(opcode & 0xff); break; - case 9<< 8: BT(opcode & 0xff); break; - case 10<< 8: NOP(); break; - case 11<< 8: BF(opcode & 0xff); break; - case 12<< 8: NOP(); break; - case 13<< 8: BTS(opcode & 0xff); break; - case 14<< 8: NOP(); break; - case 15<< 8: BFS(opcode & 0xff); break; - } -} - - -SH2_INLINE void op1001(UINT16 opcode) -{ - MOVWI(opcode & 0xff, Rn); -} - -SH2_INLINE void op1010(UINT16 opcode) -{ - BRA(opcode & 0xfff); -} - -SH2_INLINE void op1011(UINT16 opcode) -{ - BSR(opcode & 0xfff); -} - -SH2_INLINE void op1100(UINT16 opcode) -{ - switch (opcode & (15<<8)) - { - case 0<<8: MOVBSG(opcode & 0xff); break; - case 1<<8: MOVWSG(opcode & 0xff); break; - case 2<<8: MOVLSG(opcode & 0xff); break; - case 3<<8: TRAPA(opcode & 0xff); break; - case 4<<8: MOVBLG(opcode & 0xff); break; - case 5<<8: MOVWLG(opcode & 0xff); break; - case 6<<8: MOVLLG(opcode & 0xff); break; - case 7<<8: MOVA(opcode & 0xff); break; - case 8<<8: TSTI(opcode & 0xff); break; - case 9<<8: ANDI(opcode & 0xff); break; - case 10<<8: XORI(opcode & 0xff); break; - case 11<<8: ORI(opcode & 0xff); break; - case 12<<8: TSTM(opcode & 0xff); break; - case 13<<8: ANDM(opcode & 0xff); break; - case 14<<8: XORM(opcode & 0xff); break; - case 15<<8: ORM(opcode & 0xff); break; - } -} - -SH2_INLINE void op1101(UINT16 opcode) -{ - MOVLI(opcode & 0xff, Rn); -} - -SH2_INLINE void op1110(UINT16 opcode) -{ - MOVI(opcode & 0xff, Rn); -} - -SH2_INLINE void op1111(UINT16 /*opcode*/) -{ - NOP(); -} - -#endif // USE_JUMPTABLE - -/***************************************************************************** - * MAME CPU INTERFACE - *****************************************************************************/ - -static void sh2_timer_resync(void) -{ - int divider = div_tab[(sh2->m[5] >> 8) & 3]; - UINT32 cur_time = sh2_GetTotalCycles(); - - if(divider) - sh2->frc += (cur_time - sh2->frc_base) >> divider; - sh2->frc_base = cur_time; -} - -static void sh2_timer_activate(void) -{ - int max_delta = 0xfffff; - UINT16 frc; - - //timer_adjust(sh2->timer, attotime_never, 0, attotime_zero); - sh2->timer_active = 0; -// sh2->timer_cycles = 0; - - frc = sh2->frc; - if(!(sh2->m[4] & OCFA)) { - UINT16 delta = sh2->ocra - frc; - if(delta < max_delta) - max_delta = delta; - } - - if(!(sh2->m[4] & OCFB) && (sh2->ocra <= sh2->ocrb || !(sh2->m[4] & 0x010000))) { - UINT16 delta = sh2->ocrb - frc; - if(delta < max_delta) - max_delta = delta; - } - - if(!(sh2->m[4] & OVF) && !(sh2->m[4] & 0x010000)) { - int delta = 0x10000 - frc; - if(delta < max_delta) - max_delta = delta; - } - - if(max_delta != 0xfffff) { - int divider = div_tab[(sh2->m[5] >> 8) & 3]; - if(divider) { - max_delta <<= divider; - sh2->frc_base = sh2_GetTotalCycles(); - - //timer_adjust(sh2->timer, ATTOTIME_IN_CYCLES(max_delta, sh2->cpu_number), sh2->cpu_number, attotime_zero); - //bprintf(0, _T("SH2 Timer Actived %d\n"), max_delta); - - sh2->timer_active = 1; - sh2->timer_cycles = max_delta; - sh2->timer_base = sh2->frc_base; - - } else { - //bprintf(0, _T("SH2.0: Timer event in %d cycles of external clock\n"), max_delta); - } - } -} - -static void sh2_recalc_irq(void) -{ - int irq = 0, vector = -1; - int level; - - // Timer irqs - if((sh2->m[4]>>8) & sh2->m[4] & (ICF|OCFA|OCFB|OVF)) - { - level = (sh2->m[0x18] >> 24) & 15; - if(level > irq) - { - int mask = (sh2->m[4]>>8) & sh2->m[4]; - irq = level; - if(mask & ICF) - vector = (sh2->m[0x19] >> 8) & 0x7f; - else if(mask & (OCFA|OCFB)) - vector = sh2->m[0x19] & 0x7f; - else - vector = (sh2->m[0x1a] >> 24) & 0x7f; - } - } - - // DMA irqs - if((sh2->m[0x63] & 6) == 6) { - level = (sh2->m[0x38] >> 8) & 15; - if(level > irq) { - irq = level; - vector = (sh2->m[0x68] >> 24) & 0x7f; - } - } - - if((sh2->m[0x67] & 6) == 6) { - level = (sh2->m[0x38] >> 8) & 15; - if(level > irq) { - irq = level; - vector = (sh2->m[0x6a] >> 24) & 0x7f; - } - } - - - sh2->internal_irq_level = irq; - sh2->internal_irq_vector = vector; - sh2->test_irq = 1; -} - -static void sh2_timer_callback() -{ - UINT16 frc; -// int cpunum = param; -// cpuintrf_push_context(cpunum); - sh2_timer_resync(); - - frc = sh2->frc; - - if(frc == sh2->ocrb) - sh2->m[4] |= OCFB; - - if(frc == 0x0000) - sh2->m[4] |= OVF; - - if(frc == sh2->ocra) - { - sh2->m[4] |= OCFA; - - if(sh2->m[4] & 0x010000) - sh2->frc = 0; - } - - sh2_recalc_irq(); - sh2_timer_activate(); -// cpuintrf_pop_context(); -} - -static void sh2_dmac_callback(int dma) -{ -// cpuintrf_push_context(cpunum); - -// LOG(("SH2.%d: DMA %d complete\n", cpunum, dma)); - //bprintf(0, _T("SH2: DMA %d complete at %d\n"), dma, sh2_GetTotalCycles()); - - sh2->m[0x63+4*dma] |= 2; - sh2->dma_timer_active[dma] = 0; - sh2_recalc_irq(); - -// cpuintrf_pop_context(); -} - -static void sh2_dmac_check(int dma) -{ - if(sh2->m[0x63+4*dma] & sh2->m[0x6c] & 1) - { - if(!sh2->dma_timer_active[dma] && !(sh2->m[0x63+4*dma] & 2)) - { - int incs, incd, size; - UINT32 src, dst, count; - incd = (sh2->m[0x63+4*dma] >> 14) & 3; - incs = (sh2->m[0x63+4*dma] >> 12) & 3; - size = (sh2->m[0x63+4*dma] >> 10) & 3; - if(incd == 3 || incs == 3) - { -// logerror("SH2: DMA: bad increment values (%d, %d, %d, %04x)\n", incd, incs, size, sh2->m[0x63+4*dma]); - //bprintf(0, _T("SH2: DMA: bad increment values (%d, %d, %d, %04x)\n"), incd, incs, size, sh2->m[0x63+4*dma]); - return; - } - src = sh2->m[0x60+4*dma]; - dst = sh2->m[0x61+4*dma]; - count = sh2->m[0x62+4*dma]; - if(!count) - count = 0x1000000; - -// LOG(("SH2: DMA %d start %x, %x, %x, %04x, %d, %d, %d\n", dma, src, dst, count, sh2->m[0x63+4*dma], incs, incd, size)); - //bprintf(1, _T("DMA %d start %08x, %08x, %x, %04x, %d, %d, %d : %d cys from %d\n"), dma, src, dst, count, sh2->m[0x63+4*dma], incs, incd, size, 2*count+1, Sh2GetTotalCycles()); - - sh2->dma_timer_active[dma] = 1; - //timer_adjust(sh2->dma_timer[dma], ATTOTIME_IN_CYCLES(2*count+1, sh2->cpu_number), (sh2->cpu_number<<1)|dma, attotime_zero); - sh2->dma_timer_cycles[dma] = 2 * count + 1; - sh2->dma_timer_base[dma] = sh2_GetTotalCycles(); - - src &= AM; - dst &= AM; - - switch(size) - { - case 0: - for(;count > 0; count --) - { - if(incs == 2) - src --; - if(incd == 2) - dst --; - program_write_byte_32be(dst, program_read_byte_32be(src)); - if(incs == 1) - src ++; - if(incd == 1) - dst ++; - } - break; - case 1: - src &= ~1; - dst &= ~1; - for(;count > 0; count --) - { - if(incs == 2) - src -= 2; - if(incd == 2) - dst -= 2; - program_write_word_32be(dst, program_read_word_32be(src)); - if(incs == 1) - src += 2; - if(incd == 1) - dst += 2; - } - break; - case 2: - src &= ~3; - dst &= ~3; - for(;count > 0; count --) - { - if(incs == 2) - src -= 4; - if(incd == 2) - dst -= 4; - - //program_write_dword_32be(dst, program_read_dword_32be(src)); - WL(dst, RL(src)); - - if(incs == 1) - src += 4; - if(incd == 1) - dst += 4; - - } - break; - case 3: - src &= ~3; - dst &= ~3; - count &= ~3; - for(;count > 0; count -= 4) - { - if(incd == 2) - dst -= 16; - program_write_dword_32be(dst, program_read_dword_32be(src)); - program_write_dword_32be(dst+4, program_read_dword_32be(src+4)); - program_write_dword_32be(dst+8, program_read_dword_32be(src+8)); - program_write_dword_32be(dst+12, program_read_dword_32be(src+12)); - src += 16; - if(incd == 1) - dst += 16; - } - break; - } - } - } - else - { - if(sh2->dma_timer_active[dma]) - { -// logerror("SH2: DMA %d cancelled in-flight", dma); - //bprintf(0, _T("SH2: DMA %d cancelled in-flight"), dma); - //timer_adjust(sh2->dma_timer[dma], attotime_never, 0, attotime_zero); - sh2->dma_timer_active[dma] = 0; - - } - } -} - - -static void sh2_internal_w(UINT32 offset, UINT32 data, UINT32 mem_mask) -{ - UINT32 old = sh2->m[offset]; - COMBINE_DATA(sh2->m+offset); - - // if(offset != 0x20) - // logerror("sh2_internal_w: Write %08x (%x), %08x @ %08x\n", 0xfffffe00+offset*4, offset, data, mem_mask); - - switch( offset ) - { - // Timers - case 0x04: // TIER, FTCSR, FRC - if((mem_mask & 0x00ffffff) != 0xffffff) - sh2_timer_resync(); - //logerror("SH2.%d: TIER write %04x @ %04x\n", sh2->cpu_number, data >> 16, mem_mask>>16); - sh2->m[4] = (sh2->m[4] & ~(ICF|OCFA|OCFB|OVF)) | (old & sh2->m[4] & (ICF|OCFA|OCFB|OVF)); - COMBINE_DATA(&sh2->frc); - if((mem_mask & 0x00ffffff) != 0xffffff) - sh2_timer_activate(); - sh2_recalc_irq(); - break; - case 0x05: // OCRx, TCR, TOCR - //logerror("SH2.%d: TCR write %08x @ %08x\n", sh2->cpu_number, data, mem_mask); - sh2_timer_resync(); - if(sh2->m[5] & 0x10) - sh2->ocrb = (sh2->ocrb & (mem_mask >> 16)) | ((data & ~mem_mask) >> 16); - else - sh2->ocra = (sh2->ocra & (mem_mask >> 16)) | ((data & ~mem_mask) >> 16); - sh2_timer_activate(); - break; - - case 0x06: // ICR - break; - - // Interrupt vectors - case 0x18: // IPRB, VCRA - case 0x19: // VCRB, VCRC - case 0x1a: // VCRD - sh2_recalc_irq(); - break; - - // DMA - case 0x1c: // DRCR0, DRCR1 - break; - - // Watchdog - case 0x20: // WTCNT, RSTCSR - break; - - // Standby and cache - case 0x24: // SBYCR, CCR - break; - - // Interrupt vectors cont. - case 0x38: // ICR, IRPA - break; - case 0x39: // VCRWDT - break; - - // Division box - case 0x40: // DVSR - break; - case 0x41: // DVDNT - { - INT32 a = sh2->m[0x41]; - INT32 b = sh2->m[0x40]; -// LOG(("SH2 #%d div+mod %d/%d\n", cpu_getactivecpu(), a, b)); - if (b) - { - sh2->m[0x45] = a / b; - sh2->m[0x44] = a % b; - } - else - { - sh2->m[0x42] |= 0x00010000; - sh2->m[0x45] = 0x7fffffff; - sh2->m[0x44] = 0x7fffffff; - sh2_recalc_irq(); - } - break; - } - case 0x42: // DVCR - sh2->m[0x42] = (sh2->m[0x42] & ~0x00001000) | (old & sh2->m[0x42] & 0x00010000); - sh2_recalc_irq(); - break; - case 0x43: // VCRDIV - sh2_recalc_irq(); - break; - case 0x44: // DVDNTH - break; - case 0x45: // DVDNTL - { - INT64 a = sh2->m[0x45] | ((UINT64)(sh2->m[0x44]) << 32); - INT64 b = (INT32)sh2->m[0x40]; -// LOG(("SH2 #%d div+mod %lld/%lld\n", cpu_getactivecpu(), a, b)); - if (b) - { - INT64 q = a / b; - if (q != (INT32)q) - { - sh2->m[0x42] |= 0x00010000; - sh2->m[0x45] = 0x7fffffff; - sh2->m[0x44] = 0x7fffffff; - sh2_recalc_irq(); - } - else - { - sh2->m[0x45] = q; - sh2->m[0x44] = a % b; - } - } - else - { - sh2->m[0x42] |= 0x00010000; - sh2->m[0x45] = 0x7fffffff; - sh2->m[0x44] = 0x7fffffff; - sh2_recalc_irq(); - } - break; - } - - // DMA controller - case 0x60: // SAR0 - case 0x61: // DAR0 - break; - case 0x62: // DTCR0 - sh2->m[0x62] &= 0xffffff; - break; - case 0x63: // CHCR0 - sh2->m[0x63] = (sh2->m[0x63] & ~2) | (old & sh2->m[0x63] & 2); - sh2_dmac_check(0); - break; - case 0x64: // SAR1 - case 0x65: // DAR1 - break; - case 0x66: // DTCR1 - sh2->m[0x66] &= 0xffffff; - break; - case 0x67: // CHCR1 - sh2->m[0x67] = (sh2->m[0x67] & ~2) | (old & sh2->m[0x67] & 2); - sh2_dmac_check(1); - break; - case 0x68: // VCRDMA0 - case 0x6a: // VCRDMA1 - sh2_recalc_irq(); - break; - case 0x6c: // DMAOR - sh2->m[0x6c] = (sh2->m[0x6c] & ~6) | (old & sh2->m[0x6c] & 6); - sh2_dmac_check(0); - sh2_dmac_check(1); - break; - - // Bus controller - case 0x78: // BCR1 - case 0x79: // BCR2 - case 0x7a: // WCR - case 0x7b: // MCR - case 0x7c: // RTCSR - case 0x7d: // RTCNT - case 0x7e: // RTCOR - break; - - default: - //logerror("sh2_internal_w: Unmapped write %08x, %08x @ %08x\n", 0xfffffe00+offset*4, data, mem_mask); - break; - } -} - -static UINT32 sh2_internal_r(UINT32 offset, UINT32 /*mem_mask*/) -{ - // logerror("sh2_internal_r: Read %08x (%x) @ %08x\n", 0xfffffe00+offset*4, offset, mem_mask); - //bprintf(0, _T("sh2_internal_r: Read %08x (%x) @ %08x\n"), 0xfffffe00+offset*4, offset, mem_mask); - - switch( offset ) - { - case 0x04: // TIER, FTCSR, FRC - sh2_timer_resync(); - return (sh2->m[4] & 0xffff0000) | sh2->frc; - case 0x05: // OCRx, TCR, TOCR - if(sh2->m[5] & 0x10) - return (sh2->ocrb << 16) | (sh2->m[5] & 0xffff); - else - return (sh2->ocra << 16) | (sh2->m[5] & 0xffff); - case 0x06: // ICR - return sh2->icr << 16; - - case 0x38: // ICR, IPRA -// return (sh2->m[0x38] & 0x7fffffff) | (sh2->nmi_line_state == ASSERT_LINE ? 0 : 0x80000000); - return (sh2->m[0x38] & 0x7fffffff) | 0x80000000; - - case 0x78: // BCR1 -// return sh2->is_slave ? 0x00008000 : 0; - return 0; - - case 0x41: // dvdntl mirrors - case 0x47: - return sh2->m[0x45]; - - case 0x46: // dvdnth mirror - return sh2->m[0x44]; - } - return sh2->m[offset]; -} - -// ------------------------------------------------------- - -int Sh2Run(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2Run called without init\n")); -#endif - - sh2->sh2_icount = cycles; - sh2->sh2_cycles_to_run = cycles; - - do - { - if ( pSh2Ext->suspend && cps3speedhack ) { - sh2->sh2_total_cycles += cycles; - sh2->sh2_icount = 0; - break; - } - - if (pSh2Ext->suspend == 0) { - UINT16 opcode; - - if (sh2->delay) { - opcode = cpu_readop16(sh2->delay & AM); - change_pc(sh2->pc & AM); - sh2->delay = 0; - } else { - opcode = cpu_readop16(sh2->pc & AM); - sh2->pc += 2; - } - - sh2->ppc = sh2->pc; - - switch (opcode & ( 15 << 12)) - { - case 0<<12: op0000(opcode); break; - case 1<<12: op0001(opcode); break; - case 2<<12: op0010(opcode); break; - case 3<<12: op0011(opcode); break; - case 4<<12: op0100(opcode); break; - case 5<<12: op0101(opcode); break; - case 6<<12: op0110(opcode); break; - case 7<<12: op0111(opcode); break; - case 8<<12: op1000(opcode); break; - case 9<<12: op1001(opcode); break; - case 10<<12: op1010(opcode); break; - case 11<<12: op1011(opcode); break; - case 12<<12: op1100(opcode); break; - case 13<<12: op1101(opcode); break; - case 14<<12: op1110(opcode); break; - default: op1111(opcode); break; - } - } - - if(sh2->test_irq && !sh2->delay) - { - CHECK_PENDING_IRQ(/*"mame_sh2_execute"*/); - sh2->test_irq = 0; - } - - sh2->sh2_total_cycles++; - sh2->sh2_icount -= (sh2_suprnova_speedhack) ? 4 : 1; - - // timer check - - { - unsigned int cy = sh2_GetTotalCycles(); - - - if (sh2->dma_timer_active[0]) - if ((cy - sh2->dma_timer_base[0]) >= sh2->dma_timer_cycles[0]) - sh2_dmac_callback(0); - - if (sh2->dma_timer_active[1]) - if ((cy - sh2->dma_timer_base[1]) >= sh2->dma_timer_cycles[1]) - sh2_dmac_callback(1); - - if ( sh2->timer_active ) - if ((cy - sh2->timer_base) >= sh2->timer_cycles) - sh2_timer_callback(); - } - - - } while( sh2->sh2_icount > 0 ); - - sh2->cycle_counts += cycles - (UINT32)sh2->sh2_icount; - - sh2->sh2_cycles_to_run = sh2->sh2_icount; - - return cycles - sh2->sh2_icount; -} - -static void Sh2SetIRQLine_Internal(const int line, const int state) -{ - if (sh2->irq_line_state[line] == state) return; - sh2->irq_line_state[line] = state; - - if( state == CPU_IRQSTATUS_NONE ) { - // LOG(("SH-2 #%d cleared irq #%d\n", cpu_getactivecpu(), line)); - sh2->pending_irq &= ~(1 << line); - } else { - //LOG(("SH-2 #%d assert irq #%d\n", cpu_getactivecpu(), line)); - sh2->pending_irq |= 1 << line; - if(sh2->delay) - sh2->test_irq = 1; - else - CHECK_PENDING_IRQ(/*"sh2_set_irq_line"*/); - - pSh2Ext->suspend = 0; - } - -} - -void Sh2SetIRQLine(const int line, const int state) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2SetIRQLine called without init\n")); -#endif - - switch (state) { - case CPU_IRQSTATUS_AUTO: - Sh2SetIRQLine_Internal(line, CPU_IRQSTATUS_ACK); - Sh2Run(0); - Sh2SetIRQLine_Internal(line, CPU_IRQSTATUS_NONE); - break; - - default: - Sh2SetIRQLine_Internal(line, state); - break; - } -} - -unsigned int Sh2GetPC(int) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2GetPC called without init\n")); -#endif - - return (sh2->delay) ? (sh2->delay & AM) : (sh2->pc & AM); -} - -void Sh2SetVBR(unsigned int i) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2SetVBR called without init\n")); -#endif - - sh2->vbr = i; -} - -void Sh2BurnUntilInt(int) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2BurnUntilInt called without init\n")); -#endif - - pSh2Ext->suspend = 1; -} - -void Sh2StopRun() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2StopRun called without init\n")); -#endif - - sh2->sh2_total_cycles += sh2->sh2_icount; - sh2->sh2_icount = 0; - sh2->sh2_cycles_to_run = 0; -} - -int Sh2TotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2TotalCycles called without init\n")); -#endif - - return sh2->sh2_total_cycles; -} - -void Sh2NewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2NewFrame called without init\n")); -#endif - - sh2->sh2_total_cycles = 0; -} - -void Sh2BurnCycles(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2BurnCycles called without init\n")); -#endif - - sh2->sh2_icount -= cycles; - sh2->sh2_total_cycles += cycles; -} - -void Sh2Idle(int cycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2Idle called without init\n")); -#endif - - sh2->sh2_total_cycles += cycles; - sh2->cycle_counts += cycles; -} - -void __fastcall Sh2WriteByte(unsigned int a, unsigned char d) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2WriteByte called without init\n")); -#endif - - WB(a, d); -} - - -unsigned char __fastcall Sh2ReadByte(unsigned int a) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2ReadByte called without init\n")); -#endif - - return RB(a); -} - -void Sh2Reset() -{ - Sh2Reset(RL(0), RL(4)); -} - -#include "state.h" - -int Sh2Scan(int nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_SH2Initted) bprintf(PRINT_ERROR, _T("Sh2Scan called without init\n")); -#endif - - if (nAction & ACB_DRIVER_DATA) { - - char szText[] = "SH2 #0"; - - for (int i = 0; i < 1 /*nCPUCount*/; i++) { - szText[5] = '1' + i; - - int (*irq_callback)(int irqline); - irq_callback = Sh2Ext[i].sh2.irq_callback; - - ScanVar(& ( Sh2Ext[i].sh2 ), sizeof(SH2), szText); - - Sh2Ext[i].sh2.irq_callback = irq_callback; - - SCAN_VAR (Sh2Ext[i].suspend); - SCAN_VAR (Sh2Ext[i].opbase); - -#if FAST_OP_FETCH - // Sh2Ext[i].opbase - if (nAction & ACB_WRITE) { - change_pc(sh2->pc & AM); - } -#endif - } - - } - - return 0; -} diff --git a/jan/src/cpu/sh2_intf.h b/jan/src/cpu/sh2_intf.h deleted file mode 100644 index 74ac7f962..000000000 --- a/jan/src/cpu/sh2_intf.h +++ /dev/null @@ -1,57 +0,0 @@ - -#ifndef FASTCALL - #undef __fastcall - #define __fastcall -#endif - -typedef unsigned char (__fastcall *pSh2ReadByteHandler)(unsigned int a); -typedef void (__fastcall *pSh2WriteByteHandler)(unsigned int a, unsigned char d); -typedef unsigned short (__fastcall *pSh2ReadWordHandler)(unsigned int a); -typedef void (__fastcall *pSh2WriteWordHandler)(unsigned int a, unsigned short d); -typedef unsigned int (__fastcall *pSh2ReadLongHandler)(unsigned int a); -typedef void (__fastcall *pSh2WriteLongHandler)(unsigned int a, unsigned int d); - -extern int has_sh2; -extern INT32 cps3speedhack; -extern INT32 sh2_suprnova_speedhack; -extern INT32 sh2_busyloop_speedhack_mode2; - -void __fastcall Sh2WriteByte(unsigned int a, unsigned char d); -unsigned char __fastcall Sh2ReadByte(unsigned int a); - -int Sh2Init(int nCount); -int Sh2Exit(); - -void Sh2Open(const int i); -void Sh2Close(); -int Sh2GetActive(); - -void Sh2Reset(); -void Sh2Reset(unsigned int pc, unsigned r15); // hack -int Sh2Run(int cycles); - -int Sh2MapMemory(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd, int nType); -int Sh2MapHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType); - -int Sh2SetReadByteHandler(int i, pSh2ReadByteHandler pHandler); -int Sh2SetWriteByteHandler(int i, pSh2WriteByteHandler pHandler); -int Sh2SetReadWordHandler(int i, pSh2ReadWordHandler pHandler); -int Sh2SetWriteWordHandler(int i, pSh2WriteWordHandler pHandler); -int Sh2SetReadLongHandler(int i, pSh2ReadLongHandler pHandler); -int Sh2SetWriteLongHandler(int i, pSh2WriteLongHandler pHandler); - -void Sh2SetIRQLine(const int line, const int state); - -unsigned int Sh2GetPC(int n); -void Sh2StopRun(); -void Sh2SetVBR(unsigned int i); - -void Sh2BurnUntilInt(int); - -int Sh2TotalCycles(); -void Sh2NewFrame(); -void Sh2BurnCycles(int cycles); -void Sh2Idle(int cycles); - -int Sh2Scan(int); - diff --git a/jan/src/cpu/tlcs90/tlcs90.cpp b/jan/src/cpu/tlcs90/tlcs90.cpp deleted file mode 100644 index 598e94da9..000000000 --- a/jan/src/cpu/tlcs90/tlcs90.cpp +++ /dev/null @@ -1,3013 +0,0 @@ -/************************************************************************************************************* - - Toshiba TLCS-90 Series MCU's - - emulation by Luca Elia, based on the Z80 core by Juergen Buchmueller - -*************************************************************************************************************/ - -#include "burnint.h" -#include "tlcs90_intf.h" - -#define T90_IOBASE 0xffc0 - -typedef void (*timer_callback)(INT32); - -extern UINT8 tlcs90_program_read_byte(UINT32 address); -extern void tlcs90_program_write_byte(UINT32 address, UINT8 data); -extern UINT8 tlcs90_io_read_byte(UINT16 port); -extern void tlcs90_io_write_byte(UINT16 port, UINT8 data); - -enum e_ir -{ - T90_P0=T90_IOBASE, T90_P1, T90_P01CR_IRFL, T90_IRFH, T90_P2, T90_P2CR, T90_P3, T90_P3CR, - T90_P4, T90_P4CR, T90_P5, T90_SMMOD, T90_P6, T90_P7, T90_P67CR, T90_SMCR, - T90_P8, T90_P8CR, T90_WDMOD, T90_WDCR, T90_TREG0, T90_TREG1, T90_TREG2, T90_TREG3, - T90_TCLK, T90_TFFCR, T90_TMOD, T90_TRUN, T90_CAP1L, T90_CAP1H, T90_CAP2L, T90_CAL2H, - T90_TREG4L, T90_TREG4H, T90_TREG5L, T90_TREG5H, T90_T4MOD, T90_T4FFCR, T90_INTEL, T90_INTEH, - T90_DMAEH, T90_SCMOD, T90_SCCR, T90_SCBUF, T90_BX, T90_BY, T90_ADREG, T90_ADMOD -}; - -#define INLINE static - -enum _e_op { UNKNOWN, NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, JP, JR, CALL, CALLR, RET, RETI, HALT, DI, EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, CCF, TSET, BIT, SET, RES, INC, DEC, INCX, DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, XOR, OR, CP, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV }; -typedef UINT8 e_op; -static const char *const op_names[] = { "??", "nop", "ex", "exx", "ld", "ldw", "lda", "ldi", "ldir", "ldd", "lddr", "cpi", "cpir", "cpd", "cpdr", "push", "pop", "jp", "jr", "call", "callr", "ret", "reti", "halt", "di", "ei", "swi", "daa", "cpl", "neg", "ldar", "rcf", "scf", "ccf", "tset", "bit", "set", "res", "inc", "dec", "incx", "decx", "incw", "decw", "add", "adc", "sub", "sbc", "and", "xor", "or", "cp", "rlc", "rrc", "rl", "rr", "sla", "sra", "sll", "srl", "rld", "rrd", "djnz", "mul", "div" }; - -enum e_mode { - MODE_NONE, MODE_BIT8, MODE_CC, - MODE_I8, MODE_D8, MODE_R8, - MODE_I16, MODE_D16, MODE_R16, - MODE_MI16, MODE_MR16, MODE_MR16D8, MODE_MR16R8, - MODE_R16D8, MODE_R16R8 -}; - -typedef UINT16 e_r; - -struct t90_Regs -{ - PAIR prvpc,pc,sp,af,bc,de,hl,ix,iy; - PAIR af2,bc2,de2,hl2; - UINT8 halt, after_EI; - UINT16 irq_state, irq_mask; - - INT32 icount; - INT32 extra_cycles; // extra cycles for interrupts - UINT8 internal_registers[48]; - UINT32 ixbase,iybase; - - // Timers: 4 x 8-bit + 1 x 16-bit - INT32 timer_enable[4+1]; - double timer_periods[4+1]; - double timer_periods_full[4+1]; - timer_callback timer_cb[4+1]; - - UINT8 timer_value[4]; - UINT16 timer4_value; - double timer_period; - - // Work registers - e_op op; - - e_mode mode1; - e_r r1,r1b; - - e_mode mode2; - e_r r2,r2b; - - INT32 cyc_t,cyc_f; - - UINT32 addr; - - UINT32 total_cycles; - INT32 nCycles; - INT32 run_end; -}; - -static struct t90_Regs tlcs90_data[1]; - -enum { - T90_B, T90_C, T90_D, T90_E, T90_H, T90_L, T90_A, - T90_BC, T90_DE, T90_HL, T90_XX, T90_IX, T90_IY, T90_SP, - T90_AF, T90_PC -}; - -// Regs - -#define B 0 -#define C 1 -#define D 2 -#define E 3 -#define H 4 -#define L 5 -#define A 6 - -#define BC 0 -#define DE 1 -#define HL 2 -// 3 -#define IX 4 -#define IY 5 -#define SP 6 - -#define AF 7 -#define AF2 8 -#define PC 9 - -#define F cpustate->af.b.l - -static const char *const r8_names[] = { "b", "c", "d", "e", "h", "l", "a" }; -static const char *const r16_names[] = { "bc", "de", "hl", "??", "ix", "iy", "sp", "af", "af'", "pc" }; - -// Condition Codes - -#define FLS 0x0 -#define LT 0x1 -#define LE 0x2 -#define ULE 0x3 -#define OV 0x4 -#define PE 0x4 -#define MI 0x5 -#define Z 0x6 -#define EQ 0x6 -#define CR 0x7 -#define ULT 0x7 -#define T 0x8 -#define GE 0x9 -#define GT 0xa -#define UGT 0xb -#define NOV 0xc -#define PO 0xc -#define PL 0xd -#define NZ 0xe -#define NE 0xe -#define NC 0xf -#define UGE 0xf - -#define CF 0x01 -#define NF 0x02 -#define PF 0x04 -#define VF PF -#define XCF 0x08 -#define HF 0x10 -#define IF 0x20 -#define ZF 0x40 -#define SF 0x80 - -static UINT8 SZ[256]; /* zero and sign flags */ -static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ -static UINT8 SZP[256]; /* zero, sign and parity flags */ -static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ -static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ - -static const char *const cc_names[] = { "f", "lt", "le", "ule", "ov", "mi", "z", "c", "", "ge", "gt", "ugt", "nov", "pl", "nz", "nc" }; - -// Opcodes - -#define OP_16 0x80 - - -#define OP( X,CT ) cpustate->op = X; cpustate->cyc_t = (CT*2); -#define OP16( X,CT ) OP( (X)|OP_16,CT ) - -#define OPCC( X,CF,CT ) OP( X, CT ) cpustate->cyc_f = (CF*2); -#define OPCC16( X,CF,CT ) OPCC( (X)|OP_16,CF,CT ) - -#define BIT8( N,I ) cpustate->mode##N = MODE_BIT8; cpustate->r##N = I; -#define I8( N,I ) cpustate->mode##N = MODE_I8; cpustate->r##N = I; -#define D8( N,I ) cpustate->mode##N = MODE_D8; cpustate->r##N = I; -#define I16( N,I ) cpustate->mode##N = MODE_I16; cpustate->r##N = I; -#define D16( N,I ) cpustate->mode##N = MODE_D16; cpustate->r##N = I; -#define R8( N,R ) cpustate->mode##N = MODE_R8; cpustate->r##N = R; -#define R16( N,R ) cpustate->mode##N = MODE_R16; cpustate->r##N = R; -#define Q16( N,R ) cpustate->mode##N = MODE_R16; cpustate->r##N = R; if (cpustate->r##N == SP) cpustate->r##N = AF; -#define MI16( N,I ) cpustate->mode##N = MODE_MI16; cpustate->r##N = I; -#define MR16( N,R ) cpustate->mode##N = MODE_MR16; cpustate->r##N = R; -#define MR16D8( N,R,I ) cpustate->mode##N = MODE_MR16D8; cpustate->r##N = R; cpustate->r##N##b = I; -#define MR16R8( N,R,g ) cpustate->mode##N = MODE_MR16R8; cpustate->r##N = R; cpustate->r##N##b = g; -#define NONE( N ) cpustate->mode##N = MODE_NONE; -#define CC( N,cc ) cpustate->mode##N = MODE_CC; cpustate->r##N = cc; -#define R16D8( N,R,I ) cpustate->mode##N = MODE_R16D8; cpustate->r##N = R; cpustate->r##N##b = I; -#define R16R8( N,R,g ) cpustate->mode##N = MODE_R16R8; cpustate->r##N = R; cpustate->r##N##b = g; - -INLINE UINT8 RM8 (t90_Regs *, UINT32 a) { return tlcs90_program_read_byte( a ); } -INLINE UINT16 RM16(t90_Regs *cpustate, UINT32 a) { return RM8(cpustate,a) | (RM8( cpustate, (a+1) & 0xffff ) << 8); } - -INLINE void WM8 (t90_Regs *, UINT32 a, UINT8 v) { tlcs90_program_write_byte( a, v ); } -INLINE void WM16(t90_Regs *cpustate, UINT32 a, UINT16 v) { WM8(cpustate,a,v); WM8( cpustate, (a+1) & 0xffff, v >> 8); } - -INLINE UINT8 RX8 (t90_Regs *, UINT32 a, UINT32 base) { return tlcs90_program_read_byte( base | a ); } -INLINE UINT16 RX16(t90_Regs *cpustate, UINT32 a, UINT32 base) { return RX8(cpustate,a,base) | (RX8( cpustate, (a+1) & 0xffff, base ) << 8); } - -INLINE void WX8 (t90_Regs *, UINT32 a, UINT8 v, UINT32 base) { tlcs90_program_write_byte( base | a, v ); } -INLINE void WX16(t90_Regs *cpustate, UINT32 a, UINT16 v, UINT32 base) { WX8(cpustate,a,v,base); WX8( cpustate, (a+1) & 0xffff, v >> 8, base); } - -INLINE UINT8 READ8(t90_Regs *cpustate) { UINT8 b0 = RM8( cpustate, cpustate->addr++ ); cpustate->addr &= 0xffff; return b0; } -INLINE UINT16 READ16(t90_Regs *cpustate) { UINT8 b0 = READ8(cpustate); return b0 | (READ8(cpustate) << 8); } - -static void decode(t90_Regs *cpustate) -{ - UINT8 b0, b1, b2, b3; - UINT16 imm16; - - b0 = READ8(cpustate); - - switch ( b0 ) - { - case 0x00: - OP( NOP,2 ) NONE( 1 ) NONE( 2 ) return; // NOP - - case 0x01: - OP( HALT,4 ) NONE( 1 ) NONE( 2 ) return; // HALT - case 0x02: - OP( DI,2 ) NONE( 1 ) NONE( 2 ) return; // DI - case 0x03: - OP( EI,2 ) NONE( 1 ) NONE( 2 ) return; // EI - - case 0x07: - OPCC( INCX,6,10 ) MI16( 1, 0xFF00|READ8(cpustate) ) NONE( 2 ) return; // INCX ($FF00+n) - - case 0x08: - OP( EX,2 ) R16( 1, DE ) R16( 2, HL ) return; // EX DE,HL - case 0x09: - OP( EX,2 ) R16( 1, AF ) R16( 2, AF2 ) return; // EX AF,AF' - case 0x0a: - OP( EXX,2 ) NONE( 1 ) NONE( 2 ) return; // EXX - - case 0x0b: - OP( DAA,4 ) R8( 1, A ) NONE( 2 ) return; // DAA A - - case 0x0c: - OP( RCF,2 ) NONE( 1 ) NONE( 2 ) return; // RCF - case 0x0d: - OP( SCF,2 ) NONE( 1 ) NONE( 2 ) return; // SCF - case 0x0e: - OP( CCF,2 ) NONE( 1 ) NONE( 2 ) return; // CCF - - case 0x0f: - OPCC( DECX,6,10 ) MI16( 1, 0xFF00|READ8(cpustate) ) NONE( 2 ) return; // DECX ($FF00+n) - - case 0x10: - OP( CPL,2 ) R8( 1, A ) NONE( 2 ) return; // CPL A - case 0x11: - OP( NEG,2 ) R8( 1, A ) NONE( 2 ) return; // NEG A - - case 0x12: // MUL HL,n - case 0x13: // DIV HL,n - OP( MUL+b0-0x12,16) R16( 1, HL ) I8( 2, READ8(cpustate) ) return; - - case 0x14: case 0x15: case 0x16: - OP16( ADD,6 ) R16( 1, IX+b0-0x14 ) I16( 2, READ16(cpustate) ) return; // ADD ix,mn - - case 0x17: - OP( LDAR,8 ) R16( 1, HL ) D16( 2, READ16(cpustate) ) return; // LDAR HL,+cd - - case 0x18: - OP( DJNZ,10 ) D8( 1, READ8(cpustate) ) NONE( 2 ) return; // DJNZ +d - case 0x19: - OP16( DJNZ,10 ) R16( 1, BC ) D8( 2, READ8(cpustate) ) return; // DJNZ BC,+d - - case 0x1a: - OPCC( JP,8,8 ) CC( 1, T ) I16( 2, READ16(cpustate) ) return; // JP T,mn - case 0x1b: - OPCC16( JR,10,10 ) CC( 1, T ) D16( 2, READ16(cpustate) ) return; // JR T,+cd - - case 0x1c: - OPCC( CALL,14,14 ) CC( 1, T ) I16( 2, READ16(cpustate) ) return; // CALL T,mn - case 0x1d: - OP( CALLR,16 ) D16( 1, READ16(cpustate) ) NONE( 2 ) return; // CALLR +cd - - case 0x1e: - OPCC( RET,10,10 ) CC( 1, T ) NONE( 2 ) return; // RET T - case 0x1f: - OP( RETI,14 ) NONE( 1 ) NONE( 2 ) return; // RETI - - case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: - OP( LD,2 ) R8( 1, A ) R8( 2, b0 - 0x20 ) return; // LD A,r - - case 0x27: - OP( LD,8 ) R8( 1, A ) MI16( 2, 0xFF00|READ8(cpustate) ) return; // LD A,($FF00+n) - - case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: - OP( LD,2 ) R8( 1, b0 - 0x28 ) R8( 2, A ) return; // LD r,A - - case 0x2f: - OP( LD,8 ) MI16( 1, 0xFF00|READ8(cpustate) ) R8( 2, A ) return; // LD ($FF00+n), A - - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: - OP( LD,4 ) R8( 1, b0 - 0x30 ) I8( 2, READ8(cpustate) ) return; // LD r,n - - case 0x37: - OP( LD,10 ) MI16( 1, 0xFF00|READ8(cpustate) ) I8( 2, READ8(cpustate) ) return; // LD ($FF00+w),n - - case 0x38: case 0x39: case 0x3a: /*case 0x3b:*/ case 0x3c: case 0x3d: case 0x3e: - OP16( LD,6 ) R16( 1, b0 - 0x38 ) I16( 2, READ16(cpustate) ) return; // LD rr,nn - - case 0x3f: - OP( LDW,14 ) MI16( 1, 0xFF00|READ8(cpustate) ) I16( 2, READ16(cpustate) ) return; // LDW ($FF00+w),mn - - case 0x40: case 0x41: case 0x42: /*case 0x43:*/ case 0x44: case 0x45: case 0x46: - OP16( LD,4 ) R16( 1, HL ) R16( 2, b0 - 0x40 ) return; // LD HL,rr - - case 0x47: - OP16( LD,10 ) R16( 1, HL ) MI16( 2, 0xFF00|READ8(cpustate) ) return; // LD HL,($FF00+n) - - case 0x48: case 0x49: case 0x4a: /*case 0x4b:*/ case 0x4c: case 0x4d: case 0x4e: - OP16( LD,4 ) R16( 1, b0 - 0x48 ) R16( 2, HL ) return; // LD rr,HL - - case 0x4f: - OP16( LD,10 ) MI16( 1, 0xFF00|READ8(cpustate) ) R16( 2, HL ) return; // LD ($FF00+n), HL - - case 0x50: case 0x51: case 0x52: /*case 0x53:*/ case 0x54: case 0x55: case 0x56: - OP( PUSH,8 ) Q16( 1, b0 - 0x50 ) NONE( 2 ) return; // PUSH qq - case 0x58: case 0x59: case 0x5a: /*case 0x5b:*/ case 0x5c: case 0x5d: case 0x5e: - OP( POP,10 ) Q16( 1, b0 - 0x58 ) NONE( 2 ) return; // POP qq - - case 0x60: // ADD A,($FF00+n) - case 0x61: // ADC A,($FF00+n) - case 0x62: // SUB A,($FF00+n) - case 0x63: // SBC A,($FF00+n) - case 0x64: // AND A,($FF00+n) - case 0x65: // XOR A,($FF00+n) - case 0x66: // OR A,($FF00+n) - case 0x67: // CP A,($FF00+n) - OP( ADD+b0-0x60,8 ) R8( 1, A ) MI16( 2, 0xFF00|READ8(cpustate) ) return; - - case 0x68: // ADD A,n - case 0x69: // ADC A,n - case 0x6a: // SUB A,n - case 0x6b: // SBC A,n - case 0x6c: // AND A,n - case 0x6d: // XOR A,n - case 0x6e: // OR A,n - case 0x6f: // CP A,n - OP( ADD+b0-0x68,4 ) R8( 1, A ) I8( 2, READ8(cpustate) ) return; - - case 0x70: // ADD HL,($FF00+n) - case 0x71: // ADC HL,($FF00+n) - case 0x72: // SUB HL,($FF00+n) - case 0x73: // SBC HL,($FF00+n) - case 0x74: // AND HL,($FF00+n) - case 0x75: // XOR HL,($FF00+n) - case 0x76: // OR HL,($FF00+n) - case 0x77: // CP HL,($FF00+n) - OP16( ADD+b0-0x70,10 ) R16( 1, HL ) MI16( 2, 0xFF00|READ8(cpustate) ) return; - - case 0x78: // ADD HL,mn - case 0x79: // ADC HL,mn - case 0x7a: // SUB HL,mn - case 0x7b: // SBC HL,mn - case 0x7c: // AND HL,mn - case 0x7d: // XOR HL,mn - case 0x7e: // OR HL,mn - case 0x7f: // CP HL,mn - OP16( ADD+b0-0x78,6 ) R16( 1, HL ) I16( 2, READ16(cpustate) ) return; - - case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: - OP( INC,2 ) R8( 1, b0 - 0x80 ) NONE( 2 ) return; // INC r - case 0x87: - OP( INC,10 ) MI16( 1, 0xFF00|READ8(cpustate) ) NONE( 2 ) return; // INC ($FF00+n) - - case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: - OP( DEC,2 ) R8( 1, b0 - 0x88 ) NONE( 2 ) return; // DEC r - case 0x8f: - OP( DEC,10 ) MI16( 1, 0xFF00|READ8(cpustate) ) NONE( 2 ) return; // DEC ($FF00+n) - - case 0x90: case 0x91: case 0x92: /*case 0x93:*/ case 0x94: case 0x95: case 0x96: - OP16( INC,4 ) R16( 1, b0 - 0x90 ) NONE( 2 ) return; // INC rr - case 0x97: - OP( INCW,14 ) MI16( 1, 0xFF00|READ8(cpustate) ) NONE( 2 ) return; // INCW ($FF00+n) - case 0x98: case 0x99: case 0x9a: /*case 0x9b:*/ case 0x9c: case 0x9d: case 0x9e: - OP16( DEC,4 ) R16( 1, b0 - 0x98 ) NONE( 2 ) return; // DEC rr - case 0x9f: - OP( DECW,14 ) MI16( 1, 0xFF00|READ8(cpustate) ) NONE( 2 ) return; // DECW ($FF00+n) - - case 0xa0: // RLC A - case 0xa1: // RRC A - case 0xa2: // RL A - case 0xa3: // RR A - case 0xa4: // SLA A - case 0xa5: // SRA A - case 0xa6: // SLL A - case 0xa7: // SRL A - OP( RLC+b0-0xa0,2 ) R8( 1, A ) NONE( 2 ) return; - - case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - OP( BIT,8 ) BIT8( 1, b0 - 0xa8 ) MI16( 2, 0xFF00|READ8(cpustate) ) return; // BIT b,($FF00+n) - case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: - OP( RES,12 ) BIT8( 1, b0 - 0xb0 ) MI16( 2, 0xFF00|READ8(cpustate) ) return; // RES b,($FF00+n) - case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: - OP( SET,12 ) BIT8( 1, b0 - 0xb8 ) MI16( 2, 0xFF00|READ8(cpustate) ) return; // SET b,($FF00+n) - - case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: - case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: - OPCC( JR,4,8 ) CC( 1, b0 - 0xc0 ) D8( 2, READ8(cpustate) ) return; // JR cc,+d - - case 0xe0: case 0xe1: case 0xe2: /*case 0xe3:*/ case 0xe4: case 0xe5: case 0xe6: - b1 = READ8(cpustate); - switch ( b1 ) { - case 0x10: // RLD (gg) - case 0x11: // RRD (gg) - OP( RLD+b1-0x10,12 ) MR16( 1, b0 - 0xe0 ) NONE( 2 ) return; - - case 0x12: // MUL HL,(gg) - case 0x13: // DIV HL,(gg) - OP( MUL+b1-0x12,18 ) R16( 1, HL ) MR16( 2, b0 - 0xe0 ) return; - - case 0x14: case 0x15: case 0x16: - OP16( ADD,8 ) R16( 1, IX+b1-0x14 ) MR16( 2, b0 - 0xe0 ) return; // ADD ix,(gg) - - case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: - OP( LD,6 ) R8( 1, b1 - 0x28 ) MR16( 2, b0 - 0xe0 ) return; // LD r,(gg) - case 0x48: case 0x49: case 0x4a: /*case 0x4b:*/ case 0x4c: case 0x4d: case 0x4e: - OP16( LD,8 ) R16( 1, b1 - 0x48 ) MR16( 2, b0 - 0xe0 ) return; // LD rr,(gg) - - case 0x50: case 0x51: case 0x52: /*case 0x53:*/ case 0x54: case 0x55: case 0x56: - OP( EX,14 ) MR16( 1, b0 - 0xe0 ) R16( 2, b1 - 0x50 ) return; // EX (gg),rr - - case 0x60: // ADD A,(gg) - case 0x61: // ADC A,(gg) - case 0x62: // SUB A,(gg) - case 0x63: // SBC A,(gg) - case 0x64: // AND A,(gg) - case 0x65: // XOR A,(gg) - case 0x66: // OR A,(gg) - case 0x67: // CP A,(gg) - OP( ADD+b1-0x60,6 ) R8( 1, A ) MR16( 2, b0 - 0xe0 ) return; - - case 0x70: // ADD HL,(gg) - case 0x71: // ADC HL,(gg) - case 0x72: // SUB HL,(gg) - case 0x73: // SBC HL,(gg) - case 0x74: // AND HL,(gg) - case 0x75: // XOR HL,(gg) - case 0x76: // OR HL,(gg) - case 0x77: // CP HL,(gg) - OP16( ADD+b1-0x70,8 ) R16( 1, HL ) MR16( 2, b0 - 0xe0 ) return; - - case 0x87: - OP( INC,8 ) MR16( 1, b0 - 0xe0 ) NONE( 2 ) return; // INC (gg) - case 0x8f: - OP( DEC,8 ) MR16( 1, b0 - 0xe0 ) NONE( 2 ) return; // DEC (gg) - - case 0x97: - OP( INCW,12 ) MR16( 1, b0 - 0xe0 ) NONE( 2 ) return; // INCW (gg) - case 0x9f: - OP( DECW,12 ) MR16( 1, b0 - 0xe0 ) NONE( 2 ) return; // DECW (gg) - - case 0xa0: // RLC (gg) - case 0xa1: // RRC (gg) - case 0xa2: // RL (gg) - case 0xa3: // RR (gg) - case 0xa4: // SLA (gg) - case 0xa5: // SRA (gg) - case 0xa6: // SLL (gg) - case 0xa7: // SRL (gg) - OP( RLC+b1-0xa0,8 ) MR16( 1, b0 - 0xe0 ) NONE( 2 ) return; - - case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: - OP( TSET,12 ) BIT8( 1, b1 - 0x18 ) MR16( 2, b0 - 0xe0 ) return; // TSET b,(gg) - case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - OP( BIT,6 ) BIT8( 1, b1 - 0xa8 ) MR16( 2, b0 - 0xe0 ) return; // BIT b,(gg) - case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: - OP( RES,10 ) BIT8( 1, b1 - 0xb0 ) MR16( 2, b0 - 0xe0 ) return; // RES b,(gg) - case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: - OP( SET,10 ) BIT8( 1, b1 - 0xb8 ) MR16( 2, b0 - 0xe0 ) return; // SET b,(gg) - } break; - case 0xe3: - imm16 = READ16(cpustate); - b3 = READ8(cpustate); - switch ( b3 ) { - case 0x10: // RLD (mn) - case 0x11: // RRD (mn) - OP( RLD+b3-0x10,16 ) MI16( 1, imm16 ) NONE( 2 ) return; - - case 0x12: // MUL HL,(mn) - case 0x13: // DIV HL,(mn) - OP( MUL+b3-0x12,22 ) R16( 1, HL ) MI16( 2, imm16 ) return; - - case 0x14: case 0x15: case 0x16: - OP16( ADD,12 ) R16( 1, IX+b3-0x14 ) MI16( 2, imm16 ) return; // ADD ix,(mn) - - case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: - OP( LD,10 ) R8( 1, b3 - 0x28 ) MI16( 2, imm16 ) return; // LD r,(mn) - case 0x48: case 0x49: case 0x4a: /*case 0x4b:*/ case 0x4c: case 0x4d: case 0x4e: - OP16( LD,12 ) R16( 1, b3 - 0x48 ) MI16( 2, imm16 ) return; // LD rr,(mn) - - case 0x50: case 0x51: case 0x52: /*case 0x53:*/ case 0x54: case 0x55: case 0x56: - OP( EX,18 ) MI16( 1, imm16 ) R16( 2, b3 - 0x50 ) return; // EX (mn),rr - - case 0x60: // ADD A,(mn) - case 0x61: // ADC A,(mn) - case 0x62: // SUB A,(mn) - case 0x63: // SBC A,(mn) - case 0x64: // AND A,(mn) - case 0x65: // XOR A,(mn) - case 0x66: // OR A,(mn) - case 0x67: // CP A,(mn) - OP( ADD+b3-0x60,10 ) R8( 1, A ) MI16( 2, imm16 ) return; - - case 0x70: // ADD HL,(mn) - case 0x71: // ADC HL,(mn) - case 0x72: // SUB HL,(mn) - case 0x73: // SBC HL,(mn) - case 0x74: // AND HL,(mn) - case 0x75: // XOR HL,(mn) - case 0x76: // OR HL,(mn) - case 0x77: // CP HL,(mn) - OP16( ADD+b3-0x70,12 ) R16( 1, HL ) MI16( 2, imm16 ) return; - - case 0x87: - OP( INC,12 ) MI16( 1, imm16 ) NONE( 2 ) return; // INC (mn) - case 0x8f: - OP( DEC,12 ) MI16( 1, imm16 ) NONE( 2 ) return; // DEC (mn) - - case 0x97: - OP( INCW,16 ) MI16( 1, imm16 ) NONE( 2 ) return; // INCW (mn) - case 0x9f: - OP( DECW,16 ) MI16( 1, imm16 ) NONE( 2 ) return; // DECW (mn) - - case 0xa0: // RLC (mn) - case 0xa1: // RRC (mn) - case 0xa2: // RL (mn) - case 0xa3: // RR (mn) - case 0xa4: // SLA (mn) - case 0xa5: // SRA (mn) - case 0xa6: // SLL (mn) - case 0xa7: // SRL (mn) - OP( RLC+b3-0xa0,12 ) MI16( 1, imm16 ) NONE( 2 ) return; - - case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: - OP( TSET,16 ) BIT8( 1, b3 - 0x18 ) MI16( 2, imm16 ) return; // TSET b,(mn) - case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - OP( BIT,10 ) BIT8( 1, b3 - 0xa8 ) MI16( 2, imm16 ) return; // BIT b,(mn) - case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: - OP( RES,14 ) BIT8( 1, b3 - 0xb0 ) MI16( 2, imm16 ) return; // RES b,(mn) - case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: - OP( SET,14 ) BIT8( 1, b3 - 0xb8 ) MI16( 2, imm16 ) return; // SET b,(mn) - } break; - - case 0xe7: - b1 = READ8(cpustate); - b2 = READ8(cpustate); - switch ( b2 ) { - case 0x10: // RLD ($FF00+n) - case 0x11: // RRD ($FF00+n) - OP( RLD+b2-0x10,14 ) MI16( 1, 0xFF00|b1 ) NONE( 2 ) return; - - case 0x12: // MUL HL,($FF00+n) - case 0x13: // DIV HL,($FF00+n) - OP( MUL+b2-0x12,20 ) R16( 1, HL ) MI16( 2, 0xFF00|b1 ) return; - - case 0x14: case 0x15: case 0x16: - OP16( ADD,10 ) R16( 1, IX+b2-0x14 ) MI16( 2, 0xFF00|b1 ) return; // ADD ix,($FF00+n) - - case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: - OP( TSET,14 ) BIT8( 1, b2 - 0x18 ) MI16( 2, 0xFF00|b1 ) return; // TSET b,($FF00+n) - case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: - OP( LD,8 ) R8( 1, b2 - 0x28 ) MI16( 2, 0xFF00|b1 ) return; // LD r,($FF00+n) - case 0x48: case 0x49: case 0x4a: /*case 0x4b:*/ case 0x4c: case 0x4d: case 0x4e: - OP16( LD,10 ) R16( 1, b2 - 0x48 ) MI16( 2, 0xFF00|b1 ) return; // LD rr,($FF00+n) - - case 0x50: case 0x51: case 0x52: /*case 0x53:*/ case 0x54: case 0x55: case 0x56: - OP( EX,16 ) MI16( 1, 0xFF00|b1 ) R16( 2, b2 - 0x50 ) return; // EX ($FF00+n),rr - - case 0xa0: // RLC ($FF00+n) - case 0xa1: // RRC ($FF00+n) - case 0xa2: // RL ($FF00+n) - case 0xa3: // RR ($FF00+n) - case 0xa4: // SLA ($FF00+n) - case 0xa5: // SRA ($FF00+n) - case 0xa6: // SLL ($FF00+n) - case 0xa7: // SRL ($FF00+n) - OP( RLC+b2-0xa0,10 ) MI16( 1, 0xFF00|b1 ) NONE( 2 ) return; - } break; - - case 0xe8: case 0xe9: case 0xea: /*case 0xeb:*/ case 0xec: case 0xed: case 0xee: - b1 = READ8(cpustate); - switch ( b1 ) { - case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: - OP( LD,6 ) MR16( 1, b0 - 0xe8 ) R8( 2, b1 - 0x20 ) return; // LD (gg),r - case 0x37: - OP( LD,8 ) MR16( 1, b0 - 0xe8 ) I8( 2, READ8(cpustate) ) return; // LD (gg),n - case 0x3f: - OP( LDW,12 ) MR16( 1, b0 - 0xe8 ) I16( 2, READ16(cpustate) ) return; // LDW (gg),mn - case 0x40: case 0x41: case 0x42: /*case 0x43:*/ case 0x44: case 0x45: case 0x46: - OP16( LD,8 ) MR16( 1, b0 - 0xe8 ) R16( 2, b1 - 0x40 ) return; // LD (gg),rr - - case 0x68: // ADD (gg),n - case 0x69: // ADC (gg),n - case 0x6a: // SUB (gg),n - case 0x6b: // SBC (gg),n - case 0x6c: // AND (gg),n - case 0x6d: // XOR (gg),n - case 0x6e: // OR (gg),n - OP( ADD+b1-0x68,10 ) MR16( 1, b0 - 0xe8 ) I8( 2, READ8(cpustate) ) return; - case 0x6f: // CP (gg),n - OP( CP,8 ) MR16( 1, b0 - 0xe8 ) I8( 2, READ8(cpustate) ) return; - - case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: - case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: - OPCC( JP,6,8 ) CC( 1, b1 - 0xc0 ) R16( 2, b0 - 0xe8 ) return; // JP [cc,]gg - case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: - case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: - OPCC( CALL,6,14 ) CC( 1, b1 - 0xd0 ) R16( 2, b0 - 0xe8 ) return; // CALL [cc,]gg - } break; - case 0xeb: - imm16 = READ16(cpustate); - b3 = READ8(cpustate); - switch ( b3 ) { - case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: - OP( LD,10 ) MI16( 1, imm16 ) R8( 2, b3 - 0x20 ) return; // LD (mn),r - case 0x37: - OP( LD,12 ) MI16( 1, imm16 ) I8( 2, READ8(cpustate) ) return; // LD (vw),n - case 0x3f: - OP( LDW,16 ) MI16( 1, imm16 ) I16( 2, READ16(cpustate) ) return; // LDW (vw),mn - case 0x40: case 0x41: case 0x42: /*case 0x43:*/ case 0x44: case 0x45: case 0x46: - OP16( LD,12 ) MI16( 1, imm16 ) R16( 2, b3 - 0x40 ) return; // LD (mn),rr - - case 0x68: // ADD (vw),n - case 0x69: // ADC (vw),n - case 0x6a: // SUB (vw),n - case 0x6b: // SBC (vw),n - case 0x6c: // AND (vw),n - case 0x6d: // XOR (vw),n - case 0x6e: // OR (vw),n - OP( ADD+b3-0x68,14 ) MI16( 1, imm16 ) I8( 2, READ8(cpustate) ) return; - case 0x6f: // CP (vw),n - OP( ADD+b3-0x68,12 ) MI16( 1, imm16 ) I8( 2, READ8(cpustate) ) return; - - case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: - case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: - OPCC( JP,10,12 ) CC( 1, b3 - 0xc0 ) I16( 2, imm16 ) return; // JP cc,mn - case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: - case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: - OPCC( CALL,10,18 ) CC( 1, b3 - 0xd0 ) I16( 2, imm16 ) return; // CALL cc,mn - } break; - - case 0xef: - b1 = READ8(cpustate); - b2 = READ8(cpustate); - switch ( b2 ) { - case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: - OP( LD,8 ) MI16( 1, 0xFF00|b1 ) R8( 2, b2 - 0x20 ) return; // LD ($FF00+n),r - case 0x40: case 0x41: case 0x42: /*case 0x43:*/ case 0x44: case 0x45: case 0x46: - OP16( LD,10 ) MI16( 1, 0xFF00|b1 ) R16( 2, b2 - 0x40 ) return; // LD ($FF00+n),rr - - case 0x68: // ADD ($FF00+w),n - case 0x69: // ADC ($FF00+w),n - case 0x6a: // SUB ($FF00+w),n - case 0x6b: // SBC ($FF00+w),n - case 0x6c: // AND ($FF00+w),n - case 0x6d: // XOR ($FF00+w),n - case 0x6e: // OR ($FF00+w),n - OP( ADD+b2-0x68,12 ) MI16( 1, 0xFF00|b1 ) I8( 2, READ8(cpustate) ) return; - case 0x6f: // CP ($FF00+w),n - OP( ADD+b2-0x68,10 ) MI16( 1, 0xFF00|b1 ) I8( 2, READ8(cpustate) ) return; - } break; - - case 0xf0: case 0xf1: case 0xf2: - b1 = READ8(cpustate); - b2 = READ8(cpustate); - switch ( b2 ) { - case 0x10: // RLD (ix+d) - case 0x11: // RRD (ix+d) - OP( RLD+b2-0x10,16 ) MR16D8( 1, IX + b0 - 0xf0, b1 ) NONE( 2 ) return; - - case 0x12: // MUL HL,(ix+d) - case 0x13: // DIV HL,(ix+d) - OP( MUL+b2-0x12,22 ) R16( 1, HL ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; - - case 0x14: case 0x15: case 0x16: - OP16( ADD,12 ) R16( 1, IX+b2-0x14 ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; // ADD ix,(jx+d) - - case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: - OP( LD,10 ) R8( 1, b2 - 0x28 ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; // LD r,(ix+d) - case 0x48: case 0x49: case 0x4a: /*case 0x4b:*/ case 0x4c: case 0x4d: case 0x4e: - OP16( LD,12 ) R16( 1, b2 - 0x48 ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; // LD rr,(ix+d) - - case 0x50: case 0x51: case 0x52: /*case 0x53:*/ case 0x54: case 0x55: case 0x56: - OP( EX,18 ) MR16D8( 1, IX + b0 - 0xf0, b1 ) R16( 2, b2 - 0x50 ) return; // EX (ix+d),rr - - case 0x60: // ADD A,(ix+d) - case 0x61: // ADC A,(ix+d) - case 0x62: // SUB A,(ix+d) - case 0x63: // SBC A,(ix+d) - case 0x64: // AND A,(ix+d) - case 0x65: // XOR A,(ix+d) - case 0x66: // OR A,(ix+d) - case 0x67: // CP A,(ix+d) - OP( ADD+b2-0x60,10 ) R8( 1, A ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; - - case 0x70: // ADD HL,(ix+d) - case 0x71: // ADC HL,(ix+d) - case 0x72: // SUB HL,(ix+d) - case 0x73: // SBC HL,(ix+d) - case 0x74: // AND HL,(ix+d) - case 0x75: // XOR HL,(ix+d) - case 0x76: // OR HL,(ix+d) - case 0x77: // CP HL,(ix+d) - OP16( ADD+b2-0x70,12 ) R16( 1, HL ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; - - case 0x87: - OP( INC,12 ) MR16D8( 1, IX + b0 - 0xf0, b1 ) NONE( 2 ) return; // INC (ix+d) - case 0x8f: - OP( DEC,12 ) MR16D8( 1, IX + b0 - 0xf0, b1 ) NONE( 2 ) return; // DEC (ix+d) - - case 0x97: - OP( INCW,16 ) MR16D8( 1, IX + b0 - 0xf0, b1 ) NONE( 2 ) return; // INCW (ix+d) - case 0x9f: - OP( DECW,16 ) MR16D8( 1, IX + b0 - 0xf0, b1 ) NONE( 2 ) return; // DECW (ix+d) - - case 0xa0: // RLC (ix+d) - case 0xa1: // RRC (ix+d) - case 0xa2: // RL (ix+d) - case 0xa3: // RR (ix+d) - case 0xa4: // SLA (ix+d) - case 0xa5: // SRA (ix+d) - case 0xa6: // SLL (ix+d) - case 0xa7: // SRL (ix+d) - OP( RLC+b2-0xa0,12 ) MR16D8( 1, IX + b0 - 0xf0, b1 ) NONE( 2 ) return; - - case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: - OP( TSET,16 ) BIT8( 1, b2 - 0x18 ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; // TSET b,(ix+d) - case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - OP( BIT,10 ) BIT8( 1, b2 - 0xa8 ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; // BIT b,(ix+d) - case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: - OP( RES,14 ) BIT8( 1, b2 - 0xb0 ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; // RES b,(ix+d) - case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: - OP( SET,14 ) BIT8( 1, b2 - 0xb8 ) MR16D8( 2, IX + b0 - 0xf0, b1 ) return; // SET b,(ix+d) - } break; - - case 0xf3: - b1 = READ8(cpustate); - switch ( b1 ) { - case 0x10: // RLD (HL+A) - case 0x11: // RRD (HL+A) - OP( RLD+b1-0x10,20 ) MR16R8( 1, HL, A ) NONE( 2 ) return; - - case 0x12: // MUL HL,(HL+A) - case 0x13: // DIV HL,(HL+A) - OP( MUL+b1-0x12,26 ) R16( 1, HL ) MR16R8( 2, HL, A ) return; - - case 0x14: case 0x15: case 0x16: - OP16( ADD,16 ) R16( 1, IX+b1-0x14 ) MR16R8( 2, HL, A ) return; // ADD ix,(HL+A) - - case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: - OP( LD,14 ) R8( 1, b1 - 0x28 ) MR16R8( 2, HL, A ) return; // LD r,(HL+A) - case 0x48: case 0x49: case 0x4a: /*case 0x4b:*/ case 0x4c: case 0x4d: case 0x4e: - OP16( LD,16 ) R16( 1, b1 - 0x48 ) MR16R8( 2, HL, A ) return; // LD rr,(HL+A) - - case 0x50: case 0x51: case 0x52: /*case 0x53:*/ case 0x54: case 0x55: case 0x56: - OP( EX,22 ) MR16R8( 1, HL, A ) R16( 2, b1 - 0x50 ) return; // EX (HL+A),rr - - case 0x60: // ADD A,(HL+A) - case 0x61: // ADC A,(HL+A) - case 0x62: // SUB A,(HL+A) - case 0x63: // SBC A,(HL+A) - case 0x64: // AND A,(HL+A) - case 0x65: // XOR A,(HL+A) - case 0x66: // OR A,(HL+A) - case 0x67: // CP A,(HL+A) - OP( ADD+b1-0x60,14 ) R8( 1, A ) MR16R8( 2, HL, A ) return; - - case 0x70: // ADD HL,(HL+A) - case 0x71: // ADC HL,(HL+A) - case 0x72: // SUB HL,(HL+A) - case 0x73: // SBC HL,(HL+A) - case 0x74: // AND HL,(HL+A) - case 0x75: // XOR HL,(HL+A) - case 0x76: // OR HL,(HL+A) - case 0x77: // CP HL,(HL+A) - OP16( ADD+b1-0x70,16 ) R16( 1, HL ) MR16R8( 2, HL, A ) return; - - case 0x87: - OP( INC,16 ) MR16R8( 1, HL, A ) NONE( 2 ) return; // INC (HL+A) - case 0x8f: - OP( DEC,16 ) MR16R8( 1, HL, A ) NONE( 2 ) return; // DEC (HL+A) - - case 0x97: - OP( INCW,20 ) MR16R8( 1, HL, A ) NONE( 2 ) return; // INCW (HL+A) - case 0x9f: - OP( DECW,20 ) MR16R8( 1, HL, A ) NONE( 2 ) return; // DECW (HL+A) - - case 0xa0: // RLC (HL+A) - case 0xa1: // RRC (HL+A) - case 0xa2: // RL (HL+A) - case 0xa3: // RR (HL+A) - case 0xa4: // SLA (HL+A) - case 0xa5: // SRA (HL+A) - case 0xa6: // SLL (HL+A) - case 0xa7: // SRL (HL+A) - OP( RLC+b1-0xa0,16 ) MR16R8( 1, HL, A ) NONE( 2 ) return; - - case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: - OP( TSET,20 ) BIT8( 1, b1 - 0x18 ) MR16R8( 2, HL, A ) return; // TSET b,(HL+A) - case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - OP( BIT,14 ) BIT8( 1, b1 - 0xa8 ) MR16R8( 2, HL, A ) return; // BIT b,(HL+A) - case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: - OP( RES,18 ) BIT8( 1, b1 - 0xb0 ) MR16R8( 2, HL, A ) return; // RES b,(HL+A) - case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: - OP( SET,18 ) BIT8( 1, b1 - 0xb8 ) MR16R8( 2, HL, A ) return; // SET b,(HL+A) - } break; - - case 0xf4: case 0xf5: case 0xf6: - b1 = READ8(cpustate); - b2 = READ8(cpustate); - switch ( b2 ) { - case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: - OP( LD,10 ) MR16D8( 1, IX + b0 - 0xf4, b1 ) R8( 2, b2 - 0x20 ) return; // LD (ix+d),r - case 0x37: - OP( LD,12 ) MR16D8( 1, IX + b0 - 0xf4, b1 ) I8( 2, READ8(cpustate) ) return; // LD (ix+d),n - case 0x38: case 0x39: case 0x3a: /*case 0x3b:*/ case 0x3c: case 0x3d: case 0x3e: - OP( LDA,10 ) R16( 1, b2 - 0x38 ) R16D8( 2, IX + b0 - 0xf4, b1 ) return; // LDA rr,ix+d - case 0x3f: - OP( LDW,16 ) MR16D8( 1, IX + b0 - 0xf4, b1 ) I16( 2, READ16(cpustate) ) return; // LDW (ix+d),mn - case 0x40: case 0x41: case 0x42: /*case 0x43:*/ case 0x44: case 0x45: case 0x46: - OP16( LD,12 ) MR16D8( 1, IX + b0 - 0xf4, b1 ) R16( 2, b2 - 0x40 ) return; // LD (ix+d),rr - - case 0x68: // ADD (ix+d),n - case 0x69: // ADC (ix+d),n - case 0x6a: // SUB (ix+d),n - case 0x6b: // SBC (ix+d),n - case 0x6c: // AND (ix+d),n - case 0x6d: // XOR (ix+d),n - case 0x6e: // OR (ix+d),n - OP( ADD+b2-0x68,14) MR16D8( 1, IX + b0 - 0xf4, b1 ) I8( 2, READ8(cpustate) ) return; - case 0x6f: // CP (ix+d),n - OP( ADD+b2-0x68,12) MR16D8( 1, IX + b0 - 0xf4, b1 ) I8( 2, READ8(cpustate) ) return; - - case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: - case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: - OPCC( JP,10,12 ) CC( 1, b2 - 0xc0 ) R16D8( 2, IX + b0 - 0xf4, b1 ) return; // JP [cc,]ix+d - case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: - case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: - OPCC( CALL,10,18 ) CC( 1, b2 - 0xd0 ) R16D8( 2, IX + b0 - 0xf4, b1 ) return; // CALL [cc,]ix+d - } break; - - case 0xf7: - b1 = READ8(cpustate); - switch ( b1 ) { - case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: - OP( LD,14 ) MR16R8( 1, HL, A ) R8( 2, b1 - 0x20 ) return; // LD (HL+A),r - case 0x37: - OP( LD,16 ) MR16R8( 1, HL, A ) I8( 2, READ8(cpustate) ) return; // LD (HL+A),n - case 0x38: case 0x39: case 0x3a: /*case 0x3b:*/ case 0x3c: case 0x3d: case 0x3e: - OP( LDA,14 ) R16( 1, b1 - 0x38 ) R16R8( 2, HL, A ) return; // LDA rr,HL+A - case 0x3f: - OP( LDW,20 ) MR16R8( 1, HL, A ) I16( 2, READ16(cpustate) ) return; // LDW (HL+A),mn - case 0x40: case 0x41: case 0x42: /*case 0x43:*/ case 0x44: case 0x45: case 0x46: - OP16( LD,16 ) MR16R8( 1, HL, A ) R16( 2, b1 - 0x40 ) return; // LD (HL+A),rr - - case 0x68: // ADD (HL+A),n - case 0x69: // ADC (HL+A),n - case 0x6a: // SUB (HL+A),n - case 0x6b: // SBC (HL+A),n - case 0x6c: // AND (HL+A),n - case 0x6d: // XOR (HL+A),n - case 0x6e: // OR (HL+A),n - OP( ADD+b1-0x68,18) MR16R8( 1, HL, A ) I8( 2, READ8(cpustate) ) return; - case 0x6f: // CP (HL+A),n - OP( ADD+b1-0x68,16) MR16R8( 1, HL, A ) I8( 2, READ8(cpustate) ) return; - - case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: - case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: - OPCC( JP,14,16 ) CC( 1, b1 - 0xc0 ) R16R8( 2, HL, A ) return; // JP [cc,]HL+A - case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: - case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: - OPCC( CALL,14,22 ) CC( 1, b1 - 0xd0 ) R16R8( 2, HL, A ) return; // CALL [cc,]HL+A - } break; - - case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: - b1 = READ8(cpustate); - switch ( b1 ) { - case 0x12: // MUL HL,g - case 0x13: // DIV HL,g - OP( MUL+b1-0x12,18) R16( 1, HL ) R8( 2, b0 - 0xf8 ) return; - - case 0x14: case 0x15: case 0x16: - OP16( ADD,8 ) R16( 1, IX+b1-0x14 ) R16( 2, b0 - 0xf8 ) return; // ADD ix,gg - - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: - OP( LD,4 ) R8( 1, b1 - 0x30 ) R8( 2, b0 - 0xf8 ) return; // LD r,g - case 0x38: case 0x39: case 0x3a: /*case 0x3b:*/ case 0x3c: case 0x3d: case 0x3e: - OP16( LD,6 ) R16( 1, b1 - 0x38 ) R16( 2, b0 - 0xf8 ) return; // LD rr,gg - - case 0x58: // LDI - case 0x59: // LDIR - case 0x5a: // LDD - case 0x5b: // LDDR - case 0x5c: // CPI - case 0x5d: // CPIR - case 0x5e: // CPD - case 0x5f: // CPDR - if (b0 == 0xfe) { - OPCC( LDI+b1-0x58,14,18 ) NONE( 1 ) NONE( 2 ) return; - } - - case 0x60: // ADD A,g - case 0x61: // ADC A,g - case 0x62: // SUB A,g - case 0x63: // SBC A,g - case 0x64: // AND A,g - case 0x65: // XOR A,g - case 0x66: // OR A,g - case 0x67: // CP A,g - OP( ADD+b1-0x60,4 ) R8( 1, A ) R8( 2, b0 - 0xf8 ) return; - - case 0x68: // ADD g,n - case 0x69: // ADC g,n - case 0x6a: // SUB g,n - case 0x6b: // SBC g,n - case 0x6c: // AND g,n - case 0x6d: // XOR g,n - case 0x6e: // OR g,n - case 0x6f: // CP g,n - OP( ADD+b1-0x68,6 ) R8( 1, b0 - 0xf8 ) I8( 2, READ8(cpustate) ) return; - - case 0x70: // ADD HL,gg - case 0x71: // ADC HL,gg - case 0x72: // SUB HL,gg - case 0x73: // SBC HL,gg - case 0x74: // AND HL,gg - case 0x75: // XOR HL,gg - case 0x76: // OR HL,gg - case 0x77: // CP HL,gg - OP16( ADD+b1-0x70,8 ) R16( 1, HL ) R16( 2, b0 - 0xf8 ) return; - - case 0xa0: // RLC g - case 0xa1: // RRC g - case 0xa2: // RL g - case 0xa3: // RR g - case 0xa4: // SLA g - case 0xa5: // SRA g - case 0xa6: // SLL g - case 0xa7: // SRL g - OP( RLC+b1-0xa0,4 ) R8( 1, b0 - 0xf8 ) NONE( 2 ) return; - - case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: - OP( TSET,8 ) BIT8( 1, b1 - 0x18 ) R8( 2, b0 - 0xf8 ) return; // TSET b,g - case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - OP( BIT,4 ) BIT8( 1, b1 - 0xa8 ) R8( 2, b0 - 0xf8 ) return; // BIT b,g - case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: - OP( RES,4 ) BIT8( 1, b1 - 0xb0 ) R8( 2, b0 - 0xf8 ) return; // RES b,g - case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: - OP( SET,4 ) BIT8( 1, b1 - 0xb8 ) R8( 2, b0 - 0xf8 ) return; // SET b,g - - case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: - case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: - if (b0 == 0xfe) { - OPCC( RET,6,14 ) CC( 1, b1 - 0xd0 ) NONE( 2 ) return; // RET cc - } - } break; - - case 0xff: - OP( SWI,20 ) NONE( 1 ) NONE( 2 ) return; // SWI - } - - OP( UNKNOWN,2 ) NONE( 1 ) NONE( 2 ) -} - -#if 0 -static const char *const ir_names[] = { - "P0", "P1", "P01CR/IRFL", "IRFH", "P2", "P2CR", "P3", "P3CR", - "P4", "P4CR", "P5", "SMMOD", "P6", "P7", "P67CR", "SMCR", - "P8", "P8CR", "WDMOD", "WDCR", "TREG0", "TREG1", "TREG2", "TREG3", - "TCLK", "TFFCR", "TMOD", "TRUN", "CAP1L", "CAP1H", "CAP2L", "CAL2H", - "TREG4L", "TREG4H", "TREG5L", "TREG5H", "T4MOD", "T4FFCR", "INTEL", "INTEH", - "DMAEH", "SCMOD", "SCCR", "SCBUF", "BX", "BY", "ADREG", "ADMOD" -}; - -static const char *internal_registers_names(UINT16 x) -{ - INT32 ir = x - T90_IOBASE; - if ( ir >= 0 && ir < sizeof(ir_names)/sizeof(ir_names[0]) ) - return ir_names[ir]; - return NULL; -} -static INT32 sprint_arg(char *buffer, UINT32 pc, const char *pre, const e_mode mode, const e_r r, const e_r rb) -{ - const char *reg_name; - switch ( mode ) - { - case MODE_NONE: return 0; - - case MODE_BIT8: return sprintf( buffer, "%s%d", pre, r ); - case MODE_I8: return sprintf( buffer, "%s$%02X", pre, r ); - case MODE_D8: return sprintf( buffer, "%s$%04X", pre, (pc+2+(r&0x7f)-(r&0x80))&0xffff ); - case MODE_I16: return sprintf( buffer, "%s$%04X", pre, r ); - case MODE_D16: return sprintf( buffer, "%s$%04X", pre, (pc+2+(r&0x7fff)-(r&0x8000))&0xffff ); - case MODE_MI16: - reg_name = internal_registers_names(r); - return (reg_name) ? sprintf( buffer, "%s(%s)", pre, reg_name ): - sprintf( buffer, "%s($%04X)", pre, r ); - case MODE_R8: return sprintf( buffer, "%s%s", pre, r8_names[r] ); - case MODE_R16: return sprintf( buffer, "%s%s", pre, r16_names[r] ); - case MODE_MR16: return sprintf( buffer, "%s(%s)", pre, r16_names[r] ); - - case MODE_MR16R8: return sprintf( buffer, "%s(%s+%s)", pre, r16_names[r], r8_names[rb] ); - case MODE_MR16D8: return sprintf( buffer, "%s(%s%c$%02X)", pre, r16_names[r], (rb&0x80)?'-':'+', (rb&0x80)?((rb^0xff)+1):rb ); - - case MODE_CC: return sprintf( buffer, "%s%s", pre, cc_names[r] ); - - case MODE_R16R8: return sprintf( buffer, "%s%s+%s", pre, r16_names[r], r8_names[rb] ); - case MODE_R16D8: return sprintf( buffer, "%s%s%c$%02X", pre, r16_names[r], (rb&0x80)?'-':'+', (rb&0x80)?((rb^0xff)+1):rb ); - - //default: - // fatalerror("%04x: unimplemented addr mode = %d\n",pc,mode); - } - - return 0; -} - -CPU_DISASSEMBLE( t90 ) -{ - t90_Regs *cpustate = get_safe_token(device); - INT32 len; - - cpustate->addr = pc; - - decode(cpustate); - cpustate->op &= ~OP_16; - - buffer += sprintf ( buffer, "%-5s", op_names[ cpustate->op ] ); // strlen("callr") == 5 - len = sprint_arg ( buffer, pc, " ", cpustate->mode1, cpustate->r1, cpustate->r1b ); - buffer += len; - buffer += sprint_arg ( buffer, pc, (len>1)?",":"", cpustate->mode2, cpustate->r2, cpustate->r2b ); - - return (cpustate->addr - pc) | DASMFLAG_SUPPORTED; -} -#endif - -INLINE UINT16 r8( t90_Regs *cpustate, const e_r r ) -{ - switch( r ) - { - case A: return cpustate->af.b.h; - case B: return cpustate->bc.b.h; - case C: return cpustate->bc.b.l; - case D: return cpustate->de.b.h; - case E: return cpustate->de.b.l; - case H: return cpustate->hl.b.h; - case L: return cpustate->hl.b.l; - - //default: - // fatalerror("%04x: unimplemented r8 register index = %d\n",cpustate->pc.w.l,r); - } - - return 0; -} - -INLINE void w8( t90_Regs *cpustate, const e_r r, UINT16 value ) -{ - switch( r ) - { - case A: cpustate->af.b.h = value; return; - case B: cpustate->bc.b.h = value; return; - case C: cpustate->bc.b.l = value; return; - case D: cpustate->de.b.h = value; return; - case E: cpustate->de.b.l = value; return; - case H: cpustate->hl.b.h = value; return; - case L: cpustate->hl.b.l = value; return; - - //default: - // fatalerror("%04x: unimplemented w8 register index = %d\n",cpustate->pc.w.l,r); - } -} - -INLINE UINT16 r16( t90_Regs *cpustate, const e_r r ) -{ - switch( r ) - { - case BC: return cpustate->bc.w.l; - case DE: return cpustate->de.w.l; - case HL: return cpustate->hl.w.l; - case IX: return cpustate->ix.w.l; - case IY: return cpustate->iy.w.l; - case SP: return cpustate->sp.w.l; - case AF: return cpustate->af.w.l; -// case AF2: return cpustate->af2.w.l; -// one interrupt flip-flop? Needed by e.g. mjifb - case AF2: return (cpustate->af2.w.l & (~IF)) | (cpustate->af.w.l & IF); - case PC: return cpustate->pc.w.l; - - //default: - // fatalerror("%04x: unimplemented r16 register index = %d\n",cpustate->pc.w.l,r); - } - - return 0; -} - -INLINE void w16( t90_Regs *cpustate, const e_r r, UINT16 value ) -{ - switch( r ) - { - case BC: cpustate->bc.w.l = value; return; - case DE: cpustate->de.w.l = value; return; - case HL: cpustate->hl.w.l = value; return; - case IX: cpustate->ix.w.l = value; return; - case IY: cpustate->iy.w.l = value; return; - case SP: cpustate->sp.w.l = value; return; - case AF: cpustate->af.w.l = value; return; - case AF2: cpustate->af2.w.l = value; return; - case PC: cpustate->pc.d = value; return; - - //default: - // fatalerror("%04x: unimplemented w16 register index = %d\n",cpustate->pc.w.l,r); - } -} - - -#define READ_FN( N ) \ -INLINE UINT8 Read##N##_8(t90_Regs *cpustate) { \ - switch ( cpustate->mode##N ) { \ - case MODE_CC: \ - case MODE_BIT8: \ - case MODE_I8: return (UINT8)cpustate->r##N; \ - case MODE_D8: return (UINT8)cpustate->r##N; \ - case MODE_R8: return (UINT8)r8(cpustate, cpustate->r##N); \ - case MODE_MI16: return RM8(cpustate, cpustate->r##N); \ - case MODE_MR16R8: return RM8(cpustate, (UINT16)(r16(cpustate, cpustate->r##N) + (INT8)r8(cpustate, cpustate->r##N##b))); \ - case MODE_MR16: \ - switch( cpustate->r##N ) { \ - case IX: return RX8(cpustate, cpustate->ix.w.l,cpustate->ixbase); \ - case IY: return RX8(cpustate, cpustate->iy.w.l,cpustate->iybase); \ - } \ - return RM8(cpustate, r16(cpustate, cpustate->r##N)); \ - case MODE_MR16D8: \ - switch( cpustate->r##N ) { \ - case IX: return RX8(cpustate, (UINT16)(cpustate->ix.w.l + (INT8)cpustate->r##N##b),cpustate->ixbase); \ - case IY: return RX8(cpustate, (UINT16)(cpustate->iy.w.l + (INT8)cpustate->r##N##b),cpustate->iybase); \ - } \ - return RM8(cpustate, (UINT16)(r16(cpustate, cpustate->r##N) + (INT8)cpustate->r##N##b)); \ - default: \ - printf("%04x: unimplemented Read%d_8 mode = %d\n",cpustate->pc.w.l,N,cpustate->mode##N); \ - } \ - return 0; \ -} \ -INLINE UINT16 Read##N##_16(t90_Regs *cpustate) { \ - switch ( cpustate->mode##N ) { \ - case MODE_I16: return cpustate->r##N; \ - case MODE_D16: return cpustate->r##N - 1; \ - case MODE_R16: return r16(cpustate, cpustate->r##N); \ - case MODE_R16D8: return r16(cpustate, cpustate->r##N) + (INT8)cpustate->r##N##b; \ - case MODE_R16R8: return r16(cpustate, cpustate->r##N) + (INT8)r8(cpustate, cpustate->r##N##b); \ - case MODE_MI16: return RM16(cpustate, cpustate->r##N); \ - case MODE_MR16R8: return RM16(cpustate,(UINT16)(r16(cpustate, cpustate->r##N) + (INT8)r8(cpustate, cpustate->r##N##b))); \ - case MODE_MR16: \ - switch( cpustate->r##N ) { \ - case IX: return RX16(cpustate, cpustate->ix.w.l,cpustate->ixbase); \ - case IY: return RX16(cpustate, cpustate->iy.w.l,cpustate->iybase); \ - } \ - return RM16(cpustate,r16(cpustate, cpustate->r##N)); \ - case MODE_MR16D8: \ - switch( cpustate->r##N ) { \ - case IX: return RX16(cpustate, (UINT16)(cpustate->ix.w.l + (INT8)cpustate->r##N##b),cpustate->ixbase); \ - case IY: return RX16(cpustate, (UINT16)(cpustate->iy.w.l + (INT8)cpustate->r##N##b),cpustate->iybase); \ - } \ - return RM16(cpustate, (UINT16)(r16(cpustate, cpustate->r##N) + (INT8)cpustate->r##N##b)); \ - default: \ - printf("%04x: unimplemented Read%d_16 modes = %d\n",cpustate->pc.w.l,N,cpustate->mode##N); \ - } \ - return 0; \ -} - - - -#define WRITE_FN( N ) \ -INLINE void Write##N##_8( t90_Regs *cpustate, UINT8 value ) { \ - switch ( cpustate->mode##N ) { \ - case MODE_R8: w8(cpustate, cpustate->r##N,value); return; \ - case MODE_MI16: WM8(cpustate, cpustate->r##N, value); return; \ - case MODE_MR16R8: WM8(cpustate, (UINT16)(r16(cpustate, cpustate->r##N) + (INT8)r8(cpustate, cpustate->r##N##b)), value); return; \ - case MODE_MR16: \ - switch( cpustate->r##N ) { \ - case IX: WX8(cpustate, cpustate->ix.w.l,value,cpustate->ixbase); return; \ - case IY: WX8(cpustate, cpustate->iy.w.l,value,cpustate->iybase); return; \ - } \ - WM8(cpustate, r16(cpustate, cpustate->r##N), value); return; \ - case MODE_MR16D8: \ - switch( cpustate->r##N ) { \ - case IX: WX8(cpustate, (UINT16)(cpustate->ix.w.l + (INT8)cpustate->r##N##b),value,cpustate->ixbase); return; \ - case IY: WX8(cpustate, (UINT16)(cpustate->iy.w.l + (INT8)cpustate->r##N##b),value,cpustate->iybase); return; \ - } \ - WM8(cpustate, (UINT16)(r16(cpustate, cpustate->r##N) + (INT8)cpustate->r##N##b), value); return; \ - default: \ - printf("%04x: unimplemented Write%d_8 mode = %d\n",cpustate->pc.w.l,N,cpustate->mode##N); \ - } \ -} \ -INLINE void Write##N##_16( t90_Regs *cpustate, UINT16 value ) \ -{ \ - switch ( cpustate->mode##N ) { \ - case MODE_R16: w16(cpustate, cpustate->r##N,value); return; \ - case MODE_MI16: WM16(cpustate, cpustate->r##N, value); return; \ - case MODE_MR16R8: WM16(cpustate, (UINT16)(r16(cpustate, cpustate->r##N) + (INT8)r8(cpustate, cpustate->r##N##b)), value); return; \ - case MODE_MR16: \ - switch( cpustate->r##N ) { \ - case IX: WX16(cpustate, cpustate->ix.w.l,value,cpustate->ixbase); return; \ - case IY: WX16(cpustate, cpustate->iy.w.l,value,cpustate->iybase); return; \ - } \ - WM16(cpustate, r16(cpustate, cpustate->r##N), value); return; \ - case MODE_MR16D8: \ - switch( cpustate->r##N ) { \ - case IX: WX16(cpustate, (UINT16)(cpustate->ix.w.l + (INT8)cpustate->r##N##b),value,cpustate->ixbase); return; \ - case IY: WX16(cpustate, (UINT16)(cpustate->iy.w.l + (INT8)cpustate->r##N##b),value,cpustate->iybase); return; \ - } \ - WM16(cpustate, (UINT16)(r16(cpustate, cpustate->r##N) + (INT8)cpustate->r##N##b), value); return; \ - default: \ - printf("%04x: unimplemented Write%d_16 mode = %d\n",cpustate->pc.w.l,N,cpustate->mode##N); \ - } \ -} - -READ_FN(1) -READ_FN(2) -WRITE_FN(1) -WRITE_FN(2) - -INLINE INT32 Test( t90_Regs *cpustate, UINT8 cond ) -{ - INT32 s,v; - switch ( cond ) - { - case FLS: return 0; - case LT: s = F & SF; v = F & VF; return (s && !v) || (!s && v); - case LE: s = F & SF; v = F & VF; return (F & ZF) || (s && !v) || (!s && v); - case ULE: return (F & CF) || (F & ZF); - case OV: return F & VF; - case MI: return F & SF; - case Z: return F & ZF; - case CR: return F & CF; - case T: return 1; - case GE: s = F & SF; v = F & VF; return (s && v) || (!s && !v); - case GT: s = F & SF; v = F & VF; return !((F & ZF) || (s && !v) || (!s && v)); - case UGT: return !(F & CF) && !(F & ZF); - case NOV: return !(F & VF); - case PL: return !(F & SF); - case NZ: return !(F & ZF); - case NC: return !(F & CF); - //default: - // fatalerror("%04x: unimplemented condition = %d\n",cpustate->pc.w.l,cond); - } - return 0; -} - -INLINE void Push( t90_Regs *cpustate, e_r rr ) -{ - cpustate->sp.w.l -= 2; - WM16( cpustate, cpustate->sp.w.l, r16(cpustate, rr) ); -} -INLINE void Pop( t90_Regs *cpustate, e_r rr ) -{ - w16( cpustate, rr, RM16( cpustate, cpustate->sp.w.l ) ); - cpustate->sp.w.l += 2; -} - -/************************************************************************************************************* - -Interrupts - ----------------------------------------------------------------------------------------------------------------- -Priority Type Interrupt Source Vector/8 Vector Address uDMA Address ----------------------------------------------------------------------------------------------------------------- -1 Non Maskable SWI - 10 0010 - -2 "" NMI - 18 0018 - -3 "" INTWD Watch Dog - 20 0020 - -4 Maskable INT0 External 0 05 28 0028 FF28 -5 "" INTT0 Timer 0 06 30 0030 FF30 -6 "" INTT1 Timer 1 07 38 0038 FF38 -7 "" INTAD A/D 08 40 0040 FF48 -"" "" INTT2 Timer 2 "" "" "" "" -8 "" INTT3 Timer 3 09 48 0048 FF48 -9 "" INTT4 Timer 4 0A 50 0050 FF50 -10 "" INT1 External 1 0B 58 0058 FF58 -11 "" INTT5 Timer 5 0C 60 0060 FF60 -12 "" INT2 External 2 0D 68 0068 FF68 -13 "" INTRX End Serial Receive 0E 70 0070 FF70 -14 "" INTTX End Serial Transmit 0F 78 0078 FF78 - ----------------------------------------------------------------------------------------------------------------- -Interrupt Terminal Mode How To Set ----------------------------------------------------------------------------------------------------------------- -NMI - Falling Edge - -INT0 P80 Level P8CR = 0 - Rising Edge P8CR = 1 -INT1 P81 Rising Edge T4MOD = 0,0 or 0,1 or 1,1 - Falling Edge T4MOD = 1,0 -INT2 P82 Rising Edge - - -*************************************************************************************************************/ - -enum e_irq { INTSWI = 0, INTNMI = 1, INTWD = 2, INT0 = 3, INTT0 = 4, INTT1 = 5, INTT2 = 6, INTT3 = 7, INTT4 = 8, INT1 = 9, INTT5 = 10, INT2 = 11, INTRX = 12, INTTX = 13, INTMAX = 14 }; -//DECLARE_ENUM_OPERATORS(e_irq) - -INLINE void leave_halt(t90_Regs *cpustate) -{ - if( cpustate->halt ) - { - cpustate->halt = 0; - cpustate->pc.w.l++; - } -} - -static void take_interrupt(t90_Regs *cpustate, e_irq irq) -{ - cpustate->irq_state &= ~(1 << irq); - - leave_halt(cpustate); - - Push( cpustate, PC ); - Push( cpustate, AF ); - - F &= ~IF; - - cpustate->pc.w.l = 0x10 + irq * 8; - - cpustate->extra_cycles += 20*2; -} - -static void check_interrupts(t90_Regs *cpustate) -{ - INT32 irq; - INT32 mask; - - if (!(F & IF)) - return; - - for (irq = INTSWI; irq < INTMAX; irq++) - { - mask = (1 << irq); - if(irq >= INT0) mask &= cpustate->irq_mask; - if ( cpustate->irq_state & mask ) - { - take_interrupt( cpustate, (e_irq)irq ); - return; - } - } -} - -void tlcs90_set_irq_line(INT32 irq, INT32 state) -{ - t90_Regs *cpustate = &tlcs90_data[0]; - - if ( ((cpustate->irq_state >> irq)&1) == state ) return; - - if (state) - { - cpustate->irq_state |= 1 << irq; - check_interrupts(cpustate); - } - else - { - cpustate->irq_state &= ~(1 << irq); - } -} - -void tlcs90SetIRQLine(INT32 line, INT32 state) -{ - // right?? - if (line == 0) line = INT0; - else if (line == 1) line = INT1; - else if (line == 2) line = INT2; - else if (line==0x20)line = INTNMI; - - switch (state) - { - case 0: // none - case 1: // ack - tlcs90_set_irq_line(line, state); - break; - - case 2: // auto - tlcs90_set_irq_line(line, 1); - tlcs90Run(10); - tlcs90_set_irq_line(line, 0); - tlcs90Run(10); - break; - } -} - -INLINE void Cyc(t90_Regs *cpustate) { cpustate->icount -= cpustate->cyc_t; } -INLINE void Cyc_f(t90_Regs *cpustate) { cpustate->icount -= cpustate->cyc_f; } - -INT32 tlcs90Run(INT32 nCycles) -{ - t90_Regs *cpustate = &tlcs90_data[0]; //get_safe_token(device); - UINT8 a8,b8; - UINT16 a16,b16; - UINT32 a32; - PAIR tmp; - - cpustate->icount=nCycles; - cpustate->nCycles = nCycles + cpustate->extra_cycles; - if (cpustate->extra_cycles>0) { - cpustate->icount+=cpustate->extra_cycles; - } - cpustate->extra_cycles = 0; - - do - { - INT32 prev_cycles = cpustate->icount; // for timers - cpustate->prvpc.d = cpustate->pc.d; - // debugger_instruction_hook(device, cpustate->pc.d); - - check_interrupts(cpustate); - - cpustate->addr = cpustate->pc.d; - decode(cpustate); - cpustate->pc.d = cpustate->addr; - - switch ( cpustate->op ) - { - case NOP: - Cyc(cpustate); - break; - - case EX: - a16 = Read1_16(cpustate); - Write1_16( cpustate, Read2_16(cpustate) ); - Write2_16( cpustate, a16 ); - Cyc(cpustate); - break; - case EXX: - tmp = cpustate->bc; cpustate->bc = cpustate->bc2; cpustate->bc2 = tmp; - tmp = cpustate->de; cpustate->de = cpustate->de2; cpustate->de2 = tmp; - tmp = cpustate->hl; cpustate->hl = cpustate->hl2; cpustate->hl2 = tmp; - Cyc(cpustate); - break; - - case LD: - Write1_8( cpustate, Read2_8(cpustate) ); - Cyc(cpustate); - break; - case LDW: - case LD | OP_16: - Write1_16( cpustate, Read2_16(cpustate) ); - Cyc(cpustate); - break; - -// case LDA: -// Cyc(cpustate); -// break; - - case LDI: -#define _LDI \ - WM8( cpustate, cpustate->de.w.l, RM8(cpustate, cpustate->hl.w.l) ); \ - cpustate->de.w.l++; \ - cpustate->hl.w.l++; \ - cpustate->bc.w.l--; \ - F &= SF | ZF | IF | XCF | CF; \ - if ( cpustate->bc.w.l ) F |= VF; - - _LDI - Cyc(cpustate); - break; - case LDIR: - _LDI - if ( cpustate->bc.w.l ) - { - cpustate->pc.w.l -= 2; - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - - case LDD: -#define _LDD \ - WM8( cpustate, cpustate->de.w.l, RM8(cpustate, cpustate->hl.w.l) ); \ - cpustate->de.w.l--; \ - cpustate->hl.w.l--; \ - cpustate->bc.w.l--; \ - F &= SF | ZF | IF | XCF | CF; \ - if ( cpustate->bc.w.l ) F |= VF; - - _LDD - Cyc(cpustate); - break; - case LDDR: - _LDD - if ( cpustate->bc.w.l ) - { - cpustate->pc.w.l -= 2; - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - - -// case CPD: -// Cyc(cpustate); -// break; -// case CPDR: -// Cyc(cpustate); -// break; - case CPI: - a8 = RM8(cpustate, cpustate->hl.w.l); - b8 = cpustate->af.b.h - a8; - cpustate->hl.w.l++; - cpustate->bc.w.l--; - F = (F & (IF | CF)) | SZ[b8] | ((cpustate->af.b.h^a8^b8)&HF) | NF; - if ( cpustate->bc.w.l ) F |= VF; - Cyc(cpustate); - break; - case CPIR: - a8 = RM8(cpustate, cpustate->hl.w.l); - b8 = cpustate->af.b.h - a8; - cpustate->hl.w.l++; - cpustate->bc.w.l--; - F = (F & (IF | CF)) | SZ[b8] | ((cpustate->af.b.h^a8^b8)&HF) | NF; - if ( cpustate->bc.w.l ) - { - F |= VF; - cpustate->pc.w.l -= 2; - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - - case PUSH: - Push( cpustate, cpustate->r1 ); - Cyc(cpustate); - break; - case POP: - Pop( cpustate, cpustate->r1 ); - Cyc(cpustate); - break; - - case JP: - if ( Test( cpustate, Read1_8(cpustate) ) ) - { - cpustate->pc.w.l = Read2_16(cpustate); - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - case JR: - if ( Test( cpustate, Read1_8(cpustate) ) ) - { - cpustate->pc.w.l += /*2 +*/ (INT8)Read2_8(cpustate); - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - case JR | OP_16: - if ( Test( cpustate, Read1_8(cpustate) ) ) - { - cpustate->pc.w.l += /*2 +*/ Read2_16(cpustate); - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - - - case CALL: - if ( Test( cpustate, Read1_8(cpustate) ) ) - { - Push( cpustate, PC ); - cpustate->pc.w.l = Read2_16(cpustate); - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - case CALLR: - Push( cpustate, PC ); - cpustate->pc.w.l += /*2 +*/ Read1_16(cpustate); - Cyc(cpustate); - break; - - case RET: - if ( Test( cpustate, Read1_8(cpustate) ) ) - { - Pop( cpustate, PC ); - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - case RETI: - Pop( cpustate, AF ); - Pop( cpustate, PC ); - Cyc(cpustate); - break; - -// case HALT: -// Cyc(cpustate); -// break; - case DI: - cpustate->after_EI = 0; - F &= ~IF; - Cyc(cpustate); - break; - case EI: - cpustate->after_EI = !(F & IF); - Cyc(cpustate); - break; - - case SWI: - Cyc(cpustate); - take_interrupt( cpustate, INTSWI ); - break; - - case DAA: - { - UINT8 cf, nf, hf, lo, hi, diff; - cf = F & CF; - nf = F & NF; - hf = F & HF; - lo = cpustate->af.b.h & 15; - hi = cpustate->af.b.h / 16; - - if (cf) - { - diff = (lo <= 9 && !hf) ? 0x60 : 0x66; - } - else - { - if (lo >= 10) - { - diff = hi <= 8 ? 0x06 : 0x66; - } - else - { - if (hi >= 10) - { - diff = hf ? 0x66 : 0x60; - } - else - { - diff = hf ? 0x06 : 0x00; - } - } - } - if (nf) cpustate->af.b.h -= diff; - else cpustate->af.b.h += diff; - - F = SZP[A] | (F & (IF | NF)); - if (cf || (lo <= 9 ? hi >= 10 : hi >= 9)) F |= XCF | CF; - if (nf ? hf && lo <= 5 : lo >= 10) F |= HF; - } - Cyc(cpustate); - break; - - - case CPL: - cpustate->af.b.h ^= 0xff; - F |= HF | NF; - Cyc(cpustate); - break; - case NEG: - a8 = 0; - b8 = cpustate->af.b.h; - a32 = a8 - b8; - F = (F & IF) | SZ[(UINT8)a32] | NF; - if (a32 & 0x100) F |= CF | XCF; //X? - if ((a8 ^ a32 ^ b8) & 0x10) F |= HF; - if ((b8 ^ a8) & (a8 ^ a32) & 0x80) F |= VF; - cpustate->af.b.h = a32; - Cyc(cpustate); - break; - - case LDAR: - cpustate->hl.w.l = cpustate->pc.w.l + /*2 +*/ Read2_16(cpustate); - Cyc(cpustate); - break; - - case RCF: - F &= SF | ZF | IF | VF; - Cyc(cpustate); - break; - case SCF: - F = (F & (SF | ZF | IF | VF)) | XCF | CF; - Cyc(cpustate); - break; - case CCF: - F = (F & (SF | ZF | IF | VF)) | ((F & CF)?HF:(XCF | CF)); - Cyc(cpustate); - break; - -// case TSET: -// Cyc(cpustate); -// break; - case BIT: - F = (F & (IF | CF)) | HF | SZ_BIT[ Read2_8(cpustate) & (1 << Read1_8(cpustate)) ]; - Cyc(cpustate); - break; - case SET: - Write2_8( cpustate, Read2_8(cpustate) | (1 << Read1_8(cpustate)) ); - Cyc(cpustate); - break; - case RES: - Write2_8( cpustate, Read2_8(cpustate) & (~(1 << Read1_8(cpustate))) ); - Cyc(cpustate); - break; - - case INC: - a8 = Read1_8(cpustate) + 1; - Write1_8( cpustate, a8 ); - F = (F & (IF | CF)) | SZHV_inc[a8]; - if (a8 == 0) F |= XCF; - Cyc(cpustate); - break; - case INCX: - if ( F & XCF ) - { - a8 = Read1_8(cpustate) + 1; - Write1_8( cpustate, a8 ); - F = (F & (IF | CF)) | SZHV_inc[a8]; - if (a8 == 0) F |= XCF; - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - case INC | OP_16: - a16 = Read1_16(cpustate) + 1; - Write1_16( cpustate, a16 ); - if (a16 == 0) F |= XCF; - else F &= ~XCF; - Cyc(cpustate); - break; - case INCW: - a16 = Read1_16(cpustate); - a32 = a16 + 1; - Write1_16( cpustate, a32 ); - F &= IF | CF; - if ((UINT16)a32 == 0) F |= ZF | XCF; - if (a32 & 0x8000) F |= SF; - if ((a16 ^ 0x8000) & a32 & 0x8000) F |= VF; - if ((a16 ^ a32 ^ 1) & 0x1000) F |= HF; //?? - Cyc(cpustate); - break; - - - case DEC: - a8 = Read1_8(cpustate) - 1; - Write1_8( cpustate, a8 ); - F = (F & (IF | CF)) | SZHV_dec[a8]; - if (a8 == 0) F |= XCF; - Cyc(cpustate); - break; - case DECX: - if ( F & XCF ) - { - a8 = Read1_8(cpustate) - 1; - Write1_8( cpustate, a8 ); - F = (F & (IF | CF)) | SZHV_dec[a8]; - if (a8 == 0) F |= XCF; - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - case DEC | OP_16: - a16 = Read1_16(cpustate) - 1; - Write1_16( cpustate, a16 ); - if (a16 == 0) F |= XCF; - else F &= ~XCF; - Cyc(cpustate); - break; - case DECW: - a16 = Read1_16(cpustate); - a32 = a16 - 1; - Write1_16( cpustate, a32 ); - F = (F & (IF | CF)) | NF; - if ((UINT16)a32 == 0) F |= ZF | XCF; - if (a32 & 0x8000) F |= SF; - if (a16 == 0x8000) F |= VF; - if ((a16 ^ a32 ^ 1) & 0x1000) F |= HF; //?? - Cyc(cpustate); - break; - - case ADD: - case ADC: - a8 = Read1_8(cpustate); - b8 = Read2_8(cpustate); - a32 = a8 + b8; - if ( (cpustate->op == ADC) && (F & CF) ) a32 += 1; - Write1_8( cpustate, a32 ); - F = (F & IF) | SZ[(UINT8)a32]; - if (a32 & 0x100) F |= CF | XCF; //X? - if ((a8 ^ a32 ^ b8) & 0x10) F |= HF; - if ((b8 ^ a8 ^ 0x80) & (b8 ^ a32) & 0x80) F |= VF; - Cyc(cpustate); - break; - case ADD | OP_16: - case ADC | OP_16: - a16 = Read1_16(cpustate); - b16 = Read2_16(cpustate); - a32 = a16 + b16; - if ( (cpustate->op == (ADC | OP_16)) && (F & CF) ) a32 += 1; - Write1_16( cpustate, a32 ); - if ( (cpustate->op == (ADD | OP_16)) && cpustate->mode2 == MODE_R16 ) - { - F &= SF | ZF | IF | VF; - } - else - { - F &= IF; - if ((UINT16)a32 == 0) F |= ZF; - if (a32 & 0x8000) F |= SF; - if ((b16 ^ a16 ^ 0x8000) & (b16 ^ a32) & 0x8000) F |= VF; - } - if (a32 & 0x10000) F |= CF | XCF; //X? - if ((a16 ^ a32 ^ b16) & 0x1000) F |= HF; //?? - Cyc(cpustate); - break; - - case CP: - case SUB: - case SBC: - a8 = Read1_8(cpustate); - b8 = Read2_8(cpustate); - a32 = a8 - b8; - if ( (cpustate->op == SBC) && (F & CF) ) a32 -= 1; - F = (F & IF) | SZ[(UINT8)a32] | NF; - if (a32 & 0x100) F |= CF | XCF; //X? - if ((a8 ^ a32 ^ b8) & 0x10) F |= HF; - if ((b8 ^ a8) & (a8 ^ a32) & 0x80) F |= VF; - if (cpustate->op != CP) - Write1_8( cpustate, a32 ); - Cyc(cpustate); - break; - case CP | OP_16: - case SUB | OP_16: - case SBC | OP_16: - a16 = Read1_16(cpustate); - b16 = Read2_16(cpustate); - a32 = a16 - b16; - if ( (cpustate->op == (SBC | OP_16)) && (F & CF) ) a32 -= 1; - F = (F & IF) | NF; - if ((UINT16)a32 == 0) F |= ZF; - if (a32 & 0x8000) F |= SF; - if (a32 & 0x10000) F |= CF | XCF; //X? - if ((a16 ^ a32 ^ b16) & 0x1000) F |= HF; //?? - if ((b16 ^ a16) & (a16 ^ a32) & 0x8000) F |= VF; - if (cpustate->op != (CP | OP_16)) - Write1_16( cpustate, a32 ); - Cyc(cpustate); - break; - - case AND: - a8 = Read1_8(cpustate) & Read2_8(cpustate); - Write1_8( cpustate, a8 ); - F = (F & IF) | SZP[a8] | HF; - Cyc(cpustate); - break; - case AND | OP_16: - a16 = Read1_16(cpustate) & Read2_16(cpustate); - Write1_16( cpustate, a16 ); - F = (F & IF) | HF; - if (a16 == 0) F |= ZF; - if (a16 & 0x8000) F |= SF; - Cyc(cpustate); - break; - case XOR: - a8 = Read1_8(cpustate) ^ Read2_8(cpustate); - Write1_8( cpustate, a8 ); - F = (F & IF) | SZP[a8]; - Cyc(cpustate); - break; - case XOR | OP_16: - a16 = Read1_16(cpustate) ^ Read2_16(cpustate); - Write1_16( cpustate, a16 ); - F &= IF; - if (a16 == 0) F |= ZF; - if (a16 & 0x8000) F |= SF; - Cyc(cpustate); - break; - case OR: - a8 = Read1_8(cpustate) | Read2_8(cpustate); - Write1_8( cpustate, a8 ); - F = (F & IF) | SZP[a8]; - Cyc(cpustate); - break; - case OR | OP_16: - a16 = Read1_16(cpustate) | Read2_16(cpustate); - Write1_16( cpustate, a16 ); - F &= IF; - if (a16 == 0) F |= ZF; - if (a16 & 0x8000) F |= SF; - Cyc(cpustate); - break; - - case RLC: - a8 = Read1_8(cpustate); - a8 = (a8 << 1) | (a8 >> 7); - Write1_8( cpustate, a8 ); - if ( cpustate->mode1 == MODE_R8 && cpustate->r1 == A ) F &= SF | ZF | IF | PF; - else F = (F & IF) | SZP[a8]; - if (a8 & 0x01) F |= CF | XCF; // X? - Cyc(cpustate); - break; - case RRC: - a8 = Read1_8(cpustate); - a8 = (a8 >> 1) | (a8 << 7); - Write1_8( cpustate, a8 ); - if ( cpustate->mode1 == MODE_R8 && cpustate->r1 == A ) F &= SF | ZF | IF | PF; - else F = (F & IF) | SZP[a8]; - if (a8 & 0x80) F |= CF | XCF; // X? - Cyc(cpustate); - break; - case RL: - a8 = Read1_8(cpustate); - b8 = a8 & 0x80; - a8 <<= 1; - if (F & CF) a8 |= 0x01; - Write1_8( cpustate, a8 ); - if ( cpustate->mode1 == MODE_R8 && cpustate->r1 == A ) F &= SF | ZF | IF | PF; - else F = (F & IF) | SZP[a8]; - if (b8) F |= CF | XCF; // X? - Cyc(cpustate); - break; - case RR: - a8 = Read1_8(cpustate); - b8 = a8 & 0x01; - a8 >>= 1; - if (F & CF) a8 |= 0x80; - Write1_8( cpustate, a8 ); - if ( cpustate->mode1 == MODE_R8 && cpustate->r1 == A ) F &= SF | ZF | IF | PF; - else F = (F & IF) | SZP[a8]; - if (b8) F |= CF | XCF; // X? - Cyc(cpustate); - break; - - case SLA: - case SLL: - a8 = Read1_8(cpustate); - b8 = a8 & 0x80; - a8 <<= 1; - Write1_8( cpustate, a8 ); - if ( cpustate->mode1 == MODE_R8 && cpustate->r1 == A ) F &= SF | ZF | IF | PF; - else F = (F & IF) | SZP[a8]; - if (b8) F |= CF | XCF; // X? - Cyc(cpustate); - break; - case SRA: - a8 = Read1_8(cpustate); - b8 = a8 & 0x01; - a8 = (a8 & 0x80) | (a8 >> 1); - Write1_8( cpustate, a8 ); - if ( cpustate->mode1 == MODE_R8 && cpustate->r1 == A ) F &= SF | ZF | IF | PF; - else F = (F & IF) | SZP[a8]; - if (b8) F |= CF | XCF; // X? - Cyc(cpustate); - break; - case SRL: - a8 = Read1_8(cpustate); - b8 = a8 & 0x01; - a8 >>= 1; - Write1_8( cpustate, a8 ); - if ( cpustate->mode1 == MODE_R8 && cpustate->r1 == A ) F &= SF | ZF | IF | PF; - else F = (F & IF) | SZP[a8]; - if (b8) F |= CF | XCF; // X? - Cyc(cpustate); - break; - case RLD: - a8 = cpustate->af.b.h; - b8 = Read1_8(cpustate); - Write1_8( cpustate, (b8 << 4) | (a8 & 0x0f) ); - a8 = (a8 & 0xf0) | (b8 >> 4); - F = (F & (IF | CF)) | SZP[a8]; - cpustate->af.b.h = a8; - Cyc(cpustate); - break; - case RRD: - a8 = cpustate->af.b.h; - b8 = Read1_8(cpustate); - Write1_8( cpustate, (b8 >> 4) | (a8 << 4) ); - a8 = (a8 & 0xf0) | (b8 & 0x0f); - F = (F & (IF | CF)) | SZP[a8]; - cpustate->af.b.h = a8; - Cyc(cpustate); - break; - - case DJNZ: - if ( --cpustate->bc.b.h ) - { - cpustate->pc.w.l += /*2 +*/ (INT8)Read1_8(cpustate); - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - case DJNZ | OP_16: - if ( --cpustate->bc.w.l ) - { - cpustate->pc.w.l += /*2 +*/ (INT8)Read2_8(cpustate); - Cyc(cpustate); - } - else Cyc_f(cpustate); - break; - - case MUL: - cpustate->hl.w.l = (UINT16)cpustate->hl.b.l * (UINT16)Read2_8(cpustate); - Cyc(cpustate); - break; - case DIV: - a16 = cpustate->hl.w.l; - b16 = (UINT16)Read2_8(cpustate); - if (b16 == 0) - { - F |= VF; - cpustate->hl.w.l = (a16 << 8) | ((a16 >> 8) ^ 0xff); - } - else - { - cpustate->hl.b.h = a16 % b16; - a16 /= b16; - if (a16 > 0xff) F |= VF; - else F &= ~VF; - cpustate->hl.b.l = a16; - } - Cyc(cpustate); - break; - - //default: - // fatalerror("%04x: unimplemented opcode, op=%02x\n",device->pc(),cpustate->op); - } - - if ( cpustate->op != EI ) - if (cpustate->after_EI) - { - F |= IF; - cpustate->after_EI = 0; - } - - - // timers - for (INT32 i = 0; i < 5; i++) { - if (cpustate->timer_enable[i]) { - cpustate->timer_periods[i] -= (prev_cycles - cpustate->icount); - if (cpustate->timer_periods[i] <= 0) - { - cpustate->timer_cb[i](i); - cpustate->timer_periods[i] = cpustate->timer_periods_full[i]; // retrigger timer! - } - } - } - - } while( cpustate->icount > 0 && cpustate->run_end == 0 ); - - cpustate->run_end = 0; - cpustate->total_cycles += nCycles; - - return nCycles; -} - -void tlcs90NewFrame() -{ - t90_Regs *cpustate = &tlcs90_data[0]; - - cpustate->total_cycles = cpustate->nCycles = cpustate->icount = 0; - -// bprintf (0, _T("NewFrame\n")); -} - -void tlcs90RunEnd() -{ - t90_Regs *cpustate = &tlcs90_data[0]; - - cpustate->run_end = 1; -} - - -INT32 tlcs90TotalCycles() -{ - t90_Regs *cpustate = &tlcs90_data[0]; - -// bprintf (0, _T("TotalCycles: %d\n"), cpustate->total_cycles + (cpustate->nCycles - cpustate->icount)); - - return cpustate->total_cycles;// + (cpustate->nCycles - cpustate->icount); -} - -INT32 tlcs90Reset() -{ - t90_Regs *cpustate = &tlcs90_data[0]; //get_safe_token(device); - cpustate->irq_state = 0; - cpustate->irq_mask = 0; - cpustate->pc.d = 0x0000; - F &= ~IF; -/* - P0/D0-D7 P1/A0-A7 P2/A8-A15 P6 P7 = INPUT - P35/~RD P36/~WR CLK = 1 (ALWAYS OUTPUTS) - P4/A16-A19 P83 = 0 - dedicated input ports and CPU registers remain unchanged, - but PC IFF BX BY = 0, A undefined -*/ - memset(&cpustate->internal_registers, 0, sizeof(cpustate->internal_registers)); - - return 0; -} - -void tlcs90BurnCycles(INT32 cycles) -{ - t90_Regs *cpustate = &tlcs90_data[0]; //get_safe_token(device); - cpustate->icount -= 4 * ((cycles + 3) / 4); -} - - - - - -/************************************************************************************************************* - - ----------------------------------------------------------------------------------------------------------------- -FFC0 P0 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-0 P07-P00 R W IN I/O Port 0 - ----------------------------------------------------------------------------------------------------------------- -FFC1 P1 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-0 P17-P10 R W IN I/O Port 1 - ----------------------------------------------------------------------------------------------------------------- -FFC2 P01CR/ R/W Reset Description * Prohibit Read-Modify-Write * - IRFL ----------------------------------------------------------------------------------------------------------------- - 7 - - 0 - - 6 IRF0 R 0 INT0 interrupt request (1 = asserted) - 5 IRFT0 R 0 INTT0 "" - 4 IRFT1 R 0 INTT1 "" - 3 - - 0 - - 2 EXT W 0 P1/P2 control: 0 = Port 1 = Address Bus - 1 P1CR W 0 P1 control: 0 = IN 1 = OUT | - 0 P0CR W 0 P0 control: 0 = IN 1 = OUT | - | | - Port 0 also functions as data bus (D0-D7),so P1: regardless of - P0CR is reset when external memory is accessed P2: only if P2CR is set to 1 (output) - TMP90C841A: always address bus - ----------------------------------------------------------------------------------------------------------------- -FFC3 IRFH R/W Reset Description * Prohibit Read-Modify-Write * ----------------------------------------------------------------------------------------------------------------- - 7 IRFT2 R W 0 INTT2 interrupt request (1 = asserted) - 6 IRFT3 R W 0 INTT3 "" - 5 IRFT4 R W 0 INTT4 "" - 4 IRF1 R W 0 INT1 "" - 3 IRFT5 R W 0 INTT5 "" - 2 IRF2 R W 0 INT2 "" - 1 IRFRX R W 0 INTRX "" - 0 IRFTX R W 0 INTTX "" - |__ Writing Vector/8 clears the request flip-flop for that interrupt - ----------------------------------------------------------------------------------------------------------------- -FFC4 P2 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-0 P27-P20 R W IN I/O Port 2 - ----------------------------------------------------------------------------------------------------------------- -FFC5 P2CR R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-0 P27C- W 0 Port 2 control: 0 = IN 1 = OUT - P20C - ----------------------------------------------------------------------------------------------------------------- -FFC6 P3 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- - 7 P37 R IN P37 input - 6 P36 R W 1 ~WD - 5 P35 R W 1 ~RD - 4 P34 R IN P34 input - 3 P33 R W 1 TxD / P33 output - 2 P32 R W 1 TxD / P32 output - 1 P31 R IN RxD / P31 input - 0 P30 R IN RxD / P30 input - ----------------------------------------------------------------------------------------------------------------- -FFC7 P3CR R/W Reset Description * Prohibit Read-Modify-Write * ----------------------------------------------------------------------------------------------------------------- -7-6 WAITC1-0R W 00 Wait control: 00 = 2state 01 = normal 10 = no wait 11 = reserved - 5 RDE R W 0 RD control: 0 = only external access 1 = always - 4 ODE R W 0 P33 control: 0 = CMOS 1 = Open Drain -3-2 TXDC1-0 R W 00 P33-P32: 00 = OUT-OUT 01 = OUT-TxD 10 = TxD-OUT 11 = TxD-~RTS/SCLK -1-0 RXDC1-0 R W 00 P31-P30: 00 = IN-IN 01 = IN-RxD 10 = RxD-IN 11 = not used - ----------------------------------------------------------------------------------------------------------------- -FFC8 P4 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-4 - -3-0 P43-P40 R W 0 I/O Port 4 bits 3-0 or address bus A16-A19 - ----------------------------------------------------------------------------------------------------------------- -FFC9 P4CR R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-4 - -3-0 P43C- W 0 Port 4 control: 0 = OUT 1 = Address Output - P40C - ----------------------------------------------------------------------------------------------------------------- -FFCA P5 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7 - R 0 Test bit, must be set to 0 -6 - R 0 -5-0 P55-P50 R 0 I/O Port 5 bits 5-0 / AN5-AN0 analog inputs - ----------------------------------------------------------------------------------------------------------------- -FFCB SMMOD R/W Reset Description ----------------------------------------------------------------------------------------------------------------- - 7 - R W - - 6 SM7M0 R W 0 Motor Step: 0 = Full 1 = Half - 5 P70C1 R W 0 Port 7 control: 0 = IN-OUT 0 = IN-OUT,TO3 1 = IN / M1 1 = Timer 4 - 4 P70C0 R W 0 0 1 0 Timer 2,3 1 - 3 - R W - - 2 SM6M0 R W 0 Motor Step: 0 = Full 1 = Half - 1 P60C1 R W 0 Port 6 control: 0 = IN-OUT 0 = IN-OUT,TO1 1 = IN / M0 - 0 P60C0 R W 0 0 1 X Timer 0,1 - ----------------------------------------------------------------------------------------------------------------- -FFCC P6 R/W Reset Description * Read-Modify-Write not available in Stepping Motor control * ----------------------------------------------------------------------------------------------------------------- -7-4 SA60-63 W Undef Stepping motor Port 0 (M0) Shifter alternate reg. -3-0 P63-P60 R W IN Bits 3-0 of I/O Port 6 or Stepping motor Port 0 (M0) - ----------------------------------------------------------------------------------------------------------------- -FFCD P7 R/W Reset Description * Read-Modify-Write not available in Stepping Motor control * ----------------------------------------------------------------------------------------------------------------- -7-4 SA70-73 W Undef Stepping motor Port 1 (M1) Shifter alternate reg. -3-0 P73-P70 R W IN Bits 3-0 of I/O Port 7 or Stepping motor Port 1 (M1) - ----------------------------------------------------------------------------------------------------------------- -FFCE P67CR R/W Reset Description * Prohibit Read-Modify-Write * ----------------------------------------------------------------------------------------------------------------- -7-4 P73-70C W 0 Port 7: 0 = IN 1 = OUT -3-0 P63-60C W 0 Port 6: 0 = IN 1 = OUT - ----------------------------------------------------------------------------------------------------------------- -FFD0 P8 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-4 - - 3 P83 R W 0 P83 / TIO3 / TIO4 output - 2 P82 R IN P82 + INT2 input - 1 P81 R IN P81 + INT1 input - 0 P80 R IN P80 + INT0 input - ----------------------------------------------------------------------------------------------------------------- -FFD1 P8CR R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-4 - - 3 P83OC W 0 P83 out control: 0 = P83 1 = TO3 / TO4 - 2 ZCE2 W 0 INT2/TI5 control: 0 = ZCD disable 1 = ZCD enable - 1 ZCE1 W 0 INT1/TI4 control: 0 = ZCD disable 1 = ZCD enable - 0 EDGE W 0 INT0 control: 0 = Level 1 = Rising edge - ----------------------------------------------------------------------------------------------------------------- -FFD2 WDMOD R/W Reset Description ----------------------------------------------------------------------------------------------------------------- - 7 WDTE R W 1 1 = WDT Enable - 6 WDTP1 R W 0 WDT detection time: 0 = 2^14/fc 0 = 2^16/fc 1 = 2^18/fc 1 = 2^20/fc - 5 WDTP0 R W 0 0 1 0 1 - 4 WARM R W 0 Warming up time: 0 = 2^14/fc 1 = 2^16/fc - 3 HALTM1 R W 0 Standby mode: 0 = RUN 0 = STOP 1 = IDLE1 1 = IDLE2 - 2 HALTM0 R W 0 0 1 0 1 - 1 EXF R Undef Invert each time EXX instruction is executed - 0 DRIVE R W 0 1 to drive pins in stop mode - ----------------------------------------------------------------------------------------------------------------- -FFD4 TREG0 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-0 - W 0 Timer 0 match value - ----------------------------------------------------------------------------------------------------------------- -FFD5 TREG1 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-0 - W 0 Timer 0 match value - ----------------------------------------------------------------------------------------------------------------- -FFD6 TREG2 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-0 - W 0 Timer 0 match value - ----------------------------------------------------------------------------------------------------------------- -FFD7 TREG3 R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-0 - W 0 Timer 0 match value - ----------------------------------------------------------------------------------------------------------------- -FFD8 TCLK R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-6 T3CLK1-0R W 00 Timer 3 clock: 00 = Timer 2 01 = clock 10 = clock/16 11 = clock/256 <- Timer 2 overflow output in 16 bit mode -5-4 T2CLK1-0R W 00 Timer 2 clock: 00 = - 01 = clock 10 = clock/16 11 = clock/256 -3-2 T1CLK1-0R W 00 Timer 1 clock: 00 = Timer 0 01 = clock 10 = clock/16 11 = clock/256 <- Timer 0 overflow output in 16 bit mode -1-0 T0CLK1-0R W 00 Timer 0 clock: 00 = - 01 = clock 10 = clock/16 11 = clock/256 - ----------------------------------------------------------------------------------------------------------------- -FFD9 TFFCR R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-6 TFF3C1-0 W - Timer 3 flip-flop: 00 = Clear 01 = Set 10 = Invert 11 = Don't care <- Always read as 11 -5 TFF3IE R W 0 Timer 3 Invert: 0 = Disable 1 = Enable -4 TFF3IS R W 0 Timer 3 Invert: 0 = Timer 2 1 = Timer 3 -3-2 TFF1C1-0 W - Timer 1 Flip-Flop: 00 = Clear 01 = Set 10 = Invert 11 = Don't care <- Always read as 11 -1 TFF1IE R W 0 Timer 1 Invert: 0 = Disable 1 = Enable -0 TFF1IS R W 0 Timer 1 Invert: 0 = Timer 0 1 = Timer 1 - ----------------------------------------------------------------------------------------------------------------- -FFDA TMOD R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-6 T32M1-0 R W 00 Timers 2 & 3: 00 = 8b x 2 01 = 16b(T3+T2) 10 = 8b PPG(T3) 11 = 8b PWM (T3) + 8b (T2) -5-4 PWM21-0 R W 00 Timer 3 PWM freq: 00 = - 01 = 63/fc 10 = 127/fc 11 = 255/fc -3-2 T10M1-0 R W 00 Timers 1 & 0: 00 = 8b x 2 01 = 16b(T1+T0) 10 = 8b PPG(T1) 11 = 8b PWM (T1) + 8b (T0) -1-0 PWM01-0 R W 00 Timer 1 PWM freq: 00 = - 01 = 63/fc 10 = 127/fc 11 = 255/fc - ----------------------------------------------------------------------------------------------------------------- -FFDB TRUN R/W Reset Description ----------------------------------------------------------------------------------------------------------------- -7-6 BRATE1-0R W 00 Serial baud rate: 00 = 300/150 01 = 1200/600 10 = 4800/2400 11 = 19200/9600 - 5 PRRUN R W 0 Prescaler control: 0 = Stop & Clear 1 = Run - 4 T4RUN R W 0 Timer 4 control: 0 = Stop & Clear 1 = Run -3-0 T4RUN-0 R W 00 Timers 3-0 control: 0 = Stop & Clear 1 = Run - ----------------------------------------------------------------------------------------------------------------- -FFE6 INTEL R/W Reset Description ----------------------------------------------------------------------------------------------------------------- - 7 DET2 R W 0 INTT2/INTAD interrupt enable flag (1 = enable) - 6 DET3 R W 0 INTT3 "" - 5 DET4 R W 0 INTT4 "" - 4 DE1 R W 0 INT1 "" - 3 DET5 R W 0 INTT5 "" - 2 DE2 R W 0 INT2 "" - 1 DERX R W 0 INTRX "" - 0 DETX R W 0 INTTX "" - ----------------------------------------------------------------------------------------------------------------- -FFE7 INTEH R/W Reset Description ----------------------------------------------------------------------------------------------------------------- - 7 - R W 0 Write "0" - 6 DE0 R W 0 INT0 DMA enable flag (1 = enable) - 5 DET0 R W 0 INTT0 "" - 4 DET1 R W 0 INTT1 "" - 3 ADIS R W 0 INTT2/INTAD selection (1 = INTAD) - 2 IE0 R W 0 INT0 interrupt enable flag (1 = enable) - 1 IET0 R W 0 INTT0 "" - 0 IET1 R W 0 INTT1 "" - ----------------------------------------------------------------------------------------------------------------- -FFE8 DMAEH R/W Reset Description ----------------------------------------------------------------------------------------------------------------- - 7 DET2 R W 0 INTT2/INTAD DMA enable flag (1 = enable) - 6 DET3 R W 0 INTT3 "" - 5 DET4 R W 0 INTT4 "" - 4 DE1 R W 0 INT1 "" - 3 DET5 R W 0 INTT5 "" - 2 DE2 R W 0 INT2 "" - 1 DERX R W 0 INTRX "" - 0 DETX R W 0 INTTX "" - ----------------------------------------------------------------------------------------------------------------- -FFEC BX R/W Reset Description ----------------------------------------------------------------------------------------------------------------- - 7 - R 1 - 6 - R 1 - 5 - R 1 - 4 - R 1 - 3 BX3 R W 0 IX bank register bit 3 - 2 BX2 R W 0 IX bank register bit 2 - 1 BX1 R w 0 IX bank register bit 1 - 0 BX0 R W 0 IX bank register bit 0 - ----------------------------------------------------------------------------------------------------------------- -FFED BX R/W Reset Description ----------------------------------------------------------------------------------------------------------------- - 7 - R 1 - 6 - R 1 - 5 - R 1 - 4 - R 1 - 3 BY3 R W 0 IY bank register bit 3 - 2 BY2 R W 0 IY bank register bit 2 - 1 BY1 R w 0 IY bank register bit 1 - 0 BY0 R W 0 IY bank register bit 0 - -*************************************************************************************************************/ - -UINT8 t90_internal_registers_r(UINT16 offset) -{ - t90_Regs *cpustate = &tlcs90_data[0]; - - #define RIO tlcs90_io_read_byte( T90_IOBASE+offset ) - - UINT8 data = cpustate->internal_registers[offset]; - switch ( T90_IOBASE + offset ) - { - case T90_P3: // 7,4,1,0 - return (data & 0x6c) | (RIO & 0x93); - - case T90_P4: // only output - return data & 0x0f; - - case T90_P5: - return (RIO & 0x3f); - - case T90_P6: - case T90_P7: - return (data & 0xf0) | (RIO & 0x0f); - - case T90_P8: // 2,1,0 - return (data & 0x08) | (RIO & 0x07); - - case T90_BX: - case T90_BY: - return 0xf0 | data; - } - return data; -} - -static void t90_start_timer(t90_Regs *cpustate, INT32 i) -{ - INT32 prescaler; - double period; - - cpustate->timer_value[i] = 0; - - switch((cpustate->internal_registers[ T90_TMOD - T90_IOBASE ] >> (i * 2)) & 0x03) - { - case 0: - // 8-bit mode - break; - case 1: - break; - case 2: - // logerror("%04X: CPU Timer %d, unsupported PPG mode\n", cpustate->pc.w.l, i); - return; - case 3: - // logerror("%04X: CPU Timer %d, unsupported PWM mode\n", cpustate->pc.w.l, i); - return; - } - - switch((cpustate->internal_registers[ T90_TCLK - T90_IOBASE ] >> (i * 2)) & 0x03) - { - case 0:// if (i & 1) logerror("%04X: CPU Timer %d clocked by Timer %d match signal\n", cpustate->pc.w.l, i,i-1); - // else logerror("%04X: CPU Timer %d, unsupported TCLK = 0\n", cpustate->pc.w.l, i); - return; - case 2: prescaler = 16; break; - case 3: prescaler = 256; break; - default: - case 1: prescaler = 1; break; - } - - - period = cpustate->timer_period * prescaler; - - cpustate->timer_periods[i] = cpustate->timer_periods_full[i] = period; - cpustate->timer_enable[i] = 1; - - //logerror("%04X: CPU Timer %d started at %lf Hz\n", cpustate->pc.w.l, i, 1.0 / period.as_double()); -} - -static void t90_start_timer4(t90_Regs *cpustate) -{ - INT32 prescaler; - double period; - - cpustate->timer4_value = 0; - - switch(cpustate->internal_registers[ T90_T4MOD - T90_IOBASE ] & 0x03) - { - case 1: prescaler = 1; break; - case 2: prescaler = 16; break; - default: // logerror("%04X: CPU Timer 4, unsupported T4MOD = %d\n", cpustate->pc.w.l,cpustate->internal_registers[ T90_T4MOD - T90_IOBASE ] & 0x03); - return; - } - - period = cpustate->timer_period * prescaler; - - cpustate->timer_periods[4]= cpustate->timer_periods_full[4] = period; - cpustate->timer_enable[4] = 1; - -// logerror("%04X: CPU Timer 4 started at %lf Hz\n", cpustate->pc.w.l, 1.0 / period.as_double()); -} - - -static void t90_stop_timer(t90_Regs *cpustate, INT32 i) -{ - cpustate->timer_enable[i] = 0; - -// logerror("%04X: CPU Timer %d stopped\n", cpustate->pc.w.l, i); -} - -static void t90_stop_timer4(t90_Regs *cpustate) -{ - t90_stop_timer(cpustate, 4); -} - -void t90_timer_callback(INT32 param) -{ - t90_Regs *cpustate = &tlcs90_data[0]; - - INT32 mode, timer_fired; - INT32 i = param; - INT32 mask = 0x20 | (1 << i); - - if ( (cpustate->internal_registers[ T90_TRUN - T90_IOBASE ] & mask) != mask ) - return; - - timer_fired = 0; - - mode = (cpustate->internal_registers[ T90_TMOD - T90_IOBASE ] >> ((i & ~1) + 2)) & 0x03; - // Match - switch (mode) - { - case 0x02: // 8bit PPG - case 0x03: // 8bit PWM - //logerror("CPU Timer %d expired with unhandled mode %d\n", i, mode); - // TODO: hmm... - case 0x00: // 8bit - cpustate->timer_value[i]++; - if ( cpustate->timer_value[i] == cpustate->internal_registers[ T90_TREG0+i - T90_IOBASE ] ) - timer_fired = 1; - break; - - case 0x01: // 16bit - if(i & 1) - break; - cpustate->timer_value[i]++; - if(cpustate->timer_value[i] == 0) cpustate->timer_value[i+1]++; - if(cpustate->timer_value[i+1] == cpustate->internal_registers[ T90_TREG0+i+1 - T90_IOBASE ]) - if(cpustate->timer_value[i] == cpustate->internal_registers[ T90_TREG0+i - T90_IOBASE ]) - timer_fired = 1; - break; - } - - if(timer_fired) { - // special stuff handling - switch(mode) { - case 0x02: // 8bit PPG - case 0x03: // 8bit PWM - // TODO: hmm... - case 0x00: // 8bit - if(i & 1) - break; - if ( (cpustate->internal_registers[ T90_TCLK - T90_IOBASE ] & (0x0C << (i * 2))) == 0 ) // T0/T1 match signal clocks T1/T3 - t90_timer_callback(i+1); - break; - case 0x01: // 16bit, only can happen for i=0,2 - cpustate->timer_value[i+1] = 0; - tlcs90_set_irq_line(INTT0 + i+1, 1); - break; - } - // regular handling - cpustate->timer_value[i] = 0; - tlcs90_set_irq_line(INTT0 + i, 1); - } -} - -void t90_timer4_callback(INT32 ) -{ -// logerror("CPU Timer 4 fired! value = %d\n", (unsigned)cpustate->timer_value[4]); - - t90_Regs *cpustate = &tlcs90_data[0]; - cpustate->timer4_value++; - - // Match - - if ( cpustate->timer4_value == (cpustate->internal_registers[ T90_TREG4L - T90_IOBASE ] + (cpustate->internal_registers[ T90_TREG4H - T90_IOBASE ] << 8)) ) - { -// logerror("CPU Timer 4 matches TREG4\n"); - tlcs90_set_irq_line(INTT4, 1); - } - if ( cpustate->timer4_value == (cpustate->internal_registers[ T90_TREG5L - T90_IOBASE ] + (cpustate->internal_registers[ T90_TREG5H - T90_IOBASE ] << 8)) ) - { -// logerror("CPU Timer 4 matches TREG5\n"); - tlcs90_set_irq_line(INTT5, 1); - if (cpustate->internal_registers[ T90_T4MOD - T90_IOBASE ] & 0x04) - cpustate->timer4_value = 0; - } - - // Overflow - - if ( cpustate->timer_value == 0 ) - { -// logerror("CPU Timer 4 overflow\n"); - } -} - -void t90_internal_registers_w(UINT16 offset, UINT8 data) -{ - #define WIO tlcs90_io_write_byte( T90_IOBASE+offset, data ) - - t90_Regs *cpustate = &tlcs90_data[0]; - UINT8 out_mask; - UINT8 old = cpustate->internal_registers[offset]; - switch ( T90_IOBASE + offset ) - { - case T90_TRUN: - { - int i; - UINT8 mask; - // Timers 0-3 - for (i = 0; i < 4; i++) - { - mask = 0x20 | (1 << i); - if ( (old ^ data) & mask ) // if timer bit or prescaler bit changed - { - if ( (data & mask) == mask ) t90_start_timer(cpustate, i); - else t90_stop_timer(cpustate, i); - } - } - // Timer 4 - mask = 0x20 | 0x10; - if ( (old ^ data) & mask ) - { - if ( (data & mask) == mask ) t90_start_timer4(cpustate); - else t90_stop_timer4(cpustate); - } - break; - } - - case T90_INTEL: - cpustate->irq_mask &= ~( (1 << INTT2 ) | - (1 << INTT3 ) | - (1 << INTT4 ) | - (1 << INT1 ) | - (1 << INTT5 ) | - (1 << INT2 ) | - (1 << INTRX ) | - (1 << INTTX ) ); - - cpustate->irq_mask |= ((data & 0x80) ? (1 << INTT2 ) : 0) | - ((data & 0x40) ? (1 << INTT3 ) : 0) | - ((data & 0x20) ? (1 << INTT4 ) : 0) | - ((data & 0x10) ? (1 << INT1 ) : 0) | - ((data & 0x08) ? (1 << INTT5 ) : 0) | - ((data & 0x04) ? (1 << INT2 ) : 0) | - ((data & 0x02) ? (1 << INTRX ) : 0) | - ((data & 0x01) ? (1 << INTTX ) : 0) ; - break; - - case T90_INTEH: - cpustate->irq_mask &= ~( (1 << INT0 ) | - (1 << INTT0) | - (1 << INTT1) ); - - cpustate->irq_mask |= ((data & 0x04) ? (1 << INT0 ) : 0) | - ((data & 0x02) ? (1 << INTT0) : 0) | - ((data & 0x01) ? (1 << INTT1) : 0) ; - break; - - case T90_P3: - data &= 0x6c; - WIO; - break; - - case T90_P4: - data &= 0x0f; - out_mask = (~cpustate->internal_registers[ T90_P4CR - T90_IOBASE ]) & 0x0f; - if (out_mask) - { - data &= out_mask; - WIO; - } - break; - - case T90_P6: - out_mask = cpustate->internal_registers[ T90_P67CR - T90_IOBASE ] & 0x0f; - switch (cpustate->internal_registers[ T90_SMMOD - T90_IOBASE ] & 0x03) - { - case 1: - data &= ~0x01; - // add TO1 here - break; - case 2: - case 3: - data &= ~0x0f; - // add M0 here - break; - } - - if (out_mask) - { - data &= out_mask; - WIO; - } - break; - - case T90_P7: - out_mask = (cpustate->internal_registers[ T90_P67CR - T90_IOBASE ] & 0xf0) >> 4; - switch ((cpustate->internal_registers[ T90_SMMOD - T90_IOBASE ]>>4) & 0x03) - { - case 1: - data &= ~0x01; - // add TO3 here - break; - case 2: - case 3: - data &= ~0x0f; - // add M1 here - break; - } - - if (out_mask) - { - data &= out_mask; - WIO; - } - break; - - case T90_P8: - data &= 0x0f; - out_mask = (~cpustate->internal_registers[ T90_P8CR - T90_IOBASE ]) & 0x08; - if (out_mask) - { - data &= out_mask; - WIO; - } - break; - - case T90_BX: - cpustate->ixbase = (data & 0xf) << 16; - break; - case T90_BY: - cpustate->iybase = (data & 0xf) << 16; - break; - } - cpustate->internal_registers[offset] = data; -} - -INT32 tlcs90_init(INT32 clock) -{ - t90_Regs *cpustate = &tlcs90_data[0]; - INT32 i, p; - - for (i = 0; i < 256; i++) - { - p = 0; - if( i&0x01 ) ++p; - if( i&0x02 ) ++p; - if( i&0x04 ) ++p; - if( i&0x08 ) ++p; - if( i&0x10 ) ++p; - if( i&0x20 ) ++p; - if( i&0x40 ) ++p; - if( i&0x80 ) ++p; - SZ[i] = i ? i & SF : ZF; -// SZ[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ - SZ_BIT[i] = i ? i & SF : ZF | PF; -// SZ_BIT[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ - SZP[i] = SZ[i] | ((p & 1) ? 0 : PF); - SZHV_inc[i] = SZ[i]; - if( i == 0x80 ) SZHV_inc[i] |= VF; - if( (i & 0x0f) == 0x00 ) SZHV_inc[i] |= HF; - SZHV_dec[i] = SZ[i] | NF; - if( i == 0x7f ) SZHV_dec[i] |= VF; - if( (i & 0x0f) == 0x0f ) SZHV_dec[i] |= HF; - } - - memset(cpustate, 0, sizeof(t90_Regs)); - - cpustate->timer_period = clock / 1000000; - - // Timers - for (i = 0; i < 4; i++) - cpustate->timer_cb[i] = t90_timer_callback; - - cpustate->timer_cb[4] = t90_timer4_callback; - - return 0; -} - - -INT32 tlcs90Scan(INT32 nAction) -{ - struct BurnArea ba; - - if ((nAction & ACB_DRIVER_DATA) == 0) - return 0; - - t90_Regs *cpustate = &tlcs90_data[0]; - - if (nAction & ACB_MEMORY_RAM) { - ba.Data = cpustate; - ba.nLen = sizeof(tlcs90_data); - ba.nAddress = 0; - ba.szName = "tlcs90 CPU Data"; - BurnAcb(&ba); - } - - if (nAction & ACB_WRITE) { - for (INT32 i = 0; i < 4; i++) - cpustate->timer_cb[i] = t90_timer_callback; - - cpustate->timer_cb[4] = t90_timer4_callback; - } - - return 0; -} - - -#if 0 -static ADDRESS_MAP_START(tmp90840_mem, AS_PROGRAM, 8, legacy_cpu_device) - AM_RANGE( 0x0000, 0x1fff ) AM_ROM // 8KB ROM (internal) - AM_RANGE( 0xfec0, 0xffc0 ) AM_RAM // 256b RAM (internal) - AM_RANGE( T90_IOBASE, T90_IOBASE+47 ) AM_READWRITE_LEGACY( t90_internal_registers_r, t90_internal_registers_w ) -ADDRESS_MAP_END -static ADDRESS_MAP_START(tmp90841_mem, AS_PROGRAM, 8, legacy_cpu_device) -// AM_RANGE( 0x0000, 0x1fff ) AM_ROM // rom-less - AM_RANGE( 0xfec0, 0xffc0 ) AM_RAM // 256b RAM (internal) - AM_RANGE( T90_IOBASE, T90_IOBASE+47 ) AM_READWRITE_LEGACY( t90_internal_registers_r, t90_internal_registers_w ) -ADDRESS_MAP_END - -static ADDRESS_MAP_START(tmp91640_mem, AS_PROGRAM, 8, legacy_cpu_device ) - AM_RANGE( 0x0000, 0x3fff ) AM_ROM // 16KB ROM (internal) - AM_RANGE( 0xfdc0, 0xffc0 ) AM_RAM // 512b RAM (internal) - AM_RANGE( T90_IOBASE, T90_IOBASE+47 ) AM_READWRITE_LEGACY( t90_internal_registers_r, t90_internal_registers_w ) -ADDRESS_MAP_END -static ADDRESS_MAP_START(tmp91641_mem, AS_PROGRAM, 8, legacy_cpu_device ) -// AM_RANGE( 0x0000, 0x3fff ) AM_ROM // rom-less - AM_RANGE( 0xfdc0, 0xffc0 ) AM_RAM // 512b RAM (internal) - AM_RANGE( T90_IOBASE, T90_IOBASE+47 ) AM_READWRITE_LEGACY( t90_internal_registers_r, t90_internal_registers_w ) -ADDRESS_MAP_END -#endif - -#if 0 - -static CPU_SET_INFO( t90 ) -{ - t90_Regs *cpustate = get_safe_token(device); - - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(cpustate, INTNMI, info->i); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_IRQ0: set_irq_line(cpustate, INT0, info->i); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_IRQ1: set_irq_line(cpustate, INT1, info->i); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_IRQ2: set_irq_line(cpustate, INT2, info->i); break; - - case CPUINFO_INT_PC: cpustate->pc.d = info->i; break; - case CPUINFO_INT_REGISTER + T90_PC: cpustate->pc.w.l = info->i; break; - case CPUINFO_INT_SP: cpustate->sp.w.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_SP: cpustate->sp.w.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_A: cpustate->af.b.h = info->i; break; - case CPUINFO_INT_REGISTER + T90_B: cpustate->bc.b.h = info->i; break; - case CPUINFO_INT_REGISTER + T90_C: cpustate->bc.b.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_D: cpustate->de.b.h = info->i; break; - case CPUINFO_INT_REGISTER + T90_E: cpustate->de.b.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_H: cpustate->hl.b.h = info->i; break; - case CPUINFO_INT_REGISTER + T90_L: cpustate->hl.b.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_AF: cpustate->af.w.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_BC: cpustate->bc.w.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_DE: cpustate->de.w.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_HL: cpustate->hl.w.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_IX: cpustate->ix.w.l = info->i; break; - case CPUINFO_INT_REGISTER + T90_IY: cpustate->iy.w.l = info->i; break; - } -} - -CPU_GET_INFO( tmp90840 ) -{ - t90_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; - - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(t90_Regs); break; - case CPUINFO_INT_INPUT_LINES: info->i = 1; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0xff; break; - case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 6; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 26; break; - - case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + AS_PROGRAM: info->i = 20; break; - case CPUINFO_INT_ADDRBUS_SHIFT + AS_PROGRAM: info->i = 0; break; - - case CPUINFO_INT_DATABUS_WIDTH + AS_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + AS_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + AS_DATA: info->i = 0; break; - - case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + AS_IO: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_SHIFT + AS_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->irq_state & (1 << INTNMI); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_IRQ0: info->i = cpustate->irq_state & (1 << INT0); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_IRQ1: info->i = cpustate->irq_state & (1 << INT1); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_IRQ2: info->i = cpustate->irq_state & (1 << INT2); break; - - case CPUINFO_INT_PREVIOUSPC: info->i = cpustate->prvpc.w.l; break; - case CPUINFO_INT_PC: info->i = cpustate->pc.d; break; - case CPUINFO_INT_REGISTER + T90_PC: info->i = cpustate->pc.w.l; break; - case CPUINFO_INT_SP: info->i = cpustate->sp.d; break; - case CPUINFO_INT_REGISTER + T90_SP: info->i = cpustate->sp.w.l; break; - case CPUINFO_INT_REGISTER + T90_A: info->i = cpustate->af.b.h; break; - case CPUINFO_INT_REGISTER + T90_B: info->i = cpustate->bc.b.h; break; - case CPUINFO_INT_REGISTER + T90_C: info->i = cpustate->bc.b.l; break; - case CPUINFO_INT_REGISTER + T90_D: info->i = cpustate->de.b.h; break; - case CPUINFO_INT_REGISTER + T90_E: info->i = cpustate->de.b.l; break; - case CPUINFO_INT_REGISTER + T90_H: info->i = cpustate->hl.b.h; break; - case CPUINFO_INT_REGISTER + T90_L: info->i = cpustate->hl.b.l; break; - case CPUINFO_INT_REGISTER + T90_AF: info->i = cpustate->af.w.l; break; - case CPUINFO_INT_REGISTER + T90_BC: info->i = cpustate->bc.w.l; break; - case CPUINFO_INT_REGISTER + T90_DE: info->i = cpustate->de.w.l; break; - case CPUINFO_INT_REGISTER + T90_HL: info->i = cpustate->hl.w.l; break; - case CPUINFO_INT_REGISTER + T90_IX: info->i = cpustate->ix.w.l; break; - case CPUINFO_INT_REGISTER + T90_IY: info->i = cpustate->iy.w.l; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - - case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(t90); break; - case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(t90); break; - case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(t90); break; - case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(t90); break; - case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(t90); break; - case CPUINFO_FCT_BURN: info->burn = CPU_BURN_NAME(t90); break; - case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(t90); break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; - case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(tmp90840_mem); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - - case CPUINFO_STR_NAME: strcpy(info->s, "TMP90840"); break; - case CPUINFO_STR_SHORTNAME: strcpy(info->s, "tmp90840"); break; - case CPUINFO_STR_FAMILY: strcpy(info->s, "Toshiba TLCS-90"); break; - case CPUINFO_STR_VERSION: strcpy(info->s, "1.0"); break; - case CPUINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CREDITS: strcpy(info->s, "Luca Elia"); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c%c%c%c%c%c%c%c", - F & 0x80 ? 'S':'.', - F & 0x40 ? 'Z':'.', - F & 0x20 ? 'I':'.', - F & 0x10 ? 'H':'.', - F & 0x08 ? 'X':'.', - F & 0x04 ? 'P':'.', - F & 0x02 ? 'N':'.', - F & 0x01 ? 'C':'.'); - break; - - case CPUINFO_STR_REGISTER + T90_PC: sprintf(info->s, "PC:%04X", cpustate->pc.w.l); break; - case CPUINFO_STR_REGISTER + T90_SP: sprintf(info->s, "SP:%04X", cpustate->sp.w.l); break; - case CPUINFO_STR_REGISTER + T90_A: sprintf(info->s, "~A:%02X", cpustate->af.b.h); break; - case CPUINFO_STR_REGISTER + T90_B: sprintf(info->s, "~B:%02X", cpustate->bc.b.h); break; - case CPUINFO_STR_REGISTER + T90_C: sprintf(info->s, "~C:%02X", cpustate->bc.b.l); break; - case CPUINFO_STR_REGISTER + T90_D: sprintf(info->s, "~D:%02X", cpustate->de.b.h); break; - case CPUINFO_STR_REGISTER + T90_E: sprintf(info->s, "~E:%02X", cpustate->de.b.l); break; - case CPUINFO_STR_REGISTER + T90_H: sprintf(info->s, "~H:%02X", cpustate->hl.b.h); break; - case CPUINFO_STR_REGISTER + T90_L: sprintf(info->s, "~L:%02X", cpustate->hl.b.l); break; - case CPUINFO_STR_REGISTER + T90_AF: sprintf(info->s, "AF:%04X", cpustate->af.w.l); break; - case CPUINFO_STR_REGISTER + T90_BC: sprintf(info->s, "BC:%04X", cpustate->bc.w.l); break; - case CPUINFO_STR_REGISTER + T90_DE: sprintf(info->s, "DE:%04X", cpustate->de.w.l); break; - case CPUINFO_STR_REGISTER + T90_HL: sprintf(info->s, "HL:%04X", cpustate->hl.w.l); break; - case CPUINFO_STR_REGISTER + T90_IX: sprintf(info->s, "IX:%04X", cpustate->ix.w.l); break; - case CPUINFO_STR_REGISTER + T90_IY: sprintf(info->s, "IY:%04X", cpustate->iy.w.l); break; - } -} - -CPU_GET_INFO( tmp90841 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - - case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(tmp90841_mem); return; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - - case CPUINFO_STR_NAME: strcpy(info->s, "TMP90841"); return; - case CPUINFO_STR_SHORTNAME: strcpy(info->s, "tmp90841"); return; - } - - CPU_GET_INFO_CALL(tmp90840); -} - -CPU_GET_INFO( tmp91640 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - - case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(tmp91640_mem); return; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - - case CPUINFO_STR_NAME: strcpy(info->s, "TMP91640"); return; - case CPUINFO_STR_SHORTNAME: strcpy(info->s, "tmp91640"); return; - } - - CPU_GET_INFO_CALL(tmp90840); -} - -CPU_GET_INFO( tmp91641 ) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - - case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(tmp91641_mem); return; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - - case CPUINFO_STR_NAME: strcpy(info->s, "TMP91641"); return; - case CPUINFO_STR_SHORTNAME: strcpy(info->s, "tmp91641"); return; - } - - CPU_GET_INFO_CALL(tmp90840); -} - -DEFINE_LEGACY_CPU_DEVICE(TMP90840, tmp90840); -DEFINE_LEGACY_CPU_DEVICE(TMP90841, tmp90841); -DEFINE_LEGACY_CPU_DEVICE(TMP91640, tmp91640); -DEFINE_LEGACY_CPU_DEVICE(TMP91641, tmp91641); - -#endif diff --git a/jan/src/cpu/tlcs90_intf.cpp b/jan/src/cpu/tlcs90_intf.cpp deleted file mode 100644 index 3f20a28da..000000000 --- a/jan/src/cpu/tlcs90_intf.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include "burnint.h" -#include "tlcs90_intf.h" - -static UINT8 (*read)(UINT32) = NULL; -static void (*write)(UINT32, UINT8) = NULL; -static UINT8 (*readio)(UINT16) = NULL; -static void (*writeio)(UINT16, UINT8) = NULL; - -static UINT8 *mem[2][0x1000]; // only read/fetch & write - -extern void t90_internal_registers_w(UINT16 offset, UINT8 data); -extern UINT8 t90_internal_registers_r(UINT16 offset); -INT32 tlcs90_init(INT32 clock); - -UINT8 tlcs90_program_read_byte(UINT32 address) -{ - address &= 0xfffff; - - // internal registers!!!!!!!!!!!!!!!!! - if (address >= 0xffc0 && address <= 0xffef) { - return t90_internal_registers_r(address & 0x3f); - } - - if (mem[0][(address / 0x100)] != NULL) { - return mem[0][(address / 0x100)][address & 0xff]; - } - - if (read) { - return read(address); - } - - return 0; -} - -void tlcs90_program_write_byte(UINT32 address, UINT8 data) -{ - address &= 0xfffff; - - // internal registers!!!!!!!!!!!!!!!!! - if (address >= 0xffc0 && address <= 0xffef) { - t90_internal_registers_w(address & 0x3f, data); - return; - } - - if (mem[1][(address / 0x100)] != NULL) { - mem[1][(address / 0x100)][address & 0xff] = data; - return; - } - - if (write) { - write(address, data); - return; - } -} - -UINT8 tlcs90_io_read_byte(UINT16 port) -{ - port &= 0xffff; - -// bprintf (0, _T("Read Port: %4.4x\n"), port); - - if (readio) { - return readio(port); - } - - return 0; -} - -void tlcs90_io_write_byte(UINT16 port, UINT8 data) -{ - port &= 0xffff; - -// bprintf (0, _T("Write Port: %4.4x %2.2x\n"), port, data); - - if (writeio) { - return writeio(port, data); - } -} - - -void tlcs90SetReadHandler(UINT8 (*pread)(UINT32)) -{ - read = pread; -} - -void tlcs90SetWriteHandler(void (*pwrite)(UINT32, UINT8)) -{ - write = pwrite; -} - -void tlcs90SetReadPortHandler(UINT8 (*pread)(UINT16)) -{ - readio = pread; -} - -void tlcs90SetWritePortHandler(void (*pwrite)(UINT16, UINT8)) -{ - writeio = pwrite; -} - -void tlcs90MapMemory(UINT8 *ptr, UINT32 start, UINT32 end, INT32 flags) -{ - start &= 0xfffff; - end &= 0xfffff; - - for (UINT32 i = start / 0x100; i < (end / 0x100) + 1; i++) - { - if (flags & (1 << 0)) mem[0][i] = ptr + ((i * 0x100) - start); - if (flags & (1 << 1)) mem[1][i] = ptr + ((i * 0x100) - start); - } -} - - -void tlcs90Open(INT32) -{ - // only one cpu for now -} - -INT32 tlcs90Init(INT32, INT32 clock) -{ - memset (mem, 0, 2 * 0x1000 * sizeof(UINT8 *)); - - read = NULL; - write = NULL; - readio = NULL; - writeio = NULL; - - return tlcs90_init(clock); -} - -void tlcs90Close() -{ - -} - - -INT32 tlcs90Exit() -{ - memset (mem, 0, 2 * 0x1000 * sizeof(UINT8 *)); - read = NULL; - write = NULL; - readio = NULL; - writeio = NULL; - - return 0; -} - - diff --git a/jan/src/cpu/tlcs90_intf.h b/jan/src/cpu/tlcs90_intf.h deleted file mode 100644 index 39b7cf17b..000000000 --- a/jan/src/cpu/tlcs90_intf.h +++ /dev/null @@ -1,24 +0,0 @@ - -void tlcs90SetReadHandler(UINT8 (*pread)(UINT32)); -void tlcs90SetWriteHandler(void (*pwrite)(UINT32, UINT8)); -void tlcs90SetReadPortHandler(UINT8 (*pread)(UINT16)); -void tlcs90SetWritePortHandler(void (*pwrite)(UINT16, UINT8)); - -INT32 tlcs90Init(INT32 nCpu, INT32 clock); -void tlcs90Open(INT32 nCpu); -INT32 tlcs90Run(INT32 nCycles); -INT32 tlcs90Reset(); -void tlcs90Close(); -INT32 tlcs90Exit(); - -void tlcs90SetIRQLine(INT32 line, INT32 state); - -void tlcs90BurnCycles(INT32 nCpu, INT32 cycles); - -void tlcs90MapMemory(UINT8 *rom, UINT32 start, UINT32 end, INT32 flags); - -void tlcs90NewFrame(); -void tlcs90RunEnd(); -INT32 tlcs90TotalCycles(); - -INT32 tlcs90Scan(INT32 nAction); diff --git a/jan/src/cpu/tms32010/tms32010.cpp b/jan/src/cpu/tms32010/tms32010.cpp deleted file mode 100644 index 62bb18898..000000000 --- a/jan/src/cpu/tms32010/tms32010.cpp +++ /dev/null @@ -1,1095 +0,0 @@ - /**************************************************************************\ - * Texas Instruments TMS32010 DSP Emulator * - * * - * Copyright (C) 1999-2004+ Tony La Porta * - * You are not allowed to distribute this software commercially. * - * Written for the MAME project. * - * * - * * - * Notes : The term 'DMA' within this document, is in reference * - * to Direct Memory Addressing, and NOT the usual term * - * of Direct Memory Access. * - * This is a word based microcontroller, with addressing * - * architecture based on the Harvard addressing scheme. * - * * - * * - * * - * **** Change Log **** * - * * - * TLP (13-Jul-2002) * - * - Added Save-State support * - * - Converted the pending_irq flag to INTF (a real flag in this device) * - * - Fixed the ignore Interrupt Request for previous critical * - * instructions requiring an extra instruction to be processed. For * - * this reason, instant IRQ servicing cannot be supported here, so * - * INTF needs to be polled within the instruction execution loop * - * - Removed IRQ callback (IRQ ACK not supported on this device) * - * - A pending IRQ will remain pending until it's serviced. De-asserting * - * the IRQ Pin does not remove a pending IRQ state * - * - BIO is no longer treated as an IRQ line. It's polled when required. * - * This is the true behaviour of the device * - * - Removed the Clear OV flag from overflow instructions. Overflow * - * instructions can only set the flag. Flag test instructions clear it * - * - Fixed the ABST, SUBC and SUBH instructions * - * - Fixed the signedness in many equation based instructions * - * - Added the missing Previous PC to the get_register function * - * - Changed Cycle timings to include clock ticks * - * - Converted some registers from ints to pairs for much cleaner code * - * TLP (20-Jul-2002) Ver 1.10 * - * - Fixed the dissasembly from the debugger * - * - Changed all references from TMS320C10 to TMS32010 * - * ASG (24-Sep-2002) Ver 1.20 * - * - Fixed overflow handling * - * - Simplified logic in a few locations * - * TLP (22-Feb-2004) Ver 1.21 * - * - Overflow for ADDH only affects upper 16bits (was modifying 32 bits) * - * - Internal Data Memory map is assigned here now * - * - Cycle counts for invalid opcodes 7F1E and 7F1F are now 0 * - * * - \**************************************************************************/ - - - -#include "burnint.h" -#include "driver.h" -#include "state.h" -//#include "mamedbg.h" -#include "tms32010.h" -//#include "debugger.h" - - -/* 1 cycle equals 4 clock ticks */ -#if 0 -#define CLK TMS32010_CLOCK_DIVIDER -#else -#define CLK 1 /* Moved the clock timing back into the driver */ -#endif - - -#ifndef INLINE -#define INLINE static inline -#endif - - -UINT16 *tms32010_ram = NULL; -UINT16 *tms32010_rom = NULL; - -static void (*tms32010_write_port)(INT32,UINT16); -static UINT16 (*tms32010_read_port)(INT32); - -static UINT16 program_read_word_16be(UINT16 address) -{ - UINT16 r = tms32010_rom[(address & 0xfff)/2]; - r = (r << 8) | (r >> 8); - return r; -} - -static void program_write_word_16be(UINT16 address, UINT16 data) -{ - data = (data << 8) | (data >> 8); - - tms32010_rom[address & 0xfff] = data; -} - -static UINT16 data_read_word_16be(UINT16 address) -{ - UINT16 r = tms32010_ram[(address & 0xff)/2]; - - r = (r << 8) | (r >> 8); - - return r; -} - -static void data_write_word_16be(UINT16 address, UINT16 data) -{ - data = (data << 8) | (data >> 8); - - tms32010_ram[(address & 0xff)/2] = data; -} - -UINT16 io_read_word(INT32 offset) -{ - if (tms32010_read_port) { - UINT16 r = tms32010_read_port(offset); - return r; - } - - return 0; -} - -void io_write_word(INT32 offset, UINT16 data) -{ - if (tms32010_write_port) { - tms32010_write_port(offset, data); - return; - } -} - -void tms32010_set_write_port_handler(void (*pointer)(INT32,UINT16)) -{ - tms32010_write_port = pointer; -} - -void tms32010_set_read_port_handler(UINT16 (*pointer)(INT32)) -{ - tms32010_read_port = pointer; -} - - -#define TMS32010_BIO_In (io_read_word(TMS32010_BIO)) -#define TMS32010_In(Port) (io_read_word(Port)) -#define TMS32010_Out(Port,Value) (io_write_word(Port,Value)) -#define TMS32010_ROM_RDMEM(A) (program_read_word_16be((A)<<1)) -#define TMS32010_ROM_WRMEM(A,V) (program_write_word_16be((A)<<1,V)) -#define TMS32010_RAM_RDMEM(A) (data_read_word_16be((A)<<1)) -#define TMS32010_RAM_WRMEM(A,V) (data_write_word_16be((A)<<1,V)) -#define TMS32010_RDOP(A) (program_read_word_16be((A)<<1)) -#define TMS32010_RDOP_ARG(A) (program_read_word_16be((A)<<1)) - - - -#define M_RDROM(A) TMS32010_ROM_RDMEM(A) -#define M_WRTROM(A,V) TMS32010_ROM_WRMEM(A,V) -#define M_RDRAM(A) TMS32010_RAM_RDMEM(A) -#define M_WRTRAM(A,V) TMS32010_RAM_WRMEM(A,V) -#define M_RDOP(A) TMS32010_RDOP(A) -#define M_RDOP_ARG(A) TMS32010_RDOP_ARG(A) -#define P_IN(A) TMS32010_In(A) -#define P_OUT(A,V) TMS32010_Out(A,V) -#define BIO_IN TMS32010_BIO_In - - - -typedef struct /* Page 3-6 shows all registers */ -{ - /******************** CPU Internal Registers *******************/ - UINT16 PC; - UINT16 PREVPC; /* previous program counter */ - UINT16 STR; - PAIR ACC; - PAIR ALU; - PAIR Preg; - UINT16 Treg; - UINT16 AR[2]; - UINT16 STACK[4]; - - /********************** Status data ****************************/ - PAIR opcode; - int INTF; /* Pending Interrupt flag */ -} tms32010_Regs; - -static tms32010_Regs R; -static PAIR oldacc; -static UINT16 memaccess; -static int tms32010_icount; -static int addr_mask; -typedef void (*opcode_fn) (void); - - -/******** The following is the Status (Flag) register definition. *********/ -/* 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 */ -/* OV | OVM | INTM | 1 | 1 | 1 | 1 | ARP | 1 | 1 | 1 | 1 | 1 | 1 | 1 | DP */ -#define OV_FLAG 0x8000 /* OV (Overflow flag) 1 indicates an overflow */ -#define OVM_FLAG 0x4000 /* OVM (Overflow Mode bit) 1 forces ACC overflow to greatest positive or negative saturation value */ -#define INTM_FLAG 0x2000 /* INTM (Interrupt Mask flag) 0 enables maskable interrupts */ -#define ARP_REG 0x0100 /* ARP (Auxiliary Register Pointer) */ -#define DP_REG 0x0001 /* DP (Data memory Pointer (bank) bit) */ - -#define OV ( R.STR & OV_FLAG) /* OV (Overflow flag) */ -#define OVM ( R.STR & OVM_FLAG) /* OVM (Overflow Mode bit) 1 indicates an overflow */ -#define INTM ( R.STR & INTM_FLAG) /* INTM (Interrupt enable flag) 0 enables maskable interrupts */ -#define ARP ((R.STR & ARP_REG) >> 8) /* ARP (Auxiliary Register Pointer) */ -#define DP ((R.STR & DP_REG) << 7) /* DP (Data memory Pointer bit) */ - -#define DMA_DP (DP | (R.opcode.b.l & 0x7f)) /* address used in direct memory access operations */ -#define DMA_DP1 (0x80 | R.opcode.b.l) /* address used in direct memory access operations for sst instruction */ -#define IND (R.AR[ARP] & 0xff) /* address used in indirect memory access operations */ - - - - -/************************************************************************ - * Shortcuts - ************************************************************************/ - -INLINE void CLR(UINT16 flag) { R.STR &= ~flag; R.STR |= 0x1efe; } -INLINE void SET(UINT16 flag) { R.STR |= flag; R.STR |= 0x1efe; } - - -INLINE void CALCULATE_ADD_OVERFLOW(INT32 addval) -{ - if ((INT32)(~(oldacc.d ^ addval) & (oldacc.d ^ R.ACC.d)) < 0) { - SET(OV_FLAG); - if (OVM) - R.ACC.d = ((INT32)oldacc.d < 0) ? 0x80000000 : 0x7fffffff; - } -} -INLINE void CALCULATE_SUB_OVERFLOW(INT32 subval) -{ - if ((INT32)((oldacc.d ^ subval) & (oldacc.d ^ R.ACC.d)) < 0) { - SET(OV_FLAG); - if (OVM) - R.ACC.d = ((INT32)oldacc.d < 0) ? 0x80000000 : 0x7fffffff; - } -} - -INLINE UINT16 POP_STACK(void) -{ - UINT16 data = R.STACK[3]; - R.STACK[3] = R.STACK[2]; - R.STACK[2] = R.STACK[1]; - R.STACK[1] = R.STACK[0]; - return (data & addr_mask); -} -INLINE void PUSH_STACK(UINT16 data) -{ - R.STACK[0] = R.STACK[1]; - R.STACK[1] = R.STACK[2]; - R.STACK[2] = R.STACK[3]; - R.STACK[3] = (data & addr_mask); -} - -INLINE void GET_MEM_ADDR(UINT16 DMA) -{ - if (R.opcode.b.l & 0x80) - memaccess = IND; - else - memaccess = DMA; -} -INLINE void UPDATE_AR(void) -{ - if (R.opcode.b.l & 0x30) { - UINT16 tmpAR = R.AR[ARP]; - if (R.opcode.b.l & 0x20) tmpAR++ ; - if (R.opcode.b.l & 0x10) tmpAR-- ; - R.AR[ARP] = (R.AR[ARP] & 0xfe00) | (tmpAR & 0x01ff); - } -} -INLINE void UPDATE_ARP(void) -{ - if (~R.opcode.b.l & 0x08) { - if (R.opcode.b.l & 0x01) SET(ARP_REG); - else CLR(ARP_REG); - } -} - - -INLINE void getdata(UINT8 shift,UINT8 signext) -{ - GET_MEM_ADDR(DMA_DP); - R.ALU.d = (UINT16)M_RDRAM(memaccess); - if (signext) R.ALU.d = (INT16)R.ALU.d; - R.ALU.d <<= shift; - if (R.opcode.b.l & 0x80) { - UPDATE_AR(); - UPDATE_ARP(); - } -} - -INLINE void putdata(UINT16 data) -{ - GET_MEM_ADDR(DMA_DP); - if (R.opcode.b.l & 0x80) { - UPDATE_AR(); - UPDATE_ARP(); - } - M_WRTRAM(memaccess,data); -} -INLINE void putdata_sar(UINT8 data) -{ - GET_MEM_ADDR(DMA_DP); - if (R.opcode.b.l & 0x80) { - UPDATE_AR(); - UPDATE_ARP(); - } - M_WRTRAM(memaccess,R.AR[data]); -} -INLINE void putdata_sst(UINT16 data) -{ - GET_MEM_ADDR(DMA_DP1); /* Page 1 only */ - if (R.opcode.b.l & 0x80) { - UPDATE_AR(); - } - M_WRTRAM(memaccess,data); -} - - - -/************************************************************************ - * Emulate the Instructions - ************************************************************************/ - -/* This following function is here to fill in the void for */ -/* the opcode call function. This function is never called. */ - -static void other_7F_opcodes(void) { } - - -static void illegal(void) -{ - logerror("TMS32010: PC=%04x, Illegal opcode = %04x\n", (R.PC-1), R.opcode.w.l); -} - -static void abst(void) -{ - if ( (INT32)(R.ACC.d) < 0 ) { - R.ACC.d = -R.ACC.d; - if (OVM && (R.ACC.d == 0x80000000)) R.ACC.d-- ; - } -} - -/*** The manual does not mention overflow with the ADD? instructions ***** - *** however I implemented overflow, coz it doesnt make sense otherwise ** - *** and newer generations of this type of chip supported it. I think **** - *** the manual is wrong (apart from other errors the manual has). ******* - -static void add_sh(void) { getdata(R.opcode.b.h,1); R.ACC.d += R.ALU.d; } -static void addh(void) { getdata(0,0); R.ACC.d += (R.ALU.d << 16); } - ***/ - -static void add_sh(void) -{ - oldacc.d = R.ACC.d; - getdata((R.opcode.b.h & 0xf),1); - R.ACC.d += R.ALU.d; - CALCULATE_ADD_OVERFLOW(R.ALU.d); -} -static void addh(void) -{ - oldacc.d = R.ACC.d; - getdata(0,0); - R.ACC.w.h += R.ALU.w.l; - if ((INT16)(~(oldacc.w.h ^ R.ALU.w.h) & (oldacc.w.h ^ R.ACC.w.h)) < 0) { - SET(OV_FLAG); - if (OVM) - R.ACC.w.h = ((INT16)oldacc.w.h < 0) ? 0x8000 : 0x7fff; - } -} -static void adds(void) -{ - oldacc.d = R.ACC.d; - getdata(0,0); - R.ACC.d += R.ALU.d; - CALCULATE_ADD_OVERFLOW(R.ALU.d); -} -static void and_(void) -{ - getdata(0,0); - R.ACC.d &= R.ALU.d; -} -static void apac(void) -{ - oldacc.d = R.ACC.d; - R.ACC.d += R.Preg.d; - CALCULATE_ADD_OVERFLOW(R.Preg.d); -} -static void br(void) -{ - R.PC = M_RDOP_ARG(R.PC); -} -static void banz(void) -{ - if (R.AR[ARP] & 0x01ff) - R.PC = M_RDOP_ARG(R.PC); - else - R.PC++ ; - R.ALU.w.l = R.AR[ARP]; - R.ALU.w.l-- ; - R.AR[ARP] = (R.AR[ARP] & 0xfe00) | (R.ALU.w.l & 0x01ff); -} -static void bgez(void) -{ - if ( (INT32)(R.ACC.d) >= 0 ) - R.PC = M_RDOP_ARG(R.PC); - else - R.PC++ ; -} -static void bgz(void) -{ - if ( (INT32)(R.ACC.d) > 0 ) - R.PC = M_RDOP_ARG(R.PC); - else - R.PC++ ; -} -static void bioz(void) -{ - if (BIO_IN != CPU_IRQSTATUS_NONE) - R.PC = M_RDOP_ARG(R.PC); - else - R.PC++ ; -} -static void blez(void) -{ - if ( (INT32)(R.ACC.d) <= 0 ) - R.PC = M_RDOP_ARG(R.PC); - else - R.PC++ ; -} -static void blz(void) -{ - if ( (INT32)(R.ACC.d) < 0 ) - R.PC = M_RDOP_ARG(R.PC); - else - R.PC++ ; -} -static void bnz(void) -{ - if (R.ACC.d != 0) - R.PC = M_RDOP_ARG(R.PC); - else - R.PC++ ; -} -static void bv(void) -{ - if (OV) { - R.PC = M_RDOP_ARG(R.PC); - CLR(OV_FLAG); - } - else - R.PC++ ; -} -static void bz(void) -{ - if (R.ACC.d == 0) - R.PC = M_RDOP_ARG(R.PC); - else - R.PC++ ; -} -static void cala(void) -{ - PUSH_STACK(R.PC); - R.PC = R.ACC.w.l & addr_mask; -} -static void call(void) -{ - R.PC++ ; - PUSH_STACK(R.PC); - R.PC = M_RDOP_ARG((R.PC - 1)) & addr_mask; -} -static void dint(void) -{ - SET(INTM_FLAG); -} -static void dmov(void) -{ - getdata(0,0); - M_WRTRAM((memaccess + 1),R.ALU.w.l); -} -static void eint(void) -{ - CLR(INTM_FLAG); -} -static void in_p(void) -{ - R.ALU.w.l = P_IN( (R.opcode.b.h & 7) ); - putdata(R.ALU.w.l); -} -static void lac_sh(void) -{ - getdata((R.opcode.b.h & 0x0f),1); - R.ACC.d = R.ALU.d; -} -static void lack(void) -{ - R.ACC.d = R.opcode.b.l; -} -static void lar_ar0(void) -{ - getdata(0,0); - R.AR[0] = R.ALU.w.l; -} -static void lar_ar1(void) -{ - getdata(0,0); - R.AR[1] = R.ALU.w.l; -} -static void lark_ar0(void) -{ - R.AR[0] = R.opcode.b.l; -} -static void lark_ar1(void) -{ - R.AR[1] = R.opcode.b.l; -} -static void larp_mar(void) -{ - if (R.opcode.b.l & 0x80) { - UPDATE_AR(); - UPDATE_ARP(); - } -} -static void ldp(void) -{ - getdata(0,0); - if (R.ALU.d & 1) - SET(DP_REG); - else - CLR(DP_REG); -} -static void ldpk(void) -{ - if (R.opcode.b.l & 1) - SET(DP_REG); - else - CLR(DP_REG); -} -static void lst(void) -{ - R.opcode.b.l |= 0x08; /* Next arp not supported here, so mask it */ - getdata(0,0); - R.ALU.w.l &= (~INTM_FLAG); /* Must not affect INTM */ - R.STR &= INTM_FLAG; - R.STR |= R.ALU.w.l; - R.STR |= 0x1efe; -} -static void lt(void) -{ - getdata(0,0); - R.Treg = R.ALU.w.l; -} -static void lta(void) -{ - oldacc.d = R.ACC.d; - getdata(0,0); - R.Treg = R.ALU.w.l; - R.ACC.d += R.Preg.d; - CALCULATE_ADD_OVERFLOW(R.Preg.d); -} -static void ltd(void) -{ - oldacc.d = R.ACC.d; - getdata(0,0); - R.Treg = R.ALU.w.l; - M_WRTRAM((memaccess + 1),R.ALU.w.l); - R.ACC.d += R.Preg.d; - CALCULATE_ADD_OVERFLOW(R.Preg.d); -} -static void mpy(void) -{ - getdata(0,0); - R.Preg.d = (INT16)R.ALU.w.l * (INT16)R.Treg; - if (R.Preg.d == 0x40000000) R.Preg.d = 0xc0000000; -} -static void mpyk(void) -{ - R.Preg.d = (INT16)R.Treg * ((INT16)(R.opcode.w.l << 3) >> 3); -} -static void nop(void) -{ - /* Nothing to do */ -} -static void or_(void) -{ - getdata(0,0); - R.ACC.w.l |= R.ALU.w.l; -} -static void out_p(void) -{ - getdata(0,0); - P_OUT( (R.opcode.b.h & 7), R.ALU.w.l ); -} -static void pac(void) -{ - R.ACC.d = R.Preg.d; -} -static void pop(void) -{ - R.ACC.w.l = POP_STACK(); - R.ACC.w.h = 0x0000; -} -static void push(void) -{ - PUSH_STACK(R.ACC.w.l); -} -static void ret(void) -{ - R.PC = POP_STACK(); -} -static void rovm(void) -{ - CLR(OVM_FLAG); -} -static void sach_sh(void) -{ - R.ALU.d = (R.ACC.d << (R.opcode.b.h & 7)); - putdata(R.ALU.w.h); -} -static void sacl(void) -{ - putdata(R.ACC.w.l); -} -static void sar_ar0(void) -{ - putdata_sar(0); -} -static void sar_ar1(void) -{ - putdata_sar(1); -} -static void sovm(void) -{ - SET(OVM_FLAG); -} -static void spac(void) -{ - oldacc.d = R.ACC.d; - R.ACC.d -= R.Preg.d; - CALCULATE_SUB_OVERFLOW(R.Preg.d); -} -static void sst(void) -{ - putdata_sst(R.STR); -} -static void sub_sh(void) -{ - oldacc.d = R.ACC.d; - getdata((R.opcode.b.h & 0x0f),1); - R.ACC.d -= R.ALU.d; - CALCULATE_SUB_OVERFLOW(R.ALU.d); -} -static void subc(void) -{ - oldacc.d = R.ACC.d; - getdata(15,0); - R.ALU.d -= R.ALU.d; - if ((INT32)((oldacc.d ^ R.ALU.d) & (oldacc.d ^ R.ACC.d)) < 0) - SET(OV_FLAG); - if ( (INT32)(R.ALU.d) >= 0 ) - R.ACC.d = ((R.ALU.d << 1) + 1); - else - R.ACC.d = (R.ACC.d << 1); -} -static void subh(void) -{ - oldacc.d = R.ACC.d; - getdata(16,0); - R.ACC.d -= R.ALU.d; - CALCULATE_SUB_OVERFLOW(R.ALU.d); -} -static void subs(void) -{ - oldacc.d = R.ACC.d; - getdata(0,0); - R.ACC.d -= R.ALU.d; - CALCULATE_SUB_OVERFLOW(R.ALU.d); -} -static void tblr(void) -{ - R.ALU.d = M_RDROM((R.ACC.w.l & addr_mask)); - putdata(R.ALU.w.l); - R.STACK[0] = R.STACK[1]; -} -static void tblw(void) -{ - getdata(0,0); - M_WRTROM(((R.ACC.w.l & addr_mask)),R.ALU.w.l); - R.STACK[0] = R.STACK[1]; -} -static void xor_(void) -{ - getdata(0,0); - R.ACC.w.l ^= R.ALU.w.l; -} -static void zac(void) -{ - R.ACC.d = 0; -} -static void zalh(void) -{ - getdata(0,0); - R.ACC.w.h = R.ALU.w.l; - R.ACC.w.l = 0x0000; -} -static void zals(void) -{ - getdata(0,0); - R.ACC.w.l = R.ALU.w.l; - R.ACC.w.h = 0x0000; -} - - -/*********************************************************************** - * Cycle Timings - ***********************************************************************/ - -static unsigned cycles_main[256]= -{ -/*00*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*10*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*20*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*30*/ 1*CLK, 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 1*CLK, 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, -/*40*/ 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, -/*50*/ 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*60*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 3*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*70*/ 1*CLK, 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 3*CLK, 1*CLK, 0*CLK, -/*80*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*90*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, -/*A0*/ 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, -/*B0*/ 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, -/*C0*/ 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, -/*D0*/ 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, -/*E0*/ 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, -/*F0*/ 0*CLK, 0*CLK, 0*CLK, 0*CLK, 2*CLK, 2*CLK, 2*CLK, 0*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK -}; - -static unsigned cycles_7F_other[32]= -{ -/*80*/ 1*CLK, 1*CLK, 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 2*CLK, 2*CLK, 1*CLK, 1*CLK, -/*90*/ 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 2*CLK, 2*CLK, 0*CLK, 0*CLK -}; - - -/*********************************************************************** - * Opcode Table - ***********************************************************************/ - -static opcode_fn opcode_main[256]= -{ -/*00*/ add_sh ,add_sh ,add_sh ,add_sh ,add_sh ,add_sh ,add_sh ,add_sh -/*08*/ ,add_sh ,add_sh ,add_sh ,add_sh ,add_sh ,add_sh ,add_sh ,add_sh -/*10*/ ,sub_sh ,sub_sh ,sub_sh ,sub_sh ,sub_sh ,sub_sh ,sub_sh ,sub_sh -/*18*/ ,sub_sh ,sub_sh ,sub_sh ,sub_sh ,sub_sh ,sub_sh ,sub_sh ,sub_sh -/*20*/ ,lac_sh ,lac_sh ,lac_sh ,lac_sh ,lac_sh ,lac_sh ,lac_sh ,lac_sh -/*28*/ ,lac_sh ,lac_sh ,lac_sh ,lac_sh ,lac_sh ,lac_sh ,lac_sh ,lac_sh -/*30*/ ,sar_ar0 ,sar_ar1 ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*38*/ ,lar_ar0 ,lar_ar1 ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*40*/ ,in_p ,in_p ,in_p ,in_p ,in_p ,in_p ,in_p ,in_p -/*48*/ ,out_p ,out_p ,out_p ,out_p ,out_p ,out_p ,out_p ,out_p -/*50*/ ,sacl ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*58*/ ,sach_sh ,sach_sh ,sach_sh ,sach_sh ,sach_sh ,sach_sh ,sach_sh ,sach_sh -/*60*/ ,addh ,adds ,subh ,subs ,subc ,zalh ,zals ,tblr -/*68*/ ,larp_mar ,dmov ,lt ,ltd ,lta ,mpy ,ldpk ,ldp -/*70*/ ,lark_ar0 ,lark_ar1 ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*78*/ ,xor_ ,and_ ,or_ ,lst ,sst ,tblw ,lack ,other_7F_opcodes -/*80*/ ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk -/*88*/ ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk -/*90*/ ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk -/*98*/ ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk ,mpyk -/*A0*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*A8*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*B0*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*B8*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*C0*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*C8*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*D0*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*D8*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*E0*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*E8*/ ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*F0*/ ,illegal ,illegal ,illegal ,illegal ,banz ,bv ,bioz ,illegal -/*F8*/ ,call ,br ,blz ,blez ,bgz ,bgez ,bnz ,bz -}; - -static opcode_fn opcode_7F_other[32]= -{ -/*80*/ nop ,dint ,eint ,illegal ,illegal ,illegal ,illegal ,illegal -/*88*/ ,abst ,zac ,rovm ,sovm ,cala ,ret ,pac ,apac -/*90*/ ,spac ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal ,illegal -/*98*/ ,illegal ,illegal ,illegal ,illegal ,push ,pop ,illegal ,illegal -}; - - - -/**************************************************************************** - * Inits CPU emulation - ****************************************************************************/ -void tms32010_init (void) -{ -#if 0 - state_save_register_item("tms32010", index, R.PC); - state_save_register_item("tms32010", index, R.PREVPC); - state_save_register_item("tms32010", index, R.STR); - state_save_register_item("tms32010", index, R.ACC.d); - state_save_register_item("tms32010", index, R.ALU.d); - state_save_register_item("tms32010", index, R.Preg.d); - state_save_register_item("tms32010", index, R.Treg); - state_save_register_item("tms32010", index, R.AR[0]); - state_save_register_item("tms32010", index, R.AR[1]); - state_save_register_item("tms32010", index, R.STACK[0]); - state_save_register_item("tms32010", index, R.STACK[1]); - state_save_register_item("tms32010", index, R.STACK[2]); - state_save_register_item("tms32010", index, R.STACK[3]); - state_save_register_item("tms32010", index, R.INTF); - state_save_register_item("tms32010", index, R.opcode.d); -#endif -} - -/**************************************************************************** - * Reset registers to their initial values - ****************************************************************************/ -void tms32010_reset (void) -{ - R.PC = 0; - R.STR = 0xfefe; - R.ACC.d = 0; - R.INTF = TMS32010_INT_NONE; - addr_mask = 0x0fff; /* TMS32010 can only address 0x0fff */ - /* however other TMS3201x devices */ - /* can address up to 0xffff (incase */ - /* their support is ever added). */ -} - - -/**************************************************************************** - * Shut down CPU emulation - ****************************************************************************/ -void tms32010_exit (void) -{ - /* nothing to do ? */ -} - - -/**************************************************************************** - * Issue an interrupt if necessary - ****************************************************************************/ -int tms32010_Ext_IRQ(void) -{ - if (INTM == 0) - { - logerror("TMS32010: EXT INTERRUPT\n"); - R.INTF = TMS32010_INT_NONE; - SET(INTM_FLAG); - PUSH_STACK(R.PC); - R.PC = 0x0002; - return (3*CLK); /* 3 cycles used due to PUSH and DINT operation ? */ - } - return (0*CLK); -} - - - -/**************************************************************************** - * Execute IPeriod. Return 0 if emulation should be stopped - ****************************************************************************/ -int tms32010_execute(int cycles) -{ - tms32010_icount = cycles; - - do - { - if (R.INTF) { - /* Dont service INT if prev instruction was MPY, MPYK or EINT */ - if ((R.opcode.b.h != 0x6d) && ((R.opcode.b.h & 0xe0) != 0x80) && (R.opcode.w.l != 0x7f82)) - tms32010_icount -= tms32010_Ext_IRQ(); - } - - R.PREVPC = R.PC; - - //CALL_MAME_DEBUG; - - R.opcode.d = M_RDOP(R.PC); - R.PC++; - - if (R.opcode.b.h != 0x7f) { /* Do all opcodes except the 7Fxx ones */ - tms32010_icount -= cycles_main[R.opcode.b.h]; - (*(opcode_main[R.opcode.b.h]))(); - } - else { /* Opcode major byte 7Fxx has many opcodes in its minor byte */ - tms32010_icount -= cycles_7F_other[(R.opcode.b.l & 0x1f)]; - (*(opcode_7F_other[(R.opcode.b.l & 0x1f)]))(); - } - } while (tms32010_icount>0); - - return cycles - tms32010_icount; -} - -void tms32010RunEnd() -{ - tms32010_icount = 0; -} - -void tms32010_scan(INT32 nAction) -{ - if (nAction & ACB_DRIVER_DATA) { - struct BurnArea ba; - memset(&ba, 0, sizeof(ba)); - ba.Data = &R; - ba.nLen = sizeof(tms32010_Regs); - ba.szName = "tms32010 Regs"; - BurnAcb(&ba); - - SCAN_VAR(oldacc); - SCAN_VAR(memaccess); - SCAN_VAR(tms32010_icount); - SCAN_VAR(addr_mask); - } -} - -#if 0 -/**************************************************************************** - * Get all registers in given buffer - ****************************************************************************/ -static void tms32010_get_context (void *dst) -{ - if( dst ) - *(tms32010_Regs*)dst = R; -} - -/**************************************************************************** - * Set all registers to given values - ****************************************************************************/ -static void tms32010_set_context (void *src) -{ - if (src) - R = *(tms32010_Regs*)src; -} -#endif - -/**************************************************************************** - * Set IRQ line state - ****************************************************************************/ -void tms32010_set_irq_line(int irqline, int state) -{ - /* Pending Interrupts cannot be cleared! */ - if (state == CPU_IRQSTATUS_ACK) R.INTF |= TMS32010_INT_PENDING; -} - -#if 0 -static offs_t tms32010_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) -{ -#ifdef MAME_DEBUG - return Dasm32010( buffer, pc, oprom, opram ); -#else - sprintf( buffer, "$%04X", (oprom[0] << 8) | oprom[1] ); - return 2; -#endif -} - - -/**************************************************************************** - * Internal Memory Map - ****************************************************************************/ - -static ADDRESS_MAP_START( tms32010_ram, ADDRESS_SPACE_DATA, 16 ) - AM_RANGE(0x00, 0x7f) AM_RAM /* Page 0 */ - AM_RANGE(0x80, 0x8f) AM_RAM /* Page 1 */ -ADDRESS_MAP_END - - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static void tms32010_set_info(UINT32 state, union cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + 0: tms32010_set_irq_line(0, info->i); break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + TMS32010_PC: R.PC = info->i; break; - /* This is actually not a stack pointer, but the stack contents */ - /* Stack is a 4 level First In Last Out stack */ - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + TMS32010_STK3: R.STACK[3] = info->i; break; - case CPUINFO_INT_REGISTER + TMS32010_STR: R.STR = info->i; break; - case CPUINFO_INT_REGISTER + TMS32010_ACC: R.ACC.d = info->i; break; - case CPUINFO_INT_REGISTER + TMS32010_PREG: R.Preg.d = info->i; break; - case CPUINFO_INT_REGISTER + TMS32010_TREG: R.Treg = info->i; break; - case CPUINFO_INT_REGISTER + TMS32010_AR0: R.AR[0] = info->i; break; - case CPUINFO_INT_REGISTER + TMS32010_AR1: R.AR[1] = info->i; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void tms32010_get_info(UINT32 state, union cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(R); break; - case CPUINFO_INT_INPUT_LINES: info->i = 1; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = TMS32010_CLOCK_DIVIDER; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1*CLK; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 3*CLK; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 12; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -1; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = -1; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 5; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = -1; break; - - case CPUINFO_INT_INPUT_STATE + 0: info->i = (R.INTF & TMS32010_INT_PENDING) ? ASSERT_LINE : CLEAR_LINE; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = R.PREVPC; break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + TMS32010_PC: info->i = R.PC; break; - /* This is actually not a stack pointer, but the stack contents */ - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + TMS32010_STK3: info->i = R.STACK[3]; break; - case CPUINFO_INT_REGISTER + TMS32010_ACC: info->i = R.ACC.d; break; - case CPUINFO_INT_REGISTER + TMS32010_STR: info->i = R.STR; break; - case CPUINFO_INT_REGISTER + TMS32010_PREG: info->i = R.Preg.d; break; - case CPUINFO_INT_REGISTER + TMS32010_TREG: info->i = R.Treg; break; - case CPUINFO_INT_REGISTER + TMS32010_AR0: info->i = R.AR[0]; break; - case CPUINFO_INT_REGISTER + TMS32010_AR1: info->i = R.AR[1]; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = tms32010_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = tms32010_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = tms32010_set_context; break; - case CPUINFO_PTR_INIT: info->init = tms32010_init; break; - case CPUINFO_PTR_RESET: info->reset = tms32010_reset; break; - case CPUINFO_PTR_EXIT: info->exit = tms32010_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = tms32010_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = tms32010_dasm; break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &tms32010_icount; break; - case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map = construct_map_tms32010_ram; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s = cpuintrf_temp_str(), "TMS32010"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s = cpuintrf_temp_str(), "Texas Instruments TMS32010"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s = cpuintrf_temp_str(), "1.21"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s = cpuintrf_temp_str(), __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s = cpuintrf_temp_str(), "Copyright (C)1999-2004+ by Tony La Porta"); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s = cpuintrf_temp_str(), "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", - R.STR & 0x8000 ? 'O':'.', - R.STR & 0x4000 ? 'M':'.', - R.STR & 0x2000 ? 'I':'.', - R.STR & 0x1000 ? '.':'?', - R.STR & 0x0800 ? 'a':'?', - R.STR & 0x0400 ? 'r':'?', - R.STR & 0x0200 ? 'p':'?', - R.STR & 0x0100 ? '1':'0', - R.STR & 0x0080 ? '.':'?', - R.STR & 0x0040 ? '.':'?', - R.STR & 0x0020 ? '.':'?', - R.STR & 0x0010 ? '.':'?', - R.STR & 0x0008 ? '.':'?', - R.STR & 0x0004 ? 'd':'?', - R.STR & 0x0002 ? 'p':'?', - R.STR & 0x0001 ? '1':'0'); - break; - - case CPUINFO_STR_REGISTER + +TMS32010_PC: sprintf(info->s = cpuintrf_temp_str(), "PC:%04X", R.PC); break; - case CPUINFO_STR_REGISTER + +TMS32010_SP: sprintf(info->s = cpuintrf_temp_str(), "SP:%X", 0); /* fake stack pointer */ break; - case CPUINFO_STR_REGISTER + +TMS32010_STR: sprintf(info->s = cpuintrf_temp_str(), "STR:%04X", R.STR); break; - case CPUINFO_STR_REGISTER + +TMS32010_ACC: sprintf(info->s = cpuintrf_temp_str(), "ACC:%08X", R.ACC.d); break; - case CPUINFO_STR_REGISTER + +TMS32010_PREG: sprintf(info->s = cpuintrf_temp_str(), "P:%08X", R.Preg.d); break; - case CPUINFO_STR_REGISTER + +TMS32010_TREG: sprintf(info->s = cpuintrf_temp_str(), "T:%04X", R.Treg); break; - case CPUINFO_STR_REGISTER + +TMS32010_AR0: sprintf(info->s = cpuintrf_temp_str(), "AR0:%04X", R.AR[0]); break; - case CPUINFO_STR_REGISTER + +TMS32010_AR1: sprintf(info->s = cpuintrf_temp_str(), "AR1:%04X", R.AR[1]); break; - case CPUINFO_STR_REGISTER + +TMS32010_STK0: sprintf(info->s = cpuintrf_temp_str(), "STK0:%04X", R.STACK[0]); break; - case CPUINFO_STR_REGISTER + +TMS32010_STK1: sprintf(info->s = cpuintrf_temp_str(), "STK1:%04X", R.STACK[1]); break; - case CPUINFO_STR_REGISTER + +TMS32010_STK2: sprintf(info->s = cpuintrf_temp_str(), "STK2:%04X", R.STACK[2]); break; - case CPUINFO_STR_REGISTER + +TMS32010_STK3: sprintf(info->s = cpuintrf_temp_str(), "STK3:%04X", R.STACK[3]); break; - } -} -#endif diff --git a/jan/src/cpu/tms32010/tms32010.h b/jan/src/cpu/tms32010/tms32010.h deleted file mode 100644 index 22f1989f0..000000000 --- a/jan/src/cpu/tms32010/tms32010.h +++ /dev/null @@ -1,152 +0,0 @@ - /**************************************************************************\ - * Texas Instruments TMS32010 DSP Emulator * - * * - * Copyright (C) 1999-2002+ Tony La Porta * - * You are not allowed to distribute this software commercially. * - * Written for the MAME project. * - * * - * * - * Note : This is a word based microcontroller, with addressing * - * architecture based on the Harvard addressing scheme. * - * * - \**************************************************************************/ - -#ifndef _TMS32010_H -#define _TMS32010_H - -void tms32010RunEnd(); - -extern UINT16 *tms32010_ram; -extern UINT16 *tms32010_rom; - -void tms32010_set_write_port_handler(void (*pointer)(INT32,UINT16)); -void tms32010_set_read_port_handler(UINT16 (*pointer)(INT32)); - -void tms32010_init (void); -void tms32010_reset (void); -void tms32010_exit (void); -int tms32010_execute(int cycles); -int tms32010_Ext_IRQ(void); -void tms32010_set_irq_line(int irqline, int state); -void tms32010_scan(INT32 nAction); - - -/************************************************************************** - * Internal Clock divisor - * - * External Clock is divided internally by 4, to produce the states - * used in carrying out an instruction (machine) cycle. - */ - -#define TMS32010_CLOCK_DIVIDER 4 - - -/**************************************************************************** - * Use this in the I/O port address fields of your driver for the BIO pin - * i.e, - * AM_RANGE(TMS32010_BIO, TMS32010_BIO) AM_READ(twincobr_bio_line_r) - */ - -#define TMS32010_BIO 0x10 /* BIO input */ - - -#define TMS32010_INT_PENDING 0x80000000 -#define TMS32010_INT_NONE 0 - -#define TMS32010_ADDR_MASK 0x0fff /* TMS32010 can only address 0x0fff */ - /* however other TMS3201x devices */ - /* can address up to 0xffff (incase */ - /* their support is ever added). */ - - -enum { - TMS32010_PC=1, TMS32010_SP, TMS32010_STR, TMS32010_ACC, - TMS32010_PREG, TMS32010_TREG, TMS32010_AR0, TMS32010_AR1, - TMS32010_STK0, TMS32010_STK1, TMS32010_STK2, TMS32010_STK3 -}; - - -/**************************************************************************** - * Public Functions - */ - -//void tms32010_get_info(UINT32 state, union cpuinfo *info); - - - -/**************************************************************************** - * Read the state of the BIO pin - */ -#if 0 -#define TMS32010_BIO_In (io_read_word_16be(TMS32010_BIO<<1)) - - -/**************************************************************************** - * Input a word from given I/O port - */ - -#define TMS32010_In(Port) (io_read_word_16be((Port)<<1)) - - -/**************************************************************************** - * Output a word to given I/O port - */ - -#define TMS32010_Out(Port,Value) (io_write_word_16be((Port)<<1,Value)) - - - -/**************************************************************************** - * Read a word from given ROM memory location - */ - -#define TMS32010_ROM_RDMEM(A) (program_read_word_16be((A)<<1)) - - -/**************************************************************************** - * Write a word to given ROM memory location - */ - -#define TMS32010_ROM_WRMEM(A,V) (program_write_word_16be((A)<<1,V)) - - - -/**************************************************************************** - * Read a word from given RAM memory location - */ - -#define TMS32010_RAM_RDMEM(A) (data_read_word_16be((A)<<1)) - - -/**************************************************************************** - * Write a word to given RAM memory location - */ - -#define TMS32010_RAM_WRMEM(A,V) (data_write_word_16be((A)<<1,V)) - - - -/**************************************************************************** - * TMS32010_RDOP() is identical to TMS32010_RDMEM() except it is used for reading - * opcodes. In case of system with memory mapped I/O, this function can be - * used to greatly speed up emulation - */ - -#define TMS32010_RDOP(A) (cpu_readop16((A)<<1)) - - -/**************************************************************************** - * TMS32010_RDOP_ARG() is identical to TMS32010_RDOP() except it is used - * for reading opcode arguments. This difference can be used to support systems - * that use different encoding mechanisms for opcodes and opcode arguments - */ - -#define TMS32010_RDOP_ARG(A) (cpu_readop_arg16((A)<<1)) -#endif - - -#ifdef MAME_DEBUG -//extern unsigned Dasm32010(char *buffer, unsigned pc, const UINT8 *oprom, const UINT8 *opram); -#endif - -#endif /* _TMS32010_H */ diff --git a/jan/src/cpu/tms34010/tms34010.cpp b/jan/src/cpu/tms34010/tms34010.cpp deleted file mode 100644 index 872fac3a4..000000000 --- a/jan/src/cpu/tms34010/tms34010.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#include "tms34010.h" -#include "memory.h" -#include "tms34010_memacc.h" -#include "tms34010_ctrl.h" -#include "tms34010_mov.h" -#include "tms34010_arithm.h" -#include "tms34010_jump.h" -#include "tms34010_shift.h" -#include "tms34010_gfx.h" - -#ifdef TMS34010_DEBUGGER -#include -#include -#include -#endif - -namespace tms { - - -#define IO(reg) cpu->io_regs[reg] - -const char *io_regs_names[32] = { - "HESYNC", "HEBLNK", "HSBLNK", "HTOTAL", "VESYNC", "VEBLNK", "VSBLNK", - "VTOTAL", "DPYCTL", "DPYSTRT", "DPYINT", "CONTROL", "HSTDATA", "HSTADRL", - "HSTADRH", "HSTCTLL", "HSTCTLH", "INTENB", "INTPEND", "CONVSP", "CONVDP", - "PSIZE", "PMASK", "RS_70", "RS_80", "RS_90", "RS_A0", - "DPYTAP", "HCOUNT", "VCOUNT", "DPYADR", "REFCNT" -}; - -void reset(cpu_state *cpu) -{ - cpu->pc = rdfield_32(VECT_RESET); - cpu->icounter = 0; - cpu->st = 0x00000010; - for (int i = 0; i < 15; i++) { - cpu->a[i].value = 0; - cpu->b[i].value = 0; - } - for (int i = 0; i < 32; i++) { - cpu->io_regs[i] = 0; - } - - memset(cpu->shiftreg, 0, 4096*2); -} - -static void check_irq(cpu_state *cpu) -{ - int irq = cpu->io_regs[INTPEND] & cpu->io_regs[INTENB]; - if (!(_st & ST_IE) || !irq) - return; - - dword trap_addr = 0; - if (irq & INTERRUPT_HOST) { - trap_addr = 0xFFFFFEC0; - } - else if (irq & INTERRUPT_DISPLAY) { - trap_addr = 0xFFFFFEA0; - } - else if (irq & INTERRUPT_EXTERN_1) { - trap_addr = 0xFFFFFFC0; - } - else if (irq & INTERRUPT_EXTERN_2) { - trap_addr = 0xFFFFFFA0; - } - if (trap_addr) { - _push(_pc); - _push(_st); - _st = 0x10; - _pc = mem_read_d(trap_addr) & 0xFFFFFFF0; - } -} - -#ifdef TMS34010_DEBUGGER -static void perform_trace(cpu_state *cpu) -{ - int pc_count = std::count(std::begin(cpu->history), std::end(cpu->history), cpu->pc); - if (pc_count) { - cpu->loop_counter++; - return; - } - - if (cpu->loop_counter) { - cpu->trace << "\n\t(Loop for " << cpu->loop_counter << " instructions)\n\n"; - } - cpu->loop_counter = 0; - - char pcbuf[16]; - snprintf(pcbuf, 16, "%08X\t", _pc); - cpu->trace << pcbuf << new_dasm(_pc, nullptr) << std::endl; - - cpu->history[cpu->history_idx] = cpu->pc; - cpu->history_idx = (cpu->history_idx + 1) % cpu->history.size(); -} - -void run(cpu_state *cpu, int cycles, bool stepping) -{ - cpu->icounter = cycles; - while (cpu->icounter > 0) { - - check_irq(cpu); - - if (!stepping) { - if (std::find(std::begin(cpu->bpoints), std::end(cpu->bpoints), _pc) != - std::end(cpu->bpoints)) { - cpu->reason = BREAKPOINT_FOUND; - return; - } - } - - if (cpu->tracing && cpu->trace.is_open()) { - perform_trace(cpu); - } - - cpu->pc &= 0xFFFFFFF0; - - word opcode = mem_read(cpu->pc); - cpu->last_pc = cpu->pc; - cpu->pc += 16; - opcode_table[(opcode >> 4) & 0xFFF](cpu, opcode); - if (cpu->icounter == 0) - return; - } - cpu->reason = ICOUNTER_EXPIRED; -} - -#else -void run(cpu_state *cpu, int cycles) -{ - cpu->icounter = cycles; - while (cpu->icounter > 0) { - - check_irq(cpu); - cpu->pc &= 0xFFFFFFF0; - word opcode = mem_read(cpu->pc); - cpu->last_pc = cpu->pc; - cpu->pc += 16; - opcode_table[(opcode >> 4) & 0xFFF](cpu, opcode); - } -} -#endif - -void generate_irq(cpu_state *cpu, int num) -{ - cpu->io_regs[INTPEND] |= num; -} - -void clear_irq(cpu_state *cpu, int num) -{ - cpu->io_regs[INTPEND] &= ~num; -} - -void write_ioreg(cpu_state *cpu, dword addr, word value) -{ - const int reg = (addr >> 4) & 0x1F; - cpu->io_regs[reg] = value; - switch (reg) { - case PSIZE: cpu->pshift = log2(value); break; - case CONVDP: cpu->convdp = 1 << (~value & 0x1F); break; - case CONVSP: cpu->convsp = 1 << (~value & 0x1F); break; - case INTPEND: - if (!(value & INTERRUPT_DISPLAY)) - cpu->io_regs[INTPEND] &= ~INTERRUPT_DISPLAY; - break; - case DPYSTRT: - break; - case VTOTAL: - case HTOTAL: - case HSBLNK: - case HEBLNK: - case VSBLNK: - case VEBLNK: -#ifdef TMS34010_DEBUGGER - qDebug() << QString().sprintf("vga crtc %dx%d - v:%d,h:%d", - cpu->io_regs[HSBLNK]-cpu->io_regs[HEBLNK], - cpu->io_regs[VSBLNK]-cpu->io_regs[VEBLNK], - cpu->io_regs[VTOTAL], - cpu->io_regs[HTOTAL]); -#endif - break; - } - -} - -dword read_ioreg(cpu_state *cpu, dword addr) -{ - int reg = (addr >> 4) & 0x1F; - return cpu->io_regs[reg]; -} - -int generate_scanline(cpu_state *cpu, int line, scanline_render_t render) -{ - int enabled = cpu->io_regs[DPYCTL] & 0x8000; - cpu->io_regs[VCOUNT] = line; - - if (enabled && line == cpu->io_regs[DPYINT]) { - generate_irq(cpu, INTERRUPT_DISPLAY); - } - - if (line == cpu->io_regs[VSBLNK]) { - cpu->io_regs[DPYADR] = cpu->io_regs[DPYSTRT]; - } - - if (line >= cpu->io_regs[VEBLNK] && line <= cpu->io_regs[VSBLNK] - 1) { - word dpyadr = cpu->io_regs[DPYADR]; - if (!(cpu->io_regs[DPYCTL] & 0x0400)) - dpyadr ^= 0xFFFC; - - int rowaddr = dpyadr >> 4; - int coladdr = ((dpyadr & 0x007C) << 4) | (cpu->io_regs[DPYTAP] & 0x3FFF); - - display_info info; - info.coladdr = coladdr; - info.rowaddr = rowaddr; - info.heblnk = cpu->io_regs[HEBLNK]; - info.hsblnk = cpu->io_regs[HSBLNK]; - info.htotal = cpu->io_regs[HTOTAL]; - if (render) { - render(line, &info); - } - } - - if (line >= cpu->io_regs[VEBLNK] && line < cpu->io_regs[VSBLNK]) { - word dpyadr = cpu->io_regs[DPYADR]; - if ((dpyadr & 3) == 0) { - dpyadr = ((dpyadr & 0xFFFC) - (cpu->io_regs[DPYCTL] & 0x03FC)); - dpyadr |= (cpu->io_regs[DPYSTRT] & 0x0003); - } else { - dpyadr = (dpyadr & 0xfffc) | ((dpyadr - 1) & 3); - } - cpu->io_regs[DPYADR] = dpyadr; - } - if (++line >= cpu->io_regs[VTOTAL]) - line = 0; - return line; -} - -wrfield_handler wrfield_table[32] = { - &wrfield_32, &wrfield_1, &wrfield_2, &wrfield_3, &wrfield_4, &wrfield_5, &wrfield_6, &wrfield_7, - &wrfield_8, &wrfield_9, &wrfield_10, &wrfield_11, &wrfield_12, &wrfield_13, &wrfield_14, &wrfield_15, - &wrfield_16, &wrfield_17, &wrfield_18, &wrfield_19, &wrfield_20, &wrfield_21, &wrfield_22, &wrfield_23, - &wrfield_24, &wrfield_25, &wrfield_26, &wrfield_27, &wrfield_28, &wrfield_29, &wrfield_30, &wrfield_31, -}; - -rdfield_handler rdfield_table[64] = { - &rdfield_32, &rdfield_1, &rdfield_2, &rdfield_3, &rdfield_4, &rdfield_5, &rdfield_6, &rdfield_7, - &rdfield_8, &rdfield_9, &rdfield_10, &rdfield_11, &rdfield_12, &rdfield_13, &rdfield_14, &rdfield_15, - &rdfield_16, &rdfield_17, &rdfield_18, &rdfield_19, &rdfield_20, &rdfield_21, &rdfield_22, &rdfield_23, - &rdfield_24, &rdfield_25, &rdfield_26, &rdfield_27, &rdfield_28, &rdfield_29, &rdfield_30, &rdfield_31, - &rdfield_32, &rdfield_1_sx, &rdfield_2_sx, &rdfield_3_sx, &rdfield_4_sx, &rdfield_5_sx, &rdfield_6_sx, &rdfield_7_sx, - &rdfield_8_sx, &rdfield_9_sx, &rdfield_10_sx, &rdfield_11_sx, &rdfield_12_sx, &rdfield_13_sx, &rdfield_14_sx, &rdfield_15_sx, - &rdfield_16_sx, &rdfield_17_sx, &rdfield_18_sx, &rdfield_19_sx, &rdfield_20_sx, &rdfield_21_sx, &rdfield_22_sx, &rdfield_23_sx, - &rdfield_24_sx, &rdfield_25_sx, &rdfield_26_sx, &rdfield_27_sx, &rdfield_28_sx, &rdfield_29_sx, &rdfield_30_sx, &rdfield_31_sx, -}; - - - - -} diff --git a/jan/src/cpu/tms34010/tms34010.h b/jan/src/cpu/tms34010/tms34010.h deleted file mode 100644 index 1d30da595..000000000 --- a/jan/src/cpu/tms34010/tms34010.h +++ /dev/null @@ -1,507 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef TMS34010_H -#define TMS34010_H - -#include -#include -#include -#include -#include -#include - - -namespace tms -{ - -// Convert bit-address to byte-address -#define TOBYTE(a) ((a) >> 3) - -typedef uint8_t byte; -typedef uint16_t word; -typedef uint32_t dword; -typedef int8_t sbyte; -typedef int16_t sword; -typedef int32_t sdword; -typedef uint64_t u64; -typedef int64_t i64; - -const int fw_lut[32] = { - 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, -}; - -enum STATUS_FLAGS -{ - ST_NONE = 0, - ST_FS0_MASK = 0x1F, - ST_FS0_SHIFT = 0, - ST_FE0 = 0x20, - ST_FS1_MASK = 0x7C0, - ST_FS1_SHIFT = 6, - ST_FE1 = 0x800, - ST_IE = 0x200000, - ST_PBX = 0x1000000, - ST_V = 0x10000000, - ST_Z = 0x20000000, - ST_C = 0x40000000, - ST_N = 0x80000000, -}; - -enum IO_REGISTERS -{ - IO_REFCNT = 0x0C00001F0, - IO_DPYADR = 0x0C00001E0, - IO_VCOUNT = 0x0C00001D0, - IO_HCOUNT = 0x0C00001C0, - IO_DPYTAP = 0x0C00001B0, - IO_PMASK = 0x0C0000160, - IO_PSIZE = 0x0C0000150, - IO_CONVDP = 0x0C0000140, - IO_CONVSP = 0x0C0000130, - IO_INTPEND = 0x0C0000120, - IO_INTENB = 0x0C0000110, - IO_HSTCTLH = 0x0C0000100, - IO_HSTCTLL = 0x0C00000F0, - IO_HSTADRH = 0x0C00000E0, - IO_HSTADRL = 0x0C00000D0, - IO_HSTDATA = 0x0C00000C0, - IO_CONTROL = 0x0C00000B0, - IO_DPYINT = 0x0C00000A0, - IO_DPYSTRT = 0x0C0000090, - IO_DPYCTL = 0x0C0000080, - IO_VTOTAL = 0x0C0000070, - IO_VSBLNK = 0x0C0000060, - IO_VEBLNK = 0x0C0000050, - IO_VESYNC = 0x0C0000040, - IO_HTOTAL = 0x0C0000030, - IO_HSBLNK = 0x0C0000020, - IO_HEBLNK = 0x0C0000010, - IO_HESYNC = 0x0C0000000, -}; - -enum { - REFCNT = 0x1F, - DPYADR = 0x1E, - VCOUNT = 0x1D, - HCOUNT = 0x1C, - DPYTAP = 0x1B, - PMASK = 0x16, - PSIZE = 0x15, - CONVDP = 0x14, - CONVSP = 0x13, - INTPEND = 0x12, - INTENB = 0x11, - HSTCTLH = 0x10, - HSTCTLL = 0x0F, - HSTADRH = 0x0E, - HSTADRL = 0x0D, - HSTDATA = 0x0C, - CONTROL = 0x0B, - DPYINT = 0x0A, - DPYSTRT = 0x09, - DPYCTL = 0x08, - VTOTAL = 0x07, - VSBLNK = 0x06, - VEBLNK = 0x05, - VESYNC = 0x04, - HTOTAL = 0x03, - HSBLNK = 0x02, - HEBLNK = 0x01, - HESYNC = 0x00, -}; - -enum { - INTERRUPT_EXTERN_1 = (1 << 1), - INTERRUPT_EXTERN_2 = (1 << 2), - INTERRUPT_HOST = (1 << 9), - INTERRUPT_DISPLAY = (1 << 10), - INTERRUPT_WINDOW = (1 << 11), -}; - - -extern const char *io_regs_names[32]; - - -enum TRAP_VECTORS -{ - VECT_RESET = 0xFFFFFFE0, -}; - -enum { - SIGN_BIT32 = 0x80000000, - SIGN_BIT16 = 0x00008000 -}; - - -enum B_FILE_REGISTERS -{ - _SADDR = 0, - _SPTCH, - _DADDR, - _DPTCH, - _OFFSET, - _WSTART, - _WEND, - _DYDX, - _COLOR0, - _COLOR1, - _COUNT, - _INC1, - _INC2, - _PATTRN, - _TEMP, -}; - -static const char *const gfx_reg_names[15] = { - "saddr","sptch","daddr","dptch","offset","wstart", "wend", - "dydx","color0","color1","count","inc1","inc2","pattrn","temp" -}; - -#ifdef TMS34010_DEBUGGER -typedef enum { - ICOUNTER_EXPIRED = 0, - BREAKPOINT_FOUND, -} stop_reason_t; -#endif - -typedef union { - struct { - sword x; - sword y; - }; - dword value; -} cpu_register; - -struct cpu_state { - cpu_register *r[32]; - cpu_register a[15]; - cpu_register b[15]; - cpu_register sp; - dword pc; - dword last_pc; - dword st; - sdword icounter; - dword convdp; - dword convsp; - byte pshift; - word io_regs[32]; - word shiftreg[4096]; - - void (*shift_read_cycle)(dword address, void*); - void (*shift_write_cycle)(dword address, void*); - -#ifdef TMS34010_DEBUGGER - // debugger... - stop_reason_t reason; - bool tracing; - std::ofstream trace; - std::array history; - int loop_counter; - int history_idx; - std::list bpoints; -#endif - cpu_state() { - for (int i = 0; i < 15; ++i) { - r[ 0 + i] = &a[i]; - r[16 + i] = &b[i]; - } - r[15] = &sp; - r[31] = &sp; - pc = 0; - sp.value = 0U; -#ifdef TMS34010_DEBUGGER - loop_counter = 0; - history_idx = 0; -#endif - } -}; - -typedef void (*opcode_handler)(cpu_state*,word); -extern opcode_handler opcode_table[0x1000]; -typedef void (*wrfield_handler)(dword, dword); -extern wrfield_handler wrfield_table[32]; -typedef dword (*rdfield_handler)(dword); -extern rdfield_handler rdfield_table[64]; - -namespace ops { - -void dint(cpu_state *cpu, word opcode); -void eint(cpu_state *cpu, word opcode); -void setf_0(cpu_state *cpu, word opcode); -void setf_1(cpu_state *cpu, word opcode); -void mmtm(cpu_state *cpu, word opcode); -void mmfm(cpu_state *cpu, word opcode); -void getpc(cpu_state *cpu, word opcode); -void pushst(cpu_state *cpu, word opcode); -void popst(cpu_state *cpu, word opcode); -void getst(cpu_state *cpu, word opcode); -void putst(cpu_state *cpu, word opcode); -void exgpc(cpu_state *cpu, word opcode); -void setc(cpu_state *cpu, word opcode); -void clrc(cpu_state *cpu, word opcode); -void reti(cpu_state *cpu, word opcode); -void exgf_rd_0(cpu_state *cpu, word opcode); -void exgf_rd_1(cpu_state *cpu, word opcode); -void trap(cpu_state *cpu, word opcode); -void emu(cpu_state *cpu, word opcode); -void rev_rd(cpu_state *cpu, word opcode); - -void addxy_rs_rd(cpu_state *cpu, word opcode); -void subxy_rs_rd(cpu_state *cpu, word opcode); -void cmpxy_rs_rd(cpu_state *cpu, word opcode); - -void add_rs_rd(cpu_state *cpu, word opcode); -void addc_rs_rd(cpu_state *cpu, word opcode); -void addi_iw_rd(cpu_state *cpu, word opcode); -void addi_il_rd(cpu_state *cpu, word opcode); -void subi_iw_rd(cpu_state *cpu, word opcode); -void subi_il_rd(cpu_state *cpu, word opcode); - -void cmpi_iw_rd(cpu_state *cpu, word opcode); -void cmpi_il_rd(cpu_state *cpu, word opcode); - -void abs_rd(cpu_state *cpu, word opcode); -void andi_il_rd(cpu_state *cpu, word opcode); -void and_rs_rd(cpu_state *cpu, word opcode); -void andn_rs_rd(cpu_state *cpu, word opcode); -void or_rs_rd(cpu_state *cpu, word opcode); -void ori_il_rd(cpu_state *cpu, word opcode); -void xor_rs_rd(cpu_state *cpu, word opcode); -void xori_il_rd(cpu_state *cpu, word opcode); -void cmp_rs_rd(cpu_state *cpu, word opcode); -void btst_rs_rd(cpu_state *cpu, word opcode); -void btst_k_rd(cpu_state *cpu, word opcode); -void not_rd(cpu_state *cpu, word opcode); -void neg_rd(cpu_state *cpu, word opcode); -void add_k_rd(cpu_state *cpu, word opcode); -void sub_k_rd(cpu_state *cpu, word opcode); - -void sub_rs_rd(cpu_state *cpu, word opcode); -void divu_rs_rd(cpu_state *cpu, word opcode); -void divs_rs_rd(cpu_state *cpu, word opcode); -void modu_rs_rd(cpu_state *cpu, word opcode); -void mods_rs_rd(cpu_state *cpu, word opcode); - -void rl_rs_rd(cpu_state *cpu, word opcode); -void rl_k_rd(cpu_state *cpu, word opcode); -void sll_rs_rd(cpu_state *cpu, word opcode); -void sll_k_rd(cpu_state *cpu, word opcode); -void sla_k_rd(cpu_state *cpu, word opcode); -void sla_rs_rd(cpu_state *cpu, word opcode); -void srl_rs_rd(cpu_state *cpu, word opcode); -void srl_k_rd(cpu_state *cpu, word opcode); -void sra_k_rd(cpu_state *cpu, word opcode); -void sra_rs_rd(cpu_state *cpu, word opcode); -void lmo_rs_rd(cpu_state *cpu, word opcode); - -void mpyu_rs_rd(cpu_state *cpu, word opcode); -void mpys_rs_rd(cpu_state *cpu, word opcode); - -void movx_rs_rd(cpu_state *cpu, word opcode); -void movy_rs_rd(cpu_state *cpu, word opcode); - -void movb_rs_daddr(cpu_state *cpu, word opcode); -void movb_irs_rd(cpu_state *cpu, word opcode); -void movb_rs_ird(cpu_state *cpu, word opcode); -void movb_irs_ird(cpu_state *cpu, word opcode); -void movb_rs_irdo(cpu_state *cpu, word opcode); -void move_irs_rd_0(cpu_state *cpu, word opcode); -void move_irs_rd_1(cpu_state *cpu, word opcode); - -void move_rs_ird_0(cpu_state *cpu, word opcode); -void move_rs_ird_1(cpu_state *cpu, word opcode); - -void movi_iw_rd(cpu_state *cpu, word opcode); -void movi_il_rd(cpu_state *cpu, word opcode); - -void move_rs_daddr_0(cpu_state *cpu, word opcode); -void move_rs_daddr_1(cpu_state *cpu, word opcode); - -void move_saddr_rd_0(cpu_state *cpu, word opcode); -void move_saddr_rd_1(cpu_state *cpu, word opcode); - -void movk_k_rd(cpu_state *cpu, word opcode); - -void move_rs_rd(cpu_state *cpu, word opcode); -void move_rs_rd_a(cpu_state *cpu, word opcode); -void move_rs_rd_b(cpu_state *cpu, word opcode); - - -void move_irsp_irdp_0(cpu_state *cpu, word opcode); -void move_irsp_irdp_1(cpu_state *cpu, word opcode); - -void move_rs_irdp_0(cpu_state *cpu, word opcode); -void move_rs_irdp_1(cpu_state *cpu, word opcode); - -void move_irsp_rd_0(cpu_state *cpu, word opcode); -void move_irsp_rd_1(cpu_state *cpu, word opcode); - -void move_rs_mird_0(cpu_state *cpu, word opcode); -void move_rs_mird_1(cpu_state *cpu, word opcode); - -void move_irso_rd_0(cpu_state *cpu, word opcode); -void move_irso_rd_1(cpu_state *cpu, word opcode); - -void movb_addr_rd(cpu_state *cpu, word opcode); - -void move_mirs_mird_0(cpu_state *cpu, word opcode); -void move_mirs_mird_1(cpu_state *cpu, word opcode); - -void move_rs_irdo_0(cpu_state *cpu, word opcode); -void move_rs_irdo_1(cpu_state *cpu, word opcode); - -void movb_irso_rd(cpu_state *cpu, word opcode); - -void move_irs_ird_0(cpu_state *cpu, word opcode); -void move_irs_ird_1(cpu_state *cpu, word opcode); - -void move_saddr_daddr_0(cpu_state *cpu, word opcode); -void move_saddr_daddr_1(cpu_state *cpu, word opcode); - -void move_irso_irdo_0(cpu_state *cpu, word opcode); -void move_irso_irdo_1(cpu_state *cpu, word opcode); - -void move_mirs_rd_0(cpu_state *cpu, word opcode); -void move_mirs_rd_1(cpu_state *cpu, word opcode); - -void move_addr_irsp_0(cpu_state *cpu, word opcode); -void move_addr_irsp_1(cpu_state *cpu, word opcode); - -void move_irso_irdp_0(cpu_state *cpu, word opcode); -void move_irso_irdp_1(cpu_state *cpu, word opcode); - -void movb_saddr_daddr(cpu_state *cpu, word opcode); - -void movb_irso_irdo(cpu_state *cpu, word opcode); - -void sext_rd_0(cpu_state *cpu, word opcode); -void sext_rd_1(cpu_state *cpu, word opcode); - -void zext_rd_0(cpu_state *cpu, word opcode); -void zext_rd_1(cpu_state *cpu, word opcode); - -void dsj(cpu_state *cpu, word opcode); -void dsjeq(cpu_state *cpu, word opcode); -void dsjne(cpu_state *cpu, word opcode); -void dsjs(cpu_state *cpu, word opcode); - -void call_rs(cpu_state *cpu, word opcode); -void calla(cpu_state *cpu, word opcode); -void callr(cpu_state *cpu, word opcode); - -void rets(cpu_state *cpu, word opcode); - -void jump_rs(cpu_state *cpu, word opcode); - -void jr_uc(cpu_state *cpu, word opcode); -void jr_uc_0(cpu_state *cpu, word opcode); -void jr_uc_8(cpu_state *cpu, word opcode); - -void jr_ne(cpu_state *cpu, word opcode); -void jr_ne_0(cpu_state *cpu, word opcode); -void jr_ne_8(cpu_state *cpu, word opcode); - -void jr_eq(cpu_state *cpu, word opcode); -void jr_eq_0(cpu_state *cpu, word opcode); -void jr_eq_8(cpu_state *cpu, word opcode); - -void jr_nc(cpu_state *cpu, word opcode); -void jr_nc_0(cpu_state *cpu, word opcode); -void jr_nc_8(cpu_state *cpu, word opcode); - -void jr_c(cpu_state *cpu, word opcode); -void jr_c_0(cpu_state *cpu, word opcode); -void jr_c_8(cpu_state *cpu, word opcode); - -void jr_v(cpu_state *cpu, word opcode); -void jr_v_0(cpu_state *cpu, word opcode); -void jr_v_8(cpu_state *cpu, word opcode); - -void jr_nv(cpu_state *cpu, word opcode); -void jr_nv_0(cpu_state *cpu, word opcode); -void jr_nv_8(cpu_state *cpu, word opcode); - -void jr_n(cpu_state *cpu, word opcode); -void jr_n_0(cpu_state *cpu, word opcode); -void jr_n_8(cpu_state *cpu, word opcode); - -void jr_nn(cpu_state *cpu, word opcode); -void jr_nn_0(cpu_state *cpu, word opcode); -void jr_nn_8(cpu_state *cpu, word opcode); - -void jr_hi(cpu_state *cpu, word opcode); -void jr_hi_0(cpu_state *cpu, word opcode); -void jr_hi_8(cpu_state *cpu, word opcode); - -void jr_ls(cpu_state *cpu, word opcode); -void jr_ls_0(cpu_state *cpu, word opcode); -void jr_ls_8(cpu_state *cpu, word opcode); - -void jr_gt(cpu_state *cpu, word opcode); -void jr_gt_0(cpu_state *cpu, word opcode); -void jr_gt_8(cpu_state *cpu, word opcode); - -void jr_ge(cpu_state *cpu, word opcode); -void jr_ge_0(cpu_state *cpu, word opcode); -void jr_ge_8(cpu_state *cpu, word opcode); - -void jr_lt(cpu_state *cpu, word opcode); -void jr_lt_0(cpu_state *cpu, word opcode); -void jr_lt_8(cpu_state *cpu, word opcode); - -void jr_le(cpu_state *cpu, word opcode); -void jr_le_0(cpu_state *cpu, word opcode); -void jr_le_8(cpu_state *cpu, word opcode); - -void jr_p(cpu_state *cpu, word opcode); -void jr_p_0(cpu_state *cpu, word opcode); -void jr_p_8(cpu_state *cpu, word opcode); - -void pixblt_b_xy(cpu_state *cpu, word opcode); -void pixt_irs_rd(cpu_state *cpu, word opcode); -void pixt_rd_irdxy(cpu_state *cpu, word opcode); -void fill_xy(cpu_state *cpu, word opcode); -void fill_l(cpu_state *cpu, word opcode); -void cvxyl_rs_rd(cpu_state *cpu, word opcode); -void drav_rs_rd(cpu_state *cpu, word opcode); -} - -void generate_irq(cpu_state *cpu, int num); -void clear_irq(cpu_state *cpu, int num); - -struct display_info { - int rowaddr; - int coladdr; - int vsblnk; - int veblnk; - int heblnk; - int hsblnk; - int htotal; -}; - - -typedef int (*scanline_render_t)(int line, display_info*); -int generate_scanline(cpu_state *cpu, int line, scanline_render_t render); - - -#ifdef TMS34010_DEBUGGER -void run(cpu_state *cpu, int cycles, bool stepping=false); -#else -void run(cpu_state *cpu, int cycles); - -#endif -void reset(cpu_state *cpu); -void write_ioreg(cpu_state *cpu, dword addr, word value); -dword read_ioreg(cpu_state *cpu, dword addr); - -std::string dasm(dword addr, size_t *size); -std::string new_dasm(dword pc, size_t *size); - -} - -#endif // TMS34010_H diff --git a/jan/src/cpu/tms34010/tms34010_arithm.h b/jan/src/cpu/tms34010/tms34010_arithm.h deleted file mode 100644 index d8215f271..000000000 --- a/jan/src/cpu/tms34010/tms34010_arithm.h +++ /dev/null @@ -1,578 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef TMS34010_ARITHM_H -#define TMS34010_ARITHM_H - -#include "tms34010.h" -#include "tms34010_memacc.h" -#include "tms34010_defs.h" - - -namespace tms { namespace ops { - -#define update_vc(sum, a, b) \ - do { \ - _st &= ~(ST_C | ST_V); \ - if ((sum ^ a) & (sum ^ b) & SIGN_BIT32) \ - _st |= ST_V; \ - if ((dword)~(a) < (dword)(b)) \ - _st |= ST_C; \ - } while (0) - -#define update_vc_sub(sum, a, b) \ - do { \ - _st &= ~(ST_C | ST_V); \ - if ((a ^ b) & (a ^ sum) & SIGN_BIT32) \ - _st |= ST_V; \ - if ((dword)(b) > (dword)(a)) \ - _st |= ST_C; \ - } while (0) - - -void abs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_Z | ST_N | ST_V); - if (!_rd) - _st |= ST_Z; - dword res = 0 - _rd; - if (!(res & SIGN_BIT32)) - _rd = res; - else - _st |= ST_N; - - if (res == (sdword)0x80000000) - _st |= ST_V; - - CONSUME_CYCLES(1); -} - -void add_rs_rd(cpu_state *cpu, word opcode) -{ - dword sum = _rd + _rs; - update_vc(sum, _rd, _rs); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(1); -} - -void addc_rs_rd(cpu_state *cpu, word opcode) -{ - dword sum = _rd + _rs + (CF ? 1 : 0); - update_vc(sum, _rd, _rs); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(1); -} - -void addi_iw_rd(cpu_state *cpu, word opcode) -{ - sdword iw = wsign_ext(mem_read(_pc)); - _pc += 16; - dword sum = _rd + iw; - update_vc(sum, _rd, iw); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(2); -} - -void addi_il_rd(cpu_state *cpu, word opcode) -{ - sdword il = mem_read_d(_pc); - _pc += 32; - dword sum = _rd + il; - update_vc(sum, _rd, il); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - -void add_k_rd(cpu_state *cpu, word opcode) -{ - dword k = fw_lut[K]; - uint64_t sum = _rd + k; - update_vc(sum, _rd, k); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(1); -} - -void addxy_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_N | ST_V | ST_Z | ST_C); - _rdx += _rsx; - _rdy += _rsy; - if (!_rdx) - _st |= ST_N; - if (!_rdy) - _st |= ST_Z; - if (_rdy & SIGN_BIT16) - _st |= ST_C; - if (_rdx & SIGN_BIT16) - _st |= ST_V; - - CONSUME_CYCLES(1); -} - -void and_rs_rd(cpu_state *cpu, word opcode) -{ - _rd &= _rs; - update_z(_rd); - - CONSUME_CYCLES(1); -} - -void andi_il_rd(cpu_state *cpu, word opcode) -{ - dword il = ~mem_read_d(_pc); - _pc += 32; - _rd &= il; - update_z(_rd); - CONSUME_CYCLES(3); -} - -void andn_rs_rd(cpu_state *cpu, word opcode) -{ - _rd &= ~_rs; - update_z(_rd); - - CONSUME_CYCLES(1); -} - -void btst_k_rd(cpu_state *cpu, word opcode) -{ - if (_rd & (1 << KN)) - _st &= ~ST_Z; - else - _st |= ST_Z; - - CONSUME_CYCLES(1); -} - -void btst_rs_rd(cpu_state *cpu, word opcode) -{ - if (_rd & (1 << (_rs & 0x1F))) - _st &= ~ST_Z; - else - _st |= ST_Z; - - CONSUME_CYCLES(2); -} - - -void clrc(cpu_state *cpu, word opcode) -{ - _st &= ~ST_C; - - CONSUME_CYCLES(1); -} - - -void cmp_rs_rd(cpu_state *cpu, word opcode) -{ - uint64_t res = _rd - _rs; - update_zn(res); - update_vc_sub(res, _rd, _rs); - - CONSUME_CYCLES(1); -} - - -void cmpi_iw_rd(cpu_state *cpu, word opcode) -{ - sdword iw = (sword)(~mem_read(_pc)); - _pc += 16; - uint64_t res = _rd - iw; - update_zn(res); - update_vc_sub(res, _rd, iw); - - CONSUME_CYCLES(2); -} - -void cmpi_il_rd(cpu_state *cpu, word opcode) -{ - sdword il = ~mem_read_d(_pc); - _pc += 32; - uint64_t res = _rd - il; - update_zn(res); - update_vc_sub(res, _rd, il); - - CONSUME_CYCLES(3); -} - - -void cmpxy_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_N | ST_V | ST_Z | ST_C); - - sword r = _rdx - _rsx; - if (r == 0) - _st |= ST_N; - if (r & SIGN_BIT16) - _st |= ST_V; - - r = _rdy - _rsy; - if (r == 0) - _st |= ST_Z; - if (r & SIGN_BIT16) - _st |= ST_C; - - CONSUME_CYCLES(3); -} - - -// TODO: FIX -void divs_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_Z | ST_V | ST_N); - if (!_rs) - _st |= ST_V; - - sdword rd = _rd; - const sdword rs = _rs; - - if (ODD_RD) { - if (rs) { - rd /= rs; - update_zn(rd); - } - _rd = rd; - CONSUME_CYCLES(39); - } else { - i64 x = (static_cast(R(RD_n)) << 32) | R(RD_n + 1); - - if (rs) { - i64 res = x / rs; - i64 mod = x % rs; - if ((res >> 32) != 0) - _st |= ST_V; - else { - R(RD_n+0) = res; - R(RD_n+1) = mod; - if (!res) - _st |= ST_Z; - } - } - CONSUME_CYCLES(40); - } -} - -void divu_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_Z | ST_V); - if (!_rs) - _st |= ST_V; - - if (RD_n & 1) { - if (_rs) - _rd = _rd / _rs; - if (!_rd) - _st |= ST_Z; - } else { - u64 x = (static_cast(R(RD_n)) << 32) | R(RD_n + 1); - - if (_rs) { - u64 res = x / (dword)_rs; - u64 mod = x % (dword)_rs; - if ((res >> 32) != 0) - _st |= ST_V; - else { - R(RD_n+0) = res; - R(RD_n+1) = mod; - if (!res) - _st |= ST_Z; - } - } - } - - CONSUME_CYCLES(37); -} - - -void lmo_rs_rd(cpu_state *cpu, word opcode) -{ - dword val = _rs; - update_z(_rs); - int i = 0; - if (_rs) { - while (!(val & 0x80000000)) { - val <<= 1; - i++; - } - } - _rd = i; - - CONSUME_CYCLES(1); -} - - -void mods_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_Z | ST_V | ST_N); - if (_rs) { - _rd = static_cast(_rd) % static_cast(_rs); - update_zn(_rd); - } else { - _st |= ST_V; - } - - CONSUME_CYCLES(40); -} - - - -void modu_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_Z | ST_V); - if (_rs) { - _rd = _rd % _rs; - if (!_rd) - _st |= ST_Z; - } else { - _st |= ST_V; - } - - CONSUME_CYCLES(35); -} - - -// FIX? -void mpys_rs_rd(cpu_state *cpu, word opcode) -{ - const int shift = 32 - FW1; - sdword mm = ((sdword)(_rs << shift)) >> shift; - i64 res = ((i64)(uint32_t)_rd) * ((i64)mm); - - _st &= ~(ST_Z | ST_N); - if (ODD_RD) { - _rd_0 = res; - } else { - _rd_0 = res >> 32; - _rd_1 = (dword)res; - } - if ((res >> 32) & SIGN_BIT32) - _st |= ST_N; - if (res == 0) - _st |= ST_Z; - - CONSUME_CYCLES(20); -} - - -void mpyu_rs_rd(cpu_state *cpu, word opcode) -{ - unsigned mm = _rs & (0xFFFFFFFF >> (32 - FW1)); - u64 res = static_cast(mm) * static_cast(_rd); - _st &= ~ST_Z; - if (RD_n & 1) { - cpu->r[RD]->value = res; - } else { - cpu->r[RD+0]->value = res >> 32; - cpu->r[RD+1]->value = res; - } - if (!res) - _st |= ST_Z; - - CONSUME_CYCLES(21); -} - - -void neg_rd(cpu_state *cpu, word opcode) -{ - sdword sum = 0 - _rd; - update_vc_sub(sum, 0, _rd); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(1); -} - - -void negb_rd(cpu_state *cpu, word opcode) -{ - // TODO - - CONSUME_CYCLES(1); -} - - -void not_rd(cpu_state *cpu, word opcode) -{ - _rd = ~_rd; - update_z(_rd); - - CONSUME_CYCLES(1); -} - - -void or_rs_rd(cpu_state *cpu, word opcode) -{ - _rd |= _rs; - update_z(_rd); - - CONSUME_CYCLES(1); -} - - -void ori_il_rd(cpu_state *cpu, word opcode) -{ - _rd |= mem_read_d(_pc); - _pc += 32; - update_z(_rd); - - CONSUME_CYCLES(3); -} - - -void setc(cpu_state *cpu, word opcode) -{ - _st |= ST_C; - - CONSUME_CYCLES(1); -} - - -void sext_rd_0(cpu_state *cpu, word opcode) -{ - const int shift = 32 - FW0; - _rd = (((sdword)_rd) << shift) >> shift; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - - -void sext_rd_1(cpu_state *cpu, word opcode) -{ - const int shift = 32 - FW1; - _rd = (((sdword)_rd) << shift) >> shift; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - - -void sub_rs_rd(cpu_state *cpu, word opcode) -{ - dword sum = _rd - _rs; - update_vc_sub(sum, _rd, _rs); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(1); -} - - -void subb_rs_rd(cpu_state *cpu, word opcode) -{ - // TODO - - CONSUME_CYCLES(1); -} - -void subi_iw_rd(cpu_state *cpu, word opcode) -{ - sdword iw = (sword)(~mem_read(_pc)); - _pc += 16; - dword sum = _rd - iw; - update_vc_sub(sum, _rd, iw); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(2); -} - - -void subi_il_rd(cpu_state *cpu, word opcode) -{ - sdword iw = ~mem_read_d(_pc); - _pc += 32; - dword sum = _rd - iw; - update_vc_sub(sum, _rd, iw); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - - -void sub_k_rd(cpu_state *cpu, word opcode) -{ - dword k = fw_lut[K]; - uint64_t sum = _rd - k; - update_vc_sub(sum, _rd, k); - _rd = sum; - update_zn(_rd); - - CONSUME_CYCLES(1); -} - - -void subxy_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_N | ST_V | ST_Z | ST_C); - - if (_rsx == _rdx) - _st |= ST_N; - if (_rsy > _rdy) - _st |= ST_C; - if (_rsy == _rdy) - _st |= ST_Z; - if (_rsx > _rdx) - _st |= ST_V; - - _rdx -= _rsx; - _rdy -= _rsy; - - CONSUME_CYCLES(1); -} - - -void xor_rs_rd(cpu_state *cpu, word opcode) -{ - _rd ^= _rs; - update_z(_rd); - - CONSUME_CYCLES(1); -} - -void xori_il_rd(cpu_state *cpu, word opcode) -{ - _rd ^= mem_read_d(_pc); - _pc += 32; - update_z(_rd); - - CONSUME_CYCLES(3); -} - - -void zext_rd_0(cpu_state *cpu, word opcode) -{ - const int shift = 32 - FW0; - _rd &= 0xFFFFFFFF >> shift; - update_z(_rd); - - CONSUME_CYCLES(1); -} - - -void zext_rd_1(cpu_state *cpu, word opcode) -{ - const int shift = 32 - FW1; - _rd &= 0xFFFFFFFF >> shift; - update_z(_rd); - - CONSUME_CYCLES(1); -} - - -} // ops -} // tms - -#endif // TMS34010_ARITHM_H diff --git a/jan/src/cpu/tms34010/tms34010_ctrl.h b/jan/src/cpu/tms34010/tms34010_ctrl.h deleted file mode 100644 index 84c09ecfe..000000000 --- a/jan/src/cpu/tms34010/tms34010_ctrl.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef TMS34010_CTRL_H -#define TMS34010_CTRL_H - -#include "tms34010.h" -#include "tms34010_defs.h" - - -extern unsigned g_inputs[]; -namespace tms { namespace ops { - -void dint(cpu_state *cpu, word opcode) -{ - _st &= ~ST_IE; - - CONSUME_CYCLES(3); -} - -void eint(cpu_state *cpu, word opcode) -{ - _st |= ST_IE; - - CONSUME_CYCLES(3); -} - -void emu(cpu_state *cpu, word opcode) -{ - // ??? - CONSUME_CYCLES(6); -} - -void rev_rd(cpu_state *cpu, word opcode) -{ - _rd = 0x8; - - CONSUME_CYCLES(1); -} - -void setf_0(cpu_state *cpu, word opcode) -{ - unsigned fs = opcode & 0x1F; - _st &= ~(ST_FS0_MASK | ST_FE0); - _st |= fs | (opcode & 0x20); - - CONSUME_CYCLES(1); -} - -void setf_1(cpu_state *cpu, word opcode) -{ - unsigned fs = opcode & 0x1F; - _st &= ~(ST_FS1_MASK | ST_FE1); - _st |= (fs | (opcode & 0x20)) << ST_FS1_SHIFT; - - CONSUME_CYCLES(1); -} - -void exgf_rd_0(cpu_state *cpu, word opcode) -{ - word k = _rd & 0x3F; - _rd = FWEX(0); - _st &= ~(ST_FS0_MASK | ST_FE0); - _st |= k; - - CONSUME_CYCLES(1); -} - - -void exgf_rd_1(cpu_state *cpu, word opcode) -{ - word k = _rd & 0x3F; - _rd = FWEX(1); - _st &= ~(ST_FS1_MASK | ST_FE1); - _st |= (k << ST_FS1_SHIFT); - - CONSUME_CYCLES(1); -} - -void mmtm(cpu_state *cpu, word opcode) -{ - word list = mem_read(_pc); - _pc += 16; - -#if 0// TMS34020 ??? - _st &= ~ST_N; - if (!_rd) _st |= ST_N; - else { - if (((0 - _rd) & SIGN_BIT32) && !(_rd == 0x80000000)) - _st |= ST_N; - } -#endif - CONSUME_CYCLES(2); - - for (int i = 0; i < 16; i++) { - if (list & 0x8000) { - _rd -= 32; - mem_write_d(_rd, cpu->r[i|R_BIT]->value); - CONSUME_CYCLES(4); - } - list <<= 1; - } -} - -void mmfm(cpu_state *cpu, word opcode) -{ - word list = mem_read(_pc); - _pc += 16; - - CONSUME_CYCLES(3); - - for (int i = 15; i >= 0; i--) { - if (list & 0x8000) { - cpu->r[i|R_BIT]->value = mem_read_d(_rd); - _rd += 32; - CONSUME_CYCLES(4); - } - list <<= 1; - } -} - -void reti(cpu_state *cpu, word opcode) -{ - _st = _pop(); - _pc = _pop() & 0xFFFFFFF0; - - CONSUME_CYCLES(11); -} - -void trap(cpu_state *cpu, word opcode) -{ - _push(_pc); - _push(_st); - _st &= ~ST_IE; - _pc = mem_read_d(0xFFFFFFE0 - (opcode & 0x1F) * 32) & 0xFFFFFFF0; - - CONSUME_CYCLES(16); -} - -void exgpc(cpu_state *cpu, word opcode) -{ - dword tmp = _rd; - _rd = _pc; - _pc = tmp; - - CONSUME_CYCLES(2); -} - -void getpc(cpu_state *cpu, word opcode) -{ - _rd = _pc; - - CONSUME_CYCLES(1); -} - -void putst(cpu_state *cpu, word opcode) -{ - _st = _rd; - - CONSUME_CYCLES(3); -} - -void pushst(cpu_state *cpu, word opcode) -{ - _push(_st); - - CONSUME_CYCLES(2); -} - -void popst(cpu_state *cpu, word opcode) -{ - _st = _pop(); - - CONSUME_CYCLES(8); -} - -void getst(cpu_state *cpu, word opcode) -{ - _rd = _st; - - CONSUME_CYCLES(1); -} - -} // ops -} // tms - -#endif // TMS34010_CTRL_H diff --git a/jan/src/cpu/tms34010/tms34010_dasm.cpp b/jan/src/cpu/tms34010/tms34010_dasm.cpp deleted file mode 100644 index 8034aea5a..000000000 --- a/jan/src/cpu/tms34010/tms34010_dasm.cpp +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#include -#include -#include "tms34010.h" -#include "memhandler.h" - -#define READ_WORD(addr) tms::read_word(addr) -#define READ_DWORD(addr) (READ_WORD(addr) | (READ_WORD(addr + 16) << 16)) - -#define BKW_DIR (opcode & (1 << 10)) -#define OFFS ((opcode >> 5) & 0x1F) -#define K fw_lut[((opcode >> 5) & 0x1F)] -#define KN ((~opcode >> 5) & 0x1F) -#define K2C ((-K) & 0x1F) -#define M_BIT (opcode & (1 << 9)) -#define R_BIT (opcode & 0x10) -#define RS (((opcode >> 5) & 0xF) | R_BIT) -#define RD ((opcode & 0xF) | R_BIT) -#define NF (opcode & 0x1F) -#define RS_n ((opcode >> 5) & 0xF) -#define RD_n (opcode & 0xF) - -namespace tms -{ - -const int dasm_buf_size = 128; -const int dasm_pc_size = 32; - -const char *reg_names[32] = -{ - "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", - "a8", "a9", "a10", "a11", "a12", "a13", "a14", "sp", - "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", - "b8", "b9", "b10", "b11", "b12", "b13", "b14", "sp", -}; - -static inline dword dsjs_pc(dword pc, word opcode) -{ - int displace = OFFS * 16; - if (BKW_DIR) - displace = -displace; - return pc + displace; -} - -static inline dword jr_pc(dword pc, word opcode) -{ - int displace = (opcode & 0xFF) * 16; - if (BKW_DIR) - displace = -displace; - return pc + displace; -} - -static inline const char *jr_cond(word opcode) -{ - const char *cond_table[16] = { - /* 0000 */ "", - /* 0001 */ "p", - /* 0010 */ "ls", - /* 0011 */ "hi", - /* 0100 */ "lt", - /* 0101 */ "ge", - /* 0110 */ "le", - /* 0111 */ "gt", - /* 1000 */ "c", - /* 1001 */ "nc", - /* 1010 */ "eq", - /* 1011 */ "ne", - /* 1100 */ "v", - /* 1101 */ "nv", - /* 1110 */ "n", - /* 1111 */ "nn" - }; - return cond_table[(opcode >> 8) & 0xF]; -} - - -static const char *reg_list(word opcode, word data) -{ - int inc = (opcode & 0x10) ? 16 : 0; - std::vector regs; - regs.reserve(16); - - - for (int i = 0; i < 16; i++) { - if (data & 0x8000) - regs.push_back(reg_names[inc + i]); - data <<= 1; - } - - - std::string s; - s.reserve(100); - for (int i = 0; i < regs.size(); i++) { - s.append(regs[i]); - if (i != regs.size() - 1) - s.append(","); - } - - return s.c_str(); -} - -static const char *reg_list_inv(word opcode, word data) -{ - int inc = (opcode & 0x10) ? 16 : 0; - std::vector regs; - regs.reserve(16); - - - for (int i = 0; i < 16; i++) { - if (data & 1) - regs.push_back(reg_names[inc + i]); - data >>= 1; - } - - - std::string s; - s.reserve(100); - for (int i = 0; i < regs.size(); i++) { - s.append(regs[i]); - if (i != regs.size() - 1) - s.append(","); - } - - return s.c_str(); -} - -#define DASM(...) snprintf(buf, dasm_buf_size, __VA_ARGS__) - -std::string dasm(dword pc, size_t *szbits) -{ - const int size = 128; - char buf[size]; - char pcb[dasm_pc_size]; - - word opcode = READ_WORD(pc); - - buf[0] = '\0'; - pcb[0] = '\0'; - - snprintf(pcb, dasm_pc_size, "%08X\t%04X\t", pc, opcode); - int fs = opcode & 0x1F; - int fe = (opcode & (1 << 5)) ? 1 : 0; - int f = (opcode & (1 << 9)) ? 1 : 0; - int rd = RD; - int rs = RS; - //int rfile = (opcode >> 5) & 1; - - int words = 1; - - if (!fs) - fs = 32; - - switch (opcode >> 12) { - case 0x00: - switch ((opcode >> 5) & 0x7F) { - - case 0x09: DASM("exgpc %s", reg_names[rd]); break; - case 0x0A: DASM("getpc %s", reg_names[rd]); break; - case 0x0B: DASM("jump %s", reg_names[rd]); break; - case 0x0F: DASM("pushst"); break; - case 0x0E: DASM("popst"); break; - case 0x1B: DASM("dint"); break; - case 0x6B: DASM("eint"); break; - - case 0x1F: DASM("not %s", reg_names[rd]); break; - - case 0x2F: DASM("movb %s, @%x", reg_names[rd], READ_DWORD(pc + 16)); words += 2; break; - case 0x3F: DASM("movb @%x, %s", READ_DWORD(pc + 16), reg_names[rd]); words += 2; break; - - case 0x2A: - case 0x2B: - case 0x3A: - case 0x3B: DASM("setf 0x%x, %d, %d", fs, fe, f); break; - - case 0x4D: DASM("mmfm %s, %s", reg_names[rd], reg_list_inv(opcode, READ_WORD(pc + 16))); words++; break; - - case 0x4E: DASM("movi 0x%04x, %s", READ_WORD(pc + 16), reg_names[rd]); words++; break; - case 0x4F: DASM("movi 0x%08x, %s", READ_DWORD(pc + 16), reg_names[rd]); words += 2; break; - - case 0x3C: - case 0x2C: DASM("move %s, @%x, %d", reg_names[rd], READ_DWORD(pc + 16), f); words += 2; break; - - case 0x3D: - case 0x2D: DASM("move @%x, %s, %d", READ_DWORD(pc + 16), reg_names[rd], f); words += 2; break; - - case 0x4B: DASM("rets 0x%x", NF); break; - case 0x4C: DASM("mmtm %s, %s", reg_names[rd], reg_list(opcode, READ_WORD(pc + 16))); words++; break; - - case 0x58: DASM("addi 0x%08x, %s", READ_WORD(pc + 16), reg_names[rd]); words++; break; - case 0x59: DASM("addi 0x%08x, %s", READ_DWORD(pc + 16), reg_names[rd]); words += 2; break; - case 0x5C: DASM("andi 0x%08x, %s", ~READ_DWORD(pc + 16), reg_names[rd]); words += 2; break; - - case 0x5F: DASM("subi 0x%08x, %s", ~(short)READ_WORD(pc + 16), reg_names[rd]); words++; break; - case 0x68: DASM("subi 0x%08x, %s", ~READ_DWORD(pc + 16), reg_names[rd]); words += 2; break; - - case 0x5A: DASM("cmpi 0x%08x, %s", ~(short)READ_WORD(pc + 16), reg_names[rd]); words++; break; - case 0x5B: DASM("cmpi 0x%08x, %s", ~READ_DWORD(pc + 16), reg_names[rd]); words += 2; break; - - case 0x69: { - switch (opcode & 0xFF) { - case 0x3F: - DASM("callr @%x", pc + 32 + (short)READ_WORD(pc + 16) * 16); words++; break; - } - } - case 0x6A: { - switch (opcode & 0xFF) { - case 0x5F: - DASM("calla @%x", READ_DWORD(pc + 16)); words += 2; break; - } - break; - } - - case 0x6C: DASM("dsj %s, @%x", reg_names[rd], pc + 32 + (short)READ_WORD(pc + 16) * 16); words++; break; - case 0x7D: DASM("pixblt b, xy"); break; - - - default: - DASM("[%04X] ??? [0000]", opcode); - break; - } - break; - - case 0x01: - switch ((opcode >> 10) & 3) { - case 0x03: DASM("btst 0x%x, %s", KN, reg_names[rd]); break; - case 0x02: DASM("movk 0x%x, %s", K, reg_names[rd]); break; - case 0x01: DASM("subk 0x%x, %s", K, reg_names[rd]); break; - case 0x00: DASM("addk 0x%x, %s", K, reg_names[rd]); break; - default: - DASM("[%04X] ??? [0001]", opcode); - break; - } - break; - - case 0x02: - switch ((opcode >> 10) & 3) { - case 0x01: DASM("sll 0x%x, %s", K, reg_names[rd]); break; - case 0x03: DASM("srl 0x%x, %s", K2C, reg_names[rd]); break; - default: - DASM("[%04X] ??? [0010]", opcode); - break; - } - break; - - case 0x03: - if (opcode & (1 << 11)) - DASM("dsjs %s, @%x", reg_names[rd], dsjs_pc(pc + 16, opcode)); - else { - DASM("[%04X] ??? [0011]", opcode); - } - break; - case 0x04: - switch ((opcode >> 9) & 7) { - case 0x0: DASM("add %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x2: DASM("sub %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x4: DASM("cmp %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x6: DASM("move %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x7: { - int rs_, rd_; - if (R_BIT) { - rs_ = 16 + RS_n; - rd_ = RD_n; - } else { - rs_ = RS_n; - rd_ = 16 + RD_n; - } - DASM("move %s, %s", reg_names[rs_], reg_names[rd_]); - break; - } - - default: - DASM("[%04X] ??? [0100]", opcode); - break; - } - - break; - - case 0x05: - switch ((opcode >> 9) & 7) { - case 0x00: DASM("and %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x01: DASM("andn %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x02: DASM("or %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x03: - if (rs == rd) - DASM("clr %s", reg_names[rs]); - else - DASM("xor %s, %s", reg_names[rs], reg_names[rd]); - break; - case 0x04: DASM("divs %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x05: DASM("divu %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x06: DASM("mpys %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x07: DASM("mpyu %s, %s", reg_names[rs], reg_names[rd]); break; - default: - DASM("[%04X] ??? [0101]", opcode); - } - - break; - - case 0x06: - switch ((opcode >> 9) & 7) { - case 0x05: DASM("lmo %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x07: DASM("modu %s, %s", reg_names[rs], reg_names[rd]); break; - default: - DASM("[%04X] ??? [0110]", opcode); - break; - } - break; - - - case 0x08: - switch ((opcode >> 9) & 7) { - case 0x7: DASM("movb *%s, %s", reg_names[rs], reg_names[rd]); break; - case 0x6: DASM("movb %s, *%s", reg_names[rs], reg_names[rd]); break; - case 0x2: DASM("move *%s, %s, 0", reg_names[rs], reg_names[rd]); break; - case 0x3: DASM("move *%s, %s, 1", reg_names[rs], reg_names[rd]); break; - case 0x0: DASM("move %s, *%s, 0", reg_names[rs], reg_names[rd]); break; - case 0x1: DASM("move %s, *%s, 1", reg_names[rs], reg_names[rd]); break; - - default: - DASM("[%04X] ??? [1000]", opcode); - break; - } - - break; - - - - case 0x09: - switch ((opcode >> 9) & 7) { - case 0x00: DASM("move %s, *%s+, 0", reg_names[rs], reg_names[rd]); break; - case 0x01: DASM("move %s, *%s+, 1", reg_names[rs], reg_names[rd]); break; - case 0x02: DASM("move *%s+, %s, 0", reg_names[rs], reg_names[rd]); break; - case 0x03: DASM("move *%s+, %s, 1", reg_names[rs], reg_names[rd]); break; - case 0x04: DASM("move *%s+, *%s+, 0", reg_names[rs], reg_names[rd]); break; - case 0x05: DASM("move *%s+, *%s+, 1", reg_names[rs], reg_names[rd]); break; - default: - DASM("[%04X] ??? [1001]", opcode); - break; - } - break; - - case 0x0A: - switch ((opcode >> 9) & 7) { - case 0x00: DASM("move %s, -*%s, 0", reg_names[rs], reg_names[rd]); break; - case 0x01: DASM("move %s, -*%s, 1", reg_names[rs], reg_names[rd]); break; - case 0x02: DASM("move -%s, *%s, 0", reg_names[rs], reg_names[rd]); break; - case 0x03: DASM("move -%s, *%s, 1", reg_names[rs], reg_names[rd]); break; - case 0x04: DASM("move -%s, -*%s, 0", reg_names[rs], reg_names[rd]); break; - case 0x05: DASM("move -%s, -*%s, 1", reg_names[rs], reg_names[rd]); break; - case 0x06: DASM("movb %s, *%s(%x), 1", reg_names[rs], reg_names[rd],READ_WORD(pc+16)); words++; break; - case 0x07: DASM("movb %s(%x), *%s, 1", reg_names[rs], READ_WORD(pc+16),reg_names[rd]); words++; break; - default: - DASM("[%04X] ??? [1010]", opcode); - break; - } - break; - - case 0x0B: - switch ((opcode >> 9) & 7) { - case 0x00: DASM("move %s, *%s(%x), 0", reg_names[rs], reg_names[rd],READ_WORD(pc+16)); words++; break; - case 0x01: DASM("move %s, *%s(%x), 1", reg_names[rs], reg_names[rd],READ_WORD(pc+16)); words++; break; - case 0x02: DASM("move *%s(%x), %s, 0", reg_names[rs], READ_WORD(pc+16), reg_names[rd]); words++; break; - case 0x03: DASM("move *%s(%x), %s, 1", reg_names[rs], READ_WORD(pc+16), reg_names[rd]); words++; break; - case 0x04: DASM("move *%s(%x), *%s(%x), 0", reg_names[rs], READ_WORD(pc+16),reg_names[rd],READ_WORD(pc+32)); words+=2; break; - case 0x05: DASM("move *%s(%x), *%s(%x), 1", reg_names[rs], READ_WORD(pc+16),reg_names[rd],READ_WORD(pc+32)); words+=2; break; - default: - DASM("[%04X] ??? [1011]", opcode); - break; - } - break; - - - case 0x0C: - if (opcode & 0xFF) { - if ((opcode & 0xFF) == 0x80) { // JA addr - DASM("ja%s @%x", jr_cond(opcode), READ_DWORD(pc + 16)); - words += 2; - break; - } - // JR shor addr - DASM("jr%s @%x", jr_cond(opcode), pc + 16 + ((int8_t)(opcode & 0xFF)) * 16); - } else { - // JR rel cond - DASM("jr%s @%x", jr_cond(opcode), pc + 32 + (short)READ_WORD(pc + 16) * 16); - words++; - } - break; - - - case 0x0E: - switch ((opcode >> 9) & 7) { - case 0x6: DASM("movx %s, %s", reg_names[rs], reg_names[rd]); break; - case 0x7: DASM("movy %s, %s", reg_names[rs], reg_names[rd]); break; - default: - DASM("[%04X] ??? [1110]", opcode); - break; - } - - break; - - default: - DASM("[%04X] ???", opcode); - break; - } - - if (szbits) - *szbits = words * 16; - - return std::string(buf); -} - -} - diff --git a/jan/src/cpu/tms34010/tms34010_defs.h b/jan/src/cpu/tms34010/tms34010_defs.h deleted file mode 100644 index 0bd21ae39..000000000 --- a/jan/src/cpu/tms34010/tms34010_defs.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef TMS34010_DEFS_H -#define TMS34010_DEFS_H - -#define R_BIT (opcode & 0x10) -#define RS (((opcode >> 5) & 0xF) | R_BIT) -#define RD ((opcode & 0xF) | R_BIT) -#define RS_n ((opcode >> 5) & 0xF) -#define RD_n (opcode & 0xF) -#define K ((opcode >> 5) & 0x1F) -#define KN ((~opcode >> 5) & 0x1F) - -#define R(i) cpu->r[(i)|R_BIT]->value - -#define OFFS ((opcode >> 5) & 0x1F) -#define BKW_DIR (opcode & (1 << 10)) - -#define _rs cpu->r[RS]->value -#define _rd cpu->r[RD]->value -#define _rd_0 cpu->r[RD+0]->value -#define _rd_1 cpu->r[RD+1]->value -#define _pc cpu->pc -#define _sp cpu->sp.value -#define _st cpu->st - -#define _rsx cpu->r[RS]->x -#define _rdx cpu->r[RD]->x -#define _rsy cpu->r[RS]->y -#define _rdy cpu->r[RD]->y - -#define ODD_RD (RD_n & 1) - -#define ZF (_st & ST_Z) -#define CF (_st & ST_C) -#define VF (_st & ST_V) -#define NF (_st & ST_N) - -#define FS0 (_st & ST_FS0_MASK) -#define FS1 ((_st & ST_FS1_MASK) >> ST_FS1_SHIFT) -#define FE0 ((_st & ST_FE0) ? 32 : 0) -#define FE1 ((_st & ST_FE1) ? 32 : 0) - -#define CONSUME_CYCLES(n) cpu->icounter -= (n) - -#define FW(i) ((_st >> (i ? 6 : 0)) & 0x1f) -#define FWEX(i) ((_st >> (i ? 6 : 0)) & 0x3f) - -#define FW0_ FW(0) -#define FW1_ FW(1) -#define RFW0 FWEX(0) -#define RFW1 FWEX(1) - -#define FW0 fw_lut[FW0_] -#define FW1 fw_lut[FW1_] - -#define wsign_ext(n) ((sdword)(sword)(n)) - -#define update_zn(val) \ - _st &= ~(ST_N | ST_Z); \ - if (!val) \ - _st |= ST_Z; \ - _st |= val & SIGN_BIT32; - -#define update_z(val) \ - _st &= ~ST_Z; \ - if (!val) \ - _st |= ST_Z; - -#define SADDR cpu->b[_SADDR].value -#define SPTCH cpu->b[_SPTCH].value -#define SADDR_R cpu->b[_SADDR] - -#define DADDR cpu->b[_DADDR].value -#define DADDR_X cpu->b[_DADDR].x -#define DADDR_Y cpu->b[_DADDR].y -#define DADDR_R cpu->b[_DADDR] - -#define DPTCH cpu->b[_DPTCH].value -#define OFFSET cpu->b[_OFFSET].value -#define WSTART cpu->b[_WSTART].value -#define WEND cpu->b[_WEND].value - -#define WSTART_X cpu->b[_WSTART].x -#define WSTART_Y cpu->b[_WSTART].y -#define WEND_X cpu->b[_WEND].x -#define WEND_Y cpu->b[_WEND].y - - -#define DYDX cpu->b[_DYDX].value -#define DYDX_X cpu->b[_DYDX].x -#define DYDX_Y cpu->b[_DYDX].y - -#define COLOR0 cpu->b[_COLOR0].value -#define COLOR1 cpu->b[_COLOR1].value -#define COUNT cpu->b[COUNT].value -#define INC1 cpu->b[INC1].value -#define INC2 cpu->b[INC2].value -#define PATTRN cpu->b[PATTRN].value -#define TEMP cpu->b[TEMP].value - -#define PPOP ((cpu->io_regs[CONTROL] >> 10) & 0x1F) - -#endif // TMS34010_DEFS_H diff --git a/jan/src/cpu/tms34010/tms34010_gfx.h b/jan/src/cpu/tms34010/tms34010_gfx.h deleted file mode 100644 index bd19b98d2..000000000 --- a/jan/src/cpu/tms34010/tms34010_gfx.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef TMS34010_GFX_H -#define TMS34010_GFX_H - -#include -#include "tms34010.h" -#include "tms34010_defs.h" -#include "tms34010_memacc.h" - -#ifdef TMS34010_DEBUGGER -#include -#define GFX_LOG(...) qDebug()<convdp) | (r.x << cpu->pshift)) + OFFSET) - -namespace tms { namespace ops { - - -void gfx_params_dump(cpu_state *cpu) -{ - for (int i = 0; i < 15; i++) { - GFX_LOG("%-10s: %08X [%d,%d]", gfx_reg_names[i], - cpu->b[i].value, cpu->b[i].x, cpu->b[i].y); - } -} - -void pixblt_b_xy(cpu_state *cpu, word opcode) -{ -#if DEBUG_GSP - GFX_LOG("=======> PIXBLT B, XY at %08x", cpu->last_pc); - gfx_params_dump(cpu); -#endif - int width = DYDX_X; - int height = DYDX_Y; - dword daddr = DXYTOL(DADDR_R); - - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - - int bit = rdfield_1(SADDR + x); - word col = bit ? COLOR1 : COLOR0; - wrfield_8(daddr + x * 8, col); - } - daddr += DPTCH; - SADDR += SPTCH; - } - CONSUME_CYCLES(width*height*3); -} - -void pixt_irs_rd(cpu_state *cpu, word opcode) -{ -#if DEBUG_GSP - GFX_LOG("=======> PIXT *RS, RD at %08X", cpu->last_pc); - gfx_params_dump(cpu); -#endif - if (cpu->io_regs[DPYCTL] & 0x0800) - { - cpu->shift_read_cycle(_rs, cpu->shiftreg); - - _rd = cpu->shiftreg[0] & 0xff; - if (_rd) - _st |= ST_V; - else - _st &= ~ST_V; - } - else - { - - _rd = rdfield_8(_rs) & 0xff; - if (_rd) - _st |= ST_V; - else - _st &= ~ST_V; - } - CONSUME_CYCLES(3); -} - -void fill_xy(cpu_state *cpu, word opcode) -{ -#if DEBUG_GSP - GFX_LOG("FILL XY [%d,%d,%d,%d] <- %04x from %08x -- PPOP %x %x", - DADDR_X, DADDR_Y, DYDX_X, DYDX_Y, COLOR1, OFFSET, PPOP, cpu->io_regs[PSIZE]); - gfx_params_dump(cpu); -#endif - int width = DYDX_X; - int height = DYDX_Y; - - dword daddr = DXYTOL(DADDR_R); - if (cpu->io_regs[DPYCTL] & 0x0800) - { - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { -// wrfield_8(daddr + x * 8, COLOR1); - cpu->shift_write_cycle(daddr + x * 8, cpu->shiftreg); - } - daddr += DPTCH; - } - } - else - { - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - wrfield_8(daddr + x * 8, COLOR1); - } - daddr += DPTCH; - } - } - DADDR_Y += DYDX_Y; - CONSUME_CYCLES(width*height*3); -} - -void fill_l(cpu_state *cpu, word opcode) -{ -#if DEBUG_GSP - GFX_LOG("FILL XY [%d,%d,%d,%d] <- %04x from %08x -- PPOP %x", - DADDR_X, DADDR_Y, DYDX_X, DYDX_Y, COLOR1, OFFSET, PPOP); - gfx_params_dump(cpu); -#endif - int width = DYDX_X; - int height = DYDX_Y; - - dword daddr = DADDR; - - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - wrfield_8(daddr + x * 8, COLOR1); - } - daddr += DPTCH; - } - DADDR = daddr; - CONSUME_CYCLES(width*height*3); -} - - -void pixt_rd_irdxy(cpu_state *cpu, word opcode) -{ -#if DEBUG_GSP - GFX_LOG("=======> PIXT RS, *RD.XY at %08x", cpu->last_pc); - gfx_params_dump(cpu); -#endif - dword daddr = DXYTOL((*cpu->r[RD])); - if (cpu->io_regs[DPYCTL] & 0x0800) - { - cpu->shift_write_cycle(daddr, cpu->shiftreg); - } - else - { - wrfield_8(daddr, _rs); - } - CONSUME_CYCLES(3); -} - - -void cvxyl_rs_rd(cpu_state *cpu, word opcode) -{ - _rd = DXYTOL((*cpu->r[RS])); - CONSUME_CYCLES(1); -} - -void drav_rs_rd(cpu_state *cpu, word opcode) -{ -#if DEBUG_GSP - GFX_LOG("=======> DRAV RS,RD at %08x", cpu->last_pc); - gfx_params_dump(cpu); -#endif - dword daddr = DXYTOL((*cpu->r[RD])); - if (cpu->io_regs[DPYCTL] & 0x0800) - { - cpu->shift_write_cycle(daddr, cpu->shiftreg); - } - else - { - wrfield_8(daddr, COLOR1); - } - _rdx += _rsx; - _rdy += _rsy; - CONSUME_CYCLES(3); -} - -} // ops -} // tms - -#endif // TMS34010_GFX_H diff --git a/jan/src/cpu/tms34010/tms34010_jump.h b/jan/src/cpu/tms34010/tms34010_jump.h deleted file mode 100644 index 24e165960..000000000 --- a/jan/src/cpu/tms34010/tms34010_jump.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef TMS34010_JUMP_H -#define TMS34010_JUMP_H - -#include "tms34010.h" -#include "tms34010_memacc.h" -#include "tms34010_defs.h" - - -namespace tms { namespace ops { - -void dsj(cpu_state *cpu, word opcode) -{ - if (--_rd) { - _pc += wsign_ext(mem_read(_pc)) * 16 + 16; - CONSUME_CYCLES(3); - } else { - _pc += 16; - CONSUME_CYCLES(2); - } -} - -void dsjeq(cpu_state *cpu, word opcode) -{ - if (ZF) { - if (--_rd) { - _pc += wsign_ext(mem_read(_pc)) * 16 + 16; - CONSUME_CYCLES(3); - } else { - _pc += 16; - CONSUME_CYCLES(2); - } - } else { - _pc += 16; - CONSUME_CYCLES(2); - } -} - -void dsjne(cpu_state *cpu, word opcode) -{ - if (!ZF) { - if (--_rd) { - _pc += wsign_ext(mem_read(_pc)) * 16 + 16; - CONSUME_CYCLES(3); - } else { - _pc += 16; - CONSUME_CYCLES(2); - } - } else { - _pc += 16; - CONSUME_CYCLES(2); - } -} - -void dsjs(cpu_state *cpu, word opcode) -{ - if (--_rd) { - _pc += (BKW_DIR ? -OFFS : OFFS) * 16; - CONSUME_CYCLES(3); - } else { - CONSUME_CYCLES(2); - } -} - -void call_rs(cpu_state *cpu, word opcode) -{ - _push(_pc); - _pc = _rd & 0xFFFFFFF0; - - CONSUME_CYCLES(3); -} - -void calla(cpu_state *cpu, word opcode) -{ - _push(_pc + 32); - _pc = mem_read_d(_pc); - - CONSUME_CYCLES(4); -} - -void callr(cpu_state *cpu, word opcode) -{ - _push(_pc + 16); - _pc += wsign_ext(mem_read(_pc)) * 16 + 16; - - CONSUME_CYCLES(3); -} - -void rets(cpu_state *cpu, word opcode) -{ - _pc = _pop() & 0xFFFFFFF0; - if (opcode & 0x1F) { - _sp += (opcode & 0x1F) * 16; - } - CONSUME_CYCLES(7); -} - -void jump_rs(cpu_state *cpu, word opcode) -{ - _pc = _rd; - CONSUME_CYCLES(2); -} - -#define JR(cc) \ - if (cc) { \ - _pc += ((sbyte)(opcode & 0xFF)) * 16; \ - CONSUME_CYCLES(2); \ - } else { \ - CONSUME_CYCLES(1); \ - } - -#define JR_0(cc) \ - if ((opcode & 0xFF) == 0) { \ - if (cc) { \ - _pc += wsign_ext(mem_read(_pc)) * 16 + 16; \ - CONSUME_CYCLES(3); \ - } else { \ - _pc += 16; \ - CONSUME_CYCLES(4); \ - } \ - } else JR(cc) - -#define JR_8(cc) \ - if ((opcode & 0xFF) == 0x80) { \ - if (cc) { \ - _pc = mem_read_d(_pc); \ - CONSUME_CYCLES(3); \ - } else { \ - _pc += 32; \ - CONSUME_CYCLES(4); \ - } \ - } else JR(cc) - - -void jr_uc(cpu_state *cpu, word opcode) { JR(true); } -void jr_uc_0(cpu_state *cpu, word opcode) { JR_0(true); } -void jr_uc_8(cpu_state *cpu, word opcode) { JR_8(true); } - -void jr_ne(cpu_state *cpu, word opcode) { JR(!ZF); } -void jr_ne_0(cpu_state *cpu, word opcode) { JR_0(!ZF); } -void jr_ne_8(cpu_state *cpu, word opcode) { JR_8(!ZF); } - -void jr_eq(cpu_state *cpu, word opcode) { JR(ZF); } -void jr_eq_0(cpu_state *cpu, word opcode) { JR_0(ZF); } -void jr_eq_8(cpu_state *cpu, word opcode) { JR_8(ZF); } - -void jr_nc(cpu_state *cpu, word opcode) { JR(!CF); } -void jr_nc_0(cpu_state *cpu, word opcode) { JR_0(!CF); } -void jr_nc_8(cpu_state *cpu, word opcode) { JR_8(!CF); } - -void jr_c(cpu_state *cpu, word opcode) { JR(CF); } -void jr_c_0(cpu_state *cpu, word opcode) { JR_0(CF); } -void jr_c_8(cpu_state *cpu, word opcode) { JR_8(CF); } - -void jr_v(cpu_state *cpu, word opcode) { JR(VF); } -void jr_v_0(cpu_state *cpu, word opcode) { JR_0(VF); } -void jr_v_8(cpu_state *cpu, word opcode) { JR_8(VF); } - -void jr_nv(cpu_state *cpu, word opcode) { JR(!VF); } -void jr_nv_0(cpu_state *cpu, word opcode) { JR_0(!VF); } -void jr_nv_8(cpu_state *cpu, word opcode) { JR_8(!VF); } - -void jr_n(cpu_state *cpu, word opcode) { JR(NF); } -void jr_n_0(cpu_state *cpu, word opcode) { JR_0(NF); } -void jr_n_8(cpu_state *cpu, word opcode) { JR_8(NF); } - -void jr_nn(cpu_state *cpu, word opcode) { JR(!NF); } -void jr_nn_0(cpu_state *cpu, word opcode) { JR_0(!NF); } -void jr_nn_8(cpu_state *cpu, word opcode) { JR_8(!NF); } - -void jr_hi(cpu_state *cpu, word opcode) { JR(!CF&&!ZF); } -void jr_hi_0(cpu_state *cpu, word opcode) { JR_0(!CF&&!ZF); } -void jr_hi_8(cpu_state *cpu, word opcode) { JR_8(!CF&&!ZF); } - -void jr_ls(cpu_state *cpu, word opcode) { JR(CF||ZF); } -void jr_ls_0(cpu_state *cpu, word opcode) { JR_0(CF||ZF); } -void jr_ls_8(cpu_state *cpu, word opcode) { JR_8(CF||ZF); } - - -#define GT_COND (NF&&VF&&!ZF)||(!NF&&!VF&&!ZF) -void jr_gt(cpu_state *cpu, word opcode) { JR(GT_COND); } -void jr_gt_0(cpu_state *cpu, word opcode) { JR_0(GT_COND); } -void jr_gt_8(cpu_state *cpu, word opcode) { JR_8(GT_COND); } - -#define GE_COND (NF&&VF)||(!NF&&!VF) -void jr_ge(cpu_state *cpu, word opcode) { JR(GE_COND); } -void jr_ge_0(cpu_state *cpu, word opcode) { JR_0(GE_COND); } -void jr_ge_8(cpu_state *cpu, word opcode) { JR_8(GE_COND); } - -#define LT_COND (NF&&!VF)||(!NF&&VF) -void jr_lt(cpu_state *cpu, word opcode) { JR(LT_COND); } -void jr_lt_0(cpu_state *cpu, word opcode) { JR_0(LT_COND); } -void jr_lt_8(cpu_state *cpu, word opcode) { JR_8(LT_COND); } - - -#define LE_COND (NF && !VF) || (!NF && VF) || ZF -void jr_le(cpu_state *cpu, word opcode) { JR(LE_COND); } -void jr_le_0(cpu_state *cpu, word opcode) { JR_0(LE_COND); } -void jr_le_8(cpu_state *cpu, word opcode) { JR_8(LE_COND); } - -#define P_COND (!NF && !ZF) -void jr_p(cpu_state *cpu, word opcode) { JR(P_COND); } -void jr_p_0(cpu_state *cpu, word opcode) { JR_0(P_COND); } -void jr_p_8(cpu_state *cpu, word opcode) { JR_8(P_COND); } - -} // ops -} // tms - -#endif // TMS34010_JUMP_H diff --git a/jan/src/cpu/tms34010/tms34010_memacc.h b/jan/src/cpu/tms34010/tms34010_memacc.h deleted file mode 100644 index c0793cf56..000000000 --- a/jan/src/cpu/tms34010/tms34010_memacc.h +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -// All access to memory are 16bit -#ifndef TMS34010_MEMACC_H -#define TMS34010_MEMACC_H - -#include "burnint.h" -#include "tms34010.h" -#include "tms34010_defs.h" -#include "../tms34010_intf.h" -// #include - -namespace tms -{ - - -#define mem_read(addr) TMS34010ReadWord(addr) -#define mem_write(addr,v) TMS34010WriteWord(addr,v) - - -static inline dword mem_read_d(dword addr) -{ - dword data = mem_read(addr); - return data | (mem_read(addr + 16) << 16); -} - -static inline void mem_write_d(dword addr, dword data) -{ - mem_write(addr, data); - mem_write(addr+16, data >> 16); -} - - -// Read fields - - -#define DEF_READ_FIELD(mask,boundary) \ - do { \ - const int shift = addr & 0xF; \ - const dword offset = addr & 0xFFFFFFF0; \ - if (shift >= boundary) { \ - return (mem_read_d(offset) >> shift) & mask; \ - } \ - return (mem_read(offset) >> shift) & mask; \ - } while (0); - -#define DEF_READ_FIELD_SX(mask,boundary,bits) \ - do { \ - const int shift = addr & 0xF; \ - const dword offset = addr & 0xFFFFFFF0; \ - dword data = 0; \ - if (shift >= boundary) { \ - data = (mem_read_d(offset) >> shift) & mask; \ - } else { \ - data = (mem_read(offset) >> shift) & mask; \ - } \ - return ((sdword)(data << bits)) >> bits; \ - } while (0); - - -#define DEF_READ_FIELD_D(mask,boundary) \ - do { \ - const dword shift = addr & 0xF; \ - const dword offset = addr & 0xFFFFFFF0; \ - dword data = (mem_read_d(offset) >> shift); \ - if (shift >= boundary) { \ - data |= (mem_read(offset + 32) << (32 - shift));\ - } \ - return data & mask; \ - } while (0); - -#define DEF_READ_FIELD_D_SX(mask,boundary,bits) \ - do { \ - const dword shift = addr & 0xF; \ - const dword offset = addr & 0xFFFFFFF0; \ - dword data = (mem_read_d(offset) >> shift); \ - if (shift >= boundary) { \ - data |= (mem_read(offset + 32) << (32 - shift));\ - } \ - return ((sdword)((data & mask) << bits)) >> bits; \ - } while (0); - - -static dword rdfield_1(dword addr) { DEF_READ_FIELD(0x00000001, 16); } -static dword rdfield_2(dword addr) { DEF_READ_FIELD(0x00000003, 15); } -static dword rdfield_3(dword addr) { DEF_READ_FIELD(0x00000007, 14); } -static dword rdfield_4(dword addr) { DEF_READ_FIELD(0x0000000F, 13); } -static dword rdfield_5(dword addr) { DEF_READ_FIELD(0x0000001F, 12); } -static dword rdfield_6(dword addr) { DEF_READ_FIELD(0x0000003F, 11); } -static dword rdfield_7(dword addr) { DEF_READ_FIELD(0x0000007F, 10); } -static dword rdfield_8(dword addr) { DEF_READ_FIELD(0x000000FF, 9); } -static dword rdfield_9(dword addr) { DEF_READ_FIELD(0x000001FF, 8); } -static dword rdfield_10(dword addr) { DEF_READ_FIELD(0x000003FF, 7); } -static dword rdfield_11(dword addr) { DEF_READ_FIELD(0x000007FF, 6); } -static dword rdfield_12(dword addr) { DEF_READ_FIELD(0x00000FFF, 5); } -static dword rdfield_13(dword addr) { DEF_READ_FIELD(0x00001FFF, 4); } -static dword rdfield_14(dword addr) { DEF_READ_FIELD(0x00003FFF, 3); } -static dword rdfield_15(dword addr) { DEF_READ_FIELD(0x00007FFF, 2); } -static dword rdfield_16(dword addr) { DEF_READ_FIELD(0x0000FFFF, 1); } -static dword rdfield_17(dword addr) { DEF_READ_FIELD(0x0001FFFF, 0); } -static dword rdfield_18(dword addr) { DEF_READ_FIELD_D(0x0003FFFF, 15); } -static dword rdfield_19(dword addr) { DEF_READ_FIELD_D(0x0007FFFF, 13); } -static dword rdfield_20(dword addr) { DEF_READ_FIELD_D(0x000FFFFF, 12); } -static dword rdfield_21(dword addr) { DEF_READ_FIELD_D(0x001FFFFF, 11); } -static dword rdfield_22(dword addr) { DEF_READ_FIELD_D(0x003FFFFF, 10); } -static dword rdfield_23(dword addr) { DEF_READ_FIELD_D(0x007FFFFF, 9); } -static dword rdfield_24(dword addr) { DEF_READ_FIELD_D(0x00FFFFFF, 8); } -static dword rdfield_25(dword addr) { DEF_READ_FIELD_D(0x01FFFFFF, 7); } -static dword rdfield_26(dword addr) { DEF_READ_FIELD_D(0x03FFFFFF, 6); } -static dword rdfield_27(dword addr) { DEF_READ_FIELD_D(0x07FFFFFF, 5); } -static dword rdfield_28(dword addr) { DEF_READ_FIELD_D(0x0FFFFFFF, 4); } -static dword rdfield_29(dword addr) { DEF_READ_FIELD_D(0x1FFFFFFF, 3); } -static dword rdfield_30(dword addr) { DEF_READ_FIELD_D(0x3FFFFFFF, 2); } -static dword rdfield_31(dword addr) { DEF_READ_FIELD_D(0x7FFFFFFF, 1); } - -static dword rdfield_32(dword addr) { - const dword shift = addr & 0xF; - const dword offset = addr & 0xFFFFFFF0; - if (shift) { - dword data = (mem_read_d(offset) >> shift); - data |= (mem_read_d(offset + 32) << (32 - shift)); - return data; - } else { - return mem_read_d(offset); - } -} - -static dword rdfield_1_sx(dword addr) { DEF_READ_FIELD_SX(0x00000001, 16, 31); } -static dword rdfield_2_sx(dword addr) { DEF_READ_FIELD_SX(0x00000003, 15, 30); } -static dword rdfield_3_sx(dword addr) { DEF_READ_FIELD_SX(0x00000007, 14, 29); } -static dword rdfield_4_sx(dword addr) { DEF_READ_FIELD_SX(0x0000000F, 13, 28); } -static dword rdfield_5_sx(dword addr) { DEF_READ_FIELD_SX(0x0000001F, 12, 27); } -static dword rdfield_6_sx(dword addr) { DEF_READ_FIELD_SX(0x0000003F, 11, 26); } -static dword rdfield_7_sx(dword addr) { DEF_READ_FIELD_SX(0x0000007F, 10, 25); } -static dword rdfield_8_sx(dword addr) { DEF_READ_FIELD_SX(0x000000FF, 9, 24); } -static dword rdfield_9_sx(dword addr) { DEF_READ_FIELD_SX(0x000001FF, 8, 23); } -static dword rdfield_10_sx(dword addr) { DEF_READ_FIELD_SX(0x000003FF, 7, 22); } -static dword rdfield_11_sx(dword addr) { DEF_READ_FIELD_SX(0x000007FF, 6, 21); } -static dword rdfield_12_sx(dword addr) { DEF_READ_FIELD_SX(0x00000FFF, 5, 20); } -static dword rdfield_13_sx(dword addr) { DEF_READ_FIELD_SX(0x00001FFF, 4, 19); } -static dword rdfield_14_sx(dword addr) { DEF_READ_FIELD_SX(0x00003FFF, 3, 18); } -static dword rdfield_15_sx(dword addr) { DEF_READ_FIELD_SX(0x00007FFF, 2, 17); } -static dword rdfield_16_sx(dword addr) { DEF_READ_FIELD_SX(0x0000FFFF, 1, 16); } -static dword rdfield_17_sx(dword addr) { DEF_READ_FIELD_SX(0x0001FFFF, 0, 15); } -static dword rdfield_18_sx(dword addr) { DEF_READ_FIELD_D_SX(0x0003FFFF, 15, 14); } -static dword rdfield_19_sx(dword addr) { DEF_READ_FIELD_D_SX(0x0007FFFF, 13, 13); } -static dword rdfield_20_sx(dword addr) { DEF_READ_FIELD_D_SX(0x000FFFFF, 12, 12); } -static dword rdfield_21_sx(dword addr) { DEF_READ_FIELD_D_SX(0x001FFFFF, 11, 11); } -static dword rdfield_22_sx(dword addr) { DEF_READ_FIELD_D_SX(0x003FFFFF, 10, 10); } -static dword rdfield_23_sx(dword addr) { DEF_READ_FIELD_D_SX(0x007FFFFF, 9, 9); } -static dword rdfield_24_sx(dword addr) { DEF_READ_FIELD_D_SX(0x00FFFFFF, 8, 8); } -static dword rdfield_25_sx(dword addr) { DEF_READ_FIELD_D_SX(0x01FFFFFF, 7, 7); } -static dword rdfield_26_sx(dword addr) { DEF_READ_FIELD_D_SX(0x03FFFFFF, 6, 6); } -static dword rdfield_27_sx(dword addr) { DEF_READ_FIELD_D_SX(0x07FFFFFF, 5, 5); } -static dword rdfield_28_sx(dword addr) { DEF_READ_FIELD_D_SX(0x0FFFFFFF, 4, 4); } -static dword rdfield_29_sx(dword addr) { DEF_READ_FIELD_D_SX(0x1FFFFFFF, 3, 3); } -static dword rdfield_30_sx(dword addr) { DEF_READ_FIELD_D_SX(0x3FFFFFFF, 2, 2); } -static dword rdfield_31_sx(dword addr) { DEF_READ_FIELD_D_SX(0x7FFFFFFF, 1, 1); } - - -#define DEF_WRITE_FIELD(mask,boundary) \ - do { \ - const int shift = addr & 0xF; \ - const dword offset = addr & 0xFFFFFFF0; \ - const dword wdata = data & mask; \ - dword mem = 0; \ - if (shift >= boundary) { \ - mem = mem_read_d(offset) & ~(mask << shift); \ - mem_write_d(offset, (wdata << shift) | mem); \ - } else { \ - mem = mem_read(offset) & ~((mask) << shift); \ - mem_write(offset, (wdata << shift) | mem); \ - } \ - } while (0); - -// From MAME -#define WFIELDMAC_32() \ - if (addr & 0x0f) \ - { \ - dword shift = addr&0x0f; \ - dword old; \ - dword hiword; \ - dword offset = addr & 0xfffffff0; \ - old = ((dword) mem_read_d(offset)&(0xffffffff>>(0x20-shift))); \ - hiword = ((dword) mem_read_d(offset+0x20)&(0xffffffff<>(0x20-shift))|hiword); \ - } \ - else \ - mem_write_d(addr,data); - - -#define DEF_WRITE_FIELD_D(mask,boundary) \ - do { \ - const dword shift = addr & 0xF; \ - const dword offset = addr & 0xFFFFFFF0; \ - const dword wdata = data & mask; \ - dword mem = 0; \ - mem = mem_read_d(offset) & ~(mask << shift); \ - mem_write_d(offset, (wdata << shift) | mem); \ - if (shift >= boundary) { \ - mem = mem_read(offset + 32) & ~(mask >> (32-shift));\ - mem_write(offset + 32, (wdata >> (32-shift)) | mem);\ - } \ - } while (0); - -static void wrfield_1(dword addr, dword data) { DEF_WRITE_FIELD(0x00000001, 16); } -static void wrfield_2(dword addr, dword data) { DEF_WRITE_FIELD(0x00000003, 15); } -static void wrfield_3(dword addr, dword data) { DEF_WRITE_FIELD(0x00000007, 14); } -static void wrfield_4(dword addr, dword data) { DEF_WRITE_FIELD(0x0000000F, 13); } -static void wrfield_5(dword addr, dword data) { DEF_WRITE_FIELD(0x0000001F, 12); } -static void wrfield_6(dword addr, dword data) { DEF_WRITE_FIELD(0x0000003F, 11); } -static void wrfield_7(dword addr, dword data) { DEF_WRITE_FIELD(0x0000007F, 10); } -static void wrfield_8(dword addr, dword data) { DEF_WRITE_FIELD(0x000000FF, 9); } -static void wrfield_9(dword addr, dword data) { DEF_WRITE_FIELD(0x000001FF, 8); } -static void wrfield_10(dword addr, dword data) { DEF_WRITE_FIELD(0x000003FF, 7); } -static void wrfield_11(dword addr, dword data) { DEF_WRITE_FIELD(0x000007FF, 6); } -static void wrfield_12(dword addr, dword data) { DEF_WRITE_FIELD(0x00000FFF, 5); } -static void wrfield_13(dword addr, dword data) { DEF_WRITE_FIELD(0x00001FFF, 4); } -static void wrfield_14(dword addr, dword data) { DEF_WRITE_FIELD(0x00003FFF, 3); } -static void wrfield_15(dword addr, dword data) { DEF_WRITE_FIELD(0x00007FFF, 2); } -static void wrfield_16(dword addr, dword data) { DEF_WRITE_FIELD(0x0000FFFF, 1); } -static void wrfield_17(dword addr, dword data) { DEF_WRITE_FIELD(0x0001FFFF, 0); } -static void wrfield_18(dword addr, dword data) { DEF_WRITE_FIELD_D(0x0003FFFF, 15); } -static void wrfield_19(dword addr, dword data) { DEF_WRITE_FIELD_D(0x0007FFFF, 13); } -static void wrfield_20(dword addr, dword data) { DEF_WRITE_FIELD_D(0x000FFFFF, 12); } -static void wrfield_21(dword addr, dword data) { DEF_WRITE_FIELD_D(0x001FFFFF, 11); } -static void wrfield_22(dword addr, dword data) { DEF_WRITE_FIELD_D(0x003FFFFF, 10); } -static void wrfield_23(dword addr, dword data) { DEF_WRITE_FIELD_D(0x007FFFFF, 9); } -static void wrfield_24(dword addr, dword data) { DEF_WRITE_FIELD_D(0x00FFFFFF, 8); } -static void wrfield_25(dword addr, dword data) { DEF_WRITE_FIELD_D(0x01FFFFFF, 7); } -static void wrfield_26(dword addr, dword data) { DEF_WRITE_FIELD_D(0x03FFFFFF, 6); } -static void wrfield_27(dword addr, dword data) { DEF_WRITE_FIELD_D(0x07FFFFFF, 5); } -static void wrfield_28(dword addr, dword data) { DEF_WRITE_FIELD_D(0x0FFFFFFF, 4); } -static void wrfield_29(dword addr, dword data) { DEF_WRITE_FIELD_D(0x1FFFFFFF, 3); } -static void wrfield_30(dword addr, dword data) { DEF_WRITE_FIELD_D(0x3FFFFFFF, 2); } -static void wrfield_31(dword addr, dword data) { DEF_WRITE_FIELD_D(0x7FFFFFFF, 1); } -//static void wrfield_32(dword addr, dword data) { DEF_WRITE_FIELD_D(0xFFFFFFFF, 0); } -static void wrfield_32(dword addr, dword data) { WFIELDMAC_32(); } - -#define wrfield0(a,v) wrfield_table[FW0_](a,v) -#define wrfield1(a,v) wrfield_table[FW1_](a,v) -#define rdfield0(a) rdfield_table[RFW0](a) -#define rdfield1(a) rdfield_table[RFW1](a) - -static inline void __push(cpu_state *cpu, dword value) { - _sp -= 32; - mem_write_d(_sp, value); -} - -static inline dword __pop(cpu_state *cpu) { - dword value = mem_read_d(_sp); - _sp += 32; - return value; -} - -#define _push(v) __push(cpu, v) -#define _pop(v) __pop(cpu) - -} // tms - -#endif // TMS34010_MEMACC_H diff --git a/jan/src/cpu/tms34010/tms34010_mov.h b/jan/src/cpu/tms34010/tms34010_mov.h deleted file mode 100644 index c2ad5938d..000000000 --- a/jan/src/cpu/tms34010/tms34010_mov.h +++ /dev/null @@ -1,534 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef TMS34010_MOV_H -#define TMS34010_MOV_H - -#include "tms34010.h" -#include "tms34010_memacc.h" -#include "tms34010_defs.h" - -namespace tms { namespace ops { - -// MOVB RS, *RD -void movb_rs_ird(cpu_state *cpu, word opcode) -{ - wrfield_8(_rd, (dword)(byte)_rs); - - CONSUME_CYCLES(1); -} - -// MOVB *RS, RD -void movb_irs_rd(cpu_state *cpu, word opcode) -{ - _rd = rdfield_8_sx(_rs); - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - -// MOVB *RS, *RD -void movb_irs_ird(cpu_state *cpu, word opcode) -{ - wrfield_8(_rd, (dword)(byte)rdfield_8(_rs)); - - CONSUME_CYCLES(3); -} - -// MOVB RS, *RD(OFFS) -void movb_rs_irdo(cpu_state *cpu, word opcode) -{ - wrfield_8(_rd + wsign_ext(mem_read(_pc)), (dword)(byte)_rs); - _pc += 16; - - CONSUME_CYCLES(3); -} - -// MOVB *RS(OFFS), RD -void movb_irso_rd(cpu_state *cpu, word opcode) -{ - _rd = rdfield_8_sx(_rs + wsign_ext(mem_read(_pc))); - _pc += 16; - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(5); -} - -// MOVB *RS(OFFS), *RD(OFFS) -void movb_irso_irdo(cpu_state *cpu, word opcode) -{ - dword data = rdfield_8(_rs + wsign_ext(mem_read(_pc))); - wrfield_8(_rd + wsign_ext(mem_read(_pc + 16)), data); - _pc += 32; - - CONSUME_CYCLES(5); -} - -// MOVB RS, @DADDR -void movb_rs_daddr(cpu_state *cpu, word opcode) -{ - dword daddr = mem_read_d(_pc); - _pc += 32; - wrfield_8(daddr, (dword)(byte)_rd); - - CONSUME_CYCLES(1); -} - -// MOVB @SADDR, RD -void movb_addr_rd(cpu_state *cpu, word opcode) -{ - _rd = rdfield_8_sx(mem_read_d(_pc)); - _pc += 32; - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(5); -} - -// MOVB @SADDR, @DADDR -void movb_saddr_daddr(cpu_state *cpu, word opcode) -{ - dword src = mem_read_d(_pc); - _pc += 32; - dword dst = mem_read_d(_pc); - _pc += 32; - wrfield_8(dst, (dword)(byte)rdfield_8(src)); - - CONSUME_CYCLES(7); -} - -// MOVE RS, RD -void move_rs_rd(cpu_state *cpu, word opcode) -{ - _rd = _rs; - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(1); -} - -// MOVE RS, RD [A->B] -void move_rs_rd_a(cpu_state *cpu, word opcode) -{ - cpu->b[RD_n].value = cpu->a[RS_n].value; - _st &= ~ST_V; - update_zn(cpu->b[RD_n].value); - - CONSUME_CYCLES(1); -} - -// MOVE RS, RD [B->A] -void move_rs_rd_b(cpu_state *cpu, word opcode) -{ - cpu->a[RD_n].value = cpu->b[RS_n].value; - _st &= ~ST_V; - update_zn(cpu->a[RD_n].value); - - CONSUME_CYCLES(1); -} - -// MOVE RS, *RD, 0 -void move_rs_ird_0(cpu_state *cpu, word opcode) -{ - wrfield0(_rd, _rs); - - CONSUME_CYCLES(1); -} - -// MOVE RS, *RD, 1 -void move_rs_ird_1(cpu_state *cpu, word opcode) -{ - wrfield1(_rd, _rs); - - CONSUME_CYCLES(1); -} - -// MOVE RS, -*RD, 0 -void move_rs_mird_0(cpu_state *cpu, word opcode) -{ - _rd -= FW0; - wrfield0(_rd, _rs); - - CONSUME_CYCLES(2); -} - -// MOVE RS, -*RD, 1 -void move_rs_mird_1(cpu_state *cpu, word opcode) -{ - _rd -= FW1; - wrfield1(_rd, _rs); - - CONSUME_CYCLES(2); -} - -// MOVE RS, *RD+, 0 -void move_rs_irdp_0(cpu_state *cpu, word opcode) -{ - wrfield0(_rd, _rs); - _rd += FW0; - - CONSUME_CYCLES(1); -} - -// MOVE RS, *RD+, 1 -void move_rs_irdp_1(cpu_state *cpu, word opcode) -{ - wrfield1(_rd, _rs); - _rd += FW1; - - CONSUME_CYCLES(1); -} - -// MOVE *RS, RD, 0 -void move_irs_rd_0(cpu_state *cpu, word opcode) -{ - _rd = rdfield0(_rs); - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - -// MOVE *RS, RD, 1 -void move_irs_rd_1(cpu_state *cpu, word opcode) -{ - _rd = rdfield1(_rs); - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - - -// MOVE -*RS, RD, 0 -void move_mirs_rd_0(cpu_state *cpu, word opcode) -{ - _rs -= FW0; - _rd = rdfield0(_rs); - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(4); -} - -// MOVE -*RS, RD, 1 -void move_mirs_rd_1(cpu_state *cpu, word opcode) -{ - _rs -= FW1; - _rd = rdfield1(_rs); - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(4); -} - -// MOVE *RS+, RD, 0 -void move_irsp_rd_0(cpu_state *cpu, word opcode) -{ - dword data = rdfield0(_rs); - _rs += FW0; - _rd = data; - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - - -// MOVE *RS+, RD, 1 -void move_irsp_rd_1(cpu_state *cpu, word opcode) -{ - dword data = rdfield1(_rs); - _rs += FW1; - _rd = data; - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - -// MOVE *RS, *RD, 0 -void move_irs_ird_0(cpu_state *cpu, word opcode) -{ - wrfield0(_rd, rdfield0(_rs)); - - CONSUME_CYCLES(3); -} - -// MOVE *RS, *RD, 1 -void move_irs_ird_1(cpu_state *cpu, word opcode) -{ - wrfield1(_rd, rdfield1(_rs)); - - CONSUME_CYCLES(3); -} - -// MOVE -*RS, -*RD, 0 -void move_mirs_mird_0(cpu_state *cpu, word opcode) -{ - _rs -= FW0; - sdword data = rdfield0(_rs); - _rd -= FW0; - wrfield0(_rd, data); - - CONSUME_CYCLES(4); -} - - -// MOVE -*RS, -*RD, 1 -void move_mirs_mird_1(cpu_state *cpu, word opcode) -{ - _rs -= FW1; - sdword data = rdfield1(_rs); - _rd -= FW1; - wrfield1(_rd, data); - - CONSUME_CYCLES(4); -} - -// MOVE *RS+, *RD+, 0 -void move_irsp_irdp_0(cpu_state *cpu, word opcode) -{ - dword value = rdfield0(_rs); - _rs += FW0; - wrfield0(_rd, value); - _rd += FW0; - - CONSUME_CYCLES(4); -} - -// MOVE *RS+, *RD+, 1 -void move_irsp_irdp_1(cpu_state *cpu, word opcode) -{ - dword value = rdfield1(_rs); - _rs += FW1; - wrfield1(_rd, value); - _rd += FW1; - - CONSUME_CYCLES(4); -} - -// MOVE RS, *RD(OFFS), 0 -void move_rs_irdo_0(cpu_state *cpu, word opcode) -{ - wrfield0(_rd + wsign_ext(mem_read(_pc)), _rs); - _pc += 16; - - CONSUME_CYCLES(3); -} - -// MOVE RS, *RD(OFFS), 1 -void move_rs_irdo_1(cpu_state *cpu, word opcode) -{ - wrfield1(_rd + wsign_ext(mem_read(_pc)), _rs); - _pc += 16; - - CONSUME_CYCLES(3); -} - -// MOVE *RS(OFFS), RD, 0 -void move_irso_rd_0(cpu_state *cpu, word opcode) -{ - _rd = rdfield0(_rs + wsign_ext(mem_read(_pc))); - _pc += 16; - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(5); -} - -// MOVE *RS(OFFS), RD, 1 -void move_irso_rd_1(cpu_state *cpu, word opcode) -{ - _rd = rdfield1(_rs + wsign_ext(mem_read(_pc))); - _pc += 16; - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(5); -} - -// MOVE *RS(OFFS), *RD+, 0 -void move_irso_irdp_0(cpu_state *cpu, word opcode) -{ - dword data = rdfield0(_rs + wsign_ext(mem_read(_pc))); - _pc += 16; - wrfield0(_rd, data); - _rd += FW0; - - CONSUME_CYCLES(5); -} - -// MOVE *RS(OFFS), *RD+, 1 -void move_irso_irdp_1(cpu_state *cpu, word opcode) -{ - dword data = rdfield1(_rs + wsign_ext(mem_read(_pc))); - _pc += 16; - wrfield1(_rd, data); - _rd += FW1; - - CONSUME_CYCLES(5); -} - -// MOVE *RS(OFFS), *RD(OFFS), 0 -void move_irso_irdo_0(cpu_state *cpu, word opcode) -{ - dword data = rdfield0(_rs + wsign_ext(mem_read(_pc))); - wrfield0(_rd + wsign_ext(mem_read(_pc + 16)), data); - _pc += 32; - - CONSUME_CYCLES(5); -} - -// MOVE *RS(OFFS), *RD(OFFS), 1 -void move_irso_irdo_1(cpu_state *cpu, word opcode) -{ - dword data = rdfield1(_rs + wsign_ext(mem_read(_pc))); - wrfield1(_rd + wsign_ext(mem_read(_pc + 16)), data); - _pc += 32; - - CONSUME_CYCLES(5); -} - -// MOVE RS, @DADDR, 0 -void move_rs_daddr_0(cpu_state *cpu, word opcode) -{ - dword addr = mem_read_d(_pc); - _pc += 32; - wrfield0(addr, _rd); - - CONSUME_CYCLES(3); -} - -// MOVE RS, @DADDR, 1 -void move_rs_daddr_1(cpu_state *cpu, word opcode) -{ - dword addr = mem_read_d(_pc); - _pc += 32; - wrfield1(addr, _rd); - - CONSUME_CYCLES(3); -} - -// MOVE @SADDR, RD, 0 -void move_saddr_rd_0(cpu_state *cpu, word opcode) -{ - dword addr = mem_read_d(_pc); - _pc += 32; - _rd = rdfield0(addr); - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(5); -} - -// MOVE @SADDR, RD, 0 -void move_saddr_rd_1(cpu_state *cpu, word opcode) -{ - dword addr = mem_read_d(_pc); - _pc += 32; - _rd = rdfield1(addr); - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(5); -} - -// MOVE @SADDR, *RS+, 0 -void move_addr_irsp_0(cpu_state *cpu, word opcode) -{ - dword addr = mem_read_d(_pc); - _pc += 32; - wrfield0(addr, _rd); - _rd += FW0; - - CONSUME_CYCLES(5); -} - -// MOVE @SADDR, *RS+, 0 -void move_addr_irsp_1(cpu_state *cpu, word opcode) -{ - dword addr = mem_read_d(_pc); - _pc += 32; - wrfield1(addr, _rd); - _rd += FW1; - - CONSUME_CYCLES(5); -} - -// MOVE @SADDR, @DADDR, 0 -void move_saddr_daddr_0(cpu_state *cpu, word opcode) -{ - dword src = mem_read_d(_pc); - _pc += 32; - dword dst = mem_read_d(_pc); - _pc += 32; - wrfield0(dst, rdfield0(src)); - - CONSUME_CYCLES(7); -} - -// MOVE @SADDR, @DADDR, 0 -void move_saddr_daddr_1(cpu_state *cpu, word opcode) -{ - dword src = mem_read_d(_pc); - _pc += 32; - dword dst = mem_read_d(_pc); - _pc += 32; - wrfield1(dst, rdfield1(src)); - - CONSUME_CYCLES(7); -} - -// MOVEI IW, RD -void movi_iw_rd(cpu_state *cpu, word opcode) -{ - _rd = wsign_ext(mem_read(_pc)); - _pc += 16; - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(2); -} - - -// MOVEI IL, RD -void movi_il_rd(cpu_state *cpu, word opcode) -{ - _rd = mem_read_d(_pc); - _pc += 32; - _st &= ~ST_V; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - -// MOVX RS, RD -void movx_rs_rd(cpu_state *cpu, word opcode) -{ - _rdx = _rsx; - CONSUME_CYCLES(1); -} - -// MOVY RS, RD -void movy_rs_rd(cpu_state *cpu, word opcode) -{ - _rdy = _rsy; - CONSUME_CYCLES(1); -} - -// MOVK K, RD -void movk_k_rd(cpu_state *cpu, word opcode) -{ - _rd = fw_lut[K]; - CONSUME_CYCLES(1); -} - - -} // ops -} // tms - -#endif // TMS34010_MOV_H diff --git a/jan/src/cpu/tms34010/tms34010_newdasm.cpp b/jan/src/cpu/tms34010/tms34010_newdasm.cpp deleted file mode 100644 index 80fc89501..000000000 --- a/jan/src/cpu/tms34010/tms34010_newdasm.cpp +++ /dev/null @@ -1,533 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#include -#include -#include "tms34010.h" -#include "memhandler.h" - -namespace tms -{ - -#define READ_WORD(addr) tms::read_word(addr) -#define READ_DWORD(addr) (READ_WORD(addr) | (READ_WORD(addr + 16) << 16)) - -const int dasm_buf_size = 128; -const int dasm_pc_size = 32; - -static const char *reg_names[32] = -{ - "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", - "a8", "a9", "a10", "a11", "a12", "a13", "a14", "sp", - "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", - "b8", "b9", "b10", "b11", "b12", "b13", "b14", "sp", -}; - -#define BKW_DIR (st.opcode & (1 << 10)) -#define OFFS ((st.opcode >> 5) & 0x1F) -#define K fw_lut[((st.opcode >> 5) & 0x1F)] -#define FS fw_lut[st.opcode & 0x1F] -#define KN ((~st.opcode >> 5) & 0x1F) -#define K2C ((-K) & 0x1F) -#define M_BIT (st.opcode & (1 << 9)) -#define R_BIT (st.opcode & 0x10) -#define RS_ (((st.opcode >> 5) & 0xF) | R_BIT) -#define RD_ ((st.opcode & 0xF) | R_BIT) -#define NF (st.opcode & 0x1F) -#define RS_n ((st.opcode >> 5) & 0xF) -#define RD_n (st.opcode & 0xF) - -#define RS reg_names[RS_] -#define RD reg_names[RD_] -#define IW st.iw -#define IW2 st.iw2 -#define IL st.il -#define IL2 st.il2 -#define W st.words -#define OP st.opcode - -#define WDISP (st.pc + ((short)(IW)) * 16) + 32 -#define BDISP (st.pc + ((char)(OP & 0xFF) * 16)) + 16 - -#define DASM(...) snprintf(st.buf, dasm_buf_size, __VA_ARGS__) - -struct dasm_state { - dword pc; - word opcode; - char buf[dasm_buf_size]; - int words; - word iw; - word iw2; - dword il; - dword il2; - dasm_state() { - buf[0] = '\0'; - } -}; - - -static std::string reg_list(word opcode, word data) -{ - int inc = (opcode & 0x10) ? 16 : 0; - std::vector regs; - regs.reserve(16); - - - for (int i = 0; i < 16; i++) { - if (data & 0x8000) - regs.push_back(reg_names[inc + i]); - data <<= 1; - } - - - std::string s; - s.reserve(100); - for (size_t i = 0; i < regs.size(); i++) { - s.append(regs[i]); - if (i != regs.size() - 1) - s.append(","); - } - - return s; -} - -static std::string reg_list_inv(word opcode, word data) -{ - int inc = (opcode & 0x10) ? 16 : 0; - std::vector regs; - regs.reserve(16); - - - for (int i = 0; i < 16; i++) { - if (data & 1) - regs.push_back(reg_names[inc + i]); - data >>= 1; - } - - - std::string s; - s.reserve(100); - for (int i = 0; i < regs.size(); i++) { - s.append(regs[i]); - if (i != regs.size() - 1) - s.append(","); - } - - return s; -} - -static void dasm_prefix_0000(dasm_state &st) -{ - switch ((OP >> 8) & 0xF) { - case 0x0: - if (((OP >> 5) & 7) == 1) - DASM("rev %s", RD); - else - DASM("invalid opcode [%04Xh] 0000", OP); - break; - - case 0x1: - switch ((OP >> 5) & 7) { - case 0: DASM("emu"); break; - case 1: DASM("exgpc %s", RD); break; - case 2: DASM("getpc %s", RD); break; - case 3: DASM("jump %s", RD); break; - case 4: DASM("getst %s", RD); break; - case 5: DASM("putst %s", RD); break; - case 6: DASM("popst"); break; - case 7: DASM("pushst"); break; - } - break; - - case 0x2: - DASM("invalid opcode [%04Xh] 0000 010X", OP); - break; - - case 0x3: - switch ((OP >> 5) & 7) { - case 0: DASM("nop"); break; - case 1: DASM("clrc"); break; - case 2: DASM("movb @%08Xh, @%08x", IL, IL2); W+=4; break; - case 3: DASM("dint"); break; - case 4: DASM("abs %s", RD); break; - case 5: DASM("neg %s", RD); break; - case 6: DASM("negb %s", RD); break; - case 7: DASM("not %s", RD); break; - } - break; - - case 0x4: - DASM("invalid opcode [%04Xh] 0000 0100", OP); - break; - - case 0x5: - switch ((OP >> 5) & 7) { - case 0: DASM("sext %s, 0", RD); break; - case 1: DASM("zext %s, 0", RD); break; - case 2: DASM("setf %d, 0, 0", FS); break; - case 3: DASM("setf %d, 1, 0", FS); break; - case 4: DASM("move %s, @%08Xh, 0", RD, IL); W+=2; break; - case 5: DASM("move @%08Xh, %s, 0", IL, RD); W+=2; break; - case 6: DASM("move @%08Xh, @%08Xh, 0", IL, IL2); W+=4;break; - case 7: DASM("movb %s, @%08Xh", RD, IL); W+=2; break; - } - break; - - case 0x6: - DASM("invalid opcode [%04Xh]", OP); - break; - - case 0x7: - switch ((OP >> 5) & 7) { - case 0: DASM("sext %s, 1", RD); break; - case 1: DASM("zext %s, 1", RD); break; - case 2: DASM("setf %d, 0, 1", FS); break; - case 3: DASM("setf %d, 1, 1", FS); break; - case 4: DASM("move %s, @%08Xh, 1", RD, IL); W+=2; break; - case 5: DASM("move @%08Xh, %s, 1", IL, RD); W+=2; break; - case 6: DASM("move @%08Xh, @%08Xh, 1", IL, IL2); W+=4;break; - case 7: DASM("movb @%08Xh, %s", IL, RD); W+=2; break; - } - break; - - case 0x8: - DASM("invalid opcode [%04Xh]", OP); - break; - - case 0x9: - switch ((OP >> 5) & 7) { - case 0: DASM("trap %Xh", OP & 0x1F); break; - case 1: DASM("call %s", RD); break; - case 2: DASM("reti"); break; - case 3: DASM("rets 0x%d", OP & 0x1F); break; - case 4: DASM("mmtm %s, %s", RD, reg_list(OP,IW).c_str()); W++; break; - case 5: DASM("mmfm %s, %s", RD, reg_list_inv(OP,IW).c_str()); W++; break; - case 6: DASM("movi %04Xh, %s", IW, RD); W++; break; - case 7: DASM("movi %08Xh, %s", IL, RD); W+=2; break; - } - break; - - case 0xA: - DASM("invalid opcode [%04Xh]", OP); - break; - - case 0xB: - switch ((OP >> 5) & 7) { - case 0: DASM("addi %04Xh, %s", IW, RD); W++; break; - case 1: DASM("addi %08Xh, %s", IL, RD); W+=2; break; - case 2: DASM("cmpi %04Xh, %s", ~IW, RD); W++; break; - case 3: DASM("cmpi %08Xh, %s", ~IL, RD); W+=2; break; - case 4: DASM("andi %08Xh, %s", ~IL, RD); W+=2; break; - case 5: DASM("ori %08Xh, %s", IL, RD); W+=2; break; - case 6: DASM("xori %08Xh, %s", IL, RD); W+=2; break; - case 7: DASM("subi %08Xh, %s", ~IL, RD); W+=2; break; - } - break; - - case 0xC: - DASM("invalid opcode [%04Xh]", OP); - break; - - case 0xD: - switch ((OP >> 4) & 15) { - case 0x3: DASM("callr %08Xh", WDISP); W++; break; - case 0x5: DASM("calla %08Xh", IL); W+=2; break; - case 0x6: DASM("eint"); break; - case 0x8: - case 0x9: DASM("dsj %s, %08x", RD, WDISP); W++; break; - case 0xA: - case 0xB: DASM("dsjeq %s, %08x", RD, WDISP); W++; break; - case 0xC: - case 0xD: DASM("dsjne %s, %08x", RD, WDISP); W++; break; - case 0xE: DASM("setc"); break; - default: - DASM("invalid opcode [%04Xh] 0000 1101", OP); - break; - } - break; - case 0xE: - DASM("invalid opcode [%04Xh]", OP); - break; - - case 0xF: - switch ((OP >> 4) & 0xF) { - case 0x0: DASM("pixblt l, l"); break; - case 0x2: DASM("pixblt l, xy"); break; - case 0x4: DASM("pixblt xy, l"); break; - case 0x6: DASM("pixblt xy, xy"); break; - case 0x8: DASM("pixblt b, l"); break; - case 0xA: DASM("pixblt b, xy"); break; - case 0xC: DASM("fill l"); break; - case 0xE: DASM("fill xy"); break; - default: - DASM("invalid opcode [%04Xh] 0000 1111", OP); - break; - } - break; - } -} - -static void dasm_prefix_0001(dasm_state &st) -{ - switch ((OP >> 10) & 3) { - case 0: if (K==1) DASM("inc %s", RD); else DASM("addk %d, %s", K, RD); break; - case 1: if (K==1) DASM("dec %s", RD); else DASM("subk %d, %s", K, RD); break; - case 2: DASM("movk %d, %s", K, RD); break; - case 3: DASM("btst %d, %s", K, RD); break; - } -} - -static void dasm_prefix_0010(dasm_state &st) -{ - switch ((OP >> 10) & 3) { - case 0: DASM("sla %d, %s", K, RD); break; - case 1: DASM("sll %d, %s", K, RD); break; - case 2: DASM("sra %d, %s", K, RD); break; - case 3: DASM("srl %d, %s", K, RD); break; - } -} - -static void dasm_prefix_0011(dasm_state &st) -{ - switch ((OP >> 10) & 3) { - case 0: DASM("rl %d, %s", K, RD); break; - case 1: DASM("invalid opcode [%04Xh] 0011", OP); break; - case 2: - case 3: { - int displace = OFFS * 16; - if (BKW_DIR) - displace = -displace; - DASM("dsjs %s, %08Xh", RD, st.pc + 16 + displace); - break; - } - } -} - -static void dasm_prefix_0100(dasm_state &st) -{ - switch ((OP >> 9) & 7) { - case 0: DASM("add %s, %s", RS, RD); break; - case 1: DASM("addc %s, %s", RS, RD); break; - case 2: DASM("sub %s, %s", RS, RD); break; - case 3: DASM("subb %s, %s", RS, RD); break; - case 4: DASM("cmp %s, %s", RS, RD); break; - case 5: DASM("btst %s, %s", RS, RD); break; - case 6: DASM("move %s, %s", RS, RD); break; - case 7: { - DASM("move %s, %s", RS, R_BIT ? reg_names[RD_n] : reg_names[RD_n | 0x10]); - break; - } - } -} - -static void dasm_prefix_0101(dasm_state &st) -{ - switch ((OP >> 9) & 7) { - case 0: DASM("and %s, %s", RS, RD); break; - case 1: DASM("andn %s, %s", RS, RD); break; - case 2: DASM("or %s, %s", RS, RD); break; - case 3: if (RS_==RD_) DASM("clr %s", RD); else DASM("xor %s, %s", RS, RD); break; - case 4: DASM("divs %s, %s", RS, RD); break; - case 5: DASM("divu %s, %s", RS, RD); break; - case 6: DASM("mpys %s, %s", RS, RD); break; - case 7: DASM("mpyu %s, %s", RS, RD); break; - } -} - -static void dasm_prefix_0110(dasm_state &st) -{ - switch ((OP >> 9) & 7) { - case 0: DASM("sla %s, %s", RS, RD); break; - case 1: DASM("sll %s, %s", RS, RD); break; - case 2: DASM("sra %s, %s", RS, RD); break; - case 3: DASM("srl %s, %s", RS, RD); break; - case 4: DASM("rl %s, %s", RS, RD); break; - case 5: DASM("lmo %s, %s", RS, RD); break; - case 6: DASM("mods %s, %s", RS, RD); break; - case 7: DASM("modu %s, %s", RS, RD); break; - } -} - -static void dasm_prefix_0111(dasm_state &st) -{ - DASM("invalid opcode [%04Xh] 0111", OP); -} - -static void dasm_prefix_1000(dasm_state &st) -{ - switch ((OP >> 9) & 7) { - case 0: DASM("move %s, *%s, 0", RS, RD); break; - case 1: DASM("move %s, *%s, 1", RS, RD); break; - case 2: DASM("move *%s, %s, 0", RS, RD); break; - case 3: DASM("move *%s, %s, 1", RS, RD); break; - case 4: DASM("move *%s, *%s, 0", RS, RD); break; - case 5: DASM("move *%s, *%s, 1", RS, RD); break; - case 6: DASM("move %s, *%s", RS, RD); break; - case 7: DASM("move *%s, %s", RS, RD); break; - } -} - -static void dasm_prefix_1001(dasm_state &st) -{ - switch ((OP >> 9) & 7) { - case 0: DASM("move %s, *%s+, 0", RS, RD); break; - case 1: DASM("move %s, *%s+, 1", RS, RD); break; - case 2: DASM("move *%s+, %s, 0", RS, RD); break; - case 3: DASM("move *%s+, %s, 1", RS, RD); break; - case 4: DASM("move *%s+, *%s+, 0", RS, RD); break; - case 5: DASM("move *%s+, *%s+, 1", RS, RD); break; - case 6: DASM("movb *%s, *%s", RS, RD); break; - case 7: DASM("invalid opcode [%04Xh] 1001", OP); break; - } -} - -static void dasm_prefix_1010(dasm_state &st) -{ - switch ((OP >> 9) & 7) { - case 0: DASM("move %s, -*%s, 0", RS, RD); break; - case 1: DASM("move %s, -*%s, 1", RS, RD); break; - case 2: DASM("move -*%s, %s, 0", RS, RD); break; - case 3: DASM("move -*%s, %s, 1", RS, RD); break; - case 4: DASM("move -*%s, -*%s, 0", RS, RD); break; - case 5: DASM("move -*%s, -*%s, 1", RS, RD); break; - case 6: DASM("move %s, *%s(%Xh)", RS, RD, IW); W++; break; - case 7: DASM("move *%s(%Xh), %s", RS, IW, RD); W++; break; - } -} - -static void dasm_prefix_1011(dasm_state &st) -{ - switch ((OP >> 9) & 7) { - case 0: DASM("move %s, *%s(%Xh), 0", RS, RD, IW); W++; break; - case 1: DASM("move %s, *%s(%Xh), 1", RS, RD, IW); W++; break; - case 2: DASM("move *%s(%Xh), %s, 0", RS, IW, RD); W++; break; - case 3: DASM("move *%s(%Xh), %s, 1", RS, IW, RD); W++; break; - case 4: DASM("move *%s(%Xh), *%s(%Xh), 0", RS, IW, RD, IW2); W+=2; break; - case 5: DASM("move *%s(%Xh), *%s(%Xh), 1", RS, IW, RD, IW2); W+=2; break; - case 6: DASM("movb *%s(%Xh), *%s(%Xh)", RS, IW, RD, IW2); W+=2; break; - case 7: DASM("invalid opcode [%08Xh] 1011", OP); break; - } -} - -static void dasm_prefix_1100(dasm_state &st) -{ - const char *cond_table[16] = { - /* 0000 */ "", - /* 0001 */ "p", - /* 0010 */ "ls", - /* 0011 */ "hi", - /* 0100 */ "lt", - /* 0101 */ "ge", - /* 0110 */ "le", - /* 0111 */ "gt", - /* 1000 */ "c", - /* 1001 */ "nc", - /* 1010 */ "eq", - /* 1011 */ "ne", - /* 1100 */ "v", - /* 1101 */ "nv", - /* 1110 */ "n", - /* 1111 */ "nn" - }; - unsigned cc = (OP >> 8) & 0xF; - if ((OP & 0xFF) == 0x0) { - DASM("jr%s %08x (IW)", cond_table[cc], WDISP); - W++; - } else if ((OP & 0xFF) == 0x80) { - DASM("ja%s %08x", cond_table[cc], IL); - W+=2; - } else { - DASM("jr%s %08x", cond_table[cc], BDISP); - } -} - -static void dasm_prefix_1101(dasm_state &st) -{ - switch ((OP >> 8) & 0xF) { - case 0x0: - case 0x1: DASM("move *%s(%0x04x), %s, 0", RS, IW, RD); W++; break; - case 0x2: - case 0x3: DASM("move *%s(%0x04x), %s, 1", RS, IW, RD); W++; break; - case 0x4: DASM("move @%08Xh, %s, 0", IL, RD); W+=2; break; - case 0x5: DASM("exgf %s, 0", RD); break; - case 0x6: DASM("move @%08Xh, %s, 1", IL, RD); W+=2; break; - case 0x7: DASM("exgf %s, 1", RD); break; - case 0xF: - if (((OP >> 4) & 7) == 1) { - DASM("line %d", (OP >> 7) & 1); - break; - } - default: - DASM("invalid opcode [%04Xh] 1101", OP); - break; - } -} - -static void dasm_prefix_1110(dasm_state &st) -{ - switch ((OP >> 9) & 7) { - case 0: DASM("addxy %s, %s", RS, RD); break; - case 1: DASM("subxy %s, %s", RS, RD); break; - case 2: DASM("cmpxy %s, %s", RS, RD); break; - case 3: DASM("cpw %s, %s", RS, RD); break; - case 4: DASM("cvxyl %s, %s", RS, RD); break; - case 5: DASM("invalid opcode [%04Xh] 1110", OP); break; - case 6: DASM("movx %s, %s", RS, RD); break; - case 7: DASM("movy %s, %s", RS, RD); break; - } -} - - -static void dasm_prefix_1111(dasm_state &st) -{ - switch ((st.opcode >> 9) & 7) { - case 0: DASM("pixt %s, *%s.xy", RS, RD); break; - case 1: DASM("pixt *%s.xy, %s", RS, RD); break; - case 2: DASM("pixt *%s.xy, *%s.xy", RS, RD); break; - case 3: DASM("drav %s, %s", RS, RD); break; - case 4: DASM("pixt %s, *%s", RS, RD); break; - case 5: DASM("pixt *%s, %s", RS, RD); break; - case 6: DASM("pixt *%s, *%s", RS, RD); break; - case 7: DASM("invalid opcode [%04Xh] 1111", OP); break; - } -} - -std::string new_dasm(dword pc, size_t *size) -{ - dasm_state st; - - st.pc = pc & ~0xF; - st.opcode = READ_WORD(pc); - st.iw = READ_WORD(pc + 16); - st.iw2 = READ_WORD(pc + 32); - st.il = READ_DWORD(pc + 16); - st.il2 = READ_DWORD(pc + 16 + 32); - st.words = 1; - - switch ((OP >> 12) & 0xF) { - case 0x0: dasm_prefix_0000(st); break; - case 0x1: dasm_prefix_0001(st); break; - case 0x2: dasm_prefix_0010(st); break; - case 0x3: dasm_prefix_0011(st); break; - case 0x4: dasm_prefix_0100(st); break; - case 0x5: dasm_prefix_0101(st); break; - case 0x6: dasm_prefix_0110(st); break; - case 0x7: dasm_prefix_0111(st); break; - case 0x8: dasm_prefix_1000(st); break; - case 0x9: dasm_prefix_1001(st); break; - case 0xA: dasm_prefix_1010(st); break; - case 0xB: dasm_prefix_1011(st); break; - case 0xC: dasm_prefix_1100(st); break; - case 0xD: dasm_prefix_1101(st); break; - case 0xE: dasm_prefix_1110(st); break; - case 0xF: dasm_prefix_1111(st); break; - } - - if (size) - *size = st.words * 16; - - return std::string(st.buf); -} - -} diff --git a/jan/src/cpu/tms34010/tms34010_optable.cpp b/jan/src/cpu/tms34010/tms34010_optable.cpp deleted file mode 100644 index 426099b87..000000000 --- a/jan/src/cpu/tms34010/tms34010_optable.cpp +++ /dev/null @@ -1,4381 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifdef TMS34010_DEBUGGER -#include -#endif -#include "tms34010.h" -#include "tms34010_defs.h" - -namespace tms { - -using namespace ops; - -static void unimplemented(cpu_state *cpu, word opcode) { -#ifdef TMS34010_DEBUGGER - qDebug() << "OP_UNIMPL" << QString::number(opcode, 16); - qDebug() << QString::number(cpu->pc-16,16) << "::" << QString::fromStdString(dasm(cpu->pc-16,nullptr)); - cpu->reason = BREAKPOINT_FOUND; - cpu->icounter = 0; -#endif -} - -static void nop(cpu_state *cpu, word opcode) { CONSUME_CYCLES(1); } - -opcode_handler opcode_table[0x1000] = { -/* 0000 0000 0000 */ &unimplemented, -/* 0000 0000 0001 */ &unimplemented, -/* 0000 0000 0010 */ &rev_rd, -/* 0000 0000 0011 */ &rev_rd, -/* 0000 0000 0100 */ &unimplemented, -/* 0000 0000 0101 */ &unimplemented, -/* 0000 0000 0110 */ &unimplemented, -/* 0000 0000 0111 */ &unimplemented, -/* 0000 0000 1000 */ &unimplemented, -/* 0000 0000 1001 */ &unimplemented, -/* 0000 0000 1010 */ &unimplemented, -/* 0000 0000 1011 */ &unimplemented, -/* 0000 0000 1100 */ &unimplemented, -/* 0000 0000 1101 */ &unimplemented, -/* 0000 0000 1110 */ &unimplemented, -/* 0000 0000 1111 */ &unimplemented, - -/* 0000 0001 0000 */ &emu, -/* 0000 0001 0001 */ &unimplemented, -/* 0000 0001 0010 */ &exgpc, -/* 0000 0001 0011 */ &exgpc, -/* 0000 0001 0100 */ &getpc, -/* 0000 0001 0101 */ &getpc, -/* 0000 0001 0110 */ &jump_rs, -/* 0000 0001 0111 */ &jump_rs, -/* 0000 0001 1000 */ &getst, -/* 0000 0001 1001 */ &getst, -/* 0000 0001 1010 */ &putst, -/* 0000 0001 1011 */ &putst, -/* 0000 0001 1100 */ &popst, -/* 0000 0001 1101 */ &unimplemented, -/* 0000 0001 1110 */ &pushst, -/* 0000 0001 1111 */ &unimplemented, - -/* 0000 0010 0000 */ &unimplemented, -/* 0000 0010 0001 */ &unimplemented, -/* 0000 0010 0010 */ &unimplemented, -/* 0000 0010 0011 */ &unimplemented, -/* 0000 0010 0100 */ &unimplemented, -/* 0000 0010 0101 */ &unimplemented, -/* 0000 0010 0110 */ &unimplemented, -/* 0000 0010 0111 */ &unimplemented, -/* 0000 0010 1000 */ &unimplemented, -/* 0000 0010 1001 */ &unimplemented, -/* 0000 0010 1010 */ &unimplemented, -/* 0000 0010 1011 */ &unimplemented, -/* 0000 0010 1100 */ &unimplemented, -/* 0000 0010 1101 */ &unimplemented, -/* 0000 0010 1110 */ &unimplemented, -/* 0000 0010 1111 */ &unimplemented, - -/* 0000 0011 0000 */ &nop, -/* 0000 0011 0001 */ &unimplemented, -/* 0000 0011 0010 */ &clrc, -/* 0000 0011 0011 */ &unimplemented, -/* 0000 0011 0100 */ &movb_saddr_daddr, -/* 0000 0011 0101 */ &unimplemented, -/* 0000 0011 0110 */ &dint, -/* 0000 0011 0111 */ &unimplemented, -/* 0000 0011 1000 */ &abs_rd, -/* 0000 0011 1001 */ &abs_rd, -/* 0000 0011 1010 */ &neg_rd, -/* 0000 0011 1011 */ &neg_rd, -/* 0000 0011 1100 */ &unimplemented, -/* 0000 0011 1101 */ &unimplemented, -/* 0000 0011 1110 */ ¬_rd, -/* 0000 0011 1111 */ ¬_rd, - -/* 0000 0100 0000 */ &unimplemented, -/* 0000 0100 0001 */ &unimplemented, -/* 0000 0100 0010 */ &unimplemented, -/* 0000 0100 0011 */ &unimplemented, -/* 0000 0100 0100 */ &unimplemented, -/* 0000 0100 0101 */ &unimplemented, -/* 0000 0100 0110 */ &unimplemented, -/* 0000 0100 0111 */ &unimplemented, -/* 0000 0100 1000 */ &unimplemented, -/* 0000 0100 1001 */ &unimplemented, -/* 0000 0100 1010 */ &unimplemented, -/* 0000 0100 1011 */ &unimplemented, -/* 0000 0100 1100 */ &unimplemented, -/* 0000 0100 1101 */ &unimplemented, -/* 0000 0100 1110 */ &unimplemented, -/* 0000 0100 1111 */ &unimplemented, - -/* 0000 0101 0000 */ &sext_rd_0, -/* 0000 0101 0001 */ &sext_rd_0, -/* 0000 0101 0010 */ &zext_rd_0, -/* 0000 0101 0011 */ &zext_rd_0, -/* 0000 0101 0100 */ &setf_0, -/* 0000 0101 0101 */ &setf_0, -/* 0000 0101 0110 */ &setf_0, -/* 0000 0101 0111 */ &setf_0, -/* 0000 0101 1000 */ &move_rs_daddr_0, -/* 0000 0101 1001 */ &move_rs_daddr_0, -/* 0000 0101 1010 */ &move_saddr_rd_0, -/* 0000 0101 1011 */ &move_saddr_rd_0, -/* 0000 0101 1100 */ &move_saddr_daddr_0, -/* 0000 0101 1101 */ &unimplemented, -/* 0000 0101 1110 */ &movb_rs_daddr, -/* 0000 0101 1111 */ &movb_rs_daddr, - -/* 0000 0110 0000 */ &unimplemented, -/* 0000 0110 0001 */ &unimplemented, -/* 0000 0110 0010 */ &unimplemented, -/* 0000 0110 0011 */ &unimplemented, -/* 0000 0110 0100 */ &unimplemented, -/* 0000 0110 0101 */ &unimplemented, -/* 0000 0110 0110 */ &unimplemented, -/* 0000 0110 0111 */ &unimplemented, -/* 0000 0110 1000 */ &unimplemented, -/* 0000 0110 1001 */ &unimplemented, -/* 0000 0110 1010 */ &unimplemented, -/* 0000 0110 1011 */ &unimplemented, -/* 0000 0110 1100 */ &unimplemented, -/* 0000 0110 1101 */ &unimplemented, -/* 0000 0110 1110 */ &unimplemented, -/* 0000 0110 1111 */ &unimplemented, - -/* 0000 0111 0000 */ &sext_rd_1, -/* 0000 0111 0001 */ &sext_rd_1, -/* 0000 0111 0010 */ &zext_rd_1, -/* 0000 0111 0011 */ &zext_rd_1, -/* 0000 0111 0100 */ &setf_1, -/* 0000 0111 0101 */ &setf_1, -/* 0000 0111 0110 */ &setf_1, -/* 0000 0111 0111 */ &setf_1, -/* 0000 0111 1000 */ &move_rs_daddr_1, -/* 0000 0111 1001 */ &move_rs_daddr_1, -/* 0000 0111 1010 */ &move_saddr_rd_1, -/* 0000 0111 1011 */ &move_saddr_rd_1, -/* 0000 0111 1100 */ &move_saddr_daddr_1, -/* 0000 0111 1101 */ &unimplemented, -/* 0000 0111 1110 */ &movb_addr_rd, -/* 0000 0111 1111 */ &movb_addr_rd, - -/* 0000 1000 0000 */ &unimplemented, -/* 0000 1000 0001 */ &unimplemented, -/* 0000 1000 0010 */ &unimplemented, -/* 0000 1000 0011 */ &unimplemented, -/* 0000 1000 0100 */ &unimplemented, -/* 0000 1000 0101 */ &unimplemented, -/* 0000 1000 0110 */ &unimplemented, -/* 0000 1000 0111 */ &unimplemented, -/* 0000 1000 1000 */ &unimplemented, -/* 0000 1000 1001 */ &unimplemented, -/* 0000 1000 1010 */ &unimplemented, -/* 0000 1000 1011 */ &unimplemented, -/* 0000 1000 1100 */ &unimplemented, -/* 0000 1000 1101 */ &unimplemented, -/* 0000 1000 1110 */ &unimplemented, -/* 0000 1000 1111 */ &unimplemented, - -/* 0000 1001 0000 */ &trap, -/* 0000 1001 0001 */ &trap, -/* 0000 1001 0010 */ &call_rs, -/* 0000 1001 0011 */ &call_rs, -/* 0000 1001 0100 */ &reti, -/* 0000 1001 0101 */ &unimplemented, -/* 0000 1001 0110 */ &rets, -/* 0000 1001 0111 */ &rets, -/* 0000 1001 1000 */ &mmtm, -/* 0000 1001 1001 */ &mmtm, -/* 0000 1001 1010 */ &mmfm, -/* 0000 1001 1011 */ &mmfm, -/* 0000 1001 1100 */ &movi_iw_rd, -/* 0000 1001 1101 */ &movi_iw_rd, -/* 0000 1001 1110 */ &movi_il_rd, -/* 0000 1001 1111 */ &movi_il_rd, - -/* 0000 1010 0000 */ &unimplemented, -/* 0000 1010 0001 */ &unimplemented, -/* 0000 1010 0010 */ &unimplemented, -/* 0000 1010 0011 */ &unimplemented, -/* 0000 1010 0100 */ &unimplemented, -/* 0000 1010 0101 */ &unimplemented, -/* 0000 1010 0110 */ &unimplemented, -/* 0000 1010 0111 */ &unimplemented, -/* 0000 1010 1000 */ &unimplemented, -/* 0000 1010 1001 */ &unimplemented, -/* 0000 1010 1010 */ &unimplemented, -/* 0000 1010 1011 */ &unimplemented, -/* 0000 1010 1100 */ &unimplemented, -/* 0000 1010 1101 */ &unimplemented, -/* 0000 1010 1110 */ &unimplemented, -/* 0000 1010 1111 */ &unimplemented, - -/* 0000 1011 0000 */ &addi_iw_rd, -/* 0000 1011 0001 */ &addi_iw_rd, -/* 0000 1011 0010 */ &addi_il_rd, -/* 0000 1011 0011 */ &addi_il_rd, -/* 0000 1011 0100 */ &cmpi_iw_rd, -/* 0000 1011 0101 */ &cmpi_iw_rd, -/* 0000 1011 0110 */ &cmpi_il_rd, -/* 0000 1011 0111 */ &cmpi_il_rd, -/* 0000 1011 1000 */ &andi_il_rd, -/* 0000 1011 1001 */ &andi_il_rd, -/* 0000 1011 1010 */ &ori_il_rd, -/* 0000 1011 1011 */ &ori_il_rd, -/* 0000 1011 1100 */ &xori_il_rd, -/* 0000 1011 1101 */ &xori_il_rd, -/* 0000 1011 1110 */ &subi_iw_rd, -/* 0000 1011 1111 */ &subi_iw_rd, - -/* 0000 1100 0000 */ &unimplemented, -/* 0000 1100 0001 */ &unimplemented, -/* 0000 1100 0010 */ &unimplemented, -/* 0000 1100 0011 */ &unimplemented, -/* 0000 1100 0100 */ &unimplemented, -/* 0000 1100 0101 */ &unimplemented, -/* 0000 1100 0110 */ &unimplemented, -/* 0000 1100 0111 */ &unimplemented, -/* 0000 1100 1000 */ &unimplemented, -/* 0000 1100 1001 */ &unimplemented, -/* 0000 1100 1010 */ &unimplemented, -/* 0000 1100 1011 */ &unimplemented, -/* 0000 1100 1100 */ &unimplemented, -/* 0000 1100 1101 */ &unimplemented, -/* 0000 1100 1110 */ &unimplemented, -/* 0000 1100 1111 */ &unimplemented, - -/* 0000 1101 0000 */ &subi_il_rd, -/* 0000 1101 0001 */ &subi_il_rd, -/* 0000 1101 0010 */ &unimplemented, -/* 0000 1101 0011 */ &callr, -/* 0000 1101 0100 */ &unimplemented, -/* 0000 1101 0101 */ &calla, -/* 0000 1101 0110 */ &eint, -/* 0000 1101 0111 */ &unimplemented, -/* 0000 1101 1000 */ &dsj, -/* 0000 1101 1001 */ &dsj, -/* 0000 1101 1010 */ &dsjeq, -/* 0000 1101 1011 */ &dsjeq, -/* 0000 1101 1100 */ &dsjne, -/* 0000 1101 1101 */ &dsjne, -/* 0000 1101 1110 */ &setc, -/* 0000 1101 1111 */ &unimplemented, - -/* 0000 1110 0000 */ &unimplemented, -/* 0000 1110 0001 */ &unimplemented, -/* 0000 1110 0010 */ &unimplemented, -/* 0000 1110 0011 */ &unimplemented, -/* 0000 1110 0100 */ &unimplemented, -/* 0000 1110 0101 */ &unimplemented, -/* 0000 1110 0110 */ &unimplemented, -/* 0000 1110 0111 */ &unimplemented, -/* 0000 1110 1000 */ &unimplemented, -/* 0000 1110 1001 */ &unimplemented, -/* 0000 1110 1010 */ &unimplemented, -/* 0000 1110 1011 */ &unimplemented, -/* 0000 1110 1100 */ &unimplemented, -/* 0000 1110 1101 */ &unimplemented, -/* 0000 1110 1110 */ &unimplemented, -/* 0000 1110 1111 */ &unimplemented, - -/* 0000 1111 0000 */ &unimplemented, -/* 0000 1111 0001 */ &unimplemented, -/* 0000 1111 0010 */ &unimplemented, -/* 0000 1111 0011 */ &unimplemented, -/* 0000 1111 0100 */ &unimplemented, -/* 0000 1111 0101 */ &unimplemented, -/* 0000 1111 0110 */ &unimplemented, -/* 0000 1111 0111 */ &unimplemented, -/* 0000 1111 1000 */ &unimplemented, -/* 0000 1111 1001 */ &unimplemented, -/* 0000 1111 1010 */ &pixblt_b_xy, -/* 0000 1111 1011 */ &unimplemented, -/* 0000 1111 1100 */ &fill_l, -/* 0000 1111 1101 */ &unimplemented, -/* 0000 1111 1110 */ &fill_xy, -/* 0000 1111 1111 */ &unimplemented, - -/* 0001 0000 0000 */ &add_k_rd, -/* 0001 0000 0001 */ &add_k_rd, -/* 0001 0000 0010 */ &add_k_rd, -/* 0001 0000 0011 */ &add_k_rd, -/* 0001 0000 0100 */ &add_k_rd, -/* 0001 0000 0101 */ &add_k_rd, -/* 0001 0000 0110 */ &add_k_rd, -/* 0001 0000 0111 */ &add_k_rd, -/* 0001 0000 1000 */ &add_k_rd, -/* 0001 0000 1001 */ &add_k_rd, -/* 0001 0000 1010 */ &add_k_rd, -/* 0001 0000 1011 */ &add_k_rd, -/* 0001 0000 1100 */ &add_k_rd, -/* 0001 0000 1101 */ &add_k_rd, -/* 0001 0000 1110 */ &add_k_rd, -/* 0001 0000 1111 */ &add_k_rd, - -/* 0001 0001 0000 */ &add_k_rd, -/* 0001 0001 0001 */ &add_k_rd, -/* 0001 0001 0010 */ &add_k_rd, -/* 0001 0001 0011 */ &add_k_rd, -/* 0001 0001 0100 */ &add_k_rd, -/* 0001 0001 0101 */ &add_k_rd, -/* 0001 0001 0110 */ &add_k_rd, -/* 0001 0001 0111 */ &add_k_rd, -/* 0001 0001 1000 */ &add_k_rd, -/* 0001 0001 1001 */ &add_k_rd, -/* 0001 0001 1010 */ &add_k_rd, -/* 0001 0001 1011 */ &add_k_rd, -/* 0001 0001 1100 */ &add_k_rd, -/* 0001 0001 1101 */ &add_k_rd, -/* 0001 0001 1110 */ &add_k_rd, -/* 0001 0001 1111 */ &add_k_rd, - -/* 0001 0010 0000 */ &add_k_rd, -/* 0001 0010 0001 */ &add_k_rd, -/* 0001 0010 0010 */ &add_k_rd, -/* 0001 0010 0011 */ &add_k_rd, -/* 0001 0010 0100 */ &add_k_rd, -/* 0001 0010 0101 */ &add_k_rd, -/* 0001 0010 0110 */ &add_k_rd, -/* 0001 0010 0111 */ &add_k_rd, -/* 0001 0010 1000 */ &add_k_rd, -/* 0001 0010 1001 */ &add_k_rd, -/* 0001 0010 1010 */ &add_k_rd, -/* 0001 0010 1011 */ &add_k_rd, -/* 0001 0010 1100 */ &add_k_rd, -/* 0001 0010 1101 */ &add_k_rd, -/* 0001 0010 1110 */ &add_k_rd, -/* 0001 0010 1111 */ &add_k_rd, - -/* 0001 0011 0000 */ &add_k_rd, -/* 0001 0011 0001 */ &add_k_rd, -/* 0001 0011 0010 */ &add_k_rd, -/* 0001 0011 0011 */ &add_k_rd, -/* 0001 0011 0100 */ &add_k_rd, -/* 0001 0011 0101 */ &add_k_rd, -/* 0001 0011 0110 */ &add_k_rd, -/* 0001 0011 0111 */ &add_k_rd, -/* 0001 0011 1000 */ &add_k_rd, -/* 0001 0011 1001 */ &add_k_rd, -/* 0001 0011 1010 */ &add_k_rd, -/* 0001 0011 1011 */ &add_k_rd, -/* 0001 0011 1100 */ &add_k_rd, -/* 0001 0011 1101 */ &add_k_rd, -/* 0001 0011 1110 */ &add_k_rd, -/* 0001 0011 1111 */ &add_k_rd, - -/* 0001 0100 0000 */ &sub_k_rd, -/* 0001 0100 0001 */ &sub_k_rd, -/* 0001 0100 0010 */ &sub_k_rd, -/* 0001 0100 0011 */ &sub_k_rd, -/* 0001 0100 0100 */ &sub_k_rd, -/* 0001 0100 0101 */ &sub_k_rd, -/* 0001 0100 0110 */ &sub_k_rd, -/* 0001 0100 0111 */ &sub_k_rd, -/* 0001 0100 1000 */ &sub_k_rd, -/* 0001 0100 1001 */ &sub_k_rd, -/* 0001 0100 1010 */ &sub_k_rd, -/* 0001 0100 1011 */ &sub_k_rd, -/* 0001 0100 1100 */ &sub_k_rd, -/* 0001 0100 1101 */ &sub_k_rd, -/* 0001 0100 1110 */ &sub_k_rd, -/* 0001 0100 1111 */ &sub_k_rd, - -/* 0001 0101 0000 */ &sub_k_rd, -/* 0001 0101 0001 */ &sub_k_rd, -/* 0001 0101 0010 */ &sub_k_rd, -/* 0001 0101 0011 */ &sub_k_rd, -/* 0001 0101 0100 */ &sub_k_rd, -/* 0001 0101 0101 */ &sub_k_rd, -/* 0001 0101 0110 */ &sub_k_rd, -/* 0001 0101 0111 */ &sub_k_rd, -/* 0001 0101 1000 */ &sub_k_rd, -/* 0001 0101 1001 */ &sub_k_rd, -/* 0001 0101 1010 */ &sub_k_rd, -/* 0001 0101 1011 */ &sub_k_rd, -/* 0001 0101 1100 */ &sub_k_rd, -/* 0001 0101 1101 */ &sub_k_rd, -/* 0001 0101 1110 */ &sub_k_rd, -/* 0001 0101 1111 */ &sub_k_rd, - -/* 0001 0110 0000 */ &sub_k_rd, -/* 0001 0110 0001 */ &sub_k_rd, -/* 0001 0110 0010 */ &sub_k_rd, -/* 0001 0110 0011 */ &sub_k_rd, -/* 0001 0110 0100 */ &sub_k_rd, -/* 0001 0110 0101 */ &sub_k_rd, -/* 0001 0110 0110 */ &sub_k_rd, -/* 0001 0110 0111 */ &sub_k_rd, -/* 0001 0110 1000 */ &sub_k_rd, -/* 0001 0110 1001 */ &sub_k_rd, -/* 0001 0110 1010 */ &sub_k_rd, -/* 0001 0110 1011 */ &sub_k_rd, -/* 0001 0110 1100 */ &sub_k_rd, -/* 0001 0110 1101 */ &sub_k_rd, -/* 0001 0110 1110 */ &sub_k_rd, -/* 0001 0110 1111 */ &sub_k_rd, - -/* 0001 0111 0000 */ &sub_k_rd, -/* 0001 0111 0001 */ &sub_k_rd, -/* 0001 0111 0010 */ &sub_k_rd, -/* 0001 0111 0011 */ &sub_k_rd, -/* 0001 0111 0100 */ &sub_k_rd, -/* 0001 0111 0101 */ &sub_k_rd, -/* 0001 0111 0110 */ &sub_k_rd, -/* 0001 0111 0111 */ &sub_k_rd, -/* 0001 0111 1000 */ &sub_k_rd, -/* 0001 0111 1001 */ &sub_k_rd, -/* 0001 0111 1010 */ &sub_k_rd, -/* 0001 0111 1011 */ &sub_k_rd, -/* 0001 0111 1100 */ &sub_k_rd, -/* 0001 0111 1101 */ &sub_k_rd, -/* 0001 0111 1110 */ &sub_k_rd, -/* 0001 0111 1111 */ &sub_k_rd, - -/* 0001 1000 0000 */ &movk_k_rd, -/* 0001 1000 0001 */ &movk_k_rd, -/* 0001 1000 0010 */ &movk_k_rd, -/* 0001 1000 0011 */ &movk_k_rd, -/* 0001 1000 0100 */ &movk_k_rd, -/* 0001 1000 0101 */ &movk_k_rd, -/* 0001 1000 0110 */ &movk_k_rd, -/* 0001 1000 0111 */ &movk_k_rd, -/* 0001 1000 1000 */ &movk_k_rd, -/* 0001 1000 1001 */ &movk_k_rd, -/* 0001 1000 1010 */ &movk_k_rd, -/* 0001 1000 1011 */ &movk_k_rd, -/* 0001 1000 1100 */ &movk_k_rd, -/* 0001 1000 1101 */ &movk_k_rd, -/* 0001 1000 1110 */ &movk_k_rd, -/* 0001 1000 1111 */ &movk_k_rd, - -/* 0001 1001 0000 */ &movk_k_rd, -/* 0001 1001 0001 */ &movk_k_rd, -/* 0001 1001 0010 */ &movk_k_rd, -/* 0001 1001 0011 */ &movk_k_rd, -/* 0001 1001 0100 */ &movk_k_rd, -/* 0001 1001 0101 */ &movk_k_rd, -/* 0001 1001 0110 */ &movk_k_rd, -/* 0001 1001 0111 */ &movk_k_rd, -/* 0001 1001 1000 */ &movk_k_rd, -/* 0001 1001 1001 */ &movk_k_rd, -/* 0001 1001 1010 */ &movk_k_rd, -/* 0001 1001 1011 */ &movk_k_rd, -/* 0001 1001 1100 */ &movk_k_rd, -/* 0001 1001 1101 */ &movk_k_rd, -/* 0001 1001 1110 */ &movk_k_rd, -/* 0001 1001 1111 */ &movk_k_rd, - -/* 0001 1010 0000 */ &movk_k_rd, -/* 0001 1010 0001 */ &movk_k_rd, -/* 0001 1010 0010 */ &movk_k_rd, -/* 0001 1010 0011 */ &movk_k_rd, -/* 0001 1010 0100 */ &movk_k_rd, -/* 0001 1010 0101 */ &movk_k_rd, -/* 0001 1010 0110 */ &movk_k_rd, -/* 0001 1010 0111 */ &movk_k_rd, -/* 0001 1010 1000 */ &movk_k_rd, -/* 0001 1010 1001 */ &movk_k_rd, -/* 0001 1010 1010 */ &movk_k_rd, -/* 0001 1010 1011 */ &movk_k_rd, -/* 0001 1010 1100 */ &movk_k_rd, -/* 0001 1010 1101 */ &movk_k_rd, -/* 0001 1010 1110 */ &movk_k_rd, -/* 0001 1010 1111 */ &movk_k_rd, - -/* 0001 1011 0000 */ &movk_k_rd, -/* 0001 1011 0001 */ &movk_k_rd, -/* 0001 1011 0010 */ &movk_k_rd, -/* 0001 1011 0011 */ &movk_k_rd, -/* 0001 1011 0100 */ &movk_k_rd, -/* 0001 1011 0101 */ &movk_k_rd, -/* 0001 1011 0110 */ &movk_k_rd, -/* 0001 1011 0111 */ &movk_k_rd, -/* 0001 1011 1000 */ &movk_k_rd, -/* 0001 1011 1001 */ &movk_k_rd, -/* 0001 1011 1010 */ &movk_k_rd, -/* 0001 1011 1011 */ &movk_k_rd, -/* 0001 1011 1100 */ &movk_k_rd, -/* 0001 1011 1101 */ &movk_k_rd, -/* 0001 1011 1110 */ &movk_k_rd, -/* 0001 1011 1111 */ &movk_k_rd, - -/* 0001 1100 0000 */ &btst_k_rd, -/* 0001 1100 0001 */ &btst_k_rd, -/* 0001 1100 0010 */ &btst_k_rd, -/* 0001 1100 0011 */ &btst_k_rd, -/* 0001 1100 0100 */ &btst_k_rd, -/* 0001 1100 0101 */ &btst_k_rd, -/* 0001 1100 0110 */ &btst_k_rd, -/* 0001 1100 0111 */ &btst_k_rd, -/* 0001 1100 1000 */ &btst_k_rd, -/* 0001 1100 1001 */ &btst_k_rd, -/* 0001 1100 1010 */ &btst_k_rd, -/* 0001 1100 1011 */ &btst_k_rd, -/* 0001 1100 1100 */ &btst_k_rd, -/* 0001 1100 1101 */ &btst_k_rd, -/* 0001 1100 1110 */ &btst_k_rd, -/* 0001 1100 1111 */ &btst_k_rd, - -/* 0001 1101 0000 */ &btst_k_rd, -/* 0001 1101 0001 */ &btst_k_rd, -/* 0001 1101 0010 */ &btst_k_rd, -/* 0001 1101 0011 */ &btst_k_rd, -/* 0001 1101 0100 */ &btst_k_rd, -/* 0001 1101 0101 */ &btst_k_rd, -/* 0001 1101 0110 */ &btst_k_rd, -/* 0001 1101 0111 */ &btst_k_rd, -/* 0001 1101 1000 */ &btst_k_rd, -/* 0001 1101 1001 */ &btst_k_rd, -/* 0001 1101 1010 */ &btst_k_rd, -/* 0001 1101 1011 */ &btst_k_rd, -/* 0001 1101 1100 */ &btst_k_rd, -/* 0001 1101 1101 */ &btst_k_rd, -/* 0001 1101 1110 */ &btst_k_rd, -/* 0001 1101 1111 */ &btst_k_rd, - -/* 0001 1110 0000 */ &btst_k_rd, -/* 0001 1110 0001 */ &btst_k_rd, -/* 0001 1110 0010 */ &btst_k_rd, -/* 0001 1110 0011 */ &btst_k_rd, -/* 0001 1110 0100 */ &btst_k_rd, -/* 0001 1110 0101 */ &btst_k_rd, -/* 0001 1110 0110 */ &btst_k_rd, -/* 0001 1110 0111 */ &btst_k_rd, -/* 0001 1110 1000 */ &btst_k_rd, -/* 0001 1110 1001 */ &btst_k_rd, -/* 0001 1110 1010 */ &btst_k_rd, -/* 0001 1110 1011 */ &btst_k_rd, -/* 0001 1110 1100 */ &btst_k_rd, -/* 0001 1110 1101 */ &btst_k_rd, -/* 0001 1110 1110 */ &btst_k_rd, -/* 0001 1110 1111 */ &btst_k_rd, - -/* 0001 1111 0000 */ &btst_k_rd, -/* 0001 1111 0001 */ &btst_k_rd, -/* 0001 1111 0010 */ &btst_k_rd, -/* 0001 1111 0011 */ &btst_k_rd, -/* 0001 1111 0100 */ &btst_k_rd, -/* 0001 1111 0101 */ &btst_k_rd, -/* 0001 1111 0110 */ &btst_k_rd, -/* 0001 1111 0111 */ &btst_k_rd, -/* 0001 1111 1000 */ &btst_k_rd, -/* 0001 1111 1001 */ &btst_k_rd, -/* 0001 1111 1010 */ &btst_k_rd, -/* 0001 1111 1011 */ &btst_k_rd, -/* 0001 1111 1100 */ &btst_k_rd, -/* 0001 1111 1101 */ &btst_k_rd, -/* 0001 1111 1110 */ &btst_k_rd, -/* 0001 1111 1111 */ &btst_k_rd, - -/* 0010 0000 0000 */ &sla_k_rd, -/* 0010 0000 0001 */ &sla_k_rd, -/* 0010 0000 0010 */ &sla_k_rd, -/* 0010 0000 0011 */ &sla_k_rd, -/* 0010 0000 0100 */ &sla_k_rd, -/* 0010 0000 0101 */ &sla_k_rd, -/* 0010 0000 0110 */ &sla_k_rd, -/* 0010 0000 0111 */ &sla_k_rd, -/* 0010 0000 1000 */ &sla_k_rd, -/* 0010 0000 1001 */ &sla_k_rd, -/* 0010 0000 1010 */ &sla_k_rd, -/* 0010 0000 1011 */ &sla_k_rd, -/* 0010 0000 1100 */ &sla_k_rd, -/* 0010 0000 1101 */ &sla_k_rd, -/* 0010 0000 1110 */ &sla_k_rd, -/* 0010 0000 1111 */ &sla_k_rd, - -/* 0010 0001 0000 */ &sla_k_rd, -/* 0010 0001 0001 */ &sla_k_rd, -/* 0010 0001 0010 */ &sla_k_rd, -/* 0010 0001 0011 */ &sla_k_rd, -/* 0010 0001 0100 */ &sla_k_rd, -/* 0010 0001 0101 */ &sla_k_rd, -/* 0010 0001 0110 */ &sla_k_rd, -/* 0010 0001 0111 */ &sla_k_rd, -/* 0010 0001 1000 */ &sla_k_rd, -/* 0010 0001 1001 */ &sla_k_rd, -/* 0010 0001 1010 */ &sla_k_rd, -/* 0010 0001 1011 */ &sla_k_rd, -/* 0010 0001 1100 */ &sla_k_rd, -/* 0010 0001 1101 */ &sla_k_rd, -/* 0010 0001 1110 */ &sla_k_rd, -/* 0010 0001 1111 */ &sla_k_rd, - -/* 0010 0010 0000 */ &sla_k_rd, -/* 0010 0010 0001 */ &sla_k_rd, -/* 0010 0010 0010 */ &sla_k_rd, -/* 0010 0010 0011 */ &sla_k_rd, -/* 0010 0010 0100 */ &sla_k_rd, -/* 0010 0010 0101 */ &sla_k_rd, -/* 0010 0010 0110 */ &sla_k_rd, -/* 0010 0010 0111 */ &sla_k_rd, -/* 0010 0010 1000 */ &sla_k_rd, -/* 0010 0010 1001 */ &sla_k_rd, -/* 0010 0010 1010 */ &sla_k_rd, -/* 0010 0010 1011 */ &sla_k_rd, -/* 0010 0010 1100 */ &sla_k_rd, -/* 0010 0010 1101 */ &sla_k_rd, -/* 0010 0010 1110 */ &sla_k_rd, -/* 0010 0010 1111 */ &sla_k_rd, - -/* 0010 0011 0000 */ &sla_k_rd, -/* 0010 0011 0001 */ &sla_k_rd, -/* 0010 0011 0010 */ &sla_k_rd, -/* 0010 0011 0011 */ &sla_k_rd, -/* 0010 0011 0100 */ &sla_k_rd, -/* 0010 0011 0101 */ &sla_k_rd, -/* 0010 0011 0110 */ &sla_k_rd, -/* 0010 0011 0111 */ &sla_k_rd, -/* 0010 0011 1000 */ &sla_k_rd, -/* 0010 0011 1001 */ &sla_k_rd, -/* 0010 0011 1010 */ &sla_k_rd, -/* 0010 0011 1011 */ &sla_k_rd, -/* 0010 0011 1100 */ &sla_k_rd, -/* 0010 0011 1101 */ &sla_k_rd, -/* 0010 0011 1110 */ &sla_k_rd, -/* 0010 0011 1111 */ &sla_k_rd, - -/* 0010 0100 0000 */ &sll_k_rd, -/* 0010 0100 0001 */ &sll_k_rd, -/* 0010 0100 0010 */ &sll_k_rd, -/* 0010 0100 0011 */ &sll_k_rd, -/* 0010 0100 0100 */ &sll_k_rd, -/* 0010 0100 0101 */ &sll_k_rd, -/* 0010 0100 0110 */ &sll_k_rd, -/* 0010 0100 0111 */ &sll_k_rd, -/* 0010 0100 1000 */ &sll_k_rd, -/* 0010 0100 1001 */ &sll_k_rd, -/* 0010 0100 1010 */ &sll_k_rd, -/* 0010 0100 1011 */ &sll_k_rd, -/* 0010 0100 1100 */ &sll_k_rd, -/* 0010 0100 1101 */ &sll_k_rd, -/* 0010 0100 1110 */ &sll_k_rd, -/* 0010 0100 1111 */ &sll_k_rd, - -/* 0010 0101 0000 */ &sll_k_rd, -/* 0010 0101 0001 */ &sll_k_rd, -/* 0010 0101 0010 */ &sll_k_rd, -/* 0010 0101 0011 */ &sll_k_rd, -/* 0010 0101 0100 */ &sll_k_rd, -/* 0010 0101 0101 */ &sll_k_rd, -/* 0010 0101 0110 */ &sll_k_rd, -/* 0010 0101 0111 */ &sll_k_rd, -/* 0010 0101 1000 */ &sll_k_rd, -/* 0010 0101 1001 */ &sll_k_rd, -/* 0010 0101 1010 */ &sll_k_rd, -/* 0010 0101 1011 */ &sll_k_rd, -/* 0010 0101 1100 */ &sll_k_rd, -/* 0010 0101 1101 */ &sll_k_rd, -/* 0010 0101 1110 */ &sll_k_rd, -/* 0010 0101 1111 */ &sll_k_rd, - -/* 0010 0110 0000 */ &sll_k_rd, -/* 0010 0110 0001 */ &sll_k_rd, -/* 0010 0110 0010 */ &sll_k_rd, -/* 0010 0110 0011 */ &sll_k_rd, -/* 0010 0110 0100 */ &sll_k_rd, -/* 0010 0110 0101 */ &sll_k_rd, -/* 0010 0110 0110 */ &sll_k_rd, -/* 0010 0110 0111 */ &sll_k_rd, -/* 0010 0110 1000 */ &sll_k_rd, -/* 0010 0110 1001 */ &sll_k_rd, -/* 0010 0110 1010 */ &sll_k_rd, -/* 0010 0110 1011 */ &sll_k_rd, -/* 0010 0110 1100 */ &sll_k_rd, -/* 0010 0110 1101 */ &sll_k_rd, -/* 0010 0110 1110 */ &sll_k_rd, -/* 0010 0110 1111 */ &sll_k_rd, - -/* 0010 0111 0000 */ &sll_k_rd, -/* 0010 0111 0001 */ &sll_k_rd, -/* 0010 0111 0010 */ &sll_k_rd, -/* 0010 0111 0011 */ &sll_k_rd, -/* 0010 0111 0100 */ &sll_k_rd, -/* 0010 0111 0101 */ &sll_k_rd, -/* 0010 0111 0110 */ &sll_k_rd, -/* 0010 0111 0111 */ &sll_k_rd, -/* 0010 0111 1000 */ &sll_k_rd, -/* 0010 0111 1001 */ &sll_k_rd, -/* 0010 0111 1010 */ &sll_k_rd, -/* 0010 0111 1011 */ &sll_k_rd, -/* 0010 0111 1100 */ &sll_k_rd, -/* 0010 0111 1101 */ &sll_k_rd, -/* 0010 0111 1110 */ &sll_k_rd, -/* 0010 0111 1111 */ &sll_k_rd, - -/* 0010 1000 0000 */ &sra_k_rd, -/* 0010 1000 0001 */ &sra_k_rd, -/* 0010 1000 0010 */ &sra_k_rd, -/* 0010 1000 0011 */ &sra_k_rd, -/* 0010 1000 0100 */ &sra_k_rd, -/* 0010 1000 0101 */ &sra_k_rd, -/* 0010 1000 0110 */ &sra_k_rd, -/* 0010 1000 0111 */ &sra_k_rd, -/* 0010 1000 1000 */ &sra_k_rd, -/* 0010 1000 1001 */ &sra_k_rd, -/* 0010 1000 1010 */ &sra_k_rd, -/* 0010 1000 1011 */ &sra_k_rd, -/* 0010 1000 1100 */ &sra_k_rd, -/* 0010 1000 1101 */ &sra_k_rd, -/* 0010 1000 1110 */ &sra_k_rd, -/* 0010 1000 1111 */ &sra_k_rd, - -/* 0010 1001 0000 */ &sra_k_rd, -/* 0010 1001 0001 */ &sra_k_rd, -/* 0010 1001 0010 */ &sra_k_rd, -/* 0010 1001 0011 */ &sra_k_rd, -/* 0010 1001 0100 */ &sra_k_rd, -/* 0010 1001 0101 */ &sra_k_rd, -/* 0010 1001 0110 */ &sra_k_rd, -/* 0010 1001 0111 */ &sra_k_rd, -/* 0010 1001 1000 */ &sra_k_rd, -/* 0010 1001 1001 */ &sra_k_rd, -/* 0010 1001 1010 */ &sra_k_rd, -/* 0010 1001 1011 */ &sra_k_rd, -/* 0010 1001 1100 */ &sra_k_rd, -/* 0010 1001 1101 */ &sra_k_rd, -/* 0010 1001 1110 */ &sra_k_rd, -/* 0010 1001 1111 */ &sra_k_rd, - -/* 0010 1010 0000 */ &sra_k_rd, -/* 0010 1010 0001 */ &sra_k_rd, -/* 0010 1010 0010 */ &sra_k_rd, -/* 0010 1010 0011 */ &sra_k_rd, -/* 0010 1010 0100 */ &sra_k_rd, -/* 0010 1010 0101 */ &sra_k_rd, -/* 0010 1010 0110 */ &sra_k_rd, -/* 0010 1010 0111 */ &sra_k_rd, -/* 0010 1010 1000 */ &sra_k_rd, -/* 0010 1010 1001 */ &sra_k_rd, -/* 0010 1010 1010 */ &sra_k_rd, -/* 0010 1010 1011 */ &sra_k_rd, -/* 0010 1010 1100 */ &sra_k_rd, -/* 0010 1010 1101 */ &sra_k_rd, -/* 0010 1010 1110 */ &sra_k_rd, -/* 0010 1010 1111 */ &sra_k_rd, - -/* 0010 1011 0000 */ &sra_k_rd, -/* 0010 1011 0001 */ &sra_k_rd, -/* 0010 1011 0010 */ &sra_k_rd, -/* 0010 1011 0011 */ &sra_k_rd, -/* 0010 1011 0100 */ &sra_k_rd, -/* 0010 1011 0101 */ &sra_k_rd, -/* 0010 1011 0110 */ &sra_k_rd, -/* 0010 1011 0111 */ &sra_k_rd, -/* 0010 1011 1000 */ &sra_k_rd, -/* 0010 1011 1001 */ &sra_k_rd, -/* 0010 1011 1010 */ &sra_k_rd, -/* 0010 1011 1011 */ &sra_k_rd, -/* 0010 1011 1100 */ &sra_k_rd, -/* 0010 1011 1101 */ &sra_k_rd, -/* 0010 1011 1110 */ &sra_k_rd, -/* 0010 1011 1111 */ &sra_k_rd, - -/* 0010 1100 0000 */ &srl_k_rd, -/* 0010 1100 0001 */ &srl_k_rd, -/* 0010 1100 0010 */ &srl_k_rd, -/* 0010 1100 0011 */ &srl_k_rd, -/* 0010 1100 0100 */ &srl_k_rd, -/* 0010 1100 0101 */ &srl_k_rd, -/* 0010 1100 0110 */ &srl_k_rd, -/* 0010 1100 0111 */ &srl_k_rd, -/* 0010 1100 1000 */ &srl_k_rd, -/* 0010 1100 1001 */ &srl_k_rd, -/* 0010 1100 1010 */ &srl_k_rd, -/* 0010 1100 1011 */ &srl_k_rd, -/* 0010 1100 1100 */ &srl_k_rd, -/* 0010 1100 1101 */ &srl_k_rd, -/* 0010 1100 1110 */ &srl_k_rd, -/* 0010 1100 1111 */ &srl_k_rd, - -/* 0010 1101 0000 */ &srl_k_rd, -/* 0010 1101 0001 */ &srl_k_rd, -/* 0010 1101 0010 */ &srl_k_rd, -/* 0010 1101 0011 */ &srl_k_rd, -/* 0010 1101 0100 */ &srl_k_rd, -/* 0010 1101 0101 */ &srl_k_rd, -/* 0010 1101 0110 */ &srl_k_rd, -/* 0010 1101 0111 */ &srl_k_rd, -/* 0010 1101 1000 */ &srl_k_rd, -/* 0010 1101 1001 */ &srl_k_rd, -/* 0010 1101 1010 */ &srl_k_rd, -/* 0010 1101 1011 */ &srl_k_rd, -/* 0010 1101 1100 */ &srl_k_rd, -/* 0010 1101 1101 */ &srl_k_rd, -/* 0010 1101 1110 */ &srl_k_rd, -/* 0010 1101 1111 */ &srl_k_rd, - -/* 0010 1110 0000 */ &srl_k_rd, -/* 0010 1110 0001 */ &srl_k_rd, -/* 0010 1110 0010 */ &srl_k_rd, -/* 0010 1110 0011 */ &srl_k_rd, -/* 0010 1110 0100 */ &srl_k_rd, -/* 0010 1110 0101 */ &srl_k_rd, -/* 0010 1110 0110 */ &srl_k_rd, -/* 0010 1110 0111 */ &srl_k_rd, -/* 0010 1110 1000 */ &srl_k_rd, -/* 0010 1110 1001 */ &srl_k_rd, -/* 0010 1110 1010 */ &srl_k_rd, -/* 0010 1110 1011 */ &srl_k_rd, -/* 0010 1110 1100 */ &srl_k_rd, -/* 0010 1110 1101 */ &srl_k_rd, -/* 0010 1110 1110 */ &srl_k_rd, -/* 0010 1110 1111 */ &srl_k_rd, - -/* 0010 1111 0000 */ &srl_k_rd, -/* 0010 1111 0001 */ &srl_k_rd, -/* 0010 1111 0010 */ &srl_k_rd, -/* 0010 1111 0011 */ &srl_k_rd, -/* 0010 1111 0100 */ &srl_k_rd, -/* 0010 1111 0101 */ &srl_k_rd, -/* 0010 1111 0110 */ &srl_k_rd, -/* 0010 1111 0111 */ &srl_k_rd, -/* 0010 1111 1000 */ &srl_k_rd, -/* 0010 1111 1001 */ &srl_k_rd, -/* 0010 1111 1010 */ &srl_k_rd, -/* 0010 1111 1011 */ &srl_k_rd, -/* 0010 1111 1100 */ &srl_k_rd, -/* 0010 1111 1101 */ &srl_k_rd, -/* 0010 1111 1110 */ &srl_k_rd, -/* 0010 1111 1111 */ &srl_k_rd, - -/* 0011 0000 0000 */ &rl_k_rd, -/* 0011 0000 0001 */ &rl_k_rd, -/* 0011 0000 0010 */ &rl_k_rd, -/* 0011 0000 0011 */ &rl_k_rd, -/* 0011 0000 0100 */ &rl_k_rd, -/* 0011 0000 0101 */ &rl_k_rd, -/* 0011 0000 0110 */ &rl_k_rd, -/* 0011 0000 0111 */ &rl_k_rd, -/* 0011 0000 1000 */ &rl_k_rd, -/* 0011 0000 1001 */ &rl_k_rd, -/* 0011 0000 1010 */ &rl_k_rd, -/* 0011 0000 1011 */ &rl_k_rd, -/* 0011 0000 1100 */ &rl_k_rd, -/* 0011 0000 1101 */ &rl_k_rd, -/* 0011 0000 1110 */ &rl_k_rd, -/* 0011 0000 1111 */ &rl_k_rd, - -/* 0011 0001 0000 */ &rl_k_rd, -/* 0011 0001 0001 */ &rl_k_rd, -/* 0011 0001 0010 */ &rl_k_rd, -/* 0011 0001 0011 */ &rl_k_rd, -/* 0011 0001 0100 */ &rl_k_rd, -/* 0011 0001 0101 */ &rl_k_rd, -/* 0011 0001 0110 */ &rl_k_rd, -/* 0011 0001 0111 */ &rl_k_rd, -/* 0011 0001 1000 */ &rl_k_rd, -/* 0011 0001 1001 */ &rl_k_rd, -/* 0011 0001 1010 */ &rl_k_rd, -/* 0011 0001 1011 */ &rl_k_rd, -/* 0011 0001 1100 */ &rl_k_rd, -/* 0011 0001 1101 */ &rl_k_rd, -/* 0011 0001 1110 */ &rl_k_rd, -/* 0011 0001 1111 */ &rl_k_rd, - -/* 0011 0010 0000 */ &rl_k_rd, -/* 0011 0010 0001 */ &rl_k_rd, -/* 0011 0010 0010 */ &rl_k_rd, -/* 0011 0010 0011 */ &rl_k_rd, -/* 0011 0010 0100 */ &rl_k_rd, -/* 0011 0010 0101 */ &rl_k_rd, -/* 0011 0010 0110 */ &rl_k_rd, -/* 0011 0010 0111 */ &rl_k_rd, -/* 0011 0010 1000 */ &rl_k_rd, -/* 0011 0010 1001 */ &rl_k_rd, -/* 0011 0010 1010 */ &rl_k_rd, -/* 0011 0010 1011 */ &rl_k_rd, -/* 0011 0010 1100 */ &rl_k_rd, -/* 0011 0010 1101 */ &rl_k_rd, -/* 0011 0010 1110 */ &rl_k_rd, -/* 0011 0010 1111 */ &rl_k_rd, - -/* 0011 0011 0000 */ &rl_k_rd, -/* 0011 0011 0001 */ &rl_k_rd, -/* 0011 0011 0010 */ &rl_k_rd, -/* 0011 0011 0011 */ &rl_k_rd, -/* 0011 0011 0100 */ &rl_k_rd, -/* 0011 0011 0101 */ &rl_k_rd, -/* 0011 0011 0110 */ &rl_k_rd, -/* 0011 0011 0111 */ &rl_k_rd, -/* 0011 0011 1000 */ &rl_k_rd, -/* 0011 0011 1001 */ &rl_k_rd, -/* 0011 0011 1010 */ &rl_k_rd, -/* 0011 0011 1011 */ &rl_k_rd, -/* 0011 0011 1100 */ &rl_k_rd, -/* 0011 0011 1101 */ &rl_k_rd, -/* 0011 0011 1110 */ &rl_k_rd, -/* 0011 0011 1111 */ &rl_k_rd, - -/* 0011 0100 0000 */ &unimplemented, -/* 0011 0100 0001 */ &unimplemented, -/* 0011 0100 0010 */ &unimplemented, -/* 0011 0100 0011 */ &unimplemented, -/* 0011 0100 0100 */ &unimplemented, -/* 0011 0100 0101 */ &unimplemented, -/* 0011 0100 0110 */ &unimplemented, -/* 0011 0100 0111 */ &unimplemented, -/* 0011 0100 1000 */ &unimplemented, -/* 0011 0100 1001 */ &unimplemented, -/* 0011 0100 1010 */ &unimplemented, -/* 0011 0100 1011 */ &unimplemented, -/* 0011 0100 1100 */ &unimplemented, -/* 0011 0100 1101 */ &unimplemented, -/* 0011 0100 1110 */ &unimplemented, -/* 0011 0100 1111 */ &unimplemented, - -/* 0011 0101 0000 */ &unimplemented, -/* 0011 0101 0001 */ &unimplemented, -/* 0011 0101 0010 */ &unimplemented, -/* 0011 0101 0011 */ &unimplemented, -/* 0011 0101 0100 */ &unimplemented, -/* 0011 0101 0101 */ &unimplemented, -/* 0011 0101 0110 */ &unimplemented, -/* 0011 0101 0111 */ &unimplemented, -/* 0011 0101 1000 */ &unimplemented, -/* 0011 0101 1001 */ &unimplemented, -/* 0011 0101 1010 */ &unimplemented, -/* 0011 0101 1011 */ &unimplemented, -/* 0011 0101 1100 */ &unimplemented, -/* 0011 0101 1101 */ &unimplemented, -/* 0011 0101 1110 */ &unimplemented, -/* 0011 0101 1111 */ &unimplemented, - -/* 0011 0110 0000 */ &unimplemented, -/* 0011 0110 0001 */ &unimplemented, -/* 0011 0110 0010 */ &unimplemented, -/* 0011 0110 0011 */ &unimplemented, -/* 0011 0110 0100 */ &unimplemented, -/* 0011 0110 0101 */ &unimplemented, -/* 0011 0110 0110 */ &unimplemented, -/* 0011 0110 0111 */ &unimplemented, -/* 0011 0110 1000 */ &unimplemented, -/* 0011 0110 1001 */ &unimplemented, -/* 0011 0110 1010 */ &unimplemented, -/* 0011 0110 1011 */ &unimplemented, -/* 0011 0110 1100 */ &unimplemented, -/* 0011 0110 1101 */ &unimplemented, -/* 0011 0110 1110 */ &unimplemented, -/* 0011 0110 1111 */ &unimplemented, - -/* 0011 0111 0000 */ &unimplemented, -/* 0011 0111 0001 */ &unimplemented, -/* 0011 0111 0010 */ &unimplemented, -/* 0011 0111 0011 */ &unimplemented, -/* 0011 0111 0100 */ &unimplemented, -/* 0011 0111 0101 */ &unimplemented, -/* 0011 0111 0110 */ &unimplemented, -/* 0011 0111 0111 */ &unimplemented, -/* 0011 0111 1000 */ &unimplemented, -/* 0011 0111 1001 */ &unimplemented, -/* 0011 0111 1010 */ &unimplemented, -/* 0011 0111 1011 */ &unimplemented, -/* 0011 0111 1100 */ &unimplemented, -/* 0011 0111 1101 */ &unimplemented, -/* 0011 0111 1110 */ &unimplemented, -/* 0011 0111 1111 */ &unimplemented, - -/* 0011 1000 0000 */ &dsjs, -/* 0011 1000 0001 */ &dsjs, -/* 0011 1000 0010 */ &dsjs, -/* 0011 1000 0011 */ &dsjs, -/* 0011 1000 0100 */ &dsjs, -/* 0011 1000 0101 */ &dsjs, -/* 0011 1000 0110 */ &dsjs, -/* 0011 1000 0111 */ &dsjs, -/* 0011 1000 1000 */ &dsjs, -/* 0011 1000 1001 */ &dsjs, -/* 0011 1000 1010 */ &dsjs, -/* 0011 1000 1011 */ &dsjs, -/* 0011 1000 1100 */ &dsjs, -/* 0011 1000 1101 */ &dsjs, -/* 0011 1000 1110 */ &dsjs, -/* 0011 1000 1111 */ &dsjs, - -/* 0011 1001 0000 */ &dsjs, -/* 0011 1001 0001 */ &dsjs, -/* 0011 1001 0010 */ &dsjs, -/* 0011 1001 0011 */ &dsjs, -/* 0011 1001 0100 */ &dsjs, -/* 0011 1001 0101 */ &dsjs, -/* 0011 1001 0110 */ &dsjs, -/* 0011 1001 0111 */ &dsjs, -/* 0011 1001 1000 */ &dsjs, -/* 0011 1001 1001 */ &dsjs, -/* 0011 1001 1010 */ &dsjs, -/* 0011 1001 1011 */ &dsjs, -/* 0011 1001 1100 */ &dsjs, -/* 0011 1001 1101 */ &dsjs, -/* 0011 1001 1110 */ &dsjs, -/* 0011 1001 1111 */ &dsjs, - -/* 0011 1010 0000 */ &dsjs, -/* 0011 1010 0001 */ &dsjs, -/* 0011 1010 0010 */ &dsjs, -/* 0011 1010 0011 */ &dsjs, -/* 0011 1010 0100 */ &dsjs, -/* 0011 1010 0101 */ &dsjs, -/* 0011 1010 0110 */ &dsjs, -/* 0011 1010 0111 */ &dsjs, -/* 0011 1010 1000 */ &dsjs, -/* 0011 1010 1001 */ &dsjs, -/* 0011 1010 1010 */ &dsjs, -/* 0011 1010 1011 */ &dsjs, -/* 0011 1010 1100 */ &dsjs, -/* 0011 1010 1101 */ &dsjs, -/* 0011 1010 1110 */ &dsjs, -/* 0011 1010 1111 */ &dsjs, - -/* 0011 1011 0000 */ &dsjs, -/* 0011 1011 0001 */ &dsjs, -/* 0011 1011 0010 */ &dsjs, -/* 0011 1011 0011 */ &dsjs, -/* 0011 1011 0100 */ &dsjs, -/* 0011 1011 0101 */ &dsjs, -/* 0011 1011 0110 */ &dsjs, -/* 0011 1011 0111 */ &dsjs, -/* 0011 1011 1000 */ &dsjs, -/* 0011 1011 1001 */ &dsjs, -/* 0011 1011 1010 */ &dsjs, -/* 0011 1011 1011 */ &dsjs, -/* 0011 1011 1100 */ &dsjs, -/* 0011 1011 1101 */ &dsjs, -/* 0011 1011 1110 */ &dsjs, -/* 0011 1011 1111 */ &dsjs, - -/* 0011 1100 0000 */ &dsjs, -/* 0011 1100 0001 */ &dsjs, -/* 0011 1100 0010 */ &dsjs, -/* 0011 1100 0011 */ &dsjs, -/* 0011 1100 0100 */ &dsjs, -/* 0011 1100 0101 */ &dsjs, -/* 0011 1100 0110 */ &dsjs, -/* 0011 1100 0111 */ &dsjs, -/* 0011 1100 1000 */ &dsjs, -/* 0011 1100 1001 */ &dsjs, -/* 0011 1100 1010 */ &dsjs, -/* 0011 1100 1011 */ &dsjs, -/* 0011 1100 1100 */ &dsjs, -/* 0011 1100 1101 */ &dsjs, -/* 0011 1100 1110 */ &dsjs, -/* 0011 1100 1111 */ &dsjs, - -/* 0011 1101 0000 */ &dsjs, -/* 0011 1101 0001 */ &dsjs, -/* 0011 1101 0010 */ &dsjs, -/* 0011 1101 0011 */ &dsjs, -/* 0011 1101 0100 */ &dsjs, -/* 0011 1101 0101 */ &dsjs, -/* 0011 1101 0110 */ &dsjs, -/* 0011 1101 0111 */ &dsjs, -/* 0011 1101 1000 */ &dsjs, -/* 0011 1101 1001 */ &dsjs, -/* 0011 1101 1010 */ &dsjs, -/* 0011 1101 1011 */ &dsjs, -/* 0011 1101 1100 */ &dsjs, -/* 0011 1101 1101 */ &dsjs, -/* 0011 1101 1110 */ &dsjs, -/* 0011 1101 1111 */ &dsjs, - -/* 0011 1110 0000 */ &dsjs, -/* 0011 1110 0001 */ &dsjs, -/* 0011 1110 0010 */ &dsjs, -/* 0011 1110 0011 */ &dsjs, -/* 0011 1110 0100 */ &dsjs, -/* 0011 1110 0101 */ &dsjs, -/* 0011 1110 0110 */ &dsjs, -/* 0011 1110 0111 */ &dsjs, -/* 0011 1110 1000 */ &dsjs, -/* 0011 1110 1001 */ &dsjs, -/* 0011 1110 1010 */ &dsjs, -/* 0011 1110 1011 */ &dsjs, -/* 0011 1110 1100 */ &dsjs, -/* 0011 1110 1101 */ &dsjs, -/* 0011 1110 1110 */ &dsjs, -/* 0011 1110 1111 */ &dsjs, - -/* 0011 1111 0000 */ &dsjs, -/* 0011 1111 0001 */ &dsjs, -/* 0011 1111 0010 */ &dsjs, -/* 0011 1111 0011 */ &dsjs, -/* 0011 1111 0100 */ &dsjs, -/* 0011 1111 0101 */ &dsjs, -/* 0011 1111 0110 */ &dsjs, -/* 0011 1111 0111 */ &dsjs, -/* 0011 1111 1000 */ &dsjs, -/* 0011 1111 1001 */ &dsjs, -/* 0011 1111 1010 */ &dsjs, -/* 0011 1111 1011 */ &dsjs, -/* 0011 1111 1100 */ &dsjs, -/* 0011 1111 1101 */ &dsjs, -/* 0011 1111 1110 */ &dsjs, -/* 0011 1111 1111 */ &dsjs, - -/* 0100 0000 0000 */ &add_rs_rd, -/* 0100 0000 0001 */ &add_rs_rd, -/* 0100 0000 0010 */ &add_rs_rd, -/* 0100 0000 0011 */ &add_rs_rd, -/* 0100 0000 0100 */ &add_rs_rd, -/* 0100 0000 0101 */ &add_rs_rd, -/* 0100 0000 0110 */ &add_rs_rd, -/* 0100 0000 0111 */ &add_rs_rd, -/* 0100 0000 1000 */ &add_rs_rd, -/* 0100 0000 1001 */ &add_rs_rd, -/* 0100 0000 1010 */ &add_rs_rd, -/* 0100 0000 1011 */ &add_rs_rd, -/* 0100 0000 1100 */ &add_rs_rd, -/* 0100 0000 1101 */ &add_rs_rd, -/* 0100 0000 1110 */ &add_rs_rd, -/* 0100 0000 1111 */ &add_rs_rd, - -/* 0100 0001 0000 */ &add_rs_rd, -/* 0100 0001 0001 */ &add_rs_rd, -/* 0100 0001 0010 */ &add_rs_rd, -/* 0100 0001 0011 */ &add_rs_rd, -/* 0100 0001 0100 */ &add_rs_rd, -/* 0100 0001 0101 */ &add_rs_rd, -/* 0100 0001 0110 */ &add_rs_rd, -/* 0100 0001 0111 */ &add_rs_rd, -/* 0100 0001 1000 */ &add_rs_rd, -/* 0100 0001 1001 */ &add_rs_rd, -/* 0100 0001 1010 */ &add_rs_rd, -/* 0100 0001 1011 */ &add_rs_rd, -/* 0100 0001 1100 */ &add_rs_rd, -/* 0100 0001 1101 */ &add_rs_rd, -/* 0100 0001 1110 */ &add_rs_rd, -/* 0100 0001 1111 */ &add_rs_rd, - -/* 0100 0010 0000 */ &addc_rs_rd, -/* 0100 0010 0001 */ &addc_rs_rd, -/* 0100 0010 0010 */ &addc_rs_rd, -/* 0100 0010 0011 */ &addc_rs_rd, -/* 0100 0010 0100 */ &addc_rs_rd, -/* 0100 0010 0101 */ &addc_rs_rd, -/* 0100 0010 0110 */ &addc_rs_rd, -/* 0100 0010 0111 */ &addc_rs_rd, -/* 0100 0010 1000 */ &addc_rs_rd, -/* 0100 0010 1001 */ &addc_rs_rd, -/* 0100 0010 1010 */ &addc_rs_rd, -/* 0100 0010 1011 */ &addc_rs_rd, -/* 0100 0010 1100 */ &addc_rs_rd, -/* 0100 0010 1101 */ &addc_rs_rd, -/* 0100 0010 1110 */ &addc_rs_rd, -/* 0100 0010 1111 */ &addc_rs_rd, - -/* 0100 0011 0000 */ &addc_rs_rd, -/* 0100 0011 0001 */ &addc_rs_rd, -/* 0100 0011 0010 */ &addc_rs_rd, -/* 0100 0011 0011 */ &addc_rs_rd, -/* 0100 0011 0100 */ &addc_rs_rd, -/* 0100 0011 0101 */ &addc_rs_rd, -/* 0100 0011 0110 */ &addc_rs_rd, -/* 0100 0011 0111 */ &addc_rs_rd, -/* 0100 0011 1000 */ &addc_rs_rd, -/* 0100 0011 1001 */ &addc_rs_rd, -/* 0100 0011 1010 */ &addc_rs_rd, -/* 0100 0011 1011 */ &addc_rs_rd, -/* 0100 0011 1100 */ &addc_rs_rd, -/* 0100 0011 1101 */ &addc_rs_rd, -/* 0100 0011 1110 */ &addc_rs_rd, -/* 0100 0011 1111 */ &addc_rs_rd, - -/* 0100 0100 0000 */ &sub_rs_rd, -/* 0100 0100 0001 */ &sub_rs_rd, -/* 0100 0100 0010 */ &sub_rs_rd, -/* 0100 0100 0011 */ &sub_rs_rd, -/* 0100 0100 0100 */ &sub_rs_rd, -/* 0100 0100 0101 */ &sub_rs_rd, -/* 0100 0100 0110 */ &sub_rs_rd, -/* 0100 0100 0111 */ &sub_rs_rd, -/* 0100 0100 1000 */ &sub_rs_rd, -/* 0100 0100 1001 */ &sub_rs_rd, -/* 0100 0100 1010 */ &sub_rs_rd, -/* 0100 0100 1011 */ &sub_rs_rd, -/* 0100 0100 1100 */ &sub_rs_rd, -/* 0100 0100 1101 */ &sub_rs_rd, -/* 0100 0100 1110 */ &sub_rs_rd, -/* 0100 0100 1111 */ &sub_rs_rd, - -/* 0100 0101 0000 */ &sub_rs_rd, -/* 0100 0101 0001 */ &sub_rs_rd, -/* 0100 0101 0010 */ &sub_rs_rd, -/* 0100 0101 0011 */ &sub_rs_rd, -/* 0100 0101 0100 */ &sub_rs_rd, -/* 0100 0101 0101 */ &sub_rs_rd, -/* 0100 0101 0110 */ &sub_rs_rd, -/* 0100 0101 0111 */ &sub_rs_rd, -/* 0100 0101 1000 */ &sub_rs_rd, -/* 0100 0101 1001 */ &sub_rs_rd, -/* 0100 0101 1010 */ &sub_rs_rd, -/* 0100 0101 1011 */ &sub_rs_rd, -/* 0100 0101 1100 */ &sub_rs_rd, -/* 0100 0101 1101 */ &sub_rs_rd, -/* 0100 0101 1110 */ &sub_rs_rd, -/* 0100 0101 1111 */ &sub_rs_rd, - -/* 0100 0110 0000 */ &unimplemented, -/* 0100 0110 0001 */ &unimplemented, -/* 0100 0110 0010 */ &unimplemented, -/* 0100 0110 0011 */ &unimplemented, -/* 0100 0110 0100 */ &unimplemented, -/* 0100 0110 0101 */ &unimplemented, -/* 0100 0110 0110 */ &unimplemented, -/* 0100 0110 0111 */ &unimplemented, -/* 0100 0110 1000 */ &unimplemented, -/* 0100 0110 1001 */ &unimplemented, -/* 0100 0110 1010 */ &unimplemented, -/* 0100 0110 1011 */ &unimplemented, -/* 0100 0110 1100 */ &unimplemented, -/* 0100 0110 1101 */ &unimplemented, -/* 0100 0110 1110 */ &unimplemented, -/* 0100 0110 1111 */ &unimplemented, - -/* 0100 0111 0000 */ &unimplemented, -/* 0100 0111 0001 */ &unimplemented, -/* 0100 0111 0010 */ &unimplemented, -/* 0100 0111 0011 */ &unimplemented, -/* 0100 0111 0100 */ &unimplemented, -/* 0100 0111 0101 */ &unimplemented, -/* 0100 0111 0110 */ &unimplemented, -/* 0100 0111 0111 */ &unimplemented, -/* 0100 0111 1000 */ &unimplemented, -/* 0100 0111 1001 */ &unimplemented, -/* 0100 0111 1010 */ &unimplemented, -/* 0100 0111 1011 */ &unimplemented, -/* 0100 0111 1100 */ &unimplemented, -/* 0100 0111 1101 */ &unimplemented, -/* 0100 0111 1110 */ &unimplemented, -/* 0100 0111 1111 */ &unimplemented, - -/* 0100 1000 0000 */ &cmp_rs_rd, -/* 0100 1000 0001 */ &cmp_rs_rd, -/* 0100 1000 0010 */ &cmp_rs_rd, -/* 0100 1000 0011 */ &cmp_rs_rd, -/* 0100 1000 0100 */ &cmp_rs_rd, -/* 0100 1000 0101 */ &cmp_rs_rd, -/* 0100 1000 0110 */ &cmp_rs_rd, -/* 0100 1000 0111 */ &cmp_rs_rd, -/* 0100 1000 1000 */ &cmp_rs_rd, -/* 0100 1000 1001 */ &cmp_rs_rd, -/* 0100 1000 1010 */ &cmp_rs_rd, -/* 0100 1000 1011 */ &cmp_rs_rd, -/* 0100 1000 1100 */ &cmp_rs_rd, -/* 0100 1000 1101 */ &cmp_rs_rd, -/* 0100 1000 1110 */ &cmp_rs_rd, -/* 0100 1000 1111 */ &cmp_rs_rd, - -/* 0100 1001 0000 */ &cmp_rs_rd, -/* 0100 1001 0001 */ &cmp_rs_rd, -/* 0100 1001 0010 */ &cmp_rs_rd, -/* 0100 1001 0011 */ &cmp_rs_rd, -/* 0100 1001 0100 */ &cmp_rs_rd, -/* 0100 1001 0101 */ &cmp_rs_rd, -/* 0100 1001 0110 */ &cmp_rs_rd, -/* 0100 1001 0111 */ &cmp_rs_rd, -/* 0100 1001 1000 */ &cmp_rs_rd, -/* 0100 1001 1001 */ &cmp_rs_rd, -/* 0100 1001 1010 */ &cmp_rs_rd, -/* 0100 1001 1011 */ &cmp_rs_rd, -/* 0100 1001 1100 */ &cmp_rs_rd, -/* 0100 1001 1101 */ &cmp_rs_rd, -/* 0100 1001 1110 */ &cmp_rs_rd, -/* 0100 1001 1111 */ &cmp_rs_rd, - -/* 0100 1010 0000 */ &btst_rs_rd, -/* 0100 1010 0001 */ &btst_rs_rd, -/* 0100 1010 0010 */ &btst_rs_rd, -/* 0100 1010 0011 */ &btst_rs_rd, -/* 0100 1010 0100 */ &btst_rs_rd, -/* 0100 1010 0101 */ &btst_rs_rd, -/* 0100 1010 0110 */ &btst_rs_rd, -/* 0100 1010 0111 */ &btst_rs_rd, -/* 0100 1010 1000 */ &btst_rs_rd, -/* 0100 1010 1001 */ &btst_rs_rd, -/* 0100 1010 1010 */ &btst_rs_rd, -/* 0100 1010 1011 */ &btst_rs_rd, -/* 0100 1010 1100 */ &btst_rs_rd, -/* 0100 1010 1101 */ &btst_rs_rd, -/* 0100 1010 1110 */ &btst_rs_rd, -/* 0100 1010 1111 */ &btst_rs_rd, - -/* 0100 1011 0000 */ &btst_rs_rd, -/* 0100 1011 0001 */ &btst_rs_rd, -/* 0100 1011 0010 */ &btst_rs_rd, -/* 0100 1011 0011 */ &btst_rs_rd, -/* 0100 1011 0100 */ &btst_rs_rd, -/* 0100 1011 0101 */ &btst_rs_rd, -/* 0100 1011 0110 */ &btst_rs_rd, -/* 0100 1011 0111 */ &btst_rs_rd, -/* 0100 1011 1000 */ &btst_rs_rd, -/* 0100 1011 1001 */ &btst_rs_rd, -/* 0100 1011 1010 */ &btst_rs_rd, -/* 0100 1011 1011 */ &btst_rs_rd, -/* 0100 1011 1100 */ &btst_rs_rd, -/* 0100 1011 1101 */ &btst_rs_rd, -/* 0100 1011 1110 */ &btst_rs_rd, -/* 0100 1011 1111 */ &btst_rs_rd, - -/* 0100 1100 0000 */ &move_rs_rd, -/* 0100 1100 0001 */ &move_rs_rd, -/* 0100 1100 0010 */ &move_rs_rd, -/* 0100 1100 0011 */ &move_rs_rd, -/* 0100 1100 0100 */ &move_rs_rd, -/* 0100 1100 0101 */ &move_rs_rd, -/* 0100 1100 0110 */ &move_rs_rd, -/* 0100 1100 0111 */ &move_rs_rd, -/* 0100 1100 1000 */ &move_rs_rd, -/* 0100 1100 1001 */ &move_rs_rd, -/* 0100 1100 1010 */ &move_rs_rd, -/* 0100 1100 1011 */ &move_rs_rd, -/* 0100 1100 1100 */ &move_rs_rd, -/* 0100 1100 1101 */ &move_rs_rd, -/* 0100 1100 1110 */ &move_rs_rd, -/* 0100 1100 1111 */ &move_rs_rd, - -/* 0100 1101 0000 */ &move_rs_rd, -/* 0100 1101 0001 */ &move_rs_rd, -/* 0100 1101 0010 */ &move_rs_rd, -/* 0100 1101 0011 */ &move_rs_rd, -/* 0100 1101 0100 */ &move_rs_rd, -/* 0100 1101 0101 */ &move_rs_rd, -/* 0100 1101 0110 */ &move_rs_rd, -/* 0100 1101 0111 */ &move_rs_rd, -/* 0100 1101 1000 */ &move_rs_rd, -/* 0100 1101 1001 */ &move_rs_rd, -/* 0100 1101 1010 */ &move_rs_rd, -/* 0100 1101 1011 */ &move_rs_rd, -/* 0100 1101 1100 */ &move_rs_rd, -/* 0100 1101 1101 */ &move_rs_rd, -/* 0100 1101 1110 */ &move_rs_rd, -/* 0100 1101 1111 */ &move_rs_rd, - -/* 0100 1110 0000 */ &move_rs_rd_a, -/* 0100 1110 0001 */ &move_rs_rd_b, -/* 0100 1110 0010 */ &move_rs_rd_a, -/* 0100 1110 0011 */ &move_rs_rd_b, -/* 0100 1110 0100 */ &move_rs_rd_a, -/* 0100 1110 0101 */ &move_rs_rd_b, -/* 0100 1110 0110 */ &move_rs_rd_a, -/* 0100 1110 0111 */ &move_rs_rd_b, -/* 0100 1110 1000 */ &move_rs_rd_a, -/* 0100 1110 1001 */ &move_rs_rd_b, -/* 0100 1110 1010 */ &move_rs_rd_a, -/* 0100 1110 1011 */ &move_rs_rd_b, -/* 0100 1110 1100 */ &move_rs_rd_a, -/* 0100 1110 1101 */ &move_rs_rd_b, -/* 0100 1110 1110 */ &move_rs_rd_a, -/* 0100 1110 1111 */ &move_rs_rd_b, - -/* 0100 1111 0000 */ &move_rs_rd_a, -/* 0100 1111 0001 */ &move_rs_rd_b, -/* 0100 1111 0010 */ &move_rs_rd_a, -/* 0100 1111 0011 */ &move_rs_rd_b, -/* 0100 1111 0100 */ &move_rs_rd_a, -/* 0100 1111 0101 */ &move_rs_rd_b, -/* 0100 1111 0110 */ &move_rs_rd_a, -/* 0100 1111 0111 */ &move_rs_rd_b, -/* 0100 1111 1000 */ &move_rs_rd_a, -/* 0100 1111 1001 */ &move_rs_rd_b, -/* 0100 1111 1010 */ &move_rs_rd_a, -/* 0100 1111 1011 */ &move_rs_rd_b, -/* 0100 1111 1100 */ &move_rs_rd_a, -/* 0100 1111 1101 */ &move_rs_rd_b, -/* 0100 1111 1110 */ &move_rs_rd_a, -/* 0100 1111 1111 */ &move_rs_rd_b, - -/* 0101 0000 0000 */ &and_rs_rd, -/* 0101 0000 0001 */ &and_rs_rd, -/* 0101 0000 0010 */ &and_rs_rd, -/* 0101 0000 0011 */ &and_rs_rd, -/* 0101 0000 0100 */ &and_rs_rd, -/* 0101 0000 0101 */ &and_rs_rd, -/* 0101 0000 0110 */ &and_rs_rd, -/* 0101 0000 0111 */ &and_rs_rd, -/* 0101 0000 1000 */ &and_rs_rd, -/* 0101 0000 1001 */ &and_rs_rd, -/* 0101 0000 1010 */ &and_rs_rd, -/* 0101 0000 1011 */ &and_rs_rd, -/* 0101 0000 1100 */ &and_rs_rd, -/* 0101 0000 1101 */ &and_rs_rd, -/* 0101 0000 1110 */ &and_rs_rd, -/* 0101 0000 1111 */ &and_rs_rd, - -/* 0101 0001 0000 */ &and_rs_rd, -/* 0101 0001 0001 */ &and_rs_rd, -/* 0101 0001 0010 */ &and_rs_rd, -/* 0101 0001 0011 */ &and_rs_rd, -/* 0101 0001 0100 */ &and_rs_rd, -/* 0101 0001 0101 */ &and_rs_rd, -/* 0101 0001 0110 */ &and_rs_rd, -/* 0101 0001 0111 */ &and_rs_rd, -/* 0101 0001 1000 */ &and_rs_rd, -/* 0101 0001 1001 */ &and_rs_rd, -/* 0101 0001 1010 */ &and_rs_rd, -/* 0101 0001 1011 */ &and_rs_rd, -/* 0101 0001 1100 */ &and_rs_rd, -/* 0101 0001 1101 */ &and_rs_rd, -/* 0101 0001 1110 */ &and_rs_rd, -/* 0101 0001 1111 */ &and_rs_rd, - -/* 0101 0010 0000 */ &andn_rs_rd, -/* 0101 0010 0001 */ &andn_rs_rd, -/* 0101 0010 0010 */ &andn_rs_rd, -/* 0101 0010 0011 */ &andn_rs_rd, -/* 0101 0010 0100 */ &andn_rs_rd, -/* 0101 0010 0101 */ &andn_rs_rd, -/* 0101 0010 0110 */ &andn_rs_rd, -/* 0101 0010 0111 */ &andn_rs_rd, -/* 0101 0010 1000 */ &andn_rs_rd, -/* 0101 0010 1001 */ &andn_rs_rd, -/* 0101 0010 1010 */ &andn_rs_rd, -/* 0101 0010 1011 */ &andn_rs_rd, -/* 0101 0010 1100 */ &andn_rs_rd, -/* 0101 0010 1101 */ &andn_rs_rd, -/* 0101 0010 1110 */ &andn_rs_rd, -/* 0101 0010 1111 */ &andn_rs_rd, - -/* 0101 0011 0000 */ &andn_rs_rd, -/* 0101 0011 0001 */ &andn_rs_rd, -/* 0101 0011 0010 */ &andn_rs_rd, -/* 0101 0011 0011 */ &andn_rs_rd, -/* 0101 0011 0100 */ &andn_rs_rd, -/* 0101 0011 0101 */ &andn_rs_rd, -/* 0101 0011 0110 */ &andn_rs_rd, -/* 0101 0011 0111 */ &andn_rs_rd, -/* 0101 0011 1000 */ &andn_rs_rd, -/* 0101 0011 1001 */ &andn_rs_rd, -/* 0101 0011 1010 */ &andn_rs_rd, -/* 0101 0011 1011 */ &andn_rs_rd, -/* 0101 0011 1100 */ &andn_rs_rd, -/* 0101 0011 1101 */ &andn_rs_rd, -/* 0101 0011 1110 */ &andn_rs_rd, -/* 0101 0011 1111 */ &andn_rs_rd, - -/* 0101 0100 0000 */ &or_rs_rd, -/* 0101 0100 0001 */ &or_rs_rd, -/* 0101 0100 0010 */ &or_rs_rd, -/* 0101 0100 0011 */ &or_rs_rd, -/* 0101 0100 0100 */ &or_rs_rd, -/* 0101 0100 0101 */ &or_rs_rd, -/* 0101 0100 0110 */ &or_rs_rd, -/* 0101 0100 0111 */ &or_rs_rd, -/* 0101 0100 1000 */ &or_rs_rd, -/* 0101 0100 1001 */ &or_rs_rd, -/* 0101 0100 1010 */ &or_rs_rd, -/* 0101 0100 1011 */ &or_rs_rd, -/* 0101 0100 1100 */ &or_rs_rd, -/* 0101 0100 1101 */ &or_rs_rd, -/* 0101 0100 1110 */ &or_rs_rd, -/* 0101 0100 1111 */ &or_rs_rd, - -/* 0101 0101 0000 */ &or_rs_rd, -/* 0101 0101 0001 */ &or_rs_rd, -/* 0101 0101 0010 */ &or_rs_rd, -/* 0101 0101 0011 */ &or_rs_rd, -/* 0101 0101 0100 */ &or_rs_rd, -/* 0101 0101 0101 */ &or_rs_rd, -/* 0101 0101 0110 */ &or_rs_rd, -/* 0101 0101 0111 */ &or_rs_rd, -/* 0101 0101 1000 */ &or_rs_rd, -/* 0101 0101 1001 */ &or_rs_rd, -/* 0101 0101 1010 */ &or_rs_rd, -/* 0101 0101 1011 */ &or_rs_rd, -/* 0101 0101 1100 */ &or_rs_rd, -/* 0101 0101 1101 */ &or_rs_rd, -/* 0101 0101 1110 */ &or_rs_rd, -/* 0101 0101 1111 */ &or_rs_rd, - -/* 0101 0110 0000 */ &xor_rs_rd, -/* 0101 0110 0001 */ &xor_rs_rd, -/* 0101 0110 0010 */ &xor_rs_rd, -/* 0101 0110 0011 */ &xor_rs_rd, -/* 0101 0110 0100 */ &xor_rs_rd, -/* 0101 0110 0101 */ &xor_rs_rd, -/* 0101 0110 0110 */ &xor_rs_rd, -/* 0101 0110 0111 */ &xor_rs_rd, -/* 0101 0110 1000 */ &xor_rs_rd, -/* 0101 0110 1001 */ &xor_rs_rd, -/* 0101 0110 1010 */ &xor_rs_rd, -/* 0101 0110 1011 */ &xor_rs_rd, -/* 0101 0110 1100 */ &xor_rs_rd, -/* 0101 0110 1101 */ &xor_rs_rd, -/* 0101 0110 1110 */ &xor_rs_rd, -/* 0101 0110 1111 */ &xor_rs_rd, - -/* 0101 0111 0000 */ &xor_rs_rd, -/* 0101 0111 0001 */ &xor_rs_rd, -/* 0101 0111 0010 */ &xor_rs_rd, -/* 0101 0111 0011 */ &xor_rs_rd, -/* 0101 0111 0100 */ &xor_rs_rd, -/* 0101 0111 0101 */ &xor_rs_rd, -/* 0101 0111 0110 */ &xor_rs_rd, -/* 0101 0111 0111 */ &xor_rs_rd, -/* 0101 0111 1000 */ &xor_rs_rd, -/* 0101 0111 1001 */ &xor_rs_rd, -/* 0101 0111 1010 */ &xor_rs_rd, -/* 0101 0111 1011 */ &xor_rs_rd, -/* 0101 0111 1100 */ &xor_rs_rd, -/* 0101 0111 1101 */ &xor_rs_rd, -/* 0101 0111 1110 */ &xor_rs_rd, -/* 0101 0111 1111 */ &xor_rs_rd, - -/* 0101 1000 0000 */ &divs_rs_rd, -/* 0101 1000 0001 */ &divs_rs_rd, -/* 0101 1000 0010 */ &divs_rs_rd, -/* 0101 1000 0011 */ &divs_rs_rd, -/* 0101 1000 0100 */ &divs_rs_rd, -/* 0101 1000 0101 */ &divs_rs_rd, -/* 0101 1000 0110 */ &divs_rs_rd, -/* 0101 1000 0111 */ &divs_rs_rd, -/* 0101 1000 1000 */ &divs_rs_rd, -/* 0101 1000 1001 */ &divs_rs_rd, -/* 0101 1000 1010 */ &divs_rs_rd, -/* 0101 1000 1011 */ &divs_rs_rd, -/* 0101 1000 1100 */ &divs_rs_rd, -/* 0101 1000 1101 */ &divs_rs_rd, -/* 0101 1000 1110 */ &divs_rs_rd, -/* 0101 1000 1111 */ &divs_rs_rd, - -/* 0101 1001 0000 */ &divs_rs_rd, -/* 0101 1001 0001 */ &divs_rs_rd, -/* 0101 1001 0010 */ &divs_rs_rd, -/* 0101 1001 0011 */ &divs_rs_rd, -/* 0101 1001 0100 */ &divs_rs_rd, -/* 0101 1001 0101 */ &divs_rs_rd, -/* 0101 1001 0110 */ &divs_rs_rd, -/* 0101 1001 0111 */ &divs_rs_rd, -/* 0101 1001 1000 */ &divs_rs_rd, -/* 0101 1001 1001 */ &divs_rs_rd, -/* 0101 1001 1010 */ &divs_rs_rd, -/* 0101 1001 1011 */ &divs_rs_rd, -/* 0101 1001 1100 */ &divs_rs_rd, -/* 0101 1001 1101 */ &divs_rs_rd, -/* 0101 1001 1110 */ &divs_rs_rd, -/* 0101 1001 1111 */ &divs_rs_rd, - -/* 0101 1010 0000 */ &divu_rs_rd, -/* 0101 1010 0001 */ &divu_rs_rd, -/* 0101 1010 0010 */ &divu_rs_rd, -/* 0101 1010 0011 */ &divu_rs_rd, -/* 0101 1010 0100 */ &divu_rs_rd, -/* 0101 1010 0101 */ &divu_rs_rd, -/* 0101 1010 0110 */ &divu_rs_rd, -/* 0101 1010 0111 */ &divu_rs_rd, -/* 0101 1010 1000 */ &divu_rs_rd, -/* 0101 1010 1001 */ &divu_rs_rd, -/* 0101 1010 1010 */ &divu_rs_rd, -/* 0101 1010 1011 */ &divu_rs_rd, -/* 0101 1010 1100 */ &divu_rs_rd, -/* 0101 1010 1101 */ &divu_rs_rd, -/* 0101 1010 1110 */ &divu_rs_rd, -/* 0101 1010 1111 */ &divu_rs_rd, - -/* 0101 1011 0000 */ &divu_rs_rd, -/* 0101 1011 0001 */ &divu_rs_rd, -/* 0101 1011 0010 */ &divu_rs_rd, -/* 0101 1011 0011 */ &divu_rs_rd, -/* 0101 1011 0100 */ &divu_rs_rd, -/* 0101 1011 0101 */ &divu_rs_rd, -/* 0101 1011 0110 */ &divu_rs_rd, -/* 0101 1011 0111 */ &divu_rs_rd, -/* 0101 1011 1000 */ &divu_rs_rd, -/* 0101 1011 1001 */ &divu_rs_rd, -/* 0101 1011 1010 */ &divu_rs_rd, -/* 0101 1011 1011 */ &divu_rs_rd, -/* 0101 1011 1100 */ &divu_rs_rd, -/* 0101 1011 1101 */ &divu_rs_rd, -/* 0101 1011 1110 */ &divu_rs_rd, -/* 0101 1011 1111 */ &divu_rs_rd, - -/* 0101 1100 0000 */ &mpys_rs_rd, -/* 0101 1100 0001 */ &mpys_rs_rd, -/* 0101 1100 0010 */ &mpys_rs_rd, -/* 0101 1100 0011 */ &mpys_rs_rd, -/* 0101 1100 0100 */ &mpys_rs_rd, -/* 0101 1100 0101 */ &mpys_rs_rd, -/* 0101 1100 0110 */ &mpys_rs_rd, -/* 0101 1100 0111 */ &mpys_rs_rd, -/* 0101 1100 1000 */ &mpys_rs_rd, -/* 0101 1100 1001 */ &mpys_rs_rd, -/* 0101 1100 1010 */ &mpys_rs_rd, -/* 0101 1100 1011 */ &mpys_rs_rd, -/* 0101 1100 1100 */ &mpys_rs_rd, -/* 0101 1100 1101 */ &mpys_rs_rd, -/* 0101 1100 1110 */ &mpys_rs_rd, -/* 0101 1100 1111 */ &mpys_rs_rd, - -/* 0101 1101 0000 */ &mpys_rs_rd, -/* 0101 1101 0001 */ &mpys_rs_rd, -/* 0101 1101 0010 */ &mpys_rs_rd, -/* 0101 1101 0011 */ &mpys_rs_rd, -/* 0101 1101 0100 */ &mpys_rs_rd, -/* 0101 1101 0101 */ &mpys_rs_rd, -/* 0101 1101 0110 */ &mpys_rs_rd, -/* 0101 1101 0111 */ &mpys_rs_rd, -/* 0101 1101 1000 */ &mpys_rs_rd, -/* 0101 1101 1001 */ &mpys_rs_rd, -/* 0101 1101 1010 */ &mpys_rs_rd, -/* 0101 1101 1011 */ &mpys_rs_rd, -/* 0101 1101 1100 */ &mpys_rs_rd, -/* 0101 1101 1101 */ &mpys_rs_rd, -/* 0101 1101 1110 */ &mpys_rs_rd, -/* 0101 1101 1111 */ &mpys_rs_rd, - -/* 0101 1110 0000 */ &mpyu_rs_rd, -/* 0101 1110 0001 */ &mpyu_rs_rd, -/* 0101 1110 0010 */ &mpyu_rs_rd, -/* 0101 1110 0011 */ &mpyu_rs_rd, -/* 0101 1110 0100 */ &mpyu_rs_rd, -/* 0101 1110 0101 */ &mpyu_rs_rd, -/* 0101 1110 0110 */ &mpyu_rs_rd, -/* 0101 1110 0111 */ &mpyu_rs_rd, -/* 0101 1110 1000 */ &mpyu_rs_rd, -/* 0101 1110 1001 */ &mpyu_rs_rd, -/* 0101 1110 1010 */ &mpyu_rs_rd, -/* 0101 1110 1011 */ &mpyu_rs_rd, -/* 0101 1110 1100 */ &mpyu_rs_rd, -/* 0101 1110 1101 */ &mpyu_rs_rd, -/* 0101 1110 1110 */ &mpyu_rs_rd, -/* 0101 1110 1111 */ &mpyu_rs_rd, - -/* 0101 1111 0000 */ &mpyu_rs_rd, -/* 0101 1111 0001 */ &mpyu_rs_rd, -/* 0101 1111 0010 */ &mpyu_rs_rd, -/* 0101 1111 0011 */ &mpyu_rs_rd, -/* 0101 1111 0100 */ &mpyu_rs_rd, -/* 0101 1111 0101 */ &mpyu_rs_rd, -/* 0101 1111 0110 */ &mpyu_rs_rd, -/* 0101 1111 0111 */ &mpyu_rs_rd, -/* 0101 1111 1000 */ &mpyu_rs_rd, -/* 0101 1111 1001 */ &mpyu_rs_rd, -/* 0101 1111 1010 */ &mpyu_rs_rd, -/* 0101 1111 1011 */ &mpyu_rs_rd, -/* 0101 1111 1100 */ &mpyu_rs_rd, -/* 0101 1111 1101 */ &mpyu_rs_rd, -/* 0101 1111 1110 */ &mpyu_rs_rd, -/* 0101 1111 1111 */ &mpyu_rs_rd, - -/* 0110 0000 0000 */ &sla_rs_rd, -/* 0110 0000 0001 */ &sla_rs_rd, -/* 0110 0000 0010 */ &sla_rs_rd, -/* 0110 0000 0011 */ &sla_rs_rd, -/* 0110 0000 0100 */ &sla_rs_rd, -/* 0110 0000 0101 */ &sla_rs_rd, -/* 0110 0000 0110 */ &sla_rs_rd, -/* 0110 0000 0111 */ &sla_rs_rd, -/* 0110 0000 1000 */ &sla_rs_rd, -/* 0110 0000 1001 */ &sla_rs_rd, -/* 0110 0000 1010 */ &sla_rs_rd, -/* 0110 0000 1011 */ &sla_rs_rd, -/* 0110 0000 1100 */ &sla_rs_rd, -/* 0110 0000 1101 */ &sla_rs_rd, -/* 0110 0000 1110 */ &sla_rs_rd, -/* 0110 0000 1111 */ &sla_rs_rd, - -/* 0110 0001 0000 */ &sla_rs_rd, -/* 0110 0001 0001 */ &sla_rs_rd, -/* 0110 0001 0010 */ &sla_rs_rd, -/* 0110 0001 0011 */ &sla_rs_rd, -/* 0110 0001 0100 */ &sla_rs_rd, -/* 0110 0001 0101 */ &sla_rs_rd, -/* 0110 0001 0110 */ &sla_rs_rd, -/* 0110 0001 0111 */ &sla_rs_rd, -/* 0110 0001 1000 */ &sla_rs_rd, -/* 0110 0001 1001 */ &sla_rs_rd, -/* 0110 0001 1010 */ &sla_rs_rd, -/* 0110 0001 1011 */ &sla_rs_rd, -/* 0110 0001 1100 */ &sla_rs_rd, -/* 0110 0001 1101 */ &sla_rs_rd, -/* 0110 0001 1110 */ &sla_rs_rd, -/* 0110 0001 1111 */ &sla_rs_rd, - -/* 0110 0010 0000 */ &sll_rs_rd, -/* 0110 0010 0001 */ &sll_rs_rd, -/* 0110 0010 0010 */ &sll_rs_rd, -/* 0110 0010 0011 */ &sll_rs_rd, -/* 0110 0010 0100 */ &sll_rs_rd, -/* 0110 0010 0101 */ &sll_rs_rd, -/* 0110 0010 0110 */ &sll_rs_rd, -/* 0110 0010 0111 */ &sll_rs_rd, -/* 0110 0010 1000 */ &sll_rs_rd, -/* 0110 0010 1001 */ &sll_rs_rd, -/* 0110 0010 1010 */ &sll_rs_rd, -/* 0110 0010 1011 */ &sll_rs_rd, -/* 0110 0010 1100 */ &sll_rs_rd, -/* 0110 0010 1101 */ &sll_rs_rd, -/* 0110 0010 1110 */ &sll_rs_rd, -/* 0110 0010 1111 */ &sll_rs_rd, - -/* 0110 0011 0000 */ &sll_rs_rd, -/* 0110 0011 0001 */ &sll_rs_rd, -/* 0110 0011 0010 */ &sll_rs_rd, -/* 0110 0011 0011 */ &sll_rs_rd, -/* 0110 0011 0100 */ &sll_rs_rd, -/* 0110 0011 0101 */ &sll_rs_rd, -/* 0110 0011 0110 */ &sll_rs_rd, -/* 0110 0011 0111 */ &sll_rs_rd, -/* 0110 0011 1000 */ &sll_rs_rd, -/* 0110 0011 1001 */ &sll_rs_rd, -/* 0110 0011 1010 */ &sll_rs_rd, -/* 0110 0011 1011 */ &sll_rs_rd, -/* 0110 0011 1100 */ &sll_rs_rd, -/* 0110 0011 1101 */ &sll_rs_rd, -/* 0110 0011 1110 */ &sll_rs_rd, -/* 0110 0011 1111 */ &sll_rs_rd, - -/* 0110 0100 0000 */ &sra_rs_rd, -/* 0110 0100 0001 */ &sra_rs_rd, -/* 0110 0100 0010 */ &sra_rs_rd, -/* 0110 0100 0011 */ &sra_rs_rd, -/* 0110 0100 0100 */ &sra_rs_rd, -/* 0110 0100 0101 */ &sra_rs_rd, -/* 0110 0100 0110 */ &sra_rs_rd, -/* 0110 0100 0111 */ &sra_rs_rd, -/* 0110 0100 1000 */ &sra_rs_rd, -/* 0110 0100 1001 */ &sra_rs_rd, -/* 0110 0100 1010 */ &sra_rs_rd, -/* 0110 0100 1011 */ &sra_rs_rd, -/* 0110 0100 1100 */ &sra_rs_rd, -/* 0110 0100 1101 */ &sra_rs_rd, -/* 0110 0100 1110 */ &sra_rs_rd, -/* 0110 0100 1111 */ &sra_rs_rd, - -/* 0110 0101 0000 */ &sra_rs_rd, -/* 0110 0101 0001 */ &sra_rs_rd, -/* 0110 0101 0010 */ &sra_rs_rd, -/* 0110 0101 0011 */ &sra_rs_rd, -/* 0110 0101 0100 */ &sra_rs_rd, -/* 0110 0101 0101 */ &sra_rs_rd, -/* 0110 0101 0110 */ &sra_rs_rd, -/* 0110 0101 0111 */ &sra_rs_rd, -/* 0110 0101 1000 */ &sra_rs_rd, -/* 0110 0101 1001 */ &sra_rs_rd, -/* 0110 0101 1010 */ &sra_rs_rd, -/* 0110 0101 1011 */ &sra_rs_rd, -/* 0110 0101 1100 */ &sra_rs_rd, -/* 0110 0101 1101 */ &sra_rs_rd, -/* 0110 0101 1110 */ &sra_rs_rd, -/* 0110 0101 1111 */ &sra_rs_rd, - -/* 0110 0110 0000 */ &srl_rs_rd, -/* 0110 0110 0001 */ &srl_rs_rd, -/* 0110 0110 0010 */ &srl_rs_rd, -/* 0110 0110 0011 */ &srl_rs_rd, -/* 0110 0110 0100 */ &srl_rs_rd, -/* 0110 0110 0101 */ &srl_rs_rd, -/* 0110 0110 0110 */ &srl_rs_rd, -/* 0110 0110 0111 */ &srl_rs_rd, -/* 0110 0110 1000 */ &srl_rs_rd, -/* 0110 0110 1001 */ &srl_rs_rd, -/* 0110 0110 1010 */ &srl_rs_rd, -/* 0110 0110 1011 */ &srl_rs_rd, -/* 0110 0110 1100 */ &srl_rs_rd, -/* 0110 0110 1101 */ &srl_rs_rd, -/* 0110 0110 1110 */ &srl_rs_rd, -/* 0110 0110 1111 */ &srl_rs_rd, - -/* 0110 0111 0000 */ &srl_rs_rd, -/* 0110 0111 0001 */ &srl_rs_rd, -/* 0110 0111 0010 */ &srl_rs_rd, -/* 0110 0111 0011 */ &srl_rs_rd, -/* 0110 0111 0100 */ &srl_rs_rd, -/* 0110 0111 0101 */ &srl_rs_rd, -/* 0110 0111 0110 */ &srl_rs_rd, -/* 0110 0111 0111 */ &srl_rs_rd, -/* 0110 0111 1000 */ &srl_rs_rd, -/* 0110 0111 1001 */ &srl_rs_rd, -/* 0110 0111 1010 */ &srl_rs_rd, -/* 0110 0111 1011 */ &srl_rs_rd, -/* 0110 0111 1100 */ &srl_rs_rd, -/* 0110 0111 1101 */ &srl_rs_rd, -/* 0110 0111 1110 */ &srl_rs_rd, -/* 0110 0111 1111 */ &srl_rs_rd, - -/* 0110 1000 0000 */ &rl_rs_rd, -/* 0110 1000 0001 */ &rl_rs_rd, -/* 0110 1000 0010 */ &rl_rs_rd, -/* 0110 1000 0011 */ &rl_rs_rd, -/* 0110 1000 0100 */ &rl_rs_rd, -/* 0110 1000 0101 */ &rl_rs_rd, -/* 0110 1000 0110 */ &rl_rs_rd, -/* 0110 1000 0111 */ &rl_rs_rd, -/* 0110 1000 1000 */ &rl_rs_rd, -/* 0110 1000 1001 */ &rl_rs_rd, -/* 0110 1000 1010 */ &rl_rs_rd, -/* 0110 1000 1011 */ &rl_rs_rd, -/* 0110 1000 1100 */ &rl_rs_rd, -/* 0110 1000 1101 */ &rl_rs_rd, -/* 0110 1000 1110 */ &rl_rs_rd, -/* 0110 1000 1111 */ &rl_rs_rd, - -/* 0110 1001 0000 */ &rl_rs_rd, -/* 0110 1001 0001 */ &rl_rs_rd, -/* 0110 1001 0010 */ &rl_rs_rd, -/* 0110 1001 0011 */ &rl_rs_rd, -/* 0110 1001 0100 */ &rl_rs_rd, -/* 0110 1001 0101 */ &rl_rs_rd, -/* 0110 1001 0110 */ &rl_rs_rd, -/* 0110 1001 0111 */ &rl_rs_rd, -/* 0110 1001 1000 */ &rl_rs_rd, -/* 0110 1001 1001 */ &rl_rs_rd, -/* 0110 1001 1010 */ &rl_rs_rd, -/* 0110 1001 1011 */ &rl_rs_rd, -/* 0110 1001 1100 */ &rl_rs_rd, -/* 0110 1001 1101 */ &rl_rs_rd, -/* 0110 1001 1110 */ &rl_rs_rd, -/* 0110 1001 1111 */ &rl_rs_rd, - -/* 0110 1010 0000 */ &lmo_rs_rd, -/* 0110 1010 0001 */ &lmo_rs_rd, -/* 0110 1010 0010 */ &lmo_rs_rd, -/* 0110 1010 0011 */ &lmo_rs_rd, -/* 0110 1010 0100 */ &lmo_rs_rd, -/* 0110 1010 0101 */ &lmo_rs_rd, -/* 0110 1010 0110 */ &lmo_rs_rd, -/* 0110 1010 0111 */ &lmo_rs_rd, -/* 0110 1010 1000 */ &lmo_rs_rd, -/* 0110 1010 1001 */ &lmo_rs_rd, -/* 0110 1010 1010 */ &lmo_rs_rd, -/* 0110 1010 1011 */ &lmo_rs_rd, -/* 0110 1010 1100 */ &lmo_rs_rd, -/* 0110 1010 1101 */ &lmo_rs_rd, -/* 0110 1010 1110 */ &lmo_rs_rd, -/* 0110 1010 1111 */ &lmo_rs_rd, - -/* 0110 1011 0000 */ &lmo_rs_rd, -/* 0110 1011 0001 */ &lmo_rs_rd, -/* 0110 1011 0010 */ &lmo_rs_rd, -/* 0110 1011 0011 */ &lmo_rs_rd, -/* 0110 1011 0100 */ &lmo_rs_rd, -/* 0110 1011 0101 */ &lmo_rs_rd, -/* 0110 1011 0110 */ &lmo_rs_rd, -/* 0110 1011 0111 */ &lmo_rs_rd, -/* 0110 1011 1000 */ &lmo_rs_rd, -/* 0110 1011 1001 */ &lmo_rs_rd, -/* 0110 1011 1010 */ &lmo_rs_rd, -/* 0110 1011 1011 */ &lmo_rs_rd, -/* 0110 1011 1100 */ &lmo_rs_rd, -/* 0110 1011 1101 */ &lmo_rs_rd, -/* 0110 1011 1110 */ &lmo_rs_rd, -/* 0110 1011 1111 */ &lmo_rs_rd, - -/* 0110 1100 0000 */ &mods_rs_rd, -/* 0110 1100 0001 */ &mods_rs_rd, -/* 0110 1100 0010 */ &mods_rs_rd, -/* 0110 1100 0011 */ &mods_rs_rd, -/* 0110 1100 0100 */ &mods_rs_rd, -/* 0110 1100 0101 */ &mods_rs_rd, -/* 0110 1100 0110 */ &mods_rs_rd, -/* 0110 1100 0111 */ &mods_rs_rd, -/* 0110 1100 1000 */ &mods_rs_rd, -/* 0110 1100 1001 */ &mods_rs_rd, -/* 0110 1100 1010 */ &mods_rs_rd, -/* 0110 1100 1011 */ &mods_rs_rd, -/* 0110 1100 1100 */ &mods_rs_rd, -/* 0110 1100 1101 */ &mods_rs_rd, -/* 0110 1100 1110 */ &mods_rs_rd, -/* 0110 1100 1111 */ &mods_rs_rd, - -/* 0110 1101 0000 */ &mods_rs_rd, -/* 0110 1101 0001 */ &mods_rs_rd, -/* 0110 1101 0010 */ &mods_rs_rd, -/* 0110 1101 0011 */ &mods_rs_rd, -/* 0110 1101 0100 */ &mods_rs_rd, -/* 0110 1101 0101 */ &mods_rs_rd, -/* 0110 1101 0110 */ &mods_rs_rd, -/* 0110 1101 0111 */ &mods_rs_rd, -/* 0110 1101 1000 */ &mods_rs_rd, -/* 0110 1101 1001 */ &mods_rs_rd, -/* 0110 1101 1010 */ &mods_rs_rd, -/* 0110 1101 1011 */ &mods_rs_rd, -/* 0110 1101 1100 */ &mods_rs_rd, -/* 0110 1101 1101 */ &mods_rs_rd, -/* 0110 1101 1110 */ &mods_rs_rd, -/* 0110 1101 1111 */ &mods_rs_rd, - -/* 0110 1110 0000 */ &modu_rs_rd, -/* 0110 1110 0001 */ &modu_rs_rd, -/* 0110 1110 0010 */ &modu_rs_rd, -/* 0110 1110 0011 */ &modu_rs_rd, -/* 0110 1110 0100 */ &modu_rs_rd, -/* 0110 1110 0101 */ &modu_rs_rd, -/* 0110 1110 0110 */ &modu_rs_rd, -/* 0110 1110 0111 */ &modu_rs_rd, -/* 0110 1110 1000 */ &modu_rs_rd, -/* 0110 1110 1001 */ &modu_rs_rd, -/* 0110 1110 1010 */ &modu_rs_rd, -/* 0110 1110 1011 */ &modu_rs_rd, -/* 0110 1110 1100 */ &modu_rs_rd, -/* 0110 1110 1101 */ &modu_rs_rd, -/* 0110 1110 1110 */ &modu_rs_rd, -/* 0110 1110 1111 */ &modu_rs_rd, - -/* 0110 1111 0000 */ &modu_rs_rd, -/* 0110 1111 0001 */ &modu_rs_rd, -/* 0110 1111 0010 */ &modu_rs_rd, -/* 0110 1111 0011 */ &modu_rs_rd, -/* 0110 1111 0100 */ &modu_rs_rd, -/* 0110 1111 0101 */ &modu_rs_rd, -/* 0110 1111 0110 */ &modu_rs_rd, -/* 0110 1111 0111 */ &modu_rs_rd, -/* 0110 1111 1000 */ &modu_rs_rd, -/* 0110 1111 1001 */ &modu_rs_rd, -/* 0110 1111 1010 */ &modu_rs_rd, -/* 0110 1111 1011 */ &modu_rs_rd, -/* 0110 1111 1100 */ &modu_rs_rd, -/* 0110 1111 1101 */ &modu_rs_rd, -/* 0110 1111 1110 */ &modu_rs_rd, -/* 0110 1111 1111 */ &modu_rs_rd, - -/* 0111 0000 0000 */ &unimplemented, -/* 0111 0000 0001 */ &unimplemented, -/* 0111 0000 0010 */ &unimplemented, -/* 0111 0000 0011 */ &unimplemented, -/* 0111 0000 0100 */ &unimplemented, -/* 0111 0000 0101 */ &unimplemented, -/* 0111 0000 0110 */ &unimplemented, -/* 0111 0000 0111 */ &unimplemented, -/* 0111 0000 1000 */ &unimplemented, -/* 0111 0000 1001 */ &unimplemented, -/* 0111 0000 1010 */ &unimplemented, -/* 0111 0000 1011 */ &unimplemented, -/* 0111 0000 1100 */ &unimplemented, -/* 0111 0000 1101 */ &unimplemented, -/* 0111 0000 1110 */ &unimplemented, -/* 0111 0000 1111 */ &unimplemented, - -/* 0111 0001 0000 */ &unimplemented, -/* 0111 0001 0001 */ &unimplemented, -/* 0111 0001 0010 */ &unimplemented, -/* 0111 0001 0011 */ &unimplemented, -/* 0111 0001 0100 */ &unimplemented, -/* 0111 0001 0101 */ &unimplemented, -/* 0111 0001 0110 */ &unimplemented, -/* 0111 0001 0111 */ &unimplemented, -/* 0111 0001 1000 */ &unimplemented, -/* 0111 0001 1001 */ &unimplemented, -/* 0111 0001 1010 */ &unimplemented, -/* 0111 0001 1011 */ &unimplemented, -/* 0111 0001 1100 */ &unimplemented, -/* 0111 0001 1101 */ &unimplemented, -/* 0111 0001 1110 */ &unimplemented, -/* 0111 0001 1111 */ &unimplemented, - -/* 0111 0010 0000 */ &unimplemented, -/* 0111 0010 0001 */ &unimplemented, -/* 0111 0010 0010 */ &unimplemented, -/* 0111 0010 0011 */ &unimplemented, -/* 0111 0010 0100 */ &unimplemented, -/* 0111 0010 0101 */ &unimplemented, -/* 0111 0010 0110 */ &unimplemented, -/* 0111 0010 0111 */ &unimplemented, -/* 0111 0010 1000 */ &unimplemented, -/* 0111 0010 1001 */ &unimplemented, -/* 0111 0010 1010 */ &unimplemented, -/* 0111 0010 1011 */ &unimplemented, -/* 0111 0010 1100 */ &unimplemented, -/* 0111 0010 1101 */ &unimplemented, -/* 0111 0010 1110 */ &unimplemented, -/* 0111 0010 1111 */ &unimplemented, - -/* 0111 0011 0000 */ &unimplemented, -/* 0111 0011 0001 */ &unimplemented, -/* 0111 0011 0010 */ &unimplemented, -/* 0111 0011 0011 */ &unimplemented, -/* 0111 0011 0100 */ &unimplemented, -/* 0111 0011 0101 */ &unimplemented, -/* 0111 0011 0110 */ &unimplemented, -/* 0111 0011 0111 */ &unimplemented, -/* 0111 0011 1000 */ &unimplemented, -/* 0111 0011 1001 */ &unimplemented, -/* 0111 0011 1010 */ &unimplemented, -/* 0111 0011 1011 */ &unimplemented, -/* 0111 0011 1100 */ &unimplemented, -/* 0111 0011 1101 */ &unimplemented, -/* 0111 0011 1110 */ &unimplemented, -/* 0111 0011 1111 */ &unimplemented, - -/* 0111 0100 0000 */ &unimplemented, -/* 0111 0100 0001 */ &unimplemented, -/* 0111 0100 0010 */ &unimplemented, -/* 0111 0100 0011 */ &unimplemented, -/* 0111 0100 0100 */ &unimplemented, -/* 0111 0100 0101 */ &unimplemented, -/* 0111 0100 0110 */ &unimplemented, -/* 0111 0100 0111 */ &unimplemented, -/* 0111 0100 1000 */ &unimplemented, -/* 0111 0100 1001 */ &unimplemented, -/* 0111 0100 1010 */ &unimplemented, -/* 0111 0100 1011 */ &unimplemented, -/* 0111 0100 1100 */ &unimplemented, -/* 0111 0100 1101 */ &unimplemented, -/* 0111 0100 1110 */ &unimplemented, -/* 0111 0100 1111 */ &unimplemented, - -/* 0111 0101 0000 */ &unimplemented, -/* 0111 0101 0001 */ &unimplemented, -/* 0111 0101 0010 */ &unimplemented, -/* 0111 0101 0011 */ &unimplemented, -/* 0111 0101 0100 */ &unimplemented, -/* 0111 0101 0101 */ &unimplemented, -/* 0111 0101 0110 */ &unimplemented, -/* 0111 0101 0111 */ &unimplemented, -/* 0111 0101 1000 */ &unimplemented, -/* 0111 0101 1001 */ &unimplemented, -/* 0111 0101 1010 */ &unimplemented, -/* 0111 0101 1011 */ &unimplemented, -/* 0111 0101 1100 */ &unimplemented, -/* 0111 0101 1101 */ &unimplemented, -/* 0111 0101 1110 */ &unimplemented, -/* 0111 0101 1111 */ &unimplemented, - -/* 0111 0110 0000 */ &unimplemented, -/* 0111 0110 0001 */ &unimplemented, -/* 0111 0110 0010 */ &unimplemented, -/* 0111 0110 0011 */ &unimplemented, -/* 0111 0110 0100 */ &unimplemented, -/* 0111 0110 0101 */ &unimplemented, -/* 0111 0110 0110 */ &unimplemented, -/* 0111 0110 0111 */ &unimplemented, -/* 0111 0110 1000 */ &unimplemented, -/* 0111 0110 1001 */ &unimplemented, -/* 0111 0110 1010 */ &unimplemented, -/* 0111 0110 1011 */ &unimplemented, -/* 0111 0110 1100 */ &unimplemented, -/* 0111 0110 1101 */ &unimplemented, -/* 0111 0110 1110 */ &unimplemented, -/* 0111 0110 1111 */ &unimplemented, - -/* 0111 0111 0000 */ &unimplemented, -/* 0111 0111 0001 */ &unimplemented, -/* 0111 0111 0010 */ &unimplemented, -/* 0111 0111 0011 */ &unimplemented, -/* 0111 0111 0100 */ &unimplemented, -/* 0111 0111 0101 */ &unimplemented, -/* 0111 0111 0110 */ &unimplemented, -/* 0111 0111 0111 */ &unimplemented, -/* 0111 0111 1000 */ &unimplemented, -/* 0111 0111 1001 */ &unimplemented, -/* 0111 0111 1010 */ &unimplemented, -/* 0111 0111 1011 */ &unimplemented, -/* 0111 0111 1100 */ &unimplemented, -/* 0111 0111 1101 */ &unimplemented, -/* 0111 0111 1110 */ &unimplemented, -/* 0111 0111 1111 */ &unimplemented, - -/* 0111 1000 0000 */ &unimplemented, -/* 0111 1000 0001 */ &unimplemented, -/* 0111 1000 0010 */ &unimplemented, -/* 0111 1000 0011 */ &unimplemented, -/* 0111 1000 0100 */ &unimplemented, -/* 0111 1000 0101 */ &unimplemented, -/* 0111 1000 0110 */ &unimplemented, -/* 0111 1000 0111 */ &unimplemented, -/* 0111 1000 1000 */ &unimplemented, -/* 0111 1000 1001 */ &unimplemented, -/* 0111 1000 1010 */ &unimplemented, -/* 0111 1000 1011 */ &unimplemented, -/* 0111 1000 1100 */ &unimplemented, -/* 0111 1000 1101 */ &unimplemented, -/* 0111 1000 1110 */ &unimplemented, -/* 0111 1000 1111 */ &unimplemented, - -/* 0111 1001 0000 */ &unimplemented, -/* 0111 1001 0001 */ &unimplemented, -/* 0111 1001 0010 */ &unimplemented, -/* 0111 1001 0011 */ &unimplemented, -/* 0111 1001 0100 */ &unimplemented, -/* 0111 1001 0101 */ &unimplemented, -/* 0111 1001 0110 */ &unimplemented, -/* 0111 1001 0111 */ &unimplemented, -/* 0111 1001 1000 */ &unimplemented, -/* 0111 1001 1001 */ &unimplemented, -/* 0111 1001 1010 */ &unimplemented, -/* 0111 1001 1011 */ &unimplemented, -/* 0111 1001 1100 */ &unimplemented, -/* 0111 1001 1101 */ &unimplemented, -/* 0111 1001 1110 */ &unimplemented, -/* 0111 1001 1111 */ &unimplemented, - -/* 0111 1010 0000 */ &unimplemented, -/* 0111 1010 0001 */ &unimplemented, -/* 0111 1010 0010 */ &unimplemented, -/* 0111 1010 0011 */ &unimplemented, -/* 0111 1010 0100 */ &unimplemented, -/* 0111 1010 0101 */ &unimplemented, -/* 0111 1010 0110 */ &unimplemented, -/* 0111 1010 0111 */ &unimplemented, -/* 0111 1010 1000 */ &unimplemented, -/* 0111 1010 1001 */ &unimplemented, -/* 0111 1010 1010 */ &unimplemented, -/* 0111 1010 1011 */ &unimplemented, -/* 0111 1010 1100 */ &unimplemented, -/* 0111 1010 1101 */ &unimplemented, -/* 0111 1010 1110 */ &unimplemented, -/* 0111 1010 1111 */ &unimplemented, - -/* 0111 1011 0000 */ &unimplemented, -/* 0111 1011 0001 */ &unimplemented, -/* 0111 1011 0010 */ &unimplemented, -/* 0111 1011 0011 */ &unimplemented, -/* 0111 1011 0100 */ &unimplemented, -/* 0111 1011 0101 */ &unimplemented, -/* 0111 1011 0110 */ &unimplemented, -/* 0111 1011 0111 */ &unimplemented, -/* 0111 1011 1000 */ &unimplemented, -/* 0111 1011 1001 */ &unimplemented, -/* 0111 1011 1010 */ &unimplemented, -/* 0111 1011 1011 */ &unimplemented, -/* 0111 1011 1100 */ &unimplemented, -/* 0111 1011 1101 */ &unimplemented, -/* 0111 1011 1110 */ &unimplemented, -/* 0111 1011 1111 */ &unimplemented, - -/* 0111 1100 0000 */ &unimplemented, -/* 0111 1100 0001 */ &unimplemented, -/* 0111 1100 0010 */ &unimplemented, -/* 0111 1100 0011 */ &unimplemented, -/* 0111 1100 0100 */ &unimplemented, -/* 0111 1100 0101 */ &unimplemented, -/* 0111 1100 0110 */ &unimplemented, -/* 0111 1100 0111 */ &unimplemented, -/* 0111 1100 1000 */ &unimplemented, -/* 0111 1100 1001 */ &unimplemented, -/* 0111 1100 1010 */ &unimplemented, -/* 0111 1100 1011 */ &unimplemented, -/* 0111 1100 1100 */ &unimplemented, -/* 0111 1100 1101 */ &unimplemented, -/* 0111 1100 1110 */ &unimplemented, -/* 0111 1100 1111 */ &unimplemented, - -/* 0111 1101 0000 */ &unimplemented, -/* 0111 1101 0001 */ &unimplemented, -/* 0111 1101 0010 */ &unimplemented, -/* 0111 1101 0011 */ &unimplemented, -/* 0111 1101 0100 */ &unimplemented, -/* 0111 1101 0101 */ &unimplemented, -/* 0111 1101 0110 */ &unimplemented, -/* 0111 1101 0111 */ &unimplemented, -/* 0111 1101 1000 */ &unimplemented, -/* 0111 1101 1001 */ &unimplemented, -/* 0111 1101 1010 */ &unimplemented, -/* 0111 1101 1011 */ &unimplemented, -/* 0111 1101 1100 */ &unimplemented, -/* 0111 1101 1101 */ &unimplemented, -/* 0111 1101 1110 */ &unimplemented, -/* 0111 1101 1111 */ &unimplemented, - -/* 0111 1110 0000 */ &unimplemented, -/* 0111 1110 0001 */ &unimplemented, -/* 0111 1110 0010 */ &unimplemented, -/* 0111 1110 0011 */ &unimplemented, -/* 0111 1110 0100 */ &unimplemented, -/* 0111 1110 0101 */ &unimplemented, -/* 0111 1110 0110 */ &unimplemented, -/* 0111 1110 0111 */ &unimplemented, -/* 0111 1110 1000 */ &unimplemented, -/* 0111 1110 1001 */ &unimplemented, -/* 0111 1110 1010 */ &unimplemented, -/* 0111 1110 1011 */ &unimplemented, -/* 0111 1110 1100 */ &unimplemented, -/* 0111 1110 1101 */ &unimplemented, -/* 0111 1110 1110 */ &unimplemented, -/* 0111 1110 1111 */ &unimplemented, - -/* 0111 1111 0000 */ &unimplemented, -/* 0111 1111 0001 */ &unimplemented, -/* 0111 1111 0010 */ &unimplemented, -/* 0111 1111 0011 */ &unimplemented, -/* 0111 1111 0100 */ &unimplemented, -/* 0111 1111 0101 */ &unimplemented, -/* 0111 1111 0110 */ &unimplemented, -/* 0111 1111 0111 */ &unimplemented, -/* 0111 1111 1000 */ &unimplemented, -/* 0111 1111 1001 */ &unimplemented, -/* 0111 1111 1010 */ &unimplemented, -/* 0111 1111 1011 */ &unimplemented, -/* 0111 1111 1100 */ &unimplemented, -/* 0111 1111 1101 */ &unimplemented, -/* 0111 1111 1110 */ &unimplemented, -/* 0111 1111 1111 */ &unimplemented, - -/* 1000 0000 0000 */ &move_rs_ird_0, -/* 1000 0000 0001 */ &move_rs_ird_0, -/* 1000 0000 0010 */ &move_rs_ird_0, -/* 1000 0000 0011 */ &move_rs_ird_0, -/* 1000 0000 0100 */ &move_rs_ird_0, -/* 1000 0000 0101 */ &move_rs_ird_0, -/* 1000 0000 0110 */ &move_rs_ird_0, -/* 1000 0000 0111 */ &move_rs_ird_0, -/* 1000 0000 1000 */ &move_rs_ird_0, -/* 1000 0000 1001 */ &move_rs_ird_0, -/* 1000 0000 1010 */ &move_rs_ird_0, -/* 1000 0000 1011 */ &move_rs_ird_0, -/* 1000 0000 1100 */ &move_rs_ird_0, -/* 1000 0000 1101 */ &move_rs_ird_0, -/* 1000 0000 1110 */ &move_rs_ird_0, -/* 1000 0000 1111 */ &move_rs_ird_0, - -/* 1000 0001 0000 */ &move_rs_ird_0, -/* 1000 0001 0001 */ &move_rs_ird_0, -/* 1000 0001 0010 */ &move_rs_ird_0, -/* 1000 0001 0011 */ &move_rs_ird_0, -/* 1000 0001 0100 */ &move_rs_ird_0, -/* 1000 0001 0101 */ &move_rs_ird_0, -/* 1000 0001 0110 */ &move_rs_ird_0, -/* 1000 0001 0111 */ &move_rs_ird_0, -/* 1000 0001 1000 */ &move_rs_ird_0, -/* 1000 0001 1001 */ &move_rs_ird_0, -/* 1000 0001 1010 */ &move_rs_ird_0, -/* 1000 0001 1011 */ &move_rs_ird_0, -/* 1000 0001 1100 */ &move_rs_ird_0, -/* 1000 0001 1101 */ &move_rs_ird_0, -/* 1000 0001 1110 */ &move_rs_ird_0, -/* 1000 0001 1111 */ &move_rs_ird_0, - -/* 1000 0010 0000 */ &move_rs_ird_1, -/* 1000 0010 0001 */ &move_rs_ird_1, -/* 1000 0010 0010 */ &move_rs_ird_1, -/* 1000 0010 0011 */ &move_rs_ird_1, -/* 1000 0010 0100 */ &move_rs_ird_1, -/* 1000 0010 0101 */ &move_rs_ird_1, -/* 1000 0010 0110 */ &move_rs_ird_1, -/* 1000 0010 0111 */ &move_rs_ird_1, -/* 1000 0010 1000 */ &move_rs_ird_1, -/* 1000 0010 1001 */ &move_rs_ird_1, -/* 1000 0010 1010 */ &move_rs_ird_1, -/* 1000 0010 1011 */ &move_rs_ird_1, -/* 1000 0010 1100 */ &move_rs_ird_1, -/* 1000 0010 1101 */ &move_rs_ird_1, -/* 1000 0010 1110 */ &move_rs_ird_1, -/* 1000 0010 1111 */ &move_rs_ird_1, - -/* 1000 0011 0000 */ &move_rs_ird_1, -/* 1000 0011 0001 */ &move_rs_ird_1, -/* 1000 0011 0010 */ &move_rs_ird_1, -/* 1000 0011 0011 */ &move_rs_ird_1, -/* 1000 0011 0100 */ &move_rs_ird_1, -/* 1000 0011 0101 */ &move_rs_ird_1, -/* 1000 0011 0110 */ &move_rs_ird_1, -/* 1000 0011 0111 */ &move_rs_ird_1, -/* 1000 0011 1000 */ &move_rs_ird_1, -/* 1000 0011 1001 */ &move_rs_ird_1, -/* 1000 0011 1010 */ &move_rs_ird_1, -/* 1000 0011 1011 */ &move_rs_ird_1, -/* 1000 0011 1100 */ &move_rs_ird_1, -/* 1000 0011 1101 */ &move_rs_ird_1, -/* 1000 0011 1110 */ &move_rs_ird_1, -/* 1000 0011 1111 */ &move_rs_ird_1, - -/* 1000 0100 0000 */ &move_irs_rd_0, -/* 1000 0100 0001 */ &move_irs_rd_0, -/* 1000 0100 0010 */ &move_irs_rd_0, -/* 1000 0100 0011 */ &move_irs_rd_0, -/* 1000 0100 0100 */ &move_irs_rd_0, -/* 1000 0100 0101 */ &move_irs_rd_0, -/* 1000 0100 0110 */ &move_irs_rd_0, -/* 1000 0100 0111 */ &move_irs_rd_0, -/* 1000 0100 1000 */ &move_irs_rd_0, -/* 1000 0100 1001 */ &move_irs_rd_0, -/* 1000 0100 1010 */ &move_irs_rd_0, -/* 1000 0100 1011 */ &move_irs_rd_0, -/* 1000 0100 1100 */ &move_irs_rd_0, -/* 1000 0100 1101 */ &move_irs_rd_0, -/* 1000 0100 1110 */ &move_irs_rd_0, -/* 1000 0100 1111 */ &move_irs_rd_0, - -/* 1000 0101 0000 */ &move_irs_rd_0, -/* 1000 0101 0001 */ &move_irs_rd_0, -/* 1000 0101 0010 */ &move_irs_rd_0, -/* 1000 0101 0011 */ &move_irs_rd_0, -/* 1000 0101 0100 */ &move_irs_rd_0, -/* 1000 0101 0101 */ &move_irs_rd_0, -/* 1000 0101 0110 */ &move_irs_rd_0, -/* 1000 0101 0111 */ &move_irs_rd_0, -/* 1000 0101 1000 */ &move_irs_rd_0, -/* 1000 0101 1001 */ &move_irs_rd_0, -/* 1000 0101 1010 */ &move_irs_rd_0, -/* 1000 0101 1011 */ &move_irs_rd_0, -/* 1000 0101 1100 */ &move_irs_rd_0, -/* 1000 0101 1101 */ &move_irs_rd_0, -/* 1000 0101 1110 */ &move_irs_rd_0, -/* 1000 0101 1111 */ &move_irs_rd_0, - -/* 1000 0110 0000 */ &move_irs_rd_1, -/* 1000 0110 0001 */ &move_irs_rd_1, -/* 1000 0110 0010 */ &move_irs_rd_1, -/* 1000 0110 0011 */ &move_irs_rd_1, -/* 1000 0110 0100 */ &move_irs_rd_1, -/* 1000 0110 0101 */ &move_irs_rd_1, -/* 1000 0110 0110 */ &move_irs_rd_1, -/* 1000 0110 0111 */ &move_irs_rd_1, -/* 1000 0110 1000 */ &move_irs_rd_1, -/* 1000 0110 1001 */ &move_irs_rd_1, -/* 1000 0110 1010 */ &move_irs_rd_1, -/* 1000 0110 1011 */ &move_irs_rd_1, -/* 1000 0110 1100 */ &move_irs_rd_1, -/* 1000 0110 1101 */ &move_irs_rd_1, -/* 1000 0110 1110 */ &move_irs_rd_1, -/* 1000 0110 1111 */ &move_irs_rd_1, - -/* 1000 0111 0000 */ &move_irs_rd_1, -/* 1000 0111 0001 */ &move_irs_rd_1, -/* 1000 0111 0010 */ &move_irs_rd_1, -/* 1000 0111 0011 */ &move_irs_rd_1, -/* 1000 0111 0100 */ &move_irs_rd_1, -/* 1000 0111 0101 */ &move_irs_rd_1, -/* 1000 0111 0110 */ &move_irs_rd_1, -/* 1000 0111 0111 */ &move_irs_rd_1, -/* 1000 0111 1000 */ &move_irs_rd_1, -/* 1000 0111 1001 */ &move_irs_rd_1, -/* 1000 0111 1010 */ &move_irs_rd_1, -/* 1000 0111 1011 */ &move_irs_rd_1, -/* 1000 0111 1100 */ &move_irs_rd_1, -/* 1000 0111 1101 */ &move_irs_rd_1, -/* 1000 0111 1110 */ &move_irs_rd_1, -/* 1000 0111 1111 */ &move_irs_rd_1, - -/* 1000 1000 0000 */ &move_irs_ird_0, -/* 1000 1000 0001 */ &move_irs_ird_0, -/* 1000 1000 0010 */ &move_irs_ird_0, -/* 1000 1000 0011 */ &move_irs_ird_0, -/* 1000 1000 0100 */ &move_irs_ird_0, -/* 1000 1000 0101 */ &move_irs_ird_0, -/* 1000 1000 0110 */ &move_irs_ird_0, -/* 1000 1000 0111 */ &move_irs_ird_0, -/* 1000 1000 1000 */ &move_irs_ird_0, -/* 1000 1000 1001 */ &move_irs_ird_0, -/* 1000 1000 1010 */ &move_irs_ird_0, -/* 1000 1000 1011 */ &move_irs_ird_0, -/* 1000 1000 1100 */ &move_irs_ird_0, -/* 1000 1000 1101 */ &move_irs_ird_0, -/* 1000 1000 1110 */ &move_irs_ird_0, -/* 1000 1000 1111 */ &move_irs_ird_0, - -/* 1000 1001 0000 */ &move_irs_ird_0, -/* 1000 1001 0001 */ &move_irs_ird_0, -/* 1000 1001 0010 */ &move_irs_ird_0, -/* 1000 1001 0011 */ &move_irs_ird_0, -/* 1000 1001 0100 */ &move_irs_ird_0, -/* 1000 1001 0101 */ &move_irs_ird_0, -/* 1000 1001 0110 */ &move_irs_ird_0, -/* 1000 1001 0111 */ &move_irs_ird_0, -/* 1000 1001 1000 */ &move_irs_ird_0, -/* 1000 1001 1001 */ &move_irs_ird_0, -/* 1000 1001 1010 */ &move_irs_ird_0, -/* 1000 1001 1011 */ &move_irs_ird_0, -/* 1000 1001 1100 */ &move_irs_ird_0, -/* 1000 1001 1101 */ &move_irs_ird_0, -/* 1000 1001 1110 */ &move_irs_ird_0, -/* 1000 1001 1111 */ &move_irs_ird_0, - -/* 1000 1010 0000 */ &move_irs_ird_1, -/* 1000 1010 0001 */ &move_irs_ird_1, -/* 1000 1010 0010 */ &move_irs_ird_1, -/* 1000 1010 0011 */ &move_irs_ird_1, -/* 1000 1010 0100 */ &move_irs_ird_1, -/* 1000 1010 0101 */ &move_irs_ird_1, -/* 1000 1010 0110 */ &move_irs_ird_1, -/* 1000 1010 0111 */ &move_irs_ird_1, -/* 1000 1010 1000 */ &move_irs_ird_1, -/* 1000 1010 1001 */ &move_irs_ird_1, -/* 1000 1010 1010 */ &move_irs_ird_1, -/* 1000 1010 1011 */ &move_irs_ird_1, -/* 1000 1010 1100 */ &move_irs_ird_1, -/* 1000 1010 1101 */ &move_irs_ird_1, -/* 1000 1010 1110 */ &move_irs_ird_1, -/* 1000 1010 1111 */ &move_irs_ird_1, - -/* 1000 1011 0000 */ &move_irs_ird_1, -/* 1000 1011 0001 */ &move_irs_ird_1, -/* 1000 1011 0010 */ &move_irs_ird_1, -/* 1000 1011 0011 */ &move_irs_ird_1, -/* 1000 1011 0100 */ &move_irs_ird_1, -/* 1000 1011 0101 */ &move_irs_ird_1, -/* 1000 1011 0110 */ &move_irs_ird_1, -/* 1000 1011 0111 */ &move_irs_ird_1, -/* 1000 1011 1000 */ &move_irs_ird_1, -/* 1000 1011 1001 */ &move_irs_ird_1, -/* 1000 1011 1010 */ &move_irs_ird_1, -/* 1000 1011 1011 */ &move_irs_ird_1, -/* 1000 1011 1100 */ &move_irs_ird_1, -/* 1000 1011 1101 */ &move_irs_ird_1, -/* 1000 1011 1110 */ &move_irs_ird_1, -/* 1000 1011 1111 */ &move_irs_ird_1, - -/* 1000 1100 0000 */ &movb_rs_ird, -/* 1000 1100 0001 */ &movb_rs_ird, -/* 1000 1100 0010 */ &movb_rs_ird, -/* 1000 1100 0011 */ &movb_rs_ird, -/* 1000 1100 0100 */ &movb_rs_ird, -/* 1000 1100 0101 */ &movb_rs_ird, -/* 1000 1100 0110 */ &movb_rs_ird, -/* 1000 1100 0111 */ &movb_rs_ird, -/* 1000 1100 1000 */ &movb_rs_ird, -/* 1000 1100 1001 */ &movb_rs_ird, -/* 1000 1100 1010 */ &movb_rs_ird, -/* 1000 1100 1011 */ &movb_rs_ird, -/* 1000 1100 1100 */ &movb_rs_ird, -/* 1000 1100 1101 */ &movb_rs_ird, -/* 1000 1100 1110 */ &movb_rs_ird, -/* 1000 1100 1111 */ &movb_rs_ird, - -/* 1000 1101 0000 */ &movb_rs_ird, -/* 1000 1101 0001 */ &movb_rs_ird, -/* 1000 1101 0010 */ &movb_rs_ird, -/* 1000 1101 0011 */ &movb_rs_ird, -/* 1000 1101 0100 */ &movb_rs_ird, -/* 1000 1101 0101 */ &movb_rs_ird, -/* 1000 1101 0110 */ &movb_rs_ird, -/* 1000 1101 0111 */ &movb_rs_ird, -/* 1000 1101 1000 */ &movb_rs_ird, -/* 1000 1101 1001 */ &movb_rs_ird, -/* 1000 1101 1010 */ &movb_rs_ird, -/* 1000 1101 1011 */ &movb_rs_ird, -/* 1000 1101 1100 */ &movb_rs_ird, -/* 1000 1101 1101 */ &movb_rs_ird, -/* 1000 1101 1110 */ &movb_rs_ird, -/* 1000 1101 1111 */ &movb_rs_ird, - -/* 1000 1110 0000 */ &movb_irs_rd, -/* 1000 1110 0001 */ &movb_irs_rd, -/* 1000 1110 0010 */ &movb_irs_rd, -/* 1000 1110 0011 */ &movb_irs_rd, -/* 1000 1110 0100 */ &movb_irs_rd, -/* 1000 1110 0101 */ &movb_irs_rd, -/* 1000 1110 0110 */ &movb_irs_rd, -/* 1000 1110 0111 */ &movb_irs_rd, -/* 1000 1110 1000 */ &movb_irs_rd, -/* 1000 1110 1001 */ &movb_irs_rd, -/* 1000 1110 1010 */ &movb_irs_rd, -/* 1000 1110 1011 */ &movb_irs_rd, -/* 1000 1110 1100 */ &movb_irs_rd, -/* 1000 1110 1101 */ &movb_irs_rd, -/* 1000 1110 1110 */ &movb_irs_rd, -/* 1000 1110 1111 */ &movb_irs_rd, - -/* 1000 1111 0000 */ &movb_irs_rd, -/* 1000 1111 0001 */ &movb_irs_rd, -/* 1000 1111 0010 */ &movb_irs_rd, -/* 1000 1111 0011 */ &movb_irs_rd, -/* 1000 1111 0100 */ &movb_irs_rd, -/* 1000 1111 0101 */ &movb_irs_rd, -/* 1000 1111 0110 */ &movb_irs_rd, -/* 1000 1111 0111 */ &movb_irs_rd, -/* 1000 1111 1000 */ &movb_irs_rd, -/* 1000 1111 1001 */ &movb_irs_rd, -/* 1000 1111 1010 */ &movb_irs_rd, -/* 1000 1111 1011 */ &movb_irs_rd, -/* 1000 1111 1100 */ &movb_irs_rd, -/* 1000 1111 1101 */ &movb_irs_rd, -/* 1000 1111 1110 */ &movb_irs_rd, -/* 1000 1111 1111 */ &movb_irs_rd, - -/* 1001 0000 0000 */ &move_rs_irdp_0, -/* 1001 0000 0001 */ &move_rs_irdp_0, -/* 1001 0000 0010 */ &move_rs_irdp_0, -/* 1001 0000 0011 */ &move_rs_irdp_0, -/* 1001 0000 0100 */ &move_rs_irdp_0, -/* 1001 0000 0101 */ &move_rs_irdp_0, -/* 1001 0000 0110 */ &move_rs_irdp_0, -/* 1001 0000 0111 */ &move_rs_irdp_0, -/* 1001 0000 1000 */ &move_rs_irdp_0, -/* 1001 0000 1001 */ &move_rs_irdp_0, -/* 1001 0000 1010 */ &move_rs_irdp_0, -/* 1001 0000 1011 */ &move_rs_irdp_0, -/* 1001 0000 1100 */ &move_rs_irdp_0, -/* 1001 0000 1101 */ &move_rs_irdp_0, -/* 1001 0000 1110 */ &move_rs_irdp_0, -/* 1001 0000 1111 */ &move_rs_irdp_0, - -/* 1001 0001 0000 */ &move_rs_irdp_0, -/* 1001 0001 0001 */ &move_rs_irdp_0, -/* 1001 0001 0010 */ &move_rs_irdp_0, -/* 1001 0001 0011 */ &move_rs_irdp_0, -/* 1001 0001 0100 */ &move_rs_irdp_0, -/* 1001 0001 0101 */ &move_rs_irdp_0, -/* 1001 0001 0110 */ &move_rs_irdp_0, -/* 1001 0001 0111 */ &move_rs_irdp_0, -/* 1001 0001 1000 */ &move_rs_irdp_0, -/* 1001 0001 1001 */ &move_rs_irdp_0, -/* 1001 0001 1010 */ &move_rs_irdp_0, -/* 1001 0001 1011 */ &move_rs_irdp_0, -/* 1001 0001 1100 */ &move_rs_irdp_0, -/* 1001 0001 1101 */ &move_rs_irdp_0, -/* 1001 0001 1110 */ &move_rs_irdp_0, -/* 1001 0001 1111 */ &move_rs_irdp_0, - -/* 1001 0010 0000 */ &move_rs_irdp_1, -/* 1001 0010 0001 */ &move_rs_irdp_1, -/* 1001 0010 0010 */ &move_rs_irdp_1, -/* 1001 0010 0011 */ &move_rs_irdp_1, -/* 1001 0010 0100 */ &move_rs_irdp_1, -/* 1001 0010 0101 */ &move_rs_irdp_1, -/* 1001 0010 0110 */ &move_rs_irdp_1, -/* 1001 0010 0111 */ &move_rs_irdp_1, -/* 1001 0010 1000 */ &move_rs_irdp_1, -/* 1001 0010 1001 */ &move_rs_irdp_1, -/* 1001 0010 1010 */ &move_rs_irdp_1, -/* 1001 0010 1011 */ &move_rs_irdp_1, -/* 1001 0010 1100 */ &move_rs_irdp_1, -/* 1001 0010 1101 */ &move_rs_irdp_1, -/* 1001 0010 1110 */ &move_rs_irdp_1, -/* 1001 0010 1111 */ &move_rs_irdp_1, - -/* 1001 0011 0000 */ &move_rs_irdp_1, -/* 1001 0011 0001 */ &move_rs_irdp_1, -/* 1001 0011 0010 */ &move_rs_irdp_1, -/* 1001 0011 0011 */ &move_rs_irdp_1, -/* 1001 0011 0100 */ &move_rs_irdp_1, -/* 1001 0011 0101 */ &move_rs_irdp_1, -/* 1001 0011 0110 */ &move_rs_irdp_1, -/* 1001 0011 0111 */ &move_rs_irdp_1, -/* 1001 0011 1000 */ &move_rs_irdp_1, -/* 1001 0011 1001 */ &move_rs_irdp_1, -/* 1001 0011 1010 */ &move_rs_irdp_1, -/* 1001 0011 1011 */ &move_rs_irdp_1, -/* 1001 0011 1100 */ &move_rs_irdp_1, -/* 1001 0011 1101 */ &move_rs_irdp_1, -/* 1001 0011 1110 */ &move_rs_irdp_1, -/* 1001 0011 1111 */ &move_rs_irdp_1, - -/* 1001 0100 0000 */ &move_irsp_rd_0, -/* 1001 0100 0001 */ &move_irsp_rd_0, -/* 1001 0100 0010 */ &move_irsp_rd_0, -/* 1001 0100 0011 */ &move_irsp_rd_0, -/* 1001 0100 0100 */ &move_irsp_rd_0, -/* 1001 0100 0101 */ &move_irsp_rd_0, -/* 1001 0100 0110 */ &move_irsp_rd_0, -/* 1001 0100 0111 */ &move_irsp_rd_0, -/* 1001 0100 1000 */ &move_irsp_rd_0, -/* 1001 0100 1001 */ &move_irsp_rd_0, -/* 1001 0100 1010 */ &move_irsp_rd_0, -/* 1001 0100 1011 */ &move_irsp_rd_0, -/* 1001 0100 1100 */ &move_irsp_rd_0, -/* 1001 0100 1101 */ &move_irsp_rd_0, -/* 1001 0100 1110 */ &move_irsp_rd_0, -/* 1001 0100 1111 */ &move_irsp_rd_0, - -/* 1001 0101 0000 */ &move_irsp_rd_0, -/* 1001 0101 0001 */ &move_irsp_rd_0, -/* 1001 0101 0010 */ &move_irsp_rd_0, -/* 1001 0101 0011 */ &move_irsp_rd_0, -/* 1001 0101 0100 */ &move_irsp_rd_0, -/* 1001 0101 0101 */ &move_irsp_rd_0, -/* 1001 0101 0110 */ &move_irsp_rd_0, -/* 1001 0101 0111 */ &move_irsp_rd_0, -/* 1001 0101 1000 */ &move_irsp_rd_0, -/* 1001 0101 1001 */ &move_irsp_rd_0, -/* 1001 0101 1010 */ &move_irsp_rd_0, -/* 1001 0101 1011 */ &move_irsp_rd_0, -/* 1001 0101 1100 */ &move_irsp_rd_0, -/* 1001 0101 1101 */ &move_irsp_rd_0, -/* 1001 0101 1110 */ &move_irsp_rd_0, -/* 1001 0101 1111 */ &move_irsp_rd_0, - -/* 1001 0110 0000 */ &move_irsp_rd_1, -/* 1001 0110 0001 */ &move_irsp_rd_1, -/* 1001 0110 0010 */ &move_irsp_rd_1, -/* 1001 0110 0011 */ &move_irsp_rd_1, -/* 1001 0110 0100 */ &move_irsp_rd_1, -/* 1001 0110 0101 */ &move_irsp_rd_1, -/* 1001 0110 0110 */ &move_irsp_rd_1, -/* 1001 0110 0111 */ &move_irsp_rd_1, -/* 1001 0110 1000 */ &move_irsp_rd_1, -/* 1001 0110 1001 */ &move_irsp_rd_1, -/* 1001 0110 1010 */ &move_irsp_rd_1, -/* 1001 0110 1011 */ &move_irsp_rd_1, -/* 1001 0110 1100 */ &move_irsp_rd_1, -/* 1001 0110 1101 */ &move_irsp_rd_1, -/* 1001 0110 1110 */ &move_irsp_rd_1, -/* 1001 0110 1111 */ &move_irsp_rd_1, - -/* 1001 0111 0000 */ &move_irsp_rd_1, -/* 1001 0111 0001 */ &move_irsp_rd_1, -/* 1001 0111 0010 */ &move_irsp_rd_1, -/* 1001 0111 0011 */ &move_irsp_rd_1, -/* 1001 0111 0100 */ &move_irsp_rd_1, -/* 1001 0111 0101 */ &move_irsp_rd_1, -/* 1001 0111 0110 */ &move_irsp_rd_1, -/* 1001 0111 0111 */ &move_irsp_rd_1, -/* 1001 0111 1000 */ &move_irsp_rd_1, -/* 1001 0111 1001 */ &move_irsp_rd_1, -/* 1001 0111 1010 */ &move_irsp_rd_1, -/* 1001 0111 1011 */ &move_irsp_rd_1, -/* 1001 0111 1100 */ &move_irsp_rd_1, -/* 1001 0111 1101 */ &move_irsp_rd_1, -/* 1001 0111 1110 */ &move_irsp_rd_1, -/* 1001 0111 1111 */ &move_irsp_rd_1, - -/* 1001 1000 0000 */ &move_irsp_irdp_0, -/* 1001 1000 0001 */ &move_irsp_irdp_0, -/* 1001 1000 0010 */ &move_irsp_irdp_0, -/* 1001 1000 0011 */ &move_irsp_irdp_0, -/* 1001 1000 0100 */ &move_irsp_irdp_0, -/* 1001 1000 0101 */ &move_irsp_irdp_0, -/* 1001 1000 0110 */ &move_irsp_irdp_0, -/* 1001 1000 0111 */ &move_irsp_irdp_0, -/* 1001 1000 1000 */ &move_irsp_irdp_0, -/* 1001 1000 1001 */ &move_irsp_irdp_0, -/* 1001 1000 1010 */ &move_irsp_irdp_0, -/* 1001 1000 1011 */ &move_irsp_irdp_0, -/* 1001 1000 1100 */ &move_irsp_irdp_0, -/* 1001 1000 1101 */ &move_irsp_irdp_0, -/* 1001 1000 1110 */ &move_irsp_irdp_0, -/* 1001 1000 1111 */ &move_irsp_irdp_0, - -/* 1001 1001 0000 */ &move_irsp_irdp_0, -/* 1001 1001 0001 */ &move_irsp_irdp_0, -/* 1001 1001 0010 */ &move_irsp_irdp_0, -/* 1001 1001 0011 */ &move_irsp_irdp_0, -/* 1001 1001 0100 */ &move_irsp_irdp_0, -/* 1001 1001 0101 */ &move_irsp_irdp_0, -/* 1001 1001 0110 */ &move_irsp_irdp_0, -/* 1001 1001 0111 */ &move_irsp_irdp_0, -/* 1001 1001 1000 */ &move_irsp_irdp_0, -/* 1001 1001 1001 */ &move_irsp_irdp_0, -/* 1001 1001 1010 */ &move_irsp_irdp_0, -/* 1001 1001 1011 */ &move_irsp_irdp_0, -/* 1001 1001 1100 */ &move_irsp_irdp_0, -/* 1001 1001 1101 */ &move_irsp_irdp_0, -/* 1001 1001 1110 */ &move_irsp_irdp_0, -/* 1001 1001 1111 */ &move_irsp_irdp_0, - -/* 1001 1010 0000 */ &move_irsp_irdp_1, -/* 1001 1010 0001 */ &move_irsp_irdp_1, -/* 1001 1010 0010 */ &move_irsp_irdp_1, -/* 1001 1010 0011 */ &move_irsp_irdp_1, -/* 1001 1010 0100 */ &move_irsp_irdp_1, -/* 1001 1010 0101 */ &move_irsp_irdp_1, -/* 1001 1010 0110 */ &move_irsp_irdp_1, -/* 1001 1010 0111 */ &move_irsp_irdp_1, -/* 1001 1010 1000 */ &move_irsp_irdp_1, -/* 1001 1010 1001 */ &move_irsp_irdp_1, -/* 1001 1010 1010 */ &move_irsp_irdp_1, -/* 1001 1010 1011 */ &move_irsp_irdp_1, -/* 1001 1010 1100 */ &move_irsp_irdp_1, -/* 1001 1010 1101 */ &move_irsp_irdp_1, -/* 1001 1010 1110 */ &move_irsp_irdp_1, -/* 1001 1010 1111 */ &move_irsp_irdp_1, - -/* 1001 1011 0000 */ &move_irsp_irdp_1, -/* 1001 1011 0001 */ &move_irsp_irdp_1, -/* 1001 1011 0010 */ &move_irsp_irdp_1, -/* 1001 1011 0011 */ &move_irsp_irdp_1, -/* 1001 1011 0100 */ &move_irsp_irdp_1, -/* 1001 1011 0101 */ &move_irsp_irdp_1, -/* 1001 1011 0110 */ &move_irsp_irdp_1, -/* 1001 1011 0111 */ &move_irsp_irdp_1, -/* 1001 1011 1000 */ &move_irsp_irdp_1, -/* 1001 1011 1001 */ &move_irsp_irdp_1, -/* 1001 1011 1010 */ &move_irsp_irdp_1, -/* 1001 1011 1011 */ &move_irsp_irdp_1, -/* 1001 1011 1100 */ &move_irsp_irdp_1, -/* 1001 1011 1101 */ &move_irsp_irdp_1, -/* 1001 1011 1110 */ &move_irsp_irdp_1, -/* 1001 1011 1111 */ &move_irsp_irdp_1, - -/* 1001 1100 0000 */ &movb_irs_ird, -/* 1001 1100 0001 */ &movb_irs_ird, -/* 1001 1100 0010 */ &movb_irs_ird, -/* 1001 1100 0011 */ &movb_irs_ird, -/* 1001 1100 0100 */ &movb_irs_ird, -/* 1001 1100 0101 */ &movb_irs_ird, -/* 1001 1100 0110 */ &movb_irs_ird, -/* 1001 1100 0111 */ &movb_irs_ird, -/* 1001 1100 1000 */ &movb_irs_ird, -/* 1001 1100 1001 */ &movb_irs_ird, -/* 1001 1100 1010 */ &movb_irs_ird, -/* 1001 1100 1011 */ &movb_irs_ird, -/* 1001 1100 1100 */ &movb_irs_ird, -/* 1001 1100 1101 */ &movb_irs_ird, -/* 1001 1100 1110 */ &movb_irs_ird, -/* 1001 1100 1111 */ &movb_irs_ird, - -/* 1001 1101 0000 */ &movb_irs_ird, -/* 1001 1101 0001 */ &movb_irs_ird, -/* 1001 1101 0010 */ &movb_irs_ird, -/* 1001 1101 0011 */ &movb_irs_ird, -/* 1001 1101 0100 */ &movb_irs_ird, -/* 1001 1101 0101 */ &movb_irs_ird, -/* 1001 1101 0110 */ &movb_irs_ird, -/* 1001 1101 0111 */ &movb_irs_ird, -/* 1001 1101 1000 */ &movb_irs_ird, -/* 1001 1101 1001 */ &movb_irs_ird, -/* 1001 1101 1010 */ &movb_irs_ird, -/* 1001 1101 1011 */ &movb_irs_ird, -/* 1001 1101 1100 */ &movb_irs_ird, -/* 1001 1101 1101 */ &movb_irs_ird, -/* 1001 1101 1110 */ &movb_irs_ird, -/* 1001 1101 1111 */ &movb_irs_ird, - -/* 1001 1110 0000 */ &unimplemented, -/* 1001 1110 0001 */ &unimplemented, -/* 1001 1110 0010 */ &unimplemented, -/* 1001 1110 0011 */ &unimplemented, -/* 1001 1110 0100 */ &unimplemented, -/* 1001 1110 0101 */ &unimplemented, -/* 1001 1110 0110 */ &unimplemented, -/* 1001 1110 0111 */ &unimplemented, -/* 1001 1110 1000 */ &unimplemented, -/* 1001 1110 1001 */ &unimplemented, -/* 1001 1110 1010 */ &unimplemented, -/* 1001 1110 1011 */ &unimplemented, -/* 1001 1110 1100 */ &unimplemented, -/* 1001 1110 1101 */ &unimplemented, -/* 1001 1110 1110 */ &unimplemented, -/* 1001 1110 1111 */ &unimplemented, - -/* 1001 1111 0000 */ &unimplemented, -/* 1001 1111 0001 */ &unimplemented, -/* 1001 1111 0010 */ &unimplemented, -/* 1001 1111 0011 */ &unimplemented, -/* 1001 1111 0100 */ &unimplemented, -/* 1001 1111 0101 */ &unimplemented, -/* 1001 1111 0110 */ &unimplemented, -/* 1001 1111 0111 */ &unimplemented, -/* 1001 1111 1000 */ &unimplemented, -/* 1001 1111 1001 */ &unimplemented, -/* 1001 1111 1010 */ &unimplemented, -/* 1001 1111 1011 */ &unimplemented, -/* 1001 1111 1100 */ &unimplemented, -/* 1001 1111 1101 */ &unimplemented, -/* 1001 1111 1110 */ &unimplemented, -/* 1001 1111 1111 */ &unimplemented, - -/* 1010 0000 0000 */ &move_rs_mird_0, -/* 1010 0000 0001 */ &move_rs_mird_0, -/* 1010 0000 0010 */ &move_rs_mird_0, -/* 1010 0000 0011 */ &move_rs_mird_0, -/* 1010 0000 0100 */ &move_rs_mird_0, -/* 1010 0000 0101 */ &move_rs_mird_0, -/* 1010 0000 0110 */ &move_rs_mird_0, -/* 1010 0000 0111 */ &move_rs_mird_0, -/* 1010 0000 1000 */ &move_rs_mird_0, -/* 1010 0000 1001 */ &move_rs_mird_0, -/* 1010 0000 1010 */ &move_rs_mird_0, -/* 1010 0000 1011 */ &move_rs_mird_0, -/* 1010 0000 1100 */ &move_rs_mird_0, -/* 1010 0000 1101 */ &move_rs_mird_0, -/* 1010 0000 1110 */ &move_rs_mird_0, -/* 1010 0000 1111 */ &move_rs_mird_0, - -/* 1010 0001 0000 */ &move_rs_mird_0, -/* 1010 0001 0001 */ &move_rs_mird_0, -/* 1010 0001 0010 */ &move_rs_mird_0, -/* 1010 0001 0011 */ &move_rs_mird_0, -/* 1010 0001 0100 */ &move_rs_mird_0, -/* 1010 0001 0101 */ &move_rs_mird_0, -/* 1010 0001 0110 */ &move_rs_mird_0, -/* 1010 0001 0111 */ &move_rs_mird_0, -/* 1010 0001 1000 */ &move_rs_mird_0, -/* 1010 0001 1001 */ &move_rs_mird_0, -/* 1010 0001 1010 */ &move_rs_mird_0, -/* 1010 0001 1011 */ &move_rs_mird_0, -/* 1010 0001 1100 */ &move_rs_mird_0, -/* 1010 0001 1101 */ &move_rs_mird_0, -/* 1010 0001 1110 */ &move_rs_mird_0, -/* 1010 0001 1111 */ &move_rs_mird_0, - -/* 1010 0010 0000 */ &move_rs_mird_1, -/* 1010 0010 0001 */ &move_rs_mird_1, -/* 1010 0010 0010 */ &move_rs_mird_1, -/* 1010 0010 0011 */ &move_rs_mird_1, -/* 1010 0010 0100 */ &move_rs_mird_1, -/* 1010 0010 0101 */ &move_rs_mird_1, -/* 1010 0010 0110 */ &move_rs_mird_1, -/* 1010 0010 0111 */ &move_rs_mird_1, -/* 1010 0010 1000 */ &move_rs_mird_1, -/* 1010 0010 1001 */ &move_rs_mird_1, -/* 1010 0010 1010 */ &move_rs_mird_1, -/* 1010 0010 1011 */ &move_rs_mird_1, -/* 1010 0010 1100 */ &move_rs_mird_1, -/* 1010 0010 1101 */ &move_rs_mird_1, -/* 1010 0010 1110 */ &move_rs_mird_1, -/* 1010 0010 1111 */ &move_rs_mird_1, - -/* 1010 0011 0000 */ &move_rs_mird_1, -/* 1010 0011 0001 */ &move_rs_mird_1, -/* 1010 0011 0010 */ &move_rs_mird_1, -/* 1010 0011 0011 */ &move_rs_mird_1, -/* 1010 0011 0100 */ &move_rs_mird_1, -/* 1010 0011 0101 */ &move_rs_mird_1, -/* 1010 0011 0110 */ &move_rs_mird_1, -/* 1010 0011 0111 */ &move_rs_mird_1, -/* 1010 0011 1000 */ &move_rs_mird_1, -/* 1010 0011 1001 */ &move_rs_mird_1, -/* 1010 0011 1010 */ &move_rs_mird_1, -/* 1010 0011 1011 */ &move_rs_mird_1, -/* 1010 0011 1100 */ &move_rs_mird_1, -/* 1010 0011 1101 */ &move_rs_mird_1, -/* 1010 0011 1110 */ &move_rs_mird_1, -/* 1010 0011 1111 */ &move_rs_mird_1, - -/* 1010 0100 0000 */ &move_mirs_rd_0, -/* 1010 0100 0001 */ &move_mirs_rd_0, -/* 1010 0100 0010 */ &move_mirs_rd_0, -/* 1010 0100 0011 */ &move_mirs_rd_0, -/* 1010 0100 0100 */ &move_mirs_rd_0, -/* 1010 0100 0101 */ &move_mirs_rd_0, -/* 1010 0100 0110 */ &move_mirs_rd_0, -/* 1010 0100 0111 */ &move_mirs_rd_0, -/* 1010 0100 1000 */ &move_mirs_rd_0, -/* 1010 0100 1001 */ &move_mirs_rd_0, -/* 1010 0100 1010 */ &move_mirs_rd_0, -/* 1010 0100 1011 */ &move_mirs_rd_0, -/* 1010 0100 1100 */ &move_mirs_rd_0, -/* 1010 0100 1101 */ &move_mirs_rd_0, -/* 1010 0100 1110 */ &move_mirs_rd_0, -/* 1010 0100 1111 */ &move_mirs_rd_0, - -/* 1010 0101 0000 */ &move_mirs_rd_0, -/* 1010 0101 0001 */ &move_mirs_rd_0, -/* 1010 0101 0010 */ &move_mirs_rd_0, -/* 1010 0101 0011 */ &move_mirs_rd_0, -/* 1010 0101 0100 */ &move_mirs_rd_0, -/* 1010 0101 0101 */ &move_mirs_rd_0, -/* 1010 0101 0110 */ &move_mirs_rd_0, -/* 1010 0101 0111 */ &move_mirs_rd_0, -/* 1010 0101 1000 */ &move_mirs_rd_0, -/* 1010 0101 1001 */ &move_mirs_rd_0, -/* 1010 0101 1010 */ &move_mirs_rd_0, -/* 1010 0101 1011 */ &move_mirs_rd_0, -/* 1010 0101 1100 */ &move_mirs_rd_0, -/* 1010 0101 1101 */ &move_mirs_rd_0, -/* 1010 0101 1110 */ &move_mirs_rd_0, -/* 1010 0101 1111 */ &move_mirs_rd_0, - -/* 1010 0110 0000 */ &move_mirs_rd_1, -/* 1010 0110 0001 */ &move_mirs_rd_1, -/* 1010 0110 0010 */ &move_mirs_rd_1, -/* 1010 0110 0011 */ &move_mirs_rd_1, -/* 1010 0110 0100 */ &move_mirs_rd_1, -/* 1010 0110 0101 */ &move_mirs_rd_1, -/* 1010 0110 0110 */ &move_mirs_rd_1, -/* 1010 0110 0111 */ &move_mirs_rd_1, -/* 1010 0110 1000 */ &move_mirs_rd_1, -/* 1010 0110 1001 */ &move_mirs_rd_1, -/* 1010 0110 1010 */ &move_mirs_rd_1, -/* 1010 0110 1011 */ &move_mirs_rd_1, -/* 1010 0110 1100 */ &move_mirs_rd_1, -/* 1010 0110 1101 */ &move_mirs_rd_1, -/* 1010 0110 1110 */ &move_mirs_rd_1, -/* 1010 0110 1111 */ &move_mirs_rd_1, - -/* 1010 0111 0000 */ &move_mirs_rd_1, -/* 1010 0111 0001 */ &move_mirs_rd_1, -/* 1010 0111 0010 */ &move_mirs_rd_1, -/* 1010 0111 0011 */ &move_mirs_rd_1, -/* 1010 0111 0100 */ &move_mirs_rd_1, -/* 1010 0111 0101 */ &move_mirs_rd_1, -/* 1010 0111 0110 */ &move_mirs_rd_1, -/* 1010 0111 0111 */ &move_mirs_rd_1, -/* 1010 0111 1000 */ &move_mirs_rd_1, -/* 1010 0111 1001 */ &move_mirs_rd_1, -/* 1010 0111 1010 */ &move_mirs_rd_1, -/* 1010 0111 1011 */ &move_mirs_rd_1, -/* 1010 0111 1100 */ &move_mirs_rd_1, -/* 1010 0111 1101 */ &move_mirs_rd_1, -/* 1010 0111 1110 */ &move_mirs_rd_1, -/* 1010 0111 1111 */ &move_mirs_rd_1, - -/* 1010 1000 0000 */ &move_mirs_mird_0, -/* 1010 1000 0001 */ &move_mirs_mird_0, -/* 1010 1000 0010 */ &move_mirs_mird_0, -/* 1010 1000 0011 */ &move_mirs_mird_0, -/* 1010 1000 0100 */ &move_mirs_mird_0, -/* 1010 1000 0101 */ &move_mirs_mird_0, -/* 1010 1000 0110 */ &move_mirs_mird_0, -/* 1010 1000 0111 */ &move_mirs_mird_0, -/* 1010 1000 1000 */ &move_mirs_mird_0, -/* 1010 1000 1001 */ &move_mirs_mird_0, -/* 1010 1000 1010 */ &move_mirs_mird_0, -/* 1010 1000 1011 */ &move_mirs_mird_0, -/* 1010 1000 1100 */ &move_mirs_mird_0, -/* 1010 1000 1101 */ &move_mirs_mird_0, -/* 1010 1000 1110 */ &move_mirs_mird_0, -/* 1010 1000 1111 */ &move_mirs_mird_0, - -/* 1010 1001 0000 */ &move_mirs_mird_0, -/* 1010 1001 0001 */ &move_mirs_mird_0, -/* 1010 1001 0010 */ &move_mirs_mird_0, -/* 1010 1001 0011 */ &move_mirs_mird_0, -/* 1010 1001 0100 */ &move_mirs_mird_0, -/* 1010 1001 0101 */ &move_mirs_mird_0, -/* 1010 1001 0110 */ &move_mirs_mird_0, -/* 1010 1001 0111 */ &move_mirs_mird_0, -/* 1010 1001 1000 */ &move_mirs_mird_0, -/* 1010 1001 1001 */ &move_mirs_mird_0, -/* 1010 1001 1010 */ &move_mirs_mird_0, -/* 1010 1001 1011 */ &move_mirs_mird_0, -/* 1010 1001 1100 */ &move_mirs_mird_0, -/* 1010 1001 1101 */ &move_mirs_mird_0, -/* 1010 1001 1110 */ &move_mirs_mird_0, -/* 1010 1001 1111 */ &move_mirs_mird_0, - -/* 1010 1010 0000 */ &move_mirs_mird_1, -/* 1010 1010 0001 */ &move_mirs_mird_1, -/* 1010 1010 0010 */ &move_mirs_mird_1, -/* 1010 1010 0011 */ &move_mirs_mird_1, -/* 1010 1010 0100 */ &move_mirs_mird_1, -/* 1010 1010 0101 */ &move_mirs_mird_1, -/* 1010 1010 0110 */ &move_mirs_mird_1, -/* 1010 1010 0111 */ &move_mirs_mird_1, -/* 1010 1010 1000 */ &move_mirs_mird_1, -/* 1010 1010 1001 */ &move_mirs_mird_1, -/* 1010 1010 1010 */ &move_mirs_mird_1, -/* 1010 1010 1011 */ &move_mirs_mird_1, -/* 1010 1010 1100 */ &move_mirs_mird_1, -/* 1010 1010 1101 */ &move_mirs_mird_1, -/* 1010 1010 1110 */ &move_mirs_mird_1, -/* 1010 1010 1111 */ &move_mirs_mird_1, - -/* 1010 1011 0000 */ &move_mirs_mird_1, -/* 1010 1011 0001 */ &move_mirs_mird_1, -/* 1010 1011 0010 */ &move_mirs_mird_1, -/* 1010 1011 0011 */ &move_mirs_mird_1, -/* 1010 1011 0100 */ &move_mirs_mird_1, -/* 1010 1011 0101 */ &move_mirs_mird_1, -/* 1010 1011 0110 */ &move_mirs_mird_1, -/* 1010 1011 0111 */ &move_mirs_mird_1, -/* 1010 1011 1000 */ &move_mirs_mird_1, -/* 1010 1011 1001 */ &move_mirs_mird_1, -/* 1010 1011 1010 */ &move_mirs_mird_1, -/* 1010 1011 1011 */ &move_mirs_mird_1, -/* 1010 1011 1100 */ &move_mirs_mird_1, -/* 1010 1011 1101 */ &move_mirs_mird_1, -/* 1010 1011 1110 */ &move_mirs_mird_1, -/* 1010 1011 1111 */ &move_mirs_mird_1, - -/* 1010 1100 0000 */ &movb_rs_irdo, -/* 1010 1100 0001 */ &movb_rs_irdo, -/* 1010 1100 0010 */ &movb_rs_irdo, -/* 1010 1100 0011 */ &movb_rs_irdo, -/* 1010 1100 0100 */ &movb_rs_irdo, -/* 1010 1100 0101 */ &movb_rs_irdo, -/* 1010 1100 0110 */ &movb_rs_irdo, -/* 1010 1100 0111 */ &movb_rs_irdo, -/* 1010 1100 1000 */ &movb_rs_irdo, -/* 1010 1100 1001 */ &movb_rs_irdo, -/* 1010 1100 1010 */ &movb_rs_irdo, -/* 1010 1100 1011 */ &movb_rs_irdo, -/* 1010 1100 1100 */ &movb_rs_irdo, -/* 1010 1100 1101 */ &movb_rs_irdo, -/* 1010 1100 1110 */ &movb_rs_irdo, -/* 1010 1100 1111 */ &movb_rs_irdo, - -/* 1010 1101 0000 */ &movb_rs_irdo, -/* 1010 1101 0001 */ &movb_rs_irdo, -/* 1010 1101 0010 */ &movb_rs_irdo, -/* 1010 1101 0011 */ &movb_rs_irdo, -/* 1010 1101 0100 */ &movb_rs_irdo, -/* 1010 1101 0101 */ &movb_rs_irdo, -/* 1010 1101 0110 */ &movb_rs_irdo, -/* 1010 1101 0111 */ &movb_rs_irdo, -/* 1010 1101 1000 */ &movb_rs_irdo, -/* 1010 1101 1001 */ &movb_rs_irdo, -/* 1010 1101 1010 */ &movb_rs_irdo, -/* 1010 1101 1011 */ &movb_rs_irdo, -/* 1010 1101 1100 */ &movb_rs_irdo, -/* 1010 1101 1101 */ &movb_rs_irdo, -/* 1010 1101 1110 */ &movb_rs_irdo, -/* 1010 1101 1111 */ &movb_rs_irdo, - -/* 1010 1110 0000 */ &movb_irso_rd, -/* 1010 1110 0001 */ &movb_irso_rd, -/* 1010 1110 0010 */ &movb_irso_rd, -/* 1010 1110 0011 */ &movb_irso_rd, -/* 1010 1110 0100 */ &movb_irso_rd, -/* 1010 1110 0101 */ &movb_irso_rd, -/* 1010 1110 0110 */ &movb_irso_rd, -/* 1010 1110 0111 */ &movb_irso_rd, -/* 1010 1110 1000 */ &movb_irso_rd, -/* 1010 1110 1001 */ &movb_irso_rd, -/* 1010 1110 1010 */ &movb_irso_rd, -/* 1010 1110 1011 */ &movb_irso_rd, -/* 1010 1110 1100 */ &movb_irso_rd, -/* 1010 1110 1101 */ &movb_irso_rd, -/* 1010 1110 1110 */ &movb_irso_rd, -/* 1010 1110 1111 */ &movb_irso_rd, - -/* 1010 1111 0000 */ &movb_irso_rd, -/* 1010 1111 0001 */ &movb_irso_rd, -/* 1010 1111 0010 */ &movb_irso_rd, -/* 1010 1111 0011 */ &movb_irso_rd, -/* 1010 1111 0100 */ &movb_irso_rd, -/* 1010 1111 0101 */ &movb_irso_rd, -/* 1010 1111 0110 */ &movb_irso_rd, -/* 1010 1111 0111 */ &movb_irso_rd, -/* 1010 1111 1000 */ &movb_irso_rd, -/* 1010 1111 1001 */ &movb_irso_rd, -/* 1010 1111 1010 */ &movb_irso_rd, -/* 1010 1111 1011 */ &movb_irso_rd, -/* 1010 1111 1100 */ &movb_irso_rd, -/* 1010 1111 1101 */ &movb_irso_rd, -/* 1010 1111 1110 */ &movb_irso_rd, -/* 1010 1111 1111 */ &movb_irso_rd, - -/* 1011 0000 0000 */ &move_rs_irdo_0, -/* 1011 0000 0001 */ &move_rs_irdo_0, -/* 1011 0000 0010 */ &move_rs_irdo_0, -/* 1011 0000 0011 */ &move_rs_irdo_0, -/* 1011 0000 0100 */ &move_rs_irdo_0, -/* 1011 0000 0101 */ &move_rs_irdo_0, -/* 1011 0000 0110 */ &move_rs_irdo_0, -/* 1011 0000 0111 */ &move_rs_irdo_0, -/* 1011 0000 1000 */ &move_rs_irdo_0, -/* 1011 0000 1001 */ &move_rs_irdo_0, -/* 1011 0000 1010 */ &move_rs_irdo_0, -/* 1011 0000 1011 */ &move_rs_irdo_0, -/* 1011 0000 1100 */ &move_rs_irdo_0, -/* 1011 0000 1101 */ &move_rs_irdo_0, -/* 1011 0000 1110 */ &move_rs_irdo_0, -/* 1011 0000 1111 */ &move_rs_irdo_0, - -/* 1011 0001 0000 */ &move_rs_irdo_0, -/* 1011 0001 0001 */ &move_rs_irdo_0, -/* 1011 0001 0010 */ &move_rs_irdo_0, -/* 1011 0001 0011 */ &move_rs_irdo_0, -/* 1011 0001 0100 */ &move_rs_irdo_0, -/* 1011 0001 0101 */ &move_rs_irdo_0, -/* 1011 0001 0110 */ &move_rs_irdo_0, -/* 1011 0001 0111 */ &move_rs_irdo_0, -/* 1011 0001 1000 */ &move_rs_irdo_0, -/* 1011 0001 1001 */ &move_rs_irdo_0, -/* 1011 0001 1010 */ &move_rs_irdo_0, -/* 1011 0001 1011 */ &move_rs_irdo_0, -/* 1011 0001 1100 */ &move_rs_irdo_0, -/* 1011 0001 1101 */ &move_rs_irdo_0, -/* 1011 0001 1110 */ &move_rs_irdo_0, -/* 1011 0001 1111 */ &move_rs_irdo_0, - -/* 1011 0010 0000 */ &move_rs_irdo_1, -/* 1011 0010 0001 */ &move_rs_irdo_1, -/* 1011 0010 0010 */ &move_rs_irdo_1, -/* 1011 0010 0011 */ &move_rs_irdo_1, -/* 1011 0010 0100 */ &move_rs_irdo_1, -/* 1011 0010 0101 */ &move_rs_irdo_1, -/* 1011 0010 0110 */ &move_rs_irdo_1, -/* 1011 0010 0111 */ &move_rs_irdo_1, -/* 1011 0010 1000 */ &move_rs_irdo_1, -/* 1011 0010 1001 */ &move_rs_irdo_1, -/* 1011 0010 1010 */ &move_rs_irdo_1, -/* 1011 0010 1011 */ &move_rs_irdo_1, -/* 1011 0010 1100 */ &move_rs_irdo_1, -/* 1011 0010 1101 */ &move_rs_irdo_1, -/* 1011 0010 1110 */ &move_rs_irdo_1, -/* 1011 0010 1111 */ &move_rs_irdo_1, - -/* 1011 0011 0000 */ &move_rs_irdo_1, -/* 1011 0011 0001 */ &move_rs_irdo_1, -/* 1011 0011 0010 */ &move_rs_irdo_1, -/* 1011 0011 0011 */ &move_rs_irdo_1, -/* 1011 0011 0100 */ &move_rs_irdo_1, -/* 1011 0011 0101 */ &move_rs_irdo_1, -/* 1011 0011 0110 */ &move_rs_irdo_1, -/* 1011 0011 0111 */ &move_rs_irdo_1, -/* 1011 0011 1000 */ &move_rs_irdo_1, -/* 1011 0011 1001 */ &move_rs_irdo_1, -/* 1011 0011 1010 */ &move_rs_irdo_1, -/* 1011 0011 1011 */ &move_rs_irdo_1, -/* 1011 0011 1100 */ &move_rs_irdo_1, -/* 1011 0011 1101 */ &move_rs_irdo_1, -/* 1011 0011 1110 */ &move_rs_irdo_1, -/* 1011 0011 1111 */ &move_rs_irdo_1, - -/* 1011 0100 0000 */ &move_irso_rd_0, -/* 1011 0100 0001 */ &move_irso_rd_0, -/* 1011 0100 0010 */ &move_irso_rd_0, -/* 1011 0100 0011 */ &move_irso_rd_0, -/* 1011 0100 0100 */ &move_irso_rd_0, -/* 1011 0100 0101 */ &move_irso_rd_0, -/* 1011 0100 0110 */ &move_irso_rd_0, -/* 1011 0100 0111 */ &move_irso_rd_0, -/* 1011 0100 1000 */ &move_irso_rd_0, -/* 1011 0100 1001 */ &move_irso_rd_0, -/* 1011 0100 1010 */ &move_irso_rd_0, -/* 1011 0100 1011 */ &move_irso_rd_0, -/* 1011 0100 1100 */ &move_irso_rd_0, -/* 1011 0100 1101 */ &move_irso_rd_0, -/* 1011 0100 1110 */ &move_irso_rd_0, -/* 1011 0100 1111 */ &move_irso_rd_0, - -/* 1011 0101 0000 */ &move_irso_rd_0, -/* 1011 0101 0001 */ &move_irso_rd_0, -/* 1011 0101 0010 */ &move_irso_rd_0, -/* 1011 0101 0011 */ &move_irso_rd_0, -/* 1011 0101 0100 */ &move_irso_rd_0, -/* 1011 0101 0101 */ &move_irso_rd_0, -/* 1011 0101 0110 */ &move_irso_rd_0, -/* 1011 0101 0111 */ &move_irso_rd_0, -/* 1011 0101 1000 */ &move_irso_rd_0, -/* 1011 0101 1001 */ &move_irso_rd_0, -/* 1011 0101 1010 */ &move_irso_rd_0, -/* 1011 0101 1011 */ &move_irso_rd_0, -/* 1011 0101 1100 */ &move_irso_rd_0, -/* 1011 0101 1101 */ &move_irso_rd_0, -/* 1011 0101 1110 */ &move_irso_rd_0, -/* 1011 0101 1111 */ &move_irso_rd_0, - -/* 1011 0110 0000 */ &move_irso_rd_1, -/* 1011 0110 0001 */ &move_irso_rd_1, -/* 1011 0110 0010 */ &move_irso_rd_1, -/* 1011 0110 0011 */ &move_irso_rd_1, -/* 1011 0110 0100 */ &move_irso_rd_1, -/* 1011 0110 0101 */ &move_irso_rd_1, -/* 1011 0110 0110 */ &move_irso_rd_1, -/* 1011 0110 0111 */ &move_irso_rd_1, -/* 1011 0110 1000 */ &move_irso_rd_1, -/* 1011 0110 1001 */ &move_irso_rd_1, -/* 1011 0110 1010 */ &move_irso_rd_1, -/* 1011 0110 1011 */ &move_irso_rd_1, -/* 1011 0110 1100 */ &move_irso_rd_1, -/* 1011 0110 1101 */ &move_irso_rd_1, -/* 1011 0110 1110 */ &move_irso_rd_1, -/* 1011 0110 1111 */ &move_irso_rd_1, - -/* 1011 0111 0000 */ &move_irso_rd_1, -/* 1011 0111 0001 */ &move_irso_rd_1, -/* 1011 0111 0010 */ &move_irso_rd_1, -/* 1011 0111 0011 */ &move_irso_rd_1, -/* 1011 0111 0100 */ &move_irso_rd_1, -/* 1011 0111 0101 */ &move_irso_rd_1, -/* 1011 0111 0110 */ &move_irso_rd_1, -/* 1011 0111 0111 */ &move_irso_rd_1, -/* 1011 0111 1000 */ &move_irso_rd_1, -/* 1011 0111 1001 */ &move_irso_rd_1, -/* 1011 0111 1010 */ &move_irso_rd_1, -/* 1011 0111 1011 */ &move_irso_rd_1, -/* 1011 0111 1100 */ &move_irso_rd_1, -/* 1011 0111 1101 */ &move_irso_rd_1, -/* 1011 0111 1110 */ &move_irso_rd_1, -/* 1011 0111 1111 */ &move_irso_rd_1, - -/* 1011 1000 0000 */ &move_irso_irdo_0, -/* 1011 1000 0001 */ &move_irso_irdo_0, -/* 1011 1000 0010 */ &move_irso_irdo_0, -/* 1011 1000 0011 */ &move_irso_irdo_0, -/* 1011 1000 0100 */ &move_irso_irdo_0, -/* 1011 1000 0101 */ &move_irso_irdo_0, -/* 1011 1000 0110 */ &move_irso_irdo_0, -/* 1011 1000 0111 */ &move_irso_irdo_0, -/* 1011 1000 1000 */ &move_irso_irdo_0, -/* 1011 1000 1001 */ &move_irso_irdo_0, -/* 1011 1000 1010 */ &move_irso_irdo_0, -/* 1011 1000 1011 */ &move_irso_irdo_0, -/* 1011 1000 1100 */ &move_irso_irdo_0, -/* 1011 1000 1101 */ &move_irso_irdo_0, -/* 1011 1000 1110 */ &move_irso_irdo_0, -/* 1011 1000 1111 */ &move_irso_irdo_0, - -/* 1011 1001 0000 */ &move_irso_irdo_0, -/* 1011 1001 0001 */ &move_irso_irdo_0, -/* 1011 1001 0010 */ &move_irso_irdo_0, -/* 1011 1001 0011 */ &move_irso_irdo_0, -/* 1011 1001 0100 */ &move_irso_irdo_0, -/* 1011 1001 0101 */ &move_irso_irdo_0, -/* 1011 1001 0110 */ &move_irso_irdo_0, -/* 1011 1001 0111 */ &move_irso_irdo_0, -/* 1011 1001 1000 */ &move_irso_irdo_0, -/* 1011 1001 1001 */ &move_irso_irdo_0, -/* 1011 1001 1010 */ &move_irso_irdo_0, -/* 1011 1001 1011 */ &move_irso_irdo_0, -/* 1011 1001 1100 */ &move_irso_irdo_0, -/* 1011 1001 1101 */ &move_irso_irdo_0, -/* 1011 1001 1110 */ &move_irso_irdo_0, -/* 1011 1001 1111 */ &move_irso_irdo_0, - -/* 1011 1010 0000 */ &move_irso_irdo_1, -/* 1011 1010 0001 */ &move_irso_irdo_1, -/* 1011 1010 0010 */ &move_irso_irdo_1, -/* 1011 1010 0011 */ &move_irso_irdo_1, -/* 1011 1010 0100 */ &move_irso_irdo_1, -/* 1011 1010 0101 */ &move_irso_irdo_1, -/* 1011 1010 0110 */ &move_irso_irdo_1, -/* 1011 1010 0111 */ &move_irso_irdo_1, -/* 1011 1010 1000 */ &move_irso_irdo_1, -/* 1011 1010 1001 */ &move_irso_irdo_1, -/* 1011 1010 1010 */ &move_irso_irdo_1, -/* 1011 1010 1011 */ &move_irso_irdo_1, -/* 1011 1010 1100 */ &move_irso_irdo_1, -/* 1011 1010 1101 */ &move_irso_irdo_1, -/* 1011 1010 1110 */ &move_irso_irdo_1, -/* 1011 1010 1111 */ &move_irso_irdo_1, - -/* 1011 1011 0000 */ &move_irso_irdo_1, -/* 1011 1011 0001 */ &move_irso_irdo_1, -/* 1011 1011 0010 */ &move_irso_irdo_1, -/* 1011 1011 0011 */ &move_irso_irdo_1, -/* 1011 1011 0100 */ &move_irso_irdo_1, -/* 1011 1011 0101 */ &move_irso_irdo_1, -/* 1011 1011 0110 */ &move_irso_irdo_1, -/* 1011 1011 0111 */ &move_irso_irdo_1, -/* 1011 1011 1000 */ &move_irso_irdo_1, -/* 1011 1011 1001 */ &move_irso_irdo_1, -/* 1011 1011 1010 */ &move_irso_irdo_1, -/* 1011 1011 1011 */ &move_irso_irdo_1, -/* 1011 1011 1100 */ &move_irso_irdo_1, -/* 1011 1011 1101 */ &move_irso_irdo_1, -/* 1011 1011 1110 */ &move_irso_irdo_1, -/* 1011 1011 1111 */ &move_irso_irdo_1, - -/* 1011 1100 0000 */ &movb_irso_irdo, -/* 1011 1100 0001 */ &movb_irso_irdo, -/* 1011 1100 0010 */ &movb_irso_irdo, -/* 1011 1100 0011 */ &movb_irso_irdo, -/* 1011 1100 0100 */ &movb_irso_irdo, -/* 1011 1100 0101 */ &movb_irso_irdo, -/* 1011 1100 0110 */ &movb_irso_irdo, -/* 1011 1100 0111 */ &movb_irso_irdo, -/* 1011 1100 1000 */ &movb_irso_irdo, -/* 1011 1100 1001 */ &movb_irso_irdo, -/* 1011 1100 1010 */ &movb_irso_irdo, -/* 1011 1100 1011 */ &movb_irso_irdo, -/* 1011 1100 1100 */ &movb_irso_irdo, -/* 1011 1100 1101 */ &movb_irso_irdo, -/* 1011 1100 1110 */ &movb_irso_irdo, -/* 1011 1100 1111 */ &movb_irso_irdo, - -/* 1011 1101 0000 */ &movb_irso_irdo, -/* 1011 1101 0001 */ &movb_irso_irdo, -/* 1011 1101 0010 */ &movb_irso_irdo, -/* 1011 1101 0011 */ &movb_irso_irdo, -/* 1011 1101 0100 */ &movb_irso_irdo, -/* 1011 1101 0101 */ &movb_irso_irdo, -/* 1011 1101 0110 */ &movb_irso_irdo, -/* 1011 1101 0111 */ &movb_irso_irdo, -/* 1011 1101 1000 */ &movb_irso_irdo, -/* 1011 1101 1001 */ &movb_irso_irdo, -/* 1011 1101 1010 */ &movb_irso_irdo, -/* 1011 1101 1011 */ &movb_irso_irdo, -/* 1011 1101 1100 */ &movb_irso_irdo, -/* 1011 1101 1101 */ &movb_irso_irdo, -/* 1011 1101 1110 */ &movb_irso_irdo, -/* 1011 1101 1111 */ &movb_irso_irdo, - -/* 1011 1110 0000 */ &unimplemented, -/* 1011 1110 0001 */ &unimplemented, -/* 1011 1110 0010 */ &unimplemented, -/* 1011 1110 0011 */ &unimplemented, -/* 1011 1110 0100 */ &unimplemented, -/* 1011 1110 0101 */ &unimplemented, -/* 1011 1110 0110 */ &unimplemented, -/* 1011 1110 0111 */ &unimplemented, -/* 1011 1110 1000 */ &unimplemented, -/* 1011 1110 1001 */ &unimplemented, -/* 1011 1110 1010 */ &unimplemented, -/* 1011 1110 1011 */ &unimplemented, -/* 1011 1110 1100 */ &unimplemented, -/* 1011 1110 1101 */ &unimplemented, -/* 1011 1110 1110 */ &unimplemented, -/* 1011 1110 1111 */ &unimplemented, - -/* 1011 1111 0000 */ &unimplemented, -/* 1011 1111 0001 */ &unimplemented, -/* 1011 1111 0010 */ &unimplemented, -/* 1011 1111 0011 */ &unimplemented, -/* 1011 1111 0100 */ &unimplemented, -/* 1011 1111 0101 */ &unimplemented, -/* 1011 1111 0110 */ &unimplemented, -/* 1011 1111 0111 */ &unimplemented, -/* 1011 1111 1000 */ &unimplemented, -/* 1011 1111 1001 */ &unimplemented, -/* 1011 1111 1010 */ &unimplemented, -/* 1011 1111 1011 */ &unimplemented, -/* 1011 1111 1100 */ &unimplemented, -/* 1011 1111 1101 */ &unimplemented, -/* 1011 1111 1110 */ &unimplemented, -/* 1011 1111 1111 */ &unimplemented, - -/* 1100 0000 0000 */ &jr_uc_0, -/* 1100 0000 0001 */ &jr_uc, -/* 1100 0000 0010 */ &jr_uc, -/* 1100 0000 0011 */ &jr_uc, -/* 1100 0000 0100 */ &jr_uc, -/* 1100 0000 0101 */ &jr_uc, -/* 1100 0000 0110 */ &jr_uc, -/* 1100 0000 0111 */ &jr_uc, -/* 1100 0000 1000 */ &jr_uc_8, -/* 1100 0000 1001 */ &jr_uc, -/* 1100 0000 1010 */ &jr_uc, -/* 1100 0000 1011 */ &jr_uc, -/* 1100 0000 1100 */ &jr_uc, -/* 1100 0000 1101 */ &jr_uc, -/* 1100 0000 1110 */ &jr_uc, -/* 1100 0000 1111 */ &jr_uc, - -/* 1100 0001 0000 */ &jr_p_0, -/* 1100 0001 0001 */ &jr_p, -/* 1100 0001 0010 */ &jr_p, -/* 1100 0001 0011 */ &jr_p, -/* 1100 0001 0100 */ &jr_p, -/* 1100 0001 0101 */ &jr_p, -/* 1100 0001 0110 */ &jr_p, -/* 1100 0001 0111 */ &jr_p, -/* 1100 0001 1000 */ &jr_p_8, -/* 1100 0001 1001 */ &jr_p, -/* 1100 0001 1010 */ &jr_p, -/* 1100 0001 1011 */ &jr_p, -/* 1100 0001 1100 */ &jr_p, -/* 1100 0001 1101 */ &jr_p, -/* 1100 0001 1110 */ &jr_p, -/* 1100 0001 1111 */ &jr_p, - -/* 1100 0010 0000 */ &jr_ls_0, -/* 1100 0010 0001 */ &jr_ls, -/* 1100 0010 0010 */ &jr_ls, -/* 1100 0010 0011 */ &jr_ls, -/* 1100 0010 0100 */ &jr_ls, -/* 1100 0010 0101 */ &jr_ls, -/* 1100 0010 0110 */ &jr_ls, -/* 1100 0010 0111 */ &jr_ls, -/* 1100 0010 1000 */ &jr_ls_8, -/* 1100 0010 1001 */ &jr_ls, -/* 1100 0010 1010 */ &jr_ls, -/* 1100 0010 1011 */ &jr_ls, -/* 1100 0010 1100 */ &jr_ls, -/* 1100 0010 1101 */ &jr_ls, -/* 1100 0010 1110 */ &jr_ls, -/* 1100 0010 1111 */ &jr_ls, - -/* 1100 0011 0000 */ &jr_hi_0, -/* 1100 0011 0001 */ &jr_hi, -/* 1100 0011 0010 */ &jr_hi, -/* 1100 0011 0011 */ &jr_hi, -/* 1100 0011 0100 */ &jr_hi, -/* 1100 0011 0101 */ &jr_hi, -/* 1100 0011 0110 */ &jr_hi, -/* 1100 0011 0111 */ &jr_hi, -/* 1100 0011 1000 */ &jr_hi_8, -/* 1100 0011 1001 */ &jr_hi, -/* 1100 0011 1010 */ &jr_hi, -/* 1100 0011 1011 */ &jr_hi, -/* 1100 0011 1100 */ &jr_hi, -/* 1100 0011 1101 */ &jr_hi, -/* 1100 0011 1110 */ &jr_hi, -/* 1100 0011 1111 */ &jr_hi, - -/* 1100 0100 0000 */ &jr_lt_0, -/* 1100 0100 0001 */ &jr_lt, -/* 1100 0100 0010 */ &jr_lt, -/* 1100 0100 0011 */ &jr_lt, -/* 1100 0100 0100 */ &jr_lt, -/* 1100 0100 0101 */ &jr_lt, -/* 1100 0100 0110 */ &jr_lt, -/* 1100 0100 0111 */ &jr_lt, -/* 1100 0100 1000 */ &jr_lt_8, -/* 1100 0100 1001 */ &jr_lt, -/* 1100 0100 1010 */ &jr_lt, -/* 1100 0100 1011 */ &jr_lt, -/* 1100 0100 1100 */ &jr_lt, -/* 1100 0100 1101 */ &jr_lt, -/* 1100 0100 1110 */ &jr_lt, -/* 1100 0100 1111 */ &jr_lt, - -/* 1100 0101 0000 */ &jr_ge_0, -/* 1100 0101 0001 */ &jr_ge, -/* 1100 0101 0010 */ &jr_ge, -/* 1100 0101 0011 */ &jr_ge, -/* 1100 0101 0100 */ &jr_ge, -/* 1100 0101 0101 */ &jr_ge, -/* 1100 0101 0110 */ &jr_ge, -/* 1100 0101 0111 */ &jr_ge, -/* 1100 0101 1000 */ &jr_ge_8, -/* 1100 0101 1001 */ &jr_ge, -/* 1100 0101 1010 */ &jr_ge, -/* 1100 0101 1011 */ &jr_ge, -/* 1100 0101 1100 */ &jr_ge, -/* 1100 0101 1101 */ &jr_ge, -/* 1100 0101 1110 */ &jr_ge, -/* 1100 0101 1111 */ &jr_ge, - -/* 1100 0110 0000 */ &jr_le_0, -/* 1100 0110 0001 */ &jr_le, -/* 1100 0110 0010 */ &jr_le, -/* 1100 0110 0011 */ &jr_le, -/* 1100 0110 0100 */ &jr_le, -/* 1100 0110 0101 */ &jr_le, -/* 1100 0110 0110 */ &jr_le, -/* 1100 0110 0111 */ &jr_le, -/* 1100 0110 1000 */ &jr_le_8, -/* 1100 0110 1001 */ &jr_le, -/* 1100 0110 1010 */ &jr_le, -/* 1100 0110 1011 */ &jr_le, -/* 1100 0110 1100 */ &jr_le, -/* 1100 0110 1101 */ &jr_le, -/* 1100 0110 1110 */ &jr_le, -/* 1100 0110 1111 */ &jr_le, - -/* 1100 0111 0000 */ &jr_gt_0, -/* 1100 0111 0001 */ &jr_gt, -/* 1100 0111 0010 */ &jr_gt, -/* 1100 0111 0011 */ &jr_gt, -/* 1100 0111 0100 */ &jr_gt, -/* 1100 0111 0101 */ &jr_gt, -/* 1100 0111 0110 */ &jr_gt, -/* 1100 0111 0111 */ &jr_gt, -/* 1100 0111 1000 */ &jr_gt_8, -/* 1100 0111 1001 */ &jr_gt, -/* 1100 0111 1010 */ &jr_gt, -/* 1100 0111 1011 */ &jr_gt, -/* 1100 0111 1100 */ &jr_gt, -/* 1100 0111 1101 */ &jr_gt, -/* 1100 0111 1110 */ &jr_gt, -/* 1100 0111 1111 */ &jr_gt, - -/* 1100 1000 0000 */ &jr_c_0, -/* 1100 1000 0001 */ &jr_c, -/* 1100 1000 0010 */ &jr_c, -/* 1100 1000 0011 */ &jr_c, -/* 1100 1000 0100 */ &jr_c, -/* 1100 1000 0101 */ &jr_c, -/* 1100 1000 0110 */ &jr_c, -/* 1100 1000 0111 */ &jr_c, -/* 1100 1000 1000 */ &jr_c_8, -/* 1100 1000 1001 */ &jr_c, -/* 1100 1000 1010 */ &jr_c, -/* 1100 1000 1011 */ &jr_c, -/* 1100 1000 1100 */ &jr_c, -/* 1100 1000 1101 */ &jr_c, -/* 1100 1000 1110 */ &jr_c, -/* 1100 1000 1111 */ &jr_c, - -/* 1100 1001 0000 */ &jr_nc_0, -/* 1100 1001 0001 */ &jr_nc, -/* 1100 1001 0010 */ &jr_nc, -/* 1100 1001 0011 */ &jr_nc, -/* 1100 1001 0100 */ &jr_nc, -/* 1100 1001 0101 */ &jr_nc, -/* 1100 1001 0110 */ &jr_nc, -/* 1100 1001 0111 */ &jr_nc, -/* 1100 1001 1000 */ &jr_nc_8, -/* 1100 1001 1001 */ &jr_nc, -/* 1100 1001 1010 */ &jr_nc, -/* 1100 1001 1011 */ &jr_nc, -/* 1100 1001 1100 */ &jr_nc, -/* 1100 1001 1101 */ &jr_nc, -/* 1100 1001 1110 */ &jr_nc, -/* 1100 1001 1111 */ &jr_nc, - -/* 1100 1010 0000 */ &jr_eq_0, -/* 1100 1010 0001 */ &jr_eq, -/* 1100 1010 0010 */ &jr_eq, -/* 1100 1010 0011 */ &jr_eq, -/* 1100 1010 0100 */ &jr_eq, -/* 1100 1010 0101 */ &jr_eq, -/* 1100 1010 0110 */ &jr_eq, -/* 1100 1010 0111 */ &jr_eq, -/* 1100 1010 1000 */ &jr_eq_8, -/* 1100 1010 1001 */ &jr_eq, -/* 1100 1010 1010 */ &jr_eq, -/* 1100 1010 1011 */ &jr_eq, -/* 1100 1010 1100 */ &jr_eq, -/* 1100 1010 1101 */ &jr_eq, -/* 1100 1010 1110 */ &jr_eq, -/* 1100 1010 1111 */ &jr_eq, - -/* 1100 1011 0000 */ &jr_ne_0, -/* 1100 1011 0001 */ &jr_ne, -/* 1100 1011 0010 */ &jr_ne, -/* 1100 1011 0011 */ &jr_ne, -/* 1100 1011 0100 */ &jr_ne, -/* 1100 1011 0101 */ &jr_ne, -/* 1100 1011 0110 */ &jr_ne, -/* 1100 1011 0111 */ &jr_ne, -/* 1100 1011 1000 */ &jr_ne_8, -/* 1100 1011 1001 */ &jr_ne, -/* 1100 1011 1010 */ &jr_ne, -/* 1100 1011 1011 */ &jr_ne, -/* 1100 1011 1100 */ &jr_ne, -/* 1100 1011 1101 */ &jr_ne, -/* 1100 1011 1110 */ &jr_ne, -/* 1100 1011 1111 */ &jr_ne, - -/* 1100 1100 0000 */ &jr_v_0, -/* 1100 1100 0001 */ &jr_v, -/* 1100 1100 0010 */ &jr_v, -/* 1100 1100 0011 */ &jr_v, -/* 1100 1100 0100 */ &jr_v, -/* 1100 1100 0101 */ &jr_v, -/* 1100 1100 0110 */ &jr_v, -/* 1100 1100 0111 */ &jr_v, -/* 1100 1100 1000 */ &jr_v_8, -/* 1100 1100 1001 */ &jr_v, -/* 1100 1100 1010 */ &jr_v, -/* 1100 1100 1011 */ &jr_v, -/* 1100 1100 1100 */ &jr_v, -/* 1100 1100 1101 */ &jr_v, -/* 1100 1100 1110 */ &jr_v, -/* 1100 1100 1111 */ &jr_v, - -/* 1100 1101 0000 */ &jr_nv_0, -/* 1100 1101 0001 */ &jr_nv, -/* 1100 1101 0010 */ &jr_nv, -/* 1100 1101 0011 */ &jr_nv, -/* 1100 1101 0100 */ &jr_nv, -/* 1100 1101 0101 */ &jr_nv, -/* 1100 1101 0110 */ &jr_nv, -/* 1100 1101 0111 */ &jr_nv, -/* 1100 1101 1000 */ &jr_nv_8, -/* 1100 1101 1001 */ &jr_nv, -/* 1100 1101 1010 */ &jr_nv, -/* 1100 1101 1011 */ &jr_nv, -/* 1100 1101 1100 */ &jr_nv, -/* 1100 1101 1101 */ &jr_nv, -/* 1100 1101 1110 */ &jr_nv, -/* 1100 1101 1111 */ &jr_nv, - -/* 1100 1110 0000 */ &jr_n_0, -/* 1100 1110 0001 */ &jr_n, -/* 1100 1110 0010 */ &jr_n, -/* 1100 1110 0011 */ &jr_n, -/* 1100 1110 0100 */ &jr_n, -/* 1100 1110 0101 */ &jr_n, -/* 1100 1110 0110 */ &jr_n, -/* 1100 1110 0111 */ &jr_n, -/* 1100 1110 1000 */ &jr_n_8, -/* 1100 1110 1001 */ &jr_n, -/* 1100 1110 1010 */ &jr_n, -/* 1100 1110 1011 */ &jr_n, -/* 1100 1110 1100 */ &jr_n, -/* 1100 1110 1101 */ &jr_n, -/* 1100 1110 1110 */ &jr_n, -/* 1100 1110 1111 */ &jr_n, - -/* 1100 1111 0000 */ &jr_nn_0, -/* 1100 1111 0001 */ &jr_nn, -/* 1100 1111 0010 */ &jr_nn, -/* 1100 1111 0011 */ &jr_nn, -/* 1100 1111 0100 */ &jr_nn, -/* 1100 1111 0101 */ &jr_nn, -/* 1100 1111 0110 */ &jr_nn, -/* 1100 1111 0111 */ &jr_nn, -/* 1100 1111 1000 */ &jr_nn_8, -/* 1100 1111 1001 */ &jr_nn, -/* 1100 1111 1010 */ &jr_nn, -/* 1100 1111 1011 */ &jr_nn, -/* 1100 1111 1100 */ &jr_nn, -/* 1100 1111 1101 */ &jr_nn, -/* 1100 1111 1110 */ &jr_nn, -/* 1100 1111 1111 */ &jr_nn, - -/* 1101 0000 0000 */ &move_irso_irdp_0, -/* 1101 0000 0001 */ &move_irso_irdp_0, -/* 1101 0000 0010 */ &move_irso_irdp_0, -/* 1101 0000 0011 */ &move_irso_irdp_0, -/* 1101 0000 0100 */ &move_irso_irdp_0, -/* 1101 0000 0101 */ &move_irso_irdp_0, -/* 1101 0000 0110 */ &move_irso_irdp_0, -/* 1101 0000 0111 */ &move_irso_irdp_0, -/* 1101 0000 1000 */ &move_irso_irdp_0, -/* 1101 0000 1001 */ &move_irso_irdp_0, -/* 1101 0000 1010 */ &move_irso_irdp_0, -/* 1101 0000 1011 */ &move_irso_irdp_0, -/* 1101 0000 1100 */ &move_irso_irdp_0, -/* 1101 0000 1101 */ &move_irso_irdp_0, -/* 1101 0000 1110 */ &move_irso_irdp_0, -/* 1101 0000 1111 */ &move_irso_irdp_0, - -/* 1101 0001 0000 */ &move_irso_irdp_0, -/* 1101 0001 0001 */ &move_irso_irdp_0, -/* 1101 0001 0010 */ &move_irso_irdp_0, -/* 1101 0001 0011 */ &move_irso_irdp_0, -/* 1101 0001 0100 */ &move_irso_irdp_0, -/* 1101 0001 0101 */ &move_irso_irdp_0, -/* 1101 0001 0110 */ &move_irso_irdp_0, -/* 1101 0001 0111 */ &move_irso_irdp_0, -/* 1101 0001 1000 */ &move_irso_irdp_0, -/* 1101 0001 1001 */ &move_irso_irdp_0, -/* 1101 0001 1010 */ &move_irso_irdp_0, -/* 1101 0001 1011 */ &move_irso_irdp_0, -/* 1101 0001 1100 */ &move_irso_irdp_0, -/* 1101 0001 1101 */ &move_irso_irdp_0, -/* 1101 0001 1110 */ &move_irso_irdp_0, -/* 1101 0001 1111 */ &move_irso_irdp_0, - -/* 1101 0010 0000 */ &move_irso_irdp_1, -/* 1101 0010 0001 */ &move_irso_irdp_1, -/* 1101 0010 0010 */ &move_irso_irdp_1, -/* 1101 0010 0011 */ &move_irso_irdp_1, -/* 1101 0010 0100 */ &move_irso_irdp_1, -/* 1101 0010 0101 */ &move_irso_irdp_1, -/* 1101 0010 0110 */ &move_irso_irdp_1, -/* 1101 0010 0111 */ &move_irso_irdp_1, -/* 1101 0010 1000 */ &move_irso_irdp_1, -/* 1101 0010 1001 */ &move_irso_irdp_1, -/* 1101 0010 1010 */ &move_irso_irdp_1, -/* 1101 0010 1011 */ &move_irso_irdp_1, -/* 1101 0010 1100 */ &move_irso_irdp_1, -/* 1101 0010 1101 */ &move_irso_irdp_1, -/* 1101 0010 1110 */ &move_irso_irdp_1, -/* 1101 0010 1111 */ &move_irso_irdp_1, - -/* 1101 0011 0000 */ &move_irso_irdp_1, -/* 1101 0011 0001 */ &move_irso_irdp_1, -/* 1101 0011 0010 */ &move_irso_irdp_1, -/* 1101 0011 0011 */ &move_irso_irdp_1, -/* 1101 0011 0100 */ &move_irso_irdp_1, -/* 1101 0011 0101 */ &move_irso_irdp_1, -/* 1101 0011 0110 */ &move_irso_irdp_1, -/* 1101 0011 0111 */ &move_irso_irdp_1, -/* 1101 0011 1000 */ &move_irso_irdp_1, -/* 1101 0011 1001 */ &move_irso_irdp_1, -/* 1101 0011 1010 */ &move_irso_irdp_1, -/* 1101 0011 1011 */ &move_irso_irdp_1, -/* 1101 0011 1100 */ &move_irso_irdp_1, -/* 1101 0011 1101 */ &move_irso_irdp_1, -/* 1101 0011 1110 */ &move_irso_irdp_1, -/* 1101 0011 1111 */ &move_irso_irdp_1, - -/* 1101 0100 0000 */ &move_addr_irsp_0, -/* 1101 0100 0001 */ &move_addr_irsp_0, -/* 1101 0100 0010 */ &unimplemented, -/* 1101 0100 0011 */ &unimplemented, -/* 1101 0100 0100 */ &unimplemented, -/* 1101 0100 0101 */ &unimplemented, -/* 1101 0100 0110 */ &unimplemented, -/* 1101 0100 0111 */ &unimplemented, -/* 1101 0100 1000 */ &unimplemented, -/* 1101 0100 1001 */ &unimplemented, -/* 1101 0100 1010 */ &unimplemented, -/* 1101 0100 1011 */ &unimplemented, -/* 1101 0100 1100 */ &unimplemented, -/* 1101 0100 1101 */ &unimplemented, -/* 1101 0100 1110 */ &unimplemented, -/* 1101 0100 1111 */ &unimplemented, - -/* 1101 0101 0000 */ &exgf_rd_0, -/* 1101 0101 0001 */ &exgf_rd_0, -/* 1101 0101 0010 */ &unimplemented, -/* 1101 0101 0011 */ &unimplemented, -/* 1101 0101 0100 */ &unimplemented, -/* 1101 0101 0101 */ &unimplemented, -/* 1101 0101 0110 */ &unimplemented, -/* 1101 0101 0111 */ &unimplemented, -/* 1101 0101 1000 */ &unimplemented, -/* 1101 0101 1001 */ &unimplemented, -/* 1101 0101 1010 */ &unimplemented, -/* 1101 0101 1011 */ &unimplemented, -/* 1101 0101 1100 */ &unimplemented, -/* 1101 0101 1101 */ &unimplemented, -/* 1101 0101 1110 */ &unimplemented, -/* 1101 0101 1111 */ &unimplemented, - -/* 1101 0110 0000 */ &move_addr_irsp_1, -/* 1101 0110 0001 */ &move_addr_irsp_1, -/* 1101 0110 0010 */ &unimplemented, -/* 1101 0110 0011 */ &unimplemented, -/* 1101 0110 0100 */ &unimplemented, -/* 1101 0110 0101 */ &unimplemented, -/* 1101 0110 0110 */ &unimplemented, -/* 1101 0110 0111 */ &unimplemented, -/* 1101 0110 1000 */ &unimplemented, -/* 1101 0110 1001 */ &unimplemented, -/* 1101 0110 1010 */ &unimplemented, -/* 1101 0110 1011 */ &unimplemented, -/* 1101 0110 1100 */ &unimplemented, -/* 1101 0110 1101 */ &unimplemented, -/* 1101 0110 1110 */ &unimplemented, -/* 1101 0110 1111 */ &unimplemented, - -/* 1101 0111 0000 */ &exgf_rd_1, -/* 1101 0111 0001 */ &exgf_rd_1, -/* 1101 0111 0010 */ &unimplemented, -/* 1101 0111 0011 */ &unimplemented, -/* 1101 0111 0100 */ &unimplemented, -/* 1101 0111 0101 */ &unimplemented, -/* 1101 0111 0110 */ &unimplemented, -/* 1101 0111 0111 */ &unimplemented, -/* 1101 0111 1000 */ &unimplemented, -/* 1101 0111 1001 */ &unimplemented, -/* 1101 0111 1010 */ &unimplemented, -/* 1101 0111 1011 */ &unimplemented, -/* 1101 0111 1100 */ &unimplemented, -/* 1101 0111 1101 */ &unimplemented, -/* 1101 0111 1110 */ &unimplemented, -/* 1101 0111 1111 */ &unimplemented, - -/* 1101 1000 0000 */ &unimplemented, -/* 1101 1000 0001 */ &unimplemented, -/* 1101 1000 0010 */ &unimplemented, -/* 1101 1000 0011 */ &unimplemented, -/* 1101 1000 0100 */ &unimplemented, -/* 1101 1000 0101 */ &unimplemented, -/* 1101 1000 0110 */ &unimplemented, -/* 1101 1000 0111 */ &unimplemented, -/* 1101 1000 1000 */ &unimplemented, -/* 1101 1000 1001 */ &unimplemented, -/* 1101 1000 1010 */ &unimplemented, -/* 1101 1000 1011 */ &unimplemented, -/* 1101 1000 1100 */ &unimplemented, -/* 1101 1000 1101 */ &unimplemented, -/* 1101 1000 1110 */ &unimplemented, -/* 1101 1000 1111 */ &unimplemented, - -/* 1101 1001 0000 */ &unimplemented, -/* 1101 1001 0001 */ &unimplemented, -/* 1101 1001 0010 */ &unimplemented, -/* 1101 1001 0011 */ &unimplemented, -/* 1101 1001 0100 */ &unimplemented, -/* 1101 1001 0101 */ &unimplemented, -/* 1101 1001 0110 */ &unimplemented, -/* 1101 1001 0111 */ &unimplemented, -/* 1101 1001 1000 */ &unimplemented, -/* 1101 1001 1001 */ &unimplemented, -/* 1101 1001 1010 */ &unimplemented, -/* 1101 1001 1011 */ &unimplemented, -/* 1101 1001 1100 */ &unimplemented, -/* 1101 1001 1101 */ &unimplemented, -/* 1101 1001 1110 */ &unimplemented, -/* 1101 1001 1111 */ &unimplemented, - -/* 1101 1010 0000 */ &unimplemented, -/* 1101 1010 0001 */ &unimplemented, -/* 1101 1010 0010 */ &unimplemented, -/* 1101 1010 0011 */ &unimplemented, -/* 1101 1010 0100 */ &unimplemented, -/* 1101 1010 0101 */ &unimplemented, -/* 1101 1010 0110 */ &unimplemented, -/* 1101 1010 0111 */ &unimplemented, -/* 1101 1010 1000 */ &unimplemented, -/* 1101 1010 1001 */ &unimplemented, -/* 1101 1010 1010 */ &unimplemented, -/* 1101 1010 1011 */ &unimplemented, -/* 1101 1010 1100 */ &unimplemented, -/* 1101 1010 1101 */ &unimplemented, -/* 1101 1010 1110 */ &unimplemented, -/* 1101 1010 1111 */ &unimplemented, - -/* 1101 1011 0000 */ &unimplemented, -/* 1101 1011 0001 */ &unimplemented, -/* 1101 1011 0010 */ &unimplemented, -/* 1101 1011 0011 */ &unimplemented, -/* 1101 1011 0100 */ &unimplemented, -/* 1101 1011 0101 */ &unimplemented, -/* 1101 1011 0110 */ &unimplemented, -/* 1101 1011 0111 */ &unimplemented, -/* 1101 1011 1000 */ &unimplemented, -/* 1101 1011 1001 */ &unimplemented, -/* 1101 1011 1010 */ &unimplemented, -/* 1101 1011 1011 */ &unimplemented, -/* 1101 1011 1100 */ &unimplemented, -/* 1101 1011 1101 */ &unimplemented, -/* 1101 1011 1110 */ &unimplemented, -/* 1101 1011 1111 */ &unimplemented, - -/* 1101 1100 0000 */ &unimplemented, -/* 1101 1100 0001 */ &unimplemented, -/* 1101 1100 0010 */ &unimplemented, -/* 1101 1100 0011 */ &unimplemented, -/* 1101 1100 0100 */ &unimplemented, -/* 1101 1100 0101 */ &unimplemented, -/* 1101 1100 0110 */ &unimplemented, -/* 1101 1100 0111 */ &unimplemented, -/* 1101 1100 1000 */ &unimplemented, -/* 1101 1100 1001 */ &unimplemented, -/* 1101 1100 1010 */ &unimplemented, -/* 1101 1100 1011 */ &unimplemented, -/* 1101 1100 1100 */ &unimplemented, -/* 1101 1100 1101 */ &unimplemented, -/* 1101 1100 1110 */ &unimplemented, -/* 1101 1100 1111 */ &unimplemented, - -/* 1101 1101 0000 */ &unimplemented, -/* 1101 1101 0001 */ &unimplemented, -/* 1101 1101 0010 */ &unimplemented, -/* 1101 1101 0011 */ &unimplemented, -/* 1101 1101 0100 */ &unimplemented, -/* 1101 1101 0101 */ &unimplemented, -/* 1101 1101 0110 */ &unimplemented, -/* 1101 1101 0111 */ &unimplemented, -/* 1101 1101 1000 */ &unimplemented, -/* 1101 1101 1001 */ &unimplemented, -/* 1101 1101 1010 */ &unimplemented, -/* 1101 1101 1011 */ &unimplemented, -/* 1101 1101 1100 */ &unimplemented, -/* 1101 1101 1101 */ &unimplemented, -/* 1101 1101 1110 */ &unimplemented, -/* 1101 1101 1111 */ &unimplemented, - -/* 1101 1110 0000 */ &unimplemented, -/* 1101 1110 0001 */ &unimplemented, -/* 1101 1110 0010 */ &unimplemented, -/* 1101 1110 0011 */ &unimplemented, -/* 1101 1110 0100 */ &unimplemented, -/* 1101 1110 0101 */ &unimplemented, -/* 1101 1110 0110 */ &unimplemented, -/* 1101 1110 0111 */ &unimplemented, -/* 1101 1110 1000 */ &unimplemented, -/* 1101 1110 1001 */ &unimplemented, -/* 1101 1110 1010 */ &unimplemented, -/* 1101 1110 1011 */ &unimplemented, -/* 1101 1110 1100 */ &unimplemented, -/* 1101 1110 1101 */ &unimplemented, -/* 1101 1110 1110 */ &unimplemented, -/* 1101 1110 1111 */ &unimplemented, - -/* 1101 1111 0000 */ &unimplemented, -/* 1101 1111 0001 */ &unimplemented, -/* 1101 1111 0010 */ &unimplemented, -/* 1101 1111 0011 */ &unimplemented, -/* 1101 1111 0100 */ &unimplemented, -/* 1101 1111 0101 */ &unimplemented, -/* 1101 1111 0110 */ &unimplemented, -/* 1101 1111 0111 */ &unimplemented, -/* 1101 1111 1000 */ &unimplemented, -/* 1101 1111 1001 */ &unimplemented, -/* 1101 1111 1010 */ &unimplemented, -/* 1101 1111 1011 */ &unimplemented, -/* 1101 1111 1100 */ &unimplemented, -/* 1101 1111 1101 */ &unimplemented, -/* 1101 1111 1110 */ &unimplemented, -/* 1101 1111 1111 */ &unimplemented, - -/* 1110 0000 0000 */ &addxy_rs_rd, -/* 1110 0000 0001 */ &addxy_rs_rd, -/* 1110 0000 0010 */ &addxy_rs_rd, -/* 1110 0000 0011 */ &addxy_rs_rd, -/* 1110 0000 0100 */ &addxy_rs_rd, -/* 1110 0000 0101 */ &addxy_rs_rd, -/* 1110 0000 0110 */ &addxy_rs_rd, -/* 1110 0000 0111 */ &addxy_rs_rd, -/* 1110 0000 1000 */ &addxy_rs_rd, -/* 1110 0000 1001 */ &addxy_rs_rd, -/* 1110 0000 1010 */ &addxy_rs_rd, -/* 1110 0000 1011 */ &addxy_rs_rd, -/* 1110 0000 1100 */ &addxy_rs_rd, -/* 1110 0000 1101 */ &addxy_rs_rd, -/* 1110 0000 1110 */ &addxy_rs_rd, -/* 1110 0000 1111 */ &addxy_rs_rd, - -/* 1110 0001 0000 */ &addxy_rs_rd, -/* 1110 0001 0001 */ &addxy_rs_rd, -/* 1110 0001 0010 */ &addxy_rs_rd, -/* 1110 0001 0011 */ &addxy_rs_rd, -/* 1110 0001 0100 */ &addxy_rs_rd, -/* 1110 0001 0101 */ &addxy_rs_rd, -/* 1110 0001 0110 */ &addxy_rs_rd, -/* 1110 0001 0111 */ &addxy_rs_rd, -/* 1110 0001 1000 */ &addxy_rs_rd, -/* 1110 0001 1001 */ &addxy_rs_rd, -/* 1110 0001 1010 */ &addxy_rs_rd, -/* 1110 0001 1011 */ &addxy_rs_rd, -/* 1110 0001 1100 */ &addxy_rs_rd, -/* 1110 0001 1101 */ &addxy_rs_rd, -/* 1110 0001 1110 */ &addxy_rs_rd, -/* 1110 0001 1111 */ &addxy_rs_rd, - -/* 1110 0010 0000 */ &subxy_rs_rd, -/* 1110 0010 0001 */ &subxy_rs_rd, -/* 1110 0010 0010 */ &subxy_rs_rd, -/* 1110 0010 0011 */ &subxy_rs_rd, -/* 1110 0010 0100 */ &subxy_rs_rd, -/* 1110 0010 0101 */ &subxy_rs_rd, -/* 1110 0010 0110 */ &subxy_rs_rd, -/* 1110 0010 0111 */ &subxy_rs_rd, -/* 1110 0010 1000 */ &subxy_rs_rd, -/* 1110 0010 1001 */ &subxy_rs_rd, -/* 1110 0010 1010 */ &subxy_rs_rd, -/* 1110 0010 1011 */ &subxy_rs_rd, -/* 1110 0010 1100 */ &subxy_rs_rd, -/* 1110 0010 1101 */ &subxy_rs_rd, -/* 1110 0010 1110 */ &subxy_rs_rd, -/* 1110 0010 1111 */ &subxy_rs_rd, - -/* 1110 0011 0000 */ &subxy_rs_rd, -/* 1110 0011 0001 */ &subxy_rs_rd, -/* 1110 0011 0010 */ &subxy_rs_rd, -/* 1110 0011 0011 */ &subxy_rs_rd, -/* 1110 0011 0100 */ &subxy_rs_rd, -/* 1110 0011 0101 */ &subxy_rs_rd, -/* 1110 0011 0110 */ &subxy_rs_rd, -/* 1110 0011 0111 */ &subxy_rs_rd, -/* 1110 0011 1000 */ &subxy_rs_rd, -/* 1110 0011 1001 */ &subxy_rs_rd, -/* 1110 0011 1010 */ &subxy_rs_rd, -/* 1110 0011 1011 */ &subxy_rs_rd, -/* 1110 0011 1100 */ &subxy_rs_rd, -/* 1110 0011 1101 */ &subxy_rs_rd, -/* 1110 0011 1110 */ &subxy_rs_rd, -/* 1110 0011 1111 */ &subxy_rs_rd, - -/* 1110 0100 0000 */ &cmpxy_rs_rd, -/* 1110 0100 0001 */ &cmpxy_rs_rd, -/* 1110 0100 0010 */ &cmpxy_rs_rd, -/* 1110 0100 0011 */ &cmpxy_rs_rd, -/* 1110 0100 0100 */ &cmpxy_rs_rd, -/* 1110 0100 0101 */ &cmpxy_rs_rd, -/* 1110 0100 0110 */ &cmpxy_rs_rd, -/* 1110 0100 0111 */ &cmpxy_rs_rd, -/* 1110 0100 1000 */ &cmpxy_rs_rd, -/* 1110 0100 1001 */ &cmpxy_rs_rd, -/* 1110 0100 1010 */ &cmpxy_rs_rd, -/* 1110 0100 1011 */ &cmpxy_rs_rd, -/* 1110 0100 1100 */ &cmpxy_rs_rd, -/* 1110 0100 1101 */ &cmpxy_rs_rd, -/* 1110 0100 1110 */ &cmpxy_rs_rd, -/* 1110 0100 1111 */ &cmpxy_rs_rd, - -/* 1110 0101 0000 */ &cmpxy_rs_rd, -/* 1110 0101 0001 */ &cmpxy_rs_rd, -/* 1110 0101 0010 */ &cmpxy_rs_rd, -/* 1110 0101 0011 */ &cmpxy_rs_rd, -/* 1110 0101 0100 */ &cmpxy_rs_rd, -/* 1110 0101 0101 */ &cmpxy_rs_rd, -/* 1110 0101 0110 */ &cmpxy_rs_rd, -/* 1110 0101 0111 */ &cmpxy_rs_rd, -/* 1110 0101 1000 */ &cmpxy_rs_rd, -/* 1110 0101 1001 */ &cmpxy_rs_rd, -/* 1110 0101 1010 */ &cmpxy_rs_rd, -/* 1110 0101 1011 */ &cmpxy_rs_rd, -/* 1110 0101 1100 */ &cmpxy_rs_rd, -/* 1110 0101 1101 */ &cmpxy_rs_rd, -/* 1110 0101 1110 */ &cmpxy_rs_rd, -/* 1110 0101 1111 */ &cmpxy_rs_rd, - -/* 1110 0110 0000 */ &unimplemented, -/* 1110 0110 0001 */ &unimplemented, -/* 1110 0110 0010 */ &unimplemented, -/* 1110 0110 0011 */ &unimplemented, -/* 1110 0110 0100 */ &unimplemented, -/* 1110 0110 0101 */ &unimplemented, -/* 1110 0110 0110 */ &unimplemented, -/* 1110 0110 0111 */ &unimplemented, -/* 1110 0110 1000 */ &unimplemented, -/* 1110 0110 1001 */ &unimplemented, -/* 1110 0110 1010 */ &unimplemented, -/* 1110 0110 1011 */ &unimplemented, -/* 1110 0110 1100 */ &unimplemented, -/* 1110 0110 1101 */ &unimplemented, -/* 1110 0110 1110 */ &unimplemented, -/* 1110 0110 1111 */ &unimplemented, - -/* 1110 0111 0000 */ &unimplemented, -/* 1110 0111 0001 */ &unimplemented, -/* 1110 0111 0010 */ &unimplemented, -/* 1110 0111 0011 */ &unimplemented, -/* 1110 0111 0100 */ &unimplemented, -/* 1110 0111 0101 */ &unimplemented, -/* 1110 0111 0110 */ &unimplemented, -/* 1110 0111 0111 */ &unimplemented, -/* 1110 0111 1000 */ &unimplemented, -/* 1110 0111 1001 */ &unimplemented, -/* 1110 0111 1010 */ &unimplemented, -/* 1110 0111 1011 */ &unimplemented, -/* 1110 0111 1100 */ &unimplemented, -/* 1110 0111 1101 */ &unimplemented, -/* 1110 0111 1110 */ &unimplemented, -/* 1110 0111 1111 */ &unimplemented, - -/* 1110 1000 0000 */ &cvxyl_rs_rd, -/* 1110 1000 0001 */ &cvxyl_rs_rd, -/* 1110 1000 0010 */ &cvxyl_rs_rd, -/* 1110 1000 0011 */ &cvxyl_rs_rd, -/* 1110 1000 0100 */ &cvxyl_rs_rd, -/* 1110 1000 0101 */ &cvxyl_rs_rd, -/* 1110 1000 0110 */ &cvxyl_rs_rd, -/* 1110 1000 0111 */ &cvxyl_rs_rd, -/* 1110 1000 1000 */ &cvxyl_rs_rd, -/* 1110 1000 1001 */ &cvxyl_rs_rd, -/* 1110 1000 1010 */ &cvxyl_rs_rd, -/* 1110 1000 1011 */ &cvxyl_rs_rd, -/* 1110 1000 1100 */ &cvxyl_rs_rd, -/* 1110 1000 1101 */ &cvxyl_rs_rd, -/* 1110 1000 1110 */ &cvxyl_rs_rd, -/* 1110 1000 1111 */ &cvxyl_rs_rd, - -/* 1110 1001 0000 */ &cvxyl_rs_rd, -/* 1110 1001 0001 */ &cvxyl_rs_rd, -/* 1110 1001 0010 */ &cvxyl_rs_rd, -/* 1110 1001 0011 */ &cvxyl_rs_rd, -/* 1110 1001 0100 */ &cvxyl_rs_rd, -/* 1110 1001 0101 */ &cvxyl_rs_rd, -/* 1110 1001 0110 */ &cvxyl_rs_rd, -/* 1110 1001 0111 */ &cvxyl_rs_rd, -/* 1110 1001 1000 */ &cvxyl_rs_rd, -/* 1110 1001 1001 */ &cvxyl_rs_rd, -/* 1110 1001 1010 */ &cvxyl_rs_rd, -/* 1110 1001 1011 */ &cvxyl_rs_rd, -/* 1110 1001 1100 */ &cvxyl_rs_rd, -/* 1110 1001 1101 */ &cvxyl_rs_rd, -/* 1110 1001 1110 */ &cvxyl_rs_rd, -/* 1110 1001 1111 */ &cvxyl_rs_rd, - -/* 1110 1010 0000 */ &unimplemented, -/* 1110 1010 0001 */ &unimplemented, -/* 1110 1010 0010 */ &unimplemented, -/* 1110 1010 0011 */ &unimplemented, -/* 1110 1010 0100 */ &unimplemented, -/* 1110 1010 0101 */ &unimplemented, -/* 1110 1010 0110 */ &unimplemented, -/* 1110 1010 0111 */ &unimplemented, -/* 1110 1010 1000 */ &unimplemented, -/* 1110 1010 1001 */ &unimplemented, -/* 1110 1010 1010 */ &unimplemented, -/* 1110 1010 1011 */ &unimplemented, -/* 1110 1010 1100 */ &unimplemented, -/* 1110 1010 1101 */ &unimplemented, -/* 1110 1010 1110 */ &unimplemented, -/* 1110 1010 1111 */ &unimplemented, - -/* 1110 1011 0000 */ &unimplemented, -/* 1110 1011 0001 */ &unimplemented, -/* 1110 1011 0010 */ &unimplemented, -/* 1110 1011 0011 */ &unimplemented, -/* 1110 1011 0100 */ &unimplemented, -/* 1110 1011 0101 */ &unimplemented, -/* 1110 1011 0110 */ &unimplemented, -/* 1110 1011 0111 */ &unimplemented, -/* 1110 1011 1000 */ &unimplemented, -/* 1110 1011 1001 */ &unimplemented, -/* 1110 1011 1010 */ &unimplemented, -/* 1110 1011 1011 */ &unimplemented, -/* 1110 1011 1100 */ &unimplemented, -/* 1110 1011 1101 */ &unimplemented, -/* 1110 1011 1110 */ &unimplemented, -/* 1110 1011 1111 */ &unimplemented, - -/* 1110 1100 0000 */ &movx_rs_rd, -/* 1110 1100 0001 */ &movx_rs_rd, -/* 1110 1100 0010 */ &movx_rs_rd, -/* 1110 1100 0011 */ &movx_rs_rd, -/* 1110 1100 0100 */ &movx_rs_rd, -/* 1110 1100 0101 */ &movx_rs_rd, -/* 1110 1100 0110 */ &movx_rs_rd, -/* 1110 1100 0111 */ &movx_rs_rd, -/* 1110 1100 1000 */ &movx_rs_rd, -/* 1110 1100 1001 */ &movx_rs_rd, -/* 1110 1100 1010 */ &movx_rs_rd, -/* 1110 1100 1011 */ &movx_rs_rd, -/* 1110 1100 1100 */ &movx_rs_rd, -/* 1110 1100 1101 */ &movx_rs_rd, -/* 1110 1100 1110 */ &movx_rs_rd, -/* 1110 1100 1111 */ &movx_rs_rd, - -/* 1110 1101 0000 */ &movx_rs_rd, -/* 1110 1101 0001 */ &movx_rs_rd, -/* 1110 1101 0010 */ &movx_rs_rd, -/* 1110 1101 0011 */ &movx_rs_rd, -/* 1110 1101 0100 */ &movx_rs_rd, -/* 1110 1101 0101 */ &movx_rs_rd, -/* 1110 1101 0110 */ &movx_rs_rd, -/* 1110 1101 0111 */ &movx_rs_rd, -/* 1110 1101 1000 */ &movx_rs_rd, -/* 1110 1101 1001 */ &movx_rs_rd, -/* 1110 1101 1010 */ &movx_rs_rd, -/* 1110 1101 1011 */ &movx_rs_rd, -/* 1110 1101 1100 */ &movx_rs_rd, -/* 1110 1101 1101 */ &movx_rs_rd, -/* 1110 1101 1110 */ &movx_rs_rd, -/* 1110 1101 1111 */ &movx_rs_rd, - -/* 1110 1110 0000 */ &movy_rs_rd, -/* 1110 1110 0001 */ &movy_rs_rd, -/* 1110 1110 0010 */ &movy_rs_rd, -/* 1110 1110 0011 */ &movy_rs_rd, -/* 1110 1110 0100 */ &movy_rs_rd, -/* 1110 1110 0101 */ &movy_rs_rd, -/* 1110 1110 0110 */ &movy_rs_rd, -/* 1110 1110 0111 */ &movy_rs_rd, -/* 1110 1110 1000 */ &movy_rs_rd, -/* 1110 1110 1001 */ &movy_rs_rd, -/* 1110 1110 1010 */ &movy_rs_rd, -/* 1110 1110 1011 */ &movy_rs_rd, -/* 1110 1110 1100 */ &movy_rs_rd, -/* 1110 1110 1101 */ &movy_rs_rd, -/* 1110 1110 1110 */ &movy_rs_rd, -/* 1110 1110 1111 */ &movy_rs_rd, - -/* 1110 1111 0000 */ &movy_rs_rd, -/* 1110 1111 0001 */ &movy_rs_rd, -/* 1110 1111 0010 */ &movy_rs_rd, -/* 1110 1111 0011 */ &movy_rs_rd, -/* 1110 1111 0100 */ &movy_rs_rd, -/* 1110 1111 0101 */ &movy_rs_rd, -/* 1110 1111 0110 */ &movy_rs_rd, -/* 1110 1111 0111 */ &movy_rs_rd, -/* 1110 1111 1000 */ &movy_rs_rd, -/* 1110 1111 1001 */ &movy_rs_rd, -/* 1110 1111 1010 */ &movy_rs_rd, -/* 1110 1111 1011 */ &movy_rs_rd, -/* 1110 1111 1100 */ &movy_rs_rd, -/* 1110 1111 1101 */ &movy_rs_rd, -/* 1110 1111 1110 */ &movy_rs_rd, -/* 1110 1111 1111 */ &movy_rs_rd, - -/* 1111 0000 0000 */ &pixt_rd_irdxy, -/* 1111 0000 0001 */ &pixt_rd_irdxy, -/* 1111 0000 0010 */ &pixt_rd_irdxy, -/* 1111 0000 0011 */ &pixt_rd_irdxy, -/* 1111 0000 0100 */ &pixt_rd_irdxy, -/* 1111 0000 0101 */ &pixt_rd_irdxy, -/* 1111 0000 0110 */ &pixt_rd_irdxy, -/* 1111 0000 0111 */ &pixt_rd_irdxy, -/* 1111 0000 1000 */ &pixt_rd_irdxy, -/* 1111 0000 1001 */ &pixt_rd_irdxy, -/* 1111 0000 1010 */ &pixt_rd_irdxy, -/* 1111 0000 1011 */ &pixt_rd_irdxy, -/* 1111 0000 1100 */ &pixt_rd_irdxy, -/* 1111 0000 1101 */ &pixt_rd_irdxy, -/* 1111 0000 1110 */ &pixt_rd_irdxy, -/* 1111 0000 1111 */ &pixt_rd_irdxy, - -/* 1111 0001 0000 */ &pixt_rd_irdxy, -/* 1111 0001 0001 */ &pixt_rd_irdxy, -/* 1111 0001 0010 */ &pixt_rd_irdxy, -/* 1111 0001 0011 */ &pixt_rd_irdxy, -/* 1111 0001 0100 */ &pixt_rd_irdxy, -/* 1111 0001 0101 */ &pixt_rd_irdxy, -/* 1111 0001 0110 */ &pixt_rd_irdxy, -/* 1111 0001 0111 */ &pixt_rd_irdxy, -/* 1111 0001 1000 */ &pixt_rd_irdxy, -/* 1111 0001 1001 */ &pixt_rd_irdxy, -/* 1111 0001 1010 */ &pixt_rd_irdxy, -/* 1111 0001 1011 */ &pixt_rd_irdxy, -/* 1111 0001 1100 */ &pixt_rd_irdxy, -/* 1111 0001 1101 */ &pixt_rd_irdxy, -/* 1111 0001 1110 */ &pixt_rd_irdxy, -/* 1111 0001 1111 */ &pixt_rd_irdxy, - -/* 1111 0010 0000 */ &unimplemented, -/* 1111 0010 0001 */ &unimplemented, -/* 1111 0010 0010 */ &unimplemented, -/* 1111 0010 0011 */ &unimplemented, -/* 1111 0010 0100 */ &unimplemented, -/* 1111 0010 0101 */ &unimplemented, -/* 1111 0010 0110 */ &unimplemented, -/* 1111 0010 0111 */ &unimplemented, -/* 1111 0010 1000 */ &unimplemented, -/* 1111 0010 1001 */ &unimplemented, -/* 1111 0010 1010 */ &unimplemented, -/* 1111 0010 1011 */ &unimplemented, -/* 1111 0010 1100 */ &unimplemented, -/* 1111 0010 1101 */ &unimplemented, -/* 1111 0010 1110 */ &unimplemented, -/* 1111 0010 1111 */ &unimplemented, - -/* 1111 0011 0000 */ &unimplemented, -/* 1111 0011 0001 */ &unimplemented, -/* 1111 0011 0010 */ &unimplemented, -/* 1111 0011 0011 */ &unimplemented, -/* 1111 0011 0100 */ &unimplemented, -/* 1111 0011 0101 */ &unimplemented, -/* 1111 0011 0110 */ &unimplemented, -/* 1111 0011 0111 */ &unimplemented, -/* 1111 0011 1000 */ &unimplemented, -/* 1111 0011 1001 */ &unimplemented, -/* 1111 0011 1010 */ &unimplemented, -/* 1111 0011 1011 */ &unimplemented, -/* 1111 0011 1100 */ &unimplemented, -/* 1111 0011 1101 */ &unimplemented, -/* 1111 0011 1110 */ &unimplemented, -/* 1111 0011 1111 */ &unimplemented, - -/* 1111 0100 0000 */ &unimplemented, -/* 1111 0100 0001 */ &unimplemented, -/* 1111 0100 0010 */ &unimplemented, -/* 1111 0100 0011 */ &unimplemented, -/* 1111 0100 0100 */ &unimplemented, -/* 1111 0100 0101 */ &unimplemented, -/* 1111 0100 0110 */ &unimplemented, -/* 1111 0100 0111 */ &unimplemented, -/* 1111 0100 1000 */ &unimplemented, -/* 1111 0100 1001 */ &unimplemented, -/* 1111 0100 1010 */ &unimplemented, -/* 1111 0100 1011 */ &unimplemented, -/* 1111 0100 1100 */ &unimplemented, -/* 1111 0100 1101 */ &unimplemented, -/* 1111 0100 1110 */ &unimplemented, -/* 1111 0100 1111 */ &unimplemented, - -/* 1111 0101 0000 */ &unimplemented, -/* 1111 0101 0001 */ &unimplemented, -/* 1111 0101 0010 */ &unimplemented, -/* 1111 0101 0011 */ &unimplemented, -/* 1111 0101 0100 */ &unimplemented, -/* 1111 0101 0101 */ &unimplemented, -/* 1111 0101 0110 */ &unimplemented, -/* 1111 0101 0111 */ &unimplemented, -/* 1111 0101 1000 */ &unimplemented, -/* 1111 0101 1001 */ &unimplemented, -/* 1111 0101 1010 */ &unimplemented, -/* 1111 0101 1011 */ &unimplemented, -/* 1111 0101 1100 */ &unimplemented, -/* 1111 0101 1101 */ &unimplemented, -/* 1111 0101 1110 */ &unimplemented, -/* 1111 0101 1111 */ &unimplemented, - -/* 1111 0110 0000 */ &drav_rs_rd, -/* 1111 0110 0001 */ &drav_rs_rd, -/* 1111 0110 0010 */ &drav_rs_rd, -/* 1111 0110 0011 */ &drav_rs_rd, -/* 1111 0110 0100 */ &drav_rs_rd, -/* 1111 0110 0101 */ &drav_rs_rd, -/* 1111 0110 0110 */ &drav_rs_rd, -/* 1111 0110 0111 */ &drav_rs_rd, -/* 1111 0110 1000 */ &drav_rs_rd, -/* 1111 0110 1001 */ &drav_rs_rd, -/* 1111 0110 1010 */ &drav_rs_rd, -/* 1111 0110 1011 */ &drav_rs_rd, -/* 1111 0110 1100 */ &drav_rs_rd, -/* 1111 0110 1101 */ &drav_rs_rd, -/* 1111 0110 1110 */ &drav_rs_rd, -/* 1111 0110 1111 */ &drav_rs_rd, - -/* 1111 0111 0000 */ &drav_rs_rd, -/* 1111 0111 0001 */ &drav_rs_rd, -/* 1111 0111 0010 */ &drav_rs_rd, -/* 1111 0111 0011 */ &drav_rs_rd, -/* 1111 0111 0100 */ &drav_rs_rd, -/* 1111 0111 0101 */ &drav_rs_rd, -/* 1111 0111 0110 */ &drav_rs_rd, -/* 1111 0111 0111 */ &drav_rs_rd, -/* 1111 0111 1000 */ &drav_rs_rd, -/* 1111 0111 1001 */ &drav_rs_rd, -/* 1111 0111 1010 */ &drav_rs_rd, -/* 1111 0111 1011 */ &drav_rs_rd, -/* 1111 0111 1100 */ &drav_rs_rd, -/* 1111 0111 1101 */ &drav_rs_rd, -/* 1111 0111 1110 */ &drav_rs_rd, -/* 1111 0111 1111 */ &drav_rs_rd, - -/* 1111 1000 0000 */ &unimplemented, -/* 1111 1000 0001 */ &unimplemented, -/* 1111 1000 0010 */ &unimplemented, -/* 1111 1000 0011 */ &unimplemented, -/* 1111 1000 0100 */ &unimplemented, -/* 1111 1000 0101 */ &unimplemented, -/* 1111 1000 0110 */ &unimplemented, -/* 1111 1000 0111 */ &unimplemented, -/* 1111 1000 1000 */ &unimplemented, -/* 1111 1000 1001 */ &unimplemented, -/* 1111 1000 1010 */ &unimplemented, -/* 1111 1000 1011 */ &unimplemented, -/* 1111 1000 1100 */ &unimplemented, -/* 1111 1000 1101 */ &unimplemented, -/* 1111 1000 1110 */ &unimplemented, -/* 1111 1000 1111 */ &unimplemented, - -/* 1111 1001 0000 */ &unimplemented, -/* 1111 1001 0001 */ &unimplemented, -/* 1111 1001 0010 */ &unimplemented, -/* 1111 1001 0011 */ &unimplemented, -/* 1111 1001 0100 */ &unimplemented, -/* 1111 1001 0101 */ &unimplemented, -/* 1111 1001 0110 */ &unimplemented, -/* 1111 1001 0111 */ &unimplemented, -/* 1111 1001 1000 */ &unimplemented, -/* 1111 1001 1001 */ &unimplemented, -/* 1111 1001 1010 */ &unimplemented, -/* 1111 1001 1011 */ &unimplemented, -/* 1111 1001 1100 */ &unimplemented, -/* 1111 1001 1101 */ &unimplemented, -/* 1111 1001 1110 */ &unimplemented, -/* 1111 1001 1111 */ &unimplemented, - -/* 1111 1010 0000 */ &pixt_irs_rd, -/* 1111 1010 0001 */ &pixt_irs_rd, -/* 1111 1010 0010 */ &pixt_irs_rd, -/* 1111 1010 0011 */ &pixt_irs_rd, -/* 1111 1010 0100 */ &pixt_irs_rd, -/* 1111 1010 0101 */ &pixt_irs_rd, -/* 1111 1010 0110 */ &pixt_irs_rd, -/* 1111 1010 0111 */ &pixt_irs_rd, -/* 1111 1010 1000 */ &pixt_irs_rd, -/* 1111 1010 1001 */ &pixt_irs_rd, -/* 1111 1010 1010 */ &pixt_irs_rd, -/* 1111 1010 1011 */ &pixt_irs_rd, -/* 1111 1010 1100 */ &pixt_irs_rd, -/* 1111 1010 1101 */ &pixt_irs_rd, -/* 1111 1010 1110 */ &pixt_irs_rd, -/* 1111 1010 1111 */ &pixt_irs_rd, - -/* 1111 1011 0000 */ &pixt_irs_rd, -/* 1111 1011 0001 */ &pixt_irs_rd, -/* 1111 1011 0010 */ &pixt_irs_rd, -/* 1111 1011 0011 */ &pixt_irs_rd, -/* 1111 1011 0100 */ &pixt_irs_rd, -/* 1111 1011 0101 */ &pixt_irs_rd, -/* 1111 1011 0110 */ &pixt_irs_rd, -/* 1111 1011 0111 */ &pixt_irs_rd, -/* 1111 1011 1000 */ &pixt_irs_rd, -/* 1111 1011 1001 */ &pixt_irs_rd, -/* 1111 1011 1010 */ &pixt_irs_rd, -/* 1111 1011 1011 */ &pixt_irs_rd, -/* 1111 1011 1100 */ &pixt_irs_rd, -/* 1111 1011 1101 */ &pixt_irs_rd, -/* 1111 1011 1110 */ &pixt_irs_rd, -/* 1111 1011 1111 */ &pixt_irs_rd, - -/* 1111 1100 0000 */ &unimplemented, -/* 1111 1100 0001 */ &unimplemented, -/* 1111 1100 0010 */ &unimplemented, -/* 1111 1100 0011 */ &unimplemented, -/* 1111 1100 0100 */ &unimplemented, -/* 1111 1100 0101 */ &unimplemented, -/* 1111 1100 0110 */ &unimplemented, -/* 1111 1100 0111 */ &unimplemented, -/* 1111 1100 1000 */ &unimplemented, -/* 1111 1100 1001 */ &unimplemented, -/* 1111 1100 1010 */ &unimplemented, -/* 1111 1100 1011 */ &unimplemented, -/* 1111 1100 1100 */ &unimplemented, -/* 1111 1100 1101 */ &unimplemented, -/* 1111 1100 1110 */ &unimplemented, -/* 1111 1100 1111 */ &unimplemented, - -/* 1111 1101 0000 */ &unimplemented, -/* 1111 1101 0001 */ &unimplemented, -/* 1111 1101 0010 */ &unimplemented, -/* 1111 1101 0011 */ &unimplemented, -/* 1111 1101 0100 */ &unimplemented, -/* 1111 1101 0101 */ &unimplemented, -/* 1111 1101 0110 */ &unimplemented, -/* 1111 1101 0111 */ &unimplemented, -/* 1111 1101 1000 */ &unimplemented, -/* 1111 1101 1001 */ &unimplemented, -/* 1111 1101 1010 */ &unimplemented, -/* 1111 1101 1011 */ &unimplemented, -/* 1111 1101 1100 */ &unimplemented, -/* 1111 1101 1101 */ &unimplemented, -/* 1111 1101 1110 */ &unimplemented, -/* 1111 1101 1111 */ &unimplemented, - -/* 1111 1110 0000 */ &unimplemented, -/* 1111 1110 0001 */ &unimplemented, -/* 1111 1110 0010 */ &unimplemented, -/* 1111 1110 0011 */ &unimplemented, -/* 1111 1110 0100 */ &unimplemented, -/* 1111 1110 0101 */ &unimplemented, -/* 1111 1110 0110 */ &unimplemented, -/* 1111 1110 0111 */ &unimplemented, -/* 1111 1110 1000 */ &unimplemented, -/* 1111 1110 1001 */ &unimplemented, -/* 1111 1110 1010 */ &unimplemented, -/* 1111 1110 1011 */ &unimplemented, -/* 1111 1110 1100 */ &unimplemented, -/* 1111 1110 1101 */ &unimplemented, -/* 1111 1110 1110 */ &unimplemented, -/* 1111 1110 1111 */ &unimplemented, - -/* 1111 1111 0000 */ &unimplemented, -/* 1111 1111 0001 */ &unimplemented, -/* 1111 1111 0010 */ &unimplemented, -/* 1111 1111 0011 */ &unimplemented, -/* 1111 1111 0100 */ &unimplemented, -/* 1111 1111 0101 */ &unimplemented, -/* 1111 1111 0110 */ &unimplemented, -/* 1111 1111 0111 */ &unimplemented, -/* 1111 1111 1000 */ &unimplemented, -/* 1111 1111 1001 */ &unimplemented, -/* 1111 1111 1010 */ &unimplemented, -/* 1111 1111 1011 */ &unimplemented, -/* 1111 1111 1100 */ &unimplemented, -/* 1111 1111 1101 */ &unimplemented, -/* 1111 1111 1110 */ &unimplemented, -/* 1111 1111 1111 */ &unimplemented, - -}; - -} diff --git a/jan/src/cpu/tms34010/tms34010_shift.h b/jan/src/cpu/tms34010/tms34010_shift.h deleted file mode 100644 index 64511fd98..000000000 --- a/jan/src/cpu/tms34010/tms34010_shift.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2015, Marcos Medeiros - * Licensed under BSD 3-clause. - */ -#ifndef TMS34010_SHIFT_H -#define TMS34010_SHIFT_H - -#include "tms34010.h" -#include "tms34010_memacc.h" -#include "tms34010_defs.h" - -namespace tms { namespace ops { - -void rl_k_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_Z); - int k = K; - if (k) { - const int shift = 32 - k; - dword rot = (_rd >> shift) & (0xFFFFFFFF >> shift); - - _rd <<= k - 1; - if (_rd & 0x80000000) - _st |= ST_C; - _rd <<= 1; - _rd |= rot; - } - if (!_rd) - _st |= ST_Z; - - CONSUME_CYCLES(1); -} - - -void rl_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_Z); - int k = _rs & 0x1F; - if (k) { - const int shift = 32 - k; - dword rot = (_rd >> shift) & (0xFFFFFFFF >> shift); - - _rd <<= k - 1; - if (_rd & 0x80000000) - _st |= ST_C; - _rd <<= 1; - _rd |= rot; - } - if (!_rd) - _st |= ST_Z; - - CONSUME_CYCLES(1); -} - - -void sll_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_Z); - int k = _rs & 0x1F; - if (k) { - _rd <<= k - 1; - if (_rd & 0x80000000) - _st |= ST_C; - _rd <<= 1; - } - if (!_rd) - _st |= ST_Z; - - CONSUME_CYCLES(1); -} - -void sll_k_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_Z); - int k = K; - if (k) { - _rd <<= k - 1; - if (_rd & 0x80000000) - _st |= ST_C; - _rd <<= 1; - } - if (!_rd) - _st |= ST_Z; - - CONSUME_CYCLES(1); -} - -void sla_k_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_V); - int k = K; - sdword rr = _rd; - if (k) { - const dword mask = (0xFFFFFFFF << (31 - k)) & 0x7FFFFFFF; - dword rr_ = (_rd & 0x80000000) ? _rd ^ mask : _rd; - if ((rr_ & mask) != 0) - _st |= ST_V; - - rr <<= (k - 1); - if (rr & 0x80000000) - _st |= ST_C; - rr <<= 1; - } - _rd = rr; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - -void sla_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_V); - int k = _rs & 0x1F; - sdword rr = _rd; - if (k) { - const dword mask = (0xFFFFFFFF << (31 - k)) & 0x7FFFFFFF; - dword rr_ = (_rd & 0x80000000) ? _rd ^ mask : _rd; - if ((rr_ & mask) != 0) - _st |= ST_V; - - rr <<= (k - 1); - if (rr & 0x80000000) - _st |= ST_C; - rr <<= 1; - } - _rd = rr; - update_zn(_rd); - - CONSUME_CYCLES(3); -} - -void srl_k_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_Z); - int k = (-K) & 0x1F; - if (k) { - _rd >>= k - 1; - if (_rd & 1) - _st |= ST_C; - _rd >>= 1; - } - if (!_rd) - _st |= ST_Z; - - CONSUME_CYCLES(1); -} - -void srl_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_Z); - int k = _rs & 0x1F; - if (k) { - _rd >>= k - 1; - if (_rd & 1) - _st |= ST_C; - _rd >>= 1; - } - if (!_rd) - _st |= ST_Z; - - CONSUME_CYCLES(1); -} - -void sra_k_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_Z); - int k = (-K) & 0x1F; - sdword rr = _rd; - if (k) { - rr >>= k - 1; - if (rr & 1) - _st |= ST_C; - rr >>= 1; - } - _rd = rr; - if (!_rd) - _st |= ST_Z; - - CONSUME_CYCLES(1); -} - -void sra_rs_rd(cpu_state *cpu, word opcode) -{ - _st &= ~(ST_C | ST_Z); - int k = _rs & 0x1F; - sdword rr = _rd; - if (k) { - rr >>= k - 1; - if (rr & 1) - _st |= ST_C; - rr >>= 1; - } - _rd = rr; - if (!_rd) - _st |= ST_Z; - - CONSUME_CYCLES(1); -} - - -} // ops -} // tms - -#endif // TMS34010_SHIFT_H diff --git a/jan/src/cpu/tms34010_intf.cpp b/jan/src/cpu/tms34010_intf.cpp deleted file mode 100644 index af8472d97..000000000 --- a/jan/src/cpu/tms34010_intf.cpp +++ /dev/null @@ -1,191 +0,0 @@ -#include "burnint.h" -#include "tms34010/tms34010.h" -#include "tms34010_intf.h" - -#define ADDR_BITS 32 -#define PAGE_SIZE 0x1000 -#define PAGE_SIZE_8 (0x1000 >> 3) -#define PAGE_SHIFT 12 -#define PAGE_MASK 0xFFF -#define PAGE_COUNT (1 << (ADDR_BITS - PAGE_SHIFT)) -#define PAGE_WADD (PAGE_COUNT) -#define MAXHANDLER 32 -#define PFN(x) (((x) >> PAGE_SHIFT) & 0xFFFFF) - -template -inline T fast_read(UINT8 *ptr, UINT32 adr) { - return *((T*) ((UINT8*) ptr + TOBYTE(adr & PAGE_MASK))); -} - -template -inline void fast_write(UINT8 *xptr, UINT32 adr, T value) { - T *ptr = ((T*) ((UINT8*) xptr + TOBYTE(adr & PAGE_MASK))); - *ptr = value; -} - -static TMS34010State tms34010; -static pTMS34010ScanlineRender scanlineRenderCallback = NULL; - -struct TMS34010MemoryMap -{ - UINT8 *map[PAGE_COUNT * 2]; - - pTMS34010ReadHandler read[MAXHANDLER]; - pTMS34010WriteHandler write[MAXHANDLER]; -}; - -static TMS34010MemoryMap g_mmap; - -static UINT16 default_read(UINT32 address) { return ~0; } -static void default_write(UINT32 address, UINT16 value) {} -static void default_shift_op(UINT32,void*){} - - -static UINT16 IO_read(UINT32 address) { return tms::read_ioreg(&tms34010,address); } -static void IO_write(UINT32 address, UINT16 value) { tms::write_ioreg(&tms34010, address, value); } - -void TMS34010Init() -{ - tms34010.shift_read_cycle = default_shift_op; - tms34010.shift_write_cycle = default_shift_op; - - // map IO registers - TMS34010SetHandlers(MAXHANDLER-1, IO_read, IO_write); - TMS34010MapHandler(MAXHANDLER-1, 0xc0000000, 0xc00001ff, MAP_READ | MAP_WRITE); -} - -int TMS34010Run(int cycles) -{ - tms::run(&tms34010, cycles); - return 0; -} - -void TMS34010Reset() -{ - tms::reset(&tms34010); -} - -void TMS34010GenerateIRQ(UINT32 line) -{ - tms::generate_irq(&tms34010, line); -} - -void TMS34010ClearIRQ(UINT32 line) -{ - tms::clear_irq(&tms34010, line); -} - -void TMS34010SetScanlineRender(pTMS34010ScanlineRender sr) -{ - scanlineRenderCallback = sr; -} - -void TMS34010SetToShift(void (*reader)(UINT32 addr, void *dst)) -{ - tms34010.shift_read_cycle = reader; -} - -void TMS34010SetFromShift(void (*writer)(UINT32 addr, void *src)) -{ - tms34010.shift_write_cycle = writer; -} - -int TMS34010GenerateScanline(int line) -{ - return tms::generate_scanline(&tms34010, line, scanlineRenderCallback); -} - -TMS34010State *TMS34010GetState() -{ - return &tms34010; -} - -UINT16 TMS34010ReadWord(UINT32 address) -{ - UINT8 *pr = g_mmap.map[PFN(address)]; - if ((uintptr_t)pr >= MAXHANDLER) { - // address is bit-address - return fast_read(pr,address); - } else { - return g_mmap.read[(uintptr_t)pr](address); - } -} - -void TMS34010WriteWord(UINT32 address, UINT16 value) -{ - UINT8 *pr = g_mmap.map[PAGE_WADD + PFN(address)]; - if ((uintptr_t)pr >= MAXHANDLER) { - // address is bit-address - return fast_write(pr,address,value); - } else { - return g_mmap.write[(uintptr_t)pr](address, value); - } -} - -void TMS34010MapReset() -{ - for (int page = 0; page < PAGE_COUNT; page++) { - g_mmap.map[page] = nullptr; - g_mmap.map[page + PAGE_WADD] = nullptr; - } - for (int handler = 0; handler < MAXHANDLER; handler++) { - g_mmap.read[handler] = default_read; - g_mmap.write[handler] = default_write; - } -} - -void TMS34010MapMemory(UINT8 *mem, UINT32 start, UINT32 end, UINT8 type) -{ - const int max_pages = (PFN(end) - PFN(start)) + 1; - - int page = PFN(start); - for (int i = 0; i < max_pages; i++, page++) { - - if (type & MAP_READ) - g_mmap.map[page] = mem + (PAGE_SIZE_8 * i); - - if (type & MAP_WRITE) - g_mmap.map[page + PAGE_WADD] = mem + (PAGE_SIZE_8 * i); - } -} - -void TMS34010MapHandler(UINT32 num, UINT32 start, UINT32 end, UINT8 type) -{ - const int max_pages = (PFN(end) - PFN(start)) + 1; - - int page = PFN(start); - for (int i = 0; i < max_pages; i++, page++) { - - if (type & MAP_READ) - g_mmap.map[page] = (UINT8*) num; - - if (type & MAP_WRITE) - g_mmap.map[page + PAGE_WADD] = (UINT8*) num; - } -} - -int TMS34010SetReadHandler(UINT32 num, pTMS34010ReadHandler handler) -{ - if (num >= MAXHANDLER) - return 1; - g_mmap.read[num] = handler; - return 0; -} - -int TMS34010SetWriteHandler(UINT32 num, pTMS34010WriteHandler handler) -{ - if (num >= MAXHANDLER) - return 1; - g_mmap.write[num] = handler; - return 0; -} - -int TMS34010SetHandlers(UINT32 num, pTMS34010ReadHandler rhandler, pTMS34010WriteHandler whandler) -{ - if (num >= MAXHANDLER) - return 1; - g_mmap.read[num] = rhandler; - g_mmap.write[num] = whandler; - return 0; -} - diff --git a/jan/src/cpu/tms34010_intf.h b/jan/src/cpu/tms34010_intf.h deleted file mode 100644 index e30fd8343..000000000 --- a/jan/src/cpu/tms34010_intf.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef TMS34010_INTF_H -#define TMS34010_INTF_H - -#include "tms34010/tms34010.h" - -#define TMS34010_INT_EX1 tms::INTERRUPT_EXTERN_1 -#define TMS34010_INT_EX2 tms::INTERRUPT_EXTERN_2 -#define TMS34010_INT_HOST tms::INTERRUPT_HOST -#define TMS34010_INT_DISPLAY tms::INTERRUPT_DISPLAY -#define TMS34010_INT_WIN tms::INTERRUPT_WINDOW - -typedef UINT16 (*pTMS34010ReadHandler)(UINT32); -typedef void (*pTMS34010WriteHandler)(UINT32, UINT16); - -typedef tms::cpu_state TMS34010State; -typedef tms::display_info TMS34010Display; -typedef tms::scanline_render_t pTMS34010ScanlineRender; -// typedef void (*pTMS34010ScanlineRender)(int line, TMS34010Display *info); - -void TMS34010Init(); -int TMS34010Run(int cycles); -void TMS34010Reset(); -void TMS34010GenerateIRQ(UINT32 line); -void TMS34010ClearIRQ(UINT32 line); -void TMS34010SetScanlineRender(pTMS34010ScanlineRender sr); -void TMS34010SetToShift(void (*SL)(UINT32 addr, void *dst)); -void TMS34010SetFromShift(void (*FS)(UINT32 addr, void *src)); -int TMS34010GenerateScanline(int line); -TMS34010State *TMS34010GetState(); - -UINT16 TMS34010ReadWord(UINT32 address); -void TMS34010WriteWord(UINT32 address, UINT16 value); -void TMS34010MapReset(); -void TMS34010MapMemory(UINT8 *mem, UINT32 start, UINT32 end, UINT8 type); -void TMS34010MapHandler(UINT32 num, UINT32 start, UINT32 end, UINT8 type); -int TMS34010SetReadHandler(UINT32 num, pTMS34010ReadHandler handler); -int TMS34010SetWriteHandler(UINT32 num, pTMS34010WriteHandler handler); -int TMS34010SetHandlers(UINT32 num, pTMS34010ReadHandler rhandler, pTMS34010WriteHandler whandler); - - -#endif // TMS34010_INTF_H diff --git a/jan/src/cpu/upd7725/upd7725.cpp b/jan/src/cpu/upd7725/upd7725.cpp deleted file mode 100644 index 190adef90..000000000 --- a/jan/src/cpu/upd7725/upd7725.cpp +++ /dev/null @@ -1,481 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:R. Belmont,byuu -/*************************************************************************** - - upd7725.c - - Core implementation for the portable NEC uPD7725/uPD96050 emulator - - Original by byuu in the public domain. - MAME conversion by R. Belmont - -****************************************************************************/ - -#include "burnint.h" -#include "upd7725.h" - -static INT32 program_address_mask; -static INT32 data_address_mask; -static UINT8 *upd96050Opcodes = NULL; -static UINT8 *upd96050Data = NULL; -static UINT16 *dataRAM; -static void (*out_p0_cb)(INT32) = NULL; -static void (*out_p1_cb)(INT32) = NULL; - -static inline UINT32 read_op(UINT16 a) -{ - UINT32 *opcode = (UINT32*)upd96050Opcodes; - - return opcode[a & program_address_mask]; -} - -static inline UINT16 data_read_word(UINT16 a) -{ - UINT16 *data = (UINT16*)upd96050Data; - - return data[a & data_address_mask]; -} - -static inline void dataRAMWrite(INT32 offset, UINT16 data) -{ - dataRAM[offset & 0x7ff] = data; -} - -static inline UINT16 dataRAMRead(INT32 offset) -{ - return dataRAM[offset & 0x7ff]; -} - -struct Flag -{ - bool s1, s0, c, z, ov1, ov0, ov0p, ov0pp; - - inline operator UINT8() const - { - return (s1 << 7) + (s0 << 6) + (c << 5) + (z << 4) + (ov1 << 3) + (ov0 << 2) + (ov0p << 1) + (ov0pp << 0); - } - - inline unsigned operator=(UINT8 d) - { - s1 = d & 0x80; s0 = d & 0x40; c = d & 0x20; z = d & 0x10; ov1 = d & 0x08; ov0 = d & 0x04; ov0p = d & 0x02; ov0pp = d & 0x01; - return d; - } -}; - -struct Status -{ - bool rqm, usf1, usf0, drs, dma, drc, soc, sic, ei, p1, p0; - - inline operator UINT8() const - { - return (rqm << 15) + (usf1 << 14) + (usf0 << 13) + (drs << 12) - + (dma << 11) + (drc << 10) + (soc << 9) + (sic << 8) - + (ei << 7) + (p1 << 1) + (p0 << 0); - } - - inline unsigned operator=(UINT8 d) - { - rqm = d & 0x8000; usf1 = d & 0x4000; usf0 = d & 0x2000; drs = d & 0x1000; - dma = d & 0x0800; drc = d & 0x0400; soc = d & 0x0200; sic = d & 0x0100; - ei = d & 0x0080; p1 = d & 0x0002; p0 = d & 0x0001; - return d; - } -}; - -struct Regs -{ - UINT16 pc; //program counter - UINT16 stack[16]; //LIFO - UINT16 rp; //ROM pointer - UINT16 dp; //data pointer - UINT8 sp; //stack pointer - INT16 k; - INT16 l; - INT16 m; - INT16 n; - INT16 a; //accumulator - INT16 b; //accumulator - Flag flaga; - Flag flagb; - UINT16 tr; //temporary register - UINT16 trb; //temporary register - Status sr; //status register - UINT16 dr; //data register - UINT16 si; - UINT16 so; - UINT16 idb; -} regs; - -static INT32 m_icount = 0; - -static void exec_ld(UINT32 opcode) { - UINT16 id = opcode >> 6; //immediate data - UINT8 dst = (opcode >> 0) & 0xf; //destination - - regs.idb = id; - - switch(dst) { - case 0: break; - case 1: regs.a = id; break; - case 2: regs.b = id; break; - case 3: regs.tr = id; break; - case 4: regs.dp = id; break; - case 5: regs.rp = id; break; - case 6: regs.dr = id; regs.sr.rqm = 1; break; - case 7: regs.sr = (regs.sr & 0x907c) | (id & ~0x907c); - out_p0_cb(regs.sr&0x1); - out_p1_cb((regs.sr&0x2)>>1); - break; - case 8: regs.so = id; break; //LSB - case 9: regs.so = id; break; //MSB - case 10: regs.k = id; break; - case 11: regs.k = id; regs.l = data_read_word(regs.rp); break; - case 12: regs.l = id; regs.k = dataRAMRead(regs.dp | 0x40); break; - case 13: regs.l = id; break; - case 14: regs.trb = id; break; - case 15: dataRAMWrite(regs.dp, id); break; - } -} - -static void exec_op(UINT32 opcode) { - UINT8 pselect = (opcode >> 20)&0x3; //P select - UINT8 alu = (opcode >> 16)&0xf; //ALU operation mode - UINT8 asl = (opcode >> 15)&0x1; //accumulator select - UINT8 dpl = (opcode >> 13)&0x3; //DP low modify - UINT8 dphm = (opcode >> 9)&0xf; //DP high XOR modify - UINT8 rpdcr = (opcode >> 8)&0x1; //RP decrement - UINT8 src = (opcode >> 4)&0xf; //move source - UINT8 dst = (opcode >> 0)&0xf; //move destination - - switch(src) { - case 0: regs.idb = regs.trb; break; - case 1: regs.idb = regs.a; break; - case 2: regs.idb = regs.b; break; - case 3: regs.idb = regs.tr; break; - case 4: regs.idb = regs.dp; break; - case 5: regs.idb = regs.rp; break; - case 6: regs.idb = data_read_word(regs.rp); break; - case 7: regs.idb = 0x8000 - regs.flaga.s1; break; //SGN - case 8: regs.idb = regs.dr; regs.sr.rqm = 1; break; - case 9: regs.idb = regs.dr; break; - case 10: regs.idb = regs.sr; break; - case 11: regs.idb = regs.si; break; //MSB - case 12: regs.idb = regs.si; break; //LSB - case 13: regs.idb = regs.k; break; - case 14: regs.idb = regs.l; break; - case 15: regs.idb = dataRAMRead(regs.dp); break; - } - - if(alu) { - UINT16 p=0, q=0, r=0; - Flag flag; - bool c=0; - - flag.c = 0; - flag.s1 = 0; - flag.ov0 = 0; - flag.ov1 = 0; - flag.ov0p = 0; - flag.ov0pp = 0; - - switch(pselect) { - case 0: p = dataRAMRead(regs.dp); break; - case 1: p = regs.idb; break; - case 2: p = regs.m; break; - case 3: p = regs.n; break; - } - - switch(asl) { - case 0: q = regs.a; flag = regs.flaga; c = regs.flagb.c; break; - case 1: q = regs.b; flag = regs.flagb; c = regs.flaga.c; break; - } - - switch(alu) { - case 1: r = q | p; break; //OR - case 2: r = q & p; break; //AND - case 3: r = q ^ p; break; //XOR - case 4: r = q - p; break; //SUB - case 5: r = q + p; break; //ADD - case 6: r = q - p - c; break; //SBB - case 7: r = q + p + c; break; //ADC - case 8: r = q - 1; p = 1; break; //DEC - case 9: r = q + 1; p = 1; break; //INC - case 10: r = ~q; break; //CMP - case 11: r = (q >> 1) | (q & 0x8000); break; //SHR1 (ASR) - case 12: r = (q << 1) | (c ? 1 : 0); break; //SHL1 (ROL) - case 13: r = (q << 2) | 3; break; //SHL2 - case 14: r = (q << 4) | 15; break; //SHL4 - case 15: r = (q << 8) | (q >> 8); break; //XCHG - } - - flag.s0 = (r & 0x8000); - flag.z = (r == 0); - flag.ov0pp = flag.ov0p; - flag.ov0p = flag.ov0; - - switch(alu) { - case 1: case 2: case 3: case 10: case 13: case 14: case 15: { - flag.c = 0; - flag.ov0 = flag.ov0p = flag.ov0pp = 0; // ASSUMPTION: previous ov0 values are nulled here to make ov1 zero - break; - } - case 4: case 5: case 6: case 7: case 8: case 9: { - if(alu & 1) { - //addition - flag.ov0 = (q ^ r) & ~(q ^ p) & 0x8000; - flag.c = (r < q); - } else { - //subtraction - flag.ov0 = (q ^ r) & (q ^ p) & 0x8000; - flag.c = (r > q); - } - break; - } - case 11: { - flag.c = q & 1; - flag.ov0 = flag.ov0p = flag.ov0pp = 0; // ASSUMPTION: previous ov0 values are nulled here to make ov1 zero - break; - } - case 12: { - flag.c = q >> 15; - flag.ov0 = flag.ov0p = flag.ov0pp = 0; // ASSUMPTION: previous ov0 values are nulled here to make ov1 zero - break; - } - } - // flag.ov1 is only set if the number of overflows of the past 3 opcodes (of type 4,5,6,7,8,9) is odd - flag.ov1 = (flag.ov0 + flag.ov0p + flag.ov0pp) & 1; - // flag.s1 is based on ov1: s1 = ov1 ^ s0; - flag.s1 = flag.ov1 ^ flag.s0; - - switch(asl) { - case 0: regs.a = r; regs.flaga = flag; break; - case 1: regs.b = r; regs.flagb = flag; break; - } - } - - exec_ld((regs.idb << 6) + dst); - - switch(dpl) { - case 1: regs.dp = (regs.dp & 0xf0) + ((regs.dp + 1) & 0x0f); break; //DPINC - case 2: regs.dp = (regs.dp & 0xf0) + ((regs.dp - 1) & 0x0f); break; //DPDEC - case 3: regs.dp = (regs.dp & 0xf0); break; //DPCLR - } - - regs.dp ^= dphm << 4; - - if(rpdcr) regs.rp--; -} - -static void exec_rt(UINT32 opcode) { - exec_op(opcode); - regs.pc = regs.stack[--regs.sp]; - regs.sp &= 0xf; -} - -static void exec_jp(UINT32 opcode) { - UINT16 brch = (opcode >> 13) & 0x1ff; //branch - UINT16 na = (opcode >> 2) & 0x7ff; //next address - UINT16 bank = (opcode >> 0) & 0x3; //bank address - - UINT16 jps = (regs.pc & 0x2000) | (bank << 11) | (na << 0); - UINT16 jpl = (bank << 11) | (na << 0); - - switch(brch) { - case 0x000: regs.pc = regs.so; return; //JMPSO - - case 0x080: if(regs.flaga.c == 0) regs.pc = jps; return; //JNCA - case 0x082: if(regs.flaga.c == 1) regs.pc = jps; return; //JCA - case 0x084: if(regs.flagb.c == 0) regs.pc = jps; return; //JNCB - case 0x086: if(regs.flagb.c == 1) regs.pc = jps; return; //JCB - - case 0x088: if(regs.flaga.z == 0) regs.pc = jps; return; //JNZA - case 0x08a: if(regs.flaga.z == 1) regs.pc = jps; return; //JZA - case 0x08c: if(regs.flagb.z == 0) regs.pc = jps; return; //JNZB - case 0x08e: if(regs.flagb.z == 1) regs.pc = jps; return; //JZB - - case 0x090: if(regs.flaga.ov0 == 0) regs.pc = jps; return; //JNOVA0 - case 0x092: if(regs.flaga.ov0 == 1) regs.pc = jps; return; //JOVA0 - case 0x094: if(regs.flagb.ov0 == 0) regs.pc = jps; return; //JNOVB0 - case 0x096: if(regs.flagb.ov0 == 1) regs.pc = jps; return; //JOVB0 - - case 0x098: if(regs.flaga.ov1 == 0) regs.pc = jps; return; //JNOVA1 - case 0x09a: if(regs.flaga.ov1 == 1) regs.pc = jps; return; //JOVA1 - case 0x09c: if(regs.flagb.ov1 == 0) regs.pc = jps; return; //JNOVB1 - case 0x09e: if(regs.flagb.ov1 == 1) regs.pc = jps; return; //JOVB1 - - case 0x0a0: if(regs.flaga.s0 == 0) regs.pc = jps; return; //JNSA0 - case 0x0a2: if(regs.flaga.s0 == 1) regs.pc = jps; return; //JSA0 - case 0x0a4: if(regs.flagb.s0 == 0) regs.pc = jps; return; //JNSB0 - case 0x0a6: if(regs.flagb.s0 == 1) regs.pc = jps; return; //JSB0 - - case 0x0a8: if(regs.flaga.s1 == 0) regs.pc = jps; return; //JNSA1 - case 0x0aa: if(regs.flaga.s1 == 1) regs.pc = jps; return; //JSA1 - case 0x0ac: if(regs.flagb.s1 == 0) regs.pc = jps; return; //JNSB1 - case 0x0ae: if(regs.flagb.s1 == 1) regs.pc = jps; return; //JSB1 - - case 0x0b0: if((regs.dp & 0x0f) == 0x00) regs.pc = jps; return; //JDPL0 - case 0x0b1: if((regs.dp & 0x0f) != 0x00) regs.pc = jps; return; //JDPLN0 - case 0x0b2: if((regs.dp & 0x0f) == 0x0f) regs.pc = jps; return; //JDPLF - case 0x0b3: if((regs.dp & 0x0f) != 0x0f) regs.pc = jps; return; //JDPLNF - - case 0x0bc: if(regs.sr.rqm == 0) regs.pc = jps; return; //JNRQM - case 0x0be: if(regs.sr.rqm == 1) regs.pc = jps; return; //JRQM - - case 0x100: regs.pc = 0x0000 | jpl; return; //LJMP - case 0x101: regs.pc = 0x2000 | jpl; return; //HJMP - - case 0x140: regs.stack[regs.sp++] = regs.pc; regs.pc = 0x0000 | jpl; regs.sp &= 0xf; return; //LCALL - case 0x141: regs.stack[regs.sp++] = regs.pc; regs.pc = 0x2000 | jpl; regs.sp &= 0xf; return; //HCALL - } -} - -static void dummy_cb(INT32) -{ -} - -void upd96050Init(INT32 type, UINT8 *opcode, UINT8 *data, UINT8 *ram, void (*p0_cb)(INT32), void (*p1_cb)(INT32)) -{ - // get our address spaces - upd96050Opcodes = opcode; - upd96050Data = data; - dataRAM = (UINT16*)ram; - - // resolve callbacks - out_p0_cb = (p0_cb == NULL) ? dummy_cb : p0_cb; - out_p1_cb = (p1_cb == NULL) ? dummy_cb : p1_cb; - - if (type == 96050) - { - program_address_mask = ((1 << 14) - 1) >> 2; - data_address_mask = ((1 << 12) - 1) >> 1; - } - - if (type == 7725) - { - program_address_mask = ((1 << 11) - 1) >> 2; - data_address_mask = ((1 << 11) - 1) >> 1; - } -} - -void upd96050Reset() -{ - for (INT32 i = 0; i < 2048; i++) - { - dataRAM[i] = 0x0000; - } - - regs.pc = 0x0000; - regs.rp = 0x0000; - regs.dp = 0x0000; - regs.sp = 0x0; - regs.k = 0x0000; - regs.l = 0x0000; - regs.m = 0x0000; - regs.n = 0x0000; - regs.a = 0x0000; - regs.b = 0x0000; - regs.flaga = 0x00; - regs.flagb = 0x00; - regs.tr = 0x0000; - regs.trb = 0x0000; - regs.sr = 0x0000; - regs.dr = 0x0000; - regs.si = 0x0000; - regs.so = 0x0000; - regs.idb = 0x0000; - - m_icount = 0; -} - -INT32 upd96050Scan(INT32 /*nAction*/) -{ - SCAN_VAR(regs); - - return 0; -} - -INT32 upd96050Run(INT32 cycles) -{ - UINT32 opcode; - - m_icount = cycles; - - do - { - opcode = read_op(regs.pc)>>8; - regs.pc++; - switch(opcode >> 22) - { - case 0: exec_op(opcode); break; - case 1: exec_rt(opcode); break; - case 2: exec_jp(opcode); break; - case 3: exec_ld(opcode); break; - } - - INT32 result = (INT32)regs.k * regs.l; //sign + 30-bit result - regs.m = result >> 15; //store sign + top 15-bits - regs.n = result << 1; //store low 15-bits + zero - - m_icount--; - - } while (m_icount > 0); - - return cycles - m_icount; -} - -UINT8 snesdsp_read(bool mode) -{ - if (!mode) - { - return regs.sr >> 8; - } - - if (regs.sr.drc == 0) - { - //16-bit - if(regs.sr.drs == 0) - { - regs.sr.drs = 1; - return regs.dr >> 0; - } - else - { - regs.sr.rqm = 0; - regs.sr.drs = 0; - return regs.dr >> 8; - } - } - else - { - //8-bit - regs.sr.rqm = 0; - return regs.dr >> 0; - } -} - -void snesdsp_write(bool mode, UINT8 data) -{ - if (!mode) return; - - if (regs.sr.drc == 0) - { - //16-bit - if (regs.sr.drs == 0) - { - regs.sr.drs = 1; - regs.dr = (regs.dr & 0xff00) | (data << 0); - } - else - { - regs.sr.rqm = 0; - regs.sr.drs = 0; - regs.dr = (data << 8) | (regs.dr & 0x00ff); - } - } - else - { - //8-bit - regs.sr.rqm = 0; - regs.dr = (regs.dr & 0xff00) | (data << 0); - } -} diff --git a/jan/src/cpu/upd7725/upd7725.h b/jan/src/cpu/upd7725/upd7725.h deleted file mode 100644 index 78727fd42..000000000 --- a/jan/src/cpu/upd7725/upd7725.h +++ /dev/null @@ -1,6 +0,0 @@ -void upd96050Init(INT32 type, UINT8 *opcode, UINT8 *data, UINT8 *ram, void (*p0_cb)(INT32), void (*p1_cb)(INT32)); -void upd96050Reset(); -INT32 upd96050Run(INT32 cycles); -UINT8 snesdsp_read(bool mode); -void snesdsp_write(bool mode, UINT8 data); -INT32 upd96050Scan(INT32 /*nAction*/); diff --git a/jan/src/cpu/upd7810/7810dasm.c b/jan/src/cpu/upd7810/7810dasm.c deleted file mode 100644 index 32ce811b2..000000000 --- a/jan/src/cpu/upd7810/7810dasm.c +++ /dev/null @@ -1,4068 +0,0 @@ -/***************************************************************************** - * - * Portable uPD7810/11, 7810H/11H, 78C10/C11/C14 disassembler - * Copyright (c) 2001 Juergen Buchmueller, all rights reserved. - * - * NS20030112: added 7807. - * - *****************************************************************************/ - -#include - -#ifdef MAME_DEBUG -#include "driver.h" -#include "mamedbg.h" -#include "upd7810.h" - -struct dasm_s { - UINT8 token; - const void *args; - UINT8 oplen; - UINT8 cycles; -}; - -enum -{ - illegal=1, - ACI, - ADC, - ADCW, - ADCX, - ADD, - ADDNC, - ADDNCW, - ADDNCX, - ADDW, - ADDX, - ADI, - ADINC, - ANA, - ANAW, - ANAX, - AND, - ANI, - ANIW, - BIT, - BLOCK, - CALB, - CALF, - CALL, - CALT, - CLC, - CLR, /* 7807 */ - CMC, /* 7807 */ - DAA, - DADC, - DADD, - DADDNC, - DAN, - DCR, - DCRW, - DCX, - DEQ, - DGT, - DI, - DIV, - DLT, - DMOV, - DNE, - DOFF, - DON, - DOR, - DRLL, - DRLR, - DSBB, - DSLL, - DSLR, - DSUB, - DSUBNB, - DXR, - EADD, - EI, - EQA, - EQAW, - EQAX, - EQI, - EQIW, - ESUB, - EXA, - EXH, - EXX, - EXR, /* 7807 */ - GTA, - GTAW, - GTAX, - GTI, - GTIW, - HALT, - INR, - INRW, - INX, - JB, - JEA, - JMP, - JR, - JRE, - LBCD, - LDAW, - LDAX, - LDEAX, - LDED, - LHLD, - LSPD, - LTA, - LTAW, - LTAX, - LTI, - LTIW, - LXI, - MOV, - MUL, - MVI, - MVIW, - MVIX, - NEA, - NEAW, - NEAX, - NEGA, - NEI, - NEIW, - NOP, - NOT, /* 7807 */ - OFFA, - OFFAW, - OFFAX, - OFFI, - OFFIW, - ONA, - ONAW, - ONAX, - ONI, - ONIW, - OR, /* 7807 */ - ORA, - ORAW, - ORAX, - ORI, - ORIW, - POP, - PUSH, - RET, - RETI, - RETS, - RLD, - RLL, - RLR, - RRD, - SBB, - SBBW, - SBBX, - SBCD, - SBI, - SDED, - SETB, /* 7807 */ - SHLD, - SK, - SKIT, - SKN, - SKNIT, - SLL, - SLLC, - SLR, - SLRC, - SOFTI, - SSPD, - STAW, - STAX, - STC, - STEAX, - STOP, - SUB, - SUBNB, - SUBNBW, - SUBNBX, - SUBW, - SUBX, - SUI, - SUINB, - TABLE, - XOR, /* 7807 */ - XRA, - XRAW, - XRAX, - XRI -}; - -static const char* token[] = -{ - "", - "illegal", - "ACI", - "ADC", - "ADCW", - "ADCX", - "ADD", - "ADDNC", - "ADDNCW", - "ADDNCX", - "ADDW", - "ADDX", - "ADI", - "ADINC", - "ANA", - "ANAW", - "ANAX", - "AND", - "ANI", - "ANIW", - "BIT", - "BLOCK", - "CALB", - "CALF", - "CALL", - "CALT", - "CLC", - "CLR", /* 7807 */ - "CMC", /* 7807 */ - "DAA", - "DADC", - "DADD", - "DADDNC", - "DAN", - "DCR", - "DCRW", - "DCX", - "DEQ", - "DGT", - "DI", - "DIV", - "DLT", - "DMOV", - "DNE", - "DOFF", - "DON", - "DOR", - "DRLL", - "DRLR", - "DSBB", - "DSLL", - "DSLR", - "DSUB", - "DSUBNB", - "DXR", - "EADD", - "EI", - "EQA", - "EQAW", - "EQAX", - "EQI", - "EQIW", - "ESUB", - "EXA", - "EXH", - "EXX", - "EXR", /* 7807 */ - "GTA", - "GTAW", - "GTAX", - "GTI", - "GTIW", - "HALT", - "INR", - "INRW", - "INX", - "JB", - "JEA", - "JMP", - "JR", - "JRE", - "LBCD", - "LDAW", - "LDAX", - "LDEAX", - "LDED", - "LHLD", - "LSPD", - "LTA", - "LTAW", - "LTAX", - "LTI", - "LTIW", - "LXI", - "MOV", - "MUL", - "MVI", - "MVIW", - "MVIX", - "NEA", - "NEAW", - "NEAX", - "NEGA", - "NEI", - "NEIW", - "NOP", - "NOT", /* 7807 */ - "OFFA", - "OFFAW", - "OFFAX", - "OFFI", - "OFFIW", - "ONA", - "ONAW", - "ONAX", - "ONI", - "ONIW", - "OR", /* 7807 */ - "ORA", - "ORAW", - "ORAX", - "ORI", - "ORIW", - "POP", - "PUSH", - "RET", - "RETI", - "RETS", - "RLD", - "RLL", - "RLR", - "RRD", - "SBB", - "SBBW", - "SBBX", - "SBCD", - "SBI", - "SDED", - "SETB", /* 7807 */ - "SHLD", - "SK", - "SKIT", - "SKN", - "SKNIT", - "SLL", - "SLLC", - "SLR", - "SLRC", - "SOFTI", - "SSPD", - "STAW", - "STAX", - "STC", - "STEAX", - "STOP", - "SUB", - "SUBNB", - "SUBNBW", - "SUBNBX", - "SUBW", - "SUBX", - "SUI", - "SUINB", - "TABLE", - "XOR", /* 7807 */ - "XRA", - "XRAW", - "XRAX", - "XRI" -}; - - -/* prefix 48 */ -static struct dasm_s dasm48_7810[256] = -{ - {illegal,0, 2, 8}, /* 00: 0100 1000 0000 0000 */ - {SLRC,"A", 2, 8}, /* 01: 0100 1000 0000 0001 */ - {SLRC,"B", 2, 8}, /* 02: 0100 1000 0000 0010 */ - {SLRC,"C", 2, 8}, /* 03: 0100 1000 0000 0011 */ - {illegal,0, 2, 8}, /* 04: 0100 1000 0000 0100 */ - {SLLC,"A", 2, 8}, /* 05: 0100 1000 0000 0101 */ - {SLLC,"B", 2, 8}, /* 06: 0100 1000 0000 0110 */ - {SLLC,"C", 2, 8}, /* 07: 0100 1000 0000 0111 */ - {SK,"NV", 2, 8}, /* 08: 0100 1000 0000 1000 */ - {illegal,0, 2, 8}, /* 09: 0100 1000 0000 1001 */ - {SK,"CY", 2, 8}, /* 0a: 0100 1000 0000 1010 */ - {SK,"HC", 2, 8}, /* 0b: 0100 1000 0000 1011 */ - {SK,"Z", 2, 8}, /* 0c: 0100 1000 0000 1100 */ - {illegal,0, 2, 8}, /* 0d: 0100 1000 0000 1101 */ - {illegal,0, 2, 8}, /* 0e: 0100 1000 0000 1110 */ - {illegal,0, 2, 8}, /* 0f: 0100 1000 0000 1111 */ - - {illegal,0, 2, 8}, /* 10: 0100 1000 0001 0000 */ - {illegal,0, 2, 8}, /* 11: 0100 1000 0001 0001 */ - {illegal,0, 2, 8}, /* 12: 0100 1000 0001 0010 */ - {illegal,0, 2, 8}, /* 13: 0100 1000 0001 0011 */ - {illegal,0, 2, 8}, /* 14: 0100 1000 0001 0100 */ - {illegal,0, 2, 8}, /* 15: 0100 1000 0001 0101 */ - {illegal,0, 2, 8}, /* 16: 0100 1000 0001 0110 */ - {illegal,0, 2, 8}, /* 17: 0100 1000 0001 0111 */ - {SKN,"NV", 2, 8}, /* 18: 0100 1000 0001 1000 */ - {illegal,0, 2, 8}, /* 19: 0100 1000 0001 1001 */ - {SKN,"CY", 2, 8}, /* 1a: 0100 1000 0001 1010 */ - {SKN,"HC", 2, 8}, /* 1b: 0100 1000 0001 1011 */ - {SKN,"Z", 2, 8}, /* 1c: 0100 1000 0001 1100 */ - {illegal,0, 2, 8}, /* 1d: 0100 1000 0001 1101 */ - {illegal,0, 2, 8}, /* 1e: 0100 1000 0001 1110 */ - {illegal,0, 2, 8}, /* 1f: 0100 1000 0001 1111 */ - - {illegal,0, 2, 8}, /* 20: 0100 1000 0010 0000 */ - {SLR,"A", 2, 8}, /* 21: 0100 1000 0010 0001 */ - {SLR,"B", 2, 8}, /* 22: 0100 1000 0010 0010 */ - {SLR,"C", 2, 8}, /* 23: 0100 1000 0010 0011 */ - {illegal,0, 2, 8}, /* 24: 0100 1000 0010 0100 */ - {SLL,"A", 2, 8}, /* 25: 0100 1000 0010 0101 */ - {SLL,"B", 2, 8}, /* 26: 0100 1000 0010 0110 */ - {SLL,"C", 2, 8}, /* 27: 0100 1000 0010 0111 */ - {JEA,0, 2, 8}, /* 28: 0100 1000 0010 1000 */ - {CALB,0, 2,17}, /* 29: 0100 1000 0010 1001 */ - {CLC,0, 2, 8}, /* 2a: 0100 1000 0010 1010 */ - {STC,0, 2, 8}, /* 2b: 0100 1000 0010 1011 */ - {illegal,0, 2,32}, /* 2c: 0100 1000 0010 1100 */ - {MUL,"A", 2,32}, /* 2d: 0100 1000 0010 1101 */ - {MUL,"B", 2,32}, /* 2e: 0100 1000 0010 1110 */ - {MUL,"C", 2,32}, /* 2f: 0100 1000 0010 1111 */ - - {illegal,0, 2, 8}, /* 30: 0100 1000 0011 0000 */ - {RLR,"A", 2, 8}, /* 31: 0100 1000 0011 0001 */ - {RLR,"B", 2, 8}, /* 32: 0100 1000 0011 0010 */ - {RLR,"C", 2, 8}, /* 33: 0100 1000 0011 0011 */ - {illegal,0, 2, 8}, /* 34: 0100 1000 0011 0100 */ - {RLL,"A", 2, 8}, /* 35: 0100 1000 0011 0101 */ - {RLL,"B", 2, 8}, /* 36: 0100 1000 0011 0110 */ - {RLL,"C", 2, 8}, /* 37: 0100 1000 0011 0111 */ - {RLD,0, 2,17}, /* 38: 0100 1000 0011 1000 */ - {RRD,0, 2,17}, /* 39: 0100 1000 0011 1001 */ - {NEGA,0, 2, 8}, /* 3a: 0100 1000 0011 1010 */ - {HALT,0, 2,12}, /* 3b: 0100 1000 0011 1011 */ - {illegal,0, 2,59}, /* 3c: 0100 1000 0011 1100 */ - {DIV,"A", 2,59}, /* 3d: 0100 1000 0011 1101 */ - {DIV,"B", 2,59}, /* 3e: 0100 1000 0011 1110 */ - {DIV,"C", 2,59}, /* 3f: 0100 1000 0011 1111 */ - - {SKIT,"NMI", 2, 8}, /* 40: 0100 1000 0100 0000 */ - {SKIT,"FT0", 2, 8}, /* 41: 0100 1000 0100 0001 */ - {SKIT,"FT1", 2, 8}, /* 42: 0100 1000 0100 0010 */ - {SKIT,"F1", 2, 8}, /* 43: 0100 1000 0100 0011 */ - {SKIT,"F2", 2, 8}, /* 44: 0100 1000 0100 0100 */ - {SKIT,"FE0", 2, 8}, /* 45: 0100 1000 0100 0101 */ - {SKIT,"FE1", 2, 8}, /* 46: 0100 1000 0100 0110 */ - {SKIT,"FEIN", 2, 8}, /* 47: 0100 1000 0100 0111 */ - {SKIT,"FAD", 2, 8}, /* 48: 0100 1000 0100 1000 */ - {SKIT,"FSR", 2, 8}, /* 49: 0100 1000 0100 1001 */ - {SKIT,"FST", 2, 8}, /* 4a: 0100 1000 0100 1010 */ - {SKIT,"ER", 2, 8}, /* 4b: 0100 1000 0100 1011 */ - {SKIT,"OV", 2, 8}, /* 4c: 0100 1000 0100 1100 */ - {illegal,0, 2, 8}, /* 4d: 0100 1000 0100 1101 */ - {illegal,0, 2, 8}, /* 4e: 0100 1000 0100 1110 */ - {illegal,0, 2, 8}, /* 4f: 0100 1000 0100 1111 */ - - {SKIT,"AN4", 2, 8}, /* 50: 0100 1000 0101 0000 */ - {SKIT,"AN5", 2, 8}, /* 51: 0100 1000 0101 0001 */ - {SKIT,"AN6", 2, 8}, /* 52: 0100 1000 0101 0010 */ - {SKIT,"AN7", 2, 8}, /* 53: 0100 1000 0101 0011 */ - {SKIT,"SB", 2, 8}, /* 54: 0100 1000 0101 0100 */ - {illegal,0, 2, 8}, /* 55: 0100 1000 0101 0101 */ - {illegal,0, 2, 8}, /* 56: 0100 1000 0101 0110 */ - {illegal,0, 2, 8}, /* 57: 0100 1000 0101 0111 */ - {illegal,0, 2, 8}, /* 58: 0100 1000 0101 1000 */ - {illegal,0, 2, 8}, /* 59: 0100 1000 0101 1001 */ - {illegal,0, 2, 8}, /* 5a: 0100 1000 0101 1010 */ - {illegal,0, 2, 8}, /* 5b: 0100 1000 0101 1011 */ - {illegal,0, 2, 8}, /* 5c: 0100 1000 0101 1100 */ - {illegal,0, 2, 8}, /* 5d: 0100 1000 0101 1101 */ - {illegal,0, 2, 8}, /* 5e: 0100 1000 0101 1110 */ - {illegal,0, 2, 8}, /* 5f: 0100 1000 0101 1111 */ - - {SKNIT,"NMI", 2, 8}, /* 60: 0100 1000 0110 0000 */ - {SKNIT,"FT0", 2, 8}, /* 61: 0100 1000 0110 0001 */ - {SKNIT,"FT1", 2, 8}, /* 62: 0100 1000 0110 0010 */ - {SKNIT,"F1", 2, 8}, /* 63: 0100 1000 0110 0011 */ - {SKNIT,"F2", 2, 8}, /* 64: 0100 1000 0110 0100 */ - {SKNIT,"FE0", 2, 8}, /* 65: 0100 1000 0110 0101 */ - {SKNIT,"FE1", 2, 8}, /* 66: 0100 1000 0110 0110 */ - {SKNIT,"FEIN", 2, 8}, /* 67: 0100 1000 0110 0111 */ - {SKNIT,"FAD", 2, 8}, /* 68: 0100 1000 0110 1000 */ - {SKNIT,"FSR", 2, 8}, /* 69: 0100 1000 0110 1001 */ - {SKNIT,"FST", 2, 8}, /* 6a: 0100 1000 0110 1010 */ - {SKNIT,"ER", 2, 8}, /* 6b: 0100 1000 0110 1011 */ - {SKNIT,"OV", 2, 8}, /* 6c: 0100 1000 0110 1100 */ - {illegal,0, 2, 8}, /* 6d: 0100 1000 0110 1101 */ - {illegal,0, 2, 8}, /* 6e: 0100 1000 0110 1110 */ - {illegal,0, 2, 8}, /* 6f: 0100 1000 0110 1111 */ - - {SKNIT,"AN4", 2, 8}, /* 70: 0100 1000 0111 0000 */ - {SKNIT,"AN5", 2, 8}, /* 71: 0100 1000 0111 0001 */ - {SKNIT,"AN6", 2, 8}, /* 72: 0100 1000 0111 0010 */ - {SKNIT,"AN7", 2, 8}, /* 73: 0100 1000 0111 0011 */ - {SKNIT,"SB", 2, 8}, /* 74: 0100 1000 0111 0100 */ - {illegal,0, 2, 8}, /* 75: 0100 1000 0111 0101 */ - {illegal,0, 2, 8}, /* 76: 0100 1000 0111 0110 */ - {illegal,0, 2, 8}, /* 77: 0100 1000 0111 0111 */ - {illegal,0, 2, 8}, /* 78: 0100 1000 0111 1000 */ - {illegal,0, 2, 8}, /* 79: 0100 1000 0111 1001 */ - {illegal,0, 2, 8}, /* 7a: 0100 1000 0111 1010 */ - {illegal,0, 2, 8}, /* 7b: 0100 1000 0111 1011 */ - {illegal,0, 2, 8}, /* 7c: 0100 1000 0111 1100 */ - {illegal,0, 2, 8}, /* 7d: 0100 1000 0111 1101 */ - {illegal,0, 2, 8}, /* 7e: 0100 1000 0111 1110 */ - {illegal,0, 2, 8}, /* 7f: 0100 1000 0111 1111 */ - - {illegal,0, 2, 8}, /* 80: 0100 1000 1000 0000 */ - {illegal,0, 2, 8}, /* 81: 0100 1000 1000 0001 */ - {LDEAX,"(DE)", 2,14}, /* 82: 0100 1000 1000 0010 */ - {LDEAX,"(HL)", 2,14}, /* 83: 0100 1000 1000 0011 */ - {LDEAX,"(DE++)", 2,14}, /* 84: 0100 1000 1000 0100 */ - {LDEAX,"(HL++)", 2,14}, /* 85: 0100 1000 1000 0101 */ - {illegal,0, 2, 8}, /* 86: 0100 1000 1000 0110 */ - {illegal,0, 2, 8}, /* 87: 0100 1000 1000 0111 */ - {illegal,0, 2, 8}, /* 88: 0100 1000 1000 1000 */ - {illegal,0, 2, 8}, /* 89: 0100 1000 1000 1001 */ - {illegal,0, 2, 8}, /* 8a: 0100 1000 1000 1010 */ - {LDEAX,"(DE+%b)",3,20}, /* 8b: 0100 1000 1000 1011 xxxx xxxx */ - {LDEAX,"(HL+A)", 2,20}, /* 8c: 0100 1000 1000 1100 */ - {LDEAX,"(HL+B)", 2,20}, /* 8d: 0100 1000 1000 1101 */ - {LDEAX,"(HL+EA)",2,20}, /* 8e: 0100 1000 1000 1110 */ - {LDEAX,"(HL+%b)",3,20}, /* 8f: 0100 1000 1000 1111 xxxx xxxx */ - - {illegal,0, 2, 8}, /* 90: 0100 1000 1000 0000 */ - {illegal,0, 2, 8}, /* 91: 0100 1000 1000 0001 */ - {STEAX,"(DE)", 2,14}, /* 92: 0100 1000 1000 0010 */ - {STEAX,"(HL)", 2,14}, /* 93: 0100 1000 1000 0011 */ - {STEAX,"(DE++)", 2,14}, /* 94: 0100 1000 1000 0100 */ - {STEAX,"(HL++)", 2,14}, /* 95: 0100 1000 1000 0101 */ - {illegal,0, 2, 8}, /* 96: 0100 1000 1000 0110 */ - {illegal,0, 2, 8}, /* 97: 0100 1000 1000 0111 */ - {illegal,0, 2, 8}, /* 98: 0100 1000 1000 1000 */ - {illegal,0, 2, 8}, /* 99: 0100 1000 1000 1001 */ - {illegal,0, 2, 8}, /* 9a: 0100 1000 1000 1010 */ - {STEAX,"(DE+%b)",3,20}, /* 9b: 0100 1000 1000 1011 xxxx xxxx */ - {STEAX,"(HL+A)", 2,20}, /* 9c: 0100 1000 1000 1100 */ - {STEAX,"(HL+B)", 2,20}, /* 9d: 0100 1000 1000 1101 */ - {STEAX,"(HL+EA)",2,20}, /* 9e: 0100 1000 1000 1110 */ - {STEAX,"(HL+%b)",3,20}, /* 9f: 0100 1000 1000 1111 xxxx xxxx */ - - {DSLR,"EA", 2, 8}, /* a0: 0100 1000 1010 0000 */ - {illegal,0, 2, 8}, /* a1: 0100 1000 1010 0001 */ - {illegal,0, 2, 8}, /* a2: 0100 1000 1010 0010 */ - {illegal,0, 2, 8}, /* a3: 0100 1000 1010 0011 */ - {DSLL,"EA", 2, 8}, /* a4: 0100 1000 1010 0100 */ - {illegal,0, 2, 8}, /* a5: 0100 1000 1010 0101 */ - {illegal,0, 2, 8}, /* a6: 0100 1000 1010 0110 */ - {illegal,0, 2, 8}, /* a7: 0100 1000 1010 0111 */ - {TABLE,0, 2,17}, /* a8: 0100 1000 1010 1000 */ - {illegal,0, 2, 8}, /* a9: 0100 1000 1010 1001 */ - {illegal,0, 2, 8}, /* aa: 0100 1000 1010 1010 */ - {illegal,0, 2, 8}, /* ab: 0100 1000 1010 1011 */ - {illegal,0, 2, 8}, /* ac: 0100 1000 1010 1100 */ - {illegal,0, 2, 8}, /* ad: 0100 1000 1010 1101 */ - {illegal,0, 2, 8}, /* ae: 0100 1000 1010 1110 */ - {illegal,0, 2, 8}, /* af: 0100 1000 1010 1111 */ - - {DRLR,"EA", 2, 8}, /* b0: 0100 1000 1011 0000 */ - {illegal,0, 2, 8}, /* b1: 0100 1000 1011 0001 */ - {illegal,0, 2, 8}, /* b2: 0100 1000 1011 0010 */ - {illegal,0, 2, 8}, /* b3: 0100 1000 1011 0011 */ - {DRLL,"EA", 2, 8}, /* b4: 0100 1000 1011 0100 */ - {illegal,0, 2, 8}, /* b5: 0100 1000 1011 0101 */ - {illegal,0, 2, 8}, /* b6: 0100 1000 1011 0110 */ - {illegal,0, 2, 8}, /* b7: 0100 1000 1011 0111 */ - {illegal,0, 2, 8}, /* b8: 0100 1000 1011 1000 */ - {illegal,0, 2, 8}, /* b9: 0100 1000 1011 1001 */ - {illegal,0, 2, 8}, /* ba: 0100 1000 1011 1010 */ - {STOP,0, 2,12}, /* bb: 0100 1000 1011 1011 */ /* 7810 */ - {illegal,0, 2, 8}, /* bc: 0100 1000 1011 1100 */ - {illegal,0, 2, 8}, /* bd: 0100 1000 1011 1101 */ - {illegal,0, 2, 8}, /* be: 0100 1000 1011 1110 */ - {illegal,0, 2, 8}, /* bf: 0100 1000 1011 1111 */ - - {DMOV,"EA,ECNT", 2,14}, /* c0: 0100 1000 1100 0000 */ - {DMOV,"EA,ECPT", 2,14}, /* c1: 0100 1000 1100 0001 */ /* 7810 */ - {illegal,0, 2, 8}, /* c2: 0100 1000 1100 0010 */ - {illegal,0, 2, 8}, /* c3: 0100 1000 1100 0011 */ - {illegal,0, 2, 8}, /* c4: 0100 1000 1100 0100 */ - {illegal,0, 2, 8}, /* c5: 0100 1000 1100 0101 */ - {illegal,0, 2, 8}, /* c6: 0100 1000 1100 0110 */ - {illegal,0, 2, 8}, /* c7: 0100 1000 1100 0111 */ - {illegal,0, 2, 8}, /* c8: 0100 1000 1100 1000 */ - {illegal,0, 2, 8}, /* c9: 0100 1000 1100 1001 */ - {illegal,0, 2, 8}, /* ca: 0100 1000 1100 1010 */ - {illegal,0, 2, 8}, /* cb: 0100 1000 1100 1011 */ - {illegal,0, 2, 8}, /* cc: 0100 1000 1100 1100 */ - {illegal,0, 2, 8}, /* cd: 0100 1000 1100 1101 */ - {illegal,0, 2, 8}, /* ce: 0100 1000 1100 1110 */ - {illegal,0, 2, 8}, /* cf: 0100 1000 1100 1111 */ - - {illegal,0, 2, 8}, /* d0: 0100 1000 1101 0000 */ - {illegal,0, 2, 8}, /* d1: 0100 1000 1101 0001 */ - {DMOV,"ETM0,EA", 2,14}, /* d2: 0100 1000 1101 0010 */ - {DMOV,"ETM1,EA", 2,14}, /* d3: 0100 1000 1101 0011 */ - {illegal,0, 2, 8}, /* d4: 0100 1000 1101 0100 */ - {illegal,0, 2, 8}, /* d5: 0100 1000 1101 0101 */ - {illegal,0, 2, 8}, /* d6: 0100 1000 1101 0110 */ - {illegal,0, 2, 8}, /* d7: 0100 1000 1101 0111 */ - {illegal,0, 2, 8}, /* d8: 0100 1000 1101 1000 */ - {illegal,0, 2, 8}, /* d9: 0100 1000 1101 1001 */ - {illegal,0, 2, 8}, /* da: 0100 1000 1101 1010 */ - {illegal,0, 2, 8}, /* db: 0100 1000 1101 1011 */ - {illegal,0, 2, 8}, /* dc: 0100 1000 1101 1100 */ - {illegal,0, 2, 8}, /* dd: 0100 1000 1101 1101 */ - {illegal,0, 2, 8}, /* de: 0100 1000 1101 1110 */ - {illegal,0, 2, 8}, /* df: 0100 1000 1101 1111 */ - - {illegal,0, 2, 8}, /* e0: 0100 1000 1110 0000 */ - {illegal,0, 2, 8}, /* e1: 0100 1000 1110 0001 */ - {illegal,0, 2, 8}, /* e2: 0100 1000 1110 0010 */ - {illegal,0, 2, 8}, /* e3: 0100 1000 1110 0011 */ - {illegal,0, 2, 8}, /* e4: 0100 1000 1110 0100 */ - {illegal,0, 2, 8}, /* e5: 0100 1000 1110 0101 */ - {illegal,0, 2, 8}, /* e6: 0100 1000 1110 0110 */ - {illegal,0, 2, 8}, /* e7: 0100 1000 1110 0111 */ - {illegal,0, 2, 8}, /* e8: 0100 1000 1110 1000 */ - {illegal,0, 2, 8}, /* e9: 0100 1000 1110 1001 */ - {illegal,0, 2, 8}, /* ea: 0100 1000 1110 1010 */ - {illegal,0, 2, 8}, /* eb: 0100 1000 1110 1011 */ - {illegal,0, 2, 8}, /* ec: 0100 1000 1110 1100 */ - {illegal,0, 2, 8}, /* ed: 0100 1000 1110 1101 */ - {illegal,0, 2, 8}, /* ee: 0100 1000 1110 1110 */ - {illegal,0, 2, 8}, /* ef: 0100 1000 1110 1111 */ - - {illegal,0, 2, 8}, /* f0: 0100 1000 1111 0000 */ - {illegal,0, 2, 8}, /* f1: 0100 1000 1111 0001 */ - {illegal,0, 2, 8}, /* f2: 0100 1000 1111 0010 */ - {illegal,0, 2, 8}, /* f3: 0100 1000 1111 0011 */ - {illegal,0, 2, 8}, /* f4: 0100 1000 1111 0100 */ - {illegal,0, 2, 8}, /* f5: 0100 1000 1111 0101 */ - {illegal,0, 2, 8}, /* f6: 0100 1000 1111 0110 */ - {illegal,0, 2, 8}, /* f7: 0100 1000 1111 0111 */ - {illegal,0, 2, 8}, /* f8: 0100 1000 1111 1000 */ - {illegal,0, 2, 8}, /* f9: 0100 1000 1111 1001 */ - {illegal,0, 2, 8}, /* fa: 0100 1000 1111 1010 */ - {illegal,0, 2, 8}, /* fb: 0100 1000 1111 1011 */ - {illegal,0, 2, 8}, /* fc: 0100 1000 1111 1100 */ - {illegal,0, 2, 8}, /* fd: 0100 1000 1111 1101 */ - {illegal,0, 2, 8}, /* fe: 0100 1000 1111 1110 */ - {illegal,0, 2, 8} /* ff: 0100 1000 1111 1111 */ -}; - -static struct dasm_s dasm48_7807[256] = -{ - {illegal,0, 2, 8}, /* 00: 0100 1000 0000 0000 */ - {SLRC,"A", 2, 8}, /* 01: 0100 1000 0000 0001 */ - {SLRC,"B", 2, 8}, /* 02: 0100 1000 0000 0010 */ - {SLRC,"C", 2, 8}, /* 03: 0100 1000 0000 0011 */ - {illegal,0, 2, 8}, /* 04: 0100 1000 0000 0100 */ - {SLLC,"A", 2, 8}, /* 05: 0100 1000 0000 0101 */ - {SLLC,"B", 2, 8}, /* 06: 0100 1000 0000 0110 */ - {SLLC,"C", 2, 8}, /* 07: 0100 1000 0000 0111 */ - {SK,"NV", 2, 8}, /* 08: 0100 1000 0000 1000 */ - {illegal,0, 2, 8}, /* 09: 0100 1000 0000 1001 */ - {SK,"CY", 2, 8}, /* 0a: 0100 1000 0000 1010 */ - {SK,"HC", 2, 8}, /* 0b: 0100 1000 0000 1011 */ - {SK,"Z", 2, 8}, /* 0c: 0100 1000 0000 1100 */ - {illegal,0, 2, 8}, /* 0d: 0100 1000 0000 1101 */ - {illegal,0, 2, 8}, /* 0e: 0100 1000 0000 1110 */ - {illegal,0, 2, 8}, /* 0f: 0100 1000 0000 1111 */ - - {illegal,0, 2, 8}, /* 10: 0100 1000 0001 0000 */ - {illegal,0, 2, 8}, /* 11: 0100 1000 0001 0001 */ - {illegal,0, 2, 8}, /* 12: 0100 1000 0001 0010 */ - {illegal,0, 2, 8}, /* 13: 0100 1000 0001 0011 */ - {illegal,0, 2, 8}, /* 14: 0100 1000 0001 0100 */ - {illegal,0, 2, 8}, /* 15: 0100 1000 0001 0101 */ - {illegal,0, 2, 8}, /* 16: 0100 1000 0001 0110 */ - {illegal,0, 2, 8}, /* 17: 0100 1000 0001 0111 */ - {SKN,"NV", 2, 8}, /* 18: 0100 1000 0001 1000 */ - {illegal,0, 2, 8}, /* 19: 0100 1000 0001 1001 */ - {SKN,"CY", 2, 8}, /* 1a: 0100 1000 0001 1010 */ - {SKN,"HC", 2, 8}, /* 1b: 0100 1000 0001 1011 */ - {SKN,"Z", 2, 8}, /* 1c: 0100 1000 0001 1100 */ - {illegal,0, 2, 8}, /* 1d: 0100 1000 0001 1101 */ - {illegal,0, 2, 8}, /* 1e: 0100 1000 0001 1110 */ - {illegal,0, 2, 8}, /* 1f: 0100 1000 0001 1111 */ - - {illegal,0, 2, 8}, /* 20: 0100 1000 0010 0000 */ - {SLR,"A", 2, 8}, /* 21: 0100 1000 0010 0001 */ - {SLR,"B", 2, 8}, /* 22: 0100 1000 0010 0010 */ - {SLR,"C", 2, 8}, /* 23: 0100 1000 0010 0011 */ - {illegal,0, 2, 8}, /* 24: 0100 1000 0010 0100 */ - {SLL,"A", 2, 8}, /* 25: 0100 1000 0010 0101 */ - {SLL,"B", 2, 8}, /* 26: 0100 1000 0010 0110 */ - {SLL,"C", 2, 8}, /* 27: 0100 1000 0010 0111 */ - {JEA,0, 2, 8}, /* 28: 0100 1000 0010 1000 */ - {CALB,0, 2,17}, /* 29: 0100 1000 0010 1001 */ - {CLC,0, 2, 8}, /* 2a: 0100 1000 0010 1010 */ - {STC,0, 2, 8}, /* 2b: 0100 1000 0010 1011 */ - {illegal,0, 2,32}, /* 2c: 0100 1000 0010 1100 */ - {MUL,"A", 2,32}, /* 2d: 0100 1000 0010 1101 */ - {MUL,"B", 2,32}, /* 2e: 0100 1000 0010 1110 */ - {MUL,"C", 2,32}, /* 2f: 0100 1000 0010 1111 */ - - {illegal,0, 2, 8}, /* 30: 0100 1000 0011 0000 */ - {RLR,"A", 2, 8}, /* 31: 0100 1000 0011 0001 */ - {RLR,"B", 2, 8}, /* 32: 0100 1000 0011 0010 */ - {RLR,"C", 2, 8}, /* 33: 0100 1000 0011 0011 */ - {illegal,0, 2, 8}, /* 34: 0100 1000 0011 0100 */ - {RLL,"A", 2, 8}, /* 35: 0100 1000 0011 0101 */ - {RLL,"B", 2, 8}, /* 36: 0100 1000 0011 0110 */ - {RLL,"C", 2, 8}, /* 37: 0100 1000 0011 0111 */ - {RLD,0, 2,17}, /* 38: 0100 1000 0011 1000 */ - {RRD,0, 2,17}, /* 39: 0100 1000 0011 1001 */ - {NEGA,0, 2, 8}, /* 3a: 0100 1000 0011 1010 */ - {HALT,0, 2,12}, /* 3b: 0100 1000 0011 1011 */ - {illegal,0, 2,59}, /* 3c: 0100 1000 0011 1100 */ - {DIV,"A", 2,59}, /* 3d: 0100 1000 0011 1101 */ - {DIV,"B", 2,59}, /* 3e: 0100 1000 0011 1110 */ - {DIV,"C", 2,59}, /* 3f: 0100 1000 0011 1111 */ - - {SKIT,"NMI", 2, 8}, /* 40: 0100 1000 0100 0000 */ - {SKIT,"FT0", 2, 8}, /* 41: 0100 1000 0100 0001 */ - {SKIT,"FT1", 2, 8}, /* 42: 0100 1000 0100 0010 */ - {SKIT,"F1", 2, 8}, /* 43: 0100 1000 0100 0011 */ - {SKIT,"F2", 2, 8}, /* 44: 0100 1000 0100 0100 */ - {SKIT,"FE0", 2, 8}, /* 45: 0100 1000 0100 0101 */ - {SKIT,"FE1", 2, 8}, /* 46: 0100 1000 0100 0110 */ - {SKIT,"FEIN", 2, 8}, /* 47: 0100 1000 0100 0111 */ - {SKIT,"FAD", 2, 8}, /* 48: 0100 1000 0100 1000 */ - {SKIT,"FSR", 2, 8}, /* 49: 0100 1000 0100 1001 */ - {SKIT,"FST", 2, 8}, /* 4a: 0100 1000 0100 1010 */ - {SKIT,"ER", 2, 8}, /* 4b: 0100 1000 0100 1011 */ - {SKIT,"OV", 2, 8}, /* 4c: 0100 1000 0100 1100 */ - {illegal,0, 2, 8}, /* 4d: 0100 1000 0100 1101 */ - {illegal,0, 2, 8}, /* 4e: 0100 1000 0100 1110 */ - {illegal,0, 2, 8}, /* 4f: 0100 1000 0100 1111 */ - - {SKIT,"AN4", 2, 8}, /* 50: 0100 1000 0101 0000 */ - {SKIT,"AN5", 2, 8}, /* 51: 0100 1000 0101 0001 */ - {SKIT,"AN6", 2, 8}, /* 52: 0100 1000 0101 0010 */ - {SKIT,"AN7", 2, 8}, /* 53: 0100 1000 0101 0011 */ - {SKIT,"SB", 2, 8}, /* 54: 0100 1000 0101 0100 */ - {illegal,0, 2, 8}, /* 55: 0100 1000 0101 0101 */ - {illegal,0, 2, 8}, /* 56: 0100 1000 0101 0110 */ - {illegal,0, 2, 8}, /* 57: 0100 1000 0101 0111 */ - {illegal,0, 2, 8}, /* 58: 0100 1000 0101 1000 */ - {illegal,0, 2, 8}, /* 59: 0100 1000 0101 1001 */ - {illegal,0, 2, 8}, /* 5a: 0100 1000 0101 1010 */ - {illegal,0, 2, 8}, /* 5b: 0100 1000 0101 1011 */ - {illegal,0, 2, 8}, /* 5c: 0100 1000 0101 1100 */ - {illegal,0, 2, 8}, /* 5d: 0100 1000 0101 1101 */ - {illegal,0, 2, 8}, /* 5e: 0100 1000 0101 1110 */ - {illegal,0, 2, 8}, /* 5f: 0100 1000 0101 1111 */ - - {SKNIT,"NMI", 2, 8}, /* 60: 0100 1000 0110 0000 */ - {SKNIT,"FT0", 2, 8}, /* 61: 0100 1000 0110 0001 */ - {SKNIT,"FT1", 2, 8}, /* 62: 0100 1000 0110 0010 */ - {SKNIT,"F1", 2, 8}, /* 63: 0100 1000 0110 0011 */ - {SKNIT,"F2", 2, 8}, /* 64: 0100 1000 0110 0100 */ - {SKNIT,"FE0", 2, 8}, /* 65: 0100 1000 0110 0101 */ - {SKNIT,"FE1", 2, 8}, /* 66: 0100 1000 0110 0110 */ - {SKNIT,"FEIN", 2, 8}, /* 67: 0100 1000 0110 0111 */ - {SKNIT,"FAD", 2, 8}, /* 68: 0100 1000 0110 1000 */ - {SKNIT,"FSR", 2, 8}, /* 69: 0100 1000 0110 1001 */ - {SKNIT,"FST", 2, 8}, /* 6a: 0100 1000 0110 1010 */ - {SKNIT,"ER", 2, 8}, /* 6b: 0100 1000 0110 1011 */ - {SKNIT,"OV", 2, 8}, /* 6c: 0100 1000 0110 1100 */ - {illegal,0, 2, 8}, /* 6d: 0100 1000 0110 1101 */ - {illegal,0, 2, 8}, /* 6e: 0100 1000 0110 1110 */ - {illegal,0, 2, 8}, /* 6f: 0100 1000 0110 1111 */ - - {SKNIT,"AN4", 2, 8}, /* 70: 0100 1000 0111 0000 */ - {SKNIT,"AN5", 2, 8}, /* 71: 0100 1000 0111 0001 */ - {SKNIT,"AN6", 2, 8}, /* 72: 0100 1000 0111 0010 */ - {SKNIT,"AN7", 2, 8}, /* 73: 0100 1000 0111 0011 */ - {SKNIT,"SB", 2, 8}, /* 74: 0100 1000 0111 0100 */ - {illegal,0, 2, 8}, /* 75: 0100 1000 0111 0101 */ - {illegal,0, 2, 8}, /* 76: 0100 1000 0111 0110 */ - {illegal,0, 2, 8}, /* 77: 0100 1000 0111 0111 */ - {illegal,0, 2, 8}, /* 78: 0100 1000 0111 1000 */ - {illegal,0, 2, 8}, /* 79: 0100 1000 0111 1001 */ - {illegal,0, 2, 8}, /* 7a: 0100 1000 0111 1010 */ - {illegal,0, 2, 8}, /* 7b: 0100 1000 0111 1011 */ - {illegal,0, 2, 8}, /* 7c: 0100 1000 0111 1100 */ - {illegal,0, 2, 8}, /* 7d: 0100 1000 0111 1101 */ - {illegal,0, 2, 8}, /* 7e: 0100 1000 0111 1110 */ - {illegal,0, 2, 8}, /* 7f: 0100 1000 0111 1111 */ - - {illegal,0, 2, 8}, /* 80: 0100 1000 1000 0000 */ - {illegal,0, 2, 8}, /* 81: 0100 1000 1000 0001 */ - {LDEAX,"(DE)", 2,14}, /* 82: 0100 1000 1000 0010 */ - {LDEAX,"(HL)", 2,14}, /* 83: 0100 1000 1000 0011 */ - {LDEAX,"(DE++)", 2,14}, /* 84: 0100 1000 1000 0100 */ - {LDEAX,"(HL++)", 2,14}, /* 85: 0100 1000 1000 0101 */ - {illegal,0, 2, 8}, /* 86: 0100 1000 1000 0110 */ - {illegal,0, 2, 8}, /* 87: 0100 1000 1000 0111 */ - {illegal,0, 2, 8}, /* 88: 0100 1000 1000 1000 */ - {illegal,0, 2, 8}, /* 89: 0100 1000 1000 1001 */ - {illegal,0, 2, 8}, /* 8a: 0100 1000 1000 1010 */ - {LDEAX,"(DE+%b)",3,20}, /* 8b: 0100 1000 1000 1011 xxxx xxxx */ - {LDEAX,"(HL+A)", 2,20}, /* 8c: 0100 1000 1000 1100 */ - {LDEAX,"(HL+B)", 2,20}, /* 8d: 0100 1000 1000 1101 */ - {LDEAX,"(HL+EA)",2,20}, /* 8e: 0100 1000 1000 1110 */ - {LDEAX,"(HL+%b)",3,20}, /* 8f: 0100 1000 1000 1111 xxxx xxxx */ - - {illegal,0, 2, 8}, /* 90: 0100 1000 1000 0000 */ - {illegal,0, 2, 8}, /* 91: 0100 1000 1000 0001 */ - {STEAX,"(DE)", 2,14}, /* 92: 0100 1000 1000 0010 */ - {STEAX,"(HL)", 2,14}, /* 93: 0100 1000 1000 0011 */ - {STEAX,"(DE++)", 2,14}, /* 94: 0100 1000 1000 0100 */ - {STEAX,"(HL++)", 2,14}, /* 95: 0100 1000 1000 0101 */ - {illegal,0, 2, 8}, /* 96: 0100 1000 1000 0110 */ - {illegal,0, 2, 8}, /* 97: 0100 1000 1000 0111 */ - {illegal,0, 2, 8}, /* 98: 0100 1000 1000 1000 */ - {illegal,0, 2, 8}, /* 99: 0100 1000 1000 1001 */ - {illegal,0, 2, 8}, /* 9a: 0100 1000 1000 1010 */ - {STEAX,"(DE+%b)",3,20}, /* 9b: 0100 1000 1000 1011 xxxx xxxx */ - {STEAX,"(HL+A)", 2,20}, /* 9c: 0100 1000 1000 1100 */ - {STEAX,"(HL+B)", 2,20}, /* 9d: 0100 1000 1000 1101 */ - {STEAX,"(HL+EA)",2,20}, /* 9e: 0100 1000 1000 1110 */ - {STEAX,"(HL+%b)",3,20}, /* 9f: 0100 1000 1000 1111 xxxx xxxx */ - - {DSLR,"EA", 2, 8}, /* a0: 0100 1000 1010 0000 */ - {illegal,0, 2, 8}, /* a1: 0100 1000 1010 0001 */ - {illegal,0, 2, 8}, /* a2: 0100 1000 1010 0010 */ - {illegal,0, 2, 8}, /* a3: 0100 1000 1010 0011 */ - {DSLL,"EA", 2, 8}, /* a4: 0100 1000 1010 0100 */ - {illegal,0, 2, 8}, /* a5: 0100 1000 1010 0101 */ - {illegal,0, 2, 8}, /* a6: 0100 1000 1010 0110 */ - {illegal,0, 2, 8}, /* a7: 0100 1000 1010 0111 */ - {TABLE,0, 2,17}, /* a8: 0100 1000 1010 1000 */ - {illegal,0, 2, 8}, /* a9: 0100 1000 1010 1001 */ - {CMC,0, 2, 8}, /* aa: 0100 1000 1010 1010 */ /* 7807 */ - {illegal,0, 2, 8}, /* ab: 0100 1000 1010 1011 */ - {EXA,0, 2, 8}, /* ac: 0100 1000 1010 1100 */ /* 7807 */ - {EXR,0, 2, 8}, /* ad: 0100 1000 1010 1101 */ /* 7807 */ - {EXH,0, 2, 8}, /* ae: 0100 1000 1010 1110 */ /* 7807 */ - {EXX,0, 2, 8}, /* af: 0100 1000 1010 1111 */ /* 7807 */ - - {DRLR,"EA", 2, 8}, /* b0: 0100 1000 1011 0000 */ - {illegal,0, 2, 8}, /* b1: 0100 1000 1011 0001 */ - {illegal,0, 2, 8}, /* b2: 0100 1000 1011 0010 */ - {illegal,0, 2, 8}, /* b3: 0100 1000 1011 0011 */ - {DRLL,"EA", 2, 8}, /* b4: 0100 1000 1011 0100 */ - {illegal,0, 2, 8}, /* b5: 0100 1000 1011 0101 */ - {illegal,0, 2, 8}, /* b6: 0100 1000 1011 0110 */ - {illegal,0, 2, 8}, /* b7: 0100 1000 1011 0111 */ - {illegal,0, 2, 8}, /* b8: 0100 1000 1011 1000 */ - {illegal,0, 2, 8}, /* b9: 0100 1000 1011 1001 */ - {illegal,0, 2, 8}, /* ba: 0100 1000 1011 1010 */ - {illegal,0, 2, 8}, /* bb: 0100 1000 1011 1011 */ - {illegal,0, 2, 8}, /* bc: 0100 1000 1011 1100 */ - {illegal,0, 2, 8}, /* bd: 0100 1000 1011 1101 */ - {illegal,0, 2, 8}, /* be: 0100 1000 1011 1110 */ - {illegal,0, 2, 8}, /* bf: 0100 1000 1011 1111 */ - - {DMOV,"EA,ECNT", 2,14}, /* c0: 0100 1000 1100 0000 */ - {DMOV,"EA,ECPT0",2,14}, /* c1: 0100 1000 1100 0001 */ /* 7807 */ - {DMOV,"EA,ECPT1",2,14}, /* c2: 0100 1000 1100 0010 */ /* 7807 */ - {illegal,0, 2, 8}, /* c3: 0100 1000 1100 0011 */ - {illegal,0, 2, 8}, /* c4: 0100 1000 1100 0100 */ - {illegal,0, 2, 8}, /* c5: 0100 1000 1100 0101 */ - {illegal,0, 2, 8}, /* c6: 0100 1000 1100 0110 */ - {illegal,0, 2, 8}, /* c7: 0100 1000 1100 0111 */ - {illegal,0, 2, 8}, /* c8: 0100 1000 1100 1000 */ - {illegal,0, 2, 8}, /* c9: 0100 1000 1100 1001 */ - {illegal,0, 2, 8}, /* ca: 0100 1000 1100 1010 */ - {illegal,0, 2, 8}, /* cb: 0100 1000 1100 1011 */ - {illegal,0, 2, 8}, /* cc: 0100 1000 1100 1100 */ - {illegal,0, 2, 8}, /* cd: 0100 1000 1100 1101 */ - {illegal,0, 2, 8}, /* ce: 0100 1000 1100 1110 */ - {illegal,0, 2, 8}, /* cf: 0100 1000 1100 1111 */ - - {illegal,0, 2, 8}, /* d0: 0100 1000 1101 0000 */ - {illegal,0, 2, 8}, /* d1: 0100 1000 1101 0001 */ - {DMOV,"ETM0,EA", 2,14}, /* d2: 0100 1000 1101 0010 */ - {DMOV,"ETM1,EA", 2,14}, /* d3: 0100 1000 1101 0011 */ - {illegal,0, 2, 8}, /* d4: 0100 1000 1101 0100 */ - {illegal,0, 2, 8}, /* d5: 0100 1000 1101 0101 */ - {illegal,0, 2, 8}, /* d6: 0100 1000 1101 0110 */ - {illegal,0, 2, 8}, /* d7: 0100 1000 1101 0111 */ - {illegal,0, 2, 8}, /* d8: 0100 1000 1101 1000 */ - {illegal,0, 2, 8}, /* d9: 0100 1000 1101 1001 */ - {illegal,0, 2, 8}, /* da: 0100 1000 1101 1010 */ - {illegal,0, 2, 8}, /* db: 0100 1000 1101 1011 */ - {illegal,0, 2, 8}, /* dc: 0100 1000 1101 1100 */ - {illegal,0, 2, 8}, /* dd: 0100 1000 1101 1101 */ - {illegal,0, 2, 8}, /* de: 0100 1000 1101 1110 */ - {illegal,0, 2, 8}, /* df: 0100 1000 1101 1111 */ - - {illegal,0, 2, 8}, /* e0: 0100 1000 1110 0000 */ - {illegal,0, 2, 8}, /* e1: 0100 1000 1110 0001 */ - {illegal,0, 2, 8}, /* e2: 0100 1000 1110 0010 */ - {illegal,0, 2, 8}, /* e3: 0100 1000 1110 0011 */ - {illegal,0, 2, 8}, /* e4: 0100 1000 1110 0100 */ - {illegal,0, 2, 8}, /* e5: 0100 1000 1110 0101 */ - {illegal,0, 2, 8}, /* e6: 0100 1000 1110 0110 */ - {illegal,0, 2, 8}, /* e7: 0100 1000 1110 0111 */ - {illegal,0, 2, 8}, /* e8: 0100 1000 1110 1000 */ - {illegal,0, 2, 8}, /* e9: 0100 1000 1110 1001 */ - {illegal,0, 2, 8}, /* ea: 0100 1000 1110 1010 */ - {illegal,0, 2, 8}, /* eb: 0100 1000 1110 1011 */ - {illegal,0, 2, 8}, /* ec: 0100 1000 1110 1100 */ - {illegal,0, 2, 8}, /* ed: 0100 1000 1110 1101 */ - {illegal,0, 2, 8}, /* ee: 0100 1000 1110 1110 */ - {illegal,0, 2, 8}, /* ef: 0100 1000 1110 1111 */ - - {illegal,0, 2, 8}, /* f0: 0100 1000 1111 0000 */ - {illegal,0, 2, 8}, /* f1: 0100 1000 1111 0001 */ - {illegal,0, 2, 8}, /* f2: 0100 1000 1111 0010 */ - {illegal,0, 2, 8}, /* f3: 0100 1000 1111 0011 */ - {illegal,0, 2, 8}, /* f4: 0100 1000 1111 0100 */ - {illegal,0, 2, 8}, /* f5: 0100 1000 1111 0101 */ - {illegal,0, 2, 8}, /* f6: 0100 1000 1111 0110 */ - {illegal,0, 2, 8}, /* f7: 0100 1000 1111 0111 */ - {illegal,0, 2, 8}, /* f8: 0100 1000 1111 1000 */ - {illegal,0, 2, 8}, /* f9: 0100 1000 1111 1001 */ - {illegal,0, 2, 8}, /* fa: 0100 1000 1111 1010 */ - {illegal,0, 2, 8}, /* fb: 0100 1000 1111 1011 */ - {illegal,0, 2, 8}, /* fc: 0100 1000 1111 1100 */ - {illegal,0, 2, 8}, /* fd: 0100 1000 1111 1101 */ - {illegal,0, 2, 8}, /* fe: 0100 1000 1111 1110 */ - {illegal,0, 2, 8} /* ff: 0100 1000 1111 1111 */ -}; - -/* prefix 4C */ -static struct dasm_s dasm4C_7810[256] = -{ - {illegal,0, 2, 8}, /* 00: 0100 1100 0000 0000 */ - {illegal,0, 2, 8}, /* 01: 0100 1100 0000 0001 */ - {illegal,0, 2, 8}, /* 02: 0100 1100 0000 0010 */ - {illegal,0, 2, 8}, /* 03: 0100 1100 0000 0011 */ - {illegal,0, 2, 8}, /* 04: 0100 1100 0000 0100 */ - {illegal,0, 2, 8}, /* 05: 0100 1100 0000 0101 */ - {illegal,0, 2, 8}, /* 06: 0100 1100 0000 0110 */ - {illegal,0, 2, 8}, /* 07: 0100 1100 0000 0111 */ - {illegal,0, 2, 8}, /* 08: 0100 1100 0000 1000 */ - {illegal,0, 2, 8}, /* 09: 0100 1100 0000 1001 */ - {illegal,0, 2, 8}, /* 0a: 0100 1100 0000 1010 */ - {illegal,0, 2, 8}, /* 0b: 0100 1100 0000 1011 */ - {illegal,0, 2, 8}, /* 0c: 0100 1100 0000 1100 */ - {illegal,0, 2, 8}, /* 0d: 0100 1100 0000 1101 */ - {illegal,0, 2, 8}, /* 0e: 0100 1100 0000 1110 */ - {illegal,0, 2, 8}, /* 0f: 0100 1100 0000 1111 */ - - {illegal,0, 2, 8}, /* 10: 0100 1100 0001 0000 */ - {illegal,0, 2, 8}, /* 11: 0100 1100 0001 0001 */ - {illegal,0, 2, 8}, /* 12: 0100 1100 0001 0010 */ - {illegal,0, 2, 8}, /* 13: 0100 1100 0001 0011 */ - {illegal,0, 2, 8}, /* 14: 0100 1100 0001 0100 */ - {illegal,0, 2, 8}, /* 15: 0100 1100 0001 0101 */ - {illegal,0, 2, 8}, /* 16: 0100 1100 0001 0110 */ - {illegal,0, 2, 8}, /* 17: 0100 1100 0001 0111 */ - {illegal,0, 2, 8}, /* 18: 0100 1100 0001 1000 */ - {illegal,0, 2, 8}, /* 19: 0100 1100 0001 1001 */ - {illegal,0, 2, 8}, /* 1a: 0100 1100 0001 1010 */ - {illegal,0, 2, 8}, /* 1b: 0100 1100 0001 1011 */ - {illegal,0, 2, 8}, /* 1c: 0100 1100 0001 1100 */ - {illegal,0, 2, 8}, /* 1d: 0100 1100 0001 1101 */ - {illegal,0, 2, 8}, /* 1e: 0100 1100 0001 1110 */ - {illegal,0, 2, 8}, /* 1f: 0100 1100 0001 1111 */ - - {illegal,0, 2, 8}, /* 20: 0100 1100 0010 0000 */ - {illegal,0, 2, 8}, /* 21: 0100 1100 0010 0001 */ - {illegal,0, 2, 8}, /* 22: 0100 1100 0010 0010 */ - {illegal,0, 2, 8}, /* 23: 0100 1100 0010 0011 */ - {illegal,0, 2, 8}, /* 24: 0100 1100 0010 0100 */ - {illegal,0, 2, 8}, /* 25: 0100 1100 0010 0101 */ - {illegal,0, 2, 8}, /* 26: 0100 1100 0010 0110 */ - {illegal,0, 2, 8}, /* 27: 0100 1100 0010 0111 */ - {illegal,0, 2, 8}, /* 28: 0100 1100 0010 1000 */ - {illegal,0, 2, 8}, /* 29: 0100 1100 0010 1001 */ - {illegal,0, 2, 8}, /* 2a: 0100 1100 0010 1010 */ - {illegal,0, 2, 8}, /* 2b: 0100 1100 0010 1011 */ - {illegal,0, 2, 8}, /* 2c: 0100 1100 0010 1100 */ - {illegal,0, 2, 8}, /* 2d: 0100 1100 0010 1101 */ - {illegal,0, 2, 8}, /* 2e: 0100 1100 0010 1110 */ - {illegal,0, 2, 8}, /* 2f: 0100 1100 0010 1111 */ - - {illegal,0, 2, 8}, /* 30: 0100 1100 0011 0000 */ - {illegal,0, 2, 8}, /* 31: 0100 1100 0011 0001 */ - {illegal,0, 2, 8}, /* 32: 0100 1100 0011 0010 */ - {illegal,0, 2, 8}, /* 33: 0100 1100 0011 0011 */ - {illegal,0, 2, 8}, /* 34: 0100 1100 0011 0100 */ - {illegal,0, 2, 8}, /* 35: 0100 1100 0011 0101 */ - {illegal,0, 2, 8}, /* 36: 0100 1100 0011 0110 */ - {illegal,0, 2, 8}, /* 37: 0100 1100 0011 0111 */ - {illegal,0, 2, 8}, /* 38: 0100 1100 0011 1000 */ - {illegal,0, 2, 8}, /* 39: 0100 1100 0011 1001 */ - {illegal,0, 2, 8}, /* 3a: 0100 1100 0011 1010 */ - {illegal,0, 2, 8}, /* 3b: 0100 1100 0011 1011 */ - {illegal,0, 2, 8}, /* 3c: 0100 1100 0011 1100 */ - {illegal,0, 2, 8}, /* 3d: 0100 1100 0011 1101 */ - {illegal,0, 2, 8}, /* 3e: 0100 1100 0011 1110 */ - {illegal,0, 2, 8}, /* 3f: 0100 1100 0011 1111 */ - - {illegal,0, 2, 8}, /* 40: 0100 1100 0100 0000 */ - {illegal,0, 2, 8}, /* 41: 0100 1100 0100 0001 */ - {illegal,0, 2, 8}, /* 42: 0100 1100 0100 0010 */ - {illegal,0, 2, 8}, /* 43: 0100 1100 0100 0011 */ - {illegal,0, 2, 8}, /* 44: 0100 1100 0100 0100 */ - {illegal,0, 2, 8}, /* 45: 0100 1100 0100 0101 */ - {illegal,0, 2, 8}, /* 46: 0100 1100 0100 0110 */ - {illegal,0, 2, 8}, /* 47: 0100 1100 0100 0111 */ - {illegal,0, 2, 8}, /* 48: 0100 1100 0100 1000 */ - {illegal,0, 2, 8}, /* 49: 0100 1100 0100 1001 */ - {illegal,0, 2, 8}, /* 4a: 0100 1100 0100 1010 */ - {illegal,0, 2, 8}, /* 4b: 0100 1100 0100 1011 */ - {illegal,0, 2, 8}, /* 4c: 0100 1100 0100 1100 */ - {illegal,0, 2, 8}, /* 4d: 0100 1100 0100 1101 */ - {illegal,0, 2, 8}, /* 4e: 0100 1100 0100 1110 */ - {illegal,0, 2, 8}, /* 4f: 0100 1100 0100 1111 */ - - {illegal,0, 2, 8}, /* 50: 0100 1100 0101 0000 */ - {illegal,0, 2, 8}, /* 51: 0100 1100 0101 0001 */ - {illegal,0, 2, 8}, /* 52: 0100 1100 0101 0010 */ - {illegal,0, 2, 8}, /* 53: 0100 1100 0101 0011 */ - {illegal,0, 2, 8}, /* 54: 0100 1100 0101 0100 */ - {illegal,0, 2, 8}, /* 55: 0100 1100 0101 0101 */ - {illegal,0, 2, 8}, /* 56: 0100 1100 0101 0110 */ - {illegal,0, 2, 8}, /* 57: 0100 1100 0101 0111 */ - {illegal,0, 2, 8}, /* 58: 0100 1100 0101 1000 */ - {illegal,0, 2, 8}, /* 59: 0100 1100 0101 1001 */ - {illegal,0, 2, 8}, /* 5a: 0100 1100 0101 1010 */ - {illegal,0, 2, 8}, /* 5b: 0100 1100 0101 1011 */ - {illegal,0, 2, 8}, /* 5c: 0100 1100 0101 1100 */ - {illegal,0, 2, 8}, /* 5d: 0100 1100 0101 1101 */ - {illegal,0, 2, 8}, /* 5e: 0100 1100 0101 1110 */ - {illegal,0, 2, 8}, /* 5f: 0100 1100 0101 1111 */ - - {illegal,0, 2, 8}, /* 60: 0100 1100 0110 0000 */ - {illegal,0, 2, 8}, /* 61: 0100 1100 0110 0001 */ - {illegal,0, 2, 8}, /* 62: 0100 1100 0110 0010 */ - {illegal,0, 2, 8}, /* 63: 0100 1100 0110 0011 */ - {illegal,0, 2, 8}, /* 64: 0100 1100 0110 0100 */ - {illegal,0, 2, 8}, /* 65: 0100 1100 0110 0101 */ - {illegal,0, 2, 8}, /* 66: 0100 1100 0110 0110 */ - {illegal,0, 2, 8}, /* 67: 0100 1100 0110 0111 */ - {illegal,0, 2, 8}, /* 68: 0100 1100 0110 1000 */ - {illegal,0, 2, 8}, /* 69: 0100 1100 0110 1001 */ - {illegal,0, 2, 8}, /* 6a: 0100 1100 0110 1010 */ - {illegal,0, 2, 8}, /* 6b: 0100 1100 0110 1011 */ - {illegal,0, 2, 8}, /* 6c: 0100 1100 0110 1100 */ - {illegal,0, 2, 8}, /* 6d: 0100 1100 0110 1101 */ - {illegal,0, 2, 8}, /* 6e: 0100 1100 0110 1110 */ - {illegal,0, 2, 8}, /* 6f: 0100 1100 0110 1111 */ - - {illegal,0, 2, 8}, /* 70: 0100 1100 0111 0000 */ - {illegal,0, 2, 8}, /* 71: 0100 1100 0111 0001 */ - {illegal,0, 2, 8}, /* 72: 0100 1100 0111 0010 */ - {illegal,0, 2, 8}, /* 73: 0100 1100 0111 0011 */ - {illegal,0, 2, 8}, /* 74: 0100 1100 0111 0100 */ - {illegal,0, 2, 8}, /* 75: 0100 1100 0111 0101 */ - {illegal,0, 2, 8}, /* 76: 0100 1100 0111 0110 */ - {illegal,0, 2, 8}, /* 77: 0100 1100 0111 0111 */ - {illegal,0, 2, 8}, /* 78: 0100 1100 0111 1000 */ - {illegal,0, 2, 8}, /* 79: 0100 1100 0111 1001 */ - {illegal,0, 2, 8}, /* 7a: 0100 1100 0111 1010 */ - {illegal,0, 2, 8}, /* 7b: 0100 1100 0111 1011 */ - {illegal,0, 2, 8}, /* 7c: 0100 1100 0111 1100 */ - {illegal,0, 2, 8}, /* 7d: 0100 1100 0111 1101 */ - {illegal,0, 2, 8}, /* 7e: 0100 1100 0111 1110 */ - {illegal,0, 2, 8}, /* 7f: 0100 1100 0111 1111 */ - - {illegal,0, 2, 8}, /* 80: 0100 1100 1000 0000 */ - {illegal,0, 2, 8}, /* 81: 0100 1100 1000 0001 */ - {illegal,0, 2, 8}, /* 82: 0100 1100 1000 0010 */ - {illegal,0, 2, 8}, /* 83: 0100 1100 1000 0011 */ - {illegal,0, 2, 8}, /* 84: 0100 1100 1000 0100 */ - {illegal,0, 2, 8}, /* 85: 0100 1100 1000 0101 */ - {illegal,0, 2, 8}, /* 86: 0100 1100 1000 0110 */ - {illegal,0, 2, 8}, /* 87: 0100 1100 1000 0111 */ - {illegal,0, 2, 8}, /* 88: 0100 1100 1000 1000 */ - {illegal,0, 2, 8}, /* 89: 0100 1100 1000 1001 */ - {illegal,0, 2, 8}, /* 8a: 0100 1100 1000 1010 */ - {illegal,0, 2, 8}, /* 8b: 0100 1100 1000 1011 */ - {illegal,0, 2, 8}, /* 8c: 0100 1100 1000 1100 */ - {illegal,0, 2, 8}, /* 8d: 0100 1100 1000 1101 */ - {illegal,0, 2, 8}, /* 8e: 0100 1100 1000 1110 */ - {illegal,0, 2, 8}, /* 8f: 0100 1100 1000 1111 */ - - {illegal,0, 2, 8}, /* 90: 0100 1100 1001 0000 */ - {illegal,0, 2, 8}, /* 91: 0100 1100 1001 0001 */ - {illegal,0, 2, 8}, /* 92: 0100 1100 1001 0010 */ - {illegal,0, 2, 8}, /* 93: 0100 1100 1001 0011 */ - {illegal,0, 2, 8}, /* 94: 0100 1100 1001 0100 */ - {illegal,0, 2, 8}, /* 95: 0100 1100 1001 0101 */ - {illegal,0, 2, 8}, /* 96: 0100 1100 1001 0110 */ - {illegal,0, 2, 8}, /* 97: 0100 1100 1001 0111 */ - {illegal,0, 2, 8}, /* 98: 0100 1100 1001 1000 */ - {illegal,0, 2, 8}, /* 99: 0100 1100 1001 1001 */ - {illegal,0, 2, 8}, /* 9a: 0100 1100 1001 1010 */ - {illegal,0, 2, 8}, /* 9b: 0100 1100 1001 1011 */ - {illegal,0, 2, 8}, /* 9c: 0100 1100 1001 1100 */ - {illegal,0, 2, 8}, /* 9d: 0100 1100 1001 1101 */ - {illegal,0, 2, 8}, /* 9e: 0100 1100 1001 1110 */ - {illegal,0, 2, 8}, /* 9f: 0100 1100 1001 1111 */ - - {illegal,0, 2, 8}, /* a0: 0100 1100 1010 0000 */ - {illegal,0, 2, 8}, /* a1: 0100 1100 1010 0001 */ - {illegal,0, 2, 8}, /* a2: 0100 1100 1010 0010 */ - {illegal,0, 2, 8}, /* a3: 0100 1100 1010 0011 */ - {illegal,0, 2, 8}, /* a4: 0100 1100 1010 0100 */ - {illegal,0, 2, 8}, /* a5: 0100 1100 1010 0101 */ - {illegal,0, 2, 8}, /* a6: 0100 1100 1010 0110 */ - {illegal,0, 2, 8}, /* a7: 0100 1100 1010 0111 */ - {illegal,0, 2, 8}, /* a8: 0100 1100 1010 1000 */ - {illegal,0, 2, 8}, /* a9: 0100 1100 1010 1001 */ - {illegal,0, 2, 8}, /* aa: 0100 1100 1010 1010 */ - {illegal,0, 2, 8}, /* ab: 0100 1100 1010 1011 */ - {illegal,0, 2, 8}, /* ac: 0100 1100 1010 1100 */ - {illegal,0, 2, 8}, /* ad: 0100 1100 1010 1101 */ - {illegal,0, 2, 8}, /* ae: 0100 1100 1010 1110 */ - {illegal,0, 2, 8}, /* af: 0100 1100 1010 1111 */ - - {illegal,0, 2, 8}, /* b0: 0100 1100 1011 0000 */ - {illegal,0, 2, 8}, /* b1: 0100 1100 1011 0001 */ - {illegal,0, 2, 8}, /* b2: 0100 1100 1011 0010 */ - {illegal,0, 2, 8}, /* b3: 0100 1100 1011 0011 */ - {illegal,0, 2, 8}, /* b4: 0100 1100 1011 0100 */ - {illegal,0, 2, 8}, /* b5: 0100 1100 1011 0101 */ - {illegal,0, 2, 8}, /* b6: 0100 1100 1011 0110 */ - {illegal,0, 2, 8}, /* b7: 0100 1100 1011 0111 */ - {illegal,0, 2, 8}, /* b8: 0100 1100 1011 1000 */ - {illegal,0, 2, 8}, /* b9: 0100 1100 1011 1001 */ - {illegal,0, 2, 8}, /* ba: 0100 1100 1011 1010 */ - {illegal,0, 2, 8}, /* bb: 0100 1100 1011 1011 */ - {illegal,0, 2, 8}, /* bc: 0100 1100 1011 1100 */ - {illegal,0, 2, 8}, /* bd: 0100 1100 1011 1101 */ - {illegal,0, 2, 8}, /* be: 0100 1100 1011 1110 */ - {illegal,0, 2, 8}, /* bf: 0100 1100 1011 1111 */ - - {MOV,"A,PA", 2,10}, /* c0: 0100 1100 1100 0000 */ - {MOV,"A,PB", 2,10}, /* c1: 0100 1100 1100 0001 */ - {MOV,"A,PC", 2,10}, /* c2: 0100 1100 1100 0010 */ - {MOV,"A,PD", 2,10}, /* c3: 0100 1100 1100 0011 */ - {illegal,0, 2,10}, /* c4: 0100 1100 1100 0100 */ - {MOV,"A,PF", 2,10}, /* c5: 0100 1100 1100 0101 */ - {MOV,"A,MKH", 2,10}, /* c6: 0100 1100 1100 0110 */ - {MOV,"A,MKL", 2,10}, /* c7: 0100 1100 1100 0111 */ - {MOV,"A,ANM", 2,10}, /* c8: 0100 1100 1100 1000 */ /* 7810 */ - {MOV,"A,SMH", 2,10}, /* c9: 0100 1100 1100 1001 */ - {illegal,0, 2,10}, /* ca: 0100 1100 1100 1010 */ - {MOV,"A,EOM", 2,10}, /* cb: 0100 1100 1100 1011 */ - {illegal,0, 2,10}, /* cc: 0100 1100 1100 1100 */ - {MOV,"A,TMM", 2,10}, /* cd: 0100 1100 1100 1101 */ - {illegal,0, 2,10}, /* ce: 0100 1100 1100 1110 */ - {illegal,0, 2,10}, /* cf: 0100 1100 1100 1111 */ - - {illegal,0, 2,10}, /* d0: 0100 1100 1101 0000 */ - {illegal,0, 2,10}, /* d1: 0100 1100 1101 0001 */ - {illegal,0, 2,10}, /* d2: 0100 1100 1101 0010 */ - {illegal,0, 2,10}, /* d3: 0100 1100 1101 0011 */ - {illegal,0, 2,10}, /* d4: 0100 1100 1101 0100 */ - {illegal,0, 2,10}, /* d5: 0100 1100 1101 0101 */ - {illegal,0, 2,10}, /* d6: 0100 1100 1101 0110 */ - {illegal,0, 2,10}, /* d7: 0100 1100 1101 0111 */ - {illegal,0, 2,10}, /* d8: 0100 1100 1101 1000 */ - {MOV,"A,RXB", 2,10}, /* d9: 0100 1100 1101 1001 */ - {illegal,0, 2,10}, /* da: 0100 1100 1101 1010 */ - {illegal,0, 2,10}, /* db: 0100 1100 1101 1011 */ - {illegal,0, 2,10}, /* dc: 0100 1100 1101 1100 */ - {illegal,0, 2,10}, /* dd: 0100 1100 1101 1101 */ - {illegal,0, 2,10}, /* de: 0100 1100 1101 1110 */ - {illegal,0, 2,10}, /* df: 0100 1100 1101 1111 */ - - {MOV,"A,CR0", 2,10}, /* e0: 0100 1100 1110 0000 */ /* 7810 */ - {MOV,"A,CR1", 2,10}, /* e1: 0100 1100 1110 0001 */ /* 7810 */ - {MOV,"A,CR2", 2,10}, /* e2: 0100 1100 1110 0010 */ /* 7810 */ - {MOV,"A,CR3", 2,10}, /* e3: 0100 1100 1110 0011 */ /* 7810 */ - {illegal,0, 2,10}, /* e4: 0100 1100 1110 0100 */ - {illegal,0, 2,10}, /* e5: 0100 1100 1110 0101 */ - {illegal,0, 2,10}, /* e6: 0100 1100 1110 0110 */ - {illegal,0, 2,10}, /* e7: 0100 1100 1110 0111 */ - {illegal,0, 2,10}, /* e8: 0100 1100 1110 1000 */ - {illegal,0, 2,10}, /* e9: 0100 1100 1110 1001 */ - {illegal,0, 2,10}, /* ea: 0100 1100 1110 1010 */ - {illegal,0, 2,10}, /* eb: 0100 1100 1110 1011 */ - {illegal,0, 2,10}, /* ec: 0100 1100 1110 1100 */ - {illegal,0, 2,10}, /* ed: 0100 1100 1110 1101 */ - {illegal,0, 2,10}, /* ee: 0100 1100 1110 1110 */ - {illegal,0, 2,10}, /* ef: 0100 1100 1110 1111 */ - - {illegal,0, 2,10}, /* f0: 0100 1100 1111 0000 */ - {illegal,0, 2,10}, /* f1: 0100 1100 1111 0001 */ - {illegal,0, 2,10}, /* f2: 0100 1100 1111 0010 */ - {illegal,0, 2,10}, /* f3: 0100 1100 1111 0011 */ - {illegal,0, 2,10}, /* f4: 0100 1100 1111 0100 */ - {illegal,0, 2,10}, /* f5: 0100 1100 1111 0101 */ - {illegal,0, 2,10}, /* f6: 0100 1100 1111 0110 */ - {illegal,0, 2,10}, /* f7: 0100 1100 1111 0111 */ - {illegal,0, 2,10}, /* f8: 0100 1100 1111 1000 */ - {illegal,0, 2,10}, /* f9: 0100 1100 1111 1001 */ - {illegal,0, 2,10}, /* fa: 0100 1100 1111 1010 */ - {illegal,0, 2,10}, /* fb: 0100 1100 1111 1011 */ - {illegal,0, 2,10}, /* fc: 0100 1100 1111 1100 */ - {illegal,0, 2,10}, /* fd: 0100 1100 1111 1101 */ - {illegal,0, 2,10}, /* fe: 0100 1100 1111 1110 */ - {illegal,0, 2,10} /* ff: 0100 1100 1111 1111 */ -}; - -static struct dasm_s dasm4C_7807[256] = -{ - {illegal,0, 2, 8}, /* 00: 0100 1100 0000 0000 */ - {illegal,0, 2, 8}, /* 01: 0100 1100 0000 0001 */ - {illegal,0, 2, 8}, /* 02: 0100 1100 0000 0010 */ - {illegal,0, 2, 8}, /* 03: 0100 1100 0000 0011 */ - {illegal,0, 2, 8}, /* 04: 0100 1100 0000 0100 */ - {illegal,0, 2, 8}, /* 05: 0100 1100 0000 0101 */ - {illegal,0, 2, 8}, /* 06: 0100 1100 0000 0110 */ - {illegal,0, 2, 8}, /* 07: 0100 1100 0000 0111 */ - {illegal,0, 2, 8}, /* 08: 0100 1100 0000 1000 */ - {illegal,0, 2, 8}, /* 09: 0100 1100 0000 1001 */ - {illegal,0, 2, 8}, /* 0a: 0100 1100 0000 1010 */ - {illegal,0, 2, 8}, /* 0b: 0100 1100 0000 1011 */ - {illegal,0, 2, 8}, /* 0c: 0100 1100 0000 1100 */ - {illegal,0, 2, 8}, /* 0d: 0100 1100 0000 1101 */ - {illegal,0, 2, 8}, /* 0e: 0100 1100 0000 1110 */ - {illegal,0, 2, 8}, /* 0f: 0100 1100 0000 1111 */ - - {illegal,0, 2, 8}, /* 10: 0100 1100 0001 0000 */ - {illegal,0, 2, 8}, /* 11: 0100 1100 0001 0001 */ - {illegal,0, 2, 8}, /* 12: 0100 1100 0001 0010 */ - {illegal,0, 2, 8}, /* 13: 0100 1100 0001 0011 */ - {illegal,0, 2, 8}, /* 14: 0100 1100 0001 0100 */ - {illegal,0, 2, 8}, /* 15: 0100 1100 0001 0101 */ - {illegal,0, 2, 8}, /* 16: 0100 1100 0001 0110 */ - {illegal,0, 2, 8}, /* 17: 0100 1100 0001 0111 */ - {illegal,0, 2, 8}, /* 18: 0100 1100 0001 1000 */ - {illegal,0, 2, 8}, /* 19: 0100 1100 0001 1001 */ - {illegal,0, 2, 8}, /* 1a: 0100 1100 0001 1010 */ - {illegal,0, 2, 8}, /* 1b: 0100 1100 0001 1011 */ - {illegal,0, 2, 8}, /* 1c: 0100 1100 0001 1100 */ - {illegal,0, 2, 8}, /* 1d: 0100 1100 0001 1101 */ - {illegal,0, 2, 8}, /* 1e: 0100 1100 0001 1110 */ - {illegal,0, 2, 8}, /* 1f: 0100 1100 0001 1111 */ - - {illegal,0, 2, 8}, /* 20: 0100 1100 0010 0000 */ - {illegal,0, 2, 8}, /* 21: 0100 1100 0010 0001 */ - {illegal,0, 2, 8}, /* 22: 0100 1100 0010 0010 */ - {illegal,0, 2, 8}, /* 23: 0100 1100 0010 0011 */ - {illegal,0, 2, 8}, /* 24: 0100 1100 0010 0100 */ - {illegal,0, 2, 8}, /* 25: 0100 1100 0010 0101 */ - {illegal,0, 2, 8}, /* 26: 0100 1100 0010 0110 */ - {illegal,0, 2, 8}, /* 27: 0100 1100 0010 0111 */ - {illegal,0, 2, 8}, /* 28: 0100 1100 0010 1000 */ - {illegal,0, 2, 8}, /* 29: 0100 1100 0010 1001 */ - {illegal,0, 2, 8}, /* 2a: 0100 1100 0010 1010 */ - {illegal,0, 2, 8}, /* 2b: 0100 1100 0010 1011 */ - {illegal,0, 2, 8}, /* 2c: 0100 1100 0010 1100 */ - {illegal,0, 2, 8}, /* 2d: 0100 1100 0010 1101 */ - {illegal,0, 2, 8}, /* 2e: 0100 1100 0010 1110 */ - {illegal,0, 2, 8}, /* 2f: 0100 1100 0010 1111 */ - - {illegal,0, 2, 8}, /* 30: 0100 1100 0011 0000 */ - {illegal,0, 2, 8}, /* 31: 0100 1100 0011 0001 */ - {illegal,0, 2, 8}, /* 32: 0100 1100 0011 0010 */ - {illegal,0, 2, 8}, /* 33: 0100 1100 0011 0011 */ - {illegal,0, 2, 8}, /* 34: 0100 1100 0011 0100 */ - {illegal,0, 2, 8}, /* 35: 0100 1100 0011 0101 */ - {illegal,0, 2, 8}, /* 36: 0100 1100 0011 0110 */ - {illegal,0, 2, 8}, /* 37: 0100 1100 0011 0111 */ - {illegal,0, 2, 8}, /* 38: 0100 1100 0011 1000 */ - {illegal,0, 2, 8}, /* 39: 0100 1100 0011 1001 */ - {illegal,0, 2, 8}, /* 3a: 0100 1100 0011 1010 */ - {illegal,0, 2, 8}, /* 3b: 0100 1100 0011 1011 */ - {illegal,0, 2, 8}, /* 3c: 0100 1100 0011 1100 */ - {illegal,0, 2, 8}, /* 3d: 0100 1100 0011 1101 */ - {illegal,0, 2, 8}, /* 3e: 0100 1100 0011 1110 */ - {illegal,0, 2, 8}, /* 3f: 0100 1100 0011 1111 */ - - {illegal,0, 2, 8}, /* 40: 0100 1100 0100 0000 */ - {illegal,0, 2, 8}, /* 41: 0100 1100 0100 0001 */ - {illegal,0, 2, 8}, /* 42: 0100 1100 0100 0010 */ - {illegal,0, 2, 8}, /* 43: 0100 1100 0100 0011 */ - {illegal,0, 2, 8}, /* 44: 0100 1100 0100 0100 */ - {illegal,0, 2, 8}, /* 45: 0100 1100 0100 0101 */ - {illegal,0, 2, 8}, /* 46: 0100 1100 0100 0110 */ - {illegal,0, 2, 8}, /* 47: 0100 1100 0100 0111 */ - {illegal,0, 2, 8}, /* 48: 0100 1100 0100 1000 */ - {illegal,0, 2, 8}, /* 49: 0100 1100 0100 1001 */ - {illegal,0, 2, 8}, /* 4a: 0100 1100 0100 1010 */ - {illegal,0, 2, 8}, /* 4b: 0100 1100 0100 1011 */ - {illegal,0, 2, 8}, /* 4c: 0100 1100 0100 1100 */ - {illegal,0, 2, 8}, /* 4d: 0100 1100 0100 1101 */ - {illegal,0, 2, 8}, /* 4e: 0100 1100 0100 1110 */ - {illegal,0, 2, 8}, /* 4f: 0100 1100 0100 1111 */ - - {illegal,0, 2, 8}, /* 50: 0100 1100 0101 0000 */ - {illegal,0, 2, 8}, /* 51: 0100 1100 0101 0001 */ - {illegal,0, 2, 8}, /* 52: 0100 1100 0101 0010 */ - {illegal,0, 2, 8}, /* 53: 0100 1100 0101 0011 */ - {illegal,0, 2, 8}, /* 54: 0100 1100 0101 0100 */ - {illegal,0, 2, 8}, /* 55: 0100 1100 0101 0101 */ - {illegal,0, 2, 8}, /* 56: 0100 1100 0101 0110 */ - {illegal,0, 2, 8}, /* 57: 0100 1100 0101 0111 */ - {illegal,0, 2, 8}, /* 58: 0100 1100 0101 1000 */ - {illegal,0, 2, 8}, /* 59: 0100 1100 0101 1001 */ - {illegal,0, 2, 8}, /* 5a: 0100 1100 0101 1010 */ - {illegal,0, 2, 8}, /* 5b: 0100 1100 0101 1011 */ - {illegal,0, 2, 8}, /* 5c: 0100 1100 0101 1100 */ - {illegal,0, 2, 8}, /* 5d: 0100 1100 0101 1101 */ - {illegal,0, 2, 8}, /* 5e: 0100 1100 0101 1110 */ - {illegal,0, 2, 8}, /* 5f: 0100 1100 0101 1111 */ - - {illegal,0, 2, 8}, /* 60: 0100 1100 0110 0000 */ - {illegal,0, 2, 8}, /* 61: 0100 1100 0110 0001 */ - {illegal,0, 2, 8}, /* 62: 0100 1100 0110 0010 */ - {illegal,0, 2, 8}, /* 63: 0100 1100 0110 0011 */ - {illegal,0, 2, 8}, /* 64: 0100 1100 0110 0100 */ - {illegal,0, 2, 8}, /* 65: 0100 1100 0110 0101 */ - {illegal,0, 2, 8}, /* 66: 0100 1100 0110 0110 */ - {illegal,0, 2, 8}, /* 67: 0100 1100 0110 0111 */ - {illegal,0, 2, 8}, /* 68: 0100 1100 0110 1000 */ - {illegal,0, 2, 8}, /* 69: 0100 1100 0110 1001 */ - {illegal,0, 2, 8}, /* 6a: 0100 1100 0110 1010 */ - {illegal,0, 2, 8}, /* 6b: 0100 1100 0110 1011 */ - {illegal,0, 2, 8}, /* 6c: 0100 1100 0110 1100 */ - {illegal,0, 2, 8}, /* 6d: 0100 1100 0110 1101 */ - {illegal,0, 2, 8}, /* 6e: 0100 1100 0110 1110 */ - {illegal,0, 2, 8}, /* 6f: 0100 1100 0110 1111 */ - - {illegal,0, 2, 8}, /* 70: 0100 1100 0111 0000 */ - {illegal,0, 2, 8}, /* 71: 0100 1100 0111 0001 */ - {illegal,0, 2, 8}, /* 72: 0100 1100 0111 0010 */ - {illegal,0, 2, 8}, /* 73: 0100 1100 0111 0011 */ - {illegal,0, 2, 8}, /* 74: 0100 1100 0111 0100 */ - {illegal,0, 2, 8}, /* 75: 0100 1100 0111 0101 */ - {illegal,0, 2, 8}, /* 76: 0100 1100 0111 0110 */ - {illegal,0, 2, 8}, /* 77: 0100 1100 0111 0111 */ - {illegal,0, 2, 8}, /* 78: 0100 1100 0111 1000 */ - {illegal,0, 2, 8}, /* 79: 0100 1100 0111 1001 */ - {illegal,0, 2, 8}, /* 7a: 0100 1100 0111 1010 */ - {illegal,0, 2, 8}, /* 7b: 0100 1100 0111 1011 */ - {illegal,0, 2, 8}, /* 7c: 0100 1100 0111 1100 */ - {illegal,0, 2, 8}, /* 7d: 0100 1100 0111 1101 */ - {illegal,0, 2, 8}, /* 7e: 0100 1100 0111 1110 */ - {illegal,0, 2, 8}, /* 7f: 0100 1100 0111 1111 */ - - {illegal,0, 2, 8}, /* 80: 0100 1100 1000 0000 */ - {illegal,0, 2, 8}, /* 81: 0100 1100 1000 0001 */ - {illegal,0, 2, 8}, /* 82: 0100 1100 1000 0010 */ - {illegal,0, 2, 8}, /* 83: 0100 1100 1000 0011 */ - {illegal,0, 2, 8}, /* 84: 0100 1100 1000 0100 */ - {illegal,0, 2, 8}, /* 85: 0100 1100 1000 0101 */ - {illegal,0, 2, 8}, /* 86: 0100 1100 1000 0110 */ - {illegal,0, 2, 8}, /* 87: 0100 1100 1000 0111 */ - {illegal,0, 2, 8}, /* 88: 0100 1100 1000 1000 */ - {illegal,0, 2, 8}, /* 89: 0100 1100 1000 1001 */ - {illegal,0, 2, 8}, /* 8a: 0100 1100 1000 1010 */ - {illegal,0, 2, 8}, /* 8b: 0100 1100 1000 1011 */ - {illegal,0, 2, 8}, /* 8c: 0100 1100 1000 1100 */ - {illegal,0, 2, 8}, /* 8d: 0100 1100 1000 1101 */ - {illegal,0, 2, 8}, /* 8e: 0100 1100 1000 1110 */ - {illegal,0, 2, 8}, /* 8f: 0100 1100 1000 1111 */ - - {illegal,0, 2, 8}, /* 90: 0100 1100 1001 0000 */ - {illegal,0, 2, 8}, /* 91: 0100 1100 1001 0001 */ - {illegal,0, 2, 8}, /* 92: 0100 1100 1001 0010 */ - {illegal,0, 2, 8}, /* 93: 0100 1100 1001 0011 */ - {illegal,0, 2, 8}, /* 94: 0100 1100 1001 0100 */ - {illegal,0, 2, 8}, /* 95: 0100 1100 1001 0101 */ - {illegal,0, 2, 8}, /* 96: 0100 1100 1001 0110 */ - {illegal,0, 2, 8}, /* 97: 0100 1100 1001 0111 */ - {illegal,0, 2, 8}, /* 98: 0100 1100 1001 1000 */ - {illegal,0, 2, 8}, /* 99: 0100 1100 1001 1001 */ - {illegal,0, 2, 8}, /* 9a: 0100 1100 1001 1010 */ - {illegal,0, 2, 8}, /* 9b: 0100 1100 1001 1011 */ - {illegal,0, 2, 8}, /* 9c: 0100 1100 1001 1100 */ - {illegal,0, 2, 8}, /* 9d: 0100 1100 1001 1101 */ - {illegal,0, 2, 8}, /* 9e: 0100 1100 1001 1110 */ - {illegal,0, 2, 8}, /* 9f: 0100 1100 1001 1111 */ - - {illegal,0, 2, 8}, /* a0: 0100 1100 1010 0000 */ - {illegal,0, 2, 8}, /* a1: 0100 1100 1010 0001 */ - {illegal,0, 2, 8}, /* a2: 0100 1100 1010 0010 */ - {illegal,0, 2, 8}, /* a3: 0100 1100 1010 0011 */ - {illegal,0, 2, 8}, /* a4: 0100 1100 1010 0100 */ - {illegal,0, 2, 8}, /* a5: 0100 1100 1010 0101 */ - {illegal,0, 2, 8}, /* a6: 0100 1100 1010 0110 */ - {illegal,0, 2, 8}, /* a7: 0100 1100 1010 0111 */ - {illegal,0, 2, 8}, /* a8: 0100 1100 1010 1000 */ - {illegal,0, 2, 8}, /* a9: 0100 1100 1010 1001 */ - {illegal,0, 2, 8}, /* aa: 0100 1100 1010 1010 */ - {illegal,0, 2, 8}, /* ab: 0100 1100 1010 1011 */ - {illegal,0, 2, 8}, /* ac: 0100 1100 1010 1100 */ - {illegal,0, 2, 8}, /* ad: 0100 1100 1010 1101 */ - {illegal,0, 2, 8}, /* ae: 0100 1100 1010 1110 */ - {illegal,0, 2, 8}, /* af: 0100 1100 1010 1111 */ - - {illegal,0, 2, 8}, /* b0: 0100 1100 1011 0000 */ - {illegal,0, 2, 8}, /* b1: 0100 1100 1011 0001 */ - {illegal,0, 2, 8}, /* b2: 0100 1100 1011 0010 */ - {illegal,0, 2, 8}, /* b3: 0100 1100 1011 0011 */ - {illegal,0, 2, 8}, /* b4: 0100 1100 1011 0100 */ - {illegal,0, 2, 8}, /* b5: 0100 1100 1011 0101 */ - {illegal,0, 2, 8}, /* b6: 0100 1100 1011 0110 */ - {illegal,0, 2, 8}, /* b7: 0100 1100 1011 0111 */ - {illegal,0, 2, 8}, /* b8: 0100 1100 1011 1000 */ - {illegal,0, 2, 8}, /* b9: 0100 1100 1011 1001 */ - {illegal,0, 2, 8}, /* ba: 0100 1100 1011 1010 */ - {illegal,0, 2, 8}, /* bb: 0100 1100 1011 1011 */ - {illegal,0, 2, 8}, /* bc: 0100 1100 1011 1100 */ - {illegal,0, 2, 8}, /* bd: 0100 1100 1011 1101 */ - {illegal,0, 2, 8}, /* be: 0100 1100 1011 1110 */ - {illegal,0, 2, 8}, /* bf: 0100 1100 1011 1111 */ - - {MOV,"A,PA", 2,10}, /* c0: 0100 1100 1100 0000 */ - {MOV,"A,PB", 2,10}, /* c1: 0100 1100 1100 0001 */ - {MOV,"A,PC", 2,10}, /* c2: 0100 1100 1100 0010 */ - {MOV,"A,PD", 2,10}, /* c3: 0100 1100 1100 0011 */ - {illegal,0, 2,10}, /* c4: 0100 1100 1100 0100 */ - {MOV,"A,PF", 2,10}, /* c5: 0100 1100 1100 0101 */ - {MOV,"A,MKH", 2,10}, /* c6: 0100 1100 1100 0110 */ - {MOV,"A,MKL", 2,10}, /* c7: 0100 1100 1100 0111 */ - {illegal,0, 2,10}, /* c8: 0100 1100 1100 1000 */ - {MOV,"A,SMH", 2,10}, /* c9: 0100 1100 1100 1001 */ - {illegal,0, 2,10}, /* ca: 0100 1100 1100 1010 */ - {MOV,"A,EOM", 2,10}, /* cb: 0100 1100 1100 1011 */ - {illegal,0, 2,10}, /* cc: 0100 1100 1100 1100 */ - {MOV,"A,TMM", 2,10}, /* cd: 0100 1100 1100 1101 */ - {MOV,"A,PT", 2,10}, /* ce: 0100 1100 1100 1110 */ /* 7807 */ - {illegal,0, 2,10}, /* cf: 0100 1100 1100 1111 */ - - {illegal,0, 2,10}, /* d0: 0100 1100 1101 0000 */ - {illegal,0, 2,10}, /* d1: 0100 1100 1101 0001 */ - {illegal,0, 2,10}, /* d2: 0100 1100 1101 0010 */ - {illegal,0, 2,10}, /* d3: 0100 1100 1101 0011 */ - {illegal,0, 2,10}, /* d4: 0100 1100 1101 0100 */ - {illegal,0, 2,10}, /* d5: 0100 1100 1101 0101 */ - {illegal,0, 2,10}, /* d6: 0100 1100 1101 0110 */ - {illegal,0, 2,10}, /* d7: 0100 1100 1101 0111 */ - {illegal,0, 2,10}, /* d8: 0100 1100 1101 1000 */ - {MOV,"A,RXB", 2,10}, /* d9: 0100 1100 1101 1001 */ - {illegal,0, 2,10}, /* da: 0100 1100 1101 1010 */ - {illegal,0, 2,10}, /* db: 0100 1100 1101 1011 */ - {illegal,0, 2,10}, /* dc: 0100 1100 1101 1100 */ - {illegal,0, 2,10}, /* dd: 0100 1100 1101 1101 */ - {illegal,0, 2,10}, /* de: 0100 1100 1101 1110 */ - {illegal,0, 2,10}, /* df: 0100 1100 1101 1111 */ - - {illegal,0, 2,10}, /* e0: 0100 1100 1110 0000 */ - {illegal,0, 2,10}, /* e1: 0100 1100 1110 0001 */ - {illegal,0, 2,10}, /* e2: 0100 1100 1110 0010 */ - {illegal,0, 2,10}, /* e3: 0100 1100 1110 0011 */ - {illegal,0, 2,10}, /* e4: 0100 1100 1110 0100 */ - {illegal,0, 2,10}, /* e5: 0100 1100 1110 0101 */ - {illegal,0, 2,10}, /* e6: 0100 1100 1110 0110 */ - {illegal,0, 2,10}, /* e7: 0100 1100 1110 0111 */ - {illegal,0, 2,10}, /* e8: 0100 1100 1110 1000 */ - {illegal,0, 2,10}, /* e9: 0100 1100 1110 1001 */ - {illegal,0, 2,10}, /* ea: 0100 1100 1110 1010 */ - {illegal,0, 2,10}, /* eb: 0100 1100 1110 1011 */ - {illegal,0, 2,10}, /* ec: 0100 1100 1110 1100 */ - {illegal,0, 2,10}, /* ed: 0100 1100 1110 1101 */ - {illegal,0, 2,10}, /* ee: 0100 1100 1110 1110 */ - {illegal,0, 2,10}, /* ef: 0100 1100 1110 1111 */ - - {illegal,0, 2,10}, /* f0: 0100 1100 1111 0000 */ - {illegal,0, 2,10}, /* f1: 0100 1100 1111 0001 */ - {illegal,0, 2,10}, /* f2: 0100 1100 1111 0010 */ - {illegal,0, 2,10}, /* f3: 0100 1100 1111 0011 */ - {illegal,0, 2,10}, /* f4: 0100 1100 1111 0100 */ - {illegal,0, 2,10}, /* f5: 0100 1100 1111 0101 */ - {illegal,0, 2,10}, /* f6: 0100 1100 1111 0110 */ - {illegal,0, 2,10}, /* f7: 0100 1100 1111 0111 */ - {illegal,0, 2,10}, /* f8: 0100 1100 1111 1000 */ - {illegal,0, 2,10}, /* f9: 0100 1100 1111 1001 */ - {illegal,0, 2,10}, /* fa: 0100 1100 1111 1010 */ - {illegal,0, 2,10}, /* fb: 0100 1100 1111 1011 */ - {illegal,0, 2,10}, /* fc: 0100 1100 1111 1100 */ - {illegal,0, 2,10}, /* fd: 0100 1100 1111 1101 */ - {illegal,0, 2,10}, /* fe: 0100 1100 1111 1110 */ - {illegal,0, 2,10} /* ff: 0100 1100 1111 1111 */ -}; - -/* prefix 4D */ -static struct dasm_s dasm4D_7810[256] = -{ - {illegal,0, 2, 8}, /* 00: 0100 1101 0000 0000 */ - {illegal,0, 2, 8}, /* 01: 0100 1101 0000 0001 */ - {illegal,0, 2, 8}, /* 02: 0100 1101 0000 0010 */ - {illegal,0, 2, 8}, /* 03: 0100 1101 0000 0011 */ - {illegal,0, 2, 8}, /* 04: 0100 1101 0000 0100 */ - {illegal,0, 2, 8}, /* 05: 0100 1101 0000 0101 */ - {illegal,0, 2, 8}, /* 06: 0100 1101 0000 0110 */ - {illegal,0, 2, 8}, /* 07: 0100 1101 0000 0111 */ - {illegal,0, 2, 8}, /* 08: 0100 1101 0000 1000 */ - {illegal,0, 2, 8}, /* 09: 0100 1101 0000 1001 */ - {illegal,0, 2, 8}, /* 0a: 0100 1101 0000 1010 */ - {illegal,0, 2, 8}, /* 0b: 0100 1101 0000 1011 */ - {illegal,0, 2, 8}, /* 0c: 0100 1101 0000 1100 */ - {illegal,0, 2, 8}, /* 0d: 0100 1101 0000 1101 */ - {illegal,0, 2, 8}, /* 0e: 0100 1101 0000 1110 */ - {illegal,0, 2, 8}, /* 0f: 0100 1101 0000 1111 */ - - {illegal,0, 2, 8}, /* 10: 0100 1101 0001 0000 */ - {illegal,0, 2, 8}, /* 11: 0100 1101 0001 0001 */ - {illegal,0, 2, 8}, /* 12: 0100 1101 0001 0010 */ - {illegal,0, 2, 8}, /* 13: 0100 1101 0001 0011 */ - {illegal,0, 2, 8}, /* 14: 0100 1101 0001 0100 */ - {illegal,0, 2, 8}, /* 15: 0100 1101 0001 0101 */ - {illegal,0, 2, 8}, /* 16: 0100 1101 0001 0110 */ - {illegal,0, 2, 8}, /* 17: 0100 1101 0001 0111 */ - {illegal,0, 2, 8}, /* 18: 0100 1101 0001 1000 */ - {illegal,0, 2, 8}, /* 19: 0100 1101 0001 1001 */ - {illegal,0, 2, 8}, /* 1a: 0100 1101 0001 1010 */ - {illegal,0, 2, 8}, /* 1b: 0100 1101 0001 1011 */ - {illegal,0, 2, 8}, /* 1c: 0100 1101 0001 1100 */ - {illegal,0, 2, 8}, /* 1d: 0100 1101 0001 1101 */ - {illegal,0, 2, 8}, /* 1e: 0100 1101 0001 1110 */ - {illegal,0, 2, 8}, /* 1f: 0100 1101 0001 1111 */ - - {illegal,0, 2, 8}, /* 20: 0100 1101 0010 0000 */ - {illegal,0, 2, 8}, /* 21: 0100 1101 0010 0001 */ - {illegal,0, 2, 8}, /* 22: 0100 1101 0010 0010 */ - {illegal,0, 2, 8}, /* 23: 0100 1101 0010 0011 */ - {illegal,0, 2, 8}, /* 24: 0100 1101 0010 0100 */ - {illegal,0, 2, 8}, /* 25: 0100 1101 0010 0101 */ - {illegal,0, 2, 8}, /* 26: 0100 1101 0010 0110 */ - {illegal,0, 2, 8}, /* 27: 0100 1101 0010 0111 */ - {illegal,0, 2, 8}, /* 28: 0100 1101 0010 1000 */ - {illegal,0, 2, 8}, /* 29: 0100 1101 0010 1001 */ - {illegal,0, 2, 8}, /* 2a: 0100 1101 0010 1010 */ - {illegal,0, 2, 8}, /* 2b: 0100 1101 0010 1011 */ - {illegal,0, 2, 8}, /* 2c: 0100 1101 0010 1100 */ - {illegal,0, 2, 8}, /* 2d: 0100 1101 0010 1101 */ - {illegal,0, 2, 8}, /* 2e: 0100 1101 0010 1110 */ - {illegal,0, 2, 8}, /* 2f: 0100 1101 0010 1111 */ - - {illegal,0, 2, 8}, /* 30: 0100 1101 0011 0000 */ - {illegal,0, 2, 8}, /* 31: 0100 1101 0011 0001 */ - {illegal,0, 2, 8}, /* 32: 0100 1101 0011 0010 */ - {illegal,0, 2, 8}, /* 33: 0100 1101 0011 0011 */ - {illegal,0, 2, 8}, /* 34: 0100 1101 0011 0100 */ - {illegal,0, 2, 8}, /* 35: 0100 1101 0011 0101 */ - {illegal,0, 2, 8}, /* 36: 0100 1101 0011 0110 */ - {illegal,0, 2, 8}, /* 37: 0100 1101 0011 0111 */ - {illegal,0, 2, 8}, /* 38: 0100 1101 0011 1000 */ - {illegal,0, 2, 8}, /* 39: 0100 1101 0011 1001 */ - {illegal,0, 2, 8}, /* 3a: 0100 1101 0011 1010 */ - {illegal,0, 2, 8}, /* 3b: 0100 1101 0011 1011 */ - {illegal,0, 2, 8}, /* 3c: 0100 1101 0011 1100 */ - {illegal,0, 2, 8}, /* 3d: 0100 1101 0011 1101 */ - {illegal,0, 2, 8}, /* 3e: 0100 1101 0011 1110 */ - {illegal,0, 2, 8}, /* 3f: 0100 1101 0011 1111 */ - - {illegal,0, 2, 8}, /* 40: 0100 1101 0100 0000 */ - {illegal,0, 2, 8}, /* 41: 0100 1101 0100 0001 */ - {illegal,0, 2, 8}, /* 42: 0100 1101 0100 0010 */ - {illegal,0, 2, 8}, /* 43: 0100 1101 0100 0011 */ - {illegal,0, 2, 8}, /* 44: 0100 1101 0100 0100 */ - {illegal,0, 2, 8}, /* 45: 0100 1101 0100 0101 */ - {illegal,0, 2, 8}, /* 46: 0100 1101 0100 0110 */ - {illegal,0, 2, 8}, /* 47: 0100 1101 0100 0111 */ - {illegal,0, 2, 8}, /* 48: 0100 1101 0100 1000 */ - {illegal,0, 2, 8}, /* 49: 0100 1101 0100 1001 */ - {illegal,0, 2, 8}, /* 4a: 0100 1101 0100 1010 */ - {illegal,0, 2, 8}, /* 4b: 0100 1101 0100 1011 */ - {illegal,0, 2, 8}, /* 4c: 0100 1101 0100 1100 */ - {illegal,0, 2, 8}, /* 4d: 0100 1101 0100 1101 */ - {illegal,0, 2, 8}, /* 4e: 0100 1101 0100 1110 */ - {illegal,0, 2, 8}, /* 4f: 0100 1101 0100 1111 */ - - {illegal,0, 2, 8}, /* 50: 0100 1101 0101 0000 */ - {illegal,0, 2, 8}, /* 51: 0100 1101 0101 0001 */ - {illegal,0, 2, 8}, /* 52: 0100 1101 0101 0010 */ - {illegal,0, 2, 8}, /* 53: 0100 1101 0101 0011 */ - {illegal,0, 2, 8}, /* 54: 0100 1101 0101 0100 */ - {illegal,0, 2, 8}, /* 55: 0100 1101 0101 0101 */ - {illegal,0, 2, 8}, /* 56: 0100 1101 0101 0110 */ - {illegal,0, 2, 8}, /* 57: 0100 1101 0101 0111 */ - {illegal,0, 2, 8}, /* 58: 0100 1101 0101 1000 */ - {illegal,0, 2, 8}, /* 59: 0100 1101 0101 1001 */ - {illegal,0, 2, 8}, /* 5a: 0100 1101 0101 1010 */ - {illegal,0, 2, 8}, /* 5b: 0100 1101 0101 1011 */ - {illegal,0, 2, 8}, /* 5c: 0100 1101 0101 1100 */ - {illegal,0, 2, 8}, /* 5d: 0100 1101 0101 1101 */ - {illegal,0, 2, 8}, /* 5e: 0100 1101 0101 1110 */ - {illegal,0, 2, 8}, /* 5f: 0100 1101 0101 1111 */ - - {illegal,0, 2, 8}, /* 60: 0100 1101 0110 0000 */ - {illegal,0, 2, 8}, /* 61: 0100 1101 0110 0001 */ - {illegal,0, 2, 8}, /* 62: 0100 1101 0110 0010 */ - {illegal,0, 2, 8}, /* 63: 0100 1101 0110 0011 */ - {illegal,0, 2, 8}, /* 64: 0100 1101 0110 0100 */ - {illegal,0, 2, 8}, /* 65: 0100 1101 0110 0101 */ - {illegal,0, 2, 8}, /* 66: 0100 1101 0110 0110 */ - {illegal,0, 2, 8}, /* 67: 0100 1101 0110 0111 */ - {illegal,0, 2, 8}, /* 68: 0100 1101 0110 1000 */ - {illegal,0, 2, 8}, /* 69: 0100 1101 0110 1001 */ - {illegal,0, 2, 8}, /* 6a: 0100 1101 0110 1010 */ - {illegal,0, 2, 8}, /* 6b: 0100 1101 0110 1011 */ - {illegal,0, 2, 8}, /* 6c: 0100 1101 0110 1100 */ - {illegal,0, 2, 8}, /* 6d: 0100 1101 0110 1101 */ - {illegal,0, 2, 8}, /* 6e: 0100 1101 0110 1110 */ - {illegal,0, 2, 8}, /* 6f: 0100 1101 0110 1111 */ - - {illegal,0, 2, 8}, /* 70: 0100 1101 0111 0000 */ - {illegal,0, 2, 8}, /* 71: 0100 1101 0111 0001 */ - {illegal,0, 2, 8}, /* 72: 0100 1101 0111 0010 */ - {illegal,0, 2, 8}, /* 73: 0100 1101 0111 0011 */ - {illegal,0, 2, 8}, /* 74: 0100 1101 0111 0100 */ - {illegal,0, 2, 8}, /* 75: 0100 1101 0111 0101 */ - {illegal,0, 2, 8}, /* 76: 0100 1101 0111 0110 */ - {illegal,0, 2, 8}, /* 77: 0100 1101 0111 0111 */ - {illegal,0, 2, 8}, /* 78: 0100 1101 0111 1000 */ - {illegal,0, 2, 8}, /* 79: 0100 1101 0111 1001 */ - {illegal,0, 2, 8}, /* 7a: 0100 1101 0111 1010 */ - {illegal,0, 2, 8}, /* 7b: 0100 1101 0111 1011 */ - {illegal,0, 2, 8}, /* 7c: 0100 1101 0111 1100 */ - {illegal,0, 2, 8}, /* 7d: 0100 1101 0111 1101 */ - {illegal,0, 2, 8}, /* 7e: 0100 1101 0111 1110 */ - {illegal,0, 2, 8}, /* 7f: 0100 1101 0111 1111 */ - - {illegal,0, 2, 8}, /* 80: 0100 1101 1000 0000 */ - {illegal,0, 2, 8}, /* 81: 0100 1101 1000 0001 */ - {illegal,0, 2, 8}, /* 82: 0100 1101 1000 0010 */ - {illegal,0, 2, 8}, /* 83: 0100 1101 1000 0011 */ - {illegal,0, 2, 8}, /* 84: 0100 1101 1000 0100 */ - {illegal,0, 2, 8}, /* 85: 0100 1101 1000 0101 */ - {illegal,0, 2, 8}, /* 86: 0100 1101 1000 0110 */ - {illegal,0, 2, 8}, /* 87: 0100 1101 1000 0111 */ - {illegal,0, 2, 8}, /* 88: 0100 1101 1000 1000 */ - {illegal,0, 2, 8}, /* 89: 0100 1101 1000 1001 */ - {illegal,0, 2, 8}, /* 8a: 0100 1101 1000 1010 */ - {illegal,0, 2, 8}, /* 8b: 0100 1101 1000 1011 */ - {illegal,0, 2, 8}, /* 8c: 0100 1101 1000 1100 */ - {illegal,0, 2, 8}, /* 8d: 0100 1101 1000 1101 */ - {illegal,0, 2, 8}, /* 8e: 0100 1101 1000 1110 */ - {illegal,0, 2, 8}, /* 8f: 0100 1101 1000 1111 */ - - {illegal,0, 2, 8}, /* 90: 0100 1101 1001 0000 */ - {illegal,0, 2, 8}, /* 91: 0100 1101 1001 0001 */ - {illegal,0, 2, 8}, /* 92: 0100 1101 1001 0010 */ - {illegal,0, 2, 8}, /* 93: 0100 1101 1001 0011 */ - {illegal,0, 2, 8}, /* 94: 0100 1101 1001 0100 */ - {illegal,0, 2, 8}, /* 95: 0100 1101 1001 0101 */ - {illegal,0, 2, 8}, /* 96: 0100 1101 1001 0110 */ - {illegal,0, 2, 8}, /* 97: 0100 1101 1001 0111 */ - {illegal,0, 2, 8}, /* 98: 0100 1101 1001 1000 */ - {illegal,0, 2, 8}, /* 99: 0100 1101 1001 1001 */ - {illegal,0, 2, 8}, /* 9a: 0100 1101 1001 1010 */ - {illegal,0, 2, 8}, /* 9b: 0100 1101 1001 1011 */ - {illegal,0, 2, 8}, /* 9c: 0100 1101 1001 1100 */ - {illegal,0, 2, 8}, /* 9d: 0100 1101 1001 1101 */ - {illegal,0, 2, 8}, /* 9e: 0100 1101 1001 1110 */ - {illegal,0, 2, 8}, /* 9f: 0100 1101 1001 1111 */ - - {illegal,0, 2, 8}, /* a0: 0100 1101 1010 0000 */ - {illegal,0, 2, 8}, /* a1: 0100 1101 1010 0001 */ - {illegal,0, 2, 8}, /* a2: 0100 1101 1010 0010 */ - {illegal,0, 2, 8}, /* a3: 0100 1101 1010 0011 */ - {illegal,0, 2, 8}, /* a4: 0100 1101 1010 0100 */ - {illegal,0, 2, 8}, /* a5: 0100 1101 1010 0101 */ - {illegal,0, 2, 8}, /* a6: 0100 1101 1010 0110 */ - {illegal,0, 2, 8}, /* a7: 0100 1101 1010 0111 */ - {illegal,0, 2, 8}, /* a8: 0100 1101 1010 1000 */ - {illegal,0, 2, 8}, /* a9: 0100 1101 1010 1001 */ - {illegal,0, 2, 8}, /* aa: 0100 1101 1010 1010 */ - {illegal,0, 2, 8}, /* ab: 0100 1101 1010 1011 */ - {illegal,0, 2, 8}, /* ac: 0100 1101 1010 1100 */ - {illegal,0, 2, 8}, /* ad: 0100 1101 1010 1101 */ - {illegal,0, 2, 8}, /* ae: 0100 1101 1010 1110 */ - {illegal,0, 2, 8}, /* af: 0100 1101 1010 1111 */ - - {illegal,0, 2, 8}, /* b0: 0100 1101 1011 0000 */ - {illegal,0, 2, 8}, /* b1: 0100 1101 1011 0001 */ - {illegal,0, 2, 8}, /* b2: 0100 1101 1011 0010 */ - {illegal,0, 2, 8}, /* b3: 0100 1101 1011 0011 */ - {illegal,0, 2, 8}, /* b4: 0100 1101 1011 0100 */ - {illegal,0, 2, 8}, /* b5: 0100 1101 1011 0101 */ - {illegal,0, 2, 8}, /* b6: 0100 1101 1011 0110 */ - {illegal,0, 2, 8}, /* b7: 0100 1101 1011 0111 */ - {illegal,0, 2, 8}, /* b8: 0100 1101 1011 1000 */ - {illegal,0, 2, 8}, /* b9: 0100 1101 1011 1001 */ - {illegal,0, 2, 8}, /* ba: 0100 1101 1011 1010 */ - {illegal,0, 2, 8}, /* bb: 0100 1101 1011 1011 */ - {illegal,0, 2, 8}, /* bc: 0100 1101 1011 1100 */ - {illegal,0, 2, 8}, /* bd: 0100 1101 1011 1101 */ - {illegal,0, 2, 8}, /* be: 0100 1101 1011 1110 */ - {illegal,0, 2, 8}, /* bf: 0100 1101 1011 1111 */ - - {MOV,"PA,A", 2,10}, /* c0: 0100 1101 1100 0000 */ - {MOV,"PB,A", 2,10}, /* c1: 0100 1101 1100 0001 */ - {MOV,"PC,A", 2,10}, /* c2: 0100 1101 1100 0010 */ - {MOV,"PD,A", 2,10}, /* c3: 0100 1101 1100 0011 */ - {illegal,0, 2,10}, /* c4: 0100 1101 1100 0100 */ - {MOV,"PF,A", 2,10}, /* c5: 0100 1101 1100 0101 */ - {MOV,"MKH,A", 2,10}, /* c6: 0100 1101 1100 0110 */ - {MOV,"MKL,A", 2,10}, /* c7: 0100 1101 1100 0111 */ - {MOV,"ANM,A", 2,10}, /* c8: 0100 1101 1100 1000 */ /* 7810 */ - {MOV,"SMH,A", 2,10}, /* c9: 0100 1101 1100 1001 */ - {MOV,"SML,A", 2,10}, /* ca: 0100 1101 1100 1010 */ - {MOV,"EOM,A", 2,10}, /* cb: 0100 1101 1100 1011 */ - {MOV,"ETMM,A", 2,10}, /* cc: 0100 1101 1100 1100 */ - {MOV,"TMM,A", 2,10}, /* cd: 0100 1101 1100 1101 */ - {illegal,0, 2,10}, /* ce: 0100 1101 1100 1110 */ - {illegal,0, 2,10}, /* cf: 0100 1101 1100 1111 */ - - {MOV,"MM,A", 2,10}, /* d0: 0100 1101 1101 0000 */ - {MOV,"MCC,A", 2,10}, /* d1: 0100 1101 1101 0001 */ - {MOV,"MA,A", 2,10}, /* d2: 0100 1101 1101 0010 */ - {MOV,"MB,A", 2,10}, /* d3: 0100 1101 1101 0011 */ - {MOV,"MC,A", 2,10}, /* d4: 0100 1101 1101 0100 */ - {illegal,0, 2,10}, /* d5: 0100 1101 1101 0101 */ - {illegal,0, 2,10}, /* d6: 0100 1101 1101 0110 */ - {MOV,"MF,A", 2,10}, /* d7: 0100 1101 1101 0111 */ - {MOV,"TXB,A", 2,10}, /* d8: 0100 1101 1101 1000 */ - {illegal,0, 2,10}, /* d9: 0100 1101 1101 1001 */ - {MOV,"TM0,A", 2,10}, /* da: 0100 1101 1101 1010 */ - {MOV,"TM1,A", 2,10}, /* db: 0100 1101 1101 1011 */ - {illegal,0, 2,10}, /* dc: 0100 1101 1101 1100 */ - {illegal,0, 2,10}, /* dd: 0100 1101 1101 1101 */ - {illegal,0, 2,10}, /* de: 0100 1101 1101 1110 */ - {illegal,0, 2,10}, /* df: 0100 1101 1101 1111 */ - - {illegal,0, 2,10}, /* e0: 0100 1101 1110 0000 */ - {illegal,0, 2,10}, /* e1: 0100 1101 1110 0001 */ - {illegal,0, 2,10}, /* e2: 0100 1101 1110 0010 */ - {illegal,0, 2,10}, /* e3: 0100 1101 1110 0011 */ - {illegal,0, 2,10}, /* e4: 0100 1101 1110 0100 */ - {illegal,0, 2,10}, /* e5: 0100 1101 1110 0101 */ - {illegal,0, 2,10}, /* e6: 0100 1101 1110 0110 */ - {illegal,0, 2,10}, /* e7: 0100 1101 1110 0111 */ - {MOV,"ZCM,A", 2,10}, /* e8: 0100 1101 1110 1000 */ /* 7810 */ - {illegal,0, 2,10}, /* e9: 0100 1101 1110 1001 */ - {illegal,0, 2,10}, /* ea: 0100 1101 1110 1010 */ - {illegal,0, 2,10}, /* eb: 0100 1101 1110 1011 */ - {illegal,0, 2,10}, /* ec: 0100 1101 1110 1100 */ - {illegal,0, 2,10}, /* ed: 0100 1101 1110 1101 */ - {illegal,0, 2,10}, /* ee: 0100 1101 1110 1110 */ - {illegal,0, 2,10}, /* ef: 0100 1101 1110 1111 */ - - {illegal,0, 2,10}, /* f0: 0100 1101 1111 0000 */ - {illegal,0, 2,10}, /* f1: 0100 1101 1111 0001 */ - {illegal,0, 2,10}, /* f2: 0100 1101 1111 0010 */ - {illegal,0, 2,10}, /* f3: 0100 1101 1111 0011 */ - {illegal,0, 2,10}, /* f4: 0100 1101 1111 0100 */ - {illegal,0, 2,10}, /* f5: 0100 1101 1111 0101 */ - {illegal,0, 2,10}, /* f6: 0100 1101 1111 0110 */ - {illegal,0, 2,10}, /* f7: 0100 1101 1111 0111 */ - {illegal,0, 2,10}, /* f8: 0100 1101 1111 1000 */ - {illegal,0, 2,10}, /* f9: 0100 1101 1111 1001 */ - {illegal,0, 2,10}, /* fa: 0100 1101 1111 1010 */ - {illegal,0, 2,10}, /* fb: 0100 1101 1111 1011 */ - {illegal,0, 2,10}, /* fc: 0100 1101 1111 1100 */ - {illegal,0, 2,10}, /* fd: 0100 1101 1111 1101 */ - {illegal,0, 2,10}, /* fe: 0100 1101 1111 1110 */ - {illegal,0, 2,10} /* ff: 0100 1101 1111 1111 */ -}; - -static struct dasm_s dasm4D_7807[256] = -{ - {illegal,0, 2, 8}, /* 00: 0100 1101 0000 0000 */ - {illegal,0, 2, 8}, /* 01: 0100 1101 0000 0001 */ - {illegal,0, 2, 8}, /* 02: 0100 1101 0000 0010 */ - {illegal,0, 2, 8}, /* 03: 0100 1101 0000 0011 */ - {illegal,0, 2, 8}, /* 04: 0100 1101 0000 0100 */ - {illegal,0, 2, 8}, /* 05: 0100 1101 0000 0101 */ - {illegal,0, 2, 8}, /* 06: 0100 1101 0000 0110 */ - {illegal,0, 2, 8}, /* 07: 0100 1101 0000 0111 */ - {illegal,0, 2, 8}, /* 08: 0100 1101 0000 1000 */ - {illegal,0, 2, 8}, /* 09: 0100 1101 0000 1001 */ - {illegal,0, 2, 8}, /* 0a: 0100 1101 0000 1010 */ - {illegal,0, 2, 8}, /* 0b: 0100 1101 0000 1011 */ - {illegal,0, 2, 8}, /* 0c: 0100 1101 0000 1100 */ - {illegal,0, 2, 8}, /* 0d: 0100 1101 0000 1101 */ - {illegal,0, 2, 8}, /* 0e: 0100 1101 0000 1110 */ - {illegal,0, 2, 8}, /* 0f: 0100 1101 0000 1111 */ - - {illegal,0, 2, 8}, /* 10: 0100 1101 0001 0000 */ - {illegal,0, 2, 8}, /* 11: 0100 1101 0001 0001 */ - {illegal,0, 2, 8}, /* 12: 0100 1101 0001 0010 */ - {illegal,0, 2, 8}, /* 13: 0100 1101 0001 0011 */ - {illegal,0, 2, 8}, /* 14: 0100 1101 0001 0100 */ - {illegal,0, 2, 8}, /* 15: 0100 1101 0001 0101 */ - {illegal,0, 2, 8}, /* 16: 0100 1101 0001 0110 */ - {illegal,0, 2, 8}, /* 17: 0100 1101 0001 0111 */ - {illegal,0, 2, 8}, /* 18: 0100 1101 0001 1000 */ - {illegal,0, 2, 8}, /* 19: 0100 1101 0001 1001 */ - {illegal,0, 2, 8}, /* 1a: 0100 1101 0001 1010 */ - {illegal,0, 2, 8}, /* 1b: 0100 1101 0001 1011 */ - {illegal,0, 2, 8}, /* 1c: 0100 1101 0001 1100 */ - {illegal,0, 2, 8}, /* 1d: 0100 1101 0001 1101 */ - {illegal,0, 2, 8}, /* 1e: 0100 1101 0001 1110 */ - {illegal,0, 2, 8}, /* 1f: 0100 1101 0001 1111 */ - - {illegal,0, 2, 8}, /* 20: 0100 1101 0010 0000 */ - {illegal,0, 2, 8}, /* 21: 0100 1101 0010 0001 */ - {illegal,0, 2, 8}, /* 22: 0100 1101 0010 0010 */ - {illegal,0, 2, 8}, /* 23: 0100 1101 0010 0011 */ - {illegal,0, 2, 8}, /* 24: 0100 1101 0010 0100 */ - {illegal,0, 2, 8}, /* 25: 0100 1101 0010 0101 */ - {illegal,0, 2, 8}, /* 26: 0100 1101 0010 0110 */ - {illegal,0, 2, 8}, /* 27: 0100 1101 0010 0111 */ - {illegal,0, 2, 8}, /* 28: 0100 1101 0010 1000 */ - {illegal,0, 2, 8}, /* 29: 0100 1101 0010 1001 */ - {illegal,0, 2, 8}, /* 2a: 0100 1101 0010 1010 */ - {illegal,0, 2, 8}, /* 2b: 0100 1101 0010 1011 */ - {illegal,0, 2, 8}, /* 2c: 0100 1101 0010 1100 */ - {illegal,0, 2, 8}, /* 2d: 0100 1101 0010 1101 */ - {illegal,0, 2, 8}, /* 2e: 0100 1101 0010 1110 */ - {illegal,0, 2, 8}, /* 2f: 0100 1101 0010 1111 */ - - {illegal,0, 2, 8}, /* 30: 0100 1101 0011 0000 */ - {illegal,0, 2, 8}, /* 31: 0100 1101 0011 0001 */ - {illegal,0, 2, 8}, /* 32: 0100 1101 0011 0010 */ - {illegal,0, 2, 8}, /* 33: 0100 1101 0011 0011 */ - {illegal,0, 2, 8}, /* 34: 0100 1101 0011 0100 */ - {illegal,0, 2, 8}, /* 35: 0100 1101 0011 0101 */ - {illegal,0, 2, 8}, /* 36: 0100 1101 0011 0110 */ - {illegal,0, 2, 8}, /* 37: 0100 1101 0011 0111 */ - {illegal,0, 2, 8}, /* 38: 0100 1101 0011 1000 */ - {illegal,0, 2, 8}, /* 39: 0100 1101 0011 1001 */ - {illegal,0, 2, 8}, /* 3a: 0100 1101 0011 1010 */ - {illegal,0, 2, 8}, /* 3b: 0100 1101 0011 1011 */ - {illegal,0, 2, 8}, /* 3c: 0100 1101 0011 1100 */ - {illegal,0, 2, 8}, /* 3d: 0100 1101 0011 1101 */ - {illegal,0, 2, 8}, /* 3e: 0100 1101 0011 1110 */ - {illegal,0, 2, 8}, /* 3f: 0100 1101 0011 1111 */ - - {illegal,0, 2, 8}, /* 40: 0100 1101 0100 0000 */ - {illegal,0, 2, 8}, /* 41: 0100 1101 0100 0001 */ - {illegal,0, 2, 8}, /* 42: 0100 1101 0100 0010 */ - {illegal,0, 2, 8}, /* 43: 0100 1101 0100 0011 */ - {illegal,0, 2, 8}, /* 44: 0100 1101 0100 0100 */ - {illegal,0, 2, 8}, /* 45: 0100 1101 0100 0101 */ - {illegal,0, 2, 8}, /* 46: 0100 1101 0100 0110 */ - {illegal,0, 2, 8}, /* 47: 0100 1101 0100 0111 */ - {illegal,0, 2, 8}, /* 48: 0100 1101 0100 1000 */ - {illegal,0, 2, 8}, /* 49: 0100 1101 0100 1001 */ - {illegal,0, 2, 8}, /* 4a: 0100 1101 0100 1010 */ - {illegal,0, 2, 8}, /* 4b: 0100 1101 0100 1011 */ - {illegal,0, 2, 8}, /* 4c: 0100 1101 0100 1100 */ - {illegal,0, 2, 8}, /* 4d: 0100 1101 0100 1101 */ - {illegal,0, 2, 8}, /* 4e: 0100 1101 0100 1110 */ - {illegal,0, 2, 8}, /* 4f: 0100 1101 0100 1111 */ - - {illegal,0, 2, 8}, /* 50: 0100 1101 0101 0000 */ - {illegal,0, 2, 8}, /* 51: 0100 1101 0101 0001 */ - {illegal,0, 2, 8}, /* 52: 0100 1101 0101 0010 */ - {illegal,0, 2, 8}, /* 53: 0100 1101 0101 0011 */ - {illegal,0, 2, 8}, /* 54: 0100 1101 0101 0100 */ - {illegal,0, 2, 8}, /* 55: 0100 1101 0101 0101 */ - {illegal,0, 2, 8}, /* 56: 0100 1101 0101 0110 */ - {illegal,0, 2, 8}, /* 57: 0100 1101 0101 0111 */ - {illegal,0, 2, 8}, /* 58: 0100 1101 0101 1000 */ - {illegal,0, 2, 8}, /* 59: 0100 1101 0101 1001 */ - {illegal,0, 2, 8}, /* 5a: 0100 1101 0101 1010 */ - {illegal,0, 2, 8}, /* 5b: 0100 1101 0101 1011 */ - {illegal,0, 2, 8}, /* 5c: 0100 1101 0101 1100 */ - {illegal,0, 2, 8}, /* 5d: 0100 1101 0101 1101 */ - {illegal,0, 2, 8}, /* 5e: 0100 1101 0101 1110 */ - {illegal,0, 2, 8}, /* 5f: 0100 1101 0101 1111 */ - - {illegal,0, 2, 8}, /* 60: 0100 1101 0110 0000 */ - {illegal,0, 2, 8}, /* 61: 0100 1101 0110 0001 */ - {illegal,0, 2, 8}, /* 62: 0100 1101 0110 0010 */ - {illegal,0, 2, 8}, /* 63: 0100 1101 0110 0011 */ - {illegal,0, 2, 8}, /* 64: 0100 1101 0110 0100 */ - {illegal,0, 2, 8}, /* 65: 0100 1101 0110 0101 */ - {illegal,0, 2, 8}, /* 66: 0100 1101 0110 0110 */ - {illegal,0, 2, 8}, /* 67: 0100 1101 0110 0111 */ - {illegal,0, 2, 8}, /* 68: 0100 1101 0110 1000 */ - {illegal,0, 2, 8}, /* 69: 0100 1101 0110 1001 */ - {illegal,0, 2, 8}, /* 6a: 0100 1101 0110 1010 */ - {illegal,0, 2, 8}, /* 6b: 0100 1101 0110 1011 */ - {illegal,0, 2, 8}, /* 6c: 0100 1101 0110 1100 */ - {illegal,0, 2, 8}, /* 6d: 0100 1101 0110 1101 */ - {illegal,0, 2, 8}, /* 6e: 0100 1101 0110 1110 */ - {illegal,0, 2, 8}, /* 6f: 0100 1101 0110 1111 */ - - {illegal,0, 2, 8}, /* 70: 0100 1101 0111 0000 */ - {illegal,0, 2, 8}, /* 71: 0100 1101 0111 0001 */ - {illegal,0, 2, 8}, /* 72: 0100 1101 0111 0010 */ - {illegal,0, 2, 8}, /* 73: 0100 1101 0111 0011 */ - {illegal,0, 2, 8}, /* 74: 0100 1101 0111 0100 */ - {illegal,0, 2, 8}, /* 75: 0100 1101 0111 0101 */ - {illegal,0, 2, 8}, /* 76: 0100 1101 0111 0110 */ - {illegal,0, 2, 8}, /* 77: 0100 1101 0111 0111 */ - {illegal,0, 2, 8}, /* 78: 0100 1101 0111 1000 */ - {illegal,0, 2, 8}, /* 79: 0100 1101 0111 1001 */ - {illegal,0, 2, 8}, /* 7a: 0100 1101 0111 1010 */ - {illegal,0, 2, 8}, /* 7b: 0100 1101 0111 1011 */ - {illegal,0, 2, 8}, /* 7c: 0100 1101 0111 1100 */ - {illegal,0, 2, 8}, /* 7d: 0100 1101 0111 1101 */ - {illegal,0, 2, 8}, /* 7e: 0100 1101 0111 1110 */ - {illegal,0, 2, 8}, /* 7f: 0100 1101 0111 1111 */ - - {illegal,0, 2, 8}, /* 80: 0100 1101 1000 0000 */ - {illegal,0, 2, 8}, /* 81: 0100 1101 1000 0001 */ - {illegal,0, 2, 8}, /* 82: 0100 1101 1000 0010 */ - {illegal,0, 2, 8}, /* 83: 0100 1101 1000 0011 */ - {illegal,0, 2, 8}, /* 84: 0100 1101 1000 0100 */ - {illegal,0, 2, 8}, /* 85: 0100 1101 1000 0101 */ - {illegal,0, 2, 8}, /* 86: 0100 1101 1000 0110 */ - {illegal,0, 2, 8}, /* 87: 0100 1101 1000 0111 */ - {illegal,0, 2, 8}, /* 88: 0100 1101 1000 1000 */ - {illegal,0, 2, 8}, /* 89: 0100 1101 1000 1001 */ - {illegal,0, 2, 8}, /* 8a: 0100 1101 1000 1010 */ - {illegal,0, 2, 8}, /* 8b: 0100 1101 1000 1011 */ - {illegal,0, 2, 8}, /* 8c: 0100 1101 1000 1100 */ - {illegal,0, 2, 8}, /* 8d: 0100 1101 1000 1101 */ - {illegal,0, 2, 8}, /* 8e: 0100 1101 1000 1110 */ - {illegal,0, 2, 8}, /* 8f: 0100 1101 1000 1111 */ - - {illegal,0, 2, 8}, /* 90: 0100 1101 1001 0000 */ - {illegal,0, 2, 8}, /* 91: 0100 1101 1001 0001 */ - {illegal,0, 2, 8}, /* 92: 0100 1101 1001 0010 */ - {illegal,0, 2, 8}, /* 93: 0100 1101 1001 0011 */ - {illegal,0, 2, 8}, /* 94: 0100 1101 1001 0100 */ - {illegal,0, 2, 8}, /* 95: 0100 1101 1001 0101 */ - {illegal,0, 2, 8}, /* 96: 0100 1101 1001 0110 */ - {illegal,0, 2, 8}, /* 97: 0100 1101 1001 0111 */ - {illegal,0, 2, 8}, /* 98: 0100 1101 1001 1000 */ - {illegal,0, 2, 8}, /* 99: 0100 1101 1001 1001 */ - {illegal,0, 2, 8}, /* 9a: 0100 1101 1001 1010 */ - {illegal,0, 2, 8}, /* 9b: 0100 1101 1001 1011 */ - {illegal,0, 2, 8}, /* 9c: 0100 1101 1001 1100 */ - {illegal,0, 2, 8}, /* 9d: 0100 1101 1001 1101 */ - {illegal,0, 2, 8}, /* 9e: 0100 1101 1001 1110 */ - {illegal,0, 2, 8}, /* 9f: 0100 1101 1001 1111 */ - - {illegal,0, 2, 8}, /* a0: 0100 1101 1010 0000 */ - {illegal,0, 2, 8}, /* a1: 0100 1101 1010 0001 */ - {illegal,0, 2, 8}, /* a2: 0100 1101 1010 0010 */ - {illegal,0, 2, 8}, /* a3: 0100 1101 1010 0011 */ - {illegal,0, 2, 8}, /* a4: 0100 1101 1010 0100 */ - {illegal,0, 2, 8}, /* a5: 0100 1101 1010 0101 */ - {illegal,0, 2, 8}, /* a6: 0100 1101 1010 0110 */ - {illegal,0, 2, 8}, /* a7: 0100 1101 1010 0111 */ - {illegal,0, 2, 8}, /* a8: 0100 1101 1010 1000 */ - {illegal,0, 2, 8}, /* a9: 0100 1101 1010 1001 */ - {illegal,0, 2, 8}, /* aa: 0100 1101 1010 1010 */ - {illegal,0, 2, 8}, /* ab: 0100 1101 1010 1011 */ - {illegal,0, 2, 8}, /* ac: 0100 1101 1010 1100 */ - {illegal,0, 2, 8}, /* ad: 0100 1101 1010 1101 */ - {illegal,0, 2, 8}, /* ae: 0100 1101 1010 1110 */ - {illegal,0, 2, 8}, /* af: 0100 1101 1010 1111 */ - - {illegal,0, 2, 8}, /* b0: 0100 1101 1011 0000 */ - {illegal,0, 2, 8}, /* b1: 0100 1101 1011 0001 */ - {illegal,0, 2, 8}, /* b2: 0100 1101 1011 0010 */ - {illegal,0, 2, 8}, /* b3: 0100 1101 1011 0011 */ - {illegal,0, 2, 8}, /* b4: 0100 1101 1011 0100 */ - {illegal,0, 2, 8}, /* b5: 0100 1101 1011 0101 */ - {illegal,0, 2, 8}, /* b6: 0100 1101 1011 0110 */ - {illegal,0, 2, 8}, /* b7: 0100 1101 1011 0111 */ - {illegal,0, 2, 8}, /* b8: 0100 1101 1011 1000 */ - {illegal,0, 2, 8}, /* b9: 0100 1101 1011 1001 */ - {illegal,0, 2, 8}, /* ba: 0100 1101 1011 1010 */ - {illegal,0, 2, 8}, /* bb: 0100 1101 1011 1011 */ - {illegal,0, 2, 8}, /* bc: 0100 1101 1011 1100 */ - {illegal,0, 2, 8}, /* bd: 0100 1101 1011 1101 */ - {illegal,0, 2, 8}, /* be: 0100 1101 1011 1110 */ - {illegal,0, 2, 8}, /* bf: 0100 1101 1011 1111 */ - - {MOV,"PA,A", 2,10}, /* c0: 0100 1101 1100 0000 */ - {MOV,"PB,A", 2,10}, /* c1: 0100 1101 1100 0001 */ - {MOV,"PC,A", 2,10}, /* c2: 0100 1101 1100 0010 */ - {MOV,"PD,A", 2,10}, /* c3: 0100 1101 1100 0011 */ - {illegal,0, 2,10}, /* c4: 0100 1101 1100 0100 */ - {MOV,"PF,A", 2,10}, /* c5: 0100 1101 1100 0101 */ - {MOV,"MKH,A", 2,10}, /* c6: 0100 1101 1100 0110 */ - {MOV,"MKL,A", 2,10}, /* c7: 0100 1101 1100 0111 */ - {illegal,0, 2,10}, /* c8: 0100 1101 1100 1000 */ - {MOV,"SMH,A", 2,10}, /* c9: 0100 1101 1100 1001 */ - {MOV,"SML,A", 2,10}, /* ca: 0100 1101 1100 1010 */ - {MOV,"EOM,A", 2,10}, /* cb: 0100 1101 1100 1011 */ - {MOV,"ETMM,A", 2,10}, /* cc: 0100 1101 1100 1100 */ - {MOV,"TMM,A", 2,10}, /* cd: 0100 1101 1100 1101 */ - {illegal,0, 2,10}, /* ce: 0100 1101 1100 1110 */ - {illegal,0, 2,10}, /* cf: 0100 1101 1100 1111 */ - - {MOV,"MM,A", 2,10}, /* d0: 0100 1101 1101 0000 */ - {MOV,"MCC,A", 2,10}, /* d1: 0100 1101 1101 0001 */ - {MOV,"MA,A", 2,10}, /* d2: 0100 1101 1101 0010 */ - {MOV,"MB,A", 2,10}, /* d3: 0100 1101 1101 0011 */ - {MOV,"MC,A", 2,10}, /* d4: 0100 1101 1101 0100 */ - {illegal,0, 2,10}, /* d5: 0100 1101 1101 0101 */ - {illegal,0, 2,10}, /* d6: 0100 1101 1101 0110 */ - {MOV,"MF,A", 2,10}, /* d7: 0100 1101 1101 0111 */ - {MOV,"TXB,A", 2,10}, /* d8: 0100 1101 1101 1000 */ - {illegal,0, 2,10}, /* d9: 0100 1101 1101 1001 */ - {MOV,"TM0,A", 2,10}, /* da: 0100 1101 1101 1010 */ - {MOV,"TM1,A", 2,10}, /* db: 0100 1101 1101 1011 */ - {illegal,0, 2,10}, /* dc: 0100 1101 1101 1100 */ - {illegal,0, 2,10}, /* dd: 0100 1101 1101 1101 */ - {illegal,0, 2,10}, /* de: 0100 1101 1101 1110 */ - {illegal,0, 2,10}, /* df: 0100 1101 1101 1111 */ - - {illegal,0, 2,10}, /* e0: 0100 1101 1110 0000 */ - {illegal,0, 2,10}, /* e1: 0100 1101 1110 0001 */ - {illegal,0, 2,10}, /* e2: 0100 1101 1110 0010 */ - {illegal,0, 2,10}, /* e3: 0100 1101 1110 0011 */ - {illegal,0, 2,10}, /* e4: 0100 1101 1110 0100 */ - {MOV,"MT,A", 2,10}, /* e5: 0100 1101 1110 0101 */ /* 7807 */ - {illegal,0, 2,10}, /* e6: 0100 1101 1110 0110 */ - {illegal,0, 2,10}, /* e7: 0100 1101 1110 0111 */ - {illegal,0, 2,10}, /* e8: 0100 1101 1110 1000 */ - {illegal,0, 2,10}, /* e9: 0100 1101 1110 1001 */ - {illegal,0, 2,10}, /* ea: 0100 1101 1110 1010 */ - {illegal,0, 2,10}, /* eb: 0100 1101 1110 1011 */ - {illegal,0, 2,10}, /* ec: 0100 1101 1110 1100 */ - {illegal,0, 2,10}, /* ed: 0100 1101 1110 1101 */ - {illegal,0, 2,10}, /* ee: 0100 1101 1110 1110 */ - {illegal,0, 2,10}, /* ef: 0100 1101 1110 1111 */ - - {illegal,0, 2,10}, /* f0: 0100 1101 1111 0000 */ - {illegal,0, 2,10}, /* f1: 0100 1101 1111 0001 */ - {illegal,0, 2,10}, /* f2: 0100 1101 1111 0010 */ - {illegal,0, 2,10}, /* f3: 0100 1101 1111 0011 */ - {illegal,0, 2,10}, /* f4: 0100 1101 1111 0100 */ - {illegal,0, 2,10}, /* f5: 0100 1101 1111 0101 */ - {illegal,0, 2,10}, /* f6: 0100 1101 1111 0110 */ - {illegal,0, 2,10}, /* f7: 0100 1101 1111 0111 */ - {illegal,0, 2,10}, /* f8: 0100 1101 1111 1000 */ - {illegal,0, 2,10}, /* f9: 0100 1101 1111 1001 */ - {illegal,0, 2,10}, /* fa: 0100 1101 1111 1010 */ - {illegal,0, 2,10}, /* fb: 0100 1101 1111 1011 */ - {illegal,0, 2,10}, /* fc: 0100 1101 1111 1100 */ - {illegal,0, 2,10}, /* fd: 0100 1101 1111 1101 */ - {illegal,0, 2,10}, /* fe: 0100 1101 1111 1110 */ - {illegal,0, 2,10} /* ff: 0100 1101 1111 1111 */ -}; - -/* prefix 60 */ -static struct dasm_s dasm60[256] = -{ - {illegal,0, 2, 8}, /* 00: 0110 0000 0000 0000 */ - {illegal,0, 2, 8}, /* 01: 0110 0000 0000 0001 */ - {illegal,0, 2, 8}, /* 02: 0110 0000 0000 0010 */ - {illegal,0, 2, 8}, /* 03: 0110 0000 0000 0011 */ - {illegal,0, 2, 8}, /* 04: 0110 0000 0000 0100 */ - {illegal,0, 2, 8}, /* 05: 0110 0000 0000 0101 */ - {illegal,0, 2, 8}, /* 06: 0110 0000 0000 0110 */ - {illegal,0, 2, 8}, /* 07: 0110 0000 0000 0111 */ - {ANA,"V,A", 2, 8}, /* 08: 0110 0000 0000 1000 */ - {ANA,"A,A", 2, 8}, /* 09: 0110 0000 0000 1001 */ - {ANA,"B,A", 2, 8}, /* 0a: 0110 0000 0000 1010 */ - {ANA,"C,A", 2, 8}, /* 0b: 0110 0000 0000 1011 */ - {ANA,"D,A", 2, 8}, /* 0c: 0110 0000 0000 1100 */ - {ANA,"E,A", 2, 8}, /* 0d: 0110 0000 0000 1101 */ - {ANA,"H,A", 2, 8}, /* 0e: 0110 0000 0000 1110 */ - {ANA,"L,A", 2, 8}, /* 0f: 0110 0000 0000 1111 */ - - {XRA,"V,A", 2, 8}, /* 10: 0110 0000 0001 0000 */ - {XRA,"A,A", 2, 8}, /* 11: 0110 0000 0001 0001 */ - {XRA,"B,A", 2, 8}, /* 12: 0110 0000 0001 0010 */ - {XRA,"C,A", 2, 8}, /* 13: 0110 0000 0001 0011 */ - {XRA,"D,A", 2, 8}, /* 14: 0110 0000 0001 0100 */ - {XRA,"E,A", 2, 8}, /* 15: 0110 0000 0001 0101 */ - {XRA,"H,A", 2, 8}, /* 16: 0110 0000 0001 0110 */ - {XRA,"L,A", 2, 8}, /* 17: 0110 0000 0001 0111 */ - {ORA,"V,A", 2, 8}, /* 18: 0110 0000 0001 1000 */ - {ORA,"A,A", 2, 8}, /* 19: 0110 0000 0001 1001 */ - {ORA,"B,A", 2, 8}, /* 1a: 0110 0000 0001 1010 */ - {ORA,"C,A", 2, 8}, /* 1b: 0110 0000 0001 1011 */ - {ORA,"D,A", 2, 8}, /* 1c: 0110 0000 0001 1100 */ - {ORA,"E,A", 2, 8}, /* 1d: 0110 0000 0001 1101 */ - {ORA,"H,A", 2, 8}, /* 1e: 0110 0000 0001 1110 */ - {ORA,"L,A", 2, 8}, /* 1f: 0110 0000 0001 1111 */ - - {ADDNC,"V,A", 2, 8}, /* 20: 0110 0000 0010 0000 */ - {ADDNC,"A,A", 2, 8}, /* 21: 0110 0000 0010 0001 */ - {ADDNC,"B,A", 2, 8}, /* 22: 0110 0000 0010 0010 */ - {ADDNC,"C,A", 2, 8}, /* 23: 0110 0000 0010 0011 */ - {ADDNC,"D,A", 2, 8}, /* 24: 0110 0000 0010 0100 */ - {ADDNC,"E,A", 2, 8}, /* 25: 0110 0000 0010 0101 */ - {ADDNC,"H,A", 2, 8}, /* 26: 0110 0000 0010 0110 */ - {ADDNC,"L,A", 2, 8}, /* 27: 0110 0000 0010 0111 */ - {GTA,"V,A", 2, 8}, /* 28: 0110 0000 0010 1000 */ - {GTA,"A,A", 2, 8}, /* 29: 0110 0000 0010 1001 */ - {GTA,"B,A", 2, 8}, /* 2a: 0110 0000 0010 1010 */ - {GTA,"C,A", 2, 8}, /* 2b: 0110 0000 0010 1011 */ - {GTA,"D,A", 2, 8}, /* 2c: 0110 0000 0010 1100 */ - {GTA,"E,A", 2, 8}, /* 2d: 0110 0000 0010 1101 */ - {GTA,"H,A", 2, 8}, /* 2e: 0110 0000 0010 1110 */ - {GTA,"L,A", 2, 8}, /* 2f: 0110 0000 0010 1111 */ - - {SUBNB,"V,A", 2, 8}, /* 30: 0110 0000 0011 0000 */ - {SUBNB,"A,A", 2, 8}, /* 31: 0110 0000 0011 0001 */ - {SUBNB,"B,A", 2, 8}, /* 32: 0110 0000 0011 0010 */ - {SUBNB,"C,A", 2, 8}, /* 33: 0110 0000 0011 0011 */ - {SUBNB,"D,A", 2, 8}, /* 34: 0110 0000 0011 0100 */ - {SUBNB,"E,A", 2, 8}, /* 35: 0110 0000 0011 0101 */ - {SUBNB,"H,A", 2, 8}, /* 36: 0110 0000 0011 0110 */ - {SUBNB,"L,A", 2, 8}, /* 37: 0110 0000 0011 0111 */ - {LTA,"V,A", 2, 8}, /* 38: 0110 0000 0011 1000 */ - {LTA,"A,A", 2, 8}, /* 39: 0110 0000 0011 1001 */ - {LTA,"B,A", 2, 8}, /* 3a: 0110 0000 0011 1010 */ - {LTA,"C,A", 2, 8}, /* 3b: 0110 0000 0011 1011 */ - {LTA,"D,A", 2, 8}, /* 3c: 0110 0000 0011 1100 */ - {LTA,"E,A", 2, 8}, /* 3d: 0110 0000 0011 1101 */ - {LTA,"H,A", 2, 8}, /* 3e: 0110 0000 0011 1110 */ - {LTA,"L,A", 2, 8}, /* 3f: 0110 0000 0011 1111 */ - - {ADD,"V,A", 2, 8}, /* 40: 0110 0000 0100 0000 */ - {ADD,"A,A", 2, 8}, /* 41: 0110 0000 0100 0001 */ - {ADD,"B,A", 2, 8}, /* 42: 0110 0000 0100 0010 */ - {ADD,"C,A", 2, 8}, /* 43: 0110 0000 0100 0011 */ - {ADD,"D,A", 2, 8}, /* 44: 0110 0000 0100 0100 */ - {ADD,"E,A", 2, 8}, /* 45: 0110 0000 0100 0101 */ - {ADD,"H,A", 2, 8}, /* 46: 0110 0000 0100 0110 */ - {ADD,"L,A", 2, 8}, /* 47: 0110 0000 0100 0111 */ - {illegal,0, 2, 8}, /* 48: 0110 0000 0100 1000 */ - {illegal,0, 2, 8}, /* 49: 0110 0000 0100 1001 */ - {illegal,0, 2, 8}, /* 4a: 0110 0000 0100 1010 */ - {illegal,0, 2, 8}, /* 4b: 0110 0000 0100 1011 */ - {illegal,0, 2, 8}, /* 4c: 0110 0000 0100 1100 */ - {illegal,0, 2, 8}, /* 4d: 0110 0000 0100 1101 */ - {illegal,0, 2, 8}, /* 4e: 0110 0000 0100 1110 */ - {illegal,0, 2, 8}, /* 4f: 0110 0000 0100 1111 */ - - {ADC,"V,A", 2, 8}, /* 50: 0110 0000 0101 0000 */ - {ADC,"A,A", 2, 8}, /* 51: 0110 0000 0101 0001 */ - {ADC,"B,A", 2, 8}, /* 52: 0110 0000 0101 0010 */ - {ADC,"C,A", 2, 8}, /* 53: 0110 0000 0101 0011 */ - {ADC,"D,A", 2, 8}, /* 54: 0110 0000 0101 0100 */ - {ADC,"E,A", 2, 8}, /* 55: 0110 0000 0101 0101 */ - {ADC,"H,A", 2, 8}, /* 56: 0110 0000 0101 0110 */ - {ADC,"L,A", 2, 8}, /* 57: 0110 0000 0101 0111 */ - {illegal,0, 2, 8}, /* 58: 0110 0000 0101 1000 */ - {illegal,0, 2, 8}, /* 59: 0110 0000 0101 1001 */ - {illegal,0, 2, 8}, /* 5a: 0110 0000 0101 1010 */ - {illegal,0, 2, 8}, /* 5b: 0110 0000 0101 1011 */ - {illegal,0, 2, 8}, /* 5c: 0110 0000 0101 1100 */ - {illegal,0, 2, 8}, /* 5d: 0110 0000 0101 1101 */ - {illegal,0, 2, 8}, /* 5e: 0110 0000 0101 1110 */ - {illegal,0, 2, 8}, /* 5f: 0110 0000 0101 1111 */ - - {SUB,"V,A", 2, 8}, /* 60: 0110 0000 0110 0000 */ - {SUB,"A,A", 2, 8}, /* 61: 0110 0000 0110 0001 */ - {SUB,"B,A", 2, 8}, /* 62: 0110 0000 0110 0010 */ - {SUB,"C,A", 2, 8}, /* 63: 0110 0000 0110 0011 */ - {SUB,"D,A", 2, 8}, /* 64: 0110 0000 0110 0100 */ - {SUB,"E,A", 2, 8}, /* 65: 0110 0000 0110 0101 */ - {SUB,"H,A", 2, 8}, /* 66: 0110 0000 0110 0110 */ - {SUB,"L,A", 2, 8}, /* 67: 0110 0000 0110 0111 */ - {NEA,"V,A", 2, 8}, /* 68: 0110 0000 0110 1000 */ - {NEA,"A,A", 2, 8}, /* 69: 0110 0000 0110 1001 */ - {NEA,"B,A", 2, 8}, /* 6a: 0110 0000 0110 1010 */ - {NEA,"C,A", 2, 8}, /* 6b: 0110 0000 0110 1011 */ - {NEA,"D,A", 2, 8}, /* 6c: 0110 0000 0110 1100 */ - {NEA,"E,A", 2, 8}, /* 6d: 0110 0000 0110 1101 */ - {NEA,"H,A", 2, 8}, /* 6e: 0110 0000 0110 1110 */ - {NEA,"L,A", 2, 8}, /* 6f: 0110 0000 0110 1111 */ - - {SBB,"V,A", 2, 8}, /* 70: 0110 0000 0111 0000 */ - {SBB,"A,A", 2, 8}, /* 71: 0110 0000 0111 0001 */ - {SBB,"B,A", 2, 8}, /* 72: 0110 0000 0111 0010 */ - {SBB,"C,A", 2, 8}, /* 73: 0110 0000 0111 0011 */ - {SBB,"D,A", 2, 8}, /* 74: 0110 0000 0111 0100 */ - {SBB,"E,A", 2, 8}, /* 75: 0110 0000 0111 0101 */ - {SBB,"H,A", 2, 8}, /* 76: 0110 0000 0111 0110 */ - {SBB,"L,A", 2, 8}, /* 77: 0110 0000 0111 0111 */ - {EQA,"V,A", 2, 8}, /* 78: 0110 0000 0111 1000 */ - {EQA,"A,A", 2, 8}, /* 79: 0110 0000 0111 1001 */ - {EQA,"B,A", 2, 8}, /* 7a: 0110 0000 0111 1010 */ - {EQA,"C,A", 2, 8}, /* 7b: 0110 0000 0111 1011 */ - {EQA,"D,A", 2, 8}, /* 7c: 0110 0000 0111 1100 */ - {EQA,"E,A", 2, 8}, /* 7d: 0110 0000 0111 1101 */ - {EQA,"H,A", 2, 8}, /* 7e: 0110 0000 0111 1110 */ - {EQA,"L,A", 2, 8}, /* 7f: 0110 0000 0111 1111 */ - - {illegal,0, 2, 8}, /* 80: 0110 0000 1000 0000 */ - {illegal,0, 2, 8}, /* 81: 0110 0000 1000 0001 */ - {illegal,0, 2, 8}, /* 82: 0110 0000 1000 0010 */ - {illegal,0, 2, 8}, /* 83: 0110 0000 1000 0011 */ - {illegal,0, 2, 8}, /* 84: 0110 0000 1000 0100 */ - {illegal,0, 2, 8}, /* 85: 0110 0000 1000 0101 */ - {illegal,0, 2, 8}, /* 86: 0110 0000 1000 0110 */ - {illegal,0, 2, 8}, /* 87: 0110 0000 1000 0111 */ - {ANA,"A,V", 2, 8}, /* 88: 0110 0000 1000 1000 */ - {ANA,"A,A", 2, 8}, /* 89: 0110 0000 1000 1001 */ - {ANA,"A,B", 2, 8}, /* 8a: 0110 0000 1000 1010 */ - {ANA,"A,C", 2, 8}, /* 8b: 0110 0000 1000 1011 */ - {ANA,"A,D", 2, 8}, /* 8c: 0110 0000 1000 1100 */ - {ANA,"A,E", 2, 8}, /* 8d: 0110 0000 1000 1101 */ - {ANA,"A,H", 2, 8}, /* 8e: 0110 0000 1000 1110 */ - {ANA,"A,L", 2, 8}, /* 8f: 0110 0000 1000 1111 */ - - {XRA,"A,V", 2, 8}, /* 90: 0110 0000 1001 0000 */ - {XRA,"A,A", 2, 8}, /* 91: 0110 0000 1001 0001 */ - {XRA,"A,B", 2, 8}, /* 92: 0110 0000 1001 0010 */ - {XRA,"A,C", 2, 8}, /* 93: 0110 0000 1001 0011 */ - {XRA,"A,D", 2, 8}, /* 94: 0110 0000 1001 0100 */ - {XRA,"A,E", 2, 8}, /* 95: 0110 0000 1001 0101 */ - {XRA,"A,H", 2, 8}, /* 96: 0110 0000 1001 0110 */ - {XRA,"A,L", 2, 8}, /* 97: 0110 0000 1001 0111 */ - {ORA,"A,V", 2, 8}, /* 98: 0110 0000 1001 1000 */ - {ORA,"A,A", 2, 8}, /* 99: 0110 0000 1001 1001 */ - {ORA,"A,B", 2, 8}, /* 9a: 0110 0000 1001 1010 */ - {ORA,"A,C", 2, 8}, /* 9b: 0110 0000 1001 1011 */ - {ORA,"A,D", 2, 8}, /* 9c: 0110 0000 1001 1100 */ - {ORA,"A,E", 2, 8}, /* 9d: 0110 0000 1001 1101 */ - {ORA,"A,H", 2, 8}, /* 9e: 0110 0000 1001 1110 */ - {ORA,"A,L", 2, 8}, /* 9f: 0110 0000 1001 1111 */ - - {ADDNC,"A,V", 2, 8}, /* a0: 0110 0000 1010 0000 */ - {ADDNC,"A,A", 2, 8}, /* a1: 0110 0000 1010 0001 */ - {ADDNC,"A,B", 2, 8}, /* a2: 0110 0000 1010 0010 */ - {ADDNC,"A,C", 2, 8}, /* a3: 0110 0000 1010 0011 */ - {ADDNC,"A,D", 2, 8}, /* a4: 0110 0000 1010 0100 */ - {ADDNC,"A,E", 2, 8}, /* a5: 0110 0000 1010 0101 */ - {ADDNC,"A,H", 2, 8}, /* a6: 0110 0000 1010 0110 */ - {ADDNC,"A,L", 2, 8}, /* a7: 0110 0000 1010 0111 */ - {GTA,"A,V", 2, 8}, /* a8: 0110 0000 1010 1000 */ - {GTA,"A,A", 2, 8}, /* a9: 0110 0000 1010 1001 */ - {GTA,"A,B", 2, 8}, /* aa: 0110 0000 1010 1010 */ - {GTA,"A,C", 2, 8}, /* ab: 0110 0000 1010 1011 */ - {GTA,"A,D", 2, 8}, /* ac: 0110 0000 1010 1100 */ - {GTA,"A,E", 2, 8}, /* ad: 0110 0000 1010 1101 */ - {GTA,"A,H", 2, 8}, /* ae: 0110 0000 1010 1110 */ - {GTA,"A,L", 2, 8}, /* af: 0110 0000 1010 1111 */ - - {SUBNB,"A,V", 2, 8}, /* b0: 0110 0000 1011 0000 */ - {SUBNB,"A,A", 2, 8}, /* b1: 0110 0000 1011 0001 */ - {SUBNB,"A,B", 2, 8}, /* b2: 0110 0000 1011 0010 */ - {SUBNB,"A,C", 2, 8}, /* b3: 0110 0000 1011 0011 */ - {SUBNB,"A,D", 2, 8}, /* b4: 0110 0000 1011 0100 */ - {SUBNB,"A,E", 2, 8}, /* b5: 0110 0000 1011 0101 */ - {SUBNB,"A,H", 2, 8}, /* b6: 0110 0000 1011 0110 */ - {SUBNB,"A,L", 2, 8}, /* b7: 0110 0000 1011 0111 */ - {LTA,"A,V", 2, 8}, /* b8: 0110 0000 1011 1000 */ - {LTA,"A,A", 2, 8}, /* b9: 0110 0000 1011 1001 */ - {LTA,"A,B", 2, 8}, /* ba: 0110 0000 1011 1010 */ - {LTA,"A,C", 2, 8}, /* bb: 0110 0000 1011 1011 */ - {LTA,"A,D", 2, 8}, /* bc: 0110 0000 1011 1100 */ - {LTA,"A,E", 2, 8}, /* bd: 0110 0000 1011 1101 */ - {LTA,"A,H", 2, 8}, /* be: 0110 0000 1011 1110 */ - {LTA,"A,L", 2, 8}, /* bf: 0110 0000 1011 1111 */ - - {ADD,"A,V", 2, 8}, /* c0: 0110 0000 1100 0000 */ - {ADD,"A,A", 2, 8}, /* c1: 0110 0000 1100 0001 */ - {ADD,"A,B", 2, 8}, /* c2: 0110 0000 1100 0010 */ - {ADD,"A,C", 2, 8}, /* c3: 0110 0000 1100 0011 */ - {ADD,"A,D", 2, 8}, /* c4: 0110 0000 1100 0100 */ - {ADD,"A,E", 2, 8}, /* c5: 0110 0000 1100 0101 */ - {ADD,"A,H", 2, 8}, /* c6: 0110 0000 1100 0110 */ - {ADD,"A,L", 2, 8}, /* c7: 0110 0000 1100 0111 */ - {ONA,"A,V", 2, 8}, /* c8: 0110 0000 1100 1000 */ - {ONA,"A,A", 2, 8}, /* c9: 0110 0000 1100 1001 */ - {ONA,"A,B", 2, 8}, /* ca: 0110 0000 1100 1010 */ - {ONA,"A,C", 2, 8}, /* cb: 0110 0000 1100 1011 */ - {ONA,"A,D", 2, 8}, /* cc: 0110 0000 1100 1100 */ - {ONA,"A,E", 2, 8}, /* cd: 0110 0000 1100 1101 */ - {ONA,"A,H", 2, 8}, /* ce: 0110 0000 1100 1110 */ - {ONA,"A,L", 2, 8}, /* cf: 0110 0000 1100 1111 */ - - {ADC,"A,V", 2, 8}, /* d0: 0110 0000 1101 0000 */ - {ADC,"A,A", 2, 8}, /* d1: 0110 0000 1101 0001 */ - {ADC,"A,B", 2, 8}, /* d2: 0110 0000 1101 0010 */ - {ADC,"A,C", 2, 8}, /* d3: 0110 0000 1101 0011 */ - {ADC,"A,D", 2, 8}, /* d4: 0110 0000 1101 0100 */ - {ADC,"A,E", 2, 8}, /* d5: 0110 0000 1101 0101 */ - {ADC,"A,H", 2, 8}, /* d6: 0110 0000 1101 0110 */ - {ADC,"A,L", 2, 8}, /* d7: 0110 0000 1101 0111 */ - {OFFA,"A,V", 2, 8}, /* d8: 0110 0000 1101 1000 */ - {OFFA,"A,A", 2, 8}, /* d9: 0110 0000 1101 1001 */ - {OFFA,"A,B", 2, 8}, /* da: 0110 0000 1101 1010 */ - {OFFA,"A,C", 2, 8}, /* db: 0110 0000 1101 1011 */ - {OFFA,"A,D", 2, 8}, /* dc: 0110 0000 1101 1100 */ - {OFFA,"A,E", 2, 8}, /* dd: 0110 0000 1101 1101 */ - {OFFA,"A,H", 2, 8}, /* de: 0110 0000 1101 1110 */ - {OFFA,"A,L", 2, 8}, /* df: 0110 0000 1101 1111 */ - - {SUB,"A,V", 2, 8}, /* e0: 0110 0000 1110 0000 */ - {SUB,"A,A", 2, 8}, /* e1: 0110 0000 1110 0001 */ - {SUB,"A,B", 2, 8}, /* e2: 0110 0000 1110 0010 */ - {SUB,"A,C", 2, 8}, /* e3: 0110 0000 1110 0011 */ - {SUB,"A,D", 2, 8}, /* e4: 0110 0000 1110 0100 */ - {SUB,"A,E", 2, 8}, /* e5: 0110 0000 1110 0101 */ - {SUB,"A,H", 2, 8}, /* e6: 0110 0000 1110 0110 */ - {SUB,"A,L", 2, 8}, /* e7: 0110 0000 1110 0111 */ - {NEA,"A,V", 2, 8}, /* e8: 0110 0000 1110 1000 */ - {NEA,"A,A", 2, 8}, /* e9: 0110 0000 1110 1001 */ - {NEA,"A,B", 2, 8}, /* ea: 0110 0000 1110 1010 */ - {NEA,"A,C", 2, 8}, /* eb: 0110 0000 1110 1011 */ - {NEA,"A,D", 2, 8}, /* ec: 0110 0000 1110 1100 */ - {NEA,"A,E", 2, 8}, /* ed: 0110 0000 1110 1101 */ - {NEA,"A,H", 2, 8}, /* ee: 0110 0000 1110 1110 */ - {NEA,"A,L", 2, 8}, /* ef: 0110 0000 1110 1111 */ - - {SBB,"A,V", 2, 8}, /* f0: 0110 0000 1111 0000 */ - {SBB,"A,A", 2, 8}, /* f1: 0110 0000 1111 0001 */ - {SBB,"A,B", 2, 8}, /* f2: 0110 0000 1111 0010 */ - {SBB,"A,C", 2, 8}, /* f3: 0110 0000 1111 0011 */ - {SBB,"A,D", 2, 8}, /* f4: 0110 0000 1111 0100 */ - {SBB,"A,E", 2, 8}, /* f5: 0110 0000 1111 0101 */ - {SBB,"A,H", 2, 8}, /* f6: 0110 0000 1111 0110 */ - {SBB,"A,L", 2, 8}, /* f7: 0110 0000 1111 0111 */ - {EQA,"A,V", 2, 8}, /* f8: 0110 0000 1111 1000 */ - {EQA,"A,A", 2, 8}, /* f9: 0110 0000 1111 1001 */ - {EQA,"A,B", 2, 8}, /* fa: 0110 0000 1111 1010 */ - {EQA,"A,C", 2, 8}, /* fb: 0110 0000 1111 1011 */ - {EQA,"A,D", 2, 8}, /* fc: 0110 0000 1111 1100 */ - {EQA,"A,E", 2, 8}, /* fd: 0110 0000 1111 1101 */ - {EQA,"A,H", 2, 8}, /* fe: 0110 0000 1111 1110 */ - {EQA,"A,L", 2, 8} /* ff: 0110 0000 1111 1111 */ -}; - -/* prefix 64 */ -static struct dasm_s dasm64_7810[256] = -{ - {MVI,"PA,%b", 3,14}, /* 00: 0110 0100 0000 0000 xxxx xxxx */ - {MVI,"PB,%b", 3,14}, /* 01: 0110 0100 0000 0001 xxxx xxxx */ - {MVI,"PC,%b", 3,14}, /* 02: 0110 0100 0000 0010 xxxx xxxx */ - {MVI,"PD,%b", 3,14}, /* 03: 0110 0100 0000 0011 xxxx xxxx */ - {illegal,0, 3,14}, /* 04: 0110 0100 0000 0100 xxxx xxxx */ - {MVI,"PF,%b", 3,14}, /* 05: 0110 0100 0000 0101 xxxx xxxx */ - {MVI,"MKH,%b", 3,14}, /* 06: 0110 0100 0000 0110 xxxx xxxx */ - {MVI,"MKL,%b", 3,14}, /* 07: 0110 0100 0000 0111 xxxx xxxx */ - {ANI,"PA,%b", 3,20}, /* 08: 0110 0100 0000 1000 xxxx xxxx */ - {ANI,"PB,%b", 3,20}, /* 09: 0110 0100 0000 1001 xxxx xxxx */ - {ANI,"PC,%b", 3,20}, /* 0a: 0110 0100 0000 1010 xxxx xxxx */ - {ANI,"PD,%b", 3,20}, /* 0b: 0110 0100 0000 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 0c: 0110 0100 0000 1100 xxxx xxxx */ - {ANI,"PF,%b", 3,20}, /* 0d: 0110 0100 0000 1101 xxxx xxxx */ - {ANI,"MKH,%b", 3,20}, /* 0e: 0110 0100 0000 1110 xxxx xxxx */ - {ANI,"MKL,%b", 3,20}, /* 0f: 0110 0100 0000 1111 xxxx xxxx */ - - {XRI,"PA,%b", 3,20}, /* 10: 0110 0100 0001 0000 xxxx xxxx */ - {XRI,"PB,%b", 3,20}, /* 11: 0110 0100 0001 0001 xxxx xxxx */ - {XRI,"PC,%b", 3,20}, /* 12: 0110 0100 0001 0010 xxxx xxxx */ - {XRI,"PD,%b", 3,20}, /* 13: 0110 0100 0001 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 14: 0110 0100 0001 0100 xxxx xxxx */ - {XRI,"PF,%b", 3,20}, /* 15: 0110 0100 0001 0101 xxxx xxxx */ - {XRI,"MKH,%b", 3,20}, /* 16: 0110 0100 0001 0110 xxxx xxxx */ - {XRI,"MKL,%b", 3,20}, /* 17: 0110 0100 0001 0111 xxxx xxxx */ - {ORI,"PA,%b", 3,20}, /* 18: 0110 0100 0001 1000 xxxx xxxx */ - {ORI,"PB,%b", 3,20}, /* 19: 0110 0100 0001 1001 xxxx xxxx */ - {ORI,"PC,%b", 3,20}, /* 1a: 0110 0100 0001 1010 xxxx xxxx */ - {ORI,"PD,%b", 3,20}, /* 1b: 0110 0100 0001 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 1c: 0110 0100 0001 1100 xxxx xxxx */ - {ORI,"PF,%b", 3,20}, /* 1d: 0110 0100 0001 1101 xxxx xxxx */ - {ORI,"MKH,%b", 3,20}, /* 1e: 0110 0100 0001 1110 xxxx xxxx */ - {ORI,"MKL,%b", 3,20}, /* 1f: 0110 0100 0001 1111 xxxx xxxx */ - - {ADINC,"PA,%b", 3,20}, /* 20: 0110 0100 0010 0000 xxxx xxxx */ - {ADINC,"PB,%b", 3,20}, /* 21: 0110 0100 0010 0001 xxxx xxxx */ - {ADINC,"PC,%b", 3,20}, /* 22: 0110 0100 0010 0010 xxxx xxxx */ - {ADINC,"PD,%b", 3,20}, /* 23: 0110 0100 0010 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 24: 0110 0100 0010 0100 xxxx xxxx */ - {ADINC,"PF,%b", 3,20}, /* 25: 0110 0100 0010 0101 xxxx xxxx */ - {ADINC,"MKH,%b", 3,20}, /* 26: 0110 0100 0010 0110 xxxx xxxx */ - {ADINC,"MKL,%b", 3,20}, /* 27: 0110 0100 0010 0111 xxxx xxxx */ - {GTI,"PA,%b", 3,20}, /* 28: 0110 0100 0010 1000 xxxx xxxx */ - {GTI,"PB,%b", 3,20}, /* 29: 0110 0100 0010 1001 xxxx xxxx */ - {GTI,"PC,%b", 3,20}, /* 2a: 0110 0100 0010 1010 xxxx xxxx */ - {GTI,"PD,%b", 3,20}, /* 2b: 0110 0100 0010 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 2c: 0110 0100 0010 1100 xxxx xxxx */ - {GTI,"PF,%b", 3,20}, /* 2d: 0110 0100 0010 1101 xxxx xxxx */ - {GTI,"MKH,%b", 3,20}, /* 2e: 0110 0100 0010 1110 xxxx xxxx */ - {GTI,"MKL,%b", 3,20}, /* 2f: 0110 0100 0010 1111 xxxx xxxx */ - - {SUINB,"PA,%b", 3,20}, /* 30: 0110 0100 0011 0000 xxxx xxxx */ - {SUINB,"PB,%b", 3,20}, /* 31: 0110 0100 0011 0001 xxxx xxxx */ - {SUINB,"PC,%b", 3,20}, /* 32: 0110 0100 0011 0010 xxxx xxxx */ - {SUINB,"PD,%b", 3,20}, /* 33: 0110 0100 0011 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 34: 0110 0100 0011 0100 xxxx xxxx */ - {SUINB,"PF,%b", 3,20}, /* 35: 0110 0100 0011 0101 xxxx xxxx */ - {SUINB,"MKH,%b", 3,20}, /* 36: 0110 0100 0011 0110 xxxx xxxx */ - {SUINB,"MKL,%b", 3,20}, /* 37: 0110 0100 0011 0111 xxxx xxxx */ - {LTI,"PA,%b", 3,20}, /* 38: 0110 0100 0011 1000 xxxx xxxx */ - {LTI,"PB,%b", 3,20}, /* 39: 0110 0100 0011 1001 xxxx xxxx */ - {LTI,"PC,%b", 3,20}, /* 3a: 0110 0100 0011 1010 xxxx xxxx */ - {LTI,"PD,%b", 3,20}, /* 3b: 0110 0100 0011 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 3c: 0110 0100 0011 1100 xxxx xxxx */ - {LTI,"PF,%b", 3,20}, /* 3d: 0110 0100 0011 1101 xxxx xxxx */ - {LTI,"MKH,%b", 3,20}, /* 3e: 0110 0100 0011 1110 xxxx xxxx */ - {LTI,"MKL,%b", 3,20}, /* 3f: 0110 0100 0011 1111 xxxx xxxx */ - - {ADI,"PA,%b", 3,20}, /* 40: 0110 0100 0100 0000 xxxx xxxx */ - {ADI,"PB,%b", 3,20}, /* 41: 0110 0100 0100 0001 xxxx xxxx */ - {ADI,"PC,%b", 3,20}, /* 42: 0110 0100 0100 0010 xxxx xxxx */ - {ADI,"PD,%b", 3,20}, /* 43: 0110 0100 0100 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 44: 0110 0100 0100 0100 xxxx xxxx */ - {ADI,"PF,%b", 3,20}, /* 45: 0110 0100 0100 0101 xxxx xxxx */ - {ADI,"MKH,%b", 3,20}, /* 46: 0110 0100 0100 0110 xxxx xxxx */ - {ADI,"MKL,%b", 3,20}, /* 47: 0110 0100 0100 0111 xxxx xxxx */ - {ONI,"PA,%b", 3,20}, /* 48: 0110 0100 0100 1000 xxxx xxxx */ - {ONI,"PB,%b", 3,20}, /* 49: 0110 0100 0100 1001 xxxx xxxx */ - {ONI,"PC,%b", 3,20}, /* 4a: 0110 0100 0100 1010 xxxx xxxx */ - {ONI,"PD,%b", 3,20}, /* 4b: 0110 0100 0100 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 4c: 0110 0100 0100 1100 xxxx xxxx */ - {ONI,"PF,%b", 3,20}, /* 4d: 0110 0100 0100 1101 xxxx xxxx */ - {ONI,"MKH,%b", 3,20}, /* 4e: 0110 0100 0100 1110 xxxx xxxx */ - {ONI,"MKL,%b", 3,20}, /* 4f: 0110 0100 0100 1111 xxxx xxxx */ - - {ACI,"PA,%b", 3,20}, /* 50: 0110 0100 0101 0000 xxxx xxxx */ - {ACI,"PB,%b", 3,20}, /* 51: 0110 0100 0101 0001 xxxx xxxx */ - {ACI,"PC,%b", 3,20}, /* 52: 0110 0100 0101 0010 xxxx xxxx */ - {ACI,"PD,%b", 3,20}, /* 53: 0110 0100 0101 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 54: 0110 0100 0101 0100 xxxx xxxx */ - {ACI,"PF,%b", 3,20}, /* 55: 0110 0100 0101 0101 xxxx xxxx */ - {ACI,"MKH,%b", 3,20}, /* 56: 0110 0100 0101 0110 xxxx xxxx */ - {ACI,"MKL,%b", 3,20}, /* 57: 0110 0100 0101 0111 xxxx xxxx */ - {OFFI,"PA,%b", 3,20}, /* 58: 0110 0100 0101 1000 xxxx xxxx */ - {OFFI,"PB,%b", 3,20}, /* 59: 0110 0100 0101 1001 xxxx xxxx */ - {OFFI,"PC,%b", 3,20}, /* 5a: 0110 0100 0101 1010 xxxx xxxx */ - {OFFI,"PD,%b", 3,20}, /* 5b: 0110 0100 0101 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 5c: 0110 0100 0101 1100 xxxx xxxx */ - {OFFI,"PF,%b", 3,20}, /* 5d: 0110 0100 0101 1101 xxxx xxxx */ - {OFFI,"MKH,%b", 3,20}, /* 5e: 0110 0100 0101 1110 xxxx xxxx */ - {OFFI,"MKL,%b", 3,20}, /* 5f: 0110 0100 0101 1111 xxxx xxxx */ - - {SUI,"PA,%b", 3,20}, /* 60: 0110 0100 0110 0000 xxxx xxxx */ - {SUI,"PB,%b", 3,20}, /* 61: 0110 0100 0110 0001 xxxx xxxx */ - {SUI,"PC,%b", 3,20}, /* 62: 0110 0100 0110 0010 xxxx xxxx */ - {SUI,"PD,%b", 3,20}, /* 63: 0110 0100 0110 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 64: 0110 0100 0110 0100 xxxx xxxx */ - {SUI,"PF,%b", 3,20}, /* 65: 0110 0100 0110 0101 xxxx xxxx */ - {SUI,"MKH,%b", 3,20}, /* 66: 0110 0100 0110 0110 xxxx xxxx */ - {SUI,"MKL,%b", 3,20}, /* 67: 0110 0100 0110 0111 xxxx xxxx */ - {NEI,"PA,%b", 3,20}, /* 68: 0110 0100 0110 1000 xxxx xxxx */ - {NEI,"PB,%b", 3,20}, /* 69: 0110 0100 0110 1001 xxxx xxxx */ - {NEI,"PC,%b", 3,20}, /* 6a: 0110 0100 0110 1010 xxxx xxxx */ - {NEI,"PD,%b", 3,20}, /* 6b: 0110 0100 0110 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 6c: 0110 0100 0110 1100 xxxx xxxx */ - {NEI,"PF,%b", 3,20}, /* 6d: 0110 0100 0110 1101 xxxx xxxx */ - {NEI,"MKH,%b", 3,20}, /* 6e: 0110 0100 0110 1110 xxxx xxxx */ - {NEI,"MKL,%b", 3,20}, /* 6f: 0110 0100 0110 1111 xxxx xxxx */ - - {SBI,"PA,%b", 3,20}, /* 70: 0110 0100 0111 0000 xxxx xxxx */ - {SBI,"PB,%b", 3,20}, /* 71: 0110 0100 0111 0001 xxxx xxxx */ - {SBI,"PC,%b", 3,20}, /* 72: 0110 0100 0111 0010 xxxx xxxx */ - {SBI,"PD,%b", 3,20}, /* 73: 0110 0100 0111 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 74: 0110 0100 0111 0100 xxxx xxxx */ - {SBI,"PF,%b", 3,20}, /* 75: 0110 0100 0111 0101 xxxx xxxx */ - {SBI,"MKH,%b", 3,20}, /* 76: 0110 0100 0111 0110 xxxx xxxx */ - {SBI,"MKL,%b", 3,20}, /* 77: 0110 0100 0111 0111 xxxx xxxx */ - {EQI,"PA,%b", 3,20}, /* 78: 0110 0100 0111 1000 xxxx xxxx */ - {EQI,"PB,%b", 3,20}, /* 79: 0110 0100 0111 1001 xxxx xxxx */ - {EQI,"PC,%b", 3,20}, /* 7a: 0110 0100 0111 1010 xxxx xxxx */ - {EQI,"PD,%b", 3,20}, /* 7b: 0110 0100 0111 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 7c: 0110 0100 0111 1100 xxxx xxxx */ - {EQI,"PF,%b", 3,20}, /* 7d: 0110 0100 0111 1101 xxxx xxxx */ - {EQI,"MKH,%b", 3,20}, /* 7e: 0110 0100 0111 1110 xxxx xxxx */ - {EQI,"MKL,%b", 3,20}, /* 7f: 0110 0100 0111 1111 xxxx xxxx */ - - {MVI,"ANM,%b", 3,14}, /* 80: 0110 0100 1000 0000 xxxx xxxx */ /* 7810 */ - {MVI,"SMH,%b", 3,14}, /* 81: 0110 0100 1000 0001 xxxx xxxx */ - {illegal,0, 3,14}, /* 82: 0110 0100 1000 0010 xxxx xxxx */ - {MVI,"EOM,%b", 3,14}, /* 83: 0110 0100 1000 0011 xxxx xxxx */ - {illegal,0, 3,14}, /* 84: 0110 0100 1000 0100 xxxx xxxx */ - {MVI,"TMM,%b", 3,14}, /* 85: 0110 0100 1000 0101 xxxx xxxx */ - {illegal,0, 3,14}, /* 86: 0110 0100 1000 0110 xxxx xxxx */ - {illegal,0, 3,14}, /* 87: 0110 0100 1000 0111 xxxx xxxx */ - {ANI,"ANM,%b", 3,20}, /* 88: 0110 0100 1000 1000 xxxx xxxx */ /* 7810 */ - {ANI,"SMH,%b", 3,20}, /* 89: 0110 0100 1000 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* 8a: 0110 0100 1000 1010 xxxx xxxx */ - {ANI,"EOM,%b", 3,20}, /* 8b: 0110 0100 1000 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 8c: 0110 0100 1000 1100 xxxx xxxx */ - {ANI,"TMM,%b", 3,20}, /* 8d: 0110 0100 1000 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* 8e: 0110 0100 1000 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* 8f: 0110 0100 1000 1111 xxxx xxxx */ - - {XRI,"ANM,%b", 3,20}, /* 90: 0110 0100 1001 0000 xxxx xxxx */ /* 7810 */ - {XRI,"SMH,%b", 3,20}, /* 91: 0110 0100 1001 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* 92: 0110 0100 1001 0010 xxxx xxxx */ - {XRI,"EOM,%b", 3,20}, /* 93: 0110 0100 1001 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 94: 0110 0100 1001 0100 xxxx xxxx */ - {XRI,"TMM,%b", 3,20}, /* 95: 0110 0100 1001 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* 96: 0110 0100 1001 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* 97: 0110 0100 1001 0111 xxxx xxxx */ - {ORI,"ANM,%b", 3,20}, /* 98: 0110 0100 1001 1000 xxxx xxxx */ /* 7810 */ - {ORI,"SMH,%b", 3,20}, /* 99: 0110 0100 1001 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* 9a: 0110 0100 1001 1010 xxxx xxxx */ - {ORI,"EOM,%b", 3,20}, /* 9b: 0110 0100 1001 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 9c: 0110 0100 1001 1100 xxxx xxxx */ - {ORI,"TMM,%b", 3,20}, /* 9d: 0110 0100 1001 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* 9e: 0110 0100 1001 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* 9f: 0110 0100 1001 1111 xxxx xxxx */ - - {ADINC,"ANM,%b", 3,20}, /* a0: 0110 0100 1010 0000 xxxx xxxx */ /* 7810 */ - {ADINC,"SMH,%b", 3,20}, /* a1: 0110 0100 1010 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* a2: 0110 0100 1010 0010 xxxx xxxx */ - {ADINC,"EOM,%b", 3,20}, /* a3: 0110 0100 1010 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* a4: 0110 0100 1010 0100 xxxx xxxx */ - {ADINC,"TMM,%b", 3,20}, /* a5: 0110 0100 1010 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* a6: 0110 0100 1010 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* a7: 0110 0100 1010 0111 xxxx xxxx */ - {GTI,"ANM,%b", 3,20}, /* a8: 0110 0100 1010 1000 xxxx xxxx */ /* 7810 */ - {GTI,"SMH,%b", 3,20}, /* a9: 0110 0100 1010 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* aa: 0110 0100 1010 1010 xxxx xxxx */ - {GTI,"EOM,%b", 3,20}, /* ab: 0110 0100 1010 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* ac: 0110 0100 1010 1100 xxxx xxxx */ - {GTI,"TMM,%b", 3,20}, /* ad: 0110 0100 1010 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* ae: 0110 0100 1010 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* af: 0110 0100 1010 1111 xxxx xxxx */ - - {SUINB,"ANM,%b", 3,20}, /* b0: 0110 0100 1011 0000 xxxx xxxx */ /* 7810 */ - {SUINB,"SMH,%b", 3,20}, /* b1: 0110 0100 1011 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* b2: 0110 0100 1011 0010 xxxx xxxx */ - {SUINB,"EOM,%b", 3,20}, /* b3: 0110 0100 1011 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* b4: 0110 0100 1011 0100 xxxx xxxx */ - {SUINB,"TMM,%b", 3,20}, /* b5: 0110 0100 1011 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* b6: 0110 0100 1011 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* b7: 0110 0100 1011 0111 xxxx xxxx */ - {LTI,"ANM,%b", 3,20}, /* b8: 0110 0100 1011 1000 xxxx xxxx */ /* 7810 */ - {LTI,"SMH,%b", 3,20}, /* b9: 0110 0100 1011 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* ba: 0110 0100 1011 1010 xxxx xxxx */ - {LTI,"EOM,%b", 3,20}, /* bb: 0110 0100 1011 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* bc: 0110 0100 1011 1100 xxxx xxxx */ - {LTI,"TMM,%b", 3,20}, /* bd: 0110 0100 1011 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* be: 0110 0100 1011 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* bf: 0110 0100 1011 1111 xxxx xxxx */ - - {ADI,"ANM,%b", 3,20}, /* c0: 0110 0100 1100 0000 xxxx xxxx */ /* 7810 */ - {ADI,"SMH,%b", 3,20}, /* c1: 0110 0100 1100 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* c2: 0110 0100 1100 0010 xxxx xxxx */ - {ADI,"EOM,%b", 3,20}, /* c3: 0110 0100 1100 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* c4: 0110 0100 1100 0100 xxxx xxxx */ - {ADI,"TMM,%b", 3,20}, /* c5: 0110 0100 1100 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* c6: 0110 0100 1100 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* c7: 0110 0100 1100 0111 xxxx xxxx */ - {ONI,"ANM,%b", 3,20}, /* c8: 0110 0100 1100 1000 xxxx xxxx */ /* 7810 */ - {ONI,"SMH,%b", 3,20}, /* c9: 0110 0100 1100 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* ca: 0110 0100 1100 1010 xxxx xxxx */ - {ONI,"EOM,%b", 3,20}, /* cb: 0110 0100 1100 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* cc: 0110 0100 1100 1100 xxxx xxxx */ - {ONI,"TMM,%b", 3,20}, /* cd: 0110 0100 1100 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* ce: 0110 0100 1100 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* cf: 0110 0100 1100 1111 xxxx xxxx */ - - {ACI,"ANM,%b", 3,20}, /* d0: 0110 0100 1101 0000 xxxx xxxx */ /* 7810 */ - {ACI,"SMH,%b", 3,20}, /* d1: 0110 0100 1101 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* d2: 0110 0100 1101 0010 xxxx xxxx */ - {ACI,"EOM,%b", 3,20}, /* d3: 0110 0100 1101 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* d4: 0110 0100 1101 0100 xxxx xxxx */ - {ACI,"TMM,%b", 3,20}, /* d5: 0110 0100 1101 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* d6: 0110 0100 1101 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* d7: 0110 0100 1101 0111 xxxx xxxx */ - {OFFI,"ANM,%b", 3,20}, /* d8: 0110 0100 1101 1000 xxxx xxxx */ /* 7810 */ - {OFFI,"SMH,%b", 3,20}, /* d9: 0110 0100 1101 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* da: 0110 0100 1101 1010 xxxx xxxx */ - {OFFI,"EOM,%b", 3,20}, /* db: 0110 0100 1101 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* dc: 0110 0100 1101 1100 xxxx xxxx */ - {OFFI,"TMM,%b", 3,20}, /* dd: 0110 0100 1101 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* de: 0110 0100 1101 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* df: 0110 0100 1101 1111 xxxx xxxx */ - - {SUI,"ANM,%b", 3,20}, /* e0: 0110 0100 1110 0000 xxxx xxxx */ /* 7810 */ - {SUI,"SMH,%b", 3,20}, /* e1: 0110 0100 1110 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* e2: 0110 0100 1110 0010 xxxx xxxx */ - {SUI,"EOM,%b", 3,20}, /* e3: 0110 0100 1110 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* e4: 0110 0100 1110 0100 xxxx xxxx */ - {SUI,"TMM,%b", 3,20}, /* e5: 0110 0100 1110 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* e6: 0110 0100 1110 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* e7: 0110 0100 1110 0111 xxxx xxxx */ - {NEI,"ANM,%b", 3,20}, /* e8: 0110 0100 1110 1000 xxxx xxxx */ /* 7810 */ - {NEI,"SMH,%b", 3,20}, /* e9: 0110 0100 1110 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* ea: 0110 0100 1110 1010 xxxx xxxx */ - {NEI,"EOM,%b", 3,20}, /* eb: 0110 0100 1110 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* ec: 0110 0100 1110 1100 xxxx xxxx */ - {NEI,"TMM,%b", 3,20}, /* ed: 0110 0100 1110 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* ee: 0110 0100 1110 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* ef: 0110 0100 1110 1111 xxxx xxxx */ - - {SBI,"ANM,%b", 3,20}, /* f0: 0110 0100 1111 0000 xxxx xxxx */ /* 7810 */ - {SBI,"SMH,%b", 3,20}, /* f1: 0110 0100 1111 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* f2: 0110 0100 1111 0010 xxxx xxxx */ - {SBI,"EOM,%b", 3,20}, /* f3: 0110 0100 1111 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* f4: 0110 0100 1111 0100 xxxx xxxx */ - {SBI,"TMM,%b", 3,20}, /* f5: 0110 0100 1111 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* f6: 0110 0100 1111 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* f7: 0110 0100 1111 0111 xxxx xxxx */ - {EQI,"ANM,%b", 3,20}, /* f8: 0110 0100 1111 1000 xxxx xxxx */ /* 7810 */ - {EQI,"SMH,%b", 3,20}, /* f9: 0110 0100 1111 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* fa: 0110 0100 1111 1010 xxxx xxxx */ - {EQI,"EOM,%b", 3,20}, /* fb: 0110 0100 1111 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* fc: 0110 0100 1111 1100 xxxx xxxx */ - {EQI,"TMM,%b", 3,20}, /* fd: 0110 0100 1111 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* fe: 0110 0100 1111 1110 xxxx xxxx */ - {illegal,0, 3,20} /* ff: 0110 0100 1111 1111 xxxx xxxx */ -}; - -static struct dasm_s dasm64_7807[256] = -{ - {MVI,"PA,%b", 3,14}, /* 00: 0110 0100 0000 0000 xxxx xxxx */ - {MVI,"PB,%b", 3,14}, /* 01: 0110 0100 0000 0001 xxxx xxxx */ - {MVI,"PC,%b", 3,14}, /* 02: 0110 0100 0000 0010 xxxx xxxx */ - {MVI,"PD,%b", 3,14}, /* 03: 0110 0100 0000 0011 xxxx xxxx */ - {illegal,0, 3,14}, /* 04: 0110 0100 0000 0100 xxxx xxxx */ - {MVI,"PF,%b", 3,14}, /* 05: 0110 0100 0000 0101 xxxx xxxx */ - {MVI,"MKH,%b", 3,14}, /* 06: 0110 0100 0000 0110 xxxx xxxx */ - {MVI,"MKL,%b", 3,14}, /* 07: 0110 0100 0000 0111 xxxx xxxx */ - {ANI,"PA,%b", 3,20}, /* 08: 0110 0100 0000 1000 xxxx xxxx */ - {ANI,"PB,%b", 3,20}, /* 09: 0110 0100 0000 1001 xxxx xxxx */ - {ANI,"PC,%b", 3,20}, /* 0a: 0110 0100 0000 1010 xxxx xxxx */ - {ANI,"PD,%b", 3,20}, /* 0b: 0110 0100 0000 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 0c: 0110 0100 0000 1100 xxxx xxxx */ - {ANI,"PF,%b", 3,20}, /* 0d: 0110 0100 0000 1101 xxxx xxxx */ - {ANI,"MKH,%b", 3,20}, /* 0e: 0110 0100 0000 1110 xxxx xxxx */ - {ANI,"MKL,%b", 3,20}, /* 0f: 0110 0100 0000 1111 xxxx xxxx */ - - {XRI,"PA,%b", 3,20}, /* 10: 0110 0100 0001 0000 xxxx xxxx */ - {XRI,"PB,%b", 3,20}, /* 11: 0110 0100 0001 0001 xxxx xxxx */ - {XRI,"PC,%b", 3,20}, /* 12: 0110 0100 0001 0010 xxxx xxxx */ - {XRI,"PD,%b", 3,20}, /* 13: 0110 0100 0001 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 14: 0110 0100 0001 0100 xxxx xxxx */ - {XRI,"PF,%b", 3,20}, /* 15: 0110 0100 0001 0101 xxxx xxxx */ - {XRI,"MKH,%b", 3,20}, /* 16: 0110 0100 0001 0110 xxxx xxxx */ - {XRI,"MKL,%b", 3,20}, /* 17: 0110 0100 0001 0111 xxxx xxxx */ - {ORI,"PA,%b", 3,20}, /* 18: 0110 0100 0001 1000 xxxx xxxx */ - {ORI,"PB,%b", 3,20}, /* 19: 0110 0100 0001 1001 xxxx xxxx */ - {ORI,"PC,%b", 3,20}, /* 1a: 0110 0100 0001 1010 xxxx xxxx */ - {ORI,"PD,%b", 3,20}, /* 1b: 0110 0100 0001 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 1c: 0110 0100 0001 1100 xxxx xxxx */ - {ORI,"PF,%b", 3,20}, /* 1d: 0110 0100 0001 1101 xxxx xxxx */ - {ORI,"MKH,%b", 3,20}, /* 1e: 0110 0100 0001 1110 xxxx xxxx */ - {ORI,"MKL,%b", 3,20}, /* 1f: 0110 0100 0001 1111 xxxx xxxx */ - - {ADINC,"PA,%b", 3,20}, /* 20: 0110 0100 0010 0000 xxxx xxxx */ - {ADINC,"PB,%b", 3,20}, /* 21: 0110 0100 0010 0001 xxxx xxxx */ - {ADINC,"PC,%b", 3,20}, /* 22: 0110 0100 0010 0010 xxxx xxxx */ - {ADINC,"PD,%b", 3,20}, /* 23: 0110 0100 0010 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 24: 0110 0100 0010 0100 xxxx xxxx */ - {ADINC,"PF,%b", 3,20}, /* 25: 0110 0100 0010 0101 xxxx xxxx */ - {ADINC,"MKH,%b", 3,20}, /* 26: 0110 0100 0010 0110 xxxx xxxx */ - {ADINC,"MKL,%b", 3,20}, /* 27: 0110 0100 0010 0111 xxxx xxxx */ - {GTI,"PA,%b", 3,20}, /* 28: 0110 0100 0010 1000 xxxx xxxx */ - {GTI,"PB,%b", 3,20}, /* 29: 0110 0100 0010 1001 xxxx xxxx */ - {GTI,"PC,%b", 3,20}, /* 2a: 0110 0100 0010 1010 xxxx xxxx */ - {GTI,"PD,%b", 3,20}, /* 2b: 0110 0100 0010 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 2c: 0110 0100 0010 1100 xxxx xxxx */ - {GTI,"PF,%b", 3,20}, /* 2d: 0110 0100 0010 1101 xxxx xxxx */ - {GTI,"MKH,%b", 3,20}, /* 2e: 0110 0100 0010 1110 xxxx xxxx */ - {GTI,"MKL,%b", 3,20}, /* 2f: 0110 0100 0010 1111 xxxx xxxx */ - - {SUINB,"PA,%b", 3,20}, /* 30: 0110 0100 0011 0000 xxxx xxxx */ - {SUINB,"PB,%b", 3,20}, /* 31: 0110 0100 0011 0001 xxxx xxxx */ - {SUINB,"PC,%b", 3,20}, /* 32: 0110 0100 0011 0010 xxxx xxxx */ - {SUINB,"PD,%b", 3,20}, /* 33: 0110 0100 0011 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 34: 0110 0100 0011 0100 xxxx xxxx */ - {SUINB,"PF,%b", 3,20}, /* 35: 0110 0100 0011 0101 xxxx xxxx */ - {SUINB,"MKH,%b", 3,20}, /* 36: 0110 0100 0011 0110 xxxx xxxx */ - {SUINB,"MKL,%b", 3,20}, /* 37: 0110 0100 0011 0111 xxxx xxxx */ - {LTI,"PA,%b", 3,20}, /* 38: 0110 0100 0011 1000 xxxx xxxx */ - {LTI,"PB,%b", 3,20}, /* 39: 0110 0100 0011 1001 xxxx xxxx */ - {LTI,"PC,%b", 3,20}, /* 3a: 0110 0100 0011 1010 xxxx xxxx */ - {LTI,"PD,%b", 3,20}, /* 3b: 0110 0100 0011 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 3c: 0110 0100 0011 1100 xxxx xxxx */ - {LTI,"PF,%b", 3,20}, /* 3d: 0110 0100 0011 1101 xxxx xxxx */ - {LTI,"MKH,%b", 3,20}, /* 3e: 0110 0100 0011 1110 xxxx xxxx */ - {LTI,"MKL,%b", 3,20}, /* 3f: 0110 0100 0011 1111 xxxx xxxx */ - - {ADI,"PA,%b", 3,20}, /* 40: 0110 0100 0100 0000 xxxx xxxx */ - {ADI,"PB,%b", 3,20}, /* 41: 0110 0100 0100 0001 xxxx xxxx */ - {ADI,"PC,%b", 3,20}, /* 42: 0110 0100 0100 0010 xxxx xxxx */ - {ADI,"PD,%b", 3,20}, /* 43: 0110 0100 0100 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 44: 0110 0100 0100 0100 xxxx xxxx */ - {ADI,"PF,%b", 3,20}, /* 45: 0110 0100 0100 0101 xxxx xxxx */ - {ADI,"MKH,%b", 3,20}, /* 46: 0110 0100 0100 0110 xxxx xxxx */ - {ADI,"MKL,%b", 3,20}, /* 47: 0110 0100 0100 0111 xxxx xxxx */ - {ONI,"PA,%b", 3,20}, /* 48: 0110 0100 0100 1000 xxxx xxxx */ - {ONI,"PB,%b", 3,20}, /* 49: 0110 0100 0100 1001 xxxx xxxx */ - {ONI,"PC,%b", 3,20}, /* 4a: 0110 0100 0100 1010 xxxx xxxx */ - {ONI,"PD,%b", 3,20}, /* 4b: 0110 0100 0100 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 4c: 0110 0100 0100 1100 xxxx xxxx */ - {ONI,"PF,%b", 3,20}, /* 4d: 0110 0100 0100 1101 xxxx xxxx */ - {ONI,"MKH,%b", 3,20}, /* 4e: 0110 0100 0100 1110 xxxx xxxx */ - {ONI,"MKL,%b", 3,20}, /* 4f: 0110 0100 0100 1111 xxxx xxxx */ - - {ACI,"PA,%b", 3,20}, /* 50: 0110 0100 0101 0000 xxxx xxxx */ - {ACI,"PB,%b", 3,20}, /* 51: 0110 0100 0101 0001 xxxx xxxx */ - {ACI,"PC,%b", 3,20}, /* 52: 0110 0100 0101 0010 xxxx xxxx */ - {ACI,"PD,%b", 3,20}, /* 53: 0110 0100 0101 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 54: 0110 0100 0101 0100 xxxx xxxx */ - {ACI,"PF,%b", 3,20}, /* 55: 0110 0100 0101 0101 xxxx xxxx */ - {ACI,"MKH,%b", 3,20}, /* 56: 0110 0100 0101 0110 xxxx xxxx */ - {ACI,"MKL,%b", 3,20}, /* 57: 0110 0100 0101 0111 xxxx xxxx */ - {OFFI,"PA,%b", 3,20}, /* 58: 0110 0100 0101 1000 xxxx xxxx */ - {OFFI,"PB,%b", 3,20}, /* 59: 0110 0100 0101 1001 xxxx xxxx */ - {OFFI,"PC,%b", 3,20}, /* 5a: 0110 0100 0101 1010 xxxx xxxx */ - {OFFI,"PD,%b", 3,20}, /* 5b: 0110 0100 0101 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 5c: 0110 0100 0101 1100 xxxx xxxx */ - {OFFI,"PF,%b", 3,20}, /* 5d: 0110 0100 0101 1101 xxxx xxxx */ - {OFFI,"MKH,%b", 3,20}, /* 5e: 0110 0100 0101 1110 xxxx xxxx */ - {OFFI,"MKL,%b", 3,20}, /* 5f: 0110 0100 0101 1111 xxxx xxxx */ - - {SUI,"PA,%b", 3,20}, /* 60: 0110 0100 0110 0000 xxxx xxxx */ - {SUI,"PB,%b", 3,20}, /* 61: 0110 0100 0110 0001 xxxx xxxx */ - {SUI,"PC,%b", 3,20}, /* 62: 0110 0100 0110 0010 xxxx xxxx */ - {SUI,"PD,%b", 3,20}, /* 63: 0110 0100 0110 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 64: 0110 0100 0110 0100 xxxx xxxx */ - {SUI,"PF,%b", 3,20}, /* 65: 0110 0100 0110 0101 xxxx xxxx */ - {SUI,"MKH,%b", 3,20}, /* 66: 0110 0100 0110 0110 xxxx xxxx */ - {SUI,"MKL,%b", 3,20}, /* 67: 0110 0100 0110 0111 xxxx xxxx */ - {NEI,"PA,%b", 3,20}, /* 68: 0110 0100 0110 1000 xxxx xxxx */ - {NEI,"PB,%b", 3,20}, /* 69: 0110 0100 0110 1001 xxxx xxxx */ - {NEI,"PC,%b", 3,20}, /* 6a: 0110 0100 0110 1010 xxxx xxxx */ - {NEI,"PD,%b", 3,20}, /* 6b: 0110 0100 0110 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 6c: 0110 0100 0110 1100 xxxx xxxx */ - {NEI,"PF,%b", 3,20}, /* 6d: 0110 0100 0110 1101 xxxx xxxx */ - {NEI,"MKH,%b", 3,20}, /* 6e: 0110 0100 0110 1110 xxxx xxxx */ - {NEI,"MKL,%b", 3,20}, /* 6f: 0110 0100 0110 1111 xxxx xxxx */ - - {SBI,"PA,%b", 3,20}, /* 70: 0110 0100 0111 0000 xxxx xxxx */ - {SBI,"PB,%b", 3,20}, /* 71: 0110 0100 0111 0001 xxxx xxxx */ - {SBI,"PC,%b", 3,20}, /* 72: 0110 0100 0111 0010 xxxx xxxx */ - {SBI,"PD,%b", 3,20}, /* 73: 0110 0100 0111 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 74: 0110 0100 0111 0100 xxxx xxxx */ - {SBI,"PF,%b", 3,20}, /* 75: 0110 0100 0111 0101 xxxx xxxx */ - {SBI,"MKH,%b", 3,20}, /* 76: 0110 0100 0111 0110 xxxx xxxx */ - {SBI,"MKL,%b", 3,20}, /* 77: 0110 0100 0111 0111 xxxx xxxx */ - {EQI,"PA,%b", 3,20}, /* 78: 0110 0100 0111 1000 xxxx xxxx */ - {EQI,"PB,%b", 3,20}, /* 79: 0110 0100 0111 1001 xxxx xxxx */ - {EQI,"PC,%b", 3,20}, /* 7a: 0110 0100 0111 1010 xxxx xxxx */ - {EQI,"PD,%b", 3,20}, /* 7b: 0110 0100 0111 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 7c: 0110 0100 0111 1100 xxxx xxxx */ - {EQI,"PF,%b", 3,20}, /* 7d: 0110 0100 0111 1101 xxxx xxxx */ - {EQI,"MKH,%b", 3,20}, /* 7e: 0110 0100 0111 1110 xxxx xxxx */ - {EQI,"MKL,%b", 3,20}, /* 7f: 0110 0100 0111 1111 xxxx xxxx */ - - {illegal,0, 3,20}, /* 80: 0110 0100 1000 0000 xxxx xxxx */ - {MVI,"SMH,%b", 3,14}, /* 81: 0110 0100 1000 0001 xxxx xxxx */ - {illegal,0, 3,14}, /* 82: 0110 0100 1000 0010 xxxx xxxx */ - {MVI,"EOM,%b", 3,14}, /* 83: 0110 0100 1000 0011 xxxx xxxx */ - {illegal,0, 3,14}, /* 84: 0110 0100 1000 0100 xxxx xxxx */ - {MVI,"TMM,%b", 3,14}, /* 85: 0110 0100 1000 0101 xxxx xxxx */ - {illegal,0, 3,14}, /* 86: 0110 0100 1000 0110 xxxx xxxx */ - {illegal,0, 3,14}, /* 87: 0110 0100 1000 0111 xxxx xxxx */ - {illegal,0, 3,20}, /* 88: 0110 0100 1000 1000 xxxx xxxx */ - {ANI,"SMH,%b", 3,20}, /* 89: 0110 0100 1000 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* 8a: 0110 0100 1000 1010 xxxx xxxx */ - {ANI,"EOM,%b", 3,20}, /* 8b: 0110 0100 1000 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 8c: 0110 0100 1000 1100 xxxx xxxx */ - {ANI,"TMM,%b", 3,20}, /* 8d: 0110 0100 1000 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* 8e: 0110 0100 1000 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* 8f: 0110 0100 1000 1111 xxxx xxxx */ - - {illegal,0, 3,20}, /* 90: 0110 0100 1001 0000 xxxx xxxx */ - {XRI,"SMH,%b", 3,20}, /* 91: 0110 0100 1001 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* 92: 0110 0100 1001 0010 xxxx xxxx */ - {XRI,"EOM,%b", 3,20}, /* 93: 0110 0100 1001 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* 94: 0110 0100 1001 0100 xxxx xxxx */ - {XRI,"TMM,%b", 3,20}, /* 95: 0110 0100 1001 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* 96: 0110 0100 1001 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* 97: 0110 0100 1001 0111 xxxx xxxx */ - {illegal,0, 3,20}, /* 98: 0110 0100 1001 1000 xxxx xxxx */ - {ORI,"SMH,%b", 3,20}, /* 99: 0110 0100 1001 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* 9a: 0110 0100 1001 1010 xxxx xxxx */ - {ORI,"EOM,%b", 3,20}, /* 9b: 0110 0100 1001 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* 9c: 0110 0100 1001 1100 xxxx xxxx */ - {ORI,"TMM,%b", 3,20}, /* 9d: 0110 0100 1001 1101 xxxx xxxx */ - {illegal,0, 3,20}, /* 9e: 0110 0100 1001 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* 9f: 0110 0100 1001 1111 xxxx xxxx */ - - {illegal,0, 3,20}, /* a0: 0110 0100 1010 0000 xxxx xxxx */ - {ADINC,"SMH,%b", 3,20}, /* a1: 0110 0100 1010 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* a2: 0110 0100 1010 0010 xxxx xxxx */ - {ADINC,"EOM,%b", 3,20}, /* a3: 0110 0100 1010 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* a4: 0110 0100 1010 0100 xxxx xxxx */ - {ADINC,"TMM,%b", 3,20}, /* a5: 0110 0100 1010 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* a6: 0110 0100 1010 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* a7: 0110 0100 1010 0111 xxxx xxxx */ - {illegal,0, 3,20}, /* a8: 0110 0100 1010 1000 xxxx xxxx */ - {GTI,"SMH,%b", 3,20}, /* a9: 0110 0100 1010 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* aa: 0110 0100 1010 1010 xxxx xxxx */ - {GTI,"EOM,%b", 3,20}, /* ab: 0110 0100 1010 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* ac: 0110 0100 1010 1100 xxxx xxxx */ - {GTI,"TMM,%b", 3,20}, /* ad: 0110 0100 1010 1101 xxxx xxxx */ - {GTI,"PT,%b", 3,20}, /* ae: 0110 0100 1010 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* af: 0110 0100 1010 1111 xxxx xxxx */ - - {illegal,0, 3,20}, /* b0: 0110 0100 1011 0000 xxxx xxxx */ - {SUINB,"SMH,%b", 3,20}, /* b1: 0110 0100 1011 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* b2: 0110 0100 1011 0010 xxxx xxxx */ - {SUINB,"EOM,%b", 3,20}, /* b3: 0110 0100 1011 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* b4: 0110 0100 1011 0100 xxxx xxxx */ - {SUINB,"TMM,%b", 3,20}, /* b5: 0110 0100 1011 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* b6: 0110 0100 1011 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* b7: 0110 0100 1011 0111 xxxx xxxx */ - {illegal,0, 3,20}, /* b8: 0110 0100 1011 1000 xxxx xxxx */ - {LTI,"SMH,%b", 3,20}, /* b9: 0110 0100 1011 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* ba: 0110 0100 1011 1010 xxxx xxxx */ - {LTI,"EOM,%b", 3,20}, /* bb: 0110 0100 1011 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* bc: 0110 0100 1011 1100 xxxx xxxx */ - {LTI,"TMM,%b", 3,20}, /* bd: 0110 0100 1011 1101 xxxx xxxx */ - {LTI,"PT,%b", 3,20}, /* be: 0110 0100 1011 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* bf: 0110 0100 1011 1111 xxxx xxxx */ - - {illegal,0, 3,20}, /* c0: 0110 0100 1100 0000 xxxx xxxx */ - {ADI,"SMH,%b", 3,20}, /* c1: 0110 0100 1100 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* c2: 0110 0100 1100 0010 xxxx xxxx */ - {ADI,"EOM,%b", 3,20}, /* c3: 0110 0100 1100 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* c4: 0110 0100 1100 0100 xxxx xxxx */ - {ADI,"TMM,%b", 3,20}, /* c5: 0110 0100 1100 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* c6: 0110 0100 1100 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* c7: 0110 0100 1100 0111 xxxx xxxx */ - {illegal,0, 3,20}, /* c8: 0110 0100 1100 1000 xxxx xxxx */ - {ONI,"SMH,%b", 3,20}, /* c9: 0110 0100 1100 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* ca: 0110 0100 1100 1010 xxxx xxxx */ - {ONI,"EOM,%b", 3,20}, /* cb: 0110 0100 1100 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* cc: 0110 0100 1100 1100 xxxx xxxx */ - {ONI,"TMM,%b", 3,20}, /* cd: 0110 0100 1100 1101 xxxx xxxx */ - {ONI,"PT,%b", 3,20}, /* ce: 0110 0100 1100 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* cf: 0110 0100 1100 1111 xxxx xxxx */ - - {illegal,0, 3,20}, /* d0: 0110 0100 1101 0000 xxxx xxxx */ - {ACI,"SMH,%b", 3,20}, /* d1: 0110 0100 1101 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* d2: 0110 0100 1101 0010 xxxx xxxx */ - {ACI,"EOM,%b", 3,20}, /* d3: 0110 0100 1101 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* d4: 0110 0100 1101 0100 xxxx xxxx */ - {ACI,"TMM,%b", 3,20}, /* d5: 0110 0100 1101 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* d6: 0110 0100 1101 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* d7: 0110 0100 1101 0111 xxxx xxxx */ - {illegal,0, 3,20}, /* d8: 0110 0100 1101 1000 xxxx xxxx */ - {OFFI,"SMH,%b", 3,20}, /* d9: 0110 0100 1101 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* da: 0110 0100 1101 1010 xxxx xxxx */ - {OFFI,"EOM,%b", 3,20}, /* db: 0110 0100 1101 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* dc: 0110 0100 1101 1100 xxxx xxxx */ - {OFFI,"TMM,%b", 3,20}, /* dd: 0110 0100 1101 1101 xxxx xxxx */ - {OFFI,"PT,%b", 3,20}, /* de: 0110 0100 1101 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* df: 0110 0100 1101 1111 xxxx xxxx */ - - {illegal,0, 3,20}, /* e0: 0110 0100 1110 0000 xxxx xxxx */ - {SUI,"SMH,%b", 3,20}, /* e1: 0110 0100 1110 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* e2: 0110 0100 1110 0010 xxxx xxxx */ - {SUI,"EOM,%b", 3,20}, /* e3: 0110 0100 1110 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* e4: 0110 0100 1110 0100 xxxx xxxx */ - {SUI,"TMM,%b", 3,20}, /* e5: 0110 0100 1110 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* e6: 0110 0100 1110 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* e7: 0110 0100 1110 0111 xxxx xxxx */ - {illegal,0, 3,20}, /* e8: 0110 0100 1110 1000 xxxx xxxx */ - {NEI,"SMH,%b", 3,20}, /* e9: 0110 0100 1110 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* ea: 0110 0100 1110 1010 xxxx xxxx */ - {NEI,"EOM,%b", 3,20}, /* eb: 0110 0100 1110 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* ec: 0110 0100 1110 1100 xxxx xxxx */ - {NEI,"TMM,%b", 3,20}, /* ed: 0110 0100 1110 1101 xxxx xxxx */ - {NEI,"PT,%b", 3,20}, /* ee: 0110 0100 1110 1110 xxxx xxxx */ - {illegal,0, 3,20}, /* ef: 0110 0100 1110 1111 xxxx xxxx */ - - {illegal,0, 3,20}, /* f0: 0110 0100 1111 0000 xxxx xxxx */ - {SBI,"SMH,%b", 3,20}, /* f1: 0110 0100 1111 0001 xxxx xxxx */ - {illegal,0, 3,20}, /* f2: 0110 0100 1111 0010 xxxx xxxx */ - {SBI,"EOM,%b", 3,20}, /* f3: 0110 0100 1111 0011 xxxx xxxx */ - {illegal,0, 3,20}, /* f4: 0110 0100 1111 0100 xxxx xxxx */ - {SBI,"TMM,%b", 3,20}, /* f5: 0110 0100 1111 0101 xxxx xxxx */ - {illegal,0, 3,20}, /* f6: 0110 0100 1111 0110 xxxx xxxx */ - {illegal,0, 3,20}, /* f7: 0110 0100 1111 0111 xxxx xxxx */ - {illegal,0, 3,20}, /* f8: 0110 0100 1111 1000 xxxx xxxx */ - {EQI,"SMH,%b", 3,20}, /* f9: 0110 0100 1111 1001 xxxx xxxx */ - {illegal,0, 3,20}, /* fa: 0110 0100 1111 1010 xxxx xxxx */ - {EQI,"EOM,%b", 3,20}, /* fb: 0110 0100 1111 1011 xxxx xxxx */ - {illegal,0, 3,20}, /* fc: 0110 0100 1111 1100 xxxx xxxx */ - {EQI,"TMM,%b", 3,20}, /* fd: 0110 0100 1111 1101 xxxx xxxx */ - {EQI,"PT,%b", 3,20}, /* fe: 0110 0100 1111 1110 xxxx xxxx */ - {illegal,0, 3,20} /* ff: 0110 0100 1111 1111 xxxx xxxx */ -}; - -/* prefix 70 */ -static struct dasm_s dasm70[256] = -{ - {illegal,0, 2, 8}, /* 00: 0111 0000 0000 0000 */ - {illegal,0, 2, 8}, /* 01: 0111 0000 0000 0001 */ - {illegal,0, 2, 8}, /* 02: 0111 0000 0000 0010 */ - {illegal,0, 2, 8}, /* 03: 0111 0000 0000 0011 */ - {illegal,0, 2, 8}, /* 04: 0111 0000 0000 0100 */ - {illegal,0, 2, 8}, /* 05: 0111 0000 0000 0101 */ - {illegal,0, 2, 8}, /* 06: 0111 0000 0000 0110 */ - {illegal,0, 2, 8}, /* 07: 0111 0000 0000 0111 */ - {illegal,0, 2, 8}, /* 08: 0111 0000 0000 1000 */ - {illegal,0, 2, 8}, /* 09: 0111 0000 0000 1001 */ - {illegal,0, 2, 8}, /* 0a: 0111 0000 0000 1010 */ - {illegal,0, 2, 8}, /* 0b: 0111 0000 0000 1011 */ - {illegal,0, 2, 8}, /* 0c: 0111 0000 0000 1100 */ - {illegal,0, 2, 8}, /* 0d: 0111 0000 0000 1101 */ - {SSPD,"%w", 4,20}, /* 0e: 0111 0000 0000 1110 llll llll hhhh hhhh */ - {LSPD,"%w", 4,20}, /* 0f: 0111 0000 0000 1111 llll llll hhhh hhhh */ - - {illegal,0, 2, 8}, /* 10: 0111 0000 0001 0000 */ - {illegal,0, 2, 8}, /* 11: 0111 0000 0001 0001 */ - {illegal,0, 2, 8}, /* 12: 0111 0000 0001 0010 */ - {illegal,0, 2, 8}, /* 13: 0111 0000 0001 0011 */ - {illegal,0, 2, 8}, /* 14: 0111 0000 0001 0100 */ - {illegal,0, 2, 8}, /* 15: 0111 0000 0001 0101 */ - {illegal,0, 2, 8}, /* 16: 0111 0000 0001 0110 */ - {illegal,0, 2, 8}, /* 17: 0111 0000 0001 0111 */ - {illegal,0, 2, 8}, /* 18: 0111 0000 0001 1000 */ - {illegal,0, 2, 8}, /* 19: 0111 0000 0001 1001 */ - {illegal,0, 2, 8}, /* 1a: 0111 0000 0001 1010 */ - {illegal,0, 2, 8}, /* 1b: 0111 0000 0001 1011 */ - {illegal,0, 2, 8}, /* 1c: 0111 0000 0001 1100 */ - {illegal,0, 2, 8}, /* 1d: 0111 0000 0001 1101 */ - {SBCD,"%w", 4,20}, /* 1e: 0111 0000 0001 1110 llll llll hhhh hhhh */ - {LBCD,"%w", 4,20}, /* 1f: 0111 0000 0001 1111 llll llll hhhh hhhh */ - - {illegal,0, 2, 8}, /* 20: 0111 0000 0010 0000 */ - {illegal,0, 2, 8}, /* 21: 0111 0000 0010 0001 */ - {illegal,0, 2, 8}, /* 22: 0111 0000 0010 0010 */ - {illegal,0, 2, 8}, /* 23: 0111 0000 0010 0011 */ - {illegal,0, 2, 8}, /* 24: 0111 0000 0010 0100 */ - {illegal,0, 2, 8}, /* 25: 0111 0000 0010 0101 */ - {illegal,0, 2, 8}, /* 26: 0111 0000 0010 0110 */ - {illegal,0, 2, 8}, /* 27: 0111 0000 0010 0111 */ - {illegal,0, 2, 8}, /* 28: 0111 0000 0010 1000 */ - {illegal,0, 2, 8}, /* 29: 0111 0000 0010 1001 */ - {illegal,0, 2, 8}, /* 2a: 0111 0000 0010 1010 */ - {illegal,0, 2, 8}, /* 2b: 0111 0000 0010 1011 */ - {illegal,0, 2, 8}, /* 2c: 0111 0000 0010 1100 */ - {illegal,0, 2, 8}, /* 2d: 0111 0000 0010 1101 */ - {SDED,"%w", 4,20}, /* 2e: 0111 0000 0010 1110 llll llll hhhh hhhh */ - {LDED,"%w", 4,20}, /* 2f: 0111 0000 0010 1111 llll llll hhhh hhhh */ - - {illegal,0, 2, 8}, /* 30: 0111 0000 0011 0000 */ - {illegal,0, 2, 8}, /* 31: 0111 0000 0011 0001 */ - {illegal,0, 2, 8}, /* 32: 0111 0000 0011 0010 */ - {illegal,0, 2, 8}, /* 33: 0111 0000 0011 0011 */ - {illegal,0, 2, 8}, /* 34: 0111 0000 0011 0100 */ - {illegal,0, 2, 8}, /* 35: 0111 0000 0011 0101 */ - {illegal,0, 2, 8}, /* 36: 0111 0000 0011 0110 */ - {illegal,0, 2, 8}, /* 37: 0111 0000 0011 0111 */ - {illegal,0, 2, 8}, /* 38: 0111 0000 0011 1000 */ - {illegal,0, 2, 8}, /* 39: 0111 0000 0011 1001 */ - {illegal,0, 2, 8}, /* 3a: 0111 0000 0011 1010 */ - {illegal,0, 2, 8}, /* 3b: 0111 0000 0011 1011 */ - {illegal,0, 2, 8}, /* 3c: 0111 0000 0011 1100 */ - {illegal,0, 2, 8}, /* 3d: 0111 0000 0011 1101 */ - {SHLD,"%w", 4,20}, /* 3e: 0111 0000 0011 1110 llll llll hhhh hhhh */ - {LHLD,"%w", 4,20}, /* 3f: 0111 0000 0011 1111 llll llll hhhh hhhh */ - - {EADD,"EA,V", 2,11}, /* 40: 0111 0000 0100 0000 */ - {EADD,"EA,A", 2,11}, /* 41: 0111 0000 0100 0001 */ - {EADD,"EA,B", 2,11}, /* 42: 0111 0000 0100 0010 */ - {EADD,"EA,C", 2,11}, /* 43: 0111 0000 0100 0011 */ - {illegal,0, 2, 8}, /* 44: 0111 0000 0100 0100 */ - {illegal,0, 2, 8}, /* 45: 0111 0000 0100 0101 */ - {illegal,0, 2, 8}, /* 46: 0111 0000 0100 0110 */ - {illegal,0, 2, 8}, /* 47: 0111 0000 0100 0111 */ - {illegal,0, 2, 8}, /* 48: 0111 0000 0100 1000 */ - {illegal,0, 2, 8}, /* 49: 0111 0000 0100 1001 */ - {illegal,0, 2, 8}, /* 4a: 0111 0000 0100 1010 */ - {illegal,0, 2, 8}, /* 4b: 0111 0000 0100 1011 */ - {illegal,0, 2, 8}, /* 4c: 0111 0000 0100 1100 */ - {illegal,0, 2, 8}, /* 4d: 0111 0000 0100 1101 */ - {illegal,0, 2, 8}, /* 4e: 0111 0000 0100 1110 */ - {illegal,0, 2, 8}, /* 4f: 0111 0000 0100 1111 */ - - {illegal,0, 2, 8}, /* 50: 0111 0000 0101 0000 */ - {illegal,0, 2, 8}, /* 51: 0111 0000 0101 0001 */ - {illegal,0, 2, 8}, /* 52: 0111 0000 0101 0010 */ - {illegal,0, 2, 8}, /* 53: 0111 0000 0101 0011 */ - {illegal,0, 2, 8}, /* 54: 0111 0000 0101 0100 */ - {illegal,0, 2, 8}, /* 55: 0111 0000 0101 0101 */ - {illegal,0, 2, 8}, /* 56: 0111 0000 0101 0110 */ - {illegal,0, 2, 8}, /* 57: 0111 0000 0101 0111 */ - {illegal,0, 2, 8}, /* 58: 0111 0000 0101 1000 */ - {illegal,0, 2, 8}, /* 59: 0111 0000 0101 1001 */ - {illegal,0, 2, 8}, /* 5a: 0111 0000 0101 1010 */ - {illegal,0, 2, 8}, /* 5b: 0111 0000 0101 1011 */ - {illegal,0, 2, 8}, /* 5c: 0111 0000 0101 1100 */ - {illegal,0, 2, 8}, /* 5d: 0111 0000 0101 1101 */ - {illegal,0, 2, 8}, /* 5e: 0111 0000 0101 1110 */ - {illegal,0, 2, 8}, /* 5f: 0111 0000 0101 1111 */ - - {ESUB,"EA,V", 2,11}, /* 60: 0111 0000 0110 0000 */ - {ESUB,"EA,A", 2,11}, /* 61: 0111 0000 0110 0001 */ - {ESUB,"EA,B", 2,11}, /* 62: 0111 0000 0110 0010 */ - {ESUB,"EA,C", 2,11}, /* 63: 0111 0000 0110 0011 */ - {illegal,0, 2, 8}, /* 64: 0111 0000 0110 0100 */ - {illegal,0, 2, 8}, /* 65: 0111 0000 0110 0101 */ - {illegal,0, 2, 8}, /* 66: 0111 0000 0110 0110 */ - {illegal,0, 2, 8}, /* 67: 0111 0000 0110 0111 */ - {MOV,"V,(%w)", 4,17}, /* 68: 0111 0000 0110 1000 llll llll hhhh hhhh */ - {MOV,"A,(%w)", 4,17}, /* 69: 0111 0000 0110 1001 llll llll hhhh hhhh */ - {MOV,"B,(%w)", 4,17}, /* 6a: 0111 0000 0110 1010 llll llll hhhh hhhh */ - {MOV,"C,(%w)", 4,17}, /* 6b: 0111 0000 0110 1011 llll llll hhhh hhhh */ - {MOV,"D,(%w)", 4,17}, /* 6c: 0111 0000 0110 1100 llll llll hhhh hhhh */ - {MOV,"E,(%w)", 4,17}, /* 6d: 0111 0000 0110 1101 llll llll hhhh hhhh */ - {MOV,"H,(%w)", 4,17}, /* 6e: 0111 0000 0110 1110 llll llll hhhh hhhh */ - {MOV,"L,(%w)", 4,17}, /* 6f: 0111 0000 0110 1111 llll llll hhhh hhhh */ - - {illegal,0, 2, 8}, /* 70: 0111 0000 0111 0000 */ - {illegal,0, 2, 8}, /* 71: 0111 0000 0111 0001 */ - {illegal,0, 2, 8}, /* 72: 0111 0000 0111 0010 */ - {illegal,0, 2, 8}, /* 73: 0111 0000 0111 0011 */ - {illegal,0, 2, 8}, /* 74: 0111 0000 0111 0100 */ - {illegal,0, 2, 8}, /* 75: 0111 0000 0111 0101 */ - {illegal,0, 2, 8}, /* 76: 0111 0000 0111 0110 */ - {illegal,0, 2, 8}, /* 77: 0111 0000 0111 0111 */ - {MOV,"(%w),V", 4,17}, /* 78: 0111 0000 0111 1000 llll llll hhhh hhhh */ - {MOV,"(%w),A", 4,17}, /* 79: 0111 0000 0111 1001 llll llll hhhh hhhh */ - {MOV,"(%w),B", 4,17}, /* 7a: 0111 0000 0111 1010 llll llll hhhh hhhh */ - {MOV,"(%w),C", 4,17}, /* 7b: 0111 0000 0111 1011 llll llll hhhh hhhh */ - {MOV,"(%w),D", 4,17}, /* 7c: 0111 0000 0111 1100 llll llll hhhh hhhh */ - {MOV,"(%w),E", 4,17}, /* 7d: 0111 0000 0111 1101 llll llll hhhh hhhh */ - {MOV,"(%w),H", 4,17}, /* 7e: 0111 0000 0111 1110 llll llll hhhh hhhh */ - {MOV,"(%w),L", 4,17}, /* 7f: 0111 0000 0111 1111 llll llll hhhh hhhh */ - - {illegal,0, 2, 8}, /* 80: 0111 0000 1000 0000 */ - {illegal,0, 2, 8}, /* 81: 0111 0000 1000 0001 */ - {illegal,0, 2, 8}, /* 82: 0111 0000 1000 0010 */ - {illegal,0, 2, 8}, /* 83: 0111 0000 1000 0011 */ - {illegal,0, 2, 8}, /* 84: 0111 0000 1000 0100 */ - {illegal,0, 2, 8}, /* 85: 0111 0000 1000 0101 */ - {illegal,0, 2, 8}, /* 86: 0111 0000 1000 0110 */ - {illegal,0, 2, 8}, /* 87: 0111 0000 1000 0111 */ - {illegal,0, 2,11}, /* 88: 0111 0000 1000 1000 */ - {ANAX,"(BC)", 2,11}, /* 89: 0111 0000 1000 1001 */ - {ANAX,"(DE)", 2,11}, /* 8a: 0111 0000 1000 1010 */ - {ANAX,"(HL)", 2,11}, /* 8b: 0111 0000 1000 1011 */ - {ANAX,"(DE+)", 2,11}, /* 8c: 0111 0000 1000 1100 */ - {ANAX,"(HL+)", 2,11}, /* 8d: 0111 0000 1000 1101 */ - {ANAX,"(DE-)", 2,11}, /* 8e: 0111 0000 1000 1110 */ - {ANAX,"(HL-)", 2,11}, /* 8f: 0111 0000 1000 1111 */ - - {illegal,0, 2,11}, /* 90: 0111 0000 1001 0000 */ - {XRAX,"(BC)", 2,11}, /* 91: 0111 0000 1001 0001 */ - {XRAX,"(DE)", 2,11}, /* 92: 0111 0000 1001 0010 */ - {XRAX,"(HL)", 2,11}, /* 93: 0111 0000 1001 0011 */ - {XRAX,"(DE+)", 2,11}, /* 94: 0111 0000 1001 0100 */ - {XRAX,"(HL+)", 2,11}, /* 95: 0111 0000 1001 0101 */ - {XRAX,"(DE-)", 2,11}, /* 96: 0111 0000 1001 0110 */ - {XRAX,"(HL-)", 2,11}, /* 97: 0111 0000 1001 0111 */ - {illegal,0, 2, 8}, /* 98: 0111 0000 1001 1000 */ - {ORAX,"(BC)", 2, 8}, /* 99: 0111 0000 1001 1001 */ - {ORAX,"(DE)", 2, 8}, /* 9a: 0111 0000 1001 1010 */ - {ORAX,"(HL)", 2, 8}, /* 9b: 0111 0000 1001 1011 */ - {ORAX,"(DE+)", 2, 8}, /* 9c: 0111 0000 1001 1100 */ - {ORAX,"(HL+)", 2, 8}, /* 9d: 0111 0000 1001 1101 */ - {ORAX,"(DE-)", 2, 8}, /* 9e: 0111 0000 1001 1110 */ - {ORAX,"(HL-)", 2, 8}, /* 9f: 0111 0000 1001 1111 */ - - {illegal,0, 2,11}, /* a0: 0111 0000 1010 0000 */ - {ADDNCX,"(BC)", 2,11}, /* a1: 0111 0000 1010 0001 */ - {ADDNCX,"(DE)", 2,11}, /* a2: 0111 0000 1010 0010 */ - {ADDNCX,"(HL)", 2,11}, /* a3: 0111 0000 1010 0011 */ - {ADDNCX,"(DE+)", 2,11}, /* a4: 0111 0000 1010 0100 */ - {ADDNCX,"(HL+)", 2,11}, /* a5: 0111 0000 1010 0101 */ - {ADDNCX,"(DE-)", 2,11}, /* a6: 0111 0000 1010 0110 */ - {ADDNCX,"(HL-)", 2,11}, /* a7: 0111 0000 1010 0111 */ - {illegal,0, 2,11}, /* a8: 0111 0000 1010 1000 */ - {GTAX,"(BC)", 2,11}, /* a9: 0111 0000 1010 1001 */ - {GTAX,"(DE)", 2,11}, /* aa: 0111 0000 1010 1010 */ - {GTAX,"(HL)", 2,11}, /* ab: 0111 0000 1010 1011 */ - {GTAX,"(DE+)", 2,11}, /* ac: 0111 0000 1010 1100 */ - {GTAX,"(HL+)", 2,11}, /* ad: 0111 0000 1010 1101 */ - {GTAX,"(DE-)", 2,11}, /* ae: 0111 0000 1010 1110 */ - {GTAX,"(HL-)", 2,11}, /* af: 0111 0000 1010 1111 */ - - {illegal,0, 2,11}, /* b0: 0111 0000 1011 0000 */ - {SUBNBX,"(BC)", 2,11}, /* b1: 0111 0000 1011 0001 */ - {SUBNBX,"(DE)", 2,11}, /* b2: 0111 0000 1011 0010 */ - {SUBNBX,"(HL)", 2,11}, /* b3: 0111 0000 1011 0011 */ - {SUBNBX,"(DE+)", 2,11}, /* b4: 0111 0000 1011 0100 */ - {SUBNBX,"(HL+)", 2,11}, /* b5: 0111 0000 1011 0101 */ - {SUBNBX,"(DE-)", 2,11}, /* b6: 0111 0000 1011 0110 */ - {SUBNBX,"(HL-)", 2,11}, /* b7: 0111 0000 1011 0111 */ - {illegal,0, 2,11}, /* b8: 0111 0000 1011 1000 */ - {LTAX,"(BC)", 2,11}, /* b9: 0111 0000 1011 1001 */ - {LTAX,"(DE)", 2,11}, /* ba: 0111 0000 1011 1010 */ - {LTAX,"(HL)", 2,11}, /* bb: 0111 0000 1011 1011 */ - {LTAX,"(DE+)", 2,11}, /* bc: 0111 0000 1011 1100 */ - {LTAX,"(HL+)", 2,11}, /* bd: 0111 0000 1011 1101 */ - {LTAX,"(DE-)", 2,11}, /* be: 0111 0000 1011 1110 */ - {LTAX,"(HL-)", 2,11}, /* bf: 0111 0000 1011 1111 */ - - {illegal,0, 2,11}, /* c0: 0111 0000 1100 0000 */ - {ADDX,"(BC)", 2,11}, /* c1: 0111 0000 1100 0001 */ - {ADDX,"(DE)", 2,11}, /* c2: 0111 0000 1100 0010 */ - {ADDX,"(HL)", 2,11}, /* c3: 0111 0000 1100 0011 */ - {ADDX,"(DE+)", 2,11}, /* c4: 0111 0000 1100 0100 */ - {ADDX,"(HL+)", 2,11}, /* c5: 0111 0000 1100 0101 */ - {ADDX,"(DE-)", 2,11}, /* c6: 0111 0000 1100 0110 */ - {ADDX,"(HL-)", 2,11}, /* c7: 0111 0000 1100 0111 */ - {illegal,0, 2,11}, /* c8: 0111 0000 1100 1000 */ - {ONAX,"(BC)", 2,11}, /* c9: 0111 0000 1100 1001 */ - {ONAX,"(DE)", 2,11}, /* ca: 0111 0000 1100 1010 */ - {ONAX,"(HL)", 2,11}, /* cb: 0111 0000 1100 1011 */ - {ONAX,"(DE+)", 2,11}, /* cc: 0111 0000 1100 1100 */ - {ONAX,"(HL+)", 2,11}, /* cd: 0111 0000 1100 1101 */ - {ONAX,"(DE-)", 2,11}, /* ce: 0111 0000 1100 1110 */ - {ONAX,"(HL-)", 2,11}, /* cf: 0111 0000 1100 1111 */ - - {illegal,0, 2,11}, /* d0: 0111 0000 1101 0000 */ - {ADCX,"(BC)", 2,11}, /* d1: 0111 0000 1101 0001 */ - {ADCX,"(DE)", 2,11}, /* d2: 0111 0000 1101 0010 */ - {ADCX,"(HL)", 2,11}, /* d3: 0111 0000 1101 0011 */ - {ADCX,"(DE+)", 2,11}, /* d4: 0111 0000 1101 0100 */ - {ADCX,"(HL+)", 2,11}, /* d5: 0111 0000 1101 0101 */ - {ADCX,"(DE-)", 2,11}, /* d6: 0111 0000 1101 0110 */ - {ADCX,"(HL-)", 2,11}, /* d7: 0111 0000 1101 0111 */ - {illegal,0, 2,11}, /* d8: 0111 0000 1101 1000 */ - {OFFAX,"(BC)", 2,11}, /* d9: 0111 0000 1101 1001 */ - {OFFAX,"(DE)", 2,11}, /* da: 0111 0000 1101 1010 */ - {OFFAX,"(HL)", 2,11}, /* db: 0111 0000 1101 1011 */ - {OFFAX,"(DE+)", 2,11}, /* dc: 0111 0000 1101 1100 */ - {OFFAX,"(HL+)", 2,11}, /* dd: 0111 0000 1101 1101 */ - {OFFAX,"(DE-)", 2,11}, /* de: 0111 0000 1101 1110 */ - {OFFAX,"(HL-)", 2,11}, /* df: 0111 0000 1101 1111 */ - - {illegal,0, 2,11}, /* e0: 0111 0000 1110 0000 */ - {SUBX,"(BC)", 2,11}, /* e1: 0111 0000 1110 0001 */ - {SUBX,"(DE)", 2,11}, /* e2: 0111 0000 1110 0010 */ - {SUBX,"(HL)", 2,11}, /* e3: 0111 0000 1110 0011 */ - {SUBX,"(DE+)", 2,11}, /* e4: 0111 0000 1110 0100 */ - {SUBX,"(HL+)", 2,11}, /* e5: 0111 0000 1110 0101 */ - {SUBX,"(DE-)", 2,11}, /* e6: 0111 0000 1110 0110 */ - {SUBX,"(HL-)", 2,11}, /* e7: 0111 0000 1110 0111 */ - {illegal,0, 2,11}, /* e8: 0111 0000 1110 1000 */ - {NEAX,"(BC)", 2,11}, /* e9: 0111 0000 1110 1001 */ - {NEAX,"(DE)", 2,11}, /* ea: 0111 0000 1110 1010 */ - {NEAX,"(HL)", 2,11}, /* eb: 0111 0000 1110 1011 */ - {NEAX,"(DE+)", 2,11}, /* ec: 0111 0000 1110 1100 */ - {NEAX,"(HL+)", 2,11}, /* ed: 0111 0000 1110 1101 */ - {NEAX,"(DE-)", 2,11}, /* ee: 0111 0000 1110 1110 */ - {NEAX,"(HL-)", 2,11}, /* ef: 0111 0000 1110 1111 */ - - {illegal,0, 2,11}, /* f0: 0111 0000 1111 0000 */ - {SBBX,"(BC)", 2,11}, /* f1: 0111 0000 1111 0001 */ - {SBBX,"(DE)", 2,11}, /* f2: 0111 0000 1111 0010 */ - {SBBX,"(HL)", 2,11}, /* f3: 0111 0000 1111 0011 */ - {SBBX,"(DE+)", 2,11}, /* f4: 0111 0000 1111 0100 */ - {SBBX,"(HL+)", 2,11}, /* f5: 0111 0000 1111 0101 */ - {SBBX,"(DE-)", 2,11}, /* f6: 0111 0000 1111 0110 */ - {SBBX,"(HL-)", 2,11}, /* f7: 0111 0000 1111 0111 */ - {illegal,0, 2,11}, /* f8: 0111 0000 1111 1000 */ - {EQAX,"(BC)", 2,11}, /* f9: 0111 0000 1111 1001 */ - {EQAX,"(DE)", 2,11}, /* fa: 0111 0000 1111 1010 */ - {EQAX,"(HL)", 2,11}, /* fb: 0111 0000 1111 1011 */ - {EQAX,"(DE+)", 2,11}, /* fc: 0111 0000 1111 1100 */ - {EQAX,"(HL+)", 2,11}, /* fd: 0111 0000 1111 1101 */ - {EQAX,"(DE-)", 2,11}, /* fe: 0111 0000 1111 1110 */ - {EQAX,"(HL-)", 2,11} /* ff: 0111 0000 1111 1111 */ -}; - -/* prefix 74 */ -static struct dasm_s dasm74[256] = -{ - {illegal,0, 2, 8}, /* 00: 0111 0100 0000 0000 */ - {illegal,0, 2, 8}, /* 01: 0111 0100 0000 0001 */ - {illegal,0, 2, 8}, /* 02: 0111 0100 0000 0010 */ - {illegal,0, 2, 8}, /* 03: 0111 0100 0000 0011 */ - {illegal,0, 2, 8}, /* 04: 0111 0100 0000 0100 */ - {illegal,0, 2, 8}, /* 05: 0111 0100 0000 0101 */ - {illegal,0, 2, 8}, /* 06: 0111 0100 0000 0110 */ - {illegal,0, 2, 8}, /* 07: 0111 0100 0000 0111 */ - {ANI,"V,%b", 3,11}, /* 08: 0111 0100 0000 1000 xxxx xxxx */ - {ANI,"A,%b", 3,11}, /* 09: 0111 0100 0000 1001 xxxx xxxx */ - {ANI,"B,%b", 3,11}, /* 0a: 0111 0100 0000 1010 xxxx xxxx */ - {ANI,"C,%b", 3,11}, /* 0b: 0111 0100 0000 1011 xxxx xxxx */ - {ANI,"D,%b", 3,11}, /* 0c: 0111 0100 0000 1100 xxxx xxxx */ - {ANI,"E,%b", 3,11}, /* 0d: 0111 0100 0000 1101 xxxx xxxx */ - {ANI,"H,%b", 3,11}, /* 0e: 0111 0100 0000 1110 xxxx xxxx */ - {ANI,"L,%b", 3,11}, /* 0f: 0111 0100 0000 1111 xxxx xxxx */ - - {XRI,"V,%b", 3,11}, /* 10: 0111 0100 0001 0000 xxxx xxxx */ - {XRI,"A,%b", 3,11}, /* 11: 0111 0100 0001 0001 xxxx xxxx */ - {XRI,"B,%b", 3,11}, /* 12: 0111 0100 0001 0010 xxxx xxxx */ - {XRI,"C,%b", 3,11}, /* 13: 0111 0100 0001 0011 xxxx xxxx */ - {XRI,"D,%b", 3,11}, /* 14: 0111 0100 0001 0100 xxxx xxxx */ - {XRI,"E,%b", 3,11}, /* 15: 0111 0100 0001 0101 xxxx xxxx */ - {XRI,"H,%b", 3,11}, /* 16: 0111 0100 0001 0110 xxxx xxxx */ - {XRI,"L,%b", 3,11}, /* 17: 0111 0100 0001 0111 xxxx xxxx */ - {ORI,"V,%b", 3,11}, /* 18: 0111 0100 0001 1000 xxxx xxxx */ - {ORI,"A,%b", 3,11}, /* 19: 0111 0100 0001 1001 xxxx xxxx */ - {ORI,"B,%b", 3,11}, /* 1a: 0111 0100 0001 1010 xxxx xxxx */ - {ORI,"C,%b", 3,11}, /* 1b: 0111 0100 0001 1011 xxxx xxxx */ - {ORI,"D,%b", 3,11}, /* 1c: 0111 0100 0001 1100 xxxx xxxx */ - {ORI,"E,%b", 3,11}, /* 1d: 0111 0100 0001 1101 xxxx xxxx */ - {ORI,"H,%b", 3,11}, /* 1e: 0111 0100 0001 1110 xxxx xxxx */ - {ORI,"L,%b", 3,11}, /* 1f: 0111 0100 0001 1111 xxxx xxxx */ - - {ADINC,"V,%b", 3,11}, /* 20: 0111 0100 0010 0000 xxxx xxxx */ - {ADINC,"A,%b", 3,11}, /* 21: 0111 0100 0010 0001 xxxx xxxx */ - {ADINC,"B,%b", 3,11}, /* 22: 0111 0100 0010 0010 xxxx xxxx */ - {ADINC,"C,%b", 3,11}, /* 23: 0111 0100 0010 0011 xxxx xxxx */ - {ADINC,"D,%b", 3,11}, /* 24: 0111 0100 0010 0100 xxxx xxxx */ - {ADINC,"E,%b", 3,11}, /* 25: 0111 0100 0010 0101 xxxx xxxx */ - {ADINC,"H,%b", 3,11}, /* 26: 0111 0100 0010 0110 xxxx xxxx */ - {ADINC,"L,%b", 3,11}, /* 27: 0111 0100 0010 0111 xxxx xxxx */ - {GTI,"V,%b", 3,11}, /* 28: 0111 0100 0010 1000 xxxx xxxx */ - {GTI,"A,%b", 3,11}, /* 29: 0111 0100 0010 1001 xxxx xxxx */ - {GTI,"B,%b", 3,11}, /* 2a: 0111 0100 0010 1010 xxxx xxxx */ - {GTI,"C,%b", 3,11}, /* 2b: 0111 0100 0010 1011 xxxx xxxx */ - {GTI,"D,%b", 3,11}, /* 2c: 0111 0100 0010 1100 xxxx xxxx */ - {GTI,"E,%b", 3,11}, /* 2d: 0111 0100 0010 1101 xxxx xxxx */ - {GTI,"H,%b", 3,11}, /* 2e: 0111 0100 0010 1110 xxxx xxxx */ - {GTI,"L,%b", 3,11}, /* 2f: 0111 0100 0010 1111 xxxx xxxx */ - - {SUINB,"V,%b", 3,11}, /* 30: 0111 0100 0011 0000 xxxx xxxx */ - {SUINB,"A,%b", 3,11}, /* 31: 0111 0100 0011 0001 xxxx xxxx */ - {SUINB,"B,%b", 3,11}, /* 32: 0111 0100 0011 0010 xxxx xxxx */ - {SUINB,"C,%b", 3,11}, /* 33: 0111 0100 0011 0011 xxxx xxxx */ - {SUINB,"D,%b", 3,11}, /* 34: 0111 0100 0011 0100 xxxx xxxx */ - {SUINB,"E,%b", 3,11}, /* 35: 0111 0100 0011 0101 xxxx xxxx */ - {SUINB,"H,%b", 3,11}, /* 36: 0111 0100 0011 0110 xxxx xxxx */ - {SUINB,"L,%b", 3,11}, /* 37: 0111 0100 0011 0111 xxxx xxxx */ - {LTI,"V,%b", 3,11}, /* 38: 0111 0100 0011 1000 xxxx xxxx */ - {LTI,"A,%b", 3,11}, /* 39: 0111 0100 0011 1001 xxxx xxxx */ - {LTI,"B,%b", 3,11}, /* 3a: 0111 0100 0011 1010 xxxx xxxx */ - {LTI,"C,%b", 3,11}, /* 3b: 0111 0100 0011 1011 xxxx xxxx */ - {LTI,"D,%b", 3,11}, /* 3c: 0111 0100 0011 1100 xxxx xxxx */ - {LTI,"E,%b", 3,11}, /* 3d: 0111 0100 0011 1101 xxxx xxxx */ - {LTI,"H,%b", 3,11}, /* 3e: 0111 0100 0011 1110 xxxx xxxx */ - {LTI,"L,%b", 3,11}, /* 3f: 0111 0100 0011 1111 xxxx xxxx */ - - {ADI,"V,%b", 3,11}, /* 40: 0111 0100 0100 0000 xxxx xxxx */ - {ADI,"A,%b", 3,11}, /* 41: 0111 0100 0100 0001 xxxx xxxx */ - {ADI,"B,%b", 3,11}, /* 42: 0111 0100 0100 0010 xxxx xxxx */ - {ADI,"C,%b", 3,11}, /* 43: 0111 0100 0100 0011 xxxx xxxx */ - {ADI,"D,%b", 3,11}, /* 44: 0111 0100 0100 0100 xxxx xxxx */ - {ADI,"E,%b", 3,11}, /* 45: 0111 0100 0100 0101 xxxx xxxx */ - {ADI,"H,%b", 3,11}, /* 46: 0111 0100 0100 0110 xxxx xxxx */ - {ADI,"L,%b", 3,11}, /* 47: 0111 0100 0100 0111 xxxx xxxx */ - {ONI,"V,%b", 3,11}, /* 48: 0111 0100 0100 1000 xxxx xxxx */ - {ONI,"A,%b", 3,11}, /* 49: 0111 0100 0100 1001 xxxx xxxx */ - {ONI,"B,%b", 3,11}, /* 4a: 0111 0100 0100 1010 xxxx xxxx */ - {ONI,"C,%b", 3,11}, /* 4b: 0111 0100 0100 1011 xxxx xxxx */ - {ONI,"D,%b", 3,11}, /* 4c: 0111 0100 0100 1100 xxxx xxxx */ - {ONI,"E,%b", 3,11}, /* 4d: 0111 0100 0100 1101 xxxx xxxx */ - {ONI,"H,%b", 3,11}, /* 4e: 0111 0100 0100 1110 xxxx xxxx */ - {ONI,"L,%b", 3,11}, /* 4f: 0111 0100 0100 1111 xxxx xxxx */ - - {ACI,"V,%b", 3,11}, /* 50: 0111 0100 0101 0000 xxxx xxxx */ - {ACI,"A,%b", 3,11}, /* 51: 0111 0100 0101 0001 xxxx xxxx */ - {ACI,"B,%b", 3,11}, /* 52: 0111 0100 0101 0010 xxxx xxxx */ - {ACI,"C,%b", 3,11}, /* 53: 0111 0100 0101 0011 xxxx xxxx */ - {ACI,"D,%b", 3,11}, /* 54: 0111 0100 0101 0100 xxxx xxxx */ - {ACI,"E,%b", 3,11}, /* 55: 0111 0100 0101 0101 xxxx xxxx */ - {ACI,"H,%b", 3,11}, /* 56: 0111 0100 0101 0110 xxxx xxxx */ - {ACI,"L,%b", 3,11}, /* 57: 0111 0100 0101 0111 xxxx xxxx */ - {OFFI,"V,%b", 3,11}, /* 58: 0111 0100 0101 1000 xxxx xxxx */ - {OFFI,"A,%b", 3,11}, /* 59: 0111 0100 0101 1001 xxxx xxxx */ - {OFFI,"B,%b", 3,11}, /* 5a: 0111 0100 0101 1010 xxxx xxxx */ - {OFFI,"C,%b", 3,11}, /* 5b: 0111 0100 0101 1011 xxxx xxxx */ - {OFFI,"D,%b", 3,11}, /* 5c: 0111 0100 0101 1100 xxxx xxxx */ - {OFFI,"E,%b", 3,11}, /* 5d: 0111 0100 0101 1101 xxxx xxxx */ - {OFFI,"H,%b", 3,11}, /* 5e: 0111 0100 0101 1110 xxxx xxxx */ - {OFFI,"L,%b", 3,11}, /* 5f: 0111 0100 0101 1111 xxxx xxxx */ - - {SUI,"V,%b", 3,11}, /* 60: 0111 0100 0110 0000 xxxx xxxx */ - {SUI,"A,%b", 3,11}, /* 61: 0111 0100 0110 0001 xxxx xxxx */ - {SUI,"B,%b", 3,11}, /* 62: 0111 0100 0110 0010 xxxx xxxx */ - {SUI,"C,%b", 3,11}, /* 63: 0111 0100 0110 0011 xxxx xxxx */ - {SUI,"D,%b", 3,11}, /* 64: 0111 0100 0110 0100 xxxx xxxx */ - {SUI,"E,%b", 3,11}, /* 65: 0111 0100 0110 0101 xxxx xxxx */ - {SUI,"H,%b", 3,11}, /* 66: 0111 0100 0110 0110 xxxx xxxx */ - {SUI,"L,%b", 3,11}, /* 67: 0111 0100 0110 0111 xxxx xxxx */ - {NEI,"V,%b", 3,11}, /* 68: 0111 0100 0110 1000 xxxx xxxx */ - {NEI,"A,%b", 3,11}, /* 69: 0111 0100 0110 1001 xxxx xxxx */ - {NEI,"B,%b", 3,11}, /* 6a: 0111 0100 0110 1010 xxxx xxxx */ - {NEI,"C,%b", 3,11}, /* 6b: 0111 0100 0110 1011 xxxx xxxx */ - {NEI,"D,%b", 3,11}, /* 6c: 0111 0100 0110 1100 xxxx xxxx */ - {NEI,"E,%b", 3,11}, /* 6d: 0111 0100 0110 1101 xxxx xxxx */ - {NEI,"H,%b", 3,11}, /* 6e: 0111 0100 0110 1110 xxxx xxxx */ - {NEI,"L,%b", 3,11}, /* 6f: 0111 0100 0110 1111 xxxx xxxx */ - - {SBI,"V,%b", 3,11}, /* 70: 0111 0100 0111 0000 xxxx xxxx */ - {SBI,"A,%b", 3,11}, /* 71: 0111 0100 0111 0001 xxxx xxxx */ - {SBI,"B,%b", 3,11}, /* 72: 0111 0100 0111 0010 xxxx xxxx */ - {SBI,"C,%b", 3,11}, /* 73: 0111 0100 0111 0011 xxxx xxxx */ - {SBI,"D,%b", 3,11}, /* 74: 0111 0100 0111 0100 xxxx xxxx */ - {SBI,"E,%b", 3,11}, /* 75: 0111 0100 0111 0101 xxxx xxxx */ - {SBI,"H,%b", 3,11}, /* 76: 0111 0100 0111 0110 xxxx xxxx */ - {SBI,"L,%b", 3,11}, /* 77: 0111 0100 0111 0111 xxxx xxxx */ - {EQI,"V,%b", 3,11}, /* 78: 0111 0100 0111 1000 xxxx xxxx */ - {EQI,"A,%b", 3,11}, /* 79: 0111 0100 0111 1001 xxxx xxxx */ - {EQI,"B,%b", 3,11}, /* 7a: 0111 0100 0111 1010 xxxx xxxx */ - {EQI,"C,%b", 3,11}, /* 7b: 0111 0100 0111 1011 xxxx xxxx */ - {EQI,"D,%b", 3,11}, /* 7c: 0111 0100 0111 1100 xxxx xxxx */ - {EQI,"E,%b", 3,11}, /* 7d: 0111 0100 0111 1101 xxxx xxxx */ - {EQI,"H,%b", 3,11}, /* 7e: 0111 0100 0111 1110 xxxx xxxx */ - {EQI,"L,%b", 3,11}, /* 7f: 0111 0100 0111 1111 xxxx xxxx */ - - {illegal,0, 2, 8}, /* 80: 0111 0100 1000 0000 */ - {illegal,0, 2, 8}, /* 81: 0111 0100 1000 0001 */ - {illegal,0, 2, 8}, /* 82: 0111 0100 1000 0010 */ - {illegal,0, 2, 8}, /* 83: 0111 0100 1000 0011 */ - {illegal,0, 2, 8}, /* 84: 0111 0100 1000 0100 */ - {illegal,0, 2, 8}, /* 85: 0111 0100 1000 0101 */ - {illegal,0, 2, 8}, /* 86: 0111 0100 1000 0110 */ - {illegal,0, 2, 8}, /* 87: 0111 0100 1000 0111 */ - {ANAW,"%a", 3,14}, /* 88: 0111 0100 1000 1000 oooo oooo */ - {illegal,0, 2, 8}, /* 89: 0111 0100 1000 1001 */ - {illegal,0, 2, 8}, /* 8a: 0111 0100 1000 1010 */ - {illegal,0, 2, 8}, /* 8b: 0111 0100 1000 1011 */ - {illegal,0, 2, 8}, /* 8c: 0111 0100 1000 1100 */ - {DAN,"EA,BC", 2,11}, /* 8d: 0111 0100 1000 1101 */ - {DAN,"EA,DE", 2,11}, /* 8e: 0111 0100 1000 1110 */ - {DAN,"EA,HL", 2,11}, /* 8f: 0111 0100 1000 1111 */ - - {XRAW,"%a", 3,14}, /* 90: 0111 0100 1001 0000 oooo oooo */ - {illegal,0, 2, 8}, /* 91: 0111 0100 1001 0001 */ - {illegal,0, 2, 8}, /* 92: 0111 0100 1001 0010 */ - {illegal,0, 2, 8}, /* 93: 0111 0100 1001 0011 */ - {illegal,0, 2, 8}, /* 94: 0111 0100 1001 0100 */ - {DXR,"EA,BC", 2,11}, /* 95: 0111 0100 1001 0101 */ - {DXR,"EA,DE", 2,11}, /* 96: 0111 0100 1001 0110 */ - {DXR,"EA,HL", 2,11}, /* 97: 0111 0100 1001 0111 */ - {ORAW,"%a", 3,14}, /* 98: 0111 0100 1001 1000 oooo oooo */ - {illegal,0, 2, 8}, /* 99: 0111 0100 1001 1001 */ - {illegal,0, 2, 8}, /* 9a: 0111 0100 1001 1010 */ - {illegal,0, 2, 8}, /* 9b: 0111 0100 1001 1011 */ - {illegal,0, 2, 8}, /* 9c: 0111 0100 1001 1100 */ - {DOR,"EA,BC", 2,11}, /* 9d: 0111 0100 1001 1101 */ - {DOR,"EA,DE", 2,11}, /* 9e: 0111 0100 1001 1110 */ - {DOR,"EA,HL", 2,11}, /* 9f: 0111 0100 1001 1111 */ - - {ADDNCW,"%a", 3,14}, /* a0: 0111 0100 1010 0000 oooo oooo */ - {illegal,0, 2, 8}, /* a1: 0111 0100 1010 0001 */ - {illegal,0, 2, 8}, /* a2: 0111 0100 1010 0010 */ - {illegal,0, 2, 8}, /* a3: 0111 0100 1010 0011 */ - {illegal,0, 2, 8}, /* a4: 0111 0100 1010 0100 */ - {DADDNC,"EA,BC", 2,11}, /* a5: 0111 0100 1010 0101 */ - {DADDNC,"EA,DE", 2,11}, /* a6: 0111 0100 1010 0110 */ - {DADDNC,"EA,HL", 2,11}, /* a7: 0111 0100 1010 0111 */ - {GTAW,"%a", 3,14}, /* a8: 0111 0100 1010 1000 oooo oooo */ - {illegal,0, 2, 8}, /* a9: 0111 0100 1010 1001 */ - {illegal,0, 2, 8}, /* aa: 0111 0100 1010 1010 */ - {illegal,0, 2, 8}, /* ab: 0111 0100 1010 1011 */ - {illegal,0, 2, 8}, /* ac: 0111 0100 1010 1100 */ - {DGT,"EA,BC", 2,11}, /* ad: 0111 0100 1010 1101 */ - {DGT,"EA,DE", 2,11}, /* ae: 0111 0100 1010 1110 */ - {DGT,"EA,HL", 2,11}, /* af: 0111 0100 1010 1111 */ - - {SUBNBW,"%a", 3,14}, /* b0: 0111 0100 1011 0000 oooo oooo */ - {illegal,0, 2, 8}, /* b1: 0111 0100 1011 0001 */ - {illegal,0, 2, 8}, /* b2: 0111 0100 1011 0010 */ - {illegal,0, 2, 8}, /* b3: 0111 0100 1011 0011 */ - {illegal,0, 2, 8}, /* b4: 0111 0100 1011 0100 */ - {DSUBNB,"EA,BC", 2,11}, /* b5: 0111 0100 1011 0101 */ - {DSUBNB,"EA,DE", 2,11}, /* b6: 0111 0100 1011 0110 */ - {DSUBNB,"EA,HL", 2,11}, /* b7: 0111 0100 1011 0111 */ - {LTAW,"%a", 3,14}, /* b8: 0111 0100 1011 1000 oooo oooo */ - {illegal,0, 2, 8}, /* b9: 0111 0100 1011 1001 */ - {illegal,0, 2, 8}, /* ba: 0111 0100 1011 1010 */ - {illegal,0, 2, 8}, /* bb: 0111 0100 1011 1011 */ - {illegal,0, 2, 8}, /* bc: 0111 0100 1011 1100 */ - {DLT,"EA,BC", 2,11}, /* bd: 0111 0100 1011 1101 */ - {DLT,"EA,DE", 2,11}, /* be: 0111 0100 1011 1110 */ - {DLT,"EA,HL", 2,11}, /* bf: 0111 0100 1011 1111 */ - - {ADDW,"%a", 3,14}, /* c0: 0111 0100 1100 0000 oooo oooo */ - {illegal,0, 2, 8}, /* c1: 0111 0100 1100 0001 */ - {illegal,0, 2, 8}, /* c2: 0111 0100 1100 0010 */ - {illegal,0, 2, 8}, /* c3: 0111 0100 1100 0011 */ - {illegal,0, 2, 8}, /* c4: 0111 0100 1100 0100 */ - {DADD,"EA,BC", 2,11}, /* c5: 0111 0100 1100 0101 */ - {DADD,"EA,DE", 2,11}, /* c6: 0111 0100 1100 0110 */ - {DADD,"EA,HL", 2,11}, /* c7: 0111 0100 1100 0111 */ - {ONAW,"%a", 3,14}, /* c8: 0111 0100 1100 1000 oooo oooo */ - {illegal,0, 2, 8}, /* c9: 0111 0100 1100 1001 */ - {illegal,0, 2, 8}, /* ca: 0111 0100 1100 1010 */ - {illegal,0, 2, 8}, /* cb: 0111 0100 1100 1011 */ - {illegal,0, 2, 8}, /* cc: 0111 0100 1100 1100 */ - {DON,"EA,BC", 2,11}, /* cd: 0111 0100 1100 1101 */ - {DON,"EA,DE", 2,11}, /* ce: 0111 0100 1100 1110 */ - {DON,"EA,HL", 2,11}, /* cf: 0111 0100 1100 1111 */ - - {ADCW,"%a", 3,14}, /* d0: 0111 0100 1101 0000 oooo oooo */ - {illegal,0, 2, 8}, /* d1: 0111 0100 1101 0001 */ - {illegal,0, 2, 8}, /* d2: 0111 0100 1101 0010 */ - {illegal,0, 2, 8}, /* d3: 0111 0100 1101 0011 */ - {illegal,0, 2, 8}, /* d4: 0111 0100 1101 0100 */ - {DADC,"EA,BC", 2,11}, /* d5: 0111 0100 1101 0101 */ - {DADC,"EA,DE", 2,11}, /* d6: 0111 0100 1101 0110 */ - {DADC,"EA,HL", 2,11}, /* d7: 0111 0100 1101 0111 */ - {OFFAW,"%a", 3,14}, /* d8: 0111 0100 1101 1000 oooo oooo */ - {illegal,0, 2, 8}, /* d9: 0111 0100 1101 1001 */ - {illegal,0, 2, 8}, /* da: 0111 0100 1101 1010 */ - {illegal,0, 2, 8}, /* db: 0111 0100 1101 1011 */ - {illegal,0, 2, 8}, /* dc: 0111 0100 1101 1100 */ - {DOFF,"EA,BC", 2,11}, /* dd: 0111 0100 1101 1101 */ - {DOFF,"EA,DE", 2,11}, /* de: 0111 0100 1101 1110 */ - {DOFF,"EA,HL", 2,11}, /* df: 0111 0100 1101 1111 */ - - {SUBW,"%a", 3,14}, /* e0: 0111 0100 1110 0000 oooo oooo */ - {illegal,0, 2, 8}, /* e1: 0111 0100 1110 0001 */ - {illegal,0, 2, 8}, /* e2: 0111 0100 1110 0010 */ - {illegal,0, 2, 8}, /* e3: 0111 0100 1110 0011 */ - {illegal,0, 2, 8}, /* e4: 0111 0100 1110 0100 */ - {DSUB,"EA,BC", 2,11}, /* e5: 0111 0100 1110 0101 */ - {DSUB,"EA,DE", 2,11}, /* e6: 0111 0100 1110 0110 */ - {DSUB,"EA,HL", 2,11}, /* e7: 0111 0100 1110 0111 */ - {NEAW,"%a", 3,14}, /* e8: 0111 0100 1110 1000 oooo oooo */ - {illegal,0, 2, 8}, /* e9: 0111 0100 1110 1001 */ - {illegal,0, 2, 8}, /* ea: 0111 0100 1110 1010 */ - {illegal,0, 2, 8}, /* eb: 0111 0100 1110 1011 */ - {illegal,0, 2, 8}, /* ec: 0111 0100 1110 1100 */ - {DNE,"EA,BC", 2,11}, /* ed: 0111 0100 1110 1101 */ - {DNE,"EA,DE", 2,11}, /* ee: 0111 0100 1110 1110 */ - {DNE,"EA,HL", 2,11}, /* ef: 0111 0100 1110 1111 */ - - {SBBW,"%a", 3,14}, /* f0: 0111 0100 1111 0000 oooo oooo */ - {illegal,0, 2, 8}, /* f1: 0111 0100 1111 0001 */ - {illegal,0, 2, 8}, /* f2: 0111 0100 1111 0010 */ - {illegal,0, 2, 8}, /* f3: 0111 0100 1111 0011 */ - {illegal,0, 2, 8}, /* f4: 0111 0100 1111 0100 */ - {DSBB,"EA,BC", 2,11}, /* f5: 0111 0100 1111 0101 */ - {DSBB,"EA,DE", 2,11}, /* f6: 0111 0100 1111 0110 */ - {DSBB,"EA,HL", 2,11}, /* f7: 0111 0100 1111 0111 */ - {EQAW,"%a", 3,14}, /* f8: 0111 0100 1111 1000 oooo oooo */ - {illegal,0, 2, 8}, /* f9: 0111 0100 1111 1001 */ - {illegal,0, 2, 8}, /* fa: 0111 0100 1111 1010 */ - {illegal,0, 2, 8}, /* fb: 0111 0100 1111 1011 */ - {illegal,0, 2, 8}, /* fc: 0111 0100 1111 1100 */ - {DEQ,"EA,BC", 2,11}, /* fd: 0111 0100 1111 1101 */ - {DEQ,"EA,DE", 2,11}, /* fe: 0111 0100 1111 1110 */ - {DEQ,"EA,HL", 2,11} /* ff: 0111 0100 1111 1111 */ -}; - -/* main opcodes */ -static struct dasm_s dasmXX_7810[256] = -{ - {NOP,0, 1, 4}, /* 00: 0000 0000 */ - {LDAW,"%a", 2,10}, /* 01: 0000 0001 oooo oooo */ - {INX,"SP", 1, 7}, /* 02: 0000 0010 */ - {DCX,"SP", 1, 7}, /* 03: 0000 0011 */ - {LXI,"SP,%w", 3,10}, /* 04: 0000 0100 llll llll hhhh hhhh */ - {ANIW,"%a,%b", 3,19}, /* 05: 0000 0101 oooo oooo xxxx xxxx */ - {illegal,0, 1, 4}, /* 06: */ - {ANI,"A,%b", 2, 7}, /* 07: 0000 0111 xxxx xxxx */ - {MOV,"A,EAH", 1, 4}, /* 08: 0000 1000 */ - {MOV,"A,EAL", 1, 4}, /* 09: 0000 1001 */ - {MOV,"A,B", 1, 4}, /* 0a: 0000 1010 */ - {MOV,"A,C", 1, 4}, /* 0b: 0000 1011 */ - {MOV,"A,D", 1, 4}, /* 0c: 0000 1100 */ - {MOV,"A,E", 1, 4}, /* 0d: 0000 1101 */ - {MOV,"A,H", 1, 4}, /* 0e: 0000 1110 */ - {MOV,"A,L", 1, 4}, /* 0f: 0000 1111 */ - - {EXA,0, 1, 4}, /* 10: 0001 0000 */ /* 7810 */ - {EXX,0, 1, 4}, /* 11: 0001 0001 */ /* 7810 */ - {INX,"BC", 1, 7}, /* 12: 0001 0010 */ - {DCX,"BC", 1, 7}, /* 13: 0001 0011 */ - {LXI,"BC,%w", 3,10}, /* 14: 0001 0100 llll llll hhhh hhhh */ - {ORIW,"%a,%b", 3,19}, /* 15: 0001 0101 oooo oooo xxxx xxxx */ - {XRI,"A,%b", 2, 7}, /* 16: 0001 0110 xxxx xxxx */ - {ORI,"A,%b", 2, 7}, /* 17: 0001 0111 xxxx xxxx */ - {MOV,"EAH,A", 1, 4}, /* 18: 0001 1000 */ - {MOV,"EAL,A", 1, 4}, /* 19: 0001 1001 */ - {MOV,"B,A", 1, 4}, /* 1a: 0001 1010 */ - {MOV,"C,A", 1, 4}, /* 1b: 0001 1011 */ - {MOV,"D,A", 1, 4}, /* 1c: 0001 1100 */ - {MOV,"E,A", 1, 4}, /* 1d: 0001 1101 */ - {MOV,"H,A", 1, 4}, /* 1e: 0001 1110 */ - {MOV,"L,A", 1, 4}, /* 1f: 0001 1111 */ - - {INRW,"%a", 2,16}, /* 20: 0010 0000 oooo oooo */ - {JB,0, 1, 4}, /* 21: 0010 0001 */ - {INX,"DE", 1, 7}, /* 22: 0010 0010 */ - {DCX,"DE", 1, 7}, /* 23: 0010 0011 */ - {LXI,"DE,%w", 3,10}, /* 24: 0010 0100 llll llll hhhh hhhh */ - {GTIW,"%a,%b", 3,19}, /* 25: 0010 0101 oooo oooo xxxx xxxx */ - {ADINC,"A,%b", 2, 7}, /* 26: 0010 0110 xxxx xxxx */ - {GTI,"A,%b", 2, 7}, /* 27: 0010 0111 xxxx xxxx */ - {illegal,0, 1, 4}, /* 28: 0010 1000 */ - {LDAX,"(BC)", 1, 7}, /* 29: 0010 1001 */ - {LDAX,"(DE)", 1, 7}, /* 2a: 0010 1010 */ - {LDAX,"(HL)", 1, 7}, /* 2b: 0010 1011 */ - {LDAX,"(DE+)", 1, 7}, /* 2c: 0010 1100 */ - {LDAX,"(HL+)", 1, 7}, /* 2d: 0010 1101 */ - {LDAX,"(DE-)", 1, 7}, /* 2e: 0010 1110 */ - {LDAX,"(HL-)", 1, 7}, /* 2f: 0010 1111 */ - - {DCRW,"%a", 2,16}, /* 30: 0011 0000 oooo oooo */ - {BLOCK,0, 1,13}, /* 31: 0011 0001 */ /* 7810 */ - {INX,"HL", 1, 7}, /* 32: 0011 0010 */ - {DCX,"HL", 1, 7}, /* 33: 0011 0011 */ - {LXI,"HL,%w", 3,10}, /* 34: 0011 0100 llll llll hhhh hhhh */ - {LTIW,"%a,%b", 3,19}, /* 35: 0011 0101 oooo oooo xxxx xxxx */ - {SUINB,"A,%b", 2, 7}, /* 36: 0011 0110 xxxx xxxx */ - {LTI,"A,%b", 2, 7}, /* 37: 0011 0111 xxxx xxxx */ - {illegal,0, 1, 4}, /* 38: */ - {STAX,"(BC)", 1, 7}, /* 39: 0011 1001 */ - {STAX,"(DE)", 1, 7}, /* 3a: 0011 1010 */ - {STAX,"(HL)", 1, 7}, /* 3b: 0011 1011 */ - {STAX,"(DE+)", 1, 7}, /* 3c: 0011 1100 */ - {STAX,"(HL+)", 1, 7}, /* 3d: 0011 1101 */ - {STAX,"(DE-)", 1, 7}, /* 3e: 0011 1110 */ - {STAX,"(HL-)", 1, 7}, /* 3f: 0011 1111 */ - - {CALL,"%w", 3,16}, /* 40: 0100 0000 llll llll hhhh hhhh */ - {INR,"A", 1, 4}, /* 41: 0100 0001 */ - {INR,"B", 1, 4}, /* 42: 0100 0010 */ - {INR,"C", 1, 4}, /* 43: 0100 0011 */ - {LXI,"EA,%w", 3,10}, /* 44: 0100 0100 llll llll hhhh hhhh */ - {ONIW,"%a,%b", 3,19}, /* 45: 0100 0101 oooo oooo xxxx xxxx */ - {ADI,"A,%b", 2, 7}, /* 46: 0100 0110 xxxx xxxx */ - {ONI,"A,%b", 2, 7}, /* 47: 0100 0111 xxxx xxxx */ - {0,dasm48_7810, 0, 0}, /* 48: prefix */ - {MVIX,"BC,%b", 2,10}, /* 49: 0100 1001 xxxx xxxx */ - {MVIX,"DE,%b", 2,10}, /* 4a: 0100 1010 xxxx xxxx */ - {MVIX,"HL,%b", 2,10}, /* 4b: 0100 1011 xxxx xxxx */ - {0,dasm4C_7810, 0, 0}, /* 4c: prefix */ - {0,dasm4D_7810, 0, 0}, /* 4d: prefix */ - {JRE,"%d", 2,10}, /* 4e: 0100 111d dddd dddd */ - {JRE,"%d", 2,10}, /* 4f: 0100 111d dddd dddd */ - - {EXH,0, 1, 4}, /* 50: 0101 0000 */ /* 7810 */ - {DCR,"A", 1, 4}, /* 51: 0101 0001 */ - {DCR,"B", 1, 4}, /* 52: 0101 0010 */ - {DCR,"C", 1, 4}, /* 53: 0101 0011 */ - {JMP,"%w", 3,10}, /* 54: 0101 0100 llll llll hhhh hhhh */ - {OFFIW,"%a,%b", 3,19}, /* 55: 0101 0101 oooo oooo xxxx xxxx */ - {ACI,"A,%b", 2, 7}, /* 56: 0101 0110 xxxx xxxx */ - {OFFI,"A,%b", 2, 7}, /* 57: 0101 0111 xxxx xxxx */ - {BIT,"0,%a", 2,10}, /* 58: 0101 1000 oooo oooo */ /* 7810 */ - {BIT,"1,%a", 2,10}, /* 59: 0101 1001 oooo oooo */ /* 7810 */ - {BIT,"2,%a", 2,10}, /* 5a: 0101 1010 oooo oooo */ /* 7810 */ - {BIT,"3,%a", 2,10}, /* 5b: 0101 1011 oooo oooo */ /* 7810 */ - {BIT,"4,%a", 2,10}, /* 5c: 0101 1100 oooo oooo */ /* 7810 */ - {BIT,"5,%a", 2,10}, /* 5d: 0101 1101 oooo oooo */ /* 7810 */ - {BIT,"6,%a", 2,10}, /* 5e: 0101 1110 oooo oooo */ /* 7810 */ - {BIT,"7,%a", 2,10}, /* 5f: 0101 1111 oooo oooo */ /* 7810 */ - - {0,dasm60, 0, 0}, /* 60: prefix */ - {DAA,0, 1, 4}, /* 61: 0110 0001 */ - {RETI,0, 1,13}, /* 62: 0110 0010 */ - {STAW,"%a", 2,10}, /* 63: 0110 0011 oooo oooo */ - {0,dasm64_7810, 0, 0}, /* 64: prefix */ - {NEIW,"%a,%b", 3,19}, /* 65: 0110 0101 oooo oooo xxxx xxxx */ - {SUI,"A,%b", 2, 7}, /* 66: 0110 0110 xxxx xxxx */ - {NEI,"A,%b", 2, 7}, /* 67: 0110 0111 xxxx xxxx */ - {MVI,"V,%b", 2, 7}, /* 68: 0110 1000 xxxx xxxx */ - {MVI,"A,%b", 2, 7}, /* 69: 0110 1001 xxxx xxxx */ - {MVI,"B,%b", 2, 7}, /* 6a: 0110 1010 xxxx xxxx */ - {MVI,"C,%b", 2, 7}, /* 6b: 0110 1011 xxxx xxxx */ - {MVI,"D,%b", 2, 7}, /* 6c: 0110 1100 xxxx xxxx */ - {MVI,"E,%b", 2, 7}, /* 6d: 0110 1101 xxxx xxxx */ - {MVI,"H,%b", 2, 7}, /* 6e: 0110 1110 xxxx xxxx */ - {MVI,"L,%b", 2, 7}, /* 6f: 0110 1111 xxxx xxxx */ - - {0,dasm70, 0, 0}, /* 70: prefix */ - {MVIW,"%a,%b", 3,13}, /* 71: 0111 0001 oooo oooo xxxx xxxx */ - {SOFTI,0, 1,16}, /* 72: 0111 0010 */ - {illegal,0, 1, 0}, /* 73: */ - {0,dasm74, 0, 0}, /* 74: prefix */ - {EQIW,"%a,%b", 3,19}, /* 75: 0111 0101 oooo oooo xxxx xxxx */ - {SBI,"A,%b", 2, 7}, /* 76: 0111 0110 xxxx xxxx */ - {EQI,"A,%b", 2, 7}, /* 77: 0111 0111 xxxx xxxx */ - {CALF,"%f", 2,13}, /* 78: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 79: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7a: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7b: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7c: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7d: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7e: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7f: 0111 1ddd dddd dddd */ - - {CALT,"%t", 1,16}, /* 80: 100t tttt */ - {CALT,"%t", 1,16}, /* 81: 100t tttt */ - {CALT,"%t", 1,16}, /* 82: 100t tttt */ - {CALT,"%t", 1,16}, /* 83: 100t tttt */ - {CALT,"%t", 1,16}, /* 84: 100t tttt */ - {CALT,"%t", 1,16}, /* 85: 100t tttt */ - {CALT,"%t", 1,16}, /* 86: 100t tttt */ - {CALT,"%t", 1,16}, /* 87: 100t tttt */ - {CALT,"%t", 1,16}, /* 88: 100t tttt */ - {CALT,"%t", 1,16}, /* 89: 100t tttt */ - {CALT,"%t", 1,16}, /* 8a: 100t tttt */ - {CALT,"%t", 1,16}, /* 8b: 100t tttt */ - {CALT,"%t", 1,16}, /* 8c: 100t tttt */ - {CALT,"%t", 1,16}, /* 8d: 100t tttt */ - {CALT,"%t", 1,16}, /* 8e: 100t tttt */ - {CALT,"%t", 1,16}, /* 8f: 100t tttt */ - - {CALT,"%t", 1,16}, /* 90: 100t tttt */ - {CALT,"%t", 1,16}, /* 91: 100t tttt */ - {CALT,"%t", 1,16}, /* 92: 100t tttt */ - {CALT,"%t", 1,16}, /* 93: 100t tttt */ - {CALT,"%t", 1,16}, /* 94: 100t tttt */ - {CALT,"%t", 1,16}, /* 95: 100t tttt */ - {CALT,"%t", 1,16}, /* 96: 100t tttt */ - {CALT,"%t", 1,16}, /* 97: 100t tttt */ - {CALT,"%t", 1,16}, /* 98: 100t tttt */ - {CALT,"%t", 1,16}, /* 99: 100t tttt */ - {CALT,"%t", 1,16}, /* 9a: 100t tttt */ - {CALT,"%t", 1,16}, /* 9b: 100t tttt */ - {CALT,"%t", 1,16}, /* 9c: 100t tttt */ - {CALT,"%t", 1,16}, /* 9d: 100t tttt */ - {CALT,"%t", 1,16}, /* 9e: 100t tttt */ - {CALT,"%t", 1,16}, /* 9f: 100t tttt */ - - {POP,"VA", 1,10}, /* a0: 1010 0000 */ - {POP,"BC", 1,10}, /* a1: 1010 0001 */ - {POP,"DE", 1,10}, /* a2: 1010 0010 */ - {POP,"HL", 1,10}, /* a3: 1010 0011 */ - {POP,"EA", 1,10}, /* a4: 1010 0100 */ - {DMOV,"EA,BC", 1, 4}, /* a5: 1010 0101 */ - {DMOV,"EA,DE", 1, 4}, /* a6: 1010 0110 */ - {DMOV,"EA,HL", 1, 4}, /* a7: 1010 0111 */ - {INX,"EA", 1, 7}, /* a8: 1010 1000 */ - {DCX,"EA", 1, 7}, /* a9: 1010 1001 */ - {EI,0, 1, 4}, /* aa: 1010 1010 */ - {LDAX,"(DE+%b)", 2,13}, /* ab: 1010 1011 dddd dddd */ - {LDAX,"(HL+A)", 1,13}, /* ac: 1010 1100 */ - {LDAX,"(HL+B)", 1,13}, /* ad: 1010 1101 */ - {LDAX,"(HL+EA)", 1,13}, /* ae: 1010 1110 */ - {LDAX,"(HL+%b)", 2,13}, /* af: 1010 1111 dddd dddd */ - - {PUSH,"VA", 1,13}, /* b0: 1011 0000 */ - {PUSH,"BC", 1,13}, /* b1: 1011 0001 */ - {PUSH,"DE", 1,13}, /* b2: 1011 0010 */ - {PUSH,"HL", 1,13}, /* b3: 1011 0011 */ - {PUSH,"EA", 1,13}, /* b4: 1011 0100 */ - {DMOV,"BC,EA", 1, 4}, /* b5: 1011 0101 */ - {DMOV,"DE,EA", 1, 4}, /* b6: 1011 0110 */ - {DMOV,"HL,EA", 1, 4}, /* b7: 1011 0111 */ - {RET,0, 1,10}, /* b8: 1011 1000 */ - {RETS,0, 1,10}, /* b9: 1011 1001 */ - {DI,0, 1, 4}, /* ba: 1011 1010 */ - {STAX,"(DE+%b)", 2,13}, /* bb: 1011 1011 dddd dddd */ - {STAX,"(HL+A)", 1,13}, /* bc: 1011 1100 */ - {STAX,"(HL+B)", 1,13}, /* bd: 1011 1101 */ - {STAX,"(HL+EA)", 1,13}, /* be: 1011 1110 */ - {STAX,"(HL+%b)", 2,13}, /* bf: 1011 1111 dddd dddd */ - - {JR,"%o", 1,10}, /* c0: 11oo oooo */ - {JR,"%o", 1,10}, /* c1: 11oo oooo */ - {JR,"%o", 1,10}, /* c2: 11oo oooo */ - {JR,"%o", 1,10}, /* c3: 11oo oooo */ - {JR,"%o", 1,10}, /* c4: 11oo oooo */ - {JR,"%o", 1,10}, /* c5: 11oo oooo */ - {JR,"%o", 1,10}, /* c6: 11oo oooo */ - {JR,"%o", 1,10}, /* c7: 11oo oooo */ - {JR,"%o", 1,10}, /* c8: 11oo oooo */ - {JR,"%o", 1,10}, /* c9: 11oo oooo */ - {JR,"%o", 1,10}, /* ca: 11oo oooo */ - {JR,"%o", 1,10}, /* cb: 11oo oooo */ - {JR,"%o", 1,10}, /* cc: 11oo oooo */ - {JR,"%o", 1,10}, /* cd: 11oo oooo */ - {JR,"%o", 1,10}, /* ce: 11oo oooo */ - {JR,"%o", 1,10}, /* cf: 11oo oooo */ - - {JR,"%o", 1,10}, /* d0: 11oo oooo */ - {JR,"%o", 1,10}, /* d1: 11oo oooo */ - {JR,"%o", 1,10}, /* d2: 11oo oooo */ - {JR,"%o", 1,10}, /* d3: 11oo oooo */ - {JR,"%o", 1,10}, /* d4: 11oo oooo */ - {JR,"%o", 1,10}, /* d5: 11oo oooo */ - {JR,"%o", 1,10}, /* d6: 11oo oooo */ - {JR,"%o", 1,10}, /* d7: 11oo oooo */ - {JR,"%o", 1,10}, /* d8: 11oo oooo */ - {JR,"%o", 1,10}, /* d9: 11oo oooo */ - {JR,"%o", 1,10}, /* da: 11oo oooo */ - {JR,"%o", 1,10}, /* db: 11oo oooo */ - {JR,"%o", 1,10}, /* dc: 11oo oooo */ - {JR,"%o", 1,10}, /* dd: 11oo oooo */ - {JR,"%o", 1,10}, /* de: 11oo oooo */ - {JR,"%o", 1,10}, /* df: 11oo oooo */ - - {JR,"%o", 1,10}, /* e0: 11oo oooo */ - {JR,"%o", 1,10}, /* e1: 11oo oooo */ - {JR,"%o", 1,10}, /* e2: 11oo oooo */ - {JR,"%o", 1,10}, /* e3: 11oo oooo */ - {JR,"%o", 1,10}, /* e4: 11oo oooo */ - {JR,"%o", 1,10}, /* e5: 11oo oooo */ - {JR,"%o", 1,10}, /* e6: 11oo oooo */ - {JR,"%o", 1,10}, /* e7: 11oo oooo */ - {JR,"%o", 1,10}, /* e8: 11oo oooo */ - {JR,"%o", 1,10}, /* e9: 11oo oooo */ - {JR,"%o", 1,10}, /* ea: 11oo oooo */ - {JR,"%o", 1,10}, /* eb: 11oo oooo */ - {JR,"%o", 1,10}, /* ec: 11oo oooo */ - {JR,"%o", 1,10}, /* ed: 11oo oooo */ - {JR,"%o", 1,10}, /* ee: 11oo oooo */ - {JR,"%o", 1,10}, /* ef: 11oo oooo */ - - {JR,"%o", 1,10}, /* f0: 11oo oooo */ - {JR,"%o", 1,10}, /* f1: 11oo oooo */ - {JR,"%o", 1,10}, /* f2: 11oo oooo */ - {JR,"%o", 1,10}, /* f3: 11oo oooo */ - {JR,"%o", 1,10}, /* f4: 11oo oooo */ - {JR,"%o", 1,10}, /* f5: 11oo oooo */ - {JR,"%o", 1,10}, /* f6: 11oo oooo */ - {JR,"%o", 1,10}, /* f7: 11oo oooo */ - {JR,"%o", 1,10}, /* f8: 11oo oooo */ - {JR,"%o", 1,10}, /* f9: 11oo oooo */ - {JR,"%o", 1,10}, /* fa: 11oo oooo */ - {JR,"%o", 1,10}, /* fb: 11oo oooo */ - {JR,"%o", 1,10}, /* fc: 11oo oooo */ - {JR,"%o", 1,10}, /* fd: 11oo oooo */ - {JR,"%o", 1,10}, /* fe: 11oo oooo */ - {JR,"%o", 1,10} /* ff: 11oo oooo */ -}; - -static struct dasm_s dasmXX_7807[256] = -{ - {NOP,0, 1, 4}, /* 00: 0000 0000 */ - {LDAW,"%a", 2,10}, /* 01: 0000 0001 oooo oooo */ - {INX,"SP", 1, 7}, /* 02: 0000 0010 */ - {DCX,"SP", 1, 7}, /* 03: 0000 0011 */ - {LXI,"SP,%w", 3,10}, /* 04: 0000 0100 llll llll hhhh hhhh */ - {ANIW,"%a,%b", 3,19}, /* 05: 0000 0101 oooo oooo xxxx xxxx */ - {illegal,0, 1, 4}, /* 06: */ - {ANI,"A,%b", 2, 7}, /* 07: 0000 0111 xxxx xxxx */ - {MOV,"A,EAH", 1, 4}, /* 08: 0000 1000 */ - {MOV,"A,EAL", 1, 4}, /* 09: 0000 1001 */ - {MOV,"A,B", 1, 4}, /* 0a: 0000 1010 */ - {MOV,"A,C", 1, 4}, /* 0b: 0000 1011 */ - {MOV,"A,D", 1, 4}, /* 0c: 0000 1100 */ - {MOV,"A,E", 1, 4}, /* 0d: 0000 1101 */ - {MOV,"A,H", 1, 4}, /* 0e: 0000 1110 */ - {MOV,"A,L", 1, 4}, /* 0f: 0000 1111 */ - - {BLOCK,"D+", 1,13}, /* 10: 0001 0000 */ /* 7807 */ - {BLOCK,"D-", 1,13}, /* 11: 0001 0001 */ /* 7807 */ - {INX,"BC", 1, 7}, /* 12: 0001 0010 */ - {DCX,"BC", 1, 7}, /* 13: 0001 0011 */ - {LXI,"BC,%w", 3,10}, /* 14: 0001 0100 llll llll hhhh hhhh */ - {ORIW,"%a,%b", 3,19}, /* 15: 0001 0101 oooo oooo xxxx xxxx */ - {XRI,"A,%b", 2, 7}, /* 16: 0001 0110 xxxx xxxx */ - {ORI,"A,%b", 2, 7}, /* 17: 0001 0111 xxxx xxxx */ - {MOV,"EAH,A", 1, 4}, /* 18: 0001 1000 */ - {MOV,"EAL,A", 1, 4}, /* 19: 0001 1001 */ - {MOV,"B,A", 1, 4}, /* 1a: 0001 1010 */ - {MOV,"C,A", 1, 4}, /* 1b: 0001 1011 */ - {MOV,"D,A", 1, 4}, /* 1c: 0001 1100 */ - {MOV,"E,A", 1, 4}, /* 1d: 0001 1101 */ - {MOV,"H,A", 1, 4}, /* 1e: 0001 1110 */ - {MOV,"L,A", 1, 4}, /* 1f: 0001 1111 */ - - {INRW,"%a", 2,16}, /* 20: 0010 0000 oooo oooo */ - {JB,0, 1, 4}, /* 21: 0010 0001 */ - {INX,"DE", 1, 7}, /* 22: 0010 0010 */ - {DCX,"DE", 1, 7}, /* 23: 0010 0011 */ - {LXI,"DE,%w", 3,10}, /* 24: 0010 0100 llll llll hhhh hhhh */ - {GTIW,"%a,%b", 3,19}, /* 25: 0010 0101 oooo oooo xxxx xxxx */ - {ADINC,"A,%b", 2, 7}, /* 26: 0010 0110 xxxx xxxx */ - {GTI,"A,%b", 2, 7}, /* 27: 0010 0111 xxxx xxxx */ - {illegal,0, 1, 4}, /* 28: 0010 1000 */ - {LDAX,"(BC)", 1, 7}, /* 29: 0010 1001 */ - {LDAX,"(DE)", 1, 7}, /* 2a: 0010 1010 */ - {LDAX,"(HL)", 1, 7}, /* 2b: 0010 1011 */ - {LDAX,"(DE+)", 1, 7}, /* 2c: 0010 1100 */ - {LDAX,"(HL+)", 1, 7}, /* 2d: 0010 1101 */ - {LDAX,"(DE-)", 1, 7}, /* 2e: 0010 1110 */ - {LDAX,"(HL-)", 1, 7}, /* 2f: 0010 1111 */ - - {DCRW,"%a", 2,16}, /* 30: 0011 0000 oooo oooo */ - {AND,"CY,%i", 2,10}, /* 31: 0011 0001 bbbb bbbb */ /* 7807 */ - {INX,"HL", 1, 7}, /* 32: 0011 0010 */ - {DCX,"HL", 1, 7}, /* 33: 0011 0011 */ - {LXI,"HL,%w", 3,10}, /* 34: 0011 0100 llll llll hhhh hhhh */ - {LTIW,"%a,%b", 3,19}, /* 35: 0011 0101 oooo oooo xxxx xxxx */ - {SUINB,"A,%b", 2, 7}, /* 36: 0011 0110 xxxx xxxx */ - {LTI,"A,%b", 2, 7}, /* 37: 0011 0111 xxxx xxxx */ - {illegal,0, 1, 4}, /* 38: */ - {STAX,"(BC)", 1, 7}, /* 39: 0011 1001 */ - {STAX,"(DE)", 1, 7}, /* 3a: 0011 1010 */ - {STAX,"(HL)", 1, 7}, /* 3b: 0011 1011 */ - {STAX,"(DE+)", 1, 7}, /* 3c: 0011 1100 */ - {STAX,"(HL+)", 1, 7}, /* 3d: 0011 1101 */ - {STAX,"(DE-)", 1, 7}, /* 3e: 0011 1110 */ - {STAX,"(HL-)", 1, 7}, /* 3f: 0011 1111 */ - - {CALL,"%w", 3,16}, /* 40: 0100 0000 llll llll hhhh hhhh */ - {INR,"A", 1, 4}, /* 41: 0100 0001 */ - {INR,"B", 1, 4}, /* 42: 0100 0010 */ - {INR,"C", 1, 4}, /* 43: 0100 0011 */ - {LXI,"EA,%w", 3,10}, /* 44: 0100 0100 llll llll hhhh hhhh */ - {ONIW,"%a,%b", 3,19}, /* 45: 0100 0101 oooo oooo xxxx xxxx */ - {ADI,"A,%b", 2, 7}, /* 46: 0100 0110 xxxx xxxx */ - {ONI,"A,%b", 2, 7}, /* 47: 0100 0111 xxxx xxxx */ - {0,dasm48_7807, 0, 0}, /* 48: prefix */ - {MVIX,"BC,%b", 2,10}, /* 49: 0100 1001 xxxx xxxx */ - {MVIX,"DE,%b", 2,10}, /* 4a: 0100 1010 xxxx xxxx */ - {MVIX,"HL,%b", 2,10}, /* 4b: 0100 1011 xxxx xxxx */ - {0,dasm4C_7807, 0, 0}, /* 4c: prefix */ - {0,dasm4D_7807, 0, 0}, /* 4d: prefix */ - {JRE,"%d", 2,10}, /* 4e: 0100 111d dddd dddd */ - {JRE,"%d", 2,10}, /* 4f: 0100 111d dddd dddd */ - {SKN,"%i", 2,10}, /* 50: 0101 0000 bbbb bbbb */ /* 7807 */ - {DCR,"A", 1, 4}, /* 51: 0101 0001 */ - {DCR,"B", 1, 4}, /* 52: 0101 0010 */ - {DCR,"C", 1, 4}, /* 53: 0101 0011 */ - {JMP,"%w", 3,10}, /* 54: 0101 0100 llll llll hhhh hhhh */ - {OFFIW,"%a,%b", 3,19}, /* 55: 0101 0101 oooo oooo xxxx xxxx */ - {ACI,"A,%b", 2, 7}, /* 56: 0101 0110 xxxx xxxx */ - {OFFI,"A,%b", 2, 7}, /* 57: 0101 0111 xxxx xxxx */ - {SETB,"%i", 2,13}, /* 58: 0101 1000 bbbb bbbb */ /* 7807 */ - {NOT,"%i", 2,13}, /* 59: 0101 1001 bbbb bbbb */ /* 7807 */ - {MOV,"%i,CY", 2,13}, /* 5a: 0101 1010 bbbb bbbb */ /* 7807 */ - {CLR,"%i", 2,13}, /* 5b: 0101 1011 bbbb bbbb */ /* 7807 */ - {OR,"CY,%i", 2,10}, /* 5c: 0101 1100 bbbb bbbb */ /* 7807 */ - {SK,"%i", 2,10}, /* 5d: 0101 1101 bbbb bbbb */ /* 7807 */ - {XOR,"CY,%i", 2,10}, /* 5e: 0101 1110 bbbb bbbb */ /* 7807 */ - {MOV,"CY,%i", 2,10}, /* 5f: 0101 1111 bbbb bbbb */ /* 7807 */ - - {0,dasm60, 0, 0}, /* 60: prefix */ - {DAA,0, 1, 4}, /* 61: 0110 0001 */ - {RETI,0, 1,13}, /* 62: 0110 0010 */ - {STAW,"%a", 2,10}, /* 63: 0110 0011 oooo oooo */ - {0,dasm64_7807, 0, 0}, /* 64: prefix */ - {NEIW,"%a,%b", 3,19}, /* 65: 0110 0101 oooo oooo xxxx xxxx */ - {SUI,"A,%b", 2, 7}, /* 66: 0110 0110 xxxx xxxx */ - {NEI,"A,%b", 2, 7}, /* 67: 0110 0111 xxxx xxxx */ - {MVI,"V,%b", 2, 7}, /* 68: 0110 1000 xxxx xxxx */ - {MVI,"A,%b", 2, 7}, /* 69: 0110 1001 xxxx xxxx */ - {MVI,"B,%b", 2, 7}, /* 6a: 0110 1010 xxxx xxxx */ - {MVI,"C,%b", 2, 7}, /* 6b: 0110 1011 xxxx xxxx */ - {MVI,"D,%b", 2, 7}, /* 6c: 0110 1100 xxxx xxxx */ - {MVI,"E,%b", 2, 7}, /* 6d: 0110 1101 xxxx xxxx */ - {MVI,"H,%b", 2, 7}, /* 6e: 0110 1110 xxxx xxxx */ - {MVI,"L,%b", 2, 7}, /* 6f: 0110 1111 xxxx xxxx */ - - {0,dasm70, 0, 0}, /* 70: prefix */ - {MVIW,"%a,%b", 3,13}, /* 71: 0111 0001 oooo oooo xxxx xxxx */ - {SOFTI,0, 1,16}, /* 72: 0111 0010 */ - {illegal,0, 1, 0}, /* 73: */ - {0,dasm74, 0, 0}, /* 74: prefix */ - {EQIW,"%a,%b", 3,19}, /* 75: 0111 0101 oooo oooo xxxx xxxx */ - {SBI,"A,%b", 2, 7}, /* 76: 0111 0110 xxxx xxxx */ - {EQI,"A,%b", 2, 7}, /* 77: 0111 0111 xxxx xxxx */ - {CALF,"%f", 2,13}, /* 78: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 79: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7a: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7b: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7c: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7d: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7e: 0111 1ddd dddd dddd */ - {CALF,"%f", 2,13}, /* 7f: 0111 1ddd dddd dddd */ - - {CALT,"%t", 1,16}, /* 80: 100t tttt */ - {CALT,"%t", 1,16}, /* 81: 100t tttt */ - {CALT,"%t", 1,16}, /* 82: 100t tttt */ - {CALT,"%t", 1,16}, /* 83: 100t tttt */ - {CALT,"%t", 1,16}, /* 84: 100t tttt */ - {CALT,"%t", 1,16}, /* 85: 100t tttt */ - {CALT,"%t", 1,16}, /* 86: 100t tttt */ - {CALT,"%t", 1,16}, /* 87: 100t tttt */ - {CALT,"%t", 1,16}, /* 88: 100t tttt */ - {CALT,"%t", 1,16}, /* 89: 100t tttt */ - {CALT,"%t", 1,16}, /* 8a: 100t tttt */ - {CALT,"%t", 1,16}, /* 8b: 100t tttt */ - {CALT,"%t", 1,16}, /* 8c: 100t tttt */ - {CALT,"%t", 1,16}, /* 8d: 100t tttt */ - {CALT,"%t", 1,16}, /* 8e: 100t tttt */ - {CALT,"%t", 1,16}, /* 8f: 100t tttt */ - - {CALT,"%t", 1,16}, /* 90: 100t tttt */ - {CALT,"%t", 1,16}, /* 91: 100t tttt */ - {CALT,"%t", 1,16}, /* 92: 100t tttt */ - {CALT,"%t", 1,16}, /* 93: 100t tttt */ - {CALT,"%t", 1,16}, /* 94: 100t tttt */ - {CALT,"%t", 1,16}, /* 95: 100t tttt */ - {CALT,"%t", 1,16}, /* 96: 100t tttt */ - {CALT,"%t", 1,16}, /* 97: 100t tttt */ - {CALT,"%t", 1,16}, /* 98: 100t tttt */ - {CALT,"%t", 1,16}, /* 99: 100t tttt */ - {CALT,"%t", 1,16}, /* 9a: 100t tttt */ - {CALT,"%t", 1,16}, /* 9b: 100t tttt */ - {CALT,"%t", 1,16}, /* 9c: 100t tttt */ - {CALT,"%t", 1,16}, /* 9d: 100t tttt */ - {CALT,"%t", 1,16}, /* 9e: 100t tttt */ - {CALT,"%t", 1,16}, /* 9f: 100t tttt */ - - {POP,"VA", 1,10}, /* a0: 1010 0000 */ - {POP,"BC", 1,10}, /* a1: 1010 0001 */ - {POP,"DE", 1,10}, /* a2: 1010 0010 */ - {POP,"HL", 1,10}, /* a3: 1010 0011 */ - {POP,"EA", 1,10}, /* a4: 1010 0100 */ - {DMOV,"EA,BC", 1, 4}, /* a5: 1010 0101 */ - {DMOV,"EA,DE", 1, 4}, /* a6: 1010 0110 */ - {DMOV,"EA,HL", 1, 4}, /* a7: 1010 0111 */ - {INX,"EA", 1, 7}, /* a8: 1010 1000 */ - {DCX,"EA", 1, 7}, /* a9: 1010 1001 */ - {EI,0, 1, 4}, /* aa: 1010 1010 */ - {LDAX,"(DE+%b)", 2,13}, /* ab: 1010 1011 dddd dddd */ - {LDAX,"(HL+A)", 1,13}, /* ac: 1010 1100 */ - {LDAX,"(HL+B)", 1,13}, /* ad: 1010 1101 */ - {LDAX,"(HL+EA)", 1,13}, /* ae: 1010 1110 */ - {LDAX,"(HL+%b)", 2,13}, /* af: 1010 1111 dddd dddd */ - - {PUSH,"VA", 1,13}, /* b0: 1011 0000 */ - {PUSH,"BC", 1,13}, /* b1: 1011 0001 */ - {PUSH,"DE", 1,13}, /* b2: 1011 0010 */ - {PUSH,"HL", 1,13}, /* b3: 1011 0011 */ - {PUSH,"EA", 1,13}, /* b4: 1011 0100 */ - {DMOV,"BC,EA", 1, 4}, /* b5: 1011 0101 */ - {DMOV,"DE,EA", 1, 4}, /* b6: 1011 0110 */ - {DMOV,"HL,EA", 1, 4}, /* b7: 1011 0111 */ - {RET,0, 1,10}, /* b8: 1011 1000 */ - {RETS,0, 1,10}, /* b9: 1011 1001 */ - {DI,0, 1, 4}, /* ba: 1011 1010 */ - {STAX,"(DE+%b)", 2,13}, /* bb: 1011 1011 dddd dddd */ - {STAX,"(HL+A)", 1,13}, /* bc: 1011 1100 */ - {STAX,"(HL+B)", 1,13}, /* bd: 1011 1101 */ - {STAX,"(HL+EA)", 1,13}, /* be: 1011 1110 */ - {STAX,"(HL+%b)", 2,13}, /* bf: 1011 1111 dddd dddd */ - - {JR,"%o", 1,10}, /* c0: 11oo oooo */ - {JR,"%o", 1,10}, /* c1: 11oo oooo */ - {JR,"%o", 1,10}, /* c2: 11oo oooo */ - {JR,"%o", 1,10}, /* c3: 11oo oooo */ - {JR,"%o", 1,10}, /* c4: 11oo oooo */ - {JR,"%o", 1,10}, /* c5: 11oo oooo */ - {JR,"%o", 1,10}, /* c6: 11oo oooo */ - {JR,"%o", 1,10}, /* c7: 11oo oooo */ - {JR,"%o", 1,10}, /* c8: 11oo oooo */ - {JR,"%o", 1,10}, /* c9: 11oo oooo */ - {JR,"%o", 1,10}, /* ca: 11oo oooo */ - {JR,"%o", 1,10}, /* cb: 11oo oooo */ - {JR,"%o", 1,10}, /* cc: 11oo oooo */ - {JR,"%o", 1,10}, /* cd: 11oo oooo */ - {JR,"%o", 1,10}, /* ce: 11oo oooo */ - {JR,"%o", 1,10}, /* cf: 11oo oooo */ - - {JR,"%o", 1,10}, /* d0: 11oo oooo */ - {JR,"%o", 1,10}, /* d1: 11oo oooo */ - {JR,"%o", 1,10}, /* d2: 11oo oooo */ - {JR,"%o", 1,10}, /* d3: 11oo oooo */ - {JR,"%o", 1,10}, /* d4: 11oo oooo */ - {JR,"%o", 1,10}, /* d5: 11oo oooo */ - {JR,"%o", 1,10}, /* d6: 11oo oooo */ - {JR,"%o", 1,10}, /* d7: 11oo oooo */ - {JR,"%o", 1,10}, /* d8: 11oo oooo */ - {JR,"%o", 1,10}, /* d9: 11oo oooo */ - {JR,"%o", 1,10}, /* da: 11oo oooo */ - {JR,"%o", 1,10}, /* db: 11oo oooo */ - {JR,"%o", 1,10}, /* dc: 11oo oooo */ - {JR,"%o", 1,10}, /* dd: 11oo oooo */ - {JR,"%o", 1,10}, /* de: 11oo oooo */ - {JR,"%o", 1,10}, /* df: 11oo oooo */ - - {JR,"%o", 1,10}, /* e0: 11oo oooo */ - {JR,"%o", 1,10}, /* e1: 11oo oooo */ - {JR,"%o", 1,10}, /* e2: 11oo oooo */ - {JR,"%o", 1,10}, /* e3: 11oo oooo */ - {JR,"%o", 1,10}, /* e4: 11oo oooo */ - {JR,"%o", 1,10}, /* e5: 11oo oooo */ - {JR,"%o", 1,10}, /* e6: 11oo oooo */ - {JR,"%o", 1,10}, /* e7: 11oo oooo */ - {JR,"%o", 1,10}, /* e8: 11oo oooo */ - {JR,"%o", 1,10}, /* e9: 11oo oooo */ - {JR,"%o", 1,10}, /* ea: 11oo oooo */ - {JR,"%o", 1,10}, /* eb: 11oo oooo */ - {JR,"%o", 1,10}, /* ec: 11oo oooo */ - {JR,"%o", 1,10}, /* ed: 11oo oooo */ - {JR,"%o", 1,10}, /* ee: 11oo oooo */ - {JR,"%o", 1,10}, /* ef: 11oo oooo */ - - {JR,"%o", 1,10}, /* f0: 11oo oooo */ - {JR,"%o", 1,10}, /* f1: 11oo oooo */ - {JR,"%o", 1,10}, /* f2: 11oo oooo */ - {JR,"%o", 1,10}, /* f3: 11oo oooo */ - {JR,"%o", 1,10}, /* f4: 11oo oooo */ - {JR,"%o", 1,10}, /* f5: 11oo oooo */ - {JR,"%o", 1,10}, /* f6: 11oo oooo */ - {JR,"%o", 1,10}, /* f7: 11oo oooo */ - {JR,"%o", 1,10}, /* f8: 11oo oooo */ - {JR,"%o", 1,10}, /* f9: 11oo oooo */ - {JR,"%o", 1,10}, /* fa: 11oo oooo */ - {JR,"%o", 1,10}, /* fb: 11oo oooo */ - {JR,"%o", 1,10}, /* fc: 11oo oooo */ - {JR,"%o", 1,10}, /* fd: 11oo oooo */ - {JR,"%o", 1,10}, /* fe: 11oo oooo */ - {JR,"%o", 1,10} /* ff: 11oo oooo */ -}; - - -/* register names for bit manipulation instructions */ -const char *regname[32] = -{ - "illegal", "illegal", "illegal", "illegal", - "illegal", "illegal", "illegal", "illegal", - "illegal", "illegal", "illegal", "illegal", - "illegal", "illegal", "illegal", "illegal", - "PA", "PB", "PC", "PD", - "illegal", "PF", "MKH", "MKL", - "illegal", "SMH", "illegal", "EOM", - "illegal", "TMM", "PT", "illegal" -}; - -static unsigned upd7810_get_reg(int reg) { union cpuinfo info; upd7810_get_info(CPUINFO_INT_REGISTER + (reg), &info); return info.i; } - -unsigned Dasm( char *buffer, unsigned pc, struct dasm_s *dasmXX ) -{ - UINT8 op = cpu_readop(pc++), op2, t; - int offset; - unsigned l, ea; - const char *symbol; - const char *a; - - t = dasmXX[op].token; - a = dasmXX[op].args; - l = dasmXX[op].oplen; - - /* 0 token means prefix opcode (use table from args) */ - if (0 == t) - { - struct dasm_s *p_dasm = (struct dasm_s *)a; - - op2 = cpu_readop(pc++); - t = p_dasm[op2].token; - a = p_dasm[op2].args; - l = p_dasm[op2].oplen; - } - - buffer += sprintf(buffer, "%-8.8s", token[t]); - - while (a && *a) - { - if ('%' == *a) - { - a++; - switch (*a) - { - case 'a': /* address V * 256 + offset */ - op2 = cpu_readop_arg(pc++); - ea = upd7810_get_reg(UPD7810_V) * 256 + op2; - symbol = set_ea_info(0, ea, EA_UINT8, EA_MEM_RD); - buffer += sprintf(buffer, "%s", symbol); - break; - case 'b': /* immediate byte */ - ea = cpu_readop_arg(pc++); - symbol = set_ea_info(1, ea, EA_UINT8, EA_VALUE); - buffer += sprintf(buffer, "%s", symbol); - break; - case 'w': /* immediate word */ - ea = cpu_readop_arg(pc++); - ea += cpu_readop_arg(pc++) << 8; - symbol = set_ea_info(1, ea, EA_UINT16, EA_VALUE); - buffer += sprintf(buffer, "%s", symbol); - break; - case 'd': /* JRE address */ - op2 = cpu_readop(pc++); - offset = (op & 1) ? -(256 - op2): + op2; - symbol = set_ea_info(0, pc - 2, offset + 2, EA_REL_PC); - buffer += sprintf(buffer, "%s", symbol); - break; - case 't': /* CALT address */ - ea = 0x80 + 2 * (op & 0x1f); - symbol = set_ea_info(0, ea, EA_DEFAULT, EA_ABS_PC); - buffer += sprintf(buffer, "(%s)", symbol); - break; - case 'f': /* CALF address */ - op2 = cpu_readop(pc++); - ea = 0x800 + 0x100 * (op & 0x07) + op2; - symbol = set_ea_info(0, ea, EA_DEFAULT, EA_ABS_PC); - buffer += sprintf(buffer, "%s", symbol); - break; - case 'o': /* JR offset */ - op2 = cpu_readop(pc++); - offset = (INT8)(op << 2) >> 2; - symbol = set_ea_info(0, pc - 2, offset + 1, EA_REL_PC); - buffer += sprintf(buffer, "%s", symbol); - break; - case 'i': /* bit manipulation */ - op2 = cpu_readop(pc++); - buffer += sprintf(buffer, "%s,%d", regname[op2 & 0x1f], op2 >> 5); - break; - default: - *buffer++ = *a; - } - } - else - *buffer++ = *a; - a++; - } - *buffer = '\0'; - - return l; -} - -unsigned Dasm7810( char *buffer, unsigned pc ) -{ - return Dasm( buffer, pc, dasmXX_7810 ); -} - -unsigned Dasm7807( char *buffer, unsigned pc ) -{ - return Dasm( buffer, pc, dasmXX_7807 ); -} - -#endif /* MAME_DEBUG */ - diff --git a/jan/src/cpu/upd7810/7810ops.c b/jan/src/cpu/upd7810/7810ops.c deleted file mode 100644 index 060bf6610..000000000 --- a/jan/src/cpu/upd7810/7810ops.c +++ /dev/null @@ -1,9341 +0,0 @@ -/***************************************************************************** - * - * Portable uPD7810/11, 7810H/11H, 78C10/C11/C14 emulator V0.2 - * Copyright (c) 2001 Juergen Buchmueller, all rights reserved. - * - * 7810ops.c - opcode functions - * - *****************************************************************************/ - -static void illegal(void) -{ -// logerror("uPD7810 #%d: illegal opcode %02x at PC:%04x\n", cpu_getactivecpu(), OP, PC); -} - -static void illegal2(void) -{ -// logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, OP2, PC); -} - -/* prefix 48 */ - -/* 48 01: 0100 1000 0000 0001 */ -static void SLRC_A(void) -{ - PSW = (PSW & ~CY) | (A & CY); - A >>= 1; - SKIP_CY; -} - -/* 48 02: 0100 1000 0000 0010 */ -static void SLRC_B(void) -{ - PSW = (PSW & ~CY) | (B & CY); - B >>= 1; - SKIP_CY; -} - -/* 48 03: 0100 1000 0000 0011 */ -static void SLRC_C(void) -{ - PSW = (PSW & ~CY) | (C & CY); - C >>= 1; - SKIP_CY; -} - - -/* 48 05: 0100 1000 0000 0101 */ -static void SLLC_A(void) -{ - PSW = (PSW & ~CY) | ((A >> 7) & CY); - A <<= 1; - SKIP_CY; -} - -/* 48 06: 0100 1000 0000 0110 */ -static void SLLC_B(void) -{ - PSW = (PSW & ~CY) | ((B >> 7) & CY); - B <<= 1; - SKIP_CY; -} - -/* 48 07: 0100 1000 0000 0111 */ -static void SLLC_C(void) -{ - PSW = (PSW & ~CY) | ((C >> 7) & CY); - C <<= 1; - SKIP_CY; -} - -/* 48 08: 0100 1000 0000 1000 */ -static void SK_NV(void) -{ - /* 48 skip never */ -} - -/* 48 0a: 0100 1000 0000 1010 */ -static void SK_CY(void) -{ - if (CY == (PSW & CY)) - PSW |= SK; -} - -/* 48 0b: 0100 1000 0000 1011 */ -static void SK_HC(void) -{ - if (HC == (PSW & HC)) - PSW |= SK; -} - -/* 48 0c: 0100 1000 0000 1100 */ -static void SK_Z(void) -{ - if (Z == (PSW & Z)) - PSW |= SK; -} - -/* 48 18: 0100 1000 0001 1000 */ -static void SKN_NV(void) -{ - /* skip not never -> skip always ;-) */ - PSW |= SK; -} - -/* 48 1a: 0100 1000 0001 1010 */ -static void SKN_CY(void) -{ - if (0 == (PSW & CY)) - PSW |= SK; -} - -/* 48 1b: 0100 1000 0001 1011 */ -static void SKN_HC(void) -{ - if (0 == (PSW & HC)) - PSW |= SK; -} - -/* 48 1c: 0100 1000 0001 1100 */ -static void SKN_Z(void) -{ - if (0 == (PSW & Z)) - PSW |= SK; -} - -/* 48 21: 0100 1000 0010 0001 */ -static void SLR_A(void) -{ - PSW = (PSW & ~CY) | (A & CY); - A >>= 1; -} - -/* 48 22: 0100 1000 0010 0010 */ -static void SLR_B(void) -{ - PSW = (PSW & ~CY) | (B & CY); - B >>= 1; -} - -/* 48 23: 0100 1000 0010 0011 */ -static void SLR_C(void) -{ - PSW = (PSW & ~CY) | (C & CY); - C >>= 1; -} - -/* 48 25: 0100 1000 0010 0101 */ -static void SLL_A(void) -{ - PSW = (PSW & ~CY) | ((A >> 7) & CY); - A <<= 1; -} - -/* 48 26: 0100 1000 0010 0110 */ -static void SLL_B(void) -{ - PSW = (PSW & ~CY) | ((B >> 7) & CY); - B <<= 1; -} - -/* 48 27: 0100 1000 0010 0111 */ -static void SLL_C(void) -{ - PSW = (PSW & ~CY) | ((C >> 7) & CY); - C <<= 1; -} - -/* 48 28: 0100 1000 0010 1000 */ -static void JEA(void) -{ - PC = EA; - change_pc( PCD ); -} - -/* 48 29: 0100 1000 0010 1001 */ -static void CALB(void) -{ - SP--; - WM( SPD, PCH ); - SP--; - WM( SPD, PCL ); - - PC = BC; - change_pc( PCD ); -} - -/* 48 2a: 0100 1000 0010 1010 */ -static void CLC(void) -{ - PSW &= ~CY; -} - -/* 48 2b: 0100 1000 0010 1011 */ -static void STC(void) -{ - PSW |= CY; -} - -/* 48 2d: 0100 1000 0010 1101 */ -static void MUL_A(void) -{ - EA = A * A; -} - -/* 48 2e: 0100 1000 0010 1110 */ -static void MUL_B(void) -{ - EA = A * B; -} - -/* 48 2f: 0100 1000 0010 1111 */ -static void MUL_C(void) -{ - EA = A * C; -} - -/* 48 31: 0100 1000 0011 0001 */ -static void RLR_A(void) -{ - UINT8 carry=(PSW&CY)<<7; - PSW = (PSW & ~CY) | (A & CY); - A = (A >> 1) | carry; -} - -/* 48 32: 0100 1000 0011 0010 */ -static void RLR_B(void) -{ - UINT8 carry=(PSW&CY)<<7; - PSW = (PSW & ~CY) | (B & CY); - B = (B >> 1) | carry; -} - -/* 48 33: 0100 1000 0011 0011 */ -static void RLR_C(void) -{ - UINT8 carry=(PSW&CY)<<7; - PSW = (PSW & ~CY) | (C & CY); - C = (C >> 1) | carry; -} - -/* 48 35: 0100 1000 0011 0101 */ -static void RLL_A(void) -{ - UINT8 carry=PSW&CY; - PSW = (PSW & ~CY) | ((A >> 7) & CY); - A = (A << 1) | carry; -} - -/* 48 36: 0100 1000 0011 0110 */ -static void RLL_B(void) -{ - UINT8 carry=PSW&CY; - PSW = (PSW & ~CY) | ((B >> 7) & CY); - B = (B << 1) | carry; -} - -/* 48 37: 0100 1000 0011 0111 */ -static void RLL_C(void) -{ - UINT8 carry=PSW&CY; - PSW = (PSW & ~CY) | ((C >> 7) & CY); - C = (C << 1) | carry; -} - -/* 48 38: 0100 1000 0011 1000 */ -static void RLD(void) -{ - UINT8 m = RM( HL ), tmp; - tmp = (m << 4) | (A & 0x0f); - A = (A & 0xf0) | (m >> 4); - WM( HL, tmp ); -} - -/* 48 39: 0100 1000 0011 1001 */ -static void RRD(void) -{ - UINT8 m = RM( HL ), tmp; - tmp = (A << 4) | (m >> 4); - A = (A & 0xf0) | (m & 0x0f); - WM( HL, tmp ); -} - -/* 48 3a: 0100 1000 0011 1010 */ -static void NEGA(void) -{ - A = ~A + 1; -} - -/* 48 3b: 0100 1000 0011 1011 */ -static void HALT(void) -{ - int cycles = (upd7810_icount / 4) * 4; - upd7810_icount -= cycles; - upd7810_timers(cycles); - PC -= 1; /* continue executing HALT */ -} - -/* 48 3d: 0100 1000 0011 1101 */ -static void DIV_A(void) -{ - if (A) - { - UINT8 remainder; - remainder = EA % A; - EA /= A; - A = remainder; - } - else - EA = 0xffff; /* guess */ -} - -/* 48 3e: 0100 1000 0011 1110 */ -static void DIV_B(void) -{ - if (B) - { - UINT8 remainder; - remainder = EA % B; - EA /= B; - B = remainder; - } - else - EA = 0xffff; /* guess */ -} - -/* 48 3f: 0100 1000 0011 1111 */ -static void DIV_C(void) -{ - if (C) - { - UINT8 remainder; - remainder = EA % C; - EA /= C; - C = remainder; - } - else - EA = 0xffff; /* guess */ -} - -/* 48 40: 0100 1000 0100 0000 */ -static void SKIT_NMI(void) -{ - if (IRR & INTNMI) - PSW |= SK; - IRR &= ~INTNMI; -} - -/* 48 41: 0100 1000 0100 0001 */ -static void SKIT_FT0(void) -{ - if (IRR & INTFT0) - PSW |= SK; - IRR &= ~INTFT0; -} - -/* 48 42: 0100 1000 0100 0010 */ -static void SKIT_FT1(void) -{ - if (IRR & INTFT1) - PSW |= SK; - IRR &= ~INTFT1; -} - -/* 48 43: 0100 1000 0100 0011 */ -static void SKIT_F1(void) -{ - if (IRR & INTF1) - PSW |= SK; - IRR &= ~INTF1; -} - -/* 48 44: 0100 1000 0100 0100 */ -static void SKIT_F2(void) -{ - if (IRR & INTF2) - PSW |= SK; - IRR &= ~INTF2; -} - -/* 48 45: 0100 1000 0100 0101 */ -static void SKIT_FE0(void) -{ - if (IRR & INTFE0) - PSW |= SK; - IRR &= ~INTFE0; -} - -/* 48 46: 0100 1000 0100 0110 */ -static void SKIT_FE1(void) -{ - if (IRR & INTFE1) - PSW |= SK; - IRR &= ~INTFE1; -} - -/* 48 47: 0100 1000 0100 0111 */ -static void SKIT_FEIN(void) -{ - if (IRR & INTFEIN) - PSW |= SK; - IRR &= ~INTFEIN; -} - -/* 48 48: 0100 1000 0100 1000 */ -static void SKIT_FAD(void) -{ - if (IRR & INTFAD) - PSW |= SK; - IRR &= ~INTFAD; -} - -/* 48 49: 0100 1000 0100 1001 */ -static void SKIT_FSR(void) -{ - if (IRR & INTFSR) - PSW |= SK; - IRR &= ~INTFSR; -} - -/* 48 4a: 0100 1000 0100 1010 */ -static void SKIT_FST(void) -{ - if (IRR & INTFST) - PSW |= SK; - IRR &= ~INTFST; -} - -/* 48 4b: 0100 1000 0100 1011 */ -static void SKIT_ER(void) -{ - if (IRR & INTER) - PSW |= SK; - IRR &= ~INTER; -} - -/* 48 4c: 0100 1000 0100 1100 */ -static void SKIT_OV(void) -{ - if (IRR & INTOV) - PSW |= SK; - IRR &= ~INTOV; -} - -/* 48 50: 0100 1000 0101 0000 */ -static void SKIT_AN4(void) -{ - if (ITF & INTAN4) - PSW |= SK; - ITF &= ~INTAN4; -} - -/* 48 51: 0100 1000 0101 0001 */ -static void SKIT_AN5(void) -{ - if (ITF & INTAN5) - PSW |= SK; - ITF &= ~INTAN5; -} - -/* 48 52: 0100 1000 0101 0010 */ -static void SKIT_AN6(void) -{ - if (ITF & INTAN6) - PSW |= SK; - ITF &= ~INTAN6; -} - -/* 48 53: 0100 1000 0101 0011 */ -static void SKIT_AN7(void) -{ - if (ITF & INTAN7) - PSW |= SK; - ITF &= ~INTAN7; -} - -/* 48 54: 0100 1000 0101 0100 */ -static void SKIT_SB(void) -{ - if (ITF & INTSB) - PSW |= SK; - ITF &= ~INTSB; -} - -/* 48 60: 0100 1000 0110 0000 */ -static void SKNIT_NMI(void) -{ - if (0 == (IRR & INTNMI)) - PSW |= SK; - IRR &= ~INTNMI; -} - -/* 48 61: 0100 1000 0110 0001 */ -static void SKNIT_FT0(void) -{ - if (0 == (IRR & INTFT0)) - PSW |= SK; - IRR &= ~INTFT0; -} - -/* 48 62: 0100 1000 0110 0010 */ -static void SKNIT_FT1(void) -{ - if (0 == (IRR & INTFT1)) - PSW |= SK; - IRR &= ~INTFT1; -} - -/* 48 63: 0100 1000 0110 0011 */ -static void SKNIT_F1(void) -{ - if (0 == (IRR & INTF1)) - PSW |= SK; - IRR &= ~INTF1; -} - -/* 48 64: 0100 1000 0110 0100 */ -static void SKNIT_F2(void) -{ - if (0 == (IRR & INTF2)) - PSW |= SK; - IRR &= ~INTF2; -} - -/* 48 65: 0100 1000 0110 0101 */ -static void SKNIT_FE0(void) -{ - if (0 == (IRR & INTFE0)) - PSW |= SK; - IRR &= ~INTFE0; -} - -/* 48 66: 0100 1000 0110 0110 */ -static void SKNIT_FE1(void) -{ - if (0 == (IRR & INTFE1)) - PSW |= SK; - IRR &= ~INTFE1; -} - -/* 48 67: 0100 1000 0110 0111 */ -static void SKNIT_FEIN(void) -{ - if (0 == (IRR & INTFEIN)) - PSW |= SK; - IRR &= ~INTFEIN; -} - -/* 48 68: 0100 1000 0110 1000 */ -static void SKNIT_FAD(void) -{ - if (0 == (IRR & INTFAD)) - PSW |= SK; - IRR &= ~INTFAD; -} - -/* 48 69: 0100 1000 0110 1001 */ -static void SKNIT_FSR(void) -{ - if (0 == (IRR & INTFSR)) - PSW |= SK; - IRR &= ~INTFSR; -} - -/* 48 6a: 0100 1000 0110 1010 */ -static void SKNIT_FST(void) -{ - if (0 == (IRR & INTFST)) - PSW |= SK; - IRR &= ~INTFST; -} - -/* 48 6b: 0100 1000 0110 1011 */ -static void SKNIT_ER(void) -{ - if (0 == (IRR & INTER)) - PSW |= SK; - IRR &= ~INTER; -} - -/* 48 6c: 0100 1000 0110 1100 */ -static void SKNIT_OV(void) -{ - if (0 == (IRR & INTOV)) - PSW |= SK; - IRR &= ~INTOV; -} - -/* 48 70: 0100 1000 0111 0000 */ -static void SKNIT_AN4(void) -{ - if (0 == (ITF & INTAN4)) - PSW |= SK; - ITF &= ~INTAN4; -} - -/* 48 71: 0100 1000 0111 0001 */ -static void SKNIT_AN5(void) -{ - if (0 == (ITF & INTAN5)) - PSW |= SK; - ITF &= ~INTAN5; -} - -/* 48 72: 0100 1000 0111 0010 */ -static void SKNIT_AN6(void) -{ - if (0 == (ITF & INTAN6)) - PSW |= SK; - ITF &= ~INTAN6; -} - -/* 48 73: 0100 1000 0111 0011 */ -static void SKNIT_AN7(void) -{ - if (0 == (ITF & INTAN7)) - PSW |= SK; - ITF &= ~INTAN7; -} - -/* 48 74: 0100 1000 0111 0100 */ -static void SKNIT_SB(void) -{ - if (0 == (ITF & INTSB)) - PSW |= SK; - ITF &= ~INTSB; -} - -/* 48 82: 0100 1000 1000 0010 */ -static void LDEAX_D(void) -{ - EAL = RM( DE ); - EAH = RM( DE + 1 ); -} - -/* 48 83: 0100 1000 1000 0011 */ -static void LDEAX_H(void) -{ - EAL = RM( HL ); - EAH = RM( HL + 1 ); -} - -/* 48 84: 0100 1000 1000 0100 */ -static void LDEAX_Dp(void) -{ - EAL = RM( DE ); - EAH = RM( DE + 1 ); - DE += 2; -} - -/* 48 85: 0100 1000 1000 0101 */ -static void LDEAX_Hp(void) -{ - EAL = RM( HL ); - EAH = RM( HL + 1 ); - HL += 2; -} - -/* 48 8b: 0100 1000 1000 1011 xxxx xxxx */ -static void LDEAX_D_xx(void) -{ - UINT16 ea; - RDOPARG( ea ); - ea += DE; - EAL = RM( ea ); - EAH = RM( ea + 1 ); -} - -/* 48 8c: 0100 1000 1000 1100 */ -static void LDEAX_H_A(void) -{ - UINT16 ea = HL + A; - EAL = RM( ea ); - EAH = RM( ea + 1 ); -} - -/* 48 8d: 0100 1000 1000 1101 */ -static void LDEAX_H_B(void) -{ - UINT16 ea = HL + B; - EAL = RM( ea ); - EAH = RM( ea + 1 ); -} - -/* 48 8e: 0100 1000 1000 1110 */ -static void LDEAX_H_EA(void) -{ - UINT16 ea = HL + EA; - EAL = RM( ea ); - EAH = RM( ea + 1 ); -} - -/* 48 8f: 0100 1000 1000 1111 xxxx xxxx */ -static void LDEAX_H_xx(void) -{ - UINT16 ea; - RDOPARG( ea ); - ea += HL; - EAL = RM( ea ); - EAH = RM( ea + 1 ); -} - -/* 48 92: 0100 1000 1000 0010 */ -static void STEAX_D(void) -{ - WM( DE, EAL ); - WM( DE + 1, EAH ); -} - -/* 48 93: 0100 1000 1000 0011 */ -static void STEAX_H(void) -{ - WM( HL, EAL ); - WM( HL + 1, EAH ); -} - -/* 48 94: 0100 1000 1000 0100 */ -static void STEAX_Dp(void) -{ - WM( DE, EAL ); - WM( DE + 1, EAH ); - DE += 2; -} - -/* 48 95: 0100 1000 1000 0101 */ -static void STEAX_Hp(void) -{ - WM( HL, EAL ); - WM( HL + 1, EAH ); - HL += 2; -} - -/* 48 9b: 0100 1000 1000 1011 xxxx xxxx */ -static void STEAX_D_xx(void) -{ - UINT16 ea; - RDOPARG( ea ); - ea += DE; - WM( ea, EAL ); - WM( ea + 1, EAH ); -} - -/* 48 9c: 0100 1000 1000 1100 */ -static void STEAX_H_A(void) -{ - UINT16 ea = HL + A; - WM( ea, EAL ); - WM( ea + 1, EAH ); -} - -/* 48 9d: 0100 1000 1000 1101 */ -static void STEAX_H_B(void) -{ - UINT16 ea = HL + B; - WM( ea, EAL ); - WM( ea + 1, EAH ); -} - -/* 48 9e: 0100 1000 1000 1110 */ -static void STEAX_H_EA(void) -{ - UINT16 ea = HL + EA; - WM( ea, EAL ); - WM( ea + 1, EAH ); -} - -/* 48 9f: 0100 1000 1000 1111 xxxx xxxx */ -static void STEAX_H_xx(void) -{ - UINT16 ea; - RDOPARG( ea ); - ea += HL; - WM( ea, EAL ); - WM( ea + 1, EAH ); -} - -/* 48 a0: 0100 1000 1010 0000 */ -static void DSLR_EA(void) -{ - PSW = (PSW & ~CY) | (EA & CY); - EA >>= 1; -} - -/* 48 a4: 0100 1000 1010 0100 */ -static void DSLL_EA(void) -{ - PSW = (PSW & ~CY) | ((EA >> 15) & CY); - EA <<= 1; -} - -/* 48 a8: 0100 1000 1010 1000 */ -static void TABLE(void) -{ - UINT16 ea = PC + A + 1; - C = RM( ea ); - B = RM( ea + 1 ); -} - -/* 48 b0: 0100 1000 1011 0000 */ -static void DRLR_EA(void) -{ - UINT8 carry=PSW&CY; - PSW = (PSW & ~CY) | (EA & CY); - EA = (EA >> 1) | (carry << 15); -} - -/* 48 b4: 0100 1000 1011 0100 */ -static void DRLL_EA(void) -{ - UINT8 carry=PSW&CY; - PSW = (PSW & ~CY) | ((EA >> 15) & CY); - EA = (EA << 1) | carry; -} - -/* 48 bb: 0100 1000 1011 1011 */ -static void STOP(void) -{ - int cycles = (upd7810_icount / 4) * 4; - upd7810_icount -= cycles; - upd7810_timers(cycles); - PC -= 1; -} - -/* 48 c0: 0100 1000 1100 0000 */ -static void DMOV_EA_ECNT(void) -{ - EA = ECNT; -} - -/* 48 c1: 0100 1000 1100 0001 */ -static void DMOV_EA_ECPT(void) -{ - EA = ECPT; -} - -/* 48 d2: 0100 1000 1101 0010 */ -static void DMOV_ETM0_EA(void) -{ - ETM0 = EA; -} - -/* 48 d3: 0100 1000 1101 0011 */ -static void DMOV_ETM1_EA(void) -{ - ETM1 = EA; -} - -/* prefix 4C */ -/* 4c c0: 0100 1100 1100 0000 */ -static void MOV_A_PA(void) -{ - A = RP( UPD7810_PORTA ); -} - -/* 4c c1: 0100 1100 1100 0001 */ -static void MOV_A_PB(void) -{ - A = RP( UPD7810_PORTB ); -} - -/* 4c c2: 0100 1100 1100 0010 */ -static void MOV_A_PC(void) -{ - A = RP( UPD7810_PORTC ); -} - -/* 4c c3: 0100 1100 1100 0011 */ -static void MOV_A_PD(void) -{ - A = RP( UPD7810_PORTD ); -} - -/* 4c c5: 0100 1100 1100 0101 */ -static void MOV_A_PF(void) -{ - A = RP( UPD7810_PORTF ); -} - -/* 4c c6: 0100 1100 1100 0110 */ -static void MOV_A_MKH(void) -{ - A = MKH; -} - -/* 4c c7: 0100 1100 1100 0111 */ -static void MOV_A_MKL(void) -{ - A = MKL; -} - -/* 4c c8: 0100 1100 1100 1000 */ -static void MOV_A_ANM(void) -{ - A = ANM; -} - -/* 4c c9: 0100 1100 1100 1001 */ -static void MOV_A_SMH(void) -{ - A = SMH; -} - -/* 4c cb: 0100 1100 1100 1011 */ -static void MOV_A_EOM(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - A = eom; -} - -/* 4c cd: 0100 1100 1100 1101 */ -static void MOV_A_TMM(void) -{ - A = TMM; -} - -/* 4c ce: 0100 1100 1110 0000 (7807 only) */ -static void MOV_A_PT(void) -{ - A = RP( UPD7807_PORTT ); -} - -/* 4c d9: 0100 1100 1101 1001 */ -static void MOV_A_RXB(void) -{ - A = RXB; -} - -/* 4c e0: 0100 1100 1110 0000 */ -static void MOV_A_CR0(void) -{ - A = CR0; -} - -/* 4c e1: 0100 1100 1110 0001 */ -static void MOV_A_CR1(void) -{ - A = CR1; -} - -/* 4c e2: 0100 1100 1110 0010 */ -static void MOV_A_CR2(void) -{ - A = CR2; -} - -/* 4c e3: 0100 1100 1110 0011 */ -static void MOV_A_CR3(void) -{ - A = CR3; -} - -/* prefix 4D */ -/* 4d c0: 0100 1101 1100 0000 */ -static void MOV_PA_A(void) -{ - WP( UPD7810_PORTA, A ); -} - -/* 4d c1: 0100 1101 1100 0001 */ -static void MOV_PB_A(void) -{ - WP( UPD7810_PORTB, A ); -} - -/* 4d c2: 0100 1101 1100 0010 */ -static void MOV_PC_A(void) -{ - WP( UPD7810_PORTC, A ); -} - -/* 4d c3: 0100 1101 1100 0011 */ -static void MOV_PD_A(void) -{ - WP( UPD7810_PORTD, A ); -} - -/* 4d c5: 0100 1101 1100 0101 */ -static void MOV_PF_A(void) -{ - WP( UPD7810_PORTF, A ); -} - -/* 4d c6: 0100 1101 1100 0110 */ -static void MOV_MKH_A(void) -{ - MKH = A; -} - -/* 4d c7: 0100 1101 1100 0111 */ -static void MOV_MKL_A(void) -{ - MKL = A; -} - -/* 4d c8: 0100 1101 1100 1000 */ -static void MOV_ANM_A(void) -{ - ANM = A; -} - -/* 4d c9: 0100 1101 1100 1001 */ -static void MOV_SMH_A(void) -{ - SMH = A; -} - -/* 4d ca: 0100 1101 1100 1010 */ -static void MOV_SML_A(void) -{ - SML = A; -} - -/* 4d cb: 0100 1101 1100 1011 */ -static void MOV_EOM_A(void) -{ - EOM = A; - upd7810_write_EOM(); -} - -/* 4d cc: 0100 1101 1100 1100 */ -static void MOV_ETMM_A(void) -{ - ETMM = A; -} - -/* 4d cd: 0100 1101 1100 1101 */ -static void MOV_TMM_A(void) -{ - TMM = A; -} - -/* 4d d0: 0100 1101 1101 0000 */ -static void MOV_MM_A(void) -{ - MM = A; -} - -/* 4d d1: 0100 1101 1101 0001 */ -static void MOV_MCC_A(void) -{ - MCC = A; -} - -/* 4d d2: 0100 1101 1101 0010 */ -static void MOV_MA_A(void) -{ - MA = A; -} - -/* 4d d3: 0100 1101 1101 0011 */ -static void MOV_MB_A(void) -{ - MB = A; -} - -/* 4d d4: 0100 1101 1101 0100 */ -static void MOV_MC_A(void) -{ - MC = A; -} - -/* 4d d7: 0100 1101 1101 0111 */ -static void MOV_MF_A(void) -{ - MF = A; -} - -/* 4d d8: 0100 1101 1101 1000 */ -static void MOV_TXB_A(void) -{ - TXB = A; - upd7810_write_TXB(); -} - -/* 4d da: 0100 1101 1101 1010 */ -static void MOV_TM0_A(void) -{ - TM0 = A; -} - -/* 4d db: 0100 1101 1101 1011 */ -static void MOV_TM1_A(void) -{ - TM1 = A; -} - -/* 4d e8: 0100 1101 1110 1000 */ -static void MOV_ZCM_A(void) -{ - ZCM = A; -} - -/* prefix 60 */ -/* 60 08: 0110 0000 0000 1000 */ -static void ANA_V_A(void) -{ - V &= A; - SET_Z(V); -} - -/* 60 09: 0110 0000 0000 1001 */ -static void ANA_A_A(void) -{ - A &= A; - SET_Z(A); -} - -/* 60 0a: 0110 0000 0000 1010 */ -static void ANA_B_A(void) -{ - B &= A; - SET_Z(B); -} - -/* 60 0b: 0110 0000 0000 1011 */ -static void ANA_C_A(void) -{ - C &= A; - SET_Z(C); -} - -/* 60 0c: 0110 0000 0000 1100 */ -static void ANA_D_A(void) -{ - D &= A; - SET_Z(D); -} - -/* 60 0d: 0110 0000 0000 1101 */ -static void ANA_E_A(void) -{ - E &= A; - SET_Z(E); -} - -/* 60 0e: 0110 0000 0000 1110 */ -static void ANA_H_A(void) -{ - H &= A; - SET_Z(H); -} - -/* 60 0f: 0110 0000 0000 1111 */ -static void ANA_L_A(void) -{ - L &= A; - SET_Z(L); -} - -/* 60 10: 0110 0000 0001 0000 */ -static void XRA_V_A(void) -{ - V ^= A; - SET_Z(V); -} - -/* 60 11: 0110 0000 0001 0001 */ -static void XRA_A_A(void) -{ - A ^= A; - SET_Z(A); -} - -/* 60 12: 0110 0000 0001 0010 */ -static void XRA_B_A(void) -{ - B ^= A; - SET_Z(B); -} - -/* 60 13: 0110 0000 0001 0011 */ -static void XRA_C_A(void) -{ - C ^= A; - SET_Z(C); -} - -/* 60 14: 0110 0000 0001 0100 */ -static void XRA_D_A(void) -{ - D ^= A; - SET_Z(D); -} - -/* 60 15: 0110 0000 0001 0101 */ -static void XRA_E_A(void) -{ - E ^= A; - SET_Z(E); -} - -/* 60 16: 0110 0000 0001 0110 */ -static void XRA_H_A(void) -{ - H ^= A; - SET_Z(H); -} - -/* 60 17: 0110 0000 0001 0111 */ -static void XRA_L_A(void) -{ - L ^= A; - SET_Z(L); -} - -/* 60 18: 0110 0000 0001 1000 */ -static void ORA_V_A(void) -{ - V |= A; - SET_Z(V); -} - -/* 60 19: 0110 0000 0001 1001 */ -static void ORA_A_A(void) -{ - A |= A; - SET_Z(A); -} - -/* 60 1a: 0110 0000 0001 1010 */ -static void ORA_B_A(void) -{ - B |= A; - SET_Z(B); -} - -/* 60 1b: 0110 0000 0001 1011 */ -static void ORA_C_A(void) -{ - C |= A; - SET_Z(C); -} - -/* 60 1c: 0110 0000 0001 1100 */ -static void ORA_D_A(void) -{ - D |= A; - SET_Z(D); -} - -/* 60 1d: 0110 0000 0001 1101 */ -static void ORA_E_A(void) -{ - E |= A; - SET_Z(E); -} - -/* 60 1e: 0110 0000 0001 1110 */ -static void ORA_H_A(void) -{ - H |= A; - SET_Z(H); -} - -/* 60 1f: 0110 0000 0001 1111 */ -static void ORA_L_A(void) -{ - L |= A; - SET_Z(L); -} - -/* 60 20: 0110 0000 0010 0000 */ -static void ADDNC_V_A(void) -{ - UINT8 tmp = V + A; - ZHC_ADD( tmp, V, 0 ); - V = tmp; - SKIP_NC; -} - -/* 60 21: 0110 0000 0010 0001 */ -static void ADDNC_A_A(void) -{ - UINT8 tmp = A + A; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 22: 0110 0000 0010 0010 */ -static void ADDNC_B_A(void) -{ - UINT8 tmp = B + A; - ZHC_ADD( tmp, B, 0 ); - B = tmp; - SKIP_NC; -} - -/* 60 23: 0110 0000 0010 0011 */ -static void ADDNC_C_A(void) -{ - UINT8 tmp = C + A; - ZHC_ADD( tmp, C, 0 ); - C = tmp; - SKIP_NC; -} - -/* 60 24: 0110 0000 0010 0100 */ -static void ADDNC_D_A(void) -{ - UINT8 tmp = D + A; - ZHC_ADD( tmp, D, 0 ); - D = tmp; - SKIP_NC; -} - -/* 60 25: 0110 0000 0010 0101 */ -static void ADDNC_E_A(void) -{ - UINT8 tmp = E + A; - ZHC_ADD( tmp, E, 0 ); - E = tmp; - SKIP_NC; -} - -/* 60 26: 0110 0000 0010 0110 */ -static void ADDNC_H_A(void) -{ - UINT8 tmp = H + A; - ZHC_ADD( tmp, H, 0 ); - H = tmp; - SKIP_NC; -} - -/* 60 27: 0110 0000 0010 0111 */ -static void ADDNC_L_A(void) -{ - UINT8 tmp = L + A; - ZHC_ADD( tmp, L, 0 ); - L = tmp; - SKIP_NC; -} - -/* 60 28: 0110 0000 0010 1000 */ -static void GTA_V_A(void) -{ - UINT16 tmp = V - A - 1; - ZHC_SUB( tmp, V, 0 ); - SKIP_NC; -} - -/* 60 29: 0110 0000 0010 1001 */ -static void GTA_A_A(void) -{ - UINT16 tmp = A - A - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 60 2a: 0110 0000 0010 1010 */ -static void GTA_B_A(void) -{ - UINT16 tmp = B - A - 1; - ZHC_SUB( tmp, B, 0 ); - SKIP_NC; -} - -/* 60 2b: 0110 0000 0010 1011 */ -static void GTA_C_A(void) -{ - UINT16 tmp = C - A - 1; - ZHC_SUB( tmp, C, 0 ); - SKIP_NC; -} - -/* 60 2c: 0110 0000 0010 1100 */ -static void GTA_D_A(void) -{ - UINT16 tmp = D - A - 1; - ZHC_SUB( tmp, D, 0 ); - SKIP_NC; -} - -/* 60 2d: 0110 0000 0010 1101 */ -static void GTA_E_A(void) -{ - UINT16 tmp = E - A - 1; - ZHC_SUB( tmp, E, 0 ); - SKIP_NC; -} - -/* 60 2e: 0110 0000 0010 1110 */ -static void GTA_H_A(void) -{ - UINT16 tmp = H - A - 1; - ZHC_SUB( tmp, H, 0 ); - SKIP_NC; -} - -/* 60 2f: 0110 0000 0010 1111 */ -static void GTA_L_A(void) -{ - UINT16 tmp = L - A - 1; - ZHC_SUB( tmp, L, 0 ); - SKIP_NC; -} - -/* 60 30: 0110 0000 0011 0000 */ -static void SUBNB_V_A(void) -{ - UINT8 tmp = V - A; - ZHC_SUB( tmp, V, 0 ); - V = tmp; - SKIP_NC; -} - -/* 60 31: 0110 0000 0011 0001 */ -static void SUBNB_A_A(void) -{ - UINT8 tmp = A - A; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 32: 0110 0000 0011 0010 */ -static void SUBNB_B_A(void) -{ - UINT8 tmp = B - A; - ZHC_SUB( tmp, B, 0 ); - B = tmp; - SKIP_NC; -} - -/* 60 33: 0110 0000 0011 0011 */ -static void SUBNB_C_A(void) -{ - UINT8 tmp = C - A; - ZHC_SUB( tmp, C, 0 ); - C = tmp; - SKIP_NC; -} - -/* 60 34: 0110 0000 0011 0100 */ -static void SUBNB_D_A(void) -{ - UINT8 tmp = D - A; - ZHC_SUB( tmp, D, 0 ); - D = tmp; - SKIP_NC; -} - -/* 60 35: 0110 0000 0011 0101 */ -static void SUBNB_E_A(void) -{ - UINT8 tmp = E - A; - ZHC_SUB( tmp, E, 0 ); - E = tmp; - SKIP_NC; -} - -/* 60 36: 0110 0000 0011 0110 */ -static void SUBNB_H_A(void) -{ - UINT8 tmp = H - A; - ZHC_SUB( tmp, H, 0 ); - H = tmp; - SKIP_NC; -} - -/* 60 37: 0110 0000 0011 0111 */ -static void SUBNB_L_A(void) -{ - UINT8 tmp = L - A; - ZHC_SUB( tmp, L, 0 ); - L = tmp; - SKIP_NC; -} - -/* 60 38: 0110 0000 0011 1000 */ -static void LTA_V_A(void) -{ - UINT8 tmp = V - A; - ZHC_SUB( tmp, V, 0 ); - SKIP_CY; -} - -/* 60 39: 0110 0000 0011 1001 */ -static void LTA_A_A(void) -{ - UINT8 tmp = A - A; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 60 3a: 0110 0000 0011 1010 */ -static void LTA_B_A(void) -{ - UINT8 tmp = B - A; - ZHC_SUB( tmp, B, 0 ); - SKIP_CY; -} - -/* 60 3b: 0110 0000 0011 1011 */ -static void LTA_C_A(void) -{ - UINT8 tmp = C - A; - ZHC_SUB( tmp, C, 0 ); - SKIP_CY; -} - -/* 60 3c: 0110 0000 0011 1100 */ -static void LTA_D_A(void) -{ - UINT8 tmp = D - A; - ZHC_SUB( tmp, D, 0 ); - SKIP_CY; -} - -/* 60 3d: 0110 0000 0011 1101 */ -static void LTA_E_A(void) -{ - UINT8 tmp = E - A; - ZHC_SUB( tmp, E, 0 ); - SKIP_CY; -} - -/* 60 3e: 0110 0000 0011 1110 */ -static void LTA_H_A(void) -{ - UINT8 tmp = H - A; - ZHC_SUB( tmp, H, 0 ); - SKIP_CY; -} - -/* 60 3f: 0110 0000 0011 1111 */ -static void LTA_L_A(void) -{ - UINT8 tmp = L - A; - ZHC_SUB( tmp, L, 0 ); - SKIP_CY; -} - -/* 60 40: 0110 0000 0100 0000 */ -static void ADD_V_A(void) -{ - UINT8 tmp = V + A; - ZHC_ADD( tmp, V, 0 ); - V = tmp; -} - -/* 60 41: 0110 0000 0100 0001 */ -static void ADD_A_A(void) -{ - UINT8 tmp = A + A; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 60 42: 0110 0000 0100 0010 */ -static void ADD_B_A(void) -{ - UINT8 tmp = B + A; - ZHC_ADD( tmp, B, 0 ); - B = tmp; -} - -/* 60 43: 0110 0000 0100 0011 */ -static void ADD_C_A(void) -{ - UINT8 tmp = C + A; - ZHC_ADD( tmp, C, 0 ); - C = tmp; -} - -/* 60 44: 0110 0000 0100 0100 */ -static void ADD_D_A(void) -{ - UINT8 tmp = D + A; - ZHC_ADD( tmp, D, 0 ); - D = tmp; -} - -/* 60 45: 0110 0000 0100 0101 */ -static void ADD_E_A(void) -{ - UINT8 tmp = E + A; - ZHC_ADD( tmp, E, 0 ); - E = tmp; -} - -/* 60 46: 0110 0000 0100 0110 */ -static void ADD_H_A(void) -{ - UINT8 tmp = H + A; - ZHC_ADD( tmp, H, 0 ); - H = tmp; -} - -/* 60 47: 0110 0000 0100 0111 */ -static void ADD_L_A(void) -{ - UINT8 tmp = L + A; - ZHC_ADD( tmp, L, 0 ); - L = tmp; -} - -/* 60 50: 0110 0000 0101 0000 */ -static void ADC_V_A(void) -{ - UINT8 tmp = V + A + (PSW & CY); - ZHC_ADD( tmp, V, (PSW & CY) ); - V = tmp; -} - -/* 60 51: 0110 0000 0101 0001 */ -static void ADC_A_A(void) -{ - UINT8 tmp = A + A + (PSW & CY); - ZHC_ADD( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 52: 0110 0000 0101 0010 */ -static void ADC_B_A(void) -{ - UINT8 tmp = B + A + (PSW & CY); - ZHC_ADD( tmp, B, (PSW & CY) ); - B = tmp; -} - -/* 60 53: 0110 0000 0101 0011 */ -static void ADC_C_A(void) -{ - UINT8 tmp = C + A + (PSW & CY); - ZHC_ADD( tmp, C, (PSW & CY) ); - C = tmp; -} - -/* 60 54: 0110 0000 0101 0100 */ -static void ADC_D_A(void) -{ - UINT8 tmp = D + A + (PSW & CY); - ZHC_ADD( tmp, D, (PSW & CY) ); - D = tmp; -} - -/* 60 55: 0110 0000 0101 0101 */ -static void ADC_E_A(void) -{ - UINT8 tmp = E + A + (PSW & CY); - ZHC_ADD( tmp, E, (PSW & CY) ); - E = tmp; -} - -/* 60 56: 0110 0000 0101 0110 */ -static void ADC_H_A(void) -{ - UINT8 tmp = H + A + (PSW & CY); - ZHC_ADD( tmp, H, (PSW & CY) ); - H = tmp; -} - -/* 60 57: 0110 0000 0101 0111 */ -static void ADC_L_A(void) -{ - UINT8 tmp = L + A + (PSW & CY); - ZHC_ADD( tmp, L, (PSW & CY) ); - L = tmp; -} - -/* 60 60: 0110 0000 0110 0000 */ -static void SUB_V_A(void) -{ - UINT8 tmp = V - A; - ZHC_SUB( tmp, V, 0 ); - V = tmp; -} - -/* 60 61: 0110 0000 0110 0001 */ -static void SUB_A_A(void) -{ - UINT8 tmp = A - A; - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 60 62: 0110 0000 0110 0010 */ -static void SUB_B_A(void) -{ - UINT8 tmp = B - A; - ZHC_SUB( tmp, B, 0 ); - B = tmp; -} - -/* 60 63: 0110 0000 0110 0011 */ -static void SUB_C_A(void) -{ - UINT8 tmp = C - A; - ZHC_SUB( tmp, C, 0 ); - C = tmp; -} - -/* 60 64: 0110 0000 0110 0100 */ -static void SUB_D_A(void) -{ - UINT8 tmp = D - A; - ZHC_SUB( tmp, D, 0 ); - D = tmp; -} - -/* 60 65: 0110 0000 0110 0101 */ -static void SUB_E_A(void) -{ - UINT8 tmp = E - A; - ZHC_SUB( tmp, E, 0 ); - E = tmp; -} - -/* 60 66: 0110 0000 0110 0110 */ -static void SUB_H_A(void) -{ - UINT8 tmp = H - A; - ZHC_SUB( tmp, H, 0 ); - H = tmp; -} - -/* 60 67: 0110 0000 0110 0111 */ -static void SUB_L_A(void) -{ - UINT8 tmp = L - A; - ZHC_SUB( tmp, L, 0 ); - L = tmp; -} - -/* 60 68: 0110 0000 0110 1000 */ -static void NEA_V_A(void) -{ - UINT8 tmp = V - A; - ZHC_SUB( tmp, V, 0 ); - SKIP_NZ; -} - -/* 60 69: 0110 0000 0110 1001 */ -static void NEA_A_A(void) -{ - UINT8 tmp = A - A; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 60 6a: 0110 0000 0110 1010 */ -static void NEA_B_A(void) -{ - UINT8 tmp = B - A; - ZHC_SUB( tmp, B, 0 ); - SKIP_NZ; -} - -/* 60 6b: 0110 0000 0110 1011 */ -static void NEA_C_A(void) -{ - UINT8 tmp = C - A; - ZHC_SUB( tmp, C, 0 ); - SKIP_NZ; -} - -/* 60 6c: 0110 0000 0110 1100 */ -static void NEA_D_A(void) -{ - UINT8 tmp = D - A; - ZHC_SUB( tmp, D, 0 ); - SKIP_NZ; -} - -/* 60 6d: 0110 0000 0110 1101 */ -static void NEA_E_A(void) -{ - UINT8 tmp = E - A; - ZHC_SUB( tmp, E, 0 ); - SKIP_NZ; -} - -/* 60 6e: 0110 0000 0110 1110 */ -static void NEA_H_A(void) -{ - UINT8 tmp = H - A; - ZHC_SUB( tmp, H, 0 ); - SKIP_NZ; -} - -/* 60 6f: 0110 0000 0110 1111 */ -static void NEA_L_A(void) -{ - UINT8 tmp = L - A; - ZHC_SUB( tmp, L, 0 ); - SKIP_NZ; -} - -/* 60 70: 0110 0000 0111 0000 */ -static void SBB_V_A(void) -{ - UINT8 tmp = V - A - (PSW & CY); - ZHC_SUB( tmp, V, (PSW & CY) ); - V = tmp; -} - -/* 60 71: 0110 0000 0111 0001 */ -static void SBB_A_A(void) -{ - UINT8 tmp = A - A - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 72: 0110 0000 0111 0010 */ -static void SBB_B_A(void) -{ - UINT8 tmp = B - A - (PSW & CY); - ZHC_SUB( tmp, B, (PSW & CY) ); - B = tmp; -} - -/* 60 73: 0110 0000 0111 0011 */ -static void SBB_C_A(void) -{ - UINT8 tmp = C - A - (PSW & CY); - ZHC_SUB( tmp, C, (PSW & CY) ); - C = tmp; -} - -/* 60 74: 0110 0000 0111 0100 */ -static void SBB_D_A(void) -{ - UINT8 tmp = D - A - (PSW & CY); - ZHC_SUB( tmp, D, (PSW & CY) ); - D = tmp; -} - -/* 60 75: 0110 0000 0111 0101 */ -static void SBB_E_A(void) -{ - UINT8 tmp = E - A - (PSW & CY); - ZHC_SUB( tmp, E, (PSW & CY) ); - E = tmp; -} - -/* 60 76: 0110 0000 0111 0110 */ -static void SBB_H_A(void) -{ - UINT8 tmp = H - A - (PSW & CY); - ZHC_SUB( tmp, H, (PSW & CY) ); - H = tmp; -} - -/* 60 77: 0110 0000 0111 0111 */ -static void SBB_L_A(void) -{ - UINT8 tmp = L - A - (PSW & CY); - ZHC_SUB( tmp, L, (PSW & CY) ); - L = tmp; -} - -/* 60 78: 0110 0000 0111 1000 */ -static void EQA_V_A(void) -{ - UINT8 tmp = V - A; - ZHC_SUB( tmp, V, 0 ); - SKIP_Z; -} - -/* 60 79: 0110 0000 0111 1001 */ -static void EQA_A_A(void) -{ - UINT8 tmp = A - A; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 60 7a: 0110 0000 0111 1010 */ -static void EQA_B_A(void) -{ - UINT8 tmp = B - A; - ZHC_SUB( tmp, B, 0 ); - SKIP_Z; -} - -/* 60 7b: 0110 0000 0111 1011 */ -static void EQA_C_A(void) -{ - UINT8 tmp = C - A; - ZHC_SUB( tmp, C, 0 ); - SKIP_Z; -} - -/* 60 7c: 0110 0000 0111 1100 */ -static void EQA_D_A(void) -{ - UINT8 tmp = D - A; - ZHC_SUB( tmp, D, 0 ); - SKIP_Z; -} - -/* 60 7d: 0110 0000 0111 1101 */ -static void EQA_E_A(void) -{ - UINT8 tmp = E - A; - ZHC_SUB( tmp, E, 0 ); - SKIP_Z; -} - -/* 60 7e: 0110 0000 0111 1110 */ -static void EQA_H_A(void) -{ - UINT8 tmp = H - A; - ZHC_SUB( tmp, H, 0 ); - SKIP_Z; -} - -/* 60 7f: 0110 0000 0111 1111 */ -static void EQA_L_A(void) -{ - UINT8 tmp = L - A; - ZHC_SUB( tmp, L, 0 ); - SKIP_Z; -} - -/* 60 88: 0110 0000 1000 1000 */ -static void ANA_A_V(void) -{ - A &= V; - SET_Z(A); -} - -/* 60 89: 0110 0000 1000 1001 */ -/* ANA_A_A already defined */ - -/* 60 8a: 0110 0000 1000 1010 */ -static void ANA_A_B(void) -{ - A &= B; - SET_Z(A); -} - -/* 60 8b: 0110 0000 1000 1011 */ -static void ANA_A_C(void) -{ - A &= C; - SET_Z(A); -} - -/* 60 8c: 0110 0000 1000 1100 */ -static void ANA_A_D(void) -{ - A &= D; - SET_Z(A); -} - -/* 60 8d: 0110 0000 1000 1101 */ -static void ANA_A_E(void) -{ - A &= E; - SET_Z(A); -} - -/* 60 8e: 0110 0000 1000 1110 */ -static void ANA_A_H(void) -{ - A &= H; - SET_Z(A); -} - -/* 60 8f: 0110 0000 1000 1111 */ -static void ANA_A_L(void) -{ - A &= L; - SET_Z(A); -} - -/* 60 90: 0110 0000 1001 0000 */ -static void XRA_A_V(void) -{ - A ^= V; - SET_Z(A); -} - -/* 60 91: 0110 0000 1001 0001 */ -/* XRA_A_A already defined */ - -/* 60 92: 0110 0000 1001 0010 */ -static void XRA_A_B(void) -{ - A ^= B; - SET_Z(A); -} - -/* 60 93: 0110 0000 1001 0011 */ -static void XRA_A_C(void) -{ - A ^= C; - SET_Z(A); -} - -/* 60 94: 0110 0000 1001 0100 */ -static void XRA_A_D(void) -{ - A ^= D; - SET_Z(A); -} - -/* 60 95: 0110 0000 1001 0101 */ -static void XRA_A_E(void) -{ - A ^= E; - SET_Z(A); -} - -/* 60 96: 0110 0000 1001 0110 */ -static void XRA_A_H(void) -{ - A ^= H; - SET_Z(A); -} - -/* 60 97: 0110 0000 1001 0111 */ -static void XRA_A_L(void) -{ - A ^= L; - SET_Z(A); -} - -/* 60 98: 0110 0000 1001 1000 */ -static void ORA_A_V(void) -{ - A |= V; - SET_Z(A); -} - -/* 60 99: 0110 0000 1001 1001 */ -/* ORA_A_A already defined */ - -/* 60 9a: 0110 0000 1001 1010 */ -static void ORA_A_B(void) -{ - A |= B; - SET_Z(A); -} - -/* 60 9b: 0110 0000 1001 1011 */ -static void ORA_A_C(void) -{ - A |= C; - SET_Z(A); -} - -/* 60 9c: 0110 0000 1001 1100 */ -static void ORA_A_D(void) -{ - A |= D; - SET_Z(A); -} - -/* 60 9d: 0110 0000 1001 1101 */ -static void ORA_A_E(void) -{ - A |= E; - SET_Z(A); -} - -/* 60 9e: 0110 0000 1001 1110 */ -static void ORA_A_H(void) -{ - A |= H; - SET_Z(A); -} - -/* 60 9f: 0110 0000 1001 1111 */ -static void ORA_A_L(void) -{ - A |= L; - SET_Z(A); -} - -/* 60 a0: 0110 0000 1010 0000 */ -static void ADDNC_A_V(void) -{ - UINT8 tmp = A + V; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 a1: 0110 0000 1010 0001 */ -/* ADDNC_A_A already defined */ - -/* 60 a2: 0110 0000 1010 0010 */ -static void ADDNC_A_B(void) -{ - UINT8 tmp = A + B; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 a3: 0110 0000 1010 0011 */ -static void ADDNC_A_C(void) -{ - UINT8 tmp = A + C; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 a4: 0110 0000 1010 0100 */ -static void ADDNC_A_D(void) -{ - UINT8 tmp = A + D; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 a5: 0110 0000 1010 0101 */ -static void ADDNC_A_E(void) -{ - UINT8 tmp = A + E; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 a6: 0110 0000 1010 0110 */ -static void ADDNC_A_H(void) -{ - UINT8 tmp = A + H; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 a7: 0110 0000 1010 0111 */ -static void ADDNC_A_L(void) -{ - UINT8 tmp = A + L; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 a8: 0110 0000 1010 1000 */ -static void GTA_A_V(void) -{ - UINT16 tmp = A - V - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 60 a9: 0110 0000 1010 1001 */ -/* GTA_A_A already defined */ - -/* 60 aa: 0110 0000 1010 1010 */ -static void GTA_A_B(void) -{ - UINT16 tmp = A - B - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 60 ab: 0110 0000 1010 1011 */ -static void GTA_A_C(void) -{ - UINT16 tmp = A - C - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 60 ac: 0110 0000 1010 1100 */ -static void GTA_A_D(void) -{ - UINT16 tmp = A - D - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 60 ad: 0110 0000 1010 1101 */ -static void GTA_A_E(void) -{ - UINT16 tmp = A - E - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 60 ae: 0110 0000 1010 1110 */ -static void GTA_A_H(void) -{ - UINT16 tmp = A - H - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 60 af: 0110 0000 1010 1111 */ -static void GTA_A_L(void) -{ - UINT16 tmp = A - L - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 60 b0: 0110 0000 1011 0000 */ -static void SUBNB_A_V(void) -{ - UINT8 tmp = A - V; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 b1: 0110 0000 1011 0001 */ -/* SUBNB_A_A already defined */ - -/* 60 b2: 0110 0000 1011 0010 */ -static void SUBNB_A_B(void) -{ - UINT8 tmp = A - B; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 b3: 0110 0000 1011 0011 */ -static void SUBNB_A_C(void) -{ - UINT8 tmp = A - C; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 b4: 0110 0000 1011 0100 */ -static void SUBNB_A_D(void) -{ - UINT8 tmp = A - D; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 b5: 0110 0000 1011 0101 */ -static void SUBNB_A_E(void) -{ - UINT8 tmp = A - E; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 b6: 0110 0000 1011 0110 */ -static void SUBNB_A_H(void) -{ - UINT8 tmp = A - H; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 b7: 0110 0000 1011 0111 */ -static void SUBNB_A_L(void) -{ - UINT8 tmp = A - L; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 60 b8: 0110 0000 1011 1000 */ -static void LTA_A_V(void) -{ - UINT8 tmp = A - V; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 60 b9: 0110 0000 1011 1001 */ -/* LTA_A_A already defined */ - -/* 60 ba: 0110 0000 1011 1010 */ -static void LTA_A_B(void) -{ - UINT8 tmp = A - B; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 60 bb: 0110 0000 1011 1011 */ -static void LTA_A_C(void) -{ - UINT8 tmp = A - C; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 60 bc: 0110 0000 1011 1100 */ -static void LTA_A_D(void) -{ - UINT8 tmp = A - D; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 60 bd: 0110 0000 1011 1101 */ -static void LTA_A_E(void) -{ - UINT8 tmp = A - E; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 60 be: 0110 0000 1011 1110 */ -static void LTA_A_H(void) -{ - UINT8 tmp = A - H; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 60 bf: 0110 0000 1011 1111 */ -static void LTA_A_L(void) -{ - UINT8 tmp = A - L; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 60 c0: 0110 0000 1100 0000 */ -static void ADD_A_V(void) -{ - UINT8 tmp = A + V; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 60 c1: 0110 0000 1100 0001 */ -/* ADD_A_A already defined */ - -/* 60 c2: 0110 0000 1100 0010 */ -static void ADD_A_B(void) -{ - UINT8 tmp = A + B; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 60 c3: 0110 0000 1100 0011 */ -static void ADD_A_C(void) -{ - UINT8 tmp = A + C; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 60 c4: 0110 0000 1100 0100 */ -static void ADD_A_D(void) -{ - UINT8 tmp = A + D; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 60 c5: 0110 0000 1100 0101 */ -static void ADD_A_E(void) -{ - UINT8 tmp = A + E; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 60 c6: 0110 0000 1100 0110 */ -static void ADD_A_H(void) -{ - UINT8 tmp = A + H; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 60 c7: 0110 0000 1100 0111 */ -static void ADD_A_L(void) -{ - UINT8 tmp = A + L; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 60 c8: 0110 0000 1100 1000 */ -static void ONA_A_V(void) -{ - if (A & V) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 60 c9: 0110 0000 1100 1001 */ -static void ONA_A_A(void) -{ - if (A & A) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 60 ca: 0110 0000 1100 1010 */ -static void ONA_A_B(void) -{ - if (A & B) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 60 cb: 0110 0000 1100 1011 */ -static void ONA_A_C(void) -{ - if (A & C) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 60 cc: 0110 0000 1100 1100 */ -static void ONA_A_D(void) -{ - if (A & D) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 60 cd: 0110 0000 1100 1101 */ -static void ONA_A_E(void) -{ - if (A & E) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 60 ce: 0110 0000 1100 1110 */ -static void ONA_A_H(void) -{ - if (A & H) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 60 cf: 0110 0000 1100 1111 */ -static void ONA_A_L(void) -{ - if (A & L) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 60 d0: 0110 0000 1101 0000 */ -static void ADC_A_V(void) -{ - UINT8 tmp = A + V + (PSW & CY); - ZHC_ADD( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 d1: 0110 0000 1101 0001 */ -/* ADC_A_A already defined */ - -/* 60 d2: 0110 0000 1101 0010 */ -static void ADC_A_B(void) -{ - UINT8 tmp = A + B + (PSW & CY); - ZHC_ADD( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 d3: 0110 0000 1101 0011 */ -static void ADC_A_C(void) -{ - UINT8 tmp = A + C + (PSW & CY); - ZHC_ADD( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 d4: 0110 0000 1101 0100 */ -static void ADC_A_D(void) -{ - UINT8 tmp = A + D + (PSW & CY); - ZHC_ADD( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 d5: 0110 0000 1101 0101 */ -static void ADC_A_E(void) -{ - UINT8 tmp = A + E + (PSW & CY); - ZHC_ADD( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 d6: 0110 0000 1101 0110 */ -static void ADC_A_H(void) -{ - UINT8 tmp = A + H + (PSW & CY); - ZHC_ADD( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 d7: 0110 0000 1101 0111 */ -static void ADC_A_L(void) -{ - UINT8 tmp = A + L + (PSW & CY); - ZHC_ADD( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 d8: 0110 0000 1101 1000 */ -static void OFFA_A_V(void) -{ - if ( A & V ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 60 d9: 0110 0000 1101 1001 */ -static void OFFA_A_A(void) -{ - if ( A & A ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 60 da: 0110 0000 1101 1010 */ -static void OFFA_A_B(void) -{ - if ( A & B ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 60 db: 0110 0000 1101 1011 */ -static void OFFA_A_C(void) -{ - if ( A & C ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 60 dc: 0110 0000 1101 1100 */ -static void OFFA_A_D(void) -{ - if ( A & D ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 60 dd: 0110 0000 1101 1101 */ -static void OFFA_A_E(void) -{ - if ( A & E ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 60 de: 0110 0000 1101 1110 */ -static void OFFA_A_H(void) -{ - if ( A & H ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 60 df: 0110 0000 1101 1111 */ -static void OFFA_A_L(void) -{ - if ( A & L ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 60 e0: 0110 0000 1110 0000 */ -static void SUB_A_V(void) -{ - UINT8 tmp = A - V; - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 60 e1: 0110 0000 1110 0001 */ -/* SUB_A_A already defined */ - -/* 60 e2: 0110 0000 1110 0010 */ -static void SUB_A_B(void) -{ - UINT8 tmp = A - B; - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 60 e3: 0110 0000 1110 0011 */ -static void SUB_A_C(void) -{ - UINT8 tmp = A - C; - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 60 e4: 0110 0000 1110 0100 */ -static void SUB_A_D(void) -{ - UINT8 tmp = A - D; - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 60 e5: 0110 0000 1110 0101 */ -static void SUB_A_E(void) -{ - UINT8 tmp = A - E; - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 60 e6: 0110 0000 1110 0110 */ -static void SUB_A_H(void) -{ - UINT8 tmp = A - H; - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 60 e7: 0110 0000 1110 0111 */ -static void SUB_A_L(void) -{ - UINT8 tmp = A - L; - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 60 e8: 0110 0000 1110 1000 */ -static void NEA_A_V(void) -{ - UINT8 tmp = A - V; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 60 e9: 0110 0000 1110 1001 */ -/* NEA_A_A already defined */ - -/* 60 ea: 0110 0000 1110 1010 */ -static void NEA_A_B(void) -{ - UINT8 tmp = A - B; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 60 eb: 0110 0000 1110 1011 */ -static void NEA_A_C(void) -{ - UINT8 tmp = A - C; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 60 ec: 0110 0000 1110 1100 */ -static void NEA_A_D(void) -{ - UINT8 tmp = A - D; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 60 ed: 0110 0000 1110 1101 */ -static void NEA_A_E(void) -{ - UINT8 tmp = A - E; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 60 ee: 0110 0000 1110 1110 */ -static void NEA_A_H(void) -{ - UINT8 tmp = A - H; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 60 ef: 0110 0000 1110 1111 */ -static void NEA_A_L(void) -{ - UINT8 tmp = A - L; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 60 f0: 0110 0000 1111 0000 */ -static void SBB_A_V(void) -{ - UINT8 tmp = A - V - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 f1: 0110 0000 1111 0001 */ -/* SBB_A_A already defined */ - -/* 60 f2: 0110 0000 1111 0010 */ -static void SBB_A_B(void) -{ - UINT8 tmp = A - B - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 f3: 0110 0000 1111 0011 */ -static void SBB_A_C(void) -{ - UINT8 tmp = A - C - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 f4: 0110 0000 1111 0100 */ -static void SBB_A_D(void) -{ - UINT8 tmp = A - D - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 f5: 0110 0000 1111 0101 */ -static void SBB_A_E(void) -{ - UINT8 tmp = A - E - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 f6: 0110 0000 1111 0110 */ -static void SBB_A_H(void) -{ - UINT8 tmp = A - H - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 f7: 0110 0000 1111 0111 */ -static void SBB_A_L(void) -{ - UINT8 tmp = A - L - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 60 f8: 0110 0000 1111 1000 */ -static void EQA_A_V(void) -{ - UINT8 tmp = A - V; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 60 f9: 0110 0000 1111 1001 */ -/* EQA_A_A already defined */ - -/* 60 fa: 0110 0000 1111 1010 */ -static void EQA_A_B(void) -{ - UINT8 tmp = A - B; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 60 fb: 0110 0000 1111 1011 */ -static void EQA_A_C(void) -{ - UINT8 tmp = A - C; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 60 fc: 0110 0000 1111 1100 */ -static void EQA_A_D(void) -{ - UINT8 tmp = A - D; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 60 fd: 0110 0000 1111 1101 */ -static void EQA_A_E(void) -{ - UINT8 tmp = A - E; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 60 fe: 0110 0000 1111 1110 */ -static void EQA_A_H(void) -{ - UINT8 tmp = A - H; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 60 ff: 0110 0000 1111 1111 */ -static void EQA_A_L(void) -{ - UINT8 tmp = A - L; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* prefix 64 */ -/* 64 00: 0110 0100 0000 0000 xxxx xxxx */ -static void MVI_PA_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - WP( UPD7810_PORTA, imm ); -} - -/* 64 01: 0110 0100 0000 0001 xxxx xxxx */ -static void MVI_PB_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - WP( UPD7810_PORTB, imm ); -} - -/* 64 02: 0110 0100 0000 0010 xxxx xxxx */ -static void MVI_PC_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - WP( UPD7810_PORTC, imm ); -} - -/* 64 03: 0110 0100 0000 0011 xxxx xxxx */ -static void MVI_PD_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - WP( UPD7810_PORTD, imm ); -} - -/* 64 05: 0110 0100 0000 0101 xxxx xxxx */ -static void MVI_PF_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - WP( UPD7810_PORTF, imm ); -} - -/* 64 06: 0110 0100 0000 0110 xxxx xxxx */ -static void MVI_MKH_xx(void) -{ - RDOPARG( MKH ); -} - -/* 64 07: 0110 0100 0000 0111 xxxx xxxx */ -static void MVI_MKL_xx(void) -{ - RDOPARG( MKL ); -} - -/* 64 08: 0110 0100 0000 1000 xxxx xxxx */ -static void ANI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA), imm; - RDOPARG( imm ); - pa &= imm; - WP( UPD7810_PORTA, pa ); - SET_Z(pa); -} - -/* 64 09: 0110 0100 0000 1001 xxxx xxxx */ -static void ANI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB), imm; - RDOPARG( imm ); - pb &= imm; - WP( UPD7810_PORTB, pb ); - SET_Z(pb); -} - -/* 64 0a: 0110 0100 0000 1010 xxxx xxxx */ -static void ANI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC), imm; - RDOPARG( imm ); - pc &= imm; - WP( UPD7810_PORTC, pc ); - SET_Z(pc); -} - -/* 64 0b: 0110 0100 0000 1011 xxxx xxxx */ -static void ANI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), imm; - RDOPARG( imm ); - pd &= imm; - WP( UPD7810_PORTD, pd ); - SET_Z(pd); -} - -/* 64 0d: 0110 0100 0000 1101 xxxx xxxx */ -static void ANI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), imm; - RDOPARG( imm ); - pf &= imm; - WP( UPD7810_PORTF, pf ); - SET_Z(pf); -} - -/* 64 0e: 0110 0100 0000 1110 xxxx xxxx */ -static void ANI_MKH_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - MKH &= imm; - SET_Z(MKH); -} - -/* 64 0f: 0110 0100 0000 1111 xxxx xxxx */ -static void ANI_MKL_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - MKL &= imm; - SET_Z(MKL); -} - -/* 64 10: 0110 0100 0001 0000 xxxx xxxx */ -static void XRI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), imm; - RDOPARG( imm ); - pa ^= imm; - WP( UPD7810_PORTA, pa ); - SET_Z(pa); -} - -/* 64 11: 0110 0100 0001 0001 xxxx xxxx */ -static void XRI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), imm; - RDOPARG( imm ); - pb ^= imm; - WP( UPD7810_PORTB, pb ); - SET_Z(pb); -} - -/* 64 12: 0110 0100 0001 0010 xxxx xxxx */ -static void XRI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), imm; - RDOPARG( imm ); - pc ^= imm; - WP( UPD7810_PORTC, pc ); - SET_Z(pc); -} - -/* 64 13: 0110 0100 0001 0011 xxxx xxxx */ -static void XRI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), imm; - RDOPARG( imm ); - pd ^= imm; - WP( UPD7810_PORTD, pd ); - SET_Z(pd); -} - -/* 64 15: 0110 0100 0001 0101 xxxx xxxx */ -static void XRI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), imm; - RDOPARG( imm ); - pf ^= imm; - WP( UPD7810_PORTF, pf ); - SET_Z(pf); -} - -/* 64 16: 0110 0100 0001 0110 xxxx xxxx */ -static void XRI_MKH_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - MKH ^= imm; - SET_Z(MKH); -} - -/* 64 17: 0110 0100 0001 0111 xxxx xxxx */ -static void XRI_MKL_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - MKL ^= imm; - SET_Z(MKL); -} - -/* 64 18: 0110 0100 0001 1000 xxxx xxxx */ -static void ORI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), imm; - RDOPARG( imm ); - pa |= imm; - WP( UPD7810_PORTA, pa ); - SET_Z(pa); -} - -/* 64 19: 0110 0100 0001 1001 xxxx xxxx */ -static void ORI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), imm; - RDOPARG( imm ); - pb |= imm; - WP( UPD7810_PORTB, pb ); - SET_Z(pb); -} - -/* 64 1a: 0110 0100 0001 1010 xxxx xxxx */ -static void ORI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), imm; - RDOPARG( imm ); - pc |= imm; - WP( UPD7810_PORTC, pc ); - SET_Z(pc); -} - -/* 64 1b: 0110 0100 0001 1011 xxxx xxxx */ -static void ORI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), imm; - RDOPARG( imm ); - pd |= imm; - WP( UPD7810_PORTD, pd ); - SET_Z(pd); -} - -/* 64 1d: 0110 0100 0001 1101 xxxx xxxx */ -static void ORI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), imm; - RDOPARG( imm ); - pf |= imm; - WP( UPD7810_PORTF, pf ); - SET_Z(pf); -} - -/* 64 1e: 0110 0100 0001 1110 xxxx xxxx */ -static void ORI_MKH_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - MKH |= imm; - SET_Z(MKH); -} - -/* 64 1f: 0110 0100 0001 1111 xxxx xxxx */ -static void ORI_MKL_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - MKL |= imm; - SET_Z(MKL); -} - -/* 64 20: 0110 0100 0010 0000 xxxx xxxx */ -static void ADINC_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ); - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = pa + imm; - - ZHC_ADD( tmp, pa, 0 ); - WP( UPD7810_PORTA , tmp ); - SKIP_NC; -} - -/* 64 21: 0110 0100 0010 0001 xxxx xxxx */ -static void ADINC_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ); - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = pb + imm; - - ZHC_ADD( tmp, pb, 0 ); - WP( UPD7810_PORTB, tmp ); - SKIP_NC; -} - -/* 64 22: 0110 0100 0010 0010 xxxx xxxx */ -static void ADINC_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ); - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = pc + imm; - - ZHC_ADD( tmp, pc, 0 ); - WP( UPD7810_PORTC, tmp ); - SKIP_NC; -} - -/* 64 23: 0110 0100 0010 0011 xxxx xxxx */ -static void ADINC_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ); - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = pd + imm; - - ZHC_ADD( tmp, pd, 0 ); - WP( UPD7810_PORTD, tmp ); - SKIP_NC; -} - -/* 64 25: 0110 0100 0010 0101 xxxx xxxx */ -static void ADINC_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ); - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = pf + imm; - - ZHC_ADD( tmp, pf, 0 ); - WP( UPD7810_PORTF, tmp ); - SKIP_NC; -} - -/* 64 26: 0110 0100 0010 0110 xxxx xxxx */ -static void ADINC_MKH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKH + imm; - - ZHC_ADD( tmp, MKH, 0 ); - MKH = tmp; - SKIP_NC; -} - -/* 64 27: 0110 0100 0010 0111 xxxx xxxx */ -static void ADINC_MKL_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKL + imm; - - ZHC_ADD( tmp, MKL, 0 ); - MKL = tmp; - SKIP_NC; -} - -/* 64 28: 0110 0100 0010 1000 xxxx xxxx */ -static void GTI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = pa - imm - 1; - ZHC_SUB( tmp, pa, 0 ); - - SKIP_NC; -} - -/* 64 29: 0110 0100 0010 1001 xxxx xxxx */ -static void GTI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = pb - imm - 1; - ZHC_SUB( tmp, pb, 0 ); - - SKIP_NC; -} - -/* 64 2a: 0110 0100 0010 1010 xxxx xxxx */ -static void GTI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = pc - imm - 1; - ZHC_SUB( tmp, pc, 0 ); - - SKIP_NC; -} - -/* 64 2b: 0110 0100 0010 1011 xxxx xxxx */ -static void GTI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = pd - imm - 1; - ZHC_SUB( tmp, pd, 0 ); - - SKIP_NC; -} - -/* 64 2d: 0110 0100 0010 1101 xxxx xxxx */ -static void GTI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = pf - imm - 1; - ZHC_SUB( tmp, pf, 0 ); - - SKIP_NC; -} - -/* 64 2e: 0110 0100 0010 1110 xxxx xxxx */ -static void GTI_MKH_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = MKH - imm - 1; - ZHC_SUB( tmp, MKH, 0 ); - - SKIP_NC; -} - -/* 64 2f: 0110 0100 0010 1111 xxxx xxxx */ -static void GTI_MKL_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = MKL - imm - 1; - ZHC_SUB( tmp, MKL, 0 ); - - SKIP_NC; -} - -/* 64 30: 0110 0100 0011 0000 xxxx xxxx */ -static void SUINB_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; - - RDOPARG( imm ); - tmp = pa - imm; - ZHC_SUB( tmp, pa, 0 ); - pa = tmp; - WP( UPD7810_PORTA, pa ); - SKIP_NC; -} - -/* 64 31: 0110 0100 0011 0001 xxxx xxxx */ -static void SUINB_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; - - RDOPARG( imm ); - tmp = pb - imm; - ZHC_SUB( tmp, pb, 0 ); - pb = tmp; - WP( UPD7810_PORTB, pb ); - SKIP_NC; -} - -/* 64 32: 0110 0100 0011 0010 xxxx xxxx */ -static void SUINB_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; - - RDOPARG( imm ); - tmp = pc - imm; - ZHC_SUB( tmp, pc, 0 ); - pc = tmp; - WP( UPD7810_PORTC, pc ); - SKIP_NC; -} - -/* 64 33: 0110 0100 0011 0011 xxxx xxxx */ -static void SUINB_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; - - RDOPARG( imm ); - tmp = pd - imm; - ZHC_SUB( tmp, pd, 0 ); - pd = tmp; - WP( UPD7810_PORTD, pd ); - SKIP_NC; -} - -/* 64 35: 0110 0100 0011 0101 xxxx xxxx */ -static void SUINB_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; - - RDOPARG( imm ); - tmp = pf - imm; - ZHC_SUB( tmp, pf, 0 ); - pf = tmp; - WP( UPD7810_PORTF, pf ); - SKIP_NC; -} - -/* 64 36: 0110 0100 0011 0110 xxxx xxxx */ -static void SUINB_MKH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKH - imm; - ZHC_SUB( tmp, MKH, 0 ); - MKH = tmp; - SKIP_NC; -} - -/* 64 37: 0110 0100 0011 0111 xxxx xxxx */ -static void SUINB_MKL_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKL - imm; - ZHC_SUB( tmp, MKL, 0 ); - MKL = tmp; - SKIP_NC; -} - -/* 64 38: 0110 0100 0011 1000 xxxx xxxx */ -static void LTI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; - RDOPARG( imm ); - tmp = pa - imm; - ZHC_SUB( tmp, pa, 0 ); - SKIP_CY; -} - -/* 64 39: 0110 0100 0011 1001 xxxx xxxx */ -static void LTI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; - RDOPARG( imm ); - tmp = pb - imm; - ZHC_SUB( tmp, pb, 0 ); - SKIP_CY; -} - -/* 64 3a: 0110 0100 0011 1010 xxxx xxxx */ -static void LTI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; - RDOPARG( imm ); - tmp = pc - imm; - ZHC_SUB( tmp, pc, 0 ); - SKIP_CY; -} - -/* 64 3b: 0110 0100 0011 1011 xxxx xxxx */ -static void LTI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; - RDOPARG( imm ); - tmp = pd - imm; - ZHC_SUB( tmp, pd, 0 ); - SKIP_CY; -} - -/* 64 3d: 0110 0100 0011 1101 xxxx xxxx */ -static void LTI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; - RDOPARG( imm ); - tmp = pf - imm; - ZHC_SUB( tmp, pf, 0 ); - SKIP_CY; -} - -/* 64 3e: 0110 0100 0011 1110 xxxx xxxx */ -static void LTI_MKH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKH - imm; - ZHC_SUB( tmp, MKH, 0 ); - SKIP_CY; -} - -/* 64 3f: 0110 0100 0011 1111 xxxx xxxx */ -static void LTI_MKL_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKL - imm; - ZHC_SUB( tmp, MKL, 0 ); - SKIP_CY; -} - -/* 64 40: 0110 0100 0100 0000 xxxx xxxx */ -static void ADI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; - - RDOPARG( imm ); - tmp = pa + imm; - ZHC_ADD( tmp, pa, 0 ); - pa = tmp; - WP( UPD7810_PORTA, pa ); -} - -/* 64 41: 0110 0100 0100 0001 xxxx xxxx */ -static void ADI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; - - RDOPARG( imm ); - tmp = pb + imm; - ZHC_ADD( tmp, pb, 0 ); - pb = tmp; - WP( UPD7810_PORTB, pb ); -} - -/* 64 42: 0110 0100 0100 0010 xxxx xxxx */ -static void ADI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; - - RDOPARG( imm ); - tmp = pc + imm; - ZHC_ADD( tmp, pc, 0 ); - pc = tmp; - WP( UPD7810_PORTC, pc ); -} - -/* 64 43: 0110 0100 0100 0011 xxxx xxxx */ -static void ADI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; - - RDOPARG( imm ); - tmp = pd + imm; - ZHC_ADD( tmp, pd, 0 ); - pd = tmp; - WP( UPD7810_PORTD, pd ); -} - -/* 64 45: 0110 0100 0100 0101 xxxx xxxx */ -static void ADI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; - - RDOPARG( imm ); - tmp = pf + imm; - ZHC_ADD( tmp, pf, 0 ); - pf = tmp; - WP( UPD7810_PORTF, pf ); -} - -/* 64 46: 0110 0100 0100 0110 xxxx xxxx */ -static void ADI_MKH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKH + imm; - ZHC_ADD( tmp, MKH, 0 ); - MKH = tmp; -} - -/* 64 47: 0110 0100 0100 0111 xxxx xxxx */ -static void ADI_MKL_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKL + imm; - ZHC_ADD( tmp, MKL, 0 ); - MKL = tmp; -} - -/* 64 48: 0110 0100 0100 1000 xxxx xxxx */ -static void ONI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), imm; - - RDOPARG( imm ); - if (pa & imm) - PSW |= SK; -} - -/* 64 49: 0110 0100 0100 1001 xxxx xxxx */ -static void ONI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), imm; - - RDOPARG( imm ); - if (pb & imm) - PSW |= SK; -} - -/* 64 4a: 0110 0100 0100 1010 xxxx xxxx */ -static void ONI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), imm; - - RDOPARG( imm ); - if (pc & imm) - PSW |= SK; -} - -/* 64 4b: 0110 0100 0100 1011 xxxx xxxx */ -static void ONI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), imm; - - RDOPARG( imm ); - if (pd & imm) - PSW |= SK; -} - -/* 64 4d: 0110 0100 0100 1101 xxxx xxxx */ -static void ONI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), imm; - - RDOPARG( imm ); - if (pf & imm) - PSW |= SK; -} - -/* 64 4e: 0110 0100 0100 1110 xxxx xxxx */ -static void ONI_MKH_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (MKH & imm) - PSW |= SK; -} - -/* 64 4f: 0110 0100 0100 1111 xxxx xxxx */ -static void ONI_MKL_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (MKL & imm) - PSW |= SK; -} - -/* 64 50: 0110 0100 0101 0000 xxxx xxxx */ -static void ACI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; - - RDOPARG( imm ); - tmp = pa + imm + (PSW & CY); - ZHC_ADD( tmp, pa, (PSW & CY) ); - pa = tmp; - WP( UPD7810_PORTA, pa ); -} - -/* 64 51: 0110 0100 0101 0001 xxxx xxxx */ -static void ACI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; - - RDOPARG( imm ); - tmp = pb + imm + (PSW & CY); - ZHC_ADD( tmp, pb, (PSW & CY) ); - pb = tmp; - WP( UPD7810_PORTB, pb ); -} - -/* 64 52: 0110 0100 0101 0010 xxxx xxxx */ -static void ACI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; - - RDOPARG( imm ); - tmp = pc + imm + (PSW & CY); - ZHC_ADD( tmp, pc, (PSW & CY) ); - pc = tmp; - WP( UPD7810_PORTC, pc ); -} - -/* 64 53: 0110 0100 0101 0011 xxxx xxxx */ -static void ACI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; - - RDOPARG( imm ); - tmp = pd + imm + (PSW & CY); - ZHC_ADD( tmp, pd, (PSW & CY) ); - pd = tmp; - WP( UPD7810_PORTD, pd ); -} - -/* 64 55: 0110 0100 0101 0101 xxxx xxxx */ -static void ACI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; - - RDOPARG( imm ); - tmp = pf + imm + (PSW & CY); - ZHC_ADD( tmp, pf, (PSW & CY) ); - pf = tmp; - WP( UPD7810_PORTF, pf ); -} - -/* 64 56: 0110 0100 0101 0110 xxxx xxxx */ -static void ACI_MKH_xx(void) -{ - UINT8 imm, tmp; - - RDOPARG( imm ); - tmp = MKH + imm + (PSW & CY); - ZHC_ADD( tmp, MKH, (PSW & CY) ); - MKH = tmp; -} - -/* 64 57: 0110 0100 0101 0111 xxxx xxxx */ -static void ACI_MKL_xx(void) -{ - UINT8 imm, tmp; - - RDOPARG( imm ); - tmp = MKL + imm + (PSW & CY); - ZHC_ADD( tmp, MKL, (PSW & CY) ); - MKL = tmp; -} - -/* 64 58: 0110 0100 0101 1000 xxxx xxxx */ -static void OFFI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), imm; - - RDOPARG( imm ); - if (0 == (pa & imm)) - PSW |= SK; -} - -/* 64 59: 0110 0100 0101 1001 xxxx xxxx */ -static void OFFI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), imm; - - RDOPARG( imm ); - if (0 == (pb & imm)) - PSW |= SK; -} - -/* 64 5a: 0110 0100 0101 1010 xxxx xxxx */ -static void OFFI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), imm; - - RDOPARG( imm ); - if (0 == (pc & imm)) - PSW |= SK; -} - -/* 64 5b: 0110 0100 0101 1011 xxxx xxxx */ -static void OFFI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), imm; - - RDOPARG( imm ); - if (0 == (pd & imm)) - PSW |= SK; -} - -/* 64 5d: 0110 0100 0101 1101 xxxx xxxx */ -static void OFFI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), imm; - - RDOPARG( imm ); - if (0 == (pf & imm)) - PSW |= SK; -} - -/* 64 5e: 0110 0100 0101 1110 xxxx xxxx */ -static void OFFI_MKH_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (MKH & imm)) - PSW |= SK; -} - -/* 64 5f: 0110 0100 0101 1111 xxxx xxxx */ -static void OFFI_MKL_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (MKL & imm)) - PSW |= SK; -} - -/* 64 60: 0110 0100 0110 0000 xxxx xxxx */ -static void SUI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; - - RDOPARG( imm ); - tmp = pa - imm; - ZHC_SUB( tmp, pa, 0 ); - pa = tmp; - WP( UPD7810_PORTA, pa ); -} - -/* 64 61: 0110 0100 0110 0001 xxxx xxxx */ -static void SUI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; - - RDOPARG( imm ); - tmp = pb - imm; - ZHC_SUB( tmp, pb, 0 ); - pb = tmp; - WP( UPD7810_PORTB, pb ); -} - -/* 64 62: 0110 0100 0110 0010 xxxx xxxx */ -static void SUI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; - - RDOPARG( imm ); - tmp = pc - imm; - ZHC_SUB( tmp, pc, 0 ); - pc = tmp; - WP( UPD7810_PORTC, pc ); -} - -/* 64 63: 0110 0100 0110 0011 xxxx xxxx */ -static void SUI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; - - RDOPARG( imm ); - tmp = pd - imm; - ZHC_SUB( tmp, pd, 0 ); - pd = tmp; - WP( UPD7810_PORTD, pd ); -} - -/* 64 65: 0110 0100 0110 0101 xxxx xxxx */ -static void SUI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; - - RDOPARG( imm ); - tmp = pf - imm; - ZHC_SUB( tmp, pf, 0 ); - pf = tmp; - WP( UPD7810_PORTF, pf ); -} - -/* 64 66: 0110 0100 0110 0110 xxxx xxxx */ -static void SUI_MKH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKH - imm; - ZHC_SUB( tmp, MKH, 0 ); - MKH = tmp; -} - -/* 64 67: 0110 0100 0110 0111 xxxx xxxx */ -static void SUI_MKL_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKL - imm; - ZHC_SUB( tmp, MKL, 0 ); - MKL = tmp; -} - -/* 64 68: 0110 0100 0110 1000 xxxx xxxx */ -static void NEI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; - - RDOPARG( imm ); - tmp = pa - imm; - ZHC_SUB( tmp, pa, 0 ); - SKIP_NZ; -} - -/* 64 69: 0110 0100 0110 1001 xxxx xxxx */ -static void NEI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; - - RDOPARG( imm ); - tmp = pb - imm; - ZHC_SUB( tmp, pb, 0 ); - SKIP_NZ; -} - -/* 64 6a: 0110 0100 0110 1010 xxxx xxxx */ -static void NEI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; - - RDOPARG( imm ); - tmp = pc - imm; - ZHC_SUB( tmp, pc, 0 ); - SKIP_NZ; -} - -/* 64 6b: 0110 0100 0110 1011 xxxx xxxx */ -static void NEI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; - - RDOPARG( imm ); - tmp = pd - imm; - ZHC_SUB( tmp, pd, 0 ); - SKIP_NZ; -} - -/* 64 6d: 0110 0100 0110 1101 xxxx xxxx */ -static void NEI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; - - RDOPARG( imm ); - tmp = pf - imm; - ZHC_SUB( tmp, pf, 0 ); - SKIP_NZ; -} - -/* 64 6e: 0110 0100 0110 1110 xxxx xxxx */ -static void NEI_MKH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKH - imm; - ZHC_SUB( tmp, MKH, 0 ); - SKIP_NZ; -} - -/* 64 6f: 0110 0100 0110 1111 xxxx xxxx */ -static void NEI_MKL_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKL - imm; - ZHC_SUB( tmp, MKL, 0 ); - SKIP_NZ; -} - -/* 64 70: 0110 0100 0111 0000 xxxx xxxx */ -static void SBI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; - - RDOPARG( imm ); - tmp = pa - imm - (PSW & CY); - ZHC_SUB( tmp, pa, (PSW & CY) ); - pa = tmp; - WP( UPD7810_PORTA, pa ); -} - -/* 64 71: 0110 0100 0111 0001 xxxx xxxx */ -static void SBI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; - - RDOPARG( imm ); - tmp = pb - imm - (PSW & CY); - ZHC_SUB( tmp, pb, (PSW & CY) ); - pb = tmp; - WP( UPD7810_PORTB, pb ); -} - -/* 64 72: 0110 0100 0111 0010 xxxx xxxx */ -static void SBI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; - - RDOPARG( imm ); - tmp = pc - imm - (PSW & CY); - ZHC_SUB( tmp, pc, (PSW & CY) ); - pc = tmp; - WP( UPD7810_PORTC, pc ); -} - -/* 64 73: 0110 0100 0111 0011 xxxx xxxx */ -static void SBI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; - - RDOPARG( imm ); - tmp = pd - imm - (PSW & CY); - ZHC_SUB( tmp, pd, (PSW & CY) ); - pd = tmp; - WP( UPD7810_PORTD, pd ); -} - -/* 64 75: 0110 0100 0111 0101 xxxx xxxx */ -static void SBI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; - - RDOPARG( imm ); - tmp = pf - imm - (PSW & CY); - ZHC_SUB( tmp, pf, (PSW & CY) ); - pf = tmp; - WP( UPD7810_PORTF, pf ); -} - -/* 64 76: 0110 0100 0111 0110 xxxx xxxx */ -static void SBI_MKH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKH - imm - (PSW & CY); - ZHC_SUB( tmp, MKH, (PSW & CY) ); - MKH = tmp; -} - -/* 64 77: 0110 0100 0111 0111 xxxx xxxx */ -static void SBI_MKL_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKL - imm - (PSW & CY); - ZHC_SUB( tmp, MKL, (PSW & CY) ); - MKL = tmp; -} - -/* 64 78: 0110 0100 0111 1000 xxxx xxxx */ -static void EQI_PA_xx(void) -{ - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; - - RDOPARG( imm ); - tmp = pa - imm; - ZHC_SUB( tmp, pa, 0 ); - SKIP_Z; -} - -/* 64 79: 0110 0100 0111 1001 xxxx xxxx */ -static void EQI_PB_xx(void) -{ - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; - - RDOPARG( imm ); - tmp = pb - imm; - ZHC_SUB( tmp, pb, 0 ); - SKIP_Z; -} - -/* 64 7a: 0110 0100 0111 1010 xxxx xxxx */ -static void EQI_PC_xx(void) -{ - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; - - RDOPARG( imm ); - tmp = pc - imm; - ZHC_SUB( tmp, pc, 0 ); - SKIP_Z; -} - -/* 64 7b: 0110 0100 0111 1011 xxxx xxxx */ -static void EQI_PD_xx(void) -{ - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; - - RDOPARG( imm ); - tmp = pd - imm; - ZHC_SUB( tmp, pd, 0 ); - SKIP_Z; -} - -/* 64 7d: 0110 0100 0111 1101 xxxx xxxx */ -static void EQI_PF_xx(void) -{ - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; - - RDOPARG( imm ); - tmp = pf - imm; - ZHC_SUB( tmp, pf, 0 ); - SKIP_Z; -} - -/* 64 7e: 0110 0100 0111 1110 xxxx xxxx */ -static void EQI_MKH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKH - imm; - ZHC_SUB( tmp, MKH, 0 ); - SKIP_Z; -} - -/* 64 7f: 0110 0100 0111 1111 xxxx xxxx */ -static void EQI_MKL_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = MKL - imm; - ZHC_SUB( tmp, MKL, 0 ); - SKIP_Z; -} - -/* 64 80: 0110 0100 1000 0000 xxxx xxxx */ -static void MVI_ANM_xx(void) -{ - RDOPARG( ANM ); -} - -/* 64 81: 0110 0100 1000 0001 xxxx xxxx */ -static void MVI_SMH_xx(void) -{ - RDOPARG( SMH ); -} - -/* 64 83: 0110 0100 1000 0011 xxxx xxxx */ -static void MVI_EOM_xx(void) -{ - RDOPARG( EOM ); - upd7810_write_EOM(); -} - -/* 64 85: 0110 0100 1000 0101 xxxx xxxx */ -static void MVI_TMM_xx(void) -{ - RDOPARG( TMM ); -} - -/* 64 88: 0110 0100 1000 1000 xxxx xxxx */ -static void ANI_ANM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - ANM &= imm; - SET_Z(ANM); -} - -/* 64 89: 0110 0100 1000 1001 xxxx xxxx */ -static void ANI_SMH_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - SMH &= imm; - SET_Z(SMH); -} - -/* 64 8b: 0110 0100 1000 1011 xxxx xxxx */ -static void ANI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; - - RDOPARG( imm ); - /* only bits #1 and #5 can be read */ - EOM = eom & imm; - SET_Z(EOM); - upd7810_write_EOM(); -} - -/* 64 8d: 0110 0100 1000 1101 xxxx xxxx */ -static void ANI_TMM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - TMM &= imm; - SET_Z(TMM); -} - -/* 64 90: 0110 0100 1001 0000 xxxx xxxx */ -static void XRI_ANM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - ANM ^= imm; - SET_Z(ANM); -} - -/* 64 91: 0110 0100 1001 0001 xxxx xxxx */ -static void XRI_SMH_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - SMH ^= imm; - SET_Z(SMH); -} - -/* 64 93: 0110 0100 1001 0011 xxxx xxxx */ -static void XRI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; - - RDOPARG( imm ); - /* only bits #1 and #5 can be read */ - EOM = eom ^ imm; - SET_Z(EOM); - upd7810_write_EOM(); -} - -/* 64 95: 0110 0100 1001 0101 xxxx xxxx */ -static void XRI_TMM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - TMM ^= imm; - SET_Z(TMM); -} - -/* 64 98: 0110 0100 1001 1000 xxxx xxxx */ -static void ORI_ANM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - ANM |= imm; - SET_Z(ANM); -} - -/* 64 99: 0110 0100 1001 1001 xxxx xxxx */ -static void ORI_SMH_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - SMH |= imm; - SET_Z(SMH); -} - -/* 64 9b: 0110 0100 1001 1011 xxxx xxxx */ -static void ORI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; - - RDOPARG( imm ); - /* only bits #1 and #5 can be read */ - EOM = eom | imm; - SET_Z(EOM); - upd7810_write_EOM(); -} - -/* 64 9d: 0110 0100 1001 1101 xxxx xxxx */ -static void ORI_TMM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - TMM |= imm; - SET_Z(TMM); -} - -/* 64 a0: 0110 0100 1010 0000 xxxx xxxx */ -static void ADINC_ANM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = ANM + imm; - - ZHC_ADD( tmp, ANM, 0 ); - ANM = tmp; - SKIP_NC; -} - -/* 64 a1: 0110 0100 1010 0001 xxxx xxxx */ -static void ADINC_SMH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = SMH + imm; - - ZHC_ADD( tmp, SMH, 0 ); - SMH = tmp; - SKIP_NC; -} - -/* 64 a3: 0110 0100 1010 0011 xxxx xxxx */ -static void ADINC_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; - - RDOPARG( imm ); - /* only bits #1 and #5 can be read */ - tmp = eom + imm; - - ZHC_ADD( tmp, eom, 0 ); - EOM = tmp; - SKIP_NC; - upd7810_write_EOM(); -} - -/* 64 a5: 0110 0100 1010 0101 xxxx xxxx */ -static void ADINC_TMM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = TMM + imm; - - ZHC_ADD( tmp, TMM, 0 ); - TMM = tmp; - SKIP_NC; -} - -/* 64 a8: 0110 0100 1010 1000 xxxx xxxx */ -static void GTI_ANM_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = ANM - imm - 1; - ZHC_SUB( tmp, ANM, 0 ); - - SKIP_NC; -} - -/* 64 a9: 0110 0100 1010 1001 xxxx xxxx */ -static void GTI_SMH_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = SMH - imm - 1; - ZHC_SUB( tmp, SMH, 0 ); - - SKIP_NC; -} - -/* 64 ab: 0110 0100 1010 1011 xxxx xxxx */ -static void GTI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = eom - imm - 1; - ZHC_SUB( tmp, eom, 0 ); - - SKIP_NC; -} - -/* 64 ad: 0110 0100 1010 1101 xxxx xxxx */ -static void GTI_TMM_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = TMM - imm - 1; - ZHC_SUB( tmp, TMM, 0 ); - - SKIP_NC; -} - -/* 64 b0: 0110 0100 1011 0000 xxxx xxxx */ -static void SUINB_ANM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = ANM - imm; - ZHC_SUB( tmp, ANM, 0 ); - ANM = tmp; - SKIP_NC; -} - -/* 64 b1: 0110 0100 1011 0001 xxxx xxxx */ -static void SUINB_SMH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = SMH - imm; - ZHC_SUB( tmp, SMH, 0 ); - SMH = tmp; - SKIP_NC; -} - -/* 64 b3: 0110 0100 1011 0011 xxxx xxxx */ -static void SUINB_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = eom - imm; - ZHC_SUB( tmp, eom, 0 ); - EOM = tmp; - SKIP_NC; - upd7810_write_EOM(); -} - -/* 64 b5: 0110 0100 1011 0101 xxxx xxxx */ -static void SUINB_TMM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = TMM - imm; - ZHC_SUB( tmp, TMM, 0 ); - TMM = tmp; - SKIP_NC; -} - -/* 64 b8: 0110 0100 1011 1000 xxxx xxxx */ -static void LTI_ANM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = ANM - imm; - ZHC_SUB( tmp, ANM, 0 ); - SKIP_CY; -} - -/* 64 b9: 0110 0100 1011 1001 xxxx xxxx */ -static void LTI_SMH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = SMH - imm; - ZHC_SUB( tmp, SMH, 0 ); - SKIP_CY; -} - -/* 64 bb: 0110 0100 1011 1011 xxxx xxxx */ -static void LTI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = eom - imm; - ZHC_SUB( tmp, eom, 0 ); - SKIP_CY; -} - -/* 64 bd: 0110 0100 1011 1101 xxxx xxxx */ -static void LTI_TMM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = TMM - imm; - ZHC_SUB( tmp, TMM, 0 ); - SKIP_CY; -} - -/* 64 c0: 0110 0100 1100 0000 xxxx xxxx */ -static void ADI_ANM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = ANM + imm; - - ZHC_ADD( tmp, ANM, 0 ); - ANM = tmp; -} - -/* 64 c1: 0110 0100 1100 0001 xxxx xxxx */ -static void ADI_SMH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = SMH + imm; - - ZHC_ADD( tmp, SMH, 0 ); - SMH = tmp; -} - -/* 64 c3: 0110 0100 1100 0011 xxxx xxxx */ -static void ADI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = eom + imm; - - ZHC_ADD( tmp, eom, 0 ); - EOM = tmp; - upd7810_write_EOM(); -} - -/* 64 c5: 0110 0100 1100 0101 xxxx xxxx */ -static void ADI_TMM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = TMM + imm; - - ZHC_ADD( tmp, TMM, 0 ); - TMM = tmp; -} - -/* 64 c8: 0110 0100 1100 1000 xxxx xxxx */ -static void ONI_ANM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (ANM & imm) - PSW |= SK; -} - -/* 64 c9: 0110 0100 1100 1001 xxxx xxxx */ -static void ONI_SMH_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (SMH & imm) - PSW |= SK; -} - -/* 64 cb: 0110 0100 1100 1011 xxxx xxxx */ -static void ONI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; - - RDOPARG( imm ); - if (eom & imm) - PSW |= SK; -} - -/* 64 cd: 0110 0100 1100 1101 xxxx xxxx */ -static void ONI_TMM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (TMM & imm) - PSW |= SK; -} - -/* 64 d0: 0110 0100 1101 0000 xxxx xxxx */ -static void ACI_ANM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = ANM + imm + (PSW & CY); - - ZHC_ADD( tmp, ANM, (PSW & CY) ); - ANM = tmp; -} - -/* 64 d1: 0110 0100 1101 0001 xxxx xxxx */ -static void ACI_SMH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = SMH + imm + (PSW & CY); - - ZHC_ADD( tmp, SMH, (PSW & CY) ); - SMH = tmp; -} - -/* 64 d3: 0110 0100 1101 0011 xxxx xxxx */ -static void ACI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = eom + imm + (PSW & CY); - - ZHC_ADD( tmp, eom, (PSW & CY) ); - EOM = tmp; - upd7810_write_EOM(); -} - -/* 64 d5: 0110 0100 1101 0101 xxxx xxxx */ -static void ACI_TMM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = TMM + imm + (PSW & CY); - - ZHC_ADD( tmp, TMM, (PSW & CY) ); - TMM = tmp; -} - -/* 64 d8: 0110 0100 1101 1000 xxxx xxxx */ -static void OFFI_ANM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (ANM & imm)) - PSW |= SK; -} - -/* 64 d9: 0110 0100 1101 1001 xxxx xxxx */ -static void OFFI_SMH_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (SMH & imm)) - PSW |= SK; -} - -/* 64 db: 0110 0100 1101 1011 xxxx xxxx */ -static void OFFI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; - - RDOPARG( imm ); - if (0 == (eom & imm)) - PSW |= SK; -} - -/* 64 dd: 0110 0100 1101 1101 xxxx xxxx */ -static void OFFI_TMM_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (TMM & imm)) - PSW |= SK; -} - -/* 64 e0: 0110 0100 1110 0000 xxxx xxxx */ -static void SUI_ANM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = ANM - imm; - ZHC_SUB( tmp, ANM, 0 ); - ANM = tmp; -} - -/* 64 e1: 0110 0100 1110 0001 xxxx xxxx */ -static void SUI_SMH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = SMH - imm; - ZHC_SUB( tmp, SMH, 0 ); - SMH = tmp; -} - -/* 64 e3: 0110 0100 1110 0011 xxxx xxxx */ -static void SUI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = eom - imm; - ZHC_SUB( tmp, eom, 0 ); - EOM = tmp; - upd7810_write_EOM(); -} - -/* 64 e5: 0110 0100 1110 0101 xxxx xxxx */ -static void SUI_TMM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = TMM - imm; - ZHC_SUB( tmp, TMM, 0 ); - TMM = tmp; -} - -/* 64 e8: 0110 0100 1110 1000 xxxx xxxx */ -static void NEI_ANM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = ANM - imm; - ZHC_SUB( tmp, ANM, 0 ); - SKIP_NZ; -} - -/* 64 e9: 0110 0100 1110 1001 xxxx xxxx */ -static void NEI_SMH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = SMH - imm; - ZHC_SUB( tmp, SMH, 0 ); - SKIP_NZ; -} - -/* 64 eb: 0110 0100 1110 1011 xxxx xxxx */ -static void NEI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = eom - imm; - ZHC_SUB( tmp, eom, 0 ); - SKIP_NZ; -} - -/* 64 ed: 0110 0100 1110 1101 xxxx xxxx */ -static void NEI_TMM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = TMM - imm; - ZHC_SUB( tmp, TMM, 0 ); - SKIP_NZ; -} - -/* 64 f0: 0110 0100 1111 0000 xxxx xxxx */ -static void SBI_ANM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = ANM - imm - (PSW & CY); - ZHC_SUB( tmp, ANM, (PSW & CY) ); - ANM = tmp; -} - -/* 64 f1: 0110 0100 1111 0001 xxxx xxxx */ -static void SBI_SMH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = SMH - imm - (PSW & CY); - ZHC_SUB( tmp, SMH, (PSW & CY) ); - SMH = tmp; -} - -/* 64 f3: 0110 0100 1111 0011 xxxx xxxx */ -static void SBI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = eom - imm - (PSW & CY); - ZHC_SUB( tmp, eom, (PSW & CY) ); - EOM = tmp; - upd7810_write_EOM(); -} - -/* 64 f5: 0110 0100 1111 0101 xxxx xxxx */ -static void SBI_TMM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = TMM - imm - (PSW & CY); - ZHC_SUB( tmp, TMM, (PSW & CY) ); - TMM = tmp; -} - -/* 64 f8: 0110 0100 1111 1000 xxxx xxxx */ -static void EQI_ANM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = ANM - imm; - ZHC_SUB( tmp, ANM, 0 ); - SKIP_Z; -} - -/* 64 f9: 0110 0100 1111 1001 xxxx xxxx */ -static void EQI_SMH_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = SMH - imm; - ZHC_SUB( tmp, SMH, 0 ); - SKIP_Z; -} - -/* 64 fb: 0110 0100 1111 1011 xxxx xxxx */ -static void EQI_EOM_xx(void) -{ - /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = eom - imm; - ZHC_SUB( tmp, eom, 0 ); - SKIP_Z; -} - -/* 64 fd: 0110 0100 1111 1101 xxxx xxxx */ -static void EQI_TMM_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = TMM - imm; - ZHC_SUB( tmp, TMM, 0 ); - SKIP_Z; -} - -/* prefix 70 */ -/* 70 0e: 0111 0000 0000 1110 llll llll hhhh hhhh */ -static void SSPD_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, SPL ); - WM( ea.d + 1, SPH ); -} - -/* 70 0f: 0111 0000 0000 1111 llll llll hhhh hhhh */ -static void LSPD_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - SPL = RM( ea.d ); - SPH = RM( ea.d + 1 ); -} - -/* 70 1e: 0111 0000 0001 1110 llll llll hhhh hhhh */ -static void SBCD_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, C ); - WM( ea.d + 1, B ); -} - -/* 70 1f: 0111 0000 0001 1111 llll llll hhhh hhhh */ -static void LBCD_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - C = RM( ea.d ); - B = RM( ea.d + 1 ); -} - -/* 70 2e: 0111 0000 0010 1110 llll llll hhhh hhhh */ -static void SDED_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, E ); - WM( ea.d + 1, D ); -} - -/* 70 2f: 0111 0000 0010 1111 llll llll hhhh hhhh */ -static void LDED_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - E = RM( ea.d ); - D = RM( ea.d + 1 ); -} - -/* 70 3e: 0111 0000 0011 1110 llll llll hhhh hhhh */ -static void SHLD_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, L ); - WM( ea.d + 1, H ); -} - -/* 70 3f: 0111 0000 0011 1111 llll llll hhhh hhhh */ -static void LHLD_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - L = RM( ea.d ); - H = RM( ea.d + 1 ); -} - -/* 70 41: 0111 0000 0100 0001 */ -static void EADD_EA_A(void) -{ - UINT16 tmp; - tmp = EA + A; - ZHC_ADD( tmp, EA, 0 ); - EA = tmp; -} - -/* 70 42: 0111 0000 0100 0010 */ -static void EADD_EA_B(void) -{ - UINT16 tmp; - tmp = EA + B; - ZHC_ADD( tmp, EA, 0 ); - EA = tmp; -} - -/* 70 43: 0111 0000 0100 0011 */ -static void EADD_EA_C(void) -{ - UINT16 tmp; - tmp = EA + C; - ZHC_ADD( tmp, EA, 0 ); - EA = tmp; -} - -/* 70 61: 0111 0000 0110 0001 */ -static void ESUB_EA_A(void) -{ - UINT16 tmp; - tmp = EA - A; - ZHC_SUB( tmp, EA, 0 ); - EA = tmp; -} - -/* 70 62: 0111 0000 0110 0010 */ -static void ESUB_EA_B(void) -{ - UINT16 tmp; - tmp = EA - B; - ZHC_SUB( tmp, EA, 0 ); - EA = tmp; -} - -/* 70 63: 0111 0000 0110 0011 */ -static void ESUB_EA_C(void) -{ - UINT16 tmp; - tmp = EA - C; - ZHC_SUB( tmp, EA, 0 ); - EA = tmp; -} - -/* 70 68: 0111 0000 0110 1000 llll llll hhhh hhhh */ -static void MOV_V_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - V = RM( ea.d ); -} - -/* 70 69: 0111 0000 0110 1001 llll llll hhhh hhhh */ -static void MOV_A_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - A = RM( ea.d ); -} - -/* 70 6a: 0111 0000 0110 1010 llll llll hhhh hhhh */ -static void MOV_B_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - B = RM( ea.d ); -} - -/* 70 6b: 0111 0000 0110 1011 llll llll hhhh hhhh */ -static void MOV_C_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - C = RM( ea.d ); -} - -/* 70 6c: 0111 0000 0110 1100 llll llll hhhh hhhh */ -static void MOV_D_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - D = RM( ea.d ); -} - -/* 70 6d: 0111 0000 0110 1101 llll llll hhhh hhhh */ -static void MOV_E_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - E = RM( ea.d ); -} - -/* 70 6e: 0111 0000 0110 1110 llll llll hhhh hhhh */ -static void MOV_H_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - H = RM( ea.d ); -} - -/* 70 6f: 0111 0000 0110 1111 llll llll hhhh hhhh */ -static void MOV_L_w(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - L = RM( ea.d ); -} - -/* 70 78: 0111 0000 0111 1000 llll llll hhhh hhhh */ -static void MOV_w_V(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, V ); -} - -/* 70 79: 0111 0000 0111 1001 llll llll hhhh hhhh */ -static void MOV_w_A(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, A ); -} - -/* 70 7a: 0111 0000 0111 1010 llll llll hhhh hhhh */ -static void MOV_w_B(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, B ); -} - -/* 70 7b: 0111 0000 0111 1011 llll llll hhhh hhhh */ -static void MOV_w_C(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, C ); -} - -/* 70 7c: 0111 0000 0111 1100 llll llll hhhh hhhh */ -static void MOV_w_D(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, D ); -} - -/* 70 7d: 0111 0000 0111 1101 llll llll hhhh hhhh */ -static void MOV_w_E(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, E ); -} - -/* 70 7e: 0111 0000 0111 1110 llll llll hhhh hhhh */ -static void MOV_w_H(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, H ); -} - -/* 70 7f: 0111 0000 0111 1111 llll llll hhhh hhhh */ -static void MOV_w_L(void) -{ - PAIR ea; - ea.d = 0; - - RDOPARG( ea.b.l ); - RDOPARG( ea.b.h ); - WM( ea.d, L ); -} - -/* 70 89: 0111 0000 1000 1001 */ -static void ANAX_B(void) -{ - A &= RM( BC ); - SET_Z(A); -} - -/* 70 8a: 0111 0000 1000 1010 */ -static void ANAX_D(void) -{ - A &= RM( DE ); - SET_Z(A); -} - -/* 70 8b: 0111 0000 1000 1011 */ -static void ANAX_H(void) -{ - A &= RM( HL ); - SET_Z(A); -} - -/* 70 8c: 0111 0000 1000 1100 */ -static void ANAX_Dp(void) -{ - A &= RM( DE ); - DE++; - SET_Z(A); -} - -/* 70 8d: 0111 0000 1000 1101 */ -static void ANAX_Hp(void) -{ - A &= RM( HL ); - HL++; - SET_Z(A); -} - -/* 70 8e: 0111 0000 1000 1110 */ -static void ANAX_Dm(void) -{ - A &= RM( DE ); - DE--; - SET_Z(A); -} - -/* 70 8f: 0111 0000 1000 1111 */ -static void ANAX_Hm(void) -{ - A &= RM( HL ); - HL--; - SET_Z(A); -} - -/* 70 91: 0111 0000 1001 0001 */ -static void XRAX_B(void) -{ - A ^= RM( BC ); - SET_Z(A); -} - -/* 70 92: 0111 0000 1001 0010 */ -static void XRAX_D(void) -{ - A ^= RM( DE ); - SET_Z(A); -} - -/* 70 93: 0111 0000 1001 0011 */ -static void XRAX_H(void) -{ - A ^= RM( HL ); - SET_Z(A); -} - -/* 70 94: 0111 0000 1001 0100 */ -static void XRAX_Dp(void) -{ - A ^= RM( DE ); - DE++; - SET_Z(A); -} - -/* 70 95: 0111 0000 1001 0101 */ -static void XRAX_Hp(void) -{ - A ^= RM( HL ); - HL++; - SET_Z(A); -} - -/* 70 96: 0111 0000 1001 0110 */ -static void XRAX_Dm(void) -{ - A ^= RM( DE ); - DE--; - SET_Z(A); -} - -/* 70 97: 0111 0000 1001 0111 */ -static void XRAX_Hm(void) -{ - A ^= RM( HL ); - HL--; - SET_Z(A); -} - -/* 70 99: 0111 0000 1001 1001 */ -static void ORAX_B(void) -{ - A |= RM( BC ); - SET_Z(A); -} - -/* 70 9a: 0111 0000 1001 1010 */ -static void ORAX_D(void) -{ - A |= RM( DE ); - SET_Z(A); -} - -/* 70 9b: 0111 0000 1001 1011 */ -static void ORAX_H(void) -{ - A |= RM( HL ); - SET_Z(A); -} - -/* 70 9c: 0111 0000 1001 0100 */ -static void ORAX_Dp(void) -{ - A |= RM( DE ); - DE++; - SET_Z(A); -} - -/* 70 9d: 0111 0000 1001 1101 */ -static void ORAX_Hp(void) -{ - A |= RM( HL ); - HL++; - SET_Z(A); -} - -/* 70 9e: 0111 0000 1001 1110 */ -static void ORAX_Dm(void) -{ - A |= RM( DE ); - DE--; - SET_Z(A); -} - -/* 70 9f: 0111 0000 1001 1111 */ -static void ORAX_Hm(void) -{ - A |= RM( HL ); - HL--; - SET_Z(A); -} - -/* 70 a1: 0111 0000 1010 0001 */ -static void ADDNCX_B(void) -{ - UINT8 tmp = A + RM( BC ); - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 a2: 0111 0000 1010 0010 */ -static void ADDNCX_D(void) -{ - UINT8 tmp = A + RM( DE ); - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 a3: 0111 0000 1010 0011 */ -static void ADDNCX_H(void) -{ - UINT8 tmp = A + RM( HL ); - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 a4: 0111 0000 1010 0100 */ -static void ADDNCX_Dp(void) -{ - UINT8 tmp = A + RM( DE ); - DE++; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 a5: 0111 0000 1010 0101 */ -static void ADDNCX_Hp(void) -{ - UINT8 tmp = A + RM( HL ); - HL++; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 a6: 0111 0000 1010 0110 */ -static void ADDNCX_Dm(void) -{ - UINT8 tmp = A + RM( DE ); - DE--; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 a7: 0111 0000 1010 0111 */ -static void ADDNCX_Hm(void) -{ - UINT8 tmp = A + RM( HL ); - HL--; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 a9: 0111 0000 1010 1001 */ -static void GTAX_B(void) -{ - UINT16 tmp = A - RM( BC ) - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 70 aa: 0111 0000 1010 1010 */ -static void GTAX_D(void) -{ - UINT16 tmp = A - RM( DE ) - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 70 ab: 0111 0000 1010 1011 */ -static void GTAX_H(void) -{ - UINT16 tmp = A - RM( HL ) - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 70 ac: 0111 0000 1010 1100 */ -static void GTAX_Dp(void) -{ - UINT16 tmp = A - RM( DE ) - 1; - DE++; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 70 ad: 0111 0000 1010 1101 */ -static void GTAX_Hp(void) -{ - UINT16 tmp = A - RM( HL ) - 1; - HL++; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 70 ae: 0111 0000 1010 1110 */ -static void GTAX_Dm(void) -{ - UINT16 tmp = A - RM( DE ) - 1; - DE--; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 70 af: 0111 0000 1010 1111 */ -static void GTAX_Hm(void) -{ - UINT16 tmp = A - RM( HL ) - 1; - HL--; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 70 b1: 0111 0000 1011 0001 */ -static void SUBNBX_B(void) -{ - UINT8 tmp = A - RM( BC ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 b2: 0111 0000 1011 0010 */ -static void SUBNBX_D(void) -{ - UINT8 tmp = A - RM( DE ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 b3: 0111 0000 1011 0011 */ -static void SUBNBX_H(void) -{ - UINT8 tmp = A - RM( HL ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 b4: 0111 0000 1011 0100 */ -static void SUBNBX_Dp(void) -{ - UINT8 tmp = A - RM( DE ); - DE++; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 b5: 0111 0000 1011 0101 */ -static void SUBNBX_Hp(void) -{ - UINT8 tmp = A - RM( HL ); - HL++; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 b6: 0111 0000 1011 0110 */ -static void SUBNBX_Dm(void) -{ - UINT8 tmp = A - RM( DE ); - DE--; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 b7: 0111 0000 1011 0111 */ -static void SUBNBX_Hm(void) -{ - UINT8 tmp = A - RM( HL ); - HL--; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 70 b9: 0111 0000 1011 1001 */ -static void LTAX_B(void) -{ - UINT8 tmp = A - RM( BC ); - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 70 ba: 0111 0000 1011 1010 */ -static void LTAX_D(void) -{ - UINT8 tmp = A - RM( DE ); - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 70 bb: 0111 0000 1011 1011 */ -static void LTAX_H(void) -{ - UINT8 tmp = A - RM( HL ); - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 70 bc: 0111 0000 1011 1100 */ -static void LTAX_Dp(void) -{ - UINT8 tmp = A - RM( DE ); - DE++; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 70 bd: 0111 0000 1011 1101 */ -static void LTAX_Hp(void) -{ - UINT8 tmp = A - RM( HL ); - HL++; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 70 be: 0111 0000 1011 1110 */ -static void LTAX_Dm(void) -{ - UINT8 tmp = A - RM( DE ); - DE--; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 70 bf: 0111 0000 1011 1111 */ -static void LTAX_Hm(void) -{ - UINT8 tmp = A - RM( HL ); - HL--; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 70 c1: 0111 0000 1100 0001 */ -static void ADDX_B(void) -{ - UINT8 tmp = A + RM( BC ); - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 c2: 0111 0000 1100 0010 */ -static void ADDX_D(void) -{ - UINT8 tmp = A + RM( DE ); - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 c3: 0111 0000 1100 0011 */ -static void ADDX_H(void) -{ - UINT8 tmp = A + RM( HL ); - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 c4: 0111 0000 1100 0100 */ -static void ADDX_Dp(void) -{ - UINT8 tmp = A + RM( DE ); - DE++; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 c5: 0111 0000 1100 0101 */ -static void ADDX_Hp(void) -{ - UINT8 tmp = A + RM( HL ); - HL++; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 c6: 0111 0000 1100 0110 */ -static void ADDX_Dm(void) -{ - UINT8 tmp = A + RM( DE ); - DE--; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 c7: 0111 0000 1100 0111 */ -static void ADDX_Hm(void) -{ - UINT8 tmp = A + RM( HL ); - HL--; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 c9: 0111 0000 1100 1001 */ -static void ONAX_B(void) -{ - if (A & RM( BC )) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 70 ca: 0111 0000 1100 1010 */ -static void ONAX_D(void) -{ - if (A & RM( DE )) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 70 cb: 0111 0000 1100 1011 */ -static void ONAX_H(void) -{ - if (A & RM( HL )) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 70 cc: 0111 0000 1100 1100 */ -static void ONAX_Dp(void) -{ - if (A & RM( DE )) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; - DE++; -} - -/* 70 cd: 0111 0000 1100 1101 */ -static void ONAX_Hp(void) -{ - if (A & RM( HL )) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; - HL++; -} - -/* 70 ce: 0111 0000 1100 1110 */ -static void ONAX_Dm(void) -{ - if (A & RM( DE )) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; - DE--; -} - -/* 70 cf: 0111 0000 1100 1111 */ -static void ONAX_Hm(void) -{ - if (A & RM( HL )) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; - HL--; -} - -/* 70 d1: 0111 0000 1101 0001 */ -static void ADCX_B(void) -{ - UINT8 tmp = A + RM( BC ) + (PSW & CY); - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 d2: 0111 0000 1101 0010 */ -static void ADCX_D(void) -{ - UINT8 tmp = A + RM( DE ) + (PSW & CY); - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 d3: 0111 0000 1101 0011 */ -static void ADCX_H(void) -{ - UINT8 tmp = A + RM( HL ) + (PSW & CY); - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 d4: 0111 0000 1101 0100 */ -static void ADCX_Dp(void) -{ - UINT8 tmp = A + RM( DE ) + (PSW & CY); - DE++; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 d5: 0111 0000 1101 0101 */ -static void ADCX_Hp(void) -{ - UINT8 tmp = A + RM( HL ) + (PSW & CY); - HL++; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 d6: 0111 0000 1101 0110 */ -static void ADCX_Dm(void) -{ - UINT8 tmp = A + RM( DE ) + (PSW & CY); - DE--; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 d7: 0111 0000 1101 0111 */ -static void ADCX_Hm(void) -{ - UINT8 tmp = A + RM( HL ) + (PSW & CY); - HL--; - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 70 d9: 0111 0000 1101 1001 */ -static void OFFAX_B(void) -{ - if ( A & RM( BC ) ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 70 da: 0111 0000 1101 1010 */ -static void OFFAX_D(void) -{ - if ( A & RM( DE ) ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 70 db: 0111 0000 1101 1011 */ -static void OFFAX_H(void) -{ - if ( A & RM( HL ) ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 70 dc: 0111 0000 1101 1100 */ -static void OFFAX_Dp(void) -{ - if ( A & RM( DE ) ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; - DE++; -} - -/* 70 dd: 0111 0000 1101 1101 */ -static void OFFAX_Hp(void) -{ - if ( A & RM( HL ) ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; - HL++; -} - -/* 70 de: 0111 0000 1101 1110 */ -static void OFFAX_Dm(void) -{ - if ( A & RM( DE ) ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; - DE--; -} - -/* 70 df: 0111 0000 1101 1111 */ -static void OFFAX_Hm(void) -{ - if ( A & RM( HL ) ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; - HL--; -} - -/* 70 e1: 0111 0000 1110 0001 */ -static void SUBX_B(void) -{ - UINT8 tmp = A - RM( BC ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 70 e2: 0111 0000 1110 0010 */ -static void SUBX_D(void) -{ - UINT8 tmp = A - RM( DE ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 70 e3: 0111 0000 1110 0011 */ -static void SUBX_H(void) -{ - UINT8 tmp = A - RM( HL ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 70 e4: 0111 0000 1110 0100 */ -static void SUBX_Dp(void) -{ - UINT8 tmp = A - RM( DE ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; - DE++; -} - -/* 70 e5: 0111 0000 1110 0101 */ -static void SUBX_Hp(void) -{ - UINT8 tmp = A - RM( HL ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; - HL++; -} - -/* 70 e6: 0111 0000 1110 0110 */ -static void SUBX_Dm(void) -{ - UINT8 tmp = A - RM( DE ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; - DE--; -} - -/* 70 e7: 0111 0000 1110 0111 */ -static void SUBX_Hm(void) -{ - UINT8 tmp = A - RM( HL ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; - HL--; -} - -/* 70 e9: 0111 0000 1110 1001 */ -static void NEAX_B(void) -{ - UINT8 tmp = A - RM( BC ); - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 70 ea: 0111 0000 1110 1010 */ -static void NEAX_D(void) -{ - UINT8 tmp = A - RM( DE ); - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 70 eb: 0111 0000 1110 1011 */ -static void NEAX_H(void) -{ - UINT8 tmp = A - RM( HL ); - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 70 ec: 0111 0000 1110 1100 */ -static void NEAX_Dp(void) -{ - UINT8 tmp = A - RM( DE ); - DE++; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 70 ed: 0111 0000 1110 1101 */ -static void NEAX_Hp(void) -{ - UINT8 tmp = A - RM( HL ); - HL++; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 70 ee: 0111 0000 1110 1110 */ -static void NEAX_Dm(void) -{ - UINT8 tmp = A - RM( DE ); - DE--; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 70 ef: 0111 0000 1110 1111 */ -static void NEAX_Hm(void) -{ - UINT8 tmp = A - RM( HL ); - HL--; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 70 f1: 0111 0000 1111 0001 */ -static void SBBX_B(void) -{ - UINT8 tmp = A - RM( BC ) - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 70 f2: 0111 0000 1111 0010 */ -static void SBBX_D(void) -{ - UINT8 tmp = A - RM( DE ) - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 70 f3: 0111 0000 1111 0011 */ -static void SBBX_H(void) -{ - UINT8 tmp = A - RM( HL ) - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 70 f4: 0111 0000 1111 0100 */ -static void SBBX_Dp(void) -{ - UINT8 tmp = A - RM( DE ) - (PSW & CY); - DE++; - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 70 f5: 0111 0000 1111 0101 */ -static void SBBX_Hp(void) -{ - UINT8 tmp = A - RM( HL ) - (PSW & CY); - HL++; - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 70 f6: 0111 0000 1111 0110 */ -static void SBBX_Dm(void) -{ - UINT8 tmp = A - RM( DE ) - (PSW & CY); - DE--; - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 70 f7: 0111 0000 1111 0111 */ -static void SBBX_Hm(void) -{ - UINT8 tmp = A - RM( HL ) - (PSW & CY); - HL--; - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 70 f9: 0111 0000 1111 1001 */ -static void EQAX_B(void) -{ - UINT8 tmp = A - RM( BC ); - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 70 fa: 0111 0000 1111 1010 */ -static void EQAX_D(void) -{ - UINT8 tmp = A - RM( DE ); - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 70 fb: 0111 0000 1111 1011 */ -static void EQAX_H(void) -{ - UINT8 tmp = A - RM( HL ); - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 70 fc: 0111 0000 1111 1100 */ -static void EQAX_Dp(void) -{ - UINT8 tmp = A - RM( DE ); - DE++; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 70 fd: 0111 0000 1111 1101 */ -static void EQAX_Hp(void) -{ - UINT8 tmp = A - RM( HL ); - HL++; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 70 fe: 0111 0000 1111 1110 */ -static void EQAX_Dm(void) -{ - UINT8 tmp = A - RM( DE ); - DE--; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 70 ff: 0111 0000 1111 1111 */ -static void EQAX_Hm(void) -{ - UINT8 tmp = A - RM( HL ); - HL--; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* prefix 74 */ -/* 74 08: 0111 0100 0000 1000 xxxx xxxx */ -static void ANI_V_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - V &= imm; - SET_Z(V); -} - -/* 74 09: 0111 0100 0000 1001 xxxx xxxx */ -static void ANI_A_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - A &= imm; - SET_Z(A); -} - -/* 74 0a: 0111 0100 0000 1010 xxxx xxxx */ -static void ANI_B_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - B &= imm; - SET_Z(B); -} - -/* 74 0b: 0111 0100 0000 1011 xxxx xxxx */ -static void ANI_C_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - C &= imm; - SET_Z(C); -} - -/* 74 0c: 0111 0100 0000 1100 xxxx xxxx */ -static void ANI_D_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - D &= imm; - SET_Z(D); -} - -/* 74 0d: 0111 0100 0000 1101 xxxx xxxx */ -static void ANI_E_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - E &= imm; - SET_Z(E); -} - -/* 74 0e: 0111 0100 0000 1110 xxxx xxxx */ -static void ANI_H_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - H &= imm; - SET_Z(H); -} - -/* 74 0f: 0111 0100 0000 1111 xxxx xxxx */ -static void ANI_L_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - L &= imm; - SET_Z(L); -} - -/* 74 10: 0111 0100 0001 0000 xxxx xxxx */ -static void XRI_V_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - V ^= imm; - SET_Z(V); -} - -/* 74 11: 0111 0100 0001 0001 xxxx xxxx */ -static void XRI_A_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - A ^= imm; - SET_Z(A); -} - -/* 74 12: 0111 0100 0001 0010 xxxx xxxx */ -static void XRI_B_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - B ^= imm; - SET_Z(B); -} - -/* 74 13: 0111 0100 0001 0011 xxxx xxxx */ -static void XRI_C_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - C ^= imm; - SET_Z(C); -} - -/* 74 14: 0111 0100 0001 0100 xxxx xxxx */ -static void XRI_D_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - D ^= imm; - SET_Z(D); -} - -/* 74 15: 0111 0100 0001 0101 xxxx xxxx */ -static void XRI_E_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - E ^= imm; - SET_Z(E); -} - -/* 74 16: 0111 0100 0001 0110 xxxx xxxx */ -static void XRI_H_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - H ^= imm; - SET_Z(H); -} - -/* 74 17: 0111 0100 0001 0111 xxxx xxxx */ -static void XRI_L_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - L ^= imm; - SET_Z(L); -} - -/* 74 18: 0111 0100 0001 1000 xxxx xxxx */ -static void ORI_V_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - V |= imm; - SET_Z(V); -} - -/* 74 19: 0111 0100 0001 1001 xxxx xxxx */ -static void ORI_A_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - A |= imm; - SET_Z(A); -} - -/* 74 1a: 0111 0100 0001 1010 xxxx xxxx */ -static void ORI_B_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - B |= imm; - SET_Z(B); -} - -/* 74 1b: 0111 0100 0001 1011 xxxx xxxx */ -static void ORI_C_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - C |= imm; - SET_Z(C); -} - -/* 74 1c: 0111 0100 0001 1100 xxxx xxxx */ -static void ORI_D_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - D |= imm; - SET_Z(D); -} - -/* 74 1d: 0111 0100 0001 1101 xxxx xxxx */ -static void ORI_E_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - E |= imm; - SET_Z(E); -} - -/* 74 1e: 0111 0100 0001 1110 xxxx xxxx */ -static void ORI_H_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - H |= imm; - SET_Z(H); -} - -/* 74 1f: 0111 0100 0001 1111 xxxx xxxx */ -static void ORI_L_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - L |= imm; - SET_Z(L); -} - -/* 74 20: 0111 0100 0010 0000 xxxx xxxx */ -static void ADINC_V_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = V + imm; - - ZHC_ADD( tmp, V, 0 ); - V = tmp; - SKIP_NC; -} - -/* 74 21: 0111 0100 0010 0001 xxxx xxxx */ -static void ADINC_A_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = A + imm; - - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 74 22: 0111 0100 0010 0010 xxxx xxxx */ -static void ADINC_B_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = B + imm; - - ZHC_ADD( tmp, B, 0 ); - B = tmp; - SKIP_NC; -} - -/* 74 23: 0111 0100 0010 0011 xxxx xxxx */ -static void ADINC_C_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = C + imm; - - ZHC_ADD( tmp, C, 0 ); - C = tmp; - SKIP_NC; -} - -/* 74 24: 0111 0100 0010 0100 xxxx xxxx */ -static void ADINC_D_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = D + imm; - - ZHC_ADD( tmp, D, 0 ); - D = tmp; - SKIP_NC; -} - -/* 74 25: 0111 0100 0010 0101 xxxx xxxx */ -static void ADINC_E_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = E + imm; - - ZHC_ADD( tmp, E, 0 ); - E = tmp; - SKIP_NC; -} - -/* 74 26: 0111 0100 0010 0110 xxxx xxxx */ -static void ADINC_H_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = H + imm; - - ZHC_ADD( tmp, H, 0 ); - H = tmp; - SKIP_NC; -} - -/* 74 27: 0111 0100 0010 0111 xxxx xxxx */ -static void ADINC_L_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = L + imm; - - ZHC_ADD( tmp, L, 0 ); - L = tmp; - SKIP_NC; -} - -/* 74 28: 0111 0100 0010 1000 xxxx xxxx */ -static void GTI_V_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = V - imm - 1; - ZHC_SUB( tmp, V, 0 ); - - SKIP_NC; -} - -/* 74 29: 0111 0100 0010 1001 xxxx xxxx */ -static void GTI_A_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = A - imm - 1; - ZHC_SUB( tmp, A, 0 ); - - SKIP_NC; -} - -/* 74 2a: 0111 0100 0010 1010 xxxx xxxx */ -static void GTI_B_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = B - imm - 1; - ZHC_SUB( tmp, B, 0 ); - - SKIP_NC; -} - -/* 74 2b: 0111 0100 0010 1011 xxxx xxxx */ -static void GTI_C_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = C - imm - 1; - ZHC_SUB( tmp, C, 0 ); - - SKIP_NC; -} - -/* 74 2c: 0111 0100 0010 1100 xxxx xxxx */ -static void GTI_D_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = D - imm - 1; - ZHC_SUB( tmp, D, 0 ); - - SKIP_NC; -} - -/* 74 2d: 0111 0100 0010 1101 xxxx xxxx */ -static void GTI_E_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = E - imm - 1; - ZHC_SUB( tmp, E, 0 ); - - SKIP_NC; -} - -/* 74 2e: 0111 0100 0010 1110 xxxx xxxx */ -static void GTI_H_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = H - imm - 1; - ZHC_SUB( tmp, H, 0 ); - - SKIP_NC; -} - -/* 74 2f: 0111 0100 0010 1111 xxxx xxxx */ -static void GTI_L_xx(void) -{ - UINT8 imm; - UINT16 tmp; - - RDOPARG( imm ); - tmp = L - imm - 1; - ZHC_SUB( tmp, L, 0 ); - - SKIP_NC; -} - -/* 74 30: 0111 0100 0011 0000 xxxx xxxx */ -static void SUINB_V_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = V - imm; - ZHC_SUB( tmp, V, 0 ); - V = tmp; - SKIP_NC; -} - -/* 74 31: 0111 0100 0011 0001 xxxx xxxx */ -static void SUINB_A_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = A - imm; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 74 32: 0111 0100 0011 0010 xxxx xxxx */ -static void SUINB_B_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = B - imm; - ZHC_SUB( tmp, B, 0 ); - B = tmp; - SKIP_NC; -} - -/* 74 33: 0111 0100 0011 0011 xxxx xxxx */ -static void SUINB_C_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = C - imm; - ZHC_SUB( tmp, C, 0 ); - C = tmp; - SKIP_NC; -} - -/* 74 34: 0111 0100 0011 0100 xxxx xxxx */ -static void SUINB_D_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = D - imm; - ZHC_SUB( tmp, D, 0 ); - D = tmp; - SKIP_NC; -} - -/* 74 35: 0111 0100 0011 0101 xxxx xxxx */ -static void SUINB_E_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = E - imm; - ZHC_SUB( tmp, E, 0 ); - E = tmp; - SKIP_NC; -} - -/* 74 36: 0111 0100 0011 0110 xxxx xxxx */ -static void SUINB_H_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = H - imm; - ZHC_SUB( tmp, H, 0 ); - H = tmp; - SKIP_NC; -} - -/* 74 37: 0111 0100 0011 0111 xxxx xxxx */ -static void SUINB_L_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = L - imm; - ZHC_SUB( tmp, L, 0 ); - L = tmp; - SKIP_NC; -} - -/* 74 38: 0111 0100 0011 1000 xxxx xxxx */ -static void LTI_V_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = V - imm; - ZHC_SUB( tmp, V, 0 ); - SKIP_CY; -} - -/* 74 39: 0111 0100 0011 1001 xxxx xxxx */ -static void LTI_A_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = A - imm; - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 74 3a: 0111 0100 0011 1010 xxxx xxxx */ -static void LTI_B_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = B - imm; - ZHC_SUB( tmp, B, 0 ); - SKIP_CY; -} - -/* 74 3b: 0111 0100 0011 1011 xxxx xxxx */ -static void LTI_C_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = C - imm; - ZHC_SUB( tmp, C, 0 ); - SKIP_CY; -} - -/* 74 3c: 0111 0100 0011 1100 xxxx xxxx */ -static void LTI_D_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = D - imm; - ZHC_SUB( tmp, D, 0 ); - SKIP_CY; -} - -/* 74 3d: 0111 0100 0011 1101 xxxx xxxx */ -static void LTI_E_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = E - imm; - ZHC_SUB( tmp, E, 0 ); - SKIP_CY; -} - -/* 74 3e: 0111 0100 0011 1110 xxxx xxxx */ -static void LTI_H_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = H - imm; - ZHC_SUB( tmp, H, 0 ); - SKIP_CY; -} - -/* 74 3f: 0111 0100 0011 1111 xxxx xxxx */ -static void LTI_L_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = L - imm; - ZHC_SUB( tmp, L, 0 ); - SKIP_CY; -} - -/* 74 40: 0111 0100 0100 0000 xxxx xxxx */ -static void ADI_V_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = V + imm; - - ZHC_ADD( tmp, V, 0 ); - V = tmp; -} - -/* 74 41: 0111 0100 0100 0001 xxxx xxxx */ -static void ADI_A_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = A + imm; - - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 74 42: 0111 0100 0100 0010 xxxx xxxx */ -static void ADI_B_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = B + imm; - - ZHC_ADD( tmp, B, 0 ); - B = tmp; -} - -/* 74 43: 0111 0100 0100 0011 xxxx xxxx */ -static void ADI_C_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = C + imm; - - ZHC_ADD( tmp, C, 0 ); - C = tmp; -} - -/* 74 44: 0111 0100 0100 0100 xxxx xxxx */ -static void ADI_D_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = D + imm; - - ZHC_ADD( tmp, D, 0 ); - D = tmp; -} - -/* 74 45: 0111 0100 0100 0101 xxxx xxxx */ -static void ADI_E_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = E + imm; - - ZHC_ADD( tmp, E, 0 ); - E = tmp; -} - -/* 74 46: 0111 0100 0100 0110 xxxx xxxx */ -static void ADI_H_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = H + imm; - - ZHC_ADD( tmp, H, 0 ); - H = tmp; -} - -/* 74 47: 0111 0100 0100 0111 xxxx xxxx */ -static void ADI_L_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = L + imm; - - ZHC_ADD( tmp, L, 0 ); - L = tmp; -} - -/* 74 48: 0111 0100 0100 1000 xxxx xxxx */ -static void ONI_V_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (V & imm) - PSW |= SK; -} - -/* 74 49: 0111 0100 0100 1001 xxxx xxxx */ -static void ONI_A_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (A & imm) - PSW |= SK; -} - -/* 74 4a: 0111 0100 0100 1010 xxxx xxxx */ -static void ONI_B_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (B & imm) - PSW |= SK; -} - -/* 74 4b: 0111 0100 0100 1011 xxxx xxxx */ -static void ONI_C_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (C & imm) - PSW |= SK; -} - -/* 74 4c: 0111 0100 0100 1100 xxxx xxxx */ -static void ONI_D_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (D & imm) - PSW |= SK; -} - -/* 74 4d: 0111 0100 0100 1101 xxxx xxxx */ -static void ONI_E_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (E & imm) - PSW |= SK; -} - -/* 74 4e: 0111 0100 0100 1110 xxxx xxxx */ -static void ONI_H_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (H & imm) - PSW |= SK; -} - -/* 74 4f: 0111 0100 0100 1111 xxxx xxxx */ -static void ONI_L_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (L & imm) - PSW |= SK; -} - -/* 74 50: 0111 0100 0101 0000 xxxx xxxx */ -static void ACI_V_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = V + imm + (PSW & CY); - ZHC_SUB( tmp, V, (PSW & CY) ); - V = tmp; -} - -/* 74 51: 0111 0100 0101 0001 xxxx xxxx */ -static void ACI_A_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = A + imm + (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 74 52: 0111 0100 0101 0010 xxxx xxxx */ -static void ACI_B_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = B + imm + (PSW & CY); - ZHC_SUB( tmp, B, (PSW & CY) ); - B = tmp; -} - -/* 74 53: 0111 0100 0101 0011 xxxx xxxx */ -static void ACI_C_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = C + imm + (PSW & CY); - ZHC_SUB( tmp, C, (PSW & CY) ); - C = tmp; -} - -/* 74 54: 0111 0100 0101 0100 xxxx xxxx */ -static void ACI_D_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = D + imm + (PSW & CY); - ZHC_SUB( tmp, D, (PSW & CY) ); - D = tmp; -} - -/* 74 55: 0111 0100 0101 0101 xxxx xxxx */ -static void ACI_E_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = E + imm + (PSW & CY); - ZHC_SUB( tmp, E, (PSW & CY) ); - E = tmp; -} - -/* 74 56: 0111 0100 0101 0110 xxxx xxxx */ -static void ACI_H_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = H + imm + (PSW & CY); - ZHC_SUB( tmp, H, (PSW & CY) ); - H = tmp; -} - -/* 74 57: 0111 0100 0101 0111 xxxx xxxx */ -static void ACI_L_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = L + imm + (PSW & CY); - ZHC_SUB( tmp, L, (PSW & CY) ); - L = tmp; -} - -/* 74 58: 0111 0100 0101 1000 xxxx xxxx */ -static void OFFI_V_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (V & imm)) - PSW |= SK; -} - -/* 74 59: 0111 0100 0101 1001 xxxx xxxx */ -static void OFFI_A_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (A & imm)) - PSW |= SK; -} - -/* 74 5a: 0111 0100 0101 1010 xxxx xxxx */ -static void OFFI_B_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (B & imm)) - PSW |= SK; -} - -/* 74 5b: 0111 0100 0101 1011 xxxx xxxx */ -static void OFFI_C_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (C & imm)) - PSW |= SK; -} - -/* 74 5c: 0111 0100 0101 1100 xxxx xxxx */ -static void OFFI_D_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (D & imm)) - PSW |= SK; -} - -/* 74 5d: 0111 0100 0101 1101 xxxx xxxx */ -static void OFFI_E_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (E & imm)) - PSW |= SK; -} - -/* 74 5e: 0111 0100 0101 1110 xxxx xxxx */ -static void OFFI_H_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (H & imm)) - PSW |= SK; -} - -/* 74 5f: 0111 0100 0101 1111 xxxx xxxx */ -static void OFFI_L_xx(void) -{ - UINT8 imm; - - RDOPARG( imm ); - if (0 == (L & imm)) - PSW |= SK; -} - -/* 74 60: 0111 0100 0110 0000 xxxx xxxx */ -static void SUI_V_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = V - imm; - ZHC_SUB( tmp, V, 0 ); - V = tmp; -} - -/* 74 61: 0111 0100 0110 0001 xxxx xxxx */ -static void SUI_A_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = A - imm; - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 74 62: 0111 0100 0110 0010 xxxx xxxx */ -static void SUI_B_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = B - imm; - ZHC_SUB( tmp, B, 0 ); - B = tmp; -} - -/* 74 63: 0111 0100 0110 0011 xxxx xxxx */ -static void SUI_C_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = C - imm; - ZHC_SUB( tmp, C, 0 ); - C = tmp; -} - -/* 74 64: 0111 0100 0110 0100 xxxx xxxx */ -static void SUI_D_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = D - imm; - ZHC_SUB( tmp, D, 0 ); - D = tmp; -} - -/* 74 65: 0111 0100 0110 0101 xxxx xxxx */ -static void SUI_E_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = E - imm; - ZHC_SUB( tmp, E, 0 ); - E = tmp; -} - -/* 74 66: 0111 0100 0110 0110 xxxx xxxx */ -static void SUI_H_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = H - imm; - ZHC_SUB( tmp, H, 0 ); - H = tmp; -} - -/* 74 67: 0111 0100 0110 0111 xxxx xxxx */ -static void SUI_L_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = L - imm; - ZHC_SUB( tmp, L, 0 ); - L = tmp; -} - -/* 74 68: 0111 0100 0110 1000 xxxx xxxx */ -static void NEI_V_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = V - imm; - ZHC_SUB( tmp, V, 0 ); - SKIP_NZ; -} - -/* 74 69: 0111 0100 0110 1001 xxxx xxxx */ -static void NEI_A_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = A - imm; - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 74 6a: 0111 0100 0110 1010 xxxx xxxx */ -static void NEI_B_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = B - imm; - ZHC_SUB( tmp, B, 0 ); - SKIP_NZ; -} - -/* 74 6b: 0111 0100 0110 1011 xxxx xxxx */ -static void NEI_C_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = C - imm; - ZHC_SUB( tmp, C, 0 ); - SKIP_NZ; -} - -/* 74 6c: 0111 0100 0110 1100 xxxx xxxx */ -static void NEI_D_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = D - imm; - ZHC_SUB( tmp, D, 0 ); - SKIP_NZ; -} - -/* 74 6d: 0111 0100 0110 1101 xxxx xxxx */ -static void NEI_E_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = E - imm; - ZHC_SUB( tmp, E, 0 ); - SKIP_NZ; -} - -/* 74 6e: 0111 0100 0110 1110 xxxx xxxx */ -static void NEI_H_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = H - imm; - ZHC_SUB( tmp, H, 0 ); - SKIP_NZ; -} - -/* 74 6f: 0111 0100 0110 1111 xxxx xxxx */ -static void NEI_L_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = L - imm; - ZHC_SUB( tmp, L, 0 ); - SKIP_NZ; -} - -/* 74 70: 0111 0100 0111 0000 xxxx xxxx */ -static void SBI_V_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = V - imm - (PSW & CY); - ZHC_SUB( tmp, V, (PSW & CY) ); - V = tmp; -} - -/* 74 71: 0111 0100 0111 0001 xxxx xxxx */ -static void SBI_A_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = A - imm - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 74 72: 0111 0100 0111 0010 xxxx xxxx */ -static void SBI_B_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = B - imm - (PSW & CY); - ZHC_SUB( tmp, B, (PSW & CY) ); - B = tmp; -} - -/* 74 73: 0111 0100 0111 0011 xxxx xxxx */ -static void SBI_C_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = C - imm - (PSW & CY); - ZHC_SUB( tmp, C, (PSW & CY) ); - C = tmp; -} - -/* 74 74: 0111 0100 0111 0100 xxxx xxxx */ -static void SBI_D_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = D - imm - (PSW & CY); - ZHC_SUB( tmp, D, (PSW & CY) ); - D = tmp; -} - -/* 74 75: 0111 0100 0111 0101 xxxx xxxx */ -static void SBI_E_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = E - imm - (PSW & CY); - ZHC_SUB( tmp, E, (PSW & CY) ); - E = tmp; -} - -/* 74 76: 0111 0100 0111 0110 xxxx xxxx */ -static void SBI_H_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = H - imm - (PSW & CY); - ZHC_SUB( tmp, H, (PSW & CY) ); - H = tmp; -} - -/* 74 77: 0111 0100 0111 0111 xxxx xxxx */ -static void SBI_L_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = L - imm - (PSW & CY); - ZHC_SUB( tmp, L, (PSW & CY) ); - L = tmp; -} - -/* 74 78: 0111 0100 0111 1000 xxxx xxxx */ -static void EQI_V_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = V - imm; - ZHC_SUB( tmp, V, 0 ); - SKIP_Z; -} - -/* 74 79: 0111 0100 0111 1001 xxxx xxxx */ -static void EQI_A_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = A - imm; - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 74 7a: 0111 0100 0111 1010 xxxx xxxx */ -static void EQI_B_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = B - imm; - ZHC_SUB( tmp, B, 0 ); - SKIP_Z; -} - -/* 74 7b: 0111 0100 0111 1011 xxxx xxxx */ -static void EQI_C_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = C - imm; - ZHC_SUB( tmp, C, 0 ); - SKIP_Z; -} - -/* 74 7c: 0111 0100 0111 1100 xxxx xxxx */ -static void EQI_D_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = D - imm; - ZHC_SUB( tmp, D, 0 ); - SKIP_Z; -} - -/* 74 7d: 0111 0100 0111 1101 xxxx xxxx */ -static void EQI_E_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = E - imm; - ZHC_SUB( tmp, E, 0 ); - SKIP_Z; -} - -/* 74 7e: 0111 0100 0111 1110 xxxx xxxx */ -static void EQI_H_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = H - imm; - ZHC_SUB( tmp, H, 0 ); - SKIP_Z; -} - -/* 74 7f: 0111 0100 0111 1111 xxxx xxxx */ -static void EQI_L_xx(void) -{ - UINT8 tmp, imm; - - RDOPARG( imm ); - tmp = L - imm; - ZHC_SUB( tmp, L, 0 ); - SKIP_Z; -} - -/* 74 88: 0111 0100 1000 1000 oooo oooo */ -static void ANAW_wa(void) -{ - PAIR ea = upd7810.va; - RDOPARG( ea.b.l ); - - A &= RM( ea.d ); - SET_Z(A); -} - -/* 74 8d: 0111 0100 1000 1101 */ -static void DAN_EA_BC(void) -{ - EA &= BC; - SET_Z(EA); -} - -/* 74 8e: 0111 0100 1000 1110 */ -static void DAN_EA_DE(void) -{ - EA &= DE; - SET_Z(EA); -} - -/* 74 8f: 0111 0100 1000 1111 */ -static void DAN_EA_HL(void) -{ - EA &= HL; - SET_Z(EA); -} - -/* 74 90: 0111 0100 1001 0000 oooo oooo */ -static void XRAW_wa(void) -{ - PAIR ea = upd7810.va; - RDOPARG( ea.b.l ); - - A ^= RM( ea.d ); - SET_Z(A); -} - -/* 74 95: 0111 0100 1001 0101 */ -static void DXR_EA_BC(void) -{ - EA ^= BC; - SET_Z(EA); -} - -/* 74 96: 0111 0100 1001 0110 */ -static void DXR_EA_DE(void) -{ - EA ^= DE; - SET_Z(EA); -} - -/* 74 97: 0111 0100 1001 0111 */ -static void DXR_EA_HL(void) -{ - EA ^= HL; - SET_Z(EA); -} - -/* 74 98: 0111 0100 1001 1000 oooo oooo */ -static void ORAW_wa(void) -{ - PAIR ea = upd7810.va; - RDOPARG( ea.b.l ); - - A |= RM( ea.d ); - SET_Z(A); -} - -/* 74 9d: 0111 0100 1001 1101 */ -static void DOR_EA_BC(void) -{ - EA |= BC; - SET_Z(EA); -} - -/* 74 9e: 0111 0100 1001 1110 */ -static void DOR_EA_DE(void) -{ - EA |= DE; - SET_Z(EA); -} - -/* 74 9f: 0111 0100 1001 1111 */ -static void DOR_EA_HL(void) -{ - EA |= HL; - SET_Z(EA); -} - -/* 74 a0: 0111 0100 1010 0000 oooo oooo */ -static void ADDNCW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp; - - RDOPARG( ea.b.l ); - - tmp = A + RM( ea.d ); - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 74 a5: 0111 0100 1010 0101 */ -static void DADDNC_EA_BC(void) -{ - UINT16 tmp = EA + BC; - - ZHC_ADD( tmp, EA, 0 ); - EA = tmp; - SKIP_NC; -} - -/* 74 a6: 0111 0100 1010 0110 */ -static void DADDNC_EA_DE(void) -{ - UINT16 tmp = EA + DE; - - ZHC_ADD( tmp, EA, 0 ); - EA = tmp; - SKIP_NC; -} - -/* 74 a7: 0111 0100 1010 0111 */ -static void DADDNC_EA_HL(void) -{ - UINT16 tmp = EA + HL; - - ZHC_ADD( tmp, EA, 0 ); - EA = tmp; - SKIP_NC; -} - -/* 74 a8: 0111 0100 1010 1000 oooo oooo */ -static void GTAW_wa(void) -{ - PAIR ea = upd7810.va; - UINT16 tmp; - - RDOPARG( ea.b.l ); - tmp = A - RM( ea.d ) - 1; - ZHC_SUB( tmp, A, 0 ); - SKIP_NC; -} - -/* 74 ad: 0111 0100 1010 1101 */ -static void DGT_EA_BC(void) -{ - INT32 tmp = EA - BC - 1; // iq_132 - ZHC_SUB( tmp, EA, 0 ); - SKIP_NC; -} - -/* 74 ae: 0111 0100 1010 1110 */ -static void DGT_EA_DE(void) -{ - INT32 tmp = EA - DE - 1; // iq_132 - ZHC_SUB( tmp, EA, 0 ); - SKIP_NC; -} - -/* 74 af: 0111 0100 1010 1111 */ -static void DGT_EA_HL(void) -{ - INT32 tmp = EA - HL - 1; // iq_132 - ZHC_SUB( tmp, EA, 0 ); - SKIP_NC; -} - -/* 74 b0: 0111 0100 1011 0000 oooo oooo */ -static void SUBNBW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp; - - RDOPARG( ea.b.l ); - tmp = A - RM( ea.d ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_NC; -} - -/* 74 b5: 0111 0100 1011 0101 */ -static void DSUBNB_EA_BC(void) -{ - UINT16 tmp = EA - BC; - ZHC_SUB( tmp, EA, 0 ); - EA = tmp; - SKIP_NC; -} - -/* 74 b6: 0111 0100 1011 0110 */ -static void DSUBNB_EA_DE(void) -{ - UINT16 tmp = EA - DE; - ZHC_SUB( tmp, EA, 0 ); - EA = tmp; - SKIP_NC; -} - -/* 74 b7: 0111 0100 1011 0111 */ -static void DSUBNB_EA_HL(void) -{ - UINT16 tmp; - - tmp = EA - HL; - ZHC_SUB( tmp, EA, 0 ); - EA = tmp; - SKIP_NC; -} - -/* 74 b8: 0111 0100 1011 1000 oooo oooo */ -static void LTAW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp; - - RDOPARG( ea.b.l ); - tmp = A - RM( ea.d ); - ZHC_SUB( tmp, A, 0 ); - SKIP_CY; -} - -/* 74 bd: 0111 0100 1011 1101 */ -static void DLT_EA_BC(void) -{ - UINT16 tmp = EA - BC; - ZHC_SUB( tmp, EA, 0 ); - SKIP_CY; -} - -/* 74 be: 0111 0100 1011 1110 */ -static void DLT_EA_DE(void) -{ - UINT16 tmp = EA - DE; - ZHC_SUB( tmp, EA, 0 ); - SKIP_CY; -} - -/* 74 bf: 0111 0100 1011 1111 */ -static void DLT_EA_HL(void) -{ - UINT16 tmp = EA - HL; - ZHC_SUB( tmp, EA, 0 ); - SKIP_CY; -} - -/* 74 c0: 0111 0100 1100 0000 oooo oooo */ -static void ADDW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp; - RDOPARG( ea.b.l ); - tmp = A + RM( ea.d ); - ZHC_ADD( tmp, A, 0 ); - A = tmp; -} - -/* 74 c5: 0111 0100 1100 0101 */ -static void DADD_EA_BC(void) -{ - UINT16 tmp = EA + BC; - ZHC_ADD( tmp, EA, 0 ); - EA = tmp; -} - -/* 74 c6: 0111 0100 1100 0110 */ -static void DADD_EA_DE(void) -{ - UINT16 tmp = EA + DE; - ZHC_ADD( tmp, EA, 0 ); - EA = tmp; -} - -/* 74 c7: 0111 0100 1100 0111 */ -static void DADD_EA_HL(void) -{ - UINT16 tmp = EA + HL; - ZHC_ADD( tmp, EA, 0 ); - EA = tmp; -} - -/* 74 c8: 0111 0100 1100 1000 oooo oooo */ -static void ONAW_wa(void) -{ - PAIR ea = upd7810.va; - RDOPARG( ea.b.l ); - - if (A & RM( ea.d )) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 74 cd: 0111 0100 1100 1101 */ -static void DON_EA_BC(void) -{ - if (EA & BC) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 74 ce: 0111 0100 1100 1110 */ -static void DON_EA_DE(void) -{ - if (EA & DE) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 74 cf: 0111 0100 1100 1111 */ -static void DON_EA_HL(void) -{ - if (EA & HL) - PSW = (PSW & ~Z) | SK; - else - PSW |= Z; -} - -/* 74 d0: 0111 0100 1101 0000 oooo oooo */ -static void ADCW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp; - - RDOPARG( ea.b.l ); - tmp = A + RM( ea.d ) + (PSW & CY); - ZHC_ADD( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 74 d5: 0111 0100 1101 0101 */ -static void DADC_EA_BC(void) -{ - UINT16 tmp = EA + BC + (PSW & CY); - ZHC_ADD( tmp, EA, (PSW & CY) ); - EA = tmp; -} - -/* 74 d6: 0111 0100 1101 0110 */ -static void DADC_EA_DE(void) -{ - UINT16 tmp = EA + DE + (PSW & CY); - ZHC_ADD( tmp, EA, (PSW & CY) ); - EA = tmp; -} - -/* 74 d7: 0111 0100 1101 0111 */ -static void DADC_EA_HL(void) -{ - UINT16 tmp = EA + HL + (PSW & CY); - ZHC_ADD( tmp, EA, (PSW & CY) ); - EA = tmp; -} - -/* 74 d8: 0111 0100 1101 1000 oooo oooo */ -static void OFFAW_wa(void) -{ - PAIR ea = upd7810.va; - RDOPARG( ea.b.l ); - - if ( A & RM( ea.d ) ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 74 dd: 0111 0100 1101 1101 */ -static void DOFF_EA_BC(void) -{ - if ( EA & BC ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 74 de: 0111 0100 1101 1110 */ -static void DOFF_EA_DE(void) -{ - if ( EA & DE ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 74 df: 0111 0100 1101 1111 */ -static void DOFF_EA_HL(void) -{ - if ( EA & HL ) - PSW &= ~Z; - else - PSW = PSW | Z | SK; -} - -/* 74 e0: 0111 0100 1110 0000 oooo oooo */ -static void SUBW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp; - - RDOPARG( ea.b.l ); - tmp = A - RM( ea.d ); - ZHC_SUB( tmp, A, 0 ); - A = tmp; -} - -/* 74 e5: 0111 0100 1110 0101 */ -static void DSUB_EA_BC(void) -{ - UINT16 tmp = EA - BC; - ZHC_SUB( tmp, EA, 0 ); - EA = tmp; -} - -/* 74 e6: 0111 0100 1110 0110 */ -static void DSUB_EA_DE(void) -{ - UINT16 tmp = EA - DE; - ZHC_SUB( tmp, EA, 0 ); - EA = tmp; -} - -/* 74 e7: 0111 0100 1110 0111 */ -static void DSUB_EA_HL(void) -{ - UINT16 tmp = EA - HL; - ZHC_SUB( tmp, EA, 0 ); - EA = tmp; -} - -/* 74 e8: 0111 0100 1110 1000 oooo oooo */ -static void NEAW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp; - - RDOPARG( ea.b.l ); - tmp = A - RM( ea.d ); - ZHC_SUB( tmp, A, 0 ); - SKIP_NZ; -} - -/* 74 ed: 0111 0100 1110 1101 */ -static void DNE_EA_BC(void) -{ - UINT16 tmp; - - tmp = EA - BC; - ZHC_SUB( tmp, EA, 0 ); - SKIP_NZ; -} - -/* 74 ee: 0111 0100 1110 1110 */ -static void DNE_EA_DE(void) -{ - UINT16 tmp; - - tmp = EA - DE; - ZHC_SUB( tmp, EA, 0 ); - SKIP_NZ; -} - -/* 74 ef: 0111 0100 1110 1111 */ -static void DNE_EA_HL(void) -{ - UINT16 tmp; - - tmp = EA - HL; - ZHC_SUB( tmp, EA, 0 ); - SKIP_NZ; -} - -/* 74 f0: 0111 0100 1111 0000 oooo oooo */ -static void SBBW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp; - - RDOPARG( ea.b.l ); - tmp = A - RM( ea.d ) - (PSW & CY); - ZHC_SUB( tmp, A, (PSW & CY) ); - A = tmp; -} - -/* 74 f5: 0111 0100 1111 0101 */ -static void DSBB_EA_BC(void) -{ - UINT16 tmp = EA - BC - (PSW & CY); - ZHC_SUB( tmp, EA, (PSW & CY) ); - EA = tmp; -} - -/* 74 f6: 0111 0100 1111 0110 */ -static void DSBB_EA_DE(void) -{ - UINT16 tmp = EA - DE - (PSW & CY); - ZHC_SUB( tmp, EA, (PSW & CY) ); - EA = tmp; -} - -/* 74 f7: 0111 0100 1111 0111 */ -static void DSBB_EA_HL(void) -{ - UINT16 tmp = EA - HL - (PSW & CY); - ZHC_SUB( tmp, EA, (PSW & CY) ); - EA = tmp; -} - -/* 74 f8: 0111 0100 1111 1000 oooo oooo */ -static void EQAW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp; - - RDOPARG( ea.b.l ); - tmp = A - RM( ea.d ); - ZHC_SUB( tmp, A, 0 ); - SKIP_Z; -} - -/* 74 fd: 0111 0100 1111 1101 */ -static void DEQ_EA_BC(void) -{ - UINT16 tmp; - - tmp = EA - BC; - ZHC_SUB( tmp, EA, 0 ); - SKIP_Z; -} - -/* 74 fe: 0111 0100 1111 1110 */ -static void DEQ_EA_DE(void) -{ - UINT16 tmp; - - tmp = EA - DE; - ZHC_SUB( tmp, EA, 0 ); - SKIP_Z; -} - -/* 74 ff: 0111 0100 1111 1111 */ -static void DEQ_EA_HL(void) -{ - UINT16 tmp; - - tmp = EA - HL; - ZHC_SUB( tmp, EA, 0 ); - SKIP_Z; -} - -/************************************************ - * main opcodes - ************************************************/ - -/* 00: 0000 0000 */ -static void NOP(void) -{ -} - -/* 01: 0000 0001 oooo oooo */ -static void LDAW_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - A = RM( ea.d ); -} - -/* 02: 0000 0010 */ -static void INX_SP(void) -{ - SP++; -} - -/* 03: 0000 0011 */ -static void DCX_SP(void) -{ - SP--; -} - -/* 04: 0000 0100 llll llll hhhh hhhh */ -static void LXI_S_w(void) -{ - RDOPARG( SPL ); - RDOPARG( SPH ); -} - -/* 05: 0000 0101 oooo oooo xxxx xxxx */ -static void ANIW_wa_xx(void) -{ - PAIR ea = upd7810.va; - UINT8 m, imm; - - RDOPARG( ea.b.l ); - RDOPARG( imm ); - m = RM( ea.d ); - m &= imm; - WM( ea.d, m ); - SET_Z(m); -} - -/* 07: 0000 0111 xxxx xxxx */ -/* ANI_A_xx already defined (long form) */ - -/* 08: 0000 1000 */ -static void MOV_A_EAH(void) -{ - A = EAH; -} - -/* 09: 0000 1001 */ -static void MOV_A_EAL(void) -{ - A = EAL; -} - -/* 0a: 0000 1010 */ -static void MOV_A_B(void) -{ - A = B; -} - -/* 0b: 0000 1011 */ -static void MOV_A_C(void) -{ - A = C; -} - -/* 0c: 0000 1100 */ -static void MOV_A_D(void) -{ - A = D; -} - -/* 0d: 0000 1101 */ -static void MOV_A_E(void) -{ - A = E; -} - -/* 0e: 0000 1110 */ -static void MOV_A_H(void) -{ - A = H; -} - -/* 0f: 0000 1111 */ -static void MOV_A_L(void) -{ - A = L; -} - -/* 10: 0001 0000 */ -static void EXA(void) -{ - UINT16 tmp; - tmp = EA; EA = EA2; EA2 = tmp; - tmp = VA; VA = VA2; VA2 = tmp; -} - -/* 11: 0001 0001 */ -static void EXX(void) -{ - UINT16 tmp; - tmp = BC; BC = BC2; BC2 = tmp; - tmp = DE; DE = DE2; DE2 = tmp; - tmp = HL; HL = HL2; HL2 = tmp; -} - -/* 48 AD (7807 only) */ -static void EXR(void) -{ - UINT16 tmp; - tmp = BC; BC = BC2; BC2 = tmp; - tmp = DE; DE = DE2; DE2 = tmp; - tmp = HL; HL = HL2; HL2 = tmp; - tmp = EA; EA = EA2; EA2 = tmp; - tmp = VA; VA = VA2; VA2 = tmp; -} - -/* 12: 0001 0010 */ -static void INX_BC(void) -{ - BC++; -} - -/* 13: 0001 0011 */ -static void DCX_BC(void) -{ - BC--; -} - -/* 14: 0001 0100 llll llll hhhh hhhh */ -static void LXI_B_w(void) -{ - RDOPARG( C ); - RDOPARG( B ); -} - -/* 15: 0001 0101 oooo oooo xxxx xxxx */ -static void ORIW_wa_xx(void) -{ - PAIR ea = upd7810.va; - UINT8 m, imm; - - RDOPARG( ea.b.l ); - RDOPARG( imm ); - m = RM( ea.d ); - m |= imm; - WM( ea.d, m ); - SET_Z(m); -} - -/* 16: 0001 0110 xxxx xxxx */ -/* XRI_A_xx already defined (long form) */ - -/* 17: 0001 0111 xxxx xxxx */ -/* ORI_A_xx already defined (long form) */ - -/* 18: 0001 1000 */ -static void MOV_EAH_A(void) -{ - EAH = A; -} - -/* 19: 0001 1001 */ -static void MOV_EAL_A(void) -{ - EAL = A; -} - -/* 1a: 0001 1010 */ -static void MOV_B_A(void) -{ - B = A; -} - -/* 1b: 0001 1011 */ -static void MOV_C_A(void) -{ - C = A; -} - -/* 1c: 0001 1100 */ -static void MOV_D_A(void) -{ - D = A; -} - -/* 1d: 0001 1101 */ -static void MOV_E_A(void) -{ - E = A; -} - -/* 1e: 0001 1110 */ -static void MOV_H_A(void) -{ - H = A; -} - -/* 1f: 0001 1111 */ -static void MOV_L_A(void) -{ - L = A; -} - -/* 20: 0010 0000 oooo oooo */ -static void INRW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp, m; - - RDOPARG( ea.b.l ); - m = RM( ea.d ); - tmp = m + 1; - ZHC_ADD( tmp, m, 0 ); - WM( ea.d, tmp ); - SKIP_CY; -} - -/* 21: 0010 0001 */ -static void JB(void) -{ - PC = BC; - change_pc( PCD ); -} - -/* 22: 0010 0010 */ -static void INX_DE(void) -{ - DE++; -} - -/* 23: 0010 0011 */ -static void DCX_DE(void) -{ - DE--; -} - -/* 24: 0010 0100 llll llll hhhh hhhh */ -static void LXI_D_w(void) -{ - RDOPARG( E ); - RDOPARG( D ); -} - -/* 25: 0010 0101 oooo oooo xxxx xxxx */ -static void GTIW_wa_xx(void) -{ - PAIR ea = upd7810.va; - UINT8 m, imm; - UINT16 tmp; - - RDOPARG( ea.b.l ); - RDOPARG( imm ); - m = RM( ea.d ); - tmp = m - imm - 1; - ZHC_SUB( tmp, m, 0 ); - SKIP_NC; -} - -/* 26: 0010 0110 xxxx xxxx */ -/* ADINC_A_xx already defined (long form) */ - -/* 27: 0010 0111 xxxx xxxx */ -/* GTI_A_xx already defined (long form) */ - -/* 29: 0010 1001 */ -static void LDAX_B(void) -{ - A = RM( BC ); -} - -/* 2a: 0010 1010 */ -static void LDAX_D(void) -{ - A = RM( DE ); -} - -/* 2b: 0010 1011 */ -static void LDAX_H(void) -{ - A = RM( HL ); -} - -/* 2c: 0010 1100 */ -static void LDAX_Dp(void) -{ - A = RM( DE ); - DE++; -} - -/* 2d: 0010 1101 dddd dddd */ -static void LDAX_Hp(void) -{ - A = RM( HL ); - HL++; -} - -/* 2e: 0010 1110 dddd dddd */ -static void LDAX_Dm(void) -{ - A = RM( DE ); - DE--; -} - -/* 2f: 0010 1111 dddd dddd */ -static void LDAX_Hm(void) -{ - A = RM( HL ); - HL--; -} - -/* 30: 0011 0000 oooo oooo */ -static void DCRW_wa(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp, m; - - RDOPARG( ea.b.l ); - m = RM( ea.d ); - tmp = m - 1; - ZHC_SUB( tmp, m, 0 ); - WM( ea.d, tmp ); - SKIP_CY; -} - -/* 31: 0011 0001 */ -static void BLOCK(void) -{ - WM( DE, RM( HL ) ); - DE++; - HL++; - C--; - if (C == 0xff) - PSW |= CY; - else - { - PSW &= ~CY; - PC--; - } -} - -/* 32: 0011 0010 */ -static void INX_HL(void) -{ - HL++; -} - -/* 33: 0011 0011 */ -static void DCX_HL(void) -{ - HL--; -} - -/* 34: 0011 0100 llll llll hhhh hhhh */ -static void LXI_H_w(void) -{ - if (PSW & L0) { /* overlay active? */ - PC+=2; - return; - } - RDOPARG( L ); - RDOPARG( H ); - PSW |= L0; -} - -/* 35: 0011 0101 oooo oooo xxxx xxxx */ -static void LTIW_wa_xx(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp, m, imm; - - RDOPARG( ea.b.l ); - RDOPARG( imm ); - m = RM( ea.d ); - tmp = m - imm; - ZHC_SUB( tmp, m, 0 ); - SKIP_CY; -} - -/* 36: 0011 0110 xxxx xxxx */ -/* SUINB_A_xx already defined (long form) */ - -/* 37: 0011 0111 xxxx xxxx */ -/* LTI_A_xx already defined (long form) */ - -/* 39: 0011 1001 */ -static void STAX_B(void) -{ - WM( BC, A ); -} - -/* 3a: 0011 1010 */ -static void STAX_D(void) -{ - WM( DE, A ); -} - -/* 3b: 0011 1011 */ -static void STAX_H(void) -{ - WM( HL, A ); -} - -/* 3c: 0011 1100 */ -static void STAX_Dp(void) -{ - WM( DE, A ); - DE++; -} - -/* 3d: 0011 1101 */ -static void STAX_Hp(void) -{ - WM( HL, A ); - HL++; -} - -/* 3e: 0011 1110 */ -static void STAX_Dm(void) -{ - WM( DE, A ); - DE--; -} - -/* 3f: 0011 1111 */ -static void STAX_Hm(void) -{ - WM( HL, A ); - HL--; -} - -/* 40: 0100 0000 llll llll hhhh hhhh */ -static void CALL_w(void) -{ - PAIR w; - w.d = 0; - - RDOPARG( w.b.l ); - RDOPARG( w.b.h ); - - SP--; - WM( SPD, PCH ); - SP--; - WM( SPD, PCL ); - - PC = w.w.l; - change_pc( PCD ); -} - -/* 41: 0100 0001 */ -static void INR_A(void) -{ - UINT8 tmp = A + 1; - ZHC_ADD( tmp, A, 0 ); - A = tmp; - SKIP_CY; -} - -/* 42: 0100 0010 */ -static void INR_B(void) -{ - UINT8 tmp = B + 1; - ZHC_ADD( tmp, B, 0 ); - B = tmp; - SKIP_CY; -} - -/* 43: 0100 0011 */ -static void INR_C(void) -{ - UINT8 tmp = C + 1; - ZHC_ADD( tmp, C, 0 ); - C = tmp; - SKIP_CY; -} - -/* 44: 0100 0100 llll llll hhhh hhhh */ -static void LXI_EA_s(void) -{ - RDOPARG( EAL ); - RDOPARG( EAH ); -} - -/* 45: 0100 0101 oooo oooo xxxx xxxx */ -static void ONIW_wa_xx(void) -{ - PAIR ea = upd7810.va; - UINT8 imm; - - RDOPARG( ea.b.l ); - RDOPARG( imm ); - - if (RM( ea.d ) & imm) - PSW |= SK; -} - -/* 46: 0100 0110 xxxx xxxx */ -/* ADI_A_xx already defined (long form) */ - -/* 47: 0100 0111 xxxx xxxx */ -/* ONI_A_xx already defined (long form) */ - -/* 48: prefix */ -static void PRE_48(void) -{ - RDOP(OP2); - upd7810_icount -= op48[OP2].cycles; - upd7810_timers(op48[OP2].cycles); - (*op48[OP2].opfunc)(); -} - -/* 49: 0100 1001 xxxx xxxx */ -static void MVIX_BC_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - WM( BC, imm ); -} - -/* 4a: 0100 1010 xxxx xxxx */ -static void MVIX_DE_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - WM( DE, imm ); -} - -/* 4b: 0100 1011 xxxx xxxx */ -static void MVIX_HL_xx(void) -{ - UINT8 imm; - RDOPARG( imm ); - WM( HL, imm ); -} - -/* 4c: prefix */ -static void PRE_4C(void) -{ - RDOP(OP2); - upd7810_icount -= op4C[OP2].cycles; - upd7810_timers(op4C[OP2].cycles); - (*op4C[OP2].opfunc)(); -} - -/* 4d: prefix */ -static void PRE_4D(void) -{ - RDOP(OP2); - upd7810_icount -= op4D[OP2].cycles; - upd7810_timers(op4D[OP2].cycles); - (*op4D[OP2].opfunc)(); -} - -/* 4e: 0100 111d dddd dddd */ -static void JRE(void) -{ - UINT8 offs; - RDOPARG( offs ); - if (OP & 0x01) - PC -= 256 - offs; - else - PC += offs; - change_pc( PCD ); -} - -/* 50: 0101 0000 */ -static void EXH(void) -{ - UINT16 tmp; - tmp = HL; HL = HL2; HL2 = tmp; -} - -/* 51: 0101 0001 */ -static void DCR_A(void) -{ - UINT8 tmp = A - 1; - ZHC_SUB( tmp, A, 0 ); - A = tmp; - SKIP_CY; -} - -/* 52: 0101 0010 */ -static void DCR_B(void) -{ - UINT8 tmp = B - 1; - ZHC_SUB( tmp, B, 0 ); - B = tmp; - SKIP_CY; -} - -/* 53: 0101 0011 */ -static void DCR_C(void) -{ - UINT8 tmp = C - 1; - ZHC_SUB( tmp, C, 0 ); - C = tmp; - SKIP_CY; -} - -/* 54: 0101 0100 llll llll hhhh hhhh */ -static void JMP_w(void) -{ - PAIR w; - w.d = 0; - - RDOPARG( w.b.l ); - RDOPARG( w.b.h ); - - PCD = w.d; - change_pc( PCD ); -} - -/* 55: 0101 0101 oooo oooo xxxx xxxx */ -static void OFFIW_wa_xx(void) -{ - PAIR ea = upd7810.va; - UINT8 imm; - - RDOPARG( ea.b.l ); - RDOPARG( imm ); - - if (0 == (RM( ea.d ) & imm)) - PSW |= SK; -} - -/* 56: 0101 0110 xxxx xxxx */ -/* ACI_A_xx already defined (long form) */ - -/* 57: 0101 0111 xxxx xxxx */ -/* OFFI_A_xx already defined (long form) */ - -/* 58: 0101 1000 oooo oooo (7810 only) */ -static void BIT_0_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - if (RM( ea.d ) & 0x01) - PSW |= SK; -} - -/* 59: 0101 1001 oooo oooo (7810 only) */ -static void BIT_1_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - if (RM( ea.d ) & 0x02) - PSW |= SK; -} - -/* 5a: 0101 1010 oooo oooo (7810 only) */ -static void BIT_2_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - if (RM( ea.d ) & 0x04) - PSW |= SK; -} - -/* 5b: 0101 1011 oooo oooo (7810 only) */ -static void BIT_3_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - if (RM( ea.d ) & 0x08) - PSW |= SK; -} - -/* 5c: 0101 1100 oooo oooo (7810 only) */ -static void BIT_4_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - if (RM( ea.d ) & 0x10) - PSW |= SK; -} - -/* 5d: 0101 1101 oooo oooo (7810 only) */ -static void BIT_5_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - if (RM( ea.d ) & 0x20) - PSW |= SK; -} - -/* 5e: 0101 1110 oooo oooo (7810 only) */ -static void BIT_6_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - if (RM( ea.d ) & 0x40) - PSW |= SK; -} - -/* 5f: 0101 1111 oooo oooo (7810 only) */ -static void BIT_7_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - if (RM( ea.d ) & 0x80) - PSW |= SK; -} - -/* 5d: 0101 1111 bbbb bbbb (7807 only) */ -static void SKN_bit(void) -{ - UINT8 imm; - int val; - - RDOPARG( imm ); - - switch( imm & 0x1f ) - { - case 0x10: /* PA */ - val = RP( UPD7810_PORTA ); - break; - case 0x11: /* PB */ - val = RP( UPD7810_PORTB ); - break; - case 0x12: /* PC */ - val = RP( UPD7810_PORTC ); - break; - case 0x13: /* PD */ - val = RP( UPD7810_PORTD ); - break; - case 0x15: /* PF */ - val = RP( UPD7810_PORTF ); - break; - case 0x16: /* MKH */ - val = MKH; - break; - case 0x17: /* MKL */ - val = MKL; - break; - case 0x19: /* SMH */ - val = SMH; - break; - case 0x1b: /* EOM */ - val = EOM; - break; - case 0x1d: /* TMM */ - val = TMM; - break; - case 0x1e: /* PT */ - val = RP( UPD7807_PORTT ); - break; - default: - // logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, imm, PC); - val = 0; - break; - } - - if (~val & (1 << (imm >> 5))) - PSW |= SK; -} - -/* 58: 0101 1000 bbbb bbbb (7807 only) */ -static void SETB(void) -{ - UINT8 imm; - int bit; - - RDOPARG( imm ); - bit = imm >> 5; - - switch( imm & 0x1f ) - { - case 0x10: /* PA */ - WP( UPD7810_PORTA, RP( UPD7810_PORTA ) | (1 << bit)); - break; - case 0x11: /* PB */ - WP( UPD7810_PORTB, RP( UPD7810_PORTB ) | (1 << bit)); - break; - case 0x12: /* PC */ - WP( UPD7810_PORTC, RP( UPD7810_PORTC ) | (1 << bit)); - break; - case 0x13: /* PD */ - WP( UPD7810_PORTD, RP( UPD7810_PORTD ) | (1 << bit)); - break; - case 0x15: /* PF */ - WP( UPD7810_PORTF, RP( UPD7810_PORTF ) | (1 << bit)); - break; - case 0x16: /* MKH */ - MKH |= (1 << bit); - break; - case 0x17: /* MKL */ - MKL |= (1 << bit); - break; - case 0x19: /* SMH */ - SMH |= (1 << bit); - break; - case 0x1b: /* EOM */ - EOM |= (1 << bit); - break; - case 0x1d: /* TMM */ - TMM |= (1 << bit); - break; -// case 0x1e: /* PT */ -// PT is input only -// break; - default: - // logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, imm, PC); - break; - } -} - -/* 5b: 0101 1011 bbbb bbbb (7807 only) */ -static void CLR(void) -{ - UINT8 imm; - int bit; - - RDOPARG( imm ); - bit = imm >> 5; - - switch( imm & 0x1f ) - { - case 0x10: /* PA */ - WP( UPD7810_PORTA, RP( UPD7810_PORTA ) & ~(1 << bit)); - break; - case 0x11: /* PB */ - WP( UPD7810_PORTB, RP( UPD7810_PORTB ) & ~(1 << bit)); - break; - case 0x12: /* PC */ - WP( UPD7810_PORTC, RP( UPD7810_PORTC ) & ~(1 << bit)); - break; - case 0x13: /* PD */ - WP( UPD7810_PORTD, RP( UPD7810_PORTD ) & ~(1 << bit)); - break; - case 0x15: /* PF */ - WP( UPD7810_PORTF, RP( UPD7810_PORTF ) & ~(1 << bit)); - break; - case 0x16: /* MKH */ - MKH &= ~(1 << bit); - break; - case 0x17: /* MKL */ - MKL &= ~(1 << bit); - break; - case 0x19: /* SMH */ - SMH &= ~(1 << bit); - break; - case 0x1b: /* EOM */ - EOM &= ~(1 << bit); - break; - case 0x1d: /* TMM */ - TMM &= ~(1 << bit); - break; -// case 0x1e: /* PT */ -// PT is input only -// break; - default: - // logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, imm, PC); - break; - } -} - -/* 5d: 0101 1111 bbbb bbbb (7807 only) */ -static void SK_bit(void) -{ - UINT8 imm; - int val; - - RDOPARG( imm ); - - switch( imm & 0x1f ) - { - case 0x10: /* PA */ - val = RP( UPD7810_PORTA ); - break; - case 0x11: /* PB */ - val = RP( UPD7810_PORTB ); - break; - case 0x12: /* PC */ - val = RP( UPD7810_PORTC ); - break; - case 0x13: /* PD */ - val = RP( UPD7810_PORTD ); - break; - case 0x15: /* PF */ - val = RP( UPD7810_PORTF ); - break; - case 0x16: /* MKH */ - val = MKH; - break; - case 0x17: /* MKL */ - val = MKL; - break; - case 0x19: /* SMH */ - val = SMH; - break; - case 0x1b: /* EOM */ - val = EOM; - break; - case 0x1d: /* TMM */ - val = TMM; - break; - case 0x1e: /* PT */ - val = RP( UPD7807_PORTT ); - break; - default: - // logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, imm, PC); - val = 0; - break; - } - - if (val & (1 << (imm >> 5))) - PSW |= SK; -} - -/* 60:*/ -static void PRE_60(void) -{ - RDOP(OP2); - upd7810_icount -= op60[OP2].cycles; - upd7810_timers(op60[OP2].cycles); - (*op60[OP2].opfunc)(); -} - -/* 61: 0110 0001 */ -static void DAA(void) -{ - UINT8 l = A & 0x0f, h = A >> 4, tmp, adj = 0x00; - if (0 == (PSW & HC)) - { - if (l < 10) - { - if (!(h < 10 && 0 == (PSW & CY))) - adj = 0x60; - } - else - { - if (h < 9 && 0 == (PSW & CY)) - adj = 0x06; - else - adj = 0x66; - } - } - else - if (l < 3) - { - if (h < 10 && 0 == (PSW & CY)) - adj = 0x06; - else - adj = 0x66; - } - tmp = A + adj; - ZHC_ADD( tmp, A, PSW & CY ); - A = tmp; -} - -/* 62: 0110 0010 */ -static void RETI(void) -{ - PCL = RM( SPD ); - SP++; - PCH = RM( SPD ); - SP++; - PSW = RM( SPD ); - SP++; - change_pc( PCD ); -} - -/* 63: 0110 0011 oooo oooo */ -static void STAW_wa(void) -{ - PAIR ea = upd7810.va; - - RDOPARG( ea.b.l ); - - WM( ea.d, A ); -} - -/* 64: prefix */ -static void PRE_64(void) -{ - RDOP(OP2); - upd7810_icount -= op64[OP2].cycles; - upd7810_timers(op64[OP2].cycles); - (*op64[OP2].opfunc)(); -} - -/* 65: 0110 0101 oooo oooo xxxx xxxx */ -static void NEIW_wa_xx(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp, m, imm; - - RDOPARG( ea.b.l ); - RDOPARG( imm ); - m = RM( ea.d ); - tmp = m - imm; - ZHC_SUB( tmp, m, 0 ); - SKIP_NZ; -} - -/* 66: 0110 0110 xxxx xxxx */ -/* SUI_A_xx already defined (long form) */ - -/* 67: 0110 0111 xxxx xxxx */ -/* NEI_A_xx already defined (long form) */ - -/* 68: 0110 1000 xxxx xxxx */ -static void MVI_V_xx(void) -{ - RDOPARG( V ); -} - -/* 69: 0110 1001 xxxx xxxx */ -static void MVI_A_xx(void) -{ - if (PSW & L1) { /* overlay active? */ - PC++; - return; /* NOP */ - } - RDOPARG( A ); - PSW |= L1; -} - -/* 6a: 0110 1010 xxxx xxxx */ -static void MVI_B_xx(void) -{ - RDOPARG( B ); -} - -/* 6b: 0110 1011 xxxx xxxx */ -static void MVI_C_xx(void) -{ - RDOPARG( C ); -} - -/* 6c: 0110 1100 xxxx xxxx */ -static void MVI_D_xx(void) -{ - RDOPARG( D ); -} - -/* 6d: 0110 1101 xxxx xxxx */ -static void MVI_E_xx(void) -{ - RDOPARG( E ); -} - -/* 6e: 0110 1110 xxxx xxxx */ -static void MVI_H_xx(void) -{ - RDOPARG( H ); -} - -/* 6f: 0110 1111 xxxx xxxx */ -static void MVI_L_xx(void) -{ - if (PSW & L0) { /* overlay active? */ - PC++; - return; /* NOP */ - } - RDOPARG( L ); - PSW |= L0; -} - -/* 70: prefix */ -static void PRE_70(void) -{ - RDOP(OP2); - upd7810_icount -= op70[OP2].cycles; - upd7810_timers(op70[OP2].cycles); - (*op70[OP2].opfunc)(); -} - -/* 71: 0111 0001 oooo oooo xxxx xxxx */ -static void MVIW_wa_xx(void) -{ - PAIR ea = upd7810.va; - UINT8 imm; - - RDOPARG( ea.b.l ); - RDOPARG( imm ); - - WM( ea.d, imm ); -} - -/* 72: 0111 0010 */ -static void SOFTI(void) -{ - SP--; - WM( SPD, PSW ); - SP--; - WM( SPD, PCH ); - SP--; - WM( SPD, PCL ); - - PC = 0x0060; - change_pc( PCD ); -} - -/* 74: prefix */ -static void PRE_74(void) -{ - RDOP(OP2); - upd7810_icount -= op74[OP2].cycles; - upd7810_timers(op74[OP2].cycles); - (*op74[OP2].opfunc)(); -} - -/* 75: 0111 0101 oooo oooo xxxx xxxx */ -static void EQIW_wa_xx(void) -{ - PAIR ea = upd7810.va; - UINT8 tmp, m, imm; - - RDOPARG( ea.b.l ); - RDOPARG( imm ); - m = RM( ea.d ); - tmp = m - imm; - ZHC_SUB( tmp, m, 0 ); - SKIP_Z; -} - -/* 76: 0111 0110 xxxx xxxx */ -/* SBI_A_xx already defined (long form) */ - -/* 77: 0111 0111 xxxx xxxx */ -/* EQI_A_xx already defined (long form) */ - -/* 78: 0111 1ddd dddd dddd */ -static void CALF(void) -{ - PAIR w; - w.d = 0; - - RDOPARG( w.b.l ); - w.b.h = 0x08 + (OP & 0x07); - - SP--; - WM( SPD, PCH ); - SP--; - WM( SPD, PCL ); - - PCD = w.d; - change_pc( PCD ); -} - -/* 80: 100t tttt */ -static void CALT(void) -{ - PAIR w; - w.d = 0; - - switch (upd7810_config_type) { - case TYPE_7810_GAMEMASTER: - // logerror ("!!!!!!!%.4x calt %.2x game master table position not known\n",PPC, OP); - break; - default: - w.w.l = 0x80 + 2 * (OP & 0x1f); - } - - if (upd7810_config_type!=TYPE_7810_GAMEMASTER) { - SP--; - WM( SPD, PCH ); - SP--; - WM( SPD, PCL ); - - PCL=RM(w.w.l); - PCH=RM(w.w.l+1); - - change_pc( PCD ); - // logerror ("!!!!!!!%.4x calt %.2x %.4x; game master table position not known\n",PPC, OP, PCD); - } -} - -/* a0: 1010 0000 */ -static void POP_VA(void) -{ - A = RM( SPD ); - SP++; - V = RM( SPD ); - SP++; -} - -/* a1: 1010 0001 */ -static void POP_BC(void) -{ - C = RM( SPD ); - SP++; - B = RM( SPD ); - SP++; -} - -/* a2: 1010 0010 */ -static void POP_DE(void) -{ - E = RM( SPD ); - SP++; - D = RM( SPD ); - SP++; -} - -/* a3: 1010 0011 */ -static void POP_HL(void) -{ - L = RM( SPD ); - SP++; - H = RM( SPD ); - SP++; -} - -/* a4: 1010 0100 */ -static void POP_EA(void) -{ - EAL = RM( SPD ); - SP++; - EAH = RM( SPD ); - SP++; -} - -/* a5: 1010 0101 */ -static void DMOV_EA_BC(void) -{ - EA = BC; -} - -/* a6: 1010 0110 */ -static void DMOV_EA_DE(void) -{ - EA = DE; -} - -/* a7: 1010 0111 */ -static void DMOV_EA_HL(void) -{ - EA = HL; -} - -/* a8: 1010 1000 */ -static void INX_EA(void) -{ - EA++; -} - -/* a9: 1010 1001 */ -static void DCX_EA(void) -{ - EA--; -} - -/* aa: 1010 1010 */ -static void EI(void) -{ - IFF = 1; -} - -/* ab: 1010 1011 dddd dddd */ -static void LDAX_D_xx(void) -{ - UINT16 ea; - RDOPARG( ea ); - ea += DE; - A = RM( ea ); -} - -/* ac: 1010 1100 */ -static void LDAX_H_A(void) -{ - UINT16 ea; - ea = HL + A; - A = RM( ea ); -} - -/* ad: 1010 1101 */ -static void LDAX_H_B(void) -{ - UINT16 ea; - ea = HL + B; - A = RM( ea ); -} - -/* ae: 1010 1110 */ -static void LDAX_H_EA(void) -{ - UINT16 ea; - ea = HL + EA; - A = RM( ea ); -} - -/* af: 1010 1111 dddd dddd */ -static void LDAX_H_xx(void) -{ - UINT16 ea; - RDOPARG( ea ); - ea += HL; - A = RM( ea ); -} - -/* b0: 1011 0000 */ -static void PUSH_VA(void) -{ - SP--; - WM( SPD, V ); - SP--; - WM( SPD, A ); -} - -/* b1: 1011 0001 */ -static void PUSH_BC(void) -{ - SP--; - WM( SPD, B ); - SP--; - WM( SPD, C ); -} - -/* b2: 1011 0010 */ -static void PUSH_DE(void) -{ - SP--; - WM( SPD, D ); - SP--; - WM( SPD, E ); -} - -/* b3: 1011 0011 */ -static void PUSH_HL(void) -{ - SP--; - WM( SPD, H ); - SP--; - WM( SPD, L ); -} - -/* b4: 1011 0100 */ -static void PUSH_EA(void) -{ - SP--; - WM( SPD, EAH ); - SP--; - WM( SPD, EAL ); -} - -/* b5: 1011 0101 */ -static void DMOV_BC_EA(void) -{ - BC = EA; -} - -/* b6: 1011 0110 */ -static void DMOV_DE_EA(void) -{ - DE = EA; -} - -/* b7: 1011 0111 */ -static void DMOV_HL_EA(void) -{ - HL = EA; -} - -/* b8: 1011 1000 */ -static void RET(void) -{ - PCL = RM( SPD ); - SP++; - PCH = RM( SPD ); - SP++; - change_pc( PCD ); -} - -/* b9: 1011 1001 */ -static void RETS(void) -{ - PCL = RM( SPD ); - SP++; - PCH = RM( SPD ); - SP++; - PSW|=SK; /* skip one instruction */ - change_pc( PCD ); -} - -/* ba: 1011 1010 */ -static void DI(void) -{ - IFF = 0; -} - -/* bb: 1011 1011 dddd dddd */ -static void STAX_D_xx(void) -{ - UINT16 ea; - RDOPARG(ea); - ea += DE; - WM( ea, A ); -} - -/* bc: 1011 1100 */ -static void STAX_H_A(void) -{ - UINT16 ea = A; - ea += HL; - WM( ea, A ); -} - -/* bd: 1011 1101 */ -static void STAX_H_B(void) -{ - UINT16 ea = B; - ea += HL; - WM( ea, A ); -} - -/* be: 1011 1110 */ -static void STAX_H_EA(void) -{ - UINT16 ea = EA; - ea += HL; - WM( ea, A ); -} - -/* bf: 1011 1111 dddd dddd */ -static void STAX_H_xx(void) -{ - UINT16 ea; - RDOPARG( ea ); - ea += HL; - WM( ea, A ); -} - -/* c0: 11dd dddd */ -static void JR(void) -{ - INT8 offs = (INT8)(OP << 2) >> 2; - PC += offs; - change_pc(PCD); -} - diff --git a/jan/src/cpu/upd7810/7810tbl.c b/jan/src/cpu/upd7810/7810tbl.c deleted file mode 100644 index 6c434ca1c..000000000 --- a/jan/src/cpu/upd7810/7810tbl.c +++ /dev/null @@ -1,3513 +0,0 @@ -/***************************************************************************** - * - * Portable uPD7810/11, 7810H/11H, 78C10/C11/C14 emulator V0.2 - * Copyright (c) 2001 Juergen Buchmueller, all rights reserved. - * - * 7810tbl.c - function pointer tables - * - *****************************************************************************/ - -static void illegal(void); -static void illegal2(void); - -static void ACI_ANM_xx(void); -static void ACI_A_xx(void); -static void ACI_B_xx(void); -static void ACI_C_xx(void); -static void ACI_D_xx(void); -static void ACI_EOM_xx(void); -static void ACI_E_xx(void); -static void ACI_H_xx(void); -static void ACI_L_xx(void); -static void ACI_MKH_xx(void); -static void ACI_MKL_xx(void); -static void ACI_PA_xx(void); -static void ACI_PB_xx(void); -static void ACI_PC_xx(void); -static void ACI_PD_xx(void); -static void ACI_PF_xx(void); -static void ACI_SMH_xx(void); -static void ACI_TMM_xx(void); -static void ACI_V_xx(void); -static void ADCW_wa(void); -static void ADCX_B(void); -static void ADCX_D(void); -static void ADCX_Dm(void); -static void ADCX_Dp(void); -static void ADCX_H(void); -static void ADCX_Hm(void); -static void ADCX_Hp(void); -static void ADC_A_A(void); -static void ADC_A_A(void); -static void ADC_A_B(void); -static void ADC_A_C(void); -static void ADC_A_D(void); -static void ADC_A_E(void); -static void ADC_A_H(void); -static void ADC_A_L(void); -static void ADC_A_V(void); -static void ADC_B_A(void); -static void ADC_C_A(void); -static void ADC_D_A(void); -static void ADC_E_A(void); -static void ADC_H_A(void); -static void ADC_L_A(void); -static void ADC_V_A(void); -static void ADDNCW_wa(void); -static void ADDNCX_B(void); -static void ADDNCX_D(void); -static void ADDNCX_Dm(void); -static void ADDNCX_Dp(void); -static void ADDNCX_H(void); -static void ADDNCX_Hm(void); -static void ADDNCX_Hp(void); -static void ADDNC_A_A(void); -static void ADDNC_A_A(void); -static void ADDNC_A_B(void); -static void ADDNC_A_C(void); -static void ADDNC_A_D(void); -static void ADDNC_A_E(void); -static void ADDNC_A_H(void); -static void ADDNC_A_L(void); -static void ADDNC_A_V(void); -static void ADDNC_B_A(void); -static void ADDNC_C_A(void); -static void ADDNC_D_A(void); -static void ADDNC_E_A(void); -static void ADDNC_H_A(void); -static void ADDNC_L_A(void); -static void ADDNC_V_A(void); -static void ADDW_wa(void); -static void ADDX_B(void); -static void ADDX_D(void); -static void ADDX_Dm(void); -static void ADDX_Dp(void); -static void ADDX_H(void); -static void ADDX_Hm(void); -static void ADDX_Hp(void); -static void ADD_A_A(void); -static void ADD_A_A(void); -static void ADD_A_B(void); -static void ADD_A_C(void); -static void ADD_A_D(void); -static void ADD_A_E(void); -static void ADD_A_H(void); -static void ADD_A_L(void); -static void ADD_A_V(void); -static void ADD_B_A(void); -static void ADD_C_A(void); -static void ADD_D_A(void); -static void ADD_E_A(void); -static void ADD_H_A(void); -static void ADD_L_A(void); -static void ADD_V_A(void); -static void ADINC_ANM_xx(void); -static void ADINC_A_xx(void); -static void ADINC_A_xx(void); -static void ADINC_B_xx(void); -static void ADINC_C_xx(void); -static void ADINC_D_xx(void); -static void ADINC_EOM_xx(void); -static void ADINC_E_xx(void); -static void ADINC_H_xx(void); -static void ADINC_L_xx(void); -static void ADINC_MKH_xx(void); -static void ADINC_MKL_xx(void); -static void ADINC_PA_xx(void); -static void ADINC_PB_xx(void); -static void ADINC_PC_xx(void); -static void ADINC_PD_xx(void); -static void ADINC_PF_xx(void); -static void ADINC_SMH_xx(void); -static void ADINC_TMM_xx(void); -static void ADINC_V_xx(void); -static void ADI_ANM_xx(void); -static void ADI_A_xx(void); -static void ADI_A_xx(void); -static void ADI_B_xx(void); -static void ADI_C_xx(void); -static void ADI_D_xx(void); -static void ADI_EOM_xx(void); -static void ADI_E_xx(void); -static void ADI_H_xx(void); -static void ADI_L_xx(void); -static void ADI_MKH_xx(void); -static void ADI_MKL_xx(void); -static void ADI_PA_xx(void); -static void ADI_PB_xx(void); -static void ADI_PC_xx(void); -static void ADI_PD_xx(void); -static void ADI_PF_xx(void); -static void ADI_SMH_xx(void); -static void ADI_TMM_xx(void); -static void ADI_V_xx(void); -static void ANAW_wa(void); -static void ANAX_B(void); -static void ANAX_D(void); -static void ANAX_Dm(void); -static void ANAX_Dp(void); -static void ANAX_H(void); -static void ANAX_Hm(void); -static void ANAX_Hp(void); -static void ANA_A_A(void); -static void ANA_A_A(void); -static void ANA_A_B(void); -static void ANA_A_C(void); -static void ANA_A_D(void); -static void ANA_A_E(void); -static void ANA_A_H(void); -static void ANA_A_L(void); -static void ANA_A_V(void); -static void ANA_B_A(void); -static void ANA_C_A(void); -static void ANA_D_A(void); -static void ANA_E_A(void); -static void ANA_H_A(void); -static void ANA_L_A(void); -static void ANA_V_A(void); -static void ANIW_wa_xx(void); -static void ANI_ANM_xx(void); -static void ANI_A_xx(void); -static void ANI_A_xx(void); -static void ANI_B_xx(void); -static void ANI_C_xx(void); -static void ANI_D_xx(void); -static void ANI_EOM_xx(void); -static void ANI_E_xx(void); -static void ANI_H_xx(void); -static void ANI_L_xx(void); -static void ANI_MKH_xx(void); -static void ANI_MKL_xx(void); -static void ANI_PA_xx(void); -static void ANI_PB_xx(void); -static void ANI_PC_xx(void); -static void ANI_PD_xx(void); -static void ANI_PF_xx(void); -static void ANI_SMH_xx(void); -static void ANI_TMM_xx(void); -static void ANI_V_xx(void); -static void BIT_0_wa(void); -static void BIT_1_wa(void); -static void BIT_2_wa(void); -static void BIT_3_wa(void); -static void BIT_4_wa(void); -static void BIT_5_wa(void); -static void BIT_6_wa(void); -static void BIT_7_wa(void); -static void BLOCK(void); -static void CALB(void); -static void CALF(void); -static void CALL_w(void); -static void CALT(void); -static void CLC(void); -static void CLR(void); -static void DAA(void); -static void DADC_EA_BC(void); -static void DADC_EA_DE(void); -static void DADC_EA_HL(void); -static void DADDNC_EA_BC(void); -static void DADDNC_EA_DE(void); -static void DADDNC_EA_HL(void); -static void DADD_EA_BC(void); -static void DADD_EA_DE(void); -static void DADD_EA_HL(void); -static void DAN_EA_BC(void); -static void DAN_EA_DE(void); -static void DAN_EA_HL(void); -static void DCRW_wa(void); -static void DCR_A(void); -static void DCR_B(void); -static void DCR_C(void); -static void DCX_BC(void); -static void DCX_DE(void); -static void DCX_EA(void); -static void DCX_HL(void); -static void DCX_SP(void); -static void DEQ_EA_BC(void); -static void DEQ_EA_DE(void); -static void DEQ_EA_HL(void); -static void DGT_EA_BC(void); -static void DGT_EA_DE(void); -static void DGT_EA_HL(void); -static void DI(void); -static void DIV_A(void); -static void DIV_B(void); -static void DIV_C(void); -static void DLT_EA_BC(void); -static void DLT_EA_DE(void); -static void DLT_EA_HL(void); -static void DMOV_BC_EA(void); -static void DMOV_DE_EA(void); -static void DMOV_EA_BC(void); -static void DMOV_EA_DE(void); -static void DMOV_EA_ECNT(void); -static void DMOV_EA_ECPT(void); -static void DMOV_EA_HL(void); -static void DMOV_ETM0_EA(void); -static void DMOV_ETM1_EA(void); -static void DMOV_HL_EA(void); -static void DNE_EA_BC(void); -static void DNE_EA_DE(void); -static void DNE_EA_HL(void); -static void DOFF_EA_BC(void); -static void DOFF_EA_DE(void); -static void DOFF_EA_HL(void); -static void DON_EA_BC(void); -static void DON_EA_DE(void); -static void DON_EA_HL(void); -static void DOR_EA_BC(void); -static void DOR_EA_DE(void); -static void DOR_EA_HL(void); -static void DRLL_EA(void); -static void DRLR_EA(void); -static void DSBB_EA_BC(void); -static void DSBB_EA_DE(void); -static void DSBB_EA_HL(void); -static void DSLL_EA(void); -static void DSLR_EA(void); -static void DSUBNB_EA_BC(void); -static void DSUBNB_EA_DE(void); -static void DSUBNB_EA_HL(void); -static void DSUB_EA_BC(void); -static void DSUB_EA_DE(void); -static void DSUB_EA_HL(void); -static void DXR_EA_BC(void); -static void DXR_EA_DE(void); -static void DXR_EA_HL(void); -static void EADD_EA_A(void); -static void EADD_EA_B(void); -static void EADD_EA_C(void); -static void EI(void); -static void EQAW_wa(void); -static void EQAX_B(void); -static void EQAX_D(void); -static void EQAX_Dm(void); -static void EQAX_Dp(void); -static void EQAX_H(void); -static void EQAX_Hm(void); -static void EQAX_Hp(void); -static void EQA_A_A(void); -static void EQA_A_A(void); -static void EQA_A_B(void); -static void EQA_A_C(void); -static void EQA_A_D(void); -static void EQA_A_E(void); -static void EQA_A_H(void); -static void EQA_A_L(void); -static void EQA_A_V(void); -static void EQA_B_A(void); -static void EQA_C_A(void); -static void EQA_D_A(void); -static void EQA_E_A(void); -static void EQA_H_A(void); -static void EQA_L_A(void); -static void EQA_V_A(void); -static void EQIW_wa_xx(void); -static void EQI_ANM_xx(void); -static void EQI_A_xx(void); -static void EQI_A_xx(void); -static void EQI_B_xx(void); -static void EQI_C_xx(void); -static void EQI_D_xx(void); -static void EQI_EOM_xx(void); -static void EQI_E_xx(void); -static void EQI_H_xx(void); -static void EQI_L_xx(void); -static void EQI_MKH_xx(void); -static void EQI_MKL_xx(void); -static void EQI_PA_xx(void); -static void EQI_PB_xx(void); -static void EQI_PC_xx(void); -static void EQI_PD_xx(void); -static void EQI_PF_xx(void); -static void EQI_SMH_xx(void); -static void EQI_TMM_xx(void); -static void EQI_V_xx(void); -static void ESUB_EA_A(void); -static void ESUB_EA_B(void); -static void ESUB_EA_C(void); -static void EXA(void); -static void EXH(void); -static void EXX(void); -static void EXR(void); -static void GTAW_wa(void); -static void GTAX_B(void); -static void GTAX_D(void); -static void GTAX_Dm(void); -static void GTAX_Dp(void); -static void GTAX_H(void); -static void GTAX_Hm(void); -static void GTAX_Hp(void); -static void GTA_A_A(void); -static void GTA_A_A(void); -static void GTA_A_B(void); -static void GTA_A_C(void); -static void GTA_A_D(void); -static void GTA_A_E(void); -static void GTA_A_H(void); -static void GTA_A_L(void); -static void GTA_A_V(void); -static void GTA_B_A(void); -static void GTA_C_A(void); -static void GTA_D_A(void); -static void GTA_E_A(void); -static void GTA_H_A(void); -static void GTA_L_A(void); -static void GTA_V_A(void); -static void GTIW_wa_xx(void); -static void GTI_ANM_xx(void); -static void GTI_A_xx(void); -static void GTI_A_xx(void); -static void GTI_B_xx(void); -static void GTI_C_xx(void); -static void GTI_D_xx(void); -static void GTI_EOM_xx(void); -static void GTI_E_xx(void); -static void GTI_H_xx(void); -static void GTI_L_xx(void); -static void GTI_MKH_xx(void); -static void GTI_MKL_xx(void); -static void GTI_PA_xx(void); -static void GTI_PB_xx(void); -static void GTI_PC_xx(void); -static void GTI_PD_xx(void); -static void GTI_PF_xx(void); -static void GTI_SMH_xx(void); -static void GTI_TMM_xx(void); -static void GTI_V_xx(void); -static void HALT(void); -static void INRW_wa(void); -static void INR_A(void); -static void INR_B(void); -static void INR_C(void); -static void INX_BC(void); -static void INX_DE(void); -static void INX_EA(void); -static void INX_HL(void); -static void INX_SP(void); -static void JB(void); -static void JEA(void); -static void JMP_w(void); -static void JR(void); -static void JRE(void); -static void LBCD_w(void); -static void LDAW_wa(void); -static void LDAX_B(void); -static void LDAX_D(void); -static void LDAX_D_xx(void); -static void LDAX_Dm(void); -static void LDAX_Dp(void); -static void LDAX_H(void); -static void LDAX_H_A(void); -static void LDAX_H_B(void); -static void LDAX_H_EA(void); -static void LDAX_H_xx(void); -static void LDAX_Hm(void); -static void LDAX_Hp(void); -static void LDEAX_D(void); -static void LDEAX_D_xx(void); -static void LDEAX_Dp(void); -static void LDEAX_H(void); -static void LDEAX_H_A(void); -static void LDEAX_H_B(void); -static void LDEAX_H_EA(void); -static void LDEAX_H_xx(void); -static void LDEAX_Hp(void); -static void LDED_w(void); -static void LHLD_w(void); -static void LSPD_w(void); -static void LTAW_wa(void); -static void LTAX_B(void); -static void LTAX_D(void); -static void LTAX_Dm(void); -static void LTAX_Dp(void); -static void LTAX_H(void); -static void LTAX_Hm(void); -static void LTAX_Hp(void); -static void LTA_A_A(void); -static void LTA_A_A(void); -static void LTA_A_B(void); -static void LTA_A_C(void); -static void LTA_A_D(void); -static void LTA_A_E(void); -static void LTA_A_H(void); -static void LTA_A_L(void); -static void LTA_A_V(void); -static void LTA_B_A(void); -static void LTA_C_A(void); -static void LTA_D_A(void); -static void LTA_E_A(void); -static void LTA_H_A(void); -static void LTA_L_A(void); -static void LTA_V_A(void); -static void LTIW_wa_xx(void); -static void LTI_ANM_xx(void); -static void LTI_A_xx(void); -static void LTI_A_xx(void); -static void LTI_B_xx(void); -static void LTI_C_xx(void); -static void LTI_D_xx(void); -static void LTI_EOM_xx(void); -static void LTI_E_xx(void); -static void LTI_H_xx(void); -static void LTI_L_xx(void); -static void LTI_MKH_xx(void); -static void LTI_MKL_xx(void); -static void LTI_PA_xx(void); -static void LTI_PB_xx(void); -static void LTI_PC_xx(void); -static void LTI_PD_xx(void); -static void LTI_PF_xx(void); -static void LTI_SMH_xx(void); -static void LTI_TMM_xx(void); -static void LTI_V_xx(void); -static void LXI_B_w(void); -static void LXI_D_w(void); -static void LXI_EA_s(void); -static void LXI_H_w(void); -static void LXI_S_w(void); -static void MOV_ANM_A(void); -static void MOV_A_ANM(void); -static void MOV_A_B(void); -static void MOV_A_C(void); -static void MOV_A_CR0(void); -static void MOV_A_CR1(void); -static void MOV_A_CR2(void); -static void MOV_A_CR3(void); -static void MOV_A_D(void); -static void MOV_A_E(void); -static void MOV_A_EAH(void); -static void MOV_A_EAL(void); -static void MOV_A_EOM(void); -static void MOV_A_H(void); -static void MOV_A_L(void); -static void MOV_A_MKH(void); -static void MOV_A_MKL(void); -static void MOV_A_PA(void); -static void MOV_A_PB(void); -static void MOV_A_PC(void); -static void MOV_A_PD(void); -static void MOV_A_PF(void); -static void MOV_A_RXB(void); -static void MOV_A_SMH(void); -static void MOV_A_TMM(void); -static void MOV_A_PT(void); -static void MOV_A_w(void); -static void MOV_B_A(void); -static void MOV_B_w(void); -static void MOV_C_A(void); -static void MOV_C_w(void); -static void MOV_D_A(void); -static void MOV_D_w(void); -static void MOV_EAH_A(void); -static void MOV_EAL_A(void); -static void MOV_EOM_A(void); -static void MOV_ETMM_A(void); -static void MOV_E_A(void); -static void MOV_E_w(void); -static void MOV_H_A(void); -static void MOV_H_w(void); -static void MOV_L_A(void); -static void MOV_L_w(void); -static void MOV_MA_A(void); -static void MOV_MB_A(void); -static void MOV_MCC_A(void); -static void MOV_MC_A(void); -static void MOV_MF_A(void); -static void MOV_MKH_A(void); -static void MOV_MKL_A(void); -static void MOV_MM_A(void); -static void MOV_PA_A(void); -static void MOV_PB_A(void); -static void MOV_PC_A(void); -static void MOV_PD_A(void); -static void MOV_PF_A(void); -static void MOV_SMH_A(void); -static void MOV_SML_A(void); -static void MOV_TM0_A(void); -static void MOV_TM1_A(void); -static void MOV_TMM_A(void); -static void MOV_TXB_A(void); -static void MOV_V_w(void); -static void MOV_ZCM_A(void); -static void MOV_w_A(void); -static void MOV_w_B(void); -static void MOV_w_C(void); -static void MOV_w_D(void); -static void MOV_w_E(void); -static void MOV_w_H(void); -static void MOV_w_L(void); -static void MOV_w_V(void); -static void MUL_A(void); -static void MUL_B(void); -static void MUL_C(void); -static void MVIW_wa_xx(void); -static void MVIX_BC_xx(void); -static void MVIX_DE_xx(void); -static void MVIX_HL_xx(void); -static void MVI_ANM_xx(void); -static void MVI_A_xx(void); -static void MVI_B_xx(void); -static void MVI_C_xx(void); -static void MVI_D_xx(void); -static void MVI_EOM_xx(void); -static void MVI_E_xx(void); -static void MVI_H_xx(void); -static void MVI_L_xx(void); -static void MVI_MKH_xx(void); -static void MVI_MKL_xx(void); -static void MVI_PA_xx(void); -static void MVI_PB_xx(void); -static void MVI_PC_xx(void); -static void MVI_PD_xx(void); -static void MVI_PF_xx(void); -static void MVI_SMH_xx(void); -static void MVI_TMM_xx(void); -static void MVI_V_xx(void); -static void NEAW_wa(void); -static void NEAX_B(void); -static void NEAX_D(void); -static void NEAX_Dm(void); -static void NEAX_Dp(void); -static void NEAX_H(void); -static void NEAX_Hm(void); -static void NEAX_Hp(void); -static void NEA_A_A(void); -static void NEA_A_A(void); -static void NEA_A_B(void); -static void NEA_A_C(void); -static void NEA_A_D(void); -static void NEA_A_E(void); -static void NEA_A_H(void); -static void NEA_A_L(void); -static void NEA_A_V(void); -static void NEA_B_A(void); -static void NEA_C_A(void); -static void NEA_D_A(void); -static void NEA_E_A(void); -static void NEA_H_A(void); -static void NEA_L_A(void); -static void NEA_V_A(void); -static void NEGA(void); -static void NEIW_wa_xx(void); -static void NEI_ANM_xx(void); -static void NEI_A_xx(void); -static void NEI_A_xx(void); -static void NEI_B_xx(void); -static void NEI_C_xx(void); -static void NEI_D_xx(void); -static void NEI_EOM_xx(void); -static void NEI_E_xx(void); -static void NEI_H_xx(void); -static void NEI_L_xx(void); -static void NEI_MKH_xx(void); -static void NEI_MKL_xx(void); -static void NEI_PA_xx(void); -static void NEI_PB_xx(void); -static void NEI_PC_xx(void); -static void NEI_PD_xx(void); -static void NEI_PF_xx(void); -static void NEI_SMH_xx(void); -static void NEI_TMM_xx(void); -static void NEI_V_xx(void); -static void NOP(void); -static void OFFAW_wa(void); -static void OFFAX_B(void); -static void OFFAX_D(void); -static void OFFAX_Dm(void); -static void OFFAX_Dp(void); -static void OFFAX_H(void); -static void OFFAX_Hm(void); -static void OFFAX_Hp(void); -static void OFFA_A_A(void); -static void OFFA_A_B(void); -static void OFFA_A_C(void); -static void OFFA_A_D(void); -static void OFFA_A_E(void); -static void OFFA_A_H(void); -static void OFFA_A_L(void); -static void OFFA_A_V(void); -static void OFFIW_wa_xx(void); -static void OFFI_ANM_xx(void); -static void OFFI_A_xx(void); -static void OFFI_A_xx(void); -static void OFFI_B_xx(void); -static void OFFI_C_xx(void); -static void OFFI_D_xx(void); -static void OFFI_EOM_xx(void); -static void OFFI_E_xx(void); -static void OFFI_H_xx(void); -static void OFFI_L_xx(void); -static void OFFI_MKH_xx(void); -static void OFFI_MKL_xx(void); -static void OFFI_PA_xx(void); -static void OFFI_PB_xx(void); -static void OFFI_PC_xx(void); -static void OFFI_PD_xx(void); -static void OFFI_PF_xx(void); -static void OFFI_SMH_xx(void); -static void OFFI_TMM_xx(void); -static void OFFI_V_xx(void); -static void ONAW_wa(void); -static void ONAX_B(void); -static void ONAX_D(void); -static void ONAX_Dm(void); -static void ONAX_Dp(void); -static void ONAX_H(void); -static void ONAX_Hm(void); -static void ONAX_Hp(void); -static void ONA_A_A(void); -static void ONA_A_B(void); -static void ONA_A_C(void); -static void ONA_A_D(void); -static void ONA_A_E(void); -static void ONA_A_H(void); -static void ONA_A_L(void); -static void ONA_A_V(void); -static void ONIW_wa_xx(void); -static void ONI_ANM_xx(void); -static void ONI_A_xx(void); -static void ONI_A_xx(void); -static void ONI_B_xx(void); -static void ONI_C_xx(void); -static void ONI_D_xx(void); -static void ONI_EOM_xx(void); -static void ONI_E_xx(void); -static void ONI_H_xx(void); -static void ONI_L_xx(void); -static void ONI_MKH_xx(void); -static void ONI_MKL_xx(void); -static void ONI_PA_xx(void); -static void ONI_PB_xx(void); -static void ONI_PC_xx(void); -static void ONI_PD_xx(void); -static void ONI_PF_xx(void); -static void ONI_SMH_xx(void); -static void ONI_TMM_xx(void); -static void ONI_V_xx(void); -static void ORAW_wa(void); -static void ORAX_B(void); -static void ORAX_D(void); -static void ORAX_Dm(void); -static void ORAX_Dp(void); -static void ORAX_H(void); -static void ORAX_Hm(void); -static void ORAX_Hp(void); -static void ORA_A_A(void); -static void ORA_A_A(void); -static void ORA_A_B(void); -static void ORA_A_C(void); -static void ORA_A_D(void); -static void ORA_A_E(void); -static void ORA_A_H(void); -static void ORA_A_L(void); -static void ORA_A_V(void); -static void ORA_B_A(void); -static void ORA_C_A(void); -static void ORA_D_A(void); -static void ORA_E_A(void); -static void ORA_H_A(void); -static void ORA_L_A(void); -static void ORA_V_A(void); -static void ORIW_wa_xx(void); -static void ORI_ANM_xx(void); -static void ORI_A_xx(void); -static void ORI_A_xx(void); -static void ORI_B_xx(void); -static void ORI_C_xx(void); -static void ORI_D_xx(void); -static void ORI_EOM_xx(void); -static void ORI_E_xx(void); -static void ORI_H_xx(void); -static void ORI_L_xx(void); -static void ORI_MKH_xx(void); -static void ORI_MKL_xx(void); -static void ORI_PA_xx(void); -static void ORI_PB_xx(void); -static void ORI_PC_xx(void); -static void ORI_PD_xx(void); -static void ORI_PF_xx(void); -static void ORI_SMH_xx(void); -static void ORI_TMM_xx(void); -static void ORI_V_xx(void); -static void POP_BC(void); -static void POP_DE(void); -static void POP_EA(void); -static void POP_HL(void); -static void POP_VA(void); -static void PRE_48(void); -static void PRE_4C(void); -static void PRE_4D(void); -static void PRE_60(void); -static void PRE_64(void); -static void PRE_70(void); -static void PRE_74(void); -static void PUSH_BC(void); -static void PUSH_DE(void); -static void PUSH_EA(void); -static void PUSH_HL(void); -static void PUSH_VA(void); -static void RET(void); -static void RETI(void); -static void RETS(void); -static void RLD(void); -static void RLL_A(void); -static void RLL_B(void); -static void RLL_C(void); -static void RLR_A(void); -static void RLR_B(void); -static void RLR_C(void); -static void RRD(void); -static void SBBW_wa(void); -static void SBBX_B(void); -static void SBBX_D(void); -static void SBBX_Dm(void); -static void SBBX_Dp(void); -static void SBBX_H(void); -static void SBBX_Hm(void); -static void SBBX_Hp(void); -static void SBB_A_A(void); -static void SBB_A_A(void); -static void SBB_A_B(void); -static void SBB_A_C(void); -static void SBB_A_D(void); -static void SBB_A_E(void); -static void SBB_A_H(void); -static void SBB_A_L(void); -static void SBB_A_V(void); -static void SBB_B_A(void); -static void SBB_C_A(void); -static void SBB_D_A(void); -static void SBB_E_A(void); -static void SBB_H_A(void); -static void SBB_L_A(void); -static void SBB_V_A(void); -static void SBCD_w(void); -static void SBI_ANM_xx(void); -static void SBI_A_xx(void); -static void SBI_A_xx(void); -static void SBI_B_xx(void); -static void SBI_C_xx(void); -static void SBI_D_xx(void); -static void SBI_EOM_xx(void); -static void SBI_E_xx(void); -static void SBI_H_xx(void); -static void SBI_L_xx(void); -static void SBI_MKH_xx(void); -static void SBI_MKL_xx(void); -static void SBI_PA_xx(void); -static void SBI_PB_xx(void); -static void SBI_PC_xx(void); -static void SBI_PD_xx(void); -static void SBI_PF_xx(void); -static void SBI_SMH_xx(void); -static void SBI_TMM_xx(void); -static void SBI_V_xx(void); -static void SDED_w(void); -static void SETB(void); -static void SHLD_w(void); -static void SK_bit(void); -static void SKN_bit(void); -static void SKIT_AN4(void); -static void SKIT_AN5(void); -static void SKIT_AN6(void); -static void SKIT_AN7(void); -static void SKIT_ER(void); -static void SKIT_F1(void); -static void SKIT_F2(void); -static void SKIT_FAD(void); -static void SKIT_FE0(void); -static void SKIT_FE1(void); -static void SKIT_FEIN(void); -static void SKIT_FSR(void); -static void SKIT_FST(void); -static void SKIT_FT0(void); -static void SKIT_FT1(void); -static void SKIT_NMI(void); -static void SKIT_OV(void); -static void SKIT_SB(void); -static void SKNIT_AN4(void); -static void SKNIT_AN5(void); -static void SKNIT_AN6(void); -static void SKNIT_AN7(void); -static void SKNIT_ER(void); -static void SKNIT_F1(void); -static void SKNIT_F2(void); -static void SKNIT_FAD(void); -static void SKNIT_FE0(void); -static void SKNIT_FE1(void); -static void SKNIT_FEIN(void); -static void SKNIT_FSR(void); -static void SKNIT_FST(void); -static void SKNIT_FT0(void); -static void SKNIT_FT1(void); -static void SKNIT_NMI(void); -static void SKNIT_OV(void); -static void SKNIT_SB(void); -static void SKN_CY(void); -static void SKN_HC(void); -static void SKN_NV(void); -static void SKN_Z(void); -static void SK_CY(void); -static void SK_HC(void); -static void SK_NV(void); -static void SK_Z(void); -static void SLLC_A(void); -static void SLLC_B(void); -static void SLLC_C(void); -static void SLL_A(void); -static void SLL_B(void); -static void SLL_C(void); -static void SLRC_A(void); -static void SLRC_B(void); -static void SLRC_C(void); -static void SLR_A(void); -static void SLR_B(void); -static void SLR_C(void); -static void SOFTI(void); -static void SSPD_w(void); -static void STAW_wa(void); -static void STAX_B(void); -static void STAX_D(void); -static void STAX_D_xx(void); -static void STAX_Dm(void); -static void STAX_Dp(void); -static void STAX_H(void); -static void STAX_H_A(void); -static void STAX_H_B(void); -static void STAX_H_EA(void); -static void STAX_H_xx(void); -static void STAX_Hm(void); -static void STAX_Hp(void); -static void STC(void); -static void STEAX_D(void); -static void STEAX_D_xx(void); -static void STEAX_Dp(void); -static void STEAX_H(void); -static void STEAX_H_A(void); -static void STEAX_H_B(void); -static void STEAX_H_EA(void); -static void STEAX_H_xx(void); -static void STEAX_Hp(void); -static void STOP(void); -static void SUBNBW_wa(void); -static void SUBNBX_B(void); -static void SUBNBX_D(void); -static void SUBNBX_Dm(void); -static void SUBNBX_Dp(void); -static void SUBNBX_H(void); -static void SUBNBX_Hm(void); -static void SUBNBX_Hp(void); -static void SUBNB_A_A(void); -static void SUBNB_A_A(void); -static void SUBNB_A_B(void); -static void SUBNB_A_C(void); -static void SUBNB_A_D(void); -static void SUBNB_A_E(void); -static void SUBNB_A_H(void); -static void SUBNB_A_L(void); -static void SUBNB_A_V(void); -static void SUBNB_B_A(void); -static void SUBNB_C_A(void); -static void SUBNB_D_A(void); -static void SUBNB_E_A(void); -static void SUBNB_H_A(void); -static void SUBNB_L_A(void); -static void SUBNB_V_A(void); -static void SUBW_wa(void); -static void SUBX_B(void); -static void SUBX_D(void); -static void SUBX_Dm(void); -static void SUBX_Dp(void); -static void SUBX_H(void); -static void SUBX_Hm(void); -static void SUBX_Hp(void); -static void SUB_A_A(void); -static void SUB_A_A(void); -static void SUB_A_B(void); -static void SUB_A_C(void); -static void SUB_A_D(void); -static void SUB_A_E(void); -static void SUB_A_H(void); -static void SUB_A_L(void); -static void SUB_A_V(void); -static void SUB_B_A(void); -static void SUB_C_A(void); -static void SUB_D_A(void); -static void SUB_E_A(void); -static void SUB_H_A(void); -static void SUB_L_A(void); -static void SUB_V_A(void); -static void SUINB_ANM_xx(void); -static void SUINB_A_xx(void); -static void SUINB_A_xx(void); -static void SUINB_B_xx(void); -static void SUINB_C_xx(void); -static void SUINB_D_xx(void); -static void SUINB_EOM_xx(void); -static void SUINB_E_xx(void); -static void SUINB_H_xx(void); -static void SUINB_L_xx(void); -static void SUINB_MKH_xx(void); -static void SUINB_MKL_xx(void); -static void SUINB_PA_xx(void); -static void SUINB_PB_xx(void); -static void SUINB_PC_xx(void); -static void SUINB_PD_xx(void); -static void SUINB_PF_xx(void); -static void SUINB_SMH_xx(void); -static void SUINB_TMM_xx(void); -static void SUINB_V_xx(void); -static void SUI_ANM_xx(void); -static void SUI_A_xx(void); -static void SUI_A_xx(void); -static void SUI_B_xx(void); -static void SUI_C_xx(void); -static void SUI_D_xx(void); -static void SUI_EOM_xx(void); -static void SUI_E_xx(void); -static void SUI_H_xx(void); -static void SUI_L_xx(void); -static void SUI_MKH_xx(void); -static void SUI_MKL_xx(void); -static void SUI_PA_xx(void); -static void SUI_PB_xx(void); -static void SUI_PC_xx(void); -static void SUI_PD_xx(void); -static void SUI_PF_xx(void); -static void SUI_SMH_xx(void); -static void SUI_TMM_xx(void); -static void SUI_V_xx(void); -static void TABLE(void); -static void XRAW_wa(void); -static void XRAX_B(void); -static void XRAX_D(void); -static void XRAX_Dm(void); -static void XRAX_Dp(void); -static void XRAX_H(void); -static void XRAX_Hm(void); -static void XRAX_Hp(void); -static void XRA_A_A(void); -static void XRA_A_A(void); -static void XRA_A_B(void); -static void XRA_A_C(void); -static void XRA_A_D(void); -static void XRA_A_E(void); -static void XRA_A_H(void); -static void XRA_A_L(void); -static void XRA_A_V(void); -static void XRA_B_A(void); -static void XRA_C_A(void); -static void XRA_D_A(void); -static void XRA_E_A(void); -static void XRA_H_A(void); -static void XRA_L_A(void); -static void XRA_V_A(void); -static void XRI_ANM_xx(void); -static void XRI_A_xx(void); -static void XRI_A_xx(void); -static void XRI_B_xx(void); -static void XRI_C_xx(void); -static void XRI_D_xx(void); -static void XRI_EOM_xx(void); -static void XRI_E_xx(void); -static void XRI_H_xx(void); -static void XRI_L_xx(void); -static void XRI_MKH_xx(void); -static void XRI_MKL_xx(void); -static void XRI_PA_xx(void); -static void XRI_PB_xx(void); -static void XRI_PC_xx(void); -static void XRI_PD_xx(void); -static void XRI_PF_xx(void); -static void XRI_SMH_xx(void); -static void XRI_TMM_xx(void); -static void XRI_V_xx(void); - -static struct opcode_s op48[256] = -{ - {illegal, 2, 8, 8,L0|L1}, /* 00: 0100 1000 0000 0000 */ - {SLRC_A, 2, 8, 8,L0|L1}, /* 01: 0100 1000 0000 0001 */ - {SLRC_B, 2, 8, 8,L0|L1}, /* 02: 0100 1000 0000 0010 */ - {SLRC_C, 2, 8, 8,L0|L1}, /* 03: 0100 1000 0000 0011 */ - {illegal, 2, 8, 8,L0|L1}, /* 04: 0100 1000 0000 0100 */ - {SLLC_A, 2, 8, 8,L0|L1}, /* 05: 0100 1000 0000 0101 */ - {SLLC_B, 2, 8, 8,L0|L1}, /* 06: 0100 1000 0000 0110 */ - {SLLC_C, 2, 8, 8,L0|L1}, /* 07: 0100 1000 0000 0111 */ - {SK_NV, 2, 8, 8,L0|L1}, /* 08: 0100 1000 0000 1000 */ - {illegal, 2, 8, 8,L0|L1}, /* 09: 0100 1000 0000 1001 */ - {SK_CY, 2, 8, 8,L0|L1}, /* 0a: 0100 1000 0000 1010 */ - {SK_HC, 2, 8, 8,L0|L1}, /* 0b: 0100 1000 0000 1011 */ - {SK_Z, 2, 8, 8,L0|L1}, /* 0c: 0100 1000 0000 1100 */ - {illegal, 2, 8, 8,L0|L1}, /* 0d: 0100 1000 0000 1101 */ - {illegal, 2, 8, 8,L0|L1}, /* 0e: 0100 1000 0000 1110 */ - {illegal, 2, 8, 8,L0|L1}, /* 0f: 0100 1000 0000 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 10: 0100 1000 0001 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 11: 0100 1000 0001 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 12: 0100 1000 0001 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 13: 0100 1000 0001 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 14: 0100 1000 0001 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 15: 0100 1000 0001 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 16: 0100 1000 0001 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 17: 0100 1000 0001 0111 */ - {SKN_NV, 2, 8, 8,L0|L1}, /* 18: 0100 1000 0001 1000 */ - {illegal, 2, 8, 8,L0|L1}, /* 19: 0100 1000 0001 1001 */ - {SKN_CY, 2, 8, 8,L0|L1}, /* 1a: 0100 1000 0001 1010 */ - {SKN_HC, 2, 8, 8,L0|L1}, /* 1b: 0100 1000 0001 1011 */ - {SKN_Z, 2, 8, 8,L0|L1}, /* 1c: 0100 1000 0001 1100 */ - {illegal, 2, 8, 8,L0|L1}, /* 1d: 0100 1000 0001 1101 */ - {illegal, 2, 8, 8,L0|L1}, /* 1e: 0100 1000 0001 1110 */ - {illegal, 2, 8, 8,L0|L1}, /* 1f: 0100 1000 0001 1111 */ - - {illegal, 2, 8, 8,L0|L1}, /* 20: 0100 1000 0010 0000 */ - {SLR_A, 2, 8, 8,L0|L1}, /* 21: 0100 1000 0010 0001 */ - {SLR_B, 2, 8, 8,L0|L1}, /* 22: 0100 1000 0010 0010 */ - {SLR_C, 2, 8, 8,L0|L1}, /* 23: 0100 1000 0010 0011 */ - {illegal, 2, 8, 8,L0|L1}, /* 24: 0100 1000 0010 0100 */ - {SLL_A, 2, 8, 8,L0|L1}, /* 25: 0100 1000 0010 0101 */ - {SLL_B, 2, 8, 8,L0|L1}, /* 26: 0100 1000 0010 0110 */ - {SLL_C, 2, 8, 8,L0|L1}, /* 27: 0100 1000 0010 0111 */ - {JEA, 2, 8, 8,L0|L1}, /* 28: 0100 1000 0010 1000 */ - {CALB, 2,17,17,L0|L1}, /* 29: 0100 1000 0010 1001 */ - {CLC, 2, 8, 8,L0|L1}, /* 2a: 0100 1000 0010 1010 */ - {STC, 2, 8, 8,L0|L1}, /* 2b: 0100 1000 0010 1011 */ - {illegal, 2,32,32,L0|L1}, /* 2c: 0100 1000 0010 1100 */ - {MUL_A, 2,32,32,L0|L1}, /* 2d: 0100 1000 0010 1101 */ - {MUL_B, 2,32,32,L0|L1}, /* 2e: 0100 1000 0010 1110 */ - {MUL_C, 2,32,32,L0|L1}, /* 2f: 0100 1000 0010 1111 */ - - {illegal, 2, 8, 8,L0|L1}, /* 30: 0100 1000 0011 0000 */ - {RLR_A, 2, 8, 8,L0|L1}, /* 31: 0100 1000 0011 0001 */ - {RLR_B, 2, 8, 8,L0|L1}, /* 32: 0100 1000 0011 0010 */ - {RLR_C, 2, 8, 8,L0|L1}, /* 33: 0100 1000 0011 0011 */ - {illegal, 2, 8, 8,L0|L1}, /* 34: 0100 1000 0011 0100 */ - {RLL_A, 2, 8, 8,L0|L1}, /* 35: 0100 1000 0011 0101 */ - {RLL_B, 2, 8, 8,L0|L1}, /* 36: 0100 1000 0011 0110 */ - {RLL_C, 2, 8, 8,L0|L1}, /* 37: 0100 1000 0011 0111 */ - {RLD, 2,17,17,L0|L1}, /* 38: 0100 1000 0011 1000 */ - {RRD, 2,17,17,L0|L1}, /* 39: 0100 1000 0011 1001 */ - {NEGA, 2, 8, 8,L0|L1}, /* 3a: 0100 1000 0011 1010 */ - {HALT, 2,12,12,L0|L1}, /* 3b: 0100 1000 0011 1011 */ - {illegal, 2, 8, 8,L0|L1}, /* 3c: 0100 1000 0011 1100 */ - {DIV_A, 2,59,59,L0|L1}, /* 3d: 0100 1000 0011 1101 */ - {DIV_B, 2,59,59,L0|L1}, /* 3e: 0100 1000 0011 1110 */ - {DIV_C, 2,59,59,L0|L1}, /* 3f: 0100 1000 0011 1111 */ - - {SKIT_NMI, 2, 8, 8,L0|L1}, /* 40: 0100 1000 0100 0000 */ - {SKIT_FT0, 2, 8, 8,L0|L1}, /* 41: 0100 1000 0100 0001 */ - {SKIT_FT1, 2, 8, 8,L0|L1}, /* 42: 0100 1000 0100 0010 */ - {SKIT_F1, 2, 8, 8,L0|L1}, /* 43: 0100 1000 0100 0011 */ - {SKIT_F2, 2, 8, 8,L0|L1}, /* 44: 0100 1000 0100 0100 */ - {SKIT_FE0, 2, 8, 8,L0|L1}, /* 45: 0100 1000 0100 0101 */ - {SKIT_FE1, 2, 8, 8,L0|L1}, /* 46: 0100 1000 0100 0110 */ - {SKIT_FEIN, 2, 8, 8,L0|L1}, /* 47: 0100 1000 0100 0111 */ - {SKIT_FAD, 2, 8, 8,L0|L1}, /* 48: 0100 1000 0100 1000 */ - {SKIT_FSR, 2, 8, 8,L0|L1}, /* 49: 0100 1000 0100 1001 */ - {SKIT_FST, 2, 8, 8,L0|L1}, /* 4a: 0100 1000 0100 1010 */ - {SKIT_ER, 2, 8, 8,L0|L1}, /* 4b: 0100 1000 0100 1011 */ - {SKIT_OV, 2, 8, 8,L0|L1}, /* 4c: 0100 1000 0100 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4d: 0100 1000 0100 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4e: 0100 1000 0100 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4f: 0100 1000 0100 1111 */ - - {SKIT_AN4, 2, 8, 8,L0|L1}, /* 50: 0100 1000 0101 0000 */ - {SKIT_AN5, 2, 8, 8,L0|L1}, /* 51: 0100 1000 0101 0001 */ - {SKIT_AN6, 2, 8, 8,L0|L1}, /* 52: 0100 1000 0101 0010 */ - {SKIT_AN7, 2, 8, 8,L0|L1}, /* 53: 0100 1000 0101 0011 */ - {SKIT_SB, 2, 8, 8,L0|L1}, /* 54: 0100 1000 0101 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 55: 0100 1000 0101 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 56: 0100 1000 0101 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 57: 0100 1000 0101 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 58: 0100 1000 0101 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 59: 0100 1000 0101 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5a: 0100 1000 0101 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5b: 0100 1000 0101 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5c: 0100 1000 0101 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5d: 0100 1000 0101 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5e: 0100 1000 0101 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5f: 0100 1000 0101 1111 */ - - {SKNIT_NMI, 2, 8, 8,L0|L1}, /* 60: 0100 1000 0110 0000 */ - {SKNIT_FT0, 2, 8, 8,L0|L1}, /* 61: 0100 1000 0110 0001 */ - {SKNIT_FT1, 2, 8, 8,L0|L1}, /* 62: 0100 1000 0110 0010 */ - {SKNIT_F1, 2, 8, 8,L0|L1}, /* 63: 0100 1000 0110 0011 */ - {SKNIT_F2, 2, 8, 8,L0|L1}, /* 64: 0100 1000 0110 0100 */ - {SKNIT_FE0, 2, 8, 8,L0|L1}, /* 65: 0100 1000 0110 0101 */ - {SKNIT_FE1, 2, 8, 8,L0|L1}, /* 66: 0100 1000 0110 0110 */ - {SKNIT_FEIN, 2, 8, 8,L0|L1}, /* 67: 0100 1000 0110 0111 */ - {SKNIT_FAD, 2, 8, 8,L0|L1}, /* 68: 0100 1000 0110 1000 */ - {SKNIT_FSR, 2, 8, 8,L0|L1}, /* 69: 0100 1000 0110 1001 */ - {SKNIT_FST, 2, 8, 8,L0|L1}, /* 6a: 0100 1000 0110 1010 */ - {SKNIT_ER, 2, 8, 8,L0|L1}, /* 6b: 0100 1000 0110 1011 */ - {SKNIT_OV, 2, 8, 8,L0|L1}, /* 6c: 0100 1000 0110 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6d: 0100 1000 0110 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6e: 0100 1000 0110 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6f: 0100 1000 0110 1111 */ - - {SKNIT_AN4, 2, 8, 8,L0|L1}, /* 70: 0100 1000 0111 0000 */ - {SKNIT_AN5, 2, 8, 8,L0|L1}, /* 71: 0100 1000 0111 0001 */ - {SKNIT_AN6, 2, 8, 8,L0|L1}, /* 72: 0100 1000 0111 0010 */ - {SKNIT_AN7, 2, 8, 8,L0|L1}, /* 73: 0100 1000 0111 0011 */ - {SKNIT_SB, 2, 8, 8,L0|L1}, /* 74: 0100 1000 0111 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 75: 0100 1000 0111 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 76: 0100 1000 0111 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 77: 0100 1000 0111 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 78: 0100 1000 0111 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 79: 0100 1000 0111 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7a: 0100 1000 0111 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7b: 0100 1000 0111 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7c: 0100 1000 0111 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7d: 0100 1000 0111 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7e: 0100 1000 0111 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7f: 0100 1000 0111 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 80: 0100 1000 1000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 81: 0100 1000 1000 0001 */ - {LDEAX_D, 2,14,11,L0|L1}, /* 82: 0100 1000 1000 0010 */ - {LDEAX_H, 2,14,11,L0|L1}, /* 83: 0100 1000 1000 0011 */ - {LDEAX_Dp, 2,14,11,L0|L1}, /* 84: 0100 1000 1000 0100 */ - {LDEAX_Hp, 2,14,11,L0|L1}, /* 85: 0100 1000 1000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 86: 0100 1000 1000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 87: 0100 1000 1000 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 88: 0100 1000 1000 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 89: 0100 1000 1000 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8a: 0100 1000 1000 1010 */ - {LDEAX_D_xx, 3,20,20,L0|L1}, /* 8b: 0100 1000 1000 1011 xxxx xxxx */ - {LDEAX_H_A, 2,20,20,L0|L1}, /* 8c: 0100 1000 1000 1100 */ - {LDEAX_H_B, 2,20,20,L0|L1}, /* 8d: 0100 1000 1000 1101 */ - {LDEAX_H_EA, 2,20,20,L0|L1}, /* 8e: 0100 1000 1000 1110 */ - {LDEAX_H_xx, 3,20,20,L0|L1}, /* 8f: 0100 1000 1000 1111 xxxx xxxx */ - - {illegal2, 2, 8, 8,L0|L1}, /* 90: 0100 1000 1000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 91: 0100 1000 1000 0001 */ - {STEAX_D, 2,14,11,L0|L1}, /* 92: 0100 1000 1000 0010 */ - {STEAX_H, 2,14,11,L0|L1}, /* 93: 0100 1000 1000 0011 */ - {STEAX_Dp, 2,14,11,L0|L1}, /* 94: 0100 1000 1000 0100 */ - {STEAX_Hp, 2,14,11,L0|L1}, /* 95: 0100 1000 1000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 96: 0100 1000 1000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 97: 0100 1000 1000 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 98: 0100 1000 1000 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 99: 0100 1000 1000 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9a: 0100 1000 1000 1010 */ - {STEAX_D_xx, 3,20,20,L0|L1}, /* 9b: 0100 1000 1000 1011 xxxx xxxx */ - {STEAX_H_A, 2,20,20,L0|L1}, /* 9c: 0100 1000 1000 1100 */ - {STEAX_H_B, 2,20,20,L0|L1}, /* 9d: 0100 1000 1000 1101 */ - {STEAX_H_EA, 2,20,20,L0|L1}, /* 9e: 0100 1000 1000 1110 */ - {STEAX_H_xx, 3,20,20,L0|L1}, /* 9f: 0100 1000 1000 1111 xxxx xxxx */ - - {DSLR_EA, 2, 8, 8,L0|L1}, /* a0: 0100 1000 1010 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* a1: 0100 1000 1010 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* a2: 0100 1000 1010 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* a3: 0100 1000 1010 0011 */ - {DSLL_EA, 2, 8, 8,L0|L1}, /* a4: 0100 1000 1010 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* a5: 0100 1000 1010 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* a6: 0100 1000 1010 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* a7: 0100 1000 1010 0111 */ - {TABLE, 2,17,17,L0|L1}, /* a8: 0100 1000 1010 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* a9: 0100 1000 1010 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* aa: 0100 1000 1010 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* ab: 0100 1000 1010 1011 */ -// {illegal2, 2, 8, 8,L0|L1}, /* ac: 0100 1000 1010 1100 */ -// {illegal2, 2, 8, 8,L0|L1}, /* ad: 0100 1000 1010 1101 */ -// {illegal2, 2, 8, 8,L0|L1}, /* ae: 0100 1000 1010 1110 */ -// {illegal2, 2, 8, 8,L0|L1}, /* af: 0100 1000 1010 1111 */ - {EXA, 2, 8, 8,L0|L1}, /* ac: 0100 1000 1010 1100 */ /* 7807 */ - {EXR, 2, 8, 8,L0|L1}, /* ad: 0100 1000 1010 1101 */ /* 7807 */ - {EXH, 2, 8, 8,L0|L1}, /* ae: 0100 1000 1010 1110 */ /* 7807 */ - {EXX, 2, 8, 8,L0|L1}, /* af: 0100 1000 1010 1111 */ /* 7807 */ - {DRLR_EA, 2, 8, 8,L0|L1}, /* b0: 0100 1000 1011 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* b1: 0100 1000 1011 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* b2: 0100 1000 1011 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* b3: 0100 1000 1011 0011 */ - {DRLL_EA, 2, 8, 8,L0|L1}, /* b4: 0100 1000 1011 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* b5: 0100 1000 1011 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* b6: 0100 1000 1011 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* b7: 0100 1000 1011 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* b8: 0100 1000 1011 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* b9: 0100 1000 1011 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* ba: 0100 1000 1011 1010 */ - {STOP, 2,12,12,L0|L1}, /* bb: 0100 1000 1011 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* bc: 0100 1000 1011 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* bd: 0100 1000 1011 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* be: 0100 1000 1011 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* bf: 0100 1000 1011 1111 */ - - {DMOV_EA_ECNT, 2,14,11,L0|L1}, /* c0: 0100 1000 1100 0000 */ - {DMOV_EA_ECPT, 2,14,11,L0|L1}, /* c1: 0100 1000 1100 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* c2: 0100 1000 1100 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* c3: 0100 1000 1100 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* c4: 0100 1000 1100 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* c5: 0100 1000 1100 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* c6: 0100 1000 1100 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* c7: 0100 1000 1100 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* c8: 0100 1000 1100 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* c9: 0100 1000 1100 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* ca: 0100 1000 1100 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* cb: 0100 1000 1100 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* cc: 0100 1000 1100 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* cd: 0100 1000 1100 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* ce: 0100 1000 1100 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* cf: 0100 1000 1100 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* d0: 0100 1000 1101 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* d1: 0100 1000 1101 0001 */ - {DMOV_ETM0_EA, 2,14,11,L0|L1}, /* d2: 0100 1000 1101 0010 */ - {DMOV_ETM1_EA, 2,14,11,L0|L1}, /* d3: 0100 1000 1101 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* d4: 0100 1000 1101 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* d5: 0100 1000 1101 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* d6: 0100 1000 1101 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* d7: 0100 1000 1101 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* d8: 0100 1000 1101 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* d9: 0100 1000 1101 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* da: 0100 1000 1101 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* db: 0100 1000 1101 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* dc: 0100 1000 1101 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* dd: 0100 1000 1101 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* de: 0100 1000 1101 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* df: 0100 1000 1101 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* e0: 0100 1000 1110 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* e1: 0100 1000 1110 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* e2: 0100 1000 1110 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* e3: 0100 1000 1110 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* e4: 0100 1000 1110 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* e5: 0100 1000 1110 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* e6: 0100 1000 1110 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* e7: 0100 1000 1110 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* e8: 0100 1000 1110 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* e9: 0100 1000 1110 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* ea: 0100 1000 1110 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* eb: 0100 1000 1110 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* ec: 0100 1000 1110 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* ed: 0100 1000 1110 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* ee: 0100 1000 1110 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* ef: 0100 1000 1110 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* f0: 0100 1000 1111 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* f1: 0100 1000 1111 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* f2: 0100 1000 1111 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* f3: 0100 1000 1111 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* f4: 0100 1000 1111 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* f5: 0100 1000 1111 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* f6: 0100 1000 1111 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* f7: 0100 1000 1111 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* f8: 0100 1000 1111 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* f9: 0100 1000 1111 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* fa: 0100 1000 1111 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* fb: 0100 1000 1111 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* fc: 0100 1000 1111 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* fd: 0100 1000 1111 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* fe: 0100 1000 1111 1110 */ - {illegal2, 2, 8, 8,L0|L1} /* ff: 0100 1000 1111 1111 */ -}; - -/* prefix 4C */ -static struct opcode_s op4C[256] = -{ - {illegal2, 2, 8, 8,L0|L1}, /* 00: 0100 1100 0000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 01: 0100 1100 0000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 02: 0100 1100 0000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 03: 0100 1100 0000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 04: 0100 1100 0000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 05: 0100 1100 0000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 06: 0100 1100 0000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 07: 0100 1100 0000 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 08: 0100 1100 0000 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 09: 0100 1100 0000 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0a: 0100 1100 0000 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0b: 0100 1100 0000 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0c: 0100 1100 0000 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0d: 0100 1100 0000 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0e: 0100 1100 0000 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0f: 0100 1100 0000 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 10: 0100 1100 0001 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 11: 0100 1100 0001 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 12: 0100 1100 0001 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 13: 0100 1100 0001 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 14: 0100 1100 0001 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 15: 0100 1100 0001 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 16: 0100 1100 0001 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 17: 0100 1100 0001 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 18: 0100 1100 0001 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 19: 0100 1100 0001 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1a: 0100 1100 0001 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1b: 0100 1100 0001 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1c: 0100 1100 0001 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1d: 0100 1100 0001 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1e: 0100 1100 0001 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1f: 0100 1100 0001 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 20: 0100 1100 0010 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 21: 0100 1100 0010 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 22: 0100 1100 0010 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 23: 0100 1100 0010 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 24: 0100 1100 0010 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 25: 0100 1100 0010 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 26: 0100 1100 0010 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 27: 0100 1100 0010 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 28: 0100 1100 0010 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 29: 0100 1100 0010 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2a: 0100 1100 0010 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2b: 0100 1100 0010 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2c: 0100 1100 0010 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2d: 0100 1100 0010 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2e: 0100 1100 0010 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2f: 0100 1100 0010 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 30: 0100 1100 0011 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 31: 0100 1100 0011 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 32: 0100 1100 0011 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 33: 0100 1100 0011 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 34: 0100 1100 0011 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 35: 0100 1100 0011 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 36: 0100 1100 0011 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 37: 0100 1100 0011 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 38: 0100 1100 0011 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 39: 0100 1100 0011 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3a: 0100 1100 0011 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3b: 0100 1100 0011 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3c: 0100 1100 0011 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3d: 0100 1100 0011 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3e: 0100 1100 0011 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3f: 0100 1100 0011 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 40: 0100 1100 0100 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 41: 0100 1100 0100 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 42: 0100 1100 0100 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 43: 0100 1100 0100 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 44: 0100 1100 0100 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 45: 0100 1100 0100 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 46: 0100 1100 0100 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 47: 0100 1100 0100 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 48: 0100 1100 0100 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 49: 0100 1100 0100 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4a: 0100 1100 0100 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4b: 0100 1100 0100 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4c: 0100 1100 0100 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4d: 0100 1100 0100 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4e: 0100 1100 0100 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4f: 0100 1100 0100 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 50: 0100 1100 0101 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 51: 0100 1100 0101 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 52: 0100 1100 0101 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 53: 0100 1100 0101 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 54: 0100 1100 0101 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 55: 0100 1100 0101 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 56: 0100 1100 0101 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 57: 0100 1100 0101 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 58: 0100 1100 0101 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 59: 0100 1100 0101 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5a: 0100 1100 0101 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5b: 0100 1100 0101 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5c: 0100 1100 0101 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5d: 0100 1100 0101 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5e: 0100 1100 0101 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5f: 0100 1100 0101 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 60: 0100 1100 0110 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 61: 0100 1100 0110 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 62: 0100 1100 0110 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 63: 0100 1100 0110 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 64: 0100 1100 0110 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 65: 0100 1100 0110 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 66: 0100 1100 0110 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 67: 0100 1100 0110 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 68: 0100 1100 0110 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 69: 0100 1100 0110 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6a: 0100 1100 0110 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6b: 0100 1100 0110 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6c: 0100 1100 0110 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6d: 0100 1100 0110 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6e: 0100 1100 0110 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6f: 0100 1100 0110 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 70: 0100 1100 0111 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 71: 0100 1100 0111 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 72: 0100 1100 0111 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 73: 0100 1100 0111 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 74: 0100 1100 0111 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 75: 0100 1100 0111 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 76: 0100 1100 0111 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 77: 0100 1100 0111 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 78: 0100 1100 0111 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 79: 0100 1100 0111 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7a: 0100 1100 0111 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7b: 0100 1100 0111 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7c: 0100 1100 0111 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7d: 0100 1100 0111 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7e: 0100 1100 0111 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7f: 0100 1100 0111 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 80: 0100 1100 1000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 81: 0100 1100 1000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 82: 0100 1100 1000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 83: 0100 1100 1000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 84: 0100 1100 1000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 85: 0100 1100 1000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 86: 0100 1100 1000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 87: 0100 1100 1000 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 88: 0100 1100 1000 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 89: 0100 1100 1000 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8a: 0100 1100 1000 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8b: 0100 1100 1000 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8c: 0100 1100 1000 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8d: 0100 1100 1000 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8e: 0100 1100 1000 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8f: 0100 1100 1000 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 90: 0100 1100 1001 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 91: 0100 1100 1001 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 92: 0100 1100 1001 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 93: 0100 1100 1001 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 94: 0100 1100 1001 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 95: 0100 1100 1001 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 96: 0100 1100 1001 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 97: 0100 1100 1001 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 98: 0100 1100 1001 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 99: 0100 1100 1001 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9a: 0100 1100 1001 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9b: 0100 1100 1001 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9c: 0100 1100 1001 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9d: 0100 1100 1001 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9e: 0100 1100 1001 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9f: 0100 1100 1001 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* a0: 0100 1100 1010 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* a1: 0100 1100 1010 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* a2: 0100 1100 1010 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* a3: 0100 1100 1010 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* a4: 0100 1100 1010 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* a5: 0100 1100 1010 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* a6: 0100 1100 1010 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* a7: 0100 1100 1010 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* a8: 0100 1100 1010 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* a9: 0100 1100 1010 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* aa: 0100 1100 1010 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* ab: 0100 1100 1010 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* ac: 0100 1100 1010 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* ad: 0100 1100 1010 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* ae: 0100 1100 1010 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* af: 0100 1100 1010 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* b0: 0100 1100 1011 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* b1: 0100 1100 1011 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* b2: 0100 1100 1011 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* b3: 0100 1100 1011 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* b4: 0100 1100 1011 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* b5: 0100 1100 1011 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* b6: 0100 1100 1011 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* b7: 0100 1100 1011 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* b8: 0100 1100 1011 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* b9: 0100 1100 1011 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* ba: 0100 1100 1011 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* bb: 0100 1100 1011 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* bc: 0100 1100 1011 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* bd: 0100 1100 1011 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* be: 0100 1100 1011 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* bf: 0100 1100 1011 1111 */ - - {MOV_A_PA, 2,10,10,L0|L1}, /* c0: 0100 1100 1100 0000 */ - {MOV_A_PB, 2,10,10,L0|L1}, /* c1: 0100 1100 1100 0001 */ - {MOV_A_PC, 2,10,10,L0|L1}, /* c2: 0100 1100 1100 0010 */ - {MOV_A_PD, 2,10,10,L0|L1}, /* c3: 0100 1100 1100 0011 */ - {illegal2, 2,10,10,L0|L1}, /* c4: 0100 1100 1100 0100 */ - {MOV_A_PF, 2,10,10,L0|L1}, /* c5: 0100 1100 1100 0101 */ - {MOV_A_MKH, 2,10,10,L0|L1}, /* c6: 0100 1100 1100 0110 */ - {MOV_A_MKL, 2,10,10,L0|L1}, /* c7: 0100 1100 1100 0111 */ - {MOV_A_ANM, 2,10,10,L0|L1}, /* c8: 0100 1100 1100 1000 */ - {MOV_A_SMH, 2,10,10,L0|L1}, /* c9: 0100 1100 1100 1001 */ - {illegal2, 2,10,10,L0|L1}, /* ca: 0100 1100 1100 1010 */ - {MOV_A_EOM, 2,10,10,L0|L1}, /* cb: 0100 1100 1100 1011 */ - {illegal2, 2,10,10,L0|L1}, /* cc: 0100 1100 1100 1100 */ - {MOV_A_TMM, 2,10,10,L0|L1}, /* cd: 0100 1100 1100 1101 */ -// {illegal2, 2,10,10,L0|L1}, /* ce: 0100 1100 1100 1110 */ - {MOV_A_PT, 2,10,10,L0|L1}, /* ce: 0100 1100 1100 1110 */ /* 7807 */ - {illegal2, 2,10,10,L0|L1}, /* cf: 0100 1100 1100 1111 */ - - {illegal2, 2,10,10,L0|L1}, /* d0: 0100 1100 1101 0000 */ - {illegal2, 2,10,10,L0|L1}, /* d1: 0100 1100 1101 0001 */ - {illegal2, 2,10,10,L0|L1}, /* d2: 0100 1100 1101 0010 */ - {illegal2, 2,10,10,L0|L1}, /* d3: 0100 1100 1101 0011 */ - {illegal2, 2,10,10,L0|L1}, /* d4: 0100 1100 1101 0100 */ - {illegal2, 2,10,10,L0|L1}, /* d5: 0100 1100 1101 0101 */ - {illegal2, 2,10,10,L0|L1}, /* d6: 0100 1100 1101 0110 */ - {illegal2, 2,10,10,L0|L1}, /* d7: 0100 1100 1101 0111 */ - {illegal2, 2,10,10,L0|L1}, /* d8: 0100 1100 1101 1000 */ - {MOV_A_RXB, 2,10,10,L0|L1}, /* d9: 0100 1100 1101 1001 */ - {illegal2, 2,10,10,L0|L1}, /* da: 0100 1100 1101 1010 */ - {illegal2, 2,10,10,L0|L1}, /* db: 0100 1100 1101 1011 */ - {illegal2, 2,10,10,L0|L1}, /* dc: 0100 1100 1101 1100 */ - {illegal2, 2,10,10,L0|L1}, /* dd: 0100 1100 1101 1101 */ - {illegal2, 2,10,10,L0|L1}, /* de: 0100 1100 1101 1110 */ - {illegal2, 2,10,10,L0|L1}, /* df: 0100 1100 1101 1111 */ - - {MOV_A_CR0, 2,10,10,L0|L1}, /* e0: 0100 1100 1110 0000 */ - {MOV_A_CR1, 2,10,10,L0|L1}, /* e1: 0100 1100 1110 0001 */ - {MOV_A_CR2, 2,10,10,L0|L1}, /* e2: 0100 1100 1110 0010 */ - {MOV_A_CR3, 2,10,10,L0|L1}, /* e3: 0100 1100 1110 0011 */ - {illegal2, 2,10,10,L0|L1}, /* e4: 0100 1100 1110 0100 */ - {illegal2, 2,10,10,L0|L1}, /* e5: 0100 1100 1110 0101 */ - {illegal2, 2,10,10,L0|L1}, /* e6: 0100 1100 1110 0110 */ - {illegal2, 2,10,10,L0|L1}, /* e7: 0100 1100 1110 0111 */ - {illegal2, 2,10,10,L0|L1}, /* e8: 0100 1100 1110 1000 */ - {illegal2, 2,10,10,L0|L1}, /* e9: 0100 1100 1110 1001 */ - {illegal2, 2,10,10,L0|L1}, /* ea: 0100 1100 1110 1010 */ - {illegal2, 2,10,10,L0|L1}, /* eb: 0100 1100 1110 1011 */ - {illegal2, 2,10,10,L0|L1}, /* ec: 0100 1100 1110 1100 */ - {illegal2, 2,10,10,L0|L1}, /* ed: 0100 1100 1110 1101 */ - {illegal2, 2,10,10,L0|L1}, /* ee: 0100 1100 1110 1110 */ - {illegal2, 2,10,10,L0|L1}, /* ef: 0100 1100 1110 1111 */ - - {illegal2, 2,10,10,L0|L1}, /* f0: 0100 1100 1111 0000 */ - {illegal2, 2,10,10,L0|L1}, /* f1: 0100 1100 1111 0001 */ - {illegal2, 2,10,10,L0|L1}, /* f2: 0100 1100 1111 0010 */ - {illegal2, 2,10,10,L0|L1}, /* f3: 0100 1100 1111 0011 */ - {illegal2, 2,10,10,L0|L1}, /* f4: 0100 1100 1111 0100 */ - {illegal2, 2,10,10,L0|L1}, /* f5: 0100 1100 1111 0101 */ - {illegal2, 2,10,10,L0|L1}, /* f6: 0100 1100 1111 0110 */ - {illegal2, 2,10,10,L0|L1}, /* f7: 0100 1100 1111 0111 */ - {illegal2, 2,10,10,L0|L1}, /* f8: 0100 1100 1111 1000 */ - {illegal2, 2,10,10,L0|L1}, /* f9: 0100 1100 1111 1001 */ - {illegal2, 2,10,10,L0|L1}, /* fa: 0100 1100 1111 1010 */ - {illegal2, 2,10,10,L0|L1}, /* fb: 0100 1100 1111 1011 */ - {illegal2, 2,10,10,L0|L1}, /* fc: 0100 1100 1111 1100 */ - {illegal2, 2,10,10,L0|L1}, /* fd: 0100 1100 1111 1101 */ - {illegal2, 2,10,10,L0|L1}, /* fe: 0100 1100 1111 1110 */ - {illegal2, 2,10,10,L0|L1}, /* ff: 0100 1100 1111 1111 */ -}; - -/* prefix 4D */ -static struct opcode_s op4D[256] = -{ - {illegal2, 2, 8, 8,L0|L1}, /* 00: 0100 1101 0000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 01: 0100 1101 0000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 02: 0100 1101 0000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 03: 0100 1101 0000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 04: 0100 1101 0000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 05: 0100 1101 0000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 06: 0100 1101 0000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 07: 0100 1101 0000 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 08: 0100 1101 0000 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 09: 0100 1101 0000 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0a: 0100 1101 0000 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0b: 0100 1101 0000 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0c: 0100 1101 0000 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0d: 0100 1101 0000 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0e: 0100 1101 0000 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0f: 0100 1101 0000 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 10: 0100 1101 0001 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 11: 0100 1101 0001 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 12: 0100 1101 0001 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 13: 0100 1101 0001 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 14: 0100 1101 0001 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 15: 0100 1101 0001 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 16: 0100 1101 0001 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 17: 0100 1101 0001 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 18: 0100 1101 0001 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 19: 0100 1101 0001 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1a: 0100 1101 0001 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1b: 0100 1101 0001 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1c: 0100 1101 0001 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1d: 0100 1101 0001 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1e: 0100 1101 0001 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1f: 0100 1101 0001 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 20: 0100 1101 0010 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 21: 0100 1101 0010 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 22: 0100 1101 0010 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 23: 0100 1101 0010 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 24: 0100 1101 0010 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 25: 0100 1101 0010 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 26: 0100 1101 0010 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 27: 0100 1101 0010 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 28: 0100 1101 0010 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 29: 0100 1101 0010 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2a: 0100 1101 0010 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2b: 0100 1101 0010 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2c: 0100 1101 0010 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2d: 0100 1101 0010 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2e: 0100 1101 0010 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2f: 0100 1101 0010 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 30: 0100 1101 0011 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 31: 0100 1101 0011 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 32: 0100 1101 0011 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 33: 0100 1101 0011 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 34: 0100 1101 0011 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 35: 0100 1101 0011 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 36: 0100 1101 0011 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 37: 0100 1101 0011 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 38: 0100 1101 0011 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 39: 0100 1101 0011 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3a: 0100 1101 0011 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3b: 0100 1101 0011 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3c: 0100 1101 0011 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3d: 0100 1101 0011 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3e: 0100 1101 0011 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3f: 0100 1101 0011 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 40: 0100 1101 0100 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 41: 0100 1101 0100 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 42: 0100 1101 0100 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 43: 0100 1101 0100 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 44: 0100 1101 0100 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 45: 0100 1101 0100 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 46: 0100 1101 0100 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 47: 0100 1101 0100 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 48: 0100 1101 0100 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 49: 0100 1101 0100 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4a: 0100 1101 0100 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4b: 0100 1101 0100 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4c: 0100 1101 0100 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4d: 0100 1101 0100 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4e: 0100 1101 0100 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4f: 0100 1101 0100 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 50: 0100 1101 0101 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 51: 0100 1101 0101 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 52: 0100 1101 0101 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 53: 0100 1101 0101 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 54: 0100 1101 0101 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 55: 0100 1101 0101 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 56: 0100 1101 0101 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 57: 0100 1101 0101 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 58: 0100 1101 0101 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 59: 0100 1101 0101 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5a: 0100 1101 0101 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5b: 0100 1101 0101 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5c: 0100 1101 0101 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5d: 0100 1101 0101 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5e: 0100 1101 0101 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5f: 0100 1101 0101 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 60: 0100 1101 0110 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 61: 0100 1101 0110 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 62: 0100 1101 0110 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 63: 0100 1101 0110 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 64: 0100 1101 0110 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 65: 0100 1101 0110 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 66: 0100 1101 0110 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 67: 0100 1101 0110 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 68: 0100 1101 0110 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 69: 0100 1101 0110 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6a: 0100 1101 0110 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6b: 0100 1101 0110 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6c: 0100 1101 0110 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6d: 0100 1101 0110 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6e: 0100 1101 0110 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 6f: 0100 1101 0110 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 70: 0100 1101 0111 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 71: 0100 1101 0111 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 72: 0100 1101 0111 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 73: 0100 1101 0111 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 74: 0100 1101 0111 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 75: 0100 1101 0111 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 76: 0100 1101 0111 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 77: 0100 1101 0111 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 78: 0100 1101 0111 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 79: 0100 1101 0111 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7a: 0100 1101 0111 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7b: 0100 1101 0111 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7c: 0100 1101 0111 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7d: 0100 1101 0111 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7e: 0100 1101 0111 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 7f: 0100 1101 0111 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 80: 0100 1101 1000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 81: 0100 1101 1000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 82: 0100 1101 1000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 83: 0100 1101 1000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 84: 0100 1101 1000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 85: 0100 1101 1000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 86: 0100 1101 1000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 87: 0100 1101 1000 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 88: 0100 1101 1000 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 89: 0100 1101 1000 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8a: 0100 1101 1000 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8b: 0100 1101 1000 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8c: 0100 1101 1000 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8d: 0100 1101 1000 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8e: 0100 1101 1000 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8f: 0100 1101 1000 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 90: 0100 1101 1001 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 91: 0100 1101 1001 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 92: 0100 1101 1001 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 93: 0100 1101 1001 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 94: 0100 1101 1001 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 95: 0100 1101 1001 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 96: 0100 1101 1001 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 97: 0100 1101 1001 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 98: 0100 1101 1001 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 99: 0100 1101 1001 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9a: 0100 1101 1001 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9b: 0100 1101 1001 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9c: 0100 1101 1001 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9d: 0100 1101 1001 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9e: 0100 1101 1001 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9f: 0100 1101 1001 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* a0: 0100 1101 1010 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* a1: 0100 1101 1010 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* a2: 0100 1101 1010 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* a3: 0100 1101 1010 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* a4: 0100 1101 1010 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* a5: 0100 1101 1010 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* a6: 0100 1101 1010 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* a7: 0100 1101 1010 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* a8: 0100 1101 1010 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* a9: 0100 1101 1010 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* aa: 0100 1101 1010 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* ab: 0100 1101 1010 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* ac: 0100 1101 1010 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* ad: 0100 1101 1010 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* ae: 0100 1101 1010 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* af: 0100 1101 1010 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* b0: 0100 1101 1011 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* b1: 0100 1101 1011 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* b2: 0100 1101 1011 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* b3: 0100 1101 1011 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* b4: 0100 1101 1011 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* b5: 0100 1101 1011 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* b6: 0100 1101 1011 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* b7: 0100 1101 1011 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* b8: 0100 1101 1011 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* b9: 0100 1101 1011 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* ba: 0100 1101 1011 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* bb: 0100 1101 1011 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* bc: 0100 1101 1011 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* bd: 0100 1101 1011 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* be: 0100 1101 1011 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* bf: 0100 1101 1011 1111 */ - - {MOV_PA_A, 2,10,10,L0|L1}, /* c0: 0100 1101 1100 0000 */ - {MOV_PB_A, 2,10,10,L0|L1}, /* c1: 0100 1101 1100 0001 */ - {MOV_PC_A, 2,10,10,L0|L1}, /* c2: 0100 1101 1100 0010 */ - {MOV_PD_A, 2,10,10,L0|L1}, /* c3: 0100 1101 1100 0011 */ - {illegal2, 2,10,10,L0|L1}, /* c4: 0100 1101 1100 0100 */ - {MOV_PF_A, 2,10,10,L0|L1}, /* c5: 0100 1101 1100 0101 */ - {MOV_MKH_A, 2,10,10,L0|L1}, /* c6: 0100 1101 1100 0110 */ - {MOV_MKL_A, 2,10,10,L0|L1}, /* c7: 0100 1101 1100 0111 */ - {MOV_ANM_A, 2,10,10,L0|L1}, /* c8: 0100 1101 1100 1000 */ - {MOV_SMH_A, 2,10,10,L0|L1}, /* c9: 0100 1101 1100 1001 */ - {MOV_SML_A, 2,10,10,L0|L1}, /* ca: 0100 1101 1100 1010 */ - {MOV_EOM_A, 2,10,10,L0|L1}, /* cb: 0100 1101 1100 1011 */ - {MOV_ETMM_A, 2,10,10,L0|L1}, /* cc: 0100 1101 1100 1100 */ - {MOV_TMM_A, 2,10,10,L0|L1}, /* cd: 0100 1101 1100 1101 */ - {illegal2, 2,10,10,L0|L1}, /* ce: 0100 1101 1100 1110 */ - {illegal2, 2,10,10,L0|L1}, /* cf: 0100 1101 1100 1111 */ - - {MOV_MM_A, 2,10,10,L0|L1}, /* d0: 0100 1101 1101 0000 */ - {MOV_MCC_A, 2,10,10,L0|L1}, /* d1: 0100 1101 1101 0001 */ - {MOV_MA_A, 2,10,10,L0|L1}, /* d2: 0100 1101 1101 0010 */ - {MOV_MB_A, 2,10,10,L0|L1}, /* d3: 0100 1101 1101 0011 */ - {MOV_MC_A, 2,10,10,L0|L1}, /* d4: 0100 1101 1101 0100 */ - {illegal2, 2,10,10,L0|L1}, /* d5: 0100 1101 1101 0101 */ - {illegal2, 2,10,10,L0|L1}, /* d6: 0100 1101 1101 0110 */ - {MOV_MF_A, 2,10,10,L0|L1}, /* d7: 0100 1101 1101 0111 */ - {MOV_TXB_A, 2,10,10,L0|L1}, /* d8: 0100 1101 1101 1000 */ - {illegal2, 2,10,10,L0|L1}, /* d9: 0100 1101 1101 1001 */ - {MOV_TM0_A, 2,10,10,L0|L1}, /* da: 0100 1101 1101 1010 */ - {MOV_TM1_A, 2,10,10,L0|L1}, /* db: 0100 1101 1101 1011 */ - {illegal2, 2,10,10,L0|L1}, /* dc: 0100 1101 1101 1100 */ - {illegal2, 2,10,10,L0|L1}, /* dd: 0100 1101 1101 1101 */ - {illegal2, 2,10,10,L0|L1}, /* de: 0100 1101 1101 1110 */ - {illegal2, 2,10,10,L0|L1}, /* df: 0100 1101 1101 1111 */ - - {illegal2, 2,10,10,L0|L1}, /* e0: 0100 1101 1110 0000 */ - {illegal2, 2,10,10,L0|L1}, /* e1: 0100 1101 1110 0001 */ - {illegal2, 2,10,10,L0|L1}, /* e2: 0100 1101 1110 0010 */ - {illegal2, 2,10,10,L0|L1}, /* e3: 0100 1101 1110 0011 */ - {illegal2, 2,10,10,L0|L1}, /* e4: 0100 1101 1110 0100 */ - {illegal2, 2,10,10,L0|L1}, /* e5: 0100 1101 1110 0101 */ - {illegal2, 2,10,10,L0|L1}, /* e6: 0100 1101 1110 0110 */ - {illegal2, 2,10,10,L0|L1}, /* e7: 0100 1101 1110 0111 */ - {MOV_ZCM_A, 2,10,10,L0|L1}, /* e8: 0100 1101 1110 1000 */ - {illegal2, 2,10,10,L0|L1}, /* e9: 0100 1101 1110 1001 */ - {illegal2, 2,10,10,L0|L1}, /* ea: 0100 1101 1110 1010 */ - {illegal2, 2,10,10,L0|L1}, /* eb: 0100 1101 1110 1011 */ - {illegal2, 2,10,10,L0|L1}, /* ec: 0100 1101 1110 1100 */ - {illegal2, 2,10,10,L0|L1}, /* ed: 0100 1101 1110 1101 */ - {illegal2, 2,10,10,L0|L1}, /* ee: 0100 1101 1110 1110 */ - {illegal2, 2,10,10,L0|L1}, /* ef: 0100 1101 1110 1111 */ - - {illegal2, 2,10,10,L0|L1}, /* f0: 0100 1101 1111 0000 */ - {illegal2, 2,10,10,L0|L1}, /* f1: 0100 1101 1111 0001 */ - {illegal2, 2,10,10,L0|L1}, /* f2: 0100 1101 1111 0010 */ - {illegal2, 2,10,10,L0|L1}, /* f3: 0100 1101 1111 0011 */ - {illegal2, 2,10,10,L0|L1}, /* f4: 0100 1101 1111 0100 */ - {illegal2, 2,10,10,L0|L1}, /* f5: 0100 1101 1111 0101 */ - {illegal2, 2,10,10,L0|L1}, /* f6: 0100 1101 1111 0110 */ - {illegal2, 2,10,10,L0|L1}, /* f7: 0100 1101 1111 0111 */ - {illegal2, 2,10,10,L0|L1}, /* f8: 0100 1101 1111 1000 */ - {illegal2, 2,10,10,L0|L1}, /* f9: 0100 1101 1111 1001 */ - {illegal2, 2,10,10,L0|L1}, /* fa: 0100 1101 1111 1010 */ - {illegal2, 2,10,10,L0|L1}, /* fb: 0100 1101 1111 1011 */ - {illegal2, 2,10,10,L0|L1}, /* fc: 0100 1101 1111 1100 */ - {illegal2, 2,10,10,L0|L1}, /* fd: 0100 1101 1111 1101 */ - {illegal2, 2,10,10,L0|L1}, /* fe: 0100 1101 1111 1110 */ - {illegal2, 2,10,10,L0|L1} /* ff: 0100 1101 1111 1111 */ -}; - -/* prefix 60 */ -static struct opcode_s op60[256] = -{ - {illegal2, 2, 8, 8,L0|L1}, /* 00: 0110 0000 0000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 01: 0110 0000 0000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 02: 0110 0000 0000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 03: 0110 0000 0000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 04: 0110 0000 0000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 05: 0110 0000 0000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 06: 0110 0000 0000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 07: 0110 0000 0000 0111 */ - {ANA_V_A, 2, 8, 8,L0|L1}, /* 08: 0110 0000 0000 1000 */ - {ANA_A_A, 2, 8, 8,L0|L1}, /* 09: 0110 0000 0000 1001 */ - {ANA_B_A, 2, 8, 8,L0|L1}, /* 0a: 0110 0000 0000 1010 */ - {ANA_C_A, 2, 8, 8,L0|L1}, /* 0b: 0110 0000 0000 1011 */ - {ANA_D_A, 2, 8, 8,L0|L1}, /* 0c: 0110 0000 0000 1100 */ - {ANA_E_A, 2, 8, 8,L0|L1}, /* 0d: 0110 0000 0000 1101 */ - {ANA_H_A, 2, 8, 8,L0|L1}, /* 0e: 0110 0000 0000 1110 */ - {ANA_L_A, 2, 8, 8,L0|L1}, /* 0f: 0110 0000 0000 1111 */ - - {XRA_V_A, 2, 8, 8,L0|L1}, /* 10: 0110 0000 0001 0000 */ - {XRA_A_A, 2, 8, 8,L0|L1}, /* 11: 0110 0000 0001 0001 */ - {XRA_B_A, 2, 8, 8,L0|L1}, /* 12: 0110 0000 0001 0010 */ - {XRA_C_A, 2, 8, 8,L0|L1}, /* 13: 0110 0000 0001 0011 */ - {XRA_D_A, 2, 8, 8,L0|L1}, /* 14: 0110 0000 0001 0100 */ - {XRA_E_A, 2, 8, 8,L0|L1}, /* 15: 0110 0000 0001 0101 */ - {XRA_H_A, 2, 8, 8,L0|L1}, /* 16: 0110 0000 0001 0110 */ - {XRA_L_A, 2, 8, 8,L0|L1}, /* 17: 0110 0000 0001 0111 */ - {ORA_V_A, 2, 8, 8,L0|L1}, /* 18: 0110 0000 0001 1000 */ - {ORA_A_A, 2, 8, 8,L0|L1}, /* 19: 0110 0000 0001 1001 */ - {ORA_B_A, 2, 8, 8,L0|L1}, /* 1a: 0110 0000 0001 1010 */ - {ORA_C_A, 2, 8, 8,L0|L1}, /* 1b: 0110 0000 0001 1011 */ - {ORA_D_A, 2, 8, 8,L0|L1}, /* 1c: 0110 0000 0001 1100 */ - {ORA_E_A, 2, 8, 8,L0|L1}, /* 1d: 0110 0000 0001 1101 */ - {ORA_H_A, 2, 8, 8,L0|L1}, /* 1e: 0110 0000 0001 1110 */ - {ORA_L_A, 2, 8, 8,L0|L1}, /* 1f: 0110 0000 0001 1111 */ - - {ADDNC_V_A, 2, 8, 8,L0|L1}, /* 20: 0110 0000 0010 0000 */ - {ADDNC_A_A, 2, 8, 8,L0|L1}, /* 21: 0110 0000 0010 0001 */ - {ADDNC_B_A, 2, 8, 8,L0|L1}, /* 22: 0110 0000 0010 0010 */ - {ADDNC_C_A, 2, 8, 8,L0|L1}, /* 23: 0110 0000 0010 0011 */ - {ADDNC_D_A, 2, 8, 8,L0|L1}, /* 24: 0110 0000 0010 0100 */ - {ADDNC_E_A, 2, 8, 8,L0|L1}, /* 25: 0110 0000 0010 0101 */ - {ADDNC_H_A, 2, 8, 8,L0|L1}, /* 26: 0110 0000 0010 0110 */ - {ADDNC_L_A, 2, 8, 8,L0|L1}, /* 27: 0110 0000 0010 0111 */ - {GTA_V_A, 2, 8, 8,L0|L1}, /* 28: 0110 0000 0010 1000 */ - {GTA_A_A, 2, 8, 8,L0|L1}, /* 29: 0110 0000 0010 1001 */ - {GTA_B_A, 2, 8, 8,L0|L1}, /* 2a: 0110 0000 0010 1010 */ - {GTA_C_A, 2, 8, 8,L0|L1}, /* 2b: 0110 0000 0010 1011 */ - {GTA_D_A, 2, 8, 8,L0|L1}, /* 2c: 0110 0000 0010 1100 */ - {GTA_E_A, 2, 8, 8,L0|L1}, /* 2d: 0110 0000 0010 1101 */ - {GTA_H_A, 2, 8, 8,L0|L1}, /* 2e: 0110 0000 0010 1110 */ - {GTA_L_A, 2, 8, 8,L0|L1}, /* 2f: 0110 0000 0010 1111 */ - - {SUBNB_V_A, 2, 8, 8,L0|L1}, /* 30: 0110 0000 0011 0000 */ - {SUBNB_A_A, 2, 8, 8,L0|L1}, /* 31: 0110 0000 0011 0001 */ - {SUBNB_B_A, 2, 8, 8,L0|L1}, /* 32: 0110 0000 0011 0010 */ - {SUBNB_C_A, 2, 8, 8,L0|L1}, /* 33: 0110 0000 0011 0011 */ - {SUBNB_D_A, 2, 8, 8,L0|L1}, /* 34: 0110 0000 0011 0100 */ - {SUBNB_E_A, 2, 8, 8,L0|L1}, /* 35: 0110 0000 0011 0101 */ - {SUBNB_H_A, 2, 8, 8,L0|L1}, /* 36: 0110 0000 0011 0110 */ - {SUBNB_L_A, 2, 8, 8,L0|L1}, /* 37: 0110 0000 0011 0111 */ - {LTA_V_A, 2, 8, 8,L0|L1}, /* 38: 0110 0000 0011 1000 */ - {LTA_A_A, 2, 8, 8,L0|L1}, /* 39: 0110 0000 0011 1001 */ - {LTA_B_A, 2, 8, 8,L0|L1}, /* 3a: 0110 0000 0011 1010 */ - {LTA_C_A, 2, 8, 8,L0|L1}, /* 3b: 0110 0000 0011 1011 */ - {LTA_D_A, 2, 8, 8,L0|L1}, /* 3c: 0110 0000 0011 1100 */ - {LTA_E_A, 2, 8, 8,L0|L1}, /* 3d: 0110 0000 0011 1101 */ - {LTA_H_A, 2, 8, 8,L0|L1}, /* 3e: 0110 0000 0011 1110 */ - {LTA_L_A, 2, 8, 8,L0|L1}, /* 3f: 0110 0000 0011 1111 */ - - {ADD_V_A, 2, 8, 8,L0|L1}, /* 40: 0110 0000 0100 0000 */ - {ADD_A_A, 2, 8, 8,L0|L1}, /* 41: 0110 0000 0100 0001 */ - {ADD_B_A, 2, 8, 8,L0|L1}, /* 42: 0110 0000 0100 0010 */ - {ADD_C_A, 2, 8, 8,L0|L1}, /* 43: 0110 0000 0100 0011 */ - {ADD_D_A, 2, 8, 8,L0|L1}, /* 44: 0110 0000 0100 0100 */ - {ADD_E_A, 2, 8, 8,L0|L1}, /* 45: 0110 0000 0100 0101 */ - {ADD_H_A, 2, 8, 8,L0|L1}, /* 46: 0110 0000 0100 0110 */ - {ADD_L_A, 2, 8, 8,L0|L1}, /* 47: 0110 0000 0100 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 48: 0110 0000 0100 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 49: 0110 0000 0100 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4a: 0110 0000 0100 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4b: 0110 0000 0100 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4c: 0110 0000 0100 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4d: 0110 0000 0100 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4e: 0110 0000 0100 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4f: 0110 0000 0100 1111 */ - - {ADC_V_A, 2, 8, 8,L0|L1}, /* 50: 0110 0000 0101 0000 */ - {ADC_A_A, 2, 8, 8,L0|L1}, /* 51: 0110 0000 0101 0001 */ - {ADC_B_A, 2, 8, 8,L0|L1}, /* 52: 0110 0000 0101 0010 */ - {ADC_C_A, 2, 8, 8,L0|L1}, /* 53: 0110 0000 0101 0011 */ - {ADC_D_A, 2, 8, 8,L0|L1}, /* 54: 0110 0000 0101 0100 */ - {ADC_E_A, 2, 8, 8,L0|L1}, /* 55: 0110 0000 0101 0101 */ - {ADC_H_A, 2, 8, 8,L0|L1}, /* 56: 0110 0000 0101 0110 */ - {ADC_L_A, 2, 8, 8,L0|L1}, /* 57: 0110 0000 0101 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 58: 0110 0000 0101 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 59: 0110 0000 0101 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5a: 0110 0000 0101 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5b: 0110 0000 0101 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5c: 0110 0000 0101 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5d: 0110 0000 0101 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5e: 0110 0000 0101 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5f: 0110 0000 0101 1111 */ - - {SUB_V_A, 2, 8, 8,L0|L1}, /* 60: 0110 0000 0110 0000 */ - {SUB_A_A, 2, 8, 8,L0|L1}, /* 61: 0110 0000 0110 0001 */ - {SUB_B_A, 2, 8, 8,L0|L1}, /* 62: 0110 0000 0110 0010 */ - {SUB_C_A, 2, 8, 8,L0|L1}, /* 63: 0110 0000 0110 0011 */ - {SUB_D_A, 2, 8, 8,L0|L1}, /* 64: 0110 0000 0110 0100 */ - {SUB_E_A, 2, 8, 8,L0|L1}, /* 65: 0110 0000 0110 0101 */ - {SUB_H_A, 2, 8, 8,L0|L1}, /* 66: 0110 0000 0110 0110 */ - {SUB_L_A, 2, 8, 8,L0|L1}, /* 67: 0110 0000 0110 0111 */ - {NEA_V_A, 2, 8, 8,L0|L1}, /* 68: 0110 0000 0110 1000 */ - {NEA_A_A, 2, 8, 8,L0|L1}, /* 69: 0110 0000 0110 1001 */ - {NEA_B_A, 2, 8, 8,L0|L1}, /* 6a: 0110 0000 0110 1010 */ - {NEA_C_A, 2, 8, 8,L0|L1}, /* 6b: 0110 0000 0110 1011 */ - {NEA_D_A, 2, 8, 8,L0|L1}, /* 6c: 0110 0000 0110 1100 */ - {NEA_E_A, 2, 8, 8,L0|L1}, /* 6d: 0110 0000 0110 1101 */ - {NEA_H_A, 2, 8, 8,L0|L1}, /* 6e: 0110 0000 0110 1110 */ - {NEA_L_A, 2, 8, 8,L0|L1}, /* 6f: 0110 0000 0110 1111 */ - - {SBB_V_A, 2, 8, 8,L0|L1}, /* 70: 0110 0000 0111 0000 */ - {SBB_A_A, 2, 8, 8,L0|L1}, /* 71: 0110 0000 0111 0001 */ - {SBB_B_A, 2, 8, 8,L0|L1}, /* 72: 0110 0000 0111 0010 */ - {SBB_C_A, 2, 8, 8,L0|L1}, /* 73: 0110 0000 0111 0011 */ - {SBB_D_A, 2, 8, 8,L0|L1}, /* 74: 0110 0000 0111 0100 */ - {SBB_E_A, 2, 8, 8,L0|L1}, /* 75: 0110 0000 0111 0101 */ - {SBB_H_A, 2, 8, 8,L0|L1}, /* 76: 0110 0000 0111 0110 */ - {SBB_L_A, 2, 8, 8,L0|L1}, /* 77: 0110 0000 0111 0111 */ - {EQA_V_A, 2, 8, 8,L0|L1}, /* 78: 0110 0000 0111 1000 */ - {EQA_A_A, 2, 8, 8,L0|L1}, /* 79: 0110 0000 0111 1001 */ - {EQA_B_A, 2, 8, 8,L0|L1}, /* 7a: 0110 0000 0111 1010 */ - {EQA_C_A, 2, 8, 8,L0|L1}, /* 7b: 0110 0000 0111 1011 */ - {EQA_D_A, 2, 8, 8,L0|L1}, /* 7c: 0110 0000 0111 1100 */ - {EQA_E_A, 2, 8, 8,L0|L1}, /* 7d: 0110 0000 0111 1101 */ - {EQA_H_A, 2, 8, 8,L0|L1}, /* 7e: 0110 0000 0111 1110 */ - {EQA_L_A, 2, 8, 8,L0|L1}, /* 7f: 0110 0000 0111 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 80: 0110 0000 1000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 81: 0110 0000 1000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 82: 0110 0000 1000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 83: 0110 0000 1000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 84: 0110 0000 1000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 85: 0110 0000 1000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 86: 0110 0000 1000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 87: 0110 0000 1000 0111 */ - {ANA_A_V, 2, 8, 8,L0|L1}, /* 88: 0110 0000 1000 1000 */ - {ANA_A_A, 2, 8, 8,L0|L1}, /* 89: 0110 0000 1000 1001 */ - {ANA_A_B, 2, 8, 8,L0|L1}, /* 8a: 0110 0000 1000 1010 */ - {ANA_A_C, 2, 8, 8,L0|L1}, /* 8b: 0110 0000 1000 1011 */ - {ANA_A_D, 2, 8, 8,L0|L1}, /* 8c: 0110 0000 1000 1100 */ - {ANA_A_E, 2, 8, 8,L0|L1}, /* 8d: 0110 0000 1000 1101 */ - {ANA_A_H, 2, 8, 8,L0|L1}, /* 8e: 0110 0000 1000 1110 */ - {ANA_A_L, 2, 8, 8,L0|L1}, /* 8f: 0110 0000 1000 1111 */ - - {XRA_A_V, 2, 8, 8,L0|L1}, /* 90: 0110 0000 1001 0000 */ - {XRA_A_A, 2, 8, 8,L0|L1}, /* 91: 0110 0000 1001 0001 */ - {XRA_A_B, 2, 8, 8,L0|L1}, /* 92: 0110 0000 1001 0010 */ - {XRA_A_C, 2, 8, 8,L0|L1}, /* 93: 0110 0000 1001 0011 */ - {XRA_A_D, 2, 8, 8,L0|L1}, /* 94: 0110 0000 1001 0100 */ - {XRA_A_E, 2, 8, 8,L0|L1}, /* 95: 0110 0000 1001 0101 */ - {XRA_A_H, 2, 8, 8,L0|L1}, /* 96: 0110 0000 1001 0110 */ - {XRA_A_L, 2, 8, 8,L0|L1}, /* 97: 0110 0000 1001 0111 */ - {ORA_A_V, 2, 8, 8,L0|L1}, /* 98: 0110 0000 1001 1000 */ - {ORA_A_A, 2, 8, 8,L0|L1}, /* 99: 0110 0000 1001 1001 */ - {ORA_A_B, 2, 8, 8,L0|L1}, /* 9a: 0110 0000 1001 1010 */ - {ORA_A_C, 2, 8, 8,L0|L1}, /* 9b: 0110 0000 1001 1011 */ - {ORA_A_D, 2, 8, 8,L0|L1}, /* 9c: 0110 0000 1001 1100 */ - {ORA_A_E, 2, 8, 8,L0|L1}, /* 9d: 0110 0000 1001 1101 */ - {ORA_A_H, 2, 8, 8,L0|L1}, /* 9e: 0110 0000 1001 1110 */ - {ORA_A_L, 2, 8, 8,L0|L1}, /* 9f: 0110 0000 1001 1111 */ - - {ADDNC_A_V, 2, 8, 8,L0|L1}, /* a0: 0110 0000 1010 0000 */ - {ADDNC_A_A, 2, 8, 8,L0|L1}, /* a1: 0110 0000 1010 0001 */ - {ADDNC_A_B, 2, 8, 8,L0|L1}, /* a2: 0110 0000 1010 0010 */ - {ADDNC_A_C, 2, 8, 8,L0|L1}, /* a3: 0110 0000 1010 0011 */ - {ADDNC_A_D, 2, 8, 8,L0|L1}, /* a4: 0110 0000 1010 0100 */ - {ADDNC_A_E, 2, 8, 8,L0|L1}, /* a5: 0110 0000 1010 0101 */ - {ADDNC_A_H, 2, 8, 8,L0|L1}, /* a6: 0110 0000 1010 0110 */ - {ADDNC_A_L, 2, 8, 8,L0|L1}, /* a7: 0110 0000 1010 0111 */ - {GTA_A_V, 2, 8, 8,L0|L1}, /* a8: 0110 0000 1010 1000 */ - {GTA_A_A, 2, 8, 8,L0|L1}, /* a9: 0110 0000 1010 1001 */ - {GTA_A_B, 2, 8, 8,L0|L1}, /* aa: 0110 0000 1010 1010 */ - {GTA_A_C, 2, 8, 8,L0|L1}, /* ab: 0110 0000 1010 1011 */ - {GTA_A_D, 2, 8, 8,L0|L1}, /* ac: 0110 0000 1010 1100 */ - {GTA_A_E, 2, 8, 8,L0|L1}, /* ad: 0110 0000 1010 1101 */ - {GTA_A_H, 2, 8, 8,L0|L1}, /* ae: 0110 0000 1010 1110 */ - {GTA_A_L, 2, 8, 8,L0|L1}, /* af: 0110 0000 1010 1111 */ - - {SUBNB_A_V, 2, 8, 8,L0|L1}, /* b0: 0110 0000 1011 0000 */ - {SUBNB_A_A, 2, 8, 8,L0|L1}, /* b1: 0110 0000 1011 0001 */ - {SUBNB_A_B, 2, 8, 8,L0|L1}, /* b2: 0110 0000 1011 0010 */ - {SUBNB_A_C, 2, 8, 8,L0|L1}, /* b3: 0110 0000 1011 0011 */ - {SUBNB_A_D, 2, 8, 8,L0|L1}, /* b4: 0110 0000 1011 0100 */ - {SUBNB_A_E, 2, 8, 8,L0|L1}, /* b5: 0110 0000 1011 0101 */ - {SUBNB_A_H, 2, 8, 8,L0|L1}, /* b6: 0110 0000 1011 0110 */ - {SUBNB_A_L, 2, 8, 8,L0|L1}, /* b7: 0110 0000 1011 0111 */ - {LTA_A_V, 2, 8, 8,L0|L1}, /* b8: 0110 0000 1011 1000 */ - {LTA_A_A, 2, 8, 8,L0|L1}, /* b9: 0110 0000 1011 1001 */ - {LTA_A_B, 2, 8, 8,L0|L1}, /* ba: 0110 0000 1011 1010 */ - {LTA_A_C, 2, 8, 8,L0|L1}, /* bb: 0110 0000 1011 1011 */ - {LTA_A_D, 2, 8, 8,L0|L1}, /* bc: 0110 0000 1011 1100 */ - {LTA_A_E, 2, 8, 8,L0|L1}, /* bd: 0110 0000 1011 1101 */ - {LTA_A_H, 2, 8, 8,L0|L1}, /* be: 0110 0000 1011 1110 */ - {LTA_A_L, 2, 8, 8,L0|L1}, /* bf: 0110 0000 1011 1111 */ - - {ADD_A_V, 2, 8, 8,L0|L1}, /* c0: 0110 0000 1100 0000 */ - {ADD_A_A, 2, 8, 8,L0|L1}, /* c1: 0110 0000 1100 0001 */ - {ADD_A_B, 2, 8, 8,L0|L1}, /* c2: 0110 0000 1100 0010 */ - {ADD_A_C, 2, 8, 8,L0|L1}, /* c3: 0110 0000 1100 0011 */ - {ADD_A_D, 2, 8, 8,L0|L1}, /* c4: 0110 0000 1100 0100 */ - {ADD_A_E, 2, 8, 8,L0|L1}, /* c5: 0110 0000 1100 0101 */ - {ADD_A_H, 2, 8, 8,L0|L1}, /* c6: 0110 0000 1100 0110 */ - {ADD_A_L, 2, 8, 8,L0|L1}, /* c7: 0110 0000 1100 0111 */ - {ONA_A_V, 2, 8, 8,L0|L1}, /* c8: 0110 0000 1100 1000 */ - {ONA_A_A, 2, 8, 8,L0|L1}, /* c9: 0110 0000 1100 1001 */ - {ONA_A_B, 2, 8, 8,L0|L1}, /* ca: 0110 0000 1100 1010 */ - {ONA_A_C, 2, 8, 8,L0|L1}, /* cb: 0110 0000 1100 1011 */ - {ONA_A_D, 2, 8, 8,L0|L1}, /* cc: 0110 0000 1100 1100 */ - {ONA_A_E, 2, 8, 8,L0|L1}, /* cd: 0110 0000 1100 1101 */ - {ONA_A_H, 2, 8, 8,L0|L1}, /* ce: 0110 0000 1100 1110 */ - {ONA_A_L, 2, 8, 8,L0|L1}, /* cf: 0110 0000 1100 1111 */ - - {ADC_A_V, 2, 8, 8,L0|L1}, /* d0: 0110 0000 1101 0000 */ - {ADC_A_A, 2, 8, 8,L0|L1}, /* d1: 0110 0000 1101 0001 */ - {ADC_A_B, 2, 8, 8,L0|L1}, /* d2: 0110 0000 1101 0010 */ - {ADC_A_C, 2, 8, 8,L0|L1}, /* d3: 0110 0000 1101 0011 */ - {ADC_A_D, 2, 8, 8,L0|L1}, /* d4: 0110 0000 1101 0100 */ - {ADC_A_E, 2, 8, 8,L0|L1}, /* d5: 0110 0000 1101 0101 */ - {ADC_A_H, 2, 8, 8,L0|L1}, /* d6: 0110 0000 1101 0110 */ - {ADC_A_L, 2, 8, 8,L0|L1}, /* d7: 0110 0000 1101 0111 */ - {OFFA_A_V, 2, 8, 8,L0|L1}, /* d8: 0110 0000 1101 1000 */ - {OFFA_A_A, 2, 8, 8,L0|L1}, /* d9: 0110 0000 1101 1001 */ - {OFFA_A_B, 2, 8, 8,L0|L1}, /* da: 0110 0000 1101 1010 */ - {OFFA_A_C, 2, 8, 8,L0|L1}, /* db: 0110 0000 1101 1011 */ - {OFFA_A_D, 2, 8, 8,L0|L1}, /* dc: 0110 0000 1101 1100 */ - {OFFA_A_E, 2, 8, 8,L0|L1}, /* dd: 0110 0000 1101 1101 */ - {OFFA_A_H, 2, 8, 8,L0|L1}, /* de: 0110 0000 1101 1110 */ - {OFFA_A_L, 2, 8, 8,L0|L1}, /* df: 0110 0000 1101 1111 */ - - {SUB_A_V, 2, 8, 8,L0|L1}, /* e0: 0110 0000 1110 0000 */ - {SUB_A_A, 2, 8, 8,L0|L1}, /* e1: 0110 0000 1110 0001 */ - {SUB_A_B, 2, 8, 8,L0|L1}, /* e2: 0110 0000 1110 0010 */ - {SUB_A_C, 2, 8, 8,L0|L1}, /* e3: 0110 0000 1110 0011 */ - {SUB_A_D, 2, 8, 8,L0|L1}, /* e4: 0110 0000 1110 0100 */ - {SUB_A_E, 2, 8, 8,L0|L1}, /* e5: 0110 0000 1110 0101 */ - {SUB_A_H, 2, 8, 8,L0|L1}, /* e6: 0110 0000 1110 0110 */ - {SUB_A_L, 2, 8, 8,L0|L1}, /* e7: 0110 0000 1110 0111 */ - {NEA_A_V, 2, 8, 8,L0|L1}, /* e8: 0110 0000 1110 1000 */ - {NEA_A_A, 2, 8, 8,L0|L1}, /* e9: 0110 0000 1110 1001 */ - {NEA_A_B, 2, 8, 8,L0|L1}, /* ea: 0110 0000 1110 1010 */ - {NEA_A_C, 2, 8, 8,L0|L1}, /* eb: 0110 0000 1110 1011 */ - {NEA_A_D, 2, 8, 8,L0|L1}, /* ec: 0110 0000 1110 1100 */ - {NEA_A_E, 2, 8, 8,L0|L1}, /* ed: 0110 0000 1110 1101 */ - {NEA_A_H, 2, 8, 8,L0|L1}, /* ee: 0110 0000 1110 1110 */ - {NEA_A_L, 2, 8, 8,L0|L1}, /* ef: 0110 0000 1110 1111 */ - - {SBB_A_V, 2, 8, 8,L0|L1}, /* f0: 0110 0000 1111 0000 */ - {SBB_A_A, 2, 8, 8,L0|L1}, /* f1: 0110 0000 1111 0001 */ - {SBB_A_B, 2, 8, 8,L0|L1}, /* f2: 0110 0000 1111 0010 */ - {SBB_A_C, 2, 8, 8,L0|L1}, /* f3: 0110 0000 1111 0011 */ - {SBB_A_D, 2, 8, 8,L0|L1}, /* f4: 0110 0000 1111 0100 */ - {SBB_A_E, 2, 8, 8,L0|L1}, /* f5: 0110 0000 1111 0101 */ - {SBB_A_H, 2, 8, 8,L0|L1}, /* f6: 0110 0000 1111 0110 */ - {SBB_A_L, 2, 8, 8,L0|L1}, /* f7: 0110 0000 1111 0111 */ - {EQA_A_V, 2, 8, 8,L0|L1}, /* f8: 0110 0000 1111 1000 */ - {EQA_A_A, 2, 8, 8,L0|L1}, /* f9: 0110 0000 1111 1001 */ - {EQA_A_B, 2, 8, 8,L0|L1}, /* fa: 0110 0000 1111 1010 */ - {EQA_A_C, 2, 8, 8,L0|L1}, /* fb: 0110 0000 1111 1011 */ - {EQA_A_D, 2, 8, 8,L0|L1}, /* fc: 0110 0000 1111 1100 */ - {EQA_A_E, 2, 8, 8,L0|L1}, /* fd: 0110 0000 1111 1101 */ - {EQA_A_H, 2, 8, 8,L0|L1}, /* fe: 0110 0000 1111 1110 */ - {EQA_A_L, 2, 8, 8,L0|L1} /* ff: 0110 0000 1111 1111 */ -}; - -/* prefix 64 */ -static struct opcode_s op64[256] = -{ - {MVI_PA_xx, 3,14,11,L0|L1}, /* 00: 0110 0100 0000 0000 xxxx xxxx */ - {MVI_PB_xx, 3,14,11,L0|L1}, /* 01: 0110 0100 0000 0001 xxxx xxxx */ - {MVI_PC_xx, 3,14,11,L0|L1}, /* 02: 0110 0100 0000 0010 xxxx xxxx */ - {MVI_PD_xx, 3,14,11,L0|L1}, /* 03: 0110 0100 0000 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 04: 0110 0100 0000 0100 xxxx xxxx */ - {MVI_PF_xx, 3,14,11,L0|L1}, /* 05: 0110 0100 0000 0101 xxxx xxxx */ - {MVI_MKH_xx, 3,14,11,L0|L1}, /* 06: 0110 0100 0000 0110 xxxx xxxx */ - {MVI_MKL_xx, 3,14,11,L0|L1}, /* 07: 0110 0100 0000 0111 xxxx xxxx */ - {ANI_PA_xx, 3,20,11,L0|L1}, /* 08: 0110 0100 0000 1000 xxxx xxxx */ - {ANI_PB_xx, 3,20,11,L0|L1}, /* 09: 0110 0100 0000 1001 xxxx xxxx */ - {ANI_PC_xx, 3,20,11,L0|L1}, /* 0a: 0110 0100 0000 1010 xxxx xxxx */ - {ANI_PD_xx, 3,20,11,L0|L1}, /* 0b: 0110 0100 0000 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 0c: 0110 0100 0000 1100 xxxx xxxx */ - {ANI_PF_xx, 3,20,11,L0|L1}, /* 0d: 0110 0100 0000 1101 xxxx xxxx */ - {ANI_MKH_xx, 3,20,11,L0|L1}, /* 0e: 0110 0100 0000 1110 xxxx xxxx */ - {ANI_MKL_xx, 3,20,11,L0|L1}, /* 0f: 0110 0100 0000 1111 xxxx xxxx */ - - {XRI_PA_xx, 3,20,11,L0|L1}, /* 10: 0110 0100 0001 0000 xxxx xxxx */ - {XRI_PB_xx, 3,20,11,L0|L1}, /* 11: 0110 0100 0001 0001 xxxx xxxx */ - {XRI_PC_xx, 3,20,11,L0|L1}, /* 12: 0110 0100 0001 0010 xxxx xxxx */ - {XRI_PD_xx, 3,20,11,L0|L1}, /* 13: 0110 0100 0001 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 14: 0110 0100 0001 0100 xxxx xxxx */ - {XRI_PF_xx, 3,20,11,L0|L1}, /* 15: 0110 0100 0001 0101 xxxx xxxx */ - {XRI_MKH_xx, 3,20,11,L0|L1}, /* 16: 0110 0100 0001 0110 xxxx xxxx */ - {XRI_MKL_xx, 3,20,11,L0|L1}, /* 17: 0110 0100 0001 0111 xxxx xxxx */ - {ORI_PA_xx, 3,20,11,L0|L1}, /* 18: 0110 0100 0001 1000 xxxx xxxx */ - {ORI_PB_xx, 3,20,11,L0|L1}, /* 19: 0110 0100 0001 1001 xxxx xxxx */ - {ORI_PC_xx, 3,20,11,L0|L1}, /* 1a: 0110 0100 0001 1010 xxxx xxxx */ - {ORI_PD_xx, 3,20,11,L0|L1}, /* 1b: 0110 0100 0001 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 1c: 0110 0100 0001 1100 xxxx xxxx */ - {ORI_PF_xx, 3,20,11,L0|L1}, /* 1d: 0110 0100 0001 1101 xxxx xxxx */ - {ORI_MKH_xx, 3,20,11,L0|L1}, /* 1e: 0110 0100 0001 1110 xxxx xxxx */ - {ORI_MKL_xx, 3,20,11,L0|L1}, /* 1f: 0110 0100 0001 1111 xxxx xxxx */ - - {ADINC_PA_xx, 3,20,11,L0|L1}, /* 20: 0110 0100 0010 0000 xxxx xxxx */ - {ADINC_PB_xx, 3,20,11,L0|L1}, /* 21: 0110 0100 0010 0001 xxxx xxxx */ - {ADINC_PC_xx, 3,20,11,L0|L1}, /* 22: 0110 0100 0010 0010 xxxx xxxx */ - {ADINC_PD_xx, 3,20,11,L0|L1}, /* 23: 0110 0100 0010 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 24: 0110 0100 0010 0100 xxxx xxxx */ - {ADINC_PF_xx, 3,20,11,L0|L1}, /* 25: 0110 0100 0010 0101 xxxx xxxx */ - {ADINC_MKH_xx, 3,20,11,L0|L1}, /* 26: 0110 0100 0010 0110 xxxx xxxx */ - {ADINC_MKL_xx, 3,20,11,L0|L1}, /* 27: 0110 0100 0010 0111 xxxx xxxx */ - {GTI_PA_xx, 3,20,11,L0|L1}, /* 28: 0110 0100 0010 1000 xxxx xxxx */ - {GTI_PB_xx, 3,20,11,L0|L1}, /* 29: 0110 0100 0010 1001 xxxx xxxx */ - {GTI_PC_xx, 3,20,11,L0|L1}, /* 2a: 0110 0100 0010 1010 xxxx xxxx */ - {GTI_PD_xx, 3,20,11,L0|L1}, /* 2b: 0110 0100 0010 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 2c: 0110 0100 0010 1100 xxxx xxxx */ - {GTI_PF_xx, 3,20,11,L0|L1}, /* 2d: 0110 0100 0010 1101 xxxx xxxx */ - {GTI_MKH_xx, 3,20,11,L0|L1}, /* 2e: 0110 0100 0010 1110 xxxx xxxx */ - {GTI_MKL_xx, 3,20,11,L0|L1}, /* 2f: 0110 0100 0010 1111 xxxx xxxx */ - - {SUINB_PA_xx, 3,20,11,L0|L1}, /* 30: 0110 0100 0011 0000 xxxx xxxx */ - {SUINB_PB_xx, 3,20,11,L0|L1}, /* 31: 0110 0100 0011 0001 xxxx xxxx */ - {SUINB_PC_xx, 3,20,11,L0|L1}, /* 32: 0110 0100 0011 0010 xxxx xxxx */ - {SUINB_PD_xx, 3,20,11,L0|L1}, /* 33: 0110 0100 0011 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 34: 0110 0100 0011 0100 xxxx xxxx */ - {SUINB_PF_xx, 3,20,11,L0|L1}, /* 35: 0110 0100 0011 0101 xxxx xxxx */ - {SUINB_MKH_xx, 3,20,11,L0|L1}, /* 36: 0110 0100 0011 0110 xxxx xxxx */ - {SUINB_MKL_xx, 3,20,11,L0|L1}, /* 37: 0110 0100 0011 0111 xxxx xxxx */ - {LTI_PA_xx, 3,20,11,L0|L1}, /* 38: 0110 0100 0011 1000 xxxx xxxx */ - {LTI_PB_xx, 3,20,11,L0|L1}, /* 39: 0110 0100 0011 1001 xxxx xxxx */ - {LTI_PC_xx, 3,20,11,L0|L1}, /* 3a: 0110 0100 0011 1010 xxxx xxxx */ - {LTI_PD_xx, 3,20,11,L0|L1}, /* 3b: 0110 0100 0011 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 3c: 0110 0100 0011 1100 xxxx xxxx */ - {LTI_PF_xx, 3,20,11,L0|L1}, /* 3d: 0110 0100 0011 1101 xxxx xxxx */ - {LTI_MKH_xx, 3,20,11,L0|L1}, /* 3e: 0110 0100 0011 1110 xxxx xxxx */ - {LTI_MKL_xx, 3,20,11,L0|L1}, /* 3f: 0110 0100 0011 1111 xxxx xxxx */ - - {ADI_PA_xx, 3,20,11,L0|L1}, /* 40: 0110 0100 0100 0000 xxxx xxxx */ - {ADI_PB_xx, 3,20,11,L0|L1}, /* 41: 0110 0100 0100 0001 xxxx xxxx */ - {ADI_PC_xx, 3,20,11,L0|L1}, /* 42: 0110 0100 0100 0010 xxxx xxxx */ - {ADI_PD_xx, 3,20,11,L0|L1}, /* 43: 0110 0100 0100 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 44: 0110 0100 0100 0100 xxxx xxxx */ - {ADI_PF_xx, 3,20,11,L0|L1}, /* 45: 0110 0100 0100 0101 xxxx xxxx */ - {ADI_MKH_xx, 3,20,11,L0|L1}, /* 46: 0110 0100 0100 0110 xxxx xxxx */ - {ADI_MKL_xx, 3,20,11,L0|L1}, /* 47: 0110 0100 0100 0111 xxxx xxxx */ - {ONI_PA_xx, 3,20,11,L0|L1}, /* 48: 0110 0100 0100 1000 xxxx xxxx */ - {ONI_PB_xx, 3,20,11,L0|L1}, /* 49: 0110 0100 0100 1001 xxxx xxxx */ - {ONI_PC_xx, 3,20,11,L0|L1}, /* 4a: 0110 0100 0100 1010 xxxx xxxx */ - {ONI_PD_xx, 3,20,11,L0|L1}, /* 4b: 0110 0100 0100 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 4c: 0110 0100 0100 1100 xxxx xxxx */ - {ONI_PF_xx, 3,20,11,L0|L1}, /* 4d: 0110 0100 0100 1101 xxxx xxxx */ - {ONI_MKH_xx, 3,20,11,L0|L1}, /* 4e: 0110 0100 0100 1110 xxxx xxxx */ - {ONI_MKL_xx, 3,20,11,L0|L1}, /* 4f: 0110 0100 0100 1111 xxxx xxxx */ - - {ACI_PA_xx, 3,20,11,L0|L1}, /* 50: 0110 0100 0101 0000 xxxx xxxx */ - {ACI_PB_xx, 3,20,11,L0|L1}, /* 51: 0110 0100 0101 0001 xxxx xxxx */ - {ACI_PC_xx, 3,20,11,L0|L1}, /* 52: 0110 0100 0101 0010 xxxx xxxx */ - {ACI_PD_xx, 3,20,11,L0|L1}, /* 53: 0110 0100 0101 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 54: 0110 0100 0101 0100 xxxx xxxx */ - {ACI_PF_xx, 3,20,11,L0|L1}, /* 55: 0110 0100 0101 0101 xxxx xxxx */ - {ACI_MKH_xx, 3,20,11,L0|L1}, /* 56: 0110 0100 0101 0110 xxxx xxxx */ - {ACI_MKL_xx, 3,20,11,L0|L1}, /* 57: 0110 0100 0101 0111 xxxx xxxx */ - {OFFI_PA_xx, 3,20,11,L0|L1}, /* 58: 0110 0100 0101 1000 xxxx xxxx */ - {OFFI_PB_xx, 3,20,11,L0|L1}, /* 59: 0110 0100 0101 1001 xxxx xxxx */ - {OFFI_PC_xx, 3,20,11,L0|L1}, /* 5a: 0110 0100 0101 1010 xxxx xxxx */ - {OFFI_PD_xx, 3,20,11,L0|L1}, /* 5b: 0110 0100 0101 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 5c: 0110 0100 0101 1100 xxxx xxxx */ - {OFFI_PF_xx, 3,20,11,L0|L1}, /* 5d: 0110 0100 0101 1101 xxxx xxxx */ - {OFFI_MKH_xx, 3,20,11,L0|L1}, /* 5e: 0110 0100 0101 1110 xxxx xxxx */ - {OFFI_MKL_xx, 3,20,11,L0|L1}, /* 5f: 0110 0100 0101 1111 xxxx xxxx */ - - {SUI_PA_xx, 3,20,11,L0|L1}, /* 60: 0110 0100 0110 0000 xxxx xxxx */ - {SUI_PB_xx, 3,20,11,L0|L1}, /* 61: 0110 0100 0110 0001 xxxx xxxx */ - {SUI_PC_xx, 3,20,11,L0|L1}, /* 62: 0110 0100 0110 0010 xxxx xxxx */ - {SUI_PD_xx, 3,20,11,L0|L1}, /* 63: 0110 0100 0110 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 64: 0110 0100 0110 0100 xxxx xxxx */ - {SUI_PF_xx, 3,20,11,L0|L1}, /* 65: 0110 0100 0110 0101 xxxx xxxx */ - {SUI_MKH_xx, 3,20,11,L0|L1}, /* 66: 0110 0100 0110 0110 xxxx xxxx */ - {SUI_MKL_xx, 3,20,11,L0|L1}, /* 67: 0110 0100 0110 0111 xxxx xxxx */ - {NEI_PA_xx, 3,20,11,L0|L1}, /* 68: 0110 0100 0110 1000 xxxx xxxx */ - {NEI_PB_xx, 3,20,11,L0|L1}, /* 69: 0110 0100 0110 1001 xxxx xxxx */ - {NEI_PC_xx, 3,20,11,L0|L1}, /* 6a: 0110 0100 0110 1010 xxxx xxxx */ - {NEI_PD_xx, 3,20,11,L0|L1}, /* 6b: 0110 0100 0110 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 6c: 0110 0100 0110 1100 xxxx xxxx */ - {NEI_PF_xx, 3,20,11,L0|L1}, /* 6d: 0110 0100 0110 1101 xxxx xxxx */ - {NEI_MKH_xx, 3,20,11,L0|L1}, /* 6e: 0110 0100 0110 1110 xxxx xxxx */ - {NEI_MKL_xx, 3,20,11,L0|L1}, /* 6f: 0110 0100 0110 1111 xxxx xxxx */ - - {SBI_PA_xx, 3,20,11,L0|L1}, /* 70: 0110 0100 0111 0000 xxxx xxxx */ - {SBI_PB_xx, 3,20,11,L0|L1}, /* 71: 0110 0100 0111 0001 xxxx xxxx */ - {SBI_PC_xx, 3,20,11,L0|L1}, /* 72: 0110 0100 0111 0010 xxxx xxxx */ - {SBI_PD_xx, 3,20,11,L0|L1}, /* 73: 0110 0100 0111 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 74: 0110 0100 0111 0100 xxxx xxxx */ - {SBI_PF_xx, 3,20,11,L0|L1}, /* 75: 0110 0100 0111 0101 xxxx xxxx */ - {SBI_MKH_xx, 3,20,11,L0|L1}, /* 76: 0110 0100 0111 0110 xxxx xxxx */ - {SBI_MKL_xx, 3,20,11,L0|L1}, /* 77: 0110 0100 0111 0111 xxxx xxxx */ - {EQI_PA_xx, 3,20,11,L0|L1}, /* 78: 0110 0100 0111 1000 xxxx xxxx */ - {EQI_PB_xx, 3,20,11,L0|L1}, /* 79: 0110 0100 0111 1001 xxxx xxxx */ - {EQI_PC_xx, 3,20,11,L0|L1}, /* 7a: 0110 0100 0111 1010 xxxx xxxx */ - {EQI_PD_xx, 3,20,11,L0|L1}, /* 7b: 0110 0100 0111 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 7c: 0110 0100 0111 1100 xxxx xxxx */ - {EQI_PF_xx, 3,20,11,L0|L1}, /* 7d: 0110 0100 0111 1101 xxxx xxxx */ - {EQI_MKH_xx, 3,20,11,L0|L1}, /* 7e: 0110 0100 0111 1110 xxxx xxxx */ - {EQI_MKL_xx, 3,20,11,L0|L1}, /* 7f: 0110 0100 0111 1111 xxxx xxxx */ - - {MVI_ANM_xx, 3,14,11,L0|L1}, /* 80: 0110 0100 1000 0000 xxxx xxxx */ - {MVI_SMH_xx, 3,14,11,L0|L1}, /* 81: 0110 0100 1000 0001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 82: 0110 0100 1000 0010 xxxx xxxx */ - {MVI_EOM_xx, 3,14,11,L0|L1}, /* 83: 0110 0100 1000 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 84: 0110 0100 1000 0100 xxxx xxxx */ - {MVI_TMM_xx, 3,14,11,L0|L1}, /* 85: 0110 0100 1000 0101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 86: 0110 0100 1000 0110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 87: 0110 0100 1000 0111 xxxx xxxx */ - {ANI_ANM_xx, 3,20,11,L0|L1}, /* 88: 0110 0100 1000 1000 xxxx xxxx */ - {ANI_SMH_xx, 3,20,11,L0|L1}, /* 89: 0110 0100 1000 1001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 8a: 0110 0100 1000 1010 xxxx xxxx */ - {ANI_EOM_xx, 3,20,11,L0|L1}, /* 8b: 0110 0100 1000 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 8c: 0110 0100 1000 1100 xxxx xxxx */ - {ANI_TMM_xx, 3,20,11,L0|L1}, /* 8d: 0110 0100 1000 1101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 8e: 0110 0100 1000 1110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 8f: 0110 0100 1000 1111 xxxx xxxx */ - - {XRI_ANM_xx, 3,20,11,L0|L1}, /* 90: 0110 0100 1001 0000 xxxx xxxx */ - {XRI_SMH_xx, 3,20,11,L0|L1}, /* 91: 0110 0100 1001 0001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 92: 0110 0100 1001 0010 xxxx xxxx */ - {XRI_EOM_xx, 3,20,11,L0|L1}, /* 93: 0110 0100 1001 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 94: 0110 0100 1001 0100 xxxx xxxx */ - {XRI_TMM_xx, 3,20,11,L0|L1}, /* 95: 0110 0100 1001 0101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 96: 0110 0100 1001 0110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 97: 0110 0100 1001 0111 xxxx xxxx */ - {ORI_ANM_xx, 3,20,11,L0|L1}, /* 98: 0110 0100 1001 1000 xxxx xxxx */ - {ORI_SMH_xx, 3,20,11,L0|L1}, /* 99: 0110 0100 1001 1001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 9a: 0110 0100 1001 1010 xxxx xxxx */ - {ORI_EOM_xx, 3,20,11,L0|L1}, /* 9b: 0110 0100 1001 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 9c: 0110 0100 1001 1100 xxxx xxxx */ - {ORI_TMM_xx, 3,20,11,L0|L1}, /* 9d: 0110 0100 1001 1101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 9e: 0110 0100 1001 1110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* 9f: 0110 0100 1001 1111 xxxx xxxx */ - - {ADINC_ANM_xx, 3,20,11,L0|L1}, /* a0: 0110 0100 1010 0000 xxxx xxxx */ - {ADINC_SMH_xx, 3,20,11,L0|L1}, /* a1: 0110 0100 1010 0001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* a2: 0110 0100 1010 0010 xxxx xxxx */ - {ADINC_EOM_xx, 3,20,11,L0|L1}, /* a3: 0110 0100 1010 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* a4: 0110 0100 1010 0100 xxxx xxxx */ - {ADINC_TMM_xx, 3,20,11,L0|L1}, /* a5: 0110 0100 1010 0101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* a6: 0110 0100 1010 0110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* a7: 0110 0100 1010 0111 xxxx xxxx */ - {GTI_ANM_xx, 3,20,11,L0|L1}, /* a8: 0110 0100 1010 1000 xxxx xxxx */ - {GTI_SMH_xx, 3,20,11,L0|L1}, /* a9: 0110 0100 1010 1001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* aa: 0110 0100 1010 1010 xxxx xxxx */ - {GTI_EOM_xx, 3,20,11,L0|L1}, /* ab: 0110 0100 1010 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* ac: 0110 0100 1010 1100 xxxx xxxx */ - {GTI_TMM_xx, 3,20,11,L0|L1}, /* ad: 0110 0100 1010 1101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* ae: 0110 0100 1010 1110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* af: 0110 0100 1010 1111 xxxx xxxx */ - - {SUINB_ANM_xx, 3,20,11,L0|L1}, /* b0: 0110 0100 1011 0000 xxxx xxxx */ - {SUINB_SMH_xx, 3,20,11,L0|L1}, /* b1: 0110 0100 1011 0001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* b2: 0110 0100 1011 0010 xxxx xxxx */ - {SUINB_EOM_xx, 3,20,11,L0|L1}, /* b3: 0110 0100 1011 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* b4: 0110 0100 1011 0100 xxxx xxxx */ - {SUINB_TMM_xx, 3,20,11,L0|L1}, /* b5: 0110 0100 1011 0101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* b6: 0110 0100 1011 0110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* b7: 0110 0100 1011 0111 xxxx xxxx */ - {LTI_ANM_xx, 3,20,11,L0|L1}, /* b8: 0110 0100 1011 1000 xxxx xxxx */ - {LTI_SMH_xx, 3,20,11,L0|L1}, /* b9: 0110 0100 1011 1001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* ba: 0110 0100 1011 1010 xxxx xxxx */ - {LTI_EOM_xx, 3,20,11,L0|L1}, /* bb: 0110 0100 1011 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* bc: 0110 0100 1011 1100 xxxx xxxx */ - {LTI_TMM_xx, 3,20,11,L0|L1}, /* bd: 0110 0100 1011 1101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* be: 0110 0100 1011 1110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* bf: 0110 0100 1011 1111 xxxx xxxx */ - - {ADI_ANM_xx, 3,20,11,L0|L1}, /* c0: 0110 0100 1100 0000 xxxx xxxx */ - {ADI_SMH_xx, 3,20,11,L0|L1}, /* c1: 0110 0100 1100 0001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* c2: 0110 0100 1100 0010 xxxx xxxx */ - {ADI_EOM_xx, 3,20,11,L0|L1}, /* c3: 0110 0100 1100 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* c4: 0110 0100 1100 0100 xxxx xxxx */ - {ADI_TMM_xx, 3,20,11,L0|L1}, /* c5: 0110 0100 1100 0101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* c6: 0110 0100 1100 0110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* c7: 0110 0100 1100 0111 xxxx xxxx */ - {ONI_ANM_xx, 3,20,11,L0|L1}, /* c8: 0110 0100 1100 1000 xxxx xxxx */ - {ONI_SMH_xx, 3,20,11,L0|L1}, /* c9: 0110 0100 1100 1001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* ca: 0110 0100 1100 1010 xxxx xxxx */ - {ONI_EOM_xx, 3,20,11,L0|L1}, /* cb: 0110 0100 1100 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* cc: 0110 0100 1100 1100 xxxx xxxx */ - {ONI_TMM_xx, 3,20,11,L0|L1}, /* cd: 0110 0100 1100 1101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* ce: 0110 0100 1100 1110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* cf: 0110 0100 1100 1111 xxxx xxxx */ - - {ACI_ANM_xx, 3,20,11,L0|L1}, /* d0: 0110 0100 1101 0000 xxxx xxxx */ - {ACI_SMH_xx, 3,20,11,L0|L1}, /* d1: 0110 0100 1101 0001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* d2: 0110 0100 1101 0010 xxxx xxxx */ - {ACI_EOM_xx, 3,20,11,L0|L1}, /* d3: 0110 0100 1101 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* d4: 0110 0100 1101 0100 xxxx xxxx */ - {ACI_TMM_xx, 3,20,11,L0|L1}, /* d5: 0110 0100 1101 0101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* d6: 0110 0100 1101 0110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* d7: 0110 0100 1101 0111 xxxx xxxx */ - {OFFI_ANM_xx, 3,20,11,L0|L1}, /* d8: 0110 0100 1101 1000 xxxx xxxx */ - {OFFI_SMH_xx, 3,20,11,L0|L1}, /* d9: 0110 0100 1101 1001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* da: 0110 0100 1101 1010 xxxx xxxx */ - {OFFI_EOM_xx, 3,20,11,L0|L1}, /* db: 0110 0100 1101 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* dc: 0110 0100 1101 1100 xxxx xxxx */ - {OFFI_TMM_xx, 3,20,11,L0|L1}, /* dd: 0110 0100 1101 1101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* de: 0110 0100 1101 1110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* df: 0110 0100 1101 1111 xxxx xxxx */ - - {SUI_ANM_xx, 3,20,11,L0|L1}, /* e0: 0110 0100 1110 0000 xxxx xxxx */ - {SUI_SMH_xx, 3,20,11,L0|L1}, /* e1: 0110 0100 1110 0001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* e2: 0110 0100 1110 0010 xxxx xxxx */ - {SUI_EOM_xx, 3,20,11,L0|L1}, /* e3: 0110 0100 1110 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* e4: 0110 0100 1110 0100 xxxx xxxx */ - {SUI_TMM_xx, 3,20,11,L0|L1}, /* e5: 0110 0100 1110 0101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* e6: 0110 0100 1110 0110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* e7: 0110 0100 1110 0111 xxxx xxxx */ - {NEI_ANM_xx, 3,20,11,L0|L1}, /* e8: 0110 0100 1110 1000 xxxx xxxx */ - {NEI_SMH_xx, 3,20,11,L0|L1}, /* e9: 0110 0100 1110 1001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* ea: 0110 0100 1110 1010 xxxx xxxx */ - {NEI_EOM_xx, 3,20,11,L0|L1}, /* eb: 0110 0100 1110 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* ec: 0110 0100 1110 1100 xxxx xxxx */ - {NEI_TMM_xx, 3,20,11,L0|L1}, /* ed: 0110 0100 1110 1101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* ee: 0110 0100 1110 1110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* ef: 0110 0100 1110 1111 xxxx xxxx */ - - {SBI_ANM_xx, 3,20,11,L0|L1}, /* f0: 0110 0100 1111 0000 xxxx xxxx */ - {SBI_SMH_xx, 3,20,11,L0|L1}, /* f1: 0110 0100 1111 0001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* f2: 0110 0100 1111 0010 xxxx xxxx */ - {SBI_EOM_xx, 3,20,11,L0|L1}, /* f3: 0110 0100 1111 0011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* f4: 0110 0100 1111 0100 xxxx xxxx */ - {SBI_TMM_xx, 3,20,11,L0|L1}, /* f5: 0110 0100 1111 0101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* f6: 0110 0100 1111 0110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* f7: 0110 0100 1111 0111 xxxx xxxx */ - {EQI_ANM_xx, 3,20,11,L0|L1}, /* f8: 0110 0100 1111 1000 xxxx xxxx */ - {EQI_SMH_xx, 3,20,11,L0|L1}, /* f9: 0110 0100 1111 1001 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* fa: 0110 0100 1111 1010 xxxx xxxx */ - {EQI_EOM_xx, 3,20,11,L0|L1}, /* fb: 0110 0100 1111 1011 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* fc: 0110 0100 1111 1100 xxxx xxxx */ - {EQI_TMM_xx, 3,20,11,L0|L1}, /* fd: 0110 0100 1111 1101 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1}, /* fe: 0110 0100 1111 1110 xxxx xxxx */ - {illegal2, 3,11,11,L0|L1} /* ff: 0110 0100 1111 1111 xxxx xxxx */ -}; - -/* prefix 70 */ -static struct opcode_s op70[256] = -{ - {illegal2, 2, 8, 8,L0|L1}, /* 00: 0111 0000 0000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 01: 0111 0000 0000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 02: 0111 0000 0000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 03: 0111 0000 0000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 04: 0111 0000 0000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 05: 0111 0000 0000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 06: 0111 0000 0000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 07: 0111 0000 0000 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 08: 0111 0000 0000 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 09: 0111 0000 0000 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0a: 0111 0000 0000 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0b: 0111 0000 0000 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0c: 0111 0000 0000 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 0d: 0111 0000 0000 1101 */ - {SSPD_w, 4,20,20,L0|L1}, /* 0e: 0111 0000 0000 1110 llll llll hhhh hhhh */ - {LSPD_w, 4,20,20,L0|L1}, /* 0f: 0111 0000 0000 1111 llll llll hhhh hhhh */ - - {illegal2, 2, 8, 8,L0|L1}, /* 10: 0111 0000 0001 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 11: 0111 0000 0001 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 12: 0111 0000 0001 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 13: 0111 0000 0001 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 14: 0111 0000 0001 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 15: 0111 0000 0001 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 16: 0111 0000 0001 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 17: 0111 0000 0001 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 18: 0111 0000 0001 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 19: 0111 0000 0001 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1a: 0111 0000 0001 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1b: 0111 0000 0001 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1c: 0111 0000 0001 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 1d: 0111 0000 0001 1101 */ - {SBCD_w, 4,20,20,L0|L1}, /* 1e: 0111 0000 0001 1110 llll llll hhhh hhhh */ - {LBCD_w, 4,20,20,L0|L1}, /* 1f: 0111 0000 0001 1111 llll llll hhhh hhhh */ - - {illegal2, 2, 8, 8,L0|L1}, /* 20: 0111 0000 0010 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 21: 0111 0000 0010 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 22: 0111 0000 0010 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 23: 0111 0000 0010 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 24: 0111 0000 0010 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 25: 0111 0000 0010 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 26: 0111 0000 0010 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 27: 0111 0000 0010 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 28: 0111 0000 0010 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 29: 0111 0000 0010 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2a: 0111 0000 0010 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2b: 0111 0000 0010 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2c: 0111 0000 0010 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 2d: 0111 0000 0010 1101 */ - {SDED_w, 4,20,20,L0|L1}, /* 2e: 0111 0000 0010 1110 llll llll hhhh hhhh */ - {LDED_w, 4,20,20,L0|L1}, /* 2f: 0111 0000 0010 1111 llll llll hhhh hhhh */ - - {illegal2, 2, 8, 8,L0|L1}, /* 30: 0111 0000 0011 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 31: 0111 0000 0011 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 32: 0111 0000 0011 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 33: 0111 0000 0011 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 34: 0111 0000 0011 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 35: 0111 0000 0011 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 36: 0111 0000 0011 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 37: 0111 0000 0011 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 38: 0111 0000 0011 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 39: 0111 0000 0011 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3a: 0111 0000 0011 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3b: 0111 0000 0011 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3c: 0111 0000 0011 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 3d: 0111 0000 0011 1101 */ - {SHLD_w, 4,20,20,L0|L1}, /* 3e: 0111 0000 0011 1110 llll llll hhhh hhhh */ - {LHLD_w, 4,20,20,L0|L1}, /* 3f: 0111 0000 0011 1111 llll llll hhhh hhhh */ - - {illegal2, 2, 8, 8,L0|L1}, /* 40: 0111 0000 0100 0000 */ - {EADD_EA_A, 2,11,11,L0|L1}, /* 41: 0111 0000 0100 0001 */ - {EADD_EA_B, 2,11,11,L0|L1}, /* 42: 0111 0000 0100 0010 */ - {EADD_EA_C, 2,11,11,L0|L1}, /* 43: 0111 0000 0100 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 44: 0111 0000 0100 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 45: 0111 0000 0100 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 46: 0111 0000 0100 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 47: 0111 0000 0100 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 48: 0111 0000 0100 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 49: 0111 0000 0100 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4a: 0111 0000 0100 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4b: 0111 0000 0100 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4c: 0111 0000 0100 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4d: 0111 0000 0100 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4e: 0111 0000 0100 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 4f: 0111 0000 0100 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 50: 0111 0000 0101 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 51: 0111 0000 0101 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 52: 0111 0000 0101 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 53: 0111 0000 0101 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 54: 0111 0000 0101 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 55: 0111 0000 0101 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 56: 0111 0000 0101 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 57: 0111 0000 0101 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 58: 0111 0000 0101 1000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 59: 0111 0000 0101 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5a: 0111 0000 0101 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5b: 0111 0000 0101 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5c: 0111 0000 0101 1100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5d: 0111 0000 0101 1101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5e: 0111 0000 0101 1110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 5f: 0111 0000 0101 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 60: 0111 0000 0110 0000 */ - {ESUB_EA_A, 2,11,11,L0|L1}, /* 61: 0111 0000 0110 0001 */ - {ESUB_EA_B, 2,11,11,L0|L1}, /* 62: 0111 0000 0110 0010 */ - {ESUB_EA_C, 2,11,11,L0|L1}, /* 63: 0111 0000 0110 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 64: 0111 0000 0110 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 65: 0111 0000 0110 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 66: 0111 0000 0110 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 67: 0111 0000 0110 0111 */ - {MOV_V_w, 4,17,17,L0|L1}, /* 68: 0111 0000 0110 1000 llll llll hhhh hhhh */ - {MOV_A_w, 4,17,17,L0|L1}, /* 69: 0111 0000 0110 1001 llll llll hhhh hhhh */ - {MOV_B_w, 4,17,17,L0|L1}, /* 6a: 0111 0000 0110 1010 llll llll hhhh hhhh */ - {MOV_C_w, 4,17,17,L0|L1}, /* 6b: 0111 0000 0110 1011 llll llll hhhh hhhh */ - {MOV_D_w, 4,17,17,L0|L1}, /* 6c: 0111 0000 0110 1100 llll llll hhhh hhhh */ - {MOV_E_w, 4,17,17,L0|L1}, /* 6d: 0111 0000 0110 1101 llll llll hhhh hhhh */ - {MOV_H_w, 4,17,17,L0|L1}, /* 6e: 0111 0000 0110 1110 llll llll hhhh hhhh */ - {MOV_L_w, 4,17,17,L0|L1}, /* 6f: 0111 0000 0110 1111 llll llll hhhh hhhh */ - - {illegal2, 2, 8, 8,L0|L1}, /* 70: 0111 0000 0111 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 71: 0111 0000 0111 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 72: 0111 0000 0111 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 73: 0111 0000 0111 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 74: 0111 0000 0111 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 75: 0111 0000 0111 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 76: 0111 0000 0111 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 77: 0111 0000 0111 0111 */ - {MOV_w_V, 4,17,17,L0|L1}, /* 78: 0111 0000 0111 1000 llll llll hhhh hhhh */ - {MOV_w_A, 4,17,17,L0|L1}, /* 79: 0111 0000 0111 1001 llll llll hhhh hhhh */ - {MOV_w_B, 4,17,17,L0|L1}, /* 7a: 0111 0000 0111 1010 llll llll hhhh hhhh */ - {MOV_w_C, 4,17,17,L0|L1}, /* 7b: 0111 0000 0111 1011 llll llll hhhh hhhh */ - {MOV_w_D, 4,17,17,L0|L1}, /* 7c: 0111 0000 0111 1100 llll llll hhhh hhhh */ - {MOV_w_E, 4,17,17,L0|L1}, /* 7d: 0111 0000 0111 1101 llll llll hhhh hhhh */ - {MOV_w_H, 4,17,17,L0|L1}, /* 7e: 0111 0000 0111 1110 llll llll hhhh hhhh */ - {MOV_w_L, 4,17,17,L0|L1}, /* 7f: 0111 0000 0111 1111 llll llll hhhh hhhh */ - - {illegal2, 2, 8, 8,L0|L1}, /* 80: 0111 0000 1000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 81: 0111 0000 1000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 82: 0111 0000 1000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 83: 0111 0000 1000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 84: 0111 0000 1000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 85: 0111 0000 1000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 86: 0111 0000 1000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 87: 0111 0000 1000 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 88: 0111 0000 1000 1000 */ - {ANAX_B, 2,11,11,L0|L1}, /* 89: 0111 0000 1000 1001 */ - {ANAX_D, 2,11,11,L0|L1}, /* 8a: 0111 0000 1000 1010 */ - {ANAX_H, 2,11,11,L0|L1}, /* 8b: 0111 0000 1000 1011 */ - {ANAX_Dp, 2,11,11,L0|L1}, /* 8c: 0111 0000 1000 1100 */ - {ANAX_Hp, 2,11,11,L0|L1}, /* 8d: 0111 0000 1000 1101 */ - {ANAX_Dm, 2,11,11,L0|L1}, /* 8e: 0111 0000 1000 1110 */ - {ANAX_Hm, 2,11,11,L0|L1}, /* 8f: 0111 0000 1000 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* 90: 0111 0000 1001 0000 */ - {XRAX_B, 2,11,11,L0|L1}, /* 91: 0111 0000 1001 0001 */ - {XRAX_D, 2,11,11,L0|L1}, /* 92: 0111 0000 1001 0010 */ - {XRAX_H, 2,11,11,L0|L1}, /* 93: 0111 0000 1001 0011 */ - {XRAX_Dp, 2,11,11,L0|L1}, /* 94: 0111 0000 1001 0100 */ - {XRAX_Hp, 2,11,11,L0|L1}, /* 95: 0111 0000 1001 0101 */ - {XRAX_Dm, 2,11,11,L0|L1}, /* 96: 0111 0000 1001 0110 */ - {XRAX_Hm, 2,11,11,L0|L1}, /* 97: 0111 0000 1001 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* 98: 0111 0000 1001 1000 */ -// orax added, timings not verified - {ORAX_B, 2,11, 8,L0|L1}, /* 99: 0111 0000 1001 1001 */ - {ORAX_D, 2,11, 8,L0|L1}, /* 9a: 0111 0000 1001 1010 */ - {ORAX_H, 2,11, 8,L0|L1}, /* 9b: 0111 0000 1001 1011 */ - {ORAX_Dp, 2,11, 8,L0|L1}, /* 9c: 0111 0000 1001 1100 */ - {ORAX_Hp, 2,11, 8,L0|L1}, /* 9d: 0111 0000 1001 1101 */ - {ORAX_Dm, 2,11, 8,L0|L1}, /* 9e: 0111 0000 1001 1110 */ - {ORAX_Hm, 2,11, 8,L0|L1}, /* 9f: 0111 0000 1001 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* a0: 0111 0000 1010 0000 */ - {ADDNCX_B, 2,11, 8,L0|L1}, /* a1: 0111 0000 1010 0001 */ - {ADDNCX_D, 2,11, 8,L0|L1}, /* a2: 0111 0000 1010 0010 */ - {ADDNCX_H, 2,11, 8,L0|L1}, /* a3: 0111 0000 1010 0011 */ - {ADDNCX_Dp, 2,11, 8,L0|L1}, /* a4: 0111 0000 1010 0100 */ - {ADDNCX_Hp, 2,11, 8,L0|L1}, /* a5: 0111 0000 1010 0101 */ - {ADDNCX_Dm, 2,11, 8,L0|L1}, /* a6: 0111 0000 1010 0110 */ - {ADDNCX_Hm, 2,11, 8,L0|L1}, /* a7: 0111 0000 1010 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* a8: 0111 0000 1010 1000 */ - {GTAX_B, 2,11,11,L0|L1}, /* a9: 0111 0000 1010 1001 */ - {GTAX_D, 2,11,11,L0|L1}, /* aa: 0111 0000 1010 1010 */ - {GTAX_H, 2,11,11,L0|L1}, /* ab: 0111 0000 1010 1011 */ - {GTAX_Dp, 2,11,11,L0|L1}, /* ac: 0111 0000 1010 1100 */ - {GTAX_Hp, 2,11,11,L0|L1}, /* ad: 0111 0000 1010 1101 */ - {GTAX_Dm, 2,11,11,L0|L1}, /* ae: 0111 0000 1010 1110 */ - {GTAX_Hm, 2,11,11,L0|L1}, /* af: 0111 0000 1010 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* b0: 0111 0000 1011 0000 */ - {SUBNBX_B, 2,11,11,L0|L1}, /* b1: 0111 0000 1011 0001 */ - {SUBNBX_D, 2,11,11,L0|L1}, /* b2: 0111 0000 1011 0010 */ - {SUBNBX_H, 2,11,11,L0|L1}, /* b3: 0111 0000 1011 0011 */ - {SUBNBX_Dp, 2,11,11,L0|L1}, /* b4: 0111 0000 1011 0100 */ - {SUBNBX_Hp, 2,11,11,L0|L1}, /* b5: 0111 0000 1011 0101 */ - {SUBNBX_Dm, 2,11,11,L0|L1}, /* b6: 0111 0000 1011 0110 */ - {SUBNBX_Hm, 2,11,11,L0|L1}, /* b7: 0111 0000 1011 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* b8: 0111 0000 1011 1000 */ - {LTAX_B, 2,11,11,L0|L1}, /* b9: 0111 0000 1011 1001 */ - {LTAX_D, 2,11,11,L0|L1}, /* ba: 0111 0000 1011 1010 */ - {LTAX_H, 2,11,11,L0|L1}, /* bb: 0111 0000 1011 1011 */ - {LTAX_Dp, 2,11,11,L0|L1}, /* bc: 0111 0000 1011 1100 */ - {LTAX_Hp, 2,11,11,L0|L1}, /* bd: 0111 0000 1011 1101 */ - {LTAX_Dm, 2,11,11,L0|L1}, /* be: 0111 0000 1011 1110 */ - {LTAX_Hm, 2,11,11,L0|L1}, /* bf: 0111 0000 1011 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* c0: 0111 0000 1100 0000 */ - {ADDX_B, 2,11, 8,L0|L1}, /* c1: 0111 0000 1100 0001 */ - {ADDX_D, 2,11, 8,L0|L1}, /* c2: 0111 0000 1100 0010 */ - {ADDX_H, 2,11, 8,L0|L1}, /* c3: 0111 0000 1100 0011 */ - {ADDX_Dp, 2,11, 8,L0|L1}, /* c4: 0111 0000 1100 0100 */ - {ADDX_Hp, 2,11, 8,L0|L1}, /* c5: 0111 0000 1100 0101 */ - {ADDX_Dm, 2,11, 8,L0|L1}, /* c6: 0111 0000 1100 0110 */ - {ADDX_Hm, 2,11, 8,L0|L1}, /* c7: 0111 0000 1100 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* c8: 0111 0000 1100 1000 */ - {ONAX_B, 2,11, 8,L0|L1}, /* c9: 0111 0000 1100 1001 */ - {ONAX_D, 2,11, 8,L0|L1}, /* ca: 0111 0000 1100 1010 */ - {ONAX_H, 2,11, 8,L0|L1}, /* cb: 0111 0000 1100 1011 */ - {ONAX_Dp, 2,11, 8,L0|L1}, /* cc: 0111 0000 1100 1100 */ - {ONAX_Hp, 2,11, 8,L0|L1}, /* cd: 0111 0000 1100 1101 */ - {ONAX_Dm, 2,11, 8,L0|L1}, /* ce: 0111 0000 1100 1110 */ - {ONAX_Hm, 2,11, 8,L0|L1}, /* cf: 0111 0000 1100 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* d0: 0111 0000 1101 0000 */ - {ADCX_B, 2,11, 8,L0|L1}, /* d1: 0111 0000 1101 0001 */ - {ADCX_D, 2,11, 8,L0|L1}, /* d2: 0111 0000 1101 0010 */ - {ADCX_H, 2,11, 8,L0|L1}, /* d3: 0111 0000 1101 0011 */ - {ADCX_Dp, 2,11, 8,L0|L1}, /* d4: 0111 0000 1101 0100 */ - {ADCX_Hp, 2,11, 8,L0|L1}, /* d5: 0111 0000 1101 0101 */ - {ADCX_Dm, 2,11, 8,L0|L1}, /* d6: 0111 0000 1101 0110 */ - {ADCX_Hm, 2,11, 8,L0|L1}, /* d7: 0111 0000 1101 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* d8: 0111 0000 1101 1000 */ - {OFFAX_B, 2,11, 8,L0|L1}, /* d9: 0111 0000 1101 1001 */ - {OFFAX_D, 2,11, 8,L0|L1}, /* da: 0111 0000 1101 1010 */ - {OFFAX_H, 2,11, 8,L0|L1}, /* db: 0111 0000 1101 1011 */ - {OFFAX_Dp, 2,11, 8,L0|L1}, /* dc: 0111 0000 1101 1100 */ - {OFFAX_Hp, 2,11, 8,L0|L1}, /* dd: 0111 0000 1101 1101 */ - {OFFAX_Dm, 2,11, 8,L0|L1}, /* de: 0111 0000 1101 1110 */ - {OFFAX_Hm, 2,11, 8,L0|L1}, /* df: 0111 0000 1101 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* e0: 0111 0000 1110 0000 */ - {SUBX_B, 2,11,11,L0|L1}, /* e1: 0111 0000 1110 0001 */ - {SUBX_D, 2,11,11,L0|L1}, /* e2: 0111 0000 1110 0010 */ - {SUBX_H, 2,11,11,L0|L1}, /* e3: 0111 0000 1110 0011 */ - {SUBX_Dp, 2,11,11,L0|L1}, /* e4: 0111 0000 1110 0100 */ - {SUBX_Hp, 2,11,11,L0|L1}, /* e5: 0111 0000 1110 0101 */ - {SUBX_Dm, 2,11,11,L0|L1}, /* e6: 0111 0000 1110 0110 */ - {SUBX_Hm, 2,11,11,L0|L1}, /* e7: 0111 0000 1110 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* e8: 0111 0000 1110 1000 */ - {NEAX_B, 2,11,11,L0|L1}, /* e9: 0111 0000 1110 1001 */ - {NEAX_D, 2,11,11,L0|L1}, /* ea: 0111 0000 1110 1010 */ - {NEAX_H, 2,11,11,L0|L1}, /* eb: 0111 0000 1110 1011 */ - {NEAX_Dp, 2,11,11,L0|L1}, /* ec: 0111 0000 1110 1100 */ - {NEAX_Hp, 2,11,11,L0|L1}, /* ed: 0111 0000 1110 1101 */ - {NEAX_Dm, 2,11,11,L0|L1}, /* ee: 0111 0000 1110 1110 */ - {NEAX_Hm, 2,11,11,L0|L1}, /* ef: 0111 0000 1110 1111 */ - - {illegal2, 2, 8, 8,L0|L1}, /* f0: 0111 0000 1111 0000 */ - {SBBX_B, 2,11,11,L0|L1}, /* f1: 0111 0000 1111 0001 */ - {SBBX_D, 2,11,11,L0|L1}, /* f2: 0111 0000 1111 0010 */ - {SBBX_H, 2,11,11,L0|L1}, /* f3: 0111 0000 1111 0011 */ - {SBBX_Dp, 2,11,11,L0|L1}, /* f4: 0111 0000 1111 0100 */ - {SBBX_Hp, 2,11,11,L0|L1}, /* f5: 0111 0000 1111 0101 */ - {SBBX_Dm, 2,11,11,L0|L1}, /* f6: 0111 0000 1111 0110 */ - {SBBX_Hm, 2,11,11,L0|L1}, /* f7: 0111 0000 1111 0111 */ - {illegal2, 2, 8, 8,L0|L1}, /* f8: 0111 0000 1111 1000 */ - {EQAX_B, 2,11,11,L0|L1}, /* f9: 0111 0000 1111 1001 */ - {EQAX_D, 2,11,11,L0|L1}, /* fa: 0111 0000 1111 1010 */ - {EQAX_H, 2,11,11,L0|L1}, /* fb: 0111 0000 1111 1011 */ - {EQAX_Dp, 2,11,11,L0|L1}, /* fc: 0111 0000 1111 1100 */ - {EQAX_Hp, 2,11,11,L0|L1}, /* fd: 0111 0000 1111 1101 */ - {EQAX_Dm, 2,11,11,L0|L1}, /* fe: 0111 0000 1111 1110 */ - {EQAX_Hm, 2,11,11,L0|L1} /* ff: 0111 0000 1111 1111 */ -}; - -/* prefix 74 */ -static struct opcode_s op74[256] = -{ - {illegal2, 2, 8, 8,L0|L1}, /* 00: 0111 0100 0000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 01: 0111 0100 0000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 02: 0111 0100 0000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 03: 0111 0100 0000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 04: 0111 0100 0000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 05: 0111 0100 0000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 06: 0111 0100 0000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 07: 0111 0100 0000 0111 */ - {ANI_V_xx, 3,11,11,L0|L1}, /* 08: 0111 0100 0000 1000 xxxx xxxx */ - {ANI_A_xx, 3,11,11,L0|L1}, /* 09: 0111 0100 0000 1001 xxxx xxxx */ - {ANI_B_xx, 3,11,11,L0|L1}, /* 0a: 0111 0100 0000 1010 xxxx xxxx */ - {ANI_C_xx, 3,11,11,L0|L1}, /* 0b: 0111 0100 0000 1011 xxxx xxxx */ - {ANI_D_xx, 3,11,11,L0|L1}, /* 0c: 0111 0100 0000 1100 xxxx xxxx */ - {ANI_E_xx, 3,11,11,L0|L1}, /* 0d: 0111 0100 0000 1101 xxxx xxxx */ - {ANI_H_xx, 3,11,11,L0|L1}, /* 0e: 0111 0100 0000 1110 xxxx xxxx */ - {ANI_L_xx, 3,11,11,L0|L1}, /* 0f: 0111 0100 0000 1111 xxxx xxxx */ - - {XRI_V_xx, 3,11,11,L0|L1}, /* 10: 0111 0100 0001 0000 xxxx xxxx */ - {XRI_A_xx, 3,11,11,L0|L1}, /* 11: 0111 0100 0001 0001 xxxx xxxx */ - {XRI_B_xx, 3,11,11,L0|L1}, /* 12: 0111 0100 0001 0010 xxxx xxxx */ - {XRI_C_xx, 3,11,11,L0|L1}, /* 13: 0111 0100 0001 0011 xxxx xxxx */ - {XRI_D_xx, 3,11,11,L0|L1}, /* 14: 0111 0100 0001 0100 xxxx xxxx */ - {XRI_E_xx, 3,11,11,L0|L1}, /* 15: 0111 0100 0001 0101 xxxx xxxx */ - {XRI_H_xx, 3,11,11,L0|L1}, /* 16: 0111 0100 0001 0110 xxxx xxxx */ - {XRI_L_xx, 3,11,11,L0|L1}, /* 17: 0111 0100 0001 0111 xxxx xxxx */ - {ORI_V_xx, 3,11,11,L0|L1}, /* 18: 0111 0100 0001 1000 xxxx xxxx */ - {ORI_A_xx, 3,11,11,L0|L1}, /* 19: 0111 0100 0001 1001 xxxx xxxx */ - {ORI_B_xx, 3,11,11,L0|L1}, /* 1a: 0111 0100 0001 1010 xxxx xxxx */ - {ORI_C_xx, 3,11,11,L0|L1}, /* 1b: 0111 0100 0001 1011 xxxx xxxx */ - {ORI_D_xx, 3,11,11,L0|L1}, /* 1c: 0111 0100 0001 1100 xxxx xxxx */ - {ORI_E_xx, 3,11,11,L0|L1}, /* 1d: 0111 0100 0001 1101 xxxx xxxx */ - {ORI_H_xx, 3,11,11,L0|L1}, /* 1e: 0111 0100 0001 1110 xxxx xxxx */ - {ORI_L_xx, 3,11,11,L0|L1}, /* 1f: 0111 0100 0001 1111 xxxx xxxx */ - - {ADINC_V_xx, 3,11,11,L0|L1}, /* 20: 0111 0100 0010 0000 xxxx xxxx */ - {ADINC_A_xx, 3,11,11,L0|L1}, /* 21: 0111 0100 0010 0001 xxxx xxxx */ - {ADINC_B_xx, 3,11,11,L0|L1}, /* 22: 0111 0100 0010 0010 xxxx xxxx */ - {ADINC_C_xx, 3,11,11,L0|L1}, /* 23: 0111 0100 0010 0011 xxxx xxxx */ - {ADINC_D_xx, 3,11,11,L0|L1}, /* 24: 0111 0100 0010 0100 xxxx xxxx */ - {ADINC_E_xx, 3,11,11,L0|L1}, /* 25: 0111 0100 0010 0101 xxxx xxxx */ - {ADINC_H_xx, 3,11,11,L0|L1}, /* 26: 0111 0100 0010 0110 xxxx xxxx */ - {ADINC_L_xx, 3,11,11,L0|L1}, /* 27: 0111 0100 0010 0111 xxxx xxxx */ - {GTI_V_xx, 3,11,11,L0|L1}, /* 28: 0111 0100 0010 1000 xxxx xxxx */ - {GTI_A_xx, 3,11,11,L0|L1}, /* 29: 0111 0100 0010 1001 xxxx xxxx */ - {GTI_B_xx, 3,11,11,L0|L1}, /* 2a: 0111 0100 0010 1010 xxxx xxxx */ - {GTI_C_xx, 3,11,11,L0|L1}, /* 2b: 0111 0100 0010 1011 xxxx xxxx */ - {GTI_D_xx, 3,11,11,L0|L1}, /* 2c: 0111 0100 0010 1100 xxxx xxxx */ - {GTI_E_xx, 3,11,11,L0|L1}, /* 2d: 0111 0100 0010 1101 xxxx xxxx */ - {GTI_H_xx, 3,11,11,L0|L1}, /* 2e: 0111 0100 0010 1110 xxxx xxxx */ - {GTI_L_xx, 3,11,11,L0|L1}, /* 2f: 0111 0100 0010 1111 xxxx xxxx */ - - {SUINB_V_xx, 3,11,11,L0|L1}, /* 30: 0111 0100 0011 0000 xxxx xxxx */ - {SUINB_A_xx, 3,11,11,L0|L1}, /* 31: 0111 0100 0011 0001 xxxx xxxx */ - {SUINB_B_xx, 3,11,11,L0|L1}, /* 32: 0111 0100 0011 0010 xxxx xxxx */ - {SUINB_C_xx, 3,11,11,L0|L1}, /* 33: 0111 0100 0011 0011 xxxx xxxx */ - {SUINB_D_xx, 3,11,11,L0|L1}, /* 34: 0111 0100 0011 0100 xxxx xxxx */ - {SUINB_E_xx, 3,11,11,L0|L1}, /* 35: 0111 0100 0011 0101 xxxx xxxx */ - {SUINB_H_xx, 3,11,11,L0|L1}, /* 36: 0111 0100 0011 0110 xxxx xxxx */ - {SUINB_L_xx, 3,11,11,L0|L1}, /* 37: 0111 0100 0011 0111 xxxx xxxx */ - {LTI_V_xx, 3,11,11,L0|L1}, /* 38: 0111 0100 0011 1000 xxxx xxxx */ - {LTI_A_xx, 3,11,11,L0|L1}, /* 39: 0111 0100 0011 1001 xxxx xxxx */ - {LTI_B_xx, 3,11,11,L0|L1}, /* 3a: 0111 0100 0011 1010 xxxx xxxx */ - {LTI_C_xx, 3,11,11,L0|L1}, /* 3b: 0111 0100 0011 1011 xxxx xxxx */ - {LTI_D_xx, 3,11,11,L0|L1}, /* 3c: 0111 0100 0011 1100 xxxx xxxx */ - {LTI_E_xx, 3,11,11,L0|L1}, /* 3d: 0111 0100 0011 1101 xxxx xxxx */ - {LTI_H_xx, 3,11,11,L0|L1}, /* 3e: 0111 0100 0011 1110 xxxx xxxx */ - {LTI_L_xx, 3,11,11,L0|L1}, /* 3f: 0111 0100 0011 1111 xxxx xxxx */ - - {ADI_V_xx, 3,11,11,L0|L1}, /* 40: 0111 0100 0100 0000 xxxx xxxx */ - {ADI_A_xx, 3,11,11,L0|L1}, /* 41: 0111 0100 0100 0001 xxxx xxxx */ - {ADI_B_xx, 3,11,11,L0|L1}, /* 42: 0111 0100 0100 0010 xxxx xxxx */ - {ADI_C_xx, 3,11,11,L0|L1}, /* 43: 0111 0100 0100 0011 xxxx xxxx */ - {ADI_D_xx, 3,11,11,L0|L1}, /* 44: 0111 0100 0100 0100 xxxx xxxx */ - {ADI_E_xx, 3,11,11,L0|L1}, /* 45: 0111 0100 0100 0101 xxxx xxxx */ - {ADI_H_xx, 3,11,11,L0|L1}, /* 46: 0111 0100 0100 0110 xxxx xxxx */ - {ADI_L_xx, 3,11,11,L0|L1}, /* 47: 0111 0100 0100 0111 xxxx xxxx */ - {ONI_V_xx, 3,11,11,L0|L1}, /* 48: 0111 0100 0100 1000 xxxx xxxx */ - {ONI_A_xx, 3,11,11,L0|L1}, /* 49: 0111 0100 0100 1001 xxxx xxxx */ - {ONI_B_xx, 3,11,11,L0|L1}, /* 4a: 0111 0100 0100 1010 xxxx xxxx */ - {ONI_C_xx, 3,11,11,L0|L1}, /* 4b: 0111 0100 0100 1011 xxxx xxxx */ - {ONI_D_xx, 3,11,11,L0|L1}, /* 4c: 0111 0100 0100 1100 xxxx xxxx */ - {ONI_E_xx, 3,11,11,L0|L1}, /* 4d: 0111 0100 0100 1101 xxxx xxxx */ - {ONI_H_xx, 3,11,11,L0|L1}, /* 4e: 0111 0100 0100 1110 xxxx xxxx */ - {ONI_L_xx, 3,11,11,L0|L1}, /* 4f: 0111 0100 0100 1111 xxxx xxxx */ - - {ACI_V_xx, 3,11,11,L0|L1}, /* 50: 0111 0100 0101 0000 xxxx xxxx */ - {ACI_A_xx, 3,11,11,L0|L1}, /* 51: 0111 0100 0101 0001 xxxx xxxx */ - {ACI_B_xx, 3,11,11,L0|L1}, /* 52: 0111 0100 0101 0010 xxxx xxxx */ - {ACI_C_xx, 3,11,11,L0|L1}, /* 53: 0111 0100 0101 0011 xxxx xxxx */ - {ACI_D_xx, 3,11,11,L0|L1}, /* 54: 0111 0100 0101 0100 xxxx xxxx */ - {ACI_E_xx, 3,11,11,L0|L1}, /* 55: 0111 0100 0101 0101 xxxx xxxx */ - {ACI_H_xx, 3,11,11,L0|L1}, /* 56: 0111 0100 0101 0110 xxxx xxxx */ - {ACI_L_xx, 3,11,11,L0|L1}, /* 57: 0111 0100 0101 0111 xxxx xxxx */ - {OFFI_V_xx, 3,11,11,L0|L1}, /* 58: 0111 0100 0101 1000 xxxx xxxx */ - {OFFI_A_xx, 3,11,11,L0|L1}, /* 59: 0111 0100 0101 1001 xxxx xxxx */ - {OFFI_B_xx, 3,11,11,L0|L1}, /* 5a: 0111 0100 0101 1010 xxxx xxxx */ - {OFFI_C_xx, 3,11,11,L0|L1}, /* 5b: 0111 0100 0101 1011 xxxx xxxx */ - {OFFI_D_xx, 3,11,11,L0|L1}, /* 5c: 0111 0100 0101 1100 xxxx xxxx */ - {OFFI_E_xx, 3,11,11,L0|L1}, /* 5d: 0111 0100 0101 1101 xxxx xxxx */ - {OFFI_H_xx, 3,11,11,L0|L1}, /* 5e: 0111 0100 0101 1110 xxxx xxxx */ - {OFFI_L_xx, 3,11,11,L0|L1}, /* 5f: 0111 0100 0101 1111 xxxx xxxx */ - - {SUI_V_xx, 3,11,11,L0|L1}, /* 60: 0111 0100 0110 0000 xxxx xxxx */ - {SUI_A_xx, 3,11,11,L0|L1}, /* 61: 0111 0100 0110 0001 xxxx xxxx */ - {SUI_B_xx, 3,11,11,L0|L1}, /* 62: 0111 0100 0110 0010 xxxx xxxx */ - {SUI_C_xx, 3,11,11,L0|L1}, /* 63: 0111 0100 0110 0011 xxxx xxxx */ - {SUI_D_xx, 3,11,11,L0|L1}, /* 64: 0111 0100 0110 0100 xxxx xxxx */ - {SUI_E_xx, 3,11,11,L0|L1}, /* 65: 0111 0100 0110 0101 xxxx xxxx */ - {SUI_H_xx, 3,11,11,L0|L1}, /* 66: 0111 0100 0110 0110 xxxx xxxx */ - {SUI_L_xx, 3,11,11,L0|L1}, /* 67: 0111 0100 0110 0111 xxxx xxxx */ - {NEI_V_xx, 3,11,11,L0|L1}, /* 68: 0111 0100 0110 1000 xxxx xxxx */ - {NEI_A_xx, 3,11,11,L0|L1}, /* 69: 0111 0100 0110 1001 xxxx xxxx */ - {NEI_B_xx, 3,11,11,L0|L1}, /* 6a: 0111 0100 0110 1010 xxxx xxxx */ - {NEI_C_xx, 3,11,11,L0|L1}, /* 6b: 0111 0100 0110 1011 xxxx xxxx */ - {NEI_D_xx, 3,11,11,L0|L1}, /* 6c: 0111 0100 0110 1100 xxxx xxxx */ - {NEI_E_xx, 3,11,11,L0|L1}, /* 6d: 0111 0100 0110 1101 xxxx xxxx */ - {NEI_H_xx, 3,11,11,L0|L1}, /* 6e: 0111 0100 0110 1110 xxxx xxxx */ - {NEI_L_xx, 3,11,11,L0|L1}, /* 6f: 0111 0100 0110 1111 xxxx xxxx */ - - {SBI_V_xx, 3,11,11,L0|L1}, /* 70: 0111 0100 0111 0000 xxxx xxxx */ - {SBI_A_xx, 3,11,11,L0|L1}, /* 71: 0111 0100 0111 0001 xxxx xxxx */ - {SBI_B_xx, 3,11,11,L0|L1}, /* 72: 0111 0100 0111 0010 xxxx xxxx */ - {SBI_C_xx, 3,11,11,L0|L1}, /* 73: 0111 0100 0111 0011 xxxx xxxx */ - {SBI_D_xx, 3,11,11,L0|L1}, /* 74: 0111 0100 0111 0100 xxxx xxxx */ - {SBI_E_xx, 3,11,11,L0|L1}, /* 75: 0111 0100 0111 0101 xxxx xxxx */ - {SBI_H_xx, 3,11,11,L0|L1}, /* 76: 0111 0100 0111 0110 xxxx xxxx */ - {SBI_L_xx, 3,11,11,L0|L1}, /* 77: 0111 0100 0111 0111 xxxx xxxx */ - {EQI_V_xx, 3,11,11,L0|L1}, /* 78: 0111 0100 0111 1000 xxxx xxxx */ - {EQI_A_xx, 3,11,11,L0|L1}, /* 79: 0111 0100 0111 1001 xxxx xxxx */ - {EQI_B_xx, 3,11,11,L0|L1}, /* 7a: 0111 0100 0111 1010 xxxx xxxx */ - {EQI_C_xx, 3,11,11,L0|L1}, /* 7b: 0111 0100 0111 1011 xxxx xxxx */ - {EQI_D_xx, 3,11,11,L0|L1}, /* 7c: 0111 0100 0111 1100 xxxx xxxx */ - {EQI_E_xx, 3,11,11,L0|L1}, /* 7d: 0111 0100 0111 1101 xxxx xxxx */ - {EQI_H_xx, 3,11,11,L0|L1}, /* 7e: 0111 0100 0111 1110 xxxx xxxx */ - {EQI_L_xx, 3,11,11,L0|L1}, /* 7f: 0111 0100 0111 1111 xxxx xxxx */ - - {illegal2, 2, 8, 8,L0|L1}, /* 80: 0111 0100 1000 0000 */ - {illegal2, 2, 8, 8,L0|L1}, /* 81: 0111 0100 1000 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 82: 0111 0100 1000 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 83: 0111 0100 1000 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 84: 0111 0100 1000 0100 */ - {illegal2, 2, 8, 8,L0|L1}, /* 85: 0111 0100 1000 0101 */ - {illegal2, 2, 8, 8,L0|L1}, /* 86: 0111 0100 1000 0110 */ - {illegal2, 2, 8, 8,L0|L1}, /* 87: 0111 0100 1000 0111 */ - {ANAW_wa, 3,14,11,L0|L1}, /* 88: 0111 0100 1000 1000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* 89: 0111 0100 1000 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8a: 0111 0100 1000 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8b: 0111 0100 1000 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 8c: 0111 0100 1000 1100 */ - {DAN_EA_BC, 2,11,11,L0|L1}, /* 8d: 0111 0100 1000 1101 */ - {DAN_EA_DE, 2,11,11,L0|L1}, /* 8e: 0111 0100 1000 1110 */ - {DAN_EA_HL, 2,11,11,L0|L1}, /* 8f: 0111 0100 1000 1111 */ - - {XRAW_wa, 3,14,11,L0|L1}, /* 90: 0111 0100 1001 0000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* 91: 0111 0100 1001 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 92: 0111 0100 1001 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 93: 0111 0100 1001 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 94: 0111 0100 1001 0100 */ - {DXR_EA_BC, 2,11,11,L0|L1}, /* 95: 0111 0100 1001 0101 */ - {DXR_EA_DE, 2,11,11,L0|L1}, /* 96: 0111 0100 1001 0110 */ - {DXR_EA_HL, 2,11,11,L0|L1}, /* 97: 0111 0100 1001 0111 */ - {ORAW_wa, 3,14,11,L0|L1}, /* 98: 0111 0100 1001 1000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* 99: 0111 0100 1001 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9a: 0111 0100 1001 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9b: 0111 0100 1001 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* 9c: 0111 0100 1001 1100 */ - {DOR_EA_BC, 2,11,11,L0|L1}, /* 9d: 0111 0100 1001 1101 */ - {DOR_EA_DE, 2,11,11,L0|L1}, /* 9e: 0111 0100 1001 1110 */ - {DOR_EA_HL, 2,11,11,L0|L1}, /* 9f: 0111 0100 1001 1111 */ - - {ADDNCW_wa, 3,14,11,L0|L1}, /* a0: 0111 0100 1010 0000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* a1: 0111 0100 1010 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* a2: 0111 0100 1010 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* a3: 0111 0100 1010 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* a4: 0111 0100 1010 0100 */ - {DADDNC_EA_BC, 2,11,11,L0|L1}, /* a5: 0111 0100 1010 0101 */ - {DADDNC_EA_DE, 2,11,11,L0|L1}, /* a6: 0111 0100 1010 0110 */ - {DADDNC_EA_HL, 2,11,11,L0|L1}, /* a7: 0111 0100 1010 0111 */ - {GTAW_wa, 3,14,11,L0|L1}, /* a8: 0111 0100 1010 1000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* a9: 0111 0100 1010 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* aa: 0111 0100 1010 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* ab: 0111 0100 1010 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* ac: 0111 0100 1010 1100 */ - {DGT_EA_BC, 2,11,11,L0|L1}, /* ad: 0111 0100 1010 1101 */ - {DGT_EA_DE, 2,11,11,L0|L1}, /* ae: 0111 0100 1010 1110 */ - {DGT_EA_HL, 2,11,11,L0|L1}, /* af: 0111 0100 1010 1111 */ - - {SUBNBW_wa, 3,14,11,L0|L1}, /* b0: 0111 0100 1011 0000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* b1: 0111 0100 1011 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* b2: 0111 0100 1011 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* b3: 0111 0100 1011 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* b4: 0111 0100 1011 0100 */ - {DSUBNB_EA_BC, 2,11,11,L0|L1}, /* b5: 0111 0100 1011 0101 */ - {DSUBNB_EA_DE, 2,11,11,L0|L1}, /* b6: 0111 0100 1011 0110 */ - {DSUBNB_EA_HL, 2,11,11,L0|L1}, /* b7: 0111 0100 1011 0111 */ - {LTAW_wa, 3,14,11,L0|L1}, /* b8: 0111 0100 1011 1000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* b9: 0111 0100 1011 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* ba: 0111 0100 1011 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* bb: 0111 0100 1011 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* bc: 0111 0100 1011 1100 */ - {DLT_EA_BC, 2,11,11,L0|L1}, /* bd: 0111 0100 1011 1101 */ - {DLT_EA_DE, 2,11,11,L0|L1}, /* be: 0111 0100 1011 1110 */ - {DLT_EA_HL, 2,11,11,L0|L1}, /* bf: 0111 0100 1011 1111 */ - - {ADDW_wa, 3,14,11,L0|L1}, /* c0: 0111 0100 1100 0000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* c1: 0111 0100 1100 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* c2: 0111 0100 1100 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* c3: 0111 0100 1100 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* c4: 0111 0100 1100 0100 */ - {DADD_EA_BC, 2,11,11,L0|L1}, /* c5: 0111 0100 1100 0101 */ - {DADD_EA_DE, 2,11,11,L0|L1}, /* c6: 0111 0100 1100 0110 */ - {DADD_EA_HL, 2,11,11,L0|L1}, /* c7: 0111 0100 1100 0111 */ - {ONAW_wa, 3,14,11,L0|L1}, /* c8: 0111 0100 1100 1000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* c9: 0111 0100 1100 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* ca: 0111 0100 1100 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* cb: 0111 0100 1100 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* cc: 0111 0100 1100 1100 */ - {DON_EA_BC, 2,11,11,L0|L1}, /* cd: 0111 0100 1100 1101 */ - {DON_EA_DE, 2,11,11,L0|L1}, /* ce: 0111 0100 1100 1110 */ - {DON_EA_HL, 2,11,11,L0|L1}, /* cf: 0111 0100 1100 1111 */ - - {ADCW_wa, 3,14,11,L0|L1}, /* d0: 0111 0100 1101 0000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* d1: 0111 0100 1101 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* d2: 0111 0100 1101 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* d3: 0111 0100 1101 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* d4: 0111 0100 1101 0100 */ - {DADC_EA_BC, 2,11,11,L0|L1}, /* d5: 0111 0100 1101 0101 */ - {DADC_EA_DE, 2,11,11,L0|L1}, /* d6: 0111 0100 1101 0110 */ - {DADC_EA_HL, 2,11,11,L0|L1}, /* d7: 0111 0100 1101 0111 */ - {OFFAW_wa, 3,14,11,L0|L1}, /* d8: 0111 0100 1101 1000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* d9: 0111 0100 1101 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* da: 0111 0100 1101 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* db: 0111 0100 1101 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* dc: 0111 0100 1101 1100 */ - {DOFF_EA_BC, 2,11,11,L0|L1}, /* dd: 0111 0100 1101 1101 */ - {DOFF_EA_DE, 2,11,11,L0|L1}, /* de: 0111 0100 1101 1110 */ - {DOFF_EA_HL, 2,11,11,L0|L1}, /* df: 0111 0100 1101 1111 */ - - {SUBW_wa, 3,14,11,L0|L1}, /* e0: 0111 0100 1110 0000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* e1: 0111 0100 1110 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* e2: 0111 0100 1110 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* e3: 0111 0100 1110 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* e4: 0111 0100 1110 0100 */ - {DSUB_EA_BC, 2,11,11,L0|L1}, /* e5: 0111 0100 1110 0101 */ - {DSUB_EA_DE, 2,11,11,L0|L1}, /* e6: 0111 0100 1110 0110 */ - {DSUB_EA_HL, 2,11,11,L0|L1}, /* e7: 0111 0100 1110 0111 */ - {NEAW_wa, 3,14,11,L0|L1}, /* e8: 0111 0100 1110 1000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* e9: 0111 0100 1110 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* ea: 0111 0100 1110 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* eb: 0111 0100 1110 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* ec: 0111 0100 1110 1100 */ - {DNE_EA_BC, 2,11,11,L0|L1}, /* ed: 0111 0100 1110 1101 */ - {DNE_EA_DE, 2,11,11,L0|L1}, /* ee: 0111 0100 1110 1110 */ - {DNE_EA_HL, 2,11,11,L0|L1}, /* ef: 0111 0100 1110 1111 */ - - {SBBW_wa, 3,14,11,L0|L1}, /* f0: 0111 0100 1111 0000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* f1: 0111 0100 1111 0001 */ - {illegal2, 2, 8, 8,L0|L1}, /* f2: 0111 0100 1111 0010 */ - {illegal2, 2, 8, 8,L0|L1}, /* f3: 0111 0100 1111 0011 */ - {illegal2, 2, 8, 8,L0|L1}, /* f4: 0111 0100 1111 0100 */ - {DSBB_EA_BC, 2,11,11,L0|L1}, /* f5: 0111 0100 1111 0101 */ - {DSBB_EA_DE, 2,11,11,L0|L1}, /* f6: 0111 0100 1111 0110 */ - {DSBB_EA_HL, 2,11,11,L0|L1}, /* f7: 0111 0100 1111 0111 */ - {EQAW_wa, 3,14,11,L0|L1}, /* f8: 0111 0100 1111 1000 oooo oooo */ - {illegal2, 2, 8, 8,L0|L1}, /* f9: 0111 0100 1111 1001 */ - {illegal2, 2, 8, 8,L0|L1}, /* fa: 0111 0100 1111 1010 */ - {illegal2, 2, 8, 8,L0|L1}, /* fb: 0111 0100 1111 1011 */ - {illegal2, 2, 8, 8,L0|L1}, /* fc: 0111 0100 1111 1100 */ - {DEQ_EA_BC, 2,11,11,L0|L1}, /* fd: 0111 0100 1111 1101 */ - {DEQ_EA_DE, 2,11,11,L0|L1}, /* fe: 0111 0100 1111 1110 */ - {DEQ_EA_HL, 2,11,11,L0|L1} /* ff: 0111 0100 1111 1111 */ -}; - -/* main opcodes */ -static struct opcode_s opXX_7810[256] = -{ - {NOP, 1, 4, 4,L0|L1}, /* 00: 0000 0000 */ - {LDAW_wa, 2,10,10,L0|L1}, /* 01: 0000 0001 oooo oooo */ - {INX_SP, 1, 7, 7,L0|L1}, /* 02: 0000 0010 */ - {DCX_SP, 1, 7, 7,L0|L1}, /* 03: 0000 0011 */ - {LXI_S_w, 3,10,10,L0|L1}, /* 04: 0000 0100 llll llll hhhh hhhh */ - {ANIW_wa_xx, 3,19,19,L0|L1}, /* 05: 0000 0101 oooo oooo xxxx xxxx */ - {illegal, 1, 4, 4,L0|L1}, /* 06: */ - {ANI_A_xx, 2, 7, 7,L0|L1}, /* 07: 0000 0111 xxxx xxxx */ - {MOV_A_EAH, 1, 4, 4,L0|L1}, /* 08: 0000 1000 */ - {MOV_A_EAL, 1, 4, 4,L0|L1}, /* 09: 0000 1001 */ - {MOV_A_B, 1, 4, 4,L0|L1}, /* 0a: 0000 1010 */ - {MOV_A_C, 1, 4, 4,L0|L1}, /* 0b: 0000 1011 */ - {MOV_A_D, 1, 4, 4,L0|L1}, /* 0c: 0000 1100 */ - {MOV_A_E, 1, 4, 4,L0|L1}, /* 0d: 0000 1101 */ - {MOV_A_H, 1, 4, 4,L0|L1}, /* 0e: 0000 1110 */ - {MOV_A_L, 1, 4, 4,L0|L1}, /* 0f: 0000 1111 */ - - {EXA, 1, 4, 4,L0|L1}, /* 10: 0001 0000 */ - {EXX, 1, 4, 4,L0|L1}, /* 11: 0001 0001 */ - {INX_BC, 1, 7, 7,L0|L1}, /* 12: 0001 0010 */ - {DCX_BC, 1, 7, 7,L0|L1}, /* 13: 0001 0011 */ - {LXI_B_w, 3,10,10,L0|L1}, /* 14: 0001 0100 llll llll hhhh hhhh */ - {ORIW_wa_xx, 3,19,19,L0|L1}, /* 15: 0001 0101 oooo oooo xxxx xxxx */ - {XRI_A_xx, 2, 7, 7,L0|L1}, /* 16: 0001 0110 xxxx xxxx */ - {ORI_A_xx, 2, 7, 7,L0|L1}, /* 17: 0001 0111 xxxx xxxx */ - {MOV_EAH_A, 1, 4, 4,L0|L1}, /* 18: 0001 1000 */ - {MOV_EAL_A, 1, 4, 4,L0|L1}, /* 19: 0001 1001 */ - {MOV_B_A, 1, 4, 4,L0|L1}, /* 1a: 0001 1010 */ - {MOV_C_A, 1, 4, 4,L0|L1}, /* 1b: 0001 1011 */ - {MOV_D_A, 1, 4, 4,L0|L1}, /* 1c: 0001 1100 */ - {MOV_E_A, 1, 4, 4,L0|L1}, /* 1d: 0001 1101 */ - {MOV_H_A, 1, 4, 4,L0|L1}, /* 1e: 0001 1110 */ - {MOV_L_A, 1, 4, 4,L0|L1}, /* 1f: 0001 1111 */ - - {INRW_wa, 2,16,16,L0|L1}, /* 20: 0010 0000 oooo oooo */ - {JB, 1, 4, 4,L0|L1}, /* 21: 0010 0001 */ - {INX_DE, 1, 7, 7,L0|L1}, /* 22: 0010 0010 */ - {DCX_DE, 1, 7, 7,L0|L1}, /* 23: 0010 0011 */ - {LXI_D_w, 3,10,10,L0|L1}, /* 24: 0010 0100 llll llll hhhh hhhh */ - {GTIW_wa_xx, 3,19,19,L0|L1}, /* 25: 0010 0101 oooo oooo xxxx xxxx */ - {ADINC_A_xx, 2, 7, 7,L0|L1}, /* 26: 0010 0110 xxxx xxxx */ - {GTI_A_xx, 2, 7, 7,L0|L1}, /* 27: 0010 0111 xxxx xxxx */ - {illegal, 1, 4, 4,L0|L1}, /* 28: */ - {LDAX_B, 2, 7, 7,L0|L1}, /* 29: 0010 1001 dddd dddd */ - {LDAX_D, 2, 7, 7,L0|L1}, /* 2a: 0010 1010 dddd dddd */ - {LDAX_H, 2, 7, 7,L0|L1}, /* 2b: 0010 1011 dddd dddd */ - {LDAX_Dp, 2, 7, 7,L0|L1}, /* 2c: 0010 1100 dddd dddd */ - {LDAX_Hp, 2, 7, 7,L0|L1}, /* 2d: 0010 1101 dddd dddd */ - {LDAX_Dm, 2, 7, 7,L0|L1}, /* 2e: 0010 1110 dddd dddd */ - {LDAX_Hm, 2, 7, 7,L0|L1}, /* 2f: 0010 1111 dddd dddd */ - - {DCRW_wa, 2,16,16,L0|L1}, /* 30: 0011 0000 oooo oooo */ - {BLOCK, 1,13,13,L0|L1}, /* 31: 0011 0001 */ /* 7810 */ - {INX_HL, 1, 7, 7,L0|L1}, /* 32: 0011 0010 */ - {DCX_HL, 1, 7, 7,L0|L1}, /* 33: 0011 0011 */ - {LXI_H_w, 3,10,10, L1}, /* 34: 0011 0100 llll llll hhhh hhhh */ - {LTIW_wa_xx, 3,19,19,L0|L1}, /* 35: 0011 0101 oooo oooo xxxx xxxx */ - {SUINB_A_xx, 2, 7, 7,L0|L1}, /* 36: 0011 0110 xxxx xxxx */ - {LTI_A_xx, 2, 7, 7,L0|L1}, /* 37: 0011 0111 xxxx xxxx */ - {illegal, 1, 4, 4,L0|L1}, /* 38: */ - {STAX_B, 2, 7, 7,L0|L1}, /* 39: 0011 1001 dddd dddd */ - {STAX_D, 2, 7, 7,L0|L1}, /* 3a: 0011 1010 dddd dddd */ - {STAX_H, 2, 7, 7,L0|L1}, /* 3b: 0011 1011 dddd dddd */ - {STAX_Dp, 2, 7, 7,L0|L1}, /* 3c: 0011 1100 dddd dddd */ - {STAX_Hp, 2, 7, 7,L0|L1}, /* 3d: 0011 1101 dddd dddd */ - {STAX_Dm, 2, 7, 7,L0|L1}, /* 3e: 0011 1110 dddd dddd */ - {STAX_Hm, 2, 7, 7,L0|L1}, /* 3f: 0011 1111 dddd dddd */ - - {CALL_w, 3,16,16,L0|L1}, /* 40: 0100 0000 llll llll hhhh hhhh */ - {INR_A, 1, 4, 4,L0|L1}, /* 41: 0100 0001 */ - {INR_B, 1, 4, 4,L0|L1}, /* 42: 0100 0010 */ - {INR_C, 1, 4, 4,L0|L1}, /* 43: 0100 0011 */ - {LXI_EA_s, 3,10,10,L0|L1}, /* 44: 0100 0100 llll llll hhhh hhhh */ - {ONIW_wa_xx, 3,19,19,L0|L1}, /* 45: 0100 0101 oooo oooo xxxx xxxx */ - {ADI_A_xx, 2, 7, 7,L0|L1}, /* 46: 0100 0110 xxxx xxxx */ - {ONI_A_xx, 2, 7, 7,L0|L1}, /* 47: 0100 0111 xxxx xxxx */ - {PRE_48, 1, 0, 0,L0|L1}, /* 48: prefix */ - {MVIX_BC_xx, 2,10,10,L0|L1}, /* 49: 0100 1001 xxxx xxxx */ - {MVIX_DE_xx, 2,10,10,L0|L1}, /* 4a: 0100 1010 xxxx xxxx */ - {MVIX_HL_xx, 2,10,10,L0|L1}, /* 4b: 0100 1011 xxxx xxxx */ - {PRE_4C, 1, 0, 0,L0|L1}, /* 4c: prefix */ - {PRE_4D, 1, 4, 4,L0|L1}, /* 4d: prefix */ - {JRE, 2,10,10,L0|L1}, /* 4e: 0100 111d dddd dddd */ - {JRE, 2,10,10,L0|L1}, /* 4f: 0100 111d dddd dddd */ - - {EXH, 1, 4, 4,L0|L1}, /* 50: 0101 0000 */ /* 7810 */ - {DCR_A, 1, 4, 4,L0|L1}, /* 51: 0101 0001 */ - {DCR_B, 1, 4, 4,L0|L1}, /* 52: 0101 0010 */ - {DCR_C, 1, 4, 4,L0|L1}, /* 53: 0101 0011 */ - {JMP_w, 3,10,10,L0|L1}, /* 54: 0101 0100 llll llll hhhh hhhh */ - {OFFIW_wa_xx, 3,19,19,L0|L1}, /* 55: 0101 0101 oooo oooo xxxx xxxx */ - {ACI_A_xx, 2, 7, 7,L0|L1}, /* 56: 0101 0110 xxxx xxxx */ - {OFFI_A_xx, 2, 7, 7,L0|L1}, /* 57: 0101 0111 xxxx xxxx */ - {BIT_0_wa, 2,10,10,L0|L1}, /* 58: 0101 1000 oooo oooo */ /* 7810 */ - {BIT_1_wa, 2,10,10,L0|L1}, /* 59: 0101 1001 oooo oooo */ /* 7810 */ - {BIT_2_wa, 2,10,10,L0|L1}, /* 5a: 0101 1010 oooo oooo */ /* 7810 */ - {BIT_3_wa, 2,10,10,L0|L1}, /* 5b: 0101 1011 oooo oooo */ /* 7810 */ - {BIT_4_wa, 2,10,10,L0|L1}, /* 5c: 0101 1100 oooo oooo */ /* 7810 */ - {BIT_5_wa, 2,10,10,L0|L1}, /* 5d: 0101 1101 oooo oooo */ /* 7810 */ - {BIT_6_wa, 2,10,10,L0|L1}, /* 5e: 0101 1110 oooo oooo */ /* 7810 */ - {BIT_7_wa, 2,10,10,L0|L1}, /* 5f: 0101 1111 oooo oooo */ /* 7810 */ - - {PRE_60, 1, 0, 0,L0|L1}, /* 60: */ - {DAA, 1, 4, 4,L0|L1}, /* 61: 0110 0001 */ - {RETI, 1,13,13,L0|L1}, /* 62: 0110 0010 */ - {STAW_wa, 2,10,10,L0|L1}, /* 63: 0110 0011 oooo oooo */ - {PRE_64, 1, 0, 0,L0|L1}, /* 64: */ - {NEIW_wa_xx, 3,19,19,L0|L1}, /* 65: 0110 0101 oooo oooo xxxx xxxx */ - {SUI_A_xx, 2, 7, 7,L0|L1}, /* 66: 0110 0110 xxxx xxxx */ - {NEI_A_xx, 2, 7, 7,L0|L1}, /* 67: 0110 0111 xxxx xxxx */ - {MVI_V_xx, 2, 7, 7,L0|L1}, /* 68: 0110 1000 xxxx xxxx */ - {MVI_A_xx, 2, 7, 7,L0 }, /* 69: 0110 1001 xxxx xxxx */ - {MVI_B_xx, 2, 7, 7,L0|L1}, /* 6a: 0110 1010 xxxx xxxx */ - {MVI_C_xx, 2, 7, 7,L0|L1}, /* 6b: 0110 1011 xxxx xxxx */ - {MVI_D_xx, 2, 7, 7,L0|L1}, /* 6c: 0110 1100 xxxx xxxx */ - {MVI_E_xx, 2, 7, 7,L0|L1}, /* 6d: 0110 1101 xxxx xxxx */ - {MVI_H_xx, 2, 7, 7,L0|L1}, /* 6e: 0110 1110 xxxx xxxx */ - {MVI_L_xx, 2, 7, 7, L1}, /* 6f: 0110 1111 xxxx xxxx */ - - {PRE_70, 1, 0, 0,L0|L1}, /* 70: */ - {MVIW_wa_xx, 3,13,13,L0|L1}, /* 71: 0111 0001 oooo oooo xxxx xxxx */ - {SOFTI, 1,16,16,L0|L1}, /* 72: 0111 0010 */ - {illegal, 1, 0, 0,L0|L1}, /* 73: */ - {PRE_74, 1, 0, 0,L0|L1}, /* 74: prefix */ - {EQIW_wa_xx, 3,19,19,L0|L1}, /* 75: 0111 0101 oooo oooo xxxx xxxx */ - {SBI_A_xx, 2, 7, 7,L0|L1}, /* 76: 0111 0110 xxxx xxxx */ - {EQI_A_xx, 2, 7, 7,L0|L1}, /* 77: 0111 0111 xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 78: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 79: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7a: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7b: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7c: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7d: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7e: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7f: 0111 1xxx xxxx xxxx */ - - {CALT, 1,16,16,L0|L1}, /* 80: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 81: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 82: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 83: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 84: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 85: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 86: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 87: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 88: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 89: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8a: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8b: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8c: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8d: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8e: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8f: 100x xxxx */ - - {CALT, 1,16,16,L0|L1}, /* 90: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 91: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 92: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 93: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 94: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 95: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 96: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 97: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 98: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 99: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9a: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9b: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9c: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9d: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9e: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9f: 100x xxxx */ - - {POP_VA, 1,10,10,L0|L1}, /* a0: 1010 0000 */ - {POP_BC, 1,10,10,L0|L1}, /* a1: 1010 0001 */ - {POP_DE, 1,10,10,L0|L1}, /* a2: 1010 0010 */ - {POP_HL, 1,10,10,L0|L1}, /* a3: 1010 0011 */ - {POP_EA, 1,10,10,L0|L1}, /* a4: 1010 0100 */ - {DMOV_EA_BC, 1, 4, 4,L0|L1}, /* a5: 1010 0101 */ - {DMOV_EA_DE, 1, 4, 4,L0|L1}, /* a6: 1010 0110 */ - {DMOV_EA_HL, 1, 4, 4,L0|L1}, /* a7: 1010 0111 */ - {INX_EA, 1, 7, 7,L0|L1}, /* a8: 1010 1000 */ - {DCX_EA, 1, 7, 7,L0|L1}, /* a9: 1010 1001 */ - {EI, 1, 4, 4,L0|L1}, /* aa: 1010 1010 */ - {LDAX_D_xx, 2, 7, 7,L0|L1}, /* ab: 1010 1011 dddd dddd */ - {LDAX_H_A, 1, 7, 7,L0|L1}, /* ac: 1010 1100 */ - {LDAX_H_B, 1, 7, 7,L0|L1}, /* ad: 1010 1101 */ - {LDAX_H_EA, 1, 7, 7,L0|L1}, /* ae: 1010 1110 */ - {LDAX_H_xx, 2, 7, 7,L0|L1}, /* af: 1010 1111 dddd dddd */ - - {PUSH_VA, 1,13,13,L0|L1}, /* b0: 1011 0000 */ - {PUSH_BC, 1,13,13,L0|L1}, /* b1: 1011 0001 */ - {PUSH_DE, 1,13,13,L0|L1}, /* b2: 1011 0010 */ - {PUSH_HL, 1,13,13,L0|L1}, /* b3: 1011 0011 */ - {PUSH_EA, 1,13,13,L0|L1}, /* b4: 1011 0100 */ - {DMOV_BC_EA, 1, 4, 4,L0|L1}, /* b5: 1011 0101 */ - {DMOV_DE_EA, 1, 4, 4,L0|L1}, /* b6: 1011 0110 */ - {DMOV_HL_EA, 1, 4, 4,L0|L1}, /* b7: 1011 0111 */ - {RET, 1,10,10,L0|L1}, /* b8: 1011 1000 */ - {RETS, 1,10,10,L0|L1}, /* b9: 1011 1001 */ - {DI, 1, 4, 4,L0|L1}, /* ba: 1011 1010 */ - {STAX_D_xx, 2, 7, 7,L0|L1}, /* bb: 1011 1011 dddd dddd */ - {STAX_H_A, 1, 7, 7,L0|L1}, /* bc: 1011 1100 */ - {STAX_H_B, 1, 7, 7,L0|L1}, /* bd: 1011 1101 */ - {STAX_H_EA, 1, 7, 7,L0|L1}, /* be: 1011 1110 */ - {STAX_H_xx, 2, 7, 7,L0|L1}, /* bf: 1011 1111 dddd dddd */ - - {JR, 1,10,10,L0|L1}, /* c0: 1100 0000 */ - {JR, 1,10,10,L0|L1}, /* c1: 1100 0001 */ - {JR, 1,10,10,L0|L1}, /* c2: 1100 0010 */ - {JR, 1,10,10,L0|L1}, /* c3: 1100 0011 */ - {JR, 1,10,10,L0|L1}, /* c4: 1100 0100 */ - {JR, 1,10,10,L0|L1}, /* c5: 1100 0101 */ - {JR, 1,10,10,L0|L1}, /* c6: 1100 0110 */ - {JR, 1,10,10,L0|L1}, /* c7: 1100 0111 */ - {JR, 1,10,10,L0|L1}, /* c8: 1100 1000 */ - {JR, 1,10,10,L0|L1}, /* c9: 1100 1001 */ - {JR, 1,10,10,L0|L1}, /* ca: 1100 1010 */ - {JR, 1,10,10,L0|L1}, /* cb: 1100 1011 */ - {JR, 1,10,10,L0|L1}, /* cc: 1100 1100 */ - {JR, 1,10,10,L0|L1}, /* cd: 1100 1101 */ - {JR, 1,10,10,L0|L1}, /* ce: 1100 1110 */ - {JR, 1,10,10,L0|L1}, /* cf: 1100 1111 */ - - {JR, 1,10,10,L0|L1}, /* d0: 1101 0000 */ - {JR, 1,10,10,L0|L1}, /* d1: 1101 0001 */ - {JR, 1,10,10,L0|L1}, /* d2: 1101 0010 */ - {JR, 1,10,10,L0|L1}, /* d3: 1101 0011 */ - {JR, 1,10,10,L0|L1}, /* d4: 1101 0100 */ - {JR, 1,10,10,L0|L1}, /* d5: 1101 0101 */ - {JR, 1,10,10,L0|L1}, /* d6: 1101 0110 */ - {JR, 1,10,10,L0|L1}, /* d7: 1101 0111 */ - {JR, 1,10,10,L0|L1}, /* d8: 1101 1000 */ - {JR, 1,10,10,L0|L1}, /* d9: 1101 1001 */ - {JR, 1,10,10,L0|L1}, /* da: 1101 1010 */ - {JR, 1,10,10,L0|L1}, /* db: 1101 1011 */ - {JR, 1,10,10,L0|L1}, /* dc: 1101 1100 */ - {JR, 1,10,10,L0|L1}, /* dd: 1101 1101 */ - {JR, 1,10,10,L0|L1}, /* de: 1101 1110 */ - {JR, 1,10,10,L0|L1}, /* df: 1101 1111 */ - - {JR, 1,10,10,L0|L1}, /* e0: 1110 0000 */ - {JR, 1,10,10,L0|L1}, /* e1: 1110 0001 */ - {JR, 1,10,10,L0|L1}, /* e2: 1110 0010 */ - {JR, 1,10,10,L0|L1}, /* e3: 1110 0011 */ - {JR, 1,10,10,L0|L1}, /* e4: 1110 0100 */ - {JR, 1,10,10,L0|L1}, /* e5: 1110 0101 */ - {JR, 1,10,10,L0|L1}, /* e6: 1110 0110 */ - {JR, 1,10,10,L0|L1}, /* e7: 1110 0111 */ - {JR, 1,10,10,L0|L1}, /* e8: 1110 1000 */ - {JR, 1,10,10,L0|L1}, /* e9: 1110 1001 */ - {JR, 1,10,10,L0|L1}, /* ea: 1110 1010 */ - {JR, 1,10,10,L0|L1}, /* eb: 1110 1011 */ - {JR, 1,10,10,L0|L1}, /* ec: 1110 1100 */ - {JR, 1,10,10,L0|L1}, /* ed: 1110 1101 */ - {JR, 1,10,10,L0|L1}, /* ee: 1110 1110 */ - {JR, 1,10,10,L0|L1}, /* ef: 1110 1111 */ - - {JR, 1,10,10,L0|L1}, /* f0: 1111 0000 */ - {JR, 1,10,10,L0|L1}, /* f1: 1111 0001 */ - {JR, 1,10,10,L0|L1}, /* f2: 1111 0010 */ - {JR, 1,10,10,L0|L1}, /* f3: 1111 0011 */ - {JR, 1,10,10,L0|L1}, /* f4: 1111 0100 */ - {JR, 1,10,10,L0|L1}, /* f5: 1111 0101 */ - {JR, 1,10,10,L0|L1}, /* f6: 1111 0110 */ - {JR, 1,10,10,L0|L1}, /* f7: 1111 0111 */ - {JR, 1,10,10,L0|L1}, /* f8: 1111 1000 */ - {JR, 1,10,10,L0|L1}, /* f9: 1111 1001 */ - {JR, 1,10,10,L0|L1}, /* fa: 1111 1010 */ - {JR, 1,10,10,L0|L1}, /* fb: 1111 1011 */ - {JR, 1,10,10,L0|L1}, /* fc: 1111 1100 */ - {JR, 1,10,10,L0|L1}, /* fd: 1111 1101 */ - {JR, 1,10,10,L0|L1}, /* fe: 1111 1110 */ - {JR, 1,10,10,L0|L1} /* ff: 1111 1111 */ -}; - -static struct opcode_s opXX_7807[256] = -{ - {NOP, 1, 4, 4,L0|L1}, /* 00: 0000 0000 */ - {LDAW_wa, 2,10,10,L0|L1}, /* 01: 0000 0001 oooo oooo */ - {INX_SP, 1, 7, 7,L0|L1}, /* 02: 0000 0010 */ - {DCX_SP, 1, 7, 7,L0|L1}, /* 03: 0000 0011 */ - {LXI_S_w, 3,10,10,L0|L1}, /* 04: 0000 0100 llll llll hhhh hhhh */ - {ANIW_wa_xx, 3,19,19,L0|L1}, /* 05: 0000 0101 oooo oooo xxxx xxxx */ - {illegal, 1, 4, 4,L0|L1}, /* 06: */ - {ANI_A_xx, 2, 7, 7,L0|L1}, /* 07: 0000 0111 xxxx xxxx */ - {MOV_A_EAH, 1, 4, 4,L0|L1}, /* 08: 0000 1000 */ - {MOV_A_EAL, 1, 4, 4,L0|L1}, /* 09: 0000 1001 */ - {MOV_A_B, 1, 4, 4,L0|L1}, /* 0a: 0000 1010 */ - {MOV_A_C, 1, 4, 4,L0|L1}, /* 0b: 0000 1011 */ - {MOV_A_D, 1, 4, 4,L0|L1}, /* 0c: 0000 1100 */ - {MOV_A_E, 1, 4, 4,L0|L1}, /* 0d: 0000 1101 */ - {MOV_A_H, 1, 4, 4,L0|L1}, /* 0e: 0000 1110 */ - {MOV_A_L, 1, 4, 4,L0|L1}, /* 0f: 0000 1111 */ - - {illegal, 1,13, 4,L0|L1}, /* 10: 0001 0000 */ /* 7807 */ - {illegal, 1,13, 4,L0|L1}, /* 11: 0001 0001 */ /* 7807 */ - {INX_BC, 1, 7, 7,L0|L1}, /* 12: 0001 0010 */ - {DCX_BC, 1, 7, 7,L0|L1}, /* 13: 0001 0011 */ - {LXI_B_w, 3,10,10,L0|L1}, /* 14: 0001 0100 llll llll hhhh hhhh */ - {ORIW_wa_xx, 3,19,19,L0|L1}, /* 15: 0001 0101 oooo oooo xxxx xxxx */ - {XRI_A_xx, 2, 7, 7,L0|L1}, /* 16: 0001 0110 xxxx xxxx */ - {ORI_A_xx, 2, 7, 7,L0|L1}, /* 17: 0001 0111 xxxx xxxx */ - {MOV_EAH_A, 1, 4, 4,L0|L1}, /* 18: 0001 1000 */ - {MOV_EAL_A, 1, 4, 4,L0|L1}, /* 19: 0001 1001 */ - {MOV_B_A, 1, 4, 4,L0|L1}, /* 1a: 0001 1010 */ - {MOV_C_A, 1, 4, 4,L0|L1}, /* 1b: 0001 1011 */ - {MOV_D_A, 1, 4, 4,L0|L1}, /* 1c: 0001 1100 */ - {MOV_E_A, 1, 4, 4,L0|L1}, /* 1d: 0001 1101 */ - {MOV_H_A, 1, 4, 4,L0|L1}, /* 1e: 0001 1110 */ - {MOV_L_A, 1, 4, 4,L0|L1}, /* 1f: 0001 1111 */ - - {INRW_wa, 2,16,16,L0|L1}, /* 20: 0010 0000 oooo oooo */ - {JB, 1, 4, 4,L0|L1}, /* 21: 0010 0001 */ - {INX_DE, 1, 7, 7,L0|L1}, /* 22: 0010 0010 */ - {DCX_DE, 1, 7, 7,L0|L1}, /* 23: 0010 0011 */ - {LXI_D_w, 3,10,10,L0|L1}, /* 24: 0010 0100 llll llll hhhh hhhh */ - {GTIW_wa_xx, 3,19,19,L0|L1}, /* 25: 0010 0101 oooo oooo xxxx xxxx */ - {ADINC_A_xx, 2, 7, 7,L0|L1}, /* 26: 0010 0110 xxxx xxxx */ - {GTI_A_xx, 2, 7, 7,L0|L1}, /* 27: 0010 0111 xxxx xxxx */ - {illegal, 1, 4, 4,L0|L1}, /* 28: */ - {LDAX_B, 2, 7, 7,L0|L1}, /* 29: 0010 1001 dddd dddd */ - {LDAX_D, 2, 7, 7,L0|L1}, /* 2a: 0010 1010 dddd dddd */ - {LDAX_H, 2, 7, 7,L0|L1}, /* 2b: 0010 1011 dddd dddd */ - {LDAX_Dp, 2, 7, 7,L0|L1}, /* 2c: 0010 1100 dddd dddd */ - {LDAX_Hp, 2, 7, 7,L0|L1}, /* 2d: 0010 1101 dddd dddd */ - {LDAX_Dm, 2, 7, 7,L0|L1}, /* 2e: 0010 1110 dddd dddd */ - {LDAX_Hm, 2, 7, 7,L0|L1}, /* 2f: 0010 1111 dddd dddd */ - - {DCRW_wa, 2,16,16,L0|L1}, /* 30: 0011 0000 oooo oooo */ - {illegal, 2, 8, 8,L0|L1}, /* 31: 0011 0001 bbbb bbbb */ /* 7807 */ - {INX_HL, 1, 7, 7,L0|L1}, /* 32: 0011 0010 */ - {DCX_HL, 1, 7, 7,L0|L1}, /* 33: 0011 0011 */ - {LXI_H_w, 3,10,10, L1}, /* 34: 0011 0100 llll llll hhhh hhhh */ - {LTIW_wa_xx, 3,19,19,L0|L1}, /* 35: 0011 0101 oooo oooo xxxx xxxx */ - {SUINB_A_xx, 2, 7, 7,L0|L1}, /* 36: 0011 0110 xxxx xxxx */ - {LTI_A_xx, 2, 7, 7,L0|L1}, /* 37: 0011 0111 xxxx xxxx */ - {illegal, 1, 4, 4,L0|L1}, /* 38: */ - {STAX_B, 2, 7, 7,L0|L1}, /* 39: 0011 1001 dddd dddd */ - {STAX_D, 2, 7, 7,L0|L1}, /* 3a: 0011 1010 dddd dddd */ - {STAX_H, 2, 7, 7,L0|L1}, /* 3b: 0011 1011 dddd dddd */ - {STAX_Dp, 2, 7, 7,L0|L1}, /* 3c: 0011 1100 dddd dddd */ - {STAX_Hp, 2, 7, 7,L0|L1}, /* 3d: 0011 1101 dddd dddd */ - {STAX_Dm, 2, 7, 7,L0|L1}, /* 3e: 0011 1110 dddd dddd */ - {STAX_Hm, 2, 7, 7,L0|L1}, /* 3f: 0011 1111 dddd dddd */ - - {CALL_w, 3,16,16,L0|L1}, /* 40: 0100 0000 llll llll hhhh hhhh */ - {INR_A, 1, 4, 4,L0|L1}, /* 41: 0100 0001 */ - {INR_B, 1, 4, 4,L0|L1}, /* 42: 0100 0010 */ - {INR_C, 1, 4, 4,L0|L1}, /* 43: 0100 0011 */ - {LXI_EA_s, 3,10,10,L0|L1}, /* 44: 0100 0100 llll llll hhhh hhhh */ - {ONIW_wa_xx, 3,19,19,L0|L1}, /* 45: 0100 0101 oooo oooo xxxx xxxx */ - {ADI_A_xx, 2, 7, 7,L0|L1}, /* 46: 0100 0110 xxxx xxxx */ - {ONI_A_xx, 2, 7, 7,L0|L1}, /* 47: 0100 0111 xxxx xxxx */ - {PRE_48, 1, 0, 0,L0|L1}, /* 48: prefix */ - {MVIX_BC_xx, 2,10,10,L0|L1}, /* 49: 0100 1001 xxxx xxxx */ - {MVIX_DE_xx, 2,10,10,L0|L1}, /* 4a: 0100 1010 xxxx xxxx */ - {MVIX_HL_xx, 2,10,10,L0|L1}, /* 4b: 0100 1011 xxxx xxxx */ - {PRE_4C, 1, 0, 0,L0|L1}, /* 4c: prefix */ - {PRE_4D, 1, 4, 4,L0|L1}, /* 4d: prefix */ - {JRE, 2,10,10,L0|L1}, /* 4e: 0100 111d dddd dddd */ - {JRE, 2,10,10,L0|L1}, /* 4f: 0100 111d dddd dddd */ - - {SKN_bit, 2,13,13,L0|L1}, /* 50: 0101 0000 bbbb bbbb */ /* 7807 */ - {DCR_A, 1, 4, 4,L0|L1}, /* 51: 0101 0001 */ - {DCR_B, 1, 4, 4,L0|L1}, /* 52: 0101 0010 */ - {DCR_C, 1, 4, 4,L0|L1}, /* 53: 0101 0011 */ - {JMP_w, 3,10,10,L0|L1}, /* 54: 0101 0100 llll llll hhhh hhhh */ - {OFFIW_wa_xx, 3,19,19,L0|L1}, /* 55: 0101 0101 oooo oooo xxxx xxxx */ - {ACI_A_xx, 2, 7, 7,L0|L1}, /* 56: 0101 0110 xxxx xxxx */ - {OFFI_A_xx, 2, 7, 7,L0|L1}, /* 57: 0101 0111 xxxx xxxx */ - {SETB, 2,13,13,L0|L1}, /* 58: 0101 1000 bbbb bbbb */ /* 7807 */ - {illegal, 2, 8, 8,L0|L1}, /* 59: 0101 1001 bbbb bbbb */ /* 7807 */ - {illegal, 2, 8, 8,L0|L1}, /* 5a: 0101 1010 bbbb bbbb */ /* 7807 */ - {CLR, 2,13,13,L0|L1}, /* 5b: 0101 1011 bbbb bbbb */ /* 7807 */ - {illegal, 2, 8, 8,L0|L1}, /* 5c: 0101 1100 bbbb bbbb */ /* 7807 */ - {SK_bit, 2,10,10,L0|L1}, /* 5d: 0101 1101 bbbb bbbb */ /* 7807 */ - {illegal, 2, 8, 8,L0|L1}, /* 5e: 0101 1110 bbbb bbbb */ /* 7807 */ - {illegal, 2, 8, 8,L0|L1}, /* 5f: 0101 1111 bbbb bbbb */ /* 7807 */ - - {PRE_60, 1, 0, 0,L0|L1}, /* 60: */ - {DAA, 1, 4, 4,L0|L1}, /* 61: 0110 0001 */ - {RETI, 1,13,13,L0|L1}, /* 62: 0110 0010 */ - {STAW_wa, 2,10,10,L0|L1}, /* 63: 0110 0011 oooo oooo */ - {PRE_64, 1, 0, 0,L0|L1}, /* 64: */ - {NEIW_wa_xx, 3,19,19,L0|L1}, /* 65: 0110 0101 oooo oooo xxxx xxxx */ - {SUI_A_xx, 2, 7, 7,L0|L1}, /* 66: 0110 0110 xxxx xxxx */ - {NEI_A_xx, 2, 7, 7,L0|L1}, /* 67: 0110 0111 xxxx xxxx */ - {MVI_V_xx, 2, 7, 7,L0|L1}, /* 68: 0110 1000 xxxx xxxx */ - {MVI_A_xx, 2, 7, 7,L0 }, /* 69: 0110 1001 xxxx xxxx */ - {MVI_B_xx, 2, 7, 7,L0|L1}, /* 6a: 0110 1010 xxxx xxxx */ - {MVI_C_xx, 2, 7, 7,L0|L1}, /* 6b: 0110 1011 xxxx xxxx */ - {MVI_D_xx, 2, 7, 7,L0|L1}, /* 6c: 0110 1100 xxxx xxxx */ - {MVI_E_xx, 2, 7, 7,L0|L1}, /* 6d: 0110 1101 xxxx xxxx */ - {MVI_H_xx, 2, 7, 7,L0|L1}, /* 6e: 0110 1110 xxxx xxxx */ - {MVI_L_xx, 2, 7, 7, L1}, /* 6f: 0110 1111 xxxx xxxx */ - - {PRE_70, 1, 0, 0,L0|L1}, /* 70: */ - {MVIW_wa_xx, 3,13,13,L0|L1}, /* 71: 0111 0001 oooo oooo xxxx xxxx */ - {SOFTI, 1,16,16,L0|L1}, /* 72: 0111 0010 */ - {illegal, 1, 0, 0,L0|L1}, /* 73: */ - {PRE_74, 1, 0, 0,L0|L1}, /* 74: prefix */ - {EQIW_wa_xx, 3,19,19,L0|L1}, /* 75: 0111 0101 oooo oooo xxxx xxxx */ - {SBI_A_xx, 2, 7, 7,L0|L1}, /* 76: 0111 0110 xxxx xxxx */ - {EQI_A_xx, 2, 7, 7,L0|L1}, /* 77: 0111 0111 xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 78: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 79: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7a: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7b: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7c: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7d: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7e: 0111 1xxx xxxx xxxx */ - {CALF, 2,13,13,L0|L1}, /* 7f: 0111 1xxx xxxx xxxx */ - - {CALT, 1,16,16,L0|L1}, /* 80: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 81: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 82: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 83: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 84: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 85: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 86: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 87: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 88: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 89: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8a: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8b: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8c: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8d: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8e: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 8f: 100x xxxx */ - - {CALT, 1,16,16,L0|L1}, /* 90: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 91: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 92: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 93: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 94: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 95: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 96: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 97: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 98: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 99: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9a: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9b: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9c: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9d: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9e: 100x xxxx */ - {CALT, 1,16,16,L0|L1}, /* 9f: 100x xxxx */ - - {POP_VA, 1,10,10,L0|L1}, /* a0: 1010 0000 */ - {POP_BC, 1,10,10,L0|L1}, /* a1: 1010 0001 */ - {POP_DE, 1,10,10,L0|L1}, /* a2: 1010 0010 */ - {POP_HL, 1,10,10,L0|L1}, /* a3: 1010 0011 */ - {POP_EA, 1,10,10,L0|L1}, /* a4: 1010 0100 */ - {DMOV_EA_BC, 1, 4, 4,L0|L1}, /* a5: 1010 0101 */ - {DMOV_EA_DE, 1, 4, 4,L0|L1}, /* a6: 1010 0110 */ - {DMOV_EA_HL, 1, 4, 4,L0|L1}, /* a7: 1010 0111 */ - {INX_EA, 1, 7, 7,L0|L1}, /* a8: 1010 1000 */ - {DCX_EA, 1, 7, 7,L0|L1}, /* a9: 1010 1001 */ - {EI, 1, 4, 4,L0|L1}, /* aa: 1010 1010 */ - {LDAX_D_xx, 2, 7, 7,L0|L1}, /* ab: 1010 1011 dddd dddd */ - {LDAX_H_A, 1, 7, 7,L0|L1}, /* ac: 1010 1100 */ - {LDAX_H_B, 1, 7, 7,L0|L1}, /* ad: 1010 1101 */ - {LDAX_H_EA, 1, 7, 7,L0|L1}, /* ae: 1010 1110 */ - {LDAX_H_xx, 2, 7, 7,L0|L1}, /* af: 1010 1111 dddd dddd */ - - {PUSH_VA, 1,13,13,L0|L1}, /* b0: 1011 0000 */ - {PUSH_BC, 1,13,13,L0|L1}, /* b1: 1011 0001 */ - {PUSH_DE, 1,13,13,L0|L1}, /* b2: 1011 0010 */ - {PUSH_HL, 1,13,13,L0|L1}, /* b3: 1011 0011 */ - {PUSH_EA, 1,13,13,L0|L1}, /* b4: 1011 0100 */ - {DMOV_BC_EA, 1, 4, 4,L0|L1}, /* b5: 1011 0101 */ - {DMOV_DE_EA, 1, 4, 4,L0|L1}, /* b6: 1011 0110 */ - {DMOV_HL_EA, 1, 4, 4,L0|L1}, /* b7: 1011 0111 */ - {RET, 1,10,10,L0|L1}, /* b8: 1011 1000 */ - {RETS, 1,10,10,L0|L1}, /* b9: 1011 1001 */ - {DI, 1, 4, 4,L0|L1}, /* ba: 1011 1010 */ - {STAX_D_xx, 2, 7, 7,L0|L1}, /* bb: 1011 1011 dddd dddd */ - {STAX_H_A, 1, 7, 7,L0|L1}, /* bc: 1011 1100 */ - {STAX_H_B, 1, 7, 7,L0|L1}, /* bd: 1011 1101 */ - {STAX_H_EA, 1, 7, 7,L0|L1}, /* be: 1011 1110 */ - {STAX_H_xx, 2, 7, 7,L0|L1}, /* bf: 1011 1111 dddd dddd */ - - {JR, 1,10,10,L0|L1}, /* c0: 1100 0000 */ - {JR, 1,10,10,L0|L1}, /* c1: 1100 0001 */ - {JR, 1,10,10,L0|L1}, /* c2: 1100 0010 */ - {JR, 1,10,10,L0|L1}, /* c3: 1100 0011 */ - {JR, 1,10,10,L0|L1}, /* c4: 1100 0100 */ - {JR, 1,10,10,L0|L1}, /* c5: 1100 0101 */ - {JR, 1,10,10,L0|L1}, /* c6: 1100 0110 */ - {JR, 1,10,10,L0|L1}, /* c7: 1100 0111 */ - {JR, 1,10,10,L0|L1}, /* c8: 1100 1000 */ - {JR, 1,10,10,L0|L1}, /* c9: 1100 1001 */ - {JR, 1,10,10,L0|L1}, /* ca: 1100 1010 */ - {JR, 1,10,10,L0|L1}, /* cb: 1100 1011 */ - {JR, 1,10,10,L0|L1}, /* cc: 1100 1100 */ - {JR, 1,10,10,L0|L1}, /* cd: 1100 1101 */ - {JR, 1,10,10,L0|L1}, /* ce: 1100 1110 */ - {JR, 1,10,10,L0|L1}, /* cf: 1100 1111 */ - - {JR, 1,10,10,L0|L1}, /* d0: 1101 0000 */ - {JR, 1,10,10,L0|L1}, /* d1: 1101 0001 */ - {JR, 1,10,10,L0|L1}, /* d2: 1101 0010 */ - {JR, 1,10,10,L0|L1}, /* d3: 1101 0011 */ - {JR, 1,10,10,L0|L1}, /* d4: 1101 0100 */ - {JR, 1,10,10,L0|L1}, /* d5: 1101 0101 */ - {JR, 1,10,10,L0|L1}, /* d6: 1101 0110 */ - {JR, 1,10,10,L0|L1}, /* d7: 1101 0111 */ - {JR, 1,10,10,L0|L1}, /* d8: 1101 1000 */ - {JR, 1,10,10,L0|L1}, /* d9: 1101 1001 */ - {JR, 1,10,10,L0|L1}, /* da: 1101 1010 */ - {JR, 1,10,10,L0|L1}, /* db: 1101 1011 */ - {JR, 1,10,10,L0|L1}, /* dc: 1101 1100 */ - {JR, 1,10,10,L0|L1}, /* dd: 1101 1101 */ - {JR, 1,10,10,L0|L1}, /* de: 1101 1110 */ - {JR, 1,10,10,L0|L1}, /* df: 1101 1111 */ - - {JR, 1,10,10,L0|L1}, /* e0: 1110 0000 */ - {JR, 1,10,10,L0|L1}, /* e1: 1110 0001 */ - {JR, 1,10,10,L0|L1}, /* e2: 1110 0010 */ - {JR, 1,10,10,L0|L1}, /* e3: 1110 0011 */ - {JR, 1,10,10,L0|L1}, /* e4: 1110 0100 */ - {JR, 1,10,10,L0|L1}, /* e5: 1110 0101 */ - {JR, 1,10,10,L0|L1}, /* e6: 1110 0110 */ - {JR, 1,10,10,L0|L1}, /* e7: 1110 0111 */ - {JR, 1,10,10,L0|L1}, /* e8: 1110 1000 */ - {JR, 1,10,10,L0|L1}, /* e9: 1110 1001 */ - {JR, 1,10,10,L0|L1}, /* ea: 1110 1010 */ - {JR, 1,10,10,L0|L1}, /* eb: 1110 1011 */ - {JR, 1,10,10,L0|L1}, /* ec: 1110 1100 */ - {JR, 1,10,10,L0|L1}, /* ed: 1110 1101 */ - {JR, 1,10,10,L0|L1}, /* ee: 1110 1110 */ - {JR, 1,10,10,L0|L1}, /* ef: 1110 1111 */ - - {JR, 1,10,10,L0|L1}, /* f0: 1111 0000 */ - {JR, 1,10,10,L0|L1}, /* f1: 1111 0001 */ - {JR, 1,10,10,L0|L1}, /* f2: 1111 0010 */ - {JR, 1,10,10,L0|L1}, /* f3: 1111 0011 */ - {JR, 1,10,10,L0|L1}, /* f4: 1111 0100 */ - {JR, 1,10,10,L0|L1}, /* f5: 1111 0101 */ - {JR, 1,10,10,L0|L1}, /* f6: 1111 0110 */ - {JR, 1,10,10,L0|L1}, /* f7: 1111 0111 */ - {JR, 1,10,10,L0|L1}, /* f8: 1111 1000 */ - {JR, 1,10,10,L0|L1}, /* f9: 1111 1001 */ - {JR, 1,10,10,L0|L1}, /* fa: 1111 1010 */ - {JR, 1,10,10,L0|L1}, /* fb: 1111 1011 */ - {JR, 1,10,10,L0|L1}, /* fc: 1111 1100 */ - {JR, 1,10,10,L0|L1}, /* fd: 1111 1101 */ - {JR, 1,10,10,L0|L1}, /* fe: 1111 1110 */ - {JR, 1,10,10,L0|L1} /* ff: 1111 1111 */ -}; - diff --git a/jan/src/cpu/upd7810/upd7810.cpp b/jan/src/cpu/upd7810/upd7810.cpp deleted file mode 100644 index 10f31887d..000000000 --- a/jan/src/cpu/upd7810/upd7810.cpp +++ /dev/null @@ -1,2273 +0,0 @@ -/***************************************************************************** - * - * upd7810.c - * Portable uPD7810/11, 7810H/11H, 78C10/C11/C14 emulator V0.3 - * - * Copyright (c) 2001 Juergen Buchmueller, all rights reserved. - * - * Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved. - * You can contact me at juergen@mame.net or pullmoll@stop1984.com - * - * - This source code is released as freeware for non-commercial purposes - * as part of the M.A.M.E. (Multiple Arcade Machine Emulator) project. - * The licensing terms of MAME apply to this piece of code for the MAME - * project and derviative works, as defined by the MAME license. You - * may opt to make modifications, improvements or derivative works under - * that same conditions, and the MAME project may opt to keep - * modifications, improvements or derivatives under their terms exclusively. - * - * - Alternatively you can choose to apply the terms of the "GPL" (see - * below) to this - and only this - piece of code or your derivative works. - * Note that in no case your choice can have any impact on any other - * source code of the MAME project, or binary, or executable, be it closely - * or losely related to this piece of code. - * - * - At your choice you are also free to remove either licensing terms from - * this file and continue to use it under only one of the two licenses. Do this - * if you think that licenses are not compatible (enough) for you, or if you - * consider either license 'too restrictive' or 'too free'. - * - * - GPL (GNU General Public License) - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * - * This work is based on the - * "NEC Electronics User's Manual, April 1987" - * - * NS20030115: - * - fixed INRW_wa() - * - TODO: add 7807, differences are listed below. - * I only added support for these opcodes needed by homedata.c (yes, I am - * lazy): - * 4C CE (MOV A,PT) - * 48 AC (EXA) - * 48 AD (EXR) - * 48 AE (EXH) - * 48 AF (EXX) - * 50 xx (SKN bit) - * 58 xx (SETB) - * 5B xx (CLR) - * 5D xx (SK bit) - * - *****************************************************************************/ -/* Hau around 23 May 2004 - gta, gti, dgt fixed - working reg opcodes fixed - sio input fixed --- - PeT around 19 February 2002 - type selection/gamemaster support added - gamemaster init hack? added - ORAX added - jre negativ fixed - prefixed opcodes skipping fixed - interrupts fixed and improved - sub(and related)/add/daa flags fixed - mvi ports,... fixed - rll, rlr, drll, drlr fixed - rets fixed - l0, l1 skipping fixed - calt fixed -*/ - -/* - -7807 DESCRIPTION - - - - PA0 1 64 Vcc - PA1 2 63 Vdd - PA2 3 62 PD7/AD7 - PA3 4 61 PD6/AD6 - PA4 5 60 PD5/AD5 - PA5 6 59 PD4/AD4 - PA6 7 58 PD3/AD3 - PA7 8 57 PD2/AD2 - PB0 9 56 PD1/AD1 - PB1 10 55 PD0/AD0 - PB2 11 54 PF7/AB15 - PB3 12 53 PF6/AB14 - PB4 13 52 PF5/AB13 - PB5 14 51 PF4/AB12 - PB6 15 50 PF3/AB11 - PB7 16 49 PF2/AB10 - PC0 17 48 PF1/AB9 - PC1 18 47 PF0/AB8 - PC2 19 46 ALE - PC3 20 45 WR* - PC4 21 44 RD* - PC5 22 43 HLDA - PC6 23 42 HOLD - PC7 24 41 PT7 - NMI* 25 40 PT6 - INT1 26 39 PT5 - MODE1 27 38 PT4 -RESET* 28 37 PT3 - MODE0 29 36 PT2 - X2 30 35 PT1 - X1 31 34 PT0 - Vss 32 33 Vth - -PA, PB, PC, PD, and PF is bidirectional I/O port -and PT is comparator input port in uPD7808. -uPD7807 uses PD port as data I/O and bottom address output, -and uses PF port as top address output. - -NMI* is non maskable interrupt input signal (negative edge trigger). - -INT1 is interrupt input (positive edge trigger). It can be used as -AC zero-cross input or trigger source of 16bit timer counter. - -MODE0 and MODE1 is input terminal which decides total amount of -external memory of uPD7807 (4KByte, 16KBYte, and 64KByte). -It also decides number of PF ports used as top address output. - 4KByte mode: PF0~PF3=address output, PF4~PF7=data I/O port -16KByte mode: PF0~PF5=address output, PF6~PF7=data I/O port -64KByte mode: PF0~PF7=address output - -RESET* is system rest terminal. - -X1 and X2 does clock signal generation (connect OSC and condenser). - -Vth is used to determine threshold voltage for PT port. -PT0~PT7 is connected to + input of each comparator, -and Vth deterimnes voltage connected to - input of PT0~PT7. -But the voltage of Vth is not directly connected to comapators. -It is connected via 16-level programmable voltage separate circuit. - -HOLD and HLDA is terminal for DMA. RD*, WR*, and ALE is bus -interface signal (they are same type of Intel 8085). -Unlike 8085, I/O address space is not available, so IO /M* signal -does not exist. Read/write of external memory can be done -by RD*, WR*, and ALE only. - -Vcc and Vss is main power source. Vdd is backup power source -for internal RWM (32 Byte). - - -PA and PB is I/O port. They have control register MA and MB. -If control register is set to 1, the port is input. -If control register is set to 0, the port is output. -They are set to 1 by reset. - -PT is input-only port. It is consisted of input terminal PT0~PT7 -and Vth (set threshold voltage). Each PT input has analog comparator -and latch, and + input of analog comparator is connected to -PT terminal. Every - input of analog comparator is connected -to devided voltage of Vth. Voltage dividing level can be set by -bottom 4bits of MT (mode T) register. The range is 1/16~16/16 of Vth. - -Other internal I/Os are -8bit timer (x2): Upcounter. If the counter matches to specified value, -the timer is reset and counts again from 0. -You can also set it to generate interrupt, or invert output flip-flop -when the counter matches to specified value. -Furthermore, you can output that flip-flop output to PC4/TO output, -connect it to clock input of timer/event counter or watchdog timer. -Or you can use it as bitrate clock of serial interface. -Note: There is only 1 output flip-flop for 2 timers. -If you use it for timer output of 1 timer, another timer cannot be used -for other than interrupt generator. -Clock input for timer can be switched between internal clock (2 type) -or PC3/TI input. You can set 1 timer's match-output as another timer's -clock input, so that you can use them as 1 16bit timer. - -16bit timer/event counter (x1): It can be used as -- Interval timer -- External event counter -- Frequency measurement -- Pulse width measurement -- Programmable rectangle wave output -- One pulse output -Related terminals are PC5/CI input, PC6/CO0 output, and PC7/CO1. -You can measure CI input's H duration, or you can output timing signal -(with phase difference) to CO0 and CO1. - -serial I/F (x1): has 3 modes. -- Asynchronous mode -- Synchronous mode -- I/O interface mode -In all 3 modes, bitrate can be internal fixed clock, or timer output, -or external clock. -In asynchronous mode, you can -- switch 7bit/8bit data -- set parity ON/OFF and EVEN/ODD -- set 1/2 stop bit - - - - -DIFFERENCES BETWEEN 7810 and 7807 - --------------------------- -8bit transfer instructions --------------------------- - -7810 -inst. 1st byte 2nd byte state action -EXX 00001001 4 Swap BC DE HL -EXA 00001000 4 Swap VA EA -EXH 01010000 4 Swap HL -BLOCK 00110001 13(C+1) (DE)+ <- (HL)+, C <- C - 1, until CY - -7807 -inst. 1st byte 2nd byte state action -EXR 01001000 10101101 8 Swap VA BC DE HL EA -EXX 01001000 10101111 8 Swap BC DE HL -EXA 01001000 10101100 8 Swap VA EA -EXH 01001000 10101110 8 Swap HL -BLOCK D+ 00010000 13(C+1) (DE)+ <- (HL)+, C <- C - 1, until CY -BLOCK D- 00010001 13(C+1) (DE)- <- (HL)-, C <- C - 1, until CY - - ---------------------------- -16bit transfer instructions ---------------------------- -All instructions are same except operand sr4 of DMOV instruction. -7810 -V0-sr4 -function - 0-ECNT-timer/event counter upcounter - 1-ECPT-timer/event counter capture - -7807 -V1-V0- sr4 -function - 0- 0-ECNT -timer/event counter upcounter - 0- 1-ECPT0-timer/event counter capture 0 - 1- 0-ECPT1-timer/event counter capture 1 - - ------------------------------------------ -8bit operation instructions for registers ------------------------------------------ -All instructions are same. - - --------------------------------------- -8bit operation instructions for memory --------------------------------------- -All instructions are same. - - ------------------------------------------ -Operation instructions for immediate data ------------------------------------------ -uPD7807 has read-only PT port and special register group sr5 for it. -ins. 1st byte 2nd byte 3rd 4th state func -GTI sr5, byte 01100100 s0101sss dd 14 !CY sr5 - byte - 1 -LTI sr5, byte 01100100 s0111sss dd 14 CY sr5 - byte -NEI sr5, byte 01100100 s1101sss dd 14 !Z sr5 - byte -EQI sr5, byte 01100100 s1111sss dd 14 Z sr5 - byte -ONI sr5, byte 01100100 s1001sss dd 14 !Z sr5 & byte -OFFI sr5, byte 01100100 s1011sss dd 14 Z sr5 & byte - -S5-S4-S3-S2-S1-S0-sr -sr1-sr2-sr5-register function - 0 0 1 1 1 0 --- PT --- PT comparator input port T data - 1 0 0 1 0 0 WDM WDM --- --- watchdog timer mode register - 1 0 0 1 0 1 MT --- --- --- port T mode - -7807 doesn't have registers below - 0 0 1 0 0 0 ANM ANM ANM A/D channel mode - 1 0 0 0 0 0 --- CR0 --- A/D conversion result 0 - 1 0 0 0 0 1 --- CR1 --- A/D conversion result 1 - 1 0 0 0 1 0 --- CR2 --- A/D conversion result 2 - 1 0 0 0 1 1 --- CR3 --- A/D conversion result 3 - 1 0 1 0 0 0 ZCM --- --- zero cross mode - -Special register operand (includes registers for I/O ports) has -6 groups - sr, sr1, sr2, sr3, sr4, and sr5. Among these groups, -sr, sr1, sr2, and sr5 includes registers described in the table -below, and expressed as bit pattern S5-S0. - -S5S4S3S2S1S0 sr sr1 sr2 sr5 register function -0 0 0 0 0 0 PA PA PA PA port A -0 0 0 0 0 1 PB PB PB PB port B -0 0 0 0 1 0 PC PC PC PC port C -0 0 0 0 1 1 PD PD PD PD port D -0 0 0 1 0 1 PF PF PF PF port F -0 0 0 1 1 0 MKH MKH MKH MKH mask high -0 0 0 1 1 1 MKL MKL MKL MKL mask low -0 0 1 0 0 1 SMH SMH SMH SMH serial mode high -0 0 1 0 1 0 SML --- --- --- serial mode low -0 0 1 0 1 1 EOM EOM EOM EOM timer/event counter output mode -0 0 1 1 0 0 ETMM --- --- --- timer/event counter mode -0 0 1 1 0 1 TMM TMM TMM TMM timer mode -0 0 1 1 1 0 --- PT --- PT port T -0 1 0 0 0 0 MM --- --- --- memory mapping -0 1 0 0 0 1 MCC --- --- --- mode control C -0 1 0 0 1 0 MA --- --- --- mode A -0 1 0 0 1 1 MB --- --- --- mode B -0 1 0 1 0 0 MC --- --- --- mode C -0 1 0 1 1 1 MF --- --- --- mode F -0 1 1 0 0 0 TXB --- --- --- Tx buffer -0 1 1 0 0 1 --- RXB --- --- Rx buffer -0 1 1 0 1 0 TM0 --- --- --- timer register 0 -0 1 1 0 1 1 TM1 --- --- --- timer register 1 -1 0 0 1 0 0 WDM WDM --- --- watchdog timer mode -1 0 0 1 0 1 MT --- --- --- mode T - -For sr and sr1, all 6bits (S5, S4, S3, S2, S1, and S0) are used. -For sr2 and sr5, only 4bits (S3, S2, S1, AND S0) are used. -They are expressed as 'ssssss' and 's sss' in operation code. -Note that 's sss' (of sr2 and sr5) is located separately. -S0 is rightmost bit (LSB). - - --------------------------------------------- -Operation instructions for working registers --------------------------------------------- -All instructions are same. - - --------------------------------------------------------------------------- -16bit operation instructions and divider/multiplier operation instructions --------------------------------------------------------------------------- -All instructions are same. - - ------------------------------------------- -Increment/decrement operation instructions ------------------------------------------- -All instructions are same. - - ----------------------------- -Other operation instructions ----------------------------- -7807 has CMC instruction (inverts CY flag). -ins. 1st byte 2nd byte 3rd 4th state func -CMC 01001000 10101010 8 CY <- !CY - - ---------------------------- -Rotation/shift instructions ---------------------------- -All instructions are same. - - ------------------------------ -Jump/call/return instructions ------------------------------ -All instructions are same. - - ------------------ -Skip instructions ------------------ -7807 doesn't have this -ins. 1st byte 2nd byte 3rd 4th state func -BIT bit, wa 01011bbb wwwwwwww 10* bit skip if (V.wa).bit = 1 - -Instead, 7807 has these bit manipulation instructions. -ins. 1st byte 2nd byte 3rd 4th state func -MOV CY, bit 01011111 bbbbbbbb 10* CY <- (bit) -MOV bit, CY 01011010 bbbbbbbb 13* (bit) <- CY -AND CY, bit 00110001 bbbbbbbb 10* CY <- CY & (bit) -OR CY, bit 01011100 bbbbbbbb 10* CY <- CY | (bit) -XOR CY, bit 01011110 bbbbbbbb 10* CY <- CY ^ (bit) -SETB bit 01011000 bbbbbbbb 13* (bit) <- 1 -CLR bit 01011011 bbbbbbbb 13* (bit) <- 0 -NOT bit 01011001 bbbbbbbb 13* (bit) <- !(bit) -SK bit 01011101 bbbbbbbb 10* (b) skip if (bit) = 1 -SKN bit 01010000 bbbbbbbb 10* !(b) skip if (bit) = 0 - - ------------------------- -CPU control instructions ------------------------- -ins. 1st byte 2nd byte 3rd 4th state func -HLT 01001000 00111011 11/12 halt -11 state in uPD7807 and uPD7810, 12 state in uPD78C10. - -STOP 01001000 10111011 12 stop -7807 doesn't have STOP instruction. - -*/ - - -#include "burnint.h" -#include "driver.h" -#include "state.h" -//#include "mamedbg.h" -#include "upd7810.h" - -static UINT8 *mem[3][0x100]; - -static UINT8 (*read_byte_8)(UINT16) = NULL; -static void (*write_byte_8)(UINT16,UINT8) = NULL; - -static UINT8 (*io_read_byte_8)(UINT8) = NULL; -static void (*io_write_byte_8)(UINT8,UINT8) = NULL; - -static void dummy_write(UINT16,UINT8) {} -static UINT8 dummy_read(UINT16) { return 0; } -static void dummy_write_port(UINT8,UINT8) {} -static UINT8 dummy_read_port(UINT8) { return 0; } - -static UINT8 cpu_readop(UINT16 address) -{ - if (mem[2][address/0x100]) { - return mem[2][address/0x100][address & 0xff]; - } - - if (read_byte_8) { - return read_byte_8(address); - } - - return 0; -} - -static UINT8 cpu_readop_arg(UINT16 address) -{ - if (mem[0][address/0x100]) { - return mem[0][address/0x100][address & 0xff]; - } - - if (read_byte_8) { - return read_byte_8(address); - } - - return 0; -} - -static UINT8 program_read_byte_8(UINT16 address) -{ - if (mem[2][address/0x100]) { - return mem[0][address/0x100][address & 0xff]; - } - - if (read_byte_8) { - return read_byte_8(address); - } - - return 0; -} - -static void program_write_byte_8(UINT16 address, UINT8 data) -{ - if (mem[1][address/0x100]) { - mem[1][address/0x100][address & 0xff] = data; - return; - } - - if (write_byte_8) { - write_byte_8(address,data); - return; - } -} - - -void upd7810SetReadPortHandler(UINT8 (*read_port)(UINT8)) -{ - io_read_byte_8 = read_port; -} - -void upd7810SetWritePortHandler(void (*write_port)(UINT8,UINT8)) -{ - io_write_byte_8 = write_port; -} - -void upd7810SetReadHandler(UINT8 (*read)(UINT16)) -{ - read_byte_8 = read; -} - -void upd7810SetWriteHandler(void (*write)(UINT16,UINT8)) -{ - write_byte_8 = write; -} - -void upd7810MapMemory(UINT8 *src, UINT16 start, UINT16 finish, UINT8 map) -{ - UINT16 len = (finish-start) >> 8; - - for (INT32 i = 0; i < len+1; i++) - { - UINT32 offset = i + (start >> 8); - if (map & (1 << 0)) mem[0][offset] = src + (i << 8); - if (map & (1 << 1)) mem[1][offset] = src + (i << 8); - if (map & (1 << 2)) mem[2][offset] = src + (i << 8); - } -} - - -static const struct opcode_s *opXX; // = opXX_7810; -static INT32 upd7810_config_type = TYPE_7810; -INT32 (*upd7810_io_callback)(INT32 ioline, INT32 state) = NULL; -INT32 (*upd7810_irq_callback)(INT32 line) = NULL; -#define change_pc(x) PC = (x) - - -static UPD7810 upd7810; -static int upd7810_icount; -static int upd7810_total_cycles; -static int upd7810_current_cycles; - -#if 0 -/* Layout of the registers in the debugger */ -static UINT8 upd7810_reg_layout[] = { - UPD7810_PC, UPD7810_PSW, UPD7810_A, UPD7810_V, UPD7810_EA, UPD7810_BC, UPD7810_DE, UPD7810_HL, -1, - UPD7810_SP, UPD7810_MM, UPD7810_A2, UPD7810_V2, UPD7810_EA2, UPD7810_BC2, UPD7810_DE2, UPD7810_HL2, -1, - UPD7810_TMM, UPD7810_CNT0, UPD7810_TM0, UPD7810_CNT1, UPD7810_TM1, -1, - UPD7810_ETMM, UPD7810_ECNT, UPD7810_ECPT, UPD7810_ETM0, UPD7810_ETM1, -1, - UPD7810_TXB, UPD7810_RXB, UPD7810_CR0, UPD7810_CR1, UPD7810_CR2, UPD7810_CR3, -1, - UPD7810_TXD, UPD7810_RXD, UPD7810_SCK, UPD7810_TI, UPD7810_TO, UPD7810_CI, UPD7810_CO0, UPD7810_CO1, 0 -}; - -/* Layout of the debugger windows x,y,w,h */ -static UINT8 upd7810_win_layout[] = { - 0, 0,80, 6, /* register window (top rows) */ - 0, 7,24,15, /* disassembler window (left colums) */ - 25, 7,55, 7, /* memory #1 window (right, upper middle) */ - 25,15,55, 7, /* memory #2 window (right, lower middle) */ - 0,23,80, 1, /* command line window (bottom rows) */ -}; -#endif - -#define CY 0x01 -#define F1 0x02 -#define L0 0x04 -#define L1 0x08 -#define HC 0x10 -#define SK 0x20 -#define Z 0x40 -#define F7 0x80 - -/* IRR flags */ -#define INTNMI 0x0001 -#define INTFT0 0x0002 -#define INTFT1 0x0004 -#define INTF1 0x0008 -#define INTF2 0x0010 -#define INTFE0 0x0020 -#define INTFE1 0x0040 -#define INTFEIN 0x0080 -#define INTFAD 0x0100 -#define INTFSR 0x0200 -#define INTFST 0x0400 -#define INTER 0x0800 -#define INTOV 0x1000 - -/* ITF flags */ -#define INTAN4 0x0001 -#define INTAN5 0x0002 -#define INTAN6 0x0004 -#define INTAN7 0x0008 -#define INTSB 0x0010 - -#define PPC upd7810.ppc.w.l -#define PC upd7810.pc.w.l -#define PCL upd7810.pc.b.l -#define PCH upd7810.pc.b.h -#define PCD upd7810.pc.d -#define SP upd7810.sp.w.l -#define SPL upd7810.sp.b.l -#define SPH upd7810.sp.b.h -#define SPD upd7810.sp.d -#define PSW upd7810.psw -#define OP upd7810.op -#define OP2 upd7810.op2 -#define IFF upd7810.iff -#define EA upd7810.ea.w.l -#define EAL upd7810.ea.b.l -#define EAH upd7810.ea.b.h -#define VA upd7810.va.w.l -#define V upd7810.va.b.h -#define A upd7810.va.b.l -#define VAD upd7810.va.d -#define BC upd7810.bc.w.l -#define B upd7810.bc.b.h -#define C upd7810.bc.b.l -#define DE upd7810.de.w.l -#define D upd7810.de.b.h -#define E upd7810.de.b.l -#define HL upd7810.hl.w.l -#define H upd7810.hl.b.h -#define L upd7810.hl.b.l -#define EA2 upd7810.ea2.w.l -#define VA2 upd7810.va2.w.l -#define BC2 upd7810.bc2.w.l -#define DE2 upd7810.de2.w.l -#define HL2 upd7810.hl2.w.l - -#define OVC0 upd7810.ovc0 -#define OVC1 upd7810.ovc1 -#define OVCE upd7810.ovce -#define OVCF upd7810.ovcf -#define OVCS upd7810.ovcs -#define EDGES upd7810.edges - -#define CNT0 upd7810.cnt.b.l -#define CNT1 upd7810.cnt.b.h -#define TM0 upd7810.tm.b.l -#define TM1 upd7810.tm.b.h -#define ECNT upd7810.ecnt.w.l -#define ECPT upd7810.ecnt.w.h -#define ETM0 upd7810.etm.w.l -#define ETM1 upd7810.etm.w.h - -#define MA upd7810.ma -#define MB upd7810.mb -#define MCC upd7810.mcc -#define MC upd7810.mc -#define MM upd7810.mm -#define MF upd7810.mf -#define TMM upd7810.tmm -#define ETMM upd7810.etmm -#define EOM upd7810.eom -#define SML upd7810.sml -#define SMH upd7810.smh -#define ANM upd7810.anm -#define MKL upd7810.mkl -#define MKH upd7810.mkh -#define ZCM upd7810.zcm - -#define CR0 upd7810.cr0 -#define CR1 upd7810.cr1 -#define CR2 upd7810.cr2 -#define CR3 upd7810.cr3 -#define RXB upd7810.rxb -#define TXB upd7810.txb - -#define RXD upd7810.rxd -#define TXD upd7810.txd -#define SCK upd7810.sck -#define TI upd7810.ti -#define TO upd7810.to -#define CI upd7810.ci -#define CO0 upd7810.co0 -#define CO1 upd7810.co1 - -#define IRR upd7810.irr -#define ITF upd7810.itf - -struct opcode_s { - void (*opfunc)(void); - UINT8 oplen; - UINT8 cycles; - UINT8 cycles_skip; - UINT8 mask_l0_l1; -}; - -#define RDOP(O) O = cpu_readop(PCD); PC++ -#define RDOPARG(A) A = cpu_readop_arg(PCD); PC++ -#define RM(A) program_read_byte_8(A) -#define WM(A,V) program_write_byte_8(A,V) - -#define ZHC_ADD(after,before,carry) \ - if (after == 0) PSW |= Z; else PSW &= ~Z; \ - if (after == before) \ - PSW = (PSW&~CY) | (carry); \ - else if (after < before) \ - PSW |= CY; \ - else \ - PSW &= ~CY; \ - if ((after & 15) < (before & 15)) \ - PSW |= HC; \ - else \ - PSW &= ~HC; \ - -#define ZHC_SUB(after,before,carry) \ - if (after == 0) PSW |= Z; else PSW &= ~Z; \ - if (before == after) \ - PSW = (PSW & ~CY) | (carry); \ - else if (after > before) \ - PSW |= CY; \ - else \ - PSW &= ~CY; \ - if ((after & 15) > (before & 15)) \ - PSW |= HC; \ - else \ - PSW &= ~HC; \ - -#define SKIP_CY if (CY == (PSW & CY)) PSW |= SK -#define SKIP_NC if (0 == (PSW & CY)) PSW |= SK -#define SKIP_Z if (Z == (PSW & Z)) PSW |= SK -#define SKIP_NZ if (0 == (PSW & Z)) PSW |= SK -#define SET_Z(n) if (n) PSW &= ~Z; else PSW |= Z - -static UINT8 RP(INT32 port) -{ - UINT8 data = 0xff; - switch (port) - { - case UPD7810_PORTA: - if (upd7810.ma) // NS20031301 no need to read if the port is set as output - upd7810.pa_in = io_read_byte_8(port); - data = (upd7810.pa_in & upd7810.ma) | (upd7810.pa_out & ~upd7810.ma); - break; - case UPD7810_PORTB: - if (upd7810.mb) // NS20031301 no need to read if the port is set as output - upd7810.pb_in = io_read_byte_8(port); - data = (upd7810.pb_in & upd7810.mb) | (upd7810.pb_out & ~upd7810.mb); - break; - case UPD7810_PORTC: - if (upd7810.mc) // NS20031301 no need to read if the port is set as output - upd7810.pc_in = io_read_byte_8(port); - data = (upd7810.pc_in & upd7810.mc) | (upd7810.pc_out & ~upd7810.mc); - if (upd7810.mcc & 0x01) /* PC0 = TxD output */ - data = (data & ~0x01) | (upd7810.txd & 1 ? 0x01 : 0x00); - if (upd7810.mcc & 0x02) /* PC1 = RxD input */ - data = (data & ~0x02) | (upd7810.rxd & 1 ? 0x02 : 0x00); - if (upd7810.mcc & 0x04) /* PC2 = SCK input/output */ - data = (data & ~0x04) | (upd7810.sck & 1 ? 0x04 : 0x00); - if (upd7810.mcc & 0x08) /* PC3 = TI input */ - data = (data & ~0x08) | (upd7810.ti & 1 ? 0x08 : 0x00); - if (upd7810.mcc & 0x10) /* PC4 = TO output */ - data = (data & ~0x10) | (upd7810.to & 1 ? 0x10 : 0x00); - if (upd7810.mcc & 0x20) /* PC5 = CI input */ - data = (data & ~0x20) | (upd7810.ci & 1 ? 0x20 : 0x00); - if (upd7810.mcc & 0x40) /* PC6 = CO0 output */ - data = (data & ~0x40) | (upd7810.co0 & 1 ? 0x40 : 0x00); - if (upd7810.mcc & 0x80) /* PC7 = CO1 output */ - data = (data & ~0x80) | (upd7810.co1 & 1 ? 0x80 : 0x00); - break; - case UPD7810_PORTD: - upd7810.pd_in = io_read_byte_8(port); - switch (upd7810.mm & 0x07) - { - case 0x00: /* PD input mode, PF port mode */ - data = upd7810.pd_in; - break; - case 0x01: /* PD output mode, PF port mode */ - data = upd7810.pd_out; - break; - default: /* PD extension mode, PF port/extension mode */ - data = 0xff; /* what do we see on the port here? */ - break; - } - break; - case UPD7810_PORTF: - upd7810.pf_in = io_read_byte_8(port); - switch (upd7810.mm & 0x06) - { - case 0x00: /* PD input/output mode, PF port mode */ - data = (upd7810.pf_in & upd7810.mf) | (upd7810.pf_out & ~upd7810.mf); - break; - case 0x02: /* PD extension mode, PF0-3 extension mode, PF4-7 port mode */ - data = (upd7810.pf_in & upd7810.mf) | (upd7810.pf_out & ~upd7810.mf); - data |= 0x0f; /* what would we see on the lower bits here? */ - break; - case 0x04: /* PD extension mode, PF0-5 extension mode, PF6-7 port mode */ - data = (upd7810.pf_in & upd7810.mf) | (upd7810.pf_out & ~upd7810.mf); - data |= 0x3f; /* what would we see on the lower bits here? */ - break; - case 0x06: - data = 0xff; /* what would we see on the lower bits here? */ - break; - } - break; - case UPD7807_PORTT: // NS20031301 partial implementation - data = io_read_byte_8(port); - break; - //default: - // logerror("uPD7810 internal error: RP() called with invalid port number\n"); - } - return data; -} - -static void WP(INT32 port, UINT8 data) -{ - switch (port) - { - case UPD7810_PORTA: - upd7810.pa_out = data; -// data = (data & ~upd7810.ma) | (upd7810.pa_in & upd7810.ma); - data = (data & ~upd7810.ma) | (upd7810.ma); // NS20031401 - io_write_byte_8(port, data); - break; - case UPD7810_PORTB: - upd7810.pb_out = data; -// data = (data & ~upd7810.mb) | (upd7810.pb_in & upd7810.mb); - data = (data & ~upd7810.mb) | (upd7810.mb); // NS20031401 - io_write_byte_8(port, data); - break; - case UPD7810_PORTC: - upd7810.pc_out = data; -// data = (data & ~upd7810.mc) | (upd7810.pc_in & upd7810.mc); - data = (data & ~upd7810.mc) | (upd7810.mc); // NS20031401 - if (upd7810.mcc & 0x01) /* PC0 = TxD output */ - data = (data & ~0x01) | (upd7810.txd & 1 ? 0x01 : 0x00); - if (upd7810.mcc & 0x02) /* PC1 = RxD input */ - data = (data & ~0x02) | (upd7810.rxd & 1 ? 0x02 : 0x00); - if (upd7810.mcc & 0x04) /* PC2 = SCK input/output */ - data = (data & ~0x04) | (upd7810.sck & 1 ? 0x04 : 0x00); - if (upd7810.mcc & 0x08) /* PC3 = TI input */ - data = (data & ~0x08) | (upd7810.ti & 1 ? 0x08 : 0x00); - if (upd7810.mcc & 0x10) /* PC4 = TO output */ - data = (data & ~0x10) | (upd7810.to & 1 ? 0x10 : 0x00); - if (upd7810.mcc & 0x20) /* PC5 = CI input */ - data = (data & ~0x20) | (upd7810.ci & 1 ? 0x20 : 0x00); - if (upd7810.mcc & 0x40) /* PC6 = CO0 output */ - data = (data & ~0x40) | (upd7810.co0 & 1 ? 0x40 : 0x00); - if (upd7810.mcc & 0x80) /* PC7 = CO1 output */ - data = (data & ~0x80) | (upd7810.co1 & 1 ? 0x80 : 0x00); - io_write_byte_8(port, data); - break; - case UPD7810_PORTD: - upd7810.pd_out = data; - switch (upd7810.mm & 0x07) - { - case 0x00: /* PD input mode, PF port mode */ - data = upd7810.pd_in; - break; - case 0x01: /* PD output mode, PF port mode */ - data = upd7810.pd_out; - break; - default: /* PD extension mode, PF port/extension mode */ - return; - } - io_write_byte_8(port, data); - break; - case UPD7810_PORTF: - upd7810.pf_out = data; - data = (data & ~upd7810.mf) | (upd7810.pf_in & upd7810.mf); - switch (upd7810.mm & 0x06) - { - case 0x00: /* PD input/output mode, PF port mode */ - break; - case 0x02: /* PD extension mode, PF0-3 extension mode, PF4-7 port mode */ - data |= 0x0f; /* what would come out for the lower bits here? */ - break; - case 0x04: /* PD extension mode, PF0-5 extension mode, PF6-7 port mode */ - data |= 0x3f; /* what would come out for the lower bits here? */ - break; - case 0x06: - data |= 0xff; /* what would come out for the lower bits here? */ - break; - } - io_write_byte_8(port, data); - break; - //default: - // logerror("uPD7810 internal error: RP() called with invalid port number\n"); - } -} - -static void upd7810_take_irq(void) -{ - UINT16 vector = 0; - int irqline = 0; - /* global interrupt disable? */ - if (0 == IFF) - return; - - /* check the interrupts in priority sequence */ - if ((IRR & INTFT0) && 0 == (MKL & 0x02)) - { - switch (upd7810_config_type) - { - case TYPE_7810_GAMEMASTER: - vector = 0xff2a; - break; - default: - vector = 0x0008; - } - if (!((IRR & INTFT1) && 0 == (MKL & 0x04))) - IRR&=~INTFT0; - } - else - if ((IRR & INTFT1) && 0 == (MKL & 0x04)) - { - switch (upd7810_config_type) - { - case TYPE_7810_GAMEMASTER: - vector = 0xff2a; - break; - default: - vector = 0x0008; - } - IRR&=~INTFT1; - } - else - if ((IRR & INTF1) && 0 == (MKL & 0x08)) - { - irqline = UPD7810_INTF1; - vector = 0x0010; - if (!((IRR & INTF2) && 0 == (MKL & 0x10))) - IRR&=~INTF1; - } - else - if ((IRR & INTF2) && 0 == (MKL & 0x10)) - { - irqline = UPD7810_INTF2; - vector = 0x0010; - IRR&=~INTF2; - } - else - if ((IRR & INTFE0) && 0 == (MKL & 0x20)) - { - switch (upd7810_config_type) - { - case TYPE_7810_GAMEMASTER: - vector = 0xff2d; - break; - default: - vector = 0x0018; - } - if (!((IRR & INTFE1) && 0 == (MKL & 0x40))) - IRR&=~INTFE0; - } - else - if ((IRR & INTFE1) && 0 == (MKL & 0x40)) - { - switch (upd7810_config_type) - { - case TYPE_7810_GAMEMASTER: - vector = 0xff2d; - break; - default: - vector = 0x0018; - } - IRR&=~INTFE1; - } - else - if ((IRR & INTFEIN) && 0 == (MKL & 0x80)) - { - vector = 0x0020; - } - else - if ((IRR & INTFAD) && 0 == (MKH & 0x01)) - { - vector = 0x0020; - } - else - if ((IRR & INTFSR) && 0 == (MKH & 0x02)) - { - vector = 0x0028; - IRR&=~INTFSR; - } - else - if ((IRR & INTFST) && 0 == (MKH & 0x04)) - { - vector = 0x0028; - IRR&=~INTFST; - } - if (vector) - { - /* acknowledge external IRQ */ - if (irqline && upd7810_irq_callback) - (*upd7810_irq_callback)(irqline); - SP--; - WM( SP, PSW ); - SP--; - WM( SP, PCH ); - SP--; - WM( SP, PCL ); - IFF = 0; - PSW &= ~(SK|L0|L1); - PC = vector; - change_pc( PCD ); - } -} - -static void upd7810_write_EOM(void) -{ - if (EOM & 0x01) /* output LV0 content ? */ - { - switch (EOM & 0x0e) - { - case 0x02: /* toggle CO0 */ - CO0 = (CO0 >> 1) | ((CO0 ^ 2) & 2); - break; - case 0x04: /* reset CO0 */ - CO0 = 0; - break; - case 0x08: /* set CO0 */ - CO0 = 1; - break; - } - } - if (EOM & 0x10) /* output LV0 content ? */ - { - switch (EOM & 0xe0) - { - case 0x20: /* toggle CO1 */ - CO1 = (CO1 >> 1) | ((CO1 ^ 2) & 2); - break; - case 0x40: /* reset CO1 */ - CO1 = 0; - break; - case 0x80: /* set CO1 */ - CO1 = 1; - break; - } - } -} - -static void upd7810_write_TXB(void) -{ - upd7810.txbuf = 1; -} - -#define PAR7(n) ((((n)>>6)^((n)>>5)^((n)>>4)^((n)>>3)^((n)>>2)^((n)>>1)^((n)))&1) -#define PAR8(n) ((((n)>>7)^((n)>>6)^((n)>>5)^((n)>>4)^((n)>>3)^((n)>>2)^((n)>>1)^((n)))&1) - -static void upd7810_sio_output(void) -{ - /* shift out more bits? */ - if (upd7810.txcnt > 0) - { - TXD = upd7810.txs & 1; - if (upd7810_io_callback) - (*upd7810_io_callback)(UPD7810_TXD,TXD); - upd7810.txs >>= 1; - upd7810.txcnt--; - if (0 == upd7810.txcnt) - IRR |= INTFST; /* serial transfer completed */ - } - else - if (SMH & 0x04) /* send enable ? */ - { - /* nothing written into the transmitter buffer ? */ - if (0 == upd7810.txbuf) - return; - upd7810.txbuf = 0; - - if (SML & 0x03) /* asynchronous mode ? */ - { - switch (SML & 0xfc) - { - case 0x48: /* 7bits, no parity, 1 stop bit */ - case 0x68: /* 7bits, no parity, 1 stop bit (parity select = 1 but parity is off) */ - /* insert start bit in bit0, stop bit int bit8 */ - upd7810.txs = (TXB << 1) | (1 << 8); - upd7810.txcnt = 9; - break; - case 0x4c: /* 8bits, no parity, 1 stop bit */ - case 0x6c: /* 8bits, no parity, 1 stop bit (parity select = 1 but parity is off) */ - /* insert start bit in bit0, stop bit int bit9 */ - upd7810.txs = (TXB << 1) | (1 << 9); - upd7810.txcnt = 10; - break; - case 0x58: /* 7bits, odd parity, 1 stop bit */ - /* insert start bit in bit0, parity in bit 8, stop bit in bit9 */ - upd7810.txs = (TXB << 1) | (PAR7(TXB) << 8) | (1 << 9); - upd7810.txcnt = 10; - break; - case 0x5c: /* 8bits, odd parity, 1 stop bit */ - /* insert start bit in bit0, parity in bit 9, stop bit int bit10 */ - upd7810.txs = (TXB << 1) | (PAR8(TXB) << 9) | (1 << 10); - upd7810.txcnt = 11; - break; - case 0x78: /* 7bits, even parity, 1 stop bit */ - /* insert start bit in bit0, parity in bit 8, stop bit in bit9 */ - upd7810.txs = (TXB << 1) | ((PAR7(TXB) ^ 1) << 8) | (1 << 9); - upd7810.txcnt = 10; - break; - case 0x7c: /* 8bits, even parity, 1 stop bit */ - /* insert start bit in bit0, parity in bit 9, stop bit int bit10 */ - upd7810.txs = (TXB << 1) | ((PAR8(TXB) ^ 1) << 9) | (1 << 10); - upd7810.txcnt = 11; - break; - case 0xc8: /* 7bits, no parity, 2 stop bits */ - case 0xe8: /* 7bits, no parity, 2 stop bits (parity select = 1 but parity is off) */ - /* insert start bit in bit0, stop bits int bit8+9 */ - upd7810.txs = (TXB << 1) | (3 << 8); - upd7810.txcnt = 10; - break; - case 0xcc: /* 8bits, no parity, 2 stop bits */ - case 0xec: /* 8bits, no parity, 2 stop bits (parity select = 1 but parity is off) */ - /* insert start bit in bit0, stop bits in bits9+10 */ - upd7810.txs = (TXB << 1) | (3 << 9); - upd7810.txcnt = 11; - break; - case 0xd8: /* 7bits, odd parity, 2 stop bits */ - /* insert start bit in bit0, parity in bit 8, stop bits in bits9+10 */ - upd7810.txs = (TXB << 1) | (PAR7(TXB) << 8) | (3 << 9); - upd7810.txcnt = 11; - break; - case 0xdc: /* 8bits, odd parity, 2 stop bits */ - /* insert start bit in bit0, parity in bit 9, stop bits int bit10+11 */ - upd7810.txs = (TXB << 1) | (PAR8(TXB) << 9) | (3 << 10); - upd7810.txcnt = 12; - break; - case 0xf8: /* 7bits, even parity, 2 stop bits */ - /* insert start bit in bit0, parity in bit 8, stop bits in bit9+10 */ - upd7810.txs = (TXB << 1) | ((PAR7(TXB) ^ 1) << 8) | (3 << 9); - upd7810.txcnt = 11; - break; - case 0xfc: /* 8bits, even parity, 2 stop bits */ - /* insert start bit in bit0, parity in bit 9, stop bits int bits10+10 */ - upd7810.txs = (TXB << 1) | ((PAR8(TXB) ^ 1) << 9) | (1 << 10); - upd7810.txcnt = 12; - break; - } - } - else - { - /* synchronous mode */ - upd7810.txs = TXB; - upd7810.txcnt = 8; - } - } -} - -static void upd7810_sio_input(void) -{ - /* sample next bit? */ - if (upd7810.rxcnt > 0) - { - if (upd7810_io_callback) - RXD = (*upd7810_io_callback)(UPD7810_RXD,RXD); - upd7810.rxs = (upd7810.rxs >> 1) | ((UINT16)RXD << 15); - upd7810.rxcnt--; - if (0 == upd7810.rxcnt) - { - /* reset the TSK bit */ - SMH &= ~0x40; - /* serial receive completed interrupt */ - IRR |= INTFSR; - /* now extract the data from the shift register */ - if (SML & 0x03) /* asynchronous mode ? */ - { - switch (SML & 0xfc) - { - case 0x48: /* 7bits, no parity, 1 stop bit */ - case 0x68: /* 7bits, no parity, 1 stop bit (parity select = 1 but parity is off) */ - upd7810.rxs >>= 16 - 9; - RXB = (upd7810.rxs >> 1) & 0x7f; - if ((1 << 8) != (upd7810.rxs & (1 | (1 << 8)))) - IRR |= INTER; /* framing error */ - break; - case 0x4c: /* 8bits, no parity, 1 stop bit */ - case 0x6c: /* 8bits, no parity, 1 stop bit (parity select = 1 but parity is off) */ - upd7810.rxs >>= 16 - 10; - RXB = (upd7810.rxs >> 1) & 0xff; - if ((1 << 9) != (upd7810.rxs & (1 | (1 << 9)))) - IRR |= INTER; /* framing error */ - break; - case 0x58: /* 7bits, odd parity, 1 stop bit */ - upd7810.rxs >>= 16 - 10; - RXB = (upd7810.rxs >> 1) & 0x7f; - if ((1 << 9) != (upd7810.rxs & (1 | (1 << 9)))) - IRR |= INTER; /* framing error */ - if (PAR7(RXB) != ((upd7810.rxs >> 8) & 1)) - IRR |= INTER; /* parity error */ - break; - case 0x5c: /* 8bits, odd parity, 1 stop bit */ - upd7810.rxs >>= 16 - 11; - RXB = (upd7810.rxs >> 1) & 0xff; - if ((1 << 10) != (upd7810.rxs & (1 | (1 << 10)))) - IRR |= INTER; /* framing error */ - if (PAR8(RXB) != ((upd7810.rxs >> 9) & 1)) - IRR |= INTER; /* parity error */ - break; - case 0x78: /* 7bits, even parity, 1 stop bit */ - upd7810.rxs >>= 16 - 10; - RXB = (upd7810.rxs >> 1) & 0x7f; - if ((1 << 9) != (upd7810.rxs & (1 | (1 << 9)))) - IRR |= INTER; /* framing error */ - if (PAR7(RXB) != ((upd7810.rxs >> 8) & 1)) - IRR |= INTER; /* parity error */ - break; - case 0x7c: /* 8bits, even parity, 1 stop bit */ - upd7810.rxs >>= 16 - 11; - RXB = (upd7810.rxs >> 1) & 0xff; - if ((1 << 10) != (upd7810.rxs & (1 | (1 << 10)))) - IRR |= INTER; /* framing error */ - if (PAR8(RXB) != ((upd7810.rxs >> 9) & 1)) - IRR |= INTER; /* parity error */ - break; - case 0xc8: /* 7bits, no parity, 2 stop bits */ - case 0xe8: /* 7bits, no parity, 2 stop bits (parity select = 1 but parity is off) */ - upd7810.rxs >>= 16 - 10; - RXB = (upd7810.rxs >> 1) & 0x7f; - if ((3 << 9) != (upd7810.rxs & (1 | (3 << 9)))) - IRR |= INTER; /* framing error */ - if (PAR7(RXB) != ((upd7810.rxs >> 8) & 1)) - IRR |= INTER; /* parity error */ - break; - case 0xcc: /* 8bits, no parity, 2 stop bits */ - case 0xec: /* 8bits, no parity, 2 stop bits (parity select = 1 but parity is off) */ - upd7810.rxs >>= 16 - 11; - RXB = (upd7810.rxs >> 1) & 0xff; - if ((3 << 10) != (upd7810.rxs & (1 | (3 << 10)))) - IRR |= INTER; /* framing error */ - if (PAR8(RXB) != ((upd7810.rxs >> 9) & 1)) - IRR |= INTER; /* parity error */ - break; - case 0xd8: /* 7bits, odd parity, 2 stop bits */ - upd7810.rxs >>= 16 - 11; - RXB = (upd7810.rxs >> 1) & 0x7f; - if ((3 << 10) != (upd7810.rxs & (1 | (3 << 10)))) - IRR |= INTER; /* framing error */ - if (PAR7(RXB) != ((upd7810.rxs >> 8) & 1)) - IRR |= INTER; /* parity error */ - break; - case 0xdc: /* 8bits, odd parity, 2 stop bits */ - upd7810.rxs >>= 16 - 12; - RXB = (upd7810.rxs >> 1) & 0xff; - if ((3 << 11) != (upd7810.rxs & (1 | (3 << 11)))) - IRR |= INTER; /* framing error */ - if (PAR8(RXB) != ((upd7810.rxs >> 9) & 1)) - IRR |= INTER; /* parity error */ - break; - case 0xf8: /* 7bits, even parity, 2 stop bits */ - upd7810.rxs >>= 16 - 11; - RXB = (upd7810.rxs >> 1) & 0x7f; - if ((3 << 10) != (upd7810.rxs & (1 | (3 << 10)))) - IRR |= INTER; /* framing error */ - if (PAR7(RXB) != ((upd7810.rxs >> 8) & 1)) - IRR |= INTER; /* parity error */ - break; - case 0xfc: /* 8bits, even parity, 2 stop bits */ - upd7810.rxs >>= 16 - 12; - RXB = (upd7810.rxs >> 1) & 0xff; - if ((3 << 11) != (upd7810.rxs & (1 | (3 << 11)))) - IRR |= INTER; /* framing error */ - if (PAR8(RXB) != ((upd7810.rxs >> 9) & 1)) - IRR |= INTER; /* parity error */ - break; - } - } - else - { - upd7810.rxs >>= 16 - 8; - RXB = upd7810.rxs; -// upd7810.rxcnt = 8; - } - } - } - else - if (SMH & 0x08) /* receive enable ? */ - { - if (SML & 0x03) /* asynchronous mode ? */ - { - switch (SML & 0xfc) - { - case 0x48: /* 7bits, no parity, 1 stop bit */ - case 0x68: /* 7bits, no parity, 1 stop bit (parity select = 1 but parity is off) */ - upd7810.rxcnt = 9; - break; - case 0x4c: /* 8bits, no parity, 1 stop bit */ - case 0x6c: /* 8bits, no parity, 1 stop bit (parity select = 1 but parity is off) */ - upd7810.rxcnt = 10; - break; - case 0x58: /* 7bits, odd parity, 1 stop bit */ - upd7810.rxcnt = 10; - break; - case 0x5c: /* 8bits, odd parity, 1 stop bit */ - upd7810.rxcnt = 11; - break; - case 0x78: /* 7bits, even parity, 1 stop bit */ - upd7810.rxcnt = 10; - break; - case 0x7c: /* 8bits, even parity, 1 stop bit */ - upd7810.rxcnt = 11; - break; - case 0xc8: /* 7bits, no parity, 2 stop bits */ - case 0xe8: /* 7bits, no parity, 2 stop bits (parity select = 1 but parity is off) */ - upd7810.rxcnt = 10; - break; - case 0xcc: /* 8bits, no parity, 2 stop bits */ - case 0xec: /* 8bits, no parity, 2 stop bits (parity select = 1 but parity is off) */ - upd7810.rxcnt = 11; - break; - case 0xd8: /* 7bits, odd parity, 2 stop bits */ - upd7810.rxcnt = 11; - break; - case 0xdc: /* 8bits, odd parity, 2 stop bits */ - upd7810.rxcnt = 12; - break; - case 0xf8: /* 7bits, even parity, 2 stop bits */ - upd7810.rxcnt = 11; - break; - case 0xfc: /* 8bits, even parity, 2 stop bits */ - upd7810.rxcnt = 12; - break; - } - } - else - /* TSK bit set ? */ - if (SMH & 0x40) - { - upd7810.rxcnt = 8; - } - } -} - -static void upd7810_timers(int cycles) -{ - /**** TIMER 0 ****/ - if (TMM & 0x10) /* timer 0 upcounter reset ? */ - CNT0 = 0; - else - { - switch (TMM & 0x0c) /* timer 0 clock source */ - { - case 0x00: /* clock divided by 12 */ - OVC0 += cycles; - while (OVC0 >= 12) - { - OVC0 -= 12; - CNT0++; - if (CNT0 == TM0) - { - CNT0 = 0; - IRR |= INTFT0; - /* timer F/F source is timer 0 ? */ - if (0x00 == (TMM & 0x03)) - { - TO ^= 1; - if (upd7810_io_callback) - (*upd7810_io_callback)(UPD7810_TO,TO); - } - /* timer 1 chained with timer 0 ? */ - if ((TMM & 0xe0) == 0x60) - { - CNT1++; - if (CNT1 == TM1) - { - IRR |= INTFT1; - CNT1 = 0; - /* timer F/F source is timer 1 ? */ - if (0x01 == (TMM & 0x03)) - { - TO ^= 1; - if (upd7810_io_callback) - (*upd7810_io_callback)(UPD7810_TO,TO); - } - } - } - } - } - break; - case 0x04: /* clock divided by 384 */ - OVC0 += cycles; - while (OVC0 >= 384) - { - OVC0 -= 384; - CNT0++; - if (CNT0 == TM0) - { - CNT0 = 0; - IRR |= INTFT0; - /* timer F/F source is timer 0 ? */ - if (0x00 == (TMM & 0x03)) - { - TO ^= 1; - if (upd7810_io_callback) - (*upd7810_io_callback)(UPD7810_TO,TO); - } - /* timer 1 chained with timer 0 ? */ - if ((TMM & 0xe0) == 0x60) - { - CNT1++; - if (CNT1 == TM1) - { - CNT1 = 0; - IRR |= INTFT1; - /* timer F/F source is timer 1 ? */ - if (0x01 == (TMM & 0x03)) - { - TO ^= 1; - if (upd7810_io_callback) - (*upd7810_io_callback)(UPD7810_TO,TO); - } - } - } - } - } - break; - case 0x08: /* external signal at TI */ - break; - case 0x0c: /* disabled */ - break; - } - } - - /**** TIMER 1 ****/ - if (TMM & 0x80) /* timer 1 upcounter reset ? */ - CNT1 = 0; - else - { - switch (TMM & 0x60) /* timer 1 clock source */ - { - case 0x00: /* clock divided by 12 */ - OVC1 += cycles; - while (OVC1 >= 12) - { - OVC1 -= 12; - CNT1++; - if (CNT1 == TM1) - { - CNT1 = 0; - IRR |= INTFT1; - /* timer F/F source is timer 1 ? */ - if (0x01 == (TMM & 0x03)) - { - TO ^= 1; - if (upd7810_io_callback) - (*upd7810_io_callback)(UPD7810_TO,TO); - } - } - } - break; - case 0x20: /* clock divided by 384 */ - OVC1 += cycles; - while (OVC1 >= 384) - { - OVC1 -= 384; - CNT1++; - if (CNT1 == TM1) - { - CNT1 = 0; - IRR |= INTFT1; - /* timer F/F source is timer 1 ? */ - if (0x01 == (TMM & 0x03)) - { - TO ^= 1; - if (upd7810_io_callback) - (*upd7810_io_callback)(UPD7810_TO,TO); - } - } - } - break; - case 0x40: /* external signal at TI */ - break; - case 0x60: /* clocked with timer 0 */ - break; - } - } - - /**** TIMER F/F ****/ - /* timer F/F source is clock divided by 3 ? */ - if (0x02 == (TMM & 0x03)) - { - OVCF += cycles; - while (OVCF >= 3) - { - TO ^= 1; - if (upd7810_io_callback) - (*upd7810_io_callback)(UPD7810_TO,TO); - OVCF -= 3; - } - } - - /**** ETIMER ****/ - /* ECNT clear */ - if (0x00 == (ETMM & 0x0c)) - ECNT = 0; - else - if (0x00 == (ETMM & 0x03) || (0x01 == (ETMM & 0x03) && CI)) - { - OVCE += cycles; - /* clock divided by 12 */ - while (OVCE >= 12) - { - OVCE -= 12; - ECNT++; - switch (ETMM & 0x0c) - { - case 0x00: /* clear ECNT */ - break; - case 0x04: /* free running */ - if (0 == ECNT) - ITF |= INTOV; /* set overflow flag if counter wrapped */ - break; - case 0x08: /* reset at falling edge of CI or TO */ - break; - case 0x0c: /* reset if ECNT == ETM1 */ - if (ETM1 == ECNT) - ECNT = 0; - break; - } - switch (ETMM & 0x30) - { - case 0x00: /* set CO0 if ECNT == ETM0 */ - if (ETM0 == ECNT) - { - switch (EOM & 0x0e) - { - case 0x02: /* toggle CO0 */ - CO0 = (CO0 >> 1) | ((CO0 ^ 2) & 2); - break; - case 0x04: /* reset CO0 */ - CO0 = 0; - break; - case 0x08: /* set CO0 */ - CO0 = 1; - break; - } - } - break; - case 0x10: /* prohibited */ - break; - case 0x20: /* set CO0 if ECNT == ETM0 or at falling CI input */ - if (ETM0 == ECNT) - { - switch (EOM & 0x0e) - { - case 0x02: /* toggle CO0 */ - CO0 = (CO0 >> 1) | ((CO0 ^ 2) & 2); - break; - case 0x04: /* reset CO0 */ - CO0 = 0; - break; - case 0x08: /* set CO0 */ - CO0 = 1; - break; - } - } - break; - case 0x30: /* latch CO0 if ECNT == ETM0 or ECNT == ETM1 */ - if (ETM0 == ECNT || ETM1 == ECNT) - { - switch (EOM & 0x0e) - { - case 0x02: /* toggle CO0 */ - CO0 = (CO0 >> 1) | ((CO0 ^ 2) & 2); - break; - case 0x04: /* reset CO0 */ - CO0 = 0; - break; - case 0x08: /* set CO0 */ - CO0 = 1; - break; - } - } - break; - } - switch (ETMM & 0xc0) - { - case 0x00: /* lacth CO1 if ECNT == ETM1 */ - if (ETM1 == ECNT) - { - switch (EOM & 0xe0) - { - case 0x20: /* toggle CO1 */ - CO1 = (CO1 >> 1) | ((CO1 ^ 2) & 2); - break; - case 0x40: /* reset CO1 */ - CO1 = 0; - break; - case 0x80: /* set CO1 */ - CO1 = 1; - break; - } - } - break; - case 0x40: /* prohibited */ - break; - case 0x80: /* latch CO1 if ECNT == ETM1 or falling edge of CI input */ - if (ETM1 == ECNT) - { - switch (EOM & 0xe0) - { - case 0x20: /* toggle CO1 */ - CO1 = (CO1 >> 1) | ((CO1 ^ 2) & 2); - break; - case 0x40: /* reset CO1 */ - CO1 = 0; - break; - case 0x80: /* set CO1 */ - CO1 = 1; - break; - } - } - break; - case 0xc0: /* latch CO1 if ECNT == ETM0 or ECNT == ETM1 */ - if (ETM0 == ECNT || ETM1 == ECNT) - { - switch (EOM & 0xe0) - { - case 0x20: /* toggle CO1 */ - CO1 = (CO1 >> 1) | ((CO1 ^ 2) & 2); - break; - case 0x40: /* reset CO1 */ - CO1 = 0; - break; - case 0x80: /* set CO1 */ - CO1 = 1; - break; - } - } - break; - } - } - } - - /**** SIO ****/ - switch (SMH & 0x03) - { - case 0x00: /* interval timer F/F */ - break; - case 0x01: /* internal clock divided by 384 */ - OVCS += cycles; - while (OVCS >= 384) - { - OVCS -= 384; - if (0 == (EDGES ^= 1)) - upd7810_sio_input(); - else - upd7810_sio_output(); - } - break; - case 0x02: /* internal clock divided by 24 */ - OVCS += cycles; - while (OVCS >= 24) - { - OVCS -= 24; - if (0 == (EDGES ^= 1)) - upd7810_sio_input(); - else - upd7810_sio_output(); - } - break; - } -} - -#include "7810tbl.c" -#include "7810ops.c" - - -static void upd7810_init(INT32 (*io_callback)(INT32 ioline, INT32 state)) -{ - upd7810_io_callback = io_callback; - - read_byte_8 = dummy_read; - write_byte_8 = dummy_write; - io_read_byte_8 = dummy_read_port; - io_write_byte_8 = dummy_write_port; - - memset (mem, 0, 3 * 0x100 * sizeof(UINT8*)); - - -#if 0 - int cpu = cpu_getactivecpu(); - - state_save_register_UINT16("upd7810", cpu, "ppc", &upd7810.ppc.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "pc", &upd7810.pc.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "sp", &upd7810.sp.w.l, 1); - state_save_register_UINT8 ("upd7810", cpu, "psw", &upd7810.psw, 1); - state_save_register_UINT8 ("upd7810", cpu, "op", &upd7810.op, 1); - state_save_register_UINT8 ("upd7810", cpu, "op2", &upd7810.op2, 1); - state_save_register_UINT8 ("upd7810", cpu, "iff", &upd7810.iff, 1); - state_save_register_UINT16("upd7810", cpu, "ea", &upd7810.ea.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "va", &upd7810.va.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "bc", &upd7810.bc.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "de", &upd7810.de.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "hl", &upd7810.hl.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "ea2", &upd7810.ea2.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "va2", &upd7810.va2.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "bc2", &upd7810.bc2.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "de2", &upd7810.de2.w.l, 1); - state_save_register_UINT16("upd7810", cpu, "hl2", &upd7810.hl2.w.l, 1); - state_save_register_UINT32("upd7810", cpu, "cnt", &upd7810.cnt.d, 1); - state_save_register_UINT32("upd7810", cpu, "tm", &upd7810.tm.d, 1); - state_save_register_UINT32("upd7810", cpu, "ecnt", &upd7810.ecnt.d, 1); - state_save_register_UINT32("upd7810", cpu, "etm", &upd7810.etm.d, 1); - state_save_register_UINT8 ("upd7810", cpu, "ma", &upd7810.ma, 1); - state_save_register_UINT8 ("upd7810", cpu, "mb", &upd7810.mb, 1); - state_save_register_UINT8 ("upd7810", cpu, "mcc", &upd7810.mcc, 1); - state_save_register_UINT8 ("upd7810", cpu, "mc", &upd7810.mc, 1); - state_save_register_UINT8 ("upd7810", cpu, "mm", &upd7810.mm, 1); - state_save_register_UINT8 ("upd7810", cpu, "mf", &upd7810.mf, 1); - state_save_register_UINT8 ("upd7810", cpu, "tmm", &upd7810.tmm, 1); - state_save_register_UINT8 ("upd7810", cpu, "etmm", &upd7810.etmm, 1); - state_save_register_UINT8 ("upd7810", cpu, "eom", &upd7810.eom, 1); - state_save_register_UINT8 ("upd7810", cpu, "sml", &upd7810.sml, 1); - state_save_register_UINT8 ("upd7810", cpu, "smh", &upd7810.smh, 1); - state_save_register_UINT8 ("upd7810", cpu, "anm", &upd7810.anm, 1); - state_save_register_UINT8 ("upd7810", cpu, "mkl", &upd7810.mkl, 1); - state_save_register_UINT8 ("upd7810", cpu, "mkh", &upd7810.mkh, 1); - state_save_register_UINT8 ("upd7810", cpu, "zcm", &upd7810.zcm, 1); - state_save_register_UINT8 ("upd7810", cpu, "pa_out", &upd7810.pa_out, 1); - state_save_register_UINT8 ("upd7810", cpu, "pb_out", &upd7810.pb_out, 1); - state_save_register_UINT8 ("upd7810", cpu, "pc_out", &upd7810.pc_out, 1); - state_save_register_UINT8 ("upd7810", cpu, "pd_out", &upd7810.pd_out, 1); - state_save_register_UINT8 ("upd7810", cpu, "pf_out", &upd7810.pf_out, 1); - state_save_register_UINT8 ("upd7810", cpu, "cr0", &upd7810.cr0, 1); - state_save_register_UINT8 ("upd7810", cpu, "cr1", &upd7810.cr1, 1); - state_save_register_UINT8 ("upd7810", cpu, "cr2", &upd7810.cr2, 1); - state_save_register_UINT8 ("upd7810", cpu, "cr3", &upd7810.cr3, 1); - state_save_register_UINT8 ("upd7810", cpu, "txb", &upd7810.txb, 1); - state_save_register_UINT8 ("upd7810", cpu, "rxb", &upd7810.rxb, 1); - state_save_register_UINT8 ("upd7810", cpu, "txd", &upd7810.txd, 1); - state_save_register_UINT8 ("upd7810", cpu, "rxd", &upd7810.rxd, 1); - state_save_register_UINT8 ("upd7810", cpu, "sck", &upd7810.sck, 1); - state_save_register_UINT8 ("upd7810", cpu, "ti", &upd7810.ti, 1); - state_save_register_UINT8 ("upd7810", cpu, "to", &upd7810.to, 1); - state_save_register_UINT8 ("upd7810", cpu, "ci", &upd7810.ci, 1); - state_save_register_UINT8 ("upd7810", cpu, "co0", &upd7810.co0, 1); - state_save_register_UINT8 ("upd7810", cpu, "co1", &upd7810.co1, 1); - state_save_register_UINT16("upd7810", cpu, "irr", &upd7810.irr, 1); - state_save_register_UINT16("upd7810", cpu, "itf", &upd7810.itf, 1); - state_save_register_INT32 ("upd7810", cpu, "ovc0", &upd7810.ovc0, 1); - state_save_register_INT32 ("upd7810", cpu, "ovc1", &upd7810.ovc1, 1); - state_save_register_INT32 ("upd7810", cpu, "ovcf", &upd7810.ovcf, 1); - state_save_register_INT32 ("upd7810", cpu, "ovcs", &upd7810.ovcs, 1); - state_save_register_UINT8 ("upd7810", cpu, "edges",&upd7810.edges,1); -#endif -} - -INT32 upd7810Scan(INT32 nAction) -{ - struct BurnArea ba; - - if (nAction & ACB_DRIVER_DATA) - { - ba.Data = &upd7810; - ba.nLen = sizeof(upd7810); - ba.nAddress = 0; - ba.szName = "Upd Regs"; - BurnAcb(&ba); - - SCAN_VAR(upd7810_icount); - SCAN_VAR(upd7810_total_cycles); - SCAN_VAR(upd7810_current_cycles); - } - - return 0; -} - -void upd7810Init(INT32 (*io_callback)(INT32 ioline, INT32 state)) -{ - upd7810_init(io_callback); - - opXX = opXX_7810; - -} - -void upd7807Init(INT32 (*io_callback)(INT32 ioline, INT32 state)) -{ - upd7810_init(io_callback); - - opXX = opXX_7807; - -} - -void upd7810Reset() -{ - memset(&upd7810, 0, sizeof(upd7810)); - ETMM = 0xff; - TMM = 0xff; - MA = 0xff; - MB = 0xff; - switch (upd7810_config_type) - { - case TYPE_7810_GAMEMASTER: - // needed for lcd screen/ram selection; might be internal in cpu and therefor not needed; 0x10 written in some games - MC = 0xff&~0x7; - WP( UPD7810_PORTC, 1 ); //hyper space - PCD=0x8000; - break; - default: - MC = 0xff; - } - MF = 0xff; - // gamemaster falling block "and"s to enable interrupts - MKL = 0xff; - MKH = 0xff; //? - - upd7810_icount = 0; - upd7810_total_cycles = 0; - upd7810_current_cycles = 0; -} - -void upd7810Exit() -{ - upd7810_io_callback = NULL; - upd7810_config_type = 0; -} - -static int run_end = 0; - -INT32 upd7810Run(INT32 cycles) -{ - upd7810_current_cycles = cycles; - upd7810_icount = cycles; - - do - { - int cc = 0; - -#if 0 - CALL_MAME_DEBUG; -#endif - PPC = PC; - - RDOP(OP); - - /* - * clear L0 and/or L1 flags for all opcodes except - * L0 for "MVI L,xx" or "LXI H,xxxx" - * L1 for "MVI A,xx" - */ - PSW &= ~opXX[OP].mask_l0_l1; - - /* skip flag set and not SOFTI opcode? */ - if ((PSW & SK) && (OP != 0x72)) - { - if (opXX[OP].cycles) - { - cc = opXX[OP].cycles_skip; - PC += opXX[OP].oplen - 1; - } - else - { - RDOP(OP2); - - switch (OP) - { - case 0x48: - cc = op48[OP2].cycles_skip; - PC += op48[OP2].oplen - 2; - break; - case 0x4c: - cc = op4C[OP2].cycles_skip; - PC += op4C[OP2].oplen - 2; - break; - case 0x4d: - cc = op4D[OP2].cycles_skip; - PC += op4D[OP2].oplen - 2; - break; - case 0x60: - cc = op60[OP2].cycles_skip; - PC += op60[OP2].oplen - 2; - break; - case 0x64: - cc = op64[OP2].cycles_skip; - PC += op64[OP2].oplen - 2; - break; - case 0x70: - cc = op70[OP2].cycles_skip; - PC += op70[OP2].oplen - 2; - break; - case 0x74: - cc = op74[OP2].cycles_skip; - PC += op74[OP2].oplen - 2; - break; - //default: - // osd_die("uPD7810 internal error: check cycle counts for main\n"); - } - } - - PSW &= ~SK; - upd7810_timers( cc ); - change_pc( PCD ); - } - else - { - cc = opXX[OP].cycles; - upd7810_timers( cc ); - (*opXX[OP].opfunc)(); - } - - upd7810_icount -= cc; - upd7810_take_irq(); - - if (run_end) { - run_end = 0; - break; - } - } while (upd7810_icount > 0); - - upd7810_total_cycles += (upd7810_current_cycles - upd7810_icount); - - INT32 ret = cycles - upd7810_icount; - - upd7810_total_cycles = 0; - upd7810_current_cycles = 0; - upd7810_icount = 0; - - return ret; -} - -INT32 upd7810TotalCycles() -{ - return upd7810_total_cycles; // + (upd7810_current_cycles - upd7810_icount); -} - -void upd7810NewFrame() -{ - upd7810_total_cycles = 0; - upd7810_current_cycles = 0; - upd7810_icount = 0; -} - -void upd7810RunEnd() -{ - run_end = 1; -} - -#if 0 -static void upd7810_get_context (void *dst) -{ - if (dst) - memcpy(dst, &upd7810, sizeof(upd7810)); -} - -static void upd7810_set_context (void *src) -{ - if (src) - memcpy(&upd7810, src, sizeof(upd7810)); -} -#endif - -static void set_irq_line(int irqline, int state) -{ - if (state != CLEAR_LINE) - { - if (irqline == CPU_IRQLINE_NMI) - { - /* no nested NMIs ? */ -// if (0 == (IRR & INTNMI)) - { - IRR |= INTNMI; - SP--; - WM( SP, PSW ); - SP--; - WM( SP, PCH ); - SP--; - WM( SP, PCL ); - IFF = 0; - PSW &= ~(SK|L0|L1); - PC = 0x0004; - change_pc( PCD ); - } - } - else - if (irqline == UPD7810_INTF1) - IRR |= INTF1; - else - if (irqline == UPD7810_INTF2) - IRR |= INTF2; - // gamemaster hack - else - if (irqline == UPD7810_INTFE1) - IRR |= INTFE1; - // else - // logerror("upd7810_set_irq_line invalid irq line #%d\n", irqline); - } - /* resetting interrupt requests is done with the SKIT/SKNIT opcodes only! */ -} - -void upd7810SetIRQLine(INT32 line, INT32 state) -{ - if (state == CPU_IRQSTATUS_AUTO) - { - set_irq_line(line, 1); - upd7810Run(10); - set_irq_line(line, 0); - - } - else - { - set_irq_line(line, state); - //upd7810Run(10); - } -} - -#if 0 - -static offs_t upd7810_dasm(char *buffer, offs_t pc) -{ -#ifdef MAME_DEBUG - return Dasm7810( buffer, pc ); -#else - UINT8 op = cpu_readop(pc); - sprintf( buffer, "$%02X", op ); - return 1; -#endif -} - - -static offs_t upd7807_dasm(char *buffer, offs_t pc) -{ -#ifdef MAME_DEBUG - return Dasm7807( buffer, pc ); -#else - UINT8 op = cpu_readop(pc); - sprintf( buffer, "$%02X", op ); - return 1; -#endif -} - - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static void upd7810_set_info(UINT32 state, union cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(INPUT_LINE_NMI, info->i); break; - case CPUINFO_INT_INPUT_STATE + UPD7810_INTF1: set_irq_line(UPD7810_INTF1, info->i); break; - case CPUINFO_INT_INPUT_STATE + UPD7810_INTF2: set_irq_line(UPD7810_INTF2, info->i); break; - case CPUINFO_INT_INPUT_STATE + UPD7810_INTFE1: set_irq_line(UPD7810_INTFE1, info->i); break; - - case CPUINFO_INT_PC: PC = info->i; change_pc(PCD); break; - case CPUINFO_INT_REGISTER + UPD7810_PC: PC = info->i; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + UPD7810_SP: SP = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_PSW: PSW = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_A: A = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_V: V = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_EA: EA = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_VA: VA = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_BC: BC = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_DE: DE = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_HL: HL = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_EA2: EA2 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_VA2: VA2 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_BC2: BC2 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_DE2: DE2 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_HL2: HL2 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_CNT0: CNT0 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_CNT1: CNT1 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_TM0: TM0 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_TM1: TM1 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_ECNT: ECNT = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_ECPT: ECPT = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_ETM0: ETM0 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_ETM1: ETM1 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_MA: MA = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_MB: MB = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_MCC: MCC = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_MC: MC = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_MM: MM = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_MF: MF = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_TMM: TMM = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_ETMM: ETMM = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_EOM: EOM = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_SML: SML = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_SMH: SMH = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_ANM: ANM = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_MKL: MKL = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_MKH: MKH = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_ZCM: ZCM = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_TXB: TXB = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_RXB: RXB = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_CR0: CR0 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_CR1: CR1 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_CR2: CR2 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_CR3: CR3 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_TXD: TXD = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_RXD: RXD = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_SCK: SCK = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_TI: TI = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_TO: TO = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_CI: CI = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_CO0: CO0 = info->i; break; - case CPUINFO_INT_REGISTER + UPD7810_CO1: CO1 = info->i; break; - - /* --- the following bits of info are set as pointers to data or functions --- */ - case CPUINFO_PTR_IRQ_CALLBACK: upd7810.irq_callback = info->irqcallback; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void upd7810_get_info(UINT32 state, union cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(upd7810); break; - case CPUINFO_INT_INPUT_LINES: info->i = 2; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = (IRR & INTNMI) ? ASSERT_LINE : CLEAR_LINE; break; - case CPUINFO_INT_INPUT_STATE + UPD7810_INTF1: info->i = (IRR & INTF1) ? ASSERT_LINE : CLEAR_LINE; break; - case CPUINFO_INT_INPUT_STATE + UPD7810_INTF2: info->i = (IRR & INTF2) ? ASSERT_LINE : CLEAR_LINE; break; - case CPUINFO_INT_INPUT_STATE + UPD7810_INTFE1: info->i = (IRR & INTFE1) ? ASSERT_LINE : CLEAR_LINE; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = PPC; break; - - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + UPD7810_PC: info->i = PC; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + UPD7810_SP: info->i = SP; break; - case CPUINFO_INT_REGISTER + UPD7810_PSW: info->i = PSW; break; - case CPUINFO_INT_REGISTER + UPD7810_EA: info->i = EA; break; - case CPUINFO_INT_REGISTER + UPD7810_VA: info->i = VA; break; - case CPUINFO_INT_REGISTER + UPD7810_BC: info->i = BC; break; - case CPUINFO_INT_REGISTER + UPD7810_DE: info->i = DE; break; - case CPUINFO_INT_REGISTER + UPD7810_HL: info->i = HL; break; - case CPUINFO_INT_REGISTER + UPD7810_EA2: info->i = EA2; break; - case CPUINFO_INT_REGISTER + UPD7810_VA2: info->i = VA2; break; - case CPUINFO_INT_REGISTER + UPD7810_BC2: info->i = BC2; break; - case CPUINFO_INT_REGISTER + UPD7810_DE2: info->i = DE2; break; - case CPUINFO_INT_REGISTER + UPD7810_HL2: info->i = HL2; break; - case CPUINFO_INT_REGISTER + UPD7810_CNT0: info->i = CNT0; break; - case CPUINFO_INT_REGISTER + UPD7810_CNT1: info->i = CNT1; break; - case CPUINFO_INT_REGISTER + UPD7810_TM0: info->i = TM0; break; - case CPUINFO_INT_REGISTER + UPD7810_TM1: info->i = TM1; break; - case CPUINFO_INT_REGISTER + UPD7810_ECNT: info->i = ECNT; break; - case CPUINFO_INT_REGISTER + UPD7810_ECPT: info->i = ECPT; break; - case CPUINFO_INT_REGISTER + UPD7810_ETM0: info->i = ETM0; break; - case CPUINFO_INT_REGISTER + UPD7810_ETM1: info->i = ETM1; break; - case CPUINFO_INT_REGISTER + UPD7810_MA: info->i = MA; break; - case CPUINFO_INT_REGISTER + UPD7810_MB: info->i = MB; break; - case CPUINFO_INT_REGISTER + UPD7810_MCC: info->i = MCC; break; - case CPUINFO_INT_REGISTER + UPD7810_MC: info->i = MC; break; - case CPUINFO_INT_REGISTER + UPD7810_MM: info->i = MM; break; - case CPUINFO_INT_REGISTER + UPD7810_MF: info->i = MF; break; - case CPUINFO_INT_REGISTER + UPD7810_TMM: info->i = TMM; break; - case CPUINFO_INT_REGISTER + UPD7810_ETMM: info->i = ETMM; break; - case CPUINFO_INT_REGISTER + UPD7810_EOM: info->i = EOM; break; - case CPUINFO_INT_REGISTER + UPD7810_SML: info->i = SML; break; - case CPUINFO_INT_REGISTER + UPD7810_SMH: info->i = SMH; break; - case CPUINFO_INT_REGISTER + UPD7810_ANM: info->i = ANM; break; - case CPUINFO_INT_REGISTER + UPD7810_MKL: info->i = MKL; break; - case CPUINFO_INT_REGISTER + UPD7810_MKH: info->i = MKH; break; - case CPUINFO_INT_REGISTER + UPD7810_ZCM: info->i = ZCM; break; - case CPUINFO_INT_REGISTER + UPD7810_TXB: info->i = TXB; break; - case CPUINFO_INT_REGISTER + UPD7810_RXB: info->i = RXB; break; - case CPUINFO_INT_REGISTER + UPD7810_CR0: info->i = CR0; break; - case CPUINFO_INT_REGISTER + UPD7810_CR1: info->i = CR1; break; - case CPUINFO_INT_REGISTER + UPD7810_CR2: info->i = CR2; break; - case CPUINFO_INT_REGISTER + UPD7810_CR3: info->i = CR3; break; - case CPUINFO_INT_REGISTER + UPD7810_TXD: info->i = TXD; break; - case CPUINFO_INT_REGISTER + UPD7810_RXD: info->i = RXD; break; - case CPUINFO_INT_REGISTER + UPD7810_SCK: info->i = SCK; break; - case CPUINFO_INT_REGISTER + UPD7810_TI: info->i = TI; break; - case CPUINFO_INT_REGISTER + UPD7810_TO: info->i = TO; break; - case CPUINFO_INT_REGISTER + UPD7810_CI: info->i = CI; break; - case CPUINFO_INT_REGISTER + UPD7810_CO0: info->i = CO0; break; - case CPUINFO_INT_REGISTER + UPD7810_CO1: info->i = CO1; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = upd7810_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = upd7810_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = upd7810_set_context; break; - case CPUINFO_PTR_INIT: info->init = upd7810_init; break; - case CPUINFO_PTR_RESET: info->reset = upd7810_reset; break; - case CPUINFO_PTR_EXIT: info->exit = upd7810_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = upd7810_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = upd7810_dasm; break; - case CPUINFO_PTR_IRQ_CALLBACK: info->irqcallback = upd7810.irq_callback; break; - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &upd7810_icount; break; - case CPUINFO_PTR_REGISTER_LAYOUT: info->p = upd7810_reg_layout; break; - case CPUINFO_PTR_WINDOW_LAYOUT: info->p = upd7810_win_layout; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s = cpuintrf_temp_str(), "uPD7810"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s = cpuintrf_temp_str(), "NEC uPD7810"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s = cpuintrf_temp_str(), "0.3"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s = cpuintrf_temp_str(), __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s = cpuintrf_temp_str(), "Copyright (c) 2001 Juergen Buchmueller, all rights reserved."); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s = cpuintrf_temp_str(), "%s:%s:%s:%s:%s:%s", - upd7810.psw & 0x40 ? "ZF":"--", - upd7810.psw & 0x20 ? "SK":"--", - upd7810.psw & 0x10 ? "HC":"--", - upd7810.psw & 0x08 ? "L1":"--", - upd7810.psw & 0x04 ? "L0":"--", - upd7810.psw & 0x01 ? "CY":"--"); - break; - - case CPUINFO_STR_REGISTER + UPD7810_PC: sprintf(info->s = cpuintrf_temp_str(), "PC :%04X", upd7810.pc.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_SP: sprintf(info->s = cpuintrf_temp_str(), "SP :%04X", upd7810.sp.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_PSW: sprintf(info->s = cpuintrf_temp_str(), "PSW :%02X", upd7810.psw); break; - case CPUINFO_STR_REGISTER + UPD7810_A: sprintf(info->s = cpuintrf_temp_str(), "A :%02X", upd7810.va.b.l); break; - case CPUINFO_STR_REGISTER + UPD7810_V: sprintf(info->s = cpuintrf_temp_str(), "V :%02X", upd7810.va.b.h); break; - case CPUINFO_STR_REGISTER + UPD7810_EA: sprintf(info->s = cpuintrf_temp_str(), "EA :%04X", upd7810.ea.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_BC: sprintf(info->s = cpuintrf_temp_str(), "BC :%04X", upd7810.bc.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_DE: sprintf(info->s = cpuintrf_temp_str(), "DE :%04X", upd7810.de.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_HL: sprintf(info->s = cpuintrf_temp_str(), "HL :%04X", upd7810.hl.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_A2: sprintf(info->s = cpuintrf_temp_str(), "A' :%02X", upd7810.va2.b.l); break; - case CPUINFO_STR_REGISTER + UPD7810_V2: sprintf(info->s = cpuintrf_temp_str(), "V' :%02X", upd7810.va2.b.h); break; - case CPUINFO_STR_REGISTER + UPD7810_EA2: sprintf(info->s = cpuintrf_temp_str(), "EA' :%04X", upd7810.ea2.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_BC2: sprintf(info->s = cpuintrf_temp_str(), "BC' :%04X", upd7810.bc2.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_DE2: sprintf(info->s = cpuintrf_temp_str(), "DE' :%04X", upd7810.de2.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_HL2: sprintf(info->s = cpuintrf_temp_str(), "HL' :%04X", upd7810.hl2.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_CNT0: sprintf(info->s = cpuintrf_temp_str(), "CNT0:%02X", upd7810.cnt.b.l); break; - case CPUINFO_STR_REGISTER + UPD7810_CNT1: sprintf(info->s = cpuintrf_temp_str(), "CNT1:%02X", upd7810.cnt.b.h); break; - case CPUINFO_STR_REGISTER + UPD7810_TM0: sprintf(info->s = cpuintrf_temp_str(), "TM0 :%02X", upd7810.tm.b.l); break; - case CPUINFO_STR_REGISTER + UPD7810_TM1: sprintf(info->s = cpuintrf_temp_str(), "TM1 :%02X", upd7810.tm.b.h); break; - case CPUINFO_STR_REGISTER + UPD7810_ECNT: sprintf(info->s = cpuintrf_temp_str(), "ECNT:%04X", upd7810.ecnt.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_ECPT: sprintf(info->s = cpuintrf_temp_str(), "ECPT:%04X", upd7810.ecnt.w.h); break; - case CPUINFO_STR_REGISTER + UPD7810_ETM0: sprintf(info->s = cpuintrf_temp_str(), "ETM0:%04X", upd7810.etm.w.l); break; - case CPUINFO_STR_REGISTER + UPD7810_ETM1: sprintf(info->s = cpuintrf_temp_str(), "ETM1:%04X", upd7810.etm.w.h); break; - case CPUINFO_STR_REGISTER + UPD7810_MA: sprintf(info->s = cpuintrf_temp_str(), "MA :%02X", upd7810.ma); break; - case CPUINFO_STR_REGISTER + UPD7810_MB: sprintf(info->s = cpuintrf_temp_str(), "MB :%02X", upd7810.mb); break; - case CPUINFO_STR_REGISTER + UPD7810_MCC: sprintf(info->s = cpuintrf_temp_str(), "MCC :%02X", upd7810.mcc); break; - case CPUINFO_STR_REGISTER + UPD7810_MC: sprintf(info->s = cpuintrf_temp_str(), "MC :%02X", upd7810.mc); break; - case CPUINFO_STR_REGISTER + UPD7810_MM: sprintf(info->s = cpuintrf_temp_str(), "MM :%02X", upd7810.mm); break; - case CPUINFO_STR_REGISTER + UPD7810_MF: sprintf(info->s = cpuintrf_temp_str(), "MF :%02X", upd7810.mf); break; - case CPUINFO_STR_REGISTER + UPD7810_TMM: sprintf(info->s = cpuintrf_temp_str(), "TMM :%02X", upd7810.tmm); break; - case CPUINFO_STR_REGISTER + UPD7810_ETMM: sprintf(info->s = cpuintrf_temp_str(), "ETMM:%02X", upd7810.etmm); break; - case CPUINFO_STR_REGISTER + UPD7810_EOM: sprintf(info->s = cpuintrf_temp_str(), "EOM :%02X", upd7810.eom); break; - case CPUINFO_STR_REGISTER + UPD7810_SML: sprintf(info->s = cpuintrf_temp_str(), "SML :%02X", upd7810.sml); break; - case CPUINFO_STR_REGISTER + UPD7810_SMH: sprintf(info->s = cpuintrf_temp_str(), "SMH :%02X", upd7810.smh); break; - case CPUINFO_STR_REGISTER + UPD7810_ANM: sprintf(info->s = cpuintrf_temp_str(), "ANM :%02X", upd7810.anm); break; - case CPUINFO_STR_REGISTER + UPD7810_MKL: sprintf(info->s = cpuintrf_temp_str(), "MKL :%02X", upd7810.mkl); break; - case CPUINFO_STR_REGISTER + UPD7810_MKH: sprintf(info->s = cpuintrf_temp_str(), "MKH :%02X", upd7810.mkh); break; - case CPUINFO_STR_REGISTER + UPD7810_ZCM: sprintf(info->s = cpuintrf_temp_str(), "ZCM :%02X", upd7810.zcm); break; - case CPUINFO_STR_REGISTER + UPD7810_CR0: sprintf(info->s = cpuintrf_temp_str(), "CR0 :%02X", upd7810.cr0); break; - case CPUINFO_STR_REGISTER + UPD7810_CR1: sprintf(info->s = cpuintrf_temp_str(), "CR1 :%02X", upd7810.cr1); break; - case CPUINFO_STR_REGISTER + UPD7810_CR2: sprintf(info->s = cpuintrf_temp_str(), "CR2 :%02X", upd7810.cr2); break; - case CPUINFO_STR_REGISTER + UPD7810_CR3: sprintf(info->s = cpuintrf_temp_str(), "CR3 :%02X", upd7810.cr3); break; - case CPUINFO_STR_REGISTER + UPD7810_RXB: sprintf(info->s = cpuintrf_temp_str(), "RXB :%02X", upd7810.rxb); break; - case CPUINFO_STR_REGISTER + UPD7810_TXB: sprintf(info->s = cpuintrf_temp_str(), "TXB :%02X", upd7810.txb); break; - case CPUINFO_STR_REGISTER + UPD7810_TXD: sprintf(info->s = cpuintrf_temp_str(), "TXD :%d", upd7810.txd); break; - case CPUINFO_STR_REGISTER + UPD7810_RXD: sprintf(info->s = cpuintrf_temp_str(), "RXD :%d", upd7810.rxd); break; - case CPUINFO_STR_REGISTER + UPD7810_SCK: sprintf(info->s = cpuintrf_temp_str(), "SCK :%d", upd7810.sck); break; - case CPUINFO_STR_REGISTER + UPD7810_TI: sprintf(info->s = cpuintrf_temp_str(), "TI :%d", upd7810.ti); break; - case CPUINFO_STR_REGISTER + UPD7810_TO: sprintf(info->s = cpuintrf_temp_str(), "TO :%d", upd7810.to); break; - case CPUINFO_STR_REGISTER + UPD7810_CI: sprintf(info->s = cpuintrf_temp_str(), "CI :%d", upd7810.ci); break; - case CPUINFO_STR_REGISTER + UPD7810_CO0: sprintf(info->s = cpuintrf_temp_str(), "CO0 :%d", upd7810.co0 & 1); break; - case CPUINFO_STR_REGISTER + UPD7810_CO1: sprintf(info->s = cpuintrf_temp_str(), "CO1 :%d", upd7810.co1 & 1); break; - } -} - - -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void upd7807_get_info(UINT32 state, union cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_RESET: info->reset = upd7807_reset; break; - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = upd7807_dasm; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s = cpuintrf_temp_str(), "uPD7807"); break; - - default: - upd7810_get_info(state, info); - break; - } -} -#endif diff --git a/jan/src/cpu/upd7810/upd7810.h b/jan/src/cpu/upd7810/upd7810.h deleted file mode 100644 index e683707f9..000000000 --- a/jan/src/cpu/upd7810/upd7810.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef _UPD7810_H_ -#define _UPD7810_H_ - -/* - all types have internal ram at 0xff00-0xffff - 7810 - 7811 (4kbyte),7812(8),7814(16) have internal rom at 0x0000 -*/ - -// unfortunatly memory configuration differs with internal rom size -typedef enum { - TYPE_7810, - TYPE_7810_GAMEMASTER, // a few modifications until internal rom dumped - TYPE_7807 -// TYPE_78C10, // stop instruction added -// TYPE_78IV, -// TYPE_78K0, -// TYPE_78K0S -// millions of subtypes -} UPD7810_TYPE; - -/* Supply an instance of this function in your driver code: - * It will be called whenever an output signal changes or a new - * input line state is to be sampled. - */ -extern INT32 (*upd7810_io_callback)(INT32 ioline, INT32 state); - -#if 0 -// use it as reset parameter in the Machine struct -typedef struct { - UPD7810_TYPE type; - upd7810_io_callback io_callback; -} UPD7810_CONFIG; -#endif - -enum { - UPD7810_PC=1, UPD7810_SP, UPD7810_PSW, - UPD7810_EA, UPD7810_V, UPD7810_A, UPD7810_VA, - UPD7810_BC, UPD7810_B, UPD7810_C, UPD7810_DE, UPD7810_D, UPD7810_E, UPD7810_HL, UPD7810_H, UPD7810_L, - UPD7810_EA2, UPD7810_V2, UPD7810_A2, UPD7810_VA2, - UPD7810_BC2, UPD7810_B2, UPD7810_C2, UPD7810_DE2, UPD7810_D2, UPD7810_E2, UPD7810_HL2, UPD7810_H2, UPD7810_L2, - UPD7810_CNT0, UPD7810_CNT1, UPD7810_TM0, UPD7810_TM1, UPD7810_ECNT, UPD7810_ECPT, UPD7810_ETM0, UPD7810_ETM1, - UPD7810_MA, UPD7810_MB, UPD7810_MCC, UPD7810_MC, UPD7810_MM, UPD7810_MF, - UPD7810_TMM, UPD7810_ETMM, UPD7810_EOM, UPD7810_SML, UPD7810_SMH, - UPD7810_ANM, UPD7810_MKL, UPD7810_MKH, UPD7810_ZCM, - UPD7810_TXB, UPD7810_RXB, UPD7810_CR0, UPD7810_CR1, UPD7810_CR2, UPD7810_CR3, - UPD7810_TXD, UPD7810_RXD, UPD7810_SCK, UPD7810_TI, UPD7810_TO, UPD7810_CI, UPD7810_CO0, UPD7810_CO1 -}; - -/* port numbers for PA,PB,PC,PD and PF */ -enum { - UPD7810_PORTA=0, UPD7810_PORTB, UPD7810_PORTC, UPD7810_PORTD, UPD7810_PORTF -}; - -enum { - UPD7807_PORTA=0, UPD7807_PORTB, UPD7807_PORTC, UPD7807_PORTD, UPD7807_PORTF, - UPD7807_PORTT -}; - -/* IRQ lines */ -#define UPD7810_INTF1 0 -#define UPD7810_INTF2 1 -#define UPD7810_INTFE1 4 - -//extern void upd7810_get_info(UINT32 state, union cpuinfo *info); -//extern void upd7807_get_info(UINT32 state, union cpuinfo *info); - -typedef struct { - PAIR ppc; /* previous program counter */ - PAIR pc; /* program counter */ - PAIR sp; /* stack pointer */ - UINT8 op; /* opcode */ - UINT8 op2; /* opcode part 2 */ - UINT8 iff; /* interrupt enable flip flop */ - UINT8 psw; /* processor status word */ - PAIR ea; /* extended accumulator */ - PAIR va; /* accumulator + vector register */ - PAIR bc; /* 8bit B and C registers / 16bit BC register */ - PAIR de; /* 8bit D and E registers / 16bit DE register */ - PAIR hl; /* 8bit H and L registers / 16bit HL register */ - PAIR ea2; /* alternate register set */ - PAIR va2; - PAIR bc2; - PAIR de2; - PAIR hl2; - PAIR cnt; /* 8 bit timer counter */ - PAIR tm; /* 8 bit timer 0/1 comparator inputs */ - PAIR ecnt; /* timer counter register / capture register */ - PAIR etm; /* timer 0/1 comparator inputs */ - UINT8 ma; /* port A input or output mask */ - UINT8 mb; /* port B input or output mask */ - UINT8 mcc; /* port C control/port select */ - UINT8 mc; /* port C input or output mask */ - UINT8 mm; /* memory mapping */ - UINT8 mf; /* port F input or output mask */ - UINT8 tmm; /* timer 0 and timer 1 operating parameters */ - UINT8 etmm; /* 16-bit multifunction timer/event counter */ - UINT8 eom; /* 16-bit timer/event counter output control */ - UINT8 sml; /* serial interface parameters low */ - UINT8 smh; /* -"- high */ - UINT8 anm; /* analog to digital converter operating parameters */ - UINT8 mkl; /* interrupt mask low */ - UINT8 mkh; /* -"- high */ - UINT8 zcm; /* bias circuitry for ac zero-cross detection */ - UINT8 pa_in; /* port A,B,C,D,F inputs */ - UINT8 pb_in; - UINT8 pc_in; - UINT8 pd_in; - UINT8 pf_in; - UINT8 pa_out; /* port A,B,C,D,F outputs */ - UINT8 pb_out; - UINT8 pc_out; - UINT8 pd_out; - UINT8 pf_out; - UINT8 cr0; /* analog digital conversion register 0 */ - UINT8 cr1; /* analog digital conversion register 1 */ - UINT8 cr2; /* analog digital conversion register 2 */ - UINT8 cr3; /* analog digital conversion register 3 */ - UINT8 txb; /* transmitter buffer */ - UINT8 rxb; /* receiver buffer */ - UINT8 txd; /* port C control line states */ - UINT8 rxd; - UINT8 sck; - UINT8 ti; - UINT8 to; - UINT8 ci; - UINT8 co0; - UINT8 co1; - UINT16 irr; /* interrupt request register */ - UINT16 itf; /* interrupt test flag register */ - -/* internal helper variables */ - UINT16 txs; /* transmitter shift register */ - UINT16 rxs; /* receiver shift register */ - UINT8 txcnt; /* transmitter shift register bit count */ - UINT8 rxcnt; /* receiver shift register bit count */ - UINT8 txbuf; /* transmitter buffer was written */ - INT32 ovc0; /* overflow counter for timer 0 (for clock div 12/384) */ - INT32 ovc1; /* overflow counter for timer 0 (for clock div 12/384) */ - INT32 ovce; /* overflow counter for ecnt */ - INT32 ovcf; /* overflow counter for fixed clock div 3 mode */ - INT32 ovcs; /* overflow counter for serial I/O */ - UINT8 edges; /* rising/falling edge flag for serial I/O */ -// const struct opcode_s *opXX; /* opcode table */ -// const struct opcode_s *op48; -// const struct opcode_s *op4C; - -// UPD7810_CONFIG config; -// int (*irq_callback)(int irqline); -} UPD7810; - -#ifdef MAME_DEBUG -extern unsigned Dasm7810( char *dst, unsigned pc ); -extern unsigned Dasm7807( char *dst, unsigned pc ); -#endif - -#endif - diff --git a/jan/src/cpu/upd7810_intf.h b/jan/src/cpu/upd7810_intf.h deleted file mode 100644 index c69124ca9..000000000 --- a/jan/src/cpu/upd7810_intf.h +++ /dev/null @@ -1,22 +0,0 @@ -#include "upd7810.h" - -void upd7810SetReadPortHandler(UINT8 (*read_port)(UINT8)); -void upd7810SetWritePortHandler(void (*write_port)(UINT8,UINT8)); -void upd7810SetReadHandler(UINT8 (*read)(UINT16)); -void upd7810SetWriteHandler(void (*write)(UINT16,UINT8)); -void upd7810MapMemory(UINT8 *rom, UINT16 start, UINT16 end, UINT8 map); - -void upd7810Init(INT32 (*io_callback)(INT32 ioline, INT32 state)); -void upd7807Init(INT32 (*io_callback)(INT32 ioline, INT32 state)); - -void upd7810Reset(); -INT32 upd7810Run(INT32 cycles); -void upd7810Exit(); - -void upd7810SetIRQLine(INT32 line, INT32 state); - -INT32 upd7810TotalCycles(); -void upd7810NewFrame(); -void upd7810RunEnd(); - -INT32 upd7810Scan(INT32 nAction); diff --git a/jan/src/cpu/v60/am.c b/jan/src/cpu/v60/am.c deleted file mode 100644 index 350d67f2e..000000000 --- a/jan/src/cpu/v60/am.c +++ /dev/null @@ -1,102 +0,0 @@ - -// NOTE for bit string/field addressing -// ************************************ -// modDim must be passed as 10 for bit string instructions, -// and as 11 for bit field instructions - - - -// Output variables for ReadAMAddress() -static UINT8 amFlag; -static UINT32 amOut; -static UINT32 bamOffset; - -// Appo temp var -static UINT32 amLength1,amLength2; - - -// Global vars used by AM functions -static UINT32 modAdd; -static UINT8 modM; -static UINT8 modVal; -static UINT8 modVal2; -static UINT8 modWriteValB; -static UINT16 modWriteValH; -static UINT32 modWriteValW; -static UINT8 modDim; - -// Addressing mode functions and tables -#include "am1.c" // ReadAM -#include "am2.c" // ReadAMAddress -#include "am3.c" // WriteAM - -/* - Input: - modAdd - modDim - - Output: - amOut - amLength -*/ - -static UINT32 ReadAM(void) -{ - modM=modM?1:0; - modVal=OpRead8(modAdd); - return AMTable1[modM][modVal>>5](); -} - -static UINT32 BitReadAM(void) -{ - modM=modM?1:0; - modVal=OpRead8(modAdd); - return BAMTable1[modM][modVal>>5](); -} - - - -/* - Input: - modAdd - modDim - - Output: - amOut - amFlag - amLength -*/ - -static UINT32 ReadAMAddress(void) -{ - modM=modM?1:0; - modVal=OpRead8(modAdd); - return AMTable2[modM][modVal>>5](); -} - -static UINT32 BitReadAMAddress(void) -{ - modM=modM?1:0; - modVal=OpRead8(modAdd); - return BAMTable2[modM][modVal>>5](); -} - -/* - Input: - modAdd - modDim - modWriteValB/H/W - - Output: - amOut - amLength -*/ - -static UINT32 WriteAM(void) -{ - modM=modM?1:0; - modVal=OpRead8(modAdd); - return AMTable3[modM][modVal>>5](); -} - - diff --git a/jan/src/cpu/v60/am1.c b/jan/src/cpu/v60/am1.c deleted file mode 100644 index 18a238178..000000000 --- a/jan/src/cpu/v60/am1.c +++ /dev/null @@ -1,1391 +0,0 @@ - -// AM1 Functions (for ReadAM) -// ************************** - -static UINT32 am1Register(void) -{ - switch (modDim) - { - case 0: - amOut=(UINT8)v60.reg[modVal&0x1F]; - break; - case 1: - amOut=(UINT16)v60.reg[modVal&0x1F]; - break; - case 2: - amOut=v60.reg[modVal&0x1F]; - break; - } - - return 1; -} - -static UINT32 am1RegisterIndirect(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(v60.reg[modVal&0x1F]); - break; - case 2: - amOut=MemRead32(v60.reg[modVal&0x1F]); - break; - } - - return 1; -} - -static UINT32 bam1RegisterIndirect(void) -{ - bamOffset=0; - amOut=MemRead32(v60.reg[modVal&0x1F]); - return 1; -} - -static UINT32 am1RegisterIndirectIndexed(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(v60.reg[modVal2&0x1F]+v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(v60.reg[modVal2&0x1F]+v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(v60.reg[modVal2&0x1F]+v60.reg[modVal&0x1F]*4); - break; - } - - return 2; -} - -static UINT32 bam1RegisterIndirectIndexed(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(v60.reg[modVal2&0x1F]+bamOffset/8); - bamOffset&=7; - return 2; -} - -static UINT32 am1Autoincrement(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(v60.reg[modVal&0x1F]); - v60.reg[modVal&0x1F]++; - break; - case 1: - amOut=MemRead16(v60.reg[modVal&0x1F]); - v60.reg[modVal&0x1F]+=2; - break; - case 2: - amOut=MemRead32(v60.reg[modVal&0x1F]); - v60.reg[modVal&0x1F]+=4; - break; - } - - return 1; -} - -static UINT32 bam1Autoincrement(void) -{ - bamOffset=0; - amOut=MemRead32(v60.reg[modVal&0x1F]); - switch (modDim) - { - case 10: - v60.reg[modVal&0x1F]+=1; - break; - case 11: - v60.reg[modVal&0x1F]+=4; - break; - default: - // fatalerror("CPU - BAM1 - 7"); - break; - } - return 1; -} - -static UINT32 am1Autodecrement(void) -{ - switch (modDim) - { - case 0: - v60.reg[modVal&0x1F]--; - amOut=MemRead8(v60.reg[modVal&0x1F]); - break; - case 1: - v60.reg[modVal&0x1F]-=2; - amOut=MemRead16(v60.reg[modVal&0x1F]); - break; - case 2: - v60.reg[modVal&0x1F]-=4; - amOut=MemRead32(v60.reg[modVal&0x1F]); - break; - } - - return 1; -} - -static UINT32 bam1Autodecrement(void) -{ - bamOffset=0; - switch (modDim) - { - case 10: - v60.reg[modVal&0x1F]-=1; - break; - case 11: - v60.reg[modVal&0x1F]-=4; - break; - default: - // fatalerror("CPU - BAM1 - 7"); - break; - } - amOut=MemRead32(v60.reg[modVal&0x1F]); - return 1; -} - -static UINT32 am1Displacement8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)); - break; - case 1: - amOut=MemRead16(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)); - break; - case 2: - amOut=MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)); - break; - } - - return 2; -} - -static UINT32 bam1Displacement8(void) -{ - bamOffset=MemRead8(modAdd+1); - amOut=MemRead32(v60.reg[modVal&0x1F]+bamOffset/8); - bamOffset&=7; - return 2; -} - - -static UINT32 am1Displacement16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)); - break; - case 1: - amOut=MemRead16(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)); - break; - case 2: - amOut=MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)); - break; - } - - return 3; -} - -static UINT32 bam1Displacement16(void) -{ - bamOffset=OpRead16(modAdd+1); - amOut=MemRead32(v60.reg[modVal&0x1F]+bamOffset/8); - bamOffset&=7; - return 3; -} - -static UINT32 am1Displacement32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)); - break; - case 1: - amOut=MemRead16(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)); - break; - case 2: - amOut=MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)); - break; - } - - return 5; -} - -static UINT32 bam1Displacement32(void) -{ - bamOffset=OpRead32(modAdd+1); - amOut=MemRead32(v60.reg[modVal&0x1F]+bamOffset/8); - bamOffset&=7; - return 5; -} - -static UINT32 am1DisplacementIndexed8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F]*4); - break; - } - - return 3; -} - -static UINT32 bam1DisplacementIndexed8(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)+bamOffset/8); - bamOffset&=7; - return 3; -} - -static UINT32 am1DisplacementIndexed16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F]*4); - break; - } - - return 4; -} - -static UINT32 bam1DisplacementIndexed16(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)+bamOffset/8); - bamOffset&=7; - return 4; -} - -static UINT32 am1DisplacementIndexed32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F]*4); - break; - } - - return 6; -} - -static UINT32 bam1DisplacementIndexed32(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)+bamOffset/8); - bamOffset&=7; - return 6; -} - - -static UINT32 am1PCDisplacement8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(PC + (INT8)OpRead8(modAdd+1)); - break; - case 1: - amOut=MemRead16(PC + (INT8)OpRead8(modAdd+1)); - break; - case 2: - amOut=MemRead32(PC + (INT8)OpRead8(modAdd+1)); - break; - } - - return 2; -} - -static UINT32 bam1PCDisplacement8(void) -{ - bamOffset=OpRead8(modAdd+1); - amOut=MemRead32(PC+bamOffset/8); - bamOffset&=7; - return 2; -} - -static UINT32 am1PCDisplacement16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(PC + (INT16)OpRead16(modAdd+1)); - break; - case 1: - amOut=MemRead16(PC + (INT16)OpRead16(modAdd+1)); - break; - case 2: - amOut=MemRead32(PC + (INT16)OpRead16(modAdd+1)); - break; - } - - return 3; -} - -static UINT32 bam1PCDisplacement16(void) -{ - bamOffset=OpRead16(modAdd+1); - amOut=MemRead32(PC+bamOffset/8); - bamOffset&=7; - return 3; -} - -static UINT32 am1PCDisplacement32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(PC + OpRead32(modAdd+1)); - break; - case 1: - amOut=MemRead16(PC + OpRead32(modAdd+1)); - break; - case 2: - amOut=MemRead32(PC + OpRead32(modAdd+1)); - break; - } - - return 5; -} - -static UINT32 bam1PCDisplacement32(void) -{ - bamOffset=OpRead32(modAdd+1); - amOut=MemRead32(PC+bamOffset/8); - bamOffset&=7; - return 5; -} - -static UINT32 am1PCDisplacementIndexed8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F]*4); - break; - } - - return 3; -} - -static UINT32 bam1PCDisplacementIndexed8(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(PC + (INT8)OpRead8(modAdd+2)+bamOffset/8); - bamOffset&=7; - return 3; -} - - -static UINT32 am1PCDisplacementIndexed16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F]*4); - break; - } - - return 4; -} - -static UINT32 bam1PCDisplacementIndexed16(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(PC + (INT16)OpRead16(modAdd+2)+bamOffset/8); - bamOffset&=7; - return 4; -} - -static UINT32 am1PCDisplacementIndexed32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F]*4); - break; - } - - return 6; -} - -static UINT32 bam1PCDisplacementIndexed32(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(PC + OpRead32(modAdd+2)+bamOffset/8); - bamOffset&=7; - return 6; -} - -static UINT32 am1DisplacementIndirect8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1))); - break; - case 1: - amOut=MemRead16(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1))); - break; - case 2: - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1))); - break; - } - - return 2; -} - -static UINT32 bam1DisplacementIndirect8(void) -{ - bamOffset=0; - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1))); - return 2; -} - -static UINT32 am1DisplacementIndirect16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1))); - break; - case 1: - amOut=MemRead16(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1))); - break; - case 2: - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1))); - break; - } - - return 3; -} - -static UINT32 bam1DisplacementIndirect16(void) -{ - bamOffset=0; - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1))); - return 3; -} - -static UINT32 am1DisplacementIndirect32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1))); - break; - case 1: - amOut=MemRead16(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1))); - break; - case 2: - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1))); - break; - } - - return 5; -} - -static UINT32 bam1DisplacementIndirect32(void) -{ - bamOffset=0; - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1))); - return 5; -} - -static UINT32 am1DisplacementIndirectIndexed8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F]*4); - break; - } - - return 3; -} - -static UINT32 bam1DisplacementIndirectIndexed8(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2))+bamOffset/8); - bamOffset&=7; - return 3; -} - -static UINT32 am1DisplacementIndirectIndexed16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F]*4); - break; - } - - return 4; -} - -static UINT32 bam1DisplacementIndirectIndexed16(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2))+bamOffset/8); - bamOffset&=7; - return 4; -} - -static UINT32 am1DisplacementIndirectIndexed32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]*4); - break; - } - - return 6; -} - -static UINT32 bam1DisplacementIndirectIndexed32(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2))+bamOffset/8); - bamOffset&=7; - return 6; -} - -static UINT32 am1PCDisplacementIndirect8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(PC + (INT8)OpRead8(modAdd+1))); - break; - case 1: - amOut=MemRead16(MemRead32(PC + (INT8)OpRead8(modAdd+1))); - break; - case 2: - amOut=MemRead32(MemRead32(PC + (INT8)OpRead8(modAdd+1))); - break; - } - - return 2; -} - -static UINT32 bam1PCDisplacementIndirect8(void) -{ - bamOffset=0; - amOut=MemRead32(MemRead32(PC + (INT8)OpRead8(modAdd+1))); - return 2; -} - -static UINT32 am1PCDisplacementIndirect16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(PC + (INT16)OpRead16(modAdd+1))); - break; - case 1: - amOut=MemRead16(MemRead32(PC + (INT16)OpRead16(modAdd+1))); - break; - case 2: - amOut=MemRead32(MemRead32(PC + (INT16)OpRead16(modAdd+1))); - break; - } - - return 3; -} - -static UINT32 bam1PCDisplacementIndirect16(void) -{ - bamOffset=0; - amOut=MemRead32(MemRead32(PC + (INT16)OpRead16(modAdd+1))); - return 3; -} - -static UINT32 am1PCDisplacementIndirect32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(PC + OpRead32(modAdd+1))); - break; - case 1: - amOut=MemRead16(MemRead32(PC + OpRead32(modAdd+1))); - break; - case 2: - amOut=MemRead32(MemRead32(PC + OpRead32(modAdd+1))); - break; - } - - return 5; -} - -static UINT32 bam1PCDisplacementIndirect32(void) -{ - bamOffset=0; - amOut=MemRead32(MemRead32(PC + OpRead32(modAdd+1))); - return 5; -} - -static UINT32 am1PCDisplacementIndirectIndexed8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F]*4); - break; - } - - return 3; -} - -static UINT32 bam1PCDisplacementIndirectIndexed8(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(MemRead32(PC + (INT8)OpRead8(modAdd+2))+bamOffset/8); - bamOffset&=7; - return 3; -} - -static UINT32 am1PCDisplacementIndirectIndexed16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F]*4); - break; - } - - return 4; -} - -static UINT32 bam1PCDisplacementIndirectIndexed16(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(MemRead32(PC + (INT16)OpRead16(modAdd+2))+bamOffset/8); - bamOffset&=7; - return 4; -} - -static UINT32 am1PCDisplacementIndirectIndexed32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]); - break; - case 1: - amOut=MemRead16(MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]*2); - break; - case 2: - amOut=MemRead32(MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]*4); - break; - } - - return 6; -} - -static UINT32 bam1PCDisplacementIndirectIndexed32(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(MemRead32(PC + OpRead32(modAdd+2))+bamOffset/8); - bamOffset&=7; - return 6; -} - -static UINT32 am1DoubleDisplacement8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2)); - break; - - case 1: - amOut=MemRead16(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2)); - break; - - case 2: - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2)); - break; - } - - return 3; -} - -static UINT32 bam1DoubleDisplacement8(void) -{ - bamOffset=OpRead8(modAdd+2); - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1))+bamOffset/8); - bamOffset&=7; - return 3; -} - -static UINT32 am1DoubleDisplacement16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3)); - break; - - case 1: - amOut=MemRead16(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3)); - break; - - case 2: - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3)); - break; - } - - return 5; -} - -static UINT32 bam1DoubleDisplacement16(void) -{ - bamOffset=OpRead16(modAdd+3); - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1))+bamOffset/8); - bamOffset&=7; - return 5; -} - -static UINT32 am1DoubleDisplacement32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)) + OpRead32(modAdd+5)); - break; - - case 1: - amOut=MemRead16(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)) + OpRead32(modAdd+5)); - break; - - case 2: - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)) + OpRead32(modAdd+5)); - break; - } - - return 9; -} - -static UINT32 bam1DoubleDisplacement32(void) -{ - bamOffset=OpRead32(modAdd+5); - amOut=MemRead32(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1))+bamOffset/8); - bamOffset&=7; - return 9; -} - -static UINT32 am1PCDoubleDisplacement8(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(PC + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2)); - break; - - case 1: - amOut=MemRead16(MemRead32(PC + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2)); - break; - - case 2: - amOut=MemRead32(MemRead32(PC + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2)); - break; - } - - return 3; -} - -static UINT32 bam1PCDoubleDisplacement8(void) -{ - bamOffset=OpRead8(modAdd+2); - amOut=MemRead32(MemRead32(PC + (INT8)OpRead8(modAdd+1))+bamOffset/8); - bamOffset&=7; - return 3; -} - -static UINT32 am1PCDoubleDisplacement16(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3)); - break; - - case 1: - amOut=MemRead16(MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3)); - break; - - case 2: - amOut=MemRead32(MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3)); - break; - } - - return 5; -} - -static UINT32 bam1PCDoubleDisplacement16(void) -{ - bamOffset=OpRead16(modAdd+3); - amOut=MemRead32(MemRead32(PC + (INT16)OpRead16(modAdd+1))+bamOffset/8); - bamOffset&=7; - return 5; -} - - -static UINT32 am1PCDoubleDisplacement32(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(PC + OpRead32(modAdd+1)) + OpRead32(modAdd+5)); - break; - - case 1: - amOut=MemRead16(MemRead32(PC + OpRead32(modAdd+1)) + OpRead32(modAdd+5)); - break; - - case 2: - amOut=MemRead32(MemRead32(PC + OpRead32(modAdd+1)) + OpRead32(modAdd+5)); - break; - } - - return 9; -} - -static UINT32 bam1PCDoubleDisplacement32(void) -{ - bamOffset=OpRead32(modAdd+5); - amOut=MemRead32(MemRead32(PC + OpRead32(modAdd+1))+bamOffset/8); - bamOffset&=7; - return 9; -} - -static UINT32 am1DirectAddress(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(OpRead32(modAdd+1)); - break; - - case 1: - amOut=MemRead16(OpRead32(modAdd+1)); - break; - - case 2: - amOut=MemRead32(OpRead32(modAdd+1)); - break; - } - - return 5; -} - -static UINT32 bam1DirectAddress(void) -{ - bamOffset=0; - amOut=MemRead32(OpRead32(modAdd+1)); - return 5; -} - -static UINT32 am1DirectAddressIndexed(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(OpRead32(modAdd+2) + v60.reg[modVal&0x1F]); - break; - - case 1: - amOut=MemRead16(OpRead32(modAdd+2) + v60.reg[modVal&0x1F]*2); - break; - - case 2: - amOut=MemRead32(OpRead32(modAdd+2) + v60.reg[modVal&0x1F]*4); - break; - } - - return 6; -} - -static UINT32 bam1DirectAddressIndexed(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(OpRead32(modAdd+2)+bamOffset/8); - bamOffset&=7; - return 6; -} - -static UINT32 am1DirectAddressDeferred(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(OpRead32(modAdd+1))); - break; - - case 1: - amOut=MemRead16(MemRead32(OpRead32(modAdd+1))); - break; - - case 2: - amOut=MemRead32(MemRead32(OpRead32(modAdd+1))); - break; - } - - return 5; -} - -static UINT32 bam1DirectAddressDeferred(void) -{ - bamOffset=0; - amOut=MemRead32(MemRead32(OpRead32(modAdd+1))); - return 5; -} - -static UINT32 am1DirectAddressDeferredIndexed(void) -{ - switch (modDim) - { - case 0: - amOut=MemRead8(MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]); - break; - - case 1: - amOut=MemRead16(MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]*2); - break; - - case 2: - amOut=MemRead32(MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]*4); - break; - } - - return 6; -} - -static UINT32 bam1DirectAddressDeferredIndexed(void) -{ - bamOffset=v60.reg[modVal&0x1F]; - amOut=MemRead32(MemRead32(OpRead32(modAdd+2))+bamOffset/8); - bamOffset&=7; - return 6; -} - -static UINT32 am1Immediate(void) -{ - switch (modDim) - { - case 0: - amOut=OpRead8(modAdd+1); - return 2; - break; - - case 1: - amOut=OpRead16(modAdd+1); - return 3; - break; - - case 2: - amOut=OpRead32(modAdd+1); - return 5; - break; - } - - // It should not be here! Written to avoid warning - assert(0); - return 1; -} - -static UINT32 am1ImmediateQuick(void) -{ - amOut=modVal&0xF; - return 1; -} - - - - -// AM1 Tables (for ReadAM) -// *********************** - -static UINT32 am1Error1(void) -{ - //fatalerror("CPU - AM1 - 1 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam1Error1(void) -{ - //fatalerror("CPU - BAM1 - 1 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 am1Error2(void) -{ - //fatalerror("CPU - AM1 - 2 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam1Error2(void) -{ - //fatalerror("CPU - BAM1 - 2 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -#if 0 -static UINT32 am1Error3(void) -{ - //fatalerror("CPU - AM1 - 3 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam1Error3(void) -{ - //fatalerror("CPU - BAM1 - 3 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} -#endif - -static UINT32 am1Error4(void) -{ - //fatalerror("CPU - AM1 - 4 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam1Error4(void) -{ - //fatalerror("CPU - BAM1 - 4 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 am1Error5(void) -{ - //fatalerror("CPU - AM1 - 5 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam1Error5(void) -{ - //fatalerror("CPU - BAM1 - 5 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam1Error6(void) -{ - //fatalerror("CPU - BAM1 - 6 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 (*const AMTable1_G7a[16])(void) = -{ - am1PCDisplacementIndexed8, - am1PCDisplacementIndexed16, - am1PCDisplacementIndexed32, - am1DirectAddressIndexed, - am1Error5, - am1Error5, - am1Error5, - am1Error5, - am1PCDisplacementIndirectIndexed8, - am1PCDisplacementIndirectIndexed16, - am1PCDisplacementIndirectIndexed32, - am1DirectAddressDeferredIndexed, - am1Error5, - am1Error5, - am1Error5, - am1Error5 -}; - -static UINT32 (*const BAMTable1_G7a[16])(void) = -{ - bam1PCDisplacementIndexed8, - bam1PCDisplacementIndexed16, - bam1PCDisplacementIndexed32, - bam1DirectAddressIndexed, - bam1Error5, - bam1Error5, - bam1Error5, - bam1Error5, - bam1PCDisplacementIndirectIndexed8, - bam1PCDisplacementIndirectIndexed16, - bam1PCDisplacementIndirectIndexed32, - bam1DirectAddressDeferredIndexed, - bam1Error5, - bam1Error5, - bam1Error5, - bam1Error5 -}; - - -static UINT32 am1Group7a(void) -{ - if (!(modVal2&0x10)) - return am1Error4(); - - return AMTable1_G7a[modVal2&0xF](); -} - -static UINT32 bam1Group7a(void) -{ - if (!(modVal2&0x10)) - return bam1Error4(); - - return BAMTable1_G7a[modVal2&0xF](); -} - -static UINT32 (*const AMTable1_G7[32])(void) = -{ - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1ImmediateQuick, - am1PCDisplacement8, - am1PCDisplacement16, - am1PCDisplacement32, - am1DirectAddress, - am1Immediate, - am1Error2, - am1Error2, - am1Error2, - am1PCDisplacementIndirect8, - am1PCDisplacementIndirect16, - am1PCDisplacementIndirect32, - am1DirectAddressDeferred, - am1PCDoubleDisplacement8, - am1PCDoubleDisplacement16, - am1PCDoubleDisplacement32, - am1Error2 -}; - -static UINT32 (*const BAMTable1_G7[32])(void) = -{ - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1Error6, - bam1PCDisplacement8, - bam1PCDisplacement16, - bam1PCDisplacement32, - bam1DirectAddress, - bam1Error6, - bam1Error2, - bam1Error2, - bam1Error2, - bam1PCDisplacementIndirect8, - bam1PCDisplacementIndirect16, - bam1PCDisplacementIndirect32, - bam1DirectAddressDeferred, - bam1PCDoubleDisplacement8, - bam1PCDoubleDisplacement16, - bam1PCDoubleDisplacement32, - bam1Error2 -}; - - - -static UINT32 (*const AMTable1_G6[8])(void) = -{ - am1DisplacementIndexed8, - am1DisplacementIndexed16, - am1DisplacementIndexed32, - am1RegisterIndirectIndexed, - am1DisplacementIndirectIndexed8, - am1DisplacementIndirectIndexed16, - am1DisplacementIndirectIndexed32, - am1Group7a -}; - -static UINT32 (*const BAMTable1_G6[8])(void) = -{ - bam1DisplacementIndexed8, - bam1DisplacementIndexed16, - bam1DisplacementIndexed32, - bam1RegisterIndirectIndexed, - bam1DisplacementIndirectIndexed8, - bam1DisplacementIndirectIndexed16, - bam1DisplacementIndirectIndexed32, - bam1Group7a -}; - - -static UINT32 am1Group6(void) -{ - modVal2=OpRead8(modAdd+1); - return AMTable1_G6[modVal2>>5](); -} - -static UINT32 bam1Group6(void) -{ - modVal2=OpRead8(modAdd+1); - return BAMTable1_G6[modVal2>>5](); -} - - -static UINT32 am1Group7(void) -{ - return AMTable1_G7[modVal&0x1F](); -} - -static UINT32 bam1Group7(void) -{ - return BAMTable1_G7[modVal&0x1F](); -} - -static UINT32 (*const AMTable1[2][8])(void) = -{ - { - am1Displacement8, - am1Displacement16, - am1Displacement32, - am1RegisterIndirect, - am1DisplacementIndirect8, - am1DisplacementIndirect16, - am1DisplacementIndirect32, - am1Group7 - }, - - { - am1DoubleDisplacement8, - am1DoubleDisplacement16, - am1DoubleDisplacement32, - am1Register, - am1Autoincrement, - am1Autodecrement, - am1Group6, - am1Error1 - } -}; - - -static UINT32 (*const BAMTable1[2][8])(void) = -{ - { - bam1Displacement8, - bam1Displacement16, - bam1Displacement32, - bam1RegisterIndirect, - bam1DisplacementIndirect8, - bam1DisplacementIndirect16, - bam1DisplacementIndirect32, - bam1Group7 - }, - - { - bam1DoubleDisplacement8, - bam1DoubleDisplacement16, - bam1DoubleDisplacement32, - bam1Error6, - bam1Autoincrement, - bam1Autodecrement, - bam1Group6, - bam1Error1 - } -}; - - - - diff --git a/jan/src/cpu/v60/am2.c b/jan/src/cpu/v60/am2.c deleted file mode 100644 index 86287a2d2..000000000 --- a/jan/src/cpu/v60/am2.c +++ /dev/null @@ -1,1256 +0,0 @@ - -// AM2 Functions (for ReadAMAddress) -// ********************************* - -static UINT32 am2Register(void) -{ - amFlag = 1; - amOut = modVal&0x1F; - return 1; -} - -static UINT32 am2RegisterIndirect(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F]; - return 1; -} - -static UINT32 bam2RegisterIndirect(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F]; - bamOffset = 0; - return 1; -} - -static UINT32 am2RegisterIndirectIndexed(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = v60.reg[modVal2&0x1F] + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = v60.reg[modVal2&0x1F] + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = v60.reg[modVal2&0x1F] + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = v60.reg[modVal2&0x1F] + v60.reg[modVal&0x1F] * 8; - break; - } - - return 2; -} - -static UINT32 bam2RegisterIndirectIndexed(void) -{ - amFlag = 0; - amOut = v60.reg[modVal2&0x1F]; - bamOffset = v60.reg[modVal&0x1F]; - return 2; -} - -static UINT32 am2Autoincrement(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F]; - - switch (modDim) - { - case 0: - v60.reg[modVal&0x1F] += 1; - break; - case 1: - v60.reg[modVal&0x1F] += 2; - break; - case 2: - v60.reg[modVal&0x1F] += 4; - break; - case 3: - v60.reg[modVal&0x1F] += 8; - break; - } - - return 1; -} - -static UINT32 bam2Autoincrement(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F]; - bamOffset = 0; - - switch (modDim) - { - case 10: - v60.reg[modVal&0x1F]+=1; - break; - case 11: - v60.reg[modVal&0x1F]+=4; - break; - default: - //fatalerror("CPU - AM2 - 7 (t0 PC=%x)", PC); - break; - } - - return 1; -} - -static UINT32 am2Autodecrement(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - v60.reg[modVal&0x1F] -= 1; - break; - case 1: - v60.reg[modVal&0x1F] -= 2; - break; - case 2: - v60.reg[modVal&0x1F] -= 4; - break; - case 3: - v60.reg[modVal&0x1F] -= 8; - break; - } - - amOut = v60.reg[modVal&0x1F]; - return 1; -} - -static UINT32 bam2Autodecrement(void) -{ - amFlag = 0; - bamOffset = 0; - - switch (modDim) - { - case 10: - v60.reg[modVal&0x1F]-=1; - break; - case 11: - v60.reg[modVal&0x1F]-=4; - break; - default: - //fatalerror("CPU - BAM2 - 7 (PC=%06x)", PC); - break; - } - - amOut = v60.reg[modVal&0x1F]; - return 1; -} - - -static UINT32 am2Displacement8(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1); - - return 2; -} - -static UINT32 bam2Displacement8(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F]; - bamOffset = (INT8)OpRead8(modAdd+1); - - return 2; -} - -static UINT32 am2Displacement16(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1); - - return 3; -} - -static UINT32 bam2Displacement16(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F]; - bamOffset = (INT16)OpRead16(modAdd+1); - - return 3; -} - -static UINT32 am2Displacement32(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F] + OpRead32(modAdd+1); - - return 5; -} - -static UINT32 bam2Displacement32(void) -{ - amFlag = 0; - amOut = v60.reg[modVal&0x1F]; - bamOffset = OpRead32(modAdd+1); - - return 5; -} - -static UINT32 am2DisplacementIndexed8(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 3; -} - -static UINT32 bam2DisplacementIndexed8(void) -{ - amFlag = 0; - amOut = v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2); - bamOffset = v60.reg[modVal&0x1F]; - - return 3; -} - -static UINT32 am2DisplacementIndexed16(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 4; -} - -static UINT32 bam2DisplacementIndexed16(void) -{ - amFlag = 0; - amOut = v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2); - bamOffset = v60.reg[modVal&0x1F]; - - return 4; -} - -static UINT32 am2DisplacementIndexed32(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 6; -} - -static UINT32 bam2DisplacementIndexed32(void) -{ - amFlag = 0; - amOut = v60.reg[modVal2&0x1F] + OpRead32(modAdd+2); - bamOffset = v60.reg[modVal&0x1F]; - - return 6; -} - -static UINT32 am2PCDisplacement8(void) -{ - amFlag = 0; - amOut = PC + (INT8)OpRead8(modAdd+1); - - return 2; -} - -static UINT32 bam2PCDisplacement8(void) -{ - amFlag = 0; - amOut = PC; - bamOffset = (INT8)OpRead8(modAdd+1); - - return 2; -} - -static UINT32 am2PCDisplacement16(void) -{ - amFlag = 0; - amOut = PC + (INT16)OpRead16(modAdd+1); - - return 3; -} - -static UINT32 bam2PCDisplacement16(void) -{ - amFlag = 0; - amOut = PC; - bamOffset = (INT16)OpRead16(modAdd+1); - - return 3; -} - -static UINT32 am2PCDisplacement32(void) -{ - amFlag = 0; - amOut = PC + OpRead32(modAdd+1); - - return 5; -} - -static UINT32 bam2PCDisplacement32(void) -{ - amFlag = 0; - amOut = PC; - bamOffset = OpRead32(modAdd+1); - - return 5; -} - - -static UINT32 am2PCDisplacementIndexed8(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 3; -} - -static UINT32 bam2PCDisplacementIndexed8(void) -{ - amFlag = 0; - amOut = PC + (INT8)OpRead8(modAdd+2); - bamOffset = v60.reg[modVal&0x1F]; - - return 3; -} - -static UINT32 am2PCDisplacementIndexed16(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 4; -} - -static UINT32 bam2PCDisplacementIndexed16(void) -{ - amFlag = 0; - amOut = PC + (INT16)OpRead16(modAdd+2); - bamOffset = v60.reg[modVal&0x1F]; - - return 4; -} - -static UINT32 am2PCDisplacementIndexed32(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 6; -} - -static UINT32 bam2PCDisplacementIndexed32(void) -{ - amFlag = 0; - amOut = PC + OpRead32(modAdd+2); - bamOffset = v60.reg[modVal&0x1F]; - - return 6; -} - -static UINT32 am2DisplacementIndirect8(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)); - - return 2; -} - -static UINT32 bam2DisplacementIndirect8(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)); - bamOffset = 0; - return 2; -} - -static UINT32 am2DisplacementIndirect16(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)); - - return 3; -} - -static UINT32 bam2DisplacementIndirect16(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)); - bamOffset = 0; - return 3; -} - -static UINT32 am2DisplacementIndirect32(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)); - - return 5; -} - -static UINT32 bam2DisplacementIndirect32(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)); - bamOffset = 0; - - return 5; -} - -static UINT32 am2DisplacementIndirectIndexed8(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 3; -} - -static UINT32 bam2DisplacementIndirectIndexed8(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)); - bamOffset = v60.reg[modVal&0x1F]; - - return 3; -} - -static UINT32 am2DisplacementIndirectIndexed16(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 4; -} - -static UINT32 bam2DisplacementIndirectIndexed16(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)); - bamOffset = v60.reg[modVal&0x1F]; - - return 4; -} - -static UINT32 am2DisplacementIndirectIndexed32(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 6; -} - -static UINT32 bam2DisplacementIndirectIndexed32(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)); - bamOffset = v60.reg[modVal&0x1F]; - - return 6; -} - -static UINT32 am2PCDisplacementIndirect8(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT8)OpRead8(modAdd+1)); - - return 2; -} - -static UINT32 bam2PCDisplacementIndirect8(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT8)OpRead8(modAdd+1)); - bamOffset = 0; - - return 2; -} - -static UINT32 am2PCDisplacementIndirect16(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT16)OpRead16(modAdd+1)); - - return 3; -} - -static UINT32 bam2PCDisplacementIndirect16(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT16)OpRead16(modAdd+1)); - bamOffset = 0; - - return 3; -} - -static UINT32 am2PCDisplacementIndirect32(void) -{ - amFlag = 0; - amOut = MemRead32(PC + OpRead32(modAdd+1)); - - return 5; -} - -static UINT32 bam2PCDisplacementIndirect32(void) -{ - amFlag = 0; - amOut = MemRead32(PC + OpRead32(modAdd+1)); - bamOffset = 0; - - return 5; -} - -static UINT32 am2PCDisplacementIndirectIndexed8(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 3; -} - -static UINT32 bam2PCDisplacementIndirectIndexed8(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT8)OpRead8(modAdd+2)); - bamOffset = v60.reg[modVal&0x1F]; - - return 3; -} - -static UINT32 am2PCDisplacementIndirectIndexed16(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 4; -} - - -static UINT32 bam2PCDisplacementIndirectIndexed16(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT16)OpRead16(modAdd+2)); - bamOffset = v60.reg[modVal&0x1F]; - - return 4; -} - - -static UINT32 am2PCDisplacementIndirectIndexed32(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 6; -} - -static UINT32 bam2PCDisplacementIndirectIndexed32(void) -{ - amFlag = 0; - amOut = MemRead32(PC + OpRead32(modAdd+2)); - bamOffset = v60.reg[modVal&0x1F]; - - return 6; -} - -static UINT32 am2DoubleDisplacement8(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2); - - return 3; -} - -static UINT32 bam2DoubleDisplacement8(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)); - bamOffset = (INT8)OpRead8(modAdd+2); - - return 3; -} - -static UINT32 am2DoubleDisplacement16(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3); - - return 5; -} - -static UINT32 bam2DoubleDisplacement16(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)); - bamOffset = (INT8)OpRead8(modAdd+3); - - return 5; -} - -static UINT32 am2DoubleDisplacement32(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)) + OpRead32(modAdd+5); - - return 9; -} - -static UINT32 bam2DoubleDisplacement32(void) -{ - amFlag = 0; - amOut = MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)); - bamOffset = OpRead32(modAdd+5); - - return 9; -} - - -static UINT32 am2PCDoubleDisplacement8(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2); - - return 3; -} - -static UINT32 bam2PCDoubleDisplacement8(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT8)OpRead8(modAdd+1)); - bamOffset = (INT8)OpRead8(modAdd+2); - - return 3; -} - -static UINT32 am2PCDoubleDisplacement16(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3); - - return 5; -} - -static UINT32 bam2PCDoubleDisplacement16(void) -{ - amFlag = 0; - amOut = MemRead32(PC + (INT16)OpRead16(modAdd+1)); - bamOffset = (INT8)OpRead8(modAdd+3); - - return 5; -} - -static UINT32 am2PCDoubleDisplacement32(void) -{ - amFlag = 0; - amOut = MemRead32(PC + OpRead32(modAdd+1)) + OpRead32(modAdd+5); - - return 9; -} - -static UINT32 bam2PCDoubleDisplacement32(void) -{ - amFlag = 0; - amOut = MemRead32(PC + OpRead32(modAdd+1)); - bamOffset = OpRead32(modAdd+5); - - return 9; -} - -static UINT32 am2DirectAddress(void) -{ - amFlag = 0; - amOut = OpRead32(modAdd+1); - - return 5; -} - -static UINT32 bam2DirectAddress(void) -{ - amFlag = 0; - amOut = OpRead32(modAdd+1); - bamOffset = 0; - - return 5; -} - -static UINT32 am2DirectAddressIndexed(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = OpRead32(modAdd+2) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 6; -} - -static UINT32 bam2DirectAddressIndexed(void) -{ - amFlag = 0; - amOut = OpRead32(modAdd+2); - bamOffset = v60.reg[modVal&0x1F]; - - return 6; -} - -static UINT32 am2DirectAddressDeferred(void) -{ - amFlag = 0; - amOut = MemRead32(OpRead32(modAdd+1)); - - return 5; -} - -static UINT32 bam2DirectAddressDeferred(void) -{ - amFlag = 0; - amOut = MemRead32(OpRead32(modAdd+1)); - bamOffset = 0; - - return 5; -} - -static UINT32 am2DirectAddressDeferredIndexed(void) -{ - amFlag = 0; - - switch (modDim) - { - case 0: - amOut = MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F]; - break; - case 1: - amOut = MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 2; - break; - case 2: - amOut = MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 4; - break; - case 3: - amOut = MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 8; - break; - } - - return 6; -} - -static UINT32 bam2DirectAddressDeferredIndexed(void) -{ - amFlag = 0; - amOut = MemRead32(OpRead32(modAdd+2)); - bamOffset = v60.reg[modVal&0x1F]; - - return 6; -} - -static UINT32 am2Immediate(void) -{ - // Fuck off LDPR - return am1Immediate(); -} - -static UINT32 am2ImmediateQuick(void) -{ - // fuck off LDPR - return am1ImmediateQuick(); -} - - -// AM2 Tables (for ReadAMAddress) -// ****************************** - -static UINT32 am2Error1(void) -{ - //fatalerror("CPU - AM2 - 1 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 am2Error2(void) -{ - //fatalerror("CPU - AM2 - 2 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -#if 0 -static UINT32 am2Error3(void) -{ - //fatalerror("CPU - AM2 - 3 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} -#endif - -static UINT32 am2Error4(void) -{ - //fatalerror("CPU - AM2 - 4 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 am2Error5(void) -{ - //fatalerror("CPU - AM2 - 5 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam2Error1(void) -{ - //fatalerror("CPU - BAM2 - 1 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam2Error2(void) -{ - //fatalerror("CPU - BAM2 - 2 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -#if 0 -static UINT32 bam2Error3(void) -{ - //fatalerror("CPU - BAM2 - 3 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} -#endif - -static UINT32 bam2Error4(void) -{ - //fatalerror("CPU - BAM2 - 4 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam2Error5(void) -{ - //fatalerror("CPU - BAM2 - 5 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 bam2Error6(void) -{ - //fatalerror("CPU - BAM2 - 6 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - - -static UINT32 (*const AMTable2_G7a[16])(void) = -{ - am2PCDisplacementIndexed8, - am2PCDisplacementIndexed16, - am2PCDisplacementIndexed32, - am2DirectAddressIndexed, - am2Error5, - am2Error5, - am2Error5, - am2Error5, - am2PCDisplacementIndirectIndexed8, - am2PCDisplacementIndirectIndexed16, - am2PCDisplacementIndirectIndexed32, - am2DirectAddressDeferredIndexed, - am2Error5, - am2Error5, - am2Error5, - am2Error5 -}; - -static UINT32 (*const BAMTable2_G7a[16])(void) = -{ - bam2PCDisplacementIndexed8, - bam2PCDisplacementIndexed16, - bam2PCDisplacementIndexed32, - bam2DirectAddressIndexed, - bam2Error5, - bam2Error5, - bam2Error5, - bam2Error5, - bam2PCDisplacementIndirectIndexed8, - bam2PCDisplacementIndirectIndexed16, - bam2PCDisplacementIndirectIndexed32, - bam2DirectAddressDeferredIndexed, - bam2Error5, - bam2Error5, - bam2Error5, - bam2Error5 -}; - -static UINT32 am2Group7a(void) -{ - if (!(modVal2&0x10)) - return am2Error4(); - - return AMTable2_G7a[modVal2&0xF](); -} - -static UINT32 bam2Group7a(void) -{ - if (!(modVal2&0x10)) - return bam2Error4(); - - return BAMTable2_G7a[modVal2&0xF](); -} - -static UINT32 (*const AMTable2_G7[32])(void) = -{ - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2ImmediateQuick, - am2PCDisplacement8, - am2PCDisplacement16, - am2PCDisplacement32, - am2DirectAddress, - am2Immediate, - am2Error2, - am2Error2, - am2Error2, - am2PCDisplacementIndirect8, - am2PCDisplacementIndirect16, - am2PCDisplacementIndirect32, - am2DirectAddressDeferred, - am2PCDoubleDisplacement8, - am2PCDoubleDisplacement16, - am2PCDoubleDisplacement32, - am2Error2 -}; - -static UINT32 (*const BAMTable2_G7[32])(void) = -{ - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2Error6, - bam2PCDisplacement8, - bam2PCDisplacement16, - bam2PCDisplacement32, - bam2DirectAddress, - bam2Error6, - bam2Error2, - bam2Error2, - bam2Error2, - bam2PCDisplacementIndirect8, - bam2PCDisplacementIndirect16, - bam2PCDisplacementIndirect32, - bam2DirectAddressDeferred, - bam2PCDoubleDisplacement8, - bam2PCDoubleDisplacement16, - bam2PCDoubleDisplacement32, - bam2Error2 -}; - -static UINT32 (*const AMTable2_G6[8])(void) = -{ - am2DisplacementIndexed8, - am2DisplacementIndexed16, - am2DisplacementIndexed32, - am2RegisterIndirectIndexed, - am2DisplacementIndirectIndexed8, - am2DisplacementIndirectIndexed16, - am2DisplacementIndirectIndexed32, - am2Group7a -}; - -static UINT32 (*const BAMTable2_G6[8])(void) = -{ - bam2DisplacementIndexed8, - bam2DisplacementIndexed16, - bam2DisplacementIndexed32, - bam2RegisterIndirectIndexed, - bam2DisplacementIndirectIndexed8, - bam2DisplacementIndirectIndexed16, - bam2DisplacementIndirectIndexed32, - bam2Group7a -}; - - - - -static UINT32 am2Group6(void) -{ - modVal2=OpRead8(modAdd+1); - return AMTable2_G6[modVal2>>5](); -} -static UINT32 bam2Group6(void) -{ - modVal2=OpRead8(modAdd+1); - return BAMTable2_G6[modVal2>>5](); -} - -static UINT32 am2Group7(void) -{ - return AMTable2_G7[modVal&0x1F](); -} -static UINT32 bam2Group7(void) -{ - return BAMTable2_G7[modVal&0x1F](); -} - - -static UINT32 (*const AMTable2[2][8])(void) = -{ - { - am2Displacement8, - am2Displacement16, - am2Displacement32, - am2RegisterIndirect, - am2DisplacementIndirect8, - am2DisplacementIndirect16, - am2DisplacementIndirect32, - am2Group7 - }, - - { - am2DoubleDisplacement8, - am2DoubleDisplacement16, - am2DoubleDisplacement32, - am2Register, - am2Autoincrement, - am2Autodecrement, - am2Group6, - am2Error1 - } -}; - -static UINT32 (*const BAMTable2[2][8])(void) = -{ - { - bam2Displacement8, - bam2Displacement16, - bam2Displacement32, - bam2RegisterIndirect, - bam2DisplacementIndirect8, - bam2DisplacementIndirect16, - bam2DisplacementIndirect32, - bam2Group7 - }, - - { - bam2DoubleDisplacement8, - bam2DoubleDisplacement16, - bam2DoubleDisplacement32, - bam2Error6, - bam2Autoincrement, - bam2Autodecrement, - bam2Group6, - bam2Error1 - } -}; - - - - diff --git a/jan/src/cpu/v60/am3.c b/jan/src/cpu/v60/am3.c deleted file mode 100644 index 1ab684575..000000000 --- a/jan/src/cpu/v60/am3.c +++ /dev/null @@ -1,885 +0,0 @@ - -// AM3 Functions (for ReadAM) -// ************************** - -static UINT32 am3Register(void) -{ - switch (modDim) - { - case 0: - SETREG8(v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - SETREG16(v60.reg[modVal&0x1F], modWriteValH); - break; - case 2: - v60.reg[modVal&0x1F] = modWriteValW; - break; - } - - return 1; -} - -static UINT32 am3RegisterIndirect(void) -{ - switch (modDim) - { - case 0: - MemWrite8(v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(v60.reg[modVal&0x1F], modWriteValH); - break; - case 2: - MemWrite32(v60.reg[modVal&0x1F], modWriteValW); - break; - } - - return 1; -} - -static UINT32 am3RegisterIndirectIndexed(void) -{ - switch (modDim) - { - case 0: - MemWrite8(v60.reg[modVal2&0x1F] + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(v60.reg[modVal2&0x1F] + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(v60.reg[modVal2&0x1F] + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 2; -} - -static UINT32 am3Autoincrement(void) -{ - switch (modDim) - { - case 0: - MemWrite8(v60.reg[modVal&0x1F], modWriteValB); - v60.reg[modVal&0x1F] += 1; - break; - case 1: - MemWrite16(v60.reg[modVal&0x1F], modWriteValH); - v60.reg[modVal&0x1F] += 2; - break; - case 2: - MemWrite32(v60.reg[modVal&0x1F], modWriteValW); - v60.reg[modVal&0x1F] += 4; - break; - } - - return 1; -} - -static UINT32 am3Autodecrement(void) -{ - switch (modDim) - { - case 0: - v60.reg[modVal&0x1F] -= 1; - MemWrite8(v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - v60.reg[modVal&0x1F] -= 2; - MemWrite16(v60.reg[modVal&0x1F], modWriteValH); - break; - case 2: - v60.reg[modVal&0x1F] -= 4; - MemWrite32(v60.reg[modVal&0x1F], modWriteValW); - break; - } - - return 1; -} - -static UINT32 am3Displacement8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1), modWriteValB); - break; - case 1: - MemWrite16(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1), modWriteValH); - break; - case 2: - MemWrite32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1), modWriteValW); - break; - } - - return 2; -} - -static UINT32 am3Displacement16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1), modWriteValB); - break; - case 1: - MemWrite16(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1), modWriteValH); - break; - case 2: - MemWrite32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1), modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3Displacement32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(v60.reg[modVal&0x1F] + OpRead32(modAdd+1), modWriteValB); - break; - case 1: - MemWrite16(v60.reg[modVal&0x1F] + OpRead32(modAdd+1), modWriteValH); - break; - case 2: - MemWrite32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1), modWriteValW); - break; - } - - return 5; -} - - -static UINT32 am3DisplacementIndexed8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3DisplacementIndexed16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 4; -} - -static UINT32 am3DisplacementIndexed32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 6; -} - - -static UINT32 am3PCDisplacement8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(PC + (INT8)OpRead8(modAdd+1), modWriteValB); - break; - case 1: - MemWrite16(PC + (INT8)OpRead8(modAdd+1), modWriteValH); - break; - case 2: - MemWrite32(PC + (INT8)OpRead8(modAdd+1), modWriteValW); - break; - } - - return 2; -} - -static UINT32 am3PCDisplacement16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(PC + (INT16)OpRead16(modAdd+1), modWriteValB); - break; - case 1: - MemWrite16(PC + (INT16)OpRead16(modAdd+1), modWriteValH); - break; - case 2: - MemWrite32(PC + (INT16)OpRead16(modAdd+1), modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3PCDisplacement32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(PC + OpRead32(modAdd+1), modWriteValB); - break; - case 1: - MemWrite16(PC + OpRead32(modAdd+1), modWriteValH); - break; - case 2: - MemWrite32(PC + OpRead32(modAdd+1), modWriteValW); - break; - } - - return 5; -} - -static UINT32 am3PCDisplacementIndexed8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(PC + (INT8)OpRead8(modAdd+2) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3PCDisplacementIndexed16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(PC + (INT16)OpRead16(modAdd+2) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 4; -} - -static UINT32 am3PCDisplacementIndexed32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(PC + OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 6; -} - -static UINT32 am3DisplacementIndirect8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)), modWriteValW); - break; - } - - return 2; -} - -static UINT32 am3DisplacementIndirect16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)), modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3DisplacementIndirect32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)), modWriteValW); - break; - } - - return 5; -} - - -static UINT32 am3DisplacementIndirectIndexed8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(MemRead32(v60.reg[modVal2&0x1F] + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3DisplacementIndirectIndexed16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(MemRead32(v60.reg[modVal2&0x1F] + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 4; -} - -static UINT32 am3DisplacementIndirectIndexed32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(MemRead32(v60.reg[modVal2&0x1F] + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 6; -} - -static UINT32 am3PCDisplacementIndirect8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(PC + (INT8)OpRead8(modAdd+1)), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(PC + (INT8)OpRead8(modAdd+1)), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(PC + (INT8)OpRead8(modAdd+1)), modWriteValW); - break; - } - - return 2; -} - -static UINT32 am3PCDisplacementIndirect16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(PC + (INT16)OpRead16(modAdd+1)), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(PC + (INT16)OpRead16(modAdd+1)), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(PC + (INT16)OpRead16(modAdd+1)), modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3PCDisplacementIndirect32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(PC + OpRead32(modAdd+1)), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(PC + OpRead32(modAdd+1)), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(PC + OpRead32(modAdd+1)), modWriteValW); - break; - } - - return 5; -} - - -static UINT32 am3PCDisplacementIndirectIndexed8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(MemRead32(PC + (INT8)OpRead8(modAdd+2)) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3PCDisplacementIndirectIndexed16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(MemRead32(PC + (INT16)OpRead16(modAdd+2)) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 4; -} - -static UINT32 am3PCDisplacementIndirectIndexed32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(MemRead32(PC + OpRead32(modAdd+2)) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 6; -} - - -static UINT32 am3DoubleDisplacement8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(v60.reg[modVal&0x1F] + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2), modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3DoubleDisplacement16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(v60.reg[modVal&0x1F] + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3), modWriteValW); - break; - } - - return 5; -} - -static UINT32 am3DoubleDisplacement32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)) + OpRead32(modAdd+5), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)) + OpRead32(modAdd+5), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(v60.reg[modVal&0x1F] + OpRead32(modAdd+1)) + OpRead32(modAdd+5), modWriteValW); - break; - } - - return 9; -} - - -static UINT32 am3PCDoubleDisplacement8(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(PC + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(PC + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(PC + (INT8)OpRead8(modAdd+1)) + (INT8)OpRead8(modAdd+2), modWriteValW); - break; - } - - return 3; -} - -static UINT32 am3PCDoubleDisplacement16(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(PC + (INT16)OpRead16(modAdd+1)) + (INT16)OpRead16(modAdd+3), modWriteValW); - break; - } - - return 5; -} - -static UINT32 am3PCDoubleDisplacement32(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(PC + OpRead32(modAdd+1)) + OpRead32(modAdd+5), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(PC + OpRead32(modAdd+1)) + OpRead32(modAdd+5), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(PC + OpRead32(modAdd+1)) + OpRead32(modAdd+5), modWriteValW); - break; - } - - return 9; -} - -static UINT32 am3DirectAddress(void) -{ - switch (modDim) - { - case 0: - MemWrite8(OpRead32(modAdd+1), modWriteValB); - break; - case 1: - MemWrite16(OpRead32(modAdd+1), modWriteValH); - break; - case 2: - MemWrite32(OpRead32(modAdd+1), modWriteValW); - break; - } - - return 5; -} - -static UINT32 am3DirectAddressIndexed(void) -{ - switch (modDim) - { - case 0: - MemWrite8(OpRead32(modAdd+2) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 2, modWriteValH); - break; - case 2: - MemWrite32(OpRead32(modAdd+2) + v60.reg[modVal&0x1F] * 4, modWriteValW); - break; - } - - return 6; -} - -static UINT32 am3DirectAddressDeferred(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(OpRead32(modAdd+1)), modWriteValB); - break; - case 1: - MemWrite16(MemRead32(OpRead32(modAdd+1)), modWriteValH); - break; - case 2: - MemWrite32(MemRead32(OpRead32(modAdd+1)), modWriteValW); - break; - } - - return 5; -} - -static UINT32 am3DirectAddressDeferredIndexed(void) -{ - switch (modDim) - { - case 0: - MemWrite8(MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F], modWriteValB); - break; - case 1: - MemWrite16(MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F], modWriteValH); - break; - case 2: - MemWrite32(MemRead32(OpRead32(modAdd+2)) + v60.reg[modVal&0x1F], modWriteValW); - break; - } - - return 6; -} - -static UINT32 am3Immediate(void) -{ - //fatalerror("CPU - AM3 - IMM (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 am3ImmediateQuick(void) -{ - //fatalerror("CPU - AM3 - IMMQ (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - - - -// AM3 Tables (for ReadAMAddress) -// ****************************** - -static UINT32 am3Error1(void) -{ - //fatalerror("CPU - AM3 - 1 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 am3Error2(void) -{ - //fatalerror("CPU - AM3 - 2 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} -#if 0 -static UINT32 am3Error3(void) -{ - //fatalerror("CPU - AM3 - 3 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} -#endif -static UINT32 am3Error4(void) -{ - //fatalerror("CPU - AM3 - 4 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 am3Error5(void) -{ - //fatalerror("CPU - AM3 - 5 (PC=%06x)", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 (*const AMTable3_G7a[16])(void) = -{ - am3PCDisplacementIndexed8, - am3PCDisplacementIndexed16, - am3PCDisplacementIndexed32, - am3DirectAddressIndexed, - am3Error5, - am3Error5, - am3Error5, - am3Error5, - am3PCDisplacementIndirectIndexed8, - am3PCDisplacementIndirectIndexed16, - am3PCDisplacementIndirectIndexed32, - am3DirectAddressDeferredIndexed, - am3Error5, - am3Error5, - am3Error5, - am3Error5 -}; - -static UINT32 am3Group7a(void) -{ - if (!(modVal2&0x10)) - return am3Error4(); - - return AMTable3_G7a[modVal2&0xF](); -} - -static UINT32 (*const AMTable3_G7[32])(void) = -{ - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3ImmediateQuick, - am3PCDisplacement8, - am3PCDisplacement16, - am3PCDisplacement32, - am3DirectAddress, - am3Immediate, - am3Error2, - am3Error2, - am3Error2, - am3PCDisplacementIndirect8, - am3PCDisplacementIndirect16, - am3PCDisplacementIndirect32, - am3DirectAddressDeferred, - am3PCDoubleDisplacement8, - am3PCDoubleDisplacement16, - am3PCDoubleDisplacement32, - am3Error2 -}; - -static UINT32 (*const AMTable3_G6[8])(void) = -{ - am3DisplacementIndexed8, - am3DisplacementIndexed16, - am3DisplacementIndexed32, - am3RegisterIndirectIndexed, - am3DisplacementIndirectIndexed8, - am3DisplacementIndirectIndexed16, - am3DisplacementIndirectIndexed32, - am3Group7a -}; - - - - -static UINT32 am3Group6(void) -{ - modVal2=OpRead8(modAdd+1); - return AMTable3_G6[modVal2>>5](); -} - - -static UINT32 am3Group7(void) -{ - return AMTable3_G7[modVal&0x1F](); -} - - - -static UINT32 (*const AMTable3[2][8])(void) = -{ - { - am3Displacement8, - am3Displacement16, - am3Displacement32, - am3RegisterIndirect, - am3DisplacementIndirect8, - am3DisplacementIndirect16, - am3DisplacementIndirect32, - am3Group7 - }, - - { - am3DoubleDisplacement8, - am3DoubleDisplacement16, - am3DoubleDisplacement32, - am3Register, - am3Autoincrement, - am3Autodecrement, - am3Group6, - am3Error1 - } -}; - - - diff --git a/jan/src/cpu/v60/op12.c b/jan/src/cpu/v60/op12.c deleted file mode 100644 index 1ace43256..000000000 --- a/jan/src/cpu/v60/op12.c +++ /dev/null @@ -1,2378 +0,0 @@ -/* - * MUL* and MULU* do not set OV correctly - * DIVX: the second operand should be treated as dword instead of word - * GETATE, GETPTE and GETRA should not be used - * UPDPSW: _CY and _OV must be cleared or unchanged? I suppose - * cleared, like TEST being done on the mask operand. - * MOVT: I cannot understand exactly what happens to the result - * when an overflow occurs - * - * Unimplemented opcodes: - * ROTC, UPDATE, UPDPTE - */ - -static UINT32 f12Op1, f12Op2; -static UINT8 f12Flag1, f12Flag2; - - -/* - * Macro to access data in operands decoded with ReadAMAddress() - */ - -#define F12LOADOPBYTE(num) \ - if (f12Flag##num) \ - appb = (UINT8)v60.reg[f12Op##num]; \ - else \ - appb = MemRead8(f12Op##num); - -#define F12LOADOPHALF(num) \ - if (f12Flag##num) \ - apph = (UINT16)v60.reg[f12Op##num]; \ - else \ - apph = MemRead16(f12Op##num); - -#define F12LOADOPWORD(num) \ - if (f12Flag##num) \ - appw = v60.reg[f12Op##num]; \ - else \ - appw = MemRead32(f12Op##num); - -#define F12STOREOPBYTE(num) \ - if (f12Flag##num) \ - SETREG8(v60.reg[f12Op##num], appb); \ - else \ - MemWrite8(f12Op##num,appb); - -#define F12STOREOPHALF(num) \ - if (f12Flag##num) \ - SETREG16(v60.reg[f12Op##num], apph); \ - else \ - MemWrite16(f12Op##num,apph); - -#define F12STOREOPWORD(num) \ - if (f12Flag##num) \ - v60.reg[f12Op##num] = appw; \ - else \ - MemWrite32(f12Op##num,appw); - -#define F12LOADOP1BYTE() F12LOADOPBYTE(1) -#define F12LOADOP1HALF() F12LOADOPHALF(1) -#define F12LOADOP1WORD() F12LOADOPWORD(1) - -#define F12LOADOP2BYTE() F12LOADOPBYTE(2) -#define F12LOADOP2HALF() F12LOADOPHALF(2) -#define F12LOADOP2WORD() F12LOADOPWORD(2) - -#define F12STOREOP1BYTE() F12STOREOPBYTE(1) -#define F12STOREOP1HALF() F12STOREOPHALF(1) -#define F12STOREOP1WORD() F12STOREOPWORD(1) - -#define F12STOREOP2BYTE() F12STOREOPBYTE(2) -#define F12STOREOP2HALF() F12STOREOPHALF(2) -#define F12STOREOP2WORD() F12STOREOPWORD(2) - - - -#define F12END() \ - return amLength1 + amLength2 + 2; - -static UINT8 if12; - -// Decode the first operand of the instruction and prepare -// writing to the second operand. -static void F12DecodeFirstOperand(UINT32 (*DecodeOp1)(void), UINT8 dim1) -{ - if12 = OpRead8(PC + 1); - - // Check if F1 or F2 - if (if12 & 0x80) - { - modDim = dim1; - modM = if12 & 0x40; - modAdd = PC + 2; - amLength1 = DecodeOp1(); - f12Op1 = amOut; - f12Flag1 = amFlag; - } - else - { - // Check D flag - if (if12 & 0x20) - { - modDim = dim1; - modM = if12 & 0x40; - modAdd = PC + 2; - amLength1 = DecodeOp1(); - f12Op1 = amOut; - f12Flag1 = amFlag; - } - else - { - if (DecodeOp1==ReadAM) - { - switch (dim1) - { - case 0: - f12Op1 = (UINT8)v60.reg[if12 & 0x1F]; - break; - case 1: - f12Op1 = (UINT16)v60.reg[if12 & 0x1F]; - break; - case 2: - f12Op1 = v60.reg[if12 & 0x1F]; - break; - } - - f12Flag1 = 0; - } - else - { - f12Flag1 = 1; - f12Op1 = if12 & 0x1F; - } - - amLength1 = 0; - } - } -} - -static void F12WriteSecondOperand(UINT8 dim2) -{ - modDim = dim2; - - // Check if F1 or F2 - if (if12 & 0x80) - { - modM = if12 & 0x20; - modAdd = PC + 2 + amLength1; - modDim = dim2; - amLength2 = WriteAM(); - } - else - { - // Check D flag - if (if12 & 0x20) - { - switch (dim2) - { - case 0: - SETREG8(v60.reg[if12 & 0x1F], modWriteValB); - break; - case 1: - SETREG16(v60.reg[if12 & 0x1F], modWriteValH); - break; - case 2: - v60.reg[if12 & 0x1F] = modWriteValW; - break; - } - - amLength2 = 0; - } - else - { - modM = if12 & 0x40; - modAdd = PC + 2; - modDim = dim2; - amLength2 = WriteAM(); - } - } -} - - - -// Decode both format 1/2 operands -static void F12DecodeOperands(UINT32 (*DecodeOp1)(void), UINT8 dim1, UINT32 (*DecodeOp2)(void), UINT8 dim2) -{ - UINT8 _if12 = OpRead8(PC + 1); - - // Check if F1 or F2 - if (_if12 & 0x80) - { - modDim = dim1; - modM = _if12 & 0x40; - modAdd = PC + 2; - amLength1 = DecodeOp1(); - f12Op1 = amOut; - f12Flag1 = amFlag; - - modDim = dim2; - modM = _if12 & 0x20; - modAdd = PC + 2 + amLength1; - amLength2 = DecodeOp2(); - f12Op2 = amOut; - f12Flag2 = amFlag; - } - else - { - // Check D flag - if (_if12 & 0x20) - { - if (DecodeOp2==ReadAMAddress) - { - f12Op2 = _if12 & 0x1F; - f12Flag2 = 1; - } - else - { - switch (dim2) - { - case 0: - f12Op2 = (UINT8)v60.reg[_if12 & 0x1F]; - break; - case 1: - f12Op2 = (UINT16)v60.reg[_if12 & 0x1F]; - break; - case 2: - f12Op2 = v60.reg[_if12 & 0x1F]; - break; - } - } - - amLength2 = 0; - - modDim = dim1; - modM = _if12 & 0x40; - modAdd = PC + 2; - amLength1 = DecodeOp1(); - f12Op1 = amOut; - f12Flag1 = amFlag; - } - else - { - if (DecodeOp1==ReadAMAddress) - { - f12Op1 = _if12 & 0x1F; - f12Flag1 = 1; - } - else - { - switch (dim1) - { - case 0: - f12Op1 = (UINT8)v60.reg[_if12 & 0x1F]; - break; - case 1: - f12Op1 = (UINT16)v60.reg[_if12 & 0x1F]; - break; - case 2: - f12Op1 = v60.reg[_if12 & 0x1F]; - break; - } - } - amLength1 = 0; - - modDim = dim2; - modM = _if12 & 0x40; - modAdd = PC + 2 + amLength1; - amLength2 = DecodeOp2(); - f12Op2 = amOut; - f12Flag2 = amFlag; - } - } -} - -static UINT32 opADDB(void) /* TRUSTED (C too!)*/ -{ - UINT8 appb; - F12DecodeOperands(ReadAM,0,ReadAMAddress,0); - - F12LOADOP2BYTE(); - - ADDB(appb, (UINT8)f12Op1); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opADDH(void) /* TRUSTED (C too!)*/ -{ - UINT16 apph; - F12DecodeOperands(ReadAM,1,ReadAMAddress,1); - - F12LOADOP2HALF(); - - ADDW(apph, (UINT16)f12Op1); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opADDW(void) /* TRUSTED (C too!) */ -{ - UINT32 appw; - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - ADDL(appw, (UINT32)f12Op1); - - F12STOREOP2WORD(); - F12END(); -} - -static UINT32 opADDCB(void) -{ - UINT8 appb, temp; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,0); - - F12LOADOP2BYTE(); - - temp = ((UINT8)f12Op1 + (_CY?1:0)); - ADDB(appb, temp); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opADDCH(void) -{ - UINT16 apph, temp; - - F12DecodeOperands(ReadAM,1,ReadAMAddress,1); - - F12LOADOP2HALF(); - - temp = ((UINT16)f12Op1 + (_CY?1:0)); - ADDW(apph, temp); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opADDCW(void) -{ - UINT32 appw, temp; - - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - temp = f12Op1 + (_CY?1:0); - ADDL(appw, temp); - - F12STOREOP2WORD(); - F12END(); -} - -static UINT32 opANDB(void) /* TRUSTED */ -{ - UINT8 appb; - F12DecodeOperands(ReadAM,0,ReadAMAddress,0); - - F12LOADOP2BYTE(); - - appb &= f12Op1; - _OV = 0; - _S = ((appb&0x80)!=0); - _Z = (appb==0); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opANDH(void) /* TRUSTED */ -{ - UINT16 apph; - F12DecodeOperands(ReadAM,1,ReadAMAddress,1); - - F12LOADOP2HALF(); - - apph &= f12Op1; - _OV = 0; - _S = ((apph&0x8000)!=0); - _Z = (apph==0); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opANDW(void) /* TRUSTED */ -{ - UINT32 appw; - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - appw &= f12Op1; - _OV = 0; - _S = ((appw&0x80000000)!=0); - _Z = (appw==0); - - F12STOREOP2WORD(); - F12END(); -} - -static UINT32 opCALL(void) /* TRUSTED */ -{ - F12DecodeOperands(ReadAMAddress,0,ReadAMAddress,2); - - SP -= 4; - MemWrite32(SP, AP); - AP = f12Op2; - - SP -= 4; - MemWrite32(SP, PC + amLength1 + amLength2 + 2); - PC = f12Op1; - ChangePC(PC); - - return 0; -} - -static UINT32 opCHKAR(void) -{ - F12DecodeOperands(ReadAM,0,ReadAM,0); - - // No MMU and memory permissions yet @@@ - _Z = 1; - _CY = 0; - _S = 0; - - F12END(); -} - -static UINT32 opCHKAW(void) -{ - F12DecodeOperands(ReadAM,0,ReadAM,0); - - // No MMU and memory permissions yet @@@ - _Z = 1; - _CY = 0; - _S = 0; - - F12END(); -} - -static UINT32 opCHKAE(void) -{ - F12DecodeOperands(ReadAM,0,ReadAM,0); - - // No MMU and memory permissions yet @@@ - _Z = 1; - _CY = 0; - _S = 0; - - F12END(); -} - -static UINT32 opCHLVL(void) -{ - UINT32 oldPSW; - - F12DecodeOperands(ReadAM,0,ReadAM,0); - - if (f12Op1>3) - { - //fatalerror("Illegal data field on opCHLVL, PC=%x", PC); - } - - oldPSW = v60_update_psw_for_exception(0, f12Op1); - - SP -= 4; - MemWrite32(SP,f12Op2); - - SP -= 4; - MemWrite32(SP,EXCEPTION_CODE_AND_SIZE(0x1800 + f12Op1*0x100, 8)); - - SP -= 4; - MemWrite32(SP,oldPSW); - - SP -= 4; - MemWrite32(SP,PC + amLength1 + amLength2 + 2); - - PC = GETINTVECT(24+f12Op1); - ChangePC(PC); - - return 0; -} - -static UINT32 opCLR1(void) /* TRUSTED */ -{ - UINT32 appw; - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - _CY = ((appw & (1<> 8)!=0); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opMULH(void) -{ - UINT16 apph; - UINT32 tmp; - F12DecodeOperands(ReadAM,1,ReadAMAddress,1); - - F12LOADOP2HALF(); - - // @@@ OV not set!! - tmp=(INT16)apph * (INT32)(INT16)f12Op1; - apph = tmp; - _Z = (apph == 0); - _S = ((apph & 0x8000)!=0); - _OV = ((tmp >> 16)!=0); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opMULW(void) -{ - UINT32 appw; - UINT64 tmp; - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - // @@@ OV not set!! - tmp=(INT32)appw * (INT64)(INT32)f12Op1; - appw = tmp; - _Z = (appw == 0); - _S = ((appw & 0x80000000)!=0); - _OV = ((tmp >> 32) != 0); - - F12STOREOP2WORD(); - F12END(); -} - -static UINT32 opMULUB(void) -{ - UINT8 appb; - UINT32 tmp; - F12DecodeOperands(ReadAM,0,ReadAMAddress,0); - - F12LOADOP2BYTE(); - - // @@@ OV not set!! - tmp = appb * (UINT8)f12Op1; - appb = tmp; - _Z = (appb == 0); - _S = ((appb & 0x80)!=0); - _OV = ((tmp >> 8)!=0); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opMULUH(void) -{ - UINT16 apph; - UINT32 tmp; - F12DecodeOperands(ReadAM,1,ReadAMAddress,1); - - F12LOADOP2HALF(); - - // @@@ OV not set!! - tmp=apph * (UINT16)f12Op1; - apph = tmp; - _Z = (apph == 0); - _S = ((apph & 0x8000)!=0); - _OV = ((tmp >> 16)!=0); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opMULUW(void) -{ - UINT32 appw; - UINT64 tmp; - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - // @@@ OV not set!! - tmp=(UINT64)appw * (UINT64)f12Op1; - appw = tmp; - _Z = (appw == 0); - _S = ((appw & 0x80000000)!=0); - _OV = ((tmp >> 32)!=0); - - F12STOREOP2WORD(); - F12END(); -} - -static UINT32 opNEGB(void) /* TRUSTED (C too!)*/ -{ - F12DecodeFirstOperand(ReadAM,0); - - modWriteValB = 0; - SUBB(modWriteValB, (INT8)f12Op1); - - F12WriteSecondOperand(0); - F12END(); -} - -static UINT32 opNEGH(void) /* TRUSTED (C too!)*/ -{ - F12DecodeFirstOperand(ReadAM,1); - - modWriteValH = 0; - SUBW(modWriteValH, (INT16)f12Op1); - - F12WriteSecondOperand(1); - F12END(); -} - -static UINT32 opNEGW(void) /* TRUSTED (C too!)*/ -{ - F12DecodeFirstOperand(ReadAM,2); - - modWriteValW = 0; - SUBL(modWriteValW, (INT32)f12Op1); - - F12WriteSecondOperand(2); - F12END(); -} - -static UINT32 opNOTB(void) /* TRUSTED */ -{ - F12DecodeFirstOperand(ReadAM,0); - modWriteValB=~f12Op1; - - _OV=0; - _S=((modWriteValB&0x80)!=0); - _Z=(modWriteValB==0); - - F12WriteSecondOperand(0); - F12END(); -} - -static UINT32 opNOTH(void) /* TRUSTED */ -{ - F12DecodeFirstOperand(ReadAM,1); - modWriteValH=~f12Op1; - - _OV=0; - _S=((modWriteValH&0x8000)!=0); - _Z=(modWriteValH==0); - - F12WriteSecondOperand(1); - F12END(); -} - -static UINT32 opNOTW(void) /* TRUSTED */ -{ - F12DecodeFirstOperand(ReadAM,2); - modWriteValW=~f12Op1; - - _OV=0; - _S=((modWriteValW&0x80000000)!=0); - _Z=(modWriteValW==0); - - F12WriteSecondOperand(2); - F12END(); -} - -static UINT32 opNOT1(void) /* TRUSTED */ -{ - UINT32 appw; - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - _CY = ((appw & (1<0) - { - for (i=0;i> 7); - - _CY=(appb&0x1)!=0; - } - else if (count<0) - { - count=-count; - for (i=0;i>1) | ((appb&0x1) << 7); - - _CY=(appb&0x80)!=0; - } - else - _CY=0; - - _OV=0; - _S=(appb&0x80)!=0; - _Z=(appb==0); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opROTH(void) /* TRUSTED */ -{ - UINT16 apph; - INT8 i,count; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,1); - - F12LOADOP2HALF(); - - count=(INT8)(f12Op1&0xFF); - if (count>0) - { - for (i=0;i> 15); - - _CY=(apph&0x1)!=0; - } - else if (count<0) - { - count=-count; - for (i=0;i>1) | ((apph&0x1) << 15); - - _CY=(apph&0x8000)!=0; - } - else - _CY=0; - - _OV=0; - _S=(apph&0x8000)!=0; - _Z=(apph==0); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opROTW(void) /* TRUSTED */ -{ - UINT32 appw; - INT8 i,count; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,2); - - F12LOADOP2WORD(); - - count=(INT8)(f12Op1&0xFF); - if (count>0) - { - for (i=0;i> 31); - - _CY=(appw&0x1)!=0; - } - else if (count<0) - { - count=-count; - for (i=0;i>1) | ((appw&0x1) << 31); - - _CY=(appw&0x80000000)!=0; - } - else - _CY=0; - - _OV=0; - _S=(appw&0x80000000)!=0; - _Z=(appw==0); - - F12STOREOP2WORD(); - F12END(); -} - -static UINT32 opROTCB(void) /* TRUSTED */ -{ - UINT8 appb; - INT8 i,cy,count; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,0); - - F12LOADOP2BYTE(); - NORMALIZEFLAGS(); - - count=(INT8)(f12Op1&0xFF); - if (count>0) - { - for (i=0;i> 7); - appb = (appb<<1) | cy; - } - } - else if (count<0) - { - count=-count; - for (i=0;i>1) | (cy << 7); - } - } - else - _CY = 0; - - _OV=0; - _S=(appb&0x80)!=0; - _Z=(appb==0); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opROTCH(void) /* TRUSTED */ -{ - UINT16 apph; - INT8 i,cy,count; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,1); - - F12LOADOP2HALF(); - NORMALIZEFLAGS(); - - count=(INT8)(f12Op1&0xFF); - if (count>0) - { - for (i=0;i> 15); - apph = (apph<<1) | cy; - } - } - else if (count<0) - { - count=-count; - for (i=0;i>1) | ((UINT16)cy << 15); - } - } - else - _CY = 0; - - _OV=0; - _S=(apph&0x8000)!=0; - _Z=(apph==0); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opROTCW(void) /* TRUSTED */ -{ - UINT32 appw; - INT8 i,cy,count; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,2); - - F12LOADOP2WORD(); - NORMALIZEFLAGS(); - - count=(INT8)(f12Op1&0xFF); - if (count>0) - { - for (i=0;i> 31); - appw = (appw<<1) | cy; - } - } - else if (count<0) - { - count=-count; - for (i=0;i>1) | ((UINT32)cy << 31); - } - } - else - _CY=0; - - _OV=0; - _S=(appw&0x80000000)!=0; - _Z=(appw==0); - - F12STOREOP2WORD(); - F12END(); -} - -static UINT32 opRVBIT(void) -{ - F12DecodeFirstOperand(ReadAM,0); - - modWriteValB =(UINT8) - (((f12Op1 & (1<<0)) << 7) | - ((f12Op1 & (1<<1)) << 5) | - ((f12Op1 & (1<<2)) << 3) | - ((f12Op1 & (1<<3)) << 1) | - ((f12Op1 & (1<<4)) >> 1) | - ((f12Op1 & (1<<5)) >> 3) | - ((f12Op1 & (1<<6)) >> 5) | - ((f12Op1 & (1<<7)) >> 7)); - - F12WriteSecondOperand(0); - F12END(); -} - -static UINT32 opRVBYT(void) /* TRUSTED */ -{ - F12DecodeFirstOperand(ReadAM,2); - - modWriteValW = ((f12Op1 & 0x000000FF) << 24) | - ((f12Op1 & 0x0000FF00) << 8) | - ((f12Op1 & 0x00FF0000) >> 8) | - ((f12Op1 & 0xFF000000) >> 24); - - F12WriteSecondOperand(2); - F12END(); -} - -static UINT32 opSET1(void) /* TRUSTED */ -{ - UINT32 appw; - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - _CY = ((appw & (1<> (bitsize-1)) & 1; \ - tmp <<= count; \ - tmp -= 1; \ - tmp <<= (bitsize - (count)); \ - _OV = (((val) & tmp) != tmp); \ - _CY = (((val) & (1 << (count-1))) != 0); \ -} -*/ - -// During the shift, the overflow is set if the sign bit changes at any point during the shift -#define SHIFTLEFT_OV(val, count, bitsize) \ -{\ - UINT32 tmp; \ - if (count == 32) \ - tmp = 0xFFFFFFFF; \ - else \ - tmp = ((1 << (count)) - 1); \ - tmp <<= (bitsize - (count)); \ - if (((val) >> (bitsize-1)) & 1) \ - _OV = (((val) & tmp) != tmp); \ - else \ - _OV = (((val) & tmp) != 0); \ -} - -#define SHIFTLEFT_CY(val, count, bitsize) \ - _CY = (UINT8)(((val) >> (bitsize - count)) & 1); - - - -#define SHIFTARITHMETICRIGHT_OV(val, count, bitsize) \ - _OV = 0; - -#define SHIFTARITHMETICRIGHT_CY(val, count, bitsize) \ - _CY = (UINT8)(((val) >> (count-1)) & 1); - - - -static UINT32 opSHAB(void) -{ - UINT8 appb; - INT8 count; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,0); - - F12LOADOP2BYTE(); - - count=(INT8)(f12Op1&0xFF); - - // Special case: destination unchanged, flags set - if (count == 0) - { - _CY = _OV = 0; - SetSZPF_Byte(appb); - } - else if (count>0) - { - SHIFTLEFT_OV(appb, count, 8); - - // @@@ Undefined what happens to CY when count >= bitsize - SHIFTLEFT_CY(appb, count, 8); - - // do the actual shift... - if (count >= 8) - appb = 0; - else - appb <<= count; - - // and set zero and sign - SetSZPF_Byte(appb); - } - else - { - count = -count; - - SHIFTARITHMETICRIGHT_OV(appb, count, 8); - SHIFTARITHMETICRIGHT_CY(appb, count, 8); - - if (count >= 8) - appb = (appb & 0x80) ? 0xFF : 0; - else - appb = ((INT8)appb) >> count; - - SetSZPF_Byte(appb); - } - -// mame_printf_debug("SHAB: %x _CY: %d _Z: %d _OV: %d _S: %d\n", appb, _CY, _Z, _OV, _S); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opSHAH(void) -{ - UINT16 apph; - INT8 count; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,1); - - F12LOADOP2HALF(); - - count=(INT8)(f12Op1&0xFF); - - // Special case: destination unchanged, flags set - if (count == 0) - { - _CY = _OV = 0; - SetSZPF_Word(apph); - } - else if (count>0) - { - SHIFTLEFT_OV(apph, count, 16); - - // @@@ Undefined what happens to CY when count >= bitsize - SHIFTLEFT_CY(apph, count, 16); - - // do the actual shift... - if (count >= 16) - apph = 0; - else - apph <<= count; - - // and set zero and sign - SetSZPF_Word(apph); - } - else - { - count = -count; - - SHIFTARITHMETICRIGHT_OV(apph, count, 16); - SHIFTARITHMETICRIGHT_CY(apph, count, 16); - - if (count >= 16) - apph = (apph & 0x8000) ? 0xFFFF : 0; - else - apph = ((INT16)apph) >> count; - - SetSZPF_Word(apph); - } - -// mame_printf_debug("SHAH: %x >> %d = %x _CY: %d _Z: %d _OV: %d _S: %d\n", oldval, count, apph, _CY, _Z, _OV, _S); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opSHAW(void) -{ - UINT32 appw; - INT8 count; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,2); - - F12LOADOP2WORD(); - - count=(INT8)(f12Op1&0xFF); - - // Special case: destination unchanged, flags set - if (count == 0) - { - _CY = _OV = 0; - SetSZPF_Long(appw); - } - else if (count>0) - { - SHIFTLEFT_OV(appw, count, 32); - - // @@@ Undefined what happens to CY when count >= bitsize - SHIFTLEFT_CY(appw, count, 32); - - // do the actual shift... - if (count >= 32) - appw = 0; - else - appw <<= count; - - // and set zero and sign - SetSZPF_Long(appw); - } - else - { - count = -count; - - SHIFTARITHMETICRIGHT_OV(appw, count, 32); - SHIFTARITHMETICRIGHT_CY(appw, count, 32); - - if (count >= 32) - appw = (appw & 0x80000000) ? 0xFFFFFFFF : 0; - else - appw = ((INT32)appw) >> count; - - SetSZPF_Long(appw); - } - -// mame_printf_debug("SHAW: %x >> %d = %x _CY: %d _Z: %d _OV: %d _S: %d\n", oldval, count, appw, _CY, _Z, _OV, _S); - - F12STOREOP2WORD(); - F12END(); -} - - -static UINT32 opSHLB(void) /* TRUSTED */ -{ - UINT8 appb; - INT8 count; - UINT32 tmp; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,0); - - F12LOADOP2BYTE(); - - count=(INT8)(f12Op1&0xFF); - if (count>0) - { - // left shift flags: - // carry gets the last bit shifted out, - // overflow is always CLEARed - - _OV = 0; // default to no overflow - - // now handle carry - tmp = appb & 0xff; - tmp <<= count; - SetCFB(tmp); // set carry properly - - // do the actual shift... - appb <<= count; - - // and set zero and sign - SetSZPF_Byte(appb); - } - else - { - if (count == 0) - { - // special case: clear carry and overflow, do nothing else - _CY = _OV = 0; - SetSZPF_Byte(appb); // doc. is unclear if this is true... - } - else - { - // right shift flags: - // carry = last bit shifted out - // overflow always cleared - tmp = appb & 0xff; - tmp >>= ((-count)-1); - _CY = (UINT8)(tmp & 0x1); - _OV = 0; - - appb >>= -count; - SetSZPF_Byte(appb); - } - } - -// mame_printf_debug("SHLB: %x _CY: %d _Z: %d _OV: %d _S: %d\n", appb, _CY, _Z, _OV, _S); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opSHLH(void) /* TRUSTED */ -{ - UINT16 apph; - INT8 count; - UINT32 tmp; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,1); - - F12LOADOP2HALF(); - - count=(INT8)(f12Op1&0xFF); -// mame_printf_debug("apph: %x count: %d ", apph, count); - if (count>0) - { - // left shift flags: - // carry gets the last bit shifted out, - // overflow is always CLEARed - - _OV = 0; - - // now handle carry - tmp = apph & 0xffff; - tmp <<= count; - SetCFW(tmp); // set carry properly - - // do the actual shift... - apph <<= count; - - // and set zero and sign - SetSZPF_Word(apph); - } - else - { - if (count == 0) - { - // special case: clear carry and overflow, do nothing else - _CY = _OV = 0; - SetSZPF_Word(apph); // doc. is unclear if this is true... - } - else - { - // right shift flags: - // carry = last bit shifted out - // overflow always cleared - tmp = apph & 0xffff; - tmp >>= ((-count)-1); - _CY = (UINT8)(tmp & 0x1); - _OV = 0; - - apph >>= -count; - SetSZPF_Word(apph); - } - } - -// mame_printf_debug("SHLH: %x _CY: %d _Z: %d _OV: %d _S: %d\n", apph, _CY, _Z, _OV, _S); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opSHLW(void) /* TRUSTED */ -{ - UINT32 appw; - INT8 count; - UINT64 tmp; - - F12DecodeOperands(ReadAM,0,ReadAMAddress,2); - - F12LOADOP2WORD(); - - count=(INT8)(f12Op1&0xFF); - if (count>0) - { - // left shift flags: - // carry gets the last bit shifted out, - // overflow is always CLEARed - - _OV = 0; - - // now handle carry - tmp = appw & 0xffffffff; - tmp <<= count; - SetCFL(tmp); // set carry properly - - // do the actual shift... - appw <<= count; - - // and set zero and sign - SetSZPF_Long(appw); - } - else - { - if (count == 0) - { - // special case: clear carry and overflow, do nothing else - _CY = _OV = 0; - SetSZPF_Long(appw); // doc. is unclear if this is true... - } - else - { - // right shift flags: - // carry = last bit shifted out - // overflow always cleared - tmp = (UINT64)(appw & 0xffffffff); - tmp >>= ((-count)-1); - _CY = (UINT8)(tmp & 0x1); - _OV = 0; - - appw >>= -count; - SetSZPF_Long(appw); - } - } - -// mame_printf_debug("SHLW: %x _CY: %d _Z: %d _OV: %d _S: %d\n", appw, _CY, _Z, _OV, _S); - - F12STOREOP2WORD(); - F12END(); -} - -static UINT32 opSTPR(void) -{ - F12DecodeFirstOperand(ReadAM,2); - if (f12Op1 <= 28) - modWriteValW = v60.reg[f12Op1 + 36]; - else - { - //fatalerror("Invalid operand on STPR PC=%x", PC); - } - F12WriteSecondOperand(2); - F12END(); -} - - -static UINT32 opSUBB(void) /* TRUSTED (C too!) */ -{ - UINT8 appb; - F12DecodeOperands(ReadAM,0,ReadAMAddress,0); - - F12LOADOP2BYTE(); - - SUBB(appb, (UINT8)f12Op1); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opSUBH(void) /* TRUSTED (C too!) */ -{ - UINT16 apph; - F12DecodeOperands(ReadAM,1,ReadAMAddress,1); - - F12LOADOP2HALF(); - - SUBW(apph, (UINT16)f12Op1); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opSUBW(void) /* TRUSTED (C too!) */ -{ - UINT32 appw; - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - SUBL(appw, (UINT32)f12Op1); - - F12STOREOP2WORD(); - F12END(); -} - - -static UINT32 opSUBCB(void) -{ - UINT8 appb; - UINT8 src; - F12DecodeOperands(ReadAM,0,ReadAMAddress,0); - - F12LOADOP2BYTE(); - - src = (UINT8)f12Op1 + (_CY?1:0); - SUBB(appb, src); - - F12STOREOP2BYTE(); - F12END(); -} - -static UINT32 opSUBCH(void) -{ - UINT16 apph; - UINT16 src; - - F12DecodeOperands(ReadAM,1,ReadAMAddress,1); - - F12LOADOP2HALF(); - - src = (UINT16)f12Op1 + (_CY?1:0); - SUBW(apph, src); - - F12STOREOP2HALF(); - F12END(); -} - -static UINT32 opSUBCW(void) -{ - UINT32 appw; - UINT32 src; - - F12DecodeOperands(ReadAM,2,ReadAMAddress,2); - - F12LOADOP2WORD(); - - src = (UINT32)f12Op1 + (_CY?1:0); - SUBL(appw, src); - - F12STOREOP2WORD(); - F12END(); -} - -static UINT32 opTEST1(void) -{ - F12DecodeOperands(ReadAM,2,ReadAM,2); - - _CY = ((f12Op2 & (1<> 32)&0xffffffff); - a = (INT32)(res&0xffffffff); - - _S = ((b & 0x80000000) != 0); - _Z = (a == 0 && b == 0); - - if (f12Flag2) - { - v60.reg[f12Op2&0x1F]=a; - v60.reg[(f12Op2&0x1F)+1]=b; - } - else - { - MemWrite32(f12Op2,a); - MemWrite32(f12Op2+4,b); - } - - F12END(); -} - -static UINT32 opMULUX(void) -{ - INT32 a,b; - UINT64 res; - - F12DecodeOperands(ReadAM,2,ReadAMAddress,3); - - if (f12Flag2) - { - a=v60.reg[f12Op2&0x1F]; - } - else - { - a=MemRead32(f12Op2); - } - - res = (UINT64)a * (UINT64)f12Op1; - b = (INT32)((res >> 32)&0xffffffff); - a = (INT32)(res&0xffffffff); - - _S = ((b & 0x80000000) != 0); - _Z = (a == 0 && b == 0); - - if (f12Flag2) - { - v60.reg[f12Op2&0x1F]=a; - v60.reg[(f12Op2&0x1F)+1]=b; - } - else - { - MemWrite32(f12Op2,a); - MemWrite32(f12Op2+4,b); - } - - F12END(); -} diff --git a/jan/src/cpu/v60/op2.c b/jan/src/cpu/v60/op2.c deleted file mode 100644 index 712ec16d2..000000000 --- a/jan/src/cpu/v60/op2.c +++ /dev/null @@ -1,359 +0,0 @@ - - -#define if2 if12 -#define f2Op1 f12Op1 -#define f2Op2 f12Op2 -#define f2Flag1 f12Flag1 -#define f2Flag2 f12Flag2 - -#define F2END() \ - return 2+amLength1+amLength2; - -#define F2LOADOPFLOAT(num) \ - if (f2Flag##num) \ - appf = u2f(v60.reg[f2Op##num]); \ - else \ - appf = u2f(MemRead32(f2Op##num)); - -#define F2STOREOPFLOAT(num) \ - if (f2Flag##num) \ - v60.reg[f2Op##num] = f2u(appf); \ - else \ - MemWrite32(f2Op##num, f2u(appf)); - -static void F2DecodeFirstOperand(UINT32 (*DecodeOp1)(void), UINT8 dim1) -{ - modDim = dim1; - modM = if2 & 0x40; - modAdd = PC + 2; - amLength1 = DecodeOp1(); - f2Op1 = amOut; - f2Flag1 = amFlag; -} - -static void F2DecodeSecondOperand(UINT32 (*DecodeOp2)(void), UINT8 dim2) -{ - modDim = dim2; - modM = if2 & 0x20; - modAdd = PC + 2 + amLength1; - amLength2 = DecodeOp2(); - f2Op2 = amOut; - f2Flag2 = amFlag; -} - -static void F2WriteSecondOperand(UINT8 dim2) -{ - modDim = dim2; - modM = if2 & 0x20; - modAdd = PC + 2 + amLength1; - amLength2 = WriteAM(); -} - -static UINT32 opCVTWS(void) -{ - float val; - - F2DecodeFirstOperand(ReadAM,2); - - // Convert to float - val = (float)(INT32)f2Op1; - modWriteValW = f2u(val); - - _OV=0; - _CY=(val < 0.0f); - _S=((modWriteValW & 0x80000000)!=0); - _Z=(val == 0.0f); - - F2WriteSecondOperand(2); - F2END(); -} - -static UINT32 opCVTSW(void) -{ - float val; - - F2DecodeFirstOperand(ReadAM,2); - - // Convert to UINT32 - val = u2f(f2Op1); - modWriteValW = (UINT32)val; - - _OV=0; - _CY=(val < 0.0f); - _S=((modWriteValW & 0x80000000)!=0); - _Z=(val == 0.0f); - - F2WriteSecondOperand(2); - F2END(); -} - -static UINT32 opMOVFS(void) -{ - F2DecodeFirstOperand(ReadAM,2); - modWriteValW = f2Op1; - F2WriteSecondOperand(2); - F2END(); -} - -static UINT32 opNEGFS(void) -{ - float appf; - - F2DecodeFirstOperand(ReadAM, 2); - F2DecodeSecondOperand(ReadAMAddress, 2); - - appf = -u2f(f2Op1); - - _OV=0; - _CY=(appf < 0.0f); - _S=((f2u(appf) & 0x80000000)!=0); - _Z=(appf == 0.0f); - - F2STOREOPFLOAT(2); - F2END() -} - -static UINT32 opABSFS(void) -{ - float appf; - - F2DecodeFirstOperand(ReadAM, 2); - F2DecodeSecondOperand(ReadAMAddress, 2); - - appf = u2f(f2Op1); - - if(appf < 0) - appf = -appf; - - _OV=0; - _CY=0; - _S=((f2u(appf) & 0x80000000)!=0); - _Z=(appf == 0.0f); - - F2STOREOPFLOAT(2); - F2END() -} - -static UINT32 opADDFS(void) -{ - UINT32 appw; - float appf; - - F2DecodeFirstOperand(ReadAM, 2); - F2DecodeSecondOperand(ReadAMAddress, 2); - - F2LOADOPFLOAT(2); - - appf += u2f(f2Op1); - - appw = f2u(appf); - _OV = _CY = 0; - _S = ((appw & 0x80000000)!=0); - _Z = (appw == 0); - - F2STOREOPFLOAT(2); - F2END() -} - -static UINT32 opSUBFS(void) -{ - UINT32 appw; - float appf; - - F2DecodeFirstOperand(ReadAM, 2); - F2DecodeSecondOperand(ReadAMAddress, 2); - - F2LOADOPFLOAT(2); - - appf -= u2f(f2Op1); - - appw = f2u(appf); - _OV = _CY = 0; - _S = ((appw & 0x80000000)!=0); - _Z = (appw == 0); - - F2STOREOPFLOAT(2); - F2END() -} - -static UINT32 opMULFS(void) -{ - UINT32 appw; - float appf; - - F2DecodeFirstOperand(ReadAM, 2); - F2DecodeSecondOperand(ReadAMAddress, 2); - - F2LOADOPFLOAT(2); - - appf *= u2f(f2Op1); - - appw = f2u(appf); - _OV = _CY = 0; - _S = ((appw & 0x80000000)!=0); - _Z = (appw == 0); - - F2STOREOPFLOAT(2); - F2END() -} - -static UINT32 opDIVFS(void) -{ - UINT32 appw; - float appf; - - F2DecodeFirstOperand(ReadAM, 2); - F2DecodeSecondOperand(ReadAMAddress, 2); - - F2LOADOPFLOAT(2); - - appf /= u2f(f2Op1); - - appw = f2u(appf); - _OV = _CY = 0; - _S = ((appw & 0x80000000)!=0); - _Z = (appw == 0); - - F2STOREOPFLOAT(2); - F2END() -} - -static UINT32 opSCLFS(void) -{ - UINT32 appw; - float appf; - - F2DecodeFirstOperand(ReadAM, 1); - F2DecodeSecondOperand(ReadAMAddress, 2); - - F2LOADOPFLOAT(2); - - if ((INT16)f2Op1 < 0) - appf /= 1 << -(INT16)f2Op1; - else - appf *= 1 << f2Op1; - - appw = f2u(appf); - _OV = _CY = 0; - _S = ((appw & 0x80000000)!=0); - _Z = (appw == 0); - - F2STOREOPFLOAT(2); - F2END() -} - -static UINT32 opCMPF(void) -{ - float appf; - - F2DecodeFirstOperand(ReadAM, 2); - F2DecodeSecondOperand(ReadAM, 2); - - appf = u2f(f2Op2) - u2f(f2Op1); - - _Z = (appf == 0); - _S = (appf < 0); - _OV = 0; - _CY = 0; - - F2END(); -} - -static UINT32 op5FUNHANDLED(void) -{ -// //fatalerror("Unhandled 5F opcode at %08x", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 op5CUNHANDLED(void) -{ -// //fatalerror("Unhandled 5C opcode at %08x", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 (*const Op5FTable[32])(void) = -{ - opCVTWS, - opCVTSW, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED, - op5FUNHANDLED -}; - -static UINT32 (*const Op5CTable[32])(void) = -{ - opCMPF, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - opMOVFS, - opNEGFS, - opABSFS, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - - opSCLFS, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - opADDFS, - opSUBFS, - opMULFS, - opDIVFS, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED, - op5CUNHANDLED -}; - - -static UINT32 op5F(void) -{ - if2 = OpRead8(PC + 1); - return Op5FTable[if2&0x1F](); -} - - -static UINT32 op5C(void) -{ - if2 = OpRead8(PC + 1); - return Op5CTable[if2&0x1F](); -} diff --git a/jan/src/cpu/v60/op3.c b/jan/src/cpu/v60/op3.c deleted file mode 100644 index a74d56aad..000000000 --- a/jan/src/cpu/v60/op3.c +++ /dev/null @@ -1,649 +0,0 @@ -static UINT32 opINCB(void) /* TRUSTED */ -{ - UINT8 appb; - modAdd=PC+1; - modDim=0; - - amLength1=ReadAMAddress(); - - if (amFlag) - appb=(UINT8)v60.reg[amOut]; - else - appb=MemRead8(amOut); - - ADDB(appb, 1); - - if (amFlag) - SETREG8(v60.reg[amOut], appb); - else - MemWrite8(amOut, appb); - - return amLength1+1; -} - -static UINT32 opINCH(void) /* TRUSTED */ -{ - UINT16 apph; - modAdd=PC+1; - modDim=1; - - amLength1=ReadAMAddress(); - - if (amFlag) - apph=(UINT16)v60.reg[amOut]; - else - apph=MemRead16(amOut); - - ADDW(apph, 1); - - if (amFlag) - SETREG16(v60.reg[amOut], apph); - else - MemWrite16(amOut, apph); - - return amLength1+1; -} - -static UINT32 opINCW(void) /* TRUSTED */ -{ - UINT32 appw; - modAdd=PC+1; - modDim=2; - - amLength1=ReadAMAddress(); - - if (amFlag) - appw=v60.reg[amOut]; - else - appw=MemRead32(amOut); - - ADDL(appw, 1); - - if (amFlag) - v60.reg[amOut]=appw; - else - MemWrite32(amOut,appw); - - return amLength1+1; -} - -static UINT32 opDECB(void) /* TRUSTED */ -{ - UINT8 appb; - modAdd=PC+1; - modDim=0; - - amLength1=ReadAMAddress(); - - if (amFlag) - appb=(UINT8)v60.reg[amOut]; - else - appb=MemRead8(amOut); - - SUBB(appb, 1); - - if (amFlag) - SETREG8(v60.reg[amOut], appb); - else - MemWrite8(amOut, appb); - - return amLength1+1; -} - -static UINT32 opDECH(void) /* TRUSTED */ -{ - UINT16 apph; - modAdd=PC+1; - modDim=1; - - amLength1=ReadAMAddress(); - - if (amFlag) - apph=(UINT16)v60.reg[amOut]; - else - apph=MemRead16(amOut); - - SUBW(apph, 1); - - if (amFlag) - SETREG16(v60.reg[amOut], apph); - else - MemWrite16(amOut, apph); - - return amLength1+1; -} - -static UINT32 opDECW(void) /* TRUSTED */ -{ - UINT32 appw; - modAdd=PC+1; - modDim=2; - - amLength1=ReadAMAddress(); - - if (amFlag) - appw=v60.reg[amOut]; - else - appw=MemRead32(amOut); - - SUBL(appw, 1); - - if (amFlag) - v60.reg[amOut]=appw; - else - MemWrite32(amOut,appw); - - return amLength1+1; -} - -static UINT32 opJMP(void) /* TRUSTED */ -{ - modAdd=PC+1; - modDim=0; - - // Read the address of the operand - ReadAMAddress(); - - // It cannot be a register!! - assert(amFlag==0); - - // Jump there - PC=amOut; - ChangePC(PC); - - return 0; -} - -static UINT32 opJSR(void) /* TRUSTED */ -{ - modAdd=PC + 1; - modDim=0; - - // Read the address of the operand - amLength1=ReadAMAddress(); - - // It cannot be a register!! - assert(amFlag==0); - - // Save NextPC into the stack - SP -= 4; - MemWrite32(SP, PC + amLength1 + 1); - - // Jump there - PC=amOut; - ChangePC(PC); - - return 0; -} - -static UINT32 opPREPARE(void) /* somewhat TRUSTED */ -{ - modAdd=PC+1; - modDim=2; - - // Read the operand - amLength1=ReadAM(); - - // step 1: save frame pointer on the stack - SP -= 4; - MemWrite32(SP, FP); - - // step 2: FP = new SP - FP = SP; - - // step 3: SP -= operand - SP -= amOut; - - return amLength1 + 1; -} - -static UINT32 opRET(void) /* TRUSTED */ -{ - modAdd=PC + 1; - modDim=2; - - // Read the operand - ReadAM(); - - // Read return address from stack - PC=MemRead32(SP); - SP+=4; - ChangePC(PC); - - // Restore AP from stack - AP=MemRead32(SP); - SP+=4; - - // Skip stack frame - SP += amOut; - - return 0; -} - -static UINT32 opTRAP(void) -{ - UINT32 oldPSW; - - modAdd=PC + 1; - modDim=0; - - // Read the operand - amLength1=ReadAM(); - - // Normalize the flags - NORMALIZEFLAGS(); - - switch ((amOut >> 4) & 0xF) - { - case 0: - if (!_OV) return amLength1+1; - else break; - case 1: - if (_OV) return amLength1+1; - else break; - case 2: - if (!_CY) return amLength1+1; - else break; - case 3: - if (_CY) return amLength1+1; - else break; - case 4: - if (!_Z) return amLength1+1; - else break; - case 5: - if (_Z) return amLength1+1; - else break; - case 6: - if (!(_CY | _Z)) return amLength1+1; - else break; - case 7: - if ((_CY | _Z)) return amLength1+1; - else break; - case 8: - if (!_S) return amLength1+1; - else break; - case 9: - if (_S) return amLength1+1; - else break; - case 10: - break; - case 11: - return amLength1+1; - case 12: - if (!(_S^_OV)) return amLength1+1; - else break; - case 13: - if ((_S^_OV)) return amLength1+1; - else break; - case 14: - if (!((_S^_OV)|_Z)) return amLength1+1; - else break; - case 15: - if (((_S^_OV)|_Z)) return amLength1+1; - else break; - } - - oldPSW = v60_update_psw_for_exception(0, 0); - - // Issue the software trap with interrupts - SP -= 4; - MemWrite32(SP, EXCEPTION_CODE_AND_SIZE(0x3000 + 0x100 * (amOut&0xF), 4)); - - SP -= 4; - MemWrite32(SP, oldPSW); - - SP -= 4; - MemWrite32(SP, PC + amLength1 + 1); - - PC = GETINTVECT(48 + (amOut&0xF)); - ChangePC(PC); - - return 0; -} - -static UINT32 opRETIU(void) /* TRUSTED */ -{ - UINT32 newPSW; - modAdd=PC + 1; - modDim=1; - - // Read the operand - ReadAM(); - - // Restore PC and PSW from stack - PC = MemRead32(SP); - SP += 4; - ChangePC(PC); - - newPSW = MemRead32(SP); - SP += 4; - - // Destroy stack frame - SP += amOut; - - v60WritePSW(newPSW); - - return 0; -} - -static UINT32 opRETIS(void) -{ - UINT32 newPSW; - - modAdd=PC + 1; - modDim=1; - - // Read the operand - ReadAM(); - - // Restore PC and PSW from stack - PC = MemRead32(SP); - SP += 4; - ChangePC(PC); - - newPSW = MemRead32(SP); - SP += 4; - - // Destroy stack frame - SP += amOut; - - v60WritePSW(newPSW); - - return 0; -} - -static UINT32 opSTTASK(void) -{ - int i; - UINT32 adr; - - modAdd=PC + 1; - modDim=2; - - amLength1 = ReadAM(); - - adr = TR; - - v60WritePSW(v60ReadPSW() | 0x10000000); - v60SaveStack(); - - MemWrite32(adr, TKCW); - adr += 4; - if(SYCW & 0x100) { - MemWrite32(adr, L0SP); - adr += 4; - } - if(SYCW & 0x200) { - MemWrite32(adr, L1SP); - adr += 4; - } - if(SYCW & 0x400) { - MemWrite32(adr, L2SP); - adr += 4; - } - if(SYCW & 0x800) { - MemWrite32(adr, L3SP); - adr += 4; - } - - // 31 registers supported, _not_ 32 - for(i=0; i<31; i++) - if(amOut & (1<> 4)) - { - // @@@ FPU exception - //fatalerror("Hit TRAPFL! PC=%x", PC); - } - - return 1; -} - - - - - - - diff --git a/jan/src/cpu/v60/op6.c b/jan/src/cpu/v60/op6.c deleted file mode 100644 index 64d98ae0e..000000000 --- a/jan/src/cpu/v60/op6.c +++ /dev/null @@ -1,254 +0,0 @@ - -/* - FULLY TRUSTED -*/ - -static UINT32 opTB(int reg) /* TRUSTED */ -{ - if (v60.reg[reg] == 0) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBGT(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - NORMALIZEFLAGS(); - if ((v60.reg[reg] != 0) && !((_S ^ _OV) | _Z)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBLE(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - NORMALIZEFLAGS(); - if ((v60.reg[reg] != 0) && ((_S ^ _OV) | _Z)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - - -static UINT32 opDBGE(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - NORMALIZEFLAGS(); - if ((v60.reg[reg] != 0) && !(_S ^ _OV)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBLT(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - NORMALIZEFLAGS(); - if ((v60.reg[reg] != 0) && (_S ^ _OV)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBH(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && !(_CY | _Z)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBNH(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && (_CY | _Z)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - - -static UINT32 opDBL(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && (_CY)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBNL(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && !(_CY)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBE(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && (_Z)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBNE(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && !(_Z)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBV(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && (_OV)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBNV(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && !(_OV)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBN(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && (_S)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBP(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if ((v60.reg[reg] != 0) && !(_S)) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 opDBR(int reg) /* TRUSTED */ -{ - v60.reg[reg]--; - - if (v60.reg[reg] != 0) - { - PC += (INT16)OpRead16(PC + 2); - return 0; - } - - return 4; -} - -static UINT32 (*const OpC6Table[8])(int reg) = /* TRUSTED */ -{ - opDBV, - opDBL, - opDBE, - opDBNH, - opDBN, - opDBR, - opDBLT, - opDBLE -}; - -static UINT32 (*const OpC7Table[8])(int reg) = /* TRUSTED */ -{ - opDBNV, - opDBNL, - opDBNE, - opDBH, - opDBP, - opTB, - opDBGE, - opDBGT -}; - - -static UINT32 opC6(void) /* TRUSTED */ -{ - UINT8 appb=OpRead8(PC + 1); - return OpC6Table[appb>>5](appb&0x1f); -} - -static UINT32 opC7(void) /* TRUSTED */ -{ - UINT8 appb=OpRead8(PC + 1); - return OpC7Table[appb>>5](appb&0x1f); -} - diff --git a/jan/src/cpu/v60/op7a.c b/jan/src/cpu/v60/op7a.c deleted file mode 100644 index b14d4fcd3..000000000 --- a/jan/src/cpu/v60/op7a.c +++ /dev/null @@ -1,1230 +0,0 @@ - -/* - * CMPC: What happens to _S flag if the strings are identical? - * I suppose that it will be cleared. And is it set or cleared - * when the first one is a substring of the second? I suppose - * cleared (since _S should be (src > dst)) - * MOVC: Why MOVCS does not exist in downward version? - * SHCHDB/SHCHDH: R27 is filled with the offset from the start or from the end? - * - * Strange stuff: - * SCHC opcodes does *not* modify _Z flag as stated in V60 manual: - * they do the opposite (set if not found, reset if found) - */ - -static UINT32 f7aOp1, f7aOp2; -static UINT8 f7aFlag1, f7aFlag2; -static UINT32 f7aLenOp1, f7aLenOp2; -static UINT8 subOp; - -static UINT32 f7bBamOffset1, f7bBamOffset2; - -#define f7bOp1 f7aOp1 -#define f7bFlag1 f7aFlag1 -#define f7bOp2 f7aOp2 -#define f7bFlag2 f7aFlag2 -#define f7bLen f7aLenOp1 - -#define f7cOp1 f7aOp1 -#define f7cOp2 f7aOp2 -#define f7cLen f7aLenOp1 -#define f7cFlag1 f7aFlag1 -#define f7cFlag2 f7aFlag2 - -#define F7AEND() \ - return amLength1 + amLength2 + 4; - -#define F7BEND() \ - return amLength1 + amLength2 + 3; - -#define F7CEND() \ - return amLength1 + amLength2 + 3; - -#define F7BCREATEBITMASK(x) \ - x=((1<<(x))-1) - -#define F7CCREATEBITMASK(x) \ - x=((1<<(x))-1) - -static void F7aDecodeOperands(UINT32 (*DecodeOp1)(void), UINT8 dim1, UINT32 (*DecodeOp2)(void), UINT8 dim2) -{ - UINT8 appb; - // Decode first operand - modDim=dim1; - modM=subOp&0x40; - modAdd=PC+2; - amLength1=DecodeOp1(); - f7aFlag1=amFlag; - f7aOp1=amOut; - - // Decode length - appb=OpRead8(PC+2+amLength1); - if (appb&0x80) - f7aLenOp1=v60.reg[appb&0x1F]; - else - f7aLenOp1=appb; - - // Decode second operand - modDim=dim2; - modM=subOp&0x20; - modAdd=PC+3+amLength1; - amLength2=DecodeOp2(); - f7aFlag2=amFlag; - f7aOp2=amOut; - - // Decode length - appb=OpRead8(PC+3+amLength1+amLength2); - if (appb&0x80) - f7aLenOp2=v60.reg[appb&0x1F]; - else - f7aLenOp2=appb; -} - -static void F7bDecodeFirstOperand(UINT32 (*DecodeOp1)(void), UINT8 dim1) -{ - UINT8 appb; - // Decode first operand - modDim=dim1; - modM=subOp&0x40; - modAdd=PC+2; - amLength1=DecodeOp1(); - f7bFlag1=amFlag; - f7bOp1=amOut; - - // Decode ext - appb=OpRead8(PC+2+amLength1); - if (appb&0x80) - f7bLen=v60.reg[appb&0x1F]; - else - f7bLen=appb; -} - - -static void F7bWriteSecondOperand(UINT8 dim2) -{ - modDim=dim2; - modM=subOp&0x20; - modAdd=PC+3+amLength1; - amLength2=WriteAM(); -} - - -static void F7bDecodeOperands(UINT32 (*DecodeOp1)(void), UINT8 dim1, UINT32 (*DecodeOp2)(void), UINT8 dim2) -{ - // Decode first operand - F7bDecodeFirstOperand(DecodeOp1,dim1); - f7bBamOffset1 = bamOffset; - - // Decode second operand - modDim=dim2; - modM=subOp&0x20; - modAdd=PC+3+amLength1; - amLength2=DecodeOp2(); - f7bFlag2=amFlag; - f7bOp2=amOut; - f7bBamOffset2 = bamOffset; -} - -static void F7cDecodeOperands(UINT32 (*DecodeOp1)(void), UINT8 dim1, UINT32 (*DecodeOp2)(void), UINT8 dim2) -{ - UINT8 appb; - // Decode first operand - modDim=dim1; - modM=subOp&0x40; - modAdd=PC+2; - amLength1=DecodeOp1(); - f7cFlag1=amFlag; - f7cOp1=amOut; - - // Decode second operand - modDim=dim2; - modM=subOp&0x20; - modAdd=PC+2+amLength1; - amLength2=DecodeOp2(); - f7cFlag2=amFlag; - f7cOp2=amOut; - - // Decode ext - appb=OpRead8(PC+2+amLength1+amLength2); - if (appb&0x80) - f7cLen=v60.reg[appb&0x1F]; - else - f7cLen=appb; -} - -#define F7CLOADOP1BYTE(appb) \ - if (f7cFlag1) \ - appb = (UINT8)(v60.reg[f7cOp1]&0xFF); \ - else \ - appb = MemRead8(f7cOp1); - -#define F7CLOADOP2BYTE(appb) \ - if (f7cFlag2) \ - appb = (UINT8)(v60.reg[f7cOp2]&0xFF); \ - else \ - appb = MemRead8(f7cOp2); - - -#define F7CSTOREOP2BYTE() \ - if (f7cFlag2) \ - SETREG8(v60.reg[f7cOp2], appb); \ - else \ - MemWrite8(f7cOp2, appb); - -#define F7CSTOREOP2HALF() \ - if (f7cFlag2) \ - SETREG16(v60.reg[f7cOp2], apph); \ - else \ - MemWrite16(f7cOp2, apph); - -static UINT32 opCMPSTRB(UINT8 bFill, UINT8 bStop) -{ - UINT32 i,dest; - UINT8 c1,c2; - - F7aDecodeOperands(ReadAMAddress,0,ReadAMAddress,0); - - // Filling - if (bFill) - { - if (f7aLenOp1 < f7aLenOp2) - { - for (i=f7aLenOp1;ic2) - { - _S=1; break; - } - else if (c2>c1) - { - _S=0; break; - } - - if (bStop) - if (c1==(UINT8)R26 || c2==(UINT8)R26) - { - _CY=0; - break; - } - } - - R28=f7aLenOp1+i; - R27=f7aLenOp2+i; - - if (i==dest) - { - if (f7aLenOp1 > f7aLenOp2) - _S=1; - else if (f7aLenOp2 > f7aLenOp1) - _S=0; - else - _Z=1; - } - - F7AEND(); -} - -static UINT32 opCMPSTRH(UINT8 bFill, UINT8 bStop) -{ - UINT32 i,dest; - UINT16 c1,c2; - - F7aDecodeOperands(ReadAMAddress,0,ReadAMAddress,0); - - // Filling - if (bFill) - { - if (f7aLenOp1 < f7aLenOp2) - { - for (i=f7aLenOp1;ic2) - { - _S=1; break; - } - else if (c2>c1) - { - _S=0; break; - } - - if (bStop) - if (c1==(UINT16)R26 || c2==(UINT16)R26) - { - _CY=0; - break; - } - } - - R28=f7aLenOp1+i*2; - R27=f7aLenOp2+i*2; - - if (i==dest) - { - if (f7aLenOp1 > f7aLenOp2) - _S=1; - else if (f7aLenOp2 > f7aLenOp1) - _S=0; - else - _Z=1; - } - - F7AEND(); -} - - - -static UINT32 opMOVSTRUB(UINT8 bFill, UINT8 bStop) /* TRUSTED (0,0) (1,0) */ -{ - UINT32 i,dest; - UINT8 c1; - -// if (bStop) -// { -// int a=1; -// } - - F7aDecodeOperands(ReadAMAddress,0,ReadAMAddress,0); - - dest=(f7aLenOp1 < f7aLenOp2 ? f7aLenOp1 : f7aLenOp2); - - for (i=0;i=0;i--) - { - appb = (MemRead8(f7bOp1+i)==(UINT8)f7bOp2); - if ((bSearch && appb) || (!bSearch && !appb)) - break; - } - - R28=f7bOp1+i; - R27=i; - - // This is the opposite as stated in V60 manual... - if ((UINT32)i!=f7bLen) - _Z=0; - else - _Z=1; - - F7BEND(); -} - -static UINT32 opSEARCHDH(UINT8 bSearch) -{ - UINT8 appb; - INT32 i; - - F7bDecodeOperands(ReadAMAddress,1,ReadAM,1); - - for (i=f7bLen-1;i>=0;i--) - { - appb = (MemRead16(f7bOp1+i*2)==(UINT16)f7bOp2); - if ((bSearch && appb) || (!bSearch && !appb)) - break; - } - - R28=f7bOp1+i*2; - R27=i; - - if ((UINT32)i!=f7bLen) - _Z=0; - else - _Z=1; - - F7BEND(); -} - - -static UINT32 opSCHCUB(void) { return opSEARCHUB(1); } -static UINT32 opSCHCUH(void) { return opSEARCHUH(1); } -static UINT32 opSCHCDB(void) { return opSEARCHDB(1); } -static UINT32 opSCHCDH(void) { return opSEARCHDH(1); } -static UINT32 opSKPCUB(void) { return opSEARCHUB(0); } -static UINT32 opSKPCUH(void) { return opSEARCHUH(0); } -static UINT32 opSKPCDB(void) { return opSEARCHDB(0); } -static UINT32 opSKPCDH(void) { return opSEARCHDH(0); } - -static UINT32 opCMPCB(void) { return opCMPSTRB(0,0); } -static UINT32 opCMPCH(void) { return opCMPSTRH(0,0); } -static UINT32 opCMPCFB(void) { return opCMPSTRB(1,0); } -static UINT32 opCMPCFH(void) { return opCMPSTRH(1,0); } -static UINT32 opCMPCSB(void) { return opCMPSTRB(0,1); } -static UINT32 opCMPCSH(void) { return opCMPSTRH(0,1); } - -static UINT32 opMOVCUB(void) { return opMOVSTRUB(0,0); } -static UINT32 opMOVCUH(void) { return opMOVSTRUH(0,0); } -static UINT32 opMOVCFUB(void) { return opMOVSTRUB(1,0); } -static UINT32 opMOVCFUH(void) { return opMOVSTRUH(1,0); } -static UINT32 opMOVCSUB(void) { return opMOVSTRUB(0,1); } -static UINT32 opMOVCSUH(void) { return opMOVSTRUH(0,1); } - -static UINT32 opMOVCDB(void) { return opMOVSTRDB(0,0); } -static UINT32 opMOVCDH(void) { return opMOVSTRDH(0,0); } -static UINT32 opMOVCFDB(void) { return opMOVSTRDB(1,0); } -static UINT32 opMOVCFDH(void) { return opMOVSTRDH(1,0); } - -static UINT32 opEXTBFZ(void) /* TRUSTED */ -{ - F7bDecodeFirstOperand(BitReadAM, 11); - - F7BCREATEBITMASK(f7bLen); - - modWriteValW=(f7bOp1 >> bamOffset) & f7bLen; - - F7bWriteSecondOperand(2); - - F7BEND(); -} - -static UINT32 opEXTBFS(void) /* TRUSTED */ -{ - F7bDecodeFirstOperand(BitReadAM, 11); - - F7BCREATEBITMASK(f7bLen); - - modWriteValW=(f7bOp1 >> bamOffset) & f7bLen; - if (modWriteValW & ((f7bLen+1)>>1)) - modWriteValW |= ~f7bLen; - - F7bWriteSecondOperand(2); - - F7BEND(); -} - -static UINT32 opEXTBFL(void) -{ - UINT32 appw; - - F7bDecodeFirstOperand(BitReadAM, 11); - - appw=f7bLen; - F7BCREATEBITMASK(f7bLen); - - modWriteValW=(f7bOp1 >> bamOffset) & f7bLen; - modWriteValW<<=32-appw; - - F7bWriteSecondOperand(2); - - F7BEND(); -} - -static UINT32 opSCHBS(UINT32 bSearch1) -{ - UINT32 i,data; - UINT32 offset; - - F7bDecodeFirstOperand(BitReadAMAddress,10); - - // Read first UINT8 - f7bOp1 += bamOffset/8; - data = MemRead8(f7bOp1); - offset = bamOffset&7; - - // Scan bitstring - for (i=0;i>= (32-f7cLen); - - F7CCREATEBITMASK(f7cLen); - - f7cOp2 += bamOffset/8; - appw = MemRead32(f7cOp2); - bamOffset &= 7; - - appw &= ~(f7cLen << bamOffset); - appw |= (f7cLen & f7cOp1) << bamOffset; - - MemWrite32(f7cOp2, appw); - - F7CEND(); -} - -static UINT32 opMOVBSD(void) -{ - UINT32 i; - UINT8 srcdata, dstdata; - - F7bDecodeOperands(BitReadAMAddress,10,BitReadAMAddress,10); - -// if (f7bLen!=1) -// { int a=1; } - - f7bBamOffset1 += f7bLen-1; - f7bBamOffset2 += f7bLen-1; - - f7bOp1 += f7bBamOffset1/8; - f7bOp2 += f7bBamOffset2/8; - - f7bBamOffset1 &= 7; - f7bBamOffset2 &= 7; - - srcdata = MemRead8(f7bOp1); - dstdata = MemRead8(f7bOp2); - - for (i=0;i> f7bBamOffset1) & 1) << f7bBamOffset2; - - if (f7bBamOffset1 == 0) - { - f7bBamOffset1 = 8; - f7bOp1--; - srcdata = MemRead8(f7bOp1); - } - if (f7bBamOffset2 == 0) - { - MemWrite8(f7bOp2, dstdata); - f7bBamOffset2 = 8; - f7bOp2--; - dstdata = MemRead8(f7bOp2); - } - - f7bBamOffset1--; - f7bBamOffset2--; - } - - // Flush of the final data - if (f7bBamOffset2 != 7) - MemWrite8(f7bOp2, dstdata); - - F7BEND(); -} - -static UINT32 opMOVBSU(void) -{ - UINT32 i; - UINT8 srcdata, dstdata; - - F7bDecodeOperands(BitReadAMAddress,10,BitReadAMAddress,10); - - f7bOp1 += f7bBamOffset1/8; - f7bOp2 += f7bBamOffset2/8; - - f7bBamOffset1 &= 7; - f7bBamOffset2 &= 7; - - srcdata = MemRead8(f7bOp1); - dstdata = MemRead8(f7bOp2); - - for (i=0;i> f7bBamOffset1) & 1) << f7bBamOffset2; - - f7bBamOffset1++; - f7bBamOffset2++; - if (f7bBamOffset1 == 8) - { - f7bBamOffset1 = 0; - f7bOp1++; - srcdata = MemRead8(f7bOp1); - } - if (f7bBamOffset2 == 8) - { - MemWrite8(f7bOp2, dstdata); - f7bBamOffset2 = 0; - f7bOp2++; - dstdata = MemRead8(f7bOp2); - } - } - - // Flush of the final data - if (f7bBamOffset2 != 0) - MemWrite8(f7bOp2, dstdata); - - F7BEND(); -} - -// RADM 0x20f4b8 holds the time left - -static UINT32 opADDDC(void) -{ - UINT8 appb; - UINT8 src, dst; - - F7cDecodeOperands(ReadAM, 0, ReadAMAddress, 0); - - if (f7cLen != 0) - { - // logerror("ADDDC %x (pat: %x)\n", f7cOp1, f7cLen); - } - - F7CLOADOP2BYTE(appb); - - src = (UINT8)(f7cOp1 >> 4) * 10 + (UINT8)(f7cOp1 & 0xF); - dst = (appb >> 4) * 10 + (appb & 0xF); - - appb = src + dst + (_CY?1:0); - - if (appb >= 100) - { - appb -= 100; - _CY = 1; - } - else - _CY = 0; - - // compute z flag: - // cleared if result non-zero or carry generated - // unchanged otherwise - if (appb != 0 || _CY) - _Z = 0; - - appb = ((appb/10)<<4) | (appb % 10); - - F7CSTOREOP2BYTE(); - F7CEND(); -} - -static UINT32 opSUBDC(void) -{ - INT8 appb; - UINT32 src, dst; - - F7cDecodeOperands(ReadAM, 0, ReadAMAddress, 0); - - if (f7cLen != 0) - { - // logerror("SUBDC %x (pat: %x)\n", f7cOp1, f7cLen); - } - - F7CLOADOP2BYTE(appb); - - src = (UINT32)(f7cOp1 >> 4) * 10 + (UINT32)(f7cOp1 & 0xF); - dst = ((appb & 0xF0) >> 4) * 10 + (appb & 0xF); - - // Note that this APPB must be SIGNED! - appb = (INT32)dst - (INT32)src - (_CY?1:0); - - if (appb < 0) - { - appb += 100; - _CY = 1; - } - else - _CY = 0; - - // compute z flag: - // cleared if result non-zero or carry generated - // unchanged otherwise - if (appb != 0 || _CY) - _Z = 0; - - appb = ((appb/10)<<4) | (appb % 10); - - F7CSTOREOP2BYTE(); - F7CEND(); -} - -static UINT32 opSUBRDC(void) -{ - INT8 appb; - UINT32 src, dst; - - F7cDecodeOperands(ReadAM, 0, ReadAMAddress, 0); - - if (f7cLen != 0) - { - // logerror("SUBRDC %x (pat: %x)\n", f7cOp1, f7cLen); - } - - F7CLOADOP2BYTE(appb); - - src = (UINT32)(f7cOp1 >> 4) * 10 + (UINT32)(f7cOp1 & 0xF); - dst = ((appb & 0xF0) >> 4) * 10 + (appb & 0xF); - - // Note that this APPB must be SIGNED! - appb = (INT32)src - (INT32)dst - (_CY?1:0); - - if (appb < 0) - { - appb += 100; - _CY = 1; - } - else - _CY = 0; - - // compute z flag: - // cleared if result non-zero or carry generated - // unchanged otherwise - if (appb != 0 || _CY) - _Z = 0; - - appb = ((appb/10)<<4) | (appb % 10); - - F7CSTOREOP2BYTE(); - F7CEND(); -} - -static UINT32 opCVTDPZ(void) -{ - UINT16 apph; - - F7cDecodeOperands(ReadAM, 0, ReadAMAddress, 1); - - apph = (UINT16)(((f7cOp1 >> 4) & 0xF) | ((f7cOp1 & 0xF) << 8)); - apph |= (f7cLen); - apph |= (f7cLen<<8); - - // Z flag is unchanged if src is zero, cleared otherwise - if (f7cOp1 != 0) _Z = 0; - - F7CSTOREOP2HALF(); - F7CEND(); -} - -static UINT32 opCVTDZP(void) -{ - UINT8 appb; - F7cDecodeOperands(ReadAM, 1, ReadAMAddress, 0); - - if ((f7cOp1 & 0xF0) != (f7cLen & 0xF0) || ((f7cOp1 >> 8) & 0xF0) != (f7cLen & 0xF0)) - { - // Decimal exception - // logerror("CVTD.ZP Decimal exception #1!\n"); - } - - if ((f7cOp1 & 0xF) > 9 || ((f7cOp1 >> 8) & 0xF) > 9) - { - // Decimal exception - // logerror("CVTD.ZP Decimal exception #2!\n"); - } - - appb = (UINT8)(((f7cOp1 >> 8) & 0xF) | ((f7cOp1 & 0xF) << 4)); - if (appb != 0) _Z = 0; - - F7CSTOREOP2BYTE(); - F7CEND(); -} - -static UINT32 op58UNHANDLED(void) -{ - //fatalerror("Unhandled 58 opcode at PC: /%06x", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 op5AUNHANDLED(void) -{ - //fatalerror("Unhandled 5A opcode at PC: /%06x", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 op5BUNHANDLED(void) -{ - //fatalerror("Unhandled 5B opcode at PC: /%06x", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 op5DUNHANDLED(void) -{ - //fatalerror("Unhandled 5D opcode at PC: /%06x", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 op59UNHANDLED(void) -{ - //fatalerror("Unhandled 59 opcode at PC: /%06x", PC); - return 0; /* never reached, fatalerror won't return */ -} - -static UINT32 (*const Op59Table[32])(void) = -{ - opADDDC, - opSUBDC, - opSUBRDC, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - opCVTDPZ, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - opCVTDZP, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED, - op59UNHANDLED -}; - - -static UINT32 (*const Op5BTable[32])(void) = -{ - opSCH0BSU, - op5BUNHANDLED, - opSCH1BSU, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - opMOVBSU, - opMOVBSD, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED, - op5BUNHANDLED -}; - - -static UINT32 (*const Op5DTable[32])(void) = -{ - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - opEXTBFS, - opEXTBFZ, - opEXTBFL, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - opINSBFR, - opINSBFL, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED, - op5DUNHANDLED -}; - -static UINT32 (*const Op58Table[32])(void) = -{ - opCMPCB, - opCMPCFB, - opCMPCSB, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - opMOVCUB, - opMOVCDB, - opMOVCFUB, - opMOVCFDB, - opMOVCSUB, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - opSCHCUB, - opSCHCDB, - opSKPCUB, - opSKPCDB, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED, - op58UNHANDLED -}; - -static UINT32 (*const Op5ATable[32])(void) = -{ - opCMPCH, - opCMPCFH, - opCMPCSH, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - opMOVCUH, - opMOVCDH, - opMOVCFUH, - opMOVCFDH, - opMOVCSUH, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - opSCHCUH, - opSCHCDH, - opSKPCUH, - opSKPCDH, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED, - op5AUNHANDLED -}; - -static UINT32 op58(void) -{ - subOp = OpRead8(PC + 1); - - return Op58Table[subOp&0x1F](); -} - -static UINT32 op5A(void) -{ - subOp = OpRead8(PC + 1); - - return Op5ATable[subOp&0x1F](); -} - -static UINT32 op5B(void) -{ - subOp = OpRead8(PC + 1); - - return Op5BTable[subOp&0x1F](); -} - -static UINT32 op5D(void) -{ - subOp = OpRead8(PC + 1); - - return Op5DTable[subOp&0x1F](); -} - -static UINT32 op59(void) -{ - subOp = OpRead8(PC + 1); - - return Op59Table[subOp&0x1F](); -} diff --git a/jan/src/cpu/v60/optable.c b/jan/src/cpu/v60/optable.c deleted file mode 100644 index a9347fcd4..000000000 --- a/jan/src/cpu/v60/optable.c +++ /dev/null @@ -1,259 +0,0 @@ -static UINT32 (*const OpCodeTable[256])(void) = -{ - /* 0x00 */ opHALT, - /* 0x01 */ opLDTASK, - /* 0x02 */ opSTPR, - /* 0x03 */ opUNHANDLED, - /* 0x04 */ opUNHANDLED, - /* 0x05 */ opUNHANDLED, - /* 0x06 */ opUNHANDLED, - /* 0x07 */ opUNHANDLED, - /* 0x08 */ opRVBIT, - /* 0x09 */ opMOVB, - /* 0x0a */ opMOVSBH, - /* 0x0b */ opMOVZBH, - /* 0x0c */ opMOVSBW, - /* 0x0d */ opMOVZBW, - /* 0x0e */ opUNHANDLED, - /* 0x0f */ opUNHANDLED, - /* 0x10 */ opCLRTLBA, - /* 0x11 */ opUNHANDLED, - /* 0x12 */ opLDPR, - /* 0x13 */ opUPDPSWW, - /* 0x14 */ opUNHANDLED, - /* 0x15 */ opUNHANDLED, - /* 0x16 */ opUNHANDLED, - /* 0x17 */ opUNHANDLED, - /* 0x18 */ opUNHANDLED, - /* 0x19 */ opMOVTHB, - /* 0x1a */ opUNHANDLED, - /* 0x1b */ opMOVH, - /* 0x1c */ opMOVSHW, - /* 0x1d */ opMOVZHW, - /* 0x1e */ opUNHANDLED, - /* 0x1f */ opUNHANDLED, - /* 0x20 */ opINB, - /* 0x21 */ opOUTB, - /* 0x22 */ opINH, - /* 0x23 */ opOUTH, - /* 0x24 */ opINW, - /* 0x25 */ opOUTW, - /* 0x26 */ opUNHANDLED, - /* 0x27 */ opUNHANDLED, - /* 0x28 */ opUNHANDLED, - /* 0x29 */ opMOVTWB, - /* 0x2a */ opUNHANDLED, - /* 0x2b */ opMOVTWH, - /* 0x2c */ opRVBYT, - /* 0x2d */ opMOVW, - /* 0x2e */ opUNHANDLED, - /* 0x2f */ opUNHANDLED, - /* 0x30 */ opUNHANDLED, - /* 0x31 */ opUNHANDLED, - /* 0x32 */ opUNHANDLED, - /* 0x33 */ opUNHANDLED, - /* 0x34 */ opUNHANDLED, - /* 0x35 */ opUNHANDLED, - /* 0x36 */ opUNHANDLED, - /* 0x37 */ opUNHANDLED, - /* 0x38 */ opNOTB, - /* 0x39 */ opNEGB, - /* 0x3a */ opNOTH, - /* 0x3b */ opNEGH, - /* 0x3c */ opNOTW, - /* 0x3d */ opNEGW, - /* 0x3e */ opUNHANDLED, - /* 0x3f */ opMOVD, - /* 0x40 */ opMOVEAB, - /* 0x41 */ opXCHB, - /* 0x42 */ opMOVEAH, - /* 0x43 */ opXCHH, - /* 0x44 */ opMOVEAW, - /* 0x45 */ opXCHW, - /* 0x46 */ opUNHANDLED, - /* 0x47 */ opSETF, - /* 0x48 */ opBSR, - /* 0x49 */ opCALL, - /* 0x4a */ opUPDPSWH, - /* 0x4b */ opCHLVL, - /* 0x4c */ opUNHANDLED, - /* 0x4d */ opCHKAR, - /* 0x4e */ opCHKAW, - /* 0x4f */ opCHKAE, - /* 0x50 */ opREMB, - /* 0x51 */ opREMUB, - /* 0x52 */ opREMH, - /* 0x53 */ opREMUH, - /* 0x54 */ opREMW, - /* 0x55 */ opREMUW, - /* 0x56 */ opUNHANDLED, - /* 0x57 */ opUNHANDLED, - /* 0x58 */ op58, - /* 0x59 */ op59, - /* 0x5a */ op5A, - /* 0x5b */ op5B, - /* 0x5c */ op5C, - /* 0x5d */ op5D, - /* 0x5e */ opUNHANDLED, - /* 0x5f */ op5F, - /* 0x60 */ opBV8, - /* 0x61 */ opBNV8, - /* 0x62 */ opBL8, - /* 0x63 */ opBNL8, - /* 0x64 */ opBE8, - /* 0x65 */ opBNE8, - /* 0x66 */ opBNH8, - /* 0x67 */ opBH8, - /* 0x68 */ opBN8, - /* 0x69 */ opBP8, - /* 0x6a */ opBR8, - /* 0x6b */ opUNHANDLED, - /* 0x6C */ opBLT8, - /* 0x6c */ opBGE8, - /* 0x6e */ opBLE8, - /* 0x6f */ opBGT8, - /* 0x70 */ opBV16, - /* 0x71 */ opBNV16, - /* 0x72 */ opBL16, - /* 0x73 */ opBNL16, - /* 0x74 */ opBE16, - /* 0x75 */ opBNE16, - /* 0x76 */ opBNH16, - /* 0x77 */ opBH16, - /* 0x78 */ opBN16, - /* 0x79 */ opBP16, - /* 0x7a */ opBR16, - /* 0x7b */ opUNHANDLED, - /* 0x7c */ opBLT16, - /* 0x7d */ opBGE16, - /* 0x7e */ opBLE16, - /* 0x7f */ opBGT16, - /* 0x80 */ opADDB, - /* 0x81 */ opMULB, - /* 0x82 */ opADDH, - /* 0x83 */ opMULH, - /* 0x84 */ opADDW, - /* 0x85 */ opMULW, - /* 0x86 */ opMULX, - /* 0x87 */ opTEST1, - /* 0x88 */ opORB, - /* 0x89 */ opROTB, - /* 0x8a */ opORH, - /* 0x8b */ opROTH, - /* 0x8c */ opORW, - /* 0x8d */ opROTW, - /* 0x8e */ opUNHANDLED, - /* 0x8f */ opUNHANDLED, - /* 0x90 */ opADDCB, - /* 0x91 */ opMULUB, - /* 0x92 */ opADDCH, - /* 0x93 */ opMULUH, - /* 0x94 */ opADDCW, - /* 0x95 */ opMULUW, - /* 0x96 */ opMULUX, - /* 0x97 */ opSET1, - /* 0x98 */ opSUBCB, - /* 0x99 */ opROTCB, - /* 0x9a */ opSUBCH, - /* 0x9b */ opROTCH, - /* 0x9c */ opSUBCW, - /* 0x9d */ opROTCW, - /* 0x9e */ opUNHANDLED, - /* 0x9f */ opUNHANDLED, - /* 0xa0 */ opANDB, - /* 0xa1 */ opDIVB, - /* 0xa2 */ opANDH, - /* 0xa3 */ opDIVH, - /* 0xa4 */ opANDW, - /* 0xa5 */ opDIVW, - /* 0xa6 */ opDIVX, - /* 0xa7 */ opCLR1, - /* 0xa8 */ opSUBB, - /* 0xa9 */ opSHLB, - /* 0xaa */ opSUBH, - /* 0xab */ opSHLH, - /* 0xac */ opSUBW, - /* 0xad */ opSHLW, - /* 0xae */ opUNHANDLED, - /* 0xaf */ opUNHANDLED, - /* 0xb0 */ opXORB, - /* 0xb1 */ opDIVUB, - /* 0xb2 */ opXORH, - /* 0xb3 */ opDIVUH, - /* 0xb4 */ opXORW, - /* 0xb5 */ opDIVUW, - /* 0xb6 */ opDIVUX, - /* 0xb7 */ opNOT1, - /* 0xb8 */ opCMPB, - /* 0xb9 */ opSHAB, - /* 0xba */ opCMPH, - /* 0xbb */ opSHAH, - /* 0xbc */ opCMPW, - /* 0xbd */ opSHAW, - /* 0xbe */ opUNHANDLED, - /* 0xbf */ opUNHANDLED, - /* 0xc0 */ opUNHANDLED, - /* 0xc1 */ opUNHANDLED, - /* 0xc2 */ opUNHANDLED, - /* 0xc3 */ opUNHANDLED, - /* 0xc4 */ opUNHANDLED, - /* 0xc5 */ opUNHANDLED, - /* 0xc6 */ opC6, - /* 0xc7 */ opC7, - /* 0xc8 */ opBRK, - /* 0xc9 */ opBRKV, - /* 0xca */ opRSR, - /* 0xcb */ opTRAPFL, - /* 0xcc */ opDISPOSE, - /* 0xcd */ opNOP, - /* 0xce */ opUNHANDLED, - /* 0xcf */ opUNHANDLED, - /* 0xd0 */ opDECB_0, - /* 0xd1 */ opDECB_1, - /* 0xd2 */ opDECH_0, - /* 0xd3 */ opDECH_1, - /* 0xd4 */ opDECW_0, - /* 0xd5 */ opDECW_1, - /* 0xd6 */ opJMP_0, - /* 0xd7 */ opJMP_1, - /* 0xd8 */ opINCB_0, - /* 0xd9 */ opINCB_1, - /* 0xda */ opINCH_0, - /* 0xdb */ opINCH_1, - /* 0xdc */ opINCW_0, - /* 0xdd */ opINCW_1, - /* 0xde */ opPREPARE_0, - /* 0xdf */ opPREPARE_1, - /* 0xe0 */ opTASI_0, - /* 0xe1 */ opTASI_1, - /* 0xe2 */ opRET_0, - /* 0xe3 */ opRET_1, - /* 0xe4 */ opPOPM_0, - /* 0xe5 */ opPOPM_1, - /* 0xe6 */ opPOP_0, - /* 0xe7 */ opPOP_1, - /* 0xe8 */ opJSR_0, - /* 0xe9 */ opJSR_1, - /* 0xea */ opRETIU_0, - /* 0xeb */ opRETIU_1, - /* 0xec */ opPUSHM_0, - /* 0xed */ opPUSHM_1, - /* 0xee */ opPUSH_0, - /* 0xef */ opPUSH_1, - /* 0xf0 */ opTESTB_0, - /* 0xf1 */ opTESTB_1, - /* 0xf2 */ opTESTH_0, - /* 0xf3 */ opTESTH_1, - /* 0xf4 */ opTESTW_0, - /* 0xf5 */ opTESTW_1, - /* 0xf6 */ opGETPSW_0, - /* 0xf7 */ opGETPSW_1, - /* 0xf8 */ opTRAP_0, - /* 0xf9 */ opTRAP_1, - /* 0xfa */ opRETIS_0, - /* 0xfb */ opRETIS_1, - /* 0xfc */ opSTTASK_0, - /* 0xfd */ opSTTASK_1, - /* 0xfe */ opUNHANDLED, - /* 0xff */ opUNHANDLED, -}; diff --git a/jan/src/cpu/v60/v60.cpp b/jan/src/cpu/v60/v60.cpp deleted file mode 100644 index ee35e2c35..000000000 --- a/jan/src/cpu/v60/v60.cpp +++ /dev/null @@ -1,1302 +0,0 @@ -// V60.C -// Undiscover the beast! -// Main hacking and coding by Farfetch'd -// Portability fixes by Richter Belmont - -#include "burnint.h" -#include "bitswap.h" // ...xor_le -#include "driver.h" -#include "v60_intf.h" - -#define offs_t UINT32 -#define INPUT_LINE_NMI CPU_IRQLINE_NMI - -#define change_pc(x) v60.reg[32] = (x) - -// convert a series of 32 bits into a float -inline float u2f(UINT32 v) -{ - union { - float ff; - UINT32 vv; - } u; - u.vv = v; - return u.ff; -} - - -// convert a float into a series of 32 bits -inline UINT32 f2u(float f) -{ - union { - float ff; - UINT32 vv; - } u; - u.ff = f; - return u.vv; -} - - -//#define LOG_MEM - -#define address_range 0x1000000 -#define address_mask 0xffffff -#define page_size 0x800 -#define page_mask 0x7ff - -static UINT8 *mem[3][(address_mask + 1) / page_size]; - -static UINT8 (*v60_read8)(UINT32) = NULL; -static UINT16 (*v60_read16)(UINT32) = NULL; -static UINT32 (*v60_read32)(UINT32) = NULL; -static void (*v60_write8)(UINT32,UINT8) = NULL; -static void (*v60_write16)(UINT32,UINT16) = NULL; -static void (*v60_write32)(UINT32,UINT32) = NULL; - -static UINT8 (*v60_ioread8)(UINT32) = NULL; -static UINT16 (*v60_ioread16)(UINT32) = NULL; -static UINT32 (*v60_ioread32)(UINT32) = NULL; -static void (*v60_iowrite8)(UINT32,UINT8) = NULL; -static void (*v60_iowrite16)(UINT32,UINT16) = NULL; -static void (*v60_iowrite32)(UINT32,UINT32) = NULL; - - -void v60SetWriteByteHandler(void (*write)(UINT32,UINT8)) -{ - v60_write8 = write; -} - -void v60SetWriteWordHandler(void (*write)(UINT32,UINT16)) -{ - v60_write16 = write; -} - -void v60SetReadByteHandler(UINT8 (*read)(UINT32)) -{ - v60_read8 = read; -} - -void v60SetReadWordHandler(UINT16 (*read)(UINT32)) -{ - v60_read16 = read; -} - - -void v60MapMemory(UINT8 *ptr, UINT32 start, UINT32 end, UINT32 flags) -{ - // error check here! - - for (UINT32 i = start; i < end; i+= page_size) - { - if (flags & 1) mem[0][i/page_size] = ptr + (i - start); - if (flags & 2) mem[1][i/page_size] = ptr + (i - start); - if (flags & 4) mem[2][i/page_size] = ptr + (i - start); - } -} - -static UINT8 cpu_readop(UINT32 a) -{ - a &= address_mask; - - if (mem[2][a / page_size]) { -#ifdef LOG_MEM -// bprintf (0, _T("OP8: %6.6x %2.2x\n"), a, mem[2][a / page_size][a & page_mask]); -#endif - return mem[2][a / page_size][a & page_mask]; - } - - if (v60_read8) { -#ifdef LOG_MEM - bprintf (0, _T("OP8: %6.6x %2.2x\n"), a, v60_read8(a)); -#endif - return v60_read8(a); - } - - return 0; -} - -static UINT16 cpu_readop16(UINT32 a) -{ - a &= address_mask; - - UINT8 *p = mem[2][a / page_size]; - - if (p) { - UINT16 *z = (UINT16*)(p + (a & page_mask)); -#ifdef LOG_MEM -// bprintf (0, _T("OP16: %6.6x %4.4x\n"), a, *z); -#endif - return *z; - } - - if (v60_read16) { -#ifdef LOG_MEM - bprintf (0, _T("OP16: %6.6x %4.4x\n"), a, v60_read16(a)); -#endif - - return v60_read16(a); - } - - return 0; -} - -static UINT32 cpu_readop32(UINT32 a) -{ - a &= address_mask; - - UINT8 *p = mem[2][a / page_size]; - - if (p) { - UINT32 *z = (UINT32*)(p + (a & page_mask)); - -#ifdef LOG_MEM -// bprintf (0, _T("OP32: %6.6x %8.8x\n"), a, *z); -#endif - - return *z; - } - - if (v60_read32) { -#ifdef LOG_MEM - bprintf (0, _T("OP32: %6.6x %8.8x\n"), a, v60_read32(a)); -#endif - - return v60_read32(a); - } - - return 0; -} - -static UINT16 program_read_word_16le(UINT32 a) -{ - a &= address_mask; - - UINT8 *p = mem[0][a / page_size]; - - if (p) { - UINT16 *z = (UINT16*)(p + (a & page_mask)); -#ifdef LOG_MEM - bprintf (0, _T("PRW: %6.6x %4.4x\n"), a, *z); -#endif - - return *z; - } - - if (v60_read16) { -#ifdef LOG_MEM - bprintf (0, _T("PRW: %6.6x %4.4x\n"), a, v60_read16(a)); -#endif - return v60_read16(a); - } - - return 0; -} - -static UINT8 program_read_byte_16le(UINT32 a) -{ - a &= address_mask; - -#ifdef LOG_MEM - bprintf (0, _T("PRB: %6.6x\n"), a); -#endif - - if (mem[0][a / page_size]) { - return mem[0][a / page_size][a & page_mask]; - } - - if (v60_read8) { - return v60_read8(a); - } - - return 0; -} - -static void program_write_word_16le(UINT32 a, UINT16 d) -{ - a &= address_mask; -#ifdef LOG_MEM - bprintf (0, _T("PWW: %6.6x %4.4x\n"), a,d); -#endif - - UINT8 *p = mem[1][a / page_size]; - - if (p) { - UINT16 *z = (UINT16*)(p + (a & page_mask)); - *z = d; - return; - } - - if (v60_write16) { - v60_write16(a,d); - return; - } -} - -static void program_write_byte_16le(UINT32 a, UINT8 d) -{ - a &= address_mask; -#ifdef LOG_MEM - bprintf (0, _T("PWB: %6.6x %2.2x\n"), a,d); -#endif - - if (mem[1][a / page_size]) { - mem[1][a / page_size][a & page_mask] = d; - return; - } - - if (v60_write8) { - return v60_write8(a,d); - } -} - -static UINT16 io_read_word_16le(UINT32 a) -{ - if (v60_ioread16) { - return v60_ioread16(a); - } - - return 0; -} - -static UINT8 io_read_byte_16le(UINT32 a) -{ - if (v60_ioread8) { - return v60_ioread8(a); - } - - return 0; -} - -static void io_write_word_16le(UINT32 a, UINT16 d) -{ - if (v60_iowrite16) { - return v60_iowrite16(a,d); - } -} - -static void io_write_byte_16le(UINT32 a, UINT8 d) -{ - if (v60_iowrite8) { - return v60_iowrite8(a,d); - } -} - -static UINT32 io_read_dword_32le(UINT32 a) -{ - if (v60_ioread32) { - return v60_ioread32(a); - } - - return 0; -} - -static UINT16 io_read_word_32le(UINT32 a) -{ - if (v60_ioread16) { - return v60_ioread16(a); - } - - return 0; -} - -static UINT8 io_read_byte_32le(UINT32 a) -{ - if (v60_ioread8) { - return v60_ioread8(a); - } - - return 0; -} - -static void io_write_dword_32le(UINT32 a, UINT32 d) -{ - if (v60_iowrite32) { - return v60_iowrite32(a,d); - } -} - -static void io_write_word_32le(UINT32 a, UINT16 d) -{ - if (v60_iowrite16) { - return v60_iowrite16(a,d); - } -} - -static void io_write_byte_32le(UINT32 a, UINT8 d) -{ - if (v60_iowrite8) { - return v60_iowrite8(a,d); - } -} - -static UINT32 program_read_dword_32le(UINT32 a) -{ - UINT32 *p = (UINT32*)mem[0][a / page_size]; - - if (p) { - return p[(a & page_mask)/4]; - } - - if (v60_read32) { - return v60_read32(a); - } - - return 0; -} - -static UINT16 program_read_word_32le(UINT32 a) -{ - UINT16 *p = (UINT16*)mem[0][a / page_size]; - - if (p) { - return p[(a & page_mask)/2]; - } - - if (v60_read16) { - return v60_read16(a); - } - - return 0; -} - -static UINT8 program_read_byte_32le(UINT32 a) -{ - if (mem[0][a / page_size]) { - return mem[0][a / page_size][a & page_mask]; - } - - if (v60_read8) { - return v60_read8(a); - } - - return 0; -} - -static void program_write_dword_32le(UINT32 a, UINT32 d) -{ - UINT32 *p = (UINT32*)mem[1][a / page_size]; - - if (p) { - p[(a & page_mask)/4] = d; - return; - } - - if (v60_write32) { - v60_write32(a,d); - return; - } -} - -static void program_write_word_32le(UINT32 a, UINT16 d) -{ - UINT16 *p = (UINT16*)mem[1][a / page_size]; - - if (p) { - p[(a & page_mask)/2] = d; - return; - } - - if (v60_write16) { - v60_write16(a,d); - return; - } -} - -static void program_write_byte_32le(UINT32 a, UINT8 d) -{ - if (mem[1][a / page_size]) { - mem[1][a / page_size][a & page_mask] = d; - return; - } - - if (v60_write8) { - return v60_write8(a,d); - } -} - - -struct cpu_info { - UINT8 (*mr8) (offs_t address); - void (*mw8) (offs_t address, UINT8 data); - UINT16 (*mr16)(offs_t address); - void (*mw16)(offs_t address, UINT16 data); - UINT32 (*mr32)(offs_t address); - void (*mw32)(offs_t address, UINT32 data); - UINT8 (*pr8) (offs_t address); - void (*pw8) (offs_t address, UINT8 data); - UINT16 (*pr16)(offs_t address); - void (*pw16)(offs_t address, UINT16 data); - UINT32 (*pr32)(offs_t address); - void (*pw32)(offs_t address, UINT32 data); - UINT8 (*or8) (offs_t address); - UINT16 (*or16)(offs_t address); - UINT32 (*or32)(offs_t address); - void (*chpc)(offs_t newpc); - UINT32 start_pc; -}; - -typedef struct -{ - UINT8 CY; - UINT8 OV; - UINT8 S; - UINT8 Z; -} Flags; - -// v60 Register Inside (Hm... It's not a pentium inside :-))) ) -static struct v60info { - struct cpu_info info; - UINT32 reg[68]; - Flags flags; - UINT8 irq_line; - UINT8 nmi_line; - ALIGN_VAR(8) int (*irq_cb)(int irqline); - UINT32 PPC; - UINT32 current_cycles; - UINT32 cycles; -} v60; - - -static int v60_ICount; - - -// memory accessors -#include "v60mem.c" - - -// macros stolen from MAME for flags calc -// note that these types are in x86 naming: -// byte = 8 bit, word = 16 bit, long = 32 bit - -// parameter x = result, y = source 1, z = source 2 - -#define SetOFL_Add(x,y,z) (_OV = (((x) ^ (y)) & ((x) ^ (z)) & 0x80000000) ? 1: 0) -#define SetOFW_Add(x,y,z) (_OV = (((x) ^ (y)) & ((x) ^ (z)) & 0x8000) ? 1 : 0) -#define SetOFB_Add(x,y,z) (_OV = (((x) ^ (y)) & ((x) ^ (z)) & 0x80) ? 1 : 0) - -#define SetOFL_Sub(x,y,z) (_OV = (((z) ^ (y)) & ((z) ^ (x)) & 0x80000000) ? 1 : 0) -#define SetOFW_Sub(x,y,z) (_OV = (((z) ^ (y)) & ((z) ^ (x)) & 0x8000) ? 1 : 0) -#define SetOFB_Sub(x,y,z) (_OV = (((z) ^ (y)) & ((z) ^ (x)) & 0x80) ? 1 : 0) - -#define SetCFB(x) {_CY = ((x) & 0x100) ? 1 : 0; } -#define SetCFW(x) {_CY = ((x) & 0x10000) ? 1 : 0; } -#define SetCFL(x) {_CY = ((x) & (((UINT64)1) << 32)) ? 1 : 0; } - -#define SetSF(x) (_S = (x)) -#define SetZF(x) (_Z = (x)) - -#define SetSZPF_Byte(x) {_Z = ((UINT8)(x)==0); _S = ((x)&0x80) ? 1 : 0; } -#define SetSZPF_Word(x) {_Z = ((UINT16)(x)==0); _S = ((x)&0x8000) ? 1 : 0; } -#define SetSZPF_Long(x) {_Z = ((UINT32)(x)==0); _S = ((x)&0x80000000) ? 1 : 0; } - -#define ORB(dst,src) { (dst) |= (src); _CY = _OV = 0; SetSZPF_Byte(dst); } -#define ORW(dst,src) { (dst) |= (src); _CY = _OV = 0; SetSZPF_Word(dst); } -#define ORL(dst,src) { (dst) |= (src); _CY = _OV = 0; SetSZPF_Long(dst); } - -#define ANDB(dst,src) { (dst) &= (src); _CY = _OV = 0; SetSZPF_Byte(dst); } -#define ANDW(dst,src) { (dst) &= (src); _CY = _OV = 0; SetSZPF_Word(dst); } -#define ANDL(dst,src) { (dst) &= (src); _CY = _OV = 0; SetSZPF_Long(dst); } - -#define XORB(dst,src) { (dst) ^= (src); _CY = _OV = 0; SetSZPF_Byte(dst); } -#define XORW(dst,src) { (dst) ^= (src); _CY = _OV = 0; SetSZPF_Word(dst); } -#define XORL(dst,src) { (dst) ^= (src); _CY = _OV = 0; SetSZPF_Long(dst); } - -#define SUBB(dst, src) { unsigned res=(dst)-(src); SetCFB(res); SetOFB_Sub(res,src,dst); SetSZPF_Byte(res); dst=(UINT8)res; } -#define SUBW(dst, src) { unsigned res=(dst)-(src); SetCFW(res); SetOFW_Sub(res,src,dst); SetSZPF_Word(res); dst=(UINT16)res; } -#define SUBL(dst, src) { UINT64 res=(UINT64)(dst)-(INT64)(src); SetCFL(res); SetOFL_Sub(res,src,dst); SetSZPF_Long(res); dst=(UINT32)res; } - -#define ADDB(dst, src) { unsigned res=(dst)+(src); SetCFB(res); SetOFB_Add(res,src,dst); SetSZPF_Byte(res); dst=(UINT8)res; } -#define ADDW(dst, src) { unsigned res=(dst)+(src); SetCFW(res); SetOFW_Add(res,src,dst); SetSZPF_Word(res); dst=(UINT16)res; } -#define ADDL(dst, src) { UINT64 res=(UINT64)(dst)+(UINT64)(src); SetCFL(res); SetOFL_Add(res,src,dst); SetSZPF_Long(res); dst=(UINT32)res; } - -#define SETREG8(a, b) (a) = ((a) & ~0xff) | ((b) & 0xff) -#define SETREG16(a, b) (a) = ((a) & ~0xffff) | ((b) & 0xffff) - - -/* - * Prevent warnings on NetBSD. All identifiers beginning with an underscore - * followed by an uppercase letter are reserved by the C standard (ISO/IEC - * 9899:1999, 7.1.3) to be used by the implementation. It'd be best to rename - * all such instances, but this is less intrusive and error-prone. - */ -#undef _S - -#define _CY v60.flags.CY -#define _OV v60.flags.OV -#define _S v60.flags.S -#define _Z v60.flags.Z - - -// Defines of all v60 register... -#define R0 v60.reg[0] -#define R1 v60.reg[1] -#define R2 v60.reg[2] -#define R3 v60.reg[3] -#define R4 v60.reg[4] -#define R5 v60.reg[5] -#define R6 v60.reg[6] -#define R7 v60.reg[7] -#define R8 v60.reg[8] -#define R9 v60.reg[9] -#define R10 v60.reg[10] -#define R11 v60.reg[11] -#define R12 v60.reg[12] -#define R13 v60.reg[13] -#define R14 v60.reg[14] -#define R15 v60.reg[15] -#define R16 v60.reg[16] -#define R17 v60.reg[17] -#define R18 v60.reg[18] -#define R19 v60.reg[19] -#define R20 v60.reg[20] -#define R21 v60.reg[21] -#define R22 v60.reg[22] -#define R23 v60.reg[23] -#define R24 v60.reg[24] -#define R25 v60.reg[25] -#define R26 v60.reg[26] -#define R27 v60.reg[27] -#define R28 v60.reg[28] -#define AP v60.reg[29] -#define FP v60.reg[30] -#define SP v60.reg[31] - -#define PC v60.reg[32] -#define PSW v60.reg[33] - -// Privileged registers -#define ISP v60.reg[36] -#define L0SP v60.reg[37] -#define L1SP v60.reg[38] -#define L2SP v60.reg[39] -#define L3SP v60.reg[40] -#define SBR v60.reg[41] -#define TR v60.reg[42] -#define SYCW v60.reg[43] -#define TKCW v60.reg[44] -#define PIR v60.reg[45] -//10-14 reserved -#define PSW2 v60.reg[51] -#define ATBR0 v60.reg[52] -#define ATLR0 v60.reg[53] -#define ATBR1 v60.reg[54] -#define ATLR1 v60.reg[55] -#define ATBR2 v60.reg[56] -#define ATLR2 v60.reg[57] -#define ATBR3 v60.reg[58] -#define ATLR3 v60.reg[59] -#define TRMODE v60.reg[60] -#define ADTR0 v60.reg[61] -#define ADTR1 v60.reg[62] -#define ADTMR0 v60.reg[63] -#define ADTMR1 v60.reg[64] -//29-31 reserved - -// Register names -const char *v60_reg_names[69] = { - "R0", "R1", "R2", "R3", - "R4", "R5", "R6", "R7", - "R8", "R9", "R10", "R11", - "R12", "R13", "R14", "R15", - "R16", "R17", "R18", "R19", - "R20", "R21", "R22", "R23", - "R24", "R25", "R26", "R27", - "R28", "AP", "FP", "SP", - "PC", "PSW","Unk","Unk", - "ISP", "L0SP", "L1SP", "L2SP", - "L3SP", "SBR","TR","SYCW", - "TKCW", "PIR", "Reserved","Reserved", - "Reserved","Reserved","Reserved","PSW2", - "ATBR0", "ATLR0", "ATBR1", "ATLR1", - "ATBR2", "ATLR2", "ATBR3", "ATLR3", - "TRMODE", "ADTR0", "ADTR1","ADTMR0", - "ADTMR1","Reserved","Reserved","Reserved" -}; - -// Defines... -#define NORMALIZEFLAGS() \ -{ \ - _S = _S ? 1 : 0; \ - _OV = _OV ? 1 : 0; \ - _Z = _Z ? 1 : 0; \ - _CY = _CY ? 1 : 0; \ -} - -static void v60_try_irq(void); - - -INLINE void v60SaveStack(void) -{ - if (PSW & 0x10000000) - ISP = SP; - else - v60.reg[37 + ((PSW >> 24) & 3)] = SP; -} - -INLINE void v60ReloadStack(void) -{ - if (PSW & 0x10000000) - SP = ISP; - else - SP = v60.reg[37 + ((PSW >> 24) & 3)]; -} - -INLINE UINT32 v60ReadPSW(void) -{ - PSW &= 0xfffffff0; - PSW |= (_Z?1:0) | (_S?2:0) | (_OV?4:0) | (_CY?8:0); - return PSW; -} - -INLINE void v60WritePSW(UINT32 newval) -{ - /* determine if we need to save/restore the stacks */ - int updateStack = 0; - - /* if the interrupt state is changing, we definitely need to update */ - if ((newval ^ PSW) & 0x10000000) - updateStack = 1; - - /* if we are not in interrupt mode and the level is changing, we also must update */ - else if (!(PSW & 0x10000000) && ((newval ^ PSW) & 0x03000000)) - updateStack = 1; - - /* save the previous stack value */ - if (updateStack) - v60SaveStack(); - - /* set the new value and update the flags */ - PSW = newval; - _Z = (UINT8)(PSW & 1); - _S = (UINT8)(PSW & 2); - _OV = (UINT8)(PSW & 4); - _CY = (UINT8)(PSW & 8); - - /* fetch the new stack value */ - if (updateStack) - v60ReloadStack(); -} - - -INLINE UINT32 v60_update_psw_for_exception(int is_interrupt, int target_level) -{ - UINT32 oldPSW = v60ReadPSW(); - UINT32 newPSW = oldPSW; - - // Change to interrupt context - newPSW &= ~(3 << 24); // PSW.EL = 0 - newPSW |= target_level << 24; // set target level - newPSW &= ~(1 << 18); // PSW.IE = 0 - newPSW &= ~(1 << 16); // PSW.TE = 0 - newPSW &= ~(1 << 27); // PSW.TP = 0 - newPSW &= ~(1 << 17); // PSW.AE = 0 - newPSW &= ~(1 << 29); // PSW.EM = 0 - if (is_interrupt) - newPSW |= (1 << 28);// PSW.IS = 1 - newPSW |= (1 << 31); // PSW.ASA = 1 - v60WritePSW(newPSW); - - return oldPSW; -} - - -#define GETINTVECT(nint) MemRead32((SBR & ~0xfff) + (nint)*4) -#define EXCEPTION_CODE_AND_SIZE(code, size) (((code) << 16) | (size)) - - -// Addressing mode decoding functions -#include "am.c" - -// Opcode functions -#include "op12.c" -#include "op2.c" -#include "op3.c" -#include "op4.c" -#include "op5.c" -#include "op6.c" -#include "op7a.c" - -static UINT32 opUNHANDLED(void) -{ - //fatalerror("Unhandled OpCode found : %02x at %08x", OpRead16(PC), PC); - return 0; /* never reached, fatalerror won't return */ -} - -// Opcode jump table -#include "optable.c" - -static int v60_default_irq_cb(int ) -{ - return 0; -} - -INT32 v60GetActive() -{ - return 0; -} - -static void cheat_write_byte(UINT32 a, UINT8 d) -{ - if (mem[0][a / page_size]) { - mem[0][a / page_size][a & page_mask] = d; - return; - } - - if (mem[1][a / page_size]) { - mem[1][a / page_size][a & page_mask] = d; - return; - } - - if (mem[2][a / page_size]) { - mem[2][a / page_size][a & page_mask] = d; - return; - } - - if (v60_write8) { - return v60_write8(a,d); - } -} - -static cpu_core_config v60CheatCpuConfig = -{ - v60Open, - v60Close, - program_read_byte_16le, - cheat_write_byte, - v60GetActive, - v60TotalCycles, - v60NewFrame, - v60Run, - v60RunEnd, - v60Reset, - 1<<24, - 0 -}; - -static void base_init() -{ - v60.irq_cb = v60_default_irq_cb; - v60.irq_line = CLEAR_LINE; - v60.nmi_line = CLEAR_LINE; - -#if 0 - state_save_register_item_array(type, index, v60.reg); - state_save_register_item(type, index, v60.irq_line); - state_save_register_item(type, index, v60.nmi_line); - state_save_register_item(type, index, v60.PPC); - state_save_register_item(type, index, _CY); - state_save_register_item(type, index, _OV); - state_save_register_item(type, index, _S); - state_save_register_item(type, index, _Z); -#endif -} - -void v60Init() -{ - memset (mem, 0, 3 * ((address_mask + 1) / page_size) * sizeof(UINT8*)); - - base_init(); - // Set PIR (Processor ID) for NEC v60. LSB is reserved to NEC, - // so I don't know what it contains. - PIR = 0x00006000; - v60.info = v60_i; - - CpuCheatRegister(0, &v60CheatCpuConfig); -} - -void v70Init() -{ - base_init(); - // Set PIR (Processor ID) for NEC v70. LSB is reserved to NEC, - // so I don't know what it contains. - PIR = 0x00007000; - v60.info = v70_i; -} - -INT32 v60Scan(INT32 nAction) -{ - struct BurnArea ba; - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 1; - } - - ba.Data = &v60.reg; - ba.nLen = sizeof(v60.reg); - ba.szName = "V60 Regs"; - BurnAcb(&ba); - - SCAN_VAR(v60.flags.CY); - SCAN_VAR(v60.flags.OV); - SCAN_VAR(v60.flags.S); - SCAN_VAR(v60.flags.Z); - SCAN_VAR(v60.irq_line); - SCAN_VAR(v60.nmi_line); - SCAN_VAR(v60.PPC); - SCAN_VAR(v60.current_cycles); - SCAN_VAR(v60.cycles); - - return 0; -} - -void v60SetIRQCallback(int (*callback)(int irqline)) -{ - v60.irq_cb = callback; -} - -void v60Reset() -{ - v60.current_cycles = 0; - PSW = 0x10000000; - PC = v60.info.start_pc; - SBR = 0x00000000; - SYCW = 0x00000070; - TKCW = 0x0000e000; - PSW2 = 0x0000f002; - ChangePC(PC); - - _CY = 0; - _OV = 0; - _S = 0; - _Z = 0; -} - -void v60Open(int) -{ - -} - -void v60Close() -{ - -} - -void v60Exit() -{ - -} - - -static void v60_do_irq(int vector) -{ - UINT32 oldPSW = v60_update_psw_for_exception(1, 0); - - // Push PC and PSW onto the stack - SP-=4; - MemWrite32(SP, oldPSW); - SP-=4; - MemWrite32(SP, PC); - - // Jump to vector for user interrupt - PC = GETINTVECT(vector); -} - -static void v60_try_irq(void) -{ - if(v60.irq_line == CLEAR_LINE) - return; - if((PSW & (1<<18)) != 0) { - int vector; - if(v60.irq_line != ASSERT_LINE) - v60.irq_line = CLEAR_LINE; - - vector = v60.irq_cb(0); - - v60_do_irq(vector + 0x40); - } else if(v60.irq_line == PULSE_LINE) - v60.irq_line = CLEAR_LINE; -} - -static void set_irq_line(int irqline, int state) -{ - if(irqline == INPUT_LINE_NMI) { - switch(state) { - case ASSERT_LINE: - if(v60.nmi_line == CLEAR_LINE) { - v60.nmi_line = ASSERT_LINE; - v60_do_irq(2); - } - break; - case CLEAR_LINE: - v60.nmi_line = CLEAR_LINE; - break; - case HOLD_LINE: - case PULSE_LINE: - v60.nmi_line = CLEAR_LINE; - v60_do_irq(2); - break; - } - } else { - v60.irq_line = state; - v60_try_irq(); - } -} - -// Actual cycles/instruction is unknown - -INT32 v60Run(int cycles) -{ - UINT32 inc; - - v60.cycles = cycles; - - v60_ICount = cycles; - if(v60.irq_line != CLEAR_LINE) - v60_try_irq(); - while(v60_ICount >= 0) { - v60.PPC = PC; - // CALL_MAME_DEBUG; - v60_ICount -= 8; /* fix me -- this is just an average */ - inc = OpCodeTable[OpRead8(PC)](); - PC += inc; - if(v60.irq_line != CLEAR_LINE) - v60_try_irq(); - } - - v60.current_cycles += cycles - v60_ICount; - - return cycles - v60_ICount; -} - -void v60SetIRQLine(INT32 irqline, INT32 state) -{ - if (state == CPU_IRQSTATUS_AUTO) { - // INT32 tmp0 = v60.current_cycles; - // INT32 tmp1 = v60.cycles; - set_irq_line(irqline,1); - v60Run(100); - // if (tmp1) tmp1 -= 100; - set_irq_line(irqline,0); - v60Run(100); - } - else - { - set_irq_line(irqline,state); - } -} - -INT32 v60TotalCycles() -{ - return v60.current_cycles + (v60.cycles - v60_ICount); -} - -void v60RunEnd() -{ - v60_ICount = 0; -} - -void v60NewFrame() -{ - v60.current_cycles = 0; -} - -#if 0 -static void v60_get_context(void *dst) -{ - if(dst) - *(struct v60info *)dst = v60; -} - -static void v60_set_context(void *src) -{ - if(src) - { - v60 = *(struct v60info *)src; - ChangePC(PC); - } -} -#endif - -#ifdef MAME_DEBUG -offs_t v60_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -offs_t v70_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); -#endif /* MAME_DEBUG */ - - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -#if 0 -static void v60_set_info(UINT32 state, union cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(0, info->i); break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(INPUT_LINE_NMI, info->i); break; - - case CPUINFO_INT_PC: PC = info->i; ChangePC(PC); break; - case CPUINFO_INT_SP: SP = info->i; break; - - case CPUINFO_INT_REGISTER + V60_R0: R0 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R1: R1 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R2: R2 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R3: R3 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R4: R4 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R5: R5 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R6: R6 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R7: R7 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R8: R8 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R9: R9 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R10: R10 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R11: R11 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R12: R12 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R13: R13 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R14: R14 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R15: R15 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R16: R16 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R17: R17 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R18: R18 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R19: R19 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R20: R20 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R21: R21 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R22: R22 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R23: R23 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R24: R24 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R25: R25 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R26: R26 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R27: R27 = info->i; break; - case CPUINFO_INT_REGISTER + V60_R28: R28 = info->i; break; - case CPUINFO_INT_REGISTER + V60_AP: AP = info->i; break; - case CPUINFO_INT_REGISTER + V60_FP: FP = info->i; break; - case CPUINFO_INT_REGISTER + V60_SP: SP = info->i; break; - case CPUINFO_INT_REGISTER + V60_PC: PC = info->i; break; - case CPUINFO_INT_REGISTER + V60_PSW: v60WritePSW(info->i); break; - case CPUINFO_INT_REGISTER + V60_ISP: ISP = info->i; break; - case CPUINFO_INT_REGISTER + V60_L0SP: L0SP = info->i; break; - case CPUINFO_INT_REGISTER + V60_L1SP: L1SP = info->i; break; - case CPUINFO_INT_REGISTER + V60_L2SP: L2SP = info->i; break; - case CPUINFO_INT_REGISTER + V60_L3SP: L3SP = info->i; break; - case CPUINFO_INT_REGISTER + V60_SBR: SBR = info->i; break; - case CPUINFO_INT_REGISTER + V60_TR: TR = info->i; break; - case CPUINFO_INT_REGISTER + V60_SYCW: SYCW = info->i; break; - case CPUINFO_INT_REGISTER + V60_TKCW: TKCW = info->i; break; - case CPUINFO_INT_REGISTER + V60_PIR: PIR = info->i; break; - case CPUINFO_INT_REGISTER + V60_PSW2: PSW2 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ATBR0: ATBR0 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ATLR0: ATLR0 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ATBR1: ATBR1 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ATLR1: ATLR1 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ATBR2: ATBR2 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ATLR2: ATLR2 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ATBR3: ATBR3 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ATLR3: ATLR3 = info->i; break; - case CPUINFO_INT_REGISTER + V60_TRMODE: TRMODE = info->i; break; - case CPUINFO_INT_REGISTER + V60_ADTR0: ADTR0 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ADTR1: ADTR1 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ADTMR0: ADTMR0 = info->i; break; - case CPUINFO_INT_REGISTER + V60_ADTMR1: ADTMR1 = info->i; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void v60_get_info(UINT32 state, union cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(v60); break; - case CPUINFO_INT_INPUT_LINES: info->i = 1; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 22; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 24; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + 0: info->i = v60.irq_line; break; - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = v60.nmi_line; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = v60.PPC; break; - - case CPUINFO_INT_REGISTER + V60_R0: info->i = R0; break; - case CPUINFO_INT_REGISTER + V60_R1: info->i = R1; break; - case CPUINFO_INT_REGISTER + V60_R2: info->i = R2; break; - case CPUINFO_INT_REGISTER + V60_R3: info->i = R3; break; - case CPUINFO_INT_REGISTER + V60_R4: info->i = R4; break; - case CPUINFO_INT_REGISTER + V60_R5: info->i = R5; break; - case CPUINFO_INT_REGISTER + V60_R6: info->i = R6; break; - case CPUINFO_INT_REGISTER + V60_R7: info->i = R7; break; - case CPUINFO_INT_REGISTER + V60_R8: info->i = R8; break; - case CPUINFO_INT_REGISTER + V60_R9: info->i = R9; break; - case CPUINFO_INT_REGISTER + V60_R10: info->i = R10; break; - case CPUINFO_INT_REGISTER + V60_R11: info->i = R11; break; - case CPUINFO_INT_REGISTER + V60_R12: info->i = R12; break; - case CPUINFO_INT_REGISTER + V60_R13: info->i = R13; break; - case CPUINFO_INT_REGISTER + V60_R14: info->i = R14; break; - case CPUINFO_INT_REGISTER + V60_R15: info->i = R15; break; - case CPUINFO_INT_REGISTER + V60_R16: info->i = R16; break; - case CPUINFO_INT_REGISTER + V60_R17: info->i = R17; break; - case CPUINFO_INT_REGISTER + V60_R18: info->i = R18; break; - case CPUINFO_INT_REGISTER + V60_R19: info->i = R19; break; - case CPUINFO_INT_REGISTER + V60_R20: info->i = R20; break; - case CPUINFO_INT_REGISTER + V60_R21: info->i = R21; break; - case CPUINFO_INT_REGISTER + V60_R22: info->i = R22; break; - case CPUINFO_INT_REGISTER + V60_R23: info->i = R23; break; - case CPUINFO_INT_REGISTER + V60_R24: info->i = R24; break; - case CPUINFO_INT_REGISTER + V60_R25: info->i = R25; break; - case CPUINFO_INT_REGISTER + V60_R26: info->i = R26; break; - case CPUINFO_INT_REGISTER + V60_R27: info->i = R27; break; - case CPUINFO_INT_REGISTER + V60_R28: info->i = R28; break; - case CPUINFO_INT_REGISTER + V60_AP: info->i = AP; break; - case CPUINFO_INT_REGISTER + V60_FP: info->i = FP; break; - case CPUINFO_INT_SP: - case CPUINFO_INT_REGISTER + V60_SP: info->i = SP; break; - case CPUINFO_INT_PC: - case CPUINFO_INT_REGISTER + V60_PC: info->i = PC; break; - case CPUINFO_INT_REGISTER + V60_PSW: info->i = v60ReadPSW(); break; - case CPUINFO_INT_REGISTER + V60_ISP: info->i = ISP; break; - case CPUINFO_INT_REGISTER + V60_L0SP: info->i = L0SP; break; - case CPUINFO_INT_REGISTER + V60_L1SP: info->i = L1SP; break; - case CPUINFO_INT_REGISTER + V60_L2SP: info->i = L2SP; break; - case CPUINFO_INT_REGISTER + V60_L3SP: info->i = L3SP; break; - case CPUINFO_INT_REGISTER + V60_SBR: info->i = SBR; break; - case CPUINFO_INT_REGISTER + V60_TR: info->i = TR; break; - case CPUINFO_INT_REGISTER + V60_SYCW: info->i = SYCW; break; - case CPUINFO_INT_REGISTER + V60_TKCW: info->i = TKCW; break; - case CPUINFO_INT_REGISTER + V60_PIR: info->i = PIR; break; - case CPUINFO_INT_REGISTER + V60_PSW2: info->i = PSW2; break; - case CPUINFO_INT_REGISTER + V60_ATBR0: info->i = ATBR0; break; - case CPUINFO_INT_REGISTER + V60_ATLR0: info->i = ATLR0; break; - case CPUINFO_INT_REGISTER + V60_ATBR1: info->i = ATBR1; break; - case CPUINFO_INT_REGISTER + V60_ATLR1: info->i = ATLR1; break; - case CPUINFO_INT_REGISTER + V60_ATBR2: info->i = ATBR2; break; - case CPUINFO_INT_REGISTER + V60_ATLR2: info->i = ATLR2; break; - case CPUINFO_INT_REGISTER + V60_ATBR3: info->i = ATBR3; break; - case CPUINFO_INT_REGISTER + V60_ATLR3: info->i = ATLR3; break; - case CPUINFO_INT_REGISTER + V60_TRMODE: info->i = TRMODE; break; - case CPUINFO_INT_REGISTER + V60_ADTR0: info->i = ADTR0; break; - case CPUINFO_INT_REGISTER + V60_ADTR1: info->i = ADTR1; break; - case CPUINFO_INT_REGISTER + V60_ADTMR0: info->i = ADTMR0; break; - case CPUINFO_INT_REGISTER + V60_ADTMR1: info->i = ADTMR1; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = v60_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = v60_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = v60_set_context; break; - case CPUINFO_PTR_INIT: info->init = v60_init; break; - case CPUINFO_PTR_RESET: info->reset = v60_reset; break; - case CPUINFO_PTR_EXIT: info->exit = v60_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = v60_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; -#ifdef MAME_DEBUG - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = v60_dasm; break; -#endif /* MAME_DEBUG */ - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &v60_ICount; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s = cpuintrf_temp_str(), "V60"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s = cpuintrf_temp_str(), "NEC V60"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s = cpuintrf_temp_str(), "1.0"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s = cpuintrf_temp_str(), __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s = cpuintrf_temp_str(), "Farfetch'd and R.Belmont"); break; - - case CPUINFO_STR_FLAGS: strcpy(info->s = cpuintrf_temp_str(), " "); break; - - case CPUINFO_STR_REGISTER + V60_R0: sprintf(info->s = cpuintrf_temp_str(), "R0:%08X", R0); break; - case CPUINFO_STR_REGISTER + V60_R1: sprintf(info->s = cpuintrf_temp_str(), "R1:%08X", R1); break; - case CPUINFO_STR_REGISTER + V60_R2: sprintf(info->s = cpuintrf_temp_str(), "R2:%08X", R2); break; - case CPUINFO_STR_REGISTER + V60_R3: sprintf(info->s = cpuintrf_temp_str(), "R3:%08X", R3); break; - case CPUINFO_STR_REGISTER + V60_R4: sprintf(info->s = cpuintrf_temp_str(), "R4:%08X", R4); break; - case CPUINFO_STR_REGISTER + V60_R5: sprintf(info->s = cpuintrf_temp_str(), "R5:%08X", R5); break; - case CPUINFO_STR_REGISTER + V60_R6: sprintf(info->s = cpuintrf_temp_str(), "R6:%08X", R6); break; - case CPUINFO_STR_REGISTER + V60_R7: sprintf(info->s = cpuintrf_temp_str(), "R7:%08X", R7); break; - case CPUINFO_STR_REGISTER + V60_R8: sprintf(info->s = cpuintrf_temp_str(), "R8:%08X", R8); break; - case CPUINFO_STR_REGISTER + V60_R9: sprintf(info->s = cpuintrf_temp_str(), "R9:%08X", R9); break; - case CPUINFO_STR_REGISTER + V60_R10: sprintf(info->s = cpuintrf_temp_str(), "R10:%08X", R10); break; - case CPUINFO_STR_REGISTER + V60_R11: sprintf(info->s = cpuintrf_temp_str(), "R11:%08X", R11); break; - case CPUINFO_STR_REGISTER + V60_R12: sprintf(info->s = cpuintrf_temp_str(), "R12:%08X", R12); break; - case CPUINFO_STR_REGISTER + V60_R13: sprintf(info->s = cpuintrf_temp_str(), "R13:%08X", R13); break; - case CPUINFO_STR_REGISTER + V60_R14: sprintf(info->s = cpuintrf_temp_str(), "R14:%08X", R14); break; - case CPUINFO_STR_REGISTER + V60_R15: sprintf(info->s = cpuintrf_temp_str(), "R15:%08X", R15); break; - case CPUINFO_STR_REGISTER + V60_R16: sprintf(info->s = cpuintrf_temp_str(), "R16:%08X", R16); break; - case CPUINFO_STR_REGISTER + V60_R17: sprintf(info->s = cpuintrf_temp_str(), "R17:%08X", R17); break; - case CPUINFO_STR_REGISTER + V60_R18: sprintf(info->s = cpuintrf_temp_str(), "R18:%08X", R18); break; - case CPUINFO_STR_REGISTER + V60_R19: sprintf(info->s = cpuintrf_temp_str(), "R19:%08X", R19); break; - case CPUINFO_STR_REGISTER + V60_R20: sprintf(info->s = cpuintrf_temp_str(), "R20:%08X", R20); break; - case CPUINFO_STR_REGISTER + V60_R21: sprintf(info->s = cpuintrf_temp_str(), "R21:%08X", R21); break; - case CPUINFO_STR_REGISTER + V60_R22: sprintf(info->s = cpuintrf_temp_str(), "R22:%08X", R22); break; - case CPUINFO_STR_REGISTER + V60_R23: sprintf(info->s = cpuintrf_temp_str(), "R23:%08X", R23); break; - case CPUINFO_STR_REGISTER + V60_R24: sprintf(info->s = cpuintrf_temp_str(), "R24:%08X", R24); break; - case CPUINFO_STR_REGISTER + V60_R25: sprintf(info->s = cpuintrf_temp_str(), "R25:%08X", R25); break; - case CPUINFO_STR_REGISTER + V60_R26: sprintf(info->s = cpuintrf_temp_str(), "R26:%08X", R26); break; - case CPUINFO_STR_REGISTER + V60_R27: sprintf(info->s = cpuintrf_temp_str(), "R27:%08X", R27); break; - case CPUINFO_STR_REGISTER + V60_R28: sprintf(info->s = cpuintrf_temp_str(), "R28:%08X", R28); break; - case CPUINFO_STR_REGISTER + V60_AP: sprintf(info->s = cpuintrf_temp_str(), "AP:%08X", AP); break; - case CPUINFO_STR_REGISTER + V60_FP: sprintf(info->s = cpuintrf_temp_str(), "FP:%08X", FP); break; - case CPUINFO_STR_REGISTER + V60_SP: sprintf(info->s = cpuintrf_temp_str(), "SP:%08X", SP); break; - case CPUINFO_STR_REGISTER + V60_PC: sprintf(info->s = cpuintrf_temp_str(), "PC:%08X", PC); break; - case CPUINFO_STR_REGISTER + V60_PSW: sprintf(info->s = cpuintrf_temp_str(), "PSW:%08X", v60ReadPSW()); break; - case CPUINFO_STR_REGISTER + V60_ISP: sprintf(info->s = cpuintrf_temp_str(), "ISP:%08X", ISP); break; - case CPUINFO_STR_REGISTER + V60_L0SP: sprintf(info->s = cpuintrf_temp_str(), "L0SP:%08X", L0SP); break; - case CPUINFO_STR_REGISTER + V60_L1SP: sprintf(info->s = cpuintrf_temp_str(), "L1SP:%08X", L1SP); break; - case CPUINFO_STR_REGISTER + V60_L2SP: sprintf(info->s = cpuintrf_temp_str(), "L2SP:%08X", L2SP); break; - case CPUINFO_STR_REGISTER + V60_L3SP: sprintf(info->s = cpuintrf_temp_str(), "L3SP:%08X", L3SP); break; - case CPUINFO_STR_REGISTER + V60_SBR: sprintf(info->s = cpuintrf_temp_str(), "SBR:%08X", SBR); break; - case CPUINFO_STR_REGISTER + V60_TR: sprintf(info->s = cpuintrf_temp_str(), "TR:%08X", TR); break; - case CPUINFO_STR_REGISTER + V60_SYCW: sprintf(info->s = cpuintrf_temp_str(), "SYCW:%08X", SYCW); break; - case CPUINFO_STR_REGISTER + V60_TKCW: sprintf(info->s = cpuintrf_temp_str(), "TKCW:%08X", TKCW); break; - case CPUINFO_STR_REGISTER + V60_PIR: sprintf(info->s = cpuintrf_temp_str(), "PIR:%08X", PIR); break; - case CPUINFO_STR_REGISTER + V60_PSW2: sprintf(info->s = cpuintrf_temp_str(), "PSW2:%08X", PSW2); break; - case CPUINFO_STR_REGISTER + V60_ATBR0: sprintf(info->s = cpuintrf_temp_str(), "ATBR0:%08X", ATBR0); break; - case CPUINFO_STR_REGISTER + V60_ATLR0: sprintf(info->s = cpuintrf_temp_str(), "ATLR0:%08X", ATLR0); break; - case CPUINFO_STR_REGISTER + V60_ATBR1: sprintf(info->s = cpuintrf_temp_str(), "ATBR1:%08X", ATBR1); break; - case CPUINFO_STR_REGISTER + V60_ATLR1: sprintf(info->s = cpuintrf_temp_str(), "ATLR1:%08X", ATLR1); break; - case CPUINFO_STR_REGISTER + V60_ATBR2: sprintf(info->s = cpuintrf_temp_str(), "ATBR2:%08X", ATBR2); break; - case CPUINFO_STR_REGISTER + V60_ATLR2: sprintf(info->s = cpuintrf_temp_str(), "ATLR2:%08X", ATLR2); break; - case CPUINFO_STR_REGISTER + V60_ATBR3: sprintf(info->s = cpuintrf_temp_str(), "ATBR3:%08X", ATBR3); break; - case CPUINFO_STR_REGISTER + V60_ATLR3: sprintf(info->s = cpuintrf_temp_str(), "ATLR3:%08X", ATLR3); break; - case CPUINFO_STR_REGISTER + V60_TRMODE: sprintf(info->s = cpuintrf_temp_str(), "TRMODE:%08X", TRMODE); break; - case CPUINFO_STR_REGISTER + V60_ADTR0: sprintf(info->s = cpuintrf_temp_str(), "ADTR0:%08X", ADTR0); break; - case CPUINFO_STR_REGISTER + V60_ADTR1: sprintf(info->s = cpuintrf_temp_str(), "ADTR1:%08X", ADTR1); break; - case CPUINFO_STR_REGISTER + V60_ADTMR0: sprintf(info->s = cpuintrf_temp_str(), "ADTMR0:%08X", ADTMR0); break; - case CPUINFO_STR_REGISTER + V60_ADTMR1: sprintf(info->s = cpuintrf_temp_str(), "ADTMR1:%08X", ADTMR1); break; - } -} - - -/************************************************************************** - * CPU-specific set_info - **************************************************************************/ - -void v70_get_info(UINT32 state, union cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_INIT: info->init = v70_init; break; -#ifdef MAME_DEBUG - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = v70_dasm; break; -#endif /* MAME_DEBUG */ - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s = cpuintrf_temp_str(), "V70"); break; - - default: - v60_get_info(state, info); - break; - } -} -#endif diff --git a/jan/src/cpu/v60/v60.h b/jan/src/cpu/v60/v60.h deleted file mode 100644 index e91bffa45..000000000 --- a/jan/src/cpu/v60/v60.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __V60_H -#define __V60_H - -#define HAS_V60 1 -#define HAS_V70 1 - -enum { - V60_R0 = 1, - V60_R1, - V60_R2, - V60_R3, - V60_R4, - V60_R5, - V60_R6, - V60_R7, - V60_R8, - V60_R9, - V60_R10, - V60_R11, - V60_R12, - V60_R13, - V60_R14, - V60_R15, - V60_R16, - V60_R17, - V60_R18, - V60_R19, - V60_R20, - V60_R21, - V60_R22, - V60_R23, - V60_R24, - V60_R25, - V60_R26, - V60_R27, - V60_R28, - V60_AP, - V60_FP, - V60_SP, - V60_PC, - V60_PSW, - V60_U1, - V60_U2, - V60_ISP, - V60_L0SP, - V60_L1SP, - V60_L2SP, - V60_L3SP, - V60_SBR, - V60_TR, - V60_SYCW, - V60_TKCW, - V60_PIR, - V60_Res1, - V60_Res2, - V60_Res3, - V60_Res4, - V60_Res5, - V60_PSW2, - V60_ATBR0, - V60_ATLR0, - V60_ATBR1, - V60_ATLR1, - V60_ATBR2, - V60_ATLR2, - V60_ATBR3, - V60_ATLR3, - V60_TRMODE, - V60_ADTR0, - V60_ADTR1, - V60_ADTMR0, - V60_ADTMR1, - V60_Res6, - V60_Res7, - V60_Res8, - V60_REGMAX -}; - -extern const char *v60_reg_names[]; -void v60_dasm_init(void); - -#if HAS_V60 -void v60_get_info(UINT32 state, union cpuinfo *info); -#endif - -#endif - -#if HAS_V70 -void v70_get_info(UINT32 state, union cpuinfo *info); -#endif - diff --git a/jan/src/cpu/v60/v60d.c b/jan/src/cpu/v60/v60d.c deleted file mode 100644 index f3f259fda..000000000 --- a/jan/src/cpu/v60/v60d.c +++ /dev/null @@ -1,1477 +0,0 @@ - -#include "debugger.h" -#include "v60.h" - -static const UINT8 *rombase; -static offs_t pcbase; - -#define readop(a) rombase[(a) - pcbase] - -static signed char read8(unsigned pc) -{ - return readop(pc); -} - -static signed short read16(unsigned pc) -{ - return readop(pc) | (readop(pc+1) << 8); -} - -static signed int read32(unsigned pc) -{ - return readop(pc) | (readop(pc+1) << 8)| (readop(pc+2) << 16)| (readop(pc+3) << 24); -} - -static void out_AM_Register(int reg, char *out) -{ - strcat(out, v60_reg_names[reg]); -} - -static void out_AM_RegisterIndirect(int reg, int opsize, char *out) -{ - if(opsize & 0x80) - *out++ = '@'; - sprintf(out, "[%s]", v60_reg_names[reg]); -} - -static void out_AM_RegisterIndirectIndexed(int rn, int rx, int opsize, char *out) -{ - if(opsize & 0x80) - sprintf(out, "%s@[%s]", v60_reg_names[rx], v60_reg_names[rn]); - else - sprintf(out, "[%s](%s)", v60_reg_names[rn], v60_reg_names[rx]); - -} - -static void out_AM_Autoincrement(int reg, int opsize, char *out) -{ - if(opsize & 0x80) - *out++ = '@'; - sprintf(out, "[%s+]", v60_reg_names[reg]); -} - -static void out_AM_Autodecrement(int reg, int opsize, char *out) -{ - if(opsize & 0x80) - *out++ = '@'; - sprintf(out, "[-%s]", v60_reg_names[reg]); -} - -static void out_AM_Displacement(int reg, int disp, int opsize, char *out) -{ - sprintf(out, "%s%X%s[%s]", - disp >= 0 ? "" : "-", disp >= 0 ? disp : -disp, - opsize & 0x80 ? "@" : "", - v60_reg_names[reg]); -} - -static void out_AM_DisplacementIndexed(int rn, int rx, int disp, int opsize, char *out) -{ - if(opsize & 0x80) - sprintf(out, "%s@%s%X[%s]", v60_reg_names[rx], disp >= 0 ? "" : "-", disp >= 0 ? disp : -disp,v60_reg_names[rn]); - else - sprintf(out, "%s%X[%s](%s)", disp >= 0 ? "" : "-", disp >= 0 ? disp : -disp,v60_reg_names[rn], v60_reg_names[rx]); -} - -static void out_AM_PCDisplacement(unsigned pc, int disp, int opsize, char *out) -{ - sprintf(out, "%X%s[PC]", pc+disp, opsize & 0x80 ? "@" : ""); -} - -static void out_AM_PCDisplacementIndexed(unsigned pc, int disp, int rx, int opsize, char *out) -{ - if(opsize & 0x80) - sprintf(out, "%s@%X[PC]", v60_reg_names[rx], pc+disp); - else - sprintf(out, "%X[PC](%s)", pc+disp, v60_reg_names[rx]); -} - -static void out_AM_DisplacementIndirect(int reg, int disp, int opsize, char *out) -{ - sprintf(out, "%s[%s%X[%s]]", - opsize & 0x80 ? "@" : "", - disp >= 0 ? "" : "-", disp >= 0 ? disp : -disp, - v60_reg_names[reg]); -} - -static void out_AM_DisplacementIndirectIndexed(int rn, int rx, int disp, int opsize, char *out) -{ - if(opsize & 0x80) - sprintf(out, "%s@[%s%X[%s]]", v60_reg_names[rx], disp >= 0 ? "" : "-", disp >= 0 ? disp : -disp,v60_reg_names[rn]); - else - sprintf(out, "[%s%X[%s]](%s)", disp >= 0 ? "" : "-", disp >= 0 ? disp : -disp,v60_reg_names[rn], v60_reg_names[rx]); -} - -static void out_AM_PCDisplacementIndirect(unsigned pc, int disp, int opsize, char *out) -{ - sprintf(out, "%s[%X[PC]]", opsize & 0x80 ? "@" : "", pc+disp); -} - -static void out_AM_PCDisplacementIndirectIndexed(unsigned pc, int disp, int rx, int opsize, char *out) -{ - if(opsize & 0x80) - sprintf(out, "%s@[%X[PC]]", v60_reg_names[rx], pc+disp); - else - sprintf(out, "[%X[PC]](%s)", pc+disp, v60_reg_names[rx]); -} - -static void out_AM_DoubleDisplacement(int reg, int disp2, int disp1, int opsize, char *out) -{ - sprintf(out, "%s%X%s[%s%X[%s]]", - disp1 >= 0 ? "" : "-", disp1 >= 0 ? disp1 : -disp1, - opsize & 0x80 ? "@" : "", - disp2 >= 0 ? "" : "-", disp2 >= 0 ? disp2 : -disp2, - v60_reg_names[reg]); -} - -static void out_AM_PCDoubleDisplacement(unsigned pc, int disp2, int disp1, int opsize, char *out) -{ - sprintf(out, "%s%X%s[%X[PC]]", - disp1 >= 0 ? "" : "-", disp1 >= 0 ? disp1 : -disp1, - opsize & 0x80 ? "@" : "", - disp2 + pc); -} - -static void out_AM_DirectAddress(unsigned addr, int opsize, char *out) -{ - if(opsize & 0x80) - *out++ = '@'; - sprintf(out, "%X", addr); -} - -static void out_AM_DirectAddressIndexed(unsigned addr, int rx, int opsize, char *out) -{ - if(opsize & 0x80) - sprintf(out, "%s@%X", v60_reg_names[rx], addr); - else - sprintf(out, "%X(%s)", addr, v60_reg_names[rx]); -} - -static void out_AM_DirectAddressDeferred(unsigned addr, int opsize, char *out) -{ - if(opsize & 0x80) - *out++ = '@'; - sprintf(out, "[%X]", addr); -} - -static void out_AM_DirectAddressDeferredIndexed(unsigned addr, int rx, int opsize, char *out) -{ - if(opsize & 0x80) - sprintf(out, "%s@[%X]", v60_reg_names[rx], addr); - else - sprintf(out, "[%X](%s)", addr, v60_reg_names[rx]); -} - -static void out_AM_Immediate(unsigned value, int opsize, char *out) -{ - if(opsize == 0) - value &= 0xff; - else if(opsize == 1) - value &= 0xffff; - - sprintf(out, "#%X", value); -} - -static int decode_AM(unsigned ipc, unsigned pc, int m, int opsize, char *out) -{ - unsigned char mod = readop(pc); - if(m) { - switch(mod>>5) { - case 0: // Double displacement (8 bit) - out_AM_DoubleDisplacement(mod&0x1F, read8(pc+1), read8(pc+2), opsize, out); - return 3; - - case 1: // Double displacement (16 bit) - out_AM_DoubleDisplacement(mod&0x1F, read16(pc+1), read16(pc+3), opsize, out); - return 5; - - case 2: // Double displacement (32 bit) - out_AM_DoubleDisplacement(mod&0x1F, read32(pc+1), read32(pc+5), opsize, out); - return 9; - - case 3: // Register - out_AM_Register(mod&0x1F, out); - return 1; - - case 4: // Autoincrement - out_AM_Autoincrement(mod&0x1F, opsize, out); - return 1; - - case 5: // Autodecrement - out_AM_Autodecrement(mod&0x1F, opsize, out); - return 1; - - case 6: - switch (readop(pc+1)>>5) - { - case 0: // Displacement indexed (8 bit) - out_AM_DisplacementIndexed(readop(pc+1)&0x1F, mod&0x1F, read8(pc+2), opsize, out); - return 3; - - case 1: // Displacement indexed (16 bit) - out_AM_DisplacementIndexed(readop(pc+1)&0x1F, mod&0x1F, read16(pc+2), opsize, out); - return 4; - - case 2: // Displacement indexed (32 bit) - out_AM_DisplacementIndexed(readop(pc+1)&0x1F, mod&0x1F, read32(pc+2), opsize, out); - return 6; - - case 3: // Register indirect indexed - out_AM_RegisterIndirectIndexed(readop(pc+1)&0x1F, mod&0x1F, opsize, out); - return 2; - - case 4: // Displacement indirect indexed (8 bit) - out_AM_DisplacementIndirectIndexed(readop(pc+1)&0x1F, mod&0x1F, read8(pc+2), opsize, out); - return 3; - - case 5: // Displacement indirect indexed (16 bit) - out_AM_DisplacementIndirectIndexed(readop(pc+1)&0x1F, mod&0x1F, read16(pc+2), opsize, out); - return 4; - - case 6: // Displacement indirect indexed (32 bit) - out_AM_DisplacementIndirectIndexed(readop(pc+1)&0x1F, mod&0x1F, read32(pc+2), opsize, out); - return 6; - - case 7: - switch (readop(pc+1)&0x1F) - { - case 16: // PC Displacement Indexed (8 bit) - out_AM_PCDisplacementIndexed(ipc, read8(pc+2), mod&0x1F, opsize, out); - return 3; - - case 17: // PC Displacement Indexed (16 bit) - out_AM_PCDisplacementIndexed(ipc, read16(pc+2), mod&0x1F, opsize, out); - return 4; - - case 18: // PC Displacement Indexed (32 bit) - out_AM_PCDisplacementIndexed(ipc, read32(pc+2), mod&0x1F, opsize, out); - return 6; - - case 19: // Direct Address Indexed - out_AM_DirectAddressIndexed(read32(pc+2), mod&0x1F, opsize, out); - return 6; - - case 24: // PC Displacement Indirect Indexed(8 bit) - out_AM_PCDisplacementIndirectIndexed(ipc, read8(pc+2), mod&0x1F, opsize, out); - return 3; - - case 25: // PC Displacement Indirect Indexed (16 bit) - out_AM_PCDisplacementIndirectIndexed(ipc, read16(pc+2), mod&0x1F, opsize, out); - return 4; - - case 26: // PC Displacement Indirect Indexed (32 bit) - out_AM_PCDisplacementIndirectIndexed(ipc, read32(pc+2), mod&0x1F, opsize, out); - return 6; - - case 27: // Direct Address Deferred Indexed - out_AM_DirectAddressDeferredIndexed(read32(pc+2), mod&0x1F, opsize, out); - return 6; - - default: - strcat(out, "!ERRAM3"); - return 1; - } - - default: - strcat(out, "!ERRAM2"); - return 1; - } - - default: - strcat(out, "!ERRAM1"); - return 1; - } - } else { - switch(mod>>5) { - case 0: // Displacement (8 bit) - out_AM_Displacement(mod&0x1F, read8(pc+1), opsize, out); - return 2; - - case 1: // Displacement (16 bit) - out_AM_Displacement(mod&0x1F, read16(pc+1), opsize, out); - return 3; - - case 2: // Displacement (32 bit) - out_AM_Displacement(mod&0x1F, read32(pc+1), opsize, out); - return 5; - - case 3: // Register indirect - out_AM_RegisterIndirect(mod&0x1F, opsize, out); - return 1; - - case 4: // Displacement indirect (8 bit) - out_AM_DisplacementIndirect(mod&0x1F, read8(pc+1), opsize, out); - return 2; - - case 5: // Displacement indirect (16 bit) - out_AM_DisplacementIndirect(mod&0x1F, read16(pc+1), opsize, out); - return 3; - - case 6: // Displacement indirect (32 bit) - out_AM_DisplacementIndirect(mod&0x1F, read32(pc+1), opsize, out); - return 5; - - case 7: - switch(mod&0x1F) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - out_AM_Immediate(mod&0x1F, opsize, out); - return 1; - - case 16: // PC Displacement (8 bit) - out_AM_PCDisplacement(ipc, read8(pc+1), opsize, out); - return 2; - - case 17: // PC Displacement (16 bit) - out_AM_PCDisplacement(ipc, read16(pc+1), opsize, out); - return 3; - - case 18: // PC Displacement (32 bit) - out_AM_PCDisplacement(ipc, read32(pc+1), opsize, out); - return 5; - - case 19: // Direct Address - out_AM_DirectAddress(read32(pc+1), opsize, out); - return 5; - - - case 20: - switch(opsize&0x7F) { - case 0: // Immediate (8 bit) - out_AM_Immediate(read8(pc+1), opsize, out); - return 2; - - case 1: // Immediate (16 bit) - out_AM_Immediate(read16(pc+1), opsize, out); - return 3; - - case 2: // Immediate (32 bit) - out_AM_Immediate(read32(pc+1), opsize, out); - return 5; - - default: - strcat(out, "!ERRAM6"); - return 1; - } - - case 24: // PC Displacement Indirect (8 bit) - out_AM_PCDisplacementIndirect(ipc, read8(pc+1), opsize, out); - return 2; - - case 25: // PC Displacement Indirect (16 bit) - out_AM_PCDisplacementIndirect(ipc, read16(pc+1), opsize, out); - return 3; - - case 26: // PC Displacement Indirect (32 bit) - out_AM_PCDisplacementIndirect(ipc, read32(pc+1), opsize, out); - return 5; - - case 27: // Direct Address Deferred - out_AM_DirectAddressDeferred(read32(pc+1), opsize, out); - return 5; - - case 28: // PC Double Displacement (8 bit) - out_AM_PCDoubleDisplacement(ipc, read8(pc+1), read8(pc+2), opsize, out); - return 3; - - case 29: // PC Double Displacement (16 bit) - out_AM_PCDoubleDisplacement(ipc, read16(pc+1), read16(pc+3), opsize, out); - return 5; - - case 30: // PC Double Displacement (32 bit) - out_AM_PCDoubleDisplacement(ipc, read32(pc+1), read32(pc+5), opsize, out); - return 9; - - default: - strcat(out, "!ERRAM5"); - return 1; - } - - default: - strcat(out, "!ERRAM4"); - return 1; - } - } -} - - -static int decode_F1(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - unsigned char code = readop(pc); - sprintf(out, "%-8s", opnm); - if(code & 0x20) { - int ret = decode_AM(ipc, pc+1, code & 0x40, opsize1, out + strlen(out)) + 2; - strcat(out, ", "); - out_AM_Register(code & 0x1f, out + strlen(out)); - return ret; - } else { - out_AM_Register(code & 0x1f, out + strlen(out)); - strcat(out, ", "); - return decode_AM(ipc, pc+1, code & 0x40, opsize1, out + strlen(out)) + 2; - } -} - -static int decode_F2(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - int ret; - unsigned char code = readop(pc); - sprintf(out, "%-8s", opnm); - ret = decode_AM(ipc, pc+1, code & 0x40, opsize1, out + strlen(out)); - strcat(out, ", "); - ret += decode_AM(ipc, pc+1+ret, code & 0x20, opsize2, out + strlen(out)); - return ret+2; -} - -static int decode_F1F2(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - if(readop(pc) & 0x80) - return decode_F2(opnm, opsize1, opsize2, ipc, pc, out); - else - return decode_F1(opnm, opsize1, opsize2, ipc, pc, out); -} - -static int decode_F3(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "%-8s", opnm); - return decode_AM(ipc, pc, readop(pc-1) & 1, opsize1, out + strlen(out)) + 1; -} - -static int decode_F4a(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "%-8s%X", opnm, ipc+read8(pc)); - return 2; -} - -static int decode_F4b(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "%-8s%X", opnm, ipc+read16(pc)); - return 3; -} - -static int decode_F5(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - strcpy(out, opnm); - return 1; -} - -static int decode_F6(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "%-8s%s, %X[PC]", opnm, v60_reg_names[readop(pc) & 0x1f], ipc+read16(pc+1)); - return 4; -} - -static int decode_F7a(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - int ret; - unsigned char code = readop(pc); - unsigned char code2; - - sprintf(out, "%-8s", opnm); - ret = decode_AM(ipc, pc+1, code & 0x40, opsize1, out + strlen(out)); - strcat(out, ", "); - - code2 = readop(pc+1+ret); - if(code2 & 0x80) - out_AM_Register(code2 & 0x1f, out + strlen(out)); - else - out_AM_Immediate(code2, 1, out + strlen(out)); - strcat(out, ", "); - - ret += decode_AM(ipc, pc+2+ret, code & 0x20, opsize2, out + strlen(out)); - strcat(out, ", "); - - code2 = readop(pc+2+ret); - if(code2 & 0x80) - out_AM_Register(code2 & 0x1f, out + strlen(out)); - else - out_AM_Immediate(code2, 1, out + strlen(out)); - - return ret+4; -} - -static int decode_F7b(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - int ret; - unsigned char code = readop(pc); - unsigned char code2; - - sprintf(out, "%-8s", opnm); - ret = decode_AM(ipc, pc+1, code & 0x40, opsize1, out + strlen(out)); - strcat(out, ", "); - - code2 = readop(pc+1+ret); - if(code2 & 0x80) - out_AM_Register(code2 & 0x1f, out + strlen(out)); - else - out_AM_Immediate(code2, 1, out + strlen(out)); - strcat(out, ", "); - - ret += decode_AM(ipc, pc+2+ret, code & 0x20, opsize2, out + strlen(out)); - - return ret+3; -} - -static int decode_F7c(const char *opnm, int opsize1, int opsize2, unsigned ipc, unsigned pc, char *out) -{ - int ret; - unsigned char code = readop(pc); - unsigned char code2; - - sprintf(out, "%-8s", opnm); - ret = decode_AM(ipc, pc+1, code & 0x40, opsize1, out + strlen(out)); - strcat(out, ", "); - - ret += decode_AM(ipc, pc+1+ret, code & 0x20, opsize2, out + strlen(out)); - strcat(out, ", "); - - code2 = readop(pc+1+ret); - if(code2 & 0x80) - out_AM_Register(code2 & 0x1f, out + strlen(out)); - else - out_AM_Immediate(code2, 1, out + strlen(out)); - - return ret+3; -} - -static int dopUNHANDLED(unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "$%02X", readop(pc)); - return 1; -} - -static int dop58UNHANDLED(unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "$58"); - return 1; -} - -static int dop59UNHANDLED(unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "$59"); - return 1; -} - -static int dop5AUNHANDLED(unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "$5A"); - return 1; -} - -static int dop5BUNHANDLED(unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "$5B"); - return 1; -} - -static int dop5CUNHANDLED(unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "$5C"); - return 1; -} - -static int dop5DUNHANDLED(unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "$5D"); - return 1; -} - -static int dop5EUNHANDLED(unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "$5E"); - return 1; -} - -static int dop5FUNHANDLED(unsigned ipc, unsigned pc, char *out) -{ - sprintf(out, "$5F"); - return 1; -} - -#define DEFINE_EASY_OPCODE(name, opnm, ftype, opsize1, opsize2) \ - static int dop ## name(unsigned ipc, unsigned pc, char *out) \ - { \ - return decode_ ## ftype(opnm, opsize1, opsize2, ipc, pc, out); \ - } - -#define DEFINE_EASY_OPCODE_EX(name, opnm, ftype, opsize1, opsize2, flags) \ - static int dop ## name(unsigned ipc, unsigned pc, char *out) \ - { \ - return decode_ ## ftype(opnm, opsize1, opsize2, ipc, pc, out) | (flags); \ - } - -#define DEFINE_TRIPLE_OPCODE(name, string, ftype) \ - DEFINE_EASY_OPCODE(name##B,string ".b", ftype, 0, 0) \ - DEFINE_EASY_OPCODE(name##H,string ".h", ftype, 1, 1) \ - DEFINE_EASY_OPCODE(name##W,string ".w", ftype, 2, 2) - -#define DEFINE_DOUBLE_OPCODE(name, string, ftype) \ - DEFINE_EASY_OPCODE(name##B,string ".b", ftype, 0, 0) \ - DEFINE_EASY_OPCODE(name##H,string ".h", ftype, 1, 1) - -#define DEFINE_FPU_OPCODE(name,string,ftype) \ - DEFINE_EASY_OPCODE(name##S,string ".s", ftype, 2, 2) \ - DEFINE_EASY_OPCODE(name##L,string ".l", ftype, 2, 2) - - -DEFINE_FPU_OPCODE(ABSF, "absf", F2) -DEFINE_TRIPLE_OPCODE(ADD, "add", F1F2) -DEFINE_TRIPLE_OPCODE(ADDC, "addc", F1F2) -DEFINE_EASY_OPCODE(ADDDC, "adddc", F7c, 0, 0) -DEFINE_FPU_OPCODE(ADDF, "addf", F2) -DEFINE_TRIPLE_OPCODE(AND, "and", F1F2) -DEFINE_EASY_OPCODE(ANDBSU, "andbsu", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(ANDBSD, "andbsd", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(ANDNBSU, "andnbsu", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(ANDNBSD, "andnbsd", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(BGT8, "bgt", F4a, 0, 0) -DEFINE_EASY_OPCODE(BGT16, "bgt", F4b, 0, 0) -DEFINE_EASY_OPCODE(BGE8, "bge", F4a, 0, 0) -DEFINE_EASY_OPCODE(BGE16, "bge", F4b, 0, 0) -DEFINE_EASY_OPCODE(BLT8, "blt", F4a, 0, 0) -DEFINE_EASY_OPCODE(BLT16, "blt", F4b, 0, 0) -DEFINE_EASY_OPCODE(BLE8, "ble", F4a, 0, 0) -DEFINE_EASY_OPCODE(BLE16, "ble", F4b, 0, 0) -DEFINE_EASY_OPCODE(BH8, "bh", F4a, 0, 0) -DEFINE_EASY_OPCODE(BH16, "bh", F4b, 0, 0) -DEFINE_EASY_OPCODE(BNL8, "bnl", F4a, 0, 0) -DEFINE_EASY_OPCODE(BNL16, "bnl", F4b, 0, 0) -DEFINE_EASY_OPCODE(BL8, "bl", F4a, 0, 0) -DEFINE_EASY_OPCODE(BL16, "bl", F4b, 0, 0) -DEFINE_EASY_OPCODE(BNH8, "bnh", F4a, 0, 0) -DEFINE_EASY_OPCODE(BNH16, "bnh", F4b, 0, 0) -DEFINE_EASY_OPCODE(BE8, "be", F4a, 0, 0) -DEFINE_EASY_OPCODE(BE16, "be", F4b, 0, 0) -DEFINE_EASY_OPCODE(BNE8, "bne", F4a, 0, 0) -DEFINE_EASY_OPCODE(BNE16, "bne", F4b, 0, 0) -DEFINE_EASY_OPCODE(BV8, "bv", F4a, 0, 0) -DEFINE_EASY_OPCODE(BV16, "bv", F4b, 0, 0) -DEFINE_EASY_OPCODE(BNV8, "bnv", F4a, 0, 0) -DEFINE_EASY_OPCODE(BNV16, "bnv", F4b, 0, 0) -DEFINE_EASY_OPCODE(BN8, "bn", F4a, 0, 0) -DEFINE_EASY_OPCODE(BN16, "bn", F4b, 0, 0) -DEFINE_EASY_OPCODE(BP8, "bp", F4a, 0, 0) -DEFINE_EASY_OPCODE(BP16, "bp", F4b, 0, 0) -DEFINE_EASY_OPCODE(BR8, "br", F4a, 0, 0) -DEFINE_EASY_OPCODE(BR16, "br", F4b, 0, 0) -DEFINE_EASY_OPCODE(BRK, "brk", F5, 0, 0) -DEFINE_EASY_OPCODE(BRKV, "brkv", F5, 0, 0) -DEFINE_EASY_OPCODE_EX(BSR, "bsr", F4b, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(CALL, "call", F1F2, 0, 2, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE(CAXI, "caxi", F1, 2, 2) -DEFINE_EASY_OPCODE(CHKAR, "chkar", F1F2, 0, 0) // ? -DEFINE_EASY_OPCODE(CHKAW, "chkaw", F1F2, 0, 0) // ? -DEFINE_EASY_OPCODE(CHKAE, "chkae", F1F2, 0, 0) -DEFINE_EASY_OPCODE(CHLVL, "chlvl", F1F2, 0, 0) -DEFINE_EASY_OPCODE(CLR1, "clr1", F1F2, 2, 2) -DEFINE_EASY_OPCODE(CLRTLB, "clrtlb", F3, 0, 0) // ? -DEFINE_EASY_OPCODE(CLRTLBA, "clrtlba", F5, 0, 0) -DEFINE_TRIPLE_OPCODE(CMP, "cmp", F1F2) -DEFINE_EASY_OPCODE(CMPBFS, "cmpbfs", F7b, 0x82, 2) -DEFINE_EASY_OPCODE(CMPBFZ, "cmpbfz", F7b, 0x82, 2) -DEFINE_EASY_OPCODE(CMPBFL, "cmpbfl", F7b, 0x82, 2) -DEFINE_DOUBLE_OPCODE(CMPC, "cmpc", F7a) -DEFINE_DOUBLE_OPCODE(CMPCF, "cmpcf", F7a) -DEFINE_DOUBLE_OPCODE(CMPCS, "cmpcs", F7a) -DEFINE_FPU_OPCODE(CMPF, "cmpf", F2) -DEFINE_EASY_OPCODE(CVTSL, "cvt.sl", F2, 0, 1) -DEFINE_EASY_OPCODE(CVTLS, "cvt.ls", F2, 1, 0) -DEFINE_EASY_OPCODE(CVTWS, "cvt.ws", F2, 2, 0) -DEFINE_EASY_OPCODE(CVTWL, "cvt.wl", F2, 2, 1) -DEFINE_EASY_OPCODE(CVTSW, "cvt.sw", F2, 0, 2) -DEFINE_EASY_OPCODE(CVTLW, "cvt.lw", F2, 1, 2) -DEFINE_EASY_OPCODE(CVTDPZ, "cvtd.pz", F7c, 0, 1) -DEFINE_EASY_OPCODE(CVTDZP, "cvtd.zp", F7c, 1, 0) -DEFINE_EASY_OPCODE_EX(DBGT, "dbgt", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBGE, "dbge", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBLT, "dbgt", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBLE, "dbge", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBH, "dbh", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBNL, "dbnl", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBL, "dbl", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBNH, "dbnh", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBE, "dbe", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBNE, "dbne", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBV, "dbe", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBNV, "dbne", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBN, "dbn", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBP, "dbp", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE_EX(DBR, "dbr", F6, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_TRIPLE_OPCODE(DEC, "dec", F3) -DEFINE_EASY_OPCODE(DISPOSE, "dispose", F5, 0, 0) -DEFINE_TRIPLE_OPCODE(DIV, "div", F1F2) -DEFINE_FPU_OPCODE(DIVF, "divf", F2) -DEFINE_TRIPLE_OPCODE(DIVU, "divu", F1F2) -DEFINE_EASY_OPCODE(DIVX, "divx", F1F2, 2, 3) -DEFINE_EASY_OPCODE(DIVUX, "divux", F1F2, 2, 3) -DEFINE_EASY_OPCODE(EXTBFS, "extbfs", F7b, 0x82, 2) -DEFINE_EASY_OPCODE(EXTBFZ, "extbfz", F7b, 0x82, 2) -DEFINE_EASY_OPCODE(EXTBFL, "extbfl", F7b, 0x82, 2) -DEFINE_EASY_OPCODE(GETATE, "getate", F1F2, 0, 3) // ? -DEFINE_EASY_OPCODE(GETPSW, "getpsw", F3, 2, 0) -DEFINE_EASY_OPCODE(GETPTE, "getpte", F1F2, 0, 2) // ? -DEFINE_EASY_OPCODE(GETRA, "getra", F1F2, 0, 2) // ? -DEFINE_EASY_OPCODE(HALT, "halt", F5, 0, 0) -DEFINE_TRIPLE_OPCODE(IN, "in", F1F2) -DEFINE_TRIPLE_OPCODE(INC, "inc", F3) -DEFINE_EASY_OPCODE(INSBFL, "insbfl", F7c, 2, 0x82) -DEFINE_EASY_OPCODE(INSBFR, "insbfr", F7c, 2, 0x82) -DEFINE_EASY_OPCODE(JMP, "jmp", F3, 0, 0) -DEFINE_EASY_OPCODE_EX(JSR, "jsr", F3, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE(LDPR, "ldpr", F1F2, 2, 2) -DEFINE_EASY_OPCODE(LDTASK, "ldtask", F1F2, 2, 2) -DEFINE_TRIPLE_OPCODE(MOV, "mov", F1F2) -DEFINE_EASY_OPCODE(MOVBSU, "movbsu", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(MOVBSD, "movbsd", F7b, 0x80, 0x80) -DEFINE_DOUBLE_OPCODE(MOVCU, "movcu", F7a) -DEFINE_DOUBLE_OPCODE(MOVCD, "movcd", F7a) -DEFINE_DOUBLE_OPCODE(MOVCFU, "movcfu", F7a) -DEFINE_DOUBLE_OPCODE(MOVCFD, "movcfd", F7a) -DEFINE_DOUBLE_OPCODE(MOVCS, "movcs", F7a) -DEFINE_EASY_OPCODE(MOVD, "mov.d", F1F2, 3, 3) -DEFINE_EASY_OPCODE(MOVEAB, "movea.b", F1F2, 0, 2) -DEFINE_EASY_OPCODE(MOVEAH, "movea.h", F1F2, 1, 2) -DEFINE_EASY_OPCODE(MOVEAW, "movea.w", F1F2, 2, 2) -DEFINE_FPU_OPCODE(MOVF, "movf", F2) -DEFINE_EASY_OPCODE(MOVSBH, "movs.bh", F1F2, 0, 1) -DEFINE_EASY_OPCODE(MOVSBW, "movs.bw", F1F2, 0, 2) -DEFINE_EASY_OPCODE(MOVSHW, "movs.hw", F1F2, 1, 2) -DEFINE_EASY_OPCODE(MOVTHB, "movt.hb", F1F2, 1, 0) -DEFINE_EASY_OPCODE(MOVTWB, "movt.wb", F1F2, 2, 0) -DEFINE_EASY_OPCODE(MOVTWH, "movt.wh", F1F2, 2, 1) -DEFINE_EASY_OPCODE(MOVZBH, "movz.bh", F1F2, 0, 1) -DEFINE_EASY_OPCODE(MOVZBW, "movz.bw", F1F2, 0, 2) -DEFINE_EASY_OPCODE(MOVZHW, "movz.hw", F1F2, 1, 2) -DEFINE_TRIPLE_OPCODE(MUL, "mul", F1F2) -DEFINE_FPU_OPCODE(MULF, "mulf", F2) -DEFINE_TRIPLE_OPCODE(MULU, "mulu", F1F2) -DEFINE_EASY_OPCODE(MULX, "mulx", F1F2, 2, 3) -DEFINE_EASY_OPCODE(MULUX, "mulux", F1F2, 2, 3) -DEFINE_TRIPLE_OPCODE(NEG, "neg", F1F2) -DEFINE_FPU_OPCODE(NEGF, "negf", F2) -DEFINE_EASY_OPCODE(NOP, "nop", F5, 0, 0) -DEFINE_TRIPLE_OPCODE(NOT, "not", F1F2) -DEFINE_EASY_OPCODE(NOT1, "not1", F1F2, 2, 2) -DEFINE_EASY_OPCODE(NOTBSU, "notbsu", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(NOTBSD, "notbsd", F7b, 0x80, 0x80) -DEFINE_TRIPLE_OPCODE(OR, "or", F1F2) -DEFINE_EASY_OPCODE(ORBSU, "orbsu", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(ORBSD, "orbsd", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(ORNBSU, "ornbsu", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(ORNBSD, "ornbsd", F7b, 0x80, 0x80) -DEFINE_TRIPLE_OPCODE(OUT, "out", F1F2) -DEFINE_EASY_OPCODE(POP, "pop", F3, 2, 0) -DEFINE_EASY_OPCODE(POPM, "popm", F3, 2, 0) -DEFINE_EASY_OPCODE(PREPARE, "prepare", F3, 2, 0) -DEFINE_EASY_OPCODE(PUSH, "push", F3, 2, 0) -DEFINE_EASY_OPCODE(PUSHM, "pushm", F3, 2, 0) -DEFINE_TRIPLE_OPCODE(REM, "rem", F1F2) -DEFINE_TRIPLE_OPCODE(REMU, "remu", F1F2) -DEFINE_EASY_OPCODE_EX(RET, "ret", F3, 2, 0, DASMFLAG_STEP_OUT) -DEFINE_EASY_OPCODE_EX(RETIU, "retiu", F3, 1, 0, DASMFLAG_STEP_OUT) -DEFINE_EASY_OPCODE_EX(RETIS, "retis", F3, 1, 0, DASMFLAG_STEP_OUT) -DEFINE_EASY_OPCODE(ROTB, "rot.b", F1F2, 0, 0) -DEFINE_EASY_OPCODE(ROTH, "rot.h", F1F2, 0, 1) -DEFINE_EASY_OPCODE(ROTW, "rot.w", F1F2, 0, 2) -DEFINE_EASY_OPCODE(ROTCB, "rotc.b", F1F2, 0, 0) -DEFINE_EASY_OPCODE(ROTCH, "rotc.h", F1F2, 0, 1) -DEFINE_EASY_OPCODE(ROTCW, "rotc.w", F1F2, 0, 2) -DEFINE_EASY_OPCODE_EX(RSR, "rsr", F5, 0, 0, DASMFLAG_STEP_OUT) -DEFINE_EASY_OPCODE(RVBIT, "rvbit", F1F2, 0, 0) -DEFINE_EASY_OPCODE(RVBYT, "rvbyt", F1F2, 2, 2) -DEFINE_EASY_OPCODE(SCH0BSU, "sch0bsu", F7b, 0x80, 2) -DEFINE_EASY_OPCODE(SCH0BSD, "sch0bsd", F7b, 0x80, 2) -DEFINE_EASY_OPCODE(SCH1BSU, "sch1bsu", F7b, 0x80, 2) -DEFINE_EASY_OPCODE(SCH1BSD, "sch1bsd", F7b, 0x80, 2) -DEFINE_EASY_OPCODE(SCHCUB, "schcu.b", F7b, 0, 0) -DEFINE_EASY_OPCODE(SCHCDB, "schcd.b", F7b, 0, 0) -DEFINE_EASY_OPCODE(SCHCUH, "schcu.h", F7b, 1, 1) -DEFINE_EASY_OPCODE(SCHCDH, "schcd.h", F7b, 1, 1) -DEFINE_EASY_OPCODE(SCLFS, "sclf.s", F2, 1, 2) -DEFINE_EASY_OPCODE(SCLFL, "sclf.l", F2, 1, 2) -DEFINE_EASY_OPCODE(SET1, "set1", F1F2, 2, 2) -DEFINE_EASY_OPCODE(SETF, "setf", F1F2, 0, 0) -DEFINE_EASY_OPCODE(SHAB, "sha.b", F1F2, 0, 0) -DEFINE_EASY_OPCODE(SHAH, "sha.h", F1F2, 0, 1) -DEFINE_EASY_OPCODE(SHAW, "sha.w", F1F2, 0, 2) -DEFINE_EASY_OPCODE(SHLB, "shl.b", F1F2, 0, 0) -DEFINE_EASY_OPCODE(SHLH, "shl.h", F1F2, 0, 1) -DEFINE_EASY_OPCODE(SHLW, "shl.w", F1F2, 0, 2) -DEFINE_EASY_OPCODE(SKPCUB, "skpcu.b", F7b, 0, 0) -DEFINE_EASY_OPCODE(SKPCDB, "skpcd.b", F7b, 0, 0) -DEFINE_EASY_OPCODE(SKPCUH, "skpcu.h", F7b, 1, 1) -DEFINE_EASY_OPCODE(SKPCDH, "skpcd.h", F7b, 1, 1) -DEFINE_EASY_OPCODE(STPR, "stpr", F1F2, 2, 2) -DEFINE_EASY_OPCODE(STTASK, "sttask", F3, 2, 0) -DEFINE_TRIPLE_OPCODE(SUB, "sub", F1F2) -DEFINE_TRIPLE_OPCODE(SUBC, "subc", F1F2) -DEFINE_EASY_OPCODE(SUBDC, "subdc", F7c, 0, 0) -DEFINE_EASY_OPCODE(SUBRDC, "subrdc", F7c, 0, 0) -DEFINE_FPU_OPCODE(SUBF, "subf", F2) -DEFINE_EASY_OPCODE(TASI, "tasi", F3, 0, 0) -DEFINE_EASY_OPCODE(TB, "tb", F6, 0, 0) -DEFINE_TRIPLE_OPCODE(TEST, "test", F3) -DEFINE_EASY_OPCODE(TEST1, "test1", F1F2, 2, 2) -DEFINE_EASY_OPCODE_EX(TRAP, "trap", F3, 0, 0, DASMFLAG_STEP_OVER) -DEFINE_EASY_OPCODE(TRAPFL, "trapfl", F5, 0, 0) -DEFINE_EASY_OPCODE(UPDATE, "update", F1F2, 0, 3) // ? -DEFINE_EASY_OPCODE(UPDPSWH, "updpsw.h", F1F2, 2, 2) -DEFINE_EASY_OPCODE(UPDPSWW, "updpsw.w", F1F2, 2, 2) -DEFINE_EASY_OPCODE(UPDPTE, "updpte", F1F2, 0, 2) // ? -DEFINE_TRIPLE_OPCODE(XCH, "xch", F1) -DEFINE_TRIPLE_OPCODE(XOR, "xor", F1F2) -DEFINE_EASY_OPCODE(XORBSU, "xorbsu", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(XORBSD, "xorbsd", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(XORNBSU, "xornbsu", F7b, 0x80, 0x80) -DEFINE_EASY_OPCODE(XORNBSD, "xornbsd", F7b, 0x80, 0x80) - -static int (*const dasm_optable_58[32])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x00 */ dopCMPCB, - /* 0x01 */ dopCMPCFB, - /* 0x02 */ dopCMPCSB, - /* 0x03 */ dop58UNHANDLED, - /* 0x04 */ dop58UNHANDLED, - /* 0x05 */ dop58UNHANDLED, - /* 0x06 */ dop58UNHANDLED, - /* 0x07 */ dop58UNHANDLED, - /* 0x08 */ dopMOVCUB, - /* 0x09 */ dopMOVCDB, - /* 0x0A */ dopMOVCFUB, - /* 0x0B */ dopMOVCFDB, - /* 0x0C */ dopMOVCSB, - /* 0x0D */ dop58UNHANDLED, - /* 0x0E */ dop58UNHANDLED, - /* 0x0F */ dop58UNHANDLED, - /* 0x10 */ dop58UNHANDLED, - /* 0x11 */ dop58UNHANDLED, - /* 0x12 */ dop58UNHANDLED, - /* 0x13 */ dop58UNHANDLED, - /* 0x14 */ dop58UNHANDLED, - /* 0x15 */ dop58UNHANDLED, - /* 0x16 */ dop58UNHANDLED, - /* 0x17 */ dop58UNHANDLED, - /* 0x18 */ dopSCHCUB, - /* 0x19 */ dopSCHCDB, - /* 0x1A */ dopSKPCUB, - /* 0x1B */ dopSKPCDB, - /* 0x1C */ dop58UNHANDLED, - /* 0x1D */ dop58UNHANDLED, - /* 0x1E */ dop58UNHANDLED, - /* 0x1F */ dop58UNHANDLED -}; - -static int (*const dasm_optable_59[32])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x00 */ dopADDDC, - /* 0x01 */ dopSUBDC, - /* 0x02 */ dopSUBRDC, - /* 0x03 */ dop59UNHANDLED, - /* 0x04 */ dop59UNHANDLED, - /* 0x05 */ dop59UNHANDLED, - /* 0x06 */ dop59UNHANDLED, - /* 0x07 */ dop59UNHANDLED, - /* 0x08 */ dop59UNHANDLED, - /* 0x09 */ dop59UNHANDLED, - /* 0x0A */ dop59UNHANDLED, - /* 0x0B */ dop59UNHANDLED, - /* 0x0C */ dop59UNHANDLED, - /* 0x0D */ dop59UNHANDLED, - /* 0x0E */ dop59UNHANDLED, - /* 0x0F */ dop59UNHANDLED, - /* 0x10 */ dopCVTDPZ, - /* 0x11 */ dop59UNHANDLED, - /* 0x12 */ dop59UNHANDLED, - /* 0x13 */ dop59UNHANDLED, - /* 0x14 */ dop59UNHANDLED, - /* 0x15 */ dop59UNHANDLED, - /* 0x16 */ dop59UNHANDLED, - /* 0x17 */ dop59UNHANDLED, - /* 0x18 */ dopCVTDZP, - /* 0x19 */ dop59UNHANDLED, - /* 0x1A */ dop59UNHANDLED, - /* 0x1B */ dop59UNHANDLED, - /* 0x1C */ dop59UNHANDLED, - /* 0x1D */ dop59UNHANDLED, - /* 0x1E */ dop59UNHANDLED, - /* 0x1F */ dop59UNHANDLED -}; - -static int (*const dasm_optable_5A[32])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x00 */ dopCMPCH, - /* 0x01 */ dopCMPCFH, - /* 0x02 */ dopCMPCSH, - /* 0x03 */ dop5AUNHANDLED, - /* 0x04 */ dop5AUNHANDLED, - /* 0x05 */ dop5AUNHANDLED, - /* 0x06 */ dop5AUNHANDLED, - /* 0x07 */ dop5AUNHANDLED, - /* 0x08 */ dopMOVCUH, - /* 0x09 */ dopMOVCDH, - /* 0x0A */ dopMOVCFUH, - /* 0x0B */ dopMOVCFDH, - /* 0x0C */ dopMOVCSH, - /* 0x0D */ dop5AUNHANDLED, - /* 0x0E */ dop5AUNHANDLED, - /* 0x0F */ dop5AUNHANDLED, - /* 0x10 */ dop5AUNHANDLED, - /* 0x11 */ dop5AUNHANDLED, - /* 0x12 */ dop5AUNHANDLED, - /* 0x13 */ dop5AUNHANDLED, - /* 0x14 */ dop5AUNHANDLED, - /* 0x15 */ dop5AUNHANDLED, - /* 0x16 */ dop5AUNHANDLED, - /* 0x17 */ dop5AUNHANDLED, - /* 0x18 */ dopSCHCUH, - /* 0x19 */ dopSCHCDH, - /* 0x1A */ dopSKPCUH, - /* 0x1B */ dopSKPCDH, - /* 0x1C */ dop5AUNHANDLED, - /* 0x1D */ dop5AUNHANDLED, - /* 0x1E */ dop5AUNHANDLED, - /* 0x1F */ dop5AUNHANDLED -}; - -static int (*const dasm_optable_5B[32])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x00 */ dopSCH0BSU, - /* 0x01 */ dopSCH0BSD, - /* 0x02 */ dopSCH1BSU, - /* 0x03 */ dopSCH1BSD, - /* 0x04 */ dop5BUNHANDLED, - /* 0x05 */ dop5BUNHANDLED, - /* 0x06 */ dop5BUNHANDLED, - /* 0x07 */ dop5BUNHANDLED, - /* 0x08 */ dopMOVBSU, - /* 0x09 */ dopMOVBSD, - /* 0x0A */ dopNOTBSU, - /* 0x0B */ dopNOTBSD, - /* 0x0C */ dop5BUNHANDLED, - /* 0x0D */ dop5BUNHANDLED, - /* 0x0E */ dop5BUNHANDLED, - /* 0x0F */ dop5BUNHANDLED, - /* 0x10 */ dopANDBSU, - /* 0x11 */ dopANDBSD, - /* 0x12 */ dopANDNBSU, - /* 0x13 */ dopANDNBSD, - /* 0x14 */ dopORBSU, - /* 0x15 */ dopORBSD, - /* 0x16 */ dopORNBSU, - /* 0x17 */ dopORNBSD, - /* 0x18 */ dopXORBSU, - /* 0x19 */ dopXORBSD, - /* 0x1A */ dopXORNBSU, - /* 0x1B */ dopXORNBSD, - /* 0x1C */ dop5BUNHANDLED, - /* 0x1D */ dop5BUNHANDLED, - /* 0x1E */ dop5BUNHANDLED, - /* 0x1F */ dop5BUNHANDLED -}; - -static int (*const dasm_optable_5C[32])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x00 */ dopCMPFS, - /* 0x01 */ dop5CUNHANDLED, - /* 0x02 */ dop5CUNHANDLED, - /* 0x03 */ dop5CUNHANDLED, - /* 0x04 */ dop5CUNHANDLED, - /* 0x05 */ dop5CUNHANDLED, - /* 0x06 */ dop5CUNHANDLED, - /* 0x07 */ dop5CUNHANDLED, - /* 0x08 */ dopMOVFS, - /* 0x09 */ dopNEGFS, - /* 0x0A */ dopABSFS, - /* 0x0B */ dop5CUNHANDLED, - /* 0x0C */ dop5CUNHANDLED, - /* 0x0D */ dop5CUNHANDLED, - /* 0x0E */ dop5CUNHANDLED, - /* 0x0F */ dop5CUNHANDLED, - /* 0x10 */ dopSCLFS, - /* 0x11 */ dop5CUNHANDLED, - /* 0x12 */ dop5CUNHANDLED, - /* 0x13 */ dop5CUNHANDLED, - /* 0x14 */ dop5CUNHANDLED, - /* 0x15 */ dop5CUNHANDLED, - /* 0x16 */ dop5CUNHANDLED, - /* 0x17 */ dop5CUNHANDLED, - /* 0x18 */ dopADDFS, - /* 0x19 */ dopSUBFS, - /* 0x1A */ dopMULFS, - /* 0x1B */ dopDIVFS, - /* 0x1C */ dop5CUNHANDLED, - /* 0x1D */ dop5CUNHANDLED, - /* 0x1E */ dop5CUNHANDLED, - /* 0x1F */ dop5CUNHANDLED -}; - -static int (*const dasm_optable_5D[32])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x00 */ dopCMPBFS, - /* 0x01 */ dopCMPBFZ, - /* 0x02 */ dopCMPBFL, - /* 0x03 */ dop5DUNHANDLED, - /* 0x04 */ dop5DUNHANDLED, - /* 0x05 */ dop5DUNHANDLED, - /* 0x06 */ dop5DUNHANDLED, - /* 0x07 */ dop5DUNHANDLED, - /* 0x08 */ dopEXTBFS, - /* 0x09 */ dopEXTBFZ, - /* 0x0A */ dopEXTBFL, - /* 0x0B */ dop5DUNHANDLED, - /* 0x0C */ dop5DUNHANDLED, - /* 0x0D */ dop5DUNHANDLED, - /* 0x0E */ dop5DUNHANDLED, - /* 0x0F */ dop5DUNHANDLED, - /* 0x10 */ dop5DUNHANDLED, - /* 0x11 */ dop5DUNHANDLED, - /* 0x12 */ dop5DUNHANDLED, - /* 0x13 */ dop5DUNHANDLED, - /* 0x14 */ dop5DUNHANDLED, - /* 0x15 */ dop5DUNHANDLED, - /* 0x16 */ dop5DUNHANDLED, - /* 0x17 */ dop5DUNHANDLED, - /* 0x18 */ dopINSBFR, - /* 0x19 */ dopINSBFL, - /* 0x1A */ dop5DUNHANDLED, - /* 0x1B */ dop5DUNHANDLED, - /* 0x1C */ dop5DUNHANDLED, - /* 0x1D */ dop5DUNHANDLED, - /* 0x1E */ dop5DUNHANDLED, - /* 0x1F */ dop5DUNHANDLED -}; - -static int (*const dasm_optable_5E[32])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x00 */ dopCMPFL, - /* 0x01 */ dop5EUNHANDLED, - /* 0x02 */ dop5EUNHANDLED, - /* 0x03 */ dop5EUNHANDLED, - /* 0x04 */ dop5EUNHANDLED, - /* 0x05 */ dop5EUNHANDLED, - /* 0x06 */ dop5EUNHANDLED, - /* 0x07 */ dop5EUNHANDLED, - /* 0x08 */ dopMOVFL, - /* 0x09 */ dopNEGFL, - /* 0x0A */ dopABSFL, - /* 0x0B */ dop5EUNHANDLED, - /* 0x0C */ dop5EUNHANDLED, - /* 0x0D */ dop5EUNHANDLED, - /* 0x0E */ dop5EUNHANDLED, - /* 0x0F */ dop5EUNHANDLED, - /* 0x10 */ dopSCLFL, - /* 0x11 */ dop5EUNHANDLED, - /* 0x12 */ dop5EUNHANDLED, - /* 0x13 */ dop5EUNHANDLED, - /* 0x14 */ dop5EUNHANDLED, - /* 0x15 */ dop5EUNHANDLED, - /* 0x16 */ dop5EUNHANDLED, - /* 0x17 */ dop5EUNHANDLED, - /* 0x18 */ dopADDFL, - /* 0x19 */ dopSUBFL, - /* 0x1A */ dopMULFL, - /* 0x1B */ dopDIVFL, - /* 0x1C */ dop5EUNHANDLED, - /* 0x1D */ dop5EUNHANDLED, - /* 0x1E */ dop5EUNHANDLED, - /* 0x1F */ dop5EUNHANDLED -}; - -static int (*const dasm_optable_5F[32])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x00 */ dopCVTWS, - /* 0x01 */ dopCVTSW, - /* 0x02 */ dop5FUNHANDLED, - /* 0x03 */ dop5FUNHANDLED, - /* 0x04 */ dop5FUNHANDLED, - /* 0x05 */ dop5FUNHANDLED, - /* 0x06 */ dop5FUNHANDLED, - /* 0x07 */ dop5FUNHANDLED, - /* 0x08 */ dopCVTLS, - /* 0x09 */ dopCVTLW, - /* 0x0A */ dop5FUNHANDLED, - /* 0x0B */ dop5FUNHANDLED, - /* 0x0C */ dop5FUNHANDLED, - /* 0x0D */ dop5FUNHANDLED, - /* 0x0E */ dop5FUNHANDLED, - /* 0x0F */ dop5FUNHANDLED, - /* 0x10 */ dopCVTSL, - /* 0x11 */ dopCVTWL, - /* 0x12 */ dop5FUNHANDLED, - /* 0x13 */ dop5FUNHANDLED, - /* 0x14 */ dop5FUNHANDLED, - /* 0x15 */ dop5FUNHANDLED, - /* 0x16 */ dop5FUNHANDLED, - /* 0x17 */ dop5FUNHANDLED, - /* 0x18 */ dop5FUNHANDLED, - /* 0x19 */ dop5FUNHANDLED, - /* 0x1A */ dop5FUNHANDLED, - /* 0x1B */ dop5FUNHANDLED, - /* 0x1C */ dop5FUNHANDLED, - /* 0x1D */ dop5FUNHANDLED, - /* 0x1E */ dop5FUNHANDLED, - /* 0x1F */ dop5FUNHANDLED -}; - -static int (*const dasm_optable_C6[8])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x0 */ dopDBV, - /* 0x1 */ dopDBL, - /* 0x2 */ dopDBE, - /* 0x3 */ dopDBNH, - /* 0x4 */ dopDBN, - /* 0x5 */ dopDBR, - /* 0x6 */ dopDBLT, - /* 0x7 */ dopDBLE -}; - -static int (*const dasm_optable_C7[8])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x0 */ dopDBNV, - /* 0x1 */ dopDBNL, - /* 0x2 */ dopDBNE, - /* 0x3 */ dopDBH, - /* 0x4 */ dopDBP, - /* 0x5 */ dopTB, - /* 0x6 */ dopDBGE, - /* 0x7 */ dopDBGT -}; - -static int dop58(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_58[readop(pc) & 0x1f](ipc, pc, out); -} - -static int dop59(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_59[readop(pc) & 0x1f](ipc, pc, out); -} - -static int dop5A(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_5A[readop(pc) & 0x1f](ipc, pc, out); -} - -static int dop5B(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_5B[readop(pc) & 0x1f](ipc, pc, out); -} - -static int dop5C(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_5C[readop(pc) & 0x1f](ipc, pc, out); -} - -static int dop5D(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_5D[readop(pc) & 0x1f](ipc, pc, out); -} - -static int dop5E(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_5E[readop(pc) & 0x1f](ipc, pc, out); -} - -static int dop5F(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_5F[readop(pc) & 0x1f](ipc, pc, out); -} - -static int dopC6(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_C6[readop(pc) >> 5](ipc, pc, out); -} - -static int dopC7(unsigned ipc, unsigned pc, char *out) -{ - return dasm_optable_C7[readop(pc) >> 5](ipc, pc, out); -} - -static int (*const dasm_optable[256])(unsigned ipc, unsigned pc, char *out) = -{ - /* 0x00 */ dopHALT, - /* 0x01 */ dopLDTASK, - /* 0x02 */ dopSTPR, - /* 0x03 */ dopGETRA, - /* 0x04 */ dopGETPTE, - /* 0x05 */ dopGETATE, - /* 0x06 */ dopUNHANDLED, - /* 0x07 */ dopUNHANDLED, - /* 0x08 */ dopRVBIT, - /* 0x09 */ dopMOVB, - /* 0x0A */ dopMOVSBH, - /* 0x0B */ dopMOVZBH, - /* 0x0C */ dopMOVSBW, - /* 0x0D */ dopMOVZBW, - /* 0x0E */ dopUNHANDLED, - /* 0x0F */ dopUNHANDLED, - /* 0x10 */ dopCLRTLBA, - /* 0x11 */ dopUNHANDLED, - /* 0x12 */ dopLDPR, - /* 0x13 */ dopUPDPSWW, - /* 0x14 */ dopUPDPTE, - /* 0x15 */ dopUPDATE, - /* 0x16 */ dopUNHANDLED, - /* 0x17 */ dopUNHANDLED, - /* 0x18 */ dopUNHANDLED, - /* 0x19 */ dopMOVTHB, - /* 0x1A */ dopUNHANDLED, - /* 0x1B */ dopMOVH, - /* 0x1C */ dopMOVSHW, - /* 0x1D */ dopMOVZHW, - /* 0x1E */ dopUNHANDLED, - /* 0x1F */ dopUNHANDLED, - /* 0x20 */ dopINB, - /* 0x21 */ dopOUTB, - /* 0x22 */ dopINH, - /* 0x23 */ dopOUTH, - /* 0x24 */ dopINW, - /* 0x25 */ dopOUTW, - /* 0x26 */ dopUNHANDLED, - /* 0x27 */ dopUNHANDLED, - /* 0x28 */ dopUNHANDLED, - /* 0x29 */ dopMOVTWB, - /* 0x2A */ dopUNHANDLED, - /* 0x2B */ dopMOVTWH, - /* 0x2C */ dopRVBYT, - /* 0x2D */ dopMOVW, - /* 0x2E */ dopUNHANDLED, - /* 0x2F */ dopUNHANDLED, - /* 0x30 */ dopUNHANDLED, - /* 0x31 */ dopUNHANDLED, - /* 0x32 */ dopUNHANDLED, - /* 0x33 */ dopUNHANDLED, - /* 0x34 */ dopUNHANDLED, - /* 0x35 */ dopUNHANDLED, - /* 0x36 */ dopUNHANDLED, - /* 0x37 */ dopUNHANDLED, - /* 0x38 */ dopNOTB, - /* 0x39 */ dopNEGB, - /* 0x3A */ dopNOTH, - /* 0x3B */ dopNEGH, - /* 0x3C */ dopNOTW, - /* 0x3D */ dopNEGW, - /* 0x3E */ dopUNHANDLED, - /* 0x3F */ dopMOVD, - /* 0x40 */ dopMOVEAB, - /* 0x41 */ dopXCHB, - /* 0x42 */ dopMOVEAH, - /* 0x43 */ dopXCHH, - /* 0x44 */ dopMOVEAW, - /* 0x45 */ dopXCHW, - /* 0x46 */ dopUNHANDLED, - /* 0x47 */ dopSETF, - /* 0x48 */ dopBSR, - /* 0x49 */ dopCALL, - /* 0x4A */ dopUPDPSWH, - /* 0x4B */ dopCHLVL, - /* 0x4C */ dopCAXI, - /* 0x4D */ dopCHKAR, - /* 0x4E */ dopCHKAW, - /* 0x4F */ dopCHKAE, - /* 0x50 */ dopREMB, - /* 0x51 */ dopREMUB, - /* 0x52 */ dopREMH, - /* 0x53 */ dopREMUH, - /* 0x54 */ dopREMW, - /* 0x55 */ dopREMUW, - /* 0x56 */ dopUNHANDLED, - /* 0x57 */ dopUNHANDLED, - /* 0x58 */ dop58, - /* 0x59 */ dop59, - /* 0x5A */ dop5A, - /* 0x5B */ dop5B, - /* 0x5C */ dop5C, - /* 0x5D */ dop5D, - /* 0x5E */ dop5E, - /* 0x5F */ dop5F, - /* 0x60 */ dopBV8, - /* 0x61 */ dopBNV8, - /* 0x62 */ dopBL8, - /* 0x63 */ dopBNL8, - /* 0x64 */ dopBE8, - /* 0x65 */ dopBNE8, - /* 0x66 */ dopBNH8, - /* 0x67 */ dopBH8, - /* 0x68 */ dopBN8, - /* 0x69 */ dopBP8, - /* 0x6A */ dopBR8, - /* 0x6B */ dopUNHANDLED, - /* 0x6C */ dopBLT8, - /* 0x6D */ dopBGE8, - /* 0x6E */ dopBLE8, - /* 0x6F */ dopBGT8, - /* 0x70 */ dopBV16, - /* 0x71 */ dopBNV16, - /* 0x72 */ dopBL16, - /* 0x73 */ dopBNL16, - /* 0x74 */ dopBE16, - /* 0x75 */ dopBNE16, - /* 0x76 */ dopBNH16, - /* 0x77 */ dopBH16, - /* 0x78 */ dopBN16, - /* 0x79 */ dopBP16, - /* 0x7A */ dopBR16, - /* 0x7B */ dopUNHANDLED, - /* 0x7C */ dopBLT16, - /* 0x7D */ dopBGE16, - /* 0x7E */ dopBLE16, - /* 0x7F */ dopBGT16, - /* 0x80 */ dopADDB, - /* 0x81 */ dopMULB, - /* 0x82 */ dopADDH, - /* 0x83 */ dopMULH, - /* 0x84 */ dopADDW, - /* 0x85 */ dopMULW, - /* 0x86 */ dopMULX, - /* 0x87 */ dopTEST1, - /* 0x88 */ dopORB, - /* 0x89 */ dopROTB, - /* 0x8A */ dopORH, - /* 0x8B */ dopROTH, - /* 0x8C */ dopORW, - /* 0x8D */ dopROTW, - /* 0x8E */ dopUNHANDLED, - /* 0x8F */ dopUNHANDLED, - /* 0x90 */ dopADDCB, - /* 0x91 */ dopMULUB, - /* 0x92 */ dopADDCH, - /* 0x93 */ dopMULUH, - /* 0x94 */ dopADDCW, - /* 0x95 */ dopMULUW, - /* 0x96 */ dopMULUX, - /* 0x97 */ dopSET1, - /* 0x98 */ dopSUBCB, - /* 0x99 */ dopROTCB, - /* 0x9A */ dopSUBCH, - /* 0x9B */ dopROTCH, - /* 0x9C */ dopSUBCW, - /* 0x9D */ dopROTCW, - /* 0x9E */ dopUNHANDLED, - /* 0x9F */ dopUNHANDLED, - /* 0xA0 */ dopANDB, - /* 0xA1 */ dopDIVB, - /* 0xA2 */ dopANDH, - /* 0xA3 */ dopDIVH, - /* 0xA4 */ dopANDW, - /* 0xA5 */ dopDIVW, - /* 0xA6 */ dopDIVX, - /* 0xA7 */ dopCLR1, - /* 0xA8 */ dopSUBB, - /* 0xA9 */ dopSHLB, - /* 0xAA */ dopSUBH, - /* 0xAB */ dopSHLH, - /* 0xAC */ dopSUBW, - /* 0xAD */ dopSHLW, - /* 0xAE */ dopUNHANDLED, - /* 0xAF */ dopUNHANDLED, - /* 0xB0 */ dopXORB, - /* 0xB1 */ dopDIVUB, - /* 0xB2 */ dopXORH, - /* 0xB3 */ dopDIVUH, - /* 0xB4 */ dopXORW, - /* 0xB5 */ dopDIVUW, - /* 0xB6 */ dopDIVUX, - /* 0xB7 */ dopNOT1, - /* 0xB8 */ dopCMPB, - /* 0xB9 */ dopSHAB, - /* 0xBA */ dopCMPH, - /* 0xBB */ dopSHAH, - /* 0xBC */ dopCMPW, - /* 0xBD */ dopSHAW, - /* 0xBE */ dopUNHANDLED, - /* 0xBF */ dopUNHANDLED, - /* 0xC0 */ dopUNHANDLED, - /* 0xC1 */ dopUNHANDLED, - /* 0xC2 */ dopUNHANDLED, - /* 0xC3 */ dopUNHANDLED, - /* 0xC4 */ dopUNHANDLED, - /* 0xC5 */ dopUNHANDLED, - /* 0xC6 */ dopC6, - /* 0xC7 */ dopC7, - /* 0xC8 */ dopBRK, - /* 0xC9 */ dopBRKV, - /* 0xCA */ dopRSR, - /* 0xCB */ dopTRAPFL, - /* 0xCC */ dopDISPOSE, - /* 0xCD */ dopNOP, - /* 0xCE */ dopUNHANDLED, - /* 0xCF */ dopUNHANDLED, - /* 0xD0 */ dopDECB, - /* 0xD1 */ dopDECB, - /* 0xD2 */ dopDECH, - /* 0xD3 */ dopDECH, - /* 0xD4 */ dopDECW, - /* 0xD5 */ dopDECW, - /* 0xD6 */ dopJMP, - /* 0xD7 */ dopJMP, - /* 0xD8 */ dopINCB, - /* 0xD9 */ dopINCB, - /* 0xDA */ dopINCH, - /* 0xDB */ dopINCH, - /* 0xDC */ dopINCW, - /* 0xDD */ dopINCW, - /* 0xDE */ dopPREPARE, - /* 0xDF */ dopPREPARE, - /* 0xE0 */ dopTASI, - /* 0xE1 */ dopTASI, - /* 0xE2 */ dopRET, - /* 0xE3 */ dopRET, - /* 0xE4 */ dopPOPM, - /* 0xE5 */ dopPOPM, - /* 0xE6 */ dopPOP, - /* 0xE7 */ dopPOP, - /* 0xE8 */ dopJSR, - /* 0xE9 */ dopJSR, - /* 0xEA */ dopRETIU, - /* 0xEB */ dopRETIU, - /* 0xEC */ dopPUSHM, - /* 0xED */ dopPUSHM, - /* 0xEE */ dopPUSH, - /* 0xEF */ dopPUSH, - /* 0xF0 */ dopTESTB, - /* 0xF1 */ dopTESTB, - /* 0xF2 */ dopTESTH, - /* 0xF3 */ dopTESTH, - /* 0xF4 */ dopTESTW, - /* 0xF5 */ dopTESTW, - /* 0xF6 */ dopGETPSW, - /* 0xF7 */ dopGETPSW, - /* 0xF8 */ dopTRAP, - /* 0xF9 */ dopTRAP, - /* 0xFA */ dopRETIS, - /* 0xFB */ dopRETIS, - /* 0xFC */ dopSTTASK, - /* 0xFD */ dopSTTASK, - /* 0xFE */ dopCLRTLB, - /* 0xFF */ dopCLRTLB -}; - -#ifdef MAME_DEBUG -offs_t v60_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) -{ - rombase = oprom; - pcbase = pc; - return dasm_optable[oprom[0]](pc, pc+1, buffer) | DASMFLAG_SUPPORTED; -} - -offs_t v70_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) -{ - rombase = oprom; - pcbase = pc; - return dasm_optable[oprom[0]](pc, pc+1, buffer) | DASMFLAG_SUPPORTED; -} -#endif diff --git a/jan/src/cpu/v60/v60mem.c b/jan/src/cpu/v60/v60mem.c deleted file mode 100644 index 65dbdd9b1..000000000 --- a/jan/src/cpu/v60/v60mem.c +++ /dev/null @@ -1,363 +0,0 @@ - -/*****************************************************************/ -/* Memory accesses for 16-bit data bus, 24-bit address bus (V60) */ -/*****************************************************************/ - -#define MemRead8_16 program_read_byte_16le -#define MemWrite8_16 program_write_byte_16le - -static UINT16 MemRead16_16(offs_t address) -{ - if (!(address & 1)) - return program_read_word_16le(address); - else - { - UINT16 result = program_read_byte_16le(address); - return result | program_read_byte_16le(address + 1) << 8; - } -} - -static void MemWrite16_16(offs_t address, UINT16 data) -{ - if (!(address & 1)) - program_write_word_16le(address, data); - else - { - program_write_byte_16le(address, data); - program_write_byte_16le(address + 1, data >> 8); - } -} - -static UINT32 MemRead32_16(offs_t address) -{ - if (!(address & 1)) - { - UINT32 result = program_read_word_16le(address); - return result | (program_read_word_16le(address + 2) << 16); - } - else - { - UINT32 result = program_read_byte_16le(address); - result |= program_read_word_16le(address + 1) << 8; - return result | program_read_byte_16le(address + 3) << 24; - } -} - -static void MemWrite32_16(offs_t address, UINT32 data) -{ - if (!(address & 1)) - { - program_write_word_16le(address, data); - program_write_word_16le(address + 2, data >> 16); - } - else - { - program_write_byte_16le(address, data); - program_write_word_16le(address + 1, data >> 8); - program_write_byte_16le(address + 3, data >> 24); - } -} - - -/***************************************************************/ -/* Port accesses for 16-bit data bus, 24-bit address bus (V60) */ -/***************************************************************/ - -#define PortRead8_16 io_read_byte_16le -#define PortWrite8_16 io_write_byte_16le - -static UINT16 PortRead16_16(offs_t address) -{ - if (!(address & 1)) - return io_read_word_16le(address); - else - { - UINT16 result = io_read_byte_16le(address); - return result | io_read_byte_16le(address + 1) << 8; - } -} - -static void PortWrite16_16(offs_t address, UINT16 data) -{ - if (!(address & 1)) - io_write_word_16le(address, data); - else - { - io_write_byte_16le(address, data); - io_write_byte_16le(address + 1, data >> 8); - } -} - -static UINT32 PortRead32_16(offs_t address) -{ - if (!(address & 1)) - { - UINT32 result = io_read_word_16le(address); - return result | (io_read_word_16le(address + 2) << 16); - } - else - { - UINT32 result = io_read_byte_16le(address); - result |= io_read_word_16le(address + 1) << 8; - return result | io_read_byte_16le(address + 3) << 24; - } -} - -static void PortWrite32_16(offs_t address, UINT32 data) -{ - if (!(address & 1)) - { - io_write_word_16le(address, data); - io_write_word_16le(address + 2, data >> 16); - } - else - { - io_write_byte_16le(address, data); - io_write_word_16le(address + 1, data >> 8); - io_write_byte_16le(address + 3, data >> 24); - } -} - - - -/*****************************************************************/ -/* Opcode accesses for 16-bit data bus, 24-bit address bus (V60) */ -/*****************************************************************/ - -static UINT8 OpRead8_16(offs_t address) -{ - return cpu_readop(BYTE_XOR_LE(address)); -} - -static UINT16 OpRead16_16(offs_t address) -{ - return cpu_readop(BYTE_XOR_LE(address)) | (cpu_readop(BYTE_XOR_LE(address+1)) << 8); -} - -static UINT32 OpRead32_16(offs_t address) -{ - return cpu_readop(BYTE_XOR_LE(address)) | (cpu_readop(BYTE_XOR_LE(address+1)) << 8) | - (cpu_readop(BYTE_XOR_LE(address+2)) << 16) | (cpu_readop(BYTE_XOR_LE(address+3)) << 24); -} - -static void ChangePC_16(offs_t pc) -{ - change_pc(pc); -} - - - -/*****************************************************************/ -/* Memory accesses for 32-bit data bus, 32-bit address bus (V70) */ -/*****************************************************************/ - -#define MemRead8_32 program_read_byte_32le -#define MemWrite8_32 program_write_byte_32le - -static UINT16 MemRead16_32(offs_t address) -{ - if (!(address & 1)) - return program_read_word_32le(address); - else - { - UINT16 result = program_read_byte_32le(address); - return result | program_read_byte_32le(address + 1) << 8; - } -} - -static void MemWrite16_32(offs_t address, UINT16 data) -{ - if (!(address & 1)) - program_write_word_32le(address, data); - else - { - program_write_byte_32le(address, data); - program_write_byte_32le(address + 1, data >> 8); - } -} - -static UINT32 MemRead32_32(offs_t address) -{ - if (!(address & 3)) - return program_read_dword_32le(address); - else if (!(address & 1)) - { - UINT32 result = program_read_word_32le(address); - return result | (program_read_word_32le(address + 2) << 16); - } - else - { - UINT32 result = program_read_byte_32le(address); - result |= program_read_word_32le(address + 1) << 8; - return result | program_read_byte_32le(address + 3) << 24; - } -} - -static void MemWrite32_32(offs_t address, UINT32 data) -{ - if (!(address & 3)) - program_write_dword_32le(address, data); - else if (!(address & 1)) - { - program_write_word_32le(address, data); - program_write_word_32le(address + 2, data >> 16); - } - else - { - program_write_byte_32le(address, data); - program_write_word_32le(address + 1, data >> 8); - program_write_byte_32le(address + 3, data >> 24); - } -} - - - -/***************************************************************/ -/* Port accesses for 32-bit data bus, 32-bit address bus (V70) */ -/***************************************************************/ - -#define PortRead8_32 io_read_byte_32le -#define PortWrite8_32 io_write_byte_32le - -static UINT16 PortRead16_32(offs_t address) -{ - if (!(address & 1)) - { - return io_read_word_32le(address); - } - else - { - UINT16 result = io_read_byte_32le(address); - return result | io_read_byte_32le(address + 1) << 8; - } -} - -static void PortWrite16_32(offs_t address, UINT16 data) -{ - if (!(address & 1)) - { - io_write_word_32le(address, data); - } - else - { - io_write_byte_32le(address, data); - io_write_byte_32le(address + 1, data >> 8); - } -} - -static UINT32 PortRead32_32(offs_t address) -{ - if (!(address & 3)) - return io_read_dword_32le(address); - else if (!(address & 1)) - { - UINT32 result = io_read_word_32le(address); - return result | (io_read_word_32le(address + 2) << 16); - } - else - { - UINT32 result = io_read_byte_32le(address); - result |= io_read_word_32le(address + 1) << 8; - return result | io_read_byte_32le(address + 3) << 24; - } -} - -static void PortWrite32_32(offs_t address, UINT32 data) -{ - if (!(address & 3)) - io_write_dword_32le(address, data); - else if (!(address & 1)) - { - io_write_word_32le(address, data); - io_write_word_32le(address + 2, data >> 16); - } - else - { - io_write_byte_32le(address, data); - io_write_word_32le(address + 1, data >> 8); - io_write_byte_32le(address + 3, data >> 24); - } -} - - - -/*****************************************************************/ -/* Opcode accesses for 32-bit data bus, 32-bit address bus (V60) */ -/*****************************************************************/ - -static UINT8 OpRead8_32(offs_t address) -{ - return cpu_readop(BYTE4_XOR_LE(address)); -} - -static UINT16 OpRead16_32(offs_t address) -{ - return cpu_readop(BYTE4_XOR_LE(address)) | (cpu_readop(BYTE4_XOR_LE(address+1)) << 8); -} - -static UINT32 OpRead32_32(offs_t address) -{ - return cpu_readop(BYTE4_XOR_LE(address)) | (cpu_readop(BYTE4_XOR_LE(address+1)) << 8) | - (cpu_readop(BYTE4_XOR_LE(address+2)) << 16) | (cpu_readop(BYTE4_XOR_LE(address+3)) << 24); -} - -static void ChangePC_32(offs_t pc) -{ - change_pc(pc); -} - - - -/************************************************/ -/* Structures pointing to various I/O functions */ -/************************************************/ - -static struct cpu_info v60_i = -{ - MemRead8_16, MemWrite8_16, MemRead16_16, MemWrite16_16, MemRead32_16, MemWrite32_16, - PortRead8_16, PortWrite8_16, PortRead16_16, PortWrite16_16, PortRead32_16, PortWrite32_16, - OpRead8_16, OpRead16_16, OpRead32_16, - ChangePC_16, - 0xfffff0 -}; - -static struct cpu_info v70_i = -{ - MemRead8_32, MemWrite8_32, MemRead16_32, MemWrite16_32, MemRead32_32, MemWrite32_32, - PortRead8_32, PortWrite8_32, PortRead16_32, PortWrite16_32, PortRead32_32, PortWrite32_32, - OpRead8_32, OpRead16_32, OpRead32_32, - ChangePC_32, - 0xfffffff0 -}; - - - -/**************************************/ -/* Macro shorthands for I/O functions */ -/**************************************/ - -#define MemRead8 v60.info.mr8 -#define MemWrite8 v60.info.mw8 -#define MemRead16 v60.info.mr16 -#define MemWrite16 v60.info.mw16 -#define MemRead32 v60.info.mr32 -#define MemWrite32 v60.info.mw32 - -#define PortRead8 v60.info.pr8 -#define PortWrite8 v60.info.pw8 -#define PortRead16 v60.info.pr16 -#define PortWrite16 v60.info.pw16 -#define PortRead32 v60.info.pr32 -#define PortWrite32 v60.info.pw32 - -#if defined(LSB_FIRST) && !defined(ALIGN_INTS) -#define OpRead8(a) (cpu_readop(a)) -#define OpRead16(a) (cpu_readop16(a)) -#define OpRead32(a) (cpu_readop32(a)) -#else -#define OpRead8 v60.info.mr8 -#define OpRead16 v60.info.mr16 -#define OpRead32 v60.info.mr32 -#endif - -#define ChangePC v60.info.chpc diff --git a/jan/src/cpu/v60_intf.h b/jan/src/cpu/v60_intf.h deleted file mode 100644 index 9d9f0f7c5..000000000 --- a/jan/src/cpu/v60_intf.h +++ /dev/null @@ -1,27 +0,0 @@ -#include "v60.h" - -void v60Init(); -void v70Init(); - -void v60Exit(); -void v60Reset(); -void v60Open(int cpu); -void v60Close(); - -INT32 v60Run(int cycles); - -void v60SetIRQLine(INT32 irqline, INT32 state); - -void v60SetIRQCallback(int (*callback)(int irqline)); -void v60SetWriteByteHandler(void (*write)(UINT32,UINT8)); -void v60SetWriteWordHandler(void (*write)(UINT32,UINT16)); -void v60SetReadByteHandler(UINT8 (*read)(UINT32)); -void v60SetReadWordHandler(UINT16 (*read)(UINT32)); -void v60MapMemory(UINT8 *ptr, UINT32 start, UINT32 end, UINT32 flags); - -INT32 v60TotalCycles(); -void v60RunEnd(); -void v60NewFrame(); -INT32 v60GetActive(); - -INT32 v60Scan(INT32 nAction); diff --git a/jan/src/cpu/z80/z80.cpp b/jan/src/cpu/z80/z80.cpp deleted file mode 100644 index 4be04d808..000000000 --- a/jan/src/cpu/z80/z80.cpp +++ /dev/null @@ -1,4161 +0,0 @@ -/***************************************************************************** - * - * z80.c - * Portable Z80 emulator V3.5 - * - * Copyright Juergen Buchmueller, all rights reserved. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * pullmoll@t-online.de - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * - * Changes in 3.7 [Aaron Giles] - * - Changed NMI handling. NMIs are now latched in set_irq_state - * but are not taken there. Instead they are taken at the start of the - * execute loop. - * - Changed IRQ handling. IRQ state is set in set_irq_state but not taken - * except during the inner execute loop. - * - Removed x86 assembly hacks and obsolete timing loop catchers. - * Changes in 3.6 - * - Got rid of the code that would inexactly emulate a Z80, i.e. removed - * all the #if Z80_EXACT #else branches. - * - Removed leading underscores from local register name shortcuts as - * this violates the C99 standard. - * - Renamed the registers inside the Z80 context to lower case to avoid - * ambiguities (shortcuts would have had the same names as the fields - * of the structure). - * Changes in 3.5 - * - Implemented OTIR, INIR, etc. without look-up table for PF flag. - * [Ramsoft, Sean Young] - * Changes in 3.4 - * - Removed Z80-MSX specific code as it's not needed any more. - * - Implemented DAA without look-up table [Ramsoft, Sean Young] - * Changes in 3.3 - * - Fixed undocumented flags XF & YF in the non-asm versions of CP, - * and all the 16 bit arithmetic instructions. [Sean Young] - * Changes in 3.2 - * - Fixed undocumented flags XF & YF of RRCA, and CF and HF of - * INI/IND/OUTI/OUTD/INIR/INDR/OTIR/OTDR [Sean Young] - * Changes in 3.1 - * - removed the REPEAT_AT_ONCE execution of LDIR/CPIR etc. opcodes - * for readabilities sake and because the implementation was buggy - * (and I was not able to find the difference) - * Changes in 3.0 - * - 'finished' switch to dynamically overrideable cycle count tables - * Changes in 2.9: - * - added methods to access and override the cycle count tables - * - fixed handling and timing of multiple DD/FD prefixed opcodes - * Changes in 2.8: - * - OUTI/OUTD/OTIR/OTDR also pre-decrement the B register now. - * This was wrong because of a bug fix on the wrong side - * (astrocade sound driver). - * Changes in 2.7: - * - removed z80_vm specific code, it's not needed (and never was). - * Changes in 2.6: - * - BUSY_LOOP_HACKS needed to call change_pc() earlier, before - * checking the opcodes at the new address, because otherwise they - * might access the old (wrong or even NULL) banked memory region. - * Thanks to Sean Young for finding this nasty bug. - * Changes in 2.5: - * - Burning cycles always adjusts the ICount by a multiple of 4. - * - In REPEAT_AT_ONCE cases the R register wasn't incremented twice - * per repetition as it should have been. Those repeated opcodes - * could also underflow the ICount. - * - Simplified TIME_LOOP_HACKS for BC and added two more for DE + HL - * timing loops. I think those hacks weren't endian safe before too. - * Changes in 2.4: - * - z80_reset zaps the entire context, sets IX and IY to 0xffff(!) and - * sets the Z flag. With these changes the Tehkan World Cup driver - * _seems_ to work again. - * Changes in 2.3: - * - External termination of the execution loop calls z80_burn() and - * z80_vm_burn() to burn an amount of cycles (R adjustment) - * - Shortcuts which burn CPU cycles (BUSY_LOOP_HACKS and TIME_LOOP_HACKS) - * now also adjust the R register depending on the skipped opcodes. - * Changes in 2.2: - * - Fixed bugs in CPL, SCF and CCF instructions flag handling. - * - Changed variable EA and ARG16() function to UINT32; this - * produces slightly more efficient code. - * - The DD/FD XY CB opcodes where XY is 40-7F and Y is not 6/E - * are changed to calls to the X6/XE opcodes to reduce object size. - * They're hardly ever used so this should not yield a speed penalty. - * New in 2.0: - * - Optional more exact Z80 emulation (#define Z80_EXACT 1) according - * to a detailed description by Sean Young which can be found at: - * http://www.msxnet.org/tech/z80-documented.pdf - *****************************************************************************/ - -#include "burnint.h" -#include "z80.h" -#include "z80daisy.h" - -#define FALSE 0 -#define TRUE 1 -#define Z80_INLINE static -#define change_pc(newpc) Z80.pc.w.l = (newpc) - -static Z80ReadIoHandler Z80IORead; -static Z80WriteIoHandler Z80IOWrite; -static Z80ReadProgHandler Z80ProgramRead; -static Z80WriteProgHandler Z80ProgramWrite; -static Z80ReadOpHandler Z80CPUReadOp; -static Z80ReadOpArgHandler Z80CPUReadOpArg; - -unsigned char Z80Vector = 0xff; - -#define VERBOSE 0 - -#define LOG(x) //do { if (VERBOSE) logerror x; } while (0) - -/* execute main opcodes inside a big switch statement */ -#ifndef BIG_SWITCH -#define BIG_SWITCH 1 -#endif - -/* big flags array for ADD/ADC/SUB/SBC/CP results */ -#define BIG_FLAGS_ARRAY 1 - -/* on JP and JR opcodes check for tight loops */ -#define BUSY_LOOP_HACKS 1 - - -/****************************************************************************/ -/* The Z80 registers. HALT is set to 1 when the CPU is halted, the refresh */ -/* register is calculated as follows: refresh=(Z80.r&127)|(Z80.r2&128) */ -/****************************************************************************/ -#define CF 0x01 -#define NF 0x02 -#define PF 0x04 -#define VF PF -#define XF 0x08 -#define HF 0x10 -#define YF 0x20 -#define ZF 0x40 -#define SF 0x80 - -#define INT_IRQ 0x01 -#define NMI_IRQ 0x02 - -#define PRVPC Z80.prvpc.d /* previous program counter */ - -#define PCD Z80.pc.d -#define PC Z80.pc.w.l - -#define SPD Z80.sp.d -#define SP Z80.sp.w.l - -#define AFD Z80.af.d -#define AF Z80.af.w.l -#define A Z80.af.b.h -#define F Z80.af.b.l - -#define BCD Z80.bc.d -#define BC Z80.bc.w.l -#define B Z80.bc.b.h -#define C Z80.bc.b.l - -#define DED Z80.de.d -#define DE Z80.de.w.l -#define D Z80.de.b.h -#define E Z80.de.b.l - -#define HLD Z80.hl.d -#define HL Z80.hl.w.l -#define H Z80.hl.b.h -#define L Z80.hl.b.l - -#define IXD Z80.ix.d -#define IX Z80.ix.w.l -#define HX Z80.ix.b.h -#define LX Z80.ix.b.l - -#define IYD Z80.iy.d -#define IY Z80.iy.w.l -#define HY Z80.iy.b.h -#define LY Z80.iy.b.l - -#define I Z80.i -#define R Z80.r -#define R2 Z80.r2 -#define IM Z80.im -#define IFF1 Z80.iff1 -#define IFF2 Z80.iff2 -#define HALT Z80.halt - -int z80_ICount; -static INT32 end_run; -static Z80_Regs Z80; -UINT32 EA; - -void (*z80edfe_callback)(Z80_Regs *Regs) = NULL; - -static UINT8 SZ[256]; /* zero and sign flags */ -static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ -static UINT8 SZP[256]; /* zero, sign and parity flags */ -static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ -static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ - -#if BIG_FLAGS_ARRAY -static UINT8 *SZHVC_add = 0; -static UINT8 *SZHVC_sub = 0; -#endif - -static const UINT8 cc_op[0x100] = { - 4,10, 7, 6, 4, 4, 7, 4, 4,11, 7, 6, 4, 4, 7, 4, - 8,10, 7, 6, 4, 4, 7, 4,12,11, 7, 6, 4, 4, 7, 4, - 7,10,16, 6, 4, 4, 7, 4, 7,11,16, 6, 4, 4, 7, 4, - 7,10,13, 6,11,11,10, 4, 7,11,13, 6, 4, 4, 7, 4, - 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, - 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, - 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, - 7, 7, 7, 7, 7, 7, 4, 7, 4, 4, 4, 4, 4, 4, 7, 4, - 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, - 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, - 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, - 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, - 5,10,10,10,10,11, 7,11, 5,10,10, 0,10,17, 7,11, - 5,10,10,11,10,11, 7,11, 5, 4,10,11,10, 0, 7,11, - 5,10,10,19,10,11, 7,11, 5, 4,10, 4,10, 0, 7,11, - 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 0, 7,11}; - -static const UINT8 cc_cb[0x100] = { - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, - 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, - 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, - 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8}; - -static const UINT8 cc_ed[0x100] = { - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, -12,12,15,20, 8,14, 8, 9,12,12,15,20, 8,14, 8, 9, -12,12,15,20, 8,14, 8, 9,12,12,15,20, 8,14, 8, 9, -12,12,15,20, 8,14, 8,18,12,12,15,20, 8,14, 8,18, -12,12,15,20, 8,14, 8, 8,12,12,15,20, 8,14, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, -16,16,16,16, 8, 8, 8, 8,16,16,16,16, 8, 8, 8, 8, -16,16,16,16, 8, 8, 8, 8,16,16,16,16, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}; - -static const UINT8 cc_xy[0x100] = { - 4, 4, 4, 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, - 4,14,20,10, 9, 9, 9, 4, 4,15,20,10, 9, 9, 9, 4, - 4, 4, 4, 4,23,23,19, 4, 4,15, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, - 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, - 9, 9, 9, 9, 9, 9,19, 9, 9, 9, 9, 9, 9, 9,19, 9, -19,19,19,19,19,19, 4,19, 4, 4, 4, 4, 9, 9,19, 4, - 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, - 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, - 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, - 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4,14, 4,23, 4,15, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4,10, 4, 4, 4, 4, 4, 4}; - -static const UINT8 cc_xycb[0x100] = { -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, -20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, -20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, -20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23}; - -/* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ -static const UINT8 cc_ex[0x100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* DJNZ */ - 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, /* JR NZ/JR Z */ - 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, /* JR NC/JR C */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, /* LDIR/CPIR/INIR/OTIR LDDR/CPDR/INDR/OTDR */ - 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, - 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, - 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, - 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2}; - -static const UINT8 *cc[6]; -#define Z80_TABLE_dd Z80_TABLE_xy -#define Z80_TABLE_fd Z80_TABLE_xy - -static void take_interrupt(void); -//void Z80Burn(int cycles); - -typedef void (*funcptr)(void); - -#define PROTOTYPES(tablename,prefix) \ - Z80_INLINE void prefix##_00(void); Z80_INLINE void prefix##_01(void); Z80_INLINE void prefix##_02(void); Z80_INLINE void prefix##_03(void); \ - Z80_INLINE void prefix##_04(void); Z80_INLINE void prefix##_05(void); Z80_INLINE void prefix##_06(void); Z80_INLINE void prefix##_07(void); \ - Z80_INLINE void prefix##_08(void); Z80_INLINE void prefix##_09(void); Z80_INLINE void prefix##_0a(void); Z80_INLINE void prefix##_0b(void); \ - Z80_INLINE void prefix##_0c(void); Z80_INLINE void prefix##_0d(void); Z80_INLINE void prefix##_0e(void); Z80_INLINE void prefix##_0f(void); \ - Z80_INLINE void prefix##_10(void); Z80_INLINE void prefix##_11(void); Z80_INLINE void prefix##_12(void); Z80_INLINE void prefix##_13(void); \ - Z80_INLINE void prefix##_14(void); Z80_INLINE void prefix##_15(void); Z80_INLINE void prefix##_16(void); Z80_INLINE void prefix##_17(void); \ - Z80_INLINE void prefix##_18(void); Z80_INLINE void prefix##_19(void); Z80_INLINE void prefix##_1a(void); Z80_INLINE void prefix##_1b(void); \ - Z80_INLINE void prefix##_1c(void); Z80_INLINE void prefix##_1d(void); Z80_INLINE void prefix##_1e(void); Z80_INLINE void prefix##_1f(void); \ - Z80_INLINE void prefix##_20(void); Z80_INLINE void prefix##_21(void); Z80_INLINE void prefix##_22(void); Z80_INLINE void prefix##_23(void); \ - Z80_INLINE void prefix##_24(void); Z80_INLINE void prefix##_25(void); Z80_INLINE void prefix##_26(void); Z80_INLINE void prefix##_27(void); \ - Z80_INLINE void prefix##_28(void); Z80_INLINE void prefix##_29(void); Z80_INLINE void prefix##_2a(void); Z80_INLINE void prefix##_2b(void); \ - Z80_INLINE void prefix##_2c(void); Z80_INLINE void prefix##_2d(void); Z80_INLINE void prefix##_2e(void); Z80_INLINE void prefix##_2f(void); \ - Z80_INLINE void prefix##_30(void); Z80_INLINE void prefix##_31(void); Z80_INLINE void prefix##_32(void); Z80_INLINE void prefix##_33(void); \ - Z80_INLINE void prefix##_34(void); Z80_INLINE void prefix##_35(void); Z80_INLINE void prefix##_36(void); Z80_INLINE void prefix##_37(void); \ - Z80_INLINE void prefix##_38(void); Z80_INLINE void prefix##_39(void); Z80_INLINE void prefix##_3a(void); Z80_INLINE void prefix##_3b(void); \ - Z80_INLINE void prefix##_3c(void); Z80_INLINE void prefix##_3d(void); Z80_INLINE void prefix##_3e(void); Z80_INLINE void prefix##_3f(void); \ - Z80_INLINE void prefix##_40(void); Z80_INLINE void prefix##_41(void); Z80_INLINE void prefix##_42(void); Z80_INLINE void prefix##_43(void); \ - Z80_INLINE void prefix##_44(void); Z80_INLINE void prefix##_45(void); Z80_INLINE void prefix##_46(void); Z80_INLINE void prefix##_47(void); \ - Z80_INLINE void prefix##_48(void); Z80_INLINE void prefix##_49(void); Z80_INLINE void prefix##_4a(void); Z80_INLINE void prefix##_4b(void); \ - Z80_INLINE void prefix##_4c(void); Z80_INLINE void prefix##_4d(void); Z80_INLINE void prefix##_4e(void); Z80_INLINE void prefix##_4f(void); \ - Z80_INLINE void prefix##_50(void); Z80_INLINE void prefix##_51(void); Z80_INLINE void prefix##_52(void); Z80_INLINE void prefix##_53(void); \ - Z80_INLINE void prefix##_54(void); Z80_INLINE void prefix##_55(void); Z80_INLINE void prefix##_56(void); Z80_INLINE void prefix##_57(void); \ - Z80_INLINE void prefix##_58(void); Z80_INLINE void prefix##_59(void); Z80_INLINE void prefix##_5a(void); Z80_INLINE void prefix##_5b(void); \ - Z80_INLINE void prefix##_5c(void); Z80_INLINE void prefix##_5d(void); Z80_INLINE void prefix##_5e(void); Z80_INLINE void prefix##_5f(void); \ - Z80_INLINE void prefix##_60(void); Z80_INLINE void prefix##_61(void); Z80_INLINE void prefix##_62(void); Z80_INLINE void prefix##_63(void); \ - Z80_INLINE void prefix##_64(void); Z80_INLINE void prefix##_65(void); Z80_INLINE void prefix##_66(void); Z80_INLINE void prefix##_67(void); \ - Z80_INLINE void prefix##_68(void); Z80_INLINE void prefix##_69(void); Z80_INLINE void prefix##_6a(void); Z80_INLINE void prefix##_6b(void); \ - Z80_INLINE void prefix##_6c(void); Z80_INLINE void prefix##_6d(void); Z80_INLINE void prefix##_6e(void); Z80_INLINE void prefix##_6f(void); \ - Z80_INLINE void prefix##_70(void); Z80_INLINE void prefix##_71(void); Z80_INLINE void prefix##_72(void); Z80_INLINE void prefix##_73(void); \ - Z80_INLINE void prefix##_74(void); Z80_INLINE void prefix##_75(void); Z80_INLINE void prefix##_76(void); Z80_INLINE void prefix##_77(void); \ - Z80_INLINE void prefix##_78(void); Z80_INLINE void prefix##_79(void); Z80_INLINE void prefix##_7a(void); Z80_INLINE void prefix##_7b(void); \ - Z80_INLINE void prefix##_7c(void); Z80_INLINE void prefix##_7d(void); Z80_INLINE void prefix##_7e(void); Z80_INLINE void prefix##_7f(void); \ - Z80_INLINE void prefix##_80(void); Z80_INLINE void prefix##_81(void); Z80_INLINE void prefix##_82(void); Z80_INLINE void prefix##_83(void); \ - Z80_INLINE void prefix##_84(void); Z80_INLINE void prefix##_85(void); Z80_INLINE void prefix##_86(void); Z80_INLINE void prefix##_87(void); \ - Z80_INLINE void prefix##_88(void); Z80_INLINE void prefix##_89(void); Z80_INLINE void prefix##_8a(void); Z80_INLINE void prefix##_8b(void); \ - Z80_INLINE void prefix##_8c(void); Z80_INLINE void prefix##_8d(void); Z80_INLINE void prefix##_8e(void); Z80_INLINE void prefix##_8f(void); \ - Z80_INLINE void prefix##_90(void); Z80_INLINE void prefix##_91(void); Z80_INLINE void prefix##_92(void); Z80_INLINE void prefix##_93(void); \ - Z80_INLINE void prefix##_94(void); Z80_INLINE void prefix##_95(void); Z80_INLINE void prefix##_96(void); Z80_INLINE void prefix##_97(void); \ - Z80_INLINE void prefix##_98(void); Z80_INLINE void prefix##_99(void); Z80_INLINE void prefix##_9a(void); Z80_INLINE void prefix##_9b(void); \ - Z80_INLINE void prefix##_9c(void); Z80_INLINE void prefix##_9d(void); Z80_INLINE void prefix##_9e(void); Z80_INLINE void prefix##_9f(void); \ - Z80_INLINE void prefix##_a0(void); Z80_INLINE void prefix##_a1(void); Z80_INLINE void prefix##_a2(void); Z80_INLINE void prefix##_a3(void); \ - Z80_INLINE void prefix##_a4(void); Z80_INLINE void prefix##_a5(void); Z80_INLINE void prefix##_a6(void); Z80_INLINE void prefix##_a7(void); \ - Z80_INLINE void prefix##_a8(void); Z80_INLINE void prefix##_a9(void); Z80_INLINE void prefix##_aa(void); Z80_INLINE void prefix##_ab(void); \ - Z80_INLINE void prefix##_ac(void); Z80_INLINE void prefix##_ad(void); Z80_INLINE void prefix##_ae(void); Z80_INLINE void prefix##_af(void); \ - Z80_INLINE void prefix##_b0(void); Z80_INLINE void prefix##_b1(void); Z80_INLINE void prefix##_b2(void); Z80_INLINE void prefix##_b3(void); \ - Z80_INLINE void prefix##_b4(void); Z80_INLINE void prefix##_b5(void); Z80_INLINE void prefix##_b6(void); Z80_INLINE void prefix##_b7(void); \ - Z80_INLINE void prefix##_b8(void); Z80_INLINE void prefix##_b9(void); Z80_INLINE void prefix##_ba(void); Z80_INLINE void prefix##_bb(void); \ - Z80_INLINE void prefix##_bc(void); Z80_INLINE void prefix##_bd(void); Z80_INLINE void prefix##_be(void); Z80_INLINE void prefix##_bf(void); \ - Z80_INLINE void prefix##_c0(void); Z80_INLINE void prefix##_c1(void); Z80_INLINE void prefix##_c2(void); Z80_INLINE void prefix##_c3(void); \ - Z80_INLINE void prefix##_c4(void); Z80_INLINE void prefix##_c5(void); Z80_INLINE void prefix##_c6(void); Z80_INLINE void prefix##_c7(void); \ - Z80_INLINE void prefix##_c8(void); Z80_INLINE void prefix##_c9(void); Z80_INLINE void prefix##_ca(void); Z80_INLINE void prefix##_cb(void); \ - Z80_INLINE void prefix##_cc(void); Z80_INLINE void prefix##_cd(void); Z80_INLINE void prefix##_ce(void); Z80_INLINE void prefix##_cf(void); \ - Z80_INLINE void prefix##_d0(void); Z80_INLINE void prefix##_d1(void); Z80_INLINE void prefix##_d2(void); Z80_INLINE void prefix##_d3(void); \ - Z80_INLINE void prefix##_d4(void); Z80_INLINE void prefix##_d5(void); Z80_INLINE void prefix##_d6(void); Z80_INLINE void prefix##_d7(void); \ - Z80_INLINE void prefix##_d8(void); Z80_INLINE void prefix##_d9(void); Z80_INLINE void prefix##_da(void); Z80_INLINE void prefix##_db(void); \ - Z80_INLINE void prefix##_dc(void); Z80_INLINE void prefix##_dd(void); Z80_INLINE void prefix##_de(void); Z80_INLINE void prefix##_df(void); \ - Z80_INLINE void prefix##_e0(void); Z80_INLINE void prefix##_e1(void); Z80_INLINE void prefix##_e2(void); Z80_INLINE void prefix##_e3(void); \ - Z80_INLINE void prefix##_e4(void); Z80_INLINE void prefix##_e5(void); Z80_INLINE void prefix##_e6(void); Z80_INLINE void prefix##_e7(void); \ - Z80_INLINE void prefix##_e8(void); Z80_INLINE void prefix##_e9(void); Z80_INLINE void prefix##_ea(void); Z80_INLINE void prefix##_eb(void); \ - Z80_INLINE void prefix##_ec(void); Z80_INLINE void prefix##_ed(void); Z80_INLINE void prefix##_ee(void); Z80_INLINE void prefix##_ef(void); \ - Z80_INLINE void prefix##_f0(void); Z80_INLINE void prefix##_f1(void); Z80_INLINE void prefix##_f2(void); Z80_INLINE void prefix##_f3(void); \ - Z80_INLINE void prefix##_f4(void); Z80_INLINE void prefix##_f5(void); Z80_INLINE void prefix##_f6(void); Z80_INLINE void prefix##_f7(void); \ - Z80_INLINE void prefix##_f8(void); Z80_INLINE void prefix##_f9(void); Z80_INLINE void prefix##_fa(void); Z80_INLINE void prefix##_fb(void); \ - Z80_INLINE void prefix##_fc(void); Z80_INLINE void prefix##_fd(void); Z80_INLINE void prefix##_fe(void); Z80_INLINE void prefix##_ff(void); \ -static const funcptr tablename[0x100] = { \ - prefix##_00,prefix##_01,prefix##_02,prefix##_03,prefix##_04,prefix##_05,prefix##_06,prefix##_07, \ - prefix##_08,prefix##_09,prefix##_0a,prefix##_0b,prefix##_0c,prefix##_0d,prefix##_0e,prefix##_0f, \ - prefix##_10,prefix##_11,prefix##_12,prefix##_13,prefix##_14,prefix##_15,prefix##_16,prefix##_17, \ - prefix##_18,prefix##_19,prefix##_1a,prefix##_1b,prefix##_1c,prefix##_1d,prefix##_1e,prefix##_1f, \ - prefix##_20,prefix##_21,prefix##_22,prefix##_23,prefix##_24,prefix##_25,prefix##_26,prefix##_27, \ - prefix##_28,prefix##_29,prefix##_2a,prefix##_2b,prefix##_2c,prefix##_2d,prefix##_2e,prefix##_2f, \ - prefix##_30,prefix##_31,prefix##_32,prefix##_33,prefix##_34,prefix##_35,prefix##_36,prefix##_37, \ - prefix##_38,prefix##_39,prefix##_3a,prefix##_3b,prefix##_3c,prefix##_3d,prefix##_3e,prefix##_3f, \ - prefix##_40,prefix##_41,prefix##_42,prefix##_43,prefix##_44,prefix##_45,prefix##_46,prefix##_47, \ - prefix##_48,prefix##_49,prefix##_4a,prefix##_4b,prefix##_4c,prefix##_4d,prefix##_4e,prefix##_4f, \ - prefix##_50,prefix##_51,prefix##_52,prefix##_53,prefix##_54,prefix##_55,prefix##_56,prefix##_57, \ - prefix##_58,prefix##_59,prefix##_5a,prefix##_5b,prefix##_5c,prefix##_5d,prefix##_5e,prefix##_5f, \ - prefix##_60,prefix##_61,prefix##_62,prefix##_63,prefix##_64,prefix##_65,prefix##_66,prefix##_67, \ - prefix##_68,prefix##_69,prefix##_6a,prefix##_6b,prefix##_6c,prefix##_6d,prefix##_6e,prefix##_6f, \ - prefix##_70,prefix##_71,prefix##_72,prefix##_73,prefix##_74,prefix##_75,prefix##_76,prefix##_77, \ - prefix##_78,prefix##_79,prefix##_7a,prefix##_7b,prefix##_7c,prefix##_7d,prefix##_7e,prefix##_7f, \ - prefix##_80,prefix##_81,prefix##_82,prefix##_83,prefix##_84,prefix##_85,prefix##_86,prefix##_87, \ - prefix##_88,prefix##_89,prefix##_8a,prefix##_8b,prefix##_8c,prefix##_8d,prefix##_8e,prefix##_8f, \ - prefix##_90,prefix##_91,prefix##_92,prefix##_93,prefix##_94,prefix##_95,prefix##_96,prefix##_97, \ - prefix##_98,prefix##_99,prefix##_9a,prefix##_9b,prefix##_9c,prefix##_9d,prefix##_9e,prefix##_9f, \ - prefix##_a0,prefix##_a1,prefix##_a2,prefix##_a3,prefix##_a4,prefix##_a5,prefix##_a6,prefix##_a7, \ - prefix##_a8,prefix##_a9,prefix##_aa,prefix##_ab,prefix##_ac,prefix##_ad,prefix##_ae,prefix##_af, \ - prefix##_b0,prefix##_b1,prefix##_b2,prefix##_b3,prefix##_b4,prefix##_b5,prefix##_b6,prefix##_b7, \ - prefix##_b8,prefix##_b9,prefix##_ba,prefix##_bb,prefix##_bc,prefix##_bd,prefix##_be,prefix##_bf, \ - prefix##_c0,prefix##_c1,prefix##_c2,prefix##_c3,prefix##_c4,prefix##_c5,prefix##_c6,prefix##_c7, \ - prefix##_c8,prefix##_c9,prefix##_ca,prefix##_cb,prefix##_cc,prefix##_cd,prefix##_ce,prefix##_cf, \ - prefix##_d0,prefix##_d1,prefix##_d2,prefix##_d3,prefix##_d4,prefix##_d5,prefix##_d6,prefix##_d7, \ - prefix##_d8,prefix##_d9,prefix##_da,prefix##_db,prefix##_dc,prefix##_dd,prefix##_de,prefix##_df, \ - prefix##_e0,prefix##_e1,prefix##_e2,prefix##_e3,prefix##_e4,prefix##_e5,prefix##_e6,prefix##_e7, \ - prefix##_e8,prefix##_e9,prefix##_ea,prefix##_eb,prefix##_ec,prefix##_ed,prefix##_ee,prefix##_ef, \ - prefix##_f0,prefix##_f1,prefix##_f2,prefix##_f3,prefix##_f4,prefix##_f5,prefix##_f6,prefix##_f7, \ - prefix##_f8,prefix##_f9,prefix##_fa,prefix##_fb,prefix##_fc,prefix##_fd,prefix##_fe,prefix##_ff \ -} - -PROTOTYPES(Z80op,op); -PROTOTYPES(Z80cb,cb); -PROTOTYPES(Z80dd,dd); -PROTOTYPES(Z80ed,ed); -PROTOTYPES(Z80fd,fd); -PROTOTYPES(Z80xycb,xycb); - -/****************************************************************************/ -/* Burn an odd amount of cycles, that is instructions taking something */ -/* different from 4 T-states per opcode (and R increment) */ -/****************************************************************************/ -Z80_INLINE void BURNODD(int cycles, int opcodes, int cyclesum) -{ - if( cycles > 0 ) - { - R += (cycles / cyclesum) * opcodes; - z80_ICount -= (cycles / cyclesum) * cyclesum; - } -} - -/*************************************************************** - * define an opcode function - ***************************************************************/ -#define OP(prefix,opcode) Z80_INLINE void prefix##_##opcode(void) - -/*************************************************************** - * adjust cycle count by n T-states - ***************************************************************/ -#define CC(prefix,opcode) z80_ICount -= cc[Z80_TABLE_##prefix][opcode] - -/*************************************************************** - * execute an opcode - ***************************************************************/ -#define EXEC(prefix,opcode) \ -{ \ - unsigned op = opcode; \ - CC(prefix,op); \ - (*Z80##prefix[op])(); \ -} - -#if BIG_SWITCH -#define EXEC_INLINE(prefix,opcode) \ -{ \ - unsigned op = opcode; \ - CC(prefix,op); \ - switch(op) \ - { \ - case 0x00:prefix##_##00();break; case 0x01:prefix##_##01();break; case 0x02:prefix##_##02();break; case 0x03:prefix##_##03();break; \ - case 0x04:prefix##_##04();break; case 0x05:prefix##_##05();break; case 0x06:prefix##_##06();break; case 0x07:prefix##_##07();break; \ - case 0x08:prefix##_##08();break; case 0x09:prefix##_##09();break; case 0x0a:prefix##_##0a();break; case 0x0b:prefix##_##0b();break; \ - case 0x0c:prefix##_##0c();break; case 0x0d:prefix##_##0d();break; case 0x0e:prefix##_##0e();break; case 0x0f:prefix##_##0f();break; \ - case 0x10:prefix##_##10();break; case 0x11:prefix##_##11();break; case 0x12:prefix##_##12();break; case 0x13:prefix##_##13();break; \ - case 0x14:prefix##_##14();break; case 0x15:prefix##_##15();break; case 0x16:prefix##_##16();break; case 0x17:prefix##_##17();break; \ - case 0x18:prefix##_##18();break; case 0x19:prefix##_##19();break; case 0x1a:prefix##_##1a();break; case 0x1b:prefix##_##1b();break; \ - case 0x1c:prefix##_##1c();break; case 0x1d:prefix##_##1d();break; case 0x1e:prefix##_##1e();break; case 0x1f:prefix##_##1f();break; \ - case 0x20:prefix##_##20();break; case 0x21:prefix##_##21();break; case 0x22:prefix##_##22();break; case 0x23:prefix##_##23();break; \ - case 0x24:prefix##_##24();break; case 0x25:prefix##_##25();break; case 0x26:prefix##_##26();break; case 0x27:prefix##_##27();break; \ - case 0x28:prefix##_##28();break; case 0x29:prefix##_##29();break; case 0x2a:prefix##_##2a();break; case 0x2b:prefix##_##2b();break; \ - case 0x2c:prefix##_##2c();break; case 0x2d:prefix##_##2d();break; case 0x2e:prefix##_##2e();break; case 0x2f:prefix##_##2f();break; \ - case 0x30:prefix##_##30();break; case 0x31:prefix##_##31();break; case 0x32:prefix##_##32();break; case 0x33:prefix##_##33();break; \ - case 0x34:prefix##_##34();break; case 0x35:prefix##_##35();break; case 0x36:prefix##_##36();break; case 0x37:prefix##_##37();break; \ - case 0x38:prefix##_##38();break; case 0x39:prefix##_##39();break; case 0x3a:prefix##_##3a();break; case 0x3b:prefix##_##3b();break; \ - case 0x3c:prefix##_##3c();break; case 0x3d:prefix##_##3d();break; case 0x3e:prefix##_##3e();break; case 0x3f:prefix##_##3f();break; \ - case 0x40:prefix##_##40();break; case 0x41:prefix##_##41();break; case 0x42:prefix##_##42();break; case 0x43:prefix##_##43();break; \ - case 0x44:prefix##_##44();break; case 0x45:prefix##_##45();break; case 0x46:prefix##_##46();break; case 0x47:prefix##_##47();break; \ - case 0x48:prefix##_##48();break; case 0x49:prefix##_##49();break; case 0x4a:prefix##_##4a();break; case 0x4b:prefix##_##4b();break; \ - case 0x4c:prefix##_##4c();break; case 0x4d:prefix##_##4d();break; case 0x4e:prefix##_##4e();break; case 0x4f:prefix##_##4f();break; \ - case 0x50:prefix##_##50();break; case 0x51:prefix##_##51();break; case 0x52:prefix##_##52();break; case 0x53:prefix##_##53();break; \ - case 0x54:prefix##_##54();break; case 0x55:prefix##_##55();break; case 0x56:prefix##_##56();break; case 0x57:prefix##_##57();break; \ - case 0x58:prefix##_##58();break; case 0x59:prefix##_##59();break; case 0x5a:prefix##_##5a();break; case 0x5b:prefix##_##5b();break; \ - case 0x5c:prefix##_##5c();break; case 0x5d:prefix##_##5d();break; case 0x5e:prefix##_##5e();break; case 0x5f:prefix##_##5f();break; \ - case 0x60:prefix##_##60();break; case 0x61:prefix##_##61();break; case 0x62:prefix##_##62();break; case 0x63:prefix##_##63();break; \ - case 0x64:prefix##_##64();break; case 0x65:prefix##_##65();break; case 0x66:prefix##_##66();break; case 0x67:prefix##_##67();break; \ - case 0x68:prefix##_##68();break; case 0x69:prefix##_##69();break; case 0x6a:prefix##_##6a();break; case 0x6b:prefix##_##6b();break; \ - case 0x6c:prefix##_##6c();break; case 0x6d:prefix##_##6d();break; case 0x6e:prefix##_##6e();break; case 0x6f:prefix##_##6f();break; \ - case 0x70:prefix##_##70();break; case 0x71:prefix##_##71();break; case 0x72:prefix##_##72();break; case 0x73:prefix##_##73();break; \ - case 0x74:prefix##_##74();break; case 0x75:prefix##_##75();break; case 0x76:prefix##_##76();break; case 0x77:prefix##_##77();break; \ - case 0x78:prefix##_##78();break; case 0x79:prefix##_##79();break; case 0x7a:prefix##_##7a();break; case 0x7b:prefix##_##7b();break; \ - case 0x7c:prefix##_##7c();break; case 0x7d:prefix##_##7d();break; case 0x7e:prefix##_##7e();break; case 0x7f:prefix##_##7f();break; \ - case 0x80:prefix##_##80();break; case 0x81:prefix##_##81();break; case 0x82:prefix##_##82();break; case 0x83:prefix##_##83();break; \ - case 0x84:prefix##_##84();break; case 0x85:prefix##_##85();break; case 0x86:prefix##_##86();break; case 0x87:prefix##_##87();break; \ - case 0x88:prefix##_##88();break; case 0x89:prefix##_##89();break; case 0x8a:prefix##_##8a();break; case 0x8b:prefix##_##8b();break; \ - case 0x8c:prefix##_##8c();break; case 0x8d:prefix##_##8d();break; case 0x8e:prefix##_##8e();break; case 0x8f:prefix##_##8f();break; \ - case 0x90:prefix##_##90();break; case 0x91:prefix##_##91();break; case 0x92:prefix##_##92();break; case 0x93:prefix##_##93();break; \ - case 0x94:prefix##_##94();break; case 0x95:prefix##_##95();break; case 0x96:prefix##_##96();break; case 0x97:prefix##_##97();break; \ - case 0x98:prefix##_##98();break; case 0x99:prefix##_##99();break; case 0x9a:prefix##_##9a();break; case 0x9b:prefix##_##9b();break; \ - case 0x9c:prefix##_##9c();break; case 0x9d:prefix##_##9d();break; case 0x9e:prefix##_##9e();break; case 0x9f:prefix##_##9f();break; \ - case 0xa0:prefix##_##a0();break; case 0xa1:prefix##_##a1();break; case 0xa2:prefix##_##a2();break; case 0xa3:prefix##_##a3();break; \ - case 0xa4:prefix##_##a4();break; case 0xa5:prefix##_##a5();break; case 0xa6:prefix##_##a6();break; case 0xa7:prefix##_##a7();break; \ - case 0xa8:prefix##_##a8();break; case 0xa9:prefix##_##a9();break; case 0xaa:prefix##_##aa();break; case 0xab:prefix##_##ab();break; \ - case 0xac:prefix##_##ac();break; case 0xad:prefix##_##ad();break; case 0xae:prefix##_##ae();break; case 0xaf:prefix##_##af();break; \ - case 0xb0:prefix##_##b0();break; case 0xb1:prefix##_##b1();break; case 0xb2:prefix##_##b2();break; case 0xb3:prefix##_##b3();break; \ - case 0xb4:prefix##_##b4();break; case 0xb5:prefix##_##b5();break; case 0xb6:prefix##_##b6();break; case 0xb7:prefix##_##b7();break; \ - case 0xb8:prefix##_##b8();break; case 0xb9:prefix##_##b9();break; case 0xba:prefix##_##ba();break; case 0xbb:prefix##_##bb();break; \ - case 0xbc:prefix##_##bc();break; case 0xbd:prefix##_##bd();break; case 0xbe:prefix##_##be();break; case 0xbf:prefix##_##bf();break; \ - case 0xc0:prefix##_##c0();break; case 0xc1:prefix##_##c1();break; case 0xc2:prefix##_##c2();break; case 0xc3:prefix##_##c3();break; \ - case 0xc4:prefix##_##c4();break; case 0xc5:prefix##_##c5();break; case 0xc6:prefix##_##c6();break; case 0xc7:prefix##_##c7();break; \ - case 0xc8:prefix##_##c8();break; case 0xc9:prefix##_##c9();break; case 0xca:prefix##_##ca();break; case 0xcb:prefix##_##cb();break; \ - case 0xcc:prefix##_##cc();break; case 0xcd:prefix##_##cd();break; case 0xce:prefix##_##ce();break; case 0xcf:prefix##_##cf();break; \ - case 0xd0:prefix##_##d0();break; case 0xd1:prefix##_##d1();break; case 0xd2:prefix##_##d2();break; case 0xd3:prefix##_##d3();break; \ - case 0xd4:prefix##_##d4();break; case 0xd5:prefix##_##d5();break; case 0xd6:prefix##_##d6();break; case 0xd7:prefix##_##d7();break; \ - case 0xd8:prefix##_##d8();break; case 0xd9:prefix##_##d9();break; case 0xda:prefix##_##da();break; case 0xdb:prefix##_##db();break; \ - case 0xdc:prefix##_##dc();break; case 0xdd:prefix##_##dd();break; case 0xde:prefix##_##de();break; case 0xdf:prefix##_##df();break; \ - case 0xe0:prefix##_##e0();break; case 0xe1:prefix##_##e1();break; case 0xe2:prefix##_##e2();break; case 0xe3:prefix##_##e3();break; \ - case 0xe4:prefix##_##e4();break; case 0xe5:prefix##_##e5();break; case 0xe6:prefix##_##e6();break; case 0xe7:prefix##_##e7();break; \ - case 0xe8:prefix##_##e8();break; case 0xe9:prefix##_##e9();break; case 0xea:prefix##_##ea();break; case 0xeb:prefix##_##eb();break; \ - case 0xec:prefix##_##ec();break; case 0xed:prefix##_##ed();break; case 0xee:prefix##_##ee();break; case 0xef:prefix##_##ef();break; \ - case 0xf0:prefix##_##f0();break; case 0xf1:prefix##_##f1();break; case 0xf2:prefix##_##f2();break; case 0xf3:prefix##_##f3();break; \ - case 0xf4:prefix##_##f4();break; case 0xf5:prefix##_##f5();break; case 0xf6:prefix##_##f6();break; case 0xf7:prefix##_##f7();break; \ - case 0xf8:prefix##_##f8();break; case 0xf9:prefix##_##f9();break; case 0xfa:prefix##_##fa();break; case 0xfb:prefix##_##fb();break; \ - case 0xfc:prefix##_##fc();break; case 0xfd:prefix##_##fd();break; case 0xfe:prefix##_##fe();break; case 0xff:prefix##_##ff();break; \ - } \ -} -#else -#define EXEC_Z80_INLINE EXEC -#endif - - -/*************************************************************** - * Enter HALT state; write 1 to fake port on first execution - ***************************************************************/ -#define ENTER_HALT { \ - PC--; \ - HALT = 1; \ - if( Z80.irq_state == Z80_CLEAR_LINE ) \ - Z80Burn( z80_ICount ); \ -} - -/*************************************************************** - * Leave HALT state; write 0 to fake port - ***************************************************************/ -#define LEAVE_HALT { \ - if( HALT ) \ - { \ - HALT = 0; \ - PC++; \ - } \ -} - -/*************************************************************** - * Input a byte from given I/O port - ***************************************************************/ -#define IN(port) ((UINT8)Z80IORead(port)) - -/*************************************************************** - * Output a byte to given I/O port - ***************************************************************/ -#define OUT(port,value) Z80IOWrite(port,value) - -/*************************************************************** - * Read a byte from given memory location - ***************************************************************/ -#define RM(addr) (UINT8)Z80ProgramRead(addr) - -/*************************************************************** - * Read a word from given memory location - ***************************************************************/ -Z80_INLINE void RM16( UINT32 addr, Z80_PAIR *r ) -{ - r->b.l = RM(addr); - r->b.h = RM((addr+1)&0xffff); -} - -/*************************************************************** - * Write a byte to given memory location - ***************************************************************/ -#define WM(addr,value) Z80ProgramWrite(addr,value) - -#define cpu_readop(n) Z80CPUReadOp(n) -#define cpu_readop_arg(n) Z80CPUReadOpArg(n) - -/*************************************************************** - * Write a word to given memory location - ***************************************************************/ -Z80_INLINE void WM16( UINT32 addr, Z80_PAIR *r ) -{ - WM(addr,r->b.l); - WM((addr+1)&0xffff,r->b.h); -} - -/*************************************************************** - * ROP() is identical to RM() except it is used for - * reading opcodes. In case of system with memory mapped I/O, - * this function can be used to greatly speed up emulation - ***************************************************************/ -Z80_INLINE UINT8 ROP(void) -{ - unsigned pc = PCD; - PC++; - return cpu_readop(pc); -} - -/**************************************************************** - * ARG() is identical to ROP() except it is used - * for reading opcode arguments. This difference can be used to - * support systems that use different encoding mechanisms for - * opcodes and opcode arguments - ***************************************************************/ -Z80_INLINE UINT8 ARG(void) -{ - unsigned pc = PCD; - PC++; - return cpu_readop_arg(pc); -} - -Z80_INLINE UINT32 ARG16(void) -{ - unsigned pc = PCD; - PC += 2; - return cpu_readop_arg(pc) | (cpu_readop_arg((pc+1)&0xffff) << 8); -} - -/*************************************************************** - * Calculate the effective address EA of an opcode using - * IX+offset resp. IY+offset addressing. - ***************************************************************/ -#define EAX EA = (UINT32)(UINT16)(IX + (INT8)ARG()) -#define EAY EA = (UINT32)(UINT16)(IY + (INT8)ARG()) - -/*************************************************************** - * POP - ***************************************************************/ -#define POP(DR) do { RM16( SPD, &Z80.DR ); SP += 2; } while (0) - -/*************************************************************** - * PUSH - ***************************************************************/ -#define PUSH(SR) do { SP -= 2; WM16( SPD, &Z80.SR ); } while (0) - -/*************************************************************** - * JP - ***************************************************************/ -#if BUSY_LOOP_HACKS -#define JP { \ - unsigned oldpc = PCD-1; \ - PCD = ARG16(); \ - change_pc(PCD); \ - /* speed up busy loop */ \ - if( PCD == oldpc ) \ - { \ - if( Z80.irq_state == Z80_CLEAR_LINE ) \ - BURNODD( z80_ICount, 1, cc[Z80_TABLE_op][0xc3] ); \ - } \ - else \ - { \ - UINT8 op = cpu_readop(PCD); \ - if( PCD == oldpc-1 ) \ - { \ - /* NOP - JP $-1 or EI - JP $-1 */ \ - if ( op == 0x00 || op == 0xfb ) \ - { \ - if( Z80.irq_state == Z80_CLEAR_LINE ) \ - BURNODD( z80_ICount-cc[Z80_TABLE_op][0x00], \ - 2, cc[Z80_TABLE_op][0x00]+cc[Z80_TABLE_op][0xc3]); \ - } \ - } \ - else \ - /* LD SP,#xxxx - JP $-3 (Galaga) */ \ - if( PCD == oldpc-3 && op == 0x31 ) \ - { \ - if( Z80.irq_state == Z80_CLEAR_LINE ) \ - BURNODD( z80_ICount-cc[Z80_TABLE_op][0x31], \ - 2, cc[Z80_TABLE_op][0x31]+cc[Z80_TABLE_op][0xc3]); \ - } \ - } \ -} -#else -#define JP { \ - PCD = ARG16(); \ - change_pc(PCD); \ -} -#endif - -/*************************************************************** - * JP_COND - ***************************************************************/ - -#define JP_COND(cond) \ - if( cond ) \ - { \ - PCD = ARG16(); \ - change_pc(PCD); \ - } \ - else \ - { \ - PC += 2; \ - } - -/*************************************************************** - * JR - ***************************************************************/ -#define JR() \ -{ \ - unsigned oldpc = PCD-1; \ - INT8 arg = (INT8)ARG(); /* ARG() also increments PC */ \ - PC += arg; /* so don't do PC += ARG() */ \ - change_pc(PCD); \ - /* speed up busy loop */ \ - if( PCD == oldpc ) \ - { \ - if( Z80.irq_state == Z80_CLEAR_LINE ) \ - BURNODD( z80_ICount, 1, cc[Z80_TABLE_op][0x18] ); \ - } \ - else \ - { \ - UINT8 op = cpu_readop(PCD); \ - if( PCD == oldpc-1 ) \ - { \ - /* NOP - JR $-1 or EI - JR $-1 */ \ - if ( op == 0x00 || op == 0xfb ) \ - { \ - if( Z80.irq_state == Z80_CLEAR_LINE ) \ - BURNODD( z80_ICount-cc[Z80_TABLE_op][0x00], \ - 2, cc[Z80_TABLE_op][0x00]+cc[Z80_TABLE_op][0x18]); \ - } \ - } \ - else \ - /* LD SP,#xxxx - JR $-3 */ \ - if( PCD == oldpc-3 && op == 0x31 ) \ - { \ - if( Z80.irq_state == Z80_CLEAR_LINE ) \ - BURNODD( z80_ICount-cc[Z80_TABLE_op][0x31], \ - 2, cc[Z80_TABLE_op][0x31]+cc[Z80_TABLE_op][0x18]); \ - } \ - } \ -} - -/*************************************************************** - * JR_COND - ***************************************************************/ -#define JR_COND(cond,opcode) \ - if( cond ) \ - { \ - INT8 arg = (INT8)ARG(); /* ARG() also increments PC */ \ - PC += arg; /* so don't do PC += ARG() */ \ - CC(ex,opcode); \ - change_pc(PCD); \ - } \ - else PC++; \ - -/*************************************************************** - * CALL - ***************************************************************/ -#define CALL() \ - EA = ARG16(); \ - PUSH( pc ); \ - PCD = EA; \ - change_pc(PCD) - -/*************************************************************** - * CALL_COND - ***************************************************************/ -#define CALL_COND(cond,opcode) \ - if( cond ) \ - { \ - EA = ARG16(); \ - PUSH( pc ); \ - PCD = EA; \ - CC(ex,opcode); \ - change_pc(PCD); \ - } \ - else \ - { \ - PC+=2; \ - } - -/*************************************************************** - * RET_COND - ***************************************************************/ -#define RET_COND(cond,opcode) \ - if( cond ) \ - { \ - POP( pc ); \ - change_pc(PCD); \ - CC(ex,opcode); \ - } - -/*************************************************************** - * RETN - ***************************************************************/ -#define RETN { \ - LOG(("Z80 #%d RETN IFF1:%d IFF2:%d\n", cpu_getactivecpu(), IFF1, IFF2)); \ - POP( pc ); \ - change_pc(PCD); \ - IFF1 = IFF2; \ -} - -/*************************************************************** - * RETI - ***************************************************************/ -#define RETI { \ - POP( pc ); \ - change_pc(PCD); \ -/* according to http://www.msxnet.org/tech/z80-documented.pdf */\ - IFF1 = IFF2; \ - if (Z80.daisy) \ - z80daisy_call_reti_device(Z80.daisy); \ -} - -/*************************************************************** - * LD R,A - ***************************************************************/ -#define LD_R_A { \ - R = A; \ - R2 = A & 0x80; /* keep bit 7 of R */ \ -} - -/*************************************************************** - * LD A,R - ***************************************************************/ -#define LD_A_R { \ - A = (R & 0x7f) | R2; \ - F = (F & CF) | SZ[A] | ( IFF2 << 2 ); \ -} - -/*************************************************************** - * LD I,A - ***************************************************************/ -#define LD_I_A { \ - I = A; \ -} - -/*************************************************************** - * LD A,I - ***************************************************************/ -#define LD_A_I { \ - A = I; \ - F = (F & CF) | SZ[A] | ( IFF2 << 2 ); \ -} - -/*************************************************************** - * RST - ***************************************************************/ -#define RST(addr) \ - PUSH( pc ); \ - PCD = addr; \ - change_pc(PCD) - -/*************************************************************** - * INC r8 - ***************************************************************/ -Z80_INLINE UINT8 INC(UINT8 value) -{ - UINT8 res = value + 1; - F = (F & CF) | SZHV_inc[res]; - return (UINT8)res; -} - -/*************************************************************** - * DEC r8 - ***************************************************************/ -Z80_INLINE UINT8 DEC(UINT8 value) -{ - UINT8 res = value - 1; - F = (F & CF) | SZHV_dec[res]; - return res; -} - -/*************************************************************** - * RLCA - ***************************************************************/ -#define RLCA \ - A = (A << 1) | (A >> 7); \ - F = (F & (SF | ZF | PF)) | (A & (YF | XF | CF)) - -/*************************************************************** - * RRCA - ***************************************************************/ -#define RRCA \ - F = (F & (SF | ZF | PF)) | (A & CF); \ - A = (A >> 1) | (A << 7); \ - F |= (A & (YF | XF) ) - -/*************************************************************** - * RLA - ***************************************************************/ -#define RLA { \ - UINT8 res = (A << 1) | (F & CF); \ - UINT8 c = (A & 0x80) ? CF : 0; \ - F = (F & (SF | ZF | PF)) | c | (res & (YF | XF)); \ - A = res; \ -} - -/*************************************************************** - * RRA - ***************************************************************/ -#define RRA { \ - UINT8 res = (A >> 1) | (F << 7); \ - UINT8 c = (A & 0x01) ? CF : 0; \ - F = (F & (SF | ZF | PF)) | c | (res & (YF | XF)); \ - A = res; \ -} - -/*************************************************************** - * RRD - ***************************************************************/ -#define RRD { \ - UINT8 n = RM(HL); \ - WM( HL, (n >> 4) | (A << 4) ); \ - A = (A & 0xf0) | (n & 0x0f); \ - F = (F & CF) | SZP[A]; \ -} - -/*************************************************************** - * RLD - ***************************************************************/ -#define RLD { \ - UINT8 n = RM(HL); \ - WM( HL, (n << 4) | (A & 0x0f) ); \ - A = (A & 0xf0) | (n >> 4); \ - F = (F & CF) | SZP[A]; \ -} - -/*************************************************************** - * ADD A,n - ***************************************************************/ -#if BIG_FLAGS_ARRAY -#define ADD(value) \ -{ \ - UINT32 ah = AFD & 0xff00; \ - UINT32 res = (UINT8)((ah >> 8) + value); \ - F = SZHVC_add[ah | res]; \ - A = res; \ -} -#else -#define ADD(value) \ -{ \ - unsigned val = value; \ - unsigned res = A + val; \ - F = SZ[(UINT8)res] | ((res >> 8) & CF) | \ - ((A ^ res ^ val) & HF) | \ - (((val ^ A ^ 0x80) & (val ^ res) & 0x80) >> 5); \ - A = (UINT8)res; \ -} -#endif - -/*************************************************************** - * ADC A,n - ***************************************************************/ -#if BIG_FLAGS_ARRAY -#define ADC(value) \ -{ \ - UINT32 ah = AFD & 0xff00, c = AFD & 1; \ - UINT32 res = (UINT8)((ah >> 8) + value + c); \ - F = SZHVC_add[(c << 16) | ah | res]; \ - A = res; \ -} -#else -#define ADC(value) \ -{ \ - unsigned val = value; \ - unsigned res = A + val + (F & CF); \ - F = SZ[res & 0xff] | ((res >> 8) & CF) | \ - ((A ^ res ^ val) & HF) | \ - (((val ^ A ^ 0x80) & (val ^ res) & 0x80) >> 5); \ - A = res; \ -} -#endif - -/*************************************************************** - * SUB n - ***************************************************************/ -#if BIG_FLAGS_ARRAY -#define SUB(value) \ -{ \ - UINT32 ah = AFD & 0xff00; \ - UINT32 res = (UINT8)((ah >> 8) - value); \ - F = SZHVC_sub[ah | res]; \ - A = res; \ -} -#else -#define SUB(value) \ -{ \ - unsigned val = value; \ - unsigned res = A - val; \ - F = SZ[res & 0xff] | ((res >> 8) & CF) | NF | \ - ((A ^ res ^ val) & HF) | \ - (((val ^ A) & (A ^ res) & 0x80) >> 5); \ - A = res; \ -} -#endif - -/*************************************************************** - * SBC A,n - ***************************************************************/ -#if BIG_FLAGS_ARRAY -#define SBC(value) \ -{ \ - UINT32 ah = AFD & 0xff00, c = AFD & 1; \ - UINT32 res = (UINT8)((ah >> 8) - value - c); \ - F = SZHVC_sub[(c<<16) | ah | res]; \ - A = res; \ -} -#else -#define SBC(value) \ -{ \ - unsigned val = value; \ - unsigned res = A - val - (F & CF); \ - F = SZ[res & 0xff] | ((res >> 8) & CF) | NF | \ - ((A ^ res ^ val) & HF) | \ - (((val ^ A) & (A ^ res) & 0x80) >> 5); \ - A = res; \ -} -#endif - -/*************************************************************** - * NEG - ***************************************************************/ -#define NEG { \ - UINT8 value = A; \ - A = 0; \ - SUB(value); \ -} - -/*************************************************************** - * DAA - ***************************************************************/ -#define DAA { \ - UINT8 cf, nf, hf, lo, hi, diff; \ - cf = F & CF; \ - nf = F & NF; \ - hf = F & HF; \ - lo = A & 15; \ - hi = A / 16; \ - \ - if (cf) \ - { \ - diff = (lo <= 9 && !hf) ? 0x60 : 0x66; \ - } \ - else \ - { \ - if (lo >= 10) \ - { \ - diff = hi <= 8 ? 0x06 : 0x66; \ - } \ - else \ - { \ - if (hi >= 10) \ - { \ - diff = hf ? 0x66 : 0x60; \ - } \ - else \ - { \ - diff = hf ? 0x06 : 0x00; \ - } \ - } \ - } \ - if (nf) A -= diff; \ - else A += diff; \ - \ - F = SZP[A] | (F & NF); \ - if (cf || (lo <= 9 ? hi >= 10 : hi >= 9)) F |= CF; \ - if (nf ? hf && lo <= 5 : lo >= 10) F |= HF; \ -} - -/*************************************************************** - * AND n - ***************************************************************/ -#define AND(value) \ - A &= value; \ - F = SZP[A] | HF - -/*************************************************************** - * OR n - ***************************************************************/ -#define OR(value) \ - A |= value; \ - F = SZP[A] - -/*************************************************************** - * XOR n - ***************************************************************/ -#define XOR(value) \ - A ^= value; \ - F = SZP[A] - -/*************************************************************** - * CP n - ***************************************************************/ -#if BIG_FLAGS_ARRAY -#define CP(value) \ -{ \ - unsigned val = value; \ - UINT32 ah = AFD & 0xff00; \ - UINT32 res = (UINT8)((ah >> 8) - val); \ - F = (SZHVC_sub[ah | res] & ~(YF | XF)) | \ - (val & (YF | XF)); \ -} -#else -#define CP(value) \ -{ \ - unsigned val = value; \ - unsigned res = A - val; \ - F = (SZ[res & 0xff] & (SF | ZF)) | \ - (val & (YF | XF)) | ((res >> 8) & CF) | NF | \ - ((A ^ res ^ val) & HF) | \ - ((((val ^ A) & (A ^ res)) >> 5) & VF); \ -} -#endif - -/*************************************************************** - * EX AF,AF' - ***************************************************************/ -#define EX_AF { \ - Z80_PAIR tmp; \ - tmp = Z80.af; Z80.af = Z80.af2; Z80.af2 = tmp; \ -} - -/*************************************************************** - * EX DE,HL - ***************************************************************/ -#define EX_DE_HL { \ - Z80_PAIR tmp; \ - tmp = Z80.de; Z80.de = Z80.hl; Z80.hl = tmp; \ -} - -/*************************************************************** - * EXX - ***************************************************************/ -#define EXX { \ - Z80_PAIR tmp; \ - tmp = Z80.bc; Z80.bc = Z80.bc2; Z80.bc2 = tmp; \ - tmp = Z80.de; Z80.de = Z80.de2; Z80.de2 = tmp; \ - tmp = Z80.hl; Z80.hl = Z80.hl2; Z80.hl2 = tmp; \ -} - -/*************************************************************** - * EX (SP),r16 - ***************************************************************/ -#define EXSP(DR) \ -{ \ - Z80_PAIR tmp = { { 0, 0, 0, 0 } }; \ - RM16( SPD, &tmp ); \ - WM16( SPD, &Z80.DR ); \ - Z80.DR = tmp; \ -} - - -/*************************************************************** - * ADD16 - ***************************************************************/ -#define ADD16(DR,SR) \ -{ \ - UINT32 res = Z80.DR.d + Z80.SR.d; \ - F = (F & (SF | ZF | VF)) | \ - (((Z80.DR.d ^ res ^ Z80.SR.d) >> 8) & HF) | \ - ((res >> 16) & CF) | ((res >> 8) & (YF | XF)); \ - Z80.DR.w.l = (UINT16)res; \ -} - -/*************************************************************** - * ADC r16,r16 - ***************************************************************/ -#define ADC16(Reg) \ -{ \ - UINT32 res = HLD + Z80.Reg.d + (F & CF); \ - F = (((HLD ^ res ^ Z80.Reg.d) >> 8) & HF) | \ - ((res >> 16) & CF) | \ - ((res >> 8) & (SF | YF | XF)) | \ - ((res & 0xffff) ? 0 : ZF) | \ - (((Z80.Reg.d ^ HLD ^ 0x8000) & (Z80.Reg.d ^ res) & 0x8000) >> 13); \ - HL = (UINT16)res; \ -} - -/*************************************************************** - * SBC r16,r16 - ***************************************************************/ -#define SBC16(Reg) \ -{ \ - UINT32 res = HLD - Z80.Reg.d - (F & CF); \ - F = (((HLD ^ res ^ Z80.Reg.d) >> 8) & HF) | NF | \ - ((res >> 16) & CF) | \ - ((res >> 8) & (SF | YF | XF)) | \ - ((res & 0xffff) ? 0 : ZF) | \ - (((Z80.Reg.d ^ HLD) & (HLD ^ res) &0x8000) >> 13); \ - HL = (UINT16)res; \ -} - -/*************************************************************** - * RLC r8 - ***************************************************************/ -Z80_INLINE UINT8 RLC(UINT8 value) -{ - unsigned res = value; - unsigned c = (res & 0x80) ? CF : 0; - res = ((res << 1) | (res >> 7)) & 0xff; - F = SZP[res] | c; - return res; -} - -/*************************************************************** - * RRC r8 - ***************************************************************/ -Z80_INLINE UINT8 RRC(UINT8 value) -{ - unsigned res = value; - unsigned c = (res & 0x01) ? CF : 0; - res = ((res >> 1) | (res << 7)) & 0xff; - F = SZP[res] | c; - return res; -} - -/*************************************************************** - * RL r8 - ***************************************************************/ -Z80_INLINE UINT8 RL(UINT8 value) -{ - unsigned res = value; - unsigned c = (res & 0x80) ? CF : 0; - res = ((res << 1) | (F & CF)) & 0xff; - F = SZP[res] | c; - return res; -} - -/*************************************************************** - * RR r8 - ***************************************************************/ -Z80_INLINE UINT8 RR(UINT8 value) -{ - unsigned res = value; - unsigned c = (res & 0x01) ? CF : 0; - res = ((res >> 1) | (F << 7)) & 0xff; - F = SZP[res] | c; - return res; -} - -/*************************************************************** - * SLA r8 - ***************************************************************/ -Z80_INLINE UINT8 SLA(UINT8 value) -{ - unsigned res = value; - unsigned c = (res & 0x80) ? CF : 0; - res = (res << 1) & 0xff; - F = SZP[res] | c; - return res; -} - -/*************************************************************** - * SRA r8 - ***************************************************************/ -Z80_INLINE UINT8 SRA(UINT8 value) -{ - unsigned res = value; - unsigned c = (res & 0x01) ? CF : 0; - res = ((res >> 1) | (res & 0x80)) & 0xff; - F = SZP[res] | c; - return res; -} - -/*************************************************************** - * SLL r8 - ***************************************************************/ -Z80_INLINE UINT8 SLL(UINT8 value) -{ - unsigned res = value; - unsigned c = (res & 0x80) ? CF : 0; - res = ((res << 1) | 0x01) & 0xff; - F = SZP[res] | c; - return res; -} - -/*************************************************************** - * SRL r8 - ***************************************************************/ -Z80_INLINE UINT8 SRL(UINT8 value) -{ - unsigned res = value; - unsigned c = (res & 0x01) ? CF : 0; - res = (res >> 1) & 0xff; - F = SZP[res] | c; - return res; -} - -/*************************************************************** - * BIT bit,r8 - ***************************************************************/ -#undef BIT -#define BIT(bit,reg) \ - F = (F & CF) | HF | SZ_BIT[reg & (1<>8) & (YF|XF)) - -/*************************************************************** - * RES bit,r8 - ***************************************************************/ -Z80_INLINE UINT8 RES(UINT8 bit, UINT8 value) -{ - return value & ~(1< flag 5 */ \ - if( (A + io) & 0x08 ) F |= XF; /* bit 3 -> flag 3 */ \ - HL++; DE++; BC--; \ - if( BC ) F |= VF; \ -} - -/*************************************************************** - * CPI - ***************************************************************/ -#define CPI { \ - UINT8 val = RM(HL); \ - UINT8 res = A - val; \ - HL++; BC--; \ - F = (F & CF) | (SZ[res]&~(YF|XF)) | ((A^val^res)&HF) | NF; \ - if( F & HF ) res -= 1; \ - if( res & 0x02 ) F |= YF; /* bit 1 -> flag 5 */ \ - if( res & 0x08 ) F |= XF; /* bit 3 -> flag 3 */ \ - if( BC ) F |= VF; \ -} - -/*************************************************************** - * INI - ***************************************************************/ -#define INI { \ - unsigned t; \ - UINT8 io = IN(BC); \ - B--; \ - WM( HL, io ); \ - HL++; \ - F = SZ[B]; \ - t = (unsigned)((C + 1) & 0xff) + (unsigned)io; \ - if( io & SF ) F |= NF; \ - if( t & 0x100 ) F |= HF | CF; \ - F |= SZP[(UINT8)(t & 0x07) ^ B] & PF; \ -} - -/*************************************************************** - * OUTI - ***************************************************************/ -#define OUTI { \ - unsigned t; \ - UINT8 io = RM(HL); \ - B--; \ - OUT( BC, io ); \ - HL++; \ - F = SZ[B]; \ - t = (unsigned)L + (unsigned)io; \ - if( io & SF ) F |= NF; \ - if( t & 0x100 ) F |= HF | CF; \ - F |= SZP[(UINT8)(t & 0x07) ^ B] & PF; \ -} - -/*************************************************************** - * LDD - ***************************************************************/ -#define LDD { \ - UINT8 io = RM(HL); \ - WM( DE, io ); \ - F &= SF | ZF | CF; \ - if( (A + io) & 0x02 ) F |= YF; /* bit 1 -> flag 5 */ \ - if( (A + io) & 0x08 ) F |= XF; /* bit 3 -> flag 3 */ \ - HL--; DE--; BC--; \ - if( BC ) F |= VF; \ -} - -/*************************************************************** - * CPD - ***************************************************************/ -#define CPD { \ - UINT8 val = RM(HL); \ - UINT8 res = A - val; \ - HL--; BC--; \ - F = (F & CF) | (SZ[res]&~(YF|XF)) | ((A^val^res)&HF) | NF; \ - if( F & HF ) res -= 1; \ - if( res & 0x02 ) F |= YF; /* bit 1 -> flag 5 */ \ - if( res & 0x08 ) F |= XF; /* bit 3 -> flag 3 */ \ - if( BC ) F |= VF; \ -} - -/*************************************************************** - * IND - ***************************************************************/ -#define IND { \ - unsigned t; \ - UINT8 io = IN(BC); \ - B--; \ - WM( HL, io ); \ - HL--; \ - F = SZ[B]; \ - t = ((unsigned)(C - 1) & 0xff) + (unsigned)io; \ - if( io & SF ) F |= NF; \ - if( t & 0x100 ) F |= HF | CF; \ - F |= SZP[(UINT8)(t & 0x07) ^ B] & PF; \ -} - -/*************************************************************** - * OUTD - ***************************************************************/ -#define OUTD { \ - unsigned t; \ - UINT8 io = RM(HL); \ - B--; \ - OUT( BC, io ); \ - HL--; \ - F = SZ[B]; \ - t = (unsigned)L + (unsigned)io; \ - if( io & SF ) F |= NF; \ - if( t & 0x100 ) F |= HF | CF; \ - F |= SZP[(UINT8)(t & 0x07) ^ B] & PF; \ -} - -/*************************************************************** - * LDIR - ***************************************************************/ -#define LDIR \ - LDI; \ - if( BC ) \ - { \ - PC -= 2; \ - CC(ex,0xb0); \ - } - -/*************************************************************** - * CPIR - ***************************************************************/ -#define CPIR \ - CPI; \ - if( BC && !(F & ZF) ) \ - { \ - PC -= 2; \ - CC(ex,0xb1); \ - } - -/*************************************************************** - * INIR - ***************************************************************/ -#define INIR \ - INI; \ - if( B ) \ - { \ - PC -= 2; \ - CC(ex,0xb2); \ - } - -/*************************************************************** - * OTIR - ***************************************************************/ -#define OTIR \ - OUTI; \ - if( B ) \ - { \ - PC -= 2; \ - CC(ex,0xb3); \ - } - -/*************************************************************** - * LDDR - ***************************************************************/ -#define LDDR \ - LDD; \ - if( BC ) \ - { \ - PC -= 2; \ - CC(ex,0xb8); \ - } - -/*************************************************************** - * CPDR - ***************************************************************/ -#define CPDR \ - CPD; \ - if( BC && !(F & ZF) ) \ - { \ - PC -= 2; \ - CC(ex,0xb9); \ - } - -/*************************************************************** - * INDR - ***************************************************************/ -#define INDR \ - IND; \ - if( B ) \ - { \ - PC -= 2; \ - CC(ex,0xba); \ - } - -/*************************************************************** - * OTDR - ***************************************************************/ -#define OTDR \ - OUTD; \ - if( B ) \ - { \ - PC -= 2; \ - CC(ex,0xbb); \ - } - -/*************************************************************** - * EI - ***************************************************************/ -#define EI { \ - IFF1 = IFF2 = 1; \ - Z80.after_ei = TRUE; \ -} - -/********************************************************** - * opcodes with CB prefix - * rotate, shift and bit operations - **********************************************************/ -OP(cb,00) { B = RLC(B); } /* RLC B */ -OP(cb,01) { C = RLC(C); } /* RLC C */ -OP(cb,02) { D = RLC(D); } /* RLC D */ -OP(cb,03) { E = RLC(E); } /* RLC E */ -OP(cb,04) { H = RLC(H); } /* RLC H */ -OP(cb,05) { L = RLC(L); } /* RLC L */ -OP(cb,06) { WM( HL, RLC(RM(HL)) ); } /* RLC (HL) */ -OP(cb,07) { A = RLC(A); } /* RLC A */ - -OP(cb,08) { B = RRC(B); } /* RRC B */ -OP(cb,09) { C = RRC(C); } /* RRC C */ -OP(cb,0a) { D = RRC(D); } /* RRC D */ -OP(cb,0b) { E = RRC(E); } /* RRC E */ -OP(cb,0c) { H = RRC(H); } /* RRC H */ -OP(cb,0d) { L = RRC(L); } /* RRC L */ -OP(cb,0e) { WM( HL, RRC(RM(HL)) ); } /* RRC (HL) */ -OP(cb,0f) { A = RRC(A); } /* RRC A */ - -OP(cb,10) { B = RL(B); } /* RL B */ -OP(cb,11) { C = RL(C); } /* RL C */ -OP(cb,12) { D = RL(D); } /* RL D */ -OP(cb,13) { E = RL(E); } /* RL E */ -OP(cb,14) { H = RL(H); } /* RL H */ -OP(cb,15) { L = RL(L); } /* RL L */ -OP(cb,16) { WM( HL, RL(RM(HL)) ); } /* RL (HL) */ -OP(cb,17) { A = RL(A); } /* RL A */ - -OP(cb,18) { B = RR(B); } /* RR B */ -OP(cb,19) { C = RR(C); } /* RR C */ -OP(cb,1a) { D = RR(D); } /* RR D */ -OP(cb,1b) { E = RR(E); } /* RR E */ -OP(cb,1c) { H = RR(H); } /* RR H */ -OP(cb,1d) { L = RR(L); } /* RR L */ -OP(cb,1e) { WM( HL, RR(RM(HL)) ); } /* RR (HL) */ -OP(cb,1f) { A = RR(A); } /* RR A */ - -OP(cb,20) { B = SLA(B); } /* SLA B */ -OP(cb,21) { C = SLA(C); } /* SLA C */ -OP(cb,22) { D = SLA(D); } /* SLA D */ -OP(cb,23) { E = SLA(E); } /* SLA E */ -OP(cb,24) { H = SLA(H); } /* SLA H */ -OP(cb,25) { L = SLA(L); } /* SLA L */ -OP(cb,26) { WM( HL, SLA(RM(HL)) ); } /* SLA (HL) */ -OP(cb,27) { A = SLA(A); } /* SLA A */ - -OP(cb,28) { B = SRA(B); } /* SRA B */ -OP(cb,29) { C = SRA(C); } /* SRA C */ -OP(cb,2a) { D = SRA(D); } /* SRA D */ -OP(cb,2b) { E = SRA(E); } /* SRA E */ -OP(cb,2c) { H = SRA(H); } /* SRA H */ -OP(cb,2d) { L = SRA(L); } /* SRA L */ -OP(cb,2e) { WM( HL, SRA(RM(HL)) ); } /* SRA (HL) */ -OP(cb,2f) { A = SRA(A); } /* SRA A */ - -OP(cb,30) { B = SLL(B); } /* SLL B */ -OP(cb,31) { C = SLL(C); } /* SLL C */ -OP(cb,32) { D = SLL(D); } /* SLL D */ -OP(cb,33) { E = SLL(E); } /* SLL E */ -OP(cb,34) { H = SLL(H); } /* SLL H */ -OP(cb,35) { L = SLL(L); } /* SLL L */ -OP(cb,36) { WM( HL, SLL(RM(HL)) ); } /* SLL (HL) */ -OP(cb,37) { A = SLL(A); } /* SLL A */ - -OP(cb,38) { B = SRL(B); } /* SRL B */ -OP(cb,39) { C = SRL(C); } /* SRL C */ -OP(cb,3a) { D = SRL(D); } /* SRL D */ -OP(cb,3b) { E = SRL(E); } /* SRL E */ -OP(cb,3c) { H = SRL(H); } /* SRL H */ -OP(cb,3d) { L = SRL(L); } /* SRL L */ -OP(cb,3e) { WM( HL, SRL(RM(HL)) ); } /* SRL (HL) */ -OP(cb,3f) { A = SRL(A); } /* SRL A */ - -OP(cb,40) { BIT(0,B); } /* BIT 0,B */ -OP(cb,41) { BIT(0,C); } /* BIT 0,C */ -OP(cb,42) { BIT(0,D); } /* BIT 0,D */ -OP(cb,43) { BIT(0,E); } /* BIT 0,E */ -OP(cb,44) { BIT(0,H); } /* BIT 0,H */ -OP(cb,45) { BIT(0,L); } /* BIT 0,L */ -OP(cb,46) { BIT(0,RM(HL)); } /* BIT 0,(HL) */ -OP(cb,47) { BIT(0,A); } /* BIT 0,A */ - -OP(cb,48) { BIT(1,B); } /* BIT 1,B */ -OP(cb,49) { BIT(1,C); } /* BIT 1,C */ -OP(cb,4a) { BIT(1,D); } /* BIT 1,D */ -OP(cb,4b) { BIT(1,E); } /* BIT 1,E */ -OP(cb,4c) { BIT(1,H); } /* BIT 1,H */ -OP(cb,4d) { BIT(1,L); } /* BIT 1,L */ -OP(cb,4e) { BIT(1,RM(HL)); } /* BIT 1,(HL) */ -OP(cb,4f) { BIT(1,A); } /* BIT 1,A */ - -OP(cb,50) { BIT(2,B); } /* BIT 2,B */ -OP(cb,51) { BIT(2,C); } /* BIT 2,C */ -OP(cb,52) { BIT(2,D); } /* BIT 2,D */ -OP(cb,53) { BIT(2,E); } /* BIT 2,E */ -OP(cb,54) { BIT(2,H); } /* BIT 2,H */ -OP(cb,55) { BIT(2,L); } /* BIT 2,L */ -OP(cb,56) { BIT(2,RM(HL)); } /* BIT 2,(HL) */ -OP(cb,57) { BIT(2,A); } /* BIT 2,A */ - -OP(cb,58) { BIT(3,B); } /* BIT 3,B */ -OP(cb,59) { BIT(3,C); } /* BIT 3,C */ -OP(cb,5a) { BIT(3,D); } /* BIT 3,D */ -OP(cb,5b) { BIT(3,E); } /* BIT 3,E */ -OP(cb,5c) { BIT(3,H); } /* BIT 3,H */ -OP(cb,5d) { BIT(3,L); } /* BIT 3,L */ -OP(cb,5e) { BIT(3,RM(HL)); } /* BIT 3,(HL) */ -OP(cb,5f) { BIT(3,A); } /* BIT 3,A */ - -OP(cb,60) { BIT(4,B); } /* BIT 4,B */ -OP(cb,61) { BIT(4,C); } /* BIT 4,C */ -OP(cb,62) { BIT(4,D); } /* BIT 4,D */ -OP(cb,63) { BIT(4,E); } /* BIT 4,E */ -OP(cb,64) { BIT(4,H); } /* BIT 4,H */ -OP(cb,65) { BIT(4,L); } /* BIT 4,L */ -OP(cb,66) { BIT(4,RM(HL)); } /* BIT 4,(HL) */ -OP(cb,67) { BIT(4,A); } /* BIT 4,A */ - -OP(cb,68) { BIT(5,B); } /* BIT 5,B */ -OP(cb,69) { BIT(5,C); } /* BIT 5,C */ -OP(cb,6a) { BIT(5,D); } /* BIT 5,D */ -OP(cb,6b) { BIT(5,E); } /* BIT 5,E */ -OP(cb,6c) { BIT(5,H); } /* BIT 5,H */ -OP(cb,6d) { BIT(5,L); } /* BIT 5,L */ -OP(cb,6e) { BIT(5,RM(HL)); } /* BIT 5,(HL) */ -OP(cb,6f) { BIT(5,A); } /* BIT 5,A */ - -OP(cb,70) { BIT(6,B); } /* BIT 6,B */ -OP(cb,71) { BIT(6,C); } /* BIT 6,C */ -OP(cb,72) { BIT(6,D); } /* BIT 6,D */ -OP(cb,73) { BIT(6,E); } /* BIT 6,E */ -OP(cb,74) { BIT(6,H); } /* BIT 6,H */ -OP(cb,75) { BIT(6,L); } /* BIT 6,L */ -OP(cb,76) { BIT(6,RM(HL)); } /* BIT 6,(HL) */ -OP(cb,77) { BIT(6,A); } /* BIT 6,A */ - -OP(cb,78) { BIT(7,B); } /* BIT 7,B */ -OP(cb,79) { BIT(7,C); } /* BIT 7,C */ -OP(cb,7a) { BIT(7,D); } /* BIT 7,D */ -OP(cb,7b) { BIT(7,E); } /* BIT 7,E */ -OP(cb,7c) { BIT(7,H); } /* BIT 7,H */ -OP(cb,7d) { BIT(7,L); } /* BIT 7,L */ -OP(cb,7e) { BIT(7,RM(HL)); } /* BIT 7,(HL) */ -OP(cb,7f) { BIT(7,A); } /* BIT 7,A */ - -OP(cb,80) { B = RES(0,B); } /* RES 0,B */ -OP(cb,81) { C = RES(0,C); } /* RES 0,C */ -OP(cb,82) { D = RES(0,D); } /* RES 0,D */ -OP(cb,83) { E = RES(0,E); } /* RES 0,E */ -OP(cb,84) { H = RES(0,H); } /* RES 0,H */ -OP(cb,85) { L = RES(0,L); } /* RES 0,L */ -OP(cb,86) { WM( HL, RES(0,RM(HL)) ); } /* RES 0,(HL) */ -OP(cb,87) { A = RES(0,A); } /* RES 0,A */ - -OP(cb,88) { B = RES(1,B); } /* RES 1,B */ -OP(cb,89) { C = RES(1,C); } /* RES 1,C */ -OP(cb,8a) { D = RES(1,D); } /* RES 1,D */ -OP(cb,8b) { E = RES(1,E); } /* RES 1,E */ -OP(cb,8c) { H = RES(1,H); } /* RES 1,H */ -OP(cb,8d) { L = RES(1,L); } /* RES 1,L */ -OP(cb,8e) { WM( HL, RES(1,RM(HL)) ); } /* RES 1,(HL) */ -OP(cb,8f) { A = RES(1,A); } /* RES 1,A */ - -OP(cb,90) { B = RES(2,B); } /* RES 2,B */ -OP(cb,91) { C = RES(2,C); } /* RES 2,C */ -OP(cb,92) { D = RES(2,D); } /* RES 2,D */ -OP(cb,93) { E = RES(2,E); } /* RES 2,E */ -OP(cb,94) { H = RES(2,H); } /* RES 2,H */ -OP(cb,95) { L = RES(2,L); } /* RES 2,L */ -OP(cb,96) { WM( HL, RES(2,RM(HL)) ); } /* RES 2,(HL) */ -OP(cb,97) { A = RES(2,A); } /* RES 2,A */ - -OP(cb,98) { B = RES(3,B); } /* RES 3,B */ -OP(cb,99) { C = RES(3,C); } /* RES 3,C */ -OP(cb,9a) { D = RES(3,D); } /* RES 3,D */ -OP(cb,9b) { E = RES(3,E); } /* RES 3,E */ -OP(cb,9c) { H = RES(3,H); } /* RES 3,H */ -OP(cb,9d) { L = RES(3,L); } /* RES 3,L */ -OP(cb,9e) { WM( HL, RES(3,RM(HL)) ); } /* RES 3,(HL) */ -OP(cb,9f) { A = RES(3,A); } /* RES 3,A */ - -OP(cb,a0) { B = RES(4,B); } /* RES 4,B */ -OP(cb,a1) { C = RES(4,C); } /* RES 4,C */ -OP(cb,a2) { D = RES(4,D); } /* RES 4,D */ -OP(cb,a3) { E = RES(4,E); } /* RES 4,E */ -OP(cb,a4) { H = RES(4,H); } /* RES 4,H */ -OP(cb,a5) { L = RES(4,L); } /* RES 4,L */ -OP(cb,a6) { WM( HL, RES(4,RM(HL)) ); } /* RES 4,(HL) */ -OP(cb,a7) { A = RES(4,A); } /* RES 4,A */ - -OP(cb,a8) { B = RES(5,B); } /* RES 5,B */ -OP(cb,a9) { C = RES(5,C); } /* RES 5,C */ -OP(cb,aa) { D = RES(5,D); } /* RES 5,D */ -OP(cb,ab) { E = RES(5,E); } /* RES 5,E */ -OP(cb,ac) { H = RES(5,H); } /* RES 5,H */ -OP(cb,ad) { L = RES(5,L); } /* RES 5,L */ -OP(cb,ae) { WM( HL, RES(5,RM(HL)) ); } /* RES 5,(HL) */ -OP(cb,af) { A = RES(5,A); } /* RES 5,A */ - -OP(cb,b0) { B = RES(6,B); } /* RES 6,B */ -OP(cb,b1) { C = RES(6,C); } /* RES 6,C */ -OP(cb,b2) { D = RES(6,D); } /* RES 6,D */ -OP(cb,b3) { E = RES(6,E); } /* RES 6,E */ -OP(cb,b4) { H = RES(6,H); } /* RES 6,H */ -OP(cb,b5) { L = RES(6,L); } /* RES 6,L */ -OP(cb,b6) { WM( HL, RES(6,RM(HL)) ); } /* RES 6,(HL) */ -OP(cb,b7) { A = RES(6,A); } /* RES 6,A */ - -OP(cb,b8) { B = RES(7,B); } /* RES 7,B */ -OP(cb,b9) { C = RES(7,C); } /* RES 7,C */ -OP(cb,ba) { D = RES(7,D); } /* RES 7,D */ -OP(cb,bb) { E = RES(7,E); } /* RES 7,E */ -OP(cb,bc) { H = RES(7,H); } /* RES 7,H */ -OP(cb,bd) { L = RES(7,L); } /* RES 7,L */ -OP(cb,be) { WM( HL, RES(7,RM(HL)) ); } /* RES 7,(HL) */ -OP(cb,bf) { A = RES(7,A); } /* RES 7,A */ - -OP(cb,c0) { B = SET(0,B); } /* SET 0,B */ -OP(cb,c1) { C = SET(0,C); } /* SET 0,C */ -OP(cb,c2) { D = SET(0,D); } /* SET 0,D */ -OP(cb,c3) { E = SET(0,E); } /* SET 0,E */ -OP(cb,c4) { H = SET(0,H); } /* SET 0,H */ -OP(cb,c5) { L = SET(0,L); } /* SET 0,L */ -OP(cb,c6) { WM( HL, SET(0,RM(HL)) ); } /* SET 0,(HL) */ -OP(cb,c7) { A = SET(0,A); } /* SET 0,A */ - -OP(cb,c8) { B = SET(1,B); } /* SET 1,B */ -OP(cb,c9) { C = SET(1,C); } /* SET 1,C */ -OP(cb,ca) { D = SET(1,D); } /* SET 1,D */ -OP(cb,cb) { E = SET(1,E); } /* SET 1,E */ -OP(cb,cc) { H = SET(1,H); } /* SET 1,H */ -OP(cb,cd) { L = SET(1,L); } /* SET 1,L */ -OP(cb,ce) { WM( HL, SET(1,RM(HL)) ); } /* SET 1,(HL) */ -OP(cb,cf) { A = SET(1,A); } /* SET 1,A */ - -OP(cb,d0) { B = SET(2,B); } /* SET 2,B */ -OP(cb,d1) { C = SET(2,C); } /* SET 2,C */ -OP(cb,d2) { D = SET(2,D); } /* SET 2,D */ -OP(cb,d3) { E = SET(2,E); } /* SET 2,E */ -OP(cb,d4) { H = SET(2,H); } /* SET 2,H */ -OP(cb,d5) { L = SET(2,L); } /* SET 2,L */ -OP(cb,d6) { WM( HL, SET(2,RM(HL)) ); } /* SET 2,(HL) */ -OP(cb,d7) { A = SET(2,A); } /* SET 2,A */ - -OP(cb,d8) { B = SET(3,B); } /* SET 3,B */ -OP(cb,d9) { C = SET(3,C); } /* SET 3,C */ -OP(cb,da) { D = SET(3,D); } /* SET 3,D */ -OP(cb,db) { E = SET(3,E); } /* SET 3,E */ -OP(cb,dc) { H = SET(3,H); } /* SET 3,H */ -OP(cb,dd) { L = SET(3,L); } /* SET 3,L */ -OP(cb,de) { WM( HL, SET(3,RM(HL)) ); } /* SET 3,(HL) */ -OP(cb,df) { A = SET(3,A); } /* SET 3,A */ - -OP(cb,e0) { B = SET(4,B); } /* SET 4,B */ -OP(cb,e1) { C = SET(4,C); } /* SET 4,C */ -OP(cb,e2) { D = SET(4,D); } /* SET 4,D */ -OP(cb,e3) { E = SET(4,E); } /* SET 4,E */ -OP(cb,e4) { H = SET(4,H); } /* SET 4,H */ -OP(cb,e5) { L = SET(4,L); } /* SET 4,L */ -OP(cb,e6) { WM( HL, SET(4,RM(HL)) ); } /* SET 4,(HL) */ -OP(cb,e7) { A = SET(4,A); } /* SET 4,A */ - -OP(cb,e8) { B = SET(5,B); } /* SET 5,B */ -OP(cb,e9) { C = SET(5,C); } /* SET 5,C */ -OP(cb,ea) { D = SET(5,D); } /* SET 5,D */ -OP(cb,eb) { E = SET(5,E); } /* SET 5,E */ -OP(cb,ec) { H = SET(5,H); } /* SET 5,H */ -OP(cb,ed) { L = SET(5,L); } /* SET 5,L */ -OP(cb,ee) { WM( HL, SET(5,RM(HL)) ); } /* SET 5,(HL) */ -OP(cb,ef) { A = SET(5,A); } /* SET 5,A */ - -OP(cb,f0) { B = SET(6,B); } /* SET 6,B */ -OP(cb,f1) { C = SET(6,C); } /* SET 6,C */ -OP(cb,f2) { D = SET(6,D); } /* SET 6,D */ -OP(cb,f3) { E = SET(6,E); } /* SET 6,E */ -OP(cb,f4) { H = SET(6,H); } /* SET 6,H */ -OP(cb,f5) { L = SET(6,L); } /* SET 6,L */ -OP(cb,f6) { WM( HL, SET(6,RM(HL)) ); } /* SET 6,(HL) */ -OP(cb,f7) { A = SET(6,A); } /* SET 6,A */ - -OP(cb,f8) { B = SET(7,B); } /* SET 7,B */ -OP(cb,f9) { C = SET(7,C); } /* SET 7,C */ -OP(cb,fa) { D = SET(7,D); } /* SET 7,D */ -OP(cb,fb) { E = SET(7,E); } /* SET 7,E */ -OP(cb,fc) { H = SET(7,H); } /* SET 7,H */ -OP(cb,fd) { L = SET(7,L); } /* SET 7,L */ -OP(cb,fe) { WM( HL, SET(7,RM(HL)) ); } /* SET 7,(HL) */ -OP(cb,ff) { A = SET(7,A); } /* SET 7,A */ - - -/********************************************************** -* opcodes with DD/FD CB prefix -* rotate, shift and bit operations with (IX+o) -**********************************************************/ -OP(xycb,00) { B = RLC( RM(EA) ); WM( EA,B ); } /* RLC B=(XY+o) */ -OP(xycb,01) { C = RLC( RM(EA) ); WM( EA,C ); } /* RLC C=(XY+o) */ -OP(xycb,02) { D = RLC( RM(EA) ); WM( EA,D ); } /* RLC D=(XY+o) */ -OP(xycb,03) { E = RLC( RM(EA) ); WM( EA,E ); } /* RLC E=(XY+o) */ -OP(xycb,04) { H = RLC( RM(EA) ); WM( EA,H ); } /* RLC H=(XY+o) */ -OP(xycb,05) { L = RLC( RM(EA) ); WM( EA,L ); } /* RLC L=(XY+o) */ -OP(xycb,06) { WM( EA, RLC( RM(EA) ) ); } /* RLC (XY+o) */ -OP(xycb,07) { A = RLC( RM(EA) ); WM( EA,A ); } /* RLC A=(XY+o) */ - -OP(xycb,08) { B = RRC( RM(EA) ); WM( EA,B ); } /* RRC B=(XY+o) */ -OP(xycb,09) { C = RRC( RM(EA) ); WM( EA,C ); } /* RRC C=(XY+o) */ -OP(xycb,0a) { D = RRC( RM(EA) ); WM( EA,D ); } /* RRC D=(XY+o) */ -OP(xycb,0b) { E = RRC( RM(EA) ); WM( EA,E ); } /* RRC E=(XY+o) */ -OP(xycb,0c) { H = RRC( RM(EA) ); WM( EA,H ); } /* RRC H=(XY+o) */ -OP(xycb,0d) { L = RRC( RM(EA) ); WM( EA,L ); } /* RRC L=(XY+o) */ -OP(xycb,0e) { WM( EA,RRC( RM(EA) ) ); } /* RRC (XY+o) */ -OP(xycb,0f) { A = RRC( RM(EA) ); WM( EA,A ); } /* RRC A=(XY+o) */ - -OP(xycb,10) { B = RL( RM(EA) ); WM( EA,B ); } /* RL B=(XY+o) */ -OP(xycb,11) { C = RL( RM(EA) ); WM( EA,C ); } /* RL C=(XY+o) */ -OP(xycb,12) { D = RL( RM(EA) ); WM( EA,D ); } /* RL D=(XY+o) */ -OP(xycb,13) { E = RL( RM(EA) ); WM( EA,E ); } /* RL E=(XY+o) */ -OP(xycb,14) { H = RL( RM(EA) ); WM( EA,H ); } /* RL H=(XY+o) */ -OP(xycb,15) { L = RL( RM(EA) ); WM( EA,L ); } /* RL L=(XY+o) */ -OP(xycb,16) { WM( EA,RL( RM(EA) ) ); } /* RL (XY+o) */ -OP(xycb,17) { A = RL( RM(EA) ); WM( EA,A ); } /* RL A=(XY+o) */ - -OP(xycb,18) { B = RR( RM(EA) ); WM( EA,B ); } /* RR B=(XY+o) */ -OP(xycb,19) { C = RR( RM(EA) ); WM( EA,C ); } /* RR C=(XY+o) */ -OP(xycb,1a) { D = RR( RM(EA) ); WM( EA,D ); } /* RR D=(XY+o) */ -OP(xycb,1b) { E = RR( RM(EA) ); WM( EA,E ); } /* RR E=(XY+o) */ -OP(xycb,1c) { H = RR( RM(EA) ); WM( EA,H ); } /* RR H=(XY+o) */ -OP(xycb,1d) { L = RR( RM(EA) ); WM( EA,L ); } /* RR L=(XY+o) */ -OP(xycb,1e) { WM( EA,RR( RM(EA) ) ); } /* RR (XY+o) */ -OP(xycb,1f) { A = RR( RM(EA) ); WM( EA,A ); } /* RR A=(XY+o) */ - -OP(xycb,20) { B = SLA( RM(EA) ); WM( EA,B ); } /* SLA B=(XY+o) */ -OP(xycb,21) { C = SLA( RM(EA) ); WM( EA,C ); } /* SLA C=(XY+o) */ -OP(xycb,22) { D = SLA( RM(EA) ); WM( EA,D ); } /* SLA D=(XY+o) */ -OP(xycb,23) { E = SLA( RM(EA) ); WM( EA,E ); } /* SLA E=(XY+o) */ -OP(xycb,24) { H = SLA( RM(EA) ); WM( EA,H ); } /* SLA H=(XY+o) */ -OP(xycb,25) { L = SLA( RM(EA) ); WM( EA,L ); } /* SLA L=(XY+o) */ -OP(xycb,26) { WM( EA,SLA( RM(EA) ) ); } /* SLA (XY+o) */ -OP(xycb,27) { A = SLA( RM(EA) ); WM( EA,A ); } /* SLA A=(XY+o) */ - -OP(xycb,28) { B = SRA( RM(EA) ); WM( EA,B ); } /* SRA B=(XY+o) */ -OP(xycb,29) { C = SRA( RM(EA) ); WM( EA,C ); } /* SRA C=(XY+o) */ -OP(xycb,2a) { D = SRA( RM(EA) ); WM( EA,D ); } /* SRA D=(XY+o) */ -OP(xycb,2b) { E = SRA( RM(EA) ); WM( EA,E ); } /* SRA E=(XY+o) */ -OP(xycb,2c) { H = SRA( RM(EA) ); WM( EA,H ); } /* SRA H=(XY+o) */ -OP(xycb,2d) { L = SRA( RM(EA) ); WM( EA,L ); } /* SRA L=(XY+o) */ -OP(xycb,2e) { WM( EA,SRA( RM(EA) ) ); } /* SRA (XY+o) */ -OP(xycb,2f) { A = SRA( RM(EA) ); WM( EA,A ); } /* SRA A=(XY+o) */ - -OP(xycb,30) { B = SLL( RM(EA) ); WM( EA,B ); } /* SLL B=(XY+o) */ -OP(xycb,31) { C = SLL( RM(EA) ); WM( EA,C ); } /* SLL C=(XY+o) */ -OP(xycb,32) { D = SLL( RM(EA) ); WM( EA,D ); } /* SLL D=(XY+o) */ -OP(xycb,33) { E = SLL( RM(EA) ); WM( EA,E ); } /* SLL E=(XY+o) */ -OP(xycb,34) { H = SLL( RM(EA) ); WM( EA,H ); } /* SLL H=(XY+o) */ -OP(xycb,35) { L = SLL( RM(EA) ); WM( EA,L ); } /* SLL L=(XY+o) */ -OP(xycb,36) { WM( EA,SLL( RM(EA) ) ); } /* SLL (XY+o) */ -OP(xycb,37) { A = SLL( RM(EA) ); WM( EA,A ); } /* SLL A=(XY+o) */ - -OP(xycb,38) { B = SRL( RM(EA) ); WM( EA,B ); } /* SRL B=(XY+o) */ -OP(xycb,39) { C = SRL( RM(EA) ); WM( EA,C ); } /* SRL C=(XY+o) */ -OP(xycb,3a) { D = SRL( RM(EA) ); WM( EA,D ); } /* SRL D=(XY+o) */ -OP(xycb,3b) { E = SRL( RM(EA) ); WM( EA,E ); } /* SRL E=(XY+o) */ -OP(xycb,3c) { H = SRL( RM(EA) ); WM( EA,H ); } /* SRL H=(XY+o) */ -OP(xycb,3d) { L = SRL( RM(EA) ); WM( EA,L ); } /* SRL L=(XY+o) */ -OP(xycb,3e) { WM( EA,SRL( RM(EA) ) ); } /* SRL (XY+o) */ -OP(xycb,3f) { A = SRL( RM(EA) ); WM( EA,A ); } /* SRL A=(XY+o) */ - -OP(xycb,40) { xycb_46(); } /* BIT 0,(XY+o) */ -OP(xycb,41) { xycb_46(); } /* BIT 0,(XY+o) */ -OP(xycb,42) { xycb_46(); } /* BIT 0,(XY+o) */ -OP(xycb,43) { xycb_46(); } /* BIT 0,(XY+o) */ -OP(xycb,44) { xycb_46(); } /* BIT 0,(XY+o) */ -OP(xycb,45) { xycb_46(); } /* BIT 0,(XY+o) */ -OP(xycb,46) { BIT_XY(0,RM(EA)); } /* BIT 0,(XY+o) */ -OP(xycb,47) { xycb_46(); } /* BIT 0,(XY+o) */ - -OP(xycb,48) { xycb_4e(); } /* BIT 1,(XY+o) */ -OP(xycb,49) { xycb_4e(); } /* BIT 1,(XY+o) */ -OP(xycb,4a) { xycb_4e(); } /* BIT 1,(XY+o) */ -OP(xycb,4b) { xycb_4e(); } /* BIT 1,(XY+o) */ -OP(xycb,4c) { xycb_4e(); } /* BIT 1,(XY+o) */ -OP(xycb,4d) { xycb_4e(); } /* BIT 1,(XY+o) */ -OP(xycb,4e) { BIT_XY(1,RM(EA)); } /* BIT 1,(XY+o) */ -OP(xycb,4f) { xycb_4e(); } /* BIT 1,(XY+o) */ - -OP(xycb,50) { xycb_56(); } /* BIT 2,(XY+o) */ -OP(xycb,51) { xycb_56(); } /* BIT 2,(XY+o) */ -OP(xycb,52) { xycb_56(); } /* BIT 2,(XY+o) */ -OP(xycb,53) { xycb_56(); } /* BIT 2,(XY+o) */ -OP(xycb,54) { xycb_56(); } /* BIT 2,(XY+o) */ -OP(xycb,55) { xycb_56(); } /* BIT 2,(XY+o) */ -OP(xycb,56) { BIT_XY(2,RM(EA)); } /* BIT 2,(XY+o) */ -OP(xycb,57) { xycb_56(); } /* BIT 2,(XY+o) */ - -OP(xycb,58) { xycb_5e(); } /* BIT 3,(XY+o) */ -OP(xycb,59) { xycb_5e(); } /* BIT 3,(XY+o) */ -OP(xycb,5a) { xycb_5e(); } /* BIT 3,(XY+o) */ -OP(xycb,5b) { xycb_5e(); } /* BIT 3,(XY+o) */ -OP(xycb,5c) { xycb_5e(); } /* BIT 3,(XY+o) */ -OP(xycb,5d) { xycb_5e(); } /* BIT 3,(XY+o) */ -OP(xycb,5e) { BIT_XY(3,RM(EA)); } /* BIT 3,(XY+o) */ -OP(xycb,5f) { xycb_5e(); } /* BIT 3,(XY+o) */ - -OP(xycb,60) { xycb_66(); } /* BIT 4,(XY+o) */ -OP(xycb,61) { xycb_66(); } /* BIT 4,(XY+o) */ -OP(xycb,62) { xycb_66(); } /* BIT 4,(XY+o) */ -OP(xycb,63) { xycb_66(); } /* BIT 4,(XY+o) */ -OP(xycb,64) { xycb_66(); } /* BIT 4,(XY+o) */ -OP(xycb,65) { xycb_66(); } /* BIT 4,(XY+o) */ -OP(xycb,66) { BIT_XY(4,RM(EA)); } /* BIT 4,(XY+o) */ -OP(xycb,67) { xycb_66(); } /* BIT 4,(XY+o) */ - -OP(xycb,68) { xycb_6e(); } /* BIT 5,(XY+o) */ -OP(xycb,69) { xycb_6e(); } /* BIT 5,(XY+o) */ -OP(xycb,6a) { xycb_6e(); } /* BIT 5,(XY+o) */ -OP(xycb,6b) { xycb_6e(); } /* BIT 5,(XY+o) */ -OP(xycb,6c) { xycb_6e(); } /* BIT 5,(XY+o) */ -OP(xycb,6d) { xycb_6e(); } /* BIT 5,(XY+o) */ -OP(xycb,6e) { BIT_XY(5,RM(EA)); } /* BIT 5,(XY+o) */ -OP(xycb,6f) { xycb_6e(); } /* BIT 5,(XY+o) */ - -OP(xycb,70) { xycb_66(); } /* BIT 6,(XY+o) */ -OP(xycb,71) { xycb_66(); } /* BIT 6,(XY+o) */ -OP(xycb,72) { xycb_66(); } /* BIT 6,(XY+o) */ -OP(xycb,73) { xycb_66(); } /* BIT 6,(XY+o) */ -OP(xycb,74) { xycb_66(); } /* BIT 6,(XY+o) */ -OP(xycb,75) { xycb_66(); } /* BIT 6,(XY+o) */ -OP(xycb,76) { BIT_XY(6,RM(EA)); } /* BIT 6,(XY+o) */ -OP(xycb,77) { xycb_66(); } /* BIT 6,(XY+o) */ - -OP(xycb,78) { xycb_7e(); } /* BIT 7,(XY+o) */ -OP(xycb,79) { xycb_7e(); } /* BIT 7,(XY+o) */ -OP(xycb,7a) { xycb_7e(); } /* BIT 7,(XY+o) */ -OP(xycb,7b) { xycb_7e(); } /* BIT 7,(XY+o) */ -OP(xycb,7c) { xycb_7e(); } /* BIT 7,(XY+o) */ -OP(xycb,7d) { xycb_7e(); } /* BIT 7,(XY+o) */ -OP(xycb,7e) { BIT_XY(7,RM(EA)); } /* BIT 7,(XY+o) */ -OP(xycb,7f) { xycb_7e(); } /* BIT 7,(XY+o) */ - -OP(xycb,80) { B = RES(0, RM(EA) ); WM( EA,B ); } /* RES 0,B=(XY+o) */ -OP(xycb,81) { C = RES(0, RM(EA) ); WM( EA,C ); } /* RES 0,C=(XY+o) */ -OP(xycb,82) { D = RES(0, RM(EA) ); WM( EA,D ); } /* RES 0,D=(XY+o) */ -OP(xycb,83) { E = RES(0, RM(EA) ); WM( EA,E ); } /* RES 0,E=(XY+o) */ -OP(xycb,84) { H = RES(0, RM(EA) ); WM( EA,H ); } /* RES 0,H=(XY+o) */ -OP(xycb,85) { L = RES(0, RM(EA) ); WM( EA,L ); } /* RES 0,L=(XY+o) */ -OP(xycb,86) { WM( EA, RES(0,RM(EA)) ); } /* RES 0,(XY+o) */ -OP(xycb,87) { A = RES(0, RM(EA) ); WM( EA,A ); } /* RES 0,A=(XY+o) */ - -OP(xycb,88) { B = RES(1, RM(EA) ); WM( EA,B ); } /* RES 1,B=(XY+o) */ -OP(xycb,89) { C = RES(1, RM(EA) ); WM( EA,C ); } /* RES 1,C=(XY+o) */ -OP(xycb,8a) { D = RES(1, RM(EA) ); WM( EA,D ); } /* RES 1,D=(XY+o) */ -OP(xycb,8b) { E = RES(1, RM(EA) ); WM( EA,E ); } /* RES 1,E=(XY+o) */ -OP(xycb,8c) { H = RES(1, RM(EA) ); WM( EA,H ); } /* RES 1,H=(XY+o) */ -OP(xycb,8d) { L = RES(1, RM(EA) ); WM( EA,L ); } /* RES 1,L=(XY+o) */ -OP(xycb,8e) { WM( EA, RES(1,RM(EA)) ); } /* RES 1,(XY+o) */ -OP(xycb,8f) { A = RES(1, RM(EA) ); WM( EA,A ); } /* RES 1,A=(XY+o) */ - -OP(xycb,90) { B = RES(2, RM(EA) ); WM( EA,B ); } /* RES 2,B=(XY+o) */ -OP(xycb,91) { C = RES(2, RM(EA) ); WM( EA,C ); } /* RES 2,C=(XY+o) */ -OP(xycb,92) { D = RES(2, RM(EA) ); WM( EA,D ); } /* RES 2,D=(XY+o) */ -OP(xycb,93) { E = RES(2, RM(EA) ); WM( EA,E ); } /* RES 2,E=(XY+o) */ -OP(xycb,94) { H = RES(2, RM(EA) ); WM( EA,H ); } /* RES 2,H=(XY+o) */ -OP(xycb,95) { L = RES(2, RM(EA) ); WM( EA,L ); } /* RES 2,L=(XY+o) */ -OP(xycb,96) { WM( EA, RES(2,RM(EA)) ); } /* RES 2,(XY+o) */ -OP(xycb,97) { A = RES(2, RM(EA) ); WM( EA,A ); } /* RES 2,A=(XY+o) */ - -OP(xycb,98) { B = RES(3, RM(EA) ); WM( EA,B ); } /* RES 3,B=(XY+o) */ -OP(xycb,99) { C = RES(3, RM(EA) ); WM( EA,C ); } /* RES 3,C=(XY+o) */ -OP(xycb,9a) { D = RES(3, RM(EA) ); WM( EA,D ); } /* RES 3,D=(XY+o) */ -OP(xycb,9b) { E = RES(3, RM(EA) ); WM( EA,E ); } /* RES 3,E=(XY+o) */ -OP(xycb,9c) { H = RES(3, RM(EA) ); WM( EA,H ); } /* RES 3,H=(XY+o) */ -OP(xycb,9d) { L = RES(3, RM(EA) ); WM( EA,L ); } /* RES 3,L=(XY+o) */ -OP(xycb,9e) { WM( EA, RES(3,RM(EA)) ); } /* RES 3,(XY+o) */ -OP(xycb,9f) { A = RES(3, RM(EA) ); WM( EA,A ); } /* RES 3,A=(XY+o) */ - -OP(xycb,a0) { B = RES(4, RM(EA) ); WM( EA,B ); } /* RES 4,B=(XY+o) */ -OP(xycb,a1) { C = RES(4, RM(EA) ); WM( EA,C ); } /* RES 4,C=(XY+o) */ -OP(xycb,a2) { D = RES(4, RM(EA) ); WM( EA,D ); } /* RES 4,D=(XY+o) */ -OP(xycb,a3) { E = RES(4, RM(EA) ); WM( EA,E ); } /* RES 4,E=(XY+o) */ -OP(xycb,a4) { H = RES(4, RM(EA) ); WM( EA,H ); } /* RES 4,H=(XY+o) */ -OP(xycb,a5) { L = RES(4, RM(EA) ); WM( EA,L ); } /* RES 4,L=(XY+o) */ -OP(xycb,a6) { WM( EA, RES(4,RM(EA)) ); } /* RES 4,(XY+o) */ -OP(xycb,a7) { A = RES(4, RM(EA) ); WM( EA,A ); } /* RES 4,A=(XY+o) */ - -OP(xycb,a8) { B = RES(5, RM(EA) ); WM( EA,B ); } /* RES 5,B=(XY+o) */ -OP(xycb,a9) { C = RES(5, RM(EA) ); WM( EA,C ); } /* RES 5,C=(XY+o) */ -OP(xycb,aa) { D = RES(5, RM(EA) ); WM( EA,D ); } /* RES 5,D=(XY+o) */ -OP(xycb,ab) { E = RES(5, RM(EA) ); WM( EA,E ); } /* RES 5,E=(XY+o) */ -OP(xycb,ac) { H = RES(5, RM(EA) ); WM( EA,H ); } /* RES 5,H=(XY+o) */ -OP(xycb,ad) { L = RES(5, RM(EA) ); WM( EA,L ); } /* RES 5,L=(XY+o) */ -OP(xycb,ae) { WM( EA, RES(5,RM(EA)) ); } /* RES 5,(XY+o) */ -OP(xycb,af) { A = RES(5, RM(EA) ); WM( EA,A ); } /* RES 5,A=(XY+o) */ - -OP(xycb,b0) { B = RES(6, RM(EA) ); WM( EA,B ); } /* RES 6,B=(XY+o) */ -OP(xycb,b1) { C = RES(6, RM(EA) ); WM( EA,C ); } /* RES 6,C=(XY+o) */ -OP(xycb,b2) { D = RES(6, RM(EA) ); WM( EA,D ); } /* RES 6,D=(XY+o) */ -OP(xycb,b3) { E = RES(6, RM(EA) ); WM( EA,E ); } /* RES 6,E=(XY+o) */ -OP(xycb,b4) { H = RES(6, RM(EA) ); WM( EA,H ); } /* RES 6,H=(XY+o) */ -OP(xycb,b5) { L = RES(6, RM(EA) ); WM( EA,L ); } /* RES 6,L=(XY+o) */ -OP(xycb,b6) { WM( EA, RES(6,RM(EA)) ); } /* RES 6,(XY+o) */ -OP(xycb,b7) { A = RES(6, RM(EA) ); WM( EA,A ); } /* RES 6,A=(XY+o) */ - -OP(xycb,b8) { B = RES(7, RM(EA) ); WM( EA,B ); } /* RES 7,B=(XY+o) */ -OP(xycb,b9) { C = RES(7, RM(EA) ); WM( EA,C ); } /* RES 7,C=(XY+o) */ -OP(xycb,ba) { D = RES(7, RM(EA) ); WM( EA,D ); } /* RES 7,D=(XY+o) */ -OP(xycb,bb) { E = RES(7, RM(EA) ); WM( EA,E ); } /* RES 7,E=(XY+o) */ -OP(xycb,bc) { H = RES(7, RM(EA) ); WM( EA,H ); } /* RES 7,H=(XY+o) */ -OP(xycb,bd) { L = RES(7, RM(EA) ); WM( EA,L ); } /* RES 7,L=(XY+o) */ -OP(xycb,be) { WM( EA, RES(7,RM(EA)) ); } /* RES 7,(XY+o) */ -OP(xycb,bf) { A = RES(7, RM(EA) ); WM( EA,A ); } /* RES 7,A=(XY+o) */ - -OP(xycb,c0) { B = SET(0, RM(EA) ); WM( EA,B ); } /* SET 0,B=(XY+o) */ -OP(xycb,c1) { C = SET(0, RM(EA) ); WM( EA,C ); } /* SET 0,C=(XY+o) */ -OP(xycb,c2) { D = SET(0, RM(EA) ); WM( EA,D ); } /* SET 0,D=(XY+o) */ -OP(xycb,c3) { E = SET(0, RM(EA) ); WM( EA,E ); } /* SET 0,E=(XY+o) */ -OP(xycb,c4) { H = SET(0, RM(EA) ); WM( EA,H ); } /* SET 0,H=(XY+o) */ -OP(xycb,c5) { L = SET(0, RM(EA) ); WM( EA,L ); } /* SET 0,L=(XY+o) */ -OP(xycb,c6) { WM( EA, SET(0,RM(EA)) ); } /* SET 0,(XY+o) */ -OP(xycb,c7) { A = SET(0, RM(EA) ); WM( EA,A ); } /* SET 0,A=(XY+o) */ - -OP(xycb,c8) { B = SET(1, RM(EA) ); WM( EA,B ); } /* SET 1,B=(XY+o) */ -OP(xycb,c9) { C = SET(1, RM(EA) ); WM( EA,C ); } /* SET 1,C=(XY+o) */ -OP(xycb,ca) { D = SET(1, RM(EA) ); WM( EA,D ); } /* SET 1,D=(XY+o) */ -OP(xycb,cb) { E = SET(1, RM(EA) ); WM( EA,E ); } /* SET 1,E=(XY+o) */ -OP(xycb,cc) { H = SET(1, RM(EA) ); WM( EA,H ); } /* SET 1,H=(XY+o) */ -OP(xycb,cd) { L = SET(1, RM(EA) ); WM( EA,L ); } /* SET 1,L=(XY+o) */ -OP(xycb,ce) { WM( EA, SET(1,RM(EA)) ); } /* SET 1,(XY+o) */ -OP(xycb,cf) { A = SET(1, RM(EA) ); WM( EA,A ); } /* SET 1,A=(XY+o) */ - -OP(xycb,d0) { B = SET(2, RM(EA) ); WM( EA,B ); } /* SET 2,B=(XY+o) */ -OP(xycb,d1) { C = SET(2, RM(EA) ); WM( EA,C ); } /* SET 2,C=(XY+o) */ -OP(xycb,d2) { D = SET(2, RM(EA) ); WM( EA,D ); } /* SET 2,D=(XY+o) */ -OP(xycb,d3) { E = SET(2, RM(EA) ); WM( EA,E ); } /* SET 2,E=(XY+o) */ -OP(xycb,d4) { H = SET(2, RM(EA) ); WM( EA,H ); } /* SET 2,H=(XY+o) */ -OP(xycb,d5) { L = SET(2, RM(EA) ); WM( EA,L ); } /* SET 2,L=(XY+o) */ -OP(xycb,d6) { WM( EA, SET(2,RM(EA)) ); } /* SET 2,(XY+o) */ -OP(xycb,d7) { A = SET(2, RM(EA) ); WM( EA,A ); } /* SET 2,A=(XY+o) */ - -OP(xycb,d8) { B = SET(3, RM(EA) ); WM( EA,B ); } /* SET 3,B=(XY+o) */ -OP(xycb,d9) { C = SET(3, RM(EA) ); WM( EA,C ); } /* SET 3,C=(XY+o) */ -OP(xycb,da) { D = SET(3, RM(EA) ); WM( EA,D ); } /* SET 3,D=(XY+o) */ -OP(xycb,db) { E = SET(3, RM(EA) ); WM( EA,E ); } /* SET 3,E=(XY+o) */ -OP(xycb,dc) { H = SET(3, RM(EA) ); WM( EA,H ); } /* SET 3,H=(XY+o) */ -OP(xycb,dd) { L = SET(3, RM(EA) ); WM( EA,L ); } /* SET 3,L=(XY+o) */ -OP(xycb,de) { WM( EA, SET(3,RM(EA)) ); } /* SET 3,(XY+o) */ -OP(xycb,df) { A = SET(3, RM(EA) ); WM( EA,A ); } /* SET 3,A=(XY+o) */ - -OP(xycb,e0) { B = SET(4, RM(EA) ); WM( EA,B ); } /* SET 4,B=(XY+o) */ -OP(xycb,e1) { C = SET(4, RM(EA) ); WM( EA,C ); } /* SET 4,C=(XY+o) */ -OP(xycb,e2) { D = SET(4, RM(EA) ); WM( EA,D ); } /* SET 4,D=(XY+o) */ -OP(xycb,e3) { E = SET(4, RM(EA) ); WM( EA,E ); } /* SET 4,E=(XY+o) */ -OP(xycb,e4) { H = SET(4, RM(EA) ); WM( EA,H ); } /* SET 4,H=(XY+o) */ -OP(xycb,e5) { L = SET(4, RM(EA) ); WM( EA,L ); } /* SET 4,L=(XY+o) */ -OP(xycb,e6) { WM( EA, SET(4,RM(EA)) ); } /* SET 4,(XY+o) */ -OP(xycb,e7) { A = SET(4, RM(EA) ); WM( EA,A ); } /* SET 4,A=(XY+o) */ - -OP(xycb,e8) { B = SET(5, RM(EA) ); WM( EA,B ); } /* SET 5,B=(XY+o) */ -OP(xycb,e9) { C = SET(5, RM(EA) ); WM( EA,C ); } /* SET 5,C=(XY+o) */ -OP(xycb,ea) { D = SET(5, RM(EA) ); WM( EA,D ); } /* SET 5,D=(XY+o) */ -OP(xycb,eb) { E = SET(5, RM(EA) ); WM( EA,E ); } /* SET 5,E=(XY+o) */ -OP(xycb,ec) { H = SET(5, RM(EA) ); WM( EA,H ); } /* SET 5,H=(XY+o) */ -OP(xycb,ed) { L = SET(5, RM(EA) ); WM( EA,L ); } /* SET 5,L=(XY+o) */ -OP(xycb,ee) { WM( EA, SET(5,RM(EA)) ); } /* SET 5,(XY+o) */ -OP(xycb,ef) { A = SET(5, RM(EA) ); WM( EA,A ); } /* SET 5,A=(XY+o) */ - -OP(xycb,f0) { B = SET(6, RM(EA) ); WM( EA,B ); } /* SET 6,B=(XY+o) */ -OP(xycb,f1) { C = SET(6, RM(EA) ); WM( EA,C ); } /* SET 6,C=(XY+o) */ -OP(xycb,f2) { D = SET(6, RM(EA) ); WM( EA,D ); } /* SET 6,D=(XY+o) */ -OP(xycb,f3) { E = SET(6, RM(EA) ); WM( EA,E ); } /* SET 6,E=(XY+o) */ -OP(xycb,f4) { H = SET(6, RM(EA) ); WM( EA,H ); } /* SET 6,H=(XY+o) */ -OP(xycb,f5) { L = SET(6, RM(EA) ); WM( EA,L ); } /* SET 6,L=(XY+o) */ -OP(xycb,f6) { WM( EA, SET(6,RM(EA)) ); } /* SET 6,(XY+o) */ -OP(xycb,f7) { A = SET(6, RM(EA) ); WM( EA,A ); } /* SET 6,A=(XY+o) */ - -OP(xycb,f8) { B = SET(7, RM(EA) ); WM( EA,B ); } /* SET 7,B=(XY+o) */ -OP(xycb,f9) { C = SET(7, RM(EA) ); WM( EA,C ); } /* SET 7,C=(XY+o) */ -OP(xycb,fa) { D = SET(7, RM(EA) ); WM( EA,D ); } /* SET 7,D=(XY+o) */ -OP(xycb,fb) { E = SET(7, RM(EA) ); WM( EA,E ); } /* SET 7,E=(XY+o) */ -OP(xycb,fc) { H = SET(7, RM(EA) ); WM( EA,H ); } /* SET 7,H=(XY+o) */ -OP(xycb,fd) { L = SET(7, RM(EA) ); WM( EA,L ); } /* SET 7,L=(XY+o) */ -OP(xycb,fe) { WM( EA, SET(7,RM(EA)) ); } /* SET 7,(XY+o) */ -OP(xycb,ff) { A = SET(7, RM(EA) ); WM( EA,A ); } /* SET 7,A=(XY+o) */ - -OP(illegal,1) { -// logerror("Z80 #%d ill. opcode $%02x $%02x\n", -// cpu_getactivecpu(), cpu_readop((PCD-1)&0xffff), cpu_readop(PCD)); -} - -/********************************************************** - * IX register related opcodes (DD prefix) - **********************************************************/ -OP(dd,00) { illegal_1(); op_00(); } /* DB DD */ -OP(dd,01) { illegal_1(); op_01(); } /* DB DD */ -OP(dd,02) { illegal_1(); op_02(); } /* DB DD */ -OP(dd,03) { illegal_1(); op_03(); } /* DB DD */ -OP(dd,04) { illegal_1(); op_04(); } /* DB DD */ -OP(dd,05) { illegal_1(); op_05(); } /* DB DD */ -OP(dd,06) { illegal_1(); op_06(); } /* DB DD */ -OP(dd,07) { illegal_1(); op_07(); } /* DB DD */ - -OP(dd,08) { illegal_1(); op_08(); } /* DB DD */ -OP(dd,09) { ADD16(ix,bc); } /* ADD IX,BC */ -OP(dd,0a) { illegal_1(); op_0a(); } /* DB DD */ -OP(dd,0b) { illegal_1(); op_0b(); } /* DB DD */ -OP(dd,0c) { illegal_1(); op_0c(); } /* DB DD */ -OP(dd,0d) { illegal_1(); op_0d(); } /* DB DD */ -OP(dd,0e) { illegal_1(); op_0e(); } /* DB DD */ -OP(dd,0f) { illegal_1(); op_0f(); } /* DB DD */ - -OP(dd,10) { illegal_1(); op_10(); } /* DB DD */ -OP(dd,11) { illegal_1(); op_11(); } /* DB DD */ -OP(dd,12) { illegal_1(); op_12(); } /* DB DD */ -OP(dd,13) { illegal_1(); op_13(); } /* DB DD */ -OP(dd,14) { illegal_1(); op_14(); } /* DB DD */ -OP(dd,15) { illegal_1(); op_15(); } /* DB DD */ -OP(dd,16) { illegal_1(); op_16(); } /* DB DD */ -OP(dd,17) { illegal_1(); op_17(); } /* DB DD */ - -OP(dd,18) { illegal_1(); op_18(); } /* DB DD */ -OP(dd,19) { ADD16(ix,de); } /* ADD IX,DE */ -OP(dd,1a) { illegal_1(); op_1a(); } /* DB DD */ -OP(dd,1b) { illegal_1(); op_1b(); } /* DB DD */ -OP(dd,1c) { illegal_1(); op_1c(); } /* DB DD */ -OP(dd,1d) { illegal_1(); op_1d(); } /* DB DD */ -OP(dd,1e) { illegal_1(); op_1e(); } /* DB DD */ -OP(dd,1f) { illegal_1(); op_1f(); } /* DB DD */ - -OP(dd,20) { illegal_1(); op_20(); } /* DB DD */ -OP(dd,21) { IX = ARG16(); } /* LD IX,w */ -OP(dd,22) { EA = ARG16(); WM16( EA, &Z80.ix ); } /* LD (w),IX */ -OP(dd,23) { IX++; } /* INC IX */ -OP(dd,24) { HX = INC(HX); } /* INC HX */ -OP(dd,25) { HX = DEC(HX); } /* DEC HX */ -OP(dd,26) { HX = ARG(); } /* LD HX,n */ -OP(dd,27) { illegal_1(); op_27(); } /* DB DD */ - -OP(dd,28) { illegal_1(); op_28(); } /* DB DD */ -OP(dd,29) { ADD16(ix,ix); } /* ADD IX,IX */ -OP(dd,2a) { EA = ARG16(); RM16( EA, &Z80.ix ); } /* LD IX,(w) */ -OP(dd,2b) { IX--; } /* DEC IX */ -OP(dd,2c) { LX = INC(LX); } /* INC LX */ -OP(dd,2d) { LX = DEC(LX); } /* DEC LX */ -OP(dd,2e) { LX = ARG(); } /* LD LX,n */ -OP(dd,2f) { illegal_1(); op_2f(); } /* DB DD */ - -OP(dd,30) { illegal_1(); op_30(); } /* DB DD */ -OP(dd,31) { illegal_1(); op_31(); } /* DB DD */ -OP(dd,32) { illegal_1(); op_32(); } /* DB DD */ -OP(dd,33) { illegal_1(); op_33(); } /* DB DD */ -OP(dd,34) { EAX; WM( EA, INC(RM(EA)) ); } /* INC (IX+o) */ -OP(dd,35) { EAX; WM( EA, DEC(RM(EA)) ); } /* DEC (IX+o) */ -OP(dd,36) { EAX; WM( EA, ARG() ); } /* LD (IX+o),n */ -OP(dd,37) { illegal_1(); op_37(); } /* DB DD */ - -OP(dd,38) { illegal_1(); op_38(); } /* DB DD */ -OP(dd,39) { ADD16(ix,sp); } /* ADD IX,SP */ -OP(dd,3a) { illegal_1(); op_3a(); } /* DB DD */ -OP(dd,3b) { illegal_1(); op_3b(); } /* DB DD */ -OP(dd,3c) { illegal_1(); op_3c(); } /* DB DD */ -OP(dd,3d) { illegal_1(); op_3d(); } /* DB DD */ -OP(dd,3e) { illegal_1(); op_3e(); } /* DB DD */ -OP(dd,3f) { illegal_1(); op_3f(); } /* DB DD */ - -OP(dd,40) { illegal_1(); op_40(); } /* DB DD */ -OP(dd,41) { illegal_1(); op_41(); } /* DB DD */ -OP(dd,42) { illegal_1(); op_42(); } /* DB DD */ -OP(dd,43) { illegal_1(); op_43(); } /* DB DD */ -OP(dd,44) { B = HX; } /* LD B,HX */ -OP(dd,45) { B = LX; } /* LD B,LX */ -OP(dd,46) { EAX; B = RM(EA); } /* LD B,(IX+o) */ -OP(dd,47) { illegal_1(); op_47(); } /* DB DD */ - -OP(dd,48) { illegal_1(); op_48(); } /* DB DD */ -OP(dd,49) { illegal_1(); op_49(); } /* DB DD */ -OP(dd,4a) { illegal_1(); op_4a(); } /* DB DD */ -OP(dd,4b) { illegal_1(); op_4b(); } /* DB DD */ -OP(dd,4c) { C = HX; } /* LD C,HX */ -OP(dd,4d) { C = LX; } /* LD C,LX */ -OP(dd,4e) { EAX; C = RM(EA); } /* LD C,(IX+o) */ -OP(dd,4f) { illegal_1(); op_4f(); } /* DB DD */ - -OP(dd,50) { illegal_1(); op_50(); } /* DB DD */ -OP(dd,51) { illegal_1(); op_51(); } /* DB DD */ -OP(dd,52) { illegal_1(); op_52(); } /* DB DD */ -OP(dd,53) { illegal_1(); op_53(); } /* DB DD */ -OP(dd,54) { D = HX; } /* LD D,HX */ -OP(dd,55) { D = LX; } /* LD D,LX */ -OP(dd,56) { EAX; D = RM(EA); } /* LD D,(IX+o) */ -OP(dd,57) { illegal_1(); op_57(); } /* DB DD */ - -OP(dd,58) { illegal_1(); op_58(); } /* DB DD */ -OP(dd,59) { illegal_1(); op_59(); } /* DB DD */ -OP(dd,5a) { illegal_1(); op_5a(); } /* DB DD */ -OP(dd,5b) { illegal_1(); op_5b(); } /* DB DD */ -OP(dd,5c) { E = HX; } /* LD E,HX */ -OP(dd,5d) { E = LX; } /* LD E,LX */ -OP(dd,5e) { EAX; E = RM(EA); } /* LD E,(IX+o) */ -OP(dd,5f) { illegal_1(); op_5f(); } /* DB DD */ - -OP(dd,60) { HX = B; } /* LD HX,B */ -OP(dd,61) { HX = C; } /* LD HX,C */ -OP(dd,62) { HX = D; } /* LD HX,D */ -OP(dd,63) { HX = E; } /* LD HX,E */ -OP(dd,64) { } /* LD HX,HX */ -OP(dd,65) { HX = LX; } /* LD HX,LX */ -OP(dd,66) { EAX; H = RM(EA); } /* LD H,(IX+o) */ -OP(dd,67) { HX = A; } /* LD HX,A */ - -OP(dd,68) { LX = B; } /* LD LX,B */ -OP(dd,69) { LX = C; } /* LD LX,C */ -OP(dd,6a) { LX = D; } /* LD LX,D */ -OP(dd,6b) { LX = E; } /* LD LX,E */ -OP(dd,6c) { LX = HX; } /* LD LX,HX */ -OP(dd,6d) { } /* LD LX,LX */ -OP(dd,6e) { EAX; L = RM(EA); } /* LD L,(IX+o) */ -OP(dd,6f) { LX = A; } /* LD LX,A */ - -OP(dd,70) { EAX; WM( EA, B ); } /* LD (IX+o),B */ -OP(dd,71) { EAX; WM( EA, C ); } /* LD (IX+o),C */ -OP(dd,72) { EAX; WM( EA, D ); } /* LD (IX+o),D */ -OP(dd,73) { EAX; WM( EA, E ); } /* LD (IX+o),E */ -OP(dd,74) { EAX; WM( EA, H ); } /* LD (IX+o),H */ -OP(dd,75) { EAX; WM( EA, L ); } /* LD (IX+o),L */ -OP(dd,76) { illegal_1(); op_76(); } /* DB DD */ -OP(dd,77) { EAX; WM( EA, A ); } /* LD (IX+o),A */ - -OP(dd,78) { illegal_1(); op_78(); } /* DB DD */ -OP(dd,79) { illegal_1(); op_79(); } /* DB DD */ -OP(dd,7a) { illegal_1(); op_7a(); } /* DB DD */ -OP(dd,7b) { illegal_1(); op_7b(); } /* DB DD */ -OP(dd,7c) { A = HX; } /* LD A,HX */ -OP(dd,7d) { A = LX; } /* LD A,LX */ -OP(dd,7e) { EAX; A = RM(EA); } /* LD A,(IX+o) */ -OP(dd,7f) { illegal_1(); op_7f(); } /* DB DD */ - -OP(dd,80) { illegal_1(); op_80(); } /* DB DD */ -OP(dd,81) { illegal_1(); op_81(); } /* DB DD */ -OP(dd,82) { illegal_1(); op_82(); } /* DB DD */ -OP(dd,83) { illegal_1(); op_83(); } /* DB DD */ -OP(dd,84) { ADD(HX); } /* ADD A,HX */ -OP(dd,85) { ADD(LX); } /* ADD A,LX */ -OP(dd,86) { EAX; ADD(RM(EA)); } /* ADD A,(IX+o) */ -OP(dd,87) { illegal_1(); op_87(); } /* DB DD */ - -OP(dd,88) { illegal_1(); op_88(); } /* DB DD */ -OP(dd,89) { illegal_1(); op_89(); } /* DB DD */ -OP(dd,8a) { illegal_1(); op_8a(); } /* DB DD */ -OP(dd,8b) { illegal_1(); op_8b(); } /* DB DD */ -OP(dd,8c) { ADC(HX); } /* ADC A,HX */ -OP(dd,8d) { ADC(LX); } /* ADC A,LX */ -OP(dd,8e) { EAX; ADC(RM(EA)); } /* ADC A,(IX+o) */ -OP(dd,8f) { illegal_1(); op_8f(); } /* DB DD */ - -OP(dd,90) { illegal_1(); op_90(); } /* DB DD */ -OP(dd,91) { illegal_1(); op_91(); } /* DB DD */ -OP(dd,92) { illegal_1(); op_92(); } /* DB DD */ -OP(dd,93) { illegal_1(); op_93(); } /* DB DD */ -OP(dd,94) { SUB(HX); } /* SUB HX */ -OP(dd,95) { SUB(LX); } /* SUB LX */ -OP(dd,96) { EAX; SUB(RM(EA)); } /* SUB (IX+o) */ -OP(dd,97) { illegal_1(); op_97(); } /* DB DD */ - -OP(dd,98) { illegal_1(); op_98(); } /* DB DD */ -OP(dd,99) { illegal_1(); op_99(); } /* DB DD */ -OP(dd,9a) { illegal_1(); op_9a(); } /* DB DD */ -OP(dd,9b) { illegal_1(); op_9b(); } /* DB DD */ -OP(dd,9c) { SBC(HX); } /* SBC A,HX */ -OP(dd,9d) { SBC(LX); } /* SBC A,LX */ -OP(dd,9e) { EAX; SBC(RM(EA)); } /* SBC A,(IX+o) */ -OP(dd,9f) { illegal_1(); op_9f(); } /* DB DD */ - -OP(dd,a0) { illegal_1(); op_a0(); } /* DB DD */ -OP(dd,a1) { illegal_1(); op_a1(); } /* DB DD */ -OP(dd,a2) { illegal_1(); op_a2(); } /* DB DD */ -OP(dd,a3) { illegal_1(); op_a3(); } /* DB DD */ -OP(dd,a4) { AND(HX); } /* AND HX */ -OP(dd,a5) { AND(LX); } /* AND LX */ -OP(dd,a6) { EAX; AND(RM(EA)); } /* AND (IX+o) */ -OP(dd,a7) { illegal_1(); op_a7(); } /* DB DD */ - -OP(dd,a8) { illegal_1(); op_a8(); } /* DB DD */ -OP(dd,a9) { illegal_1(); op_a9(); } /* DB DD */ -OP(dd,aa) { illegal_1(); op_aa(); } /* DB DD */ -OP(dd,ab) { illegal_1(); op_ab(); } /* DB DD */ -OP(dd,ac) { XOR(HX); } /* XOR HX */ -OP(dd,ad) { XOR(LX); } /* XOR LX */ -OP(dd,ae) { EAX; XOR(RM(EA)); } /* XOR (IX+o) */ -OP(dd,af) { illegal_1(); op_af(); } /* DB DD */ - -OP(dd,b0) { illegal_1(); op_b0(); } /* DB DD */ -OP(dd,b1) { illegal_1(); op_b1(); } /* DB DD */ -OP(dd,b2) { illegal_1(); op_b2(); } /* DB DD */ -OP(dd,b3) { illegal_1(); op_b3(); } /* DB DD */ -OP(dd,b4) { OR(HX); } /* OR HX */ -OP(dd,b5) { OR(LX); } /* OR LX */ -OP(dd,b6) { EAX; OR(RM(EA)); } /* OR (IX+o) */ -OP(dd,b7) { illegal_1(); op_b7(); } /* DB DD */ - -OP(dd,b8) { illegal_1(); op_b8(); } /* DB DD */ -OP(dd,b9) { illegal_1(); op_b9(); } /* DB DD */ -OP(dd,ba) { illegal_1(); op_ba(); } /* DB DD */ -OP(dd,bb) { illegal_1(); op_bb(); } /* DB DD */ -OP(dd,bc) { CP(HX); } /* CP HX */ -OP(dd,bd) { CP(LX); } /* CP LX */ -OP(dd,be) { EAX; CP(RM(EA)); } /* CP (IX+o) */ -OP(dd,bf) { illegal_1(); op_bf(); } /* DB DD */ - -OP(dd,c0) { illegal_1(); op_c0(); } /* DB DD */ -OP(dd,c1) { illegal_1(); op_c1(); } /* DB DD */ -OP(dd,c2) { illegal_1(); op_c2(); } /* DB DD */ -OP(dd,c3) { illegal_1(); op_c3(); } /* DB DD */ -OP(dd,c4) { illegal_1(); op_c4(); } /* DB DD */ -OP(dd,c5) { illegal_1(); op_c5(); } /* DB DD */ -OP(dd,c6) { illegal_1(); op_c6(); } /* DB DD */ -OP(dd,c7) { illegal_1(); op_c7(); } /* DB DD */ - -OP(dd,c8) { illegal_1(); op_c8(); } /* DB DD */ -OP(dd,c9) { illegal_1(); op_c9(); } /* DB DD */ -OP(dd,ca) { illegal_1(); op_ca(); } /* DB DD */ -OP(dd,cb) { EAX; EXEC(xycb,ARG()); } /* ** DD CB xx */ -OP(dd,cc) { illegal_1(); op_cc(); } /* DB DD */ -OP(dd,cd) { illegal_1(); op_cd(); } /* DB DD */ -OP(dd,ce) { illegal_1(); op_ce(); } /* DB DD */ -OP(dd,cf) { illegal_1(); op_cf(); } /* DB DD */ - -OP(dd,d0) { illegal_1(); op_d0(); } /* DB DD */ -OP(dd,d1) { illegal_1(); op_d1(); } /* DB DD */ -OP(dd,d2) { illegal_1(); op_d2(); } /* DB DD */ -OP(dd,d3) { illegal_1(); op_d3(); } /* DB DD */ -OP(dd,d4) { illegal_1(); op_d4(); } /* DB DD */ -OP(dd,d5) { illegal_1(); op_d5(); } /* DB DD */ -OP(dd,d6) { illegal_1(); op_d6(); } /* DB DD */ -OP(dd,d7) { illegal_1(); op_d7(); } /* DB DD */ - -OP(dd,d8) { illegal_1(); op_d8(); } /* DB DD */ -OP(dd,d9) { illegal_1(); op_d9(); } /* DB DD */ -OP(dd,da) { illegal_1(); op_da(); } /* DB DD */ -OP(dd,db) { illegal_1(); op_db(); } /* DB DD */ -OP(dd,dc) { illegal_1(); op_dc(); } /* DB DD */ -OP(dd,dd) { illegal_1(); op_dd(); } /* DB DD */ -OP(dd,de) { illegal_1(); op_de(); } /* DB DD */ -OP(dd,df) { illegal_1(); op_df(); } /* DB DD */ - -OP(dd,e0) { illegal_1(); op_e0(); } /* DB DD */ -OP(dd,e1) { POP( ix ); } /* POP IX */ -OP(dd,e2) { illegal_1(); op_e2(); } /* DB DD */ -OP(dd,e3) { EXSP( ix ); } /* EX (SP),IX */ -OP(dd,e4) { illegal_1(); op_e4(); } /* DB DD */ -OP(dd,e5) { PUSH( ix ); } /* PUSH IX */ -OP(dd,e6) { illegal_1(); op_e6(); } /* DB DD */ -OP(dd,e7) { illegal_1(); op_e7(); } /* DB DD */ - -OP(dd,e8) { illegal_1(); op_e8(); } /* DB DD */ -OP(dd,e9) { PC = IX; change_pc(PCD); } /* JP (IX) */ -OP(dd,ea) { illegal_1(); op_ea(); } /* DB DD */ -OP(dd,eb) { illegal_1(); op_eb(); } /* DB DD */ -OP(dd,ec) { illegal_1(); op_ec(); } /* DB DD */ -OP(dd,ed) { illegal_1(); op_ed(); } /* DB DD */ -OP(dd,ee) { illegal_1(); op_ee(); } /* DB DD */ -OP(dd,ef) { illegal_1(); op_ef(); } /* DB DD */ - -OP(dd,f0) { illegal_1(); op_f0(); } /* DB DD */ -OP(dd,f1) { illegal_1(); op_f1(); } /* DB DD */ -OP(dd,f2) { illegal_1(); op_f2(); } /* DB DD */ -OP(dd,f3) { illegal_1(); op_f3(); } /* DB DD */ -OP(dd,f4) { illegal_1(); op_f4(); } /* DB DD */ -OP(dd,f5) { illegal_1(); op_f5(); } /* DB DD */ -OP(dd,f6) { illegal_1(); op_f6(); } /* DB DD */ -OP(dd,f7) { illegal_1(); op_f7(); } /* DB DD */ - -OP(dd,f8) { illegal_1(); op_f8(); } /* DB DD */ -OP(dd,f9) { SP = IX; } /* LD SP,IX */ -OP(dd,fa) { illegal_1(); op_fa(); } /* DB DD */ -OP(dd,fb) { illegal_1(); op_fb(); } /* DB DD */ -OP(dd,fc) { illegal_1(); op_fc(); } /* DB DD */ -OP(dd,fd) { illegal_1(); op_fd(); } /* DB DD */ -OP(dd,fe) { illegal_1(); op_fe(); } /* DB DD */ -OP(dd,ff) { illegal_1(); op_ff(); } /* DB DD */ - -/********************************************************** - * IY register related opcodes (FD prefix) - **********************************************************/ -OP(fd,00) { illegal_1(); op_00(); } /* DB FD */ -OP(fd,01) { illegal_1(); op_01(); } /* DB FD */ -OP(fd,02) { illegal_1(); op_02(); } /* DB FD */ -OP(fd,03) { illegal_1(); op_03(); } /* DB FD */ -OP(fd,04) { illegal_1(); op_04(); } /* DB FD */ -OP(fd,05) { illegal_1(); op_05(); } /* DB FD */ -OP(fd,06) { illegal_1(); op_06(); } /* DB FD */ -OP(fd,07) { illegal_1(); op_07(); } /* DB FD */ - -OP(fd,08) { illegal_1(); op_08(); } /* DB FD */ -OP(fd,09) { ADD16(iy,bc); } /* ADD IY,BC */ -OP(fd,0a) { illegal_1(); op_0a(); } /* DB FD */ -OP(fd,0b) { illegal_1(); op_0b(); } /* DB FD */ -OP(fd,0c) { illegal_1(); op_0c(); } /* DB FD */ -OP(fd,0d) { illegal_1(); op_0d(); } /* DB FD */ -OP(fd,0e) { illegal_1(); op_0e(); } /* DB FD */ -OP(fd,0f) { illegal_1(); op_0f(); } /* DB FD */ - -OP(fd,10) { illegal_1(); op_10(); } /* DB FD */ -OP(fd,11) { illegal_1(); op_11(); } /* DB FD */ -OP(fd,12) { illegal_1(); op_12(); } /* DB FD */ -OP(fd,13) { illegal_1(); op_13(); } /* DB FD */ -OP(fd,14) { illegal_1(); op_14(); } /* DB FD */ -OP(fd,15) { illegal_1(); op_15(); } /* DB FD */ -OP(fd,16) { illegal_1(); op_16(); } /* DB FD */ -OP(fd,17) { illegal_1(); op_17(); } /* DB FD */ - -OP(fd,18) { illegal_1(); op_18(); } /* DB FD */ -OP(fd,19) { ADD16(iy,de); } /* ADD IY,DE */ -OP(fd,1a) { illegal_1(); op_1a(); } /* DB FD */ -OP(fd,1b) { illegal_1(); op_1b(); } /* DB FD */ -OP(fd,1c) { illegal_1(); op_1c(); } /* DB FD */ -OP(fd,1d) { illegal_1(); op_1d(); } /* DB FD */ -OP(fd,1e) { illegal_1(); op_1e(); } /* DB FD */ -OP(fd,1f) { illegal_1(); op_1f(); } /* DB FD */ - -OP(fd,20) { illegal_1(); op_20(); } /* DB FD */ -OP(fd,21) { IY = ARG16(); } /* LD IY,w */ -OP(fd,22) { EA = ARG16(); WM16( EA, &Z80.iy ); } /* LD (w),IY */ -OP(fd,23) { IY++; } /* INC IY */ -OP(fd,24) { HY = INC(HY); } /* INC HY */ -OP(fd,25) { HY = DEC(HY); } /* DEC HY */ -OP(fd,26) { HY = ARG(); } /* LD HY,n */ -OP(fd,27) { illegal_1(); op_27(); } /* DB FD */ - -OP(fd,28) { illegal_1(); op_28(); } /* DB FD */ -OP(fd,29) { ADD16(iy,iy); } /* ADD IY,IY */ -OP(fd,2a) { EA = ARG16(); RM16( EA, &Z80.iy ); } /* LD IY,(w) */ -OP(fd,2b) { IY--; } /* DEC IY */ -OP(fd,2c) { LY = INC(LY); } /* INC LY */ -OP(fd,2d) { LY = DEC(LY); } /* DEC LY */ -OP(fd,2e) { LY = ARG(); } /* LD LY,n */ -OP(fd,2f) { illegal_1(); op_2f(); } /* DB FD */ - -OP(fd,30) { illegal_1(); op_30(); } /* DB FD */ -OP(fd,31) { illegal_1(); op_31(); } /* DB FD */ -OP(fd,32) { illegal_1(); op_32(); } /* DB FD */ -OP(fd,33) { illegal_1(); op_33(); } /* DB FD */ -OP(fd,34) { EAY; WM( EA, INC(RM(EA)) ); } /* INC (IY+o) */ -OP(fd,35) { EAY; WM( EA, DEC(RM(EA)) ); } /* DEC (IY+o) */ -OP(fd,36) { EAY; WM( EA, ARG() ); } /* LD (IY+o),n */ -OP(fd,37) { illegal_1(); op_37(); } /* DB FD */ - -OP(fd,38) { illegal_1(); op_38(); } /* DB FD */ -OP(fd,39) { ADD16(iy,sp); } /* ADD IY,SP */ -OP(fd,3a) { illegal_1(); op_3a(); } /* DB FD */ -OP(fd,3b) { illegal_1(); op_3b(); } /* DB FD */ -OP(fd,3c) { illegal_1(); op_3c(); } /* DB FD */ -OP(fd,3d) { illegal_1(); op_3d(); } /* DB FD */ -OP(fd,3e) { illegal_1(); op_3e(); } /* DB FD */ -OP(fd,3f) { illegal_1(); op_3f(); } /* DB FD */ - -OP(fd,40) { illegal_1(); op_40(); } /* DB FD */ -OP(fd,41) { illegal_1(); op_41(); } /* DB FD */ -OP(fd,42) { illegal_1(); op_42(); } /* DB FD */ -OP(fd,43) { illegal_1(); op_43(); } /* DB FD */ -OP(fd,44) { B = HY; } /* LD B,HY */ -OP(fd,45) { B = LY; } /* LD B,LY */ -OP(fd,46) { EAY; B = RM(EA); } /* LD B,(IY+o) */ -OP(fd,47) { illegal_1(); op_47(); } /* DB FD */ - -OP(fd,48) { illegal_1(); op_48(); } /* DB FD */ -OP(fd,49) { illegal_1(); op_49(); } /* DB FD */ -OP(fd,4a) { illegal_1(); op_4a(); } /* DB FD */ -OP(fd,4b) { illegal_1(); op_4b(); } /* DB FD */ -OP(fd,4c) { C = HY; } /* LD C,HY */ -OP(fd,4d) { C = LY; } /* LD C,LY */ -OP(fd,4e) { EAY; C = RM(EA); } /* LD C,(IY+o) */ -OP(fd,4f) { illegal_1(); op_4f(); } /* DB FD */ - -OP(fd,50) { illegal_1(); op_50(); } /* DB FD */ -OP(fd,51) { illegal_1(); op_51(); } /* DB FD */ -OP(fd,52) { illegal_1(); op_52(); } /* DB FD */ -OP(fd,53) { illegal_1(); op_53(); } /* DB FD */ -OP(fd,54) { D = HY; } /* LD D,HY */ -OP(fd,55) { D = LY; } /* LD D,LY */ -OP(fd,56) { EAY; D = RM(EA); } /* LD D,(IY+o) */ -OP(fd,57) { illegal_1(); op_57(); } /* DB FD */ - -OP(fd,58) { illegal_1(); op_58(); } /* DB FD */ -OP(fd,59) { illegal_1(); op_59(); } /* DB FD */ -OP(fd,5a) { illegal_1(); op_5a(); } /* DB FD */ -OP(fd,5b) { illegal_1(); op_5b(); } /* DB FD */ -OP(fd,5c) { E = HY; } /* LD E,HY */ -OP(fd,5d) { E = LY; } /* LD E,LY */ -OP(fd,5e) { EAY; E = RM(EA); } /* LD E,(IY+o) */ -OP(fd,5f) { illegal_1(); op_5f(); } /* DB FD */ - -OP(fd,60) { HY = B; } /* LD HY,B */ -OP(fd,61) { HY = C; } /* LD HY,C */ -OP(fd,62) { HY = D; } /* LD HY,D */ -OP(fd,63) { HY = E; } /* LD HY,E */ -OP(fd,64) { } /* LD HY,HY */ -OP(fd,65) { HY = LY; } /* LD HY,LY */ -OP(fd,66) { EAY; H = RM(EA); } /* LD H,(IY+o) */ -OP(fd,67) { HY = A; } /* LD HY,A */ - -OP(fd,68) { LY = B; } /* LD LY,B */ -OP(fd,69) { LY = C; } /* LD LY,C */ -OP(fd,6a) { LY = D; } /* LD LY,D */ -OP(fd,6b) { LY = E; } /* LD LY,E */ -OP(fd,6c) { LY = HY; } /* LD LY,HY */ -OP(fd,6d) { } /* LD LY,LY */ -OP(fd,6e) { EAY; L = RM(EA); } /* LD L,(IY+o) */ -OP(fd,6f) { LY = A; } /* LD LY,A */ - -OP(fd,70) { EAY; WM( EA, B ); } /* LD (IY+o),B */ -OP(fd,71) { EAY; WM( EA, C ); } /* LD (IY+o),C */ -OP(fd,72) { EAY; WM( EA, D ); } /* LD (IY+o),D */ -OP(fd,73) { EAY; WM( EA, E ); } /* LD (IY+o),E */ -OP(fd,74) { EAY; WM( EA, H ); } /* LD (IY+o),H */ -OP(fd,75) { EAY; WM( EA, L ); } /* LD (IY+o),L */ -OP(fd,76) { illegal_1(); op_76(); } /* DB FD */ -OP(fd,77) { EAY; WM( EA, A ); } /* LD (IY+o),A */ - -OP(fd,78) { illegal_1(); op_78(); } /* DB FD */ -OP(fd,79) { illegal_1(); op_79(); } /* DB FD */ -OP(fd,7a) { illegal_1(); op_7a(); } /* DB FD */ -OP(fd,7b) { illegal_1(); op_7b(); } /* DB FD */ -OP(fd,7c) { A = HY; } /* LD A,HY */ -OP(fd,7d) { A = LY; } /* LD A,LY */ -OP(fd,7e) { EAY; A = RM(EA); } /* LD A,(IY+o) */ -OP(fd,7f) { illegal_1(); op_7f(); } /* DB FD */ - -OP(fd,80) { illegal_1(); op_80(); } /* DB FD */ -OP(fd,81) { illegal_1(); op_81(); } /* DB FD */ -OP(fd,82) { illegal_1(); op_82(); } /* DB FD */ -OP(fd,83) { illegal_1(); op_83(); } /* DB FD */ -OP(fd,84) { ADD(HY); } /* ADD A,HY */ -OP(fd,85) { ADD(LY); } /* ADD A,LY */ -OP(fd,86) { EAY; ADD(RM(EA)); } /* ADD A,(IY+o) */ -OP(fd,87) { illegal_1(); op_87(); } /* DB FD */ - -OP(fd,88) { illegal_1(); op_88(); } /* DB FD */ -OP(fd,89) { illegal_1(); op_89(); } /* DB FD */ -OP(fd,8a) { illegal_1(); op_8a(); } /* DB FD */ -OP(fd,8b) { illegal_1(); op_8b(); } /* DB FD */ -OP(fd,8c) { ADC(HY); } /* ADC A,HY */ -OP(fd,8d) { ADC(LY); } /* ADC A,LY */ -OP(fd,8e) { EAY; ADC(RM(EA)); } /* ADC A,(IY+o) */ -OP(fd,8f) { illegal_1(); op_8f(); } /* DB FD */ - -OP(fd,90) { illegal_1(); op_90(); } /* DB FD */ -OP(fd,91) { illegal_1(); op_91(); } /* DB FD */ -OP(fd,92) { illegal_1(); op_92(); } /* DB FD */ -OP(fd,93) { illegal_1(); op_93(); } /* DB FD */ -OP(fd,94) { SUB(HY); } /* SUB HY */ -OP(fd,95) { SUB(LY); } /* SUB LY */ -OP(fd,96) { EAY; SUB(RM(EA)); } /* SUB (IY+o) */ -OP(fd,97) { illegal_1(); op_97(); } /* DB FD */ - -OP(fd,98) { illegal_1(); op_98(); } /* DB FD */ -OP(fd,99) { illegal_1(); op_99(); } /* DB FD */ -OP(fd,9a) { illegal_1(); op_9a(); } /* DB FD */ -OP(fd,9b) { illegal_1(); op_9b(); } /* DB FD */ -OP(fd,9c) { SBC(HY); } /* SBC A,HY */ -OP(fd,9d) { SBC(LY); } /* SBC A,LY */ -OP(fd,9e) { EAY; SBC(RM(EA)); } /* SBC A,(IY+o) */ -OP(fd,9f) { illegal_1(); op_9f(); } /* DB FD */ - -OP(fd,a0) { illegal_1(); op_a0(); } /* DB FD */ -OP(fd,a1) { illegal_1(); op_a1(); } /* DB FD */ -OP(fd,a2) { illegal_1(); op_a2(); } /* DB FD */ -OP(fd,a3) { illegal_1(); op_a3(); } /* DB FD */ -OP(fd,a4) { AND(HY); } /* AND HY */ -OP(fd,a5) { AND(LY); } /* AND LY */ -OP(fd,a6) { EAY; AND(RM(EA)); } /* AND (IY+o) */ -OP(fd,a7) { illegal_1(); op_a7(); } /* DB FD */ - -OP(fd,a8) { illegal_1(); op_a8(); } /* DB FD */ -OP(fd,a9) { illegal_1(); op_a9(); } /* DB FD */ -OP(fd,aa) { illegal_1(); op_aa(); } /* DB FD */ -OP(fd,ab) { illegal_1(); op_ab(); } /* DB FD */ -OP(fd,ac) { XOR(HY); } /* XOR HY */ -OP(fd,ad) { XOR(LY); } /* XOR LY */ -OP(fd,ae) { EAY; XOR(RM(EA)); } /* XOR (IY+o) */ -OP(fd,af) { illegal_1(); op_af(); } /* DB FD */ - -OP(fd,b0) { illegal_1(); op_b0(); } /* DB FD */ -OP(fd,b1) { illegal_1(); op_b1(); } /* DB FD */ -OP(fd,b2) { illegal_1(); op_b2(); } /* DB FD */ -OP(fd,b3) { illegal_1(); op_b3(); } /* DB FD */ -OP(fd,b4) { OR(HY); } /* OR HY */ -OP(fd,b5) { OR(LY); } /* OR LY */ -OP(fd,b6) { EAY; OR(RM(EA)); } /* OR (IY+o) */ -OP(fd,b7) { illegal_1(); op_b7(); } /* DB FD */ - -OP(fd,b8) { illegal_1(); op_b8(); } /* DB FD */ -OP(fd,b9) { illegal_1(); op_b9(); } /* DB FD */ -OP(fd,ba) { illegal_1(); op_ba(); } /* DB FD */ -OP(fd,bb) { illegal_1(); op_bb(); } /* DB FD */ -OP(fd,bc) { CP(HY); } /* CP HY */ -OP(fd,bd) { CP(LY); } /* CP LY */ -OP(fd,be) { EAY; CP(RM(EA)); } /* CP (IY+o) */ -OP(fd,bf) { illegal_1(); op_bf(); } /* DB FD */ - -OP(fd,c0) { illegal_1(); op_c0(); } /* DB FD */ -OP(fd,c1) { illegal_1(); op_c1(); } /* DB FD */ -OP(fd,c2) { illegal_1(); op_c2(); } /* DB FD */ -OP(fd,c3) { illegal_1(); op_c3(); } /* DB FD */ -OP(fd,c4) { illegal_1(); op_c4(); } /* DB FD */ -OP(fd,c5) { illegal_1(); op_c5(); } /* DB FD */ -OP(fd,c6) { illegal_1(); op_c6(); } /* DB FD */ -OP(fd,c7) { illegal_1(); op_c7(); } /* DB FD */ - -OP(fd,c8) { illegal_1(); op_c8(); } /* DB FD */ -OP(fd,c9) { illegal_1(); op_c9(); } /* DB FD */ -OP(fd,ca) { illegal_1(); op_ca(); } /* DB FD */ -OP(fd,cb) { EAY; EXEC(xycb,ARG()); } /* ** FD CB xx */ -OP(fd,cc) { illegal_1(); op_cc(); } /* DB FD */ -OP(fd,cd) { illegal_1(); op_cd(); } /* DB FD */ -OP(fd,ce) { illegal_1(); op_ce(); } /* DB FD */ -OP(fd,cf) { illegal_1(); op_cf(); } /* DB FD */ - -OP(fd,d0) { illegal_1(); op_d0(); } /* DB FD */ -OP(fd,d1) { illegal_1(); op_d1(); } /* DB FD */ -OP(fd,d2) { illegal_1(); op_d2(); } /* DB FD */ -OP(fd,d3) { illegal_1(); op_d3(); } /* DB FD */ -OP(fd,d4) { illegal_1(); op_d4(); } /* DB FD */ -OP(fd,d5) { illegal_1(); op_d5(); } /* DB FD */ -OP(fd,d6) { illegal_1(); op_d6(); } /* DB FD */ -OP(fd,d7) { illegal_1(); op_d7(); } /* DB FD */ - -OP(fd,d8) { illegal_1(); op_d8(); } /* DB FD */ -OP(fd,d9) { illegal_1(); op_d9(); } /* DB FD */ -OP(fd,da) { illegal_1(); op_da(); } /* DB FD */ -OP(fd,db) { illegal_1(); op_db(); } /* DB FD */ -OP(fd,dc) { illegal_1(); op_dc(); } /* DB FD */ -OP(fd,dd) { illegal_1(); op_dd(); } /* DB FD */ -OP(fd,de) { illegal_1(); op_de(); } /* DB FD */ -OP(fd,df) { illegal_1(); op_df(); } /* DB FD */ - -OP(fd,e0) { illegal_1(); op_e0(); } /* DB FD */ -OP(fd,e1) { POP( iy ); } /* POP IY */ -OP(fd,e2) { illegal_1(); op_e2(); } /* DB FD */ -OP(fd,e3) { EXSP( iy ); } /* EX (SP),IY */ -OP(fd,e4) { illegal_1(); op_e4(); } /* DB FD */ -OP(fd,e5) { PUSH( iy ); } /* PUSH IY */ -OP(fd,e6) { illegal_1(); op_e6(); } /* DB FD */ -OP(fd,e7) { illegal_1(); op_e7(); } /* DB FD */ - -OP(fd,e8) { illegal_1(); op_e8(); } /* DB FD */ -OP(fd,e9) { PC = IY; change_pc(PCD); } /* JP (IY) */ -OP(fd,ea) { illegal_1(); op_ea(); } /* DB FD */ -OP(fd,eb) { illegal_1(); op_eb(); } /* DB FD */ -OP(fd,ec) { illegal_1(); op_ec(); } /* DB FD */ -OP(fd,ed) { illegal_1(); op_ed(); } /* DB FD */ -OP(fd,ee) { illegal_1(); op_ee(); } /* DB FD */ -OP(fd,ef) { illegal_1(); op_ef(); } /* DB FD */ - -OP(fd,f0) { illegal_1(); op_f0(); } /* DB FD */ -OP(fd,f1) { illegal_1(); op_f1(); } /* DB FD */ -OP(fd,f2) { illegal_1(); op_f2(); } /* DB FD */ -OP(fd,f3) { illegal_1(); op_f3(); } /* DB FD */ -OP(fd,f4) { illegal_1(); op_f4(); } /* DB FD */ -OP(fd,f5) { illegal_1(); op_f5(); } /* DB FD */ -OP(fd,f6) { illegal_1(); op_f6(); } /* DB FD */ -OP(fd,f7) { illegal_1(); op_f7(); } /* DB FD */ - -OP(fd,f8) { illegal_1(); op_f8(); } /* DB FD */ -OP(fd,f9) { SP = IY; } /* LD SP,IY */ -OP(fd,fa) { illegal_1(); op_fa(); } /* DB FD */ -OP(fd,fb) { illegal_1(); op_fb(); } /* DB FD */ -OP(fd,fc) { illegal_1(); op_fc(); } /* DB FD */ -OP(fd,fd) { illegal_1(); op_fd(); } /* DB FD */ -OP(fd,fe) { illegal_1(); op_fe(); } /* DB FD */ -OP(fd,ff) { illegal_1(); op_ff(); } /* DB FD */ - -OP(illegal,2) -{ -// logerror("Z80 #%d ill. opcode $ed $%02x\n", -// cpu_getactivecpu(), cpu_readop((PCD-1)&0xffff)); -} - -/********************************************************** - * special opcodes (ED prefix) - **********************************************************/ -OP(ed,00) { illegal_2(); } /* DB ED */ -OP(ed,01) { illegal_2(); } /* DB ED */ -OP(ed,02) { illegal_2(); } /* DB ED */ -OP(ed,03) { illegal_2(); } /* DB ED */ -OP(ed,04) { illegal_2(); } /* DB ED */ -OP(ed,05) { illegal_2(); } /* DB ED */ -OP(ed,06) { illegal_2(); } /* DB ED */ -OP(ed,07) { illegal_2(); } /* DB ED */ - -OP(ed,08) { illegal_2(); } /* DB ED */ -OP(ed,09) { illegal_2(); } /* DB ED */ -OP(ed,0a) { illegal_2(); } /* DB ED */ -OP(ed,0b) { illegal_2(); } /* DB ED */ -OP(ed,0c) { illegal_2(); } /* DB ED */ -OP(ed,0d) { illegal_2(); } /* DB ED */ -OP(ed,0e) { illegal_2(); } /* DB ED */ -OP(ed,0f) { illegal_2(); } /* DB ED */ - -OP(ed,10) { illegal_2(); } /* DB ED */ -OP(ed,11) { illegal_2(); } /* DB ED */ -OP(ed,12) { illegal_2(); } /* DB ED */ -OP(ed,13) { illegal_2(); } /* DB ED */ -OP(ed,14) { illegal_2(); } /* DB ED */ -OP(ed,15) { illegal_2(); } /* DB ED */ -OP(ed,16) { illegal_2(); } /* DB ED */ -OP(ed,17) { illegal_2(); } /* DB ED */ - -OP(ed,18) { illegal_2(); } /* DB ED */ -OP(ed,19) { illegal_2(); } /* DB ED */ -OP(ed,1a) { illegal_2(); } /* DB ED */ -OP(ed,1b) { illegal_2(); } /* DB ED */ -OP(ed,1c) { illegal_2(); } /* DB ED */ -OP(ed,1d) { illegal_2(); } /* DB ED */ -OP(ed,1e) { illegal_2(); } /* DB ED */ -OP(ed,1f) { illegal_2(); } /* DB ED */ - -OP(ed,20) { illegal_2(); } /* DB ED */ -OP(ed,21) { illegal_2(); } /* DB ED */ -OP(ed,22) { illegal_2(); } /* DB ED */ -OP(ed,23) { illegal_2(); } /* DB ED */ -OP(ed,24) { illegal_2(); } /* DB ED */ -OP(ed,25) { illegal_2(); } /* DB ED */ -OP(ed,26) { illegal_2(); } /* DB ED */ -OP(ed,27) { illegal_2(); } /* DB ED */ - -OP(ed,28) { illegal_2(); } /* DB ED */ -OP(ed,29) { illegal_2(); } /* DB ED */ -OP(ed,2a) { illegal_2(); } /* DB ED */ -OP(ed,2b) { illegal_2(); } /* DB ED */ -OP(ed,2c) { illegal_2(); } /* DB ED */ -OP(ed,2d) { illegal_2(); } /* DB ED */ -OP(ed,2e) { illegal_2(); } /* DB ED */ -OP(ed,2f) { illegal_2(); } /* DB ED */ - -OP(ed,30) { illegal_2(); } /* DB ED */ -OP(ed,31) { illegal_2(); } /* DB ED */ -OP(ed,32) { illegal_2(); } /* DB ED */ -OP(ed,33) { illegal_2(); } /* DB ED */ -OP(ed,34) { illegal_2(); } /* DB ED */ -OP(ed,35) { illegal_2(); } /* DB ED */ -OP(ed,36) { illegal_2(); } /* DB ED */ -OP(ed,37) { illegal_2(); } /* DB ED */ - -OP(ed,38) { illegal_2(); } /* DB ED */ -OP(ed,39) { illegal_2(); } /* DB ED */ -OP(ed,3a) { illegal_2(); } /* DB ED */ -OP(ed,3b) { illegal_2(); } /* DB ED */ -OP(ed,3c) { illegal_2(); } /* DB ED */ -OP(ed,3d) { illegal_2(); } /* DB ED */ -OP(ed,3e) { illegal_2(); } /* DB ED */ -OP(ed,3f) { illegal_2(); } /* DB ED */ - -OP(ed,40) { B = IN(BC); F = (F & CF) | SZP[B]; } /* IN B,(C) */ -OP(ed,41) { OUT(BC, B); } /* OUT (C),B */ -OP(ed,42) { SBC16( bc ); } /* SBC HL,BC */ -OP(ed,43) { EA = ARG16(); WM16( EA, &Z80.bc ); } /* LD (w),BC */ -OP(ed,44) { NEG; } /* NEG */ -OP(ed,45) { RETN; } /* RETN; */ -OP(ed,46) { IM = 0; } /* IM 0 */ -OP(ed,47) { LD_I_A; } /* LD I,A */ - -OP(ed,48) { C = IN(BC); F = (F & CF) | SZP[C]; } /* IN C,(C) */ -OP(ed,49) { OUT(BC, C); } /* OUT (C),C */ -OP(ed,4a) { ADC16( bc ); } /* ADC HL,BC */ -OP(ed,4b) { EA = ARG16(); RM16( EA, &Z80.bc ); } /* LD BC,(w) */ -OP(ed,4c) { NEG; } /* NEG */ -OP(ed,4d) { RETI; } /* RETI */ -OP(ed,4e) { IM = 0; } /* IM 0 */ -OP(ed,4f) { LD_R_A; } /* LD R,A */ - -OP(ed,50) { D = IN(BC); F = (F & CF) | SZP[D]; } /* IN D,(C) */ -OP(ed,51) { OUT(BC, D); } /* OUT (C),D */ -OP(ed,52) { SBC16( de ); } /* SBC HL,DE */ -OP(ed,53) { EA = ARG16(); WM16( EA, &Z80.de ); } /* LD (w),DE */ -OP(ed,54) { NEG; } /* NEG */ -OP(ed,55) { RETN; } /* RETN; */ -OP(ed,56) { IM = 1; } /* IM 1 */ -OP(ed,57) { LD_A_I; } /* LD A,I */ - -OP(ed,58) { E = IN(BC); F = (F & CF) | SZP[E]; } /* IN E,(C) */ -OP(ed,59) { OUT(BC, E); } /* OUT (C),E */ -OP(ed,5a) { ADC16( de ); } /* ADC HL,DE */ -OP(ed,5b) { EA = ARG16(); RM16( EA, &Z80.de ); } /* LD DE,(w) */ -OP(ed,5c) { NEG; } /* NEG */ -OP(ed,5d) { RETI; } /* RETI */ -OP(ed,5e) { IM = 2; } /* IM 2 */ -OP(ed,5f) { LD_A_R; } /* LD A,R */ - -OP(ed,60) { H = IN(BC); F = (F & CF) | SZP[H]; } /* IN H,(C) */ -OP(ed,61) { OUT(BC, H); } /* OUT (C),H */ -OP(ed,62) { SBC16( hl ); } /* SBC HL,HL */ -OP(ed,63) { EA = ARG16(); WM16( EA, &Z80.hl ); } /* LD (w),HL */ -OP(ed,64) { NEG; } /* NEG */ -OP(ed,65) { RETN; } /* RETN; */ -OP(ed,66) { IM = 0; } /* IM 0 */ -OP(ed,67) { RRD; } /* RRD (HL) */ - -OP(ed,68) { L = IN(BC); F = (F & CF) | SZP[L]; } /* IN L,(C) */ -OP(ed,69) { OUT(BC, L); } /* OUT (C),L */ -OP(ed,6a) { ADC16( hl ); } /* ADC HL,HL */ -OP(ed,6b) { EA = ARG16(); RM16( EA, &Z80.hl ); } /* LD HL,(w) */ -OP(ed,6c) { NEG; } /* NEG */ -OP(ed,6d) { RETI; } /* RETI */ -OP(ed,6e) { IM = 0; } /* IM 0 */ -OP(ed,6f) { RLD; } /* RLD (HL) */ - -OP(ed,70) { UINT8 res = IN(BC); F = (F & CF) | SZP[res]; } /* IN 0,(C) */ -OP(ed,71) { OUT(BC, 0); } /* OUT (C),0 */ -OP(ed,72) { SBC16( sp ); } /* SBC HL,SP */ -OP(ed,73) { EA = ARG16(); WM16( EA, &Z80.sp ); } /* LD (w),SP */ -OP(ed,74) { NEG; } /* NEG */ -OP(ed,75) { RETN; } /* RETN; */ -OP(ed,76) { IM = 1; } /* IM 1 */ -OP(ed,77) { illegal_2(); } /* DB ED,77 */ - -OP(ed,78) { A = IN(BC); F = (F & CF) | SZP[A]; } /* IN E,(C) */ -OP(ed,79) { OUT(BC, A); } /* OUT (C),A */ -OP(ed,7a) { ADC16( sp ); } /* ADC HL,SP */ -OP(ed,7b) { EA = ARG16(); RM16( EA, &Z80.sp ); } /* LD SP,(w) */ -OP(ed,7c) { NEG; } /* NEG */ -OP(ed,7d) { RETI; } /* RETI */ -OP(ed,7e) { IM = 2; } /* IM 2 */ -OP(ed,7f) { illegal_2(); } /* DB ED,7F */ - -OP(ed,80) { illegal_2(); } /* DB ED */ -OP(ed,81) { illegal_2(); } /* DB ED */ -OP(ed,82) { illegal_2(); } /* DB ED */ -OP(ed,83) { illegal_2(); } /* DB ED */ -OP(ed,84) { illegal_2(); } /* DB ED */ -OP(ed,85) { illegal_2(); } /* DB ED */ -OP(ed,86) { illegal_2(); } /* DB ED */ -OP(ed,87) { illegal_2(); } /* DB ED */ - -OP(ed,88) { illegal_2(); } /* DB ED */ -OP(ed,89) { illegal_2(); } /* DB ED */ -OP(ed,8a) { illegal_2(); } /* DB ED */ -OP(ed,8b) { illegal_2(); } /* DB ED */ -OP(ed,8c) { illegal_2(); } /* DB ED */ -OP(ed,8d) { illegal_2(); } /* DB ED */ -OP(ed,8e) { illegal_2(); } /* DB ED */ -OP(ed,8f) { illegal_2(); } /* DB ED */ - -OP(ed,90) { illegal_2(); } /* DB ED */ -OP(ed,91) { illegal_2(); } /* DB ED */ -OP(ed,92) { illegal_2(); } /* DB ED */ -OP(ed,93) { illegal_2(); } /* DB ED */ -OP(ed,94) { illegal_2(); } /* DB ED */ -OP(ed,95) { illegal_2(); } /* DB ED */ -OP(ed,96) { illegal_2(); } /* DB ED */ -OP(ed,97) { illegal_2(); } /* DB ED */ - -OP(ed,98) { illegal_2(); } /* DB ED */ -OP(ed,99) { illegal_2(); } /* DB ED */ -OP(ed,9a) { illegal_2(); } /* DB ED */ -OP(ed,9b) { illegal_2(); } /* DB ED */ -OP(ed,9c) { illegal_2(); } /* DB ED */ -OP(ed,9d) { illegal_2(); } /* DB ED */ -OP(ed,9e) { illegal_2(); } /* DB ED */ -OP(ed,9f) { illegal_2(); } /* DB ED */ - -OP(ed,a0) { LDI; } /* LDI */ -OP(ed,a1) { CPI; } /* CPI */ -OP(ed,a2) { INI; } /* INI */ -OP(ed,a3) { OUTI; } /* OUTI */ -OP(ed,a4) { illegal_2(); } /* DB ED */ -OP(ed,a5) { illegal_2(); } /* DB ED */ -OP(ed,a6) { illegal_2(); } /* DB ED */ -OP(ed,a7) { illegal_2(); } /* DB ED */ - -OP(ed,a8) { LDD; } /* LDD */ -OP(ed,a9) { CPD; } /* CPD */ -OP(ed,aa) { IND; } /* IND */ -OP(ed,ab) { OUTD; } /* OUTD */ -OP(ed,ac) { illegal_2(); } /* DB ED */ -OP(ed,ad) { illegal_2(); } /* DB ED */ -OP(ed,ae) { illegal_2(); } /* DB ED */ -OP(ed,af) { illegal_2(); } /* DB ED */ - -OP(ed,b0) { LDIR; } /* LDIR */ -OP(ed,b1) { CPIR; } /* CPIR */ -OP(ed,b2) { INIR; } /* INIR */ -OP(ed,b3) { OTIR; } /* OTIR */ -OP(ed,b4) { illegal_2(); } /* DB ED */ -OP(ed,b5) { illegal_2(); } /* DB ED */ -OP(ed,b6) { illegal_2(); } /* DB ED */ -OP(ed,b7) { illegal_2(); } /* DB ED */ - -OP(ed,b8) { LDDR; } /* LDDR */ -OP(ed,b9) { CPDR; } /* CPDR */ -OP(ed,ba) { INDR; } /* INDR */ -OP(ed,bb) { OTDR; } /* OTDR */ -OP(ed,bc) { illegal_2(); } /* DB ED */ -OP(ed,bd) { illegal_2(); } /* DB ED */ -OP(ed,be) { illegal_2(); } /* DB ED */ -OP(ed,bf) { illegal_2(); } /* DB ED */ - -OP(ed,c0) { illegal_2(); } /* DB ED */ -OP(ed,c1) { illegal_2(); } /* DB ED */ -OP(ed,c2) { illegal_2(); } /* DB ED */ -OP(ed,c3) { illegal_2(); } /* DB ED */ -OP(ed,c4) { illegal_2(); } /* DB ED */ -OP(ed,c5) { illegal_2(); } /* DB ED */ -OP(ed,c6) { illegal_2(); } /* DB ED */ -OP(ed,c7) { illegal_2(); } /* DB ED */ - -OP(ed,c8) { illegal_2(); } /* DB ED */ -OP(ed,c9) { illegal_2(); } /* DB ED */ -OP(ed,ca) { illegal_2(); } /* DB ED */ -OP(ed,cb) { illegal_2(); } /* DB ED */ -OP(ed,cc) { illegal_2(); } /* DB ED */ -OP(ed,cd) { illegal_2(); } /* DB ED */ -OP(ed,ce) { illegal_2(); } /* DB ED */ -OP(ed,cf) { illegal_2(); } /* DB ED */ - -OP(ed,d0) { illegal_2(); } /* DB ED */ -OP(ed,d1) { illegal_2(); } /* DB ED */ -OP(ed,d2) { illegal_2(); } /* DB ED */ -OP(ed,d3) { illegal_2(); } /* DB ED */ -OP(ed,d4) { illegal_2(); } /* DB ED */ -OP(ed,d5) { illegal_2(); } /* DB ED */ -OP(ed,d6) { illegal_2(); } /* DB ED */ -OP(ed,d7) { illegal_2(); } /* DB ED */ - -OP(ed,d8) { illegal_2(); } /* DB ED */ -OP(ed,d9) { illegal_2(); } /* DB ED */ -OP(ed,da) { illegal_2(); } /* DB ED */ -OP(ed,db) { illegal_2(); } /* DB ED */ -OP(ed,dc) { illegal_2(); } /* DB ED */ -OP(ed,dd) { illegal_2(); } /* DB ED */ -OP(ed,de) { illegal_2(); } /* DB ED */ -OP(ed,df) { illegal_2(); } /* DB ED */ - -OP(ed,e0) { illegal_2(); } /* DB ED */ -OP(ed,e1) { illegal_2(); } /* DB ED */ -OP(ed,e2) { illegal_2(); } /* DB ED */ -OP(ed,e3) { illegal_2(); } /* DB ED */ -OP(ed,e4) { illegal_2(); } /* DB ED */ -OP(ed,e5) { illegal_2(); } /* DB ED */ -OP(ed,e6) { illegal_2(); } /* DB ED */ -OP(ed,e7) { illegal_2(); } /* DB ED */ - -OP(ed,e8) { illegal_2(); } /* DB ED */ -OP(ed,e9) { illegal_2(); } /* DB ED */ -OP(ed,ea) { illegal_2(); } /* DB ED */ -OP(ed,eb) { illegal_2(); } /* DB ED */ -OP(ed,ec) { illegal_2(); } /* DB ED */ -OP(ed,ed) { illegal_2(); } /* DB ED */ -OP(ed,ee) { illegal_2(); } /* DB ED */ -OP(ed,ef) { illegal_2(); } /* DB ED */ - -OP(ed,f0) { illegal_2(); } /* DB ED */ -OP(ed,f1) { illegal_2(); } /* DB ED */ -OP(ed,f2) { illegal_2(); } /* DB ED */ -OP(ed,f3) { illegal_2(); } /* DB ED */ -OP(ed,f4) { illegal_2(); } /* DB ED */ -OP(ed,f5) { illegal_2(); } /* DB ED */ -OP(ed,f6) { illegal_2(); } /* DB ED */ -OP(ed,f7) { illegal_2(); } /* DB ED */ - -OP(ed,f8) { illegal_2(); } /* DB ED */ -OP(ed,f9) { illegal_2(); } /* DB ED */ -OP(ed,fa) { illegal_2(); } /* DB ED */ -OP(ed,fb) { illegal_2(); } /* DB ED */ -OP(ed,fc) { illegal_2(); } /* DB ED */ -OP(ed,fd) { illegal_2(); } /* DB ED */ -OP(ed,fe) { - if (z80edfe_callback) { - (*z80edfe_callback)(&Z80); - } else { - illegal_2(); - } } /* DB ED */ -OP(ed,ff) { illegal_2(); } /* DB ED */ - - -/********************************************************** - * main opcodes - **********************************************************/ -OP(op,00) { } /* NOP */ -OP(op,01) { BC = ARG16(); } /* LD BC,w */ -OP(op,02) { WM( BC, A ); } /* LD (BC),A */ -OP(op,03) { BC++; } /* INC BC */ -OP(op,04) { B = INC(B); } /* INC B */ -OP(op,05) { B = DEC(B); } /* DEC B */ -OP(op,06) { B = ARG(); } /* LD B,n */ -OP(op,07) { RLCA; } /* RLCA */ - -OP(op,08) { EX_AF; } /* EX AF,AF' */ -OP(op,09) { ADD16(hl, bc); } /* ADD HL,BC */ -OP(op,0a) { A = RM( BC ); } /* LD A,(BC) */ -OP(op,0b) { BC--; } /* DEC BC */ -OP(op,0c) { C = INC(C); } /* INC C */ -OP(op,0d) { C = DEC(C); } /* DEC C */ -OP(op,0e) { C = ARG(); } /* LD C,n */ -OP(op,0f) { RRCA; } /* RRCA */ - -OP(op,10) { B--; JR_COND( B, 0x10 ); } /* DJNZ o */ -OP(op,11) { DE = ARG16(); } /* LD DE,w */ -OP(op,12) { WM( DE, A ); } /* LD (DE),A */ -OP(op,13) { DE++; } /* INC DE */ -OP(op,14) { D = INC(D); } /* INC D */ -OP(op,15) { D = DEC(D); } /* DEC D */ -OP(op,16) { D = ARG(); } /* LD D,n */ -OP(op,17) { RLA; } /* RLA */ - -OP(op,18) { JR(); } /* JR o */ -OP(op,19) { ADD16(hl, de); } /* ADD HL,DE */ -OP(op,1a) { A = RM( DE ); } /* LD A,(DE) */ -OP(op,1b) { DE--; } /* DEC DE */ -OP(op,1c) { E = INC(E); } /* INC E */ -OP(op,1d) { E = DEC(E); } /* DEC E */ -OP(op,1e) { E = ARG(); } /* LD E,n */ -OP(op,1f) { RRA; } /* RRA */ - -OP(op,20) { JR_COND( !(F & ZF), 0x20 ); } /* JR NZ,o */ -OP(op,21) { HL = ARG16(); } /* LD HL,w */ -OP(op,22) { EA = ARG16(); WM16( EA, &Z80.hl ); } /* LD (w),HL */ -OP(op,23) { HL++; } /* INC HL */ -OP(op,24) { H = INC(H); } /* INC H */ -OP(op,25) { H = DEC(H); } /* DEC H */ -OP(op,26) { H = ARG(); } /* LD H,n */ -OP(op,27) { DAA; } /* DAA */ - -OP(op,28) { JR_COND( F & ZF, 0x28 ); } /* JR Z,o */ -OP(op,29) { ADD16(hl, hl); } /* ADD HL,HL */ -OP(op,2a) { EA = ARG16(); RM16( EA, &Z80.hl ); } /* LD HL,(w) */ -OP(op,2b) { HL--; } /* DEC HL */ -OP(op,2c) { L = INC(L); } /* INC L */ -OP(op,2d) { L = DEC(L); } /* DEC L */ -OP(op,2e) { L = ARG(); } /* LD L,n */ -OP(op,2f) { A ^= 0xff; F = (F&(SF|ZF|PF|CF))|HF|NF|(A&(YF|XF)); } /* CPL */ - -OP(op,30) { JR_COND( !(F & CF), 0x30 ); } /* JR NC,o */ -OP(op,31) { SP = ARG16(); } /* LD SP,w */ -OP(op,32) { EA = ARG16(); WM( EA, A ); } /* LD (w),A */ -OP(op,33) { SP++; } /* INC SP */ -OP(op,34) { WM( HL, INC(RM(HL)) ); } /* INC (HL) */ -OP(op,35) { WM( HL, DEC(RM(HL)) ); } /* DEC (HL) */ -OP(op,36) { WM( HL, ARG() ); } /* LD (HL),n */ -OP(op,37) { F = (F & (SF|ZF|PF)) | CF | (A & (YF|XF)); } /* SCF */ - -OP(op,38) { JR_COND( F & CF, 0x38 ); } /* JR C,o */ -OP(op,39) { ADD16(hl, sp); } /* ADD HL,SP */ -OP(op,3a) { EA = ARG16(); A = RM( EA ); } /* LD A,(w) */ -OP(op,3b) { SP--; } /* DEC SP */ -OP(op,3c) { A = INC(A); } /* INC A */ -OP(op,3d) { A = DEC(A); } /* DEC A */ -OP(op,3e) { A = ARG(); } /* LD A,n */ -OP(op,3f) { F = ((F&(SF|ZF|PF|CF))|((F&CF)<<4)|(A&(YF|XF)))^CF; } /* CCF */ - -OP(op,40) { } /* LD B,B */ -OP(op,41) { B = C; } /* LD B,C */ -OP(op,42) { B = D; } /* LD B,D */ -OP(op,43) { B = E; } /* LD B,E */ -OP(op,44) { B = H; } /* LD B,H */ -OP(op,45) { B = L; } /* LD B,L */ -OP(op,46) { B = RM(HL); } /* LD B,(HL) */ -OP(op,47) { B = A; } /* LD B,A */ - -OP(op,48) { C = B; } /* LD C,B */ -OP(op,49) { } /* LD C,C */ -OP(op,4a) { C = D; } /* LD C,D */ -OP(op,4b) { C = E; } /* LD C,E */ -OP(op,4c) { C = H; } /* LD C,H */ -OP(op,4d) { C = L; } /* LD C,L */ -OP(op,4e) { C = RM(HL); } /* LD C,(HL) */ -OP(op,4f) { C = A; } /* LD C,A */ - -OP(op,50) { D = B; } /* LD D,B */ -OP(op,51) { D = C; } /* LD D,C */ -OP(op,52) { } /* LD D,D */ -OP(op,53) { D = E; } /* LD D,E */ -OP(op,54) { D = H; } /* LD D,H */ -OP(op,55) { D = L; } /* LD D,L */ -OP(op,56) { D = RM(HL); } /* LD D,(HL) */ -OP(op,57) { D = A; } /* LD D,A */ - -OP(op,58) { E = B; } /* LD E,B */ -OP(op,59) { E = C; } /* LD E,C */ -OP(op,5a) { E = D; } /* LD E,D */ -OP(op,5b) { } /* LD E,E */ -OP(op,5c) { E = H; } /* LD E,H */ -OP(op,5d) { E = L; } /* LD E,L */ -OP(op,5e) { E = RM(HL); } /* LD E,(HL) */ -OP(op,5f) { E = A; } /* LD E,A */ - -OP(op,60) { H = B; } /* LD H,B */ -OP(op,61) { H = C; } /* LD H,C */ -OP(op,62) { H = D; } /* LD H,D */ -OP(op,63) { H = E; } /* LD H,E */ -OP(op,64) { } /* LD H,H */ -OP(op,65) { H = L; } /* LD H,L */ -OP(op,66) { H = RM(HL); } /* LD H,(HL) */ -OP(op,67) { H = A; } /* LD H,A */ - -OP(op,68) { L = B; } /* LD L,B */ -OP(op,69) { L = C; } /* LD L,C */ -OP(op,6a) { L = D; } /* LD L,D */ -OP(op,6b) { L = E; } /* LD L,E */ -OP(op,6c) { L = H; } /* LD L,H */ -OP(op,6d) { } /* LD L,L */ -OP(op,6e) { L = RM(HL); } /* LD L,(HL) */ -OP(op,6f) { L = A; } /* LD L,A */ - -OP(op,70) { WM( HL, B ); } /* LD (HL),B */ -OP(op,71) { WM( HL, C ); } /* LD (HL),C */ -OP(op,72) { WM( HL, D ); } /* LD (HL),D */ -OP(op,73) { WM( HL, E ); } /* LD (HL),E */ -OP(op,74) { WM( HL, H ); } /* LD (HL),H */ -OP(op,75) { WM( HL, L ); } /* LD (HL),L */ -OP(op,76) { ENTER_HALT; } /* HALT */ -OP(op,77) { WM( HL, A ); } /* LD (HL),A */ - -OP(op,78) { A = B; } /* LD A,B */ -OP(op,79) { A = C; } /* LD A,C */ -OP(op,7a) { A = D; } /* LD A,D */ -OP(op,7b) { A = E; } /* LD A,E */ -OP(op,7c) { A = H; } /* LD A,H */ -OP(op,7d) { A = L; } /* LD A,L */ -OP(op,7e) { A = RM(HL); } /* LD A,(HL) */ -OP(op,7f) { } /* LD A,A */ - -OP(op,80) { ADD(B); } /* ADD A,B */ -OP(op,81) { ADD(C); } /* ADD A,C */ -OP(op,82) { ADD(D); } /* ADD A,D */ -OP(op,83) { ADD(E); } /* ADD A,E */ -OP(op,84) { ADD(H); } /* ADD A,H */ -OP(op,85) { ADD(L); } /* ADD A,L */ -OP(op,86) { ADD(RM(HL)); } /* ADD A,(HL) */ -OP(op,87) { ADD(A); } /* ADD A,A */ - -OP(op,88) { ADC(B); } /* ADC A,B */ -OP(op,89) { ADC(C); } /* ADC A,C */ -OP(op,8a) { ADC(D); } /* ADC A,D */ -OP(op,8b) { ADC(E); } /* ADC A,E */ -OP(op,8c) { ADC(H); } /* ADC A,H */ -OP(op,8d) { ADC(L); } /* ADC A,L */ -OP(op,8e) { ADC(RM(HL)); } /* ADC A,(HL) */ -OP(op,8f) { ADC(A); } /* ADC A,A */ - -OP(op,90) { SUB(B); } /* SUB B */ -OP(op,91) { SUB(C); } /* SUB C */ -OP(op,92) { SUB(D); } /* SUB D */ -OP(op,93) { SUB(E); } /* SUB E */ -OP(op,94) { SUB(H); } /* SUB H */ -OP(op,95) { SUB(L); } /* SUB L */ -OP(op,96) { SUB(RM(HL)); } /* SUB (HL) */ -OP(op,97) { SUB(A); } /* SUB A */ - -OP(op,98) { SBC(B); } /* SBC A,B */ -OP(op,99) { SBC(C); } /* SBC A,C */ -OP(op,9a) { SBC(D); } /* SBC A,D */ -OP(op,9b) { SBC(E); } /* SBC A,E */ -OP(op,9c) { SBC(H); } /* SBC A,H */ -OP(op,9d) { SBC(L); } /* SBC A,L */ -OP(op,9e) { SBC(RM(HL)); } /* SBC A,(HL) */ -OP(op,9f) { SBC(A); } /* SBC A,A */ - -OP(op,a0) { AND(B); } /* AND B */ -OP(op,a1) { AND(C); } /* AND C */ -OP(op,a2) { AND(D); } /* AND D */ -OP(op,a3) { AND(E); } /* AND E */ -OP(op,a4) { AND(H); } /* AND H */ -OP(op,a5) { AND(L); } /* AND L */ -OP(op,a6) { AND(RM(HL)); } /* AND (HL) */ -OP(op,a7) { AND(A); } /* AND A */ - -OP(op,a8) { XOR(B); } /* XOR B */ -OP(op,a9) { XOR(C); } /* XOR C */ -OP(op,aa) { XOR(D); } /* XOR D */ -OP(op,ab) { XOR(E); } /* XOR E */ -OP(op,ac) { XOR(H); } /* XOR H */ -OP(op,ad) { XOR(L); } /* XOR L */ -OP(op,ae) { XOR(RM(HL)); } /* XOR (HL) */ -OP(op,af) { XOR(A); } /* XOR A */ - -OP(op,b0) { OR(B); } /* OR B */ -OP(op,b1) { OR(C); } /* OR C */ -OP(op,b2) { OR(D); } /* OR D */ -OP(op,b3) { OR(E); } /* OR E */ -OP(op,b4) { OR(H); } /* OR H */ -OP(op,b5) { OR(L); } /* OR L */ -OP(op,b6) { OR(RM(HL)); } /* OR (HL) */ -OP(op,b7) { OR(A); } /* OR A */ - -OP(op,b8) { CP(B); } /* CP B */ -OP(op,b9) { CP(C); } /* CP C */ -OP(op,ba) { CP(D); } /* CP D */ -OP(op,bb) { CP(E); } /* CP E */ -OP(op,bc) { CP(H); } /* CP H */ -OP(op,bd) { CP(L); } /* CP L */ -OP(op,be) { CP(RM(HL)); } /* CP (HL) */ -OP(op,bf) { CP(A); } /* CP A */ - -OP(op,c0) { RET_COND( !(F & ZF), 0xc0 ); } /* RET NZ */ -OP(op,c1) { POP( bc ); } /* POP BC */ -OP(op,c2) { JP_COND( !(F & ZF) ); } /* JP NZ,a */ -OP(op,c3) { JP; } /* JP a */ -OP(op,c4) { CALL_COND( !(F & ZF), 0xc4 ); } /* CALL NZ,a */ -OP(op,c5) { PUSH( bc ); } /* PUSH BC */ -OP(op,c6) { ADD(ARG()); } /* ADD A,n */ -OP(op,c7) { RST(0x00); } /* RST 0 */ - -OP(op,c8) { RET_COND( F & ZF, 0xc8 ); } /* RET Z */ -OP(op,c9) { POP( pc ); change_pc(PCD); } /* RET */ -OP(op,ca) { JP_COND( F & ZF ); } /* JP Z,a */ -OP(op,cb) { R++; EXEC(cb,ROP()); } /* **** CB xx */ -OP(op,cc) { CALL_COND( F & ZF, 0xcc ); } /* CALL Z,a */ -OP(op,cd) { CALL(); } /* CALL a */ -OP(op,ce) { ADC(ARG()); } /* ADC A,n */ -OP(op,cf) { RST(0x08); } /* RST 1 */ - -OP(op,d0) { RET_COND( !(F & CF), 0xd0 ); } /* RET NC */ -OP(op,d1) { POP( de ); } /* POP DE */ -OP(op,d2) { JP_COND( !(F & CF) ); } /* JP NC,a */ -OP(op,d3) { unsigned n = ARG() | (A << 8); OUT( n, A ); } /* OUT (n),A */ -OP(op,d4) { CALL_COND( !(F & CF), 0xd4 ); } /* CALL NC,a */ -OP(op,d5) { PUSH( de ); } /* PUSH DE */ -OP(op,d6) { SUB(ARG()); } /* SUB n */ -OP(op,d7) { RST(0x10); } /* RST 2 */ - -OP(op,d8) { RET_COND( F & CF, 0xd8 ); } /* RET C */ -OP(op,d9) { EXX; } /* EXX */ -OP(op,da) { JP_COND( F & CF ); } /* JP C,a */ -OP(op,db) { unsigned n = ARG() | (A << 8); A = IN( n ); } /* IN A,(n) */ -OP(op,dc) { CALL_COND( F & CF, 0xdc ); } /* CALL C,a */ -OP(op,dd) { R++; EXEC(dd,ROP()); } /* **** DD xx */ -OP(op,de) { SBC(ARG()); } /* SBC A,n */ -OP(op,df) { RST(0x18); } /* RST 3 */ - -OP(op,e0) { RET_COND( !(F & PF), 0xe0 ); } /* RET PO */ -OP(op,e1) { POP( hl ); } /* POP HL */ -OP(op,e2) { JP_COND( !(F & PF) ); } /* JP PO,a */ -OP(op,e3) { EXSP( hl ); } /* EX HL,(SP) */ -OP(op,e4) { CALL_COND( !(F & PF), 0xe4 ); } /* CALL PO,a */ -OP(op,e5) { PUSH( hl ); } /* PUSH HL */ -OP(op,e6) { AND(ARG()); } /* AND n */ -OP(op,e7) { RST(0x20); } /* RST 4 */ - -OP(op,e8) { RET_COND( F & PF, 0xe8 ); } /* RET PE */ -OP(op,e9) { PC = HL; change_pc(PCD); } /* JP (HL) */ -OP(op,ea) { JP_COND( F & PF ); } /* JP PE,a */ -OP(op,eb) { EX_DE_HL; } /* EX DE,HL */ -OP(op,ec) { CALL_COND( F & PF, 0xec ); } /* CALL PE,a */ -OP(op,ed) { R++; EXEC(ed,ROP()); } /* **** ED xx */ -OP(op,ee) { XOR(ARG()); } /* XOR n */ -OP(op,ef) { RST(0x28); } /* RST 5 */ - -OP(op,f0) { RET_COND( !(F & SF), 0xf0 ); } /* RET P */ -OP(op,f1) { POP( af ); } /* POP AF */ -OP(op,f2) { JP_COND( !(F & SF) ); } /* JP P,a */ -OP(op,f3) { IFF1 = IFF2 = 0; } /* DI */ -OP(op,f4) { CALL_COND( !(F & SF), 0xf4 ); } /* CALL P,a */ -OP(op,f5) { PUSH( af ); } /* PUSH AF */ -OP(op,f6) { OR(ARG()); } /* OR n */ -OP(op,f7) { RST(0x30); } /* RST 6 */ - -OP(op,f8) { RET_COND( F & SF, 0xf8 ); } /* RET M */ -OP(op,f9) { SP = HL; } /* LD SP,HL */ -OP(op,fa) { JP_COND(F & SF); } /* JP M,a */ -OP(op,fb) { EI; } /* EI */ -OP(op,fc) { CALL_COND( F & SF, 0xfc ); } /* CALL M,a */ -OP(op,fd) { R++; EXEC(fd,ROP()); } /* **** FD xx */ -OP(op,fe) { CP(ARG()); } /* CP n */ -OP(op,ff) { RST(0x38); } /* RST 7 */ - - -static void take_interrupt(void) -{ - int irq_vector = Z80Vector; - - /* there isn't a valid previous program counter */ - PRVPC = (UINT32)-1; - - /* Check if processor was halted */ - LEAVE_HALT; - - /* Clear both interrupt flip flops */ - IFF1 = IFF2 = 0; - - /* Daisy chain mode? If so, call the requesting device */ -// if (Z80.daisy) -// irq_vector = z80daisy_call_ack_device(Z80.daisy); - - /* else call back the cpu interface to retrieve the vector */ -// else -// irq_vector = (*Z80.irq_callback)(0); - - /* "hold_irq" assures that an irq request (with CPU_IRQSTATUS_HOLD) gets - acknowleged. This is designed to get around the following 2 problems: - - 1) Requests made with CPU_IRQSTATUS_AUTO might get skipped in - circumstances where IRQs are disabled at the moment it was requested. - - 2) Requests made with CPU_IRQSTATUS_ACK might cause more than 1 irq to - get taken if is held in the _ACK state for too long(!) - dink jan.2016 - */ - if (Z80.hold_irq) { - Z80.hold_irq = 0; - Z80.irq_state = 0; - } - -// LOG(("Z80 #%d single int. irq_vector $%02x\n", cpu_getactivecpu(), irq_vector)); - - /* Interrupt mode 2. Call [Z80.i:databyte] */ - if( IM == 2 ) - { - irq_vector = (irq_vector & 0xff) | (I << 8); - PUSH( pc ); - RM16( irq_vector, &Z80.pc ); -// LOG(("Z80 #%d IM2 [$%04x] = $%04x\n",cpu_getactivecpu() , irq_vector, PCD)); - /* CALL opcode timing */ - z80_ICount -= cc[Z80_TABLE_op][0xcd]; - } - else - /* Interrupt mode 1. RST 38h */ - if( IM == 1 ) - { -// LOG(("Z80 #%d IM1 $0038\n",cpu_getactivecpu() )); - PUSH( pc ); - PCD = 0x0038; - /* RST $38 + 'interrupt latency' cycles */ - z80_ICount -= cc[Z80_TABLE_op][0xff] + cc[Z80_TABLE_ex][0xff]; - } - else - { - /* Interrupt mode 0. We check for CALL and JP instructions, */ - /* if neither of these were found we assume a 1 byte opcode */ - /* was placed on the databus */ -// LOG(("Z80 #%d IM0 $%04x\n",cpu_getactivecpu() , irq_vector)); - switch (irq_vector & 0xff0000) - { - case 0xcd0000: /* call */ - PUSH( pc ); - PCD = irq_vector & 0xffff; - /* CALL $xxxx + 'interrupt latency' cycles */ - z80_ICount -= cc[Z80_TABLE_op][0xcd] + cc[Z80_TABLE_ex][0xff]; - break; - case 0xc30000: /* jump */ - PCD = irq_vector & 0xffff; - /* JP $xxxx + 2 cycles */ - z80_ICount -= cc[Z80_TABLE_op][0xc3] + cc[Z80_TABLE_ex][0xff]; - break; - default: /* rst (or other opcodes?) */ - PUSH( pc ); - PCD = irq_vector & 0x0038; - /* RST $xx + 2 cycles */ - z80_ICount -= cc[Z80_TABLE_op][PCD] + cc[Z80_TABLE_ex][PCD]; - break; - } - } - change_pc(PCD); -} - -void Z80Init() -{ - int i, p; - - /* setup cycle tables */ - cc[Z80_TABLE_op] = cc_op; - cc[Z80_TABLE_cb] = cc_cb; - cc[Z80_TABLE_ed] = cc_ed; - cc[Z80_TABLE_xy] = cc_xy; - cc[Z80_TABLE_xycb] = cc_xycb; - cc[Z80_TABLE_ex] = cc_ex; - -#if BIG_FLAGS_ARRAY - if( !SZHVC_add || !SZHVC_sub ) - { - int oldval, newval, val; - UINT8 *padd, *padc, *psub, *psbc; - /* allocate big flag arrays once */ - SZHVC_add = (UINT8 *)malloc(2*256*256); - SZHVC_sub = (UINT8 *)malloc(2*256*256); - if( !SZHVC_add || !SZHVC_sub ) - { -// fatalerror("Z80: failed to allocate 2 * 128K flags arrays!!!"); - } - padd = &SZHVC_add[ 0*256]; - padc = &SZHVC_add[256*256]; - psub = &SZHVC_sub[ 0*256]; - psbc = &SZHVC_sub[256*256]; - for (oldval = 0; oldval < 256; oldval++) - { - for (newval = 0; newval < 256; newval++) - { - /* add or adc w/o carry set */ - val = newval - oldval; - *padd = (newval) ? ((newval & 0x80) ? SF : 0) : ZF; - *padd |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ - if( (newval & 0x0f) < (oldval & 0x0f) ) *padd |= HF; - if( newval < oldval ) *padd |= CF; - if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padd |= VF; - padd++; - - /* adc with carry set */ - val = newval - oldval - 1; - *padc = (newval) ? ((newval & 0x80) ? SF : 0) : ZF; - *padc |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ - if( (newval & 0x0f) <= (oldval & 0x0f) ) *padc |= HF; - if( newval <= oldval ) *padc |= CF; - if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padc |= VF; - padc++; - - /* cp, sub or sbc w/o carry set */ - val = oldval - newval; - *psub = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF); - *psub |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ - if( (newval & 0x0f) > (oldval & 0x0f) ) *psub |= HF; - if( newval > oldval ) *psub |= CF; - if( (val^oldval) & (oldval^newval) & 0x80 ) *psub |= VF; - psub++; - - /* sbc with carry set */ - val = oldval - newval - 1; - *psbc = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF); - *psbc |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ - if( (newval & 0x0f) >= (oldval & 0x0f) ) *psbc |= HF; - if( newval >= oldval ) *psbc |= CF; - if( (val^oldval) & (oldval^newval) & 0x80 ) *psbc |= VF; - psbc++; - } - } - } -#endif - for (i = 0; i < 256; i++) - { - p = 0; - if( i&0x01 ) ++p; - if( i&0x02 ) ++p; - if( i&0x04 ) ++p; - if( i&0x08 ) ++p; - if( i&0x10 ) ++p; - if( i&0x20 ) ++p; - if( i&0x40 ) ++p; - if( i&0x80 ) ++p; - SZ[i] = i ? i & SF : ZF; - SZ[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ - SZ_BIT[i] = i ? i & SF : ZF | PF; - SZ_BIT[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ - SZP[i] = SZ[i] | ((p & 1) ? 0 : PF); - SZHV_inc[i] = SZ[i]; - if( i == 0x80 ) SZHV_inc[i] |= VF; - if( (i & 0x0f) == 0x00 ) SZHV_inc[i] |= HF; - SZHV_dec[i] = SZ[i] | NF; - if( i == 0x7f ) SZHV_dec[i] |= VF; - if( (i & 0x0f) == 0x0f ) SZHV_dec[i] |= HF; - } - - /* Reset registers to their initial values */ - memset(&Z80, 0, sizeof(Z80)); - Z80.hold_irq = 0; -// Z80.daisy = config; -// Z80.irq_callback = irqcallback; - IX = IY = 0xffff; /* IX and IY are FFFF after a reset! */ - F = ZF; /* Zero flag is set */ -} - -void Z80Reset() -{ - //struct z80_irq_daisy_chain *daisy; - //int (*irq_callback)(int irqline); - - memset(&Z80, 0, sizeof(Z80)); - Z80.hold_irq = 0; - - PC = 0x0000; - I = 0; - R = 0; - R2 = 0; - Z80.nmi_state = Z80_CLEAR_LINE; - Z80.nmi_pending = FALSE; - Z80.irq_state = Z80_CLEAR_LINE; - Z80.after_ei = FALSE; - IFF1 = 0; - IFF2 = 0; - - Z80Vector = 0xff; - - if (Z80.daisy) - z80daisy_reset(Z80.daisy); - - change_pc(PCD); -} - -void Z80Exit() -{ - - if (SZHVC_add) free(SZHVC_add); - SZHVC_add = NULL; - if (SZHVC_sub) free(SZHVC_sub); - SZHVC_sub = NULL; - z80edfe_callback = NULL; -} - -int Z80Execute(int cycles) -{ - z80_ICount = cycles; - Z80.cycles_left = cycles; - end_run = 0; - - /* check for NMIs on the way in; they can only be set externally */ - /* via timers, and can't be dynamically enabled, so it is safe */ - /* to just check here */ - if (Z80.nmi_pending) - { -// LOG(("Z80 #%d take NMI\n", cpu_getactivecpu())); - PRVPC = (UINT32)-1; /* there isn't a valid previous program counter */ - LEAVE_HALT; /* Check if processor was halted */ - - IFF1 = 0; - PUSH( pc ); - PCD = 0x0066; - change_pc(PCD); - z80_ICount -= 11; - Z80.nmi_pending = FALSE; - } - - do - { - /* check for IRQs before each instruction */ - if (Z80.irq_state != Z80_CLEAR_LINE && IFF1 && !Z80.after_ei) - take_interrupt(); - Z80.after_ei = FALSE; - - PRVPC = PCD; -// CALL_DEBUGGER(PCD); - R++; - EXEC_INLINE(op,ROP()); - } while( z80_ICount > 0 && !end_run ); - - if (!end_run) Z80.cycles_left = 0; - - return cycles - z80_ICount; -} - -void Z80StopExecute() -{ - end_run = 1; -} - -INT32 z80TotalCycles() -{ - return Z80.cycles_left - z80_ICount; -} - -void Z80Burn(int cycles) -{ - if( cycles > 0 ) - { - /* NOP takes 4 cycles per instruction */ - int n = (cycles + 3) / 4; - R += n; - z80_ICount -= 4 * n; - } -} - -void Z80SetIrqLine(int irqline, int state) -{ - if (irqline == Z80_INPUT_LINE_NMI) - { - /* mark an NMI pending on the rising edge */ - if (Z80.nmi_state == Z80_CLEAR_LINE && state != Z80_CLEAR_LINE) - Z80.nmi_pending = TRUE; - Z80.nmi_state = state; - } - else - { - /* update the IRQ state via the daisy chain */ - Z80.irq_state = state; -// if (Z80.daisy) -// Z80.irq_state = z80daisy_update_irq_state(Z80.daisy); - - /* the main execute loop will take the interrupt */ - } -} - -void Z80GetContext (void *dst) -{ - if( dst ) - *(Z80_Regs*)dst = Z80; -} - -void Z80SetContext (void *src) -{ - if( src ) - Z80 = *(Z80_Regs*)src; - change_pc(PCD); -} - -int Z80Scan(int nAction) -{ - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 0; - } - - SCAN_VAR(Z80); - - return 0; -} - -void Z80SetIOReadHandler(Z80ReadIoHandler handler) -{ - Z80IORead = handler; -} - -void Z80SetIOWriteHandler(Z80WriteIoHandler handler) -{ - Z80IOWrite = handler; -} - -void Z80SetProgramReadHandler(Z80ReadProgHandler handler) -{ - Z80ProgramRead = handler; -} - -void Z80SetProgramWriteHandler(Z80WriteProgHandler handler) -{ - Z80ProgramWrite = handler; -} - -void Z80SetCPUOpReadHandler(Z80ReadOpHandler handler) -{ - Z80CPUReadOp = handler; -} - -void Z80SetCPUOpArgReadHandler(Z80ReadOpArgHandler handler) -{ - Z80CPUReadOpArg = handler; -} - -int ActiveZ80GetPC() -{ - return Z80.pc.w.l; -} - -int ActiveZ80GetBC() -{ - return Z80.bc.w.l; -} - -int ActiveZ80GetDE() -{ - return Z80.de.w.l; -} - -int ActiveZ80GetHL() -{ - return Z80.hl.w.l; -} - -int ActiveZ80GetI() -{ - return Z80.i; -} - -int ActiveZ80GetIM() -{ - return Z80.im; -} - -int ActiveZ80GetPrevPC() -{ - return Z80.prvpc.d; -} - -void ActiveZ80SetIRQHold() -{ - Z80.hold_irq = 1; -} - -#if 0 -/**************************************************************************** - * Processor initialization - ****************************************************************************/ -static void z80_init(int index, int clock, const void *config, int (*irqcallback)(int)) -{ - int i, p; - - /* setup cycle tables */ - cc[Z80_TABLE_op] = cc_op; - cc[Z80_TABLE_cb] = cc_cb; - cc[Z80_TABLE_ed] = cc_ed; - cc[Z80_TABLE_xy] = cc_xy; - cc[Z80_TABLE_xycb] = cc_xycb; - cc[Z80_TABLE_ex] = cc_ex; - -#if BIG_FLAGS_ARRAY - if( !SZHVC_add || !SZHVC_sub ) - { - int oldval, newval, val; - UINT8 *padd, *padc, *psub, *psbc; - /* allocate big flag arrays once */ - SZHVC_add = (UINT8 *)malloc(2*256*256); - SZHVC_sub = (UINT8 *)malloc(2*256*256); - if( !SZHVC_add || !SZHVC_sub ) - { - fatalerror("Z80: failed to allocate 2 * 128K flags arrays!!!"); - } - padd = &SZHVC_add[ 0*256]; - padc = &SZHVC_add[256*256]; - psub = &SZHVC_sub[ 0*256]; - psbc = &SZHVC_sub[256*256]; - for (oldval = 0; oldval < 256; oldval++) - { - for (newval = 0; newval < 256; newval++) - { - /* add or adc w/o carry set */ - val = newval - oldval; - *padd = (newval) ? ((newval & 0x80) ? SF : 0) : ZF; - *padd |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ - if( (newval & 0x0f) < (oldval & 0x0f) ) *padd |= HF; - if( newval < oldval ) *padd |= CF; - if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padd |= VF; - padd++; - - /* adc with carry set */ - val = newval - oldval - 1; - *padc = (newval) ? ((newval & 0x80) ? SF : 0) : ZF; - *padc |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ - if( (newval & 0x0f) <= (oldval & 0x0f) ) *padc |= HF; - if( newval <= oldval ) *padc |= CF; - if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padc |= VF; - padc++; - - /* cp, sub or sbc w/o carry set */ - val = oldval - newval; - *psub = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF); - *psub |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ - if( (newval & 0x0f) > (oldval & 0x0f) ) *psub |= HF; - if( newval > oldval ) *psub |= CF; - if( (val^oldval) & (oldval^newval) & 0x80 ) *psub |= VF; - psub++; - - /* sbc with carry set */ - val = oldval - newval - 1; - *psbc = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF); - *psbc |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ - if( (newval & 0x0f) >= (oldval & 0x0f) ) *psbc |= HF; - if( newval >= oldval ) *psbc |= CF; - if( (val^oldval) & (oldval^newval) & 0x80 ) *psbc |= VF; - psbc++; - } - } - } -#endif - for (i = 0; i < 256; i++) - { - p = 0; - if( i&0x01 ) ++p; - if( i&0x02 ) ++p; - if( i&0x04 ) ++p; - if( i&0x08 ) ++p; - if( i&0x10 ) ++p; - if( i&0x20 ) ++p; - if( i&0x40 ) ++p; - if( i&0x80 ) ++p; - SZ[i] = i ? i & SF : ZF; - SZ[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ - SZ_BIT[i] = i ? i & SF : ZF | PF; - SZ_BIT[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ - SZP[i] = SZ[i] | ((p & 1) ? 0 : PF); - SZHV_inc[i] = SZ[i]; - if( i == 0x80 ) SZHV_inc[i] |= VF; - if( (i & 0x0f) == 0x00 ) SZHV_inc[i] |= HF; - SZHV_dec[i] = SZ[i] | NF; - if( i == 0x7f ) SZHV_dec[i] |= VF; - if( (i & 0x0f) == 0x0f ) SZHV_dec[i] |= HF; - } - - state_save_register_item("z80", index, Z80.prvpc.w.l); - state_save_register_item("z80", index, Z80.pc.w.l); - state_save_register_item("z80", index, Z80.sp.w.l); - state_save_register_item("z80", index, Z80.af.w.l); - state_save_register_item("z80", index, Z80.bc.w.l); - state_save_register_item("z80", index, Z80.de.w.l); - state_save_register_item("z80", index, Z80.hl.w.l); - state_save_register_item("z80", index, Z80.ix.w.l); - state_save_register_item("z80", index, Z80.iy.w.l); - state_save_register_item("z80", index, Z80.af2.w.l); - state_save_register_item("z80", index, Z80.bc2.w.l); - state_save_register_item("z80", index, Z80.de2.w.l); - state_save_register_item("z80", index, Z80.hl2.w.l); - state_save_register_item("z80", index, Z80.r); - state_save_register_item("z80", index, Z80.r2); - state_save_register_item("z80", index, Z80.iff1); - state_save_register_item("z80", index, Z80.iff2); - state_save_register_item("z80", index, Z80.halt); - state_save_register_item("z80", index, Z80.im); - state_save_register_item("z80", index, Z80.i); - state_save_register_item("z80", index, Z80.nmi_state); - state_save_register_item("z80", index, Z80.nmi_pending); - state_save_register_item("z80", index, Z80.irq_state); - state_save_register_item("z80", index, Z80.after_ei); - - /* Reset registers to their initial values */ - memset(&Z80, 0, sizeof(Z80)); - Z80.daisy = config; - Z80.irq_callback = irqcallback; - IX = IY = 0xffff; /* IX and IY are FFFF after a reset! */ - F = ZF; /* Zero flag is set */ -} - -/**************************************************************************** - * Do a reset - ****************************************************************************/ -static void z80_reset(void) -{ - PC = 0x0000; - I = 0; - R = 0; - R2 = 0; - Z80.nmi_state = Z80_CLEAR_LINE; - Z80.nmi_pending = FALSE; - Z80.irq_state = Z80_CLEAR_LINE; - Z80.after_ei = FALSE; - - Z80Vector = 0xff; // Correct to reset this to 0xff? - - if (Z80.daisy) - z80daisy_reset(Z80.daisy); - - change_pc(PCD); -} - -static void z80_exit(void) -{ -#if BIG_FLAGS_ARRAY - if (SZHVC_add) free(SZHVC_add); - SZHVC_add = NULL; - if (SZHVC_sub) free(SZHVC_sub); - SZHVC_sub = NULL; -#endif -} - -/**************************************************************************** - * Execute 'cycles' T-states. Return number of T-states really executed - ****************************************************************************/ -static int z80_execute(int cycles) -{ - z80_ICount = cycles; - - /* check for NMIs on the way in; they can only be set externally */ - /* via timers, and can't be dynamically enabled, so it is safe */ - /* to just check here */ - if (Z80.nmi_pending) - { - LOG(("Z80 #%d take NMI\n", cpu_getactivecpu())); - PRVPC = -1; /* there isn't a valid previous program counter */ - LEAVE_HALT; /* Check if processor was halted */ - - IFF1 = 0; - PUSH( pc ); - PCD = 0x0066; - change_pc(PCD); - z80_ICount -= 11; - Z80.nmi_pending = FALSE; - } - - do - { - /* check for IRQs before each instruction */ - if (Z80.irq_state != Z80_CLEAR_LINE && IFF1 && !Z80.after_ei) - take_interrupt(); - Z80.after_ei = FALSE; - - PRVPC = PCD; - CALL_DEBUGGER(PCD); - R++; - EXEC_INLINE(op,ROP()); - } while( z80_ICount > 0 ); - - return cycles - z80_ICount; -} - -/**************************************************************************** - * Burn 'cycles' T-states. Adjust R register for the lost time - ****************************************************************************/ -static void z80_burn(int cycles) -{ - if( cycles > 0 ) - { - /* NOP takes 4 cycles per instruction */ - int n = (cycles + 3) / 4; - R += n; - z80_ICount -= 4 * n; - } -} - -/**************************************************************************** - * Get all registers in given buffer - ****************************************************************************/ -static void z80_get_context (void *dst) -{ - if( dst ) - *(Z80_Regs*)dst = Z80; -} - -/**************************************************************************** - * Set all registers to given values - ****************************************************************************/ -static void z80_set_context (void *src) -{ - if( src ) - Z80 = *(Z80_Regs*)src; - change_pc(PCD); -} - -/**************************************************************************** - * Set IRQ line state - ****************************************************************************/ -static void set_irq_line(int irqline, int state) -{ - if (irqline == INPUT_LINE_NMI) - { - /* mark an NMI pending on the rising edge */ - if (Z80.nmi_state == Z80_CLEAR_LINE && state != Z80_CLEAR_LINE) - Z80.nmi_pending = TRUE; - Z80.nmi_state = state; - } - else - { - /* update the IRQ state via the daisy chain */ - Z80.irq_state = state; - if (Z80.daisy) - Z80.irq_state = z80daisy_update_irq_state(Z80.daisy); - - /* the main execute loop will take the interrupt */ - } -} - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static void z80_set_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are set as 64-bit signed integers --- */ - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(INPUT_LINE_NMI, info->i); break; - case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(0, info->i); break; - - case CPUINFO_INT_PC: PC = info->i; change_pc(PCD); break; - case CPUINFO_INT_REGISTER + Z80_PC: Z80.pc.w.l = info->i; break; - case CPUINFO_INT_SP: SP = info->i; break; - case CPUINFO_INT_REGISTER + Z80_SP: Z80.sp.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_A: Z80.af.b.h = info->i; break; - case CPUINFO_INT_REGISTER + Z80_B: Z80.bc.b.h = info->i; break; - case CPUINFO_INT_REGISTER + Z80_C: Z80.bc.b.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_D: Z80.de.b.h = info->i; break; - case CPUINFO_INT_REGISTER + Z80_E: Z80.de.b.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_H: Z80.hl.b.h = info->i; break; - case CPUINFO_INT_REGISTER + Z80_L: Z80.hl.b.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_AF: Z80.af.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_BC: Z80.bc.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_DE: Z80.de.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_HL: Z80.hl.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_IX: Z80.ix.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_IY: Z80.iy.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_R: Z80.r = info->i; Z80.r2 = info->i & 0x80; break; - case CPUINFO_INT_REGISTER + Z80_I: Z80.i = info->i; break; - case CPUINFO_INT_REGISTER + Z80_AF2: Z80.af2.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_BC2: Z80.bc2.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_DE2: Z80.de2.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_HL2: Z80.hl2.w.l = info->i; break; - case CPUINFO_INT_REGISTER + Z80_IM: Z80.im = info->i; break; - case CPUINFO_INT_REGISTER + Z80_IFF1: Z80.iff1 = info->i; break; - case CPUINFO_INT_REGISTER + Z80_IFF2: Z80.iff2 = info->i; break; - case CPUINFO_INT_REGISTER + Z80_HALT: Z80.halt = info->i; break; - - /* --- the following bits of info are set as pointers to data or functions --- */ - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_op: cc[Z80_TABLE_op] = info->p; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_cb: cc[Z80_TABLE_cb] = info->p; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ed: cc[Z80_TABLE_ed] = info->p; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xy: cc[Z80_TABLE_xy] = info->p; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xycb: cc[Z80_TABLE_xycb] = info->p; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ex: cc[Z80_TABLE_ex] = info->p; break; - } -} - - - -/************************************************************************** - * Generic get_info - **************************************************************************/ - -void z80_get_info(UINT32 state, cpuinfo *info) -{ - switch (state) - { - /* --- the following bits of info are returned as 64-bit signed integers --- */ - case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(Z80); break; - case CPUINFO_INT_INPUT_LINES: info->i = 1; break; - case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0xff; break; - case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; - case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; - case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; - case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; - case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; - case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; - case CPUINFO_INT_MAX_CYCLES: info->i = 16; break; - - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; - case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; - case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; - case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; - - case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = Z80.nmi_state; break; - case CPUINFO_INT_INPUT_STATE + 0: info->i = Z80.irq_state; break; - - case CPUINFO_INT_PREVIOUSPC: info->i = Z80.prvpc.w.l; break; - - case CPUINFO_INT_PC: info->i = PCD; break; - case CPUINFO_INT_REGISTER + Z80_PC: info->i = Z80.pc.w.l; break; - case CPUINFO_INT_SP: info->i = SPD; break; - case CPUINFO_INT_REGISTER + Z80_SP: info->i = Z80.sp.w.l; break; - case CPUINFO_INT_REGISTER + Z80_A: info->i = Z80.af.b.h; break; - case CPUINFO_INT_REGISTER + Z80_B: info->i = Z80.bc.b.h; break; - case CPUINFO_INT_REGISTER + Z80_C: info->i = Z80.bc.b.l; break; - case CPUINFO_INT_REGISTER + Z80_D: info->i = Z80.de.b.h; break; - case CPUINFO_INT_REGISTER + Z80_E: info->i = Z80.de.b.l; break; - case CPUINFO_INT_REGISTER + Z80_H: info->i = Z80.hl.b.h; break; - case CPUINFO_INT_REGISTER + Z80_L: info->i = Z80.hl.b.l; break; - case CPUINFO_INT_REGISTER + Z80_AF: info->i = Z80.af.w.l; break; - case CPUINFO_INT_REGISTER + Z80_BC: info->i = Z80.bc.w.l; break; - case CPUINFO_INT_REGISTER + Z80_DE: info->i = Z80.de.w.l; break; - case CPUINFO_INT_REGISTER + Z80_HL: info->i = Z80.hl.w.l; break; - case CPUINFO_INT_REGISTER + Z80_IX: info->i = Z80.ix.w.l; break; - case CPUINFO_INT_REGISTER + Z80_IY: info->i = Z80.iy.w.l; break; - case CPUINFO_INT_REGISTER + Z80_R: info->i = (Z80.r & 0x7f) | (Z80.r2 & 0x80); break; - case CPUINFO_INT_REGISTER + Z80_I: info->i = Z80.i; break; - case CPUINFO_INT_REGISTER + Z80_AF2: info->i = Z80.af2.w.l; break; - case CPUINFO_INT_REGISTER + Z80_BC2: info->i = Z80.bc2.w.l; break; - case CPUINFO_INT_REGISTER + Z80_DE2: info->i = Z80.de2.w.l; break; - case CPUINFO_INT_REGISTER + Z80_HL2: info->i = Z80.hl2.w.l; break; - case CPUINFO_INT_REGISTER + Z80_IM: info->i = Z80.im; break; - case CPUINFO_INT_REGISTER + Z80_IFF1: info->i = Z80.iff1; break; - case CPUINFO_INT_REGISTER + Z80_IFF2: info->i = Z80.iff2; break; - case CPUINFO_INT_REGISTER + Z80_HALT: info->i = Z80.halt; break; - - /* --- the following bits of info are returned as pointers to data or functions --- */ - case CPUINFO_PTR_SET_INFO: info->setinfo = z80_set_info; break; - case CPUINFO_PTR_GET_CONTEXT: info->getcontext = z80_get_context; break; - case CPUINFO_PTR_SET_CONTEXT: info->setcontext = z80_set_context; break; - case CPUINFO_PTR_INIT: info->init = z80_init; break; - case CPUINFO_PTR_RESET: info->reset = z80_reset; break; - case CPUINFO_PTR_EXIT: info->exit = z80_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = z80_execute; break; - case CPUINFO_PTR_BURN: info->burn = NULL; break; -#ifdef ENABLE_DEBUGGER - case CPUINFO_PTR_DISASSEMBLE: info->disassemble = z80_dasm; break; -#endif - case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &z80_ICount; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_op: info->p = (void *)cc[Z80_TABLE_op]; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_cb: info->p = (void *)cc[Z80_TABLE_cb]; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ed: info->p = (void *)cc[Z80_TABLE_ed]; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xy: info->p = (void *)cc[Z80_TABLE_xy]; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xycb: info->p = (void *)cc[Z80_TABLE_xycb]; break; - case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ex: info->p = (void *)cc[Z80_TABLE_ex]; break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "Z80"); break; - case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Zilog Z80"); break; - case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "3.7"); break; - case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; - case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break; - - case CPUINFO_STR_FLAGS: - sprintf(info->s, "%c%c%c%c%c%c%c%c", - Z80.af.b.l & 0x80 ? 'S':'.', - Z80.af.b.l & 0x40 ? 'Z':'.', - Z80.af.b.l & 0x20 ? '5':'.', - Z80.af.b.l & 0x10 ? 'H':'.', - Z80.af.b.l & 0x08 ? '3':'.', - Z80.af.b.l & 0x04 ? 'P':'.', - Z80.af.b.l & 0x02 ? 'N':'.', - Z80.af.b.l & 0x01 ? 'C':'.'); - break; - - case CPUINFO_STR_REGISTER + Z80_PC: sprintf(info->s, "PC:%04X", Z80.pc.w.l); break; - case CPUINFO_STR_REGISTER + Z80_SP: sprintf(info->s, "SP:%04X", Z80.sp.w.l); break; - case CPUINFO_STR_REGISTER + Z80_A: sprintf(info->s, "~A:%02X", Z80.af.b.h); break; - case CPUINFO_STR_REGISTER + Z80_B: sprintf(info->s, "~B:%02X", Z80.bc.b.h); break; - case CPUINFO_STR_REGISTER + Z80_C: sprintf(info->s, "~C:%02X", Z80.bc.b.l); break; - case CPUINFO_STR_REGISTER + Z80_D: sprintf(info->s, "~D:%02X", Z80.de.b.h); break; - case CPUINFO_STR_REGISTER + Z80_E: sprintf(info->s, "~E:%02X", Z80.de.b.l); break; - case CPUINFO_STR_REGISTER + Z80_H: sprintf(info->s, "~H:%02X", Z80.hl.b.h); break; - case CPUINFO_STR_REGISTER + Z80_L: sprintf(info->s, "~L:%02X", Z80.hl.b.l); break; - case CPUINFO_STR_REGISTER + Z80_AF: sprintf(info->s, "AF:%04X", Z80.af.w.l); break; - case CPUINFO_STR_REGISTER + Z80_BC: sprintf(info->s, "BC:%04X", Z80.bc.w.l); break; - case CPUINFO_STR_REGISTER + Z80_DE: sprintf(info->s, "DE:%04X", Z80.de.w.l); break; - case CPUINFO_STR_REGISTER + Z80_HL: sprintf(info->s, "HL:%04X", Z80.hl.w.l); break; - case CPUINFO_STR_REGISTER + Z80_IX: sprintf(info->s, "IX:%04X", Z80.ix.w.l); break; - case CPUINFO_STR_REGISTER + Z80_IY: sprintf(info->s, "IY:%04X", Z80.iy.w.l); - break; - case CPUINFO_STR_REGISTER + Z80_R: sprintf(info->s, "R:%02X", (Z80.r & 0x7f) | (Z80.r2 & 0x80)); break; - case CPUINFO_STR_REGISTER + Z80_I: sprintf(info->s, "I:%02X", Z80.i); break; - case CPUINFO_STR_REGISTER + Z80_AF2: sprintf(info->s, "AF2:%04X", Z80.af2.w.l); break; - case CPUINFO_STR_REGISTER + Z80_BC2: sprintf(info->s, "BC2:%04X", Z80.bc2.w.l); break; - case CPUINFO_STR_REGISTER + Z80_DE2: sprintf(info->s, "DE2:%04X", Z80.de2.w.l); break; - case CPUINFO_STR_REGISTER + Z80_HL2: sprintf(info->s, "HL2:%04X", Z80.hl2.w.l); break; - case CPUINFO_STR_REGISTER + Z80_IM: sprintf(info->s, "IM:%X", Z80.im); break; - case CPUINFO_STR_REGISTER + Z80_IFF1: sprintf(info->s, "IFF1:%X", Z80.iff1); break; - case CPUINFO_STR_REGISTER + Z80_IFF2: sprintf(info->s, "IFF2:%X", Z80.iff2); break; - case CPUINFO_STR_REGISTER + Z80_HALT: sprintf(info->s, "HALT:%X", Z80.halt); break; - } -} - -#endif diff --git a/jan/src/cpu/z80/z80.h b/jan/src/cpu/z80/z80.h deleted file mode 100644 index fac3cb929..000000000 --- a/jan/src/cpu/z80/z80.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef _Z80_H_ -#define _Z80_H_ - -#define CPUINFO_PTR_CPU_SPECIFIC 0x18000 -#define Z80_CLEAR_LINE 0 -#define Z80_ASSERT_LINE 1 -#define Z80_INPUT_LINE_NMI 32 - -typedef union -{ -#ifdef LSB_FIRST - struct { UINT8 l,h,h2,h3; } b; - struct { UINT16 l,h; } w; -#else - struct { UINT8 h3,h2,h,l; } b; - struct { UINT16 h,l; } w; -#endif - UINT32 d; -} Z80_PAIR; - -typedef struct -{ - Z80_PAIR prvpc,pc,sp,af,bc,de,hl,ix,iy; - Z80_PAIR af2,bc2,de2,hl2; - UINT8 r,r2,iff1,iff2,halt,im,i; - UINT8 nmi_state; /* nmi line state */ - UINT8 nmi_pending; /* nmi pending */ - UINT8 irq_state; /* irq line state */ - UINT8 after_ei; /* are we in the EI shadow? */ - INT32 cycles_left; - INT32 hold_irq; - ALIGN_VAR(8) const struct z80_irq_daisy_chain *daisy; - ALIGN_VAR(8) int (*irq_callback)(int irqline); -} Z80_Regs; - -enum { - Z80_PC=1, Z80_SP, - Z80_A, Z80_B, Z80_C, Z80_D, Z80_E, Z80_H, Z80_L, - Z80_AF, Z80_BC, Z80_DE, Z80_HL, - Z80_IX, Z80_IY, Z80_AF2, Z80_BC2, Z80_DE2, Z80_HL2, - Z80_R, Z80_I, Z80_IM, Z80_IFF1, Z80_IFF2, Z80_HALT, - Z80_DC0, Z80_DC1, Z80_DC2, Z80_DC3 -}; - -enum { - Z80_TABLE_op, - Z80_TABLE_cb, - Z80_TABLE_ed, - Z80_TABLE_xy, - Z80_TABLE_xycb, - Z80_TABLE_ex /* cycles counts for taken jr/jp/call and interrupt latency (rst opcodes) */ -}; - -enum -{ - CPUINFO_PTR_Z80_CYCLE_TABLE = CPUINFO_PTR_CPU_SPECIFIC, - CPUINFO_PTR_Z80_CYCLE_TABLE_LAST = CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ex -}; - -void Z80Init(); -void Z80Reset(); -void Z80Exit(); -int Z80Execute(int cycles); -void Z80Burn(int cycles); -void Z80SetIrqLine(int irqline, int state); -void Z80GetContext (void *dst); -void Z80SetContext (void *src); -int Z80Scan(int nAction); -INT32 z80TotalCycles(); -void Z80StopExecute(); - -extern unsigned char Z80Vector; -extern void (*z80edfe_callback)(Z80_Regs *Regs); -extern int z80_ICount; -extern UINT32 EA; - -typedef unsigned char (__fastcall *Z80ReadIoHandler)(unsigned int a); -typedef void (__fastcall *Z80WriteIoHandler)(unsigned int a, unsigned char v); -typedef unsigned char (__fastcall *Z80ReadProgHandler)(unsigned int a); -typedef void (__fastcall *Z80WriteProgHandler)(unsigned int a, unsigned char v); -typedef unsigned char (__fastcall *Z80ReadOpHandler)(unsigned int a); -typedef unsigned char (__fastcall *Z80ReadOpArgHandler)(unsigned int a); - -void Z80SetIOReadHandler(Z80ReadIoHandler handler); -void Z80SetIOWriteHandler(Z80WriteIoHandler handler); -void Z80SetProgramReadHandler(Z80ReadProgHandler handler); -void Z80SetProgramWriteHandler(Z80WriteProgHandler handler); -void Z80SetCPUOpReadHandler(Z80ReadOpHandler handler); -void Z80SetCPUOpArgReadHandler(Z80ReadOpArgHandler handler); - -int ActiveZ80GetPC(); -int ActiveZ80GetBC(); -int ActiveZ80GetDE(); -int ActiveZ80GetHL(); -int ActiveZ80GetI(); -int ActiveZ80GetIM(); -int ActiveZ80GetPrevPC(); -void ActiveZ80SetIRQHold(); - -#endif - diff --git a/jan/src/cpu/z80/z80daisy.cpp b/jan/src/cpu/z80/z80daisy.cpp deleted file mode 100644 index 2a0cd4c97..000000000 --- a/jan/src/cpu/z80/z80daisy.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/*************************************************************************** - - z80daisy.c - - Z80/180 daisy chaining support functions. - -***************************************************************************/ - -#include "z80daisy.h" - -#define CLEAR_LINE 0 -#define ASSERT_LINE 1 - - -void z80daisy_reset(const struct z80_irq_daisy_chain *daisy) -{ - /* loop over all devices and call their reset function */ - for ( ; daisy->param != -1; daisy++) - if (daisy->reset) - (*daisy->reset)(daisy->param); -} - - -int z80daisy_update_irq_state(const struct z80_irq_daisy_chain *daisy) -{ - /* loop over all devices; dev[0] is highest priority */ - for ( ; daisy->param != -1; daisy++) - { - int state = (*daisy->irq_state)(daisy->param); - - /* if this device is asserting the INT line, that's the one we want */ - if (state & Z80_DAISY_INT) - return ASSERT_LINE; - - /* if this device is asserting the IEO line, it blocks everyone else */ - if (state & Z80_DAISY_IEO) - return CLEAR_LINE; - } - - return CLEAR_LINE; -} - - -int z80daisy_call_ack_device(const struct z80_irq_daisy_chain *daisy) -{ - /* loop over all devices; dev[0] is the highest priority */ - for ( ; daisy->param != -1; daisy++) - { - int state = (*daisy->irq_state)(daisy->param); - - /* if this device is asserting the INT line, that's the one we want */ - if (state & Z80_DAISY_INT) - return (*daisy->irq_ack)(daisy->param); - } - -// logerror("z80daisy_call_ack_device: failed to find an device to ack!\n"); - return 0; -} - - -void z80daisy_call_reti_device(const struct z80_irq_daisy_chain *daisy) -{ - /* loop over all devices; dev[0] is the highest priority */ - for ( ; daisy->param != -1; daisy++) - { - int state = (*daisy->irq_state)(daisy->param); - - /* if this device is asserting the IEO line, that's the one we want */ - if (state & Z80_DAISY_IEO) - { - (*daisy->irq_reti)(daisy->param); - return; - } - } - -// logerror("z80daisy_call_reti_device: failed to find an device to reti!\n"); -} diff --git a/jan/src/cpu/z80/z80daisy.h b/jan/src/cpu/z80/z80daisy.h deleted file mode 100644 index b0e791e6e..000000000 --- a/jan/src/cpu/z80/z80daisy.h +++ /dev/null @@ -1,36 +0,0 @@ -/*************************************************************************** - - z80daisy.h - - Z80/180 daisy chaining support functions. - -***************************************************************************/ - - -#ifndef Z80DAISY_H -#define Z80DAISY_H - - -/* daisy-chain link */ -struct z80_irq_daisy_chain -{ - void (*reset)(int); /* reset callback */ - int (*irq_state)(int); /* get interrupt state */ - int (*irq_ack)(int); /* interrupt acknowledge callback */ - void (*irq_reti)(int); /* reti callback */ - int param; /* callback parameter (-1 ends list) */ -}; - - -/* these constants are returned from the irq_state function */ -#define Z80_DAISY_INT 0x01 /* interrupt request mask */ -#define Z80_DAISY_IEO 0x02 /* interrupt disable mask (IEO) */ - - -/* prototypes */ -void z80daisy_reset(const struct z80_irq_daisy_chain *daisy); -int z80daisy_update_irq_state(const struct z80_irq_daisy_chain *chain); -int z80daisy_call_ack_device(const struct z80_irq_daisy_chain *chain); -void z80daisy_call_reti_device(const struct z80_irq_daisy_chain *chain); - -#endif diff --git a/jan/src/cpu/z80_intf.cpp b/jan/src/cpu/z80_intf.cpp deleted file mode 100644 index 188466221..000000000 --- a/jan/src/cpu/z80_intf.cpp +++ /dev/null @@ -1,795 +0,0 @@ -// Z80 (Zed Eight-Ty) Interface -#include "burnint.h" -#include "z80_intf.h" - -#define MAX_Z80 8 -static struct ZetExt * ZetCPUContext[MAX_Z80] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - -typedef UINT8 (__fastcall *pZetInHandler)(UINT16 a); -typedef void (__fastcall *pZetOutHandler)(UINT16 a, UINT8 d); -typedef UINT8 (__fastcall *pZetReadHandler)(UINT16 a); -typedef void (__fastcall *pZetWriteHandler)(UINT16 a, UINT8 d); - -struct ZetExt { - Z80_Regs reg; - - UINT8* pZetMemMap[0x100 * 4]; - - pZetInHandler ZetIn; - pZetOutHandler ZetOut; - pZetReadHandler ZetRead; - pZetWriteHandler ZetWrite; - - UINT8 BusReq; -}; - -static INT32 nZetCyclesDone[MAX_Z80]; -static INT32 nZetCyclesTotal; -static INT32 nZ80ICount[MAX_Z80]; -static UINT32 Z80EA[MAX_Z80]; - -static INT32 nOpenedCPU = -1; -static INT32 nCPUCount = 0; -INT32 nHasZet = -1; - -UINT8 __fastcall ZetDummyReadHandler(UINT16) { return 0; } -void __fastcall ZetDummyWriteHandler(UINT16, UINT8) { } -UINT8 __fastcall ZetDummyInHandler(UINT16) { return 0; } -void __fastcall ZetDummyOutHandler(UINT16, UINT8) { } - -UINT8 __fastcall ZetReadIO(UINT32 a) -{ - return ZetCPUContext[nOpenedCPU]->ZetIn(a); -} - -void __fastcall ZetWriteIO(UINT32 a, UINT8 d) -{ - ZetCPUContext[nOpenedCPU]->ZetOut(a, d); -} - -UINT8 __fastcall ZetReadProg(UINT32 a) -{ - // check mem map - UINT8 * pr = ZetCPUContext[nOpenedCPU]->pZetMemMap[0x000 | (a >> 8)]; - if (pr != NULL) { - return pr[a & 0xff]; - } - - // check handler - if (ZetCPUContext[nOpenedCPU]->ZetRead != NULL) { - return ZetCPUContext[nOpenedCPU]->ZetRead(a); - } - - return 0; -} - -void __fastcall ZetWriteProg(UINT32 a, UINT8 d) -{ - // check mem map - UINT8 * pr = ZetCPUContext[nOpenedCPU]->pZetMemMap[0x100 | (a >> 8)]; - if (pr != NULL) { - pr[a & 0xff] = d; - return; - } - - // check handler - if (ZetCPUContext[nOpenedCPU]->ZetWrite != NULL) { - ZetCPUContext[nOpenedCPU]->ZetWrite(a, d); - return; - } -} - -UINT8 __fastcall ZetReadOp(UINT32 a) -{ - // check mem map - UINT8 * pr = ZetCPUContext[nOpenedCPU]->pZetMemMap[0x200 | (a >> 8)]; - if (pr != NULL) { - return pr[a & 0xff]; - } - - // check read handler - if (ZetCPUContext[nOpenedCPU]->ZetRead != NULL) { - return ZetCPUContext[nOpenedCPU]->ZetRead(a); - } - - return 0; -} - -UINT8 __fastcall ZetReadOpArg(UINT32 a) -{ - // check mem map - UINT8 * pr = ZetCPUContext[nOpenedCPU]->pZetMemMap[0x300 | (a >> 8)]; - if (pr != NULL) { - return pr[a & 0xff]; - } - - // check read handler - if (ZetCPUContext[nOpenedCPU]->ZetRead != NULL) { - return ZetCPUContext[nOpenedCPU]->ZetRead(a); - } - - return 0; -} - -void ZetSetReadHandler(UINT8 (__fastcall *pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetSetReadHandler called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetSetReadHandler called when no CPU open\n")); -#endif - - ZetCPUContext[nOpenedCPU]->ZetRead = pHandler; -} - -void ZetSetWriteHandler(void (__fastcall *pHandler)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetSetWriteHandler called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetSetWriteHandler called when no CPU open\n")); -#endif - - ZetCPUContext[nOpenedCPU]->ZetWrite = pHandler; -} - -void ZetSetInHandler(UINT8 (__fastcall *pHandler)(UINT16)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetSetInHandler called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetSetInHandler called when no CPU open\n")); -#endif - - ZetCPUContext[nOpenedCPU]->ZetIn = pHandler; -} - -void ZetSetOutHandler(void (__fastcall *pHandler)(UINT16, UINT8)) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetSetOutHandler called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetSetOutHandler called when no CPU open\n")); -#endif - - ZetCPUContext[nOpenedCPU]->ZetOut = pHandler; -} - -void ZetSetEDFECallback(void (*pCallback)(Z80_Regs*)) -{ - // Can be set before init. it's cleared at exit. - z80edfe_callback = pCallback; -} - -void ZetNewFrame() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetNewFrame called without init\n")); -#endif - - for (INT32 i = 0; i < nCPUCount; i++) { - nZetCyclesDone[i] = 0; - } - nZetCyclesTotal = 0; -} - -static void ZetCheatWriteROM(UINT32 a, UINT8 d) -{ - ZetWriteRom(a, d); -} - -static UINT8 ZetCheatRead(UINT32 a) -{ - return ZetReadByte(a); -} - -static cpu_core_config ZetCheatCpuConfig = -{ - ZetOpen, - ZetClose, - ZetCheatRead, - ZetCheatWriteROM, - ZetGetActive, - ZetTotalCycles, - ZetNewFrame, - ZetRun, - ZetRunEnd, - ZetReset, - (1<<16), // 0x10000 - 0 -}; - -INT32 ZetInit(INT32 nCPU) -{ - DebugCPU_ZetInitted = 1; - - nOpenedCPU = -1; - - ZetCPUContext[nCPU] = (struct ZetExt*)BurnMalloc(sizeof(ZetExt)); - memset (ZetCPUContext[nCPU], 0, sizeof(ZetExt)); - - if (nCPU == 0) { // not safe! - Z80Init(); - } - - { - ZetCPUContext[nCPU]->ZetIn = ZetDummyInHandler; - ZetCPUContext[nCPU]->ZetOut = ZetDummyOutHandler; - ZetCPUContext[nCPU]->ZetRead = ZetDummyReadHandler; - ZetCPUContext[nCPU]->ZetWrite = ZetDummyWriteHandler; - ZetCPUContext[nCPU]->BusReq = 0; - // TODO: Z80Init() will set IX IY F regs with default value, so get them ... - Z80GetContext(&ZetCPUContext[nCPU]->reg); - - nZetCyclesDone[nCPU] = 0; - nZ80ICount[nCPU] = 0; - - for (INT32 j = 0; j < (0x0100 * 4); j++) { - ZetCPUContext[nCPU]->pZetMemMap[j] = NULL; - } - } - - nZetCyclesTotal = 0; - - Z80SetIOReadHandler(ZetReadIO); - Z80SetIOWriteHandler(ZetWriteIO); - Z80SetProgramReadHandler(ZetReadProg); - Z80SetProgramWriteHandler(ZetWriteProg); - Z80SetCPUOpReadHandler(ZetReadOp); - Z80SetCPUOpArgReadHandler(ZetReadOpArg); - - nCPUCount = (nCPU+1) % MAX_Z80; - - nHasZet = nCPU+1; - - CpuCheatRegister(nCPU, &ZetCheatCpuConfig); - - return 0; -} - -#if 0 -INT32 ZetInit(INT32 nCount) -{ - DebugCPU_ZetInitted = 1; - - nOpenedCPU = -1; - - ZetCPUContext = (struct ZetExt *) malloc(nCount * sizeof(ZetExt)); - if (ZetCPUContext == NULL) return 1; - memset(ZetCPUContext, 0, nCount * sizeof(ZetExt)); - - Z80Init(); - - for (INT32 i = 0; i < nCount; i++) { - ZetCPUContext[i].ZetIn = ZetDummyInHandler; - ZetCPUContext[i].ZetOut = ZetDummyOutHandler; - ZetCPUContext[i].ZetRead = ZetDummyReadHandler; - ZetCPUContext[i].ZetWrite = ZetDummyWriteHandler; - ZetCPUContext[i].BusReq = 0; - // TODO: Z80Init() will set IX IY F regs with default value, so get them ... - Z80GetContext(&ZetCPUContext[i].reg); - - nZetCyclesDone[i] = 0; - nZ80ICount[i] = 0; - - for (INT32 j = 0; j < (0x0100 * 4); j++) { - ZetCPUContext[i].pZetMemMap[j] = NULL; - } - } - - nZetCyclesTotal = 0; - - Z80SetIOReadHandler(ZetReadIO); - Z80SetIOWriteHandler(ZetWriteIO); - Z80SetProgramReadHandler(ZetReadProg); - Z80SetProgramWriteHandler(ZetWriteProg); - Z80SetCPUOpReadHandler(ZetReadOp); - Z80SetCPUOpArgReadHandler(ZetReadOpArg); - - nCPUCount = nCount % MAX_Z80; - - nHasZet = nCount; - - for (INT32 i = 0; i < nCount; i++) - CpuCheatRegister(0x0004, i); - - return 0; -} -#endif - -UINT8 ZetReadByte(UINT16 address) -{ - if (nOpenedCPU < 0) return 0; - - return ZetReadProg(address); -} - -void ZetWriteByte(UINT16 address, UINT8 data) -{ - if (nOpenedCPU < 0) return; - - ZetWriteProg(address, data); -} - -void ZetWriteRom(UINT16 address, UINT8 data) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetWriteRom called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetWriteRom called when no CPU open\n")); -#endif - - if (nOpenedCPU < 0) return; - - if (ZetCPUContext[nOpenedCPU]->pZetMemMap[0x200 | (address >> 8)] != NULL) { - ZetCPUContext[nOpenedCPU]->pZetMemMap[0x200 | (address >> 8)][address & 0xff] = data; - } - - if (ZetCPUContext[nOpenedCPU]->pZetMemMap[0x300 | (address >> 8)] != NULL) { - ZetCPUContext[nOpenedCPU]->pZetMemMap[0x300 | (address >> 8)][address & 0xff] = data; - } - - ZetWriteProg(address, data); -} - -void ZetClose() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetClose called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetClose called when no CPU open\n")); -#endif - - Z80GetContext(&ZetCPUContext[nOpenedCPU]->reg); - nZetCyclesDone[nOpenedCPU] = nZetCyclesTotal; - nZ80ICount[nOpenedCPU] = z80_ICount; - Z80EA[nOpenedCPU] = EA; - - nOpenedCPU = -1; -} - -void ZetOpen(INT32 nCPU) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetOpen called without init\n")); - if (nCPU >= nCPUCount) bprintf(PRINT_ERROR, _T("ZetOpen called with invalid index %x\n"), nCPU); - if (nOpenedCPU != -1) bprintf(PRINT_ERROR, _T("ZetOpen called when CPU already open with index %x\n"), nCPU); - if (ZetCPUContext[nCPU] == NULL) bprintf (PRINT_ERROR, _T("ZetOpen called for uninitialized cpu %x\n"), nCPU); -#endif - - Z80SetContext(&ZetCPUContext[nCPU]->reg); - nZetCyclesTotal = nZetCyclesDone[nCPU]; - z80_ICount = nZ80ICount[nCPU]; - EA = Z80EA[nCPU]; - - nOpenedCPU = nCPU; -} - -INT32 ZetGetActive() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetGetActive called without init\n")); - //if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetGetActive called when no CPU open\n")); -#endif - - return nOpenedCPU; -} - -INT32 ZetRun(INT32 nCycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetRun called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetRun called when no CPU open\n")); -#endif - - if (nCycles <= 0) return 0; - - if (ZetCPUContext[nOpenedCPU]->BusReq) { - nZetCyclesTotal += nCycles; - return nCycles; - } - - nCycles = Z80Execute(nCycles); - - nZetCyclesTotal += nCycles; - - return nCycles; -} - -void ZetRunAdjust(INT32 /*nCycles*/) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetRunAdjust called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetRunAdjust called when no CPU open\n")); -#endif -} - -void ZetRunEnd() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetRunEnd called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetRunEnd called when no CPU open\n")); -#endif - - Z80StopExecute(); -} - -// This function will make an area callback ZetRead/ZetWrite -INT32 ZetMemCallback(INT32 nStart, INT32 nEnd, INT32 nMode) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetMemCallback called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetMemCallback called when no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = ZetCPUContext[nOpenedCPU]->pZetMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - switch (nMode) { - case 0: - pMemMap[0 + i] = NULL; - break; - case 1: - pMemMap[0x100 + i] = NULL; - break; - case 2: - pMemMap[0x200 + i] = NULL; - pMemMap[0x300 + i] = NULL; - break; - } - } - - return 0; -} - -void ZetExit() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetExit called without init\n")); -#endif - - if (!DebugCPU_ZetInitted) return; - - Z80Exit(); - - for (INT32 i = 0; i < MAX_Z80; i++) { - if (ZetCPUContext[i]) { - BurnFree (ZetCPUContext[i]); - ZetCPUContext[i] = NULL; - } - } - - nCPUCount = 0; - nHasZet = -1; - - DebugCPU_ZetInitted = 0; -} - - -// This function will make an area callback ZetRead/ZetWrite -INT32 ZetUnmapMemory(INT32 nStart, INT32 nEnd, INT32 nFlags) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetUnmapMemory called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetUnmapMemory called when no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = ZetCPUContext[nOpenedCPU]->pZetMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - if (nFlags & (1 << 0)) pMemMap[0 + i] = NULL; // READ - if (nFlags & (1 << 1)) pMemMap[0x100 + i] = NULL; // WRITE - if (nFlags & (1 << 2)) pMemMap[0x200 + i] = NULL; // OP - if (nFlags & (1 << 3)) pMemMap[0x300 + i] = NULL; // ARG - } - - return 0; -} - -void ZetMapMemory(UINT8 *Mem, INT32 nStart, INT32 nEnd, INT32 nFlags) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetMapMemory called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetMapMemory called when no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = ZetCPUContext[nOpenedCPU]->pZetMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - if (nFlags & (1 << 0)) pMemMap[0 + i] = Mem + ((i - cStart) << 8); // READ - if (nFlags & (1 << 1)) pMemMap[0x100 + i] = Mem + ((i - cStart) << 8); // WRITE - if (nFlags & (1 << 2)) pMemMap[0x200 + i] = Mem + ((i - cStart) << 8); // OP - if (nFlags & (1 << 3)) pMemMap[0x300 + i] = Mem + ((i - cStart) << 8); // ARG - } -} - -INT32 ZetMapArea(INT32 nStart, INT32 nEnd, INT32 nMode, UINT8 *Mem) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetMapArea called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetMapArea called when no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = ZetCPUContext[nOpenedCPU]->pZetMemMap; - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - switch (nMode) { - case 0: { - pMemMap[0 + i] = Mem + ((i - cStart) << 8); - break; - } - - case 1: { - pMemMap[0x100 + i] = Mem + ((i - cStart) << 8); - break; - } - - case 2: { - pMemMap[0x200 + i] = Mem + ((i - cStart) << 8); - pMemMap[0x300 + i] = Mem + ((i - cStart) << 8); - break; - } - } - } - - return 0; -} - -INT32 ZetMapArea(INT32 nStart, INT32 nEnd, INT32 nMode, UINT8 *Mem01, UINT8 *Mem02) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetMapArea called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetMapArea called when no CPU open\n")); -#endif - - UINT8 cStart = (nStart >> 8); - UINT8 **pMemMap = ZetCPUContext[nOpenedCPU]->pZetMemMap; - - if (nMode != 2) { - return 1; - } - - for (UINT16 i = cStart; i <= (nEnd >> 8); i++) { - pMemMap[0x200 + i] = Mem01 + ((i - cStart) << 8); - pMemMap[0x300 + i] = Mem02 + ((i - cStart) << 8); - } - - return 0; -} - -void ZetReset() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetReset called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetReset called when no CPU open\n")); -#endif - - Z80Reset(); -} - -UINT32 ZetGetPC(INT32 n) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetGetPC called without init\n")); - if (nOpenedCPU == -1 && n < 0) bprintf(PRINT_ERROR, _T("ZetGetPC called when no CPU open\n")); -#endif - - if (n < 0) { - return ActiveZ80GetPC(); - } else { - return ZetCPUContext[n]->reg.pc.w.l; - } -} - -INT32 ZetGetPrevPC(INT32 n) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetGetPrvPC called without init\n")); - if (nOpenedCPU == -1 && n < 0) bprintf(PRINT_ERROR, _T("ZetGetPrevPC called when no CPU open\n")); -#endif - - if (n < 0) { - return ActiveZ80GetPrevPC(); - } else { - return ZetCPUContext[n]->reg.prvpc.d; - } -} - -INT32 ZetBc(INT32 n) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetBc called without init\n")); - if (nOpenedCPU == -1 && n < 0) bprintf(PRINT_ERROR, _T("ZetBc called when no CPU open\n")); -#endif - - if (n < 0) { - return ActiveZ80GetBC(); - } else { - return ZetCPUContext[n]->reg.bc.w.l; - } -} - -INT32 ZetDe(INT32 n) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetDe called without init\n")); - if (nOpenedCPU == -1 && n < 0) bprintf(PRINT_ERROR, _T("ZetDe called when no CPU open\n")); -#endif - - if (n < 0) { - return ActiveZ80GetDE(); - } else { - return ZetCPUContext[n]->reg.de.w.l; - } -} - -INT32 ZetHL(INT32 n) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetHL called without init\n")); - if (nOpenedCPU == -1 && n < 0) bprintf(PRINT_ERROR, _T("ZetHL called when no CPU open\n")); -#endif - - if (n < 0) { - return ActiveZ80GetHL(); - } else { - return ZetCPUContext[n]->reg.hl.w.l; - } -} - -INT32 ZetI(INT32 n) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetI called without init\n")); - if (nOpenedCPU == -1 && n < 0) bprintf(PRINT_ERROR, _T("ZetI called when no CPU open\n")); -#endif - - if (n < 0) { - return ActiveZ80GetI(); - } else { - return ZetCPUContext[n]->reg.i; - } -} - -INT32 ZetScan(INT32 nAction) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetScan called without init\n")); -#endif - - if ((nAction & ACB_DRIVER_DATA) == 0) { - return 0; - } - - char szText[] = "Z80 #0"; - - for (INT32 i = 0; i < nCPUCount; i++) { - szText[5] = '1' + i; - - ScanVar(&ZetCPUContext[i]->reg, sizeof(Z80_Regs), szText); - SCAN_VAR(Z80EA[i]); - SCAN_VAR(nZ80ICount[i]); - SCAN_VAR(nZetCyclesDone[i]); - } - - SCAN_VAR(nZetCyclesTotal); - - return 0; -} - -void ZetSetIRQLine(const INT32 line, const INT32 status) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetSetIRQLine called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetSetIRQLine called when no CPU open\n")); -#endif - - switch ( status ) { - case CPU_IRQSTATUS_NONE: - Z80SetIrqLine(line, 0); - break; - case CPU_IRQSTATUS_ACK: - Z80SetIrqLine(line, 1); - break; - case CPU_IRQSTATUS_AUTO: - Z80SetIrqLine(line, 1); - Z80Execute(0); - Z80SetIrqLine(0, 0); - Z80Execute(0); - break; - case CPU_IRQSTATUS_HOLD: - ActiveZ80SetIRQHold(); - Z80SetIrqLine(line, 1); - break; - } -} - -void ZetSetVector(INT32 vector) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetSetVector called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetSetVector called when no CPU open\n")); -#endif - - Z80Vector = vector; -} - -UINT8 ZetGetVector() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetGetVector called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetGetVector called when no CPU open\n")); -#endif - return Z80Vector; -} - -INT32 ZetNmi() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetNmi called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetNmi called when no CPU open\n")); -#endif - - Z80SetIrqLine(Z80_INPUT_LINE_NMI, 1); - Z80Execute(0); - Z80SetIrqLine(Z80_INPUT_LINE_NMI, 0); - Z80Execute(0); - INT32 nCycles = 12; - nZetCyclesTotal += nCycles; - - return nCycles; -} - -INT32 ZetIdle(INT32 nCycles) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetIdle called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetIdle called when no CPU open\n")); -#endif - - nZetCyclesTotal += nCycles; - - return nCycles; -} - -INT32 ZetSegmentCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetSegmentCycles called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetSegmentCycles called when no CPU open\n")); -#endif - - return z80TotalCycles(); -} - -INT32 ZetTotalCycles() -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetTotalCycles called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetTotalCycles called when no CPU open\n")); -#endif - - return nZetCyclesTotal + z80TotalCycles(); -} - -void ZetSetBUSREQLine(INT32 nStatus) -{ -#if defined FBA_DEBUG - if (!DebugCPU_ZetInitted) bprintf(PRINT_ERROR, _T("ZetSetBUSREQLine called without init\n")); - if (nOpenedCPU == -1) bprintf(PRINT_ERROR, _T("ZetSetBUSREQLine called when no CPU open\n")); -#endif - - if (nOpenedCPU < 0) return; - - ZetCPUContext[nOpenedCPU]->BusReq = nStatus; -} - -void ZetSetHL(INT32 n, UINT16 value) -{ - ZetCPUContext[n]->reg.hl.w.l=value; -} - -void ZetSetSP(INT32 n, UINT16 value) -{ - ZetCPUContext[n]->reg.sp.w.l=value; -} - -#undef MAX_Z80 diff --git a/jan/src/cpu/z80_intf.h b/jan/src/cpu/z80_intf.h deleted file mode 100644 index 743163c0c..000000000 --- a/jan/src/cpu/z80_intf.h +++ /dev/null @@ -1,65 +0,0 @@ -// Z80 (Zed Eight-Ty) Interface - -#ifndef FASTCALL - #undef __fastcall - #define __fastcall -#endif - -#include "z80/z80.h" - -extern INT32 nHasZet; -void ZetWriteByte(UINT16 address, UINT8 data); -UINT8 ZetReadByte(UINT16 address); -void ZetWriteRom(UINT16 address, UINT8 data); -INT32 ZetInit(INT32 nCount); -void ZetExit(); -void ZetNewFrame(); -void ZetOpen(INT32 nCPU); -void ZetClose(); -INT32 ZetGetActive(); - -//#define ZET_FETCHOP 4 -//#define ZET_FETCHARG 8 -//#define ZET_READ 1 -//#define ZET_WRITE 2 -//#define ZET_FETCH (ZET_FETCHOP|ZET_FETCHARG) -//#define ZET_ROM (ZET_READ|ZET_FETCH) -//#define ZET_RAM (ZET_ROM|ZET_WRITE) - -INT32 ZetUnmapMemory(INT32 nStart,INT32 nEnd,INT32 nFlags); -void ZetMapMemory(UINT8 *Mem, INT32 nStart, INT32 nEnd, INT32 nFlags); - -INT32 ZetMemCallback(INT32 nStart,INT32 nEnd,INT32 nMode); -INT32 ZetMapArea(INT32 nStart, INT32 nEnd, INT32 nMode, UINT8 *Mem); -INT32 ZetMapArea(INT32 nStart, INT32 nEnd, INT32 nMode, UINT8 *Mem01, UINT8 *Mem02); - -void ZetReset(); -UINT32 ZetGetPC(INT32 n); -INT32 ZetGetPrevPC(INT32 n); -INT32 ZetBc(INT32 n); -INT32 ZetDe(INT32 n); -INT32 ZetHL(INT32 n); -INT32 ZetI(INT32 n); -INT32 ZetScan(INT32 nAction); -INT32 ZetRun(INT32 nCycles); -void ZetRunEnd(); -void ZetSetIRQLine(const INT32 line, const INT32 status); -void ZetSetVector(INT32 vector); -UINT8 ZetGetVector(); -INT32 ZetNmi(); -INT32 ZetIdle(INT32 nCycles); -INT32 ZetSegmentCycles(); -INT32 ZetTotalCycles(); -void ZetSetHL(INT32 n, UINT16 value); -void ZetSetSP(INT32 n, UINT16 value); - -//#define ZetRaiseIrq(n) ZetSetIRQLine(n, ZET_IRQSTATUS_AUTO) -//#define ZetLowerIrq() ZetSetIRQLine(0, Z80_CLEAR_LINE) - -void ZetSetReadHandler(UINT8 (__fastcall *pHandler)(UINT16)); -void ZetSetWriteHandler(void (__fastcall *pHandler)(UINT16, UINT8)); -void ZetSetInHandler(UINT8 (__fastcall *pHandler)(UINT16)); -void ZetSetOutHandler(void (__fastcall *pHandler)(UINT16, UINT8)); -void ZetSetEDFECallback(void (*pCallback)(Z80_Regs*)); - -void ZetSetBUSREQLine(INT32 nStatus); diff --git a/jan/src/dep/kaillera/client/kailleraclient.h b/jan/src/dep/kaillera/client/kailleraclient.h deleted file mode 100644 index 06818e98c..000000000 --- a/jan/src/dep/kaillera/client/kailleraclient.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - Kaillera client API v0.84 - (c) 2001 Christophe Thibault - - History: - 0.84: added moreInfos callback - 0.83: added clientDropped callback - 0.8 : added in-game chat function/callback - 0.72: added kailleraEndGame() method - added kailleraGetVersion() method - 0.7: modified kailleraModifyPlayValues behaviour -*/ - -#ifndef KAILLERA_CLIENT_H -#define KAILLERA_CLIENT_H - -#ifdef _WIN32 -#include -#endif - -#define KAILLERA_CLIENT_API_VERSION "0.9" - -#ifdef KAILLERA_DLL -#define DLLEXP __declspec(dllexport) int WINAPI -#else -#define DLLEXP __declspec(dllimport) int WINAPI -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - typedef struct { - char *appName; - char *gameList; - - int (WINAPI *gameCallback)(char *game, int player, int numplayers); - - void (WINAPI *chatReceivedCallback)(char *nick, char *text); - void (WINAPI *clientDroppedCallback)(char *nick, int playernb); - - void (WINAPI *moreInfosCallback)(char *gamename); - } kailleraInfos; - - /* - kailleraGetVersion - Call this method to retrieve kailleraclient.dll's version - - version must point to a char[16] buffer - */ - DLLEXP kailleraGetVersion(char *version); - /* - kailleraInit: - Call this method when your program starts - */ - DLLEXP kailleraInit(); - /* - kailleraShutdown: - Call this method when your program ends - */ - DLLEXP kailleraShutdown(); - /* - kailleraSetInfos: - Use this method for setting up various infos: - Required: - - appName must be 128 chars max. - - gameList is composed of all the game names separated by a NULL char (\0). - The list ends with 2 NULL chars (\0\0). - Be sure to only put available games there. - - gameCallback will be the function called when a new game starts - game -> name of the selected game - player -> player number (1-8). 0 for spectator. - numplayers -> number of players in the game (1-8) - - Optional: - - chatReceivedCallback will be the function called when a chat line text - has been received. Set it to NULL if you don't need/want this callback. - - clientDroppedCallback will be the function called when a client drops - from the current game. Set it to NULL if you don't need/want this callback. - - moreInfosCallback will be the function called when the user selects - "More infos about this game..." in the game list context menu. - Set it to NULL if you don't need/want this feature. - */ - DLLEXP kailleraSetInfos(kailleraInfos *infos); - /* - kailleraSelectServerDialog: - Use this method for launching the Kaillera server dialog - */ - DLLEXP kailleraSelectServerDialog(HWND parent); - - /* - kailleraModifyPlayValues: - You must call this method at every frame after you retrieved values from your input devices. - This method will record/bufferize the values you send in and will manage to mix them with - the other players. - - Basically, each players sends his values and receive all players values concatened. - - e.g: - t - player 1 sends "867F" - player 2 sends "964F" - t+1 - player 1 receives "867F964F" - player 2 receives "867F964F" - - you may want to look at the modified MAME source code available on kaillera's home page - to have a working example out of this (look in inptport.c) - - Ideally, your input values should be defined like 1 bit for a given key, which has to be - unset when the key is not pressed and set when the key is pressed. - - The size of the values you pass to this function is the size for ONE player's values. - Also, it must be the SAME for a given game and should be kept to a minimum (for network - speed and latency issues). - - Be sure that the values parameters has enough space for receiving all inputs from all players - (8 players max.) - - returns: length received or -1 on network error (player no more in the game) - */ - DLLEXP kailleraModifyPlayValues(void *values, int size); - - /* - kailleraChatSend - Use this function to send a line of chat text during a game - */ - DLLEXP kailleraChatSend(char *text); - - /* - kailleraEndGame: - Your emulation thread must call this method when the user stops the emulation - */ - DLLEXP kailleraEndGame(); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/jan/src/dep/kaillera/client/net.cpp b/jan/src/dep/kaillera/client/net.cpp deleted file mode 100644 index 70240ecef..000000000 --- a/jan/src/dep/kaillera/client/net.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#include -#include -#include "net.h" - -HINSTANCE Kaillera_HDLL; -int Kaillera_Initialised; - -int (WINAPI *Kaillera_Get_Version) (char *version); -int (WINAPI *Kaillera_Init) (); -int (WINAPI *Kaillera_Shutdown) (); -int (WINAPI *Kaillera_Set_Infos) (kailleraInfos *infos); -int (WINAPI *Kaillera_Select_Server_Dialog) (HWND parent); -int (WINAPI *Kaillera_Modify_Play_Values) (void *values, int size); -int (WINAPI *Kaillera_Chat_Send) (char *text); -int (WINAPI *Kaillera_End_Game) (); - - -int WINAPI Empty_Kaillera_Get_Version(char* /*version*/) -{ - return 0; -} - -int WINAPI Empty_Kaillera_Init() -{ - return 0; -} - -int WINAPI Empty_Kaillera_Shutdown() -{ - return 0; -} - -int WINAPI Empty_Kaillera_Set_Infos(kailleraInfos* /*infos*/) -{ - return 0; -} - -int WINAPI Empty_Kaillera_Select_Server_Dialog(HWND /*parent*/) -{ - return 0; -} - -int WINAPI Empty_Kaillera_Modify_Play_Values(void* /*values*/, int /*size*/) -{ - return 0; -} - -int WINAPI Empty_Kaillera_Chat_Send(char* /*text*/) -{ - return 0; -} - -int WINAPI Empty_Kaillera_End_Game() -{ - return 0; -} - - -int Init_Network(void) -{ -//#if defined (_UNICODE) -// Kaillera_HDLL = LoadLibrary(L"kailleraclient.dll"); -//#else - Kaillera_HDLL = LoadLibrary("kailleraclient.dll"); -//#endif - - - - if (Kaillera_HDLL != NULL) - { - Kaillera_Get_Version = (int (WINAPI *)(char *version)) GetProcAddress(Kaillera_HDLL, "_kailleraGetVersion@4"); - Kaillera_Init = (int (WINAPI *)()) GetProcAddress(Kaillera_HDLL, "_kailleraInit@0"); - Kaillera_Shutdown = (int (WINAPI *)()) GetProcAddress(Kaillera_HDLL, "_kailleraShutdown@0"); - Kaillera_Set_Infos = (int (WINAPI *)(kailleraInfos *infos)) GetProcAddress(Kaillera_HDLL, "_kailleraSetInfos@4"); - Kaillera_Select_Server_Dialog = (int (WINAPI *)(HWND parent)) GetProcAddress(Kaillera_HDLL, "_kailleraSelectServerDialog@4"); - Kaillera_Modify_Play_Values = (int (WINAPI *)(void *values, int size)) GetProcAddress(Kaillera_HDLL, "_kailleraModifyPlayValues@8"); - Kaillera_Chat_Send = (int (WINAPI *)(char *text)) GetProcAddress(Kaillera_HDLL, "_kailleraChatSend@4"); - Kaillera_End_Game = (int (WINAPI *)()) GetProcAddress(Kaillera_HDLL, "_kailleraEndGame@0"); - - if ((Kaillera_Get_Version != NULL) && (Kaillera_Init != NULL) && (Kaillera_Shutdown != NULL) && (Kaillera_Set_Infos != NULL) && (Kaillera_Select_Server_Dialog != NULL) && (Kaillera_Modify_Play_Values != NULL) && (Kaillera_Chat_Send != NULL) && (Kaillera_End_Game != NULL)) - { - Kaillera_Init(); - Kaillera_Initialised = 1; - return 0; - } - - FreeLibrary(Kaillera_HDLL); - } else { - } - - Kaillera_Get_Version = Empty_Kaillera_Get_Version; - Kaillera_Init = Empty_Kaillera_Init; - Kaillera_Shutdown = Empty_Kaillera_Shutdown; - Kaillera_Set_Infos = Empty_Kaillera_Set_Infos; - Kaillera_Select_Server_Dialog = Empty_Kaillera_Select_Server_Dialog; - Kaillera_Modify_Play_Values = Empty_Kaillera_Modify_Play_Values; - Kaillera_Chat_Send = Empty_Kaillera_Chat_Send; - Kaillera_End_Game = Empty_Kaillera_End_Game; - - Kaillera_Initialised = 0; - return 1; -} - - -void End_Network(void) -{ - if (Kaillera_Initialised) - { - Kaillera_Shutdown(); - FreeLibrary(Kaillera_HDLL); - } -} diff --git a/jan/src/dep/kaillera/client/net.h b/jan/src/dep/kaillera/client/net.h deleted file mode 100644 index 39f03bf5c..000000000 --- a/jan/src/dep/kaillera/client/net.h +++ /dev/null @@ -1,15 +0,0 @@ -#include "kailleraclient.h" - -extern int Kaillera_Initialised; - -extern int (WINAPI *Kaillera_Get_Version) (char *version); -extern int (WINAPI *Kaillera_Init) (); -extern int (WINAPI *Kaillera_Shutdown) (); -extern int (WINAPI *Kaillera_Set_Infos) (kailleraInfos *infos); -extern int (WINAPI *Kaillera_Select_Server_Dialog) (HWND parent); -extern int (WINAPI *Kaillera_Modify_Play_Values) (void *values, int size); -extern int (WINAPI *Kaillera_Chat_Send) (char *text); -extern int (WINAPI *Kaillera_End_Game) (); - -int Init_Network(void); -void End_Network(void); diff --git a/jan/src/dep/libs/lib7z/7z.h b/jan/src/dep/libs/lib7z/7z.h deleted file mode 100644 index 216f381ca..000000000 --- a/jan/src/dep/libs/lib7z/7z.h +++ /dev/null @@ -1,202 +0,0 @@ -/* 7z.h -- 7z interface -2015-11-18 : Igor Pavlov : Public domain */ - -#ifndef __7Z_H -#define __7Z_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -#define k7zStartHeaderSize 0x20 -#define k7zSignatureSize 6 - -extern const Byte k7zSignature[k7zSignatureSize]; - -typedef struct -{ - const Byte *Data; - size_t Size; -} CSzData; - -/* CSzCoderInfo & CSzFolder support only default methods */ - -typedef struct -{ - size_t PropsOffset; - UInt32 MethodID; - Byte NumStreams; - Byte PropsSize; -} CSzCoderInfo; - -typedef struct -{ - UInt32 InIndex; - UInt32 OutIndex; -} CSzBond; - -#define SZ_NUM_CODERS_IN_FOLDER_MAX 4 -#define SZ_NUM_BONDS_IN_FOLDER_MAX 3 -#define SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX 4 - -typedef struct -{ - UInt32 NumCoders; - UInt32 NumBonds; - UInt32 NumPackStreams; - UInt32 UnpackStream; - UInt32 PackStreams[SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX]; - CSzBond Bonds[SZ_NUM_BONDS_IN_FOLDER_MAX]; - CSzCoderInfo Coders[SZ_NUM_CODERS_IN_FOLDER_MAX]; -} CSzFolder; - - -SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd); - -typedef struct -{ - UInt32 Low; - UInt32 High; -} CNtfsFileTime; - -typedef struct -{ - Byte *Defs; /* MSB 0 bit numbering */ - UInt32 *Vals; -} CSzBitUi32s; - -typedef struct -{ - Byte *Defs; /* MSB 0 bit numbering */ - // UInt64 *Vals; - CNtfsFileTime *Vals; -} CSzBitUi64s; - -#define SzBitArray_Check(p, i) (((p)[(i) >> 3] & (0x80 >> ((i) & 7))) != 0) - -#define SzBitWithVals_Check(p, i) ((p)->Defs && ((p)->Defs[(i) >> 3] & (0x80 >> ((i) & 7))) != 0) - -typedef struct -{ - UInt32 NumPackStreams; - UInt32 NumFolders; - - UInt64 *PackPositions; // NumPackStreams + 1 - CSzBitUi32s FolderCRCs; // NumFolders - - size_t *FoCodersOffsets; // NumFolders + 1 - UInt32 *FoStartPackStreamIndex; // NumFolders + 1 - UInt32 *FoToCoderUnpackSizes; // NumFolders + 1 - Byte *FoToMainUnpackSizeIndex; // NumFolders - UInt64 *CoderUnpackSizes; // for all coders in all folders - - Byte *CodersData; -} CSzAr; - -UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex); - -SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex, - ILookInStream *stream, UInt64 startPos, - Byte *outBuffer, size_t outSize, - ISzAlloc *allocMain); - -typedef struct -{ - CSzAr db; - - UInt64 startPosAfterHeader; - UInt64 dataPos; - - UInt32 NumFiles; - - UInt64 *UnpackPositions; // NumFiles + 1 - // Byte *IsEmptyFiles; - Byte *IsDirs; - CSzBitUi32s CRCs; - - CSzBitUi32s Attribs; - // CSzBitUi32s Parents; - CSzBitUi64s MTime; - CSzBitUi64s CTime; - - UInt32 *FolderToFile; // NumFolders + 1 - UInt32 *FileToFolder; // NumFiles - - size_t *FileNameOffsets; /* in 2-byte steps */ - Byte *FileNames; /* UTF-16-LE */ -} CSzArEx; - -#define SzArEx_IsDir(p, i) (SzBitArray_Check((p)->IsDirs, i)) - -#define SzArEx_GetFileSize(p, i) ((p)->UnpackPositions[(i) + 1] - (p)->UnpackPositions[i]) - -void SzArEx_Init(CSzArEx *p); -void SzArEx_Free(CSzArEx *p, ISzAlloc *alloc); -UInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder); -int SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize); - -/* -if dest == NULL, the return value specifies the required size of the buffer, - in 16-bit characters, including the null-terminating character. -if dest != NULL, the return value specifies the number of 16-bit characters that - are written to the dest, including the null-terminating character. */ - -size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest); - -/* -size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex); -UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest); -*/ - - - -/* - SzArEx_Extract extracts file from archive - - *outBuffer must be 0 before first call for each new archive. - - Extracting cache: - If you need to decompress more than one file, you can send - these values from previous call: - *blockIndex, - *outBuffer, - *outBufferSize - You can consider "*outBuffer" as cache of solid block. If your archive is solid, - it will increase decompression speed. - - If you use external function, you can declare these 3 cache variables - (blockIndex, outBuffer, outBufferSize) as static in that external function. - - Free *outBuffer and set *outBuffer to 0, if you want to flush cache. -*/ - -SRes SzArEx_Extract( - const CSzArEx *db, - ILookInStream *inStream, - UInt32 fileIndex, /* index of file */ - UInt32 *blockIndex, /* index of solid block */ - Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */ - size_t *outBufferSize, /* buffer size for output buffer */ - size_t *offset, /* offset of stream for required file in *outBuffer */ - size_t *outSizeProcessed, /* size of file in *outBuffer */ - ISzAlloc *allocMain, - ISzAlloc *allocTemp); - - -/* -SzArEx_Open Errors: -SZ_ERROR_NO_ARCHIVE -SZ_ERROR_ARCHIVE -SZ_ERROR_UNSUPPORTED -SZ_ERROR_MEM -SZ_ERROR_CRC -SZ_ERROR_INPUT_EOF -SZ_ERROR_FAIL -*/ - -SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream, - ISzAlloc *allocMain, ISzAlloc *allocTemp); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/7zAlloc.c b/jan/src/dep/libs/lib7z/7zAlloc.c deleted file mode 100644 index 360da0516..000000000 --- a/jan/src/dep/libs/lib7z/7zAlloc.c +++ /dev/null @@ -1,78 +0,0 @@ -/* 7zAlloc.c -- Allocation functions -2015-11-09 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "7zAlloc.h" - -/* #define _SZ_ALLOC_DEBUG */ -/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */ - -#ifdef _SZ_ALLOC_DEBUG - -#ifdef _WIN32 -#include -#endif - -#include -int g_allocCount = 0; -int g_allocCountTemp = 0; - -#endif - -void *SzAlloc(void *p, size_t size) -{ - UNUSED_VAR(p); - if (size == 0) - return 0; - #ifdef _SZ_ALLOC_DEBUG - fprintf(stderr, "\nAlloc %10u bytes; count = %10d", (unsigned)size, g_allocCount); - g_allocCount++; - #endif - return malloc(size); -} - -void SzFree(void *p, void *address) -{ - UNUSED_VAR(p); - #ifdef _SZ_ALLOC_DEBUG - if (address != 0) - { - g_allocCount--; - fprintf(stderr, "\nFree; count = %10d", g_allocCount); - } - #endif - free(address); -} - -void *SzAllocTemp(void *p, size_t size) -{ - UNUSED_VAR(p); - if (size == 0) - return 0; - #ifdef _SZ_ALLOC_DEBUG - fprintf(stderr, "\nAlloc_temp %10u bytes; count = %10d", (unsigned)size, g_allocCountTemp); - g_allocCountTemp++; - #ifdef _WIN32 - return HeapAlloc(GetProcessHeap(), 0, size); - #endif - #endif - return malloc(size); -} - -void SzFreeTemp(void *p, void *address) -{ - UNUSED_VAR(p); - #ifdef _SZ_ALLOC_DEBUG - if (address != 0) - { - g_allocCountTemp--; - fprintf(stderr, "\nFree_temp; count = %10d", g_allocCountTemp); - } - #ifdef _WIN32 - HeapFree(GetProcessHeap(), 0, address); - return; - #endif - #endif - free(address); -} diff --git a/jan/src/dep/libs/lib7z/7zAlloc.h b/jan/src/dep/libs/lib7z/7zAlloc.h deleted file mode 100644 index 4d7502ffb..000000000 --- a/jan/src/dep/libs/lib7z/7zAlloc.h +++ /dev/null @@ -1,23 +0,0 @@ -/* 7zAlloc.h -- Allocation functions -2013-03-25 : Igor Pavlov : Public domain */ - -#ifndef __7Z_ALLOC_H -#define __7Z_ALLOC_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -void *SzAlloc(void *p, size_t size); -void SzFree(void *p, void *address); - -void *SzAllocTemp(void *p, size_t size); -void SzFreeTemp(void *p, void *address); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/jan/src/dep/libs/lib7z/7zArcIn.c b/jan/src/dep/libs/lib7z/7zArcIn.c deleted file mode 100644 index c324c37ba..000000000 --- a/jan/src/dep/libs/lib7z/7zArcIn.c +++ /dev/null @@ -1,1771 +0,0 @@ -/* 7zArcIn.c -- 7z Input functions -2016-05-16 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include - -#include "7z.h" -#include "7zBuf.h" -#include "7zCrc.h" -#include "CpuArch.h" - -#define MY_ALLOC(T, p, size, alloc) { \ - if ((p = (T *)IAlloc_Alloc(alloc, (size) * sizeof(T))) == NULL) return SZ_ERROR_MEM; } - -#define MY_ALLOC_ZE(T, p, size, alloc) { if ((size) == 0) p = NULL; else MY_ALLOC(T, p, size, alloc) } - -#define MY_ALLOC_AND_CPY(to, size, from, alloc) \ - { MY_ALLOC(Byte, to, size, alloc); memcpy(to, from, size); } - -#define MY_ALLOC_ZE_AND_CPY(to, size, from, alloc) \ - { if ((size) == 0) p = NULL; else { MY_ALLOC_AND_CPY(to, size, from, alloc) } } - -#define k7zMajorVersion 0 - -enum EIdEnum -{ - k7zIdEnd, - k7zIdHeader, - k7zIdArchiveProperties, - k7zIdAdditionalStreamsInfo, - k7zIdMainStreamsInfo, - k7zIdFilesInfo, - k7zIdPackInfo, - k7zIdUnpackInfo, - k7zIdSubStreamsInfo, - k7zIdSize, - k7zIdCRC, - k7zIdFolder, - k7zIdCodersUnpackSize, - k7zIdNumUnpackStream, - k7zIdEmptyStream, - k7zIdEmptyFile, - k7zIdAnti, - k7zIdName, - k7zIdCTime, - k7zIdATime, - k7zIdMTime, - k7zIdWinAttrib, - k7zIdComment, - k7zIdEncodedHeader, - k7zIdStartPos, - k7zIdDummy - // k7zNtSecure, - // k7zParent, - // k7zIsReal -}; - -const Byte k7zSignature[k7zSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C}; - -#define SzBitUi32s_Init(p) { (p)->Defs = NULL; (p)->Vals = NULL; } - -static SRes SzBitUi32s_Alloc(CSzBitUi32s *p, size_t num, ISzAlloc *alloc) -{ - if (num == 0) - { - p->Defs = NULL; - p->Vals = NULL; - } - else - { - MY_ALLOC(Byte, p->Defs, (num + 7) >> 3, alloc); - MY_ALLOC(UInt32, p->Vals, num, alloc); - } - return SZ_OK; -} - -void SzBitUi32s_Free(CSzBitUi32s *p, ISzAlloc *alloc) -{ - IAlloc_Free(alloc, p->Defs); p->Defs = NULL; - IAlloc_Free(alloc, p->Vals); p->Vals = NULL; -} - -#define SzBitUi64s_Init(p) { (p)->Defs = NULL; (p)->Vals = NULL; } - -void SzBitUi64s_Free(CSzBitUi64s *p, ISzAlloc *alloc) -{ - IAlloc_Free(alloc, p->Defs); p->Defs = NULL; - IAlloc_Free(alloc, p->Vals); p->Vals = NULL; -} - - -static void SzAr_Init(CSzAr *p) -{ - p->NumPackStreams = 0; - p->NumFolders = 0; - - p->PackPositions = NULL; - SzBitUi32s_Init(&p->FolderCRCs); - - p->FoCodersOffsets = NULL; - p->FoStartPackStreamIndex = NULL; - p->FoToCoderUnpackSizes = NULL; - p->FoToMainUnpackSizeIndex = NULL; - p->CoderUnpackSizes = NULL; - - p->CodersData = NULL; -} - -static void SzAr_Free(CSzAr *p, ISzAlloc *alloc) -{ - IAlloc_Free(alloc, p->PackPositions); - SzBitUi32s_Free(&p->FolderCRCs, alloc); - - IAlloc_Free(alloc, p->FoCodersOffsets); - IAlloc_Free(alloc, p->FoStartPackStreamIndex); - IAlloc_Free(alloc, p->FoToCoderUnpackSizes); - IAlloc_Free(alloc, p->FoToMainUnpackSizeIndex); - IAlloc_Free(alloc, p->CoderUnpackSizes); - - IAlloc_Free(alloc, p->CodersData); - - SzAr_Init(p); -} - - -void SzArEx_Init(CSzArEx *p) -{ - SzAr_Init(&p->db); - - p->NumFiles = 0; - p->dataPos = 0; - - p->UnpackPositions = NULL; - p->IsDirs = NULL; - - p->FolderToFile = NULL; - p->FileToFolder = NULL; - - p->FileNameOffsets = NULL; - p->FileNames = NULL; - - SzBitUi32s_Init(&p->CRCs); - SzBitUi32s_Init(&p->Attribs); - // SzBitUi32s_Init(&p->Parents); - SzBitUi64s_Init(&p->MTime); - SzBitUi64s_Init(&p->CTime); -} - -void SzArEx_Free(CSzArEx *p, ISzAlloc *alloc) -{ - IAlloc_Free(alloc, p->UnpackPositions); - IAlloc_Free(alloc, p->IsDirs); - - IAlloc_Free(alloc, p->FolderToFile); - IAlloc_Free(alloc, p->FileToFolder); - - IAlloc_Free(alloc, p->FileNameOffsets); - IAlloc_Free(alloc, p->FileNames); - - SzBitUi32s_Free(&p->CRCs, alloc); - SzBitUi32s_Free(&p->Attribs, alloc); - // SzBitUi32s_Free(&p->Parents, alloc); - SzBitUi64s_Free(&p->MTime, alloc); - SzBitUi64s_Free(&p->CTime, alloc); - - SzAr_Free(&p->db, alloc); - SzArEx_Init(p); -} - - -static int TestSignatureCandidate(const Byte *testBytes) -{ - unsigned i; - for (i = 0; i < k7zSignatureSize; i++) - if (testBytes[i] != k7zSignature[i]) - return 0; - return 1; -} - -#define SzData_Clear(p) { (p)->Data = NULL; (p)->Size = 0; } - -#define SZ_READ_BYTE_SD(_sd_, dest) if ((_sd_)->Size == 0) return SZ_ERROR_ARCHIVE; (_sd_)->Size--; dest = *(_sd_)->Data++; -#define SZ_READ_BYTE(dest) SZ_READ_BYTE_SD(sd, dest) -#define SZ_READ_BYTE_2(dest) if (sd.Size == 0) return SZ_ERROR_ARCHIVE; sd.Size--; dest = *sd.Data++; - -#define SKIP_DATA(sd, size) { sd->Size -= (size_t)(size); sd->Data += (size_t)(size); } -#define SKIP_DATA2(sd, size) { sd.Size -= (size_t)(size); sd.Data += (size_t)(size); } - -#define SZ_READ_32(dest) if (sd.Size < 4) return SZ_ERROR_ARCHIVE; \ - dest = GetUi32(sd.Data); SKIP_DATA2(sd, 4); - -static MY_NO_INLINE SRes ReadNumber(CSzData *sd, UInt64 *value) -{ - Byte firstByte, mask; - unsigned i; - UInt32 v; - - SZ_READ_BYTE(firstByte); - if ((firstByte & 0x80) == 0) - { - *value = firstByte; - return SZ_OK; - } - SZ_READ_BYTE(v); - if ((firstByte & 0x40) == 0) - { - *value = (((UInt32)firstByte & 0x3F) << 8) | v; - return SZ_OK; - } - SZ_READ_BYTE(mask); - *value = v | ((UInt32)mask << 8); - mask = 0x20; - for (i = 2; i < 8; i++) - { - Byte b; - if ((firstByte & mask) == 0) - { - UInt64 highPart = (unsigned)firstByte & (unsigned)(mask - 1); - *value |= (highPart << (8 * i)); - return SZ_OK; - } - SZ_READ_BYTE(b); - *value |= ((UInt64)b << (8 * i)); - mask >>= 1; - } - return SZ_OK; -} - - -static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, UInt32 *value) -{ - Byte firstByte; - UInt64 value64; - if (sd->Size == 0) - return SZ_ERROR_ARCHIVE; - firstByte = *sd->Data; - if ((firstByte & 0x80) == 0) - { - *value = firstByte; - sd->Data++; - sd->Size--; - return SZ_OK; - } - RINOK(ReadNumber(sd, &value64)); - if (value64 >= (UInt32)0x80000000 - 1) - return SZ_ERROR_UNSUPPORTED; - if (value64 >= ((UInt64)(1) << ((sizeof(size_t) - 1) * 8 + 4))) - return SZ_ERROR_UNSUPPORTED; - *value = (UInt32)value64; - return SZ_OK; -} - -#define ReadID(sd, value) ReadNumber(sd, value) - -static SRes SkipData(CSzData *sd) -{ - UInt64 size; - RINOK(ReadNumber(sd, &size)); - if (size > sd->Size) - return SZ_ERROR_ARCHIVE; - SKIP_DATA(sd, size); - return SZ_OK; -} - -static SRes WaitId(CSzData *sd, UInt32 id) -{ - for (;;) - { - UInt64 type; - RINOK(ReadID(sd, &type)); - if (type == id) - return SZ_OK; - if (type == k7zIdEnd) - return SZ_ERROR_ARCHIVE; - RINOK(SkipData(sd)); - } -} - -static SRes RememberBitVector(CSzData *sd, UInt32 numItems, const Byte **v) -{ - UInt32 numBytes = (numItems + 7) >> 3; - if (numBytes > sd->Size) - return SZ_ERROR_ARCHIVE; - *v = sd->Data; - SKIP_DATA(sd, numBytes); - return SZ_OK; -} - -static UInt32 CountDefinedBits(const Byte *bits, UInt32 numItems) -{ - Byte b = 0; - unsigned m = 0; - UInt32 sum = 0; - for (; numItems != 0; numItems--) - { - if (m == 0) - { - b = *bits++; - m = 8; - } - m--; - sum += ((b >> m) & 1); - } - return sum; -} - -static MY_NO_INLINE SRes ReadBitVector(CSzData *sd, UInt32 numItems, Byte **v, ISzAlloc *alloc) -{ - Byte allAreDefined; - Byte *v2; - UInt32 numBytes = (numItems + 7) >> 3; - *v = NULL; - SZ_READ_BYTE(allAreDefined); - if (numBytes == 0) - return SZ_OK; - if (allAreDefined == 0) - { - if (numBytes > sd->Size) - return SZ_ERROR_ARCHIVE; - MY_ALLOC_AND_CPY(*v, numBytes, sd->Data, alloc); - SKIP_DATA(sd, numBytes); - return SZ_OK; - } - MY_ALLOC(Byte, *v, numBytes, alloc); - v2 = *v; - memset(v2, 0xFF, (size_t)numBytes); - { - unsigned numBits = (unsigned)numItems & 7; - if (numBits != 0) - v2[numBytes - 1] = (Byte)((((UInt32)1 << numBits) - 1) << (8 - numBits)); - } - return SZ_OK; -} - -static MY_NO_INLINE SRes ReadUi32s(CSzData *sd2, UInt32 numItems, CSzBitUi32s *crcs, ISzAlloc *alloc) -{ - UInt32 i; - CSzData sd; - UInt32 *vals; - const Byte *defs; - MY_ALLOC_ZE(UInt32, crcs->Vals, numItems, alloc); - sd = *sd2; - defs = crcs->Defs; - vals = crcs->Vals; - for (i = 0; i < numItems; i++) - if (SzBitArray_Check(defs, i)) - { - SZ_READ_32(vals[i]); - } - else - vals[i] = 0; - *sd2 = sd; - return SZ_OK; -} - -static SRes ReadBitUi32s(CSzData *sd, UInt32 numItems, CSzBitUi32s *crcs, ISzAlloc *alloc) -{ - SzBitUi32s_Free(crcs, alloc); - RINOK(ReadBitVector(sd, numItems, &crcs->Defs, alloc)); - return ReadUi32s(sd, numItems, crcs, alloc); -} - -static SRes SkipBitUi32s(CSzData *sd, UInt32 numItems) -{ - Byte allAreDefined; - UInt32 numDefined = numItems; - SZ_READ_BYTE(allAreDefined); - if (!allAreDefined) - { - size_t numBytes = (numItems + 7) >> 3; - if (numBytes > sd->Size) - return SZ_ERROR_ARCHIVE; - numDefined = CountDefinedBits(sd->Data, numItems); - SKIP_DATA(sd, numBytes); - } - if (numDefined > (sd->Size >> 2)) - return SZ_ERROR_ARCHIVE; - SKIP_DATA(sd, (size_t)numDefined * 4); - return SZ_OK; -} - -static SRes ReadPackInfo(CSzAr *p, CSzData *sd, ISzAlloc *alloc) -{ - RINOK(SzReadNumber32(sd, &p->NumPackStreams)); - - RINOK(WaitId(sd, k7zIdSize)); - MY_ALLOC(UInt64, p->PackPositions, (size_t)p->NumPackStreams + 1, alloc); - { - UInt64 sum = 0; - UInt32 i; - UInt32 numPackStreams = p->NumPackStreams; - for (i = 0; i < numPackStreams; i++) - { - UInt64 packSize; - p->PackPositions[i] = sum; - RINOK(ReadNumber(sd, &packSize)); - sum += packSize; - if (sum < packSize) - return SZ_ERROR_ARCHIVE; - } - p->PackPositions[i] = sum; - } - - for (;;) - { - UInt64 type; - RINOK(ReadID(sd, &type)); - if (type == k7zIdEnd) - return SZ_OK; - if (type == k7zIdCRC) - { - /* CRC of packed streams is unused now */ - RINOK(SkipBitUi32s(sd, p->NumPackStreams)); - continue; - } - RINOK(SkipData(sd)); - } -} - -/* -static SRes SzReadSwitch(CSzData *sd) -{ - Byte external; - RINOK(SzReadByte(sd, &external)); - return (external == 0) ? SZ_OK: SZ_ERROR_UNSUPPORTED; -} -*/ - -#define k_NumCodersStreams_in_Folder_MAX (SZ_NUM_BONDS_IN_FOLDER_MAX + SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX) - -SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd) -{ - UInt32 numCoders, i; - UInt32 numInStreams = 0; - const Byte *dataStart = sd->Data; - - f->NumCoders = 0; - f->NumBonds = 0; - f->NumPackStreams = 0; - f->UnpackStream = 0; - - RINOK(SzReadNumber32(sd, &numCoders)); - if (numCoders == 0 || numCoders > SZ_NUM_CODERS_IN_FOLDER_MAX) - return SZ_ERROR_UNSUPPORTED; - - for (i = 0; i < numCoders; i++) - { - Byte mainByte; - CSzCoderInfo *coder = f->Coders + i; - unsigned idSize, j; - UInt64 id; - - SZ_READ_BYTE(mainByte); - if ((mainByte & 0xC0) != 0) - return SZ_ERROR_UNSUPPORTED; - - idSize = (unsigned)(mainByte & 0xF); - if (idSize > sizeof(id)) - return SZ_ERROR_UNSUPPORTED; - if (idSize > sd->Size) - return SZ_ERROR_ARCHIVE; - id = 0; - for (j = 0; j < idSize; j++) - { - id = ((id << 8) | *sd->Data); - sd->Data++; - sd->Size--; - } - if (id > (UInt32)0xFFFFFFFF) - return SZ_ERROR_UNSUPPORTED; - coder->MethodID = (UInt32)id; - - coder->NumStreams = 1; - coder->PropsOffset = 0; - coder->PropsSize = 0; - - if ((mainByte & 0x10) != 0) - { - UInt32 numStreams; - - RINOK(SzReadNumber32(sd, &numStreams)); - if (numStreams > k_NumCodersStreams_in_Folder_MAX) - return SZ_ERROR_UNSUPPORTED; - coder->NumStreams = (Byte)numStreams; - - RINOK(SzReadNumber32(sd, &numStreams)); - if (numStreams != 1) - return SZ_ERROR_UNSUPPORTED; - } - - numInStreams += coder->NumStreams; - - if (numInStreams > k_NumCodersStreams_in_Folder_MAX) - return SZ_ERROR_UNSUPPORTED; - - if ((mainByte & 0x20) != 0) - { - UInt32 propsSize = 0; - RINOK(SzReadNumber32(sd, &propsSize)); - if (propsSize > sd->Size) - return SZ_ERROR_ARCHIVE; - if (propsSize >= 0x80) - return SZ_ERROR_UNSUPPORTED; - coder->PropsOffset = sd->Data - dataStart; - coder->PropsSize = (Byte)propsSize; - sd->Data += (size_t)propsSize; - sd->Size -= (size_t)propsSize; - } - } - - /* - if (numInStreams == 1 && numCoders == 1) - { - f->NumPackStreams = 1; - f->PackStreams[0] = 0; - } - else - */ - { - Byte streamUsed[k_NumCodersStreams_in_Folder_MAX]; - UInt32 numBonds, numPackStreams; - - numBonds = numCoders - 1; - if (numInStreams < numBonds) - return SZ_ERROR_ARCHIVE; - if (numBonds > SZ_NUM_BONDS_IN_FOLDER_MAX) - return SZ_ERROR_UNSUPPORTED; - f->NumBonds = numBonds; - - numPackStreams = numInStreams - numBonds; - if (numPackStreams > SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX) - return SZ_ERROR_UNSUPPORTED; - f->NumPackStreams = numPackStreams; - - for (i = 0; i < numInStreams; i++) - streamUsed[i] = False; - - if (numBonds != 0) - { - Byte coderUsed[SZ_NUM_CODERS_IN_FOLDER_MAX]; - - for (i = 0; i < numCoders; i++) - coderUsed[i] = False; - - for (i = 0; i < numBonds; i++) - { - CSzBond *bp = f->Bonds + i; - - RINOK(SzReadNumber32(sd, &bp->InIndex)); - if (bp->InIndex >= numInStreams || streamUsed[bp->InIndex]) - return SZ_ERROR_ARCHIVE; - streamUsed[bp->InIndex] = True; - - RINOK(SzReadNumber32(sd, &bp->OutIndex)); - if (bp->OutIndex >= numCoders || coderUsed[bp->OutIndex]) - return SZ_ERROR_ARCHIVE; - coderUsed[bp->OutIndex] = True; - } - - for (i = 0; i < numCoders; i++) - if (!coderUsed[i]) - { - f->UnpackStream = i; - break; - } - - if (i == numCoders) - return SZ_ERROR_ARCHIVE; - } - - if (numPackStreams == 1) - { - for (i = 0; i < numInStreams; i++) - if (!streamUsed[i]) - break; - if (i == numInStreams) - return SZ_ERROR_ARCHIVE; - f->PackStreams[0] = i; - } - else - for (i = 0; i < numPackStreams; i++) - { - UInt32 index; - RINOK(SzReadNumber32(sd, &index)); - if (index >= numInStreams || streamUsed[index]) - return SZ_ERROR_ARCHIVE; - streamUsed[index] = True; - f->PackStreams[i] = index; - } - } - - f->NumCoders = numCoders; - - return SZ_OK; -} - - -static MY_NO_INLINE SRes SkipNumbers(CSzData *sd2, UInt32 num) -{ - CSzData sd; - sd = *sd2; - for (; num != 0; num--) - { - Byte firstByte, mask; - unsigned i; - SZ_READ_BYTE_2(firstByte); - if ((firstByte & 0x80) == 0) - continue; - if ((firstByte & 0x40) == 0) - { - if (sd.Size == 0) - return SZ_ERROR_ARCHIVE; - sd.Size--; - sd.Data++; - continue; - } - mask = 0x20; - for (i = 2; i < 8 && (firstByte & mask) != 0; i++) - mask >>= 1; - if (i > sd.Size) - return SZ_ERROR_ARCHIVE; - SKIP_DATA2(sd, i); - } - *sd2 = sd; - return SZ_OK; -} - - -#define k_Scan_NumCoders_MAX 64 -#define k_Scan_NumCodersStreams_in_Folder_MAX 64 - - -static SRes ReadUnpackInfo(CSzAr *p, - CSzData *sd2, - UInt32 numFoldersMax, - const CBuf *tempBufs, UInt32 numTempBufs, - ISzAlloc *alloc) -{ - CSzData sd; - - UInt32 fo, numFolders, numCodersOutStreams, packStreamIndex; - const Byte *startBufPtr; - Byte external; - - RINOK(WaitId(sd2, k7zIdFolder)); - - RINOK(SzReadNumber32(sd2, &numFolders)); - if (numFolders > numFoldersMax) - return SZ_ERROR_UNSUPPORTED; - p->NumFolders = numFolders; - - SZ_READ_BYTE_SD(sd2, external); - if (external == 0) - sd = *sd2; - else - { - UInt32 index; - RINOK(SzReadNumber32(sd2, &index)); - if (index >= numTempBufs) - return SZ_ERROR_ARCHIVE; - sd.Data = tempBufs[index].data; - sd.Size = tempBufs[index].size; - } - - MY_ALLOC(size_t, p->FoCodersOffsets, (size_t)numFolders + 1, alloc); - MY_ALLOC(UInt32, p->FoStartPackStreamIndex, (size_t)numFolders + 1, alloc); - MY_ALLOC(UInt32, p->FoToCoderUnpackSizes, (size_t)numFolders + 1, alloc); - MY_ALLOC(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc); - - startBufPtr = sd.Data; - - packStreamIndex = 0; - numCodersOutStreams = 0; - - for (fo = 0; fo < numFolders; fo++) - { - UInt32 numCoders, ci, numInStreams = 0; - - p->FoCodersOffsets[fo] = sd.Data - startBufPtr; - - RINOK(SzReadNumber32(&sd, &numCoders)); - if (numCoders == 0 || numCoders > k_Scan_NumCoders_MAX) - return SZ_ERROR_UNSUPPORTED; - - for (ci = 0; ci < numCoders; ci++) - { - Byte mainByte; - unsigned idSize; - UInt32 coderInStreams; - - SZ_READ_BYTE_2(mainByte); - if ((mainByte & 0xC0) != 0) - return SZ_ERROR_UNSUPPORTED; - idSize = (mainByte & 0xF); - if (idSize > 8) - return SZ_ERROR_UNSUPPORTED; - if (idSize > sd.Size) - return SZ_ERROR_ARCHIVE; - SKIP_DATA2(sd, idSize); - - coderInStreams = 1; - - if ((mainByte & 0x10) != 0) - { - UInt32 coderOutStreams; - RINOK(SzReadNumber32(&sd, &coderInStreams)); - RINOK(SzReadNumber32(&sd, &coderOutStreams)); - if (coderInStreams > k_Scan_NumCodersStreams_in_Folder_MAX || coderOutStreams != 1) - return SZ_ERROR_UNSUPPORTED; - } - - numInStreams += coderInStreams; - - if ((mainByte & 0x20) != 0) - { - UInt32 propsSize; - RINOK(SzReadNumber32(&sd, &propsSize)); - if (propsSize > sd.Size) - return SZ_ERROR_ARCHIVE; - SKIP_DATA2(sd, propsSize); - } - } - - { - UInt32 indexOfMainStream = 0; - UInt32 numPackStreams = 1; - - if (numCoders != 1 || numInStreams != 1) - { - Byte streamUsed[k_Scan_NumCodersStreams_in_Folder_MAX]; - Byte coderUsed[k_Scan_NumCoders_MAX]; - - UInt32 i; - UInt32 numBonds = numCoders - 1; - if (numInStreams < numBonds) - return SZ_ERROR_ARCHIVE; - - if (numInStreams > k_Scan_NumCodersStreams_in_Folder_MAX) - return SZ_ERROR_UNSUPPORTED; - - for (i = 0; i < numInStreams; i++) - streamUsed[i] = False; - for (i = 0; i < numCoders; i++) - coderUsed[i] = False; - - for (i = 0; i < numBonds; i++) - { - UInt32 index; - - RINOK(SzReadNumber32(&sd, &index)); - if (index >= numInStreams || streamUsed[index]) - return SZ_ERROR_ARCHIVE; - streamUsed[index] = True; - - RINOK(SzReadNumber32(&sd, &index)); - if (index >= numCoders || coderUsed[index]) - return SZ_ERROR_ARCHIVE; - coderUsed[index] = True; - } - - numPackStreams = numInStreams - numBonds; - - if (numPackStreams != 1) - for (i = 0; i < numPackStreams; i++) - { - UInt32 index; - RINOK(SzReadNumber32(&sd, &index)); - if (index >= numInStreams || streamUsed[index]) - return SZ_ERROR_ARCHIVE; - streamUsed[index] = True; - } - - for (i = 0; i < numCoders; i++) - if (!coderUsed[i]) - { - indexOfMainStream = i; - break; - } - - if (i == numCoders) - return SZ_ERROR_ARCHIVE; - } - - p->FoStartPackStreamIndex[fo] = packStreamIndex; - p->FoToCoderUnpackSizes[fo] = numCodersOutStreams; - p->FoToMainUnpackSizeIndex[fo] = (Byte)indexOfMainStream; - numCodersOutStreams += numCoders; - if (numCodersOutStreams < numCoders) - return SZ_ERROR_UNSUPPORTED; - if (numPackStreams > p->NumPackStreams - packStreamIndex) - return SZ_ERROR_ARCHIVE; - packStreamIndex += numPackStreams; - } - } - - p->FoToCoderUnpackSizes[fo] = numCodersOutStreams; - - { - size_t dataSize = sd.Data - startBufPtr; - p->FoStartPackStreamIndex[fo] = packStreamIndex; - p->FoCodersOffsets[fo] = dataSize; - MY_ALLOC_ZE_AND_CPY(p->CodersData, dataSize, startBufPtr, alloc); - } - - if (external != 0) - { - if (sd.Size != 0) - return SZ_ERROR_ARCHIVE; - sd = *sd2; - } - - RINOK(WaitId(&sd, k7zIdCodersUnpackSize)); - - MY_ALLOC_ZE(UInt64, p->CoderUnpackSizes, (size_t)numCodersOutStreams, alloc); - { - UInt32 i; - for (i = 0; i < numCodersOutStreams; i++) - { - RINOK(ReadNumber(&sd, p->CoderUnpackSizes + i)); - } - } - - for (;;) - { - UInt64 type; - RINOK(ReadID(&sd, &type)); - if (type == k7zIdEnd) - { - *sd2 = sd; - return SZ_OK; - } - if (type == k7zIdCRC) - { - RINOK(ReadBitUi32s(&sd, numFolders, &p->FolderCRCs, alloc)); - continue; - } - RINOK(SkipData(&sd)); - } -} - - -UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex) -{ - return p->CoderUnpackSizes[p->FoToCoderUnpackSizes[folderIndex] + p->FoToMainUnpackSizeIndex[folderIndex]]; -} - - -typedef struct -{ - UInt32 NumTotalSubStreams; - UInt32 NumSubDigests; - CSzData sdNumSubStreams; - CSzData sdSizes; - CSzData sdCRCs; -} CSubStreamInfo; - - -static SRes ReadSubStreamsInfo(CSzAr *p, CSzData *sd, CSubStreamInfo *ssi) -{ - UInt64 type = 0; - UInt32 numSubDigests = 0; - UInt32 numFolders = p->NumFolders; - UInt32 numUnpackStreams = numFolders; - UInt32 numUnpackSizesInData = 0; - - for (;;) - { - RINOK(ReadID(sd, &type)); - if (type == k7zIdNumUnpackStream) - { - UInt32 i; - ssi->sdNumSubStreams.Data = sd->Data; - numUnpackStreams = 0; - numSubDigests = 0; - for (i = 0; i < numFolders; i++) - { - UInt32 numStreams; - RINOK(SzReadNumber32(sd, &numStreams)); - if (numUnpackStreams > numUnpackStreams + numStreams) - return SZ_ERROR_UNSUPPORTED; - numUnpackStreams += numStreams; - if (numStreams != 0) - numUnpackSizesInData += (numStreams - 1); - if (numStreams != 1 || !SzBitWithVals_Check(&p->FolderCRCs, i)) - numSubDigests += numStreams; - } - ssi->sdNumSubStreams.Size = sd->Data - ssi->sdNumSubStreams.Data; - continue; - } - if (type == k7zIdCRC || type == k7zIdSize || type == k7zIdEnd) - break; - RINOK(SkipData(sd)); - } - - if (!ssi->sdNumSubStreams.Data) - { - numSubDigests = numFolders; - if (p->FolderCRCs.Defs) - numSubDigests = numFolders - CountDefinedBits(p->FolderCRCs.Defs, numFolders); - } - - ssi->NumTotalSubStreams = numUnpackStreams; - ssi->NumSubDigests = numSubDigests; - - if (type == k7zIdSize) - { - ssi->sdSizes.Data = sd->Data; - RINOK(SkipNumbers(sd, numUnpackSizesInData)); - ssi->sdSizes.Size = sd->Data - ssi->sdSizes.Data; - RINOK(ReadID(sd, &type)); - } - - for (;;) - { - if (type == k7zIdEnd) - return SZ_OK; - if (type == k7zIdCRC) - { - ssi->sdCRCs.Data = sd->Data; - RINOK(SkipBitUi32s(sd, numSubDigests)); - ssi->sdCRCs.Size = sd->Data - ssi->sdCRCs.Data; - } - else - { - RINOK(SkipData(sd)); - } - RINOK(ReadID(sd, &type)); - } -} - -static SRes SzReadStreamsInfo(CSzAr *p, - CSzData *sd, - UInt32 numFoldersMax, const CBuf *tempBufs, UInt32 numTempBufs, - UInt64 *dataOffset, - CSubStreamInfo *ssi, - ISzAlloc *alloc) -{ - UInt64 type; - - SzData_Clear(&ssi->sdSizes); - SzData_Clear(&ssi->sdCRCs); - SzData_Clear(&ssi->sdNumSubStreams); - - *dataOffset = 0; - RINOK(ReadID(sd, &type)); - if (type == k7zIdPackInfo) - { - RINOK(ReadNumber(sd, dataOffset)); - RINOK(ReadPackInfo(p, sd, alloc)); - RINOK(ReadID(sd, &type)); - } - if (type == k7zIdUnpackInfo) - { - RINOK(ReadUnpackInfo(p, sd, numFoldersMax, tempBufs, numTempBufs, alloc)); - RINOK(ReadID(sd, &type)); - } - if (type == k7zIdSubStreamsInfo) - { - RINOK(ReadSubStreamsInfo(p, sd, ssi)); - RINOK(ReadID(sd, &type)); - } - else - { - ssi->NumTotalSubStreams = p->NumFolders; - // ssi->NumSubDigests = 0; - } - - return (type == k7zIdEnd ? SZ_OK : SZ_ERROR_UNSUPPORTED); -} - -static SRes SzReadAndDecodePackedStreams( - ILookInStream *inStream, - CSzData *sd, - CBuf *tempBufs, - UInt32 numFoldersMax, - UInt64 baseOffset, - CSzAr *p, - ISzAlloc *allocTemp) -{ - UInt64 dataStartPos; - UInt32 fo; - CSubStreamInfo ssi; - - RINOK(SzReadStreamsInfo(p, sd, numFoldersMax, NULL, 0, &dataStartPos, &ssi, allocTemp)); - - dataStartPos += baseOffset; - if (p->NumFolders == 0) - return SZ_ERROR_ARCHIVE; - - for (fo = 0; fo < p->NumFolders; fo++) - Buf_Init(tempBufs + fo); - - for (fo = 0; fo < p->NumFolders; fo++) - { - CBuf *tempBuf = tempBufs + fo; - UInt64 unpackSize = SzAr_GetFolderUnpackSize(p, fo); - if ((size_t)unpackSize != unpackSize) - return SZ_ERROR_MEM; - if (!Buf_Create(tempBuf, (size_t)unpackSize, allocTemp)) - return SZ_ERROR_MEM; - } - - for (fo = 0; fo < p->NumFolders; fo++) - { - const CBuf *tempBuf = tempBufs + fo; - RINOK(LookInStream_SeekTo(inStream, dataStartPos)); - RINOK(SzAr_DecodeFolder(p, fo, inStream, dataStartPos, tempBuf->data, tempBuf->size, allocTemp)); - } - - return SZ_OK; -} - -static SRes SzReadFileNames(const Byte *data, size_t size, UInt32 numFiles, size_t *offsets) -{ - size_t pos = 0; - *offsets++ = 0; - if (numFiles == 0) - return (size == 0) ? SZ_OK : SZ_ERROR_ARCHIVE; - if (size < 2) - return SZ_ERROR_ARCHIVE; - if (data[size - 2] != 0 || data[size - 1] != 0) - return SZ_ERROR_ARCHIVE; - do - { - const Byte *p; - if (pos == size) - return SZ_ERROR_ARCHIVE; - for (p = data + pos; - #ifdef _WIN32 - *(const UInt16 *)p != 0 - #else - p[0] != 0 || p[1] != 0 - #endif - ; p += 2); - pos = p - data + 2; - *offsets++ = (pos >> 1); - } - while (--numFiles); - return (pos == size) ? SZ_OK : SZ_ERROR_ARCHIVE; -} - -static MY_NO_INLINE SRes ReadTime(CSzBitUi64s *p, UInt32 num, - CSzData *sd2, - const CBuf *tempBufs, UInt32 numTempBufs, - ISzAlloc *alloc) -{ - CSzData sd; - UInt32 i; - CNtfsFileTime *vals; - Byte *defs; - Byte external; - - RINOK(ReadBitVector(sd2, num, &p->Defs, alloc)); - - SZ_READ_BYTE_SD(sd2, external); - if (external == 0) - sd = *sd2; - else - { - UInt32 index; - RINOK(SzReadNumber32(sd2, &index)); - if (index >= numTempBufs) - return SZ_ERROR_ARCHIVE; - sd.Data = tempBufs[index].data; - sd.Size = tempBufs[index].size; - } - - MY_ALLOC_ZE(CNtfsFileTime, p->Vals, num, alloc); - vals = p->Vals; - defs = p->Defs; - for (i = 0; i < num; i++) - if (SzBitArray_Check(defs, i)) - { - if (sd.Size < 8) - return SZ_ERROR_ARCHIVE; - vals[i].Low = GetUi32(sd.Data); - vals[i].High = GetUi32(sd.Data + 4); - SKIP_DATA2(sd, 8); - } - else - vals[i].High = vals[i].Low = 0; - - if (external == 0) - *sd2 = sd; - - return SZ_OK; -} - - -#define NUM_ADDITIONAL_STREAMS_MAX 8 - - -static SRes SzReadHeader2( - CSzArEx *p, /* allocMain */ - CSzData *sd, - ILookInStream *inStream, - CBuf *tempBufs, UInt32 *numTempBufs, - ISzAlloc *allocMain, - ISzAlloc *allocTemp - ) -{ - CSubStreamInfo ssi; - -{ - UInt64 type; - - SzData_Clear(&ssi.sdSizes); - SzData_Clear(&ssi.sdCRCs); - SzData_Clear(&ssi.sdNumSubStreams); - - ssi.NumSubDigests = 0; - ssi.NumTotalSubStreams = 0; - - RINOK(ReadID(sd, &type)); - - if (type == k7zIdArchiveProperties) - { - for (;;) - { - UInt64 type2; - RINOK(ReadID(sd, &type2)); - if (type2 == k7zIdEnd) - break; - RINOK(SkipData(sd)); - } - RINOK(ReadID(sd, &type)); - } - - if (type == k7zIdAdditionalStreamsInfo) - { - CSzAr tempAr; - SRes res; - - SzAr_Init(&tempAr); - res = SzReadAndDecodePackedStreams(inStream, sd, tempBufs, NUM_ADDITIONAL_STREAMS_MAX, - p->startPosAfterHeader, &tempAr, allocTemp); - *numTempBufs = tempAr.NumFolders; - SzAr_Free(&tempAr, allocTemp); - - if (res != SZ_OK) - return res; - RINOK(ReadID(sd, &type)); - } - - if (type == k7zIdMainStreamsInfo) - { - RINOK(SzReadStreamsInfo(&p->db, sd, (UInt32)1 << 30, tempBufs, *numTempBufs, - &p->dataPos, &ssi, allocMain)); - p->dataPos += p->startPosAfterHeader; - RINOK(ReadID(sd, &type)); - } - - if (type == k7zIdEnd) - { - return SZ_OK; - } - - if (type != k7zIdFilesInfo) - return SZ_ERROR_ARCHIVE; -} - -{ - UInt32 numFiles = 0; - UInt32 numEmptyStreams = 0; - const Byte *emptyStreams = NULL; - const Byte *emptyFiles = NULL; - - RINOK(SzReadNumber32(sd, &numFiles)); - p->NumFiles = numFiles; - - for (;;) - { - UInt64 type; - UInt64 size; - RINOK(ReadID(sd, &type)); - if (type == k7zIdEnd) - break; - RINOK(ReadNumber(sd, &size)); - if (size > sd->Size) - return SZ_ERROR_ARCHIVE; - - if (type >= ((UInt32)1 << 8)) - { - SKIP_DATA(sd, size); - } - else switch ((unsigned)type) - { - case k7zIdName: - { - size_t namesSize; - const Byte *namesData; - Byte external; - - SZ_READ_BYTE(external); - if (external == 0) - { - namesSize = (size_t)size - 1; - namesData = sd->Data; - } - else - { - UInt32 index; - RINOK(SzReadNumber32(sd, &index)); - if (index >= *numTempBufs) - return SZ_ERROR_ARCHIVE; - namesData = (tempBufs)[index].data; - namesSize = (tempBufs)[index].size; - } - - if ((namesSize & 1) != 0) - return SZ_ERROR_ARCHIVE; - MY_ALLOC(size_t, p->FileNameOffsets, numFiles + 1, allocMain); - MY_ALLOC_ZE_AND_CPY(p->FileNames, namesSize, namesData, allocMain); - RINOK(SzReadFileNames(p->FileNames, namesSize, numFiles, p->FileNameOffsets)) - if (external == 0) - { - SKIP_DATA(sd, namesSize); - } - break; - } - case k7zIdEmptyStream: - { - RINOK(RememberBitVector(sd, numFiles, &emptyStreams)); - numEmptyStreams = CountDefinedBits(emptyStreams, numFiles); - emptyFiles = NULL; - break; - } - case k7zIdEmptyFile: - { - RINOK(RememberBitVector(sd, numEmptyStreams, &emptyFiles)); - break; - } - case k7zIdWinAttrib: - { - Byte external; - CSzData sdSwitch; - CSzData *sdPtr; - SzBitUi32s_Free(&p->Attribs, allocMain); - RINOK(ReadBitVector(sd, numFiles, &p->Attribs.Defs, allocMain)); - - SZ_READ_BYTE(external); - if (external == 0) - sdPtr = sd; - else - { - UInt32 index; - RINOK(SzReadNumber32(sd, &index)); - if (index >= *numTempBufs) - return SZ_ERROR_ARCHIVE; - sdSwitch.Data = (tempBufs)[index].data; - sdSwitch.Size = (tempBufs)[index].size; - sdPtr = &sdSwitch; - } - RINOK(ReadUi32s(sdPtr, numFiles, &p->Attribs, allocMain)); - break; - } - /* - case k7zParent: - { - SzBitUi32s_Free(&p->Parents, allocMain); - RINOK(ReadBitVector(sd, numFiles, &p->Parents.Defs, allocMain)); - RINOK(SzReadSwitch(sd)); - RINOK(ReadUi32s(sd, numFiles, &p->Parents, allocMain)); - break; - } - */ - case k7zIdMTime: RINOK(ReadTime(&p->MTime, numFiles, sd, tempBufs, *numTempBufs, allocMain)); break; - case k7zIdCTime: RINOK(ReadTime(&p->CTime, numFiles, sd, tempBufs, *numTempBufs, allocMain)); break; - default: - { - SKIP_DATA(sd, size); - } - } - } - - if (numFiles - numEmptyStreams != ssi.NumTotalSubStreams) - return SZ_ERROR_ARCHIVE; - - for (;;) - { - UInt64 type; - RINOK(ReadID(sd, &type)); - if (type == k7zIdEnd) - break; - RINOK(SkipData(sd)); - } - - { - UInt32 i; - UInt32 emptyFileIndex = 0; - UInt32 folderIndex = 0; - UInt32 remSubStreams = 0; - UInt32 numSubStreams = 0; - UInt64 unpackPos = 0; - const Byte *digestsDefs = NULL; - const Byte *digestsVals = NULL; - UInt32 digestsValsIndex = 0; - UInt32 digestIndex; - Byte allDigestsDefined = 0; - Byte isDirMask = 0; - Byte crcMask = 0; - Byte mask = 0x80; - - MY_ALLOC(UInt32, p->FolderToFile, p->db.NumFolders + 1, allocMain); - MY_ALLOC_ZE(UInt32, p->FileToFolder, p->NumFiles, allocMain); - MY_ALLOC(UInt64, p->UnpackPositions, p->NumFiles + 1, allocMain); - MY_ALLOC_ZE(Byte, p->IsDirs, (p->NumFiles + 7) >> 3, allocMain); - - RINOK(SzBitUi32s_Alloc(&p->CRCs, p->NumFiles, allocMain)); - - if (ssi.sdCRCs.Size != 0) - { - SZ_READ_BYTE_SD(&ssi.sdCRCs, allDigestsDefined); - if (allDigestsDefined) - digestsVals = ssi.sdCRCs.Data; - else - { - size_t numBytes = (ssi.NumSubDigests + 7) >> 3; - digestsDefs = ssi.sdCRCs.Data; - digestsVals = digestsDefs + numBytes; - } - } - - digestIndex = 0; - - for (i = 0; i < numFiles; i++, mask >>= 1) - { - if (mask == 0) - { - UInt32 byteIndex = (i - 1) >> 3; - p->IsDirs[byteIndex] = isDirMask; - p->CRCs.Defs[byteIndex] = crcMask; - isDirMask = 0; - crcMask = 0; - mask = 0x80; - } - - p->UnpackPositions[i] = unpackPos; - p->CRCs.Vals[i] = 0; - - if (emptyStreams && SzBitArray_Check(emptyStreams, i)) - { - if (emptyFiles) - { - if (!SzBitArray_Check(emptyFiles, emptyFileIndex)) - isDirMask |= mask; - emptyFileIndex++; - } - else - isDirMask |= mask; - if (remSubStreams == 0) - { - p->FileToFolder[i] = (UInt32)-1; - continue; - } - } - - if (remSubStreams == 0) - { - for (;;) - { - if (folderIndex >= p->db.NumFolders) - return SZ_ERROR_ARCHIVE; - p->FolderToFile[folderIndex] = i; - numSubStreams = 1; - if (ssi.sdNumSubStreams.Data) - { - RINOK(SzReadNumber32(&ssi.sdNumSubStreams, &numSubStreams)); - } - remSubStreams = numSubStreams; - if (numSubStreams != 0) - break; - { - UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex); - unpackPos += folderUnpackSize; - if (unpackPos < folderUnpackSize) - return SZ_ERROR_ARCHIVE; - } - - folderIndex++; - } - } - - p->FileToFolder[i] = folderIndex; - - if (emptyStreams && SzBitArray_Check(emptyStreams, i)) - continue; - - if (--remSubStreams == 0) - { - UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex); - UInt64 startFolderUnpackPos = p->UnpackPositions[p->FolderToFile[folderIndex]]; - if (folderUnpackSize < unpackPos - startFolderUnpackPos) - return SZ_ERROR_ARCHIVE; - unpackPos = startFolderUnpackPos + folderUnpackSize; - if (unpackPos < folderUnpackSize) - return SZ_ERROR_ARCHIVE; - - if (numSubStreams == 1 && SzBitWithVals_Check(&p->db.FolderCRCs, i)) - { - p->CRCs.Vals[i] = p->db.FolderCRCs.Vals[folderIndex]; - crcMask |= mask; - } - else if (allDigestsDefined || (digestsDefs && SzBitArray_Check(digestsDefs, digestIndex))) - { - p->CRCs.Vals[i] = GetUi32(digestsVals + (size_t)digestsValsIndex * 4); - digestsValsIndex++; - crcMask |= mask; - } - - folderIndex++; - } - else - { - UInt64 v; - RINOK(ReadNumber(&ssi.sdSizes, &v)); - unpackPos += v; - if (unpackPos < v) - return SZ_ERROR_ARCHIVE; - if (allDigestsDefined || (digestsDefs && SzBitArray_Check(digestsDefs, digestIndex))) - { - p->CRCs.Vals[i] = GetUi32(digestsVals + (size_t)digestsValsIndex * 4); - digestsValsIndex++; - crcMask |= mask; - } - } - } - - if (mask != 0x80) - { - UInt32 byteIndex = (i - 1) >> 3; - p->IsDirs[byteIndex] = isDirMask; - p->CRCs.Defs[byteIndex] = crcMask; - } - - p->UnpackPositions[i] = unpackPos; - - if (remSubStreams != 0) - return SZ_ERROR_ARCHIVE; - - for (;;) - { - p->FolderToFile[folderIndex] = i; - if (folderIndex >= p->db.NumFolders) - break; - if (!ssi.sdNumSubStreams.Data) - return SZ_ERROR_ARCHIVE; - RINOK(SzReadNumber32(&ssi.sdNumSubStreams, &numSubStreams)); - if (numSubStreams != 0) - return SZ_ERROR_ARCHIVE; - /* - { - UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex); - unpackPos += folderUnpackSize; - if (unpackPos < folderUnpackSize) - return SZ_ERROR_ARCHIVE; - } - */ - folderIndex++; - } - - if (ssi.sdNumSubStreams.Data && ssi.sdNumSubStreams.Size != 0) - return SZ_ERROR_ARCHIVE; - } -} - return SZ_OK; -} - - -static SRes SzReadHeader( - CSzArEx *p, - CSzData *sd, - ILookInStream *inStream, - ISzAlloc *allocMain, - ISzAlloc *allocTemp) -{ - UInt32 i; - UInt32 numTempBufs = 0; - SRes res; - CBuf tempBufs[NUM_ADDITIONAL_STREAMS_MAX]; - - for (i = 0; i < NUM_ADDITIONAL_STREAMS_MAX; i++) - Buf_Init(tempBufs + i); - - res = SzReadHeader2(p, sd, inStream, - tempBufs, &numTempBufs, - allocMain, allocTemp); - - for (i = 0; i < NUM_ADDITIONAL_STREAMS_MAX; i++) - Buf_Free(tempBufs + i, allocTemp); - - RINOK(res); - - if (sd->Size != 0) - return SZ_ERROR_FAIL; - - return res; -} - -static SRes SzArEx_Open2( - CSzArEx *p, - ILookInStream *inStream, - ISzAlloc *allocMain, - ISzAlloc *allocTemp) -{ - Byte header[k7zStartHeaderSize]; - Int64 startArcPos; - UInt64 nextHeaderOffset, nextHeaderSize; - size_t nextHeaderSizeT; - UInt32 nextHeaderCRC; - CBuf buf; - SRes res; - - startArcPos = 0; - RINOK(inStream->Seek(inStream, &startArcPos, SZ_SEEK_CUR)); - - RINOK(LookInStream_Read2(inStream, header, k7zStartHeaderSize, SZ_ERROR_NO_ARCHIVE)); - - if (!TestSignatureCandidate(header)) - return SZ_ERROR_NO_ARCHIVE; - if (header[6] != k7zMajorVersion) - return SZ_ERROR_UNSUPPORTED; - - nextHeaderOffset = GetUi64(header + 12); - nextHeaderSize = GetUi64(header + 20); - nextHeaderCRC = GetUi32(header + 28); - - p->startPosAfterHeader = startArcPos + k7zStartHeaderSize; - - if (CrcCalc(header + 12, 20) != GetUi32(header + 8)) - return SZ_ERROR_CRC; - - nextHeaderSizeT = (size_t)nextHeaderSize; - if (nextHeaderSizeT != nextHeaderSize) - return SZ_ERROR_MEM; - if (nextHeaderSizeT == 0) - return SZ_OK; - if (nextHeaderOffset > nextHeaderOffset + nextHeaderSize || - nextHeaderOffset > nextHeaderOffset + nextHeaderSize + k7zStartHeaderSize) - return SZ_ERROR_NO_ARCHIVE; - - { - Int64 pos = 0; - RINOK(inStream->Seek(inStream, &pos, SZ_SEEK_END)); - if ((UInt64)pos < startArcPos + nextHeaderOffset || - (UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset || - (UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset + nextHeaderSize) - return SZ_ERROR_INPUT_EOF; - } - - RINOK(LookInStream_SeekTo(inStream, startArcPos + k7zStartHeaderSize + nextHeaderOffset)); - - if (!Buf_Create(&buf, nextHeaderSizeT, allocTemp)) - return SZ_ERROR_MEM; - - res = LookInStream_Read(inStream, buf.data, nextHeaderSizeT); - - if (res == SZ_OK) - { - res = SZ_ERROR_ARCHIVE; - if (CrcCalc(buf.data, nextHeaderSizeT) == nextHeaderCRC) - { - CSzData sd; - UInt64 type; - sd.Data = buf.data; - sd.Size = buf.size; - - res = ReadID(&sd, &type); - - if (res == SZ_OK && type == k7zIdEncodedHeader) - { - CSzAr tempAr; - CBuf tempBuf; - Buf_Init(&tempBuf); - - SzAr_Init(&tempAr); - res = SzReadAndDecodePackedStreams(inStream, &sd, &tempBuf, 1, p->startPosAfterHeader, &tempAr, allocTemp); - SzAr_Free(&tempAr, allocTemp); - - if (res != SZ_OK) - { - Buf_Free(&tempBuf, allocTemp); - } - else - { - Buf_Free(&buf, allocTemp); - buf.data = tempBuf.data; - buf.size = tempBuf.size; - sd.Data = buf.data; - sd.Size = buf.size; - res = ReadID(&sd, &type); - } - } - - if (res == SZ_OK) - { - if (type == k7zIdHeader) - { - /* - CSzData sd2; - unsigned ttt; - for (ttt = 0; ttt < 40000; ttt++) - { - SzArEx_Free(p, allocMain); - sd2 = sd; - res = SzReadHeader(p, &sd2, inStream, allocMain, allocTemp); - if (res != SZ_OK) - break; - } - */ - res = SzReadHeader(p, &sd, inStream, allocMain, allocTemp); - } - else - res = SZ_ERROR_UNSUPPORTED; - } - } - } - - Buf_Free(&buf, allocTemp); - return res; -} - - -SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream, - ISzAlloc *allocMain, ISzAlloc *allocTemp) -{ - SRes res = SzArEx_Open2(p, inStream, allocMain, allocTemp); - if (res != SZ_OK) - SzArEx_Free(p, allocMain); - return res; -} - - -SRes SzArEx_Extract( - const CSzArEx *p, - ILookInStream *inStream, - UInt32 fileIndex, - UInt32 *blockIndex, - Byte **tempBuf, - size_t *outBufferSize, - size_t *offset, - size_t *outSizeProcessed, - ISzAlloc *allocMain, - ISzAlloc *allocTemp) -{ - UInt32 folderIndex = p->FileToFolder[fileIndex]; - SRes res = SZ_OK; - - *offset = 0; - *outSizeProcessed = 0; - - if (folderIndex == (UInt32)-1) - { - IAlloc_Free(allocMain, *tempBuf); - *blockIndex = folderIndex; - *tempBuf = NULL; - *outBufferSize = 0; - return SZ_OK; - } - - if (*tempBuf == NULL || *blockIndex != folderIndex) - { - UInt64 unpackSizeSpec = SzAr_GetFolderUnpackSize(&p->db, folderIndex); - /* - UInt64 unpackSizeSpec = - p->UnpackPositions[p->FolderToFile[folderIndex + 1]] - - p->UnpackPositions[p->FolderToFile[folderIndex]]; - */ - size_t unpackSize = (size_t)unpackSizeSpec; - - if (unpackSize != unpackSizeSpec) - return SZ_ERROR_MEM; - *blockIndex = folderIndex; - IAlloc_Free(allocMain, *tempBuf); - *tempBuf = NULL; - - if (res == SZ_OK) - { - *outBufferSize = unpackSize; - if (unpackSize != 0) - { - *tempBuf = (Byte *)IAlloc_Alloc(allocMain, unpackSize); - if (*tempBuf == NULL) - res = SZ_ERROR_MEM; - } - - if (res == SZ_OK) - { - res = SzAr_DecodeFolder(&p->db, folderIndex, - inStream, p->dataPos, *tempBuf, unpackSize, allocTemp); - } - } - } - - if (res == SZ_OK) - { - UInt64 unpackPos = p->UnpackPositions[fileIndex]; - *offset = (size_t)(unpackPos - p->UnpackPositions[p->FolderToFile[folderIndex]]); - *outSizeProcessed = (size_t)(p->UnpackPositions[fileIndex + 1] - unpackPos); - if (*offset + *outSizeProcessed > *outBufferSize) - return SZ_ERROR_FAIL; - if (SzBitWithVals_Check(&p->CRCs, fileIndex)) - if (CrcCalc(*tempBuf + *offset, *outSizeProcessed) != p->CRCs.Vals[fileIndex]) - res = SZ_ERROR_CRC; - } - - return res; -} - - -size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest) -{ - size_t offs = p->FileNameOffsets[fileIndex]; - size_t len = p->FileNameOffsets[fileIndex + 1] - offs; - if (dest != 0) - { - size_t i; - const Byte *src = p->FileNames + offs * 2; - for (i = 0; i < len; i++) - dest[i] = GetUi16(src + i * 2); - } - return len; -} - -/* -size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex) -{ - size_t len; - if (!p->FileNameOffsets) - return 1; - len = 0; - for (;;) - { - UInt32 parent = (UInt32)(Int32)-1; - len += p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex]; - if SzBitWithVals_Check(&p->Parents, fileIndex) - parent = p->Parents.Vals[fileIndex]; - if (parent == (UInt32)(Int32)-1) - return len; - fileIndex = parent; - } -} - -UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest) -{ - Bool needSlash; - if (!p->FileNameOffsets) - { - *(--dest) = 0; - return dest; - } - needSlash = False; - for (;;) - { - UInt32 parent = (UInt32)(Int32)-1; - size_t curLen = p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex]; - SzArEx_GetFileNameUtf16(p, fileIndex, dest - curLen); - if (needSlash) - *(dest - 1) = '/'; - needSlash = True; - dest -= curLen; - - if SzBitWithVals_Check(&p->Parents, fileIndex) - parent = p->Parents.Vals[fileIndex]; - if (parent == (UInt32)(Int32)-1) - return dest; - fileIndex = parent; - } -} -*/ diff --git a/jan/src/dep/libs/lib7z/7zBuf.c b/jan/src/dep/libs/lib7z/7zBuf.c deleted file mode 100644 index b0ac1104b..000000000 --- a/jan/src/dep/libs/lib7z/7zBuf.c +++ /dev/null @@ -1,36 +0,0 @@ -/* 7zBuf.c -- Byte Buffer -2013-01-21 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "7zBuf.h" - -void Buf_Init(CBuf *p) -{ - p->data = 0; - p->size = 0; -} - -int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc) -{ - p->size = 0; - if (size == 0) - { - p->data = 0; - return 1; - } - p->data = (Byte *)alloc->Alloc(alloc, size); - if (p->data != 0) - { - p->size = size; - return 1; - } - return 0; -} - -void Buf_Free(CBuf *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->data); - p->data = 0; - p->size = 0; -} diff --git a/jan/src/dep/libs/lib7z/7zBuf.h b/jan/src/dep/libs/lib7z/7zBuf.h deleted file mode 100644 index e5f9218be..000000000 --- a/jan/src/dep/libs/lib7z/7zBuf.h +++ /dev/null @@ -1,35 +0,0 @@ -/* 7zBuf.h -- Byte Buffer -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __7Z_BUF_H -#define __7Z_BUF_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -typedef struct -{ - Byte *data; - size_t size; -} CBuf; - -void Buf_Init(CBuf *p); -int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc); -void Buf_Free(CBuf *p, ISzAlloc *alloc); - -typedef struct -{ - Byte *data; - size_t size; - size_t pos; -} CDynBuf; - -void DynBuf_Construct(CDynBuf *p); -void DynBuf_SeekToBeg(CDynBuf *p); -int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc); -void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/7zBuf2.c b/jan/src/dep/libs/lib7z/7zBuf2.c deleted file mode 100644 index 8e3fe9297..000000000 --- a/jan/src/dep/libs/lib7z/7zBuf2.c +++ /dev/null @@ -1,51 +0,0 @@ -/* 7zBuf2.c -- Byte Buffer -2014-08-22 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include - -#include "7zBuf.h" - -void DynBuf_Construct(CDynBuf *p) -{ - p->data = 0; - p->size = 0; - p->pos = 0; -} - -void DynBuf_SeekToBeg(CDynBuf *p) -{ - p->pos = 0; -} - -int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc) -{ - if (size > p->size - p->pos) - { - size_t newSize = p->pos + size; - Byte *data; - newSize += newSize / 4; - data = (Byte *)alloc->Alloc(alloc, newSize); - if (data == 0) - return 0; - p->size = newSize; - memcpy(data, p->data, p->pos); - alloc->Free(alloc, p->data); - p->data = data; - } - if (size != 0) - { - memcpy(p->data + p->pos, buf, size); - p->pos += size; - } - return 1; -} - -void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->data); - p->data = 0; - p->size = 0; - p->pos = 0; -} diff --git a/jan/src/dep/libs/lib7z/7zCrc.c b/jan/src/dep/libs/lib7z/7zCrc.c deleted file mode 100644 index 607db3404..000000000 --- a/jan/src/dep/libs/lib7z/7zCrc.c +++ /dev/null @@ -1,128 +0,0 @@ -/* 7zCrc.c -- CRC32 init -2015-03-10 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "7zCrc.h" -#include "CpuArch.h" - -#define kCrcPoly 0xEDB88320 - -#ifdef MY_CPU_LE - #define CRC_NUM_TABLES 8 -#else - #define CRC_NUM_TABLES 9 - - #define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24)) - - UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table); - UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table); -#endif - -#ifndef MY_CPU_BE - UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table); - UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table); -#endif - -typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table); - -CRC_FUNC g_CrcUpdateT4; -CRC_FUNC g_CrcUpdateT8; -CRC_FUNC g_CrcUpdate; - -UInt32 g_CrcTable[256 * CRC_NUM_TABLES]; - -UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size) -{ - return g_CrcUpdate(v, data, size, g_CrcTable); -} - -UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size) -{ - return g_CrcUpdate(CRC_INIT_VAL, data, size, g_CrcTable) ^ CRC_INIT_VAL; -} - -#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) - -UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table) -{ - const Byte *p = (const Byte *)data; - const Byte *pEnd = p + size; - for (; p != pEnd; p++) - v = CRC_UPDATE_BYTE_2(v, *p); - return v; -} - -void MY_FAST_CALL CrcGenerateTable() -{ - UInt32 i; - for (i = 0; i < 256; i++) - { - UInt32 r = i; - unsigned j; - for (j = 0; j < 8; j++) - r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); - g_CrcTable[i] = r; - } - for (; i < 256 * CRC_NUM_TABLES; i++) - { - UInt32 r = g_CrcTable[i - 256]; - g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8); - } - - #if CRC_NUM_TABLES < 4 - - g_CrcUpdate = CrcUpdateT1; - - #else - - #ifdef MY_CPU_LE - - g_CrcUpdateT4 = CrcUpdateT4; - g_CrcUpdate = CrcUpdateT4; - - #if CRC_NUM_TABLES >= 8 - g_CrcUpdateT8 = CrcUpdateT8; - - #ifdef MY_CPU_X86_OR_AMD64 - if (!CPU_Is_InOrder()) - g_CrcUpdate = CrcUpdateT8; - #endif - #endif - - #else - { - #ifndef MY_CPU_BE - UInt32 k = 0x01020304; - const Byte *p = (const Byte *)&k; - if (p[0] == 4 && p[1] == 3) - { - g_CrcUpdateT4 = CrcUpdateT4; - g_CrcUpdate = CrcUpdateT4; - #if CRC_NUM_TABLES >= 8 - g_CrcUpdateT8 = CrcUpdateT8; - // g_CrcUpdate = CrcUpdateT8; - #endif - } - else if (p[0] != 1 || p[1] != 2) - g_CrcUpdate = CrcUpdateT1; - else - #endif - { - for (i = 256 * CRC_NUM_TABLES - 1; i >= 256; i--) - { - UInt32 x = g_CrcTable[i - 256]; - g_CrcTable[i] = CRC_UINT32_SWAP(x); - } - g_CrcUpdateT4 = CrcUpdateT1_BeT4; - g_CrcUpdate = CrcUpdateT1_BeT4; - #if CRC_NUM_TABLES >= 8 - g_CrcUpdateT8 = CrcUpdateT1_BeT8; - // g_CrcUpdate = CrcUpdateT1_BeT8; - #endif - } - } - #endif - - #endif -} diff --git a/jan/src/dep/libs/lib7z/7zCrc.h b/jan/src/dep/libs/lib7z/7zCrc.h deleted file mode 100644 index 3b0459402..000000000 --- a/jan/src/dep/libs/lib7z/7zCrc.h +++ /dev/null @@ -1,25 +0,0 @@ -/* 7zCrc.h -- CRC32 calculation -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __7Z_CRC_H -#define __7Z_CRC_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -extern UInt32 g_CrcTable[]; - -/* Call CrcGenerateTable one time before other CRC functions */ -void MY_FAST_CALL CrcGenerateTable(void); - -#define CRC_INIT_VAL 0xFFFFFFFF -#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL) -#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) - -UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size); -UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/7zCrcOpt.c b/jan/src/dep/libs/lib7z/7zCrcOpt.c deleted file mode 100644 index 58628efe5..000000000 --- a/jan/src/dep/libs/lib7z/7zCrcOpt.c +++ /dev/null @@ -1,115 +0,0 @@ -/* 7zCrcOpt.c -- CRC32 calculation -2015-03-01 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "CpuArch.h" - -#ifndef MY_CPU_BE - -#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) - -UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table) -{ - const Byte *p = (const Byte *)data; - for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++) - v = CRC_UPDATE_BYTE_2(v, *p); - for (; size >= 4; size -= 4, p += 4) - { - v ^= *(const UInt32 *)p; - v = - table[0x300 + ((v ) & 0xFF)] - ^ table[0x200 + ((v >> 8) & 0xFF)] - ^ table[0x100 + ((v >> 16) & 0xFF)] - ^ table[0x000 + ((v >> 24))]; - } - for (; size > 0; size--, p++) - v = CRC_UPDATE_BYTE_2(v, *p); - return v; -} - -UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table) -{ - const Byte *p = (const Byte *)data; - for (; size > 0 && ((unsigned)(ptrdiff_t)p & 7) != 0; size--, p++) - v = CRC_UPDATE_BYTE_2(v, *p); - for (; size >= 8; size -= 8, p += 8) - { - UInt32 d; - v ^= *(const UInt32 *)p; - v = - table[0x700 + ((v ) & 0xFF)] - ^ table[0x600 + ((v >> 8) & 0xFF)] - ^ table[0x500 + ((v >> 16) & 0xFF)] - ^ table[0x400 + ((v >> 24))]; - d = *((const UInt32 *)p + 1); - v ^= - table[0x300 + ((d ) & 0xFF)] - ^ table[0x200 + ((d >> 8) & 0xFF)] - ^ table[0x100 + ((d >> 16) & 0xFF)] - ^ table[0x000 + ((d >> 24))]; - } - for (; size > 0; size--, p++) - v = CRC_UPDATE_BYTE_2(v, *p); - return v; -} - -#endif - - -#ifndef MY_CPU_LE - -#define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24)) - -#define CRC_UPDATE_BYTE_2_BE(crc, b) (table[(((crc) >> 24) ^ (b))] ^ ((crc) << 8)) - -UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table) -{ - const Byte *p = (const Byte *)data; - table += 0x100; - v = CRC_UINT32_SWAP(v); - for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++) - v = CRC_UPDATE_BYTE_2_BE(v, *p); - for (; size >= 4; size -= 4, p += 4) - { - v ^= *(const UInt32 *)p; - v = - table[0x000 + ((v ) & 0xFF)] - ^ table[0x100 + ((v >> 8) & 0xFF)] - ^ table[0x200 + ((v >> 16) & 0xFF)] - ^ table[0x300 + ((v >> 24))]; - } - for (; size > 0; size--, p++) - v = CRC_UPDATE_BYTE_2_BE(v, *p); - return CRC_UINT32_SWAP(v); -} - -UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table) -{ - const Byte *p = (const Byte *)data; - table += 0x100; - v = CRC_UINT32_SWAP(v); - for (; size > 0 && ((unsigned)(ptrdiff_t)p & 7) != 0; size--, p++) - v = CRC_UPDATE_BYTE_2_BE(v, *p); - for (; size >= 8; size -= 8, p += 8) - { - UInt32 d; - v ^= *(const UInt32 *)p; - v = - table[0x400 + ((v ) & 0xFF)] - ^ table[0x500 + ((v >> 8) & 0xFF)] - ^ table[0x600 + ((v >> 16) & 0xFF)] - ^ table[0x700 + ((v >> 24))]; - d = *((const UInt32 *)p + 1); - v ^= - table[0x000 + ((d ) & 0xFF)] - ^ table[0x100 + ((d >> 8) & 0xFF)] - ^ table[0x200 + ((d >> 16) & 0xFF)] - ^ table[0x300 + ((d >> 24))]; - } - for (; size > 0; size--, p++) - v = CRC_UPDATE_BYTE_2_BE(v, *p); - return CRC_UINT32_SWAP(v); -} - -#endif diff --git a/jan/src/dep/libs/lib7z/7zDec.c b/jan/src/dep/libs/lib7z/7zDec.c deleted file mode 100644 index e39b4ff12..000000000 --- a/jan/src/dep/libs/lib7z/7zDec.c +++ /dev/null @@ -1,591 +0,0 @@ -/* 7zDec.c -- Decoding from 7z folder -2015-11-18 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include - -/* #define _7ZIP_PPMD_SUPPPORT */ - -#include "7z.h" -#include "7zCrc.h" - -#include "Bcj2.h" -#include "Bra.h" -#include "CpuArch.h" -#include "Delta.h" -#include "LzmaDec.h" -#include "Lzma2Dec.h" -#ifdef _7ZIP_PPMD_SUPPPORT -#include "Ppmd7.h" -#endif - -#define k_Copy 0 -#define k_Delta 3 -#define k_LZMA2 0x21 -#define k_LZMA 0x30101 -#define k_BCJ 0x3030103 -#define k_BCJ2 0x303011B -#define k_PPC 0x3030205 -#define k_IA64 0x3030401 -#define k_ARM 0x3030501 -#define k_ARMT 0x3030701 -#define k_SPARC 0x3030805 - - -#ifdef _7ZIP_PPMD_SUPPPORT - -#define k_PPMD 0x30401 - -typedef struct -{ - IByteIn p; - const Byte *cur; - const Byte *end; - const Byte *begin; - UInt64 processed; - Bool extra; - SRes res; - ILookInStream *inStream; -} CByteInToLook; - -static Byte ReadByte(void *pp) -{ - CByteInToLook *p = (CByteInToLook *)pp; - if (p->cur != p->end) - return *p->cur++; - if (p->res == SZ_OK) - { - size_t size = p->cur - p->begin; - p->processed += size; - p->res = p->inStream->Skip(p->inStream, size); - size = (1 << 25); - p->res = p->inStream->Look(p->inStream, (const void **)&p->begin, &size); - p->cur = p->begin; - p->end = p->begin + size; - if (size != 0) - return *p->cur++;; - } - p->extra = True; - return 0; -} - -static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream, - Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain) -{ - CPpmd7 ppmd; - CByteInToLook s; - SRes res = SZ_OK; - - s.p.Read = ReadByte; - s.inStream = inStream; - s.begin = s.end = s.cur = NULL; - s.extra = False; - s.res = SZ_OK; - s.processed = 0; - - if (propsSize != 5) - return SZ_ERROR_UNSUPPORTED; - - { - unsigned order = props[0]; - UInt32 memSize = GetUi32(props + 1); - if (order < PPMD7_MIN_ORDER || - order > PPMD7_MAX_ORDER || - memSize < PPMD7_MIN_MEM_SIZE || - memSize > PPMD7_MAX_MEM_SIZE) - return SZ_ERROR_UNSUPPORTED; - Ppmd7_Construct(&ppmd); - if (!Ppmd7_Alloc(&ppmd, memSize, allocMain)) - return SZ_ERROR_MEM; - Ppmd7_Init(&ppmd, order); - } - { - CPpmd7z_RangeDec rc; - Ppmd7z_RangeDec_CreateVTable(&rc); - rc.Stream = &s.p; - if (!Ppmd7z_RangeDec_Init(&rc)) - res = SZ_ERROR_DATA; - else if (s.extra) - res = (s.res != SZ_OK ? s.res : SZ_ERROR_DATA); - else - { - SizeT i; - for (i = 0; i < outSize; i++) - { - int sym = Ppmd7_DecodeSymbol(&ppmd, &rc.p); - if (s.extra || sym < 0) - break; - outBuffer[i] = (Byte)sym; - } - if (i != outSize) - res = (s.res != SZ_OK ? s.res : SZ_ERROR_DATA); - else if (s.processed + (s.cur - s.begin) != inSize || !Ppmd7z_RangeDec_IsFinishedOK(&rc)) - res = SZ_ERROR_DATA; - } - } - Ppmd7_Free(&ppmd, allocMain); - return res; -} - -#endif - - -static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream, - Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain) -{ - CLzmaDec state; - SRes res = SZ_OK; - - LzmaDec_Construct(&state); - RINOK(LzmaDec_AllocateProbs(&state, props, propsSize, allocMain)); - state.dic = outBuffer; - state.dicBufSize = outSize; - LzmaDec_Init(&state); - - for (;;) - { - const void *inBuf = NULL; - size_t lookahead = (1 << 18); - if (lookahead > inSize) - lookahead = (size_t)inSize; - res = inStream->Look(inStream, &inBuf, &lookahead); - if (res != SZ_OK) - break; - - { - SizeT inProcessed = (SizeT)lookahead, dicPos = state.dicPos; - ELzmaStatus status; - res = LzmaDec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status); - lookahead -= inProcessed; - inSize -= inProcessed; - if (res != SZ_OK) - break; - - if (status == LZMA_STATUS_FINISHED_WITH_MARK) - { - if (outSize != state.dicPos || inSize != 0) - res = SZ_ERROR_DATA; - break; - } - - if (outSize == state.dicPos && inSize == 0 && status == LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK) - break; - - if (inProcessed == 0 && dicPos == state.dicPos) - { - res = SZ_ERROR_DATA; - break; - } - - res = inStream->Skip((void *)inStream, inProcessed); - if (res != SZ_OK) - break; - } - } - - LzmaDec_FreeProbs(&state, allocMain); - return res; -} - - -#ifndef _7Z_NO_METHOD_LZMA2 - -static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream, - Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain) -{ - CLzma2Dec state; - SRes res = SZ_OK; - - Lzma2Dec_Construct(&state); - if (propsSize != 1) - return SZ_ERROR_DATA; - RINOK(Lzma2Dec_AllocateProbs(&state, props[0], allocMain)); - state.decoder.dic = outBuffer; - state.decoder.dicBufSize = outSize; - Lzma2Dec_Init(&state); - - for (;;) - { - const void *inBuf = NULL; - size_t lookahead = (1 << 18); - if (lookahead > inSize) - lookahead = (size_t)inSize; - res = inStream->Look(inStream, &inBuf, &lookahead); - if (res != SZ_OK) - break; - - { - SizeT inProcessed = (SizeT)lookahead, dicPos = state.decoder.dicPos; - ELzmaStatus status; - res = Lzma2Dec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status); - lookahead -= inProcessed; - inSize -= inProcessed; - if (res != SZ_OK) - break; - - if (status == LZMA_STATUS_FINISHED_WITH_MARK) - { - if (outSize != state.decoder.dicPos || inSize != 0) - res = SZ_ERROR_DATA; - break; - } - - if (inProcessed == 0 && dicPos == state.decoder.dicPos) - { - res = SZ_ERROR_DATA; - break; - } - - res = inStream->Skip((void *)inStream, inProcessed); - if (res != SZ_OK) - break; - } - } - - Lzma2Dec_FreeProbs(&state, allocMain); - return res; -} - -#endif - - -static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer) -{ - while (inSize > 0) - { - const void *inBuf; - size_t curSize = (1 << 18); - if (curSize > inSize) - curSize = (size_t)inSize; - RINOK(inStream->Look(inStream, &inBuf, &curSize)); - if (curSize == 0) - return SZ_ERROR_INPUT_EOF; - memcpy(outBuffer, inBuf, curSize); - outBuffer += curSize; - inSize -= curSize; - RINOK(inStream->Skip((void *)inStream, curSize)); - } - return SZ_OK; -} - -static Bool IS_MAIN_METHOD(UInt32 m) -{ - switch (m) - { - case k_Copy: - case k_LZMA: - #ifndef _7Z_NO_METHOD_LZMA2 - case k_LZMA2: - #endif - #ifdef _7ZIP_PPMD_SUPPPORT - case k_PPMD: - #endif - return True; - } - return False; -} - -static Bool IS_SUPPORTED_CODER(const CSzCoderInfo *c) -{ - return - c->NumStreams == 1 - /* && c->MethodID <= (UInt32)0xFFFFFFFF */ - && IS_MAIN_METHOD((UInt32)c->MethodID); -} - -#define IS_BCJ2(c) ((c)->MethodID == k_BCJ2 && (c)->NumStreams == 4) - -static SRes CheckSupportedFolder(const CSzFolder *f) -{ - if (f->NumCoders < 1 || f->NumCoders > 4) - return SZ_ERROR_UNSUPPORTED; - if (!IS_SUPPORTED_CODER(&f->Coders[0])) - return SZ_ERROR_UNSUPPORTED; - if (f->NumCoders == 1) - { - if (f->NumPackStreams != 1 || f->PackStreams[0] != 0 || f->NumBonds != 0) - return SZ_ERROR_UNSUPPORTED; - return SZ_OK; - } - - - #ifndef _7Z_NO_METHODS_FILTERS - - if (f->NumCoders == 2) - { - const CSzCoderInfo *c = &f->Coders[1]; - if ( - /* c->MethodID > (UInt32)0xFFFFFFFF || */ - c->NumStreams != 1 - || f->NumPackStreams != 1 - || f->PackStreams[0] != 0 - || f->NumBonds != 1 - || f->Bonds[0].InIndex != 1 - || f->Bonds[0].OutIndex != 0) - return SZ_ERROR_UNSUPPORTED; - switch ((UInt32)c->MethodID) - { - case k_Delta: - case k_BCJ: - case k_PPC: - case k_IA64: - case k_SPARC: - case k_ARM: - case k_ARMT: - break; - default: - return SZ_ERROR_UNSUPPORTED; - } - return SZ_OK; - } - - #endif - - - if (f->NumCoders == 4) - { - if (!IS_SUPPORTED_CODER(&f->Coders[1]) - || !IS_SUPPORTED_CODER(&f->Coders[2]) - || !IS_BCJ2(&f->Coders[3])) - return SZ_ERROR_UNSUPPORTED; - if (f->NumPackStreams != 4 - || f->PackStreams[0] != 2 - || f->PackStreams[1] != 6 - || f->PackStreams[2] != 1 - || f->PackStreams[3] != 0 - || f->NumBonds != 3 - || f->Bonds[0].InIndex != 5 || f->Bonds[0].OutIndex != 0 - || f->Bonds[1].InIndex != 4 || f->Bonds[1].OutIndex != 1 - || f->Bonds[2].InIndex != 3 || f->Bonds[2].OutIndex != 2) - return SZ_ERROR_UNSUPPORTED; - return SZ_OK; - } - - return SZ_ERROR_UNSUPPORTED; -} - -#define CASE_BRA_CONV(isa) case k_ ## isa: isa ## _Convert(outBuffer, outSize, 0, 0); break; - -static SRes SzFolder_Decode2(const CSzFolder *folder, - const Byte *propsData, - const UInt64 *unpackSizes, - const UInt64 *packPositions, - ILookInStream *inStream, UInt64 startPos, - Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain, - Byte *tempBuf[]) -{ - UInt32 ci; - SizeT tempSizes[3] = { 0, 0, 0}; - SizeT tempSize3 = 0; - Byte *tempBuf3 = 0; - - RINOK(CheckSupportedFolder(folder)); - - for (ci = 0; ci < folder->NumCoders; ci++) - { - const CSzCoderInfo *coder = &folder->Coders[ci]; - - if (IS_MAIN_METHOD((UInt32)coder->MethodID)) - { - UInt32 si = 0; - UInt64 offset; - UInt64 inSize; - Byte *outBufCur = outBuffer; - SizeT outSizeCur = outSize; - if (folder->NumCoders == 4) - { - UInt32 indices[] = { 3, 2, 0 }; - UInt64 unpackSize = unpackSizes[ci]; - si = indices[ci]; - if (ci < 2) - { - Byte *temp; - outSizeCur = (SizeT)unpackSize; - if (outSizeCur != unpackSize) - return SZ_ERROR_MEM; - temp = (Byte *)IAlloc_Alloc(allocMain, outSizeCur); - if (!temp && outSizeCur != 0) - return SZ_ERROR_MEM; - outBufCur = tempBuf[1 - ci] = temp; - tempSizes[1 - ci] = outSizeCur; - } - else if (ci == 2) - { - if (unpackSize > outSize) /* check it */ - return SZ_ERROR_PARAM; - tempBuf3 = outBufCur = outBuffer + (outSize - (size_t)unpackSize); - tempSize3 = outSizeCur = (SizeT)unpackSize; - } - else - return SZ_ERROR_UNSUPPORTED; - } - offset = packPositions[si]; - inSize = packPositions[si + 1] - offset; - RINOK(LookInStream_SeekTo(inStream, startPos + offset)); - - if (coder->MethodID == k_Copy) - { - if (inSize != outSizeCur) /* check it */ - return SZ_ERROR_DATA; - RINOK(SzDecodeCopy(inSize, inStream, outBufCur)); - } - else if (coder->MethodID == k_LZMA) - { - RINOK(SzDecodeLzma(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain)); - } - #ifndef _7Z_NO_METHOD_LZMA2 - else if (coder->MethodID == k_LZMA2) - { - RINOK(SzDecodeLzma2(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain)); - } - #endif - #ifdef _7ZIP_PPMD_SUPPPORT - else if (coder->MethodID == k_PPMD) - { - RINOK(SzDecodePpmd(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain)); - } - #endif - else - return SZ_ERROR_UNSUPPORTED; - } - else if (coder->MethodID == k_BCJ2) - { - UInt64 offset = packPositions[1]; - UInt64 s3Size = packPositions[2] - offset; - - if (ci != 3) - return SZ_ERROR_UNSUPPORTED; - - tempSizes[2] = (SizeT)s3Size; - if (tempSizes[2] != s3Size) - return SZ_ERROR_MEM; - tempBuf[2] = (Byte *)IAlloc_Alloc(allocMain, tempSizes[2]); - if (!tempBuf[2] && tempSizes[2] != 0) - return SZ_ERROR_MEM; - - RINOK(LookInStream_SeekTo(inStream, startPos + offset)); - RINOK(SzDecodeCopy(s3Size, inStream, tempBuf[2])); - - if ((tempSizes[0] & 3) != 0 || - (tempSizes[1] & 3) != 0 || - tempSize3 + tempSizes[0] + tempSizes[1] != outSize) - return SZ_ERROR_DATA; - - { - CBcj2Dec p; - - p.bufs[0] = tempBuf3; p.lims[0] = tempBuf3 + tempSize3; - p.bufs[1] = tempBuf[0]; p.lims[1] = tempBuf[0] + tempSizes[0]; - p.bufs[2] = tempBuf[1]; p.lims[2] = tempBuf[1] + tempSizes[1]; - p.bufs[3] = tempBuf[2]; p.lims[3] = tempBuf[2] + tempSizes[2]; - - p.dest = outBuffer; - p.destLim = outBuffer + outSize; - - Bcj2Dec_Init(&p); - RINOK(Bcj2Dec_Decode(&p)); - - { - unsigned i; - for (i = 0; i < 4; i++) - if (p.bufs[i] != p.lims[i]) - return SZ_ERROR_DATA; - - if (!Bcj2Dec_IsFinished(&p)) - return SZ_ERROR_DATA; - - if (p.dest != p.destLim - || p.state != BCJ2_STREAM_MAIN) - return SZ_ERROR_DATA; - } - } - } - #ifndef _7Z_NO_METHODS_FILTERS - else if (ci == 1) - { - if (coder->MethodID == k_Delta) - { - if (coder->PropsSize != 1) - return SZ_ERROR_UNSUPPORTED; - { - Byte state[DELTA_STATE_SIZE]; - Delta_Init(state); - Delta_Decode(state, (unsigned)(propsData[coder->PropsOffset]) + 1, outBuffer, outSize); - } - } - else - { - if (coder->PropsSize != 0) - return SZ_ERROR_UNSUPPORTED; - switch (coder->MethodID) - { - case k_BCJ: - { - UInt32 state; - x86_Convert_Init(state); - x86_Convert(outBuffer, outSize, 0, &state, 0); - break; - } - CASE_BRA_CONV(PPC) - CASE_BRA_CONV(IA64) - CASE_BRA_CONV(SPARC) - CASE_BRA_CONV(ARM) - CASE_BRA_CONV(ARMT) - default: - return SZ_ERROR_UNSUPPORTED; - } - } - } - #endif - else - return SZ_ERROR_UNSUPPORTED; - } - - return SZ_OK; -} - - -SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex, - ILookInStream *inStream, UInt64 startPos, - Byte *outBuffer, size_t outSize, - ISzAlloc *allocMain) -{ - SRes res; - CSzFolder folder; - CSzData sd; - - const Byte *data = p->CodersData + p->FoCodersOffsets[folderIndex]; - sd.Data = data; - sd.Size = p->FoCodersOffsets[folderIndex + 1] - p->FoCodersOffsets[folderIndex]; - - res = SzGetNextFolderItem(&folder, &sd); - - if (res != SZ_OK) - return res; - - if (sd.Size != 0 - || folder.UnpackStream != p->FoToMainUnpackSizeIndex[folderIndex] - || outSize != SzAr_GetFolderUnpackSize(p, folderIndex)) - return SZ_ERROR_FAIL; - { - unsigned i; - Byte *tempBuf[3] = { 0, 0, 0}; - - res = SzFolder_Decode2(&folder, data, - &p->CoderUnpackSizes[p->FoToCoderUnpackSizes[folderIndex]], - p->PackPositions + p->FoStartPackStreamIndex[folderIndex], - inStream, startPos, - outBuffer, (SizeT)outSize, allocMain, tempBuf); - - for (i = 0; i < 3; i++) - IAlloc_Free(allocMain, tempBuf[i]); - - if (res == SZ_OK) - if (SzBitWithVals_Check(&p->FolderCRCs, folderIndex)) - if (CrcCalc(outBuffer, outSize) != p->FolderCRCs.Vals[folderIndex]) - res = SZ_ERROR_CRC; - - return res; - } -} diff --git a/jan/src/dep/libs/lib7z/7zFile.c b/jan/src/dep/libs/lib7z/7zFile.c deleted file mode 100644 index 98fe7164f..000000000 --- a/jan/src/dep/libs/lib7z/7zFile.c +++ /dev/null @@ -1,286 +0,0 @@ -/* 7zFile.c -- File IO -2009-11-24 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "7zFile.h" - -#ifndef USE_WINDOWS_FILE - -#ifndef UNDER_CE -#include -#endif - -#else - -/* - ReadFile and WriteFile functions in Windows have BUG: - If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1) - from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES - (Insufficient system resources exist to complete the requested service). - Probably in some version of Windows there are problems with other sizes: - for 32 MB (maybe also for 16 MB). - And message can be "Network connection was lost" -*/ - -#define kChunkSizeMax (1 << 22) - -#endif - -void File_Construct(CSzFile *p) -{ - #ifdef USE_WINDOWS_FILE - p->handle = INVALID_HANDLE_VALUE; - #else - p->file = NULL; - #endif -} - -#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE) -static WRes File_Open(CSzFile *p, const char *name, int writeMode) -{ - #ifdef USE_WINDOWS_FILE - p->handle = CreateFileA(name, - writeMode ? GENERIC_WRITE : GENERIC_READ, - FILE_SHARE_READ, NULL, - writeMode ? CREATE_ALWAYS : OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError(); - #else - p->file = fopen(name, writeMode ? "wb+" : "rb"); - return (p->file != 0) ? 0 : - #ifdef UNDER_CE - 2; /* ENOENT */ - #else - errno; - #endif - #endif -} - -WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); } -WRes OutFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 1); } -#endif - -#ifdef USE_WINDOWS_FILE -static WRes File_OpenW(CSzFile *p, const WCHAR *name, int writeMode) -{ - p->handle = CreateFileW(name, - writeMode ? GENERIC_WRITE : GENERIC_READ, - FILE_SHARE_READ, NULL, - writeMode ? CREATE_ALWAYS : OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError(); -} -WRes InFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 0); } -WRes OutFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 1); } -#endif - -WRes File_Close(CSzFile *p) -{ - #ifdef USE_WINDOWS_FILE - if (p->handle != INVALID_HANDLE_VALUE) - { - if (!CloseHandle(p->handle)) - return GetLastError(); - p->handle = INVALID_HANDLE_VALUE; - } - #else - if (p->file != NULL) - { - int res = fclose(p->file); - if (res != 0) - return res; - p->file = NULL; - } - #endif - return 0; -} - -WRes File_Read(CSzFile *p, void *data, size_t *size) -{ - size_t originalSize = *size; - if (originalSize == 0) - return 0; - - #ifdef USE_WINDOWS_FILE - - *size = 0; - do - { - DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize; - DWORD processed = 0; - BOOL res = ReadFile(p->handle, data, curSize, &processed, NULL); - data = (void *)((Byte *)data + processed); - originalSize -= processed; - *size += processed; - if (!res) - return GetLastError(); - if (processed == 0) - break; - } - while (originalSize > 0); - return 0; - - #else - - *size = fread(data, 1, originalSize, p->file); - if (*size == originalSize) - return 0; - return ferror(p->file); - - #endif -} - -WRes File_Write(CSzFile *p, const void *data, size_t *size) -{ - size_t originalSize = *size; - if (originalSize == 0) - return 0; - - #ifdef USE_WINDOWS_FILE - - *size = 0; - do - { - DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize; - DWORD processed = 0; - BOOL res = WriteFile(p->handle, data, curSize, &processed, NULL); - data = (void *)((Byte *)data + processed); - originalSize -= processed; - *size += processed; - if (!res) - return GetLastError(); - if (processed == 0) - break; - } - while (originalSize > 0); - return 0; - - #else - - *size = fwrite(data, 1, originalSize, p->file); - if (*size == originalSize) - return 0; - return ferror(p->file); - - #endif -} - -WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin) -{ - #ifdef USE_WINDOWS_FILE - - LARGE_INTEGER value; - DWORD moveMethod; - value.LowPart = (DWORD)*pos; - value.HighPart = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */ - switch (origin) - { - case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break; - case SZ_SEEK_CUR: moveMethod = FILE_CURRENT; break; - case SZ_SEEK_END: moveMethod = FILE_END; break; - default: return ERROR_INVALID_PARAMETER; - } - value.LowPart = SetFilePointer(p->handle, value.LowPart, &value.HighPart, moveMethod); - if (value.LowPart == 0xFFFFFFFF) - { - WRes res = GetLastError(); - if (res != NO_ERROR) - return res; - } - *pos = ((Int64)value.HighPart << 32) | value.LowPart; - return 0; - - #else - - int moveMethod; - int res; - switch (origin) - { - case SZ_SEEK_SET: moveMethod = SEEK_SET; break; - case SZ_SEEK_CUR: moveMethod = SEEK_CUR; break; - case SZ_SEEK_END: moveMethod = SEEK_END; break; - default: return 1; - } - res = fseek(p->file, (long)*pos, moveMethod); - *pos = ftell(p->file); - return res; - - #endif -} - -WRes File_GetLength(CSzFile *p, UInt64 *length) -{ - #ifdef USE_WINDOWS_FILE - - DWORD sizeHigh; - DWORD sizeLow = GetFileSize(p->handle, &sizeHigh); - if (sizeLow == 0xFFFFFFFF) - { - DWORD res = GetLastError(); - if (res != NO_ERROR) - return res; - } - *length = (((UInt64)sizeHigh) << 32) + sizeLow; - return 0; - - #else - - long pos = ftell(p->file); - int res = fseek(p->file, 0, SEEK_END); - *length = ftell(p->file); - fseek(p->file, pos, SEEK_SET); - return res; - - #endif -} - - -/* ---------- FileSeqInStream ---------- */ - -static SRes FileSeqInStream_Read(void *pp, void *buf, size_t *size) -{ - CFileSeqInStream *p = (CFileSeqInStream *)pp; - return File_Read(&p->file, buf, size) == 0 ? SZ_OK : SZ_ERROR_READ; -} - -void FileSeqInStream_CreateVTable(CFileSeqInStream *p) -{ - p->s.Read = FileSeqInStream_Read; -} - - -/* ---------- FileInStream ---------- */ - -static SRes FileInStream_Read(void *pp, void *buf, size_t *size) -{ - CFileInStream *p = (CFileInStream *)pp; - return (File_Read(&p->file, buf, size) == 0) ? SZ_OK : SZ_ERROR_READ; -} - -static SRes FileInStream_Seek(void *pp, Int64 *pos, ESzSeek origin) -{ - CFileInStream *p = (CFileInStream *)pp; - return File_Seek(&p->file, pos, origin); -} - -void FileInStream_CreateVTable(CFileInStream *p) -{ - p->s.Read = FileInStream_Read; - p->s.Seek = FileInStream_Seek; -} - - -/* ---------- FileOutStream ---------- */ - -static size_t FileOutStream_Write(void *pp, const void *data, size_t size) -{ - CFileOutStream *p = (CFileOutStream *)pp; - File_Write(&p->file, data, &size); - return size; -} - -void FileOutStream_CreateVTable(CFileOutStream *p) -{ - p->s.Write = FileOutStream_Write; -} diff --git a/jan/src/dep/libs/lib7z/7zFile.h b/jan/src/dep/libs/lib7z/7zFile.h deleted file mode 100644 index d62a19260..000000000 --- a/jan/src/dep/libs/lib7z/7zFile.h +++ /dev/null @@ -1,83 +0,0 @@ -/* 7zFile.h -- File IO -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __7Z_FILE_H -#define __7Z_FILE_H - -#ifdef _WIN32 -#define USE_WINDOWS_FILE -#endif - -#ifdef USE_WINDOWS_FILE -#include -#else -#include -#endif - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -/* ---------- File ---------- */ - -typedef struct -{ - #ifdef USE_WINDOWS_FILE - HANDLE handle; - #else - FILE *file; - #endif -} CSzFile; - -void File_Construct(CSzFile *p); -#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE) -WRes InFile_Open(CSzFile *p, const char *name); -WRes OutFile_Open(CSzFile *p, const char *name); -#endif -#ifdef USE_WINDOWS_FILE -WRes InFile_OpenW(CSzFile *p, const WCHAR *name); -WRes OutFile_OpenW(CSzFile *p, const WCHAR *name); -#endif -WRes File_Close(CSzFile *p); - -/* reads max(*size, remain file's size) bytes */ -WRes File_Read(CSzFile *p, void *data, size_t *size); - -/* writes *size bytes */ -WRes File_Write(CSzFile *p, const void *data, size_t *size); - -WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin); -WRes File_GetLength(CSzFile *p, UInt64 *length); - - -/* ---------- FileInStream ---------- */ - -typedef struct -{ - ISeqInStream s; - CSzFile file; -} CFileSeqInStream; - -void FileSeqInStream_CreateVTable(CFileSeqInStream *p); - - -typedef struct -{ - ISeekInStream s; - CSzFile file; -} CFileInStream; - -void FileInStream_CreateVTable(CFileInStream *p); - - -typedef struct -{ - ISeqOutStream s; - CSzFile file; -} CFileOutStream; - -void FileOutStream_CreateVTable(CFileOutStream *p); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/7zStream.c b/jan/src/dep/libs/lib7z/7zStream.c deleted file mode 100644 index 5a92d532c..000000000 --- a/jan/src/dep/libs/lib7z/7zStream.c +++ /dev/null @@ -1,171 +0,0 @@ -/* 7zStream.c -- 7z Stream functions -2013-11-12 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include - -#include "7zTypes.h" - -SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType) -{ - while (size != 0) - { - size_t processed = size; - RINOK(stream->Read(stream, buf, &processed)); - if (processed == 0) - return errorType; - buf = (void *)((Byte *)buf + processed); - size -= processed; - } - return SZ_OK; -} - -SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size) -{ - return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF); -} - -SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf) -{ - size_t processed = 1; - RINOK(stream->Read(stream, buf, &processed)); - return (processed == 1) ? SZ_OK : SZ_ERROR_INPUT_EOF; -} - -SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset) -{ - Int64 t = offset; - return stream->Seek(stream, &t, SZ_SEEK_SET); -} - -SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size) -{ - const void *lookBuf; - if (*size == 0) - return SZ_OK; - RINOK(stream->Look(stream, &lookBuf, size)); - memcpy(buf, lookBuf, *size); - return stream->Skip(stream, *size); -} - -SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType) -{ - while (size != 0) - { - size_t processed = size; - RINOK(stream->Read(stream, buf, &processed)); - if (processed == 0) - return errorType; - buf = (void *)((Byte *)buf + processed); - size -= processed; - } - return SZ_OK; -} - -SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size) -{ - return LookInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF); -} - -static SRes LookToRead_Look_Lookahead(void *pp, const void **buf, size_t *size) -{ - SRes res = SZ_OK; - CLookToRead *p = (CLookToRead *)pp; - size_t size2 = p->size - p->pos; - if (size2 == 0 && *size > 0) - { - p->pos = 0; - size2 = LookToRead_BUF_SIZE; - res = p->realStream->Read(p->realStream, p->buf, &size2); - p->size = size2; - } - if (size2 < *size) - *size = size2; - *buf = p->buf + p->pos; - return res; -} - -static SRes LookToRead_Look_Exact(void *pp, const void **buf, size_t *size) -{ - SRes res = SZ_OK; - CLookToRead *p = (CLookToRead *)pp; - size_t size2 = p->size - p->pos; - if (size2 == 0 && *size > 0) - { - p->pos = 0; - if (*size > LookToRead_BUF_SIZE) - *size = LookToRead_BUF_SIZE; - res = p->realStream->Read(p->realStream, p->buf, size); - size2 = p->size = *size; - } - if (size2 < *size) - *size = size2; - *buf = p->buf + p->pos; - return res; -} - -static SRes LookToRead_Skip(void *pp, size_t offset) -{ - CLookToRead *p = (CLookToRead *)pp; - p->pos += offset; - return SZ_OK; -} - -static SRes LookToRead_Read(void *pp, void *buf, size_t *size) -{ - CLookToRead *p = (CLookToRead *)pp; - size_t rem = p->size - p->pos; - if (rem == 0) - return p->realStream->Read(p->realStream, buf, size); - if (rem > *size) - rem = *size; - memcpy(buf, p->buf + p->pos, rem); - p->pos += rem; - *size = rem; - return SZ_OK; -} - -static SRes LookToRead_Seek(void *pp, Int64 *pos, ESzSeek origin) -{ - CLookToRead *p = (CLookToRead *)pp; - p->pos = p->size = 0; - return p->realStream->Seek(p->realStream, pos, origin); -} - -void LookToRead_CreateVTable(CLookToRead *p, int lookahead) -{ - p->s.Look = lookahead ? - LookToRead_Look_Lookahead : - LookToRead_Look_Exact; - p->s.Skip = LookToRead_Skip; - p->s.Read = LookToRead_Read; - p->s.Seek = LookToRead_Seek; -} - -void LookToRead_Init(CLookToRead *p) -{ - p->pos = p->size = 0; -} - -static SRes SecToLook_Read(void *pp, void *buf, size_t *size) -{ - CSecToLook *p = (CSecToLook *)pp; - return LookInStream_LookRead(p->realStream, buf, size); -} - -void SecToLook_CreateVTable(CSecToLook *p) -{ - p->s.Read = SecToLook_Read; -} - -static SRes SecToRead_Read(void *pp, void *buf, size_t *size) -{ - CSecToRead *p = (CSecToRead *)pp; - return p->realStream->Read(p->realStream, buf, size); -} - -void SecToRead_CreateVTable(CSecToRead *p) -{ - p->s.Read = SecToRead_Read; -} diff --git a/jan/src/dep/libs/lib7z/7zTypes.h b/jan/src/dep/libs/lib7z/7zTypes.h deleted file mode 100644 index 903047b10..000000000 --- a/jan/src/dep/libs/lib7z/7zTypes.h +++ /dev/null @@ -1,256 +0,0 @@ -/* 7zTypes.h -- Basic types -2013-11-12 : Igor Pavlov : Public domain */ - -#ifndef __7Z_TYPES_H -#define __7Z_TYPES_H - -#ifdef _WIN32 -/* #include */ -#endif - -#include - -#ifndef EXTERN_C_BEGIN -#ifdef __cplusplus -#define EXTERN_C_BEGIN extern "C" { -#define EXTERN_C_END } -#else -#define EXTERN_C_BEGIN -#define EXTERN_C_END -#endif -#endif - -EXTERN_C_BEGIN - -#define SZ_OK 0 - -#define SZ_ERROR_DATA 1 -#define SZ_ERROR_MEM 2 -#define SZ_ERROR_CRC 3 -#define SZ_ERROR_UNSUPPORTED 4 -#define SZ_ERROR_PARAM 5 -#define SZ_ERROR_INPUT_EOF 6 -#define SZ_ERROR_OUTPUT_EOF 7 -#define SZ_ERROR_READ 8 -#define SZ_ERROR_WRITE 9 -#define SZ_ERROR_PROGRESS 10 -#define SZ_ERROR_FAIL 11 -#define SZ_ERROR_THREAD 12 - -#define SZ_ERROR_ARCHIVE 16 -#define SZ_ERROR_NO_ARCHIVE 17 - -typedef int SRes; - -#ifdef _WIN32 -/* typedef DWORD WRes; */ -typedef unsigned WRes; -#else -typedef int WRes; -#endif - -#ifndef RINOK -#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } -#endif - -typedef unsigned char Byte; -typedef short Int16; -typedef unsigned short UInt16; - -#ifdef _LZMA_UINT32_IS_ULONG -typedef long Int32; -typedef unsigned long UInt32; -#else -typedef int Int32; -typedef unsigned int UInt32; -#endif - -#ifdef _SZ_NO_INT_64 - -/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers. - NOTES: Some code will work incorrectly in that case! */ - -typedef long Int64; -typedef unsigned long UInt64; - -#else - -#if defined(_MSC_VER) || defined(__BORLANDC__) -typedef __int64 Int64; -typedef unsigned __int64 UInt64; -#define UINT64_CONST(n) n -#else -typedef long long int Int64; -typedef unsigned long long int UInt64; -#define UINT64_CONST(n) n ## ULL -#endif - -#endif - -#ifdef _LZMA_NO_SYSTEM_SIZE_T -typedef UInt32 SizeT; -#else -typedef size_t SizeT; -#endif - -typedef int Bool; -#define True 1 -#define False 0 - - -#ifdef _WIN32 -#define MY_STD_CALL __stdcall -#else -#define MY_STD_CALL -#endif - -#ifdef _MSC_VER - -#if _MSC_VER >= 1300 -#define MY_NO_INLINE __declspec(noinline) -#else -#define MY_NO_INLINE -#endif - -#define MY_CDECL __cdecl -#define MY_FAST_CALL __fastcall - -#else - -#define MY_NO_INLINE -#define MY_CDECL -#define MY_FAST_CALL - -#endif - - -/* The following interfaces use first parameter as pointer to structure */ - -typedef struct -{ - Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */ -} IByteIn; - -typedef struct -{ - void (*Write)(void *p, Byte b); -} IByteOut; - -typedef struct -{ - SRes (*Read)(void *p, void *buf, size_t *size); - /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. - (output(*size) < input(*size)) is allowed */ -} ISeqInStream; - -/* it can return SZ_ERROR_INPUT_EOF */ -SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size); -SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType); -SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf); - -typedef struct -{ - size_t (*Write)(void *p, const void *buf, size_t size); - /* Returns: result - the number of actually written bytes. - (result < size) means error */ -} ISeqOutStream; - -typedef enum -{ - SZ_SEEK_SET = 0, - SZ_SEEK_CUR = 1, - SZ_SEEK_END = 2 -} ESzSeek; - -typedef struct -{ - SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */ - SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); -} ISeekInStream; - -typedef struct -{ - SRes (*Look)(void *p, const void **buf, size_t *size); - /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. - (output(*size) > input(*size)) is not allowed - (output(*size) < input(*size)) is allowed */ - SRes (*Skip)(void *p, size_t offset); - /* offset must be <= output(*size) of Look */ - - SRes (*Read)(void *p, void *buf, size_t *size); - /* reads directly (without buffer). It's same as ISeqInStream::Read */ - SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); -} ILookInStream; - -SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size); -SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset); - -/* reads via ILookInStream::Read */ -SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType); -SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size); - -#define LookToRead_BUF_SIZE (1 << 14) - -typedef struct -{ - ILookInStream s; - ISeekInStream *realStream; - size_t pos; - size_t size; - Byte buf[LookToRead_BUF_SIZE]; -} CLookToRead; - -void LookToRead_CreateVTable(CLookToRead *p, int lookahead); -void LookToRead_Init(CLookToRead *p); - -typedef struct -{ - ISeqInStream s; - ILookInStream *realStream; -} CSecToLook; - -void SecToLook_CreateVTable(CSecToLook *p); - -typedef struct -{ - ISeqInStream s; - ILookInStream *realStream; -} CSecToRead; - -void SecToRead_CreateVTable(CSecToRead *p); - -typedef struct -{ - SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); - /* Returns: result. (result != SZ_OK) means break. - Value (UInt64)(Int64)-1 for size means unknown value. */ -} ICompressProgress; - -typedef struct -{ - void *(*Alloc)(void *p, size_t size); - void (*Free)(void *p, void *address); /* address can be 0 */ -} ISzAlloc; - -#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) -#define IAlloc_Free(p, a) (p)->Free((p), a) - -#ifdef _WIN32 - -#define CHAR_PATH_SEPARATOR '\\' -#define WCHAR_PATH_SEPARATOR L'\\' -#define STRING_PATH_SEPARATOR "\\" -#define WSTRING_PATH_SEPARATOR L"\\" - -#else - -#define CHAR_PATH_SEPARATOR '/' -#define WCHAR_PATH_SEPARATOR L'/' -#define STRING_PATH_SEPARATOR "/" -#define WSTRING_PATH_SEPARATOR L"/" - -#endif - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/7zVersion.h b/jan/src/dep/libs/lib7z/7zVersion.h deleted file mode 100644 index acb67a94e..000000000 --- a/jan/src/dep/libs/lib7z/7zVersion.h +++ /dev/null @@ -1,19 +0,0 @@ -#define MY_VER_MAJOR 16 -#define MY_VER_MINOR 04 -#define MY_VER_BUILD 0 -#define MY_VERSION_NUMBERS "16.04" -#define MY_VERSION "16.04" -#define MY_DATE "2016-10-04" -#undef MY_COPYRIGHT -#undef MY_VERSION_COPYRIGHT_DATE -#define MY_AUTHOR_NAME "Igor Pavlov" -#define MY_COPYRIGHT_PD "Igor Pavlov : Public domain" -#define MY_COPYRIGHT_CR "Copyright (c) 1999-2016 Igor Pavlov" - -#ifdef USE_COPYRIGHT_CR - #define MY_COPYRIGHT MY_COPYRIGHT_CR -#else - #define MY_COPYRIGHT MY_COPYRIGHT_PD -#endif - -#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " : " MY_COPYRIGHT " : " MY_DATE diff --git a/jan/src/dep/libs/lib7z/7zVersion.rc b/jan/src/dep/libs/lib7z/7zVersion.rc deleted file mode 100644 index 6ed26de74..000000000 --- a/jan/src/dep/libs/lib7z/7zVersion.rc +++ /dev/null @@ -1,55 +0,0 @@ -#define MY_VS_FFI_FILEFLAGSMASK 0x0000003FL -#define MY_VOS_NT_WINDOWS32 0x00040004L -#define MY_VOS_CE_WINDOWS32 0x00050004L - -#define MY_VFT_APP 0x00000001L -#define MY_VFT_DLL 0x00000002L - -// #include - -#ifndef MY_VERSION -#include "7zVersion.h" -#endif - -#define MY_VER MY_VER_MAJOR,MY_VER_MINOR,MY_VER_BUILD,0 - -#ifdef DEBUG -#define DBG_FL VS_FF_DEBUG -#else -#define DBG_FL 0 -#endif - -#define MY_VERSION_INFO(fileType, descr, intName, origName) \ -LANGUAGE 9, 1 \ -1 VERSIONINFO \ - FILEVERSION MY_VER \ - PRODUCTVERSION MY_VER \ - FILEFLAGSMASK MY_VS_FFI_FILEFLAGSMASK \ - FILEFLAGS DBG_FL \ - FILEOS MY_VOS_NT_WINDOWS32 \ - FILETYPE fileType \ - FILESUBTYPE 0x0L \ -BEGIN \ - BLOCK "StringFileInfo" \ - BEGIN \ - BLOCK "040904b0" \ - BEGIN \ - VALUE "CompanyName", "Igor Pavlov" \ - VALUE "FileDescription", descr \ - VALUE "FileVersion", MY_VERSION \ - VALUE "InternalName", intName \ - VALUE "LegalCopyright", MY_COPYRIGHT \ - VALUE "OriginalFilename", origName \ - VALUE "ProductName", "7-Zip" \ - VALUE "ProductVersion", MY_VERSION \ - END \ - END \ - BLOCK "VarFileInfo" \ - BEGIN \ - VALUE "Translation", 0x409, 1200 \ - END \ -END - -#define MY_VERSION_INFO_APP(descr, intName) MY_VERSION_INFO(MY_VFT_APP, descr, intName, intName ".exe") - -#define MY_VERSION_INFO_DLL(descr, intName) MY_VERSION_INFO(MY_VFT_DLL, descr, intName, intName ".dll") diff --git a/jan/src/dep/libs/lib7z/Aes.c b/jan/src/dep/libs/lib7z/Aes.c deleted file mode 100644 index 8e658e751..000000000 --- a/jan/src/dep/libs/lib7z/Aes.c +++ /dev/null @@ -1,295 +0,0 @@ -/* Aes.c -- AES encryption / decryption -2016-05-21 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "Aes.h" -#include "CpuArch.h" - -static UInt32 T[256 * 4]; -static const Byte Sbox[256] = { - 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, - 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, - 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, - 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, - 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, - 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, - 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, - 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, - 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, - 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, - 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, - 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, - 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, - 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, - 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16}; - -void MY_FAST_CALL AesCbc_Encode(UInt32 *ivAes, Byte *data, size_t numBlocks); -void MY_FAST_CALL AesCbc_Decode(UInt32 *ivAes, Byte *data, size_t numBlocks); -void MY_FAST_CALL AesCtr_Code(UInt32 *ivAes, Byte *data, size_t numBlocks); - -void MY_FAST_CALL AesCbc_Encode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks); -void MY_FAST_CALL AesCbc_Decode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks); -void MY_FAST_CALL AesCtr_Code_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks); - -AES_CODE_FUNC g_AesCbc_Encode; -AES_CODE_FUNC g_AesCbc_Decode; -AES_CODE_FUNC g_AesCtr_Code; - -static UInt32 D[256 * 4]; -static Byte InvS[256]; - -static const Byte Rcon[11] = { 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36 }; - -#define xtime(x) ((((x) << 1) ^ (((x) & 0x80) != 0 ? 0x1B : 0)) & 0xFF) - -#define Ui32(a0, a1, a2, a3) ((UInt32)(a0) | ((UInt32)(a1) << 8) | ((UInt32)(a2) << 16) | ((UInt32)(a3) << 24)) - -#define gb0(x) ( (x) & 0xFF) -#define gb1(x) (((x) >> ( 8)) & 0xFF) -#define gb2(x) (((x) >> (16)) & 0xFF) -#define gb3(x) (((x) >> (24)) & 0xFF) - -void AesGenTables(void) -{ - unsigned i; - for (i = 0; i < 256; i++) - InvS[Sbox[i]] = (Byte)i; - - for (i = 0; i < 256; i++) - { - { - UInt32 a1 = Sbox[i]; - UInt32 a2 = xtime(a1); - UInt32 a3 = a2 ^ a1; - T[ i] = Ui32(a2, a1, a1, a3); - T[0x100 + i] = Ui32(a3, a2, a1, a1); - T[0x200 + i] = Ui32(a1, a3, a2, a1); - T[0x300 + i] = Ui32(a1, a1, a3, a2); - } - { - UInt32 a1 = InvS[i]; - UInt32 a2 = xtime(a1); - UInt32 a4 = xtime(a2); - UInt32 a8 = xtime(a4); - UInt32 a9 = a8 ^ a1; - UInt32 aB = a8 ^ a2 ^ a1; - UInt32 aD = a8 ^ a4 ^ a1; - UInt32 aE = a8 ^ a4 ^ a2; - D[ i] = Ui32(aE, a9, aD, aB); - D[0x100 + i] = Ui32(aB, aE, a9, aD); - D[0x200 + i] = Ui32(aD, aB, aE, a9); - D[0x300 + i] = Ui32(a9, aD, aB, aE); - } - } - - g_AesCbc_Encode = AesCbc_Encode; - g_AesCbc_Decode = AesCbc_Decode; - g_AesCtr_Code = AesCtr_Code; - - #ifdef MY_CPU_X86_OR_AMD64 - if (CPU_Is_Aes_Supported()) - { - g_AesCbc_Encode = AesCbc_Encode_Intel; - g_AesCbc_Decode = AesCbc_Decode_Intel; - g_AesCtr_Code = AesCtr_Code_Intel; - } - #endif -} - - -#define HT(i, x, s) (T + (x << 8))[gb ## x(s[(i + x) & 3])] - -#define HT4(m, i, s, p) m[i] = \ - HT(i, 0, s) ^ \ - HT(i, 1, s) ^ \ - HT(i, 2, s) ^ \ - HT(i, 3, s) ^ w[p + i] - -#define HT16(m, s, p) \ - HT4(m, 0, s, p); \ - HT4(m, 1, s, p); \ - HT4(m, 2, s, p); \ - HT4(m, 3, s, p); \ - -#define FT(i, x) Sbox[gb ## x(m[(i + x) & 3])] -#define FT4(i) dest[i] = Ui32(FT(i, 0), FT(i, 1), FT(i, 2), FT(i, 3)) ^ w[i]; - - -#define HD(i, x, s) (D + (x << 8))[gb ## x(s[(i - x) & 3])] - -#define HD4(m, i, s, p) m[i] = \ - HD(i, 0, s) ^ \ - HD(i, 1, s) ^ \ - HD(i, 2, s) ^ \ - HD(i, 3, s) ^ w[p + i]; - -#define HD16(m, s, p) \ - HD4(m, 0, s, p); \ - HD4(m, 1, s, p); \ - HD4(m, 2, s, p); \ - HD4(m, 3, s, p); \ - -#define FD(i, x) InvS[gb ## x(m[(i - x) & 3])] -#define FD4(i) dest[i] = Ui32(FD(i, 0), FD(i, 1), FD(i, 2), FD(i, 3)) ^ w[i]; - -void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *w, const Byte *key, unsigned keySize) -{ - unsigned i, wSize; - wSize = keySize + 28; - keySize /= 4; - w[0] = ((UInt32)keySize / 2) + 3; - w += 4; - - for (i = 0; i < keySize; i++, key += 4) - w[i] = GetUi32(key); - - for (; i < wSize; i++) - { - UInt32 t = w[i - 1]; - unsigned rem = i % keySize; - if (rem == 0) - t = Ui32(Sbox[gb1(t)] ^ Rcon[i / keySize], Sbox[gb2(t)], Sbox[gb3(t)], Sbox[gb0(t)]); - else if (keySize > 6 && rem == 4) - t = Ui32(Sbox[gb0(t)], Sbox[gb1(t)], Sbox[gb2(t)], Sbox[gb3(t)]); - w[i] = w[i - keySize] ^ t; - } -} - -void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *w, const Byte *key, unsigned keySize) -{ - unsigned i, num; - Aes_SetKey_Enc(w, key, keySize); - num = keySize + 20; - w += 8; - for (i = 0; i < num; i++) - { - UInt32 r = w[i]; - w[i] = - D[ (unsigned)Sbox[gb0(r)]] ^ - D[0x100 + (unsigned)Sbox[gb1(r)]] ^ - D[0x200 + (unsigned)Sbox[gb2(r)]] ^ - D[0x300 + (unsigned)Sbox[gb3(r)]]; - } -} - -/* Aes_Encode and Aes_Decode functions work with little-endian words. - src and dest are pointers to 4 UInt32 words. - src and dest can point to same block */ - -static void Aes_Encode(const UInt32 *w, UInt32 *dest, const UInt32 *src) -{ - UInt32 s[4]; - UInt32 m[4]; - UInt32 numRounds2 = w[0]; - w += 4; - s[0] = src[0] ^ w[0]; - s[1] = src[1] ^ w[1]; - s[2] = src[2] ^ w[2]; - s[3] = src[3] ^ w[3]; - w += 4; - for (;;) - { - HT16(m, s, 0); - if (--numRounds2 == 0) - break; - HT16(s, m, 4); - w += 8; - } - w += 4; - FT4(0); FT4(1); FT4(2); FT4(3); -} - -static void Aes_Decode(const UInt32 *w, UInt32 *dest, const UInt32 *src) -{ - UInt32 s[4]; - UInt32 m[4]; - UInt32 numRounds2 = w[0]; - w += 4 + numRounds2 * 8; - s[0] = src[0] ^ w[0]; - s[1] = src[1] ^ w[1]; - s[2] = src[2] ^ w[2]; - s[3] = src[3] ^ w[3]; - for (;;) - { - w -= 8; - HD16(m, s, 4); - if (--numRounds2 == 0) - break; - HD16(s, m, 0); - } - FD4(0); FD4(1); FD4(2); FD4(3); -} - -void AesCbc_Init(UInt32 *p, const Byte *iv) -{ - unsigned i; - for (i = 0; i < 4; i++) - p[i] = GetUi32(iv + i * 4); -} - -void MY_FAST_CALL AesCbc_Encode(UInt32 *p, Byte *data, size_t numBlocks) -{ - for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE) - { - p[0] ^= GetUi32(data); - p[1] ^= GetUi32(data + 4); - p[2] ^= GetUi32(data + 8); - p[3] ^= GetUi32(data + 12); - - Aes_Encode(p + 4, p, p); - - SetUi32(data, p[0]); - SetUi32(data + 4, p[1]); - SetUi32(data + 8, p[2]); - SetUi32(data + 12, p[3]); - } -} - -void MY_FAST_CALL AesCbc_Decode(UInt32 *p, Byte *data, size_t numBlocks) -{ - UInt32 in[4], out[4]; - for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE) - { - in[0] = GetUi32(data); - in[1] = GetUi32(data + 4); - in[2] = GetUi32(data + 8); - in[3] = GetUi32(data + 12); - - Aes_Decode(p + 4, out, in); - - SetUi32(data, p[0] ^ out[0]); - SetUi32(data + 4, p[1] ^ out[1]); - SetUi32(data + 8, p[2] ^ out[2]); - SetUi32(data + 12, p[3] ^ out[3]); - - p[0] = in[0]; - p[1] = in[1]; - p[2] = in[2]; - p[3] = in[3]; - } -} - -void MY_FAST_CALL AesCtr_Code(UInt32 *p, Byte *data, size_t numBlocks) -{ - for (; numBlocks != 0; numBlocks--) - { - UInt32 temp[4]; - Byte buf[16]; - int i; - - if (++p[0] == 0) - p[1]++; - - Aes_Encode(p + 4, temp, p); - - SetUi32(buf, temp[0]); - SetUi32(buf + 4, temp[1]); - SetUi32(buf + 8, temp[2]); - SetUi32(buf + 12, temp[3]); - - for (i = 0; i < 16; i++) - *data++ ^= buf[i]; - } -} diff --git a/jan/src/dep/libs/lib7z/Aes.h b/jan/src/dep/libs/lib7z/Aes.h deleted file mode 100644 index 381e979d1..000000000 --- a/jan/src/dep/libs/lib7z/Aes.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Aes.h -- AES encryption / decryption -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __AES_H -#define __AES_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -#define AES_BLOCK_SIZE 16 - -/* Call AesGenTables one time before other AES functions */ -void AesGenTables(void); - -/* UInt32 pointers must be 16-byte aligned */ - -/* 16-byte (4 * 32-bit words) blocks: 1 (IV) + 1 (keyMode) + 15 (AES-256 roundKeys) */ -#define AES_NUM_IVMRK_WORDS ((1 + 1 + 15) * 4) - -/* aes - 16-byte aligned pointer to keyMode+roundKeys sequence */ -/* keySize = 16 or 24 or 32 (bytes) */ -typedef void (MY_FAST_CALL *AES_SET_KEY_FUNC)(UInt32 *aes, const Byte *key, unsigned keySize); -void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *aes, const Byte *key, unsigned keySize); -void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *aes, const Byte *key, unsigned keySize); - -/* ivAes - 16-byte aligned pointer to iv+keyMode+roundKeys sequence: UInt32[AES_NUM_IVMRK_WORDS] */ -void AesCbc_Init(UInt32 *ivAes, const Byte *iv); /* iv size is AES_BLOCK_SIZE */ -/* data - 16-byte aligned pointer to data */ -/* numBlocks - the number of 16-byte blocks in data array */ -typedef void (MY_FAST_CALL *AES_CODE_FUNC)(UInt32 *ivAes, Byte *data, size_t numBlocks); -extern AES_CODE_FUNC g_AesCbc_Encode; -extern AES_CODE_FUNC g_AesCbc_Decode; -extern AES_CODE_FUNC g_AesCtr_Code; - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/AesOpt.c b/jan/src/dep/libs/lib7z/AesOpt.c deleted file mode 100644 index e5d4d2611..000000000 --- a/jan/src/dep/libs/lib7z/AesOpt.c +++ /dev/null @@ -1,184 +0,0 @@ -/* AesOpt.c -- Intel's AES -2013-11-12 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "CpuArch.h" - -#ifdef MY_CPU_X86_OR_AMD64 -#if _MSC_VER >= 1500 -#define USE_INTEL_AES -#endif -#endif - -#ifdef USE_INTEL_AES - -#include - -void MY_FAST_CALL AesCbc_Encode_Intel(__m128i *p, __m128i *data, size_t numBlocks) -{ - __m128i m = *p; - for (; numBlocks != 0; numBlocks--, data++) - { - UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1; - const __m128i *w = p + 3; - m = _mm_xor_si128(m, *data); - m = _mm_xor_si128(m, p[2]); - do - { - m = _mm_aesenc_si128(m, w[0]); - m = _mm_aesenc_si128(m, w[1]); - w += 2; - } - while (--numRounds2 != 0); - m = _mm_aesenc_si128(m, w[0]); - m = _mm_aesenclast_si128(m, w[1]); - *data = m; - } - *p = m; -} - -#define NUM_WAYS 3 - -#define AES_OP_W(op, n) { \ - const __m128i t = w[n]; \ - m0 = op(m0, t); \ - m1 = op(m1, t); \ - m2 = op(m2, t); \ - } - -#define AES_DEC(n) AES_OP_W(_mm_aesdec_si128, n) -#define AES_DEC_LAST(n) AES_OP_W(_mm_aesdeclast_si128, n) -#define AES_ENC(n) AES_OP_W(_mm_aesenc_si128, n) -#define AES_ENC_LAST(n) AES_OP_W(_mm_aesenclast_si128, n) - -void MY_FAST_CALL AesCbc_Decode_Intel(__m128i *p, __m128i *data, size_t numBlocks) -{ - __m128i iv = *p; - for (; numBlocks >= NUM_WAYS; numBlocks -= NUM_WAYS, data += NUM_WAYS) - { - UInt32 numRounds2 = *(const UInt32 *)(p + 1); - const __m128i *w = p + numRounds2 * 2; - __m128i m0, m1, m2; - { - const __m128i t = w[2]; - m0 = _mm_xor_si128(t, data[0]); - m1 = _mm_xor_si128(t, data[1]); - m2 = _mm_xor_si128(t, data[2]); - } - numRounds2--; - do - { - AES_DEC(1) - AES_DEC(0) - w -= 2; - } - while (--numRounds2 != 0); - AES_DEC(1) - AES_DEC_LAST(0) - - { - __m128i t; - t = _mm_xor_si128(m0, iv); iv = data[0]; data[0] = t; - t = _mm_xor_si128(m1, iv); iv = data[1]; data[1] = t; - t = _mm_xor_si128(m2, iv); iv = data[2]; data[2] = t; - } - } - for (; numBlocks != 0; numBlocks--, data++) - { - UInt32 numRounds2 = *(const UInt32 *)(p + 1); - const __m128i *w = p + numRounds2 * 2; - __m128i m = _mm_xor_si128(w[2], *data); - numRounds2--; - do - { - m = _mm_aesdec_si128(m, w[1]); - m = _mm_aesdec_si128(m, w[0]); - w -= 2; - } - while (--numRounds2 != 0); - m = _mm_aesdec_si128(m, w[1]); - m = _mm_aesdeclast_si128(m, w[0]); - - m = _mm_xor_si128(m, iv); - iv = *data; - *data = m; - } - *p = iv; -} - -void MY_FAST_CALL AesCtr_Code_Intel(__m128i *p, __m128i *data, size_t numBlocks) -{ - __m128i ctr = *p; - __m128i one; - one.m128i_u64[0] = 1; - one.m128i_u64[1] = 0; - for (; numBlocks >= NUM_WAYS; numBlocks -= NUM_WAYS, data += NUM_WAYS) - { - UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1; - const __m128i *w = p; - __m128i m0, m1, m2; - { - const __m128i t = w[2]; - ctr = _mm_add_epi64(ctr, one); m0 = _mm_xor_si128(ctr, t); - ctr = _mm_add_epi64(ctr, one); m1 = _mm_xor_si128(ctr, t); - ctr = _mm_add_epi64(ctr, one); m2 = _mm_xor_si128(ctr, t); - } - w += 3; - do - { - AES_ENC(0) - AES_ENC(1) - w += 2; - } - while (--numRounds2 != 0); - AES_ENC(0) - AES_ENC_LAST(1) - data[0] = _mm_xor_si128(data[0], m0); - data[1] = _mm_xor_si128(data[1], m1); - data[2] = _mm_xor_si128(data[2], m2); - } - for (; numBlocks != 0; numBlocks--, data++) - { - UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1; - const __m128i *w = p; - __m128i m; - ctr = _mm_add_epi64(ctr, one); - m = _mm_xor_si128(ctr, p[2]); - w += 3; - do - { - m = _mm_aesenc_si128(m, w[0]); - m = _mm_aesenc_si128(m, w[1]); - w += 2; - } - while (--numRounds2 != 0); - m = _mm_aesenc_si128(m, w[0]); - m = _mm_aesenclast_si128(m, w[1]); - *data = _mm_xor_si128(*data, m); - } - *p = ctr; -} - -#else - -void MY_FAST_CALL AesCbc_Encode(UInt32 *ivAes, Byte *data, size_t numBlocks); -void MY_FAST_CALL AesCbc_Decode(UInt32 *ivAes, Byte *data, size_t numBlocks); -void MY_FAST_CALL AesCtr_Code(UInt32 *ivAes, Byte *data, size_t numBlocks); - -void MY_FAST_CALL AesCbc_Encode_Intel(UInt32 *p, Byte *data, size_t numBlocks) -{ - AesCbc_Encode(p, data, numBlocks); -} - -void MY_FAST_CALL AesCbc_Decode_Intel(UInt32 *p, Byte *data, size_t numBlocks) -{ - AesCbc_Decode(p, data, numBlocks); -} - -void MY_FAST_CALL AesCtr_Code_Intel(UInt32 *p, Byte *data, size_t numBlocks) -{ - AesCtr_Code(p, data, numBlocks); -} - -#endif diff --git a/jan/src/dep/libs/lib7z/Alloc.c b/jan/src/dep/libs/lib7z/Alloc.c deleted file mode 100644 index 9f1d036af..000000000 --- a/jan/src/dep/libs/lib7z/Alloc.c +++ /dev/null @@ -1,136 +0,0 @@ -/* Alloc.c -- Memory allocation functions -2015-02-21 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#ifdef _WIN32 -#include -#endif -#include - -#include "Alloc.h" - -/* #define _SZ_ALLOC_DEBUG */ - -/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */ -#ifdef _SZ_ALLOC_DEBUG -#include -int g_allocCount = 0; -int g_allocCountMid = 0; -int g_allocCountBig = 0; -#endif - -void *MyAlloc(size_t size) -{ - if (size == 0) - return 0; - #ifdef _SZ_ALLOC_DEBUG - { - void *p = malloc(size); - fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p); - return p; - } - #else - return malloc(size); - #endif -} - -void MyFree(void *address) -{ - #ifdef _SZ_ALLOC_DEBUG - if (address != 0) - fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address); - #endif - free(address); -} - -#ifdef _WIN32 - -void *MidAlloc(size_t size) -{ - if (size == 0) - return 0; - #ifdef _SZ_ALLOC_DEBUG - fprintf(stderr, "\nAlloc_Mid %10d bytes; count = %10d", size, g_allocCountMid++); - #endif - return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE); -} - -void MidFree(void *address) -{ - #ifdef _SZ_ALLOC_DEBUG - if (address != 0) - fprintf(stderr, "\nFree_Mid; count = %10d", --g_allocCountMid); - #endif - if (address == 0) - return; - VirtualFree(address, 0, MEM_RELEASE); -} - -#ifndef MEM_LARGE_PAGES -#undef _7ZIP_LARGE_PAGES -#endif - -#ifdef _7ZIP_LARGE_PAGES -SIZE_T g_LargePageSize = 0; -typedef SIZE_T (WINAPI *GetLargePageMinimumP)(); -#endif - -void SetLargePageSize() -{ - #ifdef _7ZIP_LARGE_PAGES - SIZE_T size = 0; - GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP) - GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum"); - if (largePageMinimum == 0) - return; - size = largePageMinimum(); - if (size == 0 || (size & (size - 1)) != 0) - return; - g_LargePageSize = size; - #endif -} - - -void *BigAlloc(size_t size) -{ - if (size == 0) - return 0; - #ifdef _SZ_ALLOC_DEBUG - fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++); - #endif - - #ifdef _7ZIP_LARGE_PAGES - if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18)) - { - void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)), - MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE); - if (res != 0) - return res; - } - #endif - return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE); -} - -void BigFree(void *address) -{ - #ifdef _SZ_ALLOC_DEBUG - if (address != 0) - fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig); - #endif - - if (address == 0) - return; - VirtualFree(address, 0, MEM_RELEASE); -} - -#endif - - -static void *SzAlloc(void *p, size_t size) { UNUSED_VAR(p); return MyAlloc(size); } -static void SzFree(void *p, void *address) { UNUSED_VAR(p); MyFree(address); } -ISzAlloc g_Alloc = { SzAlloc, SzFree }; - -static void *SzBigAlloc(void *p, size_t size) { UNUSED_VAR(p); return BigAlloc(size); } -static void SzBigFree(void *p, void *address) { UNUSED_VAR(p); BigFree(address); } -ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree }; diff --git a/jan/src/dep/libs/lib7z/Alloc.h b/jan/src/dep/libs/lib7z/Alloc.h deleted file mode 100644 index 73b282a07..000000000 --- a/jan/src/dep/libs/lib7z/Alloc.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Alloc.h -- Memory allocation functions -2015-02-21 : Igor Pavlov : Public domain */ - -#ifndef __COMMON_ALLOC_H -#define __COMMON_ALLOC_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -void *MyAlloc(size_t size); -void MyFree(void *address); - -#ifdef _WIN32 - -void SetLargePageSize(); - -void *MidAlloc(size_t size); -void MidFree(void *address); -void *BigAlloc(size_t size); -void BigFree(void *address); - -#else - -#define MidAlloc(size) MyAlloc(size) -#define MidFree(address) MyFree(address) -#define BigAlloc(size) MyAlloc(size) -#define BigFree(address) MyFree(address) - -#endif - -extern ISzAlloc g_Alloc; -extern ISzAlloc g_BigAlloc; - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Bcj2.c b/jan/src/dep/libs/lib7z/Bcj2.c deleted file mode 100644 index 707362a61..000000000 --- a/jan/src/dep/libs/lib7z/Bcj2.c +++ /dev/null @@ -1,256 +0,0 @@ -/* Bcj2.c -- BCJ2 Decoder (Converter for x86 code) -2015-08-01 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "Bcj2.h" -#include "CpuArch.h" - -#define CProb UInt16 - -#define kTopValue ((UInt32)1 << 24) -#define kNumModelBits 11 -#define kBitModelTotal (1 << kNumModelBits) -#define kNumMoveBits 5 - -#define _IF_BIT_0 ttt = *prob; bound = (p->range >> kNumModelBits) * ttt; if (p->code < bound) -#define _UPDATE_0 p->range = bound; *prob = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); -#define _UPDATE_1 p->range -= bound; p->code -= bound; *prob = (CProb)(ttt - (ttt >> kNumMoveBits)); - -void Bcj2Dec_Init(CBcj2Dec *p) -{ - unsigned i; - - p->state = BCJ2_DEC_STATE_OK; - p->ip = 0; - p->temp[3] = 0; - p->range = 0; - p->code = 0; - for (i = 0; i < sizeof(p->probs) / sizeof(p->probs[0]); i++) - p->probs[i] = kBitModelTotal >> 1; -} - -SRes Bcj2Dec_Decode(CBcj2Dec *p) -{ - if (p->range <= 5) - { - p->state = BCJ2_DEC_STATE_OK; - for (; p->range != 5; p->range++) - { - if (p->range == 1 && p->code != 0) - return SZ_ERROR_DATA; - - if (p->bufs[BCJ2_STREAM_RC] == p->lims[BCJ2_STREAM_RC]) - { - p->state = BCJ2_STREAM_RC; - return SZ_OK; - } - - p->code = (p->code << 8) | *(p->bufs[BCJ2_STREAM_RC])++; - } - - if (p->code == 0xFFFFFFFF) - return SZ_ERROR_DATA; - - p->range = 0xFFFFFFFF; - } - else if (p->state >= BCJ2_DEC_STATE_ORIG_0) - { - while (p->state <= BCJ2_DEC_STATE_ORIG_3) - { - Byte *dest = p->dest; - if (dest == p->destLim) - return SZ_OK; - *dest = p->temp[p->state++ - BCJ2_DEC_STATE_ORIG_0]; - p->dest = dest + 1; - } - } - - /* - if (BCJ2_IS_32BIT_STREAM(p->state)) - { - const Byte *cur = p->bufs[p->state]; - if (cur == p->lims[p->state]) - return SZ_OK; - p->bufs[p->state] = cur + 4; - - { - UInt32 val; - Byte *dest; - SizeT rem; - - p->ip += 4; - val = GetBe32(cur) - p->ip; - dest = p->dest; - rem = p->destLim - dest; - if (rem < 4) - { - SizeT i; - SetUi32(p->temp, val); - for (i = 0; i < rem; i++) - dest[i] = p->temp[i]; - p->dest = dest + rem; - p->state = BCJ2_DEC_STATE_ORIG_0 + (unsigned)rem; - return SZ_OK; - } - SetUi32(dest, val); - p->temp[3] = (Byte)(val >> 24); - p->dest = dest + 4; - p->state = BCJ2_DEC_STATE_OK; - } - } - */ - - for (;;) - { - if (BCJ2_IS_32BIT_STREAM(p->state)) - p->state = BCJ2_DEC_STATE_OK; - else - { - if (p->range < kTopValue) - { - if (p->bufs[BCJ2_STREAM_RC] == p->lims[BCJ2_STREAM_RC]) - { - p->state = BCJ2_STREAM_RC; - return SZ_OK; - } - p->range <<= 8; - p->code = (p->code << 8) | *(p->bufs[BCJ2_STREAM_RC])++; - } - - { - const Byte *src = p->bufs[BCJ2_STREAM_MAIN]; - const Byte *srcLim; - Byte *dest; - SizeT num = p->lims[BCJ2_STREAM_MAIN] - src; - - if (num == 0) - { - p->state = BCJ2_STREAM_MAIN; - return SZ_OK; - } - - dest = p->dest; - if (num > (SizeT)(p->destLim - dest)) - { - num = p->destLim - dest; - if (num == 0) - { - p->state = BCJ2_DEC_STATE_ORIG; - return SZ_OK; - } - } - - srcLim = src + num; - - if (p->temp[3] == 0x0F && (src[0] & 0xF0) == 0x80) - *dest = src[0]; - else for (;;) - { - Byte b = *src; - *dest = b; - if (b != 0x0F) - { - if ((b & 0xFE) == 0xE8) - break; - dest++; - if (++src != srcLim) - continue; - break; - } - dest++; - if (++src == srcLim) - break; - if ((*src & 0xF0) != 0x80) - continue; - *dest = *src; - break; - } - - num = src - p->bufs[BCJ2_STREAM_MAIN]; - - if (src == srcLim) - { - p->temp[3] = src[-1]; - p->bufs[BCJ2_STREAM_MAIN] = src; - p->ip += (UInt32)num; - p->dest += num; - p->state = - p->bufs[BCJ2_STREAM_MAIN] == - p->lims[BCJ2_STREAM_MAIN] ? - (unsigned)BCJ2_STREAM_MAIN : - (unsigned)BCJ2_DEC_STATE_ORIG; - return SZ_OK; - } - - { - UInt32 bound, ttt; - CProb *prob; - Byte b = src[0]; - Byte prev = (Byte)(num == 0 ? p->temp[3] : src[-1]); - - p->temp[3] = b; - p->bufs[BCJ2_STREAM_MAIN] = src + 1; - num++; - p->ip += (UInt32)num; - p->dest += num; - - prob = p->probs + (unsigned)(b == 0xE8 ? 2 + (unsigned)prev : (b == 0xE9 ? 1 : 0)); - - _IF_BIT_0 - { - _UPDATE_0 - continue; - } - _UPDATE_1 - - } - } - } - - { - UInt32 val; - unsigned cj = (p->temp[3] == 0xE8) ? BCJ2_STREAM_CALL : BCJ2_STREAM_JUMP; - const Byte *cur = p->bufs[cj]; - Byte *dest; - SizeT rem; - - if (cur == p->lims[cj]) - { - p->state = cj; - break; - } - - val = GetBe32(cur); - p->bufs[cj] = cur + 4; - - p->ip += 4; - val -= p->ip; - dest = p->dest; - rem = p->destLim - dest; - - if (rem < 4) - { - SizeT i; - SetUi32(p->temp, val); - for (i = 0; i < rem; i++) - dest[i] = p->temp[i]; - p->dest = dest + rem; - p->state = BCJ2_DEC_STATE_ORIG_0 + (unsigned)rem; - break; - } - - SetUi32(dest, val); - p->temp[3] = (Byte)(val >> 24); - p->dest = dest + 4; - } - } - - if (p->range < kTopValue && p->bufs[BCJ2_STREAM_RC] != p->lims[BCJ2_STREAM_RC]) - { - p->range <<= 8; - p->code = (p->code << 8) | *(p->bufs[BCJ2_STREAM_RC])++; - } - - return SZ_OK; -} diff --git a/jan/src/dep/libs/lib7z/Bcj2.h b/jan/src/dep/libs/lib7z/Bcj2.h deleted file mode 100644 index 68893d2d1..000000000 --- a/jan/src/dep/libs/lib7z/Bcj2.h +++ /dev/null @@ -1,146 +0,0 @@ -/* Bcj2.h -- BCJ2 Converter for x86 code -2014-11-10 : Igor Pavlov : Public domain */ - -#ifndef __BCJ2_H -#define __BCJ2_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -#define BCJ2_NUM_STREAMS 4 - -enum -{ - BCJ2_STREAM_MAIN, - BCJ2_STREAM_CALL, - BCJ2_STREAM_JUMP, - BCJ2_STREAM_RC -}; - -enum -{ - BCJ2_DEC_STATE_ORIG_0 = BCJ2_NUM_STREAMS, - BCJ2_DEC_STATE_ORIG_1, - BCJ2_DEC_STATE_ORIG_2, - BCJ2_DEC_STATE_ORIG_3, - - BCJ2_DEC_STATE_ORIG, - BCJ2_DEC_STATE_OK -}; - -enum -{ - BCJ2_ENC_STATE_ORIG = BCJ2_NUM_STREAMS, - BCJ2_ENC_STATE_OK -}; - - -#define BCJ2_IS_32BIT_STREAM(s) ((s) == BCJ2_STREAM_CALL || (s) == BCJ2_STREAM_JUMP) - -/* -CBcj2Dec / CBcj2Enc -bufs sizes: - BUF_SIZE(n) = lims[n] - bufs[n] -bufs sizes for BCJ2_STREAM_CALL and BCJ2_STREAM_JUMP must be mutliply of 4: - (BUF_SIZE(BCJ2_STREAM_CALL) & 3) == 0 - (BUF_SIZE(BCJ2_STREAM_JUMP) & 3) == 0 -*/ - -/* -CBcj2Dec: -dest is allowed to overlap with bufs[BCJ2_STREAM_MAIN], with the following conditions: - bufs[BCJ2_STREAM_MAIN] >= dest && - bufs[BCJ2_STREAM_MAIN] - dest >= tempReserv + - BUF_SIZE(BCJ2_STREAM_CALL) + - BUF_SIZE(BCJ2_STREAM_JUMP) - tempReserv = 0 : for first call of Bcj2Dec_Decode - tempReserv = 4 : for any other calls of Bcj2Dec_Decode - overlap with offset = 1 is not allowed -*/ - -typedef struct -{ - const Byte *bufs[BCJ2_NUM_STREAMS]; - const Byte *lims[BCJ2_NUM_STREAMS]; - Byte *dest; - const Byte *destLim; - - unsigned state; /* BCJ2_STREAM_MAIN has more priority than BCJ2_STATE_ORIG */ - - UInt32 ip; - Byte temp[4]; - UInt32 range; - UInt32 code; - UInt16 probs[2 + 256]; -} CBcj2Dec; - -void Bcj2Dec_Init(CBcj2Dec *p); - -/* Returns: SZ_OK or SZ_ERROR_DATA */ -SRes Bcj2Dec_Decode(CBcj2Dec *p); - -#define Bcj2Dec_IsFinished(_p_) ((_p_)->code == 0) - - - -typedef enum -{ - BCJ2_ENC_FINISH_MODE_CONTINUE, - BCJ2_ENC_FINISH_MODE_END_BLOCK, - BCJ2_ENC_FINISH_MODE_END_STREAM -} EBcj2Enc_FinishMode; - -typedef struct -{ - Byte *bufs[BCJ2_NUM_STREAMS]; - const Byte *lims[BCJ2_NUM_STREAMS]; - const Byte *src; - const Byte *srcLim; - - unsigned state; - EBcj2Enc_FinishMode finishMode; - - Byte prevByte; - - Byte cache; - UInt32 range; - UInt64 low; - UInt64 cacheSize; - - UInt32 ip; - - /* 32-bit ralative offset in JUMP/CALL commands is - - (mod 4 GB) in 32-bit mode - - signed Int32 in 64-bit mode - We use (mod 4 GB) check for fileSize. - Use fileSize up to 2 GB, if you want to support 32-bit and 64-bit code conversion. */ - UInt32 fileIp; - UInt32 fileSize; /* (fileSize <= ((UInt32)1 << 31)), 0 means no_limit */ - UInt32 relatLimit; /* (relatLimit <= ((UInt32)1 << 31)), 0 means desable_conversion */ - - UInt32 tempTarget; - unsigned tempPos; - Byte temp[4 * 2]; - - unsigned flushPos; - - UInt16 probs[2 + 256]; -} CBcj2Enc; - -void Bcj2Enc_Init(CBcj2Enc *p); -void Bcj2Enc_Encode(CBcj2Enc *p); - -#define Bcj2Enc_Get_InputData_Size(p) ((SizeT)((p)->srcLim - (p)->src) + (p)->tempPos) -#define Bcj2Enc_IsFinished(p) ((p)->flushPos == 5) - - -#define BCJ2_RELAT_LIMIT_NUM_BITS 26 -#define BCJ2_RELAT_LIMIT ((UInt32)1 << BCJ2_RELAT_LIMIT_NUM_BITS) - -/* limit for CBcj2Enc::fileSize variable */ -#define BCJ2_FileSize_MAX ((UInt32)1 << 31) - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Bcj2Enc.c b/jan/src/dep/libs/lib7z/Bcj2Enc.c deleted file mode 100644 index 6a210151e..000000000 --- a/jan/src/dep/libs/lib7z/Bcj2Enc.c +++ /dev/null @@ -1,312 +0,0 @@ -/* Bcj2Enc.c -- BCJ2 Encoder (Converter for x86 code) -2014-11-10 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -/* #define SHOW_STAT */ - -#ifdef SHOW_STAT -#include -#define PRF(x) x -#else -#define PRF(x) -#endif - -#include -#include - -#include "Bcj2.h" -#include "CpuArch.h" - -#define CProb UInt16 - -#define kTopValue ((UInt32)1 << 24) -#define kNumModelBits 11 -#define kBitModelTotal (1 << kNumModelBits) -#define kNumMoveBits 5 - -void Bcj2Enc_Init(CBcj2Enc *p) -{ - unsigned i; - - p->state = BCJ2_ENC_STATE_OK; - p->finishMode = BCJ2_ENC_FINISH_MODE_CONTINUE; - - p->prevByte = 0; - - p->cache = 0; - p->range = 0xFFFFFFFF; - p->low = 0; - p->cacheSize = 1; - - p->ip = 0; - - p->fileIp = 0; - p->fileSize = 0; - p->relatLimit = BCJ2_RELAT_LIMIT; - - p->tempPos = 0; - - p->flushPos = 0; - - for (i = 0; i < sizeof(p->probs) / sizeof(p->probs[0]); i++) - p->probs[i] = kBitModelTotal >> 1; -} - -static Bool MY_FAST_CALL RangeEnc_ShiftLow(CBcj2Enc *p) -{ - if ((UInt32)p->low < (UInt32)0xFF000000 || (UInt32)(p->low >> 32) != 0) - { - Byte *buf = p->bufs[BCJ2_STREAM_RC]; - do - { - if (buf == p->lims[BCJ2_STREAM_RC]) - { - p->state = BCJ2_STREAM_RC; - p->bufs[BCJ2_STREAM_RC] = buf; - return True; - } - *buf++ = (Byte)(p->cache + (Byte)(p->low >> 32)); - p->cache = 0xFF; - } - while (--p->cacheSize); - p->bufs[BCJ2_STREAM_RC] = buf; - p->cache = (Byte)((UInt32)p->low >> 24); - } - p->cacheSize++; - p->low = (UInt32)p->low << 8; - return False; -} - -static void Bcj2Enc_Encode_2(CBcj2Enc *p) -{ - if (BCJ2_IS_32BIT_STREAM(p->state)) - { - Byte *cur = p->bufs[p->state]; - if (cur == p->lims[p->state]) - return; - SetBe32(cur, p->tempTarget); - p->bufs[p->state] = cur + 4; - } - - p->state = BCJ2_ENC_STATE_ORIG; - - for (;;) - { - if (p->range < kTopValue) - { - if (RangeEnc_ShiftLow(p)) - return; - p->range <<= 8; - } - - { - { - const Byte *src = p->src; - const Byte *srcLim; - Byte *dest; - SizeT num = p->srcLim - src; - - if (p->finishMode == BCJ2_ENC_FINISH_MODE_CONTINUE) - { - if (num <= 4) - return; - num -= 4; - } - else if (num == 0) - break; - - dest = p->bufs[BCJ2_STREAM_MAIN]; - if (num > (SizeT)(p->lims[BCJ2_STREAM_MAIN] - dest)) - { - num = p->lims[BCJ2_STREAM_MAIN] - dest; - if (num == 0) - { - p->state = BCJ2_STREAM_MAIN; - return; - } - } - - srcLim = src + num; - - if (p->prevByte == 0x0F && (src[0] & 0xF0) == 0x80) - *dest = src[0]; - else for (;;) - { - Byte b = *src; - *dest = b; - if (b != 0x0F) - { - if ((b & 0xFE) == 0xE8) - break; - dest++; - if (++src != srcLim) - continue; - break; - } - dest++; - if (++src == srcLim) - break; - if ((*src & 0xF0) != 0x80) - continue; - *dest = *src; - break; - } - - num = src - p->src; - - if (src == srcLim) - { - p->prevByte = src[-1]; - p->bufs[BCJ2_STREAM_MAIN] = dest; - p->src = src; - p->ip += (UInt32)num; - continue; - } - - { - Byte context = (Byte)(num == 0 ? p->prevByte : src[-1]); - Bool needConvert; - - p->bufs[BCJ2_STREAM_MAIN] = dest + 1; - p->ip += (UInt32)num + 1; - src++; - - needConvert = False; - - if ((SizeT)(p->srcLim - src) >= 4) - { - UInt32 relatVal = GetUi32(src); - if ((p->fileSize == 0 || (UInt32)(p->ip + 4 + relatVal - p->fileIp) < p->fileSize) - && ((relatVal + p->relatLimit) >> 1) < p->relatLimit) - needConvert = True; - } - - { - UInt32 bound; - unsigned ttt; - Byte b = src[-1]; - CProb *prob = p->probs + (unsigned)(b == 0xE8 ? 2 + (unsigned)context : (b == 0xE9 ? 1 : 0)); - - ttt = *prob; - bound = (p->range >> kNumModelBits) * ttt; - - if (!needConvert) - { - p->range = bound; - *prob = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); - p->src = src; - p->prevByte = b; - continue; - } - - p->low += bound; - p->range -= bound; - *prob = (CProb)(ttt - (ttt >> kNumMoveBits)); - - { - UInt32 relatVal = GetUi32(src); - UInt32 absVal; - p->ip += 4; - absVal = p->ip + relatVal; - p->prevByte = src[3]; - src += 4; - p->src = src; - { - unsigned cj = (b == 0xE8) ? BCJ2_STREAM_CALL : BCJ2_STREAM_JUMP; - Byte *cur = p->bufs[cj]; - if (cur == p->lims[cj]) - { - p->state = cj; - p->tempTarget = absVal; - return; - } - SetBe32(cur, absVal); - p->bufs[cj] = cur + 4; - } - } - } - } - } - } - } - - if (p->finishMode != BCJ2_ENC_FINISH_MODE_END_STREAM) - return; - - for (; p->flushPos < 5; p->flushPos++) - if (RangeEnc_ShiftLow(p)) - return; - p->state = BCJ2_ENC_STATE_OK; -} - - -void Bcj2Enc_Encode(CBcj2Enc *p) -{ - PRF(printf("\n")); - PRF(printf("---- ip = %8d tempPos = %8d src = %8d\n", p->ip, p->tempPos, p->srcLim - p->src)); - - if (p->tempPos != 0) - { - unsigned extra = 0; - - for (;;) - { - const Byte *src = p->src; - const Byte *srcLim = p->srcLim; - unsigned finishMode = p->finishMode; - - p->src = p->temp; - p->srcLim = p->temp + p->tempPos; - if (src != srcLim) - p->finishMode = BCJ2_ENC_FINISH_MODE_CONTINUE; - - PRF(printf(" ip = %8d tempPos = %8d src = %8d\n", p->ip, p->tempPos, p->srcLim - p->src)); - - Bcj2Enc_Encode_2(p); - - { - unsigned num = (unsigned)(p->src - p->temp); - unsigned tempPos = p->tempPos - num; - unsigned i; - p->tempPos = tempPos; - for (i = 0; i < tempPos; i++) - p->temp[i] = p->temp[i + num]; - - p->src = src; - p->srcLim = srcLim; - p->finishMode = finishMode; - - if (p->state != BCJ2_ENC_STATE_ORIG || src == srcLim) - return; - - if (extra >= tempPos) - { - p->src = src - tempPos; - p->tempPos = 0; - break; - } - - p->temp[tempPos] = src[0]; - p->tempPos = tempPos + 1; - p->src = src + 1; - extra++; - } - } - } - - PRF(printf("++++ ip = %8d tempPos = %8d src = %8d\n", p->ip, p->tempPos, p->srcLim - p->src)); - - Bcj2Enc_Encode_2(p); - - if (p->state == BCJ2_ENC_STATE_ORIG) - { - const Byte *src = p->src; - unsigned rem = (unsigned)(p->srcLim - src); - unsigned i; - for (i = 0; i < rem; i++) - p->temp[i] = src[i]; - p->tempPos = rem; - p->src = src + rem; - } -} diff --git a/jan/src/dep/libs/lib7z/Bra.c b/jan/src/dep/libs/lib7z/Bra.c deleted file mode 100644 index 976810c96..000000000 --- a/jan/src/dep/libs/lib7z/Bra.c +++ /dev/null @@ -1,135 +0,0 @@ -/* Bra.c -- Converters for RISC code -2010-04-16 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "Bra.h" - -SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - SizeT i; - if (size < 4) - return 0; - size -= 4; - ip += 8; - for (i = 0; i <= size; i += 4) - { - if (data[i + 3] == 0xEB) - { - UInt32 dest; - UInt32 src = ((UInt32)data[i + 2] << 16) | ((UInt32)data[i + 1] << 8) | (data[i + 0]); - src <<= 2; - if (encoding) - dest = ip + (UInt32)i + src; - else - dest = src - (ip + (UInt32)i); - dest >>= 2; - data[i + 2] = (Byte)(dest >> 16); - data[i + 1] = (Byte)(dest >> 8); - data[i + 0] = (Byte)dest; - } - } - return i; -} - -SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - SizeT i; - if (size < 4) - return 0; - size -= 4; - ip += 4; - for (i = 0; i <= size; i += 2) - { - if ((data[i + 1] & 0xF8) == 0xF0 && - (data[i + 3] & 0xF8) == 0xF8) - { - UInt32 dest; - UInt32 src = - (((UInt32)data[i + 1] & 0x7) << 19) | - ((UInt32)data[i + 0] << 11) | - (((UInt32)data[i + 3] & 0x7) << 8) | - (data[i + 2]); - - src <<= 1; - if (encoding) - dest = ip + (UInt32)i + src; - else - dest = src - (ip + (UInt32)i); - dest >>= 1; - - data[i + 1] = (Byte)(0xF0 | ((dest >> 19) & 0x7)); - data[i + 0] = (Byte)(dest >> 11); - data[i + 3] = (Byte)(0xF8 | ((dest >> 8) & 0x7)); - data[i + 2] = (Byte)dest; - i += 2; - } - } - return i; -} - -SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - SizeT i; - if (size < 4) - return 0; - size -= 4; - for (i = 0; i <= size; i += 4) - { - if ((data[i] >> 2) == 0x12 && (data[i + 3] & 3) == 1) - { - UInt32 src = ((UInt32)(data[i + 0] & 3) << 24) | - ((UInt32)data[i + 1] << 16) | - ((UInt32)data[i + 2] << 8) | - ((UInt32)data[i + 3] & (~3)); - - UInt32 dest; - if (encoding) - dest = ip + (UInt32)i + src; - else - dest = src - (ip + (UInt32)i); - data[i + 0] = (Byte)(0x48 | ((dest >> 24) & 0x3)); - data[i + 1] = (Byte)(dest >> 16); - data[i + 2] = (Byte)(dest >> 8); - data[i + 3] &= 0x3; - data[i + 3] |= dest; - } - } - return i; -} - -SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - UInt32 i; - if (size < 4) - return 0; - size -= 4; - for (i = 0; i <= size; i += 4) - { - if ((data[i] == 0x40 && (data[i + 1] & 0xC0) == 0x00) || - (data[i] == 0x7F && (data[i + 1] & 0xC0) == 0xC0)) - { - UInt32 src = - ((UInt32)data[i + 0] << 24) | - ((UInt32)data[i + 1] << 16) | - ((UInt32)data[i + 2] << 8) | - ((UInt32)data[i + 3]); - UInt32 dest; - - src <<= 2; - if (encoding) - dest = ip + i + src; - else - dest = src - (ip + i); - dest >>= 2; - - dest = (((0 - ((dest >> 22) & 1)) << 22) & 0x3FFFFFFF) | (dest & 0x3FFFFF) | 0x40000000; - - data[i + 0] = (Byte)(dest >> 24); - data[i + 1] = (Byte)(dest >> 16); - data[i + 2] = (Byte)(dest >> 8); - data[i + 3] = (Byte)dest; - } - } - return i; -} diff --git a/jan/src/dep/libs/lib7z/Bra.h b/jan/src/dep/libs/lib7z/Bra.h deleted file mode 100644 index aba8dce14..000000000 --- a/jan/src/dep/libs/lib7z/Bra.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Bra.h -- Branch converters for executables -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __BRA_H -#define __BRA_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -/* -These functions convert relative addresses to absolute addresses -in CALL instructions to increase the compression ratio. - - In: - data - data buffer - size - size of data - ip - current virtual Instruction Pinter (IP) value - state - state variable for x86 converter - encoding - 0 (for decoding), 1 (for encoding) - - Out: - state - state variable for x86 converter - - Returns: - The number of processed bytes. If you call these functions with multiple calls, - you must start next call with first byte after block of processed bytes. - - Type Endian Alignment LookAhead - - x86 little 1 4 - ARMT little 2 2 - ARM little 4 0 - PPC big 4 0 - SPARC big 4 0 - IA64 little 16 0 - - size must be >= Alignment + LookAhead, if it's not last block. - If (size < Alignment + LookAhead), converter returns 0. - - Example: - - UInt32 ip = 0; - for () - { - ; size must be >= Alignment + LookAhead, if it's not last block - SizeT processed = Convert(data, size, ip, 1); - data += processed; - size -= processed; - ip += processed; - } -*/ - -#define x86_Convert_Init(state) { state = 0; } -SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding); -SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); -SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); -SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); -SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); -SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Bra86.c b/jan/src/dep/libs/lib7z/Bra86.c deleted file mode 100644 index 8dd3ed48d..000000000 --- a/jan/src/dep/libs/lib7z/Bra86.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Bra86.c -- Converter for x86 code (BCJ) -2013-11-12 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "Bra.h" - -#define Test86MSByte(b) ((((b) + 1) & 0xFE) == 0) - -SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding) -{ - SizeT pos = 0; - UInt32 mask = *state & 7; - if (size < 5) - return 0; - size -= 4; - ip += 5; - - for (;;) - { - Byte *p = data + pos; - const Byte *limit = data + size; - for (; p < limit; p++) - if ((*p & 0xFE) == 0xE8) - break; - - { - SizeT d = (SizeT)(p - data - pos); - pos = (SizeT)(p - data); - if (p >= limit) - { - *state = (d > 2 ? 0 : mask >> (unsigned)d); - return pos; - } - if (d > 2) - mask = 0; - else - { - mask >>= (unsigned)d; - if (mask != 0 && (mask > 4 || mask == 3 || Test86MSByte(p[(mask >> 1) + 1]))) - { - mask = (mask >> 1) | 4; - pos++; - continue; - } - } - } - - if (Test86MSByte(p[4])) - { - UInt32 v = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]); - UInt32 cur = ip + (UInt32)pos; - pos += 5; - if (encoding) - v += cur; - else - v -= cur; - if (mask != 0) - { - unsigned sh = (mask & 6) << 2; - if (Test86MSByte((Byte)(v >> sh))) - { - v ^= (((UInt32)0x100 << sh) - 1); - if (encoding) - v += cur; - else - v -= cur; - } - mask = 0; - } - p[1] = (Byte)v; - p[2] = (Byte)(v >> 8); - p[3] = (Byte)(v >> 16); - p[4] = (Byte)(0 - ((v >> 24) & 1)); - } - else - { - mask = (mask >> 1) | 4; - pos++; - } - } -} diff --git a/jan/src/dep/libs/lib7z/BraIA64.c b/jan/src/dep/libs/lib7z/BraIA64.c deleted file mode 100644 index 813830c79..000000000 --- a/jan/src/dep/libs/lib7z/BraIA64.c +++ /dev/null @@ -1,69 +0,0 @@ -/* BraIA64.c -- Converter for IA-64 code -2013-11-12 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "Bra.h" - -static const Byte kBranchTable[32] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 4, 6, 6, 0, 0, 7, 7, - 4, 4, 0, 0, 4, 4, 0, 0 -}; - -SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - SizeT i; - if (size < 16) - return 0; - size -= 16; - for (i = 0; i <= size; i += 16) - { - UInt32 instrTemplate = data[i] & 0x1F; - UInt32 mask = kBranchTable[instrTemplate]; - UInt32 bitPos = 5; - int slot; - for (slot = 0; slot < 3; slot++, bitPos += 41) - { - UInt32 bytePos, bitRes; - UInt64 instruction, instNorm; - int j; - if (((mask >> slot) & 1) == 0) - continue; - bytePos = (bitPos >> 3); - bitRes = bitPos & 0x7; - instruction = 0; - for (j = 0; j < 6; j++) - instruction += (UInt64)data[i + j + bytePos] << (8 * j); - - instNorm = instruction >> bitRes; - if (((instNorm >> 37) & 0xF) == 0x5 && ((instNorm >> 9) & 0x7) == 0) - { - UInt32 src = (UInt32)((instNorm >> 13) & 0xFFFFF); - UInt32 dest; - src |= ((UInt32)(instNorm >> 36) & 1) << 20; - - src <<= 4; - - if (encoding) - dest = ip + (UInt32)i + src; - else - dest = src - (ip + (UInt32)i); - - dest >>= 4; - - instNorm &= ~((UInt64)(0x8FFFFF) << 13); - instNorm |= ((UInt64)(dest & 0xFFFFF) << 13); - instNorm |= ((UInt64)(dest & 0x100000) << (36 - 20)); - - instruction &= (1 << bitRes) - 1; - instruction |= (instNorm << bitRes); - for (j = 0; j < 6; j++) - data[i + j + bytePos] = (Byte)(instruction >> (8 * j)); - } - } - } - return i; -} diff --git a/jan/src/dep/libs/lib7z/Compiler.h b/jan/src/dep/libs/lib7z/Compiler.h deleted file mode 100644 index de8fab374..000000000 --- a/jan/src/dep/libs/lib7z/Compiler.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Compiler.h -2015-08-02 : Igor Pavlov : Public domain */ - -#ifndef __7Z_COMPILER_H -#define __7Z_COMPILER_H - -#ifdef _MSC_VER - - #ifdef UNDER_CE - #define RPC_NO_WINDOWS_H - /* #pragma warning(disable : 4115) // '_RPC_ASYNC_STATE' : named type definition in parentheses */ - #pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union - #pragma warning(disable : 4214) // nonstandard extension used : bit field types other than int - #endif - - #if _MSC_VER >= 1300 - #pragma warning(disable : 4996) // This function or variable may be unsafe - #else - #pragma warning(disable : 4511) // copy constructor could not be generated - #pragma warning(disable : 4512) // assignment operator could not be generated - #pragma warning(disable : 4514) // unreferenced inline function has been removed - #pragma warning(disable : 4702) // unreachable code - #pragma warning(disable : 4710) // not inlined - #pragma warning(disable : 4786) // identifier was truncated to '255' characters in the debug information - #endif - -#endif - -#define UNUSED_VAR(x) (void)x; -/* #define UNUSED_VAR(x) x=x; */ - -#endif diff --git a/jan/src/dep/libs/lib7z/CpuArch.c b/jan/src/dep/libs/lib7z/CpuArch.c deleted file mode 100644 index f835c2b7b..000000000 --- a/jan/src/dep/libs/lib7z/CpuArch.c +++ /dev/null @@ -1,200 +0,0 @@ -/* CpuArch.c -- CPU specific code -2016-02-25: Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "CpuArch.h" - -#ifdef MY_CPU_X86_OR_AMD64 - -#if (defined(_MSC_VER) && !defined(MY_CPU_AMD64)) || defined(__GNUC__) -#define USE_ASM -#endif - -#if !defined(USE_ASM) && _MSC_VER >= 1500 -#include -#endif - -#if defined(USE_ASM) && !defined(MY_CPU_AMD64) -static UInt32 CheckFlag(UInt32 flag) -{ - #ifdef _MSC_VER - __asm pushfd; - __asm pop EAX; - __asm mov EDX, EAX; - __asm xor EAX, flag; - __asm push EAX; - __asm popfd; - __asm pushfd; - __asm pop EAX; - __asm xor EAX, EDX; - __asm push EDX; - __asm popfd; - __asm and flag, EAX; - #else - __asm__ __volatile__ ( - "pushf\n\t" - "pop %%EAX\n\t" - "movl %%EAX,%%EDX\n\t" - "xorl %0,%%EAX\n\t" - "push %%EAX\n\t" - "popf\n\t" - "pushf\n\t" - "pop %%EAX\n\t" - "xorl %%EDX,%%EAX\n\t" - "push %%EDX\n\t" - "popf\n\t" - "andl %%EAX, %0\n\t": - "=c" (flag) : "c" (flag) : - "%eax", "%edx"); - #endif - return flag; -} -#define CHECK_CPUID_IS_SUPPORTED if (CheckFlag(1 << 18) == 0 || CheckFlag(1 << 21) == 0) return False; -#else -#define CHECK_CPUID_IS_SUPPORTED -#endif - -void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d) -{ - #ifdef USE_ASM - - #ifdef _MSC_VER - - UInt32 a2, b2, c2, d2; - __asm xor EBX, EBX; - __asm xor ECX, ECX; - __asm xor EDX, EDX; - __asm mov EAX, function; - __asm cpuid; - __asm mov a2, EAX; - __asm mov b2, EBX; - __asm mov c2, ECX; - __asm mov d2, EDX; - - *a = a2; - *b = b2; - *c = c2; - *d = d2; - - #else - - __asm__ __volatile__ ( - #if defined(MY_CPU_AMD64) && defined(__PIC__) - "mov %%rbx, %%rdi;" - "cpuid;" - "xchg %%rbx, %%rdi;" - : "=a" (*a) , - "=D" (*b) , - #elif defined(MY_CPU_X86) && defined(__PIC__) - "mov %%ebx, %%edi;" - "cpuid;" - "xchgl %%ebx, %%edi;" - : "=a" (*a) , - "=D" (*b) , - #else - "cpuid" - : "=a" (*a) , - "=b" (*b) , - #endif - "=c" (*c) , - "=d" (*d) - : "0" (function)) ; - - #endif - - #else - - int CPUInfo[4]; - __cpuid(CPUInfo, function); - *a = CPUInfo[0]; - *b = CPUInfo[1]; - *c = CPUInfo[2]; - *d = CPUInfo[3]; - - #endif -} - -Bool x86cpuid_CheckAndRead(Cx86cpuid *p) -{ - CHECK_CPUID_IS_SUPPORTED - MyCPUID(0, &p->maxFunc, &p->vendor[0], &p->vendor[2], &p->vendor[1]); - MyCPUID(1, &p->ver, &p->b, &p->c, &p->d); - return True; -} - -static const UInt32 kVendors[][3] = -{ - { 0x756E6547, 0x49656E69, 0x6C65746E}, - { 0x68747541, 0x69746E65, 0x444D4163}, - { 0x746E6543, 0x48727561, 0x736C7561} -}; - -int x86cpuid_GetFirm(const Cx86cpuid *p) -{ - unsigned i; - for (i = 0; i < sizeof(kVendors) / sizeof(kVendors[i]); i++) - { - const UInt32 *v = kVendors[i]; - if (v[0] == p->vendor[0] && - v[1] == p->vendor[1] && - v[2] == p->vendor[2]) - return (int)i; - } - return -1; -} - -Bool CPU_Is_InOrder() -{ - Cx86cpuid p; - int firm; - UInt32 family, model; - if (!x86cpuid_CheckAndRead(&p)) - return True; - - family = x86cpuid_GetFamily(p.ver); - model = x86cpuid_GetModel(p.ver); - - firm = x86cpuid_GetFirm(&p); - - switch (firm) - { - case CPU_FIRM_INTEL: return (family < 6 || (family == 6 && ( - /* In-Order Atom CPU */ - model == 0x1C /* 45 nm, N4xx, D4xx, N5xx, D5xx, 230, 330 */ - || model == 0x26 /* 45 nm, Z6xx */ - || model == 0x27 /* 32 nm, Z2460 */ - || model == 0x35 /* 32 nm, Z2760 */ - || model == 0x36 /* 32 nm, N2xxx, D2xxx */ - ))); - case CPU_FIRM_AMD: return (family < 5 || (family == 5 && (model < 6 || model == 0xA))); - case CPU_FIRM_VIA: return (family < 6 || (family == 6 && model < 0xF)); - } - return True; -} - -#if !defined(MY_CPU_AMD64) && defined(_WIN32) -#include -static Bool CPU_Sys_Is_SSE_Supported() -{ - OSVERSIONINFO vi; - vi.dwOSVersionInfoSize = sizeof(vi); - if (!GetVersionEx(&vi)) - return False; - return (vi.dwMajorVersion >= 5); -} -#define CHECK_SYS_SSE_SUPPORT if (!CPU_Sys_Is_SSE_Supported()) return False; -#else -#define CHECK_SYS_SSE_SUPPORT -#endif - -Bool CPU_Is_Aes_Supported() -{ - Cx86cpuid p; - CHECK_SYS_SSE_SUPPORT - if (!x86cpuid_CheckAndRead(&p)) - return False; - return (p.c >> 25) & 1; -} - -#endif diff --git a/jan/src/dep/libs/lib7z/CpuArch.h b/jan/src/dep/libs/lib7z/CpuArch.h deleted file mode 100644 index ef6083c3b..000000000 --- a/jan/src/dep/libs/lib7z/CpuArch.h +++ /dev/null @@ -1,223 +0,0 @@ -/* CpuArch.h -- CPU specific code -2016-06-09: Igor Pavlov : Public domain */ - -#ifndef __CPU_ARCH_H -#define __CPU_ARCH_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -/* -MY_CPU_LE means that CPU is LITTLE ENDIAN. -MY_CPU_BE means that CPU is BIG ENDIAN. -If MY_CPU_LE and MY_CPU_BE are not defined, we don't know about ENDIANNESS of platform. - -MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses. -*/ - -#if defined(_M_X64) \ - || defined(_M_AMD64) \ - || defined(__x86_64__) \ - || defined(__AMD64__) \ - || defined(__amd64__) - #define MY_CPU_AMD64 -#endif - -#if defined(MY_CPU_AMD64) \ - || defined(_M_IA64) \ - || defined(__AARCH64EL__) \ - || defined(__AARCH64EB__) - #define MY_CPU_64BIT -#endif - -#if defined(_M_IX86) || defined(__i386__) -#define MY_CPU_X86 -#endif - -#if defined(MY_CPU_X86) || defined(MY_CPU_AMD64) -#define MY_CPU_X86_OR_AMD64 -#endif - -#if defined(MY_CPU_X86) \ - || defined(_M_ARM) \ - || defined(__ARMEL__) \ - || defined(__THUMBEL__) \ - || defined(__ARMEB__) \ - || defined(__THUMBEB__) - #define MY_CPU_32BIT -#endif - -#if defined(_WIN32) && defined(_M_ARM) -#define MY_CPU_ARM_LE -#endif - -#if defined(_WIN32) && defined(_M_IA64) -#define MY_CPU_IA64_LE -#endif - -#if defined(MY_CPU_X86_OR_AMD64) \ - || defined(MY_CPU_ARM_LE) \ - || defined(MY_CPU_IA64_LE) \ - || defined(__LITTLE_ENDIAN__) \ - || defined(__ARMEL__) \ - || defined(__THUMBEL__) \ - || defined(__AARCH64EL__) \ - || defined(__MIPSEL__) \ - || defined(__MIPSEL) \ - || defined(_MIPSEL) \ - || defined(__BFIN__) \ - || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - #define MY_CPU_LE -#endif - -#if defined(__BIG_ENDIAN__) \ - || defined(__ARMEB__) \ - || defined(__THUMBEB__) \ - || defined(__AARCH64EB__) \ - || defined(__MIPSEB__) \ - || defined(__MIPSEB) \ - || defined(_MIPSEB) \ - || defined(__m68k__) \ - || defined(__s390__) \ - || defined(__s390x__) \ - || defined(__zarch__) \ - || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - #define MY_CPU_BE -#endif - -#if defined(MY_CPU_LE) && defined(MY_CPU_BE) -Stop_Compiling_Bad_Endian -#endif - - -#ifdef MY_CPU_LE - #if defined(MY_CPU_X86_OR_AMD64) \ - /* || defined(__AARCH64EL__) */ - #define MY_CPU_LE_UNALIGN - #endif -#endif - - -#ifdef MY_CPU_LE_UNALIGN - -#define GetUi16(p) (*(const UInt16 *)(const void *)(p)) -#define GetUi32(p) (*(const UInt32 *)(const void *)(p)) -#define GetUi64(p) (*(const UInt64 *)(const void *)(p)) - -#define SetUi16(p, v) { *(UInt16 *)(p) = (v); } -#define SetUi32(p, v) { *(UInt32 *)(p) = (v); } -#define SetUi64(p, v) { *(UInt64 *)(p) = (v); } - -#else - -#define GetUi16(p) ( (UInt16) ( \ - ((const Byte *)(p))[0] | \ - ((UInt16)((const Byte *)(p))[1] << 8) )) - -#define GetUi32(p) ( \ - ((const Byte *)(p))[0] | \ - ((UInt32)((const Byte *)(p))[1] << 8) | \ - ((UInt32)((const Byte *)(p))[2] << 16) | \ - ((UInt32)((const Byte *)(p))[3] << 24)) - -#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32)) - -#define SetUi16(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \ - _ppp_[0] = (Byte)_vvv_; \ - _ppp_[1] = (Byte)(_vvv_ >> 8); } - -#define SetUi32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \ - _ppp_[0] = (Byte)_vvv_; \ - _ppp_[1] = (Byte)(_vvv_ >> 8); \ - _ppp_[2] = (Byte)(_vvv_ >> 16); \ - _ppp_[3] = (Byte)(_vvv_ >> 24); } - -#define SetUi64(p, v) { Byte *_ppp2_ = (Byte *)(p); UInt64 _vvv2_ = (v); \ - SetUi32(_ppp2_ , (UInt32)_vvv2_); \ - SetUi32(_ppp2_ + 4, (UInt32)(_vvv2_ >> 32)); } - -#endif - - -#if defined(MY_CPU_LE_UNALIGN) && /* defined(_WIN64) && */ (_MSC_VER >= 1300) - -/* Note: we use bswap instruction, that is unsupported in 386 cpu */ - -#include - -#pragma intrinsic(_byteswap_ulong) -#pragma intrinsic(_byteswap_uint64) -#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p)) -#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p)) - -#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = _byteswap_ulong(v) - -#elif defined(MY_CPU_LE_UNALIGN) && defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - -#define GetBe32(p) __builtin_bswap32(*(const UInt32 *)(const Byte *)(p)) -#define GetBe64(p) __builtin_bswap64(*(const UInt64 *)(const Byte *)(p)) - -#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = __builtin_bswap32(v) - -#else - -#define GetBe32(p) ( \ - ((UInt32)((const Byte *)(p))[0] << 24) | \ - ((UInt32)((const Byte *)(p))[1] << 16) | \ - ((UInt32)((const Byte *)(p))[2] << 8) | \ - ((const Byte *)(p))[3] ) - -#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4)) - -#define SetBe32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \ - _ppp_[0] = (Byte)(_vvv_ >> 24); \ - _ppp_[1] = (Byte)(_vvv_ >> 16); \ - _ppp_[2] = (Byte)(_vvv_ >> 8); \ - _ppp_[3] = (Byte)_vvv_; } - -#endif - - -#define GetBe16(p) ( (UInt16) ( \ - ((UInt16)((const Byte *)(p))[0] << 8) | \ - ((const Byte *)(p))[1] )) - - - -#ifdef MY_CPU_X86_OR_AMD64 - -typedef struct -{ - UInt32 maxFunc; - UInt32 vendor[3]; - UInt32 ver; - UInt32 b; - UInt32 c; - UInt32 d; -} Cx86cpuid; - -enum -{ - CPU_FIRM_INTEL, - CPU_FIRM_AMD, - CPU_FIRM_VIA -}; - -void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d); - -Bool x86cpuid_CheckAndRead(Cx86cpuid *p); -int x86cpuid_GetFirm(const Cx86cpuid *p); - -#define x86cpuid_GetFamily(ver) (((ver >> 16) & 0xFF0) | ((ver >> 8) & 0xF)) -#define x86cpuid_GetModel(ver) (((ver >> 12) & 0xF0) | ((ver >> 4) & 0xF)) -#define x86cpuid_GetStepping(ver) (ver & 0xF) - -Bool CPU_Is_InOrder(); -Bool CPU_Is_Aes_Supported(); - -#endif - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Delta.c b/jan/src/dep/libs/lib7z/Delta.c deleted file mode 100644 index 6cbbe4601..000000000 --- a/jan/src/dep/libs/lib7z/Delta.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Delta.c -- Delta converter -2009-05-26 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "Delta.h" - -void Delta_Init(Byte *state) -{ - unsigned i; - for (i = 0; i < DELTA_STATE_SIZE; i++) - state[i] = 0; -} - -static void MyMemCpy(Byte *dest, const Byte *src, unsigned size) -{ - unsigned i; - for (i = 0; i < size; i++) - dest[i] = src[i]; -} - -void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size) -{ - Byte buf[DELTA_STATE_SIZE]; - unsigned j = 0; - MyMemCpy(buf, state, delta); - { - SizeT i; - for (i = 0; i < size;) - { - for (j = 0; j < delta && i < size; i++, j++) - { - Byte b = data[i]; - data[i] = (Byte)(b - buf[j]); - buf[j] = b; - } - } - } - if (j == delta) - j = 0; - MyMemCpy(state, buf + j, delta - j); - MyMemCpy(state + delta - j, buf, j); -} - -void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size) -{ - Byte buf[DELTA_STATE_SIZE]; - unsigned j = 0; - MyMemCpy(buf, state, delta); - { - SizeT i; - for (i = 0; i < size;) - { - for (j = 0; j < delta && i < size; i++, j++) - { - buf[j] = data[i] = (Byte)(buf[j] + data[i]); - } - } - } - if (j == delta) - j = 0; - MyMemCpy(state, buf + j, delta - j); - MyMemCpy(state + delta - j, buf, j); -} diff --git a/jan/src/dep/libs/lib7z/Delta.h b/jan/src/dep/libs/lib7z/Delta.h deleted file mode 100644 index e59d5a252..000000000 --- a/jan/src/dep/libs/lib7z/Delta.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Delta.h -- Delta converter -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __DELTA_H -#define __DELTA_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -#define DELTA_STATE_SIZE 256 - -void Delta_Init(Byte *state); -void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size); -void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/LzFind.c b/jan/src/dep/libs/lib7z/LzFind.c deleted file mode 100644 index c335d363c..000000000 --- a/jan/src/dep/libs/lib7z/LzFind.c +++ /dev/null @@ -1,1044 +0,0 @@ -/* LzFind.c -- Match finder for LZ algorithms -2015-10-15 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include - -#include "LzFind.h" -#include "LzHash.h" - -#define kEmptyHashValue 0 -#define kMaxValForNormalize ((UInt32)0xFFFFFFFF) -#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ -#define kNormalizeMask (~(UInt32)(kNormalizeStepMin - 1)) -#define kMaxHistorySize ((UInt32)7 << 29) - -#define kStartMaxLen 3 - -static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) -{ - if (!p->directInput) - { - alloc->Free(alloc, p->bufferBase); - p->bufferBase = NULL; - } -} - -/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */ - -static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) -{ - UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; - if (p->directInput) - { - p->blockSize = blockSize; - return 1; - } - if (!p->bufferBase || p->blockSize != blockSize) - { - LzInWindow_Free(p, alloc); - p->blockSize = blockSize; - p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize); - } - return (p->bufferBase != NULL); -} - -Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } - -UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } - -void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) -{ - p->posLimit -= subValue; - p->pos -= subValue; - p->streamPos -= subValue; -} - -static void MatchFinder_ReadBlock(CMatchFinder *p) -{ - if (p->streamEndWasReached || p->result != SZ_OK) - return; - - /* We use (p->streamPos - p->pos) value. (p->streamPos < p->pos) is allowed. */ - - if (p->directInput) - { - UInt32 curSize = 0xFFFFFFFF - (p->streamPos - p->pos); - if (curSize > p->directInputRem) - curSize = (UInt32)p->directInputRem; - p->directInputRem -= curSize; - p->streamPos += curSize; - if (p->directInputRem == 0) - p->streamEndWasReached = 1; - return; - } - - for (;;) - { - Byte *dest = p->buffer + (p->streamPos - p->pos); - size_t size = (p->bufferBase + p->blockSize - dest); - if (size == 0) - return; - - p->result = p->stream->Read(p->stream, dest, &size); - if (p->result != SZ_OK) - return; - if (size == 0) - { - p->streamEndWasReached = 1; - return; - } - p->streamPos += (UInt32)size; - if (p->streamPos - p->pos > p->keepSizeAfter) - return; - } -} - -void MatchFinder_MoveBlock(CMatchFinder *p) -{ - memmove(p->bufferBase, - p->buffer - p->keepSizeBefore, - (size_t)(p->streamPos - p->pos) + p->keepSizeBefore); - p->buffer = p->bufferBase + p->keepSizeBefore; -} - -int MatchFinder_NeedMove(CMatchFinder *p) -{ - if (p->directInput) - return 0; - /* if (p->streamEndWasReached) return 0; */ - return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); -} - -void MatchFinder_ReadIfRequired(CMatchFinder *p) -{ - if (p->streamEndWasReached) - return; - if (p->keepSizeAfter >= p->streamPos - p->pos) - MatchFinder_ReadBlock(p); -} - -static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) -{ - if (MatchFinder_NeedMove(p)) - MatchFinder_MoveBlock(p); - MatchFinder_ReadBlock(p); -} - -static void MatchFinder_SetDefaultSettings(CMatchFinder *p) -{ - p->cutValue = 32; - p->btMode = 1; - p->numHashBytes = 4; - p->bigHash = 0; -} - -#define kCrcPoly 0xEDB88320 - -void MatchFinder_Construct(CMatchFinder *p) -{ - UInt32 i; - p->bufferBase = NULL; - p->directInput = 0; - p->hash = NULL; - MatchFinder_SetDefaultSettings(p); - - for (i = 0; i < 256; i++) - { - UInt32 r = i; - unsigned j; - for (j = 0; j < 8; j++) - r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); - p->crc[i] = r; - } -} - -static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->hash); - p->hash = NULL; -} - -void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc) -{ - MatchFinder_FreeThisClassMemory(p, alloc); - LzInWindow_Free(p, alloc); -} - -static CLzRef* AllocRefs(size_t num, ISzAlloc *alloc) -{ - size_t sizeInBytes = (size_t)num * sizeof(CLzRef); - if (sizeInBytes / sizeof(CLzRef) != num) - return NULL; - return (CLzRef *)alloc->Alloc(alloc, sizeInBytes); -} - -int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, - UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, - ISzAlloc *alloc) -{ - UInt32 sizeReserv; - - if (historySize > kMaxHistorySize) - { - MatchFinder_Free(p, alloc); - return 0; - } - - sizeReserv = historySize >> 1; - if (historySize >= ((UInt32)3 << 30)) sizeReserv = historySize >> 3; - else if (historySize >= ((UInt32)2 << 30)) sizeReserv = historySize >> 2; - - sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19); - - p->keepSizeBefore = historySize + keepAddBufferBefore + 1; - p->keepSizeAfter = matchMaxLen + keepAddBufferAfter; - - /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */ - - if (LzInWindow_Create(p, sizeReserv, alloc)) - { - UInt32 newCyclicBufferSize = historySize + 1; - UInt32 hs; - p->matchMaxLen = matchMaxLen; - { - p->fixedHashSize = 0; - if (p->numHashBytes == 2) - hs = (1 << 16) - 1; - else - { - hs = historySize - 1; - hs |= (hs >> 1); - hs |= (hs >> 2); - hs |= (hs >> 4); - hs |= (hs >> 8); - hs >>= 1; - hs |= 0xFFFF; /* don't change it! It's required for Deflate */ - if (hs > (1 << 24)) - { - if (p->numHashBytes == 3) - hs = (1 << 24) - 1; - else - hs >>= 1; - /* if (bigHash) mode, GetHeads4b() in LzFindMt.c needs (hs >= ((1 << 24) - 1))) */ - } - } - p->hashMask = hs; - hs++; - if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size; - if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size; - if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size; - hs += p->fixedHashSize; - } - - { - size_t newSize; - size_t numSons; - p->historySize = historySize; - p->hashSizeSum = hs; - p->cyclicBufferSize = newCyclicBufferSize; - - numSons = newCyclicBufferSize; - if (p->btMode) - numSons <<= 1; - newSize = hs + numSons; - - if (p->hash && p->numRefs == newSize) - return 1; - - MatchFinder_FreeThisClassMemory(p, alloc); - p->numRefs = newSize; - p->hash = AllocRefs(newSize, alloc); - - if (p->hash) - { - p->son = p->hash + p->hashSizeSum; - return 1; - } - } - } - - MatchFinder_Free(p, alloc); - return 0; -} - -static void MatchFinder_SetLimits(CMatchFinder *p) -{ - UInt32 limit = kMaxValForNormalize - p->pos; - UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos; - - if (limit2 < limit) - limit = limit2; - limit2 = p->streamPos - p->pos; - - if (limit2 <= p->keepSizeAfter) - { - if (limit2 > 0) - limit2 = 1; - } - else - limit2 -= p->keepSizeAfter; - - if (limit2 < limit) - limit = limit2; - - { - UInt32 lenLimit = p->streamPos - p->pos; - if (lenLimit > p->matchMaxLen) - lenLimit = p->matchMaxLen; - p->lenLimit = lenLimit; - } - p->posLimit = p->pos + limit; -} - -void MatchFinder_Init_2(CMatchFinder *p, int readData) -{ - UInt32 i; - UInt32 *hash = p->hash; - UInt32 num = p->hashSizeSum; - for (i = 0; i < num; i++) - hash[i] = kEmptyHashValue; - - p->cyclicBufferPos = 0; - p->buffer = p->bufferBase; - p->pos = p->streamPos = p->cyclicBufferSize; - p->result = SZ_OK; - p->streamEndWasReached = 0; - - if (readData) - MatchFinder_ReadBlock(p); - - MatchFinder_SetLimits(p); -} - -void MatchFinder_Init(CMatchFinder *p) -{ - MatchFinder_Init_2(p, True); -} - -static UInt32 MatchFinder_GetSubValue(CMatchFinder *p) -{ - return (p->pos - p->historySize - 1) & kNormalizeMask; -} - -void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems) -{ - size_t i; - for (i = 0; i < numItems; i++) - { - UInt32 value = items[i]; - if (value <= subValue) - value = kEmptyHashValue; - else - value -= subValue; - items[i] = value; - } -} - -static void MatchFinder_Normalize(CMatchFinder *p) -{ - UInt32 subValue = MatchFinder_GetSubValue(p); - MatchFinder_Normalize3(subValue, p->hash, p->numRefs); - MatchFinder_ReduceOffsets(p, subValue); -} - -static void MatchFinder_CheckLimits(CMatchFinder *p) -{ - if (p->pos == kMaxValForNormalize) - MatchFinder_Normalize(p); - if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos) - MatchFinder_CheckAndMoveAndRead(p); - if (p->cyclicBufferPos == p->cyclicBufferSize) - p->cyclicBufferPos = 0; - MatchFinder_SetLimits(p); -} - -static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, - UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, - UInt32 *distances, UInt32 maxLen) -{ - son[_cyclicBufferPos] = curMatch; - for (;;) - { - UInt32 delta = pos - curMatch; - if (cutValue-- == 0 || delta >= _cyclicBufferSize) - return distances; - { - const Byte *pb = cur - delta; - curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; - if (pb[maxLen] == cur[maxLen] && *pb == *cur) - { - UInt32 len = 0; - while (++len != lenLimit) - if (pb[len] != cur[len]) - break; - if (maxLen < len) - { - *distances++ = maxLen = len; - *distances++ = delta - 1; - if (len == lenLimit) - return distances; - } - } - } - } -} - -UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, - UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, - UInt32 *distances, UInt32 maxLen) -{ - CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; - CLzRef *ptr1 = son + (_cyclicBufferPos << 1); - UInt32 len0 = 0, len1 = 0; - for (;;) - { - UInt32 delta = pos - curMatch; - if (cutValue-- == 0 || delta >= _cyclicBufferSize) - { - *ptr0 = *ptr1 = kEmptyHashValue; - return distances; - } - { - CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); - const Byte *pb = cur - delta; - UInt32 len = (len0 < len1 ? len0 : len1); - if (pb[len] == cur[len]) - { - if (++len != lenLimit && pb[len] == cur[len]) - while (++len != lenLimit) - if (pb[len] != cur[len]) - break; - if (maxLen < len) - { - *distances++ = maxLen = len; - *distances++ = delta - 1; - if (len == lenLimit) - { - *ptr1 = pair[0]; - *ptr0 = pair[1]; - return distances; - } - } - } - if (pb[len] < cur[len]) - { - *ptr1 = curMatch; - ptr1 = pair + 1; - curMatch = *ptr1; - len1 = len; - } - else - { - *ptr0 = curMatch; - ptr0 = pair; - curMatch = *ptr0; - len0 = len; - } - } - } -} - -static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, - UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue) -{ - CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; - CLzRef *ptr1 = son + (_cyclicBufferPos << 1); - UInt32 len0 = 0, len1 = 0; - for (;;) - { - UInt32 delta = pos - curMatch; - if (cutValue-- == 0 || delta >= _cyclicBufferSize) - { - *ptr0 = *ptr1 = kEmptyHashValue; - return; - } - { - CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); - const Byte *pb = cur - delta; - UInt32 len = (len0 < len1 ? len0 : len1); - if (pb[len] == cur[len]) - { - while (++len != lenLimit) - if (pb[len] != cur[len]) - break; - { - if (len == lenLimit) - { - *ptr1 = pair[0]; - *ptr0 = pair[1]; - return; - } - } - } - if (pb[len] < cur[len]) - { - *ptr1 = curMatch; - ptr1 = pair + 1; - curMatch = *ptr1; - len1 = len; - } - else - { - *ptr0 = curMatch; - ptr0 = pair; - curMatch = *ptr0; - len0 = len; - } - } - } -} - -#define MOVE_POS \ - ++p->cyclicBufferPos; \ - p->buffer++; \ - if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); - -#define MOVE_POS_RET MOVE_POS return offset; - -static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } - -#define GET_MATCHES_HEADER2(minLen, ret_op) \ - UInt32 lenLimit; UInt32 hv; const Byte *cur; UInt32 curMatch; \ - lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ - cur = p->buffer; - -#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0) -#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue) - -#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue - -#define GET_MATCHES_FOOTER(offset, maxLen) \ - offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \ - distances + offset, maxLen) - distances); MOVE_POS_RET; - -#define SKIP_FOOTER \ - SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; - -#define UPDATE_maxLen { \ - ptrdiff_t diff = (ptrdiff_t)0 - d2; \ - const Byte *c = cur + maxLen; \ - const Byte *lim = cur + lenLimit; \ - for (; c != lim; c++) if (*(c + diff) != *c) break; \ - maxLen = (UInt32)(c - cur); } - -static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -{ - UInt32 offset; - GET_MATCHES_HEADER(2) - HASH2_CALC; - curMatch = p->hash[hv]; - p->hash[hv] = p->pos; - offset = 0; - GET_MATCHES_FOOTER(offset, 1) -} - -UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -{ - UInt32 offset; - GET_MATCHES_HEADER(3) - HASH_ZIP_CALC; - curMatch = p->hash[hv]; - p->hash[hv] = p->pos; - offset = 0; - GET_MATCHES_FOOTER(offset, 2) -} - -static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -{ - UInt32 h2, d2, maxLen, offset, pos; - UInt32 *hash; - GET_MATCHES_HEADER(3) - - HASH3_CALC; - - hash = p->hash; - pos = p->pos; - - d2 = pos - hash[h2]; - - curMatch = hash[kFix3HashSize + hv]; - - hash[h2] = pos; - hash[kFix3HashSize + hv] = pos; - - maxLen = 2; - offset = 0; - - if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) - { - UPDATE_maxLen - distances[0] = maxLen; - distances[1] = d2 - 1; - offset = 2; - if (maxLen == lenLimit) - { - SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); - MOVE_POS_RET; - } - } - - GET_MATCHES_FOOTER(offset, maxLen) -} - -static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -{ - UInt32 h2, h3, d2, d3, maxLen, offset, pos; - UInt32 *hash; - GET_MATCHES_HEADER(4) - - HASH4_CALC; - - hash = p->hash; - pos = p->pos; - - d2 = pos - hash[ h2]; - d3 = pos - hash[kFix3HashSize + h3]; - - curMatch = hash[kFix4HashSize + hv]; - - hash[ h2] = pos; - hash[kFix3HashSize + h3] = pos; - hash[kFix4HashSize + hv] = pos; - - maxLen = 0; - offset = 0; - - if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) - { - distances[0] = maxLen = 2; - distances[1] = d2 - 1; - offset = 2; - } - - if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur) - { - maxLen = 3; - distances[offset + 1] = d3 - 1; - offset += 2; - d2 = d3; - } - - if (offset != 0) - { - UPDATE_maxLen - distances[offset - 2] = maxLen; - if (maxLen == lenLimit) - { - SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); - MOVE_POS_RET; - } - } - - if (maxLen < 3) - maxLen = 3; - - GET_MATCHES_FOOTER(offset, maxLen) -} - -/* -static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -{ - UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos; - UInt32 *hash; - GET_MATCHES_HEADER(5) - - HASH5_CALC; - - hash = p->hash; - pos = p->pos; - - d2 = pos - hash[ h2]; - d3 = pos - hash[kFix3HashSize + h3]; - d4 = pos - hash[kFix4HashSize + h4]; - - curMatch = hash[kFix5HashSize + hv]; - - hash[ h2] = pos; - hash[kFix3HashSize + h3] = pos; - hash[kFix4HashSize + h4] = pos; - hash[kFix5HashSize + hv] = pos; - - maxLen = 0; - offset = 0; - - if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) - { - distances[0] = maxLen = 2; - distances[1] = d2 - 1; - offset = 2; - if (*(cur - d2 + 2) == cur[2]) - distances[0] = maxLen = 3; - else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur) - { - distances[2] = maxLen = 3; - distances[3] = d3 - 1; - offset = 4; - d2 = d3; - } - } - else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur) - { - distances[0] = maxLen = 3; - distances[1] = d3 - 1; - offset = 2; - d2 = d3; - } - - if (d2 != d4 && d4 < p->cyclicBufferSize - && *(cur - d4) == *cur - && *(cur - d4 + 3) == *(cur + 3)) - { - maxLen = 4; - distances[offset + 1] = d4 - 1; - offset += 2; - d2 = d4; - } - - if (offset != 0) - { - UPDATE_maxLen - distances[offset - 2] = maxLen; - if (maxLen == lenLimit) - { - SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); - MOVE_POS_RET; - } - } - - if (maxLen < 4) - maxLen = 4; - - GET_MATCHES_FOOTER(offset, maxLen) -} -*/ - -static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -{ - UInt32 h2, h3, d2, d3, maxLen, offset, pos; - UInt32 *hash; - GET_MATCHES_HEADER(4) - - HASH4_CALC; - - hash = p->hash; - pos = p->pos; - - d2 = pos - hash[ h2]; - d3 = pos - hash[kFix3HashSize + h3]; - - curMatch = hash[kFix4HashSize + hv]; - - hash[ h2] = pos; - hash[kFix3HashSize + h3] = pos; - hash[kFix4HashSize + hv] = pos; - - maxLen = 0; - offset = 0; - - if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) - { - distances[0] = maxLen = 2; - distances[1] = d2 - 1; - offset = 2; - } - - if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur) - { - maxLen = 3; - distances[offset + 1] = d3 - 1; - offset += 2; - d2 = d3; - } - - if (offset != 0) - { - UPDATE_maxLen - distances[offset - 2] = maxLen; - if (maxLen == lenLimit) - { - p->son[p->cyclicBufferPos] = curMatch; - MOVE_POS_RET; - } - } - - if (maxLen < 3) - maxLen = 3; - - offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), - distances + offset, maxLen) - (distances)); - MOVE_POS_RET -} - -/* -static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -{ - UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos - UInt32 *hash; - GET_MATCHES_HEADER(5) - - HASH5_CALC; - - hash = p->hash; - pos = p->pos; - - d2 = pos - hash[ h2]; - d3 = pos - hash[kFix3HashSize + h3]; - d4 = pos - hash[kFix4HashSize + h4]; - - curMatch = hash[kFix5HashSize + hv]; - - hash[ h2] = pos; - hash[kFix3HashSize + h3] = pos; - hash[kFix4HashSize + h4] = pos; - hash[kFix5HashSize + hv] = pos; - - maxLen = 0; - offset = 0; - - if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) - { - distances[0] = maxLen = 2; - distances[1] = d2 - 1; - offset = 2; - if (*(cur - d2 + 2) == cur[2]) - distances[0] = maxLen = 3; - else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur) - { - distances[2] = maxLen = 3; - distances[3] = d3 - 1; - offset = 4; - d2 = d3; - } - } - else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur) - { - distances[0] = maxLen = 3; - distances[1] = d3 - 1; - offset = 2; - d2 = d3; - } - - if (d2 != d4 && d4 < p->cyclicBufferSize - && *(cur - d4) == *cur - && *(cur - d4 + 3) == *(cur + 3)) - { - maxLen = 4; - distances[offset + 1] = d4 - 1; - offset += 2; - d2 = d4; - } - - if (offset != 0) - { - UPDATE_maxLen - distances[offset - 2] = maxLen; - if (maxLen == lenLimit) - { - p->son[p->cyclicBufferPos] = curMatch; - MOVE_POS_RET; - } - } - - if (maxLen < 4) - maxLen = 4; - - offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), - distances + offset, maxLen) - (distances)); - MOVE_POS_RET -} -*/ - -UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -{ - UInt32 offset; - GET_MATCHES_HEADER(3) - HASH_ZIP_CALC; - curMatch = p->hash[hv]; - p->hash[hv] = p->pos; - offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), - distances, 2) - (distances)); - MOVE_POS_RET -} - -static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -{ - do - { - SKIP_HEADER(2) - HASH2_CALC; - curMatch = p->hash[hv]; - p->hash[hv] = p->pos; - SKIP_FOOTER - } - while (--num != 0); -} - -void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -{ - do - { - SKIP_HEADER(3) - HASH_ZIP_CALC; - curMatch = p->hash[hv]; - p->hash[hv] = p->pos; - SKIP_FOOTER - } - while (--num != 0); -} - -static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -{ - do - { - UInt32 h2; - UInt32 *hash; - SKIP_HEADER(3) - HASH3_CALC; - hash = p->hash; - curMatch = hash[kFix3HashSize + hv]; - hash[h2] = - hash[kFix3HashSize + hv] = p->pos; - SKIP_FOOTER - } - while (--num != 0); -} - -static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -{ - do - { - UInt32 h2, h3; - UInt32 *hash; - SKIP_HEADER(4) - HASH4_CALC; - hash = p->hash; - curMatch = hash[kFix4HashSize + hv]; - hash[ h2] = - hash[kFix3HashSize + h3] = - hash[kFix4HashSize + hv] = p->pos; - SKIP_FOOTER - } - while (--num != 0); -} - -/* -static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -{ - do - { - UInt32 h2, h3, h4; - UInt32 *hash; - SKIP_HEADER(5) - HASH5_CALC; - hash = p->hash; - curMatch = hash[kFix5HashSize + hv]; - hash[ h2] = - hash[kFix3HashSize + h3] = - hash[kFix4HashSize + h4] = - hash[kFix5HashSize + hv] = p->pos; - SKIP_FOOTER - } - while (--num != 0); -} -*/ - -static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -{ - do - { - UInt32 h2, h3; - UInt32 *hash; - SKIP_HEADER(4) - HASH4_CALC; - hash = p->hash; - curMatch = hash[kFix4HashSize + hv]; - hash[ h2] = - hash[kFix3HashSize + h3] = - hash[kFix4HashSize + hv] = p->pos; - p->son[p->cyclicBufferPos] = curMatch; - MOVE_POS - } - while (--num != 0); -} - -/* -static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -{ - do - { - UInt32 h2, h3, h4; - UInt32 *hash; - SKIP_HEADER(5) - HASH5_CALC; - hash = p->hash; - curMatch = p->hash[kFix5HashSize + hv]; - hash[ h2] = - hash[kFix3HashSize + h3] = - hash[kFix4HashSize + h4] = - hash[kFix5HashSize + hv] = p->pos; - p->son[p->cyclicBufferPos] = curMatch; - MOVE_POS - } - while (--num != 0); -} -*/ - -void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -{ - do - { - SKIP_HEADER(3) - HASH_ZIP_CALC; - curMatch = p->hash[hv]; - p->hash[hv] = p->pos; - p->son[p->cyclicBufferPos] = curMatch; - MOVE_POS - } - while (--num != 0); -} - -void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) -{ - vTable->Init = (Mf_Init_Func)MatchFinder_Init; - vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; - vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; - if (!p->btMode) - { - /* if (p->numHashBytes <= 4) */ - { - vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; - } - /* - else - { - vTable->GetMatches = (Mf_GetMatches_Func)Hc5_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Hc5_MatchFinder_Skip; - } - */ - } - else if (p->numHashBytes == 2) - { - vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; - } - else if (p->numHashBytes == 3) - { - vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; - } - else /* if (p->numHashBytes == 4) */ - { - vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; - } - /* - else - { - vTable->GetMatches = (Mf_GetMatches_Func)Bt5_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Bt5_MatchFinder_Skip; - } - */ -} diff --git a/jan/src/dep/libs/lib7z/LzFind.h b/jan/src/dep/libs/lib7z/LzFind.h deleted file mode 100644 index 2ff667377..000000000 --- a/jan/src/dep/libs/lib7z/LzFind.h +++ /dev/null @@ -1,117 +0,0 @@ -/* LzFind.h -- Match finder for LZ algorithms -2015-10-15 : Igor Pavlov : Public domain */ - -#ifndef __LZ_FIND_H -#define __LZ_FIND_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -typedef UInt32 CLzRef; - -typedef struct _CMatchFinder -{ - Byte *buffer; - UInt32 pos; - UInt32 posLimit; - UInt32 streamPos; - UInt32 lenLimit; - - UInt32 cyclicBufferPos; - UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */ - - Byte streamEndWasReached; - Byte btMode; - Byte bigHash; - Byte directInput; - - UInt32 matchMaxLen; - CLzRef *hash; - CLzRef *son; - UInt32 hashMask; - UInt32 cutValue; - - Byte *bufferBase; - ISeqInStream *stream; - - UInt32 blockSize; - UInt32 keepSizeBefore; - UInt32 keepSizeAfter; - - UInt32 numHashBytes; - size_t directInputRem; - UInt32 historySize; - UInt32 fixedHashSize; - UInt32 hashSizeSum; - SRes result; - UInt32 crc[256]; - size_t numRefs; -} CMatchFinder; - -#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer) - -#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) - -#define Inline_MatchFinder_IsFinishedOK(p) \ - ((p)->streamEndWasReached \ - && (p)->streamPos == (p)->pos \ - && (!(p)->directInput || (p)->directInputRem == 0)) - -int MatchFinder_NeedMove(CMatchFinder *p); -Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); -void MatchFinder_MoveBlock(CMatchFinder *p); -void MatchFinder_ReadIfRequired(CMatchFinder *p); - -void MatchFinder_Construct(CMatchFinder *p); - -/* Conditions: - historySize <= 3 GB - keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB -*/ -int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, - UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, - ISzAlloc *alloc); -void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); -void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems); -void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); - -UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, - UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, - UInt32 *distances, UInt32 maxLen); - -/* -Conditions: - Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. - Mf_GetPointerToCurrentPos_Func's result must be used only before any other function -*/ - -typedef void (*Mf_Init_Func)(void *object); -typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object); -typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object); -typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances); -typedef void (*Mf_Skip_Func)(void *object, UInt32); - -typedef struct _IMatchFinder -{ - Mf_Init_Func Init; - Mf_GetNumAvailableBytes_Func GetNumAvailableBytes; - Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos; - Mf_GetMatches_Func GetMatches; - Mf_Skip_Func Skip; -} IMatchFinder; - -void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); - -void MatchFinder_Init_2(CMatchFinder *p, int readData); -void MatchFinder_Init(CMatchFinder *p); - -UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); -UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); - -void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); -void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/LzFindMt.c b/jan/src/dep/libs/lib7z/LzFindMt.c deleted file mode 100644 index cb61e0953..000000000 --- a/jan/src/dep/libs/lib7z/LzFindMt.c +++ /dev/null @@ -1,803 +0,0 @@ -/* LzFindMt.c -- multithreaded Match finder for LZ algorithms -2015-10-15 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "LzHash.h" - -#include "LzFindMt.h" - -static void MtSync_Construct(CMtSync *p) -{ - p->wasCreated = False; - p->csWasInitialized = False; - p->csWasEntered = False; - Thread_Construct(&p->thread); - Event_Construct(&p->canStart); - Event_Construct(&p->wasStarted); - Event_Construct(&p->wasStopped); - Semaphore_Construct(&p->freeSemaphore); - Semaphore_Construct(&p->filledSemaphore); -} - -static void MtSync_GetNextBlock(CMtSync *p) -{ - if (p->needStart) - { - p->numProcessedBlocks = 1; - p->needStart = False; - p->stopWriting = False; - p->exit = False; - Event_Reset(&p->wasStarted); - Event_Reset(&p->wasStopped); - - Event_Set(&p->canStart); - Event_Wait(&p->wasStarted); - } - else - { - CriticalSection_Leave(&p->cs); - p->csWasEntered = False; - p->numProcessedBlocks++; - Semaphore_Release1(&p->freeSemaphore); - } - Semaphore_Wait(&p->filledSemaphore); - CriticalSection_Enter(&p->cs); - p->csWasEntered = True; -} - -/* MtSync_StopWriting must be called if Writing was started */ - -static void MtSync_StopWriting(CMtSync *p) -{ - UInt32 myNumBlocks = p->numProcessedBlocks; - if (!Thread_WasCreated(&p->thread) || p->needStart) - return; - p->stopWriting = True; - if (p->csWasEntered) - { - CriticalSection_Leave(&p->cs); - p->csWasEntered = False; - } - Semaphore_Release1(&p->freeSemaphore); - - Event_Wait(&p->wasStopped); - - while (myNumBlocks++ != p->numProcessedBlocks) - { - Semaphore_Wait(&p->filledSemaphore); - Semaphore_Release1(&p->freeSemaphore); - } - p->needStart = True; -} - -static void MtSync_Destruct(CMtSync *p) -{ - if (Thread_WasCreated(&p->thread)) - { - MtSync_StopWriting(p); - p->exit = True; - if (p->needStart) - Event_Set(&p->canStart); - Thread_Wait(&p->thread); - Thread_Close(&p->thread); - } - if (p->csWasInitialized) - { - CriticalSection_Delete(&p->cs); - p->csWasInitialized = False; - } - - Event_Close(&p->canStart); - Event_Close(&p->wasStarted); - Event_Close(&p->wasStopped); - Semaphore_Close(&p->freeSemaphore); - Semaphore_Close(&p->filledSemaphore); - - p->wasCreated = False; -} - -#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; } - -static SRes MtSync_Create2(CMtSync *p, THREAD_FUNC_TYPE startAddress, void *obj, UInt32 numBlocks) -{ - if (p->wasCreated) - return SZ_OK; - - RINOK_THREAD(CriticalSection_Init(&p->cs)); - p->csWasInitialized = True; - - RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canStart)); - RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStarted)); - RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStopped)); - - RINOK_THREAD(Semaphore_Create(&p->freeSemaphore, numBlocks, numBlocks)); - RINOK_THREAD(Semaphore_Create(&p->filledSemaphore, 0, numBlocks)); - - p->needStart = True; - - RINOK_THREAD(Thread_Create(&p->thread, startAddress, obj)); - p->wasCreated = True; - return SZ_OK; -} - -static SRes MtSync_Create(CMtSync *p, THREAD_FUNC_TYPE startAddress, void *obj, UInt32 numBlocks) -{ - SRes res = MtSync_Create2(p, startAddress, obj, numBlocks); - if (res != SZ_OK) - MtSync_Destruct(p); - return res; -} - -void MtSync_Init(CMtSync *p) { p->needStart = True; } - -#define kMtMaxValForNormalize 0xFFFFFFFF - -#define DEF_GetHeads2(name, v, action) \ - static void GetHeads ## name(const Byte *p, UInt32 pos, \ - UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc) \ - { action; for (; numHeads != 0; numHeads--) { \ - const UInt32 value = (v); p++; *heads++ = pos - hash[value]; hash[value] = pos++; } } - -#define DEF_GetHeads(name, v) DEF_GetHeads2(name, v, ;) - -DEF_GetHeads2(2, (p[0] | ((UInt32)p[1] << 8)), UNUSED_VAR(hashMask); UNUSED_VAR(crc); ) -DEF_GetHeads(3, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8)) & hashMask) -DEF_GetHeads(4, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5)) & hashMask) -DEF_GetHeads(4b, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ ((UInt32)p[3] << 16)) & hashMask) -/* DEF_GetHeads(5, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5) ^ (crc[p[4]] << 3)) & hashMask) */ - -static void HashThreadFunc(CMatchFinderMt *mt) -{ - CMtSync *p = &mt->hashSync; - for (;;) - { - UInt32 numProcessedBlocks = 0; - Event_Wait(&p->canStart); - Event_Set(&p->wasStarted); - for (;;) - { - if (p->exit) - return; - if (p->stopWriting) - { - p->numProcessedBlocks = numProcessedBlocks; - Event_Set(&p->wasStopped); - break; - } - - { - CMatchFinder *mf = mt->MatchFinder; - if (MatchFinder_NeedMove(mf)) - { - CriticalSection_Enter(&mt->btSync.cs); - CriticalSection_Enter(&mt->hashSync.cs); - { - const Byte *beforePtr = Inline_MatchFinder_GetPointerToCurrentPos(mf); - ptrdiff_t offset; - MatchFinder_MoveBlock(mf); - offset = beforePtr - Inline_MatchFinder_GetPointerToCurrentPos(mf); - mt->pointerToCurPos -= offset; - mt->buffer -= offset; - } - CriticalSection_Leave(&mt->btSync.cs); - CriticalSection_Leave(&mt->hashSync.cs); - continue; - } - - Semaphore_Wait(&p->freeSemaphore); - - MatchFinder_ReadIfRequired(mf); - if (mf->pos > (kMtMaxValForNormalize - kMtHashBlockSize)) - { - UInt32 subValue = (mf->pos - mf->historySize - 1); - MatchFinder_ReduceOffsets(mf, subValue); - MatchFinder_Normalize3(subValue, mf->hash + mf->fixedHashSize, (size_t)mf->hashMask + 1); - } - { - UInt32 *heads = mt->hashBuf + ((numProcessedBlocks++) & kMtHashNumBlocksMask) * kMtHashBlockSize; - UInt32 num = mf->streamPos - mf->pos; - heads[0] = 2; - heads[1] = num; - if (num >= mf->numHashBytes) - { - num = num - mf->numHashBytes + 1; - if (num > kMtHashBlockSize - 2) - num = kMtHashBlockSize - 2; - mt->GetHeadsFunc(mf->buffer, mf->pos, mf->hash + mf->fixedHashSize, mf->hashMask, heads + 2, num, mf->crc); - heads[0] += num; - } - mf->pos += num; - mf->buffer += num; - } - } - - Semaphore_Release1(&p->filledSemaphore); - } - } -} - -static void MatchFinderMt_GetNextBlock_Hash(CMatchFinderMt *p) -{ - MtSync_GetNextBlock(&p->hashSync); - p->hashBufPosLimit = p->hashBufPos = ((p->hashSync.numProcessedBlocks - 1) & kMtHashNumBlocksMask) * kMtHashBlockSize; - p->hashBufPosLimit += p->hashBuf[p->hashBufPos++]; - p->hashNumAvail = p->hashBuf[p->hashBufPos++]; -} - -#define kEmptyHashValue 0 - -/* #define MFMT_GM_INLINE */ - -#ifdef MFMT_GM_INLINE - -#define NO_INLINE MY_FAST_CALL - -static Int32 NO_INLINE GetMatchesSpecN(UInt32 lenLimit, UInt32 pos, const Byte *cur, CLzRef *son, - UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, - UInt32 *_distances, UInt32 _maxLen, const UInt32 *hash, Int32 limit, UInt32 size, UInt32 *posRes) -{ - do - { - UInt32 *distances = _distances + 1; - UInt32 curMatch = pos - *hash++; - - CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; - CLzRef *ptr1 = son + (_cyclicBufferPos << 1); - UInt32 len0 = 0, len1 = 0; - UInt32 cutValue = _cutValue; - UInt32 maxLen = _maxLen; - for (;;) - { - UInt32 delta = pos - curMatch; - if (cutValue-- == 0 || delta >= _cyclicBufferSize) - { - *ptr0 = *ptr1 = kEmptyHashValue; - break; - } - { - CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); - const Byte *pb = cur - delta; - UInt32 len = (len0 < len1 ? len0 : len1); - if (pb[len] == cur[len]) - { - if (++len != lenLimit && pb[len] == cur[len]) - while (++len != lenLimit) - if (pb[len] != cur[len]) - break; - if (maxLen < len) - { - *distances++ = maxLen = len; - *distances++ = delta - 1; - if (len == lenLimit) - { - *ptr1 = pair[0]; - *ptr0 = pair[1]; - break; - } - } - } - if (pb[len] < cur[len]) - { - *ptr1 = curMatch; - ptr1 = pair + 1; - curMatch = *ptr1; - len1 = len; - } - else - { - *ptr0 = curMatch; - ptr0 = pair; - curMatch = *ptr0; - len0 = len; - } - } - } - pos++; - _cyclicBufferPos++; - cur++; - { - UInt32 num = (UInt32)(distances - _distances); - *_distances = num - 1; - _distances += num; - limit -= num; - } - } - while (limit > 0 && --size != 0); - *posRes = pos; - return limit; -} - -#endif - -static void BtGetMatches(CMatchFinderMt *p, UInt32 *distances) -{ - UInt32 numProcessed = 0; - UInt32 curPos = 2; - UInt32 limit = kMtBtBlockSize - (p->matchMaxLen * 2); - - distances[1] = p->hashNumAvail; - - while (curPos < limit) - { - if (p->hashBufPos == p->hashBufPosLimit) - { - MatchFinderMt_GetNextBlock_Hash(p); - distances[1] = numProcessed + p->hashNumAvail; - if (p->hashNumAvail >= p->numHashBytes) - continue; - distances[0] = curPos + p->hashNumAvail; - distances += curPos; - for (; p->hashNumAvail != 0; p->hashNumAvail--) - *distances++ = 0; - return; - } - { - UInt32 size = p->hashBufPosLimit - p->hashBufPos; - UInt32 lenLimit = p->matchMaxLen; - UInt32 pos = p->pos; - UInt32 cyclicBufferPos = p->cyclicBufferPos; - if (lenLimit >= p->hashNumAvail) - lenLimit = p->hashNumAvail; - { - UInt32 size2 = p->hashNumAvail - lenLimit + 1; - if (size2 < size) - size = size2; - size2 = p->cyclicBufferSize - cyclicBufferPos; - if (size2 < size) - size = size2; - } - - #ifndef MFMT_GM_INLINE - while (curPos < limit && size-- != 0) - { - UInt32 *startDistances = distances + curPos; - UInt32 num = (UInt32)(GetMatchesSpec1(lenLimit, pos - p->hashBuf[p->hashBufPos++], - pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, - startDistances + 1, p->numHashBytes - 1) - startDistances); - *startDistances = num - 1; - curPos += num; - cyclicBufferPos++; - pos++; - p->buffer++; - } - #else - { - UInt32 posRes; - curPos = limit - GetMatchesSpecN(lenLimit, pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, - distances + curPos, p->numHashBytes - 1, p->hashBuf + p->hashBufPos, (Int32)(limit - curPos), size, &posRes); - p->hashBufPos += posRes - pos; - cyclicBufferPos += posRes - pos; - p->buffer += posRes - pos; - pos = posRes; - } - #endif - - numProcessed += pos - p->pos; - p->hashNumAvail -= pos - p->pos; - p->pos = pos; - if (cyclicBufferPos == p->cyclicBufferSize) - cyclicBufferPos = 0; - p->cyclicBufferPos = cyclicBufferPos; - } - } - - distances[0] = curPos; -} - -static void BtFillBlock(CMatchFinderMt *p, UInt32 globalBlockIndex) -{ - CMtSync *sync = &p->hashSync; - if (!sync->needStart) - { - CriticalSection_Enter(&sync->cs); - sync->csWasEntered = True; - } - - BtGetMatches(p, p->btBuf + (globalBlockIndex & kMtBtNumBlocksMask) * kMtBtBlockSize); - - if (p->pos > kMtMaxValForNormalize - kMtBtBlockSize) - { - UInt32 subValue = p->pos - p->cyclicBufferSize; - MatchFinder_Normalize3(subValue, p->son, (size_t)p->cyclicBufferSize * 2); - p->pos -= subValue; - } - - if (!sync->needStart) - { - CriticalSection_Leave(&sync->cs); - sync->csWasEntered = False; - } -} - -void BtThreadFunc(CMatchFinderMt *mt) -{ - CMtSync *p = &mt->btSync; - for (;;) - { - UInt32 blockIndex = 0; - Event_Wait(&p->canStart); - Event_Set(&p->wasStarted); - for (;;) - { - if (p->exit) - return; - if (p->stopWriting) - { - p->numProcessedBlocks = blockIndex; - MtSync_StopWriting(&mt->hashSync); - Event_Set(&p->wasStopped); - break; - } - Semaphore_Wait(&p->freeSemaphore); - BtFillBlock(mt, blockIndex++); - Semaphore_Release1(&p->filledSemaphore); - } - } -} - -void MatchFinderMt_Construct(CMatchFinderMt *p) -{ - p->hashBuf = NULL; - MtSync_Construct(&p->hashSync); - MtSync_Construct(&p->btSync); -} - -static void MatchFinderMt_FreeMem(CMatchFinderMt *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->hashBuf); - p->hashBuf = NULL; -} - -void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc) -{ - MtSync_Destruct(&p->hashSync); - MtSync_Destruct(&p->btSync); - MatchFinderMt_FreeMem(p, alloc); -} - -#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks) -#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks) - -static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; } -static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE BtThreadFunc2(void *p) -{ - Byte allocaDummy[0x180]; - unsigned i = 0; - for (i = 0; i < 16; i++) - allocaDummy[i] = (Byte)0; - if (allocaDummy[0] == 0) - BtThreadFunc((CMatchFinderMt *)p); - return 0; -} - -SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, - UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc) -{ - CMatchFinder *mf = p->MatchFinder; - p->historySize = historySize; - if (kMtBtBlockSize <= matchMaxLen * 4) - return SZ_ERROR_PARAM; - if (!p->hashBuf) - { - p->hashBuf = (UInt32 *)alloc->Alloc(alloc, (kHashBufferSize + kBtBufferSize) * sizeof(UInt32)); - if (!p->hashBuf) - return SZ_ERROR_MEM; - p->btBuf = p->hashBuf + kHashBufferSize; - } - keepAddBufferBefore += (kHashBufferSize + kBtBufferSize); - keepAddBufferAfter += kMtHashBlockSize; - if (!MatchFinder_Create(mf, historySize, keepAddBufferBefore, matchMaxLen, keepAddBufferAfter, alloc)) - return SZ_ERROR_MEM; - - RINOK(MtSync_Create(&p->hashSync, HashThreadFunc2, p, kMtHashNumBlocks)); - RINOK(MtSync_Create(&p->btSync, BtThreadFunc2, p, kMtBtNumBlocks)); - return SZ_OK; -} - -/* Call it after ReleaseStream / SetStream */ -void MatchFinderMt_Init(CMatchFinderMt *p) -{ - CMatchFinder *mf = p->MatchFinder; - p->btBufPos = p->btBufPosLimit = 0; - p->hashBufPos = p->hashBufPosLimit = 0; - - /* Init without data reading. We don't want to read data in this thread */ - MatchFinder_Init_2(mf, False); - - p->pointerToCurPos = Inline_MatchFinder_GetPointerToCurrentPos(mf); - p->btNumAvailBytes = 0; - p->lzPos = p->historySize + 1; - - p->hash = mf->hash; - p->fixedHashSize = mf->fixedHashSize; - p->crc = mf->crc; - - p->son = mf->son; - p->matchMaxLen = mf->matchMaxLen; - p->numHashBytes = mf->numHashBytes; - p->pos = mf->pos; - p->buffer = mf->buffer; - p->cyclicBufferPos = mf->cyclicBufferPos; - p->cyclicBufferSize = mf->cyclicBufferSize; - p->cutValue = mf->cutValue; -} - -/* ReleaseStream is required to finish multithreading */ -void MatchFinderMt_ReleaseStream(CMatchFinderMt *p) -{ - MtSync_StopWriting(&p->btSync); - /* p->MatchFinder->ReleaseStream(); */ -} - -static void MatchFinderMt_Normalize(CMatchFinderMt *p) -{ - MatchFinder_Normalize3(p->lzPos - p->historySize - 1, p->hash, p->fixedHashSize); - p->lzPos = p->historySize + 1; -} - -static void MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p) -{ - UInt32 blockIndex; - MtSync_GetNextBlock(&p->btSync); - blockIndex = ((p->btSync.numProcessedBlocks - 1) & kMtBtNumBlocksMask); - p->btBufPosLimit = p->btBufPos = blockIndex * kMtBtBlockSize; - p->btBufPosLimit += p->btBuf[p->btBufPos++]; - p->btNumAvailBytes = p->btBuf[p->btBufPos++]; - if (p->lzPos >= kMtMaxValForNormalize - kMtBtBlockSize) - MatchFinderMt_Normalize(p); -} - -static const Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p) -{ - return p->pointerToCurPos; -} - -#define GET_NEXT_BLOCK_IF_REQUIRED if (p->btBufPos == p->btBufPosLimit) MatchFinderMt_GetNextBlock_Bt(p); - -static UInt32 MatchFinderMt_GetNumAvailableBytes(CMatchFinderMt *p) -{ - GET_NEXT_BLOCK_IF_REQUIRED; - return p->btNumAvailBytes; -} - -static UInt32 * MixMatches2(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) -{ - UInt32 h2, curMatch2; - UInt32 *hash = p->hash; - const Byte *cur = p->pointerToCurPos; - UInt32 lzPos = p->lzPos; - MT_HASH2_CALC - - curMatch2 = hash[h2]; - hash[h2] = lzPos; - - if (curMatch2 >= matchMinPos) - if (cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) - { - *distances++ = 2; - *distances++ = lzPos - curMatch2 - 1; - } - - return distances; -} - -static UInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) -{ - UInt32 h2, h3, curMatch2, curMatch3; - UInt32 *hash = p->hash; - const Byte *cur = p->pointerToCurPos; - UInt32 lzPos = p->lzPos; - MT_HASH3_CALC - - curMatch2 = hash[ h2]; - curMatch3 = hash[kFix3HashSize + h3]; - - hash[ h2] = lzPos; - hash[kFix3HashSize + h3] = lzPos; - - if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) - { - distances[1] = lzPos - curMatch2 - 1; - if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) - { - distances[0] = 3; - return distances + 2; - } - distances[0] = 2; - distances += 2; - } - - if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) - { - *distances++ = 3; - *distances++ = lzPos - curMatch3 - 1; - } - - return distances; -} - -/* -static UInt32 *MixMatches4(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) -{ - UInt32 h2, h3, h4, curMatch2, curMatch3, curMatch4; - UInt32 *hash = p->hash; - const Byte *cur = p->pointerToCurPos; - UInt32 lzPos = p->lzPos; - MT_HASH4_CALC - - curMatch2 = hash[ h2]; - curMatch3 = hash[kFix3HashSize + h3]; - curMatch4 = hash[kFix4HashSize + h4]; - - hash[ h2] = lzPos; - hash[kFix3HashSize + h3] = lzPos; - hash[kFix4HashSize + h4] = lzPos; - - if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) - { - distances[1] = lzPos - curMatch2 - 1; - if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) - { - distances[0] = (cur[(ptrdiff_t)curMatch2 - lzPos + 3] == cur[3]) ? 4 : 3; - return distances + 2; - } - distances[0] = 2; - distances += 2; - } - - if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) - { - distances[1] = lzPos - curMatch3 - 1; - if (cur[(ptrdiff_t)curMatch3 - lzPos + 3] == cur[3]) - { - distances[0] = 4; - return distances + 2; - } - distances[0] = 3; - distances += 2; - } - - if (curMatch4 >= matchMinPos) - if ( - cur[(ptrdiff_t)curMatch4 - lzPos] == cur[0] && - cur[(ptrdiff_t)curMatch4 - lzPos + 3] == cur[3] - ) - { - *distances++ = 4; - *distances++ = lzPos - curMatch4 - 1; - } - - return distances; -} -*/ - -#define INCREASE_LZ_POS p->lzPos++; p->pointerToCurPos++; - -static UInt32 MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *distances) -{ - const UInt32 *btBuf = p->btBuf + p->btBufPos; - UInt32 len = *btBuf++; - p->btBufPos += 1 + len; - p->btNumAvailBytes--; - { - UInt32 i; - for (i = 0; i < len; i += 2) - { - *distances++ = *btBuf++; - *distances++ = *btBuf++; - } - } - INCREASE_LZ_POS - return len; -} - -static UInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances) -{ - const UInt32 *btBuf = p->btBuf + p->btBufPos; - UInt32 len = *btBuf++; - p->btBufPos += 1 + len; - - if (len == 0) - { - /* change for bt5 ! */ - if (p->btNumAvailBytes-- >= 4) - len = (UInt32)(p->MixMatchesFunc(p, p->lzPos - p->historySize, distances) - (distances)); - } - else - { - /* Condition: there are matches in btBuf with length < p->numHashBytes */ - UInt32 *distances2; - p->btNumAvailBytes--; - distances2 = p->MixMatchesFunc(p, p->lzPos - btBuf[1], distances); - do - { - *distances2++ = *btBuf++; - *distances2++ = *btBuf++; - } - while ((len -= 2) != 0); - len = (UInt32)(distances2 - (distances)); - } - INCREASE_LZ_POS - return len; -} - -#define SKIP_HEADER2_MT do { GET_NEXT_BLOCK_IF_REQUIRED -#define SKIP_HEADER_MT(n) SKIP_HEADER2_MT if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash; -#define SKIP_FOOTER_MT } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0); - -static void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num) -{ - SKIP_HEADER2_MT { p->btNumAvailBytes--; - SKIP_FOOTER_MT -} - -static void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num) -{ - SKIP_HEADER_MT(2) - UInt32 h2; - MT_HASH2_CALC - hash[h2] = p->lzPos; - SKIP_FOOTER_MT -} - -static void MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num) -{ - SKIP_HEADER_MT(3) - UInt32 h2, h3; - MT_HASH3_CALC - hash[kFix3HashSize + h3] = - hash[ h2] = - p->lzPos; - SKIP_FOOTER_MT -} - -/* -static void MatchFinderMt4_Skip(CMatchFinderMt *p, UInt32 num) -{ - SKIP_HEADER_MT(4) - UInt32 h2, h3, h4; - MT_HASH4_CALC - hash[kFix4HashSize + h4] = - hash[kFix3HashSize + h3] = - hash[ h2] = - p->lzPos; - SKIP_FOOTER_MT -} -*/ - -void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable) -{ - vTable->Init = (Mf_Init_Func)MatchFinderMt_Init; - vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinderMt_GetNumAvailableBytes; - vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinderMt_GetPointerToCurrentPos; - vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches; - - switch (p->MatchFinder->numHashBytes) - { - case 2: - p->GetHeadsFunc = GetHeads2; - p->MixMatchesFunc = (Mf_Mix_Matches)0; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt0_Skip; - vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt2_GetMatches; - break; - case 3: - p->GetHeadsFunc = GetHeads3; - p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches2; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt2_Skip; - break; - default: - /* case 4: */ - p->GetHeadsFunc = p->MatchFinder->bigHash ? GetHeads4b : GetHeads4; - p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches3; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt3_Skip; - break; - /* - default: - p->GetHeadsFunc = GetHeads5; - p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches4; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt4_Skip; - break; - */ - } -} diff --git a/jan/src/dep/libs/lib7z/LzFindMt.h b/jan/src/dep/libs/lib7z/LzFindMt.h deleted file mode 100644 index 46b6924ad..000000000 --- a/jan/src/dep/libs/lib7z/LzFindMt.h +++ /dev/null @@ -1,101 +0,0 @@ -/* LzFindMt.h -- multithreaded Match finder for LZ algorithms -2015-05-03 : Igor Pavlov : Public domain */ - -#ifndef __LZ_FIND_MT_H -#define __LZ_FIND_MT_H - -#include "LzFind.h" -#include "Threads.h" - -EXTERN_C_BEGIN - -#define kMtHashBlockSize (1 << 13) -#define kMtHashNumBlocks (1 << 3) -#define kMtHashNumBlocksMask (kMtHashNumBlocks - 1) - -#define kMtBtBlockSize (1 << 14) -#define kMtBtNumBlocks (1 << 6) -#define kMtBtNumBlocksMask (kMtBtNumBlocks - 1) - -typedef struct _CMtSync -{ - Bool wasCreated; - Bool needStart; - Bool exit; - Bool stopWriting; - - CThread thread; - CAutoResetEvent canStart; - CAutoResetEvent wasStarted; - CAutoResetEvent wasStopped; - CSemaphore freeSemaphore; - CSemaphore filledSemaphore; - Bool csWasInitialized; - Bool csWasEntered; - CCriticalSection cs; - UInt32 numProcessedBlocks; -} CMtSync; - -typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances); - -/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */ -#define kMtCacheLineDummy 128 - -typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos, - UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc); - -typedef struct _CMatchFinderMt -{ - /* LZ */ - const Byte *pointerToCurPos; - UInt32 *btBuf; - UInt32 btBufPos; - UInt32 btBufPosLimit; - UInt32 lzPos; - UInt32 btNumAvailBytes; - - UInt32 *hash; - UInt32 fixedHashSize; - UInt32 historySize; - const UInt32 *crc; - - Mf_Mix_Matches MixMatchesFunc; - - /* LZ + BT */ - CMtSync btSync; - Byte btDummy[kMtCacheLineDummy]; - - /* BT */ - UInt32 *hashBuf; - UInt32 hashBufPos; - UInt32 hashBufPosLimit; - UInt32 hashNumAvail; - - CLzRef *son; - UInt32 matchMaxLen; - UInt32 numHashBytes; - UInt32 pos; - const Byte *buffer; - UInt32 cyclicBufferPos; - UInt32 cyclicBufferSize; /* it must be historySize + 1 */ - UInt32 cutValue; - - /* BT + Hash */ - CMtSync hashSync; - /* Byte hashDummy[kMtCacheLineDummy]; */ - - /* Hash */ - Mf_GetHeads GetHeadsFunc; - CMatchFinder *MatchFinder; -} CMatchFinderMt; - -void MatchFinderMt_Construct(CMatchFinderMt *p); -void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc); -SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, - UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc); -void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable); -void MatchFinderMt_ReleaseStream(CMatchFinderMt *p); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/LzHash.h b/jan/src/dep/libs/lib7z/LzHash.h deleted file mode 100644 index 219144407..000000000 --- a/jan/src/dep/libs/lib7z/LzHash.h +++ /dev/null @@ -1,57 +0,0 @@ -/* LzHash.h -- HASH functions for LZ algorithms -2015-04-12 : Igor Pavlov : Public domain */ - -#ifndef __LZ_HASH_H -#define __LZ_HASH_H - -#define kHash2Size (1 << 10) -#define kHash3Size (1 << 16) -#define kHash4Size (1 << 20) - -#define kFix3HashSize (kHash2Size) -#define kFix4HashSize (kHash2Size + kHash3Size) -#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) - -#define HASH2_CALC hv = cur[0] | ((UInt32)cur[1] << 8); - -#define HASH3_CALC { \ - UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ - h2 = temp & (kHash2Size - 1); \ - hv = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } - -#define HASH4_CALC { \ - UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ - h2 = temp & (kHash2Size - 1); \ - temp ^= ((UInt32)cur[2] << 8); \ - h3 = temp & (kHash3Size - 1); \ - hv = (temp ^ (p->crc[cur[3]] << 5)) & p->hashMask; } - -#define HASH5_CALC { \ - UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ - h2 = temp & (kHash2Size - 1); \ - temp ^= ((UInt32)cur[2] << 8); \ - h3 = temp & (kHash3Size - 1); \ - temp ^= (p->crc[cur[3]] << 5); \ - h4 = temp & (kHash4Size - 1); \ - hv = (temp ^ (p->crc[cur[4]] << 3)) & p->hashMask; } - -/* #define HASH_ZIP_CALC hv = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ -#define HASH_ZIP_CALC hv = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; - - -#define MT_HASH2_CALC \ - h2 = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); - -#define MT_HASH3_CALC { \ - UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ - h2 = temp & (kHash2Size - 1); \ - h3 = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } - -#define MT_HASH4_CALC { \ - UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ - h2 = temp & (kHash2Size - 1); \ - temp ^= ((UInt32)cur[2] << 8); \ - h3 = temp & (kHash3Size - 1); \ - h4 = (temp ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } - -#endif diff --git a/jan/src/dep/libs/lib7z/Lzma2Dec.c b/jan/src/dep/libs/lib7z/Lzma2Dec.c deleted file mode 100644 index b6884571c..000000000 --- a/jan/src/dep/libs/lib7z/Lzma2Dec.c +++ /dev/null @@ -1,378 +0,0 @@ -/* Lzma2Dec.c -- LZMA2 Decoder -2015-11-09 : Igor Pavlov : Public domain */ - -/* #define SHOW_DEBUG_INFO */ - -#include "Precomp.h" - -#ifdef SHOW_DEBUG_INFO -#include -#endif - -#include - -#include "Lzma2Dec.h" - -/* -00000000 - EOS -00000001 U U - Uncompressed Reset Dic -00000010 U U - Uncompressed No Reset -100uuuuu U U P P - LZMA no reset -101uuuuu U U P P - LZMA reset state -110uuuuu U U P P S - LZMA reset state + new prop -111uuuuu U U P P S - LZMA reset state + new prop + reset dic - - u, U - Unpack Size - P - Pack Size - S - Props -*/ - -#define LZMA2_CONTROL_LZMA (1 << 7) -#define LZMA2_CONTROL_COPY_NO_RESET 2 -#define LZMA2_CONTROL_COPY_RESET_DIC 1 -#define LZMA2_CONTROL_EOF 0 - -#define LZMA2_IS_UNCOMPRESSED_STATE(p) (((p)->control & LZMA2_CONTROL_LZMA) == 0) - -#define LZMA2_GET_LZMA_MODE(p) (((p)->control >> 5) & 3) -#define LZMA2_IS_THERE_PROP(mode) ((mode) >= 2) - -#define LZMA2_LCLP_MAX 4 -#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11)) - -#ifdef SHOW_DEBUG_INFO -#define PRF(x) x -#else -#define PRF(x) -#endif - -typedef enum -{ - LZMA2_STATE_CONTROL, - LZMA2_STATE_UNPACK0, - LZMA2_STATE_UNPACK1, - LZMA2_STATE_PACK0, - LZMA2_STATE_PACK1, - LZMA2_STATE_PROP, - LZMA2_STATE_DATA, - LZMA2_STATE_DATA_CONT, - LZMA2_STATE_FINISHED, - LZMA2_STATE_ERROR -} ELzma2State; - -static SRes Lzma2Dec_GetOldProps(Byte prop, Byte *props) -{ - UInt32 dicSize; - if (prop > 40) - return SZ_ERROR_UNSUPPORTED; - dicSize = (prop == 40) ? 0xFFFFFFFF : LZMA2_DIC_SIZE_FROM_PROP(prop); - props[0] = (Byte)LZMA2_LCLP_MAX; - props[1] = (Byte)(dicSize); - props[2] = (Byte)(dicSize >> 8); - props[3] = (Byte)(dicSize >> 16); - props[4] = (Byte)(dicSize >> 24); - return SZ_OK; -} - -SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAlloc *alloc) -{ - Byte props[LZMA_PROPS_SIZE]; - RINOK(Lzma2Dec_GetOldProps(prop, props)); - return LzmaDec_AllocateProbs(&p->decoder, props, LZMA_PROPS_SIZE, alloc); -} - -SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAlloc *alloc) -{ - Byte props[LZMA_PROPS_SIZE]; - RINOK(Lzma2Dec_GetOldProps(prop, props)); - return LzmaDec_Allocate(&p->decoder, props, LZMA_PROPS_SIZE, alloc); -} - -void Lzma2Dec_Init(CLzma2Dec *p) -{ - p->state = LZMA2_STATE_CONTROL; - p->needInitDic = True; - p->needInitState = True; - p->needInitProp = True; - LzmaDec_Init(&p->decoder); -} - -static ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b) -{ - switch (p->state) - { - case LZMA2_STATE_CONTROL: - p->control = b; - PRF(printf("\n %4X ", (unsigned)p->decoder.dicPos)); - PRF(printf(" %2X", (unsigned)b)); - if (p->control == 0) - return LZMA2_STATE_FINISHED; - if (LZMA2_IS_UNCOMPRESSED_STATE(p)) - { - if ((p->control & 0x7F) > 2) - return LZMA2_STATE_ERROR; - p->unpackSize = 0; - } - else - p->unpackSize = (UInt32)(p->control & 0x1F) << 16; - return LZMA2_STATE_UNPACK0; - - case LZMA2_STATE_UNPACK0: - p->unpackSize |= (UInt32)b << 8; - return LZMA2_STATE_UNPACK1; - - case LZMA2_STATE_UNPACK1: - p->unpackSize |= (UInt32)b; - p->unpackSize++; - PRF(printf(" %8u", (unsigned)p->unpackSize)); - return (LZMA2_IS_UNCOMPRESSED_STATE(p)) ? LZMA2_STATE_DATA : LZMA2_STATE_PACK0; - - case LZMA2_STATE_PACK0: - p->packSize = (UInt32)b << 8; - return LZMA2_STATE_PACK1; - - case LZMA2_STATE_PACK1: - p->packSize |= (UInt32)b; - p->packSize++; - PRF(printf(" %8u", (unsigned)p->packSize)); - return LZMA2_IS_THERE_PROP(LZMA2_GET_LZMA_MODE(p)) ? LZMA2_STATE_PROP: - (p->needInitProp ? LZMA2_STATE_ERROR : LZMA2_STATE_DATA); - - case LZMA2_STATE_PROP: - { - unsigned lc, lp; - if (b >= (9 * 5 * 5)) - return LZMA2_STATE_ERROR; - lc = b % 9; - b /= 9; - p->decoder.prop.pb = b / 5; - lp = b % 5; - if (lc + lp > LZMA2_LCLP_MAX) - return LZMA2_STATE_ERROR; - p->decoder.prop.lc = lc; - p->decoder.prop.lp = lp; - p->needInitProp = False; - return LZMA2_STATE_DATA; - } - } - return LZMA2_STATE_ERROR; -} - -static void LzmaDec_UpdateWithUncompressed(CLzmaDec *p, const Byte *src, SizeT size) -{ - memcpy(p->dic + p->dicPos, src, size); - p->dicPos += size; - if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= size) - p->checkDicSize = p->prop.dicSize; - p->processedPos += (UInt32)size; -} - -void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState); - -SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit, - const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) -{ - SizeT inSize = *srcLen; - *srcLen = 0; - *status = LZMA_STATUS_NOT_SPECIFIED; - - while (p->state != LZMA2_STATE_FINISHED) - { - SizeT dicPos = p->decoder.dicPos; - - if (p->state == LZMA2_STATE_ERROR) - return SZ_ERROR_DATA; - - if (dicPos == dicLimit && finishMode == LZMA_FINISH_ANY) - { - *status = LZMA_STATUS_NOT_FINISHED; - return SZ_OK; - } - - if (p->state != LZMA2_STATE_DATA && p->state != LZMA2_STATE_DATA_CONT) - { - if (*srcLen == inSize) - { - *status = LZMA_STATUS_NEEDS_MORE_INPUT; - return SZ_OK; - } - (*srcLen)++; - p->state = Lzma2Dec_UpdateState(p, *src++); - - if (dicPos == dicLimit && p->state != LZMA2_STATE_FINISHED) - { - p->state = LZMA2_STATE_ERROR; - return SZ_ERROR_DATA; - } - continue; - } - - { - SizeT destSizeCur = dicLimit - dicPos; - SizeT srcSizeCur = inSize - *srcLen; - ELzmaFinishMode curFinishMode = LZMA_FINISH_ANY; - - if (p->unpackSize <= destSizeCur) - { - destSizeCur = (SizeT)p->unpackSize; - curFinishMode = LZMA_FINISH_END; - } - - if (LZMA2_IS_UNCOMPRESSED_STATE(p)) - { - if (*srcLen == inSize) - { - *status = LZMA_STATUS_NEEDS_MORE_INPUT; - return SZ_OK; - } - - if (p->state == LZMA2_STATE_DATA) - { - Bool initDic = (p->control == LZMA2_CONTROL_COPY_RESET_DIC); - if (initDic) - p->needInitProp = p->needInitState = True; - else if (p->needInitDic) - { - p->state = LZMA2_STATE_ERROR; - return SZ_ERROR_DATA; - } - p->needInitDic = False; - LzmaDec_InitDicAndState(&p->decoder, initDic, False); - } - - if (srcSizeCur > destSizeCur) - srcSizeCur = destSizeCur; - - if (srcSizeCur == 0) - { - p->state = LZMA2_STATE_ERROR; - return SZ_ERROR_DATA; - } - - LzmaDec_UpdateWithUncompressed(&p->decoder, src, srcSizeCur); - - src += srcSizeCur; - *srcLen += srcSizeCur; - p->unpackSize -= (UInt32)srcSizeCur; - p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT; - } - else - { - SizeT outSizeProcessed; - SRes res; - - if (p->state == LZMA2_STATE_DATA) - { - unsigned mode = LZMA2_GET_LZMA_MODE(p); - Bool initDic = (mode == 3); - Bool initState = (mode != 0); - if ((!initDic && p->needInitDic) || (!initState && p->needInitState)) - { - p->state = LZMA2_STATE_ERROR; - return SZ_ERROR_DATA; - } - - LzmaDec_InitDicAndState(&p->decoder, initDic, initState); - p->needInitDic = False; - p->needInitState = False; - p->state = LZMA2_STATE_DATA_CONT; - } - - if (srcSizeCur > p->packSize) - srcSizeCur = (SizeT)p->packSize; - - res = LzmaDec_DecodeToDic(&p->decoder, dicPos + destSizeCur, src, &srcSizeCur, curFinishMode, status); - - src += srcSizeCur; - *srcLen += srcSizeCur; - p->packSize -= (UInt32)srcSizeCur; - - outSizeProcessed = p->decoder.dicPos - dicPos; - p->unpackSize -= (UInt32)outSizeProcessed; - - RINOK(res); - if (*status == LZMA_STATUS_NEEDS_MORE_INPUT) - return res; - - if (srcSizeCur == 0 && outSizeProcessed == 0) - { - if (*status != LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK - || p->unpackSize != 0 - || p->packSize != 0) - { - p->state = LZMA2_STATE_ERROR; - return SZ_ERROR_DATA; - } - p->state = LZMA2_STATE_CONTROL; - } - - if (*status == LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK) - *status = LZMA_STATUS_NOT_FINISHED; - } - } - } - - *status = LZMA_STATUS_FINISHED_WITH_MARK; - return SZ_OK; -} - -SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) -{ - SizeT outSize = *destLen, inSize = *srcLen; - *srcLen = *destLen = 0; - for (;;) - { - SizeT srcSizeCur = inSize, outSizeCur, dicPos; - ELzmaFinishMode curFinishMode; - SRes res; - if (p->decoder.dicPos == p->decoder.dicBufSize) - p->decoder.dicPos = 0; - dicPos = p->decoder.dicPos; - if (outSize > p->decoder.dicBufSize - dicPos) - { - outSizeCur = p->decoder.dicBufSize; - curFinishMode = LZMA_FINISH_ANY; - } - else - { - outSizeCur = dicPos + outSize; - curFinishMode = finishMode; - } - - res = Lzma2Dec_DecodeToDic(p, outSizeCur, src, &srcSizeCur, curFinishMode, status); - src += srcSizeCur; - inSize -= srcSizeCur; - *srcLen += srcSizeCur; - outSizeCur = p->decoder.dicPos - dicPos; - memcpy(dest, p->decoder.dic + dicPos, outSizeCur); - dest += outSizeCur; - outSize -= outSizeCur; - *destLen += outSizeCur; - if (res != 0) - return res; - if (outSizeCur == 0 || outSize == 0) - return SZ_OK; - } -} - -SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, - Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc) -{ - CLzma2Dec p; - SRes res; - SizeT outSize = *destLen, inSize = *srcLen; - *destLen = *srcLen = 0; - *status = LZMA_STATUS_NOT_SPECIFIED; - Lzma2Dec_Construct(&p); - RINOK(Lzma2Dec_AllocateProbs(&p, prop, alloc)); - p.decoder.dic = dest; - p.decoder.dicBufSize = outSize; - Lzma2Dec_Init(&p); - *srcLen = inSize; - res = Lzma2Dec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); - *destLen = p.decoder.dicPos; - if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) - res = SZ_ERROR_INPUT_EOF; - Lzma2Dec_FreeProbs(&p, alloc); - return res; -} diff --git a/jan/src/dep/libs/lib7z/Lzma2Dec.h b/jan/src/dep/libs/lib7z/Lzma2Dec.h deleted file mode 100644 index 026cdefe9..000000000 --- a/jan/src/dep/libs/lib7z/Lzma2Dec.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Lzma2Dec.h -- LZMA2 Decoder -2015-05-13 : Igor Pavlov : Public domain */ - -#ifndef __LZMA2_DEC_H -#define __LZMA2_DEC_H - -#include "LzmaDec.h" - -EXTERN_C_BEGIN - -/* ---------- State Interface ---------- */ - -typedef struct -{ - CLzmaDec decoder; - UInt32 packSize; - UInt32 unpackSize; - unsigned state; - Byte control; - Bool needInitDic; - Bool needInitState; - Bool needInitProp; -} CLzma2Dec; - -#define Lzma2Dec_Construct(p) LzmaDec_Construct(&(p)->decoder) -#define Lzma2Dec_FreeProbs(p, alloc) LzmaDec_FreeProbs(&(p)->decoder, alloc); -#define Lzma2Dec_Free(p, alloc) LzmaDec_Free(&(p)->decoder, alloc); - -SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAlloc *alloc); -SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAlloc *alloc); -void Lzma2Dec_Init(CLzma2Dec *p); - - -/* -finishMode: - It has meaning only if the decoding reaches output limit (*destLen or dicLimit). - LZMA_FINISH_ANY - use smallest number of input bytes - LZMA_FINISH_END - read EndOfStream marker after decoding - -Returns: - SZ_OK - status: - LZMA_STATUS_FINISHED_WITH_MARK - LZMA_STATUS_NOT_FINISHED - LZMA_STATUS_NEEDS_MORE_INPUT - SZ_ERROR_DATA - Data error -*/ - -SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit, - const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); - -SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen, - const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); - - -/* ---------- One Call Interface ---------- */ - -/* -finishMode: - It has meaning only if the decoding reaches output limit (*destLen). - LZMA_FINISH_ANY - use smallest number of input bytes - LZMA_FINISH_END - read EndOfStream marker after decoding - -Returns: - SZ_OK - status: - LZMA_STATUS_FINISHED_WITH_MARK - LZMA_STATUS_NOT_FINISHED - SZ_ERROR_DATA - Data error - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_UNSUPPORTED - Unsupported properties - SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). -*/ - -SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, - Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Lzma2Enc.c b/jan/src/dep/libs/lib7z/Lzma2Enc.c deleted file mode 100644 index cba013497..000000000 --- a/jan/src/dep/libs/lib7z/Lzma2Enc.c +++ /dev/null @@ -1,520 +0,0 @@ -/* Lzma2Enc.c -- LZMA2 Encoder -2015-10-04 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -/* #include */ -#include - -/* #define _7ZIP_ST */ - -#include "Lzma2Enc.h" - -#ifndef _7ZIP_ST -#include "MtCoder.h" -#else -#define NUM_MT_CODER_THREADS_MAX 1 -#endif - -#define LZMA2_CONTROL_LZMA (1 << 7) -#define LZMA2_CONTROL_COPY_NO_RESET 2 -#define LZMA2_CONTROL_COPY_RESET_DIC 1 -#define LZMA2_CONTROL_EOF 0 - -#define LZMA2_LCLP_MAX 4 - -#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11)) - -#define LZMA2_PACK_SIZE_MAX (1 << 16) -#define LZMA2_COPY_CHUNK_SIZE LZMA2_PACK_SIZE_MAX -#define LZMA2_UNPACK_SIZE_MAX (1 << 21) -#define LZMA2_KEEP_WINDOW_SIZE LZMA2_UNPACK_SIZE_MAX - -#define LZMA2_CHUNK_SIZE_COMPRESSED_MAX ((1 << 16) + 16) - - -#define PRF(x) /* x */ - -/* ---------- CLzma2EncInt ---------- */ - -typedef struct -{ - CLzmaEncHandle enc; - UInt64 srcPos; - Byte props; - Bool needInitState; - Bool needInitProp; -} CLzma2EncInt; - -static SRes Lzma2EncInt_Init(CLzma2EncInt *p, const CLzma2EncProps *props) -{ - Byte propsEncoded[LZMA_PROPS_SIZE]; - SizeT propsSize = LZMA_PROPS_SIZE; - RINOK(LzmaEnc_SetProps(p->enc, &props->lzmaProps)); - RINOK(LzmaEnc_WriteProperties(p->enc, propsEncoded, &propsSize)); - p->srcPos = 0; - p->props = propsEncoded[0]; - p->needInitState = True; - p->needInitProp = True; - return SZ_OK; -} - -SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, ISeqInStream *inStream, UInt32 keepWindowSize, - ISzAlloc *alloc, ISzAlloc *allocBig); -SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, - UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig); -SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, - Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize); -const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp); -void LzmaEnc_Finish(CLzmaEncHandle pp); -void LzmaEnc_SaveState(CLzmaEncHandle pp); -void LzmaEnc_RestoreState(CLzmaEncHandle pp); - - -static SRes Lzma2EncInt_EncodeSubblock(CLzma2EncInt *p, Byte *outBuf, - size_t *packSizeRes, ISeqOutStream *outStream) -{ - size_t packSizeLimit = *packSizeRes; - size_t packSize = packSizeLimit; - UInt32 unpackSize = LZMA2_UNPACK_SIZE_MAX; - unsigned lzHeaderSize = 5 + (p->needInitProp ? 1 : 0); - Bool useCopyBlock; - SRes res; - - *packSizeRes = 0; - if (packSize < lzHeaderSize) - return SZ_ERROR_OUTPUT_EOF; - packSize -= lzHeaderSize; - - LzmaEnc_SaveState(p->enc); - res = LzmaEnc_CodeOneMemBlock(p->enc, p->needInitState, - outBuf + lzHeaderSize, &packSize, LZMA2_PACK_SIZE_MAX, &unpackSize); - - PRF(printf("\npackSize = %7d unpackSize = %7d ", packSize, unpackSize)); - - if (unpackSize == 0) - return res; - - if (res == SZ_OK) - useCopyBlock = (packSize + 2 >= unpackSize || packSize > (1 << 16)); - else - { - if (res != SZ_ERROR_OUTPUT_EOF) - return res; - res = SZ_OK; - useCopyBlock = True; - } - - if (useCopyBlock) - { - size_t destPos = 0; - PRF(printf("################# COPY ")); - - while (unpackSize > 0) - { - UInt32 u = (unpackSize < LZMA2_COPY_CHUNK_SIZE) ? unpackSize : LZMA2_COPY_CHUNK_SIZE; - if (packSizeLimit - destPos < u + 3) - return SZ_ERROR_OUTPUT_EOF; - outBuf[destPos++] = (Byte)(p->srcPos == 0 ? LZMA2_CONTROL_COPY_RESET_DIC : LZMA2_CONTROL_COPY_NO_RESET); - outBuf[destPos++] = (Byte)((u - 1) >> 8); - outBuf[destPos++] = (Byte)(u - 1); - memcpy(outBuf + destPos, LzmaEnc_GetCurBuf(p->enc) - unpackSize, u); - unpackSize -= u; - destPos += u; - p->srcPos += u; - - if (outStream) - { - *packSizeRes += destPos; - if (outStream->Write(outStream, outBuf, destPos) != destPos) - return SZ_ERROR_WRITE; - destPos = 0; - } - else - *packSizeRes = destPos; - /* needInitState = True; */ - } - - LzmaEnc_RestoreState(p->enc); - return SZ_OK; - } - - { - size_t destPos = 0; - UInt32 u = unpackSize - 1; - UInt32 pm = (UInt32)(packSize - 1); - unsigned mode = (p->srcPos == 0) ? 3 : (p->needInitState ? (p->needInitProp ? 2 : 1) : 0); - - PRF(printf(" ")); - - outBuf[destPos++] = (Byte)(LZMA2_CONTROL_LZMA | (mode << 5) | ((u >> 16) & 0x1F)); - outBuf[destPos++] = (Byte)(u >> 8); - outBuf[destPos++] = (Byte)u; - outBuf[destPos++] = (Byte)(pm >> 8); - outBuf[destPos++] = (Byte)pm; - - if (p->needInitProp) - outBuf[destPos++] = p->props; - - p->needInitProp = False; - p->needInitState = False; - destPos += packSize; - p->srcPos += unpackSize; - - if (outStream) - if (outStream->Write(outStream, outBuf, destPos) != destPos) - return SZ_ERROR_WRITE; - - *packSizeRes = destPos; - return SZ_OK; - } -} - - -/* ---------- Lzma2 Props ---------- */ - -void Lzma2EncProps_Init(CLzma2EncProps *p) -{ - LzmaEncProps_Init(&p->lzmaProps); - p->numTotalThreads = -1; - p->numBlockThreads = -1; - p->blockSize = 0; -} - -void Lzma2EncProps_Normalize(CLzma2EncProps *p) -{ - int t1, t1n, t2, t3; - { - CLzmaEncProps lzmaProps = p->lzmaProps; - LzmaEncProps_Normalize(&lzmaProps); - t1n = lzmaProps.numThreads; - } - - t1 = p->lzmaProps.numThreads; - t2 = p->numBlockThreads; - t3 = p->numTotalThreads; - - if (t2 > NUM_MT_CODER_THREADS_MAX) - t2 = NUM_MT_CODER_THREADS_MAX; - - if (t3 <= 0) - { - if (t2 <= 0) - t2 = 1; - t3 = t1n * t2; - } - else if (t2 <= 0) - { - t2 = t3 / t1n; - if (t2 == 0) - { - t1 = 1; - t2 = t3; - } - if (t2 > NUM_MT_CODER_THREADS_MAX) - t2 = NUM_MT_CODER_THREADS_MAX; - } - else if (t1 <= 0) - { - t1 = t3 / t2; - if (t1 == 0) - t1 = 1; - } - else - t3 = t1n * t2; - - p->lzmaProps.numThreads = t1; - - LzmaEncProps_Normalize(&p->lzmaProps); - - t1 = p->lzmaProps.numThreads; - - if (p->blockSize == 0) - { - UInt32 dictSize = p->lzmaProps.dictSize; - UInt64 blockSize = (UInt64)dictSize << 2; - const UInt32 kMinSize = (UInt32)1 << 20; - const UInt32 kMaxSize = (UInt32)1 << 28; - if (blockSize < kMinSize) blockSize = kMinSize; - if (blockSize > kMaxSize) blockSize = kMaxSize; - if (blockSize < dictSize) blockSize = dictSize; - p->blockSize = (size_t)blockSize; - } - - if (t2 > 1 && p->lzmaProps.reduceSize != (UInt64)(Int64)-1) - { - UInt64 temp = p->lzmaProps.reduceSize + p->blockSize - 1; - if (temp > p->lzmaProps.reduceSize) - { - UInt64 numBlocks = temp / p->blockSize; - if (numBlocks < (unsigned)t2) - { - t2 = (unsigned)numBlocks; - if (t2 == 0) - t2 = 1; - t3 = t1 * t2; - } - } - } - - p->numBlockThreads = t2; - p->numTotalThreads = t3; -} - - -static SRes Progress(ICompressProgress *p, UInt64 inSize, UInt64 outSize) -{ - return (p && p->Progress(p, inSize, outSize) != SZ_OK) ? SZ_ERROR_PROGRESS : SZ_OK; -} - - -/* ---------- Lzma2 ---------- */ - -typedef struct -{ - Byte propEncoded; - CLzma2EncProps props; - - Byte *outBuf; - - ISzAlloc *alloc; - ISzAlloc *allocBig; - - CLzma2EncInt coders[NUM_MT_CODER_THREADS_MAX]; - - #ifndef _7ZIP_ST - CMtCoder mtCoder; - #endif - -} CLzma2Enc; - - -/* ---------- Lzma2EncThread ---------- */ - -static SRes Lzma2Enc_EncodeMt1(CLzma2EncInt *p, CLzma2Enc *mainEncoder, - ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress) -{ - UInt64 packTotal = 0; - SRes res = SZ_OK; - - if (!mainEncoder->outBuf) - { - mainEncoder->outBuf = (Byte *)IAlloc_Alloc(mainEncoder->alloc, LZMA2_CHUNK_SIZE_COMPRESSED_MAX); - if (!mainEncoder->outBuf) - return SZ_ERROR_MEM; - } - - RINOK(Lzma2EncInt_Init(p, &mainEncoder->props)); - RINOK(LzmaEnc_PrepareForLzma2(p->enc, inStream, LZMA2_KEEP_WINDOW_SIZE, - mainEncoder->alloc, mainEncoder->allocBig)); - - for (;;) - { - size_t packSize = LZMA2_CHUNK_SIZE_COMPRESSED_MAX; - res = Lzma2EncInt_EncodeSubblock(p, mainEncoder->outBuf, &packSize, outStream); - if (res != SZ_OK) - break; - packTotal += packSize; - res = Progress(progress, p->srcPos, packTotal); - if (res != SZ_OK) - break; - if (packSize == 0) - break; - } - - LzmaEnc_Finish(p->enc); - - if (res == SZ_OK) - { - Byte b = 0; - if (outStream->Write(outStream, &b, 1) != 1) - return SZ_ERROR_WRITE; - } - - return res; -} - - -#ifndef _7ZIP_ST - -typedef struct -{ - IMtCoderCallback funcTable; - CLzma2Enc *lzma2Enc; -} CMtCallbackImp; - -static SRes MtCallbackImp_Code(void *pp, unsigned index, Byte *dest, size_t *destSize, - const Byte *src, size_t srcSize, int finished) -{ - CMtCallbackImp *imp = (CMtCallbackImp *)pp; - CLzma2Enc *mainEncoder = imp->lzma2Enc; - CLzma2EncInt *p = &mainEncoder->coders[index]; - - SRes res = SZ_OK; - { - size_t destLim = *destSize; - *destSize = 0; - - if (srcSize != 0) - { - RINOK(Lzma2EncInt_Init(p, &mainEncoder->props)); - - RINOK(LzmaEnc_MemPrepare(p->enc, src, srcSize, LZMA2_KEEP_WINDOW_SIZE, - mainEncoder->alloc, mainEncoder->allocBig)); - - while (p->srcPos < srcSize) - { - size_t packSize = destLim - *destSize; - res = Lzma2EncInt_EncodeSubblock(p, dest + *destSize, &packSize, NULL); - if (res != SZ_OK) - break; - *destSize += packSize; - - if (packSize == 0) - { - res = SZ_ERROR_FAIL; - break; - } - - if (MtProgress_Set(&mainEncoder->mtCoder.mtProgress, index, p->srcPos, *destSize) != SZ_OK) - { - res = SZ_ERROR_PROGRESS; - break; - } - } - - LzmaEnc_Finish(p->enc); - if (res != SZ_OK) - return res; - } - - if (finished) - { - if (*destSize == destLim) - return SZ_ERROR_OUTPUT_EOF; - dest[(*destSize)++] = 0; - } - } - return res; -} - -#endif - - -/* ---------- Lzma2Enc ---------- */ - -CLzma2EncHandle Lzma2Enc_Create(ISzAlloc *alloc, ISzAlloc *allocBig) -{ - CLzma2Enc *p = (CLzma2Enc *)alloc->Alloc(alloc, sizeof(CLzma2Enc)); - if (!p) - return NULL; - Lzma2EncProps_Init(&p->props); - Lzma2EncProps_Normalize(&p->props); - p->outBuf = 0; - p->alloc = alloc; - p->allocBig = allocBig; - { - unsigned i; - for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++) - p->coders[i].enc = 0; - } - - #ifndef _7ZIP_ST - MtCoder_Construct(&p->mtCoder); - #endif - - return p; -} - -void Lzma2Enc_Destroy(CLzma2EncHandle pp) -{ - CLzma2Enc *p = (CLzma2Enc *)pp; - unsigned i; - for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++) - { - CLzma2EncInt *t = &p->coders[i]; - if (t->enc) - { - LzmaEnc_Destroy(t->enc, p->alloc, p->allocBig); - t->enc = 0; - } - } - - #ifndef _7ZIP_ST - MtCoder_Destruct(&p->mtCoder); - #endif - - IAlloc_Free(p->alloc, p->outBuf); - IAlloc_Free(p->alloc, pp); -} - -SRes Lzma2Enc_SetProps(CLzma2EncHandle pp, const CLzma2EncProps *props) -{ - CLzma2Enc *p = (CLzma2Enc *)pp; - CLzmaEncProps lzmaProps = props->lzmaProps; - LzmaEncProps_Normalize(&lzmaProps); - if (lzmaProps.lc + lzmaProps.lp > LZMA2_LCLP_MAX) - return SZ_ERROR_PARAM; - p->props = *props; - Lzma2EncProps_Normalize(&p->props); - return SZ_OK; -} - -Byte Lzma2Enc_WriteProperties(CLzma2EncHandle pp) -{ - CLzma2Enc *p = (CLzma2Enc *)pp; - unsigned i; - UInt32 dicSize = LzmaEncProps_GetDictSize(&p->props.lzmaProps); - for (i = 0; i < 40; i++) - if (dicSize <= LZMA2_DIC_SIZE_FROM_PROP(i)) - break; - return (Byte)i; -} - -SRes Lzma2Enc_Encode(CLzma2EncHandle pp, - ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress) -{ - CLzma2Enc *p = (CLzma2Enc *)pp; - int i; - - for (i = 0; i < p->props.numBlockThreads; i++) - { - CLzma2EncInt *t = &p->coders[(unsigned)i]; - if (!t->enc) - { - t->enc = LzmaEnc_Create(p->alloc); - if (!t->enc) - return SZ_ERROR_MEM; - } - } - - #ifndef _7ZIP_ST - if (p->props.numBlockThreads > 1) - { - CMtCallbackImp mtCallback; - - mtCallback.funcTable.Code = MtCallbackImp_Code; - mtCallback.lzma2Enc = p; - - p->mtCoder.progress = progress; - p->mtCoder.inStream = inStream; - p->mtCoder.outStream = outStream; - p->mtCoder.alloc = p->alloc; - p->mtCoder.mtCallback = &mtCallback.funcTable; - - p->mtCoder.blockSize = p->props.blockSize; - p->mtCoder.destBlockSize = p->props.blockSize + (p->props.blockSize >> 10) + 16; - if (p->mtCoder.destBlockSize < p->props.blockSize) - { - p->mtCoder.destBlockSize = (size_t)0 - 1; - if (p->mtCoder.destBlockSize < p->props.blockSize) - return SZ_ERROR_FAIL; - } - p->mtCoder.numThreads = p->props.numBlockThreads; - - return MtCoder_Code(&p->mtCoder); - } - #endif - - return Lzma2Enc_EncodeMt1(&p->coders[0], p, outStream, inStream, progress); -} diff --git a/jan/src/dep/libs/lib7z/Lzma2Enc.h b/jan/src/dep/libs/lib7z/Lzma2Enc.h deleted file mode 100644 index 061178aaf..000000000 --- a/jan/src/dep/libs/lib7z/Lzma2Enc.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Lzma2Enc.h -- LZMA2 Encoder -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __LZMA2_ENC_H -#define __LZMA2_ENC_H - -#include "LzmaEnc.h" - -EXTERN_C_BEGIN - -typedef struct -{ - CLzmaEncProps lzmaProps; - size_t blockSize; - int numBlockThreads; - int numTotalThreads; -} CLzma2EncProps; - -void Lzma2EncProps_Init(CLzma2EncProps *p); -void Lzma2EncProps_Normalize(CLzma2EncProps *p); - -/* ---------- CLzmaEnc2Handle Interface ---------- */ - -/* Lzma2Enc_* functions can return the following exit codes: -Returns: - SZ_OK - OK - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_PARAM - Incorrect paramater in props - SZ_ERROR_WRITE - Write callback error - SZ_ERROR_PROGRESS - some break from progress callback - SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) -*/ - -typedef void * CLzma2EncHandle; - -CLzma2EncHandle Lzma2Enc_Create(ISzAlloc *alloc, ISzAlloc *allocBig); -void Lzma2Enc_Destroy(CLzma2EncHandle p); -SRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props); -Byte Lzma2Enc_WriteProperties(CLzma2EncHandle p); -SRes Lzma2Enc_Encode(CLzma2EncHandle p, - ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress); - -/* ---------- One Call Interface ---------- */ - -/* Lzma2Encode -Return code: - SZ_OK - OK - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_PARAM - Incorrect paramater - SZ_ERROR_OUTPUT_EOF - output buffer overflow - SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) -*/ - -/* -SRes Lzma2Encode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, - const CLzmaEncProps *props, Byte *propsEncoded, int writeEndMark, - ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); -*/ - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Lzma86.h b/jan/src/dep/libs/lib7z/Lzma86.h deleted file mode 100644 index 83057e598..000000000 --- a/jan/src/dep/libs/lib7z/Lzma86.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Lzma86.h -- LZMA + x86 (BCJ) Filter -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __LZMA86_H -#define __LZMA86_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -#define LZMA86_SIZE_OFFSET (1 + 5) -#define LZMA86_HEADER_SIZE (LZMA86_SIZE_OFFSET + 8) - -/* -It's an example for LZMA + x86 Filter use. -You can use .lzma86 extension, if you write that stream to file. -.lzma86 header adds one additional byte to standard .lzma header. -.lzma86 header (14 bytes): - Offset Size Description - 0 1 = 0 - no filter, pure LZMA - = 1 - x86 filter + LZMA - 1 1 lc, lp and pb in encoded form - 2 4 dictSize (little endian) - 6 8 uncompressed size (little endian) - - -Lzma86_Encode -------------- -level - compression level: 0 <= level <= 9, the default value for "level" is 5. - -dictSize - The dictionary size in bytes. The maximum value is - 128 MB = (1 << 27) bytes for 32-bit version - 1 GB = (1 << 30) bytes for 64-bit version - The default value is 16 MB = (1 << 24) bytes, for level = 5. - It's recommended to use the dictionary that is larger than 4 KB and - that can be calculated as (1 << N) or (3 << N) sizes. - For better compression ratio dictSize must be >= inSize. - -filterMode: - SZ_FILTER_NO - no Filter - SZ_FILTER_YES - x86 Filter - SZ_FILTER_AUTO - it tries both alternatives to select best. - Encoder will use 2 or 3 passes: - 2 passes when FILTER_NO provides better compression. - 3 passes when FILTER_YES provides better compression. - -Lzma86Encode allocates Data with MyAlloc functions. -RAM Requirements for compressing: - RamSize = dictionarySize * 11.5 + 6MB + FilterBlockSize - filterMode FilterBlockSize - SZ_FILTER_NO 0 - SZ_FILTER_YES inSize - SZ_FILTER_AUTO inSize - - -Return code: - SZ_OK - OK - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_PARAM - Incorrect paramater - SZ_ERROR_OUTPUT_EOF - output buffer overflow - SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) -*/ - -enum ESzFilterMode -{ - SZ_FILTER_NO, - SZ_FILTER_YES, - SZ_FILTER_AUTO -}; - -SRes Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen, - int level, UInt32 dictSize, int filterMode); - - -/* -Lzma86_GetUnpackSize: - In: - src - input data - srcLen - input data size - Out: - unpackSize - size of uncompressed stream - Return code: - SZ_OK - OK - SZ_ERROR_INPUT_EOF - Error in headers -*/ - -SRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize); - -/* -Lzma86_Decode: - In: - dest - output data - destLen - output data size - src - input data - srcLen - input data size - Out: - destLen - processed output size - srcLen - processed input size - Return code: - SZ_OK - OK - SZ_ERROR_DATA - Data error - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_UNSUPPORTED - unsupported file - SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer -*/ - -SRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Lzma86Dec.c b/jan/src/dep/libs/lib7z/Lzma86Dec.c deleted file mode 100644 index 20ac5e7a9..000000000 --- a/jan/src/dep/libs/lib7z/Lzma86Dec.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Lzma86Dec.c -- LZMA + x86 (BCJ) Filter Decoder -2016-05-16 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "Lzma86.h" - -#include "Alloc.h" -#include "Bra.h" -#include "LzmaDec.h" - -SRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize) -{ - unsigned i; - if (srcLen < LZMA86_HEADER_SIZE) - return SZ_ERROR_INPUT_EOF; - *unpackSize = 0; - for (i = 0; i < sizeof(UInt64); i++) - *unpackSize += ((UInt64)src[LZMA86_SIZE_OFFSET + i]) << (8 * i); - return SZ_OK; -} - -SRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen) -{ - SRes res; - int useFilter; - SizeT inSizePure; - ELzmaStatus status; - - if (*srcLen < LZMA86_HEADER_SIZE) - return SZ_ERROR_INPUT_EOF; - - useFilter = src[0]; - - if (useFilter > 1) - { - *destLen = 0; - return SZ_ERROR_UNSUPPORTED; - } - - inSizePure = *srcLen - LZMA86_HEADER_SIZE; - res = LzmaDecode(dest, destLen, src + LZMA86_HEADER_SIZE, &inSizePure, - src + 1, LZMA_PROPS_SIZE, LZMA_FINISH_ANY, &status, &g_Alloc); - *srcLen = inSizePure + LZMA86_HEADER_SIZE; - if (res != SZ_OK) - return res; - if (useFilter == 1) - { - UInt32 x86State; - x86_Convert_Init(x86State); - x86_Convert(dest, *destLen, 0, &x86State, 0); - } - return SZ_OK; -} diff --git a/jan/src/dep/libs/lib7z/Lzma86Enc.c b/jan/src/dep/libs/lib7z/Lzma86Enc.c deleted file mode 100644 index ee59fb7d7..000000000 --- a/jan/src/dep/libs/lib7z/Lzma86Enc.c +++ /dev/null @@ -1,106 +0,0 @@ -/* Lzma86Enc.c -- LZMA + x86 (BCJ) Filter Encoder -2016-05-16 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include - -#include "Lzma86.h" - -#include "Alloc.h" -#include "Bra.h" -#include "LzmaEnc.h" - -#define SZE_OUT_OVERFLOW SZE_DATA_ERROR - -int Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen, - int level, UInt32 dictSize, int filterMode) -{ - size_t outSize2 = *destLen; - Byte *filteredStream; - Bool useFilter; - int mainResult = SZ_ERROR_OUTPUT_EOF; - CLzmaEncProps props; - LzmaEncProps_Init(&props); - props.level = level; - props.dictSize = dictSize; - - *destLen = 0; - if (outSize2 < LZMA86_HEADER_SIZE) - return SZ_ERROR_OUTPUT_EOF; - - { - int i; - UInt64 t = srcLen; - for (i = 0; i < 8; i++, t >>= 8) - dest[LZMA86_SIZE_OFFSET + i] = (Byte)t; - } - - filteredStream = 0; - useFilter = (filterMode != SZ_FILTER_NO); - if (useFilter) - { - if (srcLen != 0) - { - filteredStream = (Byte *)MyAlloc(srcLen); - if (filteredStream == 0) - return SZ_ERROR_MEM; - memcpy(filteredStream, src, srcLen); - } - { - UInt32 x86State; - x86_Convert_Init(x86State); - x86_Convert(filteredStream, srcLen, 0, &x86State, 1); - } - } - - { - size_t minSize = 0; - Bool bestIsFiltered = False; - - /* passes for SZ_FILTER_AUTO: - 0 - BCJ + LZMA - 1 - LZMA - 2 - BCJ + LZMA agaian, if pass 0 (BCJ + LZMA) is better. - */ - int numPasses = (filterMode == SZ_FILTER_AUTO) ? 3 : 1; - - int i; - for (i = 0; i < numPasses; i++) - { - size_t outSizeProcessed = outSize2 - LZMA86_HEADER_SIZE; - size_t outPropsSize = 5; - SRes curRes; - Bool curModeIsFiltered = (numPasses > 1 && i == numPasses - 1); - if (curModeIsFiltered && !bestIsFiltered) - break; - if (useFilter && i == 0) - curModeIsFiltered = True; - - curRes = LzmaEncode(dest + LZMA86_HEADER_SIZE, &outSizeProcessed, - curModeIsFiltered ? filteredStream : src, srcLen, - &props, dest + 1, &outPropsSize, 0, - NULL, &g_Alloc, &g_Alloc); - - if (curRes != SZ_ERROR_OUTPUT_EOF) - { - if (curRes != SZ_OK) - { - mainResult = curRes; - break; - } - if (outSizeProcessed <= minSize || mainResult != SZ_OK) - { - minSize = outSizeProcessed; - bestIsFiltered = curModeIsFiltered; - mainResult = SZ_OK; - } - } - } - dest[0] = (Byte)(bestIsFiltered ? 1 : 0); - *destLen = LZMA86_HEADER_SIZE + minSize; - } - if (useFilter) - MyFree(filteredStream); - return mainResult; -} diff --git a/jan/src/dep/libs/lib7z/LzmaDec.c b/jan/src/dep/libs/lib7z/LzmaDec.c deleted file mode 100644 index 64f1164f3..000000000 --- a/jan/src/dep/libs/lib7z/LzmaDec.c +++ /dev/null @@ -1,1100 +0,0 @@ -/* LzmaDec.c -- LZMA Decoder -2016-05-16 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "LzmaDec.h" - -#include - -#define kNumTopBits 24 -#define kTopValue ((UInt32)1 << kNumTopBits) - -#define kNumBitModelTotalBits 11 -#define kBitModelTotal (1 << kNumBitModelTotalBits) -#define kNumMoveBits 5 - -#define RC_INIT_SIZE 5 - -#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } - -#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) -#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); -#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); -#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ - { UPDATE_0(p); i = (i + i); A0; } else \ - { UPDATE_1(p); i = (i + i) + 1; A1; } -#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) - -#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } -#define TREE_DECODE(probs, limit, i) \ - { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } - -/* #define _LZMA_SIZE_OPT */ - -#ifdef _LZMA_SIZE_OPT -#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) -#else -#define TREE_6_DECODE(probs, i) \ - { i = 1; \ - TREE_GET_BIT(probs, i); \ - TREE_GET_BIT(probs, i); \ - TREE_GET_BIT(probs, i); \ - TREE_GET_BIT(probs, i); \ - TREE_GET_BIT(probs, i); \ - TREE_GET_BIT(probs, i); \ - i -= 0x40; } -#endif - -#define NORMAL_LITER_DEC GET_BIT(prob + symbol, symbol) -#define MATCHED_LITER_DEC \ - matchByte <<= 1; \ - bit = (matchByte & offs); \ - probLit = prob + offs + bit + symbol; \ - GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) - -#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } - -#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) -#define UPDATE_0_CHECK range = bound; -#define UPDATE_1_CHECK range -= bound; code -= bound; -#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ - { UPDATE_0_CHECK; i = (i + i); A0; } else \ - { UPDATE_1_CHECK; i = (i + i) + 1; A1; } -#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) -#define TREE_DECODE_CHECK(probs, limit, i) \ - { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; } - - -#define kNumPosBitsMax 4 -#define kNumPosStatesMax (1 << kNumPosBitsMax) - -#define kLenNumLowBits 3 -#define kLenNumLowSymbols (1 << kLenNumLowBits) -#define kLenNumMidBits 3 -#define kLenNumMidSymbols (1 << kLenNumMidBits) -#define kLenNumHighBits 8 -#define kLenNumHighSymbols (1 << kLenNumHighBits) - -#define LenChoice 0 -#define LenChoice2 (LenChoice + 1) -#define LenLow (LenChoice2 + 1) -#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) -#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) -#define kNumLenProbs (LenHigh + kLenNumHighSymbols) - - -#define kNumStates 12 -#define kNumLitStates 7 - -#define kStartPosModelIndex 4 -#define kEndPosModelIndex 14 -#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) - -#define kNumPosSlotBits 6 -#define kNumLenToPosStates 4 - -#define kNumAlignBits 4 -#define kAlignTableSize (1 << kNumAlignBits) - -#define kMatchMinLen 2 -#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) - -#define IsMatch 0 -#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) -#define IsRepG0 (IsRep + kNumStates) -#define IsRepG1 (IsRepG0 + kNumStates) -#define IsRepG2 (IsRepG1 + kNumStates) -#define IsRep0Long (IsRepG2 + kNumStates) -#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) -#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) -#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) -#define LenCoder (Align + kAlignTableSize) -#define RepLenCoder (LenCoder + kNumLenProbs) -#define Literal (RepLenCoder + kNumLenProbs) - -#define LZMA_BASE_SIZE 1846 -#define LZMA_LIT_SIZE 0x300 - -#if Literal != LZMA_BASE_SIZE -StopCompilingDueBUG -#endif - -#define LzmaProps_GetNumProbs(p) (Literal + ((UInt32)LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) - -#define LZMA_DIC_MIN (1 << 12) - -/* First LZMA-symbol is always decoded. -And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization -Out: - Result: - SZ_OK - OK - SZ_ERROR_DATA - Error - p->remainLen: - < kMatchSpecLenStart : normal remain - = kMatchSpecLenStart : finished - = kMatchSpecLenStart + 1 : Flush marker (unused now) - = kMatchSpecLenStart + 2 : State Init Marker (unused now) -*/ - -static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) -{ - CLzmaProb *probs = p->probs; - - unsigned state = p->state; - UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; - unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; - unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; - unsigned lc = p->prop.lc; - - Byte *dic = p->dic; - SizeT dicBufSize = p->dicBufSize; - SizeT dicPos = p->dicPos; - - UInt32 processedPos = p->processedPos; - UInt32 checkDicSize = p->checkDicSize; - unsigned len = 0; - - const Byte *buf = p->buf; - UInt32 range = p->range; - UInt32 code = p->code; - - do - { - CLzmaProb *prob; - UInt32 bound; - unsigned ttt; - unsigned posState = processedPos & pbMask; - - prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; - IF_BIT_0(prob) - { - unsigned symbol; - UPDATE_0(prob); - prob = probs + Literal; - if (processedPos != 0 || checkDicSize != 0) - prob += ((UInt32)LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + - (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); - processedPos++; - - if (state < kNumLitStates) - { - state -= (state < 4) ? state : 3; - symbol = 1; - #ifdef _LZMA_SIZE_OPT - do { NORMAL_LITER_DEC } while (symbol < 0x100); - #else - NORMAL_LITER_DEC - NORMAL_LITER_DEC - NORMAL_LITER_DEC - NORMAL_LITER_DEC - NORMAL_LITER_DEC - NORMAL_LITER_DEC - NORMAL_LITER_DEC - NORMAL_LITER_DEC - #endif - } - else - { - unsigned matchByte = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)]; - unsigned offs = 0x100; - state -= (state < 10) ? 3 : 6; - symbol = 1; - #ifdef _LZMA_SIZE_OPT - do - { - unsigned bit; - CLzmaProb *probLit; - MATCHED_LITER_DEC - } - while (symbol < 0x100); - #else - { - unsigned bit; - CLzmaProb *probLit; - MATCHED_LITER_DEC - MATCHED_LITER_DEC - MATCHED_LITER_DEC - MATCHED_LITER_DEC - MATCHED_LITER_DEC - MATCHED_LITER_DEC - MATCHED_LITER_DEC - MATCHED_LITER_DEC - } - #endif - } - - dic[dicPos++] = (Byte)symbol; - continue; - } - - { - UPDATE_1(prob); - prob = probs + IsRep + state; - IF_BIT_0(prob) - { - UPDATE_0(prob); - state += kNumStates; - prob = probs + LenCoder; - } - else - { - UPDATE_1(prob); - if (checkDicSize == 0 && processedPos == 0) - return SZ_ERROR_DATA; - prob = probs + IsRepG0 + state; - IF_BIT_0(prob) - { - UPDATE_0(prob); - prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; - IF_BIT_0(prob) - { - UPDATE_0(prob); - dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)]; - dicPos++; - processedPos++; - state = state < kNumLitStates ? 9 : 11; - continue; - } - UPDATE_1(prob); - } - else - { - UInt32 distance; - UPDATE_1(prob); - prob = probs + IsRepG1 + state; - IF_BIT_0(prob) - { - UPDATE_0(prob); - distance = rep1; - } - else - { - UPDATE_1(prob); - prob = probs + IsRepG2 + state; - IF_BIT_0(prob) - { - UPDATE_0(prob); - distance = rep2; - } - else - { - UPDATE_1(prob); - distance = rep3; - rep3 = rep2; - } - rep2 = rep1; - } - rep1 = rep0; - rep0 = distance; - } - state = state < kNumLitStates ? 8 : 11; - prob = probs + RepLenCoder; - } - - #ifdef _LZMA_SIZE_OPT - { - unsigned lim, offset; - CLzmaProb *probLen = prob + LenChoice; - IF_BIT_0(probLen) - { - UPDATE_0(probLen); - probLen = prob + LenLow + (posState << kLenNumLowBits); - offset = 0; - lim = (1 << kLenNumLowBits); - } - else - { - UPDATE_1(probLen); - probLen = prob + LenChoice2; - IF_BIT_0(probLen) - { - UPDATE_0(probLen); - probLen = prob + LenMid + (posState << kLenNumMidBits); - offset = kLenNumLowSymbols; - lim = (1 << kLenNumMidBits); - } - else - { - UPDATE_1(probLen); - probLen = prob + LenHigh; - offset = kLenNumLowSymbols + kLenNumMidSymbols; - lim = (1 << kLenNumHighBits); - } - } - TREE_DECODE(probLen, lim, len); - len += offset; - } - #else - { - CLzmaProb *probLen = prob + LenChoice; - IF_BIT_0(probLen) - { - UPDATE_0(probLen); - probLen = prob + LenLow + (posState << kLenNumLowBits); - len = 1; - TREE_GET_BIT(probLen, len); - TREE_GET_BIT(probLen, len); - TREE_GET_BIT(probLen, len); - len -= 8; - } - else - { - UPDATE_1(probLen); - probLen = prob + LenChoice2; - IF_BIT_0(probLen) - { - UPDATE_0(probLen); - probLen = prob + LenMid + (posState << kLenNumMidBits); - len = 1; - TREE_GET_BIT(probLen, len); - TREE_GET_BIT(probLen, len); - TREE_GET_BIT(probLen, len); - } - else - { - UPDATE_1(probLen); - probLen = prob + LenHigh; - TREE_DECODE(probLen, (1 << kLenNumHighBits), len); - len += kLenNumLowSymbols + kLenNumMidSymbols; - } - } - } - #endif - - if (state >= kNumStates) - { - UInt32 distance; - prob = probs + PosSlot + - ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); - TREE_6_DECODE(prob, distance); - if (distance >= kStartPosModelIndex) - { - unsigned posSlot = (unsigned)distance; - unsigned numDirectBits = (unsigned)(((distance >> 1) - 1)); - distance = (2 | (distance & 1)); - if (posSlot < kEndPosModelIndex) - { - distance <<= numDirectBits; - prob = probs + SpecPos + distance - posSlot - 1; - { - UInt32 mask = 1; - unsigned i = 1; - do - { - GET_BIT2(prob + i, i, ; , distance |= mask); - mask <<= 1; - } - while (--numDirectBits != 0); - } - } - else - { - numDirectBits -= kNumAlignBits; - do - { - NORMALIZE - range >>= 1; - - { - UInt32 t; - code -= range; - t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ - distance = (distance << 1) + (t + 1); - code += range & t; - } - /* - distance <<= 1; - if (code >= range) - { - code -= range; - distance |= 1; - } - */ - } - while (--numDirectBits != 0); - prob = probs + Align; - distance <<= kNumAlignBits; - { - unsigned i = 1; - GET_BIT2(prob + i, i, ; , distance |= 1); - GET_BIT2(prob + i, i, ; , distance |= 2); - GET_BIT2(prob + i, i, ; , distance |= 4); - GET_BIT2(prob + i, i, ; , distance |= 8); - } - if (distance == (UInt32)0xFFFFFFFF) - { - len += kMatchSpecLenStart; - state -= kNumStates; - break; - } - } - } - - rep3 = rep2; - rep2 = rep1; - rep1 = rep0; - rep0 = distance + 1; - if (checkDicSize == 0) - { - if (distance >= processedPos) - { - p->dicPos = dicPos; - return SZ_ERROR_DATA; - } - } - else if (distance >= checkDicSize) - { - p->dicPos = dicPos; - return SZ_ERROR_DATA; - } - state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; - } - - len += kMatchMinLen; - - { - SizeT rem; - unsigned curLen; - SizeT pos; - - if ((rem = limit - dicPos) == 0) - { - p->dicPos = dicPos; - return SZ_ERROR_DATA; - } - - curLen = ((rem < len) ? (unsigned)rem : len); - pos = dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0); - - processedPos += curLen; - - len -= curLen; - if (curLen <= dicBufSize - pos) - { - Byte *dest = dic + dicPos; - ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; - const Byte *lim = dest + curLen; - dicPos += curLen; - do - *(dest) = (Byte)*(dest + src); - while (++dest != lim); - } - else - { - do - { - dic[dicPos++] = dic[pos]; - if (++pos == dicBufSize) - pos = 0; - } - while (--curLen != 0); - } - } - } - } - while (dicPos < limit && buf < bufLimit); - - NORMALIZE; - - p->buf = buf; - p->range = range; - p->code = code; - p->remainLen = len; - p->dicPos = dicPos; - p->processedPos = processedPos; - p->reps[0] = rep0; - p->reps[1] = rep1; - p->reps[2] = rep2; - p->reps[3] = rep3; - p->state = state; - - return SZ_OK; -} - -static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) -{ - if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) - { - Byte *dic = p->dic; - SizeT dicPos = p->dicPos; - SizeT dicBufSize = p->dicBufSize; - unsigned len = p->remainLen; - SizeT rep0 = p->reps[0]; /* we use SizeT to avoid the BUG of VC14 for AMD64 */ - SizeT rem = limit - dicPos; - if (rem < len) - len = (unsigned)(rem); - - if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) - p->checkDicSize = p->prop.dicSize; - - p->processedPos += len; - p->remainLen -= len; - while (len != 0) - { - len--; - dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)]; - dicPos++; - } - p->dicPos = dicPos; - } -} - -static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) -{ - do - { - SizeT limit2 = limit; - if (p->checkDicSize == 0) - { - UInt32 rem = p->prop.dicSize - p->processedPos; - if (limit - p->dicPos > rem) - limit2 = p->dicPos + rem; - } - - RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); - - if (p->checkDicSize == 0 && p->processedPos >= p->prop.dicSize) - p->checkDicSize = p->prop.dicSize; - - LzmaDec_WriteRem(p, limit); - } - while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); - - if (p->remainLen > kMatchSpecLenStart) - p->remainLen = kMatchSpecLenStart; - - return 0; -} - -typedef enum -{ - DUMMY_ERROR, /* unexpected end of input stream */ - DUMMY_LIT, - DUMMY_MATCH, - DUMMY_REP -} ELzmaDummy; - -static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) -{ - UInt32 range = p->range; - UInt32 code = p->code; - const Byte *bufLimit = buf + inSize; - const CLzmaProb *probs = p->probs; - unsigned state = p->state; - ELzmaDummy res; - - { - const CLzmaProb *prob; - UInt32 bound; - unsigned ttt; - unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); - - prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; - IF_BIT_0_CHECK(prob) - { - UPDATE_0_CHECK - - /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ - - prob = probs + Literal; - if (p->checkDicSize != 0 || p->processedPos != 0) - prob += ((UInt32)LZMA_LIT_SIZE * - ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + - (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); - - if (state < kNumLitStates) - { - unsigned symbol = 1; - do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); - } - else - { - unsigned matchByte = p->dic[p->dicPos - p->reps[0] + - (p->dicPos < p->reps[0] ? p->dicBufSize : 0)]; - unsigned offs = 0x100; - unsigned symbol = 1; - do - { - unsigned bit; - const CLzmaProb *probLit; - matchByte <<= 1; - bit = (matchByte & offs); - probLit = prob + offs + bit + symbol; - GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) - } - while (symbol < 0x100); - } - res = DUMMY_LIT; - } - else - { - unsigned len; - UPDATE_1_CHECK; - - prob = probs + IsRep + state; - IF_BIT_0_CHECK(prob) - { - UPDATE_0_CHECK; - state = 0; - prob = probs + LenCoder; - res = DUMMY_MATCH; - } - else - { - UPDATE_1_CHECK; - res = DUMMY_REP; - prob = probs + IsRepG0 + state; - IF_BIT_0_CHECK(prob) - { - UPDATE_0_CHECK; - prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; - IF_BIT_0_CHECK(prob) - { - UPDATE_0_CHECK; - NORMALIZE_CHECK; - return DUMMY_REP; - } - else - { - UPDATE_1_CHECK; - } - } - else - { - UPDATE_1_CHECK; - prob = probs + IsRepG1 + state; - IF_BIT_0_CHECK(prob) - { - UPDATE_0_CHECK; - } - else - { - UPDATE_1_CHECK; - prob = probs + IsRepG2 + state; - IF_BIT_0_CHECK(prob) - { - UPDATE_0_CHECK; - } - else - { - UPDATE_1_CHECK; - } - } - } - state = kNumStates; - prob = probs + RepLenCoder; - } - { - unsigned limit, offset; - const CLzmaProb *probLen = prob + LenChoice; - IF_BIT_0_CHECK(probLen) - { - UPDATE_0_CHECK; - probLen = prob + LenLow + (posState << kLenNumLowBits); - offset = 0; - limit = 1 << kLenNumLowBits; - } - else - { - UPDATE_1_CHECK; - probLen = prob + LenChoice2; - IF_BIT_0_CHECK(probLen) - { - UPDATE_0_CHECK; - probLen = prob + LenMid + (posState << kLenNumMidBits); - offset = kLenNumLowSymbols; - limit = 1 << kLenNumMidBits; - } - else - { - UPDATE_1_CHECK; - probLen = prob + LenHigh; - offset = kLenNumLowSymbols + kLenNumMidSymbols; - limit = 1 << kLenNumHighBits; - } - } - TREE_DECODE_CHECK(probLen, limit, len); - len += offset; - } - - if (state < 4) - { - unsigned posSlot; - prob = probs + PosSlot + - ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << - kNumPosSlotBits); - TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); - if (posSlot >= kStartPosModelIndex) - { - unsigned numDirectBits = ((posSlot >> 1) - 1); - - /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ - - if (posSlot < kEndPosModelIndex) - { - prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; - } - else - { - numDirectBits -= kNumAlignBits; - do - { - NORMALIZE_CHECK - range >>= 1; - code -= range & (((code - range) >> 31) - 1); - /* if (code >= range) code -= range; */ - } - while (--numDirectBits != 0); - prob = probs + Align; - numDirectBits = kNumAlignBits; - } - { - unsigned i = 1; - do - { - GET_BIT_CHECK(prob + i, i); - } - while (--numDirectBits != 0); - } - } - } - } - } - NORMALIZE_CHECK; - return res; -} - - -void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) -{ - p->needFlush = 1; - p->remainLen = 0; - p->tempBufSize = 0; - - if (initDic) - { - p->processedPos = 0; - p->checkDicSize = 0; - p->needInitState = 1; - } - if (initState) - p->needInitState = 1; -} - -void LzmaDec_Init(CLzmaDec *p) -{ - p->dicPos = 0; - LzmaDec_InitDicAndState(p, True, True); -} - -static void LzmaDec_InitStateReal(CLzmaDec *p) -{ - SizeT numProbs = LzmaProps_GetNumProbs(&p->prop); - SizeT i; - CLzmaProb *probs = p->probs; - for (i = 0; i < numProbs; i++) - probs[i] = kBitModelTotal >> 1; - p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; - p->state = 0; - p->needInitState = 0; -} - -SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, - ELzmaFinishMode finishMode, ELzmaStatus *status) -{ - SizeT inSize = *srcLen; - (*srcLen) = 0; - LzmaDec_WriteRem(p, dicLimit); - - *status = LZMA_STATUS_NOT_SPECIFIED; - - while (p->remainLen != kMatchSpecLenStart) - { - int checkEndMarkNow; - - if (p->needFlush) - { - for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) - p->tempBuf[p->tempBufSize++] = *src++; - if (p->tempBufSize < RC_INIT_SIZE) - { - *status = LZMA_STATUS_NEEDS_MORE_INPUT; - return SZ_OK; - } - if (p->tempBuf[0] != 0) - return SZ_ERROR_DATA; - p->code = - ((UInt32)p->tempBuf[1] << 24) - | ((UInt32)p->tempBuf[2] << 16) - | ((UInt32)p->tempBuf[3] << 8) - | ((UInt32)p->tempBuf[4]); - p->range = 0xFFFFFFFF; - p->needFlush = 0; - p->tempBufSize = 0; - } - - checkEndMarkNow = 0; - if (p->dicPos >= dicLimit) - { - if (p->remainLen == 0 && p->code == 0) - { - *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; - return SZ_OK; - } - if (finishMode == LZMA_FINISH_ANY) - { - *status = LZMA_STATUS_NOT_FINISHED; - return SZ_OK; - } - if (p->remainLen != 0) - { - *status = LZMA_STATUS_NOT_FINISHED; - return SZ_ERROR_DATA; - } - checkEndMarkNow = 1; - } - - if (p->needInitState) - LzmaDec_InitStateReal(p); - - if (p->tempBufSize == 0) - { - SizeT processed; - const Byte *bufLimit; - if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) - { - int dummyRes = LzmaDec_TryDummy(p, src, inSize); - if (dummyRes == DUMMY_ERROR) - { - memcpy(p->tempBuf, src, inSize); - p->tempBufSize = (unsigned)inSize; - (*srcLen) += inSize; - *status = LZMA_STATUS_NEEDS_MORE_INPUT; - return SZ_OK; - } - if (checkEndMarkNow && dummyRes != DUMMY_MATCH) - { - *status = LZMA_STATUS_NOT_FINISHED; - return SZ_ERROR_DATA; - } - bufLimit = src; - } - else - bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; - p->buf = src; - if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) - return SZ_ERROR_DATA; - processed = (SizeT)(p->buf - src); - (*srcLen) += processed; - src += processed; - inSize -= processed; - } - else - { - unsigned rem = p->tempBufSize, lookAhead = 0; - while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) - p->tempBuf[rem++] = src[lookAhead++]; - p->tempBufSize = rem; - if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) - { - int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); - if (dummyRes == DUMMY_ERROR) - { - (*srcLen) += lookAhead; - *status = LZMA_STATUS_NEEDS_MORE_INPUT; - return SZ_OK; - } - if (checkEndMarkNow && dummyRes != DUMMY_MATCH) - { - *status = LZMA_STATUS_NOT_FINISHED; - return SZ_ERROR_DATA; - } - } - p->buf = p->tempBuf; - if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) - return SZ_ERROR_DATA; - - { - unsigned kkk = (unsigned)(p->buf - p->tempBuf); - if (rem < kkk) - return SZ_ERROR_FAIL; /* some internal error */ - rem -= kkk; - if (lookAhead < rem) - return SZ_ERROR_FAIL; /* some internal error */ - lookAhead -= rem; - } - (*srcLen) += lookAhead; - src += lookAhead; - inSize -= lookAhead; - p->tempBufSize = 0; - } - } - if (p->code == 0) - *status = LZMA_STATUS_FINISHED_WITH_MARK; - return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; -} - -SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) -{ - SizeT outSize = *destLen; - SizeT inSize = *srcLen; - *srcLen = *destLen = 0; - for (;;) - { - SizeT inSizeCur = inSize, outSizeCur, dicPos; - ELzmaFinishMode curFinishMode; - SRes res; - if (p->dicPos == p->dicBufSize) - p->dicPos = 0; - dicPos = p->dicPos; - if (outSize > p->dicBufSize - dicPos) - { - outSizeCur = p->dicBufSize; - curFinishMode = LZMA_FINISH_ANY; - } - else - { - outSizeCur = dicPos + outSize; - curFinishMode = finishMode; - } - - res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); - src += inSizeCur; - inSize -= inSizeCur; - *srcLen += inSizeCur; - outSizeCur = p->dicPos - dicPos; - memcpy(dest, p->dic + dicPos, outSizeCur); - dest += outSizeCur; - outSize -= outSizeCur; - *destLen += outSizeCur; - if (res != 0) - return res; - if (outSizeCur == 0 || outSize == 0) - return SZ_OK; - } -} - -void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->probs); - p->probs = NULL; -} - -static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->dic); - p->dic = NULL; -} - -void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) -{ - LzmaDec_FreeProbs(p, alloc); - LzmaDec_FreeDict(p, alloc); -} - -SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) -{ - UInt32 dicSize; - Byte d; - - if (size < LZMA_PROPS_SIZE) - return SZ_ERROR_UNSUPPORTED; - else - dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); - - if (dicSize < LZMA_DIC_MIN) - dicSize = LZMA_DIC_MIN; - p->dicSize = dicSize; - - d = data[0]; - if (d >= (9 * 5 * 5)) - return SZ_ERROR_UNSUPPORTED; - - p->lc = d % 9; - d /= 9; - p->pb = d / 5; - p->lp = d % 5; - - return SZ_OK; -} - -static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) -{ - UInt32 numProbs = LzmaProps_GetNumProbs(propNew); - if (!p->probs || numProbs != p->numProbs) - { - LzmaDec_FreeProbs(p, alloc); - p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb)); - p->numProbs = numProbs; - if (!p->probs) - return SZ_ERROR_MEM; - } - return SZ_OK; -} - -SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) -{ - CLzmaProps propNew; - RINOK(LzmaProps_Decode(&propNew, props, propsSize)); - RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); - p->prop = propNew; - return SZ_OK; -} - -SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) -{ - CLzmaProps propNew; - SizeT dicBufSize; - RINOK(LzmaProps_Decode(&propNew, props, propsSize)); - RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); - - { - UInt32 dictSize = propNew.dicSize; - SizeT mask = ((UInt32)1 << 12) - 1; - if (dictSize >= ((UInt32)1 << 30)) mask = ((UInt32)1 << 22) - 1; - else if (dictSize >= ((UInt32)1 << 22)) mask = ((UInt32)1 << 20) - 1;; - dicBufSize = ((SizeT)dictSize + mask) & ~mask; - if (dicBufSize < dictSize) - dicBufSize = dictSize; - } - - if (!p->dic || dicBufSize != p->dicBufSize) - { - LzmaDec_FreeDict(p, alloc); - p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); - if (!p->dic) - { - LzmaDec_FreeProbs(p, alloc); - return SZ_ERROR_MEM; - } - } - p->dicBufSize = dicBufSize; - p->prop = propNew; - return SZ_OK; -} - -SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, - const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, - ELzmaStatus *status, ISzAlloc *alloc) -{ - CLzmaDec p; - SRes res; - SizeT outSize = *destLen, inSize = *srcLen; - *destLen = *srcLen = 0; - *status = LZMA_STATUS_NOT_SPECIFIED; - if (inSize < RC_INIT_SIZE) - return SZ_ERROR_INPUT_EOF; - LzmaDec_Construct(&p); - RINOK(LzmaDec_AllocateProbs(&p, propData, propSize, alloc)); - p.dic = dest; - p.dicBufSize = outSize; - LzmaDec_Init(&p); - *srcLen = inSize; - res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); - *destLen = p.dicPos; - if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) - res = SZ_ERROR_INPUT_EOF; - LzmaDec_FreeProbs(&p, alloc); - return res; -} diff --git a/jan/src/dep/libs/lib7z/LzmaDec.h b/jan/src/dep/libs/lib7z/LzmaDec.h deleted file mode 100644 index 2633abeac..000000000 --- a/jan/src/dep/libs/lib7z/LzmaDec.h +++ /dev/null @@ -1,227 +0,0 @@ -/* LzmaDec.h -- LZMA Decoder -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __LZMA_DEC_H -#define __LZMA_DEC_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -/* #define _LZMA_PROB32 */ -/* _LZMA_PROB32 can increase the speed on some CPUs, - but memory usage for CLzmaDec::probs will be doubled in that case */ - -#ifdef _LZMA_PROB32 -#define CLzmaProb UInt32 -#else -#define CLzmaProb UInt16 -#endif - - -/* ---------- LZMA Properties ---------- */ - -#define LZMA_PROPS_SIZE 5 - -typedef struct _CLzmaProps -{ - unsigned lc, lp, pb; - UInt32 dicSize; -} CLzmaProps; - -/* LzmaProps_Decode - decodes properties -Returns: - SZ_OK - SZ_ERROR_UNSUPPORTED - Unsupported properties -*/ - -SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); - - -/* ---------- LZMA Decoder state ---------- */ - -/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. - Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ - -#define LZMA_REQUIRED_INPUT_MAX 20 - -typedef struct -{ - CLzmaProps prop; - CLzmaProb *probs; - Byte *dic; - const Byte *buf; - UInt32 range, code; - SizeT dicPos; - SizeT dicBufSize; - UInt32 processedPos; - UInt32 checkDicSize; - unsigned state; - UInt32 reps[4]; - unsigned remainLen; - int needFlush; - int needInitState; - UInt32 numProbs; - unsigned tempBufSize; - Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; -} CLzmaDec; - -#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } - -void LzmaDec_Init(CLzmaDec *p); - -/* There are two types of LZMA streams: - 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. - 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ - -typedef enum -{ - LZMA_FINISH_ANY, /* finish at any point */ - LZMA_FINISH_END /* block must be finished at the end */ -} ELzmaFinishMode; - -/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! - - You must use LZMA_FINISH_END, when you know that current output buffer - covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. - - If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, - and output value of destLen will be less than output buffer size limit. - You can check status result also. - - You can use multiple checks to test data integrity after full decompression: - 1) Check Result and "status" variable. - 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. - 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. - You must use correct finish mode in that case. */ - -typedef enum -{ - LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ - LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ - LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ - LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ - LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ -} ELzmaStatus; - -/* ELzmaStatus is used only as output value for function call */ - - -/* ---------- Interfaces ---------- */ - -/* There are 3 levels of interfaces: - 1) Dictionary Interface - 2) Buffer Interface - 3) One Call Interface - You can select any of these interfaces, but don't mix functions from different - groups for same object. */ - - -/* There are two variants to allocate state for Dictionary Interface: - 1) LzmaDec_Allocate / LzmaDec_Free - 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs - You can use variant 2, if you set dictionary buffer manually. - For Buffer Interface you must always use variant 1. - -LzmaDec_Allocate* can return: - SZ_OK - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_UNSUPPORTED - Unsupported properties -*/ - -SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); -void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); - -SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); -void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); - -/* ---------- Dictionary Interface ---------- */ - -/* You can use it, if you want to eliminate the overhead for data copying from - dictionary to some other external buffer. - You must work with CLzmaDec variables directly in this interface. - - STEPS: - LzmaDec_Constr() - LzmaDec_Allocate() - for (each new stream) - { - LzmaDec_Init() - while (it needs more decompression) - { - LzmaDec_DecodeToDic() - use data from CLzmaDec::dic and update CLzmaDec::dicPos - } - } - LzmaDec_Free() -*/ - -/* LzmaDec_DecodeToDic - - The decoding to internal dictionary buffer (CLzmaDec::dic). - You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! - -finishMode: - It has meaning only if the decoding reaches output limit (dicLimit). - LZMA_FINISH_ANY - Decode just dicLimit bytes. - LZMA_FINISH_END - Stream must be finished after dicLimit. - -Returns: - SZ_OK - status: - LZMA_STATUS_FINISHED_WITH_MARK - LZMA_STATUS_NOT_FINISHED - LZMA_STATUS_NEEDS_MORE_INPUT - LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK - SZ_ERROR_DATA - Data error -*/ - -SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, - const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); - - -/* ---------- Buffer Interface ---------- */ - -/* It's zlib-like interface. - See LzmaDec_DecodeToDic description for information about STEPS and return results, - but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need - to work with CLzmaDec variables manually. - -finishMode: - It has meaning only if the decoding reaches output limit (*destLen). - LZMA_FINISH_ANY - Decode just destLen bytes. - LZMA_FINISH_END - Stream must be finished after (*destLen). -*/ - -SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, - const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); - - -/* ---------- One Call Interface ---------- */ - -/* LzmaDecode - -finishMode: - It has meaning only if the decoding reaches output limit (*destLen). - LZMA_FINISH_ANY - Decode just destLen bytes. - LZMA_FINISH_END - Stream must be finished after (*destLen). - -Returns: - SZ_OK - status: - LZMA_STATUS_FINISHED_WITH_MARK - LZMA_STATUS_NOT_FINISHED - LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK - SZ_ERROR_DATA - Data error - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_UNSUPPORTED - Unsupported properties - SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). -*/ - -SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, - const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, - ELzmaStatus *status, ISzAlloc *alloc); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/LzmaEnc.c b/jan/src/dep/libs/lib7z/LzmaEnc.c deleted file mode 100644 index 462ca6756..000000000 --- a/jan/src/dep/libs/lib7z/LzmaEnc.c +++ /dev/null @@ -1,2351 +0,0 @@ -/* LzmaEnc.c -- LZMA Encoder -2016-05-16 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include - -/* #define SHOW_STAT */ -/* #define SHOW_STAT2 */ - -#if defined(SHOW_STAT) || defined(SHOW_STAT2) -#include -#endif - -#include "LzmaEnc.h" - -#include "LzFind.h" -#ifndef _7ZIP_ST -#include "LzFindMt.h" -#endif - -#ifdef SHOW_STAT -static unsigned g_STAT_OFFSET = 0; -#endif - -#define kMaxHistorySize ((UInt32)3 << 29) -/* #define kMaxHistorySize ((UInt32)7 << 29) */ - -#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1) - -#define kBlockSize (9 << 10) -#define kUnpackBlockSize (1 << 18) -#define kMatchArraySize (1 << 21) -#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX) - -#define kNumMaxDirectBits (31) - -#define kNumTopBits 24 -#define kTopValue ((UInt32)1 << kNumTopBits) - -#define kNumBitModelTotalBits 11 -#define kBitModelTotal (1 << kNumBitModelTotalBits) -#define kNumMoveBits 5 -#define kProbInitValue (kBitModelTotal >> 1) - -#define kNumMoveReducingBits 4 -#define kNumBitPriceShiftBits 4 -#define kBitPrice (1 << kNumBitPriceShiftBits) - -void LzmaEncProps_Init(CLzmaEncProps *p) -{ - p->level = 5; - p->dictSize = p->mc = 0; - p->reduceSize = (UInt64)(Int64)-1; - p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1; - p->writeEndMark = 0; -} - -void LzmaEncProps_Normalize(CLzmaEncProps *p) -{ - int level = p->level; - if (level < 0) level = 5; - p->level = level; - - if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26))); - if (p->dictSize > p->reduceSize) - { - unsigned i; - for (i = 11; i <= 30; i++) - { - if ((UInt32)p->reduceSize <= ((UInt32)2 << i)) { p->dictSize = ((UInt32)2 << i); break; } - if ((UInt32)p->reduceSize <= ((UInt32)3 << i)) { p->dictSize = ((UInt32)3 << i); break; } - } - } - - if (p->lc < 0) p->lc = 3; - if (p->lp < 0) p->lp = 0; - if (p->pb < 0) p->pb = 2; - - if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); - if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); - if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); - if (p->numHashBytes < 0) p->numHashBytes = 4; - if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); - - if (p->numThreads < 0) - p->numThreads = - #ifndef _7ZIP_ST - ((p->btMode && p->algo) ? 2 : 1); - #else - 1; - #endif -} - -UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) -{ - CLzmaEncProps props = *props2; - LzmaEncProps_Normalize(&props); - return props.dictSize; -} - -#if (_MSC_VER >= 1400) -/* BSR code is fast for some new CPUs */ -/* #define LZMA_LOG_BSR */ -#endif - -#ifdef LZMA_LOG_BSR - -#define kDicLogSizeMaxCompress 32 - -#define BSR2_RET(pos, res) { unsigned long zz; _BitScanReverse(&zz, (pos)); res = (zz + zz) + ((pos >> (zz - 1)) & 1); } - -static UInt32 GetPosSlot1(UInt32 pos) -{ - UInt32 res; - BSR2_RET(pos, res); - return res; -} -#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } -#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } - -#else - -#define kNumLogBits (9 + sizeof(size_t) / 2) -/* #define kNumLogBits (11 + sizeof(size_t) / 8 * 3) */ - -#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) - -static void LzmaEnc_FastPosInit(Byte *g_FastPos) -{ - unsigned slot; - g_FastPos[0] = 0; - g_FastPos[1] = 1; - g_FastPos += 2; - - for (slot = 2; slot < kNumLogBits * 2; slot++) - { - size_t k = ((size_t)1 << ((slot >> 1) - 1)); - size_t j; - for (j = 0; j < k; j++) - g_FastPos[j] = (Byte)slot; - g_FastPos += k; - } -} - -/* we can use ((limit - pos) >> 31) only if (pos < ((UInt32)1 << 31)) */ -/* -#define BSR2_RET(pos, res) { UInt32 zz = 6 + ((kNumLogBits - 1) & \ - (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \ - res = p->g_FastPos[pos >> zz] + (zz * 2); } -*/ - -/* -#define BSR2_RET(pos, res) { UInt32 zz = 6 + ((kNumLogBits - 1) & \ - (0 - (((((UInt32)1 << (kNumLogBits)) - 1) - (pos >> 6)) >> 31))); \ - res = p->g_FastPos[pos >> zz] + (zz * 2); } -*/ - -#define BSR2_RET(pos, res) { UInt32 zz = (pos < (1 << (kNumLogBits + 6))) ? 6 : 6 + kNumLogBits - 1; \ - res = p->g_FastPos[pos >> zz] + (zz * 2); } - -/* -#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \ - p->g_FastPos[pos >> 6] + 12 : \ - p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; } -*/ - -#define GetPosSlot1(pos) p->g_FastPos[pos] -#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } -#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); } - -#endif - - -#define LZMA_NUM_REPS 4 - -typedef unsigned CState; - -typedef struct -{ - UInt32 price; - - CState state; - int prev1IsChar; - int prev2; - - UInt32 posPrev2; - UInt32 backPrev2; - - UInt32 posPrev; - UInt32 backPrev; - UInt32 backs[LZMA_NUM_REPS]; -} COptimal; - -#define kNumOpts (1 << 12) - -#define kNumLenToPosStates 4 -#define kNumPosSlotBits 6 -#define kDicLogSizeMin 0 -#define kDicLogSizeMax 32 -#define kDistTableSizeMax (kDicLogSizeMax * 2) - - -#define kNumAlignBits 4 -#define kAlignTableSize (1 << kNumAlignBits) -#define kAlignMask (kAlignTableSize - 1) - -#define kStartPosModelIndex 4 -#define kEndPosModelIndex 14 -#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex) - -#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) - -#ifdef _LZMA_PROB32 -#define CLzmaProb UInt32 -#else -#define CLzmaProb UInt16 -#endif - -#define LZMA_PB_MAX 4 -#define LZMA_LC_MAX 8 -#define LZMA_LP_MAX 4 - -#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX) - - -#define kLenNumLowBits 3 -#define kLenNumLowSymbols (1 << kLenNumLowBits) -#define kLenNumMidBits 3 -#define kLenNumMidSymbols (1 << kLenNumMidBits) -#define kLenNumHighBits 8 -#define kLenNumHighSymbols (1 << kLenNumHighBits) - -#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) - -#define LZMA_MATCH_LEN_MIN 2 -#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1) - -#define kNumStates 12 - - -typedef struct -{ - CLzmaProb choice; - CLzmaProb choice2; - CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits]; - CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits]; - CLzmaProb high[kLenNumHighSymbols]; -} CLenEnc; - - -typedef struct -{ - CLenEnc p; - UInt32 tableSize; - UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal]; - UInt32 counters[LZMA_NUM_PB_STATES_MAX]; -} CLenPriceEnc; - - -typedef struct -{ - UInt32 range; - Byte cache; - UInt64 low; - UInt64 cacheSize; - Byte *buf; - Byte *bufLim; - Byte *bufBase; - ISeqOutStream *outStream; - UInt64 processed; - SRes res; -} CRangeEnc; - - -typedef struct -{ - CLzmaProb *litProbs; - - UInt32 state; - UInt32 reps[LZMA_NUM_REPS]; - - CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; - CLzmaProb isRep[kNumStates]; - CLzmaProb isRepG0[kNumStates]; - CLzmaProb isRepG1[kNumStates]; - CLzmaProb isRepG2[kNumStates]; - CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; - - CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; - CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; - CLzmaProb posAlignEncoder[1 << kNumAlignBits]; - - CLenPriceEnc lenEnc; - CLenPriceEnc repLenEnc; -} CSaveState; - - -typedef struct -{ - void *matchFinderObj; - IMatchFinder matchFinder; - - UInt32 optimumEndIndex; - UInt32 optimumCurrentIndex; - - UInt32 longestMatchLength; - UInt32 numPairs; - UInt32 numAvail; - - UInt32 numFastBytes; - UInt32 additionalOffset; - UInt32 reps[LZMA_NUM_REPS]; - UInt32 state; - - unsigned lc, lp, pb; - unsigned lpMask, pbMask; - unsigned lclp; - - CLzmaProb *litProbs; - - Bool fastMode; - Bool writeEndMark; - Bool finished; - Bool multiThread; - Bool needInit; - - UInt64 nowPos64; - - UInt32 matchPriceCount; - UInt32 alignPriceCount; - - UInt32 distTableSize; - - UInt32 dictSize; - SRes result; - - CRangeEnc rc; - - #ifndef _7ZIP_ST - Bool mtMode; - CMatchFinderMt matchFinderMt; - #endif - - CMatchFinder matchFinderBase; - - #ifndef _7ZIP_ST - Byte pad[128]; - #endif - - COptimal opt[kNumOpts]; - - #ifndef LZMA_LOG_BSR - Byte g_FastPos[1 << kNumLogBits]; - #endif - - UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits]; - UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1]; - - UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax]; - UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances]; - UInt32 alignPrices[kAlignTableSize]; - - CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; - CLzmaProb isRep[kNumStates]; - CLzmaProb isRepG0[kNumStates]; - CLzmaProb isRepG1[kNumStates]; - CLzmaProb isRepG2[kNumStates]; - CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; - - CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; - CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; - CLzmaProb posAlignEncoder[1 << kNumAlignBits]; - - CLenPriceEnc lenEnc; - CLenPriceEnc repLenEnc; - - CSaveState saveState; - - #ifndef _7ZIP_ST - Byte pad2[128]; - #endif -} CLzmaEnc; - - -void LzmaEnc_SaveState(CLzmaEncHandle pp) -{ - CLzmaEnc *p = (CLzmaEnc *)pp; - CSaveState *dest = &p->saveState; - int i; - dest->lenEnc = p->lenEnc; - dest->repLenEnc = p->repLenEnc; - dest->state = p->state; - - for (i = 0; i < kNumStates; i++) - { - memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); - memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); - } - for (i = 0; i < kNumLenToPosStates; i++) - memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); - memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); - memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); - memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); - memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); - memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); - memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); - memcpy(dest->reps, p->reps, sizeof(p->reps)); - memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << p->lclp) * sizeof(CLzmaProb)); -} - -void LzmaEnc_RestoreState(CLzmaEncHandle pp) -{ - CLzmaEnc *dest = (CLzmaEnc *)pp; - const CSaveState *p = &dest->saveState; - int i; - dest->lenEnc = p->lenEnc; - dest->repLenEnc = p->repLenEnc; - dest->state = p->state; - - for (i = 0; i < kNumStates; i++) - { - memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); - memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); - } - for (i = 0; i < kNumLenToPosStates; i++) - memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); - memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); - memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); - memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); - memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); - memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); - memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); - memcpy(dest->reps, p->reps, sizeof(p->reps)); - memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << dest->lclp) * sizeof(CLzmaProb)); -} - -SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) -{ - CLzmaEnc *p = (CLzmaEnc *)pp; - CLzmaEncProps props = *props2; - LzmaEncProps_Normalize(&props); - - if (props.lc > LZMA_LC_MAX - || props.lp > LZMA_LP_MAX - || props.pb > LZMA_PB_MAX - || props.dictSize > ((UInt64)1 << kDicLogSizeMaxCompress) - || props.dictSize > kMaxHistorySize) - return SZ_ERROR_PARAM; - - p->dictSize = props.dictSize; - { - unsigned fb = props.fb; - if (fb < 5) - fb = 5; - if (fb > LZMA_MATCH_LEN_MAX) - fb = LZMA_MATCH_LEN_MAX; - p->numFastBytes = fb; - } - p->lc = props.lc; - p->lp = props.lp; - p->pb = props.pb; - p->fastMode = (props.algo == 0); - p->matchFinderBase.btMode = (Byte)(props.btMode ? 1 : 0); - { - UInt32 numHashBytes = 4; - if (props.btMode) - { - if (props.numHashBytes < 2) - numHashBytes = 2; - else if (props.numHashBytes < 4) - numHashBytes = props.numHashBytes; - } - p->matchFinderBase.numHashBytes = numHashBytes; - } - - p->matchFinderBase.cutValue = props.mc; - - p->writeEndMark = props.writeEndMark; - - #ifndef _7ZIP_ST - /* - if (newMultiThread != _multiThread) - { - ReleaseMatchFinder(); - _multiThread = newMultiThread; - } - */ - p->multiThread = (props.numThreads > 1); - #endif - - return SZ_OK; -} - -static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; -static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; -static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; -static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; - -#define IsCharState(s) ((s) < 7) - -#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1) - -#define kInfinityPrice (1 << 30) - -static void RangeEnc_Construct(CRangeEnc *p) -{ - p->outStream = NULL; - p->bufBase = NULL; -} - -#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize) - -#define RC_BUF_SIZE (1 << 16) -static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc) -{ - if (!p->bufBase) - { - p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE); - if (!p->bufBase) - return 0; - p->bufLim = p->bufBase + RC_BUF_SIZE; - } - return 1; -} - -static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->bufBase); - p->bufBase = 0; -} - -static void RangeEnc_Init(CRangeEnc *p) -{ - /* Stream.Init(); */ - p->low = 0; - p->range = 0xFFFFFFFF; - p->cacheSize = 1; - p->cache = 0; - - p->buf = p->bufBase; - - p->processed = 0; - p->res = SZ_OK; -} - -static void RangeEnc_FlushStream(CRangeEnc *p) -{ - size_t num; - if (p->res != SZ_OK) - return; - num = p->buf - p->bufBase; - if (num != p->outStream->Write(p->outStream, p->bufBase, num)) - p->res = SZ_ERROR_WRITE; - p->processed += num; - p->buf = p->bufBase; -} - -static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p) -{ - if ((UInt32)p->low < (UInt32)0xFF000000 || (unsigned)(p->low >> 32) != 0) - { - Byte temp = p->cache; - do - { - Byte *buf = p->buf; - *buf++ = (Byte)(temp + (Byte)(p->low >> 32)); - p->buf = buf; - if (buf == p->bufLim) - RangeEnc_FlushStream(p); - temp = 0xFF; - } - while (--p->cacheSize != 0); - p->cache = (Byte)((UInt32)p->low >> 24); - } - p->cacheSize++; - p->low = (UInt32)p->low << 8; -} - -static void RangeEnc_FlushData(CRangeEnc *p) -{ - int i; - for (i = 0; i < 5; i++) - RangeEnc_ShiftLow(p); -} - -static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, unsigned numBits) -{ - do - { - p->range >>= 1; - p->low += p->range & (0 - ((value >> --numBits) & 1)); - if (p->range < kTopValue) - { - p->range <<= 8; - RangeEnc_ShiftLow(p); - } - } - while (numBits != 0); -} - -static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol) -{ - UInt32 ttt = *prob; - UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt; - if (symbol == 0) - { - p->range = newBound; - ttt += (kBitModelTotal - ttt) >> kNumMoveBits; - } - else - { - p->low += newBound; - p->range -= newBound; - ttt -= ttt >> kNumMoveBits; - } - *prob = (CLzmaProb)ttt; - if (p->range < kTopValue) - { - p->range <<= 8; - RangeEnc_ShiftLow(p); - } -} - -static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol) -{ - symbol |= 0x100; - do - { - RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1); - symbol <<= 1; - } - while (symbol < 0x10000); -} - -static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte) -{ - UInt32 offs = 0x100; - symbol |= 0x100; - do - { - matchByte <<= 1; - RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1); - symbol <<= 1; - offs &= ~(matchByte ^ symbol); - } - while (symbol < 0x10000); -} - -static void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) -{ - UInt32 i; - for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) - { - const int kCyclesBits = kNumBitPriceShiftBits; - UInt32 w = i; - UInt32 bitCount = 0; - int j; - for (j = 0; j < kCyclesBits; j++) - { - w = w * w; - bitCount <<= 1; - while (w >= ((UInt32)1 << 16)) - { - w >>= 1; - bitCount++; - } - } - ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount); - } -} - - -#define GET_PRICE(prob, symbol) \ - p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; - -#define GET_PRICEa(prob, symbol) \ - ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; - -#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits] -#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] - -#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits] -#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] - -static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, const UInt32 *ProbPrices) -{ - UInt32 price = 0; - symbol |= 0x100; - do - { - price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1); - symbol <<= 1; - } - while (symbol < 0x10000); - return price; -} - -static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, const UInt32 *ProbPrices) -{ - UInt32 price = 0; - UInt32 offs = 0x100; - symbol |= 0x100; - do - { - matchByte <<= 1; - price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1); - symbol <<= 1; - offs &= ~(matchByte ^ symbol); - } - while (symbol < 0x10000); - return price; -} - - -static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) -{ - UInt32 m = 1; - int i; - for (i = numBitLevels; i != 0;) - { - UInt32 bit; - i--; - bit = (symbol >> i) & 1; - RangeEnc_EncodeBit(rc, probs + m, bit); - m = (m << 1) | bit; - } -} - -static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) -{ - UInt32 m = 1; - int i; - for (i = 0; i < numBitLevels; i++) - { - UInt32 bit = symbol & 1; - RangeEnc_EncodeBit(rc, probs + m, bit); - m = (m << 1) | bit; - symbol >>= 1; - } -} - -static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, const UInt32 *ProbPrices) -{ - UInt32 price = 0; - symbol |= (1 << numBitLevels); - while (symbol != 1) - { - price += GET_PRICEa(probs[symbol >> 1], symbol & 1); - symbol >>= 1; - } - return price; -} - -static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, const UInt32 *ProbPrices) -{ - UInt32 price = 0; - UInt32 m = 1; - int i; - for (i = numBitLevels; i != 0; i--) - { - UInt32 bit = symbol & 1; - symbol >>= 1; - price += GET_PRICEa(probs[m], bit); - m = (m << 1) | bit; - } - return price; -} - - -static void LenEnc_Init(CLenEnc *p) -{ - unsigned i; - p->choice = p->choice2 = kProbInitValue; - for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++) - p->low[i] = kProbInitValue; - for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++) - p->mid[i] = kProbInitValue; - for (i = 0; i < kLenNumHighSymbols; i++) - p->high[i] = kProbInitValue; -} - -static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState) -{ - if (symbol < kLenNumLowSymbols) - { - RangeEnc_EncodeBit(rc, &p->choice, 0); - RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol); - } - else - { - RangeEnc_EncodeBit(rc, &p->choice, 1); - if (symbol < kLenNumLowSymbols + kLenNumMidSymbols) - { - RangeEnc_EncodeBit(rc, &p->choice2, 0); - RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols); - } - else - { - RangeEnc_EncodeBit(rc, &p->choice2, 1); - RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols); - } - } -} - -static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, const UInt32 *ProbPrices) -{ - UInt32 a0 = GET_PRICE_0a(p->choice); - UInt32 a1 = GET_PRICE_1a(p->choice); - UInt32 b0 = a1 + GET_PRICE_0a(p->choice2); - UInt32 b1 = a1 + GET_PRICE_1a(p->choice2); - UInt32 i = 0; - for (i = 0; i < kLenNumLowSymbols; i++) - { - if (i >= numSymbols) - return; - prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices); - } - for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++) - { - if (i >= numSymbols) - return; - prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices); - } - for (; i < numSymbols; i++) - prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices); -} - -static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, const UInt32 *ProbPrices) -{ - LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices); - p->counters[posState] = p->tableSize; -} - -static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, const UInt32 *ProbPrices) -{ - UInt32 posState; - for (posState = 0; posState < numPosStates; posState++) - LenPriceEnc_UpdateTable(p, posState, ProbPrices); -} - -static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, const UInt32 *ProbPrices) -{ - LenEnc_Encode(&p->p, rc, symbol, posState); - if (updatePrice) - if (--p->counters[posState] == 0) - LenPriceEnc_UpdateTable(p, posState, ProbPrices); -} - - - - -static void MovePos(CLzmaEnc *p, UInt32 num) -{ - #ifdef SHOW_STAT - g_STAT_OFFSET += num; - printf("\n MovePos %u", num); - #endif - - if (num != 0) - { - p->additionalOffset += num; - p->matchFinder.Skip(p->matchFinderObj, num); - } -} - -static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes) -{ - UInt32 lenRes = 0, numPairs; - p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); - numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches); - - #ifdef SHOW_STAT - printf("\n i = %u numPairs = %u ", g_STAT_OFFSET, numPairs / 2); - g_STAT_OFFSET++; - { - UInt32 i; - for (i = 0; i < numPairs; i += 2) - printf("%2u %6u | ", p->matches[i], p->matches[i + 1]); - } - #endif - - if (numPairs > 0) - { - lenRes = p->matches[numPairs - 2]; - if (lenRes == p->numFastBytes) - { - UInt32 numAvail = p->numAvail; - if (numAvail > LZMA_MATCH_LEN_MAX) - numAvail = LZMA_MATCH_LEN_MAX; - { - const Byte *pbyCur = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; - const Byte *pby = pbyCur + lenRes; - ptrdiff_t dif = (ptrdiff_t)-1 - p->matches[numPairs - 1]; - const Byte *pbyLim = pbyCur + numAvail; - for (; pby != pbyLim && *pby == pby[dif]; pby++); - lenRes = (UInt32)(pby - pbyCur); - } - } - } - p->additionalOffset++; - *numDistancePairsRes = numPairs; - return lenRes; -} - - -#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False; -#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False; -#define IsShortRep(p) ((p)->backPrev == 0) - -static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState) -{ - return - GET_PRICE_0(p->isRepG0[state]) + - GET_PRICE_0(p->isRep0Long[state][posState]); -} - -static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState) -{ - UInt32 price; - if (repIndex == 0) - { - price = GET_PRICE_0(p->isRepG0[state]); - price += GET_PRICE_1(p->isRep0Long[state][posState]); - } - else - { - price = GET_PRICE_1(p->isRepG0[state]); - if (repIndex == 1) - price += GET_PRICE_0(p->isRepG1[state]); - else - { - price += GET_PRICE_1(p->isRepG1[state]); - price += GET_PRICE(p->isRepG2[state], repIndex - 2); - } - } - return price; -} - -static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState) -{ - return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] + - GetPureRepPrice(p, repIndex, state, posState); -} - -static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur) -{ - UInt32 posMem = p->opt[cur].posPrev; - UInt32 backMem = p->opt[cur].backPrev; - p->optimumEndIndex = cur; - do - { - if (p->opt[cur].prev1IsChar) - { - MakeAsChar(&p->opt[posMem]) - p->opt[posMem].posPrev = posMem - 1; - if (p->opt[cur].prev2) - { - p->opt[posMem - 1].prev1IsChar = False; - p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2; - p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2; - } - } - { - UInt32 posPrev = posMem; - UInt32 backCur = backMem; - - backMem = p->opt[posPrev].backPrev; - posMem = p->opt[posPrev].posPrev; - - p->opt[posPrev].backPrev = backCur; - p->opt[posPrev].posPrev = cur; - cur = posPrev; - } - } - while (cur != 0); - *backRes = p->opt[0].backPrev; - p->optimumCurrentIndex = p->opt[0].posPrev; - return p->optimumCurrentIndex; -} - -#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * (UInt32)0x300) - -static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes) -{ - UInt32 lenEnd, cur; - UInt32 reps[LZMA_NUM_REPS], repLens[LZMA_NUM_REPS]; - UInt32 *matches; - - { - - UInt32 numAvail, mainLen, numPairs, repMaxIndex, i, posState, len; - UInt32 matchPrice, repMatchPrice, normalMatchPrice; - const Byte *data; - Byte curByte, matchByte; - - if (p->optimumEndIndex != p->optimumCurrentIndex) - { - const COptimal *opt = &p->opt[p->optimumCurrentIndex]; - UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex; - *backRes = opt->backPrev; - p->optimumCurrentIndex = opt->posPrev; - return lenRes; - } - p->optimumCurrentIndex = p->optimumEndIndex = 0; - - if (p->additionalOffset == 0) - mainLen = ReadMatchDistances(p, &numPairs); - else - { - mainLen = p->longestMatchLength; - numPairs = p->numPairs; - } - - numAvail = p->numAvail; - if (numAvail < 2) - { - *backRes = (UInt32)(-1); - return 1; - } - if (numAvail > LZMA_MATCH_LEN_MAX) - numAvail = LZMA_MATCH_LEN_MAX; - - data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; - repMaxIndex = 0; - for (i = 0; i < LZMA_NUM_REPS; i++) - { - UInt32 lenTest; - const Byte *data2; - reps[i] = p->reps[i]; - data2 = data - reps[i] - 1; - if (data[0] != data2[0] || data[1] != data2[1]) - { - repLens[i] = 0; - continue; - } - for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); - repLens[i] = lenTest; - if (lenTest > repLens[repMaxIndex]) - repMaxIndex = i; - } - if (repLens[repMaxIndex] >= p->numFastBytes) - { - UInt32 lenRes; - *backRes = repMaxIndex; - lenRes = repLens[repMaxIndex]; - MovePos(p, lenRes - 1); - return lenRes; - } - - matches = p->matches; - if (mainLen >= p->numFastBytes) - { - *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; - MovePos(p, mainLen - 1); - return mainLen; - } - curByte = *data; - matchByte = *(data - (reps[0] + 1)); - - if (mainLen < 2 && curByte != matchByte && repLens[repMaxIndex] < 2) - { - *backRes = (UInt32)-1; - return 1; - } - - p->opt[0].state = (CState)p->state; - - posState = (position & p->pbMask); - - { - const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); - p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) + - (!IsCharState(p->state) ? - LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : - LitEnc_GetPrice(probs, curByte, p->ProbPrices)); - } - - MakeAsChar(&p->opt[1]); - - matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]); - repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]); - - if (matchByte == curByte) - { - UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState); - if (shortRepPrice < p->opt[1].price) - { - p->opt[1].price = shortRepPrice; - MakeAsShortRep(&p->opt[1]); - } - } - lenEnd = ((mainLen >= repLens[repMaxIndex]) ? mainLen : repLens[repMaxIndex]); - - if (lenEnd < 2) - { - *backRes = p->opt[1].backPrev; - return 1; - } - - p->opt[1].posPrev = 0; - for (i = 0; i < LZMA_NUM_REPS; i++) - p->opt[0].backs[i] = reps[i]; - - len = lenEnd; - do - p->opt[len--].price = kInfinityPrice; - while (len >= 2); - - for (i = 0; i < LZMA_NUM_REPS; i++) - { - UInt32 repLen = repLens[i]; - UInt32 price; - if (repLen < 2) - continue; - price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState); - do - { - UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2]; - COptimal *opt = &p->opt[repLen]; - if (curAndLenPrice < opt->price) - { - opt->price = curAndLenPrice; - opt->posPrev = 0; - opt->backPrev = i; - opt->prev1IsChar = False; - } - } - while (--repLen >= 2); - } - - normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]); - - len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2); - if (len <= mainLen) - { - UInt32 offs = 0; - while (len > matches[offs]) - offs += 2; - for (; ; len++) - { - COptimal *opt; - UInt32 distance = matches[offs + 1]; - - UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN]; - UInt32 lenToPosState = GetLenToPosState(len); - if (distance < kNumFullDistances) - curAndLenPrice += p->distancesPrices[lenToPosState][distance]; - else - { - UInt32 slot; - GetPosSlot2(distance, slot); - curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot]; - } - opt = &p->opt[len]; - if (curAndLenPrice < opt->price) - { - opt->price = curAndLenPrice; - opt->posPrev = 0; - opt->backPrev = distance + LZMA_NUM_REPS; - opt->prev1IsChar = False; - } - if (len == matches[offs]) - { - offs += 2; - if (offs == numPairs) - break; - } - } - } - - cur = 0; - - #ifdef SHOW_STAT2 - /* if (position >= 0) */ - { - unsigned i; - printf("\n pos = %4X", position); - for (i = cur; i <= lenEnd; i++) - printf("\nprice[%4X] = %u", position - cur + i, p->opt[i].price); - } - #endif - - } - - for (;;) - { - UInt32 numAvail; - UInt32 numAvailFull, newLen, numPairs, posPrev, state, posState, startLen; - UInt32 curPrice, curAnd1Price, matchPrice, repMatchPrice; - Bool nextIsChar; - Byte curByte, matchByte; - const Byte *data; - COptimal *curOpt; - COptimal *nextOpt; - - cur++; - if (cur == lenEnd) - return Backward(p, backRes, cur); - - newLen = ReadMatchDistances(p, &numPairs); - if (newLen >= p->numFastBytes) - { - p->numPairs = numPairs; - p->longestMatchLength = newLen; - return Backward(p, backRes, cur); - } - position++; - curOpt = &p->opt[cur]; - posPrev = curOpt->posPrev; - if (curOpt->prev1IsChar) - { - posPrev--; - if (curOpt->prev2) - { - state = p->opt[curOpt->posPrev2].state; - if (curOpt->backPrev2 < LZMA_NUM_REPS) - state = kRepNextStates[state]; - else - state = kMatchNextStates[state]; - } - else - state = p->opt[posPrev].state; - state = kLiteralNextStates[state]; - } - else - state = p->opt[posPrev].state; - if (posPrev == cur - 1) - { - if (IsShortRep(curOpt)) - state = kShortRepNextStates[state]; - else - state = kLiteralNextStates[state]; - } - else - { - UInt32 pos; - const COptimal *prevOpt; - if (curOpt->prev1IsChar && curOpt->prev2) - { - posPrev = curOpt->posPrev2; - pos = curOpt->backPrev2; - state = kRepNextStates[state]; - } - else - { - pos = curOpt->backPrev; - if (pos < LZMA_NUM_REPS) - state = kRepNextStates[state]; - else - state = kMatchNextStates[state]; - } - prevOpt = &p->opt[posPrev]; - if (pos < LZMA_NUM_REPS) - { - UInt32 i; - reps[0] = prevOpt->backs[pos]; - for (i = 1; i <= pos; i++) - reps[i] = prevOpt->backs[i - 1]; - for (; i < LZMA_NUM_REPS; i++) - reps[i] = prevOpt->backs[i]; - } - else - { - UInt32 i; - reps[0] = (pos - LZMA_NUM_REPS); - for (i = 1; i < LZMA_NUM_REPS; i++) - reps[i] = prevOpt->backs[i - 1]; - } - } - curOpt->state = (CState)state; - - curOpt->backs[0] = reps[0]; - curOpt->backs[1] = reps[1]; - curOpt->backs[2] = reps[2]; - curOpt->backs[3] = reps[3]; - - curPrice = curOpt->price; - nextIsChar = False; - data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; - curByte = *data; - matchByte = *(data - (reps[0] + 1)); - - posState = (position & p->pbMask); - - curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]); - { - const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); - curAnd1Price += - (!IsCharState(state) ? - LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : - LitEnc_GetPrice(probs, curByte, p->ProbPrices)); - } - - nextOpt = &p->opt[cur + 1]; - - if (curAnd1Price < nextOpt->price) - { - nextOpt->price = curAnd1Price; - nextOpt->posPrev = cur; - MakeAsChar(nextOpt); - nextIsChar = True; - } - - matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]); - repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]); - - if (matchByte == curByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0)) - { - UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState); - if (shortRepPrice <= nextOpt->price) - { - nextOpt->price = shortRepPrice; - nextOpt->posPrev = cur; - MakeAsShortRep(nextOpt); - nextIsChar = True; - } - } - numAvailFull = p->numAvail; - { - UInt32 temp = kNumOpts - 1 - cur; - if (temp < numAvailFull) - numAvailFull = temp; - } - - if (numAvailFull < 2) - continue; - numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes); - - if (!nextIsChar && matchByte != curByte) /* speed optimization */ - { - /* try Literal + rep0 */ - UInt32 temp; - UInt32 lenTest2; - const Byte *data2 = data - reps[0] - 1; - UInt32 limit = p->numFastBytes + 1; - if (limit > numAvailFull) - limit = numAvailFull; - - for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++); - lenTest2 = temp - 1; - if (lenTest2 >= 2) - { - UInt32 state2 = kLiteralNextStates[state]; - UInt32 posStateNext = (position + 1) & p->pbMask; - UInt32 nextRepMatchPrice = curAnd1Price + - GET_PRICE_1(p->isMatch[state2][posStateNext]) + - GET_PRICE_1(p->isRep[state2]); - /* for (; lenTest2 >= 2; lenTest2--) */ - { - UInt32 curAndLenPrice; - COptimal *opt; - UInt32 offset = cur + 1 + lenTest2; - while (lenEnd < offset) - p->opt[++lenEnd].price = kInfinityPrice; - curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); - opt = &p->opt[offset]; - if (curAndLenPrice < opt->price) - { - opt->price = curAndLenPrice; - opt->posPrev = cur + 1; - opt->backPrev = 0; - opt->prev1IsChar = True; - opt->prev2 = False; - } - } - } - } - - startLen = 2; /* speed optimization */ - { - UInt32 repIndex; - for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++) - { - UInt32 lenTest; - UInt32 lenTestTemp; - UInt32 price; - const Byte *data2 = data - reps[repIndex] - 1; - if (data[0] != data2[0] || data[1] != data2[1]) - continue; - for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); - while (lenEnd < cur + lenTest) - p->opt[++lenEnd].price = kInfinityPrice; - lenTestTemp = lenTest; - price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState); - do - { - UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2]; - COptimal *opt = &p->opt[cur + lenTest]; - if (curAndLenPrice < opt->price) - { - opt->price = curAndLenPrice; - opt->posPrev = cur; - opt->backPrev = repIndex; - opt->prev1IsChar = False; - } - } - while (--lenTest >= 2); - lenTest = lenTestTemp; - - if (repIndex == 0) - startLen = lenTest + 1; - - /* if (_maxMode) */ - { - UInt32 lenTest2 = lenTest + 1; - UInt32 limit = lenTest2 + p->numFastBytes; - if (limit > numAvailFull) - limit = numAvailFull; - for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); - lenTest2 -= lenTest + 1; - if (lenTest2 >= 2) - { - UInt32 nextRepMatchPrice; - UInt32 state2 = kRepNextStates[state]; - UInt32 posStateNext = (position + lenTest) & p->pbMask; - UInt32 curAndLenCharPrice = - price + p->repLenEnc.prices[posState][lenTest - 2] + - GET_PRICE_0(p->isMatch[state2][posStateNext]) + - LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), - data[lenTest], data2[lenTest], p->ProbPrices); - state2 = kLiteralNextStates[state2]; - posStateNext = (position + lenTest + 1) & p->pbMask; - nextRepMatchPrice = curAndLenCharPrice + - GET_PRICE_1(p->isMatch[state2][posStateNext]) + - GET_PRICE_1(p->isRep[state2]); - - /* for (; lenTest2 >= 2; lenTest2--) */ - { - UInt32 curAndLenPrice; - COptimal *opt; - UInt32 offset = cur + lenTest + 1 + lenTest2; - while (lenEnd < offset) - p->opt[++lenEnd].price = kInfinityPrice; - curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); - opt = &p->opt[offset]; - if (curAndLenPrice < opt->price) - { - opt->price = curAndLenPrice; - opt->posPrev = cur + lenTest + 1; - opt->backPrev = 0; - opt->prev1IsChar = True; - opt->prev2 = True; - opt->posPrev2 = cur; - opt->backPrev2 = repIndex; - } - } - } - } - } - } - /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */ - if (newLen > numAvail) - { - newLen = numAvail; - for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2); - matches[numPairs] = newLen; - numPairs += 2; - } - if (newLen >= startLen) - { - UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]); - UInt32 offs, curBack, posSlot; - UInt32 lenTest; - while (lenEnd < cur + newLen) - p->opt[++lenEnd].price = kInfinityPrice; - - offs = 0; - while (startLen > matches[offs]) - offs += 2; - curBack = matches[offs + 1]; - GetPosSlot2(curBack, posSlot); - for (lenTest = /*2*/ startLen; ; lenTest++) - { - UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN]; - { - UInt32 lenToPosState = GetLenToPosState(lenTest); - COptimal *opt; - if (curBack < kNumFullDistances) - curAndLenPrice += p->distancesPrices[lenToPosState][curBack]; - else - curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask]; - - opt = &p->opt[cur + lenTest]; - if (curAndLenPrice < opt->price) - { - opt->price = curAndLenPrice; - opt->posPrev = cur; - opt->backPrev = curBack + LZMA_NUM_REPS; - opt->prev1IsChar = False; - } - } - - if (/*_maxMode && */lenTest == matches[offs]) - { - /* Try Match + Literal + Rep0 */ - const Byte *data2 = data - curBack - 1; - UInt32 lenTest2 = lenTest + 1; - UInt32 limit = lenTest2 + p->numFastBytes; - if (limit > numAvailFull) - limit = numAvailFull; - for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); - lenTest2 -= lenTest + 1; - if (lenTest2 >= 2) - { - UInt32 nextRepMatchPrice; - UInt32 state2 = kMatchNextStates[state]; - UInt32 posStateNext = (position + lenTest) & p->pbMask; - UInt32 curAndLenCharPrice = curAndLenPrice + - GET_PRICE_0(p->isMatch[state2][posStateNext]) + - LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), - data[lenTest], data2[lenTest], p->ProbPrices); - state2 = kLiteralNextStates[state2]; - posStateNext = (posStateNext + 1) & p->pbMask; - nextRepMatchPrice = curAndLenCharPrice + - GET_PRICE_1(p->isMatch[state2][posStateNext]) + - GET_PRICE_1(p->isRep[state2]); - - /* for (; lenTest2 >= 2; lenTest2--) */ - { - UInt32 offset = cur + lenTest + 1 + lenTest2; - UInt32 curAndLenPrice2; - COptimal *opt; - while (lenEnd < offset) - p->opt[++lenEnd].price = kInfinityPrice; - curAndLenPrice2 = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); - opt = &p->opt[offset]; - if (curAndLenPrice2 < opt->price) - { - opt->price = curAndLenPrice2; - opt->posPrev = cur + lenTest + 1; - opt->backPrev = 0; - opt->prev1IsChar = True; - opt->prev2 = True; - opt->posPrev2 = cur; - opt->backPrev2 = curBack + LZMA_NUM_REPS; - } - } - } - offs += 2; - if (offs == numPairs) - break; - curBack = matches[offs + 1]; - if (curBack >= kNumFullDistances) - GetPosSlot2(curBack, posSlot); - } - } - } - } -} - -#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist)) - -static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes) -{ - UInt32 numAvail, mainLen, mainDist, numPairs, repIndex, repLen, i; - const Byte *data; - const UInt32 *matches; - - if (p->additionalOffset == 0) - mainLen = ReadMatchDistances(p, &numPairs); - else - { - mainLen = p->longestMatchLength; - numPairs = p->numPairs; - } - - numAvail = p->numAvail; - *backRes = (UInt32)-1; - if (numAvail < 2) - return 1; - if (numAvail > LZMA_MATCH_LEN_MAX) - numAvail = LZMA_MATCH_LEN_MAX; - data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; - - repLen = repIndex = 0; - for (i = 0; i < LZMA_NUM_REPS; i++) - { - UInt32 len; - const Byte *data2 = data - p->reps[i] - 1; - if (data[0] != data2[0] || data[1] != data2[1]) - continue; - for (len = 2; len < numAvail && data[len] == data2[len]; len++); - if (len >= p->numFastBytes) - { - *backRes = i; - MovePos(p, len - 1); - return len; - } - if (len > repLen) - { - repIndex = i; - repLen = len; - } - } - - matches = p->matches; - if (mainLen >= p->numFastBytes) - { - *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; - MovePos(p, mainLen - 1); - return mainLen; - } - - mainDist = 0; /* for GCC */ - if (mainLen >= 2) - { - mainDist = matches[numPairs - 1]; - while (numPairs > 2 && mainLen == matches[numPairs - 4] + 1) - { - if (!ChangePair(matches[numPairs - 3], mainDist)) - break; - numPairs -= 2; - mainLen = matches[numPairs - 2]; - mainDist = matches[numPairs - 1]; - } - if (mainLen == 2 && mainDist >= 0x80) - mainLen = 1; - } - - if (repLen >= 2 && ( - (repLen + 1 >= mainLen) || - (repLen + 2 >= mainLen && mainDist >= (1 << 9)) || - (repLen + 3 >= mainLen && mainDist >= (1 << 15)))) - { - *backRes = repIndex; - MovePos(p, repLen - 1); - return repLen; - } - - if (mainLen < 2 || numAvail <= 2) - return 1; - - p->longestMatchLength = ReadMatchDistances(p, &p->numPairs); - if (p->longestMatchLength >= 2) - { - UInt32 newDistance = matches[p->numPairs - 1]; - if ((p->longestMatchLength >= mainLen && newDistance < mainDist) || - (p->longestMatchLength == mainLen + 1 && !ChangePair(mainDist, newDistance)) || - (p->longestMatchLength > mainLen + 1) || - (p->longestMatchLength + 1 >= mainLen && mainLen >= 3 && ChangePair(newDistance, mainDist))) - return 1; - } - - data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; - for (i = 0; i < LZMA_NUM_REPS; i++) - { - UInt32 len, limit; - const Byte *data2 = data - p->reps[i] - 1; - if (data[0] != data2[0] || data[1] != data2[1]) - continue; - limit = mainLen - 1; - for (len = 2; len < limit && data[len] == data2[len]; len++); - if (len >= limit) - return 1; - } - *backRes = mainDist + LZMA_NUM_REPS; - MovePos(p, mainLen - 2); - return mainLen; -} - -static void WriteEndMarker(CLzmaEnc *p, UInt32 posState) -{ - UInt32 len; - RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); - RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); - p->state = kMatchNextStates[p->state]; - len = LZMA_MATCH_LEN_MIN; - LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); - RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1); - RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits); - RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask); -} - -static SRes CheckErrors(CLzmaEnc *p) -{ - if (p->result != SZ_OK) - return p->result; - if (p->rc.res != SZ_OK) - p->result = SZ_ERROR_WRITE; - if (p->matchFinderBase.result != SZ_OK) - p->result = SZ_ERROR_READ; - if (p->result != SZ_OK) - p->finished = True; - return p->result; -} - -static SRes Flush(CLzmaEnc *p, UInt32 nowPos) -{ - /* ReleaseMFStream(); */ - p->finished = True; - if (p->writeEndMark) - WriteEndMarker(p, nowPos & p->pbMask); - RangeEnc_FlushData(&p->rc); - RangeEnc_FlushStream(&p->rc); - return CheckErrors(p); -} - -static void FillAlignPrices(CLzmaEnc *p) -{ - UInt32 i; - for (i = 0; i < kAlignTableSize; i++) - p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices); - p->alignPriceCount = 0; -} - -static void FillDistancesPrices(CLzmaEnc *p) -{ - UInt32 tempPrices[kNumFullDistances]; - UInt32 i, lenToPosState; - for (i = kStartPosModelIndex; i < kNumFullDistances; i++) - { - UInt32 posSlot = GetPosSlot1(i); - UInt32 footerBits = ((posSlot >> 1) - 1); - UInt32 base = ((2 | (posSlot & 1)) << footerBits); - tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices); - } - - for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++) - { - UInt32 posSlot; - const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState]; - UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState]; - for (posSlot = 0; posSlot < p->distTableSize; posSlot++) - posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices); - for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++) - posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits); - - { - UInt32 *distancesPrices = p->distancesPrices[lenToPosState]; - for (i = 0; i < kStartPosModelIndex; i++) - distancesPrices[i] = posSlotPrices[i]; - for (; i < kNumFullDistances; i++) - distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i]; - } - } - p->matchPriceCount = 0; -} - -void LzmaEnc_Construct(CLzmaEnc *p) -{ - RangeEnc_Construct(&p->rc); - MatchFinder_Construct(&p->matchFinderBase); - - #ifndef _7ZIP_ST - MatchFinderMt_Construct(&p->matchFinderMt); - p->matchFinderMt.MatchFinder = &p->matchFinderBase; - #endif - - { - CLzmaEncProps props; - LzmaEncProps_Init(&props); - LzmaEnc_SetProps(p, &props); - } - - #ifndef LZMA_LOG_BSR - LzmaEnc_FastPosInit(p->g_FastPos); - #endif - - LzmaEnc_InitPriceTables(p->ProbPrices); - p->litProbs = NULL; - p->saveState.litProbs = NULL; -} - -CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc) -{ - void *p; - p = alloc->Alloc(alloc, sizeof(CLzmaEnc)); - if (p) - LzmaEnc_Construct((CLzmaEnc *)p); - return p; -} - -void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->litProbs); - alloc->Free(alloc, p->saveState.litProbs); - p->litProbs = NULL; - p->saveState.litProbs = NULL; -} - -void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) -{ - #ifndef _7ZIP_ST - MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); - #endif - - MatchFinder_Free(&p->matchFinderBase, allocBig); - LzmaEnc_FreeLits(p, alloc); - RangeEnc_Free(&p->rc, alloc); -} - -void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig) -{ - LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig); - alloc->Free(alloc, p); -} - -static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize) -{ - UInt32 nowPos32, startPos32; - if (p->needInit) - { - p->matchFinder.Init(p->matchFinderObj); - p->needInit = 0; - } - - if (p->finished) - return p->result; - RINOK(CheckErrors(p)); - - nowPos32 = (UInt32)p->nowPos64; - startPos32 = nowPos32; - - if (p->nowPos64 == 0) - { - UInt32 numPairs; - Byte curByte; - if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) - return Flush(p, nowPos32); - ReadMatchDistances(p, &numPairs); - RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0); - p->state = kLiteralNextStates[p->state]; - curByte = *(p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset); - LitEnc_Encode(&p->rc, p->litProbs, curByte); - p->additionalOffset--; - nowPos32++; - } - - if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0) - for (;;) - { - UInt32 pos, len, posState; - - if (p->fastMode) - len = GetOptimumFast(p, &pos); - else - len = GetOptimum(p, nowPos32, &pos); - - #ifdef SHOW_STAT2 - printf("\n pos = %4X, len = %u pos = %u", nowPos32, len, pos); - #endif - - posState = nowPos32 & p->pbMask; - if (len == 1 && pos == (UInt32)-1) - { - Byte curByte; - CLzmaProb *probs; - const Byte *data; - - RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0); - data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; - curByte = *data; - probs = LIT_PROBS(nowPos32, *(data - 1)); - if (IsCharState(p->state)) - LitEnc_Encode(&p->rc, probs, curByte); - else - LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1)); - p->state = kLiteralNextStates[p->state]; - } - else - { - RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); - if (pos < LZMA_NUM_REPS) - { - RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1); - if (pos == 0) - { - RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0); - RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1)); - } - else - { - UInt32 distance = p->reps[pos]; - RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1); - if (pos == 1) - RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0); - else - { - RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1); - RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2); - if (pos == 3) - p->reps[3] = p->reps[2]; - p->reps[2] = p->reps[1]; - } - p->reps[1] = p->reps[0]; - p->reps[0] = distance; - } - if (len == 1) - p->state = kShortRepNextStates[p->state]; - else - { - LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); - p->state = kRepNextStates[p->state]; - } - } - else - { - UInt32 posSlot; - RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); - p->state = kMatchNextStates[p->state]; - LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); - pos -= LZMA_NUM_REPS; - GetPosSlot(pos, posSlot); - RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot); - - if (posSlot >= kStartPosModelIndex) - { - UInt32 footerBits = ((posSlot >> 1) - 1); - UInt32 base = ((2 | (posSlot & 1)) << footerBits); - UInt32 posReduced = pos - base; - - if (posSlot < kEndPosModelIndex) - RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced); - else - { - RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits); - RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask); - p->alignPriceCount++; - } - } - p->reps[3] = p->reps[2]; - p->reps[2] = p->reps[1]; - p->reps[1] = p->reps[0]; - p->reps[0] = pos; - p->matchPriceCount++; - } - } - p->additionalOffset -= len; - nowPos32 += len; - if (p->additionalOffset == 0) - { - UInt32 processed; - if (!p->fastMode) - { - if (p->matchPriceCount >= (1 << 7)) - FillDistancesPrices(p); - if (p->alignPriceCount >= kAlignTableSize) - FillAlignPrices(p); - } - if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) - break; - processed = nowPos32 - startPos32; - if (useLimits) - { - if (processed + kNumOpts + 300 >= maxUnpackSize || - RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize) - break; - } - else if (processed >= (1 << 17)) - { - p->nowPos64 += nowPos32 - startPos32; - return CheckErrors(p); - } - } - } - p->nowPos64 += nowPos32 - startPos32; - return Flush(p, nowPos32); -} - -#define kBigHashDicLimit ((UInt32)1 << 24) - -static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) -{ - UInt32 beforeSize = kNumOpts; - if (!RangeEnc_Alloc(&p->rc, alloc)) - return SZ_ERROR_MEM; - - #ifndef _7ZIP_ST - p->mtMode = (p->multiThread && !p->fastMode && (p->matchFinderBase.btMode != 0)); - #endif - - { - unsigned lclp = p->lc + p->lp; - if (!p->litProbs || !p->saveState.litProbs || p->lclp != lclp) - { - LzmaEnc_FreeLits(p, alloc); - p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb)); - p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb)); - if (!p->litProbs || !p->saveState.litProbs) - { - LzmaEnc_FreeLits(p, alloc); - return SZ_ERROR_MEM; - } - p->lclp = lclp; - } - } - - p->matchFinderBase.bigHash = (Byte)(p->dictSize > kBigHashDicLimit ? 1 : 0); - - if (beforeSize + p->dictSize < keepWindowSize) - beforeSize = keepWindowSize - p->dictSize; - - #ifndef _7ZIP_ST - if (p->mtMode) - { - RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)); - p->matchFinderObj = &p->matchFinderMt; - MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder); - } - else - #endif - { - if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)) - return SZ_ERROR_MEM; - p->matchFinderObj = &p->matchFinderBase; - MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder); - } - - return SZ_OK; -} - -void LzmaEnc_Init(CLzmaEnc *p) -{ - UInt32 i; - p->state = 0; - for (i = 0 ; i < LZMA_NUM_REPS; i++) - p->reps[i] = 0; - - RangeEnc_Init(&p->rc); - - - for (i = 0; i < kNumStates; i++) - { - UInt32 j; - for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++) - { - p->isMatch[i][j] = kProbInitValue; - p->isRep0Long[i][j] = kProbInitValue; - } - p->isRep[i] = kProbInitValue; - p->isRepG0[i] = kProbInitValue; - p->isRepG1[i] = kProbInitValue; - p->isRepG2[i] = kProbInitValue; - } - - { - UInt32 num = (UInt32)0x300 << (p->lp + p->lc); - CLzmaProb *probs = p->litProbs; - for (i = 0; i < num; i++) - probs[i] = kProbInitValue; - } - - { - for (i = 0; i < kNumLenToPosStates; i++) - { - CLzmaProb *probs = p->posSlotEncoder[i]; - UInt32 j; - for (j = 0; j < (1 << kNumPosSlotBits); j++) - probs[j] = kProbInitValue; - } - } - { - for (i = 0; i < kNumFullDistances - kEndPosModelIndex; i++) - p->posEncoders[i] = kProbInitValue; - } - - LenEnc_Init(&p->lenEnc.p); - LenEnc_Init(&p->repLenEnc.p); - - for (i = 0; i < (1 << kNumAlignBits); i++) - p->posAlignEncoder[i] = kProbInitValue; - - p->optimumEndIndex = 0; - p->optimumCurrentIndex = 0; - p->additionalOffset = 0; - - p->pbMask = (1 << p->pb) - 1; - p->lpMask = (1 << p->lp) - 1; -} - -void LzmaEnc_InitPrices(CLzmaEnc *p) -{ - if (!p->fastMode) - { - FillDistancesPrices(p); - FillAlignPrices(p); - } - - p->lenEnc.tableSize = - p->repLenEnc.tableSize = - p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN; - LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices); - LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices); -} - -static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) -{ - UInt32 i; - for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++) - if (p->dictSize <= ((UInt32)1 << i)) - break; - p->distTableSize = i * 2; - - p->finished = False; - p->result = SZ_OK; - RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); - LzmaEnc_Init(p); - LzmaEnc_InitPrices(p); - p->nowPos64 = 0; - return SZ_OK; -} - -static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, - ISzAlloc *alloc, ISzAlloc *allocBig) -{ - CLzmaEnc *p = (CLzmaEnc *)pp; - p->matchFinderBase.stream = inStream; - p->needInit = 1; - p->rc.outStream = outStream; - return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); -} - -SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, - ISeqInStream *inStream, UInt32 keepWindowSize, - ISzAlloc *alloc, ISzAlloc *allocBig) -{ - CLzmaEnc *p = (CLzmaEnc *)pp; - p->matchFinderBase.stream = inStream; - p->needInit = 1; - return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); -} - -static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) -{ - p->matchFinderBase.directInput = 1; - p->matchFinderBase.bufferBase = (Byte *)src; - p->matchFinderBase.directInputRem = srcLen; -} - -SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, - UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) -{ - CLzmaEnc *p = (CLzmaEnc *)pp; - LzmaEnc_SetInputBuf(p, src, srcLen); - p->needInit = 1; - - return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); -} - -void LzmaEnc_Finish(CLzmaEncHandle pp) -{ - #ifndef _7ZIP_ST - CLzmaEnc *p = (CLzmaEnc *)pp; - if (p->mtMode) - MatchFinderMt_ReleaseStream(&p->matchFinderMt); - #else - UNUSED_VAR(pp); - #endif -} - - -typedef struct -{ - ISeqOutStream funcTable; - Byte *data; - SizeT rem; - Bool overflow; -} CSeqOutStreamBuf; - -static size_t MyWrite(void *pp, const void *data, size_t size) -{ - CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp; - if (p->rem < size) - { - size = p->rem; - p->overflow = True; - } - memcpy(p->data, data, size); - p->rem -= size; - p->data += size; - return size; -} - - -UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) -{ - const CLzmaEnc *p = (CLzmaEnc *)pp; - return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); -} - - -const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) -{ - const CLzmaEnc *p = (CLzmaEnc *)pp; - return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; -} - - -SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, - Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) -{ - CLzmaEnc *p = (CLzmaEnc *)pp; - UInt64 nowPos64; - SRes res; - CSeqOutStreamBuf outStream; - - outStream.funcTable.Write = MyWrite; - outStream.data = dest; - outStream.rem = *destLen; - outStream.overflow = False; - - p->writeEndMark = False; - p->finished = False; - p->result = SZ_OK; - - if (reInit) - LzmaEnc_Init(p); - LzmaEnc_InitPrices(p); - nowPos64 = p->nowPos64; - RangeEnc_Init(&p->rc); - p->rc.outStream = &outStream.funcTable; - - res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize); - - *unpackSize = (UInt32)(p->nowPos64 - nowPos64); - *destLen -= outStream.rem; - if (outStream.overflow) - return SZ_ERROR_OUTPUT_EOF; - - return res; -} - - -static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress) -{ - SRes res = SZ_OK; - - #ifndef _7ZIP_ST - Byte allocaDummy[0x300]; - allocaDummy[0] = 0; - allocaDummy[1] = allocaDummy[0]; - #endif - - for (;;) - { - res = LzmaEnc_CodeOneBlock(p, False, 0, 0); - if (res != SZ_OK || p->finished) - break; - if (progress) - { - res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc)); - if (res != SZ_OK) - { - res = SZ_ERROR_PROGRESS; - break; - } - } - } - - LzmaEnc_Finish(p); - - /* - if (res == S_OK && !Inline_MatchFinder_IsFinishedOK(&p->matchFinderBase)) - res = SZ_ERROR_FAIL; - } - */ - - return res; -} - - -SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, - ISzAlloc *alloc, ISzAlloc *allocBig) -{ - RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig)); - return LzmaEnc_Encode2((CLzmaEnc *)pp, progress); -} - - -SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) -{ - CLzmaEnc *p = (CLzmaEnc *)pp; - unsigned i; - UInt32 dictSize = p->dictSize; - if (*size < LZMA_PROPS_SIZE) - return SZ_ERROR_PARAM; - *size = LZMA_PROPS_SIZE; - props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc); - - if (dictSize >= ((UInt32)1 << 22)) - { - UInt32 kDictMask = ((UInt32)1 << 20) - 1; - if (dictSize < (UInt32)0xFFFFFFFF - kDictMask) - dictSize = (dictSize + kDictMask) & ~kDictMask; - } - else for (i = 11; i <= 30; i++) - { - if (dictSize <= ((UInt32)2 << i)) { dictSize = (2 << i); break; } - if (dictSize <= ((UInt32)3 << i)) { dictSize = (3 << i); break; } - } - - for (i = 0; i < 4; i++) - props[1 + i] = (Byte)(dictSize >> (8 * i)); - return SZ_OK; -} - - -SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, - int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) -{ - SRes res; - CLzmaEnc *p = (CLzmaEnc *)pp; - - CSeqOutStreamBuf outStream; - - outStream.funcTable.Write = MyWrite; - outStream.data = dest; - outStream.rem = *destLen; - outStream.overflow = False; - - p->writeEndMark = writeEndMark; - p->rc.outStream = &outStream.funcTable; - - res = LzmaEnc_MemPrepare(pp, src, srcLen, 0, alloc, allocBig); - - if (res == SZ_OK) - { - res = LzmaEnc_Encode2(p, progress); - if (res == SZ_OK && p->nowPos64 != srcLen) - res = SZ_ERROR_FAIL; - } - - *destLen -= outStream.rem; - if (outStream.overflow) - return SZ_ERROR_OUTPUT_EOF; - return res; -} - - -SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, - const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, - ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) -{ - CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); - SRes res; - if (!p) - return SZ_ERROR_MEM; - - res = LzmaEnc_SetProps(p, props); - if (res == SZ_OK) - { - res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); - if (res == SZ_OK) - res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, - writeEndMark, progress, alloc, allocBig); - } - - LzmaEnc_Destroy(p, alloc, allocBig); - return res; -} diff --git a/jan/src/dep/libs/lib7z/LzmaEnc.h b/jan/src/dep/libs/lib7z/LzmaEnc.h deleted file mode 100644 index c2806b45f..000000000 --- a/jan/src/dep/libs/lib7z/LzmaEnc.h +++ /dev/null @@ -1,78 +0,0 @@ -/* LzmaEnc.h -- LZMA Encoder -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __LZMA_ENC_H -#define __LZMA_ENC_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -#define LZMA_PROPS_SIZE 5 - -typedef struct _CLzmaEncProps -{ - int level; /* 0 <= level <= 9 */ - UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version - (1 << 12) <= dictSize <= (1 << 30) for 64-bit version - default = (1 << 24) */ - UInt64 reduceSize; /* estimated size of data that will be compressed. default = 0xFFFFFFFF. - Encoder uses this value to reduce dictionary size */ - int lc; /* 0 <= lc <= 8, default = 3 */ - int lp; /* 0 <= lp <= 4, default = 0 */ - int pb; /* 0 <= pb <= 4, default = 2 */ - int algo; /* 0 - fast, 1 - normal, default = 1 */ - int fb; /* 5 <= fb <= 273, default = 32 */ - int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ - int numHashBytes; /* 2, 3 or 4, default = 4 */ - UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ - unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ - int numThreads; /* 1 or 2, default = 2 */ -} CLzmaEncProps; - -void LzmaEncProps_Init(CLzmaEncProps *p); -void LzmaEncProps_Normalize(CLzmaEncProps *p); -UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); - - -/* ---------- CLzmaEncHandle Interface ---------- */ - -/* LzmaEnc_* functions can return the following exit codes: -Returns: - SZ_OK - OK - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_PARAM - Incorrect paramater in props - SZ_ERROR_WRITE - Write callback error. - SZ_ERROR_PROGRESS - some break from progress callback - SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) -*/ - -typedef void * CLzmaEncHandle; - -CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); -void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); -SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); -SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); -SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, - ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); -SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, - int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); - -/* ---------- One Call Interface ---------- */ - -/* LzmaEncode -Return code: - SZ_OK - OK - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_PARAM - Incorrect paramater - SZ_ERROR_OUTPUT_EOF - output buffer overflow - SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) -*/ - -SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, - const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, - ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/LzmaLib.c b/jan/src/dep/libs/lib7z/LzmaLib.c deleted file mode 100644 index c10cf1a0f..000000000 --- a/jan/src/dep/libs/lib7z/LzmaLib.c +++ /dev/null @@ -1,40 +0,0 @@ -/* LzmaLib.c -- LZMA library wrapper -2015-06-13 : Igor Pavlov : Public domain */ - -#include "Alloc.h" -#include "LzmaDec.h" -#include "LzmaEnc.h" -#include "LzmaLib.h" - -MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen, - unsigned char *outProps, size_t *outPropsSize, - int level, /* 0 <= level <= 9, default = 5 */ - unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */ - int lc, /* 0 <= lc <= 8, default = 3 */ - int lp, /* 0 <= lp <= 4, default = 0 */ - int pb, /* 0 <= pb <= 4, default = 2 */ - int fb, /* 5 <= fb <= 273, default = 32 */ - int numThreads /* 1 or 2, default = 2 */ -) -{ - CLzmaEncProps props; - LzmaEncProps_Init(&props); - props.level = level; - props.dictSize = dictSize; - props.lc = lc; - props.lp = lp; - props.pb = pb; - props.fb = fb; - props.numThreads = numThreads; - - return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0, - NULL, &g_Alloc, &g_Alloc); -} - - -MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen, - const unsigned char *props, size_t propsSize) -{ - ELzmaStatus status; - return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc); -} diff --git a/jan/src/dep/libs/lib7z/LzmaLib.h b/jan/src/dep/libs/lib7z/LzmaLib.h deleted file mode 100644 index 5c35e5365..000000000 --- a/jan/src/dep/libs/lib7z/LzmaLib.h +++ /dev/null @@ -1,131 +0,0 @@ -/* LzmaLib.h -- LZMA library interface -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __LZMA_LIB_H -#define __LZMA_LIB_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -#define MY_STDAPI int MY_STD_CALL - -#define LZMA_PROPS_SIZE 5 - -/* -RAM requirements for LZMA: - for compression: (dictSize * 11.5 + 6 MB) + state_size - for decompression: dictSize + state_size - state_size = (4 + (1.5 << (lc + lp))) KB - by default (lc=3, lp=0), state_size = 16 KB. - -LZMA properties (5 bytes) format - Offset Size Description - 0 1 lc, lp and pb in encoded form. - 1 4 dictSize (little endian). -*/ - -/* -LzmaCompress ------------- - -outPropsSize - - In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5. - Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5. - - LZMA Encoder will use defult values for any parameter, if it is - -1 for any from: level, loc, lp, pb, fb, numThreads - 0 for dictSize - -level - compression level: 0 <= level <= 9; - - level dictSize algo fb - 0: 16 KB 0 32 - 1: 64 KB 0 32 - 2: 256 KB 0 32 - 3: 1 MB 0 32 - 4: 4 MB 0 32 - 5: 16 MB 1 32 - 6: 32 MB 1 32 - 7+: 64 MB 1 64 - - The default value for "level" is 5. - - algo = 0 means fast method - algo = 1 means normal method - -dictSize - The dictionary size in bytes. The maximum value is - 128 MB = (1 << 27) bytes for 32-bit version - 1 GB = (1 << 30) bytes for 64-bit version - The default value is 16 MB = (1 << 24) bytes. - It's recommended to use the dictionary that is larger than 4 KB and - that can be calculated as (1 << N) or (3 << N) sizes. - -lc - The number of literal context bits (high bits of previous literal). - It can be in the range from 0 to 8. The default value is 3. - Sometimes lc=4 gives the gain for big files. - -lp - The number of literal pos bits (low bits of current position for literals). - It can be in the range from 0 to 4. The default value is 0. - The lp switch is intended for periodical data when the period is equal to 2^lp. - For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's - better to set lc=0, if you change lp switch. - -pb - The number of pos bits (low bits of current position). - It can be in the range from 0 to 4. The default value is 2. - The pb switch is intended for periodical data when the period is equal 2^pb. - -fb - Word size (the number of fast bytes). - It can be in the range from 5 to 273. The default value is 32. - Usually, a big number gives a little bit better compression ratio and - slower compression process. - -numThreads - The number of thereads. 1 or 2. The default value is 2. - Fast mode (algo = 0) can use only 1 thread. - -Out: - destLen - processed output size -Returns: - SZ_OK - OK - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_PARAM - Incorrect paramater - SZ_ERROR_OUTPUT_EOF - output buffer overflow - SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) -*/ - -MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen, - unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */ - int level, /* 0 <= level <= 9, default = 5 */ - unsigned dictSize, /* default = (1 << 24) */ - int lc, /* 0 <= lc <= 8, default = 3 */ - int lp, /* 0 <= lp <= 4, default = 0 */ - int pb, /* 0 <= pb <= 4, default = 2 */ - int fb, /* 5 <= fb <= 273, default = 32 */ - int numThreads /* 1 or 2, default = 2 */ - ); - -/* -LzmaUncompress --------------- -In: - dest - output data - destLen - output data size - src - input data - srcLen - input data size -Out: - destLen - processed output size - srcLen - processed input size -Returns: - SZ_OK - OK - SZ_ERROR_DATA - Data error - SZ_ERROR_MEM - Memory allocation arror - SZ_ERROR_UNSUPPORTED - Unsupported properties - SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src) -*/ - -MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen, - const unsigned char *props, size_t propsSize); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/MtCoder.c b/jan/src/dep/libs/lib7z/MtCoder.c deleted file mode 100644 index 8c0d9b339..000000000 --- a/jan/src/dep/libs/lib7z/MtCoder.c +++ /dev/null @@ -1,327 +0,0 @@ -/* MtCoder.c -- Multi-thread Coder -2015-10-13 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "MtCoder.h" - -void LoopThread_Construct(CLoopThread *p) -{ - Thread_Construct(&p->thread); - Event_Construct(&p->startEvent); - Event_Construct(&p->finishedEvent); -} - -void LoopThread_Close(CLoopThread *p) -{ - Thread_Close(&p->thread); - Event_Close(&p->startEvent); - Event_Close(&p->finishedEvent); -} - -static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE LoopThreadFunc(void *pp) -{ - CLoopThread *p = (CLoopThread *)pp; - for (;;) - { - if (Event_Wait(&p->startEvent) != 0) - return SZ_ERROR_THREAD; - if (p->stop) - return 0; - p->res = p->func(p->param); - if (Event_Set(&p->finishedEvent) != 0) - return SZ_ERROR_THREAD; - } -} - -WRes LoopThread_Create(CLoopThread *p) -{ - p->stop = 0; - RINOK(AutoResetEvent_CreateNotSignaled(&p->startEvent)); - RINOK(AutoResetEvent_CreateNotSignaled(&p->finishedEvent)); - return Thread_Create(&p->thread, LoopThreadFunc, p); -} - -WRes LoopThread_StopAndWait(CLoopThread *p) -{ - p->stop = 1; - if (Event_Set(&p->startEvent) != 0) - return SZ_ERROR_THREAD; - return Thread_Wait(&p->thread); -} - -WRes LoopThread_StartSubThread(CLoopThread *p) { return Event_Set(&p->startEvent); } -WRes LoopThread_WaitSubThread(CLoopThread *p) { return Event_Wait(&p->finishedEvent); } - -static SRes Progress(ICompressProgress *p, UInt64 inSize, UInt64 outSize) -{ - return (p && p->Progress(p, inSize, outSize) != SZ_OK) ? SZ_ERROR_PROGRESS : SZ_OK; -} - -static void MtProgress_Init(CMtProgress *p, ICompressProgress *progress) -{ - unsigned i; - for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++) - p->inSizes[i] = p->outSizes[i] = 0; - p->totalInSize = p->totalOutSize = 0; - p->progress = progress; - p->res = SZ_OK; -} - -static void MtProgress_Reinit(CMtProgress *p, unsigned index) -{ - p->inSizes[index] = 0; - p->outSizes[index] = 0; -} - -#define UPDATE_PROGRESS(size, prev, total) \ - if (size != (UInt64)(Int64)-1) { total += size - prev; prev = size; } - -SRes MtProgress_Set(CMtProgress *p, unsigned index, UInt64 inSize, UInt64 outSize) -{ - SRes res; - CriticalSection_Enter(&p->cs); - UPDATE_PROGRESS(inSize, p->inSizes[index], p->totalInSize) - UPDATE_PROGRESS(outSize, p->outSizes[index], p->totalOutSize) - if (p->res == SZ_OK) - p->res = Progress(p->progress, p->totalInSize, p->totalOutSize); - res = p->res; - CriticalSection_Leave(&p->cs); - return res; -} - -static void MtProgress_SetError(CMtProgress *p, SRes res) -{ - CriticalSection_Enter(&p->cs); - if (p->res == SZ_OK) - p->res = res; - CriticalSection_Leave(&p->cs); -} - -static void MtCoder_SetError(CMtCoder* p, SRes res) -{ - CriticalSection_Enter(&p->cs); - if (p->res == SZ_OK) - p->res = res; - CriticalSection_Leave(&p->cs); -} - -/* ---------- MtThread ---------- */ - -void CMtThread_Construct(CMtThread *p, CMtCoder *mtCoder) -{ - p->mtCoder = mtCoder; - p->outBuf = 0; - p->inBuf = 0; - Event_Construct(&p->canRead); - Event_Construct(&p->canWrite); - LoopThread_Construct(&p->thread); -} - -#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; } - -static void CMtThread_CloseEvents(CMtThread *p) -{ - Event_Close(&p->canRead); - Event_Close(&p->canWrite); -} - -static void CMtThread_Destruct(CMtThread *p) -{ - CMtThread_CloseEvents(p); - - if (Thread_WasCreated(&p->thread.thread)) - { - LoopThread_StopAndWait(&p->thread); - LoopThread_Close(&p->thread); - } - - if (p->mtCoder->alloc) - IAlloc_Free(p->mtCoder->alloc, p->outBuf); - p->outBuf = 0; - - if (p->mtCoder->alloc) - IAlloc_Free(p->mtCoder->alloc, p->inBuf); - p->inBuf = 0; -} - -#define MY_BUF_ALLOC(buf, size, newSize) \ - if (buf == 0 || size != newSize) \ - { IAlloc_Free(p->mtCoder->alloc, buf); \ - size = newSize; buf = (Byte *)IAlloc_Alloc(p->mtCoder->alloc, size); \ - if (buf == 0) return SZ_ERROR_MEM; } - -static SRes CMtThread_Prepare(CMtThread *p) -{ - MY_BUF_ALLOC(p->inBuf, p->inBufSize, p->mtCoder->blockSize) - MY_BUF_ALLOC(p->outBuf, p->outBufSize, p->mtCoder->destBlockSize) - - p->stopReading = False; - p->stopWriting = False; - RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canRead)); - RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canWrite)); - - return SZ_OK; -} - -static SRes FullRead(ISeqInStream *stream, Byte *data, size_t *processedSize) -{ - size_t size = *processedSize; - *processedSize = 0; - while (size != 0) - { - size_t curSize = size; - SRes res = stream->Read(stream, data, &curSize); - *processedSize += curSize; - data += curSize; - size -= curSize; - RINOK(res); - if (curSize == 0) - return SZ_OK; - } - return SZ_OK; -} - -#define GET_NEXT_THREAD(p) &p->mtCoder->threads[p->index == p->mtCoder->numThreads - 1 ? 0 : p->index + 1] - -static SRes MtThread_Process(CMtThread *p, Bool *stop) -{ - CMtThread *next; - *stop = True; - if (Event_Wait(&p->canRead) != 0) - return SZ_ERROR_THREAD; - - next = GET_NEXT_THREAD(p); - - if (p->stopReading) - { - next->stopReading = True; - return Event_Set(&next->canRead) == 0 ? SZ_OK : SZ_ERROR_THREAD; - } - - { - size_t size = p->mtCoder->blockSize; - size_t destSize = p->outBufSize; - - RINOK(FullRead(p->mtCoder->inStream, p->inBuf, &size)); - next->stopReading = *stop = (size != p->mtCoder->blockSize); - if (Event_Set(&next->canRead) != 0) - return SZ_ERROR_THREAD; - - RINOK(p->mtCoder->mtCallback->Code(p->mtCoder->mtCallback, p->index, - p->outBuf, &destSize, p->inBuf, size, *stop)); - - MtProgress_Reinit(&p->mtCoder->mtProgress, p->index); - - if (Event_Wait(&p->canWrite) != 0) - return SZ_ERROR_THREAD; - if (p->stopWriting) - return SZ_ERROR_FAIL; - if (p->mtCoder->outStream->Write(p->mtCoder->outStream, p->outBuf, destSize) != destSize) - return SZ_ERROR_WRITE; - return Event_Set(&next->canWrite) == 0 ? SZ_OK : SZ_ERROR_THREAD; - } -} - -static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE ThreadFunc(void *pp) -{ - CMtThread *p = (CMtThread *)pp; - for (;;) - { - Bool stop; - CMtThread *next = GET_NEXT_THREAD(p); - SRes res = MtThread_Process(p, &stop); - if (res != SZ_OK) - { - MtCoder_SetError(p->mtCoder, res); - MtProgress_SetError(&p->mtCoder->mtProgress, res); - next->stopReading = True; - next->stopWriting = True; - Event_Set(&next->canRead); - Event_Set(&next->canWrite); - return res; - } - if (stop) - return 0; - } -} - -void MtCoder_Construct(CMtCoder* p) -{ - unsigned i; - p->alloc = 0; - for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++) - { - CMtThread *t = &p->threads[i]; - t->index = i; - CMtThread_Construct(t, p); - } - CriticalSection_Init(&p->cs); - CriticalSection_Init(&p->mtProgress.cs); -} - -void MtCoder_Destruct(CMtCoder* p) -{ - unsigned i; - for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++) - CMtThread_Destruct(&p->threads[i]); - CriticalSection_Delete(&p->cs); - CriticalSection_Delete(&p->mtProgress.cs); -} - -SRes MtCoder_Code(CMtCoder *p) -{ - unsigned i, numThreads = p->numThreads; - SRes res = SZ_OK; - p->res = SZ_OK; - - MtProgress_Init(&p->mtProgress, p->progress); - - for (i = 0; i < numThreads; i++) - { - RINOK(CMtThread_Prepare(&p->threads[i])); - } - - for (i = 0; i < numThreads; i++) - { - CMtThread *t = &p->threads[i]; - CLoopThread *lt = &t->thread; - - if (!Thread_WasCreated(<->thread)) - { - lt->func = ThreadFunc; - lt->param = t; - - if (LoopThread_Create(lt) != SZ_OK) - { - res = SZ_ERROR_THREAD; - break; - } - } - } - - if (res == SZ_OK) - { - unsigned j; - for (i = 0; i < numThreads; i++) - { - CMtThread *t = &p->threads[i]; - if (LoopThread_StartSubThread(&t->thread) != SZ_OK) - { - res = SZ_ERROR_THREAD; - p->threads[0].stopReading = True; - break; - } - } - - Event_Set(&p->threads[0].canWrite); - Event_Set(&p->threads[0].canRead); - - for (j = 0; j < i; j++) - LoopThread_WaitSubThread(&p->threads[j].thread); - } - - for (i = 0; i < numThreads; i++) - CMtThread_CloseEvents(&p->threads[i]); - return (res == SZ_OK) ? p->res : res; -} diff --git a/jan/src/dep/libs/lib7z/MtCoder.h b/jan/src/dep/libs/lib7z/MtCoder.h deleted file mode 100644 index 705208ed3..000000000 --- a/jan/src/dep/libs/lib7z/MtCoder.h +++ /dev/null @@ -1,98 +0,0 @@ -/* MtCoder.h -- Multi-thread Coder -2009-11-19 : Igor Pavlov : Public domain */ - -#ifndef __MT_CODER_H -#define __MT_CODER_H - -#include "Threads.h" - -EXTERN_C_BEGIN - -typedef struct -{ - CThread thread; - CAutoResetEvent startEvent; - CAutoResetEvent finishedEvent; - int stop; - - THREAD_FUNC_TYPE func; - LPVOID param; - THREAD_FUNC_RET_TYPE res; -} CLoopThread; - -void LoopThread_Construct(CLoopThread *p); -void LoopThread_Close(CLoopThread *p); -WRes LoopThread_Create(CLoopThread *p); -WRes LoopThread_StopAndWait(CLoopThread *p); -WRes LoopThread_StartSubThread(CLoopThread *p); -WRes LoopThread_WaitSubThread(CLoopThread *p); - -#ifndef _7ZIP_ST -#define NUM_MT_CODER_THREADS_MAX 32 -#else -#define NUM_MT_CODER_THREADS_MAX 1 -#endif - -typedef struct -{ - UInt64 totalInSize; - UInt64 totalOutSize; - ICompressProgress *progress; - SRes res; - CCriticalSection cs; - UInt64 inSizes[NUM_MT_CODER_THREADS_MAX]; - UInt64 outSizes[NUM_MT_CODER_THREADS_MAX]; -} CMtProgress; - -SRes MtProgress_Set(CMtProgress *p, unsigned index, UInt64 inSize, UInt64 outSize); - -struct _CMtCoder; - -typedef struct -{ - struct _CMtCoder *mtCoder; - Byte *outBuf; - size_t outBufSize; - Byte *inBuf; - size_t inBufSize; - unsigned index; - CLoopThread thread; - - Bool stopReading; - Bool stopWriting; - CAutoResetEvent canRead; - CAutoResetEvent canWrite; -} CMtThread; - -typedef struct -{ - SRes (*Code)(void *p, unsigned index, Byte *dest, size_t *destSize, - const Byte *src, size_t srcSize, int finished); -} IMtCoderCallback; - -typedef struct _CMtCoder -{ - size_t blockSize; - size_t destBlockSize; - unsigned numThreads; - - ISeqInStream *inStream; - ISeqOutStream *outStream; - ICompressProgress *progress; - ISzAlloc *alloc; - - IMtCoderCallback *mtCallback; - CCriticalSection cs; - SRes res; - - CMtProgress mtProgress; - CMtThread threads[NUM_MT_CODER_THREADS_MAX]; -} CMtCoder; - -void MtCoder_Construct(CMtCoder* p); -void MtCoder_Destruct(CMtCoder* p); -SRes MtCoder_Code(CMtCoder *p); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Ppmd.h b/jan/src/dep/libs/lib7z/Ppmd.h deleted file mode 100644 index e807ca17d..000000000 --- a/jan/src/dep/libs/lib7z/Ppmd.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Ppmd.h -- PPMD codec common code -2016-05-16 : Igor Pavlov : Public domain -This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ - -#ifndef __PPMD_H -#define __PPMD_H - -#include "CpuArch.h" - -EXTERN_C_BEGIN - -#ifdef MY_CPU_32BIT - #define PPMD_32BIT -#endif - -#define PPMD_INT_BITS 7 -#define PPMD_PERIOD_BITS 7 -#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS)) - -#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift)) -#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2) -#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob)) -#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob)) - -#define PPMD_N1 4 -#define PPMD_N2 4 -#define PPMD_N3 4 -#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4) -#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4) - -#pragma pack(push, 1) -/* Most compilers works OK here even without #pragma pack(push, 1), but some GCC compilers need it. */ - -/* SEE-contexts for PPM-contexts with masked symbols */ -typedef struct -{ - UInt16 Summ; /* Freq */ - Byte Shift; /* Speed of Freq change; low Shift is for fast change */ - Byte Count; /* Count to next change of Shift */ -} CPpmd_See; - -#define Ppmd_See_Update(p) if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \ - { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); } - -typedef struct -{ - Byte Symbol; - Byte Freq; - UInt16 SuccessorLow; - UInt16 SuccessorHigh; -} CPpmd_State; - -#pragma pack(pop) - -typedef - #ifdef PPMD_32BIT - CPpmd_State * - #else - UInt32 - #endif - CPpmd_State_Ref; - -typedef - #ifdef PPMD_32BIT - void * - #else - UInt32 - #endif - CPpmd_Void_Ref; - -typedef - #ifdef PPMD_32BIT - Byte * - #else - UInt32 - #endif - CPpmd_Byte_Ref; - -#define PPMD_SetAllBitsIn256Bytes(p) \ - { unsigned z; for (z = 0; z < 256 / sizeof(p[0]); z += 8) { \ - p[z+7] = p[z+6] = p[z+5] = p[z+4] = p[z+3] = p[z+2] = p[z+1] = p[z+0] = ~(size_t)0; }} - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Ppmd7.c b/jan/src/dep/libs/lib7z/Ppmd7.c deleted file mode 100644 index ba5d32919..000000000 --- a/jan/src/dep/libs/lib7z/Ppmd7.c +++ /dev/null @@ -1,710 +0,0 @@ -/* Ppmd7.c -- PPMdH codec -2016-05-21 : Igor Pavlov : Public domain -This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ - -#include "Precomp.h" - -#include - -#include "Ppmd7.h" - -const Byte PPMD7_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 }; -static const UInt16 kInitBinEsc[] = { 0x3CDD, 0x1F3F, 0x59BF, 0x48F3, 0x64A1, 0x5ABC, 0x6632, 0x6051}; - -#define MAX_FREQ 124 -#define UNIT_SIZE 12 - -#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE) -#define U2I(nu) (p->Units2Indx[(nu) - 1]) -#define I2U(indx) (p->Indx2Units[indx]) - -#ifdef PPMD_32BIT - #define REF(ptr) (ptr) -#else - #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base)) -#endif - -#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr)) - -#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref)) -#define STATS(ctx) Ppmd7_GetStats(p, ctx) -#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx) -#define SUFFIX(ctx) CTX((ctx)->Suffix) - -typedef CPpmd7_Context * CTX_PTR; - -struct CPpmd7_Node_; - -typedef - #ifdef PPMD_32BIT - struct CPpmd7_Node_ * - #else - UInt32 - #endif - CPpmd7_Node_Ref; - -typedef struct CPpmd7_Node_ -{ - UInt16 Stamp; /* must be at offset 0 as CPpmd7_Context::NumStats. Stamp=0 means free */ - UInt16 NU; - CPpmd7_Node_Ref Next; /* must be at offset >= 4 */ - CPpmd7_Node_Ref Prev; -} CPpmd7_Node; - -#ifdef PPMD_32BIT - #define NODE(ptr) (ptr) -#else - #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs))) -#endif - -void Ppmd7_Construct(CPpmd7 *p) -{ - unsigned i, k, m; - - p->Base = 0; - - for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++) - { - unsigned step = (i >= 12 ? 4 : (i >> 2) + 1); - do { p->Units2Indx[k++] = (Byte)i; } while (--step); - p->Indx2Units[i] = (Byte)k; - } - - p->NS2BSIndx[0] = (0 << 1); - p->NS2BSIndx[1] = (1 << 1); - memset(p->NS2BSIndx + 2, (2 << 1), 9); - memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11); - - for (i = 0; i < 3; i++) - p->NS2Indx[i] = (Byte)i; - for (m = i, k = 1; i < 256; i++) - { - p->NS2Indx[i] = (Byte)m; - if (--k == 0) - k = (++m) - 2; - } - - memset(p->HB2Flag, 0, 0x40); - memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40); -} - -void Ppmd7_Free(CPpmd7 *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->Base); - p->Size = 0; - p->Base = 0; -} - -Bool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAlloc *alloc) -{ - if (p->Base == 0 || p->Size != size) - { - Ppmd7_Free(p, alloc); - p->AlignOffset = - #ifdef PPMD_32BIT - (4 - size) & 3; - #else - 4 - (size & 3); - #endif - if ((p->Base = (Byte *)alloc->Alloc(alloc, p->AlignOffset + size - #ifndef PPMD_32BIT - + UNIT_SIZE - #endif - )) == 0) - return False; - p->Size = size; - } - return True; -} - -static void InsertNode(CPpmd7 *p, void *node, unsigned indx) -{ - *((CPpmd_Void_Ref *)node) = p->FreeList[indx]; - p->FreeList[indx] = REF(node); -} - -static void *RemoveNode(CPpmd7 *p, unsigned indx) -{ - CPpmd_Void_Ref *node = (CPpmd_Void_Ref *)Ppmd7_GetPtr(p, p->FreeList[indx]); - p->FreeList[indx] = *node; - return node; -} - -static void SplitBlock(CPpmd7 *p, void *ptr, unsigned oldIndx, unsigned newIndx) -{ - unsigned i, nu = I2U(oldIndx) - I2U(newIndx); - ptr = (Byte *)ptr + U2B(I2U(newIndx)); - if (I2U(i = U2I(nu)) != nu) - { - unsigned k = I2U(--i); - InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1); - } - InsertNode(p, ptr, i); -} - -static void GlueFreeBlocks(CPpmd7 *p) -{ - #ifdef PPMD_32BIT - CPpmd7_Node headItem; - CPpmd7_Node_Ref head = &headItem; - #else - CPpmd7_Node_Ref head = p->AlignOffset + p->Size; - #endif - - CPpmd7_Node_Ref n = head; - unsigned i; - - p->GlueCount = 255; - - /* create doubly-linked list of free blocks */ - for (i = 0; i < PPMD_NUM_INDEXES; i++) - { - UInt16 nu = I2U(i); - CPpmd7_Node_Ref next = (CPpmd7_Node_Ref)p->FreeList[i]; - p->FreeList[i] = 0; - while (next != 0) - { - CPpmd7_Node *node = NODE(next); - node->Next = n; - n = NODE(n)->Prev = next; - next = *(const CPpmd7_Node_Ref *)node; - node->Stamp = 0; - node->NU = (UInt16)nu; - } - } - NODE(head)->Stamp = 1; - NODE(head)->Next = n; - NODE(n)->Prev = head; - if (p->LoUnit != p->HiUnit) - ((CPpmd7_Node *)p->LoUnit)->Stamp = 1; - - /* Glue free blocks */ - while (n != head) - { - CPpmd7_Node *node = NODE(n); - UInt32 nu = (UInt32)node->NU; - for (;;) - { - CPpmd7_Node *node2 = NODE(n) + nu; - nu += node2->NU; - if (node2->Stamp != 0 || nu >= 0x10000) - break; - NODE(node2->Prev)->Next = node2->Next; - NODE(node2->Next)->Prev = node2->Prev; - node->NU = (UInt16)nu; - } - n = node->Next; - } - - /* Fill lists of free blocks */ - for (n = NODE(head)->Next; n != head;) - { - CPpmd7_Node *node = NODE(n); - unsigned nu; - CPpmd7_Node_Ref next = node->Next; - for (nu = node->NU; nu > 128; nu -= 128, node += 128) - InsertNode(p, node, PPMD_NUM_INDEXES - 1); - if (I2U(i = U2I(nu)) != nu) - { - unsigned k = I2U(--i); - InsertNode(p, node + k, nu - k - 1); - } - InsertNode(p, node, i); - n = next; - } -} - -static void *AllocUnitsRare(CPpmd7 *p, unsigned indx) -{ - unsigned i; - void *retVal; - if (p->GlueCount == 0) - { - GlueFreeBlocks(p); - if (p->FreeList[indx] != 0) - return RemoveNode(p, indx); - } - i = indx; - do - { - if (++i == PPMD_NUM_INDEXES) - { - UInt32 numBytes = U2B(I2U(indx)); - p->GlueCount--; - return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL); - } - } - while (p->FreeList[i] == 0); - retVal = RemoveNode(p, i); - SplitBlock(p, retVal, i, indx); - return retVal; -} - -static void *AllocUnits(CPpmd7 *p, unsigned indx) -{ - UInt32 numBytes; - if (p->FreeList[indx] != 0) - return RemoveNode(p, indx); - numBytes = U2B(I2U(indx)); - if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit)) - { - void *retVal = p->LoUnit; - p->LoUnit += numBytes; - return retVal; - } - return AllocUnitsRare(p, indx); -} - -#define MyMem12Cpy(dest, src, num) \ - { UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \ - do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while (--n); } - -static void *ShrinkUnits(CPpmd7 *p, void *oldPtr, unsigned oldNU, unsigned newNU) -{ - unsigned i0 = U2I(oldNU); - unsigned i1 = U2I(newNU); - if (i0 == i1) - return oldPtr; - if (p->FreeList[i1] != 0) - { - void *ptr = RemoveNode(p, i1); - MyMem12Cpy(ptr, oldPtr, newNU); - InsertNode(p, oldPtr, i0); - return ptr; - } - SplitBlock(p, oldPtr, i0, i1); - return oldPtr; -} - -#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16))) - -static void SetSuccessor(CPpmd_State *p, CPpmd_Void_Ref v) -{ - (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF); - (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF); -} - -static void RestartModel(CPpmd7 *p) -{ - unsigned i, k, m; - - memset(p->FreeList, 0, sizeof(p->FreeList)); - p->Text = p->Base + p->AlignOffset; - p->HiUnit = p->Text + p->Size; - p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE; - p->GlueCount = 0; - - p->OrderFall = p->MaxOrder; - p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1; - p->PrevSuccess = 0; - - p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */ - p->MinContext->Suffix = 0; - p->MinContext->NumStats = 256; - p->MinContext->SummFreq = 256 + 1; - p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */ - p->LoUnit += U2B(256 / 2); - p->MinContext->Stats = REF(p->FoundState); - for (i = 0; i < 256; i++) - { - CPpmd_State *s = &p->FoundState[i]; - s->Symbol = (Byte)i; - s->Freq = 1; - SetSuccessor(s, 0); - } - - for (i = 0; i < 128; i++) - for (k = 0; k < 8; k++) - { - UInt16 *dest = p->BinSumm[i] + k; - UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 2)); - for (m = 0; m < 64; m += 8) - dest[m] = val; - } - - for (i = 0; i < 25; i++) - for (k = 0; k < 16; k++) - { - CPpmd_See *s = &p->See[i][k]; - s->Summ = (UInt16)((5 * i + 10) << (s->Shift = PPMD_PERIOD_BITS - 4)); - s->Count = 4; - } -} - -void Ppmd7_Init(CPpmd7 *p, unsigned maxOrder) -{ - p->MaxOrder = maxOrder; - RestartModel(p); - p->DummySee.Shift = PPMD_PERIOD_BITS; - p->DummySee.Summ = 0; /* unused */ - p->DummySee.Count = 64; /* unused */ -} - -static CTX_PTR CreateSuccessors(CPpmd7 *p, Bool skip) -{ - CPpmd_State upState; - CTX_PTR c = p->MinContext; - CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState); - CPpmd_State *ps[PPMD7_MAX_ORDER]; - unsigned numPs = 0; - - if (!skip) - ps[numPs++] = p->FoundState; - - while (c->Suffix) - { - CPpmd_Void_Ref successor; - CPpmd_State *s; - c = SUFFIX(c); - if (c->NumStats != 1) - { - for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++); - } - else - s = ONE_STATE(c); - successor = SUCCESSOR(s); - if (successor != upBranch) - { - c = CTX(successor); - if (numPs == 0) - return c; - break; - } - ps[numPs++] = s; - } - - upState.Symbol = *(const Byte *)Ppmd7_GetPtr(p, upBranch); - SetSuccessor(&upState, upBranch + 1); - - if (c->NumStats == 1) - upState.Freq = ONE_STATE(c)->Freq; - else - { - UInt32 cf, s0; - CPpmd_State *s; - for (s = STATS(c); s->Symbol != upState.Symbol; s++); - cf = s->Freq - 1; - s0 = c->SummFreq - c->NumStats - cf; - upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0)))); - } - - do - { - /* Create Child */ - CTX_PTR c1; /* = AllocContext(p); */ - if (p->HiUnit != p->LoUnit) - c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); - else if (p->FreeList[0] != 0) - c1 = (CTX_PTR)RemoveNode(p, 0); - else - { - c1 = (CTX_PTR)AllocUnitsRare(p, 0); - if (!c1) - return NULL; - } - c1->NumStats = 1; - *ONE_STATE(c1) = upState; - c1->Suffix = REF(c); - SetSuccessor(ps[--numPs], REF(c1)); - c = c1; - } - while (numPs != 0); - - return c; -} - -static void SwapStates(CPpmd_State *t1, CPpmd_State *t2) -{ - CPpmd_State tmp = *t1; - *t1 = *t2; - *t2 = tmp; -} - -static void UpdateModel(CPpmd7 *p) -{ - CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState); - CTX_PTR c; - unsigned s0, ns; - - if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0) - { - c = SUFFIX(p->MinContext); - - if (c->NumStats == 1) - { - CPpmd_State *s = ONE_STATE(c); - if (s->Freq < 32) - s->Freq++; - } - else - { - CPpmd_State *s = STATS(c); - if (s->Symbol != p->FoundState->Symbol) - { - do { s++; } while (s->Symbol != p->FoundState->Symbol); - if (s[0].Freq >= s[-1].Freq) - { - SwapStates(&s[0], &s[-1]); - s--; - } - } - if (s->Freq < MAX_FREQ - 9) - { - s->Freq += 2; - c->SummFreq += 2; - } - } - } - - if (p->OrderFall == 0) - { - p->MinContext = p->MaxContext = CreateSuccessors(p, True); - if (p->MinContext == 0) - { - RestartModel(p); - return; - } - SetSuccessor(p->FoundState, REF(p->MinContext)); - return; - } - - *p->Text++ = p->FoundState->Symbol; - successor = REF(p->Text); - if (p->Text >= p->UnitsStart) - { - RestartModel(p); - return; - } - - if (fSuccessor) - { - if (fSuccessor <= successor) - { - CTX_PTR cs = CreateSuccessors(p, False); - if (cs == NULL) - { - RestartModel(p); - return; - } - fSuccessor = REF(cs); - } - if (--p->OrderFall == 0) - { - successor = fSuccessor; - p->Text -= (p->MaxContext != p->MinContext); - } - } - else - { - SetSuccessor(p->FoundState, successor); - fSuccessor = REF(p->MinContext); - } - - s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - (p->FoundState->Freq - 1); - - for (c = p->MaxContext; c != p->MinContext; c = SUFFIX(c)) - { - unsigned ns1; - UInt32 cf, sf; - if ((ns1 = c->NumStats) != 1) - { - if ((ns1 & 1) == 0) - { - /* Expand for one UNIT */ - unsigned oldNU = ns1 >> 1; - unsigned i = U2I(oldNU); - if (i != U2I(oldNU + 1)) - { - void *ptr = AllocUnits(p, i + 1); - void *oldPtr; - if (!ptr) - { - RestartModel(p); - return; - } - oldPtr = STATS(c); - MyMem12Cpy(ptr, oldPtr, oldNU); - InsertNode(p, oldPtr, i); - c->Stats = STATS_REF(ptr); - } - } - c->SummFreq = (UInt16)(c->SummFreq + (2 * ns1 < ns) + 2 * ((4 * ns1 <= ns) & (c->SummFreq <= 8 * ns1))); - } - else - { - CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0); - if (!s) - { - RestartModel(p); - return; - } - *s = *ONE_STATE(c); - c->Stats = REF(s); - if (s->Freq < MAX_FREQ / 4 - 1) - s->Freq <<= 1; - else - s->Freq = MAX_FREQ - 4; - c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 3)); - } - cf = 2 * (UInt32)p->FoundState->Freq * (c->SummFreq + 6); - sf = (UInt32)s0 + c->SummFreq; - if (cf < 6 * sf) - { - cf = 1 + (cf > sf) + (cf >= 4 * sf); - c->SummFreq += 3; - } - else - { - cf = 4 + (cf >= 9 * sf) + (cf >= 12 * sf) + (cf >= 15 * sf); - c->SummFreq = (UInt16)(c->SummFreq + cf); - } - { - CPpmd_State *s = STATS(c) + ns1; - SetSuccessor(s, successor); - s->Symbol = p->FoundState->Symbol; - s->Freq = (Byte)cf; - c->NumStats = (UInt16)(ns1 + 1); - } - } - p->MaxContext = p->MinContext = CTX(fSuccessor); -} - -static void Rescale(CPpmd7 *p) -{ - unsigned i, adder, sumFreq, escFreq; - CPpmd_State *stats = STATS(p->MinContext); - CPpmd_State *s = p->FoundState; - { - CPpmd_State tmp = *s; - for (; s != stats; s--) - s[0] = s[-1]; - *s = tmp; - } - escFreq = p->MinContext->SummFreq - s->Freq; - s->Freq += 4; - adder = (p->OrderFall != 0); - s->Freq = (Byte)((s->Freq + adder) >> 1); - sumFreq = s->Freq; - - i = p->MinContext->NumStats - 1; - do - { - escFreq -= (++s)->Freq; - s->Freq = (Byte)((s->Freq + adder) >> 1); - sumFreq += s->Freq; - if (s[0].Freq > s[-1].Freq) - { - CPpmd_State *s1 = s; - CPpmd_State tmp = *s1; - do - s1[0] = s1[-1]; - while (--s1 != stats && tmp.Freq > s1[-1].Freq); - *s1 = tmp; - } - } - while (--i); - - if (s->Freq == 0) - { - unsigned numStats = p->MinContext->NumStats; - unsigned n0, n1; - do { i++; } while ((--s)->Freq == 0); - escFreq += i; - p->MinContext->NumStats = (UInt16)(p->MinContext->NumStats - i); - if (p->MinContext->NumStats == 1) - { - CPpmd_State tmp = *stats; - do - { - tmp.Freq = (Byte)(tmp.Freq - (tmp.Freq >> 1)); - escFreq >>= 1; - } - while (escFreq > 1); - InsertNode(p, stats, U2I(((numStats + 1) >> 1))); - *(p->FoundState = ONE_STATE(p->MinContext)) = tmp; - return; - } - n0 = (numStats + 1) >> 1; - n1 = (p->MinContext->NumStats + 1) >> 1; - if (n0 != n1) - p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1)); - } - p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1)); - p->FoundState = STATS(p->MinContext); -} - -CPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *escFreq) -{ - CPpmd_See *see; - unsigned nonMasked = p->MinContext->NumStats - numMasked; - if (p->MinContext->NumStats != 256) - { - see = p->See[(unsigned)p->NS2Indx[nonMasked - 1]] + - (nonMasked < (unsigned)SUFFIX(p->MinContext)->NumStats - p->MinContext->NumStats) + - 2 * (unsigned)(p->MinContext->SummFreq < 11 * p->MinContext->NumStats) + - 4 * (unsigned)(numMasked > nonMasked) + - p->HiBitsFlag; - { - unsigned r = (see->Summ >> see->Shift); - see->Summ = (UInt16)(see->Summ - r); - *escFreq = r + (r == 0); - } - } - else - { - see = &p->DummySee; - *escFreq = 1; - } - return see; -} - -static void NextContext(CPpmd7 *p) -{ - CTX_PTR c = CTX(SUCCESSOR(p->FoundState)); - if (p->OrderFall == 0 && (Byte *)c > p->Text) - p->MinContext = p->MaxContext = c; - else - UpdateModel(p); -} - -void Ppmd7_Update1(CPpmd7 *p) -{ - CPpmd_State *s = p->FoundState; - s->Freq += 4; - p->MinContext->SummFreq += 4; - if (s[0].Freq > s[-1].Freq) - { - SwapStates(&s[0], &s[-1]); - p->FoundState = --s; - if (s->Freq > MAX_FREQ) - Rescale(p); - } - NextContext(p); -} - -void Ppmd7_Update1_0(CPpmd7 *p) -{ - p->PrevSuccess = (2 * p->FoundState->Freq > p->MinContext->SummFreq); - p->RunLength += p->PrevSuccess; - p->MinContext->SummFreq += 4; - if ((p->FoundState->Freq += 4) > MAX_FREQ) - Rescale(p); - NextContext(p); -} - -void Ppmd7_UpdateBin(CPpmd7 *p) -{ - p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0)); - p->PrevSuccess = 1; - p->RunLength++; - NextContext(p); -} - -void Ppmd7_Update2(CPpmd7 *p) -{ - p->MinContext->SummFreq += 4; - if ((p->FoundState->Freq += 4) > MAX_FREQ) - Rescale(p); - p->RunLength = p->InitRL; - UpdateModel(p); -} diff --git a/jan/src/dep/libs/lib7z/Ppmd7.h b/jan/src/dep/libs/lib7z/Ppmd7.h deleted file mode 100644 index 1c7870c45..000000000 --- a/jan/src/dep/libs/lib7z/Ppmd7.h +++ /dev/null @@ -1,140 +0,0 @@ -/* Ppmd7.h -- PPMdH compression codec -2016-05-21 : Igor Pavlov : Public domain -This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ - -/* This code supports virtual RangeDecoder and includes the implementation -of RangeCoder from 7z, instead of RangeCoder from original PPMd var.H. -If you need the compatibility with original PPMd var.H, you can use external RangeDecoder */ - -#ifndef __PPMD7_H -#define __PPMD7_H - -#include "Ppmd.h" - -EXTERN_C_BEGIN - -#define PPMD7_MIN_ORDER 2 -#define PPMD7_MAX_ORDER 64 - -#define PPMD7_MIN_MEM_SIZE (1 << 11) -#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3) - -struct CPpmd7_Context_; - -typedef - #ifdef PPMD_32BIT - struct CPpmd7_Context_ * - #else - UInt32 - #endif - CPpmd7_Context_Ref; - -typedef struct CPpmd7_Context_ -{ - UInt16 NumStats; - UInt16 SummFreq; - CPpmd_State_Ref Stats; - CPpmd7_Context_Ref Suffix; -} CPpmd7_Context; - -#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq) - -typedef struct -{ - CPpmd7_Context *MinContext, *MaxContext; - CPpmd_State *FoundState; - unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder, HiBitsFlag; - Int32 RunLength, InitRL; /* must be 32-bit at least */ - - UInt32 Size; - UInt32 GlueCount; - Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart; - UInt32 AlignOffset; - - Byte Indx2Units[PPMD_NUM_INDEXES]; - Byte Units2Indx[128]; - CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES]; - Byte NS2Indx[256], NS2BSIndx[256], HB2Flag[256]; - CPpmd_See DummySee, See[25][16]; - UInt16 BinSumm[128][64]; -} CPpmd7; - -void Ppmd7_Construct(CPpmd7 *p); -Bool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAlloc *alloc); -void Ppmd7_Free(CPpmd7 *p, ISzAlloc *alloc); -void Ppmd7_Init(CPpmd7 *p, unsigned maxOrder); -#define Ppmd7_WasAllocated(p) ((p)->Base != NULL) - - -/* ---------- Internal Functions ---------- */ - -extern const Byte PPMD7_kExpEscape[16]; - -#ifdef PPMD_32BIT - #define Ppmd7_GetPtr(p, ptr) (ptr) - #define Ppmd7_GetContext(p, ptr) (ptr) - #define Ppmd7_GetStats(p, ctx) ((ctx)->Stats) -#else - #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs))) - #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs))) - #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats))) -#endif - -void Ppmd7_Update1(CPpmd7 *p); -void Ppmd7_Update1_0(CPpmd7 *p); -void Ppmd7_Update2(CPpmd7 *p); -void Ppmd7_UpdateBin(CPpmd7 *p); - -#define Ppmd7_GetBinSumm(p) \ - &p->BinSumm[(unsigned)Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \ - p->NS2BSIndx[Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \ - (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \ - 2 * p->HB2Flag[(unsigned)Ppmd7Context_OneState(p->MinContext)->Symbol] + \ - ((p->RunLength >> 26) & 0x20)] - -CPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *scale); - - -/* ---------- Decode ---------- */ - -typedef struct -{ - UInt32 (*GetThreshold)(void *p, UInt32 total); - void (*Decode)(void *p, UInt32 start, UInt32 size); - UInt32 (*DecodeBit)(void *p, UInt32 size0); -} IPpmd7_RangeDec; - -typedef struct -{ - IPpmd7_RangeDec p; - UInt32 Range; - UInt32 Code; - IByteIn *Stream; -} CPpmd7z_RangeDec; - -void Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p); -Bool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p); -#define Ppmd7z_RangeDec_IsFinishedOK(p) ((p)->Code == 0) - -int Ppmd7_DecodeSymbol(CPpmd7 *p, IPpmd7_RangeDec *rc); - - -/* ---------- Encode ---------- */ - -typedef struct -{ - UInt64 Low; - UInt32 Range; - Byte Cache; - UInt64 CacheSize; - IByteOut *Stream; -} CPpmd7z_RangeEnc; - -void Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p); -void Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p); - -void Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Ppmd7Dec.c b/jan/src/dep/libs/lib7z/Ppmd7Dec.c deleted file mode 100644 index 3d01d7644..000000000 --- a/jan/src/dep/libs/lib7z/Ppmd7Dec.c +++ /dev/null @@ -1,189 +0,0 @@ -/* Ppmd7Dec.c -- PPMdH Decoder -2010-03-12 : Igor Pavlov : Public domain -This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ - -#include "Precomp.h" - -#include "Ppmd7.h" - -#define kTopValue (1 << 24) - -Bool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p) -{ - unsigned i; - p->Code = 0; - p->Range = 0xFFFFFFFF; - if (p->Stream->Read((void *)p->Stream) != 0) - return False; - for (i = 0; i < 4; i++) - p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream); - return (p->Code < 0xFFFFFFFF); -} - -static UInt32 Range_GetThreshold(void *pp, UInt32 total) -{ - CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp; - return (p->Code) / (p->Range /= total); -} - -static void Range_Normalize(CPpmd7z_RangeDec *p) -{ - if (p->Range < kTopValue) - { - p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream); - p->Range <<= 8; - if (p->Range < kTopValue) - { - p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream); - p->Range <<= 8; - } - } -} - -static void Range_Decode(void *pp, UInt32 start, UInt32 size) -{ - CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp; - p->Code -= start * p->Range; - p->Range *= size; - Range_Normalize(p); -} - -static UInt32 Range_DecodeBit(void *pp, UInt32 size0) -{ - CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp; - UInt32 newBound = (p->Range >> 14) * size0; - UInt32 symbol; - if (p->Code < newBound) - { - symbol = 0; - p->Range = newBound; - } - else - { - symbol = 1; - p->Code -= newBound; - p->Range -= newBound; - } - Range_Normalize(p); - return symbol; -} - -void Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p) -{ - p->p.GetThreshold = Range_GetThreshold; - p->p.Decode = Range_Decode; - p->p.DecodeBit = Range_DecodeBit; -} - - -#define MASK(sym) ((signed char *)charMask)[sym] - -int Ppmd7_DecodeSymbol(CPpmd7 *p, IPpmd7_RangeDec *rc) -{ - size_t charMask[256 / sizeof(size_t)]; - if (p->MinContext->NumStats != 1) - { - CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext); - unsigned i; - UInt32 count, hiCnt; - if ((count = rc->GetThreshold(rc, p->MinContext->SummFreq)) < (hiCnt = s->Freq)) - { - Byte symbol; - rc->Decode(rc, 0, s->Freq); - p->FoundState = s; - symbol = s->Symbol; - Ppmd7_Update1_0(p); - return symbol; - } - p->PrevSuccess = 0; - i = p->MinContext->NumStats - 1; - do - { - if ((hiCnt += (++s)->Freq) > count) - { - Byte symbol; - rc->Decode(rc, hiCnt - s->Freq, s->Freq); - p->FoundState = s; - symbol = s->Symbol; - Ppmd7_Update1(p); - return symbol; - } - } - while (--i); - if (count >= p->MinContext->SummFreq) - return -2; - p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]; - rc->Decode(rc, hiCnt, p->MinContext->SummFreq - hiCnt); - PPMD_SetAllBitsIn256Bytes(charMask); - MASK(s->Symbol) = 0; - i = p->MinContext->NumStats - 1; - do { MASK((--s)->Symbol) = 0; } while (--i); - } - else - { - UInt16 *prob = Ppmd7_GetBinSumm(p); - if (rc->DecodeBit(rc, *prob) == 0) - { - Byte symbol; - *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob); - symbol = (p->FoundState = Ppmd7Context_OneState(p->MinContext))->Symbol; - Ppmd7_UpdateBin(p); - return symbol; - } - *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob); - p->InitEsc = PPMD7_kExpEscape[*prob >> 10]; - PPMD_SetAllBitsIn256Bytes(charMask); - MASK(Ppmd7Context_OneState(p->MinContext)->Symbol) = 0; - p->PrevSuccess = 0; - } - for (;;) - { - CPpmd_State *ps[256], *s; - UInt32 freqSum, count, hiCnt; - CPpmd_See *see; - unsigned i, num, numMasked = p->MinContext->NumStats; - do - { - p->OrderFall++; - if (!p->MinContext->Suffix) - return -1; - p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix); - } - while (p->MinContext->NumStats == numMasked); - hiCnt = 0; - s = Ppmd7_GetStats(p, p->MinContext); - i = 0; - num = p->MinContext->NumStats - numMasked; - do - { - int k = (int)(MASK(s->Symbol)); - hiCnt += (s->Freq & k); - ps[i] = s++; - i -= k; - } - while (i != num); - - see = Ppmd7_MakeEscFreq(p, numMasked, &freqSum); - freqSum += hiCnt; - count = rc->GetThreshold(rc, freqSum); - - if (count < hiCnt) - { - Byte symbol; - CPpmd_State **pps = ps; - for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++); - s = *pps; - rc->Decode(rc, hiCnt - s->Freq, s->Freq); - Ppmd_See_Update(see); - p->FoundState = s; - symbol = s->Symbol; - Ppmd7_Update2(p); - return symbol; - } - if (count >= freqSum) - return -2; - rc->Decode(rc, hiCnt, freqSum - hiCnt); - see->Summ = (UInt16)(see->Summ + freqSum); - do { MASK(ps[--i]->Symbol) = 0; } while (i != 0); - } -} diff --git a/jan/src/dep/libs/lib7z/Ppmd7Enc.c b/jan/src/dep/libs/lib7z/Ppmd7Enc.c deleted file mode 100644 index 9b49e5d44..000000000 --- a/jan/src/dep/libs/lib7z/Ppmd7Enc.c +++ /dev/null @@ -1,187 +0,0 @@ -/* Ppmd7Enc.c -- PPMdH Encoder -2015-09-28 : Igor Pavlov : Public domain -This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ - -#include "Precomp.h" - -#include "Ppmd7.h" - -#define kTopValue (1 << 24) - -void Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p) -{ - p->Low = 0; - p->Range = 0xFFFFFFFF; - p->Cache = 0; - p->CacheSize = 1; -} - -static void RangeEnc_ShiftLow(CPpmd7z_RangeEnc *p) -{ - if ((UInt32)p->Low < (UInt32)0xFF000000 || (unsigned)(p->Low >> 32) != 0) - { - Byte temp = p->Cache; - do - { - p->Stream->Write(p->Stream, (Byte)(temp + (Byte)(p->Low >> 32))); - temp = 0xFF; - } - while (--p->CacheSize != 0); - p->Cache = (Byte)((UInt32)p->Low >> 24); - } - p->CacheSize++; - p->Low = (UInt32)p->Low << 8; -} - -static void RangeEnc_Encode(CPpmd7z_RangeEnc *p, UInt32 start, UInt32 size, UInt32 total) -{ - p->Low += start * (p->Range /= total); - p->Range *= size; - while (p->Range < kTopValue) - { - p->Range <<= 8; - RangeEnc_ShiftLow(p); - } -} - -static void RangeEnc_EncodeBit_0(CPpmd7z_RangeEnc *p, UInt32 size0) -{ - p->Range = (p->Range >> 14) * size0; - while (p->Range < kTopValue) - { - p->Range <<= 8; - RangeEnc_ShiftLow(p); - } -} - -static void RangeEnc_EncodeBit_1(CPpmd7z_RangeEnc *p, UInt32 size0) -{ - UInt32 newBound = (p->Range >> 14) * size0; - p->Low += newBound; - p->Range -= newBound; - while (p->Range < kTopValue) - { - p->Range <<= 8; - RangeEnc_ShiftLow(p); - } -} - -void Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p) -{ - unsigned i; - for (i = 0; i < 5; i++) - RangeEnc_ShiftLow(p); -} - - -#define MASK(sym) ((signed char *)charMask)[sym] - -void Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol) -{ - size_t charMask[256 / sizeof(size_t)]; - if (p->MinContext->NumStats != 1) - { - CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext); - UInt32 sum; - unsigned i; - if (s->Symbol == symbol) - { - RangeEnc_Encode(rc, 0, s->Freq, p->MinContext->SummFreq); - p->FoundState = s; - Ppmd7_Update1_0(p); - return; - } - p->PrevSuccess = 0; - sum = s->Freq; - i = p->MinContext->NumStats - 1; - do - { - if ((++s)->Symbol == symbol) - { - RangeEnc_Encode(rc, sum, s->Freq, p->MinContext->SummFreq); - p->FoundState = s; - Ppmd7_Update1(p); - return; - } - sum += s->Freq; - } - while (--i); - - p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]; - PPMD_SetAllBitsIn256Bytes(charMask); - MASK(s->Symbol) = 0; - i = p->MinContext->NumStats - 1; - do { MASK((--s)->Symbol) = 0; } while (--i); - RangeEnc_Encode(rc, sum, p->MinContext->SummFreq - sum, p->MinContext->SummFreq); - } - else - { - UInt16 *prob = Ppmd7_GetBinSumm(p); - CPpmd_State *s = Ppmd7Context_OneState(p->MinContext); - if (s->Symbol == symbol) - { - RangeEnc_EncodeBit_0(rc, *prob); - *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob); - p->FoundState = s; - Ppmd7_UpdateBin(p); - return; - } - else - { - RangeEnc_EncodeBit_1(rc, *prob); - *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob); - p->InitEsc = PPMD7_kExpEscape[*prob >> 10]; - PPMD_SetAllBitsIn256Bytes(charMask); - MASK(s->Symbol) = 0; - p->PrevSuccess = 0; - } - } - for (;;) - { - UInt32 escFreq; - CPpmd_See *see; - CPpmd_State *s; - UInt32 sum; - unsigned i, numMasked = p->MinContext->NumStats; - do - { - p->OrderFall++; - if (!p->MinContext->Suffix) - return; /* EndMarker (symbol = -1) */ - p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix); - } - while (p->MinContext->NumStats == numMasked); - - see = Ppmd7_MakeEscFreq(p, numMasked, &escFreq); - s = Ppmd7_GetStats(p, p->MinContext); - sum = 0; - i = p->MinContext->NumStats; - do - { - int cur = s->Symbol; - if (cur == symbol) - { - UInt32 low = sum; - CPpmd_State *s1 = s; - do - { - sum += (s->Freq & (int)(MASK(s->Symbol))); - s++; - } - while (--i); - RangeEnc_Encode(rc, low, s1->Freq, sum + escFreq); - Ppmd_See_Update(see); - p->FoundState = s1; - Ppmd7_Update2(p); - return; - } - sum += (s->Freq & (int)(MASK(cur))); - MASK(cur) = 0; - s++; - } - while (--i); - - RangeEnc_Encode(rc, sum, escFreq, sum + escFreq); - see->Summ = (UInt16)(see->Summ + sum + escFreq); - } -} diff --git a/jan/src/dep/libs/lib7z/Precomp.h b/jan/src/dep/libs/lib7z/Precomp.h deleted file mode 100644 index edb581443..000000000 --- a/jan/src/dep/libs/lib7z/Precomp.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Precomp.h -- StdAfx -2013-11-12 : Igor Pavlov : Public domain */ - -#ifndef __7Z_PRECOMP_H -#define __7Z_PRECOMP_H - -#include "Compiler.h" -/* #include "7zTypes.h" */ - -#endif diff --git a/jan/src/dep/libs/lib7z/RotateDefs.h b/jan/src/dep/libs/lib7z/RotateDefs.h deleted file mode 100644 index 6c790e791..000000000 --- a/jan/src/dep/libs/lib7z/RotateDefs.h +++ /dev/null @@ -1,30 +0,0 @@ -/* RotateDefs.h -- Rotate functions -2015-03-25 : Igor Pavlov : Public domain */ - -#ifndef __ROTATE_DEFS_H -#define __ROTATE_DEFS_H - -#ifdef _MSC_VER - -#include - -/* don't use _rotl with MINGW. It can insert slow call to function. */ - -/* #if (_MSC_VER >= 1200) */ -#pragma intrinsic(_rotl) -#pragma intrinsic(_rotr) -/* #endif */ - -#define rotlFixed(x, n) _rotl((x), (n)) -#define rotrFixed(x, n) _rotr((x), (n)) - -#else - -/* new compilers can translate these macros to fast commands. */ - -#define rotlFixed(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) -#define rotrFixed(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) - -#endif - -#endif diff --git a/jan/src/dep/libs/lib7z/Sha256.c b/jan/src/dep/libs/lib7z/Sha256.c deleted file mode 100644 index 47e2f42b9..000000000 --- a/jan/src/dep/libs/lib7z/Sha256.c +++ /dev/null @@ -1,248 +0,0 @@ -/* Crypto/Sha256.c -- SHA-256 Hash -2015-11-14 : Igor Pavlov : Public domain -This code is based on public domain code from Wei Dai's Crypto++ library. */ - -#include "Precomp.h" - -#include - -#include "CpuArch.h" -#include "RotateDefs.h" -#include "Sha256.h" - -/* define it for speed optimization */ -#ifndef _SFX -#define _SHA256_UNROLL -#define _SHA256_UNROLL2 -#endif - -/* #define _SHA256_UNROLL2 */ - -void Sha256_Init(CSha256 *p) -{ - p->state[0] = 0x6a09e667; - p->state[1] = 0xbb67ae85; - p->state[2] = 0x3c6ef372; - p->state[3] = 0xa54ff53a; - p->state[4] = 0x510e527f; - p->state[5] = 0x9b05688c; - p->state[6] = 0x1f83d9ab; - p->state[7] = 0x5be0cd19; - p->count = 0; -} - -#define S0(x) (rotrFixed(x, 2) ^ rotrFixed(x,13) ^ rotrFixed(x, 22)) -#define S1(x) (rotrFixed(x, 6) ^ rotrFixed(x,11) ^ rotrFixed(x, 25)) -#define s0(x) (rotrFixed(x, 7) ^ rotrFixed(x,18) ^ (x >> 3)) -#define s1(x) (rotrFixed(x,17) ^ rotrFixed(x,19) ^ (x >> 10)) - -#define blk0(i) (W[i]) -#define blk2(i) (W[i] += s1(W[((i)-2)&15]) + W[((i)-7)&15] + s0(W[((i)-15)&15])) - -#define Ch(x,y,z) (z^(x&(y^z))) -#define Maj(x,y,z) ((x&y)|(z&(x|y))) - -#ifdef _SHA256_UNROLL2 - -#define R(a,b,c,d,e,f,g,h, i) \ - h += S1(e) + Ch(e,f,g) + K[(i)+(j)] + (j ? blk2(i) : blk0(i)); \ - d += h; \ - h += S0(a) + Maj(a, b, c) - -#define RX_8(i) \ - R(a,b,c,d,e,f,g,h, i); \ - R(h,a,b,c,d,e,f,g, i+1); \ - R(g,h,a,b,c,d,e,f, i+2); \ - R(f,g,h,a,b,c,d,e, i+3); \ - R(e,f,g,h,a,b,c,d, i+4); \ - R(d,e,f,g,h,a,b,c, i+5); \ - R(c,d,e,f,g,h,a,b, i+6); \ - R(b,c,d,e,f,g,h,a, i+7) - -#define RX_16 RX_8(0); RX_8(8); - -#else - -#define a(i) T[(0-(i))&7] -#define b(i) T[(1-(i))&7] -#define c(i) T[(2-(i))&7] -#define d(i) T[(3-(i))&7] -#define e(i) T[(4-(i))&7] -#define f(i) T[(5-(i))&7] -#define g(i) T[(6-(i))&7] -#define h(i) T[(7-(i))&7] - -#define R(i) \ - h(i) += S1(e(i)) + Ch(e(i),f(i),g(i)) + K[(i)+(j)] + (j ? blk2(i) : blk0(i)); \ - d(i) += h(i); \ - h(i) += S0(a(i)) + Maj(a(i), b(i), c(i)) \ - -#ifdef _SHA256_UNROLL - -#define RX_8(i) R(i+0); R(i+1); R(i+2); R(i+3); R(i+4); R(i+5); R(i+6); R(i+7); -#define RX_16 RX_8(0); RX_8(8); - -#else - -#define RX_16 unsigned i; for (i = 0; i < 16; i++) { R(i); } - -#endif - -#endif - -static const UInt32 K[64] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -}; - -static void Sha256_WriteByteBlock(CSha256 *p) -{ - UInt32 W[16]; - unsigned j; - UInt32 *state; - - #ifdef _SHA256_UNROLL2 - UInt32 a,b,c,d,e,f,g,h; - #else - UInt32 T[8]; - #endif - - for (j = 0; j < 16; j += 4) - { - const Byte *ccc = p->buffer + j * 4; - W[j ] = GetBe32(ccc); - W[j + 1] = GetBe32(ccc + 4); - W[j + 2] = GetBe32(ccc + 8); - W[j + 3] = GetBe32(ccc + 12); - } - - state = p->state; - - #ifdef _SHA256_UNROLL2 - a = state[0]; - b = state[1]; - c = state[2]; - d = state[3]; - e = state[4]; - f = state[5]; - g = state[6]; - h = state[7]; - #else - for (j = 0; j < 8; j++) - T[j] = state[j]; - #endif - - for (j = 0; j < 64; j += 16) - { - RX_16 - } - - #ifdef _SHA256_UNROLL2 - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - state[5] += f; - state[6] += g; - state[7] += h; - #else - for (j = 0; j < 8; j++) - state[j] += T[j]; - #endif - - /* Wipe variables */ - /* memset(W, 0, sizeof(W)); */ - /* memset(T, 0, sizeof(T)); */ -} - -#undef S0 -#undef S1 -#undef s0 -#undef s1 - -void Sha256_Update(CSha256 *p, const Byte *data, size_t size) -{ - if (size == 0) - return; - - { - unsigned pos = (unsigned)p->count & 0x3F; - unsigned num; - - p->count += size; - - num = 64 - pos; - if (num > size) - { - memcpy(p->buffer + pos, data, size); - return; - } - - size -= num; - memcpy(p->buffer + pos, data, num); - data += num; - } - - for (;;) - { - Sha256_WriteByteBlock(p); - if (size < 64) - break; - size -= 64; - memcpy(p->buffer, data, 64); - data += 64; - } - - if (size != 0) - memcpy(p->buffer, data, size); -} - -void Sha256_Final(CSha256 *p, Byte *digest) -{ - unsigned pos = (unsigned)p->count & 0x3F; - unsigned i; - - p->buffer[pos++] = 0x80; - - while (pos != (64 - 8)) - { - pos &= 0x3F; - if (pos == 0) - Sha256_WriteByteBlock(p); - p->buffer[pos++] = 0; - } - - { - UInt64 numBits = (p->count << 3); - SetBe32(p->buffer + 64 - 8, (UInt32)(numBits >> 32)); - SetBe32(p->buffer + 64 - 4, (UInt32)(numBits)); - } - - Sha256_WriteByteBlock(p); - - for (i = 0; i < 8; i += 2) - { - UInt32 v0 = p->state[i]; - UInt32 v1 = p->state[i + 1]; - SetBe32(digest , v0); - SetBe32(digest + 4, v1); - digest += 8; - } - - Sha256_Init(p); -} diff --git a/jan/src/dep/libs/lib7z/Sha256.h b/jan/src/dep/libs/lib7z/Sha256.h deleted file mode 100644 index 7f17ccf9c..000000000 --- a/jan/src/dep/libs/lib7z/Sha256.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Sha256.h -- SHA-256 Hash -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __CRYPTO_SHA256_H -#define __CRYPTO_SHA256_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -#define SHA256_DIGEST_SIZE 32 - -typedef struct -{ - UInt32 state[8]; - UInt64 count; - Byte buffer[64]; -} CSha256; - -void Sha256_Init(CSha256 *p); -void Sha256_Update(CSha256 *p, const Byte *data, size_t size); -void Sha256_Final(CSha256 *p, Byte *digest); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Sort.c b/jan/src/dep/libs/lib7z/Sort.c deleted file mode 100644 index 73dcbf059..000000000 --- a/jan/src/dep/libs/lib7z/Sort.c +++ /dev/null @@ -1,141 +0,0 @@ -/* Sort.c -- Sort functions -2014-04-05 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "Sort.h" - -#define HeapSortDown(p, k, size, temp) \ - { for (;;) { \ - size_t s = (k << 1); \ - if (s > size) break; \ - if (s < size && p[s + 1] > p[s]) s++; \ - if (temp >= p[s]) break; \ - p[k] = p[s]; k = s; \ - } p[k] = temp; } - -void HeapSort(UInt32 *p, size_t size) -{ - if (size <= 1) - return; - p--; - { - size_t i = size / 2; - do - { - UInt32 temp = p[i]; - size_t k = i; - HeapSortDown(p, k, size, temp) - } - while (--i != 0); - } - /* - do - { - size_t k = 1; - UInt32 temp = p[size]; - p[size--] = p[1]; - HeapSortDown(p, k, size, temp) - } - while (size > 1); - */ - while (size > 3) - { - UInt32 temp = p[size]; - size_t k = (p[3] > p[2]) ? 3 : 2; - p[size--] = p[1]; - p[1] = p[k]; - HeapSortDown(p, k, size, temp) - } - { - UInt32 temp = p[size]; - p[size] = p[1]; - if (size > 2 && p[2] < temp) - { - p[1] = p[2]; - p[2] = temp; - } - else - p[1] = temp; - } -} - -void HeapSort64(UInt64 *p, size_t size) -{ - if (size <= 1) - return; - p--; - { - size_t i = size / 2; - do - { - UInt64 temp = p[i]; - size_t k = i; - HeapSortDown(p, k, size, temp) - } - while (--i != 0); - } - /* - do - { - size_t k = 1; - UInt64 temp = p[size]; - p[size--] = p[1]; - HeapSortDown(p, k, size, temp) - } - while (size > 1); - */ - while (size > 3) - { - UInt64 temp = p[size]; - size_t k = (p[3] > p[2]) ? 3 : 2; - p[size--] = p[1]; - p[1] = p[k]; - HeapSortDown(p, k, size, temp) - } - { - UInt64 temp = p[size]; - p[size] = p[1]; - if (size > 2 && p[2] < temp) - { - p[1] = p[2]; - p[2] = temp; - } - else - p[1] = temp; - } -} - -/* -#define HeapSortRefDown(p, vals, n, size, temp) \ - { size_t k = n; UInt32 val = vals[temp]; for (;;) { \ - size_t s = (k << 1); \ - if (s > size) break; \ - if (s < size && vals[p[s + 1]] > vals[p[s]]) s++; \ - if (val >= vals[p[s]]) break; \ - p[k] = p[s]; k = s; \ - } p[k] = temp; } - -void HeapSortRef(UInt32 *p, UInt32 *vals, size_t size) -{ - if (size <= 1) - return; - p--; - { - size_t i = size / 2; - do - { - UInt32 temp = p[i]; - HeapSortRefDown(p, vals, i, size, temp); - } - while (--i != 0); - } - do - { - UInt32 temp = p[size]; - p[size--] = p[1]; - HeapSortRefDown(p, vals, 1, size, temp); - } - while (size > 1); -} -*/ diff --git a/jan/src/dep/libs/lib7z/Sort.h b/jan/src/dep/libs/lib7z/Sort.h deleted file mode 100644 index 7209d7824..000000000 --- a/jan/src/dep/libs/lib7z/Sort.h +++ /dev/null @@ -1,18 +0,0 @@ -/* Sort.h -- Sort functions -2014-04-05 : Igor Pavlov : Public domain */ - -#ifndef __7Z_SORT_H -#define __7Z_SORT_H - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -void HeapSort(UInt32 *p, size_t size); -void HeapSort64(UInt64 *p, size_t size); - -/* void HeapSortRef(UInt32 *p, UInt32 *vals, size_t size); */ - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Threads.c b/jan/src/dep/libs/lib7z/Threads.c deleted file mode 100644 index ece07e618..000000000 --- a/jan/src/dep/libs/lib7z/Threads.c +++ /dev/null @@ -1,93 +0,0 @@ -/* Threads.c -- multithreading library -2014-09-21 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#ifndef UNDER_CE -#include -#endif - -#include "Threads.h" - -static WRes GetError() -{ - DWORD res = GetLastError(); - return (res) ? (WRes)(res) : 1; -} - -WRes HandleToWRes(HANDLE h) { return (h != 0) ? 0 : GetError(); } -WRes BOOLToWRes(BOOL v) { return v ? 0 : GetError(); } - -WRes HandlePtr_Close(HANDLE *p) -{ - if (*p != NULL) - if (!CloseHandle(*p)) - return GetError(); - *p = NULL; - return 0; -} - -WRes Handle_WaitObject(HANDLE h) { return (WRes)WaitForSingleObject(h, INFINITE); } - -WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param) -{ - /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */ - - #ifdef UNDER_CE - - DWORD threadId; - *p = CreateThread(0, 0, func, param, 0, &threadId); - - #else - - unsigned threadId; - *p = (HANDLE)_beginthreadex(NULL, 0, func, param, 0, &threadId); - - #endif - - /* maybe we must use errno here, but probably GetLastError() is also OK. */ - return HandleToWRes(*p); -} - -WRes Event_Create(CEvent *p, BOOL manualReset, int signaled) -{ - *p = CreateEvent(NULL, manualReset, (signaled ? TRUE : FALSE), NULL); - return HandleToWRes(*p); -} - -WRes Event_Set(CEvent *p) { return BOOLToWRes(SetEvent(*p)); } -WRes Event_Reset(CEvent *p) { return BOOLToWRes(ResetEvent(*p)); } - -WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled) { return Event_Create(p, TRUE, signaled); } -WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled) { return Event_Create(p, FALSE, signaled); } -WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p) { return ManualResetEvent_Create(p, 0); } -WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p) { return AutoResetEvent_Create(p, 0); } - - -WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount) -{ - *p = CreateSemaphore(NULL, (LONG)initCount, (LONG)maxCount, NULL); - return HandleToWRes(*p); -} - -static WRes Semaphore_Release(CSemaphore *p, LONG releaseCount, LONG *previousCount) - { return BOOLToWRes(ReleaseSemaphore(*p, releaseCount, previousCount)); } -WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num) - { return Semaphore_Release(p, (LONG)num, NULL); } -WRes Semaphore_Release1(CSemaphore *p) { return Semaphore_ReleaseN(p, 1); } - -WRes CriticalSection_Init(CCriticalSection *p) -{ - /* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */ - #ifdef _MSC_VER - __try - #endif - { - InitializeCriticalSection(p); - /* InitializeCriticalSectionAndSpinCount(p, 0); */ - } - #ifdef _MSC_VER - __except (EXCEPTION_EXECUTE_HANDLER) { return 1; } - #endif - return 0; -} diff --git a/jan/src/dep/libs/lib7z/Threads.h b/jan/src/dep/libs/lib7z/Threads.h deleted file mode 100644 index e927208d7..000000000 --- a/jan/src/dep/libs/lib7z/Threads.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Threads.h -- multithreading library -2013-11-12 : Igor Pavlov : Public domain */ - -#ifndef __7Z_THREADS_H -#define __7Z_THREADS_H - -#ifdef _WIN32 -#include -#endif - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -WRes HandlePtr_Close(HANDLE *h); -WRes Handle_WaitObject(HANDLE h); - -typedef HANDLE CThread; -#define Thread_Construct(p) *(p) = NULL -#define Thread_WasCreated(p) (*(p) != NULL) -#define Thread_Close(p) HandlePtr_Close(p) -#define Thread_Wait(p) Handle_WaitObject(*(p)) - -typedef -#ifdef UNDER_CE - DWORD -#else - unsigned -#endif - THREAD_FUNC_RET_TYPE; - -#define THREAD_FUNC_CALL_TYPE MY_STD_CALL -#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE -typedef THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE * THREAD_FUNC_TYPE)(void *); -WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param); - -typedef HANDLE CEvent; -typedef CEvent CAutoResetEvent; -typedef CEvent CManualResetEvent; -#define Event_Construct(p) *(p) = NULL -#define Event_IsCreated(p) (*(p) != NULL) -#define Event_Close(p) HandlePtr_Close(p) -#define Event_Wait(p) Handle_WaitObject(*(p)) -WRes Event_Set(CEvent *p); -WRes Event_Reset(CEvent *p); -WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled); -WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p); -WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled); -WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p); - -typedef HANDLE CSemaphore; -#define Semaphore_Construct(p) (*p) = NULL -#define Semaphore_Close(p) HandlePtr_Close(p) -#define Semaphore_Wait(p) Handle_WaitObject(*(p)) -WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount); -WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num); -WRes Semaphore_Release1(CSemaphore *p); - -typedef CRITICAL_SECTION CCriticalSection; -WRes CriticalSection_Init(CCriticalSection *p); -#define CriticalSection_Delete(p) DeleteCriticalSection(p) -#define CriticalSection_Enter(p) EnterCriticalSection(p) -#define CriticalSection_Leave(p) LeaveCriticalSection(p) - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/Xz.c b/jan/src/dep/libs/lib7z/Xz.c deleted file mode 100644 index 92144db18..000000000 --- a/jan/src/dep/libs/lib7z/Xz.c +++ /dev/null @@ -1,90 +0,0 @@ -/* Xz.c - Xz -2015-05-01 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "7zCrc.h" -#include "CpuArch.h" -#include "Xz.h" -#include "XzCrc64.h" - -const Byte XZ_SIG[XZ_SIG_SIZE] = { 0xFD, '7', 'z', 'X', 'Z', 0 }; -const Byte XZ_FOOTER_SIG[XZ_FOOTER_SIG_SIZE] = { 'Y', 'Z' }; - -unsigned Xz_WriteVarInt(Byte *buf, UInt64 v) -{ - unsigned i = 0; - do - { - buf[i++] = (Byte)((v & 0x7F) | 0x80); - v >>= 7; - } - while (v != 0); - buf[i - 1] &= 0x7F; - return i; -} - -void Xz_Construct(CXzStream *p) -{ - p->numBlocks = p->numBlocksAllocated = 0; - p->blocks = 0; - p->flags = 0; -} - -void Xz_Free(CXzStream *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->blocks); - p->numBlocks = p->numBlocksAllocated = 0; - p->blocks = 0; -} - -unsigned XzFlags_GetCheckSize(CXzStreamFlags f) -{ - unsigned t = XzFlags_GetCheckType(f); - return (t == 0) ? 0 : (4 << ((t - 1) / 3)); -} - -void XzCheck_Init(CXzCheck *p, unsigned mode) -{ - p->mode = mode; - switch (mode) - { - case XZ_CHECK_CRC32: p->crc = CRC_INIT_VAL; break; - case XZ_CHECK_CRC64: p->crc64 = CRC64_INIT_VAL; break; - case XZ_CHECK_SHA256: Sha256_Init(&p->sha); break; - } -} - -void XzCheck_Update(CXzCheck *p, const void *data, size_t size) -{ - switch (p->mode) - { - case XZ_CHECK_CRC32: p->crc = CrcUpdate(p->crc, data, size); break; - case XZ_CHECK_CRC64: p->crc64 = Crc64Update(p->crc64, data, size); break; - case XZ_CHECK_SHA256: Sha256_Update(&p->sha, (const Byte *)data, size); break; - } -} - -int XzCheck_Final(CXzCheck *p, Byte *digest) -{ - switch (p->mode) - { - case XZ_CHECK_CRC32: - SetUi32(digest, CRC_GET_DIGEST(p->crc)); - break; - case XZ_CHECK_CRC64: - { - int i; - UInt64 v = CRC64_GET_DIGEST(p->crc64); - for (i = 0; i < 8; i++, v >>= 8) - digest[i] = (Byte)(v & 0xFF); - break; - } - case XZ_CHECK_SHA256: - Sha256_Final(&p->sha, digest); - break; - default: - return 0; - } - return 1; -} diff --git a/jan/src/dep/libs/lib7z/Xz.h b/jan/src/dep/libs/lib7z/Xz.h deleted file mode 100644 index 6937beaf6..000000000 --- a/jan/src/dep/libs/lib7z/Xz.h +++ /dev/null @@ -1,275 +0,0 @@ -/* Xz.h - Xz interface -2015-05-01 : Igor Pavlov : Public domain */ - -#ifndef __XZ_H -#define __XZ_H - -#include "Sha256.h" - -EXTERN_C_BEGIN - -#define XZ_ID_Subblock 1 -#define XZ_ID_Delta 3 -#define XZ_ID_X86 4 -#define XZ_ID_PPC 5 -#define XZ_ID_IA64 6 -#define XZ_ID_ARM 7 -#define XZ_ID_ARMT 8 -#define XZ_ID_SPARC 9 -#define XZ_ID_LZMA2 0x21 - -unsigned Xz_ReadVarInt(const Byte *p, size_t maxSize, UInt64 *value); -unsigned Xz_WriteVarInt(Byte *buf, UInt64 v); - -/* ---------- xz block ---------- */ - -#define XZ_BLOCK_HEADER_SIZE_MAX 1024 - -#define XZ_NUM_FILTERS_MAX 4 -#define XZ_BF_NUM_FILTERS_MASK 3 -#define XZ_BF_PACK_SIZE (1 << 6) -#define XZ_BF_UNPACK_SIZE (1 << 7) - -#define XZ_FILTER_PROPS_SIZE_MAX 20 - -typedef struct -{ - UInt64 id; - UInt32 propsSize; - Byte props[XZ_FILTER_PROPS_SIZE_MAX]; -} CXzFilter; - -typedef struct -{ - UInt64 packSize; - UInt64 unpackSize; - Byte flags; - CXzFilter filters[XZ_NUM_FILTERS_MAX]; -} CXzBlock; - -#define XzBlock_GetNumFilters(p) (((p)->flags & XZ_BF_NUM_FILTERS_MASK) + 1) -#define XzBlock_HasPackSize(p) (((p)->flags & XZ_BF_PACK_SIZE) != 0) -#define XzBlock_HasUnpackSize(p) (((p)->flags & XZ_BF_UNPACK_SIZE) != 0) - -SRes XzBlock_Parse(CXzBlock *p, const Byte *header); -SRes XzBlock_ReadHeader(CXzBlock *p, ISeqInStream *inStream, Bool *isIndex, UInt32 *headerSizeRes); - -/* ---------- xz stream ---------- */ - -#define XZ_SIG_SIZE 6 -#define XZ_FOOTER_SIG_SIZE 2 - -extern const Byte XZ_SIG[XZ_SIG_SIZE]; -extern const Byte XZ_FOOTER_SIG[XZ_FOOTER_SIG_SIZE]; - -#define XZ_STREAM_FLAGS_SIZE 2 -#define XZ_STREAM_CRC_SIZE 4 - -#define XZ_STREAM_HEADER_SIZE (XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE + XZ_STREAM_CRC_SIZE) -#define XZ_STREAM_FOOTER_SIZE (XZ_FOOTER_SIG_SIZE + XZ_STREAM_FLAGS_SIZE + XZ_STREAM_CRC_SIZE + 4) - -#define XZ_CHECK_MASK 0xF -#define XZ_CHECK_NO 0 -#define XZ_CHECK_CRC32 1 -#define XZ_CHECK_CRC64 4 -#define XZ_CHECK_SHA256 10 - -typedef struct -{ - unsigned mode; - UInt32 crc; - UInt64 crc64; - CSha256 sha; -} CXzCheck; - -void XzCheck_Init(CXzCheck *p, unsigned mode); -void XzCheck_Update(CXzCheck *p, const void *data, size_t size); -int XzCheck_Final(CXzCheck *p, Byte *digest); - -typedef UInt16 CXzStreamFlags; - -#define XzFlags_IsSupported(f) ((f) <= XZ_CHECK_MASK) -#define XzFlags_GetCheckType(f) ((f) & XZ_CHECK_MASK) -#define XzFlags_HasDataCrc32(f) (Xz_GetCheckType(f) == XZ_CHECK_CRC32) -unsigned XzFlags_GetCheckSize(CXzStreamFlags f); - -SRes Xz_ParseHeader(CXzStreamFlags *p, const Byte *buf); -SRes Xz_ReadHeader(CXzStreamFlags *p, ISeqInStream *inStream); - -typedef struct -{ - UInt64 unpackSize; - UInt64 totalSize; -} CXzBlockSizes; - -typedef struct -{ - CXzStreamFlags flags; - size_t numBlocks; - size_t numBlocksAllocated; - CXzBlockSizes *blocks; - UInt64 startOffset; -} CXzStream; - -void Xz_Construct(CXzStream *p); -void Xz_Free(CXzStream *p, ISzAlloc *alloc); - -#define XZ_SIZE_OVERFLOW ((UInt64)(Int64)-1) - -UInt64 Xz_GetUnpackSize(const CXzStream *p); -UInt64 Xz_GetPackSize(const CXzStream *p); - -typedef struct -{ - size_t num; - size_t numAllocated; - CXzStream *streams; -} CXzs; - -void Xzs_Construct(CXzs *p); -void Xzs_Free(CXzs *p, ISzAlloc *alloc); -SRes Xzs_ReadBackward(CXzs *p, ILookInStream *inStream, Int64 *startOffset, ICompressProgress *progress, ISzAlloc *alloc); - -UInt64 Xzs_GetNumBlocks(const CXzs *p); -UInt64 Xzs_GetUnpackSize(const CXzs *p); - -typedef enum -{ - CODER_STATUS_NOT_SPECIFIED, /* use main error code instead */ - CODER_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ - CODER_STATUS_NOT_FINISHED, /* stream was not finished */ - CODER_STATUS_NEEDS_MORE_INPUT /* you must provide more input bytes */ -} ECoderStatus; - -typedef enum -{ - CODER_FINISH_ANY, /* finish at any point */ - CODER_FINISH_END /* block must be finished at the end */ -} ECoderFinishMode; - -typedef struct _IStateCoder -{ - void *p; - void (*Free)(void *p, ISzAlloc *alloc); - SRes (*SetProps)(void *p, const Byte *props, size_t propSize, ISzAlloc *alloc); - void (*Init)(void *p); - SRes (*Code)(void *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, - int srcWasFinished, ECoderFinishMode finishMode, int *wasFinished); -} IStateCoder; - -#define MIXCODER_NUM_FILTERS_MAX 4 - -typedef struct -{ - ISzAlloc *alloc; - Byte *buf; - unsigned numCoders; - int finished[MIXCODER_NUM_FILTERS_MAX - 1]; - size_t pos[MIXCODER_NUM_FILTERS_MAX - 1]; - size_t size[MIXCODER_NUM_FILTERS_MAX - 1]; - UInt64 ids[MIXCODER_NUM_FILTERS_MAX]; - IStateCoder coders[MIXCODER_NUM_FILTERS_MAX]; -} CMixCoder; - -void MixCoder_Construct(CMixCoder *p, ISzAlloc *alloc); -void MixCoder_Free(CMixCoder *p); -void MixCoder_Init(CMixCoder *p); -SRes MixCoder_SetFromMethod(CMixCoder *p, unsigned coderIndex, UInt64 methodId); -SRes MixCoder_Code(CMixCoder *p, Byte *dest, SizeT *destLen, - const Byte *src, SizeT *srcLen, int srcWasFinished, - ECoderFinishMode finishMode, ECoderStatus *status); - -typedef enum -{ - XZ_STATE_STREAM_HEADER, - XZ_STATE_STREAM_INDEX, - XZ_STATE_STREAM_INDEX_CRC, - XZ_STATE_STREAM_FOOTER, - XZ_STATE_STREAM_PADDING, - XZ_STATE_BLOCK_HEADER, - XZ_STATE_BLOCK, - XZ_STATE_BLOCK_FOOTER -} EXzState; - -typedef struct -{ - EXzState state; - UInt32 pos; - unsigned alignPos; - unsigned indexPreSize; - - CXzStreamFlags streamFlags; - - UInt32 blockHeaderSize; - UInt64 packSize; - UInt64 unpackSize; - - UInt64 numBlocks; - UInt64 indexSize; - UInt64 indexPos; - UInt64 padSize; - - UInt64 numStartedStreams; - UInt64 numFinishedStreams; - UInt64 numTotalBlocks; - - UInt32 crc; - CMixCoder decoder; - CXzBlock block; - CXzCheck check; - CSha256 sha; - Byte shaDigest[SHA256_DIGEST_SIZE]; - Byte buf[XZ_BLOCK_HEADER_SIZE_MAX]; -} CXzUnpacker; - -void XzUnpacker_Construct(CXzUnpacker *p, ISzAlloc *alloc); -void XzUnpacker_Init(CXzUnpacker *p); -void XzUnpacker_Free(CXzUnpacker *p); - -/* -finishMode: - It has meaning only if the decoding reaches output limit (*destLen). - CODER_FINISH_ANY - use smallest number of input bytes - CODER_FINISH_END - read EndOfStream marker after decoding - -Returns: - SZ_OK - status: - CODER_STATUS_NOT_FINISHED, - CODER_STATUS_NEEDS_MORE_INPUT - maybe there are more xz streams, - call XzUnpacker_IsStreamWasFinished to check that current stream was finished - SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_DATA - Data error - SZ_ERROR_UNSUPPORTED - Unsupported method or method properties - SZ_ERROR_CRC - CRC error - // SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). - - SZ_ERROR_NO_ARCHIVE - the error with xz Stream Header with one of the following reasons: - - xz Stream Signature failure - - CRC32 of xz Stream Header is failed - - The size of Stream padding is not multiple of four bytes. - It's possible to get that error, if xz stream was finished and the stream - contains some another data. In that case you can call XzUnpacker_GetExtraSize() - function to get real size of xz stream. -*/ - - -SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, - const Byte *src, SizeT *srcLen, ECoderFinishMode finishMode, - ECoderStatus *status); - -Bool XzUnpacker_IsStreamWasFinished(CXzUnpacker *p); - -/* -Call XzUnpacker_GetExtraSize after XzUnpacker_Code function to detect real size of -xz stream in two cases: -XzUnpacker_Code() returns: - res == SZ_OK && status == CODER_STATUS_NEEDS_MORE_INPUT - res == SZ_ERROR_NO_ARCHIVE -*/ - -UInt64 XzUnpacker_GetExtraSize(CXzUnpacker *p); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/XzCrc64.c b/jan/src/dep/libs/lib7z/XzCrc64.c deleted file mode 100644 index bd0cf5a37..000000000 --- a/jan/src/dep/libs/lib7z/XzCrc64.c +++ /dev/null @@ -1,86 +0,0 @@ -/* XzCrc64.c -- CRC64 calculation -2015-03-01 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "XzCrc64.h" -#include "CpuArch.h" - -#define kCrc64Poly UINT64_CONST(0xC96C5795D7870F42) - -#ifdef MY_CPU_LE - #define CRC_NUM_TABLES 4 -#else - #define CRC_NUM_TABLES 5 - #define CRC_UINT64_SWAP(v) \ - ((v >> 56) \ - | ((v >> 40) & ((UInt64)0xFF << 8)) \ - | ((v >> 24) & ((UInt64)0xFF << 16)) \ - | ((v >> 8) & ((UInt64)0xFF << 24)) \ - | ((v << 8) & ((UInt64)0xFF << 32)) \ - | ((v << 24) & ((UInt64)0xFF << 40)) \ - | ((v << 40) & ((UInt64)0xFF << 48)) \ - | ((v << 56))) - - UInt64 MY_FAST_CALL XzCrc64UpdateT1_BeT4(UInt64 v, const void *data, size_t size, const UInt64 *table); -#endif - -#ifndef MY_CPU_BE - UInt64 MY_FAST_CALL XzCrc64UpdateT4(UInt64 v, const void *data, size_t size, const UInt64 *table); -#endif - -typedef UInt64 (MY_FAST_CALL *CRC_FUNC)(UInt64 v, const void *data, size_t size, const UInt64 *table); - -static CRC_FUNC g_Crc64Update; -UInt64 g_Crc64Table[256 * CRC_NUM_TABLES]; - -UInt64 MY_FAST_CALL Crc64Update(UInt64 v, const void *data, size_t size) -{ - return g_Crc64Update(v, data, size, g_Crc64Table); -} - -UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size) -{ - return g_Crc64Update(CRC64_INIT_VAL, data, size, g_Crc64Table) ^ CRC64_INIT_VAL; -} - -void MY_FAST_CALL Crc64GenerateTable() -{ - UInt32 i; - for (i = 0; i < 256; i++) - { - UInt64 r = i; - unsigned j; - for (j = 0; j < 8; j++) - r = (r >> 1) ^ (kCrc64Poly & ~((r & 1) - 1)); - g_Crc64Table[i] = r; - } - for (; i < 256 * CRC_NUM_TABLES; i++) - { - UInt64 r = g_Crc64Table[i - 256]; - g_Crc64Table[i] = g_Crc64Table[r & 0xFF] ^ (r >> 8); - } - - #ifdef MY_CPU_LE - - g_Crc64Update = XzCrc64UpdateT4; - - #else - { - #ifndef MY_CPU_BE - UInt32 k = 1; - if (*(const Byte *)&k == 1) - g_Crc64Update = XzCrc64UpdateT4; - else - #endif - { - for (i = 256 * CRC_NUM_TABLES - 1; i >= 256; i--) - { - UInt64 x = g_Crc64Table[i - 256]; - g_Crc64Table[i] = CRC_UINT64_SWAP(x); - } - g_Crc64Update = XzCrc64UpdateT1_BeT4; - } - } - #endif -} diff --git a/jan/src/dep/libs/lib7z/XzCrc64.h b/jan/src/dep/libs/lib7z/XzCrc64.h deleted file mode 100644 index 71b10d57e..000000000 --- a/jan/src/dep/libs/lib7z/XzCrc64.h +++ /dev/null @@ -1,26 +0,0 @@ -/* XzCrc64.h -- CRC64 calculation -2013-01-18 : Igor Pavlov : Public domain */ - -#ifndef __XZ_CRC64_H -#define __XZ_CRC64_H - -#include - -#include "7zTypes.h" - -EXTERN_C_BEGIN - -extern UInt64 g_Crc64Table[]; - -void MY_FAST_CALL Crc64GenerateTable(void); - -#define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF) -#define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL) -#define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) - -UInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size); -UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/XzCrc64Opt.c b/jan/src/dep/libs/lib7z/XzCrc64Opt.c deleted file mode 100644 index 97d086e6a..000000000 --- a/jan/src/dep/libs/lib7z/XzCrc64Opt.c +++ /dev/null @@ -1,69 +0,0 @@ -/* XzCrc64Opt.c -- CRC64 calculation -2015-03-01 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include "CpuArch.h" - -#ifndef MY_CPU_BE - -#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) - -UInt64 MY_FAST_CALL XzCrc64UpdateT4(UInt64 v, const void *data, size_t size, const UInt64 *table) -{ - const Byte *p = (const Byte *)data; - for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++) - v = CRC_UPDATE_BYTE_2(v, *p); - for (; size >= 4; size -= 4, p += 4) - { - UInt32 d = (UInt32)v ^ *(const UInt32 *)p; - v = (v >> 32) - ^ table[0x300 + ((d ) & 0xFF)] - ^ table[0x200 + ((d >> 8) & 0xFF)] - ^ table[0x100 + ((d >> 16) & 0xFF)] - ^ table[0x000 + ((d >> 24))]; - } - for (; size > 0; size--, p++) - v = CRC_UPDATE_BYTE_2(v, *p); - return v; -} - -#endif - - -#ifndef MY_CPU_LE - -#define CRC_UINT64_SWAP(v) \ - ((v >> 56) \ - | ((v >> 40) & ((UInt64)0xFF << 8)) \ - | ((v >> 24) & ((UInt64)0xFF << 16)) \ - | ((v >> 8) & ((UInt64)0xFF << 24)) \ - | ((v << 8) & ((UInt64)0xFF << 32)) \ - | ((v << 24) & ((UInt64)0xFF << 40)) \ - | ((v << 40) & ((UInt64)0xFF << 48)) \ - | ((v << 56))) - -#define CRC_UPDATE_BYTE_2_BE(crc, b) (table[(Byte)((crc) >> 56) ^ (b)] ^ ((crc) << 8)) - -UInt64 MY_FAST_CALL XzCrc64UpdateT1_BeT4(UInt64 v, const void *data, size_t size, const UInt64 *table) -{ - const Byte *p = (const Byte *)data; - table += 0x100; - v = CRC_UINT64_SWAP(v); - for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++) - v = CRC_UPDATE_BYTE_2_BE(v, *p); - for (; size >= 4; size -= 4, p += 4) - { - UInt32 d = (UInt32)(v >> 32) ^ *(const UInt32 *)p; - v = (v << 32) - ^ table[0x000 + ((d ) & 0xFF)] - ^ table[0x100 + ((d >> 8) & 0xFF)] - ^ table[0x200 + ((d >> 16) & 0xFF)] - ^ table[0x300 + ((d >> 24))]; - } - for (; size > 0; size--, p++) - v = CRC_UPDATE_BYTE_2_BE(v, *p); - return CRC_UINT64_SWAP(v); -} - -#endif diff --git a/jan/src/dep/libs/lib7z/XzDec.c b/jan/src/dep/libs/lib7z/XzDec.c deleted file mode 100644 index 29831b0ca..000000000 --- a/jan/src/dep/libs/lib7z/XzDec.c +++ /dev/null @@ -1,913 +0,0 @@ -/* XzDec.c -- Xz Decode -2015-11-09 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -/* #define XZ_DUMP */ - -#ifdef XZ_DUMP -#include -#endif - -#include -#include - -#include "7zCrc.h" -#include "Alloc.h" -#include "Bra.h" -#include "CpuArch.h" -#include "Delta.h" -#include "Lzma2Dec.h" - -#ifdef USE_SUBBLOCK -#include "Bcj3Dec.c" -#include "SbDec.c" -#endif - -#include "Xz.h" - -#define XZ_CHECK_SIZE_MAX 64 - -#define CODER_BUF_SIZE (1 << 17) - -unsigned Xz_ReadVarInt(const Byte *p, size_t maxSize, UInt64 *value) -{ - unsigned i, limit; - *value = 0; - limit = (maxSize > 9) ? 9 : (unsigned)maxSize; - - for (i = 0; i < limit;) - { - Byte b = p[i]; - *value |= (UInt64)(b & 0x7F) << (7 * i++); - if ((b & 0x80) == 0) - return (b == 0 && i != 1) ? 0 : i; - } - return 0; -} - -/* ---------- BraState ---------- */ - -#define BRA_BUF_SIZE (1 << 14) - -typedef struct -{ - size_t bufPos; - size_t bufConv; - size_t bufTotal; - - UInt32 methodId; - int encodeMode; - UInt32 delta; - UInt32 ip; - UInt32 x86State; - Byte deltaState[DELTA_STATE_SIZE]; - - Byte buf[BRA_BUF_SIZE]; -} CBraState; - -static void BraState_Free(void *pp, ISzAlloc *alloc) -{ - alloc->Free(alloc, pp); -} - -static SRes BraState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAlloc *alloc) -{ - CBraState *p = ((CBraState *)pp); - UNUSED_VAR(alloc); - p->ip = 0; - if (p->methodId == XZ_ID_Delta) - { - if (propSize != 1) - return SZ_ERROR_UNSUPPORTED; - p->delta = (unsigned)props[0] + 1; - } - else - { - if (propSize == 4) - { - UInt32 v = GetUi32(props); - switch (p->methodId) - { - case XZ_ID_PPC: - case XZ_ID_ARM: - case XZ_ID_SPARC: - if ((v & 3) != 0) - return SZ_ERROR_UNSUPPORTED; - break; - case XZ_ID_ARMT: - if ((v & 1) != 0) - return SZ_ERROR_UNSUPPORTED; - break; - case XZ_ID_IA64: - if ((v & 0xF) != 0) - return SZ_ERROR_UNSUPPORTED; - break; - } - p->ip = v; - } - else if (propSize != 0) - return SZ_ERROR_UNSUPPORTED; - } - return SZ_OK; -} - -static void BraState_Init(void *pp) -{ - CBraState *p = ((CBraState *)pp); - p->bufPos = p->bufConv = p->bufTotal = 0; - x86_Convert_Init(p->x86State); - if (p->methodId == XZ_ID_Delta) - Delta_Init(p->deltaState); -} - -#define CASE_BRA_CONV(isa) case XZ_ID_ ## isa: p->bufConv = isa ## _Convert(p->buf, p->bufTotal, p->ip, p->encodeMode); break; - -static SRes BraState_Code(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, - int srcWasFinished, ECoderFinishMode finishMode, int *wasFinished) -{ - CBraState *p = ((CBraState *)pp); - SizeT destLenOrig = *destLen; - SizeT srcLenOrig = *srcLen; - UNUSED_VAR(finishMode); - *destLen = 0; - *srcLen = 0; - *wasFinished = 0; - while (destLenOrig > 0) - { - if (p->bufPos != p->bufConv) - { - size_t curSize = p->bufConv - p->bufPos; - if (curSize > destLenOrig) - curSize = destLenOrig; - memcpy(dest, p->buf + p->bufPos, curSize); - p->bufPos += curSize; - *destLen += curSize; - dest += curSize; - destLenOrig -= curSize; - continue; - } - p->bufTotal -= p->bufPos; - memmove(p->buf, p->buf + p->bufPos, p->bufTotal); - p->bufPos = 0; - p->bufConv = 0; - { - size_t curSize = BRA_BUF_SIZE - p->bufTotal; - if (curSize > srcLenOrig) - curSize = srcLenOrig; - memcpy(p->buf + p->bufTotal, src, curSize); - *srcLen += curSize; - src += curSize; - srcLenOrig -= curSize; - p->bufTotal += curSize; - } - if (p->bufTotal == 0) - break; - switch (p->methodId) - { - case XZ_ID_Delta: - if (p->encodeMode) - Delta_Encode(p->deltaState, p->delta, p->buf, p->bufTotal); - else - Delta_Decode(p->deltaState, p->delta, p->buf, p->bufTotal); - p->bufConv = p->bufTotal; - break; - case XZ_ID_X86: - p->bufConv = x86_Convert(p->buf, p->bufTotal, p->ip, &p->x86State, p->encodeMode); - break; - CASE_BRA_CONV(PPC) - CASE_BRA_CONV(IA64) - CASE_BRA_CONV(ARM) - CASE_BRA_CONV(ARMT) - CASE_BRA_CONV(SPARC) - default: - return SZ_ERROR_UNSUPPORTED; - } - p->ip += (UInt32)p->bufConv; - - if (p->bufConv == 0) - { - if (!srcWasFinished) - break; - p->bufConv = p->bufTotal; - } - } - if (p->bufTotal == p->bufPos && srcLenOrig == 0 && srcWasFinished) - *wasFinished = 1; - return SZ_OK; -} - -SRes BraState_SetFromMethod(IStateCoder *p, UInt64 id, int encodeMode, ISzAlloc *alloc) -{ - CBraState *decoder; - if (id != XZ_ID_Delta && - id != XZ_ID_X86 && - id != XZ_ID_PPC && - id != XZ_ID_IA64 && - id != XZ_ID_ARM && - id != XZ_ID_ARMT && - id != XZ_ID_SPARC) - return SZ_ERROR_UNSUPPORTED; - p->p = 0; - decoder = (CBraState *)alloc->Alloc(alloc, sizeof(CBraState)); - if (decoder == 0) - return SZ_ERROR_MEM; - decoder->methodId = (UInt32)id; - decoder->encodeMode = encodeMode; - p->p = decoder; - p->Free = BraState_Free; - p->SetProps = BraState_SetProps; - p->Init = BraState_Init; - p->Code = BraState_Code; - return SZ_OK; -} - -/* ---------- SbState ---------- */ - -#ifdef USE_SUBBLOCK - -static void SbState_Free(void *pp, ISzAlloc *alloc) -{ - CSbDec *p = (CSbDec *)pp; - SbDec_Free(p); - alloc->Free(alloc, pp); -} - -static SRes SbState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAlloc *alloc) -{ - UNUSED_VAR(pp); - UNUSED_VAR(props); - UNUSED_VAR(alloc); - return (propSize == 0) ? SZ_OK : SZ_ERROR_UNSUPPORTED; -} - -static void SbState_Init(void *pp) -{ - SbDec_Init((CSbDec *)pp); -} - -static SRes SbState_Code(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, - int srcWasFinished, ECoderFinishMode finishMode, int *wasFinished) -{ - CSbDec *p = (CSbDec *)pp; - SRes res; - UNUSED_VAR(srcWasFinished); - p->dest = dest; - p->destLen = *destLen; - p->src = src; - p->srcLen = *srcLen; - p->finish = finishMode; /* change it */ - res = SbDec_Decode((CSbDec *)pp); - *destLen -= p->destLen; - *srcLen -= p->srcLen; - *wasFinished = (*destLen == 0 && *srcLen == 0); /* change it */ - return res; -} - -SRes SbState_SetFromMethod(IStateCoder *p, ISzAlloc *alloc) -{ - CSbDec *decoder; - p->p = 0; - decoder = alloc->Alloc(alloc, sizeof(CSbDec)); - if (decoder == 0) - return SZ_ERROR_MEM; - p->p = decoder; - p->Free = SbState_Free; - p->SetProps = SbState_SetProps; - p->Init = SbState_Init; - p->Code = SbState_Code; - SbDec_Construct(decoder); - SbDec_SetAlloc(decoder, alloc); - return SZ_OK; -} -#endif - -/* ---------- Lzma2State ---------- */ - -static void Lzma2State_Free(void *pp, ISzAlloc *alloc) -{ - Lzma2Dec_Free((CLzma2Dec *)pp, alloc); - alloc->Free(alloc, pp); -} - -static SRes Lzma2State_SetProps(void *pp, const Byte *props, size_t propSize, ISzAlloc *alloc) -{ - if (propSize != 1) - return SZ_ERROR_UNSUPPORTED; - return Lzma2Dec_Allocate((CLzma2Dec *)pp, props[0], alloc); -} - -static void Lzma2State_Init(void *pp) -{ - Lzma2Dec_Init((CLzma2Dec *)pp); -} - -static SRes Lzma2State_Code(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, - int srcWasFinished, ECoderFinishMode finishMode, int *wasFinished) -{ - ELzmaStatus status; - /* ELzmaFinishMode fm = (finishMode == LZMA_FINISH_ANY) ? LZMA_FINISH_ANY : LZMA_FINISH_END; */ - SRes res = Lzma2Dec_DecodeToBuf((CLzma2Dec *)pp, dest, destLen, src, srcLen, (ELzmaFinishMode)finishMode, &status); - UNUSED_VAR(srcWasFinished); - *wasFinished = (status == LZMA_STATUS_FINISHED_WITH_MARK); - return res; -} - -static SRes Lzma2State_SetFromMethod(IStateCoder *p, ISzAlloc *alloc) -{ - CLzma2Dec *decoder = (CLzma2Dec *)alloc->Alloc(alloc, sizeof(CLzma2Dec)); - p->p = decoder; - if (decoder == 0) - return SZ_ERROR_MEM; - p->Free = Lzma2State_Free; - p->SetProps = Lzma2State_SetProps; - p->Init = Lzma2State_Init; - p->Code = Lzma2State_Code; - Lzma2Dec_Construct(decoder); - return SZ_OK; -} - - -void MixCoder_Construct(CMixCoder *p, ISzAlloc *alloc) -{ - unsigned i; - p->alloc = alloc; - p->buf = NULL; - p->numCoders = 0; - for (i = 0; i < MIXCODER_NUM_FILTERS_MAX; i++) - p->coders[i].p = NULL; -} - -void MixCoder_Free(CMixCoder *p) -{ - unsigned i; - for (i = 0; i < p->numCoders; i++) - { - IStateCoder *sc = &p->coders[i]; - if (p->alloc && sc->p) - sc->Free(sc->p, p->alloc); - } - p->numCoders = 0; - if (p->buf) - { - p->alloc->Free(p->alloc, p->buf); - p->buf = NULL; /* 9.31: the BUG was fixed */ - } -} - -void MixCoder_Init(CMixCoder *p) -{ - unsigned i; - for (i = 0; i < MIXCODER_NUM_FILTERS_MAX - 1; i++) - { - p->size[i] = 0; - p->pos[i] = 0; - p->finished[i] = 0; - } - for (i = 0; i < p->numCoders; i++) - { - IStateCoder *coder = &p->coders[i]; - coder->Init(coder->p); - } -} - -SRes MixCoder_SetFromMethod(CMixCoder *p, unsigned coderIndex, UInt64 methodId) -{ - IStateCoder *sc = &p->coders[coderIndex]; - p->ids[coderIndex] = methodId; - switch (methodId) - { - case XZ_ID_LZMA2: return Lzma2State_SetFromMethod(sc, p->alloc); - #ifdef USE_SUBBLOCK - case XZ_ID_Subblock: return SbState_SetFromMethod(sc, p->alloc); - #endif - } - if (coderIndex == 0) - return SZ_ERROR_UNSUPPORTED; - return BraState_SetFromMethod(sc, methodId, 0, p->alloc); -} - -SRes MixCoder_Code(CMixCoder *p, Byte *dest, SizeT *destLen, - const Byte *src, SizeT *srcLen, int srcWasFinished, - ECoderFinishMode finishMode, ECoderStatus *status) -{ - SizeT destLenOrig = *destLen; - SizeT srcLenOrig = *srcLen; - Bool allFinished = True; - *destLen = 0; - *srcLen = 0; - *status = CODER_STATUS_NOT_FINISHED; - - if (!p->buf) - { - p->buf = (Byte *)p->alloc->Alloc(p->alloc, CODER_BUF_SIZE * (MIXCODER_NUM_FILTERS_MAX - 1)); - if (!p->buf) - return SZ_ERROR_MEM; - } - - if (p->numCoders != 1) - finishMode = CODER_FINISH_ANY; - - for (;;) - { - Bool processed = False; - unsigned i; - /* - if (p->numCoders == 1 && *destLen == destLenOrig && finishMode == LZMA_FINISH_ANY) - break; - */ - - for (i = 0; i < p->numCoders; i++) - { - SRes res; - IStateCoder *coder = &p->coders[i]; - Byte *destCur; - SizeT destLenCur, srcLenCur; - const Byte *srcCur; - int srcFinishedCur; - int encodingWasFinished; - - if (i == 0) - { - srcCur = src; - srcLenCur = srcLenOrig - *srcLen; - srcFinishedCur = srcWasFinished; - } - else - { - srcCur = p->buf + (CODER_BUF_SIZE * (i - 1)) + p->pos[i - 1]; - srcLenCur = p->size[i - 1] - p->pos[i - 1]; - srcFinishedCur = p->finished[i - 1]; - } - - if (i == p->numCoders - 1) - { - destCur = dest; - destLenCur = destLenOrig - *destLen; - } - else - { - if (p->pos[i] != p->size[i]) - continue; - destCur = p->buf + (CODER_BUF_SIZE * i); - destLenCur = CODER_BUF_SIZE; - } - - res = coder->Code(coder->p, destCur, &destLenCur, srcCur, &srcLenCur, srcFinishedCur, finishMode, &encodingWasFinished); - - if (!encodingWasFinished) - allFinished = False; - - if (i == 0) - { - *srcLen += srcLenCur; - src += srcLenCur; - } - else - { - p->pos[i - 1] += srcLenCur; - } - - if (i == p->numCoders - 1) - { - *destLen += destLenCur; - dest += destLenCur; - } - else - { - p->size[i] = destLenCur; - p->pos[i] = 0; - p->finished[i] = encodingWasFinished; - } - - if (res != SZ_OK) - return res; - - if (destLenCur != 0 || srcLenCur != 0) - processed = True; - } - if (!processed) - break; - } - if (allFinished) - *status = CODER_STATUS_FINISHED_WITH_MARK; - return SZ_OK; -} - -SRes Xz_ParseHeader(CXzStreamFlags *p, const Byte *buf) -{ - *p = (CXzStreamFlags)GetBe16(buf + XZ_SIG_SIZE); - if (CrcCalc(buf + XZ_SIG_SIZE, XZ_STREAM_FLAGS_SIZE) != - GetUi32(buf + XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE)) - return SZ_ERROR_NO_ARCHIVE; - return XzFlags_IsSupported(*p) ? SZ_OK : SZ_ERROR_UNSUPPORTED; -} - -static Bool Xz_CheckFooter(CXzStreamFlags flags, UInt64 indexSize, const Byte *buf) -{ - return - indexSize == (((UInt64)GetUi32(buf + 4) + 1) << 2) && - (GetUi32(buf) == CrcCalc(buf + 4, 6) && - flags == GetBe16(buf + 8) && - memcmp(buf + 10, XZ_FOOTER_SIG, XZ_FOOTER_SIG_SIZE) == 0); -} - -#define READ_VARINT_AND_CHECK(buf, pos, size, res) \ - { unsigned s = Xz_ReadVarInt(buf + pos, size - pos, res); \ - if (s == 0) return SZ_ERROR_ARCHIVE; pos += s; } - - -SRes XzBlock_Parse(CXzBlock *p, const Byte *header) -{ - unsigned pos; - unsigned numFilters, i; - unsigned headerSize = (unsigned)header[0] << 2; - - if (CrcCalc(header, headerSize) != GetUi32(header + headerSize)) - return SZ_ERROR_ARCHIVE; - - pos = 1; - if (pos == headerSize) - return SZ_ERROR_ARCHIVE; - p->flags = header[pos++]; - - if (XzBlock_HasPackSize(p)) - { - READ_VARINT_AND_CHECK(header, pos, headerSize, &p->packSize); - if (p->packSize == 0 || p->packSize + headerSize >= (UInt64)1 << 63) - return SZ_ERROR_ARCHIVE; - } - - if (XzBlock_HasUnpackSize(p)) - READ_VARINT_AND_CHECK(header, pos, headerSize, &p->unpackSize); - - numFilters = XzBlock_GetNumFilters(p); - for (i = 0; i < numFilters; i++) - { - CXzFilter *filter = p->filters + i; - UInt64 size; - READ_VARINT_AND_CHECK(header, pos, headerSize, &filter->id); - READ_VARINT_AND_CHECK(header, pos, headerSize, &size); - if (size > headerSize - pos || size > XZ_FILTER_PROPS_SIZE_MAX) - return SZ_ERROR_ARCHIVE; - filter->propsSize = (UInt32)size; - memcpy(filter->props, header + pos, (size_t)size); - pos += (unsigned)size; - - #ifdef XZ_DUMP - printf("\nf[%u] = %2X: ", i, (unsigned)filter->id); - { - unsigned i; - for (i = 0; i < size; i++) - printf(" %2X", filter->props[i]); - } - #endif - } - - while (pos < headerSize) - if (header[pos++] != 0) - return SZ_ERROR_ARCHIVE; - return SZ_OK; -} - -SRes XzDec_Init(CMixCoder *p, const CXzBlock *block) -{ - unsigned i; - Bool needReInit = True; - unsigned numFilters = XzBlock_GetNumFilters(block); - - if (numFilters == p->numCoders) - { - for (i = 0; i < numFilters; i++) - if (p->ids[i] != block->filters[numFilters - 1 - i].id) - break; - needReInit = (i != numFilters); - } - - if (needReInit) - { - MixCoder_Free(p); - p->numCoders = numFilters; - for (i = 0; i < numFilters; i++) - { - const CXzFilter *f = &block->filters[numFilters - 1 - i]; - RINOK(MixCoder_SetFromMethod(p, i, f->id)); - } - } - - for (i = 0; i < numFilters; i++) - { - const CXzFilter *f = &block->filters[numFilters - 1 - i]; - IStateCoder *sc = &p->coders[i]; - RINOK(sc->SetProps(sc->p, f->props, f->propsSize, p->alloc)); - } - - MixCoder_Init(p); - return SZ_OK; -} - -void XzUnpacker_Init(CXzUnpacker *p) -{ - p->state = XZ_STATE_STREAM_HEADER; - p->pos = 0; - p->numStartedStreams = 0; - p->numFinishedStreams = 0; - p->numTotalBlocks = 0; - p->padSize = 0; -} - -void XzUnpacker_Construct(CXzUnpacker *p, ISzAlloc *alloc) -{ - MixCoder_Construct(&p->decoder, alloc); - XzUnpacker_Init(p); -} - -void XzUnpacker_Free(CXzUnpacker *p) -{ - MixCoder_Free(&p->decoder); -} - -SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, - const Byte *src, SizeT *srcLen, ECoderFinishMode finishMode, ECoderStatus *status) -{ - SizeT destLenOrig = *destLen; - SizeT srcLenOrig = *srcLen; - *destLen = 0; - *srcLen = 0; - *status = CODER_STATUS_NOT_SPECIFIED; - for (;;) - { - SizeT srcRem = srcLenOrig - *srcLen; - - if (p->state == XZ_STATE_BLOCK) - { - SizeT destLen2 = destLenOrig - *destLen; - SizeT srcLen2 = srcLenOrig - *srcLen; - SRes res; - if (srcLen2 == 0 && destLen2 == 0) - { - *status = CODER_STATUS_NOT_FINISHED; - return SZ_OK; - } - - res = MixCoder_Code(&p->decoder, dest, &destLen2, src, &srcLen2, False, finishMode, status); - XzCheck_Update(&p->check, dest, destLen2); - - (*srcLen) += srcLen2; - src += srcLen2; - p->packSize += srcLen2; - - (*destLen) += destLen2; - dest += destLen2; - p->unpackSize += destLen2; - - RINOK(res); - - if (*status == CODER_STATUS_FINISHED_WITH_MARK) - { - Byte temp[32]; - unsigned num = Xz_WriteVarInt(temp, p->packSize + p->blockHeaderSize + XzFlags_GetCheckSize(p->streamFlags)); - num += Xz_WriteVarInt(temp + num, p->unpackSize); - Sha256_Update(&p->sha, temp, num); - p->indexSize += num; - p->numBlocks++; - - p->state = XZ_STATE_BLOCK_FOOTER; - p->pos = 0; - p->alignPos = 0; - } - else if (srcLen2 == 0 && destLen2 == 0) - return SZ_OK; - - continue; - } - - if (srcRem == 0) - { - *status = CODER_STATUS_NEEDS_MORE_INPUT; - return SZ_OK; - } - - switch (p->state) - { - case XZ_STATE_STREAM_HEADER: - { - if (p->pos < XZ_STREAM_HEADER_SIZE) - { - if (p->pos < XZ_SIG_SIZE && *src != XZ_SIG[p->pos]) - return SZ_ERROR_NO_ARCHIVE; - p->buf[p->pos++] = *src++; - (*srcLen)++; - } - else - { - RINOK(Xz_ParseHeader(&p->streamFlags, p->buf)); - p->numStartedStreams++; - p->state = XZ_STATE_BLOCK_HEADER; - Sha256_Init(&p->sha); - p->indexSize = 0; - p->numBlocks = 0; - p->pos = 0; - } - break; - } - - case XZ_STATE_BLOCK_HEADER: - { - if (p->pos == 0) - { - p->buf[p->pos++] = *src++; - (*srcLen)++; - if (p->buf[0] == 0) - { - p->indexPreSize = 1 + Xz_WriteVarInt(p->buf + 1, p->numBlocks); - p->indexPos = p->indexPreSize; - p->indexSize += p->indexPreSize; - Sha256_Final(&p->sha, p->shaDigest); - Sha256_Init(&p->sha); - p->crc = CrcUpdate(CRC_INIT_VAL, p->buf, p->indexPreSize); - p->state = XZ_STATE_STREAM_INDEX; - } - p->blockHeaderSize = ((UInt32)p->buf[0] << 2) + 4; - } - else if (p->pos != p->blockHeaderSize) - { - UInt32 cur = p->blockHeaderSize - p->pos; - if (cur > srcRem) - cur = (UInt32)srcRem; - memcpy(p->buf + p->pos, src, cur); - p->pos += cur; - (*srcLen) += cur; - src += cur; - } - else - { - RINOK(XzBlock_Parse(&p->block, p->buf)); - p->numTotalBlocks++; - p->state = XZ_STATE_BLOCK; - p->packSize = 0; - p->unpackSize = 0; - XzCheck_Init(&p->check, XzFlags_GetCheckType(p->streamFlags)); - RINOK(XzDec_Init(&p->decoder, &p->block)); - } - break; - } - - case XZ_STATE_BLOCK_FOOTER: - { - if (((p->packSize + p->alignPos) & 3) != 0) - { - (*srcLen)++; - p->alignPos++; - if (*src++ != 0) - return SZ_ERROR_CRC; - } - else - { - UInt32 checkSize = XzFlags_GetCheckSize(p->streamFlags); - UInt32 cur = checkSize - p->pos; - if (cur != 0) - { - if (cur > srcRem) - cur = (UInt32)srcRem; - memcpy(p->buf + p->pos, src, cur); - p->pos += cur; - (*srcLen) += cur; - src += cur; - } - else - { - Byte digest[XZ_CHECK_SIZE_MAX]; - p->state = XZ_STATE_BLOCK_HEADER; - p->pos = 0; - if (XzCheck_Final(&p->check, digest) && memcmp(digest, p->buf, checkSize) != 0) - return SZ_ERROR_CRC; - } - } - break; - } - - case XZ_STATE_STREAM_INDEX: - { - if (p->pos < p->indexPreSize) - { - (*srcLen)++; - if (*src++ != p->buf[p->pos++]) - return SZ_ERROR_CRC; - } - else - { - if (p->indexPos < p->indexSize) - { - UInt64 cur = p->indexSize - p->indexPos; - if (srcRem > cur) - srcRem = (SizeT)cur; - p->crc = CrcUpdate(p->crc, src, srcRem); - Sha256_Update(&p->sha, src, srcRem); - (*srcLen) += srcRem; - src += srcRem; - p->indexPos += srcRem; - } - else if ((p->indexPos & 3) != 0) - { - Byte b = *src++; - p->crc = CRC_UPDATE_BYTE(p->crc, b); - (*srcLen)++; - p->indexPos++; - p->indexSize++; - if (b != 0) - return SZ_ERROR_CRC; - } - else - { - Byte digest[SHA256_DIGEST_SIZE]; - p->state = XZ_STATE_STREAM_INDEX_CRC; - p->indexSize += 4; - p->pos = 0; - Sha256_Final(&p->sha, digest); - if (memcmp(digest, p->shaDigest, SHA256_DIGEST_SIZE) != 0) - return SZ_ERROR_CRC; - } - } - break; - } - - case XZ_STATE_STREAM_INDEX_CRC: - { - if (p->pos < 4) - { - (*srcLen)++; - p->buf[p->pos++] = *src++; - } - else - { - p->state = XZ_STATE_STREAM_FOOTER; - p->pos = 0; - if (CRC_GET_DIGEST(p->crc) != GetUi32(p->buf)) - return SZ_ERROR_CRC; - } - break; - } - - case XZ_STATE_STREAM_FOOTER: - { - UInt32 cur = XZ_STREAM_FOOTER_SIZE - p->pos; - if (cur > srcRem) - cur = (UInt32)srcRem; - memcpy(p->buf + p->pos, src, cur); - p->pos += cur; - (*srcLen) += cur; - src += cur; - if (p->pos == XZ_STREAM_FOOTER_SIZE) - { - p->state = XZ_STATE_STREAM_PADDING; - p->numFinishedStreams++; - p->padSize = 0; - if (!Xz_CheckFooter(p->streamFlags, p->indexSize, p->buf)) - return SZ_ERROR_CRC; - } - break; - } - - case XZ_STATE_STREAM_PADDING: - { - if (*src != 0) - { - if (((UInt32)p->padSize & 3) != 0) - return SZ_ERROR_NO_ARCHIVE; - p->pos = 0; - p->state = XZ_STATE_STREAM_HEADER; - } - else - { - (*srcLen)++; - src++; - p->padSize++; - } - break; - } - - case XZ_STATE_BLOCK: break; /* to disable GCC warning */ - } - } - /* - if (p->state == XZ_STATE_FINISHED) - *status = CODER_STATUS_FINISHED_WITH_MARK; - return SZ_OK; - */ -} - -Bool XzUnpacker_IsStreamWasFinished(CXzUnpacker *p) -{ - return (p->state == XZ_STATE_STREAM_PADDING) && (((UInt32)p->padSize & 3) == 0); -} - -UInt64 XzUnpacker_GetExtraSize(CXzUnpacker *p) -{ - UInt64 num = 0; - if (p->state == XZ_STATE_STREAM_PADDING) - num += p->padSize; - else if (p->state == XZ_STATE_STREAM_HEADER) - num += p->padSize + p->pos; - return num; -} diff --git a/jan/src/dep/libs/lib7z/XzEnc.c b/jan/src/dep/libs/lib7z/XzEnc.c deleted file mode 100644 index 2e5a003ad..000000000 --- a/jan/src/dep/libs/lib7z/XzEnc.c +++ /dev/null @@ -1,538 +0,0 @@ -/* XzEnc.c -- Xz Encode -2015-09-16 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include -#include - -#include "7zCrc.h" -#include "Alloc.h" -#include "Bra.h" -#include "CpuArch.h" - -#ifdef USE_SUBBLOCK -#include "Bcj3Enc.c" -#include "SbFind.c" -#include "SbEnc.c" -#endif - -#include "XzEnc.h" - -#define XzBlock_ClearFlags(p) (p)->flags = 0; -#define XzBlock_SetNumFilters(p, n) (p)->flags |= ((n) - 1); -#define XzBlock_SetHasPackSize(p) (p)->flags |= XZ_BF_PACK_SIZE; -#define XzBlock_SetHasUnpackSize(p) (p)->flags |= XZ_BF_UNPACK_SIZE; - -static SRes WriteBytes(ISeqOutStream *s, const void *buf, UInt32 size) -{ - return (s->Write(s, buf, size) == size) ? SZ_OK : SZ_ERROR_WRITE; -} - -static SRes WriteBytesAndCrc(ISeqOutStream *s, const void *buf, UInt32 size, UInt32 *crc) -{ - *crc = CrcUpdate(*crc, buf, size); - return WriteBytes(s, buf, size); -} - -static SRes Xz_WriteHeader(CXzStreamFlags f, ISeqOutStream *s) -{ - UInt32 crc; - Byte header[XZ_STREAM_HEADER_SIZE]; - memcpy(header, XZ_SIG, XZ_SIG_SIZE); - header[XZ_SIG_SIZE] = (Byte)(f >> 8); - header[XZ_SIG_SIZE + 1] = (Byte)(f & 0xFF); - crc = CrcCalc(header + XZ_SIG_SIZE, XZ_STREAM_FLAGS_SIZE); - SetUi32(header + XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE, crc); - return WriteBytes(s, header, XZ_STREAM_HEADER_SIZE); -} - - -static SRes XzBlock_WriteHeader(const CXzBlock *p, ISeqOutStream *s) -{ - Byte header[XZ_BLOCK_HEADER_SIZE_MAX]; - - unsigned pos = 1; - unsigned numFilters, i; - header[pos++] = p->flags; - - if (XzBlock_HasPackSize(p)) pos += Xz_WriteVarInt(header + pos, p->packSize); - if (XzBlock_HasUnpackSize(p)) pos += Xz_WriteVarInt(header + pos, p->unpackSize); - numFilters = XzBlock_GetNumFilters(p); - - for (i = 0; i < numFilters; i++) - { - const CXzFilter *f = &p->filters[i]; - pos += Xz_WriteVarInt(header + pos, f->id); - pos += Xz_WriteVarInt(header + pos, f->propsSize); - memcpy(header + pos, f->props, f->propsSize); - pos += f->propsSize; - } - - while ((pos & 3) != 0) - header[pos++] = 0; - - header[0] = (Byte)(pos >> 2); - SetUi32(header + pos, CrcCalc(header, pos)); - return WriteBytes(s, header, pos + 4); -} - - -static SRes Xz_WriteFooter(CXzStream *p, ISeqOutStream *s) -{ - Byte buf[32]; - UInt64 globalPos; - { - UInt32 crc = CRC_INIT_VAL; - unsigned pos = 1 + Xz_WriteVarInt(buf + 1, p->numBlocks); - size_t i; - - globalPos = pos; - buf[0] = 0; - RINOK(WriteBytesAndCrc(s, buf, pos, &crc)); - - for (i = 0; i < p->numBlocks; i++) - { - const CXzBlockSizes *block = &p->blocks[i]; - pos = Xz_WriteVarInt(buf, block->totalSize); - pos += Xz_WriteVarInt(buf + pos, block->unpackSize); - globalPos += pos; - RINOK(WriteBytesAndCrc(s, buf, pos, &crc)); - } - - pos = ((unsigned)globalPos & 3); - - if (pos != 0) - { - buf[0] = buf[1] = buf[2] = 0; - RINOK(WriteBytesAndCrc(s, buf, 4 - pos, &crc)); - globalPos += 4 - pos; - } - { - SetUi32(buf, CRC_GET_DIGEST(crc)); - RINOK(WriteBytes(s, buf, 4)); - globalPos += 4; - } - } - - { - UInt32 indexSize = (UInt32)((globalPos >> 2) - 1); - SetUi32(buf + 4, indexSize); - buf[8] = (Byte)(p->flags >> 8); - buf[9] = (Byte)(p->flags & 0xFF); - SetUi32(buf, CrcCalc(buf + 4, 6)); - memcpy(buf + 10, XZ_FOOTER_SIG, XZ_FOOTER_SIG_SIZE); - return WriteBytes(s, buf, 12); - } -} - - -static SRes Xz_AddIndexRecord(CXzStream *p, UInt64 unpackSize, UInt64 totalSize, ISzAlloc *alloc) -{ - if (!p->blocks || p->numBlocksAllocated == p->numBlocks) - { - size_t num = p->numBlocks * 2 + 1; - size_t newSize = sizeof(CXzBlockSizes) * num; - CXzBlockSizes *blocks; - if (newSize / sizeof(CXzBlockSizes) != num) - return SZ_ERROR_MEM; - blocks = (CXzBlockSizes *)alloc->Alloc(alloc, newSize); - if (!blocks) - return SZ_ERROR_MEM; - if (p->numBlocks != 0) - { - memcpy(blocks, p->blocks, p->numBlocks * sizeof(CXzBlockSizes)); - alloc->Free(alloc, p->blocks); - } - p->blocks = blocks; - p->numBlocksAllocated = num; - } - { - CXzBlockSizes *block = &p->blocks[p->numBlocks++]; - block->unpackSize = unpackSize; - block->totalSize = totalSize; - } - return SZ_OK; -} - - -/* ---------- CSeqCheckInStream ---------- */ - -typedef struct -{ - ISeqInStream p; - ISeqInStream *realStream; - UInt64 processed; - CXzCheck check; -} CSeqCheckInStream; - -static void SeqCheckInStream_Init(CSeqCheckInStream *p, unsigned mode) -{ - p->processed = 0; - XzCheck_Init(&p->check, mode); -} - -static void SeqCheckInStream_GetDigest(CSeqCheckInStream *p, Byte *digest) -{ - XzCheck_Final(&p->check, digest); -} - -static SRes SeqCheckInStream_Read(void *pp, void *data, size_t *size) -{ - CSeqCheckInStream *p = (CSeqCheckInStream *)pp; - SRes res = p->realStream->Read(p->realStream, data, size); - XzCheck_Update(&p->check, data, *size); - p->processed += *size; - return res; -} - - -/* ---------- CSeqSizeOutStream ---------- */ - -typedef struct -{ - ISeqOutStream p; - ISeqOutStream *realStream; - UInt64 processed; -} CSeqSizeOutStream; - -static size_t MyWrite(void *pp, const void *data, size_t size) -{ - CSeqSizeOutStream *p = (CSeqSizeOutStream *)pp; - size = p->realStream->Write(p->realStream, data, size); - p->processed += size; - return size; -} - - -/* ---------- CSeqInFilter ---------- */ - -#define FILTER_BUF_SIZE (1 << 20) - -typedef struct -{ - ISeqInStream p; - ISeqInStream *realStream; - IStateCoder StateCoder; - Byte *buf; - size_t curPos; - size_t endPos; - int srcWasFinished; -} CSeqInFilter; - -static SRes SeqInFilter_Read(void *pp, void *data, size_t *size) -{ - CSeqInFilter *p = (CSeqInFilter *)pp; - size_t sizeOriginal = *size; - if (sizeOriginal == 0) - return SZ_OK; - *size = 0; - - for (;;) - { - if (!p->srcWasFinished && p->curPos == p->endPos) - { - p->curPos = 0; - p->endPos = FILTER_BUF_SIZE; - RINOK(p->realStream->Read(p->realStream, p->buf, &p->endPos)); - if (p->endPos == 0) - p->srcWasFinished = 1; - } - { - SizeT srcLen = p->endPos - p->curPos; - int wasFinished; - SRes res; - *size = sizeOriginal; - res = p->StateCoder.Code(p->StateCoder.p, data, size, p->buf + p->curPos, &srcLen, - p->srcWasFinished, CODER_FINISH_ANY, &wasFinished); - p->curPos += srcLen; - if (*size != 0 || srcLen == 0 || res != 0) - return res; - } - } -} - -static void SeqInFilter_Construct(CSeqInFilter *p) -{ - p->buf = NULL; - p->p.Read = SeqInFilter_Read; -} - -static void SeqInFilter_Free(CSeqInFilter *p) -{ - if (p->buf) - { - g_Alloc.Free(&g_Alloc, p->buf); - p->buf = NULL; - } -} - -SRes BraState_SetFromMethod(IStateCoder *p, UInt64 id, int encodeMode, ISzAlloc *alloc); - -static SRes SeqInFilter_Init(CSeqInFilter *p, const CXzFilter *props) -{ - if (!p->buf) - { - p->buf = g_Alloc.Alloc(&g_Alloc, FILTER_BUF_SIZE); - if (!p->buf) - return SZ_ERROR_MEM; - } - p->curPos = p->endPos = 0; - p->srcWasFinished = 0; - RINOK(BraState_SetFromMethod(&p->StateCoder, props->id, 1, &g_Alloc)); - RINOK(p->StateCoder.SetProps(p->StateCoder.p, props->props, props->propsSize, &g_Alloc)); - p->StateCoder.Init(p->StateCoder.p); - return SZ_OK; -} - - -/* ---------- CSbEncInStream ---------- */ - -#ifdef USE_SUBBLOCK - -typedef struct -{ - ISeqInStream p; - ISeqInStream *inStream; - CSbEnc enc; -} CSbEncInStream; - -static SRes SbEncInStream_Read(void *pp, void *data, size_t *size) -{ - CSbEncInStream *p = (CSbEncInStream *)pp; - size_t sizeOriginal = *size; - if (sizeOriginal == 0) - return S_OK; - - for (;;) - { - if (p->enc.needRead && !p->enc.readWasFinished) - { - size_t processed = p->enc.needReadSizeMax; - RINOK(p->inStream->Read(p->inStream, p->enc.buf + p->enc.readPos, &processed)); - p->enc.readPos += processed; - if (processed == 0) - { - p->enc.readWasFinished = True; - p->enc.isFinalFinished = True; - } - p->enc.needRead = False; - } - - *size = sizeOriginal; - RINOK(SbEnc_Read(&p->enc, data, size)); - if (*size != 0 || !p->enc.needRead) - return S_OK; - } -} - -void SbEncInStream_Construct(CSbEncInStream *p, ISzAlloc *alloc) -{ - SbEnc_Construct(&p->enc, alloc); - p->p.Read = SbEncInStream_Read; -} - -SRes SbEncInStream_Init(CSbEncInStream *p) -{ - return SbEnc_Init(&p->enc); -} - -void SbEncInStream_Free(CSbEncInStream *p) -{ - SbEnc_Free(&p->enc); -} - -#endif - - -typedef struct -{ - CLzma2EncHandle lzma2; - #ifdef USE_SUBBLOCK - CSbEncInStream sb; - #endif - CSeqInFilter filter; - ISzAlloc *alloc; - ISzAlloc *bigAlloc; -} CLzma2WithFilters; - - -static void Lzma2WithFilters_Construct(CLzma2WithFilters *p, ISzAlloc *alloc, ISzAlloc *bigAlloc) -{ - p->alloc = alloc; - p->bigAlloc = bigAlloc; - p->lzma2 = NULL; - #ifdef USE_SUBBLOCK - SbEncInStream_Construct(&p->sb, alloc); - #endif - SeqInFilter_Construct(&p->filter); -} - -static SRes Lzma2WithFilters_Create(CLzma2WithFilters *p) -{ - p->lzma2 = Lzma2Enc_Create(p->alloc, p->bigAlloc); - if (!p->lzma2) - return SZ_ERROR_MEM; - return SZ_OK; -} - -static void Lzma2WithFilters_Free(CLzma2WithFilters *p) -{ - SeqInFilter_Free(&p->filter); - #ifdef USE_SUBBLOCK - SbEncInStream_Free(&p->sb); - #endif - if (p->lzma2) - { - Lzma2Enc_Destroy(p->lzma2); - p->lzma2 = NULL; - } -} - - -void XzProps_Init(CXzProps *p) -{ - p->lzma2Props = NULL; - p->filterProps = NULL; - p->checkId = XZ_CHECK_CRC32; -} - -void XzFilterProps_Init(CXzFilterProps *p) -{ - p->id = 0; - p->delta = 0; - p->ip = 0; - p->ipDefined = False; -} - - -static SRes Xz_Compress(CXzStream *xz, CLzma2WithFilters *lzmaf, - ISeqOutStream *outStream, ISeqInStream *inStream, - const CXzProps *props, ICompressProgress *progress) -{ - xz->flags = (Byte)props->checkId; - - RINOK(Lzma2Enc_SetProps(lzmaf->lzma2, props->lzma2Props)); - RINOK(Xz_WriteHeader(xz->flags, outStream)); - - { - CSeqCheckInStream checkInStream; - CSeqSizeOutStream seqSizeOutStream; - CXzBlock block; - unsigned filterIndex = 0; - CXzFilter *filter = NULL; - const CXzFilterProps *fp = props->filterProps; - - XzBlock_ClearFlags(&block); - XzBlock_SetNumFilters(&block, 1 + (fp ? 1 : 0)); - - if (fp) - { - filter = &block.filters[filterIndex++]; - filter->id = fp->id; - filter->propsSize = 0; - - if (fp->id == XZ_ID_Delta) - { - filter->props[0] = (Byte)(fp->delta - 1); - filter->propsSize = 1; - } - else if (fp->ipDefined) - { - SetUi32(filter->props, fp->ip); - filter->propsSize = 4; - } - } - - { - CXzFilter *f = &block.filters[filterIndex++]; - f->id = XZ_ID_LZMA2; - f->propsSize = 1; - f->props[0] = Lzma2Enc_WriteProperties(lzmaf->lzma2); - } - - seqSizeOutStream.p.Write = MyWrite; - seqSizeOutStream.realStream = outStream; - seqSizeOutStream.processed = 0; - - RINOK(XzBlock_WriteHeader(&block, &seqSizeOutStream.p)); - - checkInStream.p.Read = SeqCheckInStream_Read; - checkInStream.realStream = inStream; - SeqCheckInStream_Init(&checkInStream, XzFlags_GetCheckType(xz->flags)); - - if (fp) - { - #ifdef USE_SUBBLOCK - if (fp->id == XZ_ID_Subblock) - { - lzmaf->sb.inStream = &checkInStream.p; - RINOK(SbEncInStream_Init(&lzmaf->sb)); - } - else - #endif - { - lzmaf->filter.realStream = &checkInStream.p; - RINOK(SeqInFilter_Init(&lzmaf->filter, filter)); - } - } - - { - UInt64 packPos = seqSizeOutStream.processed; - - SRes res = Lzma2Enc_Encode(lzmaf->lzma2, &seqSizeOutStream.p, - fp ? - #ifdef USE_SUBBLOCK - (fp->id == XZ_ID_Subblock) ? &lzmaf->sb.p: - #endif - &lzmaf->filter.p: - &checkInStream.p, - progress); - - RINOK(res); - block.unpackSize = checkInStream.processed; - block.packSize = seqSizeOutStream.processed - packPos; - } - - { - unsigned padSize = 0; - Byte buf[128]; - while ((((unsigned)block.packSize + padSize) & 3) != 0) - buf[padSize++] = 0; - SeqCheckInStream_GetDigest(&checkInStream, buf + padSize); - RINOK(WriteBytes(&seqSizeOutStream.p, buf, padSize + XzFlags_GetCheckSize(xz->flags))); - RINOK(Xz_AddIndexRecord(xz, block.unpackSize, seqSizeOutStream.processed - padSize, &g_Alloc)); - } - } - return Xz_WriteFooter(xz, outStream); -} - - -SRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream, - const CXzProps *props, ICompressProgress *progress) -{ - SRes res; - CXzStream xz; - CLzma2WithFilters lzmaf; - Xz_Construct(&xz); - Lzma2WithFilters_Construct(&lzmaf, &g_Alloc, &g_BigAlloc); - res = Lzma2WithFilters_Create(&lzmaf); - if (res == SZ_OK) - res = Xz_Compress(&xz, &lzmaf, outStream, inStream, props, progress); - Lzma2WithFilters_Free(&lzmaf); - Xz_Free(&xz, &g_Alloc); - return res; -} - - -SRes Xz_EncodeEmpty(ISeqOutStream *outStream) -{ - SRes res; - CXzStream xz; - Xz_Construct(&xz); - res = Xz_WriteHeader(xz.flags, outStream); - if (res == SZ_OK) - res = Xz_WriteFooter(&xz, outStream); - Xz_Free(&xz, &g_Alloc); - return res; -} diff --git a/jan/src/dep/libs/lib7z/XzEnc.h b/jan/src/dep/libs/lib7z/XzEnc.h deleted file mode 100644 index e9cea34f7..000000000 --- a/jan/src/dep/libs/lib7z/XzEnc.h +++ /dev/null @@ -1,39 +0,0 @@ -/* XzEnc.h -- Xz Encode -2011-02-07 : Igor Pavlov : Public domain */ - -#ifndef __XZ_ENC_H -#define __XZ_ENC_H - -#include "Lzma2Enc.h" - -#include "Xz.h" - -EXTERN_C_BEGIN - -typedef struct -{ - UInt32 id; - UInt32 delta; - UInt32 ip; - int ipDefined; -} CXzFilterProps; - -void XzFilterProps_Init(CXzFilterProps *p); - -typedef struct -{ - const CLzma2EncProps *lzma2Props; - const CXzFilterProps *filterProps; - unsigned checkId; -} CXzProps; - -void XzProps_Init(CXzProps *p); - -SRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream, - const CXzProps *props, ICompressProgress *progress); - -SRes Xz_EncodeEmpty(ISeqOutStream *outStream); - -EXTERN_C_END - -#endif diff --git a/jan/src/dep/libs/lib7z/XzIn.c b/jan/src/dep/libs/lib7z/XzIn.c deleted file mode 100644 index aaa059730..000000000 --- a/jan/src/dep/libs/lib7z/XzIn.c +++ /dev/null @@ -1,313 +0,0 @@ -/* XzIn.c - Xz input -2015-11-08 : Igor Pavlov : Public domain */ - -#include "Precomp.h" - -#include - -#include "7zCrc.h" -#include "CpuArch.h" -#include "Xz.h" - -SRes Xz_ReadHeader(CXzStreamFlags *p, ISeqInStream *inStream) -{ - Byte sig[XZ_STREAM_HEADER_SIZE]; - RINOK(SeqInStream_Read2(inStream, sig, XZ_STREAM_HEADER_SIZE, SZ_ERROR_NO_ARCHIVE)); - if (memcmp(sig, XZ_SIG, XZ_SIG_SIZE) != 0) - return SZ_ERROR_NO_ARCHIVE; - return Xz_ParseHeader(p, sig); -} - -#define READ_VARINT_AND_CHECK(buf, pos, size, res) \ - { unsigned s = Xz_ReadVarInt(buf + pos, size - pos, res); \ - if (s == 0) return SZ_ERROR_ARCHIVE; pos += s; } - -SRes XzBlock_ReadHeader(CXzBlock *p, ISeqInStream *inStream, Bool *isIndex, UInt32 *headerSizeRes) -{ - Byte header[XZ_BLOCK_HEADER_SIZE_MAX]; - unsigned headerSize; - *headerSizeRes = 0; - RINOK(SeqInStream_ReadByte(inStream, &header[0])); - headerSize = ((unsigned)header[0] << 2) + 4; - if (headerSize == 0) - { - *headerSizeRes = 1; - *isIndex = True; - return SZ_OK; - } - - *isIndex = False; - *headerSizeRes = headerSize; - RINOK(SeqInStream_Read(inStream, header + 1, headerSize - 1)); - return XzBlock_Parse(p, header); -} - -#define ADD_SIZE_CHECH(size, val) \ - { UInt64 newSize = size + (val); if (newSize < size) return XZ_SIZE_OVERFLOW; size = newSize; } - -UInt64 Xz_GetUnpackSize(const CXzStream *p) -{ - UInt64 size = 0; - size_t i; - for (i = 0; i < p->numBlocks; i++) - ADD_SIZE_CHECH(size, p->blocks[i].unpackSize); - return size; -} - -UInt64 Xz_GetPackSize(const CXzStream *p) -{ - UInt64 size = 0; - size_t i; - for (i = 0; i < p->numBlocks; i++) - ADD_SIZE_CHECH(size, (p->blocks[i].totalSize + 3) & ~(UInt64)3); - return size; -} - -/* -SRes XzBlock_ReadFooter(CXzBlock *p, CXzStreamFlags f, ISeqInStream *inStream) -{ - return SeqInStream_Read(inStream, p->check, XzFlags_GetCheckSize(f)); -} -*/ - -static SRes Xz_ReadIndex2(CXzStream *p, const Byte *buf, size_t size, ISzAlloc *alloc) -{ - size_t numBlocks, pos = 1; - UInt32 crc; - - if (size < 5 || buf[0] != 0) - return SZ_ERROR_ARCHIVE; - - size -= 4; - crc = CrcCalc(buf, size); - if (crc != GetUi32(buf + size)) - return SZ_ERROR_ARCHIVE; - - { - UInt64 numBlocks64; - READ_VARINT_AND_CHECK(buf, pos, size, &numBlocks64); - numBlocks = (size_t)numBlocks64; - if (numBlocks != numBlocks64 || numBlocks * 2 > size) - return SZ_ERROR_ARCHIVE; - } - - Xz_Free(p, alloc); - if (numBlocks != 0) - { - size_t i; - p->numBlocks = numBlocks; - p->numBlocksAllocated = numBlocks; - p->blocks = alloc->Alloc(alloc, sizeof(CXzBlockSizes) * numBlocks); - if (p->blocks == 0) - return SZ_ERROR_MEM; - for (i = 0; i < numBlocks; i++) - { - CXzBlockSizes *block = &p->blocks[i]; - READ_VARINT_AND_CHECK(buf, pos, size, &block->totalSize); - READ_VARINT_AND_CHECK(buf, pos, size, &block->unpackSize); - if (block->totalSize == 0) - return SZ_ERROR_ARCHIVE; - } - } - while ((pos & 3) != 0) - if (buf[pos++] != 0) - return SZ_ERROR_ARCHIVE; - return (pos == size) ? SZ_OK : SZ_ERROR_ARCHIVE; -} - -static SRes Xz_ReadIndex(CXzStream *p, ILookInStream *stream, UInt64 indexSize, ISzAlloc *alloc) -{ - SRes res; - size_t size; - Byte *buf; - if (indexSize > ((UInt32)1 << 31)) - return SZ_ERROR_UNSUPPORTED; - size = (size_t)indexSize; - if (size != indexSize) - return SZ_ERROR_UNSUPPORTED; - buf = alloc->Alloc(alloc, size); - if (buf == 0) - return SZ_ERROR_MEM; - res = LookInStream_Read2(stream, buf, size, SZ_ERROR_UNSUPPORTED); - if (res == SZ_OK) - res = Xz_ReadIndex2(p, buf, size, alloc); - alloc->Free(alloc, buf); - return res; -} - -static SRes LookInStream_SeekRead_ForArc(ILookInStream *stream, UInt64 offset, void *buf, size_t size) -{ - RINOK(LookInStream_SeekTo(stream, offset)); - return LookInStream_Read(stream, buf, size); - /* return LookInStream_Read2(stream, buf, size, SZ_ERROR_NO_ARCHIVE); */ -} - -static SRes Xz_ReadBackward(CXzStream *p, ILookInStream *stream, Int64 *startOffset, ISzAlloc *alloc) -{ - UInt64 indexSize; - Byte buf[XZ_STREAM_FOOTER_SIZE]; - UInt64 pos = *startOffset; - - if ((pos & 3) != 0 || pos < XZ_STREAM_FOOTER_SIZE) - return SZ_ERROR_NO_ARCHIVE; - - pos -= XZ_STREAM_FOOTER_SIZE; - RINOK(LookInStream_SeekRead_ForArc(stream, pos, buf, XZ_STREAM_FOOTER_SIZE)); - - if (memcmp(buf + 10, XZ_FOOTER_SIG, XZ_FOOTER_SIG_SIZE) != 0) - { - UInt32 total = 0; - pos += XZ_STREAM_FOOTER_SIZE; - - for (;;) - { - size_t i; - #define TEMP_BUF_SIZE (1 << 10) - Byte temp[TEMP_BUF_SIZE]; - - i = (pos > TEMP_BUF_SIZE) ? TEMP_BUF_SIZE : (size_t)pos; - pos -= i; - RINOK(LookInStream_SeekRead_ForArc(stream, pos, temp, i)); - total += (UInt32)i; - for (; i != 0; i--) - if (temp[i - 1] != 0) - break; - if (i != 0) - { - if ((i & 3) != 0) - return SZ_ERROR_NO_ARCHIVE; - pos += i; - break; - } - if (pos < XZ_STREAM_FOOTER_SIZE || total > (1 << 16)) - return SZ_ERROR_NO_ARCHIVE; - } - - if (pos < XZ_STREAM_FOOTER_SIZE) - return SZ_ERROR_NO_ARCHIVE; - pos -= XZ_STREAM_FOOTER_SIZE; - RINOK(LookInStream_SeekRead_ForArc(stream, pos, buf, XZ_STREAM_FOOTER_SIZE)); - if (memcmp(buf + 10, XZ_FOOTER_SIG, XZ_FOOTER_SIG_SIZE) != 0) - return SZ_ERROR_NO_ARCHIVE; - } - - p->flags = (CXzStreamFlags)GetBe16(buf + 8); - - if (!XzFlags_IsSupported(p->flags)) - return SZ_ERROR_UNSUPPORTED; - - if (GetUi32(buf) != CrcCalc(buf + 4, 6)) - return SZ_ERROR_ARCHIVE; - - indexSize = ((UInt64)GetUi32(buf + 4) + 1) << 2; - - if (pos < indexSize) - return SZ_ERROR_ARCHIVE; - - pos -= indexSize; - RINOK(LookInStream_SeekTo(stream, pos)); - RINOK(Xz_ReadIndex(p, stream, indexSize, alloc)); - - { - UInt64 totalSize = Xz_GetPackSize(p); - if (totalSize == XZ_SIZE_OVERFLOW - || totalSize >= ((UInt64)1 << 63) - || pos < totalSize + XZ_STREAM_HEADER_SIZE) - return SZ_ERROR_ARCHIVE; - pos -= (totalSize + XZ_STREAM_HEADER_SIZE); - RINOK(LookInStream_SeekTo(stream, pos)); - *startOffset = pos; - } - { - CXzStreamFlags headerFlags; - CSecToRead secToRead; - SecToRead_CreateVTable(&secToRead); - secToRead.realStream = stream; - - RINOK(Xz_ReadHeader(&headerFlags, &secToRead.s)); - return (p->flags == headerFlags) ? SZ_OK : SZ_ERROR_ARCHIVE; - } -} - - -/* ---------- Xz Streams ---------- */ - -void Xzs_Construct(CXzs *p) -{ - p->num = p->numAllocated = 0; - p->streams = 0; -} - -void Xzs_Free(CXzs *p, ISzAlloc *alloc) -{ - size_t i; - for (i = 0; i < p->num; i++) - Xz_Free(&p->streams[i], alloc); - alloc->Free(alloc, p->streams); - p->num = p->numAllocated = 0; - p->streams = 0; -} - -UInt64 Xzs_GetNumBlocks(const CXzs *p) -{ - UInt64 num = 0; - size_t i; - for (i = 0; i < p->num; i++) - num += p->streams[i].numBlocks; - return num; -} - -UInt64 Xzs_GetUnpackSize(const CXzs *p) -{ - UInt64 size = 0; - size_t i; - for (i = 0; i < p->num; i++) - ADD_SIZE_CHECH(size, Xz_GetUnpackSize(&p->streams[i])); - return size; -} - -/* -UInt64 Xzs_GetPackSize(const CXzs *p) -{ - UInt64 size = 0; - size_t i; - for (i = 0; i < p->num; i++) - ADD_SIZE_CHECH(size, Xz_GetTotalSize(&p->streams[i])); - return size; -} -*/ - -SRes Xzs_ReadBackward(CXzs *p, ILookInStream *stream, Int64 *startOffset, ICompressProgress *progress, ISzAlloc *alloc) -{ - Int64 endOffset = 0; - RINOK(stream->Seek(stream, &endOffset, SZ_SEEK_END)); - *startOffset = endOffset; - for (;;) - { - CXzStream st; - SRes res; - Xz_Construct(&st); - res = Xz_ReadBackward(&st, stream, startOffset, alloc); - st.startOffset = *startOffset; - RINOK(res); - if (p->num == p->numAllocated) - { - size_t newNum = p->num + p->num / 4 + 1; - Byte *data = (Byte *)alloc->Alloc(alloc, newNum * sizeof(CXzStream)); - if (data == 0) - return SZ_ERROR_MEM; - p->numAllocated = newNum; - if (p->num != 0) - memcpy(data, p->streams, p->num * sizeof(CXzStream)); - alloc->Free(alloc, p->streams); - p->streams = (CXzStream *)data; - } - p->streams[p->num++] = st; - if (*startOffset == 0) - break; - RINOK(LookInStream_SeekTo(stream, *startOffset)); - if (progress && progress->Progress(progress, endOffset - *startOffset, (UInt64)(Int64)-1) != SZ_OK) - return SZ_ERROR_PROGRESS; - } - return SZ_OK; -} diff --git a/jan/src/dep/libs/lib7z/_fba_lzmasdk_v16.04.txt b/jan/src/dep/libs/lib7z/_fba_lzmasdk_v16.04.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/jan/src/dep/libs/libpng/_fba_libpng_v1628.txt b/jan/src/dep/libs/libpng/_fba_libpng_v1628.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/jan/src/dep/libs/libpng/png.c b/jan/src/dep/libs/libpng/png.c deleted file mode 100644 index fe39e3bff..000000000 --- a/jan/src/dep/libs/libpng/png.c +++ /dev/null @@ -1,4534 +0,0 @@ - -/* png.c - location for general purpose libpng functions - * - * Last changed in libpng 1.6.28 [January 5, 2017] - * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -#include "pngpriv.h" - -/* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_28 Your_png_h_is_not_version_1_6_28; - -/* Tells libpng that we have already handled the first "num_bytes" bytes - * of the PNG file signature. If the PNG data is embedded into another - * stream we can set num_bytes = 8 so that libpng will not attempt to read - * or write any of the magic bytes before it starts on the IHDR. - */ - -#ifdef PNG_READ_SUPPORTED -void PNGAPI -png_set_sig_bytes(png_structrp png_ptr, int num_bytes) -{ - unsigned int nb = (unsigned int)num_bytes; - - png_debug(1, "in png_set_sig_bytes"); - - if (png_ptr == NULL) - return; - - if (num_bytes < 0) - nb = 0; - - if (nb > 8) - png_error(png_ptr, "Too many bytes for PNG signature"); - - png_ptr->sig_bytes = (png_byte)nb; -} - -/* Checks whether the supplied bytes match the PNG signature. We allow - * checking less than the full 8-byte signature so that those apps that - * already read the first few bytes of a file to determine the file type - * can simply check the remaining bytes for extra assurance. Returns - * an integer less than, equal to, or greater than zero if sig is found, - * respectively, to be less than, to match, or be greater than the correct - * PNG signature (this is the same behavior as strcmp, memcmp, etc). - */ -int PNGAPI -png_sig_cmp(png_const_bytep sig, png_size_t start, png_size_t num_to_check) -{ - png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; - - if (num_to_check > 8) - num_to_check = 8; - - else if (num_to_check < 1) - return (-1); - - if (start > 7) - return (-1); - - if (start + num_to_check > 8) - num_to_check = 8 - start; - - return ((int)(memcmp(&sig[start], &png_signature[start], num_to_check))); -} - -#endif /* READ */ - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -/* Function to allocate memory for zlib */ -PNG_FUNCTION(voidpf /* PRIVATE */, -png_zalloc,(voidpf png_ptr, uInt items, uInt size),PNG_ALLOCATED) -{ - png_alloc_size_t num_bytes = size; - - if (png_ptr == NULL) - return NULL; - - if (items >= (~(png_alloc_size_t)0)/size) - { - png_warning (png_voidcast(png_structrp, png_ptr), - "Potential overflow in png_zalloc()"); - return NULL; - } - - num_bytes *= items; - return png_malloc_warn(png_voidcast(png_structrp, png_ptr), num_bytes); -} - -/* Function to free memory for zlib */ -void /* PRIVATE */ -png_zfree(voidpf png_ptr, voidpf ptr) -{ - png_free(png_voidcast(png_const_structrp,png_ptr), ptr); -} - -/* Reset the CRC variable to 32 bits of 1's. Care must be taken - * in case CRC is > 32 bits to leave the top bits 0. - */ -void /* PRIVATE */ -png_reset_crc(png_structrp png_ptr) -{ - /* The cast is safe because the crc is a 32-bit value. */ - png_ptr->crc = (png_uint_32)crc32(0, Z_NULL, 0); -} - -/* Calculate the CRC over a section of data. We can only pass as - * much data to this routine as the largest single buffer size. We - * also check that this data will actually be used before going to the - * trouble of calculating it. - */ -void /* PRIVATE */ -png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length) -{ - int need_crc = 1; - - if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name) != 0) - { - if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) == - (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN)) - need_crc = 0; - } - - else /* critical */ - { - if ((png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) != 0) - need_crc = 0; - } - - /* 'uLong' is defined in zlib.h as unsigned long; this means that on some - * systems it is a 64-bit value. crc32, however, returns 32 bits so the - * following cast is safe. 'uInt' may be no more than 16 bits, so it is - * necessary to perform a loop here. - */ - if (need_crc != 0 && length > 0) - { - uLong crc = png_ptr->crc; /* Should never issue a warning */ - - do - { - uInt safe_length = (uInt)length; -#ifndef __COVERITY__ - if (safe_length == 0) - safe_length = (uInt)-1; /* evil, but safe */ -#endif - - crc = crc32(crc, ptr, safe_length); - - /* The following should never issue compiler warnings; if they do the - * target system has characteristics that will probably violate other - * assumptions within the libpng code. - */ - ptr += safe_length; - length -= safe_length; - } - while (length > 0); - - /* And the following is always safe because the crc is only 32 bits. */ - png_ptr->crc = (png_uint_32)crc; - } -} - -/* Check a user supplied version number, called from both read and write - * functions that create a png_struct. - */ -int -png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver) -{ - /* Libpng versions 1.0.0 and later are binary compatible if the version - * string matches through the second '.'; we must recompile any - * applications that use any older library version. - */ - - if (user_png_ver != NULL) - { - int i = -1; - int found_dots = 0; - - do - { - i++; - if (user_png_ver[i] != PNG_LIBPNG_VER_STRING[i]) - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - if (user_png_ver[i] == '.') - found_dots++; - } while (found_dots < 2 && user_png_ver[i] != 0 && - PNG_LIBPNG_VER_STRING[i] != 0); - } - - else - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - - if ((png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) != 0) - { -#ifdef PNG_WARNINGS_SUPPORTED - size_t pos = 0; - char m[128]; - - pos = png_safecat(m, (sizeof m), pos, - "Application built with libpng-"); - pos = png_safecat(m, (sizeof m), pos, user_png_ver); - pos = png_safecat(m, (sizeof m), pos, " but running with "); - pos = png_safecat(m, (sizeof m), pos, PNG_LIBPNG_VER_STRING); - PNG_UNUSED(pos) - - png_warning(png_ptr, m); -#endif - -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags = 0; -#endif - - return 0; - } - - /* Success return. */ - return 1; -} - -/* Generic function to create a png_struct for either read or write - this - * contains the common initialization. - */ -PNG_FUNCTION(png_structp /* PRIVATE */, -png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED) -{ - png_struct create_struct; -# ifdef PNG_SETJMP_SUPPORTED - jmp_buf create_jmp_buf; -# endif - - /* This temporary stack-allocated structure is used to provide a place to - * build enough context to allow the user provided memory allocator (if any) - * to be called. - */ - memset(&create_struct, 0, (sizeof create_struct)); - - /* Added at libpng-1.2.6 */ -# ifdef PNG_USER_LIMITS_SUPPORTED - create_struct.user_width_max = PNG_USER_WIDTH_MAX; - create_struct.user_height_max = PNG_USER_HEIGHT_MAX; - -# ifdef PNG_USER_CHUNK_CACHE_MAX - /* Added at libpng-1.2.43 and 1.4.0 */ - create_struct.user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX; -# endif - -# ifdef PNG_USER_CHUNK_MALLOC_MAX - /* Added at libpng-1.2.43 and 1.4.1, required only for read but exists - * in png_struct regardless. - */ - create_struct.user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX; -# endif -# endif - - /* The following two API calls simply set fields in png_struct, so it is safe - * to do them now even though error handling is not yet set up. - */ -# ifdef PNG_USER_MEM_SUPPORTED - png_set_mem_fn(&create_struct, mem_ptr, malloc_fn, free_fn); -# else - PNG_UNUSED(mem_ptr) - PNG_UNUSED(malloc_fn) - PNG_UNUSED(free_fn) -# endif - - /* (*error_fn) can return control to the caller after the error_ptr is set, - * this will result in a memory leak unless the error_fn does something - * extremely sophisticated. The design lacks merit but is implicit in the - * API. - */ - png_set_error_fn(&create_struct, error_ptr, error_fn, warn_fn); - -# ifdef PNG_SETJMP_SUPPORTED - if (!setjmp(create_jmp_buf)) -# endif - { -# ifdef PNG_SETJMP_SUPPORTED - /* Temporarily fake out the longjmp information until we have - * successfully completed this function. This only works if we have - * setjmp() support compiled in, but it is safe - this stuff should - * never happen. - */ - create_struct.jmp_buf_ptr = &create_jmp_buf; - create_struct.jmp_buf_size = 0; /*stack allocation*/ - create_struct.longjmp_fn = longjmp; -# endif - /* Call the general version checker (shared with read and write code): - */ - if (png_user_version_check(&create_struct, user_png_ver) != 0) - { - png_structrp png_ptr = png_voidcast(png_structrp, - png_malloc_warn(&create_struct, (sizeof *png_ptr))); - - if (png_ptr != NULL) - { - /* png_ptr->zstream holds a back-pointer to the png_struct, so - * this can only be done now: - */ - create_struct.zstream.zalloc = png_zalloc; - create_struct.zstream.zfree = png_zfree; - create_struct.zstream.opaque = png_ptr; - -# ifdef PNG_SETJMP_SUPPORTED - /* Eliminate the local error handling: */ - create_struct.jmp_buf_ptr = NULL; - create_struct.jmp_buf_size = 0; - create_struct.longjmp_fn = 0; -# endif - - *png_ptr = create_struct; - - /* This is the successful return point */ - return png_ptr; - } - } - } - - /* A longjmp because of a bug in the application storage allocator or a - * simple failure to allocate the png_struct. - */ - return NULL; -} - -/* Allocate the memory for an info_struct for the application. */ -PNG_FUNCTION(png_infop,PNGAPI -png_create_info_struct,(png_const_structrp png_ptr),PNG_ALLOCATED) -{ - png_inforp info_ptr; - - png_debug(1, "in png_create_info_struct"); - - if (png_ptr == NULL) - return NULL; - - /* Use the internal API that does not (or at least should not) error out, so - * that this call always returns ok. The application typically sets up the - * error handling *after* creating the info_struct because this is the way it - * has always been done in 'example.c'. - */ - info_ptr = png_voidcast(png_inforp, png_malloc_base(png_ptr, - (sizeof *info_ptr))); - - if (info_ptr != NULL) - memset(info_ptr, 0, (sizeof *info_ptr)); - - return info_ptr; -} - -/* This function frees the memory associated with a single info struct. - * Normally, one would use either png_destroy_read_struct() or - * png_destroy_write_struct() to free an info struct, but this may be - * useful for some applications. From libpng 1.6.0 this function is also used - * internally to implement the png_info release part of the 'struct' destroy - * APIs. This ensures that all possible approaches free the same data (all of - * it). - */ -void PNGAPI -png_destroy_info_struct(png_const_structrp png_ptr, png_infopp info_ptr_ptr) -{ - png_inforp info_ptr = NULL; - - png_debug(1, "in png_destroy_info_struct"); - - if (png_ptr == NULL) - return; - - if (info_ptr_ptr != NULL) - info_ptr = *info_ptr_ptr; - - if (info_ptr != NULL) - { - /* Do this first in case of an error below; if the app implements its own - * memory management this can lead to png_free calling png_error, which - * will abort this routine and return control to the app error handler. - * An infinite loop may result if it then tries to free the same info - * ptr. - */ - *info_ptr_ptr = NULL; - - png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); - memset(info_ptr, 0, (sizeof *info_ptr)); - png_free(png_ptr, info_ptr); - } -} - -/* Initialize the info structure. This is now an internal function (0.89) - * and applications using it are urged to use png_create_info_struct() - * instead. Use deprecated in 1.6.0, internal use removed (used internally it - * is just a memset). - * - * NOTE: it is almost inconceivable that this API is used because it bypasses - * the user-memory mechanism and the user error handling/warning mechanisms in - * those cases where it does anything other than a memset. - */ -PNG_FUNCTION(void,PNGAPI -png_info_init_3,(png_infopp ptr_ptr, png_size_t png_info_struct_size), - PNG_DEPRECATED) -{ - png_inforp info_ptr = *ptr_ptr; - - png_debug(1, "in png_info_init_3"); - - if (info_ptr == NULL) - return; - - if ((sizeof (png_info)) > png_info_struct_size) - { - *ptr_ptr = NULL; - /* The following line is why this API should not be used: */ - free(info_ptr); - info_ptr = png_voidcast(png_inforp, png_malloc_base(NULL, - (sizeof *info_ptr))); - if (info_ptr == NULL) - return; - *ptr_ptr = info_ptr; - } - - /* Set everything to 0 */ - memset(info_ptr, 0, (sizeof *info_ptr)); -} - -/* The following API is not called internally */ -void PNGAPI -png_data_freer(png_const_structrp png_ptr, png_inforp info_ptr, - int freer, png_uint_32 mask) -{ - png_debug(1, "in png_data_freer"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (freer == PNG_DESTROY_WILL_FREE_DATA) - info_ptr->free_me |= mask; - - else if (freer == PNG_USER_WILL_FREE_DATA) - info_ptr->free_me &= ~mask; - - else - png_error(png_ptr, "Unknown freer parameter in png_data_freer"); -} - -void PNGAPI -png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, - int num) -{ - png_debug(1, "in png_free_data"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - -#ifdef PNG_TEXT_SUPPORTED - /* Free text item num or (if num == -1) all text items */ - if (info_ptr->text != NULL && - ((mask & PNG_FREE_TEXT) & info_ptr->free_me) != 0) - { - if (num != -1) - { - png_free(png_ptr, info_ptr->text[num].key); - info_ptr->text[num].key = NULL; - } - - else - { - int i; - - for (i = 0; i < info_ptr->num_text; i++) - png_free(png_ptr, info_ptr->text[i].key); - - png_free(png_ptr, info_ptr->text); - info_ptr->text = NULL; - info_ptr->num_text = 0; - info_ptr->max_text = 0; - } - } -#endif - -#ifdef PNG_tRNS_SUPPORTED - /* Free any tRNS entry */ - if (((mask & PNG_FREE_TRNS) & info_ptr->free_me) != 0) - { - info_ptr->valid &= ~PNG_INFO_tRNS; - png_free(png_ptr, info_ptr->trans_alpha); - info_ptr->trans_alpha = NULL; - info_ptr->num_trans = 0; - } -#endif - -#ifdef PNG_sCAL_SUPPORTED - /* Free any sCAL entry */ - if (((mask & PNG_FREE_SCAL) & info_ptr->free_me) != 0) - { - png_free(png_ptr, info_ptr->scal_s_width); - png_free(png_ptr, info_ptr->scal_s_height); - info_ptr->scal_s_width = NULL; - info_ptr->scal_s_height = NULL; - info_ptr->valid &= ~PNG_INFO_sCAL; - } -#endif - -#ifdef PNG_pCAL_SUPPORTED - /* Free any pCAL entry */ - if (((mask & PNG_FREE_PCAL) & info_ptr->free_me) != 0) - { - png_free(png_ptr, info_ptr->pcal_purpose); - png_free(png_ptr, info_ptr->pcal_units); - info_ptr->pcal_purpose = NULL; - info_ptr->pcal_units = NULL; - - if (info_ptr->pcal_params != NULL) - { - int i; - - for (i = 0; i < info_ptr->pcal_nparams; i++) - png_free(png_ptr, info_ptr->pcal_params[i]); - - png_free(png_ptr, info_ptr->pcal_params); - info_ptr->pcal_params = NULL; - } - info_ptr->valid &= ~PNG_INFO_pCAL; - } -#endif - -#ifdef PNG_iCCP_SUPPORTED - /* Free any profile entry */ - if (((mask & PNG_FREE_ICCP) & info_ptr->free_me) != 0) - { - png_free(png_ptr, info_ptr->iccp_name); - png_free(png_ptr, info_ptr->iccp_profile); - info_ptr->iccp_name = NULL; - info_ptr->iccp_profile = NULL; - info_ptr->valid &= ~PNG_INFO_iCCP; - } -#endif - -#ifdef PNG_sPLT_SUPPORTED - /* Free a given sPLT entry, or (if num == -1) all sPLT entries */ - if (info_ptr->splt_palettes != NULL && - ((mask & PNG_FREE_SPLT) & info_ptr->free_me) != 0) - { - if (num != -1) - { - png_free(png_ptr, info_ptr->splt_palettes[num].name); - png_free(png_ptr, info_ptr->splt_palettes[num].entries); - info_ptr->splt_palettes[num].name = NULL; - info_ptr->splt_palettes[num].entries = NULL; - } - - else - { - int i; - - for (i = 0; i < info_ptr->splt_palettes_num; i++) - { - png_free(png_ptr, info_ptr->splt_palettes[i].name); - png_free(png_ptr, info_ptr->splt_palettes[i].entries); - } - - png_free(png_ptr, info_ptr->splt_palettes); - info_ptr->splt_palettes = NULL; - info_ptr->splt_palettes_num = 0; - info_ptr->valid &= ~PNG_INFO_sPLT; - } - } -#endif - -#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED - if (info_ptr->unknown_chunks != NULL && - ((mask & PNG_FREE_UNKN) & info_ptr->free_me) != 0) - { - if (num != -1) - { - png_free(png_ptr, info_ptr->unknown_chunks[num].data); - info_ptr->unknown_chunks[num].data = NULL; - } - - else - { - int i; - - for (i = 0; i < info_ptr->unknown_chunks_num; i++) - png_free(png_ptr, info_ptr->unknown_chunks[i].data); - - png_free(png_ptr, info_ptr->unknown_chunks); - info_ptr->unknown_chunks = NULL; - info_ptr->unknown_chunks_num = 0; - } - } -#endif - -#ifdef PNG_hIST_SUPPORTED - /* Free any hIST entry */ - if (((mask & PNG_FREE_HIST) & info_ptr->free_me) != 0) - { - png_free(png_ptr, info_ptr->hist); - info_ptr->hist = NULL; - info_ptr->valid &= ~PNG_INFO_hIST; - } -#endif - - /* Free any PLTE entry that was internally allocated */ - if (((mask & PNG_FREE_PLTE) & info_ptr->free_me) != 0) - { - png_free(png_ptr, info_ptr->palette); - info_ptr->palette = NULL; - info_ptr->valid &= ~PNG_INFO_PLTE; - info_ptr->num_palette = 0; - } - -#ifdef PNG_INFO_IMAGE_SUPPORTED - /* Free any image bits attached to the info structure */ - if (((mask & PNG_FREE_ROWS) & info_ptr->free_me) != 0) - { - if (info_ptr->row_pointers != NULL) - { - png_uint_32 row; - for (row = 0; row < info_ptr->height; row++) - png_free(png_ptr, info_ptr->row_pointers[row]); - - png_free(png_ptr, info_ptr->row_pointers); - info_ptr->row_pointers = NULL; - } - info_ptr->valid &= ~PNG_INFO_IDAT; - } -#endif - - if (num != -1) - mask &= ~PNG_FREE_MUL; - - info_ptr->free_me &= ~mask; -} -#endif /* READ || WRITE */ - -/* This function returns a pointer to the io_ptr associated with the user - * functions. The application should free any memory associated with this - * pointer before png_write_destroy() or png_read_destroy() are called. - */ -png_voidp PNGAPI -png_get_io_ptr(png_const_structrp png_ptr) -{ - if (png_ptr == NULL) - return (NULL); - - return (png_ptr->io_ptr); -} - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -# ifdef PNG_STDIO_SUPPORTED -/* Initialize the default input/output functions for the PNG file. If you - * use your own read or write routines, you can call either png_set_read_fn() - * or png_set_write_fn() instead of png_init_io(). If you have defined - * PNG_NO_STDIO or otherwise disabled PNG_STDIO_SUPPORTED, you must use a - * function of your own because "FILE *" isn't necessarily available. - */ -void PNGAPI -png_init_io(png_structrp png_ptr, png_FILE_p fp) -{ - png_debug(1, "in png_init_io"); - - if (png_ptr == NULL) - return; - - png_ptr->io_ptr = (png_voidp)fp; -} -# endif - -# ifdef PNG_SAVE_INT_32_SUPPORTED -/* PNG signed integers are saved in 32-bit 2's complement format. ANSI C-90 - * defines a cast of a signed integer to an unsigned integer either to preserve - * the value, if it is positive, or to calculate: - * - * (UNSIGNED_MAX+1) + integer - * - * Where UNSIGNED_MAX is the appropriate maximum unsigned value, so when the - * negative integral value is added the result will be an unsigned value - * correspnding to the 2's complement representation. - */ -void PNGAPI -png_save_int_32(png_bytep buf, png_int_32 i) -{ - png_save_uint_32(buf, (png_uint_32)i); -} -# endif - -# ifdef PNG_TIME_RFC1123_SUPPORTED -/* Convert the supplied time into an RFC 1123 string suitable for use in - * a "Creation Time" or other text-based time string. - */ -int PNGAPI -png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime) -{ - static PNG_CONST char short_months[12][4] = - {"Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - - if (out == NULL) - return 0; - - if (ptime->year > 9999 /* RFC1123 limitation */ || - ptime->month == 0 || ptime->month > 12 || - ptime->day == 0 || ptime->day > 31 || - ptime->hour > 23 || ptime->minute > 59 || - ptime->second > 60) - return 0; - - { - size_t pos = 0; - char number_buf[5]; /* enough for a four-digit year */ - -# define APPEND_STRING(string) pos = png_safecat(out, 29, pos, (string)) -# define APPEND_NUMBER(format, value)\ - APPEND_STRING(PNG_FORMAT_NUMBER(number_buf, format, (value))) -# define APPEND(ch) if (pos < 28) out[pos++] = (ch) - - APPEND_NUMBER(PNG_NUMBER_FORMAT_u, (unsigned)ptime->day); - APPEND(' '); - APPEND_STRING(short_months[(ptime->month - 1)]); - APPEND(' '); - APPEND_NUMBER(PNG_NUMBER_FORMAT_u, ptime->year); - APPEND(' '); - APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->hour); - APPEND(':'); - APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->minute); - APPEND(':'); - APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->second); - APPEND_STRING(" +0000"); /* This reliably terminates the buffer */ - PNG_UNUSED (pos) - -# undef APPEND -# undef APPEND_NUMBER -# undef APPEND_STRING - } - - return 1; -} - -# if PNG_LIBPNG_VER < 10700 -/* To do: remove the following from libpng-1.7 */ -/* Original API that uses a private buffer in png_struct. - * Deprecated because it causes png_struct to carry a spurious temporary - * buffer (png_struct::time_buffer), better to have the caller pass this in. - */ -png_const_charp PNGAPI -png_convert_to_rfc1123(png_structrp png_ptr, png_const_timep ptime) -{ - if (png_ptr != NULL) - { - /* The only failure above if png_ptr != NULL is from an invalid ptime */ - if (png_convert_to_rfc1123_buffer(png_ptr->time_buffer, ptime) == 0) - png_warning(png_ptr, "Ignoring invalid time value"); - - else - return png_ptr->time_buffer; - } - - return NULL; -} -# endif /* LIBPNG_VER < 10700 */ -# endif /* TIME_RFC1123 */ - -#endif /* READ || WRITE */ - -png_const_charp PNGAPI -png_get_copyright(png_const_structrp png_ptr) -{ - PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */ -#ifdef PNG_STRING_COPYRIGHT - return PNG_STRING_COPYRIGHT -#else -# ifdef __STDC__ - return PNG_STRING_NEWLINE \ - "libpng version 1.6.28 - January 5, 2017" PNG_STRING_NEWLINE \ - "Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \ - PNG_STRING_NEWLINE \ - "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ - "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ - PNG_STRING_NEWLINE; -# else - return "libpng version 1.6.28 - January 5, 2017\ - Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\ - Copyright (c) 1996-1997 Andreas Dilger\ - Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; -# endif -#endif -} - -/* The following return the library version as a short string in the - * format 1.0.0 through 99.99.99zz. To get the version of *.h files - * used with your application, print out PNG_LIBPNG_VER_STRING, which - * is defined in png.h. - * Note: now there is no difference between png_get_libpng_ver() and - * png_get_header_ver(). Due to the version_nn_nn_nn typedef guard, - * it is guaranteed that png.c uses the correct version of png.h. - */ -png_const_charp PNGAPI -png_get_libpng_ver(png_const_structrp png_ptr) -{ - /* Version of *.c files used when building libpng */ - return png_get_header_ver(png_ptr); -} - -png_const_charp PNGAPI -png_get_header_ver(png_const_structrp png_ptr) -{ - /* Version of *.h files used when building libpng */ - PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */ - return PNG_LIBPNG_VER_STRING; -} - -png_const_charp PNGAPI -png_get_header_version(png_const_structrp png_ptr) -{ - /* Returns longer string containing both version and date */ - PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */ -#ifdef __STDC__ - return PNG_HEADER_VERSION_STRING -# ifndef PNG_READ_SUPPORTED - " (NO READ SUPPORT)" -# endif - PNG_STRING_NEWLINE; -#else - return PNG_HEADER_VERSION_STRING; -#endif -} - -#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED -/* NOTE: this routine is not used internally! */ -/* Build a grayscale palette. Palette is assumed to be 1 << bit_depth - * large of png_color. This lets grayscale images be treated as - * paletted. Most useful for gamma correction and simplification - * of code. This API is not used internally. - */ -void PNGAPI -png_build_grayscale_palette(int bit_depth, png_colorp palette) -{ - int num_palette; - int color_inc; - int i; - int v; - - png_debug(1, "in png_do_build_grayscale_palette"); - - if (palette == NULL) - return; - - switch (bit_depth) - { - case 1: - num_palette = 2; - color_inc = 0xff; - break; - - case 2: - num_palette = 4; - color_inc = 0x55; - break; - - case 4: - num_palette = 16; - color_inc = 0x11; - break; - - case 8: - num_palette = 256; - color_inc = 1; - break; - - default: - num_palette = 0; - color_inc = 0; - break; - } - - for (i = 0, v = 0; i < num_palette; i++, v += color_inc) - { - palette[i].red = (png_byte)(v & 0xff); - palette[i].green = (png_byte)(v & 0xff); - palette[i].blue = (png_byte)(v & 0xff); - } -} -#endif - -#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED -int PNGAPI -png_handle_as_unknown(png_const_structrp png_ptr, png_const_bytep chunk_name) -{ - /* Check chunk_name and return "keep" value if it's on the list, else 0 */ - png_const_bytep p, p_end; - - if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list == 0) - return PNG_HANDLE_CHUNK_AS_DEFAULT; - - p_end = png_ptr->chunk_list; - p = p_end + png_ptr->num_chunk_list*5; /* beyond end */ - - /* The code is the fifth byte after each four byte string. Historically this - * code was always searched from the end of the list, this is no longer - * necessary because the 'set' routine handles duplicate entries correcty. - */ - do /* num_chunk_list > 0, so at least one */ - { - p -= 5; - - if (memcmp(chunk_name, p, 4) == 0) - return p[4]; - } - while (p > p_end); - - /* This means that known chunks should be processed and unknown chunks should - * be handled according to the value of png_ptr->unknown_default; this can be - * confusing because, as a result, there are two levels of defaulting for - * unknown chunks. - */ - return PNG_HANDLE_CHUNK_AS_DEFAULT; -} - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\ - defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) -int /* PRIVATE */ -png_chunk_unknown_handling(png_const_structrp png_ptr, png_uint_32 chunk_name) -{ - png_byte chunk_string[5]; - - PNG_CSTRING_FROM_CHUNK(chunk_string, chunk_name); - return png_handle_as_unknown(png_ptr, chunk_string); -} -#endif /* READ_UNKNOWN_CHUNKS || HANDLE_AS_UNKNOWN */ -#endif /* SET_UNKNOWN_CHUNKS */ - -#ifdef PNG_READ_SUPPORTED -/* This function, added to libpng-1.0.6g, is untested. */ -int PNGAPI -png_reset_zstream(png_structrp png_ptr) -{ - if (png_ptr == NULL) - return Z_STREAM_ERROR; - - /* WARNING: this resets the window bits to the maximum! */ - return (inflateReset(&png_ptr->zstream)); -} -#endif /* READ */ - -/* This function was added to libpng-1.0.7 */ -png_uint_32 PNGAPI -png_access_version_number(void) -{ - /* Version of *.c files used when building libpng */ - return((png_uint_32)PNG_LIBPNG_VER); -} - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -/* Ensure that png_ptr->zstream.msg holds some appropriate error message string. - * If it doesn't 'ret' is used to set it to something appropriate, even in cases - * like Z_OK or Z_STREAM_END where the error code is apparently a success code. - */ -void /* PRIVATE */ -png_zstream_error(png_structrp png_ptr, int ret) -{ - /* Translate 'ret' into an appropriate error string, priority is given to the - * one in zstream if set. This always returns a string, even in cases like - * Z_OK or Z_STREAM_END where the error code is a success code. - */ - if (png_ptr->zstream.msg == NULL) switch (ret) - { - default: - case Z_OK: - png_ptr->zstream.msg = PNGZ_MSG_CAST("unexpected zlib return code"); - break; - - case Z_STREAM_END: - /* Normal exit */ - png_ptr->zstream.msg = PNGZ_MSG_CAST("unexpected end of LZ stream"); - break; - - case Z_NEED_DICT: - /* This means the deflate stream did not have a dictionary; this - * indicates a bogus PNG. - */ - png_ptr->zstream.msg = PNGZ_MSG_CAST("missing LZ dictionary"); - break; - - case Z_ERRNO: - /* gz APIs only: should not happen */ - png_ptr->zstream.msg = PNGZ_MSG_CAST("zlib IO error"); - break; - - case Z_STREAM_ERROR: - /* internal libpng error */ - png_ptr->zstream.msg = PNGZ_MSG_CAST("bad parameters to zlib"); - break; - - case Z_DATA_ERROR: - png_ptr->zstream.msg = PNGZ_MSG_CAST("damaged LZ stream"); - break; - - case Z_MEM_ERROR: - png_ptr->zstream.msg = PNGZ_MSG_CAST("insufficient memory"); - break; - - case Z_BUF_ERROR: - /* End of input or output; not a problem if the caller is doing - * incremental read or write. - */ - png_ptr->zstream.msg = PNGZ_MSG_CAST("truncated"); - break; - - case Z_VERSION_ERROR: - png_ptr->zstream.msg = PNGZ_MSG_CAST("unsupported zlib version"); - break; - - case PNG_UNEXPECTED_ZLIB_RETURN: - /* Compile errors here mean that zlib now uses the value co-opted in - * pngpriv.h for PNG_UNEXPECTED_ZLIB_RETURN; update the switch above - * and change pngpriv.h. Note that this message is "... return", - * whereas the default/Z_OK one is "... return code". - */ - png_ptr->zstream.msg = PNGZ_MSG_CAST("unexpected zlib return"); - break; - } -} - -/* png_convert_size: a PNGAPI but no longer in png.h, so deleted - * at libpng 1.5.5! - */ - -/* Added at libpng version 1.2.34 and 1.4.0 (moved from pngset.c) */ -#ifdef PNG_GAMMA_SUPPORTED /* always set if COLORSPACE */ -static int -png_colorspace_check_gamma(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_fixed_point gAMA, int from) - /* This is called to check a new gamma value against an existing one. The - * routine returns false if the new gamma value should not be written. - * - * 'from' says where the new gamma value comes from: - * - * 0: the new gamma value is the libpng estimate for an ICC profile - * 1: the new gamma value comes from a gAMA chunk - * 2: the new gamma value comes from an sRGB chunk - */ -{ - png_fixed_point gtest; - - if ((colorspace->flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 && - (png_muldiv(>est, colorspace->gamma, PNG_FP_1, gAMA) == 0 || - png_gamma_significant(gtest) != 0)) - { - /* Either this is an sRGB image, in which case the calculated gamma - * approximation should match, or this is an image with a profile and the - * value libpng calculates for the gamma of the profile does not match the - * value recorded in the file. The former, sRGB, case is an error, the - * latter is just a warning. - */ - if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0 || from == 2) - { - png_chunk_report(png_ptr, "gamma value does not match sRGB", - PNG_CHUNK_ERROR); - /* Do not overwrite an sRGB value */ - return from == 2; - } - - else /* sRGB tag not involved */ - { - png_chunk_report(png_ptr, "gamma value does not match libpng estimate", - PNG_CHUNK_WARNING); - return from == 1; - } - } - - return 1; -} - -void /* PRIVATE */ -png_colorspace_set_gamma(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_fixed_point gAMA) -{ - /* Changed in libpng-1.5.4 to limit the values to ensure overflow can't - * occur. Since the fixed point representation is asymetrical it is - * possible for 1/gamma to overflow the limit of 21474 and this means the - * gamma value must be at least 5/100000 and hence at most 20000.0. For - * safety the limits here are a little narrower. The values are 0.00016 to - * 6250.0, which are truly ridiculous gamma values (and will produce - * displays that are all black or all white.) - * - * In 1.6.0 this test replaces the ones in pngrutil.c, in the gAMA chunk - * handling code, which only required the value to be >0. - */ - png_const_charp errmsg; - - if (gAMA < 16 || gAMA > 625000000) - errmsg = "gamma value out of range"; - -# ifdef PNG_READ_gAMA_SUPPORTED - /* Allow the application to set the gamma value more than once */ - else if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 && - (colorspace->flags & PNG_COLORSPACE_FROM_gAMA) != 0) - errmsg = "duplicate"; -# endif - - /* Do nothing if the colorspace is already invalid */ - else if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0) - return; - - else - { - if (png_colorspace_check_gamma(png_ptr, colorspace, gAMA, - 1/*from gAMA*/) != 0) - { - /* Store this gamma value. */ - colorspace->gamma = gAMA; - colorspace->flags |= - (PNG_COLORSPACE_HAVE_GAMMA | PNG_COLORSPACE_FROM_gAMA); - } - - /* At present if the check_gamma test fails the gamma of the colorspace is - * not updated however the colorspace is not invalidated. This - * corresponds to the case where the existing gamma comes from an sRGB - * chunk or profile. An error message has already been output. - */ - return; - } - - /* Error exit - errmsg has been set. */ - colorspace->flags |= PNG_COLORSPACE_INVALID; - png_chunk_report(png_ptr, errmsg, PNG_CHUNK_WRITE_ERROR); -} - -void /* PRIVATE */ -png_colorspace_sync_info(png_const_structrp png_ptr, png_inforp info_ptr) -{ - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0) - { - /* Everything is invalid */ - info_ptr->valid &= ~(PNG_INFO_gAMA|PNG_INFO_cHRM|PNG_INFO_sRGB| - PNG_INFO_iCCP); - -# ifdef PNG_COLORSPACE_SUPPORTED - /* Clean up the iCCP profile now if it won't be used. */ - png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, -1/*not used*/); -# else - PNG_UNUSED(png_ptr) -# endif - } - - else - { -# ifdef PNG_COLORSPACE_SUPPORTED - /* Leave the INFO_iCCP flag set if the pngset.c code has already set - * it; this allows a PNG to contain a profile which matches sRGB and - * yet still have that profile retrievable by the application. - */ - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_MATCHES_sRGB) != 0) - info_ptr->valid |= PNG_INFO_sRGB; - - else - info_ptr->valid &= ~PNG_INFO_sRGB; - - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) - info_ptr->valid |= PNG_INFO_cHRM; - - else - info_ptr->valid &= ~PNG_INFO_cHRM; -# endif - - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0) - info_ptr->valid |= PNG_INFO_gAMA; - - else - info_ptr->valid &= ~PNG_INFO_gAMA; - } -} - -#ifdef PNG_READ_SUPPORTED -void /* PRIVATE */ -png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr) -{ - if (info_ptr == NULL) /* reduce code size; check here not in the caller */ - return; - - info_ptr->colorspace = png_ptr->colorspace; - png_colorspace_sync_info(png_ptr, info_ptr); -} -#endif -#endif /* GAMMA */ - -#ifdef PNG_COLORSPACE_SUPPORTED -/* Added at libpng-1.5.5 to support read and write of true CIEXYZ values for - * cHRM, as opposed to using chromaticities. These internal APIs return - * non-zero on a parameter error. The X, Y and Z values are required to be - * positive and less than 1.0. - */ -static int -png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ) -{ - png_int_32 d, dwhite, whiteX, whiteY; - - d = XYZ->red_X + XYZ->red_Y + XYZ->red_Z; - if (png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d) == 0) - return 1; - if (png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d) == 0) - return 1; - dwhite = d; - whiteX = XYZ->red_X; - whiteY = XYZ->red_Y; - - d = XYZ->green_X + XYZ->green_Y + XYZ->green_Z; - if (png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, d) == 0) - return 1; - if (png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d) == 0) - return 1; - dwhite += d; - whiteX += XYZ->green_X; - whiteY += XYZ->green_Y; - - d = XYZ->blue_X + XYZ->blue_Y + XYZ->blue_Z; - if (png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, d) == 0) - return 1; - if (png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d) == 0) - return 1; - dwhite += d; - whiteX += XYZ->blue_X; - whiteY += XYZ->blue_Y; - - /* The reference white is simply the sum of the end-point (X,Y,Z) vectors, - * thus: - */ - if (png_muldiv(&xy->whitex, whiteX, PNG_FP_1, dwhite) == 0) - return 1; - if (png_muldiv(&xy->whitey, whiteY, PNG_FP_1, dwhite) == 0) - return 1; - - return 0; -} - -static int -png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy) -{ - png_fixed_point red_inverse, green_inverse, blue_scale; - png_fixed_point left, right, denominator; - - /* Check xy and, implicitly, z. Note that wide gamut color spaces typically - * have end points with 0 tristimulus values (these are impossible end - * points, but they are used to cover the possible colors). We check - * xy->whitey against 5, not 0, to avoid a possible integer overflow. - */ - if (xy->redx < 0 || xy->redx > PNG_FP_1) return 1; - if (xy->redy < 0 || xy->redy > PNG_FP_1-xy->redx) return 1; - if (xy->greenx < 0 || xy->greenx > PNG_FP_1) return 1; - if (xy->greeny < 0 || xy->greeny > PNG_FP_1-xy->greenx) return 1; - if (xy->bluex < 0 || xy->bluex > PNG_FP_1) return 1; - if (xy->bluey < 0 || xy->bluey > PNG_FP_1-xy->bluex) return 1; - if (xy->whitex < 0 || xy->whitex > PNG_FP_1) return 1; - if (xy->whitey < 5 || xy->whitey > PNG_FP_1-xy->whitex) return 1; - - /* The reverse calculation is more difficult because the original tristimulus - * value had 9 independent values (red,green,blue)x(X,Y,Z) however only 8 - * derived values were recorded in the cHRM chunk; - * (red,green,blue,white)x(x,y). This loses one degree of freedom and - * therefore an arbitrary ninth value has to be introduced to undo the - * original transformations. - * - * Think of the original end-points as points in (X,Y,Z) space. The - * chromaticity values (c) have the property: - * - * C - * c = --------- - * X + Y + Z - * - * For each c (x,y,z) from the corresponding original C (X,Y,Z). Thus the - * three chromaticity values (x,y,z) for each end-point obey the - * relationship: - * - * x + y + z = 1 - * - * This describes the plane in (X,Y,Z) space that intersects each axis at the - * value 1.0; call this the chromaticity plane. Thus the chromaticity - * calculation has scaled each end-point so that it is on the x+y+z=1 plane - * and chromaticity is the intersection of the vector from the origin to the - * (X,Y,Z) value with the chromaticity plane. - * - * To fully invert the chromaticity calculation we would need the three - * end-point scale factors, (red-scale, green-scale, blue-scale), but these - * were not recorded. Instead we calculated the reference white (X,Y,Z) and - * recorded the chromaticity of this. The reference white (X,Y,Z) would have - * given all three of the scale factors since: - * - * color-C = color-c * color-scale - * white-C = red-C + green-C + blue-C - * = red-c*red-scale + green-c*green-scale + blue-c*blue-scale - * - * But cHRM records only white-x and white-y, so we have lost the white scale - * factor: - * - * white-C = white-c*white-scale - * - * To handle this the inverse transformation makes an arbitrary assumption - * about white-scale: - * - * Assume: white-Y = 1.0 - * Hence: white-scale = 1/white-y - * Or: red-Y + green-Y + blue-Y = 1.0 - * - * Notice the last statement of the assumption gives an equation in three of - * the nine values we want to calculate. 8 more equations come from the - * above routine as summarised at the top above (the chromaticity - * calculation): - * - * Given: color-x = color-X / (color-X + color-Y + color-Z) - * Hence: (color-x - 1)*color-X + color.x*color-Y + color.x*color-Z = 0 - * - * This is 9 simultaneous equations in the 9 variables "color-C" and can be - * solved by Cramer's rule. Cramer's rule requires calculating 10 9x9 matrix - * determinants, however this is not as bad as it seems because only 28 of - * the total of 90 terms in the various matrices are non-zero. Nevertheless - * Cramer's rule is notoriously numerically unstable because the determinant - * calculation involves the difference of large, but similar, numbers. It is - * difficult to be sure that the calculation is stable for real world values - * and it is certain that it becomes unstable where the end points are close - * together. - * - * So this code uses the perhaps slightly less optimal but more - * understandable and totally obvious approach of calculating color-scale. - * - * This algorithm depends on the precision in white-scale and that is - * (1/white-y), so we can immediately see that as white-y approaches 0 the - * accuracy inherent in the cHRM chunk drops off substantially. - * - * libpng arithmetic: a simple inversion of the above equations - * ------------------------------------------------------------ - * - * white_scale = 1/white-y - * white-X = white-x * white-scale - * white-Y = 1.0 - * white-Z = (1 - white-x - white-y) * white_scale - * - * white-C = red-C + green-C + blue-C - * = red-c*red-scale + green-c*green-scale + blue-c*blue-scale - * - * This gives us three equations in (red-scale,green-scale,blue-scale) where - * all the coefficients are now known: - * - * red-x*red-scale + green-x*green-scale + blue-x*blue-scale - * = white-x/white-y - * red-y*red-scale + green-y*green-scale + blue-y*blue-scale = 1 - * red-z*red-scale + green-z*green-scale + blue-z*blue-scale - * = (1 - white-x - white-y)/white-y - * - * In the last equation color-z is (1 - color-x - color-y) so we can add all - * three equations together to get an alternative third: - * - * red-scale + green-scale + blue-scale = 1/white-y = white-scale - * - * So now we have a Cramer's rule solution where the determinants are just - * 3x3 - far more tractible. Unfortunately 3x3 determinants still involve - * multiplication of three coefficients so we can't guarantee to avoid - * overflow in the libpng fixed point representation. Using Cramer's rule in - * floating point is probably a good choice here, but it's not an option for - * fixed point. Instead proceed to simplify the first two equations by - * eliminating what is likely to be the largest value, blue-scale: - * - * blue-scale = white-scale - red-scale - green-scale - * - * Hence: - * - * (red-x - blue-x)*red-scale + (green-x - blue-x)*green-scale = - * (white-x - blue-x)*white-scale - * - * (red-y - blue-y)*red-scale + (green-y - blue-y)*green-scale = - * 1 - blue-y*white-scale - * - * And now we can trivially solve for (red-scale,green-scale): - * - * green-scale = - * (white-x - blue-x)*white-scale - (red-x - blue-x)*red-scale - * ----------------------------------------------------------- - * green-x - blue-x - * - * red-scale = - * 1 - blue-y*white-scale - (green-y - blue-y) * green-scale - * --------------------------------------------------------- - * red-y - blue-y - * - * Hence: - * - * red-scale = - * ( (green-x - blue-x) * (white-y - blue-y) - - * (green-y - blue-y) * (white-x - blue-x) ) / white-y - * ------------------------------------------------------------------------- - * (green-x - blue-x)*(red-y - blue-y)-(green-y - blue-y)*(red-x - blue-x) - * - * green-scale = - * ( (red-y - blue-y) * (white-x - blue-x) - - * (red-x - blue-x) * (white-y - blue-y) ) / white-y - * ------------------------------------------------------------------------- - * (green-x - blue-x)*(red-y - blue-y)-(green-y - blue-y)*(red-x - blue-x) - * - * Accuracy: - * The input values have 5 decimal digits of accuracy. The values are all in - * the range 0 < value < 1, so simple products are in the same range but may - * need up to 10 decimal digits to preserve the original precision and avoid - * underflow. Because we are using a 32-bit signed representation we cannot - * match this; the best is a little over 9 decimal digits, less than 10. - * - * The approach used here is to preserve the maximum precision within the - * signed representation. Because the red-scale calculation above uses the - * difference between two products of values that must be in the range -1..+1 - * it is sufficient to divide the product by 7; ceil(100,000/32767*2). The - * factor is irrelevant in the calculation because it is applied to both - * numerator and denominator. - * - * Note that the values of the differences of the products of the - * chromaticities in the above equations tend to be small, for example for - * the sRGB chromaticities they are: - * - * red numerator: -0.04751 - * green numerator: -0.08788 - * denominator: -0.2241 (without white-y multiplication) - * - * The resultant Y coefficients from the chromaticities of some widely used - * color space definitions are (to 15 decimal places): - * - * sRGB - * 0.212639005871510 0.715168678767756 0.072192315360734 - * Kodak ProPhoto - * 0.288071128229293 0.711843217810102 0.000085653960605 - * Adobe RGB - * 0.297344975250536 0.627363566255466 0.075291458493998 - * Adobe Wide Gamut RGB - * 0.258728243040113 0.724682314948566 0.016589442011321 - */ - /* By the argument, above overflow should be impossible here. The return - * value of 2 indicates an internal error to the caller. - */ - if (png_muldiv(&left, xy->greenx-xy->bluex, xy->redy - xy->bluey, 7) == 0) - return 2; - if (png_muldiv(&right, xy->greeny-xy->bluey, xy->redx - xy->bluex, 7) == 0) - return 2; - denominator = left - right; - - /* Now find the red numerator. */ - if (png_muldiv(&left, xy->greenx-xy->bluex, xy->whitey-xy->bluey, 7) == 0) - return 2; - if (png_muldiv(&right, xy->greeny-xy->bluey, xy->whitex-xy->bluex, 7) == 0) - return 2; - - /* Overflow is possible here and it indicates an extreme set of PNG cHRM - * chunk values. This calculation actually returns the reciprocal of the - * scale value because this allows us to delay the multiplication of white-y - * into the denominator, which tends to produce a small number. - */ - if (png_muldiv(&red_inverse, xy->whitey, denominator, left-right) == 0 || - red_inverse <= xy->whitey /* r+g+b scales = white scale */) - return 1; - - /* Similarly for green_inverse: */ - if (png_muldiv(&left, xy->redy-xy->bluey, xy->whitex-xy->bluex, 7) == 0) - return 2; - if (png_muldiv(&right, xy->redx-xy->bluex, xy->whitey-xy->bluey, 7) == 0) - return 2; - if (png_muldiv(&green_inverse, xy->whitey, denominator, left-right) == 0 || - green_inverse <= xy->whitey) - return 1; - - /* And the blue scale, the checks above guarantee this can't overflow but it - * can still produce 0 for extreme cHRM values. - */ - blue_scale = png_reciprocal(xy->whitey) - png_reciprocal(red_inverse) - - png_reciprocal(green_inverse); - if (blue_scale <= 0) - return 1; - - - /* And fill in the png_XYZ: */ - if (png_muldiv(&XYZ->red_X, xy->redx, PNG_FP_1, red_inverse) == 0) - return 1; - if (png_muldiv(&XYZ->red_Y, xy->redy, PNG_FP_1, red_inverse) == 0) - return 1; - if (png_muldiv(&XYZ->red_Z, PNG_FP_1 - xy->redx - xy->redy, PNG_FP_1, - red_inverse) == 0) - return 1; - - if (png_muldiv(&XYZ->green_X, xy->greenx, PNG_FP_1, green_inverse) == 0) - return 1; - if (png_muldiv(&XYZ->green_Y, xy->greeny, PNG_FP_1, green_inverse) == 0) - return 1; - if (png_muldiv(&XYZ->green_Z, PNG_FP_1 - xy->greenx - xy->greeny, PNG_FP_1, - green_inverse) == 0) - return 1; - - if (png_muldiv(&XYZ->blue_X, xy->bluex, blue_scale, PNG_FP_1) == 0) - return 1; - if (png_muldiv(&XYZ->blue_Y, xy->bluey, blue_scale, PNG_FP_1) == 0) - return 1; - if (png_muldiv(&XYZ->blue_Z, PNG_FP_1 - xy->bluex - xy->bluey, blue_scale, - PNG_FP_1) == 0) - return 1; - - return 0; /*success*/ -} - -static int -png_XYZ_normalize(png_XYZ *XYZ) -{ - png_int_32 Y; - - if (XYZ->red_Y < 0 || XYZ->green_Y < 0 || XYZ->blue_Y < 0 || - XYZ->red_X < 0 || XYZ->green_X < 0 || XYZ->blue_X < 0 || - XYZ->red_Z < 0 || XYZ->green_Z < 0 || XYZ->blue_Z < 0) - return 1; - - /* Normalize by scaling so the sum of the end-point Y values is PNG_FP_1. - * IMPLEMENTATION NOTE: ANSI requires signed overflow not to occur, therefore - * relying on addition of two positive values producing a negative one is not - * safe. - */ - Y = XYZ->red_Y; - if (0x7fffffff - Y < XYZ->green_X) - return 1; - Y += XYZ->green_Y; - if (0x7fffffff - Y < XYZ->blue_X) - return 1; - Y += XYZ->blue_Y; - - if (Y != PNG_FP_1) - { - if (png_muldiv(&XYZ->red_X, XYZ->red_X, PNG_FP_1, Y) == 0) - return 1; - if (png_muldiv(&XYZ->red_Y, XYZ->red_Y, PNG_FP_1, Y) == 0) - return 1; - if (png_muldiv(&XYZ->red_Z, XYZ->red_Z, PNG_FP_1, Y) == 0) - return 1; - - if (png_muldiv(&XYZ->green_X, XYZ->green_X, PNG_FP_1, Y) == 0) - return 1; - if (png_muldiv(&XYZ->green_Y, XYZ->green_Y, PNG_FP_1, Y) == 0) - return 1; - if (png_muldiv(&XYZ->green_Z, XYZ->green_Z, PNG_FP_1, Y) == 0) - return 1; - - if (png_muldiv(&XYZ->blue_X, XYZ->blue_X, PNG_FP_1, Y) == 0) - return 1; - if (png_muldiv(&XYZ->blue_Y, XYZ->blue_Y, PNG_FP_1, Y) == 0) - return 1; - if (png_muldiv(&XYZ->blue_Z, XYZ->blue_Z, PNG_FP_1, Y) == 0) - return 1; - } - - return 0; -} - -static int -png_colorspace_endpoints_match(const png_xy *xy1, const png_xy *xy2, int delta) -{ - /* Allow an error of +/-0.01 (absolute value) on each chromaticity */ - if (PNG_OUT_OF_RANGE(xy1->whitex, xy2->whitex,delta) || - PNG_OUT_OF_RANGE(xy1->whitey, xy2->whitey,delta) || - PNG_OUT_OF_RANGE(xy1->redx, xy2->redx, delta) || - PNG_OUT_OF_RANGE(xy1->redy, xy2->redy, delta) || - PNG_OUT_OF_RANGE(xy1->greenx, xy2->greenx,delta) || - PNG_OUT_OF_RANGE(xy1->greeny, xy2->greeny,delta) || - PNG_OUT_OF_RANGE(xy1->bluex, xy2->bluex, delta) || - PNG_OUT_OF_RANGE(xy1->bluey, xy2->bluey, delta)) - return 0; - return 1; -} - -/* Added in libpng-1.6.0, a different check for the validity of a set of cHRM - * chunk chromaticities. Earlier checks used to simply look for the overflow - * condition (where the determinant of the matrix to solve for XYZ ends up zero - * because the chromaticity values are not all distinct.) Despite this it is - * theoretically possible to produce chromaticities that are apparently valid - * but that rapidly degrade to invalid, potentially crashing, sets because of - * arithmetic inaccuracies when calculations are performed on them. The new - * check is to round-trip xy -> XYZ -> xy and then check that the result is - * within a small percentage of the original. - */ -static int -png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy) -{ - int result; - png_xy xy_test; - - /* As a side-effect this routine also returns the XYZ endpoints. */ - result = png_XYZ_from_xy(XYZ, xy); - if (result != 0) - return result; - - result = png_xy_from_XYZ(&xy_test, XYZ); - if (result != 0) - return result; - - if (png_colorspace_endpoints_match(xy, &xy_test, - 5/*actually, the math is pretty accurate*/) != 0) - return 0; - - /* Too much slip */ - return 1; -} - -/* This is the check going the other way. The XYZ is modified to normalize it - * (another side-effect) and the xy chromaticities are returned. - */ -static int -png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ) -{ - int result; - png_XYZ XYZtemp; - - result = png_XYZ_normalize(XYZ); - if (result != 0) - return result; - - result = png_xy_from_XYZ(xy, XYZ); - if (result != 0) - return result; - - XYZtemp = *XYZ; - return png_colorspace_check_xy(&XYZtemp, xy); -} - -/* Used to check for an endpoint match against sRGB */ -static const png_xy sRGB_xy = /* From ITU-R BT.709-3 */ -{ - /* color x y */ - /* red */ 64000, 33000, - /* green */ 30000, 60000, - /* blue */ 15000, 6000, - /* white */ 31270, 32900 -}; - -static int -png_colorspace_set_xy_and_XYZ(png_const_structrp png_ptr, - png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ, - int preferred) -{ - if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0) - return 0; - - /* The consistency check is performed on the chromaticities; this factors out - * variations because of the normalization (or not) of the end point Y - * values. - */ - if (preferred < 2 && - (colorspace->flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) - { - /* The end points must be reasonably close to any we already have. The - * following allows an error of up to +/-.001 - */ - if (png_colorspace_endpoints_match(xy, &colorspace->end_points_xy, - 100) == 0) - { - colorspace->flags |= PNG_COLORSPACE_INVALID; - png_benign_error(png_ptr, "inconsistent chromaticities"); - return 0; /* failed */ - } - - /* Only overwrite with preferred values */ - if (preferred == 0) - return 1; /* ok, but no change */ - } - - colorspace->end_points_xy = *xy; - colorspace->end_points_XYZ = *XYZ; - colorspace->flags |= PNG_COLORSPACE_HAVE_ENDPOINTS; - - /* The end points are normally quoted to two decimal digits, so allow +/-0.01 - * on this test. - */ - if (png_colorspace_endpoints_match(xy, &sRGB_xy, 1000) != 0) - colorspace->flags |= PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB; - - else - colorspace->flags &= PNG_COLORSPACE_CANCEL( - PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB); - - return 2; /* ok and changed */ -} - -int /* PRIVATE */ -png_colorspace_set_chromaticities(png_const_structrp png_ptr, - png_colorspacerp colorspace, const png_xy *xy, int preferred) -{ - /* We must check the end points to ensure they are reasonable - in the past - * color management systems have crashed as a result of getting bogus - * colorant values, while this isn't the fault of libpng it is the - * responsibility of libpng because PNG carries the bomb and libpng is in a - * position to protect against it. - */ - png_XYZ XYZ; - - switch (png_colorspace_check_xy(&XYZ, xy)) - { - case 0: /* success */ - return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ, - preferred); - - case 1: - /* We can't invert the chromaticities so we can't produce value XYZ - * values. Likely as not a color management system will fail too. - */ - colorspace->flags |= PNG_COLORSPACE_INVALID; - png_benign_error(png_ptr, "invalid chromaticities"); - break; - - default: - /* libpng is broken; this should be a warning but if it happens we - * want error reports so for the moment it is an error. - */ - colorspace->flags |= PNG_COLORSPACE_INVALID; - png_error(png_ptr, "internal error checking chromaticities"); - } - - return 0; /* failed */ -} - -int /* PRIVATE */ -png_colorspace_set_endpoints(png_const_structrp png_ptr, - png_colorspacerp colorspace, const png_XYZ *XYZ_in, int preferred) -{ - png_XYZ XYZ = *XYZ_in; - png_xy xy; - - switch (png_colorspace_check_XYZ(&xy, &XYZ)) - { - case 0: - return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ, - preferred); - - case 1: - /* End points are invalid. */ - colorspace->flags |= PNG_COLORSPACE_INVALID; - png_benign_error(png_ptr, "invalid end points"); - break; - - default: - colorspace->flags |= PNG_COLORSPACE_INVALID; - png_error(png_ptr, "internal error checking chromaticities"); - } - - return 0; /* failed */ -} - -#if defined(PNG_sRGB_SUPPORTED) || defined(PNG_iCCP_SUPPORTED) -/* Error message generation */ -static char -png_icc_tag_char(png_uint_32 byte) -{ - byte &= 0xff; - if (byte >= 32 && byte <= 126) - return (char)byte; - else - return '?'; -} - -static void -png_icc_tag_name(char *name, png_uint_32 tag) -{ - name[0] = '\''; - name[1] = png_icc_tag_char(tag >> 24); - name[2] = png_icc_tag_char(tag >> 16); - name[3] = png_icc_tag_char(tag >> 8); - name[4] = png_icc_tag_char(tag ); - name[5] = '\''; -} - -static int -is_ICC_signature_char(png_alloc_size_t it) -{ - return it == 32 || (it >= 48 && it <= 57) || (it >= 65 && it <= 90) || - (it >= 97 && it <= 122); -} - -static int -is_ICC_signature(png_alloc_size_t it) -{ - return is_ICC_signature_char(it >> 24) /* checks all the top bits */ && - is_ICC_signature_char((it >> 16) & 0xff) && - is_ICC_signature_char((it >> 8) & 0xff) && - is_ICC_signature_char(it & 0xff); -} - -static int -png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_alloc_size_t value, png_const_charp reason) -{ - size_t pos; - char message[196]; /* see below for calculation */ - - if (colorspace != NULL) - colorspace->flags |= PNG_COLORSPACE_INVALID; - - pos = png_safecat(message, (sizeof message), 0, "profile '"); /* 9 chars */ - pos = png_safecat(message, pos+79, pos, name); /* Truncate to 79 chars */ - pos = png_safecat(message, (sizeof message), pos, "': "); /* +2 = 90 */ - if (is_ICC_signature(value) != 0) - { - /* So 'value' is at most 4 bytes and the following cast is safe */ - png_icc_tag_name(message+pos, (png_uint_32)value); - pos += 6; /* total +8; less than the else clause */ - message[pos++] = ':'; - message[pos++] = ' '; - } -# ifdef PNG_WARNINGS_SUPPORTED - else - { - char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114*/ - - pos = png_safecat(message, (sizeof message), pos, - png_format_number(number, number+(sizeof number), - PNG_NUMBER_FORMAT_x, value)); - pos = png_safecat(message, (sizeof message), pos, "h: "); /*+2 = 116*/ - } -# endif - /* The 'reason' is an arbitrary message, allow +79 maximum 195 */ - pos = png_safecat(message, (sizeof message), pos, reason); - PNG_UNUSED(pos) - - /* This is recoverable, but make it unconditionally an app_error on write to - * avoid writing invalid ICC profiles into PNG files (i.e., we handle them - * on read, with a warning, but on write unless the app turns off - * application errors the PNG won't be written.) - */ - png_chunk_report(png_ptr, message, - (colorspace != NULL) ? PNG_CHUNK_ERROR : PNG_CHUNK_WRITE_ERROR); - - return 0; -} -#endif /* sRGB || iCCP */ - -#ifdef PNG_sRGB_SUPPORTED -int /* PRIVATE */ -png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace, - int intent) -{ - /* sRGB sets known gamma, end points and (from the chunk) intent. */ - /* IMPORTANT: these are not necessarily the values found in an ICC profile - * because ICC profiles store values adapted to a D50 environment; it is - * expected that the ICC profile mediaWhitePointTag will be D50; see the - * checks and code elsewhere to understand this better. - * - * These XYZ values, which are accurate to 5dp, produce rgb to gray - * coefficients of (6968,23435,2366), which are reduced (because they add up - * to 32769 not 32768) to (6968,23434,2366). These are the values that - * libpng has traditionally used (and are the best values given the 15bit - * algorithm used by the rgb to gray code.) - */ - static const png_XYZ sRGB_XYZ = /* D65 XYZ (*not* the D50 adapted values!) */ - { - /* color X Y Z */ - /* red */ 41239, 21264, 1933, - /* green */ 35758, 71517, 11919, - /* blue */ 18048, 7219, 95053 - }; - - /* Do nothing if the colorspace is already invalidated. */ - if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0) - return 0; - - /* Check the intent, then check for existing settings. It is valid for the - * PNG file to have cHRM or gAMA chunks along with sRGB, but the values must - * be consistent with the correct values. If, however, this function is - * called below because an iCCP chunk matches sRGB then it is quite - * conceivable that an older app recorded incorrect gAMA and cHRM because of - * an incorrect calculation based on the values in the profile - this does - * *not* invalidate the profile (though it still produces an error, which can - * be ignored.) - */ - if (intent < 0 || intent >= PNG_sRGB_INTENT_LAST) - return png_icc_profile_error(png_ptr, colorspace, "sRGB", - (unsigned)intent, "invalid sRGB rendering intent"); - - if ((colorspace->flags & PNG_COLORSPACE_HAVE_INTENT) != 0 && - colorspace->rendering_intent != intent) - return png_icc_profile_error(png_ptr, colorspace, "sRGB", - (unsigned)intent, "inconsistent rendering intents"); - - if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0) - { - png_benign_error(png_ptr, "duplicate sRGB information ignored"); - return 0; - } - - /* If the standard sRGB cHRM chunk does not match the one from the PNG file - * warn but overwrite the value with the correct one. - */ - if ((colorspace->flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0 && - !png_colorspace_endpoints_match(&sRGB_xy, &colorspace->end_points_xy, - 100)) - png_chunk_report(png_ptr, "cHRM chunk does not match sRGB", - PNG_CHUNK_ERROR); - - /* This check is just done for the error reporting - the routine always - * returns true when the 'from' argument corresponds to sRGB (2). - */ - (void)png_colorspace_check_gamma(png_ptr, colorspace, PNG_GAMMA_sRGB_INVERSE, - 2/*from sRGB*/); - - /* intent: bugs in GCC force 'int' to be used as the parameter type. */ - colorspace->rendering_intent = (png_uint_16)intent; - colorspace->flags |= PNG_COLORSPACE_HAVE_INTENT; - - /* endpoints */ - colorspace->end_points_xy = sRGB_xy; - colorspace->end_points_XYZ = sRGB_XYZ; - colorspace->flags |= - (PNG_COLORSPACE_HAVE_ENDPOINTS|PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB); - - /* gamma */ - colorspace->gamma = PNG_GAMMA_sRGB_INVERSE; - colorspace->flags |= PNG_COLORSPACE_HAVE_GAMMA; - - /* Finally record that we have an sRGB profile */ - colorspace->flags |= - (PNG_COLORSPACE_MATCHES_sRGB|PNG_COLORSPACE_FROM_sRGB); - - return 1; /* set */ -} -#endif /* sRGB */ - -#ifdef PNG_iCCP_SUPPORTED -/* Encoded value of D50 as an ICC XYZNumber. From the ICC 2010 spec the value - * is XYZ(0.9642,1.0,0.8249), which scales to: - * - * (63189.8112, 65536, 54060.6464) - */ -static const png_byte D50_nCIEXYZ[12] = - { 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d }; - -static int /* bool */ -icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_uint_32 profile_length) -{ - if (profile_length < 132) - return png_icc_profile_error(png_ptr, colorspace, name, profile_length, - "too short"); - - return 1; -} - -#ifdef PNG_READ_iCCP_SUPPORTED -int /* PRIVATE */ -png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_uint_32 profile_length) -{ - if (!icc_check_length(png_ptr, colorspace, name, profile_length)) - return 0; - - /* This needs to be here because the 'normal' check is in - * png_decompress_chunk, yet this happens after the attempt to - * png_malloc_base the required data. We only need this on read; on write - * the caller supplies the profile buffer so libpng doesn't allocate it. See - * the call to icc_check_length below (the write case). - */ -# ifdef PNG_SET_USER_LIMITS_SUPPORTED - else if (png_ptr->user_chunk_malloc_max > 0 && - png_ptr->user_chunk_malloc_max < profile_length) - return png_icc_profile_error(png_ptr, colorspace, name, profile_length, - "exceeds application limits"); -# elif PNG_USER_CHUNK_MALLOC_MAX > 0 - else if (PNG_USER_CHUNK_MALLOC_MAX < profile_length) - return png_icc_profile_error(png_ptr, colorspace, name, profile_length, - "exceeds libpng limits"); -# else /* !SET_USER_LIMITS */ - /* This will get compiled out on all 32-bit and better systems. */ - else if (PNG_SIZE_MAX < profile_length) - return png_icc_profile_error(png_ptr, colorspace, name, profile_length, - "exceeds system limits"); -# endif /* !SET_USER_LIMITS */ - - return 1; -} -#endif /* READ_iCCP */ - -int /* PRIVATE */ -png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_uint_32 profile_length, - png_const_bytep profile/* first 132 bytes only */, int color_type) -{ - png_uint_32 temp; - - /* Length check; this cannot be ignored in this code because profile_length - * is used later to check the tag table, so even if the profile seems over - * long profile_length from the caller must be correct. The caller can fix - * this up on read or write by just passing in the profile header length. - */ - temp = png_get_uint_32(profile); - if (temp != profile_length) - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "length does not match profile"); - - temp = (png_uint_32) (*(profile+8)); - if (temp > 3 && (profile_length & 3)) - return png_icc_profile_error(png_ptr, colorspace, name, profile_length, - "invalid length"); - - temp = png_get_uint_32(profile+128); /* tag count: 12 bytes/tag */ - if (temp > 357913930 || /* (2^32-4-132)/12: maximum possible tag count */ - profile_length < 132+12*temp) /* truncated tag table */ - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "tag count too large"); - - /* The 'intent' must be valid or we can't store it, ICC limits the intent to - * 16 bits. - */ - temp = png_get_uint_32(profile+64); - if (temp >= 0xffff) /* The ICC limit */ - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "invalid rendering intent"); - - /* This is just a warning because the profile may be valid in future - * versions. - */ - if (temp >= PNG_sRGB_INTENT_LAST) - (void)png_icc_profile_error(png_ptr, NULL, name, temp, - "intent outside defined range"); - - /* At this point the tag table can't be checked because it hasn't necessarily - * been loaded; however, various header fields can be checked. These checks - * are for values permitted by the PNG spec in an ICC profile; the PNG spec - * restricts the profiles that can be passed in an iCCP chunk (they must be - * appropriate to processing PNG data!) - */ - - /* Data checks (could be skipped). These checks must be independent of the - * version number; however, the version number doesn't accomodate changes in - * the header fields (just the known tags and the interpretation of the - * data.) - */ - temp = png_get_uint_32(profile+36); /* signature 'ascp' */ - if (temp != 0x61637370) - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "invalid signature"); - - /* Currently the PCS illuminant/adopted white point (the computational - * white point) are required to be D50, - * however the profile contains a record of the illuminant so perhaps ICC - * expects to be able to change this in the future (despite the rationale in - * the introduction for using a fixed PCS adopted white.) Consequently the - * following is just a warning. - */ - if (memcmp(profile+68, D50_nCIEXYZ, 12) != 0) - (void)png_icc_profile_error(png_ptr, NULL, name, 0/*no tag value*/, - "PCS illuminant is not D50"); - - /* The PNG spec requires this: - * "If the iCCP chunk is present, the image samples conform to the colour - * space represented by the embedded ICC profile as defined by the - * International Color Consortium [ICC]. The colour space of the ICC profile - * shall be an RGB colour space for colour images (PNG colour types 2, 3, and - * 6), or a greyscale colour space for greyscale images (PNG colour types 0 - * and 4)." - * - * This checking code ensures the embedded profile (on either read or write) - * conforms to the specification requirements. Notice that an ICC 'gray' - * color-space profile contains the information to transform the monochrome - * data to XYZ or L*a*b (according to which PCS the profile uses) and this - * should be used in preference to the standard libpng K channel replication - * into R, G and B channels. - * - * Previously it was suggested that an RGB profile on grayscale data could be - * handled. However it it is clear that using an RGB profile in this context - * must be an error - there is no specification of what it means. Thus it is - * almost certainly more correct to ignore the profile. - */ - temp = png_get_uint_32(profile+16); /* data colour space field */ - switch (temp) - { - case 0x52474220: /* 'RGB ' */ - if ((color_type & PNG_COLOR_MASK_COLOR) == 0) - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "RGB color space not permitted on grayscale PNG"); - break; - - case 0x47524159: /* 'GRAY' */ - if ((color_type & PNG_COLOR_MASK_COLOR) != 0) - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "Gray color space not permitted on RGB PNG"); - break; - - default: - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "invalid ICC profile color space"); - } - - /* It is up to the application to check that the profile class matches the - * application requirements; the spec provides no guidance, but it's pretty - * weird if the profile is not scanner ('scnr'), monitor ('mntr'), printer - * ('prtr') or 'spac' (for generic color spaces). Issue a warning in these - * cases. Issue an error for device link or abstract profiles - these don't - * contain the records necessary to transform the color-space to anything - * other than the target device (and not even that for an abstract profile). - * Profiles of these classes may not be embedded in images. - */ - temp = png_get_uint_32(profile+12); /* profile/device class */ - switch (temp) - { - case 0x73636e72: /* 'scnr' */ - case 0x6d6e7472: /* 'mntr' */ - case 0x70727472: /* 'prtr' */ - case 0x73706163: /* 'spac' */ - /* All supported */ - break; - - case 0x61627374: /* 'abst' */ - /* May not be embedded in an image */ - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "invalid embedded Abstract ICC profile"); - - case 0x6c696e6b: /* 'link' */ - /* DeviceLink profiles cannot be interpreted in a non-device specific - * fashion, if an app uses the AToB0Tag in the profile the results are - * undefined unless the result is sent to the intended device, - * therefore a DeviceLink profile should not be found embedded in a - * PNG. - */ - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "unexpected DeviceLink ICC profile class"); - - case 0x6e6d636c: /* 'nmcl' */ - /* A NamedColor profile is also device specific, however it doesn't - * contain an AToB0 tag that is open to misinterpretation. Almost - * certainly it will fail the tests below. - */ - (void)png_icc_profile_error(png_ptr, NULL, name, temp, - "unexpected NamedColor ICC profile class"); - break; - - default: - /* To allow for future enhancements to the profile accept unrecognized - * profile classes with a warning, these then hit the test below on the - * tag content to ensure they are backward compatible with one of the - * understood profiles. - */ - (void)png_icc_profile_error(png_ptr, NULL, name, temp, - "unrecognized ICC profile class"); - break; - } - - /* For any profile other than a device link one the PCS must be encoded - * either in XYZ or Lab. - */ - temp = png_get_uint_32(profile+20); - switch (temp) - { - case 0x58595a20: /* 'XYZ ' */ - case 0x4c616220: /* 'Lab ' */ - break; - - default: - return png_icc_profile_error(png_ptr, colorspace, name, temp, - "unexpected ICC PCS encoding"); - } - - return 1; -} - -int /* PRIVATE */ -png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_uint_32 profile_length, - png_const_bytep profile /* header plus whole tag table */) -{ - png_uint_32 tag_count = png_get_uint_32(profile+128); - png_uint_32 itag; - png_const_bytep tag = profile+132; /* The first tag */ - - /* First scan all the tags in the table and add bits to the icc_info value - * (temporarily in 'tags'). - */ - for (itag=0; itag < tag_count; ++itag, tag += 12) - { - png_uint_32 tag_id = png_get_uint_32(tag+0); - png_uint_32 tag_start = png_get_uint_32(tag+4); /* must be aligned */ - png_uint_32 tag_length = png_get_uint_32(tag+8);/* not padded */ - - /* The ICC specification does not exclude zero length tags, therefore the - * start might actually be anywhere if there is no data, but this would be - * a clear abuse of the intent of the standard so the start is checked for - * being in range. All defined tag types have an 8 byte header - a 4 byte - * type signature then 0. - */ - if ((tag_start & 3) != 0) - { - /* CNHP730S.icc shipped with Microsoft Windows 64 violates this, it is - * only a warning here because libpng does not care about the - * alignment. - */ - (void)png_icc_profile_error(png_ptr, NULL, name, tag_id, - "ICC profile tag start not a multiple of 4"); - } - - /* This is a hard error; potentially it can cause read outside the - * profile. - */ - if (tag_start > profile_length || tag_length > profile_length - tag_start) - return png_icc_profile_error(png_ptr, colorspace, name, tag_id, - "ICC profile tag outside profile"); - } - - return 1; /* success, maybe with warnings */ -} - -#ifdef PNG_sRGB_SUPPORTED -#if PNG_sRGB_PROFILE_CHECKS >= 0 -/* Information about the known ICC sRGB profiles */ -static const struct -{ - png_uint_32 adler, crc, length; - png_uint_32 md5[4]; - png_byte have_md5; - png_byte is_broken; - png_uint_16 intent; - -# define PNG_MD5(a,b,c,d) { a, b, c, d }, (a!=0)||(b!=0)||(c!=0)||(d!=0) -# define PNG_ICC_CHECKSUM(adler, crc, md5, intent, broke, date, length, fname)\ - { adler, crc, length, md5, broke, intent }, - -} png_sRGB_checks[] = -{ - /* This data comes from contrib/tools/checksum-icc run on downloads of - * all four ICC sRGB profiles from www.color.org. - */ - /* adler32, crc32, MD5[4], intent, date, length, file-name */ - PNG_ICC_CHECKSUM(0x0a3fd9f6, 0x3b8772b9, - PNG_MD5(0x29f83dde, 0xaff255ae, 0x7842fae4, 0xca83390d), 0, 0, - "2009/03/27 21:36:31", 3048, "sRGB_IEC61966-2-1_black_scaled.icc") - - /* ICC sRGB v2 perceptual no black-compensation: */ - PNG_ICC_CHECKSUM(0x4909e5e1, 0x427ebb21, - PNG_MD5(0xc95bd637, 0xe95d8a3b, 0x0df38f99, 0xc1320389), 1, 0, - "2009/03/27 21:37:45", 3052, "sRGB_IEC61966-2-1_no_black_scaling.icc") - - PNG_ICC_CHECKSUM(0xfd2144a1, 0x306fd8ae, - PNG_MD5(0xfc663378, 0x37e2886b, 0xfd72e983, 0x8228f1b8), 0, 0, - "2009/08/10 17:28:01", 60988, "sRGB_v4_ICC_preference_displayclass.icc") - - /* ICC sRGB v4 perceptual */ - PNG_ICC_CHECKSUM(0x209c35d2, 0xbbef7812, - PNG_MD5(0x34562abf, 0x994ccd06, 0x6d2c5721, 0xd0d68c5d), 0, 0, - "2007/07/25 00:05:37", 60960, "sRGB_v4_ICC_preference.icc") - - /* The following profiles have no known MD5 checksum. If there is a match - * on the (empty) MD5 the other fields are used to attempt a match and - * a warning is produced. The first two of these profiles have a 'cprt' tag - * which suggests that they were also made by Hewlett Packard. - */ - PNG_ICC_CHECKSUM(0xa054d762, 0x5d5129ce, - PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 0, - "2004/07/21 18:57:42", 3024, "sRGB_IEC61966-2-1_noBPC.icc") - - /* This is a 'mntr' (display) profile with a mediaWhitePointTag that does not - * match the D50 PCS illuminant in the header (it is in fact the D65 values, - * so the white point is recorded as the un-adapted value.) The profiles - * below only differ in one byte - the intent - and are basically the same as - * the previous profile except for the mediaWhitePointTag error and a missing - * chromaticAdaptationTag. - */ - PNG_ICC_CHECKSUM(0xf784f3fb, 0x182ea552, - PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 0, 1/*broken*/, - "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 perceptual") - - PNG_ICC_CHECKSUM(0x0398f3fc, 0xf29e526d, - PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 1/*broken*/, - "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 media-relative") -}; - -static int -png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, - png_const_bytep profile, uLong adler) -{ - /* The quick check is to verify just the MD5 signature and trust the - * rest of the data. Because the profile has already been verified for - * correctness this is safe. png_colorspace_set_sRGB will check the 'intent' - * field too, so if the profile has been edited with an intent not defined - * by sRGB (but maybe defined by a later ICC specification) the read of - * the profile will fail at that point. - */ - - png_uint_32 length = 0; - png_uint_32 intent = 0x10000; /* invalid */ -#if PNG_sRGB_PROFILE_CHECKS > 1 - uLong crc = 0; /* the value for 0 length data */ -#endif - unsigned int i; - -#ifdef PNG_SET_OPTION_SUPPORTED - /* First see if PNG_SKIP_sRGB_CHECK_PROFILE has been set to "on" */ - if (((png_ptr->options >> PNG_SKIP_sRGB_CHECK_PROFILE) & 3) == - PNG_OPTION_ON) - return 0; -#endif - - for (i=0; i < (sizeof png_sRGB_checks) / (sizeof png_sRGB_checks[0]); ++i) - { - if (png_get_uint_32(profile+84) == png_sRGB_checks[i].md5[0] && - png_get_uint_32(profile+88) == png_sRGB_checks[i].md5[1] && - png_get_uint_32(profile+92) == png_sRGB_checks[i].md5[2] && - png_get_uint_32(profile+96) == png_sRGB_checks[i].md5[3]) - { - /* This may be one of the old HP profiles without an MD5, in that - * case we can only use the length and Adler32 (note that these - * are not used by default if there is an MD5!) - */ -# if PNG_sRGB_PROFILE_CHECKS == 0 - if (png_sRGB_checks[i].have_md5 != 0) - return 1+png_sRGB_checks[i].is_broken; -# endif - - /* Profile is unsigned or more checks have been configured in. */ - if (length == 0) - { - length = png_get_uint_32(profile); - intent = png_get_uint_32(profile+64); - } - - /* Length *and* intent must match */ - if (length == (png_uint_32) png_sRGB_checks[i].length && - intent == (png_uint_32) png_sRGB_checks[i].intent) - { - /* Now calculate the adler32 if not done already. */ - if (adler == 0) - { - adler = adler32(0, NULL, 0); - adler = adler32(adler, profile, length); - } - - if (adler == png_sRGB_checks[i].adler) - { - /* These basic checks suggest that the data has not been - * modified, but if the check level is more than 1 perform - * our own crc32 checksum on the data. - */ -# if PNG_sRGB_PROFILE_CHECKS > 1 - if (crc == 0) - { - crc = crc32(0, NULL, 0); - crc = crc32(crc, profile, length); - } - - /* So this check must pass for the 'return' below to happen. - */ - if (crc == png_sRGB_checks[i].crc) -# endif - { - if (png_sRGB_checks[i].is_broken != 0) - { - /* These profiles are known to have bad data that may cause - * problems if they are used, therefore attempt to - * discourage their use, skip the 'have_md5' warning below, - * which is made irrelevant by this error. - */ - png_chunk_report(png_ptr, "known incorrect sRGB profile", - PNG_CHUNK_ERROR); - } - - /* Warn that this being done; this isn't even an error since - * the profile is perfectly valid, but it would be nice if - * people used the up-to-date ones. - */ - else if (png_sRGB_checks[i].have_md5 == 0) - { - png_chunk_report(png_ptr, - "out-of-date sRGB profile with no signature", - PNG_CHUNK_WARNING); - } - - return 1+png_sRGB_checks[i].is_broken; - } - } - -# if PNG_sRGB_PROFILE_CHECKS > 0 - /* The signature matched, but the profile had been changed in some - * way. This probably indicates a data error or uninformed hacking. - * Fall through to "no match". - */ - png_chunk_report(png_ptr, - "Not recognizing known sRGB profile that has been edited", - PNG_CHUNK_WARNING); - break; -# endif - } - } - } - - return 0; /* no match */ -} - -void /* PRIVATE */ -png_icc_set_sRGB(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_const_bytep profile, uLong adler) -{ - /* Is this profile one of the known ICC sRGB profiles? If it is, just set - * the sRGB information. - */ - if (png_compare_ICC_profile_with_sRGB(png_ptr, profile, adler) != 0) - (void)png_colorspace_set_sRGB(png_ptr, colorspace, - (int)/*already checked*/png_get_uint_32(profile+64)); -} -#endif /* PNG_sRGB_PROFILE_CHECKS >= 0 */ -#endif /* sRGB */ - -int /* PRIVATE */ -png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, - int color_type) -{ - if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0) - return 0; - - if (icc_check_length(png_ptr, colorspace, name, profile_length) != 0 && - png_icc_check_header(png_ptr, colorspace, name, profile_length, profile, - color_type) != 0 && - png_icc_check_tag_table(png_ptr, colorspace, name, profile_length, - profile) != 0) - { -# if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0 - /* If no sRGB support, don't try storing sRGB information */ - png_icc_set_sRGB(png_ptr, colorspace, profile, 0); -# endif - return 1; - } - - /* Failure case */ - return 0; -} -#endif /* iCCP */ - -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED -void /* PRIVATE */ -png_colorspace_set_rgb_coefficients(png_structrp png_ptr) -{ - /* Set the rgb_to_gray coefficients from the colorspace. */ - if (png_ptr->rgb_to_gray_coefficients_set == 0 && - (png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) - { - /* png_set_background has not been called, get the coefficients from the Y - * values of the colorspace colorants. - */ - png_fixed_point r = png_ptr->colorspace.end_points_XYZ.red_Y; - png_fixed_point g = png_ptr->colorspace.end_points_XYZ.green_Y; - png_fixed_point b = png_ptr->colorspace.end_points_XYZ.blue_Y; - png_fixed_point total = r+g+b; - - if (total > 0 && - r >= 0 && png_muldiv(&r, r, 32768, total) && r >= 0 && r <= 32768 && - g >= 0 && png_muldiv(&g, g, 32768, total) && g >= 0 && g <= 32768 && - b >= 0 && png_muldiv(&b, b, 32768, total) && b >= 0 && b <= 32768 && - r+g+b <= 32769) - { - /* We allow 0 coefficients here. r+g+b may be 32769 if two or - * all of the coefficients were rounded up. Handle this by - * reducing the *largest* coefficient by 1; this matches the - * approach used for the default coefficients in pngrtran.c - */ - int add = 0; - - if (r+g+b > 32768) - add = -1; - else if (r+g+b < 32768) - add = 1; - - if (add != 0) - { - if (g >= r && g >= b) - g += add; - else if (r >= g && r >= b) - r += add; - else - b += add; - } - - /* Check for an internal error. */ - if (r+g+b != 32768) - png_error(png_ptr, - "internal error handling cHRM coefficients"); - - else - { - png_ptr->rgb_to_gray_red_coeff = (png_uint_16)r; - png_ptr->rgb_to_gray_green_coeff = (png_uint_16)g; - } - } - - /* This is a png_error at present even though it could be ignored - - * it should never happen, but it is important that if it does, the - * bug is fixed. - */ - else - png_error(png_ptr, "internal error handling cHRM->XYZ"); - } -} -#endif /* READ_RGB_TO_GRAY */ - -#endif /* COLORSPACE */ - -#ifdef __GNUC__ -/* This exists solely to work round a warning from GNU C. */ -static int /* PRIVATE */ -png_gt(size_t a, size_t b) -{ - return a > b; -} -#else -# define png_gt(a,b) ((a) > (b)) -#endif - -void /* PRIVATE */ -png_check_IHDR(png_const_structrp png_ptr, - png_uint_32 width, png_uint_32 height, int bit_depth, - int color_type, int interlace_type, int compression_type, - int filter_type) -{ - int error = 0; - - /* Check for width and height valid values */ - if (width == 0) - { - png_warning(png_ptr, "Image width is zero in IHDR"); - error = 1; - } - - if (width > PNG_UINT_31_MAX) - { - png_warning(png_ptr, "Invalid image width in IHDR"); - error = 1; - } - - if (png_gt(((width + 7) & (~7U)), - ((PNG_SIZE_MAX - - 48 /* big_row_buf hack */ - - 1) /* filter byte */ - / 8) /* 8-byte RGBA pixels */ - - 1)) /* extra max_pixel_depth pad */ - { - /* The size of the row must be within the limits of this architecture. - * Because the read code can perform arbitrary transformations the - * maximum size is checked here. Because the code in png_read_start_row - * adds extra space "for safety's sake" in several places a conservative - * limit is used here. - * - * NOTE: it would be far better to check the size that is actually used, - * but the effect in the real world is minor and the changes are more - * extensive, therefore much more dangerous and much more difficult to - * write in a way that avoids compiler warnings. - */ - png_warning(png_ptr, "Image width is too large for this architecture"); - error = 1; - } - -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - if (width > png_ptr->user_width_max) -#else - if (width > PNG_USER_WIDTH_MAX) -#endif - { - png_warning(png_ptr, "Image width exceeds user limit in IHDR"); - error = 1; - } - - if (height == 0) - { - png_warning(png_ptr, "Image height is zero in IHDR"); - error = 1; - } - - if (height > PNG_UINT_31_MAX) - { - png_warning(png_ptr, "Invalid image height in IHDR"); - error = 1; - } - -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - if (height > png_ptr->user_height_max) -#else - if (height > PNG_USER_HEIGHT_MAX) -#endif - { - png_warning(png_ptr, "Image height exceeds user limit in IHDR"); - error = 1; - } - - /* Check other values */ - if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 && - bit_depth != 8 && bit_depth != 16) - { - png_warning(png_ptr, "Invalid bit depth in IHDR"); - error = 1; - } - - if (color_type < 0 || color_type == 1 || - color_type == 5 || color_type > 6) - { - png_warning(png_ptr, "Invalid color type in IHDR"); - error = 1; - } - - if (((color_type == PNG_COLOR_TYPE_PALETTE) && bit_depth > 8) || - ((color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8)) - { - png_warning(png_ptr, "Invalid color type/bit depth combination in IHDR"); - error = 1; - } - - if (interlace_type >= PNG_INTERLACE_LAST) - { - png_warning(png_ptr, "Unknown interlace method in IHDR"); - error = 1; - } - - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - { - png_warning(png_ptr, "Unknown compression method in IHDR"); - error = 1; - } - -#ifdef PNG_MNG_FEATURES_SUPPORTED - /* Accept filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and - * 2. Libpng did not read a PNG signature (this filter_method is only - * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and - * 4. The filter_method is 64 and - * 5. The color_type is RGB or RGBA - */ - if ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) != 0 && - png_ptr->mng_features_permitted != 0) - png_warning(png_ptr, "MNG features are not allowed in a PNG datastream"); - - if (filter_type != PNG_FILTER_TYPE_BASE) - { - if (!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) != 0 && - (filter_type == PNG_INTRAPIXEL_DIFFERENCING) && - ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) == 0) && - (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA))) - { - png_warning(png_ptr, "Unknown filter method in IHDR"); - error = 1; - } - - if ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) != 0) - { - png_warning(png_ptr, "Invalid filter method in IHDR"); - error = 1; - } - } - -#else - if (filter_type != PNG_FILTER_TYPE_BASE) - { - png_warning(png_ptr, "Unknown filter method in IHDR"); - error = 1; - } -#endif - - if (error == 1) - png_error(png_ptr, "Invalid IHDR data"); -} - -#if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) -/* ASCII to fp functions */ -/* Check an ASCII formated floating point value, see the more detailed - * comments in pngpriv.h - */ -/* The following is used internally to preserve the sticky flags */ -#define png_fp_add(state, flags) ((state) |= (flags)) -#define png_fp_set(state, value) ((state) = (value) | ((state) & PNG_FP_STICKY)) - -int /* PRIVATE */ -png_check_fp_number(png_const_charp string, png_size_t size, int *statep, - png_size_tp whereami) -{ - int state = *statep; - png_size_t i = *whereami; - - while (i < size) - { - int type; - /* First find the type of the next character */ - switch (string[i]) - { - case 43: type = PNG_FP_SAW_SIGN; break; - case 45: type = PNG_FP_SAW_SIGN + PNG_FP_NEGATIVE; break; - case 46: type = PNG_FP_SAW_DOT; break; - case 48: type = PNG_FP_SAW_DIGIT; break; - case 49: case 50: case 51: case 52: - case 53: case 54: case 55: case 56: - case 57: type = PNG_FP_SAW_DIGIT + PNG_FP_NONZERO; break; - case 69: - case 101: type = PNG_FP_SAW_E; break; - default: goto PNG_FP_End; - } - - /* Now deal with this type according to the current - * state, the type is arranged to not overlap the - * bits of the PNG_FP_STATE. - */ - switch ((state & PNG_FP_STATE) + (type & PNG_FP_SAW_ANY)) - { - case PNG_FP_INTEGER + PNG_FP_SAW_SIGN: - if ((state & PNG_FP_SAW_ANY) != 0) - goto PNG_FP_End; /* not a part of the number */ - - png_fp_add(state, type); - break; - - case PNG_FP_INTEGER + PNG_FP_SAW_DOT: - /* Ok as trailer, ok as lead of fraction. */ - if ((state & PNG_FP_SAW_DOT) != 0) /* two dots */ - goto PNG_FP_End; - - else if ((state & PNG_FP_SAW_DIGIT) != 0) /* trailing dot? */ - png_fp_add(state, type); - - else - png_fp_set(state, PNG_FP_FRACTION | type); - - break; - - case PNG_FP_INTEGER + PNG_FP_SAW_DIGIT: - if ((state & PNG_FP_SAW_DOT) != 0) /* delayed fraction */ - png_fp_set(state, PNG_FP_FRACTION | PNG_FP_SAW_DOT); - - png_fp_add(state, type | PNG_FP_WAS_VALID); - - break; - - case PNG_FP_INTEGER + PNG_FP_SAW_E: - if ((state & PNG_FP_SAW_DIGIT) == 0) - goto PNG_FP_End; - - png_fp_set(state, PNG_FP_EXPONENT); - - break; - - /* case PNG_FP_FRACTION + PNG_FP_SAW_SIGN: - goto PNG_FP_End; ** no sign in fraction */ - - /* case PNG_FP_FRACTION + PNG_FP_SAW_DOT: - goto PNG_FP_End; ** Because SAW_DOT is always set */ - - case PNG_FP_FRACTION + PNG_FP_SAW_DIGIT: - png_fp_add(state, type | PNG_FP_WAS_VALID); - break; - - case PNG_FP_FRACTION + PNG_FP_SAW_E: - /* This is correct because the trailing '.' on an - * integer is handled above - so we can only get here - * with the sequence ".E" (with no preceding digits). - */ - if ((state & PNG_FP_SAW_DIGIT) == 0) - goto PNG_FP_End; - - png_fp_set(state, PNG_FP_EXPONENT); - - break; - - case PNG_FP_EXPONENT + PNG_FP_SAW_SIGN: - if ((state & PNG_FP_SAW_ANY) != 0) - goto PNG_FP_End; /* not a part of the number */ - - png_fp_add(state, PNG_FP_SAW_SIGN); - - break; - - /* case PNG_FP_EXPONENT + PNG_FP_SAW_DOT: - goto PNG_FP_End; */ - - case PNG_FP_EXPONENT + PNG_FP_SAW_DIGIT: - png_fp_add(state, PNG_FP_SAW_DIGIT | PNG_FP_WAS_VALID); - - break; - - /* case PNG_FP_EXPONEXT + PNG_FP_SAW_E: - goto PNG_FP_End; */ - - default: goto PNG_FP_End; /* I.e. break 2 */ - } - - /* The character seems ok, continue. */ - ++i; - } - -PNG_FP_End: - /* Here at the end, update the state and return the correct - * return code. - */ - *statep = state; - *whereami = i; - - return (state & PNG_FP_SAW_DIGIT) != 0; -} - - -/* The same but for a complete string. */ -int -png_check_fp_string(png_const_charp string, png_size_t size) -{ - int state=0; - png_size_t char_index=0; - - if (png_check_fp_number(string, size, &state, &char_index) != 0 && - (char_index == size || string[char_index] == 0)) - return state /* must be non-zero - see above */; - - return 0; /* i.e. fail */ -} -#endif /* pCAL || sCAL */ - -#ifdef PNG_sCAL_SUPPORTED -# ifdef PNG_FLOATING_POINT_SUPPORTED -/* Utility used below - a simple accurate power of ten from an integral - * exponent. - */ -static double -png_pow10(int power) -{ - int recip = 0; - double d = 1; - - /* Handle negative exponent with a reciprocal at the end because - * 10 is exact whereas .1 is inexact in base 2 - */ - if (power < 0) - { - if (power < DBL_MIN_10_EXP) return 0; - recip = 1, power = -power; - } - - if (power > 0) - { - /* Decompose power bitwise. */ - double mult = 10; - do - { - if (power & 1) d *= mult; - mult *= mult; - power >>= 1; - } - while (power > 0); - - if (recip != 0) d = 1/d; - } - /* else power is 0 and d is 1 */ - - return d; -} - -/* Function to format a floating point value in ASCII with a given - * precision. - */ -void /* PRIVATE */ -png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, - double fp, unsigned int precision) -{ - /* We use standard functions from math.h, but not printf because - * that would require stdio. The caller must supply a buffer of - * sufficient size or we will png_error. The tests on size and - * the space in ascii[] consumed are indicated below. - */ - if (precision < 1) - precision = DBL_DIG; - - /* Enforce the limit of the implementation precision too. */ - if (precision > DBL_DIG+1) - precision = DBL_DIG+1; - - /* Basic sanity checks */ - if (size >= precision+5) /* See the requirements below. */ - { - if (fp < 0) - { - fp = -fp; - *ascii++ = 45; /* '-' PLUS 1 TOTAL 1 */ - --size; - } - - if (fp >= DBL_MIN && fp <= DBL_MAX) - { - int exp_b10; /* A base 10 exponent */ - double base; /* 10^exp_b10 */ - - /* First extract a base 10 exponent of the number, - * the calculation below rounds down when converting - * from base 2 to base 10 (multiply by log10(2) - - * 0.3010, but 77/256 is 0.3008, so exp_b10 needs to - * be increased. Note that the arithmetic shift - * performs a floor() unlike C arithmetic - using a - * C multiply would break the following for negative - * exponents. - */ - (void)frexp(fp, &exp_b10); /* exponent to base 2 */ - - exp_b10 = (exp_b10 * 77) >> 8; /* <= exponent to base 10 */ - - /* Avoid underflow here. */ - base = png_pow10(exp_b10); /* May underflow */ - - while (base < DBL_MIN || base < fp) - { - /* And this may overflow. */ - double test = png_pow10(exp_b10+1); - - if (test <= DBL_MAX) - ++exp_b10, base = test; - - else - break; - } - - /* Normalize fp and correct exp_b10, after this fp is in the - * range [.1,1) and exp_b10 is both the exponent and the digit - * *before* which the decimal point should be inserted - * (starting with 0 for the first digit). Note that this - * works even if 10^exp_b10 is out of range because of the - * test on DBL_MAX above. - */ - fp /= base; - while (fp >= 1) fp /= 10, ++exp_b10; - - /* Because of the code above fp may, at this point, be - * less than .1, this is ok because the code below can - * handle the leading zeros this generates, so no attempt - * is made to correct that here. - */ - - { - unsigned int czero, clead, cdigits; - char exponent[10]; - - /* Allow up to two leading zeros - this will not lengthen - * the number compared to using E-n. - */ - if (exp_b10 < 0 && exp_b10 > -3) /* PLUS 3 TOTAL 4 */ - { - czero = (unsigned int)(-exp_b10); /* PLUS 2 digits: TOTAL 3 */ - exp_b10 = 0; /* Dot added below before first output. */ - } - else - czero = 0; /* No zeros to add */ - - /* Generate the digit list, stripping trailing zeros and - * inserting a '.' before a digit if the exponent is 0. - */ - clead = czero; /* Count of leading zeros */ - cdigits = 0; /* Count of digits in list. */ - - do - { - double d; - - fp *= 10; - /* Use modf here, not floor and subtract, so that - * the separation is done in one step. At the end - * of the loop don't break the number into parts so - * that the final digit is rounded. - */ - if (cdigits+czero+1 < precision+clead) - fp = modf(fp, &d); - - else - { - d = floor(fp + .5); - - if (d > 9) - { - /* Rounding up to 10, handle that here. */ - if (czero > 0) - { - --czero, d = 1; - if (cdigits == 0) --clead; - } - else - { - while (cdigits > 0 && d > 9) - { - int ch = *--ascii; - - if (exp_b10 != (-1)) - ++exp_b10; - - else if (ch == 46) - { - ch = *--ascii, ++size; - /* Advance exp_b10 to '1', so that the - * decimal point happens after the - * previous digit. - */ - exp_b10 = 1; - } - - --cdigits; - d = ch - 47; /* I.e. 1+(ch-48) */ - } - - /* Did we reach the beginning? If so adjust the - * exponent but take into account the leading - * decimal point. - */ - if (d > 9) /* cdigits == 0 */ - { - if (exp_b10 == (-1)) - { - /* Leading decimal point (plus zeros?), if - * we lose the decimal point here it must - * be reentered below. - */ - int ch = *--ascii; - - if (ch == 46) - ++size, exp_b10 = 1; - - /* Else lost a leading zero, so 'exp_b10' is - * still ok at (-1) - */ - } - else - ++exp_b10; - - /* In all cases we output a '1' */ - d = 1; - } - } - } - fp = 0; /* Guarantees termination below. */ - } - - if (d == 0) - { - ++czero; - if (cdigits == 0) ++clead; - } - else - { - /* Included embedded zeros in the digit count. */ - cdigits += czero - clead; - clead = 0; - - while (czero > 0) - { - /* exp_b10 == (-1) means we just output the decimal - * place - after the DP don't adjust 'exp_b10' any - * more! - */ - if (exp_b10 != (-1)) - { - if (exp_b10 == 0) *ascii++ = 46, --size; - /* PLUS 1: TOTAL 4 */ - --exp_b10; - } - *ascii++ = 48, --czero; - } - - if (exp_b10 != (-1)) - { - if (exp_b10 == 0) - *ascii++ = 46, --size; /* counted above */ - - --exp_b10; - } - *ascii++ = (char)(48 + (int)d), ++cdigits; - } - } - while (cdigits+czero < precision+clead && fp > DBL_MIN); - - /* The total output count (max) is now 4+precision */ - - /* Check for an exponent, if we don't need one we are - * done and just need to terminate the string. At - * this point exp_b10==(-1) is effectively if flag - it got - * to '-1' because of the decrement after outputting - * the decimal point above (the exponent required is - * *not* -1!) - */ - if (exp_b10 >= (-1) && exp_b10 <= 2) - { - /* The following only happens if we didn't output the - * leading zeros above for negative exponent, so this - * doesn't add to the digit requirement. Note that the - * two zeros here can only be output if the two leading - * zeros were *not* output, so this doesn't increase - * the output count. - */ - while (--exp_b10 >= 0) *ascii++ = 48; - - *ascii = 0; - - /* Total buffer requirement (including the '\0') is - * 5+precision - see check at the start. - */ - return; - } - - /* Here if an exponent is required, adjust size for - * the digits we output but did not count. The total - * digit output here so far is at most 1+precision - no - * decimal point and no leading or trailing zeros have - * been output. - */ - size -= cdigits; - - *ascii++ = 69, --size; /* 'E': PLUS 1 TOTAL 2+precision */ - - /* The following use of an unsigned temporary avoids ambiguities in - * the signed arithmetic on exp_b10 and permits GCC at least to do - * better optimization. - */ - { - unsigned int uexp_b10; - - if (exp_b10 < 0) - { - *ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */ - uexp_b10 = (unsigned int)(-exp_b10); - } - - else - uexp_b10 = (unsigned int)exp_b10; - - cdigits = 0; - - while (uexp_b10 > 0) - { - exponent[cdigits++] = (char)(48 + uexp_b10 % 10); - uexp_b10 /= 10; - } - } - - /* Need another size check here for the exponent digits, so - * this need not be considered above. - */ - if (size > cdigits) - { - while (cdigits > 0) *ascii++ = exponent[--cdigits]; - - *ascii = 0; - - return; - } - } - } - else if (!(fp >= DBL_MIN)) - { - *ascii++ = 48; /* '0' */ - *ascii = 0; - return; - } - else - { - *ascii++ = 105; /* 'i' */ - *ascii++ = 110; /* 'n' */ - *ascii++ = 102; /* 'f' */ - *ascii = 0; - return; - } - } - - /* Here on buffer too small. */ - png_error(png_ptr, "ASCII conversion buffer too small"); -} - -# endif /* FLOATING_POINT */ - -# ifdef PNG_FIXED_POINT_SUPPORTED -/* Function to format a fixed point value in ASCII. - */ -void /* PRIVATE */ -png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii, - png_size_t size, png_fixed_point fp) -{ - /* Require space for 10 decimal digits, a decimal point, a minus sign and a - * trailing \0, 13 characters: - */ - if (size > 12) - { - png_uint_32 num; - - /* Avoid overflow here on the minimum integer. */ - if (fp < 0) - *ascii++ = 45, num = (png_uint_32)(-fp); - else - num = (png_uint_32)fp; - - if (num <= 0x80000000) /* else overflowed */ - { - unsigned int ndigits = 0, first = 16 /* flag value */; - char digits[10]; - - while (num) - { - /* Split the low digit off num: */ - unsigned int tmp = num/10; - num -= tmp*10; - digits[ndigits++] = (char)(48 + num); - /* Record the first non-zero digit, note that this is a number - * starting at 1, it's not actually the array index. - */ - if (first == 16 && num > 0) - first = ndigits; - num = tmp; - } - - if (ndigits > 0) - { - while (ndigits > 5) *ascii++ = digits[--ndigits]; - /* The remaining digits are fractional digits, ndigits is '5' or - * smaller at this point. It is certainly not zero. Check for a - * non-zero fractional digit: - */ - if (first <= 5) - { - unsigned int i; - *ascii++ = 46; /* decimal point */ - /* ndigits may be <5 for small numbers, output leading zeros - * then ndigits digits to first: - */ - i = 5; - while (ndigits < i) *ascii++ = 48, --i; - while (ndigits >= first) *ascii++ = digits[--ndigits]; - /* Don't output the trailing zeros! */ - } - } - else - *ascii++ = 48; - - /* And null terminate the string: */ - *ascii = 0; - return; - } - } - - /* Here on buffer too small. */ - png_error(png_ptr, "ASCII conversion buffer too small"); -} -# endif /* FIXED_POINT */ -#endif /* SCAL */ - -#if defined(PNG_FLOATING_POINT_SUPPORTED) && \ - !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \ - (defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \ - defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \ - (defined(PNG_sCAL_SUPPORTED) && \ - defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)) -png_fixed_point -png_fixed(png_const_structrp png_ptr, double fp, png_const_charp text) -{ - double r = floor(100000 * fp + .5); - - if (r > 2147483647. || r < -2147483648.) - png_fixed_error(png_ptr, text); - -# ifndef PNG_ERROR_TEXT_SUPPORTED - PNG_UNUSED(text) -# endif - - return (png_fixed_point)r; -} -#endif - -#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_COLORSPACE_SUPPORTED) ||\ - defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED) -/* muldiv functions */ -/* This API takes signed arguments and rounds the result to the nearest - * integer (or, for a fixed point number - the standard argument - to - * the nearest .00001). Overflow and divide by zero are signalled in - * the result, a boolean - true on success, false on overflow. - */ -int -png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times, - png_int_32 divisor) -{ - /* Return a * times / divisor, rounded. */ - if (divisor != 0) - { - if (a == 0 || times == 0) - { - *res = 0; - return 1; - } - else - { -#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - double r = a; - r *= times; - r /= divisor; - r = floor(r+.5); - - /* A png_fixed_point is a 32-bit integer. */ - if (r <= 2147483647. && r >= -2147483648.) - { - *res = (png_fixed_point)r; - return 1; - } -#else - int negative = 0; - png_uint_32 A, T, D; - png_uint_32 s16, s32, s00; - - if (a < 0) - negative = 1, A = -a; - else - A = a; - - if (times < 0) - negative = !negative, T = -times; - else - T = times; - - if (divisor < 0) - negative = !negative, D = -divisor; - else - D = divisor; - - /* Following can't overflow because the arguments only - * have 31 bits each, however the result may be 32 bits. - */ - s16 = (A >> 16) * (T & 0xffff) + - (A & 0xffff) * (T >> 16); - /* Can't overflow because the a*times bit is only 30 - * bits at most. - */ - s32 = (A >> 16) * (T >> 16) + (s16 >> 16); - s00 = (A & 0xffff) * (T & 0xffff); - - s16 = (s16 & 0xffff) << 16; - s00 += s16; - - if (s00 < s16) - ++s32; /* carry */ - - if (s32 < D) /* else overflow */ - { - /* s32.s00 is now the 64-bit product, do a standard - * division, we know that s32 < D, so the maximum - * required shift is 31. - */ - int bitshift = 32; - png_fixed_point result = 0; /* NOTE: signed */ - - while (--bitshift >= 0) - { - png_uint_32 d32, d00; - - if (bitshift > 0) - d32 = D >> (32-bitshift), d00 = D << bitshift; - - else - d32 = 0, d00 = D; - - if (s32 > d32) - { - if (s00 < d00) --s32; /* carry */ - s32 -= d32, s00 -= d00, result += 1<= d00) - s32 = 0, s00 -= d00, result += 1<= (D >> 1)) - ++result; - - if (negative != 0) - result = -result; - - /* Check for overflow. */ - if ((negative != 0 && result <= 0) || - (negative == 0 && result >= 0)) - { - *res = result; - return 1; - } - } -#endif - } - } - - return 0; -} -#endif /* READ_GAMMA || INCH_CONVERSIONS */ - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED) -/* The following is for when the caller doesn't much care about the - * result. - */ -png_fixed_point -png_muldiv_warn(png_const_structrp png_ptr, png_fixed_point a, png_int_32 times, - png_int_32 divisor) -{ - png_fixed_point result; - - if (png_muldiv(&result, a, times, divisor) != 0) - return result; - - png_warning(png_ptr, "fixed point overflow ignored"); - return 0; -} -#endif - -#ifdef PNG_GAMMA_SUPPORTED /* more fixed point functions for gamma */ -/* Calculate a reciprocal, return 0 on div-by-zero or overflow. */ -png_fixed_point -png_reciprocal(png_fixed_point a) -{ -#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - double r = floor(1E10/a+.5); - - if (r <= 2147483647. && r >= -2147483648.) - return (png_fixed_point)r; -#else - png_fixed_point res; - - if (png_muldiv(&res, 100000, 100000, a) != 0) - return res; -#endif - - return 0; /* error/overflow */ -} - -/* This is the shared test on whether a gamma value is 'significant' - whether - * it is worth doing gamma correction. - */ -int /* PRIVATE */ -png_gamma_significant(png_fixed_point gamma_val) -{ - return gamma_val < PNG_FP_1 - PNG_GAMMA_THRESHOLD_FIXED || - gamma_val > PNG_FP_1 + PNG_GAMMA_THRESHOLD_FIXED; -} -#endif - -#ifdef PNG_READ_GAMMA_SUPPORTED -#ifdef PNG_16BIT_SUPPORTED -/* A local convenience routine. */ -static png_fixed_point -png_product2(png_fixed_point a, png_fixed_point b) -{ - /* The required result is 1/a * 1/b; the following preserves accuracy. */ -#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - double r = a * 1E-5; - r *= b; - r = floor(r+.5); - - if (r <= 2147483647. && r >= -2147483648.) - return (png_fixed_point)r; -#else - png_fixed_point res; - - if (png_muldiv(&res, a, b, 100000) != 0) - return res; -#endif - - return 0; /* overflow */ -} -#endif /* 16BIT */ - -/* The inverse of the above. */ -png_fixed_point -png_reciprocal2(png_fixed_point a, png_fixed_point b) -{ - /* The required result is 1/a * 1/b; the following preserves accuracy. */ -#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - if (a != 0 && b != 0) - { - double r = 1E15/a; - r /= b; - r = floor(r+.5); - - if (r <= 2147483647. && r >= -2147483648.) - return (png_fixed_point)r; - } -#else - /* This may overflow because the range of png_fixed_point isn't symmetric, - * but this API is only used for the product of file and screen gamma so it - * doesn't matter that the smallest number it can produce is 1/21474, not - * 1/100000 - */ - png_fixed_point res = png_product2(a, b); - - if (res != 0) - return png_reciprocal(res); -#endif - - return 0; /* overflow */ -} -#endif /* READ_GAMMA */ - -#ifdef PNG_READ_GAMMA_SUPPORTED /* gamma table code */ -#ifndef PNG_FLOATING_ARITHMETIC_SUPPORTED -/* Fixed point gamma. - * - * The code to calculate the tables used below can be found in the shell script - * contrib/tools/intgamma.sh - * - * To calculate gamma this code implements fast log() and exp() calls using only - * fixed point arithmetic. This code has sufficient precision for either 8-bit - * or 16-bit sample values. - * - * The tables used here were calculated using simple 'bc' programs, but C double - * precision floating point arithmetic would work fine. - * - * 8-bit log table - * This is a table of -log(value/255)/log(2) for 'value' in the range 128 to - * 255, so it's the base 2 logarithm of a normalized 8-bit floating point - * mantissa. The numbers are 32-bit fractions. - */ -static const png_uint_32 -png_8bit_l2[128] = -{ - 4270715492U, 4222494797U, 4174646467U, 4127164793U, 4080044201U, 4033279239U, - 3986864580U, 3940795015U, 3895065449U, 3849670902U, 3804606499U, 3759867474U, - 3715449162U, 3671346997U, 3627556511U, 3584073329U, 3540893168U, 3498011834U, - 3455425220U, 3413129301U, 3371120137U, 3329393864U, 3287946700U, 3246774933U, - 3205874930U, 3165243125U, 3124876025U, 3084770202U, 3044922296U, 3005329011U, - 2965987113U, 2926893432U, 2888044853U, 2849438323U, 2811070844U, 2772939474U, - 2735041326U, 2697373562U, 2659933400U, 2622718104U, 2585724991U, 2548951424U, - 2512394810U, 2476052606U, 2439922311U, 2404001468U, 2368287663U, 2332778523U, - 2297471715U, 2262364947U, 2227455964U, 2192742551U, 2158222529U, 2123893754U, - 2089754119U, 2055801552U, 2022034013U, 1988449497U, 1955046031U, 1921821672U, - 1888774511U, 1855902668U, 1823204291U, 1790677560U, 1758320682U, 1726131893U, - 1694109454U, 1662251657U, 1630556815U, 1599023271U, 1567649391U, 1536433567U, - 1505374214U, 1474469770U, 1443718700U, 1413119487U, 1382670639U, 1352370686U, - 1322218179U, 1292211689U, 1262349810U, 1232631153U, 1203054352U, 1173618059U, - 1144320946U, 1115161701U, 1086139034U, 1057251672U, 1028498358U, 999877854U, - 971388940U, 943030410U, 914801076U, 886699767U, 858725327U, 830876614U, - 803152505U, 775551890U, 748073672U, 720716771U, 693480120U, 666362667U, - 639363374U, 612481215U, 585715177U, 559064263U, 532527486U, 506103872U, - 479792461U, 453592303U, 427502463U, 401522014U, 375650043U, 349885648U, - 324227938U, 298676034U, 273229066U, 247886176U, 222646516U, 197509248U, - 172473545U, 147538590U, 122703574U, 97967701U, 73330182U, 48790236U, - 24347096U, 0U - -#if 0 - /* The following are the values for 16-bit tables - these work fine for the - * 8-bit conversions but produce very slightly larger errors in the 16-bit - * log (about 1.2 as opposed to 0.7 absolute error in the final value). To - * use these all the shifts below must be adjusted appropriately. - */ - 65166, 64430, 63700, 62976, 62257, 61543, 60835, 60132, 59434, 58741, 58054, - 57371, 56693, 56020, 55352, 54689, 54030, 53375, 52726, 52080, 51439, 50803, - 50170, 49542, 48918, 48298, 47682, 47070, 46462, 45858, 45257, 44661, 44068, - 43479, 42894, 42312, 41733, 41159, 40587, 40020, 39455, 38894, 38336, 37782, - 37230, 36682, 36137, 35595, 35057, 34521, 33988, 33459, 32932, 32408, 31887, - 31369, 30854, 30341, 29832, 29325, 28820, 28319, 27820, 27324, 26830, 26339, - 25850, 25364, 24880, 24399, 23920, 23444, 22970, 22499, 22029, 21562, 21098, - 20636, 20175, 19718, 19262, 18808, 18357, 17908, 17461, 17016, 16573, 16132, - 15694, 15257, 14822, 14390, 13959, 13530, 13103, 12678, 12255, 11834, 11415, - 10997, 10582, 10168, 9756, 9346, 8937, 8531, 8126, 7723, 7321, 6921, 6523, - 6127, 5732, 5339, 4947, 4557, 4169, 3782, 3397, 3014, 2632, 2251, 1872, 1495, - 1119, 744, 372 -#endif -}; - -static png_int_32 -png_log8bit(unsigned int x) -{ - unsigned int lg2 = 0; - /* Each time 'x' is multiplied by 2, 1 must be subtracted off the final log, - * because the log is actually negate that means adding 1. The final - * returned value thus has the range 0 (for 255 input) to 7.994 (for 1 - * input), return -1 for the overflow (log 0) case, - so the result is - * always at most 19 bits. - */ - if ((x &= 0xff) == 0) - return -1; - - if ((x & 0xf0) == 0) - lg2 = 4, x <<= 4; - - if ((x & 0xc0) == 0) - lg2 += 2, x <<= 2; - - if ((x & 0x80) == 0) - lg2 += 1, x <<= 1; - - /* result is at most 19 bits, so this cast is safe: */ - return (png_int_32)((lg2 << 16) + ((png_8bit_l2[x-128]+32768)>>16)); -} - -/* The above gives exact (to 16 binary places) log2 values for 8-bit images, - * for 16-bit images we use the most significant 8 bits of the 16-bit value to - * get an approximation then multiply the approximation by a correction factor - * determined by the remaining up to 8 bits. This requires an additional step - * in the 16-bit case. - * - * We want log2(value/65535), we have log2(v'/255), where: - * - * value = v' * 256 + v'' - * = v' * f - * - * So f is value/v', which is equal to (256+v''/v') since v' is in the range 128 - * to 255 and v'' is in the range 0 to 255 f will be in the range 256 to less - * than 258. The final factor also needs to correct for the fact that our 8-bit - * value is scaled by 255, whereas the 16-bit values must be scaled by 65535. - * - * This gives a final formula using a calculated value 'x' which is value/v' and - * scaling by 65536 to match the above table: - * - * log2(x/257) * 65536 - * - * Since these numbers are so close to '1' we can use simple linear - * interpolation between the two end values 256/257 (result -368.61) and 258/257 - * (result 367.179). The values used below are scaled by a further 64 to give - * 16-bit precision in the interpolation: - * - * Start (256): -23591 - * Zero (257): 0 - * End (258): 23499 - */ -#ifdef PNG_16BIT_SUPPORTED -static png_int_32 -png_log16bit(png_uint_32 x) -{ - unsigned int lg2 = 0; - - /* As above, but now the input has 16 bits. */ - if ((x &= 0xffff) == 0) - return -1; - - if ((x & 0xff00) == 0) - lg2 = 8, x <<= 8; - - if ((x & 0xf000) == 0) - lg2 += 4, x <<= 4; - - if ((x & 0xc000) == 0) - lg2 += 2, x <<= 2; - - if ((x & 0x8000) == 0) - lg2 += 1, x <<= 1; - - /* Calculate the base logarithm from the top 8 bits as a 28-bit fractional - * value. - */ - lg2 <<= 28; - lg2 += (png_8bit_l2[(x>>8)-128]+8) >> 4; - - /* Now we need to interpolate the factor, this requires a division by the top - * 8 bits. Do this with maximum precision. - */ - x = ((x << 16) + (x >> 9)) / (x >> 8); - - /* Since we divided by the top 8 bits of 'x' there will be a '1' at 1<<24, - * the value at 1<<16 (ignoring this) will be 0 or 1; this gives us exactly - * 16 bits to interpolate to get the low bits of the result. Round the - * answer. Note that the end point values are scaled by 64 to retain overall - * precision and that 'lg2' is current scaled by an extra 12 bits, so adjust - * the overall scaling by 6-12. Round at every step. - */ - x -= 1U << 24; - - if (x <= 65536U) /* <= '257' */ - lg2 += ((23591U * (65536U-x)) + (1U << (16+6-12-1))) >> (16+6-12); - - else - lg2 -= ((23499U * (x-65536U)) + (1U << (16+6-12-1))) >> (16+6-12); - - /* Safe, because the result can't have more than 20 bits: */ - return (png_int_32)((lg2 + 2048) >> 12); -} -#endif /* 16BIT */ - -/* The 'exp()' case must invert the above, taking a 20-bit fixed point - * logarithmic value and returning a 16 or 8-bit number as appropriate. In - * each case only the low 16 bits are relevant - the fraction - since the - * integer bits (the top 4) simply determine a shift. - * - * The worst case is the 16-bit distinction between 65535 and 65534. This - * requires perhaps spurious accuracy in the decoding of the logarithm to - * distinguish log2(65535/65534.5) - 10^-5 or 17 bits. There is little chance - * of getting this accuracy in practice. - * - * To deal with this the following exp() function works out the exponent of the - * frational part of the logarithm by using an accurate 32-bit value from the - * top four fractional bits then multiplying in the remaining bits. - */ -static const png_uint_32 -png_32bit_exp[16] = -{ - /* NOTE: the first entry is deliberately set to the maximum 32-bit value. */ - 4294967295U, 4112874773U, 3938502376U, 3771522796U, 3611622603U, 3458501653U, - 3311872529U, 3171459999U, 3037000500U, 2908241642U, 2784941738U, 2666869345U, - 2553802834U, 2445529972U, 2341847524U, 2242560872U -}; - -/* Adjustment table; provided to explain the numbers in the code below. */ -#if 0 -for (i=11;i>=0;--i){ print i, " ", (1 - e(-(2^i)/65536*l(2))) * 2^(32-i), "\n"} - 11 44937.64284865548751208448 - 10 45180.98734845585101160448 - 9 45303.31936980687359311872 - 8 45364.65110595323018870784 - 7 45395.35850361789624614912 - 6 45410.72259715102037508096 - 5 45418.40724413220722311168 - 4 45422.25021786898173001728 - 3 45424.17186732298419044352 - 2 45425.13273269940811464704 - 1 45425.61317555035558641664 - 0 45425.85339951654943850496 -#endif - -static png_uint_32 -png_exp(png_fixed_point x) -{ - if (x > 0 && x <= 0xfffff) /* Else overflow or zero (underflow) */ - { - /* Obtain a 4-bit approximation */ - png_uint_32 e = png_32bit_exp[(x >> 12) & 0x0f]; - - /* Incorporate the low 12 bits - these decrease the returned value by - * multiplying by a number less than 1 if the bit is set. The multiplier - * is determined by the above table and the shift. Notice that the values - * converge on 45426 and this is used to allow linear interpolation of the - * low bits. - */ - if (x & 0x800) - e -= (((e >> 16) * 44938U) + 16U) >> 5; - - if (x & 0x400) - e -= (((e >> 16) * 45181U) + 32U) >> 6; - - if (x & 0x200) - e -= (((e >> 16) * 45303U) + 64U) >> 7; - - if (x & 0x100) - e -= (((e >> 16) * 45365U) + 128U) >> 8; - - if (x & 0x080) - e -= (((e >> 16) * 45395U) + 256U) >> 9; - - if (x & 0x040) - e -= (((e >> 16) * 45410U) + 512U) >> 10; - - /* And handle the low 6 bits in a single block. */ - e -= (((e >> 16) * 355U * (x & 0x3fU)) + 256U) >> 9; - - /* Handle the upper bits of x. */ - e >>= x >> 16; - return e; - } - - /* Check for overflow */ - if (x <= 0) - return png_32bit_exp[0]; - - /* Else underflow */ - return 0; -} - -static png_byte -png_exp8bit(png_fixed_point lg2) -{ - /* Get a 32-bit value: */ - png_uint_32 x = png_exp(lg2); - - /* Convert the 32-bit value to 0..255 by multiplying by 256-1. Note that the - * second, rounding, step can't overflow because of the first, subtraction, - * step. - */ - x -= x >> 8; - return (png_byte)(((x + 0x7fffffU) >> 24) & 0xff); -} - -#ifdef PNG_16BIT_SUPPORTED -static png_uint_16 -png_exp16bit(png_fixed_point lg2) -{ - /* Get a 32-bit value: */ - png_uint_32 x = png_exp(lg2); - - /* Convert the 32-bit value to 0..65535 by multiplying by 65536-1: */ - x -= x >> 16; - return (png_uint_16)((x + 32767U) >> 16); -} -#endif /* 16BIT */ -#endif /* FLOATING_ARITHMETIC */ - -png_byte -png_gamma_8bit_correct(unsigned int value, png_fixed_point gamma_val) -{ - if (value > 0 && value < 255) - { -# ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - /* 'value' is unsigned, ANSI-C90 requires the compiler to correctly - * convert this to a floating point value. This includes values that - * would overflow if 'value' were to be converted to 'int'. - * - * Apparently GCC, however, does an intermediate conversion to (int) - * on some (ARM) but not all (x86) platforms, possibly because of - * hardware FP limitations. (E.g. if the hardware conversion always - * assumes the integer register contains a signed value.) This results - * in ANSI-C undefined behavior for large values. - * - * Other implementations on the same machine might actually be ANSI-C90 - * conformant and therefore compile spurious extra code for the large - * values. - * - * We can be reasonably sure that an unsigned to float conversion - * won't be faster than an int to float one. Therefore this code - * assumes responsibility for the undefined behavior, which it knows - * can't happen because of the check above. - * - * Note the argument to this routine is an (unsigned int) because, on - * 16-bit platforms, it is assigned a value which might be out of - * range for an (int); that would result in undefined behavior in the - * caller if the *argument* ('value') were to be declared (int). - */ - double r = floor(255*pow((int)/*SAFE*/value/255.,gamma_val*.00001)+.5); - return (png_byte)r; -# else - png_int_32 lg2 = png_log8bit(value); - png_fixed_point res; - - if (png_muldiv(&res, gamma_val, lg2, PNG_FP_1) != 0) - return png_exp8bit(res); - - /* Overflow. */ - value = 0; -# endif - } - - return (png_byte)(value & 0xff); -} - -#ifdef PNG_16BIT_SUPPORTED -png_uint_16 -png_gamma_16bit_correct(unsigned int value, png_fixed_point gamma_val) -{ - if (value > 0 && value < 65535) - { -# ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - /* The same (unsigned int)->(double) constraints apply here as above, - * however in this case the (unsigned int) to (int) conversion can - * overflow on an ANSI-C90 compliant system so the cast needs to ensure - * that this is not possible. - */ - double r = floor(65535*pow((png_int_32)value/65535., - gamma_val*.00001)+.5); - return (png_uint_16)r; -# else - png_int_32 lg2 = png_log16bit(value); - png_fixed_point res; - - if (png_muldiv(&res, gamma_val, lg2, PNG_FP_1) != 0) - return png_exp16bit(res); - - /* Overflow. */ - value = 0; -# endif - } - - return (png_uint_16)value; -} -#endif /* 16BIT */ - -/* This does the right thing based on the bit_depth field of the - * png_struct, interpreting values as 8-bit or 16-bit. While the result - * is nominally a 16-bit value if bit depth is 8 then the result is - * 8-bit (as are the arguments.) - */ -png_uint_16 /* PRIVATE */ -png_gamma_correct(png_structrp png_ptr, unsigned int value, - png_fixed_point gamma_val) -{ - if (png_ptr->bit_depth == 8) - return png_gamma_8bit_correct(value, gamma_val); - -#ifdef PNG_16BIT_SUPPORTED - else - return png_gamma_16bit_correct(value, gamma_val); -#else - /* should not reach this */ - return 0; -#endif /* 16BIT */ -} - -#ifdef PNG_16BIT_SUPPORTED -/* Internal function to build a single 16-bit table - the table consists of - * 'num' 256 entry subtables, where 'num' is determined by 'shift' - the amount - * to shift the input values right (or 16-number_of_signifiant_bits). - * - * The caller is responsible for ensuring that the table gets cleaned up on - * png_error (i.e. if one of the mallocs below fails) - i.e. the *table argument - * should be somewhere that will be cleaned. - */ -static void -png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable, - PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val) -{ - /* Various values derived from 'shift': */ - PNG_CONST unsigned int num = 1U << (8U - shift); -#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - /* CSE the division and work round wacky GCC warnings (see the comments - * in png_gamma_8bit_correct for where these come from.) - */ - PNG_CONST double fmax = 1./(((png_int_32)1 << (16U - shift))-1); -#endif - PNG_CONST unsigned int max = (1U << (16U - shift))-1U; - PNG_CONST unsigned int max_by_2 = 1U << (15U-shift); - unsigned int i; - - png_uint_16pp table = *ptable = - (png_uint_16pp)png_calloc(png_ptr, num * (sizeof (png_uint_16p))); - - for (i = 0; i < num; i++) - { - png_uint_16p sub_table = table[i] = - (png_uint_16p)png_malloc(png_ptr, 256 * (sizeof (png_uint_16))); - - /* The 'threshold' test is repeated here because it can arise for one of - * the 16-bit tables even if the others don't hit it. - */ - if (png_gamma_significant(gamma_val) != 0) - { - /* The old code would overflow at the end and this would cause the - * 'pow' function to return a result >1, resulting in an - * arithmetic error. This code follows the spec exactly; ig is - * the recovered input sample, it always has 8-16 bits. - * - * We want input * 65535/max, rounded, the arithmetic fits in 32 - * bits (unsigned) so long as max <= 32767. - */ - unsigned int j; - for (j = 0; j < 256; j++) - { - png_uint_32 ig = (j << (8-shift)) + i; -# ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - /* Inline the 'max' scaling operation: */ - /* See png_gamma_8bit_correct for why the cast to (int) is - * required here. - */ - double d = floor(65535.*pow(ig*fmax, gamma_val*.00001)+.5); - sub_table[j] = (png_uint_16)d; -# else - if (shift != 0) - ig = (ig * 65535U + max_by_2)/max; - - sub_table[j] = png_gamma_16bit_correct(ig, gamma_val); -# endif - } - } - else - { - /* We must still build a table, but do it the fast way. */ - unsigned int j; - - for (j = 0; j < 256; j++) - { - png_uint_32 ig = (j << (8-shift)) + i; - - if (shift != 0) - ig = (ig * 65535U + max_by_2)/max; - - sub_table[j] = (png_uint_16)ig; - } - } - } -} - -/* NOTE: this function expects the *inverse* of the overall gamma transformation - * required. - */ -static void -png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable, - PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val) -{ - PNG_CONST unsigned int num = 1U << (8U - shift); - PNG_CONST unsigned int max = (1U << (16U - shift))-1U; - unsigned int i; - png_uint_32 last; - - png_uint_16pp table = *ptable = - (png_uint_16pp)png_calloc(png_ptr, num * (sizeof (png_uint_16p))); - - /* 'num' is the number of tables and also the number of low bits of low - * bits of the input 16-bit value used to select a table. Each table is - * itself indexed by the high 8 bits of the value. - */ - for (i = 0; i < num; i++) - table[i] = (png_uint_16p)png_malloc(png_ptr, - 256 * (sizeof (png_uint_16))); - - /* 'gamma_val' is set to the reciprocal of the value calculated above, so - * pow(out,g) is an *input* value. 'last' is the last input value set. - * - * In the loop 'i' is used to find output values. Since the output is - * 8-bit there are only 256 possible values. The tables are set up to - * select the closest possible output value for each input by finding - * the input value at the boundary between each pair of output values - * and filling the table up to that boundary with the lower output - * value. - * - * The boundary values are 0.5,1.5..253.5,254.5. Since these are 9-bit - * values the code below uses a 16-bit value in i; the values start at - * 128.5 (for 0.5) and step by 257, for a total of 254 values (the last - * entries are filled with 255). Start i at 128 and fill all 'last' - * table entries <= 'max' - */ - last = 0; - for (i = 0; i < 255; ++i) /* 8-bit output value */ - { - /* Find the corresponding maximum input value */ - png_uint_16 out = (png_uint_16)(i * 257U); /* 16-bit output value */ - - /* Find the boundary value in 16 bits: */ - png_uint_32 bound = png_gamma_16bit_correct(out+128U, gamma_val); - - /* Adjust (round) to (16-shift) bits: */ - bound = (bound * max + 32768U)/65535U + 1U; - - while (last < bound) - { - table[last & (0xffU >> shift)][last >> (8U - shift)] = out; - last++; - } - } - - /* And fill in the final entries. */ - while (last < (num << 8)) - { - table[last & (0xff >> shift)][last >> (8U - shift)] = 65535U; - last++; - } -} -#endif /* 16BIT */ - -/* Build a single 8-bit table: same as the 16-bit case but much simpler (and - * typically much faster). Note that libpng currently does no sBIT processing - * (apparently contrary to the spec) so a 256-entry table is always generated. - */ -static void -png_build_8bit_table(png_structrp png_ptr, png_bytepp ptable, - PNG_CONST png_fixed_point gamma_val) -{ - unsigned int i; - png_bytep table = *ptable = (png_bytep)png_malloc(png_ptr, 256); - - if (png_gamma_significant(gamma_val) != 0) - for (i=0; i<256; i++) - table[i] = png_gamma_8bit_correct(i, gamma_val); - - else - for (i=0; i<256; ++i) - table[i] = (png_byte)(i & 0xff); -} - -/* Used from png_read_destroy and below to release the memory used by the gamma - * tables. - */ -void /* PRIVATE */ -png_destroy_gamma_table(png_structrp png_ptr) -{ - png_free(png_ptr, png_ptr->gamma_table); - png_ptr->gamma_table = NULL; - -#ifdef PNG_16BIT_SUPPORTED - if (png_ptr->gamma_16_table != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_table[i]); - } - png_free(png_ptr, png_ptr->gamma_16_table); - png_ptr->gamma_16_table = NULL; - } -#endif /* 16BIT */ - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - png_free(png_ptr, png_ptr->gamma_from_1); - png_ptr->gamma_from_1 = NULL; - png_free(png_ptr, png_ptr->gamma_to_1); - png_ptr->gamma_to_1 = NULL; - -#ifdef PNG_16BIT_SUPPORTED - if (png_ptr->gamma_16_from_1 != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_from_1[i]); - } - png_free(png_ptr, png_ptr->gamma_16_from_1); - png_ptr->gamma_16_from_1 = NULL; - } - if (png_ptr->gamma_16_to_1 != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_to_1[i]); - } - png_free(png_ptr, png_ptr->gamma_16_to_1); - png_ptr->gamma_16_to_1 = NULL; - } -#endif /* 16BIT */ -#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ -} - -/* We build the 8- or 16-bit gamma tables here. Note that for 16-bit - * tables, we don't make a full table if we are reducing to 8-bit in - * the future. Note also how the gamma_16 tables are segmented so that - * we don't need to allocate > 64K chunks for a full 16-bit table. - */ -void /* PRIVATE */ -png_build_gamma_table(png_structrp png_ptr, int bit_depth) -{ - png_debug(1, "in png_build_gamma_table"); - - /* Remove any existing table; this copes with multiple calls to - * png_read_update_info. The warning is because building the gamma tables - * multiple times is a performance hit - it's harmless but the ability to - * call png_read_update_info() multiple times is new in 1.5.6 so it seems - * sensible to warn if the app introduces such a hit. - */ - if (png_ptr->gamma_table != NULL || png_ptr->gamma_16_table != NULL) - { - png_warning(png_ptr, "gamma table being rebuilt"); - png_destroy_gamma_table(png_ptr); - } - - if (bit_depth <= 8) - { - png_build_8bit_table(png_ptr, &png_ptr->gamma_table, - png_ptr->screen_gamma > 0 ? - png_reciprocal2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma) : PNG_FP_1); - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if ((png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY)) != 0) - { - png_build_8bit_table(png_ptr, &png_ptr->gamma_to_1, - png_reciprocal(png_ptr->colorspace.gamma)); - - png_build_8bit_table(png_ptr, &png_ptr->gamma_from_1, - png_ptr->screen_gamma > 0 ? - png_reciprocal(png_ptr->screen_gamma) : - png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */); - } -#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ - } -#ifdef PNG_16BIT_SUPPORTED - else - { - png_byte shift, sig_bit; - - if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) - { - sig_bit = png_ptr->sig_bit.red; - - if (png_ptr->sig_bit.green > sig_bit) - sig_bit = png_ptr->sig_bit.green; - - if (png_ptr->sig_bit.blue > sig_bit) - sig_bit = png_ptr->sig_bit.blue; - } - else - sig_bit = png_ptr->sig_bit.gray; - - /* 16-bit gamma code uses this equation: - * - * ov = table[(iv & 0xff) >> gamma_shift][iv >> 8] - * - * Where 'iv' is the input color value and 'ov' is the output value - - * pow(iv, gamma). - * - * Thus the gamma table consists of up to 256 256-entry tables. The table - * is selected by the (8-gamma_shift) most significant of the low 8 bits - * of the color value then indexed by the upper 8 bits: - * - * table[low bits][high 8 bits] - * - * So the table 'n' corresponds to all those 'iv' of: - * - * ..<(n+1 << gamma_shift)-1> - * - */ - if (sig_bit > 0 && sig_bit < 16U) - /* shift == insignificant bits */ - shift = (png_byte)((16U - sig_bit) & 0xff); - - else - shift = 0; /* keep all 16 bits */ - - if ((png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8)) != 0) - { - /* PNG_MAX_GAMMA_8 is the number of bits to keep - effectively - * the significant bits in the *input* when the output will - * eventually be 8 bits. By default it is 11. - */ - if (shift < (16U - PNG_MAX_GAMMA_8)) - shift = (16U - PNG_MAX_GAMMA_8); - } - - if (shift > 8U) - shift = 8U; /* Guarantees at least one table! */ - - png_ptr->gamma_shift = shift; - - /* NOTE: prior to 1.5.4 this test used to include PNG_BACKGROUND (now - * PNG_COMPOSE). This effectively smashed the background calculation for - * 16-bit output because the 8-bit table assumes the result will be - * reduced to 8 bits. - */ - if ((png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8)) != 0) - png_build_16to8_table(png_ptr, &png_ptr->gamma_16_table, shift, - png_ptr->screen_gamma > 0 ? png_product2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma) : PNG_FP_1); - - else - png_build_16bit_table(png_ptr, &png_ptr->gamma_16_table, shift, - png_ptr->screen_gamma > 0 ? png_reciprocal2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma) : PNG_FP_1); - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if ((png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY)) != 0) - { - png_build_16bit_table(png_ptr, &png_ptr->gamma_16_to_1, shift, - png_reciprocal(png_ptr->colorspace.gamma)); - - /* Notice that the '16 from 1' table should be full precision, however - * the lookup on this table still uses gamma_shift, so it can't be. - * TODO: fix this. - */ - png_build_16bit_table(png_ptr, &png_ptr->gamma_16_from_1, shift, - png_ptr->screen_gamma > 0 ? png_reciprocal(png_ptr->screen_gamma) : - png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */); - } -#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ - } -#endif /* 16BIT */ -} -#endif /* READ_GAMMA */ - -/* HARDWARE OR SOFTWARE OPTION SUPPORT */ -#ifdef PNG_SET_OPTION_SUPPORTED -int PNGAPI -png_set_option(png_structrp png_ptr, int option, int onoff) -{ - if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT && - (option & 1) == 0) - { - png_uint_32 mask = 3 << option; - png_uint_32 setting = (2 + (onoff != 0)) << option; - png_uint_32 current = png_ptr->options; - - png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff); - - return (current & mask) >> option; - } - - return PNG_OPTION_INVALID; -} -#endif - -/* sRGB support */ -#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ - defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) -/* sRGB conversion tables; these are machine generated with the code in - * contrib/tools/makesRGB.c. The actual sRGB transfer curve defined in the - * specification (see the article at http://en.wikipedia.org/wiki/SRGB) - * is used, not the gamma=1/2.2 approximation use elsewhere in libpng. - * The sRGB to linear table is exact (to the nearest 16-bit linear fraction). - * The inverse (linear to sRGB) table has accuracies as follows: - * - * For all possible (255*65535+1) input values: - * - * error: -0.515566 - 0.625971, 79441 (0.475369%) of readings inexact - * - * For the input values corresponding to the 65536 16-bit values: - * - * error: -0.513727 - 0.607759, 308 (0.469978%) of readings inexact - * - * In all cases the inexact readings are only off by one. - */ - -#ifdef PNG_SIMPLIFIED_READ_SUPPORTED -/* The convert-to-sRGB table is only currently required for read. */ -const png_uint_16 png_sRGB_table[256] = -{ - 0,20,40,60,80,99,119,139, - 159,179,199,219,241,264,288,313, - 340,367,396,427,458,491,526,562, - 599,637,677,718,761,805,851,898, - 947,997,1048,1101,1156,1212,1270,1330, - 1391,1453,1517,1583,1651,1720,1790,1863, - 1937,2013,2090,2170,2250,2333,2418,2504, - 2592,2681,2773,2866,2961,3058,3157,3258, - 3360,3464,3570,3678,3788,3900,4014,4129, - 4247,4366,4488,4611,4736,4864,4993,5124, - 5257,5392,5530,5669,5810,5953,6099,6246, - 6395,6547,6700,6856,7014,7174,7335,7500, - 7666,7834,8004,8177,8352,8528,8708,8889, - 9072,9258,9445,9635,9828,10022,10219,10417, - 10619,10822,11028,11235,11446,11658,11873,12090, - 12309,12530,12754,12980,13209,13440,13673,13909, - 14146,14387,14629,14874,15122,15371,15623,15878, - 16135,16394,16656,16920,17187,17456,17727,18001, - 18277,18556,18837,19121,19407,19696,19987,20281, - 20577,20876,21177,21481,21787,22096,22407,22721, - 23038,23357,23678,24002,24329,24658,24990,25325, - 25662,26001,26344,26688,27036,27386,27739,28094, - 28452,28813,29176,29542,29911,30282,30656,31033, - 31412,31794,32179,32567,32957,33350,33745,34143, - 34544,34948,35355,35764,36176,36591,37008,37429, - 37852,38278,38706,39138,39572,40009,40449,40891, - 41337,41785,42236,42690,43147,43606,44069,44534, - 45002,45473,45947,46423,46903,47385,47871,48359, - 48850,49344,49841,50341,50844,51349,51858,52369, - 52884,53401,53921,54445,54971,55500,56032,56567, - 57105,57646,58190,58737,59287,59840,60396,60955, - 61517,62082,62650,63221,63795,64372,64952,65535 -}; -#endif /* SIMPLIFIED_READ */ - -/* The base/delta tables are required for both read and write (but currently - * only the simplified versions.) - */ -const png_uint_16 png_sRGB_base[512] = -{ - 128,1782,3383,4644,5675,6564,7357,8074, - 8732,9346,9921,10463,10977,11466,11935,12384, - 12816,13233,13634,14024,14402,14769,15125,15473, - 15812,16142,16466,16781,17090,17393,17690,17981, - 18266,18546,18822,19093,19359,19621,19879,20133, - 20383,20630,20873,21113,21349,21583,21813,22041, - 22265,22487,22707,22923,23138,23350,23559,23767, - 23972,24175,24376,24575,24772,24967,25160,25352, - 25542,25730,25916,26101,26284,26465,26645,26823, - 27000,27176,27350,27523,27695,27865,28034,28201, - 28368,28533,28697,28860,29021,29182,29341,29500, - 29657,29813,29969,30123,30276,30429,30580,30730, - 30880,31028,31176,31323,31469,31614,31758,31902, - 32045,32186,32327,32468,32607,32746,32884,33021, - 33158,33294,33429,33564,33697,33831,33963,34095, - 34226,34357,34486,34616,34744,34873,35000,35127, - 35253,35379,35504,35629,35753,35876,35999,36122, - 36244,36365,36486,36606,36726,36845,36964,37083, - 37201,37318,37435,37551,37668,37783,37898,38013, - 38127,38241,38354,38467,38580,38692,38803,38915, - 39026,39136,39246,39356,39465,39574,39682,39790, - 39898,40005,40112,40219,40325,40431,40537,40642, - 40747,40851,40955,41059,41163,41266,41369,41471, - 41573,41675,41777,41878,41979,42079,42179,42279, - 42379,42478,42577,42676,42775,42873,42971,43068, - 43165,43262,43359,43456,43552,43648,43743,43839, - 43934,44028,44123,44217,44311,44405,44499,44592, - 44685,44778,44870,44962,45054,45146,45238,45329, - 45420,45511,45601,45692,45782,45872,45961,46051, - 46140,46229,46318,46406,46494,46583,46670,46758, - 46846,46933,47020,47107,47193,47280,47366,47452, - 47538,47623,47709,47794,47879,47964,48048,48133, - 48217,48301,48385,48468,48552,48635,48718,48801, - 48884,48966,49048,49131,49213,49294,49376,49458, - 49539,49620,49701,49782,49862,49943,50023,50103, - 50183,50263,50342,50422,50501,50580,50659,50738, - 50816,50895,50973,51051,51129,51207,51285,51362, - 51439,51517,51594,51671,51747,51824,51900,51977, - 52053,52129,52205,52280,52356,52432,52507,52582, - 52657,52732,52807,52881,52956,53030,53104,53178, - 53252,53326,53400,53473,53546,53620,53693,53766, - 53839,53911,53984,54056,54129,54201,54273,54345, - 54417,54489,54560,54632,54703,54774,54845,54916, - 54987,55058,55129,55199,55269,55340,55410,55480, - 55550,55620,55689,55759,55828,55898,55967,56036, - 56105,56174,56243,56311,56380,56448,56517,56585, - 56653,56721,56789,56857,56924,56992,57059,57127, - 57194,57261,57328,57395,57462,57529,57595,57662, - 57728,57795,57861,57927,57993,58059,58125,58191, - 58256,58322,58387,58453,58518,58583,58648,58713, - 58778,58843,58908,58972,59037,59101,59165,59230, - 59294,59358,59422,59486,59549,59613,59677,59740, - 59804,59867,59930,59993,60056,60119,60182,60245, - 60308,60370,60433,60495,60558,60620,60682,60744, - 60806,60868,60930,60992,61054,61115,61177,61238, - 61300,61361,61422,61483,61544,61605,61666,61727, - 61788,61848,61909,61969,62030,62090,62150,62211, - 62271,62331,62391,62450,62510,62570,62630,62689, - 62749,62808,62867,62927,62986,63045,63104,63163, - 63222,63281,63340,63398,63457,63515,63574,63632, - 63691,63749,63807,63865,63923,63981,64039,64097, - 64155,64212,64270,64328,64385,64443,64500,64557, - 64614,64672,64729,64786,64843,64900,64956,65013, - 65070,65126,65183,65239,65296,65352,65409,65465 -}; - -const png_byte png_sRGB_delta[512] = -{ - 207,201,158,129,113,100,90,82,77,72,68,64,61,59,56,54, - 52,50,49,47,46,45,43,42,41,40,39,39,38,37,36,36, - 35,34,34,33,33,32,32,31,31,30,30,30,29,29,28,28, - 28,27,27,27,27,26,26,26,25,25,25,25,24,24,24,24, - 23,23,23,23,23,22,22,22,22,22,22,21,21,21,21,21, - 21,20,20,20,20,20,20,20,20,19,19,19,19,19,19,19, - 19,18,18,18,18,18,18,18,18,18,18,17,17,17,17,17, - 17,17,17,17,17,17,16,16,16,16,16,16,16,16,16,16, - 16,16,16,16,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,14,14,14,14,14,14,14,14,14,14,14,14, - 14,14,14,14,14,14,14,13,13,13,13,13,13,13,13,13, - 13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, - 12,12,12,12,12,12,12,12,12,12,12,12,11,11,11,11, - 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, - 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, - 11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, - 10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 -}; -#endif /* SIMPLIFIED READ/WRITE sRGB support */ - -/* SIMPLIFIED READ/WRITE SUPPORT */ -#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ - defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) -static int -png_image_free_function(png_voidp argument) -{ - png_imagep image = png_voidcast(png_imagep, argument); - png_controlp cp = image->opaque; - png_control c; - - /* Double check that we have a png_ptr - it should be impossible to get here - * without one. - */ - if (cp->png_ptr == NULL) - return 0; - - /* First free any data held in the control structure. */ -# ifdef PNG_STDIO_SUPPORTED - if (cp->owned_file != 0) - { - FILE *fp = png_voidcast(FILE*, cp->png_ptr->io_ptr); - cp->owned_file = 0; - - /* Ignore errors here. */ - if (fp != NULL) - { - cp->png_ptr->io_ptr = NULL; - (void)fclose(fp); - } - } -# endif - - /* Copy the control structure so that the original, allocated, version can be - * safely freed. Notice that a png_error here stops the remainder of the - * cleanup, but this is probably fine because that would indicate bad memory - * problems anyway. - */ - c = *cp; - image->opaque = &c; - png_free(c.png_ptr, cp); - - /* Then the structures, calling the correct API. */ - if (c.for_write != 0) - { -# ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED - png_destroy_write_struct(&c.png_ptr, &c.info_ptr); -# else - png_error(c.png_ptr, "simplified write not supported"); -# endif - } - else - { -# ifdef PNG_SIMPLIFIED_READ_SUPPORTED - png_destroy_read_struct(&c.png_ptr, &c.info_ptr, NULL); -# else - png_error(c.png_ptr, "simplified read not supported"); -# endif - } - - /* Success. */ - return 1; -} - -void PNGAPI -png_image_free(png_imagep image) -{ - /* Safely call the real function, but only if doing so is safe at this point - * (if not inside an error handling context). Otherwise assume - * png_safe_execute will call this API after the return. - */ - if (image != NULL && image->opaque != NULL && - image->opaque->error_buf == NULL) - { - /* Ignore errors here: */ - (void)png_safe_execute(image, png_image_free_function, image); - image->opaque = NULL; - } -} - -int /* PRIVATE */ -png_image_error(png_imagep image, png_const_charp error_message) -{ - /* Utility to log an error. */ - png_safecat(image->message, (sizeof image->message), 0, error_message); - image->warning_or_error |= PNG_IMAGE_ERROR; - png_image_free(image); - return 0; -} - -#endif /* SIMPLIFIED READ/WRITE */ -#endif /* READ || WRITE */ diff --git a/jan/src/dep/libs/libpng/png.h b/jan/src/dep/libs/libpng/png.h deleted file mode 100644 index a03dd68f7..000000000 --- a/jan/src/dep/libs/libpng/png.h +++ /dev/null @@ -1,3260 +0,0 @@ - -/* png.h - header file for PNG reference library - * - * libpng version 1.6.28, January 5, 2017 - * - * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license (See LICENSE, below) - * - * Authors and maintainers: - * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat - * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.6.28, January 5, 2017: - * Glenn Randers-Pehrson. - * See also "Contributing Authors", below. - */ - -/* - * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: - * - * If you modify libpng you may insert additional notices immediately following - * this sentence. - * - * This code is released under the libpng license. - * - * libpng versions 1.0.7, July 1, 2000 through 1.6.28, January 5, 2017 are - * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are - * derived from libpng-1.0.6, and are distributed according to the same - * disclaimer and license as libpng-1.0.6 with the following individuals - * added to the list of Contributing Authors: - * - * Simon-Pierre Cadieux - * Eric S. Raymond - * Mans Rullgard - * Cosmin Truta - * Gilles Vollant - * James Yu - * Mandar Sahastrabuddhe - * - * and with the following additions to the disclaimer: - * - * There is no warranty against interference with your enjoyment of the - * library or against infringement. There is no warranty that our - * efforts or the library will fulfill any of your particular purposes - * or needs. This library is provided with all faults, and the entire - * risk of satisfactory quality, performance, accuracy, and effort is with - * the user. - * - * Some files in the "contrib" directory and some configure-generated - * files that are distributed with libpng have other copyright owners and - * are released under other open source licenses. - * - * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are - * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from - * libpng-0.96, and are distributed according to the same disclaimer and - * license as libpng-0.96, with the following individuals added to the list - * of Contributing Authors: - * - * Tom Lane - * Glenn Randers-Pehrson - * Willem van Schaik - * - * libpng versions 0.89, June 1996, through 0.96, May 1997, are - * Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, - * and are distributed according to the same disclaimer and license as - * libpng-0.88, with the following individuals added to the list of - * Contributing Authors: - * - * John Bowler - * Kevin Bracey - * Sam Bushell - * Magnus Holmgren - * Greg Roelofs - * Tom Tanner - * - * Some files in the "scripts" directory have other copyright owners - * but are released under this license. - * - * libpng versions 0.5, May 1995, through 0.88, January 1996, are - * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. - * - * For the purposes of this copyright and license, "Contributing Authors" - * is defined as the following set of individuals: - * - * Andreas Dilger - * Dave Martindale - * Guy Eric Schalnat - * Paul Schmidt - * Tim Wegner - * - * The PNG Reference Library is supplied "AS IS". The Contributing Authors - * and Group 42, Inc. disclaim all warranties, expressed or implied, - * including, without limitation, the warranties of merchantability and of - * fitness for any purpose. The Contributing Authors and Group 42, Inc. - * assume no liability for direct, indirect, incidental, special, exemplary, - * or consequential damages, which may result from the use of the PNG - * Reference Library, even if advised of the possibility of such damage. - * - * Permission is hereby granted to use, copy, modify, and distribute this - * source code, or portions hereof, for any purpose, without fee, subject - * to the following restrictions: - * - * 1. The origin of this source code must not be misrepresented. - * - * 2. Altered versions must be plainly marked as such and must not - * be misrepresented as being the original source. - * - * 3. This Copyright notice may not be removed or altered from any - * source or altered source distribution. - * - * The Contributing Authors and Group 42, Inc. specifically permit, without - * fee, and encourage the use of this source code as a component to - * supporting the PNG file format in commercial products. If you use this - * source code in a product, acknowledgment is not required but would be - * appreciated. - * - * END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. - * - * TRADEMARK: - * - * The name "libpng" has not been registered by the Copyright owner - * as a trademark in any jurisdiction. However, because libpng has - * been distributed and maintained world-wide, continually since 1995, - * the Copyright owner claims "common-law trademark protection" in any - * jurisdiction where common-law trademark is recognized. - * - * OSI CERTIFICATION: - * - * Libpng is OSI Certified Open Source Software. OSI Certified Open Source is - * a certification mark of the Open Source Initiative. OSI has not addressed - * the additional disclaimers inserted at version 1.0.7. - * - * EXPORT CONTROL: - * - * The Copyright owner believes that the Export Control Classification - * Number (ECCN) for libpng is EAR99, which means not subject to export - * controls or International Traffic in Arms Regulations (ITAR) because - * it is open source, publicly available software, that does not contain - * any encryption software. See the EAR, paragraphs 734.3(b)(3) and - * 734.7(b). - */ - -/* - * A "png_get_copyright" function is available, for convenient use in "about" - * boxes and the like: - * - * printf("%s", png_get_copyright(NULL)); - * - * Also, the PNG logo (in PNG format, of course) is supplied in the - * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). - */ - -/* - * The contributing authors would like to thank all those who helped - * with testing, bug fixes, and patience. This wouldn't have been - * possible without all of you. - * - * Thanks to Frank J. T. Wojcik for helping with the documentation. - */ - -/* Note about libpng version numbers: - * - * Due to various miscommunications, unforeseen code incompatibilities - * and occasional factors outside the authors' control, version numbering - * on the library has not always been consistent and straightforward. - * The following table summarizes matters since version 0.89c, which was - * the first widely used release: - * - * source png.h png.h shared-lib - * version string int version - * ------- ------ ----- ---------- - * 0.89c "1.0 beta 3" 0.89 89 1.0.89 - * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] - * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] - * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] - * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] - * 0.97c 0.97 97 2.0.97 - * 0.98 0.98 98 2.0.98 - * 0.99 0.99 98 2.0.99 - * 0.99a-m 0.99 99 2.0.99 - * 1.00 1.00 100 2.1.0 [100 should be 10000] - * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] - * 1.0.1 png.h string is 10001 2.1.0 - * 1.0.1a-e identical to the 10002 from here on, the shared library - * 1.0.2 source version) 10002 is 2.V where V is the source code - * 1.0.2a-b 10003 version, except as noted. - * 1.0.3 10003 - * 1.0.3a-d 10004 - * 1.0.4 10004 - * 1.0.4a-f 10005 - * 1.0.5 (+ 2 patches) 10005 - * 1.0.5a-d 10006 - * 1.0.5e-r 10100 (not source compatible) - * 1.0.5s-v 10006 (not binary compatible) - * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) - * 1.0.6d-f 10007 (still binary incompatible) - * 1.0.6g 10007 - * 1.0.6h 10007 10.6h (testing xy.z so-numbering) - * 1.0.6i 10007 10.6i - * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) - * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) - * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) - * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) - * 1.0.7 1 10007 (still compatible) - * ... - * 1.0.19 10 10019 10.so.0.19[.0] - * ... - * 1.2.57 13 10257 12.so.0.57[.0] - * ... - * 1.5.28 15 10527 15.so.15.28[.0] - * ... - * 1.6.28 16 10628 16.so.16.28[.0] - * - * Henceforth the source version will match the shared-library major - * and minor numbers; the shared-library major version number will be - * used for changes in backward compatibility, as it is intended. The - * PNG_LIBPNG_VER macro, which is not used within libpng but is available - * for applications, is an unsigned integer of the form xyyzz corresponding - * to the source version x.y.z (leading zeros in y and z). Beta versions - * were given the previous public release number plus a letter, until - * version 1.0.6j; from then on they were given the upcoming public - * release number plus "betaNN" or "rcNN". - * - * Binary incompatibility exists only when applications make direct access - * to the info_ptr or png_ptr members through png.h, and the compiled - * application is loaded with a different version of the library. - * - * DLLNUM will change each time there are forward or backward changes - * in binary compatibility (e.g., when a new feature is added). - * - * See libpng.txt or libpng.3 for more information. The PNG specification - * is available as a W3C Recommendation and as an ISO Specification, - * - * - * If you just need to read a PNG file and don't want to read the documentation - * skip to the end of this file and read the section entitled 'simplified API'. - */ - -/* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.6.28" -#define PNG_HEADER_VERSION_STRING " libpng version 1.6.28 - January 5, 2017\n" - -#define PNG_LIBPNG_VER_SONUM 16 -#define PNG_LIBPNG_VER_DLLNUM 16 - -/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ -#define PNG_LIBPNG_VER_MAJOR 1 -#define PNG_LIBPNG_VER_MINOR 6 -#define PNG_LIBPNG_VER_RELEASE 28 - -/* This should match the numeric part of the final component of - * PNG_LIBPNG_VER_STRING, omitting any leading zero: - */ - -#define PNG_LIBPNG_VER_BUILD 0 - -/* Release Status */ -#define PNG_LIBPNG_BUILD_ALPHA 1 -#define PNG_LIBPNG_BUILD_BETA 2 -#define PNG_LIBPNG_BUILD_RC 3 -#define PNG_LIBPNG_BUILD_STABLE 4 -#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7 - -/* Release-Specific Flags */ -#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with - PNG_LIBPNG_BUILD_STABLE only */ -#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with - PNG_LIBPNG_BUILD_SPECIAL */ -#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with - PNG_LIBPNG_BUILD_PRIVATE */ - -#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE - -/* Careful here. At one time, Guy wanted to use 082, but that would be octal. - * We must not include leading zeros. - * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only - * version 1.0.0 was mis-numbered 100 instead of 10000). From - * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release - */ -#define PNG_LIBPNG_VER 10628 /* 1.6.28 */ - -/* Library configuration: these options cannot be changed after - * the library has been built. - */ -#ifndef PNGLCONF_H -/* If pnglibconf.h is missing, you can - * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h - */ -# include "pnglibconf.h" -#endif - -#ifndef PNG_VERSION_INFO_ONLY -/* Machine specific configuration. */ -# include "pngconf.h" -#endif - -/* - * Added at libpng-1.2.8 - * - * Ref MSDN: Private as priority over Special - * VS_FF_PRIVATEBUILD File *was not* built using standard release - * procedures. If this value is given, the StringFileInfo block must - * contain a PrivateBuild string. - * - * VS_FF_SPECIALBUILD File *was* built by the original company using - * standard release procedures but is a variation of the standard - * file of the same version number. If this value is given, the - * StringFileInfo block must contain a SpecialBuild string. - */ - -#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */ -# define PNG_LIBPNG_BUILD_TYPE \ - (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE) -#else -# ifdef PNG_LIBPNG_SPECIALBUILD -# define PNG_LIBPNG_BUILD_TYPE \ - (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL) -# else -# define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE) -# endif -#endif - -#ifndef PNG_VERSION_INFO_ONLY - -/* Inhibit C++ name-mangling for libpng functions but not for system calls. */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Version information for C files, stored in png.c. This had better match - * the version above. - */ -#define png_libpng_ver png_get_header_ver(NULL) - -/* This file is arranged in several sections: - * - * 1. [omitted] - * 2. Any configuration options that can be specified by for the application - * code when it is built. (Build time configuration is in pnglibconf.h) - * 3. Type definitions (base types are defined in pngconf.h), structure - * definitions. - * 4. Exported library functions. - * 5. Simplified API. - * 6. Implementation options. - * - * The library source code has additional files (principally pngpriv.h) that - * allow configuration of the library. - */ - -/* Section 1: [omitted] */ - -/* Section 2: run time configuration - * See pnglibconf.h for build time configuration - * - * Run time configuration allows the application to choose between - * implementations of certain arithmetic APIs. The default is set - * at build time and recorded in pnglibconf.h, but it is safe to - * override these (and only these) settings. Note that this won't - * change what the library does, only application code, and the - * settings can (and probably should) be made on a per-file basis - * by setting the #defines before including png.h - * - * Use macros to read integers from PNG data or use the exported - * functions? - * PNG_USE_READ_MACROS: use the macros (see below) Note that - * the macros evaluate their argument multiple times. - * PNG_NO_USE_READ_MACROS: call the relevant library function. - * - * Use the alternative algorithm for compositing alpha samples that - * does not use division? - * PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division' - * algorithm. - * PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm. - * - * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is - * false? - * PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error - * APIs to png_warning. - * Otherwise the calls are mapped to png_error. - */ - -/* Section 3: type definitions, including structures and compile time - * constants. - * See pngconf.h for base types that vary by machine/system - */ - -/* This triggers a compiler error in png.c, if png.c and png.h - * do not agree upon the version number. - */ -typedef char* png_libpng_version_1_6_28; - -/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. - * - * png_struct is the cache of information used while reading or writing a single - * PNG file. One of these is always required, although the simplified API - * (below) hides the creation and destruction of it. - */ -typedef struct png_struct_def png_struct; -typedef const png_struct * png_const_structp; -typedef png_struct * png_structp; -typedef png_struct * * png_structpp; - -/* png_info contains information read from or to be written to a PNG file. One - * or more of these must exist while reading or creating a PNG file. The - * information is not used by libpng during read but is used to control what - * gets written when a PNG file is created. "png_get_" function calls read - * information during read and "png_set_" functions calls write information - * when creating a PNG. - * been moved into a separate header file that is not accessible to - * applications. Read libpng-manual.txt or libpng.3 for more info. - */ -typedef struct png_info_def png_info; -typedef png_info * png_infop; -typedef const png_info * png_const_infop; -typedef png_info * * png_infopp; - -/* Types with names ending 'p' are pointer types. The corresponding types with - * names ending 'rp' are identical pointer types except that the pointer is - * marked 'restrict', which means that it is the only pointer to the object - * passed to the function. Applications should not use the 'restrict' types; - * it is always valid to pass 'p' to a pointer with a function argument of the - * corresponding 'rp' type. Different compilers have different rules with - * regard to type matching in the presence of 'restrict'. For backward - * compatibility libpng callbacks never have 'restrict' in their parameters and, - * consequentially, writing portable application code is extremely difficult if - * an attempt is made to use 'restrict'. - */ -typedef png_struct * PNG_RESTRICT png_structrp; -typedef const png_struct * PNG_RESTRICT png_const_structrp; -typedef png_info * PNG_RESTRICT png_inforp; -typedef const png_info * PNG_RESTRICT png_const_inforp; - -/* Three color definitions. The order of the red, green, and blue, (and the - * exact size) is not important, although the size of the fields need to - * be png_byte or png_uint_16 (as defined below). - */ -typedef struct png_color_struct -{ - png_byte red; - png_byte green; - png_byte blue; -} png_color; -typedef png_color * png_colorp; -typedef const png_color * png_const_colorp; -typedef png_color * * png_colorpp; - -typedef struct png_color_16_struct -{ - png_byte index; /* used for palette files */ - png_uint_16 red; /* for use in red green blue files */ - png_uint_16 green; - png_uint_16 blue; - png_uint_16 gray; /* for use in grayscale files */ -} png_color_16; -typedef png_color_16 * png_color_16p; -typedef const png_color_16 * png_const_color_16p; -typedef png_color_16 * * png_color_16pp; - -typedef struct png_color_8_struct -{ - png_byte red; /* for use in red green blue files */ - png_byte green; - png_byte blue; - png_byte gray; /* for use in grayscale files */ - png_byte alpha; /* for alpha channel files */ -} png_color_8; -typedef png_color_8 * png_color_8p; -typedef const png_color_8 * png_const_color_8p; -typedef png_color_8 * * png_color_8pp; - -/* - * The following two structures are used for the in-core representation - * of sPLT chunks. - */ -typedef struct png_sPLT_entry_struct -{ - png_uint_16 red; - png_uint_16 green; - png_uint_16 blue; - png_uint_16 alpha; - png_uint_16 frequency; -} png_sPLT_entry; -typedef png_sPLT_entry * png_sPLT_entryp; -typedef const png_sPLT_entry * png_const_sPLT_entryp; -typedef png_sPLT_entry * * png_sPLT_entrypp; - -/* When the depth of the sPLT palette is 8 bits, the color and alpha samples - * occupy the LSB of their respective members, and the MSB of each member - * is zero-filled. The frequency member always occupies the full 16 bits. - */ - -typedef struct png_sPLT_struct -{ - png_charp name; /* palette name */ - png_byte depth; /* depth of palette samples */ - png_sPLT_entryp entries; /* palette entries */ - png_int_32 nentries; /* number of palette entries */ -} png_sPLT_t; -typedef png_sPLT_t * png_sPLT_tp; -typedef const png_sPLT_t * png_const_sPLT_tp; -typedef png_sPLT_t * * png_sPLT_tpp; - -#ifdef PNG_TEXT_SUPPORTED -/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, - * and whether that contents is compressed or not. The "key" field - * points to a regular zero-terminated C string. The "text" fields can be a - * regular C string, an empty string, or a NULL pointer. - * However, the structure returned by png_get_text() will always contain - * the "text" field as a regular zero-terminated C string (possibly - * empty), never a NULL pointer, so it can be safely used in printf() and - * other string-handling functions. Note that the "itxt_length", "lang", and - * "lang_key" members of the structure only exist when the library is built - * with iTXt chunk support. Prior to libpng-1.4.0 the library was built by - * default without iTXt support. Also note that when iTXt *is* supported, - * the "lang" and "lang_key" fields contain NULL pointers when the - * "compression" field contains * PNG_TEXT_COMPRESSION_NONE or - * PNG_TEXT_COMPRESSION_zTXt. Note that the "compression value" is not the - * same as what appears in the PNG tEXt/zTXt/iTXt chunk's "compression flag" - * which is always 0 or 1, or its "compression method" which is always 0. - */ -typedef struct png_text_struct -{ - int compression; /* compression value: - -1: tEXt, none - 0: zTXt, deflate - 1: iTXt, none - 2: iTXt, deflate */ - png_charp key; /* keyword, 1-79 character description of "text" */ - png_charp text; /* comment, may be an empty string (ie "") - or a NULL pointer */ - png_size_t text_length; /* length of the text string */ - png_size_t itxt_length; /* length of the itxt string */ - png_charp lang; /* language code, 0-79 characters - or a NULL pointer */ - png_charp lang_key; /* keyword translated UTF-8 string, 0 or more - chars or a NULL pointer */ -} png_text; -typedef png_text * png_textp; -typedef const png_text * png_const_textp; -typedef png_text * * png_textpp; -#endif - -/* Supported compression types for text in PNG files (tEXt, and zTXt). - * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */ -#define PNG_TEXT_COMPRESSION_NONE_WR -3 -#define PNG_TEXT_COMPRESSION_zTXt_WR -2 -#define PNG_TEXT_COMPRESSION_NONE -1 -#define PNG_TEXT_COMPRESSION_zTXt 0 -#define PNG_ITXT_COMPRESSION_NONE 1 -#define PNG_ITXT_COMPRESSION_zTXt 2 -#define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ - -/* png_time is a way to hold the time in an machine independent way. - * Two conversions are provided, both from time_t and struct tm. There - * is no portable way to convert to either of these structures, as far - * as I know. If you know of a portable way, send it to me. As a side - * note - PNG has always been Year 2000 compliant! - */ -typedef struct png_time_struct -{ - png_uint_16 year; /* full year, as in, 1995 */ - png_byte month; /* month of year, 1 - 12 */ - png_byte day; /* day of month, 1 - 31 */ - png_byte hour; /* hour of day, 0 - 23 */ - png_byte minute; /* minute of hour, 0 - 59 */ - png_byte second; /* second of minute, 0 - 60 (for leap seconds) */ -} png_time; -typedef png_time * png_timep; -typedef const png_time * png_const_timep; -typedef png_time * * png_timepp; - -#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) ||\ - defined(PNG_USER_CHUNKS_SUPPORTED) -/* png_unknown_chunk is a structure to hold queued chunks for which there is - * no specific support. The idea is that we can use this to queue - * up private chunks for output even though the library doesn't actually - * know about their semantics. - * - * The data in the structure is set by libpng on read and used on write. - */ -typedef struct png_unknown_chunk_t -{ - png_byte name[5]; /* Textual chunk name with '\0' terminator */ - png_byte *data; /* Data, should not be modified on read! */ - png_size_t size; - - /* On write 'location' must be set using the flag values listed below. - * Notice that on read it is set by libpng however the values stored have - * more bits set than are listed below. Always treat the value as a - * bitmask. On write set only one bit - setting multiple bits may cause the - * chunk to be written in multiple places. - */ - png_byte location; /* mode of operation at read time */ -} -png_unknown_chunk; - -typedef png_unknown_chunk * png_unknown_chunkp; -typedef const png_unknown_chunk * png_const_unknown_chunkp; -typedef png_unknown_chunk * * png_unknown_chunkpp; -#endif - -/* Flag values for the unknown chunk location byte. */ -#define PNG_HAVE_IHDR 0x01 -#define PNG_HAVE_PLTE 0x02 -#define PNG_AFTER_IDAT 0x08 - -/* Maximum positive integer used in PNG is (2^31)-1 */ -#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL) -#define PNG_UINT_32_MAX ((png_uint_32)(-1)) -#define PNG_SIZE_MAX ((png_size_t)(-1)) - -/* These are constants for fixed point values encoded in the - * PNG specification manner (x100000) - */ -#define PNG_FP_1 100000 -#define PNG_FP_HALF 50000 -#define PNG_FP_MAX ((png_fixed_point)0x7fffffffL) -#define PNG_FP_MIN (-PNG_FP_MAX) - -/* These describe the color_type field in png_info. */ -/* color type masks */ -#define PNG_COLOR_MASK_PALETTE 1 -#define PNG_COLOR_MASK_COLOR 2 -#define PNG_COLOR_MASK_ALPHA 4 - -/* color types. Note that not all combinations are legal */ -#define PNG_COLOR_TYPE_GRAY 0 -#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) -#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) -#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) -#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) -/* aliases */ -#define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA -#define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA - -/* This is for compression type. PNG 1.0-1.2 only define the single type. */ -#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ -#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE - -/* This is for filter type. PNG 1.0-1.2 only define the single type. */ -#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ -#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ -#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE - -/* These are for the interlacing type. These values should NOT be changed. */ -#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */ -#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */ -#define PNG_INTERLACE_LAST 2 /* Not a valid value */ - -/* These are for the oFFs chunk. These values should NOT be changed. */ -#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */ -#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ -#define PNG_OFFSET_LAST 2 /* Not a valid value */ - -/* These are for the pCAL chunk. These values should NOT be changed. */ -#define PNG_EQUATION_LINEAR 0 /* Linear transformation */ -#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */ -#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ -#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ -#define PNG_EQUATION_LAST 4 /* Not a valid value */ - -/* These are for the sCAL chunk. These values should NOT be changed. */ -#define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ -#define PNG_SCALE_METER 1 /* meters per pixel */ -#define PNG_SCALE_RADIAN 2 /* radians per pixel */ -#define PNG_SCALE_LAST 3 /* Not a valid value */ - -/* These are for the pHYs chunk. These values should NOT be changed. */ -#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ -#define PNG_RESOLUTION_METER 1 /* pixels/meter */ -#define PNG_RESOLUTION_LAST 2 /* Not a valid value */ - -/* These are for the sRGB chunk. These values should NOT be changed. */ -#define PNG_sRGB_INTENT_PERCEPTUAL 0 -#define PNG_sRGB_INTENT_RELATIVE 1 -#define PNG_sRGB_INTENT_SATURATION 2 -#define PNG_sRGB_INTENT_ABSOLUTE 3 -#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ - -/* This is for text chunks */ -#define PNG_KEYWORD_MAX_LENGTH 79 - -/* Maximum number of entries in PLTE/sPLT/tRNS arrays */ -#define PNG_MAX_PALETTE_LENGTH 256 - -/* These determine if an ancillary chunk's data has been successfully read - * from the PNG header, or if the application has filled in the corresponding - * data in the info_struct to be written into the output file. The values - * of the PNG_INFO_ defines should NOT be changed. - */ -#define PNG_INFO_gAMA 0x0001U -#define PNG_INFO_sBIT 0x0002U -#define PNG_INFO_cHRM 0x0004U -#define PNG_INFO_PLTE 0x0008U -#define PNG_INFO_tRNS 0x0010U -#define PNG_INFO_bKGD 0x0020U -#define PNG_INFO_hIST 0x0040U -#define PNG_INFO_pHYs 0x0080U -#define PNG_INFO_oFFs 0x0100U -#define PNG_INFO_tIME 0x0200U -#define PNG_INFO_pCAL 0x0400U -#define PNG_INFO_sRGB 0x0800U /* GR-P, 0.96a */ -#define PNG_INFO_iCCP 0x1000U /* ESR, 1.0.6 */ -#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */ -#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */ -#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */ - -/* This is used for the transformation routines, as some of them - * change these values for the row. It also should enable using - * the routines for other purposes. - */ -typedef struct png_row_info_struct -{ - png_uint_32 width; /* width of row */ - png_size_t rowbytes; /* number of bytes in row */ - png_byte color_type; /* color type of row */ - png_byte bit_depth; /* bit depth of row */ - png_byte channels; /* number of channels (1, 2, 3, or 4) */ - png_byte pixel_depth; /* bits per pixel (depth * channels) */ -} png_row_info; - -typedef png_row_info * png_row_infop; -typedef png_row_info * * png_row_infopp; - -/* These are the function types for the I/O functions and for the functions - * that allow the user to override the default I/O functions with his or her - * own. The png_error_ptr type should match that of user-supplied warning - * and error functions, while the png_rw_ptr type should match that of the - * user read/write data functions. Note that the 'write' function must not - * modify the buffer it is passed. The 'read' function, on the other hand, is - * expected to return the read data in the buffer. - */ -typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp)); -typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t)); -typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp)); -typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32, - int)); -typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32, - int)); - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); -typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); - -/* The following callback receives png_uint_32 row_number, int pass for the - * png_bytep data of the row. When transforming an interlaced image the - * row number is the row number within the sub-image of the interlace pass, so - * the value will increase to the height of the sub-image (not the full image) - * then reset to 0 for the next pass. - * - * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to - * find the output pixel (x,y) given an interlaced sub-image pixel - * (row,col,pass). (See below for these macros.) - */ -typedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep, - png_uint_32, int)); -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -typedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop, - png_bytep)); -#endif - -#ifdef PNG_USER_CHUNKS_SUPPORTED -typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp, - png_unknown_chunkp)); -#endif -#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED -/* not used anywhere */ -/* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */ -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* This must match the function definition in , and the application - * must include this before png.h to obtain the definition of jmp_buf. The - * function is required to be PNG_NORETURN, but this is not checked. If the - * function does return the application will crash via an abort() or similar - * system level call. - * - * If you get a warning here while building the library you may need to make - * changes to ensure that pnglibconf.h records the calling convention used by - * your compiler. This may be very difficult - try using a different compiler - * to build the library! - */ -PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef); -#endif - -/* Transform masks for the high-level interface */ -#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ -#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ -#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ -#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ -#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ -#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ -#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ -#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ -#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ -#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ -#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ -#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ -#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only */ -/* Added to libpng-1.2.34 */ -#define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER -#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ -/* Added to libpng-1.4.0 */ -#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ -/* Added to libpng-1.5.4 */ -#define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ -#if INT_MAX >= 0x8000 /* else this might break */ -#define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ -#endif - -/* Flags for MNG supported features */ -#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 -#define PNG_FLAG_MNG_FILTER_64 0x04 -#define PNG_ALL_MNG_FEATURES 0x05 - -/* NOTE: prior to 1.5 these functions had no 'API' style declaration, - * this allowed the zlib default functions to be used on Windows - * platforms. In 1.5 the zlib default malloc (which just calls malloc and - * ignores the first argument) should be completely compatible with the - * following. - */ -typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp, - png_alloc_size_t)); -typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp)); - -/* Section 4: exported functions - * Here are the function definitions most commonly used. This is not - * the place to find out how to use libpng. See libpng-manual.txt for the - * full explanation, see example.c for the summary. This just provides - * a simple one line description of the use of each function. - * - * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in - * pngconf.h and in the *.dfn files in the scripts directory. - * - * PNG_EXPORT(ordinal, type, name, (args)); - * - * ordinal: ordinal that is used while building - * *.def files. The ordinal value is only - * relevant when preprocessing png.h with - * the *.dfn files for building symbol table - * entries, and are removed by pngconf.h. - * type: return type of the function - * name: function name - * args: function arguments, with types - * - * When we wish to append attributes to a function prototype we use - * the PNG_EXPORTA() macro instead. - * - * PNG_EXPORTA(ordinal, type, name, (args), attributes); - * - * ordinal, type, name, and args: same as in PNG_EXPORT(). - * attributes: function attributes - */ - -/* Returns the version number of the library */ -PNG_EXPORT(1, png_uint_32, png_access_version_number, (void)); - -/* Tell lib we have already handled the first magic bytes. - * Handling more than 8 bytes from the beginning of the file is an error. - */ -PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes)); - -/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a - * PNG file. Returns zero if the supplied bytes match the 8-byte PNG - * signature, and non-zero otherwise. Having num_to_check == 0 or - * start > 7 will always fail (ie return non-zero). - */ -PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start, - png_size_t num_to_check)); - -/* Simple signature checking function. This is the same as calling - * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). - */ -#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n)) - -/* Allocate and initialize png_ptr struct for reading, and any other memory. */ -PNG_EXPORTA(4, png_structp, png_create_read_struct, - (png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn), - PNG_ALLOCATED); - -/* Allocate and initialize png_ptr struct for writing, and any other memory */ -PNG_EXPORTA(5, png_structp, png_create_write_struct, - (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, - png_error_ptr warn_fn), - PNG_ALLOCATED); - -PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size, - (png_const_structrp png_ptr)); - -PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr, - png_size_t size)); - -/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp - * match up. - */ -#ifdef PNG_SETJMP_SUPPORTED -/* This function returns the jmp_buf built in to *png_ptr. It must be - * supplied with an appropriate 'longjmp' function to use on that jmp_buf - * unless the default error function is overridden in which case NULL is - * acceptable. The size of the jmp_buf is checked against the actual size - * allocated by the library - the call will return NULL on a mismatch - * indicating an ABI mismatch. - */ -PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr, - png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)); -# define png_jmpbuf(png_ptr) \ - (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf)))) -#else -# define png_jmpbuf(png_ptr) \ - (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) -#endif -/* This function should be used by libpng applications in place of - * longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it - * will use it; otherwise it will call PNG_ABORT(). This function was - * added in libpng-1.5.0. - */ -PNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val), - PNG_NORETURN); - -#ifdef PNG_READ_SUPPORTED -/* Reset the compression stream */ -PNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED); -#endif - -/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ -#ifdef PNG_USER_MEM_SUPPORTED -PNG_EXPORTA(11, png_structp, png_create_read_struct_2, - (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, - png_error_ptr warn_fn, - png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), - PNG_ALLOCATED); -PNG_EXPORTA(12, png_structp, png_create_write_struct_2, - (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, - png_error_ptr warn_fn, - png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), - PNG_ALLOCATED); -#endif - -/* Write the PNG file signature. */ -PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr)); - -/* Write a PNG chunk - size, type, (optional) data, CRC. */ -PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep - chunk_name, png_const_bytep data, png_size_t length)); - -/* Write the start of a PNG chunk - length and chunk name. */ -PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr, - png_const_bytep chunk_name, png_uint_32 length)); - -/* Write the data of a PNG chunk started with png_write_chunk_start(). */ -PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr, - png_const_bytep data, png_size_t length)); - -/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ -PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr)); - -/* Allocate and initialize the info structure */ -PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr), - PNG_ALLOCATED); - -/* DEPRECATED: this function allowed init structures to be created using the - * default allocation method (typically malloc). Use is deprecated in 1.6.0 and - * the API will be removed in the future. - */ -PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr, - png_size_t png_info_struct_size), PNG_DEPRECATED); - -/* Writes all the PNG information before the image. */ -PNG_EXPORT(20, void, png_write_info_before_PLTE, - (png_structrp png_ptr, png_const_inforp info_ptr)); -PNG_EXPORT(21, void, png_write_info, - (png_structrp png_ptr, png_const_inforp info_ptr)); - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Read the information before the actual image data. */ -PNG_EXPORT(22, void, png_read_info, - (png_structrp png_ptr, png_inforp info_ptr)); -#endif - -#ifdef PNG_TIME_RFC1123_SUPPORTED - /* Convert to a US string format: there is no localization support in this - * routine. The original implementation used a 29 character buffer in - * png_struct, this will be removed in future versions. - */ -#if PNG_LIBPNG_VER < 10700 -/* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */ -PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr, - png_const_timep ptime),PNG_DEPRECATED); -#endif -PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29], - png_const_timep ptime)); -#endif - -#ifdef PNG_CONVERT_tIME_SUPPORTED -/* Convert from a struct tm to png_time */ -PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime, - const struct tm * ttime)); - -/* Convert from time_t to png_time. Uses gmtime() */ -PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime)); -#endif /* CONVERT_tIME */ - -#ifdef PNG_READ_EXPAND_SUPPORTED -/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ -PNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr)); -PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr)); -PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr)); -PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr)); -#endif - -#ifdef PNG_READ_EXPAND_16_SUPPORTED -/* Expand to 16-bit channels, forces conversion of palette to RGB and expansion - * of a tRNS chunk if present. - */ -PNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr)); -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* Use blue, green, red order for pixels. */ -PNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr)); -#endif - -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED -/* Expand the grayscale to 24-bit RGB if necessary. */ -PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr)); -#endif - -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED -/* Reduce RGB to grayscale. */ -#define PNG_ERROR_ACTION_NONE 1 -#define PNG_ERROR_ACTION_WARN 2 -#define PNG_ERROR_ACTION_ERROR 3 -#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ - -PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr, - int error_action, double red, double green)) -PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr, - int error_action, png_fixed_point red, png_fixed_point green)) - -PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp - png_ptr)); -#endif - -#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED -PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth, - png_colorp palette)); -#endif - -#ifdef PNG_READ_ALPHA_MODE_SUPPORTED -/* How the alpha channel is interpreted - this affects how the color channels - * of a PNG file are returned to the calling application when an alpha channel, - * or a tRNS chunk in a palette file, is present. - * - * This has no effect on the way pixels are written into a PNG output - * datastream. The color samples in a PNG datastream are never premultiplied - * with the alpha samples. - * - * The default is to return data according to the PNG specification: the alpha - * channel is a linear measure of the contribution of the pixel to the - * corresponding composited pixel, and the color channels are unassociated - * (not premultiplied). The gamma encoded color channels must be scaled - * according to the contribution and to do this it is necessary to undo - * the encoding, scale the color values, perform the composition and reencode - * the values. This is the 'PNG' mode. - * - * The alternative is to 'associate' the alpha with the color information by - * storing color channel values that have been scaled by the alpha. - * image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes - * (the latter being the two common names for associated alpha color channels). - * - * For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha - * value is equal to the maximum value. - * - * The final choice is to gamma encode the alpha channel as well. This is - * broken because, in practice, no implementation that uses this choice - * correctly undoes the encoding before handling alpha composition. Use this - * choice only if other serious errors in the software or hardware you use - * mandate it; the typical serious error is for dark halos to appear around - * opaque areas of the composited PNG image because of arithmetic overflow. - * - * The API function png_set_alpha_mode specifies which of these choices to use - * with an enumerated 'mode' value and the gamma of the required output: - */ -#define PNG_ALPHA_PNG 0 /* according to the PNG standard */ -#define PNG_ALPHA_STANDARD 1 /* according to Porter/Duff */ -#define PNG_ALPHA_ASSOCIATED 1 /* as above; this is the normal practice */ -#define PNG_ALPHA_PREMULTIPLIED 1 /* as above */ -#define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ -#define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ - -PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode, - double output_gamma)) -PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr, - int mode, png_fixed_point output_gamma)) -#endif - -#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) -/* The output_gamma value is a screen gamma in libpng terminology: it expresses - * how to decode the output values, not how they are encoded. - */ -#define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */ -#define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */ -#define PNG_GAMMA_sRGB 220000 /* Television standards--matches sRGB gamma */ -#define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */ -#endif - -/* The following are examples of calls to png_set_alpha_mode to achieve the - * required overall gamma correction and, where necessary, alpha - * premultiplication. - * - * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); - * This is the default libpng handling of the alpha channel - it is not - * pre-multiplied into the color components. In addition the call states - * that the output is for a sRGB system and causes all PNG files without gAMA - * chunks to be assumed to be encoded using sRGB. - * - * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); - * In this case the output is assumed to be something like an sRGB conformant - * display preceeded by a power-law lookup table of power 1.45. This is how - * early Mac systems behaved. - * - * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); - * This is the classic Jim Blinn approach and will work in academic - * environments where everything is done by the book. It has the shortcoming - * of assuming that input PNG data with no gamma information is linear - this - * is unlikely to be correct unless the PNG files where generated locally. - * Most of the time the output precision will be so low as to show - * significant banding in dark areas of the image. - * - * png_set_expand_16(pp); - * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB); - * This is a somewhat more realistic Jim Blinn inspired approach. PNG files - * are assumed to have the sRGB encoding if not marked with a gamma value and - * the output is always 16 bits per component. This permits accurate scaling - * and processing of the data. If you know that your input PNG files were - * generated locally you might need to replace PNG_DEFAULT_sRGB with the - * correct value for your system. - * - * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB); - * If you just need to composite the PNG image onto an existing background - * and if you control the code that does this you can use the optimization - * setting. In this case you just copy completely opaque pixels to the - * output. For pixels that are not completely transparent (you just skip - * those) you do the composition math using png_composite or png_composite_16 - * below then encode the resultant 8-bit or 16-bit values to match the output - * encoding. - * - * Other cases - * If neither the PNG nor the standard linear encoding work for you because - * of the software or hardware you use then you have a big problem. The PNG - * case will probably result in halos around the image. The linear encoding - * will probably result in a washed out, too bright, image (it's actually too - * contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably - * substantially reduce the halos. Alternatively try: - * - * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB); - * This option will also reduce the halos, but there will be slight dark - * halos round the opaque parts of the image where the background is light. - * In the OPTIMIZED mode the halos will be light halos where the background - * is dark. Take your pick - the halos are unavoidable unless you can get - * your hardware/software fixed! (The OPTIMIZED approach is slightly - * faster.) - * - * When the default gamma of PNG files doesn't match the output gamma. - * If you have PNG files with no gamma information png_set_alpha_mode allows - * you to provide a default gamma, but it also sets the ouput gamma to the - * matching value. If you know your PNG files have a gamma that doesn't - * match the output you can take advantage of the fact that - * png_set_alpha_mode always sets the output gamma but only sets the PNG - * default if it is not already set: - * - * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); - * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); - * The first call sets both the default and the output gamma values, the - * second call overrides the output gamma without changing the default. This - * is easier than achieving the same effect with png_set_gamma. You must use - * PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will - * fire if more than one call to png_set_alpha_mode and png_set_background is - * made in the same read operation, however multiple calls with PNG_ALPHA_PNG - * are ignored. - */ - -#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED -PNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr)); -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -PNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr)); -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr)); -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -/* Add a filler byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ -PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler, - int flags)); -/* The values of the PNG_FILLER_ defines should NOT be changed */ -# define PNG_FILLER_BEFORE 0 -# define PNG_FILLER_AFTER 1 -/* Add an alpha byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ -PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, - png_uint_32 filler, int flags)); -#endif /* READ_FILLER || WRITE_FILLER */ - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* Swap bytes in 16-bit depth files. */ -PNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr)); -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) -/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ -PNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr)); -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ - defined(PNG_WRITE_PACKSWAP_SUPPORTED) -/* Swap packing order of pixels in bytes. */ -PNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr)); -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) -/* Converts files to legal bit depths. */ -PNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p - true_bits)); -#endif - -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) -/* Have the code handle the interlacing. Returns the number of passes. - * MUST be called before png_read_update_info or png_start_read_image, - * otherwise it will not have the desired effect. Note that it is still - * necessary to call png_read_row or png_read_rows png_get_image_height - * times for each pass. -*/ -PNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr)); -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -/* Invert monochrome files */ -PNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr)); -#endif - -#ifdef PNG_READ_BACKGROUND_SUPPORTED -/* Handle alpha and tRNS by replacing with a background color. Prior to - * libpng-1.5.4 this API must not be called before the PNG file header has been - * read. Doing so will result in unexpected behavior and possible warnings or - * errors if the PNG file contains a bKGD chunk. - */ -PNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr, - png_const_color_16p background_color, int background_gamma_code, - int need_expand, double background_gamma)) -PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr, - png_const_color_16p background_color, int background_gamma_code, - int need_expand, png_fixed_point background_gamma)) -#endif -#ifdef PNG_READ_BACKGROUND_SUPPORTED -# define PNG_BACKGROUND_GAMMA_UNKNOWN 0 -# define PNG_BACKGROUND_GAMMA_SCREEN 1 -# define PNG_BACKGROUND_GAMMA_FILE 2 -# define PNG_BACKGROUND_GAMMA_UNIQUE 3 -#endif - -#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED -/* Scale a 16-bit depth file down to 8-bit, accurately. */ -PNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr)); -#endif - -#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED -#define PNG_READ_16_TO_8_SUPPORTED /* Name prior to 1.5.4 */ -/* Strip the second byte of information from a 16-bit depth file. */ -PNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr)); -#endif - -#ifdef PNG_READ_QUANTIZE_SUPPORTED -/* Turn on quantizing, and reduce the palette to the number of colors - * available. - */ -PNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr, - png_colorp palette, int num_palette, int maximum_colors, - png_const_uint_16p histogram, int full_quantize)); -#endif - -#ifdef PNG_READ_GAMMA_SUPPORTED -/* The threshold on gamma processing is configurable but hard-wired into the - * library. The following is the floating point variant. - */ -#define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001) - -/* Handle gamma correction. Screen_gamma=(display_exponent). - * NOTE: this API simply sets the screen and file gamma values. It will - * therefore override the value for gamma in a PNG file if it is called after - * the file header has been read - use with care - call before reading the PNG - * file for best results! - * - * These routines accept the same gamma values as png_set_alpha_mode (described - * above). The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either - * API (floating point or fixed.) Notice, however, that the 'file_gamma' value - * is the inverse of a 'screen gamma' value. - */ -PNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr, - double screen_gamma, double override_file_gamma)) -PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr, - png_fixed_point screen_gamma, png_fixed_point override_file_gamma)) -#endif - -#ifdef PNG_WRITE_FLUSH_SUPPORTED -/* Set how many lines between output flushes - 0 for no flushing */ -PNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows)); -/* Flush the current PNG output buffer */ -PNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr)); -#endif - -/* Optional update palette with requested transformations */ -PNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr)); - -/* Optional call to update the users info structure */ -PNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr, - png_inforp info_ptr)); - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Read one or more rows of image data. */ -PNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row, - png_bytepp display_row, png_uint_32 num_rows)); -#endif - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Read a row of data. */ -PNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row, - png_bytep display_row)); -#endif - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Read the whole image into memory at once. */ -PNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image)); -#endif - -/* Write a row of image data */ -PNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr, - png_const_bytep row)); - -/* Write a few rows of image data: (*row) is not written; however, the type - * is declared as writeable to maintain compatibility with previous versions - * of libpng and to allow the 'display_row' array from read_rows to be passed - * unchanged to write_rows. - */ -PNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row, - png_uint_32 num_rows)); - -/* Write the image data */ -PNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image)); - -/* Write the end of the PNG file. */ -PNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr, - png_inforp info_ptr)); - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Read the end of the PNG file. */ -PNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr)); -#endif - -/* Free any memory associated with the png_info_struct */ -PNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr, - png_infopp info_ptr_ptr)); - -/* Free any memory associated with the png_struct and the png_info_structs */ -PNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr, - png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); - -/* Free any memory associated with the png_struct and the png_info_structs */ -PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr, - png_infopp info_ptr_ptr)); - -/* Set the libpng method of handling chunk CRC errors */ -PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, - int ancil_action)); - -/* Values for png_set_crc_action() say how to handle CRC errors in - * ancillary and critical chunks, and whether to use the data contained - * therein. Note that it is impossible to "discard" data in a critical - * chunk. For versions prior to 0.90, the action was always error/quit, - * whereas in version 0.90 and later, the action for CRC errors in ancillary - * chunks is warn/discard. These values should NOT be changed. - * - * value action:critical action:ancillary - */ -#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ -#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ -#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ -#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ -#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ -#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ - -#ifdef PNG_WRITE_SUPPORTED -/* These functions give the user control over the scan-line filtering in - * libpng and the compression methods used by zlib. These functions are - * mainly useful for testing, as the defaults should work with most users. - * Those users who are tight on memory or want faster performance at the - * expense of compression can modify them. See the compression library - * header file (zlib.h) for an explination of the compression functions. - */ - -/* Set the filtering method(s) used by libpng. Currently, the only valid - * value for "method" is 0. - */ -PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, - int filters)); -#endif /* WRITE */ - -/* Flags for png_set_filter() to say which filters to use. The flags - * are chosen so that they don't conflict with real filter types - * below, in case they are supplied instead of the #defined constants. - * These values should NOT be changed. - */ -#define PNG_NO_FILTERS 0x00 -#define PNG_FILTER_NONE 0x08 -#define PNG_FILTER_SUB 0x10 -#define PNG_FILTER_UP 0x20 -#define PNG_FILTER_AVG 0x40 -#define PNG_FILTER_PAETH 0x80 -#define PNG_FAST_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP) -#define PNG_ALL_FILTERS (PNG_FAST_FILTERS | PNG_FILTER_AVG | PNG_FILTER_PAETH) - -/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. - * These defines should NOT be changed. - */ -#define PNG_FILTER_VALUE_NONE 0 -#define PNG_FILTER_VALUE_SUB 1 -#define PNG_FILTER_VALUE_UP 2 -#define PNG_FILTER_VALUE_AVG 3 -#define PNG_FILTER_VALUE_PAETH 4 -#define PNG_FILTER_VALUE_LAST 5 - -#ifdef PNG_WRITE_SUPPORTED -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */ -PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr, - int heuristic_method, int num_weights, png_const_doublep filter_weights, - png_const_doublep filter_costs)) -PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, - (png_structrp png_ptr, int heuristic_method, int num_weights, - png_const_fixed_point_p filter_weights, - png_const_fixed_point_p filter_costs)) -#endif /* WRITE_WEIGHTED_FILTER */ - -/* The following are no longer used and will be removed from libpng-1.7: */ -#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ -#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ -#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ -#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ - -/* Set the library compression level. Currently, valid values range from - * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 - * (0 - no compression, 9 - "maximal" compression). Note that tests have - * shown that zlib compression levels 3-6 usually perform as well as level 9 - * for PNG images, and do considerably fewer caclulations. In the future, - * these values may not correspond directly to the zlib compression levels. - */ -#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED -PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr, - int level)); - -PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr, - int mem_level)); - -PNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr, - int strategy)); - -/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a - * smaller value of window_bits if it can do so safely. - */ -PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr, - int window_bits)); - -PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr, - int method)); -#endif /* WRITE_CUSTOMIZE_COMPRESSION */ - -#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED -/* Also set zlib parameters for compressing non-IDAT chunks */ -PNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr, - int level)); - -PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr, - int mem_level)); - -PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr, - int strategy)); - -/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a - * smaller value of window_bits if it can do so safely. - */ -PNG_EXPORT(225, void, png_set_text_compression_window_bits, - (png_structrp png_ptr, int window_bits)); - -PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr, - int method)); -#endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */ -#endif /* WRITE */ - -/* These next functions are called for input/output, memory, and error - * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, - * and call standard C I/O routines such as fread(), fwrite(), and - * fprintf(). These functions can be made to use other I/O routines - * at run time for those applications that need to handle I/O in a - * different manner by calling png_set_???_fn(). See libpng-manual.txt for - * more information. - */ - -#ifdef PNG_STDIO_SUPPORTED -/* Initialize the input/output for the PNG file to the default functions. */ -PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp)); -#endif - -/* Replace the (error and abort), and warning functions with user - * supplied functions. If no messages are to be printed you must still - * write and use replacement functions. The replacement error_fn should - * still do a longjmp to the last setjmp location if you are using this - * method of error handling. If error_fn or warning_fn is NULL, the - * default function will be used. - */ - -PNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr, - png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); - -/* Return the user pointer associated with the error functions */ -PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr)); - -/* Replace the default data output functions with a user supplied one(s). - * If buffered output is not used, then output_flush_fn can be set to NULL. - * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time - * output_flush_fn will be ignored (and thus can be NULL). - * It is probably a mistake to use NULL for output_flush_fn if - * write_data_fn is not also NULL unless you have built libpng with - * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's - * default flush function, which uses the standard *FILE structure, will - * be used. - */ -PNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr, - png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); - -/* Replace the default data input function with a user supplied one. */ -PNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr, - png_rw_ptr read_data_fn)); - -/* Return the user pointer associated with the I/O functions */ -PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr)); - -PNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr, - png_read_status_ptr read_row_fn)); - -PNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr, - png_write_status_ptr write_row_fn)); - -#ifdef PNG_USER_MEM_SUPPORTED -/* Replace the default memory allocation functions with user supplied one(s). */ -PNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn)); -/* Return the user pointer associated with the memory functions */ -PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr)); -#endif - -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED -PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr, - png_user_transform_ptr read_user_transform_fn)); -#endif - -#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED -PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr, - png_user_transform_ptr write_user_transform_fn)); -#endif - -#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED -PNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr, - png_voidp user_transform_ptr, int user_transform_depth, - int user_transform_channels)); -/* Return the user pointer associated with the user transform functions */ -PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr, - (png_const_structrp png_ptr)); -#endif - -#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED -/* Return information about the row currently being processed. Note that these - * APIs do not fail but will return unexpected results if called outside a user - * transform callback. Also note that when transforming an interlaced image the - * row number is the row number within the sub-image of the interlace pass, so - * the value will increase to the height of the sub-image (not the full image) - * then reset to 0 for the next pass. - * - * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to - * find the output pixel (x,y) given an interlaced sub-image pixel - * (row,col,pass). (See below for these macros.) - */ -PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp)); -PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp)); -#endif - -#ifdef PNG_READ_USER_CHUNKS_SUPPORTED -/* This callback is called only for *unknown* chunks. If - * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known - * chunks to be treated as unknown, however in this case the callback must do - * any processing required by the chunk (e.g. by calling the appropriate - * png_set_ APIs.) - * - * There is no write support - on write, by default, all the chunks in the - * 'unknown' list are written in the specified position. - * - * The integer return from the callback function is interpreted thus: - * - * negative: An error occurred; png_chunk_error will be called. - * zero: The chunk was not handled, the chunk will be saved. A critical - * chunk will cause an error at this point unless it is to be saved. - * positive: The chunk was handled, libpng will ignore/discard it. - * - * See "INTERACTION WTIH USER CHUNK CALLBACKS" below for important notes about - * how this behavior will change in libpng 1.7 - */ -PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr, - png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); -#endif - -#ifdef PNG_USER_CHUNKS_SUPPORTED -PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr)); -#endif - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -/* Sets the function callbacks for the push reader, and a pointer to a - * user-defined structure available to the callback functions. - */ -PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr, - png_voidp progressive_ptr, png_progressive_info_ptr info_fn, - png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn)); - -/* Returns the user pointer associated with the push read functions */ -PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, - (png_const_structrp png_ptr)); - -/* Function to be called when data becomes available */ -PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr, - png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size)); - -/* A function which may be called *only* within png_process_data to stop the - * processing of any more data. The function returns the number of bytes - * remaining, excluding any that libpng has cached internally. A subsequent - * call to png_process_data must supply these bytes again. If the argument - * 'save' is set to true the routine will first save all the pending data and - * will always return 0. - */ -PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save)); - -/* A function which may be called *only* outside (after) a call to - * png_process_data. It returns the number of bytes of data to skip in the - * input. Normally it will return 0, but if it returns a non-zero value the - * application must skip than number of bytes of input data and pass the - * following data to the next call to png_process_data. - */ -PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp)); - -/* Function that combines rows. 'new_row' is a flag that should come from - * the callback and be non-NULL if anything needs to be done; the library - * stores its own version of the new data internally and ignores the passed - * in value. - */ -PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr, - png_bytep old_row, png_const_bytep new_row)); -#endif /* PROGRESSIVE_READ */ - -PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr, - png_alloc_size_t size), PNG_ALLOCATED); -/* Added at libpng version 1.4.0 */ -PNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr, - png_alloc_size_t size), PNG_ALLOCATED); - -/* Added at libpng version 1.2.4 */ -PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr, - png_alloc_size_t size), PNG_ALLOCATED); - -/* Frees a pointer allocated by png_malloc() */ -PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr)); - -/* Free data that was allocated internally */ -PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr, - png_inforp info_ptr, png_uint_32 free_me, int num)); - -/* Reassign responsibility for freeing existing data, whether allocated - * by libpng or by the application; this works on the png_info structure passed - * in, it does not change the state for other png_info structures. - * - * It is unlikely that this function works correctly as of 1.6.0 and using it - * may result either in memory leaks or double free of allocated data. - */ -PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr, - png_inforp info_ptr, int freer, png_uint_32 mask)); - -/* Assignments for png_data_freer */ -#define PNG_DESTROY_WILL_FREE_DATA 1 -#define PNG_SET_WILL_FREE_DATA 1 -#define PNG_USER_WILL_FREE_DATA 2 -/* Flags for png_ptr->free_me and info_ptr->free_me */ -#define PNG_FREE_HIST 0x0008U -#define PNG_FREE_ICCP 0x0010U -#define PNG_FREE_SPLT 0x0020U -#define PNG_FREE_ROWS 0x0040U -#define PNG_FREE_PCAL 0x0080U -#define PNG_FREE_SCAL 0x0100U -#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_FREE_UNKN 0x0200U -#endif -/* PNG_FREE_LIST 0x0400U removed in 1.6.0 because it is ignored */ -#define PNG_FREE_PLTE 0x1000U -#define PNG_FREE_TRNS 0x2000U -#define PNG_FREE_TEXT 0x4000U -#define PNG_FREE_ALL 0x7fffU -#define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ - -#ifdef PNG_USER_MEM_SUPPORTED -PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr, - png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED); -PNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr, - png_voidp ptr), PNG_DEPRECATED); -#endif - -#ifdef PNG_ERROR_TEXT_SUPPORTED -/* Fatal error in PNG image of libpng - can't continue */ -PNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr, - png_const_charp error_message), PNG_NORETURN); - -/* The same, but the chunk name is prepended to the error string. */ -PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr, - png_const_charp error_message), PNG_NORETURN); - -#else -/* Fatal error in PNG image of libpng - can't continue */ -PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN); -# define png_error(s1,s2) png_err(s1) -# define png_chunk_error(s1,s2) png_err(s1) -#endif - -#ifdef PNG_WARNINGS_SUPPORTED -/* Non-fatal error in libpng. Can continue, but may have a problem. */ -PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr, - png_const_charp warning_message)); - -/* Non-fatal error in libpng, chunk name is prepended to message. */ -PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr, - png_const_charp warning_message)); -#else -# define png_warning(s1,s2) ((void)(s1)) -# define png_chunk_warning(s1,s2) ((void)(s1)) -#endif - -#ifdef PNG_BENIGN_ERRORS_SUPPORTED -/* Benign error in libpng. Can continue, but may have a problem. - * User can choose whether to handle as a fatal error or as a warning. */ -PNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr, - png_const_charp warning_message)); - -#ifdef PNG_READ_SUPPORTED -/* Same, chunk name is prepended to message (only during read) */ -PNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr, - png_const_charp warning_message)); -#endif - -PNG_EXPORT(109, void, png_set_benign_errors, - (png_structrp png_ptr, int allowed)); -#else -# ifdef PNG_ALLOW_BENIGN_ERRORS -# define png_benign_error png_warning -# define png_chunk_benign_error png_chunk_warning -# else -# define png_benign_error png_error -# define png_chunk_benign_error png_chunk_error -# endif -#endif - -/* The png_set_ functions are for storing values in the png_info_struct. - * Similarly, the png_get_ calls are used to read values from the - * png_info_struct, either storing the parameters in the passed variables, or - * setting pointers into the png_info_struct where the data is stored. The - * png_get_ functions return a non-zero value if the data was available - * in info_ptr, or return zero and do not change any of the parameters if the - * data was not available. - * - * These functions should be used instead of directly accessing png_info - * to avoid problems with future changes in the size and internal layout of - * png_info_struct. - */ -/* Returns "flag" if chunk data is valid in info_ptr. */ -PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr, - png_const_inforp info_ptr, png_uint_32 flag)); - -/* Returns number of bytes needed to hold a transformed row. */ -PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -#ifdef PNG_INFO_IMAGE_SUPPORTED -/* Returns row_pointers, which is an array of pointers to scanlines that was - * returned from png_read_png(). - */ -PNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -/* Set row_pointers, which is an array of pointers to scanlines for use - * by png_write_png(). - */ -PNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr, - png_inforp info_ptr, png_bytepp row_pointers)); -#endif - -/* Returns number of color channels in image. */ -PNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -#ifdef PNG_EASY_ACCESS_SUPPORTED -/* Returns image width in pixels. */ -PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -/* Returns image height in pixels. */ -PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -/* Returns image bit_depth. */ -PNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -/* Returns image color_type. */ -PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -/* Returns image filter_type. */ -PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -/* Returns image interlace_type. */ -PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -/* Returns image compression_type. */ -PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); - -/* Returns image resolution in pixels per meter, from pHYs chunk data. */ -PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); -PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); -PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); - -/* Returns pixel aspect ratio, computed from pHYs chunk data. */ -PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio, - (png_const_structrp png_ptr, png_const_inforp info_ptr)) -PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed, - (png_const_structrp png_ptr, png_const_inforp info_ptr)) - -/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ -PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); -PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); -PNG_EXPORT(128, png_int_32, png_get_x_offset_microns, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); -PNG_EXPORT(129, png_int_32, png_get_y_offset_microns, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); - -#endif /* EASY_ACCESS */ - -#ifdef PNG_READ_SUPPORTED -/* Returns pointer to signature string read from PNG header */ -PNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr, - png_const_inforp info_ptr)); -#endif - -#ifdef PNG_bKGD_SUPPORTED -PNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr, - png_inforp info_ptr, png_color_16p *background)); -#endif - -#ifdef PNG_bKGD_SUPPORTED -PNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr, - png_inforp info_ptr, png_const_color_16p background)); -#endif - -#ifdef PNG_cHRM_SUPPORTED -PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr, - png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x, - double *red_y, double *green_x, double *green_y, double *blue_x, - double *blue_y)) -PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr, - png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z, - double *green_X, double *green_Y, double *green_Z, double *blue_X, - double *blue_Y, double *blue_Z)) -PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, - (png_const_structrp png_ptr, png_const_inforp info_ptr, - png_fixed_point *int_white_x, png_fixed_point *int_white_y, - png_fixed_point *int_red_x, png_fixed_point *int_red_y, - png_fixed_point *int_green_x, png_fixed_point *int_green_y, - png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)) -PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, - (png_const_structrp png_ptr, png_const_inforp info_ptr, - png_fixed_point *int_red_X, png_fixed_point *int_red_Y, - png_fixed_point *int_red_Z, png_fixed_point *int_green_X, - png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, - png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, - png_fixed_point *int_blue_Z)) -#endif - -#ifdef PNG_cHRM_SUPPORTED -PNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr, - png_inforp info_ptr, - double white_x, double white_y, double red_x, double red_y, double green_x, - double green_y, double blue_x, double blue_y)) -PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr, - png_inforp info_ptr, double red_X, double red_Y, double red_Z, - double green_X, double green_Y, double green_Z, double blue_X, - double blue_Y, double blue_Z)) -PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr, - png_inforp info_ptr, png_fixed_point int_white_x, - png_fixed_point int_white_y, png_fixed_point int_red_x, - png_fixed_point int_red_y, png_fixed_point int_green_x, - png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)) -PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr, - png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y, - png_fixed_point int_red_Z, png_fixed_point int_green_X, - png_fixed_point int_green_Y, png_fixed_point int_green_Z, - png_fixed_point int_blue_X, png_fixed_point int_blue_Y, - png_fixed_point int_blue_Z)) -#endif - -#ifdef PNG_gAMA_SUPPORTED -PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr, - png_const_inforp info_ptr, double *file_gamma)) -PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed, - (png_const_structrp png_ptr, png_const_inforp info_ptr, - png_fixed_point *int_file_gamma)) -#endif - -#ifdef PNG_gAMA_SUPPORTED -PNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr, - png_inforp info_ptr, double file_gamma)) -PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr, - png_inforp info_ptr, png_fixed_point int_file_gamma)) -#endif - -#ifdef PNG_hIST_SUPPORTED -PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr, - png_inforp info_ptr, png_uint_16p *hist)); -#endif - -#ifdef PNG_hIST_SUPPORTED -PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr, - png_inforp info_ptr, png_const_uint_16p hist)); -#endif - -PNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr, - png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height, - int *bit_depth, int *color_type, int *interlace_method, - int *compression_method, int *filter_method)); - -PNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr, - png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, - int color_type, int interlace_method, int compression_method, - int filter_method)); - -#ifdef PNG_oFFs_SUPPORTED -PNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr, - png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, - int *unit_type)); -#endif - -#ifdef PNG_oFFs_SUPPORTED -PNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr, - png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y, - int unit_type)); -#endif - -#ifdef PNG_pCAL_SUPPORTED -PNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr, - png_inforp info_ptr, png_charp *purpose, png_int_32 *X0, - png_int_32 *X1, int *type, int *nparams, png_charp *units, - png_charpp *params)); -#endif - -#ifdef PNG_pCAL_SUPPORTED -PNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr, - png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1, - int type, int nparams, png_const_charp units, png_charpp params)); -#endif - -#ifdef PNG_pHYs_SUPPORTED -PNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr, - png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, - int *unit_type)); -#endif - -#ifdef PNG_pHYs_SUPPORTED -PNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr, - png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); -#endif - -PNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr, - png_inforp info_ptr, png_colorp *palette, int *num_palette)); - -PNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr, - png_inforp info_ptr, png_const_colorp palette, int num_palette)); - -#ifdef PNG_sBIT_SUPPORTED -PNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr, - png_inforp info_ptr, png_color_8p *sig_bit)); -#endif - -#ifdef PNG_sBIT_SUPPORTED -PNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr, - png_inforp info_ptr, png_const_color_8p sig_bit)); -#endif - -#ifdef PNG_sRGB_SUPPORTED -PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr, - png_const_inforp info_ptr, int *file_srgb_intent)); -#endif - -#ifdef PNG_sRGB_SUPPORTED -PNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr, - png_inforp info_ptr, int srgb_intent)); -PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr, - png_inforp info_ptr, int srgb_intent)); -#endif - -#ifdef PNG_iCCP_SUPPORTED -PNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr, - png_inforp info_ptr, png_charpp name, int *compression_type, - png_bytepp profile, png_uint_32 *proflen)); -#endif - -#ifdef PNG_iCCP_SUPPORTED -PNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr, - png_inforp info_ptr, png_const_charp name, int compression_type, - png_const_bytep profile, png_uint_32 proflen)); -#endif - -#ifdef PNG_sPLT_SUPPORTED -PNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr, - png_inforp info_ptr, png_sPLT_tpp entries)); -#endif - -#ifdef PNG_sPLT_SUPPORTED -PNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr, - png_inforp info_ptr, png_const_sPLT_tp entries, int nentries)); -#endif - -#ifdef PNG_TEXT_SUPPORTED -/* png_get_text also returns the number of text chunks in *num_text */ -PNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr, - png_inforp info_ptr, png_textp *text_ptr, int *num_text)); -#endif - -/* Note while png_set_text() will accept a structure whose text, - * language, and translated keywords are NULL pointers, the structure - * returned by png_get_text will always contain regular - * zero-terminated C strings. They might be empty strings but - * they will never be NULL pointers. - */ - -#ifdef PNG_TEXT_SUPPORTED -PNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr, - png_inforp info_ptr, png_const_textp text_ptr, int num_text)); -#endif - -#ifdef PNG_tIME_SUPPORTED -PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr, - png_inforp info_ptr, png_timep *mod_time)); -#endif - -#ifdef PNG_tIME_SUPPORTED -PNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr, - png_inforp info_ptr, png_const_timep mod_time)); -#endif - -#ifdef PNG_tRNS_SUPPORTED -PNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr, - png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans, - png_color_16p *trans_color)); -#endif - -#ifdef PNG_tRNS_SUPPORTED -PNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr, - png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans, - png_const_color_16p trans_color)); -#endif - -#ifdef PNG_sCAL_SUPPORTED -PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr, - png_const_inforp info_ptr, int *unit, double *width, double *height)) -#if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \ - defined(PNG_FLOATING_POINT_SUPPORTED) -/* NOTE: this API is currently implemented using floating point arithmetic, - * consequently it can only be used on systems with floating point support. - * In any case the range of values supported by png_fixed_point is small and it - * is highly recommended that png_get_sCAL_s be used instead. - */ -PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed, - (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, - png_fixed_point *width, png_fixed_point *height)) -#endif -PNG_EXPORT(169, png_uint_32, png_get_sCAL_s, - (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, - png_charpp swidth, png_charpp sheight)); - -PNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr, - png_inforp info_ptr, int unit, double width, double height)) -PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr, - png_inforp info_ptr, int unit, png_fixed_point width, - png_fixed_point height)) -PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr, - png_inforp info_ptr, int unit, - png_const_charp swidth, png_const_charp sheight)); -#endif /* sCAL */ - -#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED -/* Provide the default handling for all unknown chunks or, optionally, for - * specific unknown chunks. - * - * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was - * ignored and the default was used, the per-chunk setting only had an effect on - * write. If you wish to have chunk-specific handling on read in code that must - * work on earlier versions you must use a user chunk callback to specify the - * desired handling (keep or discard.) - * - * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below. The - * parameter is interpreted as follows: - * - * READ: - * PNG_HANDLE_CHUNK_AS_DEFAULT: - * Known chunks: do normal libpng processing, do not keep the chunk (but - * see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED) - * Unknown chunks: for a specific chunk use the global default, when used - * as the default discard the chunk data. - * PNG_HANDLE_CHUNK_NEVER: - * Discard the chunk data. - * PNG_HANDLE_CHUNK_IF_SAFE: - * Keep the chunk data if the chunk is not critical else raise a chunk - * error. - * PNG_HANDLE_CHUNK_ALWAYS: - * Keep the chunk data. - * - * If the chunk data is saved it can be retrieved using png_get_unknown_chunks, - * below. Notice that specifying "AS_DEFAULT" as a global default is equivalent - * to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks - * it simply resets the behavior to the libpng default. - * - * INTERACTION WTIH USER CHUNK CALLBACKS: - * The per-chunk handling is always used when there is a png_user_chunk_ptr - * callback and the callback returns 0; the chunk is then always stored *unless* - * it is critical and the per-chunk setting is other than ALWAYS. Notice that - * the global default is *not* used in this case. (In effect the per-chunk - * value is incremented to at least IF_SAFE.) - * - * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and - * per-chunk defaults will be honored. If you want to preserve the current - * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE - * as the default - if you don't do this libpng 1.6 will issue a warning. - * - * If you want unhandled unknown chunks to be discarded in libpng 1.6 and - * earlier simply return '1' (handled). - * - * PNG_HANDLE_AS_UNKNOWN_SUPPORTED: - * If this is *not* set known chunks will always be handled by libpng and - * will never be stored in the unknown chunk list. Known chunks listed to - * png_set_keep_unknown_chunks will have no effect. If it is set then known - * chunks listed with a keep other than AS_DEFAULT will *never* be processed - * by libpng, in addition critical chunks must either be processed by the - * callback or saved. - * - * The IHDR and IEND chunks must not be listed. Because this turns off the - * default handling for chunks that would otherwise be recognized the - * behavior of libpng transformations may well become incorrect! - * - * WRITE: - * When writing chunks the options only apply to the chunks specified by - * png_set_unknown_chunks (below), libpng will *always* write known chunks - * required by png_set_ calls and will always write the core critical chunks - * (as required for PLTE). - * - * Each chunk in the png_set_unknown_chunks list is looked up in the - * png_set_keep_unknown_chunks list to find the keep setting, this is then - * interpreted as follows: - * - * PNG_HANDLE_CHUNK_AS_DEFAULT: - * Write safe-to-copy chunks and write other chunks if the global - * default is set to _ALWAYS, otherwise don't write this chunk. - * PNG_HANDLE_CHUNK_NEVER: - * Do not write the chunk. - * PNG_HANDLE_CHUNK_IF_SAFE: - * Write the chunk if it is safe-to-copy, otherwise do not write it. - * PNG_HANDLE_CHUNK_ALWAYS: - * Write the chunk. - * - * Note that the default behavior is effectively the opposite of the read case - - * in read unknown chunks are not stored by default, in write they are written - * by default. Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different - * - on write the safe-to-copy bit is checked, on read the critical bit is - * checked and on read if the chunk is critical an error will be raised. - * - * num_chunks: - * =========== - * If num_chunks is positive, then the "keep" parameter specifies the manner - * for handling only those chunks appearing in the chunk_list array, - * otherwise the chunk list array is ignored. - * - * If num_chunks is 0 the "keep" parameter specifies the default behavior for - * unknown chunks, as described above. - * - * If num_chunks is negative, then the "keep" parameter specifies the manner - * for handling all unknown chunks plus all chunks recognized by libpng - * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to - * be processed by libpng. - */ -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr, - int keep, png_const_bytep chunk_list, int num_chunks)); -#endif /* HANDLE_AS_UNKNOWN */ - -/* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; - * the result is therefore true (non-zero) if special handling is required, - * false for the default handling. - */ -PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr, - png_const_bytep chunk_name)); -#endif /* SET_UNKNOWN_CHUNKS */ - -#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED -PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr, - png_inforp info_ptr, png_const_unknown_chunkp unknowns, - int num_unknowns)); - /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added - * unknowns to the location currently stored in the png_struct. This is - * invariably the wrong value on write. To fix this call the following API - * for each chunk in the list with the correct location. If you know your - * code won't be compiled on earlier versions you can rely on - * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing - * the correct thing. - */ - -PNG_EXPORT(175, void, png_set_unknown_chunk_location, - (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location)); - -PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr, - png_inforp info_ptr, png_unknown_chunkpp entries)); -#endif - -/* Png_free_data() will turn off the "valid" flag for anything it frees. - * If you need to turn it off for a chunk that your application has freed, - * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); - */ -PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr, - png_inforp info_ptr, int mask)); - -#ifdef PNG_INFO_IMAGE_SUPPORTED -/* The "params" pointer is currently not used and is for future expansion. */ -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr, - int transforms, png_voidp params)); -#endif -#ifdef PNG_WRITE_SUPPORTED -PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr, - int transforms, png_voidp params)); -#endif -#endif - -PNG_EXPORT(180, png_const_charp, png_get_copyright, - (png_const_structrp png_ptr)); -PNG_EXPORT(181, png_const_charp, png_get_header_ver, - (png_const_structrp png_ptr)); -PNG_EXPORT(182, png_const_charp, png_get_header_version, - (png_const_structrp png_ptr)); -PNG_EXPORT(183, png_const_charp, png_get_libpng_ver, - (png_const_structrp png_ptr)); - -#ifdef PNG_MNG_FEATURES_SUPPORTED -PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr, - png_uint_32 mng_features_permitted)); -#endif - -/* For use in png_set_keep_unknown, added to version 1.2.6 */ -#define PNG_HANDLE_CHUNK_AS_DEFAULT 0 -#define PNG_HANDLE_CHUNK_NEVER 1 -#define PNG_HANDLE_CHUNK_IF_SAFE 2 -#define PNG_HANDLE_CHUNK_ALWAYS 3 -#define PNG_HANDLE_CHUNK_LAST 4 - -/* Strip the prepended error numbers ("#nnn ") from error and warning - * messages before passing them to the error or warning handler. - */ -#ifdef PNG_ERROR_NUMBERS_SUPPORTED -PNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr, - png_uint_32 strip_mode)); -#endif - -/* Added in libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED -PNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr, - png_uint_32 user_width_max, png_uint_32 user_height_max)); -PNG_EXPORT(187, png_uint_32, png_get_user_width_max, - (png_const_structrp png_ptr)); -PNG_EXPORT(188, png_uint_32, png_get_user_height_max, - (png_const_structrp png_ptr)); -/* Added in libpng-1.4.0 */ -PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr, - png_uint_32 user_chunk_cache_max)); -PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max, - (png_const_structrp png_ptr)); -/* Added in libpng-1.4.1 */ -PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr, - png_alloc_size_t user_chunk_cache_max)); -PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max, - (png_const_structrp png_ptr)); -#endif - -#if defined(PNG_INCH_CONVERSIONS_SUPPORTED) -PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); - -PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); - -PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch, - (png_const_structrp png_ptr, png_const_inforp info_ptr)); - -PNG_FP_EXPORT(196, float, png_get_x_offset_inches, - (png_const_structrp png_ptr, png_const_inforp info_ptr)) -#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ -PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed, - (png_const_structrp png_ptr, png_const_inforp info_ptr)) -#endif - -PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr, - png_const_inforp info_ptr)) -#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ -PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, - (png_const_structrp png_ptr, png_const_inforp info_ptr)) -#endif - -# ifdef PNG_pHYs_SUPPORTED -PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr, - png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, - int *unit_type)); -# endif /* pHYs */ -#endif /* INCH_CONVERSIONS */ - -/* Added in libpng-1.4.0 */ -#ifdef PNG_IO_STATE_SUPPORTED -PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr)); - -/* Removed from libpng 1.6; use png_get_io_chunk_type. */ -PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr), - PNG_DEPRECATED) - -PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, - (png_const_structrp png_ptr)); - -/* The flags returned by png_get_io_state() are the following: */ -# define PNG_IO_NONE 0x0000 /* no I/O at this moment */ -# define PNG_IO_READING 0x0001 /* currently reading */ -# define PNG_IO_WRITING 0x0002 /* currently writing */ -# define PNG_IO_SIGNATURE 0x0010 /* currently at the file signature */ -# define PNG_IO_CHUNK_HDR 0x0020 /* currently at the chunk header */ -# define PNG_IO_CHUNK_DATA 0x0040 /* currently at the chunk data */ -# define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */ -# define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */ -# define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */ -#endif /* IO_STATE */ - -/* Interlace support. The following macros are always defined so that if - * libpng interlace handling is turned off the macros may be used to handle - * interlaced images within the application. - */ -#define PNG_INTERLACE_ADAM7_PASSES 7 - -/* Two macros to return the first row and first column of the original, - * full, image which appears in a given pass. 'pass' is in the range 0 - * to 6 and the result is in the range 0 to 7. - */ -#define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7) -#define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7) - -/* A macro to return the offset between pixels in the output row for a pair of - * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that - * follows. Note that ROW_OFFSET is the offset from one row to the next whereas - * COL_OFFSET is from one column to the next, within a row. - */ -#define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8) -#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1)) - -/* Two macros to help evaluate the number of rows or columns in each - * pass. This is expressed as a shift - effectively log2 of the number or - * rows or columns in each 8x8 tile of the original image. - */ -#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) -#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) - -/* Hence two macros to determine the number of rows or columns in a given - * pass of an image given its height or width. In fact these macros may - * return non-zero even though the sub-image is empty, because the other - * dimension may be empty for a small image. - */ -#define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) -#define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) - -/* For the reader row callbacks (both progressive and sequential) it is - * necessary to find the row in the output image given a row in an interlaced - * image, so two more macros: - */ -#define PNG_ROW_FROM_PASS_ROW(y_in, pass) \ - (((y_in)<>(((7-(off))-(pass))<<2)) & 0xF) | \ - ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0)) - -#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ - ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) -#define PNG_COL_IN_INTERLACE_PASS(x, pass) \ - ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) - -#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED -/* With these routines we avoid an integer divide, which will be slower on - * most machines. However, it does take more operations than the corresponding - * divide method, so it may be slower on a few RISC systems. There are two - * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. - * - * Note that the rounding factors are NOT supposed to be the same! 128 and - * 32768 are correct for the NODIV code; 127 and 32767 are correct for the - * standard method. - * - * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] - */ - - /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ - -# define png_composite(composite, fg, alpha, bg) \ - { \ - png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ - * (png_uint_16)(alpha) \ - + (png_uint_16)(bg)*(png_uint_16)(255 \ - - (png_uint_16)(alpha)) + 128); \ - (composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); \ - } - -# define png_composite_16(composite, fg, alpha, bg) \ - { \ - png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ - * (png_uint_32)(alpha) \ - + (png_uint_32)(bg)*(65535 \ - - (png_uint_32)(alpha)) + 32768); \ - (composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); \ - } - -#else /* Standard method using integer division */ - -# define png_composite(composite, fg, alpha, bg) \ - (composite) = \ - (png_byte)(0xff & (((png_uint_16)(fg) * (png_uint_16)(alpha) + \ - (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ - 127) / 255)) - -# define png_composite_16(composite, fg, alpha, bg) \ - (composite) = \ - (png_uint_16)(0xffff & (((png_uint_32)(fg) * (png_uint_32)(alpha) + \ - (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ - 32767) / 65535)) -#endif /* READ_COMPOSITE_NODIV */ - -#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED -PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf)); -PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf)); -PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf)); -#endif - -PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr, - png_const_bytep buf)); -/* No png_get_int_16 -- may be added if there's a real need for it. */ - -/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */ -#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED -PNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i)); -#endif -#ifdef PNG_SAVE_INT_32_SUPPORTED -PNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i)); -#endif - -/* Place a 16-bit number into a buffer in PNG byte order. - * The parameter is declared unsigned int, not png_uint_16, - * just to avoid potential problems on pre-ANSI C compilers. - */ -#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED -PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); -/* No png_save_int_16 -- may be added if there's a real need for it. */ -#endif - -#ifdef PNG_USE_READ_MACROS -/* Inline macros to do direct reads of bytes from the input buffer. - * The png_get_int_32() routine assumes we are using two's complement - * format for negative values, which is almost certainly true. - */ -# define PNG_get_uint_32(buf) \ - (((png_uint_32)(*(buf)) << 24) + \ - ((png_uint_32)(*((buf) + 1)) << 16) + \ - ((png_uint_32)(*((buf) + 2)) << 8) + \ - ((png_uint_32)(*((buf) + 3)))) - - /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the - * function) incorrectly returned a value of type png_uint_32. - */ -# define PNG_get_uint_16(buf) \ - ((png_uint_16) \ - (((unsigned int)(*(buf)) << 8) + \ - ((unsigned int)(*((buf) + 1))))) - -# define PNG_get_int_32(buf) \ - ((png_int_32)((*(buf) & 0x80) \ - ? -((png_int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \ - : (png_int_32)png_get_uint_32(buf))) - -/* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, - * but defining a macro name prefixed with PNG_PREFIX. - */ -# ifndef PNG_PREFIX -# define png_get_uint_32(buf) PNG_get_uint_32(buf) -# define png_get_uint_16(buf) PNG_get_uint_16(buf) -# define png_get_int_32(buf) PNG_get_int_32(buf) -# endif -#else -# ifdef PNG_PREFIX - /* No macros; revert to the (redefined) function */ -# define PNG_get_uint_32 (png_get_uint_32) -# define PNG_get_uint_16 (png_get_uint_16) -# define PNG_get_int_32 (png_get_int_32) -# endif -#endif - -#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED -PNG_EXPORT(242, void, png_set_check_for_invalid_index, - (png_structrp png_ptr, int allowed)); -# ifdef PNG_GET_PALETTE_MAX_SUPPORTED -PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, - png_const_infop info_ptr)); -# endif -#endif /* CHECK_FOR_INVALID_INDEX */ - -/******************************************************************************* - * Section 5: SIMPLIFIED API - ******************************************************************************* - * - * Please read the documentation in libpng-manual.txt (TODO: write said - * documentation) if you don't understand what follows. - * - * The simplified API hides the details of both libpng and the PNG file format - * itself. It allows PNG files to be read into a very limited number of - * in-memory bitmap formats or to be written from the same formats. If these - * formats do not accomodate your needs then you can, and should, use the more - * sophisticated APIs above - these support a wide variety of in-memory formats - * and a wide variety of sophisticated transformations to those formats as well - * as a wide variety of APIs to manipulate ancillary information. - * - * To read a PNG file using the simplified API: - * - * 1) Declare a 'png_image' structure (see below) on the stack, set the - * version field to PNG_IMAGE_VERSION and the 'opaque' pointer to NULL - * (this is REQUIRED, your program may crash if you don't do it.) - * 2) Call the appropriate png_image_begin_read... function. - * 3) Set the png_image 'format' member to the required sample format. - * 4) Allocate a buffer for the image and, if required, the color-map. - * 5) Call png_image_finish_read to read the image and, if required, the - * color-map into your buffers. - * - * There are no restrictions on the format of the PNG input itself; all valid - * color types, bit depths, and interlace methods are acceptable, and the - * input image is transformed as necessary to the requested in-memory format - * during the png_image_finish_read() step. The only caveat is that if you - * request a color-mapped image from a PNG that is full-color or makes - * complex use of an alpha channel the transformation is extremely lossy and the - * result may look terrible. - * - * To write a PNG file using the simplified API: - * - * 1) Declare a 'png_image' structure on the stack and memset() it to all zero. - * 2) Initialize the members of the structure that describe the image, setting - * the 'format' member to the format of the image samples. - * 3) Call the appropriate png_image_write... function with a pointer to the - * image and, if necessary, the color-map to write the PNG data. - * - * png_image is a structure that describes the in-memory format of an image - * when it is being read or defines the in-memory format of an image that you - * need to write: - */ -#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \ - defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) - -#define PNG_IMAGE_VERSION 1 - -typedef struct png_control *png_controlp; -typedef struct -{ - png_controlp opaque; /* Initialize to NULL, free with png_image_free */ - png_uint_32 version; /* Set to PNG_IMAGE_VERSION */ - png_uint_32 width; /* Image width in pixels (columns) */ - png_uint_32 height; /* Image height in pixels (rows) */ - png_uint_32 format; /* Image format as defined below */ - png_uint_32 flags; /* A bit mask containing informational flags */ - png_uint_32 colormap_entries; - /* Number of entries in the color-map */ - - /* In the event of an error or warning the following field will be set to a - * non-zero value and the 'message' field will contain a '\0' terminated - * string with the libpng error or warning message. If both warnings and - * an error were encountered, only the error is recorded. If there - * are multiple warnings, only the first one is recorded. - * - * The upper 30 bits of this value are reserved, the low two bits contain - * a value as follows: - */ -# define PNG_IMAGE_WARNING 1 -# define PNG_IMAGE_ERROR 2 - /* - * The result is a two-bit code such that a value more than 1 indicates - * a failure in the API just called: - * - * 0 - no warning or error - * 1 - warning - * 2 - error - * 3 - error preceded by warning - */ -# define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1) - - png_uint_32 warning_or_error; - - char message[64]; -} png_image, *png_imagep; - -/* The samples of the image have one to four channels whose components have - * original values in the range 0 to 1.0: - * - * 1: A single gray or luminance channel (G). - * 2: A gray/luminance channel and an alpha channel (GA). - * 3: Three red, green, blue color channels (RGB). - * 4: Three color channels and an alpha channel (RGBA). - * - * The components are encoded in one of two ways: - * - * a) As a small integer, value 0..255, contained in a single byte. For the - * alpha channel the original value is simply value/255. For the color or - * luminance channels the value is encoded according to the sRGB specification - * and matches the 8-bit format expected by typical display devices. - * - * The color/gray channels are not scaled (pre-multiplied) by the alpha - * channel and are suitable for passing to color management software. - * - * b) As a value in the range 0..65535, contained in a 2-byte integer. All - * channels can be converted to the original value by dividing by 65535; all - * channels are linear. Color channels use the RGB encoding (RGB end-points) of - * the sRGB specification. This encoding is identified by the - * PNG_FORMAT_FLAG_LINEAR flag below. - * - * When the simplified API needs to convert between sRGB and linear colorspaces, - * the actual sRGB transfer curve defined in the sRGB specification (see the - * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 - * approximation used elsewhere in libpng. - * - * When an alpha channel is present it is expected to denote pixel coverage - * of the color or luminance channels and is returned as an associated alpha - * channel: the color/gray channels are scaled (pre-multiplied) by the alpha - * value. - * - * The samples are either contained directly in the image data, between 1 and 8 - * bytes per pixel according to the encoding, or are held in a color-map indexed - * by bytes in the image data. In the case of a color-map the color-map entries - * are individual samples, encoded as above, and the image data has one byte per - * pixel to select the relevant sample from the color-map. - */ - -/* PNG_FORMAT_* - * - * #defines to be used in png_image::format. Each #define identifies a - * particular layout of sample data and, if present, alpha values. There are - * separate defines for each of the two component encodings. - * - * A format is built up using single bit flag values. All combinations are - * valid. Formats can be built up from the flag values or you can use one of - * the predefined values below. When testing formats always use the FORMAT_FLAG - * macros to test for individual features - future versions of the library may - * add new flags. - * - * When reading or writing color-mapped images the format should be set to the - * format of the entries in the color-map then png_image_{read,write}_colormap - * called to read or write the color-map and set the format correctly for the - * image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! - * - * NOTE: libpng can be built with particular features disabled. If you see - * compiler errors because the definition of one of the following flags has been - * compiled out it is because libpng does not have the required support. It is - * possible, however, for the libpng configuration to enable the format on just - * read or just write; in that case you may see an error at run time. You can - * guard against this by checking for the definition of the appropriate - * "_SUPPORTED" macro, one of: - * - * PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED - */ -#define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ -#define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ -#define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2-byte channels else 1-byte */ -#define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ - -#ifdef PNG_FORMAT_BGR_SUPPORTED -# define PNG_FORMAT_FLAG_BGR 0x10U /* BGR colors, else order is RGB */ -#endif - -#ifdef PNG_FORMAT_AFIRST_SUPPORTED -# define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */ -#endif - -/* Commonly used formats have predefined macros. - * - * First the single byte (sRGB) formats: - */ -#define PNG_FORMAT_GRAY 0 -#define PNG_FORMAT_GA PNG_FORMAT_FLAG_ALPHA -#define PNG_FORMAT_AG (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST) -#define PNG_FORMAT_RGB PNG_FORMAT_FLAG_COLOR -#define PNG_FORMAT_BGR (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR) -#define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA) -#define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST) -#define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA) -#define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST) - -/* Then the linear 2-byte formats. When naming these "Y" is used to - * indicate a luminance (gray) channel. - */ -#define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR -#define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA) -#define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR) -#define PNG_FORMAT_LINEAR_RGB_ALPHA \ - (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA) - -/* With color-mapped formats the image data is one byte for each pixel, the byte - * is an index into the color-map which is formatted as above. To obtain a - * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP - * to one of the above definitions, or you can use one of the definitions below. - */ -#define PNG_FORMAT_RGB_COLORMAP (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP) -#define PNG_FORMAT_BGR_COLORMAP (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP) -#define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP) -#define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP) -#define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP) -#define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP) - -/* PNG_IMAGE macros - * - * These are convenience macros to derive information from a png_image - * structure. The PNG_IMAGE_SAMPLE_ macros return values appropriate to the - * actual image sample values - either the entries in the color-map or the - * pixels in the image. The PNG_IMAGE_PIXEL_ macros return corresponding values - * for the pixels and will always return 1 for color-mapped formats. The - * remaining macros return information about the rows in the image and the - * complete image. - * - * NOTE: All the macros that take a png_image::format parameter are compile time - * constants if the format parameter is, itself, a constant. Therefore these - * macros can be used in array declarations and case labels where required. - * Similarly the macros are also pre-processor constants (sizeof is not used) so - * they can be used in #if tests. - * - * First the information about the samples. - */ -#define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\ - (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1) - /* Return the total number of channels in a given format: 1..4 */ - -#define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\ - ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1) - /* Return the size in bytes of a single component of a pixel or color-map - * entry (as appropriate) in the image: 1 or 2. - */ - -#define PNG_IMAGE_SAMPLE_SIZE(fmt)\ - (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)) - /* This is the size of the sample data for one sample. If the image is - * color-mapped it is the size of one color-map entry (and image pixels are - * one byte in size), otherwise it is the size of one image pixel. - */ - -#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\ - (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256) - /* The maximum size of the color-map required by the format expressed in a - * count of components. This can be used to compile-time allocate a - * color-map: - * - * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)]; - * - * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)]; - * - * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the - * information from one of the png_image_begin_read_ APIs and dynamically - * allocate the required memory. - */ - -/* Corresponding information about the pixels */ -#define PNG_IMAGE_PIXEL_(test,fmt)\ - (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt)) - -#define PNG_IMAGE_PIXEL_CHANNELS(fmt)\ - PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt) - /* The number of separate channels (components) in a pixel; 1 for a - * color-mapped image. - */ - -#define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\ - PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt) - /* The size, in bytes, of each component in a pixel; 1 for a color-mapped - * image. - */ - -#define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt) - /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */ - -/* Information about the whole row, or whole image */ -#define PNG_IMAGE_ROW_STRIDE(image)\ - (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width) - /* Return the total number of components in a single row of the image; this - * is the minimum 'row stride', the minimum count of components between each - * row. For a color-mapped image this is the minimum number of bytes in a - * row. - * - * WARNING: this macro overflows for some images with more than one component - * and very large image widths. libpng will refuse to process an image where - * this macro would overflow. - */ - -#define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\ - (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride)) - /* Return the size, in bytes, of an image buffer given a png_image and a row - * stride - the number of components to leave space for in each row. - * - * WARNING: this macro overflows a 32-bit integer for some large PNG images, - * libpng will refuse to process an image where such an overflow would occur. - */ - -#define PNG_IMAGE_SIZE(image)\ - PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image)) - /* Return the size, in bytes, of the image in memory given just a png_image; - * the row stride is the minimum stride required for the image. - */ - -#define PNG_IMAGE_COLORMAP_SIZE(image)\ - (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries) - /* Return the size, in bytes, of the color-map of this image. If the image - * format is not a color-map format this will return a size sufficient for - * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if - * you don't want to allocate a color-map in this case. - */ - -/* PNG_IMAGE_FLAG_* - * - * Flags containing additional information about the image are held in the - * 'flags' field of png_image. - */ -#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01 - /* This indicates the the RGB values of the in-memory bitmap do not - * correspond to the red, green and blue end-points defined by sRGB. - */ - -#define PNG_IMAGE_FLAG_FAST 0x02 - /* On write emphasise speed over compression; the resultant PNG file will be - * larger but will be produced significantly faster, particular for large - * images. Do not use this option for images which will be distributed, only - * used it when producing intermediate files that will be read back in - * repeatedly. For a typical 24-bit image the option will double the read - * speed at the cost of increasing the image size by 25%, however for many - * more compressible images the PNG file can be 10 times larger with only a - * slight speed gain. - */ - -#define PNG_IMAGE_FLAG_16BIT_sRGB 0x04 - /* On read if the image is a 16-bit per component image and there is no gAMA - * or sRGB chunk assume that the components are sRGB encoded. Notice that - * images output by the simplified API always have gamma information; setting - * this flag only affects the interpretation of 16-bit images from an - * external source. It is recommended that the application expose this flag - * to the user; the user can normally easily recognize the difference between - * linear and sRGB encoding. This flag has no effect on write - the data - * passed to the write APIs must have the correct encoding (as defined - * above.) - * - * If the flag is not set (the default) input 16-bit per component data is - * assumed to be linear. - * - * NOTE: the flag can only be set after the png_image_begin_read_ call, - * because that call initializes the 'flags' field. - */ - -#ifdef PNG_SIMPLIFIED_READ_SUPPORTED -/* READ APIs - * --------- - * - * The png_image passed to the read APIs must have been initialized by setting - * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.) - */ -#ifdef PNG_STDIO_SUPPORTED -PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image, - const char *file_name)); - /* The named file is opened for read and the image header is filled in - * from the PNG header in the file. - */ - -PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image, - FILE* file)); - /* The PNG header is read from the stdio FILE object. */ -#endif /* STDIO */ - -PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image, - png_const_voidp memory, png_size_t size)); - /* The PNG header is read from the given memory buffer. */ - -PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image, - png_const_colorp background, void *buffer, png_int_32 row_stride, - void *colormap)); - /* Finish reading the image into the supplied buffer and clean up the - * png_image structure. - * - * row_stride is the step, in byte or 2-byte units as appropriate, - * between adjacent rows. A positive stride indicates that the top-most row - * is first in the buffer - the normal top-down arrangement. A negative - * stride indicates that the bottom-most row is first in the buffer. - * - * background need only be supplied if an alpha channel must be removed from - * a png_byte format and the removal is to be done by compositing on a solid - * color; otherwise it may be NULL and any composition will be done directly - * onto the buffer. The value is an sRGB color to use for the background, - * for grayscale output the green channel is used. - * - * background must be supplied when an alpha channel must be removed from a - * single byte color-mapped output format, in other words if: - * - * 1) The original format from png_image_begin_read_from_* had - * PNG_FORMAT_FLAG_ALPHA set. - * 2) The format set by the application does not. - * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and - * PNG_FORMAT_FLAG_LINEAR *not* set. - * - * For linear output removing the alpha channel is always done by compositing - * on black and background is ignored. - * - * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set. It must - * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE. - * image->colormap_entries will be updated to the actual number of entries - * written to the colormap; this may be less than the original value. - */ - -PNG_EXPORT(238, void, png_image_free, (png_imagep image)); - /* Free any data allocated by libpng in image->opaque, setting the pointer to - * NULL. May be called at any time after the structure is initialized. - */ -#endif /* SIMPLIFIED_READ */ - -#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED -/* WRITE APIS - * ---------- - * For write you must initialize a png_image structure to describe the image to - * be written. To do this use memset to set the whole structure to 0 then - * initialize fields describing your image. - * - * version: must be set to PNG_IMAGE_VERSION - * opaque: must be initialized to NULL - * width: image width in pixels - * height: image height in rows - * format: the format of the data (image and color-map) you wish to write - * flags: set to 0 unless one of the defined flags applies; set - * PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB - * values do not correspond to the colors in sRGB. - * colormap_entries: set to the number of entries in the color-map (0 to 256) - */ -#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED -PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image, - const char *file, int convert_to_8bit, const void *buffer, - png_int_32 row_stride, const void *colormap)); - /* Write the image to the named file. */ - -PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, - int convert_to_8_bit, const void *buffer, png_int_32 row_stride, - const void *colormap)); - /* Write the image to the given (FILE*). */ -#endif /* SIMPLIFIED_WRITE_STDIO */ - -/* With all write APIs if image is in one of the linear formats with 16-bit - * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG - * gamma encoded according to the sRGB specification, otherwise a 16-bit linear - * encoded PNG file is written. - * - * With color-mapped data formats the colormap parameter point to a color-map - * with at least image->colormap_entries encoded in the specified format. If - * the format is linear the written PNG color-map will be converted to sRGB - * regardless of the convert_to_8_bit flag. - * - * With all APIs row_stride is handled as in the read APIs - it is the spacing - * from one row to the next in component sized units (1 or 2 bytes) and if - * negative indicates a bottom-up row layout in the buffer. If row_stride is - * zero, libpng will calculate it for you from the image width and number of - * channels. - * - * Note that the write API does not support interlacing, sub-8-bit pixels or - * most ancillary chunks. If you need to write text chunks (e.g. for copyright - * notices) you need to use one of the other APIs. - */ - -PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory, - png_alloc_size_t * PNG_RESTRICT memory_bytes, int convert_to_8_bit, - const void *buffer, png_int_32 row_stride, const void *colormap)); - /* Write the image to the given memory buffer. The function both writes the - * whole PNG data stream to *memory and updates *memory_bytes with the count - * of bytes written. - * - * 'memory' may be NULL. In this case *memory_bytes is not read however on - * success the number of bytes which would have been written will still be - * stored in *memory_bytes. On failure *memory_bytes will contain 0. - * - * If 'memory' is not NULL it must point to memory[*memory_bytes] of - * writeable memory. - * - * If the function returns success memory[*memory_bytes] (if 'memory' is not - * NULL) contains the written PNG data. *memory_bytes will always be less - * than or equal to the original value. - * - * If the function returns false and *memory_bytes was not changed an error - * occured during write. If *memory_bytes was changed, or is not 0 if - * 'memory' was NULL, the write would have succeeded but for the memory - * buffer being too small. *memory_bytes contains the required number of - * bytes and will be bigger that the original value. - */ - -#define png_image_write_get_memory_size(image, size, convert_to_8_bit, buffer,\ - row_stride, colormap)\ - png_image_write_to_memory(&(image), 0, &(size), convert_to_8_bit, buffer,\ - row_stride, colormap) - /* Return the amount of memory in 'size' required to compress this image. - * The png_image structure 'image' must be filled in as in the above - * function and must not be changed before the actual write call, the buffer - * and all other parameters must also be identical to that in the final - * write call. The 'size' variable need not be initialized. - * - * NOTE: the macro returns true/false, if false is returned 'size' will be - * set to zero and the write failed and probably will fail if tried again. - */ - -/* You can pre-allocate the buffer by making sure it is of sufficient size - * regardless of the amount of compression achieved. The buffer size will - * always be bigger than the original image and it will never be filled. The - * following macros are provided to assist in allocating the buffer. - */ -#define PNG_IMAGE_DATA_SIZE(image) (PNG_IMAGE_SIZE(image)+(image).height) - /* The number of uncompressed bytes in the PNG byte encoding of the image; - * uncompressing the PNG IDAT data will give this number of bytes. - * - * NOTE: while PNG_IMAGE_SIZE cannot overflow for an image in memory this - * macro can because of the extra bytes used in the PNG byte encoding. You - * need to avoid this macro if your image size approaches 2^30 in width or - * height. The same goes for the remainder of these macros; they all produce - * bigger numbers than the actual in-memory image size. - */ -#ifndef PNG_ZLIB_MAX_SIZE -# define PNG_ZLIB_MAX_SIZE(b) ((b)+(((b)+7U)>>3)+(((b)+63U)>>6)+11U) - /* An upper bound on the number of compressed bytes given 'b' uncompressed - * bytes. This is based on deflateBounds() in zlib; different - * implementations of zlib compression may conceivably produce more data so - * if your zlib implementation is not zlib itself redefine this macro - * appropriately. - */ -#endif - -#define PNG_IMAGE_COMPRESSED_SIZE_MAX(image)\ - PNG_ZLIB_MAX_SIZE((png_alloc_size_t)PNG_IMAGE_DATA_SIZE(image)) - /* An upper bound on the size of the data in the PNG IDAT chunks. */ - -#define PNG_IMAGE_PNG_SIZE_MAX_(image, image_size)\ - ((8U/*sig*/+25U/*IHDR*/+16U/*gAMA*/+44U/*cHRM*/+12U/*IEND*/+\ - (((image).format&PNG_FORMAT_FLAG_COLORMAP)?/*colormap: PLTE, tRNS*/\ - 12U+3U*(image).colormap_entries/*PLTE data*/+\ - (((image).format&PNG_FORMAT_FLAG_ALPHA)?\ - 12U/*tRNS*/+(image).colormap_entries:0U):0U)+\ - 12U)+(12U*((image_size)/PNG_ZBUF_SIZE))/*IDAT*/+(image_size)) - /* A helper for the following macro; if your compiler cannot handle the - * following macro use this one with the result of - * PNG_IMAGE_COMPRESSED_SIZE_MAX(image) as the second argument (most - * compilers should handle this just fine.) - */ - -#define PNG_IMAGE_PNG_SIZE_MAX(image)\ - PNG_IMAGE_PNG_SIZE_MAX_(image, PNG_IMAGE_COMPRESSED_SIZE_MAX(image)) - /* An upper bound on the total length of the PNG data stream for 'image'. - * The result is of type png_alloc_size_t, on 32-bit systems this may - * overflow even though PNG_IMAGE_DATA_SIZE does not overflow; the write will - * run out of buffer space but return a corrected size which should work. - */ -#endif /* SIMPLIFIED_WRITE */ -/******************************************************************************* - * END OF SIMPLIFIED API - ******************************************************************************/ -#endif /* SIMPLIFIED_{READ|WRITE} */ - -/******************************************************************************* - * Section 6: IMPLEMENTATION OPTIONS - ******************************************************************************* - * - * Support for arbitrary implementation-specific optimizations. The API allows - * particular options to be turned on or off. 'Option' is the number of the - * option and 'onoff' is 0 (off) or non-0 (on). The value returned is given - * by the PNG_OPTION_ defines below. - * - * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions, - * are detected at run time, however sometimes it may be impossible - * to do this in user mode, in which case it is necessary to discover - * the capabilities in an OS specific way. Such capabilities are - * listed here when libpng has support for them and must be turned - * ON by the application if present. - * - * SOFTWARE: sometimes software optimizations actually result in performance - * decrease on some architectures or systems, or with some sets of - * PNG images. 'Software' options allow such optimizations to be - * selected at run time. - */ -#ifdef PNG_SET_OPTION_SUPPORTED -#ifdef PNG_ARM_NEON_API_SUPPORTED -# define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */ -#endif -#define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */ -#define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */ -#ifdef PNG_MIPS_MSA_API_SUPPORTED -# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */ -#endif -#define PNG_IGNORE_ADLER32 8 -#define PNG_OPTION_NEXT 10 /* Next option - numbers must be even */ - -/* Return values: NOTE: there are four values and 'off' is *not* zero */ -#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ -#define PNG_OPTION_INVALID 1 /* Option number out of range */ -#define PNG_OPTION_OFF 2 -#define PNG_OPTION_ON 3 - -PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, - int onoff)); -#endif /* SET_OPTION */ - -/******************************************************************************* - * END OF HARDWARE AND SOFTWARE OPTIONS - ******************************************************************************/ - -/* Maintainer: Put new public prototypes here ^, in libpng.3, in project - * defs, and in scripts/symbols.def. - */ - -/* The last ordinal number (this is the *last* one already used; the next - * one to use is one more than this.) - */ -#ifdef PNG_EXPORT_LAST_ORDINAL - PNG_EXPORT_LAST_ORDINAL(245); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* PNG_VERSION_INFO_ONLY */ -/* Do not put anything past this line */ -#endif /* PNG_H */ diff --git a/jan/src/dep/libs/libpng/pngconf.h b/jan/src/dep/libs/libpng/pngconf.h deleted file mode 100644 index 88a28f95a..000000000 --- a/jan/src/dep/libs/libpng/pngconf.h +++ /dev/null @@ -1,622 +0,0 @@ - -/* pngconf.h - machine configurable file for libpng - * - * libpng version 1.6.28, January 5, 2017 - * - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - * Any machine specific code is near the front of this file, so if you - * are configuring libpng for a machine, you may want to read the section - * starting here down to where it starts to typedef png_color, png_text, - * and png_info. - */ - -#ifndef PNGCONF_H -#define PNGCONF_H - -#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ - -/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C - * compiler for correct compilation. The following header files are required by - * the standard. If your compiler doesn't provide these header files, or they - * do not match the standard, you will need to provide/improve them. - */ -#include -#include - -/* Library header files. These header files are all defined by ISOC90; libpng - * expects conformant implementations, however, an ISOC90 conformant system need - * not provide these header files if the functionality cannot be implemented. - * In this case it will be necessary to disable the relevant parts of libpng in - * the build of pnglibconf.h. - * - * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not - * include this unnecessary header file. - */ - -#ifdef PNG_STDIO_SUPPORTED - /* Required for the definition of FILE: */ -# include -#endif - -#ifdef PNG_SETJMP_SUPPORTED - /* Required for the definition of jmp_buf and the declaration of longjmp: */ -# include -#endif - -#ifdef PNG_CONVERT_tIME_SUPPORTED - /* Required for struct tm: */ -# include -#endif - -#endif /* PNG_BUILDING_SYMBOL_TABLE */ - -/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using - * PNG_NO_CONST; this is no longer supported except for data declarations which - * apparently still cause problems in 2011 on some compilers. - */ -#define PNG_CONST const /* backward compatibility only */ - -/* This controls optimization of the reading of 16-bit and 32-bit values - * from PNG files. It can be set on a per-app-file basis - it - * just changes whether a macro is used when the function is called. - * The library builder sets the default; if read functions are not - * built into the library the macro implementation is forced on. - */ -#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED -# define PNG_USE_READ_MACROS -#endif -#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) -# if PNG_DEFAULT_READ_MACROS -# define PNG_USE_READ_MACROS -# endif -#endif - -/* COMPILER SPECIFIC OPTIONS. - * - * These options are provided so that a variety of difficult compilers - * can be used. Some are fixed at build time (e.g. PNG_API_RULE - * below) but still have compiler specific implementations, others - * may be changed on a per-file basis when compiling against libpng. - */ - -/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect - * against legacy (pre ISOC90) compilers that did not understand function - * prototypes. It is not required for modern C compilers. - */ -#ifndef PNGARG -# define PNGARG(arglist) arglist -#endif - -/* Function calling conventions. - * ============================= - * Normally it is not necessary to specify to the compiler how to call - * a function - it just does it - however on x86 systems derived from - * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems - * and some others) there are multiple ways to call a function and the - * default can be changed on the compiler command line. For this reason - * libpng specifies the calling convention of every exported function and - * every function called via a user supplied function pointer. This is - * done in this file by defining the following macros: - * - * PNGAPI Calling convention for exported functions. - * PNGCBAPI Calling convention for user provided (callback) functions. - * PNGCAPI Calling convention used by the ANSI-C library (required - * for longjmp callbacks and sometimes used internally to - * specify the calling convention for zlib). - * - * These macros should never be overridden. If it is necessary to - * change calling convention in a private build this can be done - * by setting PNG_API_RULE (which defaults to 0) to one of the values - * below to select the correct 'API' variants. - * - * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. - * This is correct in every known environment. - * PNG_API_RULE=1 Use the operating system convention for PNGAPI and - * the 'C' calling convention (from PNGCAPI) for - * callbacks (PNGCBAPI). This is no longer required - * in any known environment - if it has to be used - * please post an explanation of the problem to the - * libpng mailing list. - * - * These cases only differ if the operating system does not use the C - * calling convention, at present this just means the above cases - * (x86 DOS/Windows sytems) and, even then, this does not apply to - * Cygwin running on those systems. - * - * Note that the value must be defined in pnglibconf.h so that what - * the application uses to call the library matches the conventions - * set when building the library. - */ - -/* Symbol export - * ============= - * When building a shared library it is almost always necessary to tell - * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' - * is used to mark the symbols. On some systems these symbols can be - * extracted at link time and need no special processing by the compiler, - * on other systems the symbols are flagged by the compiler and just - * the declaration requires a special tag applied (unfortunately) in a - * compiler dependent way. Some systems can do either. - * - * A small number of older systems also require a symbol from a DLL to - * be flagged to the program that calls it. This is a problem because - * we do not know in the header file included by application code that - * the symbol will come from a shared library, as opposed to a statically - * linked one. For this reason the application must tell us by setting - * the magic flag PNG_USE_DLL to turn on the special processing before - * it includes png.h. - * - * Four additional macros are used to make this happen: - * - * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from - * the build or imported if PNG_USE_DLL is set - compiler - * and system specific. - * - * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to - * 'type', compiler specific. - * - * PNG_DLL_EXPORT Set to the magic to use during a libpng build to - * make a symbol exported from the DLL. Not used in the - * public header files; see pngpriv.h for how it is used - * in the libpng build. - * - * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come - * from a DLL - used to define PNG_IMPEXP when - * PNG_USE_DLL is set. - */ - -/* System specific discovery. - * ========================== - * This code is used at build time to find PNG_IMPEXP, the API settings - * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL - * import processing is possible. On Windows systems it also sets - * compiler-specific macros to the values required to change the calling - * conventions of the various functions. - */ -#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ - defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) - /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or - * MinGW on any architecture currently supported by Windows. Also includes - * Watcom builds but these need special treatment because they are not - * compatible with GCC or Visual C because of different calling conventions. - */ -# if PNG_API_RULE == 2 - /* If this line results in an error, either because __watcall is not - * understood or because of a redefine just below you cannot use *this* - * build of the library with the compiler you are using. *This* build was - * build using Watcom and applications must also be built using Watcom! - */ -# define PNGCAPI __watcall -# endif - -# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) -# define PNGCAPI __cdecl -# if PNG_API_RULE == 1 - /* If this line results in an error __stdcall is not understood and - * PNG_API_RULE should not have been set to '1'. - */ -# define PNGAPI __stdcall -# endif -# else - /* An older compiler, or one not detected (erroneously) above, - * if necessary override on the command line to get the correct - * variants for the compiler. - */ -# ifndef PNGCAPI -# define PNGCAPI _cdecl -# endif -# if PNG_API_RULE == 1 && !defined(PNGAPI) -# define PNGAPI _stdcall -# endif -# endif /* compiler/api */ - - /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ - -# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) -# error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed" -# endif - -# if (defined(_MSC_VER) && _MSC_VER < 800) ||\ - (defined(__BORLANDC__) && __BORLANDC__ < 0x500) - /* older Borland and MSC - * compilers used '__export' and required this to be after - * the type. - */ -# ifndef PNG_EXPORT_TYPE -# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP -# endif -# define PNG_DLL_EXPORT __export -# else /* newer compiler */ -# define PNG_DLL_EXPORT __declspec(dllexport) -# ifndef PNG_DLL_IMPORT -# define PNG_DLL_IMPORT __declspec(dllimport) -# endif -# endif /* compiler */ - -#else /* !Windows */ -# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) -# define PNGAPI _System -# else /* !Windows/x86 && !OS/2 */ - /* Use the defaults, or define PNG*API on the command line (but - * this will have to be done for every compile!) - */ -# endif /* other system, !OS/2 */ -#endif /* !Windows/x86 */ - -/* Now do all the defaulting . */ -#ifndef PNGCAPI -# define PNGCAPI -#endif -#ifndef PNGCBAPI -# define PNGCBAPI PNGCAPI -#endif -#ifndef PNGAPI -# define PNGAPI PNGCAPI -#endif - -/* PNG_IMPEXP may be set on the compilation system command line or (if not set) - * then in an internal header file when building the library, otherwise (when - * using the library) it is set here. - */ -#ifndef PNG_IMPEXP -# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) - /* This forces use of a DLL, disallowing static linking */ -# define PNG_IMPEXP PNG_DLL_IMPORT -# endif - -# ifndef PNG_IMPEXP -# define PNG_IMPEXP -# endif -#endif - -/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat - * 'attributes' as a storage class - the attributes go at the start of the - * function definition, and attributes are always appended regardless of the - * compiler. This considerably simplifies these macros but may cause problems - * if any compilers both need function attributes and fail to handle them as - * a storage class (this is unlikely.) - */ -#ifndef PNG_FUNCTION -# define PNG_FUNCTION(type, name, args, attributes) attributes type name args -#endif - -#ifndef PNG_EXPORT_TYPE -# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type -#endif - - /* The ordinal value is only relevant when preprocessing png.h for symbol - * table entries, so we discard it here. See the .dfn files in the - * scripts directory. - */ - -#ifndef PNG_EXPORTA -# define PNG_EXPORTA(ordinal, type, name, args, attributes) \ - PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), PNGARG(args), \ - PNG_LINKAGE_API attributes) -#endif - -/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, - * so make something non-empty to satisfy the requirement: - */ -#define PNG_EMPTY /*empty list*/ - -#define PNG_EXPORT(ordinal, type, name, args) \ - PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) - -/* Use PNG_REMOVED to comment out a removed interface. */ -#ifndef PNG_REMOVED -# define PNG_REMOVED(ordinal, type, name, args, attributes) -#endif - -#ifndef PNG_CALLBACK -# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args) -#endif - -/* Support for compiler specific function attributes. These are used - * so that where compiler support is available incorrect use of API - * functions in png.h will generate compiler warnings. - * - * Added at libpng-1.2.41. - */ - -#ifndef PNG_NO_PEDANTIC_WARNINGS -# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED -# define PNG_PEDANTIC_WARNINGS_SUPPORTED -# endif -#endif - -#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED - /* Support for compiler specific function attributes. These are used - * so that where compiler support is available, incorrect use of API - * functions in png.h will generate compiler warnings. Added at libpng - * version 1.2.41. Disabling these removes the warnings but may also produce - * less efficient code. - */ -# if defined(__clang__) && defined(__has_attribute) - /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ -# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) -# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) -# endif -# if !defined(PNG_NORETURN) && __has_attribute(__noreturn__) -# define PNG_NORETURN __attribute__((__noreturn__)) -# endif -# if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__) -# define PNG_ALLOCATED __attribute__((__malloc__)) -# endif -# if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__) -# define PNG_DEPRECATED __attribute__((__deprecated__)) -# endif -# if !defined(PNG_PRIVATE) -# ifdef __has_extension -# if __has_extension(attribute_unavailable_with_message) -# define PNG_PRIVATE __attribute__((__unavailable__(\ - "This function is not exported by libpng."))) -# endif -# endif -# endif -# ifndef PNG_RESTRICT -# define PNG_RESTRICT __restrict -# endif - -# elif defined(__GNUC__) -# ifndef PNG_USE_RESULT -# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) -# endif -# ifndef PNG_NORETURN -# define PNG_NORETURN __attribute__((__noreturn__)) -# endif -# if __GNUC__ >= 3 -# ifndef PNG_ALLOCATED -# define PNG_ALLOCATED __attribute__((__malloc__)) -# endif -# ifndef PNG_DEPRECATED -# define PNG_DEPRECATED __attribute__((__deprecated__)) -# endif -# ifndef PNG_PRIVATE -# if 0 /* Doesn't work so we use deprecated instead*/ -# define PNG_PRIVATE \ - __attribute__((warning("This function is not exported by libpng."))) -# else -# define PNG_PRIVATE \ - __attribute__((__deprecated__)) -# endif -# endif -# if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) -# ifndef PNG_RESTRICT -# define PNG_RESTRICT __restrict -# endif -# endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */ -# endif /* __GNUC__ >= 3 */ - -# elif defined(_MSC_VER) && (_MSC_VER >= 1300) -# ifndef PNG_USE_RESULT -# define PNG_USE_RESULT /* not supported */ -# endif -# ifndef PNG_NORETURN -# define PNG_NORETURN __declspec(noreturn) -# endif -# ifndef PNG_ALLOCATED -# if (_MSC_VER >= 1400) -# define PNG_ALLOCATED __declspec(restrict) -# endif -# endif -# ifndef PNG_DEPRECATED -# define PNG_DEPRECATED __declspec(deprecated) -# endif -# ifndef PNG_PRIVATE -# define PNG_PRIVATE __declspec(deprecated) -# endif -# ifndef PNG_RESTRICT -# if (_MSC_VER >= 1400) -# define PNG_RESTRICT __restrict -# endif -# endif - -# elif defined(__WATCOMC__) -# ifndef PNG_RESTRICT -# define PNG_RESTRICT __restrict -# endif -# endif -#endif /* PNG_PEDANTIC_WARNINGS */ - -#ifndef PNG_DEPRECATED -# define PNG_DEPRECATED /* Use of this function is deprecated */ -#endif -#ifndef PNG_USE_RESULT -# define PNG_USE_RESULT /* The result of this function must be checked */ -#endif -#ifndef PNG_NORETURN -# define PNG_NORETURN /* This function does not return */ -#endif -#ifndef PNG_ALLOCATED -# define PNG_ALLOCATED /* The result of the function is new memory */ -#endif -#ifndef PNG_PRIVATE -# define PNG_PRIVATE /* This is a private libpng function */ -#endif -#ifndef PNG_RESTRICT -# define PNG_RESTRICT /* The C99 "restrict" feature */ -#endif - -#ifndef PNG_FP_EXPORT /* A floating point API. */ -# ifdef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FP_EXPORT(ordinal, type, name, args)\ - PNG_EXPORT(ordinal, type, name, args); -# else /* No floating point APIs */ -# define PNG_FP_EXPORT(ordinal, type, name, args) -# endif -#endif -#ifndef PNG_FIXED_EXPORT /* A fixed point API. */ -# ifdef PNG_FIXED_POINT_SUPPORTED -# define PNG_FIXED_EXPORT(ordinal, type, name, args)\ - PNG_EXPORT(ordinal, type, name, args); -# else /* No fixed point APIs */ -# define PNG_FIXED_EXPORT(ordinal, type, name, args) -# endif -#endif - -#ifndef PNG_BUILDING_SYMBOL_TABLE -/* Some typedefs to get us started. These should be safe on most of the common - * platforms. - * - * png_uint_32 and png_int_32 may, currently, be larger than required to hold a - * 32-bit value however this is not normally advisable. - * - * png_uint_16 and png_int_16 should always be two bytes in size - this is - * verified at library build time. - * - * png_byte must always be one byte in size. - * - * The checks below use constants from limits.h, as defined by the ISOC90 - * standard. - */ -#if CHAR_BIT == 8 && UCHAR_MAX == 255 - typedef unsigned char png_byte; -#else -# error "libpng requires 8-bit bytes" -#endif - -#if INT_MIN == -32768 && INT_MAX == 32767 - typedef int png_int_16; -#elif SHRT_MIN == -32768 && SHRT_MAX == 32767 - typedef short png_int_16; -#else -# error "libpng requires a signed 16-bit type" -#endif - -#if UINT_MAX == 65535 - typedef unsigned int png_uint_16; -#elif USHRT_MAX == 65535 - typedef unsigned short png_uint_16; -#else -# error "libpng requires an unsigned 16-bit type" -#endif - -#if INT_MIN < -2147483646 && INT_MAX > 2147483646 - typedef int png_int_32; -#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 - typedef long int png_int_32; -#else -# error "libpng requires a signed 32-bit (or more) type" -#endif - -#if UINT_MAX > 4294967294U - typedef unsigned int png_uint_32; -#elif ULONG_MAX > 4294967294U - typedef unsigned long int png_uint_32; -#else -# error "libpng requires an unsigned 32-bit (or more) type" -#endif - -/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however, - * requires an ISOC90 compiler and relies on consistent behavior of sizeof. - */ -typedef size_t png_size_t; -typedef ptrdiff_t png_ptrdiff_t; - -/* libpng needs to know the maximum value of 'size_t' and this controls the - * definition of png_alloc_size_t, below. This maximum value of size_t limits - * but does not control the maximum allocations the library makes - there is - * direct application control of this through png_set_user_limits(). - */ -#ifndef PNG_SMALL_SIZE_T - /* Compiler specific tests for systems where size_t is known to be less than - * 32 bits (some of these systems may no longer work because of the lack of - * 'far' support; see above.) - */ -# if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ - (defined(_MSC_VER) && defined(MAXSEG_64K)) -# define PNG_SMALL_SIZE_T -# endif -#endif - -/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no - * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to - * png_alloc_size_t are not necessary; in fact, it is recommended not to use - * them at all so that the compiler can complain when something turns out to be - * problematic. - * - * Casts in the other direction (from png_alloc_size_t to png_size_t or - * png_uint_32) should be explicitly applied; however, we do not expect to - * encounter practical situations that require such conversions. - * - * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than - * 4294967295 - i.e. less than the maximum value of png_uint_32. - */ -#ifdef PNG_SMALL_SIZE_T - typedef png_uint_32 png_alloc_size_t; -#else - typedef png_size_t png_alloc_size_t; -#endif - -/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler - * implementations of Intel CPU specific support of user-mode segmented address - * spaces, where 16-bit pointers address more than 65536 bytes of memory using - * separate 'segment' registers. The implementation requires two different - * types of pointer (only one of which includes the segment value.) - * - * If required this support is available in version 1.2 of libpng and may be - * available in versions through 1.5, although the correctness of the code has - * not been verified recently. - */ - -/* Typedef for floating-point numbers that are converted to fixed-point with a - * multiple of 100,000, e.g., gamma - */ -typedef png_int_32 png_fixed_point; - -/* Add typedefs for pointers */ -typedef void * png_voidp; -typedef const void * png_const_voidp; -typedef png_byte * png_bytep; -typedef const png_byte * png_const_bytep; -typedef png_uint_32 * png_uint_32p; -typedef const png_uint_32 * png_const_uint_32p; -typedef png_int_32 * png_int_32p; -typedef const png_int_32 * png_const_int_32p; -typedef png_uint_16 * png_uint_16p; -typedef const png_uint_16 * png_const_uint_16p; -typedef png_int_16 * png_int_16p; -typedef const png_int_16 * png_const_int_16p; -typedef char * png_charp; -typedef const char * png_const_charp; -typedef png_fixed_point * png_fixed_point_p; -typedef const png_fixed_point * png_const_fixed_point_p; -typedef png_size_t * png_size_tp; -typedef const png_size_t * png_const_size_tp; - -#ifdef PNG_STDIO_SUPPORTED -typedef FILE * png_FILE_p; -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double * png_doublep; -typedef const double * png_const_doublep; -#endif - -/* Pointers to pointers; i.e. arrays */ -typedef png_byte * * png_bytepp; -typedef png_uint_32 * * png_uint_32pp; -typedef png_int_32 * * png_int_32pp; -typedef png_uint_16 * * png_uint_16pp; -typedef png_int_16 * * png_int_16pp; -typedef const char * * png_const_charpp; -typedef char * * png_charpp; -typedef png_fixed_point * * png_fixed_point_pp; -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double * * png_doublepp; -#endif - -/* Pointers to pointers to pointers; i.e., pointer to array */ -typedef char * * * png_charppp; - -#endif /* PNG_BUILDING_SYMBOL_TABLE */ - -#endif /* PNGCONF_H */ diff --git a/jan/src/dep/libs/libpng/pngdebug.h b/jan/src/dep/libs/libpng/pngdebug.h deleted file mode 100644 index 3d1e78c16..000000000 --- a/jan/src/dep/libs/libpng/pngdebug.h +++ /dev/null @@ -1,153 +0,0 @@ - -/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c - * - * Last changed in libpng 1.6.8 [December 19, 2013] - * Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -/* Define PNG_DEBUG at compile time for debugging information. Higher - * numbers for PNG_DEBUG mean more debugging information. This has - * only been added since version 0.95 so it is not implemented throughout - * libpng yet, but more support will be added as needed. - * - * png_debug[1-2]?(level, message ,arg{0-2}) - * Expands to a statement (either a simple expression or a compound - * do..while(0) statement) that outputs a message with parameter - * substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG - * is undefined, 0 or 1 every png_debug expands to a simple expression - * (actually ((void)0)). - * - * level: level of detail of message, starting at 0. A level 'n' - * message is preceded by 'n' 3-space indentations (not implemented - * on Microsoft compilers unless PNG_DEBUG_FILE is also - * defined, to allow debug DLL compilation with no standard IO). - * message: a printf(3) style text string. A trailing '\n' is added - * to the message. - * arg: 0 to 2 arguments for printf(3) style substitution in message. - */ -#ifndef PNGDEBUG_H -#define PNGDEBUG_H -/* These settings control the formatting of messages in png.c and pngerror.c */ -/* Moved to pngdebug.h at 1.5.0 */ -# ifndef PNG_LITERAL_SHARP -# define PNG_LITERAL_SHARP 0x23 -# endif -# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET -# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b -# endif -# ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET -# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d -# endif -# ifndef PNG_STRING_NEWLINE -# define PNG_STRING_NEWLINE "\n" -# endif - -#ifdef PNG_DEBUG -# if (PNG_DEBUG > 0) -# if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) -# include -# if (PNG_DEBUG > 1) -# ifndef _DEBUG -# define _DEBUG -# endif -# ifndef png_debug -# define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) -# endif -# ifndef png_debug1 -# define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) -# endif -# ifndef png_debug2 -# define png_debug2(l,m,p1,p2) \ - _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) -# endif -# endif -# else /* PNG_DEBUG_FILE || !_MSC_VER */ -# ifndef PNG_STDIO_SUPPORTED -# include /* not included yet */ -# endif -# ifndef PNG_DEBUG_FILE -# define PNG_DEBUG_FILE stderr -# endif /* PNG_DEBUG_FILE */ - -# if (PNG_DEBUG > 1) -# ifdef __STDC__ -# ifndef png_debug -# define png_debug(l,m) \ - do { \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ - (num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \ - } while (0) -# endif -# ifndef png_debug1 -# define png_debug1(l,m,p1) \ - do { \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ - (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \ - } while (0) -# endif -# ifndef png_debug2 -# define png_debug2(l,m,p1,p2) \ - do { \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ - (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\ - } while (0) -# endif -# else /* __STDC __ */ -# ifndef png_debug -# define png_debug(l,m) \ - do { \ - int num_tabs=l; \ - char format[256]; \ - snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ - m,PNG_STRING_NEWLINE); \ - fprintf(PNG_DEBUG_FILE,format); \ - } while (0) -# endif -# ifndef png_debug1 -# define png_debug1(l,m,p1) \ - do { \ - int num_tabs=l; \ - char format[256]; \ - snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ - m,PNG_STRING_NEWLINE); \ - fprintf(PNG_DEBUG_FILE,format,p1); \ - } while (0) -# endif -# ifndef png_debug2 -# define png_debug2(l,m,p1,p2) \ - do { \ - int num_tabs=l; \ - char format[256]; \ - snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ - m,PNG_STRING_NEWLINE); \ - fprintf(PNG_DEBUG_FILE,format,p1,p2); \ - } while (0) -# endif -# endif /* __STDC __ */ -# endif /* (PNG_DEBUG > 1) */ - -# endif /* _MSC_VER */ -# endif /* (PNG_DEBUG > 0) */ -#endif /* PNG_DEBUG */ -#ifndef png_debug -# define png_debug(l, m) ((void)0) -#endif -#ifndef png_debug1 -# define png_debug1(l, m, p1) ((void)0) -#endif -#ifndef png_debug2 -# define png_debug2(l, m, p1, p2) ((void)0) -#endif -#endif /* PNGDEBUG_H */ diff --git a/jan/src/dep/libs/libpng/pngerror.c b/jan/src/dep/libs/libpng/pngerror.c deleted file mode 100644 index d6f22ef61..000000000 --- a/jan/src/dep/libs/libpng/pngerror.c +++ /dev/null @@ -1,963 +0,0 @@ - -/* pngerror.c - stub functions for i/o and memory allocation - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - * This file provides a location for all error handling. Users who - * need special error handling are expected to write replacement functions - * and use png_set_error_fn() to use those functions. See the instructions - * at each function. - */ - -#include "pngpriv.h" - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) - -static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr, - png_const_charp error_message)),PNG_NORETURN); - -#ifdef PNG_WARNINGS_SUPPORTED -static void /* PRIVATE */ -png_default_warning PNGARG((png_const_structrp png_ptr, - png_const_charp warning_message)); -#endif /* WARNINGS */ - -/* This function is called whenever there is a fatal error. This function - * should not be changed. If there is a need to handle errors differently, - * you should supply a replacement error function and use png_set_error_fn() - * to replace the error function at run-time. - */ -#ifdef PNG_ERROR_TEXT_SUPPORTED -PNG_FUNCTION(void,PNGAPI -png_error,(png_const_structrp png_ptr, png_const_charp error_message), - PNG_NORETURN) -{ -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - char msg[16]; - if (png_ptr != NULL) - { - if ((png_ptr->flags & - (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0) - { - if (*error_message == PNG_LITERAL_SHARP) - { - /* Strip "#nnnn " from beginning of error message. */ - int offset; - for (offset = 1; offset<15; offset++) - if (error_message[offset] == ' ') - break; - - if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0) - { - int i; - for (i = 0; i < offset - 1; i++) - msg[i] = error_message[i + 1]; - msg[i - 1] = '\0'; - error_message = msg; - } - - else - error_message += offset; - } - - else - { - if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0) - { - msg[0] = '0'; - msg[1] = '\0'; - error_message = msg; - } - } - } - } -#endif - if (png_ptr != NULL && png_ptr->error_fn != NULL) - (*(png_ptr->error_fn))(png_constcast(png_structrp,png_ptr), - error_message); - - /* If the custom handler doesn't exist, or if it returns, - use the default handler, which will not return. */ - png_default_error(png_ptr, error_message); -} -#else -PNG_FUNCTION(void,PNGAPI -png_err,(png_const_structrp png_ptr),PNG_NORETURN) -{ - /* Prior to 1.5.2 the error_fn received a NULL pointer, expressed - * erroneously as '\0', instead of the empty string "". This was - * apparently an error, introduced in libpng-1.2.20, and png_default_error - * will crash in this case. - */ - if (png_ptr != NULL && png_ptr->error_fn != NULL) - (*(png_ptr->error_fn))(png_constcast(png_structrp,png_ptr), ""); - - /* If the custom handler doesn't exist, or if it returns, - use the default handler, which will not return. */ - png_default_error(png_ptr, ""); -} -#endif /* ERROR_TEXT */ - -/* Utility to safely appends strings to a buffer. This never errors out so - * error checking is not required in the caller. - */ -size_t -png_safecat(png_charp buffer, size_t bufsize, size_t pos, - png_const_charp string) -{ - if (buffer != NULL && pos < bufsize) - { - if (string != NULL) - while (*string != '\0' && pos < bufsize-1) - buffer[pos++] = *string++; - - buffer[pos] = '\0'; - } - - return pos; -} - -#if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_TIME_RFC1123_SUPPORTED) -/* Utility to dump an unsigned value into a buffer, given a start pointer and - * and end pointer (which should point just *beyond* the end of the buffer!) - * Returns the pointer to the start of the formatted string. - */ -png_charp -png_format_number(png_const_charp start, png_charp end, int format, - png_alloc_size_t number) -{ - int count = 0; /* number of digits output */ - int mincount = 1; /* minimum number required */ - int output = 0; /* digit output (for the fixed point format) */ - - *--end = '\0'; - - /* This is written so that the loop always runs at least once, even with - * number zero. - */ - while (end > start && (number != 0 || count < mincount)) - { - - static const char digits[] = "0123456789ABCDEF"; - - switch (format) - { - case PNG_NUMBER_FORMAT_fixed: - /* Needs five digits (the fraction) */ - mincount = 5; - if (output != 0 || number % 10 != 0) - { - *--end = digits[number % 10]; - output = 1; - } - number /= 10; - break; - - case PNG_NUMBER_FORMAT_02u: - /* Expects at least 2 digits. */ - mincount = 2; - /* FALL THROUGH */ - - case PNG_NUMBER_FORMAT_u: - *--end = digits[number % 10]; - number /= 10; - break; - - case PNG_NUMBER_FORMAT_02x: - /* This format expects at least two digits */ - mincount = 2; - /* FALL THROUGH */ - - case PNG_NUMBER_FORMAT_x: - *--end = digits[number & 0xf]; - number >>= 4; - break; - - default: /* an error */ - number = 0; - break; - } - - /* Keep track of the number of digits added */ - ++count; - - /* Float a fixed number here: */ - if ((format == PNG_NUMBER_FORMAT_fixed) && (count == 5) && (end > start)) - { - /* End of the fraction, but maybe nothing was output? In that case - * drop the decimal point. If the number is a true zero handle that - * here. - */ - if (output != 0) - *--end = '.'; - else if (number == 0) /* and !output */ - *--end = '0'; - } - } - - return end; -} -#endif - -#ifdef PNG_WARNINGS_SUPPORTED -/* This function is called whenever there is a non-fatal error. This function - * should not be changed. If there is a need to handle warnings differently, - * you should supply a replacement warning function and use - * png_set_error_fn() to replace the warning function at run-time. - */ -void PNGAPI -png_warning(png_const_structrp png_ptr, png_const_charp warning_message) -{ - int offset = 0; - if (png_ptr != NULL) - { -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - if ((png_ptr->flags & - (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0) -#endif - { - if (*warning_message == PNG_LITERAL_SHARP) - { - for (offset = 1; offset < 15; offset++) - if (warning_message[offset] == ' ') - break; - } - } - } - if (png_ptr != NULL && png_ptr->warning_fn != NULL) - (*(png_ptr->warning_fn))(png_constcast(png_structrp,png_ptr), - warning_message + offset); - else - png_default_warning(png_ptr, warning_message + offset); -} - -/* These functions support 'formatted' warning messages with up to - * PNG_WARNING_PARAMETER_COUNT parameters. In the format string the parameter - * is introduced by @, where 'number' starts at 1. This follows the - * standard established by X/Open for internationalizable error messages. - */ -void -png_warning_parameter(png_warning_parameters p, int number, - png_const_charp string) -{ - if (number > 0 && number <= PNG_WARNING_PARAMETER_COUNT) - (void)png_safecat(p[number-1], (sizeof p[number-1]), 0, string); -} - -void -png_warning_parameter_unsigned(png_warning_parameters p, int number, int format, - png_alloc_size_t value) -{ - char buffer[PNG_NUMBER_BUFFER_SIZE]; - png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value)); -} - -void -png_warning_parameter_signed(png_warning_parameters p, int number, int format, - png_int_32 value) -{ - png_alloc_size_t u; - png_charp str; - char buffer[PNG_NUMBER_BUFFER_SIZE]; - - /* Avoid overflow by doing the negate in a png_alloc_size_t: */ - u = (png_alloc_size_t)value; - if (value < 0) - u = ~u + 1; - - str = PNG_FORMAT_NUMBER(buffer, format, u); - - if (value < 0 && str > buffer) - *--str = '-'; - - png_warning_parameter(p, number, str); -} - -void -png_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p, - png_const_charp message) -{ - /* The internal buffer is just 192 bytes - enough for all our messages, - * overflow doesn't happen because this code checks! If someone figures - * out how to send us a message longer than 192 bytes, all that will - * happen is that the message will be truncated appropriately. - */ - size_t i = 0; /* Index in the msg[] buffer: */ - char msg[192]; - - /* Each iteration through the following loop writes at most one character - * to msg[i++] then returns here to validate that there is still space for - * the trailing '\0'. It may (in the case of a parameter) read more than - * one character from message[]; it must check for '\0' and continue to the - * test if it finds the end of string. - */ - while (i<(sizeof msg)-1 && *message != '\0') - { - /* '@' at end of string is now just printed (previously it was skipped); - * it is an error in the calling code to terminate the string with @. - */ - if (p != NULL && *message == '@' && message[1] != '\0') - { - int parameter_char = *++message; /* Consume the '@' */ - static const char valid_parameters[] = "123456789"; - int parameter = 0; - - /* Search for the parameter digit, the index in the string is the - * parameter to use. - */ - while (valid_parameters[parameter] != parameter_char && - valid_parameters[parameter] != '\0') - ++parameter; - - /* If the parameter digit is out of range it will just get printed. */ - if (parameter < PNG_WARNING_PARAMETER_COUNT) - { - /* Append this parameter */ - png_const_charp parm = p[parameter]; - png_const_charp pend = p[parameter] + (sizeof p[parameter]); - - /* No need to copy the trailing '\0' here, but there is no guarantee - * that parm[] has been initialized, so there is no guarantee of a - * trailing '\0': - */ - while (i<(sizeof msg)-1 && *parm != '\0' && parm < pend) - msg[i++] = *parm++; - - /* Consume the parameter digit too: */ - ++message; - continue; - } - - /* else not a parameter and there is a character after the @ sign; just - * copy that. This is known not to be '\0' because of the test above. - */ - } - - /* At this point *message can't be '\0', even in the bad parameter case - * above where there is a lone '@' at the end of the message string. - */ - msg[i++] = *message++; - } - - /* i is always less than (sizeof msg), so: */ - msg[i] = '\0'; - - /* And this is the formatted message. It may be larger than - * PNG_MAX_ERROR_TEXT, but that is only used for 'chunk' errors and these - * are not (currently) formatted. - */ - png_warning(png_ptr, msg); -} -#endif /* WARNINGS */ - -#ifdef PNG_BENIGN_ERRORS_SUPPORTED -void PNGAPI -png_benign_error(png_const_structrp png_ptr, png_const_charp error_message) -{ - if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0) - { -# ifdef PNG_READ_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 && - png_ptr->chunk_name != 0) - png_chunk_warning(png_ptr, error_message); - else -# endif - png_warning(png_ptr, error_message); - } - - else - { -# ifdef PNG_READ_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 && - png_ptr->chunk_name != 0) - png_chunk_error(png_ptr, error_message); - else -# endif - png_error(png_ptr, error_message); - } - -# ifndef PNG_ERROR_TEXT_SUPPORTED - PNG_UNUSED(error_message) -# endif -} - -void /* PRIVATE */ -png_app_warning(png_const_structrp png_ptr, png_const_charp error_message) -{ - if ((png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN) != 0) - png_warning(png_ptr, error_message); - else - png_error(png_ptr, error_message); - -# ifndef PNG_ERROR_TEXT_SUPPORTED - PNG_UNUSED(error_message) -# endif -} - -void /* PRIVATE */ -png_app_error(png_const_structrp png_ptr, png_const_charp error_message) -{ - if ((png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN) != 0) - png_warning(png_ptr, error_message); - else - png_error(png_ptr, error_message); - -# ifndef PNG_ERROR_TEXT_SUPPORTED - PNG_UNUSED(error_message) -# endif -} -#endif /* BENIGN_ERRORS */ - -#define PNG_MAX_ERROR_TEXT 196 /* Currently limited by profile_error in png.c */ -#if defined(PNG_WARNINGS_SUPPORTED) || \ - (defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)) -/* These utilities are used internally to build an error message that relates - * to the current chunk. The chunk name comes from png_ptr->chunk_name, - * which is used to prefix the message. The message is limited in length - * to 63 bytes. The name characters are output as hex digits wrapped in [] - * if the character is invalid. - */ -#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) -static PNG_CONST char png_digit[16] = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F' -}; - -static void /* PRIVATE */ -png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp - error_message) -{ - png_uint_32 chunk_name = png_ptr->chunk_name; - int iout = 0, ishift = 24; - - while (ishift >= 0) - { - int c = (int)(chunk_name >> ishift) & 0xff; - - ishift -= 8; - if (isnonalpha(c) != 0) - { - buffer[iout++] = PNG_LITERAL_LEFT_SQUARE_BRACKET; - buffer[iout++] = png_digit[(c & 0xf0) >> 4]; - buffer[iout++] = png_digit[c & 0x0f]; - buffer[iout++] = PNG_LITERAL_RIGHT_SQUARE_BRACKET; - } - - else - { - buffer[iout++] = (char)c; - } - } - - if (error_message == NULL) - buffer[iout] = '\0'; - - else - { - int iin = 0; - - buffer[iout++] = ':'; - buffer[iout++] = ' '; - - while (iin < PNG_MAX_ERROR_TEXT-1 && error_message[iin] != '\0') - buffer[iout++] = error_message[iin++]; - - /* iin < PNG_MAX_ERROR_TEXT, so the following is safe: */ - buffer[iout] = '\0'; - } -} -#endif /* WARNINGS || ERROR_TEXT */ - -#if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED) -PNG_FUNCTION(void,PNGAPI -png_chunk_error,(png_const_structrp png_ptr, png_const_charp error_message), - PNG_NORETURN) -{ - char msg[18+PNG_MAX_ERROR_TEXT]; - if (png_ptr == NULL) - png_error(png_ptr, error_message); - - else - { - png_format_buffer(png_ptr, msg, error_message); - png_error(png_ptr, msg); - } -} -#endif /* READ && ERROR_TEXT */ - -#ifdef PNG_WARNINGS_SUPPORTED -void PNGAPI -png_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message) -{ - char msg[18+PNG_MAX_ERROR_TEXT]; - if (png_ptr == NULL) - png_warning(png_ptr, warning_message); - - else - { - png_format_buffer(png_ptr, msg, warning_message); - png_warning(png_ptr, msg); - } -} -#endif /* WARNINGS */ - -#ifdef PNG_READ_SUPPORTED -#ifdef PNG_BENIGN_ERRORS_SUPPORTED -void PNGAPI -png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp - error_message) -{ - if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0) - png_chunk_warning(png_ptr, error_message); - - else - png_chunk_error(png_ptr, error_message); - -# ifndef PNG_ERROR_TEXT_SUPPORTED - PNG_UNUSED(error_message) -# endif -} -#endif -#endif /* READ */ - -void /* PRIVATE */ -png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error) -{ -# ifndef PNG_WARNINGS_SUPPORTED - PNG_UNUSED(message) -# endif - - /* This is always supported, but for just read or just write it - * unconditionally does the right thing. - */ -# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED) - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) -# endif - -# ifdef PNG_READ_SUPPORTED - { - if (error < PNG_CHUNK_ERROR) - png_chunk_warning(png_ptr, message); - - else - png_chunk_benign_error(png_ptr, message); - } -# endif - -# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED) - else if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0) -# endif - -# ifdef PNG_WRITE_SUPPORTED - { - if (error < PNG_CHUNK_WRITE_ERROR) - png_app_warning(png_ptr, message); - - else - png_app_error(png_ptr, message); - } -# endif -} - -#ifdef PNG_ERROR_TEXT_SUPPORTED -#ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_FUNCTION(void, -png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN) -{ -# define fixed_message "fixed point overflow in " -# define fixed_message_ln ((sizeof fixed_message)-1) - unsigned int iin; - char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT]; - memcpy(msg, fixed_message, fixed_message_ln); - iin = 0; - if (name != NULL) - while (iin < (PNG_MAX_ERROR_TEXT-1) && name[iin] != 0) - { - msg[fixed_message_ln + iin] = name[iin]; - ++iin; - } - msg[fixed_message_ln + iin] = 0; - png_error(png_ptr, msg); -} -#endif -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* This API only exists if ANSI-C style error handling is used, - * otherwise it is necessary for png_default_error to be overridden. - */ -jmp_buf* PNGAPI -png_set_longjmp_fn(png_structrp png_ptr, png_longjmp_ptr longjmp_fn, - size_t jmp_buf_size) -{ - /* From libpng 1.6.0 the app gets one chance to set a 'jmpbuf_size' value - * and it must not change after that. Libpng doesn't care how big the - * buffer is, just that it doesn't change. - * - * If the buffer size is no *larger* than the size of jmp_buf when libpng is - * compiled a built in jmp_buf is returned; this preserves the pre-1.6.0 - * semantics that this call will not fail. If the size is larger, however, - * the buffer is allocated and this may fail, causing the function to return - * NULL. - */ - if (png_ptr == NULL) - return NULL; - - if (png_ptr->jmp_buf_ptr == NULL) - { - png_ptr->jmp_buf_size = 0; /* not allocated */ - - if (jmp_buf_size <= (sizeof png_ptr->jmp_buf_local)) - png_ptr->jmp_buf_ptr = &png_ptr->jmp_buf_local; - - else - { - png_ptr->jmp_buf_ptr = png_voidcast(jmp_buf *, - png_malloc_warn(png_ptr, jmp_buf_size)); - - if (png_ptr->jmp_buf_ptr == NULL) - return NULL; /* new NULL return on OOM */ - - png_ptr->jmp_buf_size = jmp_buf_size; - } - } - - else /* Already allocated: check the size */ - { - size_t size = png_ptr->jmp_buf_size; - - if (size == 0) - { - size = (sizeof png_ptr->jmp_buf_local); - if (png_ptr->jmp_buf_ptr != &png_ptr->jmp_buf_local) - { - /* This is an internal error in libpng: somehow we have been left - * with a stack allocated jmp_buf when the application regained - * control. It's always possible to fix this up, but for the moment - * this is a png_error because that makes it easy to detect. - */ - png_error(png_ptr, "Libpng jmp_buf still allocated"); - /* png_ptr->jmp_buf_ptr = &png_ptr->jmp_buf_local; */ - } - } - - if (size != jmp_buf_size) - { - png_warning(png_ptr, "Application jmp_buf size changed"); - return NULL; /* caller will probably crash: no choice here */ - } - } - - /* Finally fill in the function, now we have a satisfactory buffer. It is - * valid to change the function on every call. - */ - png_ptr->longjmp_fn = longjmp_fn; - return png_ptr->jmp_buf_ptr; -} - -void /* PRIVATE */ -png_free_jmpbuf(png_structrp png_ptr) -{ - if (png_ptr != NULL) - { - jmp_buf *jb = png_ptr->jmp_buf_ptr; - - /* A size of 0 is used to indicate a local, stack, allocation of the - * pointer; used here and in png.c - */ - if (jb != NULL && png_ptr->jmp_buf_size > 0) - { - - /* This stuff is so that a failure to free the error control structure - * does not leave libpng in a state with no valid error handling: the - * free always succeeds, if there is an error it gets ignored. - */ - if (jb != &png_ptr->jmp_buf_local) - { - /* Make an internal, libpng, jmp_buf to return here */ - jmp_buf free_jmp_buf; - - if (!setjmp(free_jmp_buf)) - { - png_ptr->jmp_buf_ptr = &free_jmp_buf; /* come back here */ - png_ptr->jmp_buf_size = 0; /* stack allocation */ - png_ptr->longjmp_fn = longjmp; - png_free(png_ptr, jb); /* Return to setjmp on error */ - } - } - } - - /* *Always* cancel everything out: */ - png_ptr->jmp_buf_size = 0; - png_ptr->jmp_buf_ptr = NULL; - png_ptr->longjmp_fn = 0; - } -} -#endif - -/* This is the default error handling function. Note that replacements for - * this function MUST NOT RETURN, or the program will likely crash. This - * function is used by default, or if the program supplies NULL for the - * error function pointer in png_set_error_fn(). - */ -static PNG_FUNCTION(void /* PRIVATE */, -png_default_error,(png_const_structrp png_ptr, png_const_charp error_message), - PNG_NORETURN) -{ -#ifdef PNG_CONSOLE_IO_SUPPORTED -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - /* Check on NULL only added in 1.5.4 */ - if (error_message != NULL && *error_message == PNG_LITERAL_SHARP) - { - /* Strip "#nnnn " from beginning of error message. */ - int offset; - char error_number[16]; - for (offset = 0; offset<15; offset++) - { - error_number[offset] = error_message[offset + 1]; - if (error_message[offset] == ' ') - break; - } - - if ((offset > 1) && (offset < 15)) - { - error_number[offset - 1] = '\0'; - fprintf(stderr, "libpng error no. %s: %s", - error_number, error_message + offset + 1); - fprintf(stderr, PNG_STRING_NEWLINE); - } - - else - { - fprintf(stderr, "libpng error: %s, offset=%d", - error_message, offset); - fprintf(stderr, PNG_STRING_NEWLINE); - } - } - else -#endif - { - fprintf(stderr, "libpng error: %s", error_message ? error_message : - "undefined"); - fprintf(stderr, PNG_STRING_NEWLINE); - } -#else - PNG_UNUSED(error_message) /* Make compiler happy */ -#endif - png_longjmp(png_ptr, 1); -} - -PNG_FUNCTION(void,PNGAPI -png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN) -{ -#ifdef PNG_SETJMP_SUPPORTED - if (png_ptr != NULL && png_ptr->longjmp_fn != NULL && - png_ptr->jmp_buf_ptr != NULL) - png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val); -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(val) -#endif - - /* If control reaches this point, png_longjmp() must not return. The only - * choice is to terminate the whole process (or maybe the thread); to do - * this the ANSI-C abort() function is used unless a different method is - * implemented by overriding the default configuration setting for - * PNG_ABORT(). - */ - PNG_ABORT(); -} - -#ifdef PNG_WARNINGS_SUPPORTED -/* This function is called when there is a warning, but the library thinks - * it can continue anyway. Replacement functions don't have to do anything - * here if you don't want them to. In the default configuration, png_ptr is - * not used, but it is passed in case it may be useful. - */ -static void /* PRIVATE */ -png_default_warning(png_const_structrp png_ptr, png_const_charp warning_message) -{ -#ifdef PNG_CONSOLE_IO_SUPPORTED -# ifdef PNG_ERROR_NUMBERS_SUPPORTED - if (*warning_message == PNG_LITERAL_SHARP) - { - int offset; - char warning_number[16]; - for (offset = 0; offset < 15; offset++) - { - warning_number[offset] = warning_message[offset + 1]; - if (warning_message[offset] == ' ') - break; - } - - if ((offset > 1) && (offset < 15)) - { - warning_number[offset + 1] = '\0'; - fprintf(stderr, "libpng warning no. %s: %s", - warning_number, warning_message + offset); - fprintf(stderr, PNG_STRING_NEWLINE); - } - - else - { - fprintf(stderr, "libpng warning: %s", - warning_message); - fprintf(stderr, PNG_STRING_NEWLINE); - } - } - else -# endif - - { - fprintf(stderr, "libpng warning: %s", warning_message); - fprintf(stderr, PNG_STRING_NEWLINE); - } -#else - PNG_UNUSED(warning_message) /* Make compiler happy */ -#endif - PNG_UNUSED(png_ptr) /* Make compiler happy */ -} -#endif /* WARNINGS */ - -/* This function is called when the application wants to use another method - * of handling errors and warnings. Note that the error function MUST NOT - * return to the calling routine or serious problems will occur. The return - * method used in the default routine calls longjmp(png_ptr->jmp_buf_ptr, 1) - */ -void PNGAPI -png_set_error_fn(png_structrp png_ptr, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warning_fn) -{ - if (png_ptr == NULL) - return; - - png_ptr->error_ptr = error_ptr; - png_ptr->error_fn = error_fn; -#ifdef PNG_WARNINGS_SUPPORTED - png_ptr->warning_fn = warning_fn; -#else - PNG_UNUSED(warning_fn) -#endif -} - - -/* This function returns a pointer to the error_ptr associated with the user - * functions. The application should free any memory associated with this - * pointer before png_write_destroy and png_read_destroy are called. - */ -png_voidp PNGAPI -png_get_error_ptr(png_const_structrp png_ptr) -{ - if (png_ptr == NULL) - return NULL; - - return ((png_voidp)png_ptr->error_ptr); -} - - -#ifdef PNG_ERROR_NUMBERS_SUPPORTED -void PNGAPI -png_set_strip_error_numbers(png_structrp png_ptr, png_uint_32 strip_mode) -{ - if (png_ptr != NULL) - { - png_ptr->flags &= - ((~(PNG_FLAG_STRIP_ERROR_NUMBERS | - PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); - } -} -#endif - -#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ - defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) - /* Currently the above both depend on SETJMP_SUPPORTED, however it would be - * possible to implement without setjmp support just so long as there is some - * way to handle the error return here: - */ -PNG_FUNCTION(void /* PRIVATE */, (PNGCBAPI -png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message), - PNG_NORETURN) -{ - const png_const_structrp png_ptr = png_nonconst_ptr; - png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr); - - /* An error is always logged here, overwriting anything (typically a warning) - * that is already there: - */ - if (image != NULL) - { - png_safecat(image->message, (sizeof image->message), 0, error_message); - image->warning_or_error |= PNG_IMAGE_ERROR; - - /* Retrieve the jmp_buf from within the png_control, making this work for - * C++ compilation too is pretty tricky: C++ wants a pointer to the first - * element of a jmp_buf, but C doesn't tell us the type of that. - */ - if (image->opaque != NULL && image->opaque->error_buf != NULL) - longjmp(png_control_jmp_buf(image->opaque), 1); - - /* Missing longjmp buffer, the following is to help debugging: */ - { - size_t pos = png_safecat(image->message, (sizeof image->message), 0, - "bad longjmp: "); - png_safecat(image->message, (sizeof image->message), pos, - error_message); - } - } - - /* Here on an internal programming error. */ - abort(); -} - -#ifdef PNG_WARNINGS_SUPPORTED -void /* PRIVATE */ PNGCBAPI -png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message) -{ - const png_const_structrp png_ptr = png_nonconst_ptr; - png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr); - - /* A warning is only logged if there is no prior warning or error. */ - if (image->warning_or_error == 0) - { - png_safecat(image->message, (sizeof image->message), 0, warning_message); - image->warning_or_error |= PNG_IMAGE_WARNING; - } -} -#endif - -int /* PRIVATE */ -png_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg) -{ - volatile png_imagep image = image_in; - volatile int result; - volatile png_voidp saved_error_buf; - jmp_buf safe_jmpbuf; - - /* Safely execute function(arg) with png_error returning to this function. */ - saved_error_buf = image->opaque->error_buf; - result = setjmp(safe_jmpbuf) == 0; - - if (result != 0) - { - - image->opaque->error_buf = safe_jmpbuf; - result = function(arg); - } - - image->opaque->error_buf = saved_error_buf; - - /* And do the cleanup prior to any failure return. */ - if (result == 0) - png_image_free(image); - - return result; -} -#endif /* SIMPLIFIED READ || SIMPLIFIED_WRITE */ -#endif /* READ || WRITE */ diff --git a/jan/src/dep/libs/libpng/pngget.c b/jan/src/dep/libs/libpng/pngget.c deleted file mode 100644 index b21826127..000000000 --- a/jan/src/dep/libs/libpng/pngget.c +++ /dev/null @@ -1,1219 +0,0 @@ - -/* pngget.c - retrieval of values from info struct - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - */ - -#include "pngpriv.h" - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) - -png_uint_32 PNGAPI -png_get_valid(png_const_structrp png_ptr, png_const_inforp info_ptr, - png_uint_32 flag) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->valid & flag); - - return(0); -} - -png_size_t PNGAPI -png_get_rowbytes(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->rowbytes); - - return(0); -} - -#ifdef PNG_INFO_IMAGE_SUPPORTED -png_bytepp PNGAPI -png_get_rows(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->row_pointers); - - return(0); -} -#endif - -#ifdef PNG_EASY_ACCESS_SUPPORTED -/* Easy access to info, added in libpng-0.99 */ -png_uint_32 PNGAPI -png_get_image_width(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->width; - - return (0); -} - -png_uint_32 PNGAPI -png_get_image_height(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->height; - - return (0); -} - -png_byte PNGAPI -png_get_bit_depth(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->bit_depth; - - return (0); -} - -png_byte PNGAPI -png_get_color_type(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->color_type; - - return (0); -} - -png_byte PNGAPI -png_get_filter_type(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->filter_type; - - return (0); -} - -png_byte PNGAPI -png_get_interlace_type(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->interlace_type; - - return (0); -} - -png_byte PNGAPI -png_get_compression_type(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->compression_type; - - return (0); -} - -png_uint_32 PNGAPI -png_get_x_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp - info_ptr) -{ -#ifdef PNG_pHYs_SUPPORTED - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs) != 0) - { - png_debug1(1, "in %s retrieval function", - "png_get_x_pixels_per_meter"); - - if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER) - return (info_ptr->x_pixels_per_unit); - } -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(info_ptr) -#endif - - return (0); -} - -png_uint_32 PNGAPI -png_get_y_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp - info_ptr) -{ -#ifdef PNG_pHYs_SUPPORTED - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs) != 0) - { - png_debug1(1, "in %s retrieval function", - "png_get_y_pixels_per_meter"); - - if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER) - return (info_ptr->y_pixels_per_unit); - } -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(info_ptr) -#endif - - return (0); -} - -png_uint_32 PNGAPI -png_get_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ -#ifdef PNG_pHYs_SUPPORTED - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs) != 0) - { - png_debug1(1, "in %s retrieval function", "png_get_pixels_per_meter"); - - if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER && - info_ptr->x_pixels_per_unit == info_ptr->y_pixels_per_unit) - return (info_ptr->x_pixels_per_unit); - } -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(info_ptr) -#endif - - return (0); -} - -#ifdef PNG_FLOATING_POINT_SUPPORTED -float PNGAPI -png_get_pixel_aspect_ratio(png_const_structrp png_ptr, png_const_inforp - info_ptr) -{ -#ifdef PNG_READ_pHYs_SUPPORTED - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs) != 0) - { - png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio"); - - if (info_ptr->x_pixels_per_unit != 0) - return ((float)((float)info_ptr->y_pixels_per_unit - /(float)info_ptr->x_pixels_per_unit)); - } -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(info_ptr) -#endif - - return ((float)0.0); -} -#endif - -#ifdef PNG_FIXED_POINT_SUPPORTED -png_fixed_point PNGAPI -png_get_pixel_aspect_ratio_fixed(png_const_structrp png_ptr, - png_const_inforp info_ptr) -{ -#ifdef PNG_READ_pHYs_SUPPORTED - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs) != 0 && - info_ptr->x_pixels_per_unit > 0 && info_ptr->y_pixels_per_unit > 0 && - info_ptr->x_pixels_per_unit <= PNG_UINT_31_MAX && - info_ptr->y_pixels_per_unit <= PNG_UINT_31_MAX) - { - png_fixed_point res; - - png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio_fixed"); - - /* The following casts work because a PNG 4 byte integer only has a valid - * range of 0..2^31-1; otherwise the cast might overflow. - */ - if (png_muldiv(&res, (png_int_32)info_ptr->y_pixels_per_unit, PNG_FP_1, - (png_int_32)info_ptr->x_pixels_per_unit) != 0) - return res; - } -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(info_ptr) -#endif - - return 0; -} -#endif - -png_int_32 PNGAPI -png_get_x_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ -#ifdef PNG_oFFs_SUPPORTED - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_oFFs) != 0) - { - png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns"); - - if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER) - return (info_ptr->x_offset); - } -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(info_ptr) -#endif - - return (0); -} - -png_int_32 PNGAPI -png_get_y_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ -#ifdef PNG_oFFs_SUPPORTED - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_oFFs) != 0) - { - png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns"); - - if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER) - return (info_ptr->y_offset); - } -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(info_ptr) -#endif - - return (0); -} - -png_int_32 PNGAPI -png_get_x_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ -#ifdef PNG_oFFs_SUPPORTED - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_oFFs) != 0) - { - png_debug1(1, "in %s retrieval function", "png_get_x_offset_pixels"); - - if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL) - return (info_ptr->x_offset); - } -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(info_ptr) -#endif - - return (0); -} - -png_int_32 PNGAPI -png_get_y_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ -#ifdef PNG_oFFs_SUPPORTED - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_oFFs) != 0) - { - png_debug1(1, "in %s retrieval function", "png_get_y_offset_pixels"); - - if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL) - return (info_ptr->y_offset); - } -#else - PNG_UNUSED(png_ptr) - PNG_UNUSED(info_ptr) -#endif - - return (0); -} - -#ifdef PNG_INCH_CONVERSIONS_SUPPORTED -static png_uint_32 -ppi_from_ppm(png_uint_32 ppm) -{ -#if 0 - /* The conversion is *(2.54/100), in binary (32 digits): - * .00000110100000001001110101001001 - */ - png_uint_32 t1001, t1101; - ppm >>= 1; /* .1 */ - t1001 = ppm + (ppm >> 3); /* .1001 */ - t1101 = t1001 + (ppm >> 1); /* .1101 */ - ppm >>= 20; /* .000000000000000000001 */ - t1101 += t1101 >> 15; /* .1101000000000001101 */ - t1001 >>= 11; /* .000000000001001 */ - t1001 += t1001 >> 12; /* .000000000001001000000001001 */ - ppm += t1001; /* .000000000001001000001001001 */ - ppm += t1101; /* .110100000001001110101001001 */ - return (ppm + 16) >> 5;/* .00000110100000001001110101001001 */ -#else - /* The argument is a PNG unsigned integer, so it is not permitted - * to be bigger than 2^31. - */ - png_fixed_point result; - if (ppm <= PNG_UINT_31_MAX && png_muldiv(&result, (png_int_32)ppm, 127, - 5000) != 0) - return (png_uint_32)result; - - /* Overflow. */ - return 0; -#endif -} - -png_uint_32 PNGAPI -png_get_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - return ppi_from_ppm(png_get_pixels_per_meter(png_ptr, info_ptr)); -} - -png_uint_32 PNGAPI -png_get_x_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - return ppi_from_ppm(png_get_x_pixels_per_meter(png_ptr, info_ptr)); -} - -png_uint_32 PNGAPI -png_get_y_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - return ppi_from_ppm(png_get_y_pixels_per_meter(png_ptr, info_ptr)); -} - -#ifdef PNG_FIXED_POINT_SUPPORTED -static png_fixed_point -png_fixed_inches_from_microns(png_const_structrp png_ptr, png_int_32 microns) -{ - /* Convert from metres * 1,000,000 to inches * 100,000, meters to - * inches is simply *(100/2.54), so we want *(10/2.54) == 500/127. - * Notice that this can overflow - a warning is output and 0 is - * returned. - */ - return png_muldiv_warn(png_ptr, microns, 500, 127); -} - -png_fixed_point PNGAPI -png_get_x_offset_inches_fixed(png_const_structrp png_ptr, - png_const_inforp info_ptr) -{ - return png_fixed_inches_from_microns(png_ptr, - png_get_x_offset_microns(png_ptr, info_ptr)); -} -#endif - -#ifdef PNG_FIXED_POINT_SUPPORTED -png_fixed_point PNGAPI -png_get_y_offset_inches_fixed(png_const_structrp png_ptr, - png_const_inforp info_ptr) -{ - return png_fixed_inches_from_microns(png_ptr, - png_get_y_offset_microns(png_ptr, info_ptr)); -} -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -float PNGAPI -png_get_x_offset_inches(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - /* To avoid the overflow do the conversion directly in floating - * point. - */ - return (float)(png_get_x_offset_microns(png_ptr, info_ptr) * .00003937); -} -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -float PNGAPI -png_get_y_offset_inches(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - /* To avoid the overflow do the conversion directly in floating - * point. - */ - return (float)(png_get_y_offset_microns(png_ptr, info_ptr) * .00003937); -} -#endif - -#ifdef PNG_pHYs_SUPPORTED -png_uint_32 PNGAPI -png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr, - png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) -{ - png_uint_32 retval = 0; - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs) != 0) - { - png_debug1(1, "in %s retrieval function", "pHYs"); - - if (res_x != NULL) - { - *res_x = info_ptr->x_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - - if (res_y != NULL) - { - *res_y = info_ptr->y_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - - if (unit_type != NULL) - { - *unit_type = (int)info_ptr->phys_unit_type; - retval |= PNG_INFO_pHYs; - - if (*unit_type == 1) - { - if (res_x != NULL) *res_x = (png_uint_32)(*res_x * .0254 + .50); - if (res_y != NULL) *res_y = (png_uint_32)(*res_y * .0254 + .50); - } - } - } - - return (retval); -} -#endif /* pHYs */ -#endif /* INCH_CONVERSIONS */ - -/* png_get_channels really belongs in here, too, but it's been around longer */ - -#endif /* EASY_ACCESS */ - - -png_byte PNGAPI -png_get_channels(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->channels); - - return (0); -} - -#ifdef PNG_READ_SUPPORTED -png_const_bytep PNGAPI -png_get_signature(png_const_structrp png_ptr, png_const_inforp info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->signature); - - return (NULL); -} -#endif - -#ifdef PNG_bKGD_SUPPORTED -png_uint_32 PNGAPI -png_get_bKGD(png_const_structrp png_ptr, png_inforp info_ptr, - png_color_16p *background) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_bKGD) != 0 && - background != NULL) - { - png_debug1(1, "in %s retrieval function", "bKGD"); - - *background = &(info_ptr->background); - return (PNG_INFO_bKGD); - } - - return (0); -} -#endif - -#ifdef PNG_cHRM_SUPPORTED -/* The XYZ APIs were added in 1.5.5 to take advantage of the code added at the - * same time to correct the rgb grayscale coefficient defaults obtained from the - * cHRM chunk in 1.5.4 - */ -# ifdef PNG_FLOATING_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr, - double *white_x, double *white_y, double *red_x, double *red_y, - double *green_x, double *green_y, double *blue_x, double *blue_y) -{ - /* Quiet API change: this code used to only return the end points if a cHRM - * chunk was present, but the end points can also come from iCCP or sRGB - * chunks, so in 1.6.0 the png_get_ APIs return the end points regardless and - * the png_set_ APIs merely check that set end points are mutually - * consistent. - */ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) - { - png_debug1(1, "in %s retrieval function", "cHRM"); - - if (white_x != NULL) - *white_x = png_float(png_ptr, - info_ptr->colorspace.end_points_xy.whitex, "cHRM white X"); - if (white_y != NULL) - *white_y = png_float(png_ptr, - info_ptr->colorspace.end_points_xy.whitey, "cHRM white Y"); - if (red_x != NULL) - *red_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redx, - "cHRM red X"); - if (red_y != NULL) - *red_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redy, - "cHRM red Y"); - if (green_x != NULL) - *green_x = png_float(png_ptr, - info_ptr->colorspace.end_points_xy.greenx, "cHRM green X"); - if (green_y != NULL) - *green_y = png_float(png_ptr, - info_ptr->colorspace.end_points_xy.greeny, "cHRM green Y"); - if (blue_x != NULL) - *blue_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluex, - "cHRM blue X"); - if (blue_y != NULL) - *blue_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluey, - "cHRM blue Y"); - return (PNG_INFO_cHRM); - } - - return (0); -} - -png_uint_32 PNGAPI -png_get_cHRM_XYZ(png_const_structrp png_ptr, png_const_inforp info_ptr, - double *red_X, double *red_Y, double *red_Z, double *green_X, - double *green_Y, double *green_Z, double *blue_X, double *blue_Y, - double *blue_Z) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) - { - png_debug1(1, "in %s retrieval function", "cHRM_XYZ(float)"); - - if (red_X != NULL) - *red_X = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_X, - "cHRM red X"); - if (red_Y != NULL) - *red_Y = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Y, - "cHRM red Y"); - if (red_Z != NULL) - *red_Z = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Z, - "cHRM red Z"); - if (green_X != NULL) - *green_X = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.green_X, "cHRM green X"); - if (green_Y != NULL) - *green_Y = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.green_Y, "cHRM green Y"); - if (green_Z != NULL) - *green_Z = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.green_Z, "cHRM green Z"); - if (blue_X != NULL) - *blue_X = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.blue_X, "cHRM blue X"); - if (blue_Y != NULL) - *blue_Y = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.blue_Y, "cHRM blue Y"); - if (blue_Z != NULL) - *blue_Z = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.blue_Z, "cHRM blue Z"); - return (PNG_INFO_cHRM); - } - - return (0); -} -# endif - -# ifdef PNG_FIXED_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_cHRM_XYZ_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr, - png_fixed_point *int_red_X, png_fixed_point *int_red_Y, - png_fixed_point *int_red_Z, png_fixed_point *int_green_X, - png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, - png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, - png_fixed_point *int_blue_Z) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) - { - png_debug1(1, "in %s retrieval function", "cHRM_XYZ"); - - if (int_red_X != NULL) - *int_red_X = info_ptr->colorspace.end_points_XYZ.red_X; - if (int_red_Y != NULL) - *int_red_Y = info_ptr->colorspace.end_points_XYZ.red_Y; - if (int_red_Z != NULL) - *int_red_Z = info_ptr->colorspace.end_points_XYZ.red_Z; - if (int_green_X != NULL) - *int_green_X = info_ptr->colorspace.end_points_XYZ.green_X; - if (int_green_Y != NULL) - *int_green_Y = info_ptr->colorspace.end_points_XYZ.green_Y; - if (int_green_Z != NULL) - *int_green_Z = info_ptr->colorspace.end_points_XYZ.green_Z; - if (int_blue_X != NULL) - *int_blue_X = info_ptr->colorspace.end_points_XYZ.blue_X; - if (int_blue_Y != NULL) - *int_blue_Y = info_ptr->colorspace.end_points_XYZ.blue_Y; - if (int_blue_Z != NULL) - *int_blue_Z = info_ptr->colorspace.end_points_XYZ.blue_Z; - return (PNG_INFO_cHRM); - } - - return (0); -} - -png_uint_32 PNGAPI -png_get_cHRM_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr, - png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x, - png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y, - png_fixed_point *blue_x, png_fixed_point *blue_y) -{ - png_debug1(1, "in %s retrieval function", "cHRM"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) - { - if (white_x != NULL) - *white_x = info_ptr->colorspace.end_points_xy.whitex; - if (white_y != NULL) - *white_y = info_ptr->colorspace.end_points_xy.whitey; - if (red_x != NULL) - *red_x = info_ptr->colorspace.end_points_xy.redx; - if (red_y != NULL) - *red_y = info_ptr->colorspace.end_points_xy.redy; - if (green_x != NULL) - *green_x = info_ptr->colorspace.end_points_xy.greenx; - if (green_y != NULL) - *green_y = info_ptr->colorspace.end_points_xy.greeny; - if (blue_x != NULL) - *blue_x = info_ptr->colorspace.end_points_xy.bluex; - if (blue_y != NULL) - *blue_y = info_ptr->colorspace.end_points_xy.bluey; - return (PNG_INFO_cHRM); - } - - return (0); -} -# endif -#endif - -#ifdef PNG_gAMA_SUPPORTED -# ifdef PNG_FIXED_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_gAMA_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr, - png_fixed_point *file_gamma) -{ - png_debug1(1, "in %s retrieval function", "gAMA"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 && - file_gamma != NULL) - { - *file_gamma = info_ptr->colorspace.gamma; - return (PNG_INFO_gAMA); - } - - return (0); -} -# endif - -# ifdef PNG_FLOATING_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_gAMA(png_const_structrp png_ptr, png_const_inforp info_ptr, - double *file_gamma) -{ - png_debug1(1, "in %s retrieval function", "gAMA(float)"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 && - file_gamma != NULL) - { - *file_gamma = png_float(png_ptr, info_ptr->colorspace.gamma, - "png_get_gAMA"); - return (PNG_INFO_gAMA); - } - - return (0); -} -# endif -#endif - -#ifdef PNG_sRGB_SUPPORTED -png_uint_32 PNGAPI -png_get_sRGB(png_const_structrp png_ptr, png_const_inforp info_ptr, - int *file_srgb_intent) -{ - png_debug1(1, "in %s retrieval function", "sRGB"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sRGB) != 0 && file_srgb_intent != NULL) - { - *file_srgb_intent = info_ptr->colorspace.rendering_intent; - return (PNG_INFO_sRGB); - } - - return (0); -} -#endif - -#ifdef PNG_iCCP_SUPPORTED -png_uint_32 PNGAPI -png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr, - png_charpp name, int *compression_type, - png_bytepp profile, png_uint_32 *proflen) -{ - png_debug1(1, "in %s retrieval function", "iCCP"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_iCCP) != 0 && - name != NULL && compression_type != NULL && profile != NULL && - proflen != NULL) - { - *name = info_ptr->iccp_name; - *profile = info_ptr->iccp_profile; - *proflen = png_get_uint_32(info_ptr->iccp_profile); - /* This is somewhat irrelevant since the profile data returned has - * actually been uncompressed. - */ - *compression_type = PNG_COMPRESSION_TYPE_BASE; - return (PNG_INFO_iCCP); - } - - return (0); -} -#endif - -#ifdef PNG_sPLT_SUPPORTED -int PNGAPI -png_get_sPLT(png_const_structrp png_ptr, png_inforp info_ptr, - png_sPLT_tpp spalettes) -{ - if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL) - { - *spalettes = info_ptr->splt_palettes; - return info_ptr->splt_palettes_num; - } - - return (0); -} -#endif - -#ifdef PNG_hIST_SUPPORTED -png_uint_32 PNGAPI -png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr, - png_uint_16p *hist) -{ - png_debug1(1, "in %s retrieval function", "hIST"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_hIST) != 0 && hist != NULL) - { - *hist = info_ptr->hist; - return (PNG_INFO_hIST); - } - - return (0); -} -#endif - -png_uint_32 PNGAPI -png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr, - png_uint_32 *width, png_uint_32 *height, int *bit_depth, - int *color_type, int *interlace_type, int *compression_type, - int *filter_type) -{ - png_debug1(1, "in %s retrieval function", "IHDR"); - - if (png_ptr == NULL || info_ptr == NULL) - return (0); - - if (width != NULL) - *width = info_ptr->width; - - if (height != NULL) - *height = info_ptr->height; - - if (bit_depth != NULL) - *bit_depth = info_ptr->bit_depth; - - if (color_type != NULL) - *color_type = info_ptr->color_type; - - if (compression_type != NULL) - *compression_type = info_ptr->compression_type; - - if (filter_type != NULL) - *filter_type = info_ptr->filter_type; - - if (interlace_type != NULL) - *interlace_type = info_ptr->interlace_type; - - /* This is redundant if we can be sure that the info_ptr values were all - * assigned in png_set_IHDR(). We do the check anyhow in case an - * application has ignored our advice not to mess with the members - * of info_ptr directly. - */ - png_check_IHDR(png_ptr, info_ptr->width, info_ptr->height, - info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type, - info_ptr->compression_type, info_ptr->filter_type); - - return (1); -} - -#ifdef PNG_oFFs_SUPPORTED -png_uint_32 PNGAPI -png_get_oFFs(png_const_structrp png_ptr, png_const_inforp info_ptr, - png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type) -{ - png_debug1(1, "in %s retrieval function", "oFFs"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_oFFs) != 0 && - offset_x != NULL && offset_y != NULL && unit_type != NULL) - { - *offset_x = info_ptr->x_offset; - *offset_y = info_ptr->y_offset; - *unit_type = (int)info_ptr->offset_unit_type; - return (PNG_INFO_oFFs); - } - - return (0); -} -#endif - -#ifdef PNG_pCAL_SUPPORTED -png_uint_32 PNGAPI -png_get_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, - png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, - png_charp *units, png_charpp *params) -{ - png_debug1(1, "in %s retrieval function", "pCAL"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pCAL) != 0 && - purpose != NULL && X0 != NULL && X1 != NULL && type != NULL && - nparams != NULL && units != NULL && params != NULL) - { - *purpose = info_ptr->pcal_purpose; - *X0 = info_ptr->pcal_X0; - *X1 = info_ptr->pcal_X1; - *type = (int)info_ptr->pcal_type; - *nparams = (int)info_ptr->pcal_nparams; - *units = info_ptr->pcal_units; - *params = info_ptr->pcal_params; - return (PNG_INFO_pCAL); - } - - return (0); -} -#endif - -#ifdef PNG_sCAL_SUPPORTED -# ifdef PNG_FIXED_POINT_SUPPORTED -# if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \ - defined(PNG_FLOATING_POINT_SUPPORTED) -png_uint_32 PNGAPI -png_get_sCAL_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr, - int *unit, png_fixed_point *width, png_fixed_point *height) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sCAL) != 0) - { - *unit = info_ptr->scal_unit; - /*TODO: make this work without FP support; the API is currently eliminated - * if neither floating point APIs nor internal floating point arithmetic - * are enabled. - */ - *width = png_fixed(png_ptr, atof(info_ptr->scal_s_width), "sCAL width"); - *height = png_fixed(png_ptr, atof(info_ptr->scal_s_height), - "sCAL height"); - return (PNG_INFO_sCAL); - } - - return(0); -} -# endif /* FLOATING_ARITHMETIC */ -# endif /* FIXED_POINT */ -# ifdef PNG_FLOATING_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_sCAL(png_const_structrp png_ptr, png_const_inforp info_ptr, - int *unit, double *width, double *height) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sCAL) != 0) - { - *unit = info_ptr->scal_unit; - *width = atof(info_ptr->scal_s_width); - *height = atof(info_ptr->scal_s_height); - return (PNG_INFO_sCAL); - } - - return(0); -} -# endif /* FLOATING POINT */ -png_uint_32 PNGAPI -png_get_sCAL_s(png_const_structrp png_ptr, png_const_inforp info_ptr, - int *unit, png_charpp width, png_charpp height) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sCAL) != 0) - { - *unit = info_ptr->scal_unit; - *width = info_ptr->scal_s_width; - *height = info_ptr->scal_s_height; - return (PNG_INFO_sCAL); - } - - return(0); -} -#endif /* sCAL */ - -#ifdef PNG_pHYs_SUPPORTED -png_uint_32 PNGAPI -png_get_pHYs(png_const_structrp png_ptr, png_const_inforp info_ptr, - png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) -{ - png_uint_32 retval = 0; - - png_debug1(1, "in %s retrieval function", "pHYs"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs) != 0) - { - if (res_x != NULL) - { - *res_x = info_ptr->x_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - - if (res_y != NULL) - { - *res_y = info_ptr->y_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - - if (unit_type != NULL) - { - *unit_type = (int)info_ptr->phys_unit_type; - retval |= PNG_INFO_pHYs; - } - } - - return (retval); -} -#endif /* pHYs */ - -png_uint_32 PNGAPI -png_get_PLTE(png_const_structrp png_ptr, png_inforp info_ptr, - png_colorp *palette, int *num_palette) -{ - png_debug1(1, "in %s retrieval function", "PLTE"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_PLTE) != 0 && palette != NULL) - { - *palette = info_ptr->palette; - *num_palette = info_ptr->num_palette; - png_debug1(3, "num_palette = %d", *num_palette); - return (PNG_INFO_PLTE); - } - - return (0); -} - -#ifdef PNG_sBIT_SUPPORTED -png_uint_32 PNGAPI -png_get_sBIT(png_const_structrp png_ptr, png_inforp info_ptr, - png_color_8p *sig_bit) -{ - png_debug1(1, "in %s retrieval function", "sBIT"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sBIT) != 0 && sig_bit != NULL) - { - *sig_bit = &(info_ptr->sig_bit); - return (PNG_INFO_sBIT); - } - - return (0); -} -#endif - -#ifdef PNG_TEXT_SUPPORTED -int PNGAPI -png_get_text(png_const_structrp png_ptr, png_inforp info_ptr, - png_textp *text_ptr, int *num_text) -{ - if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) - { - png_debug1(1, "in 0x%lx retrieval function", - (unsigned long)png_ptr->chunk_name); - - if (text_ptr != NULL) - *text_ptr = info_ptr->text; - - if (num_text != NULL) - *num_text = info_ptr->num_text; - - return info_ptr->num_text; - } - - if (num_text != NULL) - *num_text = 0; - - return(0); -} -#endif - -#ifdef PNG_tIME_SUPPORTED -png_uint_32 PNGAPI -png_get_tIME(png_const_structrp png_ptr, png_inforp info_ptr, - png_timep *mod_time) -{ - png_debug1(1, "in %s retrieval function", "tIME"); - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_tIME) != 0 && mod_time != NULL) - { - *mod_time = &(info_ptr->mod_time); - return (PNG_INFO_tIME); - } - - return (0); -} -#endif - -#ifdef PNG_tRNS_SUPPORTED -png_uint_32 PNGAPI -png_get_tRNS(png_const_structrp png_ptr, png_inforp info_ptr, - png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color) -{ - png_uint_32 retval = 0; - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_tRNS) != 0) - { - png_debug1(1, "in %s retrieval function", "tRNS"); - - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (trans_alpha != NULL) - { - *trans_alpha = info_ptr->trans_alpha; - retval |= PNG_INFO_tRNS; - } - - if (trans_color != NULL) - *trans_color = &(info_ptr->trans_color); - } - - else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */ - { - if (trans_color != NULL) - { - *trans_color = &(info_ptr->trans_color); - retval |= PNG_INFO_tRNS; - } - - if (trans_alpha != NULL) - *trans_alpha = NULL; - } - - if (num_trans != NULL) - { - *num_trans = info_ptr->num_trans; - retval |= PNG_INFO_tRNS; - } - } - - return (retval); -} -#endif - -#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED -int PNGAPI -png_get_unknown_chunks(png_const_structrp png_ptr, png_inforp info_ptr, - png_unknown_chunkpp unknowns) -{ - if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL) - { - *unknowns = info_ptr->unknown_chunks; - return info_ptr->unknown_chunks_num; - } - - return (0); -} -#endif - -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED -png_byte PNGAPI -png_get_rgb_to_gray_status (png_const_structrp png_ptr) -{ - return (png_byte)(png_ptr ? png_ptr->rgb_to_gray_status : 0); -} -#endif - -#ifdef PNG_USER_CHUNKS_SUPPORTED -png_voidp PNGAPI -png_get_user_chunk_ptr(png_const_structrp png_ptr) -{ - return (png_ptr ? png_ptr->user_chunk_ptr : NULL); -} -#endif - -png_size_t PNGAPI -png_get_compression_buffer_size(png_const_structrp png_ptr) -{ - if (png_ptr == NULL) - return 0; - -#ifdef PNG_WRITE_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) -#endif - { -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED - return png_ptr->IDAT_read_size; -#else - return PNG_IDAT_READ_SIZE; -#endif - } - -#ifdef PNG_WRITE_SUPPORTED - else - return png_ptr->zbuffer_size; -#endif -} - -#ifdef PNG_SET_USER_LIMITS_SUPPORTED -/* These functions were added to libpng 1.2.6 and were enabled - * by default in libpng-1.4.0 */ -png_uint_32 PNGAPI -png_get_user_width_max (png_const_structrp png_ptr) -{ - return (png_ptr ? png_ptr->user_width_max : 0); -} - -png_uint_32 PNGAPI -png_get_user_height_max (png_const_structrp png_ptr) -{ - return (png_ptr ? png_ptr->user_height_max : 0); -} - -/* This function was added to libpng 1.4.0 */ -png_uint_32 PNGAPI -png_get_chunk_cache_max (png_const_structrp png_ptr) -{ - return (png_ptr ? png_ptr->user_chunk_cache_max : 0); -} - -/* This function was added to libpng 1.4.1 */ -png_alloc_size_t PNGAPI -png_get_chunk_malloc_max (png_const_structrp png_ptr) -{ - return (png_ptr ? png_ptr->user_chunk_malloc_max : 0); -} -#endif /* SET_USER_LIMITS */ - -/* These functions were added to libpng 1.4.0 */ -#ifdef PNG_IO_STATE_SUPPORTED -png_uint_32 PNGAPI -png_get_io_state (png_const_structrp png_ptr) -{ - return png_ptr->io_state; -} - -png_uint_32 PNGAPI -png_get_io_chunk_type (png_const_structrp png_ptr) -{ - return png_ptr->chunk_name; -} -#endif /* IO_STATE */ - -#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED -# ifdef PNG_GET_PALETTE_MAX_SUPPORTED -int PNGAPI -png_get_palette_max(png_const_structp png_ptr, png_const_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return png_ptr->num_palette_max; - - return (-1); -} -# endif -#endif - -#endif /* READ || WRITE */ diff --git a/jan/src/dep/libs/libpng/pnginfo.h b/jan/src/dep/libs/libpng/pnginfo.h deleted file mode 100644 index 036f58c25..000000000 --- a/jan/src/dep/libs/libpng/pnginfo.h +++ /dev/null @@ -1,259 +0,0 @@ - -/* pnginfo.h - header file for PNG reference library - * - * Last changed in libpng 1.6.1 [March 28, 2013] - * Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - - /* png_info is a structure that holds the information in a PNG file so - * that the application can find out the characteristics of the image. - * If you are reading the file, this structure will tell you what is - * in the PNG file. If you are writing the file, fill in the information - * you want to put into the PNG file, using png_set_*() functions, then - * call png_write_info(). - * - * The names chosen should be very close to the PNG specification, so - * consult that document for information about the meaning of each field. - * - * With libpng < 0.95, it was only possible to directly set and read the - * the values in the png_info_struct, which meant that the contents and - * order of the values had to remain fixed. With libpng 0.95 and later, - * however, there are now functions that abstract the contents of - * png_info_struct from the application, so this makes it easier to use - * libpng with dynamic libraries, and even makes it possible to use - * libraries that don't have all of the libpng ancillary chunk-handing - * functionality. In libpng-1.5.0 this was moved into a separate private - * file that is not visible to applications. - * - * The following members may have allocated storage attached that should be - * cleaned up before the structure is discarded: palette, trans, text, - * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, - * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these - * are automatically freed when the info structure is deallocated, if they were - * allocated internally by libpng. This behavior can be changed by means - * of the png_data_freer() function. - * - * More allocation details: all the chunk-reading functions that - * change these members go through the corresponding png_set_* - * functions. A function to clear these members is available: see - * png_free_data(). The png_set_* functions do not depend on being - * able to point info structure members to any of the storage they are - * passed (they make their own copies), EXCEPT that the png_set_text - * functions use the same storage passed to them in the text_ptr or - * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns - * functions do not make their own copies. - */ -#ifndef PNGINFO_H -#define PNGINFO_H - -struct png_info_def -{ - /* The following are necessary for every PNG file */ - png_uint_32 width; /* width of image in pixels (from IHDR) */ - png_uint_32 height; /* height of image in pixels (from IHDR) */ - png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ - png_size_t rowbytes; /* bytes needed to hold an untransformed row */ - png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ - png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ - png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ - png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ - png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ - /* The following three should have been named *_method not *_type */ - png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ - png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ - png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ - - /* The following are set by png_set_IHDR, called from the application on - * write, but the are never actually used by the write code. - */ - png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ - png_byte pixel_depth; /* number of bits per pixel */ - png_byte spare_byte; /* to align the data, and for future use */ - -#ifdef PNG_READ_SUPPORTED - /* This is never set during write */ - png_byte signature[8]; /* magic bytes read by libpng from start of file */ -#endif - - /* The rest of the data is optional. If you are reading, check the - * valid field to see if the information in these are valid. If you - * are writing, set the valid field to those chunks you want written, - * and initialize the appropriate fields below. - */ - -#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) - /* png_colorspace only contains 'flags' if neither GAMMA or COLORSPACE are - * defined. When COLORSPACE is switched on all the colorspace-defining - * chunks should be enabled, when GAMMA is switched on all the gamma-defining - * chunks should be enabled. If this is not done it becomes possible to read - * inconsistent PNG files and assign a probably incorrect interpretation to - * the information. (In other words, by carefully choosing which chunks to - * recognize the system configuration can select an interpretation for PNG - * files containing ambiguous data and this will result in inconsistent - * behavior between different libpng builds!) - */ - png_colorspace colorspace; -#endif - -#ifdef PNG_iCCP_SUPPORTED - /* iCCP chunk data. */ - png_charp iccp_name; /* profile name */ - png_bytep iccp_profile; /* International Color Consortium profile data */ - png_uint_32 iccp_proflen; /* ICC profile data length */ -#endif - -#ifdef PNG_TEXT_SUPPORTED - /* The tEXt, and zTXt chunks contain human-readable textual data in - * uncompressed, compressed, and optionally compressed forms, respectively. - * The data in "text" is an array of pointers to uncompressed, - * null-terminated C strings. Each chunk has a keyword that describes the - * textual data contained in that chunk. Keywords are not required to be - * unique, and the text string may be empty. Any number of text chunks may - * be in an image. - */ - int num_text; /* number of comments read or comments to write */ - int max_text; /* current size of text array */ - png_textp text; /* array of comments read or comments to write */ -#endif /* TEXT */ - -#ifdef PNG_tIME_SUPPORTED - /* The tIME chunk holds the last time the displayed image data was - * modified. See the png_time struct for the contents of this struct. - */ - png_time mod_time; -#endif - -#ifdef PNG_sBIT_SUPPORTED - /* The sBIT chunk specifies the number of significant high-order bits - * in the pixel data. Values are in the range [1, bit_depth], and are - * only specified for the channels in the pixel data. The contents of - * the low-order bits is not specified. Data is valid if - * (valid & PNG_INFO_sBIT) is non-zero. - */ - png_color_8 sig_bit; /* significant bits in color channels */ -#endif - -#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ -defined(PNG_READ_BACKGROUND_SUPPORTED) - /* The tRNS chunk supplies transparency data for paletted images and - * other image types that don't need a full alpha channel. There are - * "num_trans" transparency values for a paletted image, stored in the - * same order as the palette colors, starting from index 0. Values - * for the data are in the range [0, 255], ranging from fully transparent - * to fully opaque, respectively. For non-paletted images, there is a - * single color specified that should be treated as fully transparent. - * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. - */ - png_bytep trans_alpha; /* alpha values for paletted image */ - png_color_16 trans_color; /* transparent color for non-palette image */ -#endif - -#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - /* The bKGD chunk gives the suggested image background color if the - * display program does not have its own background color and the image - * is needs to composited onto a background before display. The colors - * in "background" are normally in the same color space/depth as the - * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. - */ - png_color_16 background; -#endif - -#ifdef PNG_oFFs_SUPPORTED - /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards - * and downwards from the top-left corner of the display, page, or other - * application-specific co-ordinate space. See the PNG_OFFSET_ defines - * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. - */ - png_int_32 x_offset; /* x offset on page */ - png_int_32 y_offset; /* y offset on page */ - png_byte offset_unit_type; /* offset units type */ -#endif - -#ifdef PNG_pHYs_SUPPORTED - /* The pHYs chunk gives the physical pixel density of the image for - * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ - * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. - */ - png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ - png_uint_32 y_pixels_per_unit; /* vertical pixel density */ - png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ -#endif - -#ifdef PNG_hIST_SUPPORTED - /* The hIST chunk contains the relative frequency or importance of the - * various palette entries, so that a viewer can intelligently select a - * reduced-color palette, if required. Data is an array of "num_palette" - * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) - * is non-zero. - */ - png_uint_16p hist; -#endif - -#ifdef PNG_pCAL_SUPPORTED - /* The pCAL chunk describes a transformation between the stored pixel - * values and original physical data values used to create the image. - * The integer range [0, 2^bit_depth - 1] maps to the floating-point - * range given by [pcal_X0, pcal_X1], and are further transformed by a - * (possibly non-linear) transformation function given by "pcal_type" - * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ - * defines below, and the PNG-Group's PNG extensions document for a - * complete description of the transformations and how they should be - * implemented, and for a description of the ASCII parameter strings. - * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. - */ - png_charp pcal_purpose; /* pCAL chunk description string */ - png_int_32 pcal_X0; /* minimum value */ - png_int_32 pcal_X1; /* maximum value */ - png_charp pcal_units; /* Latin-1 string giving physical units */ - png_charpp pcal_params; /* ASCII strings containing parameter values */ - png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ - png_byte pcal_nparams; /* number of parameters given in pcal_params */ -#endif - -/* New members added in libpng-1.0.6 */ - png_uint_32 free_me; /* flags items libpng is responsible for freeing */ - -#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED - /* Storage for unknown chunks that the library doesn't recognize. */ - png_unknown_chunkp unknown_chunks; - - /* The type of this field is limited by the type of - * png_struct::user_chunk_cache_max, else overflow can occur. - */ - int unknown_chunks_num; -#endif - -#ifdef PNG_sPLT_SUPPORTED - /* Data on sPLT chunks (there may be more than one). */ - png_sPLT_tp splt_palettes; - int splt_palettes_num; /* Match type returned by png_get API */ -#endif - -#ifdef PNG_sCAL_SUPPORTED - /* The sCAL chunk describes the actual physical dimensions of the - * subject matter of the graphic. The chunk contains a unit specification - * a byte value, and two ASCII strings representing floating-point - * values. The values are width and height corresponsing to one pixel - * in the image. Data values are valid if (valid & PNG_INFO_sCAL) is - * non-zero. - */ - png_byte scal_unit; /* unit of physical scale */ - png_charp scal_s_width; /* string containing height */ - png_charp scal_s_height; /* string containing width */ -#endif - -#ifdef PNG_INFO_IMAGE_SUPPORTED - /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) - non-zero */ - /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ - png_bytepp row_pointers; /* the image bits */ -#endif - -}; -#endif /* PNGINFO_H */ diff --git a/jan/src/dep/libs/libpng/pnglibconf.h b/jan/src/dep/libs/libpng/pnglibconf.h deleted file mode 100644 index 967b9e1cc..000000000 --- a/jan/src/dep/libs/libpng/pnglibconf.h +++ /dev/null @@ -1,215 +0,0 @@ -/* libpng 1.6.28 STANDARD API DEFINITION */ - -/* pnglibconf.h - library build configuration */ - -/* Libpng version 1.6.28 - January 5, 2017 */ - -/* Copyright (c) 1998-2015 Glenn Randers-Pehrson */ - -/* This code is released under the libpng license. */ -/* For conditions of distribution and use, see the disclaimer */ -/* and license in png.h */ - -/* pnglibconf.h */ -/* Machine generated file: DO NOT EDIT */ -/* Derived from: scripts/pnglibconf.dfa */ -#ifndef PNGLCONF_H -#define PNGLCONF_H -/* options */ -#define PNG_16BIT_SUPPORTED -#define PNG_ALIGNED_MEMORY_SUPPORTED -/*#undef PNG_ARM_NEON_API_SUPPORTED*/ -/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/ -#define PNG_BENIGN_ERRORS_SUPPORTED -#define PNG_BENIGN_READ_ERRORS_SUPPORTED -/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/ -#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED -#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED -#define PNG_COLORSPACE_SUPPORTED -#define PNG_CONSOLE_IO_SUPPORTED -#define PNG_CONVERT_tIME_SUPPORTED -#define PNG_EASY_ACCESS_SUPPORTED -/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ -#define PNG_ERROR_TEXT_SUPPORTED -#define PNG_FIXED_POINT_SUPPORTED -#define PNG_FLOATING_ARITHMETIC_SUPPORTED -#define PNG_FLOATING_POINT_SUPPORTED -#define PNG_FORMAT_AFIRST_SUPPORTED -#define PNG_FORMAT_BGR_SUPPORTED -#define PNG_GAMMA_SUPPORTED -#define PNG_GET_PALETTE_MAX_SUPPORTED -#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -#define PNG_INCH_CONVERSIONS_SUPPORTED -#define PNG_INFO_IMAGE_SUPPORTED -#define PNG_IO_STATE_SUPPORTED -#define PNG_MNG_FEATURES_SUPPORTED -#define PNG_POINTER_INDEXING_SUPPORTED -#define PNG_PROGRESSIVE_READ_SUPPORTED -#define PNG_READ_16BIT_SUPPORTED -#define PNG_READ_ALPHA_MODE_SUPPORTED -#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED -#define PNG_READ_BACKGROUND_SUPPORTED -#define PNG_READ_BGR_SUPPORTED -#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED -#define PNG_READ_COMPOSITE_NODIV_SUPPORTED -#define PNG_READ_COMPRESSED_TEXT_SUPPORTED -#define PNG_READ_EXPAND_16_SUPPORTED -#define PNG_READ_EXPAND_SUPPORTED -#define PNG_READ_FILLER_SUPPORTED -#define PNG_READ_GAMMA_SUPPORTED -#define PNG_READ_GET_PALETTE_MAX_SUPPORTED -#define PNG_READ_GRAY_TO_RGB_SUPPORTED -#define PNG_READ_INTERLACING_SUPPORTED -#define PNG_READ_INT_FUNCTIONS_SUPPORTED -#define PNG_READ_INVERT_ALPHA_SUPPORTED -#define PNG_READ_INVERT_SUPPORTED -#define PNG_READ_OPT_PLTE_SUPPORTED -#define PNG_READ_PACKSWAP_SUPPORTED -#define PNG_READ_PACK_SUPPORTED -#define PNG_READ_QUANTIZE_SUPPORTED -#define PNG_READ_RGB_TO_GRAY_SUPPORTED -#define PNG_READ_SCALE_16_TO_8_SUPPORTED -#define PNG_READ_SHIFT_SUPPORTED -#define PNG_READ_STRIP_16_TO_8_SUPPORTED -#define PNG_READ_STRIP_ALPHA_SUPPORTED -#define PNG_READ_SUPPORTED -#define PNG_READ_SWAP_ALPHA_SUPPORTED -#define PNG_READ_SWAP_SUPPORTED -#define PNG_READ_TEXT_SUPPORTED -#define PNG_READ_TRANSFORMS_SUPPORTED -#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -#define PNG_READ_USER_CHUNKS_SUPPORTED -#define PNG_READ_USER_TRANSFORM_SUPPORTED -#define PNG_READ_bKGD_SUPPORTED -#define PNG_READ_cHRM_SUPPORTED -#define PNG_READ_gAMA_SUPPORTED -#define PNG_READ_hIST_SUPPORTED -#define PNG_READ_iCCP_SUPPORTED -#define PNG_READ_iTXt_SUPPORTED -#define PNG_READ_oFFs_SUPPORTED -#define PNG_READ_pCAL_SUPPORTED -#define PNG_READ_pHYs_SUPPORTED -#define PNG_READ_sBIT_SUPPORTED -#define PNG_READ_sCAL_SUPPORTED -#define PNG_READ_sPLT_SUPPORTED -#define PNG_READ_sRGB_SUPPORTED -#define PNG_READ_tEXt_SUPPORTED -#define PNG_READ_tIME_SUPPORTED -#define PNG_READ_tRNS_SUPPORTED -#define PNG_READ_zTXt_SUPPORTED -#define PNG_SAVE_INT_32_SUPPORTED -#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED -#define PNG_SEQUENTIAL_READ_SUPPORTED -#define PNG_SETJMP_SUPPORTED -#define PNG_SET_OPTION_SUPPORTED -#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED -#define PNG_SET_USER_LIMITS_SUPPORTED -#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED -#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED -#define PNG_SIMPLIFIED_READ_SUPPORTED -#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED -#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED -#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED -#define PNG_SIMPLIFIED_WRITE_SUPPORTED -#define PNG_STDIO_SUPPORTED -#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED -#define PNG_TEXT_SUPPORTED -#define PNG_TIME_RFC1123_SUPPORTED -#define PNG_UNKNOWN_CHUNKS_SUPPORTED -#define PNG_USER_CHUNKS_SUPPORTED -#define PNG_USER_LIMITS_SUPPORTED -#define PNG_USER_MEM_SUPPORTED -#define PNG_USER_TRANSFORM_INFO_SUPPORTED -#define PNG_USER_TRANSFORM_PTR_SUPPORTED -#define PNG_WARNINGS_SUPPORTED -#define PNG_WRITE_16BIT_SUPPORTED -#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#define PNG_WRITE_BGR_SUPPORTED -#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED -#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED -#define PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED -#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED -#define PNG_WRITE_FILLER_SUPPORTED -#define PNG_WRITE_FILTER_SUPPORTED -#define PNG_WRITE_FLUSH_SUPPORTED -#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED -#define PNG_WRITE_INTERLACING_SUPPORTED -#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED -#define PNG_WRITE_INVERT_ALPHA_SUPPORTED -#define PNG_WRITE_INVERT_SUPPORTED -#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED -#define PNG_WRITE_PACKSWAP_SUPPORTED -#define PNG_WRITE_PACK_SUPPORTED -#define PNG_WRITE_SHIFT_SUPPORTED -#define PNG_WRITE_SUPPORTED -#define PNG_WRITE_SWAP_ALPHA_SUPPORTED -#define PNG_WRITE_SWAP_SUPPORTED -#define PNG_WRITE_TEXT_SUPPORTED -#define PNG_WRITE_TRANSFORMS_SUPPORTED -#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -#define PNG_WRITE_USER_TRANSFORM_SUPPORTED -#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -#define PNG_WRITE_bKGD_SUPPORTED -#define PNG_WRITE_cHRM_SUPPORTED -#define PNG_WRITE_gAMA_SUPPORTED -#define PNG_WRITE_hIST_SUPPORTED -#define PNG_WRITE_iCCP_SUPPORTED -#define PNG_WRITE_iTXt_SUPPORTED -#define PNG_WRITE_oFFs_SUPPORTED -#define PNG_WRITE_pCAL_SUPPORTED -#define PNG_WRITE_pHYs_SUPPORTED -#define PNG_WRITE_sBIT_SUPPORTED -#define PNG_WRITE_sCAL_SUPPORTED -#define PNG_WRITE_sPLT_SUPPORTED -#define PNG_WRITE_sRGB_SUPPORTED -#define PNG_WRITE_tEXt_SUPPORTED -#define PNG_WRITE_tIME_SUPPORTED -#define PNG_WRITE_tRNS_SUPPORTED -#define PNG_WRITE_zTXt_SUPPORTED -#define PNG_bKGD_SUPPORTED -#define PNG_cHRM_SUPPORTED -#define PNG_gAMA_SUPPORTED -#define PNG_hIST_SUPPORTED -#define PNG_iCCP_SUPPORTED -#define PNG_iTXt_SUPPORTED -#define PNG_oFFs_SUPPORTED -#define PNG_pCAL_SUPPORTED -#define PNG_pHYs_SUPPORTED -#define PNG_sBIT_SUPPORTED -#define PNG_sCAL_SUPPORTED -#define PNG_sPLT_SUPPORTED -#define PNG_sRGB_SUPPORTED -#define PNG_tEXt_SUPPORTED -#define PNG_tIME_SUPPORTED -#define PNG_tRNS_SUPPORTED -#define PNG_zTXt_SUPPORTED -/* end of options */ -/* settings */ -#define PNG_API_RULE 0 -#define PNG_DEFAULT_READ_MACROS 1 -#define PNG_GAMMA_THRESHOLD_FIXED 5000 -#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE -#define PNG_INFLATE_BUF_SIZE 1024 -#define PNG_LINKAGE_API extern -#define PNG_LINKAGE_CALLBACK extern -#define PNG_LINKAGE_DATA extern -#define PNG_LINKAGE_FUNCTION extern -#define PNG_MAX_GAMMA_8 11 -#define PNG_QUANTIZE_BLUE_BITS 5 -#define PNG_QUANTIZE_GREEN_BITS 5 -#define PNG_QUANTIZE_RED_BITS 5 -#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1) -#define PNG_TEXT_Z_DEFAULT_STRATEGY 0 -#define PNG_USER_CHUNK_CACHE_MAX 1000 -#define PNG_USER_CHUNK_MALLOC_MAX 8000000 -#define PNG_USER_HEIGHT_MAX 1000000 -#define PNG_USER_WIDTH_MAX 1000000 -#define PNG_ZBUF_SIZE 8192 -#define PNG_ZLIB_VERNUM 0 /* unknown */ -#define PNG_Z_DEFAULT_COMPRESSION (-1) -#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0 -#define PNG_Z_DEFAULT_STRATEGY 1 -#define PNG_sCAL_PRECISION 5 -#define PNG_sRGB_PROFILE_CHECKS 2 -/* end of settings */ -#endif /* PNGLCONF_H */ diff --git a/jan/src/dep/libs/libpng/pngmem.c b/jan/src/dep/libs/libpng/pngmem.c deleted file mode 100644 index 1a32adbca..000000000 --- a/jan/src/dep/libs/libpng/pngmem.c +++ /dev/null @@ -1,284 +0,0 @@ - -/* pngmem.c - stub functions for memory allocation - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - * This file provides a location for all memory allocation. Users who - * need special memory handling are expected to supply replacement - * functions for png_malloc() and png_free(), and to use - * png_create_read_struct_2() and png_create_write_struct_2() to - * identify the replacement functions. - */ - -#include "pngpriv.h" - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -/* Free a png_struct */ -void /* PRIVATE */ -png_destroy_png_struct(png_structrp png_ptr) -{ - if (png_ptr != NULL) - { - /* png_free might call png_error and may certainly call - * png_get_mem_ptr, so fake a temporary png_struct to support this. - */ - png_struct dummy_struct = *png_ptr; - memset(png_ptr, 0, (sizeof *png_ptr)); - png_free(&dummy_struct, png_ptr); - -# ifdef PNG_SETJMP_SUPPORTED - /* We may have a jmp_buf left to deallocate. */ - png_free_jmpbuf(&dummy_struct); -# endif - } -} - -/* Allocate memory. For reasonable files, size should never exceed - * 64K. However, zlib may allocate more than 64K if you don't tell - * it not to. See zconf.h and png.h for more information. zlib does - * need to allocate exactly 64K, so whatever you call here must - * have the ability to do that. - */ -PNG_FUNCTION(png_voidp,PNGAPI -png_calloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED) -{ - png_voidp ret; - - ret = png_malloc(png_ptr, size); - - if (ret != NULL) - memset(ret, 0, size); - - return ret; -} - -/* png_malloc_base, an internal function added at libpng 1.6.0, does the work of - * allocating memory, taking into account limits and PNG_USER_MEM_SUPPORTED. - * Checking and error handling must happen outside this routine; it returns NULL - * if the allocation cannot be done (for any reason.) - */ -PNG_FUNCTION(png_voidp /* PRIVATE */, -png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size), - PNG_ALLOCATED) -{ - /* Moved to png_malloc_base from png_malloc_default in 1.6.0; the DOS - * allocators have also been removed in 1.6.0, so any 16-bit system now has - * to implement a user memory handler. This checks to be sure it isn't - * called with big numbers. - */ -#ifndef PNG_USER_MEM_SUPPORTED - PNG_UNUSED(png_ptr) -#endif - - /* Some compilers complain that this is always true. However, it - * can be false when integer overflow happens. - */ - if (size > 0 && size <= PNG_SIZE_MAX -# ifdef PNG_MAX_MALLOC_64K - && size <= 65536U -# endif - ) - { -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr != NULL && png_ptr->malloc_fn != NULL) - return png_ptr->malloc_fn(png_constcast(png_structrp,png_ptr), size); - - else -#endif - return malloc((size_t)size); /* checked for truncation above */ - } - - else - return NULL; -} - -#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\ - defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) -/* This is really here only to work round a spurious warning in GCC 4.6 and 4.7 - * that arises because of the checks in png_realloc_array that are repeated in - * png_malloc_array. - */ -static png_voidp -png_malloc_array_checked(png_const_structrp png_ptr, int nelements, - size_t element_size) -{ - png_alloc_size_t req = (png_alloc_size_t)nelements; /* known to be > 0 */ - - if (req <= PNG_SIZE_MAX/element_size) - return png_malloc_base(png_ptr, req * element_size); - - /* The failure case when the request is too large */ - return NULL; -} - -PNG_FUNCTION(png_voidp /* PRIVATE */, -png_malloc_array,(png_const_structrp png_ptr, int nelements, - size_t element_size),PNG_ALLOCATED) -{ - if (nelements <= 0 || element_size == 0) - png_error(png_ptr, "internal error: array alloc"); - - return png_malloc_array_checked(png_ptr, nelements, element_size); -} - -PNG_FUNCTION(png_voidp /* PRIVATE */, -png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array, - int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED) -{ - /* These are internal errors: */ - if (add_elements <= 0 || element_size == 0 || old_elements < 0 || - (old_array == NULL && old_elements > 0)) - png_error(png_ptr, "internal error: array realloc"); - - /* Check for overflow on the elements count (so the caller does not have to - * check.) - */ - if (add_elements <= INT_MAX - old_elements) - { - png_voidp new_array = png_malloc_array_checked(png_ptr, - old_elements+add_elements, element_size); - - if (new_array != NULL) - { - /* Because png_malloc_array worked the size calculations below cannot - * overflow. - */ - if (old_elements > 0) - memcpy(new_array, old_array, element_size*(unsigned)old_elements); - - memset((char*)new_array + element_size*(unsigned)old_elements, 0, - element_size*(unsigned)add_elements); - - return new_array; - } - } - - return NULL; /* error */ -} -#endif /* TEXT || sPLT || STORE_UNKNOWN_CHUNKS */ - -/* Various functions that have different error handling are derived from this. - * png_malloc always exists, but if PNG_USER_MEM_SUPPORTED is defined a separate - * function png_malloc_default is also provided. - */ -PNG_FUNCTION(png_voidp,PNGAPI -png_malloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED) -{ - png_voidp ret; - - if (png_ptr == NULL) - return NULL; - - ret = png_malloc_base(png_ptr, size); - - if (ret == NULL) - png_error(png_ptr, "Out of memory"); /* 'm' means png_malloc */ - - return ret; -} - -#ifdef PNG_USER_MEM_SUPPORTED -PNG_FUNCTION(png_voidp,PNGAPI -png_malloc_default,(png_const_structrp png_ptr, png_alloc_size_t size), - PNG_ALLOCATED PNG_DEPRECATED) -{ - png_voidp ret; - - if (png_ptr == NULL) - return NULL; - - /* Passing 'NULL' here bypasses the application provided memory handler. */ - ret = png_malloc_base(NULL/*use malloc*/, size); - - if (ret == NULL) - png_error(png_ptr, "Out of Memory"); /* 'M' means png_malloc_default */ - - return ret; -} -#endif /* USER_MEM */ - -/* This function was added at libpng version 1.2.3. The png_malloc_warn() - * function will issue a png_warning and return NULL instead of issuing a - * png_error, if it fails to allocate the requested memory. - */ -PNG_FUNCTION(png_voidp,PNGAPI -png_malloc_warn,(png_const_structrp png_ptr, png_alloc_size_t size), - PNG_ALLOCATED) -{ - if (png_ptr != NULL) - { - png_voidp ret = png_malloc_base(png_ptr, size); - - if (ret != NULL) - return ret; - - png_warning(png_ptr, "Out of memory"); - } - - return NULL; -} - -/* Free a pointer allocated by png_malloc(). If ptr is NULL, return - * without taking any action. - */ -void PNGAPI -png_free(png_const_structrp png_ptr, png_voidp ptr) -{ - if (png_ptr == NULL || ptr == NULL) - return; - -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr->free_fn != NULL) - png_ptr->free_fn(png_constcast(png_structrp,png_ptr), ptr); - - else - png_free_default(png_ptr, ptr); -} - -PNG_FUNCTION(void,PNGAPI -png_free_default,(png_const_structrp png_ptr, png_voidp ptr),PNG_DEPRECATED) -{ - if (png_ptr == NULL || ptr == NULL) - return; -#endif /* USER_MEM */ - - free(ptr); -} - -#ifdef PNG_USER_MEM_SUPPORTED -/* This function is called when the application wants to use another method - * of allocating and freeing memory. - */ -void PNGAPI -png_set_mem_fn(png_structrp png_ptr, png_voidp mem_ptr, png_malloc_ptr - malloc_fn, png_free_ptr free_fn) -{ - if (png_ptr != NULL) - { - png_ptr->mem_ptr = mem_ptr; - png_ptr->malloc_fn = malloc_fn; - png_ptr->free_fn = free_fn; - } -} - -/* This function returns a pointer to the mem_ptr associated with the user - * functions. The application should free any memory associated with this - * pointer before png_write_destroy and png_read_destroy are called. - */ -png_voidp PNGAPI -png_get_mem_ptr(png_const_structrp png_ptr) -{ - if (png_ptr == NULL) - return NULL; - - return png_ptr->mem_ptr; -} -#endif /* USER_MEM */ -#endif /* READ || WRITE */ diff --git a/jan/src/dep/libs/libpng/pngpread.c b/jan/src/dep/libs/libpng/pngpread.c deleted file mode 100644 index aaf5acd07..000000000 --- a/jan/src/dep/libs/libpng/pngpread.c +++ /dev/null @@ -1,1095 +0,0 @@ - -/* pngpread.c - read a png file in push mode - * - * Last changed in libpng 1.6.24 [August 4, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -#include "pngpriv.h" - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - -/* Push model modes */ -#define PNG_READ_SIG_MODE 0 -#define PNG_READ_CHUNK_MODE 1 -#define PNG_READ_IDAT_MODE 2 -#define PNG_READ_tEXt_MODE 4 -#define PNG_READ_zTXt_MODE 5 -#define PNG_READ_DONE_MODE 6 -#define PNG_READ_iTXt_MODE 7 -#define PNG_ERROR_MODE 8 - -#define PNG_PUSH_SAVE_BUFFER_IF_FULL \ -if (png_ptr->push_length + 4 > png_ptr->buffer_size) \ - { png_push_save_buffer(png_ptr); return; } -#define PNG_PUSH_SAVE_BUFFER_IF_LT(N) \ -if (png_ptr->buffer_size < N) \ - { png_push_save_buffer(png_ptr); return; } - -void PNGAPI -png_process_data(png_structrp png_ptr, png_inforp info_ptr, - png_bytep buffer, png_size_t buffer_size) -{ - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_push_restore_buffer(png_ptr, buffer, buffer_size); - - while (png_ptr->buffer_size) - { - png_process_some_data(png_ptr, info_ptr); - } -} - -png_size_t PNGAPI -png_process_data_pause(png_structrp png_ptr, int save) -{ - if (png_ptr != NULL) - { - /* It's easiest for the caller if we do the save; then the caller doesn't - * have to supply the same data again: - */ - if (save != 0) - png_push_save_buffer(png_ptr); - else - { - /* This includes any pending saved bytes: */ - png_size_t remaining = png_ptr->buffer_size; - png_ptr->buffer_size = 0; - - /* So subtract the saved buffer size, unless all the data - * is actually 'saved', in which case we just return 0 - */ - if (png_ptr->save_buffer_size < remaining) - return remaining - png_ptr->save_buffer_size; - } - } - - return 0; -} - -png_uint_32 PNGAPI -png_process_data_skip(png_structrp png_ptr) -{ -/* TODO: Deprecate and remove this API. - * Somewhere the implementation of this seems to have been lost, - * or abandoned. It was only to support some internal back-door access - * to png_struct) in libpng-1.4.x. - */ - png_app_warning(png_ptr, -"png_process_data_skip is not implemented in any current version of libpng"); - return 0; -} - -/* What we do with the incoming data depends on what we were previously - * doing before we ran out of data... - */ -void /* PRIVATE */ -png_process_some_data(png_structrp png_ptr, png_inforp info_ptr) -{ - if (png_ptr == NULL) - return; - - switch (png_ptr->process_mode) - { - case PNG_READ_SIG_MODE: - { - png_push_read_sig(png_ptr, info_ptr); - break; - } - - case PNG_READ_CHUNK_MODE: - { - png_push_read_chunk(png_ptr, info_ptr); - break; - } - - case PNG_READ_IDAT_MODE: - { - png_push_read_IDAT(png_ptr); - break; - } - - default: - { - png_ptr->buffer_size = 0; - break; - } - } -} - -/* Read any remaining signature bytes from the stream and compare them with - * the correct PNG signature. It is possible that this routine is called - * with bytes already read from the signature, either because they have been - * checked by the calling application, or because of multiple calls to this - * routine. - */ -void /* PRIVATE */ -png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr) -{ - png_size_t num_checked = png_ptr->sig_bytes, /* SAFE, does not exceed 8 */ - num_to_check = 8 - num_checked; - - if (png_ptr->buffer_size < num_to_check) - { - num_to_check = png_ptr->buffer_size; - } - - png_push_fill_buffer(png_ptr, &(info_ptr->signature[num_checked]), - num_to_check); - png_ptr->sig_bytes = (png_byte)(png_ptr->sig_bytes + num_to_check); - - if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check)) - { - if (num_checked < 4 && - png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) - png_error(png_ptr, "Not a PNG file"); - - else - png_error(png_ptr, "PNG file corrupted by ASCII conversion"); - } - else - { - if (png_ptr->sig_bytes >= 8) - { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - } - } -} - -void /* PRIVATE */ -png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) -{ - png_uint_32 chunk_name; -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - int keep; /* unknown handling method */ -#endif - - /* First we make sure we have enough data for the 4-byte chunk name - * and the 4-byte chunk length before proceeding with decoding the - * chunk data. To fully decode each of these chunks, we also make - * sure we have enough data in the buffer for the 4-byte CRC at the - * end of every chunk (except IDAT, which is handled separately). - */ - if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0) - { - png_byte chunk_length[4]; - png_byte chunk_tag[4]; - - PNG_PUSH_SAVE_BUFFER_IF_LT(8) - png_push_fill_buffer(png_ptr, chunk_length, 4); - png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, chunk_tag, 4); - png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); - png_check_chunk_name(png_ptr, png_ptr->chunk_name); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - } - - chunk_name = png_ptr->chunk_name; - - if (chunk_name == png_IDAT) - { - if ((png_ptr->mode & PNG_AFTER_IDAT) != 0) - png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; - - /* If we reach an IDAT chunk, this means we have read all of the - * header chunks, and we can start reading the image (or if this - * is called after the image has been read - we have an error). - */ - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_error(png_ptr, "Missing IHDR before IDAT"); - - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - (png_ptr->mode & PNG_HAVE_PLTE) == 0) - png_error(png_ptr, "Missing PLTE before IDAT"); - - png_ptr->process_mode = PNG_READ_IDAT_MODE; - - if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - if ((png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) == 0) - if (png_ptr->push_length == 0) - return; - - png_ptr->mode |= PNG_HAVE_IDAT; - - if ((png_ptr->mode & PNG_AFTER_IDAT) != 0) - png_benign_error(png_ptr, "Too many IDATs found"); - } - - if (chunk_name == png_IHDR) - { - if (png_ptr->push_length != 13) - png_error(png_ptr, "Invalid IHDR length"); - - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length); - } - - else if (chunk_name == png_IEND) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length); - - png_ptr->process_mode = PNG_READ_DONE_MODE; - png_push_have_end(png_ptr, info_ptr); - } - -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, keep); - - if (chunk_name == png_PLTE) - png_ptr->mode |= PNG_HAVE_PLTE; - } -#endif - - else if (chunk_name == png_PLTE) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length); - } - - else if (chunk_name == png_IDAT) - { - png_ptr->idat_size = png_ptr->push_length; - png_ptr->process_mode = PNG_READ_IDAT_MODE; - png_push_have_info(png_ptr, info_ptr); - png_ptr->zstream.avail_out = - (uInt) PNG_ROWBYTES(png_ptr->pixel_depth, - png_ptr->iwidth) + 1; - png_ptr->zstream.next_out = png_ptr->row_buf; - return; - } - -#ifdef PNG_READ_gAMA_SUPPORTED - else if (png_ptr->chunk_name == png_gAMA) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_sBIT_SUPPORTED - else if (png_ptr->chunk_name == png_sBIT) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_cHRM_SUPPORTED - else if (png_ptr->chunk_name == png_cHRM) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_sRGB_SUPPORTED - else if (chunk_name == png_sRGB) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_iCCP_SUPPORTED - else if (png_ptr->chunk_name == png_iCCP) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_sPLT_SUPPORTED - else if (chunk_name == png_sPLT) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_tRNS_SUPPORTED - else if (chunk_name == png_tRNS) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_bKGD_SUPPORTED - else if (chunk_name == png_bKGD) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_hIST_SUPPORTED - else if (chunk_name == png_hIST) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_pHYs_SUPPORTED - else if (chunk_name == png_pHYs) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_oFFs_SUPPORTED - else if (chunk_name == png_oFFs) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length); - } -#endif - -#ifdef PNG_READ_pCAL_SUPPORTED - else if (chunk_name == png_pCAL) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_sCAL_SUPPORTED - else if (chunk_name == png_sCAL) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_tIME_SUPPORTED - else if (chunk_name == png_tIME) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_tEXt_SUPPORTED - else if (chunk_name == png_tEXt) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_zTXt_SUPPORTED - else if (chunk_name == png_zTXt) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#ifdef PNG_READ_iTXt_SUPPORTED - else if (chunk_name == png_iTXt) - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); - } -#endif - - else - { - PNG_PUSH_SAVE_BUFFER_IF_FULL - png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, - PNG_HANDLE_CHUNK_AS_DEFAULT); - } - - png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -} - -void PNGCBAPI -png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) -{ - png_bytep ptr; - - if (png_ptr == NULL) - return; - - ptr = buffer; - if (png_ptr->save_buffer_size != 0) - { - png_size_t save_size; - - if (length < png_ptr->save_buffer_size) - save_size = length; - - else - save_size = png_ptr->save_buffer_size; - - memcpy(ptr, png_ptr->save_buffer_ptr, save_size); - length -= save_size; - ptr += save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; - } - if (length != 0 && png_ptr->current_buffer_size != 0) - { - png_size_t save_size; - - if (length < png_ptr->current_buffer_size) - save_size = length; - - else - save_size = png_ptr->current_buffer_size; - - memcpy(ptr, png_ptr->current_buffer_ptr, save_size); - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; - } -} - -void /* PRIVATE */ -png_push_save_buffer(png_structrp png_ptr) -{ - if (png_ptr->save_buffer_size != 0) - { - if (png_ptr->save_buffer_ptr != png_ptr->save_buffer) - { - png_size_t i, istop; - png_bytep sp; - png_bytep dp; - - istop = png_ptr->save_buffer_size; - for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer; - i < istop; i++, sp++, dp++) - { - *dp = *sp; - } - } - } - if (png_ptr->save_buffer_size + png_ptr->current_buffer_size > - png_ptr->save_buffer_max) - { - png_size_t new_max; - png_bytep old_buffer; - - if (png_ptr->save_buffer_size > PNG_SIZE_MAX - - (png_ptr->current_buffer_size + 256)) - { - png_error(png_ptr, "Potential overflow of save_buffer"); - } - - new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256; - old_buffer = png_ptr->save_buffer; - png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr, - (png_size_t)new_max); - - if (png_ptr->save_buffer == NULL) - { - png_free(png_ptr, old_buffer); - png_error(png_ptr, "Insufficient memory for save_buffer"); - } - - if (old_buffer) - memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size); - else if (png_ptr->save_buffer_size) - png_error(png_ptr, "save_buffer error"); - png_free(png_ptr, old_buffer); - png_ptr->save_buffer_max = new_max; - } - if (png_ptr->current_buffer_size) - { - memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size, - png_ptr->current_buffer_ptr, png_ptr->current_buffer_size); - png_ptr->save_buffer_size += png_ptr->current_buffer_size; - png_ptr->current_buffer_size = 0; - } - png_ptr->save_buffer_ptr = png_ptr->save_buffer; - png_ptr->buffer_size = 0; -} - -void /* PRIVATE */ -png_push_restore_buffer(png_structrp png_ptr, png_bytep buffer, - png_size_t buffer_length) -{ - png_ptr->current_buffer = buffer; - png_ptr->current_buffer_size = buffer_length; - png_ptr->buffer_size = buffer_length + png_ptr->save_buffer_size; - png_ptr->current_buffer_ptr = png_ptr->current_buffer; -} - -void /* PRIVATE */ -png_push_read_IDAT(png_structrp png_ptr) -{ - if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0) - { - png_byte chunk_length[4]; - png_byte chunk_tag[4]; - - /* TODO: this code can be commoned up with the same code in push_read */ - PNG_PUSH_SAVE_BUFFER_IF_LT(8) - png_push_fill_buffer(png_ptr, chunk_length, 4); - png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, chunk_tag, 4); - png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - - if (png_ptr->chunk_name != png_IDAT) - { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - - if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0) - png_error(png_ptr, "Not enough compressed data"); - - return; - } - - png_ptr->idat_size = png_ptr->push_length; - } - - if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0) - { - png_size_t save_size = png_ptr->save_buffer_size; - png_uint_32 idat_size = png_ptr->idat_size; - - /* We want the smaller of 'idat_size' and 'current_buffer_size', but they - * are of different types and we don't know which variable has the fewest - * bits. Carefully select the smaller and cast it to the type of the - * larger - this cannot overflow. Do not cast in the following test - it - * will break on either 16-bit or 64-bit platforms. - */ - if (idat_size < save_size) - save_size = (png_size_t)idat_size; - - else - idat_size = (png_uint_32)save_size; - - png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size); - - png_process_IDAT_data(png_ptr, png_ptr->save_buffer_ptr, save_size); - - png_ptr->idat_size -= idat_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; - } - - if (png_ptr->idat_size != 0 && png_ptr->current_buffer_size != 0) - { - png_size_t save_size = png_ptr->current_buffer_size; - png_uint_32 idat_size = png_ptr->idat_size; - - /* We want the smaller of 'idat_size' and 'current_buffer_size', but they - * are of different types and we don't know which variable has the fewest - * bits. Carefully select the smaller and cast it to the type of the - * larger - this cannot overflow. - */ - if (idat_size < save_size) - save_size = (png_size_t)idat_size; - - else - idat_size = (png_uint_32)save_size; - - png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size); - - png_process_IDAT_data(png_ptr, png_ptr->current_buffer_ptr, save_size); - - png_ptr->idat_size -= idat_size; - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; - } - - if (png_ptr->idat_size == 0) - { - PNG_PUSH_SAVE_BUFFER_IF_LT(4) - png_crc_finish(png_ptr, 0); - png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->zowner = 0; - } -} - -void /* PRIVATE */ -png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer, - png_size_t buffer_length) -{ - /* The caller checks for a non-zero buffer length. */ - if (!(buffer_length > 0) || buffer == NULL) - png_error(png_ptr, "No IDAT data (internal error)"); - - /* This routine must process all the data it has been given - * before returning, calling the row callback as required to - * handle the uncompressed results. - */ - png_ptr->zstream.next_in = buffer; - /* TODO: WARNING: TRUNCATION ERROR: DANGER WILL ROBINSON: */ - png_ptr->zstream.avail_in = (uInt)buffer_length; - - /* Keep going until the decompressed data is all processed - * or the stream marked as finished. - */ - while (png_ptr->zstream.avail_in > 0 && - (png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0) - { - int ret; - - /* We have data for zlib, but we must check that zlib - * has someplace to put the results. It doesn't matter - * if we don't expect any results -- it may be the input - * data is just the LZ end code. - */ - if (!(png_ptr->zstream.avail_out > 0)) - { - /* TODO: WARNING: TRUNCATION ERROR: DANGER WILL ROBINSON: */ - png_ptr->zstream.avail_out = (uInt)(PNG_ROWBYTES(png_ptr->pixel_depth, - png_ptr->iwidth) + 1); - - png_ptr->zstream.next_out = png_ptr->row_buf; - } - - /* Using Z_SYNC_FLUSH here means that an unterminated - * LZ stream (a stream with a missing end code) can still - * be handled, otherwise (Z_NO_FLUSH) a future zlib - * implementation might defer output and therefore - * change the current behavior (see comments in inflate.c - * for why this doesn't happen at present with zlib 1.2.5). - */ - ret = PNG_INFLATE(png_ptr, Z_SYNC_FLUSH); - - /* Check for any failure before proceeding. */ - if (ret != Z_OK && ret != Z_STREAM_END) - { - /* Terminate the decompression. */ - png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; - png_ptr->zowner = 0; - - /* This may be a truncated stream (missing or - * damaged end code). Treat that as a warning. - */ - if (png_ptr->row_number >= png_ptr->num_rows || - png_ptr->pass > 6) - png_warning(png_ptr, "Truncated compressed data in IDAT"); - - else - { - if (ret == Z_DATA_ERROR) - png_benign_error(png_ptr, "IDAT: ADLER32 checksum mismatch"); - else - png_error(png_ptr, "Decompression error in IDAT"); - } - - /* Skip the check on unprocessed input */ - return; - } - - /* Did inflate output any data? */ - if (png_ptr->zstream.next_out != png_ptr->row_buf) - { - /* Is this unexpected data after the last row? - * If it is, artificially terminate the LZ output - * here. - */ - if (png_ptr->row_number >= png_ptr->num_rows || - png_ptr->pass > 6) - { - /* Extra data. */ - png_warning(png_ptr, "Extra compressed data in IDAT"); - png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; - png_ptr->zowner = 0; - - /* Do no more processing; skip the unprocessed - * input check below. - */ - return; - } - - /* Do we have a complete row? */ - if (png_ptr->zstream.avail_out == 0) - png_push_process_row(png_ptr); - } - - /* And check for the end of the stream. */ - if (ret == Z_STREAM_END) - png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; - } - - /* All the data should have been processed, if anything - * is left at this point we have bytes of IDAT data - * after the zlib end code. - */ - if (png_ptr->zstream.avail_in > 0) - png_warning(png_ptr, "Extra compression data in IDAT"); -} - -void /* PRIVATE */ -png_push_process_row(png_structrp png_ptr) -{ - /* 1.5.6: row_info moved out of png_struct to a local here. */ - png_row_info row_info; - - row_info.width = png_ptr->iwidth; /* NOTE: width of current interlaced row */ - row_info.color_type = png_ptr->color_type; - row_info.bit_depth = png_ptr->bit_depth; - row_info.channels = png_ptr->channels; - row_info.pixel_depth = png_ptr->pixel_depth; - row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width); - - if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE) - { - if (png_ptr->row_buf[0] < PNG_FILTER_VALUE_LAST) - png_read_filter_row(png_ptr, &row_info, png_ptr->row_buf + 1, - png_ptr->prev_row + 1, png_ptr->row_buf[0]); - else - png_error(png_ptr, "bad adaptive filter value"); - } - - /* libpng 1.5.6: the following line was copying png_ptr->rowbytes before - * 1.5.6, while the buffer really is this big in current versions of libpng - * it may not be in the future, so this was changed just to copy the - * interlaced row count: - */ - memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1); - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED - if (png_ptr->transformations != 0) - png_do_read_transformations(png_ptr, &row_info); -#endif - - /* The transformed pixel depth should match the depth now in row_info. */ - if (png_ptr->transformed_pixel_depth == 0) - { - png_ptr->transformed_pixel_depth = row_info.pixel_depth; - if (row_info.pixel_depth > png_ptr->maximum_pixel_depth) - png_error(png_ptr, "progressive row overflow"); - } - - else if (png_ptr->transformed_pixel_depth != row_info.pixel_depth) - png_error(png_ptr, "internal progressive row size calculation error"); - - -#ifdef PNG_READ_INTERLACING_SUPPORTED - /* Expand interlaced rows to full size */ - if (png_ptr->interlaced != 0 && - (png_ptr->transformations & PNG_INTERLACE) != 0) - { - if (png_ptr->pass < 6) - png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass, - png_ptr->transformations); - - switch (png_ptr->pass) - { - case 0: - { - int i; - for (i = 0; i < 8 && png_ptr->pass == 0; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); /* Updates png_ptr->pass */ - } - - if (png_ptr->pass == 2) /* Pass 1 might be empty */ - { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - if (png_ptr->pass == 4 && png_ptr->height <= 4) - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - if (png_ptr->pass == 6 && png_ptr->height <= 4) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - break; - } - - case 1: - { - int i; - for (i = 0; i < 8 && png_ptr->pass == 1; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 2) /* Skip top 4 generated rows */ - { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - break; - } - - case 2: - { - int i; - - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 4) /* Pass 3 might be empty */ - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - break; - } - - case 3: - { - int i; - - for (i = 0; i < 4 && png_ptr->pass == 3; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 4) /* Skip top two generated rows */ - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - break; - } - - case 4: - { - int i; - - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 6) /* Pass 5 might be empty */ - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - break; - } - - case 5: - { - int i; - - for (i = 0; i < 2 && png_ptr->pass == 5; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 6) /* Skip top generated row */ - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - break; - } - - default: - case 6: - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - - if (png_ptr->pass != 6) - break; - - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - } - else -#endif - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } -} - -void /* PRIVATE */ -png_read_push_finish_row(png_structrp png_ptr) -{ -#ifdef PNG_READ_INTERLACING_SUPPORTED - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; - - /* Height of interlace block. This is not currently used - if you need - * it, uncomment it here and in png.h - static PNG_CONST png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; - */ -#endif - - png_ptr->row_number++; - if (png_ptr->row_number < png_ptr->num_rows) - return; - -#ifdef PNG_READ_INTERLACING_SUPPORTED - if (png_ptr->interlaced != 0) - { - png_ptr->row_number = 0; - memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); - - do - { - png_ptr->pass++; - if ((png_ptr->pass == 1 && png_ptr->width < 5) || - (png_ptr->pass == 3 && png_ptr->width < 3) || - (png_ptr->pass == 5 && png_ptr->width < 2)) - png_ptr->pass++; - - if (png_ptr->pass > 7) - png_ptr->pass--; - - if (png_ptr->pass >= 7) - break; - - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - if ((png_ptr->transformations & PNG_INTERLACE) != 0) - break; - - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - - } while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0); - } -#endif /* READ_INTERLACING */ -} - -void /* PRIVATE */ -png_push_have_info(png_structrp png_ptr, png_inforp info_ptr) -{ - if (png_ptr->info_fn != NULL) - (*(png_ptr->info_fn))(png_ptr, info_ptr); -} - -void /* PRIVATE */ -png_push_have_end(png_structrp png_ptr, png_inforp info_ptr) -{ - if (png_ptr->end_fn != NULL) - (*(png_ptr->end_fn))(png_ptr, info_ptr); -} - -void /* PRIVATE */ -png_push_have_row(png_structrp png_ptr, png_bytep row) -{ - if (png_ptr->row_fn != NULL) - (*(png_ptr->row_fn))(png_ptr, row, png_ptr->row_number, - (int)png_ptr->pass); -} - -#ifdef PNG_READ_INTERLACING_SUPPORTED -void PNGAPI -png_progressive_combine_row(png_const_structrp png_ptr, png_bytep old_row, - png_const_bytep new_row) -{ - if (png_ptr == NULL) - return; - - /* new_row is a flag here - if it is NULL then the app callback was called - * from an empty row (see the calls to png_struct::row_fn below), otherwise - * it must be png_ptr->row_buf+1 - */ - if (new_row != NULL) - png_combine_row(png_ptr, old_row, 1/*blocky display*/); -} -#endif /* READ_INTERLACING */ - -void PNGAPI -png_set_progressive_read_fn(png_structrp png_ptr, png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn) -{ - if (png_ptr == NULL) - return; - - png_ptr->info_fn = info_fn; - png_ptr->row_fn = row_fn; - png_ptr->end_fn = end_fn; - - png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); -} - -png_voidp PNGAPI -png_get_progressive_ptr(png_const_structrp png_ptr) -{ - if (png_ptr == NULL) - return (NULL); - - return png_ptr->io_ptr; -} -#endif /* PROGRESSIVE_READ */ diff --git a/jan/src/dep/libs/libpng/pngpriv.h b/jan/src/dep/libs/libpng/pngpriv.h deleted file mode 100644 index fd23daff7..000000000 --- a/jan/src/dep/libs/libpng/pngpriv.h +++ /dev/null @@ -1,2008 +0,0 @@ - -/* pngpriv.h - private declarations for use inside libpng - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -/* The symbols declared in this file (including the functions declared - * as extern) are PRIVATE. They are not part of the libpng public - * interface, and are not recommended for use by regular applications. - * Some of them may become public in the future; others may stay private, - * change in an incompatible way, or even disappear. - * Although the libpng users are not forbidden to include this header, - * they should be well aware of the issues that may arise from doing so. - */ - -#ifndef PNGPRIV_H -#define PNGPRIV_H - -/* Feature Test Macros. The following are defined here to ensure that correctly - * implemented libraries reveal the APIs libpng needs to build and hide those - * that are not needed and potentially damaging to the compilation. - * - * Feature Test Macros must be defined before any system header is included (see - * POSIX 1003.1 2.8.2 "POSIX Symbols." - * - * These macros only have an effect if the operating system supports either - * POSIX 1003.1 or C99, or both. On other operating systems (particularly - * Windows/Visual Studio) there is no effect; the OS specific tests below are - * still required (as of 2011-05-02.) - */ -#define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */ - -#ifndef PNG_VERSION_INFO_ONLY -/* Standard library headers not required by png.h: */ -# include -# include -#endif - -#define PNGLIB_BUILD /*libpng is being built, not used*/ - -/* If HAVE_CONFIG_H is defined during the build then the build system must - * provide an appropriate "config.h" file on the include path. The header file - * must provide definitions as required below (search for "HAVE_CONFIG_H"); - * see configure.ac for more details of the requirements. The macro - * "PNG_NO_CONFIG_H" is provided for maintainers to test for dependencies on - * 'configure'; define this macro to prevent the configure build including the - * configure generated config.h. Libpng is expected to compile without *any* - * special build system support on a reasonably ANSI-C compliant system. - */ -#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) -# include - - /* Pick up the definition of 'restrict' from config.h if it was read: */ -# define PNG_RESTRICT restrict -#endif - -/* To support symbol prefixing it is necessary to know *before* including png.h - * whether the fixed point (and maybe other) APIs are exported, because if they - * are not internal definitions may be required. This is handled below just - * before png.h is included, but load the configuration now if it is available. - */ -#ifndef PNGLCONF_H -# include "pnglibconf.h" -#endif - -/* Local renames may change non-exported API functions from png.h */ -#if defined(PNG_PREFIX) && !defined(PNGPREFIX_H) -# include "pngprefix.h" -#endif - -#ifdef PNG_USER_CONFIG -# include "pngusr.h" - /* These should have been defined in pngusr.h */ -# ifndef PNG_USER_PRIVATEBUILD -# define PNG_USER_PRIVATEBUILD "Custom libpng build" -# endif -# ifndef PNG_USER_DLLFNAME_POSTFIX -# define PNG_USER_DLLFNAME_POSTFIX "Cb" -# endif -#endif - -/* Compile time options. - * ===================== - * In a multi-arch build the compiler may compile the code several times for the - * same object module, producing different binaries for different architectures. - * When this happens configure-time setting of the target host options cannot be - * done and this interferes with the handling of the ARM NEON optimizations, and - * possibly other similar optimizations. Put additional tests here; in general - * this is needed when the same option can be changed at both compile time and - * run time depending on the target OS (i.e. iOS vs Android.) - * - * NOTE: symbol prefixing does not pass $(CFLAGS) to the preprocessor, because - * this is not possible with certain compilers (Oracle SUN OS CC), as a result - * it is necessary to ensure that all extern functions that *might* be used - * regardless of $(CFLAGS) get declared in this file. The test on __ARM_NEON__ - * below is one example of this behavior because it is controlled by the - * presence or not of -mfpu=neon on the GCC command line, it is possible to do - * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely - * do this. - */ -#ifndef PNG_ARM_NEON_OPT - /* ARM NEON optimizations are being controlled by the compiler settings, - * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon - * with GCC) then the compiler will define __ARM_NEON__ and we can rely - * unconditionally on NEON instructions not crashing, otherwise we must - * disable use of NEON instructions. - * - * NOTE: at present these optimizations depend on 'ALIGNED_MEMORY', so they - * can only be turned on automatically if that is supported too. If - * PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail - * to compile with an appropriate #error if ALIGNED_MEMORY has been turned - * off. - * - * Note that gcc-4.9 defines __ARM_NEON instead of the deprecated - * __ARM_NEON__, so we check both variants. - * - * To disable ARM_NEON optimizations entirely, and skip compiling the - * associated assembler code, pass --enable-arm-neon=no to configure - * or put -DPNG_ARM_NEON_OPT=0 in CPPFLAGS. - */ -# if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \ - defined(PNG_ALIGNED_MEMORY_SUPPORTED) -# define PNG_ARM_NEON_OPT 2 -# else -# define PNG_ARM_NEON_OPT 0 -# endif -#endif - -#if PNG_ARM_NEON_OPT > 0 - /* NEON optimizations are to be at least considered by libpng, so enable the - * callbacks to do this. - */ -# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon - - /* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used - * if possible - if __ARM_NEON__ is set and the compiler version is not known - * to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can - * be: - * - * 1 The intrinsics code (the default with __ARM_NEON__) - * 2 The hand coded assembler (the default without __ARM_NEON__) - * - * It is possible to set PNG_ARM_NEON_IMPLEMENTATION in CPPFLAGS, however - * this is *NOT* supported and may cease to work even after a minor revision - * to libpng. It *is* valid to do this for testing purposes, e.g. speed - * testing or a new compiler, but the results should be communicated to the - * libpng implementation list for incorporation in the next minor release. - */ -# ifndef PNG_ARM_NEON_IMPLEMENTATION -# if defined(__ARM_NEON__) || defined(__ARM_NEON) -# if defined(__clang__) - /* At present it is unknown by the libpng developers which versions - * of clang support the intrinsics, however some or perhaps all - * versions do not work with the assembler so this may be - * irrelevant, so just use the default (do nothing here.) - */ -# elif defined(__GNUC__) - /* GCC 4.5.4 NEON support is known to be broken. 4.6.3 is known to - * work, so if this *is* GCC, or G++, look for a version >4.5 - */ -# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) -# define PNG_ARM_NEON_IMPLEMENTATION 2 -# endif /* no GNUC support */ -# endif /* __GNUC__ */ -# else /* !defined __ARM_NEON__ */ - /* The 'intrinsics' code simply won't compile without this -mfpu=neon: - */ -# define PNG_ARM_NEON_IMPLEMENTATION 2 -# endif /* __ARM_NEON__ */ -# endif /* !PNG_ARM_NEON_IMPLEMENTATION */ - -# ifndef PNG_ARM_NEON_IMPLEMENTATION - /* Use the intrinsics code by default. */ -# define PNG_ARM_NEON_IMPLEMENTATION 1 -# endif -#endif /* PNG_ARM_NEON_OPT > 0 */ - -#ifndef PNG_MIPS_MSA_OPT -# if defined(__mips_msa) && (__mips_isa_rev >= 5) && defined(PNG_ALIGNED_MEMORY_SUPPORTED) -# define PNG_MIPS_MSA_OPT 2 -# else -# define PNG_MIPS_MSA_OPT 0 -# endif -#endif - -#if PNG_MIPS_MSA_OPT > 0 -# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa -# ifndef PNG_MIPS_MSA_IMPLEMENTATION -# if defined(__mips_msa) -# if defined(__clang__) -# elif defined(__GNUC__) -# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) -# define PNG_MIPS_MSA_IMPLEMENTATION 2 -# endif /* no GNUC support */ -# endif /* __GNUC__ */ -# else /* !defined __mips_msa */ -# define PNG_MIPS_MSA_IMPLEMENTATION 2 -# endif /* __mips_msa */ -# endif /* !PNG_MIPS_MSA_IMPLEMENTATION */ - -# ifndef PNG_MIPS_MSA_IMPLEMENTATION -# define PNG_MIPS_MSA_IMPLEMENTATION 1 -# endif -#endif /* PNG_MIPS_MSA_OPT > 0 */ - - -/* Is this a build of a DLL where compilation of the object modules requires - * different preprocessor settings to those required for a simple library? If - * so PNG_BUILD_DLL must be set. - * - * If libpng is used inside a DLL but that DLL does not export the libpng APIs - * PNG_BUILD_DLL must not be set. To avoid the code below kicking in build a - * static library of libpng then link the DLL against that. - */ -#ifndef PNG_BUILD_DLL -# ifdef DLL_EXPORT - /* This is set by libtool when files are compiled for a DLL; libtool - * always compiles twice, even on systems where it isn't necessary. Set - * PNG_BUILD_DLL in case it is necessary: - */ -# define PNG_BUILD_DLL -# else -# ifdef _WINDLL - /* This is set by the Microsoft Visual Studio IDE in projects that - * build a DLL. It can't easily be removed from those projects (it - * isn't visible in the Visual Studio UI) so it is a fairly reliable - * indication that PNG_IMPEXP needs to be set to the DLL export - * attributes. - */ -# define PNG_BUILD_DLL -# else -# ifdef __DLL__ - /* This is set by the Borland C system when compiling for a DLL - * (as above.) - */ -# define PNG_BUILD_DLL -# else - /* Add additional compiler cases here. */ -# endif -# endif -# endif -#endif /* Setting PNG_BUILD_DLL if required */ - -/* See pngconf.h for more details: the builder of the library may set this on - * the command line to the right thing for the specific compilation system or it - * may be automagically set above (at present we know of no system where it does - * need to be set on the command line.) - * - * PNG_IMPEXP must be set here when building the library to prevent pngconf.h - * setting it to the "import" setting for a DLL build. - */ -#ifndef PNG_IMPEXP -# ifdef PNG_BUILD_DLL -# define PNG_IMPEXP PNG_DLL_EXPORT -# else - /* Not building a DLL, or the DLL doesn't require specific export - * definitions. - */ -# define PNG_IMPEXP -# endif -#endif - -/* No warnings for private or deprecated functions in the build: */ -#ifndef PNG_DEPRECATED -# define PNG_DEPRECATED -#endif -#ifndef PNG_PRIVATE -# define PNG_PRIVATE -#endif - -/* Symbol preprocessing support. - * - * To enable listing global, but internal, symbols the following macros should - * always be used to declare an extern data or function object in this file. - */ -#ifndef PNG_INTERNAL_DATA -# define PNG_INTERNAL_DATA(type, name, array) PNG_LINKAGE_DATA type name array -#endif - -#ifndef PNG_INTERNAL_FUNCTION -# define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\ - PNG_LINKAGE_FUNCTION PNG_FUNCTION(type, name, args, PNG_EMPTY attributes) -#endif - -#ifndef PNG_INTERNAL_CALLBACK -# define PNG_INTERNAL_CALLBACK(type, name, args, attributes)\ - PNG_LINKAGE_CALLBACK PNG_FUNCTION(type, (PNGCBAPI name), args,\ - PNG_EMPTY attributes) -#endif - -/* If floating or fixed point APIs are disabled they may still be compiled - * internally. To handle this make sure they are declared as the appropriate - * internal extern function (otherwise the symbol prefixing stuff won't work and - * the functions will be used without definitions.) - * - * NOTE: although all the API functions are declared here they are not all - * actually built! Because the declarations are still made it is necessary to - * fake out types that they depend on. - */ -#ifndef PNG_FP_EXPORT -# ifndef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FP_EXPORT(ordinal, type, name, args)\ - PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); -# ifndef PNG_VERSION_INFO_ONLY - typedef struct png_incomplete png_double; - typedef png_double* png_doublep; - typedef const png_double* png_const_doublep; - typedef png_double** png_doublepp; -# endif -# endif -#endif -#ifndef PNG_FIXED_EXPORT -# ifndef PNG_FIXED_POINT_SUPPORTED -# define PNG_FIXED_EXPORT(ordinal, type, name, args)\ - PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); -# endif -#endif - -#include "png.h" - -/* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */ -#ifndef PNG_DLL_EXPORT -# define PNG_DLL_EXPORT -#endif - -/* This is a global switch to set the compilation for an installed system - * (a release build). It can be set for testing debug builds to ensure that - * they will compile when the build type is switched to RC or STABLE, the - * default is just to use PNG_LIBPNG_BUILD_BASE_TYPE. Set this in CPPFLAGS - * with either: - * - * -DPNG_RELEASE_BUILD Turns on the release compile path - * -DPNG_RELEASE_BUILD=0 Turns it off - * or in your pngusr.h with - * #define PNG_RELEASE_BUILD=1 Turns on the release compile path - * #define PNG_RELEASE_BUILD=0 Turns it off - */ -#ifndef PNG_RELEASE_BUILD -# define PNG_RELEASE_BUILD (PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC) -#endif - -/* SECURITY and SAFETY: - * - * libpng is built with support for internal limits on image dimensions and - * memory usage. These are documented in scripts/pnglibconf.dfa of the - * source and recorded in the machine generated header file pnglibconf.h. - */ - -/* If you are running on a machine where you cannot allocate more - * than 64K of memory at once, uncomment this. While libpng will not - * normally need that much memory in a chunk (unless you load up a very - * large file), zlib needs to know how big of a chunk it can use, and - * libpng thus makes sure to check any memory allocation to verify it - * will fit into memory. - * - * zlib provides 'MAXSEG_64K' which, if defined, indicates the - * same limit and pngconf.h (already included) sets the limit - * if certain operating systems are detected. - */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) -# define PNG_MAX_MALLOC_64K -#endif - -#ifndef PNG_UNUSED -/* Unused formal parameter warnings are silenced using the following macro - * which is expected to have no bad effects on performance (optimizing - * compilers will probably remove it entirely). Note that if you replace - * it with something other than whitespace, you must include the terminating - * semicolon. - */ -# define PNG_UNUSED(param) (void)param; -#endif - -/* Just a little check that someone hasn't tried to define something - * contradictory. - */ -#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) -# undef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 65536L -#endif - -/* If warnings or errors are turned off the code is disabled or redirected here. - * From 1.5.4 functions have been added to allow very limited formatting of - * error and warning messages - this code will also be disabled here. - */ -#ifdef PNG_WARNINGS_SUPPORTED -# define PNG_WARNING_PARAMETERS(p) png_warning_parameters p; -#else -# define png_warning_parameter(p,number,string) ((void)0) -# define png_warning_parameter_unsigned(p,number,format,value) ((void)0) -# define png_warning_parameter_signed(p,number,format,value) ((void)0) -# define png_formatted_warning(pp,p,message) ((void)(pp)) -# define PNG_WARNING_PARAMETERS(p) -#endif -#ifndef PNG_ERROR_TEXT_SUPPORTED -# define png_fixed_error(s1,s2) png_err(s1) -#endif - -/* C allows up-casts from (void*) to any pointer and (const void*) to any - * pointer to a const object. C++ regards this as a type error and requires an - * explicit, static, cast and provides the static_cast<> rune to ensure that - * const is not cast away. - */ -#ifdef __cplusplus -# define png_voidcast(type, value) static_cast(value) -# define png_constcast(type, value) const_cast(value) -# define png_aligncast(type, value) \ - static_cast(static_cast(value)) -# define png_aligncastconst(type, value) \ - static_cast(static_cast(value)) -#else -# define png_voidcast(type, value) (value) -# define png_constcast(type, value) ((type)(value)) -# define png_aligncast(type, value) ((void*)(value)) -# define png_aligncastconst(type, value) ((const void*)(value)) -#endif /* __cplusplus */ - -/* Some fixed point APIs are still required even if not exported because - * they get used by the corresponding floating point APIs. This magic - * deals with this: - */ -#ifdef PNG_FIXED_POINT_SUPPORTED -# define PNGFAPI PNGAPI -#else -# define PNGFAPI /* PRIVATE */ -#endif - -#ifndef PNG_VERSION_INFO_ONLY -/* Other defines specific to compilers can go here. Try to keep - * them inside an appropriate ifdef/endif pair for portability. - */ -#if defined(PNG_FLOATING_POINT_SUPPORTED) ||\ - defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) - /* png.c requires the following ANSI-C constants if the conversion of - * floating point to ASCII is implemented therein: - * - * DBL_DIG Maximum number of decimal digits (can be set to any constant) - * DBL_MIN Smallest normalized fp number (can be set to an arbitrary value) - * DBL_MAX Maximum floating point number (can be set to an arbitrary value) - */ -# include - -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) - /* We need to check that hasn't already been included earlier - * as it seems it doesn't agree with , yet we should really use - * if possible. - */ -# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) -# include -# endif -# else -# include -# endif -# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) - /* Amiga SAS/C: We must include builtin FPU functions when compiling using - * MATH=68881 - */ -# include -# endif -#endif - -/* This provides the non-ANSI (far) memory allocation routines. */ -#if defined(__TURBOC__) && defined(__MSDOS__) -# include -# include -#endif - -#if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \ - defined(_WIN32) || defined(__WIN32__) -# include /* defines _WINDOWS_ macro */ -#endif -#endif /* PNG_VERSION_INFO_ONLY */ - -/* Moved here around 1.5.0beta36 from pngconf.h */ -/* Users may want to use these so they are not private. Any library - * functions that are passed far data must be model-independent. - */ - -/* Memory model/platform independent fns */ -#ifndef PNG_ABORT -# ifdef _WINDOWS_ -# define PNG_ABORT() ExitProcess(0) -# else -# define PNG_ABORT() abort() -# endif -#endif - -/* These macros may need to be architecture dependent. */ -#define PNG_ALIGN_NONE 0 /* do not use data alignment */ -#define PNG_ALIGN_ALWAYS 1 /* assume unaligned accesses are OK */ -#ifdef offsetof -# define PNG_ALIGN_OFFSET 2 /* use offsetof to determine alignment */ -#else -# define PNG_ALIGN_OFFSET -1 /* prevent the use of this */ -#endif -#define PNG_ALIGN_SIZE 3 /* use sizeof to determine alignment */ - -#ifndef PNG_ALIGN_TYPE - /* Default to using aligned access optimizations and requiring alignment to a - * multiple of the data type size. Override in a compiler specific fashion - * if necessary by inserting tests here: - */ -# define PNG_ALIGN_TYPE PNG_ALIGN_SIZE -#endif - -#if PNG_ALIGN_TYPE == PNG_ALIGN_SIZE - /* This is used because in some compiler implementations non-aligned - * structure members are supported, so the offsetof approach below fails. - * Set PNG_ALIGN_SIZE=0 for compiler combinations where unaligned access - * is good for performance. Do not do this unless you have tested the result - * and understand it. - */ -# define png_alignof(type) (sizeof (type)) -#else -# if PNG_ALIGN_TYPE == PNG_ALIGN_OFFSET -# define png_alignof(type) offsetof(struct{char c; type t;}, t) -# else -# if PNG_ALIGN_TYPE == PNG_ALIGN_ALWAYS -# define png_alignof(type) (1) -# endif - /* Else leave png_alignof undefined to prevent use thereof */ -# endif -#endif - -/* This implicitly assumes alignment is always to a power of 2. */ -#ifdef png_alignof -# define png_isaligned(ptr, type)\ - (((type)((const char*)ptr-(const char*)0) & \ - (type)(png_alignof(type)-1)) == 0) -#else -# define png_isaligned(ptr, type) 0 -#endif - -/* End of memory model/platform independent support */ -/* End of 1.5.0beta36 move from pngconf.h */ - -/* CONSTANTS and UTILITY MACROS - * These are used internally by libpng and not exposed in the API - */ - -/* Various modes of operation. Note that after an init, mode is set to - * zero automatically when the structure is created. Three of these - * are defined in png.h because they need to be visible to applications - * that call png_set_unknown_chunk(). - */ -/* #define PNG_HAVE_IHDR 0x01U (defined in png.h) */ -/* #define PNG_HAVE_PLTE 0x02U (defined in png.h) */ -#define PNG_HAVE_IDAT 0x04U -/* #define PNG_AFTER_IDAT 0x08U (defined in png.h) */ -#define PNG_HAVE_IEND 0x10U - /* 0x20U (unused) */ - /* 0x40U (unused) */ - /* 0x80U (unused) */ -#define PNG_HAVE_CHUNK_HEADER 0x100U -#define PNG_WROTE_tIME 0x200U -#define PNG_WROTE_INFO_BEFORE_PLTE 0x400U -#define PNG_BACKGROUND_IS_GRAY 0x800U -#define PNG_HAVE_PNG_SIGNATURE 0x1000U -#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U /* Have another chunk after IDAT */ - /* 0x4000U (unused) */ -#define PNG_IS_READ_STRUCT 0x8000U /* Else is a write struct */ - -/* Flags for the transformations the PNG library does on the image data */ -#define PNG_BGR 0x0001U -#define PNG_INTERLACE 0x0002U -#define PNG_PACK 0x0004U -#define PNG_SHIFT 0x0008U -#define PNG_SWAP_BYTES 0x0010U -#define PNG_INVERT_MONO 0x0020U -#define PNG_QUANTIZE 0x0040U -#define PNG_COMPOSE 0x0080U /* Was PNG_BACKGROUND */ -#define PNG_BACKGROUND_EXPAND 0x0100U -#define PNG_EXPAND_16 0x0200U /* Added to libpng 1.5.2 */ -#define PNG_16_TO_8 0x0400U /* Becomes 'chop' in 1.5.4 */ -#define PNG_RGBA 0x0800U -#define PNG_EXPAND 0x1000U -#define PNG_GAMMA 0x2000U -#define PNG_GRAY_TO_RGB 0x4000U -#define PNG_FILLER 0x8000U -#define PNG_PACKSWAP 0x10000U -#define PNG_SWAP_ALPHA 0x20000U -#define PNG_STRIP_ALPHA 0x40000U -#define PNG_INVERT_ALPHA 0x80000U -#define PNG_USER_TRANSFORM 0x100000U -#define PNG_RGB_TO_GRAY_ERR 0x200000U -#define PNG_RGB_TO_GRAY_WARN 0x400000U -#define PNG_RGB_TO_GRAY 0x600000U /* two bits, RGB_TO_GRAY_ERR|WARN */ -#define PNG_ENCODE_ALPHA 0x800000U /* Added to libpng-1.5.4 */ -#define PNG_ADD_ALPHA 0x1000000U /* Added to libpng-1.2.7 */ -#define PNG_EXPAND_tRNS 0x2000000U /* Added to libpng-1.2.9 */ -#define PNG_SCALE_16_TO_8 0x4000000U /* Added to libpng-1.5.4 */ - /* 0x8000000U unused */ - /* 0x10000000U unused */ - /* 0x20000000U unused */ - /* 0x40000000U unused */ -/* Flags for png_create_struct */ -#define PNG_STRUCT_PNG 0x0001U -#define PNG_STRUCT_INFO 0x0002U - -/* Flags for the png_ptr->flags rather than declaring a byte for each one */ -#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001U -#define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002U /* Added to libpng-1.6.0 */ - /* 0x0004U unused */ -#define PNG_FLAG_ZSTREAM_ENDED 0x0008U /* Added to libpng-1.6.0 */ - /* 0x0010U unused */ - /* 0x0020U unused */ -#define PNG_FLAG_ROW_INIT 0x0040U -#define PNG_FLAG_FILLER_AFTER 0x0080U -#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100U -#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200U -#define PNG_FLAG_CRC_CRITICAL_USE 0x0400U -#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800U -#define PNG_FLAG_ASSUME_sRGB 0x1000U /* Added to libpng-1.5.4 */ -#define PNG_FLAG_OPTIMIZE_ALPHA 0x2000U /* Added to libpng-1.5.4 */ -#define PNG_FLAG_DETECT_UNINITIALIZED 0x4000U /* Added to libpng-1.5.4 */ -/* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000U */ -/* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000U */ -#define PNG_FLAG_LIBRARY_MISMATCH 0x20000U -#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000U -#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000U -#define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000U /* Added to libpng-1.4.0 */ -#define PNG_FLAG_APP_WARNINGS_WARN 0x200000U /* Added to libpng-1.6.0 */ -#define PNG_FLAG_APP_ERRORS_WARN 0x400000U /* Added to libpng-1.6.0 */ - /* 0x800000U unused */ - /* 0x1000000U unused */ - /* 0x2000000U unused */ - /* 0x4000000U unused */ - /* 0x8000000U unused */ - /* 0x10000000U unused */ - /* 0x20000000U unused */ - /* 0x40000000U unused */ - -#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ - PNG_FLAG_CRC_ANCILLARY_NOWARN) - -#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ - PNG_FLAG_CRC_CRITICAL_IGNORE) - -#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ - PNG_FLAG_CRC_CRITICAL_MASK) - -/* Save typing and make code easier to understand */ - -#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ - abs((int)((c1).green) - (int)((c2).green)) + \ - abs((int)((c1).blue) - (int)((c2).blue))) - -/* Added to libpng-1.6.0: scale a 16-bit value in the range 0..65535 to 0..255 - * by dividing by 257 *with rounding*. This macro is exact for the given range. - * See the discourse in pngrtran.c png_do_scale_16_to_8. The values in the - * macro were established by experiment (modifying the added value). The macro - * has a second variant that takes a value already scaled by 255 and divides by - * 65535 - this has a maximum error of .502. Over the range 0..65535*65535 it - * only gives off-by-one errors and only for 0.5% (1 in 200) of the values. - */ -#define PNG_DIV65535(v24) (((v24) + 32895) >> 16) -#define PNG_DIV257(v16) PNG_DIV65535((png_uint_32)(v16) * 255) - -/* Added to libpng-1.2.6 JB */ -#define PNG_ROWBYTES(pixel_bits, width) \ - ((pixel_bits) >= 8 ? \ - ((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \ - (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) ) - -/* This returns the number of trailing bits in the last byte of a row, 0 if the - * last byte is completely full of pixels. It is, in principle, (pixel_bits x - * width) % 8, but that would overflow for large 'width'. The second macro is - * the same except that it returns the number of unused bits in the last byte; - * (8-TRAILBITS), but 0 when TRAILBITS is 0. - * - * NOTE: these macros are intended to be self-evidently correct and never - * overflow on the assumption that pixel_bits is in the range 0..255. The - * arguments are evaluated only once and they can be signed (e.g. as a result of - * the integral promotions). The result of the expression always has type - * (png_uint_32), however the compiler always knows it is in the range 0..7. - */ -#define PNG_TRAILBITS(pixel_bits, width) \ - (((pixel_bits) * ((width) % (png_uint_32)8)) % 8) - -#define PNG_PADBITS(pixel_bits, width) \ - ((8 - PNG_TRAILBITS(pixel_bits, width)) % 8) - -/* PNG_OUT_OF_RANGE returns true if value is outside the range - * ideal-delta..ideal+delta. Each argument is evaluated twice. - * "ideal" and "delta" should be constants, normally simple - * integers, "value" a variable. Added to libpng-1.2.6 JB - */ -#define PNG_OUT_OF_RANGE(value, ideal, delta) \ - ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) - -/* Conversions between fixed and floating point, only defined if - * required (to make sure the code doesn't accidentally use float - * when it is supposedly disabled.) - */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -/* The floating point conversion can't overflow, though it can and - * does lose accuracy relative to the original fixed point value. - * In practice this doesn't matter because png_fixed_point only - * stores numbers with very low precision. The png_ptr and s - * arguments are unused by default but are there in case error - * checking becomes a requirement. - */ -#define png_float(png_ptr, fixed, s) (.00001 * (fixed)) - -/* The fixed point conversion performs range checking and evaluates - * its argument multiple times, so must be used with care. The - * range checking uses the PNG specification values for a signed - * 32-bit fixed point value except that the values are deliberately - * rounded-to-zero to an integral value - 21474 (21474.83 is roughly - * (2^31-1) * 100000). 's' is a string that describes the value being - * converted. - * - * NOTE: this macro will raise a png_error if the range check fails, - * therefore it is normally only appropriate to use this on values - * that come from API calls or other sources where an out of range - * error indicates a programming error, not a data error! - * - * NOTE: by default this is off - the macro is not used - because the - * function call saves a lot of code. - */ -#ifdef PNG_FIXED_POINT_MACRO_SUPPORTED -#define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\ - ((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0)) -#endif -/* else the corresponding function is defined below, inside the scope of the - * cplusplus test. - */ -#endif - -/* Constants for known chunk types. If you need to add a chunk, define the name - * here. For historical reasons these constants have the form png_; i.e. - * the prefix is lower case. Please use decimal values as the parameters to - * match the ISO PNG specification and to avoid relying on the C locale - * interpretation of character values. - * - * Prior to 1.5.6 these constants were strings, as of 1.5.6 png_uint_32 values - * are computed and a new macro (PNG_STRING_FROM_CHUNK) added to allow a string - * to be generated if required. - * - * PNG_32b correctly produces a value shifted by up to 24 bits, even on - * architectures where (int) is only 16 bits. - */ -#define PNG_32b(b,s) ((png_uint_32)(b) << (s)) -#define PNG_U32(b1,b2,b3,b4) \ - (PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0)) - -/* Constants for known chunk types. - * - * MAINTAINERS: If you need to add a chunk, define the name here. - * For historical reasons these constants have the form png_; i.e. - * the prefix is lower case. Please use decimal values as the parameters to - * match the ISO PNG specification and to avoid relying on the C locale - * interpretation of character values. Please keep the list sorted. - * - * Notice that PNG_U32 is used to define a 32-bit value for the 4 byte chunk - * type. In fact the specification does not express chunk types this way, - * however using a 32-bit value means that the chunk type can be read from the - * stream using exactly the same code as used for a 32-bit unsigned value and - * can be examined far more efficiently (using one arithmetic compare). - * - * Prior to 1.5.6 the chunk type constants were expressed as C strings. The - * libpng API still uses strings for 'unknown' chunks and a macro, - * PNG_STRING_FROM_CHUNK, allows a string to be generated if required. Notice - * that for portable code numeric values must still be used; the string "IHDR" - * is not portable and neither is PNG_U32('I', 'H', 'D', 'R'). - * - * In 1.7.0 the definitions will be made public in png.h to avoid having to - * duplicate the same definitions in application code. - */ -#define png_IDAT PNG_U32( 73, 68, 65, 84) -#define png_IEND PNG_U32( 73, 69, 78, 68) -#define png_IHDR PNG_U32( 73, 72, 68, 82) -#define png_PLTE PNG_U32( 80, 76, 84, 69) -#define png_bKGD PNG_U32( 98, 75, 71, 68) -#define png_cHRM PNG_U32( 99, 72, 82, 77) -#define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */ -#define png_gAMA PNG_U32(103, 65, 77, 65) -#define png_gIFg PNG_U32(103, 73, 70, 103) -#define png_gIFt PNG_U32(103, 73, 70, 116) /* deprecated */ -#define png_gIFx PNG_U32(103, 73, 70, 120) -#define png_hIST PNG_U32(104, 73, 83, 84) -#define png_iCCP PNG_U32(105, 67, 67, 80) -#define png_iTXt PNG_U32(105, 84, 88, 116) -#define png_oFFs PNG_U32(111, 70, 70, 115) -#define png_pCAL PNG_U32(112, 67, 65, 76) -#define png_pHYs PNG_U32(112, 72, 89, 115) -#define png_sBIT PNG_U32(115, 66, 73, 84) -#define png_sCAL PNG_U32(115, 67, 65, 76) -#define png_sPLT PNG_U32(115, 80, 76, 84) -#define png_sRGB PNG_U32(115, 82, 71, 66) -#define png_sTER PNG_U32(115, 84, 69, 82) -#define png_tEXt PNG_U32(116, 69, 88, 116) -#define png_tIME PNG_U32(116, 73, 77, 69) -#define png_tRNS PNG_U32(116, 82, 78, 83) -#define png_zTXt PNG_U32(122, 84, 88, 116) - -/* The following will work on (signed char*) strings, whereas the get_uint_32 - * macro will fail on top-bit-set values because of the sign extension. - */ -#define PNG_CHUNK_FROM_STRING(s)\ - PNG_U32(0xff & (s)[0], 0xff & (s)[1], 0xff & (s)[2], 0xff & (s)[3]) - -/* This uses (char), not (png_byte) to avoid warnings on systems where (char) is - * signed and the argument is a (char[]) This macro will fail miserably on - * systems where (char) is more than 8 bits. - */ -#define PNG_STRING_FROM_CHUNK(s,c)\ - (void)(((char*)(s))[0]=(char)(((c)>>24) & 0xff), \ - ((char*)(s))[1]=(char)(((c)>>16) & 0xff),\ - ((char*)(s))[2]=(char)(((c)>>8) & 0xff), \ - ((char*)(s))[3]=(char)((c & 0xff))) - -/* Do the same but terminate with a null character. */ -#define PNG_CSTRING_FROM_CHUNK(s,c)\ - (void)(PNG_STRING_FROM_CHUNK(s,c), ((char*)(s))[4] = 0) - -/* Test on flag values as defined in the spec (section 5.4): */ -#define PNG_CHUNK_ANCILLARY(c) (1 & ((c) >> 29)) -#define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c)) -#define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21)) -#define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13)) -#define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5)) - -/* Gamma values (new at libpng-1.5.4): */ -#define PNG_GAMMA_MAC_OLD 151724 /* Assume '1.8' is really 2.2/1.45! */ -#define PNG_GAMMA_MAC_INVERSE 65909 -#define PNG_GAMMA_sRGB_INVERSE 45455 - -/* Almost everything below is C specific; the #defines above can be used in - * non-C code (so long as it is C-preprocessed) the rest of this stuff cannot. - */ -#ifndef PNG_VERSION_INFO_ONLY - -#include "pngstruct.h" -#include "pnginfo.h" - -/* Validate the include paths - the include path used to generate pnglibconf.h - * must match that used in the build, or we must be using pnglibconf.h.prebuilt: - */ -#if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM -# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \ - "-I (include path) error: see the notes in pngpriv.h" - /* This means that when pnglibconf.h was built the copy of zlib.h that it - * used is not the same as the one being used here. Because the build of - * libpng makes decisions to use inflateInit2 and inflateReset2 based on the - * zlib version number and because this affects handling of certain broken - * PNG files the -I directives must match. - * - * The most likely explanation is that you passed a -I in CFLAGS. This will - * not work; all the preprocessor directories and in particular all the -I - * directives must be in CPPFLAGS. - */ -#endif - -/* This is used for 16-bit gamma tables -- only the top level pointers are - * const; this could be changed: - */ -typedef const png_uint_16p * png_const_uint_16pp; - -/* Added to libpng-1.5.7: sRGB conversion tables */ -#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ - defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) -#ifdef PNG_SIMPLIFIED_READ_SUPPORTED -PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]); - /* Convert from an sRGB encoded value 0..255 to a 16-bit linear value, - * 0..65535. This table gives the closest 16-bit answers (no errors). - */ -#endif - -PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]); -PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]); - -#define PNG_sRGB_FROM_LINEAR(linear) \ - ((png_byte)(0xff & ((png_sRGB_base[(linear)>>15] \ - + ((((linear) & 0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8))) - /* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB - * encoded value with maximum error 0.646365. Note that the input is not a - * 16-bit value; it has been multiplied by 255! */ -#endif /* SIMPLIFIED_READ/WRITE */ - - -/* Inhibit C++ name-mangling for libpng functions but not for system calls. */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Internal functions; these are not exported from a DLL however because they - * are used within several of the C source files they have to be C extern. - * - * All of these functions must be declared with PNG_INTERNAL_FUNCTION. - */ - -/* Zlib support */ -#define PNG_UNEXPECTED_ZLIB_RETURN (-7) -PNG_INTERNAL_FUNCTION(void, png_zstream_error,(png_structrp png_ptr, int ret), - PNG_EMPTY); - /* Used by the zlib handling functions to ensure that z_stream::msg is always - * set before they return. - */ - -#ifdef PNG_WRITE_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_free_buffer_list,(png_structrp png_ptr, - png_compression_bufferp *list),PNG_EMPTY); - /* Free the buffer list used by the compressed write code. */ -#endif - -#if defined(PNG_FLOATING_POINT_SUPPORTED) && \ - !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \ - (defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \ - defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \ - (defined(PNG_sCAL_SUPPORTED) && \ - defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)) -PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr, - double fp, png_const_charp text),PNG_EMPTY); -#endif - -/* Check the user version string for compatibility, returns false if the version - * numbers aren't compatible. - */ -PNG_INTERNAL_FUNCTION(int,png_user_version_check,(png_structrp png_ptr, - png_const_charp user_png_ver),PNG_EMPTY); - -/* Internal base allocator - no messages, NULL on failure to allocate. This - * does, however, call the application provided allocator and that could call - * png_error (although that would be a bug in the application implementation.) - */ -PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_base,(png_const_structrp png_ptr, - png_alloc_size_t size),PNG_ALLOCATED); - -#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\ - defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) -/* Internal array allocator, outputs no error or warning messages on failure, - * just returns NULL. - */ -PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_array,(png_const_structrp png_ptr, - int nelements, size_t element_size),PNG_ALLOCATED); - -/* The same but an existing array is extended by add_elements. This function - * also memsets the new elements to 0 and copies the old elements. The old - * array is not freed or altered. - */ -PNG_INTERNAL_FUNCTION(png_voidp,png_realloc_array,(png_const_structrp png_ptr, - png_const_voidp array, int old_elements, int add_elements, - size_t element_size),PNG_ALLOCATED); -#endif /* text, sPLT or unknown chunks */ - -/* Magic to create a struct when there is no struct to call the user supplied - * memory allocators. Because error handling has not been set up the memory - * handlers can't safely call png_error, but this is an obscure and undocumented - * restriction so libpng has to assume that the 'free' handler, at least, might - * call png_error. - */ -PNG_INTERNAL_FUNCTION(png_structp,png_create_png_struct, - (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, - png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, - png_free_ptr free_fn),PNG_ALLOCATED); - -/* Free memory from internal libpng struct */ -PNG_INTERNAL_FUNCTION(void,png_destroy_png_struct,(png_structrp png_ptr), - PNG_EMPTY); - -/* Free an allocated jmp_buf (always succeeds) */ -PNG_INTERNAL_FUNCTION(void,png_free_jmpbuf,(png_structrp png_ptr),PNG_EMPTY); - -/* Function to allocate memory for zlib. PNGAPI is disallowed. */ -PNG_INTERNAL_FUNCTION(voidpf,png_zalloc,(voidpf png_ptr, uInt items, uInt size), - PNG_ALLOCATED); - -/* Function to free memory for zlib. PNGAPI is disallowed. */ -PNG_INTERNAL_FUNCTION(void,png_zfree,(voidpf png_ptr, voidpf ptr),PNG_EMPTY); - -/* Next four functions are used internally as callbacks. PNGCBAPI is required - * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3, changed to - * PNGCBAPI at 1.5.0 - */ - -PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_read_data,(png_structp png_ptr, - png_bytep data, png_size_t length),PNG_EMPTY); - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_push_fill_buffer,(png_structp png_ptr, - png_bytep buffer, png_size_t length),PNG_EMPTY); -#endif - -PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_write_data,(png_structp png_ptr, - png_bytep data, png_size_t length),PNG_EMPTY); - -#ifdef PNG_WRITE_FLUSH_SUPPORTED -# ifdef PNG_STDIO_SUPPORTED -PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_flush,(png_structp png_ptr), - PNG_EMPTY); -# endif -#endif - -/* Reset the CRC variable */ -PNG_INTERNAL_FUNCTION(void,png_reset_crc,(png_structrp png_ptr),PNG_EMPTY); - -/* Write the "data" buffer to whatever output you are using */ -PNG_INTERNAL_FUNCTION(void,png_write_data,(png_structrp png_ptr, - png_const_bytep data, png_size_t length),PNG_EMPTY); - -/* Read and check the PNG file signature */ -PNG_INTERNAL_FUNCTION(void,png_read_sig,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); - -/* Read the chunk header (length + type name) */ -PNG_INTERNAL_FUNCTION(png_uint_32,png_read_chunk_header,(png_structrp png_ptr), - PNG_EMPTY); - -/* Read data from whatever input you are using into the "data" buffer */ -PNG_INTERNAL_FUNCTION(void,png_read_data,(png_structrp png_ptr, png_bytep data, - png_size_t length),PNG_EMPTY); - -/* Read bytes into buf, and update png_ptr->crc */ -PNG_INTERNAL_FUNCTION(void,png_crc_read,(png_structrp png_ptr, png_bytep buf, - png_uint_32 length),PNG_EMPTY); - -/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ -PNG_INTERNAL_FUNCTION(int,png_crc_finish,(png_structrp png_ptr, - png_uint_32 skip),PNG_EMPTY); - -/* Read the CRC from the file and compare it to the libpng calculated CRC */ -PNG_INTERNAL_FUNCTION(int,png_crc_error,(png_structrp png_ptr),PNG_EMPTY); - -/* Calculate the CRC over a section of data. Note that we are only - * passing a maximum of 64K on systems that have this as a memory limit, - * since this is the maximum buffer size we can specify. - */ -PNG_INTERNAL_FUNCTION(void,png_calculate_crc,(png_structrp png_ptr, - png_const_bytep ptr, png_size_t length),PNG_EMPTY); - -#ifdef PNG_WRITE_FLUSH_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_flush,(png_structrp png_ptr),PNG_EMPTY); -#endif - -/* Write various chunks */ - -/* Write the IHDR chunk, and update the png_struct with the necessary - * information. - */ -PNG_INTERNAL_FUNCTION(void,png_write_IHDR,(png_structrp png_ptr, - png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, - int compression_method, int filter_method, int interlace_method),PNG_EMPTY); - -PNG_INTERNAL_FUNCTION(void,png_write_PLTE,(png_structrp png_ptr, - png_const_colorp palette, png_uint_32 num_pal),PNG_EMPTY); - -PNG_INTERNAL_FUNCTION(void,png_compress_IDAT,(png_structrp png_ptr, - png_const_bytep row_data, png_alloc_size_t row_data_length, int flush), - PNG_EMPTY); - -PNG_INTERNAL_FUNCTION(void,png_write_IEND,(png_structrp png_ptr),PNG_EMPTY); - -#ifdef PNG_WRITE_gAMA_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_gAMA_fixed,(png_structrp png_ptr, - png_fixed_point file_gamma),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_sBIT_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_sBIT,(png_structrp png_ptr, - png_const_color_8p sbit, int color_type),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_cHRM_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr, - const png_xy *xy), PNG_EMPTY); - /* The xy value must have been previously validated */ -#endif - -#ifdef PNG_WRITE_sRGB_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr, - int intent),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_iCCP_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr, - png_const_charp name, png_const_bytep profile), PNG_EMPTY); - /* The profile must have been previously validated for correctness, the - * length comes from the first four bytes. Only the base, deflate, - * compression is supported. - */ -#endif - -#ifdef PNG_WRITE_sPLT_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_sPLT,(png_structrp png_ptr, - png_const_sPLT_tp palette),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_tRNS_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_tRNS,(png_structrp png_ptr, - png_const_bytep trans, png_const_color_16p values, int number, - int color_type),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_bKGD_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_bKGD,(png_structrp png_ptr, - png_const_color_16p values, int color_type),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_hIST_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_hIST,(png_structrp png_ptr, - png_const_uint_16p hist, int num_hist),PNG_EMPTY); -#endif - -/* Chunks that have keywords */ -#ifdef PNG_WRITE_tEXt_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr, - png_const_charp key, png_const_charp text, png_size_t text_len),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_zTXt_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp - key, png_const_charp text, int compression),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_iTXt_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_iTXt,(png_structrp png_ptr, - int compression, png_const_charp key, png_const_charp lang, - png_const_charp lang_key, png_const_charp text),PNG_EMPTY); -#endif - -#ifdef PNG_TEXT_SUPPORTED /* Added at version 1.0.14 and 1.2.4 */ -PNG_INTERNAL_FUNCTION(int,png_set_text_2,(png_const_structrp png_ptr, - png_inforp info_ptr, png_const_textp text_ptr, int num_text),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_oFFs_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_oFFs,(png_structrp png_ptr, - png_int_32 x_offset, png_int_32 y_offset, int unit_type),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_pCAL_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_pCAL,(png_structrp png_ptr, - png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, - png_const_charp units, png_charpp params),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_pHYs_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_pHYs,(png_structrp png_ptr, - png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, - int unit_type),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_tIME_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_tIME,(png_structrp png_ptr, - png_const_timep mod_time),PNG_EMPTY); -#endif - -#ifdef PNG_WRITE_sCAL_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_write_sCAL_s,(png_structrp png_ptr, - int unit, png_const_charp width, png_const_charp height),PNG_EMPTY); -#endif - -/* Called when finished processing a row of data */ -PNG_INTERNAL_FUNCTION(void,png_write_finish_row,(png_structrp png_ptr), - PNG_EMPTY); - -/* Internal use only. Called before first row of data */ -PNG_INTERNAL_FUNCTION(void,png_write_start_row,(png_structrp png_ptr), - PNG_EMPTY); - -/* Combine a row of data, dealing with alpha, etc. if requested. 'row' is an - * array of png_ptr->width pixels. If the image is not interlaced or this - * is the final pass this just does a memcpy, otherwise the "display" flag - * is used to determine whether to copy pixels that are not in the current pass. - * - * Because 'png_do_read_interlace' (below) replicates pixels this allows this - * function to achieve the documented 'blocky' appearance during interlaced read - * if display is 1 and the 'sparkle' appearance, where existing pixels in 'row' - * are not changed if they are not in the current pass, when display is 0. - * - * 'display' must be 0 or 1, otherwise the memcpy will be done regardless. - * - * The API always reads from the png_struct row buffer and always assumes that - * it is full width (png_do_read_interlace has already been called.) - * - * This function is only ever used to write to row buffers provided by the - * caller of the relevant libpng API and the row must have already been - * transformed by the read transformations. - * - * The PNG_USE_COMPILE_TIME_MASKS option causes generation of pre-computed - * bitmasks for use within the code, otherwise runtime generated masks are used. - * The default is compile time masks. - */ -#ifndef PNG_USE_COMPILE_TIME_MASKS -# define PNG_USE_COMPILE_TIME_MASKS 1 -#endif -PNG_INTERNAL_FUNCTION(void,png_combine_row,(png_const_structrp png_ptr, - png_bytep row, int display),PNG_EMPTY); - -#ifdef PNG_READ_INTERLACING_SUPPORTED -/* Expand an interlaced row: the 'row_info' describes the pass data that has - * been read in and must correspond to the pixels in 'row', the pixels are - * expanded (moved apart) in 'row' to match the final layout, when doing this - * the pixels are *replicated* to the intervening space. This is essential for - * the correct operation of png_combine_row, above. - */ -PNG_INTERNAL_FUNCTION(void,png_do_read_interlace,(png_row_infop row_info, - png_bytep row, int pass, png_uint_32 transformations),PNG_EMPTY); -#endif - -/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED -/* Grab pixels out of a row for an interlaced pass */ -PNG_INTERNAL_FUNCTION(void,png_do_write_interlace,(png_row_infop row_info, - png_bytep row, int pass),PNG_EMPTY); -#endif - -/* Unfilter a row: check the filter value before calling this, there is no point - * calling it for PNG_FILTER_VALUE_NONE. - */ -PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop - row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY); - -#if PNG_ARM_NEON_OPT > 0 -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info, - png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_neon,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -#endif - -#if PNG_MIPS_MSA_OPT > 0 -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_msa,(png_row_infop row_info, - png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_msa,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_msa,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_msa,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_msa,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_msa,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_msa,(png_row_infop - row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); -#endif - -/* Choose the best filter to use and filter the row data */ -PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr, - png_row_infop row_info),PNG_EMPTY); - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr, - png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY); - /* Read 'avail_out' bytes of data from the IDAT stream. If the output buffer - * is NULL the function checks, instead, for the end of the stream. In this - * case a benign error will be issued if the stream end is not found or if - * extra data has to be consumed. - */ -PNG_INTERNAL_FUNCTION(void,png_read_finish_IDAT,(png_structrp png_ptr), - PNG_EMPTY); - /* This cleans up when the IDAT LZ stream does not end when the last image - * byte is read; there is still some pending input. - */ - -PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr), - PNG_EMPTY); - /* Finish a row while reading, dealing with interlacing passes, etc. */ -#endif /* SEQUENTIAL_READ */ - -/* Initialize the row buffers, etc. */ -PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY); - -#if ZLIB_VERNUM >= 0x1240 -PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush), - PNG_EMPTY); -# define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush) -#else /* Zlib < 1.2.4 */ -# define PNG_INFLATE(pp, flush) inflate(&(pp)->zstream, flush) -#endif /* Zlib < 1.2.4 */ - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -/* Optional call to update the users info structure */ -PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -#endif - -/* Shared transform functions, defined in pngtran.c */ -#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ - defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info, - png_bytep row, int at_start),PNG_EMPTY); -#endif - -#ifdef PNG_16BIT_SUPPORTED -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -PNG_INTERNAL_FUNCTION(void,png_do_swap,(png_row_infop row_info, - png_bytep row),PNG_EMPTY); -#endif -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ - defined(PNG_WRITE_PACKSWAP_SUPPORTED) -PNG_INTERNAL_FUNCTION(void,png_do_packswap,(png_row_infop row_info, - png_bytep row),PNG_EMPTY); -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info, - png_bytep row),PNG_EMPTY); -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info, - png_bytep row),PNG_EMPTY); -#endif - -/* The following decodes the appropriate chunks, and does error correction, - * then calls the appropriate callback for the chunk if it is valid. - */ - -/* Decode the IHDR chunk */ -PNG_INTERNAL_FUNCTION(void,png_handle_IHDR,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_handle_PLTE,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_handle_IEND,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); - -#ifdef PNG_READ_bKGD_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_bKGD,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_cHRM_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_gAMA_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_hIST_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_hIST,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_iCCP_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_iCCP,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif /* READ_iCCP */ - -#ifdef PNG_READ_iTXt_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_iTXt,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_oFFs_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_oFFs,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_pCAL_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_pCAL,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_pHYs_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_pHYs,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_sBIT_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_sBIT,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_sCAL_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_sCAL,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_sPLT_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_sPLT,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif /* READ_sPLT */ - -#ifdef PNG_READ_sRGB_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_sRGB,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_tEXt_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_tEXt,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_tIME_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_tIME,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_tRNS_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_tRNS,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -#ifdef PNG_READ_zTXt_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -#endif - -PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr, - png_uint_32 chunk_name),PNG_EMPTY); - -PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY); - /* This is the function that gets called for unknown chunks. The 'keep' - * argument is either non-zero for a known chunk that has been set to be - * handled as unknown or zero for an unknown chunk. By default the function - * just skips the chunk or errors out if it is critical. - */ - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\ - defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) -PNG_INTERNAL_FUNCTION(int,png_chunk_unknown_handling, - (png_const_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY); - /* Exactly as the API png_handle_as_unknown() except that the argument is a - * 32-bit chunk name, not a string. - */ -#endif /* READ_UNKNOWN_CHUNKS || HANDLE_AS_UNKNOWN */ - -/* Handle the transformations for reading and writing */ -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_do_read_transformations,(png_structrp png_ptr, - png_row_infop row_info),PNG_EMPTY); -#endif -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_do_write_transformations,(png_structrp png_ptr, - png_row_infop row_info),PNG_EMPTY); -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_init_read_transformations,(png_structrp png_ptr), - PNG_EMPTY); -#endif - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_push_read_chunk,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_read_sig,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr), - PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr, - png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_read_IDAT,(png_structrp png_ptr),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_process_IDAT_data,(png_structrp png_ptr, - png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr), - PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_handle_unknown,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr, - png_bytep row),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr), - PNG_EMPTY); -# ifdef PNG_READ_tEXt_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_push_handle_tEXt,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_read_tEXt,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -# endif -# ifdef PNG_READ_zTXt_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_push_handle_zTXt,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_read_zTXt,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -# endif -# ifdef PNG_READ_iTXt_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_push_handle_iTXt,(png_structrp png_ptr, - png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr, - png_inforp info_ptr),PNG_EMPTY); -# endif - -#endif /* PROGRESSIVE_READ */ - -/* Added at libpng version 1.6.0 */ -#ifdef PNG_GAMMA_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_fixed_point gAMA), PNG_EMPTY); - /* Set the colorspace gamma with a value provided by the application or by - * the gAMA chunk on read. The value will override anything set by an ICC - * profile. - */ - -PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr, - png_inforp info_ptr), PNG_EMPTY); - /* Synchronize the info 'valid' flags with the colorspace */ - -PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr, - png_inforp info_ptr), PNG_EMPTY); - /* Copy the png_struct colorspace to the info_struct and call the above to - * synchronize the flags. Checks for NULL info_ptr and does nothing. - */ -#endif - -/* Added at libpng version 1.4.0 */ -#ifdef PNG_COLORSPACE_SUPPORTED -/* These internal functions are for maintaining the colorspace structure within - * a png_info or png_struct (or, indeed, both). - */ -PNG_INTERNAL_FUNCTION(int,png_colorspace_set_chromaticities, - (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy, - int preferred), PNG_EMPTY); - -PNG_INTERNAL_FUNCTION(int,png_colorspace_set_endpoints, - (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_XYZ *XYZ, - int preferred), PNG_EMPTY); - -#ifdef PNG_sRGB_SUPPORTED -PNG_INTERNAL_FUNCTION(int,png_colorspace_set_sRGB,(png_const_structrp png_ptr, - png_colorspacerp colorspace, int intent), PNG_EMPTY); - /* This does set the colorspace gAMA and cHRM values too, but doesn't set the - * flags to write them, if it returns false there was a problem and an error - * message has already been output (but the colorspace may still need to be - * synced to record the invalid flag). - */ -#endif /* sRGB */ - -#ifdef PNG_iCCP_SUPPORTED -PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_const_charp name, - png_uint_32 profile_length, png_const_bytep profile, int color_type), - PNG_EMPTY); - /* The 'name' is used for information only */ - -/* Routines for checking parts of an ICC profile. */ -#ifdef PNG_READ_iCCP_SUPPORTED -PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_const_charp name, - png_uint_32 profile_length), PNG_EMPTY); -#endif /* READ_iCCP */ -PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_const_charp name, - png_uint_32 profile_length, - png_const_bytep profile /* first 132 bytes only */, int color_type), - PNG_EMPTY); -PNG_INTERNAL_FUNCTION(int,png_icc_check_tag_table,(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_const_charp name, - png_uint_32 profile_length, - png_const_bytep profile /* header plus whole tag table */), PNG_EMPTY); -#ifdef PNG_sRGB_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_icc_set_sRGB,( - png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_bytep profile, uLong adler), PNG_EMPTY); - /* 'adler' is the Adler32 checksum of the uncompressed profile data. It may - * be zero to indicate that it is not available. It is used, if provided, - * as a fast check on the profile when checking to see if it is sRGB. - */ -#endif -#endif /* iCCP */ - -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_colorspace_set_rgb_coefficients, - (png_structrp png_ptr), PNG_EMPTY); - /* Set the rgb_to_gray coefficients from the colorspace Y values */ -#endif /* READ_RGB_TO_GRAY */ -#endif /* COLORSPACE */ - -/* Added at libpng version 1.4.0 */ -PNG_INTERNAL_FUNCTION(void,png_check_IHDR,(png_const_structrp png_ptr, - png_uint_32 width, png_uint_32 height, int bit_depth, - int color_type, int interlace_type, int compression_type, - int filter_type),PNG_EMPTY); - -/* Added at libpng version 1.5.10 */ -#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ - defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) -PNG_INTERNAL_FUNCTION(void,png_do_check_palette_indexes, - (png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); -#endif - -#if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED) -PNG_INTERNAL_FUNCTION(void,png_fixed_error,(png_const_structrp png_ptr, - png_const_charp name),PNG_NORETURN); -#endif - -/* Puts 'string' into 'buffer' at buffer[pos], taking care never to overwrite - * the end. Always leaves the buffer nul terminated. Never errors out (and - * there is no error code.) - */ -PNG_INTERNAL_FUNCTION(size_t,png_safecat,(png_charp buffer, size_t bufsize, - size_t pos, png_const_charp string),PNG_EMPTY); - -/* Various internal functions to handle formatted warning messages, currently - * only implemented for warnings. - */ -#if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_TIME_RFC1123_SUPPORTED) -/* Utility to dump an unsigned value into a buffer, given a start pointer and - * and end pointer (which should point just *beyond* the end of the buffer!) - * Returns the pointer to the start of the formatted string. This utility only - * does unsigned values. - */ -PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start, - png_charp end, int format, png_alloc_size_t number),PNG_EMPTY); - -/* Convenience macro that takes an array: */ -#define PNG_FORMAT_NUMBER(buffer,format,number) \ - png_format_number(buffer, buffer + (sizeof buffer), format, number) - -/* Suggested size for a number buffer (enough for 64 bits and a sign!) */ -#define PNG_NUMBER_BUFFER_SIZE 24 - -/* These are the integer formats currently supported, the name is formed from - * the standard printf(3) format string. - */ -#define PNG_NUMBER_FORMAT_u 1 /* chose unsigned API! */ -#define PNG_NUMBER_FORMAT_02u 2 -#define PNG_NUMBER_FORMAT_d 1 /* chose signed API! */ -#define PNG_NUMBER_FORMAT_02d 2 -#define PNG_NUMBER_FORMAT_x 3 -#define PNG_NUMBER_FORMAT_02x 4 -#define PNG_NUMBER_FORMAT_fixed 5 /* choose the signed API */ -#endif - -#ifdef PNG_WARNINGS_SUPPORTED -/* New defines and members adding in libpng-1.5.4 */ -# define PNG_WARNING_PARAMETER_SIZE 32 -# define PNG_WARNING_PARAMETER_COUNT 8 /* Maximum 9; see pngerror.c */ - -/* An l-value of this type has to be passed to the APIs below to cache the - * values of the parameters to a formatted warning message. - */ -typedef char png_warning_parameters[PNG_WARNING_PARAMETER_COUNT][ - PNG_WARNING_PARAMETER_SIZE]; - -PNG_INTERNAL_FUNCTION(void,png_warning_parameter,(png_warning_parameters p, - int number, png_const_charp string),PNG_EMPTY); - /* Parameters are limited in size to PNG_WARNING_PARAMETER_SIZE characters, - * including the trailing '\0'. - */ -PNG_INTERNAL_FUNCTION(void,png_warning_parameter_unsigned, - (png_warning_parameters p, int number, int format, png_alloc_size_t value), - PNG_EMPTY); - /* Use png_alloc_size_t because it is an unsigned type as big as any we - * need to output. Use the following for a signed value. - */ -PNG_INTERNAL_FUNCTION(void,png_warning_parameter_signed, - (png_warning_parameters p, int number, int format, png_int_32 value), - PNG_EMPTY); - -PNG_INTERNAL_FUNCTION(void,png_formatted_warning,(png_const_structrp png_ptr, - png_warning_parameters p, png_const_charp message),PNG_EMPTY); - /* 'message' follows the X/Open approach of using @1, @2 to insert - * parameters previously supplied using the above functions. Errors in - * specifying the parameters will simply result in garbage substitutions. - */ -#endif - -#ifdef PNG_BENIGN_ERRORS_SUPPORTED -/* Application errors (new in 1.6); use these functions (declared below) for - * errors in the parameters or order of API function calls on read. The - * 'warning' should be used for an error that can be handled completely; the - * 'error' for one which can be handled safely but which may lose application - * information or settings. - * - * By default these both result in a png_error call prior to release, while in a - * released version the 'warning' is just a warning. However if the application - * explicitly disables benign errors (explicitly permitting the code to lose - * information) they both turn into warnings. - * - * If benign errors aren't supported they end up as the corresponding base call - * (png_warning or png_error.) - */ -PNG_INTERNAL_FUNCTION(void,png_app_warning,(png_const_structrp png_ptr, - png_const_charp message),PNG_EMPTY); - /* The application provided invalid parameters to an API function or called - * an API function at the wrong time, libpng can completely recover. - */ - -PNG_INTERNAL_FUNCTION(void,png_app_error,(png_const_structrp png_ptr, - png_const_charp message),PNG_EMPTY); - /* As above but libpng will ignore the call, or attempt some other partial - * recovery from the error. - */ -#else -# define png_app_warning(pp,s) png_warning(pp,s) -# define png_app_error(pp,s) png_error(pp,s) -#endif - -PNG_INTERNAL_FUNCTION(void,png_chunk_report,(png_const_structrp png_ptr, - png_const_charp message, int error),PNG_EMPTY); - /* Report a recoverable issue in chunk data. On read this is used to report - * a problem found while reading a particular chunk and the - * png_chunk_benign_error or png_chunk_warning function is used as - * appropriate. On write this is used to report an error that comes from - * data set via an application call to a png_set_ API and png_app_error or - * png_app_warning is used as appropriate. - * - * The 'error' parameter must have one of the following values: - */ -#define PNG_CHUNK_WARNING 0 /* never an error */ -#define PNG_CHUNK_WRITE_ERROR 1 /* an error only on write */ -#define PNG_CHUNK_ERROR 2 /* always an error */ - -/* ASCII to FP interfaces, currently only implemented if sCAL - * support is required. - */ -#if defined(PNG_sCAL_SUPPORTED) -/* MAX_DIGITS is actually the maximum number of characters in an sCAL - * width or height, derived from the precision (number of significant - * digits - a build time settable option) and assumptions about the - * maximum ridiculous exponent. - */ -#define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/) - -#ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_ascii_from_fp,(png_const_structrp png_ptr, - png_charp ascii, png_size_t size, double fp, unsigned int precision), - PNG_EMPTY); -#endif /* FLOATING_POINT */ - -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr, - png_charp ascii, png_size_t size, png_fixed_point fp),PNG_EMPTY); -#endif /* FIXED_POINT */ -#endif /* sCAL */ - -#if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) -/* An internal API to validate the format of a floating point number. - * The result is the index of the next character. If the number is - * not valid it will be the index of a character in the supposed number. - * - * The format of a number is defined in the PNG extensions specification - * and this API is strictly conformant to that spec, not anyone elses! - * - * The format as a regular expression is: - * - * [+-]?[0-9]+.?([Ee][+-]?[0-9]+)? - * - * or: - * - * [+-]?.[0-9]+(.[0-9]+)?([Ee][+-]?[0-9]+)? - * - * The complexity is that either integer or fraction must be present and the - * fraction is permitted to have no digits only if the integer is present. - * - * NOTE: The dangling E problem. - * There is a PNG valid floating point number in the following: - * - * PNG floating point numbers are not greedy. - * - * Working this out requires *TWO* character lookahead (because of the - * sign), the parser does not do this - it will fail at the 'r' - this - * doesn't matter for PNG sCAL chunk values, but it requires more care - * if the value were ever to be embedded in something more complex. Use - * ANSI-C strtod if you need the lookahead. - */ -/* State table for the parser. */ -#define PNG_FP_INTEGER 0 /* before or in integer */ -#define PNG_FP_FRACTION 1 /* before or in fraction */ -#define PNG_FP_EXPONENT 2 /* before or in exponent */ -#define PNG_FP_STATE 3 /* mask for the above */ -#define PNG_FP_SAW_SIGN 4 /* Saw +/- in current state */ -#define PNG_FP_SAW_DIGIT 8 /* Saw a digit in current state */ -#define PNG_FP_SAW_DOT 16 /* Saw a dot in current state */ -#define PNG_FP_SAW_E 32 /* Saw an E (or e) in current state */ -#define PNG_FP_SAW_ANY 60 /* Saw any of the above 4 */ - -/* These three values don't affect the parser. They are set but not used. - */ -#define PNG_FP_WAS_VALID 64 /* Preceding substring is a valid fp number */ -#define PNG_FP_NEGATIVE 128 /* A negative number, including "-0" */ -#define PNG_FP_NONZERO 256 /* A non-zero value */ -#define PNG_FP_STICKY 448 /* The above three flags */ - -/* This is available for the caller to store in 'state' if required. Do not - * call the parser after setting it (the parser sometimes clears it.) - */ -#define PNG_FP_INVALID 512 /* Available for callers as a distinct value */ - -/* Result codes for the parser (boolean - true meants ok, false means - * not ok yet.) - */ -#define PNG_FP_MAYBE 0 /* The number may be valid in the future */ -#define PNG_FP_OK 1 /* The number is valid */ - -/* Tests on the sticky non-zero and negative flags. To pass these checks - * the state must also indicate that the whole number is valid - this is - * achieved by testing PNG_FP_SAW_DIGIT (see the implementation for why this - * is equivalent to PNG_FP_OK above.) - */ -#define PNG_FP_NZ_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NEGATIVE | PNG_FP_NONZERO) - /* NZ_MASK: the string is valid and a non-zero negative value */ -#define PNG_FP_Z_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NONZERO) - /* Z MASK: the string is valid and a non-zero value. */ - /* PNG_FP_SAW_DIGIT: the string is valid. */ -#define PNG_FP_IS_ZERO(state) (((state) & PNG_FP_Z_MASK) == PNG_FP_SAW_DIGIT) -#define PNG_FP_IS_POSITIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_Z_MASK) -#define PNG_FP_IS_NEGATIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_NZ_MASK) - -/* The actual parser. This can be called repeatedly. It updates - * the index into the string and the state variable (which must - * be initialized to 0). It returns a result code, as above. There - * is no point calling the parser any more if it fails to advance to - * the end of the string - it is stuck on an invalid character (or - * terminated by '\0'). - * - * Note that the pointer will consume an E or even an E+ and then leave - * a 'maybe' state even though a preceding integer.fraction is valid. - * The PNG_FP_WAS_VALID flag indicates that a preceding substring was - * a valid number. It's possible to recover from this by calling - * the parser again (from the start, with state 0) but with a string - * that omits the last character (i.e. set the size to the index of - * the problem character.) This has not been tested within libpng. - */ -PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string, - png_size_t size, int *statep, png_size_tp whereami),PNG_EMPTY); - -/* This is the same but it checks a complete string and returns true - * only if it just contains a floating point number. As of 1.5.4 this - * function also returns the state at the end of parsing the number if - * it was valid (otherwise it returns 0.) This can be used for testing - * for negative or zero values using the sticky flag. - */ -PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string, - png_size_t size),PNG_EMPTY); -#endif /* pCAL || sCAL */ - -#if defined(PNG_GAMMA_SUPPORTED) ||\ - defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED) -/* Added at libpng version 1.5.0 */ -/* This is a utility to provide a*times/div (rounded) and indicate - * if there is an overflow. The result is a boolean - false (0) - * for overflow, true (1) if no overflow, in which case *res - * holds the result. - */ -PNG_INTERNAL_FUNCTION(int,png_muldiv,(png_fixed_point_p res, png_fixed_point a, - png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY); -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED) -/* Same deal, but issue a warning on overflow and return 0. */ -PNG_INTERNAL_FUNCTION(png_fixed_point,png_muldiv_warn, - (png_const_structrp png_ptr, png_fixed_point a, png_int_32 multiplied_by, - png_int_32 divided_by),PNG_EMPTY); -#endif - -#ifdef PNG_GAMMA_SUPPORTED -/* Calculate a reciprocal - used for gamma values. This returns - * 0 if the argument is 0 in order to maintain an undefined value; - * there are no warnings. - */ -PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal,(png_fixed_point a), - PNG_EMPTY); - -#ifdef PNG_READ_GAMMA_SUPPORTED -/* The same but gives a reciprocal of the product of two fixed point - * values. Accuracy is suitable for gamma calculations but this is - * not exact - use png_muldiv for that. Only required at present on read. - */ -PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal2,(png_fixed_point a, - png_fixed_point b),PNG_EMPTY); -#endif - -/* Return true if the gamma value is significantly different from 1.0 */ -PNG_INTERNAL_FUNCTION(int,png_gamma_significant,(png_fixed_point gamma_value), - PNG_EMPTY); -#endif - -#ifdef PNG_READ_GAMMA_SUPPORTED -/* Internal fixed point gamma correction. These APIs are called as - * required to convert single values - they don't need to be fast, - * they are not used when processing image pixel values. - * - * While the input is an 'unsigned' value it must actually be the - * correct bit value - 0..255 or 0..65535 as required. - */ -PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_correct,(png_structrp png_ptr, - unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_16bit_correct,(unsigned int value, - png_fixed_point gamma_value),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(png_byte,png_gamma_8bit_correct,(unsigned int value, - png_fixed_point gamma_value),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_destroy_gamma_table,(png_structrp png_ptr), - PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_build_gamma_table,(png_structrp png_ptr, - int bit_depth),PNG_EMPTY); -#endif - -/* SIMPLIFIED READ/WRITE SUPPORT */ -#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ - defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) -/* The internal structure that png_image::opaque points to. */ -typedef struct png_control -{ - png_structp png_ptr; - png_infop info_ptr; - png_voidp error_buf; /* Always a jmp_buf at present. */ - - png_const_bytep memory; /* Memory buffer. */ - png_size_t size; /* Size of the memory buffer. */ - - unsigned int for_write :1; /* Otherwise it is a read structure */ - unsigned int owned_file :1; /* We own the file in io_ptr */ -} png_control; - -/* Return the pointer to the jmp_buf from a png_control: necessary because C - * does not reveal the type of the elements of jmp_buf. - */ -#ifdef __cplusplus -# define png_control_jmp_buf(pc) (((jmp_buf*)((pc)->error_buf))[0]) -#else -# define png_control_jmp_buf(pc) ((pc)->error_buf) -#endif - -/* Utility to safely execute a piece of libpng code catching and logging any - * errors that might occur. Returns true on success, false on failure (either - * of the function or as a result of a png_error.) - */ -PNG_INTERNAL_CALLBACK(void,png_safe_error,(png_structp png_ptr, - png_const_charp error_message),PNG_NORETURN); - -#ifdef PNG_WARNINGS_SUPPORTED -PNG_INTERNAL_CALLBACK(void,png_safe_warning,(png_structp png_ptr, - png_const_charp warning_message),PNG_EMPTY); -#else -# define png_safe_warning 0/*dummy argument*/ -#endif - -PNG_INTERNAL_FUNCTION(int,png_safe_execute,(png_imagep image, - int (*function)(png_voidp), png_voidp arg),PNG_EMPTY); - -/* Utility to log an error; this also cleans up the png_image; the function - * always returns 0 (false). - */ -PNG_INTERNAL_FUNCTION(int,png_image_error,(png_imagep image, - png_const_charp error_message),PNG_EMPTY); - -#ifndef PNG_SIMPLIFIED_READ_SUPPORTED -/* png_image_free is used by the write code but not exported */ -PNG_INTERNAL_FUNCTION(void, png_image_free, (png_imagep image), PNG_EMPTY); -#endif /* !SIMPLIFIED_READ */ - -#endif /* SIMPLIFIED READ/WRITE */ - -/* These are initialization functions for hardware specific PNG filter - * optimizations; list these here then select the appropriate one at compile - * time using the macro PNG_FILTER_OPTIMIZATIONS. If the macro is not defined - * the generic code is used. - */ -#ifdef PNG_FILTER_OPTIMIZATIONS -PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr, - unsigned int bpp), PNG_EMPTY); - /* Just declare the optimization that will be used */ -#else - /* List *all* the possible optimizations here - this branch is required if - * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in - * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing. - */ -# if PNG_ARM_NEON_OPT > 0 -PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon, - (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); -#endif - -#if PNG_MIPS_MSA_OPT > 0 -PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa, - (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); -#endif -#endif - -PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr, - png_const_charp key, png_bytep new_key), PNG_EMPTY); - -/* Maintainer: Put new private prototypes here ^ */ - -#include "pngdebug.h" - -#ifdef __cplusplus -} -#endif - -#endif /* PNG_VERSION_INFO_ONLY */ -#endif /* PNGPRIV_H */ diff --git a/jan/src/dep/libs/libpng/pngread.c b/jan/src/dep/libs/libpng/pngread.c deleted file mode 100644 index c1f8c15cc..000000000 --- a/jan/src/dep/libs/libpng/pngread.c +++ /dev/null @@ -1,4197 +0,0 @@ - -/* pngread.c - read a PNG file - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - * This file contains routines that an application calls directly to - * read a PNG file or stream. - */ - -#include "pngpriv.h" -#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) && defined(PNG_STDIO_SUPPORTED) -# include -#endif - -#ifdef PNG_READ_SUPPORTED - -/* Create a PNG structure for reading, and allocate any memory needed. */ -PNG_FUNCTION(png_structp,PNGAPI -png_create_read_struct,(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn),PNG_ALLOCATED) -{ -#ifndef PNG_USER_MEM_SUPPORTED - png_structp png_ptr = png_create_png_struct(user_png_ver, error_ptr, - error_fn, warn_fn, NULL, NULL, NULL); -#else - return png_create_read_struct_2(user_png_ver, error_ptr, error_fn, - warn_fn, NULL, NULL, NULL); -} - -/* Alternate create PNG structure for reading, and allocate any memory - * needed. - */ -PNG_FUNCTION(png_structp,PNGAPI -png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED) -{ - png_structp png_ptr = png_create_png_struct(user_png_ver, error_ptr, - error_fn, warn_fn, mem_ptr, malloc_fn, free_fn); -#endif /* USER_MEM */ - - if (png_ptr != NULL) - { - png_ptr->mode = PNG_IS_READ_STRUCT; - - /* Added in libpng-1.6.0; this can be used to detect a read structure if - * required (it will be zero in a write structure.) - */ -# ifdef PNG_SEQUENTIAL_READ_SUPPORTED - png_ptr->IDAT_read_size = PNG_IDAT_READ_SIZE; -# endif - -# ifdef PNG_BENIGN_READ_ERRORS_SUPPORTED - png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN; - - /* In stable builds only warn if an application error can be completely - * handled. - */ -# if PNG_RELEASE_BUILD - png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN; -# endif -# endif - - /* TODO: delay this, it can be done in png_init_io (if the app doesn't - * do it itself) avoiding setting the default function if it is not - * required. - */ - png_set_read_fn(png_ptr, NULL, NULL); - } - - return png_ptr; -} - - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Read the information before the actual image data. This has been - * changed in v0.90 to allow reading a file that already has the magic - * bytes read from the stream. You can tell libpng how many bytes have - * been read from the beginning of the stream (up to the maximum of 8) - * via png_set_sig_bytes(), and we will only check the remaining bytes - * here. The application can then have access to the signature bytes we - * read if it is determined that this isn't a valid PNG file. - */ -void PNGAPI -png_read_info(png_structrp png_ptr, png_inforp info_ptr) -{ -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - int keep; -#endif - - png_debug(1, "in png_read_info"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - /* Read and check the PNG file signature. */ - png_read_sig(png_ptr, info_ptr); - - for (;;) - { - png_uint_32 length = png_read_chunk_header(png_ptr); - png_uint_32 chunk_name = png_ptr->chunk_name; - - /* IDAT logic needs to happen here to simplify getting the two flags - * right. - */ - if (chunk_name == png_IDAT) - { - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "Missing IHDR before IDAT"); - - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - (png_ptr->mode & PNG_HAVE_PLTE) == 0) - png_chunk_error(png_ptr, "Missing PLTE before IDAT"); - - else if ((png_ptr->mode & PNG_AFTER_IDAT) != 0) - png_chunk_benign_error(png_ptr, "Too many IDATs found"); - - png_ptr->mode |= PNG_HAVE_IDAT; - } - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - { - png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; - png_ptr->mode |= PNG_AFTER_IDAT; - } - - /* This should be a binary subdivision search or a hash for - * matching the chunk name rather than a linear search. - */ - if (chunk_name == png_IHDR) - png_handle_IHDR(png_ptr, info_ptr, length); - - else if (chunk_name == png_IEND) - png_handle_IEND(png_ptr, info_ptr, length); - -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0) - { - png_handle_unknown(png_ptr, info_ptr, length, keep); - - if (chunk_name == png_PLTE) - png_ptr->mode |= PNG_HAVE_PLTE; - - else if (chunk_name == png_IDAT) - { - png_ptr->idat_size = 0; /* It has been consumed */ - break; - } - } -#endif - else if (chunk_name == png_PLTE) - png_handle_PLTE(png_ptr, info_ptr, length); - - else if (chunk_name == png_IDAT) - { - png_ptr->idat_size = length; - break; - } - -#ifdef PNG_READ_bKGD_SUPPORTED - else if (chunk_name == png_bKGD) - png_handle_bKGD(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_cHRM_SUPPORTED - else if (chunk_name == png_cHRM) - png_handle_cHRM(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_gAMA_SUPPORTED - else if (chunk_name == png_gAMA) - png_handle_gAMA(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_hIST_SUPPORTED - else if (chunk_name == png_hIST) - png_handle_hIST(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_oFFs_SUPPORTED - else if (chunk_name == png_oFFs) - png_handle_oFFs(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_pCAL_SUPPORTED - else if (chunk_name == png_pCAL) - png_handle_pCAL(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_sCAL_SUPPORTED - else if (chunk_name == png_sCAL) - png_handle_sCAL(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_pHYs_SUPPORTED - else if (chunk_name == png_pHYs) - png_handle_pHYs(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_sBIT_SUPPORTED - else if (chunk_name == png_sBIT) - png_handle_sBIT(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_sRGB_SUPPORTED - else if (chunk_name == png_sRGB) - png_handle_sRGB(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_iCCP_SUPPORTED - else if (chunk_name == png_iCCP) - png_handle_iCCP(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_sPLT_SUPPORTED - else if (chunk_name == png_sPLT) - png_handle_sPLT(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_tEXt_SUPPORTED - else if (chunk_name == png_tEXt) - png_handle_tEXt(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_tIME_SUPPORTED - else if (chunk_name == png_tIME) - png_handle_tIME(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_tRNS_SUPPORTED - else if (chunk_name == png_tRNS) - png_handle_tRNS(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_zTXt_SUPPORTED - else if (chunk_name == png_zTXt) - png_handle_zTXt(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_iTXt_SUPPORTED - else if (chunk_name == png_iTXt) - png_handle_iTXt(png_ptr, info_ptr, length); -#endif - - else - png_handle_unknown(png_ptr, info_ptr, length, - PNG_HANDLE_CHUNK_AS_DEFAULT); - } -} -#endif /* SEQUENTIAL_READ */ - -/* Optional call to update the users info_ptr structure */ -void PNGAPI -png_read_update_info(png_structrp png_ptr, png_inforp info_ptr) -{ - png_debug(1, "in png_read_update_info"); - - if (png_ptr != NULL) - { - if ((png_ptr->flags & PNG_FLAG_ROW_INIT) == 0) - { - png_read_start_row(png_ptr); - -# ifdef PNG_READ_TRANSFORMS_SUPPORTED - png_read_transform_info(png_ptr, info_ptr); -# else - PNG_UNUSED(info_ptr) -# endif - } - - /* New in 1.6.0 this avoids the bug of doing the initializations twice */ - else - png_app_error(png_ptr, - "png_read_update_info/png_start_read_image: duplicate call"); - } -} - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Initialize palette, background, etc, after transformations - * are set, but before any reading takes place. This allows - * the user to obtain a gamma-corrected palette, for example. - * If the user doesn't call this, we will do it ourselves. - */ -void PNGAPI -png_start_read_image(png_structrp png_ptr) -{ - png_debug(1, "in png_start_read_image"); - - if (png_ptr != NULL) - { - if ((png_ptr->flags & PNG_FLAG_ROW_INIT) == 0) - png_read_start_row(png_ptr); - - /* New in 1.6.0 this avoids the bug of doing the initializations twice */ - else - png_app_error(png_ptr, - "png_start_read_image/png_read_update_info: duplicate call"); - } -} -#endif /* SEQUENTIAL_READ */ - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -#ifdef PNG_MNG_FEATURES_SUPPORTED -/* Undoes intrapixel differencing, - * NOTE: this is apparently only supported in the 'sequential' reader. - */ -static void -png_do_read_intrapixel(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_read_intrapixel"); - - if ( - (row_info->color_type & PNG_COLOR_MASK_COLOR) != 0) - { - int bytes_per_pixel; - png_uint_32 row_width = row_info->width; - - if (row_info->bit_depth == 8) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 3; - - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 4; - - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - *(rp) = (png_byte)((256 + *rp + *(rp + 1)) & 0xff); - *(rp+2) = (png_byte)((256 + *(rp + 2) + *(rp + 1)) & 0xff); - } - } - else if (row_info->bit_depth == 16) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 6; - - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 8; - - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - png_uint_32 s0 = (png_uint_32)(*(rp ) << 8) | *(rp + 1); - png_uint_32 s1 = (png_uint_32)(*(rp + 2) << 8) | *(rp + 3); - png_uint_32 s2 = (png_uint_32)(*(rp + 4) << 8) | *(rp + 5); - png_uint_32 red = (s0 + s1 + 65536) & 0xffff; - png_uint_32 blue = (s2 + s1 + 65536) & 0xffff; - *(rp ) = (png_byte)((red >> 8) & 0xff); - *(rp + 1) = (png_byte)(red & 0xff); - *(rp + 4) = (png_byte)((blue >> 8) & 0xff); - *(rp + 5) = (png_byte)(blue & 0xff); - } - } - } -} -#endif /* MNG_FEATURES */ - -void PNGAPI -png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row) -{ - png_row_info row_info; - - if (png_ptr == NULL) - return; - - png_debug2(1, "in png_read_row (row %lu, pass %d)", - (unsigned long)png_ptr->row_number, png_ptr->pass); - - /* png_read_start_row sets the information (in particular iwidth) for this - * interlace pass. - */ - if ((png_ptr->flags & PNG_FLAG_ROW_INIT) == 0) - png_read_start_row(png_ptr); - - /* 1.5.6: row_info moved out of png_struct to a local here. */ - row_info.width = png_ptr->iwidth; /* NOTE: width of current interlaced row */ - row_info.color_type = png_ptr->color_type; - row_info.bit_depth = png_ptr->bit_depth; - row_info.channels = png_ptr->channels; - row_info.pixel_depth = png_ptr->pixel_depth; - row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width); - -#ifdef PNG_WARNINGS_SUPPORTED - if (png_ptr->row_number == 0 && png_ptr->pass == 0) - { - /* Check for transforms that have been set but were defined out */ -#if defined(PNG_WRITE_INVERT_SUPPORTED) && !defined(PNG_READ_INVERT_SUPPORTED) - if ((png_ptr->transformations & PNG_INVERT_MONO) != 0) - png_warning(png_ptr, "PNG_READ_INVERT_SUPPORTED is not defined"); -#endif - -#if defined(PNG_WRITE_FILLER_SUPPORTED) && !defined(PNG_READ_FILLER_SUPPORTED) - if ((png_ptr->transformations & PNG_FILLER) != 0) - png_warning(png_ptr, "PNG_READ_FILLER_SUPPORTED is not defined"); -#endif - -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && \ - !defined(PNG_READ_PACKSWAP_SUPPORTED) - if ((png_ptr->transformations & PNG_PACKSWAP) != 0) - png_warning(png_ptr, "PNG_READ_PACKSWAP_SUPPORTED is not defined"); -#endif - -#if defined(PNG_WRITE_PACK_SUPPORTED) && !defined(PNG_READ_PACK_SUPPORTED) - if ((png_ptr->transformations & PNG_PACK) != 0) - png_warning(png_ptr, "PNG_READ_PACK_SUPPORTED is not defined"); -#endif - -#if defined(PNG_WRITE_SHIFT_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) - if ((png_ptr->transformations & PNG_SHIFT) != 0) - png_warning(png_ptr, "PNG_READ_SHIFT_SUPPORTED is not defined"); -#endif - -#if defined(PNG_WRITE_BGR_SUPPORTED) && !defined(PNG_READ_BGR_SUPPORTED) - if ((png_ptr->transformations & PNG_BGR) != 0) - png_warning(png_ptr, "PNG_READ_BGR_SUPPORTED is not defined"); -#endif - -#if defined(PNG_WRITE_SWAP_SUPPORTED) && !defined(PNG_READ_SWAP_SUPPORTED) - if ((png_ptr->transformations & PNG_SWAP_BYTES) != 0) - png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined"); -#endif - } -#endif /* WARNINGS */ - -#ifdef PNG_READ_INTERLACING_SUPPORTED - /* If interlaced and we do not need a new row, combine row and return. - * Notice that the pixels we have from previous rows have been transformed - * already; we can only combine like with like (transformed or - * untransformed) and, because of the libpng API for interlaced images, this - * means we must transform before de-interlacing. - */ - if (png_ptr->interlaced != 0 && - (png_ptr->transformations & PNG_INTERLACE) != 0) - { - switch (png_ptr->pass) - { - case 0: - if (png_ptr->row_number & 0x07) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, 1/*display*/); - png_read_finish_row(png_ptr); - return; - } - break; - - case 1: - if ((png_ptr->row_number & 0x07) || png_ptr->width < 5) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, 1/*display*/); - - png_read_finish_row(png_ptr); - return; - } - break; - - case 2: - if ((png_ptr->row_number & 0x07) != 4) - { - if (dsp_row != NULL && (png_ptr->row_number & 4)) - png_combine_row(png_ptr, dsp_row, 1/*display*/); - - png_read_finish_row(png_ptr); - return; - } - break; - - case 3: - if ((png_ptr->row_number & 3) || png_ptr->width < 3) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, 1/*display*/); - - png_read_finish_row(png_ptr); - return; - } - break; - - case 4: - if ((png_ptr->row_number & 3) != 2) - { - if (dsp_row != NULL && (png_ptr->row_number & 2)) - png_combine_row(png_ptr, dsp_row, 1/*display*/); - - png_read_finish_row(png_ptr); - return; - } - break; - - case 5: - if ((png_ptr->row_number & 1) || png_ptr->width < 2) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, 1/*display*/); - - png_read_finish_row(png_ptr); - return; - } - break; - - default: - case 6: - if ((png_ptr->row_number & 1) == 0) - { - png_read_finish_row(png_ptr); - return; - } - break; - } - } -#endif - - if ((png_ptr->mode & PNG_HAVE_IDAT) == 0) - png_error(png_ptr, "Invalid attempt to read row data"); - - /* Fill the row with IDAT data: */ - png_read_IDAT_data(png_ptr, png_ptr->row_buf, row_info.rowbytes + 1); - - if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE) - { - if (png_ptr->row_buf[0] < PNG_FILTER_VALUE_LAST) - png_read_filter_row(png_ptr, &row_info, png_ptr->row_buf + 1, - png_ptr->prev_row + 1, png_ptr->row_buf[0]); - else - png_error(png_ptr, "bad adaptive filter value"); - } - - /* libpng 1.5.6: the following line was copying png_ptr->rowbytes before - * 1.5.6, while the buffer really is this big in current versions of libpng - * it may not be in the future, so this was changed just to copy the - * interlaced count: - */ - memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1); - -#ifdef PNG_MNG_FEATURES_SUPPORTED - if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) != 0 && - (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) - { - /* Intrapixel differencing */ - png_do_read_intrapixel(&row_info, png_ptr->row_buf + 1); - } -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED - if (png_ptr->transformations) - png_do_read_transformations(png_ptr, &row_info); -#endif - - /* The transformed pixel depth should match the depth now in row_info. */ - if (png_ptr->transformed_pixel_depth == 0) - { - png_ptr->transformed_pixel_depth = row_info.pixel_depth; - if (row_info.pixel_depth > png_ptr->maximum_pixel_depth) - png_error(png_ptr, "sequential row overflow"); - } - - else if (png_ptr->transformed_pixel_depth != row_info.pixel_depth) - png_error(png_ptr, "internal sequential row size calculation error"); - -#ifdef PNG_READ_INTERLACING_SUPPORTED - /* Expand interlaced rows to full size */ - if (png_ptr->interlaced != 0 && - (png_ptr->transformations & PNG_INTERLACE) != 0) - { - if (png_ptr->pass < 6) - png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass, - png_ptr->transformations); - - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, 1/*display*/); - - if (row != NULL) - png_combine_row(png_ptr, row, 0/*row*/); - } - - else -#endif - { - if (row != NULL) - png_combine_row(png_ptr, row, -1/*ignored*/); - - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, -1/*ignored*/); - } - png_read_finish_row(png_ptr); - - if (png_ptr->read_row_fn != NULL) - (*(png_ptr->read_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); - -} -#endif /* SEQUENTIAL_READ */ - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Read one or more rows of image data. If the image is interlaced, - * and png_set_interlace_handling() has been called, the rows need to - * contain the contents of the rows from the previous pass. If the - * image has alpha or transparency, and png_handle_alpha()[*] has been - * called, the rows contents must be initialized to the contents of the - * screen. - * - * "row" holds the actual image, and pixels are placed in it - * as they arrive. If the image is displayed after each pass, it will - * appear to "sparkle" in. "display_row" can be used to display a - * "chunky" progressive image, with finer detail added as it becomes - * available. If you do not want this "chunky" display, you may pass - * NULL for display_row. If you do not want the sparkle display, and - * you have not called png_handle_alpha(), you may pass NULL for rows. - * If you have called png_handle_alpha(), and the image has either an - * alpha channel or a transparency chunk, you must provide a buffer for - * rows. In this case, you do not have to provide a display_row buffer - * also, but you may. If the image is not interlaced, or if you have - * not called png_set_interlace_handling(), the display_row buffer will - * be ignored, so pass NULL to it. - * - * [*] png_handle_alpha() does not exist yet, as of this version of libpng - */ - -void PNGAPI -png_read_rows(png_structrp png_ptr, png_bytepp row, - png_bytepp display_row, png_uint_32 num_rows) -{ - png_uint_32 i; - png_bytepp rp; - png_bytepp dp; - - png_debug(1, "in png_read_rows"); - - if (png_ptr == NULL) - return; - - rp = row; - dp = display_row; - if (rp != NULL && dp != NULL) - for (i = 0; i < num_rows; i++) - { - png_bytep rptr = *rp++; - png_bytep dptr = *dp++; - - png_read_row(png_ptr, rptr, dptr); - } - - else if (rp != NULL) - for (i = 0; i < num_rows; i++) - { - png_bytep rptr = *rp; - png_read_row(png_ptr, rptr, NULL); - rp++; - } - - else if (dp != NULL) - for (i = 0; i < num_rows; i++) - { - png_bytep dptr = *dp; - png_read_row(png_ptr, NULL, dptr); - dp++; - } -} -#endif /* SEQUENTIAL_READ */ - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Read the entire image. If the image has an alpha channel or a tRNS - * chunk, and you have called png_handle_alpha()[*], you will need to - * initialize the image to the current image that PNG will be overlaying. - * We set the num_rows again here, in case it was incorrectly set in - * png_read_start_row() by a call to png_read_update_info() or - * png_start_read_image() if png_set_interlace_handling() wasn't called - * prior to either of these functions like it should have been. You can - * only call this function once. If you desire to have an image for - * each pass of a interlaced image, use png_read_rows() instead. - * - * [*] png_handle_alpha() does not exist yet, as of this version of libpng - */ -void PNGAPI -png_read_image(png_structrp png_ptr, png_bytepp image) -{ - png_uint_32 i, image_height; - int pass, j; - png_bytepp rp; - - png_debug(1, "in png_read_image"); - - if (png_ptr == NULL) - return; - -#ifdef PNG_READ_INTERLACING_SUPPORTED - if ((png_ptr->flags & PNG_FLAG_ROW_INIT) == 0) - { - pass = png_set_interlace_handling(png_ptr); - /* And make sure transforms are initialized. */ - png_start_read_image(png_ptr); - } - else - { - if (png_ptr->interlaced != 0 && - (png_ptr->transformations & PNG_INTERLACE) == 0) - { - /* Caller called png_start_read_image or png_read_update_info without - * first turning on the PNG_INTERLACE transform. We can fix this here, - * but the caller should do it! - */ - png_warning(png_ptr, "Interlace handling should be turned on when " - "using png_read_image"); - /* Make sure this is set correctly */ - png_ptr->num_rows = png_ptr->height; - } - - /* Obtain the pass number, which also turns on the PNG_INTERLACE flag in - * the above error case. - */ - pass = png_set_interlace_handling(png_ptr); - } -#else - if (png_ptr->interlaced) - png_error(png_ptr, - "Cannot read interlaced image -- interlace handler disabled"); - - pass = 1; -#endif - - image_height=png_ptr->height; - - for (j = 0; j < pass; j++) - { - rp = image; - for (i = 0; i < image_height; i++) - { - png_read_row(png_ptr, *rp, NULL); - rp++; - } - } -} -#endif /* SEQUENTIAL_READ */ - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -/* Read the end of the PNG file. Will not read past the end of the - * file, will verify the end is accurate, and will read any comments - * or time information at the end of the file, if info is not NULL. - */ -void PNGAPI -png_read_end(png_structrp png_ptr, png_inforp info_ptr) -{ -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - int keep; -#endif - - png_debug(1, "in png_read_end"); - - if (png_ptr == NULL) - return; - - /* If png_read_end is called in the middle of reading the rows there may - * still be pending IDAT data and an owned zstream. Deal with this here. - */ -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - if (png_chunk_unknown_handling(png_ptr, png_IDAT) == 0) -#endif - png_read_finish_IDAT(png_ptr); - -#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED - /* Report invalid palette index; added at libng-1.5.10 */ - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - png_ptr->num_palette_max > png_ptr->num_palette) - png_benign_error(png_ptr, "Read palette index exceeding num_palette"); -#endif - - do - { - png_uint_32 length = png_read_chunk_header(png_ptr); - png_uint_32 chunk_name = png_ptr->chunk_name; - - if (chunk_name != png_IDAT) - png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; - - if (chunk_name == png_IEND) - png_handle_IEND(png_ptr, info_ptr, length); - - else if (chunk_name == png_IHDR) - png_handle_IHDR(png_ptr, info_ptr, length); - - else if (info_ptr == NULL) - png_crc_finish(png_ptr, length); - -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0) - { - if (chunk_name == png_IDAT) - { - if ((length > 0 && !(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED)) - || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) != 0) - png_benign_error(png_ptr, ".Too many IDATs found"); - } - png_handle_unknown(png_ptr, info_ptr, length, keep); - if (chunk_name == png_PLTE) - png_ptr->mode |= PNG_HAVE_PLTE; - } -#endif - - else if (chunk_name == png_IDAT) - { - /* Zero length IDATs are legal after the last IDAT has been - * read, but not after other chunks have been read. 1.6 does not - * always read all the deflate data; specifically it cannot be relied - * upon to read the Adler32 at the end. If it doesn't ignore IDAT - * chunks which are longer than zero as well: - */ - if ((length > 0 && !(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED)) - || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) != 0) - png_benign_error(png_ptr, "..Too many IDATs found"); - - png_crc_finish(png_ptr, length); - } - else if (chunk_name == png_PLTE) - png_handle_PLTE(png_ptr, info_ptr, length); - -#ifdef PNG_READ_bKGD_SUPPORTED - else if (chunk_name == png_bKGD) - png_handle_bKGD(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_cHRM_SUPPORTED - else if (chunk_name == png_cHRM) - png_handle_cHRM(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_gAMA_SUPPORTED - else if (chunk_name == png_gAMA) - png_handle_gAMA(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_hIST_SUPPORTED - else if (chunk_name == png_hIST) - png_handle_hIST(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_oFFs_SUPPORTED - else if (chunk_name == png_oFFs) - png_handle_oFFs(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_pCAL_SUPPORTED - else if (chunk_name == png_pCAL) - png_handle_pCAL(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_sCAL_SUPPORTED - else if (chunk_name == png_sCAL) - png_handle_sCAL(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_pHYs_SUPPORTED - else if (chunk_name == png_pHYs) - png_handle_pHYs(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_sBIT_SUPPORTED - else if (chunk_name == png_sBIT) - png_handle_sBIT(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_sRGB_SUPPORTED - else if (chunk_name == png_sRGB) - png_handle_sRGB(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_iCCP_SUPPORTED - else if (chunk_name == png_iCCP) - png_handle_iCCP(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_sPLT_SUPPORTED - else if (chunk_name == png_sPLT) - png_handle_sPLT(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_tEXt_SUPPORTED - else if (chunk_name == png_tEXt) - png_handle_tEXt(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_tIME_SUPPORTED - else if (chunk_name == png_tIME) - png_handle_tIME(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_tRNS_SUPPORTED - else if (chunk_name == png_tRNS) - png_handle_tRNS(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_zTXt_SUPPORTED - else if (chunk_name == png_zTXt) - png_handle_zTXt(png_ptr, info_ptr, length); -#endif - -#ifdef PNG_READ_iTXt_SUPPORTED - else if (chunk_name == png_iTXt) - png_handle_iTXt(png_ptr, info_ptr, length); -#endif - - else - png_handle_unknown(png_ptr, info_ptr, length, - PNG_HANDLE_CHUNK_AS_DEFAULT); - } while ((png_ptr->mode & PNG_HAVE_IEND) == 0); -} -#endif /* SEQUENTIAL_READ */ - -/* Free all memory used in the read struct */ -static void -png_read_destroy(png_structrp png_ptr) -{ - png_debug(1, "in png_read_destroy"); - -#ifdef PNG_READ_GAMMA_SUPPORTED - png_destroy_gamma_table(png_ptr); -#endif - - png_free(png_ptr, png_ptr->big_row_buf); - png_ptr->big_row_buf = NULL; - png_free(png_ptr, png_ptr->big_prev_row); - png_ptr->big_prev_row = NULL; - png_free(png_ptr, png_ptr->read_buffer); - png_ptr->read_buffer = NULL; - -#ifdef PNG_READ_QUANTIZE_SUPPORTED - png_free(png_ptr, png_ptr->palette_lookup); - png_ptr->palette_lookup = NULL; - png_free(png_ptr, png_ptr->quantize_index); - png_ptr->quantize_index = NULL; -#endif - - if ((png_ptr->free_me & PNG_FREE_PLTE) != 0) - { - png_zfree(png_ptr, png_ptr->palette); - png_ptr->palette = NULL; - } - png_ptr->free_me &= ~PNG_FREE_PLTE; - -#if defined(PNG_tRNS_SUPPORTED) || \ - defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if ((png_ptr->free_me & PNG_FREE_TRNS) != 0) - { - png_free(png_ptr, png_ptr->trans_alpha); - png_ptr->trans_alpha = NULL; - } - png_ptr->free_me &= ~PNG_FREE_TRNS; -#endif - - inflateEnd(&png_ptr->zstream); - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - png_free(png_ptr, png_ptr->save_buffer); - png_ptr->save_buffer = NULL; -#endif - -#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) && \ - defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - png_free(png_ptr, png_ptr->unknown_chunk.data); - png_ptr->unknown_chunk.data = NULL; -#endif - -#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list = NULL; -#endif - - /* NOTE: the 'setjmp' buffer may still be allocated and the memory and error - * callbacks are still set at this point. They are required to complete the - * destruction of the png_struct itself. - */ -} - -/* Free all memory used by the read */ -void PNGAPI -png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, - png_infopp end_info_ptr_ptr) -{ - png_structrp png_ptr = NULL; - - png_debug(1, "in png_destroy_read_struct"); - - if (png_ptr_ptr != NULL) - png_ptr = *png_ptr_ptr; - - if (png_ptr == NULL) - return; - - /* libpng 1.6.0: use the API to destroy info structs to ensure consistent - * behavior. Prior to 1.6.0 libpng did extra 'info' destruction in this API. - * The extra was, apparently, unnecessary yet this hides memory leak bugs. - */ - png_destroy_info_struct(png_ptr, end_info_ptr_ptr); - png_destroy_info_struct(png_ptr, info_ptr_ptr); - - *png_ptr_ptr = NULL; - png_read_destroy(png_ptr); - png_destroy_png_struct(png_ptr); -} - -void PNGAPI -png_set_read_status_fn(png_structrp png_ptr, png_read_status_ptr read_row_fn) -{ - if (png_ptr == NULL) - return; - - png_ptr->read_row_fn = read_row_fn; -} - - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -#ifdef PNG_INFO_IMAGE_SUPPORTED -void PNGAPI -png_read_png(png_structrp png_ptr, png_inforp info_ptr, - int transforms, voidp params) -{ - if (png_ptr == NULL || info_ptr == NULL) - return; - - /* png_read_info() gives us all of the information from the - * PNG file before the first IDAT (image data chunk). - */ - png_read_info(png_ptr, info_ptr); - if (info_ptr->height > PNG_UINT_32_MAX/(sizeof (png_bytep))) - png_error(png_ptr, "Image is too high to process with png_read_png()"); - - /* -------------- image transformations start here ------------------- */ - /* libpng 1.6.10: add code to cause a png_app_error if a selected TRANSFORM - * is not implemented. This will only happen in de-configured (non-default) - * libpng builds. The results can be unexpected - png_read_png may return - * short or mal-formed rows because the transform is skipped. - */ - - /* Tell libpng to strip 16-bit/color files down to 8 bits per color. - */ - if ((transforms & PNG_TRANSFORM_SCALE_16) != 0) - /* Added at libpng-1.5.4. "strip_16" produces the same result that it - * did in earlier versions, while "scale_16" is now more accurate. - */ -#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED - png_set_scale_16(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_SCALE_16 not supported"); -#endif - - /* If both SCALE and STRIP are required pngrtran will effectively cancel the - * latter by doing SCALE first. This is ok and allows apps not to check for - * which is supported to get the right answer. - */ - if ((transforms & PNG_TRANSFORM_STRIP_16) != 0) -#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED - png_set_strip_16(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_STRIP_16 not supported"); -#endif - - /* Strip alpha bytes from the input data without combining with - * the background (not recommended). - */ - if ((transforms & PNG_TRANSFORM_STRIP_ALPHA) != 0) -#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED - png_set_strip_alpha(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_STRIP_ALPHA not supported"); -#endif - - /* Extract multiple pixels with bit depths of 1, 2, or 4 from a single - * byte into separate bytes (useful for paletted and grayscale images). - */ - if ((transforms & PNG_TRANSFORM_PACKING) != 0) -#ifdef PNG_READ_PACK_SUPPORTED - png_set_packing(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_PACKING not supported"); -#endif - - /* Change the order of packed pixels to least significant bit first - * (not useful if you are using png_set_packing). - */ - if ((transforms & PNG_TRANSFORM_PACKSWAP) != 0) -#ifdef PNG_READ_PACKSWAP_SUPPORTED - png_set_packswap(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_PACKSWAP not supported"); -#endif - - /* Expand paletted colors into true RGB triplets - * Expand grayscale images to full 8 bits from 1, 2, or 4 bits/pixel - * Expand paletted or RGB images with transparency to full alpha - * channels so the data will be available as RGBA quartets. - */ - if ((transforms & PNG_TRANSFORM_EXPAND) != 0) -#ifdef PNG_READ_EXPAND_SUPPORTED - png_set_expand(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_EXPAND not supported"); -#endif - - /* We don't handle background color or gamma transformation or quantizing. - */ - - /* Invert monochrome files to have 0 as white and 1 as black - */ - if ((transforms & PNG_TRANSFORM_INVERT_MONO) != 0) -#ifdef PNG_READ_INVERT_SUPPORTED - png_set_invert_mono(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_INVERT_MONO not supported"); -#endif - - /* If you want to shift the pixel values from the range [0,255] or - * [0,65535] to the original [0,7] or [0,31], or whatever range the - * colors were originally in: - */ - if ((transforms & PNG_TRANSFORM_SHIFT) != 0) -#ifdef PNG_READ_SHIFT_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sBIT) != 0) - png_set_shift(png_ptr, &info_ptr->sig_bit); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_SHIFT not supported"); -#endif - - /* Flip the RGB pixels to BGR (or RGBA to BGRA) */ - if ((transforms & PNG_TRANSFORM_BGR) != 0) -#ifdef PNG_READ_BGR_SUPPORTED - png_set_bgr(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_BGR not supported"); -#endif - - /* Swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) */ - if ((transforms & PNG_TRANSFORM_SWAP_ALPHA) != 0) -#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED - png_set_swap_alpha(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_SWAP_ALPHA not supported"); -#endif - - /* Swap bytes of 16-bit files to least significant byte first */ - if ((transforms & PNG_TRANSFORM_SWAP_ENDIAN) != 0) -#ifdef PNG_READ_SWAP_SUPPORTED - png_set_swap(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_SWAP_ENDIAN not supported"); -#endif - -/* Added at libpng-1.2.41 */ - /* Invert the alpha channel from opacity to transparency */ - if ((transforms & PNG_TRANSFORM_INVERT_ALPHA) != 0) -#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED - png_set_invert_alpha(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_INVERT_ALPHA not supported"); -#endif - -/* Added at libpng-1.2.41 */ - /* Expand grayscale image to RGB */ - if ((transforms & PNG_TRANSFORM_GRAY_TO_RGB) != 0) -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED - png_set_gray_to_rgb(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_GRAY_TO_RGB not supported"); -#endif - -/* Added at libpng-1.5.4 */ - if ((transforms & PNG_TRANSFORM_EXPAND_16) != 0) -#ifdef PNG_READ_EXPAND_16_SUPPORTED - png_set_expand_16(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_EXPAND_16 not supported"); -#endif - - /* We don't handle adding filler bytes */ - - /* We use png_read_image and rely on that for interlace handling, but we also - * call png_read_update_info therefore must turn on interlace handling now: - */ - (void)png_set_interlace_handling(png_ptr); - - /* Optional call to gamma correct and add the background to the palette - * and update info structure. REQUIRED if you are expecting libpng to - * update the palette for you (i.e., you selected such a transform above). - */ - png_read_update_info(png_ptr, info_ptr); - - /* -------------- image transformations end here ------------------- */ - - png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0); - if (info_ptr->row_pointers == NULL) - { - png_uint_32 iptr; - - info_ptr->row_pointers = png_voidcast(png_bytepp, png_malloc(png_ptr, - info_ptr->height * (sizeof (png_bytep)))); - - for (iptr=0; iptrheight; iptr++) - info_ptr->row_pointers[iptr] = NULL; - - info_ptr->free_me |= PNG_FREE_ROWS; - - for (iptr = 0; iptr < info_ptr->height; iptr++) - info_ptr->row_pointers[iptr] = png_voidcast(png_bytep, - png_malloc(png_ptr, info_ptr->rowbytes)); - } - - png_read_image(png_ptr, info_ptr->row_pointers); - info_ptr->valid |= PNG_INFO_IDAT; - - /* Read rest of file, and get additional chunks in info_ptr - REQUIRED */ - png_read_end(png_ptr, info_ptr); - - PNG_UNUSED(params) -} -#endif /* INFO_IMAGE */ -#endif /* SEQUENTIAL_READ */ - -#ifdef PNG_SIMPLIFIED_READ_SUPPORTED -/* SIMPLIFIED READ - * - * This code currently relies on the sequential reader, though it could easily - * be made to work with the progressive one. - */ -/* Arguments to png_image_finish_read: */ - -/* Encoding of PNG data (used by the color-map code) */ -# define P_NOTSET 0 /* File encoding not yet known */ -# define P_sRGB 1 /* 8-bit encoded to sRGB gamma */ -# define P_LINEAR 2 /* 16-bit linear: not encoded, NOT pre-multiplied! */ -# define P_FILE 3 /* 8-bit encoded to file gamma, not sRGB or linear */ -# define P_LINEAR8 4 /* 8-bit linear: only from a file value */ - -/* Color-map processing: after libpng has run on the PNG image further - * processing may be needed to convert the data to color-map indices. - */ -#define PNG_CMAP_NONE 0 -#define PNG_CMAP_GA 1 /* Process GA data to a color-map with alpha */ -#define PNG_CMAP_TRANS 2 /* Process GA data to a background index */ -#define PNG_CMAP_RGB 3 /* Process RGB data */ -#define PNG_CMAP_RGB_ALPHA 4 /* Process RGBA data */ - -/* The following document where the background is for each processing case. */ -#define PNG_CMAP_NONE_BACKGROUND 256 -#define PNG_CMAP_GA_BACKGROUND 231 -#define PNG_CMAP_TRANS_BACKGROUND 254 -#define PNG_CMAP_RGB_BACKGROUND 256 -#define PNG_CMAP_RGB_ALPHA_BACKGROUND 216 - -typedef struct -{ - /* Arguments: */ - png_imagep image; - png_voidp buffer; - png_int_32 row_stride; - png_voidp colormap; - png_const_colorp background; - /* Local variables: */ - png_voidp local_row; - png_voidp first_row; - ptrdiff_t row_bytes; /* step between rows */ - int file_encoding; /* E_ values above */ - png_fixed_point gamma_to_linear; /* For P_FILE, reciprocal of gamma */ - int colormap_processing; /* PNG_CMAP_ values above */ -} png_image_read_control; - -/* Do all the *safe* initialization - 'safe' means that png_error won't be - * called, so setting up the jmp_buf is not required. This means that anything - * called from here must *not* call png_malloc - it has to call png_malloc_warn - * instead so that control is returned safely back to this routine. - */ -static int -png_image_read_init(png_imagep image) -{ - if (image->opaque == NULL) - { - png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, image, - png_safe_error, png_safe_warning); - - /* And set the rest of the structure to NULL to ensure that the various - * fields are consistent. - */ - memset(image, 0, (sizeof *image)); - image->version = PNG_IMAGE_VERSION; - - if (png_ptr != NULL) - { - png_infop info_ptr = png_create_info_struct(png_ptr); - - if (info_ptr != NULL) - { - png_controlp control = png_voidcast(png_controlp, - png_malloc_warn(png_ptr, (sizeof *control))); - - if (control != NULL) - { - memset(control, 0, (sizeof *control)); - - control->png_ptr = png_ptr; - control->info_ptr = info_ptr; - control->for_write = 0; - - image->opaque = control; - return 1; - } - - /* Error clean up */ - png_destroy_info_struct(png_ptr, &info_ptr); - } - - png_destroy_read_struct(&png_ptr, NULL, NULL); - } - - return png_image_error(image, "png_image_read: out of memory"); - } - - return png_image_error(image, "png_image_read: opaque pointer not NULL"); -} - -/* Utility to find the base format of a PNG file from a png_struct. */ -static png_uint_32 -png_image_format(png_structrp png_ptr) -{ - png_uint_32 format = 0; - - if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) - format |= PNG_FORMAT_FLAG_COLOR; - - if ((png_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0) - format |= PNG_FORMAT_FLAG_ALPHA; - - /* Use png_ptr here, not info_ptr, because by examination png_handle_tRNS - * sets the png_struct fields; that's all we are interested in here. The - * precise interaction with an app call to png_set_tRNS and PNG file reading - * is unclear. - */ - else if (png_ptr->num_trans > 0) - format |= PNG_FORMAT_FLAG_ALPHA; - - if (png_ptr->bit_depth == 16) - format |= PNG_FORMAT_FLAG_LINEAR; - - if ((png_ptr->color_type & PNG_COLOR_MASK_PALETTE) != 0) - format |= PNG_FORMAT_FLAG_COLORMAP; - - return format; -} - -/* Is the given gamma significantly different from sRGB? The test is the same - * one used in pngrtran.c when deciding whether to do gamma correction. The - * arithmetic optimizes the division by using the fact that the inverse of the - * file sRGB gamma is 2.2 - */ -static int -png_gamma_not_sRGB(png_fixed_point g) -{ - if (g < PNG_FP_1) - { - /* An uninitialized gamma is assumed to be sRGB for the simplified API. */ - if (g == 0) - return 0; - - return png_gamma_significant((g * 11 + 2)/5 /* i.e. *2.2, rounded */); - } - - return 1; -} - -/* Do the main body of a 'png_image_begin_read' function; read the PNG file - * header and fill in all the information. This is executed in a safe context, - * unlike the init routine above. - */ -static int -png_image_read_header(png_voidp argument) -{ - png_imagep image = png_voidcast(png_imagep, argument); - png_structrp png_ptr = image->opaque->png_ptr; - png_inforp info_ptr = image->opaque->info_ptr; - -#ifdef PNG_BENIGN_ERRORS_SUPPORTED - png_set_benign_errors(png_ptr, 1/*warn*/); -#endif - png_read_info(png_ptr, info_ptr); - - /* Do this the fast way; just read directly out of png_struct. */ - image->width = png_ptr->width; - image->height = png_ptr->height; - - { - png_uint_32 format = png_image_format(png_ptr); - - image->format = format; - -#ifdef PNG_COLORSPACE_SUPPORTED - /* Does the colorspace match sRGB? If there is no color endpoint - * (colorant) information assume yes, otherwise require the - * 'ENDPOINTS_MATCHP_sRGB' colorspace flag to have been set. If the - * colorspace has been determined to be invalid ignore it. - */ - if ((format & PNG_FORMAT_FLAG_COLOR) != 0 && ((png_ptr->colorspace.flags - & (PNG_COLORSPACE_HAVE_ENDPOINTS|PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB| - PNG_COLORSPACE_INVALID)) == PNG_COLORSPACE_HAVE_ENDPOINTS)) - image->flags |= PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB; -#endif - } - - /* We need the maximum number of entries regardless of the format the - * application sets here. - */ - { - png_uint_32 cmap_entries; - - switch (png_ptr->color_type) - { - case PNG_COLOR_TYPE_GRAY: - cmap_entries = 1U << png_ptr->bit_depth; - break; - - case PNG_COLOR_TYPE_PALETTE: - cmap_entries = (png_uint_32)png_ptr->num_palette; - break; - - default: - cmap_entries = 256; - break; - } - - if (cmap_entries > 256) - cmap_entries = 256; - - image->colormap_entries = cmap_entries; - } - - return 1; -} - -#ifdef PNG_STDIO_SUPPORTED -int PNGAPI -png_image_begin_read_from_stdio(png_imagep image, FILE* file) -{ - if (image != NULL && image->version == PNG_IMAGE_VERSION) - { - if (file != NULL) - { - if (png_image_read_init(image) != 0) - { - /* This is slightly evil, but png_init_io doesn't do anything other - * than this and we haven't changed the standard IO functions so - * this saves a 'safe' function. - */ - image->opaque->png_ptr->io_ptr = file; - return png_safe_execute(image, png_image_read_header, image); - } - } - - else - return png_image_error(image, - "png_image_begin_read_from_stdio: invalid argument"); - } - - else if (image != NULL) - return png_image_error(image, - "png_image_begin_read_from_stdio: incorrect PNG_IMAGE_VERSION"); - - return 0; -} - -int PNGAPI -png_image_begin_read_from_file(png_imagep image, const char *file_name) -{ - if (image != NULL && image->version == PNG_IMAGE_VERSION) - { - if (file_name != NULL) - { - FILE *fp = fopen(file_name, "rb"); - - if (fp != NULL) - { - if (png_image_read_init(image) != 0) - { - image->opaque->png_ptr->io_ptr = fp; - image->opaque->owned_file = 1; - return png_safe_execute(image, png_image_read_header, image); - } - - /* Clean up: just the opened file. */ - (void)fclose(fp); - } - - else - return png_image_error(image, strerror(errno)); - } - - else - return png_image_error(image, - "png_image_begin_read_from_file: invalid argument"); - } - - else if (image != NULL) - return png_image_error(image, - "png_image_begin_read_from_file: incorrect PNG_IMAGE_VERSION"); - - return 0; -} -#endif /* STDIO */ - -static void PNGCBAPI -png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need) -{ - if (png_ptr != NULL) - { - png_imagep image = png_voidcast(png_imagep, png_ptr->io_ptr); - if (image != NULL) - { - png_controlp cp = image->opaque; - if (cp != NULL) - { - png_const_bytep memory = cp->memory; - png_size_t size = cp->size; - - if (memory != NULL && size >= need) - { - memcpy(out, memory, need); - cp->memory = memory + need; - cp->size = size - need; - return; - } - - png_error(png_ptr, "read beyond end of data"); - } - } - - png_error(png_ptr, "invalid memory read"); - } -} - -int PNGAPI png_image_begin_read_from_memory(png_imagep image, - png_const_voidp memory, png_size_t size) -{ - if (image != NULL && image->version == PNG_IMAGE_VERSION) - { - if (memory != NULL && size > 0) - { - if (png_image_read_init(image) != 0) - { - /* Now set the IO functions to read from the memory buffer and - * store it into io_ptr. Again do this in-place to avoid calling a - * libpng function that requires error handling. - */ - image->opaque->memory = png_voidcast(png_const_bytep, memory); - image->opaque->size = size; - image->opaque->png_ptr->io_ptr = image; - image->opaque->png_ptr->read_data_fn = png_image_memory_read; - - return png_safe_execute(image, png_image_read_header, image); - } - } - - else - return png_image_error(image, - "png_image_begin_read_from_memory: invalid argument"); - } - - else if (image != NULL) - return png_image_error(image, - "png_image_begin_read_from_memory: incorrect PNG_IMAGE_VERSION"); - - return 0; -} - -/* Utility function to skip chunks that are not used by the simplified image - * read functions and an appropriate macro to call it. - */ -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -static void -png_image_skip_unused_chunks(png_structrp png_ptr) -{ - /* Prepare the reader to ignore all recognized chunks whose data will not - * be used, i.e., all chunks recognized by libpng except for those - * involved in basic image reading: - * - * IHDR, PLTE, IDAT, IEND - * - * Or image data handling: - * - * tRNS, bKGD, gAMA, cHRM, sRGB, [iCCP] and sBIT. - * - * This provides a small performance improvement and eliminates any - * potential vulnerability to security problems in the unused chunks. - * - * At present the iCCP chunk data isn't used, so iCCP chunk can be ignored - * too. This allows the simplified API to be compiled without iCCP support, - * however if the support is there the chunk is still checked to detect - * errors (which are unfortunately quite common.) - */ - { - static PNG_CONST png_byte chunks_to_process[] = { - 98, 75, 71, 68, '\0', /* bKGD */ - 99, 72, 82, 77, '\0', /* cHRM */ - 103, 65, 77, 65, '\0', /* gAMA */ -# ifdef PNG_READ_iCCP_SUPPORTED - 105, 67, 67, 80, '\0', /* iCCP */ -# endif - 115, 66, 73, 84, '\0', /* sBIT */ - 115, 82, 71, 66, '\0', /* sRGB */ - }; - - /* Ignore unknown chunks and all other chunks except for the - * IHDR, PLTE, tRNS, IDAT, and IEND chunks. - */ - png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_NEVER, - NULL, -1); - - /* But do not ignore image data handling chunks */ - png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_AS_DEFAULT, - chunks_to_process, (int)/*SAFE*/(sizeof chunks_to_process)/5); - } -} - -# define PNG_SKIP_CHUNKS(p) png_image_skip_unused_chunks(p) -#else -# define PNG_SKIP_CHUNKS(p) ((void)0) -#endif /* HANDLE_AS_UNKNOWN */ - -/* The following macro gives the exact rounded answer for all values in the - * range 0..255 (it actually divides by 51.2, but the rounding still generates - * the correct numbers 0..5 - */ -#define PNG_DIV51(v8) (((v8) * 5 + 130) >> 8) - -/* Utility functions to make particular color-maps */ -static void -set_file_encoding(png_image_read_control *display) -{ - png_fixed_point g = display->image->opaque->png_ptr->colorspace.gamma; - if (png_gamma_significant(g) != 0) - { - if (png_gamma_not_sRGB(g) != 0) - { - display->file_encoding = P_FILE; - display->gamma_to_linear = png_reciprocal(g); - } - - else - display->file_encoding = P_sRGB; - } - - else - display->file_encoding = P_LINEAR8; -} - -static unsigned int -decode_gamma(png_image_read_control *display, png_uint_32 value, int encoding) -{ - if (encoding == P_FILE) /* double check */ - encoding = display->file_encoding; - - if (encoding == P_NOTSET) /* must be the file encoding */ - { - set_file_encoding(display); - encoding = display->file_encoding; - } - - switch (encoding) - { - case P_FILE: - value = png_gamma_16bit_correct(value*257, display->gamma_to_linear); - break; - - case P_sRGB: - value = png_sRGB_table[value]; - break; - - case P_LINEAR: - break; - - case P_LINEAR8: - value *= 257; - break; - -#ifdef __GNUC__ - default: - png_error(display->image->opaque->png_ptr, - "unexpected encoding (internal error)"); -#endif - } - - return value; -} - -static png_uint_32 -png_colormap_compose(png_image_read_control *display, - png_uint_32 foreground, int foreground_encoding, png_uint_32 alpha, - png_uint_32 background, int encoding) -{ - /* The file value is composed on the background, the background has the given - * encoding and so does the result, the file is encoded with P_FILE and the - * file and alpha are 8-bit values. The (output) encoding will always be - * P_LINEAR or P_sRGB. - */ - png_uint_32 f = decode_gamma(display, foreground, foreground_encoding); - png_uint_32 b = decode_gamma(display, background, encoding); - - /* The alpha is always an 8-bit value (it comes from the palette), the value - * scaled by 255 is what PNG_sRGB_FROM_LINEAR requires. - */ - f = f * alpha + b * (255-alpha); - - if (encoding == P_LINEAR) - { - /* Scale to 65535; divide by 255, approximately (in fact this is extremely - * accurate, it divides by 255.00000005937181414556, with no overflow.) - */ - f *= 257; /* Now scaled by 65535 */ - f += f >> 16; - f = (f+32768) >> 16; - } - - else /* P_sRGB */ - f = PNG_sRGB_FROM_LINEAR(f); - - return f; -} - -/* NOTE: P_LINEAR values to this routine must be 16-bit, but P_FILE values must - * be 8-bit. - */ -static void -png_create_colormap_entry(png_image_read_control *display, - png_uint_32 ip, png_uint_32 red, png_uint_32 green, png_uint_32 blue, - png_uint_32 alpha, int encoding) -{ - png_imagep image = display->image; - const int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) != 0 ? - P_LINEAR : P_sRGB; - const int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 && - (red != green || green != blue); - - if (ip > 255) - png_error(image->opaque->png_ptr, "color-map index out of range"); - - /* Update the cache with whether the file gamma is significantly different - * from sRGB. - */ - if (encoding == P_FILE) - { - if (display->file_encoding == P_NOTSET) - set_file_encoding(display); - - /* Note that the cached value may be P_FILE too, but if it is then the - * gamma_to_linear member has been set. - */ - encoding = display->file_encoding; - } - - if (encoding == P_FILE) - { - png_fixed_point g = display->gamma_to_linear; - - red = png_gamma_16bit_correct(red*257, g); - green = png_gamma_16bit_correct(green*257, g); - blue = png_gamma_16bit_correct(blue*257, g); - - if (convert_to_Y != 0 || output_encoding == P_LINEAR) - { - alpha *= 257; - encoding = P_LINEAR; - } - - else - { - red = PNG_sRGB_FROM_LINEAR(red * 255); - green = PNG_sRGB_FROM_LINEAR(green * 255); - blue = PNG_sRGB_FROM_LINEAR(blue * 255); - encoding = P_sRGB; - } - } - - else if (encoding == P_LINEAR8) - { - /* This encoding occurs quite frequently in test cases because PngSuite - * includes a gAMA 1.0 chunk with most images. - */ - red *= 257; - green *= 257; - blue *= 257; - alpha *= 257; - encoding = P_LINEAR; - } - - else if (encoding == P_sRGB && - (convert_to_Y != 0 || output_encoding == P_LINEAR)) - { - /* The values are 8-bit sRGB values, but must be converted to 16-bit - * linear. - */ - red = png_sRGB_table[red]; - green = png_sRGB_table[green]; - blue = png_sRGB_table[blue]; - alpha *= 257; - encoding = P_LINEAR; - } - - /* This is set if the color isn't gray but the output is. */ - if (encoding == P_LINEAR) - { - if (convert_to_Y != 0) - { - /* NOTE: these values are copied from png_do_rgb_to_gray */ - png_uint_32 y = (png_uint_32)6968 * red + (png_uint_32)23434 * green + - (png_uint_32)2366 * blue; - - if (output_encoding == P_LINEAR) - y = (y + 16384) >> 15; - - else - { - /* y is scaled by 32768, we need it scaled by 255: */ - y = (y + 128) >> 8; - y *= 255; - y = PNG_sRGB_FROM_LINEAR((y + 64) >> 7); - alpha = PNG_DIV257(alpha); - encoding = P_sRGB; - } - - blue = red = green = y; - } - - else if (output_encoding == P_sRGB) - { - red = PNG_sRGB_FROM_LINEAR(red * 255); - green = PNG_sRGB_FROM_LINEAR(green * 255); - blue = PNG_sRGB_FROM_LINEAR(blue * 255); - alpha = PNG_DIV257(alpha); - encoding = P_sRGB; - } - } - - if (encoding != output_encoding) - png_error(image->opaque->png_ptr, "bad encoding (internal error)"); - - /* Store the value. */ - { -# ifdef PNG_FORMAT_AFIRST_SUPPORTED - const int afirst = (image->format & PNG_FORMAT_FLAG_AFIRST) != 0 && - (image->format & PNG_FORMAT_FLAG_ALPHA) != 0; -# else -# define afirst 0 -# endif -# ifdef PNG_FORMAT_BGR_SUPPORTED - const int bgr = (image->format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0; -# else -# define bgr 0 -# endif - - if (output_encoding == P_LINEAR) - { - png_uint_16p entry = png_voidcast(png_uint_16p, display->colormap); - - entry += ip * PNG_IMAGE_SAMPLE_CHANNELS(image->format); - - /* The linear 16-bit values must be pre-multiplied by the alpha channel - * value, if less than 65535 (this is, effectively, composite on black - * if the alpha channel is removed.) - */ - switch (PNG_IMAGE_SAMPLE_CHANNELS(image->format)) - { - case 4: - entry[afirst ? 0 : 3] = (png_uint_16)alpha; - /* FALL THROUGH */ - - case 3: - if (alpha < 65535) - { - if (alpha > 0) - { - blue = (blue * alpha + 32767U)/65535U; - green = (green * alpha + 32767U)/65535U; - red = (red * alpha + 32767U)/65535U; - } - - else - red = green = blue = 0; - } - entry[afirst + (2 ^ bgr)] = (png_uint_16)blue; - entry[afirst + 1] = (png_uint_16)green; - entry[afirst + bgr] = (png_uint_16)red; - break; - - case 2: - entry[1 ^ afirst] = (png_uint_16)alpha; - /* FALL THROUGH */ - - case 1: - if (alpha < 65535) - { - if (alpha > 0) - green = (green * alpha + 32767U)/65535U; - - else - green = 0; - } - entry[afirst] = (png_uint_16)green; - break; - - default: - break; - } - } - - else /* output encoding is P_sRGB */ - { - png_bytep entry = png_voidcast(png_bytep, display->colormap); - - entry += ip * PNG_IMAGE_SAMPLE_CHANNELS(image->format); - - switch (PNG_IMAGE_SAMPLE_CHANNELS(image->format)) - { - case 4: - entry[afirst ? 0 : 3] = (png_byte)alpha; - case 3: - entry[afirst + (2 ^ bgr)] = (png_byte)blue; - entry[afirst + 1] = (png_byte)green; - entry[afirst + bgr] = (png_byte)red; - break; - - case 2: - entry[1 ^ afirst] = (png_byte)alpha; - case 1: - entry[afirst] = (png_byte)green; - break; - - default: - break; - } - } - -# ifdef afirst -# undef afirst -# endif -# ifdef bgr -# undef bgr -# endif - } -} - -static int -make_gray_file_colormap(png_image_read_control *display) -{ - unsigned int i; - - for (i=0; i<256; ++i) - png_create_colormap_entry(display, i, i, i, i, 255, P_FILE); - - return (int)i; -} - -static int -make_gray_colormap(png_image_read_control *display) -{ - unsigned int i; - - for (i=0; i<256; ++i) - png_create_colormap_entry(display, i, i, i, i, 255, P_sRGB); - - return (int)i; -} -#define PNG_GRAY_COLORMAP_ENTRIES 256 - -static int -make_ga_colormap(png_image_read_control *display) -{ - unsigned int i, a; - - /* Alpha is retained, the output will be a color-map with entries - * selected by six levels of alpha. One transparent entry, 6 gray - * levels for all the intermediate alpha values, leaving 230 entries - * for the opaque grays. The color-map entries are the six values - * [0..5]*51, the GA processing uses PNG_DIV51(value) to find the - * relevant entry. - * - * if (alpha > 229) // opaque - * { - * // The 231 entries are selected to make the math below work: - * base = 0; - * entry = (231 * gray + 128) >> 8; - * } - * else if (alpha < 26) // transparent - * { - * base = 231; - * entry = 0; - * } - * else // partially opaque - * { - * base = 226 + 6 * PNG_DIV51(alpha); - * entry = PNG_DIV51(gray); - * } - */ - i = 0; - while (i < 231) - { - unsigned int gray = (i * 256 + 115) / 231; - png_create_colormap_entry(display, i++, gray, gray, gray, 255, P_sRGB); - } - - /* 255 is used here for the component values for consistency with the code - * that undoes premultiplication in pngwrite.c. - */ - png_create_colormap_entry(display, i++, 255, 255, 255, 0, P_sRGB); - - for (a=1; a<5; ++a) - { - unsigned int g; - - for (g=0; g<6; ++g) - png_create_colormap_entry(display, i++, g*51, g*51, g*51, a*51, - P_sRGB); - } - - return (int)i; -} - -#define PNG_GA_COLORMAP_ENTRIES 256 - -static int -make_rgb_colormap(png_image_read_control *display) -{ - unsigned int i, r; - - /* Build a 6x6x6 opaque RGB cube */ - for (i=r=0; r<6; ++r) - { - unsigned int g; - - for (g=0; g<6; ++g) - { - unsigned int b; - - for (b=0; b<6; ++b) - png_create_colormap_entry(display, i++, r*51, g*51, b*51, 255, - P_sRGB); - } - } - - return (int)i; -} - -#define PNG_RGB_COLORMAP_ENTRIES 216 - -/* Return a palette index to the above palette given three 8-bit sRGB values. */ -#define PNG_RGB_INDEX(r,g,b) \ - ((png_byte)(6 * (6 * PNG_DIV51(r) + PNG_DIV51(g)) + PNG_DIV51(b))) - -static int -png_image_read_colormap(png_voidp argument) -{ - png_image_read_control *display = - png_voidcast(png_image_read_control*, argument); - const png_imagep image = display->image; - - const png_structrp png_ptr = image->opaque->png_ptr; - const png_uint_32 output_format = image->format; - const int output_encoding = (output_format & PNG_FORMAT_FLAG_LINEAR) != 0 ? - P_LINEAR : P_sRGB; - - unsigned int cmap_entries; - unsigned int output_processing; /* Output processing option */ - unsigned int data_encoding = P_NOTSET; /* Encoding libpng must produce */ - - /* Background information; the background color and the index of this color - * in the color-map if it exists (else 256). - */ - unsigned int background_index = 256; - png_uint_32 back_r, back_g, back_b; - - /* Flags to accumulate things that need to be done to the input. */ - int expand_tRNS = 0; - - /* Exclude the NYI feature of compositing onto a color-mapped buffer; it is - * very difficult to do, the results look awful, and it is difficult to see - * what possible use it is because the application can't control the - * color-map. - */ - if (((png_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0 || - png_ptr->num_trans > 0) /* alpha in input */ && - ((output_format & PNG_FORMAT_FLAG_ALPHA) == 0) /* no alpha in output */) - { - if (output_encoding == P_LINEAR) /* compose on black */ - back_b = back_g = back_r = 0; - - else if (display->background == NULL /* no way to remove it */) - png_error(png_ptr, - "background color must be supplied to remove alpha/transparency"); - - /* Get a copy of the background color (this avoids repeating the checks - * below.) The encoding is 8-bit sRGB or 16-bit linear, depending on the - * output format. - */ - else - { - back_g = display->background->green; - if ((output_format & PNG_FORMAT_FLAG_COLOR) != 0) - { - back_r = display->background->red; - back_b = display->background->blue; - } - else - back_b = back_r = back_g; - } - } - - else if (output_encoding == P_LINEAR) - back_b = back_r = back_g = 65535; - - else - back_b = back_r = back_g = 255; - - /* Default the input file gamma if required - this is necessary because - * libpng assumes that if no gamma information is present the data is in the - * output format, but the simplified API deduces the gamma from the input - * format. - */ - if ((png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) == 0) - { - /* Do this directly, not using the png_colorspace functions, to ensure - * that it happens even if the colorspace is invalid (though probably if - * it is the setting will be ignored) Note that the same thing can be - * achieved at the application interface with png_set_gAMA. - */ - if (png_ptr->bit_depth == 16 && - (image->flags & PNG_IMAGE_FLAG_16BIT_sRGB) == 0) - png_ptr->colorspace.gamma = PNG_GAMMA_LINEAR; - - else - png_ptr->colorspace.gamma = PNG_GAMMA_sRGB_INVERSE; - - png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA; - } - - /* Decide what to do based on the PNG color type of the input data. The - * utility function png_create_colormap_entry deals with most aspects of the - * output transformations; this code works out how to produce bytes of - * color-map entries from the original format. - */ - switch (png_ptr->color_type) - { - case PNG_COLOR_TYPE_GRAY: - if (png_ptr->bit_depth <= 8) - { - /* There at most 256 colors in the output, regardless of - * transparency. - */ - unsigned int step, i, val, trans = 256/*ignore*/, back_alpha = 0; - - cmap_entries = 1U << png_ptr->bit_depth; - if (cmap_entries > image->colormap_entries) - png_error(png_ptr, "gray[8] color-map: too few entries"); - - step = 255 / (cmap_entries - 1); - output_processing = PNG_CMAP_NONE; - - /* If there is a tRNS chunk then this either selects a transparent - * value or, if the output has no alpha, the background color. - */ - if (png_ptr->num_trans > 0) - { - trans = png_ptr->trans_color.gray; - - if ((output_format & PNG_FORMAT_FLAG_ALPHA) == 0) - back_alpha = output_encoding == P_LINEAR ? 65535 : 255; - } - - /* png_create_colormap_entry just takes an RGBA and writes the - * corresponding color-map entry using the format from 'image', - * including the required conversion to sRGB or linear as - * appropriate. The input values are always either sRGB (if the - * gamma correction flag is 0) or 0..255 scaled file encoded values - * (if the function must gamma correct them). - */ - for (i=val=0; ibit_depth < 8) - png_set_packing(png_ptr); - } - - else /* bit depth is 16 */ - { - /* The 16-bit input values can be converted directly to 8-bit gamma - * encoded values; however, if a tRNS chunk is present 257 color-map - * entries are required. This means that the extra entry requires - * special processing; add an alpha channel, sacrifice gray level - * 254 and convert transparent (alpha==0) entries to that. - * - * Use libpng to chop the data to 8 bits. Convert it to sRGB at the - * same time to minimize quality loss. If a tRNS chunk is present - * this means libpng must handle it too; otherwise it is impossible - * to do the exact match on the 16-bit value. - * - * If the output has no alpha channel *and* the background color is - * gray then it is possible to let libpng handle the substitution by - * ensuring that the corresponding gray level matches the background - * color exactly. - */ - data_encoding = P_sRGB; - - if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries) - png_error(png_ptr, "gray[16] color-map: too few entries"); - - cmap_entries = (unsigned int)make_gray_colormap(display); - - if (png_ptr->num_trans > 0) - { - unsigned int back_alpha; - - if ((output_format & PNG_FORMAT_FLAG_ALPHA) != 0) - back_alpha = 0; - - else - { - if (back_r == back_g && back_g == back_b) - { - /* Background is gray; no special processing will be - * required. - */ - png_color_16 c; - png_uint_32 gray = back_g; - - if (output_encoding == P_LINEAR) - { - gray = PNG_sRGB_FROM_LINEAR(gray * 255); - - /* And make sure the corresponding palette entry - * matches. - */ - png_create_colormap_entry(display, gray, back_g, back_g, - back_g, 65535, P_LINEAR); - } - - /* The background passed to libpng, however, must be the - * sRGB value. - */ - c.index = 0; /*unused*/ - c.gray = c.red = c.green = c.blue = (png_uint_16)gray; - - /* NOTE: does this work without expanding tRNS to alpha? - * It should be the color->gray case below apparently - * doesn't. - */ - png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); - - output_processing = PNG_CMAP_NONE; - break; - } -#ifdef __COVERITY__ - /* Coverity claims that output_encoding cannot be 2 (P_LINEAR) - * here. - */ - back_alpha = 255; -#else - back_alpha = output_encoding == P_LINEAR ? 65535 : 255; -#endif - } - - /* output_processing means that the libpng-processed row will be - * 8-bit GA and it has to be processing to single byte color-map - * values. Entry 254 is replaced by either a completely - * transparent entry or by the background color at full - * precision (and the background color is not a simple gray - * level in this case.) - */ - expand_tRNS = 1; - output_processing = PNG_CMAP_TRANS; - background_index = 254; - - /* And set (overwrite) color-map entry 254 to the actual - * background color at full precision. - */ - png_create_colormap_entry(display, 254, back_r, back_g, back_b, - back_alpha, output_encoding); - } - - else - output_processing = PNG_CMAP_NONE; - } - break; - - case PNG_COLOR_TYPE_GRAY_ALPHA: - /* 8-bit or 16-bit PNG with two channels - gray and alpha. A minimum - * of 65536 combinations. If, however, the alpha channel is to be - * removed there are only 256 possibilities if the background is gray. - * (Otherwise there is a subset of the 65536 possibilities defined by - * the triangle between black, white and the background color.) - * - * Reduce 16-bit files to 8-bit and sRGB encode the result. No need to - * worry about tRNS matching - tRNS is ignored if there is an alpha - * channel. - */ - data_encoding = P_sRGB; - - if ((output_format & PNG_FORMAT_FLAG_ALPHA) != 0) - { - if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries) - png_error(png_ptr, "gray+alpha color-map: too few entries"); - - cmap_entries = (unsigned int)make_ga_colormap(display); - - background_index = PNG_CMAP_GA_BACKGROUND; - output_processing = PNG_CMAP_GA; - } - - else /* alpha is removed */ - { - /* Alpha must be removed as the PNG data is processed when the - * background is a color because the G and A channels are - * independent and the vector addition (non-parallel vectors) is a - * 2-D problem. - * - * This can be reduced to the same algorithm as above by making a - * colormap containing gray levels (for the opaque grays), a - * background entry (for a transparent pixel) and a set of four six - * level color values, one set for each intermediate alpha value. - * See the comments in make_ga_colormap for how this works in the - * per-pixel processing. - * - * If the background is gray, however, we only need a 256 entry gray - * level color map. It is sufficient to make the entry generated - * for the background color be exactly the color specified. - */ - if ((output_format & PNG_FORMAT_FLAG_COLOR) == 0 || - (back_r == back_g && back_g == back_b)) - { - /* Background is gray; no special processing will be required. */ - png_color_16 c; - png_uint_32 gray = back_g; - - if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries) - png_error(png_ptr, "gray-alpha color-map: too few entries"); - - cmap_entries = (unsigned int)make_gray_colormap(display); - - if (output_encoding == P_LINEAR) - { - gray = PNG_sRGB_FROM_LINEAR(gray * 255); - - /* And make sure the corresponding palette entry matches. */ - png_create_colormap_entry(display, gray, back_g, back_g, - back_g, 65535, P_LINEAR); - } - - /* The background passed to libpng, however, must be the sRGB - * value. - */ - c.index = 0; /*unused*/ - c.gray = c.red = c.green = c.blue = (png_uint_16)gray; - - png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); - - output_processing = PNG_CMAP_NONE; - } - - else - { - png_uint_32 i, a; - - /* This is the same as png_make_ga_colormap, above, except that - * the entries are all opaque. - */ - if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries) - png_error(png_ptr, "ga-alpha color-map: too few entries"); - - i = 0; - while (i < 231) - { - png_uint_32 gray = (i * 256 + 115) / 231; - png_create_colormap_entry(display, i++, gray, gray, gray, - 255, P_sRGB); - } - - /* NOTE: this preserves the full precision of the application - * background color. - */ - background_index = i; - png_create_colormap_entry(display, i++, back_r, back_g, back_b, -#ifdef __COVERITY__ - /* Coverity claims that output_encoding - * cannot be 2 (P_LINEAR) here. - */ 255U, -#else - output_encoding == P_LINEAR ? 65535U : 255U, -#endif - output_encoding); - - /* For non-opaque input composite on the sRGB background - this - * requires inverting the encoding for each component. The input - * is still converted to the sRGB encoding because this is a - * reasonable approximate to the logarithmic curve of human - * visual sensitivity, at least over the narrow range which PNG - * represents. Consequently 'G' is always sRGB encoded, while - * 'A' is linear. We need the linear background colors. - */ - if (output_encoding == P_sRGB) /* else already linear */ - { - /* This may produce a value not exactly matching the - * background, but that's ok because these numbers are only - * used when alpha != 0 - */ - back_r = png_sRGB_table[back_r]; - back_g = png_sRGB_table[back_g]; - back_b = png_sRGB_table[back_b]; - } - - for (a=1; a<5; ++a) - { - unsigned int g; - - /* PNG_sRGB_FROM_LINEAR expects a 16-bit linear value scaled - * by an 8-bit alpha value (0..255). - */ - png_uint_32 alpha = 51 * a; - png_uint_32 back_rx = (255-alpha) * back_r; - png_uint_32 back_gx = (255-alpha) * back_g; - png_uint_32 back_bx = (255-alpha) * back_b; - - for (g=0; g<6; ++g) - { - png_uint_32 gray = png_sRGB_table[g*51] * alpha; - - png_create_colormap_entry(display, i++, - PNG_sRGB_FROM_LINEAR(gray + back_rx), - PNG_sRGB_FROM_LINEAR(gray + back_gx), - PNG_sRGB_FROM_LINEAR(gray + back_bx), 255, P_sRGB); - } - } - - cmap_entries = i; - output_processing = PNG_CMAP_GA; - } - } - break; - - case PNG_COLOR_TYPE_RGB: - case PNG_COLOR_TYPE_RGB_ALPHA: - /* Exclude the case where the output is gray; we can always handle this - * with the cases above. - */ - if ((output_format & PNG_FORMAT_FLAG_COLOR) == 0) - { - /* The color-map will be grayscale, so we may as well convert the - * input RGB values to a simple grayscale and use the grayscale - * code above. - * - * NOTE: calling this apparently damages the recognition of the - * transparent color in background color handling; call - * png_set_tRNS_to_alpha before png_set_background_fixed. - */ - png_set_rgb_to_gray_fixed(png_ptr, PNG_ERROR_ACTION_NONE, -1, - -1); - data_encoding = P_sRGB; - - /* The output will now be one or two 8-bit gray or gray+alpha - * channels. The more complex case arises when the input has alpha. - */ - if ((png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA || - png_ptr->num_trans > 0) && - (output_format & PNG_FORMAT_FLAG_ALPHA) != 0) - { - /* Both input and output have an alpha channel, so no background - * processing is required; just map the GA bytes to the right - * color-map entry. - */ - expand_tRNS = 1; - - if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries) - png_error(png_ptr, "rgb[ga] color-map: too few entries"); - - cmap_entries = (unsigned int)make_ga_colormap(display); - background_index = PNG_CMAP_GA_BACKGROUND; - output_processing = PNG_CMAP_GA; - } - - else - { - /* Either the input or the output has no alpha channel, so there - * will be no non-opaque pixels in the color-map; it will just be - * grayscale. - */ - if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries) - png_error(png_ptr, "rgb[gray] color-map: too few entries"); - - /* Ideally this code would use libpng to do the gamma correction, - * but if an input alpha channel is to be removed we will hit the - * libpng bug in gamma+compose+rgb-to-gray (the double gamma - * correction bug). Fix this by dropping the gamma correction in - * this case and doing it in the palette; this will result in - * duplicate palette entries, but that's better than the - * alternative of double gamma correction. - */ - if ((png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA || - png_ptr->num_trans > 0) && - png_gamma_not_sRGB(png_ptr->colorspace.gamma) != 0) - { - cmap_entries = (unsigned int)make_gray_file_colormap(display); - data_encoding = P_FILE; - } - - else - cmap_entries = (unsigned int)make_gray_colormap(display); - - /* But if the input has alpha or transparency it must be removed - */ - if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA || - png_ptr->num_trans > 0) - { - png_color_16 c; - png_uint_32 gray = back_g; - - /* We need to ensure that the application background exists in - * the colormap and that completely transparent pixels map to - * it. Achieve this simply by ensuring that the entry - * selected for the background really is the background color. - */ - if (data_encoding == P_FILE) /* from the fixup above */ - { - /* The app supplied a gray which is in output_encoding, we - * need to convert it to a value of the input (P_FILE) - * encoding then set this palette entry to the required - * output encoding. - */ - if (output_encoding == P_sRGB) - gray = png_sRGB_table[gray]; /* now P_LINEAR */ - - gray = PNG_DIV257(png_gamma_16bit_correct(gray, - png_ptr->colorspace.gamma)); /* now P_FILE */ - - /* And make sure the corresponding palette entry contains - * exactly the required sRGB value. - */ - png_create_colormap_entry(display, gray, back_g, back_g, - back_g, 0/*unused*/, output_encoding); - } - - else if (output_encoding == P_LINEAR) - { - gray = PNG_sRGB_FROM_LINEAR(gray * 255); - - /* And make sure the corresponding palette entry matches. - */ - png_create_colormap_entry(display, gray, back_g, back_g, - back_g, 0/*unused*/, P_LINEAR); - } - - /* The background passed to libpng, however, must be the - * output (normally sRGB) value. - */ - c.index = 0; /*unused*/ - c.gray = c.red = c.green = c.blue = (png_uint_16)gray; - - /* NOTE: the following is apparently a bug in libpng. Without - * it the transparent color recognition in - * png_set_background_fixed seems to go wrong. - */ - expand_tRNS = 1; - png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); - } - - output_processing = PNG_CMAP_NONE; - } - } - - else /* output is color */ - { - /* We could use png_quantize here so long as there is no transparent - * color or alpha; png_quantize ignores alpha. Easier overall just - * to do it once and using PNG_DIV51 on the 6x6x6 reduced RGB cube. - * Consequently we always want libpng to produce sRGB data. - */ - data_encoding = P_sRGB; - - /* Is there any transparency or alpha? */ - if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA || - png_ptr->num_trans > 0) - { - /* Is there alpha in the output too? If so all four channels are - * processed into a special RGB cube with alpha support. - */ - if ((output_format & PNG_FORMAT_FLAG_ALPHA) != 0) - { - png_uint_32 r; - - if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries) - png_error(png_ptr, "rgb+alpha color-map: too few entries"); - - cmap_entries = (unsigned int)make_rgb_colormap(display); - - /* Add a transparent entry. */ - png_create_colormap_entry(display, cmap_entries, 255, 255, - 255, 0, P_sRGB); - - /* This is stored as the background index for the processing - * algorithm. - */ - background_index = cmap_entries++; - - /* Add 27 r,g,b entries each with alpha 0.5. */ - for (r=0; r<256; r = (r << 1) | 0x7f) - { - png_uint_32 g; - - for (g=0; g<256; g = (g << 1) | 0x7f) - { - png_uint_32 b; - - /* This generates components with the values 0, 127 and - * 255 - */ - for (b=0; b<256; b = (b << 1) | 0x7f) - png_create_colormap_entry(display, cmap_entries++, - r, g, b, 128, P_sRGB); - } - } - - expand_tRNS = 1; - output_processing = PNG_CMAP_RGB_ALPHA; - } - - else - { - /* Alpha/transparency must be removed. The background must - * exist in the color map (achieved by setting adding it after - * the 666 color-map). If the standard processing code will - * pick up this entry automatically that's all that is - * required; libpng can be called to do the background - * processing. - */ - unsigned int sample_size = - PNG_IMAGE_SAMPLE_SIZE(output_format); - png_uint_32 r, g, b; /* sRGB background */ - - if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries) - png_error(png_ptr, "rgb-alpha color-map: too few entries"); - - cmap_entries = (unsigned int)make_rgb_colormap(display); - - png_create_colormap_entry(display, cmap_entries, back_r, - back_g, back_b, 0/*unused*/, output_encoding); - - if (output_encoding == P_LINEAR) - { - r = PNG_sRGB_FROM_LINEAR(back_r * 255); - g = PNG_sRGB_FROM_LINEAR(back_g * 255); - b = PNG_sRGB_FROM_LINEAR(back_b * 255); - } - - else - { - r = back_r; - g = back_g; - b = back_g; - } - - /* Compare the newly-created color-map entry with the one the - * PNG_CMAP_RGB algorithm will use. If the two entries don't - * match, add the new one and set this as the background - * index. - */ - if (memcmp((png_const_bytep)display->colormap + - sample_size * cmap_entries, - (png_const_bytep)display->colormap + - sample_size * PNG_RGB_INDEX(r,g,b), - sample_size) != 0) - { - /* The background color must be added. */ - background_index = cmap_entries++; - - /* Add 27 r,g,b entries each with created by composing with - * the background at alpha 0.5. - */ - for (r=0; r<256; r = (r << 1) | 0x7f) - { - for (g=0; g<256; g = (g << 1) | 0x7f) - { - /* This generates components with the values 0, 127 - * and 255 - */ - for (b=0; b<256; b = (b << 1) | 0x7f) - png_create_colormap_entry(display, cmap_entries++, - png_colormap_compose(display, r, P_sRGB, 128, - back_r, output_encoding), - png_colormap_compose(display, g, P_sRGB, 128, - back_g, output_encoding), - png_colormap_compose(display, b, P_sRGB, 128, - back_b, output_encoding), - 0/*unused*/, output_encoding); - } - } - - expand_tRNS = 1; - output_processing = PNG_CMAP_RGB_ALPHA; - } - - else /* background color is in the standard color-map */ - { - png_color_16 c; - - c.index = 0; /*unused*/ - c.red = (png_uint_16)back_r; - c.gray = c.green = (png_uint_16)back_g; - c.blue = (png_uint_16)back_b; - - png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); - - output_processing = PNG_CMAP_RGB; - } - } - } - - else /* no alpha or transparency in the input */ - { - /* Alpha in the output is irrelevant, simply map the opaque input - * pixels to the 6x6x6 color-map. - */ - if (PNG_RGB_COLORMAP_ENTRIES > image->colormap_entries) - png_error(png_ptr, "rgb color-map: too few entries"); - - cmap_entries = (unsigned int)make_rgb_colormap(display); - output_processing = PNG_CMAP_RGB; - } - } - break; - - case PNG_COLOR_TYPE_PALETTE: - /* It's already got a color-map. It may be necessary to eliminate the - * tRNS entries though. - */ - { - unsigned int num_trans = png_ptr->num_trans; - png_const_bytep trans = num_trans > 0 ? png_ptr->trans_alpha : NULL; - png_const_colorp colormap = png_ptr->palette; - const int do_background = trans != NULL && - (output_format & PNG_FORMAT_FLAG_ALPHA) == 0; - unsigned int i; - - /* Just in case: */ - if (trans == NULL) - num_trans = 0; - - output_processing = PNG_CMAP_NONE; - data_encoding = P_FILE; /* Don't change from color-map indices */ - cmap_entries = (unsigned int)png_ptr->num_palette; - if (cmap_entries > 256) - cmap_entries = 256; - - if (cmap_entries > (unsigned int)image->colormap_entries) - png_error(png_ptr, "palette color-map: too few entries"); - - for (i=0; i < cmap_entries; ++i) - { - if (do_background != 0 && i < num_trans && trans[i] < 255) - { - if (trans[i] == 0) - png_create_colormap_entry(display, i, back_r, back_g, - back_b, 0, output_encoding); - - else - { - /* Must compose the PNG file color in the color-map entry - * on the sRGB color in 'back'. - */ - png_create_colormap_entry(display, i, - png_colormap_compose(display, colormap[i].red, - P_FILE, trans[i], back_r, output_encoding), - png_colormap_compose(display, colormap[i].green, - P_FILE, trans[i], back_g, output_encoding), - png_colormap_compose(display, colormap[i].blue, - P_FILE, trans[i], back_b, output_encoding), - output_encoding == P_LINEAR ? trans[i] * 257U : - trans[i], - output_encoding); - } - } - - else - png_create_colormap_entry(display, i, colormap[i].red, - colormap[i].green, colormap[i].blue, - i < num_trans ? trans[i] : 255U, P_FILE/*8-bit*/); - } - - /* The PNG data may have indices packed in fewer than 8 bits, it - * must be expanded if so. - */ - if (png_ptr->bit_depth < 8) - png_set_packing(png_ptr); - } - break; - - default: - png_error(png_ptr, "invalid PNG color type"); - /*NOT REACHED*/ - } - - /* Now deal with the output processing */ - if (expand_tRNS != 0 && png_ptr->num_trans > 0 && - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) == 0) - png_set_tRNS_to_alpha(png_ptr); - - switch (data_encoding) - { - case P_sRGB: - /* Change to 8-bit sRGB */ - png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB); - /* FALL THROUGH */ - - case P_FILE: - if (png_ptr->bit_depth > 8) - png_set_scale_16(png_ptr); - break; - -#ifdef __GNUC__ - default: - png_error(png_ptr, "bad data option (internal error)"); -#endif - } - - if (cmap_entries > 256 || cmap_entries > image->colormap_entries) - png_error(png_ptr, "color map overflow (BAD internal error)"); - - image->colormap_entries = cmap_entries; - - /* Double check using the recorded background index */ - switch (output_processing) - { - case PNG_CMAP_NONE: - if (background_index != PNG_CMAP_NONE_BACKGROUND) - goto bad_background; - break; - - case PNG_CMAP_GA: - if (background_index != PNG_CMAP_GA_BACKGROUND) - goto bad_background; - break; - - case PNG_CMAP_TRANS: - if (background_index >= cmap_entries || - background_index != PNG_CMAP_TRANS_BACKGROUND) - goto bad_background; - break; - - case PNG_CMAP_RGB: - if (background_index != PNG_CMAP_RGB_BACKGROUND) - goto bad_background; - break; - - case PNG_CMAP_RGB_ALPHA: - if (background_index != PNG_CMAP_RGB_ALPHA_BACKGROUND) - goto bad_background; - break; - - default: - png_error(png_ptr, "bad processing option (internal error)"); - - bad_background: - png_error(png_ptr, "bad background index (internal error)"); - } - - display->colormap_processing = (int)output_processing; - - return 1/*ok*/; -} - -/* The final part of the color-map read called from png_image_finish_read. */ -static int -png_image_read_and_map(png_voidp argument) -{ - png_image_read_control *display = png_voidcast(png_image_read_control*, - argument); - png_imagep image = display->image; - png_structrp png_ptr = image->opaque->png_ptr; - int passes; - - /* Called when the libpng data must be transformed into the color-mapped - * form. There is a local row buffer in display->local and this routine must - * do the interlace handling. - */ - switch (png_ptr->interlaced) - { - case PNG_INTERLACE_NONE: - passes = 1; - break; - - case PNG_INTERLACE_ADAM7: - passes = PNG_INTERLACE_ADAM7_PASSES; - break; - - default: - png_error(png_ptr, "unknown interlace type"); - } - - { - png_uint_32 height = image->height; - png_uint_32 width = image->width; - int proc = display->colormap_processing; - png_bytep first_row = png_voidcast(png_bytep, display->first_row); - ptrdiff_t step_row = display->row_bytes; - int pass; - - for (pass = 0; pass < passes; ++pass) - { - unsigned int startx, stepx, stepy; - png_uint_32 y; - - if (png_ptr->interlaced == PNG_INTERLACE_ADAM7) - { - /* The row may be empty for a short image: */ - if (PNG_PASS_COLS(width, pass) == 0) - continue; - - startx = PNG_PASS_START_COL(pass); - stepx = PNG_PASS_COL_OFFSET(pass); - y = PNG_PASS_START_ROW(pass); - stepy = PNG_PASS_ROW_OFFSET(pass); - } - - else - { - y = 0; - startx = 0; - stepx = stepy = 1; - } - - for (; ylocal_row); - png_bytep outrow = first_row + y * step_row; - png_const_bytep end_row = outrow + width; - - /* Read read the libpng data into the temporary buffer. */ - png_read_row(png_ptr, inrow, NULL); - - /* Now process the row according to the processing option, note - * that the caller verifies that the format of the libpng output - * data is as required. - */ - outrow += startx; - switch (proc) - { - case PNG_CMAP_GA: - for (; outrow < end_row; outrow += stepx) - { - /* The data is always in the PNG order */ - unsigned int gray = *inrow++; - unsigned int alpha = *inrow++; - unsigned int entry; - - /* NOTE: this code is copied as a comment in - * make_ga_colormap above. Please update the - * comment if you change this code! - */ - if (alpha > 229) /* opaque */ - { - entry = (231 * gray + 128) >> 8; - } - else if (alpha < 26) /* transparent */ - { - entry = 231; - } - else /* partially opaque */ - { - entry = 226 + 6 * PNG_DIV51(alpha) + PNG_DIV51(gray); - } - - *outrow = (png_byte)entry; - } - break; - - case PNG_CMAP_TRANS: - for (; outrow < end_row; outrow += stepx) - { - png_byte gray = *inrow++; - png_byte alpha = *inrow++; - - if (alpha == 0) - *outrow = PNG_CMAP_TRANS_BACKGROUND; - - else if (gray != PNG_CMAP_TRANS_BACKGROUND) - *outrow = gray; - - else - *outrow = (png_byte)(PNG_CMAP_TRANS_BACKGROUND+1); - } - break; - - case PNG_CMAP_RGB: - for (; outrow < end_row; outrow += stepx) - { - *outrow = PNG_RGB_INDEX(inrow[0], inrow[1], inrow[2]); - inrow += 3; - } - break; - - case PNG_CMAP_RGB_ALPHA: - for (; outrow < end_row; outrow += stepx) - { - unsigned int alpha = inrow[3]; - - /* Because the alpha entries only hold alpha==0.5 values - * split the processing at alpha==0.25 (64) and 0.75 - * (196). - */ - - if (alpha >= 196) - *outrow = PNG_RGB_INDEX(inrow[0], inrow[1], - inrow[2]); - - else if (alpha < 64) - *outrow = PNG_CMAP_RGB_ALPHA_BACKGROUND; - - else - { - /* Likewise there are three entries for each of r, g - * and b. We could select the entry by popcount on - * the top two bits on those architectures that - * support it, this is what the code below does, - * crudely. - */ - unsigned int back_i = PNG_CMAP_RGB_ALPHA_BACKGROUND+1; - - /* Here are how the values map: - * - * 0x00 .. 0x3f -> 0 - * 0x40 .. 0xbf -> 1 - * 0xc0 .. 0xff -> 2 - * - * So, as above with the explicit alpha checks, the - * breakpoints are at 64 and 196. - */ - if (inrow[0] & 0x80) back_i += 9; /* red */ - if (inrow[0] & 0x40) back_i += 9; - if (inrow[0] & 0x80) back_i += 3; /* green */ - if (inrow[0] & 0x40) back_i += 3; - if (inrow[0] & 0x80) back_i += 1; /* blue */ - if (inrow[0] & 0x40) back_i += 1; - - *outrow = (png_byte)back_i; - } - - inrow += 4; - } - break; - - default: - break; - } - } - } - } - - return 1; -} - -static int -png_image_read_colormapped(png_voidp argument) -{ - png_image_read_control *display = png_voidcast(png_image_read_control*, - argument); - png_imagep image = display->image; - png_controlp control = image->opaque; - png_structrp png_ptr = control->png_ptr; - png_inforp info_ptr = control->info_ptr; - - int passes = 0; /* As a flag */ - - PNG_SKIP_CHUNKS(png_ptr); - - /* Update the 'info' structure and make sure the result is as required; first - * make sure to turn on the interlace handling if it will be required - * (because it can't be turned on *after* the call to png_read_update_info!) - */ - if (display->colormap_processing == PNG_CMAP_NONE) - passes = png_set_interlace_handling(png_ptr); - - png_read_update_info(png_ptr, info_ptr); - - /* The expected output can be deduced from the colormap_processing option. */ - switch (display->colormap_processing) - { - case PNG_CMAP_NONE: - /* Output must be one channel and one byte per pixel, the output - * encoding can be anything. - */ - if ((info_ptr->color_type == PNG_COLOR_TYPE_PALETTE || - info_ptr->color_type == PNG_COLOR_TYPE_GRAY) && - info_ptr->bit_depth == 8) - break; - - goto bad_output; - - case PNG_CMAP_TRANS: - case PNG_CMAP_GA: - /* Output must be two channels and the 'G' one must be sRGB, the latter - * can be checked with an exact number because it should have been set - * to this number above! - */ - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && - info_ptr->bit_depth == 8 && - png_ptr->screen_gamma == PNG_GAMMA_sRGB && - image->colormap_entries == 256) - break; - - goto bad_output; - - case PNG_CMAP_RGB: - /* Output must be 8-bit sRGB encoded RGB */ - if (info_ptr->color_type == PNG_COLOR_TYPE_RGB && - info_ptr->bit_depth == 8 && - png_ptr->screen_gamma == PNG_GAMMA_sRGB && - image->colormap_entries == 216) - break; - - goto bad_output; - - case PNG_CMAP_RGB_ALPHA: - /* Output must be 8-bit sRGB encoded RGBA */ - if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA && - info_ptr->bit_depth == 8 && - png_ptr->screen_gamma == PNG_GAMMA_sRGB && - image->colormap_entries == 244 /* 216 + 1 + 27 */) - break; - - /* goto bad_output; */ - /* FALL THROUGH */ - - default: - bad_output: - png_error(png_ptr, "bad color-map processing (internal error)"); - } - - /* Now read the rows. Do this here if it is possible to read directly into - * the output buffer, otherwise allocate a local row buffer of the maximum - * size libpng requires and call the relevant processing routine safely. - */ - { - png_voidp first_row = display->buffer; - ptrdiff_t row_bytes = display->row_stride; - - /* The following expression is designed to work correctly whether it gives - * a signed or an unsigned result. - */ - if (row_bytes < 0) - { - char *ptr = png_voidcast(char*, first_row); - ptr += (image->height-1) * (-row_bytes); - first_row = png_voidcast(png_voidp, ptr); - } - - display->first_row = first_row; - display->row_bytes = row_bytes; - } - - if (passes == 0) - { - int result; - png_voidp row = png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr)); - - display->local_row = row; - result = png_safe_execute(image, png_image_read_and_map, display); - display->local_row = NULL; - png_free(png_ptr, row); - - return result; - } - - else - { - png_alloc_size_t row_bytes = (png_alloc_size_t)display->row_bytes; - - while (--passes >= 0) - { - png_uint_32 y = image->height; - png_bytep row = png_voidcast(png_bytep, display->first_row); - - for (; y > 0; --y) - { - png_read_row(png_ptr, row, NULL); - row += row_bytes; - } - } - - return 1; - } -} - -/* Just the row reading part of png_image_read. */ -static int -png_image_read_composite(png_voidp argument) -{ - png_image_read_control *display = png_voidcast(png_image_read_control*, - argument); - png_imagep image = display->image; - png_structrp png_ptr = image->opaque->png_ptr; - int passes; - - switch (png_ptr->interlaced) - { - case PNG_INTERLACE_NONE: - passes = 1; - break; - - case PNG_INTERLACE_ADAM7: - passes = PNG_INTERLACE_ADAM7_PASSES; - break; - - default: - png_error(png_ptr, "unknown interlace type"); - } - - { - png_uint_32 height = image->height; - png_uint_32 width = image->width; - ptrdiff_t step_row = display->row_bytes; - unsigned int channels = - (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1; - int pass; - - for (pass = 0; pass < passes; ++pass) - { - unsigned int startx, stepx, stepy; - png_uint_32 y; - - if (png_ptr->interlaced == PNG_INTERLACE_ADAM7) - { - /* The row may be empty for a short image: */ - if (PNG_PASS_COLS(width, pass) == 0) - continue; - - startx = PNG_PASS_START_COL(pass) * channels; - stepx = PNG_PASS_COL_OFFSET(pass) * channels; - y = PNG_PASS_START_ROW(pass); - stepy = PNG_PASS_ROW_OFFSET(pass); - } - - else - { - y = 0; - startx = 0; - stepx = channels; - stepy = 1; - } - - for (; ylocal_row); - png_bytep outrow; - png_const_bytep end_row; - - /* Read the row, which is packed: */ - png_read_row(png_ptr, inrow, NULL); - - outrow = png_voidcast(png_bytep, display->first_row); - outrow += y * step_row; - end_row = outrow + width * channels; - - /* Now do the composition on each pixel in this row. */ - outrow += startx; - for (; outrow < end_row; outrow += stepx) - { - png_byte alpha = inrow[channels]; - - if (alpha > 0) /* else no change to the output */ - { - unsigned int c; - - for (c=0; cimage; - png_structrp png_ptr = image->opaque->png_ptr; - png_inforp info_ptr = image->opaque->info_ptr; - png_uint_32 height = image->height; - png_uint_32 width = image->width; - int pass, passes; - - /* Double check the convoluted logic below. We expect to get here with - * libpng doing rgb to gray and gamma correction but background processing - * left to the png_image_read_background function. The rows libpng produce - * might be 8 or 16-bit but should always have two channels; gray plus alpha. - */ - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == 0) - png_error(png_ptr, "lost rgb to gray"); - - if ((png_ptr->transformations & PNG_COMPOSE) != 0) - png_error(png_ptr, "unexpected compose"); - - if (png_get_channels(png_ptr, info_ptr) != 2) - png_error(png_ptr, "lost/gained channels"); - - /* Expect the 8-bit case to always remove the alpha channel */ - if ((image->format & PNG_FORMAT_FLAG_LINEAR) == 0 && - (image->format & PNG_FORMAT_FLAG_ALPHA) != 0) - png_error(png_ptr, "unexpected 8-bit transformation"); - - switch (png_ptr->interlaced) - { - case PNG_INTERLACE_NONE: - passes = 1; - break; - - case PNG_INTERLACE_ADAM7: - passes = PNG_INTERLACE_ADAM7_PASSES; - break; - - default: - png_error(png_ptr, "unknown interlace type"); - } - - /* Use direct access to info_ptr here because otherwise the simplified API - * would require PNG_EASY_ACCESS_SUPPORTED (just for this.) Note this is - * checking the value after libpng expansions, not the original value in the - * PNG. - */ - switch (info_ptr->bit_depth) - { - case 8: - /* 8-bit sRGB gray values with an alpha channel; the alpha channel is - * to be removed by composing on a background: either the row if - * display->background is NULL or display->background->green if not. - * Unlike the code above ALPHA_OPTIMIZED has *not* been done. - */ - { - png_bytep first_row = png_voidcast(png_bytep, display->first_row); - ptrdiff_t step_row = display->row_bytes; - - for (pass = 0; pass < passes; ++pass) - { - png_bytep row = png_voidcast(png_bytep, display->first_row); - unsigned int startx, stepx, stepy; - png_uint_32 y; - - if (png_ptr->interlaced == PNG_INTERLACE_ADAM7) - { - /* The row may be empty for a short image: */ - if (PNG_PASS_COLS(width, pass) == 0) - continue; - - startx = PNG_PASS_START_COL(pass); - stepx = PNG_PASS_COL_OFFSET(pass); - y = PNG_PASS_START_ROW(pass); - stepy = PNG_PASS_ROW_OFFSET(pass); - } - - else - { - y = 0; - startx = 0; - stepx = stepy = 1; - } - - if (display->background == NULL) - { - for (; ylocal_row); - png_bytep outrow = first_row + y * step_row; - png_const_bytep end_row = outrow + width; - - /* Read the row, which is packed: */ - png_read_row(png_ptr, inrow, NULL); - - /* Now do the composition on each pixel in this row. */ - outrow += startx; - for (; outrow < end_row; outrow += stepx) - { - png_byte alpha = inrow[1]; - - if (alpha > 0) /* else no change to the output */ - { - png_uint_32 component = inrow[0]; - - if (alpha < 255) /* else just use component */ - { - /* Since PNG_OPTIMIZED_ALPHA was not set it is - * necessary to invert the sRGB transfer - * function and multiply the alpha out. - */ - component = png_sRGB_table[component] * alpha; - component += png_sRGB_table[outrow[0]] * - (255-alpha); - component = PNG_sRGB_FROM_LINEAR(component); - } - - outrow[0] = (png_byte)component; - } - - inrow += 2; /* gray and alpha channel */ - } - } - } - - else /* constant background value */ - { - png_byte background8 = display->background->green; - png_uint_16 background = png_sRGB_table[background8]; - - for (; ylocal_row); - png_bytep outrow = first_row + y * step_row; - png_const_bytep end_row = outrow + width; - - /* Read the row, which is packed: */ - png_read_row(png_ptr, inrow, NULL); - - /* Now do the composition on each pixel in this row. */ - outrow += startx; - for (; outrow < end_row; outrow += stepx) - { - png_byte alpha = inrow[1]; - - if (alpha > 0) /* else use background */ - { - png_uint_32 component = inrow[0]; - - if (alpha < 255) /* else just use component */ - { - component = png_sRGB_table[component] * alpha; - component += background * (255-alpha); - component = PNG_sRGB_FROM_LINEAR(component); - } - - outrow[0] = (png_byte)component; - } - - else - outrow[0] = background8; - - inrow += 2; /* gray and alpha channel */ - } - - row += display->row_bytes; - } - } - } - } - break; - - case 16: - /* 16-bit linear with pre-multiplied alpha; the pre-multiplication must - * still be done and, maybe, the alpha channel removed. This code also - * handles the alpha-first option. - */ - { - png_uint_16p first_row = png_voidcast(png_uint_16p, - display->first_row); - /* The division by two is safe because the caller passed in a - * stride which was multiplied by 2 (below) to get row_bytes. - */ - ptrdiff_t step_row = display->row_bytes / 2; - unsigned int preserve_alpha = (image->format & - PNG_FORMAT_FLAG_ALPHA) != 0; - unsigned int outchannels = 1U+preserve_alpha; - int swap_alpha = 0; - -# ifdef PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED - if (preserve_alpha != 0 && - (image->format & PNG_FORMAT_FLAG_AFIRST) != 0) - swap_alpha = 1; -# endif - - for (pass = 0; pass < passes; ++pass) - { - unsigned int startx, stepx, stepy; - png_uint_32 y; - - /* The 'x' start and step are adjusted to output components here. - */ - if (png_ptr->interlaced == PNG_INTERLACE_ADAM7) - { - /* The row may be empty for a short image: */ - if (PNG_PASS_COLS(width, pass) == 0) - continue; - - startx = PNG_PASS_START_COL(pass) * outchannels; - stepx = PNG_PASS_COL_OFFSET(pass) * outchannels; - y = PNG_PASS_START_ROW(pass); - stepy = PNG_PASS_ROW_OFFSET(pass); - } - - else - { - y = 0; - startx = 0; - stepx = outchannels; - stepy = 1; - } - - for (; ylocal_row), NULL); - inrow = png_voidcast(png_const_uint_16p, display->local_row); - - /* Now do the pre-multiplication on each pixel in this row. - */ - outrow += startx; - for (; outrow < end_row; outrow += stepx) - { - png_uint_32 component = inrow[0]; - png_uint_16 alpha = inrow[1]; - - if (alpha > 0) /* else 0 */ - { - if (alpha < 65535) /* else just use component */ - { - component *= alpha; - component += 32767; - component /= 65535; - } - } - - else - component = 0; - - outrow[swap_alpha] = (png_uint_16)component; - if (preserve_alpha != 0) - outrow[1 ^ swap_alpha] = alpha; - - inrow += 2; /* components and alpha channel */ - } - } - } - } - break; - -#ifdef __GNUC__ - default: - png_error(png_ptr, "unexpected bit depth"); -#endif - } - - return 1; -} - -/* The guts of png_image_finish_read as a png_safe_execute callback. */ -static int -png_image_read_direct(png_voidp argument) -{ - png_image_read_control *display = png_voidcast(png_image_read_control*, - argument); - png_imagep image = display->image; - png_structrp png_ptr = image->opaque->png_ptr; - png_inforp info_ptr = image->opaque->info_ptr; - - png_uint_32 format = image->format; - int linear = (format & PNG_FORMAT_FLAG_LINEAR) != 0; - int do_local_compose = 0; - int do_local_background = 0; /* to avoid double gamma correction bug */ - int passes = 0; - - /* Add transforms to ensure the correct output format is produced then check - * that the required implementation support is there. Always expand; always - * need 8 bits minimum, no palette and expanded tRNS. - */ - png_set_expand(png_ptr); - - /* Now check the format to see if it was modified. */ - { - png_uint_32 base_format = png_image_format(png_ptr) & - ~PNG_FORMAT_FLAG_COLORMAP /* removed by png_set_expand */; - png_uint_32 change = format ^ base_format; - png_fixed_point output_gamma; - int mode; /* alpha mode */ - - /* Do this first so that we have a record if rgb to gray is happening. */ - if ((change & PNG_FORMAT_FLAG_COLOR) != 0) - { - /* gray<->color transformation required. */ - if ((format & PNG_FORMAT_FLAG_COLOR) != 0) - png_set_gray_to_rgb(png_ptr); - - else - { - /* libpng can't do both rgb to gray and - * background/pre-multiplication if there is also significant gamma - * correction, because both operations require linear colors and - * the code only supports one transform doing the gamma correction. - * Handle this by doing the pre-multiplication or background - * operation in this code, if necessary. - * - * TODO: fix this by rewriting pngrtran.c (!) - * - * For the moment (given that fixing this in pngrtran.c is an - * enormous change) 'do_local_background' is used to indicate that - * the problem exists. - */ - if ((base_format & PNG_FORMAT_FLAG_ALPHA) != 0) - do_local_background = 1/*maybe*/; - - png_set_rgb_to_gray_fixed(png_ptr, PNG_ERROR_ACTION_NONE, - PNG_RGB_TO_GRAY_DEFAULT, PNG_RGB_TO_GRAY_DEFAULT); - } - - change &= ~PNG_FORMAT_FLAG_COLOR; - } - - /* Set the gamma appropriately, linear for 16-bit input, sRGB otherwise. - */ - { - png_fixed_point input_gamma_default; - - if ((base_format & PNG_FORMAT_FLAG_LINEAR) != 0 && - (image->flags & PNG_IMAGE_FLAG_16BIT_sRGB) == 0) - input_gamma_default = PNG_GAMMA_LINEAR; - else - input_gamma_default = PNG_DEFAULT_sRGB; - - /* Call png_set_alpha_mode to set the default for the input gamma; the - * output gamma is set by a second call below. - */ - png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, input_gamma_default); - } - - if (linear != 0) - { - /* If there *is* an alpha channel in the input it must be multiplied - * out; use PNG_ALPHA_STANDARD, otherwise just use PNG_ALPHA_PNG. - */ - if ((base_format & PNG_FORMAT_FLAG_ALPHA) != 0) - mode = PNG_ALPHA_STANDARD; /* associated alpha */ - - else - mode = PNG_ALPHA_PNG; - - output_gamma = PNG_GAMMA_LINEAR; - } - - else - { - mode = PNG_ALPHA_PNG; - output_gamma = PNG_DEFAULT_sRGB; - } - - /* If 'do_local_background' is set check for the presence of gamma - * correction; this is part of the work-round for the libpng bug - * described above. - * - * TODO: fix libpng and remove this. - */ - if (do_local_background != 0) - { - png_fixed_point gtest; - - /* This is 'png_gamma_threshold' from pngrtran.c; the test used for - * gamma correction, the screen gamma hasn't been set on png_struct - * yet; it's set below. png_struct::gamma, however, is set to the - * final value. - */ - if (png_muldiv(>est, output_gamma, png_ptr->colorspace.gamma, - PNG_FP_1) != 0 && png_gamma_significant(gtest) == 0) - do_local_background = 0; - - else if (mode == PNG_ALPHA_STANDARD) - { - do_local_background = 2/*required*/; - mode = PNG_ALPHA_PNG; /* prevent libpng doing it */ - } - - /* else leave as 1 for the checks below */ - } - - /* If the bit-depth changes then handle that here. */ - if ((change & PNG_FORMAT_FLAG_LINEAR) != 0) - { - if (linear != 0 /*16-bit output*/) - png_set_expand_16(png_ptr); - - else /* 8-bit output */ - png_set_scale_16(png_ptr); - - change &= ~PNG_FORMAT_FLAG_LINEAR; - } - - /* Now the background/alpha channel changes. */ - if ((change & PNG_FORMAT_FLAG_ALPHA) != 0) - { - /* Removing an alpha channel requires composition for the 8-bit - * formats; for the 16-bit it is already done, above, by the - * pre-multiplication and the channel just needs to be stripped. - */ - if ((base_format & PNG_FORMAT_FLAG_ALPHA) != 0) - { - /* If RGB->gray is happening the alpha channel must be left and the - * operation completed locally. - * - * TODO: fix libpng and remove this. - */ - if (do_local_background != 0) - do_local_background = 2/*required*/; - - /* 16-bit output: just remove the channel */ - else if (linear != 0) /* compose on black (well, pre-multiply) */ - png_set_strip_alpha(png_ptr); - - /* 8-bit output: do an appropriate compose */ - else if (display->background != NULL) - { - png_color_16 c; - - c.index = 0; /*unused*/ - c.red = display->background->red; - c.green = display->background->green; - c.blue = display->background->blue; - c.gray = display->background->green; - - /* This is always an 8-bit sRGB value, using the 'green' channel - * for gray is much better than calculating the luminance here; - * we can get off-by-one errors in that calculation relative to - * the app expectations and that will show up in transparent - * pixels. - */ - png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); - } - - else /* compose on row: implemented below. */ - { - do_local_compose = 1; - /* This leaves the alpha channel in the output, so it has to be - * removed by the code below. Set the encoding to the 'OPTIMIZE' - * one so the code only has to hack on the pixels that require - * composition. - */ - mode = PNG_ALPHA_OPTIMIZED; - } - } - - else /* output needs an alpha channel */ - { - /* This is tricky because it happens before the swap operation has - * been accomplished; however, the swap does *not* swap the added - * alpha channel (weird API), so it must be added in the correct - * place. - */ - png_uint_32 filler; /* opaque filler */ - int where; - - if (linear != 0) - filler = 65535; - - else - filler = 255; - -#ifdef PNG_FORMAT_AFIRST_SUPPORTED - if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) - { - where = PNG_FILLER_BEFORE; - change &= ~PNG_FORMAT_FLAG_AFIRST; - } - - else -#endif - where = PNG_FILLER_AFTER; - - png_set_add_alpha(png_ptr, filler, where); - } - - /* This stops the (irrelevant) call to swap_alpha below. */ - change &= ~PNG_FORMAT_FLAG_ALPHA; - } - - /* Now set the alpha mode correctly; this is always done, even if there is - * no alpha channel in either the input or the output because it correctly - * sets the output gamma. - */ - png_set_alpha_mode_fixed(png_ptr, mode, output_gamma); - -# ifdef PNG_FORMAT_BGR_SUPPORTED - if ((change & PNG_FORMAT_FLAG_BGR) != 0) - { - /* Check only the output format; PNG is never BGR; don't do this if - * the output is gray, but fix up the 'format' value in that case. - */ - if ((format & PNG_FORMAT_FLAG_COLOR) != 0) - png_set_bgr(png_ptr); - - else - format &= ~PNG_FORMAT_FLAG_BGR; - - change &= ~PNG_FORMAT_FLAG_BGR; - } -# endif - -# ifdef PNG_FORMAT_AFIRST_SUPPORTED - if ((change & PNG_FORMAT_FLAG_AFIRST) != 0) - { - /* Only relevant if there is an alpha channel - it's particularly - * important to handle this correctly because do_local_compose may - * be set above and then libpng will keep the alpha channel for this - * code to remove. - */ - if ((format & PNG_FORMAT_FLAG_ALPHA) != 0) - { - /* Disable this if doing a local background, - * TODO: remove this when local background is no longer required. - */ - if (do_local_background != 2) - png_set_swap_alpha(png_ptr); - } - - else - format &= ~PNG_FORMAT_FLAG_AFIRST; - - change &= ~PNG_FORMAT_FLAG_AFIRST; - } -# endif - - /* If the *output* is 16-bit then we need to check for a byte-swap on this - * architecture. - */ - if (linear != 0) - { - PNG_CONST png_uint_16 le = 0x0001; - - if ((*(png_const_bytep) & le) != 0) - png_set_swap(png_ptr); - } - - /* If change is not now 0 some transformation is missing - error out. */ - if (change != 0) - png_error(png_ptr, "png_read_image: unsupported transformation"); - } - - PNG_SKIP_CHUNKS(png_ptr); - - /* Update the 'info' structure and make sure the result is as required; first - * make sure to turn on the interlace handling if it will be required - * (because it can't be turned on *after* the call to png_read_update_info!) - * - * TODO: remove the do_local_background fixup below. - */ - if (do_local_compose == 0 && do_local_background != 2) - passes = png_set_interlace_handling(png_ptr); - - png_read_update_info(png_ptr, info_ptr); - - { - png_uint_32 info_format = 0; - - if ((info_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) - info_format |= PNG_FORMAT_FLAG_COLOR; - - if ((info_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0) - { - /* do_local_compose removes this channel below. */ - if (do_local_compose == 0) - { - /* do_local_background does the same if required. */ - if (do_local_background != 2 || - (format & PNG_FORMAT_FLAG_ALPHA) != 0) - info_format |= PNG_FORMAT_FLAG_ALPHA; - } - } - - else if (do_local_compose != 0) /* internal error */ - png_error(png_ptr, "png_image_read: alpha channel lost"); - - if (info_ptr->bit_depth == 16) - info_format |= PNG_FORMAT_FLAG_LINEAR; - -#ifdef PNG_FORMAT_BGR_SUPPORTED - if ((png_ptr->transformations & PNG_BGR) != 0) - info_format |= PNG_FORMAT_FLAG_BGR; -#endif - -#ifdef PNG_FORMAT_AFIRST_SUPPORTED - if (do_local_background == 2) - { - if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) - info_format |= PNG_FORMAT_FLAG_AFIRST; - } - - if ((png_ptr->transformations & PNG_SWAP_ALPHA) != 0 || - ((png_ptr->transformations & PNG_ADD_ALPHA) != 0 && - (png_ptr->flags & PNG_FLAG_FILLER_AFTER) == 0)) - { - if (do_local_background == 2) - png_error(png_ptr, "unexpected alpha swap transformation"); - - info_format |= PNG_FORMAT_FLAG_AFIRST; - } -# endif - - /* This is actually an internal error. */ - if (info_format != format) - png_error(png_ptr, "png_read_image: invalid transformations"); - } - - /* Now read the rows. If do_local_compose is set then it is necessary to use - * a local row buffer. The output will be GA, RGBA or BGRA and must be - * converted to G, RGB or BGR as appropriate. The 'local_row' member of the - * display acts as a flag. - */ - { - png_voidp first_row = display->buffer; - ptrdiff_t row_bytes = display->row_stride; - - if (linear != 0) - row_bytes *= 2; - - /* The following expression is designed to work correctly whether it gives - * a signed or an unsigned result. - */ - if (row_bytes < 0) - { - char *ptr = png_voidcast(char*, first_row); - ptr += (image->height-1) * (-row_bytes); - first_row = png_voidcast(png_voidp, ptr); - } - - display->first_row = first_row; - display->row_bytes = row_bytes; - } - - if (do_local_compose != 0) - { - int result; - png_voidp row = png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr)); - - display->local_row = row; - result = png_safe_execute(image, png_image_read_composite, display); - display->local_row = NULL; - png_free(png_ptr, row); - - return result; - } - - else if (do_local_background == 2) - { - int result; - png_voidp row = png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr)); - - display->local_row = row; - result = png_safe_execute(image, png_image_read_background, display); - display->local_row = NULL; - png_free(png_ptr, row); - - return result; - } - - else - { - png_alloc_size_t row_bytes = (png_alloc_size_t)display->row_bytes; - - while (--passes >= 0) - { - png_uint_32 y = image->height; - png_bytep row = png_voidcast(png_bytep, display->first_row); - - for (; y > 0; --y) - { - png_read_row(png_ptr, row, NULL); - row += row_bytes; - } - } - - return 1; - } -} - -int PNGAPI -png_image_finish_read(png_imagep image, png_const_colorp background, - void *buffer, png_int_32 row_stride, void *colormap) -{ - if (image != NULL && image->version == PNG_IMAGE_VERSION) - { - /* Check for row_stride overflow. This check is not performed on the - * original PNG format because it may not occur in the output PNG format - * and libpng deals with the issues of reading the original. - */ - const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format); - - /* The following checks just the 'row_stride' calculation to ensure it - * fits in a signed 32-bit value. Because channels/components can be - * either 1 or 2 bytes in size the length of a row can still overflow 32 - * bits; this is just to verify that the 'row_stride' argument can be - * represented. - */ - if (image->width <= 0x7fffffffU/channels) /* no overflow */ - { - png_uint_32 check; - const png_uint_32 png_row_stride = image->width * channels; - - if (row_stride == 0) - row_stride = (png_int_32)/*SAFE*/png_row_stride; - - if (row_stride < 0) - check = (png_uint_32)(-row_stride); - - else - check = (png_uint_32)row_stride; - - /* This verifies 'check', the absolute value of the actual stride - * passed in and detects overflow in the application calculation (i.e. - * if the app did actually pass in a non-zero 'row_stride'. - */ - if (image->opaque != NULL && buffer != NULL && check >= png_row_stride) - { - /* Now check for overflow of the image buffer calculation; this - * limits the whole image size to 32 bits for API compatibility with - * the current, 32-bit, PNG_IMAGE_BUFFER_SIZE macro. - * - * The PNG_IMAGE_BUFFER_SIZE macro is: - * - * (PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)*height*(row_stride)) - * - * And the component size is always 1 or 2, so make sure that the - * number of *bytes* that the application is saying are available - * does actually fit into a 32-bit number. - * - * NOTE: this will be changed in 1.7 because PNG_IMAGE_BUFFER_SIZE - * will be changed to use png_alloc_size_t; bigger images can be - * accomodated on 64-bit systems. - */ - if (image->height <= - 0xffffffffU/PNG_IMAGE_PIXEL_COMPONENT_SIZE(image->format)/check) - { - if ((image->format & PNG_FORMAT_FLAG_COLORMAP) == 0 || - (image->colormap_entries > 0 && colormap != NULL)) - { - int result; - png_image_read_control display; - - memset(&display, 0, (sizeof display)); - display.image = image; - display.buffer = buffer; - display.row_stride = row_stride; - display.colormap = colormap; - display.background = background; - display.local_row = NULL; - - /* Choose the correct 'end' routine; for the color-map case - * all the setup has already been done. - */ - if ((image->format & PNG_FORMAT_FLAG_COLORMAP) != 0) - result = - png_safe_execute(image, - png_image_read_colormap, &display) && - png_safe_execute(image, - png_image_read_colormapped, &display); - - else - result = - png_safe_execute(image, - png_image_read_direct, &display); - - png_image_free(image); - return result; - } - - else - return png_image_error(image, - "png_image_finish_read[color-map]: no color-map"); - } - - else - return png_image_error(image, - "png_image_finish_read: image too large"); - } - - else - return png_image_error(image, - "png_image_finish_read: invalid argument"); - } - - else - return png_image_error(image, - "png_image_finish_read: row_stride too large"); - } - - else if (image != NULL) - return png_image_error(image, - "png_image_finish_read: damaged PNG_IMAGE_VERSION"); - - return 0; -} - -#endif /* SIMPLIFIED_READ */ -#endif /* READ */ diff --git a/jan/src/dep/libs/libpng/pngrio.c b/jan/src/dep/libs/libpng/pngrio.c deleted file mode 100644 index 381f50699..000000000 --- a/jan/src/dep/libs/libpng/pngrio.c +++ /dev/null @@ -1,120 +0,0 @@ - -/* pngrio.c - functions for data input - * - * Last changed in libpng 1.6.24 [August 4, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - * This file provides a location for all input. Users who need - * special handling are expected to write a function that has the same - * arguments as this and performs a similar function, but that possibly - * has a different input method. Note that you shouldn't change this - * function, but rather write a replacement function and then make - * libpng use it at run time with png_set_read_fn(...). - */ - -#include "pngpriv.h" - -#ifdef PNG_READ_SUPPORTED - -/* Read the data from whatever input you are using. The default routine - * reads from a file pointer. Note that this routine sometimes gets called - * with very small lengths, so you should implement some kind of simple - * buffering if you are using unbuffered reads. This should never be asked - * to read more than 64K on a 16-bit machine. - */ -void /* PRIVATE */ -png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length) -{ - png_debug1(4, "reading %d bytes", (int)length); - - if (png_ptr->read_data_fn != NULL) - (*(png_ptr->read_data_fn))(png_ptr, data, length); - - else - png_error(png_ptr, "Call to NULL read function"); -} - -#ifdef PNG_STDIO_SUPPORTED -/* This is the function that does the actual reading of data. If you are - * not reading from a standard C stream, you should create a replacement - * read_data function and use it at run time with png_set_read_fn(), rather - * than changing the library. - */ -void PNGCBAPI -png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_size_t check; - - if (png_ptr == NULL) - return; - - /* fread() returns 0 on error, so it is OK to store this in a png_size_t - * instead of an int, which is what fread() actually returns. - */ - check = fread(data, 1, length, png_voidcast(png_FILE_p, png_ptr->io_ptr)); - - if (check != length) - png_error(png_ptr, "Read Error"); -} -#endif - -/* This function allows the application to supply a new input function - * for libpng if standard C streams aren't being used. - * - * This function takes as its arguments: - * - * png_ptr - pointer to a png input data structure - * - * io_ptr - pointer to user supplied structure containing info about - * the input functions. May be NULL. - * - * read_data_fn - pointer to a new input function that takes as its - * arguments a pointer to a png_struct, a pointer to - * a location where input data can be stored, and a 32-bit - * unsigned int that is the number of bytes to be read. - * To exit and output any fatal error messages the new write - * function should call png_error(png_ptr, "Error msg"). - * May be NULL, in which case libpng's default function will - * be used. - */ -void PNGAPI -png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr, - png_rw_ptr read_data_fn) -{ - if (png_ptr == NULL) - return; - - png_ptr->io_ptr = io_ptr; - -#ifdef PNG_STDIO_SUPPORTED - if (read_data_fn != NULL) - png_ptr->read_data_fn = read_data_fn; - - else - png_ptr->read_data_fn = png_default_read_data; -#else - png_ptr->read_data_fn = read_data_fn; -#endif - -#ifdef PNG_WRITE_SUPPORTED - /* It is an error to write to a read device */ - if (png_ptr->write_data_fn != NULL) - { - png_ptr->write_data_fn = NULL; - png_warning(png_ptr, - "Can't set both read_data_fn and write_data_fn in the" - " same structure"); - } -#endif - -#ifdef PNG_WRITE_FLUSH_SUPPORTED - png_ptr->output_flush_fn = NULL; -#endif -} -#endif /* READ */ diff --git a/jan/src/dep/libs/libpng/pngrtran.c b/jan/src/dep/libs/libpng/pngrtran.c deleted file mode 100644 index fa455bc93..000000000 --- a/jan/src/dep/libs/libpng/pngrtran.c +++ /dev/null @@ -1,5005 +0,0 @@ - -/* pngrtran.c - transforms the data in a row for PNG readers - * - * Last changed in libpng 1.6.24 [August 4, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - * This file contains functions optionally called by an application - * in order to tell libpng how to handle data when reading a PNG. - * Transformations that are used in both reading and writing are - * in pngtrans.c. - */ - -#include "pngpriv.h" - -#ifdef PNG_READ_SUPPORTED - -/* Set the action on getting a CRC error for an ancillary or critical chunk. */ -void PNGAPI -png_set_crc_action(png_structrp png_ptr, int crit_action, int ancil_action) -{ - png_debug(1, "in png_set_crc_action"); - - if (png_ptr == NULL) - return; - - /* Tell libpng how we react to CRC errors in critical chunks */ - switch (crit_action) - { - case PNG_CRC_NO_CHANGE: /* Leave setting as is */ - break; - - case PNG_CRC_WARN_USE: /* Warn/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE; - break; - - case PNG_CRC_QUIET_USE: /* Quiet/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE | - PNG_FLAG_CRC_CRITICAL_IGNORE; - break; - - case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */ - png_warning(png_ptr, - "Can't discard critical data on CRC error"); - case PNG_CRC_ERROR_QUIT: /* Error/quit */ - - case PNG_CRC_DEFAULT: - default: - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - break; - } - - /* Tell libpng how we react to CRC errors in ancillary chunks */ - switch (ancil_action) - { - case PNG_CRC_NO_CHANGE: /* Leave setting as is */ - break; - - case PNG_CRC_WARN_USE: /* Warn/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE; - break; - - case PNG_CRC_QUIET_USE: /* Quiet/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE | - PNG_FLAG_CRC_ANCILLARY_NOWARN; - break; - - case PNG_CRC_ERROR_QUIT: /* Error/quit */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_NOWARN; - break; - - case PNG_CRC_WARN_DISCARD: /* Warn/discard data */ - - case PNG_CRC_DEFAULT: - default: - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - break; - } -} - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -/* Is it OK to set a transformation now? Only if png_start_read_image or - * png_read_update_info have not been called. It is not necessary for the IHDR - * to have been read in all cases; the need_IHDR parameter allows for this - * check too. - */ -static int -png_rtran_ok(png_structrp png_ptr, int need_IHDR) -{ - if (png_ptr != NULL) - { - if ((png_ptr->flags & PNG_FLAG_ROW_INIT) != 0) - png_app_error(png_ptr, - "invalid after png_start_read_image or png_read_update_info"); - - else if (need_IHDR && (png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_app_error(png_ptr, "invalid before the PNG header has been read"); - - else - { - /* Turn on failure to initialize correctly for all transforms. */ - png_ptr->flags |= PNG_FLAG_DETECT_UNINITIALIZED; - - return 1; /* Ok */ - } - } - - return 0; /* no png_error possible! */ -} -#endif - -#ifdef PNG_READ_BACKGROUND_SUPPORTED -/* Handle alpha and tRNS via a background color */ -void PNGFAPI -png_set_background_fixed(png_structrp png_ptr, - png_const_color_16p background_color, int background_gamma_code, - int need_expand, png_fixed_point background_gamma) -{ - png_debug(1, "in png_set_background_fixed"); - - if (png_rtran_ok(png_ptr, 0) == 0 || background_color == NULL) - return; - - if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN) - { - png_warning(png_ptr, "Application must supply a known background gamma"); - return; - } - - png_ptr->transformations |= PNG_COMPOSE | PNG_STRIP_ALPHA; - png_ptr->transformations &= ~PNG_ENCODE_ALPHA; - png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA; - - png_ptr->background = *background_color; - png_ptr->background_gamma = background_gamma; - png_ptr->background_gamma_type = (png_byte)(background_gamma_code); - if (need_expand != 0) - png_ptr->transformations |= PNG_BACKGROUND_EXPAND; - else - png_ptr->transformations &= ~PNG_BACKGROUND_EXPAND; -} - -# ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_background(png_structrp png_ptr, - png_const_color_16p background_color, int background_gamma_code, - int need_expand, double background_gamma) -{ - png_set_background_fixed(png_ptr, background_color, background_gamma_code, - need_expand, png_fixed(png_ptr, background_gamma, "png_set_background")); -} -# endif /* FLOATING_POINT */ -#endif /* READ_BACKGROUND */ - -/* Scale 16-bit depth files to 8-bit depth. If both of these are set then the - * one that pngrtran does first (scale) happens. This is necessary to allow the - * TRANSFORM and API behavior to be somewhat consistent, and it's simpler. - */ -#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED -void PNGAPI -png_set_scale_16(png_structrp png_ptr) -{ - png_debug(1, "in png_set_scale_16"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - png_ptr->transformations |= PNG_SCALE_16_TO_8; -} -#endif - -#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED -/* Chop 16-bit depth files to 8-bit depth */ -void PNGAPI -png_set_strip_16(png_structrp png_ptr) -{ - png_debug(1, "in png_set_strip_16"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - png_ptr->transformations |= PNG_16_TO_8; -} -#endif - -#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED -void PNGAPI -png_set_strip_alpha(png_structrp png_ptr) -{ - png_debug(1, "in png_set_strip_alpha"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - png_ptr->transformations |= PNG_STRIP_ALPHA; -} -#endif - -#if defined(PNG_READ_ALPHA_MODE_SUPPORTED) || defined(PNG_READ_GAMMA_SUPPORTED) -static png_fixed_point -translate_gamma_flags(png_structrp png_ptr, png_fixed_point output_gamma, - int is_screen) -{ - /* Check for flag values. The main reason for having the old Mac value as a - * flag is that it is pretty near impossible to work out what the correct - * value is from Apple documentation - a working Mac system is needed to - * discover the value! - */ - if (output_gamma == PNG_DEFAULT_sRGB || - output_gamma == PNG_FP_1 / PNG_DEFAULT_sRGB) - { - /* If there is no sRGB support this just sets the gamma to the standard - * sRGB value. (This is a side effect of using this function!) - */ -# ifdef PNG_READ_sRGB_SUPPORTED - png_ptr->flags |= PNG_FLAG_ASSUME_sRGB; -# else - PNG_UNUSED(png_ptr) -# endif - if (is_screen != 0) - output_gamma = PNG_GAMMA_sRGB; - else - output_gamma = PNG_GAMMA_sRGB_INVERSE; - } - - else if (output_gamma == PNG_GAMMA_MAC_18 || - output_gamma == PNG_FP_1 / PNG_GAMMA_MAC_18) - { - if (is_screen != 0) - output_gamma = PNG_GAMMA_MAC_OLD; - else - output_gamma = PNG_GAMMA_MAC_INVERSE; - } - - return output_gamma; -} - -# ifdef PNG_FLOATING_POINT_SUPPORTED -static png_fixed_point -convert_gamma_value(png_structrp png_ptr, double output_gamma) -{ - /* The following silently ignores cases where fixed point (times 100,000) - * gamma values are passed to the floating point API. This is safe and it - * means the fixed point constants work just fine with the floating point - * API. The alternative would just lead to undetected errors and spurious - * bug reports. Negative values fail inside the _fixed API unless they - * correspond to the flag values. - */ - if (output_gamma > 0 && output_gamma < 128) - output_gamma *= PNG_FP_1; - - /* This preserves -1 and -2 exactly: */ - output_gamma = floor(output_gamma + .5); - - if (output_gamma > PNG_FP_MAX || output_gamma < PNG_FP_MIN) - png_fixed_error(png_ptr, "gamma value"); - - return (png_fixed_point)output_gamma; -} -# endif -#endif /* READ_ALPHA_MODE || READ_GAMMA */ - -#ifdef PNG_READ_ALPHA_MODE_SUPPORTED -void PNGFAPI -png_set_alpha_mode_fixed(png_structrp png_ptr, int mode, - png_fixed_point output_gamma) -{ - int compose = 0; - png_fixed_point file_gamma; - - png_debug(1, "in png_set_alpha_mode"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - output_gamma = translate_gamma_flags(png_ptr, output_gamma, 1/*screen*/); - - /* Validate the value to ensure it is in a reasonable range. The value - * is expected to be 1 or greater, but this range test allows for some - * viewing correction values. The intent is to weed out users of this API - * who use the inverse of the gamma value accidentally! Since some of these - * values are reasonable this may have to be changed: - * - * 1.6.x: changed from 0.07..3 to 0.01..100 (to accomodate the optimal 16-bit - * gamma of 36, and its reciprocal.) - */ - if (output_gamma < 1000 || output_gamma > 10000000) - png_error(png_ptr, "output gamma out of expected range"); - - /* The default file gamma is the inverse of the output gamma; the output - * gamma may be changed below so get the file value first: - */ - file_gamma = png_reciprocal(output_gamma); - - /* There are really 8 possibilities here, composed of any combination - * of: - * - * premultiply the color channels - * do not encode non-opaque pixels - * encode the alpha as well as the color channels - * - * The differences disappear if the input/output ('screen') gamma is 1.0, - * because then the encoding is a no-op and there is only the choice of - * premultiplying the color channels or not. - * - * png_set_alpha_mode and png_set_background interact because both use - * png_compose to do the work. Calling both is only useful when - * png_set_alpha_mode is used to set the default mode - PNG_ALPHA_PNG - along - * with a default gamma value. Otherwise PNG_COMPOSE must not be set. - */ - switch (mode) - { - case PNG_ALPHA_PNG: /* default: png standard */ - /* No compose, but it may be set by png_set_background! */ - png_ptr->transformations &= ~PNG_ENCODE_ALPHA; - png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA; - break; - - case PNG_ALPHA_ASSOCIATED: /* color channels premultiplied */ - compose = 1; - png_ptr->transformations &= ~PNG_ENCODE_ALPHA; - png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA; - /* The output is linear: */ - output_gamma = PNG_FP_1; - break; - - case PNG_ALPHA_OPTIMIZED: /* associated, non-opaque pixels linear */ - compose = 1; - png_ptr->transformations &= ~PNG_ENCODE_ALPHA; - png_ptr->flags |= PNG_FLAG_OPTIMIZE_ALPHA; - /* output_gamma records the encoding of opaque pixels! */ - break; - - case PNG_ALPHA_BROKEN: /* associated, non-linear, alpha encoded */ - compose = 1; - png_ptr->transformations |= PNG_ENCODE_ALPHA; - png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA; - break; - - default: - png_error(png_ptr, "invalid alpha mode"); - } - - /* Only set the default gamma if the file gamma has not been set (this has - * the side effect that the gamma in a second call to png_set_alpha_mode will - * be ignored.) - */ - if (png_ptr->colorspace.gamma == 0) - { - png_ptr->colorspace.gamma = file_gamma; - png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA; - } - - /* But always set the output gamma: */ - png_ptr->screen_gamma = output_gamma; - - /* Finally, if pre-multiplying, set the background fields to achieve the - * desired result. - */ - if (compose != 0) - { - /* And obtain alpha pre-multiplication by composing on black: */ - memset(&png_ptr->background, 0, (sizeof png_ptr->background)); - png_ptr->background_gamma = png_ptr->colorspace.gamma; /* just in case */ - png_ptr->background_gamma_type = PNG_BACKGROUND_GAMMA_FILE; - png_ptr->transformations &= ~PNG_BACKGROUND_EXPAND; - - if ((png_ptr->transformations & PNG_COMPOSE) != 0) - png_error(png_ptr, - "conflicting calls to set alpha mode and background"); - - png_ptr->transformations |= PNG_COMPOSE; - } -} - -# ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_alpha_mode(png_structrp png_ptr, int mode, double output_gamma) -{ - png_set_alpha_mode_fixed(png_ptr, mode, convert_gamma_value(png_ptr, - output_gamma)); -} -# endif -#endif - -#ifdef PNG_READ_QUANTIZE_SUPPORTED -/* Dither file to 8-bit. Supply a palette, the current number - * of elements in the palette, the maximum number of elements - * allowed, and a histogram if possible. If the current number - * of colors is greater than the maximum number, the palette will be - * modified to fit in the maximum number. "full_quantize" indicates - * whether we need a quantizing cube set up for RGB images, or if we - * simply are reducing the number of colors in a paletted image. - */ - -typedef struct png_dsort_struct -{ - struct png_dsort_struct * next; - png_byte left; - png_byte right; -} png_dsort; -typedef png_dsort * png_dsortp; -typedef png_dsort * * png_dsortpp; - -void PNGAPI -png_set_quantize(png_structrp png_ptr, png_colorp palette, - int num_palette, int maximum_colors, png_const_uint_16p histogram, - int full_quantize) -{ - png_debug(1, "in png_set_quantize"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - png_ptr->transformations |= PNG_QUANTIZE; - - if (full_quantize == 0) - { - int i; - - png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr, - (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte)))); - for (i = 0; i < num_palette; i++) - png_ptr->quantize_index[i] = (png_byte)i; - } - - if (num_palette > maximum_colors) - { - if (histogram != NULL) - { - /* This is easy enough, just throw out the least used colors. - * Perhaps not the best solution, but good enough. - */ - - int i; - - /* Initialize an array to sort colors */ - png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr, - (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte)))); - - /* Initialize the quantize_sort array */ - for (i = 0; i < num_palette; i++) - png_ptr->quantize_sort[i] = (png_byte)i; - - /* Find the least used palette entries by starting a - * bubble sort, and running it until we have sorted - * out enough colors. Note that we don't care about - * sorting all the colors, just finding which are - * least used. - */ - - for (i = num_palette - 1; i >= maximum_colors; i--) - { - int done; /* To stop early if the list is pre-sorted */ - int j; - - done = 1; - for (j = 0; j < i; j++) - { - if (histogram[png_ptr->quantize_sort[j]] - < histogram[png_ptr->quantize_sort[j + 1]]) - { - png_byte t; - - t = png_ptr->quantize_sort[j]; - png_ptr->quantize_sort[j] = png_ptr->quantize_sort[j + 1]; - png_ptr->quantize_sort[j + 1] = t; - done = 0; - } - } - - if (done != 0) - break; - } - - /* Swap the palette around, and set up a table, if necessary */ - if (full_quantize != 0) - { - int j = num_palette; - - /* Put all the useful colors within the max, but don't - * move the others. - */ - for (i = 0; i < maximum_colors; i++) - { - if ((int)png_ptr->quantize_sort[i] >= maximum_colors) - { - do - j--; - while ((int)png_ptr->quantize_sort[j] >= maximum_colors); - - palette[i] = palette[j]; - } - } - } - else - { - int j = num_palette; - - /* Move all the used colors inside the max limit, and - * develop a translation table. - */ - for (i = 0; i < maximum_colors; i++) - { - /* Only move the colors we need to */ - if ((int)png_ptr->quantize_sort[i] >= maximum_colors) - { - png_color tmp_color; - - do - j--; - while ((int)png_ptr->quantize_sort[j] >= maximum_colors); - - tmp_color = palette[j]; - palette[j] = palette[i]; - palette[i] = tmp_color; - /* Indicate where the color went */ - png_ptr->quantize_index[j] = (png_byte)i; - png_ptr->quantize_index[i] = (png_byte)j; - } - } - - /* Find closest color for those colors we are not using */ - for (i = 0; i < num_palette; i++) - { - if ((int)png_ptr->quantize_index[i] >= maximum_colors) - { - int min_d, k, min_k, d_index; - - /* Find the closest color to one we threw out */ - d_index = png_ptr->quantize_index[i]; - min_d = PNG_COLOR_DIST(palette[d_index], palette[0]); - for (k = 1, min_k = 0; k < maximum_colors; k++) - { - int d; - - d = PNG_COLOR_DIST(palette[d_index], palette[k]); - - if (d < min_d) - { - min_d = d; - min_k = k; - } - } - /* Point to closest color */ - png_ptr->quantize_index[i] = (png_byte)min_k; - } - } - } - png_free(png_ptr, png_ptr->quantize_sort); - png_ptr->quantize_sort = NULL; - } - else - { - /* This is much harder to do simply (and quickly). Perhaps - * we need to go through a median cut routine, but those - * don't always behave themselves with only a few colors - * as input. So we will just find the closest two colors, - * and throw out one of them (chosen somewhat randomly). - * [We don't understand this at all, so if someone wants to - * work on improving it, be our guest - AED, GRP] - */ - int i; - int max_d; - int num_new_palette; - png_dsortp t; - png_dsortpp hash; - - t = NULL; - - /* Initialize palette index arrays */ - png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr, - (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte)))); - png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr, - (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte)))); - - /* Initialize the sort array */ - for (i = 0; i < num_palette; i++) - { - png_ptr->index_to_palette[i] = (png_byte)i; - png_ptr->palette_to_index[i] = (png_byte)i; - } - - hash = (png_dsortpp)png_calloc(png_ptr, (png_uint_32)(769 * - (sizeof (png_dsortp)))); - - num_new_palette = num_palette; - - /* Initial wild guess at how far apart the farthest pixel - * pair we will be eliminating will be. Larger - * numbers mean more areas will be allocated, Smaller - * numbers run the risk of not saving enough data, and - * having to do this all over again. - * - * I have not done extensive checking on this number. - */ - max_d = 96; - - while (num_new_palette > maximum_colors) - { - for (i = 0; i < num_new_palette - 1; i++) - { - int j; - - for (j = i + 1; j < num_new_palette; j++) - { - int d; - - d = PNG_COLOR_DIST(palette[i], palette[j]); - - if (d <= max_d) - { - - t = (png_dsortp)png_malloc_warn(png_ptr, - (png_uint_32)(sizeof (png_dsort))); - - if (t == NULL) - break; - - t->next = hash[d]; - t->left = (png_byte)i; - t->right = (png_byte)j; - hash[d] = t; - } - } - if (t == NULL) - break; - } - - if (t != NULL) - for (i = 0; i <= max_d; i++) - { - if (hash[i] != NULL) - { - png_dsortp p; - - for (p = hash[i]; p; p = p->next) - { - if ((int)png_ptr->index_to_palette[p->left] - < num_new_palette && - (int)png_ptr->index_to_palette[p->right] - < num_new_palette) - { - int j, next_j; - - if (num_new_palette & 0x01) - { - j = p->left; - next_j = p->right; - } - else - { - j = p->right; - next_j = p->left; - } - - num_new_palette--; - palette[png_ptr->index_to_palette[j]] - = palette[num_new_palette]; - if (full_quantize == 0) - { - int k; - - for (k = 0; k < num_palette; k++) - { - if (png_ptr->quantize_index[k] == - png_ptr->index_to_palette[j]) - png_ptr->quantize_index[k] = - png_ptr->index_to_palette[next_j]; - - if ((int)png_ptr->quantize_index[k] == - num_new_palette) - png_ptr->quantize_index[k] = - png_ptr->index_to_palette[j]; - } - } - - png_ptr->index_to_palette[png_ptr->palette_to_index - [num_new_palette]] = png_ptr->index_to_palette[j]; - - png_ptr->palette_to_index[png_ptr->index_to_palette[j]] - = png_ptr->palette_to_index[num_new_palette]; - - png_ptr->index_to_palette[j] = - (png_byte)num_new_palette; - - png_ptr->palette_to_index[num_new_palette] = - (png_byte)j; - } - if (num_new_palette <= maximum_colors) - break; - } - if (num_new_palette <= maximum_colors) - break; - } - } - - for (i = 0; i < 769; i++) - { - if (hash[i] != NULL) - { - png_dsortp p = hash[i]; - while (p) - { - t = p->next; - png_free(png_ptr, p); - p = t; - } - } - hash[i] = 0; - } - max_d += 96; - } - png_free(png_ptr, hash); - png_free(png_ptr, png_ptr->palette_to_index); - png_free(png_ptr, png_ptr->index_to_palette); - png_ptr->palette_to_index = NULL; - png_ptr->index_to_palette = NULL; - } - num_palette = maximum_colors; - } - if (png_ptr->palette == NULL) - { - png_ptr->palette = palette; - } - png_ptr->num_palette = (png_uint_16)num_palette; - - if (full_quantize != 0) - { - int i; - png_bytep distance; - int total_bits = PNG_QUANTIZE_RED_BITS + PNG_QUANTIZE_GREEN_BITS + - PNG_QUANTIZE_BLUE_BITS; - int num_red = (1 << PNG_QUANTIZE_RED_BITS); - int num_green = (1 << PNG_QUANTIZE_GREEN_BITS); - int num_blue = (1 << PNG_QUANTIZE_BLUE_BITS); - png_size_t num_entries = ((png_size_t)1 << total_bits); - - png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr, - (png_uint_32)(num_entries * (sizeof (png_byte)))); - - distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries * - (sizeof (png_byte)))); - - memset(distance, 0xff, num_entries * (sizeof (png_byte))); - - for (i = 0; i < num_palette; i++) - { - int ir, ig, ib; - int r = (palette[i].red >> (8 - PNG_QUANTIZE_RED_BITS)); - int g = (palette[i].green >> (8 - PNG_QUANTIZE_GREEN_BITS)); - int b = (palette[i].blue >> (8 - PNG_QUANTIZE_BLUE_BITS)); - - for (ir = 0; ir < num_red; ir++) - { - /* int dr = abs(ir - r); */ - int dr = ((ir > r) ? ir - r : r - ir); - int index_r = (ir << (PNG_QUANTIZE_BLUE_BITS + - PNG_QUANTIZE_GREEN_BITS)); - - for (ig = 0; ig < num_green; ig++) - { - /* int dg = abs(ig - g); */ - int dg = ((ig > g) ? ig - g : g - ig); - int dt = dr + dg; - int dm = ((dr > dg) ? dr : dg); - int index_g = index_r | (ig << PNG_QUANTIZE_BLUE_BITS); - - for (ib = 0; ib < num_blue; ib++) - { - int d_index = index_g | ib; - /* int db = abs(ib - b); */ - int db = ((ib > b) ? ib - b : b - ib); - int dmax = ((dm > db) ? dm : db); - int d = dmax + dt + db; - - if (d < (int)distance[d_index]) - { - distance[d_index] = (png_byte)d; - png_ptr->palette_lookup[d_index] = (png_byte)i; - } - } - } - } - } - - png_free(png_ptr, distance); - } -} -#endif /* READ_QUANTIZE */ - -#ifdef PNG_READ_GAMMA_SUPPORTED -void PNGFAPI -png_set_gamma_fixed(png_structrp png_ptr, png_fixed_point scrn_gamma, - png_fixed_point file_gamma) -{ - png_debug(1, "in png_set_gamma_fixed"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - /* New in libpng-1.5.4 - reserve particular negative values as flags. */ - scrn_gamma = translate_gamma_flags(png_ptr, scrn_gamma, 1/*screen*/); - file_gamma = translate_gamma_flags(png_ptr, file_gamma, 0/*file*/); - - /* Checking the gamma values for being >0 was added in 1.5.4 along with the - * premultiplied alpha support; this actually hides an undocumented feature - * of the previous implementation which allowed gamma processing to be - * disabled in background handling. There is no evidence (so far) that this - * was being used; however, png_set_background itself accepted and must still - * accept '0' for the gamma value it takes, because it isn't always used. - * - * Since this is an API change (albeit a very minor one that removes an - * undocumented API feature) the following checks were only enabled in - * libpng-1.6.0. - */ - if (file_gamma <= 0) - png_error(png_ptr, "invalid file gamma in png_set_gamma"); - - if (scrn_gamma <= 0) - png_error(png_ptr, "invalid screen gamma in png_set_gamma"); - - /* Set the gamma values unconditionally - this overrides the value in the PNG - * file if a gAMA chunk was present. png_set_alpha_mode provides a - * different, easier, way to default the file gamma. - */ - png_ptr->colorspace.gamma = file_gamma; - png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA; - png_ptr->screen_gamma = scrn_gamma; -} - -# ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_gamma(png_structrp png_ptr, double scrn_gamma, double file_gamma) -{ - png_set_gamma_fixed(png_ptr, convert_gamma_value(png_ptr, scrn_gamma), - convert_gamma_value(png_ptr, file_gamma)); -} -# endif /* FLOATING_POINT */ -#endif /* READ_GAMMA */ - -#ifdef PNG_READ_EXPAND_SUPPORTED -/* Expand paletted images to RGB, expand grayscale images of - * less than 8-bit depth to 8-bit depth, and expand tRNS chunks - * to alpha channels. - */ -void PNGAPI -png_set_expand(png_structrp png_ptr) -{ - png_debug(1, "in png_set_expand"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); -} - -/* GRR 19990627: the following three functions currently are identical - * to png_set_expand(). However, it is entirely reasonable that someone - * might wish to expand an indexed image to RGB but *not* expand a single, - * fully transparent palette entry to a full alpha channel--perhaps instead - * convert tRNS to the grayscale/RGB format (16-bit RGB value), or replace - * the transparent color with a particular RGB value, or drop tRNS entirely. - * IOW, a future version of the library may make the transformations flag - * a bit more fine-grained, with separate bits for each of these three - * functions. - * - * More to the point, these functions make it obvious what libpng will be - * doing, whereas "expand" can (and does) mean any number of things. - * - * GRP 20060307: In libpng-1.2.9, png_set_gray_1_2_4_to_8() was modified - * to expand only the sample depth but not to expand the tRNS to alpha - * and its name was changed to png_set_expand_gray_1_2_4_to_8(). - */ - -/* Expand paletted images to RGB. */ -void PNGAPI -png_set_palette_to_rgb(png_structrp png_ptr) -{ - png_debug(1, "in png_set_palette_to_rgb"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); -} - -/* Expand grayscale images of less than 8-bit depth to 8 bits. */ -void PNGAPI -png_set_expand_gray_1_2_4_to_8(png_structrp png_ptr) -{ - png_debug(1, "in png_set_expand_gray_1_2_4_to_8"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - png_ptr->transformations |= PNG_EXPAND; -} - -/* Expand tRNS chunks to alpha channels. */ -void PNGAPI -png_set_tRNS_to_alpha(png_structrp png_ptr) -{ - png_debug(1, "in png_set_tRNS_to_alpha"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); -} -#endif /* READ_EXPAND */ - -#ifdef PNG_READ_EXPAND_16_SUPPORTED -/* Expand to 16-bit channels, expand the tRNS chunk too (because otherwise - * it may not work correctly.) - */ -void PNGAPI -png_set_expand_16(png_structrp png_ptr) -{ - png_debug(1, "in png_set_expand_16"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - png_ptr->transformations |= (PNG_EXPAND_16 | PNG_EXPAND | PNG_EXPAND_tRNS); -} -#endif - -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED -void PNGAPI -png_set_gray_to_rgb(png_structrp png_ptr) -{ - png_debug(1, "in png_set_gray_to_rgb"); - - if (png_rtran_ok(png_ptr, 0) == 0) - return; - - /* Because rgb must be 8 bits or more: */ - png_set_expand_gray_1_2_4_to_8(png_ptr); - png_ptr->transformations |= PNG_GRAY_TO_RGB; -} -#endif - -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED -void PNGFAPI -png_set_rgb_to_gray_fixed(png_structrp png_ptr, int error_action, - png_fixed_point red, png_fixed_point green) -{ - png_debug(1, "in png_set_rgb_to_gray"); - - /* Need the IHDR here because of the check on color_type below. */ - /* TODO: fix this */ - if (png_rtran_ok(png_ptr, 1) == 0) - return; - - switch (error_action) - { - case PNG_ERROR_ACTION_NONE: - png_ptr->transformations |= PNG_RGB_TO_GRAY; - break; - - case PNG_ERROR_ACTION_WARN: - png_ptr->transformations |= PNG_RGB_TO_GRAY_WARN; - break; - - case PNG_ERROR_ACTION_ERROR: - png_ptr->transformations |= PNG_RGB_TO_GRAY_ERR; - break; - - default: - png_error(png_ptr, "invalid error action to rgb_to_gray"); - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) -#ifdef PNG_READ_EXPAND_SUPPORTED - png_ptr->transformations |= PNG_EXPAND; -#else - { - /* Make this an error in 1.6 because otherwise the application may assume - * that it just worked and get a memory overwrite. - */ - png_error(png_ptr, - "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED"); - - /* png_ptr->transformations &= ~PNG_RGB_TO_GRAY; */ - } -#endif - { - if (red >= 0 && green >= 0 && red + green <= PNG_FP_1) - { - png_uint_16 red_int, green_int; - - /* NOTE: this calculation does not round, but this behavior is retained - * for consistency; the inaccuracy is very small. The code here always - * overwrites the coefficients, regardless of whether they have been - * defaulted or set already. - */ - red_int = (png_uint_16)(((png_uint_32)red*32768)/100000); - green_int = (png_uint_16)(((png_uint_32)green*32768)/100000); - - png_ptr->rgb_to_gray_red_coeff = red_int; - png_ptr->rgb_to_gray_green_coeff = green_int; - png_ptr->rgb_to_gray_coefficients_set = 1; - } - - else - { - if (red >= 0 && green >= 0) - png_app_warning(png_ptr, - "ignoring out of range rgb_to_gray coefficients"); - - /* Use the defaults, from the cHRM chunk if set, else the historical - * values which are close to the sRGB/HDTV/ITU-Rec 709 values. See - * png_do_rgb_to_gray for more discussion of the values. In this case - * the coefficients are not marked as 'set' and are not overwritten if - * something has already provided a default. - */ - if (png_ptr->rgb_to_gray_red_coeff == 0 && - png_ptr->rgb_to_gray_green_coeff == 0) - { - png_ptr->rgb_to_gray_red_coeff = 6968; - png_ptr->rgb_to_gray_green_coeff = 23434; - /* png_ptr->rgb_to_gray_blue_coeff = 2366; */ - } - } - } -} - -#ifdef PNG_FLOATING_POINT_SUPPORTED -/* Convert a RGB image to a grayscale of the same width. This allows us, - * for example, to convert a 24 bpp RGB image into an 8 bpp grayscale image. - */ - -void PNGAPI -png_set_rgb_to_gray(png_structrp png_ptr, int error_action, double red, - double green) -{ - png_set_rgb_to_gray_fixed(png_ptr, error_action, - png_fixed(png_ptr, red, "rgb to gray red coefficient"), - png_fixed(png_ptr, green, "rgb to gray green coefficient")); -} -#endif /* FLOATING POINT */ - -#endif /* RGB_TO_GRAY */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -void PNGAPI -png_set_read_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr - read_user_transform_fn) -{ - png_debug(1, "in png_set_read_user_transform_fn"); - -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - png_ptr->transformations |= PNG_USER_TRANSFORM; - png_ptr->read_user_transform_fn = read_user_transform_fn; -#endif -} -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -#ifdef PNG_READ_GAMMA_SUPPORTED -/* In the case of gamma transformations only do transformations on images where - * the [file] gamma and screen_gamma are not close reciprocals, otherwise it - * slows things down slightly, and also needlessly introduces small errors. - */ -static int /* PRIVATE */ -png_gamma_threshold(png_fixed_point screen_gamma, png_fixed_point file_gamma) -{ - /* PNG_GAMMA_THRESHOLD is the threshold for performing gamma - * correction as a difference of the overall transform from 1.0 - * - * We want to compare the threshold with s*f - 1, if we get - * overflow here it is because of wacky gamma values so we - * turn on processing anyway. - */ - png_fixed_point gtest; - return !png_muldiv(>est, screen_gamma, file_gamma, PNG_FP_1) || - png_gamma_significant(gtest); -} -#endif - -/* Initialize everything needed for the read. This includes modifying - * the palette. - */ - -/* For the moment 'png_init_palette_transformations' and - * 'png_init_rgb_transformations' only do some flag canceling optimizations. - * The intent is that these two routines should have palette or rgb operations - * extracted from 'png_init_read_transformations'. - */ -static void /* PRIVATE */ -png_init_palette_transformations(png_structrp png_ptr) -{ - /* Called to handle the (input) palette case. In png_do_read_transformations - * the first step is to expand the palette if requested, so this code must - * take care to only make changes that are invariant with respect to the - * palette expansion, or only do them if there is no expansion. - * - * STRIP_ALPHA has already been handled in the caller (by setting num_trans - * to 0.) - */ - int input_has_alpha = 0; - int input_has_transparency = 0; - - if (png_ptr->num_trans > 0) - { - int i; - - /* Ignore if all the entries are opaque (unlikely!) */ - for (i=0; inum_trans; ++i) - { - if (png_ptr->trans_alpha[i] == 255) - continue; - else if (png_ptr->trans_alpha[i] == 0) - input_has_transparency = 1; - else - { - input_has_transparency = 1; - input_has_alpha = 1; - break; - } - } - } - - /* If no alpha we can optimize. */ - if (input_has_alpha == 0) - { - /* Any alpha means background and associative alpha processing is - * required, however if the alpha is 0 or 1 throughout OPTIMIZE_ALPHA - * and ENCODE_ALPHA are irrelevant. - */ - png_ptr->transformations &= ~PNG_ENCODE_ALPHA; - png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA; - - if (input_has_transparency == 0) - png_ptr->transformations &= ~(PNG_COMPOSE | PNG_BACKGROUND_EXPAND); - } - -#if defined(PNG_READ_EXPAND_SUPPORTED) && defined(PNG_READ_BACKGROUND_SUPPORTED) - /* png_set_background handling - deals with the complexity of whether the - * background color is in the file format or the screen format in the case - * where an 'expand' will happen. - */ - - /* The following code cannot be entered in the alpha pre-multiplication case - * because PNG_BACKGROUND_EXPAND is cancelled below. - */ - if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) != 0 && - (png_ptr->transformations & PNG_EXPAND) != 0) - { - { - png_ptr->background.red = - png_ptr->palette[png_ptr->background.index].red; - png_ptr->background.green = - png_ptr->palette[png_ptr->background.index].green; - png_ptr->background.blue = - png_ptr->palette[png_ptr->background.index].blue; - -#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED - if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0) - { - if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0) - { - /* Invert the alpha channel (in tRNS) unless the pixels are - * going to be expanded, in which case leave it for later - */ - int i, istop = png_ptr->num_trans; - - for (i=0; itrans_alpha[i] = (png_byte)(255 - - png_ptr->trans_alpha[i]); - } - } -#endif /* READ_INVERT_ALPHA */ - } - } /* background expand and (therefore) no alpha association. */ -#endif /* READ_EXPAND && READ_BACKGROUND */ -} - -static void /* PRIVATE */ -png_init_rgb_transformations(png_structrp png_ptr) -{ - /* Added to libpng-1.5.4: check the color type to determine whether there - * is any alpha or transparency in the image and simply cancel the - * background and alpha mode stuff if there isn't. - */ - int input_has_alpha = (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0; - int input_has_transparency = png_ptr->num_trans > 0; - - /* If no alpha we can optimize. */ - if (input_has_alpha == 0) - { - /* Any alpha means background and associative alpha processing is - * required, however if the alpha is 0 or 1 throughout OPTIMIZE_ALPHA - * and ENCODE_ALPHA are irrelevant. - */ -# ifdef PNG_READ_ALPHA_MODE_SUPPORTED - png_ptr->transformations &= ~PNG_ENCODE_ALPHA; - png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA; -# endif - - if (input_has_transparency == 0) - png_ptr->transformations &= ~(PNG_COMPOSE | PNG_BACKGROUND_EXPAND); - } - -#if defined(PNG_READ_EXPAND_SUPPORTED) && defined(PNG_READ_BACKGROUND_SUPPORTED) - /* png_set_background handling - deals with the complexity of whether the - * background color is in the file format or the screen format in the case - * where an 'expand' will happen. - */ - - /* The following code cannot be entered in the alpha pre-multiplication case - * because PNG_BACKGROUND_EXPAND is cancelled below. - */ - if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) != 0 && - (png_ptr->transformations & PNG_EXPAND) != 0 && - (png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0) - /* i.e., GRAY or GRAY_ALPHA */ - { - { - /* Expand background and tRNS chunks */ - int gray = png_ptr->background.gray; - int trans_gray = png_ptr->trans_color.gray; - - switch (png_ptr->bit_depth) - { - case 1: - gray *= 0xff; - trans_gray *= 0xff; - break; - - case 2: - gray *= 0x55; - trans_gray *= 0x55; - break; - - case 4: - gray *= 0x11; - trans_gray *= 0x11; - break; - - default: - - case 8: - /* FALL THROUGH (Already 8 bits) */ - - case 16: - /* Already a full 16 bits */ - break; - } - - png_ptr->background.red = png_ptr->background.green = - png_ptr->background.blue = (png_uint_16)gray; - - if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0) - { - png_ptr->trans_color.red = png_ptr->trans_color.green = - png_ptr->trans_color.blue = (png_uint_16)trans_gray; - } - } - } /* background expand and (therefore) no alpha association. */ -#endif /* READ_EXPAND && READ_BACKGROUND */ -} - -void /* PRIVATE */ -png_init_read_transformations(png_structrp png_ptr) -{ - png_debug(1, "in png_init_read_transformations"); - - /* This internal function is called from png_read_start_row in pngrutil.c - * and it is called before the 'rowbytes' calculation is done, so the code - * in here can change or update the transformations flags. - * - * First do updates that do not depend on the details of the PNG image data - * being processed. - */ - -#ifdef PNG_READ_GAMMA_SUPPORTED - /* Prior to 1.5.4 these tests were performed from png_set_gamma, 1.5.4 adds - * png_set_alpha_mode and this is another source for a default file gamma so - * the test needs to be performed later - here. In addition prior to 1.5.4 - * the tests were repeated for the PALETTE color type here - this is no - * longer necessary (and doesn't seem to have been necessary before.) - */ - { - /* The following temporary indicates if overall gamma correction is - * required. - */ - int gamma_correction = 0; - - if (png_ptr->colorspace.gamma != 0) /* has been set */ - { - if (png_ptr->screen_gamma != 0) /* screen set too */ - gamma_correction = png_gamma_threshold(png_ptr->colorspace.gamma, - png_ptr->screen_gamma); - - else - /* Assume the output matches the input; a long time default behavior - * of libpng, although the standard has nothing to say about this. - */ - png_ptr->screen_gamma = png_reciprocal(png_ptr->colorspace.gamma); - } - - else if (png_ptr->screen_gamma != 0) - /* The converse - assume the file matches the screen, note that this - * perhaps undesireable default can (from 1.5.4) be changed by calling - * png_set_alpha_mode (even if the alpha handling mode isn't required - * or isn't changed from the default.) - */ - png_ptr->colorspace.gamma = png_reciprocal(png_ptr->screen_gamma); - - else /* neither are set */ - /* Just in case the following prevents any processing - file and screen - * are both assumed to be linear and there is no way to introduce a - * third gamma value other than png_set_background with 'UNIQUE', and, - * prior to 1.5.4 - */ - png_ptr->screen_gamma = png_ptr->colorspace.gamma = PNG_FP_1; - - /* We have a gamma value now. */ - png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA; - - /* Now turn the gamma transformation on or off as appropriate. Notice - * that PNG_GAMMA just refers to the file->screen correction. Alpha - * composition may independently cause gamma correction because it needs - * linear data (e.g. if the file has a gAMA chunk but the screen gamma - * hasn't been specified.) In any case this flag may get turned off in - * the code immediately below if the transform can be handled outside the - * row loop. - */ - if (gamma_correction != 0) - png_ptr->transformations |= PNG_GAMMA; - - else - png_ptr->transformations &= ~PNG_GAMMA; - } -#endif - - /* Certain transformations have the effect of preventing other - * transformations that happen afterward in png_do_read_transformations; - * resolve the interdependencies here. From the code of - * png_do_read_transformations the order is: - * - * 1) PNG_EXPAND (including PNG_EXPAND_tRNS) - * 2) PNG_STRIP_ALPHA (if no compose) - * 3) PNG_RGB_TO_GRAY - * 4) PNG_GRAY_TO_RGB iff !PNG_BACKGROUND_IS_GRAY - * 5) PNG_COMPOSE - * 6) PNG_GAMMA - * 7) PNG_STRIP_ALPHA (if compose) - * 8) PNG_ENCODE_ALPHA - * 9) PNG_SCALE_16_TO_8 - * 10) PNG_16_TO_8 - * 11) PNG_QUANTIZE (converts to palette) - * 12) PNG_EXPAND_16 - * 13) PNG_GRAY_TO_RGB iff PNG_BACKGROUND_IS_GRAY - * 14) PNG_INVERT_MONO - * 15) PNG_INVERT_ALPHA - * 16) PNG_SHIFT - * 17) PNG_PACK - * 18) PNG_BGR - * 19) PNG_PACKSWAP - * 20) PNG_FILLER (includes PNG_ADD_ALPHA) - * 21) PNG_SWAP_ALPHA - * 22) PNG_SWAP_BYTES - * 23) PNG_USER_TRANSFORM [must be last] - */ -#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED - if ((png_ptr->transformations & PNG_STRIP_ALPHA) != 0 && - (png_ptr->transformations & PNG_COMPOSE) == 0) - { - /* Stripping the alpha channel happens immediately after the 'expand' - * transformations, before all other transformation, so it cancels out - * the alpha handling. It has the side effect negating the effect of - * PNG_EXPAND_tRNS too: - */ - png_ptr->transformations &= ~(PNG_BACKGROUND_EXPAND | PNG_ENCODE_ALPHA | - PNG_EXPAND_tRNS); - png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA; - - /* Kill the tRNS chunk itself too. Prior to 1.5.4 this did not happen - * so transparency information would remain just so long as it wasn't - * expanded. This produces unexpected API changes if the set of things - * that do PNG_EXPAND_tRNS changes (perfectly possible given the - * documentation - which says ask for what you want, accept what you - * get.) This makes the behavior consistent from 1.5.4: - */ - png_ptr->num_trans = 0; - } -#endif /* STRIP_ALPHA supported, no COMPOSE */ - -#ifdef PNG_READ_ALPHA_MODE_SUPPORTED - /* If the screen gamma is about 1.0 then the OPTIMIZE_ALPHA and ENCODE_ALPHA - * settings will have no effect. - */ - if (png_gamma_significant(png_ptr->screen_gamma) == 0) - { - png_ptr->transformations &= ~PNG_ENCODE_ALPHA; - png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA; - } -#endif - -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED - /* Make sure the coefficients for the rgb to gray conversion are set - * appropriately. - */ - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) != 0) - png_colorspace_set_rgb_coefficients(png_ptr); -#endif - -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED -#if defined(PNG_READ_EXPAND_SUPPORTED) && defined(PNG_READ_BACKGROUND_SUPPORTED) - /* Detect gray background and attempt to enable optimization for - * gray --> RGB case. - * - * Note: if PNG_BACKGROUND_EXPAND is set and color_type is either RGB or - * RGB_ALPHA (in which case need_expand is superfluous anyway), the - * background color might actually be gray yet not be flagged as such. - * This is not a problem for the current code, which uses - * PNG_BACKGROUND_IS_GRAY only to decide when to do the - * png_do_gray_to_rgb() transformation. - * - * TODO: this code needs to be revised to avoid the complexity and - * interdependencies. The color type of the background should be recorded in - * png_set_background, along with the bit depth, then the code has a record - * of exactly what color space the background is currently in. - */ - if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) != 0) - { - /* PNG_BACKGROUND_EXPAND: the background is in the file color space, so if - * the file was grayscale the background value is gray. - */ - if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0) - png_ptr->mode |= PNG_BACKGROUND_IS_GRAY; - } - - else if ((png_ptr->transformations & PNG_COMPOSE) != 0) - { - /* PNG_COMPOSE: png_set_background was called with need_expand false, - * so the color is in the color space of the output or png_set_alpha_mode - * was called and the color is black. Ignore RGB_TO_GRAY because that - * happens before GRAY_TO_RGB. - */ - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) != 0) - { - if (png_ptr->background.red == png_ptr->background.green && - png_ptr->background.red == png_ptr->background.blue) - { - png_ptr->mode |= PNG_BACKGROUND_IS_GRAY; - png_ptr->background.gray = png_ptr->background.red; - } - } - } -#endif /* READ_EXPAND && READ_BACKGROUND */ -#endif /* READ_GRAY_TO_RGB */ - - /* For indexed PNG data (PNG_COLOR_TYPE_PALETTE) many of the transformations - * can be performed directly on the palette, and some (such as rgb to gray) - * can be optimized inside the palette. This is particularly true of the - * composite (background and alpha) stuff, which can be pretty much all done - * in the palette even if the result is expanded to RGB or gray afterward. - * - * NOTE: this is Not Yet Implemented, the code behaves as in 1.5.1 and - * earlier and the palette stuff is actually handled on the first row. This - * leads to the reported bug that the palette returned by png_get_PLTE is not - * updated. - */ - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - png_init_palette_transformations(png_ptr); - - else - png_init_rgb_transformations(png_ptr); - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ - defined(PNG_READ_EXPAND_16_SUPPORTED) - if ((png_ptr->transformations & PNG_EXPAND_16) != 0 && - (png_ptr->transformations & PNG_COMPOSE) != 0 && - (png_ptr->transformations & PNG_BACKGROUND_EXPAND) == 0 && - png_ptr->bit_depth != 16) - { - /* TODO: fix this. Because the expand_16 operation is after the compose - * handling the background color must be 8, not 16, bits deep, but the - * application will supply a 16-bit value so reduce it here. - * - * The PNG_BACKGROUND_EXPAND code above does not expand to 16 bits at - * present, so that case is ok (until do_expand_16 is moved.) - * - * NOTE: this discards the low 16 bits of the user supplied background - * color, but until expand_16 works properly there is no choice! - */ -# define CHOP(x) (x)=((png_uint_16)PNG_DIV257(x)) - CHOP(png_ptr->background.red); - CHOP(png_ptr->background.green); - CHOP(png_ptr->background.blue); - CHOP(png_ptr->background.gray); -# undef CHOP - } -#endif /* READ_BACKGROUND && READ_EXPAND_16 */ - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ - (defined(PNG_READ_SCALE_16_TO_8_SUPPORTED) || \ - defined(PNG_READ_STRIP_16_TO_8_SUPPORTED)) - if ((png_ptr->transformations & (PNG_16_TO_8|PNG_SCALE_16_TO_8)) != 0 && - (png_ptr->transformations & PNG_COMPOSE) != 0 && - (png_ptr->transformations & PNG_BACKGROUND_EXPAND) == 0 && - png_ptr->bit_depth == 16) - { - /* On the other hand, if a 16-bit file is to be reduced to 8-bits per - * component this will also happen after PNG_COMPOSE and so the background - * color must be pre-expanded here. - * - * TODO: fix this too. - */ - png_ptr->background.red = (png_uint_16)(png_ptr->background.red * 257); - png_ptr->background.green = - (png_uint_16)(png_ptr->background.green * 257); - png_ptr->background.blue = (png_uint_16)(png_ptr->background.blue * 257); - png_ptr->background.gray = (png_uint_16)(png_ptr->background.gray * 257); - } -#endif - - /* NOTE: below 'PNG_READ_ALPHA_MODE_SUPPORTED' is presumed to also enable the - * background support (see the comments in scripts/pnglibconf.dfa), this - * allows pre-multiplication of the alpha channel to be implemented as - * compositing on black. This is probably sub-optimal and has been done in - * 1.5.4 betas simply to enable external critique and testing (i.e. to - * implement the new API quickly, without lots of internal changes.) - */ - -#ifdef PNG_READ_GAMMA_SUPPORTED -# ifdef PNG_READ_BACKGROUND_SUPPORTED - /* Includes ALPHA_MODE */ - png_ptr->background_1 = png_ptr->background; -# endif - - /* This needs to change - in the palette image case a whole set of tables are - * built when it would be quicker to just calculate the correct value for - * each palette entry directly. Also, the test is too tricky - why check - * PNG_RGB_TO_GRAY if PNG_GAMMA is not set? The answer seems to be that - * PNG_GAMMA is cancelled even if the gamma is known? The test excludes the - * PNG_COMPOSE case, so apparently if there is no *overall* gamma correction - * the gamma tables will not be built even if composition is required on a - * gamma encoded value. - * - * In 1.5.4 this is addressed below by an additional check on the individual - * file gamma - if it is not 1.0 both RGB_TO_GRAY and COMPOSE need the - * tables. - */ - if ((png_ptr->transformations & PNG_GAMMA) != 0 || - ((png_ptr->transformations & PNG_RGB_TO_GRAY) != 0 && - (png_gamma_significant(png_ptr->colorspace.gamma) != 0 || - png_gamma_significant(png_ptr->screen_gamma) != 0)) || - ((png_ptr->transformations & PNG_COMPOSE) != 0 && - (png_gamma_significant(png_ptr->colorspace.gamma) != 0 || - png_gamma_significant(png_ptr->screen_gamma) != 0 -# ifdef PNG_READ_BACKGROUND_SUPPORTED - || (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_UNIQUE && - png_gamma_significant(png_ptr->background_gamma) != 0) -# endif - )) || ((png_ptr->transformations & PNG_ENCODE_ALPHA) != 0 && - png_gamma_significant(png_ptr->screen_gamma) != 0)) - { - png_build_gamma_table(png_ptr, png_ptr->bit_depth); - -#ifdef PNG_READ_BACKGROUND_SUPPORTED - if ((png_ptr->transformations & PNG_COMPOSE) != 0) - { - /* Issue a warning about this combination: because RGB_TO_GRAY is - * optimized to do the gamma transform if present yet do_background has - * to do the same thing if both options are set a - * double-gamma-correction happens. This is true in all versions of - * libpng to date. - */ - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) != 0) - png_warning(png_ptr, - "libpng does not support gamma+background+rgb_to_gray"); - - if ((png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) != 0) - { - /* We don't get to here unless there is a tRNS chunk with non-opaque - * entries - see the checking code at the start of this function. - */ - png_color back, back_1; - png_colorp palette = png_ptr->palette; - int num_palette = png_ptr->num_palette; - int i; - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE) - { - - back.red = png_ptr->gamma_table[png_ptr->background.red]; - back.green = png_ptr->gamma_table[png_ptr->background.green]; - back.blue = png_ptr->gamma_table[png_ptr->background.blue]; - - back_1.red = png_ptr->gamma_to_1[png_ptr->background.red]; - back_1.green = png_ptr->gamma_to_1[png_ptr->background.green]; - back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue]; - } - else - { - png_fixed_point g, gs; - - switch (png_ptr->background_gamma_type) - { - case PNG_BACKGROUND_GAMMA_SCREEN: - g = (png_ptr->screen_gamma); - gs = PNG_FP_1; - break; - - case PNG_BACKGROUND_GAMMA_FILE: - g = png_reciprocal(png_ptr->colorspace.gamma); - gs = png_reciprocal2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma); - break; - - case PNG_BACKGROUND_GAMMA_UNIQUE: - g = png_reciprocal(png_ptr->background_gamma); - gs = png_reciprocal2(png_ptr->background_gamma, - png_ptr->screen_gamma); - break; - default: - g = PNG_FP_1; /* back_1 */ - gs = PNG_FP_1; /* back */ - break; - } - - if (png_gamma_significant(gs) != 0) - { - back.red = png_gamma_8bit_correct(png_ptr->background.red, - gs); - back.green = png_gamma_8bit_correct(png_ptr->background.green, - gs); - back.blue = png_gamma_8bit_correct(png_ptr->background.blue, - gs); - } - - else - { - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; - } - - if (png_gamma_significant(g) != 0) - { - back_1.red = png_gamma_8bit_correct(png_ptr->background.red, - g); - back_1.green = png_gamma_8bit_correct( - png_ptr->background.green, g); - back_1.blue = png_gamma_8bit_correct(png_ptr->background.blue, - g); - } - - else - { - back_1.red = (png_byte)png_ptr->background.red; - back_1.green = (png_byte)png_ptr->background.green; - back_1.blue = (png_byte)png_ptr->background.blue; - } - } - - for (i = 0; i < num_palette; i++) - { - if (i < (int)png_ptr->num_trans && - png_ptr->trans_alpha[i] != 0xff) - { - if (png_ptr->trans_alpha[i] == 0) - { - palette[i] = back; - } - else /* if (png_ptr->trans_alpha[i] != 0xff) */ - { - png_byte v, w; - - v = png_ptr->gamma_to_1[palette[i].red]; - png_composite(w, v, png_ptr->trans_alpha[i], back_1.red); - palette[i].red = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[palette[i].green]; - png_composite(w, v, png_ptr->trans_alpha[i], back_1.green); - palette[i].green = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[palette[i].blue]; - png_composite(w, v, png_ptr->trans_alpha[i], back_1.blue); - palette[i].blue = png_ptr->gamma_from_1[w]; - } - } - else - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } - - /* Prevent the transformations being done again. - * - * NOTE: this is highly dubious; it removes the transformations in - * place. This seems inconsistent with the general treatment of the - * transformations elsewhere. - */ - png_ptr->transformations &= ~(PNG_COMPOSE | PNG_GAMMA); - } /* color_type == PNG_COLOR_TYPE_PALETTE */ - - /* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */ - else /* color_type != PNG_COLOR_TYPE_PALETTE */ - { - int gs_sig, g_sig; - png_fixed_point g = PNG_FP_1; /* Correction to linear */ - png_fixed_point gs = PNG_FP_1; /* Correction to screen */ - - switch (png_ptr->background_gamma_type) - { - case PNG_BACKGROUND_GAMMA_SCREEN: - g = png_ptr->screen_gamma; - /* gs = PNG_FP_1; */ - break; - - case PNG_BACKGROUND_GAMMA_FILE: - g = png_reciprocal(png_ptr->colorspace.gamma); - gs = png_reciprocal2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma); - break; - - case PNG_BACKGROUND_GAMMA_UNIQUE: - g = png_reciprocal(png_ptr->background_gamma); - gs = png_reciprocal2(png_ptr->background_gamma, - png_ptr->screen_gamma); - break; - - default: - png_error(png_ptr, "invalid background gamma type"); - } - - g_sig = png_gamma_significant(g); - gs_sig = png_gamma_significant(gs); - - if (g_sig != 0) - png_ptr->background_1.gray = png_gamma_correct(png_ptr, - png_ptr->background.gray, g); - - if (gs_sig != 0) - png_ptr->background.gray = png_gamma_correct(png_ptr, - png_ptr->background.gray, gs); - - if ((png_ptr->background.red != png_ptr->background.green) || - (png_ptr->background.red != png_ptr->background.blue) || - (png_ptr->background.red != png_ptr->background.gray)) - { - /* RGB or RGBA with color background */ - if (g_sig != 0) - { - png_ptr->background_1.red = png_gamma_correct(png_ptr, - png_ptr->background.red, g); - - png_ptr->background_1.green = png_gamma_correct(png_ptr, - png_ptr->background.green, g); - - png_ptr->background_1.blue = png_gamma_correct(png_ptr, - png_ptr->background.blue, g); - } - - if (gs_sig != 0) - { - png_ptr->background.red = png_gamma_correct(png_ptr, - png_ptr->background.red, gs); - - png_ptr->background.green = png_gamma_correct(png_ptr, - png_ptr->background.green, gs); - - png_ptr->background.blue = png_gamma_correct(png_ptr, - png_ptr->background.blue, gs); - } - } - - else - { - /* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */ - png_ptr->background_1.red = png_ptr->background_1.green - = png_ptr->background_1.blue = png_ptr->background_1.gray; - - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - } - - /* The background is now in screen gamma: */ - png_ptr->background_gamma_type = PNG_BACKGROUND_GAMMA_SCREEN; - } /* color_type != PNG_COLOR_TYPE_PALETTE */ - }/* png_ptr->transformations & PNG_BACKGROUND */ - - else - /* Transformation does not include PNG_BACKGROUND */ -#endif /* READ_BACKGROUND */ - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED - /* RGB_TO_GRAY needs to have non-gamma-corrected values! */ - && ((png_ptr->transformations & PNG_EXPAND) == 0 || - (png_ptr->transformations & PNG_RGB_TO_GRAY) == 0) -#endif - ) - { - png_colorp palette = png_ptr->palette; - int num_palette = png_ptr->num_palette; - int i; - - /* NOTE: there are other transformations that should probably be in - * here too. - */ - for (i = 0; i < num_palette; i++) - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - - /* Done the gamma correction. */ - png_ptr->transformations &= ~PNG_GAMMA; - } /* color_type == PALETTE && !PNG_BACKGROUND transformation */ - } -#ifdef PNG_READ_BACKGROUND_SUPPORTED - else -#endif -#endif /* READ_GAMMA */ - -#ifdef PNG_READ_BACKGROUND_SUPPORTED - /* No GAMMA transformation (see the hanging else 4 lines above) */ - if ((png_ptr->transformations & PNG_COMPOSE) != 0 && - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)) - { - int i; - int istop = (int)png_ptr->num_trans; - png_color back; - png_colorp palette = png_ptr->palette; - - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; - - for (i = 0; i < istop; i++) - { - if (png_ptr->trans_alpha[i] == 0) - { - palette[i] = back; - } - - else if (png_ptr->trans_alpha[i] != 0xff) - { - /* The png_composite() macro is defined in png.h */ - png_composite(palette[i].red, palette[i].red, - png_ptr->trans_alpha[i], back.red); - - png_composite(palette[i].green, palette[i].green, - png_ptr->trans_alpha[i], back.green); - - png_composite(palette[i].blue, palette[i].blue, - png_ptr->trans_alpha[i], back.blue); - } - } - - png_ptr->transformations &= ~PNG_COMPOSE; - } -#endif /* READ_BACKGROUND */ - -#ifdef PNG_READ_SHIFT_SUPPORTED - if ((png_ptr->transformations & PNG_SHIFT) != 0 && - (png_ptr->transformations & PNG_EXPAND) == 0 && - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)) - { - int i; - int istop = png_ptr->num_palette; - int shift = 8 - png_ptr->sig_bit.red; - - png_ptr->transformations &= ~PNG_SHIFT; - - /* significant bits can be in the range 1 to 7 for a meaninful result, if - * the number of significant bits is 0 then no shift is done (this is an - * error condition which is silently ignored.) - */ - if (shift > 0 && shift < 8) - for (i=0; ipalette[i].red; - - component >>= shift; - png_ptr->palette[i].red = (png_byte)component; - } - - shift = 8 - png_ptr->sig_bit.green; - if (shift > 0 && shift < 8) - for (i=0; ipalette[i].green; - - component >>= shift; - png_ptr->palette[i].green = (png_byte)component; - } - - shift = 8 - png_ptr->sig_bit.blue; - if (shift > 0 && shift < 8) - for (i=0; ipalette[i].blue; - - component >>= shift; - png_ptr->palette[i].blue = (png_byte)component; - } - } -#endif /* READ_SHIFT */ -} - -/* Modify the info structure to reflect the transformations. The - * info should be updated so a PNG file could be written with it, - * assuming the transformations result in valid PNG data. - */ -void /* PRIVATE */ -png_read_transform_info(png_structrp png_ptr, png_inforp info_ptr) -{ - png_debug(1, "in png_read_transform_info"); - -#ifdef PNG_READ_EXPAND_SUPPORTED - if ((png_ptr->transformations & PNG_EXPAND) != 0) - { - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - /* This check must match what actually happens in - * png_do_expand_palette; if it ever checks the tRNS chunk to see if - * it is all opaque we must do the same (at present it does not.) - */ - if (png_ptr->num_trans > 0) - info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; - - else - info_ptr->color_type = PNG_COLOR_TYPE_RGB; - - info_ptr->bit_depth = 8; - info_ptr->num_trans = 0; - - if (png_ptr->palette == NULL) - png_error (png_ptr, "Palette is NULL in indexed image"); - } - else - { - if (png_ptr->num_trans != 0) - { - if ((png_ptr->transformations & PNG_EXPAND_tRNS) != 0) - info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; - } - if (info_ptr->bit_depth < 8) - info_ptr->bit_depth = 8; - - info_ptr->num_trans = 0; - } - } -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ - defined(PNG_READ_ALPHA_MODE_SUPPORTED) - /* The following is almost certainly wrong unless the background value is in - * the screen space! - */ - if ((png_ptr->transformations & PNG_COMPOSE) != 0) - info_ptr->background = png_ptr->background; -#endif - -#ifdef PNG_READ_GAMMA_SUPPORTED - /* The following used to be conditional on PNG_GAMMA (prior to 1.5.4), - * however it seems that the code in png_init_read_transformations, which has - * been called before this from png_read_update_info->png_read_start_row - * sometimes does the gamma transform and cancels the flag. - * - * TODO: this looks wrong; the info_ptr should end up with a gamma equal to - * the screen_gamma value. The following probably results in weirdness if - * the info_ptr is used by the app after the rows have been read. - */ - info_ptr->colorspace.gamma = png_ptr->colorspace.gamma; -#endif - - if (info_ptr->bit_depth == 16) - { -# ifdef PNG_READ_16BIT_SUPPORTED -# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED - if ((png_ptr->transformations & PNG_SCALE_16_TO_8) != 0) - info_ptr->bit_depth = 8; -# endif - -# ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED - if ((png_ptr->transformations & PNG_16_TO_8) != 0) - info_ptr->bit_depth = 8; -# endif - -# else - /* No 16-bit support: force chopping 16-bit input down to 8, in this case - * the app program can chose if both APIs are available by setting the - * correct scaling to use. - */ -# ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED - /* For compatibility with previous versions use the strip method by - * default. This code works because if PNG_SCALE_16_TO_8 is already - * set the code below will do that in preference to the chop. - */ - png_ptr->transformations |= PNG_16_TO_8; - info_ptr->bit_depth = 8; -# else - -# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED - png_ptr->transformations |= PNG_SCALE_16_TO_8; - info_ptr->bit_depth = 8; -# else - - CONFIGURATION ERROR: you must enable at least one 16 to 8 method -# endif -# endif -#endif /* !READ_16BIT */ - } - -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) != 0) - info_ptr->color_type = (png_byte)(info_ptr->color_type | - PNG_COLOR_MASK_COLOR); -#endif - -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) != 0) - info_ptr->color_type = (png_byte)(info_ptr->color_type & - ~PNG_COLOR_MASK_COLOR); -#endif - -#ifdef PNG_READ_QUANTIZE_SUPPORTED - if ((png_ptr->transformations & PNG_QUANTIZE) != 0) - { - if (((info_ptr->color_type == PNG_COLOR_TYPE_RGB) || - (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)) && - png_ptr->palette_lookup != 0 && info_ptr->bit_depth == 8) - { - info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; - } - } -#endif - -#ifdef PNG_READ_EXPAND_16_SUPPORTED - if ((png_ptr->transformations & PNG_EXPAND_16) != 0 && - info_ptr->bit_depth == 8 && - info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) - { - info_ptr->bit_depth = 16; - } -#endif - -#ifdef PNG_READ_PACK_SUPPORTED - if ((png_ptr->transformations & PNG_PACK) != 0 && - (info_ptr->bit_depth < 8)) - info_ptr->bit_depth = 8; -#endif - - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - info_ptr->channels = 1; - - else if ((info_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) - info_ptr->channels = 3; - - else - info_ptr->channels = 1; - -#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED - if ((png_ptr->transformations & PNG_STRIP_ALPHA) != 0) - { - info_ptr->color_type = (png_byte)(info_ptr->color_type & - ~PNG_COLOR_MASK_ALPHA); - info_ptr->num_trans = 0; - } -#endif - - if ((info_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0) - info_ptr->channels++; - -#ifdef PNG_READ_FILLER_SUPPORTED - /* STRIP_ALPHA and FILLER allowed: MASK_ALPHA bit stripped above */ - if ((png_ptr->transformations & PNG_FILLER) != 0 && - (info_ptr->color_type == PNG_COLOR_TYPE_RGB || - info_ptr->color_type == PNG_COLOR_TYPE_GRAY)) - { - info_ptr->channels++; - /* If adding a true alpha channel not just filler */ - if ((png_ptr->transformations & PNG_ADD_ALPHA) != 0) - info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; - } -#endif - -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) && \ -defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - if ((png_ptr->transformations & PNG_USER_TRANSFORM) != 0) - { - if (png_ptr->user_transform_depth != 0) - info_ptr->bit_depth = png_ptr->user_transform_depth; - - if (png_ptr->user_transform_channels != 0) - info_ptr->channels = png_ptr->user_transform_channels; - } -#endif - - info_ptr->pixel_depth = (png_byte)(info_ptr->channels * - info_ptr->bit_depth); - - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, info_ptr->width); - - /* Adding in 1.5.4: cache the above value in png_struct so that we can later - * check in png_rowbytes that the user buffer won't get overwritten. Note - * that the field is not always set - if png_read_update_info isn't called - * the application has to either not do any transforms or get the calculation - * right itself. - */ - png_ptr->info_rowbytes = info_ptr->rowbytes; - -#ifndef PNG_READ_EXPAND_SUPPORTED - if (png_ptr != NULL) - return; -#endif -} - -#ifdef PNG_READ_PACK_SUPPORTED -/* Unpack pixels of 1, 2, or 4 bits per pixel into 1 byte per pixel, - * without changing the actual values. Thus, if you had a row with - * a bit depth of 1, you would end up with bytes that only contained - * the numbers 0 or 1. If you would rather they contain 0 and 255, use - * png_do_shift() after this. - */ -static void -png_do_unpack(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_unpack"); - - if (row_info->bit_depth < 8) - { - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - switch (row_info->bit_depth) - { - case 1: - { - png_bytep sp = row + (png_size_t)((row_width - 1) >> 3); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = 7U - ((row_width + 7U) & 0x07); - for (i = 0; i < row_width; i++) - { - *dp = (png_byte)((*sp >> shift) & 0x01); - - if (shift == 7) - { - shift = 0; - sp--; - } - - else - shift++; - - dp--; - } - break; - } - - case 2: - { - - png_bytep sp = row + (png_size_t)((row_width - 1) >> 2); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = ((3U - ((row_width + 3U) & 0x03)) << 1); - for (i = 0; i < row_width; i++) - { - *dp = (png_byte)((*sp >> shift) & 0x03); - - if (shift == 6) - { - shift = 0; - sp--; - } - - else - shift += 2; - - dp--; - } - break; - } - - case 4: - { - png_bytep sp = row + (png_size_t)((row_width - 1) >> 1); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = ((1U - ((row_width + 1U) & 0x01)) << 2); - for (i = 0; i < row_width; i++) - { - *dp = (png_byte)((*sp >> shift) & 0x0f); - - if (shift == 4) - { - shift = 0; - sp--; - } - - else - shift = 4; - - dp--; - } - break; - } - - default: - break; - } - row_info->bit_depth = 8; - row_info->pixel_depth = (png_byte)(8 * row_info->channels); - row_info->rowbytes = row_width * row_info->channels; - } -} -#endif - -#ifdef PNG_READ_SHIFT_SUPPORTED -/* Reverse the effects of png_do_shift. This routine merely shifts the - * pixels back to their significant bits values. Thus, if you have - * a row of bit depth 8, but only 5 are significant, this will shift - * the values back to 0 through 31. - */ -static void -png_do_unshift(png_row_infop row_info, png_bytep row, - png_const_color_8p sig_bits) -{ - int color_type; - - png_debug(1, "in png_do_unshift"); - - /* The palette case has already been handled in the _init routine. */ - color_type = row_info->color_type; - - if (color_type != PNG_COLOR_TYPE_PALETTE) - { - int shift[4]; - int channels = 0; - int bit_depth = row_info->bit_depth; - - if ((color_type & PNG_COLOR_MASK_COLOR) != 0) - { - shift[channels++] = bit_depth - sig_bits->red; - shift[channels++] = bit_depth - sig_bits->green; - shift[channels++] = bit_depth - sig_bits->blue; - } - - else - { - shift[channels++] = bit_depth - sig_bits->gray; - } - - if ((color_type & PNG_COLOR_MASK_ALPHA) != 0) - { - shift[channels++] = bit_depth - sig_bits->alpha; - } - - { - int c, have_shift; - - for (c = have_shift = 0; c < channels; ++c) - { - /* A shift of more than the bit depth is an error condition but it - * gets ignored here. - */ - if (shift[c] <= 0 || shift[c] >= bit_depth) - shift[c] = 0; - - else - have_shift = 1; - } - - if (have_shift == 0) - return; - } - - switch (bit_depth) - { - default: - /* Must be 1bpp gray: should not be here! */ - /* NOTREACHED */ - break; - - case 2: - /* Must be 2bpp gray */ - /* assert(channels == 1 && shift[0] == 1) */ - { - png_bytep bp = row; - png_bytep bp_end = bp + row_info->rowbytes; - - while (bp < bp_end) - { - int b = (*bp >> 1) & 0x55; - *bp++ = (png_byte)b; - } - break; - } - - case 4: - /* Must be 4bpp gray */ - /* assert(channels == 1) */ - { - png_bytep bp = row; - png_bytep bp_end = bp + row_info->rowbytes; - int gray_shift = shift[0]; - int mask = 0xf >> gray_shift; - - mask |= mask << 4; - - while (bp < bp_end) - { - int b = (*bp >> gray_shift) & mask; - *bp++ = (png_byte)b; - } - break; - } - - case 8: - /* Single byte components, G, GA, RGB, RGBA */ - { - png_bytep bp = row; - png_bytep bp_end = bp + row_info->rowbytes; - int channel = 0; - - while (bp < bp_end) - { - int b = *bp >> shift[channel]; - if (++channel >= channels) - channel = 0; - *bp++ = (png_byte)b; - } - break; - } - -#ifdef PNG_READ_16BIT_SUPPORTED - case 16: - /* Double byte components, G, GA, RGB, RGBA */ - { - png_bytep bp = row; - png_bytep bp_end = bp + row_info->rowbytes; - int channel = 0; - - while (bp < bp_end) - { - int value = (bp[0] << 8) + bp[1]; - - value >>= shift[channel]; - if (++channel >= channels) - channel = 0; - *bp++ = (png_byte)(value >> 8); - *bp++ = (png_byte)value; - } - break; - } -#endif - } - } -} -#endif - -#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED -/* Scale rows of bit depth 16 down to 8 accurately */ -static void -png_do_scale_16_to_8(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_scale_16_to_8"); - - if (row_info->bit_depth == 16) - { - png_bytep sp = row; /* source */ - png_bytep dp = row; /* destination */ - png_bytep ep = sp + row_info->rowbytes; /* end+1 */ - - while (sp < ep) - { - /* The input is an array of 16-bit components, these must be scaled to - * 8 bits each. For a 16-bit value V the required value (from the PNG - * specification) is: - * - * (V * 255) / 65535 - * - * This reduces to round(V / 257), or floor((V + 128.5)/257) - * - * Represent V as the two byte value vhi.vlo. Make a guess that the - * result is the top byte of V, vhi, then the correction to this value - * is: - * - * error = floor(((V-vhi.vhi) + 128.5) / 257) - * = floor(((vlo-vhi) + 128.5) / 257) - * - * This can be approximated using integer arithmetic (and a signed - * shift): - * - * error = (vlo-vhi+128) >> 8; - * - * The approximate differs from the exact answer only when (vlo-vhi) is - * 128; it then gives a correction of +1 when the exact correction is - * 0. This gives 128 errors. The exact answer (correct for all 16-bit - * input values) is: - * - * error = (vlo-vhi+128)*65535 >> 24; - * - * An alternative arithmetic calculation which also gives no errors is: - * - * (V * 255 + 32895) >> 16 - */ - - png_int_32 tmp = *sp++; /* must be signed! */ - tmp += (((int)*sp++ - tmp + 128) * 65535) >> 24; - *dp++ = (png_byte)tmp; - } - - row_info->bit_depth = 8; - row_info->pixel_depth = (png_byte)(8 * row_info->channels); - row_info->rowbytes = row_info->width * row_info->channels; - } -} -#endif - -#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED -static void -/* Simply discard the low byte. This was the default behavior prior - * to libpng-1.5.4. - */ -png_do_chop(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_chop"); - - if (row_info->bit_depth == 16) - { - png_bytep sp = row; /* source */ - png_bytep dp = row; /* destination */ - png_bytep ep = sp + row_info->rowbytes; /* end+1 */ - - while (sp < ep) - { - *dp++ = *sp; - sp += 2; /* skip low byte */ - } - - row_info->bit_depth = 8; - row_info->pixel_depth = (png_byte)(8 * row_info->channels); - row_info->rowbytes = row_info->width * row_info->channels; - } -} -#endif - -#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED -static void -png_do_read_swap_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_read_swap_alpha"); - - { - png_uint_32 row_width = row_info->width; - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - /* This converts from RGBA to ARGB */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save; - } - } - -#ifdef PNG_READ_16BIT_SUPPORTED - /* This converts from RRGGBBAA to AARRGGBB */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save[2]; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save[0] = *(--sp); - save[1] = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save[0]; - *(--dp) = save[1]; - } - } -#endif - } - - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - /* This converts from GA to AG */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save; - } - } - -#ifdef PNG_READ_16BIT_SUPPORTED - /* This converts from GGAA to AAGG */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save[2]; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save[0] = *(--sp); - save[1] = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save[0]; - *(--dp) = save[1]; - } - } -#endif - } - } -} -#endif - -#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED -static void -png_do_read_invert_alpha(png_row_infop row_info, png_bytep row) -{ - png_uint_32 row_width; - png_debug(1, "in png_do_read_invert_alpha"); - - row_width = row_info->width; - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - if (row_info->bit_depth == 8) - { - /* This inverts the alpha channel in RGBA */ - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - -/* This does nothing: - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - We can replace it with: -*/ - sp-=3; - dp=sp; - } - } - -#ifdef PNG_READ_16BIT_SUPPORTED - /* This inverts the alpha channel in RRGGBBAA */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = (png_byte)(255 - *(--sp)); - -/* This does nothing: - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - We can replace it with: -*/ - sp-=6; - dp=sp; - } - } -#endif - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - if (row_info->bit_depth == 8) - { - /* This inverts the alpha channel in GA */ - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = *(--sp); - } - } - -#ifdef PNG_READ_16BIT_SUPPORTED - else - { - /* This inverts the alpha channel in GGAA */ - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = (png_byte)(255 - *(--sp)); -/* - *(--dp) = *(--sp); - *(--dp) = *(--sp); -*/ - sp-=2; - dp=sp; - } - } -#endif - } -} -#endif - -#ifdef PNG_READ_FILLER_SUPPORTED -/* Add filler channel if we have RGB color */ -static void -png_do_read_filler(png_row_infop row_info, png_bytep row, - png_uint_32 filler, png_uint_32 flags) -{ - png_uint_32 i; - png_uint_32 row_width = row_info->width; - -#ifdef PNG_READ_16BIT_SUPPORTED - png_byte hi_filler = (png_byte)(filler>>8); -#endif - png_byte lo_filler = (png_byte)filler; - - png_debug(1, "in png_do_read_filler"); - - if ( - row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - if (row_info->bit_depth == 8) - { - if ((flags & PNG_FLAG_FILLER_AFTER) != 0) - { - /* This changes the data from G to GX */ - png_bytep sp = row + (png_size_t)row_width; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 1; i < row_width; i++) - { - *(--dp) = lo_filler; - *(--dp) = *(--sp); - } - *(--dp) = lo_filler; - row_info->channels = 2; - row_info->pixel_depth = 16; - row_info->rowbytes = row_width * 2; - } - - else - { - /* This changes the data from G to XG */ - png_bytep sp = row + (png_size_t)row_width; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = lo_filler; - } - row_info->channels = 2; - row_info->pixel_depth = 16; - row_info->rowbytes = row_width * 2; - } - } - -#ifdef PNG_READ_16BIT_SUPPORTED - else if (row_info->bit_depth == 16) - { - if ((flags & PNG_FLAG_FILLER_AFTER) != 0) - { - /* This changes the data from GG to GGXX */ - png_bytep sp = row + (png_size_t)row_width * 2; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 1; i < row_width; i++) - { - *(--dp) = lo_filler; - *(--dp) = hi_filler; - *(--dp) = *(--sp); - *(--dp) = *(--sp); - } - *(--dp) = lo_filler; - *(--dp) = hi_filler; - row_info->channels = 2; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - - else - { - /* This changes the data from GG to XXGG */ - png_bytep sp = row + (png_size_t)row_width * 2; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = lo_filler; - *(--dp) = hi_filler; - } - row_info->channels = 2; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - } -#endif - } /* COLOR_TYPE == GRAY */ - else if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - if (row_info->bit_depth == 8) - { - if ((flags & PNG_FLAG_FILLER_AFTER) != 0) - { - /* This changes the data from RGB to RGBX */ - png_bytep sp = row + (png_size_t)row_width * 3; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 1; i < row_width; i++) - { - *(--dp) = lo_filler; - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - } - *(--dp) = lo_filler; - row_info->channels = 4; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - - else - { - /* This changes the data from RGB to XRGB */ - png_bytep sp = row + (png_size_t)row_width * 3; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = lo_filler; - } - row_info->channels = 4; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - } - -#ifdef PNG_READ_16BIT_SUPPORTED - else if (row_info->bit_depth == 16) - { - if ((flags & PNG_FLAG_FILLER_AFTER) != 0) - { - /* This changes the data from RRGGBB to RRGGBBXX */ - png_bytep sp = row + (png_size_t)row_width * 6; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 1; i < row_width; i++) - { - *(--dp) = lo_filler; - *(--dp) = hi_filler; - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - } - *(--dp) = lo_filler; - *(--dp) = hi_filler; - row_info->channels = 4; - row_info->pixel_depth = 64; - row_info->rowbytes = row_width * 8; - } - - else - { - /* This changes the data from RRGGBB to XXRRGGBB */ - png_bytep sp = row + (png_size_t)row_width * 6; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = lo_filler; - *(--dp) = hi_filler; - } - - row_info->channels = 4; - row_info->pixel_depth = 64; - row_info->rowbytes = row_width * 8; - } - } -#endif - } /* COLOR_TYPE == RGB */ -} -#endif - -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED -/* Expand grayscale files to RGB, with or without alpha */ -static void -png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) -{ - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - png_debug(1, "in png_do_gray_to_rgb"); - - if (row_info->bit_depth >= 8 && - (row_info->color_type & PNG_COLOR_MASK_COLOR) == 0) - { - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - if (row_info->bit_depth == 8) - { - /* This changes G to RGB */ - png_bytep sp = row + (png_size_t)row_width - 1; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(dp--) = *sp; - *(dp--) = *sp; - *(dp--) = *(sp--); - } - } - - else - { - /* This changes GG to RRGGBB */ - png_bytep sp = row + (png_size_t)row_width * 2 - 1; - png_bytep dp = sp + (png_size_t)row_width * 4; - for (i = 0; i < row_width; i++) - { - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *(sp--); - *(dp--) = *(sp--); - } - } - } - - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - if (row_info->bit_depth == 8) - { - /* This changes GA to RGBA */ - png_bytep sp = row + (png_size_t)row_width * 2 - 1; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(dp--) = *(sp--); - *(dp--) = *sp; - *(dp--) = *sp; - *(dp--) = *(sp--); - } - } - - else - { - /* This changes GGAA to RRGGBBAA */ - png_bytep sp = row + (png_size_t)row_width * 4 - 1; - png_bytep dp = sp + (png_size_t)row_width * 4; - for (i = 0; i < row_width; i++) - { - *(dp--) = *(sp--); - *(dp--) = *(sp--); - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *(sp--); - *(dp--) = *(sp--); - } - } - } - row_info->channels = (png_byte)(row_info->channels + 2); - row_info->color_type |= PNG_COLOR_MASK_COLOR; - row_info->pixel_depth = (png_byte)(row_info->channels * - row_info->bit_depth); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } -} -#endif - -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED -/* Reduce RGB files to grayscale, with or without alpha - * using the equation given in Poynton's ColorFAQ of 1998-01-04 at - * (THIS LINK IS DEAD June 2008 but - * versions dated 1998 through November 2002 have been archived at - * http://web.archive.org/web/20000816232553/http://www.inforamp.net/ - * ~poynton/notes/colour_and_gamma/ColorFAQ.txt ) - * Charles Poynton poynton at poynton.com - * - * Y = 0.212671 * R + 0.715160 * G + 0.072169 * B - * - * which can be expressed with integers as - * - * Y = (6969 * R + 23434 * G + 2365 * B)/32768 - * - * Poynton's current link (as of January 2003 through July 2011): - * - * has changed the numbers slightly: - * - * Y = 0.2126*R + 0.7152*G + 0.0722*B - * - * which can be expressed with integers as - * - * Y = (6966 * R + 23436 * G + 2366 * B)/32768 - * - * Historically, however, libpng uses numbers derived from the ITU-R Rec 709 - * end point chromaticities and the D65 white point. Depending on the - * precision used for the D65 white point this produces a variety of different - * numbers, however if the four decimal place value used in ITU-R Rec 709 is - * used (0.3127,0.3290) the Y calculation would be: - * - * Y = (6968 * R + 23435 * G + 2366 * B)/32768 - * - * While this is correct the rounding results in an overflow for white, because - * the sum of the rounded coefficients is 32769, not 32768. Consequently - * libpng uses, instead, the closest non-overflowing approximation: - * - * Y = (6968 * R + 23434 * G + 2366 * B)/32768 - * - * Starting with libpng-1.5.5, if the image being converted has a cHRM chunk - * (including an sRGB chunk) then the chromaticities are used to calculate the - * coefficients. See the chunk handling in pngrutil.c for more information. - * - * In all cases the calculation is to be done in a linear colorspace. If no - * gamma information is available to correct the encoding of the original RGB - * values this results in an implicit assumption that the original PNG RGB - * values were linear. - * - * Other integer coefficents can be used via png_set_rgb_to_gray(). Because - * the API takes just red and green coefficients the blue coefficient is - * calculated to make the sum 32768. This will result in different rounding - * to that used above. - */ -static int -png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row) - -{ - int rgb_error = 0; - - png_debug(1, "in png_do_rgb_to_gray"); - - if ((row_info->color_type & PNG_COLOR_MASK_PALETTE) == 0 && - (row_info->color_type & PNG_COLOR_MASK_COLOR) != 0) - { - PNG_CONST png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff; - PNG_CONST png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff; - PNG_CONST png_uint_32 bc = 32768 - rc - gc; - PNG_CONST png_uint_32 row_width = row_info->width; - PNG_CONST int have_alpha = - (row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0; - - if (row_info->bit_depth == 8) - { -#ifdef PNG_READ_GAMMA_SUPPORTED - /* Notice that gamma to/from 1 are not necessarily inverses (if - * there is an overall gamma correction). Prior to 1.5.5 this code - * checked the linearized values for equality; this doesn't match - * the documentation, the original values must be checked. - */ - if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); - - if (red != green || red != blue) - { - red = png_ptr->gamma_to_1[red]; - green = png_ptr->gamma_to_1[green]; - blue = png_ptr->gamma_to_1[blue]; - - rgb_error |= 1; - *(dp++) = png_ptr->gamma_from_1[ - (rc*red + gc*green + bc*blue + 16384)>>15]; - } - - else - { - /* If there is no overall correction the table will not be - * set. - */ - if (png_ptr->gamma_table != NULL) - red = png_ptr->gamma_table[red]; - - *(dp++) = red; - } - - if (have_alpha != 0) - *(dp++) = *(sp++); - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); - - if (red != green || red != blue) - { - rgb_error |= 1; - /* NOTE: this is the historical approach which simply - * truncates the results. - */ - *(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15); - } - - else - *(dp++) = red; - - if (have_alpha != 0) - *(dp++) = *(sp++); - } - } - } - - else /* RGB bit_depth == 16 */ - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (png_ptr->gamma_16_to_1 != NULL && png_ptr->gamma_16_from_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, w; - png_byte hi,lo; - - hi=*(sp)++; lo=*(sp)++; red = (png_uint_16)((hi << 8) | (lo)); - hi=*(sp)++; lo=*(sp)++; green = (png_uint_16)((hi << 8) | (lo)); - hi=*(sp)++; lo=*(sp)++; blue = (png_uint_16)((hi << 8) | (lo)); - - if (red == green && red == blue) - { - if (png_ptr->gamma_16_table != NULL) - w = png_ptr->gamma_16_table[(red & 0xff) - >> png_ptr->gamma_shift][red >> 8]; - - else - w = red; - } - - else - { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red & 0xff) - >> png_ptr->gamma_shift][red>>8]; - png_uint_16 green_1 = - png_ptr->gamma_16_to_1[(green & 0xff) >> - png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue & 0xff) - >> png_ptr->gamma_shift][blue>>8]; - png_uint_16 gray16 = (png_uint_16)((rc*red_1 + gc*green_1 - + bc*blue_1 + 16384)>>15); - w = png_ptr->gamma_16_from_1[(gray16 & 0xff) >> - png_ptr->gamma_shift][gray16 >> 8]; - rgb_error |= 1; - } - - *(dp++) = (png_byte)((w>>8) & 0xff); - *(dp++) = (png_byte)(w & 0xff); - - if (have_alpha != 0) - { - *(dp++) = *(sp++); - *(dp++) = *(sp++); - } - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, gray16; - png_byte hi,lo; - - hi=*(sp)++; lo=*(sp)++; red = (png_uint_16)((hi << 8) | (lo)); - hi=*(sp)++; lo=*(sp)++; green = (png_uint_16)((hi << 8) | (lo)); - hi=*(sp)++; lo=*(sp)++; blue = (png_uint_16)((hi << 8) | (lo)); - - if (red != green || red != blue) - rgb_error |= 1; - - /* From 1.5.5 in the 16-bit case do the accurate conversion even - * in the 'fast' case - this is because this is where the code - * ends up when handling linear 16-bit data. - */ - gray16 = (png_uint_16)((rc*red + gc*green + bc*blue + 16384) >> - 15); - *(dp++) = (png_byte)((gray16 >> 8) & 0xff); - *(dp++) = (png_byte)(gray16 & 0xff); - - if (have_alpha != 0) - { - *(dp++) = *(sp++); - *(dp++) = *(sp++); - } - } - } - } - - row_info->channels = (png_byte)(row_info->channels - 2); - row_info->color_type = (png_byte)(row_info->color_type & - ~PNG_COLOR_MASK_COLOR); - row_info->pixel_depth = (png_byte)(row_info->channels * - row_info->bit_depth); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } - return rgb_error; -} -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ - defined(PNG_READ_ALPHA_MODE_SUPPORTED) -/* Replace any alpha or transparency with the supplied background color. - * "background" is already in the screen gamma, while "background_1" is - * at a gamma of 1.0. Paletted files have already been taken care of. - */ -static void -png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr) -{ -#ifdef PNG_READ_GAMMA_SUPPORTED - png_const_bytep gamma_table = png_ptr->gamma_table; - png_const_bytep gamma_from_1 = png_ptr->gamma_from_1; - png_const_bytep gamma_to_1 = png_ptr->gamma_to_1; - png_const_uint_16pp gamma_16 = png_ptr->gamma_16_table; - png_const_uint_16pp gamma_16_from_1 = png_ptr->gamma_16_from_1; - png_const_uint_16pp gamma_16_to_1 = png_ptr->gamma_16_to_1; - int gamma_shift = png_ptr->gamma_shift; - int optimize = (png_ptr->flags & PNG_FLAG_OPTIMIZE_ALPHA) != 0; -#endif - - png_bytep sp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - int shift; - - png_debug(1, "in png_do_compose"); - - { - switch (row_info->color_type) - { - case PNG_COLOR_TYPE_GRAY: - { - switch (row_info->bit_depth) - { - case 1: - { - sp = row; - shift = 7; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x01) - == png_ptr->trans_color.gray) - { - unsigned int tmp = *sp & (0x7f7f >> (7 - shift)); - tmp |= - (unsigned int)(png_ptr->background.gray << shift); - *sp = (png_byte)(tmp & 0xff); - } - - if (shift == 0) - { - shift = 7; - sp++; - } - - else - shift--; - } - break; - } - - case 2: - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_table != NULL) - { - sp = row; - shift = 6; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x03) - == png_ptr->trans_color.gray) - { - unsigned int tmp = *sp & (0x3f3f >> (6 - shift)); - tmp |= - (unsigned int)png_ptr->background.gray << shift; - *sp = (png_byte)(tmp & 0xff); - } - - else - { - unsigned int p = (*sp >> shift) & 0x03; - unsigned int g = (gamma_table [p | (p << 2) | - (p << 4) | (p << 6)] >> 6) & 0x03; - unsigned int tmp = *sp & (0x3f3f >> (6 - shift)); - tmp |= (unsigned int)(g << shift); - *sp = (png_byte)(tmp & 0xff); - } - - if (shift == 0) - { - shift = 6; - sp++; - } - - else - shift -= 2; - } - } - - else -#endif - { - sp = row; - shift = 6; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x03) - == png_ptr->trans_color.gray) - { - unsigned int tmp = *sp & (0x3f3f >> (6 - shift)); - tmp |= - (unsigned int)png_ptr->background.gray << shift; - *sp = (png_byte)(tmp & 0xff); - } - - if (shift == 0) - { - shift = 6; - sp++; - } - - else - shift -= 2; - } - } - break; - } - - case 4: - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_table != NULL) - { - sp = row; - shift = 4; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x0f) - == png_ptr->trans_color.gray) - { - unsigned int tmp = *sp & (0x0f0f >> (4 - shift)); - tmp |= - (unsigned int)(png_ptr->background.gray << shift); - *sp = (png_byte)(tmp & 0xff); - } - - else - { - unsigned int p = (*sp >> shift) & 0x0f; - unsigned int g = (gamma_table[p | (p << 4)] >> 4) & - 0x0f; - unsigned int tmp = *sp & (0x0f0f >> (4 - shift)); - tmp |= (unsigned int)(g << shift); - *sp = (png_byte)(tmp & 0xff); - } - - if (shift == 0) - { - shift = 4; - sp++; - } - - else - shift -= 4; - } - } - - else -#endif - { - sp = row; - shift = 4; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x0f) - == png_ptr->trans_color.gray) - { - unsigned int tmp = *sp & (0x0f0f >> (4 - shift)); - tmp |= - (unsigned int)(png_ptr->background.gray << shift); - *sp = (png_byte)(tmp & 0xff); - } - - if (shift == 0) - { - shift = 4; - sp++; - } - - else - shift -= 4; - } - } - break; - } - - case 8: - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_table != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp++) - { - if (*sp == png_ptr->trans_color.gray) - *sp = (png_byte)png_ptr->background.gray; - - else - *sp = gamma_table[*sp]; - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp++) - { - if (*sp == png_ptr->trans_color.gray) - *sp = (png_byte)png_ptr->background.gray; - } - } - break; - } - - case 16: - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_16 != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 2) - { - png_uint_16 v; - - v = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - - if (v == png_ptr->trans_color.gray) - { - /* Background is already in screen gamma */ - *sp = (png_byte)((png_ptr->background.gray >> 8) - & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.gray - & 0xff); - } - - else - { - v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 2) - { - png_uint_16 v; - - v = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - - if (v == png_ptr->trans_color.gray) - { - *sp = (png_byte)((png_ptr->background.gray >> 8) - & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.gray - & 0xff); - } - } - } - break; - } - - default: - break; - } - break; - } - - case PNG_COLOR_TYPE_RGB: - { - if (row_info->bit_depth == 8) - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_table != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 3) - { - if (*sp == png_ptr->trans_color.red && - *(sp + 1) == png_ptr->trans_color.green && - *(sp + 2) == png_ptr->trans_color.blue) - { - *sp = (png_byte)png_ptr->background.red; - *(sp + 1) = (png_byte)png_ptr->background.green; - *(sp + 2) = (png_byte)png_ptr->background.blue; - } - - else - { - *sp = gamma_table[*sp]; - *(sp + 1) = gamma_table[*(sp + 1)]; - *(sp + 2) = gamma_table[*(sp + 2)]; - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 3) - { - if (*sp == png_ptr->trans_color.red && - *(sp + 1) == png_ptr->trans_color.green && - *(sp + 2) == png_ptr->trans_color.blue) - { - *sp = (png_byte)png_ptr->background.red; - *(sp + 1) = (png_byte)png_ptr->background.green; - *(sp + 2) = (png_byte)png_ptr->background.blue; - } - } - } - } - else /* if (row_info->bit_depth == 16) */ - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_16 != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 6) - { - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - - png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8) - + *(sp + 3)); - - png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8) - + *(sp + 5)); - - if (r == png_ptr->trans_color.red && - g == png_ptr->trans_color.green && - b == png_ptr->trans_color.blue) - { - /* Background is already in screen gamma */ - *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff); - *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) - & 0xff); - *(sp + 3) = (png_byte)(png_ptr->background.green - & 0xff); - *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) - & 0xff); - *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff); - } - - else - { - png_uint_16 v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - - v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)]; - *(sp + 2) = (png_byte)((v >> 8) & 0xff); - *(sp + 3) = (png_byte)(v & 0xff); - - v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)]; - *(sp + 4) = (png_byte)((v >> 8) & 0xff); - *(sp + 5) = (png_byte)(v & 0xff); - } - } - } - - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 6) - { - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - - png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8) - + *(sp + 3)); - - png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8) - + *(sp + 5)); - - if (r == png_ptr->trans_color.red && - g == png_ptr->trans_color.green && - b == png_ptr->trans_color.blue) - { - *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff); - *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) - & 0xff); - *(sp + 3) = (png_byte)(png_ptr->background.green - & 0xff); - *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) - & 0xff); - *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff); - } - } - } - } - break; - } - - case PNG_COLOR_TYPE_GRAY_ALPHA: - { - if (row_info->bit_depth == 8) - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_to_1 != NULL && gamma_from_1 != NULL && - gamma_table != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 2) - { - png_uint_16 a = *(sp + 1); - - if (a == 0xff) - *sp = gamma_table[*sp]; - - else if (a == 0) - { - /* Background is already in screen gamma */ - *sp = (png_byte)png_ptr->background.gray; - } - - else - { - png_byte v, w; - - v = gamma_to_1[*sp]; - png_composite(w, v, a, png_ptr->background_1.gray); - if (optimize == 0) - w = gamma_from_1[w]; - *sp = w; - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 2) - { - png_byte a = *(sp + 1); - - if (a == 0) - *sp = (png_byte)png_ptr->background.gray; - - else if (a < 0xff) - png_composite(*sp, *sp, a, png_ptr->background.gray); - } - } - } - else /* if (png_ptr->bit_depth == 16) */ - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_16 != NULL && gamma_16_from_1 != NULL && - gamma_16_to_1 != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 4) - { - png_uint_16 a = (png_uint_16)(((*(sp + 2)) << 8) - + *(sp + 3)); - - if (a == (png_uint_16)0xffff) - { - png_uint_16 v; - - v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - } - - else if (a == 0) - { - /* Background is already in screen gamma */ - *sp = (png_byte)((png_ptr->background.gray >> 8) - & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff); - } - - else - { - png_uint_16 g, v, w; - - g = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; - png_composite_16(v, g, a, png_ptr->background_1.gray); - if (optimize != 0) - w = v; - else - w = gamma_16_from_1[(v & 0xff) >> - gamma_shift][v >> 8]; - *sp = (png_byte)((w >> 8) & 0xff); - *(sp + 1) = (png_byte)(w & 0xff); - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 4) - { - png_uint_16 a = (png_uint_16)(((*(sp + 2)) << 8) - + *(sp + 3)); - - if (a == 0) - { - *sp = (png_byte)((png_ptr->background.gray >> 8) - & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff); - } - - else if (a < 0xffff) - { - png_uint_16 g, v; - - g = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_composite_16(v, g, a, png_ptr->background.gray); - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - } - } - } - } - break; - } - - case PNG_COLOR_TYPE_RGB_ALPHA: - { - if (row_info->bit_depth == 8) - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_to_1 != NULL && gamma_from_1 != NULL && - gamma_table != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 4) - { - png_byte a = *(sp + 3); - - if (a == 0xff) - { - *sp = gamma_table[*sp]; - *(sp + 1) = gamma_table[*(sp + 1)]; - *(sp + 2) = gamma_table[*(sp + 2)]; - } - - else if (a == 0) - { - /* Background is already in screen gamma */ - *sp = (png_byte)png_ptr->background.red; - *(sp + 1) = (png_byte)png_ptr->background.green; - *(sp + 2) = (png_byte)png_ptr->background.blue; - } - - else - { - png_byte v, w; - - v = gamma_to_1[*sp]; - png_composite(w, v, a, png_ptr->background_1.red); - if (optimize == 0) w = gamma_from_1[w]; - *sp = w; - - v = gamma_to_1[*(sp + 1)]; - png_composite(w, v, a, png_ptr->background_1.green); - if (optimize == 0) w = gamma_from_1[w]; - *(sp + 1) = w; - - v = gamma_to_1[*(sp + 2)]; - png_composite(w, v, a, png_ptr->background_1.blue); - if (optimize == 0) w = gamma_from_1[w]; - *(sp + 2) = w; - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 4) - { - png_byte a = *(sp + 3); - - if (a == 0) - { - *sp = (png_byte)png_ptr->background.red; - *(sp + 1) = (png_byte)png_ptr->background.green; - *(sp + 2) = (png_byte)png_ptr->background.blue; - } - - else if (a < 0xff) - { - png_composite(*sp, *sp, a, png_ptr->background.red); - - png_composite(*(sp + 1), *(sp + 1), a, - png_ptr->background.green); - - png_composite(*(sp + 2), *(sp + 2), a, - png_ptr->background.blue); - } - } - } - } - else /* if (row_info->bit_depth == 16) */ - { -#ifdef PNG_READ_GAMMA_SUPPORTED - if (gamma_16 != NULL && gamma_16_from_1 != NULL && - gamma_16_to_1 != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 8) - { - png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6)) - << 8) + (png_uint_16)(*(sp + 7))); - - if (a == (png_uint_16)0xffff) - { - png_uint_16 v; - - v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - - v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)]; - *(sp + 2) = (png_byte)((v >> 8) & 0xff); - *(sp + 3) = (png_byte)(v & 0xff); - - v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)]; - *(sp + 4) = (png_byte)((v >> 8) & 0xff); - *(sp + 5) = (png_byte)(v & 0xff); - } - - else if (a == 0) - { - /* Background is already in screen gamma */ - *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff); - *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) - & 0xff); - *(sp + 3) = (png_byte)(png_ptr->background.green - & 0xff); - *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) - & 0xff); - *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff); - } - - else - { - png_uint_16 v, w; - - v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; - png_composite_16(w, v, a, png_ptr->background_1.red); - if (optimize == 0) - w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >> - 8]; - *sp = (png_byte)((w >> 8) & 0xff); - *(sp + 1) = (png_byte)(w & 0xff); - - v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)]; - png_composite_16(w, v, a, png_ptr->background_1.green); - if (optimize == 0) - w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >> - 8]; - - *(sp + 2) = (png_byte)((w >> 8) & 0xff); - *(sp + 3) = (png_byte)(w & 0xff); - - v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)]; - png_composite_16(w, v, a, png_ptr->background_1.blue); - if (optimize == 0) - w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >> - 8]; - - *(sp + 4) = (png_byte)((w >> 8) & 0xff); - *(sp + 5) = (png_byte)(w & 0xff); - } - } - } - - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 8) - { - png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6)) - << 8) + (png_uint_16)(*(sp + 7))); - - if (a == 0) - { - *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff); - *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) - & 0xff); - *(sp + 3) = (png_byte)(png_ptr->background.green - & 0xff); - *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) - & 0xff); - *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff); - } - - else if (a < 0xffff) - { - png_uint_16 v; - - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8) - + *(sp + 3)); - png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8) - + *(sp + 5)); - - png_composite_16(v, r, a, png_ptr->background.red); - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - - png_composite_16(v, g, a, png_ptr->background.green); - *(sp + 2) = (png_byte)((v >> 8) & 0xff); - *(sp + 3) = (png_byte)(v & 0xff); - - png_composite_16(v, b, a, png_ptr->background.blue); - *(sp + 4) = (png_byte)((v >> 8) & 0xff); - *(sp + 5) = (png_byte)(v & 0xff); - } - } - } - } - break; - } - - default: - break; - } - } -} -#endif /* READ_BACKGROUND || READ_ALPHA_MODE */ - -#ifdef PNG_READ_GAMMA_SUPPORTED -/* Gamma correct the image, avoiding the alpha channel. Make sure - * you do this after you deal with the transparency issue on grayscale - * or RGB images. If your bit depth is 8, use gamma_table, if it - * is 16, use gamma_16_table and gamma_shift. Build these with - * build_gamma_table(). - */ -static void -png_do_gamma(png_row_infop row_info, png_bytep row, png_structrp png_ptr) -{ - png_const_bytep gamma_table = png_ptr->gamma_table; - png_const_uint_16pp gamma_16_table = png_ptr->gamma_16_table; - int gamma_shift = png_ptr->gamma_shift; - - png_bytep sp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_gamma"); - - if (((row_info->bit_depth <= 8 && gamma_table != NULL) || - (row_info->bit_depth == 16 && gamma_16_table != NULL))) - { - switch (row_info->color_type) - { - case PNG_COLOR_TYPE_RGB: - { - if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - } - } - - else /* if (row_info->bit_depth == 16) */ - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v; - - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - } - } - break; - } - - case PNG_COLOR_TYPE_RGB_ALPHA: - { - if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp++; - - *sp = gamma_table[*sp]; - sp++; - - *sp = gamma_table[*sp]; - sp++; - - sp++; - } - } - - else /* if (row_info->bit_depth == 16) */ - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 4; - } - } - break; - } - - case PNG_COLOR_TYPE_GRAY_ALPHA: - { - if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp += 2; - } - } - - else /* if (row_info->bit_depth == 16) */ - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 4; - } - } - break; - } - - case PNG_COLOR_TYPE_GRAY: - { - if (row_info->bit_depth == 2) - { - sp = row; - for (i = 0; i < row_width; i += 4) - { - int a = *sp & 0xc0; - int b = *sp & 0x30; - int c = *sp & 0x0c; - int d = *sp & 0x03; - - *sp = (png_byte)( - ((((int)gamma_table[a|(a>>2)|(a>>4)|(a>>6)]) ) & 0xc0)| - ((((int)gamma_table[(b<<2)|b|(b>>2)|(b>>4)])>>2) & 0x30)| - ((((int)gamma_table[(c<<4)|(c<<2)|c|(c>>2)])>>4) & 0x0c)| - ((((int)gamma_table[(d<<6)|(d<<4)|(d<<2)|d])>>6) )); - sp++; - } - } - - if (row_info->bit_depth == 4) - { - sp = row; - for (i = 0; i < row_width; i += 2) - { - int msb = *sp & 0xf0; - int lsb = *sp & 0x0f; - - *sp = (png_byte)((((int)gamma_table[msb | (msb >> 4)]) & 0xf0) - | (((int)gamma_table[(lsb << 4) | lsb]) >> 4)); - sp++; - } - } - - else if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp++; - } - } - - else if (row_info->bit_depth == 16) - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - } - } - break; - } - - default: - break; - } - } -} -#endif - -#ifdef PNG_READ_ALPHA_MODE_SUPPORTED -/* Encode the alpha channel to the output gamma (the input channel is always - * linear.) Called only with color types that have an alpha channel. Needs the - * from_1 tables. - */ -static void -png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr) -{ - png_uint_32 row_width = row_info->width; - - png_debug(1, "in png_do_encode_alpha"); - - if ((row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0) - { - if (row_info->bit_depth == 8) - { - PNG_CONST png_bytep table = png_ptr->gamma_from_1; - - if (table != NULL) - { - PNG_CONST int step = - (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 4 : 2; - - /* The alpha channel is the last component: */ - row += step - 1; - - for (; row_width > 0; --row_width, row += step) - *row = table[*row]; - - return; - } - } - - else if (row_info->bit_depth == 16) - { - PNG_CONST png_uint_16pp table = png_ptr->gamma_16_from_1; - PNG_CONST int gamma_shift = png_ptr->gamma_shift; - - if (table != NULL) - { - PNG_CONST int step = - (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 8 : 4; - - /* The alpha channel is the last component: */ - row += step - 2; - - for (; row_width > 0; --row_width, row += step) - { - png_uint_16 v; - - v = table[*(row + 1) >> gamma_shift][*row]; - *row = (png_byte)((v >> 8) & 0xff); - *(row + 1) = (png_byte)(v & 0xff); - } - - return; - } - } - } - - /* Only get to here if called with a weird row_info; no harm has been done, - * so just issue a warning. - */ - png_warning(png_ptr, "png_do_encode_alpha: unexpected call"); -} -#endif - -#ifdef PNG_READ_EXPAND_SUPPORTED -/* Expands a palette row to an RGB or RGBA row depending - * upon whether you supply trans and num_trans. - */ -static void -png_do_expand_palette(png_row_infop row_info, png_bytep row, - png_const_colorp palette, png_const_bytep trans_alpha, int num_trans) -{ - int shift, value; - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_expand_palette"); - - if (row_info->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (row_info->bit_depth < 8) - { - switch (row_info->bit_depth) - { - case 1: - { - sp = row + (png_size_t)((row_width - 1) >> 3); - dp = row + (png_size_t)row_width - 1; - shift = 7 - (int)((row_width + 7) & 0x07); - for (i = 0; i < row_width; i++) - { - if ((*sp >> shift) & 0x01) - *dp = 1; - - else - *dp = 0; - - if (shift == 7) - { - shift = 0; - sp--; - } - - else - shift++; - - dp--; - } - break; - } - - case 2: - { - sp = row + (png_size_t)((row_width - 1) >> 2); - dp = row + (png_size_t)row_width - 1; - shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x03; - *dp = (png_byte)value; - if (shift == 6) - { - shift = 0; - sp--; - } - - else - shift += 2; - - dp--; - } - break; - } - - case 4: - { - sp = row + (png_size_t)((row_width - 1) >> 1); - dp = row + (png_size_t)row_width - 1; - shift = (int)((row_width & 0x01) << 2); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x0f; - *dp = (png_byte)value; - if (shift == 4) - { - shift = 0; - sp--; - } - - else - shift += 4; - - dp--; - } - break; - } - - default: - break; - } - row_info->bit_depth = 8; - row_info->pixel_depth = 8; - row_info->rowbytes = row_width; - } - - if (row_info->bit_depth == 8) - { - { - if (num_trans > 0) - { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width << 2) - 1; - - for (i = 0; i < row_width; i++) - { - if ((int)(*sp) >= num_trans) - *dp-- = 0xff; - - else - *dp-- = trans_alpha[*sp]; - - *dp-- = palette[*sp].blue; - *dp-- = palette[*sp].green; - *dp-- = palette[*sp].red; - sp--; - } - row_info->bit_depth = 8; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - row_info->color_type = 6; - row_info->channels = 4; - } - - else - { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width * 3) - 1; - - for (i = 0; i < row_width; i++) - { - *dp-- = palette[*sp].blue; - *dp-- = palette[*sp].green; - *dp-- = palette[*sp].red; - sp--; - } - - row_info->bit_depth = 8; - row_info->pixel_depth = 24; - row_info->rowbytes = row_width * 3; - row_info->color_type = 2; - row_info->channels = 3; - } - } - } - } -} - -/* If the bit depth < 8, it is expanded to 8. Also, if the already - * expanded transparency value is supplied, an alpha channel is built. - */ -static void -png_do_expand(png_row_infop row_info, png_bytep row, - png_const_color_16p trans_color) -{ - int shift, value; - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_expand"); - - { - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - unsigned int gray = trans_color != NULL ? trans_color->gray : 0; - - if (row_info->bit_depth < 8) - { - switch (row_info->bit_depth) - { - case 1: - { - gray = (gray & 0x01) * 0xff; - sp = row + (png_size_t)((row_width - 1) >> 3); - dp = row + (png_size_t)row_width - 1; - shift = 7 - (int)((row_width + 7) & 0x07); - for (i = 0; i < row_width; i++) - { - if ((*sp >> shift) & 0x01) - *dp = 0xff; - - else - *dp = 0; - - if (shift == 7) - { - shift = 0; - sp--; - } - - else - shift++; - - dp--; - } - break; - } - - case 2: - { - gray = (gray & 0x03) * 0x55; - sp = row + (png_size_t)((row_width - 1) >> 2); - dp = row + (png_size_t)row_width - 1; - shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x03; - *dp = (png_byte)(value | (value << 2) | (value << 4) | - (value << 6)); - if (shift == 6) - { - shift = 0; - sp--; - } - - else - shift += 2; - - dp--; - } - break; - } - - case 4: - { - gray = (gray & 0x0f) * 0x11; - sp = row + (png_size_t)((row_width - 1) >> 1); - dp = row + (png_size_t)row_width - 1; - shift = (int)((1 - ((row_width + 1) & 0x01)) << 2); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x0f; - *dp = (png_byte)(value | (value << 4)); - if (shift == 4) - { - shift = 0; - sp--; - } - - else - shift = 4; - - dp--; - } - break; - } - - default: - break; - } - - row_info->bit_depth = 8; - row_info->pixel_depth = 8; - row_info->rowbytes = row_width; - } - - if (trans_color != NULL) - { - if (row_info->bit_depth == 8) - { - gray = gray & 0xff; - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width << 1) - 1; - - for (i = 0; i < row_width; i++) - { - if ((*sp & 0xffU) == gray) - *dp-- = 0; - - else - *dp-- = 0xff; - - *dp-- = *sp--; - } - } - - else if (row_info->bit_depth == 16) - { - unsigned int gray_high = (gray >> 8) & 0xff; - unsigned int gray_low = gray & 0xff; - sp = row + row_info->rowbytes - 1; - dp = row + (row_info->rowbytes << 1) - 1; - for (i = 0; i < row_width; i++) - { - if ((*(sp - 1) & 0xffU) == gray_high && - (*(sp) & 0xffU) == gray_low) - { - *dp-- = 0; - *dp-- = 0; - } - - else - { - *dp-- = 0xff; - *dp-- = 0xff; - } - - *dp-- = *sp--; - *dp-- = *sp--; - } - } - - row_info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA; - row_info->channels = 2; - row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_width); - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB && - trans_color != NULL) - { - if (row_info->bit_depth == 8) - { - png_byte red = (png_byte)(trans_color->red & 0xff); - png_byte green = (png_byte)(trans_color->green & 0xff); - png_byte blue = (png_byte)(trans_color->blue & 0xff); - sp = row + (png_size_t)row_info->rowbytes - 1; - dp = row + (png_size_t)(row_width << 2) - 1; - for (i = 0; i < row_width; i++) - { - if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue) - *dp-- = 0; - - else - *dp-- = 0xff; - - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - } - } - else if (row_info->bit_depth == 16) - { - png_byte red_high = (png_byte)((trans_color->red >> 8) & 0xff); - png_byte green_high = (png_byte)((trans_color->green >> 8) & 0xff); - png_byte blue_high = (png_byte)((trans_color->blue >> 8) & 0xff); - png_byte red_low = (png_byte)(trans_color->red & 0xff); - png_byte green_low = (png_byte)(trans_color->green & 0xff); - png_byte blue_low = (png_byte)(trans_color->blue & 0xff); - sp = row + row_info->rowbytes - 1; - dp = row + (png_size_t)(row_width << 3) - 1; - for (i = 0; i < row_width; i++) - { - if (*(sp - 5) == red_high && - *(sp - 4) == red_low && - *(sp - 3) == green_high && - *(sp - 2) == green_low && - *(sp - 1) == blue_high && - *(sp ) == blue_low) - { - *dp-- = 0; - *dp-- = 0; - } - - else - { - *dp-- = 0xff; - *dp-- = 0xff; - } - - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - } - } - row_info->color_type = PNG_COLOR_TYPE_RGB_ALPHA; - row_info->channels = 4; - row_info->pixel_depth = (png_byte)(row_info->bit_depth << 2); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } - } -} -#endif - -#ifdef PNG_READ_EXPAND_16_SUPPORTED -/* If the bit depth is 8 and the color type is not a palette type expand the - * whole row to 16 bits. Has no effect otherwise. - */ -static void -png_do_expand_16(png_row_infop row_info, png_bytep row) -{ - if (row_info->bit_depth == 8 && - row_info->color_type != PNG_COLOR_TYPE_PALETTE) - { - /* The row have a sequence of bytes containing [0..255] and we need - * to turn it into another row containing [0..65535], to do this we - * calculate: - * - * (input / 255) * 65535 - * - * Which happens to be exactly input * 257 and this can be achieved - * simply by byte replication in place (copying backwards). - */ - png_byte *sp = row + row_info->rowbytes; /* source, last byte + 1 */ - png_byte *dp = sp + row_info->rowbytes; /* destination, end + 1 */ - while (dp > sp) - dp[-2] = dp[-1] = *--sp, dp -= 2; - - row_info->rowbytes *= 2; - row_info->bit_depth = 16; - row_info->pixel_depth = (png_byte)(row_info->channels * 16); - } -} -#endif - -#ifdef PNG_READ_QUANTIZE_SUPPORTED -static void -png_do_quantize(png_row_infop row_info, png_bytep row, - png_const_bytep palette_lookup, png_const_bytep quantize_lookup) -{ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_quantize"); - - if (row_info->bit_depth == 8) - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB && palette_lookup) - { - int r, g, b, p; - sp = row; - dp = row; - for (i = 0; i < row_width; i++) - { - r = *sp++; - g = *sp++; - b = *sp++; - - /* This looks real messy, but the compiler will reduce - * it down to a reasonable formula. For example, with - * 5 bits per color, we get: - * p = (((r >> 3) & 0x1f) << 10) | - * (((g >> 3) & 0x1f) << 5) | - * ((b >> 3) & 0x1f); - */ - p = (((r >> (8 - PNG_QUANTIZE_RED_BITS)) & - ((1 << PNG_QUANTIZE_RED_BITS) - 1)) << - (PNG_QUANTIZE_GREEN_BITS + PNG_QUANTIZE_BLUE_BITS)) | - (((g >> (8 - PNG_QUANTIZE_GREEN_BITS)) & - ((1 << PNG_QUANTIZE_GREEN_BITS) - 1)) << - (PNG_QUANTIZE_BLUE_BITS)) | - ((b >> (8 - PNG_QUANTIZE_BLUE_BITS)) & - ((1 << PNG_QUANTIZE_BLUE_BITS) - 1)); - - *dp++ = palette_lookup[p]; - } - - row_info->color_type = PNG_COLOR_TYPE_PALETTE; - row_info->channels = 1; - row_info->pixel_depth = row_info->bit_depth; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } - - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA && - palette_lookup != NULL) - { - int r, g, b, p; - sp = row; - dp = row; - for (i = 0; i < row_width; i++) - { - r = *sp++; - g = *sp++; - b = *sp++; - sp++; - - p = (((r >> (8 - PNG_QUANTIZE_RED_BITS)) & - ((1 << PNG_QUANTIZE_RED_BITS) - 1)) << - (PNG_QUANTIZE_GREEN_BITS + PNG_QUANTIZE_BLUE_BITS)) | - (((g >> (8 - PNG_QUANTIZE_GREEN_BITS)) & - ((1 << PNG_QUANTIZE_GREEN_BITS) - 1)) << - (PNG_QUANTIZE_BLUE_BITS)) | - ((b >> (8 - PNG_QUANTIZE_BLUE_BITS)) & - ((1 << PNG_QUANTIZE_BLUE_BITS) - 1)); - - *dp++ = palette_lookup[p]; - } - - row_info->color_type = PNG_COLOR_TYPE_PALETTE; - row_info->channels = 1; - row_info->pixel_depth = row_info->bit_depth; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } - - else if (row_info->color_type == PNG_COLOR_TYPE_PALETTE && - quantize_lookup) - { - sp = row; - - for (i = 0; i < row_width; i++, sp++) - { - *sp = quantize_lookup[*sp]; - } - } - } -} -#endif /* READ_QUANTIZE */ - -/* Transform the row. The order of transformations is significant, - * and is very touchy. If you add a transformation, take care to - * decide how it fits in with the other transformations here. - */ -void /* PRIVATE */ -png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info) -{ - png_debug(1, "in png_do_read_transformations"); - - if (png_ptr->row_buf == NULL) - { - /* Prior to 1.5.4 this output row/pass where the NULL pointer is, but this - * error is incredibly rare and incredibly easy to debug without this - * information. - */ - png_error(png_ptr, "NULL row buffer"); - } - - /* The following is debugging; prior to 1.5.4 the code was never compiled in; - * in 1.5.4 PNG_FLAG_DETECT_UNINITIALIZED was added and the macro - * PNG_WARN_UNINITIALIZED_ROW removed. In 1.6 the new flag is set only for - * all transformations, however in practice the ROW_INIT always gets done on - * demand, if necessary. - */ - if ((png_ptr->flags & PNG_FLAG_DETECT_UNINITIALIZED) != 0 && - (png_ptr->flags & PNG_FLAG_ROW_INIT) == 0) - { - /* Application has failed to call either png_read_start_image() or - * png_read_update_info() after setting transforms that expand pixels. - * This check added to libpng-1.2.19 (but not enabled until 1.5.4). - */ - png_error(png_ptr, "Uninitialized row"); - } - -#ifdef PNG_READ_EXPAND_SUPPORTED - if ((png_ptr->transformations & PNG_EXPAND) != 0) - { - if (row_info->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_do_expand_palette(row_info, png_ptr->row_buf + 1, - png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans); - } - - else - { - if (png_ptr->num_trans != 0 && - (png_ptr->transformations & PNG_EXPAND_tRNS) != 0) - png_do_expand(row_info, png_ptr->row_buf + 1, - &(png_ptr->trans_color)); - - else - png_do_expand(row_info, png_ptr->row_buf + 1, - NULL); - } - } -#endif - -#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED - if ((png_ptr->transformations & PNG_STRIP_ALPHA) != 0 && - (png_ptr->transformations & PNG_COMPOSE) == 0 && - (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA || - row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)) - png_do_strip_channel(row_info, png_ptr->row_buf + 1, - 0 /* at_start == false, because SWAP_ALPHA happens later */); -#endif - -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) != 0) - { - int rgb_error = - png_do_rgb_to_gray(png_ptr, row_info, - png_ptr->row_buf + 1); - - if (rgb_error != 0) - { - png_ptr->rgb_to_gray_status=1; - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == - PNG_RGB_TO_GRAY_WARN) - png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel"); - - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == - PNG_RGB_TO_GRAY_ERR) - png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel"); - } - } -#endif - -/* From Andreas Dilger e-mail to png-implement, 26 March 1998: - * - * In most cases, the "simple transparency" should be done prior to doing - * gray-to-RGB, or you will have to test 3x as many bytes to check if a - * pixel is transparent. You would also need to make sure that the - * transparency information is upgraded to RGB. - * - * To summarize, the current flow is: - * - Gray + simple transparency -> compare 1 or 2 gray bytes and composite - * with background "in place" if transparent, - * convert to RGB if necessary - * - Gray + alpha -> composite with gray background and remove alpha bytes, - * convert to RGB if necessary - * - * To support RGB backgrounds for gray images we need: - * - Gray + simple transparency -> convert to RGB + simple transparency, - * compare 3 or 6 bytes and composite with - * background "in place" if transparent - * (3x compare/pixel compared to doing - * composite with gray bkgrnd) - * - Gray + alpha -> convert to RGB + alpha, composite with background and - * remove alpha bytes (3x float - * operations/pixel compared with composite - * on gray background) - * - * Greg's change will do this. The reason it wasn't done before is for - * performance, as this increases the per-pixel operations. If we would check - * in advance if the background was gray or RGB, and position the gray-to-RGB - * transform appropriately, then it would save a lot of work/time. - */ - -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED - /* If gray -> RGB, do so now only if background is non-gray; else do later - * for performance reasons - */ - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) != 0 && - (png_ptr->mode & PNG_BACKGROUND_IS_GRAY) == 0) - png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ - defined(PNG_READ_ALPHA_MODE_SUPPORTED) - if ((png_ptr->transformations & PNG_COMPOSE) != 0) - png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr); -#endif - -#ifdef PNG_READ_GAMMA_SUPPORTED - if ((png_ptr->transformations & PNG_GAMMA) != 0 && -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED - /* Because RGB_TO_GRAY does the gamma transform. */ - (png_ptr->transformations & PNG_RGB_TO_GRAY) == 0 && -#endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ - defined(PNG_READ_ALPHA_MODE_SUPPORTED) - /* Because PNG_COMPOSE does the gamma transform if there is something to - * do (if there is an alpha channel or transparency.) - */ - !((png_ptr->transformations & PNG_COMPOSE) != 0 && - ((png_ptr->num_trans != 0) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0)) && -#endif - /* Because png_init_read_transformations transforms the palette, unless - * RGB_TO_GRAY will do the transform. - */ - (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)) - png_do_gamma(row_info, png_ptr->row_buf + 1, png_ptr); -#endif - -#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED - if ((png_ptr->transformations & PNG_STRIP_ALPHA) != 0 && - (png_ptr->transformations & PNG_COMPOSE) != 0 && - (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA || - row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)) - png_do_strip_channel(row_info, png_ptr->row_buf + 1, - 0 /* at_start == false, because SWAP_ALPHA happens later */); -#endif - -#ifdef PNG_READ_ALPHA_MODE_SUPPORTED - if ((png_ptr->transformations & PNG_ENCODE_ALPHA) != 0 && - (row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0) - png_do_encode_alpha(row_info, png_ptr->row_buf + 1, png_ptr); -#endif - -#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED - if ((png_ptr->transformations & PNG_SCALE_16_TO_8) != 0) - png_do_scale_16_to_8(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED - /* There is no harm in doing both of these because only one has any effect, - * by putting the 'scale' option first if the app asks for scale (either by - * calling the API or in a TRANSFORM flag) this is what happens. - */ - if ((png_ptr->transformations & PNG_16_TO_8) != 0) - png_do_chop(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_QUANTIZE_SUPPORTED - if ((png_ptr->transformations & PNG_QUANTIZE) != 0) - { - png_do_quantize(row_info, png_ptr->row_buf + 1, - png_ptr->palette_lookup, png_ptr->quantize_index); - - if (row_info->rowbytes == 0) - png_error(png_ptr, "png_do_quantize returned rowbytes=0"); - } -#endif /* READ_QUANTIZE */ - -#ifdef PNG_READ_EXPAND_16_SUPPORTED - /* Do the expansion now, after all the arithmetic has been done. Notice - * that previous transformations can handle the PNG_EXPAND_16 flag if this - * is efficient (particularly true in the case of gamma correction, where - * better accuracy results faster!) - */ - if ((png_ptr->transformations & PNG_EXPAND_16) != 0) - png_do_expand_16(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED - /* NOTE: moved here in 1.5.4 (from much later in this list.) */ - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) != 0 && - (png_ptr->mode & PNG_BACKGROUND_IS_GRAY) != 0) - png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_INVERT_SUPPORTED - if ((png_ptr->transformations & PNG_INVERT_MONO) != 0) - png_do_invert(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED - if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0) - png_do_read_invert_alpha(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_SHIFT_SUPPORTED - if ((png_ptr->transformations & PNG_SHIFT) != 0) - png_do_unshift(row_info, png_ptr->row_buf + 1, - &(png_ptr->shift)); -#endif - -#ifdef PNG_READ_PACK_SUPPORTED - if ((png_ptr->transformations & PNG_PACK) != 0) - png_do_unpack(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED - /* Added at libpng-1.5.10 */ - if (row_info->color_type == PNG_COLOR_TYPE_PALETTE && - png_ptr->num_palette_max >= 0) - png_do_check_palette_indexes(png_ptr, row_info); -#endif - -#ifdef PNG_READ_BGR_SUPPORTED - if ((png_ptr->transformations & PNG_BGR) != 0) - png_do_bgr(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_PACKSWAP_SUPPORTED - if ((png_ptr->transformations & PNG_PACKSWAP) != 0) - png_do_packswap(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_FILLER_SUPPORTED - if ((png_ptr->transformations & PNG_FILLER) != 0) - png_do_read_filler(row_info, png_ptr->row_buf + 1, - (png_uint_32)png_ptr->filler, png_ptr->flags); -#endif - -#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED - if ((png_ptr->transformations & PNG_SWAP_ALPHA) != 0) - png_do_read_swap_alpha(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_READ_16BIT_SUPPORTED -#ifdef PNG_READ_SWAP_SUPPORTED - if ((png_ptr->transformations & PNG_SWAP_BYTES) != 0) - png_do_swap(row_info, png_ptr->row_buf + 1); -#endif -#endif - -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - if ((png_ptr->transformations & PNG_USER_TRANSFORM) != 0) - { - if (png_ptr->read_user_transform_fn != NULL) - (*(png_ptr->read_user_transform_fn)) /* User read transform function */ - (png_ptr, /* png_ptr */ - row_info, /* row_info: */ - /* png_uint_32 width; width of row */ - /* png_size_t rowbytes; number of bytes in row */ - /* png_byte color_type; color type of pixels */ - /* png_byte bit_depth; bit depth of samples */ - /* png_byte channels; number of channels (1-4) */ - /* png_byte pixel_depth; bits per pixel (depth*channels) */ - png_ptr->row_buf + 1); /* start of pixel data for row */ -#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED - if (png_ptr->user_transform_depth != 0) - row_info->bit_depth = png_ptr->user_transform_depth; - - if (png_ptr->user_transform_channels != 0) - row_info->channels = png_ptr->user_transform_channels; -#endif - row_info->pixel_depth = (png_byte)(row_info->bit_depth * - row_info->channels); - - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_info->width); - } -#endif -} - -#endif /* READ_TRANSFORMS */ -#endif /* READ */ diff --git a/jan/src/dep/libs/libpng/pngrutil.c b/jan/src/dep/libs/libpng/pngrutil.c deleted file mode 100644 index 225c2a458..000000000 --- a/jan/src/dep/libs/libpng/pngrutil.c +++ /dev/null @@ -1,4538 +0,0 @@ - -/* pngrutil.c - utilities to read a PNG file - * - * Last changed in libpng 1.6.27 [January 5, 2017] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - * This file contains routines that are only called from within - * libpng itself during the course of reading an image. - */ - -#include "pngpriv.h" - -#ifdef PNG_READ_SUPPORTED - -png_uint_32 PNGAPI -png_get_uint_31(png_const_structrp png_ptr, png_const_bytep buf) -{ - png_uint_32 uval = png_get_uint_32(buf); - - if (uval > PNG_UINT_31_MAX) - png_error(png_ptr, "PNG unsigned integer out of range"); - - return (uval); -} - -#if defined(PNG_READ_gAMA_SUPPORTED) || defined(PNG_READ_cHRM_SUPPORTED) -/* The following is a variation on the above for use with the fixed - * point values used for gAMA and cHRM. Instead of png_error it - * issues a warning and returns (-1) - an invalid value because both - * gAMA and cHRM use *unsigned* integers for fixed point values. - */ -#define PNG_FIXED_ERROR (-1) - -static png_fixed_point /* PRIVATE */ -png_get_fixed_point(png_structrp png_ptr, png_const_bytep buf) -{ - png_uint_32 uval = png_get_uint_32(buf); - - if (uval <= PNG_UINT_31_MAX) - return (png_fixed_point)uval; /* known to be in range */ - - /* The caller can turn off the warning by passing NULL. */ - if (png_ptr != NULL) - png_warning(png_ptr, "PNG fixed point integer out of range"); - - return PNG_FIXED_ERROR; -} -#endif - -#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED -/* NOTE: the read macros will obscure these definitions, so that if - * PNG_USE_READ_MACROS is set the library will not use them internally, - * but the APIs will still be available externally. - * - * The parentheses around "PNGAPI function_name" in the following three - * functions are necessary because they allow the macros to co-exist with - * these (unused but exported) functions. - */ - -/* Grab an unsigned 32-bit integer from a buffer in big-endian format. */ -png_uint_32 (PNGAPI -png_get_uint_32)(png_const_bytep buf) -{ - png_uint_32 uval = - ((png_uint_32)(*(buf )) << 24) + - ((png_uint_32)(*(buf + 1)) << 16) + - ((png_uint_32)(*(buf + 2)) << 8) + - ((png_uint_32)(*(buf + 3)) ) ; - - return uval; -} - -/* Grab a signed 32-bit integer from a buffer in big-endian format. The - * data is stored in the PNG file in two's complement format and there - * is no guarantee that a 'png_int_32' is exactly 32 bits, therefore - * the following code does a two's complement to native conversion. - */ -png_int_32 (PNGAPI -png_get_int_32)(png_const_bytep buf) -{ - png_uint_32 uval = png_get_uint_32(buf); - if ((uval & 0x80000000) == 0) /* non-negative */ - return (png_int_32)uval; - - uval = (uval ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */ - if ((uval & 0x80000000) == 0) /* no overflow */ - return -(png_int_32)uval; - /* The following has to be safe; this function only gets called on PNG data - * and if we get here that data is invalid. 0 is the most safe value and - * if not then an attacker would surely just generate a PNG with 0 instead. - */ - return 0; -} - -/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */ -png_uint_16 (PNGAPI -png_get_uint_16)(png_const_bytep buf) -{ - /* ANSI-C requires an int value to accomodate at least 16 bits so this - * works and allows the compiler not to worry about possible narrowing - * on 32-bit systems. (Pre-ANSI systems did not make integers smaller - * than 16 bits either.) - */ - unsigned int val = - ((unsigned int)(*buf) << 8) + - ((unsigned int)(*(buf + 1))); - - return (png_uint_16)val; -} - -#endif /* READ_INT_FUNCTIONS */ - -/* Read and check the PNG file signature */ -void /* PRIVATE */ -png_read_sig(png_structrp png_ptr, png_inforp info_ptr) -{ - png_size_t num_checked, num_to_check; - - /* Exit if the user application does not expect a signature. */ - if (png_ptr->sig_bytes >= 8) - return; - - num_checked = png_ptr->sig_bytes; - num_to_check = 8 - num_checked; - -#ifdef PNG_IO_STATE_SUPPORTED - png_ptr->io_state = PNG_IO_READING | PNG_IO_SIGNATURE; -#endif - - /* The signature must be serialized in a single I/O call. */ - png_read_data(png_ptr, &(info_ptr->signature[num_checked]), num_to_check); - png_ptr->sig_bytes = 8; - - if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check) != 0) - { - if (num_checked < 4 && - png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) - png_error(png_ptr, "Not a PNG file"); - else - png_error(png_ptr, "PNG file corrupted by ASCII conversion"); - } - if (num_checked < 3) - png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; -} - -/* Read the chunk header (length + type name). - * Put the type name into png_ptr->chunk_name, and return the length. - */ -png_uint_32 /* PRIVATE */ -png_read_chunk_header(png_structrp png_ptr) -{ - png_byte buf[8]; - png_uint_32 length; - -#ifdef PNG_IO_STATE_SUPPORTED - png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_HDR; -#endif - - /* Read the length and the chunk name. - * This must be performed in a single I/O call. - */ - png_read_data(png_ptr, buf, 8); - length = png_get_uint_31(png_ptr, buf); - - /* Put the chunk name into png_ptr->chunk_name. */ - png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(buf+4); - - png_debug2(0, "Reading %lx chunk, length = %lu", - (unsigned long)png_ptr->chunk_name, (unsigned long)length); - - /* Reset the crc and run it over the chunk name. */ - png_reset_crc(png_ptr); - png_calculate_crc(png_ptr, buf + 4, 4); - - /* Check to see if chunk name is valid. */ - png_check_chunk_name(png_ptr, png_ptr->chunk_name); - -#ifdef PNG_IO_STATE_SUPPORTED - png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_DATA; -#endif - - return length; -} - -/* Read data, and (optionally) run it through the CRC. */ -void /* PRIVATE */ -png_crc_read(png_structrp png_ptr, png_bytep buf, png_uint_32 length) -{ - if (png_ptr == NULL) - return; - - png_read_data(png_ptr, buf, length); - png_calculate_crc(png_ptr, buf, length); -} - -/* Optionally skip data and then check the CRC. Depending on whether we - * are reading an ancillary or critical chunk, and how the program has set - * things up, we may calculate the CRC on the data and print a message. - * Returns '1' if there was a CRC error, '0' otherwise. - */ -int /* PRIVATE */ -png_crc_finish(png_structrp png_ptr, png_uint_32 skip) -{ - /* The size of the local buffer for inflate is a good guess as to a - * reasonable size to use for buffering reads from the application. - */ - while (skip > 0) - { - png_uint_32 len; - png_byte tmpbuf[PNG_INFLATE_BUF_SIZE]; - - len = (sizeof tmpbuf); - if (len > skip) - len = skip; - skip -= len; - - png_crc_read(png_ptr, tmpbuf, len); - } - - if (png_crc_error(png_ptr) != 0) - { - if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name) != 0 ? - (png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) == 0 : - (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE) != 0) - { - png_chunk_warning(png_ptr, "CRC error"); - } - - else - png_chunk_error(png_ptr, "CRC error"); - - return (1); - } - - return (0); -} - -/* Compare the CRC stored in the PNG file with that calculated by libpng from - * the data it has read thus far. - */ -int /* PRIVATE */ -png_crc_error(png_structrp png_ptr) -{ - png_byte crc_bytes[4]; - png_uint_32 crc; - int need_crc = 1; - - if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name) != 0) - { - if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) == - (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN)) - need_crc = 0; - } - - else /* critical */ - { - if ((png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) != 0) - need_crc = 0; - } - -#ifdef PNG_IO_STATE_SUPPORTED - png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_CRC; -#endif - - /* The chunk CRC must be serialized in a single I/O call. */ - png_read_data(png_ptr, crc_bytes, 4); - - if (need_crc != 0) - { - crc = png_get_uint_32(crc_bytes); - return ((int)(crc != png_ptr->crc)); - } - - else - return (0); -} - -#if defined(PNG_READ_iCCP_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) ||\ - defined(PNG_READ_pCAL_SUPPORTED) || defined(PNG_READ_sCAL_SUPPORTED) ||\ - defined(PNG_READ_sPLT_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) ||\ - defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_SEQUENTIAL_READ_SUPPORTED) -/* Manage the read buffer; this simply reallocates the buffer if it is not small - * enough (or if it is not allocated). The routine returns a pointer to the - * buffer; if an error occurs and 'warn' is set the routine returns NULL, else - * it will call png_error (via png_malloc) on failure. (warn == 2 means - * 'silent'). - */ -static png_bytep -png_read_buffer(png_structrp png_ptr, png_alloc_size_t new_size, int warn) -{ - png_bytep buffer = png_ptr->read_buffer; - - if (buffer != NULL && new_size > png_ptr->read_buffer_size) - { - png_ptr->read_buffer = NULL; - png_ptr->read_buffer = NULL; - png_ptr->read_buffer_size = 0; - png_free(png_ptr, buffer); - buffer = NULL; - } - - if (buffer == NULL) - { - buffer = png_voidcast(png_bytep, png_malloc_base(png_ptr, new_size)); - - if (buffer != NULL) - { - png_ptr->read_buffer = buffer; - png_ptr->read_buffer_size = new_size; - } - - else if (warn < 2) /* else silent */ - { - if (warn != 0) - png_chunk_warning(png_ptr, "insufficient memory to read chunk"); - - else - png_chunk_error(png_ptr, "insufficient memory to read chunk"); - } - } - - return buffer; -} -#endif /* READ_iCCP|iTXt|pCAL|sCAL|sPLT|tEXt|zTXt|SEQUENTIAL_READ */ - -/* png_inflate_claim: claim the zstream for some nefarious purpose that involves - * decompression. Returns Z_OK on success, else a zlib error code. It checks - * the owner but, in final release builds, just issues a warning if some other - * chunk apparently owns the stream. Prior to release it does a png_error. - */ -static int -png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) -{ - if (png_ptr->zowner != 0) - { - char msg[64]; - - PNG_STRING_FROM_CHUNK(msg, png_ptr->zowner); - /* So the message that results is " using zstream"; this is an - * internal error, but is very useful for debugging. i18n requirements - * are minimal. - */ - (void)png_safecat(msg, (sizeof msg), 4, " using zstream"); -#if PNG_RELEASE_BUILD - png_chunk_warning(png_ptr, msg); - png_ptr->zowner = 0; -#else - png_chunk_error(png_ptr, msg); -#endif - } - - /* Implementation note: unlike 'png_deflate_claim' this internal function - * does not take the size of the data as an argument. Some efficiency could - * be gained by using this when it is known *if* the zlib stream itself does - * not record the number; however, this is an illusion: the original writer - * of the PNG may have selected a lower window size, and we really must - * follow that because, for systems with with limited capabilities, we - * would otherwise reject the application's attempts to use a smaller window - * size (zlib doesn't have an interface to say "this or lower"!). - * - * inflateReset2 was added to zlib 1.2.4; before this the window could not be - * reset, therefore it is necessary to always allocate the maximum window - * size with earlier zlibs just in case later compressed chunks need it. - */ - { - int ret; /* zlib return code */ -#if ZLIB_VERNUM >= 0x1240 - int window_bits = 0; - -# if defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_MAXIMUM_INFLATE_WINDOW) - if (((png_ptr->options >> PNG_MAXIMUM_INFLATE_WINDOW) & 3) == - PNG_OPTION_ON) - { - window_bits = 15; - png_ptr->zstream_start = 0; /* fixed window size */ - } - - else - { - png_ptr->zstream_start = 1; - } -# endif - -#endif /* ZLIB_VERNUM >= 0x1240 */ - - /* Set this for safety, just in case the previous owner left pointers to - * memory allocations. - */ - png_ptr->zstream.next_in = NULL; - png_ptr->zstream.avail_in = 0; - png_ptr->zstream.next_out = NULL; - png_ptr->zstream.avail_out = 0; - - if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0) - { -#if ZLIB_VERNUM >= 0x1240 - ret = inflateReset2(&png_ptr->zstream, window_bits); -#else - ret = inflateReset(&png_ptr->zstream); -#endif - } - - else - { -#if ZLIB_VERNUM >= 0x1240 - ret = inflateInit2(&png_ptr->zstream, window_bits); -#else - ret = inflateInit(&png_ptr->zstream); -#endif - - if (ret == Z_OK) - png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED; - } - -#if ZLIB_VERNUM >= 0x1281 && \ - defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32) - if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON) - /* Turn off validation of the ADLER32 checksum in IDAT chunks */ - ret = inflateValidate(&png_ptr->zstream, 0); -#endif - - if (ret == Z_OK) - png_ptr->zowner = owner; - - else - png_zstream_error(png_ptr, ret); - - return ret; - } - -#ifdef window_bits -# undef window_bits -#endif -} - -#if ZLIB_VERNUM >= 0x1240 -/* Handle the start of the inflate stream if we called inflateInit2(strm,0); - * in this case some zlib versions skip validation of the CINFO field and, in - * certain circumstances, libpng may end up displaying an invalid image, in - * contrast to implementations that call zlib in the normal way (e.g. libpng - * 1.5). - */ -int /* PRIVATE */ -png_zlib_inflate(png_structrp png_ptr, int flush) -{ - if (png_ptr->zstream_start && png_ptr->zstream.avail_in > 0) - { - if ((*png_ptr->zstream.next_in >> 4) > 7) - { - png_ptr->zstream.msg = "invalid window size (libpng)"; - return Z_DATA_ERROR; - } - - png_ptr->zstream_start = 0; - } - - return inflate(&png_ptr->zstream, flush); -} -#endif /* Zlib >= 1.2.4 */ - -#ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED -#if defined(PNG_READ_zTXt_SUPPORTED) || defined (PNG_READ_iTXt_SUPPORTED) -/* png_inflate now returns zlib error codes including Z_OK and Z_STREAM_END to - * allow the caller to do multiple calls if required. If the 'finish' flag is - * set Z_FINISH will be passed to the final inflate() call and Z_STREAM_END must - * be returned or there has been a problem, otherwise Z_SYNC_FLUSH is used and - * Z_OK or Z_STREAM_END will be returned on success. - * - * The input and output sizes are updated to the actual amounts of data consumed - * or written, not the amount available (as in a z_stream). The data pointers - * are not changed, so the next input is (data+input_size) and the next - * available output is (output+output_size). - */ -static int -png_inflate(png_structrp png_ptr, png_uint_32 owner, int finish, - /* INPUT: */ png_const_bytep input, png_uint_32p input_size_ptr, - /* OUTPUT: */ png_bytep output, png_alloc_size_t *output_size_ptr) -{ - if (png_ptr->zowner == owner) /* Else not claimed */ - { - int ret; - png_alloc_size_t avail_out = *output_size_ptr; - png_uint_32 avail_in = *input_size_ptr; - - /* zlib can't necessarily handle more than 65535 bytes at once (i.e. it - * can't even necessarily handle 65536 bytes) because the type uInt is - * "16 bits or more". Consequently it is necessary to chunk the input to - * zlib. This code uses ZLIB_IO_MAX, from pngpriv.h, as the maximum (the - * maximum value that can be stored in a uInt.) It is possible to set - * ZLIB_IO_MAX to a lower value in pngpriv.h and this may sometimes have - * a performance advantage, because it reduces the amount of data accessed - * at each step and that may give the OS more time to page it in. - */ - png_ptr->zstream.next_in = PNGZ_INPUT_CAST(input); - /* avail_in and avail_out are set below from 'size' */ - png_ptr->zstream.avail_in = 0; - png_ptr->zstream.avail_out = 0; - - /* Read directly into the output if it is available (this is set to - * a local buffer below if output is NULL). - */ - if (output != NULL) - png_ptr->zstream.next_out = output; - - do - { - uInt avail; - Byte local_buffer[PNG_INFLATE_BUF_SIZE]; - - /* zlib INPUT BUFFER */ - /* The setting of 'avail_in' used to be outside the loop; by setting it - * inside it is possible to chunk the input to zlib and simply rely on - * zlib to advance the 'next_in' pointer. This allows arbitrary - * amounts of data to be passed through zlib at the unavoidable cost of - * requiring a window save (memcpy of up to 32768 output bytes) - * every ZLIB_IO_MAX input bytes. - */ - avail_in += png_ptr->zstream.avail_in; /* not consumed last time */ - - avail = ZLIB_IO_MAX; - - if (avail_in < avail) - avail = (uInt)avail_in; /* safe: < than ZLIB_IO_MAX */ - - avail_in -= avail; - png_ptr->zstream.avail_in = avail; - - /* zlib OUTPUT BUFFER */ - avail_out += png_ptr->zstream.avail_out; /* not written last time */ - - avail = ZLIB_IO_MAX; /* maximum zlib can process */ - - if (output == NULL) - { - /* Reset the output buffer each time round if output is NULL and - * make available the full buffer, up to 'remaining_space' - */ - png_ptr->zstream.next_out = local_buffer; - if ((sizeof local_buffer) < avail) - avail = (sizeof local_buffer); - } - - if (avail_out < avail) - avail = (uInt)avail_out; /* safe: < ZLIB_IO_MAX */ - - png_ptr->zstream.avail_out = avail; - avail_out -= avail; - - /* zlib inflate call */ - /* In fact 'avail_out' may be 0 at this point, that happens at the end - * of the read when the final LZ end code was not passed at the end of - * the previous chunk of input data. Tell zlib if we have reached the - * end of the output buffer. - */ - ret = PNG_INFLATE(png_ptr, avail_out > 0 ? Z_NO_FLUSH : - (finish ? Z_FINISH : Z_SYNC_FLUSH)); - } while (ret == Z_OK); - - /* For safety kill the local buffer pointer now */ - if (output == NULL) - png_ptr->zstream.next_out = NULL; - - /* Claw back the 'size' and 'remaining_space' byte counts. */ - avail_in += png_ptr->zstream.avail_in; - avail_out += png_ptr->zstream.avail_out; - - /* Update the input and output sizes; the updated values are the amount - * consumed or written, effectively the inverse of what zlib uses. - */ - if (avail_out > 0) - *output_size_ptr -= avail_out; - - if (avail_in > 0) - *input_size_ptr -= avail_in; - - /* Ensure png_ptr->zstream.msg is set (even in the success case!) */ - png_zstream_error(png_ptr, ret); - return ret; - } - - else - { - /* This is a bad internal error. The recovery assigns to the zstream msg - * pointer, which is not owned by the caller, but this is safe; it's only - * used on errors! - */ - png_ptr->zstream.msg = PNGZ_MSG_CAST("zstream unclaimed"); - return Z_STREAM_ERROR; - } -} - -/* - * Decompress trailing data in a chunk. The assumption is that read_buffer - * points at an allocated area holding the contents of a chunk with a - * trailing compressed part. What we get back is an allocated area - * holding the original prefix part and an uncompressed version of the - * trailing part (the malloc area passed in is freed). - */ -static int -png_decompress_chunk(png_structrp png_ptr, - png_uint_32 chunklength, png_uint_32 prefix_size, - png_alloc_size_t *newlength /* must be initialized to the maximum! */, - int terminate /*add a '\0' to the end of the uncompressed data*/) -{ - /* TODO: implement different limits for different types of chunk. - * - * The caller supplies *newlength set to the maximum length of the - * uncompressed data, but this routine allocates space for the prefix and - * maybe a '\0' terminator too. We have to assume that 'prefix_size' is - * limited only by the maximum chunk size. - */ - png_alloc_size_t limit = PNG_SIZE_MAX; - -# ifdef PNG_SET_USER_LIMITS_SUPPORTED - if (png_ptr->user_chunk_malloc_max > 0 && - png_ptr->user_chunk_malloc_max < limit) - limit = png_ptr->user_chunk_malloc_max; -# elif PNG_USER_CHUNK_MALLOC_MAX > 0 - if (PNG_USER_CHUNK_MALLOC_MAX < limit) - limit = PNG_USER_CHUNK_MALLOC_MAX; -# endif - - if (limit >= prefix_size + (terminate != 0)) - { - int ret; - - limit -= prefix_size + (terminate != 0); - - if (limit < *newlength) - *newlength = limit; - - /* Now try to claim the stream. */ - ret = png_inflate_claim(png_ptr, png_ptr->chunk_name); - - if (ret == Z_OK) - { - png_uint_32 lzsize = chunklength - prefix_size; - - ret = png_inflate(png_ptr, png_ptr->chunk_name, 1/*finish*/, - /* input: */ png_ptr->read_buffer + prefix_size, &lzsize, - /* output: */ NULL, newlength); - - if (ret == Z_STREAM_END) - { - /* Use 'inflateReset' here, not 'inflateReset2' because this - * preserves the previously decided window size (otherwise it would - * be necessary to store the previous window size.) In practice - * this doesn't matter anyway, because png_inflate will call inflate - * with Z_FINISH in almost all cases, so the window will not be - * maintained. - */ - if (inflateReset(&png_ptr->zstream) == Z_OK) - { - /* Because of the limit checks above we know that the new, - * expanded, size will fit in a size_t (let alone an - * png_alloc_size_t). Use png_malloc_base here to avoid an - * extra OOM message. - */ - png_alloc_size_t new_size = *newlength; - png_alloc_size_t buffer_size = prefix_size + new_size + - (terminate != 0); - png_bytep text = png_voidcast(png_bytep, png_malloc_base(png_ptr, - buffer_size)); - - if (text != NULL) - { - ret = png_inflate(png_ptr, png_ptr->chunk_name, 1/*finish*/, - png_ptr->read_buffer + prefix_size, &lzsize, - text + prefix_size, newlength); - - if (ret == Z_STREAM_END) - { - if (new_size == *newlength) - { - if (terminate != 0) - text[prefix_size + *newlength] = 0; - - if (prefix_size > 0) - memcpy(text, png_ptr->read_buffer, prefix_size); - - { - png_bytep old_ptr = png_ptr->read_buffer; - - png_ptr->read_buffer = text; - png_ptr->read_buffer_size = buffer_size; - text = old_ptr; /* freed below */ - } - } - - else - { - /* The size changed on the second read, there can be no - * guarantee that anything is correct at this point. - * The 'msg' pointer has been set to "unexpected end of - * LZ stream", which is fine, but return an error code - * that the caller won't accept. - */ - ret = PNG_UNEXPECTED_ZLIB_RETURN; - } - } - - else if (ret == Z_OK) - ret = PNG_UNEXPECTED_ZLIB_RETURN; /* for safety */ - - /* Free the text pointer (this is the old read_buffer on - * success) - */ - png_free(png_ptr, text); - - /* This really is very benign, but it's still an error because - * the extra space may otherwise be used as a Trojan Horse. - */ - if (ret == Z_STREAM_END && - chunklength - prefix_size != lzsize) - png_chunk_benign_error(png_ptr, "extra compressed data"); - } - - else - { - /* Out of memory allocating the buffer */ - ret = Z_MEM_ERROR; - png_zstream_error(png_ptr, Z_MEM_ERROR); - } - } - - else - { - /* inflateReset failed, store the error message */ - png_zstream_error(png_ptr, ret); - - if (ret == Z_STREAM_END) - ret = PNG_UNEXPECTED_ZLIB_RETURN; - } - } - - else if (ret == Z_OK) - ret = PNG_UNEXPECTED_ZLIB_RETURN; - - /* Release the claimed stream */ - png_ptr->zowner = 0; - } - - else /* the claim failed */ if (ret == Z_STREAM_END) /* impossible! */ - ret = PNG_UNEXPECTED_ZLIB_RETURN; - - return ret; - } - - else - { - /* Application/configuration limits exceeded */ - png_zstream_error(png_ptr, Z_MEM_ERROR); - return Z_MEM_ERROR; - } -} -#endif /* READ_zTXt || READ_iTXt */ -#endif /* READ_COMPRESSED_TEXT */ - -#ifdef PNG_READ_iCCP_SUPPORTED -/* Perform a partial read and decompress, producing 'avail_out' bytes and - * reading from the current chunk as required. - */ -static int -png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size, - png_uint_32p chunk_bytes, png_bytep next_out, png_alloc_size_t *out_size, - int finish) -{ - if (png_ptr->zowner == png_ptr->chunk_name) - { - int ret; - - /* next_in and avail_in must have been initialized by the caller. */ - png_ptr->zstream.next_out = next_out; - png_ptr->zstream.avail_out = 0; /* set in the loop */ - - do - { - if (png_ptr->zstream.avail_in == 0) - { - if (read_size > *chunk_bytes) - read_size = (uInt)*chunk_bytes; - *chunk_bytes -= read_size; - - if (read_size > 0) - png_crc_read(png_ptr, read_buffer, read_size); - - png_ptr->zstream.next_in = read_buffer; - png_ptr->zstream.avail_in = read_size; - } - - if (png_ptr->zstream.avail_out == 0) - { - uInt avail = ZLIB_IO_MAX; - if (avail > *out_size) - avail = (uInt)*out_size; - *out_size -= avail; - - png_ptr->zstream.avail_out = avail; - } - - /* Use Z_SYNC_FLUSH when there is no more chunk data to ensure that all - * the available output is produced; this allows reading of truncated - * streams. - */ - ret = PNG_INFLATE(png_ptr, *chunk_bytes > 0 ? - Z_NO_FLUSH : (finish ? Z_FINISH : Z_SYNC_FLUSH)); - } - while (ret == Z_OK && (*out_size > 0 || png_ptr->zstream.avail_out > 0)); - - *out_size += png_ptr->zstream.avail_out; - png_ptr->zstream.avail_out = 0; /* Should not be required, but is safe */ - - /* Ensure the error message pointer is always set: */ - png_zstream_error(png_ptr, ret); - return ret; - } - - else - { - png_ptr->zstream.msg = PNGZ_MSG_CAST("zstream unclaimed"); - return Z_STREAM_ERROR; - } -} -#endif /* READ_iCCP */ - -/* Read and check the IDHR chunk */ - -void /* PRIVATE */ -png_handle_IHDR(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_byte buf[13]; - png_uint_32 width, height; - int bit_depth, color_type, compression_type, filter_type; - int interlace_type; - - png_debug(1, "in png_handle_IHDR"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) != 0) - png_chunk_error(png_ptr, "out of place"); - - /* Check the length */ - if (length != 13) - png_chunk_error(png_ptr, "invalid"); - - png_ptr->mode |= PNG_HAVE_IHDR; - - png_crc_read(png_ptr, buf, 13); - png_crc_finish(png_ptr, 0); - - width = png_get_uint_31(png_ptr, buf); - height = png_get_uint_31(png_ptr, buf + 4); - bit_depth = buf[8]; - color_type = buf[9]; - compression_type = buf[10]; - filter_type = buf[11]; - interlace_type = buf[12]; - - /* Set internal variables */ - png_ptr->width = width; - png_ptr->height = height; - png_ptr->bit_depth = (png_byte)bit_depth; - png_ptr->interlaced = (png_byte)interlace_type; - png_ptr->color_type = (png_byte)color_type; -#ifdef PNG_MNG_FEATURES_SUPPORTED - png_ptr->filter_type = (png_byte)filter_type; -#endif - png_ptr->compression_type = (png_byte)compression_type; - - /* Find number of channels */ - switch (png_ptr->color_type) - { - default: /* invalid, png_set_IHDR calls png_error */ - case PNG_COLOR_TYPE_GRAY: - case PNG_COLOR_TYPE_PALETTE: - png_ptr->channels = 1; - break; - - case PNG_COLOR_TYPE_RGB: - png_ptr->channels = 3; - break; - - case PNG_COLOR_TYPE_GRAY_ALPHA: - png_ptr->channels = 2; - break; - - case PNG_COLOR_TYPE_RGB_ALPHA: - png_ptr->channels = 4; - break; - } - - /* Set up other useful info */ - png_ptr->pixel_depth = (png_byte)(png_ptr->bit_depth * png_ptr->channels); - png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->width); - png_debug1(3, "bit_depth = %d", png_ptr->bit_depth); - png_debug1(3, "channels = %d", png_ptr->channels); - png_debug1(3, "rowbytes = %lu", (unsigned long)png_ptr->rowbytes); - png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, - color_type, interlace_type, compression_type, filter_type); -} - -/* Read and check the palette */ -void /* PRIVATE */ -png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_color palette[PNG_MAX_PALETTE_LENGTH]; - int max_palette_length, num, i; -#ifdef PNG_POINTER_INDEXING_SUPPORTED - png_colorp pal_ptr; -#endif - - png_debug(1, "in png_handle_PLTE"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - /* Moved to before the 'after IDAT' check below because otherwise duplicate - * PLTE chunks are potentially ignored (the spec says there shall not be more - * than one PLTE, the error is not treated as benign, so this check trumps - * the requirement that PLTE appears before IDAT.) - */ - else if ((png_ptr->mode & PNG_HAVE_PLTE) != 0) - png_chunk_error(png_ptr, "duplicate"); - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - { - /* This is benign because the non-benign error happened before, when an - * IDAT was encountered in a color-mapped image with no PLTE. - */ - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - png_ptr->mode |= PNG_HAVE_PLTE; - - if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "ignored in grayscale PNG"); - return; - } - -#ifndef PNG_READ_OPT_PLTE_SUPPORTED - if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE) - { - png_crc_finish(png_ptr, length); - return; - } -#endif - - if (length > 3*PNG_MAX_PALETTE_LENGTH || length % 3) - { - png_crc_finish(png_ptr, length); - - if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE) - png_chunk_benign_error(png_ptr, "invalid"); - - else - png_chunk_error(png_ptr, "invalid"); - - return; - } - - /* The cast is safe because 'length' is less than 3*PNG_MAX_PALETTE_LENGTH */ - num = (int)length / 3; - - /* If the palette has 256 or fewer entries but is too large for the bit - * depth, we don't issue an error, to preserve the behavior of previous - * libpng versions. We silently truncate the unused extra palette entries - * here. - */ - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - max_palette_length = (1 << png_ptr->bit_depth); - else - max_palette_length = PNG_MAX_PALETTE_LENGTH; - - if (num > max_palette_length) - num = max_palette_length; - -#ifdef PNG_POINTER_INDEXING_SUPPORTED - for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++) - { - png_byte buf[3]; - - png_crc_read(png_ptr, buf, 3); - pal_ptr->red = buf[0]; - pal_ptr->green = buf[1]; - pal_ptr->blue = buf[2]; - } -#else - for (i = 0; i < num; i++) - { - png_byte buf[3]; - - png_crc_read(png_ptr, buf, 3); - /* Don't depend upon png_color being any order */ - palette[i].red = buf[0]; - palette[i].green = buf[1]; - palette[i].blue = buf[2]; - } -#endif - - /* If we actually need the PLTE chunk (ie for a paletted image), we do - * whatever the normal CRC configuration tells us. However, if we - * have an RGB image, the PLTE can be considered ancillary, so - * we will act as though it is. - */ -#ifndef PNG_READ_OPT_PLTE_SUPPORTED - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) -#endif - { - png_crc_finish(png_ptr, (png_uint_32) (length - (unsigned int)num * 3)); - } - -#ifndef PNG_READ_OPT_PLTE_SUPPORTED - else if (png_crc_error(png_ptr) != 0) /* Only if we have a CRC error */ - { - /* If we don't want to use the data from an ancillary chunk, - * we have two options: an error abort, or a warning and we - * ignore the data in this chunk (which should be OK, since - * it's considered ancillary for a RGB or RGBA image). - * - * IMPLEMENTATION NOTE: this is only here because png_crc_finish uses the - * chunk type to determine whether to check the ancillary or the critical - * flags. - */ - if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_USE) == 0) - { - if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) != 0) - return; - - else - png_chunk_error(png_ptr, "CRC error"); - } - - /* Otherwise, we (optionally) emit a warning and use the chunk. */ - else if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) == 0) - png_chunk_warning(png_ptr, "CRC error"); - } -#endif - - /* TODO: png_set_PLTE has the side effect of setting png_ptr->palette to its - * own copy of the palette. This has the side effect that when png_start_row - * is called (this happens after any call to png_read_update_info) the - * info_ptr palette gets changed. This is extremely unexpected and - * confusing. - * - * Fix this by not sharing the palette in this way. - */ - png_set_PLTE(png_ptr, info_ptr, palette, num); - - /* The three chunks, bKGD, hIST and tRNS *must* appear after PLTE and before - * IDAT. Prior to 1.6.0 this was not checked; instead the code merely - * checked the apparent validity of a tRNS chunk inserted before PLTE on a - * palette PNG. 1.6.0 attempts to rigorously follow the standard and - * therefore does a benign error if the erroneous condition is detected *and* - * cancels the tRNS if the benign error returns. The alternative is to - * amend the standard since it would be rather hypocritical of the standards - * maintainers to ignore it. - */ -#ifdef PNG_READ_tRNS_SUPPORTED - if (png_ptr->num_trans > 0 || - (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS) != 0)) - { - /* Cancel this because otherwise it would be used if the transforms - * require it. Don't cancel the 'valid' flag because this would prevent - * detection of duplicate chunks. - */ - png_ptr->num_trans = 0; - - if (info_ptr != NULL) - info_ptr->num_trans = 0; - - png_chunk_benign_error(png_ptr, "tRNS must be after"); - } -#endif - -#ifdef PNG_READ_hIST_SUPPORTED - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) != 0) - png_chunk_benign_error(png_ptr, "hIST must be after"); -#endif - -#ifdef PNG_READ_bKGD_SUPPORTED - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) != 0) - png_chunk_benign_error(png_ptr, "bKGD must be after"); -#endif -} - -void /* PRIVATE */ -png_handle_IEND(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_debug(1, "in png_handle_IEND"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0 || - (png_ptr->mode & PNG_HAVE_IDAT) == 0) - png_chunk_error(png_ptr, "out of place"); - - png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND); - - png_crc_finish(png_ptr, length); - - if (length != 0) - png_chunk_benign_error(png_ptr, "invalid"); - - PNG_UNUSED(info_ptr) -} - -#ifdef PNG_READ_gAMA_SUPPORTED -void /* PRIVATE */ -png_handle_gAMA(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_fixed_point igamma; - png_byte buf[4]; - - png_debug(1, "in png_handle_gAMA"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - if (length != 4) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, buf, 4); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - igamma = png_get_fixed_point(NULL, buf); - - png_colorspace_set_gamma(png_ptr, &png_ptr->colorspace, igamma); - png_colorspace_sync(png_ptr, info_ptr); -} -#endif - -#ifdef PNG_READ_sBIT_SUPPORTED -void /* PRIVATE */ -png_handle_sBIT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - unsigned int truelen, i; - png_byte sample_depth; - png_byte buf[4]; - - png_debug(1, "in png_handle_sBIT"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - truelen = 3; - sample_depth = 8; - } - - else - { - truelen = png_ptr->channels; - sample_depth = png_ptr->bit_depth; - } - - if (length != truelen || length > 4) - { - png_chunk_benign_error(png_ptr, "invalid"); - png_crc_finish(png_ptr, length); - return; - } - - buf[0] = buf[1] = buf[2] = buf[3] = sample_depth; - png_crc_read(png_ptr, buf, truelen); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - for (i=0; i sample_depth) - { - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - } - - if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) - { - png_ptr->sig_bit.red = buf[0]; - png_ptr->sig_bit.green = buf[1]; - png_ptr->sig_bit.blue = buf[2]; - png_ptr->sig_bit.alpha = buf[3]; - } - - else - { - png_ptr->sig_bit.gray = buf[0]; - png_ptr->sig_bit.red = buf[0]; - png_ptr->sig_bit.green = buf[0]; - png_ptr->sig_bit.blue = buf[0]; - png_ptr->sig_bit.alpha = buf[1]; - } - - png_set_sBIT(png_ptr, info_ptr, &(png_ptr->sig_bit)); -} -#endif - -#ifdef PNG_READ_cHRM_SUPPORTED -void /* PRIVATE */ -png_handle_cHRM(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_byte buf[32]; - png_xy xy; - - png_debug(1, "in png_handle_cHRM"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - if (length != 32) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, buf, 32); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - xy.whitex = png_get_fixed_point(NULL, buf); - xy.whitey = png_get_fixed_point(NULL, buf + 4); - xy.redx = png_get_fixed_point(NULL, buf + 8); - xy.redy = png_get_fixed_point(NULL, buf + 12); - xy.greenx = png_get_fixed_point(NULL, buf + 16); - xy.greeny = png_get_fixed_point(NULL, buf + 20); - xy.bluex = png_get_fixed_point(NULL, buf + 24); - xy.bluey = png_get_fixed_point(NULL, buf + 28); - - if (xy.whitex == PNG_FIXED_ERROR || - xy.whitey == PNG_FIXED_ERROR || - xy.redx == PNG_FIXED_ERROR || - xy.redy == PNG_FIXED_ERROR || - xy.greenx == PNG_FIXED_ERROR || - xy.greeny == PNG_FIXED_ERROR || - xy.bluex == PNG_FIXED_ERROR || - xy.bluey == PNG_FIXED_ERROR) - { - png_chunk_benign_error(png_ptr, "invalid values"); - return; - } - - /* If a colorspace error has already been output skip this chunk */ - if ((png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0) - return; - - if ((png_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) != 0) - { - png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID; - png_colorspace_sync(png_ptr, info_ptr); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - png_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM; - (void)png_colorspace_set_chromaticities(png_ptr, &png_ptr->colorspace, &xy, - 1/*prefer cHRM values*/); - png_colorspace_sync(png_ptr, info_ptr); -} -#endif - -#ifdef PNG_READ_sRGB_SUPPORTED -void /* PRIVATE */ -png_handle_sRGB(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_byte intent; - - png_debug(1, "in png_handle_sRGB"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - if (length != 1) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, &intent, 1); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - /* If a colorspace error has already been output skip this chunk */ - if ((png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0) - return; - - /* Only one sRGB or iCCP chunk is allowed, use the HAVE_INTENT flag to detect - * this. - */ - if ((png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_INTENT) != 0) - { - png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID; - png_colorspace_sync(png_ptr, info_ptr); - png_chunk_benign_error(png_ptr, "too many profiles"); - return; - } - - (void)png_colorspace_set_sRGB(png_ptr, &png_ptr->colorspace, intent); - png_colorspace_sync(png_ptr, info_ptr); -} -#endif /* READ_sRGB */ - -#ifdef PNG_READ_iCCP_SUPPORTED -void /* PRIVATE */ -png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -/* Note: this does not properly handle profiles that are > 64K under DOS */ -{ - png_const_charp errmsg = NULL; /* error message output, or no error */ - int finished = 0; /* crc checked */ - - png_debug(1, "in png_handle_iCCP"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - /* Consistent with all the above colorspace handling an obviously *invalid* - * chunk is just ignored, so does not invalidate the color space. An - * alternative is to set the 'invalid' flags at the start of this routine - * and only clear them in they were not set before and all the tests pass. - * The minimum 'deflate' stream is assumed to be just the 2 byte header and - * 4 byte checksum. The keyword must be at least one character and there is - * a terminator (0) byte and the compression method. - */ - if (length < 9) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "too short"); - return; - } - - /* If a colorspace error has already been output skip this chunk */ - if ((png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0) - { - png_crc_finish(png_ptr, length); - return; - } - - /* Only one sRGB or iCCP chunk is allowed, use the HAVE_INTENT flag to detect - * this. - */ - if ((png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_INTENT) == 0) - { - uInt read_length, keyword_length; - char keyword[81]; - - /* Find the keyword; the keyword plus separator and compression method - * bytes can be at most 81 characters long. - */ - read_length = 81; /* maximum */ - if (read_length > length) - read_length = (uInt)length; - - png_crc_read(png_ptr, (png_bytep)keyword, read_length); - length -= read_length; - - keyword_length = 0; - while (keyword_length < 80 && keyword_length < read_length && - keyword[keyword_length] != 0) - ++keyword_length; - - /* TODO: make the keyword checking common */ - if (keyword_length >= 1 && keyword_length <= 79) - { - /* We only understand '0' compression - deflate - so if we get a - * different value we can't safely decode the chunk. - */ - if (keyword_length+1 < read_length && - keyword[keyword_length+1] == PNG_COMPRESSION_TYPE_BASE) - { - read_length -= keyword_length+2; - - if (png_inflate_claim(png_ptr, png_iCCP) == Z_OK) - { - Byte profile_header[132]; - Byte local_buffer[PNG_INFLATE_BUF_SIZE]; - png_alloc_size_t size = (sizeof profile_header); - - png_ptr->zstream.next_in = (Bytef*)keyword + (keyword_length+2); - png_ptr->zstream.avail_in = read_length; - (void)png_inflate_read(png_ptr, local_buffer, - (sizeof local_buffer), &length, profile_header, &size, - 0/*finish: don't, because the output is too small*/); - - if (size == 0) - { - /* We have the ICC profile header; do the basic header checks. - */ - const png_uint_32 profile_length = - png_get_uint_32(profile_header); - - if (png_icc_check_length(png_ptr, &png_ptr->colorspace, - keyword, profile_length) != 0) - { - /* The length is apparently ok, so we can check the 132 - * byte header. - */ - if (png_icc_check_header(png_ptr, &png_ptr->colorspace, - keyword, profile_length, profile_header, - png_ptr->color_type) != 0) - { - /* Now read the tag table; a variable size buffer is - * needed at this point, allocate one for the whole - * profile. The header check has already validated - * that none of these stuff will overflow. - */ - const png_uint_32 tag_count = png_get_uint_32( - profile_header+128); - png_bytep profile = png_read_buffer(png_ptr, - profile_length, 2/*silent*/); - - if (profile != NULL) - { - memcpy(profile, profile_header, - (sizeof profile_header)); - - size = 12 * tag_count; - - (void)png_inflate_read(png_ptr, local_buffer, - (sizeof local_buffer), &length, - profile + (sizeof profile_header), &size, 0); - - /* Still expect a buffer error because we expect - * there to be some tag data! - */ - if (size == 0) - { - if (png_icc_check_tag_table(png_ptr, - &png_ptr->colorspace, keyword, profile_length, - profile) != 0) - { - /* The profile has been validated for basic - * security issues, so read the whole thing in. - */ - size = profile_length - (sizeof profile_header) - - 12 * tag_count; - - (void)png_inflate_read(png_ptr, local_buffer, - (sizeof local_buffer), &length, - profile + (sizeof profile_header) + - 12 * tag_count, &size, 1/*finish*/); - - if (length > 0 && !(png_ptr->flags & - PNG_FLAG_BENIGN_ERRORS_WARN)) - errmsg = "extra compressed data"; - - /* But otherwise allow extra data: */ - else if (size == 0) - { - if (length > 0) - { - /* This can be handled completely, so - * keep going. - */ - png_chunk_warning(png_ptr, - "extra compressed data"); - } - - png_crc_finish(png_ptr, length); - finished = 1; - -# if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0 - /* Check for a match against sRGB */ - png_icc_set_sRGB(png_ptr, - &png_ptr->colorspace, profile, - png_ptr->zstream.adler); -# endif - - /* Steal the profile for info_ptr. */ - if (info_ptr != NULL) - { - png_free_data(png_ptr, info_ptr, - PNG_FREE_ICCP, 0); - - info_ptr->iccp_name = png_voidcast(char*, - png_malloc_base(png_ptr, - keyword_length+1)); - if (info_ptr->iccp_name != NULL) - { - memcpy(info_ptr->iccp_name, keyword, - keyword_length+1); - info_ptr->iccp_proflen = - profile_length; - info_ptr->iccp_profile = profile; - png_ptr->read_buffer = NULL; /*steal*/ - info_ptr->free_me |= PNG_FREE_ICCP; - info_ptr->valid |= PNG_INFO_iCCP; - } - - else - { - png_ptr->colorspace.flags |= - PNG_COLORSPACE_INVALID; - errmsg = "out of memory"; - } - } - - /* else the profile remains in the read - * buffer which gets reused for subsequent - * chunks. - */ - - if (info_ptr != NULL) - png_colorspace_sync(png_ptr, info_ptr); - - if (errmsg == NULL) - { - png_ptr->zowner = 0; - return; - } - } - - else if (size > 0) - errmsg = "truncated"; - -#ifndef __COVERITY__ - else - errmsg = png_ptr->zstream.msg; -#endif - } - - /* else png_icc_check_tag_table output an error */ - } - - else /* profile truncated */ - errmsg = png_ptr->zstream.msg; - } - - else - errmsg = "out of memory"; - } - - /* else png_icc_check_header output an error */ - } - - /* else png_icc_check_length output an error */ - } - - else /* profile truncated */ - errmsg = png_ptr->zstream.msg; - - /* Release the stream */ - png_ptr->zowner = 0; - } - - else /* png_inflate_claim failed */ - errmsg = png_ptr->zstream.msg; - } - - else - errmsg = "bad compression method"; /* or missing */ - } - - else - errmsg = "bad keyword"; - } - - else - errmsg = "too many profiles"; - - /* Failure: the reason is in 'errmsg' */ - if (finished == 0) - png_crc_finish(png_ptr, length); - - png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID; - png_colorspace_sync(png_ptr, info_ptr); - if (errmsg != NULL) /* else already output */ - png_chunk_benign_error(png_ptr, errmsg); -} -#endif /* READ_iCCP */ - -#ifdef PNG_READ_sPLT_SUPPORTED -void /* PRIVATE */ -png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -/* Note: this does not properly handle chunks that are > 64K under DOS */ -{ - png_bytep entry_start, buffer; - png_sPLT_t new_palette; - png_sPLT_entryp pp; - png_uint_32 data_length; - int entry_size, i; - png_uint_32 skip = 0; - png_uint_32 dl; - png_size_t max_dl; - - png_debug(1, "in png_handle_sPLT"); - -#ifdef PNG_USER_LIMITS_SUPPORTED - if (png_ptr->user_chunk_cache_max != 0) - { - if (png_ptr->user_chunk_cache_max == 1) - { - png_crc_finish(png_ptr, length); - return; - } - - if (--png_ptr->user_chunk_cache_max == 1) - { - png_warning(png_ptr, "No space in chunk cache for sPLT"); - png_crc_finish(png_ptr, length); - return; - } - } -#endif - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - -#ifdef PNG_MAX_MALLOC_64K - if (length > 65535U) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "too large to fit in memory"); - return; - } -#endif - - buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/); - if (buffer == NULL) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of memory"); - return; - } - - - /* WARNING: this may break if size_t is less than 32 bits; it is assumed - * that the PNG_MAX_MALLOC_64K test is enabled in this case, but this is a - * potential breakage point if the types in pngconf.h aren't exactly right. - */ - png_crc_read(png_ptr, buffer, length); - - if (png_crc_finish(png_ptr, skip) != 0) - return; - - buffer[length] = 0; - - for (entry_start = buffer; *entry_start; entry_start++) - /* Empty loop to find end of name */ ; - - ++entry_start; - - /* A sample depth should follow the separator, and we should be on it */ - if (length < 2U || entry_start > buffer + (length - 2U)) - { - png_warning(png_ptr, "malformed sPLT chunk"); - return; - } - - new_palette.depth = *entry_start++; - entry_size = (new_palette.depth == 8 ? 6 : 10); - /* This must fit in a png_uint_32 because it is derived from the original - * chunk data length. - */ - data_length = length - (png_uint_32)(entry_start - buffer); - - /* Integrity-check the data length */ - if ((data_length % (unsigned int)entry_size) != 0) - { - png_warning(png_ptr, "sPLT chunk has bad length"); - return; - } - - dl = (png_uint_32)(data_length / (unsigned int)entry_size); - max_dl = PNG_SIZE_MAX / (sizeof (png_sPLT_entry)); - - if (dl > max_dl) - { - png_warning(png_ptr, "sPLT chunk too long"); - return; - } - - new_palette.nentries = (png_int_32)(data_length / (unsigned int)entry_size); - - new_palette.entries = (png_sPLT_entryp)png_malloc_warn(png_ptr, - (png_alloc_size_t) new_palette.nentries * (sizeof (png_sPLT_entry))); - - if (new_palette.entries == NULL) - { - png_warning(png_ptr, "sPLT chunk requires too much memory"); - return; - } - -#ifdef PNG_POINTER_INDEXING_SUPPORTED - for (i = 0; i < new_palette.nentries; i++) - { - pp = new_palette.entries + i; - - if (new_palette.depth == 8) - { - pp->red = *entry_start++; - pp->green = *entry_start++; - pp->blue = *entry_start++; - pp->alpha = *entry_start++; - } - - else - { - pp->red = png_get_uint_16(entry_start); entry_start += 2; - pp->green = png_get_uint_16(entry_start); entry_start += 2; - pp->blue = png_get_uint_16(entry_start); entry_start += 2; - pp->alpha = png_get_uint_16(entry_start); entry_start += 2; - } - - pp->frequency = png_get_uint_16(entry_start); entry_start += 2; - } -#else - pp = new_palette.entries; - - for (i = 0; i < new_palette.nentries; i++) - { - - if (new_palette.depth == 8) - { - pp[i].red = *entry_start++; - pp[i].green = *entry_start++; - pp[i].blue = *entry_start++; - pp[i].alpha = *entry_start++; - } - - else - { - pp[i].red = png_get_uint_16(entry_start); entry_start += 2; - pp[i].green = png_get_uint_16(entry_start); entry_start += 2; - pp[i].blue = png_get_uint_16(entry_start); entry_start += 2; - pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2; - } - - pp[i].frequency = png_get_uint_16(entry_start); entry_start += 2; - } -#endif - - /* Discard all chunk data except the name and stash that */ - new_palette.name = (png_charp)buffer; - - png_set_sPLT(png_ptr, info_ptr, &new_palette, 1); - - png_free(png_ptr, new_palette.entries); -} -#endif /* READ_sPLT */ - -#ifdef PNG_READ_tRNS_SUPPORTED -void /* PRIVATE */ -png_handle_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_byte readbuf[PNG_MAX_PALETTE_LENGTH]; - - png_debug(1, "in png_handle_tRNS"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) - { - png_byte buf[2]; - - if (length != 2) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, buf, 2); - png_ptr->num_trans = 1; - png_ptr->trans_color.gray = png_get_uint_16(buf); - } - - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - png_byte buf[6]; - - if (length != 6) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, buf, length); - png_ptr->num_trans = 1; - png_ptr->trans_color.red = png_get_uint_16(buf); - png_ptr->trans_color.green = png_get_uint_16(buf + 2); - png_ptr->trans_color.blue = png_get_uint_16(buf + 4); - } - - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if ((png_ptr->mode & PNG_HAVE_PLTE) == 0) - { - /* TODO: is this actually an error in the ISO spec? */ - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - if (length > (unsigned int) png_ptr->num_palette || - length > (unsigned int) PNG_MAX_PALETTE_LENGTH || - length == 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, readbuf, length); - png_ptr->num_trans = (png_uint_16)length; - } - - else - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid with alpha channel"); - return; - } - - if (png_crc_finish(png_ptr, 0) != 0) - { - png_ptr->num_trans = 0; - return; - } - - /* TODO: this is a horrible side effect in the palette case because the - * png_struct ends up with a pointer to the tRNS buffer owned by the - * png_info. Fix this. - */ - png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans, - &(png_ptr->trans_color)); -} -#endif - -#ifdef PNG_READ_bKGD_SUPPORTED -void /* PRIVATE */ -png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - unsigned int truelen; - png_byte buf[6]; - png_color_16 background; - - png_debug(1, "in png_handle_bKGD"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0 || - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - (png_ptr->mode & PNG_HAVE_PLTE) == 0)) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - truelen = 1; - - else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) - truelen = 6; - - else - truelen = 2; - - if (length != truelen) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, buf, truelen); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - /* We convert the index value into RGB components so that we can allow - * arbitrary RGB values for background when we have transparency, and - * so it is easy to determine the RGB values of the background color - * from the info_ptr struct. - */ - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - background.index = buf[0]; - - if (info_ptr != NULL && info_ptr->num_palette != 0) - { - if (buf[0] >= info_ptr->num_palette) - { - png_chunk_benign_error(png_ptr, "invalid index"); - return; - } - - background.red = (png_uint_16)png_ptr->palette[buf[0]].red; - background.green = (png_uint_16)png_ptr->palette[buf[0]].green; - background.blue = (png_uint_16)png_ptr->palette[buf[0]].blue; - } - - else - background.red = background.green = background.blue = 0; - - background.gray = 0; - } - - else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0) /* GRAY */ - { - background.index = 0; - background.red = - background.green = - background.blue = - background.gray = png_get_uint_16(buf); - } - - else - { - background.index = 0; - background.red = png_get_uint_16(buf); - background.green = png_get_uint_16(buf + 2); - background.blue = png_get_uint_16(buf + 4); - background.gray = 0; - } - - png_set_bKGD(png_ptr, info_ptr, &background); -} -#endif - -#ifdef PNG_READ_hIST_SUPPORTED -void /* PRIVATE */ -png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - unsigned int num, i; - png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH]; - - png_debug(1, "in png_handle_hIST"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0 || - (png_ptr->mode & PNG_HAVE_PLTE) == 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - num = length / 2 ; - - if (num != (unsigned int) png_ptr->num_palette || - num > (unsigned int) PNG_MAX_PALETTE_LENGTH) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - for (i = 0; i < num; i++) - { - png_byte buf[2]; - - png_crc_read(png_ptr, buf, 2); - readbuf[i] = png_get_uint_16(buf); - } - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - png_set_hIST(png_ptr, info_ptr, readbuf); -} -#endif - -#ifdef PNG_READ_pHYs_SUPPORTED -void /* PRIVATE */ -png_handle_pHYs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_byte buf[9]; - png_uint_32 res_x, res_y; - int unit_type; - - png_debug(1, "in png_handle_pHYs"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - if (length != 9) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, buf, 9); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - res_x = png_get_uint_32(buf); - res_y = png_get_uint_32(buf + 4); - unit_type = buf[8]; - png_set_pHYs(png_ptr, info_ptr, res_x, res_y, unit_type); -} -#endif - -#ifdef PNG_READ_oFFs_SUPPORTED -void /* PRIVATE */ -png_handle_oFFs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_byte buf[9]; - png_int_32 offset_x, offset_y; - int unit_type; - - png_debug(1, "in png_handle_oFFs"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - if (length != 9) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, buf, 9); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - offset_x = png_get_int_32(buf); - offset_y = png_get_int_32(buf + 4); - unit_type = buf[8]; - png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, unit_type); -} -#endif - -#ifdef PNG_READ_pCAL_SUPPORTED -/* Read the pCAL chunk (described in the PNG Extensions document) */ -void /* PRIVATE */ -png_handle_pCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_int_32 X0, X1; - png_byte type, nparams; - png_bytep buffer, buf, units, endptr; - png_charpp params; - int i; - - png_debug(1, "in png_handle_pCAL"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - png_debug1(2, "Allocating and reading pCAL chunk data (%u bytes)", - length + 1); - - buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/); - - if (buffer == NULL) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of memory"); - return; - } - - png_crc_read(png_ptr, buffer, length); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - buffer[length] = 0; /* Null terminate the last string */ - - png_debug(3, "Finding end of pCAL purpose string"); - for (buf = buffer; *buf; buf++) - /* Empty loop */ ; - - endptr = buffer + length; - - /* We need to have at least 12 bytes after the purpose string - * in order to get the parameter information. - */ - if (endptr - buf <= 12) - { - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_debug(3, "Reading pCAL X0, X1, type, nparams, and units"); - X0 = png_get_int_32((png_bytep)buf+1); - X1 = png_get_int_32((png_bytep)buf+5); - type = buf[9]; - nparams = buf[10]; - units = buf + 11; - - png_debug(3, "Checking pCAL equation type and number of parameters"); - /* Check that we have the right number of parameters for known - * equation types. - */ - if ((type == PNG_EQUATION_LINEAR && nparams != 2) || - (type == PNG_EQUATION_BASE_E && nparams != 3) || - (type == PNG_EQUATION_ARBITRARY && nparams != 3) || - (type == PNG_EQUATION_HYPERBOLIC && nparams != 4)) - { - png_chunk_benign_error(png_ptr, "invalid parameter count"); - return; - } - - else if (type >= PNG_EQUATION_LAST) - { - png_chunk_benign_error(png_ptr, "unrecognized equation type"); - } - - for (buf = units; *buf; buf++) - /* Empty loop to move past the units string. */ ; - - png_debug(3, "Allocating pCAL parameters array"); - - params = png_voidcast(png_charpp, png_malloc_warn(png_ptr, - nparams * (sizeof (png_charp)))); - - if (params == NULL) - { - png_chunk_benign_error(png_ptr, "out of memory"); - return; - } - - /* Get pointers to the start of each parameter string. */ - for (i = 0; i < nparams; i++) - { - buf++; /* Skip the null string terminator from previous parameter. */ - - png_debug1(3, "Reading pCAL parameter %d", i); - - for (params[i] = (png_charp)buf; buf <= endptr && *buf != 0; buf++) - /* Empty loop to move past each parameter string */ ; - - /* Make sure we haven't run out of data yet */ - if (buf > endptr) - { - png_free(png_ptr, params); - png_chunk_benign_error(png_ptr, "invalid data"); - return; - } - } - - png_set_pCAL(png_ptr, info_ptr, (png_charp)buffer, X0, X1, type, nparams, - (png_charp)units, params); - - png_free(png_ptr, params); -} -#endif - -#ifdef PNG_READ_sCAL_SUPPORTED -/* Read the sCAL chunk */ -void /* PRIVATE */ -png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_bytep buffer; - png_size_t i; - int state; - - png_debug(1, "in png_handle_sCAL"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of place"); - return; - } - - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - /* Need unit type, width, \0, height: minimum 4 bytes */ - else if (length < 4) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_debug1(2, "Allocating and reading sCAL chunk data (%u bytes)", - length + 1); - - buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/); - - if (buffer == NULL) - { - png_chunk_benign_error(png_ptr, "out of memory"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buffer, length); - buffer[length] = 0; /* Null terminate the last string */ - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - /* Validate the unit. */ - if (buffer[0] != 1 && buffer[0] != 2) - { - png_chunk_benign_error(png_ptr, "invalid unit"); - return; - } - - /* Validate the ASCII numbers, need two ASCII numbers separated by - * a '\0' and they need to fit exactly in the chunk data. - */ - i = 1; - state = 0; - - if (png_check_fp_number((png_const_charp)buffer, length, &state, &i) == 0 || - i >= length || buffer[i++] != 0) - png_chunk_benign_error(png_ptr, "bad width format"); - - else if (PNG_FP_IS_POSITIVE(state) == 0) - png_chunk_benign_error(png_ptr, "non-positive width"); - - else - { - png_size_t heighti = i; - - state = 0; - if (png_check_fp_number((png_const_charp)buffer, length, - &state, &i) == 0 || i != length) - png_chunk_benign_error(png_ptr, "bad height format"); - - else if (PNG_FP_IS_POSITIVE(state) == 0) - png_chunk_benign_error(png_ptr, "non-positive height"); - - else - /* This is the (only) success case. */ - png_set_sCAL_s(png_ptr, info_ptr, buffer[0], - (png_charp)buffer+1, (png_charp)buffer+heighti); - } -} -#endif - -#ifdef PNG_READ_tIME_SUPPORTED -void /* PRIVATE */ -png_handle_tIME(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_byte buf[7]; - png_time mod_time; - - png_debug(1, "in png_handle_tIME"); - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME) != 0) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "duplicate"); - return; - } - - if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - png_ptr->mode |= PNG_AFTER_IDAT; - - if (length != 7) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "invalid"); - return; - } - - png_crc_read(png_ptr, buf, 7); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - mod_time.second = buf[6]; - mod_time.minute = buf[5]; - mod_time.hour = buf[4]; - mod_time.day = buf[3]; - mod_time.month = buf[2]; - mod_time.year = png_get_uint_16(buf); - - png_set_tIME(png_ptr, info_ptr, &mod_time); -} -#endif - -#ifdef PNG_READ_tEXt_SUPPORTED -/* Note: this does not properly handle chunks that are > 64K under DOS */ -void /* PRIVATE */ -png_handle_tEXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_text text_info; - png_bytep buffer; - png_charp key; - png_charp text; - png_uint_32 skip = 0; - - png_debug(1, "in png_handle_tEXt"); - -#ifdef PNG_USER_LIMITS_SUPPORTED - if (png_ptr->user_chunk_cache_max != 0) - { - if (png_ptr->user_chunk_cache_max == 1) - { - png_crc_finish(png_ptr, length); - return; - } - - if (--png_ptr->user_chunk_cache_max == 1) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "no space in chunk cache"); - return; - } - } -#endif - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - png_ptr->mode |= PNG_AFTER_IDAT; - -#ifdef PNG_MAX_MALLOC_64K - if (length > 65535U) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "too large to fit in memory"); - return; - } -#endif - - buffer = png_read_buffer(png_ptr, length+1, 1/*warn*/); - - if (buffer == NULL) - { - png_chunk_benign_error(png_ptr, "out of memory"); - return; - } - - png_crc_read(png_ptr, buffer, length); - - if (png_crc_finish(png_ptr, skip) != 0) - return; - - key = (png_charp)buffer; - key[length] = 0; - - for (text = key; *text; text++) - /* Empty loop to find end of key */ ; - - if (text != key + length) - text++; - - text_info.compression = PNG_TEXT_COMPRESSION_NONE; - text_info.key = key; - text_info.lang = NULL; - text_info.lang_key = NULL; - text_info.itxt_length = 0; - text_info.text = text; - text_info.text_length = strlen(text); - - if (png_set_text_2(png_ptr, info_ptr, &text_info, 1) != 0) - png_warning(png_ptr, "Insufficient memory to process text chunk"); -} -#endif - -#ifdef PNG_READ_zTXt_SUPPORTED -/* Note: this does not correctly handle chunks that are > 64K under DOS */ -void /* PRIVATE */ -png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_const_charp errmsg = NULL; - png_bytep buffer; - png_uint_32 keyword_length; - - png_debug(1, "in png_handle_zTXt"); - -#ifdef PNG_USER_LIMITS_SUPPORTED - if (png_ptr->user_chunk_cache_max != 0) - { - if (png_ptr->user_chunk_cache_max == 1) - { - png_crc_finish(png_ptr, length); - return; - } - - if (--png_ptr->user_chunk_cache_max == 1) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "no space in chunk cache"); - return; - } - } -#endif - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - png_ptr->mode |= PNG_AFTER_IDAT; - - buffer = png_read_buffer(png_ptr, length, 2/*silent*/); - - if (buffer == NULL) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of memory"); - return; - } - - png_crc_read(png_ptr, buffer, length); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - /* TODO: also check that the keyword contents match the spec! */ - for (keyword_length = 0; - keyword_length < length && buffer[keyword_length] != 0; - ++keyword_length) - /* Empty loop to find end of name */ ; - - if (keyword_length > 79 || keyword_length < 1) - errmsg = "bad keyword"; - - /* zTXt must have some LZ data after the keyword, although it may expand to - * zero bytes; we need a '\0' at the end of the keyword, the compression type - * then the LZ data: - */ - else if (keyword_length + 3 > length) - errmsg = "truncated"; - - else if (buffer[keyword_length+1] != PNG_COMPRESSION_TYPE_BASE) - errmsg = "unknown compression type"; - - else - { - png_alloc_size_t uncompressed_length = PNG_SIZE_MAX; - - /* TODO: at present png_decompress_chunk imposes a single application - * level memory limit, this should be split to different values for iCCP - * and text chunks. - */ - if (png_decompress_chunk(png_ptr, length, keyword_length+2, - &uncompressed_length, 1/*terminate*/) == Z_STREAM_END) - { - png_text text; - - /* It worked; png_ptr->read_buffer now looks like a tEXt chunk except - * for the extra compression type byte and the fact that it isn't - * necessarily '\0' terminated. - */ - buffer = png_ptr->read_buffer; - buffer[uncompressed_length+(keyword_length+2)] = 0; - - text.compression = PNG_TEXT_COMPRESSION_zTXt; - text.key = (png_charp)buffer; - text.text = (png_charp)(buffer + keyword_length+2); - text.text_length = uncompressed_length; - text.itxt_length = 0; - text.lang = NULL; - text.lang_key = NULL; - - if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0) - errmsg = "insufficient memory"; - } - - else - errmsg = png_ptr->zstream.msg; - } - - if (errmsg != NULL) - png_chunk_benign_error(png_ptr, errmsg); -} -#endif - -#ifdef PNG_READ_iTXt_SUPPORTED -/* Note: this does not correctly handle chunks that are > 64K under DOS */ -void /* PRIVATE */ -png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) -{ - png_const_charp errmsg = NULL; - png_bytep buffer; - png_uint_32 prefix_length; - - png_debug(1, "in png_handle_iTXt"); - -#ifdef PNG_USER_LIMITS_SUPPORTED - if (png_ptr->user_chunk_cache_max != 0) - { - if (png_ptr->user_chunk_cache_max == 1) - { - png_crc_finish(png_ptr, length); - return; - } - - if (--png_ptr->user_chunk_cache_max == 1) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "no space in chunk cache"); - return; - } - } -#endif - - if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) - png_chunk_error(png_ptr, "missing IHDR"); - - if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) - png_ptr->mode |= PNG_AFTER_IDAT; - - buffer = png_read_buffer(png_ptr, length+1, 1/*warn*/); - - if (buffer == NULL) - { - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "out of memory"); - return; - } - - png_crc_read(png_ptr, buffer, length); - - if (png_crc_finish(png_ptr, 0) != 0) - return; - - /* First the keyword. */ - for (prefix_length=0; - prefix_length < length && buffer[prefix_length] != 0; - ++prefix_length) - /* Empty loop */ ; - - /* Perform a basic check on the keyword length here. */ - if (prefix_length > 79 || prefix_length < 1) - errmsg = "bad keyword"; - - /* Expect keyword, compression flag, compression type, language, translated - * keyword (both may be empty but are 0 terminated) then the text, which may - * be empty. - */ - else if (prefix_length + 5 > length) - errmsg = "truncated"; - - else if (buffer[prefix_length+1] == 0 || - (buffer[prefix_length+1] == 1 && - buffer[prefix_length+2] == PNG_COMPRESSION_TYPE_BASE)) - { - int compressed = buffer[prefix_length+1] != 0; - png_uint_32 language_offset, translated_keyword_offset; - png_alloc_size_t uncompressed_length = 0; - - /* Now the language tag */ - prefix_length += 3; - language_offset = prefix_length; - - for (; prefix_length < length && buffer[prefix_length] != 0; - ++prefix_length) - /* Empty loop */ ; - - /* WARNING: the length may be invalid here, this is checked below. */ - translated_keyword_offset = ++prefix_length; - - for (; prefix_length < length && buffer[prefix_length] != 0; - ++prefix_length) - /* Empty loop */ ; - - /* prefix_length should now be at the trailing '\0' of the translated - * keyword, but it may already be over the end. None of this arithmetic - * can overflow because chunks are at most 2^31 bytes long, but on 16-bit - * systems the available allocation may overflow. - */ - ++prefix_length; - - if (compressed == 0 && prefix_length <= length) - uncompressed_length = length - prefix_length; - - else if (compressed != 0 && prefix_length < length) - { - uncompressed_length = PNG_SIZE_MAX; - - /* TODO: at present png_decompress_chunk imposes a single application - * level memory limit, this should be split to different values for - * iCCP and text chunks. - */ - if (png_decompress_chunk(png_ptr, length, prefix_length, - &uncompressed_length, 1/*terminate*/) == Z_STREAM_END) - buffer = png_ptr->read_buffer; - - else - errmsg = png_ptr->zstream.msg; - } - - else - errmsg = "truncated"; - - if (errmsg == NULL) - { - png_text text; - - buffer[uncompressed_length+prefix_length] = 0; - - if (compressed == 0) - text.compression = PNG_ITXT_COMPRESSION_NONE; - - else - text.compression = PNG_ITXT_COMPRESSION_zTXt; - - text.key = (png_charp)buffer; - text.lang = (png_charp)buffer + language_offset; - text.lang_key = (png_charp)buffer + translated_keyword_offset; - text.text = (png_charp)buffer + prefix_length; - text.text_length = 0; - text.itxt_length = uncompressed_length; - - if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0) - errmsg = "insufficient memory"; - } - } - - else - errmsg = "bad compression info"; - - if (errmsg != NULL) - png_chunk_benign_error(png_ptr, errmsg); -} -#endif - -#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -/* Utility function for png_handle_unknown; set up png_ptr::unknown_chunk */ -static int -png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length) -{ - png_alloc_size_t limit = PNG_SIZE_MAX; - - if (png_ptr->unknown_chunk.data != NULL) - { - png_free(png_ptr, png_ptr->unknown_chunk.data); - png_ptr->unknown_chunk.data = NULL; - } - -# ifdef PNG_SET_USER_LIMITS_SUPPORTED - if (png_ptr->user_chunk_malloc_max > 0 && - png_ptr->user_chunk_malloc_max < limit) - limit = png_ptr->user_chunk_malloc_max; - -# elif PNG_USER_CHUNK_MALLOC_MAX > 0 - if (PNG_USER_CHUNK_MALLOC_MAX < limit) - limit = PNG_USER_CHUNK_MALLOC_MAX; -# endif - - if (length <= limit) - { - PNG_CSTRING_FROM_CHUNK(png_ptr->unknown_chunk.name, png_ptr->chunk_name); - /* The following is safe because of the PNG_SIZE_MAX init above */ - png_ptr->unknown_chunk.size = (png_size_t)length/*SAFE*/; - /* 'mode' is a flag array, only the bottom four bits matter here */ - png_ptr->unknown_chunk.location = (png_byte)png_ptr->mode/*SAFE*/; - - if (length == 0) - png_ptr->unknown_chunk.data = NULL; - - else - { - /* Do a 'warn' here - it is handled below. */ - png_ptr->unknown_chunk.data = png_voidcast(png_bytep, - png_malloc_warn(png_ptr, length)); - } - } - - if (png_ptr->unknown_chunk.data == NULL && length > 0) - { - /* This is benign because we clean up correctly */ - png_crc_finish(png_ptr, length); - png_chunk_benign_error(png_ptr, "unknown chunk exceeds memory limits"); - return 0; - } - - else - { - if (length > 0) - png_crc_read(png_ptr, png_ptr->unknown_chunk.data, length); - png_crc_finish(png_ptr, 0); - return 1; - } -} -#endif /* READ_UNKNOWN_CHUNKS */ - -/* Handle an unknown, or known but disabled, chunk */ -void /* PRIVATE */ -png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, - png_uint_32 length, int keep) -{ - int handled = 0; /* the chunk was handled */ - - png_debug(1, "in png_handle_unknown"); - -#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED - /* NOTE: this code is based on the code in libpng-1.4.12 except for fixing - * the bug which meant that setting a non-default behavior for a specific - * chunk would be ignored (the default was always used unless a user - * callback was installed). - * - * 'keep' is the value from the png_chunk_unknown_handling, the setting for - * this specific chunk_name, if PNG_HANDLE_AS_UNKNOWN_SUPPORTED, if not it - * will always be PNG_HANDLE_CHUNK_AS_DEFAULT and it needs to be set here. - * This is just an optimization to avoid multiple calls to the lookup - * function. - */ -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED - keep = png_chunk_unknown_handling(png_ptr, png_ptr->chunk_name); -# endif -# endif - - /* One of the following methods will read the chunk or skip it (at least one - * of these is always defined because this is the only way to switch on - * PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - */ -# ifdef PNG_READ_USER_CHUNKS_SUPPORTED - /* The user callback takes precedence over the chunk keep value, but the - * keep value is still required to validate a save of a critical chunk. - */ - if (png_ptr->read_user_chunk_fn != NULL) - { - if (png_cache_unknown_chunk(png_ptr, length) != 0) - { - /* Callback to user unknown chunk handler */ - int ret = (*(png_ptr->read_user_chunk_fn))(png_ptr, - &png_ptr->unknown_chunk); - - /* ret is: - * negative: An error occurred; png_chunk_error will be called. - * zero: The chunk was not handled, the chunk will be discarded - * unless png_set_keep_unknown_chunks has been used to set - * a 'keep' behavior for this particular chunk, in which - * case that will be used. A critical chunk will cause an - * error at this point unless it is to be saved. - * positive: The chunk was handled, libpng will ignore/discard it. - */ - if (ret < 0) - png_chunk_error(png_ptr, "error in user chunk"); - - else if (ret == 0) - { - /* If the keep value is 'default' or 'never' override it, but - * still error out on critical chunks unless the keep value is - * 'always' While this is weird it is the behavior in 1.4.12. - * A possible improvement would be to obey the value set for the - * chunk, but this would be an API change that would probably - * damage some applications. - * - * The png_app_warning below catches the case that matters, where - * the application has not set specific save or ignore for this - * chunk or global save or ignore. - */ - if (keep < PNG_HANDLE_CHUNK_IF_SAFE) - { -# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED - if (png_ptr->unknown_default < PNG_HANDLE_CHUNK_IF_SAFE) - { - png_chunk_warning(png_ptr, "Saving unknown chunk:"); - png_app_warning(png_ptr, - "forcing save of an unhandled chunk;" - " please call png_set_keep_unknown_chunks"); - /* with keep = PNG_HANDLE_CHUNK_IF_SAFE */ - } -# endif - keep = PNG_HANDLE_CHUNK_IF_SAFE; - } - } - - else /* chunk was handled */ - { - handled = 1; - /* Critical chunks can be safely discarded at this point. */ - keep = PNG_HANDLE_CHUNK_NEVER; - } - } - - else - keep = PNG_HANDLE_CHUNK_NEVER; /* insufficient memory */ - } - - else - /* Use the SAVE_UNKNOWN_CHUNKS code or skip the chunk */ -# endif /* READ_USER_CHUNKS */ - -# ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED - { - /* keep is currently just the per-chunk setting, if there was no - * setting change it to the global default now (not that this may - * still be AS_DEFAULT) then obtain the cache of the chunk if required, - * if not simply skip the chunk. - */ - if (keep == PNG_HANDLE_CHUNK_AS_DEFAULT) - keep = png_ptr->unknown_default; - - if (keep == PNG_HANDLE_CHUNK_ALWAYS || - (keep == PNG_HANDLE_CHUNK_IF_SAFE && - PNG_CHUNK_ANCILLARY(png_ptr->chunk_name))) - { - if (png_cache_unknown_chunk(png_ptr, length) == 0) - keep = PNG_HANDLE_CHUNK_NEVER; - } - - else - png_crc_finish(png_ptr, length); - } -# else -# ifndef PNG_READ_USER_CHUNKS_SUPPORTED -# error no method to support READ_UNKNOWN_CHUNKS -# endif - - { - /* If here there is no read callback pointer set and no support is - * compiled in to just save the unknown chunks, so simply skip this - * chunk. If 'keep' is something other than AS_DEFAULT or NEVER then - * the app has erroneously asked for unknown chunk saving when there - * is no support. - */ - if (keep > PNG_HANDLE_CHUNK_NEVER) - png_app_error(png_ptr, "no unknown chunk support available"); - - png_crc_finish(png_ptr, length); - } -# endif - -# ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED - /* Now store the chunk in the chunk list if appropriate, and if the limits - * permit it. - */ - if (keep == PNG_HANDLE_CHUNK_ALWAYS || - (keep == PNG_HANDLE_CHUNK_IF_SAFE && - PNG_CHUNK_ANCILLARY(png_ptr->chunk_name))) - { -# ifdef PNG_USER_LIMITS_SUPPORTED - switch (png_ptr->user_chunk_cache_max) - { - case 2: - png_ptr->user_chunk_cache_max = 1; - png_chunk_benign_error(png_ptr, "no space in chunk cache"); - /* FALL THROUGH */ - case 1: - /* NOTE: prior to 1.6.0 this case resulted in an unknown critical - * chunk being skipped, now there will be a hard error below. - */ - break; - - default: /* not at limit */ - --(png_ptr->user_chunk_cache_max); - /* FALL THROUGH */ - case 0: /* no limit */ -# endif /* USER_LIMITS */ - /* Here when the limit isn't reached or when limits are compiled - * out; store the chunk. - */ - png_set_unknown_chunks(png_ptr, info_ptr, - &png_ptr->unknown_chunk, 1); - handled = 1; -# ifdef PNG_USER_LIMITS_SUPPORTED - break; - } -# endif - } -# else /* no store support: the chunk must be handled by the user callback */ - PNG_UNUSED(info_ptr) -# endif - - /* Regardless of the error handling below the cached data (if any) can be - * freed now. Notice that the data is not freed if there is a png_error, but - * it will be freed by destroy_read_struct. - */ - if (png_ptr->unknown_chunk.data != NULL) - png_free(png_ptr, png_ptr->unknown_chunk.data); - png_ptr->unknown_chunk.data = NULL; - -#else /* !PNG_READ_UNKNOWN_CHUNKS_SUPPORTED */ - /* There is no support to read an unknown chunk, so just skip it. */ - png_crc_finish(png_ptr, length); - PNG_UNUSED(info_ptr) - PNG_UNUSED(keep) -#endif /* !READ_UNKNOWN_CHUNKS */ - - /* Check for unhandled critical chunks */ - if (handled == 0 && PNG_CHUNK_CRITICAL(png_ptr->chunk_name)) - png_chunk_error(png_ptr, "unhandled critical chunk"); -} - -/* This function is called to verify that a chunk name is valid. - * This function can't have the "critical chunk check" incorporated - * into it, since in the future we will need to be able to call user - * functions to handle unknown critical chunks after we check that - * the chunk name itself is valid. - */ - -/* Bit hacking: the test for an invalid byte in the 4 byte chunk name is: - * - * ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) - */ - -void /* PRIVATE */ -png_check_chunk_name(png_structrp png_ptr, png_uint_32 chunk_name) -{ - int i; - - png_debug(1, "in png_check_chunk_name"); - - for (i=1; i<=4; ++i) - { - int c = chunk_name & 0xff; - - if (c < 65 || c > 122 || (c > 90 && c < 97)) - png_chunk_error(png_ptr, "invalid chunk type"); - - chunk_name >>= 8; - } -} - -/* Combines the row recently read in with the existing pixels in the row. This - * routine takes care of alpha and transparency if requested. This routine also - * handles the two methods of progressive display of interlaced images, - * depending on the 'display' value; if 'display' is true then the whole row - * (dp) is filled from the start by replicating the available pixels. If - * 'display' is false only those pixels present in the pass are filled in. - */ -void /* PRIVATE */ -png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display) -{ - unsigned int pixel_depth = png_ptr->transformed_pixel_depth; - png_const_bytep sp = png_ptr->row_buf + 1; - png_alloc_size_t row_width = png_ptr->width; - unsigned int pass = png_ptr->pass; - png_bytep end_ptr = 0; - png_byte end_byte = 0; - unsigned int end_mask; - - png_debug(1, "in png_combine_row"); - - /* Added in 1.5.6: it should not be possible to enter this routine until at - * least one row has been read from the PNG data and transformed. - */ - if (pixel_depth == 0) - png_error(png_ptr, "internal row logic error"); - - /* Added in 1.5.4: the pixel depth should match the information returned by - * any call to png_read_update_info at this point. Do not continue if we got - * this wrong. - */ - if (png_ptr->info_rowbytes != 0 && png_ptr->info_rowbytes != - PNG_ROWBYTES(pixel_depth, row_width)) - png_error(png_ptr, "internal row size calculation error"); - - /* Don't expect this to ever happen: */ - if (row_width == 0) - png_error(png_ptr, "internal row width error"); - - /* Preserve the last byte in cases where only part of it will be overwritten, - * the multiply below may overflow, we don't care because ANSI-C guarantees - * we get the low bits. - */ - end_mask = (pixel_depth * row_width) & 7; - if (end_mask != 0) - { - /* end_ptr == NULL is a flag to say do nothing */ - end_ptr = dp + PNG_ROWBYTES(pixel_depth, row_width) - 1; - end_byte = *end_ptr; -# ifdef PNG_READ_PACKSWAP_SUPPORTED - if ((png_ptr->transformations & PNG_PACKSWAP) != 0) - /* little-endian byte */ - end_mask = (unsigned int)(0xff << end_mask); - - else /* big-endian byte */ -# endif - end_mask = 0xff >> end_mask; - /* end_mask is now the bits to *keep* from the destination row */ - } - - /* For non-interlaced images this reduces to a memcpy(). A memcpy() - * will also happen if interlacing isn't supported or if the application - * does not call png_set_interlace_handling(). In the latter cases the - * caller just gets a sequence of the unexpanded rows from each interlace - * pass. - */ -#ifdef PNG_READ_INTERLACING_SUPPORTED - if (png_ptr->interlaced != 0 && - (png_ptr->transformations & PNG_INTERLACE) != 0 && - pass < 6 && (display == 0 || - /* The following copies everything for 'display' on passes 0, 2 and 4. */ - (display == 1 && (pass & 1) != 0))) - { - /* Narrow images may have no bits in a pass; the caller should handle - * this, but this test is cheap: - */ - if (row_width <= PNG_PASS_START_COL(pass)) - return; - - if (pixel_depth < 8) - { - /* For pixel depths up to 4 bpp the 8-pixel mask can be expanded to fit - * into 32 bits, then a single loop over the bytes using the four byte - * values in the 32-bit mask can be used. For the 'display' option the - * expanded mask may also not require any masking within a byte. To - * make this work the PACKSWAP option must be taken into account - it - * simply requires the pixels to be reversed in each byte. - * - * The 'regular' case requires a mask for each of the first 6 passes, - * the 'display' case does a copy for the even passes in the range - * 0..6. This has already been handled in the test above. - * - * The masks are arranged as four bytes with the first byte to use in - * the lowest bits (little-endian) regardless of the order (PACKSWAP or - * not) of the pixels in each byte. - * - * NOTE: the whole of this logic depends on the caller of this function - * only calling it on rows appropriate to the pass. This function only - * understands the 'x' logic; the 'y' logic is handled by the caller. - * - * The following defines allow generation of compile time constant bit - * masks for each pixel depth and each possibility of swapped or not - * swapped bytes. Pass 'p' is in the range 0..6; 'x', a pixel index, - * is in the range 0..7; and the result is 1 if the pixel is to be - * copied in the pass, 0 if not. 'S' is for the sparkle method, 'B' - * for the block method. - * - * With some compilers a compile time expression of the general form: - * - * (shift >= 32) ? (a >> (shift-32)) : (b >> shift) - * - * Produces warnings with values of 'shift' in the range 33 to 63 - * because the right hand side of the ?: expression is evaluated by - * the compiler even though it isn't used. Microsoft Visual C (various - * versions) and the Intel C compiler are known to do this. To avoid - * this the following macros are used in 1.5.6. This is a temporary - * solution to avoid destabilizing the code during the release process. - */ -# if PNG_USE_COMPILE_TIME_MASKS -# define PNG_LSR(x,s) ((x)>>((s) & 0x1f)) -# define PNG_LSL(x,s) ((x)<<((s) & 0x1f)) -# else -# define PNG_LSR(x,s) ((x)>>(s)) -# define PNG_LSL(x,s) ((x)<<(s)) -# endif -# define S_COPY(p,x) (((p)<4 ? PNG_LSR(0x80088822,(3-(p))*8+(7-(x))) :\ - PNG_LSR(0xaa55ff00,(7-(p))*8+(7-(x)))) & 1) -# define B_COPY(p,x) (((p)<4 ? PNG_LSR(0xff0fff33,(3-(p))*8+(7-(x))) :\ - PNG_LSR(0xff55ff00,(7-(p))*8+(7-(x)))) & 1) - - /* Return a mask for pass 'p' pixel 'x' at depth 'd'. The mask is - * little endian - the first pixel is at bit 0 - however the extra - * parameter 's' can be set to cause the mask position to be swapped - * within each byte, to match the PNG format. This is done by XOR of - * the shift with 7, 6 or 4 for bit depths 1, 2 and 4. - */ -# define PIXEL_MASK(p,x,d,s) \ - (PNG_LSL(((PNG_LSL(1U,(d)))-1),(((x)*(d))^((s)?8-(d):0)))) - - /* Hence generate the appropriate 'block' or 'sparkle' pixel copy mask. - */ -# define S_MASKx(p,x,d,s) (S_COPY(p,x)?PIXEL_MASK(p,x,d,s):0) -# define B_MASKx(p,x,d,s) (B_COPY(p,x)?PIXEL_MASK(p,x,d,s):0) - - /* Combine 8 of these to get the full mask. For the 1-bpp and 2-bpp - * cases the result needs replicating, for the 4-bpp case the above - * generates a full 32 bits. - */ -# define MASK_EXPAND(m,d) ((m)*((d)==1?0x01010101:((d)==2?0x00010001:1))) - -# define S_MASK(p,d,s) MASK_EXPAND(S_MASKx(p,0,d,s) + S_MASKx(p,1,d,s) +\ - S_MASKx(p,2,d,s) + S_MASKx(p,3,d,s) + S_MASKx(p,4,d,s) +\ - S_MASKx(p,5,d,s) + S_MASKx(p,6,d,s) + S_MASKx(p,7,d,s), d) - -# define B_MASK(p,d,s) MASK_EXPAND(B_MASKx(p,0,d,s) + B_MASKx(p,1,d,s) +\ - B_MASKx(p,2,d,s) + B_MASKx(p,3,d,s) + B_MASKx(p,4,d,s) +\ - B_MASKx(p,5,d,s) + B_MASKx(p,6,d,s) + B_MASKx(p,7,d,s), d) - -#if PNG_USE_COMPILE_TIME_MASKS - /* Utility macros to construct all the masks for a depth/swap - * combination. The 's' parameter says whether the format is PNG - * (big endian bytes) or not. Only the three odd-numbered passes are - * required for the display/block algorithm. - */ -# define S_MASKS(d,s) { S_MASK(0,d,s), S_MASK(1,d,s), S_MASK(2,d,s),\ - S_MASK(3,d,s), S_MASK(4,d,s), S_MASK(5,d,s) } - -# define B_MASKS(d,s) { B_MASK(1,d,s), B_MASK(3,d,s), B_MASK(5,d,s) } - -# define DEPTH_INDEX(d) ((d)==1?0:((d)==2?1:2)) - - /* Hence the pre-compiled masks indexed by PACKSWAP (or not), depth and - * then pass: - */ - static PNG_CONST png_uint_32 row_mask[2/*PACKSWAP*/][3/*depth*/][6] = - { - /* Little-endian byte masks for PACKSWAP */ - { S_MASKS(1,0), S_MASKS(2,0), S_MASKS(4,0) }, - /* Normal (big-endian byte) masks - PNG format */ - { S_MASKS(1,1), S_MASKS(2,1), S_MASKS(4,1) } - }; - - /* display_mask has only three entries for the odd passes, so index by - * pass>>1. - */ - static PNG_CONST png_uint_32 display_mask[2][3][3] = - { - /* Little-endian byte masks for PACKSWAP */ - { B_MASKS(1,0), B_MASKS(2,0), B_MASKS(4,0) }, - /* Normal (big-endian byte) masks - PNG format */ - { B_MASKS(1,1), B_MASKS(2,1), B_MASKS(4,1) } - }; - -# define MASK(pass,depth,display,png)\ - ((display)?display_mask[png][DEPTH_INDEX(depth)][pass>>1]:\ - row_mask[png][DEPTH_INDEX(depth)][pass]) - -#else /* !PNG_USE_COMPILE_TIME_MASKS */ - /* This is the runtime alternative: it seems unlikely that this will - * ever be either smaller or faster than the compile time approach. - */ -# define MASK(pass,depth,display,png)\ - ((display)?B_MASK(pass,depth,png):S_MASK(pass,depth,png)) -#endif /* !USE_COMPILE_TIME_MASKS */ - - /* Use the appropriate mask to copy the required bits. In some cases - * the byte mask will be 0 or 0xff; optimize these cases. row_width is - * the number of pixels, but the code copies bytes, so it is necessary - * to special case the end. - */ - png_uint_32 pixels_per_byte = 8 / pixel_depth; - png_uint_32 mask; - -# ifdef PNG_READ_PACKSWAP_SUPPORTED - if ((png_ptr->transformations & PNG_PACKSWAP) != 0) - mask = MASK(pass, pixel_depth, display, 0); - - else -# endif - mask = MASK(pass, pixel_depth, display, 1); - - for (;;) - { - png_uint_32 m; - - /* It doesn't matter in the following if png_uint_32 has more than - * 32 bits because the high bits always match those in m<<24; it is, - * however, essential to use OR here, not +, because of this. - */ - m = mask; - mask = (m >> 8) | (m << 24); /* rotate right to good compilers */ - m &= 0xff; - - if (m != 0) /* something to copy */ - { - if (m != 0xff) - *dp = (png_byte)((*dp & ~m) | (*sp & m)); - else - *dp = *sp; - } - - /* NOTE: this may overwrite the last byte with garbage if the image - * is not an exact number of bytes wide; libpng has always done - * this. - */ - if (row_width <= pixels_per_byte) - break; /* May need to restore part of the last byte */ - - row_width -= pixels_per_byte; - ++dp; - ++sp; - } - } - - else /* pixel_depth >= 8 */ - { - unsigned int bytes_to_copy, bytes_to_jump; - - /* Validate the depth - it must be a multiple of 8 */ - if (pixel_depth & 7) - png_error(png_ptr, "invalid user transform pixel depth"); - - pixel_depth >>= 3; /* now in bytes */ - row_width *= pixel_depth; - - /* Regardless of pass number the Adam 7 interlace always results in a - * fixed number of pixels to copy then to skip. There may be a - * different number of pixels to skip at the start though. - */ - { - unsigned int offset = PNG_PASS_START_COL(pass) * pixel_depth; - - row_width -= offset; - dp += offset; - sp += offset; - } - - /* Work out the bytes to copy. */ - if (display != 0) - { - /* When doing the 'block' algorithm the pixel in the pass gets - * replicated to adjacent pixels. This is why the even (0,2,4,6) - * passes are skipped above - the entire expanded row is copied. - */ - bytes_to_copy = (1<<((6-pass)>>1)) * pixel_depth; - - /* But don't allow this number to exceed the actual row width. */ - if (bytes_to_copy > row_width) - bytes_to_copy = (unsigned int)/*SAFE*/row_width; - } - - else /* normal row; Adam7 only ever gives us one pixel to copy. */ - bytes_to_copy = pixel_depth; - - /* In Adam7 there is a constant offset between where the pixels go. */ - bytes_to_jump = PNG_PASS_COL_OFFSET(pass) * pixel_depth; - - /* And simply copy these bytes. Some optimization is possible here, - * depending on the value of 'bytes_to_copy'. Special case the low - * byte counts, which we know to be frequent. - * - * Notice that these cases all 'return' rather than 'break' - this - * avoids an unnecessary test on whether to restore the last byte - * below. - */ - switch (bytes_to_copy) - { - case 1: - for (;;) - { - *dp = *sp; - - if (row_width <= bytes_to_jump) - return; - - dp += bytes_to_jump; - sp += bytes_to_jump; - row_width -= bytes_to_jump; - } - - case 2: - /* There is a possibility of a partial copy at the end here; this - * slows the code down somewhat. - */ - do - { - dp[0] = sp[0], dp[1] = sp[1]; - - if (row_width <= bytes_to_jump) - return; - - sp += bytes_to_jump; - dp += bytes_to_jump; - row_width -= bytes_to_jump; - } - while (row_width > 1); - - /* And there can only be one byte left at this point: */ - *dp = *sp; - return; - - case 3: - /* This can only be the RGB case, so each copy is exactly one - * pixel and it is not necessary to check for a partial copy. - */ - for (;;) - { - dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2]; - - if (row_width <= bytes_to_jump) - return; - - sp += bytes_to_jump; - dp += bytes_to_jump; - row_width -= bytes_to_jump; - } - - default: -#if PNG_ALIGN_TYPE != PNG_ALIGN_NONE - /* Check for double byte alignment and, if possible, use a - * 16-bit copy. Don't attempt this for narrow images - ones that - * are less than an interlace panel wide. Don't attempt it for - * wide bytes_to_copy either - use the memcpy there. - */ - if (bytes_to_copy < 16 /*else use memcpy*/ && - png_isaligned(dp, png_uint_16) && - png_isaligned(sp, png_uint_16) && - bytes_to_copy % (sizeof (png_uint_16)) == 0 && - bytes_to_jump % (sizeof (png_uint_16)) == 0) - { - /* Everything is aligned for png_uint_16 copies, but try for - * png_uint_32 first. - */ - if (png_isaligned(dp, png_uint_32) && - png_isaligned(sp, png_uint_32) && - bytes_to_copy % (sizeof (png_uint_32)) == 0 && - bytes_to_jump % (sizeof (png_uint_32)) == 0) - { - png_uint_32p dp32 = png_aligncast(png_uint_32p,dp); - png_const_uint_32p sp32 = png_aligncastconst( - png_const_uint_32p, sp); - size_t skip = (bytes_to_jump-bytes_to_copy) / - (sizeof (png_uint_32)); - - do - { - size_t c = bytes_to_copy; - do - { - *dp32++ = *sp32++; - c -= (sizeof (png_uint_32)); - } - while (c > 0); - - if (row_width <= bytes_to_jump) - return; - - dp32 += skip; - sp32 += skip; - row_width -= bytes_to_jump; - } - while (bytes_to_copy <= row_width); - - /* Get to here when the row_width truncates the final copy. - * There will be 1-3 bytes left to copy, so don't try the - * 16-bit loop below. - */ - dp = (png_bytep)dp32; - sp = (png_const_bytep)sp32; - do - *dp++ = *sp++; - while (--row_width > 0); - return; - } - - /* Else do it in 16-bit quantities, but only if the size is - * not too large. - */ - else - { - png_uint_16p dp16 = png_aligncast(png_uint_16p, dp); - png_const_uint_16p sp16 = png_aligncastconst( - png_const_uint_16p, sp); - size_t skip = (bytes_to_jump-bytes_to_copy) / - (sizeof (png_uint_16)); - - do - { - size_t c = bytes_to_copy; - do - { - *dp16++ = *sp16++; - c -= (sizeof (png_uint_16)); - } - while (c > 0); - - if (row_width <= bytes_to_jump) - return; - - dp16 += skip; - sp16 += skip; - row_width -= bytes_to_jump; - } - while (bytes_to_copy <= row_width); - - /* End of row - 1 byte left, bytes_to_copy > row_width: */ - dp = (png_bytep)dp16; - sp = (png_const_bytep)sp16; - do - *dp++ = *sp++; - while (--row_width > 0); - return; - } - } -#endif /* ALIGN_TYPE code */ - - /* The true default - use a memcpy: */ - for (;;) - { - memcpy(dp, sp, bytes_to_copy); - - if (row_width <= bytes_to_jump) - return; - - sp += bytes_to_jump; - dp += bytes_to_jump; - row_width -= bytes_to_jump; - if (bytes_to_copy > row_width) - bytes_to_copy = (unsigned int)/*SAFE*/row_width; - } - } - - /* NOT REACHED*/ - } /* pixel_depth >= 8 */ - - /* Here if pixel_depth < 8 to check 'end_ptr' below. */ - } - else -#endif /* READ_INTERLACING */ - - /* If here then the switch above wasn't used so just memcpy the whole row - * from the temporary row buffer (notice that this overwrites the end of the - * destination row if it is a partial byte.) - */ - memcpy(dp, sp, PNG_ROWBYTES(pixel_depth, row_width)); - - /* Restore the overwritten bits from the last byte if necessary. */ - if (end_ptr != NULL) - *end_ptr = (png_byte)((end_byte & end_mask) | (*end_ptr & ~end_mask)); -} - -#ifdef PNG_READ_INTERLACING_SUPPORTED -void /* PRIVATE */ -png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, - png_uint_32 transformations /* Because these may affect the byte layout */) -{ - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - /* Offset to next interlace block */ - static PNG_CONST unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - png_debug(1, "in png_do_read_interlace"); - if (row != NULL && row_info != NULL) - { - png_uint_32 final_width; - - final_width = row_info->width * png_pass_inc[pass]; - - switch (row_info->pixel_depth) - { - case 1: - { - png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 3); - png_bytep dp = row + (png_size_t)((final_width - 1) >> 3); - unsigned int sshift, dshift; - unsigned int s_start, s_end; - int s_inc; - int jstop = (int)png_pass_inc[pass]; - png_byte v; - png_uint_32 i; - int j; - -#ifdef PNG_READ_PACKSWAP_SUPPORTED - if ((transformations & PNG_PACKSWAP) != 0) - { - sshift = ((row_info->width + 7) & 0x07); - dshift = ((final_width + 7) & 0x07); - s_start = 7; - s_end = 0; - s_inc = -1; - } - - else -#endif - { - sshift = 7 - ((row_info->width + 7) & 0x07); - dshift = 7 - ((final_width + 7) & 0x07); - s_start = 0; - s_end = 7; - s_inc = 1; - } - - for (i = 0; i < row_info->width; i++) - { - v = (png_byte)((*sp >> sshift) & 0x01); - for (j = 0; j < jstop; j++) - { - unsigned int tmp = *dp & (0x7f7f >> (7 - dshift)); - tmp |= (unsigned int)(v << dshift); - *dp = (png_byte)(tmp & 0xff); - - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - - else - dshift = (unsigned int)((int)dshift + s_inc); - } - - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - - else - sshift = (unsigned int)((int)sshift + s_inc); - } - break; - } - - case 2: - { - png_bytep sp = row + (png_uint_32)((row_info->width - 1) >> 2); - png_bytep dp = row + (png_uint_32)((final_width - 1) >> 2); - unsigned int sshift, dshift; - unsigned int s_start, s_end; - int s_inc; - int jstop = (int)png_pass_inc[pass]; - png_uint_32 i; - -#ifdef PNG_READ_PACKSWAP_SUPPORTED - if ((transformations & PNG_PACKSWAP) != 0) - { - sshift = (((row_info->width + 3) & 0x03) << 1); - dshift = (((final_width + 3) & 0x03) << 1); - s_start = 6; - s_end = 0; - s_inc = -2; - } - - else -#endif - { - sshift = ((3 - ((row_info->width + 3) & 0x03)) << 1); - dshift = ((3 - ((final_width + 3) & 0x03)) << 1); - s_start = 0; - s_end = 6; - s_inc = 2; - } - - for (i = 0; i < row_info->width; i++) - { - png_byte v; - int j; - - v = (png_byte)((*sp >> sshift) & 0x03); - for (j = 0; j < jstop; j++) - { - unsigned int tmp = *dp & (0x3f3f >> (6 - dshift)); - tmp |= (unsigned int)(v << dshift); - *dp = (png_byte)(tmp & 0xff); - - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - - else - dshift = (unsigned int)((int)dshift + s_inc); - } - - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - - else - sshift = (unsigned int)((int)sshift + s_inc); - } - break; - } - - case 4: - { - png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 1); - png_bytep dp = row + (png_size_t)((final_width - 1) >> 1); - unsigned int sshift, dshift; - unsigned int s_start, s_end; - int s_inc; - png_uint_32 i; - int jstop = (int)png_pass_inc[pass]; - -#ifdef PNG_READ_PACKSWAP_SUPPORTED - if ((transformations & PNG_PACKSWAP) != 0) - { - sshift = (((row_info->width + 1) & 0x01) << 2); - dshift = (((final_width + 1) & 0x01) << 2); - s_start = 4; - s_end = 0; - s_inc = -4; - } - - else -#endif - { - sshift = ((1 - ((row_info->width + 1) & 0x01)) << 2); - dshift = ((1 - ((final_width + 1) & 0x01)) << 2); - s_start = 0; - s_end = 4; - s_inc = 4; - } - - for (i = 0; i < row_info->width; i++) - { - png_byte v = (png_byte)((*sp >> sshift) & 0x0f); - int j; - - for (j = 0; j < jstop; j++) - { - unsigned int tmp = *dp & (0xf0f >> (4 - dshift)); - tmp |= (unsigned int)(v << dshift); - *dp = (png_byte)(tmp & 0xff); - - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - - else - dshift = (unsigned int)((int)dshift + s_inc); - } - - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - - else - sshift = (unsigned int)((int)sshift + s_inc); - } - break; - } - - default: - { - png_size_t pixel_bytes = (row_info->pixel_depth >> 3); - - png_bytep sp = row + (png_size_t)(row_info->width - 1) - * pixel_bytes; - - png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes; - - int jstop = (int)png_pass_inc[pass]; - png_uint_32 i; - - for (i = 0; i < row_info->width; i++) - { - png_byte v[8]; /* SAFE; pixel_depth does not exceed 64 */ - int j; - - memcpy(v, sp, pixel_bytes); - - for (j = 0; j < jstop; j++) - { - memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - - sp -= pixel_bytes; - } - break; - } - } - - row_info->width = final_width; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width); - } -#ifndef PNG_READ_PACKSWAP_SUPPORTED - PNG_UNUSED(transformations) /* Silence compiler warning */ -#endif -} -#endif /* READ_INTERLACING */ - -static void -png_read_filter_row_sub(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) -{ - png_size_t i; - png_size_t istop = row_info->rowbytes; - unsigned int bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp = row + bpp; - - PNG_UNUSED(prev_row) - - for (i = bpp; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff); - rp++; - } -} - -static void -png_read_filter_row_up(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) -{ - png_size_t i; - png_size_t istop = row_info->rowbytes; - png_bytep rp = row; - png_const_bytep pp = prev_row; - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } -} - -static void -png_read_filter_row_avg(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) -{ - png_size_t i; - png_bytep rp = row; - png_const_bytep pp = prev_row; - unsigned int bpp = (row_info->pixel_depth + 7) >> 3; - png_size_t istop = row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + - ((int)(*pp++) / 2 )) & 0xff); - - rp++; - } - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + - (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff); - - rp++; - } -} - -static void -png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) -{ - png_bytep rp_end = row + row_info->rowbytes; - int a, c; - - /* First pixel/byte */ - c = *prev_row++; - a = *row + c; - *row++ = (png_byte)a; - - /* Remainder */ - while (row < rp_end) - { - int b, pa, pb, pc, p; - - a &= 0xff; /* From previous iteration or start */ - b = *prev_row++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - /* Find the best predictor, the least of pa, pb, pc favoring the earlier - * ones in the case of a tie. - */ - if (pb < pa) pa = pb, a = b; - if (pc < pa) a = c; - - /* Calculate the current pixel in a, and move the previous row pixel to c - * for the next time round the loop - */ - c = b; - a += *row; - *row++ = (png_byte)a; - } -} - -static void -png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) -{ - unsigned int bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp_end = row + bpp; - - /* Process the first pixel in the row completely (this is the same as 'up' - * because there is only one candidate predictor for the first row). - */ - while (row < rp_end) - { - int a = *row + *prev_row++; - *row++ = (png_byte)a; - } - - /* Remainder */ - rp_end = rp_end + (row_info->rowbytes - bpp); - - while (row < rp_end) - { - int a, b, c, pa, pb, pc, p; - - c = *(prev_row - bpp); - a = *(row - bpp); - b = *prev_row++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - if (pb < pa) pa = pb, a = b; - if (pc < pa) a = c; - - a += *row; - *row++ = (png_byte)a; - } -} - -static void -png_init_filter_functions(png_structrp pp) - /* This function is called once for every PNG image (except for PNG images - * that only use PNG_FILTER_VALUE_NONE for all rows) to set the - * implementations required to reverse the filtering of PNG rows. Reversing - * the filter is the first transformation performed on the row data. It is - * performed in place, therefore an implementation can be selected based on - * the image pixel format. If the implementation depends on image width then - * take care to ensure that it works correctly if the image is interlaced - - * interlacing causes the actual row width to vary. - */ -{ - unsigned int bpp = (pp->pixel_depth + 7) >> 3; - - pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub; - pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up; - pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg; - if (bpp == 1) - pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = - png_read_filter_row_paeth_1byte_pixel; - else - pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = - png_read_filter_row_paeth_multibyte_pixel; - -#ifdef PNG_FILTER_OPTIMIZATIONS - /* To use this define PNG_FILTER_OPTIMIZATIONS as the name of a function to - * call to install hardware optimizations for the above functions; simply - * replace whatever elements of the pp->read_filter[] array with a hardware - * specific (or, for that matter, generic) optimization. - * - * To see an example of this examine what configure.ac does when - * --enable-arm-neon is specified on the command line. - */ - PNG_FILTER_OPTIMIZATIONS(pp, bpp); -#endif -} - -void /* PRIVATE */ -png_read_filter_row(png_structrp pp, png_row_infop row_info, png_bytep row, - png_const_bytep prev_row, int filter) -{ - /* OPTIMIZATION: DO NOT MODIFY THIS FUNCTION, instead #define - * PNG_FILTER_OPTIMIZATIONS to a function that overrides the generic - * implementations. See png_init_filter_functions above. - */ - if (filter > PNG_FILTER_VALUE_NONE && filter < PNG_FILTER_VALUE_LAST) - { - if (pp->read_filter[0] == NULL) - png_init_filter_functions(pp); - - pp->read_filter[filter-1](row_info, row, prev_row); - } -} - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -void /* PRIVATE */ -png_read_IDAT_data(png_structrp png_ptr, png_bytep output, - png_alloc_size_t avail_out) -{ - /* Loop reading IDATs and decompressing the result into output[avail_out] */ - png_ptr->zstream.next_out = output; - png_ptr->zstream.avail_out = 0; /* safety: set below */ - - if (output == NULL) - avail_out = 0; - - do - { - int ret; - png_byte tmpbuf[PNG_INFLATE_BUF_SIZE]; - - if (png_ptr->zstream.avail_in == 0) - { - uInt avail_in; - png_bytep buffer; - - while (png_ptr->idat_size == 0) - { - png_crc_finish(png_ptr, 0); - - png_ptr->idat_size = png_read_chunk_header(png_ptr); - /* This is an error even in the 'check' case because the code just - * consumed a non-IDAT header. - */ - if (png_ptr->chunk_name != png_IDAT) - png_error(png_ptr, "Not enough image data"); - } - - avail_in = png_ptr->IDAT_read_size; - - if (avail_in > png_ptr->idat_size) - avail_in = (uInt)png_ptr->idat_size; - - /* A PNG with a gradually increasing IDAT size will defeat this attempt - * to minimize memory usage by causing lots of re-allocs, but - * realistically doing IDAT_read_size re-allocs is not likely to be a - * big problem. - */ - buffer = png_read_buffer(png_ptr, avail_in, 0/*error*/); - - png_crc_read(png_ptr, buffer, avail_in); - png_ptr->idat_size -= avail_in; - - png_ptr->zstream.next_in = buffer; - png_ptr->zstream.avail_in = avail_in; - } - - /* And set up the output side. */ - if (output != NULL) /* standard read */ - { - uInt out = ZLIB_IO_MAX; - - if (out > avail_out) - out = (uInt)avail_out; - - avail_out -= out; - png_ptr->zstream.avail_out = out; - } - - else /* after last row, checking for end */ - { - png_ptr->zstream.next_out = tmpbuf; - png_ptr->zstream.avail_out = (sizeof tmpbuf); - } - - /* Use NO_FLUSH; this gives zlib the maximum opportunity to optimize the - * process. If the LZ stream is truncated the sequential reader will - * terminally damage the stream, above, by reading the chunk header of the - * following chunk (it then exits with png_error). - * - * TODO: deal more elegantly with truncated IDAT lists. - */ - ret = PNG_INFLATE(png_ptr, Z_NO_FLUSH); - - /* Take the unconsumed output back. */ - if (output != NULL) - avail_out += png_ptr->zstream.avail_out; - - else /* avail_out counts the extra bytes */ - avail_out += (sizeof tmpbuf) - png_ptr->zstream.avail_out; - - png_ptr->zstream.avail_out = 0; - - if (ret == Z_STREAM_END) - { - /* Do this for safety; we won't read any more into this row. */ - png_ptr->zstream.next_out = NULL; - - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; - - if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0) - png_chunk_benign_error(png_ptr, "Extra compressed data"); - break; - } - - if (ret != Z_OK) - { - png_zstream_error(png_ptr, ret); - - if (output != NULL) - png_chunk_error(png_ptr, png_ptr->zstream.msg); - - else /* checking */ - { - png_chunk_benign_error(png_ptr, png_ptr->zstream.msg); - return; - } - } - } while (avail_out > 0); - - if (avail_out > 0) - { - /* The stream ended before the image; this is the same as too few IDATs so - * should be handled the same way. - */ - if (output != NULL) - png_error(png_ptr, "Not enough image data"); - - else /* the deflate stream contained extra data */ - png_chunk_benign_error(png_ptr, "Too much image data"); - } -} - -void /* PRIVATE */ -png_read_finish_IDAT(png_structrp png_ptr) -{ - /* We don't need any more data and the stream should have ended, however the - * LZ end code may actually not have been processed. In this case we must - * read it otherwise stray unread IDAT data or, more likely, an IDAT chunk - * may still remain to be consumed. - */ - if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0) - { - /* The NULL causes png_read_IDAT_data to swallow any remaining bytes in - * the compressed stream, but the stream may be damaged too, so even after - * this call we may need to terminate the zstream ownership. - */ - png_read_IDAT_data(png_ptr, NULL, 0); - png_ptr->zstream.next_out = NULL; /* safety */ - - /* Now clear everything out for safety; the following may not have been - * done. - */ - if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0) - { - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; - } - } - - /* If the zstream has not been released do it now *and* terminate the reading - * of the final IDAT chunk. - */ - if (png_ptr->zowner == png_IDAT) - { - /* Always do this; the pointers otherwise point into the read buffer. */ - png_ptr->zstream.next_in = NULL; - png_ptr->zstream.avail_in = 0; - - /* Now we no longer own the zstream. */ - png_ptr->zowner = 0; - - /* The slightly weird semantics of the sequential IDAT reading is that we - * are always in or at the end of an IDAT chunk, so we always need to do a - * crc_finish here. If idat_size is non-zero we also need to read the - * spurious bytes at the end of the chunk now. - */ - (void)png_crc_finish(png_ptr, png_ptr->idat_size); - } -} - -void /* PRIVATE */ -png_read_finish_row(png_structrp png_ptr) -{ - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; - - png_debug(1, "in png_read_finish_row"); - png_ptr->row_number++; - if (png_ptr->row_number < png_ptr->num_rows) - return; - - if (png_ptr->interlaced != 0) - { - png_ptr->row_number = 0; - - /* TO DO: don't do this if prev_row isn't needed (requires - * read-ahead of the next row's filter byte. - */ - memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); - - do - { - png_ptr->pass++; - - if (png_ptr->pass >= 7) - break; - - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - if ((png_ptr->transformations & PNG_INTERLACE) == 0) - { - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - } - - else /* if (png_ptr->transformations & PNG_INTERLACE) */ - break; /* libpng deinterlacing sees every row */ - - } while (png_ptr->num_rows == 0 || png_ptr->iwidth == 0); - - if (png_ptr->pass < 7) - return; - } - - /* Here after at the end of the last row of the last pass. */ - png_read_finish_IDAT(png_ptr); -} -#endif /* SEQUENTIAL_READ */ - -void /* PRIVATE */ -png_read_start_row(png_structrp png_ptr) -{ - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; - - unsigned int max_pixel_depth; - png_size_t row_bytes; - - png_debug(1, "in png_read_start_row"); - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED - png_init_read_transformations(png_ptr); -#endif - if (png_ptr->interlaced != 0) - { - if ((png_ptr->transformations & PNG_INTERLACE) == 0) - png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - - png_pass_ystart[0]) / png_pass_yinc[0]; - - else - png_ptr->num_rows = png_ptr->height; - - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - } - - else - { - png_ptr->num_rows = png_ptr->height; - png_ptr->iwidth = png_ptr->width; - } - - max_pixel_depth = (unsigned int)png_ptr->pixel_depth; - - /* WARNING: * png_read_transform_info (pngrtran.c) performs a simpler set of - * calculations to calculate the final pixel depth, then - * png_do_read_transforms actually does the transforms. This means that the - * code which effectively calculates this value is actually repeated in three - * separate places. They must all match. Innocent changes to the order of - * transformations can and will break libpng in a way that causes memory - * overwrites. - * - * TODO: fix this. - */ -#ifdef PNG_READ_PACK_SUPPORTED - if ((png_ptr->transformations & PNG_PACK) != 0 && png_ptr->bit_depth < 8) - max_pixel_depth = 8; -#endif - -#ifdef PNG_READ_EXPAND_SUPPORTED - if ((png_ptr->transformations & PNG_EXPAND) != 0) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (png_ptr->num_trans != 0) - max_pixel_depth = 32; - - else - max_pixel_depth = 24; - } - - else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) - { - if (max_pixel_depth < 8) - max_pixel_depth = 8; - - if (png_ptr->num_trans != 0) - max_pixel_depth *= 2; - } - - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - if (png_ptr->num_trans != 0) - { - max_pixel_depth *= 4; - max_pixel_depth /= 3; - } - } - } -#endif - -#ifdef PNG_READ_EXPAND_16_SUPPORTED - if ((png_ptr->transformations & PNG_EXPAND_16) != 0) - { -# ifdef PNG_READ_EXPAND_SUPPORTED - /* In fact it is an error if it isn't supported, but checking is - * the safe way. - */ - if ((png_ptr->transformations & PNG_EXPAND) != 0) - { - if (png_ptr->bit_depth < 16) - max_pixel_depth *= 2; - } - else -# endif - png_ptr->transformations &= ~PNG_EXPAND_16; - } -#endif - -#ifdef PNG_READ_FILLER_SUPPORTED - if ((png_ptr->transformations & (PNG_FILLER)) != 0) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) - { - if (max_pixel_depth <= 8) - max_pixel_depth = 16; - - else - max_pixel_depth = 32; - } - - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB || - png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (max_pixel_depth <= 32) - max_pixel_depth = 32; - - else - max_pixel_depth = 64; - } - } -#endif - -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) != 0) - { - if ( -#ifdef PNG_READ_EXPAND_SUPPORTED - (png_ptr->num_trans != 0 && - (png_ptr->transformations & PNG_EXPAND) != 0) || -#endif -#ifdef PNG_READ_FILLER_SUPPORTED - (png_ptr->transformations & (PNG_FILLER)) != 0 || -#endif - png_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - if (max_pixel_depth <= 16) - max_pixel_depth = 32; - - else - max_pixel_depth = 64; - } - - else - { - if (max_pixel_depth <= 8) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - max_pixel_depth = 32; - - else - max_pixel_depth = 24; - } - - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - max_pixel_depth = 64; - - else - max_pixel_depth = 48; - } - } -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) && \ -defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - if ((png_ptr->transformations & PNG_USER_TRANSFORM) != 0) - { - unsigned int user_pixel_depth = png_ptr->user_transform_depth * - png_ptr->user_transform_channels; - - if (user_pixel_depth > max_pixel_depth) - max_pixel_depth = user_pixel_depth; - } -#endif - - /* This value is stored in png_struct and double checked in the row read - * code. - */ - png_ptr->maximum_pixel_depth = (png_byte)max_pixel_depth; - png_ptr->transformed_pixel_depth = 0; /* calculated on demand */ - - /* Align the width on the next larger 8 pixels. Mainly used - * for interlacing - */ - row_bytes = ((png_ptr->width + 7) & ~((png_uint_32)7)); - /* Calculate the maximum bytes needed, adding a byte and a pixel - * for safety's sake - */ - row_bytes = PNG_ROWBYTES(max_pixel_depth, row_bytes) + - 1 + ((max_pixel_depth + 7) >> 3U); - -#ifdef PNG_MAX_MALLOC_64K - if (row_bytes > (png_uint_32)65536L) - png_error(png_ptr, "This image requires a row greater than 64KB"); -#endif - - if (row_bytes + 48 > png_ptr->old_big_row_buf_size) - { - png_free(png_ptr, png_ptr->big_row_buf); - png_free(png_ptr, png_ptr->big_prev_row); - - if (png_ptr->interlaced != 0) - png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr, - row_bytes + 48); - - else - png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes + 48); - - png_ptr->big_prev_row = (png_bytep)png_malloc(png_ptr, row_bytes + 48); - -#ifdef PNG_ALIGNED_MEMORY_SUPPORTED - /* Use 16-byte aligned memory for row_buf with at least 16 bytes - * of padding before and after row_buf; treat prev_row similarly. - * NOTE: the alignment is to the start of the pixels, one beyond the start - * of the buffer, because of the filter byte. Prior to libpng 1.5.6 this - * was incorrect; the filter byte was aligned, which had the exact - * opposite effect of that intended. - */ - { - png_bytep temp = png_ptr->big_row_buf + 32; - int extra = (int)((temp - (png_bytep)0) & 0x0f); - png_ptr->row_buf = temp - extra - 1/*filter byte*/; - - temp = png_ptr->big_prev_row + 32; - extra = (int)((temp - (png_bytep)0) & 0x0f); - png_ptr->prev_row = temp - extra - 1/*filter byte*/; - } - -#else - /* Use 31 bytes of padding before and 17 bytes after row_buf. */ - png_ptr->row_buf = png_ptr->big_row_buf + 31; - png_ptr->prev_row = png_ptr->big_prev_row + 31; -#endif - png_ptr->old_big_row_buf_size = row_bytes + 48; - } - -#ifdef PNG_MAX_MALLOC_64K - if (png_ptr->rowbytes > 65535) - png_error(png_ptr, "This image requires a row greater than 64KB"); - -#endif - if (png_ptr->rowbytes > (PNG_SIZE_MAX - 1)) - png_error(png_ptr, "Row has too many bytes to allocate in memory"); - - memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); - - png_debug1(3, "width = %u,", png_ptr->width); - png_debug1(3, "height = %u,", png_ptr->height); - png_debug1(3, "iwidth = %u,", png_ptr->iwidth); - png_debug1(3, "num_rows = %u,", png_ptr->num_rows); - png_debug1(3, "rowbytes = %lu,", (unsigned long)png_ptr->rowbytes); - png_debug1(3, "irowbytes = %lu", - (unsigned long)PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1); - - /* The sequential reader needs a buffer for IDAT, but the progressive reader - * does not, so free the read buffer now regardless; the sequential reader - * reallocates it on demand. - */ - if (png_ptr->read_buffer != NULL) - { - png_bytep buffer = png_ptr->read_buffer; - - png_ptr->read_buffer_size = 0; - png_ptr->read_buffer = NULL; - png_free(png_ptr, buffer); - } - - /* Finally claim the zstream for the inflate of the IDAT data, use the bits - * value from the stream (note that this will result in a fatal error if the - * IDAT stream has a bogus deflate header window_bits value, but this should - * not be happening any longer!) - */ - if (png_inflate_claim(png_ptr, png_IDAT) != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg); - - png_ptr->flags |= PNG_FLAG_ROW_INIT; -} -#endif /* READ */ diff --git a/jan/src/dep/libs/libpng/pngset.c b/jan/src/dep/libs/libpng/pngset.c deleted file mode 100644 index 843d30282..000000000 --- a/jan/src/dep/libs/libpng/pngset.c +++ /dev/null @@ -1,1751 +0,0 @@ - -/* pngset.c - storage of image information into info struct - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - * The functions here are used during reads to store data from the file - * into the info struct, and during writes to store application data - * into the info struct for writing into the file. This abstracts the - * info struct and allows us to change the structure in the future. - */ - -#include "pngpriv.h" - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) - -#ifdef PNG_bKGD_SUPPORTED -void PNGAPI -png_set_bKGD(png_const_structrp png_ptr, png_inforp info_ptr, - png_const_color_16p background) -{ - png_debug1(1, "in %s storage function", "bKGD"); - - if (png_ptr == NULL || info_ptr == NULL || background == NULL) - return; - - info_ptr->background = *background; - info_ptr->valid |= PNG_INFO_bKGD; -} -#endif - -#ifdef PNG_cHRM_SUPPORTED -void PNGFAPI -png_set_cHRM_fixed(png_const_structrp png_ptr, png_inforp info_ptr, - png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, - png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, - png_fixed_point blue_x, png_fixed_point blue_y) -{ - png_xy xy; - - png_debug1(1, "in %s storage function", "cHRM fixed"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - xy.redx = red_x; - xy.redy = red_y; - xy.greenx = green_x; - xy.greeny = green_y; - xy.bluex = blue_x; - xy.bluey = blue_y; - xy.whitex = white_x; - xy.whitey = white_y; - - if (png_colorspace_set_chromaticities(png_ptr, &info_ptr->colorspace, &xy, - 2/* override with app values*/) != 0) - info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM; - - png_colorspace_sync_info(png_ptr, info_ptr); -} - -void PNGFAPI -png_set_cHRM_XYZ_fixed(png_const_structrp png_ptr, png_inforp info_ptr, - png_fixed_point int_red_X, png_fixed_point int_red_Y, - png_fixed_point int_red_Z, png_fixed_point int_green_X, - png_fixed_point int_green_Y, png_fixed_point int_green_Z, - png_fixed_point int_blue_X, png_fixed_point int_blue_Y, - png_fixed_point int_blue_Z) -{ - png_XYZ XYZ; - - png_debug1(1, "in %s storage function", "cHRM XYZ fixed"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - XYZ.red_X = int_red_X; - XYZ.red_Y = int_red_Y; - XYZ.red_Z = int_red_Z; - XYZ.green_X = int_green_X; - XYZ.green_Y = int_green_Y; - XYZ.green_Z = int_green_Z; - XYZ.blue_X = int_blue_X; - XYZ.blue_Y = int_blue_Y; - XYZ.blue_Z = int_blue_Z; - - if (png_colorspace_set_endpoints(png_ptr, &info_ptr->colorspace, - &XYZ, 2) != 0) - info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM; - - png_colorspace_sync_info(png_ptr, info_ptr); -} - -# ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_cHRM(png_const_structrp png_ptr, png_inforp info_ptr, - double white_x, double white_y, double red_x, double red_y, - double green_x, double green_y, double blue_x, double blue_y) -{ - png_set_cHRM_fixed(png_ptr, info_ptr, - png_fixed(png_ptr, white_x, "cHRM White X"), - png_fixed(png_ptr, white_y, "cHRM White Y"), - png_fixed(png_ptr, red_x, "cHRM Red X"), - png_fixed(png_ptr, red_y, "cHRM Red Y"), - png_fixed(png_ptr, green_x, "cHRM Green X"), - png_fixed(png_ptr, green_y, "cHRM Green Y"), - png_fixed(png_ptr, blue_x, "cHRM Blue X"), - png_fixed(png_ptr, blue_y, "cHRM Blue Y")); -} - -void PNGAPI -png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X, - double red_Y, double red_Z, double green_X, double green_Y, double green_Z, - double blue_X, double blue_Y, double blue_Z) -{ - png_set_cHRM_XYZ_fixed(png_ptr, info_ptr, - png_fixed(png_ptr, red_X, "cHRM Red X"), - png_fixed(png_ptr, red_Y, "cHRM Red Y"), - png_fixed(png_ptr, red_Z, "cHRM Red Z"), - png_fixed(png_ptr, green_X, "cHRM Green X"), - png_fixed(png_ptr, green_Y, "cHRM Green Y"), - png_fixed(png_ptr, green_Z, "cHRM Green Z"), - png_fixed(png_ptr, blue_X, "cHRM Blue X"), - png_fixed(png_ptr, blue_Y, "cHRM Blue Y"), - png_fixed(png_ptr, blue_Z, "cHRM Blue Z")); -} -# endif /* FLOATING_POINT */ - -#endif /* cHRM */ - -#ifdef PNG_gAMA_SUPPORTED -void PNGFAPI -png_set_gAMA_fixed(png_const_structrp png_ptr, png_inforp info_ptr, - png_fixed_point file_gamma) -{ - png_debug1(1, "in %s storage function", "gAMA"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_colorspace_set_gamma(png_ptr, &info_ptr->colorspace, file_gamma); - png_colorspace_sync_info(png_ptr, info_ptr); -} - -# ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_gAMA(png_const_structrp png_ptr, png_inforp info_ptr, double file_gamma) -{ - png_set_gAMA_fixed(png_ptr, info_ptr, png_fixed(png_ptr, file_gamma, - "png_set_gAMA")); -} -# endif -#endif - -#ifdef PNG_hIST_SUPPORTED -void PNGAPI -png_set_hIST(png_const_structrp png_ptr, png_inforp info_ptr, - png_const_uint_16p hist) -{ - int i; - - png_debug1(1, "in %s storage function", "hIST"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (info_ptr->num_palette == 0 || info_ptr->num_palette - > PNG_MAX_PALETTE_LENGTH) - { - png_warning(png_ptr, - "Invalid palette size, hIST allocation skipped"); - - return; - } - - png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0); - - /* Changed from info->num_palette to PNG_MAX_PALETTE_LENGTH in - * version 1.2.1 - */ - info_ptr->hist = png_voidcast(png_uint_16p, png_malloc_warn(png_ptr, - PNG_MAX_PALETTE_LENGTH * (sizeof (png_uint_16)))); - - if (info_ptr->hist == NULL) - { - png_warning(png_ptr, "Insufficient memory for hIST chunk data"); - - return; - } - - info_ptr->free_me |= PNG_FREE_HIST; - - for (i = 0; i < info_ptr->num_palette; i++) - info_ptr->hist[i] = hist[i]; - - info_ptr->valid |= PNG_INFO_hIST; -} -#endif - -void PNGAPI -png_set_IHDR(png_const_structrp png_ptr, png_inforp info_ptr, - png_uint_32 width, png_uint_32 height, int bit_depth, - int color_type, int interlace_type, int compression_type, - int filter_type) -{ - png_debug1(1, "in %s storage function", "IHDR"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->width = width; - info_ptr->height = height; - info_ptr->bit_depth = (png_byte)bit_depth; - info_ptr->color_type = (png_byte)color_type; - info_ptr->compression_type = (png_byte)compression_type; - info_ptr->filter_type = (png_byte)filter_type; - info_ptr->interlace_type = (png_byte)interlace_type; - - png_check_IHDR (png_ptr, info_ptr->width, info_ptr->height, - info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type, - info_ptr->compression_type, info_ptr->filter_type); - - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - info_ptr->channels = 1; - - else if ((info_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) - info_ptr->channels = 3; - - else - info_ptr->channels = 1; - - if ((info_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0) - info_ptr->channels++; - - info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); - - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); -} - -#ifdef PNG_oFFs_SUPPORTED -void PNGAPI -png_set_oFFs(png_const_structrp png_ptr, png_inforp info_ptr, - png_int_32 offset_x, png_int_32 offset_y, int unit_type) -{ - png_debug1(1, "in %s storage function", "oFFs"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->x_offset = offset_x; - info_ptr->y_offset = offset_y; - info_ptr->offset_unit_type = (png_byte)unit_type; - info_ptr->valid |= PNG_INFO_oFFs; -} -#endif - -#ifdef PNG_pCAL_SUPPORTED -void PNGAPI -png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, - png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type, - int nparams, png_const_charp units, png_charpp params) -{ - png_size_t length; - int i; - - png_debug1(1, "in %s storage function", "pCAL"); - - if (png_ptr == NULL || info_ptr == NULL || purpose == NULL || units == NULL - || (nparams > 0 && params == NULL)) - return; - - length = strlen(purpose) + 1; - png_debug1(3, "allocating purpose for info (%lu bytes)", - (unsigned long)length); - - /* TODO: validate format of calibration name and unit name */ - - /* Check that the type matches the specification. */ - if (type < 0 || type > 3) - { - png_chunk_report(png_ptr, "Invalid pCAL equation type", - PNG_CHUNK_WRITE_ERROR); - return; - } - - if (nparams < 0 || nparams > 255) - { - png_chunk_report(png_ptr, "Invalid pCAL parameter count", - PNG_CHUNK_WRITE_ERROR); - return; - } - - /* Validate params[nparams] */ - for (i=0; ipcal_purpose = png_voidcast(png_charp, - png_malloc_warn(png_ptr, length)); - - if (info_ptr->pcal_purpose == NULL) - { - png_chunk_report(png_ptr, "Insufficient memory for pCAL purpose", - PNG_CHUNK_WRITE_ERROR); - return; - } - - memcpy(info_ptr->pcal_purpose, purpose, length); - - png_debug(3, "storing X0, X1, type, and nparams in info"); - info_ptr->pcal_X0 = X0; - info_ptr->pcal_X1 = X1; - info_ptr->pcal_type = (png_byte)type; - info_ptr->pcal_nparams = (png_byte)nparams; - - length = strlen(units) + 1; - png_debug1(3, "allocating units for info (%lu bytes)", - (unsigned long)length); - - info_ptr->pcal_units = png_voidcast(png_charp, - png_malloc_warn(png_ptr, length)); - - if (info_ptr->pcal_units == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL units"); - - return; - } - - memcpy(info_ptr->pcal_units, units, length); - - info_ptr->pcal_params = png_voidcast(png_charpp, png_malloc_warn(png_ptr, - (png_size_t)(((unsigned int)nparams + 1) * (sizeof (png_charp))))); - - if (info_ptr->pcal_params == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL params"); - - return; - } - - memset(info_ptr->pcal_params, 0, ((unsigned int)nparams + 1) * - (sizeof (png_charp))); - - for (i = 0; i < nparams; i++) - { - length = strlen(params[i]) + 1; - png_debug2(3, "allocating parameter %d for info (%lu bytes)", i, - (unsigned long)length); - - info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length); - - if (info_ptr->pcal_params[i] == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL parameter"); - - return; - } - - memcpy(info_ptr->pcal_params[i], params[i], length); - } - - info_ptr->valid |= PNG_INFO_pCAL; - info_ptr->free_me |= PNG_FREE_PCAL; -} -#endif - -#ifdef PNG_sCAL_SUPPORTED -void PNGAPI -png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr, - int unit, png_const_charp swidth, png_const_charp sheight) -{ - png_size_t lengthw = 0, lengthh = 0; - - png_debug1(1, "in %s storage function", "sCAL"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - /* Double check the unit (should never get here with an invalid - * unit unless this is an API call.) - */ - if (unit != 1 && unit != 2) - png_error(png_ptr, "Invalid sCAL unit"); - - if (swidth == NULL || (lengthw = strlen(swidth)) == 0 || - swidth[0] == 45 /* '-' */ || !png_check_fp_string(swidth, lengthw)) - png_error(png_ptr, "Invalid sCAL width"); - - if (sheight == NULL || (lengthh = strlen(sheight)) == 0 || - sheight[0] == 45 /* '-' */ || !png_check_fp_string(sheight, lengthh)) - png_error(png_ptr, "Invalid sCAL height"); - - info_ptr->scal_unit = (png_byte)unit; - - ++lengthw; - - png_debug1(3, "allocating unit for info (%u bytes)", (unsigned int)lengthw); - - info_ptr->scal_s_width = png_voidcast(png_charp, - png_malloc_warn(png_ptr, lengthw)); - - if (info_ptr->scal_s_width == NULL) - { - png_warning(png_ptr, "Memory allocation failed while processing sCAL"); - - return; - } - - memcpy(info_ptr->scal_s_width, swidth, lengthw); - - ++lengthh; - - png_debug1(3, "allocating unit for info (%u bytes)", (unsigned int)lengthh); - - info_ptr->scal_s_height = png_voidcast(png_charp, - png_malloc_warn(png_ptr, lengthh)); - - if (info_ptr->scal_s_height == NULL) - { - png_free (png_ptr, info_ptr->scal_s_width); - info_ptr->scal_s_width = NULL; - - png_warning(png_ptr, "Memory allocation failed while processing sCAL"); - - return; - } - - memcpy(info_ptr->scal_s_height, sheight, lengthh); - - info_ptr->valid |= PNG_INFO_sCAL; - info_ptr->free_me |= PNG_FREE_SCAL; -} - -# ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_sCAL(png_const_structrp png_ptr, png_inforp info_ptr, int unit, - double width, double height) -{ - png_debug1(1, "in %s storage function", "sCAL"); - - /* Check the arguments. */ - if (width <= 0) - png_warning(png_ptr, "Invalid sCAL width ignored"); - - else if (height <= 0) - png_warning(png_ptr, "Invalid sCAL height ignored"); - - else - { - /* Convert 'width' and 'height' to ASCII. */ - char swidth[PNG_sCAL_MAX_DIGITS+1]; - char sheight[PNG_sCAL_MAX_DIGITS+1]; - - png_ascii_from_fp(png_ptr, swidth, (sizeof swidth), width, - PNG_sCAL_PRECISION); - png_ascii_from_fp(png_ptr, sheight, (sizeof sheight), height, - PNG_sCAL_PRECISION); - - png_set_sCAL_s(png_ptr, info_ptr, unit, swidth, sheight); - } -} -# endif - -# ifdef PNG_FIXED_POINT_SUPPORTED -void PNGAPI -png_set_sCAL_fixed(png_const_structrp png_ptr, png_inforp info_ptr, int unit, - png_fixed_point width, png_fixed_point height) -{ - png_debug1(1, "in %s storage function", "sCAL"); - - /* Check the arguments. */ - if (width <= 0) - png_warning(png_ptr, "Invalid sCAL width ignored"); - - else if (height <= 0) - png_warning(png_ptr, "Invalid sCAL height ignored"); - - else - { - /* Convert 'width' and 'height' to ASCII. */ - char swidth[PNG_sCAL_MAX_DIGITS+1]; - char sheight[PNG_sCAL_MAX_DIGITS+1]; - - png_ascii_from_fixed(png_ptr, swidth, (sizeof swidth), width); - png_ascii_from_fixed(png_ptr, sheight, (sizeof sheight), height); - - png_set_sCAL_s(png_ptr, info_ptr, unit, swidth, sheight); - } -} -# endif -#endif - -#ifdef PNG_pHYs_SUPPORTED -void PNGAPI -png_set_pHYs(png_const_structrp png_ptr, png_inforp info_ptr, - png_uint_32 res_x, png_uint_32 res_y, int unit_type) -{ - png_debug1(1, "in %s storage function", "pHYs"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->x_pixels_per_unit = res_x; - info_ptr->y_pixels_per_unit = res_y; - info_ptr->phys_unit_type = (png_byte)unit_type; - info_ptr->valid |= PNG_INFO_pHYs; -} -#endif - -void PNGAPI -png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, - png_const_colorp palette, int num_palette) -{ - - png_uint_32 max_palette_length; - - png_debug1(1, "in %s storage function", "PLTE"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - max_palette_length = (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ? - (1 << info_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH; - - if (num_palette < 0 || num_palette > (int) max_palette_length) - { - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - png_error(png_ptr, "Invalid palette length"); - - else - { - png_warning(png_ptr, "Invalid palette length"); - - return; - } - } - - if ((num_palette > 0 && palette == NULL) || - (num_palette == 0 -# ifdef PNG_MNG_FEATURES_SUPPORTED - && (png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) == 0 -# endif - )) - { - png_error(png_ptr, "Invalid palette"); - } - - /* It may not actually be necessary to set png_ptr->palette here; - * we do it for backward compatibility with the way the png_handle_tRNS - * function used to do the allocation. - * - * 1.6.0: the above statement appears to be incorrect; something has to set - * the palette inside png_struct on read. - */ - png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0); - - /* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead - * of num_palette entries, in case of an invalid PNG file or incorrect - * call to png_set_PLTE() with too-large sample values. - */ - png_ptr->palette = png_voidcast(png_colorp, png_calloc(png_ptr, - PNG_MAX_PALETTE_LENGTH * (sizeof (png_color)))); - - if (num_palette > 0) - memcpy(png_ptr->palette, palette, (unsigned int)num_palette * - (sizeof (png_color))); - info_ptr->palette = png_ptr->palette; - info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette; - - info_ptr->free_me |= PNG_FREE_PLTE; - - info_ptr->valid |= PNG_INFO_PLTE; -} - -#ifdef PNG_sBIT_SUPPORTED -void PNGAPI -png_set_sBIT(png_const_structrp png_ptr, png_inforp info_ptr, - png_const_color_8p sig_bit) -{ - png_debug1(1, "in %s storage function", "sBIT"); - - if (png_ptr == NULL || info_ptr == NULL || sig_bit == NULL) - return; - - info_ptr->sig_bit = *sig_bit; - info_ptr->valid |= PNG_INFO_sBIT; -} -#endif - -#ifdef PNG_sRGB_SUPPORTED -void PNGAPI -png_set_sRGB(png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent) -{ - png_debug1(1, "in %s storage function", "sRGB"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - (void)png_colorspace_set_sRGB(png_ptr, &info_ptr->colorspace, srgb_intent); - png_colorspace_sync_info(png_ptr, info_ptr); -} - -void PNGAPI -png_set_sRGB_gAMA_and_cHRM(png_const_structrp png_ptr, png_inforp info_ptr, - int srgb_intent) -{ - png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (png_colorspace_set_sRGB(png_ptr, &info_ptr->colorspace, - srgb_intent) != 0) - { - /* This causes the gAMA and cHRM to be written too */ - info_ptr->colorspace.flags |= - PNG_COLORSPACE_FROM_gAMA|PNG_COLORSPACE_FROM_cHRM; - } - - png_colorspace_sync_info(png_ptr, info_ptr); -} -#endif /* sRGB */ - - -#ifdef PNG_iCCP_SUPPORTED -void PNGAPI -png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr, - png_const_charp name, int compression_type, - png_const_bytep profile, png_uint_32 proflen) -{ - png_charp new_iccp_name; - png_bytep new_iccp_profile; - png_size_t length; - - png_debug1(1, "in %s storage function", "iCCP"); - - if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL) - return; - - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - png_app_error(png_ptr, "Invalid iCCP compression method"); - - /* Set the colorspace first because this validates the profile; do not - * override previously set app cHRM or gAMA here (because likely as not the - * application knows better than libpng what the correct values are.) Pass - * the info_ptr color_type field to png_colorspace_set_ICC because in the - * write case it has not yet been stored in png_ptr. - */ - { - int result = png_colorspace_set_ICC(png_ptr, &info_ptr->colorspace, name, - proflen, profile, info_ptr->color_type); - - png_colorspace_sync_info(png_ptr, info_ptr); - - /* Don't do any of the copying if the profile was bad, or inconsistent. */ - if (result == 0) - return; - - /* But do write the gAMA and cHRM chunks from the profile. */ - info_ptr->colorspace.flags |= - PNG_COLORSPACE_FROM_gAMA|PNG_COLORSPACE_FROM_cHRM; - } - - length = strlen(name)+1; - new_iccp_name = png_voidcast(png_charp, png_malloc_warn(png_ptr, length)); - - if (new_iccp_name == NULL) - { - png_benign_error(png_ptr, "Insufficient memory to process iCCP chunk"); - - return; - } - - memcpy(new_iccp_name, name, length); - new_iccp_profile = png_voidcast(png_bytep, - png_malloc_warn(png_ptr, proflen)); - - if (new_iccp_profile == NULL) - { - png_free(png_ptr, new_iccp_name); - png_benign_error(png_ptr, - "Insufficient memory to process iCCP profile"); - - return; - } - - memcpy(new_iccp_profile, profile, proflen); - - png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, 0); - - info_ptr->iccp_proflen = proflen; - info_ptr->iccp_name = new_iccp_name; - info_ptr->iccp_profile = new_iccp_profile; - info_ptr->free_me |= PNG_FREE_ICCP; - info_ptr->valid |= PNG_INFO_iCCP; -} -#endif - -#ifdef PNG_TEXT_SUPPORTED -void PNGAPI -png_set_text(png_const_structrp png_ptr, png_inforp info_ptr, - png_const_textp text_ptr, int num_text) -{ - int ret; - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, num_text); - - if (ret != 0) - png_error(png_ptr, "Insufficient memory to store text"); -} - -int /* PRIVATE */ -png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, - png_const_textp text_ptr, int num_text) -{ - int i; - - png_debug1(1, "in %lx storage function", png_ptr == NULL ? 0xabadca11U : - (unsigned long)png_ptr->chunk_name); - - if (png_ptr == NULL || info_ptr == NULL || num_text <= 0 || text_ptr == NULL) - return(0); - - /* Make sure we have enough space in the "text" array in info_struct - * to hold all of the incoming text_ptr objects. This compare can't overflow - * because max_text >= num_text (anyway, subtract of two positive integers - * can't overflow in any case.) - */ - if (num_text > info_ptr->max_text - info_ptr->num_text) - { - int old_num_text = info_ptr->num_text; - int max_text; - png_textp new_text = NULL; - - /* Calculate an appropriate max_text, checking for overflow. */ - max_text = old_num_text; - if (num_text <= INT_MAX - max_text) - { - max_text += num_text; - - /* Round up to a multiple of 8 */ - if (max_text < INT_MAX-8) - max_text = (max_text + 8) & ~0x7; - - else - max_text = INT_MAX; - - /* Now allocate a new array and copy the old members in; this does all - * the overflow checks. - */ - new_text = png_voidcast(png_textp,png_realloc_array(png_ptr, - info_ptr->text, old_num_text, max_text-old_num_text, - sizeof *new_text)); - } - - if (new_text == NULL) - { - png_chunk_report(png_ptr, "too many text chunks", - PNG_CHUNK_WRITE_ERROR); - - return 1; - } - - png_free(png_ptr, info_ptr->text); - - info_ptr->text = new_text; - info_ptr->free_me |= PNG_FREE_TEXT; - info_ptr->max_text = max_text; - /* num_text is adjusted below as the entries are copied in */ - - png_debug1(3, "allocated %d entries for info_ptr->text", max_text); - } - - for (i = 0; i < num_text; i++) - { - size_t text_length, key_len; - size_t lang_len, lang_key_len; - png_textp textp = &(info_ptr->text[info_ptr->num_text]); - - if (text_ptr[i].key == NULL) - continue; - - if (text_ptr[i].compression < PNG_TEXT_COMPRESSION_NONE || - text_ptr[i].compression >= PNG_TEXT_COMPRESSION_LAST) - { - png_chunk_report(png_ptr, "text compression mode is out of range", - PNG_CHUNK_WRITE_ERROR); - continue; - } - - key_len = strlen(text_ptr[i].key); - - if (text_ptr[i].compression <= 0) - { - lang_len = 0; - lang_key_len = 0; - } - - else -# ifdef PNG_iTXt_SUPPORTED - { - /* Set iTXt data */ - - if (text_ptr[i].lang != NULL) - lang_len = strlen(text_ptr[i].lang); - - else - lang_len = 0; - - if (text_ptr[i].lang_key != NULL) - lang_key_len = strlen(text_ptr[i].lang_key); - - else - lang_key_len = 0; - } -# else /* iTXt */ - { - png_chunk_report(png_ptr, "iTXt chunk not supported", - PNG_CHUNK_WRITE_ERROR); - continue; - } -# endif - - if (text_ptr[i].text == NULL || text_ptr[i].text[0] == '\0') - { - text_length = 0; -# ifdef PNG_iTXt_SUPPORTED - if (text_ptr[i].compression > 0) - textp->compression = PNG_ITXT_COMPRESSION_NONE; - - else -# endif - textp->compression = PNG_TEXT_COMPRESSION_NONE; - } - - else - { - text_length = strlen(text_ptr[i].text); - textp->compression = text_ptr[i].compression; - } - - textp->key = png_voidcast(png_charp,png_malloc_base(png_ptr, - key_len + text_length + lang_len + lang_key_len + 4)); - - if (textp->key == NULL) - { - png_chunk_report(png_ptr, "text chunk: out of memory", - PNG_CHUNK_WRITE_ERROR); - - return 1; - } - - png_debug2(2, "Allocated %lu bytes at %p in png_set_text", - (unsigned long)(png_uint_32) - (key_len + lang_len + lang_key_len + text_length + 4), - textp->key); - - memcpy(textp->key, text_ptr[i].key, key_len); - *(textp->key + key_len) = '\0'; - - if (text_ptr[i].compression > 0) - { - textp->lang = textp->key + key_len + 1; - memcpy(textp->lang, text_ptr[i].lang, lang_len); - *(textp->lang + lang_len) = '\0'; - textp->lang_key = textp->lang + lang_len + 1; - memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len); - *(textp->lang_key + lang_key_len) = '\0'; - textp->text = textp->lang_key + lang_key_len + 1; - } - - else - { - textp->lang=NULL; - textp->lang_key=NULL; - textp->text = textp->key + key_len + 1; - } - - if (text_length != 0) - memcpy(textp->text, text_ptr[i].text, text_length); - - *(textp->text + text_length) = '\0'; - -# ifdef PNG_iTXt_SUPPORTED - if (textp->compression > 0) - { - textp->text_length = 0; - textp->itxt_length = text_length; - } - - else -# endif - { - textp->text_length = text_length; - textp->itxt_length = 0; - } - - info_ptr->num_text++; - png_debug1(3, "transferred text chunk %d", info_ptr->num_text); - } - - return(0); -} -#endif - -#ifdef PNG_tIME_SUPPORTED -void PNGAPI -png_set_tIME(png_const_structrp png_ptr, png_inforp info_ptr, - png_const_timep mod_time) -{ - png_debug1(1, "in %s storage function", "tIME"); - - if (png_ptr == NULL || info_ptr == NULL || mod_time == NULL || - (png_ptr->mode & PNG_WROTE_tIME) != 0) - return; - - if (mod_time->month == 0 || mod_time->month > 12 || - mod_time->day == 0 || mod_time->day > 31 || - mod_time->hour > 23 || mod_time->minute > 59 || - mod_time->second > 60) - { - png_warning(png_ptr, "Ignoring invalid time value"); - - return; - } - - info_ptr->mod_time = *mod_time; - info_ptr->valid |= PNG_INFO_tIME; -} -#endif - -#ifdef PNG_tRNS_SUPPORTED -void PNGAPI -png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr, - png_const_bytep trans_alpha, int num_trans, png_const_color_16p trans_color) -{ - png_debug1(1, "in %s storage function", "tRNS"); - - if (png_ptr == NULL || info_ptr == NULL) - - return; - - if (trans_alpha != NULL) - { - /* It may not actually be necessary to set png_ptr->trans_alpha here; - * we do it for backward compatibility with the way the png_handle_tRNS - * function used to do the allocation. - * - * 1.6.0: The above statement is incorrect; png_handle_tRNS effectively - * relies on png_set_tRNS storing the information in png_struct - * (otherwise it won't be there for the code in pngrtran.c). - */ - - png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0); - - if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH) - { - /* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */ - info_ptr->trans_alpha = png_voidcast(png_bytep, - png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH)); - memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans); - } - png_ptr->trans_alpha = info_ptr->trans_alpha; - } - - if (trans_color != NULL) - { -#ifdef PNG_WARNINGS_SUPPORTED - if (info_ptr->bit_depth < 16) - { - int sample_max = (1 << info_ptr->bit_depth) - 1; - - if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY && - trans_color->gray > sample_max) || - (info_ptr->color_type == PNG_COLOR_TYPE_RGB && - (trans_color->red > sample_max || - trans_color->green > sample_max || - trans_color->blue > sample_max))) - png_warning(png_ptr, - "tRNS chunk has out-of-range samples for bit_depth"); - } -#endif - - info_ptr->trans_color = *trans_color; - - if (num_trans == 0) - num_trans = 1; - } - - info_ptr->num_trans = (png_uint_16)num_trans; - - if (num_trans != 0) - { - info_ptr->valid |= PNG_INFO_tRNS; - info_ptr->free_me |= PNG_FREE_TRNS; - } -} -#endif - -#ifdef PNG_sPLT_SUPPORTED -void PNGAPI -png_set_sPLT(png_const_structrp png_ptr, - png_inforp info_ptr, png_const_sPLT_tp entries, int nentries) -/* - * entries - array of png_sPLT_t structures - * to be added to the list of palettes - * in the info structure. - * - * nentries - number of palette structures to be - * added. - */ -{ - png_sPLT_tp np; - - if (png_ptr == NULL || info_ptr == NULL || nentries <= 0 || entries == NULL) - return; - - /* Use the internal realloc function, which checks for all the possible - * overflows. Notice that the parameters are (int) and (size_t) - */ - np = png_voidcast(png_sPLT_tp,png_realloc_array(png_ptr, - info_ptr->splt_palettes, info_ptr->splt_palettes_num, nentries, - sizeof *np)); - - if (np == NULL) - { - /* Out of memory or too many chunks */ - png_chunk_report(png_ptr, "too many sPLT chunks", PNG_CHUNK_WRITE_ERROR); - - return; - } - - png_free(png_ptr, info_ptr->splt_palettes); - info_ptr->splt_palettes = np; - info_ptr->free_me |= PNG_FREE_SPLT; - - np += info_ptr->splt_palettes_num; - - do - { - png_size_t length; - - /* Skip invalid input entries */ - if (entries->name == NULL || entries->entries == NULL) - { - /* png_handle_sPLT doesn't do this, so this is an app error */ - png_app_error(png_ptr, "png_set_sPLT: invalid sPLT"); - /* Just skip the invalid entry */ - continue; - } - - np->depth = entries->depth; - - /* In the event of out-of-memory just return - there's no point keeping - * on trying to add sPLT chunks. - */ - length = strlen(entries->name) + 1; - np->name = png_voidcast(png_charp, png_malloc_base(png_ptr, length)); - - if (np->name == NULL) - break; - - memcpy(np->name, entries->name, length); - - /* IMPORTANT: we have memory now that won't get freed if something else - * goes wrong; this code must free it. png_malloc_array produces no - * warnings; use a png_chunk_report (below) if there is an error. - */ - np->entries = png_voidcast(png_sPLT_entryp, png_malloc_array(png_ptr, - entries->nentries, sizeof (png_sPLT_entry))); - - if (np->entries == NULL) - { - png_free(png_ptr, np->name); - np->name = NULL; - break; - } - - np->nentries = entries->nentries; - /* This multiply can't overflow because png_malloc_array has already - * checked it when doing the allocation. - */ - memcpy(np->entries, entries->entries, - (unsigned int)entries->nentries * sizeof (png_sPLT_entry)); - - /* Note that 'continue' skips the advance of the out pointer and out - * count, so an invalid entry is not added. - */ - info_ptr->valid |= PNG_INFO_sPLT; - ++(info_ptr->splt_palettes_num); - ++np; - } - while (++entries, --nentries); - - if (nentries > 0) - png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR); -} -#endif /* sPLT */ - -#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED -static png_byte -check_location(png_const_structrp png_ptr, int location) -{ - location &= (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT); - - /* New in 1.6.0; copy the location and check it. This is an API - * change; previously the app had to use the - * png_set_unknown_chunk_location API below for each chunk. - */ - if (location == 0 && (png_ptr->mode & PNG_IS_READ_STRUCT) == 0) - { - /* Write struct, so unknown chunks come from the app */ - png_app_warning(png_ptr, - "png_set_unknown_chunks now expects a valid location"); - /* Use the old behavior */ - location = (png_byte)(png_ptr->mode & - (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT)); - } - - /* This need not be an internal error - if the app calls - * png_set_unknown_chunks on a read pointer it must get the location right. - */ - if (location == 0) - png_error(png_ptr, "invalid location in png_set_unknown_chunks"); - - /* Now reduce the location to the top-most set bit by removing each least - * significant bit in turn. - */ - while (location != (location & -location)) - location &= ~(location & -location); - - /* The cast is safe because 'location' is a bit mask and only the low four - * bits are significant. - */ - return (png_byte)location; -} - -void PNGAPI -png_set_unknown_chunks(png_const_structrp png_ptr, - png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns) -{ - png_unknown_chunkp np; - - if (png_ptr == NULL || info_ptr == NULL || num_unknowns <= 0 || - unknowns == NULL) - return; - - /* Check for the failure cases where support has been disabled at compile - * time. This code is hardly ever compiled - it's here because - * STORE_UNKNOWN_CHUNKS is set by both read and write code (compiling in this - * code) but may be meaningless if the read or write handling of unknown - * chunks is not compiled in. - */ -# if !defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) && \ - defined(PNG_READ_SUPPORTED) - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) - { - png_app_error(png_ptr, "no unknown chunk support on read"); - - return; - } -# endif -# if !defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) && \ - defined(PNG_WRITE_SUPPORTED) - if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0) - { - png_app_error(png_ptr, "no unknown chunk support on write"); - - return; - } -# endif - - /* Prior to 1.6.0 this code used png_malloc_warn; however, this meant that - * unknown critical chunks could be lost with just a warning resulting in - * undefined behavior. Now png_chunk_report is used to provide behavior - * appropriate to read or write. - */ - np = png_voidcast(png_unknown_chunkp, png_realloc_array(png_ptr, - info_ptr->unknown_chunks, info_ptr->unknown_chunks_num, num_unknowns, - sizeof *np)); - - if (np == NULL) - { - png_chunk_report(png_ptr, "too many unknown chunks", - PNG_CHUNK_WRITE_ERROR); - - return; - } - - png_free(png_ptr, info_ptr->unknown_chunks); - info_ptr->unknown_chunks = np; /* safe because it is initialized */ - info_ptr->free_me |= PNG_FREE_UNKN; - - np += info_ptr->unknown_chunks_num; - - /* Increment unknown_chunks_num each time round the loop to protect the - * just-allocated chunk data. - */ - for (; num_unknowns > 0; --num_unknowns, ++unknowns) - { - memcpy(np->name, unknowns->name, (sizeof np->name)); - np->name[(sizeof np->name)-1] = '\0'; - np->location = check_location(png_ptr, unknowns->location); - - if (unknowns->size == 0) - { - np->data = NULL; - np->size = 0; - } - - else - { - np->data = png_voidcast(png_bytep, - png_malloc_base(png_ptr, unknowns->size)); - - if (np->data == NULL) - { - png_chunk_report(png_ptr, "unknown chunk: out of memory", - PNG_CHUNK_WRITE_ERROR); - /* But just skip storing the unknown chunk */ - continue; - } - - memcpy(np->data, unknowns->data, unknowns->size); - np->size = unknowns->size; - } - - /* These increments are skipped on out-of-memory for the data - the - * unknown chunk entry gets overwritten if the png_chunk_report returns. - * This is correct in the read case (the chunk is just dropped.) - */ - ++np; - ++(info_ptr->unknown_chunks_num); - } -} - -void PNGAPI -png_set_unknown_chunk_location(png_const_structrp png_ptr, png_inforp info_ptr, - int chunk, int location) -{ - /* This API is pretty pointless in 1.6.0 because the location can be set - * before the call to png_set_unknown_chunks. - * - * TODO: add a png_app_warning in 1.7 - */ - if (png_ptr != NULL && info_ptr != NULL && chunk >= 0 && - chunk < info_ptr->unknown_chunks_num) - { - if ((location & (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT)) == 0) - { - png_app_error(png_ptr, "invalid unknown chunk location"); - /* Fake out the pre 1.6.0 behavior: */ - if (((unsigned int)location & PNG_HAVE_IDAT) != 0) /* undocumented! */ - location = PNG_AFTER_IDAT; - - else - location = PNG_HAVE_IHDR; /* also undocumented */ - } - - info_ptr->unknown_chunks[chunk].location = - check_location(png_ptr, location); - } -} -#endif /* STORE_UNKNOWN_CHUNKS */ - -#ifdef PNG_MNG_FEATURES_SUPPORTED -png_uint_32 PNGAPI -png_permit_mng_features (png_structrp png_ptr, png_uint_32 mng_features) -{ - png_debug(1, "in png_permit_mng_features"); - - if (png_ptr == NULL) - return 0; - - png_ptr->mng_features_permitted = mng_features & PNG_ALL_MNG_FEATURES; - - return png_ptr->mng_features_permitted; -} -#endif - -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -static unsigned int -add_one_chunk(png_bytep list, unsigned int count, png_const_bytep add, int keep) -{ - unsigned int i; - - /* Utility function: update the 'keep' state of a chunk if it is already in - * the list, otherwise add it to the list. - */ - for (i=0; i= PNG_HANDLE_CHUNK_LAST) - { - png_app_error(png_ptr, "png_set_keep_unknown_chunks: invalid keep"); - - return; - } - - if (num_chunks_in <= 0) - { - png_ptr->unknown_default = keep; - - /* '0' means just set the flags, so stop here */ - if (num_chunks_in == 0) - return; - } - - if (num_chunks_in < 0) - { - /* Ignore all unknown chunks and all chunks recognized by - * libpng except for IHDR, PLTE, tRNS, IDAT, and IEND - */ - static PNG_CONST png_byte chunks_to_ignore[] = { - 98, 75, 71, 68, '\0', /* bKGD */ - 99, 72, 82, 77, '\0', /* cHRM */ - 103, 65, 77, 65, '\0', /* gAMA */ - 104, 73, 83, 84, '\0', /* hIST */ - 105, 67, 67, 80, '\0', /* iCCP */ - 105, 84, 88, 116, '\0', /* iTXt */ - 111, 70, 70, 115, '\0', /* oFFs */ - 112, 67, 65, 76, '\0', /* pCAL */ - 112, 72, 89, 115, '\0', /* pHYs */ - 115, 66, 73, 84, '\0', /* sBIT */ - 115, 67, 65, 76, '\0', /* sCAL */ - 115, 80, 76, 84, '\0', /* sPLT */ - 115, 84, 69, 82, '\0', /* sTER */ - 115, 82, 71, 66, '\0', /* sRGB */ - 116, 69, 88, 116, '\0', /* tEXt */ - 116, 73, 77, 69, '\0', /* tIME */ - 122, 84, 88, 116, '\0' /* zTXt */ - }; - - chunk_list = chunks_to_ignore; - num_chunks = (unsigned int)/*SAFE*/(sizeof chunks_to_ignore)/5U; - } - - else /* num_chunks_in > 0 */ - { - if (chunk_list == NULL) - { - /* Prior to 1.6.0 this was silently ignored, now it is an app_error - * which can be switched off. - */ - png_app_error(png_ptr, "png_set_keep_unknown_chunks: no chunk list"); - - return; - } - - num_chunks = (unsigned int)num_chunks_in; - } - - old_num_chunks = png_ptr->num_chunk_list; - if (png_ptr->chunk_list == NULL) - old_num_chunks = 0; - - /* Since num_chunks is always restricted to UINT_MAX/5 this can't overflow. - */ - if (num_chunks + old_num_chunks > UINT_MAX/5) - { - png_app_error(png_ptr, "png_set_keep_unknown_chunks: too many chunks"); - - return; - } - - /* If these chunks are being reset to the default then no more memory is - * required because add_one_chunk above doesn't extend the list if the 'keep' - * parameter is the default. - */ - if (keep != 0) - { - new_list = png_voidcast(png_bytep, png_malloc(png_ptr, - 5 * (num_chunks + old_num_chunks))); - - if (old_num_chunks > 0) - memcpy(new_list, png_ptr->chunk_list, 5*old_num_chunks); - } - - else if (old_num_chunks > 0) - new_list = png_ptr->chunk_list; - - else - new_list = NULL; - - /* Add the new chunks together with each one's handling code. If the chunk - * already exists the code is updated, otherwise the chunk is added to the - * end. (In libpng 1.6.0 order no longer matters because this code enforces - * the earlier convention that the last setting is the one that is used.) - */ - if (new_list != NULL) - { - png_const_bytep inlist; - png_bytep outlist; - unsigned int i; - - for (i=0; ichunk_list != new_list) - png_free(png_ptr, new_list); - - new_list = NULL; - } - } - - else - num_chunks = 0; - - png_ptr->num_chunk_list = num_chunks; - - if (png_ptr->chunk_list != new_list) - { - if (png_ptr->chunk_list != NULL) - png_free(png_ptr, png_ptr->chunk_list); - - png_ptr->chunk_list = new_list; - } -} -#endif - -#ifdef PNG_READ_USER_CHUNKS_SUPPORTED -void PNGAPI -png_set_read_user_chunk_fn(png_structrp png_ptr, png_voidp user_chunk_ptr, - png_user_chunk_ptr read_user_chunk_fn) -{ - png_debug(1, "in png_set_read_user_chunk_fn"); - - if (png_ptr == NULL) - return; - - png_ptr->read_user_chunk_fn = read_user_chunk_fn; - png_ptr->user_chunk_ptr = user_chunk_ptr; -} -#endif - -#ifdef PNG_INFO_IMAGE_SUPPORTED -void PNGAPI -png_set_rows(png_const_structrp png_ptr, png_inforp info_ptr, - png_bytepp row_pointers) -{ - png_debug1(1, "in %s storage function", "rows"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (info_ptr->row_pointers != NULL && - (info_ptr->row_pointers != row_pointers)) - png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0); - - info_ptr->row_pointers = row_pointers; - - if (row_pointers != NULL) - info_ptr->valid |= PNG_INFO_IDAT; -} -#endif - -void PNGAPI -png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size) -{ - if (png_ptr == NULL) - return; - - if (size == 0 || size > PNG_UINT_31_MAX) - png_error(png_ptr, "invalid compression buffer size"); - -# ifdef PNG_SEQUENTIAL_READ_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) - { - png_ptr->IDAT_read_size = (png_uint_32)size; /* checked above */ - return; - } -# endif - -# ifdef PNG_WRITE_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0) - { - if (png_ptr->zowner != 0) - { - png_warning(png_ptr, - "Compression buffer size cannot be changed because it is in use"); - - return; - } - -#ifndef __COVERITY__ - /* Some compilers complain that this is always false. However, it - * can be true when integer overflow happens. - */ - if (size > ZLIB_IO_MAX) - { - png_warning(png_ptr, - "Compression buffer size limited to system maximum"); - size = ZLIB_IO_MAX; /* must fit */ - } -#endif - - if (size < 6) - { - /* Deflate will potentially go into an infinite loop on a SYNC_FLUSH - * if this is permitted. - */ - png_warning(png_ptr, - "Compression buffer size cannot be reduced below 6"); - - return; - } - - if (png_ptr->zbuffer_size != size) - { - png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list); - png_ptr->zbuffer_size = (uInt)size; - } - } -# endif -} - -void PNGAPI -png_set_invalid(png_const_structrp png_ptr, png_inforp info_ptr, int mask) -{ - if (png_ptr != NULL && info_ptr != NULL) - info_ptr->valid &= (unsigned int)(~mask); -} - - -#ifdef PNG_SET_USER_LIMITS_SUPPORTED -/* This function was added to libpng 1.2.6 */ -void PNGAPI -png_set_user_limits (png_structrp png_ptr, png_uint_32 user_width_max, - png_uint_32 user_height_max) -{ - /* Images with dimensions larger than these limits will be - * rejected by png_set_IHDR(). To accept any PNG datastream - * regardless of dimensions, set both limits to 0x7fffffff. - */ - if (png_ptr == NULL) - return; - - png_ptr->user_width_max = user_width_max; - png_ptr->user_height_max = user_height_max; -} - -/* This function was added to libpng 1.4.0 */ -void PNGAPI -png_set_chunk_cache_max (png_structrp png_ptr, png_uint_32 user_chunk_cache_max) -{ - if (png_ptr != NULL) - png_ptr->user_chunk_cache_max = user_chunk_cache_max; -} - -/* This function was added to libpng 1.4.1 */ -void PNGAPI -png_set_chunk_malloc_max (png_structrp png_ptr, - png_alloc_size_t user_chunk_malloc_max) -{ - if (png_ptr != NULL) - png_ptr->user_chunk_malloc_max = user_chunk_malloc_max; -} -#endif /* ?SET_USER_LIMITS */ - - -#ifdef PNG_BENIGN_ERRORS_SUPPORTED -void PNGAPI -png_set_benign_errors(png_structrp png_ptr, int allowed) -{ - png_debug(1, "in png_set_benign_errors"); - - /* If allowed is 1, png_benign_error() is treated as a warning. - * - * If allowed is 0, png_benign_error() is treated as an error (which - * is the default behavior if png_set_benign_errors() is not called). - */ - - if (allowed != 0) - png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN | - PNG_FLAG_APP_WARNINGS_WARN | PNG_FLAG_APP_ERRORS_WARN; - - else - png_ptr->flags &= ~(PNG_FLAG_BENIGN_ERRORS_WARN | - PNG_FLAG_APP_WARNINGS_WARN | PNG_FLAG_APP_ERRORS_WARN); -} -#endif /* BENIGN_ERRORS */ - -#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED - /* Whether to report invalid palette index; added at libng-1.5.10. - * It is possible for an indexed (color-type==3) PNG file to contain - * pixels with invalid (out-of-range) indexes if the PLTE chunk has - * fewer entries than the image's bit-depth would allow. We recover - * from this gracefully by filling any incomplete palette with zeros - * (opaque black). By default, when this occurs libpng will issue - * a benign error. This API can be used to override that behavior. - */ -void PNGAPI -png_set_check_for_invalid_index(png_structrp png_ptr, int allowed) -{ - png_debug(1, "in png_set_check_for_invalid_index"); - - if (allowed > 0) - png_ptr->num_palette_max = 0; - - else - png_ptr->num_palette_max = -1; -} -#endif - -#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) || \ - defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) -/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification, - * and if invalid, correct the keyword rather than discarding the entire - * chunk. The PNG 1.0 specification requires keywords 1-79 characters in - * length, forbids leading or trailing whitespace, multiple internal spaces, - * and the non-break space (0x80) from ISO 8859-1. Returns keyword length. - * - * The 'new_key' buffer must be 80 characters in size (for the keyword plus a - * trailing '\0'). If this routine returns 0 then there was no keyword, or a - * valid one could not be generated, and the caller must png_error. - */ -png_uint_32 /* PRIVATE */ -png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key) -{ -#ifdef PNG_WARNINGS_SUPPORTED - png_const_charp orig_key = key; -#endif - png_uint_32 key_len = 0; - int bad_character = 0; - int space = 1; - - png_debug(1, "in png_check_keyword"); - - if (key == NULL) - { - *new_key = 0; - return 0; - } - - while (*key && key_len < 79) - { - png_byte ch = (png_byte)*key++; - - if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/)) - *new_key++ = ch, ++key_len, space = 0; - - else if (space == 0) - { - /* A space or an invalid character when one wasn't seen immediately - * before; output just a space. - */ - *new_key++ = 32, ++key_len, space = 1; - - /* If the character was not a space then it is invalid. */ - if (ch != 32) - bad_character = ch; - } - - else if (bad_character == 0) - bad_character = ch; /* just skip it, record the first error */ - } - - if (key_len > 0 && space != 0) /* trailing space */ - { - --key_len, --new_key; - if (bad_character == 0) - bad_character = 32; - } - - /* Terminate the keyword */ - *new_key = 0; - - if (key_len == 0) - return 0; - -#ifdef PNG_WARNINGS_SUPPORTED - /* Try to only output one warning per keyword: */ - if (*key != 0) /* keyword too long */ - png_warning(png_ptr, "keyword truncated"); - - else if (bad_character != 0) - { - PNG_WARNING_PARAMETERS(p) - - png_warning_parameter(p, 1, orig_key); - png_warning_parameter_signed(p, 2, PNG_NUMBER_FORMAT_02x, bad_character); - - png_formatted_warning(png_ptr, p, "keyword \"@1\": bad character '0x@2'"); - } -#else /* !WARNINGS */ - PNG_UNUSED(png_ptr) -#endif /* !WARNINGS */ - - return key_len; -} -#endif /* TEXT || pCAL || iCCP || sPLT */ -#endif /* READ || WRITE */ diff --git a/jan/src/dep/libs/libpng/pngstruct.h b/jan/src/dep/libs/libpng/pngstruct.h deleted file mode 100644 index d8cc70071..000000000 --- a/jan/src/dep/libs/libpng/pngstruct.h +++ /dev/null @@ -1,483 +0,0 @@ - -/* pngstruct.h - header file for PNG reference library - * - * Last changed in libpng 1.6.28 [January 5, 2017] - * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -/* The structure that holds the information to read and write PNG files. - * The only people who need to care about what is inside of this are the - * people who will be modifying the library for their own special needs. - * It should NOT be accessed directly by an application. - */ - -#ifndef PNGSTRUCT_H -#define PNGSTRUCT_H -/* zlib.h defines the structure z_stream, an instance of which is included - * in this structure and is required for decompressing the LZ compressed - * data in PNG files. - */ -#ifndef ZLIB_CONST - /* We must ensure that zlib uses 'const' in declarations. */ -# define ZLIB_CONST -#endif -#include "zlib.h" -#ifdef const - /* zlib.h sometimes #defines const to nothing, undo this. */ -# undef const -#endif - -/* zlib.h has mediocre z_const use before 1.2.6, this stuff is for compatibility - * with older builds. - */ -#if ZLIB_VERNUM < 0x1260 -# define PNGZ_MSG_CAST(s) png_constcast(char*,s) -# define PNGZ_INPUT_CAST(b) png_constcast(png_bytep,b) -#else -# define PNGZ_MSG_CAST(s) (s) -# define PNGZ_INPUT_CAST(b) (b) -#endif - -/* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib - * can handle at once. This type need be no larger than 16 bits (so maximum of - * 65535), this define allows us to discover how big it is, but limited by the - * maximuum for png_size_t. The value can be overriden in a library build - * (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably - * lower value (e.g. 255 works). A lower value may help memory usage (slightly) - * and may even improve performance on some systems (and degrade it on others.) - */ -#ifndef ZLIB_IO_MAX -# define ZLIB_IO_MAX ((uInt)-1) -#endif - -#ifdef PNG_WRITE_SUPPORTED -/* The type of a compression buffer list used by the write code. */ -typedef struct png_compression_buffer -{ - struct png_compression_buffer *next; - png_byte output[1]; /* actually zbuf_size */ -} png_compression_buffer, *png_compression_bufferp; - -#define PNG_COMPRESSION_BUFFER_SIZE(pp)\ - (offsetof(png_compression_buffer, output) + (pp)->zbuffer_size) -#endif - -/* Colorspace support; structures used in png_struct, png_info and in internal - * functions to hold and communicate information about the color space. - * - * PNG_COLORSPACE_SUPPORTED is only required if the application will perform - * colorspace corrections, otherwise all the colorspace information can be - * skipped and the size of libpng can be reduced (significantly) by compiling - * out the colorspace support. - */ -#ifdef PNG_COLORSPACE_SUPPORTED -/* The chromaticities of the red, green and blue colorants and the chromaticity - * of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)). - */ -typedef struct png_xy -{ - png_fixed_point redx, redy; - png_fixed_point greenx, greeny; - png_fixed_point bluex, bluey; - png_fixed_point whitex, whitey; -} png_xy; - -/* The same data as above but encoded as CIE XYZ values. When this data comes - * from chromaticities the sum of the Y values is assumed to be 1.0 - */ -typedef struct png_XYZ -{ - png_fixed_point red_X, red_Y, red_Z; - png_fixed_point green_X, green_Y, green_Z; - png_fixed_point blue_X, blue_Y, blue_Z; -} png_XYZ; -#endif /* COLORSPACE */ - -#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) -/* A colorspace is all the above plus, potentially, profile information; - * however at present libpng does not use the profile internally so it is only - * stored in the png_info struct (if iCCP is supported.) The rendering intent - * is retained here and is checked. - * - * The file gamma encoding information is also stored here and gamma correction - * is done by libpng, whereas color correction must currently be done by the - * application. - */ -typedef struct png_colorspace -{ -#ifdef PNG_GAMMA_SUPPORTED - png_fixed_point gamma; /* File gamma */ -#endif - -#ifdef PNG_COLORSPACE_SUPPORTED - png_xy end_points_xy; /* End points as chromaticities */ - png_XYZ end_points_XYZ; /* End points as CIE XYZ colorant values */ - png_uint_16 rendering_intent; /* Rendering intent of a profile */ -#endif - - /* Flags are always defined to simplify the code. */ - png_uint_16 flags; /* As defined below */ -} png_colorspace, * PNG_RESTRICT png_colorspacerp; - -typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp; - -/* General flags for the 'flags' field */ -#define PNG_COLORSPACE_HAVE_GAMMA 0x0001 -#define PNG_COLORSPACE_HAVE_ENDPOINTS 0x0002 -#define PNG_COLORSPACE_HAVE_INTENT 0x0004 -#define PNG_COLORSPACE_FROM_gAMA 0x0008 -#define PNG_COLORSPACE_FROM_cHRM 0x0010 -#define PNG_COLORSPACE_FROM_sRGB 0x0020 -#define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040 -#define PNG_COLORSPACE_MATCHES_sRGB 0x0080 /* exact match on profile */ -#define PNG_COLORSPACE_INVALID 0x8000 -#define PNG_COLORSPACE_CANCEL(flags) (0xffff ^ (flags)) -#endif /* COLORSPACE || GAMMA */ - -struct png_struct_def -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf jmp_buf_local; /* New name in 1.6.0 for jmp_buf in png_struct */ - png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */ - jmp_buf *jmp_buf_ptr; /* passed to longjmp_fn */ - size_t jmp_buf_size; /* size of the above, if allocated */ -#endif - png_error_ptr error_fn; /* function for printing errors and aborting */ -#ifdef PNG_WARNINGS_SUPPORTED - png_error_ptr warning_fn; /* function for printing warnings */ -#endif - png_voidp error_ptr; /* user supplied struct for error functions */ - png_rw_ptr write_data_fn; /* function for writing output data */ - png_rw_ptr read_data_fn; /* function for reading input data */ - png_voidp io_ptr; /* ptr to application struct for I/O functions */ - -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - png_user_transform_ptr read_user_transform_fn; /* user read transform */ -#endif - -#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED - png_user_transform_ptr write_user_transform_fn; /* user write transform */ -#endif - -/* These were added in libpng-1.0.2 */ -#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - png_voidp user_transform_ptr; /* user supplied struct for user transform */ - png_byte user_transform_depth; /* bit depth of user transformed pixels */ - png_byte user_transform_channels; /* channels in user transformed pixels */ -#endif -#endif - - png_uint_32 mode; /* tells us where we are in the PNG file */ - png_uint_32 flags; /* flags indicating various things to libpng */ - png_uint_32 transformations; /* which transformations to perform */ - - png_uint_32 zowner; /* ID (chunk type) of zstream owner, 0 if none */ - z_stream zstream; /* decompression structure */ - -#ifdef PNG_WRITE_SUPPORTED - png_compression_bufferp zbuffer_list; /* Created on demand during write */ - uInt zbuffer_size; /* size of the actual buffer */ - - int zlib_level; /* holds zlib compression level */ - int zlib_method; /* holds zlib compression method */ - int zlib_window_bits; /* holds zlib compression window bits */ - int zlib_mem_level; /* holds zlib compression memory level */ - int zlib_strategy; /* holds zlib compression strategy */ -#endif -/* Added at libpng 1.5.4 */ -#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED - int zlib_text_level; /* holds zlib compression level */ - int zlib_text_method; /* holds zlib compression method */ - int zlib_text_window_bits; /* holds zlib compression window bits */ - int zlib_text_mem_level; /* holds zlib compression memory level */ - int zlib_text_strategy; /* holds zlib compression strategy */ -#endif -/* End of material added at libpng 1.5.4 */ -/* Added at libpng 1.6.0 */ -#ifdef PNG_WRITE_SUPPORTED - int zlib_set_level; /* Actual values set into the zstream on write */ - int zlib_set_method; - int zlib_set_window_bits; - int zlib_set_mem_level; - int zlib_set_strategy; -#endif - - png_uint_32 width; /* width of image in pixels */ - png_uint_32 height; /* height of image in pixels */ - png_uint_32 num_rows; /* number of rows in current pass */ - png_uint_32 usr_width; /* width of row at start of write */ - png_size_t rowbytes; /* size of row in bytes */ - png_uint_32 iwidth; /* width of current interlaced row in pixels */ - png_uint_32 row_number; /* current row in interlace pass */ - png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */ - png_bytep prev_row; /* buffer to save previous (unfiltered) row. - * While reading this is a pointer into - * big_prev_row; while writing it is separately - * allocated if needed. - */ - png_bytep row_buf; /* buffer to save current (unfiltered) row. - * While reading, this is a pointer into - * big_row_buf; while writing it is separately - * allocated. - */ -#ifdef PNG_WRITE_FILTER_SUPPORTED - png_bytep try_row; /* buffer to save trial row when filtering */ - png_bytep tst_row; /* buffer to save best trial row when filtering */ -#endif - png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */ - - png_uint_32 idat_size; /* current IDAT size for read */ - png_uint_32 crc; /* current chunk CRC value */ - png_colorp palette; /* palette from the input file */ - png_uint_16 num_palette; /* number of color entries in palette */ - -/* Added at libpng-1.5.10 */ -#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED - int num_palette_max; /* maximum palette index found in IDAT */ -#endif - - png_uint_16 num_trans; /* number of transparency values */ - png_byte compression; /* file compression type (always 0) */ - png_byte filter; /* file filter type (always 0) */ - png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ - png_byte pass; /* current interlace pass (0 - 6) */ - png_byte do_filter; /* row filter flags (see PNG_FILTER_ in png.h ) */ - png_byte color_type; /* color type of file */ - png_byte bit_depth; /* bit depth of file */ - png_byte usr_bit_depth; /* bit depth of users row: write only */ - png_byte pixel_depth; /* number of bits per pixel */ - png_byte channels; /* number of channels in file */ -#ifdef PNG_WRITE_SUPPORTED - png_byte usr_channels; /* channels at start of write: write only */ -#endif - png_byte sig_bytes; /* magic bytes read/written from start of file */ - png_byte maximum_pixel_depth; - /* pixel depth used for the row buffers */ - png_byte transformed_pixel_depth; - /* pixel depth after read/write transforms */ -#if ZLIB_VERNUM >= 0x1240 - png_byte zstream_start; /* at start of an input zlib stream */ -#endif /* Zlib >= 1.2.4 */ -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) - png_uint_16 filler; /* filler bytes for pixel expansion */ -#endif - -#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ - defined(PNG_READ_ALPHA_MODE_SUPPORTED) - png_byte background_gamma_type; - png_fixed_point background_gamma; - png_color_16 background; /* background color in screen gamma space */ -#ifdef PNG_READ_GAMMA_SUPPORTED - png_color_16 background_1; /* background normalized to gamma 1.0 */ -#endif -#endif /* bKGD */ - -#ifdef PNG_WRITE_FLUSH_SUPPORTED - png_flush_ptr output_flush_fn; /* Function for flushing output */ - png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ - png_uint_32 flush_rows; /* number of rows written since last flush */ -#endif - -#ifdef PNG_READ_GAMMA_SUPPORTED - int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ - png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */ - - png_bytep gamma_table; /* gamma table for 8-bit depth files */ - png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - png_bytep gamma_from_1; /* converts from 1.0 to screen */ - png_bytep gamma_to_1; /* converts from file to 1.0 */ - png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ - png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ -#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) - png_color_8 sig_bit; /* significant bits in each available channel */ -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) - png_color_8 shift; /* shift for significant bit tranformation */ -#endif - -#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ - || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_bytep trans_alpha; /* alpha values for paletted files */ - png_color_16 trans_color; /* transparent color for non-paletted files */ -#endif - - png_read_status_ptr read_row_fn; /* called after each row is decoded */ - png_write_status_ptr write_row_fn; /* called after each row is encoded */ -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - png_progressive_info_ptr info_fn; /* called after header data fully read */ - png_progressive_row_ptr row_fn; /* called after a prog. row is decoded */ - png_progressive_end_ptr end_fn; /* called after image is complete */ - png_bytep save_buffer_ptr; /* current location in save_buffer */ - png_bytep save_buffer; /* buffer for previously read data */ - png_bytep current_buffer_ptr; /* current location in current_buffer */ - png_bytep current_buffer; /* buffer for recently used data */ - png_uint_32 push_length; /* size of current input chunk */ - png_uint_32 skip_length; /* bytes to skip in input data */ - png_size_t save_buffer_size; /* amount of data now in save_buffer */ - png_size_t save_buffer_max; /* total size of save_buffer */ - png_size_t buffer_size; /* total amount of available input data */ - png_size_t current_buffer_size; /* amount of data now in current_buffer */ - int process_mode; /* what push library is currently doing */ - int cur_palette; /* current push library palette index */ - -#endif /* PROGRESSIVE_READ */ - -#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) -/* For the Borland special 64K segment handler */ - png_bytepp offset_table_ptr; - png_bytep offset_table; - png_uint_16 offset_table_number; - png_uint_16 offset_table_count; - png_uint_16 offset_table_count_free; -#endif - -#ifdef PNG_READ_QUANTIZE_SUPPORTED - png_bytep palette_lookup; /* lookup table for quantizing */ - png_bytep quantize_index; /* index translation for palette files */ -#endif - -/* Options */ -#ifdef PNG_SET_OPTION_SUPPORTED - png_uint_32 options; /* On/off state (up to 16 options) */ -#endif - -#if PNG_LIBPNG_VER < 10700 -/* To do: remove this from libpng-1.7 */ -#ifdef PNG_TIME_RFC1123_SUPPORTED - char time_buffer[29]; /* String to hold RFC 1123 time text */ -#endif -#endif - -/* New members added in libpng-1.0.6 */ - - png_uint_32 free_me; /* flags items libpng is responsible for freeing */ - -#ifdef PNG_USER_CHUNKS_SUPPORTED - png_voidp user_chunk_ptr; -#ifdef PNG_READ_USER_CHUNKS_SUPPORTED - png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ -#endif -#endif - -#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED - int unknown_default; /* As PNG_HANDLE_* */ - unsigned int num_chunk_list; /* Number of entries in the list */ - png_bytep chunk_list; /* List of png_byte[5]; the textual chunk name - * followed by a PNG_HANDLE_* byte */ -#endif - -/* New members added in libpng-1.0.3 */ -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED - png_byte rgb_to_gray_status; - /* Added in libpng 1.5.5 to record setting of coefficients: */ - png_byte rgb_to_gray_coefficients_set; - /* These were changed from png_byte in libpng-1.0.6 */ - png_uint_16 rgb_to_gray_red_coeff; - png_uint_16 rgb_to_gray_green_coeff; - /* deleted in 1.5.5: rgb_to_gray_blue_coeff; */ -#endif - -/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) -/* Changed from png_byte to png_uint_32 at version 1.2.0 */ - png_uint_32 mng_features_permitted; -#endif - -/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ -#ifdef PNG_MNG_FEATURES_SUPPORTED - png_byte filter_type; -#endif - -/* New members added in libpng-1.2.0 */ - -/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ -#ifdef PNG_USER_MEM_SUPPORTED - png_voidp mem_ptr; /* user supplied struct for mem functions */ - png_malloc_ptr malloc_fn; /* function for allocating memory */ - png_free_ptr free_fn; /* function for freeing memory */ -#endif - -/* New member added in libpng-1.0.13 and 1.2.0 */ - png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ - -#ifdef PNG_READ_QUANTIZE_SUPPORTED -/* The following three members were added at version 1.0.14 and 1.2.4 */ - png_bytep quantize_sort; /* working sort array */ - png_bytep index_to_palette; /* where the original index currently is - in the palette */ - png_bytep palette_to_index; /* which original index points to this - palette color */ -#endif - -/* New members added in libpng-1.0.16 and 1.2.6 */ - png_byte compression_type; - -#ifdef PNG_USER_LIMITS_SUPPORTED - png_uint_32 user_width_max; - png_uint_32 user_height_max; - - /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown - * chunks that can be stored (0 means unlimited). - */ - png_uint_32 user_chunk_cache_max; - - /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk - * can occupy when decompressed. 0 means unlimited. - */ - png_alloc_size_t user_chunk_malloc_max; -#endif - -/* New member added in libpng-1.0.25 and 1.2.17 */ -#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED - /* Temporary storage for unknown chunk that the library doesn't recognize, - * used while reading the chunk. - */ - png_unknown_chunk unknown_chunk; -#endif - -/* New member added in libpng-1.2.26 */ - png_size_t old_big_row_buf_size; - -#ifdef PNG_READ_SUPPORTED -/* New member added in libpng-1.2.30 */ - png_bytep read_buffer; /* buffer for reading chunk data */ - png_alloc_size_t read_buffer_size; /* current size of the buffer */ -#endif -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED - uInt IDAT_read_size; /* limit on read buffer size for IDAT */ -#endif - -#ifdef PNG_IO_STATE_SUPPORTED -/* New member added in libpng-1.4.0 */ - png_uint_32 io_state; -#endif - -/* New member added in libpng-1.5.6 */ - png_bytep big_prev_row; - -/* New member added in libpng-1.5.7 */ - void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info, - png_bytep row, png_const_bytep prev_row); - -#ifdef PNG_READ_SUPPORTED -#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) - png_colorspace colorspace; -#endif -#endif -}; -#endif /* PNGSTRUCT_H */ diff --git a/jan/src/dep/libs/libpng/pngtrans.c b/jan/src/dep/libs/libpng/pngtrans.c deleted file mode 100644 index ed6cb60a8..000000000 --- a/jan/src/dep/libs/libpng/pngtrans.c +++ /dev/null @@ -1,850 +0,0 @@ - -/* pngtrans.c - transforms the data in a row (used by both readers and writers) - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -#include "pngpriv.h" - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* Turn on BGR-to-RGB mapping */ -void PNGAPI -png_set_bgr(png_structrp png_ptr) -{ - png_debug(1, "in png_set_bgr"); - - if (png_ptr == NULL) - return; - - png_ptr->transformations |= PNG_BGR; -} -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* Turn on 16-bit byte swapping */ -void PNGAPI -png_set_swap(png_structrp png_ptr) -{ - png_debug(1, "in png_set_swap"); - - if (png_ptr == NULL) - return; - - if (png_ptr->bit_depth == 16) - png_ptr->transformations |= PNG_SWAP_BYTES; -} -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) -/* Turn on pixel packing */ -void PNGAPI -png_set_packing(png_structrp png_ptr) -{ - png_debug(1, "in png_set_packing"); - - if (png_ptr == NULL) - return; - - if (png_ptr->bit_depth < 8) - { - png_ptr->transformations |= PNG_PACK; -# ifdef PNG_WRITE_SUPPORTED - png_ptr->usr_bit_depth = 8; -# endif - } -} -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) -/* Turn on packed pixel swapping */ -void PNGAPI -png_set_packswap(png_structrp png_ptr) -{ - png_debug(1, "in png_set_packswap"); - - if (png_ptr == NULL) - return; - - if (png_ptr->bit_depth < 8) - png_ptr->transformations |= PNG_PACKSWAP; -} -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) -void PNGAPI -png_set_shift(png_structrp png_ptr, png_const_color_8p true_bits) -{ - png_debug(1, "in png_set_shift"); - - if (png_ptr == NULL) - return; - - png_ptr->transformations |= PNG_SHIFT; - png_ptr->shift = *true_bits; -} -#endif - -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) -int PNGAPI -png_set_interlace_handling(png_structrp png_ptr) -{ - png_debug(1, "in png_set_interlace handling"); - - if (png_ptr != 0 && png_ptr->interlaced != 0) - { - png_ptr->transformations |= PNG_INTERLACE; - return (7); - } - - return (1); -} -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -/* Add a filler byte on read, or remove a filler or alpha byte on write. - * The filler type has changed in v0.95 to allow future 2-byte fillers - * for 48-bit input data, as well as to avoid problems with some compilers - * that don't like bytes as parameters. - */ -void PNGAPI -png_set_filler(png_structrp png_ptr, png_uint_32 filler, int filler_loc) -{ - png_debug(1, "in png_set_filler"); - - if (png_ptr == NULL) - return; - - /* In libpng 1.6 it is possible to determine whether this is a read or write - * operation and therefore to do more checking here for a valid call. - */ - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) - { -# ifdef PNG_READ_FILLER_SUPPORTED - /* On read png_set_filler is always valid, regardless of the base PNG - * format, because other transformations can give a format where the - * filler code can execute (basically an 8 or 16-bit component RGB or G - * format.) - * - * NOTE: usr_channels is not used by the read code! (This has led to - * confusion in the past.) The filler is only used in the read code. - */ - png_ptr->filler = (png_uint_16)filler; -# else - png_app_error(png_ptr, "png_set_filler not supported on read"); - PNG_UNUSED(filler) /* not used in the write case */ - return; -# endif - } - - else /* write */ - { -# ifdef PNG_WRITE_FILLER_SUPPORTED - /* On write the usr_channels parameter must be set correctly at the - * start to record the number of channels in the app-supplied data. - */ - switch (png_ptr->color_type) - { - case PNG_COLOR_TYPE_RGB: - png_ptr->usr_channels = 4; - break; - - case PNG_COLOR_TYPE_GRAY: - if (png_ptr->bit_depth >= 8) - { - png_ptr->usr_channels = 2; - break; - } - - else - { - /* There simply isn't any code in libpng to strip out bits - * from bytes when the components are less than a byte in - * size! - */ - png_app_error(png_ptr, - "png_set_filler is invalid for" - " low bit depth gray output"); - return; - } - - default: - png_app_error(png_ptr, - "png_set_filler: inappropriate color type"); - return; - } -# else - png_app_error(png_ptr, "png_set_filler not supported on write"); - return; -# endif - } - - /* Here on success - libpng supports the operation, set the transformation - * and the flag to say where the filler channel is. - */ - png_ptr->transformations |= PNG_FILLER; - - if (filler_loc == PNG_FILLER_AFTER) - png_ptr->flags |= PNG_FLAG_FILLER_AFTER; - - else - png_ptr->flags &= ~PNG_FLAG_FILLER_AFTER; -} - -/* Added to libpng-1.2.7 */ -void PNGAPI -png_set_add_alpha(png_structrp png_ptr, png_uint_32 filler, int filler_loc) -{ - png_debug(1, "in png_set_add_alpha"); - - if (png_ptr == NULL) - return; - - png_set_filler(png_ptr, filler, filler_loc); - /* The above may fail to do anything. */ - if ((png_ptr->transformations & PNG_FILLER) != 0) - png_ptr->transformations |= PNG_ADD_ALPHA; -} - -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -void PNGAPI -png_set_swap_alpha(png_structrp png_ptr) -{ - png_debug(1, "in png_set_swap_alpha"); - - if (png_ptr == NULL) - return; - - png_ptr->transformations |= PNG_SWAP_ALPHA; -} -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -void PNGAPI -png_set_invert_alpha(png_structrp png_ptr) -{ - png_debug(1, "in png_set_invert_alpha"); - - if (png_ptr == NULL) - return; - - png_ptr->transformations |= PNG_INVERT_ALPHA; -} -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -void PNGAPI -png_set_invert_mono(png_structrp png_ptr) -{ - png_debug(1, "in png_set_invert_mono"); - - if (png_ptr == NULL) - return; - - png_ptr->transformations |= PNG_INVERT_MONO; -} - -/* Invert monochrome grayscale data */ -void /* PRIVATE */ -png_do_invert(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_invert"); - - /* This test removed from libpng version 1.0.13 and 1.2.0: - * if (row_info->bit_depth == 1 && - */ - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - png_bytep rp = row; - png_size_t i; - png_size_t istop = row_info->rowbytes; - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(~(*rp)); - rp++; - } - } - - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && - row_info->bit_depth == 8) - { - png_bytep rp = row; - png_size_t i; - png_size_t istop = row_info->rowbytes; - - for (i = 0; i < istop; i += 2) - { - *rp = (png_byte)(~(*rp)); - rp += 2; - } - } - -#ifdef PNG_16BIT_SUPPORTED - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && - row_info->bit_depth == 16) - { - png_bytep rp = row; - png_size_t i; - png_size_t istop = row_info->rowbytes; - - for (i = 0; i < istop; i += 4) - { - *rp = (png_byte)(~(*rp)); - *(rp + 1) = (png_byte)(~(*(rp + 1))); - rp += 4; - } - } -#endif -} -#endif - -#ifdef PNG_16BIT_SUPPORTED -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* Swaps byte order on 16-bit depth images */ -void /* PRIVATE */ -png_do_swap(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_swap"); - - if (row_info->bit_depth == 16) - { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop= row_info->width * row_info->channels; - - for (i = 0; i < istop; i++, rp += 2) - { -#ifdef PNG_BUILTIN_BSWAP16_SUPPORTED - /* Feature added to libpng-1.6.11 for testing purposes, not - * enabled by default. - */ - *(png_uint_16*)rp = __builtin_bswap16(*(png_uint_16*)rp); -#else - png_byte t = *rp; - *rp = *(rp + 1); - *(rp + 1) = t; -#endif - } - } -} -#endif -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) -static PNG_CONST png_byte onebppswaptable[256] = { - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, - 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, - 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, - 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, - 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, - 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF -}; - -static PNG_CONST png_byte twobppswaptable[256] = { - 0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0, - 0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0, - 0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4, - 0x24, 0x64, 0xA4, 0xE4, 0x34, 0x74, 0xB4, 0xF4, - 0x08, 0x48, 0x88, 0xC8, 0x18, 0x58, 0x98, 0xD8, - 0x28, 0x68, 0xA8, 0xE8, 0x38, 0x78, 0xB8, 0xF8, - 0x0C, 0x4C, 0x8C, 0xCC, 0x1C, 0x5C, 0x9C, 0xDC, - 0x2C, 0x6C, 0xAC, 0xEC, 0x3C, 0x7C, 0xBC, 0xFC, - 0x01, 0x41, 0x81, 0xC1, 0x11, 0x51, 0x91, 0xD1, - 0x21, 0x61, 0xA1, 0xE1, 0x31, 0x71, 0xB1, 0xF1, - 0x05, 0x45, 0x85, 0xC5, 0x15, 0x55, 0x95, 0xD5, - 0x25, 0x65, 0xA5, 0xE5, 0x35, 0x75, 0xB5, 0xF5, - 0x09, 0x49, 0x89, 0xC9, 0x19, 0x59, 0x99, 0xD9, - 0x29, 0x69, 0xA9, 0xE9, 0x39, 0x79, 0xB9, 0xF9, - 0x0D, 0x4D, 0x8D, 0xCD, 0x1D, 0x5D, 0x9D, 0xDD, - 0x2D, 0x6D, 0xAD, 0xED, 0x3D, 0x7D, 0xBD, 0xFD, - 0x02, 0x42, 0x82, 0xC2, 0x12, 0x52, 0x92, 0xD2, - 0x22, 0x62, 0xA2, 0xE2, 0x32, 0x72, 0xB2, 0xF2, - 0x06, 0x46, 0x86, 0xC6, 0x16, 0x56, 0x96, 0xD6, - 0x26, 0x66, 0xA6, 0xE6, 0x36, 0x76, 0xB6, 0xF6, - 0x0A, 0x4A, 0x8A, 0xCA, 0x1A, 0x5A, 0x9A, 0xDA, - 0x2A, 0x6A, 0xAA, 0xEA, 0x3A, 0x7A, 0xBA, 0xFA, - 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x5E, 0x9E, 0xDE, - 0x2E, 0x6E, 0xAE, 0xEE, 0x3E, 0x7E, 0xBE, 0xFE, - 0x03, 0x43, 0x83, 0xC3, 0x13, 0x53, 0x93, 0xD3, - 0x23, 0x63, 0xA3, 0xE3, 0x33, 0x73, 0xB3, 0xF3, - 0x07, 0x47, 0x87, 0xC7, 0x17, 0x57, 0x97, 0xD7, - 0x27, 0x67, 0xA7, 0xE7, 0x37, 0x77, 0xB7, 0xF7, - 0x0B, 0x4B, 0x8B, 0xCB, 0x1B, 0x5B, 0x9B, 0xDB, - 0x2B, 0x6B, 0xAB, 0xEB, 0x3B, 0x7B, 0xBB, 0xFB, - 0x0F, 0x4F, 0x8F, 0xCF, 0x1F, 0x5F, 0x9F, 0xDF, - 0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF -}; - -static PNG_CONST png_byte fourbppswaptable[256] = { - 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, - 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0, - 0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71, - 0x81, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, 0xE1, 0xF1, - 0x02, 0x12, 0x22, 0x32, 0x42, 0x52, 0x62, 0x72, - 0x82, 0x92, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0xF2, - 0x03, 0x13, 0x23, 0x33, 0x43, 0x53, 0x63, 0x73, - 0x83, 0x93, 0xA3, 0xB3, 0xC3, 0xD3, 0xE3, 0xF3, - 0x04, 0x14, 0x24, 0x34, 0x44, 0x54, 0x64, 0x74, - 0x84, 0x94, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4, - 0x05, 0x15, 0x25, 0x35, 0x45, 0x55, 0x65, 0x75, - 0x85, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xE5, 0xF5, - 0x06, 0x16, 0x26, 0x36, 0x46, 0x56, 0x66, 0x76, - 0x86, 0x96, 0xA6, 0xB6, 0xC6, 0xD6, 0xE6, 0xF6, - 0x07, 0x17, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, - 0x87, 0x97, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7, - 0x08, 0x18, 0x28, 0x38, 0x48, 0x58, 0x68, 0x78, - 0x88, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8, - 0x09, 0x19, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79, - 0x89, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9, - 0x0A, 0x1A, 0x2A, 0x3A, 0x4A, 0x5A, 0x6A, 0x7A, - 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA, - 0x0B, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, - 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xDB, 0xEB, 0xFB, - 0x0C, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C, - 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xDC, 0xEC, 0xFC, - 0x0D, 0x1D, 0x2D, 0x3D, 0x4D, 0x5D, 0x6D, 0x7D, - 0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0xDD, 0xED, 0xFD, - 0x0E, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E, - 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE, - 0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F, - 0x8F, 0x9F, 0xAF, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF -}; - -/* Swaps pixel packing order within bytes */ -void /* PRIVATE */ -png_do_packswap(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_packswap"); - - if (row_info->bit_depth < 8) - { - png_bytep rp; - png_const_bytep end, table; - - end = row + row_info->rowbytes; - - if (row_info->bit_depth == 1) - table = onebppswaptable; - - else if (row_info->bit_depth == 2) - table = twobppswaptable; - - else if (row_info->bit_depth == 4) - table = fourbppswaptable; - - else - return; - - for (rp = row; rp < end; rp++) - *rp = table[*rp]; - } -} -#endif /* PACKSWAP || WRITE_PACKSWAP */ - -#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ - defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -/* Remove a channel - this used to be 'png_do_strip_filler' but it used a - * somewhat weird combination of flags to determine what to do. All the calls - * to png_do_strip_filler are changed in 1.5.2 to call this instead with the - * correct arguments. - * - * The routine isn't general - the channel must be the channel at the start or - * end (not in the middle) of each pixel. - */ -void /* PRIVATE */ -png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start) -{ - png_bytep sp = row; /* source pointer */ - png_bytep dp = row; /* destination pointer */ - png_bytep ep = row + row_info->rowbytes; /* One beyond end of row */ - - /* At the start sp will point to the first byte to copy and dp to where - * it is copied to. ep always points just beyond the end of the row, so - * the loop simply copies (channels-1) channels until sp reaches ep. - * - * at_start: 0 -- convert AG, XG, ARGB, XRGB, AAGG, XXGG, etc. - * nonzero -- convert GA, GX, RGBA, RGBX, GGAA, RRGGBBXX, etc. - */ - - /* GA, GX, XG cases */ - if (row_info->channels == 2) - { - if (row_info->bit_depth == 8) - { - if (at_start != 0) /* Skip initial filler */ - ++sp; - else /* Skip initial channel and, for sp, the filler */ - sp += 2, ++dp; - - /* For a 1 pixel wide image there is nothing to do */ - while (sp < ep) - *dp++ = *sp, sp += 2; - - row_info->pixel_depth = 8; - } - - else if (row_info->bit_depth == 16) - { - if (at_start != 0) /* Skip initial filler */ - sp += 2; - else /* Skip initial channel and, for sp, the filler */ - sp += 4, dp += 2; - - while (sp < ep) - *dp++ = *sp++, *dp++ = *sp, sp += 3; - - row_info->pixel_depth = 16; - } - - else - return; /* bad bit depth */ - - row_info->channels = 1; - - /* Finally fix the color type if it records an alpha channel */ - if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - row_info->color_type = PNG_COLOR_TYPE_GRAY; - } - - /* RGBA, RGBX, XRGB cases */ - else if (row_info->channels == 4) - { - if (row_info->bit_depth == 8) - { - if (at_start != 0) /* Skip initial filler */ - ++sp; - else /* Skip initial channels and, for sp, the filler */ - sp += 4, dp += 3; - - /* Note that the loop adds 3 to dp and 4 to sp each time. */ - while (sp < ep) - *dp++ = *sp++, *dp++ = *sp++, *dp++ = *sp, sp += 2; - - row_info->pixel_depth = 24; - } - - else if (row_info->bit_depth == 16) - { - if (at_start != 0) /* Skip initial filler */ - sp += 2; - else /* Skip initial channels and, for sp, the filler */ - sp += 8, dp += 6; - - while (sp < ep) - { - /* Copy 6 bytes, skip 2 */ - *dp++ = *sp++, *dp++ = *sp++; - *dp++ = *sp++, *dp++ = *sp++; - *dp++ = *sp++, *dp++ = *sp, sp += 3; - } - - row_info->pixel_depth = 48; - } - - else - return; /* bad bit depth */ - - row_info->channels = 3; - - /* Finally fix the color type if it records an alpha channel */ - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - row_info->color_type = PNG_COLOR_TYPE_RGB; - } - - else - return; /* The filler channel has gone already */ - - /* Fix the rowbytes value. */ - row_info->rowbytes = (unsigned int)(dp-row); -} -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* Swaps red and blue bytes within a pixel */ -void /* PRIVATE */ -png_do_bgr(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_bgr"); - - if ((row_info->color_type & PNG_COLOR_MASK_COLOR) != 0) - { - png_uint_32 row_width = row_info->width; - if (row_info->bit_depth == 8) - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 3) - { - png_byte save = *rp; - *rp = *(rp + 2); - *(rp + 2) = save; - } - } - - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 4) - { - png_byte save = *rp; - *rp = *(rp + 2); - *(rp + 2) = save; - } - } - } - -#ifdef PNG_16BIT_SUPPORTED - else if (row_info->bit_depth == 16) - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 6) - { - png_byte save = *rp; - *rp = *(rp + 4); - *(rp + 4) = save; - save = *(rp + 1); - *(rp + 1) = *(rp + 5); - *(rp + 5) = save; - } - } - - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 8) - { - png_byte save = *rp; - *rp = *(rp + 4); - *(rp + 4) = save; - save = *(rp + 1); - *(rp + 1) = *(rp + 5); - *(rp + 5) = save; - } - } - } -#endif - } -} -#endif /* READ_BGR || WRITE_BGR */ - -#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ - defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) -/* Added at libpng-1.5.10 */ -void /* PRIVATE */ -png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info) -{ - if (png_ptr->num_palette < (1 << row_info->bit_depth) && - png_ptr->num_palette > 0) /* num_palette can be 0 in MNG files */ - { - /* Calculations moved outside switch in an attempt to stop different - * compiler warnings. 'padding' is in *bits* within the last byte, it is - * an 'int' because pixel_depth becomes an 'int' in the expression below, - * and this calculation is used because it avoids warnings that other - * forms produced on either GCC or MSVC. - */ - int padding = PNG_PADBITS(row_info->pixel_depth, row_info->width); - png_bytep rp = png_ptr->row_buf + row_info->rowbytes; - - switch (row_info->bit_depth) - { - case 1: - { - /* in this case, all bytes must be 0 so we don't need - * to unpack the pixels except for the rightmost one. - */ - for (; rp > png_ptr->row_buf; rp--) - { - if ((*rp >> padding) != 0) - png_ptr->num_palette_max = 1; - padding = 0; - } - - break; - } - - case 2: - { - for (; rp > png_ptr->row_buf; rp--) - { - int i = ((*rp >> padding) & 0x03); - - if (i > png_ptr->num_palette_max) - png_ptr->num_palette_max = i; - - i = (((*rp >> padding) >> 2) & 0x03); - - if (i > png_ptr->num_palette_max) - png_ptr->num_palette_max = i; - - i = (((*rp >> padding) >> 4) & 0x03); - - if (i > png_ptr->num_palette_max) - png_ptr->num_palette_max = i; - - i = (((*rp >> padding) >> 6) & 0x03); - - if (i > png_ptr->num_palette_max) - png_ptr->num_palette_max = i; - - padding = 0; - } - - break; - } - - case 4: - { - for (; rp > png_ptr->row_buf; rp--) - { - int i = ((*rp >> padding) & 0x0f); - - if (i > png_ptr->num_palette_max) - png_ptr->num_palette_max = i; - - i = (((*rp >> padding) >> 4) & 0x0f); - - if (i > png_ptr->num_palette_max) - png_ptr->num_palette_max = i; - - padding = 0; - } - - break; - } - - case 8: - { - for (; rp > png_ptr->row_buf; rp--) - { - if (*rp > png_ptr->num_palette_max) - png_ptr->num_palette_max = (int) *rp; - } - - break; - } - - default: - break; - } - } -} -#endif /* CHECK_FOR_INVALID_INDEX */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED -void PNGAPI -png_set_user_transform_info(png_structrp png_ptr, png_voidp - user_transform_ptr, int user_transform_depth, int user_transform_channels) -{ - png_debug(1, "in png_set_user_transform_info"); - - if (png_ptr == NULL) - return; - -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 && - (png_ptr->flags & PNG_FLAG_ROW_INIT) != 0) - { - png_app_error(png_ptr, - "info change after png_start_read_image or png_read_update_info"); - return; - } -#endif - - png_ptr->user_transform_ptr = user_transform_ptr; - png_ptr->user_transform_depth = (png_byte)user_transform_depth; - png_ptr->user_transform_channels = (png_byte)user_transform_channels; -} -#endif - -/* This function returns a pointer to the user_transform_ptr associated with - * the user transform functions. The application should free any memory - * associated with this pointer before png_write_destroy and png_read_destroy - * are called. - */ -#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED -png_voidp PNGAPI -png_get_user_transform_ptr(png_const_structrp png_ptr) -{ - if (png_ptr == NULL) - return (NULL); - - return png_ptr->user_transform_ptr; -} -#endif - -#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED -png_uint_32 PNGAPI -png_get_current_row_number(png_const_structrp png_ptr) -{ - /* See the comments in png.h - this is the sub-image row when reading an - * interlaced image. - */ - if (png_ptr != NULL) - return png_ptr->row_number; - - return PNG_UINT_32_MAX; /* help the app not to fail silently */ -} - -png_byte PNGAPI -png_get_current_pass_number(png_const_structrp png_ptr) -{ - if (png_ptr != NULL) - return png_ptr->pass; - return 8; /* invalid */ -} -#endif /* USER_TRANSFORM_INFO */ -#endif /* READ_USER_TRANSFORM || WRITE_USER_TRANSFORM */ -#endif /* READ || WRITE */ diff --git a/jan/src/dep/libs/libpng/pngwio.c b/jan/src/dep/libs/libpng/pngwio.c deleted file mode 100644 index 28194b6fc..000000000 --- a/jan/src/dep/libs/libpng/pngwio.c +++ /dev/null @@ -1,168 +0,0 @@ - -/* pngwio.c - functions for data output - * - * Last changed in libpng 1.6.24 [August 4, 2016] - * Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - * - * This file provides a location for all output. Users who need - * special handling are expected to write functions that have the same - * arguments as these and perform similar functions, but that possibly - * use different output methods. Note that you shouldn't change these - * functions, but rather write replacement functions and then change - * them at run time with png_set_write_fn(...). - */ - -#include "pngpriv.h" - -#ifdef PNG_WRITE_SUPPORTED - -/* Write the data to whatever output you are using. The default routine - * writes to a file pointer. Note that this routine sometimes gets called - * with very small lengths, so you should implement some kind of simple - * buffering if you are using unbuffered writes. This should never be asked - * to write more than 64K on a 16-bit machine. - */ - -void /* PRIVATE */ -png_write_data(png_structrp png_ptr, png_const_bytep data, png_size_t length) -{ - /* NOTE: write_data_fn must not change the buffer! */ - if (png_ptr->write_data_fn != NULL ) - (*(png_ptr->write_data_fn))(png_ptr, png_constcast(png_bytep,data), - length); - - else - png_error(png_ptr, "Call to NULL write function"); -} - -#ifdef PNG_STDIO_SUPPORTED -/* This is the function that does the actual writing of data. If you are - * not writing to a standard C stream, you should create a replacement - * write_data function and use it at run time with png_set_write_fn(), rather - * than changing the library. - */ -void PNGCBAPI -png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_size_t check; - - if (png_ptr == NULL) - return; - - check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr)); - - if (check != length) - png_error(png_ptr, "Write Error"); -} -#endif - -/* This function is called to output any data pending writing (normally - * to disk). After png_flush is called, there should be no data pending - * writing in any buffers. - */ -#ifdef PNG_WRITE_FLUSH_SUPPORTED -void /* PRIVATE */ -png_flush(png_structrp png_ptr) -{ - if (png_ptr->output_flush_fn != NULL) - (*(png_ptr->output_flush_fn))(png_ptr); -} - -# ifdef PNG_STDIO_SUPPORTED -void PNGCBAPI -png_default_flush(png_structp png_ptr) -{ - png_FILE_p io_ptr; - - if (png_ptr == NULL) - return; - - io_ptr = png_voidcast(png_FILE_p, (png_ptr->io_ptr)); - fflush(io_ptr); -} -# endif -#endif - -/* This function allows the application to supply new output functions for - * libpng if standard C streams aren't being used. - * - * This function takes as its arguments: - * png_ptr - pointer to a png output data structure - * io_ptr - pointer to user supplied structure containing info about - * the output functions. May be NULL. - * write_data_fn - pointer to a new output function that takes as its - * arguments a pointer to a png_struct, a pointer to - * data to be written, and a 32-bit unsigned int that is - * the number of bytes to be written. The new write - * function should call png_error(png_ptr, "Error msg") - * to exit and output any fatal error messages. May be - * NULL, in which case libpng's default function will - * be used. - * flush_data_fn - pointer to a new flush function that takes as its - * arguments a pointer to a png_struct. After a call to - * the flush function, there should be no data in any buffers - * or pending transmission. If the output method doesn't do - * any buffering of output, a function prototype must still be - * supplied although it doesn't have to do anything. If - * PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile - * time, output_flush_fn will be ignored, although it must be - * supplied for compatibility. May be NULL, in which case - * libpng's default function will be used, if - * PNG_WRITE_FLUSH_SUPPORTED is defined. This is not - * a good idea if io_ptr does not point to a standard - * *FILE structure. - */ -void PNGAPI -png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr, - png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn) -{ - if (png_ptr == NULL) - return; - - png_ptr->io_ptr = io_ptr; - -#ifdef PNG_STDIO_SUPPORTED - if (write_data_fn != NULL) - png_ptr->write_data_fn = write_data_fn; - - else - png_ptr->write_data_fn = png_default_write_data; -#else - png_ptr->write_data_fn = write_data_fn; -#endif - -#ifdef PNG_WRITE_FLUSH_SUPPORTED -# ifdef PNG_STDIO_SUPPORTED - - if (output_flush_fn != NULL) - png_ptr->output_flush_fn = output_flush_fn; - - else - png_ptr->output_flush_fn = png_default_flush; - -# else - png_ptr->output_flush_fn = output_flush_fn; -# endif -#else - PNG_UNUSED(output_flush_fn) -#endif /* WRITE_FLUSH */ - -#ifdef PNG_READ_SUPPORTED - /* It is an error to read while writing a png file */ - if (png_ptr->read_data_fn != NULL) - { - png_ptr->read_data_fn = NULL; - - png_warning(png_ptr, - "Can't set both read_data_fn and write_data_fn in the" - " same structure"); - } -#endif -} -#endif /* WRITE */ diff --git a/jan/src/dep/libs/libpng/pngwrite.c b/jan/src/dep/libs/libpng/pngwrite.c deleted file mode 100644 index 7967bb29b..000000000 --- a/jan/src/dep/libs/libpng/pngwrite.c +++ /dev/null @@ -1,2385 +0,0 @@ - -/* pngwrite.c - general routines to write a PNG file - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -#include "pngpriv.h" -#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED -# include -#endif /* SIMPLIFIED_WRITE_STDIO */ - -#ifdef PNG_WRITE_SUPPORTED - -#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -/* Write out all the unknown chunks for the current given location */ -static void -write_unknown_chunks(png_structrp png_ptr, png_const_inforp info_ptr, - unsigned int where) -{ - if (info_ptr->unknown_chunks_num != 0) - { - png_const_unknown_chunkp up; - - png_debug(5, "writing extra chunks"); - - for (up = info_ptr->unknown_chunks; - up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; - ++up) - if ((up->location & where) != 0) - { - /* If per-chunk unknown chunk handling is enabled use it, otherwise - * just write the chunks the application has set. - */ -#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED - int keep = png_handle_as_unknown(png_ptr, up->name); - - /* NOTE: this code is radically different from the read side in the - * matter of handling an ancillary unknown chunk. In the read side - * the default behavior is to discard it, in the code below the default - * behavior is to write it. Critical chunks are, however, only - * written if explicitly listed or if the default is set to write all - * unknown chunks. - * - * The default handling is also slightly weird - it is not possible to - * stop the writing of all unsafe-to-copy chunks! - * - * TODO: REVIEW: this would seem to be a bug. - */ - if (keep != PNG_HANDLE_CHUNK_NEVER && - ((up->name[3] & 0x20) /* safe-to-copy overrides everything */ || - keep == PNG_HANDLE_CHUNK_ALWAYS || - (keep == PNG_HANDLE_CHUNK_AS_DEFAULT && - png_ptr->unknown_default == PNG_HANDLE_CHUNK_ALWAYS))) -#endif - { - /* TODO: review, what is wrong with a zero length unknown chunk? */ - if (up->size == 0) - png_warning(png_ptr, "Writing zero-length unknown chunk"); - - png_write_chunk(png_ptr, up->name, up->data, up->size); - } - } - } -} -#endif /* WRITE_UNKNOWN_CHUNKS */ - -/* Writes all the PNG information. This is the suggested way to use the - * library. If you have a new chunk to add, make a function to write it, - * and put it in the correct location here. If you want the chunk written - * after the image data, put it in png_write_end(). I strongly encourage - * you to supply a PNG_INFO_ flag, and check info_ptr->valid before writing - * the chunk, as that will keep the code from breaking if you want to just - * write a plain PNG file. If you have long comments, I suggest writing - * them in png_write_end(), and compressing them. - */ -void PNGAPI -png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr) -{ - png_debug(1, "in png_write_info_before_PLTE"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - if ((png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE) == 0) - { - /* Write PNG signature */ - png_write_sig(png_ptr); - -#ifdef PNG_MNG_FEATURES_SUPPORTED - if ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) != 0 && \ - png_ptr->mng_features_permitted != 0) - { - png_warning(png_ptr, - "MNG features are not allowed in a PNG datastream"); - png_ptr->mng_features_permitted = 0; - } -#endif - - /* Write IHDR information. */ - png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height, - info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type, - info_ptr->filter_type, -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - info_ptr->interlace_type -#else - 0 -#endif - ); - - /* The rest of these check to see if the valid field has the appropriate - * flag set, and if it does, writes the chunk. - * - * 1.6.0: COLORSPACE support controls the writing of these chunks too, and - * the chunks will be written if the WRITE routine is there and - * information * is available in the COLORSPACE. (See - * png_colorspace_sync_info in png.c for where the valid flags get set.) - * - * Under certain circumstances the colorspace can be invalidated without - * syncing the info_struct 'valid' flags; this happens if libpng detects - * an error and calls png_error while the color space is being set, yet - * the application continues writing the PNG. So check the 'invalid' - * flag here too. - */ -#ifdef PNG_GAMMA_SUPPORTED -# ifdef PNG_WRITE_gAMA_SUPPORTED - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && - (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_gAMA) != 0 && - (info_ptr->valid & PNG_INFO_gAMA) != 0) - png_write_gAMA_fixed(png_ptr, info_ptr->colorspace.gamma); -# endif -#endif - -#ifdef PNG_COLORSPACE_SUPPORTED - /* Write only one of sRGB or an ICC profile. If a profile was supplied - * and it matches one of the known sRGB ones issue a warning. - */ -# ifdef PNG_WRITE_iCCP_SUPPORTED - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && - (info_ptr->valid & PNG_INFO_iCCP) != 0) - { -# ifdef PNG_WRITE_sRGB_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sRGB) != 0) - png_app_warning(png_ptr, - "profile matches sRGB but writing iCCP instead"); -# endif - - png_write_iCCP(png_ptr, info_ptr->iccp_name, - info_ptr->iccp_profile); - } -# ifdef PNG_WRITE_sRGB_SUPPORTED - else -# endif -# endif - -# ifdef PNG_WRITE_sRGB_SUPPORTED - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && - (info_ptr->valid & PNG_INFO_sRGB) != 0) - png_write_sRGB(png_ptr, info_ptr->colorspace.rendering_intent); -# endif /* WRITE_sRGB */ -#endif /* COLORSPACE */ - -#ifdef PNG_WRITE_sBIT_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sBIT) != 0) - png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type); -#endif - -#ifdef PNG_COLORSPACE_SUPPORTED -# ifdef PNG_WRITE_cHRM_SUPPORTED - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && - (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) != 0 && - (info_ptr->valid & PNG_INFO_cHRM) != 0) - png_write_cHRM_fixed(png_ptr, &info_ptr->colorspace.end_points_xy); -# endif -#endif - -#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_IHDR); -#endif - - png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE; - } -} - -void PNGAPI -png_write_info(png_structrp png_ptr, png_const_inforp info_ptr) -{ -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) - int i; -#endif - - png_debug(1, "in png_write_info"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_write_info_before_PLTE(png_ptr, info_ptr); - - if ((info_ptr->valid & PNG_INFO_PLTE) != 0) - png_write_PLTE(png_ptr, info_ptr->palette, - (png_uint_32)info_ptr->num_palette); - - else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - png_error(png_ptr, "Valid palette required for paletted images"); - -#ifdef PNG_WRITE_tRNS_SUPPORTED - if ((info_ptr->valid & PNG_INFO_tRNS) !=0) - { -#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED - /* Invert the alpha channel (in tRNS) */ - if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0 && - info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - int j, jend; - - jend = info_ptr->num_trans; - if (jend > PNG_MAX_PALETTE_LENGTH) - jend = PNG_MAX_PALETTE_LENGTH; - - for (j = 0; jtrans_alpha[j] = - (png_byte)(255 - info_ptr->trans_alpha[j]); - } -#endif - png_write_tRNS(png_ptr, info_ptr->trans_alpha, &(info_ptr->trans_color), - info_ptr->num_trans, info_ptr->color_type); - } -#endif -#ifdef PNG_WRITE_bKGD_SUPPORTED - if ((info_ptr->valid & PNG_INFO_bKGD) != 0) - png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type); -#endif - -#ifdef PNG_WRITE_hIST_SUPPORTED - if ((info_ptr->valid & PNG_INFO_hIST) != 0) - png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette); -#endif - -#ifdef PNG_WRITE_oFFs_SUPPORTED - if ((info_ptr->valid & PNG_INFO_oFFs) != 0) - png_write_oFFs(png_ptr, info_ptr->x_offset, info_ptr->y_offset, - info_ptr->offset_unit_type); -#endif - -#ifdef PNG_WRITE_pCAL_SUPPORTED - if ((info_ptr->valid & PNG_INFO_pCAL) != 0) - png_write_pCAL(png_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0, - info_ptr->pcal_X1, info_ptr->pcal_type, info_ptr->pcal_nparams, - info_ptr->pcal_units, info_ptr->pcal_params); -#endif - -#ifdef PNG_WRITE_sCAL_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sCAL) != 0) - png_write_sCAL_s(png_ptr, (int)info_ptr->scal_unit, - info_ptr->scal_s_width, info_ptr->scal_s_height); -#endif /* sCAL */ - -#ifdef PNG_WRITE_pHYs_SUPPORTED - if ((info_ptr->valid & PNG_INFO_pHYs) != 0) - png_write_pHYs(png_ptr, info_ptr->x_pixels_per_unit, - info_ptr->y_pixels_per_unit, info_ptr->phys_unit_type); -#endif /* pHYs */ - -#ifdef PNG_WRITE_tIME_SUPPORTED - if ((info_ptr->valid & PNG_INFO_tIME) != 0) - { - png_write_tIME(png_ptr, &(info_ptr->mod_time)); - png_ptr->mode |= PNG_WROTE_tIME; - } -#endif /* tIME */ - -#ifdef PNG_WRITE_sPLT_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sPLT) != 0) - for (i = 0; i < (int)info_ptr->splt_palettes_num; i++) - png_write_sPLT(png_ptr, info_ptr->splt_palettes + i); -#endif /* sPLT */ - -#ifdef PNG_WRITE_TEXT_SUPPORTED - /* Check to see if we need to write text chunks */ - for (i = 0; i < info_ptr->num_text; i++) - { - png_debug2(2, "Writing header text chunk %d, type %d", i, - info_ptr->text[i].compression); - /* An internationalized chunk? */ - if (info_ptr->text[i].compression > 0) - { -#ifdef PNG_WRITE_iTXt_SUPPORTED - /* Write international chunk */ - png_write_iTXt(png_ptr, - info_ptr->text[i].compression, - info_ptr->text[i].key, - info_ptr->text[i].lang, - info_ptr->text[i].lang_key, - info_ptr->text[i].text); - /* Mark this chunk as written */ - if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; - else - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; -#else - png_warning(png_ptr, "Unable to write international text"); -#endif - } - - /* If we want a compressed text chunk */ - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_zTXt) - { -#ifdef PNG_WRITE_zTXt_SUPPORTED - /* Write compressed chunk */ - png_write_zTXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, info_ptr->text[i].compression); - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; -#else - png_warning(png_ptr, "Unable to write compressed text"); -#endif - } - - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) - { -#ifdef PNG_WRITE_tEXt_SUPPORTED - /* Write uncompressed chunk */ - png_write_tEXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, - 0); - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; -#else - /* Can't get here */ - png_warning(png_ptr, "Unable to write uncompressed text"); -#endif - } - } -#endif /* tEXt */ - -#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_PLTE); -#endif -} - -/* Writes the end of the PNG file. If you don't want to write comments or - * time information, you can pass NULL for info. If you already wrote these - * in png_write_info(), do not write them again here. If you have long - * comments, I suggest writing them here, and compressing them. - */ -void PNGAPI -png_write_end(png_structrp png_ptr, png_inforp info_ptr) -{ - png_debug(1, "in png_write_end"); - - if (png_ptr == NULL) - return; - - if ((png_ptr->mode & PNG_HAVE_IDAT) == 0) - png_error(png_ptr, "No IDATs written into file"); - -#ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED - if (png_ptr->num_palette_max > png_ptr->num_palette) - png_benign_error(png_ptr, "Wrote palette index exceeding num_palette"); -#endif - - /* See if user wants us to write information chunks */ - if (info_ptr != NULL) - { -#ifdef PNG_WRITE_TEXT_SUPPORTED - int i; /* local index variable */ -#endif -#ifdef PNG_WRITE_tIME_SUPPORTED - /* Check to see if user has supplied a time chunk */ - if ((info_ptr->valid & PNG_INFO_tIME) != 0 && - (png_ptr->mode & PNG_WROTE_tIME) == 0) - png_write_tIME(png_ptr, &(info_ptr->mod_time)); - -#endif -#ifdef PNG_WRITE_TEXT_SUPPORTED - /* Loop through comment chunks */ - for (i = 0; i < info_ptr->num_text; i++) - { - png_debug2(2, "Writing trailer text chunk %d, type %d", i, - info_ptr->text[i].compression); - /* An internationalized chunk? */ - if (info_ptr->text[i].compression > 0) - { -#ifdef PNG_WRITE_iTXt_SUPPORTED - /* Write international chunk */ - png_write_iTXt(png_ptr, - info_ptr->text[i].compression, - info_ptr->text[i].key, - info_ptr->text[i].lang, - info_ptr->text[i].lang_key, - info_ptr->text[i].text); - /* Mark this chunk as written */ - if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; - else - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; -#else - png_warning(png_ptr, "Unable to write international text"); -#endif - } - - else if (info_ptr->text[i].compression >= PNG_TEXT_COMPRESSION_zTXt) - { -#ifdef PNG_WRITE_zTXt_SUPPORTED - /* Write compressed chunk */ - png_write_zTXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, info_ptr->text[i].compression); - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; -#else - png_warning(png_ptr, "Unable to write compressed text"); -#endif - } - - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) - { -#ifdef PNG_WRITE_tEXt_SUPPORTED - /* Write uncompressed chunk */ - png_write_tEXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, 0); - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; -#else - png_warning(png_ptr, "Unable to write uncompressed text"); -#endif - } - } -#endif -#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - write_unknown_chunks(png_ptr, info_ptr, PNG_AFTER_IDAT); -#endif - } - - png_ptr->mode |= PNG_AFTER_IDAT; - - /* Write end of PNG file */ - png_write_IEND(png_ptr); - - /* This flush, added in libpng-1.0.8, removed from libpng-1.0.9beta03, - * and restored again in libpng-1.2.30, may cause some applications that - * do not set png_ptr->output_flush_fn to crash. If your application - * experiences a problem, please try building libpng with - * PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED defined, and report the event to - * png-mng-implement at lists.sf.net . - */ -#ifdef PNG_WRITE_FLUSH_SUPPORTED -# ifdef PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED - png_flush(png_ptr); -# endif -#endif -} - -#ifdef PNG_CONVERT_tIME_SUPPORTED -void PNGAPI -png_convert_from_struct_tm(png_timep ptime, PNG_CONST struct tm * ttime) -{ - png_debug(1, "in png_convert_from_struct_tm"); - - ptime->year = (png_uint_16)(1900 + ttime->tm_year); - ptime->month = (png_byte)(ttime->tm_mon + 1); - ptime->day = (png_byte)ttime->tm_mday; - ptime->hour = (png_byte)ttime->tm_hour; - ptime->minute = (png_byte)ttime->tm_min; - ptime->second = (png_byte)ttime->tm_sec; -} - -void PNGAPI -png_convert_from_time_t(png_timep ptime, time_t ttime) -{ - struct tm *tbuf; - - png_debug(1, "in png_convert_from_time_t"); - - tbuf = gmtime(&ttime); - png_convert_from_struct_tm(ptime, tbuf); -} -#endif - -/* Initialize png_ptr structure, and allocate any memory needed */ -PNG_FUNCTION(png_structp,PNGAPI -png_create_write_struct,(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn),PNG_ALLOCATED) -{ -#ifndef PNG_USER_MEM_SUPPORTED - png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr, - error_fn, warn_fn, NULL, NULL, NULL); -#else - return png_create_write_struct_2(user_png_ver, error_ptr, error_fn, - warn_fn, NULL, NULL, NULL); -} - -/* Alternate initialize png_ptr structure, and allocate any memory needed */ -PNG_FUNCTION(png_structp,PNGAPI -png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED) -{ - png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr, - error_fn, warn_fn, mem_ptr, malloc_fn, free_fn); -#endif /* USER_MEM */ - if (png_ptr != NULL) - { - /* Set the zlib control values to defaults; they can be overridden by the - * application after the struct has been created. - */ - png_ptr->zbuffer_size = PNG_ZBUF_SIZE; - - /* The 'zlib_strategy' setting is irrelevant because png_default_claim in - * pngwutil.c defaults it according to whether or not filters will be - * used, and ignores this setting. - */ - png_ptr->zlib_strategy = PNG_Z_DEFAULT_STRATEGY; - png_ptr->zlib_level = PNG_Z_DEFAULT_COMPRESSION; - png_ptr->zlib_mem_level = 8; - png_ptr->zlib_window_bits = 15; - png_ptr->zlib_method = 8; - -#ifdef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED - png_ptr->zlib_text_strategy = PNG_TEXT_Z_DEFAULT_STRATEGY; - png_ptr->zlib_text_level = PNG_TEXT_Z_DEFAULT_COMPRESSION; - png_ptr->zlib_text_mem_level = 8; - png_ptr->zlib_text_window_bits = 15; - png_ptr->zlib_text_method = 8; -#endif /* WRITE_COMPRESSED_TEXT */ - - /* This is a highly dubious configuration option; by default it is off, - * but it may be appropriate for private builds that are testing - * extensions not conformant to the current specification, or of - * applications that must not fail to write at all costs! - */ -#ifdef PNG_BENIGN_WRITE_ERRORS_SUPPORTED - /* In stable builds only warn if an application error can be completely - * handled. - */ - png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN; -#endif - - /* App warnings are warnings in release (or release candidate) builds but - * are errors during development. - */ -#if PNG_RELEASE_BUILD - png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN; -#endif - - /* TODO: delay this, it can be done in png_init_io() (if the app doesn't - * do it itself) avoiding setting the default function if it is not - * required. - */ - png_set_write_fn(png_ptr, NULL, NULL, NULL); - } - - return png_ptr; -} - - -/* Write a few rows of image data. If the image is interlaced, - * either you will have to write the 7 sub images, or, if you - * have called png_set_interlace_handling(), you will have to - * "write" the image seven times. - */ -void PNGAPI -png_write_rows(png_structrp png_ptr, png_bytepp row, - png_uint_32 num_rows) -{ - png_uint_32 i; /* row counter */ - png_bytepp rp; /* row pointer */ - - png_debug(1, "in png_write_rows"); - - if (png_ptr == NULL) - return; - - /* Loop through the rows */ - for (i = 0, rp = row; i < num_rows; i++, rp++) - { - png_write_row(png_ptr, *rp); - } -} - -/* Write the image. You only need to call this function once, even - * if you are writing an interlaced image. - */ -void PNGAPI -png_write_image(png_structrp png_ptr, png_bytepp image) -{ - png_uint_32 i; /* row index */ - int pass, num_pass; /* pass variables */ - png_bytepp rp; /* points to current row */ - - if (png_ptr == NULL) - return; - - png_debug(1, "in png_write_image"); - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* Initialize interlace handling. If image is not interlaced, - * this will set pass to 1 - */ - num_pass = png_set_interlace_handling(png_ptr); -#else - num_pass = 1; -#endif - /* Loop through passes */ - for (pass = 0; pass < num_pass; pass++) - { - /* Loop through image */ - for (i = 0, rp = image; i < png_ptr->height; i++, rp++) - { - png_write_row(png_ptr, *rp); - } - } -} - -#ifdef PNG_MNG_FEATURES_SUPPORTED -/* Performs intrapixel differencing */ -static void -png_do_write_intrapixel(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_write_intrapixel"); - - if ((row_info->color_type & PNG_COLOR_MASK_COLOR) != 0) - { - int bytes_per_pixel; - png_uint_32 row_width = row_info->width; - if (row_info->bit_depth == 8) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 3; - - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 4; - - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - *(rp) = (png_byte)(*rp - *(rp + 1)); - *(rp + 2) = (png_byte)(*(rp + 2) - *(rp + 1)); - } - } - -#ifdef PNG_WRITE_16BIT_SUPPORTED - else if (row_info->bit_depth == 16) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 6; - - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 8; - - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - png_uint_32 s0 = (png_uint_32)(*(rp ) << 8) | *(rp + 1); - png_uint_32 s1 = (png_uint_32)(*(rp + 2) << 8) | *(rp + 3); - png_uint_32 s2 = (png_uint_32)(*(rp + 4) << 8) | *(rp + 5); - png_uint_32 red = (png_uint_32)((s0 - s1) & 0xffffL); - png_uint_32 blue = (png_uint_32)((s2 - s1) & 0xffffL); - *(rp ) = (png_byte)(red >> 8); - *(rp + 1) = (png_byte)red; - *(rp + 4) = (png_byte)(blue >> 8); - *(rp + 5) = (png_byte)blue; - } - } -#endif /* WRITE_16BIT */ - } -} -#endif /* MNG_FEATURES */ - -/* Called by user to write a row of image data */ -void PNGAPI -png_write_row(png_structrp png_ptr, png_const_bytep row) -{ - /* 1.5.6: moved from png_struct to be a local structure: */ - png_row_info row_info; - - if (png_ptr == NULL) - return; - - png_debug2(1, "in png_write_row (row %u, pass %d)", - png_ptr->row_number, png_ptr->pass); - - /* Initialize transformations and other stuff if first time */ - if (png_ptr->row_number == 0 && png_ptr->pass == 0) - { - /* Make sure we wrote the header info */ - if ((png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE) == 0) - png_error(png_ptr, - "png_write_info was never called before png_write_row"); - - /* Check for transforms that have been set but were defined out */ -#if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED) - if ((png_ptr->transformations & PNG_INVERT_MONO) != 0) - png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined"); -#endif - -#if !defined(PNG_WRITE_FILLER_SUPPORTED) && defined(PNG_READ_FILLER_SUPPORTED) - if ((png_ptr->transformations & PNG_FILLER) != 0) - png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined"); -#endif -#if !defined(PNG_WRITE_PACKSWAP_SUPPORTED) && \ - defined(PNG_READ_PACKSWAP_SUPPORTED) - if ((png_ptr->transformations & PNG_PACKSWAP) != 0) - png_warning(png_ptr, - "PNG_WRITE_PACKSWAP_SUPPORTED is not defined"); -#endif - -#if !defined(PNG_WRITE_PACK_SUPPORTED) && defined(PNG_READ_PACK_SUPPORTED) - if ((png_ptr->transformations & PNG_PACK) != 0) - png_warning(png_ptr, "PNG_WRITE_PACK_SUPPORTED is not defined"); -#endif - -#if !defined(PNG_WRITE_SHIFT_SUPPORTED) && defined(PNG_READ_SHIFT_SUPPORTED) - if ((png_ptr->transformations & PNG_SHIFT) != 0) - png_warning(png_ptr, "PNG_WRITE_SHIFT_SUPPORTED is not defined"); -#endif - -#if !defined(PNG_WRITE_BGR_SUPPORTED) && defined(PNG_READ_BGR_SUPPORTED) - if ((png_ptr->transformations & PNG_BGR) != 0) - png_warning(png_ptr, "PNG_WRITE_BGR_SUPPORTED is not defined"); -#endif - -#if !defined(PNG_WRITE_SWAP_SUPPORTED) && defined(PNG_READ_SWAP_SUPPORTED) - if ((png_ptr->transformations & PNG_SWAP_BYTES) != 0) - png_warning(png_ptr, "PNG_WRITE_SWAP_SUPPORTED is not defined"); -#endif - - png_write_start_row(png_ptr); - } - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* If interlaced and not interested in row, return */ - if (png_ptr->interlaced != 0 && - (png_ptr->transformations & PNG_INTERLACE) != 0) - { - switch (png_ptr->pass) - { - case 0: - if ((png_ptr->row_number & 0x07) != 0) - { - png_write_finish_row(png_ptr); - return; - } - break; - - case 1: - if ((png_ptr->row_number & 0x07) != 0 || png_ptr->width < 5) - { - png_write_finish_row(png_ptr); - return; - } - break; - - case 2: - if ((png_ptr->row_number & 0x07) != 4) - { - png_write_finish_row(png_ptr); - return; - } - break; - - case 3: - if ((png_ptr->row_number & 0x03) != 0 || png_ptr->width < 3) - { - png_write_finish_row(png_ptr); - return; - } - break; - - case 4: - if ((png_ptr->row_number & 0x03) != 2) - { - png_write_finish_row(png_ptr); - return; - } - break; - - case 5: - if ((png_ptr->row_number & 0x01) != 0 || png_ptr->width < 2) - { - png_write_finish_row(png_ptr); - return; - } - break; - - case 6: - if ((png_ptr->row_number & 0x01) == 0) - { - png_write_finish_row(png_ptr); - return; - } - break; - - default: /* error: ignore it */ - break; - } - } -#endif - - /* Set up row info for transformations */ - row_info.color_type = png_ptr->color_type; - row_info.width = png_ptr->usr_width; - row_info.channels = png_ptr->usr_channels; - row_info.bit_depth = png_ptr->usr_bit_depth; - row_info.pixel_depth = (png_byte)(row_info.bit_depth * row_info.channels); - row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width); - - png_debug1(3, "row_info->color_type = %d", row_info.color_type); - png_debug1(3, "row_info->width = %u", row_info.width); - png_debug1(3, "row_info->channels = %d", row_info.channels); - png_debug1(3, "row_info->bit_depth = %d", row_info.bit_depth); - png_debug1(3, "row_info->pixel_depth = %d", row_info.pixel_depth); - png_debug1(3, "row_info->rowbytes = %lu", (unsigned long)row_info.rowbytes); - - /* Copy user's row into buffer, leaving room for filter byte. */ - memcpy(png_ptr->row_buf + 1, row, row_info.rowbytes); - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* Handle interlacing */ - if (png_ptr->interlaced && png_ptr->pass < 6 && - (png_ptr->transformations & PNG_INTERLACE) != 0) - { - png_do_write_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass); - /* This should always get caught above, but still ... */ - if (row_info.width == 0) - { - png_write_finish_row(png_ptr); - return; - } - } -#endif - -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED - /* Handle other transformations */ - if (png_ptr->transformations != 0) - png_do_write_transformations(png_ptr, &row_info); -#endif - - /* At this point the row_info pixel depth must match the 'transformed' depth, - * which is also the output depth. - */ - if (row_info.pixel_depth != png_ptr->pixel_depth || - row_info.pixel_depth != png_ptr->transformed_pixel_depth) - png_error(png_ptr, "internal write transform logic error"); - -#ifdef PNG_MNG_FEATURES_SUPPORTED - /* Write filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and - * 2. Libpng did not write a PNG signature (this filter_method is only - * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and - * 4. The filter_method is 64 and - * 5. The color_type is RGB or RGBA - */ - if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) != 0 && - (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) - { - /* Intrapixel differencing */ - png_do_write_intrapixel(&row_info, png_ptr->row_buf + 1); - } -#endif - -/* Added at libpng-1.5.10 */ -#ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED - /* Check for out-of-range palette index */ - if (row_info.color_type == PNG_COLOR_TYPE_PALETTE && - png_ptr->num_palette_max >= 0) - png_do_check_palette_indexes(png_ptr, &row_info); -#endif - - /* Find a filter if necessary, filter the row and write it out. */ - png_write_find_filter(png_ptr, &row_info); - - if (png_ptr->write_row_fn != NULL) - (*(png_ptr->write_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); -} - -#ifdef PNG_WRITE_FLUSH_SUPPORTED -/* Set the automatic flush interval or 0 to turn flushing off */ -void PNGAPI -png_set_flush(png_structrp png_ptr, int nrows) -{ - png_debug(1, "in png_set_flush"); - - if (png_ptr == NULL) - return; - - png_ptr->flush_dist = (nrows < 0 ? 0 : (png_uint_32)nrows); -} - -/* Flush the current output buffers now */ -void PNGAPI -png_write_flush(png_structrp png_ptr) -{ - png_debug(1, "in png_write_flush"); - - if (png_ptr == NULL) - return; - - /* We have already written out all of the data */ - if (png_ptr->row_number >= png_ptr->num_rows) - return; - - png_compress_IDAT(png_ptr, NULL, 0, Z_SYNC_FLUSH); - png_ptr->flush_rows = 0; - png_flush(png_ptr); -} -#endif /* WRITE_FLUSH */ - -/* Free any memory used in png_ptr struct without freeing the struct itself. */ -static void -png_write_destroy(png_structrp png_ptr) -{ - png_debug(1, "in png_write_destroy"); - - /* Free any memory zlib uses */ - if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0) - deflateEnd(&png_ptr->zstream); - - /* Free our memory. png_free checks NULL for us. */ - png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list); - png_free(png_ptr, png_ptr->row_buf); - png_ptr->row_buf = NULL; -#ifdef PNG_WRITE_FILTER_SUPPORTED - png_free(png_ptr, png_ptr->prev_row); - png_free(png_ptr, png_ptr->try_row); - png_free(png_ptr, png_ptr->tst_row); - png_ptr->prev_row = NULL; - png_ptr->try_row = NULL; - png_ptr->tst_row = NULL; -#endif - -#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list = NULL; -#endif - - /* The error handling and memory handling information is left intact at this - * point: the jmp_buf may still have to be freed. See png_destroy_png_struct - * for how this happens. - */ -} - -/* Free all memory used by the write. - * In libpng 1.6.0 this API changed quietly to no longer accept a NULL value for - * *png_ptr_ptr. Prior to 1.6.0 it would accept such a value and it would free - * the passed in info_structs but it would quietly fail to free any of the data - * inside them. In 1.6.0 it quietly does nothing (it has to be quiet because it - * has no png_ptr.) - */ -void PNGAPI -png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr) -{ - png_debug(1, "in png_destroy_write_struct"); - - if (png_ptr_ptr != NULL) - { - png_structrp png_ptr = *png_ptr_ptr; - - if (png_ptr != NULL) /* added in libpng 1.6.0 */ - { - png_destroy_info_struct(png_ptr, info_ptr_ptr); - - *png_ptr_ptr = NULL; - png_write_destroy(png_ptr); - png_destroy_png_struct(png_ptr); - } - } -} - -/* Allow the application to select one or more row filters to use. */ -void PNGAPI -png_set_filter(png_structrp png_ptr, int method, int filters) -{ - png_debug(1, "in png_set_filter"); - - if (png_ptr == NULL) - return; - -#ifdef PNG_MNG_FEATURES_SUPPORTED - if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) != 0 && - (method == PNG_INTRAPIXEL_DIFFERENCING)) - method = PNG_FILTER_TYPE_BASE; - -#endif - if (method == PNG_FILTER_TYPE_BASE) - { - switch (filters & (PNG_ALL_FILTERS | 0x07)) - { -#ifdef PNG_WRITE_FILTER_SUPPORTED - case 5: - case 6: - case 7: png_app_error(png_ptr, "Unknown row filter for method 0"); - /* FALL THROUGH */ -#endif /* WRITE_FILTER */ - case PNG_FILTER_VALUE_NONE: - png_ptr->do_filter = PNG_FILTER_NONE; break; - -#ifdef PNG_WRITE_FILTER_SUPPORTED - case PNG_FILTER_VALUE_SUB: - png_ptr->do_filter = PNG_FILTER_SUB; break; - - case PNG_FILTER_VALUE_UP: - png_ptr->do_filter = PNG_FILTER_UP; break; - - case PNG_FILTER_VALUE_AVG: - png_ptr->do_filter = PNG_FILTER_AVG; break; - - case PNG_FILTER_VALUE_PAETH: - png_ptr->do_filter = PNG_FILTER_PAETH; break; - - default: - png_ptr->do_filter = (png_byte)filters; break; -#else - default: - png_app_error(png_ptr, "Unknown row filter for method 0"); -#endif /* WRITE_FILTER */ - } - -#ifdef PNG_WRITE_FILTER_SUPPORTED - /* If we have allocated the row_buf, this means we have already started - * with the image and we should have allocated all of the filter buffers - * that have been selected. If prev_row isn't already allocated, then - * it is too late to start using the filters that need it, since we - * will be missing the data in the previous row. If an application - * wants to start and stop using particular filters during compression, - * it should start out with all of the filters, and then remove them - * or add them back after the start of compression. - * - * NOTE: this is a nasty constraint on the code, because it means that the - * prev_row buffer must be maintained even if there are currently no - * 'prev_row' requiring filters active. - */ - if (png_ptr->row_buf != NULL) - { - int num_filters; - png_alloc_size_t buf_size; - - /* Repeat the checks in png_write_start_row; 1 pixel high or wide - * images cannot benefit from certain filters. If this isn't done here - * the check below will fire on 1 pixel high images. - */ - if (png_ptr->height == 1) - filters &= ~(PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH); - - if (png_ptr->width == 1) - filters &= ~(PNG_FILTER_SUB|PNG_FILTER_AVG|PNG_FILTER_PAETH); - - if ((filters & (PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH)) != 0 - && png_ptr->prev_row == NULL) - { - /* This is the error case, however it is benign - the previous row - * is not available so the filter can't be used. Just warn here. - */ - png_app_warning(png_ptr, - "png_set_filter: UP/AVG/PAETH cannot be added after start"); - filters &= ~(PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH); - } - - num_filters = 0; - - if (filters & PNG_FILTER_SUB) - num_filters++; - - if (filters & PNG_FILTER_UP) - num_filters++; - - if (filters & PNG_FILTER_AVG) - num_filters++; - - if (filters & PNG_FILTER_PAETH) - num_filters++; - - /* Allocate needed row buffers if they have not already been - * allocated. - */ - buf_size = PNG_ROWBYTES(png_ptr->usr_channels * png_ptr->usr_bit_depth, - png_ptr->width) + 1; - - if (png_ptr->try_row == NULL) - png_ptr->try_row = png_voidcast(png_bytep, - png_malloc(png_ptr, buf_size)); - - if (num_filters > 1) - { - if (png_ptr->tst_row == NULL) - png_ptr->tst_row = png_voidcast(png_bytep, - png_malloc(png_ptr, buf_size)); - } - } - png_ptr->do_filter = (png_byte)filters; -#endif - } - else - png_error(png_ptr, "Unknown custom filter method"); -} - -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */ -/* Provide floating and fixed point APIs */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_filter_heuristics(png_structrp png_ptr, int heuristic_method, - int num_weights, png_const_doublep filter_weights, - png_const_doublep filter_costs) -{ - PNG_UNUSED(png_ptr) - PNG_UNUSED(heuristic_method) - PNG_UNUSED(num_weights) - PNG_UNUSED(filter_weights) - PNG_UNUSED(filter_costs) -} -#endif /* FLOATING_POINT */ - -#ifdef PNG_FIXED_POINT_SUPPORTED -void PNGAPI -png_set_filter_heuristics_fixed(png_structrp png_ptr, int heuristic_method, - int num_weights, png_const_fixed_point_p filter_weights, - png_const_fixed_point_p filter_costs) -{ - PNG_UNUSED(png_ptr) - PNG_UNUSED(heuristic_method) - PNG_UNUSED(num_weights) - PNG_UNUSED(filter_weights) - PNG_UNUSED(filter_costs) -} -#endif /* FIXED_POINT */ -#endif /* WRITE_WEIGHTED_FILTER */ - -#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED -void PNGAPI -png_set_compression_level(png_structrp png_ptr, int level) -{ - png_debug(1, "in png_set_compression_level"); - - if (png_ptr == NULL) - return; - - png_ptr->zlib_level = level; -} - -void PNGAPI -png_set_compression_mem_level(png_structrp png_ptr, int mem_level) -{ - png_debug(1, "in png_set_compression_mem_level"); - - if (png_ptr == NULL) - return; - - png_ptr->zlib_mem_level = mem_level; -} - -void PNGAPI -png_set_compression_strategy(png_structrp png_ptr, int strategy) -{ - png_debug(1, "in png_set_compression_strategy"); - - if (png_ptr == NULL) - return; - - /* The flag setting here prevents the libpng dynamic selection of strategy. - */ - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY; - png_ptr->zlib_strategy = strategy; -} - -/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a - * smaller value of window_bits if it can do so safely. - */ -void PNGAPI -png_set_compression_window_bits(png_structrp png_ptr, int window_bits) -{ - if (png_ptr == NULL) - return; - - /* Prior to 1.6.0 this would warn but then set the window_bits value. This - * meant that negative window bits values could be selected that would cause - * libpng to write a non-standard PNG file with raw deflate or gzip - * compressed IDAT or ancillary chunks. Such files can be read and there is - * no warning on read, so this seems like a very bad idea. - */ - if (window_bits > 15) - { - png_warning(png_ptr, "Only compression windows <= 32k supported by PNG"); - window_bits = 15; - } - - else if (window_bits < 8) - { - png_warning(png_ptr, "Only compression windows >= 256 supported by PNG"); - window_bits = 8; - } - - png_ptr->zlib_window_bits = window_bits; -} - -void PNGAPI -png_set_compression_method(png_structrp png_ptr, int method) -{ - png_debug(1, "in png_set_compression_method"); - - if (png_ptr == NULL) - return; - - /* This would produce an invalid PNG file if it worked, but it doesn't and - * deflate will fault it, so it is harmless to just warn here. - */ - if (method != 8) - png_warning(png_ptr, "Only compression method 8 is supported by PNG"); - - png_ptr->zlib_method = method; -} -#endif /* WRITE_CUSTOMIZE_COMPRESSION */ - -/* The following were added to libpng-1.5.4 */ -#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED -void PNGAPI -png_set_text_compression_level(png_structrp png_ptr, int level) -{ - png_debug(1, "in png_set_text_compression_level"); - - if (png_ptr == NULL) - return; - - png_ptr->zlib_text_level = level; -} - -void PNGAPI -png_set_text_compression_mem_level(png_structrp png_ptr, int mem_level) -{ - png_debug(1, "in png_set_text_compression_mem_level"); - - if (png_ptr == NULL) - return; - - png_ptr->zlib_text_mem_level = mem_level; -} - -void PNGAPI -png_set_text_compression_strategy(png_structrp png_ptr, int strategy) -{ - png_debug(1, "in png_set_text_compression_strategy"); - - if (png_ptr == NULL) - return; - - png_ptr->zlib_text_strategy = strategy; -} - -/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a - * smaller value of window_bits if it can do so safely. - */ -void PNGAPI -png_set_text_compression_window_bits(png_structrp png_ptr, int window_bits) -{ - if (png_ptr == NULL) - return; - - if (window_bits > 15) - { - png_warning(png_ptr, "Only compression windows <= 32k supported by PNG"); - window_bits = 15; - } - - else if (window_bits < 8) - { - png_warning(png_ptr, "Only compression windows >= 256 supported by PNG"); - window_bits = 8; - } - - png_ptr->zlib_text_window_bits = window_bits; -} - -void PNGAPI -png_set_text_compression_method(png_structrp png_ptr, int method) -{ - png_debug(1, "in png_set_text_compression_method"); - - if (png_ptr == NULL) - return; - - if (method != 8) - png_warning(png_ptr, "Only compression method 8 is supported by PNG"); - - png_ptr->zlib_text_method = method; -} -#endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */ -/* end of API added to libpng-1.5.4 */ - -void PNGAPI -png_set_write_status_fn(png_structrp png_ptr, png_write_status_ptr write_row_fn) -{ - if (png_ptr == NULL) - return; - - png_ptr->write_row_fn = write_row_fn; -} - -#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED -void PNGAPI -png_set_write_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr - write_user_transform_fn) -{ - png_debug(1, "in png_set_write_user_transform_fn"); - - if (png_ptr == NULL) - return; - - png_ptr->transformations |= PNG_USER_TRANSFORM; - png_ptr->write_user_transform_fn = write_user_transform_fn; -} -#endif - - -#ifdef PNG_INFO_IMAGE_SUPPORTED -void PNGAPI -png_write_png(png_structrp png_ptr, png_inforp info_ptr, - int transforms, voidp params) -{ - if (png_ptr == NULL || info_ptr == NULL) - return; - - if ((info_ptr->valid & PNG_INFO_IDAT) == 0) - { - png_app_error(png_ptr, "no rows for png_write_image to write"); - return; - } - - /* Write the file header information. */ - png_write_info(png_ptr, info_ptr); - - /* ------ these transformations don't touch the info structure ------- */ - - /* Invert monochrome pixels */ - if ((transforms & PNG_TRANSFORM_INVERT_MONO) != 0) -#ifdef PNG_WRITE_INVERT_SUPPORTED - png_set_invert_mono(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_INVERT_MONO not supported"); -#endif - - /* Shift the pixels up to a legal bit depth and fill in - * as appropriate to correctly scale the image. - */ - if ((transforms & PNG_TRANSFORM_SHIFT) != 0) -#ifdef PNG_WRITE_SHIFT_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sBIT) != 0) - png_set_shift(png_ptr, &info_ptr->sig_bit); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_SHIFT not supported"); -#endif - - /* Pack pixels into bytes */ - if ((transforms & PNG_TRANSFORM_PACKING) != 0) -#ifdef PNG_WRITE_PACK_SUPPORTED - png_set_packing(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_PACKING not supported"); -#endif - - /* Swap location of alpha bytes from ARGB to RGBA */ - if ((transforms & PNG_TRANSFORM_SWAP_ALPHA) != 0) -#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED - png_set_swap_alpha(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_SWAP_ALPHA not supported"); -#endif - - /* Remove a filler (X) from XRGB/RGBX/AG/GA into to convert it into - * RGB, note that the code expects the input color type to be G or RGB; no - * alpha channel. - */ - if ((transforms & (PNG_TRANSFORM_STRIP_FILLER_AFTER| - PNG_TRANSFORM_STRIP_FILLER_BEFORE)) != 0) - { -#ifdef PNG_WRITE_FILLER_SUPPORTED - if ((transforms & PNG_TRANSFORM_STRIP_FILLER_AFTER) != 0) - { - if ((transforms & PNG_TRANSFORM_STRIP_FILLER_BEFORE) != 0) - png_app_error(png_ptr, - "PNG_TRANSFORM_STRIP_FILLER: BEFORE+AFTER not supported"); - - /* Continue if ignored - this is the pre-1.6.10 behavior */ - png_set_filler(png_ptr, 0, PNG_FILLER_AFTER); - } - - else if ((transforms & PNG_TRANSFORM_STRIP_FILLER_BEFORE) != 0) - png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_STRIP_FILLER not supported"); -#endif - } - - /* Flip BGR pixels to RGB */ - if ((transforms & PNG_TRANSFORM_BGR) != 0) -#ifdef PNG_WRITE_BGR_SUPPORTED - png_set_bgr(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_BGR not supported"); -#endif - - /* Swap bytes of 16-bit files to most significant byte first */ - if ((transforms & PNG_TRANSFORM_SWAP_ENDIAN) != 0) -#ifdef PNG_WRITE_SWAP_SUPPORTED - png_set_swap(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_SWAP_ENDIAN not supported"); -#endif - - /* Swap bits of 1-bit, 2-bit, 4-bit packed pixel formats */ - if ((transforms & PNG_TRANSFORM_PACKSWAP) != 0) -#ifdef PNG_WRITE_PACKSWAP_SUPPORTED - png_set_packswap(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_PACKSWAP not supported"); -#endif - - /* Invert the alpha channel from opacity to transparency */ - if ((transforms & PNG_TRANSFORM_INVERT_ALPHA) != 0) -#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED - png_set_invert_alpha(png_ptr); -#else - png_app_error(png_ptr, "PNG_TRANSFORM_INVERT_ALPHA not supported"); -#endif - - /* ----------------------- end of transformations ------------------- */ - - /* Write the bits */ - png_write_image(png_ptr, info_ptr->row_pointers); - - /* It is REQUIRED to call this to finish writing the rest of the file */ - png_write_end(png_ptr, info_ptr); - - PNG_UNUSED(params) -} -#endif - - -#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED -/* Initialize the write structure - general purpose utility. */ -static int -png_image_write_init(png_imagep image) -{ - png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, image, - png_safe_error, png_safe_warning); - - if (png_ptr != NULL) - { - png_infop info_ptr = png_create_info_struct(png_ptr); - - if (info_ptr != NULL) - { - png_controlp control = png_voidcast(png_controlp, - png_malloc_warn(png_ptr, (sizeof *control))); - - if (control != NULL) - { - memset(control, 0, (sizeof *control)); - - control->png_ptr = png_ptr; - control->info_ptr = info_ptr; - control->for_write = 1; - - image->opaque = control; - return 1; - } - - /* Error clean up */ - png_destroy_info_struct(png_ptr, &info_ptr); - } - - png_destroy_write_struct(&png_ptr, NULL); - } - - return png_image_error(image, "png_image_write_: out of memory"); -} - -/* Arguments to png_image_write_main: */ -typedef struct -{ - /* Arguments: */ - png_imagep image; - png_const_voidp buffer; - png_int_32 row_stride; - png_const_voidp colormap; - int convert_to_8bit; - /* Local variables: */ - png_const_voidp first_row; - ptrdiff_t row_bytes; - png_voidp local_row; - /* Byte count for memory writing */ - png_bytep memory; - png_alloc_size_t memory_bytes; /* not used for STDIO */ - png_alloc_size_t output_bytes; /* running total */ -} png_image_write_control; - -/* Write png_uint_16 input to a 16-bit PNG; the png_ptr has already been set to - * do any necessary byte swapping. The component order is defined by the - * png_image format value. - */ -static int -png_write_image_16bit(png_voidp argument) -{ - png_image_write_control *display = png_voidcast(png_image_write_control*, - argument); - png_imagep image = display->image; - png_structrp png_ptr = image->opaque->png_ptr; - - png_const_uint_16p input_row = png_voidcast(png_const_uint_16p, - display->first_row); - png_uint_16p output_row = png_voidcast(png_uint_16p, display->local_row); - png_uint_16p row_end; - const unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? - 3 : 1; - int aindex = 0; - png_uint_32 y = image->height; - - if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0) - { -# ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED - if ((image->format & PNG_FORMAT_FLAG_AFIRST) != 0) - { - aindex = -1; - ++input_row; /* To point to the first component */ - ++output_row; - } - else - aindex = (int)channels; -# else - aindex = (int)channels; -# endif - } - - else - png_error(png_ptr, "png_write_image: internal call error"); - - /* Work out the output row end and count over this, note that the increment - * above to 'row' means that row_end can actually be beyond the end of the - * row; this is correct. - */ - row_end = output_row + image->width * (channels+1); - - for (; y > 0; --y) - { - png_const_uint_16p in_ptr = input_row; - png_uint_16p out_ptr = output_row; - - while (out_ptr < row_end) - { - const png_uint_16 alpha = in_ptr[aindex]; - png_uint_32 reciprocal = 0; - int c; - - out_ptr[aindex] = alpha; - - /* Calculate a reciprocal. The correct calculation is simply - * component/alpha*65535 << 15. (I.e. 15 bits of precision); this - * allows correct rounding by adding .5 before the shift. 'reciprocal' - * is only initialized when required. - */ - if (alpha > 0 && alpha < 65535) - reciprocal = ((0xffff<<15)+(alpha>>1))/alpha; - - c = (int)channels; - do /* always at least one channel */ - { - png_uint_16 component = *in_ptr++; - - /* The following gives 65535 for an alpha of 0, which is fine, - * otherwise if 0/0 is represented as some other value there is more - * likely to be a discontinuity which will probably damage - * compression when moving from a fully transparent area to a - * nearly transparent one. (The assumption here is that opaque - * areas tend not to be 0 intensity.) - */ - if (component >= alpha) - component = 65535; - - /* component 0 && alpha < 65535) - { - png_uint_32 calc = component * reciprocal; - calc += 16384; /* round to nearest */ - component = (png_uint_16)(calc >> 15); - } - - *out_ptr++ = component; - } - while (--c > 0); - - /* Skip to next component (skip the intervening alpha channel) */ - ++in_ptr; - ++out_ptr; - } - - png_write_row(png_ptr, png_voidcast(png_const_bytep, display->local_row)); - input_row += (png_uint_16)display->row_bytes/(sizeof (png_uint_16)); - } - - return 1; -} - -/* Given 16-bit input (1 to 4 channels) write 8-bit output. If an alpha channel - * is present it must be removed from the components, the components are then - * written in sRGB encoding. No components are added or removed. - * - * Calculate an alpha reciprocal to reverse pre-multiplication. As above the - * calculation can be done to 15 bits of accuracy; however, the output needs to - * be scaled in the range 0..255*65535, so include that scaling here. - */ -# define UNP_RECIPROCAL(alpha) ((((0xffff*0xff)<<7)+(alpha>>1))/alpha) - -static png_byte -png_unpremultiply(png_uint_32 component, png_uint_32 alpha, - png_uint_32 reciprocal/*from the above macro*/) -{ - /* The following gives 1.0 for an alpha of 0, which is fine, otherwise if 0/0 - * is represented as some other value there is more likely to be a - * discontinuity which will probably damage compression when moving from a - * fully transparent area to a nearly transparent one. (The assumption here - * is that opaque areas tend not to be 0 intensity.) - * - * There is a rounding problem here; if alpha is less than 128 it will end up - * as 0 when scaled to 8 bits. To avoid introducing spurious colors into the - * output change for this too. - */ - if (component >= alpha || alpha < 128) - return 255; - - /* component 0) - { - /* The test is that alpha/257 (rounded) is less than 255, the first value - * that becomes 255 is 65407. - * NOTE: this must agree with the PNG_DIV257 macro (which must, therefore, - * be exact!) [Could also test reciprocal != 0] - */ - if (alpha < 65407) - { - component *= reciprocal; - component += 64; /* round to nearest */ - component >>= 7; - } - - else - component *= 255; - - /* Convert the component to sRGB. */ - return (png_byte)PNG_sRGB_FROM_LINEAR(component); - } - - else - return 0; -} - -static int -png_write_image_8bit(png_voidp argument) -{ - png_image_write_control *display = png_voidcast(png_image_write_control*, - argument); - png_imagep image = display->image; - png_structrp png_ptr = image->opaque->png_ptr; - - png_const_uint_16p input_row = png_voidcast(png_const_uint_16p, - display->first_row); - png_bytep output_row = png_voidcast(png_bytep, display->local_row); - png_uint_32 y = image->height; - const unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? - 3 : 1; - - if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0) - { - png_bytep row_end; - int aindex; - -# ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED - if ((image->format & PNG_FORMAT_FLAG_AFIRST) != 0) - { - aindex = -1; - ++input_row; /* To point to the first component */ - ++output_row; - } - - else -# endif - aindex = (int)channels; - - /* Use row_end in place of a loop counter: */ - row_end = output_row + image->width * (channels+1); - - for (; y > 0; --y) - { - png_const_uint_16p in_ptr = input_row; - png_bytep out_ptr = output_row; - - while (out_ptr < row_end) - { - png_uint_16 alpha = in_ptr[aindex]; - png_byte alphabyte = (png_byte)PNG_DIV257(alpha); - png_uint_32 reciprocal = 0; - int c; - - /* Scale and write the alpha channel. */ - out_ptr[aindex] = alphabyte; - - if (alphabyte > 0 && alphabyte < 255) - reciprocal = UNP_RECIPROCAL(alpha); - - c = (int)channels; - do /* always at least one channel */ - *out_ptr++ = png_unpremultiply(*in_ptr++, alpha, reciprocal); - while (--c > 0); - - /* Skip to next component (skip the intervening alpha channel) */ - ++in_ptr; - ++out_ptr; - } /* while out_ptr < row_end */ - - png_write_row(png_ptr, png_voidcast(png_const_bytep, - display->local_row)); - input_row += (png_uint_16)display->row_bytes/(sizeof (png_uint_16)); - } /* while y */ - } - - else - { - /* No alpha channel, so the row_end really is the end of the row and it - * is sufficient to loop over the components one by one. - */ - png_bytep row_end = output_row + image->width * channels; - - for (; y > 0; --y) - { - png_const_uint_16p in_ptr = input_row; - png_bytep out_ptr = output_row; - - while (out_ptr < row_end) - { - png_uint_32 component = *in_ptr++; - - component *= 255; - *out_ptr++ = (png_byte)PNG_sRGB_FROM_LINEAR(component); - } - - png_write_row(png_ptr, output_row); - input_row += (png_uint_16)display->row_bytes/(sizeof (png_uint_16)); - } - } - - return 1; -} - -static void -png_image_set_PLTE(png_image_write_control *display) -{ - const png_imagep image = display->image; - const void *cmap = display->colormap; - const int entries = image->colormap_entries > 256 ? 256 : - (int)image->colormap_entries; - - /* NOTE: the caller must check for cmap != NULL and entries != 0 */ - const png_uint_32 format = image->format; - const unsigned int channels = PNG_IMAGE_SAMPLE_CHANNELS(format); - -# if defined(PNG_FORMAT_BGR_SUPPORTED) &&\ - defined(PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED) - const int afirst = (format & PNG_FORMAT_FLAG_AFIRST) != 0 && - (format & PNG_FORMAT_FLAG_ALPHA) != 0; -# else -# define afirst 0 -# endif - -# ifdef PNG_FORMAT_BGR_SUPPORTED - const int bgr = (format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0; -# else -# define bgr 0 -# endif - - int i, num_trans; - png_color palette[256]; - png_byte tRNS[256]; - - memset(tRNS, 255, (sizeof tRNS)); - memset(palette, 0, (sizeof palette)); - - for (i=num_trans=0; i= 3) /* RGB */ - { - palette[i].blue = (png_byte)PNG_sRGB_FROM_LINEAR(255 * - entry[(2 ^ bgr)]); - palette[i].green = (png_byte)PNG_sRGB_FROM_LINEAR(255 * - entry[1]); - palette[i].red = (png_byte)PNG_sRGB_FROM_LINEAR(255 * - entry[bgr]); - } - - else /* Gray */ - palette[i].blue = palette[i].red = palette[i].green = - (png_byte)PNG_sRGB_FROM_LINEAR(255 * *entry); - } - - else /* alpha */ - { - png_uint_16 alpha = entry[afirst ? 0 : channels-1]; - png_byte alphabyte = (png_byte)PNG_DIV257(alpha); - png_uint_32 reciprocal = 0; - - /* Calculate a reciprocal, as in the png_write_image_8bit code above - * this is designed to produce a value scaled to 255*65535 when - * divided by 128 (i.e. asr 7). - */ - if (alphabyte > 0 && alphabyte < 255) - reciprocal = (((0xffff*0xff)<<7)+(alpha>>1))/alpha; - - tRNS[i] = alphabyte; - if (alphabyte < 255) - num_trans = i+1; - - if (channels >= 3) /* RGB */ - { - palette[i].blue = png_unpremultiply(entry[afirst + (2 ^ bgr)], - alpha, reciprocal); - palette[i].green = png_unpremultiply(entry[afirst + 1], alpha, - reciprocal); - palette[i].red = png_unpremultiply(entry[afirst + bgr], alpha, - reciprocal); - } - - else /* gray */ - palette[i].blue = palette[i].red = palette[i].green = - png_unpremultiply(entry[afirst], alpha, reciprocal); - } - } - - else /* Color-map has sRGB values */ - { - png_const_bytep entry = png_voidcast(png_const_bytep, cmap); - - entry += (unsigned int)i * channels; - - switch (channels) - { - case 4: - tRNS[i] = entry[afirst ? 0 : 3]; - if (tRNS[i] < 255) - num_trans = i+1; - /* FALL THROUGH */ - case 3: - palette[i].blue = entry[afirst + (2 ^ bgr)]; - palette[i].green = entry[afirst + 1]; - palette[i].red = entry[afirst + bgr]; - break; - - case 2: - tRNS[i] = entry[1 ^ afirst]; - if (tRNS[i] < 255) - num_trans = i+1; - /* FALL THROUGH */ - case 1: - palette[i].blue = palette[i].red = palette[i].green = - entry[afirst]; - break; - - default: - break; - } - } - } - -# ifdef afirst -# undef afirst -# endif -# ifdef bgr -# undef bgr -# endif - - png_set_PLTE(image->opaque->png_ptr, image->opaque->info_ptr, palette, - entries); - - if (num_trans > 0) - png_set_tRNS(image->opaque->png_ptr, image->opaque->info_ptr, tRNS, - num_trans, NULL); - - image->colormap_entries = (png_uint_32)entries; -} - -static int -png_image_write_main(png_voidp argument) -{ - png_image_write_control *display = png_voidcast(png_image_write_control*, - argument); - png_imagep image = display->image; - png_structrp png_ptr = image->opaque->png_ptr; - png_inforp info_ptr = image->opaque->info_ptr; - png_uint_32 format = image->format; - - /* The following four ints are actually booleans */ - int colormap = (format & PNG_FORMAT_FLAG_COLORMAP); - int linear = !colormap && (format & PNG_FORMAT_FLAG_LINEAR); /* input */ - int alpha = !colormap && (format & PNG_FORMAT_FLAG_ALPHA); - int write_16bit = linear && !colormap && (display->convert_to_8bit == 0); - -# ifdef PNG_BENIGN_ERRORS_SUPPORTED - /* Make sure we error out on any bad situation */ - png_set_benign_errors(png_ptr, 0/*error*/); -# endif - - /* Default the 'row_stride' parameter if required, also check the row stride - * and total image size to ensure that they are within the system limits. - */ - { - const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format); - - if (image->width <= 0x7fffffffU/channels) /* no overflow */ - { - png_uint_32 check; - const png_uint_32 png_row_stride = image->width * channels; - - if (display->row_stride == 0) - display->row_stride = (png_int_32)/*SAFE*/png_row_stride; - - if (display->row_stride < 0) - check = (png_uint_32)(-display->row_stride); - - else - check = (png_uint_32)display->row_stride; - - if (check >= png_row_stride) - { - /* Now check for overflow of the image buffer calculation; this - * limits the whole image size to 32 bits for API compatibility with - * the current, 32-bit, PNG_IMAGE_BUFFER_SIZE macro. - */ - if (image->height > 0xffffffffU/png_row_stride) - png_error(image->opaque->png_ptr, "memory image too large"); - } - - else - png_error(image->opaque->png_ptr, "supplied row stride too small"); - } - - else - png_error(image->opaque->png_ptr, "image row stride too large"); - } - - /* Set the required transforms then write the rows in the correct order. */ - if ((format & PNG_FORMAT_FLAG_COLORMAP) != 0) - { - if (display->colormap != NULL && image->colormap_entries > 0) - { - png_uint_32 entries = image->colormap_entries; - - png_set_IHDR(png_ptr, info_ptr, image->width, image->height, - entries > 16 ? 8 : (entries > 4 ? 4 : (entries > 2 ? 2 : 1)), - PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - - png_image_set_PLTE(display); - } - - else - png_error(image->opaque->png_ptr, - "no color-map for color-mapped image"); - } - - else - png_set_IHDR(png_ptr, info_ptr, image->width, image->height, - write_16bit ? 16 : 8, - ((format & PNG_FORMAT_FLAG_COLOR) ? PNG_COLOR_MASK_COLOR : 0) + - ((format & PNG_FORMAT_FLAG_ALPHA) ? PNG_COLOR_MASK_ALPHA : 0), - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - - /* Counter-intuitively the data transformations must be called *after* - * png_write_info, not before as in the read code, but the 'set' functions - * must still be called before. Just set the color space information, never - * write an interlaced image. - */ - - if (write_16bit != 0) - { - /* The gamma here is 1.0 (linear) and the cHRM chunk matches sRGB. */ - png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_LINEAR); - - if ((image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB) == 0) - png_set_cHRM_fixed(png_ptr, info_ptr, - /* color x y */ - /* white */ 31270, 32900, - /* red */ 64000, 33000, - /* green */ 30000, 60000, - /* blue */ 15000, 6000 - ); - } - - else if ((image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB) == 0) - png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_PERCEPTUAL); - - /* Else writing an 8-bit file and the *colors* aren't sRGB, but the 8-bit - * space must still be gamma encoded. - */ - else - png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_sRGB_INVERSE); - - /* Write the file header. */ - png_write_info(png_ptr, info_ptr); - - /* Now set up the data transformations (*after* the header is written), - * remove the handled transformations from the 'format' flags for checking. - * - * First check for a little endian system if writing 16-bit files. - */ - if (write_16bit != 0) - { - PNG_CONST png_uint_16 le = 0x0001; - - if ((*(png_const_bytep) & le) != 0) - png_set_swap(png_ptr); - } - -# ifdef PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED - if ((format & PNG_FORMAT_FLAG_BGR) != 0) - { - if (colormap == 0 && (format & PNG_FORMAT_FLAG_COLOR) != 0) - png_set_bgr(png_ptr); - format &= ~PNG_FORMAT_FLAG_BGR; - } -# endif - -# ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED - if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) - { - if (colormap == 0 && (format & PNG_FORMAT_FLAG_ALPHA) != 0) - png_set_swap_alpha(png_ptr); - format &= ~PNG_FORMAT_FLAG_AFIRST; - } -# endif - - /* If there are 16 or fewer color-map entries we wrote a lower bit depth - * above, but the application data is still byte packed. - */ - if (colormap != 0 && image->colormap_entries <= 16) - png_set_packing(png_ptr); - - /* That should have handled all (both) the transforms. */ - if ((format & ~(png_uint_32)(PNG_FORMAT_FLAG_COLOR | PNG_FORMAT_FLAG_LINEAR | - PNG_FORMAT_FLAG_ALPHA | PNG_FORMAT_FLAG_COLORMAP)) != 0) - png_error(png_ptr, "png_write_image: unsupported transformation"); - - { - png_const_bytep row = png_voidcast(png_const_bytep, display->buffer); - ptrdiff_t row_bytes = display->row_stride; - - if (linear != 0) - row_bytes *= (sizeof (png_uint_16)); - - if (row_bytes < 0) - row += (image->height-1) * (-row_bytes); - - display->first_row = row; - display->row_bytes = row_bytes; - } - - /* Apply 'fast' options if the flag is set. */ - if ((image->flags & PNG_IMAGE_FLAG_FAST) != 0) - { - png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, PNG_NO_FILTERS); - /* NOTE: determined by experiment using pngstest, this reflects some - * balance between the time to write the image once and the time to read - * it about 50 times. The speed-up in pngstest was about 10-20% of the - * total (user) time on a heavily loaded system. - */ -# ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED - png_set_compression_level(png_ptr, 3); -# endif - } - - /* Check for the cases that currently require a pre-transform on the row - * before it is written. This only applies when the input is 16-bit and - * either there is an alpha channel or it is converted to 8-bit. - */ - if ((linear != 0 && alpha != 0 ) || - (colormap == 0 && display->convert_to_8bit != 0)) - { - png_bytep row = png_voidcast(png_bytep, png_malloc(png_ptr, - png_get_rowbytes(png_ptr, info_ptr))); - int result; - - display->local_row = row; - if (write_16bit != 0) - result = png_safe_execute(image, png_write_image_16bit, display); - else - result = png_safe_execute(image, png_write_image_8bit, display); - display->local_row = NULL; - - png_free(png_ptr, row); - - /* Skip the 'write_end' on error: */ - if (result == 0) - return 0; - } - - /* Otherwise this is the case where the input is in a format currently - * supported by the rest of the libpng write code; call it directly. - */ - else - { - png_const_bytep row = png_voidcast(png_const_bytep, display->first_row); - ptrdiff_t row_bytes = display->row_bytes; - png_uint_32 y = image->height; - - for (; y > 0; --y) - { - png_write_row(png_ptr, row); - row += row_bytes; - } - } - - png_write_end(png_ptr, info_ptr); - return 1; -} - - -static void (PNGCBAPI -image_memory_write)(png_structp png_ptr, png_bytep/*const*/ data, - png_size_t size) -{ - png_image_write_control *display = png_voidcast(png_image_write_control*, - png_ptr->io_ptr/*backdoor: png_get_io_ptr(png_ptr)*/); - const png_alloc_size_t ob = display->output_bytes; - - /* Check for overflow; this should never happen: */ - if (size <= ((png_alloc_size_t)-1) - ob) - { - /* I don't think libpng ever does this, but just in case: */ - if (size > 0) - { - if (display->memory_bytes >= ob+size) /* writing */ - memcpy(display->memory+ob, data, size); - - /* Always update the size: */ - display->output_bytes = ob+size; - } - } - - else - png_error(png_ptr, "png_image_write_to_memory: PNG too big"); -} - -static void (PNGCBAPI -image_memory_flush)(png_structp png_ptr) -{ - PNG_UNUSED(png_ptr) -} - -static int -png_image_write_memory(png_voidp argument) -{ - png_image_write_control *display = png_voidcast(png_image_write_control*, - argument); - - /* The rest of the memory-specific init and write_main in an error protected - * environment. This case needs to use callbacks for the write operations - * since libpng has no built in support for writing to memory. - */ - png_set_write_fn(display->image->opaque->png_ptr, display/*io_ptr*/, - image_memory_write, image_memory_flush); - - return png_image_write_main(display); -} - -int PNGAPI -png_image_write_to_memory(png_imagep image, void *memory, - png_alloc_size_t * PNG_RESTRICT memory_bytes, int convert_to_8bit, - const void *buffer, png_int_32 row_stride, const void *colormap) -{ - /* Write the image to the given buffer, or count the bytes if it is NULL */ - if (image != NULL && image->version == PNG_IMAGE_VERSION) - { - if (memory_bytes != NULL && buffer != NULL) - { - /* This is to give the caller an easier error detection in the NULL - * case and guard against uninitialized variable problems: - */ - if (memory == NULL) - *memory_bytes = 0; - - if (png_image_write_init(image) != 0) - { - png_image_write_control display; - int result; - - memset(&display, 0, (sizeof display)); - display.image = image; - display.buffer = buffer; - display.row_stride = row_stride; - display.colormap = colormap; - display.convert_to_8bit = convert_to_8bit; - display.memory = png_voidcast(png_bytep, memory); - display.memory_bytes = *memory_bytes; - display.output_bytes = 0; - - result = png_safe_execute(image, png_image_write_memory, &display); - png_image_free(image); - - /* write_memory returns true even if we ran out of buffer. */ - if (result) - { - /* On out-of-buffer this function returns '0' but still updates - * memory_bytes: - */ - if (memory != NULL && display.output_bytes > *memory_bytes) - result = 0; - - *memory_bytes = display.output_bytes; - } - - return result; - } - - else - return 0; - } - - else - return png_image_error(image, - "png_image_write_to_memory: invalid argument"); - } - - else if (image != NULL) - return png_image_error(image, - "png_image_write_to_memory: incorrect PNG_IMAGE_VERSION"); - - else - return 0; -} - -#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED -int PNGAPI -png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit, - const void *buffer, png_int_32 row_stride, const void *colormap) -{ - /* Write the image to the given (FILE*). */ - if (image != NULL && image->version == PNG_IMAGE_VERSION) - { - if (file != NULL && buffer != NULL) - { - if (png_image_write_init(image) != 0) - { - png_image_write_control display; - int result; - - /* This is slightly evil, but png_init_io doesn't do anything other - * than this and we haven't changed the standard IO functions so - * this saves a 'safe' function. - */ - image->opaque->png_ptr->io_ptr = file; - - memset(&display, 0, (sizeof display)); - display.image = image; - display.buffer = buffer; - display.row_stride = row_stride; - display.colormap = colormap; - display.convert_to_8bit = convert_to_8bit; - - result = png_safe_execute(image, png_image_write_main, &display); - png_image_free(image); - return result; - } - - else - return 0; - } - - else - return png_image_error(image, - "png_image_write_to_stdio: invalid argument"); - } - - else if (image != NULL) - return png_image_error(image, - "png_image_write_to_stdio: incorrect PNG_IMAGE_VERSION"); - - else - return 0; -} - -int PNGAPI -png_image_write_to_file(png_imagep image, const char *file_name, - int convert_to_8bit, const void *buffer, png_int_32 row_stride, - const void *colormap) -{ - /* Write the image to the named file. */ - if (image != NULL && image->version == PNG_IMAGE_VERSION) - { - if (file_name != NULL && buffer != NULL) - { - FILE *fp = fopen(file_name, "wb"); - - if (fp != NULL) - { - if (png_image_write_to_stdio(image, fp, convert_to_8bit, buffer, - row_stride, colormap) != 0) - { - int error; /* from fflush/fclose */ - - /* Make sure the file is flushed correctly. */ - if (fflush(fp) == 0 && ferror(fp) == 0) - { - if (fclose(fp) == 0) - return 1; - - error = errno; /* from fclose */ - } - - else - { - error = errno; /* from fflush or ferror */ - (void)fclose(fp); - } - - (void)remove(file_name); - /* The image has already been cleaned up; this is just used to - * set the error (because the original write succeeded). - */ - return png_image_error(image, strerror(error)); - } - - else - { - /* Clean up: just the opened file. */ - (void)fclose(fp); - (void)remove(file_name); - return 0; - } - } - - else - return png_image_error(image, strerror(errno)); - } - - else - return png_image_error(image, - "png_image_write_to_file: invalid argument"); - } - - else if (image != NULL) - return png_image_error(image, - "png_image_write_to_file: incorrect PNG_IMAGE_VERSION"); - - else - return 0; -} -#endif /* SIMPLIFIED_WRITE_STDIO */ -#endif /* SIMPLIFIED_WRITE */ -#endif /* WRITE */ diff --git a/jan/src/dep/libs/libpng/pngwtran.c b/jan/src/dep/libs/libpng/pngwtran.c deleted file mode 100644 index 922abb5c7..000000000 --- a/jan/src/dep/libs/libpng/pngwtran.c +++ /dev/null @@ -1,576 +0,0 @@ - -/* pngwtran.c - transforms the data in a row for PNG writers - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -#include "pngpriv.h" - -#ifdef PNG_WRITE_SUPPORTED -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED - -#ifdef PNG_WRITE_PACK_SUPPORTED -/* Pack pixels into bytes. Pass the true bit depth in bit_depth. The - * row_info bit depth should be 8 (one pixel per byte). The channels - * should be 1 (this only happens on grayscale and paletted images). - */ -static void -png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) -{ - png_debug(1, "in png_do_pack"); - - if (row_info->bit_depth == 8 && - row_info->channels == 1) - { - switch ((int)bit_depth) - { - case 1: - { - png_bytep sp, dp; - int mask, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - sp = row; - dp = row; - mask = 0x80; - v = 0; - - for (i = 0; i < row_width; i++) - { - if (*sp != 0) - v |= mask; - - sp++; - - if (mask > 1) - mask >>= 1; - - else - { - mask = 0x80; - *dp = (png_byte)v; - dp++; - v = 0; - } - } - - if (mask != 0x80) - *dp = (png_byte)v; - - break; - } - - case 2: - { - png_bytep sp, dp; - unsigned int shift; - int v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - sp = row; - dp = row; - shift = 6; - v = 0; - - for (i = 0; i < row_width; i++) - { - png_byte value; - - value = (png_byte)(*sp & 0x03); - v |= (value << shift); - - if (shift == 0) - { - shift = 6; - *dp = (png_byte)v; - dp++; - v = 0; - } - - else - shift -= 2; - - sp++; - } - - if (shift != 6) - *dp = (png_byte)v; - - break; - } - - case 4: - { - png_bytep sp, dp; - unsigned int shift; - int v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - sp = row; - dp = row; - shift = 4; - v = 0; - - for (i = 0; i < row_width; i++) - { - png_byte value; - - value = (png_byte)(*sp & 0x0f); - v |= (value << shift); - - if (shift == 0) - { - shift = 4; - *dp = (png_byte)v; - dp++; - v = 0; - } - - else - shift -= 4; - - sp++; - } - - if (shift != 4) - *dp = (png_byte)v; - - break; - } - - default: - break; - } - - row_info->bit_depth = (png_byte)bit_depth; - row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_info->width); - } -} -#endif - -#ifdef PNG_WRITE_SHIFT_SUPPORTED -/* Shift pixel values to take advantage of whole range. Pass the - * true number of bits in bit_depth. The row should be packed - * according to row_info->bit_depth. Thus, if you had a row of - * bit depth 4, but the pixels only had values from 0 to 7, you - * would pass 3 as bit_depth, and this routine would translate the - * data to 0 to 15. - */ -static void -png_do_shift(png_row_infop row_info, png_bytep row, - png_const_color_8p bit_depth) -{ - png_debug(1, "in png_do_shift"); - - if (row_info->color_type != PNG_COLOR_TYPE_PALETTE) - { - int shift_start[4], shift_dec[4]; - unsigned int channels = 0; - - if ((row_info->color_type & PNG_COLOR_MASK_COLOR) != 0) - { - shift_start[channels] = row_info->bit_depth - bit_depth->red; - shift_dec[channels] = bit_depth->red; - channels++; - - shift_start[channels] = row_info->bit_depth - bit_depth->green; - shift_dec[channels] = bit_depth->green; - channels++; - - shift_start[channels] = row_info->bit_depth - bit_depth->blue; - shift_dec[channels] = bit_depth->blue; - channels++; - } - - else - { - shift_start[channels] = row_info->bit_depth - bit_depth->gray; - shift_dec[channels] = bit_depth->gray; - channels++; - } - - if ((row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0) - { - shift_start[channels] = row_info->bit_depth - bit_depth->alpha; - shift_dec[channels] = bit_depth->alpha; - channels++; - } - - /* With low row depths, could only be grayscale, so one channel */ - if (row_info->bit_depth < 8) - { - png_bytep bp = row; - png_size_t i; - unsigned int mask; - png_size_t row_bytes = row_info->rowbytes; - - if (bit_depth->gray == 1 && row_info->bit_depth == 2) - mask = 0x55; - - else if (row_info->bit_depth == 4 && bit_depth->gray == 3) - mask = 0x11; - - else - mask = 0xff; - - for (i = 0; i < row_bytes; i++, bp++) - { - int j; - unsigned int v, out; - - v = *bp; - out = 0; - - for (j = shift_start[0]; j > -shift_dec[0]; j -= shift_dec[0]) - { - if (j > 0) - out |= v << j; - - else - out |= (v >> (-j)) & mask; - } - - *bp = (png_byte)(out & 0xff); - } - } - - else if (row_info->bit_depth == 8) - { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = channels * row_info->width; - - for (i = 0; i < istop; i++, bp++) - { - - const unsigned int c = i%channels; - int j; - unsigned int v, out; - - v = *bp; - out = 0; - - for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c]) - { - if (j > 0) - out |= v << j; - - else - out |= v >> (-j); - } - - *bp = (png_byte)(out & 0xff); - } - } - - else - { - png_bytep bp; - png_uint_32 i; - png_uint_32 istop = channels * row_info->width; - - for (bp = row, i = 0; i < istop; i++) - { - const unsigned int c = i%channels; - int j; - unsigned int value, v; - - v = png_get_uint_16(bp); - value = 0; - - for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c]) - { - if (j > 0) - value |= v << j; - - else - value |= v >> (-j); - } - *bp++ = (png_byte)((value >> 8) & 0xff); - *bp++ = (png_byte)(value & 0xff); - } - } - } -} -#endif - -#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED -static void -png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_write_swap_alpha"); - - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - if (row_info->bit_depth == 8) - { - /* This converts from ARGB to RGBA */ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save; - } - } - -#ifdef PNG_WRITE_16BIT_SUPPORTED - else - { - /* This converts from AARRGGBB to RRGGBBAA */ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save[2]; - save[0] = *(sp++); - save[1] = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save[0]; - *(dp++) = save[1]; - } - } -#endif /* WRITE_16BIT */ - } - - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - if (row_info->bit_depth == 8) - { - /* This converts from AG to GA */ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save; - } - } - -#ifdef PNG_WRITE_16BIT_SUPPORTED - else - { - /* This converts from AAGG to GGAA */ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save[2]; - save[0] = *(sp++); - save[1] = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save[0]; - *(dp++) = save[1]; - } - } -#endif /* WRITE_16BIT */ - } - } -} -#endif - -#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED -static void -png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_write_invert_alpha"); - - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - if (row_info->bit_depth == 8) - { - /* This inverts the alpha channel in RGBA */ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - /* Does nothing - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - */ - sp+=3; dp = sp; - *dp = (png_byte)(255 - *(sp++)); - } - } - -#ifdef PNG_WRITE_16BIT_SUPPORTED - else - { - /* This inverts the alpha channel in RRGGBBAA */ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - /* Does nothing - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - */ - sp+=6; dp = sp; - *(dp++) = (png_byte)(255 - *(sp++)); - *dp = (png_byte)(255 - *(sp++)); - } - } -#endif /* WRITE_16BIT */ - } - - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - if (row_info->bit_depth == 8) - { - /* This inverts the alpha channel in GA */ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - *(dp++) = *(sp++); - *(dp++) = (png_byte)(255 - *(sp++)); - } - } - -#ifdef PNG_WRITE_16BIT_SUPPORTED - else - { - /* This inverts the alpha channel in GGAA */ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - /* Does nothing - *(dp++) = *(sp++); - *(dp++) = *(sp++); - */ - sp+=2; dp = sp; - *(dp++) = (png_byte)(255 - *(sp++)); - *dp = (png_byte)(255 - *(sp++)); - } - } -#endif /* WRITE_16BIT */ - } - } -} -#endif - -/* Transform the data according to the user's wishes. The order of - * transformations is significant. - */ -void /* PRIVATE */ -png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info) -{ - png_debug(1, "in png_do_write_transformations"); - - if (png_ptr == NULL) - return; - -#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED - if ((png_ptr->transformations & PNG_USER_TRANSFORM) != 0) - if (png_ptr->write_user_transform_fn != NULL) - (*(png_ptr->write_user_transform_fn)) /* User write transform - function */ - (png_ptr, /* png_ptr */ - row_info, /* row_info: */ - /* png_uint_32 width; width of row */ - /* png_size_t rowbytes; number of bytes in row */ - /* png_byte color_type; color type of pixels */ - /* png_byte bit_depth; bit depth of samples */ - /* png_byte channels; number of channels (1-4) */ - /* png_byte pixel_depth; bits per pixel (depth*channels) */ - png_ptr->row_buf + 1); /* start of pixel data for row */ -#endif - -#ifdef PNG_WRITE_FILLER_SUPPORTED - if ((png_ptr->transformations & PNG_FILLER) != 0) - png_do_strip_channel(row_info, png_ptr->row_buf + 1, - !(png_ptr->flags & PNG_FLAG_FILLER_AFTER)); -#endif - -#ifdef PNG_WRITE_PACKSWAP_SUPPORTED - if ((png_ptr->transformations & PNG_PACKSWAP) != 0) - png_do_packswap(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_WRITE_PACK_SUPPORTED - if ((png_ptr->transformations & PNG_PACK) != 0) - png_do_pack(row_info, png_ptr->row_buf + 1, - (png_uint_32)png_ptr->bit_depth); -#endif - -#ifdef PNG_WRITE_SWAP_SUPPORTED -# ifdef PNG_16BIT_SUPPORTED - if ((png_ptr->transformations & PNG_SWAP_BYTES) != 0) - png_do_swap(row_info, png_ptr->row_buf + 1); -# endif -#endif - -#ifdef PNG_WRITE_SHIFT_SUPPORTED - if ((png_ptr->transformations & PNG_SHIFT) != 0) - png_do_shift(row_info, png_ptr->row_buf + 1, - &(png_ptr->shift)); -#endif - -#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED - if ((png_ptr->transformations & PNG_SWAP_ALPHA) != 0) - png_do_write_swap_alpha(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED - if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0) - png_do_write_invert_alpha(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_WRITE_BGR_SUPPORTED - if ((png_ptr->transformations & PNG_BGR) != 0) - png_do_bgr(row_info, png_ptr->row_buf + 1); -#endif - -#ifdef PNG_WRITE_INVERT_SUPPORTED - if ((png_ptr->transformations & PNG_INVERT_MONO) != 0) - png_do_invert(row_info, png_ptr->row_buf + 1); -#endif -} -#endif /* WRITE_TRANSFORMS */ -#endif /* WRITE */ diff --git a/jan/src/dep/libs/libpng/pngwutil.c b/jan/src/dep/libs/libpng/pngwutil.c deleted file mode 100644 index a8915c737..000000000 --- a/jan/src/dep/libs/libpng/pngwutil.c +++ /dev/null @@ -1,2755 +0,0 @@ - -/* pngwutil.c - utilities to write a PNG file - * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This code is released under the libpng license. - * For conditions of distribution and use, see the disclaimer - * and license in png.h - */ - -#include "pngpriv.h" - -#ifdef PNG_WRITE_SUPPORTED - -#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED -/* Place a 32-bit number into a buffer in PNG byte order. We work - * with unsigned numbers for convenience, although one supported - * ancillary chunk uses signed (two's complement) numbers. - */ -void PNGAPI -png_save_uint_32(png_bytep buf, png_uint_32 i) -{ - buf[0] = (png_byte)((i >> 24) & 0xffU); - buf[1] = (png_byte)((i >> 16) & 0xffU); - buf[2] = (png_byte)((i >> 8) & 0xffU); - buf[3] = (png_byte)( i & 0xffU); -} - -/* Place a 16-bit number into a buffer in PNG byte order. - * The parameter is declared unsigned int, not png_uint_16, - * just to avoid potential problems on pre-ANSI C compilers. - */ -void PNGAPI -png_save_uint_16(png_bytep buf, unsigned int i) -{ - buf[0] = (png_byte)((i >> 8) & 0xffU); - buf[1] = (png_byte)( i & 0xffU); -} -#endif - -/* Simple function to write the signature. If we have already written - * the magic bytes of the signature, or more likely, the PNG stream is - * being embedded into another stream and doesn't need its own signature, - * we should call png_set_sig_bytes() to tell libpng how many of the - * bytes have already been written. - */ -void PNGAPI -png_write_sig(png_structrp png_ptr) -{ - png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; - -#ifdef PNG_IO_STATE_SUPPORTED - /* Inform the I/O callback that the signature is being written */ - png_ptr->io_state = PNG_IO_WRITING | PNG_IO_SIGNATURE; -#endif - - /* Write the rest of the 8 byte signature */ - png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes], - (png_size_t)(8 - png_ptr->sig_bytes)); - - if (png_ptr->sig_bytes < 3) - png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; -} - -/* Write the start of a PNG chunk. The type is the chunk type. - * The total_length is the sum of the lengths of all the data you will be - * passing in png_write_chunk_data(). - */ -static void -png_write_chunk_header(png_structrp png_ptr, png_uint_32 chunk_name, - png_uint_32 length) -{ - png_byte buf[8]; - -#if defined(PNG_DEBUG) && (PNG_DEBUG > 0) - PNG_CSTRING_FROM_CHUNK(buf, chunk_name); - png_debug2(0, "Writing %s chunk, length = %lu", buf, (unsigned long)length); -#endif - - if (png_ptr == NULL) - return; - -#ifdef PNG_IO_STATE_SUPPORTED - /* Inform the I/O callback that the chunk header is being written. - * PNG_IO_CHUNK_HDR requires a single I/O call. - */ - png_ptr->io_state = PNG_IO_WRITING | PNG_IO_CHUNK_HDR; -#endif - - /* Write the length and the chunk name */ - png_save_uint_32(buf, length); - png_save_uint_32(buf + 4, chunk_name); - png_write_data(png_ptr, buf, 8); - - /* Put the chunk name into png_ptr->chunk_name */ - png_ptr->chunk_name = chunk_name; - - /* Reset the crc and run it over the chunk name */ - png_reset_crc(png_ptr); - - png_calculate_crc(png_ptr, buf + 4, 4); - -#ifdef PNG_IO_STATE_SUPPORTED - /* Inform the I/O callback that chunk data will (possibly) be written. - * PNG_IO_CHUNK_DATA does NOT require a specific number of I/O calls. - */ - png_ptr->io_state = PNG_IO_WRITING | PNG_IO_CHUNK_DATA; -#endif -} - -void PNGAPI -png_write_chunk_start(png_structrp png_ptr, png_const_bytep chunk_string, - png_uint_32 length) -{ - png_write_chunk_header(png_ptr, PNG_CHUNK_FROM_STRING(chunk_string), length); -} - -/* Write the data of a PNG chunk started with png_write_chunk_header(). - * Note that multiple calls to this function are allowed, and that the - * sum of the lengths from these calls *must* add up to the total_length - * given to png_write_chunk_header(). - */ -void PNGAPI -png_write_chunk_data(png_structrp png_ptr, png_const_bytep data, - png_size_t length) -{ - /* Write the data, and run the CRC over it */ - if (png_ptr == NULL) - return; - - if (data != NULL && length > 0) - { - png_write_data(png_ptr, data, length); - - /* Update the CRC after writing the data, - * in case the user I/O routine alters it. - */ - png_calculate_crc(png_ptr, data, length); - } -} - -/* Finish a chunk started with png_write_chunk_header(). */ -void PNGAPI -png_write_chunk_end(png_structrp png_ptr) -{ - png_byte buf[4]; - - if (png_ptr == NULL) return; - -#ifdef PNG_IO_STATE_SUPPORTED - /* Inform the I/O callback that the chunk CRC is being written. - * PNG_IO_CHUNK_CRC requires a single I/O function call. - */ - png_ptr->io_state = PNG_IO_WRITING | PNG_IO_CHUNK_CRC; -#endif - - /* Write the crc in a single operation */ - png_save_uint_32(buf, png_ptr->crc); - - png_write_data(png_ptr, buf, (png_size_t)4); -} - -/* Write a PNG chunk all at once. The type is an array of ASCII characters - * representing the chunk name. The array must be at least 4 bytes in - * length, and does not need to be null terminated. To be safe, pass the - * pre-defined chunk names here, and if you need a new one, define it - * where the others are defined. The length is the length of the data. - * All the data must be present. If that is not possible, use the - * png_write_chunk_start(), png_write_chunk_data(), and png_write_chunk_end() - * functions instead. - */ -static void -png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name, - png_const_bytep data, png_size_t length) -{ - if (png_ptr == NULL) - return; - - /* On 64-bit architectures 'length' may not fit in a png_uint_32. */ - if (length > PNG_UINT_31_MAX) - png_error(png_ptr, "length exceeds PNG maximum"); - - png_write_chunk_header(png_ptr, chunk_name, (png_uint_32)length); - png_write_chunk_data(png_ptr, data, length); - png_write_chunk_end(png_ptr); -} - -/* This is the API that calls the internal function above. */ -void PNGAPI -png_write_chunk(png_structrp png_ptr, png_const_bytep chunk_string, - png_const_bytep data, png_size_t length) -{ - png_write_complete_chunk(png_ptr, PNG_CHUNK_FROM_STRING(chunk_string), data, - length); -} - -/* This is used below to find the size of an image to pass to png_deflate_claim, - * so it only needs to be accurate if the size is less than 16384 bytes (the - * point at which a lower LZ window size can be used.) - */ -static png_alloc_size_t -png_image_size(png_structrp png_ptr) -{ - /* Only return sizes up to the maximum of a png_uint_32; do this by limiting - * the width and height used to 15 bits. - */ - png_uint_32 h = png_ptr->height; - - if (png_ptr->rowbytes < 32768 && h < 32768) - { - if (png_ptr->interlaced != 0) - { - /* Interlacing makes the image larger because of the replication of - * both the filter byte and the padding to a byte boundary. - */ - png_uint_32 w = png_ptr->width; - unsigned int pd = png_ptr->pixel_depth; - png_alloc_size_t cb_base; - int pass; - - for (cb_base=0, pass=0; pass<=6; ++pass) - { - png_uint_32 pw = PNG_PASS_COLS(w, pass); - - if (pw > 0) - cb_base += (PNG_ROWBYTES(pd, pw)+1) * PNG_PASS_ROWS(h, pass); - } - - return cb_base; - } - - else - return (png_ptr->rowbytes+1) * h; - } - - else - return 0xffffffffU; -} - -#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED - /* This is the code to hack the first two bytes of the deflate stream (the - * deflate header) to correct the windowBits value to match the actual data - * size. Note that the second argument is the *uncompressed* size but the - * first argument is the *compressed* data (and it must be deflate - * compressed.) - */ -static void -optimize_cmf(png_bytep data, png_alloc_size_t data_size) -{ - /* Optimize the CMF field in the zlib stream. The resultant zlib stream is - * still compliant to the stream specification. - */ - if (data_size <= 16384) /* else windowBits must be 15 */ - { - unsigned int z_cmf = data[0]; /* zlib compression method and flags */ - - if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70) - { - unsigned int z_cinfo; - unsigned int half_z_window_size; - - z_cinfo = z_cmf >> 4; - half_z_window_size = 1U << (z_cinfo + 7); - - if (data_size <= half_z_window_size) /* else no change */ - { - unsigned int tmp; - - do - { - half_z_window_size >>= 1; - --z_cinfo; - } - while (z_cinfo > 0 && data_size <= half_z_window_size); - - z_cmf = (z_cmf & 0x0f) | (z_cinfo << 4); - - data[0] = (png_byte)z_cmf; - tmp = data[1] & 0xe0; - tmp += 0x1f - ((z_cmf << 8) + tmp) % 0x1f; - data[1] = (png_byte)tmp; - } - } - } -} -#endif /* WRITE_OPTIMIZE_CMF */ - -/* Initialize the compressor for the appropriate type of compression. */ -static int -png_deflate_claim(png_structrp png_ptr, png_uint_32 owner, - png_alloc_size_t data_size) -{ - if (png_ptr->zowner != 0) - { -#if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_ERROR_TEXT_SUPPORTED) - char msg[64]; - - PNG_STRING_FROM_CHUNK(msg, owner); - msg[4] = ':'; - msg[5] = ' '; - PNG_STRING_FROM_CHUNK(msg+6, png_ptr->zowner); - /* So the message that results is " using zstream"; this is an - * internal error, but is very useful for debugging. i18n requirements - * are minimal. - */ - (void)png_safecat(msg, (sizeof msg), 10, " using zstream"); -#endif -#if PNG_RELEASE_BUILD - png_warning(png_ptr, msg); - - /* Attempt sane error recovery */ - if (png_ptr->zowner == png_IDAT) /* don't steal from IDAT */ - { - png_ptr->zstream.msg = PNGZ_MSG_CAST("in use by IDAT"); - return Z_STREAM_ERROR; - } - - png_ptr->zowner = 0; -#else - png_error(png_ptr, msg); -#endif - } - - { - int level = png_ptr->zlib_level; - int method = png_ptr->zlib_method; - int windowBits = png_ptr->zlib_window_bits; - int memLevel = png_ptr->zlib_mem_level; - int strategy; /* set below */ - int ret; /* zlib return code */ - - if (owner == png_IDAT) - { - if ((png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY) != 0) - strategy = png_ptr->zlib_strategy; - - else if (png_ptr->do_filter != PNG_FILTER_NONE) - strategy = PNG_Z_DEFAULT_STRATEGY; - - else - strategy = PNG_Z_DEFAULT_NOFILTER_STRATEGY; - } - - else - { -#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED - level = png_ptr->zlib_text_level; - method = png_ptr->zlib_text_method; - windowBits = png_ptr->zlib_text_window_bits; - memLevel = png_ptr->zlib_text_mem_level; - strategy = png_ptr->zlib_text_strategy; -#else - /* If customization is not supported the values all come from the - * IDAT values except for the strategy, which is fixed to the - * default. (This is the pre-1.6.0 behavior too, although it was - * implemented in a very different way.) - */ - strategy = Z_DEFAULT_STRATEGY; -#endif - } - - /* Adjust 'windowBits' down if larger than 'data_size'; to stop this - * happening just pass 32768 as the data_size parameter. Notice that zlib - * requires an extra 262 bytes in the window in addition to the data to be - * able to see the whole of the data, so if data_size+262 takes us to the - * next windowBits size we need to fix up the value later. (Because even - * though deflate needs the extra window, inflate does not!) - */ - if (data_size <= 16384) - { - /* IMPLEMENTATION NOTE: this 'half_window_size' stuff is only here to - * work round a Microsoft Visual C misbehavior which, contrary to C-90, - * widens the result of the following shift to 64-bits if (and, - * apparently, only if) it is used in a test. - */ - unsigned int half_window_size = 1U << (windowBits-1); - - while (data_size + 262 <= half_window_size) - { - half_window_size >>= 1; - --windowBits; - } - } - - /* Check against the previous initialized values, if any. */ - if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0 && - (png_ptr->zlib_set_level != level || - png_ptr->zlib_set_method != method || - png_ptr->zlib_set_window_bits != windowBits || - png_ptr->zlib_set_mem_level != memLevel || - png_ptr->zlib_set_strategy != strategy)) - { - if (deflateEnd(&png_ptr->zstream) != Z_OK) - png_warning(png_ptr, "deflateEnd failed (ignored)"); - - png_ptr->flags &= ~PNG_FLAG_ZSTREAM_INITIALIZED; - } - - /* For safety clear out the input and output pointers (currently zlib - * doesn't use them on Init, but it might in the future). - */ - png_ptr->zstream.next_in = NULL; - png_ptr->zstream.avail_in = 0; - png_ptr->zstream.next_out = NULL; - png_ptr->zstream.avail_out = 0; - - /* Now initialize if required, setting the new parameters, otherwise just - * do a simple reset to the previous parameters. - */ - if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0) - ret = deflateReset(&png_ptr->zstream); - - else - { - ret = deflateInit2(&png_ptr->zstream, level, method, windowBits, - memLevel, strategy); - - if (ret == Z_OK) - png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED; - } - - /* The return code is from either deflateReset or deflateInit2; they have - * pretty much the same set of error codes. - */ - if (ret == Z_OK) - png_ptr->zowner = owner; - - else - png_zstream_error(png_ptr, ret); - - return ret; - } -} - -/* Clean up (or trim) a linked list of compression buffers. */ -void /* PRIVATE */ -png_free_buffer_list(png_structrp png_ptr, png_compression_bufferp *listp) -{ - png_compression_bufferp list = *listp; - - if (list != NULL) - { - *listp = NULL; - - do - { - png_compression_bufferp next = list->next; - - png_free(png_ptr, list); - list = next; - } - while (list != NULL); - } -} - -#ifdef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED -/* This pair of functions encapsulates the operation of (a) compressing a - * text string, and (b) issuing it later as a series of chunk data writes. - * The compression_state structure is shared context for these functions - * set up by the caller to allow access to the relevant local variables. - * - * compression_buffer (new in 1.6.0) is just a linked list of zbuffer_size - * temporary buffers. From 1.6.0 it is retained in png_struct so that it will - * be correctly freed in the event of a write error (previous implementations - * just leaked memory.) - */ -typedef struct -{ - png_const_bytep input; /* The uncompressed input data */ - png_alloc_size_t input_len; /* Its length */ - png_uint_32 output_len; /* Final compressed length */ - png_byte output[1024]; /* First block of output */ -} compression_state; - -static void -png_text_compress_init(compression_state *comp, png_const_bytep input, - png_alloc_size_t input_len) -{ - comp->input = input; - comp->input_len = input_len; - comp->output_len = 0; -} - -/* Compress the data in the compression state input */ -static int -png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name, - compression_state *comp, png_uint_32 prefix_len) -{ - int ret; - - /* To find the length of the output it is necessary to first compress the - * input. The result is buffered rather than using the two-pass algorithm - * that is used on the inflate side; deflate is assumed to be slower and a - * PNG writer is assumed to have more memory available than a PNG reader. - * - * IMPLEMENTATION NOTE: the zlib API deflateBound() can be used to find an - * upper limit on the output size, but it is always bigger than the input - * size so it is likely to be more efficient to use this linked-list - * approach. - */ - ret = png_deflate_claim(png_ptr, chunk_name, comp->input_len); - - if (ret != Z_OK) - return ret; - - /* Set up the compression buffers, we need a loop here to avoid overflowing a - * uInt. Use ZLIB_IO_MAX to limit the input. The output is always limited - * by the output buffer size, so there is no need to check that. Since this - * is ANSI-C we know that an 'int', hence a uInt, is always at least 16 bits - * in size. - */ - { - png_compression_bufferp *end = &png_ptr->zbuffer_list; - png_alloc_size_t input_len = comp->input_len; /* may be zero! */ - png_uint_32 output_len; - - /* zlib updates these for us: */ - png_ptr->zstream.next_in = PNGZ_INPUT_CAST(comp->input); - png_ptr->zstream.avail_in = 0; /* Set below */ - png_ptr->zstream.next_out = comp->output; - png_ptr->zstream.avail_out = (sizeof comp->output); - - output_len = png_ptr->zstream.avail_out; - - do - { - uInt avail_in = ZLIB_IO_MAX; - - if (avail_in > input_len) - avail_in = (uInt)input_len; - - input_len -= avail_in; - - png_ptr->zstream.avail_in = avail_in; - - if (png_ptr->zstream.avail_out == 0) - { - png_compression_buffer *next; - - /* Chunk data is limited to 2^31 bytes in length, so the prefix - * length must be counted here. - */ - if (output_len + prefix_len > PNG_UINT_31_MAX) - { - ret = Z_MEM_ERROR; - break; - } - - /* Need a new (malloc'ed) buffer, but there may be one present - * already. - */ - next = *end; - if (next == NULL) - { - next = png_voidcast(png_compression_bufferp, png_malloc_base - (png_ptr, PNG_COMPRESSION_BUFFER_SIZE(png_ptr))); - - if (next == NULL) - { - ret = Z_MEM_ERROR; - break; - } - - /* Link in this buffer (so that it will be freed later) */ - next->next = NULL; - *end = next; - } - - png_ptr->zstream.next_out = next->output; - png_ptr->zstream.avail_out = png_ptr->zbuffer_size; - output_len += png_ptr->zstream.avail_out; - - /* Move 'end' to the next buffer pointer. */ - end = &next->next; - } - - /* Compress the data */ - ret = deflate(&png_ptr->zstream, - input_len > 0 ? Z_NO_FLUSH : Z_FINISH); - - /* Claw back input data that was not consumed (because avail_in is - * reset above every time round the loop). - */ - input_len += png_ptr->zstream.avail_in; - png_ptr->zstream.avail_in = 0; /* safety */ - } - while (ret == Z_OK); - - /* There may be some space left in the last output buffer. This needs to - * be subtracted from output_len. - */ - output_len -= png_ptr->zstream.avail_out; - png_ptr->zstream.avail_out = 0; /* safety */ - comp->output_len = output_len; - - /* Now double check the output length, put in a custom message if it is - * too long. Otherwise ensure the z_stream::msg pointer is set to - * something. - */ - if (output_len + prefix_len >= PNG_UINT_31_MAX) - { - png_ptr->zstream.msg = PNGZ_MSG_CAST("compressed data too long"); - ret = Z_MEM_ERROR; - } - - else - png_zstream_error(png_ptr, ret); - - /* Reset zlib for another zTXt/iTXt or image data */ - png_ptr->zowner = 0; - - /* The only success case is Z_STREAM_END, input_len must be 0; if not this - * is an internal error. - */ - if (ret == Z_STREAM_END && input_len == 0) - { -#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED - /* Fix up the deflate header, if required */ - optimize_cmf(comp->output, comp->input_len); -#endif - /* But Z_OK is returned, not Z_STREAM_END; this allows the claim - * function above to return Z_STREAM_END on an error (though it never - * does in the current versions of zlib.) - */ - return Z_OK; - } - - else - return ret; - } -} - -/* Ship the compressed text out via chunk writes */ -static void -png_write_compressed_data_out(png_structrp png_ptr, compression_state *comp) -{ - png_uint_32 output_len = comp->output_len; - png_const_bytep output = comp->output; - png_uint_32 avail = (sizeof comp->output); - png_compression_buffer *next = png_ptr->zbuffer_list; - - for (;;) - { - if (avail > output_len) - avail = output_len; - - png_write_chunk_data(png_ptr, output, avail); - - output_len -= avail; - - if (output_len == 0 || next == NULL) - break; - - avail = png_ptr->zbuffer_size; - output = next->output; - next = next->next; - } - - /* This is an internal error; 'next' must have been NULL! */ - if (output_len > 0) - png_error(png_ptr, "error writing ancillary chunked compressed data"); -} -#endif /* WRITE_COMPRESSED_TEXT */ - -/* Write the IHDR chunk, and update the png_struct with the necessary - * information. Note that the rest of this code depends upon this - * information being correct. - */ -void /* PRIVATE */ -png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height, - int bit_depth, int color_type, int compression_type, int filter_type, - int interlace_type) -{ - png_byte buf[13]; /* Buffer to store the IHDR info */ - - png_debug(1, "in png_write_IHDR"); - - /* Check that we have valid input data from the application info */ - switch (color_type) - { - case PNG_COLOR_TYPE_GRAY: - switch (bit_depth) - { - case 1: - case 2: - case 4: - case 8: -#ifdef PNG_WRITE_16BIT_SUPPORTED - case 16: -#endif - png_ptr->channels = 1; break; - - default: - png_error(png_ptr, - "Invalid bit depth for grayscale image"); - } - break; - - case PNG_COLOR_TYPE_RGB: -#ifdef PNG_WRITE_16BIT_SUPPORTED - if (bit_depth != 8 && bit_depth != 16) -#else - if (bit_depth != 8) -#endif - png_error(png_ptr, "Invalid bit depth for RGB image"); - - png_ptr->channels = 3; - break; - - case PNG_COLOR_TYPE_PALETTE: - switch (bit_depth) - { - case 1: - case 2: - case 4: - case 8: - png_ptr->channels = 1; - break; - - default: - png_error(png_ptr, "Invalid bit depth for paletted image"); - } - break; - - case PNG_COLOR_TYPE_GRAY_ALPHA: - if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for grayscale+alpha image"); - - png_ptr->channels = 2; - break; - - case PNG_COLOR_TYPE_RGB_ALPHA: -#ifdef PNG_WRITE_16BIT_SUPPORTED - if (bit_depth != 8 && bit_depth != 16) -#else - if (bit_depth != 8) -#endif - png_error(png_ptr, "Invalid bit depth for RGBA image"); - - png_ptr->channels = 4; - break; - - default: - png_error(png_ptr, "Invalid image color type specified"); - } - - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - { - png_warning(png_ptr, "Invalid compression type specified"); - compression_type = PNG_COMPRESSION_TYPE_BASE; - } - - /* Write filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and - * 2. Libpng did not write a PNG signature (this filter_method is only - * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and - * 4. The filter_method is 64 and - * 5. The color_type is RGB or RGBA - */ - if ( -#ifdef PNG_MNG_FEATURES_SUPPORTED - !((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) != 0 && - ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) == 0) && - (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) && - (filter_type == PNG_INTRAPIXEL_DIFFERENCING)) && -#endif - filter_type != PNG_FILTER_TYPE_BASE) - { - png_warning(png_ptr, "Invalid filter type specified"); - filter_type = PNG_FILTER_TYPE_BASE; - } - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - if (interlace_type != PNG_INTERLACE_NONE && - interlace_type != PNG_INTERLACE_ADAM7) - { - png_warning(png_ptr, "Invalid interlace type specified"); - interlace_type = PNG_INTERLACE_ADAM7; - } -#else - interlace_type=PNG_INTERLACE_NONE; -#endif - - /* Save the relevant information */ - png_ptr->bit_depth = (png_byte)bit_depth; - png_ptr->color_type = (png_byte)color_type; - png_ptr->interlaced = (png_byte)interlace_type; -#ifdef PNG_MNG_FEATURES_SUPPORTED - png_ptr->filter_type = (png_byte)filter_type; -#endif - png_ptr->compression_type = (png_byte)compression_type; - png_ptr->width = width; - png_ptr->height = height; - - png_ptr->pixel_depth = (png_byte)(bit_depth * png_ptr->channels); - png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); - /* Set the usr info, so any transformations can modify it */ - png_ptr->usr_width = png_ptr->width; - png_ptr->usr_bit_depth = png_ptr->bit_depth; - png_ptr->usr_channels = png_ptr->channels; - - /* Pack the header information into the buffer */ - png_save_uint_32(buf, width); - png_save_uint_32(buf + 4, height); - buf[8] = (png_byte)bit_depth; - buf[9] = (png_byte)color_type; - buf[10] = (png_byte)compression_type; - buf[11] = (png_byte)filter_type; - buf[12] = (png_byte)interlace_type; - - /* Write the chunk */ - png_write_complete_chunk(png_ptr, png_IHDR, buf, (png_size_t)13); - - if ((png_ptr->do_filter) == PNG_NO_FILTERS) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || - png_ptr->bit_depth < 8) - png_ptr->do_filter = PNG_FILTER_NONE; - - else - png_ptr->do_filter = PNG_ALL_FILTERS; - } - - png_ptr->mode = PNG_HAVE_IHDR; /* not READY_FOR_ZTXT */ -} - -/* Write the palette. We are careful not to trust png_color to be in the - * correct order for PNG, so people can redefine it to any convenient - * structure. - */ -void /* PRIVATE */ -png_write_PLTE(png_structrp png_ptr, png_const_colorp palette, - png_uint_32 num_pal) -{ - png_uint_32 max_palette_length, i; - png_const_colorp pal_ptr; - png_byte buf[3]; - - png_debug(1, "in png_write_PLTE"); - - max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ? - (1 << png_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH; - - if (( -#ifdef PNG_MNG_FEATURES_SUPPORTED - (png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) == 0 && -#endif - num_pal == 0) || num_pal > max_palette_length) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_error(png_ptr, "Invalid number of colors in palette"); - } - - else - { - png_warning(png_ptr, "Invalid number of colors in palette"); - return; - } - } - - if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0) - { - png_warning(png_ptr, - "Ignoring request to write a PLTE chunk in grayscale PNG"); - - return; - } - - png_ptr->num_palette = (png_uint_16)num_pal; - png_debug1(3, "num_palette = %d", png_ptr->num_palette); - - png_write_chunk_header(png_ptr, png_PLTE, (png_uint_32)(num_pal * 3)); -#ifdef PNG_POINTER_INDEXING_SUPPORTED - - for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++) - { - buf[0] = pal_ptr->red; - buf[1] = pal_ptr->green; - buf[2] = pal_ptr->blue; - png_write_chunk_data(png_ptr, buf, (png_size_t)3); - } - -#else - /* This is a little slower but some buggy compilers need to do this - * instead - */ - pal_ptr=palette; - - for (i = 0; i < num_pal; i++) - { - buf[0] = pal_ptr[i].red; - buf[1] = pal_ptr[i].green; - buf[2] = pal_ptr[i].blue; - png_write_chunk_data(png_ptr, buf, (png_size_t)3); - } - -#endif - png_write_chunk_end(png_ptr); - png_ptr->mode |= PNG_HAVE_PLTE; -} - -/* This is similar to png_text_compress, above, except that it does not require - * all of the data at once and, instead of buffering the compressed result, - * writes it as IDAT chunks. Unlike png_text_compress it *can* png_error out - * because it calls the write interface. As a result it does its own error - * reporting and does not return an error code. In the event of error it will - * just call png_error. The input data length may exceed 32-bits. The 'flush' - * parameter is exactly the same as that to deflate, with the following - * meanings: - * - * Z_NO_FLUSH: normal incremental output of compressed data - * Z_SYNC_FLUSH: do a SYNC_FLUSH, used by png_write_flush - * Z_FINISH: this is the end of the input, do a Z_FINISH and clean up - * - * The routine manages the acquire and release of the png_ptr->zstream by - * checking and (at the end) clearing png_ptr->zowner; it does some sanity - * checks on the 'mode' flags while doing this. - */ -void /* PRIVATE */ -png_compress_IDAT(png_structrp png_ptr, png_const_bytep input, - png_alloc_size_t input_len, int flush) -{ - if (png_ptr->zowner != png_IDAT) - { - /* First time. Ensure we have a temporary buffer for compression and - * trim the buffer list if it has more than one entry to free memory. - * If 'WRITE_COMPRESSED_TEXT' is not set the list will never have been - * created at this point, but the check here is quick and safe. - */ - if (png_ptr->zbuffer_list == NULL) - { - png_ptr->zbuffer_list = png_voidcast(png_compression_bufferp, - png_malloc(png_ptr, PNG_COMPRESSION_BUFFER_SIZE(png_ptr))); - png_ptr->zbuffer_list->next = NULL; - } - - else - png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list->next); - - /* It is a terminal error if we can't claim the zstream. */ - if (png_deflate_claim(png_ptr, png_IDAT, png_image_size(png_ptr)) != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg); - - /* The output state is maintained in png_ptr->zstream, so it must be - * initialized here after the claim. - */ - png_ptr->zstream.next_out = png_ptr->zbuffer_list->output; - png_ptr->zstream.avail_out = png_ptr->zbuffer_size; - } - - /* Now loop reading and writing until all the input is consumed or an error - * terminates the operation. The _out values are maintained across calls to - * this function, but the input must be reset each time. - */ - png_ptr->zstream.next_in = PNGZ_INPUT_CAST(input); - png_ptr->zstream.avail_in = 0; /* set below */ - for (;;) - { - int ret; - - /* INPUT: from the row data */ - uInt avail = ZLIB_IO_MAX; - - if (avail > input_len) - avail = (uInt)input_len; /* safe because of the check */ - - png_ptr->zstream.avail_in = avail; - input_len -= avail; - - ret = deflate(&png_ptr->zstream, input_len > 0 ? Z_NO_FLUSH : flush); - - /* Include as-yet unconsumed input */ - input_len += png_ptr->zstream.avail_in; - png_ptr->zstream.avail_in = 0; - - /* OUTPUT: write complete IDAT chunks when avail_out drops to zero. Note - * that these two zstream fields are preserved across the calls, therefore - * there is no need to set these up on entry to the loop. - */ - if (png_ptr->zstream.avail_out == 0) - { - png_bytep data = png_ptr->zbuffer_list->output; - uInt size = png_ptr->zbuffer_size; - - /* Write an IDAT containing the data then reset the buffer. The - * first IDAT may need deflate header optimization. - */ -#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED - if ((png_ptr->mode & PNG_HAVE_IDAT) == 0 && - png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE) - optimize_cmf(data, png_image_size(png_ptr)); -#endif - - png_write_complete_chunk(png_ptr, png_IDAT, data, size); - png_ptr->mode |= PNG_HAVE_IDAT; - - png_ptr->zstream.next_out = data; - png_ptr->zstream.avail_out = size; - - /* For SYNC_FLUSH or FINISH it is essential to keep calling zlib with - * the same flush parameter until it has finished output, for NO_FLUSH - * it doesn't matter. - */ - if (ret == Z_OK && flush != Z_NO_FLUSH) - continue; - } - - /* The order of these checks doesn't matter much; it just affects which - * possible error might be detected if multiple things go wrong at once. - */ - if (ret == Z_OK) /* most likely return code! */ - { - /* If all the input has been consumed then just return. If Z_FINISH - * was used as the flush parameter something has gone wrong if we get - * here. - */ - if (input_len == 0) - { - if (flush == Z_FINISH) - png_error(png_ptr, "Z_OK on Z_FINISH with output space"); - - return; - } - } - - else if (ret == Z_STREAM_END && flush == Z_FINISH) - { - /* This is the end of the IDAT data; any pending output must be - * flushed. For small PNG files we may still be at the beginning. - */ - png_bytep data = png_ptr->zbuffer_list->output; - uInt size = png_ptr->zbuffer_size - png_ptr->zstream.avail_out; - -#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED - if ((png_ptr->mode & PNG_HAVE_IDAT) == 0 && - png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE) - optimize_cmf(data, png_image_size(png_ptr)); -#endif - - png_write_complete_chunk(png_ptr, png_IDAT, data, size); - png_ptr->zstream.avail_out = 0; - png_ptr->zstream.next_out = NULL; - png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT; - - png_ptr->zowner = 0; /* Release the stream */ - return; - } - - else - { - /* This is an error condition. */ - png_zstream_error(png_ptr, ret); - png_error(png_ptr, png_ptr->zstream.msg); - } - } -} - -/* Write an IEND chunk */ -void /* PRIVATE */ -png_write_IEND(png_structrp png_ptr) -{ - png_debug(1, "in png_write_IEND"); - - png_write_complete_chunk(png_ptr, png_IEND, NULL, (png_size_t)0); - png_ptr->mode |= PNG_HAVE_IEND; -} - -#ifdef PNG_WRITE_gAMA_SUPPORTED -/* Write a gAMA chunk */ -void /* PRIVATE */ -png_write_gAMA_fixed(png_structrp png_ptr, png_fixed_point file_gamma) -{ - png_byte buf[4]; - - png_debug(1, "in png_write_gAMA"); - - /* file_gamma is saved in 1/100,000ths */ - png_save_uint_32(buf, (png_uint_32)file_gamma); - png_write_complete_chunk(png_ptr, png_gAMA, buf, (png_size_t)4); -} -#endif - -#ifdef PNG_WRITE_sRGB_SUPPORTED -/* Write a sRGB chunk */ -void /* PRIVATE */ -png_write_sRGB(png_structrp png_ptr, int srgb_intent) -{ - png_byte buf[1]; - - png_debug(1, "in png_write_sRGB"); - - if (srgb_intent >= PNG_sRGB_INTENT_LAST) - png_warning(png_ptr, - "Invalid sRGB rendering intent specified"); - - buf[0]=(png_byte)srgb_intent; - png_write_complete_chunk(png_ptr, png_sRGB, buf, (png_size_t)1); -} -#endif - -#ifdef PNG_WRITE_iCCP_SUPPORTED -/* Write an iCCP chunk */ -void /* PRIVATE */ -png_write_iCCP(png_structrp png_ptr, png_const_charp name, - png_const_bytep profile) -{ - png_uint_32 name_len; - png_uint_32 profile_len; - png_byte new_name[81]; /* 1 byte for the compression byte */ - compression_state comp; - png_uint_32 temp; - - png_debug(1, "in png_write_iCCP"); - - /* These are all internal problems: the profile should have been checked - * before when it was stored. - */ - if (profile == NULL) - png_error(png_ptr, "No profile for iCCP chunk"); /* internal error */ - - profile_len = png_get_uint_32(profile); - - if (profile_len < 132) - png_error(png_ptr, "ICC profile too short"); - - temp = (png_uint_32) (*(profile+8)); - if (temp > 3 && (profile_len & 0x03)) - png_error(png_ptr, "ICC profile length invalid (not a multiple of 4)"); - - { - png_uint_32 embedded_profile_len = png_get_uint_32(profile); - - if (profile_len != embedded_profile_len) - png_error(png_ptr, "Profile length does not match profile"); - } - - name_len = png_check_keyword(png_ptr, name, new_name); - - if (name_len == 0) - png_error(png_ptr, "iCCP: invalid keyword"); - - new_name[++name_len] = PNG_COMPRESSION_TYPE_BASE; - - /* Make sure we include the NULL after the name and the compression type */ - ++name_len; - - png_text_compress_init(&comp, profile, profile_len); - - /* Allow for keyword terminator and compression byte */ - if (png_text_compress(png_ptr, png_iCCP, &comp, name_len) != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg); - - png_write_chunk_header(png_ptr, png_iCCP, name_len + comp.output_len); - - png_write_chunk_data(png_ptr, new_name, name_len); - - png_write_compressed_data_out(png_ptr, &comp); - - png_write_chunk_end(png_ptr); -} -#endif - -#ifdef PNG_WRITE_sPLT_SUPPORTED -/* Write a sPLT chunk */ -void /* PRIVATE */ -png_write_sPLT(png_structrp png_ptr, png_const_sPLT_tp spalette) -{ - png_uint_32 name_len; - png_byte new_name[80]; - png_byte entrybuf[10]; - png_size_t entry_size = (spalette->depth == 8 ? 6 : 10); - png_size_t palette_size = entry_size * (png_size_t)spalette->nentries; - png_sPLT_entryp ep; -#ifndef PNG_POINTER_INDEXING_SUPPORTED - int i; -#endif - - png_debug(1, "in png_write_sPLT"); - - name_len = png_check_keyword(png_ptr, spalette->name, new_name); - - if (name_len == 0) - png_error(png_ptr, "sPLT: invalid keyword"); - - /* Make sure we include the NULL after the name */ - png_write_chunk_header(png_ptr, png_sPLT, - (png_uint_32)(name_len + 2 + palette_size)); - - png_write_chunk_data(png_ptr, (png_bytep)new_name, - (png_size_t)(name_len + 1)); - - png_write_chunk_data(png_ptr, &spalette->depth, (png_size_t)1); - - /* Loop through each palette entry, writing appropriately */ -#ifdef PNG_POINTER_INDEXING_SUPPORTED - for (ep = spalette->entries; epentries + spalette->nentries; ep++) - { - if (spalette->depth == 8) - { - entrybuf[0] = (png_byte)ep->red; - entrybuf[1] = (png_byte)ep->green; - entrybuf[2] = (png_byte)ep->blue; - entrybuf[3] = (png_byte)ep->alpha; - png_save_uint_16(entrybuf + 4, ep->frequency); - } - - else - { - png_save_uint_16(entrybuf + 0, ep->red); - png_save_uint_16(entrybuf + 2, ep->green); - png_save_uint_16(entrybuf + 4, ep->blue); - png_save_uint_16(entrybuf + 6, ep->alpha); - png_save_uint_16(entrybuf + 8, ep->frequency); - } - - png_write_chunk_data(png_ptr, entrybuf, entry_size); - } -#else - ep=spalette->entries; - for (i = 0; i>spalette->nentries; i++) - { - if (spalette->depth == 8) - { - entrybuf[0] = (png_byte)ep[i].red; - entrybuf[1] = (png_byte)ep[i].green; - entrybuf[2] = (png_byte)ep[i].blue; - entrybuf[3] = (png_byte)ep[i].alpha; - png_save_uint_16(entrybuf + 4, ep[i].frequency); - } - - else - { - png_save_uint_16(entrybuf + 0, ep[i].red); - png_save_uint_16(entrybuf + 2, ep[i].green); - png_save_uint_16(entrybuf + 4, ep[i].blue); - png_save_uint_16(entrybuf + 6, ep[i].alpha); - png_save_uint_16(entrybuf + 8, ep[i].frequency); - } - - png_write_chunk_data(png_ptr, entrybuf, entry_size); - } -#endif - - png_write_chunk_end(png_ptr); -} -#endif - -#ifdef PNG_WRITE_sBIT_SUPPORTED -/* Write the sBIT chunk */ -void /* PRIVATE */ -png_write_sBIT(png_structrp png_ptr, png_const_color_8p sbit, int color_type) -{ - png_byte buf[4]; - png_size_t size; - - png_debug(1, "in png_write_sBIT"); - - /* Make sure we don't depend upon the order of PNG_COLOR_8 */ - if ((color_type & PNG_COLOR_MASK_COLOR) != 0) - { - png_byte maxbits; - - maxbits = (png_byte)(color_type==PNG_COLOR_TYPE_PALETTE ? 8 : - png_ptr->usr_bit_depth); - - if (sbit->red == 0 || sbit->red > maxbits || - sbit->green == 0 || sbit->green > maxbits || - sbit->blue == 0 || sbit->blue > maxbits) - { - png_warning(png_ptr, "Invalid sBIT depth specified"); - return; - } - - buf[0] = sbit->red; - buf[1] = sbit->green; - buf[2] = sbit->blue; - size = 3; - } - - else - { - if (sbit->gray == 0 || sbit->gray > png_ptr->usr_bit_depth) - { - png_warning(png_ptr, "Invalid sBIT depth specified"); - return; - } - - buf[0] = sbit->gray; - size = 1; - } - - if ((color_type & PNG_COLOR_MASK_ALPHA) != 0) - { - if (sbit->alpha == 0 || sbit->alpha > png_ptr->usr_bit_depth) - { - png_warning(png_ptr, "Invalid sBIT depth specified"); - return; - } - - buf[size++] = sbit->alpha; - } - - png_write_complete_chunk(png_ptr, png_sBIT, buf, size); -} -#endif - -#ifdef PNG_WRITE_cHRM_SUPPORTED -/* Write the cHRM chunk */ -void /* PRIVATE */ -png_write_cHRM_fixed(png_structrp png_ptr, const png_xy *xy) -{ - png_byte buf[32]; - - png_debug(1, "in png_write_cHRM"); - - /* Each value is saved in 1/100,000ths */ - png_save_int_32(buf, xy->whitex); - png_save_int_32(buf + 4, xy->whitey); - - png_save_int_32(buf + 8, xy->redx); - png_save_int_32(buf + 12, xy->redy); - - png_save_int_32(buf + 16, xy->greenx); - png_save_int_32(buf + 20, xy->greeny); - - png_save_int_32(buf + 24, xy->bluex); - png_save_int_32(buf + 28, xy->bluey); - - png_write_complete_chunk(png_ptr, png_cHRM, buf, 32); -} -#endif - -#ifdef PNG_WRITE_tRNS_SUPPORTED -/* Write the tRNS chunk */ -void /* PRIVATE */ -png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha, - png_const_color_16p tran, int num_trans, int color_type) -{ - png_byte buf[6]; - - png_debug(1, "in png_write_tRNS"); - - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette) - { - png_app_warning(png_ptr, - "Invalid number of transparent colors specified"); - return; - } - - /* Write the chunk out as it is */ - png_write_complete_chunk(png_ptr, png_tRNS, trans_alpha, - (png_size_t)num_trans); - } - - else if (color_type == PNG_COLOR_TYPE_GRAY) - { - /* One 16-bit value */ - if (tran->gray >= (1 << png_ptr->bit_depth)) - { - png_app_warning(png_ptr, - "Ignoring attempt to write tRNS chunk out-of-range for bit_depth"); - - return; - } - - png_save_uint_16(buf, tran->gray); - png_write_complete_chunk(png_ptr, png_tRNS, buf, (png_size_t)2); - } - - else if (color_type == PNG_COLOR_TYPE_RGB) - { - /* Three 16-bit values */ - png_save_uint_16(buf, tran->red); - png_save_uint_16(buf + 2, tran->green); - png_save_uint_16(buf + 4, tran->blue); -#ifdef PNG_WRITE_16BIT_SUPPORTED - if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]) != 0) -#else - if ((buf[0] | buf[2] | buf[4]) != 0) -#endif - { - png_app_warning(png_ptr, - "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8"); - return; - } - - png_write_complete_chunk(png_ptr, png_tRNS, buf, (png_size_t)6); - } - - else - { - png_app_warning(png_ptr, "Can't write tRNS with an alpha channel"); - } -} -#endif - -#ifdef PNG_WRITE_bKGD_SUPPORTED -/* Write the background chunk */ -void /* PRIVATE */ -png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type) -{ - png_byte buf[6]; - - png_debug(1, "in png_write_bKGD"); - - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - if ( -#ifdef PNG_MNG_FEATURES_SUPPORTED - (png_ptr->num_palette != 0 || - (png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) == 0) && -#endif - back->index >= png_ptr->num_palette) - { - png_warning(png_ptr, "Invalid background palette index"); - return; - } - - buf[0] = back->index; - png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)1); - } - - else if ((color_type & PNG_COLOR_MASK_COLOR) != 0) - { - png_save_uint_16(buf, back->red); - png_save_uint_16(buf + 2, back->green); - png_save_uint_16(buf + 4, back->blue); -#ifdef PNG_WRITE_16BIT_SUPPORTED - if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]) != 0) -#else - if ((buf[0] | buf[2] | buf[4]) != 0) -#endif - { - png_warning(png_ptr, - "Ignoring attempt to write 16-bit bKGD chunk " - "when bit_depth is 8"); - - return; - } - - png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)6); - } - - else - { - if (back->gray >= (1 << png_ptr->bit_depth)) - { - png_warning(png_ptr, - "Ignoring attempt to write bKGD chunk out-of-range for bit_depth"); - - return; - } - - png_save_uint_16(buf, back->gray); - png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)2); - } -} -#endif - -#ifdef PNG_WRITE_hIST_SUPPORTED -/* Write the histogram */ -void /* PRIVATE */ -png_write_hIST(png_structrp png_ptr, png_const_uint_16p hist, int num_hist) -{ - int i; - png_byte buf[3]; - - png_debug(1, "in png_write_hIST"); - - if (num_hist > (int)png_ptr->num_palette) - { - png_debug2(3, "num_hist = %d, num_palette = %d", num_hist, - png_ptr->num_palette); - - png_warning(png_ptr, "Invalid number of histogram entries specified"); - return; - } - - png_write_chunk_header(png_ptr, png_hIST, (png_uint_32)(num_hist * 2)); - - for (i = 0; i < num_hist; i++) - { - png_save_uint_16(buf, hist[i]); - png_write_chunk_data(png_ptr, buf, (png_size_t)2); - } - - png_write_chunk_end(png_ptr); -} -#endif - -#ifdef PNG_WRITE_tEXt_SUPPORTED -/* Write a tEXt chunk */ -void /* PRIVATE */ -png_write_tEXt(png_structrp png_ptr, png_const_charp key, png_const_charp text, - png_size_t text_len) -{ - png_uint_32 key_len; - png_byte new_key[80]; - - png_debug(1, "in png_write_tEXt"); - - key_len = png_check_keyword(png_ptr, key, new_key); - - if (key_len == 0) - png_error(png_ptr, "tEXt: invalid keyword"); - - if (text == NULL || *text == '\0') - text_len = 0; - - else - text_len = strlen(text); - - if (text_len > PNG_UINT_31_MAX - (key_len+1)) - png_error(png_ptr, "tEXt: text too long"); - - /* Make sure we include the 0 after the key */ - png_write_chunk_header(png_ptr, png_tEXt, - (png_uint_32)/*checked above*/(key_len + text_len + 1)); - /* - * We leave it to the application to meet PNG-1.0 requirements on the - * contents of the text. PNG-1.0 through PNG-1.2 discourage the use of - * any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them. - * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG. - */ - png_write_chunk_data(png_ptr, new_key, key_len + 1); - - if (text_len != 0) - png_write_chunk_data(png_ptr, (png_const_bytep)text, text_len); - - png_write_chunk_end(png_ptr); -} -#endif - -#ifdef PNG_WRITE_zTXt_SUPPORTED -/* Write a compressed text chunk */ -void /* PRIVATE */ -png_write_zTXt(png_structrp png_ptr, png_const_charp key, png_const_charp text, - int compression) -{ - png_uint_32 key_len; - png_byte new_key[81]; - compression_state comp; - - png_debug(1, "in png_write_zTXt"); - - if (compression == PNG_TEXT_COMPRESSION_NONE) - { - png_write_tEXt(png_ptr, key, text, 0); - return; - } - - if (compression != PNG_TEXT_COMPRESSION_zTXt) - png_error(png_ptr, "zTXt: invalid compression type"); - - key_len = png_check_keyword(png_ptr, key, new_key); - - if (key_len == 0) - png_error(png_ptr, "zTXt: invalid keyword"); - - /* Add the compression method and 1 for the keyword separator. */ - new_key[++key_len] = PNG_COMPRESSION_TYPE_BASE; - ++key_len; - - /* Compute the compressed data; do it now for the length */ - png_text_compress_init(&comp, (png_const_bytep)text, - text == NULL ? 0 : strlen(text)); - - if (png_text_compress(png_ptr, png_zTXt, &comp, key_len) != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg); - - /* Write start of chunk */ - png_write_chunk_header(png_ptr, png_zTXt, key_len + comp.output_len); - - /* Write key */ - png_write_chunk_data(png_ptr, new_key, key_len); - - /* Write the compressed data */ - png_write_compressed_data_out(png_ptr, &comp); - - /* Close the chunk */ - png_write_chunk_end(png_ptr); -} -#endif - -#ifdef PNG_WRITE_iTXt_SUPPORTED -/* Write an iTXt chunk */ -void /* PRIVATE */ -png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key, - png_const_charp lang, png_const_charp lang_key, png_const_charp text) -{ - png_uint_32 key_len, prefix_len; - png_size_t lang_len, lang_key_len; - png_byte new_key[82]; - compression_state comp; - - png_debug(1, "in png_write_iTXt"); - - key_len = png_check_keyword(png_ptr, key, new_key); - - if (key_len == 0) - png_error(png_ptr, "iTXt: invalid keyword"); - - /* Set the compression flag */ - switch (compression) - { - case PNG_ITXT_COMPRESSION_NONE: - case PNG_TEXT_COMPRESSION_NONE: - compression = new_key[++key_len] = 0; /* no compression */ - break; - - case PNG_TEXT_COMPRESSION_zTXt: - case PNG_ITXT_COMPRESSION_zTXt: - compression = new_key[++key_len] = 1; /* compressed */ - break; - - default: - png_error(png_ptr, "iTXt: invalid compression"); - } - - new_key[++key_len] = PNG_COMPRESSION_TYPE_BASE; - ++key_len; /* for the keywod separator */ - - /* We leave it to the application to meet PNG-1.0 requirements on the - * contents of the text. PNG-1.0 through PNG-1.2 discourage the use of - * any non-Latin-1 characters except for NEWLINE. ISO PNG, however, - * specifies that the text is UTF-8 and this really doesn't require any - * checking. - * - * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG. - * - * TODO: validate the language tag correctly (see the spec.) - */ - if (lang == NULL) lang = ""; /* empty language is valid */ - lang_len = strlen(lang)+1; - if (lang_key == NULL) lang_key = ""; /* may be empty */ - lang_key_len = strlen(lang_key)+1; - if (text == NULL) text = ""; /* may be empty */ - - prefix_len = key_len; - if (lang_len > PNG_UINT_31_MAX-prefix_len) - prefix_len = PNG_UINT_31_MAX; - else - prefix_len = (png_uint_32)(prefix_len + lang_len); - - if (lang_key_len > PNG_UINT_31_MAX-prefix_len) - prefix_len = PNG_UINT_31_MAX; - else - prefix_len = (png_uint_32)(prefix_len + lang_key_len); - - png_text_compress_init(&comp, (png_const_bytep)text, strlen(text)); - - if (compression != 0) - { - if (png_text_compress(png_ptr, png_iTXt, &comp, prefix_len) != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg); - } - - else - { - if (comp.input_len > PNG_UINT_31_MAX-prefix_len) - png_error(png_ptr, "iTXt: uncompressed text too long"); - - /* So the string will fit in a chunk: */ - comp.output_len = (png_uint_32)/*SAFE*/comp.input_len; - } - - png_write_chunk_header(png_ptr, png_iTXt, comp.output_len + prefix_len); - - png_write_chunk_data(png_ptr, new_key, key_len); - - png_write_chunk_data(png_ptr, (png_const_bytep)lang, lang_len); - - png_write_chunk_data(png_ptr, (png_const_bytep)lang_key, lang_key_len); - - if (compression != 0) - png_write_compressed_data_out(png_ptr, &comp); - - else - png_write_chunk_data(png_ptr, (png_const_bytep)text, comp.output_len); - - png_write_chunk_end(png_ptr); -} -#endif - -#ifdef PNG_WRITE_oFFs_SUPPORTED -/* Write the oFFs chunk */ -void /* PRIVATE */ -png_write_oFFs(png_structrp png_ptr, png_int_32 x_offset, png_int_32 y_offset, - int unit_type) -{ - png_byte buf[9]; - - png_debug(1, "in png_write_oFFs"); - - if (unit_type >= PNG_OFFSET_LAST) - png_warning(png_ptr, "Unrecognized unit type for oFFs chunk"); - - png_save_int_32(buf, x_offset); - png_save_int_32(buf + 4, y_offset); - buf[8] = (png_byte)unit_type; - - png_write_complete_chunk(png_ptr, png_oFFs, buf, (png_size_t)9); -} -#endif -#ifdef PNG_WRITE_pCAL_SUPPORTED -/* Write the pCAL chunk (described in the PNG extensions document) */ -void /* PRIVATE */ -png_write_pCAL(png_structrp png_ptr, png_charp purpose, png_int_32 X0, - png_int_32 X1, int type, int nparams, png_const_charp units, - png_charpp params) -{ - png_uint_32 purpose_len; - png_size_t units_len, total_len; - png_size_tp params_len; - png_byte buf[10]; - png_byte new_purpose[80]; - int i; - - png_debug1(1, "in png_write_pCAL (%d parameters)", nparams); - - if (type >= PNG_EQUATION_LAST) - png_error(png_ptr, "Unrecognized equation type for pCAL chunk"); - - purpose_len = png_check_keyword(png_ptr, purpose, new_purpose); - - if (purpose_len == 0) - png_error(png_ptr, "pCAL: invalid keyword"); - - ++purpose_len; /* terminator */ - - png_debug1(3, "pCAL purpose length = %d", (int)purpose_len); - units_len = strlen(units) + (nparams == 0 ? 0 : 1); - png_debug1(3, "pCAL units length = %d", (int)units_len); - total_len = purpose_len + units_len + 10; - - params_len = (png_size_tp)png_malloc(png_ptr, - (png_alloc_size_t)((png_alloc_size_t)nparams * (sizeof (png_size_t)))); - - /* Find the length of each parameter, making sure we don't count the - * null terminator for the last parameter. - */ - for (i = 0; i < nparams; i++) - { - params_len[i] = strlen(params[i]) + (i == nparams - 1 ? 0 : 1); - png_debug2(3, "pCAL parameter %d length = %lu", i, - (unsigned long)params_len[i]); - total_len += params_len[i]; - } - - png_debug1(3, "pCAL total length = %d", (int)total_len); - png_write_chunk_header(png_ptr, png_pCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, new_purpose, purpose_len); - png_save_int_32(buf, X0); - png_save_int_32(buf + 4, X1); - buf[8] = (png_byte)type; - buf[9] = (png_byte)nparams; - png_write_chunk_data(png_ptr, buf, (png_size_t)10); - png_write_chunk_data(png_ptr, (png_const_bytep)units, (png_size_t)units_len); - - for (i = 0; i < nparams; i++) - { - png_write_chunk_data(png_ptr, (png_const_bytep)params[i], params_len[i]); - } - - png_free(png_ptr, params_len); - png_write_chunk_end(png_ptr); -} -#endif - -#ifdef PNG_WRITE_sCAL_SUPPORTED -/* Write the sCAL chunk */ -void /* PRIVATE */ -png_write_sCAL_s(png_structrp png_ptr, int unit, png_const_charp width, - png_const_charp height) -{ - png_byte buf[64]; - png_size_t wlen, hlen, total_len; - - png_debug(1, "in png_write_sCAL_s"); - - wlen = strlen(width); - hlen = strlen(height); - total_len = wlen + hlen + 2; - - if (total_len > 64) - { - png_warning(png_ptr, "Can't write sCAL (buffer too small)"); - return; - } - - buf[0] = (png_byte)unit; - memcpy(buf + 1, width, wlen + 1); /* Append the '\0' here */ - memcpy(buf + wlen + 2, height, hlen); /* Do NOT append the '\0' here */ - - png_debug1(3, "sCAL total length = %u", (unsigned int)total_len); - png_write_complete_chunk(png_ptr, png_sCAL, buf, total_len); -} -#endif - -#ifdef PNG_WRITE_pHYs_SUPPORTED -/* Write the pHYs chunk */ -void /* PRIVATE */ -png_write_pHYs(png_structrp png_ptr, png_uint_32 x_pixels_per_unit, - png_uint_32 y_pixels_per_unit, - int unit_type) -{ - png_byte buf[9]; - - png_debug(1, "in png_write_pHYs"); - - if (unit_type >= PNG_RESOLUTION_LAST) - png_warning(png_ptr, "Unrecognized unit type for pHYs chunk"); - - png_save_uint_32(buf, x_pixels_per_unit); - png_save_uint_32(buf + 4, y_pixels_per_unit); - buf[8] = (png_byte)unit_type; - - png_write_complete_chunk(png_ptr, png_pHYs, buf, (png_size_t)9); -} -#endif - -#ifdef PNG_WRITE_tIME_SUPPORTED -/* Write the tIME chunk. Use either png_convert_from_struct_tm() - * or png_convert_from_time_t(), or fill in the structure yourself. - */ -void /* PRIVATE */ -png_write_tIME(png_structrp png_ptr, png_const_timep mod_time) -{ - png_byte buf[7]; - - png_debug(1, "in png_write_tIME"); - - if (mod_time->month > 12 || mod_time->month < 1 || - mod_time->day > 31 || mod_time->day < 1 || - mod_time->hour > 23 || mod_time->second > 60) - { - png_warning(png_ptr, "Invalid time specified for tIME chunk"); - return; - } - - png_save_uint_16(buf, mod_time->year); - buf[2] = mod_time->month; - buf[3] = mod_time->day; - buf[4] = mod_time->hour; - buf[5] = mod_time->minute; - buf[6] = mod_time->second; - - png_write_complete_chunk(png_ptr, png_tIME, buf, (png_size_t)7); -} -#endif - -/* Initializes the row writing capability of libpng */ -void /* PRIVATE */ -png_write_start_row(png_structrp png_ptr) -{ -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif - - png_alloc_size_t buf_size; - int usr_pixel_depth; - -#ifdef PNG_WRITE_FILTER_SUPPORTED - png_byte filters; -#endif - - png_debug(1, "in png_write_start_row"); - - usr_pixel_depth = png_ptr->usr_channels * png_ptr->usr_bit_depth; - buf_size = PNG_ROWBYTES(usr_pixel_depth, png_ptr->width) + 1; - - /* 1.5.6: added to allow checking in the row write code. */ - png_ptr->transformed_pixel_depth = png_ptr->pixel_depth; - png_ptr->maximum_pixel_depth = (png_byte)usr_pixel_depth; - - /* Set up row buffer */ - png_ptr->row_buf = png_voidcast(png_bytep, png_malloc(png_ptr, buf_size)); - - png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE; - -#ifdef PNG_WRITE_FILTER_SUPPORTED - filters = png_ptr->do_filter; - - if (png_ptr->height == 1) - filters &= 0xff & ~(PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH); - - if (png_ptr->width == 1) - filters &= 0xff & ~(PNG_FILTER_SUB|PNG_FILTER_AVG|PNG_FILTER_PAETH); - - if (filters == 0) - filters = PNG_FILTER_NONE; - - png_ptr->do_filter = filters; - - if (((filters & (PNG_FILTER_SUB | PNG_FILTER_UP | PNG_FILTER_AVG | - PNG_FILTER_PAETH)) != 0) && png_ptr->try_row == NULL) - { - int num_filters = 0; - - png_ptr->try_row = png_voidcast(png_bytep, png_malloc(png_ptr, buf_size)); - - if (filters & PNG_FILTER_SUB) - num_filters++; - - if (filters & PNG_FILTER_UP) - num_filters++; - - if (filters & PNG_FILTER_AVG) - num_filters++; - - if (filters & PNG_FILTER_PAETH) - num_filters++; - - if (num_filters > 1) - png_ptr->tst_row = png_voidcast(png_bytep, png_malloc(png_ptr, - buf_size)); - } - - /* We only need to keep the previous row if we are using one of the following - * filters. - */ - if ((filters & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH)) != 0) - png_ptr->prev_row = png_voidcast(png_bytep, - png_calloc(png_ptr, buf_size)); -#endif /* WRITE_FILTER */ - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* If interlaced, we need to set up width and height of pass */ - if (png_ptr->interlaced != 0) - { - if ((png_ptr->transformations & PNG_INTERLACE) == 0) - { - png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - - png_pass_ystart[0]) / png_pass_yinc[0]; - - png_ptr->usr_width = (png_ptr->width + png_pass_inc[0] - 1 - - png_pass_start[0]) / png_pass_inc[0]; - } - - else - { - png_ptr->num_rows = png_ptr->height; - png_ptr->usr_width = png_ptr->width; - } - } - - else -#endif - { - png_ptr->num_rows = png_ptr->height; - png_ptr->usr_width = png_ptr->width; - } -} - -/* Internal use only. Called when finished processing a row of data. */ -void /* PRIVATE */ -png_write_finish_row(png_structrp png_ptr) -{ -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif - - png_debug(1, "in png_write_finish_row"); - - /* Next row */ - png_ptr->row_number++; - - /* See if we are done */ - if (png_ptr->row_number < png_ptr->num_rows) - return; - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* If interlaced, go to next pass */ - if (png_ptr->interlaced != 0) - { - png_ptr->row_number = 0; - if ((png_ptr->transformations & PNG_INTERLACE) != 0) - { - png_ptr->pass++; - } - - else - { - /* Loop until we find a non-zero width or height pass */ - do - { - png_ptr->pass++; - - if (png_ptr->pass >= 7) - break; - - png_ptr->usr_width = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - - if ((png_ptr->transformations & PNG_INTERLACE) != 0) - break; - - } while (png_ptr->usr_width == 0 || png_ptr->num_rows == 0); - - } - - /* Reset the row above the image for the next pass */ - if (png_ptr->pass < 7) - { - if (png_ptr->prev_row != NULL) - memset(png_ptr->prev_row, 0, - (png_size_t)(PNG_ROWBYTES(png_ptr->usr_channels* - png_ptr->usr_bit_depth, png_ptr->width)) + 1); - - return; - } - } -#endif - - /* If we get here, we've just written the last row, so we need - to flush the compressor */ - png_compress_IDAT(png_ptr, NULL, 0, Z_FINISH); -} - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED -/* Pick out the correct pixels for the interlace pass. - * The basic idea here is to go through the row with a source - * pointer and a destination pointer (sp and dp), and copy the - * correct pixels for the pass. As the row gets compacted, - * sp will always be >= dp, so we should never overwrite anything. - * See the default: case for the easiest code to understand. - */ -void /* PRIVATE */ -png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) -{ - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - png_debug(1, "in png_do_write_interlace"); - - /* We don't have to do anything on the last pass (6) */ - if (pass < 6) - { - /* Each pixel depth is handled separately */ - switch (row_info->pixel_depth) - { - case 1: - { - png_bytep sp; - png_bytep dp; - unsigned int shift; - int d; - int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - dp = row; - d = 0; - shift = 7; - - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - sp = row + (png_size_t)(i >> 3); - value = (int)(*sp >> (7 - (int)(i & 0x07))) & 0x01; - d |= (value << shift); - - if (shift == 0) - { - shift = 7; - *dp++ = (png_byte)d; - d = 0; - } - - else - shift--; - - } - if (shift != 7) - *dp = (png_byte)d; - - break; - } - - case 2: - { - png_bytep sp; - png_bytep dp; - unsigned int shift; - int d; - int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - dp = row; - shift = 6; - d = 0; - - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - sp = row + (png_size_t)(i >> 2); - value = (*sp >> ((3 - (int)(i & 0x03)) << 1)) & 0x03; - d |= (value << shift); - - if (shift == 0) - { - shift = 6; - *dp++ = (png_byte)d; - d = 0; - } - - else - shift -= 2; - } - if (shift != 6) - *dp = (png_byte)d; - - break; - } - - case 4: - { - png_bytep sp; - png_bytep dp; - unsigned int shift; - int d; - int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - dp = row; - shift = 4; - d = 0; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - sp = row + (png_size_t)(i >> 1); - value = (*sp >> ((1 - (int)(i & 0x01)) << 2)) & 0x0f; - d |= (value << shift); - - if (shift == 0) - { - shift = 4; - *dp++ = (png_byte)d; - d = 0; - } - - else - shift -= 4; - } - if (shift != 4) - *dp = (png_byte)d; - - break; - } - - default: - { - png_bytep sp; - png_bytep dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - png_size_t pixel_bytes; - - /* Start at the beginning */ - dp = row; - - /* Find out how many bytes each pixel takes up */ - pixel_bytes = (row_info->pixel_depth >> 3); - - /* Loop through the row, only looking at the pixels that matter */ - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - /* Find out where the original pixel is */ - sp = row + (png_size_t)i * pixel_bytes; - - /* Move the pixel */ - if (dp != sp) - memcpy(dp, sp, pixel_bytes); - - /* Next pixel */ - dp += pixel_bytes; - } - break; - } - } - /* Set new row width */ - row_info->width = (row_info->width + - png_pass_inc[pass] - 1 - - png_pass_start[pass]) / - png_pass_inc[pass]; - - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_info->width); - } -} -#endif - - -/* This filters the row, chooses which filter to use, if it has not already - * been specified by the application, and then writes the row out with the - * chosen filter. - */ -static void /* PRIVATE */ -png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row, - png_size_t row_bytes); - -#ifdef PNG_WRITE_FILTER_SUPPORTED -static png_size_t /* PRIVATE */ -png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp, - const png_size_t row_bytes, const png_size_t lmins) -{ - png_bytep rp, dp, lp; - png_size_t i; - png_size_t sum = 0; - unsigned int v; - - png_ptr->try_row[0] = PNG_FILTER_VALUE_SUB; - - for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1; i < bpp; - i++, rp++, dp++) - { - v = *dp = *rp; -#ifdef PNG_USE_ABS - sum += 128 - abs((int)v - 128); -#else - sum += (v < 128) ? v : 256 - v; -#endif - } - - for (lp = png_ptr->row_buf + 1; i < row_bytes; - i++, rp++, lp++, dp++) - { - v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); -#ifdef PNG_USE_ABS - sum += 128 - abs((int)v - 128); -#else - sum += (v < 128) ? v : 256 - v; -#endif - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - - return (sum); -} - -static void /* PRIVATE */ -png_setup_sub_row_only(png_structrp png_ptr, const png_uint_32 bpp, - const png_size_t row_bytes) -{ - png_bytep rp, dp, lp; - png_size_t i; - - png_ptr->try_row[0] = PNG_FILTER_VALUE_SUB; - - for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1; i < bpp; - i++, rp++, dp++) - { - *dp = *rp; - } - - for (lp = png_ptr->row_buf + 1; i < row_bytes; - i++, rp++, lp++, dp++) - { - *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); - } -} - -static png_size_t /* PRIVATE */ -png_setup_up_row(png_structrp png_ptr, const png_size_t row_bytes, - const png_size_t lmins) -{ - png_bytep rp, dp, pp; - png_size_t i; - png_size_t sum = 0; - unsigned int v; - - png_ptr->try_row[0] = PNG_FILTER_VALUE_UP; - - for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, - pp = png_ptr->prev_row + 1; i < row_bytes; - i++, rp++, pp++, dp++) - { - v = *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff); -#ifdef PNG_USE_ABS - sum += 128 - abs((int)v - 128); -#else - sum += (v < 128) ? v : 256 - v; -#endif - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - - return (sum); -} -static void /* PRIVATE */ -png_setup_up_row_only(png_structrp png_ptr, const png_size_t row_bytes) -{ - png_bytep rp, dp, pp; - png_size_t i; - - png_ptr->try_row[0] = PNG_FILTER_VALUE_UP; - - for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, - pp = png_ptr->prev_row + 1; i < row_bytes; - i++, rp++, pp++, dp++) - { - *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff); - } -} - -static png_size_t /* PRIVATE */ -png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp, - const png_size_t row_bytes, const png_size_t lmins) -{ - png_bytep rp, dp, pp, lp; - png_uint_32 i; - png_size_t sum = 0; - unsigned int v; - - png_ptr->try_row[0] = PNG_FILTER_VALUE_AVG; - - for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, - pp = png_ptr->prev_row + 1; i < bpp; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); - -#ifdef PNG_USE_ABS - sum += 128 - abs((int)v - 128); -#else - sum += (v < 128) ? v : 256 - v; -#endif - } - - for (lp = png_ptr->row_buf + 1; i < row_bytes; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) - & 0xff); - -#ifdef PNG_USE_ABS - sum += 128 - abs((int)v - 128); -#else - sum += (v < 128) ? v : 256 - v; -#endif - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - - return (sum); -} -static void /* PRIVATE */ -png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp, - const png_size_t row_bytes) -{ - png_bytep rp, dp, pp, lp; - png_uint_32 i; - - png_ptr->try_row[0] = PNG_FILTER_VALUE_AVG; - - for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, - pp = png_ptr->prev_row + 1; i < bpp; i++) - { - *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); - } - - for (lp = png_ptr->row_buf + 1; i < row_bytes; i++) - { - *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) - & 0xff); - } -} - -static png_size_t /* PRIVATE */ -png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp, - const png_size_t row_bytes, const png_size_t lmins) -{ - png_bytep rp, dp, pp, cp, lp; - png_size_t i; - png_size_t sum = 0; - unsigned int v; - - png_ptr->try_row[0] = PNG_FILTER_VALUE_PAETH; - - for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, - pp = png_ptr->prev_row + 1; i < bpp; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - -#ifdef PNG_USE_ABS - sum += 128 - abs((int)v - 128); -#else - sum += (v < 128) ? v : 256 - v; -#endif - } - - for (lp = png_ptr->row_buf + 1, cp = png_ptr->prev_row + 1; i < row_bytes; - i++) - { - int a, b, c, pa, pb, pc, p; - - b = *pp++; - c = *cp++; - a = *lp++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - - v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); - -#ifdef PNG_USE_ABS - sum += 128 - abs((int)v - 128); -#else - sum += (v < 128) ? v : 256 - v; -#endif - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - - return (sum); -} -static void /* PRIVATE */ -png_setup_paeth_row_only(png_structrp png_ptr, const png_uint_32 bpp, - const png_size_t row_bytes) -{ - png_bytep rp, dp, pp, cp, lp; - png_size_t i; - - png_ptr->try_row[0] = PNG_FILTER_VALUE_PAETH; - - for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, - pp = png_ptr->prev_row + 1; i < bpp; i++) - { - *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - } - - for (lp = png_ptr->row_buf + 1, cp = png_ptr->prev_row + 1; i < row_bytes; - i++) - { - int a, b, c, pa, pb, pc, p; - - b = *pp++; - c = *cp++; - a = *lp++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - - *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); - } -} -#endif /* WRITE_FILTER */ - -void /* PRIVATE */ -png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) -{ -#ifndef PNG_WRITE_FILTER_SUPPORTED - png_write_filtered_row(png_ptr, png_ptr->row_buf, row_info->rowbytes+1); -#else - unsigned int filter_to_do = png_ptr->do_filter; - png_bytep row_buf; - png_bytep best_row; - png_uint_32 bpp; - png_size_t mins; - png_size_t row_bytes = row_info->rowbytes; - - png_debug(1, "in png_write_find_filter"); - - /* Find out how many bytes offset each pixel is */ - bpp = (row_info->pixel_depth + 7) >> 3; - - row_buf = png_ptr->row_buf; - mins = PNG_SIZE_MAX - 256/* so we can detect potential overflow of the - running sum */; - - /* The prediction method we use is to find which method provides the - * smallest value when summing the absolute values of the distances - * from zero, using anything >= 128 as negative numbers. This is known - * as the "minimum sum of absolute differences" heuristic. Other - * heuristics are the "weighted minimum sum of absolute differences" - * (experimental and can in theory improve compression), and the "zlib - * predictive" method (not implemented yet), which does test compressions - * of lines using different filter methods, and then chooses the - * (series of) filter(s) that give minimum compressed data size (VERY - * computationally expensive). - * - * GRR 980525: consider also - * - * (1) minimum sum of absolute differences from running average (i.e., - * keep running sum of non-absolute differences & count of bytes) - * [track dispersion, too? restart average if dispersion too large?] - * - * (1b) minimum sum of absolute differences from sliding average, probably - * with window size <= deflate window (usually 32K) - * - * (2) minimum sum of squared differences from zero or running average - * (i.e., ~ root-mean-square approach) - */ - - - /* We don't need to test the 'no filter' case if this is the only filter - * that has been chosen, as it doesn't actually do anything to the data. - */ - best_row = png_ptr->row_buf; - - if (PNG_SIZE_MAX/128 <= row_bytes) - { - /* Overflow can occur in the calculation, just select the lowest set - * filter. - */ - filter_to_do &= 0U-filter_to_do; - } - else if ((filter_to_do & PNG_FILTER_NONE) != 0 && - filter_to_do != PNG_FILTER_NONE) - { - /* Overflow not possible and multiple filters in the list, including the - * 'none' filter. - */ - png_bytep rp; - png_size_t sum = 0; - png_size_t i; - unsigned int v; - - { - for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++) - { - v = *rp; -#ifdef PNG_USE_ABS - sum += 128 - abs((int)v - 128); -#else - sum += (v < 128) ? v : 256 - v; -#endif - } - } - - mins = sum; - } - - /* Sub filter */ - if (filter_to_do == PNG_FILTER_SUB) - /* It's the only filter so no testing is needed */ - { - png_setup_sub_row_only(png_ptr, bpp, row_bytes); - best_row = png_ptr->try_row; - } - - else if ((filter_to_do & PNG_FILTER_SUB) != 0) - { - png_size_t sum; - png_size_t lmins = mins; - - sum = png_setup_sub_row(png_ptr, bpp, row_bytes, lmins); - - if (sum < mins) - { - mins = sum; - best_row = png_ptr->try_row; - if (png_ptr->tst_row != NULL) - { - png_ptr->try_row = png_ptr->tst_row; - png_ptr->tst_row = best_row; - } - } - } - - /* Up filter */ - if (filter_to_do == PNG_FILTER_UP) - { - png_setup_up_row_only(png_ptr, row_bytes); - best_row = png_ptr->try_row; - } - - else if ((filter_to_do & PNG_FILTER_UP) != 0) - { - png_size_t sum; - png_size_t lmins = mins; - - sum = png_setup_up_row(png_ptr, row_bytes, lmins); - - if (sum < mins) - { - mins = sum; - best_row = png_ptr->try_row; - if (png_ptr->tst_row != NULL) - { - png_ptr->try_row = png_ptr->tst_row; - png_ptr->tst_row = best_row; - } - } - } - - /* Avg filter */ - if (filter_to_do == PNG_FILTER_AVG) - { - png_setup_avg_row_only(png_ptr, bpp, row_bytes); - best_row = png_ptr->try_row; - } - - else if ((filter_to_do & PNG_FILTER_AVG) != 0) - { - png_size_t sum; - png_size_t lmins = mins; - - sum= png_setup_avg_row(png_ptr, bpp, row_bytes, lmins); - - if (sum < mins) - { - mins = sum; - best_row = png_ptr->try_row; - if (png_ptr->tst_row != NULL) - { - png_ptr->try_row = png_ptr->tst_row; - png_ptr->tst_row = best_row; - } - } - } - - /* Paeth filter */ - if (filter_to_do == PNG_FILTER_PAETH) - { - png_setup_paeth_row_only(png_ptr, bpp, row_bytes); - best_row = png_ptr->try_row; - } - - else if ((filter_to_do & PNG_FILTER_PAETH) != 0) - { - png_size_t sum; - png_size_t lmins = mins; - - sum = png_setup_paeth_row(png_ptr, bpp, row_bytes, lmins); - - if (sum < mins) - { - best_row = png_ptr->try_row; - if (png_ptr->tst_row != NULL) - { - png_ptr->try_row = png_ptr->tst_row; - png_ptr->tst_row = best_row; - } - } - } - - /* Do the actual writing of the filtered row data from the chosen filter. */ - png_write_filtered_row(png_ptr, best_row, row_info->rowbytes+1); - -#endif /* WRITE_FILTER */ -} - - -/* Do the actual writing of a previously filtered row. */ -static void -png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row, - png_size_t full_row_length/*includes filter byte*/) -{ - png_debug(1, "in png_write_filtered_row"); - - png_debug1(2, "filter = %d", filtered_row[0]); - - png_compress_IDAT(png_ptr, filtered_row, full_row_length, Z_NO_FLUSH); - -#ifdef PNG_WRITE_FILTER_SUPPORTED - /* Swap the current and previous rows */ - if (png_ptr->prev_row != NULL) - { - png_bytep tptr; - - tptr = png_ptr->prev_row; - png_ptr->prev_row = png_ptr->row_buf; - png_ptr->row_buf = tptr; - } -#endif /* WRITE_FILTER */ - - /* Finish row - updates counters and flushes zlib if last row */ - png_write_finish_row(png_ptr); - -#ifdef PNG_WRITE_FLUSH_SUPPORTED - png_ptr->flush_rows++; - - if (png_ptr->flush_dist > 0 && - png_ptr->flush_rows >= png_ptr->flush_dist) - { - png_write_flush(png_ptr); - } -#endif /* WRITE_FLUSH */ -} -#endif /* WRITE */ diff --git a/jan/src/dep/libs/zlib/_fba_zlib_v1211.txt b/jan/src/dep/libs/zlib/_fba_zlib_v1211.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/jan/src/dep/libs/zlib/adler32.c b/jan/src/dep/libs/zlib/adler32.c deleted file mode 100644 index d0be4380a..000000000 --- a/jan/src/dep/libs/zlib/adler32.c +++ /dev/null @@ -1,186 +0,0 @@ -/* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2011, 2016 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#include "zutil.h" - -local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); - -#define BASE 65521U /* largest prime smaller than 65536 */ -#define NMAX 5552 -/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ - -#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} -#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); -#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); -#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); -#define DO16(buf) DO8(buf,0); DO8(buf,8); - -/* use NO_DIVIDE if your processor does not do division in hardware -- - try it both ways to see which is faster */ -#ifdef NO_DIVIDE -/* note that this assumes BASE is 65521, where 65536 % 65521 == 15 - (thank you to John Reiser for pointing this out) */ -# define CHOP(a) \ - do { \ - unsigned long tmp = a >> 16; \ - a &= 0xffffUL; \ - a += (tmp << 4) - tmp; \ - } while (0) -# define MOD28(a) \ - do { \ - CHOP(a); \ - if (a >= BASE) a -= BASE; \ - } while (0) -# define MOD(a) \ - do { \ - CHOP(a); \ - MOD28(a); \ - } while (0) -# define MOD63(a) \ - do { /* this assumes a is not negative */ \ - z_off64_t tmp = a >> 32; \ - a &= 0xffffffffL; \ - a += (tmp << 8) - (tmp << 5) + tmp; \ - tmp = a >> 16; \ - a &= 0xffffL; \ - a += (tmp << 4) - tmp; \ - tmp = a >> 16; \ - a &= 0xffffL; \ - a += (tmp << 4) - tmp; \ - if (a >= BASE) a -= BASE; \ - } while (0) -#else -# define MOD(a) a %= BASE -# define MOD28(a) a %= BASE -# define MOD63(a) a %= BASE -#endif - -/* ========================================================================= */ -uLong ZEXPORT adler32_z(adler, buf, len) - uLong adler; - const Bytef *buf; - z_size_t len; -{ - unsigned long sum2; - unsigned n; - - /* split Adler-32 into component sums */ - sum2 = (adler >> 16) & 0xffff; - adler &= 0xffff; - - /* in case user likes doing a byte at a time, keep it fast */ - if (len == 1) { - adler += buf[0]; - if (adler >= BASE) - adler -= BASE; - sum2 += adler; - if (sum2 >= BASE) - sum2 -= BASE; - return adler | (sum2 << 16); - } - - /* initial Adler-32 value (deferred check for len == 1 speed) */ - if (buf == Z_NULL) - return 1L; - - /* in case short lengths are provided, keep it somewhat fast */ - if (len < 16) { - while (len--) { - adler += *buf++; - sum2 += adler; - } - if (adler >= BASE) - adler -= BASE; - MOD28(sum2); /* only added so many BASE's */ - return adler | (sum2 << 16); - } - - /* do length NMAX blocks -- requires just one modulo operation */ - while (len >= NMAX) { - len -= NMAX; - n = NMAX / 16; /* NMAX is divisible by 16 */ - do { - DO16(buf); /* 16 sums unrolled */ - buf += 16; - } while (--n); - MOD(adler); - MOD(sum2); - } - - /* do remaining bytes (less than NMAX, still just one modulo) */ - if (len) { /* avoid modulos if none remaining */ - while (len >= 16) { - len -= 16; - DO16(buf); - buf += 16; - } - while (len--) { - adler += *buf++; - sum2 += adler; - } - MOD(adler); - MOD(sum2); - } - - /* return recombined sums */ - return adler | (sum2 << 16); -} - -/* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; -{ - return adler32_z(adler, buf, len); -} - -/* ========================================================================= */ -local uLong adler32_combine_(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off64_t len2; -{ - unsigned long sum1; - unsigned long sum2; - unsigned rem; - - /* for negative len, return invalid adler32 as a clue for debugging */ - if (len2 < 0) - return 0xffffffffUL; - - /* the derivation of this formula is left as an exercise for the reader */ - MOD63(len2); /* assumes len2 >= 0 */ - rem = (unsigned)len2; - sum1 = adler1 & 0xffff; - sum2 = rem * sum1; - MOD(sum2); - sum1 += (adler2 & 0xffff) + BASE - 1; - sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; - if (sum1 >= BASE) sum1 -= BASE; - if (sum1 >= BASE) sum1 -= BASE; - if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1); - if (sum2 >= BASE) sum2 -= BASE; - return sum1 | (sum2 << 16); -} - -/* ========================================================================= */ -uLong ZEXPORT adler32_combine(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off_t len2; -{ - return adler32_combine_(adler1, adler2, len2); -} - -uLong ZEXPORT adler32_combine64(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off64_t len2; -{ - return adler32_combine_(adler1, adler2, len2); -} diff --git a/jan/src/dep/libs/zlib/compress.c b/jan/src/dep/libs/zlib/compress.c deleted file mode 100644 index e2db404ab..000000000 --- a/jan/src/dep/libs/zlib/compress.c +++ /dev/null @@ -1,86 +0,0 @@ -/* compress.c -- compress a memory buffer - * Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#define ZLIB_INTERNAL -#include "zlib.h" - -/* =========================================================================== - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least 0.1% larger than sourceLen plus - 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; - int level; -{ - z_stream stream; - int err; - const uInt max = (uInt)-1; - uLong left; - - left = *destLen; - *destLen = 0; - - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - stream.opaque = (voidpf)0; - - err = deflateInit(&stream, level); - if (err != Z_OK) return err; - - stream.next_out = dest; - stream.avail_out = 0; - stream.next_in = (z_const Bytef *)source; - stream.avail_in = 0; - - do { - if (stream.avail_out == 0) { - stream.avail_out = left > (uLong)max ? max : (uInt)left; - left -= stream.avail_out; - } - if (stream.avail_in == 0) { - stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen; - sourceLen -= stream.avail_in; - } - err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH); - } while (err == Z_OK); - - *destLen = stream.total_out; - deflateEnd(&stream); - return err == Z_STREAM_END ? Z_OK : err; -} - -/* =========================================================================== - */ -int ZEXPORT compress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ - return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); -} - -/* =========================================================================== - If the default memLevel or windowBits for deflateInit() is changed, then - this function needs to be updated. - */ -uLong ZEXPORT compressBound (sourceLen) - uLong sourceLen; -{ - return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + - (sourceLen >> 25) + 13; -} diff --git a/jan/src/dep/libs/zlib/crc32.c b/jan/src/dep/libs/zlib/crc32.c deleted file mode 100644 index 9580440c0..000000000 --- a/jan/src/dep/libs/zlib/crc32.c +++ /dev/null @@ -1,442 +0,0 @@ -/* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Thanks to Rodney Brown for his contribution of faster - * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing - * tables for updating the shift register in one step with three exclusive-ors - * instead of four steps with four exclusive-ors. This results in about a - * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. - */ - -/* @(#) $Id$ */ - -/* - Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore - protection on the static variables used to control the first-use generation - of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should - first call get_crc_table() to initialize the tables before allowing more than - one thread to use crc32(). - - DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h. - */ - -#ifdef MAKECRCH -# include -# ifndef DYNAMIC_CRC_TABLE -# define DYNAMIC_CRC_TABLE -# endif /* !DYNAMIC_CRC_TABLE */ -#endif /* MAKECRCH */ - -#include "zutil.h" /* for STDC and FAR definitions */ - -/* Definitions for doing the crc four data bytes at a time. */ -#if !defined(NOBYFOUR) && defined(Z_U4) -# define BYFOUR -#endif -#ifdef BYFOUR - local unsigned long crc32_little OF((unsigned long, - const unsigned char FAR *, z_size_t)); - local unsigned long crc32_big OF((unsigned long, - const unsigned char FAR *, z_size_t)); -# define TBLS 8 -#else -# define TBLS 1 -#endif /* BYFOUR */ - -/* Local functions for crc concatenation */ -local unsigned long gf2_matrix_times OF((unsigned long *mat, - unsigned long vec)); -local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); -local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2)); - - -#ifdef DYNAMIC_CRC_TABLE - -local volatile int crc_table_empty = 1; -local z_crc_t FAR crc_table[TBLS][256]; -local void make_crc_table OF((void)); -#ifdef MAKECRCH - local void write_table OF((FILE *, const z_crc_t FAR *)); -#endif /* MAKECRCH */ -/* - Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: - x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. - - Polynomials over GF(2) are represented in binary, one bit per coefficient, - with the lowest powers in the most significant bit. Then adding polynomials - is just exclusive-or, and multiplying a polynomial by x is a right shift by - one. If we call the above polynomial p, and represent a byte as the - polynomial q, also with the lowest power in the most significant bit (so the - byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, - where a mod b means the remainder after dividing a by b. - - This calculation is done using the shift-register method of multiplying and - taking the remainder. The register is initialized to zero, and for each - incoming bit, x^32 is added mod p to the register if the bit is a one (where - x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by - x (which is shifting right by one and adding x^32 mod p if the bit shifted - out is a one). We start with the highest power (least significant bit) of - q and repeat for all eight bits of q. - - The first table is simply the CRC of all possible eight bit values. This is - all the information needed to generate CRCs on data a byte at a time for all - combinations of CRC register values and incoming bytes. The remaining tables - allow for word-at-a-time CRC calculation for both big-endian and little- - endian machines, where a word is four bytes. -*/ -local void make_crc_table() -{ - z_crc_t c; - int n, k; - z_crc_t poly; /* polynomial exclusive-or pattern */ - /* terms of polynomial defining this crc (except x^32): */ - static volatile int first = 1; /* flag to limit concurrent making */ - static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - - /* See if another task is already doing this (not thread-safe, but better - than nothing -- significantly reduces duration of vulnerability in - case the advice about DYNAMIC_CRC_TABLE is ignored) */ - if (first) { - first = 0; - - /* make exclusive-or pattern from polynomial (0xedb88320UL) */ - poly = 0; - for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++) - poly |= (z_crc_t)1 << (31 - p[n]); - - /* generate a crc for every 8-bit value */ - for (n = 0; n < 256; n++) { - c = (z_crc_t)n; - for (k = 0; k < 8; k++) - c = c & 1 ? poly ^ (c >> 1) : c >> 1; - crc_table[0][n] = c; - } - -#ifdef BYFOUR - /* generate crc for each value followed by one, two, and three zeros, - and then the byte reversal of those as well as the first table */ - for (n = 0; n < 256; n++) { - c = crc_table[0][n]; - crc_table[4][n] = ZSWAP32(c); - for (k = 1; k < 4; k++) { - c = crc_table[0][c & 0xff] ^ (c >> 8); - crc_table[k][n] = c; - crc_table[k + 4][n] = ZSWAP32(c); - } - } -#endif /* BYFOUR */ - - crc_table_empty = 0; - } - else { /* not first */ - /* wait for the other guy to finish (not efficient, but rare) */ - while (crc_table_empty) - ; - } - -#ifdef MAKECRCH - /* write out CRC tables to crc32.h */ - { - FILE *out; - - out = fopen("crc32.h", "w"); - if (out == NULL) return; - fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); - fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); - fprintf(out, "local const z_crc_t FAR "); - fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); - write_table(out, crc_table[0]); -# ifdef BYFOUR - fprintf(out, "#ifdef BYFOUR\n"); - for (k = 1; k < 8; k++) { - fprintf(out, " },\n {\n"); - write_table(out, crc_table[k]); - } - fprintf(out, "#endif\n"); -# endif /* BYFOUR */ - fprintf(out, " }\n};\n"); - fclose(out); - } -#endif /* MAKECRCH */ -} - -#ifdef MAKECRCH -local void write_table(out, table) - FILE *out; - const z_crc_t FAR *table; -{ - int n; - - for (n = 0; n < 256; n++) - fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", - (unsigned long)(table[n]), - n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); -} -#endif /* MAKECRCH */ - -#else /* !DYNAMIC_CRC_TABLE */ -/* ======================================================================== - * Tables of CRC-32s of all single-byte values, made by make_crc_table(). - */ -#include "crc32.h" -#endif /* DYNAMIC_CRC_TABLE */ - -/* ========================================================================= - * This function can be used by asm versions of crc32() - */ -const z_crc_t FAR * ZEXPORT get_crc_table() -{ -#ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); -#endif /* DYNAMIC_CRC_TABLE */ - return (const z_crc_t FAR *)crc_table; -} - -/* ========================================================================= */ -#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) -#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 - -/* ========================================================================= */ -unsigned long ZEXPORT crc32_z(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - z_size_t len; -{ - if (buf == Z_NULL) return 0UL; - -#ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); -#endif /* DYNAMIC_CRC_TABLE */ - -#ifdef BYFOUR - if (sizeof(void *) == sizeof(ptrdiff_t)) { - z_crc_t endian; - - endian = 1; - if (*((unsigned char *)(&endian))) - return crc32_little(crc, buf, len); - else - return crc32_big(crc, buf, len); - } -#endif /* BYFOUR */ - crc = crc ^ 0xffffffffUL; - while (len >= 8) { - DO8; - len -= 8; - } - if (len) do { - DO1; - } while (--len); - return crc ^ 0xffffffffUL; -} - -/* ========================================================================= */ -unsigned long ZEXPORT crc32(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - uInt len; -{ - return crc32_z(crc, buf, len); -} - -#ifdef BYFOUR - -/* - This BYFOUR code accesses the passed unsigned char * buffer with a 32-bit - integer pointer type. This violates the strict aliasing rule, where a - compiler can assume, for optimization purposes, that two pointers to - fundamentally different types won't ever point to the same memory. This can - manifest as a problem only if one of the pointers is written to. This code - only reads from those pointers. So long as this code remains isolated in - this compilation unit, there won't be a problem. For this reason, this code - should not be copied and pasted into a compilation unit in which other code - writes to the buffer that is passed to these routines. - */ - -/* ========================================================================= */ -#define DOLIT4 c ^= *buf4++; \ - c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ - crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] -#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 - -/* ========================================================================= */ -local unsigned long crc32_little(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - z_size_t len; -{ - register z_crc_t c; - register const z_crc_t FAR *buf4; - - c = (z_crc_t)crc; - c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); - len--; - } - - buf4 = (const z_crc_t FAR *)(const void FAR *)buf; - while (len >= 32) { - DOLIT32; - len -= 32; - } - while (len >= 4) { - DOLIT4; - len -= 4; - } - buf = (const unsigned char FAR *)buf4; - - if (len) do { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); - } while (--len); - c = ~c; - return (unsigned long)c; -} - -/* ========================================================================= */ -#define DOBIG4 c ^= *buf4++; \ - c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ - crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] -#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 - -/* ========================================================================= */ -local unsigned long crc32_big(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - z_size_t len; -{ - register z_crc_t c; - register const z_crc_t FAR *buf4; - - c = ZSWAP32((z_crc_t)crc); - c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { - c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); - len--; - } - - buf4 = (const z_crc_t FAR *)(const void FAR *)buf; - while (len >= 32) { - DOBIG32; - len -= 32; - } - while (len >= 4) { - DOBIG4; - len -= 4; - } - buf = (const unsigned char FAR *)buf4; - - if (len) do { - c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); - } while (--len); - c = ~c; - return (unsigned long)(ZSWAP32(c)); -} - -#endif /* BYFOUR */ - -#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ - -/* ========================================================================= */ -local unsigned long gf2_matrix_times(mat, vec) - unsigned long *mat; - unsigned long vec; -{ - unsigned long sum; - - sum = 0; - while (vec) { - if (vec & 1) - sum ^= *mat; - vec >>= 1; - mat++; - } - return sum; -} - -/* ========================================================================= */ -local void gf2_matrix_square(square, mat) - unsigned long *square; - unsigned long *mat; -{ - int n; - - for (n = 0; n < GF2_DIM; n++) - square[n] = gf2_matrix_times(mat, mat[n]); -} - -/* ========================================================================= */ -local uLong crc32_combine_(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off64_t len2; -{ - int n; - unsigned long row; - unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */ - unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */ - - /* degenerate case (also disallow negative lengths) */ - if (len2 <= 0) - return crc1; - - /* put operator for one zero bit in odd */ - odd[0] = 0xedb88320UL; /* CRC-32 polynomial */ - row = 1; - for (n = 1; n < GF2_DIM; n++) { - odd[n] = row; - row <<= 1; - } - - /* put operator for two zero bits in even */ - gf2_matrix_square(even, odd); - - /* put operator for four zero bits in odd */ - gf2_matrix_square(odd, even); - - /* apply len2 zeros to crc1 (first square will put the operator for one - zero byte, eight zero bits, in even) */ - do { - /* apply zeros operator for this bit of len2 */ - gf2_matrix_square(even, odd); - if (len2 & 1) - crc1 = gf2_matrix_times(even, crc1); - len2 >>= 1; - - /* if no more bits set, then done */ - if (len2 == 0) - break; - - /* another iteration of the loop with odd and even swapped */ - gf2_matrix_square(odd, even); - if (len2 & 1) - crc1 = gf2_matrix_times(odd, crc1); - len2 >>= 1; - - /* if no more bits set, then done */ - } while (len2 != 0); - - /* return combined crc */ - crc1 ^= crc2; - return crc1; -} - -/* ========================================================================= */ -uLong ZEXPORT crc32_combine(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off_t len2; -{ - return crc32_combine_(crc1, crc2, len2); -} - -uLong ZEXPORT crc32_combine64(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off64_t len2; -{ - return crc32_combine_(crc1, crc2, len2); -} diff --git a/jan/src/dep/libs/zlib/crc32.h b/jan/src/dep/libs/zlib/crc32.h deleted file mode 100644 index 9e0c77810..000000000 --- a/jan/src/dep/libs/zlib/crc32.h +++ /dev/null @@ -1,441 +0,0 @@ -/* crc32.h -- tables for rapid CRC calculation - * Generated automatically by crc32.c - */ - -local const z_crc_t FAR crc_table[TBLS][256] = -{ - { - 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, - 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, - 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, - 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, - 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, - 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, - 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, - 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, - 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, - 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, - 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, - 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, - 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, - 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, - 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, - 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, - 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, - 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, - 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, - 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, - 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, - 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, - 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, - 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, - 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, - 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, - 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, - 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, - 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, - 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, - 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, - 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, - 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, - 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, - 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, - 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, - 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, - 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, - 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, - 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, - 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, - 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, - 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, - 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, - 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, - 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, - 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, - 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, - 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, - 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, - 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, - 0x2d02ef8dUL -#ifdef BYFOUR - }, - { - 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL, - 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL, - 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL, - 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL, - 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL, - 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL, - 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL, - 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL, - 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL, - 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL, - 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL, - 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL, - 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL, - 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL, - 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL, - 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL, - 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL, - 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL, - 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL, - 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL, - 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL, - 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL, - 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL, - 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL, - 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL, - 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL, - 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL, - 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL, - 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL, - 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL, - 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL, - 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL, - 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL, - 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL, - 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL, - 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL, - 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL, - 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL, - 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL, - 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL, - 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL, - 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL, - 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL, - 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL, - 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL, - 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL, - 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL, - 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL, - 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL, - 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL, - 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL, - 0x9324fd72UL - }, - { - 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL, - 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL, - 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL, - 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL, - 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL, - 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL, - 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL, - 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL, - 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL, - 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL, - 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL, - 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL, - 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL, - 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL, - 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL, - 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL, - 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL, - 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL, - 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL, - 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL, - 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL, - 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL, - 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL, - 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL, - 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL, - 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL, - 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL, - 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL, - 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL, - 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL, - 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL, - 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL, - 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL, - 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL, - 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL, - 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL, - 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL, - 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL, - 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL, - 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL, - 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL, - 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL, - 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL, - 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL, - 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL, - 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL, - 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL, - 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL, - 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL, - 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL, - 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL, - 0xbe9834edUL - }, - { - 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL, - 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL, - 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL, - 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL, - 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL, - 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL, - 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL, - 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL, - 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL, - 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL, - 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL, - 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL, - 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL, - 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL, - 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL, - 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL, - 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL, - 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL, - 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL, - 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL, - 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL, - 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL, - 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL, - 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL, - 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL, - 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL, - 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL, - 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL, - 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL, - 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL, - 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL, - 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL, - 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL, - 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL, - 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL, - 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL, - 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL, - 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL, - 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL, - 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL, - 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL, - 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL, - 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL, - 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL, - 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL, - 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL, - 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL, - 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL, - 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL, - 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, - 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, - 0xde0506f1UL - }, - { - 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, - 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL, - 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL, - 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL, - 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL, - 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL, - 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL, - 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL, - 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL, - 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL, - 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL, - 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL, - 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL, - 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL, - 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL, - 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL, - 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL, - 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL, - 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL, - 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL, - 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL, - 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL, - 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL, - 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL, - 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL, - 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL, - 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL, - 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL, - 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL, - 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL, - 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL, - 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL, - 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL, - 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL, - 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL, - 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL, - 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL, - 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL, - 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL, - 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL, - 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL, - 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL, - 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL, - 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL, - 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL, - 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL, - 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL, - 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL, - 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL, - 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL, - 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL, - 0x8def022dUL - }, - { - 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL, - 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL, - 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL, - 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL, - 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL, - 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL, - 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL, - 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL, - 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL, - 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL, - 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL, - 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL, - 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL, - 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL, - 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL, - 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL, - 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL, - 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL, - 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL, - 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL, - 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL, - 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL, - 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL, - 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL, - 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL, - 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL, - 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL, - 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL, - 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL, - 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL, - 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL, - 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL, - 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL, - 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL, - 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL, - 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL, - 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL, - 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL, - 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL, - 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL, - 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL, - 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL, - 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL, - 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL, - 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL, - 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL, - 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL, - 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL, - 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL, - 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL, - 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL, - 0x72fd2493UL - }, - { - 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL, - 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL, - 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL, - 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL, - 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL, - 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL, - 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL, - 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL, - 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL, - 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL, - 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL, - 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL, - 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL, - 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL, - 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL, - 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL, - 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL, - 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL, - 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL, - 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL, - 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL, - 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL, - 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL, - 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL, - 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL, - 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL, - 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL, - 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL, - 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL, - 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL, - 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL, - 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL, - 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL, - 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL, - 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL, - 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL, - 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL, - 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL, - 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL, - 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL, - 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL, - 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL, - 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL, - 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL, - 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL, - 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL, - 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL, - 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL, - 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL, - 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL, - 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL, - 0xed3498beUL - }, - { - 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL, - 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL, - 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL, - 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL, - 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL, - 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL, - 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL, - 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL, - 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL, - 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL, - 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL, - 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL, - 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL, - 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL, - 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL, - 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL, - 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL, - 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL, - 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL, - 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL, - 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL, - 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL, - 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL, - 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL, - 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL, - 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL, - 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL, - 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL, - 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL, - 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL, - 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL, - 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL, - 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL, - 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL, - 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL, - 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL, - 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL, - 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL, - 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL, - 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL, - 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL, - 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL, - 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL, - 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL, - 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL, - 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL, - 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL, - 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL, - 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL, - 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, - 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, - 0xf10605deUL -#endif - } -}; diff --git a/jan/src/dep/libs/zlib/deflate.c b/jan/src/dep/libs/zlib/deflate.c deleted file mode 100644 index 1ec761448..000000000 --- a/jan/src/dep/libs/zlib/deflate.c +++ /dev/null @@ -1,2163 +0,0 @@ -/* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * ALGORITHM - * - * The "deflation" process depends on being able to identify portions - * of the input text which are identical to earlier input (within a - * sliding window trailing behind the input currently being processed). - * - * The most straightforward technique turns out to be the fastest for - * most input files: try all possible matches and select the longest. - * The key feature of this algorithm is that insertions into the string - * dictionary are very simple and thus fast, and deletions are avoided - * completely. Insertions are performed at each input character, whereas - * string matches are performed only when the previous match ends. So it - * is preferable to spend more time in matches to allow very fast string - * insertions and avoid deletions. The matching algorithm for small - * strings is inspired from that of Rabin & Karp. A brute force approach - * is used to find longer strings when a small match has been found. - * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze - * (by Leonid Broukhis). - * A previous version of this file used a more sophisticated algorithm - * (by Fiala and Greene) which is guaranteed to run in linear amortized - * time, but has a larger average cost, uses more memory and is patented. - * However the F&G algorithm may be faster for some highly redundant - * files if the parameter max_chain_length (described below) is too large. - * - * ACKNOWLEDGEMENTS - * - * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and - * I found it in 'freeze' written by Leonid Broukhis. - * Thanks to many people for bug reports and testing. - * - * REFERENCES - * - * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". - * Available in http://tools.ietf.org/html/rfc1951 - * - * A description of the Rabin and Karp algorithm is given in the book - * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. - * - * Fiala,E.R., and Greene,D.H. - * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 - * - */ - -/* @(#) $Id$ */ - -#include "deflate.h" - -const char deflate_copyright[] = - " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* =========================================================================== - * Function prototypes. - */ -typedef enum { - need_more, /* block not completed, need more input or more output */ - block_done, /* block flush performed */ - finish_started, /* finish started, need only more output at next deflate */ - finish_done /* finish done, accept no more input or output */ -} block_state; - -typedef block_state (*compress_func) OF((deflate_state *s, int flush)); -/* Compression function. Returns the block state after the call. */ - -local int deflateStateCheck OF((z_streamp strm)); -local void slide_hash OF((deflate_state *s)); -local void fill_window OF((deflate_state *s)); -local block_state deflate_stored OF((deflate_state *s, int flush)); -local block_state deflate_fast OF((deflate_state *s, int flush)); -#ifndef FASTEST -local block_state deflate_slow OF((deflate_state *s, int flush)); -#endif -local block_state deflate_rle OF((deflate_state *s, int flush)); -local block_state deflate_huff OF((deflate_state *s, int flush)); -local void lm_init OF((deflate_state *s)); -local void putShortMSB OF((deflate_state *s, uInt b)); -local void flush_pending OF((z_streamp strm)); -local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifdef ASMV -# pragma message("Assembler code may have bugs -- use at your own risk") - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else -local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif - -#ifdef ZLIB_DEBUG -local void check_match OF((deflate_state *s, IPos start, IPos match, - int length)); -#endif - -/* =========================================================================== - * Local data - */ - -#define NIL 0 -/* Tail of hash chains */ - -#ifndef TOO_FAR -# define TOO_FAR 4096 -#endif -/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ - -/* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ -typedef struct config_s { - ush good_length; /* reduce lazy search above this match length */ - ush max_lazy; /* do not perform lazy search above this match length */ - ush nice_length; /* quit search above this match length */ - ush max_chain; - compress_func func; -} config; - -#ifdef FASTEST -local const config configuration_table[2] = { -/* good lazy nice chain */ -/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ -/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */ -#else -local const config configuration_table[10] = { -/* good lazy nice chain */ -/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ -/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */ -/* 2 */ {4, 5, 16, 8, deflate_fast}, -/* 3 */ {4, 6, 32, 32, deflate_fast}, - -/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ -/* 5 */ {8, 16, 32, 32, deflate_slow}, -/* 6 */ {8, 16, 128, 128, deflate_slow}, -/* 7 */ {8, 32, 128, 256, deflate_slow}, -/* 8 */ {32, 128, 258, 1024, deflate_slow}, -/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */ -#endif - -/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 - * For deflate_fast() (levels <= 3) good is ignored and lazy has a different - * meaning. - */ - -/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ -#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0)) - -/* =========================================================================== - * Update a hash value with the given input byte - * IN assertion: all calls to UPDATE_HASH are made with consecutive input - * characters, so that a running hash key can be computed from the previous - * key instead of complete recalculation each time. - */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) - - -/* =========================================================================== - * Insert string str in the dictionary and set match_head to the previous head - * of the hash chain (the most recent string with same hash key). Return - * the previous length of the hash chain. - * If this file is compiled with -DFASTEST, the compression level is forced - * to 1, and no hash chains are maintained. - * IN assertion: all calls to INSERT_STRING are made with consecutive input - * characters and the first MIN_MATCH bytes of str are valid (except for - * the last MIN_MATCH-1 bytes of the input file). - */ -#ifdef FASTEST -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - match_head = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#else -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#endif - -/* =========================================================================== - * Initialize the hash table (avoiding 64K overflow for 16 bit systems). - * prev[] will be initialized on the fly. - */ -#define CLEAR_HASH(s) \ - s->head[s->hash_size-1] = NIL; \ - zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); - -/* =========================================================================== - * Slide the hash table when sliding the window down (could be avoided with 32 - * bit values at the expense of memory usage). We slide even when level == 0 to - * keep the hash table consistent if we switch back to level > 0 later. - */ -local void slide_hash(s) - deflate_state *s; -{ - unsigned n, m; - Posf *p; - uInt wsize = s->w_size; - - n = s->hash_size; - p = &s->head[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m - wsize : NIL); - } while (--n); - n = wsize; -#ifndef FASTEST - p = &s->prev[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m - wsize : NIL); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); -#endif -} - -/* ========================================================================= */ -int ZEXPORT deflateInit_(strm, level, version, stream_size) - z_streamp strm; - int level; - const char *version; - int stream_size; -{ - return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, - Z_DEFAULT_STRATEGY, version, stream_size); - /* To do: ignore strm->next_in if we use it as window */ -} - -/* ========================================================================= */ -int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, - version, stream_size) - z_streamp strm; - int level; - int method; - int windowBits; - int memLevel; - int strategy; - const char *version; - int stream_size; -{ - deflate_state *s; - int wrap = 1; - static const char my_version[] = ZLIB_VERSION; - - ushf *overlay; - /* We overlay pending_buf and d_buf+l_buf. This works since the average - * output size for (length,distance) codes is <= 24 bits. - */ - - if (version == Z_NULL || version[0] != my_version[0] || - stream_size != sizeof(z_stream)) { - return Z_VERSION_ERROR; - } - if (strm == Z_NULL) return Z_STREAM_ERROR; - - strm->msg = Z_NULL; - if (strm->zalloc == (alloc_func)0) { -#ifdef Z_SOLO - return Z_STREAM_ERROR; -#else - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; -#endif - } - if (strm->zfree == (free_func)0) -#ifdef Z_SOLO - return Z_STREAM_ERROR; -#else - strm->zfree = zcfree; -#endif - -#ifdef FASTEST - if (level != 0) level = 1; -#else - if (level == Z_DEFAULT_COMPRESSION) level = 6; -#endif - - if (windowBits < 0) { /* suppress zlib wrapper */ - wrap = 0; - windowBits = -windowBits; - } -#ifdef GZIP - else if (windowBits > 15) { - wrap = 2; /* write gzip wrapper instead */ - windowBits -= 16; - } -#endif - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || - windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) { - return Z_STREAM_ERROR; - } - if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ - s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); - if (s == Z_NULL) return Z_MEM_ERROR; - strm->state = (struct internal_state FAR *)s; - s->strm = strm; - s->status = INIT_STATE; /* to pass state test in deflateReset() */ - - s->wrap = wrap; - s->gzhead = Z_NULL; - s->w_bits = (uInt)windowBits; - s->w_size = 1 << s->w_bits; - s->w_mask = s->w_size - 1; - - s->hash_bits = (uInt)memLevel + 7; - s->hash_size = 1 << s->hash_bits; - s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); - - s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); - s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); - s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); - - s->high_water = 0; /* nothing written to s->window yet */ - - s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - - overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); - s->pending_buf = (uchf *) overlay; - s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); - - if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || - s->pending_buf == Z_NULL) { - s->status = FINISH_STATE; - strm->msg = ERR_MSG(Z_MEM_ERROR); - deflateEnd (strm); - return Z_MEM_ERROR; - } - s->d_buf = overlay + s->lit_bufsize/sizeof(ush); - s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; - - s->level = level; - s->strategy = strategy; - s->method = (Byte)method; - - return deflateReset(strm); -} - -/* ========================================================================= - * Check for a valid deflate stream state. Return 0 if ok, 1 if not. - */ -local int deflateStateCheck (strm) - z_streamp strm; -{ - deflate_state *s; - if (strm == Z_NULL || - strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) - return 1; - s = strm->state; - if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE && -#ifdef GZIP - s->status != GZIP_STATE && -#endif - s->status != EXTRA_STATE && - s->status != NAME_STATE && - s->status != COMMENT_STATE && - s->status != HCRC_STATE && - s->status != BUSY_STATE && - s->status != FINISH_STATE)) - return 1; - return 0; -} - -/* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) - z_streamp strm; - const Bytef *dictionary; - uInt dictLength; -{ - deflate_state *s; - uInt str, n; - int wrap; - unsigned avail; - z_const unsigned char *next; - - if (deflateStateCheck(strm) || dictionary == Z_NULL) - return Z_STREAM_ERROR; - s = strm->state; - wrap = s->wrap; - if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead) - return Z_STREAM_ERROR; - - /* when using zlib wrappers, compute Adler-32 for provided dictionary */ - if (wrap == 1) - strm->adler = adler32(strm->adler, dictionary, dictLength); - s->wrap = 0; /* avoid computing Adler-32 in read_buf */ - - /* if dictionary would fill window, just replace the history */ - if (dictLength >= s->w_size) { - if (wrap == 0) { /* already empty otherwise */ - CLEAR_HASH(s); - s->strstart = 0; - s->block_start = 0L; - s->insert = 0; - } - dictionary += dictLength - s->w_size; /* use the tail */ - dictLength = s->w_size; - } - - /* insert dictionary into window and hash */ - avail = strm->avail_in; - next = strm->next_in; - strm->avail_in = dictLength; - strm->next_in = (z_const Bytef *)dictionary; - fill_window(s); - while (s->lookahead >= MIN_MATCH) { - str = s->strstart; - n = s->lookahead - (MIN_MATCH-1); - do { - UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); -#ifndef FASTEST - s->prev[str & s->w_mask] = s->head[s->ins_h]; -#endif - s->head[s->ins_h] = (Pos)str; - str++; - } while (--n); - s->strstart = str; - s->lookahead = MIN_MATCH-1; - fill_window(s); - } - s->strstart += s->lookahead; - s->block_start = (long)s->strstart; - s->insert = s->lookahead; - s->lookahead = 0; - s->match_length = s->prev_length = MIN_MATCH-1; - s->match_available = 0; - strm->next_in = next; - strm->avail_in = avail; - s->wrap = wrap; - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) - z_streamp strm; - Bytef *dictionary; - uInt *dictLength; -{ - deflate_state *s; - uInt len; - - if (deflateStateCheck(strm)) - return Z_STREAM_ERROR; - s = strm->state; - len = s->strstart + s->lookahead; - if (len > s->w_size) - len = s->w_size; - if (dictionary != Z_NULL && len) - zmemcpy(dictionary, s->window + s->strstart + s->lookahead - len, len); - if (dictLength != Z_NULL) - *dictLength = len; - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateResetKeep (strm) - z_streamp strm; -{ - deflate_state *s; - - if (deflateStateCheck(strm)) { - return Z_STREAM_ERROR; - } - - strm->total_in = strm->total_out = 0; - strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ - strm->data_type = Z_UNKNOWN; - - s = (deflate_state *)strm->state; - s->pending = 0; - s->pending_out = s->pending_buf; - - if (s->wrap < 0) { - s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ - } - s->status = -#ifdef GZIP - s->wrap == 2 ? GZIP_STATE : -#endif - s->wrap ? INIT_STATE : BUSY_STATE; - strm->adler = -#ifdef GZIP - s->wrap == 2 ? crc32(0L, Z_NULL, 0) : -#endif - adler32(0L, Z_NULL, 0); - s->last_flush = Z_NO_FLUSH; - - _tr_init(s); - - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateReset (strm) - z_streamp strm; -{ - int ret; - - ret = deflateResetKeep(strm); - if (ret == Z_OK) - lm_init(strm->state); - return ret; -} - -/* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) - z_streamp strm; - gz_headerp head; -{ - if (deflateStateCheck(strm) || strm->state->wrap != 2) - return Z_STREAM_ERROR; - strm->state->gzhead = head; - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflatePending (strm, pending, bits) - unsigned *pending; - int *bits; - z_streamp strm; -{ - if (deflateStateCheck(strm)) return Z_STREAM_ERROR; - if (pending != Z_NULL) - *pending = strm->state->pending; - if (bits != Z_NULL) - *bits = strm->state->bi_valid; - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) - z_streamp strm; - int bits; - int value; -{ - deflate_state *s; - int put; - - if (deflateStateCheck(strm)) return Z_STREAM_ERROR; - s = strm->state; - if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3)) - return Z_BUF_ERROR; - do { - put = Buf_size - s->bi_valid; - if (put > bits) - put = bits; - s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid); - s->bi_valid += put; - _tr_flush_bits(s); - value >>= put; - bits -= put; - } while (bits); - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateParams(strm, level, strategy) - z_streamp strm; - int level; - int strategy; -{ - deflate_state *s; - compress_func func; - - if (deflateStateCheck(strm)) return Z_STREAM_ERROR; - s = strm->state; - -#ifdef FASTEST - if (level != 0) level = 1; -#else - if (level == Z_DEFAULT_COMPRESSION) level = 6; -#endif - if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { - return Z_STREAM_ERROR; - } - func = configuration_table[s->level].func; - - if ((strategy != s->strategy || func != configuration_table[level].func) && - s->high_water) { - /* Flush the last buffer: */ - int err = deflate(strm, Z_BLOCK); - if (err == Z_STREAM_ERROR) - return err; - if (strm->avail_out == 0) - return Z_BUF_ERROR; - } - if (s->level != level) { - if (s->level == 0 && s->matches != 0) { - if (s->matches == 1) - slide_hash(s); - else - CLEAR_HASH(s); - s->matches = 0; - } - s->level = level; - s->max_lazy_match = configuration_table[level].max_lazy; - s->good_match = configuration_table[level].good_length; - s->nice_match = configuration_table[level].nice_length; - s->max_chain_length = configuration_table[level].max_chain; - } - s->strategy = strategy; - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) - z_streamp strm; - int good_length; - int max_lazy; - int nice_length; - int max_chain; -{ - deflate_state *s; - - if (deflateStateCheck(strm)) return Z_STREAM_ERROR; - s = strm->state; - s->good_match = (uInt)good_length; - s->max_lazy_match = (uInt)max_lazy; - s->nice_match = nice_length; - s->max_chain_length = (uInt)max_chain; - return Z_OK; -} - -/* ========================================================================= - * For the default windowBits of 15 and memLevel of 8, this function returns - * a close to exact, as well as small, upper bound on the compressed size. - * They are coded as constants here for a reason--if the #define's are - * changed, then this function needs to be changed as well. The return - * value for 15 and 8 only works for those exact settings. - * - * For any setting other than those defaults for windowBits and memLevel, - * the value returned is a conservative worst case for the maximum expansion - * resulting from using fixed blocks instead of stored blocks, which deflate - * can emit on compressed data for some combinations of the parameters. - * - * This function could be more sophisticated to provide closer upper bounds for - * every combination of windowBits and memLevel. But even the conservative - * upper bound of about 14% expansion does not seem onerous for output buffer - * allocation. - */ -uLong ZEXPORT deflateBound(strm, sourceLen) - z_streamp strm; - uLong sourceLen; -{ - deflate_state *s; - uLong complen, wraplen; - - /* conservative upper bound for compressed data */ - complen = sourceLen + - ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; - - /* if can't get parameters, return conservative bound plus zlib wrapper */ - if (deflateStateCheck(strm)) - return complen + 6; - - /* compute wrapper length */ - s = strm->state; - switch (s->wrap) { - case 0: /* raw deflate */ - wraplen = 0; - break; - case 1: /* zlib wrapper */ - wraplen = 6 + (s->strstart ? 4 : 0); - break; -#ifdef GZIP - case 2: /* gzip wrapper */ - wraplen = 18; - if (s->gzhead != Z_NULL) { /* user-supplied gzip header */ - Bytef *str; - if (s->gzhead->extra != Z_NULL) - wraplen += 2 + s->gzhead->extra_len; - str = s->gzhead->name; - if (str != Z_NULL) - do { - wraplen++; - } while (*str++); - str = s->gzhead->comment; - if (str != Z_NULL) - do { - wraplen++; - } while (*str++); - if (s->gzhead->hcrc) - wraplen += 2; - } - break; -#endif - default: /* for compiler happiness */ - wraplen = 6; - } - - /* if not default parameters, return conservative bound */ - if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return complen + wraplen; - - /* default settings: return tight bound for that case */ - return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + - (sourceLen >> 25) + 13 - 6 + wraplen; -} - -/* ========================================================================= - * Put a short in the pending buffer. The 16-bit value is put in MSB order. - * IN assertion: the stream state is correct and there is enough room in - * pending_buf. - */ -local void putShortMSB (s, b) - deflate_state *s; - uInt b; -{ - put_byte(s, (Byte)(b >> 8)); - put_byte(s, (Byte)(b & 0xff)); -} - -/* ========================================================================= - * Flush as much pending output as possible. All deflate() output, except for - * some deflate_stored() output, goes through this function so some - * applications may wish to modify it to avoid allocating a large - * strm->next_out buffer and copying into it. (See also read_buf()). - */ -local void flush_pending(strm) - z_streamp strm; -{ - unsigned len; - deflate_state *s = strm->state; - - _tr_flush_bits(s); - len = s->pending; - if (len > strm->avail_out) len = strm->avail_out; - if (len == 0) return; - - zmemcpy(strm->next_out, s->pending_out, len); - strm->next_out += len; - s->pending_out += len; - strm->total_out += len; - strm->avail_out -= len; - s->pending -= len; - if (s->pending == 0) { - s->pending_out = s->pending_buf; - } -} - -/* =========================================================================== - * Update the header CRC with the bytes s->pending_buf[beg..s->pending - 1]. - */ -#define HCRC_UPDATE(beg) \ - do { \ - if (s->gzhead->hcrc && s->pending > (beg)) \ - strm->adler = crc32(strm->adler, s->pending_buf + (beg), \ - s->pending - (beg)); \ - } while (0) - -/* ========================================================================= */ -int ZEXPORT deflate (strm, flush) - z_streamp strm; - int flush; -{ - int old_flush; /* value of flush param for previous deflate call */ - deflate_state *s; - - if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) { - return Z_STREAM_ERROR; - } - s = strm->state; - - if (strm->next_out == Z_NULL || - (strm->avail_in != 0 && strm->next_in == Z_NULL) || - (s->status == FINISH_STATE && flush != Z_FINISH)) { - ERR_RETURN(strm, Z_STREAM_ERROR); - } - if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); - - old_flush = s->last_flush; - s->last_flush = flush; - - /* Flush as much pending output as possible */ - if (s->pending != 0) { - flush_pending(strm); - if (strm->avail_out == 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ - s->last_flush = -1; - return Z_OK; - } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUF_ERROR. - */ - } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) && - flush != Z_FINISH) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s->status == FINISH_STATE && strm->avail_in != 0) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* Write the header */ - if (s->status == INIT_STATE) { - /* zlib header */ - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; - uInt level_flags; - - if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) - level_flags = 0; - else if (s->level < 6) - level_flags = 1; - else if (s->level == 6) - level_flags = 2; - else - level_flags = 3; - header |= (level_flags << 6); - if (s->strstart != 0) header |= PRESET_DICT; - header += 31 - (header % 31); - - putShortMSB(s, header); - - /* Save the adler32 of the preset dictionary: */ - if (s->strstart != 0) { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - } - strm->adler = adler32(0L, Z_NULL, 0); - s->status = BUSY_STATE; - - /* Compression must start with an empty pending buffer */ - flush_pending(strm); - if (s->pending != 0) { - s->last_flush = -1; - return Z_OK; - } - } -#ifdef GZIP - if (s->status == GZIP_STATE) { - /* gzip header */ - strm->adler = crc32(0L, Z_NULL, 0); - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (s->gzhead == Z_NULL) { - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, OS_CODE); - s->status = BUSY_STATE; - - /* Compression must start with an empty pending buffer */ - flush_pending(strm); - if (s->pending != 0) { - s->last_flush = -1; - return Z_OK; - } - } - else { - put_byte(s, (s->gzhead->text ? 1 : 0) + - (s->gzhead->hcrc ? 2 : 0) + - (s->gzhead->extra == Z_NULL ? 0 : 4) + - (s->gzhead->name == Z_NULL ? 0 : 8) + - (s->gzhead->comment == Z_NULL ? 0 : 16) - ); - put_byte(s, (Byte)(s->gzhead->time & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, s->gzhead->os & 0xff); - if (s->gzhead->extra != Z_NULL) { - put_byte(s, s->gzhead->extra_len & 0xff); - put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); - } - if (s->gzhead->hcrc) - strm->adler = crc32(strm->adler, s->pending_buf, - s->pending); - s->gzindex = 0; - s->status = EXTRA_STATE; - } - } - if (s->status == EXTRA_STATE) { - if (s->gzhead->extra != Z_NULL) { - ulg beg = s->pending; /* start of bytes to update crc */ - uInt left = (s->gzhead->extra_len & 0xffff) - s->gzindex; - while (s->pending + left > s->pending_buf_size) { - uInt copy = s->pending_buf_size - s->pending; - zmemcpy(s->pending_buf + s->pending, - s->gzhead->extra + s->gzindex, copy); - s->pending = s->pending_buf_size; - HCRC_UPDATE(beg); - s->gzindex += copy; - flush_pending(strm); - if (s->pending != 0) { - s->last_flush = -1; - return Z_OK; - } - beg = 0; - left -= copy; - } - zmemcpy(s->pending_buf + s->pending, - s->gzhead->extra + s->gzindex, left); - s->pending += left; - HCRC_UPDATE(beg); - s->gzindex = 0; - } - s->status = NAME_STATE; - } - if (s->status == NAME_STATE) { - if (s->gzhead->name != Z_NULL) { - ulg beg = s->pending; /* start of bytes to update crc */ - int val; - do { - if (s->pending == s->pending_buf_size) { - HCRC_UPDATE(beg); - flush_pending(strm); - if (s->pending != 0) { - s->last_flush = -1; - return Z_OK; - } - beg = 0; - } - val = s->gzhead->name[s->gzindex++]; - put_byte(s, val); - } while (val != 0); - HCRC_UPDATE(beg); - s->gzindex = 0; - } - s->status = COMMENT_STATE; - } - if (s->status == COMMENT_STATE) { - if (s->gzhead->comment != Z_NULL) { - ulg beg = s->pending; /* start of bytes to update crc */ - int val; - do { - if (s->pending == s->pending_buf_size) { - HCRC_UPDATE(beg); - flush_pending(strm); - if (s->pending != 0) { - s->last_flush = -1; - return Z_OK; - } - beg = 0; - } - val = s->gzhead->comment[s->gzindex++]; - put_byte(s, val); - } while (val != 0); - HCRC_UPDATE(beg); - } - s->status = HCRC_STATE; - } - if (s->status == HCRC_STATE) { - if (s->gzhead->hcrc) { - if (s->pending + 2 > s->pending_buf_size) { - flush_pending(strm); - if (s->pending != 0) { - s->last_flush = -1; - return Z_OK; - } - } - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - strm->adler = crc32(0L, Z_NULL, 0); - } - s->status = BUSY_STATE; - - /* Compression must start with an empty pending buffer */ - flush_pending(strm); - if (s->pending != 0) { - s->last_flush = -1; - return Z_OK; - } - } -#endif - - /* Start a new block or continue the current one. - */ - if (strm->avail_in != 0 || s->lookahead != 0 || - (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { - block_state bstate; - - bstate = s->level == 0 ? deflate_stored(s, flush) : - s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : - s->strategy == Z_RLE ? deflate_rle(s, flush) : - (*(configuration_table[s->level].func))(s, flush); - - if (bstate == finish_started || bstate == finish_done) { - s->status = FINISH_STATE; - } - if (bstate == need_more || bstate == finish_started) { - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ - } - return Z_OK; - /* If flush != Z_NO_FLUSH && avail_out == 0, the next call - * of deflate should use the same flush parameter to make sure - * that the flush is complete. So we don't have to output an - * empty block here, this will be done at next call. This also - * ensures that for a very small output buffer, we emit at most - * one empty block. - */ - } - if (bstate == block_done) { - if (flush == Z_PARTIAL_FLUSH) { - _tr_align(s); - } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block(s, (char*)0, 0L, 0); - /* For a full flush, this empty block will be recognized - * as a special marker by inflate_sync(). - */ - if (flush == Z_FULL_FLUSH) { - CLEAR_HASH(s); /* forget history */ - if (s->lookahead == 0) { - s->strstart = 0; - s->block_start = 0L; - s->insert = 0; - } - } - } - flush_pending(strm); - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; - } - } - } - - if (flush != Z_FINISH) return Z_OK; - if (s->wrap <= 0) return Z_STREAM_END; - - /* Write the trailer */ -#ifdef GZIP - if (s->wrap == 2) { - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - put_byte(s, (Byte)((strm->adler >> 16) & 0xff)); - put_byte(s, (Byte)((strm->adler >> 24) & 0xff)); - put_byte(s, (Byte)(strm->total_in & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 8) & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 16) & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 24) & 0xff)); - } - else -#endif - { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - } - flush_pending(strm); - /* If avail_out is zero, the application will call deflate again - * to flush the rest. - */ - if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */ - return s->pending != 0 ? Z_OK : Z_STREAM_END; -} - -/* ========================================================================= */ -int ZEXPORT deflateEnd (strm) - z_streamp strm; -{ - int status; - - if (deflateStateCheck(strm)) return Z_STREAM_ERROR; - - status = strm->state->status; - - /* Deallocate in reverse order of allocations: */ - TRY_FREE(strm, strm->state->pending_buf); - TRY_FREE(strm, strm->state->head); - TRY_FREE(strm, strm->state->prev); - TRY_FREE(strm, strm->state->window); - - ZFREE(strm, strm->state); - strm->state = Z_NULL; - - return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; -} - -/* ========================================================================= - * Copy the source state to the destination state. - * To simplify the source, this is not supported for 16-bit MSDOS (which - * doesn't have enough memory anyway to duplicate compression states). - */ -int ZEXPORT deflateCopy (dest, source) - z_streamp dest; - z_streamp source; -{ -#ifdef MAXSEG_64K - return Z_STREAM_ERROR; -#else - deflate_state *ds; - deflate_state *ss; - ushf *overlay; - - - if (deflateStateCheck(source) || dest == Z_NULL) { - return Z_STREAM_ERROR; - } - - ss = source->state; - - zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); - - ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); - if (ds == Z_NULL) return Z_MEM_ERROR; - dest->state = (struct internal_state FAR *) ds; - zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state)); - ds->strm = dest; - - ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); - ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); - ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); - ds->pending_buf = (uchf *) overlay; - - if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || - ds->pending_buf == Z_NULL) { - deflateEnd (dest); - return Z_MEM_ERROR; - } - /* following zmemcpy do not work for 16-bit MSDOS */ - zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); - zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); - zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); - zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); - - ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); - ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); - ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; - - ds->l_desc.dyn_tree = ds->dyn_ltree; - ds->d_desc.dyn_tree = ds->dyn_dtree; - ds->bl_desc.dyn_tree = ds->bl_tree; - - return Z_OK; -#endif /* MAXSEG_64K */ -} - -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->next_in buffer and copying from it. - * (See also flush_pending()). - */ -local unsigned read_buf(strm, buf, size) - z_streamp strm; - Bytef *buf; - unsigned size; -{ - unsigned len = strm->avail_in; - - if (len > size) len = size; - if (len == 0) return 0; - - strm->avail_in -= len; - - zmemcpy(buf, strm->next_in, len); - if (strm->state->wrap == 1) { - strm->adler = adler32(strm->adler, buf, len); - } -#ifdef GZIP - else if (strm->state->wrap == 2) { - strm->adler = crc32(strm->adler, buf, len); - } -#endif - strm->next_in += len; - strm->total_in += len; - - return len; -} - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -local void lm_init (s) - deflate_state *s; -{ - s->window_size = (ulg)2L*s->w_size; - - CLEAR_HASH(s); - - /* Set the default configuration parameters: - */ - s->max_lazy_match = configuration_table[s->level].max_lazy; - s->good_match = configuration_table[s->level].good_length; - s->nice_match = configuration_table[s->level].nice_length; - s->max_chain_length = configuration_table[s->level].max_chain; - - s->strstart = 0; - s->block_start = 0L; - s->lookahead = 0; - s->insert = 0; - s->match_length = s->prev_length = MIN_MATCH-1; - s->match_available = 0; - s->ins_h = 0; -#ifndef FASTEST -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -#endif -} - -#ifndef FASTEST -/* =========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - * OUT assertion: the match length is not greater than s->lookahead. - */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ -local uInt longest_match(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ - unsigned chain_length = s->max_chain_length;/* max hash chain length */ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - int best_len = (int)s->prev_length; /* best match length so far */ - int nice_match = s->nice_match; /* stop if match long enough */ - IPos limit = s->strstart > (IPos)MAX_DIST(s) ? - s->strstart - (IPos)MAX_DIST(s) : NIL; - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - Posf *prev = s->prev; - uInt wmask = s->w_mask; - -#ifdef UNALIGNED_OK - /* Compare two bytes at a time. Note: this is not always beneficial. - * Try with and without -DUNALIGNED_OK to check. - */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; - register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); -#else - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; - register Byte scan_end = scan[best_len]; -#endif - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - /* Do not waste too much time if we already have a good match: */ - if (s->prev_length >= s->good_match) { - chain_length >>= 2; - } - /* Do not look for matches beyond the end of the input. This is necessary - * to make deflate deterministic. - */ - if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; - - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - do { - Assert(cur_match < s->strstart, "no future"); - match = s->window + cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2. Note that the checks below - * for insufficient lookahead only occur occasionally for performance - * reasons. Therefore uninitialized memory will be accessed, and - * conditional jumps will be made that depend on those values. - * However the length of the match is limited to the lookahead, so - * the output of deflate is not affected by the uninitialized values. - */ -#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) - /* This code assumes sizeof(unsigned short) == 2. Do not use - * UNALIGNED_OK if your compiler uses a different size. - */ - if (*(ushf*)(match+best_len-1) != scan_end || - *(ushf*)match != scan_start) continue; - - /* It is not necessary to compare scan[2] and match[2] since they are - * always equal when the other bytes match, given that the hash keys - * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient - * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is - * necessary to put more guard bytes at the end of the window, or - * to check more often for insufficient lookahead. - */ - Assert(scan[2] == match[2], "scan[2]?"); - scan++, match++; - do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - scan < strend); - /* The funny "do {}" generates better code on most compilers */ - - /* Here, scan <= window+strstart+257 */ - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - if (*scan == *match) scan++; - - len = (MAX_MATCH - 1) - (int)(strend-scan); - scan = strend - (MAX_MATCH-1); - -#else /* UNALIGNED_OK */ - - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match++; - Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (int)(strend - scan); - scan = strend - MAX_MATCH; - -#endif /* UNALIGNED_OK */ - - if (len > best_len) { - s->match_start = cur_match; - best_len = len; - if (len >= nice_match) break; -#ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); -#else - scan_end1 = scan[best_len-1]; - scan_end = scan[best_len]; -#endif - } - } while ((cur_match = prev[cur_match & wmask]) > limit - && --chain_length != 0); - - if ((uInt)best_len <= s->lookahead) return (uInt)best_len; - return s->lookahead; -} -#endif /* ASMV */ - -#else /* FASTEST */ - -/* --------------------------------------------------------------------------- - * Optimized version for FASTEST only - */ -local uInt longest_match(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - Assert(cur_match < s->strstart, "no future"); - - match = s->window + cur_match; - - /* Return failure if the match length is less than 2: - */ - if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match += 2; - Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (int)(strend - scan); - - if (len < MIN_MATCH) return MIN_MATCH - 1; - - s->match_start = cur_match; - return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead; -} - -#endif /* FASTEST */ - -#ifdef ZLIB_DEBUG - -#define EQUAL 0 -/* result of memcmp for equal strings */ - -/* =========================================================================== - * Check that the match at match_start is indeed a match. - */ -local void check_match(s, start, match, length) - deflate_state *s; - IPos start, match; - int length; -{ - /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); - do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); - z_error("invalid match"); - } - if (z_verbose > 1) { - fprintf(stderr,"\\[%d,%d]", start-match, length); - do { putc(s->window[start++], stderr); } while (--length != 0); - } -} -#else -# define check_match(s, start, match, length) -#endif /* ZLIB_DEBUG */ - -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -local void fill_window(s) - deflate_state *s; -{ - unsigned n; - unsigned more; /* Amount of free space at the end of the window. */ - uInt wsize = s->w_size; - - Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); - - do { - more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); - - /* Deal with !@#$% 64K limit: */ - if (sizeof(int) <= 2) { - if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - more = wsize; - - } else if (more == (unsigned)(-1)) { - /* Very unlikely, but possible on 16 bit machine if - * strstart == 0 && lookahead == 1 (input done a byte at time) - */ - more--; - } - } - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (s->strstart >= wsize+MAX_DIST(s)) { - - zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more); - s->match_start -= wsize; - s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ - s->block_start -= (long) wsize; - slide_hash(s); - more += wsize; - } - if (s->strm->avail_in == 0) break; - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - Assert(more >= 2, "more < 2"); - - n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); - s->lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s->lookahead + s->insert >= MIN_MATCH) { - uInt str = s->strstart - s->insert; - s->ins_h = s->window[str]; - UPDATE_HASH(s, s->ins_h, s->window[str + 1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - while (s->insert) { - UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); -#ifndef FASTEST - s->prev[str & s->w_mask] = s->head[s->ins_h]; -#endif - s->head[s->ins_h] = (Pos)str; - str++; - s->insert--; - if (s->lookahead + s->insert < MIN_MATCH) - break; - } - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); - - /* If the WIN_INIT bytes after the end of the current data have never been - * written, then zero those bytes in order to avoid memory check reports of - * the use of uninitialized (or uninitialised as Julian writes) bytes by - * the longest match routines. Update the high water mark for the next - * time through here. WIN_INIT is set to MAX_MATCH since the longest match - * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. - */ - if (s->high_water < s->window_size) { - ulg curr = s->strstart + (ulg)(s->lookahead); - ulg init; - - if (s->high_water < curr) { - /* Previous high water mark below current data -- zero WIN_INIT - * bytes or up to end of window, whichever is less. - */ - init = s->window_size - curr; - if (init > WIN_INIT) - init = WIN_INIT; - zmemzero(s->window + curr, (unsigned)init); - s->high_water = curr + init; - } - else if (s->high_water < (ulg)curr + WIN_INIT) { - /* High water mark at or above current data, but below current data - * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up - * to end of window, whichever is less. - */ - init = (ulg)curr + WIN_INIT - s->high_water; - if (init > s->window_size - s->high_water) - init = s->window_size - s->high_water; - zmemzero(s->window + s->high_water, (unsigned)init); - s->high_water += init; - } - } - - Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, - "not enough room for search"); -} - -/* =========================================================================== - * Flush the current block, with given end-of-file flag. - * IN assertion: strstart is set to the end of the current match. - */ -#define FLUSH_BLOCK_ONLY(s, last) { \ - _tr_flush_block(s, (s->block_start >= 0L ? \ - (charf *)&s->window[(unsigned)s->block_start] : \ - (charf *)Z_NULL), \ - (ulg)((long)s->strstart - s->block_start), \ - (last)); \ - s->block_start = s->strstart; \ - flush_pending(s->strm); \ - Tracev((stderr,"[FLUSH]")); \ -} - -/* Same but force premature exit if necessary. */ -#define FLUSH_BLOCK(s, last) { \ - FLUSH_BLOCK_ONLY(s, last); \ - if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \ -} - -/* Maximum stored block length in deflate format (not including header). */ -#define MAX_STORED 65535 - -/* Minimum of a and b. */ -#define MIN(a, b) ((a) > (b) ? (b) : (a)) - -/* =========================================================================== - * Copy without compression as much as possible from the input stream, return - * the current block state. - * - * In case deflateParams() is used to later switch to a non-zero compression - * level, s->matches (otherwise unused when storing) keeps track of the number - * of hash table slides to perform. If s->matches is 1, then one hash table - * slide will be done when switching. If s->matches is 2, the maximum value - * allowed here, then the hash table will be cleared, since two or more slides - * is the same as a clear. - * - * deflate_stored() is written to minimize the number of times an input byte is - * copied. It is most efficient with large input and output buffers, which - * maximizes the opportunites to have a single copy from next_in to next_out. - */ -local block_state deflate_stored(s, flush) - deflate_state *s; - int flush; -{ - /* Smallest worthy block size when not flushing or finishing. By default - * this is 32K. This can be as small as 507 bytes for memLevel == 1. For - * large input and output buffers, the stored block size will be larger. - */ - unsigned min_block = MIN(s->pending_buf_size - 5, s->w_size); - - /* Copy as many min_block or larger stored blocks directly to next_out as - * possible. If flushing, copy the remaining available input to next_out as - * stored blocks, if there is enough space. - */ - unsigned len, left, have, last = 0; - unsigned used = s->strm->avail_in; - do { - /* Set len to the maximum size block that we can copy directly with the - * available input data and output space. Set left to how much of that - * would be copied from what's left in the window. - */ - len = MAX_STORED; /* maximum deflate stored block length */ - have = (s->bi_valid + 42) >> 3; /* number of header bytes */ - if (s->strm->avail_out < have) /* need room for header */ - break; - /* maximum stored block length that will fit in avail_out: */ - have = s->strm->avail_out - have; - left = s->strstart - s->block_start; /* bytes left in window */ - if (len > (ulg)left + s->strm->avail_in) - len = left + s->strm->avail_in; /* limit len to the input */ - if (len > have) - len = have; /* limit len to the output */ - - /* If the stored block would be less than min_block in length, or if - * unable to copy all of the available input when flushing, then try - * copying to the window and the pending buffer instead. Also don't - * write an empty block when flushing -- deflate() does that. - */ - if (len < min_block && ((len == 0 && flush != Z_FINISH) || - flush == Z_NO_FLUSH || - len != left + s->strm->avail_in)) - break; - - /* Make a dummy stored block in pending to get the header bytes, - * including any pending bits. This also updates the debugging counts. - */ - last = flush == Z_FINISH && len == left + s->strm->avail_in ? 1 : 0; - _tr_stored_block(s, (char *)0, 0L, last); - - /* Replace the lengths in the dummy stored block with len. */ - s->pending_buf[s->pending - 4] = len; - s->pending_buf[s->pending - 3] = len >> 8; - s->pending_buf[s->pending - 2] = ~len; - s->pending_buf[s->pending - 1] = ~len >> 8; - - /* Write the stored block header bytes. */ - flush_pending(s->strm); - -#ifdef ZLIB_DEBUG - /* Update debugging counts for the data about to be copied. */ - s->compressed_len += len << 3; - s->bits_sent += len << 3; -#endif - - /* Copy uncompressed bytes from the window to next_out. */ - if (left) { - if (left > len) - left = len; - zmemcpy(s->strm->next_out, s->window + s->block_start, left); - s->strm->next_out += left; - s->strm->avail_out -= left; - s->strm->total_out += left; - s->block_start += left; - len -= left; - } - - /* Copy uncompressed bytes directly from next_in to next_out, updating - * the check value. - */ - if (len) { - read_buf(s->strm, s->strm->next_out, len); - s->strm->next_out += len; - s->strm->avail_out -= len; - s->strm->total_out += len; - } - } while (last == 0); - - /* Update the sliding window with the last s->w_size bytes of the copied - * data, or append all of the copied data to the existing window if less - * than s->w_size bytes were copied. Also update the number of bytes to - * insert in the hash tables, in the event that deflateParams() switches to - * a non-zero compression level. - */ - used -= s->strm->avail_in; /* number of input bytes directly copied */ - if (used) { - /* If any input was used, then no unused input remains in the window, - * therefore s->block_start == s->strstart. - */ - if (used >= s->w_size) { /* supplant the previous history */ - s->matches = 2; /* clear hash */ - zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size); - s->strstart = s->w_size; - } - else { - if (s->window_size - s->strstart <= used) { - /* Slide the window down. */ - s->strstart -= s->w_size; - zmemcpy(s->window, s->window + s->w_size, s->strstart); - if (s->matches < 2) - s->matches++; /* add a pending slide_hash() */ - } - zmemcpy(s->window + s->strstart, s->strm->next_in - used, used); - s->strstart += used; - } - s->block_start = s->strstart; - s->insert += MIN(used, s->w_size - s->insert); - } - if (s->high_water < s->strstart) - s->high_water = s->strstart; - - /* If the last block was written to next_out, then done. */ - if (last) - return finish_done; - - /* If flushing and all input has been consumed, then done. */ - if (flush != Z_NO_FLUSH && flush != Z_FINISH && - s->strm->avail_in == 0 && (long)s->strstart == s->block_start) - return block_done; - - /* Fill the window with any remaining input. */ - have = s->window_size - s->strstart - 1; - if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) { - /* Slide the window down. */ - s->block_start -= s->w_size; - s->strstart -= s->w_size; - zmemcpy(s->window, s->window + s->w_size, s->strstart); - if (s->matches < 2) - s->matches++; /* add a pending slide_hash() */ - have += s->w_size; /* more space now */ - } - if (have > s->strm->avail_in) - have = s->strm->avail_in; - if (have) { - read_buf(s->strm, s->window + s->strstart, have); - s->strstart += have; - } - if (s->high_water < s->strstart) - s->high_water = s->strstart; - - /* There was not enough avail_out to write a complete worthy or flushed - * stored block to next_out. Write a stored block to pending instead, if we - * have enough input for a worthy block, or if flushing and there is enough - * room for the remaining input as a stored block in the pending buffer. - */ - have = (s->bi_valid + 42) >> 3; /* number of header bytes */ - /* maximum stored block length that will fit in pending: */ - have = MIN(s->pending_buf_size - have, MAX_STORED); - min_block = MIN(have, s->w_size); - left = s->strstart - s->block_start; - if (left >= min_block || - ((left || flush == Z_FINISH) && flush != Z_NO_FLUSH && - s->strm->avail_in == 0 && left <= have)) { - len = MIN(left, have); - last = flush == Z_FINISH && s->strm->avail_in == 0 && - len == left ? 1 : 0; - _tr_stored_block(s, (charf *)s->window + s->block_start, len, last); - s->block_start += len; - flush_pending(s->strm); - } - - /* We've done all we can with the available input and output. */ - return last ? finish_started : need_more; -} - -/* =========================================================================== - * Compress as much as possible from the input stream, return the current - * block state. - * This function does not perform lazy evaluation of matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ -local block_state deflate_fast(s, flush) - deflate_state *s; - int flush; -{ - IPos hash_head; /* head of the hash chain */ - int bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - hash_head = NIL; - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s->match_length = longest_match (s, hash_head); - /* longest_match() sets match_start */ - } - if (s->match_length >= MIN_MATCH) { - check_match(s, s->strstart, s->match_start, s->match_length); - - _tr_tally_dist(s, s->strstart - s->match_start, - s->match_length - MIN_MATCH, bflush); - - s->lookahead -= s->match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ -#ifndef FASTEST - if (s->match_length <= s->max_insert_length && - s->lookahead >= MIN_MATCH) { - s->match_length--; /* string at strstart already in table */ - do { - s->strstart++; - INSERT_STRING(s, s->strstart, hash_head); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. - */ - } while (--s->match_length != 0); - s->strstart++; - } else -#endif - { - s->strstart += s->match_length; - s->match_length = 0; - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not - * matter since it will be recomputed at next deflate call. - */ - } - } else { - /* No match, output a literal byte */ - Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - } - if (bflush) FLUSH_BLOCK(s, 0); - } - s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; - if (flush == Z_FINISH) { - FLUSH_BLOCK(s, 1); - return finish_done; - } - if (s->last_lit) - FLUSH_BLOCK(s, 0); - return block_done; -} - -#ifndef FASTEST -/* =========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ -local block_state deflate_slow(s, flush) - deflate_state *s; - int flush; -{ - IPos hash_head; /* head of hash chain */ - int bflush; /* set if current block must be flushed */ - - /* Process the input block. */ - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - hash_head = NIL; - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - */ - s->prev_length = s->match_length, s->prev_match = s->match_start; - s->match_length = MIN_MATCH-1; - - if (hash_head != NIL && s->prev_length < s->max_lazy_match && - s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s->match_length = longest_match (s, hash_head); - /* longest_match() sets match_start */ - - if (s->match_length <= 5 && (s->strategy == Z_FILTERED -#if TOO_FAR <= 32767 - || (s->match_length == MIN_MATCH && - s->strstart - s->match_start > TOO_FAR) -#endif - )) { - - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s->match_length = MIN_MATCH-1; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { - uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; - /* Do not insert strings in hash table beyond this. */ - - check_match(s, s->strstart-1, s->prev_match, s->prev_length); - - _tr_tally_dist(s, s->strstart -1 - s->prev_match, - s->prev_length - MIN_MATCH, bflush); - - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not - * enough lookahead, the last two strings are not inserted in - * the hash table. - */ - s->lookahead -= s->prev_length-1; - s->prev_length -= 2; - do { - if (++s->strstart <= max_insert) { - INSERT_STRING(s, s->strstart, hash_head); - } - } while (--s->prev_length != 0); - s->match_available = 0; - s->match_length = MIN_MATCH-1; - s->strstart++; - - if (bflush) FLUSH_BLOCK(s, 0); - - } else if (s->match_available) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); - if (bflush) { - FLUSH_BLOCK_ONLY(s, 0); - } - s->strstart++; - s->lookahead--; - if (s->strm->avail_out == 0) return need_more; - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - s->match_available = 1; - s->strstart++; - s->lookahead--; - } - } - Assert (flush != Z_NO_FLUSH, "no flush?"); - if (s->match_available) { - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); - s->match_available = 0; - } - s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; - if (flush == Z_FINISH) { - FLUSH_BLOCK(s, 1); - return finish_done; - } - if (s->last_lit) - FLUSH_BLOCK(s, 0); - return block_done; -} -#endif /* FASTEST */ - -/* =========================================================================== - * For Z_RLE, simply look for runs of bytes, generate matches only of distance - * one. Do not maintain a hash table. (It will be regenerated if this run of - * deflate switches away from Z_RLE.) - */ -local block_state deflate_rle(s, flush) - deflate_state *s; - int flush; -{ - int bflush; /* set if current block must be flushed */ - uInt prev; /* byte at distance one to match */ - Bytef *scan, *strend; /* scan goes up to strend for length of run */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the longest run, plus one for the unrolled loop. - */ - if (s->lookahead <= MAX_MATCH) { - fill_window(s); - if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* See how many times the previous byte repeats */ - s->match_length = 0; - if (s->lookahead >= MIN_MATCH && s->strstart > 0) { - scan = s->window + s->strstart - 1; - prev = *scan; - if (prev == *++scan && prev == *++scan && prev == *++scan) { - strend = s->window + s->strstart + MAX_MATCH; - do { - } while (prev == *++scan && prev == *++scan && - prev == *++scan && prev == *++scan && - prev == *++scan && prev == *++scan && - prev == *++scan && prev == *++scan && - scan < strend); - s->match_length = MAX_MATCH - (uInt)(strend - scan); - if (s->match_length > s->lookahead) - s->match_length = s->lookahead; - } - Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); - } - - /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s->match_length >= MIN_MATCH) { - check_match(s, s->strstart, s->strstart - 1, s->match_length); - - _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush); - - s->lookahead -= s->match_length; - s->strstart += s->match_length; - s->match_length = 0; - } else { - /* No match, output a literal byte */ - Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - } - if (bflush) FLUSH_BLOCK(s, 0); - } - s->insert = 0; - if (flush == Z_FINISH) { - FLUSH_BLOCK(s, 1); - return finish_done; - } - if (s->last_lit) - FLUSH_BLOCK(s, 0); - return block_done; -} - -/* =========================================================================== - * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. - * (It will be regenerated if this run of deflate switches away from Huffman.) - */ -local block_state deflate_huff(s, flush) - deflate_state *s; - int flush; -{ - int bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we have a literal to write. */ - if (s->lookahead == 0) { - fill_window(s); - if (s->lookahead == 0) { - if (flush == Z_NO_FLUSH) - return need_more; - break; /* flush the current block */ - } - } - - /* Output a literal byte */ - s->match_length = 0; - Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - if (bflush) FLUSH_BLOCK(s, 0); - } - s->insert = 0; - if (flush == Z_FINISH) { - FLUSH_BLOCK(s, 1); - return finish_done; - } - if (s->last_lit) - FLUSH_BLOCK(s, 0); - return block_done; -} diff --git a/jan/src/dep/libs/zlib/deflate.h b/jan/src/dep/libs/zlib/deflate.h deleted file mode 100644 index 23ecdd312..000000000 --- a/jan/src/dep/libs/zlib/deflate.h +++ /dev/null @@ -1,349 +0,0 @@ -/* deflate.h -- internal compression state - * Copyright (C) 1995-2016 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id$ */ - -#ifndef DEFLATE_H -#define DEFLATE_H - -#include "zutil.h" - -/* define NO_GZIP when compiling if you want to disable gzip header and - trailer creation by deflate(). NO_GZIP would be used to avoid linking in - the crc code when it is not needed. For shared libraries, gzip encoding - should be left enabled. */ -#ifndef NO_GZIP -# define GZIP -#endif - -/* =========================================================================== - * Internal compression state. - */ - -#define LENGTH_CODES 29 -/* number of length codes, not counting the special END_BLOCK code */ - -#define LITERALS 256 -/* number of literal bytes 0..255 */ - -#define L_CODES (LITERALS+1+LENGTH_CODES) -/* number of Literal or Length codes, including the END_BLOCK code */ - -#define D_CODES 30 -/* number of distance codes */ - -#define BL_CODES 19 -/* number of codes used to transfer the bit lengths */ - -#define HEAP_SIZE (2*L_CODES+1) -/* maximum heap size */ - -#define MAX_BITS 15 -/* All codes must not exceed MAX_BITS bits */ - -#define Buf_size 16 -/* size of bit buffer in bi_buf */ - -#define INIT_STATE 42 /* zlib header -> BUSY_STATE */ -#ifdef GZIP -# define GZIP_STATE 57 /* gzip header -> BUSY_STATE | EXTRA_STATE */ -#endif -#define EXTRA_STATE 69 /* gzip extra block -> NAME_STATE */ -#define NAME_STATE 73 /* gzip file name -> COMMENT_STATE */ -#define COMMENT_STATE 91 /* gzip comment -> HCRC_STATE */ -#define HCRC_STATE 103 /* gzip header CRC -> BUSY_STATE */ -#define BUSY_STATE 113 /* deflate -> FINISH_STATE */ -#define FINISH_STATE 666 /* stream complete */ -/* Stream status */ - - -/* Data structure describing a single value and its code string. */ -typedef struct ct_data_s { - union { - ush freq; /* frequency count */ - ush code; /* bit string */ - } fc; - union { - ush dad; /* father node in Huffman tree */ - ush len; /* length of bit string */ - } dl; -} FAR ct_data; - -#define Freq fc.freq -#define Code fc.code -#define Dad dl.dad -#define Len dl.len - -typedef struct static_tree_desc_s static_tree_desc; - -typedef struct tree_desc_s { - ct_data *dyn_tree; /* the dynamic tree */ - int max_code; /* largest code with non zero frequency */ - const static_tree_desc *stat_desc; /* the corresponding static tree */ -} FAR tree_desc; - -typedef ush Pos; -typedef Pos FAR Posf; -typedef unsigned IPos; - -/* A Pos is an index in the character window. We use short instead of int to - * save space in the various tables. IPos is used only for parameter passing. - */ - -typedef struct internal_state { - z_streamp strm; /* pointer back to this zlib stream */ - int status; /* as the name implies */ - Bytef *pending_buf; /* output still pending */ - ulg pending_buf_size; /* size of pending_buf */ - Bytef *pending_out; /* next pending byte to output to the stream */ - ulg pending; /* nb of bytes in the pending buffer */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - gz_headerp gzhead; /* gzip header information to write */ - ulg gzindex; /* where in extra, name, or comment */ - Byte method; /* can only be DEFLATED */ - int last_flush; /* value of flush param for previous deflate call */ - - /* used by deflate.c: */ - - uInt w_size; /* LZ77 window size (32K by default) */ - uInt w_bits; /* log2(w_size) (8..16) */ - uInt w_mask; /* w_size - 1 */ - - Bytef *window; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. Also, it limits - * the window size to 64K, which is quite useful on MSDOS. - * To do: use the user input buffer as sliding window. - */ - - ulg window_size; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - Posf *prev; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - Posf *head; /* Heads of the hash chains or NIL. */ - - uInt ins_h; /* hash index of string to be inserted */ - uInt hash_size; /* number of elements in hash table */ - uInt hash_bits; /* log2(hash_size) */ - uInt hash_mask; /* hash_size-1 */ - - uInt hash_shift; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - long block_start; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - uInt match_length; /* length of best match */ - IPos prev_match; /* previous match */ - int match_available; /* set if previous match exists */ - uInt strstart; /* start of string to insert */ - uInt match_start; /* start of matching string */ - uInt lookahead; /* number of valid bytes ahead in window */ - - uInt prev_length; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - uInt max_chain_length; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - uInt max_lazy_match; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ -# define max_insert_length max_lazy_match - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - int level; /* compression level (1..9) */ - int strategy; /* favor or force Huffman coding*/ - - uInt good_match; - /* Use a faster search when the previous match is longer than this */ - - int nice_match; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - /* Didn't use ct_data typedef below to suppress compiler warning */ - struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - struct tree_desc_s l_desc; /* desc. for literal tree */ - struct tree_desc_s d_desc; /* desc. for distance tree */ - struct tree_desc_s bl_desc; /* desc. for bit length tree */ - - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - int heap_len; /* number of elements in the heap */ - int heap_max; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - uch depth[2*L_CODES+1]; - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - uchf *l_buf; /* buffer for literals or lengths */ - - uInt lit_bufsize; - /* Size of match buffer for literals/lengths. There are 4 reasons for - * limiting lit_bufsize to 64K: - * - frequencies can be kept in 16 bit counters - * - if compression is not successful for the first block, all input - * data is still in the window so we can still emit a stored block even - * when input comes from standard input. (This can also be done for - * all blocks if lit_bufsize is not greater than 32K.) - * - if compression is not successful for a file smaller than 64K, we can - * even emit a stored file instead of a stored block (saving 5 bytes). - * This is applicable only for zip (not gzip or zlib). - * - creating new Huffman trees less frequently may not provide fast - * adaptation to changes in the input data statistics. (Take for - * example a binary file with poorly compressible code followed by - * a highly compressible string table.) Smaller buffer sizes give - * fast adaptation but have of course the overhead of transmitting - * trees more frequently. - * - I can't count above 4 - */ - - uInt last_lit; /* running index in l_buf */ - - ushf *d_buf; - /* Buffer for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - ulg opt_len; /* bit length of current block with optimal trees */ - ulg static_len; /* bit length of current block with static trees */ - uInt matches; /* number of string matches in current block */ - uInt insert; /* bytes at end of window left to insert */ - -#ifdef ZLIB_DEBUG - ulg compressed_len; /* total bit length of compressed file mod 2^32 */ - ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ -#endif - - ush bi_buf; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - int bi_valid; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - - ulg high_water; - /* High water mark offset in window for initialized bytes -- bytes above - * this are set to zero in order to avoid memory check warnings when - * longest match routines access bytes past the input. This is then - * updated to the new high water mark. - */ - -} FAR deflate_state; - -/* Output a byte on the stream. - * IN assertion: there is enough room in pending_buf. - */ -#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);} - - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) -/* In order to simplify the code, particularly on 16 bit machines, match - * distances are limited to MAX_DIST instead of WSIZE. - */ - -#define WIN_INIT MAX_MATCH -/* Number of bytes after end of data in window to initialize in order to avoid - memory checker errors from longest match routines */ - - /* in trees.c */ -void ZLIB_INTERNAL _tr_init OF((deflate_state *s)); -int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); -void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf, - ulg stored_len, int last)); -void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s)); -void ZLIB_INTERNAL _tr_align OF((deflate_state *s)); -void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, - ulg stored_len, int last)); - -#define d_code(dist) \ - ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) -/* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. _dist_code[256] and _dist_code[257] are never - * used. - */ - -#ifndef ZLIB_DEBUG -/* Inline versions of _tr_tally for speed: */ - -#if defined(GEN_TREES_H) || !defined(STDC) - extern uch ZLIB_INTERNAL _length_code[]; - extern uch ZLIB_INTERNAL _dist_code[]; -#else - extern const uch ZLIB_INTERNAL _length_code[]; - extern const uch ZLIB_INTERNAL _dist_code[]; -#endif - -# define _tr_tally_lit(s, c, flush) \ - { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ - s->dyn_ltree[cc].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -# define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (uch)(length); \ - ush dist = (ush)(distance); \ - s->d_buf[s->last_lit] = dist; \ - s->l_buf[s->last_lit++] = len; \ - dist--; \ - s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ - s->dyn_dtree[d_code(dist)].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -#else -# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) -# define _tr_tally_dist(s, distance, length, flush) \ - flush = _tr_tally(s, distance, length) -#endif - -#endif /* DEFLATE_H */ diff --git a/jan/src/dep/libs/zlib/gzclose.c b/jan/src/dep/libs/zlib/gzclose.c deleted file mode 100644 index caeb99a31..000000000 --- a/jan/src/dep/libs/zlib/gzclose.c +++ /dev/null @@ -1,25 +0,0 @@ -/* gzclose.c -- zlib gzclose() function - * Copyright (C) 2004, 2010 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "gzguts.h" - -/* gzclose() is in a separate file so that it is linked in only if it is used. - That way the other gzclose functions can be used instead to avoid linking in - unneeded compression or decompression routines. */ -int ZEXPORT gzclose(file) - gzFile file; -{ -#ifndef NO_GZCOMPRESS - gz_statep state; - - if (file == NULL) - return Z_STREAM_ERROR; - state = (gz_statep)file; - - return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); -#else - return gzclose_r(file); -#endif -} diff --git a/jan/src/dep/libs/zlib/gzguts.h b/jan/src/dep/libs/zlib/gzguts.h deleted file mode 100644 index 990a4d251..000000000 --- a/jan/src/dep/libs/zlib/gzguts.h +++ /dev/null @@ -1,218 +0,0 @@ -/* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#ifdef _LARGEFILE64_SOURCE -# ifndef _LARGEFILE_SOURCE -# define _LARGEFILE_SOURCE 1 -# endif -# ifdef _FILE_OFFSET_BITS -# undef _FILE_OFFSET_BITS -# endif -#endif - -#ifdef HAVE_HIDDEN -# define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) -#else -# define ZLIB_INTERNAL -#endif - -#include -#include "zlib.h" -#ifdef STDC -# include -# include -# include -#endif - -#ifndef _POSIX_SOURCE -# define _POSIX_SOURCE -#endif -#include - -#ifdef _WIN32 -# include -#endif - -#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) -# include -#endif - -#if defined(_WIN32) || defined(__CYGWIN__) -# define WIDECHAR -#endif - -#ifdef WINAPI_FAMILY -# define open _open -# define read _read -# define write _write -# define close _close -#endif - -#ifdef NO_DEFLATE /* for compatibility with old definition */ -# define NO_GZCOMPRESS -#endif - -#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif - -#if defined(__CYGWIN__) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif - -#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif - -#ifndef HAVE_VSNPRINTF -# ifdef MSDOS -/* vsnprintf may exist on some MS-DOS compilers (DJGPP?), - but for now we just assume it doesn't. */ -# define NO_vsnprintf -# endif -# ifdef __TURBOC__ -# define NO_vsnprintf -# endif -# ifdef WIN32 -/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ -# if !defined(vsnprintf) && !defined(NO_vsnprintf) -# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) -# define vsnprintf _vsnprintf -# endif -# endif -# endif -# ifdef __SASC -# define NO_vsnprintf -# endif -# ifdef VMS -# define NO_vsnprintf -# endif -# ifdef __OS400__ -# define NO_vsnprintf -# endif -# ifdef __MVS__ -# define NO_vsnprintf -# endif -#endif - -/* unlike snprintf (which is required in C99), _snprintf does not guarantee - null termination of the result -- however this is only used in gzlib.c where - the result is assured to fit in the space provided */ -#if defined(_MSC_VER) && _MSC_VER < 1900 -# define snprintf _snprintf -#endif - -#ifndef local -# define local static -#endif -/* since "static" is used to mean two completely different things in C, we - define "local" for the non-static meaning of "static", for readability - (compile with -Dlocal if your debugger can't find static symbols) */ - -/* gz* functions always use library allocation functions */ -#ifndef STDC - extern voidp malloc OF((uInt size)); - extern void free OF((voidpf ptr)); -#endif - -/* get errno and strerror definition */ -#if defined UNDER_CE -# include -# define zstrerror() gz_strwinerror((DWORD)GetLastError()) -#else -# ifndef NO_STRERROR -# include -# define zstrerror() strerror(errno) -# else -# define zstrerror() "stdio error (consult errno)" -# endif -#endif - -/* provide prototypes for these when building zlib without LFS */ -#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); -#endif - -/* default memLevel */ -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif - -/* default i/o buffer size -- double this for output when reading (this and - twice this must be able to fit in an unsigned type) */ -#define GZBUFSIZE 8192 - -/* gzip modes, also provide a little integrity check on the passed structure */ -#define GZ_NONE 0 -#define GZ_READ 7247 -#define GZ_WRITE 31153 -#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ - -/* values for gz_state how */ -#define LOOK 0 /* look for a gzip header */ -#define COPY 1 /* copy input directly */ -#define GZIP 2 /* decompress a gzip stream */ - -/* internal gzip file state data structure */ -typedef struct { - /* exposed contents for gzgetc() macro */ - struct gzFile_s x; /* "x" for exposed */ - /* x.have: number of bytes available at x.next */ - /* x.next: next output data to deliver or write */ - /* x.pos: current position in uncompressed data */ - /* used for both reading and writing */ - int mode; /* see gzip modes above */ - int fd; /* file descriptor */ - char *path; /* path or fd for error messages */ - unsigned size; /* buffer size, zero if not allocated yet */ - unsigned want; /* requested buffer size, default is GZBUFSIZE */ - unsigned char *in; /* input buffer (double-sized when writing) */ - unsigned char *out; /* output buffer (double-sized when reading) */ - int direct; /* 0 if processing gzip, 1 if transparent */ - /* just for reading */ - int how; /* 0: get header, 1: copy, 2: decompress */ - z_off64_t start; /* where the gzip data started, for rewinding */ - int eof; /* true if end of input file reached */ - int past; /* true if read requested past end */ - /* just for writing */ - int level; /* compression level */ - int strategy; /* compression strategy */ - /* seek request */ - z_off64_t skip; /* amount to skip (already rewound if backwards) */ - int seek; /* true if seek request pending */ - /* error information */ - int err; /* error code */ - char *msg; /* error message */ - /* zlib inflate or deflate stream */ - z_stream strm; /* stream structure in-place (not a pointer) */ -} gz_state; -typedef gz_state FAR *gz_statep; - -/* shared functions */ -void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); -#if defined UNDER_CE -char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); -#endif - -/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t - value -- needed when comparing unsigned to z_off64_t, which is signed - (possible z_off64_t types off_t, off64_t, and long are all signed) */ -#ifdef INT_MAX -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) -#else -unsigned ZLIB_INTERNAL gz_intmax OF((void)); -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) -#endif diff --git a/jan/src/dep/libs/zlib/gzlib.c b/jan/src/dep/libs/zlib/gzlib.c deleted file mode 100644 index 4105e6aff..000000000 --- a/jan/src/dep/libs/zlib/gzlib.c +++ /dev/null @@ -1,637 +0,0 @@ -/* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004-2017 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "gzguts.h" - -#if defined(_WIN32) && !defined(__BORLANDC__) && !defined(__MINGW32__) -# define LSEEK _lseeki64 -#else -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 -# define LSEEK lseek64 -#else -# define LSEEK lseek -#endif -#endif - -/* Local functions */ -local void gz_reset OF((gz_statep)); -local gzFile gz_open OF((const void *, int, const char *)); - -#if defined UNDER_CE - -/* Map the Windows error number in ERROR to a locale-dependent error message - string and return a pointer to it. Typically, the values for ERROR come - from GetLastError. - - The string pointed to shall not be modified by the application, but may be - overwritten by a subsequent call to gz_strwinerror - - The gz_strwinerror function does not change the current setting of - GetLastError. */ -char ZLIB_INTERNAL *gz_strwinerror (error) - DWORD error; -{ - static char buf[1024]; - - wchar_t *msgbuf; - DWORD lasterr = GetLastError(); - DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM - | FORMAT_MESSAGE_ALLOCATE_BUFFER, - NULL, - error, - 0, /* Default language */ - (LPVOID)&msgbuf, - 0, - NULL); - if (chars != 0) { - /* If there is an \r\n appended, zap it. */ - if (chars >= 2 - && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') { - chars -= 2; - msgbuf[chars] = 0; - } - - if (chars > sizeof (buf) - 1) { - chars = sizeof (buf) - 1; - msgbuf[chars] = 0; - } - - wcstombs(buf, msgbuf, chars + 1); - LocalFree(msgbuf); - } - else { - sprintf(buf, "unknown win32 error (%ld)", error); - } - - SetLastError(lasterr); - return buf; -} - -#endif /* UNDER_CE */ - -/* Reset gzip file state */ -local void gz_reset(state) - gz_statep state; -{ - state->x.have = 0; /* no output data available */ - if (state->mode == GZ_READ) { /* for reading ... */ - state->eof = 0; /* not at end of file */ - state->past = 0; /* have not read past end yet */ - state->how = LOOK; /* look for gzip header */ - } - state->seek = 0; /* no seek request pending */ - gz_error(state, Z_OK, NULL); /* clear error */ - state->x.pos = 0; /* no uncompressed data yet */ - state->strm.avail_in = 0; /* no input data yet */ -} - -/* Open a gzip file either by name or file descriptor. */ -local gzFile gz_open(path, fd, mode) - const void *path; - int fd; - const char *mode; -{ - gz_statep state; - z_size_t len; - int oflag; -#ifdef O_CLOEXEC - int cloexec = 0; -#endif -#ifdef O_EXCL - int exclusive = 0; -#endif - - /* check input */ - if (path == NULL) - return NULL; - - /* allocate gzFile structure to return */ - state = (gz_statep)malloc(sizeof(gz_state)); - if (state == NULL) - return NULL; - state->size = 0; /* no buffers allocated yet */ - state->want = GZBUFSIZE; /* requested buffer size */ - state->msg = NULL; /* no error message yet */ - - /* interpret mode */ - state->mode = GZ_NONE; - state->level = Z_DEFAULT_COMPRESSION; - state->strategy = Z_DEFAULT_STRATEGY; - state->direct = 0; - while (*mode) { - if (*mode >= '0' && *mode <= '9') - state->level = *mode - '0'; - else - switch (*mode) { - case 'r': - state->mode = GZ_READ; - break; -#ifndef NO_GZCOMPRESS - case 'w': - state->mode = GZ_WRITE; - break; - case 'a': - state->mode = GZ_APPEND; - break; -#endif - case '+': /* can't read and write at the same time */ - free(state); - return NULL; - case 'b': /* ignore -- will request binary anyway */ - break; -#ifdef O_CLOEXEC - case 'e': - cloexec = 1; - break; -#endif -#ifdef O_EXCL - case 'x': - exclusive = 1; - break; -#endif - case 'f': - state->strategy = Z_FILTERED; - break; - case 'h': - state->strategy = Z_HUFFMAN_ONLY; - break; - case 'R': - state->strategy = Z_RLE; - break; - case 'F': - state->strategy = Z_FIXED; - break; - case 'T': - state->direct = 1; - break; - default: /* could consider as an error, but just ignore */ - ; - } - mode++; - } - - /* must provide an "r", "w", or "a" */ - if (state->mode == GZ_NONE) { - free(state); - return NULL; - } - - /* can't force transparent read */ - if (state->mode == GZ_READ) { - if (state->direct) { - free(state); - return NULL; - } - state->direct = 1; /* for empty file */ - } - - /* save the path name for error messages */ -#ifdef WIDECHAR - if (fd == -2) { - len = wcstombs(NULL, path, 0); - if (len == (z_size_t)-1) - len = 0; - } - else -#endif - len = strlen((const char *)path); - state->path = (char *)malloc(len + 1); - if (state->path == NULL) { - free(state); - return NULL; - } -#ifdef WIDECHAR - if (fd == -2) - if (len) - wcstombs(state->path, path, len + 1); - else - *(state->path) = 0; - else -#endif -#if !defined(NO_snprintf) && !defined(NO_vsnprintf) - (void)snprintf(state->path, len + 1, "%s", (const char *)path); -#else - strcpy(state->path, path); -#endif - - /* compute the flags for open() */ - oflag = -#ifdef O_LARGEFILE - O_LARGEFILE | -#endif -#ifdef O_BINARY - O_BINARY | -#endif -#ifdef O_CLOEXEC - (cloexec ? O_CLOEXEC : 0) | -#endif - (state->mode == GZ_READ ? - O_RDONLY : - (O_WRONLY | O_CREAT | -#ifdef O_EXCL - (exclusive ? O_EXCL : 0) | -#endif - (state->mode == GZ_WRITE ? - O_TRUNC : - O_APPEND))); - - /* open the file with the appropriate flags (or just use fd) */ - state->fd = fd > -1 ? fd : ( -#ifdef WIDECHAR - fd == -2 ? _wopen(path, oflag, 0666) : -#endif - open((const char *)path, oflag, 0666)); - if (state->fd == -1) { - free(state->path); - free(state); - return NULL; - } - if (state->mode == GZ_APPEND) { - LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */ - state->mode = GZ_WRITE; /* simplify later checks */ - } - - /* save the current position for rewinding (only if reading) */ - if (state->mode == GZ_READ) { - state->start = LSEEK(state->fd, 0, SEEK_CUR); - if (state->start == -1) state->start = 0; - } - - /* initialize stream */ - gz_reset(state); - - /* return stream */ - return (gzFile)state; -} - -/* -- see zlib.h -- */ -gzFile ZEXPORT gzopen(path, mode) - const char *path; - const char *mode; -{ - return gz_open(path, -1, mode); -} - -/* -- see zlib.h -- */ -gzFile ZEXPORT gzopen64(path, mode) - const char *path; - const char *mode; -{ - return gz_open(path, -1, mode); -} - -/* -- see zlib.h -- */ -gzFile ZEXPORT gzdopen(fd, mode) - int fd; - const char *mode; -{ - char *path; /* identifier for error messages */ - gzFile gz; - - if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL) - return NULL; -#if !defined(NO_snprintf) && !defined(NO_vsnprintf) - (void)snprintf(path, 7 + 3 * sizeof(int), "", fd); -#else - sprintf(path, "", fd); /* for debugging */ -#endif - gz = gz_open(path, fd, mode); - free(path); - return gz; -} - -/* -- see zlib.h -- */ -#ifdef WIDECHAR -gzFile ZEXPORT gzopen_w(path, mode) - const wchar_t *path; - const char *mode; -{ - return gz_open(path, -2, mode); -} -#endif - -/* -- see zlib.h -- */ -int ZEXPORT gzbuffer(file, size) - gzFile file; - unsigned size; -{ - gz_statep state; - - /* get internal structure and check integrity */ - if (file == NULL) - return -1; - state = (gz_statep)file; - if (state->mode != GZ_READ && state->mode != GZ_WRITE) - return -1; - - /* make sure we haven't already allocated memory */ - if (state->size != 0) - return -1; - - /* check and set requested size */ - if ((size << 1) < size) - return -1; /* need to be able to double it */ - if (size < 2) - size = 2; /* need two bytes to check magic header */ - state->want = size; - return 0; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzrewind(file) - gzFile file; -{ - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return -1; - state = (gz_statep)file; - - /* check that we're reading and that there's no error */ - if (state->mode != GZ_READ || - (state->err != Z_OK && state->err != Z_BUF_ERROR)) - return -1; - - /* back up and start over */ - if (LSEEK(state->fd, state->start, SEEK_SET) == -1) - return -1; - gz_reset(state); - return 0; -} - -/* -- see zlib.h -- */ -z_off64_t ZEXPORT gzseek64(file, offset, whence) - gzFile file; - z_off64_t offset; - int whence; -{ - unsigned n; - z_off64_t ret; - gz_statep state; - - /* get internal structure and check integrity */ - if (file == NULL) - return -1; - state = (gz_statep)file; - if (state->mode != GZ_READ && state->mode != GZ_WRITE) - return -1; - - /* check that there's no error */ - if (state->err != Z_OK && state->err != Z_BUF_ERROR) - return -1; - - /* can only seek from start or relative to current position */ - if (whence != SEEK_SET && whence != SEEK_CUR) - return -1; - - /* normalize offset to a SEEK_CUR specification */ - if (whence == SEEK_SET) - offset -= state->x.pos; - else if (state->seek) - offset += state->skip; - state->seek = 0; - - /* if within raw area while reading, just go there */ - if (state->mode == GZ_READ && state->how == COPY && - state->x.pos + offset >= 0) { - ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR); - if (ret == -1) - return -1; - state->x.have = 0; - state->eof = 0; - state->past = 0; - state->seek = 0; - gz_error(state, Z_OK, NULL); - state->strm.avail_in = 0; - state->x.pos += offset; - return state->x.pos; - } - - /* calculate skip amount, rewinding if needed for back seek when reading */ - if (offset < 0) { - if (state->mode != GZ_READ) /* writing -- can't go backwards */ - return -1; - offset += state->x.pos; - if (offset < 0) /* before start of file! */ - return -1; - if (gzrewind(file) == -1) /* rewind, then skip to offset */ - return -1; - } - - /* if reading, skip what's in output buffer (one less gzgetc() check) */ - if (state->mode == GZ_READ) { - n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ? - (unsigned)offset : state->x.have; - state->x.have -= n; - state->x.next += n; - state->x.pos += n; - offset -= n; - } - - /* request skip (if not zero) */ - if (offset) { - state->seek = 1; - state->skip = offset; - } - return state->x.pos + offset; -} - -/* -- see zlib.h -- */ -z_off_t ZEXPORT gzseek(file, offset, whence) - gzFile file; - z_off_t offset; - int whence; -{ - z_off64_t ret; - - ret = gzseek64(file, (z_off64_t)offset, whence); - return ret == (z_off_t)ret ? (z_off_t)ret : -1; -} - -/* -- see zlib.h -- */ -z_off64_t ZEXPORT gztell64(file) - gzFile file; -{ - gz_statep state; - - /* get internal structure and check integrity */ - if (file == NULL) - return -1; - state = (gz_statep)file; - if (state->mode != GZ_READ && state->mode != GZ_WRITE) - return -1; - - /* return position */ - return state->x.pos + (state->seek ? state->skip : 0); -} - -/* -- see zlib.h -- */ -z_off_t ZEXPORT gztell(file) - gzFile file; -{ - z_off64_t ret; - - ret = gztell64(file); - return ret == (z_off_t)ret ? (z_off_t)ret : -1; -} - -/* -- see zlib.h -- */ -z_off64_t ZEXPORT gzoffset64(file) - gzFile file; -{ - z_off64_t offset; - gz_statep state; - - /* get internal structure and check integrity */ - if (file == NULL) - return -1; - state = (gz_statep)file; - if (state->mode != GZ_READ && state->mode != GZ_WRITE) - return -1; - - /* compute and return effective offset in file */ - offset = LSEEK(state->fd, 0, SEEK_CUR); - if (offset == -1) - return -1; - if (state->mode == GZ_READ) /* reading */ - offset -= state->strm.avail_in; /* don't count buffered input */ - return offset; -} - -/* -- see zlib.h -- */ -z_off_t ZEXPORT gzoffset(file) - gzFile file; -{ - z_off64_t ret; - - ret = gzoffset64(file); - return ret == (z_off_t)ret ? (z_off_t)ret : -1; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzeof(file) - gzFile file; -{ - gz_statep state; - - /* get internal structure and check integrity */ - if (file == NULL) - return 0; - state = (gz_statep)file; - if (state->mode != GZ_READ && state->mode != GZ_WRITE) - return 0; - - /* return end-of-file state */ - return state->mode == GZ_READ ? state->past : 0; -} - -/* -- see zlib.h -- */ -const char * ZEXPORT gzerror(file, errnum) - gzFile file; - int *errnum; -{ - gz_statep state; - - /* get internal structure and check integrity */ - if (file == NULL) - return NULL; - state = (gz_statep)file; - if (state->mode != GZ_READ && state->mode != GZ_WRITE) - return NULL; - - /* return error information */ - if (errnum != NULL) - *errnum = state->err; - return state->err == Z_MEM_ERROR ? "out of memory" : - (state->msg == NULL ? "" : state->msg); -} - -/* -- see zlib.h -- */ -void ZEXPORT gzclearerr(file) - gzFile file; -{ - gz_statep state; - - /* get internal structure and check integrity */ - if (file == NULL) - return; - state = (gz_statep)file; - if (state->mode != GZ_READ && state->mode != GZ_WRITE) - return; - - /* clear error and end-of-file */ - if (state->mode == GZ_READ) { - state->eof = 0; - state->past = 0; - } - gz_error(state, Z_OK, NULL); -} - -/* Create an error message in allocated memory and set state->err and - state->msg accordingly. Free any previous error message already there. Do - not try to free or allocate space if the error is Z_MEM_ERROR (out of - memory). Simply save the error message as a static string. If there is an - allocation failure constructing the error message, then convert the error to - out of memory. */ -void ZLIB_INTERNAL gz_error(state, err, msg) - gz_statep state; - int err; - const char *msg; -{ - /* free previously allocated message and clear */ - if (state->msg != NULL) { - if (state->err != Z_MEM_ERROR) - free(state->msg); - state->msg = NULL; - } - - /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */ - if (err != Z_OK && err != Z_BUF_ERROR) - state->x.have = 0; - - /* set error code, and if no message, then done */ - state->err = err; - if (msg == NULL) - return; - - /* for an out of memory error, return literal string when requested */ - if (err == Z_MEM_ERROR) - return; - - /* construct error message with path */ - if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) == - NULL) { - state->err = Z_MEM_ERROR; - return; - } -#if !defined(NO_snprintf) && !defined(NO_vsnprintf) - (void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, - "%s%s%s", state->path, ": ", msg); -#else - strcpy(state->msg, state->path); - strcat(state->msg, ": "); - strcat(state->msg, msg); -#endif -} - -#ifndef INT_MAX -/* portably return maximum value for an int (when limits.h presumed not - available) -- we need to do this to cover cases where 2's complement not - used, since C standard permits 1's complement and sign-bit representations, - otherwise we could just use ((unsigned)-1) >> 1 */ -unsigned ZLIB_INTERNAL gz_intmax() -{ - unsigned p, q; - - p = 1; - do { - q = p; - p <<= 1; - p++; - } while (p > q); - return q >> 1; -} -#endif diff --git a/jan/src/dep/libs/zlib/gzread.c b/jan/src/dep/libs/zlib/gzread.c deleted file mode 100644 index 956b91ea7..000000000 --- a/jan/src/dep/libs/zlib/gzread.c +++ /dev/null @@ -1,654 +0,0 @@ -/* gzread.c -- zlib functions for reading gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "gzguts.h" - -/* Local functions */ -local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *)); -local int gz_avail OF((gz_statep)); -local int gz_look OF((gz_statep)); -local int gz_decomp OF((gz_statep)); -local int gz_fetch OF((gz_statep)); -local int gz_skip OF((gz_statep, z_off64_t)); -local z_size_t gz_read OF((gz_statep, voidp, z_size_t)); - -/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from - state->fd, and update state->eof, state->err, and state->msg as appropriate. - This function needs to loop on read(), since read() is not guaranteed to - read the number of bytes requested, depending on the type of descriptor. */ -local int gz_load(state, buf, len, have) - gz_statep state; - unsigned char *buf; - unsigned len; - unsigned *have; -{ - int ret; - unsigned get, max = ((unsigned)-1 >> 2) + 1; - - *have = 0; - do { - get = len - *have; - if (get > max) - get = max; - ret = read(state->fd, buf + *have, get); - if (ret <= 0) - break; - *have += (unsigned)ret; - } while (*have < len); - if (ret < 0) { - gz_error(state, Z_ERRNO, zstrerror()); - return -1; - } - if (ret == 0) - state->eof = 1; - return 0; -} - -/* Load up input buffer and set eof flag if last data loaded -- return -1 on - error, 0 otherwise. Note that the eof flag is set when the end of the input - file is reached, even though there may be unused data in the buffer. Once - that data has been used, no more attempts will be made to read the file. - If strm->avail_in != 0, then the current data is moved to the beginning of - the input buffer, and then the remainder of the buffer is loaded with the - available data from the input file. */ -local int gz_avail(state) - gz_statep state; -{ - unsigned got; - z_streamp strm = &(state->strm); - - if (state->err != Z_OK && state->err != Z_BUF_ERROR) - return -1; - if (state->eof == 0) { - if (strm->avail_in) { /* copy what's there to the start */ - unsigned char *p = state->in; - unsigned const char *q = strm->next_in; - unsigned n = strm->avail_in; - do { - *p++ = *q++; - } while (--n); - } - if (gz_load(state, state->in + strm->avail_in, - state->size - strm->avail_in, &got) == -1) - return -1; - strm->avail_in += got; - strm->next_in = state->in; - } - return 0; -} - -/* Look for gzip header, set up for inflate or copy. state->x.have must be 0. - If this is the first time in, allocate required memory. state->how will be - left unchanged if there is no more input data available, will be set to COPY - if there is no gzip header and direct copying will be performed, or it will - be set to GZIP for decompression. If direct copying, then leftover input - data from the input buffer will be copied to the output buffer. In that - case, all further file reads will be directly to either the output buffer or - a user buffer. If decompressing, the inflate state will be initialized. - gz_look() will return 0 on success or -1 on failure. */ -local int gz_look(state) - gz_statep state; -{ - z_streamp strm = &(state->strm); - - /* allocate read buffers and inflate memory */ - if (state->size == 0) { - /* allocate buffers */ - state->in = (unsigned char *)malloc(state->want); - state->out = (unsigned char *)malloc(state->want << 1); - if (state->in == NULL || state->out == NULL) { - free(state->out); - free(state->in); - gz_error(state, Z_MEM_ERROR, "out of memory"); - return -1; - } - state->size = state->want; - - /* allocate inflate memory */ - state->strm.zalloc = Z_NULL; - state->strm.zfree = Z_NULL; - state->strm.opaque = Z_NULL; - state->strm.avail_in = 0; - state->strm.next_in = Z_NULL; - if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) { /* gunzip */ - free(state->out); - free(state->in); - state->size = 0; - gz_error(state, Z_MEM_ERROR, "out of memory"); - return -1; - } - } - - /* get at least the magic bytes in the input buffer */ - if (strm->avail_in < 2) { - if (gz_avail(state) == -1) - return -1; - if (strm->avail_in == 0) - return 0; - } - - /* look for gzip magic bytes -- if there, do gzip decoding (note: there is - a logical dilemma here when considering the case of a partially written - gzip file, to wit, if a single 31 byte is written, then we cannot tell - whether this is a single-byte file, or just a partially written gzip - file -- for here we assume that if a gzip file is being written, then - the header will be written in a single operation, so that reading a - single byte is sufficient indication that it is not a gzip file) */ - if (strm->avail_in > 1 && - strm->next_in[0] == 31 && strm->next_in[1] == 139) { - inflateReset(strm); - state->how = GZIP; - state->direct = 0; - return 0; - } - - /* no gzip header -- if we were decoding gzip before, then this is trailing - garbage. Ignore the trailing garbage and finish. */ - if (state->direct == 0) { - strm->avail_in = 0; - state->eof = 1; - state->x.have = 0; - return 0; - } - - /* doing raw i/o, copy any leftover input to output -- this assumes that - the output buffer is larger than the input buffer, which also assures - space for gzungetc() */ - state->x.next = state->out; - if (strm->avail_in) { - memcpy(state->x.next, strm->next_in, strm->avail_in); - state->x.have = strm->avail_in; - strm->avail_in = 0; - } - state->how = COPY; - state->direct = 1; - return 0; -} - -/* Decompress from input to the provided next_out and avail_out in the state. - On return, state->x.have and state->x.next point to the just decompressed - data. If the gzip stream completes, state->how is reset to LOOK to look for - the next gzip stream or raw data, once state->x.have is depleted. Returns 0 - on success, -1 on failure. */ -local int gz_decomp(state) - gz_statep state; -{ - int ret = Z_OK; - unsigned had; - z_streamp strm = &(state->strm); - - /* fill output buffer up to end of deflate stream */ - had = strm->avail_out; - do { - /* get more input for inflate() */ - if (strm->avail_in == 0 && gz_avail(state) == -1) - return -1; - if (strm->avail_in == 0) { - gz_error(state, Z_BUF_ERROR, "unexpected end of file"); - break; - } - - /* decompress and handle errors */ - ret = inflate(strm, Z_NO_FLUSH); - if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) { - gz_error(state, Z_STREAM_ERROR, - "internal error: inflate stream corrupt"); - return -1; - } - if (ret == Z_MEM_ERROR) { - gz_error(state, Z_MEM_ERROR, "out of memory"); - return -1; - } - if (ret == Z_DATA_ERROR) { /* deflate stream invalid */ - gz_error(state, Z_DATA_ERROR, - strm->msg == NULL ? "compressed data error" : strm->msg); - return -1; - } - } while (strm->avail_out && ret != Z_STREAM_END); - - /* update available output */ - state->x.have = had - strm->avail_out; - state->x.next = strm->next_out - state->x.have; - - /* if the gzip stream completed successfully, look for another */ - if (ret == Z_STREAM_END) - state->how = LOOK; - - /* good decompression */ - return 0; -} - -/* Fetch data and put it in the output buffer. Assumes state->x.have is 0. - Data is either copied from the input file or decompressed from the input - file depending on state->how. If state->how is LOOK, then a gzip header is - looked for to determine whether to copy or decompress. Returns -1 on error, - otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the - end of the input file has been reached and all data has been processed. */ -local int gz_fetch(state) - gz_statep state; -{ - z_streamp strm = &(state->strm); - - do { - switch(state->how) { - case LOOK: /* -> LOOK, COPY (only if never GZIP), or GZIP */ - if (gz_look(state) == -1) - return -1; - if (state->how == LOOK) - return 0; - break; - case COPY: /* -> COPY */ - if (gz_load(state, state->out, state->size << 1, &(state->x.have)) - == -1) - return -1; - state->x.next = state->out; - return 0; - case GZIP: /* -> GZIP or LOOK (if end of gzip stream) */ - strm->avail_out = state->size << 1; - strm->next_out = state->out; - if (gz_decomp(state) == -1) - return -1; - } - } while (state->x.have == 0 && (!state->eof || strm->avail_in)); - return 0; -} - -/* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */ -local int gz_skip(state, len) - gz_statep state; - z_off64_t len; -{ - unsigned n; - - /* skip over len bytes or reach end-of-file, whichever comes first */ - while (len) - /* skip over whatever is in output buffer */ - if (state->x.have) { - n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ? - (unsigned)len : state->x.have; - state->x.have -= n; - state->x.next += n; - state->x.pos += n; - len -= n; - } - - /* output buffer empty -- return if we're at the end of the input */ - else if (state->eof && state->strm.avail_in == 0) - break; - - /* need more data to skip -- load up output buffer */ - else { - /* get more output, looking for header if required */ - if (gz_fetch(state) == -1) - return -1; - } - return 0; -} - -/* Read len bytes into buf from file, or less than len up to the end of the - input. Return the number of bytes read. If zero is returned, either the - end of file was reached, or there was an error. state->err must be - consulted in that case to determine which. */ -local z_size_t gz_read(state, buf, len) - gz_statep state; - voidp buf; - z_size_t len; -{ - z_size_t got; - unsigned n; - - /* if len is zero, avoid unnecessary operations */ - if (len == 0) - return 0; - - /* process a skip request */ - if (state->seek) { - state->seek = 0; - if (gz_skip(state, state->skip) == -1) - return 0; - } - - /* get len bytes to buf, or less than len if at the end */ - got = 0; - do { - /* set n to the maximum amount of len that fits in an unsigned int */ - n = -1; - if (n > len) - n = len; - - /* first just try copying data from the output buffer */ - if (state->x.have) { - if (state->x.have < n) - n = state->x.have; - memcpy(buf, state->x.next, n); - state->x.next += n; - state->x.have -= n; - } - - /* output buffer empty -- return if we're at the end of the input */ - else if (state->eof && state->strm.avail_in == 0) { - state->past = 1; /* tried to read past end */ - break; - } - - /* need output data -- for small len or new stream load up our output - buffer */ - else if (state->how == LOOK || n < (state->size << 1)) { - /* get more output, looking for header if required */ - if (gz_fetch(state) == -1) - return 0; - continue; /* no progress yet -- go back to copy above */ - /* the copy above assures that we will leave with space in the - output buffer, allowing at least one gzungetc() to succeed */ - } - - /* large len -- read directly into user buffer */ - else if (state->how == COPY) { /* read directly */ - if (gz_load(state, (unsigned char *)buf, n, &n) == -1) - return 0; - } - - /* large len -- decompress directly into user buffer */ - else { /* state->how == GZIP */ - state->strm.avail_out = n; - state->strm.next_out = (unsigned char *)buf; - if (gz_decomp(state) == -1) - return 0; - n = state->x.have; - state->x.have = 0; - } - - /* update progress */ - len -= n; - buf = (char *)buf + n; - got += n; - state->x.pos += n; - } while (len); - - /* return number of bytes read into user buffer */ - return got; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzread(file, buf, len) - gzFile file; - voidp buf; - unsigned len; -{ - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return -1; - state = (gz_statep)file; - - /* check that we're reading and that there's no (serious) error */ - if (state->mode != GZ_READ || - (state->err != Z_OK && state->err != Z_BUF_ERROR)) - return -1; - - /* since an int is returned, make sure len fits in one, otherwise return - with an error (this avoids a flaw in the interface) */ - if ((int)len < 0) { - gz_error(state, Z_STREAM_ERROR, "request does not fit in an int"); - return -1; - } - - /* read len or fewer bytes to buf */ - len = gz_read(state, buf, len); - - /* check for an error */ - if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR) - return -1; - - /* return the number of bytes read (this is assured to fit in an int) */ - return (int)len; -} - -/* -- see zlib.h -- */ -z_size_t ZEXPORT gzfread(buf, size, nitems, file) - voidp buf; - z_size_t size; - z_size_t nitems; - gzFile file; -{ - z_size_t len; - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return 0; - state = (gz_statep)file; - - /* check that we're reading and that there's no (serious) error */ - if (state->mode != GZ_READ || - (state->err != Z_OK && state->err != Z_BUF_ERROR)) - return 0; - - /* compute bytes to read -- error on overflow */ - len = nitems * size; - if (size && len / size != nitems) { - gz_error(state, Z_STREAM_ERROR, "request does not fit in a size_t"); - return 0; - } - - /* read len or fewer bytes to buf, return the number of full items read */ - return len ? gz_read(state, buf, len) / size : 0; -} - -/* -- see zlib.h -- */ -#ifdef Z_PREFIX_SET -# undef z_gzgetc -#else -# undef gzgetc -#endif -int ZEXPORT gzgetc(file) - gzFile file; -{ - int ret; - unsigned char buf[1]; - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return -1; - state = (gz_statep)file; - - /* check that we're reading and that there's no (serious) error */ - if (state->mode != GZ_READ || - (state->err != Z_OK && state->err != Z_BUF_ERROR)) - return -1; - - /* try output buffer (no need to check for skip request) */ - if (state->x.have) { - state->x.have--; - state->x.pos++; - return *(state->x.next)++; - } - - /* nothing there -- try gz_read() */ - ret = gz_read(state, buf, 1); - return ret < 1 ? -1 : buf[0]; -} - -int ZEXPORT gzgetc_(file) -gzFile file; -{ - return gzgetc(file); -} - -/* -- see zlib.h -- */ -int ZEXPORT gzungetc(c, file) - int c; - gzFile file; -{ - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return -1; - state = (gz_statep)file; - - /* check that we're reading and that there's no (serious) error */ - if (state->mode != GZ_READ || - (state->err != Z_OK && state->err != Z_BUF_ERROR)) - return -1; - - /* process a skip request */ - if (state->seek) { - state->seek = 0; - if (gz_skip(state, state->skip) == -1) - return -1; - } - - /* can't push EOF */ - if (c < 0) - return -1; - - /* if output buffer empty, put byte at end (allows more pushing) */ - if (state->x.have == 0) { - state->x.have = 1; - state->x.next = state->out + (state->size << 1) - 1; - state->x.next[0] = (unsigned char)c; - state->x.pos--; - state->past = 0; - return c; - } - - /* if no room, give up (must have already done a gzungetc()) */ - if (state->x.have == (state->size << 1)) { - gz_error(state, Z_DATA_ERROR, "out of room to push characters"); - return -1; - } - - /* slide output data if needed and insert byte before existing data */ - if (state->x.next == state->out) { - unsigned char *src = state->out + state->x.have; - unsigned char *dest = state->out + (state->size << 1); - while (src > state->out) - *--dest = *--src; - state->x.next = dest; - } - state->x.have++; - state->x.next--; - state->x.next[0] = (unsigned char)c; - state->x.pos--; - state->past = 0; - return c; -} - -/* -- see zlib.h -- */ -char * ZEXPORT gzgets(file, buf, len) - gzFile file; - char *buf; - int len; -{ - unsigned left, n; - char *str; - unsigned char *eol; - gz_statep state; - - /* check parameters and get internal structure */ - if (file == NULL || buf == NULL || len < 1) - return NULL; - state = (gz_statep)file; - - /* check that we're reading and that there's no (serious) error */ - if (state->mode != GZ_READ || - (state->err != Z_OK && state->err != Z_BUF_ERROR)) - return NULL; - - /* process a skip request */ - if (state->seek) { - state->seek = 0; - if (gz_skip(state, state->skip) == -1) - return NULL; - } - - /* copy output bytes up to new line or len - 1, whichever comes first -- - append a terminating zero to the string (we don't check for a zero in - the contents, let the user worry about that) */ - str = buf; - left = (unsigned)len - 1; - if (left) do { - /* assure that something is in the output buffer */ - if (state->x.have == 0 && gz_fetch(state) == -1) - return NULL; /* error */ - if (state->x.have == 0) { /* end of file */ - state->past = 1; /* read past end */ - break; /* return what we have */ - } - - /* look for end-of-line in current output buffer */ - n = state->x.have > left ? left : state->x.have; - eol = (unsigned char *)memchr(state->x.next, '\n', n); - if (eol != NULL) - n = (unsigned)(eol - state->x.next) + 1; - - /* copy through end-of-line, or remainder if not found */ - memcpy(buf, state->x.next, n); - state->x.have -= n; - state->x.next += n; - state->x.pos += n; - left -= n; - buf += n; - } while (left && eol == NULL); - - /* return terminated string, or if nothing, end of file */ - if (buf == str) - return NULL; - buf[0] = 0; - return str; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzdirect(file) - gzFile file; -{ - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return 0; - state = (gz_statep)file; - - /* if the state is not known, but we can find out, then do so (this is - mainly for right after a gzopen() or gzdopen()) */ - if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0) - (void)gz_look(state); - - /* return 1 if transparent, 0 if processing a gzip stream */ - return state->direct; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzclose_r(file) - gzFile file; -{ - int ret, err; - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return Z_STREAM_ERROR; - state = (gz_statep)file; - - /* check that we're reading */ - if (state->mode != GZ_READ) - return Z_STREAM_ERROR; - - /* free memory and close file */ - if (state->size) { - inflateEnd(&(state->strm)); - free(state->out); - free(state->in); - } - err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK; - gz_error(state, Z_OK, NULL); - free(state->path); - ret = close(state->fd); - free(state); - return ret ? Z_ERRNO : err; -} diff --git a/jan/src/dep/libs/zlib/gzwrite.c b/jan/src/dep/libs/zlib/gzwrite.c deleted file mode 100644 index c7b5651d7..000000000 --- a/jan/src/dep/libs/zlib/gzwrite.c +++ /dev/null @@ -1,665 +0,0 @@ -/* gzwrite.c -- zlib functions for writing gzip files - * Copyright (C) 2004-2017 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "gzguts.h" - -/* Local functions */ -local int gz_init OF((gz_statep)); -local int gz_comp OF((gz_statep, int)); -local int gz_zero OF((gz_statep, z_off64_t)); -local z_size_t gz_write OF((gz_statep, voidpc, z_size_t)); - -/* Initialize state for writing a gzip file. Mark initialization by setting - state->size to non-zero. Return -1 on a memory allocation failure, or 0 on - success. */ -local int gz_init(state) - gz_statep state; -{ - int ret; - z_streamp strm = &(state->strm); - - /* allocate input buffer (double size for gzprintf) */ - state->in = (unsigned char *)malloc(state->want << 1); - if (state->in == NULL) { - gz_error(state, Z_MEM_ERROR, "out of memory"); - return -1; - } - - /* only need output buffer and deflate state if compressing */ - if (!state->direct) { - /* allocate output buffer */ - state->out = (unsigned char *)malloc(state->want); - if (state->out == NULL) { - free(state->in); - gz_error(state, Z_MEM_ERROR, "out of memory"); - return -1; - } - - /* allocate deflate memory, set up for gzip compression */ - strm->zalloc = Z_NULL; - strm->zfree = Z_NULL; - strm->opaque = Z_NULL; - ret = deflateInit2(strm, state->level, Z_DEFLATED, - MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy); - if (ret != Z_OK) { - free(state->out); - free(state->in); - gz_error(state, Z_MEM_ERROR, "out of memory"); - return -1; - } - strm->next_in = NULL; - } - - /* mark state as initialized */ - state->size = state->want; - - /* initialize write buffer if compressing */ - if (!state->direct) { - strm->avail_out = state->size; - strm->next_out = state->out; - state->x.next = strm->next_out; - } - return 0; -} - -/* Compress whatever is at avail_in and next_in and write to the output file. - Return -1 if there is an error writing to the output file or if gz_init() - fails to allocate memory, otherwise 0. flush is assumed to be a valid - deflate() flush value. If flush is Z_FINISH, then the deflate() state is - reset to start a new gzip stream. If gz->direct is true, then simply write - to the output file without compressing, and ignore flush. */ -local int gz_comp(state, flush) - gz_statep state; - int flush; -{ - int ret, writ; - unsigned have, put, max = ((unsigned)-1 >> 2) + 1; - z_streamp strm = &(state->strm); - - /* allocate memory if this is the first time through */ - if (state->size == 0 && gz_init(state) == -1) - return -1; - - /* write directly if requested */ - if (state->direct) { - while (strm->avail_in) { - put = strm->avail_in > max ? max : strm->avail_in; - writ = write(state->fd, strm->next_in, put); - if (writ < 0) { - gz_error(state, Z_ERRNO, zstrerror()); - return -1; - } - strm->avail_in -= (unsigned)writ; - strm->next_in += writ; - } - return 0; - } - - /* run deflate() on provided input until it produces no more output */ - ret = Z_OK; - do { - /* write out current buffer contents if full, or if flushing, but if - doing Z_FINISH then don't write until we get to Z_STREAM_END */ - if (strm->avail_out == 0 || (flush != Z_NO_FLUSH && - (flush != Z_FINISH || ret == Z_STREAM_END))) { - while (strm->next_out > state->x.next) { - put = strm->next_out - state->x.next > (int)max ? max : - (unsigned)(strm->next_out - state->x.next); - writ = write(state->fd, state->x.next, put); - if (writ < 0) { - gz_error(state, Z_ERRNO, zstrerror()); - return -1; - } - state->x.next += writ; - } - if (strm->avail_out == 0) { - strm->avail_out = state->size; - strm->next_out = state->out; - state->x.next = state->out; - } - } - - /* compress */ - have = strm->avail_out; - ret = deflate(strm, flush); - if (ret == Z_STREAM_ERROR) { - gz_error(state, Z_STREAM_ERROR, - "internal error: deflate stream corrupt"); - return -1; - } - have -= strm->avail_out; - } while (have); - - /* if that completed a deflate stream, allow another to start */ - if (flush == Z_FINISH) - deflateReset(strm); - - /* all done, no errors */ - return 0; -} - -/* Compress len zeros to output. Return -1 on a write error or memory - allocation failure by gz_comp(), or 0 on success. */ -local int gz_zero(state, len) - gz_statep state; - z_off64_t len; -{ - int first; - unsigned n; - z_streamp strm = &(state->strm); - - /* consume whatever's left in the input buffer */ - if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) - return -1; - - /* compress len zeros (len guaranteed > 0) */ - first = 1; - while (len) { - n = GT_OFF(state->size) || (z_off64_t)state->size > len ? - (unsigned)len : state->size; - if (first) { - memset(state->in, 0, n); - first = 0; - } - strm->avail_in = n; - strm->next_in = state->in; - state->x.pos += n; - if (gz_comp(state, Z_NO_FLUSH) == -1) - return -1; - len -= n; - } - return 0; -} - -/* Write len bytes from buf to file. Return the number of bytes written. If - the returned value is less than len, then there was an error. */ -local z_size_t gz_write(state, buf, len) - gz_statep state; - voidpc buf; - z_size_t len; -{ - z_size_t put = len; - - /* if len is zero, avoid unnecessary operations */ - if (len == 0) - return 0; - - /* allocate memory if this is the first time through */ - if (state->size == 0 && gz_init(state) == -1) - return 0; - - /* check for seek request */ - if (state->seek) { - state->seek = 0; - if (gz_zero(state, state->skip) == -1) - return 0; - } - - /* for small len, copy to input buffer, otherwise compress directly */ - if (len < state->size) { - /* copy to input buffer, compress when full */ - do { - unsigned have, copy; - - if (state->strm.avail_in == 0) - state->strm.next_in = state->in; - have = (unsigned)((state->strm.next_in + state->strm.avail_in) - - state->in); - copy = state->size - have; - if (copy > len) - copy = len; - memcpy(state->in + have, buf, copy); - state->strm.avail_in += copy; - state->x.pos += copy; - buf = (const char *)buf + copy; - len -= copy; - if (len && gz_comp(state, Z_NO_FLUSH) == -1) - return 0; - } while (len); - } - else { - /* consume whatever's left in the input buffer */ - if (state->strm.avail_in && gz_comp(state, Z_NO_FLUSH) == -1) - return 0; - - /* directly compress user buffer to file */ - state->strm.next_in = (z_const Bytef *)buf; - do { - unsigned n = (unsigned)-1; - if (n > len) - n = len; - state->strm.avail_in = n; - state->x.pos += n; - if (gz_comp(state, Z_NO_FLUSH) == -1) - return 0; - len -= n; - } while (len); - } - - /* input was all buffered or compressed */ - return put; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzwrite(file, buf, len) - gzFile file; - voidpc buf; - unsigned len; -{ - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return 0; - state = (gz_statep)file; - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return 0; - - /* since an int is returned, make sure len fits in one, otherwise return - with an error (this avoids a flaw in the interface) */ - if ((int)len < 0) { - gz_error(state, Z_DATA_ERROR, "requested length does not fit in int"); - return 0; - } - - /* write len bytes from buf (the return value will fit in an int) */ - return (int)gz_write(state, buf, len); -} - -/* -- see zlib.h -- */ -z_size_t ZEXPORT gzfwrite(buf, size, nitems, file) - voidpc buf; - z_size_t size; - z_size_t nitems; - gzFile file; -{ - z_size_t len; - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return 0; - state = (gz_statep)file; - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return 0; - - /* compute bytes to read -- error on overflow */ - len = nitems * size; - if (size && len / size != nitems) { - gz_error(state, Z_STREAM_ERROR, "request does not fit in a size_t"); - return 0; - } - - /* write len bytes to buf, return the number of full items written */ - return len ? gz_write(state, buf, len) / size : 0; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzputc(file, c) - gzFile file; - int c; -{ - unsigned have; - unsigned char buf[1]; - gz_statep state; - z_streamp strm; - - /* get internal structure */ - if (file == NULL) - return -1; - state = (gz_statep)file; - strm = &(state->strm); - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return -1; - - /* check for seek request */ - if (state->seek) { - state->seek = 0; - if (gz_zero(state, state->skip) == -1) - return -1; - } - - /* try writing to input buffer for speed (state->size == 0 if buffer not - initialized) */ - if (state->size) { - if (strm->avail_in == 0) - strm->next_in = state->in; - have = (unsigned)((strm->next_in + strm->avail_in) - state->in); - if (have < state->size) { - state->in[have] = (unsigned char)c; - strm->avail_in++; - state->x.pos++; - return c & 0xff; - } - } - - /* no room in buffer or not initialized, use gz_write() */ - buf[0] = (unsigned char)c; - if (gz_write(state, buf, 1) != 1) - return -1; - return c & 0xff; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzputs(file, str) - gzFile file; - const char *str; -{ - int ret; - z_size_t len; - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return -1; - state = (gz_statep)file; - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return -1; - - /* write string */ - len = strlen(str); - ret = gz_write(state, str, len); - return ret == 0 && len != 0 ? -1 : ret; -} - -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -#include - -/* -- see zlib.h -- */ -int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) -{ - int len; - unsigned left; - char *next; - gz_statep state; - z_streamp strm; - - /* get internal structure */ - if (file == NULL) - return Z_STREAM_ERROR; - state = (gz_statep)file; - strm = &(state->strm); - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return Z_STREAM_ERROR; - - /* make sure we have some buffer space */ - if (state->size == 0 && gz_init(state) == -1) - return state->err; - - /* check for seek request */ - if (state->seek) { - state->seek = 0; - if (gz_zero(state, state->skip) == -1) - return state->err; - } - - /* do the printf() into the input buffer, put length in len -- the input - buffer is double-sized just for this function, so there is guaranteed to - be state->size bytes available after the current contents */ - if (strm->avail_in == 0) - strm->next_in = state->in; - next = (char *)(state->in + (strm->next_in - state->in) + strm->avail_in); - next[state->size - 1] = 0; -#ifdef NO_vsnprintf -# ifdef HAS_vsprintf_void - (void)vsprintf(next, format, va); - for (len = 0; len < state->size; len++) - if (next[len] == 0) break; -# else - len = vsprintf(next, format, va); -# endif -#else -# ifdef HAS_vsnprintf_void - (void)vsnprintf(next, state->size, format, va); - len = strlen(next); -# else - len = vsnprintf(next, state->size, format, va); -# endif -#endif - - /* check that printf() results fit in buffer */ - if (len == 0 || (unsigned)len >= state->size || next[state->size - 1] != 0) - return 0; - - /* update buffer and position, compress first half if past that */ - strm->avail_in += (unsigned)len; - state->x.pos += len; - if (strm->avail_in >= state->size) { - left = strm->avail_in - state->size; - strm->avail_in = state->size; - if (gz_comp(state, Z_NO_FLUSH) == -1) - return state->err; - memcpy(state->in, state->in + state->size, left); - strm->next_in = state->in; - strm->avail_in = left; - } - return len; -} - -int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) -{ - va_list va; - int ret; - - va_start(va, format); - ret = gzvprintf(file, format, va); - va_end(va); - return ret; -} - -#else /* !STDC && !Z_HAVE_STDARG_H */ - -/* -- see zlib.h -- */ -int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) - gzFile file; - const char *format; - int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; -{ - unsigned len, left; - char *next; - gz_statep state; - z_streamp strm; - - /* get internal structure */ - if (file == NULL) - return Z_STREAM_ERROR; - state = (gz_statep)file; - strm = &(state->strm); - - /* check that can really pass pointer in ints */ - if (sizeof(int) != sizeof(void *)) - return Z_STREAM_ERROR; - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return Z_STREAM_ERROR; - - /* make sure we have some buffer space */ - if (state->size == 0 && gz_init(state) == -1) - return state->error; - - /* check for seek request */ - if (state->seek) { - state->seek = 0; - if (gz_zero(state, state->skip) == -1) - return state->error; - } - - /* do the printf() into the input buffer, put length in len -- the input - buffer is double-sized just for this function, so there is guaranteed to - be state->size bytes available after the current contents */ - if (strm->avail_in == 0) - strm->next_in = state->in; - next = (char *)(strm->next_in + strm->avail_in); - next[state->size - 1] = 0; -#ifdef NO_snprintf -# ifdef HAS_sprintf_void - sprintf(next, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, - a13, a14, a15, a16, a17, a18, a19, a20); - for (len = 0; len < size; len++) - if (next[len] == 0) - break; -# else - len = sprintf(next, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, - a12, a13, a14, a15, a16, a17, a18, a19, a20); -# endif -#else -# ifdef HAS_snprintf_void - snprintf(next, state->size, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); - len = strlen(next); -# else - len = snprintf(next, state->size, format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); -# endif -#endif - - /* check that printf() results fit in buffer */ - if (len == 0 || len >= state->size || next[state->size - 1] != 0) - return 0; - - /* update buffer and position, compress first half if past that */ - strm->avail_in += len; - state->x.pos += len; - if (strm->avail_in >= state->size) { - left = strm->avail_in - state->size; - strm->avail_in = state->size; - if (gz_comp(state, Z_NO_FLUSH) == -1) - return state->err; - memcpy(state->in, state->in + state->size, left); - strm->next_in = state->in; - strm->avail_in = left; - } - return (int)len; -} - -#endif - -/* -- see zlib.h -- */ -int ZEXPORT gzflush(file, flush) - gzFile file; - int flush; -{ - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return Z_STREAM_ERROR; - state = (gz_statep)file; - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return Z_STREAM_ERROR; - - /* check flush parameter */ - if (flush < 0 || flush > Z_FINISH) - return Z_STREAM_ERROR; - - /* check for seek request */ - if (state->seek) { - state->seek = 0; - if (gz_zero(state, state->skip) == -1) - return state->err; - } - - /* compress remaining data with requested flush */ - (void)gz_comp(state, flush); - return state->err; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzsetparams(file, level, strategy) - gzFile file; - int level; - int strategy; -{ - gz_statep state; - z_streamp strm; - - /* get internal structure */ - if (file == NULL) - return Z_STREAM_ERROR; - state = (gz_statep)file; - strm = &(state->strm); - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return Z_STREAM_ERROR; - - /* if no change is requested, then do nothing */ - if (level == state->level && strategy == state->strategy) - return Z_OK; - - /* check for seek request */ - if (state->seek) { - state->seek = 0; - if (gz_zero(state, state->skip) == -1) - return state->err; - } - - /* change compression parameters for subsequent input */ - if (state->size) { - /* flush previous input with previous parameters before changing */ - if (strm->avail_in && gz_comp(state, Z_BLOCK) == -1) - return state->err; - deflateParams(strm, level, strategy); - } - state->level = level; - state->strategy = strategy; - return Z_OK; -} - -/* -- see zlib.h -- */ -int ZEXPORT gzclose_w(file) - gzFile file; -{ - int ret = Z_OK; - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return Z_STREAM_ERROR; - state = (gz_statep)file; - - /* check that we're writing */ - if (state->mode != GZ_WRITE) - return Z_STREAM_ERROR; - - /* check for seek request */ - if (state->seek) { - state->seek = 0; - if (gz_zero(state, state->skip) == -1) - ret = state->err; - } - - /* flush, free memory, and close file */ - if (gz_comp(state, Z_FINISH) == -1) - ret = state->err; - if (state->size) { - if (!state->direct) { - (void)deflateEnd(&(state->strm)); - free(state->out); - } - free(state->in); - } - gz_error(state, Z_OK, NULL); - free(state->path); - if (close(state->fd) == -1) - ret = Z_ERRNO; - free(state); - return ret; -} diff --git a/jan/src/dep/libs/zlib/infback.c b/jan/src/dep/libs/zlib/infback.c deleted file mode 100644 index 59679ecbf..000000000 --- a/jan/src/dep/libs/zlib/infback.c +++ /dev/null @@ -1,640 +0,0 @@ -/* infback.c -- inflate using a call-back interface - * Copyright (C) 1995-2016 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - This code is largely copied from inflate.c. Normally either infback.o or - inflate.o would be linked into an application--not both. The interface - with inffast.c is retained so that optimized assembler-coded versions of - inflate_fast() can be used with either inflate.c or infback.c. - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); - -/* - strm provides memory allocation functions in zalloc and zfree, or - Z_NULL to use the library memory allocation functions. - - windowBits is in the range 8..15, and window is a user-supplied - window and output buffer that is 2**windowBits bytes. - */ -int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) -z_streamp strm; -int windowBits; -unsigned char FAR *window; -const char *version; -int stream_size; -{ - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL || window == Z_NULL || - windowBits < 8 || windowBits > 15) - return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { -#ifdef Z_SOLO - return Z_STREAM_ERROR; -#else - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; -#endif - } - if (strm->zfree == (free_func)0) -#ifdef Z_SOLO - return Z_STREAM_ERROR; -#else - strm->zfree = zcfree; -#endif - state = (struct inflate_state FAR *)ZALLOC(strm, 1, - sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - state->dmax = 32768U; - state->wbits = (uInt)windowBits; - state->wsize = 1U << windowBits; - state->window = window; - state->wnext = 0; - state->whave = 0; - return Z_OK; -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifdef BUILDFIXED - static int virgin = 1; - static code *lenfix, *distfix; - static code fixed[544]; - - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - unsigned sym, bits; - static code *next; - - /* literal/length table */ - sym = 0; - while (sym < 144) state->lens[sym++] = 8; - while (sym < 256) state->lens[sym++] = 9; - while (sym < 280) state->lens[sym++] = 7; - while (sym < 288) state->lens[sym++] = 8; - next = fixed; - lenfix = next; - bits = 9; - inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); - - /* distance table */ - sym = 0; - while (sym < 32) state->lens[sym++] = 5; - distfix = next; - bits = 5; - inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); - - /* do this just once */ - virgin = 0; - } -#else /* !BUILDFIXED */ -# include "inffixed.h" -#endif /* BUILDFIXED */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -/* Macros for inflateBack(): */ - -/* Load returned state from inflate_fast() */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Set state from registers for inflate_fast() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Assure that some input is available. If input is requested, but denied, - then return a Z_BUF_ERROR from inflateBack(). */ -#define PULL() \ - do { \ - if (have == 0) { \ - have = in(in_desc, &next); \ - if (have == 0) { \ - next = Z_NULL; \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflateBack() - with an error if there is no input available. */ -#define PULLBYTE() \ - do { \ - PULL(); \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflateBack() with - an error. */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((1U << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* Assure that some output space is available, by writing out the window - if it's full. If the write fails, return from inflateBack() with a - Z_BUF_ERROR. */ -#define ROOM() \ - do { \ - if (left == 0) { \ - put = state->window; \ - left = state->wsize; \ - state->whave = left; \ - if (out(out_desc, put, left)) { \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* - strm provides the memory allocation functions and window buffer on input, - and provides information on the unused input on return. For Z_DATA_ERROR - returns, strm will also provide an error message. - - in() and out() are the call-back input and output functions. When - inflateBack() needs more input, it calls in(). When inflateBack() has - filled the window with output, or when it completes with data in the - window, it calls out() to write out the data. The application must not - change the provided input until in() is called again or inflateBack() - returns. The application must not change the window/output buffer until - inflateBack() returns. - - in() and out() are called with a descriptor parameter provided in the - inflateBack() call. This parameter can be a structure that provides the - information required to do the read or write, as well as accumulated - information on the input and output such as totals and check values. - - in() should return zero on failure. out() should return non-zero on - failure. If either in() or out() fails, than inflateBack() returns a - Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it - was in() or out() that caused in the error. Otherwise, inflateBack() - returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format - error, or Z_MEM_ERROR if it could not allocate memory for the state. - inflateBack() can also return Z_STREAM_ERROR if the input parameters - are not correct, i.e. strm is Z_NULL or the state was not initialized. - */ -int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) -z_streamp strm; -in_func in; -void FAR *in_desc; -out_func out; -void FAR *out_desc; -{ - struct inflate_state FAR *state; - z_const unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code here; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - /* Check that the strm exists and that the state was initialized */ - if (strm == Z_NULL || strm->state == Z_NULL) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - - /* Reset the state */ - strm->msg = Z_NULL; - state->mode = TYPE; - state->last = 0; - state->whave = 0; - next = strm->next_in; - have = next != Z_NULL ? strm->avail_in : 0; - hold = 0; - bits = 0; - put = state->window; - left = state->wsize; - - /* Inflate until end of block marked as last */ - for (;;) - switch (state->mode) { - case TYPE: - /* determine and dispatch block type */ - if (state->last) { - BYTEBITS(); - state->mode = DONE; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN; /* decode codes */ - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - - case STORED: - /* get and verify stored block length */ - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - - /* copy stored block from input to output */ - while (state->length != 0) { - copy = state->length; - PULL(); - ROOM(); - if (copy > have) copy = have; - if (copy > left) copy = left; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - - case TABLE: - /* get dynamic table entries descriptor */ - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - - /* get code length code lengths (not a typo) */ - state->have = 0; - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - - /* get length and distance code code lengths */ - state->have = 0; - while (state->have < state->nlen + state->ndist) { - for (;;) { - here = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(here.bits) <= bits) break; - PULLBYTE(); - } - if (here.val < 16) { - DROPBITS(here.bits); - state->lens[state->have++] = here.val; - } - else { - if (here.val == 16) { - NEEDBITS(here.bits + 2); - DROPBITS(here.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = (unsigned)(state->lens[state->have - 1]); - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (here.val == 17) { - NEEDBITS(here.bits + 3); - DROPBITS(here.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(here.bits + 7); - DROPBITS(here.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* check for end-of-block code (better have one) */ - if (state->lens[256] == 0) { - strm->msg = (char *)"invalid code -- missing end-of-block"; - state->mode = BAD; - break; - } - - /* build code tables -- note: do not change the lenbits or distbits - values here (9 and 6) without reading the comments in inftrees.h - concerning the ENOUGH constants, which depend on those values */ - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (code const FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN; - - case LEN: - /* use inflate_fast() if we have enough input and output */ - if (have >= 6 && left >= 258) { - RESTORE(); - if (state->whave < state->wsize) - state->whave = state->wsize - left; - inflate_fast(strm, state->wsize); - LOAD(); - break; - } - - /* get a literal, length, or end-of-block code */ - for (;;) { - here = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(here.bits) <= bits) break; - PULLBYTE(); - } - if (here.op && (here.op & 0xf0) == 0) { - last = here; - for (;;) { - here = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + here.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(here.bits); - state->length = (unsigned)here.val; - - /* process literal */ - if (here.op == 0) { - Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", here.val)); - ROOM(); - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - } - - /* process end of block */ - if (here.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - - /* invalid code */ - if (here.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - - /* length code -- get extra bits, if any */ - state->extra = (unsigned)(here.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - - /* get distance code */ - for (;;) { - here = state->distcode[BITS(state->distbits)]; - if ((unsigned)(here.bits) <= bits) break; - PULLBYTE(); - } - if ((here.op & 0xf0) == 0) { - last = here; - for (;;) { - here = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + here.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(here.bits); - if (here.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)here.val; - - /* get distance extra bits, if any */ - state->extra = (unsigned)(here.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - } - if (state->offset > state->wsize - (state->whave < state->wsize ? - left : 0)) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - - /* copy match from window to output */ - do { - ROOM(); - copy = state->wsize - state->offset; - if (copy < left) { - from = put + copy; - copy = left - copy; - } - else { - from = put - state->offset; - copy = left; - } - if (copy > state->length) copy = state->length; - state->length -= copy; - left -= copy; - do { - *put++ = *from++; - } while (--copy); - } while (state->length != 0); - break; - - case DONE: - /* inflate stream terminated properly -- write leftover output */ - ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } - goto inf_leave; - - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - - default: /* can't happen, but makes compilers happy */ - ret = Z_STREAM_ERROR; - goto inf_leave; - } - - /* Return unused input */ - inf_leave: - strm->next_in = next; - strm->avail_in = have; - return ret; -} - -int ZEXPORT inflateBackEnd(strm) -z_streamp strm; -{ - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) - return Z_STREAM_ERROR; - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} diff --git a/jan/src/dep/libs/zlib/inffast.c b/jan/src/dep/libs/zlib/inffast.c deleted file mode 100644 index 0dbd1dbc0..000000000 --- a/jan/src/dep/libs/zlib/inffast.c +++ /dev/null @@ -1,323 +0,0 @@ -/* inffast.c -- fast decoding - * Copyright (C) 1995-2017 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -#ifdef ASMINF -# pragma message("Assembler code may have bugs -- use at your own risk") -#else - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state->mode == LEN - strm->avail_in >= 6 - strm->avail_out >= 258 - start >= strm->avail_out - state->bits < 8 - - On return, state->mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm->avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm->avail_out >= 258 for each loop to avoid checking for - output space. - */ -void ZLIB_INTERNAL inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ - struct inflate_state FAR *state; - z_const unsigned char FAR *in; /* local strm->next_in */ - z_const unsigned char FAR *last; /* have enough input while in < last */ - unsigned char FAR *out; /* local strm->next_out */ - unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ - unsigned char FAR *end; /* while out < end, enough space available */ -#ifdef INFLATE_STRICT - unsigned dmax; /* maximum distance from zlib header */ -#endif - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned wnext; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ - unsigned long hold; /* local strm->hold */ - unsigned bits; /* local strm->bits */ - code const FAR *lcode; /* local strm->lencode */ - code const FAR *dcode; /* local strm->distcode */ - unsigned lmask; /* mask for first level of length codes */ - unsigned dmask; /* mask for first level of distance codes */ - code here; /* retrieved table entry */ - unsigned op; /* code bits, operation, extra bits, or */ - /* window position, window bytes to copy */ - unsigned len; /* match length, unused bytes */ - unsigned dist; /* match distance */ - unsigned char FAR *from; /* where to copy match from */ - - /* copy state to local variables */ - state = (struct inflate_state FAR *)strm->state; - in = strm->next_in; - last = in + (strm->avail_in - 5); - out = strm->next_out; - beg = out - (start - strm->avail_out); - end = out + (strm->avail_out - 257); -#ifdef INFLATE_STRICT - dmax = state->dmax; -#endif - wsize = state->wsize; - whave = state->whave; - wnext = state->wnext; - window = state->window; - hold = state->hold; - bits = state->bits; - lcode = state->lencode; - dcode = state->distcode; - lmask = (1U << state->lenbits) - 1; - dmask = (1U << state->distbits) - 1; - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - do { - if (bits < 15) { - hold += (unsigned long)(*in++) << bits; - bits += 8; - hold += (unsigned long)(*in++) << bits; - bits += 8; - } - here = lcode[hold & lmask]; - dolen: - op = (unsigned)(here.bits); - hold >>= op; - bits -= op; - op = (unsigned)(here.op); - if (op == 0) { /* literal */ - Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", here.val)); - *out++ = (unsigned char)(here.val); - } - else if (op & 16) { /* length base */ - len = (unsigned)(here.val); - op &= 15; /* number of extra bits */ - if (op) { - if (bits < op) { - hold += (unsigned long)(*in++) << bits; - bits += 8; - } - len += (unsigned)hold & ((1U << op) - 1); - hold >>= op; - bits -= op; - } - Tracevv((stderr, "inflate: length %u\n", len)); - if (bits < 15) { - hold += (unsigned long)(*in++) << bits; - bits += 8; - hold += (unsigned long)(*in++) << bits; - bits += 8; - } - here = dcode[hold & dmask]; - dodist: - op = (unsigned)(here.bits); - hold >>= op; - bits -= op; - op = (unsigned)(here.op); - if (op & 16) { /* distance base */ - dist = (unsigned)(here.val); - op &= 15; /* number of extra bits */ - if (bits < op) { - hold += (unsigned long)(*in++) << bits; - bits += 8; - if (bits < op) { - hold += (unsigned long)(*in++) << bits; - bits += 8; - } - } - dist += (unsigned)hold & ((1U << op) - 1); -#ifdef INFLATE_STRICT - if (dist > dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - hold >>= op; - bits -= op; - Tracevv((stderr, "inflate: distance %u\n", dist)); - op = (unsigned)(out - beg); /* max distance in output */ - if (dist > op) { /* see if copy from window */ - op = dist - op; /* distance back in window */ - if (op > whave) { - if (state->sane) { - strm->msg = - (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR - if (len <= op - whave) { - do { - *out++ = 0; - } while (--len); - continue; - } - len -= op - whave; - do { - *out++ = 0; - } while (--op > whave); - if (op == 0) { - from = out - dist; - do { - *out++ = *from++; - } while (--len); - continue; - } -#endif - } - from = window; - if (wnext == 0) { /* very common case */ - from += wsize - op; - if (op < len) { /* some from window */ - len -= op; - do { - *out++ = *from++; - } while (--op); - from = out - dist; /* rest from output */ - } - } - else if (wnext < op) { /* wrap around window */ - from += wsize + wnext - op; - op -= wnext; - if (op < len) { /* some from end of window */ - len -= op; - do { - *out++ = *from++; - } while (--op); - from = window; - if (wnext < len) { /* some from start of window */ - op = wnext; - len -= op; - do { - *out++ = *from++; - } while (--op); - from = out - dist; /* rest from output */ - } - } - } - else { /* contiguous in window */ - from += wnext - op; - if (op < len) { /* some from window */ - len -= op; - do { - *out++ = *from++; - } while (--op); - from = out - dist; /* rest from output */ - } - } - while (len > 2) { - *out++ = *from++; - *out++ = *from++; - *out++ = *from++; - len -= 3; - } - if (len) { - *out++ = *from++; - if (len > 1) - *out++ = *from++; - } - } - else { - from = out - dist; /* copy direct from output */ - do { /* minimum length is three */ - *out++ = *from++; - *out++ = *from++; - *out++ = *from++; - len -= 3; - } while (len > 2); - if (len) { - *out++ = *from++; - if (len > 1) - *out++ = *from++; - } - } - } - else if ((op & 64) == 0) { /* 2nd level distance code */ - here = dcode[here.val + (hold & ((1U << op) - 1))]; - goto dodist; - } - else { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - } - else if ((op & 64) == 0) { /* 2nd level length code */ - here = lcode[here.val + (hold & ((1U << op) - 1))]; - goto dolen; - } - else if (op & 32) { /* end-of-block */ - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - else { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - } while (in < last && out < end); - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - len = bits >> 3; - in -= len; - bits -= len << 3; - hold &= (1U << bits) - 1; - - /* update state and return */ - strm->next_in = in; - strm->next_out = out; - strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); - strm->avail_out = (unsigned)(out < end ? - 257 + (end - out) : 257 - (out - end)); - state->hold = hold; - state->bits = bits; - return; -} - -/* - inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): - - Using bit fields for code structure - - Different op definition to avoid & for extra bits (do & for table bits) - - Three separate decoding do-loops for direct, window, and wnext == 0 - - Special case for distance > 1 copies to do overlapped load and store copy - - Explicit branch predictions (based on measured branch probabilities) - - Deferring match copy and interspersed it with decoding subsequent codes - - Swapping literal/length else - - Swapping window/direct else - - Larger unrolled copy loops (three is about right) - - Moving len -= 3 statement into middle of loop - */ - -#endif /* !ASMINF */ diff --git a/jan/src/dep/libs/zlib/inffast.h b/jan/src/dep/libs/zlib/inffast.h deleted file mode 100644 index e5c1aa4ca..000000000 --- a/jan/src/dep/libs/zlib/inffast.h +++ /dev/null @@ -1,11 +0,0 @@ -/* inffast.h -- header to use inffast.c - * Copyright (C) 1995-2003, 2010 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); diff --git a/jan/src/dep/libs/zlib/inffixed.h b/jan/src/dep/libs/zlib/inffixed.h deleted file mode 100644 index d62832776..000000000 --- a/jan/src/dep/libs/zlib/inffixed.h +++ /dev/null @@ -1,94 +0,0 @@ - /* inffixed.h -- table for decoding fixed codes - * Generated automatically by makefixed(). - */ - - /* WARNING: this file should *not* be used by applications. - It is part of the implementation of this library and is - subject to change. Applications should only use zlib.h. - */ - - static const code lenfix[512] = { - {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, - {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, - {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, - {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, - {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, - {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, - {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, - {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, - {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, - {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, - {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, - {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, - {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, - {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, - {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, - {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, - {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, - {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, - {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, - {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, - {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, - {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, - {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, - {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, - {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, - {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, - {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, - {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, - {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, - {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, - {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, - {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, - {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, - {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, - {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, - {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, - {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, - {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, - {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, - {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, - {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, - {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, - {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, - {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, - {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, - {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, - {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, - {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, - {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, - {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, - {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, - {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, - {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, - {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, - {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, - {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, - {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, - {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, - {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, - {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, - {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, - {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, - {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, - {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, - {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, - {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, - {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, - {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, - {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, - {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, - {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, - {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, - {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, - {0,9,255} - }; - - static const code distfix[32] = { - {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, - {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, - {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, - {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, - {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, - {22,5,193},{64,5,0} - }; diff --git a/jan/src/dep/libs/zlib/inflate.c b/jan/src/dep/libs/zlib/inflate.c deleted file mode 100644 index ac333e8c2..000000000 --- a/jan/src/dep/libs/zlib/inflate.c +++ /dev/null @@ -1,1561 +0,0 @@ -/* inflate.c -- zlib decompression - * Copyright (C) 1995-2016 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * Change history: - * - * 1.2.beta0 24 Nov 2002 - * - First version -- complete rewrite of inflate to simplify code, avoid - * creation of window when not needed, minimize use of window when it is - * needed, make inffast.c even faster, implement gzip decoding, and to - * improve code readability and style over the previous zlib inflate code - * - * 1.2.beta1 25 Nov 2002 - * - Use pointers for available input and output checking in inffast.c - * - Remove input and output counters in inffast.c - * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 - * - Remove unnecessary second byte pull from length extra in inffast.c - * - Unroll direct copy to three copies per loop in inffast.c - * - * 1.2.beta2 4 Dec 2002 - * - Change external routine names to reduce potential conflicts - * - Correct filename to inffixed.h for fixed tables in inflate.c - * - Make hbuf[] unsigned char to match parameter type in inflate.c - * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset) - * to avoid negation problem on Alphas (64 bit) in inflate.c - * - * 1.2.beta3 22 Dec 2002 - * - Add comments on state->bits assertion in inffast.c - * - Add comments on op field in inftrees.h - * - Fix bug in reuse of allocated window after inflateReset() - * - Remove bit fields--back to byte structure for speed - * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths - * - Change post-increments to pre-increments in inflate_fast(), PPC biased? - * - Add compile time option, POSTINC, to use post-increments instead (Intel?) - * - Make MATCH copy in inflate() much faster for when inflate_fast() not used - * - Use local copies of stream next and avail values, as well as local bit - * buffer and bit count in inflate()--for speed when inflate_fast() not used - * - * 1.2.beta4 1 Jan 2003 - * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings - * - Move a comment on output buffer sizes from inffast.c to inflate.c - * - Add comments in inffast.c to introduce the inflate_fast() routine - * - Rearrange window copies in inflate_fast() for speed and simplification - * - Unroll last copy for window match in inflate_fast() - * - Use local copies of window variables in inflate_fast() for speed - * - Pull out common wnext == 0 case for speed in inflate_fast() - * - Make op and len in inflate_fast() unsigned for consistency - * - Add FAR to lcode and dcode declarations in inflate_fast() - * - Simplified bad distance check in inflate_fast() - * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new - * source file infback.c to provide a call-back interface to inflate for - * programs like gzip and unzip -- uses window as output buffer to avoid - * window copying - * - * 1.2.beta5 1 Jan 2003 - * - Improved inflateBack() interface to allow the caller to provide initial - * input in strm. - * - Fixed stored blocks bug in inflateBack() - * - * 1.2.beta6 4 Jan 2003 - * - Added comments in inffast.c on effectiveness of POSTINC - * - Typecasting all around to reduce compiler warnings - * - Changed loops from while (1) or do {} while (1) to for (;;), again to - * make compilers happy - * - Changed type of window in inflateBackInit() to unsigned char * - * - * 1.2.beta7 27 Jan 2003 - * - Changed many types to unsigned or unsigned short to avoid warnings - * - Added inflateCopy() function - * - * 1.2.0 9 Mar 2003 - * - Changed inflateBack() interface to provide separate opaque descriptors - * for the in() and out() functions - * - Changed inflateBack() argument and in_func typedef to swap the length - * and buffer address return values for the input function - * - Check next_in and next_out for Z_NULL on entry to inflate() - * - * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -#ifdef MAKEFIXED -# ifndef BUILDFIXED -# define BUILDFIXED -# endif -#endif - -/* function prototypes */ -local int inflateStateCheck OF((z_streamp strm)); -local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, - unsigned copy)); -#ifdef BUILDFIXED - void makefixed OF((void)); -#endif -local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, - unsigned len)); - -local int inflateStateCheck(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - if (strm == Z_NULL || - strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) - return 1; - state = (struct inflate_state FAR *)strm->state; - if (state == Z_NULL || state->strm != strm || - state->mode < HEAD || state->mode > SYNC) - return 1; - return 0; -} - -int ZEXPORT inflateResetKeep(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - strm->total_in = strm->total_out = state->total = 0; - strm->msg = Z_NULL; - if (state->wrap) /* to support ill-conceived Java test suite */ - strm->adler = state->wrap & 1; - state->mode = HEAD; - state->last = 0; - state->havedict = 0; - state->dmax = 32768U; - state->head = Z_NULL; - state->hold = 0; - state->bits = 0; - state->lencode = state->distcode = state->next = state->codes; - state->sane = 1; - state->back = -1; - Tracev((stderr, "inflate: reset\n")); - return Z_OK; -} - -int ZEXPORT inflateReset(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - state->wsize = 0; - state->whave = 0; - state->wnext = 0; - return inflateResetKeep(strm); -} - -int ZEXPORT inflateReset2(strm, windowBits) -z_streamp strm; -int windowBits; -{ - int wrap; - struct inflate_state FAR *state; - - /* get the state */ - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - - /* extract wrap request from windowBits parameter */ - if (windowBits < 0) { - wrap = 0; - windowBits = -windowBits; - } - else { - wrap = (windowBits >> 4) + 5; -#ifdef GUNZIP - if (windowBits < 48) - windowBits &= 15; -#endif - } - - /* set number of window bits, free window if different */ - if (windowBits && (windowBits < 8 || windowBits > 15)) - return Z_STREAM_ERROR; - if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) { - ZFREE(strm, state->window); - state->window = Z_NULL; - } - - /* update state and reset the rest of it */ - state->wrap = wrap; - state->wbits = (unsigned)windowBits; - return inflateReset(strm); -} - -int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) -z_streamp strm; -int windowBits; -const char *version; -int stream_size; -{ - int ret; - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL) return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { -#ifdef Z_SOLO - return Z_STREAM_ERROR; -#else - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; -#endif - } - if (strm->zfree == (free_func)0) -#ifdef Z_SOLO - return Z_STREAM_ERROR; -#else - strm->zfree = zcfree; -#endif - state = (struct inflate_state FAR *) - ZALLOC(strm, 1, sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - state->strm = strm; - state->window = Z_NULL; - state->mode = HEAD; /* to pass state test in inflateReset2() */ - ret = inflateReset2(strm, windowBits); - if (ret != Z_OK) { - ZFREE(strm, state); - strm->state = Z_NULL; - } - return ret; -} - -int ZEXPORT inflateInit_(strm, version, stream_size) -z_streamp strm; -const char *version; -int stream_size; -{ - return inflateInit2_(strm, DEF_WBITS, version, stream_size); -} - -int ZEXPORT inflatePrime(strm, bits, value) -z_streamp strm; -int bits; -int value; -{ - struct inflate_state FAR *state; - - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (bits < 0) { - state->hold = 0; - state->bits = 0; - return Z_OK; - } - if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR; - value &= (1L << bits) - 1; - state->hold += (unsigned)value << state->bits; - state->bits += (uInt)bits; - return Z_OK; -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifdef BUILDFIXED - static int virgin = 1; - static code *lenfix, *distfix; - static code fixed[544]; - - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - unsigned sym, bits; - static code *next; - - /* literal/length table */ - sym = 0; - while (sym < 144) state->lens[sym++] = 8; - while (sym < 256) state->lens[sym++] = 9; - while (sym < 280) state->lens[sym++] = 7; - while (sym < 288) state->lens[sym++] = 8; - next = fixed; - lenfix = next; - bits = 9; - inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); - - /* distance table */ - sym = 0; - while (sym < 32) state->lens[sym++] = 5; - distfix = next; - bits = 5; - inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); - - /* do this just once */ - virgin = 0; - } -#else /* !BUILDFIXED */ -# include "inffixed.h" -#endif /* BUILDFIXED */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -#ifdef MAKEFIXED -#include - -/* - Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also - defines BUILDFIXED, so the tables are built on the fly. makefixed() writes - those tables to stdout, which would be piped to inffixed.h. A small program - can simply call makefixed to do this: - - void makefixed(void); - - int main(void) - { - makefixed(); - return 0; - } - - Then that can be linked with zlib built with MAKEFIXED defined and run: - - a.out > inffixed.h - */ -void makefixed() -{ - unsigned low, size; - struct inflate_state state; - - fixedtables(&state); - puts(" /* inffixed.h -- table for decoding fixed codes"); - puts(" * Generated automatically by makefixed()."); - puts(" */"); - puts(""); - puts(" /* WARNING: this file should *not* be used by applications."); - puts(" It is part of the implementation of this library and is"); - puts(" subject to change. Applications should only use zlib.h."); - puts(" */"); - puts(""); - size = 1U << 9; - printf(" static const code lenfix[%u] = {", size); - low = 0; - for (;;) { - if ((low % 7) == 0) printf("\n "); - printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op, - state.lencode[low].bits, state.lencode[low].val); - if (++low == size) break; - putchar(','); - } - puts("\n };"); - size = 1U << 5; - printf("\n static const code distfix[%u] = {", size); - low = 0; - for (;;) { - if ((low % 6) == 0) printf("\n "); - printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, - state.distcode[low].val); - if (++low == size) break; - putchar(','); - } - puts("\n };"); -} -#endif /* MAKEFIXED */ - -/* - Update the window with the last wsize (normally 32K) bytes written before - returning. If window does not exist yet, create it. This is only called - when a window is already in use, or when output has been written during this - inflate call, but the end of the deflate stream has not been reached yet. - It is also called to create a window for dictionary data when a dictionary - is loaded. - - Providing output buffers larger than 32K to inflate() should provide a speed - advantage, since only the last 32K of output is copied to the sliding window - upon return from inflate(), and since all distances after the first 32K of - output will fall in the output data, making match copies simpler and faster. - The advantage may be dependent on the size of the processor's data caches. - */ -local int updatewindow(strm, end, copy) -z_streamp strm; -const Bytef *end; -unsigned copy; -{ - struct inflate_state FAR *state; - unsigned dist; - - state = (struct inflate_state FAR *)strm->state; - - /* if it hasn't been done already, allocate space for the window */ - if (state->window == Z_NULL) { - state->window = (unsigned char FAR *) - ZALLOC(strm, 1U << state->wbits, - sizeof(unsigned char)); - if (state->window == Z_NULL) return 1; - } - - /* if window not in use yet, initialize */ - if (state->wsize == 0) { - state->wsize = 1U << state->wbits; - state->wnext = 0; - state->whave = 0; - } - - /* copy state->wsize or less output bytes into the circular window */ - if (copy >= state->wsize) { - zmemcpy(state->window, end - state->wsize, state->wsize); - state->wnext = 0; - state->whave = state->wsize; - } - else { - dist = state->wsize - state->wnext; - if (dist > copy) dist = copy; - zmemcpy(state->window + state->wnext, end - copy, dist); - copy -= dist; - if (copy) { - zmemcpy(state->window, end - copy, copy); - state->wnext = copy; - state->whave = state->wsize; - } - else { - state->wnext += dist; - if (state->wnext == state->wsize) state->wnext = 0; - if (state->whave < state->wsize) state->whave += dist; - } - } - return 0; -} - -/* Macros for inflate(): */ - -/* check function to use adler32() for zlib or crc32() for gzip */ -#ifdef GUNZIP -# define UPDATE(check, buf, len) \ - (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) -#else -# define UPDATE(check, buf, len) adler32(check, buf, len) -#endif - -/* check macros for header crc */ -#ifdef GUNZIP -# define CRC2(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - check = crc32(check, hbuf, 2); \ - } while (0) - -# define CRC4(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - hbuf[2] = (unsigned char)((word) >> 16); \ - hbuf[3] = (unsigned char)((word) >> 24); \ - check = crc32(check, hbuf, 4); \ - } while (0) -#endif - -/* Load registers with state in inflate() for speed */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Restore state from registers in inflate() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflate() - if there is no input available. */ -#define PULLBYTE() \ - do { \ - if (have == 0) goto inf_leave; \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflate(). */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((1U << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* - inflate() uses a state machine to process as much input data and generate as - much output data as possible before returning. The state machine is - structured roughly as follows: - - for (;;) switch (state) { - ... - case STATEn: - if (not enough input data or output space to make progress) - return; - ... make progress ... - state = STATEm; - break; - ... - } - - so when inflate() is called again, the same case is attempted again, and - if the appropriate resources are provided, the machine proceeds to the - next state. The NEEDBITS() macro is usually the way the state evaluates - whether it can proceed or should return. NEEDBITS() does the return if - the requested bits are not available. The typical use of the BITS macros - is: - - NEEDBITS(n); - ... do something with BITS(n) ... - DROPBITS(n); - - where NEEDBITS(n) either returns from inflate() if there isn't enough - input left to load n bits into the accumulator, or it continues. BITS(n) - gives the low n bits in the accumulator. When done, DROPBITS(n) drops - the low n bits off the accumulator. INITBITS() clears the accumulator - and sets the number of available bits to zero. BYTEBITS() discards just - enough bits to put the accumulator on a byte boundary. After BYTEBITS() - and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. - - NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return - if there is no input available. The decoding of variable length codes uses - PULLBYTE() directly in order to pull just enough bytes to decode the next - code, and no more. - - Some states loop until they get enough input, making sure that enough - state information is maintained to continue the loop where it left off - if NEEDBITS() returns in the loop. For example, want, need, and keep - would all have to actually be part of the saved state in case NEEDBITS() - returns: - - case STATEw: - while (want < need) { - NEEDBITS(n); - keep[want++] = BITS(n); - DROPBITS(n); - } - state = STATEx; - case STATEx: - - As shown above, if the next state is also the next case, then the break - is omitted. - - A state may also return if there is not enough output space available to - complete that state. Those states are copying stored data, writing a - literal byte, and copying a matching string. - - When returning, a "goto inf_leave" is used to update the total counters, - update the check value, and determine whether any progress has been made - during that inflate() call in order to return the proper return code. - Progress is defined as a change in either strm->avail_in or strm->avail_out. - When there is a window, goto inf_leave will update the window with the last - output written. If a goto inf_leave occurs in the middle of decompression - and there is no window currently, goto inf_leave will create one and copy - output to the window for the next call of inflate(). - - In this implementation, the flush parameter of inflate() only affects the - return code (per zlib.h). inflate() always writes as much as possible to - strm->next_out, given the space available and the provided input--the effect - documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers - the allocation of and copying into a sliding window until necessary, which - provides the effect documented in zlib.h for Z_FINISH when the entire input - stream available. So the only thing the flush parameter actually does is: - when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it - will return Z_BUF_ERROR if it has not reached the end of the stream. - */ - -int ZEXPORT inflate(strm, flush) -z_streamp strm; -int flush; -{ - struct inflate_state FAR *state; - z_const unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned in, out; /* save starting available input and output */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code here; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ -#ifdef GUNZIP - unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ -#endif - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - if (inflateStateCheck(strm) || strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0)) - return Z_STREAM_ERROR; - - state = (struct inflate_state FAR *)strm->state; - if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ - LOAD(); - in = have; - out = left; - ret = Z_OK; - for (;;) - switch (state->mode) { - case HEAD: - if (state->wrap == 0) { - state->mode = TYPEDO; - break; - } - NEEDBITS(16); -#ifdef GUNZIP - if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ - if (state->wbits == 0) - state->wbits = 15; - state->check = crc32(0L, Z_NULL, 0); - CRC2(state->check, hold); - INITBITS(); - state->mode = FLAGS; - break; - } - state->flags = 0; /* expect zlib header */ - if (state->head != Z_NULL) - state->head->done = -1; - if (!(state->wrap & 1) || /* check if zlib header allowed */ -#else - if ( -#endif - ((BITS(8) << 8) + (hold >> 8)) % 31) { - strm->msg = (char *)"incorrect header check"; - state->mode = BAD; - break; - } - if (BITS(4) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - DROPBITS(4); - len = BITS(4) + 8; - if (state->wbits == 0) - state->wbits = len; - if (len > 15 || len > state->wbits) { - strm->msg = (char *)"invalid window size"; - state->mode = BAD; - break; - } - state->dmax = 1U << len; - Tracev((stderr, "inflate: zlib header ok\n")); - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = hold & 0x200 ? DICTID : TYPE; - INITBITS(); - break; -#ifdef GUNZIP - case FLAGS: - NEEDBITS(16); - state->flags = (int)(hold); - if ((state->flags & 0xff) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - if (state->flags & 0xe000) { - strm->msg = (char *)"unknown header flags set"; - state->mode = BAD; - break; - } - if (state->head != Z_NULL) - state->head->text = (int)((hold >> 8) & 1); - if ((state->flags & 0x0200) && (state->wrap & 4)) - CRC2(state->check, hold); - INITBITS(); - state->mode = TIME; - case TIME: - NEEDBITS(32); - if (state->head != Z_NULL) - state->head->time = hold; - if ((state->flags & 0x0200) && (state->wrap & 4)) - CRC4(state->check, hold); - INITBITS(); - state->mode = OS; - case OS: - NEEDBITS(16); - if (state->head != Z_NULL) { - state->head->xflags = (int)(hold & 0xff); - state->head->os = (int)(hold >> 8); - } - if ((state->flags & 0x0200) && (state->wrap & 4)) - CRC2(state->check, hold); - INITBITS(); - state->mode = EXLEN; - case EXLEN: - if (state->flags & 0x0400) { - NEEDBITS(16); - state->length = (unsigned)(hold); - if (state->head != Z_NULL) - state->head->extra_len = (unsigned)hold; - if ((state->flags & 0x0200) && (state->wrap & 4)) - CRC2(state->check, hold); - INITBITS(); - } - else if (state->head != Z_NULL) - state->head->extra = Z_NULL; - state->mode = EXTRA; - case EXTRA: - if (state->flags & 0x0400) { - copy = state->length; - if (copy > have) copy = have; - if (copy) { - if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; - zmemcpy(state->head->extra + len, next, - len + copy > state->head->extra_max ? - state->head->extra_max - len : copy); - } - if ((state->flags & 0x0200) && (state->wrap & 4)) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - state->length -= copy; - } - if (state->length) goto inf_leave; - } - state->length = 0; - state->mode = NAME; - case NAME: - if (state->flags & 0x0800) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->name != Z_NULL && - state->length < state->head->name_max) - state->head->name[state->length++] = (Bytef)len; - } while (len && copy < have); - if ((state->flags & 0x0200) && (state->wrap & 4)) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->name = Z_NULL; - state->length = 0; - state->mode = COMMENT; - case COMMENT: - if (state->flags & 0x1000) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->comment != Z_NULL && - state->length < state->head->comm_max) - state->head->comment[state->length++] = (Bytef)len; - } while (len && copy < have); - if ((state->flags & 0x0200) && (state->wrap & 4)) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->comment = Z_NULL; - state->mode = HCRC; - case HCRC: - if (state->flags & 0x0200) { - NEEDBITS(16); - if ((state->wrap & 4) && hold != (state->check & 0xffff)) { - strm->msg = (char *)"header crc mismatch"; - state->mode = BAD; - break; - } - INITBITS(); - } - if (state->head != Z_NULL) { - state->head->hcrc = (int)((state->flags >> 9) & 1); - state->head->done = 1; - } - strm->adler = state->check = crc32(0L, Z_NULL, 0); - state->mode = TYPE; - break; -#endif - case DICTID: - NEEDBITS(32); - strm->adler = state->check = ZSWAP32(hold); - INITBITS(); - state->mode = DICT; - case DICT: - if (state->havedict == 0) { - RESTORE(); - return Z_NEED_DICT; - } - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = TYPE; - case TYPE: - if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave; - case TYPEDO: - if (state->last) { - BYTEBITS(); - state->mode = CHECK; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN_; /* decode codes */ - if (flush == Z_TREES) { - DROPBITS(2); - goto inf_leave; - } - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - case STORED: - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - state->mode = COPY_; - if (flush == Z_TREES) goto inf_leave; - case COPY_: - state->mode = COPY; - case COPY: - copy = state->length; - if (copy) { - if (copy > have) copy = have; - if (copy > left) copy = left; - if (copy == 0) goto inf_leave; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - break; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - case TABLE: - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - state->have = 0; - state->mode = LENLENS; - case LENLENS: - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (const code FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - state->have = 0; - state->mode = CODELENS; - case CODELENS: - while (state->have < state->nlen + state->ndist) { - for (;;) { - here = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(here.bits) <= bits) break; - PULLBYTE(); - } - if (here.val < 16) { - DROPBITS(here.bits); - state->lens[state->have++] = here.val; - } - else { - if (here.val == 16) { - NEEDBITS(here.bits + 2); - DROPBITS(here.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = state->lens[state->have - 1]; - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (here.val == 17) { - NEEDBITS(here.bits + 3); - DROPBITS(here.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(here.bits + 7); - DROPBITS(here.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* check for end-of-block code (better have one) */ - if (state->lens[256] == 0) { - strm->msg = (char *)"invalid code -- missing end-of-block"; - state->mode = BAD; - break; - } - - /* build code tables -- note: do not change the lenbits or distbits - values here (9 and 6) without reading the comments in inftrees.h - concerning the ENOUGH constants, which depend on those values */ - state->next = state->codes; - state->lencode = (const code FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (const code FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN_; - if (flush == Z_TREES) goto inf_leave; - case LEN_: - state->mode = LEN; - case LEN: - if (have >= 6 && left >= 258) { - RESTORE(); - inflate_fast(strm, out); - LOAD(); - if (state->mode == TYPE) - state->back = -1; - break; - } - state->back = 0; - for (;;) { - here = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(here.bits) <= bits) break; - PULLBYTE(); - } - if (here.op && (here.op & 0xf0) == 0) { - last = here; - for (;;) { - here = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + here.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - state->back += last.bits; - } - DROPBITS(here.bits); - state->back += here.bits; - state->length = (unsigned)here.val; - if ((int)(here.op) == 0) { - Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", here.val)); - state->mode = LIT; - break; - } - if (here.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->back = -1; - state->mode = TYPE; - break; - } - if (here.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - state->extra = (unsigned)(here.op) & 15; - state->mode = LENEXT; - case LENEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - state->back += state->extra; - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - state->was = state->length; - state->mode = DIST; - case DIST: - for (;;) { - here = state->distcode[BITS(state->distbits)]; - if ((unsigned)(here.bits) <= bits) break; - PULLBYTE(); - } - if ((here.op & 0xf0) == 0) { - last = here; - for (;;) { - here = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + here.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - state->back += last.bits; - } - DROPBITS(here.bits); - state->back += here.bits; - if (here.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)here.val; - state->extra = (unsigned)(here.op) & 15; - state->mode = DISTEXT; - case DISTEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - state->back += state->extra; - } -#ifdef INFLATE_STRICT - if (state->offset > state->dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - state->mode = MATCH; - case MATCH: - if (left == 0) goto inf_leave; - copy = out - left; - if (state->offset > copy) { /* copy from window */ - copy = state->offset - copy; - if (copy > state->whave) { - if (state->sane) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR - Trace((stderr, "inflate.c too far\n")); - copy -= state->whave; - if (copy > state->length) copy = state->length; - if (copy > left) copy = left; - left -= copy; - state->length -= copy; - do { - *put++ = 0; - } while (--copy); - if (state->length == 0) state->mode = LEN; - break; -#endif - } - if (copy > state->wnext) { - copy -= state->wnext; - from = state->window + (state->wsize - copy); - } - else - from = state->window + (state->wnext - copy); - if (copy > state->length) copy = state->length; - } - else { /* copy from output */ - from = put - state->offset; - copy = state->length; - } - if (copy > left) copy = left; - left -= copy; - state->length -= copy; - do { - *put++ = *from++; - } while (--copy); - if (state->length == 0) state->mode = LEN; - break; - case LIT: - if (left == 0) goto inf_leave; - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - case CHECK: - if (state->wrap) { - NEEDBITS(32); - out -= left; - strm->total_out += out; - state->total += out; - if ((state->wrap & 4) && out) - strm->adler = state->check = - UPDATE(state->check, put - out, out); - out = left; - if ((state->wrap & 4) && ( -#ifdef GUNZIP - state->flags ? hold : -#endif - ZSWAP32(hold)) != state->check) { - strm->msg = (char *)"incorrect data check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: check matches trailer\n")); - } -#ifdef GUNZIP - state->mode = LENGTH; - case LENGTH: - if (state->wrap && state->flags) { - NEEDBITS(32); - if (hold != (state->total & 0xffffffffUL)) { - strm->msg = (char *)"incorrect length check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: length matches trailer\n")); - } -#endif - state->mode = DONE; - case DONE: - ret = Z_STREAM_END; - goto inf_leave; - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - default: - return Z_STREAM_ERROR; - } - - /* - Return from inflate(), updating the total counts and the check value. - If there was no progress during the inflate() call, return a buffer - error. Call updatewindow() to create and/or update the window state. - Note: a memory error from inflate() is non-recoverable. - */ - inf_leave: - RESTORE(); - if (state->wsize || (out != strm->avail_out && state->mode < BAD && - (state->mode < CHECK || flush != Z_FINISH))) - if (updatewindow(strm, strm->next_out, out - strm->avail_out)) { - state->mode = MEM; - return Z_MEM_ERROR; - } - in -= strm->avail_in; - out -= strm->avail_out; - strm->total_in += in; - strm->total_out += out; - state->total += out; - if ((state->wrap & 4) && out) - strm->adler = state->check = - UPDATE(state->check, strm->next_out - out, out); - strm->data_type = (int)state->bits + (state->last ? 64 : 0) + - (state->mode == TYPE ? 128 : 0) + - (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); - if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) - ret = Z_BUF_ERROR; - return ret; -} - -int ZEXPORT inflateEnd(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - if (inflateStateCheck(strm)) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->window != Z_NULL) ZFREE(strm, state->window); - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} - -int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) -z_streamp strm; -Bytef *dictionary; -uInt *dictLength; -{ - struct inflate_state FAR *state; - - /* check state */ - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - - /* copy dictionary */ - if (state->whave && dictionary != Z_NULL) { - zmemcpy(dictionary, state->window + state->wnext, - state->whave - state->wnext); - zmemcpy(dictionary + state->whave - state->wnext, - state->window, state->wnext); - } - if (dictLength != Z_NULL) - *dictLength = state->whave; - return Z_OK; -} - -int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) -z_streamp strm; -const Bytef *dictionary; -uInt dictLength; -{ - struct inflate_state FAR *state; - unsigned long dictid; - int ret; - - /* check state */ - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->wrap != 0 && state->mode != DICT) - return Z_STREAM_ERROR; - - /* check for correct dictionary identifier */ - if (state->mode == DICT) { - dictid = adler32(0L, Z_NULL, 0); - dictid = adler32(dictid, dictionary, dictLength); - if (dictid != state->check) - return Z_DATA_ERROR; - } - - /* copy dictionary to window using updatewindow(), which will amend the - existing dictionary if appropriate */ - ret = updatewindow(strm, dictionary + dictLength, dictLength); - if (ret) { - state->mode = MEM; - return Z_MEM_ERROR; - } - state->havedict = 1; - Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; -} - -int ZEXPORT inflateGetHeader(strm, head) -z_streamp strm; -gz_headerp head; -{ - struct inflate_state FAR *state; - - /* check state */ - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; - - /* save header structure */ - state->head = head; - head->done = 0; - return Z_OK; -} - -/* - Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found - or when out of input. When called, *have is the number of pattern bytes - found in order so far, in 0..3. On return *have is updated to the new - state. If on return *have equals four, then the pattern was found and the - return value is how many bytes were read including the last byte of the - pattern. If *have is less than four, then the pattern has not been found - yet and the return value is len. In the latter case, syncsearch() can be - called again with more data and the *have state. *have is initialized to - zero for the first call. - */ -local unsigned syncsearch(have, buf, len) -unsigned FAR *have; -const unsigned char FAR *buf; -unsigned len; -{ - unsigned got; - unsigned next; - - got = *have; - next = 0; - while (next < len && got < 4) { - if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) - got++; - else if (buf[next]) - got = 0; - else - got = 4 - got; - next++; - } - *have = got; - return next; -} - -int ZEXPORT inflateSync(strm) -z_streamp strm; -{ - unsigned len; /* number of bytes to look at or looked at */ - unsigned long in, out; /* temporary to save total_in and total_out */ - unsigned char buf[4]; /* to restore bit buffer to byte string */ - struct inflate_state FAR *state; - - /* check parameters */ - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; - - /* if first time, start search in bit buffer */ - if (state->mode != SYNC) { - state->mode = SYNC; - state->hold <<= state->bits & 7; - state->bits -= state->bits & 7; - len = 0; - while (state->bits >= 8) { - buf[len++] = (unsigned char)(state->hold); - state->hold >>= 8; - state->bits -= 8; - } - state->have = 0; - syncsearch(&(state->have), buf, len); - } - - /* search available input */ - len = syncsearch(&(state->have), strm->next_in, strm->avail_in); - strm->avail_in -= len; - strm->next_in += len; - strm->total_in += len; - - /* return no joy or set up to restart inflate() on a new block */ - if (state->have != 4) return Z_DATA_ERROR; - in = strm->total_in; out = strm->total_out; - inflateReset(strm); - strm->total_in = in; strm->total_out = out; - state->mode = TYPE; - return Z_OK; -} - -/* - Returns true if inflate is currently at the end of a block generated by - Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP - implementation to provide an additional safety check. PPP uses - Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored - block. When decompressing, PPP checks that at the end of input packet, - inflate is waiting for these length bytes. - */ -int ZEXPORT inflateSyncPoint(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - return state->mode == STORED && state->bits == 0; -} - -int ZEXPORT inflateCopy(dest, source) -z_streamp dest; -z_streamp source; -{ - struct inflate_state FAR *state; - struct inflate_state FAR *copy; - unsigned char FAR *window; - unsigned wsize; - - /* check input */ - if (inflateStateCheck(source) || dest == Z_NULL) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)source->state; - - /* allocate space */ - copy = (struct inflate_state FAR *) - ZALLOC(source, 1, sizeof(struct inflate_state)); - if (copy == Z_NULL) return Z_MEM_ERROR; - window = Z_NULL; - if (state->window != Z_NULL) { - window = (unsigned char FAR *) - ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); - if (window == Z_NULL) { - ZFREE(source, copy); - return Z_MEM_ERROR; - } - } - - /* copy state */ - zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); - zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state)); - copy->strm = dest; - if (state->lencode >= state->codes && - state->lencode <= state->codes + ENOUGH - 1) { - copy->lencode = copy->codes + (state->lencode - state->codes); - copy->distcode = copy->codes + (state->distcode - state->codes); - } - copy->next = copy->codes + (state->next - state->codes); - if (window != Z_NULL) { - wsize = 1U << state->wbits; - zmemcpy(window, state->window, wsize); - } - copy->window = window; - dest->state = (struct internal_state FAR *)copy; - return Z_OK; -} - -int ZEXPORT inflateUndermine(strm, subvert) -z_streamp strm; -int subvert; -{ - struct inflate_state FAR *state; - - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; -#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR - state->sane = !subvert; - return Z_OK; -#else - (void)subvert; - state->sane = 1; - return Z_DATA_ERROR; -#endif -} - -int ZEXPORT inflateValidate(strm, check) -z_streamp strm; -int check; -{ - struct inflate_state FAR *state; - - if (inflateStateCheck(strm)) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (check) - state->wrap |= 4; - else - state->wrap &= ~4; - return Z_OK; -} - -long ZEXPORT inflateMark(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (inflateStateCheck(strm)) - return -(1L << 16); - state = (struct inflate_state FAR *)strm->state; - return (long)(((unsigned long)((long)state->back)) << 16) + - (state->mode == COPY ? state->length : - (state->mode == MATCH ? state->was - state->length : 0)); -} - -unsigned long ZEXPORT inflateCodesUsed(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - if (inflateStateCheck(strm)) return (unsigned long)-1; - state = (struct inflate_state FAR *)strm->state; - return (unsigned long)(state->next - state->codes); -} diff --git a/jan/src/dep/libs/zlib/inflate.h b/jan/src/dep/libs/zlib/inflate.h deleted file mode 100644 index a46cce6b6..000000000 --- a/jan/src/dep/libs/zlib/inflate.h +++ /dev/null @@ -1,125 +0,0 @@ -/* inflate.h -- internal inflate state definition - * Copyright (C) 1995-2016 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* define NO_GZIP when compiling if you want to disable gzip header and - trailer decoding by inflate(). NO_GZIP would be used to avoid linking in - the crc code when it is not needed. For shared libraries, gzip decoding - should be left enabled. */ -#ifndef NO_GZIP -# define GUNZIP -#endif - -/* Possible inflate modes between inflate() calls */ -typedef enum { - HEAD = 16180, /* i: waiting for magic header */ - FLAGS, /* i: waiting for method and flags (gzip) */ - TIME, /* i: waiting for modification time (gzip) */ - OS, /* i: waiting for extra flags and operating system (gzip) */ - EXLEN, /* i: waiting for extra length (gzip) */ - EXTRA, /* i: waiting for extra bytes (gzip) */ - NAME, /* i: waiting for end of file name (gzip) */ - COMMENT, /* i: waiting for end of comment (gzip) */ - HCRC, /* i: waiting for header crc (gzip) */ - DICTID, /* i: waiting for dictionary check value */ - DICT, /* waiting for inflateSetDictionary() call */ - TYPE, /* i: waiting for type bits, including last-flag bit */ - TYPEDO, /* i: same, but skip check to exit inflate on new block */ - STORED, /* i: waiting for stored size (length and complement) */ - COPY_, /* i/o: same as COPY below, but only first time in */ - COPY, /* i/o: waiting for input or output to copy stored block */ - TABLE, /* i: waiting for dynamic block table lengths */ - LENLENS, /* i: waiting for code length code lengths */ - CODELENS, /* i: waiting for length/lit and distance code lengths */ - LEN_, /* i: same as LEN below, but only first time in */ - LEN, /* i: waiting for length/lit/eob code */ - LENEXT, /* i: waiting for length extra bits */ - DIST, /* i: waiting for distance code */ - DISTEXT, /* i: waiting for distance extra bits */ - MATCH, /* o: waiting for output space to copy string */ - LIT, /* o: waiting for output space to write literal */ - CHECK, /* i: waiting for 32-bit check value */ - LENGTH, /* i: waiting for 32-bit length (gzip) */ - DONE, /* finished check, done -- remain here until reset */ - BAD, /* got a data error -- remain here until reset */ - MEM, /* got an inflate() memory error -- remain here until reset */ - SYNC /* looking for synchronization bytes to restart inflate() */ -} inflate_mode; - -/* - State transitions between above modes - - - (most modes can go to BAD or MEM on error -- not shown for clarity) - - Process header: - HEAD -> (gzip) or (zlib) or (raw) - (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT -> - HCRC -> TYPE - (zlib) -> DICTID or TYPE - DICTID -> DICT -> TYPE - (raw) -> TYPEDO - Read deflate blocks: - TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK - STORED -> COPY_ -> COPY -> TYPE - TABLE -> LENLENS -> CODELENS -> LEN_ - LEN_ -> LEN - Read deflate codes in fixed or dynamic block: - LEN -> LENEXT or LIT or TYPE - LENEXT -> DIST -> DISTEXT -> MATCH -> LEN - LIT -> LEN - Process trailer: - CHECK -> LENGTH -> DONE - */ - -/* State maintained between inflate() calls -- approximately 7K bytes, not - including the allocated sliding window, which is up to 32K bytes. */ -struct inflate_state { - z_streamp strm; /* pointer back to this zlib stream */ - inflate_mode mode; /* current inflate mode */ - int last; /* true if processing last block */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip, - bit 2 true to validate check value */ - int havedict; /* true if dictionary provided */ - int flags; /* gzip header method and flags (0 if zlib) */ - unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ - unsigned long check; /* protected copy of check value */ - unsigned long total; /* protected copy of output count */ - gz_headerp head; /* where to save gzip header information */ - /* sliding window */ - unsigned wbits; /* log base 2 of requested window size */ - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned wnext; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if needed */ - /* bit accumulator */ - unsigned long hold; /* input bit accumulator */ - unsigned bits; /* number of bits in "in" */ - /* for string and stored block copying */ - unsigned length; /* literal or length of data to copy */ - unsigned offset; /* distance back to copy string from */ - /* for table and code decoding */ - unsigned extra; /* extra bits needed */ - /* fixed and dynamic code tables */ - code const FAR *lencode; /* starting table for length/literal codes */ - code const FAR *distcode; /* starting table for distance codes */ - unsigned lenbits; /* index bits for lencode */ - unsigned distbits; /* index bits for distcode */ - /* dynamic table building */ - unsigned ncode; /* number of code length code lengths */ - unsigned nlen; /* number of length code lengths */ - unsigned ndist; /* number of distance code lengths */ - unsigned have; /* number of code lengths in lens[] */ - code FAR *next; /* next available space in codes[] */ - unsigned short lens[320]; /* temporary storage for code lengths */ - unsigned short work[288]; /* work area for code table building */ - code codes[ENOUGH]; /* space for code tables */ - int sane; /* if false, allow invalid distance too far */ - int back; /* bits back of last unprocessed length/lit */ - unsigned was; /* initial length of match */ -}; diff --git a/jan/src/dep/libs/zlib/inftrees.c b/jan/src/dep/libs/zlib/inftrees.c deleted file mode 100644 index 2ea08fc13..000000000 --- a/jan/src/dep/libs/zlib/inftrees.c +++ /dev/null @@ -1,304 +0,0 @@ -/* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2017 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" - -#define MAXBITS 15 - -const char inflate_copyright[] = - " inflate 1.2.11 Copyright 1995-2017 Mark Adler "; -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* - Build a set of tables to decode the provided canonical Huffman code. - The code lengths are lens[0..codes-1]. The result starts at *table, - whose indices are 0..2^bits-1. work is a writable array of at least - lens shorts, which is used as a work area. type is the type of code - to be generated, CODES, LENS, or DISTS. On return, zero is success, - -1 is an invalid code, and +1 means that ENOUGH isn't enough. table - on return points to the next available entry's address. bits is the - requested root table index bits, and on return it is the actual root - table index bits. It will differ if the request is greater than the - longest code or if it is less than the shortest code. - */ -int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work) -codetype type; -unsigned short FAR *lens; -unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; -{ - unsigned len; /* a code's length in bits */ - unsigned sym; /* index of code symbols */ - unsigned min, max; /* minimum and maximum code lengths */ - unsigned root; /* number of index bits for root table */ - unsigned curr; /* number of index bits for current table */ - unsigned drop; /* code bits to drop for sub-table */ - int left; /* number of prefix codes available */ - unsigned used; /* code entries in table used */ - unsigned huff; /* Huffman code */ - unsigned incr; /* for incrementing code, index */ - unsigned fill; /* index for replicating entries */ - unsigned low; /* low bits for current root entry */ - unsigned mask; /* mask for low root bits */ - code here; /* table entry for duplication */ - code FAR *next; /* next available space in table */ - const unsigned short FAR *base; /* base value table to use */ - const unsigned short FAR *extra; /* extra bits table to use */ - unsigned match; /* use base and extra for symbol >= match */ - unsigned short count[MAXBITS+1]; /* number of codes of each length */ - unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ - static const unsigned short lbase[31] = { /* Length codes 257..285 base */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - static const unsigned short lext[31] = { /* Length codes 257..285 extra */ - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 202}; - static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577, 0, 0}; - static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ - 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 29, 29, 64, 64}; - - /* - Process a set of code lengths to create a canonical Huffman code. The - code lengths are lens[0..codes-1]. Each length corresponds to the - symbols 0..codes-1. The Huffman code is generated by first sorting the - symbols by length from short to long, and retaining the symbol order - for codes with equal lengths. Then the code starts with all zero bits - for the first code of the shortest length, and the codes are integer - increments for the same length, and zeros are appended as the length - increases. For the deflate format, these bits are stored backwards - from their more natural integer increment ordering, and so when the - decoding tables are built in the large loop below, the integer codes - are incremented backwards. - - This routine assumes, but does not check, that all of the entries in - lens[] are in the range 0..MAXBITS. The caller must assure this. - 1..MAXBITS is interpreted as that code length. zero means that that - symbol does not occur in this code. - - The codes are sorted by computing a count of codes for each length, - creating from that a table of starting indices for each length in the - sorted table, and then entering the symbols in order in the sorted - table. The sorted table is work[], with that space being provided by - the caller. - - The length counts are used for other purposes as well, i.e. finding - the minimum and maximum length codes, determining if there are any - codes at all, checking for a valid set of lengths, and looking ahead - at length counts to determine sub-table sizes when building the - decoding tables. - */ - - /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ - for (len = 0; len <= MAXBITS; len++) - count[len] = 0; - for (sym = 0; sym < codes; sym++) - count[lens[sym]]++; - - /* bound code lengths, force root to be within code lengths */ - root = *bits; - for (max = MAXBITS; max >= 1; max--) - if (count[max] != 0) break; - if (root > max) root = max; - if (max == 0) { /* no symbols to code at all */ - here.op = (unsigned char)64; /* invalid code marker */ - here.bits = (unsigned char)1; - here.val = (unsigned short)0; - *(*table)++ = here; /* make a table to force an error */ - *(*table)++ = here; - *bits = 1; - return 0; /* no symbols, but wait for decoding to report error */ - } - for (min = 1; min < max; min++) - if (count[min] != 0) break; - if (root < min) root = min; - - /* check for an over-subscribed or incomplete set of lengths */ - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) return -1; /* over-subscribed */ - } - if (left > 0 && (type == CODES || max != 1)) - return -1; /* incomplete set */ - - /* generate offsets into symbol table for each length for sorting */ - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) - offs[len + 1] = offs[len] + count[len]; - - /* sort symbols by length, by symbol order within each length */ - for (sym = 0; sym < codes; sym++) - if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; - - /* - Create and fill in decoding tables. In this loop, the table being - filled is at next and has curr index bits. The code being used is huff - with length len. That code is converted to an index by dropping drop - bits off of the bottom. For codes where len is less than drop + curr, - those top drop + curr - len bits are incremented through all values to - fill the table with replicated entries. - - root is the number of index bits for the root table. When len exceeds - root, sub-tables are created pointed to by the root entry with an index - of the low root bits of huff. This is saved in low to check for when a - new sub-table should be started. drop is zero when the root table is - being filled, and drop is root when sub-tables are being filled. - - When a new sub-table is needed, it is necessary to look ahead in the - code lengths to determine what size sub-table is needed. The length - counts are used for this, and so count[] is decremented as codes are - entered in the tables. - - used keeps track of how many table entries have been allocated from the - provided *table space. It is checked for LENS and DIST tables against - the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in - the initial root table size constants. See the comments in inftrees.h - for more information. - - sym increments through all symbols, and the loop terminates when - all codes of length max, i.e. all codes, have been processed. This - routine permits incomplete codes, so another loop after this one fills - in the rest of the decoding tables with invalid code markers. - */ - - /* set up for code type */ - switch (type) { - case CODES: - base = extra = work; /* dummy value--not used */ - match = 20; - break; - case LENS: - base = lbase; - extra = lext; - match = 257; - break; - default: /* DISTS */ - base = dbase; - extra = dext; - match = 0; - } - - /* initialize state for loop */ - huff = 0; /* starting code */ - sym = 0; /* starting code symbol */ - len = min; /* starting code length */ - next = *table; /* current table to fill in */ - curr = root; /* current table index bits */ - drop = 0; /* current bits to drop from code for index */ - low = (unsigned)(-1); /* trigger new sub-table when len > root */ - used = 1U << root; /* use root table entries */ - mask = used - 1; /* mask for comparing low */ - - /* check available table space */ - if ((type == LENS && used > ENOUGH_LENS) || - (type == DISTS && used > ENOUGH_DISTS)) - return 1; - - /* process all codes and make table entries */ - for (;;) { - /* create table entry */ - here.bits = (unsigned char)(len - drop); - if (work[sym] + 1U < match) { - here.op = (unsigned char)0; - here.val = work[sym]; - } - else if (work[sym] >= match) { - here.op = (unsigned char)(extra[work[sym] - match]); - here.val = base[work[sym] - match]; - } - else { - here.op = (unsigned char)(32 + 64); /* end of block */ - here.val = 0; - } - - /* replicate for those indices with low len bits equal to huff */ - incr = 1U << (len - drop); - fill = 1U << curr; - min = fill; /* save offset to next table */ - do { - fill -= incr; - next[(huff >> drop) + fill] = here; - } while (fill != 0); - - /* backwards increment the len-bit code huff */ - incr = 1U << (len - 1); - while (huff & incr) - incr >>= 1; - if (incr != 0) { - huff &= incr - 1; - huff += incr; - } - else - huff = 0; - - /* go to next symbol, update count, len */ - sym++; - if (--(count[len]) == 0) { - if (len == max) break; - len = lens[work[sym]]; - } - - /* create new sub-table if needed */ - if (len > root && (huff & mask) != low) { - /* if first time, transition to sub-tables */ - if (drop == 0) - drop = root; - - /* increment past last table */ - next += min; /* here min is 1 << curr */ - - /* determine length of next table */ - curr = len - drop; - left = (int)(1 << curr); - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) break; - curr++; - left <<= 1; - } - - /* check for enough space */ - used += 1U << curr; - if ((type == LENS && used > ENOUGH_LENS) || - (type == DISTS && used > ENOUGH_DISTS)) - return 1; - - /* point entry in root table to sub-table */ - low = huff & mask; - (*table)[low].op = (unsigned char)curr; - (*table)[low].bits = (unsigned char)root; - (*table)[low].val = (unsigned short)(next - *table); - } - } - - /* fill in remaining table entry if code is incomplete (guaranteed to have - at most one remaining entry, since if the code is incomplete, the - maximum code length that was allowed to get this far is one bit) */ - if (huff != 0) { - here.op = (unsigned char)64; /* invalid code marker */ - here.bits = (unsigned char)(len - drop); - here.val = (unsigned short)0; - next[huff] = here; - } - - /* set return parameters */ - *table += used; - *bits = root; - return 0; -} diff --git a/jan/src/dep/libs/zlib/inftrees.h b/jan/src/dep/libs/zlib/inftrees.h deleted file mode 100644 index baa53a0b1..000000000 --- a/jan/src/dep/libs/zlib/inftrees.h +++ /dev/null @@ -1,62 +0,0 @@ -/* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2005, 2010 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* Structure for decoding tables. Each entry provides either the - information needed to do the operation requested by the code that - indexed that table entry, or it provides a pointer to another - table that indexes more bits of the code. op indicates whether - the entry is a pointer to another table, a literal, a length or - distance, an end-of-block, or an invalid code. For a table - pointer, the low four bits of op is the number of index bits of - that table. For a length or distance, the low four bits of op - is the number of extra bits to get after the code. bits is - the number of bits in this code or part of the code to drop off - of the bit buffer. val is the actual byte to output in the case - of a literal, the base length or distance, or the offset from - the current table to the next table. Each entry is four bytes. */ -typedef struct { - unsigned char op; /* operation, extra bits, table bits */ - unsigned char bits; /* bits in this part of the code */ - unsigned short val; /* offset in table or code value */ -} code; - -/* op values as set by inflate_table(): - 00000000 - literal - 0000tttt - table link, tttt != 0 is the number of table index bits - 0001eeee - length or distance, eeee is the number of extra bits - 01100000 - end of block - 01000000 - invalid code - */ - -/* Maximum size of the dynamic table. The maximum number of code structures is - 1444, which is the sum of 852 for literal/length codes and 592 for distance - codes. These values were found by exhaustive searches using the program - examples/enough.c found in the zlib distribtution. The arguments to that - program are the number of symbols, the initial root table size, and the - maximum bit length of a code. "enough 286 9 15" for literal/length codes - returns returns 852, and "enough 30 6 15" for distance codes returns 592. - The initial root table size (9 or 6) is found in the fifth argument of the - inflate_table() calls in inflate.c and infback.c. If the root table size is - changed, then these maximum sizes would be need to be recalculated and - updated. */ -#define ENOUGH_LENS 852 -#define ENOUGH_DISTS 592 -#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) - -/* Type of code to build for inflate_table() */ -typedef enum { - CODES, - LENS, - DISTS -} codetype; - -int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); diff --git a/jan/src/dep/libs/zlib/trees.c b/jan/src/dep/libs/zlib/trees.c deleted file mode 100644 index 50cf4b457..000000000 --- a/jan/src/dep/libs/zlib/trees.c +++ /dev/null @@ -1,1203 +0,0 @@ -/* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2017 Jean-loup Gailly - * detect_data_type() function provided freely by Cosmin Truta, 2006 - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * ALGORITHM - * - * The "deflation" process uses several Huffman trees. The more - * common source values are represented by shorter bit sequences. - * - * Each code tree is stored in a compressed form which is itself - * a Huffman encoding of the lengths of all the code strings (in - * ascending order by source values). The actual code strings are - * reconstructed from the lengths in the inflate process, as described - * in the deflate specification. - * - * REFERENCES - * - * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification". - * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc - * - * Storer, James A. - * Data Compression: Methods and Theory, pp. 49-50. - * Computer Science Press, 1988. ISBN 0-7167-8156-5. - * - * Sedgewick, R. - * Algorithms, p290. - * Addison-Wesley, 1983. ISBN 0-201-06672-6. - */ - -/* @(#) $Id$ */ - -/* #define GEN_TREES_H */ - -#include "deflate.h" - -#ifdef ZLIB_DEBUG -# include -#endif - -/* =========================================================================== - * Constants - */ - -#define MAX_BL_BITS 7 -/* Bit length codes must not exceed MAX_BL_BITS bits */ - -#define END_BLOCK 256 -/* end of block literal code */ - -#define REP_3_6 16 -/* repeat previous bit length 3-6 times (2 bits of repeat count) */ - -#define REPZ_3_10 17 -/* repeat a zero length 3-10 times (3 bits of repeat count) */ - -#define REPZ_11_138 18 -/* repeat a zero length 11-138 times (7 bits of repeat count) */ - -local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ - = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; - -local const int extra_dbits[D_CODES] /* extra bits for each distance code */ - = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - -local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ - = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; - -local const uch bl_order[BL_CODES] - = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; -/* The lengths of the bit length codes are sent in order of decreasing - * probability, to avoid transmitting the lengths for unused bit length codes. - */ - -/* =========================================================================== - * Local data. These are initialized only once. - */ - -#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ - -#if defined(GEN_TREES_H) || !defined(STDC) -/* non ANSI compilers may not accept trees.h */ - -local ct_data static_ltree[L_CODES+2]; -/* The static literal tree. Since the bit lengths are imposed, there is no - * need for the L_CODES extra codes used during heap construction. However - * The codes 286 and 287 are needed to build a canonical tree (see _tr_init - * below). - */ - -local ct_data static_dtree[D_CODES]; -/* The static distance tree. (Actually a trivial tree since all codes use - * 5 bits.) - */ - -uch _dist_code[DIST_CODE_LEN]; -/* Distance codes. The first 256 values correspond to the distances - * 3 .. 258, the last 256 values correspond to the top 8 bits of - * the 15 bit distances. - */ - -uch _length_code[MAX_MATCH-MIN_MATCH+1]; -/* length code for each normalized match length (0 == MIN_MATCH) */ - -local int base_length[LENGTH_CODES]; -/* First normalized length for each code (0 = MIN_MATCH) */ - -local int base_dist[D_CODES]; -/* First normalized distance for each code (0 = distance of 1) */ - -#else -# include "trees.h" -#endif /* GEN_TREES_H */ - -struct static_tree_desc_s { - const ct_data *static_tree; /* static tree or NULL */ - const intf *extra_bits; /* extra bits for each code or NULL */ - int extra_base; /* base index for extra_bits */ - int elems; /* max number of elements in the tree */ - int max_length; /* max bit length for the codes */ -}; - -local const static_tree_desc static_l_desc = -{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; - -local const static_tree_desc static_d_desc = -{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; - -local const static_tree_desc static_bl_desc = -{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; - -/* =========================================================================== - * Local (static) routines in this file. - */ - -local void tr_static_init OF((void)); -local void init_block OF((deflate_state *s)); -local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); -local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); -local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); -local void build_tree OF((deflate_state *s, tree_desc *desc)); -local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local int build_bl_tree OF((deflate_state *s)); -local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, - int blcodes)); -local void compress_block OF((deflate_state *s, const ct_data *ltree, - const ct_data *dtree)); -local int detect_data_type OF((deflate_state *s)); -local unsigned bi_reverse OF((unsigned value, int length)); -local void bi_windup OF((deflate_state *s)); -local void bi_flush OF((deflate_state *s)); - -#ifdef GEN_TREES_H -local void gen_trees_header OF((void)); -#endif - -#ifndef ZLIB_DEBUG -# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) - /* Send a code of the given tree. c and tree must not have side effects */ - -#else /* !ZLIB_DEBUG */ -# define send_code(s, c, tree) \ - { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ - send_bits(s, tree[c].Code, tree[c].Len); } -#endif - -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -#define put_short(s, w) { \ - put_byte(s, (uch)((w) & 0xff)); \ - put_byte(s, (uch)((ush)(w) >> 8)); \ -} - -/* =========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ -#ifdef ZLIB_DEBUG -local void send_bits OF((deflate_state *s, int value, int length)); - -local void send_bits(s, value, length) - deflate_state *s; - int value; /* value to send */ - int length; /* number of bits */ -{ - Tracevv((stderr," l %2d v %4x ", length, value)); - Assert(length > 0 && length <= 15, "invalid length"); - s->bits_sent += (ulg)length; - - /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) - * unused bits in value. - */ - if (s->bi_valid > (int)Buf_size - length) { - s->bi_buf |= (ush)value << s->bi_valid; - put_short(s, s->bi_buf); - s->bi_buf = (ush)value >> (Buf_size - s->bi_valid); - s->bi_valid += length - Buf_size; - } else { - s->bi_buf |= (ush)value << s->bi_valid; - s->bi_valid += length; - } -} -#else /* !ZLIB_DEBUG */ - -#define send_bits(s, value, length) \ -{ int len = length;\ - if (s->bi_valid > (int)Buf_size - len) {\ - int val = (int)value;\ - s->bi_buf |= (ush)val << s->bi_valid;\ - put_short(s, s->bi_buf);\ - s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ - s->bi_valid += len - Buf_size;\ - } else {\ - s->bi_buf |= (ush)(value) << s->bi_valid;\ - s->bi_valid += len;\ - }\ -} -#endif /* ZLIB_DEBUG */ - - -/* the arguments must not have side effects */ - -/* =========================================================================== - * Initialize the various 'constant' tables. - */ -local void tr_static_init() -{ -#if defined(GEN_TREES_H) || !defined(STDC) - static int static_init_done = 0; - int n; /* iterates over tree elements */ - int bits; /* bit counter */ - int length; /* length value */ - int code; /* code value */ - int dist; /* distance index */ - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - if (static_init_done) return; - - /* For some embedded targets, global variables are not initialized: */ -#ifdef NO_INIT_GLOBAL_POINTERS - static_l_desc.static_tree = static_ltree; - static_l_desc.extra_bits = extra_lbits; - static_d_desc.static_tree = static_dtree; - static_d_desc.extra_bits = extra_dbits; - static_bl_desc.extra_bits = extra_blbits; -#endif - - /* Initialize the mapping length (0..255) -> length code (0..28) */ - length = 0; - for (code = 0; code < LENGTH_CODES-1; code++) { - base_length[code] = length; - for (n = 0; n < (1< dist code (0..29) */ - dist = 0; - for (code = 0 ; code < 16; code++) { - base_dist[code] = dist; - for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ - for ( ; code < D_CODES; code++) { - base_dist[code] = dist << 7; - for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { - _dist_code[256 + dist++] = (uch)code; - } - } - Assert (dist == 256, "tr_static_init: 256+dist != 512"); - - /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; - n = 0; - while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++; - while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++; - while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++; - while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++; - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count); - - /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { - static_dtree[n].Len = 5; - static_dtree[n].Code = bi_reverse((unsigned)n, 5); - } - static_init_done = 1; - -# ifdef GEN_TREES_H - gen_trees_header(); -# endif -#endif /* defined(GEN_TREES_H) || !defined(STDC) */ -} - -/* =========================================================================== - * Genererate the file trees.h describing the static trees. - */ -#ifdef GEN_TREES_H -# ifndef ZLIB_DEBUG -# include -# endif - -# define SEPARATOR(i, last, width) \ - ((i) == (last)? "\n};\n\n" : \ - ((i) % (width) == (width)-1 ? ",\n" : ", ")) - -void gen_trees_header() -{ - FILE *header = fopen("trees.h", "w"); - int i; - - Assert (header != NULL, "Can't open trees.h"); - fprintf(header, - "/* header created automatically with -DGEN_TREES_H */\n\n"); - - fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n"); - for (i = 0; i < L_CODES+2; i++) { - fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code, - static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5)); - } - - fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n"); - for (i = 0; i < D_CODES; i++) { - fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code, - static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5)); - } - - fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n"); - for (i = 0; i < DIST_CODE_LEN; i++) { - fprintf(header, "%2u%s", _dist_code[i], - SEPARATOR(i, DIST_CODE_LEN-1, 20)); - } - - fprintf(header, - "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n"); - for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) { - fprintf(header, "%2u%s", _length_code[i], - SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20)); - } - - fprintf(header, "local const int base_length[LENGTH_CODES] = {\n"); - for (i = 0; i < LENGTH_CODES; i++) { - fprintf(header, "%1u%s", base_length[i], - SEPARATOR(i, LENGTH_CODES-1, 20)); - } - - fprintf(header, "local const int base_dist[D_CODES] = {\n"); - for (i = 0; i < D_CODES; i++) { - fprintf(header, "%5u%s", base_dist[i], - SEPARATOR(i, D_CODES-1, 10)); - } - - fclose(header); -} -#endif /* GEN_TREES_H */ - -/* =========================================================================== - * Initialize the tree data structures for a new zlib stream. - */ -void ZLIB_INTERNAL _tr_init(s) - deflate_state *s; -{ - tr_static_init(); - - s->l_desc.dyn_tree = s->dyn_ltree; - s->l_desc.stat_desc = &static_l_desc; - - s->d_desc.dyn_tree = s->dyn_dtree; - s->d_desc.stat_desc = &static_d_desc; - - s->bl_desc.dyn_tree = s->bl_tree; - s->bl_desc.stat_desc = &static_bl_desc; - - s->bi_buf = 0; - s->bi_valid = 0; -#ifdef ZLIB_DEBUG - s->compressed_len = 0L; - s->bits_sent = 0L; -#endif - - /* Initialize the first block of the first file: */ - init_block(s); -} - -/* =========================================================================== - * Initialize a new block. - */ -local void init_block(s) - deflate_state *s; -{ - int n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; - for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; - for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; - - s->dyn_ltree[END_BLOCK].Freq = 1; - s->opt_len = s->static_len = 0L; - s->last_lit = s->matches = 0; -} - -#define SMALLEST 1 -/* Index within the heap array of least frequent node in the Huffman tree */ - - -/* =========================================================================== - * Remove the smallest element from the heap and recreate the heap with - * one less element. Updates heap and heap_len. - */ -#define pqremove(s, tree, top) \ -{\ - top = s->heap[SMALLEST]; \ - s->heap[SMALLEST] = s->heap[s->heap_len--]; \ - pqdownheap(s, tree, SMALLEST); \ -} - -/* =========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ -#define smaller(tree, n, m, depth) \ - (tree[n].Freq < tree[m].Freq || \ - (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) - -/* =========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ -local void pqdownheap(s, tree, k) - deflate_state *s; - ct_data *tree; /* the tree to restore */ - int k; /* node to move down */ -{ - int v = s->heap[k]; - int j = k << 1; /* left son of k */ - while (j <= s->heap_len) { - /* Set j to the smallest of the two sons: */ - if (j < s->heap_len && - smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { - j++; - } - /* Exit if v is smaller than both sons */ - if (smaller(tree, v, s->heap[j], s->depth)) break; - - /* Exchange v with the smallest son */ - s->heap[k] = s->heap[j]; k = j; - - /* And continue down the tree, setting j to the left son of k */ - j <<= 1; - } - s->heap[k] = v; -} - -/* =========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ -local void gen_bitlen(s, desc) - deflate_state *s; - tree_desc *desc; /* the tree descriptor */ -{ - ct_data *tree = desc->dyn_tree; - int max_code = desc->max_code; - const ct_data *stree = desc->stat_desc->static_tree; - const intf *extra = desc->stat_desc->extra_bits; - int base = desc->stat_desc->extra_base; - int max_length = desc->stat_desc->max_length; - int h; /* heap index */ - int n, m; /* iterate over the tree elements */ - int bits; /* bit length */ - int xbits; /* extra bits */ - ush f; /* frequency */ - int overflow = 0; /* number of elements with bit length too large */ - - for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0; - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ - - for (h = s->heap_max+1; h < HEAP_SIZE; h++) { - n = s->heap[h]; - bits = tree[tree[n].Dad].Len + 1; - if (bits > max_length) bits = max_length, overflow++; - tree[n].Len = (ush)bits; - /* We overwrite tree[n].Dad which is no longer needed */ - - if (n > max_code) continue; /* not a leaf node */ - - s->bl_count[bits]++; - xbits = 0; - if (n >= base) xbits = extra[n-base]; - f = tree[n].Freq; - s->opt_len += (ulg)f * (unsigned)(bits + xbits); - if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits); - } - if (overflow == 0) return; - - Tracev((stderr,"\nbit length overflow\n")); - /* This happens for example on obj2 and pic of the Calgary corpus */ - - /* Find the first bit length which could increase: */ - do { - bits = max_length-1; - while (s->bl_count[bits] == 0) bits--; - s->bl_count[bits]--; /* move one leaf down the tree */ - s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ - s->bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits != 0; bits--) { - n = s->bl_count[bits]; - while (n != 0) { - m = s->heap[--h]; - if (m > max_code) continue; - if ((unsigned) tree[m].Len != (unsigned) bits) { - Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); - s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq; - tree[m].Len = (ush)bits; - } - n--; - } - } -} - -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -local void gen_codes (tree, max_code, bl_count) - ct_data *tree; /* the tree to decorate */ - int max_code; /* largest code with non zero frequency */ - ushf *bl_count; /* number of codes at each bit length */ -{ - ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - unsigned code = 0; /* running code value */ - int bits; /* bit index */ - int n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - code = (code + bl_count[bits-1]) << 1; - next_code[bits] = (ush)code; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - Assert (code + bl_count[MAX_BITS]-1 == (1<dyn_tree; - const ct_data *stree = desc->stat_desc->static_tree; - int elems = desc->stat_desc->elems; - int n, m; /* iterate over heap elements */ - int max_code = -1; /* largest code with non zero frequency */ - int node; /* new node being created */ - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - s->heap_len = 0, s->heap_max = HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n].Freq != 0) { - s->heap[++(s->heap_len)] = max_code = n; - s->depth[n] = 0; - } else { - tree[n].Len = 0; - } - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (s->heap_len < 2) { - node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0); - tree[node].Freq = 1; - s->depth[node] = 0; - s->opt_len--; if (stree) s->static_len -= stree[node].Len; - /* node is 0 or 1 so it does not have extra bits */ - } - desc->max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - node = elems; /* next internal node of the tree */ - do { - pqremove(s, tree, n); /* n = node of least frequency */ - m = s->heap[SMALLEST]; /* m = node of next least frequency */ - - s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */ - s->heap[--(s->heap_max)] = m; - - /* Create a new node father of n and m */ - tree[node].Freq = tree[n].Freq + tree[m].Freq; - s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ? - s->depth[n] : s->depth[m]) + 1); - tree[n].Dad = tree[m].Dad = (ush)node; -#ifdef DUMP_BL_TREE - if (tree == s->bl_tree) { - fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", - node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); - } -#endif - /* and insert the new node in the heap */ - s->heap[SMALLEST] = node++; - pqdownheap(s, tree, SMALLEST); - - } while (s->heap_len >= 2); - - s->heap[--(s->heap_max)] = s->heap[SMALLEST]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - gen_bitlen(s, (tree_desc *)desc); - - /* The field len is now set, we can generate the bit codes */ - gen_codes ((ct_data *)tree, max_code, s->bl_count); -} - -/* =========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. - */ -local void scan_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - if (nextlen == 0) max_count = 138, min_count = 3; - tree[max_code+1].Len = (ush)0xffff; /* guard */ - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - s->bl_tree[curlen].Freq += count; - } else if (curlen != 0) { - if (curlen != prevlen) s->bl_tree[curlen].Freq++; - s->bl_tree[REP_3_6].Freq++; - } else if (count <= 10) { - s->bl_tree[REPZ_3_10].Freq++; - } else { - s->bl_tree[REPZ_11_138].Freq++; - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ -local void send_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - /* tree[max_code+1].Len = -1; */ /* guard already set */ - if (nextlen == 0) max_count = 138, min_count = 3; - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - do { send_code(s, curlen, s->bl_tree); } while (--count != 0); - - } else if (curlen != 0) { - if (curlen != prevlen) { - send_code(s, curlen, s->bl_tree); count--; - } - Assert(count >= 3 && count <= 6, " 3_6?"); - send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); - - } else if (count <= 10) { - send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); - - } else { - send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ -local int build_bl_tree(s) - deflate_state *s; -{ - int max_blindex; /* index of last bit length code of non zero freq */ - - /* Determine the bit length frequencies for literal and distance trees */ - scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); - scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); - - /* Build the bit length tree: */ - build_tree(s, (tree_desc *)(&(s->bl_desc))); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { - if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4; - Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", - s->opt_len, s->static_len)); - - return max_blindex; -} - -/* =========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ -local void send_all_trees(s, lcodes, dcodes, blcodes) - deflate_state *s; - int lcodes, dcodes, blcodes; /* number of codes for each tree */ -{ - int rank; /* index in bl_order */ - - Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); - Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, - "too many codes"); - Tracev((stderr, "\nbl counts: ")); - send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes-1, 5); - send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ - for (rank = 0; rank < blcodes; rank++) { - Tracev((stderr, "\nbl code %2d ", bl_order[rank])); - send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); - } - Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); - - send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ - Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); - - send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ - Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); -} - -/* =========================================================================== - * Send a stored block - */ -void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) - deflate_state *s; - charf *buf; /* input block */ - ulg stored_len; /* length of input block */ - int last; /* one if this is the last block for a file */ -{ - send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */ - bi_windup(s); /* align on byte boundary */ - put_short(s, (ush)stored_len); - put_short(s, (ush)~stored_len); - zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); - s->pending += stored_len; -#ifdef ZLIB_DEBUG - s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; - s->compressed_len += (stored_len + 4) << 3; - s->bits_sent += 2*16; - s->bits_sent += stored_len<<3; -#endif -} - -/* =========================================================================== - * Flush the bits in the bit buffer to pending output (leaves at most 7 bits) - */ -void ZLIB_INTERNAL _tr_flush_bits(s) - deflate_state *s; -{ - bi_flush(s); -} - -/* =========================================================================== - * Send one empty static block to give enough lookahead for inflate. - * This takes 10 bits, of which 7 may remain in the bit buffer. - */ -void ZLIB_INTERNAL _tr_align(s) - deflate_state *s; -{ - send_bits(s, STATIC_TREES<<1, 3); - send_code(s, END_BLOCK, static_ltree); -#ifdef ZLIB_DEBUG - s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ -#endif - bi_flush(s); -} - -/* =========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and write out the encoded block. - */ -void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) - deflate_state *s; - charf *buf; /* input block, or NULL if too old */ - ulg stored_len; /* length of input block */ - int last; /* one if this is the last block for a file */ -{ - ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ - int max_blindex = 0; /* index of last bit length code of non zero freq */ - - /* Build the Huffman trees unless a stored block is forced */ - if (s->level > 0) { - - /* Check if the file is binary or text */ - if (s->strm->data_type == Z_UNKNOWN) - s->strm->data_type = detect_data_type(s); - - /* Construct the literal and distance trees */ - build_tree(s, (tree_desc *)(&(s->l_desc))); - Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, - s->static_len)); - - build_tree(s, (tree_desc *)(&(s->d_desc))); - Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, - s->static_len)); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = build_bl_tree(s); - - /* Determine the best encoding. Compute the block lengths in bytes. */ - opt_lenb = (s->opt_len+3+7)>>3; - static_lenb = (s->static_len+3+7)>>3; - - Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", - opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, - s->last_lit)); - - if (static_lenb <= opt_lenb) opt_lenb = static_lenb; - - } else { - Assert(buf != (char*)0, "lost buf"); - opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ - } - -#ifdef FORCE_STORED - if (buf != (char*)0) { /* force stored block */ -#else - if (stored_len+4 <= opt_lenb && buf != (char*)0) { - /* 4: two words for the lengths */ -#endif - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - _tr_stored_block(s, buf, stored_len, last); - -#ifdef FORCE_STATIC - } else if (static_lenb >= 0) { /* force static trees */ -#else - } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { -#endif - send_bits(s, (STATIC_TREES<<1)+last, 3); - compress_block(s, (const ct_data *)static_ltree, - (const ct_data *)static_dtree); -#ifdef ZLIB_DEBUG - s->compressed_len += 3 + s->static_len; -#endif - } else { - send_bits(s, (DYN_TREES<<1)+last, 3); - send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, - max_blindex+1); - compress_block(s, (const ct_data *)s->dyn_ltree, - (const ct_data *)s->dyn_dtree); -#ifdef ZLIB_DEBUG - s->compressed_len += 3 + s->opt_len; -#endif - } - Assert (s->compressed_len == s->bits_sent, "bad compressed size"); - /* The above check is made mod 2^32, for files larger than 512 MB - * and uLong implemented on 32 bits. - */ - init_block(s); - - if (last) { - bi_windup(s); -#ifdef ZLIB_DEBUG - s->compressed_len += 7; /* align on byte boundary */ -#endif - } - Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - s->compressed_len-7*last)); -} - -/* =========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ -int ZLIB_INTERNAL _tr_tally (s, dist, lc) - deflate_state *s; - unsigned dist; /* distance of matched string */ - unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ -{ - s->d_buf[s->last_lit] = (ush)dist; - s->l_buf[s->last_lit++] = (uch)lc; - if (dist == 0) { - /* lc is the unmatched char */ - s->dyn_ltree[lc].Freq++; - } else { - s->matches++; - /* Here, lc is the match length - MIN_MATCH */ - dist--; /* dist = match distance - 1 */ - Assert((ush)dist < (ush)MAX_DIST(s) && - (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && - (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - - s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; - s->dyn_dtree[d_code(dist)].Freq++; - } - -#ifdef TRUNCATE_BLOCK - /* Try to guess if it is profitable to stop the current block here */ - if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { - /* Compute an upper bound for the compressed length */ - ulg out_length = (ulg)s->last_lit*8L; - ulg in_length = (ulg)((long)s->strstart - s->block_start); - int dcode; - for (dcode = 0; dcode < D_CODES; dcode++) { - out_length += (ulg)s->dyn_dtree[dcode].Freq * - (5L+extra_dbits[dcode]); - } - out_length >>= 3; - Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", - s->last_lit, in_length, out_length, - 100L - out_length*100L/in_length)); - if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; - } -#endif - return (s->last_lit == s->lit_bufsize-1); - /* We avoid equality with lit_bufsize because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ -} - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -local void compress_block(s, ltree, dtree) - deflate_state *s; - const ct_data *ltree; /* literal tree */ - const ct_data *dtree; /* distance tree */ -{ - unsigned dist; /* distance of matched string */ - int lc; /* match length or unmatched char (if dist == 0) */ - unsigned lx = 0; /* running index in l_buf */ - unsigned code; /* the code to send */ - int extra; /* number of extra bits to send */ - - if (s->last_lit != 0) do { - dist = s->d_buf[lx]; - lc = s->l_buf[lx++]; - if (dist == 0) { - send_code(s, lc, ltree); /* send a literal byte */ - Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code+LITERALS+1, ltree); /* send the length code */ - extra = extra_lbits[code]; - if (extra != 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - Assert (code < D_CODES, "bad d_code"); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra != 0) { - dist -= (unsigned)base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ - Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, - "pendingBuf overflow"); - - } while (lx < s->last_lit); - - send_code(s, END_BLOCK, ltree); -} - -/* =========================================================================== - * Check if the data type is TEXT or BINARY, using the following algorithm: - * - TEXT if the two conditions below are satisfied: - * a) There are no non-portable control characters belonging to the - * "black list" (0..6, 14..25, 28..31). - * b) There is at least one printable character belonging to the - * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). - * - BINARY otherwise. - * - The following partially-portable control characters form a - * "gray list" that is ignored in this detection algorithm: - * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). - * IN assertion: the fields Freq of dyn_ltree are set. - */ -local int detect_data_type(s) - deflate_state *s; -{ - /* black_mask is the bit mask of black-listed bytes - * set bits 0..6, 14..25, and 28..31 - * 0xf3ffc07f = binary 11110011111111111100000001111111 - */ - unsigned long black_mask = 0xf3ffc07fUL; - int n; - - /* Check for non-textual ("black-listed") bytes. */ - for (n = 0; n <= 31; n++, black_mask >>= 1) - if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0)) - return Z_BINARY; - - /* Check for textual ("white-listed") bytes. */ - if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 - || s->dyn_ltree[13].Freq != 0) - return Z_TEXT; - for (n = 32; n < LITERALS; n++) - if (s->dyn_ltree[n].Freq != 0) - return Z_TEXT; - - /* There are no "black-listed" or "white-listed" bytes: - * this stream either is empty or has tolerated ("gray-listed") bytes only. - */ - return Z_BINARY; -} - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -local unsigned bi_reverse(code, len) - unsigned code; /* the value to invert */ - int len; /* its bit length */ -{ - register unsigned res = 0; - do { - res |= code & 1; - code >>= 1, res <<= 1; - } while (--len > 0); - return res >> 1; -} - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -local void bi_flush(s) - deflate_state *s; -{ - if (s->bi_valid == 16) { - put_short(s, s->bi_buf); - s->bi_buf = 0; - s->bi_valid = 0; - } else if (s->bi_valid >= 8) { - put_byte(s, (Byte)s->bi_buf); - s->bi_buf >>= 8; - s->bi_valid -= 8; - } -} - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -local void bi_windup(s) - deflate_state *s; -{ - if (s->bi_valid > 8) { - put_short(s, s->bi_buf); - } else if (s->bi_valid > 0) { - put_byte(s, (Byte)s->bi_buf); - } - s->bi_buf = 0; - s->bi_valid = 0; -#ifdef ZLIB_DEBUG - s->bits_sent = (s->bits_sent+7) & ~7; -#endif -} diff --git a/jan/src/dep/libs/zlib/trees.h b/jan/src/dep/libs/zlib/trees.h deleted file mode 100644 index d35639d82..000000000 --- a/jan/src/dep/libs/zlib/trees.h +++ /dev/null @@ -1,128 +0,0 @@ -/* header created automatically with -DGEN_TREES_H */ - -local const ct_data static_ltree[L_CODES+2] = { -{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, -{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, -{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, -{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, -{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, -{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, -{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, -{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, -{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, -{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, -{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, -{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, -{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, -{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, -{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, -{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, -{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, -{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, -{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, -{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, -{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, -{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, -{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, -{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, -{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, -{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, -{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, -{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, -{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, -{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, -{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, -{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, -{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, -{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, -{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, -{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, -{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, -{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, -{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, -{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, -{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, -{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, -{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, -{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, -{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, -{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, -{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, -{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, -{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, -{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, -{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, -{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, -{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, -{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, -{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, -{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, -{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, -{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} -}; - -local const ct_data static_dtree[D_CODES] = { -{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, -{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, -{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, -{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, -{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, -{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} -}; - -const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = { - 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, -10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, -11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, -12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, -18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 -}; - -const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, -13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, -17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, -19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, -21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, -22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 -}; - -local const int base_length[LENGTH_CODES] = { -0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, -64, 80, 96, 112, 128, 160, 192, 224, 0 -}; - -local const int base_dist[D_CODES] = { - 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, - 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, - 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 -}; - diff --git a/jan/src/dep/libs/zlib/uncompr.c b/jan/src/dep/libs/zlib/uncompr.c deleted file mode 100644 index f03a1a865..000000000 --- a/jan/src/dep/libs/zlib/uncompr.c +++ /dev/null @@ -1,93 +0,0 @@ -/* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#define ZLIB_INTERNAL -#include "zlib.h" - -/* =========================================================================== - Decompresses the source buffer into the destination buffer. *sourceLen is - the byte length of the source buffer. Upon entry, *destLen is the total size - of the destination buffer, which must be large enough to hold the entire - uncompressed data. (The size of the uncompressed data must have been saved - previously by the compressor and transmitted to the decompressor by some - mechanism outside the scope of this compression library.) Upon exit, - *destLen is the size of the decompressed data and *sourceLen is the number - of source bytes consumed. Upon return, source + *sourceLen points to the - first unused input byte. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, or - Z_DATA_ERROR if the input data was corrupted, including if the input data is - an incomplete zlib stream. -*/ -int ZEXPORT uncompress2 (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong *sourceLen; -{ - z_stream stream; - int err; - const uInt max = (uInt)-1; - uLong len, left; - Byte buf[1]; /* for detection of incomplete stream when *destLen == 0 */ - - len = *sourceLen; - if (*destLen) { - left = *destLen; - *destLen = 0; - } - else { - left = 1; - dest = buf; - } - - stream.next_in = (z_const Bytef *)source; - stream.avail_in = 0; - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - stream.opaque = (voidpf)0; - - err = inflateInit(&stream); - if (err != Z_OK) return err; - - stream.next_out = dest; - stream.avail_out = 0; - - do { - if (stream.avail_out == 0) { - stream.avail_out = left > (uLong)max ? max : (uInt)left; - left -= stream.avail_out; - } - if (stream.avail_in == 0) { - stream.avail_in = len > (uLong)max ? max : (uInt)len; - len -= stream.avail_in; - } - err = inflate(&stream, Z_NO_FLUSH); - } while (err == Z_OK); - - *sourceLen -= len + stream.avail_in; - if (dest != buf) - *destLen = stream.total_out; - else if (stream.total_out && err == Z_BUF_ERROR) - left = 1; - - inflateEnd(&stream); - return err == Z_STREAM_END ? Z_OK : - err == Z_NEED_DICT ? Z_DATA_ERROR : - err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR : - err; -} - -int ZEXPORT uncompress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ - return uncompress2(dest, destLen, source, &sourceLen); -} diff --git a/jan/src/dep/libs/zlib/zconf.h b/jan/src/dep/libs/zlib/zconf.h deleted file mode 100644 index 5e1d68a00..000000000 --- a/jan/src/dep/libs/zlib/zconf.h +++ /dev/null @@ -1,534 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set - * this permanently in zconf.h using "./configure --zprefix". - */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ -# define Z_PREFIX_SET - -/* all linked symbols and init macros */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_bits z__tr_flush_bits -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# define adler32_z z_adler32_z -# ifndef Z_SOLO -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# endif -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define crc32_z z_crc32_z -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateGetDictionary z_deflateGetDictionary -# define deflateInit z_deflateInit -# define deflateInit2 z_deflateInit2 -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePending z_deflatePending -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateResetKeep z_deflateResetKeep -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# ifndef Z_SOLO -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzfread z_gzfread -# define gzfwrite z_gzfwrite -# define gzgetc z_gzgetc -# define gzgetc_ z_gzgetc_ -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# ifdef _WIN32 -# define gzopen_w z_gzopen_w -# endif -# define gzprintf z_gzprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzvprintf z_gzvprintf -# define gzwrite z_gzwrite -# endif -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit z_inflateBackInit -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCodesUsed z_inflateCodesUsed -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetDictionary z_inflateGetDictionary -# define inflateGetHeader z_inflateGetHeader -# define inflateInit z_inflateInit -# define inflateInit2 z_inflateInit2 -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateResetKeep z_inflateResetKeep -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflateValidate z_inflateValidate -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# ifndef Z_SOLO -# define uncompress z_uncompress -# define uncompress2 z_uncompress2 -# endif -# define zError z_zError -# ifndef Z_SOLO -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# endif -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion - -/* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# ifndef Z_SOLO -# define gzFile z_gzFile -# endif -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf - -/* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state - -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -#if defined(ZLIB_CONST) && !defined(z_const) -# define z_const const -#else -# define z_const -#endif - -#ifdef Z_SOLO - typedef unsigned long z_size_t; -#else -# define z_longlong long long -# if defined(NO_SIZE_T) - typedef unsigned NO_SIZE_T z_size_t; -# elif defined(STDC) -# include - typedef size_t z_size_t; -# else - typedef unsigned long z_size_t; -# endif -# undef z_longlong -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus about 7 kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) -# include -# if (UINT_MAX == 0xffffffffUL) -# define Z_U4 unsigned -# elif (ULONG_MAX == 0xffffffffUL) -# define Z_U4 unsigned long -# elif (USHRT_MAX == 0xffffffffUL) -# define Z_U4 unsigned short -# endif -#endif - -#ifdef Z_U4 - typedef Z_U4 z_crc_t; -#else - typedef unsigned long z_crc_t; -#endif - -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H -#endif - -#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_STDARG_H -#endif - -#ifdef STDC -# ifndef Z_SOLO -# include /* for off_t */ -# endif -#endif - -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -# include /* for va_list */ -# endif -#endif - -#ifdef _WIN32 -# ifndef Z_SOLO -# include /* for wchar_t */ -# endif -#endif - -/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and - * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even - * though the former does not conform to the LFS document), but considering - * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as - * equivalently requesting no 64-bit operations - */ -#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE -#endif - -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H -#endif -#ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) -# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ -# ifdef VMS -# include /* for off_t */ -# endif -# ifndef z_off_t -# define z_off_t off_t -# endif -# endif -#endif - -#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 -# define Z_LFS64 -#endif - -#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) -# define Z_LARGE64 -#endif - -#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) -# define Z_WANT64 -#endif - -#if !defined(SEEK_SET) && !defined(Z_SOLO) -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#ifndef z_off_t -# define z_off_t long -#endif - -#if !defined(_WIN32) && defined(Z_LARGE64) -# define z_off64_t off64_t -#else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 -# else -# define z_off64_t z_off_t -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/jan/src/dep/libs/zlib/zconf.h.in b/jan/src/dep/libs/zlib/zconf.h.in deleted file mode 100644 index 5e1d68a00..000000000 --- a/jan/src/dep/libs/zlib/zconf.h.in +++ /dev/null @@ -1,534 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set - * this permanently in zconf.h using "./configure --zprefix". - */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ -# define Z_PREFIX_SET - -/* all linked symbols and init macros */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_bits z__tr_flush_bits -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# define adler32_z z_adler32_z -# ifndef Z_SOLO -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# endif -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define crc32_z z_crc32_z -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateGetDictionary z_deflateGetDictionary -# define deflateInit z_deflateInit -# define deflateInit2 z_deflateInit2 -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePending z_deflatePending -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateResetKeep z_deflateResetKeep -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# ifndef Z_SOLO -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzfread z_gzfread -# define gzfwrite z_gzfwrite -# define gzgetc z_gzgetc -# define gzgetc_ z_gzgetc_ -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# ifdef _WIN32 -# define gzopen_w z_gzopen_w -# endif -# define gzprintf z_gzprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzvprintf z_gzvprintf -# define gzwrite z_gzwrite -# endif -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit z_inflateBackInit -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCodesUsed z_inflateCodesUsed -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetDictionary z_inflateGetDictionary -# define inflateGetHeader z_inflateGetHeader -# define inflateInit z_inflateInit -# define inflateInit2 z_inflateInit2 -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateResetKeep z_inflateResetKeep -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflateValidate z_inflateValidate -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# ifndef Z_SOLO -# define uncompress z_uncompress -# define uncompress2 z_uncompress2 -# endif -# define zError z_zError -# ifndef Z_SOLO -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# endif -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion - -/* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# ifndef Z_SOLO -# define gzFile z_gzFile -# endif -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf - -/* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state - -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -#if defined(ZLIB_CONST) && !defined(z_const) -# define z_const const -#else -# define z_const -#endif - -#ifdef Z_SOLO - typedef unsigned long z_size_t; -#else -# define z_longlong long long -# if defined(NO_SIZE_T) - typedef unsigned NO_SIZE_T z_size_t; -# elif defined(STDC) -# include - typedef size_t z_size_t; -# else - typedef unsigned long z_size_t; -# endif -# undef z_longlong -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus about 7 kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) -# include -# if (UINT_MAX == 0xffffffffUL) -# define Z_U4 unsigned -# elif (ULONG_MAX == 0xffffffffUL) -# define Z_U4 unsigned long -# elif (USHRT_MAX == 0xffffffffUL) -# define Z_U4 unsigned short -# endif -#endif - -#ifdef Z_U4 - typedef Z_U4 z_crc_t; -#else - typedef unsigned long z_crc_t; -#endif - -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H -#endif - -#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_STDARG_H -#endif - -#ifdef STDC -# ifndef Z_SOLO -# include /* for off_t */ -# endif -#endif - -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -# include /* for va_list */ -# endif -#endif - -#ifdef _WIN32 -# ifndef Z_SOLO -# include /* for wchar_t */ -# endif -#endif - -/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and - * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even - * though the former does not conform to the LFS document), but considering - * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as - * equivalently requesting no 64-bit operations - */ -#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE -#endif - -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H -#endif -#ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) -# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ -# ifdef VMS -# include /* for off_t */ -# endif -# ifndef z_off_t -# define z_off_t off_t -# endif -# endif -#endif - -#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 -# define Z_LFS64 -#endif - -#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) -# define Z_LARGE64 -#endif - -#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) -# define Z_WANT64 -#endif - -#if !defined(SEEK_SET) && !defined(Z_SOLO) -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#ifndef z_off_t -# define z_off_t long -#endif - -#if !defined(_WIN32) && defined(Z_LARGE64) -# define z_off64_t off64_t -#else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 -# else -# define z_off64_t z_off_t -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/jan/src/dep/libs/zlib/zlib.h b/jan/src/dep/libs/zlib/zlib.h deleted file mode 100644 index f09cdaf1e..000000000 --- a/jan/src/dep/libs/zlib/zlib.h +++ /dev/null @@ -1,1912 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.11, January 15th, 2017 - - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 - (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.11" -#define ZLIB_VERNUM 0x12b0 -#define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 11 -#define ZLIB_VER_SUBREVISION 0 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed data. - This version of the library supports only one compression method (deflation) - but other algorithms will be added later and will have the same stream - interface. - - Compression can be done in a single step if the buffers are large enough, - or can be done by repeated calls of the compression function. In the latter - case, the application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip and raw deflate streams in - memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never crash - even in the case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - z_const Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total number of input bytes read so far */ - - Bytef *next_out; /* next output byte will go here */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total number of bytes output so far */ - - z_const char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text - for deflate, or the decoding state for inflate */ - uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has dropped - to zero. It must update next_out and avail_out when avail_out has dropped - to zero. The application must initialize zalloc, zfree and opaque before - calling the init function. All other fields are set by the compression - library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. In that case, zlib is thread-safe. When zalloc and zfree are - Z_NULL on entry to the initialization function, they are set to internal - routines that use the standard library functions malloc() and free(). - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this if - the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers - returned by zalloc for objects of exactly 65536 bytes *must* have their - offset normalized to zero. The default allocation function provided by this - library ensures this (see zutil.c). To reduce memory requirements and avoid - any allocation of 64K objects, at the expense of compression ratio, compile - the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or progress - reports. After compression, total_in holds the total size of the - uncompressed data and may be saved for use by the decompressor (particularly - if the decompressor wants to decompress everything in a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -#define Z_TREES 6 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field for deflate() */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is not - compatible with the zlib.h header file used by the application. This check - is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at all - (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION - requests a default compromise between speed and compression (currently - equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if level is not a valid compression level, or - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). msg is set to null - if there is no error message. deflateInit does not perform any compression: - this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Generate more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary. Some output may be provided even if - flush is zero. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating avail_in or avail_out accordingly; avail_out should - never be zero before the call. The application can consume the compressed - output when it wants, for example when the output buffer is full (avail_out - == 0), or after each call of deflate(). If deflate returns Z_OK and with - zero avail_out, it must be called again after making room in the output - buffer because there might be more output pending. See deflatePending(), - which can be used if desired to determine whether or not there is more ouput - in that case. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumulate before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In - particular avail_in is zero after the call if enough output space has been - provided before the call.) Flushing may degrade compression for some - compression algorithms and so it should be used only when necessary. This - completes the current deflate block and follows it with an empty stored block - that is three bits plus filler bits to the next byte, followed by four bytes - (00 00 ff ff). - - If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the - output buffer, but the output is not aligned to a byte boundary. All of the - input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. - This completes the current deflate block and follows it with an empty fixed - codes block that is 10 bits long. This assures that enough bytes are output - in order for the decompressor to finish the block before the empty fixed - codes block. - - If flush is set to Z_BLOCK, a deflate block is completed and emitted, as - for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to - seven bits of the current block are held to be written as the next byte after - the next deflate block is completed. In this case, the decompressor may not - be provided enough bits at this point in order to complete decompression of - the data provided so far to the compressor. It may need to wait for the next - block to be emitted. This is for advanced applications that need to control - the emission of deflate blocks. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there was - enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this - function must be called again with Z_FINISH and more output space (updated - avail_out) but no more input data, until it returns with Z_STREAM_END or an - error. After deflate has returned Z_STREAM_END, the only possible operations - on the stream are deflateReset or deflateEnd. - - Z_FINISH can be used in the first deflate call after deflateInit if all the - compression is to be done in a single step. In order to complete in one - call, avail_out must be at least the value returned by deflateBound (see - below). Then deflate is guaranteed to return Z_STREAM_END. If not enough - output space is provided, deflate will not return Z_STREAM_END, and it must - be called again as described above. - - deflate() sets strm->adler to the Adler-32 checksum of all input read - so far (that is, total_in bytes). If a gzip stream is being generated, then - strm->adler will be the CRC-32 checksum of the input read so far. (See - deflateInit2 below.) - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is - considered binary. This field is only for information purposes and does not - affect the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was Z_NULL or the state was inadvertently written over - by the application), or Z_BUF_ERROR if no progress is possible (for example - avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and - deflate() can be called again with more input and more output space to - continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, msg - may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. In the current version of inflate, the provided input is not - read or consumed. The allocation of a sliding window will be deferred to - the first call of inflate (if the decompression does not complete on the - first call). If zalloc and zfree are set to Z_NULL, inflateInit updates - them to use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit does not perform any decompression. - Actual decompression will be done by inflate(). So next_in, and avail_in, - next_out, and avail_out are unused and unchanged. The current - implementation of inflateInit() does not process any header information -- - that is deferred until inflate() is called. -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), then next_in and avail_in are updated - accordingly, and processing will resume at this point for the next call of - inflate(). - - - Generate more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there is - no more input data or no more space in the output buffer (see below about - the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating the next_* and avail_* values accordingly. If the - caller of inflate() does not provide both available input and available - output space, it is possible that there will be no progress made. The - application can consume the uncompressed output when it wants, for example - when the output buffer is full (avail_out == 0), or after each call of - inflate(). If inflate returns Z_OK and with zero avail_out, it must be - called again after making room in the output buffer because there might be - more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, - Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() - stop if and when it gets to the next deflate block boundary. When decoding - the zlib or gzip format, this will cause inflate() to return immediately - after the header and before the first block. When doing a raw inflate, - inflate() will go ahead and process the first block, and will return when it - gets to the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - To assist in this, on return inflate() always sets strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if - inflate() is currently decoding the last block in the deflate stream, plus - 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate - stream. The end-of-block will not be indicated until all of the uncompressed - data from that block has been written to strm->next_out. The number of - unused bits may in general be greater than seven, except when bit 7 of - data_type is set, in which case the number of unused bits will be less than - eight. data_type is set as noted here every time inflate() returns for all - flush options, and so can be used to determine the amount of currently - consumed input in bits. - - The Z_TREES option behaves as Z_BLOCK does, but it also returns when the - end of each deflate block header is reached, before any actual data in that - block is decoded. This allows the caller to determine the length of the - deflate block header for later use in random access within a deflate block. - 256 is added to the value of strm->data_type when inflate() returns - immediately after reaching the end of the deflate block header. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step (a - single call of inflate), the parameter flush should be set to Z_FINISH. In - this case all pending input is processed and all pending output is flushed; - avail_out must be large enough to hold all of the uncompressed data for the - operation to complete. (The size of the uncompressed data may have been - saved by the compressor for this purpose.) The use of Z_FINISH is not - required to perform an inflation in one step. However it may be used to - inform inflate that a faster approach can be used for the single inflate() - call. Z_FINISH also informs inflate to not maintain a sliding window if the - stream completes, which reduces inflate's memory footprint. If the stream - does not complete, either because not all of the stream is provided or not - enough output space is provided, then a sliding window will be allocated and - inflate() can be called again to continue the operation as if Z_NO_FLUSH had - been used. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the effects of the flush parameter in this implementation are - on the return value of inflate() as noted below, when inflate() returns early - when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of - memory for a sliding window when Z_FINISH is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the Adler-32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the Adler-32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed Adler-32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() can decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically, if requested when - initializing with inflateInit2(). Any information contained in the gzip - header is not retained unless inflateGetHeader() is used. When processing - gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output - produced so far. The CRC-32 is checked against the gzip trailer, as is the - uncompressed length, modulo 2^32. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value, in which case strm->msg points to a string with a more specific - error), Z_STREAM_ERROR if the stream structure was inconsistent (for example - next_in or next_out was Z_NULL, or the state was inadvertently written over - by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR - if no progress was possible or if there was not enough room in the output - buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may - then call inflateSync() to look for a good compression block if a partial - recovery of the data is to be attempted. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state - was inconsistent. -*/ - - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by the - caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - For the current implementation of deflate(), a windowBits value of 8 (a - window size of 256 bytes) is not supported. As a result, a request for 8 - will result in 9 (a 512-byte window). In that case, providing 8 to - inflateInit2() will result in an error when the zlib header with 9 is - checked against the initialization of inflate(). The remedy is to not use 8 - with deflateInit2() with this initialization, or at least in that case use 9 - with inflateInit2(). - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute a check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), no - header crc, and the operating system will be set to the appropriate value, - if the operating system was determined at compile time. If a gzip stream is - being written, strm->adler is a CRC-32 instead of an Adler-32. - - For raw deflate or gzip encoding, a request for a 256-byte window is - rejected as invalid, since only the zlib header provides a means of - transmitting the window size to the decompressor. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but is - slow and reduces compression ratio; memLevel=9 uses maximum memory for - optimal speed. The default value is 8. See zconf.h for total memory usage - as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as - fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The - strategy parameter only affects the compression ratio but not the - correctness of the compressed output even if it is not set appropriately. - Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler - decoder for special applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid - method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is - incompatible with the version assumed by the caller (ZLIB_VERSION). msg is - set to null if there is no error message. deflateInit2 does not perform any - compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. When using the zlib format, this - function must be called immediately after deflateInit, deflateInit2 or - deflateReset, and before any call of deflate. When doing raw deflate, this - function must be called either before any call of deflate, or immediately - after the completion of a deflate block, i.e. after all input has been - consumed and all output has been delivered when using any of the flush - options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The - compressor and decompressor must use exactly the same dictionary (see - inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size - provided in deflateInit or deflateInit2. Thus the strings most likely to be - useful should be put at the end of the dictionary, not at the front. In - addition, the current implementation of deflate will use at most the window - size minus 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the Adler-32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The Adler-32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - Adler-32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if not at a block boundary for raw deflate). deflateSetDictionary does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); -/* - Returns the sliding dictionary being maintained by deflate. dictLength is - set to the number of bytes in the dictionary, and that many bytes are copied - to dictionary. dictionary must have enough space, where 32768 bytes is - always enough. If deflateGetDictionary() is called with dictionary equal to - Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similary, if dictLength is Z_NULL, then it is not set. - - deflateGetDictionary() may return a length less than the window size, even - when more than the window size in input has been provided. It may return up - to 258 bytes less in that case, due to how zlib's implementation of deflate - manages the sliding window and lookahead for matches, where matches can be - up to 258 bytes long. If the application needs the last window-size bytes of - input, then that would need to be saved by the application outside of zlib. - - deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the - stream state is inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and can - consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, but - does not free and reallocate the internal compression state. The stream - will leave the compression level and any other attributes that may have been - set unchanged. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2(). This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different strategy. - If the compression approach (which is a function of the level) or the - strategy is changed, and if any input has been consumed in a previous - deflate() call, then the input available so far is compressed with the old - level and strategy using deflate(strm, Z_BLOCK). There are three approaches - for the compression levels 0, 1..3, and 4..9 respectively. The new level - and strategy will take effect at the next call of deflate(). - - If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does - not have enough output space to complete, then the parameter change will not - take effect. In this case, deflateParams() can be called again with the - same parameters and more output space to try again. - - In order to assure a change in the parameters on the first try, the - deflate stream should be flushed using deflate() with Z_BLOCK or other flush - request until strm.avail_out is not zero, before calling deflateParams(). - Then no more input data should be provided before the deflateParams() call. - If this is done, the old level and strategy will be applied to the data - compressed before deflateParams(), and the new level and strategy will be - applied to the the data compressed after deflateParams(). - - deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream - state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if - there was not enough output space to complete the compression of the - available input data before a change in the strategy or approach. Note that - in the case of a Z_BUF_ERROR, the parameters are not changed. A return - value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be - retried with more output space. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() or - deflateInit2(), and after deflateSetHeader(), if used. This would be used - to allocate an output buffer for deflation in a single pass, and so would be - called before deflate(). If that first deflate() call is provided the - sourceLen input bytes, an output buffer allocated to the size returned by - deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed - to return Z_STREAM_END. Note that it is possible for the compressed size to - be larger than the value returned by deflateBound() if flush options other - than Z_FINISH or Z_NO_FLUSH are used. -*/ - -ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, - unsigned *pending, - int *bits)); -/* - deflatePending() returns the number of bytes and bits of output that have - been generated, but not yet provided in the available output. The bytes not - provided would be due to the available output space having being consumed. - The number of bits of output not provided are between 0 and 7, where they - await more bits to join them in order to fill out a full byte. If pending - or bits are Z_NULL, then those values are not set. - - deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. - */ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the bits - leftover from a previous deflate stream when appending to it. As such, this - function can only be used for raw deflate, and must be used before the first - deflate() call after a deflateInit2() or deflateReset(). bits must be less - than or equal to 16, and that many of the least significant bits of value - will be inserted in the output. - - deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough - room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be zero to request that inflate use the window size in - the zlib header of the compressed stream. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an Adler-32 or a CRC-32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a - CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see - below), inflate() will not automatically decode concatenated gzip streams. - inflate() will return Z_STREAM_END at the end of the gzip stream. The state - would need to be reset to continue decoding a subsequent gzip stream. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit2 does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit2() does not process any header information -- that is - deferred until inflate() is called. -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the Adler-32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called at any - time to set the dictionary. If the provided dictionary is smaller than the - window and there is already data in the window, then the provided dictionary - will amend what's there. The application must insure that the dictionary - that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect Adler-32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); -/* - Returns the sliding dictionary being maintained by inflate. dictLength is - set to the number of bytes in the dictionary, and that many bytes are copied - to dictionary. dictionary must have enough space, where 32768 bytes is - always enough. If inflateGetDictionary() is called with dictionary equal to - Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similary, if dictLength is Z_NULL, then it is not set. - - inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the - stream state is inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a possible full flush point (see above - for the description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync searches for a 00 00 FF FF pattern in the compressed data. - All full flush points have this pattern, but not all occurrences of this - pattern are full flush points. - - inflateSync returns Z_OK if a possible full flush point has been found, - Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point - has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate the internal decompression state. The - stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); -/* - This function is the same as inflateReset, but it also permits changing - the wrap and window size requests. The windowBits parameter is interpreted - the same as it is for inflateInit2. If the window size is changed, then the - memory allocated for the window is freed, and the window will be reallocated - by inflate() if needed. - - inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL), or if - the windowBits parameter is invalid. -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - If bits is negative, then the input stream bit buffer is emptied. Then - inflatePrime() can be called again to put bits in the buffer. This is used - to clear out bits leftover after feeding inflate a block description prior - to feeding inflate codes. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); -/* - This function returns two values, one in the lower 16 bits of the return - value, and the other in the remaining upper bits, obtained by shifting the - return value down 16 bits. If the upper value is -1 and the lower value is - zero, then inflate() is currently decoding information outside of a block. - If the upper value is -1 and the lower value is non-zero, then inflate is in - the middle of a stored block, with the lower value equaling the number of - bytes from the input remaining to copy. If the upper value is not -1, then - it is the number of bits back from the current bit position in the input of - the code (literal or length/distance pair) currently being processed. In - that case the lower value is the number of bytes already emitted for that - code. - - A code is being processed if inflate is waiting for more input to complete - decoding of the code, or if it has completed decoding but is waiting for - more output space to write the literal or match data. - - inflateMark() is used to mark locations in the input data for random - access, which may be at bit positions, and to note those cases where the - output of a code may span boundaries of random access blocks. The current - location in the input stream can be determined from avail_in and data_type - as noted in the description for the Z_BLOCK flush parameter for inflate. - - inflateMark returns the value noted above, or -65536 if the provided - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be - used to force inflate() to return immediately after header processing is - complete and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When any - of extra, name, or comment are not Z_NULL and the respective field is not - present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the parameters are invalid, Z_MEM_ERROR if the internal state could not be - allocated, or Z_VERSION_ERROR if the version of the library does not match - the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, - z_const unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is potentially more efficient than - inflate() for file i/o applications, in that it avoids copying between the - output and the sliding window by simply making the window itself the output - buffer. inflate() can be faster on modern CPUs when used with large - buffers. inflateBack() trusts the application to not change the output - buffer passed by the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free the - allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects only - the raw deflate stream to decompress. This is different from the default - behavior of inflate(), which expects a zlib header and trailer around the - deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero -- buf is ignored in that - case -- and inflateBack() will return a buffer error. inflateBack() will - call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. - out() should return zero on success, or non-zero on failure. If out() - returns non-zero, inflateBack() will return with an error. Neither in() nor - out() are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format error - in the deflate stream (in which case strm->msg is set to indicate the nature - of the error), or Z_STREAM_ERROR if the stream was not properly initialized. - In the case of Z_BUF_ERROR, an input or output error can be distinguished - using strm->next_in which will be Z_NULL only if in() returned an error. If - strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning - non-zero. (in() will always be called before out(), so strm->next_in is - assured to be defined if out() returns non-zero.) Note that inflateBack() - cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: ZLIB_DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - -#ifndef Z_SOLO - - /* utility functions */ - -/* - The following utility functions are implemented on top of the basic - stream-oriented functions. To simplify the interface, some default options - are assumed (compression level and memory usage, standard memory allocation - functions). The source code of these utility functions can be modified if - you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed data. compress() is equivalent to compress2() with a level - parameter of Z_DEFAULT_COMPRESSION. - - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed data. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before a - compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be large enough to hold the entire - uncompressed data. (The size of the uncompressed data must have been saved - previously by the compressor and transmitted to the decompressor by some - mechanism outside the scope of this compression library.) Upon exit, destLen - is the actual size of the uncompressed data. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In - the case where there is not enough room, uncompress() will fill the output - buffer with the uncompressed data up to that point. -*/ - -ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong *sourceLen)); -/* - Same as uncompress, except that sourceLen is a pointer, where the - length of the source is *sourceLen. On return, *sourceLen is the number of - source bytes consumed. -*/ - - /* gzip file access functions */ - -/* - This library supports reading and writing files in gzip (.gz) format with - an interface similar to that of stdio, using the functions that start with - "gz". The gzip format is different from the zlib format. gzip is a gzip - wrapper, documented in RFC 1952, wrapped around a deflate stream. -*/ - -typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ - -/* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); - - Opens a gzip (.gz) file for reading or writing. The mode parameter is as - in fopen ("rb" or "wb") but can also include a compression level ("wb9") or - a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only - compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' - for fixed code compression as in "wb9F". (See the description of - deflateInit2 for more information about the strategy parameter.) 'T' will - request transparent writing or appending with no compression and not using - the gzip format. - - "a" can be used instead of "w" to request that the gzip stream that will - be written be appended to the file. "+" will result in an error, since - reading and writing to the same gzip file is not supported. The addition of - "x" when writing will create the file exclusively, which fails if the file - already exists. On systems that support it, the addition of "e" when - reading or writing will set the flag to close the file on an execve() call. - - These functions, as well as gzip, will read and decode a sequence of gzip - streams in a file. The append function of gzopen() can be used to create - such a file. (Also see gzflush() for another way to do this.) When - appending, gzopen does not test whether the file begins with a gzip stream, - nor does it look for the end of the gzip streams to begin appending. gzopen - will simply append a gzip stream to the existing file. - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. When - reading, this will be detected automatically by looking for the magic two- - byte gzip header. - - gzopen returns NULL if the file could not be opened, if there was - insufficient memory to allocate the gzFile state, or if an invalid mode was - specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). - errno can be checked to determine if the reason gzopen failed was that the - file could not be opened. -*/ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen associates a gzFile with the file descriptor fd. File descriptors - are obtained from calls like open, dup, creat, pipe or fileno (if the file - has been previously opened with fopen). The mode parameter is as in gzopen. - - The next call of gzclose on the returned gzFile will also close the file - descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor - fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, - mode);. The duplicated descriptor should be saved to avoid a leak, since - gzdopen does not close fd if it fails. If you are using fileno() to get the - file descriptor from a FILE *, then you will have to use dup() to avoid - double-close()ing the file descriptor. Both gzclose() and fclose() will - close the associated file descriptor, so they need to have different file - descriptors. - - gzdopen returns NULL if there was insufficient memory to allocate the - gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not - provided, or '+' was provided), or if fd is -1. The file descriptor is not - used until the next gz* read, write, seek, or close operation, so gzdopen - will not detect if fd is invalid (unless fd is -1). -*/ - -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); -/* - Set the internal buffer size used by this library's functions. The - default buffer size is 8192 bytes. This function must be called after - gzopen() or gzdopen(), and before any other calls that read or write the - file. The buffer memory allocation is always deferred to the first read or - write. Three times that size in buffer space is allocated. A larger buffer - size of, for example, 64K or 128K bytes will noticeably increase the speed - of decompression (reading). - - The new buffer size also affects the maximum length for gzprintf(). - - gzbuffer() returns 0 on success, or -1 on failure, such as being called - too late. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. Previously provided - data is flushed before the parameter change. - - gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not - opened for writing, Z_ERRNO if there is an error writing the flushed data, - or Z_MEM_ERROR if there is a memory allocation error. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. If - the input file is not in gzip format, gzread copies the given number of - bytes into the buffer directly from the file. - - After reaching the end of a gzip stream in the input, gzread will continue - to read, looking for another gzip stream. Any number of gzip streams may be - concatenated in the input file, and will all be decompressed by gzread(). - If something other than a gzip stream is encountered after a gzip stream, - that remaining trailing garbage is ignored (and no error is returned). - - gzread can be used to read a gzip file that is being concurrently written. - Upon reaching the end of the input, gzread will return with the available - data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then - gzclearerr can be used to clear the end of file indicator in order to permit - gzread to be tried again. Z_OK indicates that a gzip stream was completed - on the last gzread. Z_BUF_ERROR indicates that the input file ended in the - middle of a gzip stream. Note that gzread does not return -1 in the event - of an incomplete gzip stream. This error is deferred until gzclose(), which - will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip - stream. Alternatively, gzerror can be used before gzclose to detect this - case. - - gzread returns the number of uncompressed bytes actually read, less than - len for end of file, or -1 for error. If len is too large to fit in an int, - then nothing is read, -1 is returned, and the error state is set to - Z_STREAM_ERROR. -*/ - -ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, - gzFile file)); -/* - Read up to nitems items of size size from file to buf, otherwise operating - as gzread() does. This duplicates the interface of stdio's fread(), with - size_t request and return types. If the library defines size_t, then - z_size_t is identical to size_t. If not, then z_size_t is an unsigned - integer type that can contain a pointer. - - gzfread() returns the number of full items read of size size, or zero if - the end of the file was reached and a full item could not be read, or if - there was an error. gzerror() must be consulted if zero is returned in - order to determine if there was an error. If the multiplication of size and - nitems overflows, i.e. the product does not fit in a z_size_t, then nothing - is read, zero is returned, and the error state is set to Z_STREAM_ERROR. - - In the event that the end of file is reached and only a partial item is - available at the end, i.e. the remaining uncompressed data length is not a - multiple of size, then the final partial item is nevetheless read into buf - and the end-of-file flag is set. The length of the partial item read is not - provided, but could be inferred from the result of gztell(). This behavior - is the same as the behavior of fread() implementations in common libraries, - but it prevents the direct use of gzfread() to read a concurrently written - file, reseting and retrying on end-of-file, when size is not 1. -*/ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes written or 0 in case of - error. -*/ - -ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, - z_size_t nitems, gzFile file)); -/* - gzfwrite() writes nitems items of size size from buf to file, duplicating - the interface of stdio's fwrite(), with size_t request and return types. If - the library defines size_t, then z_size_t is identical to size_t. If not, - then z_size_t is an unsigned integer type that can contain a pointer. - - gzfwrite() returns the number of full items written of size size, or zero - if there was an error. If the multiplication of size and nitems overflows, - i.e. the product does not fit in a z_size_t, then nothing is written, zero - is returned, and the error state is set to Z_STREAM_ERROR. -*/ - -ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the arguments to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written, or a negative zlib error code in case - of error. The number of uncompressed bytes written is limited to 8191, or - one less than the buffer size given to gzbuffer(). The caller should assure - that this limit is not exceeded. If it is exceeded, then gzprintf() will - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. - This can be determined using zlibCompileFlags(). -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or a - newline character is read and transferred to buf, or an end-of-file - condition is encountered. If any characters are read or if len == 1, the - string is terminated with a null character. If no characters are read due - to an end-of-file or len < 1, then the buffer is left untouched. - - gzgets returns buf which is a null-terminated string, or it returns NULL - for end-of-file or in case of error. If there was an error, the contents at - buf are indeterminate. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. gzputc - returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte or -1 - in case of end of file or error. This is implemented as a macro for speed. - As such, it does not do all of the checking the other functions do. I.e. - it does not check to see if file is NULL, nor whether the structure file - points to has been clobbered or not. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read as the first character - on the next read. At least one character of push-back is allowed. - gzungetc() returns the character pushed, or -1 on failure. gzungetc() will - fail if c is -1, and may fail if a character has been pushed but not read - yet. If gzungetc is used immediately after gzopen or gzdopen, at least the - output buffer size of pushed characters is allowed. (See gzbuffer above.) - The pushed character will be discarded if the stream is repositioned with - gzseek() or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter flush - is as in the deflate() function. The return value is the zlib error number - (see function gzerror below). gzflush is only permitted when writing. - - If the flush parameter is Z_FINISH, the remaining data is written and the - gzip stream is completed in the output. If gzwrite() is called again, a new - gzip stream will be started in the output. gzread() is able to read such - concatenated gzip streams. - - gzflush should be called only when strictly necessary because it will - degrade compression if called too often. -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); - - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); - - Returns the starting position for the next gzread or gzwrite on the given - compressed file. This position represents a number of bytes in the - uncompressed data stream, and is zero when starting, even if appending or - reading a gzip stream from the middle of a file using gzdopen(). - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); - - Returns the current offset in the file being read or written. This offset - includes the count of bytes that precede the gzip stream, for example when - appending or when using gzdopen() for reading. When reading, the offset - does not include as yet unused buffered input. This information can be used - for a progress indicator. On error, gzoffset() returns -1. -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns true (1) if the end-of-file indicator has been set while reading, - false (0) otherwise. Note that the end-of-file indicator is set only if the - read tried to go past the end of the input, but came up short. Therefore, - just like feof(), gzeof() may return false even if there is no more data to - read, in the event that the last read request was for the exact number of - bytes remaining in the input file. This will happen if the input file size - is an exact multiple of the buffer size. - - If gzeof() returns true, then the read functions will return no more data, - unless the end-of-file indicator is reset by gzclearerr() and the input file - has grown since the previous end of file was detected. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns true (1) if file is being copied directly while reading, or false - (0) if file is a gzip stream being decompressed. - - If the input file is empty, gzdirect() will return true, since the input - does not contain a gzip stream. - - If gzdirect() is used immediately after gzopen() or gzdopen() it will - cause buffers to be allocated to allow reading the file to determine if it - is a gzip file. Therefore if gzbuffer() is used, it should be called before - gzdirect(). - - When writing, gzdirect() returns true (1) if transparent writing was - requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: - gzdirect() is not needed when writing. Transparent writing must be - explicitly requested, so the application already knows the answer. When - linking statically, using gzdirect() will include all of the zlib code for - gzip file reading and decompression, which may not be desired.) -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file and - deallocates the (de)compression state. Note that once file is closed, you - cannot call gzerror with file, since its structures have been deallocated. - gzclose must not be called more than once on the same file, just as free - must not be called more than once on the same allocation. - - gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a - file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the - last read ended in the middle of a gzip stream, or Z_OK on success. -*/ - -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); -/* - Same as gzclose(), but gzclose_r() is only for use when reading, and - gzclose_w() is only for use when writing or appending. The advantage to - using these instead of gzclose() is that they avoid linking in zlib - compression or decompression code that is not used when only reading or only - writing respectively. If gzclose() is used, then both compression and - decompression code will be included the application when linking to a static - zlib library. -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the given - compressed file. errnum is set to zlib error number. If an error occurred - in the file system and not in the compression library, errnum is set to - Z_ERRNO and the application may consult errno to get the exact error code. - - The application must not modify the returned string. Future calls to - this function may invalidate the previously returned string. If file is - closed, then the string previously returned by gzerror will no longer be - available. - - gzerror() should be used to distinguish errors from end-of-file for those - functions above that do not distinguish those cases in their return values. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - -#endif /* !Z_SOLO */ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the compression - library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is Z_NULL, this function returns the - required initial value for the checksum. - - An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed - much faster. - - Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, - z_size_t len)); -/* - Same as adler32(), but with a size_t length. -*/ - -/* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); - - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note - that the z_off_t type (like off_t) is a signed integer. If len2 is - negative, the result has no meaning or utility. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is Z_NULL, this function returns the required - initial value for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf, - z_size_t len)); -/* - Same as crc32(), but with a size_t length. -*/ - -/* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#ifdef Z_PREFIX_SET -# define z_deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -# define z_inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) -#else -# define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -# define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -# define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -# define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) -#endif - -#ifndef Z_SOLO - -/* gzgetc() macro and its supporting function and exposed data structure. Note - * that the real internal state is much larger than the exposed structure. - * This abbreviated structure exposes just enough for the gzgetc() macro. The - * user should not mess with these exposed elements, since their names or - * behavior could change in the future, perhaps even capriciously. They can - * only be used by the gzgetc() macro. You have been warned. - */ -struct gzFile_s { - unsigned have; - unsigned char *next; - z_off64_t pos; -}; -ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ -#ifdef Z_PREFIX_SET -# undef z_gzgetc -# define z_gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) -#else -# define gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) -#endif - -/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or - * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if - * both are true, the application gets the *64 functions, and the regular - * functions are changed to 64 bits) -- in case these are set on systems - * without large file support, _LFS64_LARGEFILE must also be true - */ -#ifdef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); -#endif - -#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) -# ifdef Z_PREFIX_SET -# define z_gzopen z_gzopen64 -# define z_gzseek z_gzseek64 -# define z_gztell z_gztell64 -# define z_gzoffset z_gzoffset64 -# define z_adler32_combine z_adler32_combine64 -# define z_crc32_combine z_crc32_combine64 -# else -# define gzopen gzopen64 -# define gzseek gzseek64 -# define gztell gztell64 -# define gzoffset gzoffset64 -# define adler32_combine adler32_combine64 -# define crc32_combine crc32_combine64 -# endif -# ifndef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); -# endif -#else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); -#endif - -#else /* Z_SOLO */ - - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - -#endif /* !Z_SOLO */ - -/* undocumented functions */ -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); -ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); -ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); -ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); -ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); -#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO) -ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, - const char *mode)); -#endif -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, - const char *format, - va_list va)); -# endif -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ diff --git a/jan/src/dep/libs/zlib/zutil.c b/jan/src/dep/libs/zlib/zutil.c deleted file mode 100644 index a76c6b0c7..000000000 --- a/jan/src/dep/libs/zlib/zutil.c +++ /dev/null @@ -1,325 +0,0 @@ -/* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2017 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#include "zutil.h" -#ifndef Z_SOLO -# include "gzguts.h" -#endif - -z_const char * const z_errmsg[10] = { - (z_const char *)"need dictionary", /* Z_NEED_DICT 2 */ - (z_const char *)"stream end", /* Z_STREAM_END 1 */ - (z_const char *)"", /* Z_OK 0 */ - (z_const char *)"file error", /* Z_ERRNO (-1) */ - (z_const char *)"stream error", /* Z_STREAM_ERROR (-2) */ - (z_const char *)"data error", /* Z_DATA_ERROR (-3) */ - (z_const char *)"insufficient memory", /* Z_MEM_ERROR (-4) */ - (z_const char *)"buffer error", /* Z_BUF_ERROR (-5) */ - (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */ - (z_const char *)"" -}; - - -const char * ZEXPORT zlibVersion() -{ - return ZLIB_VERSION; -} - -uLong ZEXPORT zlibCompileFlags() -{ - uLong flags; - - flags = 0; - switch ((int)(sizeof(uInt))) { - case 2: break; - case 4: flags += 1; break; - case 8: flags += 2; break; - default: flags += 3; - } - switch ((int)(sizeof(uLong))) { - case 2: break; - case 4: flags += 1 << 2; break; - case 8: flags += 2 << 2; break; - default: flags += 3 << 2; - } - switch ((int)(sizeof(voidpf))) { - case 2: break; - case 4: flags += 1 << 4; break; - case 8: flags += 2 << 4; break; - default: flags += 3 << 4; - } - switch ((int)(sizeof(z_off_t))) { - case 2: break; - case 4: flags += 1 << 6; break; - case 8: flags += 2 << 6; break; - default: flags += 3 << 6; - } -#ifdef ZLIB_DEBUG - flags += 1 << 8; -#endif -#if defined(ASMV) || defined(ASMINF) - flags += 1 << 9; -#endif -#ifdef ZLIB_WINAPI - flags += 1 << 10; -#endif -#ifdef BUILDFIXED - flags += 1 << 12; -#endif -#ifdef DYNAMIC_CRC_TABLE - flags += 1 << 13; -#endif -#ifdef NO_GZCOMPRESS - flags += 1L << 16; -#endif -#ifdef NO_GZIP - flags += 1L << 17; -#endif -#ifdef PKZIP_BUG_WORKAROUND - flags += 1L << 20; -#endif -#ifdef FASTEST - flags += 1L << 21; -#endif -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifdef NO_vsnprintf - flags += 1L << 25; -# ifdef HAS_vsprintf_void - flags += 1L << 26; -# endif -# else -# ifdef HAS_vsnprintf_void - flags += 1L << 26; -# endif -# endif -#else - flags += 1L << 24; -# ifdef NO_snprintf - flags += 1L << 25; -# ifdef HAS_sprintf_void - flags += 1L << 26; -# endif -# else -# ifdef HAS_snprintf_void - flags += 1L << 26; -# endif -# endif -#endif - return flags; -} - -#ifdef ZLIB_DEBUG -#include -# ifndef verbose -# define verbose 0 -# endif -int ZLIB_INTERNAL z_verbose = verbose; - -void ZLIB_INTERNAL z_error (m) - char *m; -{ - fprintf(stderr, "%s\n", m); - exit(1); -} -#endif - -/* exported to allow conversion of error code to string for compress() and - * uncompress() - */ -const char * ZEXPORT zError(err) - int err; -{ - return ERR_MSG(err); -} - -#if defined(_WIN32_WCE) - /* The Microsoft C Run-Time Library for Windows CE doesn't have - * errno. We define it as a global variable to simplify porting. - * Its value is always 0 and should not be used. - */ - int errno = 0; -#endif - -#ifndef HAVE_MEMCPY - -void ZLIB_INTERNAL zmemcpy(dest, source, len) - Bytef* dest; - const Bytef* source; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = *source++; /* ??? to be unrolled */ - } while (--len != 0); -} - -int ZLIB_INTERNAL zmemcmp(s1, s2, len) - const Bytef* s1; - const Bytef* s2; - uInt len; -{ - uInt j; - - for (j = 0; j < len; j++) { - if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; - } - return 0; -} - -void ZLIB_INTERNAL zmemzero(dest, len) - Bytef* dest; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = 0; /* ??? to be unrolled */ - } while (--len != 0); -} -#endif - -#ifndef Z_SOLO - -#ifdef SYS16BIT - -#ifdef __TURBOC__ -/* Turbo C in 16-bit mode */ - -# define MY_ZCALLOC - -/* Turbo C malloc() does not allow dynamic allocation of 64K bytes - * and farmalloc(64K) returns a pointer with an offset of 8, so we - * must fix the pointer. Warning: the pointer must be put back to its - * original form in order to free it, use zcfree(). - */ - -#define MAX_PTR 10 -/* 10*64K = 640K */ - -local int next_ptr = 0; - -typedef struct ptr_table_s { - voidpf org_ptr; - voidpf new_ptr; -} ptr_table; - -local ptr_table table[MAX_PTR]; -/* This table is used to remember the original form of pointers - * to large buffers (64K). Such pointers are normalized with a zero offset. - * Since MSDOS is not a preemptive multitasking OS, this table is not - * protected from concurrent access. This hack doesn't work anyway on - * a protected system like OS/2. Use Microsoft C instead. - */ - -voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - voidpf buf; - ulg bsize = (ulg)items*size; - - (void)opaque; - - /* If we allocate less than 65520 bytes, we assume that farmalloc - * will return a usable pointer which doesn't have to be normalized. - */ - if (bsize < 65520L) { - buf = farmalloc(bsize); - if (*(ush*)&buf != 0) return buf; - } else { - buf = farmalloc(bsize + 16L); - } - if (buf == NULL || next_ptr >= MAX_PTR) return NULL; - table[next_ptr].org_ptr = buf; - - /* Normalize the pointer to seg:0 */ - *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; - *(ush*)&buf = 0; - table[next_ptr++].new_ptr = buf; - return buf; -} - -void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) -{ - int n; - - (void)opaque; - - if (*(ush*)&ptr != 0) { /* object < 64K */ - farfree(ptr); - return; - } - /* Find the original pointer */ - for (n = 0; n < next_ptr; n++) { - if (ptr != table[n].new_ptr) continue; - - farfree(table[n].org_ptr); - while (++n < next_ptr) { - table[n-1] = table[n]; - } - next_ptr--; - return; - } - Assert(0, "zcfree: ptr not found"); -} - -#endif /* __TURBOC__ */ - - -#ifdef M_I86 -/* Microsoft C in 16-bit mode */ - -# define MY_ZCALLOC - -#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) -# define _halloc halloc -# define _hfree hfree -#endif - -voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) -{ - (void)opaque; - return _halloc((long)items, size); -} - -void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) -{ - (void)opaque; - _hfree(ptr); -} - -#endif /* M_I86 */ - -#endif /* SYS16BIT */ - - -#ifndef MY_ZCALLOC /* Any system without a special alloc function */ - -#ifndef STDC -extern voidp malloc OF((uInt size)); -extern voidp calloc OF((uInt items, uInt size)); -extern void free OF((voidpf ptr)); -#endif - -voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; -{ - (void)opaque; - return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : - (voidpf)calloc(items, size); -} - -void ZLIB_INTERNAL zcfree (opaque, ptr) - voidpf opaque; - voidpf ptr; -{ - (void)opaque; - free(ptr); -} - -#endif /* MY_ZCALLOC */ - -#endif /* !Z_SOLO */ diff --git a/jan/src/dep/libs/zlib/zutil.h b/jan/src/dep/libs/zlib/zutil.h deleted file mode 100644 index b079ea6a8..000000000 --- a/jan/src/dep/libs/zlib/zutil.h +++ /dev/null @@ -1,271 +0,0 @@ -/* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id$ */ - -#ifndef ZUTIL_H -#define ZUTIL_H - -#ifdef HAVE_HIDDEN -# define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) -#else -# define ZLIB_INTERNAL -#endif - -#include "zlib.h" - -#if defined(STDC) && !defined(Z_SOLO) -# if !(defined(_WIN32_WCE) && defined(_MSC_VER)) -# include -# endif -# include -# include -#endif - -#ifdef Z_SOLO - typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ -#endif - -#ifndef local -# define local static -#endif -/* since "static" is used to mean two completely different things in C, we - define "local" for the non-static meaning of "static", for readability - (compile with -Dlocal if your debugger can't find static symbols) */ - -typedef unsigned char uch; -typedef uch FAR uchf; -typedef unsigned short ush; -typedef ush FAR ushf; -typedef unsigned long ulg; - -extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ -/* (size given to avoid silly warnings with Visual C++) */ - -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] - -#define ERR_RETURN(strm,err) \ - return (strm->msg = ERR_MSG(err), (err)) -/* To be used only when the state is known to be valid */ - - /* common constants */ - -#ifndef DEF_WBITS -# define DEF_WBITS MAX_WBITS -#endif -/* default windowBits for decompression. MAX_WBITS is for compression only */ - -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -/* default memLevel */ - -#define STORED_BLOCK 0 -#define STATIC_TREES 1 -#define DYN_TREES 2 -/* The three kinds of block type */ - -#define MIN_MATCH 3 -#define MAX_MATCH 258 -/* The minimum and maximum match lengths */ - -#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ - - /* target dependencies */ - -#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) -# define OS_CODE 0x00 -# ifndef Z_SOLO -# if defined(__TURBOC__) || defined(__BORLANDC__) -# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) - /* Allow compilation with ANSI keywords only enabled */ - void _Cdecl farfree( void *block ); - void *_Cdecl farmalloc( unsigned long nbytes ); -# else -# include -# endif -# else /* MSC or DJGPP */ -# include -# endif -# endif -#endif - -#ifdef AMIGA -# define OS_CODE 1 -#endif - -#if defined(VAXC) || defined(VMS) -# define OS_CODE 2 -# define F_OPEN(name, mode) \ - fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") -#endif - -#ifdef __370__ -# if __TARGET_LIB__ < 0x20000000 -# define OS_CODE 4 -# elif __TARGET_LIB__ < 0x40000000 -# define OS_CODE 11 -# else -# define OS_CODE 8 -# endif -#endif - -#if defined(ATARI) || defined(atarist) -# define OS_CODE 5 -#endif - -#ifdef OS2 -# define OS_CODE 6 -# if defined(M_I86) && !defined(Z_SOLO) -# include -# endif -#endif - -#if defined(MACOS) || defined(TARGET_OS_MAC) -# define OS_CODE 7 -# ifndef Z_SOLO -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -# endif -#endif - -#ifdef __acorn -# define OS_CODE 13 -#endif - -#if defined(WIN32) && !defined(__CYGWIN__) -# define OS_CODE 10 -#endif - -#ifdef _BEOS_ -# define OS_CODE 16 -#endif - -#ifdef __TOS_OS400__ -# define OS_CODE 18 -#endif - -#ifdef __APPLE__ -# define OS_CODE 19 -#endif - -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# ifndef _PTRDIFF_T_DEFINED - typedef int ptrdiff_t; -# define _PTRDIFF_T_DEFINED -# endif -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - -#if defined(__BORLANDC__) && !defined(MSDOS) - #pragma warn -8004 - #pragma warn -8008 - #pragma warn -8066 -#endif - -/* provide prototypes for these when building zlib without LFS */ -#if !defined(_WIN32) && \ - (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); -#endif - - /* common defaults */ - -#ifndef OS_CODE -# define OS_CODE 3 /* assume Unix */ -#endif - -#ifndef F_OPEN -# define F_OPEN(name, mode) fopen((name), (mode)) -#endif - - /* functions */ - -#if defined(pyr) || defined(Z_SOLO) -# define NO_MEMCPY -#endif -#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) - /* Use our own functions for small and medium model with MSC <= 5.0. - * You may have to use the same strategy for Borland C (untested). - * The __SC__ check is for Symantec. - */ -# define NO_MEMCPY -#endif -#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) -# define HAVE_MEMCPY -#endif -#ifdef HAVE_MEMCPY -# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ -# define zmemcpy _fmemcpy -# define zmemcmp _fmemcmp -# define zmemzero(dest, len) _fmemset(dest, 0, len) -# else -# define zmemcpy memcpy -# define zmemcmp memcmp -# define zmemzero(dest, len) memset(dest, 0, len) -# endif -#else - void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); -#endif - -/* Diagnostic functions */ -#ifdef ZLIB_DEBUG -# include - extern int ZLIB_INTERNAL z_verbose; - extern void ZLIB_INTERNAL z_error OF((char *m)); -# define Assert(cond,msg) {if(!(cond)) z_error(msg);} -# define Trace(x) {if (z_verbose>=0) fprintf x ;} -# define Tracev(x) {if (z_verbose>0) fprintf x ;} -# define Tracevv(x) {if (z_verbose>1) fprintf x ;} -# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} -# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} -#else -# define Assert(cond,msg) -# define Trace(x) -# define Tracev(x) -# define Tracevv(x) -# define Tracec(c,x) -# define Tracecv(c,x) -#endif - -#ifndef Z_SOLO - voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, - unsigned size)); - void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); -#endif - -#define ZALLOC(strm, items, size) \ - (*((strm)->zalloc))((strm)->opaque, (items), (size)) -#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) -#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} - -/* Reverse the bytes in a 32-bit value */ -#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ - (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) - -#endif /* ZUTIL_H */ diff --git a/jan/src/dep/mingw/include/directx9/d3dx9.h b/jan/src/dep/mingw/include/directx9/d3dx9.h deleted file mode 100644 index ec5fc84c6..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9.h +++ /dev/null @@ -1,78 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9.h -// Content: D3DX utility library -// -////////////////////////////////////////////////////////////////////////////// - -#ifdef __D3DX_INTERNAL__ -#error Incorrect D3DX header used -#endif - -#ifndef __D3DX9_H__ -#define __D3DX9_H__ - - -// Defines -#include - -#define D3DX_DEFAULT ((UINT) -1) -#define D3DX_DEFAULT_NONPOW2 ((UINT) -2) -#define D3DX_DEFAULT_FLOAT FLT_MAX -#define D3DX_FROM_FILE ((UINT) -3) -#define D3DFMT_FROM_FILE ((D3DFORMAT) -3) - -#ifndef D3DXINLINE -#ifdef _MSC_VER - #if (_MSC_VER >= 1200) - #define D3DXINLINE __forceinline - #else - #define D3DXINLINE __inline - #endif -#else - #ifdef __cplusplus - #define D3DXINLINE inline - #else - #define D3DXINLINE - #endif -#endif -#endif - - - -// Includes -#include "d3d9.h" -#include "d3dx9math.h" -#include "d3dx9core.h" -#include "d3dx9xof.h" -#include "d3dx9mesh.h" -#include "d3dx9shader.h" -#include "d3dx9effect.h" - -#include "d3dx9tex.h" -#include "d3dx9shape.h" -#include "d3dx9anim.h" - - - -// Errors -#define _FACDD 0x876 -#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) - -enum _D3DXERR { - D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900), - D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901), - D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902), - D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903), - D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904), - D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905), - D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906), - D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907), - D3DXERR_CANNOTREMOVELASTITEM = MAKE_DDHRESULT(2908) -}; - - -#endif //__D3DX9_H__ - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9anim.h b/jan/src/dep/mingw/include/directx9/d3dx9anim.h deleted file mode 100644 index 966f539c0..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9anim.h +++ /dev/null @@ -1,1114 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9anim.h -// Content: D3DX mesh types and functions -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DX9ANIM_H__ -#define __D3DX9ANIM_H__ - -// {698CFB3F-9289-4d95-9A57-33A94B5A65F9} -DEFINE_GUID(IID_ID3DXAnimationSet, -0x698cfb3f, 0x9289, 0x4d95, 0x9a, 0x57, 0x33, 0xa9, 0x4b, 0x5a, 0x65, 0xf9); - -// {FA4E8E3A-9786-407d-8B4C-5995893764AF} -DEFINE_GUID(IID_ID3DXKeyframedAnimationSet, -0xfa4e8e3a, 0x9786, 0x407d, 0x8b, 0x4c, 0x59, 0x95, 0x89, 0x37, 0x64, 0xaf); - -// {6CC2480D-3808-4739-9F88-DE49FACD8D4C} -DEFINE_GUID(IID_ID3DXCompressedAnimationSet, -0x6cc2480d, 0x3808, 0x4739, 0x9f, 0x88, 0xde, 0x49, 0xfa, 0xcd, 0x8d, 0x4c); - -// {AC8948EC-F86D-43e2-96DE-31FC35F96D9E} -DEFINE_GUID(IID_ID3DXAnimationController, -0xac8948ec, 0xf86d, 0x43e2, 0x96, 0xde, 0x31, 0xfc, 0x35, 0xf9, 0x6d, 0x9e); - - -//---------------------------------------------------------------------------- -// D3DXMESHDATATYPE: -// ----------------- -// This enum defines the type of mesh data present in a MeshData structure. -//---------------------------------------------------------------------------- -typedef enum _D3DXMESHDATATYPE { - D3DXMESHTYPE_MESH = 0x001, // Normal ID3DXMesh data - D3DXMESHTYPE_PMESH = 0x002, // Progressive Mesh - ID3DXPMesh - D3DXMESHTYPE_PATCHMESH = 0x003, // Patch Mesh - ID3DXPatchMesh - - D3DXMESHTYPE_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ -} D3DXMESHDATATYPE; - -//---------------------------------------------------------------------------- -// D3DXMESHDATA: -// ------------- -// This struct encapsulates a the mesh data that can be present in a mesh -// container. The supported mesh types are pMesh, pPMesh, pPatchMesh. -// The valid way to access this is determined by the Type enum. -//---------------------------------------------------------------------------- -typedef struct _D3DXMESHDATA -{ - D3DXMESHDATATYPE Type; - - // current mesh data interface - union - { - LPD3DXMESH pMesh; - LPD3DXPMESH pPMesh; - LPD3DXPATCHMESH pPatchMesh; - }; -} D3DXMESHDATA, *LPD3DXMESHDATA; - -//---------------------------------------------------------------------------- -// D3DXMESHCONTAINER: -// ------------------ -// This struct encapsulates a mesh object in a transformation frame -// hierarchy. The app can derive from this structure to add other app specific -// data to this. -//---------------------------------------------------------------------------- -typedef struct _D3DXMESHCONTAINER -{ - LPSTR Name; - - D3DXMESHDATA MeshData; - - LPD3DXMATERIAL pMaterials; - LPD3DXEFFECTINSTANCE pEffects; - DWORD NumMaterials; - DWORD *pAdjacency; - - LPD3DXSKININFO pSkinInfo; - - struct _D3DXMESHCONTAINER *pNextMeshContainer; -} D3DXMESHCONTAINER, *LPD3DXMESHCONTAINER; - -//---------------------------------------------------------------------------- -// D3DXFRAME: -// ---------- -// This struct is the encapsulates a transform frame in a transformation frame -// hierarchy. The app can derive from this structure to add other app specific -// data to this -//---------------------------------------------------------------------------- -typedef struct _D3DXFRAME -{ - LPSTR Name; - D3DXMATRIX TransformationMatrix; - - LPD3DXMESHCONTAINER pMeshContainer; - - struct _D3DXFRAME *pFrameSibling; - struct _D3DXFRAME *pFrameFirstChild; -} D3DXFRAME, *LPD3DXFRAME; - - -//---------------------------------------------------------------------------- -// ID3DXAllocateHierarchy: -// ----------------------- -// This interface is implemented by the application to allocate/free frame and -// mesh container objects. Methods on this are called during loading and -// destroying frame hierarchies -//---------------------------------------------------------------------------- -typedef interface ID3DXAllocateHierarchy ID3DXAllocateHierarchy; -typedef interface ID3DXAllocateHierarchy *LPD3DXALLOCATEHIERARCHY; - -#undef INTERFACE -#define INTERFACE ID3DXAllocateHierarchy - -DECLARE_INTERFACE(ID3DXAllocateHierarchy) -{ - // ID3DXAllocateHierarchy - - //------------------------------------------------------------------------ - // CreateFrame: - // ------------ - // Requests allocation of a frame object. - // - // Parameters: - // Name - // Name of the frame to be created - // ppNewFrame - // Returns the created frame object - // - //------------------------------------------------------------------------ - STDMETHOD(CreateFrame)(THIS_ LPCSTR Name, - LPD3DXFRAME *ppNewFrame) PURE; - - //------------------------------------------------------------------------ - // CreateMeshContainer: - // -------------------- - // Requests allocation of a mesh container object. - // - // Parameters: - // Name - // Name of the mesh - // pMesh - // Pointer to the mesh object if basic polygon data found - // pPMesh - // Pointer to the progressive mesh object if progressive mesh data found - // pPatchMesh - // Pointer to the patch mesh object if patch data found - // pMaterials - // Array of materials used in the mesh - // pEffectInstances - // Array of effect instances used in the mesh - // NumMaterials - // Num elements in the pMaterials array - // pAdjacency - // Adjacency array for the mesh - // pSkinInfo - // Pointer to the skininfo object if the mesh is skinned - // pBoneNames - // Array of names, one for each bone in the skinned mesh. - // The numberof bones can be found from the pSkinMesh object - // pBoneOffsetMatrices - // Array of matrices, one for each bone in the skinned mesh. - // - //------------------------------------------------------------------------ - STDMETHOD(CreateMeshContainer)(THIS_ - LPCSTR Name, - CONST D3DXMESHDATA *pMeshData, - CONST D3DXMATERIAL *pMaterials, - CONST D3DXEFFECTINSTANCE *pEffectInstances, - DWORD NumMaterials, - CONST DWORD *pAdjacency, - LPD3DXSKININFO pSkinInfo, - LPD3DXMESHCONTAINER *ppNewMeshContainer) PURE; - - //------------------------------------------------------------------------ - // DestroyFrame: - // ------------- - // Requests de-allocation of a frame object. - // - // Parameters: - // pFrameToFree - // Pointer to the frame to be de-allocated - // - //------------------------------------------------------------------------ - STDMETHOD(DestroyFrame)(THIS_ LPD3DXFRAME pFrameToFree) PURE; - - //------------------------------------------------------------------------ - // DestroyMeshContainer: - // --------------------- - // Requests de-allocation of a mesh container object. - // - // Parameters: - // pMeshContainerToFree - // Pointer to the mesh container object to be de-allocated - // - //------------------------------------------------------------------------ - STDMETHOD(DestroyMeshContainer)(THIS_ LPD3DXMESHCONTAINER pMeshContainerToFree) PURE; -}; - -//---------------------------------------------------------------------------- -// ID3DXLoadUserData: -// ------------------ -// This interface is implemented by the application to load user data in a .X file -// When user data is found, these callbacks will be used to allow the application -// to load the data. -//---------------------------------------------------------------------------- -typedef interface ID3DXLoadUserData ID3DXLoadUserData; -typedef interface ID3DXLoadUserData *LPD3DXLOADUSERDATA; - -#undef INTERFACE -#define INTERFACE ID3DXLoadUserData - -DECLARE_INTERFACE(ID3DXLoadUserData) -{ - STDMETHOD(LoadTopLevelData)(LPD3DXFILEDATA pXofChildData) PURE; - - STDMETHOD(LoadFrameChildData)(LPD3DXFRAME pFrame, - LPD3DXFILEDATA pXofChildData) PURE; - - STDMETHOD(LoadMeshChildData)(LPD3DXMESHCONTAINER pMeshContainer, - LPD3DXFILEDATA pXofChildData) PURE; -}; - -//---------------------------------------------------------------------------- -// ID3DXSaveUserData: -// ------------------ -// This interface is implemented by the application to save user data in a .X file -// The callbacks are called for all data saved. The user can then add any -// child data objects to the object provided to the callback. -//---------------------------------------------------------------------------- -typedef interface ID3DXSaveUserData ID3DXSaveUserData; -typedef interface ID3DXSaveUserData *LPD3DXSAVEUSERDATA; - -#undef INTERFACE -#define INTERFACE ID3DXSaveUserData - -DECLARE_INTERFACE(ID3DXSaveUserData) -{ - STDMETHOD(AddFrameChildData)(CONST D3DXFRAME *pFrame, - LPD3DXFILESAVEOBJECT pXofSave, - LPD3DXFILESAVEDATA pXofFrameData) PURE; - - STDMETHOD(AddMeshChildData)(CONST D3DXMESHCONTAINER *pMeshContainer, - LPD3DXFILESAVEOBJECT pXofSave, - LPD3DXFILESAVEDATA pXofMeshData) PURE; - - // NOTE: this is called once per Save. All top level objects should be added using the - // provided interface. One call adds objects before the frame hierarchy, the other after - STDMETHOD(AddTopLevelDataObjectsPre)(LPD3DXFILESAVEOBJECT pXofSave) PURE; - STDMETHOD(AddTopLevelDataObjectsPost)(LPD3DXFILESAVEOBJECT pXofSave) PURE; - - // callbacks for the user to register and then save templates to the XFile - STDMETHOD(RegisterTemplates)(LPD3DXFILE pXFileApi) PURE; - STDMETHOD(SaveTemplates)(LPD3DXFILESAVEOBJECT pXofSave) PURE; -}; - - -//---------------------------------------------------------------------------- -// D3DXCALLBACK_SEARCH_FLAGS: -// -------------------------- -// Flags that can be passed into ID3DXAnimationSet::GetCallback. -//---------------------------------------------------------------------------- -typedef enum _D3DXCALLBACK_SEARCH_FLAGS -{ - D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION = 0x01, // exclude callbacks at the initial position from the search - D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION = 0x02, // reverse the callback search direction - - D3DXCALLBACK_SEARCH_FORCE_DWORD = 0x7fffffff -} D3DXCALLBACK_SEARCH_FLAGS; - -//---------------------------------------------------------------------------- -// ID3DXAnimationSet: -// ------------------ -// This interface implements an animation set. -//---------------------------------------------------------------------------- -typedef interface ID3DXAnimationSet ID3DXAnimationSet; -typedef interface ID3DXAnimationSet *LPD3DXANIMATIONSET; - -#undef INTERFACE -#define INTERFACE ID3DXAnimationSet - -DECLARE_INTERFACE_(ID3DXAnimationSet, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Name - STDMETHOD_(LPCSTR, GetName)(THIS) PURE; - - // Period - STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; - STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period - - // Animation names - STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; - STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; - STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; - - // SRT - STDMETHOD(GetSRT)(THIS_ - DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) - UINT Animation, // Animation index - D3DXVECTOR3 *pScale, // Returns the scale - D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion - D3DXVECTOR3 *pTranslation) PURE; // Returns the translation - - // Callbacks - STDMETHOD(GetCallback)(THIS_ - DOUBLE Position, // Position from which to find callbacks - DWORD Flags, // Callback search flags - DOUBLE *pCallbackPosition, // Returns the position of the callback - LPVOID *ppCallbackData) PURE; // Returns the callback data pointer -}; - - -//---------------------------------------------------------------------------- -// D3DXPLAYBACK_TYPE: -// ------------------ -// This enum defines the type of animation set loop modes. -//---------------------------------------------------------------------------- -typedef enum _D3DXPLAYBACK_TYPE -{ - D3DXPLAY_LOOP = 0, - D3DXPLAY_ONCE = 1, - D3DXPLAY_PINGPONG = 2, - - D3DXPLAY_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ -} D3DXPLAYBACK_TYPE; - - -//---------------------------------------------------------------------------- -// D3DXKEY_VECTOR3: -// ---------------- -// This structure describes a vector key for use in keyframe animation. -// It specifies a vector Value at a given Time. This is used for scale and -// translation keys. -//---------------------------------------------------------------------------- -typedef struct _D3DXKEY_VECTOR3 -{ - FLOAT Time; - D3DXVECTOR3 Value; -} D3DXKEY_VECTOR3, *LPD3DXKEY_VECTOR3; - - -//---------------------------------------------------------------------------- -// D3DXKEY_QUATERNION: -// ------------------- -// This structure describes a quaternion key for use in keyframe animation. -// It specifies a quaternion Value at a given Time. This is used for rotation -// keys. -//---------------------------------------------------------------------------- -typedef struct _D3DXKEY_QUATERNION -{ - FLOAT Time; - D3DXQUATERNION Value; -} D3DXKEY_QUATERNION, *LPD3DXKEY_QUATERNION; - - -//---------------------------------------------------------------------------- -// D3DXKEY_CALLBACK: -// ----------------- -// This structure describes an callback key for use in keyframe animation. -// It specifies a pointer to user data at a given Time. -//---------------------------------------------------------------------------- -typedef struct _D3DXKEY_CALLBACK -{ - FLOAT Time; - LPVOID pCallbackData; -} D3DXKEY_CALLBACK, *LPD3DXKEY_CALLBACK; - - -//---------------------------------------------------------------------------- -// D3DXCOMPRESSION_FLAGS: -// ---------------------- -// Flags that can be passed into ID3DXKeyframedAnimationSet::Compress. -//---------------------------------------------------------------------------- -typedef enum _D3DXCOMPRESSION_FLAGS -{ - D3DXCOMPRESS_DEFAULT = 0x00, - - D3DXCOMPRESS_FORCE_DWORD = 0x7fffffff -} D3DXCOMPRESSION_FLAGS; - - -//---------------------------------------------------------------------------- -// ID3DXKeyframedAnimationSet: -// --------------------------- -// This interface implements a compressable keyframed animation set. -//---------------------------------------------------------------------------- -typedef interface ID3DXKeyframedAnimationSet ID3DXKeyframedAnimationSet; -typedef interface ID3DXKeyframedAnimationSet *LPD3DXKEYFRAMEDANIMATIONSET; - -#undef INTERFACE -#define INTERFACE ID3DXKeyframedAnimationSet - -DECLARE_INTERFACE_(ID3DXKeyframedAnimationSet, ID3DXAnimationSet) -{ - // ID3DXAnimationSet - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Name - STDMETHOD_(LPCSTR, GetName)(THIS) PURE; - - // Period - STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; - STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period - - // Animation names - STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; - STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; - STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; - - // SRT - STDMETHOD(GetSRT)(THIS_ - DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) - UINT Animation, // Animation index - D3DXVECTOR3 *pScale, // Returns the scale - D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion - D3DXVECTOR3 *pTranslation) PURE; // Returns the translation - - // Callbacks - STDMETHOD(GetCallback)(THIS_ - DOUBLE Position, // Position from which to find callbacks - DWORD Flags, // Callback search flags - DOUBLE *pCallbackPosition, // Returns the position of the callback - LPVOID *ppCallbackData) PURE; // Returns the callback data pointer - - // Playback - STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; - STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; - - // Scale keys - STDMETHOD_(UINT, GetNumScaleKeys)(THIS_ UINT Animation) PURE; - STDMETHOD(GetScaleKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pScaleKeys) PURE; - STDMETHOD(GetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE; - STDMETHOD(SetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE; - - // Rotation keys - STDMETHOD_(UINT, GetNumRotationKeys)(THIS_ UINT Animation) PURE; - STDMETHOD(GetRotationKeys)(THIS_ UINT Animation, LPD3DXKEY_QUATERNION pRotationKeys) PURE; - STDMETHOD(GetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE; - STDMETHOD(SetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE; - - // Translation keys - STDMETHOD_(UINT, GetNumTranslationKeys)(THIS_ UINT Animation) PURE; - STDMETHOD(GetTranslationKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pTranslationKeys) PURE; - STDMETHOD(GetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE; - STDMETHOD(SetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE; - - // Callback keys - STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE; - STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE; - STDMETHOD(GetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE; - STDMETHOD(SetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE; - - // Key removal methods. These are slow, and should not be used once the animation starts playing - STDMETHOD(UnregisterScaleKey)(THIS_ UINT Animation, UINT Key) PURE; - STDMETHOD(UnregisterRotationKey)(THIS_ UINT Animation, UINT Key) PURE; - STDMETHOD(UnregisterTranslationKey)(THIS_ UINT Animation, UINT Key) PURE; - - // One-time animaton SRT keyframe registration - STDMETHOD(RegisterAnimationSRTKeys)(THIS_ - LPCSTR pName, // Animation name - UINT NumScaleKeys, // Number of scale keys - UINT NumRotationKeys, // Number of rotation keys - UINT NumTranslationKeys, // Number of translation keys - CONST D3DXKEY_VECTOR3 *pScaleKeys, // Array of scale keys - CONST D3DXKEY_QUATERNION *pRotationKeys, // Array of rotation keys - CONST D3DXKEY_VECTOR3 *pTranslationKeys, // Array of translation keys - DWORD *pAnimationIndex) PURE; // Returns the animation index - - // Compression - STDMETHOD(Compress)(THIS_ - DWORD Flags, // Compression flags (use D3DXCOMPRESS_STRONG for better results) - FLOAT Lossiness, // Compression loss ratio in the [0, 1] range - LPD3DXFRAME pHierarchy, // Frame hierarchy (optional) - LPD3DXBUFFER *ppCompressedData) PURE; // Returns the compressed animation set - - STDMETHOD(UnregisterAnimation)(THIS_ UINT Index) PURE; -}; - - -//---------------------------------------------------------------------------- -// ID3DXCompressedAnimationSet: -// ---------------------------- -// This interface implements a compressed keyframed animation set. -//---------------------------------------------------------------------------- -typedef interface ID3DXCompressedAnimationSet ID3DXCompressedAnimationSet; -typedef interface ID3DXCompressedAnimationSet *LPD3DXCOMPRESSEDANIMATIONSET; - -#undef INTERFACE -#define INTERFACE ID3DXCompressedAnimationSet - -DECLARE_INTERFACE_(ID3DXCompressedAnimationSet, ID3DXAnimationSet) -{ - // ID3DXAnimationSet - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Name - STDMETHOD_(LPCSTR, GetName)(THIS) PURE; - - // Period - STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; - STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period - - // Animation names - STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; - STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; - STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; - - // SRT - STDMETHOD(GetSRT)(THIS_ - DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) - UINT Animation, // Animation index - D3DXVECTOR3 *pScale, // Returns the scale - D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion - D3DXVECTOR3 *pTranslation) PURE; // Returns the translation - - // Callbacks - STDMETHOD(GetCallback)(THIS_ - DOUBLE Position, // Position from which to find callbacks - DWORD Flags, // Callback search flags - DOUBLE *pCallbackPosition, // Returns the position of the callback - LPVOID *ppCallbackData) PURE; // Returns the callback data pointer - - // Playback - STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; - STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; - - // Scale keys - STDMETHOD(GetCompressedData)(THIS_ LPD3DXBUFFER *ppCompressedData) PURE; - - // Callback keys - STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE; - STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE; -}; - - -//---------------------------------------------------------------------------- -// D3DXPRIORITY_TYPE: -// ------------------ -// This enum defines the type of priority group that a track can be assigned to. -//---------------------------------------------------------------------------- -typedef enum _D3DXPRIORITY_TYPE { - D3DXPRIORITY_LOW = 0, // This track should be blended with all low priority tracks before mixed with the high priority result - D3DXPRIORITY_HIGH = 1, // This track should be blended with all high priority tracks before mixed with the low priority result - - D3DXPRIORITY_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ -} D3DXPRIORITY_TYPE; - -//---------------------------------------------------------------------------- -// D3DXTRACK_DESC: -// --------------- -// This structure describes the mixing information of an animation track. -// The mixing information consists of the current position, speed, and blending -// weight for the track. The Flags field also specifies whether the track is -// low or high priority. Tracks with the same priority are blended together -// and then the two resulting values are blended using the priority blend factor. -// A track also has an animation set (stored separately) associated with it. -//---------------------------------------------------------------------------- -typedef struct _D3DXTRACK_DESC -{ - D3DXPRIORITY_TYPE Priority; - FLOAT Weight; - FLOAT Speed; - DOUBLE Position; - BOOL Enable; -} D3DXTRACK_DESC, *LPD3DXTRACK_DESC; - -//---------------------------------------------------------------------------- -// D3DXEVENT_TYPE: -// --------------- -// This enum defines the type of events keyable via the animation controller. -//---------------------------------------------------------------------------- -typedef enum _D3DXEVENT_TYPE -{ - D3DXEVENT_TRACKSPEED = 0, - D3DXEVENT_TRACKWEIGHT = 1, - D3DXEVENT_TRACKPOSITION = 2, - D3DXEVENT_TRACKENABLE = 3, - D3DXEVENT_PRIORITYBLEND = 4, - - D3DXEVENT_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ -} D3DXEVENT_TYPE; - -//---------------------------------------------------------------------------- -// D3DXTRANSITION_TYPE: -// -------------------- -// This enum defines the type of transtion performed on a event that -// transitions from one value to another. -//---------------------------------------------------------------------------- -typedef enum _D3DXTRANSITION_TYPE { - D3DXTRANSITION_LINEAR = 0x000, // Linear transition from one value to the next - D3DXTRANSITION_EASEINEASEOUT = 0x001, // Ease-In Ease-Out spline transtion from one value to the next - - D3DXTRANSITION_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ -} D3DXTRANSITION_TYPE; - -//---------------------------------------------------------------------------- -// D3DXEVENT_DESC: -// --------------- -// This structure describes a animation controller event. -// It gives the event's type, track (if the event is a track event), global -// start time, duration, transition method, and target value. -//---------------------------------------------------------------------------- -typedef struct _D3DXEVENT_DESC -{ - D3DXEVENT_TYPE Type; - UINT Track; - DOUBLE StartTime; - DOUBLE Duration; - D3DXTRANSITION_TYPE Transition; - union - { - FLOAT Weight; - FLOAT Speed; - DOUBLE Position; - BOOL Enable; - }; -} D3DXEVENT_DESC, *LPD3DXEVENT_DESC; - -//---------------------------------------------------------------------------- -// D3DXEVENTHANDLE: -// ---------------- -// Handle values used to efficiently reference animation controller events. -//---------------------------------------------------------------------------- -typedef DWORD D3DXEVENTHANDLE; -typedef D3DXEVENTHANDLE *LPD3DXEVENTHANDLE; - - -//---------------------------------------------------------------------------- -// ID3DXAnimationCallbackHandler: -// ------------------------------ -// This interface is intended to be implemented by the application, and can -// be used to handle callbacks in animation sets generated when -// ID3DXAnimationController::AdvanceTime() is called. -//---------------------------------------------------------------------------- -typedef interface ID3DXAnimationCallbackHandler ID3DXAnimationCallbackHandler; -typedef interface ID3DXAnimationCallbackHandler *LPD3DXANIMATIONCALLBACKHANDLER; - -#undef INTERFACE -#define INTERFACE ID3DXAnimationCallbackHandler - -DECLARE_INTERFACE(ID3DXAnimationCallbackHandler) -{ - //---------------------------------------------------------------------------- - // ID3DXAnimationCallbackHandler::HandleCallback: - // ---------------------------------------------- - // This method gets called when a callback occurs for an animation set in one - // of the tracks during the ID3DXAnimationController::AdvanceTime() call. - // - // Parameters: - // Track - // Index of the track on which the callback occured. - // pCallbackData - // Pointer to user owned callback data. - // - //---------------------------------------------------------------------------- - STDMETHOD(HandleCallback)(THIS_ UINT Track, LPVOID pCallbackData) PURE; -}; - - -//---------------------------------------------------------------------------- -// ID3DXAnimationController: -// ------------------------- -// This interface implements the main animation functionality. It connects -// animation sets with the transform frames that are being animated. Allows -// mixing multiple animations for blended animations or for transistions -// It adds also has methods to modify blending parameters over time to -// enable smooth transistions and other effects. -//---------------------------------------------------------------------------- -typedef interface ID3DXAnimationController ID3DXAnimationController; -typedef interface ID3DXAnimationController *LPD3DXANIMATIONCONTROLLER; - -#undef INTERFACE -#define INTERFACE ID3DXAnimationController - -DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Max sizes - STDMETHOD_(UINT, GetMaxNumAnimationOutputs)(THIS) PURE; - STDMETHOD_(UINT, GetMaxNumAnimationSets)(THIS) PURE; - STDMETHOD_(UINT, GetMaxNumTracks)(THIS) PURE; - STDMETHOD_(UINT, GetMaxNumEvents)(THIS) PURE; - - // Animation output registration - STDMETHOD(RegisterAnimationOutput)(THIS_ - LPCSTR pName, - D3DXMATRIX *pMatrix, - D3DXVECTOR3 *pScale, - D3DXQUATERNION *pRotation, - D3DXVECTOR3 *pTranslation) PURE; - - // Animation set registration - STDMETHOD(RegisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE; - STDMETHOD(UnregisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE; - - STDMETHOD_(UINT, GetNumAnimationSets)(THIS) PURE; - STDMETHOD(GetAnimationSet)(THIS_ UINT Index, LPD3DXANIMATIONSET *ppAnimationSet) PURE; - STDMETHOD(GetAnimationSetByName)(THIS_ LPCSTR szName, LPD3DXANIMATIONSET *ppAnimationSet) PURE; - - // Global time - STDMETHOD(AdvanceTime)(THIS_ DOUBLE TimeDelta, LPD3DXANIMATIONCALLBACKHANDLER pCallbackHandler) PURE; - STDMETHOD(ResetTime)(THIS) PURE; - STDMETHOD_(DOUBLE, GetTime)(THIS) PURE; - - // Tracks - STDMETHOD(SetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET pAnimSet) PURE; - STDMETHOD(GetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET *ppAnimSet) PURE; - - STDMETHOD(SetTrackPriority)(THIS_ UINT Track, D3DXPRIORITY_TYPE Priority) PURE; - - STDMETHOD(SetTrackSpeed)(THIS_ UINT Track, FLOAT Speed) PURE; - STDMETHOD(SetTrackWeight)(THIS_ UINT Track, FLOAT Weight) PURE; - STDMETHOD(SetTrackPosition)(THIS_ UINT Track, DOUBLE Position) PURE; - STDMETHOD(SetTrackEnable)(THIS_ UINT Track, BOOL Enable) PURE; - - STDMETHOD(SetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE; - STDMETHOD(GetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE; - - // Priority blending - STDMETHOD(SetPriorityBlend)(THIS_ FLOAT BlendWeight) PURE; - STDMETHOD_(FLOAT, GetPriorityBlend)(THIS) PURE; - - // Event keying - STDMETHOD_(D3DXEVENTHANDLE, KeyTrackSpeed)(THIS_ UINT Track, FLOAT NewSpeed, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; - STDMETHOD_(D3DXEVENTHANDLE, KeyTrackWeight)(THIS_ UINT Track, FLOAT NewWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; - STDMETHOD_(D3DXEVENTHANDLE, KeyTrackPosition)(THIS_ UINT Track, DOUBLE NewPosition, DOUBLE StartTime) PURE; - STDMETHOD_(D3DXEVENTHANDLE, KeyTrackEnable)(THIS_ UINT Track, BOOL NewEnable, DOUBLE StartTime) PURE; - - STDMETHOD_(D3DXEVENTHANDLE, KeyPriorityBlend)(THIS_ FLOAT NewBlendWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; - - // Event unkeying - STDMETHOD(UnkeyEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE; - - STDMETHOD(UnkeyAllTrackEvents)(THIS_ UINT Track) PURE; - STDMETHOD(UnkeyAllPriorityBlends)(THIS) PURE; - - // Event enumeration - STDMETHOD_(D3DXEVENTHANDLE, GetCurrentTrackEvent)(THIS_ UINT Track, D3DXEVENT_TYPE EventType) PURE; - STDMETHOD_(D3DXEVENTHANDLE, GetCurrentPriorityBlend)(THIS) PURE; - - STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingTrackEvent)(THIS_ UINT Track, D3DXEVENTHANDLE hEvent) PURE; - STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingPriorityBlend)(THIS_ D3DXEVENTHANDLE hEvent) PURE; - - STDMETHOD(ValidateEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE; - - STDMETHOD(GetEventDesc)(THIS_ D3DXEVENTHANDLE hEvent, LPD3DXEVENT_DESC pDesc) PURE; - - // Cloning - STDMETHOD(CloneAnimationController)(THIS_ - UINT MaxNumAnimationOutputs, - UINT MaxNumAnimationSets, - UINT MaxNumTracks, - UINT MaxNumEvents, - LPD3DXANIMATIONCONTROLLER *ppAnimController) PURE; -}; - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -//---------------------------------------------------------------------------- -// D3DXLoadMeshHierarchyFromX: -// --------------------------- -// Loads the first frame hierarchy in a .X file. -// -// Parameters: -// Filename -// Name of the .X file -// MeshOptions -// Mesh creation options for meshes in the file (see d3dx9mesh.h) -// pD3DDevice -// D3D9 device on which meshes in the file are created in -// pAlloc -// Allocation interface used to allocate nodes of the frame hierarchy -// pUserDataLoader -// Application provided interface to allow loading of user data -// ppFrameHierarchy -// Returns root node pointer of the loaded frame hierarchy -// ppAnimController -// Returns pointer to an animation controller corresponding to animation -// in the .X file. This is created with default max tracks and events -// -//---------------------------------------------------------------------------- -HRESULT WINAPI -D3DXLoadMeshHierarchyFromXA - ( - LPCSTR Filename, - DWORD MeshOptions, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXALLOCATEHIERARCHY pAlloc, - LPD3DXLOADUSERDATA pUserDataLoader, - LPD3DXFRAME *ppFrameHierarchy, - LPD3DXANIMATIONCONTROLLER *ppAnimController - ); - -HRESULT WINAPI -D3DXLoadMeshHierarchyFromXW - ( - LPCWSTR Filename, - DWORD MeshOptions, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXALLOCATEHIERARCHY pAlloc, - LPD3DXLOADUSERDATA pUserDataLoader, - LPD3DXFRAME *ppFrameHierarchy, - LPD3DXANIMATIONCONTROLLER *ppAnimController - ); - -#ifdef UNICODE -#define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXW -#else -#define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXA -#endif - -HRESULT WINAPI -D3DXLoadMeshHierarchyFromXInMemory - ( - LPCVOID Memory, - DWORD SizeOfMemory, - DWORD MeshOptions, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXALLOCATEHIERARCHY pAlloc, - LPD3DXLOADUSERDATA pUserDataLoader, - LPD3DXFRAME *ppFrameHierarchy, - LPD3DXANIMATIONCONTROLLER *ppAnimController - ); - -//---------------------------------------------------------------------------- -// D3DXSaveMeshHierarchyToFile: -// ---------------------------- -// Creates a .X file and saves the mesh hierarchy and corresponding animations -// in it -// -// Parameters: -// Filename -// Name of the .X file -// XFormat -// Format of the .X file (text or binary, compressed or not, etc) -// pFrameRoot -// Root node of the hierarchy to be saved -// pAnimController -// The animation controller whose animation sets are to be stored -// pUserDataSaver -// Application provided interface to allow adding of user data to -// data objects saved to .X file -// -//---------------------------------------------------------------------------- -HRESULT WINAPI -D3DXSaveMeshHierarchyToFileA - ( - LPCSTR Filename, - DWORD XFormat, - CONST D3DXFRAME *pFrameRoot, - LPD3DXANIMATIONCONTROLLER pAnimcontroller, - LPD3DXSAVEUSERDATA pUserDataSaver - ); - -HRESULT WINAPI -D3DXSaveMeshHierarchyToFileW - ( - LPCWSTR Filename, - DWORD XFormat, - CONST D3DXFRAME *pFrameRoot, - LPD3DXANIMATIONCONTROLLER pAnimController, - LPD3DXSAVEUSERDATA pUserDataSaver - ); - -#ifdef UNICODE -#define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileW -#else -#define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileA -#endif - -//---------------------------------------------------------------------------- -// D3DXFrameDestroy: -// ----------------- -// Destroys the subtree of frames under the root, including the root -// -// Parameters: -// pFrameRoot -// Pointer to the root node -// pAlloc -// Allocation interface used to de-allocate nodes of the frame hierarchy -// -//---------------------------------------------------------------------------- -HRESULT WINAPI -D3DXFrameDestroy - ( - LPD3DXFRAME pFrameRoot, - LPD3DXALLOCATEHIERARCHY pAlloc - ); - -//---------------------------------------------------------------------------- -// D3DXFrameAppendChild: -// --------------------- -// Add a child frame to a frame -// -// Parameters: -// pFrameParent -// Pointer to the parent node -// pFrameChild -// Pointer to the child node -// -//---------------------------------------------------------------------------- -HRESULT WINAPI -D3DXFrameAppendChild - ( - LPD3DXFRAME pFrameParent, - CONST D3DXFRAME *pFrameChild - ); - -//---------------------------------------------------------------------------- -// D3DXFrameFind: -// -------------- -// Finds a frame with the given name. Returns NULL if no frame found. -// -// Parameters: -// pFrameRoot -// Pointer to the root node -// Name -// Name of frame to find -// -//---------------------------------------------------------------------------- -LPD3DXFRAME WINAPI -D3DXFrameFind - ( - CONST D3DXFRAME *pFrameRoot, - LPCSTR Name - ); - -//---------------------------------------------------------------------------- -// D3DXFrameRegisterNamedMatrices: -// ------------------------------- -// Finds all frames that have non-null names and registers each of those frame -// matrices to the given animation controller -// -// Parameters: -// pFrameRoot -// Pointer to the root node -// pAnimController -// Pointer to the animation controller where the matrices are registered -// -//---------------------------------------------------------------------------- -HRESULT WINAPI -D3DXFrameRegisterNamedMatrices - ( - LPD3DXFRAME pFrameRoot, - LPD3DXANIMATIONCONTROLLER pAnimController - ); - -//---------------------------------------------------------------------------- -// D3DXFrameNumNamedMatrices: -// -------------------------- -// Counts number of frames in a subtree that have non-null names -// -// Parameters: -// pFrameRoot -// Pointer to the root node of the subtree -// Return Value: -// Count of frames -// -//---------------------------------------------------------------------------- -UINT WINAPI -D3DXFrameNumNamedMatrices - ( - CONST D3DXFRAME *pFrameRoot - ); - -//---------------------------------------------------------------------------- -// D3DXFrameCalculateBoundingSphere: -// --------------------------------- -// Computes the bounding sphere of all the meshes in the frame hierarchy. -// -// Parameters: -// pFrameRoot -// Pointer to the root node -// pObjectCenter -// Returns the center of the bounding sphere -// pObjectRadius -// Returns the radius of the bounding sphere -// -//---------------------------------------------------------------------------- -HRESULT WINAPI -D3DXFrameCalculateBoundingSphere - ( - CONST D3DXFRAME *pFrameRoot, - LPD3DXVECTOR3 pObjectCenter, - FLOAT *pObjectRadius - ); - - -//---------------------------------------------------------------------------- -// D3DXCreateKeyframedAnimationSet: -// -------------------------------- -// This function creates a compressable keyframed animations set interface. -// -// Parameters: -// pName -// Name of the animation set -// TicksPerSecond -// Number of keyframe ticks that elapse per second -// Playback -// Playback mode of keyframe looping -// NumAnimations -// Number of SRT animations -// NumCallbackKeys -// Number of callback keys -// pCallbackKeys -// Array of callback keys -// ppAnimationSet -// Returns the animation set interface -// -//----------------------------------------------------------------------------- -HRESULT WINAPI -D3DXCreateKeyframedAnimationSet - ( - LPCSTR pName, - DOUBLE TicksPerSecond, - D3DXPLAYBACK_TYPE Playback, - UINT NumAnimations, - UINT NumCallbackKeys, - CONST D3DXKEY_CALLBACK *pCallbackKeys, - LPD3DXKEYFRAMEDANIMATIONSET *ppAnimationSet - ); - - -//---------------------------------------------------------------------------- -// D3DXCreateCompressedAnimationSet: -// -------------------------------- -// This function creates a compressed animations set interface from -// compressed data. -// -// Parameters: -// pName -// Name of the animation set -// TicksPerSecond -// Number of keyframe ticks that elapse per second -// Playback -// Playback mode of keyframe looping -// pCompressedData -// Compressed animation SRT data -// NumCallbackKeys -// Number of callback keys -// pCallbackKeys -// Array of callback keys -// ppAnimationSet -// Returns the animation set interface -// -//----------------------------------------------------------------------------- -HRESULT WINAPI -D3DXCreateCompressedAnimationSet - ( - LPCSTR pName, - DOUBLE TicksPerSecond, - D3DXPLAYBACK_TYPE Playback, - LPD3DXBUFFER pCompressedData, - UINT NumCallbackKeys, - CONST D3DXKEY_CALLBACK *pCallbackKeys, - LPD3DXCOMPRESSEDANIMATIONSET *ppAnimationSet - ); - - -//---------------------------------------------------------------------------- -// D3DXCreateAnimationController: -// ------------------------------ -// This function creates an animation controller object. -// -// Parameters: -// MaxNumMatrices -// Maximum number of matrices that can be animated -// MaxNumAnimationSets -// Maximum number of animation sets that can be played -// MaxNumTracks -// Maximum number of animation sets that can be blended -// MaxNumEvents -// Maximum number of outstanding events that can be scheduled at any given time -// ppAnimController -// Returns the animation controller interface -// -//----------------------------------------------------------------------------- -HRESULT WINAPI -D3DXCreateAnimationController - ( - UINT MaxNumMatrices, - UINT MaxNumAnimationSets, - UINT MaxNumTracks, - UINT MaxNumEvents, - LPD3DXANIMATIONCONTROLLER *ppAnimController - ); - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX9ANIM_H__ - - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9core.h b/jan/src/dep/mingw/include/directx9/d3dx9core.h deleted file mode 100644 index 77f46ec12..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9core.h +++ /dev/null @@ -1,754 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9core.h -// Content: D3DX core types and functions -// -/////////////////////////////////////////////////////////////////////////// - -#include "d3dx9.h" - -#ifndef __D3DX9CORE_H__ -#define __D3DX9CORE_H__ - - -/////////////////////////////////////////////////////////////////////////// -// D3DX_SDK_VERSION: -// ----------------- -// This identifier is passed to D3DXCheckVersion in order to ensure that an -// application was built against the correct header files and lib files. -// This number is incremented whenever a header (or other) change would -// require applications to be rebuilt. If the version doesn't match, -// D3DXCheckVersion will return FALSE. (The number itself has no meaning.) -/////////////////////////////////////////////////////////////////////////// - -#define D3DX_VERSION 0x0902 - -#define D3DX_SDK_VERSION 43 - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -BOOL WINAPI - D3DXCheckVersion(UINT D3DSdkVersion, UINT D3DXSdkVersion); - -#ifdef __cplusplus -} -#endif //__cplusplus - - - -/////////////////////////////////////////////////////////////////////////// -// D3DXDebugMute -// Mutes D3DX and D3D debug spew (TRUE - mute, FALSE - not mute) -// -// returns previous mute value -// -/////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -BOOL WINAPI - D3DXDebugMute(BOOL Mute); - -#ifdef __cplusplus -} -#endif //__cplusplus - - -/////////////////////////////////////////////////////////////////////////// -// D3DXGetDriverLevel: -// Returns driver version information: -// -// 700 - DX7 level driver -// 800 - DX8 level driver -// 900 - DX9 level driver -/////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -UINT WINAPI - D3DXGetDriverLevel(LPDIRECT3DDEVICE9 pDevice); - -#ifdef __cplusplus -} -#endif //__cplusplus - - -/////////////////////////////////////////////////////////////////////////// -// ID3DXBuffer: -// ------------ -// The buffer object is used by D3DX to return arbitrary size data. -// -// GetBufferPointer - -// Returns a pointer to the beginning of the buffer. -// -// GetBufferSize - -// Returns the size of the buffer, in bytes. -/////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXBuffer ID3DXBuffer; -typedef interface ID3DXBuffer *LPD3DXBUFFER; - -// {8BA5FB08-5195-40e2-AC58-0D989C3A0102} -DEFINE_GUID(IID_ID3DXBuffer, -0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); - -#undef INTERFACE -#define INTERFACE ID3DXBuffer - -DECLARE_INTERFACE_(ID3DXBuffer, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXBuffer - STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; - STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; -}; - - - -////////////////////////////////////////////////////////////////////////////// -// D3DXSPRITE flags: -// ----------------- -// D3DXSPRITE_DONOTSAVESTATE -// Specifies device state is not to be saved and restored in Begin/End. -// D3DXSPRITE_DONOTMODIFY_RENDERSTATE -// Specifies device render state is not to be changed in Begin. The device -// is assumed to be in a valid state to draw vertices containing POSITION0, -// TEXCOORD0, and COLOR0 data. -// D3DXSPRITE_OBJECTSPACE -// The WORLD, VIEW, and PROJECTION transforms are NOT modified. The -// transforms currently set to the device are used to transform the sprites -// when the batch is drawn (at Flush or End). If this is not specified, -// WORLD, VIEW, and PROJECTION transforms are modified so that sprites are -// drawn in screenspace coordinates. -// D3DXSPRITE_BILLBOARD -// Rotates each sprite about its center so that it is facing the viewer. -// D3DXSPRITE_ALPHABLEND -// Enables ALPHABLEND(SRCALPHA, INVSRCALPHA) and ALPHATEST(alpha > 0). -// ID3DXFont expects this to be set when drawing text. -// D3DXSPRITE_SORT_TEXTURE -// Sprites are sorted by texture prior to drawing. This is recommended when -// drawing non-overlapping sprites of uniform depth. For example, drawing -// screen-aligned text with ID3DXFont. -// D3DXSPRITE_SORT_DEPTH_FRONTTOBACK -// Sprites are sorted by depth front-to-back prior to drawing. This is -// recommended when drawing opaque sprites of varying depths. -// D3DXSPRITE_SORT_DEPTH_BACKTOFRONT -// Sprites are sorted by depth back-to-front prior to drawing. This is -// recommended when drawing transparent sprites of varying depths. -// D3DXSPRITE_DO_NOT_ADDREF_TEXTURE -// Disables calling AddRef() on every draw, and Release() on Flush() for -// better performance. -////////////////////////////////////////////////////////////////////////////// - -#define D3DXSPRITE_DONOTSAVESTATE (1 << 0) -#define D3DXSPRITE_DONOTMODIFY_RENDERSTATE (1 << 1) -#define D3DXSPRITE_OBJECTSPACE (1 << 2) -#define D3DXSPRITE_BILLBOARD (1 << 3) -#define D3DXSPRITE_ALPHABLEND (1 << 4) -#define D3DXSPRITE_SORT_TEXTURE (1 << 5) -#define D3DXSPRITE_SORT_DEPTH_FRONTTOBACK (1 << 6) -#define D3DXSPRITE_SORT_DEPTH_BACKTOFRONT (1 << 7) -#define D3DXSPRITE_DO_NOT_ADDREF_TEXTURE (1 << 8) - - -////////////////////////////////////////////////////////////////////////////// -// ID3DXSprite: -// ------------ -// This object intends to provide an easy way to drawing sprites using D3D. -// -// Begin - -// Prepares device for drawing sprites. -// -// Draw - -// Draws a sprite. Before transformation, the sprite is the size of -// SrcRect, with its top-left corner specified by Position. The color -// and alpha channels are modulated by Color. -// -// Flush - -// Forces all batched sprites to submitted to the device. -// -// End - -// Restores device state to how it was when Begin was called. -// -// OnLostDevice, OnResetDevice - -// Call OnLostDevice() on this object before calling Reset() on the -// device, so that this object can release any stateblocks and video -// memory resources. After Reset(), the call OnResetDevice(). -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXSprite ID3DXSprite; -typedef interface ID3DXSprite *LPD3DXSPRITE; - - -// {BA0B762D-7D28-43ec-B9DC-2F84443B0614} -DEFINE_GUID(IID_ID3DXSprite, -0xba0b762d, 0x7d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14); - - -#undef INTERFACE -#define INTERFACE ID3DXSprite - -DECLARE_INTERFACE_(ID3DXSprite, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXSprite - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - - STDMETHOD(GetTransform)(THIS_ D3DXMATRIX *pTransform) PURE; - STDMETHOD(SetTransform)(THIS_ CONST D3DXMATRIX *pTransform) PURE; - - STDMETHOD(SetWorldViewRH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE; - STDMETHOD(SetWorldViewLH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE; - - STDMETHOD(Begin)(THIS_ DWORD Flags) PURE; - STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE9 pTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR3 *pCenter, CONST D3DXVECTOR3 *pPosition, D3DCOLOR Color) PURE; - STDMETHOD(Flush)(THIS) PURE; - STDMETHOD(End)(THIS) PURE; - - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; -}; - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -HRESULT WINAPI - D3DXCreateSprite( - LPDIRECT3DDEVICE9 pDevice, - LPD3DXSPRITE* ppSprite); - -#ifdef __cplusplus -} -#endif //__cplusplus - - - -////////////////////////////////////////////////////////////////////////////// -// ID3DXFont: -// ---------- -// Font objects contain the textures and resources needed to render a specific -// font on a specific device. -// -// GetGlyphData - -// Returns glyph cache data, for a given glyph. -// -// PreloadCharacters/PreloadGlyphs/PreloadText - -// Preloads glyphs into the glyph cache textures. -// -// DrawText - -// Draws formatted text on a D3D device. Some parameters are -// surprisingly similar to those of GDI's DrawText function. See GDI -// documentation for a detailed description of these parameters. -// If pSprite is NULL, an internal sprite object will be used. -// -// OnLostDevice, OnResetDevice - -// Call OnLostDevice() on this object before calling Reset() on the -// device, so that this object can release any stateblocks and video -// memory resources. After Reset(), the call OnResetDevice(). -////////////////////////////////////////////////////////////////////////////// - -typedef struct _D3DXFONT_DESCA -{ - INT Height; - UINT Width; - UINT Weight; - UINT MipLevels; - BOOL Italic; - BYTE CharSet; - BYTE OutputPrecision; - BYTE Quality; - BYTE PitchAndFamily; - CHAR FaceName[LF_FACESIZE]; - -} D3DXFONT_DESCA, *LPD3DXFONT_DESCA; - -typedef struct _D3DXFONT_DESCW -{ - INT Height; - UINT Width; - UINT Weight; - UINT MipLevels; - BOOL Italic; - BYTE CharSet; - BYTE OutputPrecision; - BYTE Quality; - BYTE PitchAndFamily; - WCHAR FaceName[LF_FACESIZE]; - -} D3DXFONT_DESCW, *LPD3DXFONT_DESCW; - -#ifdef UNICODE -typedef D3DXFONT_DESCW D3DXFONT_DESC; -typedef LPD3DXFONT_DESCW LPD3DXFONT_DESC; -#else -typedef D3DXFONT_DESCA D3DXFONT_DESC; -typedef LPD3DXFONT_DESCA LPD3DXFONT_DESC; -#endif - - -typedef interface ID3DXFont ID3DXFont; -typedef interface ID3DXFont *LPD3DXFONT; - - -// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC} -DEFINE_GUID(IID_ID3DXFont, -0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc); - - -#undef INTERFACE -#define INTERFACE ID3DXFont - -DECLARE_INTERFACE_(ID3DXFont, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXFont - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE; - STDMETHOD(GetDescA)(THIS_ D3DXFONT_DESCA *pDesc) PURE; - STDMETHOD(GetDescW)(THIS_ D3DXFONT_DESCW *pDesc) PURE; - STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE; - STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE; - - STDMETHOD_(HDC, GetDC)(THIS) PURE; - STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, LPDIRECT3DTEXTURE9 *ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE; - - STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE; - STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE; - STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE; - STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE; - - STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DXSPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE; - STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DXSPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE; - - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; - -#ifdef __cplusplus -#ifdef UNICODE - HRESULT GetDesc(D3DXFONT_DESCW *pDesc) { return GetDescW(pDesc); } - HRESULT PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); } -#else - HRESULT GetDesc(D3DXFONT_DESCA *pDesc) { return GetDescA(pDesc); } - HRESULT PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); } -#endif -#endif //__cplusplus -}; - -#ifndef GetTextMetrics -#ifdef UNICODE -#define GetTextMetrics GetTextMetricsW -#else -#define GetTextMetrics GetTextMetricsA -#endif -#endif - -#ifndef DrawText -#ifdef UNICODE -#define DrawText DrawTextW -#else -#define DrawText DrawTextA -#endif -#endif - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -HRESULT WINAPI - D3DXCreateFontA( - LPDIRECT3DDEVICE9 pDevice, - INT Height, - UINT Width, - UINT Weight, - UINT MipLevels, - BOOL Italic, - DWORD CharSet, - DWORD OutputPrecision, - DWORD Quality, - DWORD PitchAndFamily, - LPCSTR pFaceName, - LPD3DXFONT* ppFont); - -HRESULT WINAPI - D3DXCreateFontW( - LPDIRECT3DDEVICE9 pDevice, - INT Height, - UINT Width, - UINT Weight, - UINT MipLevels, - BOOL Italic, - DWORD CharSet, - DWORD OutputPrecision, - DWORD Quality, - DWORD PitchAndFamily, - LPCWSTR pFaceName, - LPD3DXFONT* ppFont); - -#ifdef UNICODE -#define D3DXCreateFont D3DXCreateFontW -#else -#define D3DXCreateFont D3DXCreateFontA -#endif - - -HRESULT WINAPI - D3DXCreateFontIndirectA( - LPDIRECT3DDEVICE9 pDevice, - CONST D3DXFONT_DESCA* pDesc, - LPD3DXFONT* ppFont); - -HRESULT WINAPI - D3DXCreateFontIndirectW( - LPDIRECT3DDEVICE9 pDevice, - CONST D3DXFONT_DESCW* pDesc, - LPD3DXFONT* ppFont); - -#ifdef UNICODE -#define D3DXCreateFontIndirect D3DXCreateFontIndirectW -#else -#define D3DXCreateFontIndirect D3DXCreateFontIndirectA -#endif - - -#ifdef __cplusplus -} -#endif //__cplusplus - - - -/////////////////////////////////////////////////////////////////////////// -// ID3DXRenderToSurface: -// --------------------- -// This object abstracts rendering to surfaces. These surfaces do not -// necessarily need to be render targets. If they are not, a compatible -// render target is used, and the result copied into surface at end scene. -// -// BeginScene, EndScene - -// Call BeginScene() and EndScene() at the beginning and ending of your -// scene. These calls will setup and restore render targets, viewports, -// etc.. -// -// OnLostDevice, OnResetDevice - -// Call OnLostDevice() on this object before calling Reset() on the -// device, so that this object can release any stateblocks and video -// memory resources. After Reset(), the call OnResetDevice(). -/////////////////////////////////////////////////////////////////////////// - -typedef struct _D3DXRTS_DESC -{ - UINT Width; - UINT Height; - D3DFORMAT Format; - BOOL DepthStencil; - D3DFORMAT DepthStencilFormat; - -} D3DXRTS_DESC, *LPD3DXRTS_DESC; - - -typedef interface ID3DXRenderToSurface ID3DXRenderToSurface; -typedef interface ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE; - - -// {6985F346-2C3D-43b3-BE8B-DAAE8A03D894} -DEFINE_GUID(IID_ID3DXRenderToSurface, -0x6985f346, 0x2c3d, 0x43b3, 0xbe, 0x8b, 0xda, 0xae, 0x8a, 0x3, 0xd8, 0x94); - - -#undef INTERFACE -#define INTERFACE ID3DXRenderToSurface - -DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXRenderToSurface - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE; - - STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE9 pSurface, CONST D3DVIEWPORT9* pViewport) PURE; - STDMETHOD(EndScene)(THIS_ DWORD MipFilter) PURE; - - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; -}; - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -HRESULT WINAPI - D3DXCreateRenderToSurface( - LPDIRECT3DDEVICE9 pDevice, - UINT Width, - UINT Height, - D3DFORMAT Format, - BOOL DepthStencil, - D3DFORMAT DepthStencilFormat, - LPD3DXRENDERTOSURFACE* ppRenderToSurface); - -#ifdef __cplusplus -} -#endif //__cplusplus - - - -/////////////////////////////////////////////////////////////////////////// -// ID3DXRenderToEnvMap: -// -------------------- -// This object abstracts rendering to environment maps. These surfaces -// do not necessarily need to be render targets. If they are not, a -// compatible render target is used, and the result copied into the -// environment map at end scene. -// -// BeginCube, BeginSphere, BeginHemisphere, BeginParabolic - -// This function initiates the rendering of the environment map. As -// parameters, you pass the textures in which will get filled in with -// the resulting environment map. -// -// Face - -// Call this function to initiate the drawing of each face. For each -// environment map, you will call this six times.. once for each face -// in D3DCUBEMAP_FACES. -// -// End - -// This will restore all render targets, and if needed compose all the -// rendered faces into the environment map surfaces. -// -// OnLostDevice, OnResetDevice - -// Call OnLostDevice() on this object before calling Reset() on the -// device, so that this object can release any stateblocks and video -// memory resources. After Reset(), the call OnResetDevice(). -/////////////////////////////////////////////////////////////////////////// - -typedef struct _D3DXRTE_DESC -{ - UINT Size; - UINT MipLevels; - D3DFORMAT Format; - BOOL DepthStencil; - D3DFORMAT DepthStencilFormat; - -} D3DXRTE_DESC, *LPD3DXRTE_DESC; - - -typedef interface ID3DXRenderToEnvMap ID3DXRenderToEnvMap; -typedef interface ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap; - - -// {313F1B4B-C7B0-4fa2-9D9D-8D380B64385E} -DEFINE_GUID(IID_ID3DXRenderToEnvMap, -0x313f1b4b, 0xc7b0, 0x4fa2, 0x9d, 0x9d, 0x8d, 0x38, 0xb, 0x64, 0x38, 0x5e); - - -#undef INTERFACE -#define INTERFACE ID3DXRenderToEnvMap - -DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXRenderToEnvMap - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC* pDesc) PURE; - - STDMETHOD(BeginCube)(THIS_ - LPDIRECT3DCUBETEXTURE9 pCubeTex) PURE; - - STDMETHOD(BeginSphere)(THIS_ - LPDIRECT3DTEXTURE9 pTex) PURE; - - STDMETHOD(BeginHemisphere)(THIS_ - LPDIRECT3DTEXTURE9 pTexZPos, - LPDIRECT3DTEXTURE9 pTexZNeg) PURE; - - STDMETHOD(BeginParabolic)(THIS_ - LPDIRECT3DTEXTURE9 pTexZPos, - LPDIRECT3DTEXTURE9 pTexZNeg) PURE; - - STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES Face, DWORD MipFilter) PURE; - STDMETHOD(End)(THIS_ DWORD MipFilter) PURE; - - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; -}; - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -HRESULT WINAPI - D3DXCreateRenderToEnvMap( - LPDIRECT3DDEVICE9 pDevice, - UINT Size, - UINT MipLevels, - D3DFORMAT Format, - BOOL DepthStencil, - D3DFORMAT DepthStencilFormat, - LPD3DXRenderToEnvMap* ppRenderToEnvMap); - -#ifdef __cplusplus -} -#endif //__cplusplus - - - -/////////////////////////////////////////////////////////////////////////// -// ID3DXLine: -// ------------ -// This object intends to provide an easy way to draw lines using D3D. -// -// Begin - -// Prepares device for drawing lines -// -// Draw - -// Draws a line strip in screen-space. -// Input is in the form of a array defining points on the line strip. of D3DXVECTOR2 -// -// DrawTransform - -// Draws a line in screen-space with a specified input transformation matrix. -// -// End - -// Restores device state to how it was when Begin was called. -// -// SetPattern - -// Applies a stipple pattern to the line. Input is one 32-bit -// DWORD which describes the stipple pattern. 1 is opaque, 0 is -// transparent. -// -// SetPatternScale - -// Stretches the stipple pattern in the u direction. Input is one -// floating-point value. 0.0f is no scaling, whereas 1.0f doubles -// the length of the stipple pattern. -// -// SetWidth - -// Specifies the thickness of the line in the v direction. Input is -// one floating-point value. -// -// SetAntialias - -// Toggles line antialiasing. Input is a BOOL. -// TRUE = Antialiasing on. -// FALSE = Antialiasing off. -// -// SetGLLines - -// Toggles non-antialiased OpenGL line emulation. Input is a BOOL. -// TRUE = OpenGL line emulation on. -// FALSE = OpenGL line emulation off. -// -// OpenGL line: Regular line: -/* -// .\ .\ -// | \ / \ -// | \ .\ \ -// .\ \ \ \ -// \ \ \ \ -// \ . \ . -// \ | \ / -// \| . -// . -*/ -// OnLostDevice, OnResetDevice - -// Call OnLostDevice() on this object before calling Reset() on the -// device, so that this object can release any stateblocks and video -// memory resources. After Reset(), the call OnResetDevice(). -/////////////////////////////////////////////////////////////////////////// - - -typedef interface ID3DXLine ID3DXLine; -typedef interface ID3DXLine *LPD3DXLINE; - - -// {D379BA7F-9042-4ac4-9F5E-58192A4C6BD8} -DEFINE_GUID(IID_ID3DXLine, -0xd379ba7f, 0x9042, 0x4ac4, 0x9f, 0x5e, 0x58, 0x19, 0x2a, 0x4c, 0x6b, 0xd8); - -#undef INTERFACE -#define INTERFACE ID3DXLine - -DECLARE_INTERFACE_(ID3DXLine, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXLine - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - - STDMETHOD(Begin)(THIS) PURE; - - STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *pVertexList, - DWORD dwVertexListCount, D3DCOLOR Color) PURE; - - STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *pVertexList, - DWORD dwVertexListCount, CONST D3DXMATRIX* pTransform, - D3DCOLOR Color) PURE; - - STDMETHOD(SetPattern)(THIS_ DWORD dwPattern) PURE; - STDMETHOD_(DWORD, GetPattern)(THIS) PURE; - - STDMETHOD(SetPatternScale)(THIS_ FLOAT fPatternScale) PURE; - STDMETHOD_(FLOAT, GetPatternScale)(THIS) PURE; - - STDMETHOD(SetWidth)(THIS_ FLOAT fWidth) PURE; - STDMETHOD_(FLOAT, GetWidth)(THIS) PURE; - - STDMETHOD(SetAntialias)(THIS_ BOOL bAntialias) PURE; - STDMETHOD_(BOOL, GetAntialias)(THIS) PURE; - - STDMETHOD(SetGLLines)(THIS_ BOOL bGLLines) PURE; - STDMETHOD_(BOOL, GetGLLines)(THIS) PURE; - - STDMETHOD(End)(THIS) PURE; - - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; -}; - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -HRESULT WINAPI - D3DXCreateLine( - LPDIRECT3DDEVICE9 pDevice, - LPD3DXLINE* ppLine); - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX9CORE_H__ - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9effect.h b/jan/src/dep/mingw/include/directx9/d3dx9effect.h deleted file mode 100644 index a3bcd307c..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9effect.h +++ /dev/null @@ -1,873 +0,0 @@ - -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// File: d3dx9effect.h -// Content: D3DX effect types and Shaders -// -////////////////////////////////////////////////////////////////////////////// - -#include "d3dx9.h" - -#ifndef __D3DX9EFFECT_H__ -#define __D3DX9EFFECT_H__ - - -//---------------------------------------------------------------------------- -// D3DXFX_DONOTSAVESTATE -// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag -// is specified, device state is not saved or restored in Begin/End. -// D3DXFX_DONOTSAVESHADERSTATE -// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag -// is specified, shader device state is not saved or restored in Begin/End. -// This includes pixel/vertex shaders and shader constants -// D3DXFX_DONOTSAVESAMPLERSTATE -// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag -// is specified, sampler device state is not saved or restored in Begin/End. -// D3DXFX_NOT_CLONEABLE -// This flag is used as a parameter to the D3DXCreateEffect family of APIs. -// When this flag is specified, the effect will be non-cloneable and will not -// contain any shader binary data. -// Furthermore, GetPassDesc will not return shader function pointers. -// Setting this flag reduces effect memory usage by about 50%. -//---------------------------------------------------------------------------- - -#define D3DXFX_DONOTSAVESTATE (1 << 0) -#define D3DXFX_DONOTSAVESHADERSTATE (1 << 1) -#define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2) - -#define D3DXFX_NOT_CLONEABLE (1 << 11) -#define D3DXFX_LARGEADDRESSAWARE (1 << 17) - -//---------------------------------------------------------------------------- -// D3DX_PARAMETER_SHARED -// Indicates that the value of a parameter will be shared with all effects -// which share the same namespace. Changing the value in one effect will -// change it in all. -// -// D3DX_PARAMETER_LITERAL -// Indicates that the value of this parameter can be treated as literal. -// Literal parameters can be marked when the effect is compiled, and their -// cannot be changed after the effect is compiled. Shared parameters cannot -// be literal. -//---------------------------------------------------------------------------- - -#define D3DX_PARAMETER_SHARED (1 << 0) -#define D3DX_PARAMETER_LITERAL (1 << 1) -#define D3DX_PARAMETER_ANNOTATION (1 << 2) - -//---------------------------------------------------------------------------- -// D3DXEFFECT_DESC: -//---------------------------------------------------------------------------- - -typedef struct _D3DXEFFECT_DESC -{ - LPCSTR Creator; // Creator string - UINT Parameters; // Number of parameters - UINT Techniques; // Number of techniques - UINT Functions; // Number of function entrypoints - -} D3DXEFFECT_DESC; - - -//---------------------------------------------------------------------------- -// D3DXPARAMETER_DESC: -//---------------------------------------------------------------------------- - -typedef struct _D3DXPARAMETER_DESC -{ - LPCSTR Name; // Parameter name - LPCSTR Semantic; // Parameter semantic - D3DXPARAMETER_CLASS Class; // Class - D3DXPARAMETER_TYPE Type; // Component type - UINT Rows; // Number of rows - UINT Columns; // Number of columns - UINT Elements; // Number of array elements - UINT Annotations; // Number of annotations - UINT StructMembers; // Number of structure member sub-parameters - DWORD Flags; // D3DX_PARAMETER_* flags - UINT Bytes; // Parameter size, in bytes - -} D3DXPARAMETER_DESC; - - -//---------------------------------------------------------------------------- -// D3DXTECHNIQUE_DESC: -//---------------------------------------------------------------------------- - -typedef struct _D3DXTECHNIQUE_DESC -{ - LPCSTR Name; // Technique name - UINT Passes; // Number of passes - UINT Annotations; // Number of annotations - -} D3DXTECHNIQUE_DESC; - - -//---------------------------------------------------------------------------- -// D3DXPASS_DESC: -//---------------------------------------------------------------------------- - -typedef struct _D3DXPASS_DESC -{ - LPCSTR Name; // Pass name - UINT Annotations; // Number of annotations - - CONST DWORD *pVertexShaderFunction; // Vertex shader function - CONST DWORD *pPixelShaderFunction; // Pixel shader function - -} D3DXPASS_DESC; - - -//---------------------------------------------------------------------------- -// D3DXFUNCTION_DESC: -//---------------------------------------------------------------------------- - -typedef struct _D3DXFUNCTION_DESC -{ - LPCSTR Name; // Function name - UINT Annotations; // Number of annotations - -} D3DXFUNCTION_DESC; - - - -////////////////////////////////////////////////////////////////////////////// -// ID3DXEffectPool /////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXEffectPool ID3DXEffectPool; -typedef interface ID3DXEffectPool *LPD3DXEFFECTPOOL; - -// {9537AB04-3250-412e-8213-FCD2F8677933} -DEFINE_GUID(IID_ID3DXEffectPool, -0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33); - - -#undef INTERFACE -#define INTERFACE ID3DXEffectPool - -DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // No public methods -}; - - -////////////////////////////////////////////////////////////////////////////// -// ID3DXBaseEffect /////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXBaseEffect ID3DXBaseEffect; -typedef interface ID3DXBaseEffect *LPD3DXBASEEFFECT; - -// {017C18AC-103F-4417-8C51-6BF6EF1E56BE} -DEFINE_GUID(IID_ID3DXBaseEffect, -0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe); - - -#undef INTERFACE -#define INTERFACE ID3DXBaseEffect - -DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Descs - STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; - STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE; - STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; - STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE; - STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE; - - // Handle operations - STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE; - - // Get/Set Parameters - STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE; - STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE; - STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE; - STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE; - STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE; - STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE; - STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE; - STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE; - STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE; - STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE; - STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE; - STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE; - STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE; - STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE; - STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE; - STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE; - STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE; - STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE; - STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE; - STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; - STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; - STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; - STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; - STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; - - //Set Range of an Array to pass to device - //Useful for sending only a subrange of an array down to the device - STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE; - -}; - - -//---------------------------------------------------------------------------- -// ID3DXEffectStateManager: -// ------------------------ -// This is a user implemented interface that can be used to manage device -// state changes made by an Effect. -//---------------------------------------------------------------------------- - -typedef interface ID3DXEffectStateManager ID3DXEffectStateManager; -typedef interface ID3DXEffectStateManager *LPD3DXEFFECTSTATEMANAGER; - -// {79AAB587-6DBC-4fa7-82DE-37FA1781C5CE} -DEFINE_GUID(IID_ID3DXEffectStateManager, -0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, 0x37, 0xfa, 0x17, 0x81, 0xc5, 0xce); - -#undef INTERFACE -#define INTERFACE ID3DXEffectStateManager - -DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown) -{ - // The user must correctly implement QueryInterface, AddRef, and Release. - - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // The following methods are called by the Effect when it wants to make - // the corresponding device call. Note that: - // 1. Users manage the state and are therefore responsible for making the - // the corresponding device calls themselves inside their callbacks. - // 2. Effects pay attention to the return values of the callbacks, and so - // users must pay attention to what they return in their callbacks. - - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix) PURE; - STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9 *pMaterial) PURE; - STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9 *pLight) PURE; - STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE; - STDMETHOD(SetTexture)(THIS_ DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture) PURE; - STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE; - STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE; - STDMETHOD(SetNPatchMode)(THIS_ FLOAT NumSegments) PURE; - STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; - STDMETHOD(SetVertexShader)(THIS_ LPDIRECT3DVERTEXSHADER9 pShader) PURE; - STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE; - STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE; - STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE; - STDMETHOD(SetPixelShader)(THIS_ LPDIRECT3DPIXELSHADER9 pShader) PURE; - STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE; - STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE; - STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE; -}; - - -////////////////////////////////////////////////////////////////////////////// -// ID3DXEffect /////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXEffect ID3DXEffect; -typedef interface ID3DXEffect *LPD3DXEFFECT; - -// {F6CEB4B3-4E4C-40dd-B883-8D8DE5EA0CD5} -DEFINE_GUID(IID_ID3DXEffect, -0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5); - -#undef INTERFACE -#define INTERFACE ID3DXEffect - -DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect) -{ - // ID3DXBaseEffect - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Descs - STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; - STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE; - STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; - STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE; - STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE; - - // Handle operations - STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE; - - // Get/Set Parameters - STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE; - STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE; - STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE; - STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE; - STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE; - STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE; - STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE; - STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE; - STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE; - STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE; - STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE; - STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE; - STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE; - STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE; - STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE; - STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE; - STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE; - STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE; - STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE; - STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; - STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; - STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; - STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; - STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; - - //Set Range of an Array to pass to device - //Usefull for sending only a subrange of an array down to the device - STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE; - // ID3DXBaseEffect - - - // Pool - STDMETHOD(GetPool)(THIS_ LPD3DXEFFECTPOOL* ppPool) PURE; - - // Selecting and setting a technique - STDMETHOD(SetTechnique)(THIS_ D3DXHANDLE hTechnique) PURE; - STDMETHOD_(D3DXHANDLE, GetCurrentTechnique)(THIS) PURE; - STDMETHOD(ValidateTechnique)(THIS_ D3DXHANDLE hTechnique) PURE; - STDMETHOD(FindNextValidTechnique)(THIS_ D3DXHANDLE hTechnique, D3DXHANDLE *pTechnique) PURE; - STDMETHOD_(BOOL, IsParameterUsed)(THIS_ D3DXHANDLE hParameter, D3DXHANDLE hTechnique) PURE; - - // Using current technique - // Begin starts active technique - // BeginPass begins a pass - // CommitChanges updates changes to any set calls in the pass. This should be called before - // any DrawPrimitive call to d3d - // EndPass ends a pass - // End ends active technique - STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE; - STDMETHOD(BeginPass)(THIS_ UINT Pass) PURE; - STDMETHOD(CommitChanges)(THIS) PURE; - STDMETHOD(EndPass)(THIS) PURE; - STDMETHOD(End)(THIS) PURE; - - // Managing D3D Device - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; - - // Logging device calls - STDMETHOD(SetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER pManager) PURE; - STDMETHOD(GetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER *ppManager) PURE; - - // Parameter blocks - STDMETHOD(BeginParameterBlock)(THIS) PURE; - STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE; - STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE; - STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE; - - // Cloning - STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE9 pDevice, LPD3DXEFFECT* ppEffect) PURE; - - // Fast path for setting variables directly in ID3DXEffect - STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT ByteOffset, UINT Bytes) PURE; -}; - - -////////////////////////////////////////////////////////////////////////////// -// ID3DXEffectCompiler /////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXEffectCompiler ID3DXEffectCompiler; -typedef interface ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER; - -// {51B8A949-1A31-47e6-BEA0-4B30DB53F1E0} -DEFINE_GUID(IID_ID3DXEffectCompiler, -0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0); - - -#undef INTERFACE -#define INTERFACE ID3DXEffectCompiler - -DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect) -{ - // ID3DXBaseEffect - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Descs - STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; - STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE; - STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; - STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE; - STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE; - - // Handle operations - STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE; - - // Get/Set Parameters - STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE; - STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE; - STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE; - STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE; - STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE; - STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE; - STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE; - STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE; - STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE; - STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE; - STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE; - STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE; - STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE; - STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE; - STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE; - STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE; - STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE; - STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE; - STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE; - STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; - STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; - STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; - STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; - STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; - - //Set Range of an Array to pass to device - //Usefull for sending only a subrange of an array down to the device - STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE; - // ID3DXBaseEffect - - // Parameter sharing, specialization, and information - STDMETHOD(SetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL Literal) PURE; - STDMETHOD(GetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL *pLiteral) PURE; - - // Compilation - STDMETHOD(CompileEffect)(THIS_ DWORD Flags, - LPD3DXBUFFER* ppEffect, LPD3DXBUFFER* ppErrorMsgs) PURE; - - STDMETHOD(CompileShader)(THIS_ D3DXHANDLE hFunction, LPCSTR pTarget, DWORD Flags, - LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable) PURE; -}; - - -////////////////////////////////////////////////////////////////////////////// -// APIs ////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -//---------------------------------------------------------------------------- -// D3DXCreateEffectPool: -// --------------------- -// Creates an effect pool. Pools are used for sharing parameters between -// multiple effects. For all effects within a pool, shared parameters of the -// same name all share the same value. -// -// Parameters: -// ppPool -// Returns the created pool. -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCreateEffectPool( - LPD3DXEFFECTPOOL* ppPool); - - -//---------------------------------------------------------------------------- -// D3DXCreateEffect: -// ----------------- -// Creates an effect from an ascii or binary effect description. -// -// Parameters: -// pDevice -// Pointer of the device on which to create the effect -// pSrcFile -// Name of the file containing the effect description -// hSrcModule -// Module handle. if NULL, current module will be used. -// pSrcResource -// Resource name in module -// pSrcData -// Pointer to effect description -// SrcDataSize -// Size of the effect description in bytes -// pDefines -// Optional NULL-terminated array of preprocessor macro definitions. -// Flags -// See D3DXSHADER_xxx flags. -// pSkipConstants -// A list of semi-colon delimited variable names. The effect will -// not set these variables to the device when they are referenced -// by a shader. NOTE: the variables specified here must be -// register bound in the file and must not be used in expressions -// in passes or samplers or the file will not load. -// pInclude -// Optional interface pointer to use for handling #include directives. -// If this parameter is NULL, #includes will be honored when compiling -// from file, and will error when compiling from resource or memory. -// pPool -// Pointer to ID3DXEffectPool object to use for shared parameters. -// If NULL, no parameters will be shared. -// ppEffect -// Returns a buffer containing created effect. -// ppCompilationErrors -// Returns a buffer containing any error messages which occurred during -// compile. Or NULL if you do not care about the error messages. -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCreateEffectFromFileA( - LPDIRECT3DDEVICE9 pDevice, - LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -HRESULT WINAPI - D3DXCreateEffectFromFileW( - LPDIRECT3DDEVICE9 pDevice, - LPCWSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -#ifdef UNICODE -#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW -#else -#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA -#endif - - -HRESULT WINAPI - D3DXCreateEffectFromResourceA( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -HRESULT WINAPI - D3DXCreateEffectFromResourceW( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -#ifdef UNICODE -#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW -#else -#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA -#endif - - -HRESULT WINAPI - D3DXCreateEffect( - LPDIRECT3DDEVICE9 pDevice, - LPCVOID pSrcData, - UINT SrcDataLen, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -// -// Ex functions that accept pSkipConstants in addition to other parameters -// - -HRESULT WINAPI - D3DXCreateEffectFromFileExA( - LPDIRECT3DDEVICE9 pDevice, - LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pSkipConstants, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -HRESULT WINAPI - D3DXCreateEffectFromFileExW( - LPDIRECT3DDEVICE9 pDevice, - LPCWSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pSkipConstants, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -#ifdef UNICODE -#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExW -#else -#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExA -#endif - - -HRESULT WINAPI - D3DXCreateEffectFromResourceExA( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pSkipConstants, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -HRESULT WINAPI - D3DXCreateEffectFromResourceExW( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pSkipConstants, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -#ifdef UNICODE -#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExW -#else -#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExA -#endif - - -HRESULT WINAPI - D3DXCreateEffectEx( - LPDIRECT3DDEVICE9 pDevice, - LPCVOID pSrcData, - UINT SrcDataLen, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pSkipConstants, - DWORD Flags, - LPD3DXEFFECTPOOL pPool, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -//---------------------------------------------------------------------------- -// D3DXCreateEffectCompiler: -// ------------------------- -// Creates an effect from an ascii or binary effect description. -// -// Parameters: -// pSrcFile -// Name of the file containing the effect description -// hSrcModule -// Module handle. if NULL, current module will be used. -// pSrcResource -// Resource name in module -// pSrcData -// Pointer to effect description -// SrcDataSize -// Size of the effect description in bytes -// pDefines -// Optional NULL-terminated array of preprocessor macro definitions. -// pInclude -// Optional interface pointer to use for handling #include directives. -// If this parameter is NULL, #includes will be honored when compiling -// from file, and will error when compiling from resource or memory. -// pPool -// Pointer to ID3DXEffectPool object to use for shared parameters. -// If NULL, no parameters will be shared. -// ppCompiler -// Returns a buffer containing created effect compiler. -// ppParseErrors -// Returns a buffer containing any error messages which occurred during -// parse. Or NULL if you do not care about the error messages. -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCreateEffectCompilerFromFileA( - LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTCOMPILER* ppCompiler, - LPD3DXBUFFER* ppParseErrors); - -HRESULT WINAPI - D3DXCreateEffectCompilerFromFileW( - LPCWSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTCOMPILER* ppCompiler, - LPD3DXBUFFER* ppParseErrors); - -#ifdef UNICODE -#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileW -#else -#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileA -#endif - - -HRESULT WINAPI - D3DXCreateEffectCompilerFromResourceA( - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTCOMPILER* ppCompiler, - LPD3DXBUFFER* ppParseErrors); - -HRESULT WINAPI - D3DXCreateEffectCompilerFromResourceW( - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTCOMPILER* ppCompiler, - LPD3DXBUFFER* ppParseErrors); - -#ifdef UNICODE -#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceW -#else -#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceA -#endif - - -HRESULT WINAPI - D3DXCreateEffectCompiler( - LPCSTR pSrcData, - UINT SrcDataLen, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXEFFECTCOMPILER* ppCompiler, - LPD3DXBUFFER* ppParseErrors); - -//---------------------------------------------------------------------------- -// D3DXDisassembleEffect: -// ----------------------- -// -// Parameters: -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXDisassembleEffect( - LPD3DXEFFECT pEffect, - BOOL EnableColorCode, - LPD3DXBUFFER *ppDisassembly); - - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX9EFFECT_H__ - - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9math.h b/jan/src/dep/mingw/include/directx9/d3dx9math.h deleted file mode 100644 index 862061364..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9math.h +++ /dev/null @@ -1,1798 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9math.h -// Content: D3DX math types and functions -// -////////////////////////////////////////////////////////////////////////////// - -#include "d3dx9.h" - -#ifndef __D3DX9MATH_H__ -#define __D3DX9MATH_H__ - -#include -//#if _MSC_VER >= 1200 -//#pragma warning(push) -//#endif -//#pragma warning(disable:4201) // anonymous unions warning - -#if __GNUC__ >= 4 -#pragma GCC diagnostic ignored "-Wshadow" -#endif - -//=========================================================================== -// -// General purpose utilities -// -//=========================================================================== -#define D3DX_PI ((FLOAT) 3.141592654f) -#define D3DX_1BYPI ((FLOAT) 0.318309886f) - -#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f)) -#define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI)) - - - -//=========================================================================== -// -// 16 bit floating point numbers -// -//=========================================================================== - -#define D3DX_16F_DIG 3 // # of decimal digits of precision -#define D3DX_16F_EPSILON 4.8875809e-4f // smallest such that 1.0 + epsilon != 1.0 -#define D3DX_16F_MANT_DIG 11 // # of bits in mantissa -#define D3DX_16F_MAX 6.550400e+004 // max value -#define D3DX_16F_MAX_10_EXP 4 // max decimal exponent -#define D3DX_16F_MAX_EXP 15 // max binary exponent -#define D3DX_16F_MIN 6.1035156e-5f // min positive value -#define D3DX_16F_MIN_10_EXP (-4) // min decimal exponent -#define D3DX_16F_MIN_EXP (-14) // min binary exponent -#define D3DX_16F_RADIX 2 // exponent radix -#define D3DX_16F_ROUNDS 1 // addition rounding: near - - -typedef struct D3DXFLOAT16 -{ -#ifdef __cplusplus -public: - D3DXFLOAT16() {}; - D3DXFLOAT16( FLOAT ); - D3DXFLOAT16( CONST D3DXFLOAT16& ); - - // casting - operator FLOAT (); - - // binary operators - BOOL operator == ( CONST D3DXFLOAT16& ) const; - BOOL operator != ( CONST D3DXFLOAT16& ) const; - -protected: -#endif //__cplusplus - WORD value; -} D3DXFLOAT16, *LPD3DXFLOAT16; - - - -//=========================================================================== -// -// Vectors -// -//=========================================================================== - - -//-------------------------- -// 2D Vector -//-------------------------- -typedef struct D3DXVECTOR2 -{ -#ifdef __cplusplus -public: - D3DXVECTOR2() {}; - D3DXVECTOR2( CONST FLOAT * ); - D3DXVECTOR2( CONST D3DXFLOAT16 * ); - D3DXVECTOR2( FLOAT x, FLOAT y ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXVECTOR2& operator += ( CONST D3DXVECTOR2& ); - D3DXVECTOR2& operator -= ( CONST D3DXVECTOR2& ); - D3DXVECTOR2& operator *= ( FLOAT ); - D3DXVECTOR2& operator /= ( FLOAT ); - - // unary operators - D3DXVECTOR2 operator + () const; - D3DXVECTOR2 operator - () const; - - // binary operators - D3DXVECTOR2 operator + ( CONST D3DXVECTOR2& ) const; - D3DXVECTOR2 operator - ( CONST D3DXVECTOR2& ) const; - D3DXVECTOR2 operator * ( FLOAT ) const; - D3DXVECTOR2 operator / ( FLOAT ) const; - - friend D3DXVECTOR2 operator * ( FLOAT, CONST D3DXVECTOR2& ); - - BOOL operator == ( CONST D3DXVECTOR2& ) const; - BOOL operator != ( CONST D3DXVECTOR2& ) const; - - -public: -#endif //__cplusplus - FLOAT x, y; -} D3DXVECTOR2, *LPD3DXVECTOR2; - - - -//-------------------------- -// 2D Vector (16 bit) -//-------------------------- - -typedef struct D3DXVECTOR2_16F -{ -#ifdef __cplusplus -public: - D3DXVECTOR2_16F() {}; - D3DXVECTOR2_16F( CONST FLOAT * ); - D3DXVECTOR2_16F( CONST D3DXFLOAT16 * ); - D3DXVECTOR2_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y ); - - // casting - operator D3DXFLOAT16* (); - operator CONST D3DXFLOAT16* () const; - - // binary operators - BOOL operator == ( CONST D3DXVECTOR2_16F& ) const; - BOOL operator != ( CONST D3DXVECTOR2_16F& ) const; - -public: -#endif //__cplusplus - D3DXFLOAT16 x, y; - -} D3DXVECTOR2_16F, *LPD3DXVECTOR2_16F; - - - -//-------------------------- -// 3D Vector -//-------------------------- -#ifdef __cplusplus -typedef struct D3DXVECTOR3 : public D3DVECTOR -{ -public: - D3DXVECTOR3() {}; - D3DXVECTOR3( CONST FLOAT * ); - D3DXVECTOR3( CONST D3DVECTOR& ); - D3DXVECTOR3( CONST D3DXFLOAT16 * ); - D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& ); - D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& ); - D3DXVECTOR3& operator *= ( FLOAT ); - D3DXVECTOR3& operator /= ( FLOAT ); - - // unary operators - D3DXVECTOR3 operator + () const; - D3DXVECTOR3 operator - () const; - - // binary operators - D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const; - D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const; - D3DXVECTOR3 operator * ( FLOAT ) const; - D3DXVECTOR3 operator / ( FLOAT ) const; - - friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& ); - - BOOL operator == ( CONST D3DXVECTOR3& ) const; - BOOL operator != ( CONST D3DXVECTOR3& ) const; - -} D3DXVECTOR3, *LPD3DXVECTOR3; - -#else //!__cplusplus -typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3; -#endif //!__cplusplus - - - -//-------------------------- -// 3D Vector (16 bit) -//-------------------------- -typedef struct D3DXVECTOR3_16F -{ -#ifdef __cplusplus -public: - D3DXVECTOR3_16F() {}; - D3DXVECTOR3_16F( CONST FLOAT * ); - D3DXVECTOR3_16F( CONST D3DVECTOR& ); - D3DXVECTOR3_16F( CONST D3DXFLOAT16 * ); - D3DXVECTOR3_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y, CONST D3DXFLOAT16 &z ); - - // casting - operator D3DXFLOAT16* (); - operator CONST D3DXFLOAT16* () const; - - // binary operators - BOOL operator == ( CONST D3DXVECTOR3_16F& ) const; - BOOL operator != ( CONST D3DXVECTOR3_16F& ) const; - -public: -#endif //__cplusplus - D3DXFLOAT16 x, y, z; - -} D3DXVECTOR3_16F, *LPD3DXVECTOR3_16F; - - - -//-------------------------- -// 4D Vector -//-------------------------- -typedef struct D3DXVECTOR4 -{ -#ifdef __cplusplus -public: - D3DXVECTOR4() {}; - D3DXVECTOR4( CONST FLOAT* ); - D3DXVECTOR4( CONST D3DXFLOAT16* ); - D3DXVECTOR4( CONST D3DVECTOR& xyz, FLOAT w ); - D3DXVECTOR4( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXVECTOR4& operator += ( CONST D3DXVECTOR4& ); - D3DXVECTOR4& operator -= ( CONST D3DXVECTOR4& ); - D3DXVECTOR4& operator *= ( FLOAT ); - D3DXVECTOR4& operator /= ( FLOAT ); - - // unary operators - D3DXVECTOR4 operator + () const; - D3DXVECTOR4 operator - () const; - - // binary operators - D3DXVECTOR4 operator + ( CONST D3DXVECTOR4& ) const; - D3DXVECTOR4 operator - ( CONST D3DXVECTOR4& ) const; - D3DXVECTOR4 operator * ( FLOAT ) const; - D3DXVECTOR4 operator / ( FLOAT ) const; - - friend D3DXVECTOR4 operator * ( FLOAT, CONST D3DXVECTOR4& ); - - BOOL operator == ( CONST D3DXVECTOR4& ) const; - BOOL operator != ( CONST D3DXVECTOR4& ) const; - -public: -#endif //__cplusplus - FLOAT x, y, z, w; -} D3DXVECTOR4, *LPD3DXVECTOR4; - - -//-------------------------- -// 4D Vector (16 bit) -//-------------------------- -typedef struct D3DXVECTOR4_16F -{ -#ifdef __cplusplus -public: - D3DXVECTOR4_16F() {}; - D3DXVECTOR4_16F( CONST FLOAT * ); - D3DXVECTOR4_16F( CONST D3DXFLOAT16* ); - D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& xyz, CONST D3DXFLOAT16& w ); - D3DXVECTOR4_16F( CONST D3DXFLOAT16& x, CONST D3DXFLOAT16& y, CONST D3DXFLOAT16& z, CONST D3DXFLOAT16& w ); - - // casting - operator D3DXFLOAT16* (); - operator CONST D3DXFLOAT16* () const; - - // binary operators - BOOL operator == ( CONST D3DXVECTOR4_16F& ) const; - BOOL operator != ( CONST D3DXVECTOR4_16F& ) const; - -public: -#endif //__cplusplus - D3DXFLOAT16 x, y, z, w; - -} D3DXVECTOR4_16F, *LPD3DXVECTOR4_16F; - - - -//=========================================================================== -// -// Matrices -// -//=========================================================================== -#ifdef __cplusplus -typedef struct D3DXMATRIX : public D3DMATRIX -{ -public: - D3DXMATRIX() {}; - D3DXMATRIX( CONST FLOAT * ); - D3DXMATRIX( CONST D3DMATRIX& ); - D3DXMATRIX( CONST D3DXFLOAT16 * ); - D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, - FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, - FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, - FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); - - - // access grants - FLOAT& operator () ( UINT Row, UINT Col ); - FLOAT operator () ( UINT Row, UINT Col ) const; - - // casting operators - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXMATRIX& operator *= ( CONST D3DXMATRIX& ); - D3DXMATRIX& operator += ( CONST D3DXMATRIX& ); - D3DXMATRIX& operator -= ( CONST D3DXMATRIX& ); - D3DXMATRIX& operator *= ( FLOAT ); - D3DXMATRIX& operator /= ( FLOAT ); - - // unary operators - D3DXMATRIX operator + () const; - D3DXMATRIX operator - () const; - - // binary operators - D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const; - D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const; - D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const; - D3DXMATRIX operator * ( FLOAT ) const; - D3DXMATRIX operator / ( FLOAT ) const; - - friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& ); - - BOOL operator == ( CONST D3DXMATRIX& ) const; - BOOL operator != ( CONST D3DXMATRIX& ) const; - -} D3DXMATRIX, *LPD3DXMATRIX; - -#else //!__cplusplus -typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; -#endif //!__cplusplus - - -//--------------------------------------------------------------------------- -// Aligned Matrices -// -// This class helps keep matrices 16-byte aligned as preferred by P4 cpus. -// It aligns matrices on the stack and on the heap or in global scope. -// It does this using __declspec(align(16)) which works on VC7 and on VC 6 -// with the processor pack. Unfortunately there is no way to detect the -// latter so this is turned on only on VC7. On other compilers this is the -// the same as D3DXMATRIX. -// -// Using this class on a compiler that does not actually do the alignment -// can be dangerous since it will not expose bugs that ignore alignment. -// E.g if an object of this class in inside a struct or class, and some code -// memcopys data in it assuming tight packing. This could break on a compiler -// that eventually start aligning the matrix. -//--------------------------------------------------------------------------- -#ifdef __cplusplus -typedef struct _D3DXMATRIXA16 : public D3DXMATRIX -{ - _D3DXMATRIXA16() {} - _D3DXMATRIXA16( CONST FLOAT * ); - _D3DXMATRIXA16( CONST D3DMATRIX& ); - _D3DXMATRIXA16( CONST D3DXFLOAT16 * ); - _D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, - FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, - FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, - FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); - - // new operators - void* operator new ( size_t ); - void* operator new[] ( size_t ); - - // delete operators - void operator delete ( void* ); // These are NOT virtual; Do not - void operator delete[] ( void* ); // cast to D3DXMATRIX and delete. - - // assignment operators - _D3DXMATRIXA16& operator = ( CONST D3DXMATRIX& ); - -} _D3DXMATRIXA16; - -#else //!__cplusplus -typedef D3DXMATRIX _D3DXMATRIXA16; -#endif //!__cplusplus - - - -//#if _MSC_VER >= 1300 // VC7 -//#define D3DX_ALIGN16 __declspec(align(16)) -//#else -#define D3DX_ALIGN16 // Earlier compiler may not understand this, do nothing. -//#endif - -typedef D3DX_ALIGN16 _D3DXMATRIXA16 D3DXMATRIXA16, *LPD3DXMATRIXA16; - - - -//=========================================================================== -// -// Quaternions -// -//=========================================================================== -typedef struct D3DXQUATERNION -{ -#ifdef __cplusplus -public: - D3DXQUATERNION() {} - D3DXQUATERNION( CONST FLOAT * ); - D3DXQUATERNION( CONST D3DXFLOAT16 * ); - D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXQUATERNION& operator += ( CONST D3DXQUATERNION& ); - D3DXQUATERNION& operator -= ( CONST D3DXQUATERNION& ); - D3DXQUATERNION& operator *= ( CONST D3DXQUATERNION& ); - D3DXQUATERNION& operator *= ( FLOAT ); - D3DXQUATERNION& operator /= ( FLOAT ); - - // unary operators - D3DXQUATERNION operator + () const; - D3DXQUATERNION operator - () const; - - // binary operators - D3DXQUATERNION operator + ( CONST D3DXQUATERNION& ) const; - D3DXQUATERNION operator - ( CONST D3DXQUATERNION& ) const; - D3DXQUATERNION operator * ( CONST D3DXQUATERNION& ) const; - D3DXQUATERNION operator * ( FLOAT ) const; - D3DXQUATERNION operator / ( FLOAT ) const; - - friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION& ); - - BOOL operator == ( CONST D3DXQUATERNION& ) const; - BOOL operator != ( CONST D3DXQUATERNION& ) const; - -#endif //__cplusplus - FLOAT x, y, z, w; -} D3DXQUATERNION, *LPD3DXQUATERNION; - - -//=========================================================================== -// -// Planes -// -//=========================================================================== -typedef struct D3DXPLANE -{ -#ifdef __cplusplus -public: - D3DXPLANE() {} - D3DXPLANE( CONST FLOAT* ); - D3DXPLANE( CONST D3DXFLOAT16* ); - D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXPLANE& operator *= ( FLOAT ); - D3DXPLANE& operator /= ( FLOAT ); - - // unary operators - D3DXPLANE operator + () const; - D3DXPLANE operator - () const; - - // binary operators - D3DXPLANE operator * ( FLOAT ) const; - D3DXPLANE operator / ( FLOAT ) const; - - friend D3DXPLANE operator * ( FLOAT, CONST D3DXPLANE& ); - - BOOL operator == ( CONST D3DXPLANE& ) const; - BOOL operator != ( CONST D3DXPLANE& ) const; - -#endif //__cplusplus - FLOAT a, b, c, d; -} D3DXPLANE, *LPD3DXPLANE; - - -//=========================================================================== -// -// Colors -// -//=========================================================================== - -typedef struct D3DXCOLOR -{ -#ifdef __cplusplus -public: - D3DXCOLOR() {} - D3DXCOLOR( DWORD argb ); - D3DXCOLOR( CONST FLOAT * ); - D3DXCOLOR( CONST D3DXFLOAT16 * ); - D3DXCOLOR( CONST D3DCOLORVALUE& ); - D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a ); - - // casting - operator DWORD () const; - - operator FLOAT* (); - operator CONST FLOAT* () const; - - operator D3DCOLORVALUE* (); - operator CONST D3DCOLORVALUE* () const; - - operator D3DCOLORVALUE& (); - operator CONST D3DCOLORVALUE& () const; - - // assignment operators - D3DXCOLOR& operator += ( CONST D3DXCOLOR& ); - D3DXCOLOR& operator -= ( CONST D3DXCOLOR& ); - D3DXCOLOR& operator *= ( FLOAT ); - D3DXCOLOR& operator /= ( FLOAT ); - - // unary operators - D3DXCOLOR operator + () const; - D3DXCOLOR operator - () const; - - // binary operators - D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const; - D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const; - D3DXCOLOR operator * ( FLOAT ) const; - D3DXCOLOR operator / ( FLOAT ) const; - - friend D3DXCOLOR operator * ( FLOAT, CONST D3DXCOLOR& ); - - BOOL operator == ( CONST D3DXCOLOR& ) const; - BOOL operator != ( CONST D3DXCOLOR& ) const; - -#endif //__cplusplus - FLOAT r, g, b, a; -} D3DXCOLOR, *LPD3DXCOLOR; - - - -//=========================================================================== -// -// D3DX math functions: -// -// NOTE: -// * All these functions can take the same object as in and out parameters. -// -// * Out parameters are typically also returned as return values, so that -// the output of one function may be used as a parameter to another. -// -//=========================================================================== - -//-------------------------- -// Float16 -//-------------------------- - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Converts an array 32-bit floats to 16-bit floats -D3DXFLOAT16* WINAPI D3DXFloat32To16Array - ( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n ); - -// Converts an array 16-bit floats to 32-bit floats -FLOAT* WINAPI D3DXFloat16To32Array - ( FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// 2D Vector -//-------------------------- - -// inline - -FLOAT D3DXVec2Length - ( CONST D3DXVECTOR2 *pV ); - -FLOAT D3DXVec2LengthSq - ( CONST D3DXVECTOR2 *pV ); - -FLOAT D3DXVec2Dot - ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -// Z component of ((x1,y1,0) cross (x2,y2,0)) -FLOAT D3DXVec2CCW - ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -D3DXVECTOR2* D3DXVec2Add - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -D3DXVECTOR2* D3DXVec2Subtract - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -// Minimize each component. x = min(x1, x2), y = min(y1, y2) -D3DXVECTOR2* D3DXVec2Minimize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -// Maximize each component. x = max(x1, x2), y = max(y1, y2) -D3DXVECTOR2* D3DXVec2Maximize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -D3DXVECTOR2* D3DXVec2Scale - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ); - -// Linear interpolation. V1 + s(V2-V1) -D3DXVECTOR2* D3DXVec2Lerp - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, - FLOAT s ); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -D3DXVECTOR2* WINAPI D3DXVec2Normalize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV ); - -// Hermite interpolation between position V1, tangent T1 (when s == 0) -// and position V2, tangent T2 (when s == 1). -D3DXVECTOR2* WINAPI D3DXVec2Hermite - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1, - CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s ); - -// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) -D3DXVECTOR2* WINAPI D3DXVec2CatmullRom - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1, - CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s ); - -// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) -D3DXVECTOR2* WINAPI D3DXVec2BaryCentric - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, - CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g); - -// Transform (x, y, 0, 1) by matrix. -D3DXVECTOR4* WINAPI D3DXVec2Transform - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); - -// Transform (x, y, 0, 1) by matrix, project result back into w=1. -D3DXVECTOR2* WINAPI D3DXVec2TransformCoord - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); - -// Transform (x, y, 0, 0) by matrix. -D3DXVECTOR2* WINAPI D3DXVec2TransformNormal - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); - -// Transform Array (x, y, 0, 1) by matrix. -D3DXVECTOR4* WINAPI D3DXVec2TransformArray - ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n); - -// Transform Array (x, y, 0, 1) by matrix, project result back into w=1. -D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray - ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); - -// Transform Array (x, y, 0, 0) by matrix. -D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray - ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); - - - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// 3D Vector -//-------------------------- - -// inline - -FLOAT D3DXVec3Length - ( CONST D3DXVECTOR3 *pV ); - -FLOAT D3DXVec3LengthSq - ( CONST D3DXVECTOR3 *pV ); - -FLOAT D3DXVec3Dot - ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Cross - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Add - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Subtract - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... -D3DXVECTOR3* D3DXVec3Minimize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... -D3DXVECTOR3* D3DXVec3Maximize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Scale - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s); - -// Linear interpolation. V1 + s(V2-V1) -D3DXVECTOR3* D3DXVec3Lerp - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, - FLOAT s ); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -D3DXVECTOR3* WINAPI D3DXVec3Normalize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV ); - -// Hermite interpolation between position V1, tangent T1 (when s == 0) -// and position V2, tangent T2 (when s == 1). -D3DXVECTOR3* WINAPI D3DXVec3Hermite - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1, - CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s ); - -// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) -D3DXVECTOR3* WINAPI D3DXVec3CatmullRom - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1, - CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s ); - -// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) -D3DXVECTOR3* WINAPI D3DXVec3BaryCentric - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, - CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g); - -// Transform (x, y, z, 1) by matrix. -D3DXVECTOR4* WINAPI D3DXVec3Transform - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); - -// Transform (x, y, z, 1) by matrix, project result back into w=1. -D3DXVECTOR3* WINAPI D3DXVec3TransformCoord - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); - -// Transform (x, y, z, 0) by matrix. If you transforming a normal by a -// non-affine matrix, the matrix you pass to this function should be the -// transpose of the inverse of the matrix you would use to transform a coord. -D3DXVECTOR3* WINAPI D3DXVec3TransformNormal - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); - - -// Transform Array (x, y, z, 1) by matrix. -D3DXVECTOR4* WINAPI D3DXVec3TransformArray - ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); - -// Transform Array (x, y, z, 1) by matrix, project result back into w=1. -D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray - ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); - -// Transform (x, y, z, 0) by matrix. If you transforming a normal by a -// non-affine matrix, the matrix you pass to this function should be the -// transpose of the inverse of the matrix you would use to transform a coord. -D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray - ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); - -// Project vector from object space into screen space -D3DXVECTOR3* WINAPI D3DXVec3Project - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, - CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); - -// Project vector from screen space into object space -D3DXVECTOR3* WINAPI D3DXVec3Unproject - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, - CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); - -// Project vector Array from object space into screen space -D3DXVECTOR3* WINAPI D3DXVec3ProjectArray - ( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3DVIEWPORT9 *pViewport, - CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); - -// Project vector Array from screen space into object space -D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray - ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DVIEWPORT9 *pViewport, - CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); - - -#ifdef __cplusplus -} -#endif - - - -//-------------------------- -// 4D Vector -//-------------------------- - -// inline - -FLOAT D3DXVec4Length - ( CONST D3DXVECTOR4 *pV ); - -FLOAT D3DXVec4LengthSq - ( CONST D3DXVECTOR4 *pV ); - -FLOAT D3DXVec4Dot - ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ); - -D3DXVECTOR4* D3DXVec4Add - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); - -D3DXVECTOR4* D3DXVec4Subtract - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); - -// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... -D3DXVECTOR4* D3DXVec4Minimize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); - -// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... -D3DXVECTOR4* D3DXVec4Maximize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); - -D3DXVECTOR4* D3DXVec4Scale - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s); - -// Linear interpolation. V1 + s(V2-V1) -D3DXVECTOR4* D3DXVec4Lerp - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, - FLOAT s ); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Cross-product in 4 dimensions. -D3DXVECTOR4* WINAPI D3DXVec4Cross - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, - CONST D3DXVECTOR4 *pV3); - -D3DXVECTOR4* WINAPI D3DXVec4Normalize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ); - -// Hermite interpolation between position V1, tangent T1 (when s == 0) -// and position V2, tangent T2 (when s == 1). -D3DXVECTOR4* WINAPI D3DXVec4Hermite - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1, - CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s ); - -// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) -D3DXVECTOR4* WINAPI D3DXVec4CatmullRom - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1, - CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s ); - -// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) -D3DXVECTOR4* WINAPI D3DXVec4BaryCentric - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, - CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g); - -// Transform vector by matrix. -D3DXVECTOR4* WINAPI D3DXVec4Transform - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ); - -// Transform vector array by matrix. -D3DXVECTOR4* WINAPI D3DXVec4TransformArray - ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// 4D Matrix -//-------------------------- - -// inline - -D3DXMATRIX* D3DXMatrixIdentity - ( D3DXMATRIX *pOut ); - -BOOL D3DXMatrixIsIdentity - ( CONST D3DXMATRIX *pM ); - - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -FLOAT WINAPI D3DXMatrixDeterminant - ( CONST D3DXMATRIX *pM ); - -HRESULT WINAPI D3DXMatrixDecompose - ( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, - D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM ); - -D3DXMATRIX* WINAPI D3DXMatrixTranspose - ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ); - -// Matrix multiplication. The result represents the transformation M2 -// followed by the transformation M1. (Out = M1 * M2) -D3DXMATRIX* WINAPI D3DXMatrixMultiply - ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); - -// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2)) -D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose - ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); - -// Calculate inverse of matrix. Inversion my fail, in which case NULL will -// be returned. The determinant of pM is also returned it pfDeterminant -// is non-NULL. -D3DXMATRIX* WINAPI D3DXMatrixInverse - ( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ); - -// Build a matrix which scales by (sx, sy, sz) -D3DXMATRIX* WINAPI D3DXMatrixScaling - ( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz ); - -// Build a matrix which translates by (x, y, z) -D3DXMATRIX* WINAPI D3DXMatrixTranslation - ( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ); - -// Build a matrix which rotates around the X axis -D3DXMATRIX* WINAPI D3DXMatrixRotationX - ( D3DXMATRIX *pOut, FLOAT Angle ); - -// Build a matrix which rotates around the Y axis -D3DXMATRIX* WINAPI D3DXMatrixRotationY - ( D3DXMATRIX *pOut, FLOAT Angle ); - -// Build a matrix which rotates around the Z axis -D3DXMATRIX* WINAPI D3DXMatrixRotationZ - ( D3DXMATRIX *pOut, FLOAT Angle ); - -// Build a matrix which rotates around an arbitrary axis -D3DXMATRIX* WINAPI D3DXMatrixRotationAxis - ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); - -// Build a matrix from a quaternion -D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion - ( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ); - -// Yaw around the Y axis, a pitch around the X axis, -// and a roll around the Z axis. -D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll - ( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); - -// Build transformation matrix. NULL arguments are treated as identity. -// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt -D3DXMATRIX* WINAPI D3DXMatrixTransformation - ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter, - CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling, - CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, - CONST D3DXVECTOR3 *pTranslation); - -// Build 2D transformation matrix in XY plane. NULL arguments are treated as identity. -// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt -D3DXMATRIX* WINAPI D3DXMatrixTransformation2D - ( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter, - FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, - CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, - CONST D3DXVECTOR2* pTranslation); - -// Build affine transformation matrix. NULL arguments are treated as identity. -// Mout = Ms * Mrc-1 * Mr * Mrc * Mt -D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation - ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter, - CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation); - -// Build 2D affine transformation matrix in XY plane. NULL arguments are treated as identity. -// Mout = Ms * Mrc-1 * Mr * Mrc * Mt -D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D - ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, - FLOAT Rotation, CONST D3DXVECTOR2* pTranslation); - -// Build a lookat matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixLookAtRH - ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, - CONST D3DXVECTOR3 *pUp ); - -// Build a lookat matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixLookAtLH - ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, - CONST D3DXVECTOR3 *pUp ); - -// Build a perspective projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH - ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); - -// Build a perspective projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH - ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); - -// Build a perspective projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH - ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); - -// Build a perspective projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH - ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); - -// Build a perspective projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH - ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, - FLOAT zf ); - -// Build a perspective projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH - ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, - FLOAT zf ); - -// Build an ortho projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoRH - ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); - -// Build an ortho projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoLH - ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); - -// Build an ortho projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH - ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, - FLOAT zf ); - -// Build an ortho projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH - ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, - FLOAT zf ); - -// Build a matrix which flattens geometry into a plane, as if casting -// a shadow from a light. -D3DXMATRIX* WINAPI D3DXMatrixShadow - ( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight, - CONST D3DXPLANE *pPlane ); - -// Build a matrix which reflects the coordinate system about a plane -D3DXMATRIX* WINAPI D3DXMatrixReflect - ( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// Quaternion -//-------------------------- - -// inline - -FLOAT D3DXQuaternionLength - ( CONST D3DXQUATERNION *pQ ); - -// Length squared, or "norm" -FLOAT D3DXQuaternionLengthSq - ( CONST D3DXQUATERNION *pQ ); - -FLOAT D3DXQuaternionDot - ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ); - -// (0, 0, 0, 1) -D3DXQUATERNION* D3DXQuaternionIdentity - ( D3DXQUATERNION *pOut ); - -BOOL D3DXQuaternionIsIdentity - ( CONST D3DXQUATERNION *pQ ); - -// (-x, -y, -z, w) -D3DXQUATERNION* D3DXQuaternionConjugate - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Compute a quaternin's axis and angle of rotation. Expects unit quaternions. -void WINAPI D3DXQuaternionToAxisAngle - ( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle ); - -// Build a quaternion from a rotation matrix. -D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix - ( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM); - -// Rotation about arbitrary axis. -D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis - ( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); - -// Yaw around the Y axis, a pitch around the X axis, -// and a roll around the Z axis. -D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll - ( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); - -// Quaternion multiplication. The result represents the rotation Q2 -// followed by the rotation Q1. (Out = Q2 * Q1) -D3DXQUATERNION* WINAPI D3DXQuaternionMultiply - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pQ2 ); - -D3DXQUATERNION* WINAPI D3DXQuaternionNormalize - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - -// Conjugate and re-norm -D3DXQUATERNION* WINAPI D3DXQuaternionInverse - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - -// Expects unit quaternions. -// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v) -D3DXQUATERNION* WINAPI D3DXQuaternionLn - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - -// Expects pure quaternions. (w == 0) w is ignored in calculation. -// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v) -D3DXQUATERNION* WINAPI D3DXQuaternionExp - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - -// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1). -// Expects unit quaternions. -D3DXQUATERNION* WINAPI D3DXQuaternionSlerp - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pQ2, FLOAT t ); - -// Spherical quadrangle interpolation. -// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t)) -D3DXQUATERNION* WINAPI D3DXQuaternionSquad - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB, - CONST D3DXQUATERNION *pC, FLOAT t ); - -// Setup control points for spherical quadrangle interpolation -// from Q1 to Q2. The control points are chosen in such a way -// to ensure the continuity of tangents with adjacent segments. -void WINAPI D3DXQuaternionSquadSetup - ( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut, - CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 ); - -// Barycentric interpolation. -// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g)) -D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3, - FLOAT f, FLOAT g ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// Plane -//-------------------------- - -// inline - -// ax + by + cz + dw -FLOAT D3DXPlaneDot - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV); - -// ax + by + cz + d -FLOAT D3DXPlaneDotCoord - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); - -// ax + by + cz -FLOAT D3DXPlaneDotNormal - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); - -D3DXPLANE* D3DXPlaneScale - (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Normalize plane (so that |a,b,c| == 1) -D3DXPLANE* WINAPI D3DXPlaneNormalize - ( D3DXPLANE *pOut, CONST D3DXPLANE *pP); - -// Find the intersection between a plane and a line. If the line is -// parallel to the plane, NULL is returned. -D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine - ( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1, - CONST D3DXVECTOR3 *pV2); - -// Construct a plane from a point and a normal -D3DXPLANE* WINAPI D3DXPlaneFromPointNormal - ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal); - -// Construct a plane from 3 points -D3DXPLANE* WINAPI D3DXPlaneFromPoints - ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, - CONST D3DXVECTOR3 *pV3); - -// Transform a plane by a matrix. The vector (a,b,c) must be normal. -// M should be the inverse transpose of the transformation desired. -D3DXPLANE* WINAPI D3DXPlaneTransform - ( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ); - -// Transform an array of planes by a matrix. The vectors (a,b,c) must be normal. -// M should be the inverse transpose of the transformation desired. -D3DXPLANE* WINAPI D3DXPlaneTransformArray - ( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// Color -//-------------------------- - -// inline - -// (1-r, 1-g, 1-b, a) -D3DXCOLOR* D3DXColorNegative - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC); - -D3DXCOLOR* D3DXColorAdd - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); - -D3DXCOLOR* D3DXColorSubtract - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); - -D3DXCOLOR* D3DXColorScale - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); - -// (r1*r2, g1*g2, b1*b2, a1*a2) -D3DXCOLOR* D3DXColorModulate - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); - -// Linear interpolation of r,g,b, and a. C1 + s(C2-C1) -D3DXCOLOR* D3DXColorLerp - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Interpolate r,g,b between desaturated color and color. -// DesaturatedColor + s(Color - DesaturatedColor) -D3DXCOLOR* WINAPI D3DXColorAdjustSaturation - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); - -// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey) -D3DXCOLOR* WINAPI D3DXColorAdjustContrast - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c); - -#ifdef __cplusplus -} -#endif - - - - -//-------------------------- -// Misc -//-------------------------- - -#ifdef __cplusplus -extern "C" { -#endif - -// Calculate Fresnel term given the cosine of theta (likely obtained by -// taking the dot of two normals), and the refraction index of the material. -FLOAT WINAPI D3DXFresnelTerm - (FLOAT CosTheta, FLOAT RefractionIndex); - -#ifdef __cplusplus -} -#endif - - - -//=========================================================================== -// -// Matrix Stack -// -//=========================================================================== - -typedef interface ID3DXMatrixStack ID3DXMatrixStack; -typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK; - -// {C7885BA7-F990-4fe7-922D-8515E477DD85} -DEFINE_GUID(IID_ID3DXMatrixStack, -0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85); - - -#undef INTERFACE -#define INTERFACE ID3DXMatrixStack - -DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) -{ - // - // IUnknown methods - // - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // - // ID3DXMatrixStack methods - // - - // Pops the top of the stack, returns the current top - // *after* popping the top. - STDMETHOD(Pop)(THIS) PURE; - - // Pushes the stack by one, duplicating the current matrix. - STDMETHOD(Push)(THIS) PURE; - - // Loads identity in the current matrix. - STDMETHOD(LoadIdentity)(THIS) PURE; - - // Loads the given matrix into the current matrix - STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; - - // Right-Multiplies the given matrix to the current matrix. - // (transformation is about the current world origin) - STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; - - // Left-Multiplies the given matrix to the current matrix - // (transformation is about the local origin of the object) - STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE; - - // Right multiply the current matrix with the computed rotation - // matrix, counterclockwise about the given axis with the given angle. - // (rotation is about the current world origin) - STDMETHOD(RotateAxis) - (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; - - // Left multiply the current matrix with the computed rotation - // matrix, counterclockwise about the given axis with the given angle. - // (rotation is about the local origin of the object) - STDMETHOD(RotateAxisLocal) - (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; - - // Right multiply the current matrix with the computed rotation - // matrix. All angles are counterclockwise. (rotation is about the - // current world origin) - - // The rotation is composed of a yaw around the Y axis, a pitch around - // the X axis, and a roll around the Z axis. - STDMETHOD(RotateYawPitchRoll) - (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; - - // Left multiply the current matrix with the computed rotation - // matrix. All angles are counterclockwise. (rotation is about the - // local origin of the object) - - // The rotation is composed of a yaw around the Y axis, a pitch around - // the X axis, and a roll around the Z axis. - STDMETHOD(RotateYawPitchRollLocal) - (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; - - // Right multiply the current matrix with the computed scale - // matrix. (transformation is about the current world origin) - STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; - - // Left multiply the current matrix with the computed scale - // matrix. (transformation is about the local origin of the object) - STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; - - // Right multiply the current matrix with the computed translation - // matrix. (transformation is about the current world origin) - STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE; - - // Left multiply the current matrix with the computed translation - // matrix. (transformation is about the local origin of the object) - STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; - - // Obtain the current matrix at the top of the stack - STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT WINAPI - D3DXCreateMatrixStack( - DWORD Flags, - LPD3DXMATRIXSTACK* ppStack); - -#ifdef __cplusplus -} -#endif - -//=========================================================================== -// -// Spherical Harmonic Runtime Routines -// -// NOTE: -// * Most of these functions can take the same object as in and out parameters. -// The exceptions are the rotation functions. -// -// * Out parameters are typically also returned as return values, so that -// the output of one function may be used as a parameter to another. -// -//============================================================================ - - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -//============================================================================ -// -// Basic Spherical Harmonic math routines -// -//============================================================================ - -#define D3DXSH_MINORDER 2 -#define D3DXSH_MAXORDER 6 - -//============================================================================ -// -// D3DXSHEvalDirection: -// -------------------- -// Evaluates the Spherical Harmonic basis functions -// -// Parameters: -// pOut -// Output SH coefficients - basis function Ylm is stored at l*l + m+l -// This is the pointer that is returned. -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pDir -// Direction to evaluate in - assumed to be normalized -// -//============================================================================ - -FLOAT* WINAPI D3DXSHEvalDirection - ( FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir ); - -//============================================================================ -// -// D3DXSHRotate: -// -------------------- -// Rotates SH vector by a rotation matrix -// -// Parameters: -// pOut -// Output SH coefficients - basis function Ylm is stored at l*l + m+l -// This is the pointer that is returned (should not alias with pIn.) -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pMatrix -// Matrix used for rotation - rotation sub matrix should be orthogonal -// and have a unit determinant. -// pIn -// Input SH coeffs (rotated), incorect results if this is also output. -// -//============================================================================ - -FLOAT* WINAPI D3DXSHRotate - ( FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn ); - -//============================================================================ -// -// D3DXSHRotateZ: -// -------------------- -// Rotates the SH vector in the Z axis by an angle -// -// Parameters: -// pOut -// Output SH coefficients - basis function Ylm is stored at l*l + m+l -// This is the pointer that is returned (should not alias with pIn.) -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// Angle -// Angle in radians to rotate around the Z axis. -// pIn -// Input SH coeffs (rotated), incorect results if this is also output. -// -//============================================================================ - - -FLOAT* WINAPI D3DXSHRotateZ - ( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn ); - -//============================================================================ -// -// D3DXSHAdd: -// -------------------- -// Adds two SH vectors, pOut[i] = pA[i] + pB[i]; -// -// Parameters: -// pOut -// Output SH coefficients - basis function Ylm is stored at l*l + m+l -// This is the pointer that is returned. -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pA -// Input SH coeffs. -// pB -// Input SH coeffs (second vector.) -// -//============================================================================ - -FLOAT* WINAPI D3DXSHAdd - ( FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); - -//============================================================================ -// -// D3DXSHScale: -// -------------------- -// Adds two SH vectors, pOut[i] = pA[i]*Scale; -// -// Parameters: -// pOut -// Output SH coefficients - basis function Ylm is stored at l*l + m+l -// This is the pointer that is returned. -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pIn -// Input SH coeffs. -// Scale -// Scale factor. -// -//============================================================================ - -FLOAT* WINAPI D3DXSHScale - ( FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale ); - -//============================================================================ -// -// D3DXSHDot: -// -------------------- -// Computes the dot product of two SH vectors -// -// Parameters: -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pA -// Input SH coeffs. -// pB -// Second set of input SH coeffs. -// -//============================================================================ - -FLOAT WINAPI D3DXSHDot - ( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); - -//============================================================================ -// -// D3DXSHMultiply[O]: -// -------------------- -// Computes the product of two functions represented using SH (f and g), where: -// pOut[i] = int(y_i(s) * f(s) * g(s)), where y_i(s) is the ith SH basis -// function, f(s) and g(s) are SH functions (sum_i(y_i(s)*c_i)). The order O -// determines the lengths of the arrays, where there should always be O^2 -// coefficients. In general the product of two SH functions of order O generates -// and SH function of order 2*O - 1, but we truncate the result. This means -// that the product commutes (f*g == g*f) but doesn't associate -// (f*(g*h) != (f*g)*h. -// -// Parameters: -// pOut -// Output SH coefficients - basis function Ylm is stored at l*l + m+l -// This is the pointer that is returned. -// pF -// Input SH coeffs for first function. -// pG -// Second set of input SH coeffs. -// -//============================================================================ - -FLOAT* WINAPI D3DXSHMultiply2( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); -FLOAT* WINAPI D3DXSHMultiply3( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); -FLOAT* WINAPI D3DXSHMultiply4( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); -FLOAT* WINAPI D3DXSHMultiply5( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); -FLOAT* WINAPI D3DXSHMultiply6( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); - - -//============================================================================ -// -// Basic Spherical Harmonic lighting routines -// -//============================================================================ - -//============================================================================ -// -// D3DXSHEvalDirectionalLight: -// -------------------- -// Evaluates a directional light and returns spectral SH data. The output -// vector is computed so that if the intensity of R/G/B is unit the resulting -// exit radiance of a point directly under the light on a diffuse object with -// an albedo of 1 would be 1.0. This will compute 3 spectral samples, pROut -// has to be specified, while pGout and pBout are optional. -// -// Parameters: -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pDir -// Direction light is coming from (assumed to be normalized.) -// RIntensity -// Red intensity of light. -// GIntensity -// Green intensity of light. -// BIntensity -// Blue intensity of light. -// pROut -// Output SH vector for Red. -// pGOut -// Output SH vector for Green (optional.) -// pBOut -// Output SH vector for Blue (optional.) -// -//============================================================================ - -HRESULT WINAPI D3DXSHEvalDirectionalLight - ( UINT Order, CONST D3DXVECTOR3 *pDir, - FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, - FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); - -//============================================================================ -// -// D3DXSHEvalSphericalLight: -// -------------------- -// Evaluates a spherical light and returns spectral SH data. There is no -// normalization of the intensity of the light like there is for directional -// lights, care has to be taken when specifiying the intensities. This will -// compute 3 spectral samples, pROut has to be specified, while pGout and -// pBout are optional. -// -// Parameters: -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pPos -// Position of light - reciever is assumed to be at the origin. -// Radius -// Radius of the spherical light source. -// RIntensity -// Red intensity of light. -// GIntensity -// Green intensity of light. -// BIntensity -// Blue intensity of light. -// pROut -// Output SH vector for Red. -// pGOut -// Output SH vector for Green (optional.) -// pBOut -// Output SH vector for Blue (optional.) -// -//============================================================================ - -HRESULT WINAPI D3DXSHEvalSphericalLight - ( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius, - FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, - FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); - -//============================================================================ -// -// D3DXSHEvalConeLight: -// -------------------- -// Evaluates a light that is a cone of constant intensity and returns spectral -// SH data. The output vector is computed so that if the intensity of R/G/B is -// unit the resulting exit radiance of a point directly under the light oriented -// in the cone direction on a diffuse object with an albedo of 1 would be 1.0. -// This will compute 3 spectral samples, pROut has to be specified, while pGout -// and pBout are optional. -// -// Parameters: -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pDir -// Direction light is coming from (assumed to be normalized.) -// Radius -// Radius of cone in radians. -// RIntensity -// Red intensity of light. -// GIntensity -// Green intensity of light. -// BIntensity -// Blue intensity of light. -// pROut -// Output SH vector for Red. -// pGOut -// Output SH vector for Green (optional.) -// pBOut -// Output SH vector for Blue (optional.) -// -//============================================================================ - -HRESULT WINAPI D3DXSHEvalConeLight - ( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius, - FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, - FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); - -//============================================================================ -// -// D3DXSHEvalHemisphereLight: -// -------------------- -// Evaluates a light that is a linear interpolant between two colors over the -// sphere. The interpolant is linear along the axis of the two points, not -// over the surface of the sphere (ie: if the axis was (0,0,1) it is linear in -// Z, not in the azimuthal angle.) The resulting spherical lighting function -// is normalized so that a point on a perfectly diffuse surface with no -// shadowing and a normal pointed in the direction pDir would result in exit -// radiance with a value of 1 if the top color was white and the bottom color -// was black. This is a very simple model where Top represents the intensity -// of the "sky" and Bottom represents the intensity of the "ground". -// -// Parameters: -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pDir -// Axis of the hemisphere. -// Top -// Color of the upper hemisphere. -// Bottom -// Color of the lower hemisphere. -// pROut -// Output SH vector for Red. -// pGOut -// Output SH vector for Green -// pBOut -// Output SH vector for Blue -// -//============================================================================ - -HRESULT WINAPI D3DXSHEvalHemisphereLight - ( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom, - FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); - -//============================================================================ -// -// Basic Spherical Harmonic projection routines -// -//============================================================================ - -//============================================================================ -// -// D3DXSHProjectCubeMap: -// -------------------- -// Projects a function represented on a cube map into spherical harmonics. -// -// Parameters: -// Order -// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 -// pCubeMap -// CubeMap that is going to be projected into spherical harmonics -// pROut -// Output SH vector for Red. -// pGOut -// Output SH vector for Green -// pBOut -// Output SH vector for Blue -// -//============================================================================ - -HRESULT WINAPI D3DXSHProjectCubeMap - ( UINT uOrder, LPDIRECT3DCUBETEXTURE9 pCubeMap, - FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); - - -#ifdef __cplusplus -} -#endif - - -#include "d3dx9math.inl" - -//#if _MSC_VER >= 1200 -//#pragma warning(pop) -//#else -//#pragma warning(default:4201) -//#endif - -#endif // __D3DX9MATH_H__ - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9math.inl b/jan/src/dep/mingw/include/directx9/d3dx9math.inl deleted file mode 100644 index a3652ed45..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9math.inl +++ /dev/null @@ -1,2251 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9math.inl -// Content: D3DX math inline functions -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DX9MATH_INL__ -#define __D3DX9MATH_INL__ - -//=========================================================================== -// -// Inline Class Methods -// -//=========================================================================== - -#ifdef __cplusplus - -//-------------------------- -// Float16 -//-------------------------- - -D3DXINLINE -D3DXFLOAT16::D3DXFLOAT16( FLOAT f ) -{ - D3DXFloat32To16Array(this, &f, 1); -} - -D3DXINLINE -D3DXFLOAT16::D3DXFLOAT16( CONST D3DXFLOAT16& f ) -{ - value = f.value; -} - -// casting -D3DXINLINE -D3DXFLOAT16::operator FLOAT () -{ - FLOAT f; - D3DXFloat16To32Array(&f, this, 1); - return f; -} - -// binary operators -D3DXINLINE BOOL -D3DXFLOAT16::operator == ( CONST D3DXFLOAT16& f ) const -{ - return value == f.value; -} - -D3DXINLINE BOOL -D3DXFLOAT16::operator != ( CONST D3DXFLOAT16& f ) const -{ - return value != f.value; -} - - -//-------------------------- -// 2D Vector -//-------------------------- - -D3DXINLINE -D3DXVECTOR2::D3DXVECTOR2( CONST FLOAT *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; -} - -D3DXINLINE -D3DXVECTOR2::D3DXVECTOR2( CONST D3DXFLOAT16 *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat16To32Array(&x, pf, 2); -} - -D3DXINLINE -D3DXVECTOR2::D3DXVECTOR2( FLOAT fx, FLOAT fy ) -{ - x = fx; - y = fy; -} - - -// casting -D3DXINLINE -D3DXVECTOR2::operator FLOAT* () -{ - return (FLOAT *) &x; -} - -D3DXINLINE -D3DXVECTOR2::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &x; -} - - -// assignment operators -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator += ( CONST D3DXVECTOR2& v ) -{ - x += v.x; - y += v.y; - return *this; -} - -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator -= ( CONST D3DXVECTOR2& v ) -{ - x -= v.x; - y -= v.y; - return *this; -} - -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator *= ( FLOAT f ) -{ - x *= f; - y *= f; - return *this; -} - -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - x *= fInv; - y *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator - () const -{ - return D3DXVECTOR2(-x, -y); -} - - -// binary operators -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator + ( CONST D3DXVECTOR2& v ) const -{ - return D3DXVECTOR2(x + v.x, y + v.y); -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator - ( CONST D3DXVECTOR2& v ) const -{ - return D3DXVECTOR2(x - v.x, y - v.y); -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator * ( FLOAT f ) const -{ - return D3DXVECTOR2(x * f, y * f); -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXVECTOR2(x * fInv, y * fInv); -} - -D3DXINLINE D3DXVECTOR2 -operator * ( FLOAT f, CONST D3DXVECTOR2& v ) -{ - return D3DXVECTOR2(f * v.x, f * v.y); -} - -D3DXINLINE BOOL -D3DXVECTOR2::operator == ( CONST D3DXVECTOR2& v ) const -{ - return x == v.x && y == v.y; -} - -D3DXINLINE BOOL -D3DXVECTOR2::operator != ( CONST D3DXVECTOR2& v ) const -{ - return x != v.x || y != v.y; -} - - - -//-------------------------- -// 2D Vector (16 bit) -//-------------------------- - -D3DXINLINE -D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST FLOAT *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat32To16Array(&x, pf, 2); -} - -D3DXINLINE -D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - *((DWORD *) &x) = *((DWORD *) &pf[0]); -} - -D3DXINLINE -D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy ) -{ - x = fx; - y = fy; -} - - -// casting -D3DXINLINE -D3DXVECTOR2_16F::operator D3DXFLOAT16* () -{ - return (D3DXFLOAT16*) &x; -} - -D3DXINLINE -D3DXVECTOR2_16F::operator CONST D3DXFLOAT16* () const -{ - return (CONST D3DXFLOAT16*) &x; -} - - -// binary operators -D3DXINLINE BOOL -D3DXVECTOR2_16F::operator == ( CONST D3DXVECTOR2_16F &v ) const -{ - return *((DWORD *) &x) == *((DWORD *) &v.x); -} - -D3DXINLINE BOOL -D3DXVECTOR2_16F::operator != ( CONST D3DXVECTOR2_16F &v ) const -{ - return *((DWORD *) &x) != *((DWORD *) &v.x); -} - - -//-------------------------- -// 3D Vector -//-------------------------- -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( CONST FLOAT *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; - z = pf[2]; -} - -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( CONST D3DVECTOR& v ) -{ - x = v.x; - y = v.y; - z = v.z; -} - -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( CONST D3DXFLOAT16 *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat16To32Array(&x, pf, 3); -} - -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( FLOAT fx, FLOAT fy, FLOAT fz ) -{ - x = fx; - y = fy; - z = fz; -} - - -// casting -D3DXINLINE -D3DXVECTOR3::operator FLOAT* () -{ - return (FLOAT *) &x; -} - -D3DXINLINE -D3DXVECTOR3::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &x; -} - - -// assignment operators -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& v ) -{ - x += v.x; - y += v.y; - z += v.z; - return *this; -} - -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator -= ( CONST D3DXVECTOR3& v ) -{ - x -= v.x; - y -= v.y; - z -= v.z; - return *this; -} - -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator *= ( FLOAT f ) -{ - x *= f; - y *= f; - z *= f; - return *this; -} - -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - x *= fInv; - y *= fInv; - z *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator - () const -{ - return D3DXVECTOR3(-x, -y, -z); -} - - -// binary operators -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator + ( CONST D3DXVECTOR3& v ) const -{ - return D3DXVECTOR3(x + v.x, y + v.y, z + v.z); -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator - ( CONST D3DXVECTOR3& v ) const -{ - return D3DXVECTOR3(x - v.x, y - v.y, z - v.z); -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator * ( FLOAT f ) const -{ - return D3DXVECTOR3(x * f, y * f, z * f); -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXVECTOR3(x * fInv, y * fInv, z * fInv); -} - - -D3DXINLINE D3DXVECTOR3 -operator * ( FLOAT f, CONST struct D3DXVECTOR3& v ) -{ - return D3DXVECTOR3(f * v.x, f * v.y, f * v.z); -} - - -D3DXINLINE BOOL -D3DXVECTOR3::operator == ( CONST D3DXVECTOR3& v ) const -{ - return x == v.x && y == v.y && z == v.z; -} - -D3DXINLINE BOOL -D3DXVECTOR3::operator != ( CONST D3DXVECTOR3& v ) const -{ - return x != v.x || y != v.y || z != v.z; -} - - - -//-------------------------- -// 3D Vector (16 bit) -//-------------------------- - -D3DXINLINE -D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST FLOAT *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat32To16Array(&x, pf, 3); -} - -D3DXINLINE -D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DVECTOR& v ) -{ - D3DXFloat32To16Array(&x, &v.x, 1); - D3DXFloat32To16Array(&y, &v.y, 1); - D3DXFloat32To16Array(&z, &v.z, 1); -} - -D3DXINLINE -D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - *((DWORD *) &x) = *((DWORD *) &pf[0]); - *((WORD *) &z) = *((WORD *) &pf[2]); -} - -D3DXINLINE -D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz ) -{ - x = fx; - y = fy; - z = fz; -} - - -// casting -D3DXINLINE -D3DXVECTOR3_16F::operator D3DXFLOAT16* () -{ - return (D3DXFLOAT16*) &x; -} - -D3DXINLINE -D3DXVECTOR3_16F::operator CONST D3DXFLOAT16* () const -{ - return (CONST D3DXFLOAT16*) &x; -} - - -// binary operators -D3DXINLINE BOOL -D3DXVECTOR3_16F::operator == ( CONST D3DXVECTOR3_16F &v ) const -{ - return *((DWORD *) &x) == *((DWORD *) &v.x) && - *((WORD *) &z) == *((WORD *) &v.z); -} - -D3DXINLINE BOOL -D3DXVECTOR3_16F::operator != ( CONST D3DXVECTOR3_16F &v ) const -{ - return *((DWORD *) &x) != *((DWORD *) &v.x) || - *((WORD *) &z) != *((WORD *) &v.z); -} - - -//-------------------------- -// 4D Vector -//-------------------------- -D3DXINLINE -D3DXVECTOR4::D3DXVECTOR4( CONST FLOAT *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; - z = pf[2]; - w = pf[3]; -} - -D3DXINLINE -D3DXVECTOR4::D3DXVECTOR4( CONST D3DXFLOAT16 *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat16To32Array(&x, pf, 4); -} - -D3DXINLINE -D3DXVECTOR4::D3DXVECTOR4( CONST D3DVECTOR& v, FLOAT f ) -{ - x = v.x; - y = v.y; - z = v.z; - w = f; -} - -D3DXINLINE -D3DXVECTOR4::D3DXVECTOR4( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) -{ - x = fx; - y = fy; - z = fz; - w = fw; -} - - -// casting -D3DXINLINE -D3DXVECTOR4::operator FLOAT* () -{ - return (FLOAT *) &x; -} - -D3DXINLINE -D3DXVECTOR4::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &x; -} - - -// assignment operators -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator += ( CONST D3DXVECTOR4& v ) -{ - x += v.x; - y += v.y; - z += v.z; - w += v.w; - return *this; -} - -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator -= ( CONST D3DXVECTOR4& v ) -{ - x -= v.x; - y -= v.y; - z -= v.z; - w -= v.w; - return *this; -} - -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator *= ( FLOAT f ) -{ - x *= f; - y *= f; - z *= f; - w *= f; - return *this; -} - -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - x *= fInv; - y *= fInv; - z *= fInv; - w *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator - () const -{ - return D3DXVECTOR4(-x, -y, -z, -w); -} - - -// binary operators -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator + ( CONST D3DXVECTOR4& v ) const -{ - return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w); -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator - ( CONST D3DXVECTOR4& v ) const -{ - return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w); -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator * ( FLOAT f ) const -{ - return D3DXVECTOR4(x * f, y * f, z * f, w * f); -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXVECTOR4(x * fInv, y * fInv, z * fInv, w * fInv); -} - -D3DXINLINE D3DXVECTOR4 -operator * ( FLOAT f, CONST D3DXVECTOR4& v ) -{ - return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w); -} - - -D3DXINLINE BOOL -D3DXVECTOR4::operator == ( CONST D3DXVECTOR4& v ) const -{ - return x == v.x && y == v.y && z == v.z && w == v.w; -} - -D3DXINLINE BOOL -D3DXVECTOR4::operator != ( CONST D3DXVECTOR4& v ) const -{ - return x != v.x || y != v.y || z != v.z || w != v.w; -} - - - -//-------------------------- -// 4D Vector (16 bit) -//-------------------------- - -D3DXINLINE -D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST FLOAT *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat32To16Array(&x, pf, 4); -} - -D3DXINLINE -D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - *((DWORD *) &x) = *((DWORD *) &pf[0]); - *((DWORD *) &z) = *((DWORD *) &pf[2]); -} - -D3DXINLINE -D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& v, CONST D3DXFLOAT16& f ) -{ - x = v.x; - y = v.y; - z = v.z; - w = f; -} - -D3DXINLINE -D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz, CONST D3DXFLOAT16 &fw ) -{ - x = fx; - y = fy; - z = fz; - w = fw; -} - - -// casting -D3DXINLINE -D3DXVECTOR4_16F::operator D3DXFLOAT16* () -{ - return (D3DXFLOAT16*) &x; -} - -D3DXINLINE -D3DXVECTOR4_16F::operator CONST D3DXFLOAT16* () const -{ - return (CONST D3DXFLOAT16*) &x; -} - - -// binary operators -D3DXINLINE BOOL -D3DXVECTOR4_16F::operator == ( CONST D3DXVECTOR4_16F &v ) const -{ - return *((DWORD *) &x) == *((DWORD *) &v.x) && - *((DWORD *) &z) == *((DWORD *) &v.z); -} - -D3DXINLINE BOOL -D3DXVECTOR4_16F::operator != ( CONST D3DXVECTOR4_16F &v ) const -{ - return *((DWORD *) &x) != *((DWORD *) &v.x) || - *((DWORD *) &z) != *((DWORD *) &v.z); -} - - -//-------------------------- -// Matrix -//-------------------------- -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( CONST FLOAT* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - memcpy(&_11, pf, sizeof(D3DXMATRIX)); -} - -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( CONST D3DMATRIX& mat ) -{ - memcpy(&_11, &mat, sizeof(D3DXMATRIX)); -} - -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( CONST D3DXFLOAT16* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat16To32Array(&_11, pf, 16); -} - -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14, - FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24, - FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34, - FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44 ) -{ - _11 = f11; _12 = f12; _13 = f13; _14 = f14; - _21 = f21; _22 = f22; _23 = f23; _24 = f24; - _31 = f31; _32 = f32; _33 = f33; _34 = f34; - _41 = f41; _42 = f42; _43 = f43; _44 = f44; -} - - - -// access grants -D3DXINLINE FLOAT& -D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) -{ - return m[iRow][iCol]; -} - -D3DXINLINE FLOAT -D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) const -{ - return m[iRow][iCol]; -} - - -// casting operators -D3DXINLINE -D3DXMATRIX::operator FLOAT* () -{ - return (FLOAT *) &_11; -} - -D3DXINLINE -D3DXMATRIX::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &_11; -} - - -// assignment operators -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator *= ( CONST D3DXMATRIX& mat ) -{ - D3DXMatrixMultiply(this, this, &mat); - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator += ( CONST D3DXMATRIX& mat ) -{ - _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14; - _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24; - _31 += mat._31; _32 += mat._32; _33 += mat._33; _34 += mat._34; - _41 += mat._41; _42 += mat._42; _43 += mat._43; _44 += mat._44; - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator -= ( CONST D3DXMATRIX& mat ) -{ - _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14; - _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24; - _31 -= mat._31; _32 -= mat._32; _33 -= mat._33; _34 -= mat._34; - _41 -= mat._41; _42 -= mat._42; _43 -= mat._43; _44 -= mat._44; - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator *= ( FLOAT f ) -{ - _11 *= f; _12 *= f; _13 *= f; _14 *= f; - _21 *= f; _22 *= f; _23 *= f; _24 *= f; - _31 *= f; _32 *= f; _33 *= f; _34 *= f; - _41 *= f; _42 *= f; _43 *= f; _44 *= f; - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - _11 *= fInv; _12 *= fInv; _13 *= fInv; _14 *= fInv; - _21 *= fInv; _22 *= fInv; _23 *= fInv; _24 *= fInv; - _31 *= fInv; _32 *= fInv; _33 *= fInv; _34 *= fInv; - _41 *= fInv; _42 *= fInv; _43 *= fInv; _44 *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator - () const -{ - return D3DXMATRIX(-_11, -_12, -_13, -_14, - -_21, -_22, -_23, -_24, - -_31, -_32, -_33, -_34, - -_41, -_42, -_43, -_44); -} - - -// binary operators -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator * ( CONST D3DXMATRIX& mat ) const -{ - D3DXMATRIX matT; - D3DXMatrixMultiply(&matT, this, &mat); - return matT; -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator + ( CONST D3DXMATRIX& mat ) const -{ - return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14, - _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24, - _31 + mat._31, _32 + mat._32, _33 + mat._33, _34 + mat._34, - _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44); -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator - ( CONST D3DXMATRIX& mat ) const -{ - return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14, - _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24, - _31 - mat._31, _32 - mat._32, _33 - mat._33, _34 - mat._34, - _41 - mat._41, _42 - mat._42, _43 - mat._43, _44 - mat._44); -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator * ( FLOAT f ) const -{ - return D3DXMATRIX(_11 * f, _12 * f, _13 * f, _14 * f, - _21 * f, _22 * f, _23 * f, _24 * f, - _31 * f, _32 * f, _33 * f, _34 * f, - _41 * f, _42 * f, _43 * f, _44 * f); -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXMATRIX(_11 * fInv, _12 * fInv, _13 * fInv, _14 * fInv, - _21 * fInv, _22 * fInv, _23 * fInv, _24 * fInv, - _31 * fInv, _32 * fInv, _33 * fInv, _34 * fInv, - _41 * fInv, _42 * fInv, _43 * fInv, _44 * fInv); -} - - -D3DXINLINE D3DXMATRIX -operator * ( FLOAT f, CONST D3DXMATRIX& mat ) -{ - return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14, - f * mat._21, f * mat._22, f * mat._23, f * mat._24, - f * mat._31, f * mat._32, f * mat._33, f * mat._34, - f * mat._41, f * mat._42, f * mat._43, f * mat._44); -} - - -D3DXINLINE BOOL -D3DXMATRIX::operator == ( CONST D3DXMATRIX& mat ) const -{ - return 0 == memcmp(this, &mat, sizeof(D3DXMATRIX)); -} - -D3DXINLINE BOOL -D3DXMATRIX::operator != ( CONST D3DXMATRIX& mat ) const -{ - return 0 != memcmp(this, &mat, sizeof(D3DXMATRIX)); -} - - - -//-------------------------- -// Aligned Matrices -//-------------------------- - -D3DXINLINE -_D3DXMATRIXA16::_D3DXMATRIXA16( CONST FLOAT* f ) : - D3DXMATRIX( f ) -{ -} - -D3DXINLINE -_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DMATRIX& m ) : - D3DXMATRIX( m ) -{ -} - -D3DXINLINE -_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DXFLOAT16* f ) : - D3DXMATRIX( f ) -{ -} - -D3DXINLINE -_D3DXMATRIXA16::_D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, - FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, - FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, - FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ) : - D3DXMATRIX(_11, _12, _13, _14, - _21, _22, _23, _24, - _31, _32, _33, _34, - _41, _42, _43, _44) -{ -} - -#ifndef SIZE_MAX -#define SIZE_MAX ((SIZE_T)-1) -#endif - -D3DXINLINE void* -_D3DXMATRIXA16::operator new( size_t s ) -{ - if (s > (SIZE_MAX-16)) - return NULL; - LPBYTE p = ::new BYTE[s + 16]; - if (p) - { - BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); - p += offset; - p[-1] = offset; - } - return p; -} - -D3DXINLINE void* -_D3DXMATRIXA16::operator new[]( size_t s ) -{ - if (s > (SIZE_MAX-16)) - return NULL; - LPBYTE p = ::new BYTE[s + 16]; - if (p) - { - BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); - p += offset; - p[-1] = offset; - } - return p; -} - -D3DXINLINE void -_D3DXMATRIXA16::operator delete(void* p) -{ - if(p) - { - BYTE* pb = static_cast(p); - pb -= pb[-1]; - ::delete [] pb; - } -} - -D3DXINLINE void -_D3DXMATRIXA16::operator delete[](void* p) -{ - if(p) - { - BYTE* pb = static_cast(p); - pb -= pb[-1]; - ::delete [] pb; - } -} - -D3DXINLINE _D3DXMATRIXA16& -_D3DXMATRIXA16::operator=(CONST D3DXMATRIX& rhs) -{ - memcpy(&_11, &rhs, sizeof(D3DXMATRIX)); - return *this; -} - - -//-------------------------- -// Quaternion -//-------------------------- - -D3DXINLINE -D3DXQUATERNION::D3DXQUATERNION( CONST FLOAT* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; - z = pf[2]; - w = pf[3]; -} - -D3DXINLINE -D3DXQUATERNION::D3DXQUATERNION( CONST D3DXFLOAT16* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat16To32Array(&x, pf, 4); -} - -D3DXINLINE -D3DXQUATERNION::D3DXQUATERNION( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) -{ - x = fx; - y = fy; - z = fz; - w = fw; -} - - -// casting -D3DXINLINE -D3DXQUATERNION::operator FLOAT* () -{ - return (FLOAT *) &x; -} - -D3DXINLINE -D3DXQUATERNION::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &x; -} - - -// assignment operators -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator += ( CONST D3DXQUATERNION& q ) -{ - x += q.x; - y += q.y; - z += q.z; - w += q.w; - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator -= ( CONST D3DXQUATERNION& q ) -{ - x -= q.x; - y -= q.y; - z -= q.z; - w -= q.w; - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator *= ( CONST D3DXQUATERNION& q ) -{ - D3DXQuaternionMultiply(this, this, &q); - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator *= ( FLOAT f ) -{ - x *= f; - y *= f; - z *= f; - w *= f; - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - x *= fInv; - y *= fInv; - z *= fInv; - w *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator - () const -{ - return D3DXQUATERNION(-x, -y, -z, -w); -} - - -// binary operators -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator + ( CONST D3DXQUATERNION& q ) const -{ - return D3DXQUATERNION(x + q.x, y + q.y, z + q.z, w + q.w); -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator - ( CONST D3DXQUATERNION& q ) const -{ - return D3DXQUATERNION(x - q.x, y - q.y, z - q.z, w - q.w); -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator * ( CONST D3DXQUATERNION& q ) const -{ - D3DXQUATERNION qT; - D3DXQuaternionMultiply(&qT, this, &q); - return qT; -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator * ( FLOAT f ) const -{ - return D3DXQUATERNION(x * f, y * f, z * f, w * f); -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXQUATERNION(x * fInv, y * fInv, z * fInv, w * fInv); -} - - -D3DXINLINE D3DXQUATERNION -operator * (FLOAT f, CONST D3DXQUATERNION& q ) -{ - return D3DXQUATERNION(f * q.x, f * q.y, f * q.z, f * q.w); -} - - -D3DXINLINE BOOL -D3DXQUATERNION::operator == ( CONST D3DXQUATERNION& q ) const -{ - return x == q.x && y == q.y && z == q.z && w == q.w; -} - -D3DXINLINE BOOL -D3DXQUATERNION::operator != ( CONST D3DXQUATERNION& q ) const -{ - return x != q.x || y != q.y || z != q.z || w != q.w; -} - - - -//-------------------------- -// Plane -//-------------------------- - -D3DXINLINE -D3DXPLANE::D3DXPLANE( CONST FLOAT* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - a = pf[0]; - b = pf[1]; - c = pf[2]; - d = pf[3]; -} - -D3DXINLINE -D3DXPLANE::D3DXPLANE( CONST D3DXFLOAT16* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat16To32Array(&a, pf, 4); -} - -D3DXINLINE -D3DXPLANE::D3DXPLANE( FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd ) -{ - a = fa; - b = fb; - c = fc; - d = fd; -} - - -// casting -D3DXINLINE -D3DXPLANE::operator FLOAT* () -{ - return (FLOAT *) &a; -} - -D3DXINLINE -D3DXPLANE::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &a; -} - - -// assignment operators -D3DXINLINE D3DXPLANE& -D3DXPLANE::operator *= ( FLOAT f ) -{ - a *= f; - b *= f; - c *= f; - d *= f; - return *this; -} - -D3DXINLINE D3DXPLANE& -D3DXPLANE::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - a *= fInv; - b *= fInv; - c *= fInv; - d *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXPLANE -D3DXPLANE::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXPLANE -D3DXPLANE::operator - () const -{ - return D3DXPLANE(-a, -b, -c, -d); -} - - -// binary operators -D3DXINLINE D3DXPLANE -D3DXPLANE::operator * ( FLOAT f ) const -{ - return D3DXPLANE(a * f, b * f, c * f, d * f); -} - -D3DXINLINE D3DXPLANE -D3DXPLANE::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXPLANE(a * fInv, b * fInv, c * fInv, d * fInv); -} - -D3DXINLINE D3DXPLANE -operator * (FLOAT f, CONST D3DXPLANE& p ) -{ - return D3DXPLANE(f * p.a, f * p.b, f * p.c, f * p.d); -} - -D3DXINLINE BOOL -D3DXPLANE::operator == ( CONST D3DXPLANE& p ) const -{ - return a == p.a && b == p.b && c == p.c && d == p.d; -} - -D3DXINLINE BOOL -D3DXPLANE::operator != ( CONST D3DXPLANE& p ) const -{ - return a != p.a || b != p.b || c != p.c || d != p.d; -} - - - - -//-------------------------- -// Color -//-------------------------- - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( DWORD dw ) -{ - CONST FLOAT f = 1.0f / 255.0f; - r = f * (FLOAT) (unsigned char) (dw >> 16); - g = f * (FLOAT) (unsigned char) (dw >> 8); - b = f * (FLOAT) (unsigned char) (dw >> 0); - a = f * (FLOAT) (unsigned char) (dw >> 24); -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( CONST FLOAT* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - r = pf[0]; - g = pf[1]; - b = pf[2]; - a = pf[3]; -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( CONST D3DXFLOAT16* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - D3DXFloat16To32Array(&r, pf, 4); -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( CONST D3DCOLORVALUE& c ) -{ - r = c.r; - g = c.g; - b = c.b; - a = c.a; -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa ) -{ - r = fr; - g = fg; - b = fb; - a = fa; -} - - -// casting -D3DXINLINE -D3DXCOLOR::operator DWORD () const -{ - DWORD dwR = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (DWORD) (r * 255.0f + 0.5f); - DWORD dwG = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (DWORD) (g * 255.0f + 0.5f); - DWORD dwB = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (DWORD) (b * 255.0f + 0.5f); - DWORD dwA = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (DWORD) (a * 255.0f + 0.5f); - - return (dwA << 24) | (dwR << 16) | (dwG << 8) | dwB; -} - - -D3DXINLINE -D3DXCOLOR::operator FLOAT * () -{ - return (FLOAT *) &r; -} - -D3DXINLINE -D3DXCOLOR::operator CONST FLOAT * () const -{ - return (CONST FLOAT *) &r; -} - - -D3DXINLINE -D3DXCOLOR::operator D3DCOLORVALUE * () -{ - return (D3DCOLORVALUE *) &r; -} - -D3DXINLINE -D3DXCOLOR::operator CONST D3DCOLORVALUE * () const -{ - return (CONST D3DCOLORVALUE *) &r; -} - - -D3DXINLINE -D3DXCOLOR::operator D3DCOLORVALUE& () -{ - return *((D3DCOLORVALUE *) &r); -} - -D3DXINLINE -D3DXCOLOR::operator CONST D3DCOLORVALUE& () const -{ - return *((CONST D3DCOLORVALUE *) &r); -} - - -// assignment operators -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator += ( CONST D3DXCOLOR& c ) -{ - r += c.r; - g += c.g; - b += c.b; - a += c.a; - return *this; -} - -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator -= ( CONST D3DXCOLOR& c ) -{ - r -= c.r; - g -= c.g; - b -= c.b; - a -= c.a; - return *this; -} - -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator *= ( FLOAT f ) -{ - r *= f; - g *= f; - b *= f; - a *= f; - return *this; -} - -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - r *= fInv; - g *= fInv; - b *= fInv; - a *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator - () const -{ - return D3DXCOLOR(-r, -g, -b, -a); -} - - -// binary operators -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator + ( CONST D3DXCOLOR& c ) const -{ - return D3DXCOLOR(r + c.r, g + c.g, b + c.b, a + c.a); -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator - ( CONST D3DXCOLOR& c ) const -{ - return D3DXCOLOR(r - c.r, g - c.g, b - c.b, a - c.a); -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator * ( FLOAT f ) const -{ - return D3DXCOLOR(r * f, g * f, b * f, a * f); -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXCOLOR(r * fInv, g * fInv, b * fInv, a * fInv); -} - - -D3DXINLINE D3DXCOLOR -operator * (FLOAT f, CONST D3DXCOLOR& c ) -{ - return D3DXCOLOR(f * c.r, f * c.g, f * c.b, f * c.a); -} - - -D3DXINLINE BOOL -D3DXCOLOR::operator == ( CONST D3DXCOLOR& c ) const -{ - return r == c.r && g == c.g && b == c.b && a == c.a; -} - -D3DXINLINE BOOL -D3DXCOLOR::operator != ( CONST D3DXCOLOR& c ) const -{ - return r != c.r || g != c.g || b != c.b || a != c.a; -} - - -#endif //__cplusplus - - - -//=========================================================================== -// -// Inline functions -// -//=========================================================================== - - -//-------------------------- -// 2D Vector -//-------------------------- - -D3DXINLINE FLOAT D3DXVec2Length - ( CONST D3DXVECTOR2 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pV->x * pV->x + pV->y * pV->y); -#else - return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y); -#endif -} - -D3DXINLINE FLOAT D3DXVec2LengthSq - ( CONST D3DXVECTOR2 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - - return pV->x * pV->x + pV->y * pV->y; -} - -D3DXINLINE FLOAT D3DXVec2Dot - ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->x + pV1->y * pV2->y; -} - -D3DXINLINE FLOAT D3DXVec2CCW - ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->y - pV1->y * pV2->x; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Add - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + pV2->x; - pOut->y = pV1->y + pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Subtract - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x - pV2->x; - pOut->y = pV1->y - pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Minimize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Maximize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Scale - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV) - return NULL; -#endif - - pOut->x = pV->x * s; - pOut->y = pV->y * s; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Lerp - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, - FLOAT s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + s * (pV2->x - pV1->x); - pOut->y = pV1->y + s * (pV2->y - pV1->y); - return pOut; -} - - -//-------------------------- -// 3D Vector -//-------------------------- - -D3DXINLINE FLOAT D3DXVec3Length - ( CONST D3DXVECTOR3 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); -#else - return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); -#endif -} - -D3DXINLINE FLOAT D3DXVec3LengthSq - ( CONST D3DXVECTOR3 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - - return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z; -} - -D3DXINLINE FLOAT D3DXVec3Dot - ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Cross - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ - D3DXVECTOR3 v; - -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - v.x = pV1->y * pV2->z - pV1->z * pV2->y; - v.y = pV1->z * pV2->x - pV1->x * pV2->z; - v.z = pV1->x * pV2->y - pV1->y * pV2->x; - - *pOut = v; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Add - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + pV2->x; - pOut->y = pV1->y + pV2->y; - pOut->z = pV1->z + pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Subtract - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x - pV2->x; - pOut->y = pV1->y - pV2->y; - pOut->z = pV1->z - pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Minimize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Maximize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Scale - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV) - return NULL; -#endif - - pOut->x = pV->x * s; - pOut->y = pV->y * s; - pOut->z = pV->z * s; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Lerp - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, - FLOAT s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + s * (pV2->x - pV1->x); - pOut->y = pV1->y + s * (pV2->y - pV1->y); - pOut->z = pV1->z + s * (pV2->z - pV1->z); - return pOut; -} - - -//-------------------------- -// 4D Vector -//-------------------------- - -D3DXINLINE FLOAT D3DXVec4Length - ( CONST D3DXVECTOR4 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); -#else - return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); -#endif -} - -D3DXINLINE FLOAT D3DXVec4LengthSq - ( CONST D3DXVECTOR4 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - - return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w; -} - -D3DXINLINE FLOAT D3DXVec4Dot - ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z + pV1->w * pV2->w; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Add - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + pV2->x; - pOut->y = pV1->y + pV2->y; - pOut->z = pV1->z + pV2->z; - pOut->w = pV1->w + pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Subtract - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x - pV2->x; - pOut->y = pV1->y - pV2->y; - pOut->z = pV1->z - pV2->z; - pOut->w = pV1->w - pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Minimize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; - pOut->w = pV1->w < pV2->w ? pV1->w : pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Maximize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; - pOut->w = pV1->w > pV2->w ? pV1->w : pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Scale - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV) - return NULL; -#endif - - pOut->x = pV->x * s; - pOut->y = pV->y * s; - pOut->z = pV->z * s; - pOut->w = pV->w * s; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Lerp - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, - FLOAT s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + s * (pV2->x - pV1->x); - pOut->y = pV1->y + s * (pV2->y - pV1->y); - pOut->z = pV1->z + s * (pV2->z - pV1->z); - pOut->w = pV1->w + s * (pV2->w - pV1->w); - return pOut; -} - - -//-------------------------- -// 4D Matrix -//-------------------------- - -D3DXINLINE D3DXMATRIX* D3DXMatrixIdentity - ( D3DXMATRIX *pOut ) -{ -#ifdef D3DX_DEBUG - if(!pOut) - return NULL; -#endif - - pOut->m[0][1] = pOut->m[0][2] = pOut->m[0][3] = - pOut->m[1][0] = pOut->m[1][2] = pOut->m[1][3] = - pOut->m[2][0] = pOut->m[2][1] = pOut->m[2][3] = - pOut->m[3][0] = pOut->m[3][1] = pOut->m[3][2] = 0.0f; - - pOut->m[0][0] = pOut->m[1][1] = pOut->m[2][2] = pOut->m[3][3] = 1.0f; - return pOut; -} - - -D3DXINLINE BOOL D3DXMatrixIsIdentity - ( CONST D3DXMATRIX *pM ) -{ -#ifdef D3DX_DEBUG - if(!pM) - return FALSE; -#endif - - return pM->m[0][0] == 1.0f && pM->m[0][1] == 0.0f && pM->m[0][2] == 0.0f && pM->m[0][3] == 0.0f && - pM->m[1][0] == 0.0f && pM->m[1][1] == 1.0f && pM->m[1][2] == 0.0f && pM->m[1][3] == 0.0f && - pM->m[2][0] == 0.0f && pM->m[2][1] == 0.0f && pM->m[2][2] == 1.0f && pM->m[2][3] == 0.0f && - pM->m[3][0] == 0.0f && pM->m[3][1] == 0.0f && pM->m[3][2] == 0.0f && pM->m[3][3] == 1.0f; -} - - -//-------------------------- -// Quaternion -//-------------------------- - -D3DXINLINE FLOAT D3DXQuaternionLength - ( CONST D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pQ) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); -#else - return (FLOAT) sqrt(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); -#endif -} - -D3DXINLINE FLOAT D3DXQuaternionLengthSq - ( CONST D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pQ) - return 0.0f; -#endif - - return pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w; -} - -D3DXINLINE FLOAT D3DXQuaternionDot - ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ) -{ -#ifdef D3DX_DEBUG - if(!pQ1 || !pQ2) - return 0.0f; -#endif - - return pQ1->x * pQ2->x + pQ1->y * pQ2->y + pQ1->z * pQ2->z + pQ1->w * pQ2->w; -} - - -D3DXINLINE D3DXQUATERNION* D3DXQuaternionIdentity - ( D3DXQUATERNION *pOut ) -{ -#ifdef D3DX_DEBUG - if(!pOut) - return NULL; -#endif - - pOut->x = pOut->y = pOut->z = 0.0f; - pOut->w = 1.0f; - return pOut; -} - -D3DXINLINE BOOL D3DXQuaternionIsIdentity - ( CONST D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pQ) - return FALSE; -#endif - - return pQ->x == 0.0f && pQ->y == 0.0f && pQ->z == 0.0f && pQ->w == 1.0f; -} - - -D3DXINLINE D3DXQUATERNION* D3DXQuaternionConjugate - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pQ) - return NULL; -#endif - - pOut->x = -pQ->x; - pOut->y = -pQ->y; - pOut->z = -pQ->z; - pOut->w = pQ->w; - return pOut; -} - - -//-------------------------- -// Plane -//-------------------------- - -D3DXINLINE FLOAT D3DXPlaneDot - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV) -{ -#ifdef D3DX_DEBUG - if(!pP || !pV) - return 0.0f; -#endif - - return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d * pV->w; -} - -D3DXINLINE FLOAT D3DXPlaneDotCoord - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) -{ -#ifdef D3DX_DEBUG - if(!pP || !pV) - return 0.0f; -#endif - - return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d; -} - -D3DXINLINE FLOAT D3DXPlaneDotNormal - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) -{ -#ifdef D3DX_DEBUG - if(!pP || !pV) - return 0.0f; -#endif - - return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z; -} - -D3DXINLINE D3DXPLANE* D3DXPlaneScale - (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pP) - return NULL; -#endif - - pOut->a = pP->a * s; - pOut->b = pP->b * s; - pOut->c = pP->c * s; - pOut->d = pP->d * s; - return pOut; -} - - -//-------------------------- -// Color -//-------------------------- - -D3DXINLINE D3DXCOLOR* D3DXColorNegative - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC) - return NULL; -#endif - - pOut->r = 1.0f - pC->r; - pOut->g = 1.0f - pC->g; - pOut->b = 1.0f - pC->b; - pOut->a = pC->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorAdd - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r + pC2->r; - pOut->g = pC1->g + pC2->g; - pOut->b = pC1->b + pC2->b; - pOut->a = pC1->a + pC2->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorSubtract - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r - pC2->r; - pOut->g = pC1->g - pC2->g; - pOut->b = pC1->b - pC2->b; - pOut->a = pC1->a - pC2->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorScale - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC) - return NULL; -#endif - - pOut->r = pC->r * s; - pOut->g = pC->g * s; - pOut->b = pC->b * s; - pOut->a = pC->a * s; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorModulate - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r * pC2->r; - pOut->g = pC1->g * pC2->g; - pOut->b = pC1->b * pC2->b; - pOut->a = pC1->a * pC2->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorLerp - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r + s * (pC2->r - pC1->r); - pOut->g = pC1->g + s * (pC2->g - pC1->g); - pOut->b = pC1->b + s * (pC2->b - pC1->b); - pOut->a = pC1->a + s * (pC2->a - pC1->a); - return pOut; -} - - -#endif // __D3DX9MATH_INL__ - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9mesh.h b/jan/src/dep/mingw/include/directx9/d3dx9mesh.h deleted file mode 100644 index 5ecbba1b1..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9mesh.h +++ /dev/null @@ -1,3007 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9mesh.h -// Content: D3DX mesh types and functions -// -////////////////////////////////////////////////////////////////////////////// - -#include "d3dx9.h" - -#ifndef __D3DX9MESH_H__ -#define __D3DX9MESH_H__ - -// {7ED943DD-52E8-40b5-A8D8-76685C406330} -DEFINE_GUID(IID_ID3DXBaseMesh, -0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30); - -// {4020E5C2-1403-4929-883F-E2E849FAC195} -DEFINE_GUID(IID_ID3DXMesh, -0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95); - -// {8875769A-D579-4088-AAEB-534D1AD84E96} -DEFINE_GUID(IID_ID3DXPMesh, -0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96); - -// {667EA4C7-F1CD-4386-B523-7C0290B83CC5} -DEFINE_GUID(IID_ID3DXSPMesh, -0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5); - -// {11EAA540-F9A6-4d49-AE6A-E19221F70CC4} -DEFINE_GUID(IID_ID3DXSkinInfo, -0x11eaa540, 0xf9a6, 0x4d49, 0xae, 0x6a, 0xe1, 0x92, 0x21, 0xf7, 0xc, 0xc4); - -// {3CE6CC22-DBF2-44f4-894D-F9C34A337139} -DEFINE_GUID(IID_ID3DXPatchMesh, -0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39); - -//patch mesh can be quads or tris -typedef enum _D3DXPATCHMESHTYPE { - D3DXPATCHMESH_RECT = 0x001, - D3DXPATCHMESH_TRI = 0x002, - D3DXPATCHMESH_NPATCH = 0x003, - - D3DXPATCHMESH_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ -} D3DXPATCHMESHTYPE; - -// Mesh options - lower 3 bytes only, upper byte used by _D3DXMESHOPT option flags -enum _D3DXMESH { - D3DXMESH_32BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices. - D3DXMESH_DONOTCLIP = 0x002, // Use D3DUSAGE_DONOTCLIP for VB & IB. - D3DXMESH_POINTS = 0x004, // Use D3DUSAGE_POINTS for VB & IB. - D3DXMESH_RTPATCHES = 0x008, // Use D3DUSAGE_RTPATCHES for VB & IB. - D3DXMESH_NPATCHES = 0x4000,// Use D3DUSAGE_NPATCHES for VB & IB. - D3DXMESH_VB_SYSTEMMEM = 0x010, // Use D3DPOOL_SYSTEMMEM for VB. Overrides D3DXMESH_MANAGEDVERTEXBUFFER - D3DXMESH_VB_MANAGED = 0x020, // Use D3DPOOL_MANAGED for VB. - D3DXMESH_VB_WRITEONLY = 0x040, // Use D3DUSAGE_WRITEONLY for VB. - D3DXMESH_VB_DYNAMIC = 0x080, // Use D3DUSAGE_DYNAMIC for VB. - D3DXMESH_VB_SOFTWAREPROCESSING = 0x8000, // Use D3DUSAGE_SOFTWAREPROCESSING for VB. - D3DXMESH_IB_SYSTEMMEM = 0x100, // Use D3DPOOL_SYSTEMMEM for IB. Overrides D3DXMESH_MANAGEDINDEXBUFFER - D3DXMESH_IB_MANAGED = 0x200, // Use D3DPOOL_MANAGED for IB. - D3DXMESH_IB_WRITEONLY = 0x400, // Use D3DUSAGE_WRITEONLY for IB. - D3DXMESH_IB_DYNAMIC = 0x800, // Use D3DUSAGE_DYNAMIC for IB. - D3DXMESH_IB_SOFTWAREPROCESSING= 0x10000, // Use D3DUSAGE_SOFTWAREPROCESSING for IB. - - D3DXMESH_VB_SHARE = 0x1000, // Valid for Clone* calls only, forces cloned mesh/pmesh to share vertex buffer - - D3DXMESH_USEHWONLY = 0x2000, // Valid for ID3DXSkinInfo::ConvertToBlendedMesh - - // Helper options - D3DXMESH_SYSTEMMEM = 0x110, // D3DXMESH_VB_SYSTEMMEM | D3DXMESH_IB_SYSTEMMEM - D3DXMESH_MANAGED = 0x220, // D3DXMESH_VB_MANAGED | D3DXMESH_IB_MANAGED - D3DXMESH_WRITEONLY = 0x440, // D3DXMESH_VB_WRITEONLY | D3DXMESH_IB_WRITEONLY - D3DXMESH_DYNAMIC = 0x880, // D3DXMESH_VB_DYNAMIC | D3DXMESH_IB_DYNAMIC - D3DXMESH_SOFTWAREPROCESSING = 0x18000 // D3DXMESH_VB_SOFTWAREPROCESSING | D3DXMESH_IB_SOFTWAREPROCESSING - -}; - -//patch mesh options -enum _D3DXPATCHMESH { - D3DXPATCHMESH_DEFAULT = 000 -}; -// option field values for specifying min value in D3DXGeneratePMesh and D3DXSimplifyMesh -enum _D3DXMESHSIMP -{ - D3DXMESHSIMP_VERTEX = 0x1, - D3DXMESHSIMP_FACE = 0x2 - -}; - -typedef enum _D3DXCLEANTYPE { - D3DXCLEAN_BACKFACING = 0x00000001, - D3DXCLEAN_BOWTIES = 0x00000002, - - // Helper options - D3DXCLEAN_SKINNING = D3DXCLEAN_BACKFACING, // Bowtie cleaning modifies geometry and breaks skinning - D3DXCLEAN_OPTIMIZATION = D3DXCLEAN_BACKFACING, - D3DXCLEAN_SIMPLIFICATION= D3DXCLEAN_BACKFACING | D3DXCLEAN_BOWTIES -} D3DXCLEANTYPE; - -enum _MAX_FVF_DECL_SIZE -{ - MAX_FVF_DECL_SIZE = MAXD3DDECLLENGTH + 1 // +1 for END -}; - -typedef enum _D3DXTANGENT -{ - D3DXTANGENT_WRAP_U = 0x01, - D3DXTANGENT_WRAP_V = 0x02, - D3DXTANGENT_WRAP_UV = 0x03, - D3DXTANGENT_DONT_NORMALIZE_PARTIALS = 0x04, - D3DXTANGENT_DONT_ORTHOGONALIZE = 0x08, - D3DXTANGENT_ORTHOGONALIZE_FROM_V = 0x010, - D3DXTANGENT_ORTHOGONALIZE_FROM_U = 0x020, - D3DXTANGENT_WEIGHT_BY_AREA = 0x040, - D3DXTANGENT_WEIGHT_EQUAL = 0x080, - D3DXTANGENT_WIND_CW = 0x0100, - D3DXTANGENT_CALCULATE_NORMALS = 0x0200, - D3DXTANGENT_GENERATE_IN_PLACE = 0x0400 -} D3DXTANGENT; - -// D3DXIMT_WRAP_U means the texture wraps in the U direction -// D3DXIMT_WRAP_V means the texture wraps in the V direction -// D3DXIMT_WRAP_UV means the texture wraps in both directions -typedef enum _D3DXIMT -{ - D3DXIMT_WRAP_U = 0x01, - D3DXIMT_WRAP_V = 0x02, - D3DXIMT_WRAP_UV = 0x03 -} D3DXIMT; - -// These options are only valid for UVAtlasCreate and UVAtlasPartition, we may add more for UVAtlasPack if necessary -// D3DXUVATLAS_DEFAULT - Meshes with more than 25k faces go through fast, meshes with fewer than 25k faces go through quality -// D3DXUVATLAS_GEODESIC_FAST - Uses approximations to improve charting speed at the cost of added stretch or more charts. -// D3DXUVATLAS_GEODESIC_QUALITY - Provides better quality charts, but requires more time and memory than fast. -typedef enum _D3DXUVATLAS -{ - D3DXUVATLAS_DEFAULT = 0x00, - D3DXUVATLAS_GEODESIC_FAST = 0x01, - D3DXUVATLAS_GEODESIC_QUALITY = 0x02 -} D3DXUVATLAS; - -typedef struct ID3DXBaseMesh *LPD3DXBASEMESH; -typedef struct ID3DXMesh *LPD3DXMESH; -typedef struct ID3DXPMesh *LPD3DXPMESH; -typedef struct ID3DXSPMesh *LPD3DXSPMESH; -typedef struct ID3DXSkinInfo *LPD3DXSKININFO; -typedef struct ID3DXPatchMesh *LPD3DXPATCHMESH; -typedef interface ID3DXTextureGutterHelper *LPD3DXTEXTUREGUTTERHELPER; -typedef interface ID3DXPRTBuffer *LPD3DXPRTBUFFER; - - -typedef struct _D3DXATTRIBUTERANGE -{ - DWORD AttribId; - DWORD FaceStart; - DWORD FaceCount; - DWORD VertexStart; - DWORD VertexCount; -} D3DXATTRIBUTERANGE; - -typedef D3DXATTRIBUTERANGE* LPD3DXATTRIBUTERANGE; - -typedef struct _D3DXMATERIAL -{ - D3DMATERIAL9 MatD3D; - LPSTR pTextureFilename; -} D3DXMATERIAL; -typedef D3DXMATERIAL *LPD3DXMATERIAL; - -typedef enum _D3DXEFFECTDEFAULTTYPE -{ - D3DXEDT_STRING = 0x1, // pValue points to a null terminated ASCII string - D3DXEDT_FLOATS = 0x2, // pValue points to an array of floats - number of floats is NumBytes / sizeof(float) - D3DXEDT_DWORD = 0x3, // pValue points to a DWORD - - D3DXEDT_FORCEDWORD = 0x7fffffff -} D3DXEFFECTDEFAULTTYPE; - -typedef struct _D3DXEFFECTDEFAULT -{ - LPSTR pParamName; - D3DXEFFECTDEFAULTTYPE Type; // type of the data pointed to by pValue - DWORD NumBytes; // size in bytes of the data pointed to by pValue - LPVOID pValue; // data for the default of the effect -} D3DXEFFECTDEFAULT, *LPD3DXEFFECTDEFAULT; - -typedef struct _D3DXEFFECTINSTANCE -{ - LPSTR pEffectFilename; - DWORD NumDefaults; - LPD3DXEFFECTDEFAULT pDefaults; -} D3DXEFFECTINSTANCE, *LPD3DXEFFECTINSTANCE; - -typedef struct _D3DXATTRIBUTEWEIGHTS -{ - FLOAT Position; - FLOAT Boundary; - FLOAT Normal; - FLOAT Diffuse; - FLOAT Specular; - FLOAT Texcoord[8]; - FLOAT Tangent; - FLOAT Binormal; -} D3DXATTRIBUTEWEIGHTS, *LPD3DXATTRIBUTEWEIGHTS; - -enum _D3DXWELDEPSILONSFLAGS -{ - D3DXWELDEPSILONS_WELDALL = 0x1, // weld all vertices marked by adjacency as being overlapping - - D3DXWELDEPSILONS_WELDPARTIALMATCHES = 0x2, // if a given vertex component is within epsilon, modify partial matched - // vertices so that both components identical AND if all components "equal" - // remove one of the vertices - D3DXWELDEPSILONS_DONOTREMOVEVERTICES = 0x4, // instructs weld to only allow modifications to vertices and not removal - // ONLY valid if D3DXWELDEPSILONS_WELDPARTIALMATCHES is set - // useful to modify vertices to be equal, but not allow vertices to be removed - - D3DXWELDEPSILONS_DONOTSPLIT = 0x8 // instructs weld to specify the D3DXMESHOPT_DONOTSPLIT flag when doing an Optimize(ATTR_SORT) - // if this flag is not set, all vertices that are in separate attribute groups - // will remain split and not welded. Setting this flag can slow down software vertex processing - -}; - -typedef struct _D3DXWELDEPSILONS -{ - FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency - // in general, it should be the same value or greater than the one passed to GeneratedAdjacency - FLOAT BlendWeights; - FLOAT Normal; - FLOAT PSize; - FLOAT Specular; - FLOAT Diffuse; - FLOAT Texcoord[8]; - FLOAT Tangent; - FLOAT Binormal; - FLOAT TessFactor; -} D3DXWELDEPSILONS; - -typedef D3DXWELDEPSILONS* LPD3DXWELDEPSILONS; - - -#undef INTERFACE -#define INTERFACE ID3DXBaseMesh - -DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXBaseMesh - STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; - STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(CloneMesh)(THIS_ DWORD Options, - CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; - STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; - STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; - STDMETHOD(UnlockIndexBuffer)(THIS) PURE; - STDMETHOD(GetAttributeTable)( - THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; - - STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; - STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; - STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; - - STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; -}; - - -#undef INTERFACE -#define INTERFACE ID3DXMesh - -DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXBaseMesh - STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; - STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(CloneMesh)(THIS_ DWORD Options, - CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; - STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; - STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; - STDMETHOD(UnlockIndexBuffer)(THIS) PURE; - STDMETHOD(GetAttributeTable)( - THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; - - STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; - STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; - STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; - - STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; - - // ID3DXMesh - STDMETHOD(LockAttributeBuffer)(THIS_ DWORD Flags, DWORD** ppData) PURE; - STDMETHOD(UnlockAttributeBuffer)(THIS) PURE; - STDMETHOD(Optimize)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut, - DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap, - LPD3DXMESH* ppOptMesh) PURE; - STDMETHOD(OptimizeInplace)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut, - DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap) PURE; - STDMETHOD(SetAttributeTable)(THIS_ CONST D3DXATTRIBUTERANGE *pAttribTable, DWORD cAttribTableSize) PURE; -}; - - -#undef INTERFACE -#define INTERFACE ID3DXPMesh - -DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXBaseMesh - STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; - STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(CloneMesh)(THIS_ DWORD Options, - CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; - STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; - STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; - STDMETHOD(UnlockIndexBuffer)(THIS) PURE; - STDMETHOD(GetAttributeTable)( - THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; - - STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; - STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; - STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; - - STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; - - // ID3DXPMesh - STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXPMESH* ppCloneMesh) PURE; - STDMETHOD(ClonePMesh)(THIS_ DWORD Options, - CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXPMESH* ppCloneMesh) PURE; - STDMETHOD(SetNumFaces)(THIS_ DWORD Faces) PURE; - STDMETHOD(SetNumVertices)(THIS_ DWORD Vertices) PURE; - STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetMinFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetMinVertices)(THIS) PURE; - STDMETHOD(Save)(THIS_ IStream *pStream, CONST D3DXMATERIAL* pMaterials, CONST D3DXEFFECTINSTANCE* pEffectInstances, DWORD NumMaterials) PURE; - - STDMETHOD(Optimize)(THIS_ DWORD Flags, DWORD* pAdjacencyOut, - DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap, - LPD3DXMESH* ppOptMesh) PURE; - - STDMETHOD(OptimizeBaseLOD)(THIS_ DWORD Flags, DWORD* pFaceRemap) PURE; - STDMETHOD(TrimByFaces)(THIS_ DWORD NewFacesMin, DWORD NewFacesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE; - STDMETHOD(TrimByVertices)(THIS_ DWORD NewVerticesMin, DWORD NewVerticesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE; - - STDMETHOD(GetAdjacency)(THIS_ DWORD* pAdjacency) PURE; - - // Used to generate the immediate "ancestor" for each vertex when it is removed by a vsplit. Allows generation of geomorphs - // Vertex buffer must be equal to or greater than the maximum number of vertices in the pmesh - STDMETHOD(GenerateVertexHistory)(THIS_ DWORD* pVertexHistory) PURE; -}; - - -#undef INTERFACE -#define INTERFACE ID3DXSPMesh - -DECLARE_INTERFACE_(ID3DXSPMesh, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXSPMesh - STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(CloneMesh)(THIS_ DWORD Options, - CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pVertexRemapOut, FLOAT *pErrorsByFace, LPD3DXPMESH* ppCloneMesh) PURE; - STDMETHOD(ClonePMesh)(THIS_ DWORD Options, - CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pVertexRemapOut, FLOAT *pErrorsbyFace, LPD3DXPMESH* ppCloneMesh) PURE; - STDMETHOD(ReduceFaces)(THIS_ DWORD Faces) PURE; - STDMETHOD(ReduceVertices)(THIS_ DWORD Vertices) PURE; - STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE; - STDMETHOD(GetVertexAttributeWeights)(THIS_ LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights) PURE; - STDMETHOD(GetVertexWeights)(THIS_ FLOAT *pVertexWeights) PURE; -}; - -#define UNUSED16 (0xffff) -#define UNUSED32 (0xffffffff) - -// ID3DXMesh::Optimize options - upper byte only, lower 3 bytes used from _D3DXMESH option flags -enum _D3DXMESHOPT { - D3DXMESHOPT_COMPACT = 0x01000000, - D3DXMESHOPT_ATTRSORT = 0x02000000, - D3DXMESHOPT_VERTEXCACHE = 0x04000000, - D3DXMESHOPT_STRIPREORDER = 0x08000000, - D3DXMESHOPT_IGNOREVERTS = 0x10000000, // optimize faces only, don't touch vertices - D3DXMESHOPT_DONOTSPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting - D3DXMESHOPT_DEVICEINDEPENDENT = 0x00400000 // Only affects VCache. uses a static known good cache size for all cards - - // D3DXMESHOPT_SHAREVB has been removed, please use D3DXMESH_VB_SHARE instead - -}; - -// Subset of the mesh that has the same attribute and bone combination. -// This subset can be rendered in a single draw call -typedef struct _D3DXBONECOMBINATION -{ - DWORD AttribId; - DWORD FaceStart; - DWORD FaceCount; - DWORD VertexStart; - DWORD VertexCount; - DWORD* BoneId; -} D3DXBONECOMBINATION, *LPD3DXBONECOMBINATION; - -// The following types of patch combinations are supported: -// Patch type Basis Degree -// Rect Bezier 2,3,5 -// Rect B-Spline 2,3,5 -// Rect Catmull-Rom 3 -// Tri Bezier 2,3,5 -// N-Patch N/A 3 - -typedef struct _D3DXPATCHINFO -{ - D3DXPATCHMESHTYPE PatchType; - D3DDEGREETYPE Degree; - D3DBASISTYPE Basis; -} D3DXPATCHINFO, *LPD3DXPATCHINFO; - -#undef INTERFACE -#define INTERFACE ID3DXPatchMesh - -DECLARE_INTERFACE_(ID3DXPatchMesh, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXPatchMesh - - // Return creation parameters - STDMETHOD_(DWORD, GetNumPatches)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetControlVerticesPerPatch)(THIS) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE; - STDMETHOD(GetPatchInfo)(THIS_ LPD3DXPATCHINFO PatchInfo) PURE; - - // Control mesh access - STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; - STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, LPVOID *ppData) PURE; - STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, LPVOID *ppData) PURE; - STDMETHOD(UnlockIndexBuffer)(THIS) PURE; - STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** ppData) PURE; - STDMETHOD(UnlockAttributeBuffer)(THIS) PURE; - - // This function returns the size of the tessellated mesh given a tessellation level. - // This assumes uniform tessellation. For adaptive tessellation the Adaptive parameter must - // be set to TRUE and TessellationLevel should be the max tessellation. - // This will result in the max mesh size necessary for adaptive tessellation. - STDMETHOD(GetTessSize)(THIS_ FLOAT fTessLevel,DWORD Adaptive, DWORD *NumTriangles,DWORD *NumVertices) PURE; - - //GenerateAdjacency determines which patches are adjacent with provided tolerance - //this information is used internally to optimize tessellation - STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Tolerance) PURE; - - //CloneMesh Creates a new patchmesh with the specified decl, and converts the vertex buffer - //to the new decl. Entries in the new decl which are new are set to 0. If the current mesh - //has adjacency, the new mesh will also have adjacency - STDMETHOD(CloneMesh)(THIS_ DWORD Options, CONST D3DVERTEXELEMENT9 *pDecl, LPD3DXPATCHMESH *pMesh) PURE; - - // Optimizes the patchmesh for efficient tessellation. This function is designed - // to perform one time optimization for patch meshes that need to be tessellated - // repeatedly by calling the Tessellate() method. The optimization performed is - // independent of the actual tessellation level used. - // Currently Flags is unused. - // If vertices are changed, Optimize must be called again - STDMETHOD(Optimize)(THIS_ DWORD flags) PURE; - - //gets and sets displacement parameters - //displacement maps can only be 2D textures MIP-MAPPING is ignored for non adapative tessellation - STDMETHOD(SetDisplaceParam)(THIS_ LPDIRECT3DBASETEXTURE9 Texture, - D3DTEXTUREFILTERTYPE MinFilter, - D3DTEXTUREFILTERTYPE MagFilter, - D3DTEXTUREFILTERTYPE MipFilter, - D3DTEXTUREADDRESS Wrap, - DWORD dwLODBias) PURE; - - STDMETHOD(GetDisplaceParam)(THIS_ LPDIRECT3DBASETEXTURE9 *Texture, - D3DTEXTUREFILTERTYPE *MinFilter, - D3DTEXTUREFILTERTYPE *MagFilter, - D3DTEXTUREFILTERTYPE *MipFilter, - D3DTEXTUREADDRESS *Wrap, - DWORD *dwLODBias) PURE; - - // Performs the uniform tessellation based on the tessellation level. - // This function will perform more efficiently if the patch mesh has been optimized using the Optimize() call. - STDMETHOD(Tessellate)(THIS_ FLOAT fTessLevel,LPD3DXMESH pMesh) PURE; - - // Performs adaptive tessellation based on the Z based adaptive tessellation criterion. - // pTrans specifies a 4D vector that is dotted with the vertices to get the per vertex - // adaptive tessellation amount. Each edge is tessellated to the average of the criterion - // at the 2 vertices it connects. - // MaxTessLevel specifies the upper limit for adaptive tesselation. - // This function will perform more efficiently if the patch mesh has been optimized using the Optimize() call. - STDMETHOD(TessellateAdaptive)(THIS_ - CONST D3DXVECTOR4 *pTrans, - DWORD dwMaxTessLevel, - DWORD dwMinTessLevel, - LPD3DXMESH pMesh) PURE; - -}; - -#undef INTERFACE -#define INTERFACE ID3DXSkinInfo - -DECLARE_INTERFACE_(ID3DXSkinInfo, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Specify the which vertices do each bones influence and by how much - STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, DWORD numInfluences, CONST DWORD* vertices, CONST FLOAT* weights) PURE; - STDMETHOD(SetBoneVertexInfluence)(THIS_ DWORD boneNum, DWORD influenceNum, float weight) PURE; - STDMETHOD_(DWORD, GetNumBoneInfluences)(THIS_ DWORD bone) PURE; - STDMETHOD(GetBoneInfluence)(THIS_ DWORD bone, DWORD* vertices, FLOAT* weights) PURE; - STDMETHOD(GetBoneVertexInfluence)(THIS_ DWORD boneNum, DWORD influenceNum, float *pWeight, DWORD *pVertexNum) PURE; - STDMETHOD(GetMaxVertexInfluences)(THIS_ DWORD* maxVertexInfluences) PURE; - STDMETHOD_(DWORD, GetNumBones)(THIS) PURE; - STDMETHOD(FindBoneVertexInfluenceIndex)(THIS_ DWORD boneNum, DWORD vertexNum, DWORD *pInfluenceIndex) PURE; - - // This gets the max face influences based on a triangle mesh with the specified index buffer - STDMETHOD(GetMaxFaceInfluences)(THIS_ LPDIRECT3DINDEXBUFFER9 pIB, DWORD NumFaces, DWORD* maxFaceInfluences) PURE; - - // Set min bone influence. Bone influences that are smaller than this are ignored - STDMETHOD(SetMinBoneInfluence)(THIS_ FLOAT MinInfl) PURE; - // Get min bone influence. - STDMETHOD_(FLOAT, GetMinBoneInfluence)(THIS) PURE; - - // Bone names are returned by D3DXLoadSkinMeshFromXof. They are not used by any other method of this object - STDMETHOD(SetBoneName)(THIS_ DWORD Bone, LPCSTR pName) PURE; // pName is copied to an internal string buffer - STDMETHOD_(LPCSTR, GetBoneName)(THIS_ DWORD Bone) PURE; // A pointer to an internal string buffer is returned. Do not free this. - - // Bone offset matrices are returned by D3DXLoadSkinMeshFromXof. They are not used by any other method of this object - STDMETHOD(SetBoneOffsetMatrix)(THIS_ DWORD Bone, CONST D3DXMATRIX *pBoneTransform) PURE; // pBoneTransform is copied to an internal buffer - STDMETHOD_(LPD3DXMATRIX, GetBoneOffsetMatrix)(THIS_ DWORD Bone) PURE; // A pointer to an internal matrix is returned. Do not free this. - - // Clone a skin info object - STDMETHOD(Clone)(THIS_ LPD3DXSKININFO* ppSkinInfo) PURE; - - // Update bone influence information to match vertices after they are reordered. This should be called - // if the target vertex buffer has been reordered externally. - STDMETHOD(Remap)(THIS_ DWORD NumVertices, DWORD* pVertexRemap) PURE; - - // These methods enable the modification of the vertex layout of the vertices that will be skinned - STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; - STDMETHOD(SetDeclaration)(THIS_ CONST D3DVERTEXELEMENT9 *pDeclaration) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; - - // Apply SW skinning based on current pose matrices to the target vertices. - STDMETHOD(UpdateSkinnedMesh)(THIS_ - CONST D3DXMATRIX* pBoneTransforms, - CONST D3DXMATRIX* pBoneInvTransposeTransforms, - LPCVOID pVerticesSrc, - PVOID pVerticesDst) PURE; - - // Takes a mesh and returns a new mesh with per vertex blend weights and a bone combination - // table that describes which bones affect which subsets of the mesh - STDMETHOD(ConvertToBlendedMesh)(THIS_ - LPD3DXMESH pMesh, - DWORD Options, - CONST DWORD *pAdjacencyIn, - LPDWORD pAdjacencyOut, - DWORD* pFaceRemap, - LPD3DXBUFFER *ppVertexRemap, - DWORD* pMaxFaceInfl, - DWORD* pNumBoneCombinations, - LPD3DXBUFFER* ppBoneCombinationTable, - LPD3DXMESH* ppMesh) PURE; - - // Takes a mesh and returns a new mesh with per vertex blend weights and indices - // and a bone combination table that describes which bones palettes affect which subsets of the mesh - STDMETHOD(ConvertToIndexedBlendedMesh)(THIS_ - LPD3DXMESH pMesh, - DWORD Options, - DWORD paletteSize, - CONST DWORD *pAdjacencyIn, - LPDWORD pAdjacencyOut, - DWORD* pFaceRemap, - LPD3DXBUFFER *ppVertexRemap, - DWORD* pMaxVertexInfl, - DWORD* pNumBoneCombinations, - LPD3DXBUFFER* ppBoneCombinationTable, - LPD3DXMESH* ppMesh) PURE; -}; - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -HRESULT WINAPI - D3DXCreateMesh( - DWORD NumFaces, - DWORD NumVertices, - DWORD Options, - CONST D3DVERTEXELEMENT9 *pDeclaration, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXMESH* ppMesh); - -HRESULT WINAPI - D3DXCreateMeshFVF( - DWORD NumFaces, - DWORD NumVertices, - DWORD Options, - DWORD FVF, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXMESH* ppMesh); - -HRESULT WINAPI - D3DXCreateSPMesh( - LPD3DXMESH pMesh, - CONST DWORD* pAdjacency, - CONST D3DXATTRIBUTEWEIGHTS *pVertexAttributeWeights, - CONST FLOAT *pVertexWeights, - LPD3DXSPMESH* ppSMesh); - -// clean a mesh up for simplification, try to make manifold -HRESULT WINAPI - D3DXCleanMesh( - D3DXCLEANTYPE CleanType, - LPD3DXMESH pMeshIn, - CONST DWORD* pAdjacencyIn, - LPD3DXMESH* ppMeshOut, - DWORD* pAdjacencyOut, - LPD3DXBUFFER* ppErrorsAndWarnings); - -HRESULT WINAPI - D3DXValidMesh( - LPD3DXMESH pMeshIn, - CONST DWORD* pAdjacency, - LPD3DXBUFFER* ppErrorsAndWarnings); - -HRESULT WINAPI - D3DXGeneratePMesh( - LPD3DXMESH pMesh, - CONST DWORD* pAdjacency, - CONST D3DXATTRIBUTEWEIGHTS *pVertexAttributeWeights, - CONST FLOAT *pVertexWeights, - DWORD MinValue, - DWORD Options, - LPD3DXPMESH* ppPMesh); - -HRESULT WINAPI - D3DXSimplifyMesh( - LPD3DXMESH pMesh, - CONST DWORD* pAdjacency, - CONST D3DXATTRIBUTEWEIGHTS *pVertexAttributeWeights, - CONST FLOAT *pVertexWeights, - DWORD MinValue, - DWORD Options, - LPD3DXMESH* ppMesh); - -HRESULT WINAPI - D3DXComputeBoundingSphere( - CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position - DWORD NumVertices, - DWORD dwStride, // count in bytes to subsequent position vectors - D3DXVECTOR3 *pCenter, - FLOAT *pRadius); - -HRESULT WINAPI - D3DXComputeBoundingBox( - CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position - DWORD NumVertices, - DWORD dwStride, // count in bytes to subsequent position vectors - D3DXVECTOR3 *pMin, - D3DXVECTOR3 *pMax); - -HRESULT WINAPI - D3DXComputeNormals( - LPD3DXBASEMESH pMesh, - CONST DWORD *pAdjacency); - -HRESULT WINAPI - D3DXCreateBuffer( - DWORD NumBytes, - LPD3DXBUFFER *ppBuffer); - - -HRESULT WINAPI - D3DXLoadMeshFromXA( - LPCSTR pFilename, - DWORD Options, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXBUFFER *ppAdjacency, - LPD3DXBUFFER *ppMaterials, - LPD3DXBUFFER *ppEffectInstances, - DWORD *pNumMaterials, - LPD3DXMESH *ppMesh); - -HRESULT WINAPI - D3DXLoadMeshFromXW( - LPCWSTR pFilename, - DWORD Options, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXBUFFER *ppAdjacency, - LPD3DXBUFFER *ppMaterials, - LPD3DXBUFFER *ppEffectInstances, - DWORD *pNumMaterials, - LPD3DXMESH *ppMesh); - -#ifdef UNICODE -#define D3DXLoadMeshFromX D3DXLoadMeshFromXW -#else -#define D3DXLoadMeshFromX D3DXLoadMeshFromXA -#endif - -HRESULT WINAPI - D3DXLoadMeshFromXInMemory( - LPCVOID Memory, - DWORD SizeOfMemory, - DWORD Options, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXBUFFER *ppAdjacency, - LPD3DXBUFFER *ppMaterials, - LPD3DXBUFFER *ppEffectInstances, - DWORD *pNumMaterials, - LPD3DXMESH *ppMesh); - -HRESULT WINAPI - D3DXLoadMeshFromXResource( - HMODULE Module, - LPCSTR Name, - LPCSTR Type, - DWORD Options, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXBUFFER *ppAdjacency, - LPD3DXBUFFER *ppMaterials, - LPD3DXBUFFER *ppEffectInstances, - DWORD *pNumMaterials, - LPD3DXMESH *ppMesh); - -HRESULT WINAPI - D3DXSaveMeshToXA( - LPCSTR pFilename, - LPD3DXMESH pMesh, - CONST DWORD* pAdjacency, - CONST D3DXMATERIAL* pMaterials, - CONST D3DXEFFECTINSTANCE* pEffectInstances, - DWORD NumMaterials, - DWORD Format - ); - -HRESULT WINAPI - D3DXSaveMeshToXW( - LPCWSTR pFilename, - LPD3DXMESH pMesh, - CONST DWORD* pAdjacency, - CONST D3DXMATERIAL* pMaterials, - CONST D3DXEFFECTINSTANCE* pEffectInstances, - DWORD NumMaterials, - DWORD Format - ); - -#ifdef UNICODE -#define D3DXSaveMeshToX D3DXSaveMeshToXW -#else -#define D3DXSaveMeshToX D3DXSaveMeshToXA -#endif - - -HRESULT WINAPI - D3DXCreatePMeshFromStream( - IStream *pStream, - DWORD Options, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXBUFFER *ppMaterials, - LPD3DXBUFFER *ppEffectInstances, - DWORD* pNumMaterials, - LPD3DXPMESH *ppPMesh); - -// Creates a skin info object based on the number of vertices, number of bones, and a declaration describing the vertex layout of the target vertices -// The bone names and initial bone transforms are not filled in the skin info object by this method. -HRESULT WINAPI - D3DXCreateSkinInfo( - DWORD NumVertices, - CONST D3DVERTEXELEMENT9 *pDeclaration, - DWORD NumBones, - LPD3DXSKININFO* ppSkinInfo); - -// Creates a skin info object based on the number of vertices, number of bones, and a FVF describing the vertex layout of the target vertices -// The bone names and initial bone transforms are not filled in the skin info object by this method. -HRESULT WINAPI - D3DXCreateSkinInfoFVF( - DWORD NumVertices, - DWORD FVF, - DWORD NumBones, - LPD3DXSKININFO* ppSkinInfo); - -#ifdef __cplusplus -} - -extern "C" { -#endif //__cplusplus - -HRESULT WINAPI - D3DXLoadMeshFromXof( - LPD3DXFILEDATA pxofMesh, - DWORD Options, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXBUFFER *ppAdjacency, - LPD3DXBUFFER *ppMaterials, - LPD3DXBUFFER *ppEffectInstances, - DWORD *pNumMaterials, - LPD3DXMESH *ppMesh); - -// This similar to D3DXLoadMeshFromXof, except also returns skinning info if present in the file -// If skinning info is not present, ppSkinInfo will be NULL -HRESULT WINAPI - D3DXLoadSkinMeshFromXof( - LPD3DXFILEDATA pxofMesh, - DWORD Options, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXBUFFER* ppAdjacency, - LPD3DXBUFFER* ppMaterials, - LPD3DXBUFFER *ppEffectInstances, - DWORD *pMatOut, - LPD3DXSKININFO* ppSkinInfo, - LPD3DXMESH* ppMesh); - - -// The inverse of D3DXConvertTo{Indexed}BlendedMesh() functions. It figures out the skinning info from -// the mesh and the bone combination table and populates a skin info object with that data. The bone -// names and initial bone transforms are not filled in the skin info object by this method. This works -// with either a non-indexed or indexed blended mesh. It examines the FVF or declarator of the mesh to -// determine what type it is. -HRESULT WINAPI - D3DXCreateSkinInfoFromBlendedMesh( - LPD3DXBASEMESH pMesh, - DWORD NumBones, - CONST D3DXBONECOMBINATION *pBoneCombinationTable, - LPD3DXSKININFO* ppSkinInfo); - -HRESULT WINAPI - D3DXTessellateNPatches( - LPD3DXMESH pMeshIn, - CONST DWORD* pAdjacencyIn, - FLOAT NumSegs, - BOOL QuadraticInterpNormals, // if false use linear intrep for normals, if true use quadratic - LPD3DXMESH *ppMeshOut, - LPD3DXBUFFER *ppAdjacencyOut); - - -//generates implied outputdecl from input decl -//the decl generated from this should be used to generate the output decl for -//the tessellator subroutines. - -HRESULT WINAPI - D3DXGenerateOutputDecl( - D3DVERTEXELEMENT9 *pOutput, - CONST D3DVERTEXELEMENT9 *pInput); - -//loads patches from an XFileData -//since an X file can have up to 6 different patch meshes in it, -//returns them in an array - pNumPatches will contain the number of -//meshes in the actual file. -HRESULT WINAPI - D3DXLoadPatchMeshFromXof( - LPD3DXFILEDATA pXofObjMesh, - DWORD Options, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXBUFFER *ppMaterials, - LPD3DXBUFFER *ppEffectInstances, - PDWORD pNumMaterials, - LPD3DXPATCHMESH *ppMesh); - -//computes the size a single rect patch. -HRESULT WINAPI - D3DXRectPatchSize( - CONST FLOAT *pfNumSegs, //segments for each edge (4) - DWORD *pdwTriangles, //output number of triangles - DWORD *pdwVertices); //output number of vertices - -//computes the size of a single triangle patch -HRESULT WINAPI - D3DXTriPatchSize( - CONST FLOAT *pfNumSegs, //segments for each edge (3) - DWORD *pdwTriangles, //output number of triangles - DWORD *pdwVertices); //output number of vertices - - -//tessellates a patch into a created mesh -//similar to D3D RT patch -HRESULT WINAPI - D3DXTessellateRectPatch( - LPDIRECT3DVERTEXBUFFER9 pVB, - CONST FLOAT *pNumSegs, - CONST D3DVERTEXELEMENT9 *pdwInDecl, - CONST D3DRECTPATCH_INFO *pRectPatchInfo, - LPD3DXMESH pMesh); - - -HRESULT WINAPI - D3DXTessellateTriPatch( - LPDIRECT3DVERTEXBUFFER9 pVB, - CONST FLOAT *pNumSegs, - CONST D3DVERTEXELEMENT9 *pInDecl, - CONST D3DTRIPATCH_INFO *pTriPatchInfo, - LPD3DXMESH pMesh); - - - -//creates an NPatch PatchMesh from a D3DXMESH -HRESULT WINAPI - D3DXCreateNPatchMesh( - LPD3DXMESH pMeshSysMem, - LPD3DXPATCHMESH *pPatchMesh); - - -//creates a patch mesh -HRESULT WINAPI - D3DXCreatePatchMesh( - CONST D3DXPATCHINFO *pInfo, //patch type - DWORD dwNumPatches, //number of patches - DWORD dwNumVertices, //number of control vertices - DWORD dwOptions, //options - CONST D3DVERTEXELEMENT9 *pDecl, //format of control vertices - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXPATCHMESH *pPatchMesh); - - -//returns the number of degenerates in a patch mesh - -//text output put in string. -HRESULT WINAPI - D3DXValidPatchMesh(LPD3DXPATCHMESH pMesh, - DWORD *dwcDegenerateVertices, - DWORD *dwcDegeneratePatches, - LPD3DXBUFFER *ppErrorsAndWarnings); - -UINT WINAPI - D3DXGetFVFVertexSize(DWORD FVF); - -UINT WINAPI - D3DXGetDeclVertexSize(CONST D3DVERTEXELEMENT9 *pDecl,DWORD Stream); - -UINT WINAPI - D3DXGetDeclLength(CONST D3DVERTEXELEMENT9 *pDecl); - -HRESULT WINAPI - D3DXDeclaratorFromFVF( - DWORD FVF, - D3DVERTEXELEMENT9 pDeclarator[MAX_FVF_DECL_SIZE]); - -HRESULT WINAPI - D3DXFVFFromDeclarator( - CONST D3DVERTEXELEMENT9 *pDeclarator, - DWORD *pFVF); - -HRESULT WINAPI - D3DXWeldVertices( - LPD3DXMESH pMesh, - DWORD Flags, - CONST D3DXWELDEPSILONS *pEpsilons, - CONST DWORD *pAdjacencyIn, - DWORD *pAdjacencyOut, - DWORD *pFaceRemap, - LPD3DXBUFFER *ppVertexRemap); - -typedef struct _D3DXINTERSECTINFO -{ - DWORD FaceIndex; // index of face intersected - FLOAT U; // Barycentric Hit Coordinates - FLOAT V; // Barycentric Hit Coordinates - FLOAT Dist; // Ray-Intersection Parameter Distance -} D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO; - - -HRESULT WINAPI - D3DXIntersect( - LPD3DXBASEMESH pMesh, - CONST D3DXVECTOR3 *pRayPos, - CONST D3DXVECTOR3 *pRayDir, - BOOL *pHit, // True if any faces were intersected - DWORD *pFaceIndex, // index of closest face intersected - FLOAT *pU, // Barycentric Hit Coordinates - FLOAT *pV, // Barycentric Hit Coordinates - FLOAT *pDist, // Ray-Intersection Parameter Distance - LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest) - DWORD *pCountOfHits); // Number of entries in AllHits array - -HRESULT WINAPI - D3DXIntersectSubset( - LPD3DXBASEMESH pMesh, - DWORD AttribId, - CONST D3DXVECTOR3 *pRayPos, - CONST D3DXVECTOR3 *pRayDir, - BOOL *pHit, // True if any faces were intersected - DWORD *pFaceIndex, // index of closest face intersected - FLOAT *pU, // Barycentric Hit Coordinates - FLOAT *pV, // Barycentric Hit Coordinates - FLOAT *pDist, // Ray-Intersection Parameter Distance - LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest) - DWORD *pCountOfHits); // Number of entries in AllHits array - - -HRESULT WINAPI D3DXSplitMesh - ( - LPD3DXMESH pMeshIn, - CONST DWORD *pAdjacencyIn, - CONST DWORD MaxSize, - CONST DWORD Options, - DWORD *pMeshesOut, - LPD3DXBUFFER *ppMeshArrayOut, - LPD3DXBUFFER *ppAdjacencyArrayOut, - LPD3DXBUFFER *ppFaceRemapArrayOut, - LPD3DXBUFFER *ppVertRemapArrayOut - ); - -BOOL WINAPI D3DXIntersectTri -( - CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position - CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position - CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position - CONST D3DXVECTOR3 *pRayPos, // Ray origin - CONST D3DXVECTOR3 *pRayDir, // Ray direction - FLOAT *pU, // Barycentric Hit Coordinates - FLOAT *pV, // Barycentric Hit Coordinates - FLOAT *pDist); // Ray-Intersection Parameter Distance - -BOOL WINAPI - D3DXSphereBoundProbe( - CONST D3DXVECTOR3 *pCenter, - FLOAT Radius, - CONST D3DXVECTOR3 *pRayPosition, - CONST D3DXVECTOR3 *pRayDirection); - -BOOL WINAPI - D3DXBoxBoundProbe( - CONST D3DXVECTOR3 *pMin, - CONST D3DXVECTOR3 *pMax, - CONST D3DXVECTOR3 *pRayPosition, - CONST D3DXVECTOR3 *pRayDirection); - - -HRESULT WINAPI D3DXComputeTangentFrame(ID3DXMesh *pMesh, - DWORD dwOptions); - -HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *pMesh, - DWORD dwTextureInSemantic, - DWORD dwTextureInIndex, - DWORD dwUPartialOutSemantic, - DWORD dwUPartialOutIndex, - DWORD dwVPartialOutSemantic, - DWORD dwVPartialOutIndex, - DWORD dwNormalOutSemantic, - DWORD dwNormalOutIndex, - DWORD dwOptions, - CONST DWORD *pdwAdjacency, - FLOAT fPartialEdgeThreshold, - FLOAT fSingularPointThreshold, - FLOAT fNormalEdgeThreshold, - ID3DXMesh **ppMeshOut, - ID3DXBuffer **ppVertexMapping); - - -//D3DXComputeTangent -// -//Computes the Tangent vectors for the TexStage texture coordinates -//and places the results in the TANGENT[TangentIndex] specified in the meshes' DECL -//puts the binorm in BINORM[BinormIndex] also specified in the decl. -// -//If neither the binorm or the tangnet are in the meshes declaration, -//the function will fail. -// -//If a tangent or Binorm field is in the Decl, but the user does not -//wish D3DXComputeTangent to replace them, then D3DX_DEFAULT specified -//in the TangentIndex or BinormIndex will cause it to ignore the specified -//semantic. -// -//Wrap should be specified if the texture coordinates wrap. - -HRESULT WINAPI D3DXComputeTangent(LPD3DXMESH Mesh, - DWORD TexStage, - DWORD TangentIndex, - DWORD BinormIndex, - DWORD Wrap, - CONST DWORD *pAdjacency); - -//============================================================================ -// -// UVAtlas apis -// -//============================================================================ -typedef HRESULT (WINAPI *LPD3DXUVATLASCB)(FLOAT fPercentDone, LPVOID lpUserContext); - -// This function creates atlases for meshes. There are two modes of operation, -// either based on the number of charts, or the maximum allowed stretch. If the -// maximum allowed stretch is 0, then each triangle will likely be in its own -// chart. - -// -// The parameters are as follows: -// pMesh - Input mesh to calculate an atlas for. This must have a position -// channel and at least a 2-d texture channel. -// uMaxChartNumber - The maximum number of charts required for the atlas. -// If this is 0, it will be parameterized based solely on -// stretch. -// fMaxStretch - The maximum amount of stretch, if 0, no stretching is allowed, -// if 1, then any amount of stretching is allowed. -// uWidth - The width of the texture the atlas will be used on. -// uHeight - The height of the texture the atlas will be used on. -// fGutter - The minimum distance, in texels between two charts on the atlas. -// this gets scaled by the width, so if fGutter is 2.5, and it is -// used on a 512x512 texture, then the minimum distance will be -// 2.5 / 512 in u-v space. -// dwTextureIndex - Specifies which texture coordinate to write to in the -// output mesh (which is cloned from the input mesh). Useful -// if your vertex has multiple texture coordinates. -// pdwAdjacency - a pointer to an array with 3 DWORDs per face, indicating -// which triangles are adjacent to each other. -// pdwFalseEdgeAdjacency - a pointer to an array with 3 DWORDS per face, indicating -// at each face, whether an edge is a false edge or not (using -// the same ordering as the adjacency data structure). If this -// is NULL, then it is assumed that there are no false edges. If -// not NULL, then a non-false edge is indicated by -1 and a false -// edge is indicated by any other value (it is not required, but -// it may be useful for the caller to use the original adjacency -// value). This allows you to parameterize a mesh of quads, and -// the edges down the middle of each quad will not be cut when -// parameterizing the mesh. -// pfIMTArray - a pointer to an array with 3 FLOATs per face, describing the -// integrated metric tensor for that face. This lets you control -// the way this triangle may be stretched in the atlas. The IMT -// passed in will be 3 floats (a,b,c) and specify a symmetric -// matrix (a b) that, given a vector (s,t), specifies the -// (b c) -// distance between a vector v1 and a vector v2 = v1 + (s,t) as -// sqrt((s, t) * M * (s, t)^T). -// In other words, this lets one specify the magnitude of the -// stretch in an arbitrary direction in u-v space. For example -// if a = b = c = 1, then this scales the vector (1,1) by 2, and -// the vector (1,-1) by 0. Note that this is multiplying the edge -// length by the square of the matrix, so if you want the face to -// stretch to twice its -// size with no shearing, the IMT value should be (2, 0, 2), which -// is just the identity matrix times 2. -// Note that this assumes you have an orientation for the triangle -// in some 2-D space. For D3DXUVAtlas, this space is created by -// letting S be the direction from the first to the second -// vertex, and T be the cross product between the normal and S. -// -// pStatusCallback - Since the atlas creation process can be very CPU intensive, -// this allows the programmer to specify a function to be called -// periodically, similarly to how it is done in the PRT simulation -// engine. -// fCallbackFrequency - This lets you specify how often the callback will be -// called. A decent default should be 0.0001f. -// pUserContext - a void pointer to be passed back to the callback function -// dwOptions - A combination of flags in the D3DXUVATLAS enum -// ppMeshOut - A pointer to a location to store a pointer for the newly created -// mesh. -// ppFacePartitioning - A pointer to a location to store a pointer for an array, -// one DWORD per face, giving the final partitioning -// created by the atlasing algorithm. -// ppVertexRemapArray - A pointer to a location to store a pointer for an array, -// one DWORD per vertex, giving the vertex it was copied -// from, if any vertices needed to be split. -// pfMaxStretchOut - A location to store the maximum stretch resulting from the -// atlasing algorithm. -// puNumChartsOut - A location to store the number of charts created, or if the -// maximum number of charts was too low, this gives the minimum -// number of charts needed to create an atlas. - -HRESULT WINAPI D3DXUVAtlasCreate(LPD3DXMESH pMesh, - UINT uMaxChartNumber, - FLOAT fMaxStretch, - UINT uWidth, - UINT uHeight, - FLOAT fGutter, - DWORD dwTextureIndex, - CONST DWORD *pdwAdjacency, - CONST DWORD *pdwFalseEdgeAdjacency, - CONST FLOAT *pfIMTArray, - LPD3DXUVATLASCB pStatusCallback, - FLOAT fCallbackFrequency, - LPVOID pUserContext, - DWORD dwOptions, - LPD3DXMESH *ppMeshOut, - LPD3DXBUFFER *ppFacePartitioning, - LPD3DXBUFFER *ppVertexRemapArray, - FLOAT *pfMaxStretchOut, - UINT *puNumChartsOut); - -// This has the same exact arguments as Create, except that it does not perform the -// final packing step. This method allows one to get a partitioning out, and possibly -// modify it before sending it to be repacked. Note that if you change the -// partitioning, you'll also need to calculate new texture coordinates for any faces -// that have switched charts. -// -// The partition result adjacency output parameter is meant to be passed to the -// UVAtlasPack function, this adjacency cuts edges that are between adjacent -// charts, and also can include cuts inside of a chart in order to make it -// equivalent to a disc. For example: -// -// _______ -// | ___ | -// | |_| | -// |_____| -// -// In order to make this equivalent to a disc, we would need to add a cut, and it -// Would end up looking like: -// _______ -// | ___ | -// | |_|_| -// |_____| -// -// The resulting partition adjacency parameter cannot be NULL, because it is -// required for the packing step. - - - -HRESULT WINAPI D3DXUVAtlasPartition(LPD3DXMESH pMesh, - UINT uMaxChartNumber, - FLOAT fMaxStretch, - DWORD dwTextureIndex, - CONST DWORD *pdwAdjacency, - CONST DWORD *pdwFalseEdgeAdjacency, - CONST FLOAT *pfIMTArray, - LPD3DXUVATLASCB pStatusCallback, - FLOAT fCallbackFrequency, - LPVOID pUserContext, - DWORD dwOptions, - LPD3DXMESH *ppMeshOut, - LPD3DXBUFFER *ppFacePartitioning, - LPD3DXBUFFER *ppVertexRemapArray, - LPD3DXBUFFER *ppPartitionResultAdjacency, - FLOAT *pfMaxStretchOut, - UINT *puNumChartsOut); - -// This takes the face partitioning result from Partition and packs it into an -// atlas of the given size. pdwPartitionResultAdjacency should be derived from -// the adjacency returned from the partition step. This value cannot be NULL -// because Pack needs to know where charts were cut in the partition step in -// order to find the edges of each chart. -// The options parameter is currently reserved. -HRESULT WINAPI D3DXUVAtlasPack(ID3DXMesh *pMesh, - UINT uWidth, - UINT uHeight, - FLOAT fGutter, - DWORD dwTextureIndex, - CONST DWORD *pdwPartitionResultAdjacency, - LPD3DXUVATLASCB pStatusCallback, - FLOAT fCallbackFrequency, - LPVOID pUserContext, - DWORD dwOptions, - LPD3DXBUFFER pFacePartitioning); - - -//============================================================================ -// -// IMT Calculation apis -// -// These functions all compute the Integrated Metric Tensor for use in the -// UVAtlas API. They all calculate the IMT with respect to the canonical -// triangle, where the coordinate system is set up so that the u axis goes -// from vertex 0 to 1 and the v axis is N x u. So, for example, the second -// vertex's canonical uv coordinates are (d,0) where d is the distance between -// vertices 0 and 1. This way the IMT does not depend on the parameterization -// of the mesh, and if the signal over the surface doesn't change, then -// the IMT doesn't need to be recalculated. -//============================================================================ - -// This callback is used by D3DXComputeIMTFromSignal. -// -// uv - The texture coordinate for the vertex. -// uPrimitiveID - Face ID of the triangle on which to compute the signal. -// uSignalDimension - The number of floats to store in pfSignalOut. -// pUserData - The pUserData pointer passed in to ComputeIMTFromSignal. -// pfSignalOut - A pointer to where to store the signal data. -typedef HRESULT (WINAPI* LPD3DXIMTSIGNALCALLBACK) - (CONST D3DXVECTOR2 *uv, - UINT uPrimitiveID, - UINT uSignalDimension, - VOID *pUserData, - FLOAT *pfSignalOut); - -// This function is used to calculate the IMT from per vertex data. It sets -// up a linear system over the triangle, solves for the jacobian J, then -// constructs the IMT from that (J^TJ). -// This function allows you to calculate the IMT based off of any value in a -// mesh (color, normal, etc) by specifying the correct stride of the array. -// The IMT computed will cause areas of the mesh that have similar values to -// take up less space in the texture. -// -// pMesh - The mesh to calculate the IMT for. -// pVertexSignal - A float array of size uSignalStride * v, where v is the -// number of vertices in the mesh. -// uSignalDimension - How many floats per vertex to use in calculating the IMT. -// uSignalStride - The number of bytes per vertex in the array. This must be -// a multiple of sizeof(float) -// ppIMTData - Where to store the buffer holding the IMT data - -HRESULT WINAPI D3DXComputeIMTFromPerVertexSignal ( - LPD3DXMESH pMesh, - CONST FLOAT *pfVertexSignal, // uSignalDimension floats per vertex - UINT uSignalDimension, - UINT uSignalStride, // stride of signal in bytes - DWORD dwOptions, // reserved for future use - LPD3DXUVATLASCB pStatusCallback, - LPVOID pUserContext, - LPD3DXBUFFER *ppIMTData); - -// This function is used to calculate the IMT from data that varies over the -// surface of the mesh (generally at a higher frequency than vertex data). -// This function requires the mesh to already be parameterized (so it already -// has texture coordinates). It allows the user to define a signal arbitrarily -// over the surface of the mesh. -// -// pMesh - The mesh to calculate the IMT for. -// dwTextureIndex - This describes which set of texture coordinates in the -// mesh to use. -// uSignalDimension - How many components there are in the signal. -// fMaxUVDistance - The subdivision will continue until the distance between -// all vertices is at most fMaxUVDistance. -// dwOptions - reserved for future use -// pSignalCallback - The callback to use to get the signal. -// pUserData - A pointer that will be passed in to the callback. -// ppIMTData - Where to store the buffer holding the IMT data -HRESULT WINAPI D3DXComputeIMTFromSignal( - LPD3DXMESH pMesh, - DWORD dwTextureIndex, - UINT uSignalDimension, - FLOAT fMaxUVDistance, - DWORD dwOptions, // reserved for future use - LPD3DXIMTSIGNALCALLBACK pSignalCallback, - VOID *pUserData, - LPD3DXUVATLASCB pStatusCallback, - LPVOID pUserContext, - LPD3DXBUFFER *ppIMTData); - -// This function is used to calculate the IMT from texture data. Given a texture -// that maps over the surface of the mesh, the algorithm computes the IMT for -// each face. This will cause large areas that are very similar to take up less -// room when parameterized with UVAtlas. The texture is assumed to be -// interpolated over the mesh bilinearly. -// -// pMesh - The mesh to calculate the IMT for. -// pTexture - The texture to load data from. -// dwTextureIndex - This describes which set of texture coordinates in the -// mesh to use. -// dwOptions - Combination of one or more D3DXIMT flags. -// ppIMTData - Where to store the buffer holding the IMT data -HRESULT WINAPI D3DXComputeIMTFromTexture ( - LPD3DXMESH pMesh, - LPDIRECT3DTEXTURE9 pTexture, - DWORD dwTextureIndex, - DWORD dwOptions, - LPD3DXUVATLASCB pStatusCallback, - LPVOID pUserContext, - LPD3DXBUFFER *ppIMTData); - -// This function is very similar to ComputeIMTFromTexture, but it uses a -// float array to pass in the data, and it can calculate higher dimensional -// values than 4. -// -// pMesh - The mesh to calculate the IMT for. -// dwTextureIndex - This describes which set of texture coordinates in the -// mesh to use. -// pfFloatArray - a pointer to a float array of size -// uWidth*uHeight*uComponents -// uWidth - The width of the texture -// uHeight - The height of the texture -// uSignalDimension - The number of floats per texel in the signal -// uComponents - The number of floats in each texel -// dwOptions - Combination of one or more D3DXIMT flags -// ppIMTData - Where to store the buffer holding the IMT data -HRESULT WINAPI D3DXComputeIMTFromPerTexelSignal( - LPD3DXMESH pMesh, - DWORD dwTextureIndex, - FLOAT *pfTexelSignal, - UINT uWidth, - UINT uHeight, - UINT uSignalDimension, - UINT uComponents, - DWORD dwOptions, - LPD3DXUVATLASCB pStatusCallback, - LPVOID pUserContext, - LPD3DXBUFFER *ppIMTData); - -HRESULT WINAPI - D3DXConvertMeshSubsetToSingleStrip( - LPD3DXBASEMESH MeshIn, - DWORD AttribId, - DWORD IBOptions, - LPDIRECT3DINDEXBUFFER9 *ppIndexBuffer, - DWORD *pNumIndices); - -HRESULT WINAPI - D3DXConvertMeshSubsetToStrips( - LPD3DXBASEMESH MeshIn, - DWORD AttribId, - DWORD IBOptions, - LPDIRECT3DINDEXBUFFER9 *ppIndexBuffer, - DWORD *pNumIndices, - LPD3DXBUFFER *ppStripLengths, - DWORD *pNumStrips); - - -//============================================================================ -// -// D3DXOptimizeFaces: -// -------------------- -// Generate a face remapping for a triangle list that more effectively utilizes -// vertex caches. This optimization is identical to the one provided -// by ID3DXMesh::Optimize with the hardware independent option enabled. -// -// Parameters: -// pbIndices -// Triangle list indices to use for generating a vertex ordering -// NumFaces -// Number of faces in the triangle list -// NumVertices -// Number of vertices referenced by the triangle list -// b32BitIndices -// TRUE if indices are 32 bit, FALSE if indices are 16 bit -// pFaceRemap -// Destination buffer to store face ordering -// The number stored for a given element is where in the new ordering -// the face will have come from. See ID3DXMesh::Optimize for more info. -// -//============================================================================ -HRESULT WINAPI - D3DXOptimizeFaces( - LPCVOID pbIndices, - UINT cFaces, - UINT cVertices, - BOOL b32BitIndices, - DWORD* pFaceRemap); - -//============================================================================ -// -// D3DXOptimizeVertices: -// -------------------- -// Generate a vertex remapping to optimize for in order use of vertices for -// a given set of indices. This is commonly used after applying the face -// remap generated by D3DXOptimizeFaces -// -// Parameters: -// pbIndices -// Triangle list indices to use for generating a vertex ordering -// NumFaces -// Number of faces in the triangle list -// NumVertices -// Number of vertices referenced by the triangle list -// b32BitIndices -// TRUE if indices are 32 bit, FALSE if indices are 16 bit -// pVertexRemap -// Destination buffer to store vertex ordering -// The number stored for a given element is where in the new ordering -// the vertex will have come from. See ID3DXMesh::Optimize for more info. -// -//============================================================================ -HRESULT WINAPI - D3DXOptimizeVertices( - LPCVOID pbIndices, - UINT cFaces, - UINT cVertices, - BOOL b32BitIndices, - DWORD* pVertexRemap); - -#ifdef __cplusplus -} -#endif //__cplusplus - - -//=========================================================================== -// -// Data structures for Spherical Harmonic Precomputation -// -// -//============================================================================ - -typedef enum _D3DXSHCOMPRESSQUALITYTYPE { - D3DXSHCQUAL_FASTLOWQUALITY = 1, - D3DXSHCQUAL_SLOWHIGHQUALITY = 2, - D3DXSHCQUAL_FORCE_DWORD = 0x7fffffff -} D3DXSHCOMPRESSQUALITYTYPE; - -typedef enum _D3DXSHGPUSIMOPT { - D3DXSHGPUSIMOPT_SHADOWRES256 = 1, - D3DXSHGPUSIMOPT_SHADOWRES512 = 0, - D3DXSHGPUSIMOPT_SHADOWRES1024 = 2, - D3DXSHGPUSIMOPT_SHADOWRES2048 = 3, - - D3DXSHGPUSIMOPT_HIGHQUALITY = 4, - - D3DXSHGPUSIMOPT_FORCE_DWORD = 0x7fffffff -} D3DXSHGPUSIMOPT; - -// for all properties that are colors the luminance is computed -// if the simulator is run with a single channel using the following -// formula: R * 0.2125 + G * 0.7154 + B * 0.0721 - -typedef struct _D3DXSHMATERIAL { - D3DCOLORVALUE Diffuse; // Diffuse albedo of the surface. (Ignored if object is a Mirror) - BOOL bMirror; // Must be set to FALSE. bMirror == TRUE not currently supported - BOOL bSubSurf; // true if the object does subsurface scattering - can't do this and be a mirror - - // subsurface scattering parameters - FLOAT RelativeIndexOfRefraction; - D3DCOLORVALUE Absorption; - D3DCOLORVALUE ReducedScattering; - -} D3DXSHMATERIAL; - -// allocated in D3DXSHPRTCompSplitMeshSC -// vertices are duplicated into multiple super clusters but -// only have a valid status in one super cluster (fill in the rest) - -typedef struct _D3DXSHPRTSPLITMESHVERTDATA { - UINT uVertRemap; // vertex in original mesh this corresponds to - UINT uSubCluster; // cluster index relative to super cluster - UCHAR ucVertStatus; // 1 if vertex has valid data, 0 if it is "fill" -} D3DXSHPRTSPLITMESHVERTDATA; - -// used in D3DXSHPRTCompSplitMeshSC -// information for each super cluster that maps into face/vert arrays - -typedef struct _D3DXSHPRTSPLITMESHCLUSTERDATA { - UINT uVertStart; // initial index into remapped vertex array - UINT uVertLength; // number of vertices in this super cluster - - UINT uFaceStart; // initial index into face array - UINT uFaceLength; // number of faces in this super cluster - - UINT uClusterStart; // initial index into cluster array - UINT uClusterLength; // number of clusters in this super cluster -} D3DXSHPRTSPLITMESHCLUSTERDATA; - -// call back function for simulator -// return S_OK to keep running the simulator - anything else represents -// failure and the simulator will abort. - -typedef HRESULT (WINAPI *LPD3DXSHPRTSIMCB)(float fPercentDone, LPVOID lpUserContext); - -// interfaces for PRT buffers/simulator - -// GUIDs -// {F1827E47-00A8-49cd-908C-9D11955F8728} -DEFINE_GUID(IID_ID3DXPRTBuffer, -0xf1827e47, 0xa8, 0x49cd, 0x90, 0x8c, 0x9d, 0x11, 0x95, 0x5f, 0x87, 0x28); - -// {A758D465-FE8D-45ad-9CF0-D01E56266A07} -DEFINE_GUID(IID_ID3DXPRTCompBuffer, -0xa758d465, 0xfe8d, 0x45ad, 0x9c, 0xf0, 0xd0, 0x1e, 0x56, 0x26, 0x6a, 0x7); - -// {838F01EC-9729-4527-AADB-DF70ADE7FEA9} -DEFINE_GUID(IID_ID3DXTextureGutterHelper, -0x838f01ec, 0x9729, 0x4527, 0xaa, 0xdb, 0xdf, 0x70, 0xad, 0xe7, 0xfe, 0xa9); - -// {683A4278-CD5F-4d24-90AD-C4E1B6855D53} -DEFINE_GUID(IID_ID3DXPRTEngine, -0x683a4278, 0xcd5f, 0x4d24, 0x90, 0xad, 0xc4, 0xe1, 0xb6, 0x85, 0x5d, 0x53); - -// interface defenitions - -typedef interface ID3DXTextureGutterHelper ID3DXTextureGutterHelper; -typedef interface ID3DXPRTBuffer ID3DXPRTBuffer; - -#undef INTERFACE -#define INTERFACE ID3DXPRTBuffer - -// Buffer interface - contains "NumSamples" samples -// each sample in memory is stored as NumCoeffs scalars per channel (1 or 3) -// Same interface is used for both Vertex and Pixel PRT buffers - -DECLARE_INTERFACE_(ID3DXPRTBuffer, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXPRTBuffer - STDMETHOD_(UINT, GetNumSamples)(THIS) PURE; - STDMETHOD_(UINT, GetNumCoeffs)(THIS) PURE; - STDMETHOD_(UINT, GetNumChannels)(THIS) PURE; - - STDMETHOD_(BOOL, IsTexture)(THIS) PURE; - STDMETHOD_(UINT, GetWidth)(THIS) PURE; - STDMETHOD_(UINT, GetHeight)(THIS) PURE; - - // changes the number of samples allocated in the buffer - STDMETHOD(Resize)(THIS_ UINT NewSize) PURE; - - // ppData will point to the memory location where sample Start begins - // pointer is valid for at least NumSamples samples - STDMETHOD(LockBuffer)(THIS_ UINT Start, UINT NumSamples, FLOAT **ppData) PURE; - STDMETHOD(UnlockBuffer)(THIS) PURE; - - // every scalar in buffer is multiplied by Scale - STDMETHOD(ScaleBuffer)(THIS_ FLOAT Scale) PURE; - - // every scalar contains the sum of this and pBuffers values - // pBuffer must have the same storage class/dimensions - STDMETHOD(AddBuffer)(THIS_ LPD3DXPRTBUFFER pBuffer) PURE; - - // GutterHelper (described below) will fill in the gutter - // regions of a texture by interpolating "internal" values - STDMETHOD(AttachGH)(THIS_ LPD3DXTEXTUREGUTTERHELPER) PURE; - STDMETHOD(ReleaseGH)(THIS) PURE; - - // Evaluates attached gutter helper on the contents of this buffer - STDMETHOD(EvalGH)(THIS) PURE; - - // extracts a given channel into texture pTexture - // NumCoefficients starting from StartCoefficient are copied - STDMETHOD(ExtractTexture)(THIS_ UINT Channel, UINT StartCoefficient, - UINT NumCoefficients, LPDIRECT3DTEXTURE9 pTexture) PURE; - - // extracts NumCoefficients coefficients into mesh - only applicable on single channel - // buffers, otherwise just lockbuffer and copy data. With SHPRT data NumCoefficients - // should be Order^2 - STDMETHOD(ExtractToMesh)(THIS_ UINT NumCoefficients, D3DDECLUSAGE Usage, UINT UsageIndexStart, - LPD3DXMESH pScene) PURE; - -}; - -typedef interface ID3DXPRTCompBuffer ID3DXPRTCompBuffer; -typedef interface ID3DXPRTCompBuffer *LPD3DXPRTCOMPBUFFER; - -#undef INTERFACE -#define INTERFACE ID3DXPRTCompBuffer - -// compressed buffers stored a compressed version of a PRTBuffer - -DECLARE_INTERFACE_(ID3DXPRTCompBuffer, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DPRTCompBuffer - - // NumCoeffs and NumChannels are properties of input buffer - STDMETHOD_(UINT, GetNumSamples)(THIS) PURE; - STDMETHOD_(UINT, GetNumCoeffs)(THIS) PURE; - STDMETHOD_(UINT, GetNumChannels)(THIS) PURE; - - STDMETHOD_(BOOL, IsTexture)(THIS) PURE; - STDMETHOD_(UINT, GetWidth)(THIS) PURE; - STDMETHOD_(UINT, GetHeight)(THIS) PURE; - - // number of clusters, and PCA vectors per-cluster - STDMETHOD_(UINT, GetNumClusters)(THIS) PURE; - STDMETHOD_(UINT, GetNumPCA)(THIS) PURE; - - // normalizes PCA weights so that they are between [-1,1] - // basis vectors are modified to reflect this - STDMETHOD(NormalizeData)(THIS) PURE; - - // copies basis vectors for cluster "Cluster" into pClusterBasis - // (NumPCA+1)*NumCoeffs*NumChannels floats - STDMETHOD(ExtractBasis)(THIS_ UINT Cluster, FLOAT *pClusterBasis) PURE; - - // UINT per sample - which cluster it belongs to - STDMETHOD(ExtractClusterIDs)(THIS_ UINT *pClusterIDs) PURE; - - // copies NumExtract PCA projection coefficients starting at StartPCA - // into pPCACoefficients - NumSamples*NumExtract floats copied - STDMETHOD(ExtractPCA)(THIS_ UINT StartPCA, UINT NumExtract, FLOAT *pPCACoefficients) PURE; - - // copies NumPCA projection coefficients starting at StartPCA - // into pTexture - should be able to cope with signed formats - STDMETHOD(ExtractTexture)(THIS_ UINT StartPCA, UINT NumpPCA, - LPDIRECT3DTEXTURE9 pTexture) PURE; - - // copies NumPCA projection coefficients into mesh pScene - // Usage is D3DDECLUSAGE where coefficients are to be stored - // UsageIndexStart is starting index - STDMETHOD(ExtractToMesh)(THIS_ UINT NumPCA, D3DDECLUSAGE Usage, UINT UsageIndexStart, - LPD3DXMESH pScene) PURE; -}; - - -#undef INTERFACE -#define INTERFACE ID3DXTextureGutterHelper - -// ID3DXTextureGutterHelper will build and manage -// "gutter" regions in a texture - this will allow for -// bi-linear interpolation to not have artifacts when rendering -// It generates a map (in texture space) where each texel -// is in one of 3 states: -// 0 Invalid - not used at all -// 1 Inside triangle -// 2 Gutter texel -// 4 represents a gutter texel that will be computed during PRT -// For each Inside/Gutter texel it stores the face it -// belongs to and barycentric coordinates for the 1st two -// vertices of that face. Gutter vertices are assigned to -// the closest edge in texture space. -// -// When used with PRT this requires a unique parameterization -// of the model - every texel must correspond to a single point -// on the surface of the model and vice versa - -DECLARE_INTERFACE_(ID3DXTextureGutterHelper, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXTextureGutterHelper - - // dimensions of texture this is bound too - STDMETHOD_(UINT, GetWidth)(THIS) PURE; - STDMETHOD_(UINT, GetHeight)(THIS) PURE; - - - // Applying gutters recomputes all of the gutter texels of class "2" - // based on texels of class "1" or "4" - - // Applies gutters to a raw float buffer - each texel is NumCoeffs floats - // Width and Height must match GutterHelper - STDMETHOD(ApplyGuttersFloat)(THIS_ FLOAT *pDataIn, UINT NumCoeffs, UINT Width, UINT Height); - - // Applies gutters to pTexture - // Dimensions must match GutterHelper - STDMETHOD(ApplyGuttersTex)(THIS_ LPDIRECT3DTEXTURE9 pTexture); - - // Applies gutters to a D3DXPRTBuffer - // Dimensions must match GutterHelper - STDMETHOD(ApplyGuttersPRT)(THIS_ LPD3DXPRTBUFFER pBuffer); - - // Resamples a texture from a mesh onto this gutterhelpers - // parameterization. It is assumed that the UV coordinates - // for this gutter helper are in TEXTURE 0 (usage/usage index) - // and the texture coordinates should all be within [0,1] for - // both sets. - // - // pTextureIn - texture represented using parameterization in pMeshIn - // pMeshIn - Mesh with texture coordinates that represent pTextureIn - // pTextureOut texture coordinates are assumed to be in - // TEXTURE 0 - // Usage - field in DECL for pMeshIn that stores texture coordinates - // for pTextureIn - // UsageIndex - which index for Usage above for pTextureIn - // pTextureOut- Resampled texture - // - // Usage would generally be D3DDECLUSAGE_TEXCOORD and UsageIndex other than zero - STDMETHOD(ResampleTex)(THIS_ LPDIRECT3DTEXTURE9 pTextureIn, - LPD3DXMESH pMeshIn, - D3DDECLUSAGE Usage, UINT UsageIndex, - LPDIRECT3DTEXTURE9 pTextureOut); - - // the routines below provide access to the data structures - // used by the Apply functions - - // face map is a UINT per texel that represents the - // face of the mesh that texel belongs too - - // only valid if same texel is valid in pGutterData - // pFaceData must be allocated by the user - STDMETHOD(GetFaceMap)(THIS_ UINT *pFaceData) PURE; - - // BaryMap is a D3DXVECTOR2 per texel - // the 1st two barycentric coordinates for the corresponding - // face (3rd weight is always 1-sum of first two) - // only valid if same texel is valid in pGutterData - // pBaryData must be allocated by the user - STDMETHOD(GetBaryMap)(THIS_ D3DXVECTOR2 *pBaryData) PURE; - - // TexelMap is a D3DXVECTOR2 per texel that - // stores the location in pixel coordinates where the - // corresponding texel is mapped - // pTexelData must be allocated by the user - STDMETHOD(GetTexelMap)(THIS_ D3DXVECTOR2 *pTexelData) PURE; - - // GutterMap is a BYTE per texel - // 0/1/2 for Invalid/Internal/Gutter texels - // 4 represents a gutter texel that will be computed - // during PRT - // pGutterData must be allocated by the user - STDMETHOD(GetGutterMap)(THIS_ BYTE *pGutterData) PURE; - - // face map is a UINT per texel that represents the - // face of the mesh that texel belongs too - - // only valid if same texel is valid in pGutterData - STDMETHOD(SetFaceMap)(THIS_ UINT *pFaceData) PURE; - - // BaryMap is a D3DXVECTOR2 per texel - // the 1st two barycentric coordinates for the corresponding - // face (3rd weight is always 1-sum of first two) - // only valid if same texel is valid in pGutterData - STDMETHOD(SetBaryMap)(THIS_ D3DXVECTOR2 *pBaryData) PURE; - - // TexelMap is a D3DXVECTOR2 per texel that - // stores the location in pixel coordinates where the - // corresponding texel is mapped - STDMETHOD(SetTexelMap)(THIS_ D3DXVECTOR2 *pTexelData) PURE; - - // GutterMap is a BYTE per texel - // 0/1/2 for Invalid/Internal/Gutter texels - // 4 represents a gutter texel that will be computed - // during PRT - STDMETHOD(SetGutterMap)(THIS_ BYTE *pGutterData) PURE; -}; - - -typedef interface ID3DXPRTEngine ID3DXPRTEngine; -typedef interface ID3DXPRTEngine *LPD3DXPRTENGINE; - -#undef INTERFACE -#define INTERFACE ID3DXPRTEngine - -// ID3DXPRTEngine is used to compute a PRT simulation -// Use the following steps to compute PRT for SH -// (1) create an interface (which includes a scene) -// (2) call SetSamplingInfo -// (3) [optional] Set MeshMaterials/albedo's (required if doing bounces) -// (4) call ComputeDirectLightingSH -// (5) [optional] call ComputeBounce -// repeat step 5 for as many bounces as wanted. -// if you want to model subsurface scattering you -// need to call ComputeSS after direct lighting and -// each bounce. -// If you want to bake the albedo into the PRT signal, you -// must call MutliplyAlbedo, otherwise the user has to multiply -// the albedo themselves. Not multiplying the albedo allows you -// to model albedo variation at a finer scale then illumination, and -// can result in better compression results. -// Luminance values are computed from RGB values using the following -// formula: R * 0.2125 + G * 0.7154 + B * 0.0721 - -DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXPRTEngine - - // This sets a material per attribute in the scene mesh and it is - // the only way to specify subsurface scattering parameters. if - // bSetAlbedo is FALSE, NumChannels must match the current - // configuration of the PRTEngine. If you intend to change - // NumChannels (through some other SetAlbedo function) it must - // happen before SetMeshMaterials is called. - // - // NumChannels 1 implies "grayscale" materials, set this to 3 to enable - // color bleeding effects - // bSetAlbedo sets albedo from material if TRUE - which clobbers per texel/vertex - // albedo that might have been set before. FALSE won't clobber. - // fLengthScale is used for subsurface scattering - scene is mapped into a 1mm unit cube - // and scaled by this amount - STDMETHOD(SetMeshMaterials)(THIS_ CONST D3DXSHMATERIAL **ppMaterials, UINT NumMeshes, - UINT NumChannels, BOOL bSetAlbedo, FLOAT fLengthScale) PURE; - - // setting albedo per-vertex or per-texel over rides the albedos stored per mesh - // but it does not over ride any other settings - - // sets an albedo to be used per vertex - the albedo is represented as a float - // pDataIn input pointer (pointint to albedo of 1st sample) - // NumChannels 1 implies "grayscale" materials, set this to 3 to enable - // color bleeding effects - // Stride - stride in bytes to get to next samples albedo - STDMETHOD(SetPerVertexAlbedo)(THIS_ CONST VOID *pDataIn, UINT NumChannels, UINT Stride) PURE; - - // represents the albedo per-texel instead of per-vertex (even if per-vertex PRT is used) - // pAlbedoTexture - texture that stores the albedo (dimension arbitrary) - // NumChannels 1 implies "grayscale" materials, set this to 3 to enable - // color bleeding effects - // pGH - optional gutter helper, otherwise one is constructed in computation routines and - // destroyed (if not attached to buffers) - STDMETHOD(SetPerTexelAlbedo)(THIS_ LPDIRECT3DTEXTURE9 pAlbedoTexture, - UINT NumChannels, - LPD3DXTEXTUREGUTTERHELPER pGH) PURE; - - // gets the per-vertex albedo - STDMETHOD(GetVertexAlbedo)(THIS_ D3DXCOLOR *pVertColors, UINT NumVerts) PURE; - - // If pixel PRT is being computed normals default to ones that are interpolated - // from the vertex normals. This specifies a texture that stores an object - // space normal map instead (must use a texture format that can represent signed values) - // pNormalTexture - normal map, must be same dimensions as PRTBuffers, signed - STDMETHOD(SetPerTexelNormal)(THIS_ LPDIRECT3DTEXTURE9 pNormalTexture) PURE; - - // Copies per-vertex albedo from mesh - // pMesh - mesh that represents the scene. It must have the same - // properties as the mesh used to create the PRTEngine - // Usage - D3DDECLUSAGE to extract albedos from - // NumChannels 1 implies "grayscale" materials, set this to 3 to enable - // color bleeding effects - STDMETHOD(ExtractPerVertexAlbedo)(THIS_ LPD3DXMESH pMesh, - D3DDECLUSAGE Usage, - UINT NumChannels) PURE; - - // Resamples the input buffer into the output buffer - // can be used to move between per-vertex and per-texel buffers. This can also be used - // to convert single channel buffers to 3-channel buffers and vice-versa. - STDMETHOD(ResampleBuffer)(THIS_ LPD3DXPRTBUFFER pBufferIn, LPD3DXPRTBUFFER pBufferOut) PURE; - - // Returns the scene mesh - including modifications from adaptive spatial sampling - // The returned mesh only has positions, normals and texture coordinates (if defined) - // pD3DDevice - d3d device that will be used to allocate the mesh - // pFaceRemap - each face has a pointer back to the face on the original mesh that it comes from - // if the face hasn't been subdivided this will be an identity mapping - // pVertRemap - each vertex contains 3 vertices that this is a linear combination of - // pVertWeights - weights for each of above indices (sum to 1.0f) - // ppMesh - mesh that will be allocated and filled - STDMETHOD(GetAdaptedMesh)(THIS_ LPDIRECT3DDEVICE9 pD3DDevice,UINT *pFaceRemap, UINT *pVertRemap, FLOAT *pfVertWeights, LPD3DXMESH *ppMesh) PURE; - - // Number of vertices currently allocated (includes new vertices from adaptive sampling) - STDMETHOD_(UINT, GetNumVerts)(THIS) PURE; - // Number of faces currently allocated (includes new faces) - STDMETHOD_(UINT, GetNumFaces)(THIS) PURE; - - // Sets the Minimum/Maximum intersection distances, this can be used to control - // maximum distance that objects can shadow/reflect light, and help with "bad" - // art that might have near features that you don't want to shadow. This does not - // apply for GPU simulations. - // fMin - minimum intersection distance, must be positive and less than fMax - // fMax - maximum intersection distance, if 0.0f use the previous value, otherwise - // must be strictly greater than fMin - STDMETHOD(SetMinMaxIntersection)(THIS_ FLOAT fMin, FLOAT fMax) PURE; - - // This will subdivide faces on a mesh so that adaptively simulations can - // use a more conservative threshold (it won't miss features.) - // MinEdgeLength - minimum edge length that will be generated, if 0.0f a - // reasonable default will be used - // MaxSubdiv - maximum level of subdivision, if 0 is specified a default - // value will be used (5) - STDMETHOD(RobustMeshRefine)(THIS_ FLOAT MinEdgeLength, UINT MaxSubdiv) PURE; - - // This sets to sampling information used by the simulator. Adaptive sampling - // parameters are currently ignored. - // NumRays - number of rays to shoot per sample - // UseSphere - if TRUE uses spherical samples, otherwise samples over - // the hemisphere. Should only be used with GPU and Vol computations - // UseCosine - if TRUE uses a cosine weighting - not used for Vol computations - // or if only the visiblity function is desired - // Adaptive - if TRUE adaptive sampling (angular) is used - // AdaptiveThresh - threshold used to terminate adaptive angular sampling - // ignored if adaptive sampling is not set - STDMETHOD(SetSamplingInfo)(THIS_ UINT NumRays, - BOOL UseSphere, - BOOL UseCosine, - BOOL Adaptive, - FLOAT AdaptiveThresh) PURE; - - // Methods that compute the direct lighting contribution for objects - // always represente light using spherical harmonics (SH) - // the albedo is not multiplied by the signal - it just integrates - // incoming light. If NumChannels is not 1 the vector is replicated - // - // SHOrder - order of SH to use - // pDataOut - PRT buffer that is generated. Can be single channel - STDMETHOD(ComputeDirectLightingSH)(THIS_ UINT SHOrder, - LPD3DXPRTBUFFER pDataOut) PURE; - - // Adaptive variant of above function. This will refine the mesh - // generating new vertices/faces to approximate the PRT signal - // more faithfully. - // SHOrder - order of SH to use - // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) - // if value is less then 1e-6f, 1e-6f is specified - // MinEdgeLength - minimum edge length that will be generated - // if value is too small a fairly conservative model dependent value - // is used - // MaxSubdiv - maximum subdivision level, if 0 is specified it - // will default to 4 - // pDataOut - PRT buffer that is generated. Can be single channel. - STDMETHOD(ComputeDirectLightingSHAdaptive)(THIS_ UINT SHOrder, - FLOAT AdaptiveThresh, - FLOAT MinEdgeLength, - UINT MaxSubdiv, - LPD3DXPRTBUFFER pDataOut) PURE; - - // Function that computes the direct lighting contribution for objects - // light is always represented using spherical harmonics (SH) - // This is done on the GPU and is much faster then using the CPU. - // The albedo is not multiplied by the signal - it just integrates - // incoming light. If NumChannels is not 1 the vector is replicated. - // ZBias/ZAngleBias are akin to parameters used with shadow zbuffers. - // A reasonable default for both values is 0.005, but the user should - // experiment (ZAngleBias can be zero, ZBias should not be.) - // Callbacks should not use the Direct3D9Device the simulator is using. - // SetSamplingInfo must be called with TRUE for UseSphere and - // FALSE for UseCosine before this method is called. - // - // pD3DDevice - device used to run GPU simulator - must support PS2.0 - // and FP render targets - // Flags - parameters for the GPU simulator, combination of one or more - // D3DXSHGPUSIMOPT flags. Only one SHADOWRES setting should be set and - // the defaults is 512 - // SHOrder - order of SH to use - // ZBias - bias in normal direction (for depth test) - // ZAngleBias - scaled by one minus cosine of angle with light (offset in depth) - // pDataOut - PRT buffer that is filled in. Can be single channel - STDMETHOD(ComputeDirectLightingSHGPU)(THIS_ LPDIRECT3DDEVICE9 pD3DDevice, - UINT Flags, - UINT SHOrder, - FLOAT ZBias, - FLOAT ZAngleBias, - LPD3DXPRTBUFFER pDataOut) PURE; - - - // Functions that computes subsurface scattering (using material properties) - // Albedo is not multiplied by result. This only works for per-vertex data - // use ResampleBuffer to move per-vertex data into a texture and back. - // - // pDataIn - input data (previous bounce) - // pDataOut - result of subsurface scattering simulation - // pDataTotal - [optional] results can be summed into this buffer - STDMETHOD(ComputeSS)(THIS_ LPD3DXPRTBUFFER pDataIn, - LPD3DXPRTBUFFER pDataOut, LPD3DXPRTBUFFER pDataTotal) PURE; - - // Adaptive version of ComputeSS. - // - // pDataIn - input data (previous bounce) - // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) - // if value is less then 1e-6f, 1e-6f is specified - // MinEdgeLength - minimum edge length that will be generated - // if value is too small a fairly conservative model dependent value - // is used - // MaxSubdiv - maximum subdivision level, if 0 is specified it - // will default to 4 - // pDataOut - result of subsurface scattering simulation - // pDataTotal - [optional] results can be summed into this buffer - STDMETHOD(ComputeSSAdaptive)(THIS_ LPD3DXPRTBUFFER pDataIn, - FLOAT AdaptiveThresh, - FLOAT MinEdgeLength, - UINT MaxSubdiv, - LPD3DXPRTBUFFER pDataOut, LPD3DXPRTBUFFER pDataTotal) PURE; - - // computes a single bounce of inter-reflected light - // works for SH based PRT or generic lighting - // Albedo is not multiplied by result - // - // pDataIn - previous bounces data - // pDataOut - PRT buffer that is generated - // pDataTotal - [optional] can be used to keep a running sum - STDMETHOD(ComputeBounce)(THIS_ LPD3DXPRTBUFFER pDataIn, - LPD3DXPRTBUFFER pDataOut, - LPD3DXPRTBUFFER pDataTotal) PURE; - - // Adaptive version of above function. - // - // pDataIn - previous bounces data, can be single channel - // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) - // if value is less then 1e-6f, 1e-6f is specified - // MinEdgeLength - minimum edge length that will be generated - // if value is too small a fairly conservative model dependent value - // is used - // MaxSubdiv - maximum subdivision level, if 0 is specified it - // will default to 4 - // pDataOut - PRT buffer that is generated - // pDataTotal - [optional] can be used to keep a running sum - STDMETHOD(ComputeBounceAdaptive)(THIS_ LPD3DXPRTBUFFER pDataIn, - FLOAT AdaptiveThresh, - FLOAT MinEdgeLength, - UINT MaxSubdiv, - LPD3DXPRTBUFFER pDataOut, - LPD3DXPRTBUFFER pDataTotal) PURE; - - // Computes projection of distant SH radiance into a local SH radiance - // function. This models how direct lighting is attenuated by the - // scene and is a form of "neighborhood transfer." The result is - // a linear operator (matrix) at every sample point, if you multiply - // this matrix by the distant SH lighting coefficients you get an - // approximation of the local incident radiance function from - // direct lighting. These resulting lighting coefficients can - // than be projected into another basis or used with any rendering - // technique that uses spherical harmonics as input. - // SetSamplingInfo must be called with TRUE for UseSphere and - // FALSE for UseCosine before this method is called. - // Generates SHOrderIn*SHOrderIn*SHOrderOut*SHOrderOut scalars - // per channel at each sample location. - // - // SHOrderIn - Order of the SH representation of distant lighting - // SHOrderOut - Order of the SH representation of local lighting - // NumVolSamples - Number of sample locations - // pSampleLocs - position of sample locations - // pDataOut - PRT Buffer that will store output results - STDMETHOD(ComputeVolumeSamplesDirectSH)(THIS_ UINT SHOrderIn, - UINT SHOrderOut, - UINT NumVolSamples, - CONST D3DXVECTOR3 *pSampleLocs, - LPD3DXPRTBUFFER pDataOut) PURE; - - // At each sample location computes a linear operator (matrix) that maps - // the representation of source radiance (NumCoeffs in pSurfDataIn) - // into a local incident radiance function approximated with spherical - // harmonics. For example if a light map data is specified in pSurfDataIn - // the result is an SH representation of the flow of light at each sample - // point. If PRT data for an outdoor scene is used, each sample point - // contains a matrix that models how distant lighting bounces of the objects - // in the scene and arrives at the given sample point. Combined with - // ComputeVolumeSamplesDirectSH this gives the complete representation for - // how light arrives at each sample point parameterized by distant lighting. - // SetSamplingInfo must be called with TRUE for UseSphere and - // FALSE for UseCosine before this method is called. - // Generates pSurfDataIn->NumCoeffs()*SHOrder*SHOrder scalars - // per channel at each sample location. - // - // pSurfDataIn - previous bounce data - // SHOrder - order of SH to generate projection with - // NumVolSamples - Number of sample locations - // pSampleLocs - position of sample locations - // pDataOut - PRT Buffer that will store output results - STDMETHOD(ComputeVolumeSamples)(THIS_ LPD3DXPRTBUFFER pSurfDataIn, - UINT SHOrder, - UINT NumVolSamples, - CONST D3DXVECTOR3 *pSampleLocs, - LPD3DXPRTBUFFER pDataOut) PURE; - - // Computes direct lighting (SH) for a point not on the mesh - // with a given normal - cannot use texture buffers. - // - // SHOrder - order of SH to use - // NumSamples - number of sample locations - // pSampleLocs - position for each sample - // pSampleNorms - normal for each sample - // pDataOut - PRT Buffer that will store output results - STDMETHOD(ComputeSurfSamplesDirectSH)(THIS_ UINT SHOrder, - UINT NumSamples, - CONST D3DXVECTOR3 *pSampleLocs, - CONST D3DXVECTOR3 *pSampleNorms, - LPD3DXPRTBUFFER pDataOut) PURE; - - - // given the solution for PRT or light maps, computes transfer vector at arbitrary - // position/normal pairs in space - // - // pSurfDataIn - input data - // NumSamples - number of sample locations - // pSampleLocs - position for each sample - // pSampleNorms - normal for each sample - // pDataOut - PRT Buffer that will store output results - // pDataTotal - optional buffer to sum results into - can be NULL - STDMETHOD(ComputeSurfSamplesBounce)(THIS_ LPD3DXPRTBUFFER pSurfDataIn, - UINT NumSamples, - CONST D3DXVECTOR3 *pSampleLocs, - CONST D3DXVECTOR3 *pSampleNorms, - LPD3DXPRTBUFFER pDataOut, - LPD3DXPRTBUFFER pDataTotal) PURE; - - // Frees temporary data structures that can be created for subsurface scattering - // this data is freed when the PRTComputeEngine is freed and is lazily created - STDMETHOD(FreeSSData)(THIS) PURE; - - // Frees temporary data structures that can be created for bounce simulations - // this data is freed when the PRTComputeEngine is freed and is lazily created - STDMETHOD(FreeBounceData)(THIS) PURE; - - // This computes the Local Deformable PRT (LDPRT) coefficients relative to the - // per sample normals that minimize error in a least squares sense with respect - // to the input PRT data set. These coefficients can be used with skinned/transformed - // normals to model global effects with dynamic objects. Shading normals can - // optionally be solved for - these normals (along with the LDPRT coefficients) can - // more accurately represent the PRT signal. The coefficients are for zonal - // harmonics oriented in the normal/shading normal direction. - // - // pDataIn - SH PRT dataset that is input - // SHOrder - Order of SH to compute conv coefficients for - // pNormOut - Optional array of vectors (passed in) that will be filled with - // "shading normals", LDPRT coefficients are optimized for - // these normals. This array must be the same size as the number of - // samples in pDataIn - // pDataOut - Output buffer (SHOrder zonal harmonic coefficients per channel per sample) - STDMETHOD(ComputeLDPRTCoeffs)(THIS_ LPD3DXPRTBUFFER pDataIn, - UINT SHOrder, - D3DXVECTOR3 *pNormOut, - LPD3DXPRTBUFFER pDataOut) PURE; - - // scales all the samples associated with a given sub mesh - // can be useful when using subsurface scattering - // fScale - value to scale each vector in submesh by - STDMETHOD(ScaleMeshChunk)(THIS_ UINT uMeshChunk, FLOAT fScale, LPD3DXPRTBUFFER pDataOut) PURE; - - // mutliplies each PRT vector by the albedo - can be used if you want to have the albedo - // burned into the dataset, often better not to do this. If this is not done the user - // must mutliply the albedo themselves when rendering - just multiply the albedo times - // the result of the PRT dot product. - // If pDataOut is a texture simulation result and there is an albedo texture it - // must be represented at the same resolution as the simulation buffer. You can use - // LoadSurfaceFromSurface and set a new albedo texture if this is an issue - but must - // be careful about how the gutters are handled. - // - // pDataOut - dataset that will get albedo pushed into it - STDMETHOD(MultiplyAlbedo)(THIS_ LPD3DXPRTBUFFER pDataOut) PURE; - - // Sets a pointer to an optional call back function that reports back to the - // user percentage done and gives them the option of quitting - // pCB - pointer to call back function, return S_OK for the simulation - // to continue - // Frequency - 1/Frequency is roughly the number of times the call back - // will be invoked - // lpUserContext - will be passed back to the users call back - STDMETHOD(SetCallBack)(THIS_ LPD3DXSHPRTSIMCB pCB, FLOAT Frequency, LPVOID lpUserContext) PURE; - - // Returns TRUE if the ray intersects the mesh, FALSE if it does not. This function - // takes into account settings from SetMinMaxIntersection. If the closest intersection - // is not needed this function is more efficient compared to the ClosestRayIntersection - // method. - // pRayPos - origin of ray - // pRayDir - normalized ray direction (normalization required for SetMinMax to be meaningful) - - STDMETHOD_(BOOL, ShadowRayIntersects)(THIS_ CONST D3DXVECTOR3 *pRayPos, CONST D3DXVECTOR3 *pRayDir) PURE; - - // Returns TRUE if the ray intersects the mesh, FALSE if it does not. If there is an - // intersection the closest face that was intersected and its first two barycentric coordinates - // are returned. This function takes into account settings from SetMinMaxIntersection. - // This is a slower function compared to ShadowRayIntersects and should only be used where - // needed. The third vertices barycentric coordinates will be 1 - pU - pV. - // pRayPos - origin of ray - // pRayDir - normalized ray direction (normalization required for SetMinMax to be meaningful) - // pFaceIndex - Closest face that intersects. This index is based on stacking the pBlockerMesh - // faces before the faces from pMesh - // pU - Barycentric coordinate for vertex 0 - // pV - Barycentric coordinate for vertex 1 - // pDist - Distance along ray where the intersection occured - - STDMETHOD_(BOOL, ClosestRayIntersects)(THIS_ CONST D3DXVECTOR3 *pRayPos, CONST D3DXVECTOR3 *pRayDir, - DWORD *pFaceIndex, FLOAT *pU, FLOAT *pV, FLOAT *pDist) PURE; -}; - - -// API functions for creating interfaces - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -//============================================================================ -// -// D3DXCreatePRTBuffer: -// -------------------- -// Generates a PRT Buffer that can be compressed or filled by a simulator -// This function should be used to create per-vertex or volume buffers. -// When buffers are created all values are initialized to zero. -// -// Parameters: -// NumSamples -// Number of sample locations represented -// NumCoeffs -// Number of coefficients per sample location (order^2 for SH) -// NumChannels -// Number of color channels to represent (1 or 3) -// ppBuffer -// Buffer that will be allocated -// -//============================================================================ - -HRESULT WINAPI - D3DXCreatePRTBuffer( - UINT NumSamples, - UINT NumCoeffs, - UINT NumChannels, - LPD3DXPRTBUFFER* ppBuffer); - -//============================================================================ -// -// D3DXCreatePRTBufferTex: -// -------------------- -// Generates a PRT Buffer that can be compressed or filled by a simulator -// This function should be used to create per-pixel buffers. -// When buffers are created all values are initialized to zero. -// -// Parameters: -// Width -// Width of texture -// Height -// Height of texture -// NumCoeffs -// Number of coefficients per sample location (order^2 for SH) -// NumChannels -// Number of color channels to represent (1 or 3) -// ppBuffer -// Buffer that will be allocated -// -//============================================================================ - -HRESULT WINAPI - D3DXCreatePRTBufferTex( - UINT Width, - UINT Height, - UINT NumCoeffs, - UINT NumChannels, - LPD3DXPRTBUFFER* ppBuffer); - -//============================================================================ -// -// D3DXLoadPRTBufferFromFile: -// -------------------- -// Loads a PRT buffer that has been saved to disk. -// -// Parameters: -// pFilename -// Name of the file to load -// ppBuffer -// Buffer that will be allocated -// -//============================================================================ - -HRESULT WINAPI - D3DXLoadPRTBufferFromFileA( - LPCSTR pFilename, - LPD3DXPRTBUFFER* ppBuffer); - -HRESULT WINAPI - D3DXLoadPRTBufferFromFileW( - LPCWSTR pFilename, - LPD3DXPRTBUFFER* ppBuffer); - -#ifdef UNICODE -#define D3DXLoadPRTBufferFromFile D3DXLoadPRTBufferFromFileW -#else -#define D3DXLoadPRTBufferFromFile D3DXLoadPRTBufferFromFileA -#endif - - -//============================================================================ -// -// D3DXSavePRTBufferToFile: -// -------------------- -// Saves a PRTBuffer to disk. -// -// Parameters: -// pFilename -// Name of the file to save -// pBuffer -// Buffer that will be saved -// -//============================================================================ - -HRESULT WINAPI - D3DXSavePRTBufferToFileA( - LPCSTR pFileName, - LPD3DXPRTBUFFER pBuffer); - -HRESULT WINAPI - D3DXSavePRTBufferToFileW( - LPCWSTR pFileName, - LPD3DXPRTBUFFER pBuffer); - -#ifdef UNICODE -#define D3DXSavePRTBufferToFile D3DXSavePRTBufferToFileW -#else -#define D3DXSavePRTBufferToFile D3DXSavePRTBufferToFileA -#endif - - -//============================================================================ -// -// D3DXLoadPRTCompBufferFromFile: -// -------------------- -// Loads a PRTComp buffer that has been saved to disk. -// -// Parameters: -// pFilename -// Name of the file to load -// ppBuffer -// Buffer that will be allocated -// -//============================================================================ - -HRESULT WINAPI - D3DXLoadPRTCompBufferFromFileA( - LPCSTR pFilename, - LPD3DXPRTCOMPBUFFER* ppBuffer); - -HRESULT WINAPI - D3DXLoadPRTCompBufferFromFileW( - LPCWSTR pFilename, - LPD3DXPRTCOMPBUFFER* ppBuffer); - -#ifdef UNICODE -#define D3DXLoadPRTCompBufferFromFile D3DXLoadPRTCompBufferFromFileW -#else -#define D3DXLoadPRTCompBufferFromFile D3DXLoadPRTCompBufferFromFileA -#endif - -//============================================================================ -// -// D3DXSavePRTCompBufferToFile: -// -------------------- -// Saves a PRTCompBuffer to disk. -// -// Parameters: -// pFilename -// Name of the file to save -// pBuffer -// Buffer that will be saved -// -//============================================================================ - -HRESULT WINAPI - D3DXSavePRTCompBufferToFileA( - LPCSTR pFileName, - LPD3DXPRTCOMPBUFFER pBuffer); - -HRESULT WINAPI - D3DXSavePRTCompBufferToFileW( - LPCWSTR pFileName, - LPD3DXPRTCOMPBUFFER pBuffer); - -#ifdef UNICODE -#define D3DXSavePRTCompBufferToFile D3DXSavePRTCompBufferToFileW -#else -#define D3DXSavePRTCompBufferToFile D3DXSavePRTCompBufferToFileA -#endif - -//============================================================================ -// -// D3DXCreatePRTCompBuffer: -// -------------------- -// Compresses a PRT buffer (vertex or texel) -// -// Parameters: -// D3DXSHCOMPRESSQUALITYTYPE -// Quality of compression - low is faster (computes PCA per voronoi cluster) -// high is slower but better quality (clusters based on distance to affine subspace) -// NumClusters -// Number of clusters to compute -// NumPCA -// Number of basis vectors to compute -// pCB -// Optional Callback function -// lpUserContext -// Optional user context -// pBufferIn -// Buffer that will be compressed -// ppBufferOut -// Compressed buffer that will be created -// -//============================================================================ - - -HRESULT WINAPI - D3DXCreatePRTCompBuffer( - D3DXSHCOMPRESSQUALITYTYPE Quality, - UINT NumClusters, - UINT NumPCA, - LPD3DXSHPRTSIMCB pCB, - LPVOID lpUserContext, - LPD3DXPRTBUFFER pBufferIn, - LPD3DXPRTCOMPBUFFER *ppBufferOut - ); - -//============================================================================ -// -// D3DXCreateTextureGutterHelper: -// -------------------- -// Generates a "GutterHelper" for a given set of meshes and texture -// resolution -// -// Parameters: -// Width -// Width of texture -// Height -// Height of texture -// pMesh -// Mesh that represents the scene -// GutterSize -// Number of texels to over rasterize in texture space -// this should be at least 1.0 -// ppBuffer -// GutterHelper that will be created -// -//============================================================================ - - -HRESULT WINAPI - D3DXCreateTextureGutterHelper( - UINT Width, - UINT Height, - LPD3DXMESH pMesh, - FLOAT GutterSize, - LPD3DXTEXTUREGUTTERHELPER* ppBuffer); - - -//============================================================================ -// -// D3DXCreatePRTEngine: -// -------------------- -// Computes a PRTEngine which can efficiently generate PRT simulations -// of a scene -// -// Parameters: -// pMesh -// Mesh that represents the scene - must have an AttributeTable -// where vertices are in a unique attribute. -// pAdjacency -// Optional adjacency information -// ExtractUVs -// Set this to true if textures are going to be used for albedos -// or to store PRT vectors -// pBlockerMesh -// Optional mesh that just blocks the scene -// ppEngine -// PRTEngine that will be created -// -//============================================================================ - - -HRESULT WINAPI - D3DXCreatePRTEngine( - LPD3DXMESH pMesh, - DWORD *pAdjacency, - BOOL ExtractUVs, - LPD3DXMESH pBlockerMesh, - LPD3DXPRTENGINE* ppEngine); - -//============================================================================ -// -// D3DXConcatenateMeshes: -// -------------------- -// Concatenates a group of meshes into one common mesh. This can optionaly transform -// each sub mesh or its texture coordinates. If no DECL is given it will -// generate a union of all of the DECL's of the sub meshes, promoting channels -// and types if neccesary. It will create an AttributeTable if possible, one can -// call OptimizeMesh with attribute sort and compacting enabled to ensure this. -// -// Parameters: -// ppMeshes -// Array of pointers to meshes that can store PRT vectors -// NumMeshes -// Number of meshes -// Options -// Passed through to D3DXCreateMesh -// pGeomXForms -// [optional] Each sub mesh is transformed by the corresponding -// matrix if this array is supplied -// pTextureXForms -// [optional] UV coordinates for each sub mesh are transformed -// by corresponding matrix if supplied -// pDecl -// [optional] Only information in this DECL is used when merging -// data -// pD3DDevice -// D3D device that is used to create the new mesh -// ppMeshOut -// Mesh that will be created -// -//============================================================================ - - -HRESULT WINAPI - D3DXConcatenateMeshes( - LPD3DXMESH *ppMeshes, - UINT NumMeshes, - DWORD Options, - CONST D3DXMATRIX *pGeomXForms, - CONST D3DXMATRIX *pTextureXForms, - CONST D3DVERTEXELEMENT9 *pDecl, - LPDIRECT3DDEVICE9 pD3DDevice, - LPD3DXMESH *ppMeshOut); - -//============================================================================ -// -// D3DXSHPRTCompSuperCluster: -// -------------------------- -// Used with compressed results of D3DXSHPRTSimulation. -// Generates "super clusters" - groups of clusters that can be drawn in -// the same draw call. A greedy algorithm that minimizes overdraw is used -// to group the clusters. -// -// Parameters: -// pClusterIDs -// NumVerts cluster ID's (extracted from a compressed buffer) -// pScene -// Mesh that represents composite scene passed to the simulator -// MaxNumClusters -// Maximum number of clusters allocated per super cluster -// NumClusters -// Number of clusters computed in the simulator -// pSuperClusterIDs -// Array of length NumClusters, contains index of super cluster -// that corresponding cluster was assigned to -// pNumSuperClusters -// Returns the number of super clusters allocated -// -//============================================================================ - -HRESULT WINAPI - D3DXSHPRTCompSuperCluster( - UINT *pClusterIDs, - LPD3DXMESH pScene, - UINT MaxNumClusters, - UINT NumClusters, - UINT *pSuperClusterIDs, - UINT *pNumSuperClusters); - -//============================================================================ -// -// D3DXSHPRTCompSplitMeshSC: -// ------------------------- -// Used with compressed results of the vertex version of the PRT simulator. -// After D3DXSHRTCompSuperCluster has been called this function can be used -// to split the mesh into a group of faces/vertices per super cluster. -// Each super cluster contains all of the faces that contain any vertex -// classified in one of its clusters. All of the vertices connected to this -// set of faces are also included with the returned array ppVertStatus -// indicating whether or not the vertex belongs to the supercluster. -// -// Parameters: -// pClusterIDs -// NumVerts cluster ID's (extracted from a compressed buffer) -// NumVertices -// Number of vertices in original mesh -// NumClusters -// Number of clusters (input parameter to compression) -// pSuperClusterIDs -// Array of size NumClusters that will contain super cluster ID's (from -// D3DXSHCompSuerCluster) -// NumSuperClusters -// Number of superclusters allocated in D3DXSHCompSuerCluster -// pInputIB -// Raw index buffer for mesh - format depends on bInputIBIs32Bit -// InputIBIs32Bit -// Indicates whether the input index buffer is 32-bit (otherwise 16-bit -// is assumed) -// NumFaces -// Number of faces in the original mesh (pInputIB is 3 times this length) -// ppIBData -// LPD3DXBUFFER holds raw index buffer that will contain the resulting split faces. -// Format determined by bIBIs32Bit. Allocated by function -// pIBDataLength -// Length of ppIBData, assigned in function -// OutputIBIs32Bit -// Indicates whether the output index buffer is to be 32-bit (otherwise -// 16-bit is assumed) -// ppFaceRemap -// LPD3DXBUFFER mapping of each face in ppIBData to original faces. Length is -// *pIBDataLength/3. Optional paramter, allocated in function -// ppVertData -// LPD3DXBUFFER contains new vertex data structure. Size of pVertDataLength -// pVertDataLength -// Number of new vertices in split mesh. Assigned in function -// pSCClusterList -// Array of length NumClusters which pSCData indexes into (Cluster* fields) -// for each SC, contains clusters sorted by super cluster -// pSCData -// Structure per super cluster - contains indices into ppIBData, -// pSCClusterList and ppVertData -// -//============================================================================ - -HRESULT WINAPI - D3DXSHPRTCompSplitMeshSC( - UINT *pClusterIDs, - UINT NumVertices, - UINT NumClusters, - UINT *pSuperClusterIDs, - UINT NumSuperClusters, - LPVOID pInputIB, - BOOL InputIBIs32Bit, - UINT NumFaces, - LPD3DXBUFFER *ppIBData, - UINT *pIBDataLength, - BOOL OutputIBIs32Bit, - LPD3DXBUFFER *ppFaceRemap, - LPD3DXBUFFER *ppVertData, - UINT *pVertDataLength, - UINT *pSCClusterList, - D3DXSHPRTSPLITMESHCLUSTERDATA *pSCData); - - -#ifdef __cplusplus -} -#endif //__cplusplus - -////////////////////////////////////////////////////////////////////////////// -// -// Definitions of .X file templates used by mesh load/save functions -// that are not RM standard -// -////////////////////////////////////////////////////////////////////////////// - -// {3CF169CE-FF7C-44ab-93C0-F78F62D172E2} -DEFINE_GUID(DXFILEOBJ_XSkinMeshHeader, -0x3cf169ce, 0xff7c, 0x44ab, 0x93, 0xc0, 0xf7, 0x8f, 0x62, 0xd1, 0x72, 0xe2); - -// {B8D65549-D7C9-4995-89CF-53A9A8B031E3} -DEFINE_GUID(DXFILEOBJ_VertexDuplicationIndices, -0xb8d65549, 0xd7c9, 0x4995, 0x89, 0xcf, 0x53, 0xa9, 0xa8, 0xb0, 0x31, 0xe3); - -// {A64C844A-E282-4756-8B80-250CDE04398C} -DEFINE_GUID(DXFILEOBJ_FaceAdjacency, -0xa64c844a, 0xe282, 0x4756, 0x8b, 0x80, 0x25, 0xc, 0xde, 0x4, 0x39, 0x8c); - -// {6F0D123B-BAD2-4167-A0D0-80224F25FABB} -DEFINE_GUID(DXFILEOBJ_SkinWeights, -0x6f0d123b, 0xbad2, 0x4167, 0xa0, 0xd0, 0x80, 0x22, 0x4f, 0x25, 0xfa, 0xbb); - -// {A3EB5D44-FC22-429d-9AFB-3221CB9719A6} -DEFINE_GUID(DXFILEOBJ_Patch, -0xa3eb5d44, 0xfc22, 0x429d, 0x9a, 0xfb, 0x32, 0x21, 0xcb, 0x97, 0x19, 0xa6); - -// {D02C95CC-EDBA-4305-9B5D-1820D7704BBF} -DEFINE_GUID(DXFILEOBJ_PatchMesh, -0xd02c95cc, 0xedba, 0x4305, 0x9b, 0x5d, 0x18, 0x20, 0xd7, 0x70, 0x4b, 0xbf); - -// {B9EC94E1-B9A6-4251-BA18-94893F02C0EA} -DEFINE_GUID(DXFILEOBJ_PatchMesh9, -0xb9ec94e1, 0xb9a6, 0x4251, 0xba, 0x18, 0x94, 0x89, 0x3f, 0x2, 0xc0, 0xea); - -// {B6C3E656-EC8B-4b92-9B62-681659522947} -DEFINE_GUID(DXFILEOBJ_PMInfo, -0xb6c3e656, 0xec8b, 0x4b92, 0x9b, 0x62, 0x68, 0x16, 0x59, 0x52, 0x29, 0x47); - -// {917E0427-C61E-4a14-9C64-AFE65F9E9844} -DEFINE_GUID(DXFILEOBJ_PMAttributeRange, -0x917e0427, 0xc61e, 0x4a14, 0x9c, 0x64, 0xaf, 0xe6, 0x5f, 0x9e, 0x98, 0x44); - -// {574CCC14-F0B3-4333-822D-93E8A8A08E4C} -DEFINE_GUID(DXFILEOBJ_PMVSplitRecord, -0x574ccc14, 0xf0b3, 0x4333, 0x82, 0x2d, 0x93, 0xe8, 0xa8, 0xa0, 0x8e, 0x4c); - -// {B6E70A0E-8EF9-4e83-94AD-ECC8B0C04897} -DEFINE_GUID(DXFILEOBJ_FVFData, -0xb6e70a0e, 0x8ef9, 0x4e83, 0x94, 0xad, 0xec, 0xc8, 0xb0, 0xc0, 0x48, 0x97); - -// {F752461C-1E23-48f6-B9F8-8350850F336F} -DEFINE_GUID(DXFILEOBJ_VertexElement, -0xf752461c, 0x1e23, 0x48f6, 0xb9, 0xf8, 0x83, 0x50, 0x85, 0xf, 0x33, 0x6f); - -// {BF22E553-292C-4781-9FEA-62BD554BDD93} -DEFINE_GUID(DXFILEOBJ_DeclData, -0xbf22e553, 0x292c, 0x4781, 0x9f, 0xea, 0x62, 0xbd, 0x55, 0x4b, 0xdd, 0x93); - -// {F1CFE2B3-0DE3-4e28-AFA1-155A750A282D} -DEFINE_GUID(DXFILEOBJ_EffectFloats, -0xf1cfe2b3, 0xde3, 0x4e28, 0xaf, 0xa1, 0x15, 0x5a, 0x75, 0xa, 0x28, 0x2d); - -// {D55B097E-BDB6-4c52-B03D-6051C89D0E42} -DEFINE_GUID(DXFILEOBJ_EffectString, -0xd55b097e, 0xbdb6, 0x4c52, 0xb0, 0x3d, 0x60, 0x51, 0xc8, 0x9d, 0xe, 0x42); - -// {622C0ED0-956E-4da9-908A-2AF94F3CE716} -DEFINE_GUID(DXFILEOBJ_EffectDWord, -0x622c0ed0, 0x956e, 0x4da9, 0x90, 0x8a, 0x2a, 0xf9, 0x4f, 0x3c, 0xe7, 0x16); - -// {3014B9A0-62F5-478c-9B86-E4AC9F4E418B} -DEFINE_GUID(DXFILEOBJ_EffectParamFloats, -0x3014b9a0, 0x62f5, 0x478c, 0x9b, 0x86, 0xe4, 0xac, 0x9f, 0x4e, 0x41, 0x8b); - -// {1DBC4C88-94C1-46ee-9076-2C28818C9481} -DEFINE_GUID(DXFILEOBJ_EffectParamString, -0x1dbc4c88, 0x94c1, 0x46ee, 0x90, 0x76, 0x2c, 0x28, 0x81, 0x8c, 0x94, 0x81); - -// {E13963BC-AE51-4c5d-B00F-CFA3A9D97CE5} -DEFINE_GUID(DXFILEOBJ_EffectParamDWord, -0xe13963bc, 0xae51, 0x4c5d, 0xb0, 0xf, 0xcf, 0xa3, 0xa9, 0xd9, 0x7c, 0xe5); - -// {E331F7E4-0559-4cc2-8E99-1CEC1657928F} -DEFINE_GUID(DXFILEOBJ_EffectInstance, -0xe331f7e4, 0x559, 0x4cc2, 0x8e, 0x99, 0x1c, 0xec, 0x16, 0x57, 0x92, 0x8f); - -// {9E415A43-7BA6-4a73-8743-B73D47E88476} -DEFINE_GUID(DXFILEOBJ_AnimTicksPerSecond, -0x9e415a43, 0x7ba6, 0x4a73, 0x87, 0x43, 0xb7, 0x3d, 0x47, 0xe8, 0x84, 0x76); - -// {7F9B00B3-F125-4890-876E-1CFFBF697C4D} -DEFINE_GUID(DXFILEOBJ_CompressedAnimationSet, -0x7f9b00b3, 0xf125, 0x4890, 0x87, 0x6e, 0x1c, 0x42, 0xbf, 0x69, 0x7c, 0x4d); - -#pragma pack(push, 1) -typedef struct _XFILECOMPRESSEDANIMATIONSET -{ - DWORD CompressedBlockSize; - FLOAT TicksPerSec; - DWORD PlaybackType; - DWORD BufferLength; -} XFILECOMPRESSEDANIMATIONSET; -#pragma pack(pop) - -#define XSKINEXP_TEMPLATES \ - "xof 0303txt 0032\ - template XSkinMeshHeader \ - { \ - <3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \ - WORD nMaxSkinWeightsPerVertex; \ - WORD nMaxSkinWeightsPerFace; \ - WORD nBones; \ - } \ - template VertexDuplicationIndices \ - { \ - \ - DWORD nIndices; \ - DWORD nOriginalVertices; \ - array DWORD indices[nIndices]; \ - } \ - template FaceAdjacency \ - { \ - \ - DWORD nIndices; \ - array DWORD indices[nIndices]; \ - } \ - template SkinWeights \ - { \ - <6F0D123B-BAD2-4167-A0D0-80224F25FABB> \ - STRING transformNodeName; \ - DWORD nWeights; \ - array DWORD vertexIndices[nWeights]; \ - array float weights[nWeights]; \ - Matrix4x4 matrixOffset; \ - } \ - template Patch \ - { \ - \ - DWORD nControlIndices; \ - array DWORD controlIndices[nControlIndices]; \ - } \ - template PatchMesh \ - { \ - \ - DWORD nVertices; \ - array Vector vertices[nVertices]; \ - DWORD nPatches; \ - array Patch patches[nPatches]; \ - [ ... ] \ - } \ - template PatchMesh9 \ - { \ - \ - DWORD Type; \ - DWORD Degree; \ - DWORD Basis; \ - DWORD nVertices; \ - array Vector vertices[nVertices]; \ - DWORD nPatches; \ - array Patch patches[nPatches]; \ - [ ... ] \ - } " \ - "template EffectFloats \ - { \ - \ - DWORD nFloats; \ - array float Floats[nFloats]; \ - } \ - template EffectString \ - { \ - \ - STRING Value; \ - } \ - template EffectDWord \ - { \ - <622C0ED0-956E-4da9-908A-2AF94F3CE716> \ - DWORD Value; \ - } " \ - "template EffectParamFloats \ - { \ - <3014B9A0-62F5-478c-9B86-E4AC9F4E418B> \ - STRING ParamName; \ - DWORD nFloats; \ - array float Floats[nFloats]; \ - } " \ - "template EffectParamString \ - { \ - <1DBC4C88-94C1-46ee-9076-2C28818C9481> \ - STRING ParamName; \ - STRING Value; \ - } \ - template EffectParamDWord \ - { \ - \ - STRING ParamName; \ - DWORD Value; \ - } \ - template EffectInstance \ - { \ - \ - STRING EffectFilename; \ - [ ... ] \ - } " \ - "template AnimTicksPerSecond \ - { \ - <9E415A43-7BA6-4a73-8743-B73D47E88476> \ - DWORD AnimTicksPerSecond; \ - } \ - template CompressedAnimationSet \ - { \ - <7F9B00B3-F125-4890-876E-1C42BF697C4D> \ - DWORD CompressedBlockSize; \ - FLOAT TicksPerSec; \ - DWORD PlaybackType; \ - DWORD BufferLength; \ - array DWORD CompressedData[BufferLength]; \ - } " - -#define XEXTENSIONS_TEMPLATES \ - "xof 0303txt 0032\ - template FVFData \ - { \ - \ - DWORD dwFVF; \ - DWORD nDWords; \ - array DWORD data[nDWords]; \ - } \ - template VertexElement \ - { \ - \ - DWORD Type; \ - DWORD Method; \ - DWORD Usage; \ - DWORD UsageIndex; \ - } \ - template DeclData \ - { \ - \ - DWORD nElements; \ - array VertexElement Elements[nElements]; \ - DWORD nDWords; \ - array DWORD data[nDWords]; \ - } \ - template PMAttributeRange \ - { \ - <917E0427-C61E-4a14-9C64-AFE65F9E9844> \ - DWORD iFaceOffset; \ - DWORD nFacesMin; \ - DWORD nFacesMax; \ - DWORD iVertexOffset; \ - DWORD nVerticesMin; \ - DWORD nVerticesMax; \ - } \ - template PMVSplitRecord \ - { \ - <574CCC14-F0B3-4333-822D-93E8A8A08E4C> \ - DWORD iFaceCLW; \ - DWORD iVlrOffset; \ - DWORD iCode; \ - } \ - template PMInfo \ - { \ - \ - DWORD nAttributes; \ - array PMAttributeRange attributeRanges[nAttributes]; \ - DWORD nMaxValence; \ - DWORD nMinLogicalVertices; \ - DWORD nMaxLogicalVertices; \ - DWORD nVSplits; \ - array PMVSplitRecord splitRecords[nVSplits]; \ - DWORD nAttributeMispredicts; \ - array DWORD attributeMispredicts[nAttributeMispredicts]; \ - } " - -#endif //__D3DX9MESH_H__ - - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9shader.h b/jan/src/dep/mingw/include/directx9/d3dx9shader.h deleted file mode 100644 index 5ed3f01dc..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9shader.h +++ /dev/null @@ -1,1010 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// File: d3dx9shader.h -// Content: D3DX Shader APIs -// -////////////////////////////////////////////////////////////////////////////// - -#include "d3dx9.h" - -#ifndef __D3DX9SHADER_H__ -#define __D3DX9SHADER_H__ - - -//--------------------------------------------------------------------------- -// D3DXTX_VERSION: -// -------------- -// Version token used to create a procedural texture filler in effects -// Used by D3DXFill[]TX functions -//--------------------------------------------------------------------------- -#define D3DXTX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor)) - - - -//---------------------------------------------------------------------------- -// D3DXSHADER flags: -// ----------------- -// D3DXSHADER_DEBUG -// Insert debug file/line/type/symbol information. -// -// D3DXSHADER_SKIPVALIDATION -// Do not validate the generated code against known capabilities and -// constraints. This option is only recommended when compiling shaders -// you KNOW will work. (ie. have compiled before without this option.) -// Shaders are always validated by D3D before they are set to the device. -// -// D3DXSHADER_SKIPOPTIMIZATION -// Instructs the compiler to skip optimization steps during code generation. -// Unless you are trying to isolate a problem in your code using this option -// is not recommended. -// -// D3DXSHADER_PACKMATRIX_ROWMAJOR -// Unless explicitly specified, matrices will be packed in row-major order -// on input and output from the shader. -// -// D3DXSHADER_PACKMATRIX_COLUMNMAJOR -// Unless explicitly specified, matrices will be packed in column-major -// order on input and output from the shader. This is generally more -// efficient, since it allows vector-matrix multiplication to be performed -// using a series of dot-products. -// -// D3DXSHADER_PARTIALPRECISION -// Force all computations in resulting shader to occur at partial precision. -// This may result in faster evaluation of shaders on some hardware. -// -// D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT -// Force compiler to compile against the next highest available software -// target for vertex shaders. This flag also turns optimizations off, -// and debugging on. -// -// D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT -// Force compiler to compile against the next highest available software -// target for pixel shaders. This flag also turns optimizations off, -// and debugging on. -// -// D3DXSHADER_NO_PRESHADER -// Disables Preshaders. Using this flag will cause the compiler to not -// pull out static expression for evaluation on the host cpu -// -// D3DXSHADER_AVOID_FLOW_CONTROL -// Hint compiler to avoid flow-control constructs where possible. -// -// D3DXSHADER_PREFER_FLOW_CONTROL -// Hint compiler to prefer flow-control constructs where possible. -// -//---------------------------------------------------------------------------- - -#define D3DXSHADER_DEBUG (1 << 0) -#define D3DXSHADER_SKIPVALIDATION (1 << 1) -#define D3DXSHADER_SKIPOPTIMIZATION (1 << 2) -#define D3DXSHADER_PACKMATRIX_ROWMAJOR (1 << 3) -#define D3DXSHADER_PACKMATRIX_COLUMNMAJOR (1 << 4) -#define D3DXSHADER_PARTIALPRECISION (1 << 5) -#define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT (1 << 6) -#define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT (1 << 7) -#define D3DXSHADER_NO_PRESHADER (1 << 8) -#define D3DXSHADER_AVOID_FLOW_CONTROL (1 << 9) -#define D3DXSHADER_PREFER_FLOW_CONTROL (1 << 10) -#define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12) -#define D3DXSHADER_IEEE_STRICTNESS (1 << 13) -#define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL (1 << 16) - - -// optimization level flags -#define D3DXSHADER_OPTIMIZATION_LEVEL0 (1 << 14) -#define D3DXSHADER_OPTIMIZATION_LEVEL1 0 -#define D3DXSHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15)) -#define D3DXSHADER_OPTIMIZATION_LEVEL3 (1 << 15) - - - -//---------------------------------------------------------------------------- -// D3DXCONSTTABLE flags: -// ------------------- - -#define D3DXCONSTTABLE_LARGEADDRESSAWARE (1 << 17) - - - -//---------------------------------------------------------------------------- -// D3DXHANDLE: -// ----------- -// Handle values used to efficiently reference shader and effect parameters. -// Strings can be used as handles. However, handles are not always strings. -//---------------------------------------------------------------------------- - -#ifndef D3DXFX_LARGEADDRESS_HANDLE -typedef LPCSTR D3DXHANDLE; -#else -typedef UINT_PTR D3DXHANDLE; -#endif -typedef D3DXHANDLE *LPD3DXHANDLE; - - -//---------------------------------------------------------------------------- -// D3DXMACRO: -// ---------- -// Preprocessor macro definition. The application pass in a NULL-terminated -// array of this structure to various D3DX APIs. This enables the application -// to #define tokens at runtime, before the file is parsed. -//---------------------------------------------------------------------------- - -typedef struct _D3DXMACRO -{ - LPCSTR Name; - LPCSTR Definition; - -} D3DXMACRO, *LPD3DXMACRO; - - -//---------------------------------------------------------------------------- -// D3DXSEMANTIC: -//---------------------------------------------------------------------------- - -typedef struct _D3DXSEMANTIC -{ - UINT Usage; - UINT UsageIndex; - -} D3DXSEMANTIC, *LPD3DXSEMANTIC; - - - -//---------------------------------------------------------------------------- -// D3DXREGISTER_SET: -//---------------------------------------------------------------------------- - -typedef enum _D3DXREGISTER_SET -{ - D3DXRS_BOOL, - D3DXRS_INT4, - D3DXRS_FLOAT4, - D3DXRS_SAMPLER, - - // force 32-bit size enum - D3DXRS_FORCE_DWORD = 0x7fffffff - -} D3DXREGISTER_SET, *LPD3DXREGISTER_SET; - - -//---------------------------------------------------------------------------- -// D3DXPARAMETER_CLASS: -//---------------------------------------------------------------------------- - -typedef enum _D3DXPARAMETER_CLASS -{ - D3DXPC_SCALAR, - D3DXPC_VECTOR, - D3DXPC_MATRIX_ROWS, - D3DXPC_MATRIX_COLUMNS, - D3DXPC_OBJECT, - D3DXPC_STRUCT, - - // force 32-bit size enum - D3DXPC_FORCE_DWORD = 0x7fffffff - -} D3DXPARAMETER_CLASS, *LPD3DXPARAMETER_CLASS; - - -//---------------------------------------------------------------------------- -// D3DXPARAMETER_TYPE: -//---------------------------------------------------------------------------- - -typedef enum _D3DXPARAMETER_TYPE -{ - D3DXPT_VOID, - D3DXPT_BOOL, - D3DXPT_INT, - D3DXPT_FLOAT, - D3DXPT_STRING, - D3DXPT_TEXTURE, - D3DXPT_TEXTURE1D, - D3DXPT_TEXTURE2D, - D3DXPT_TEXTURE3D, - D3DXPT_TEXTURECUBE, - D3DXPT_SAMPLER, - D3DXPT_SAMPLER1D, - D3DXPT_SAMPLER2D, - D3DXPT_SAMPLER3D, - D3DXPT_SAMPLERCUBE, - D3DXPT_PIXELSHADER, - D3DXPT_VERTEXSHADER, - D3DXPT_PIXELFRAGMENT, - D3DXPT_VERTEXFRAGMENT, - D3DXPT_UNSUPPORTED, - - // force 32-bit size enum - D3DXPT_FORCE_DWORD = 0x7fffffff - -} D3DXPARAMETER_TYPE, *LPD3DXPARAMETER_TYPE; - - -//---------------------------------------------------------------------------- -// D3DXCONSTANTTABLE_DESC: -//---------------------------------------------------------------------------- - -typedef struct _D3DXCONSTANTTABLE_DESC -{ - LPCSTR Creator; // Creator string - DWORD Version; // Shader version - UINT Constants; // Number of constants - -} D3DXCONSTANTTABLE_DESC, *LPD3DXCONSTANTTABLE_DESC; - - -//---------------------------------------------------------------------------- -// D3DXCONSTANT_DESC: -//---------------------------------------------------------------------------- - -typedef struct _D3DXCONSTANT_DESC -{ - LPCSTR Name; // Constant name - - D3DXREGISTER_SET RegisterSet; // Register set - UINT RegisterIndex; // Register index - UINT RegisterCount; // Number of registers occupied - - D3DXPARAMETER_CLASS Class; // Class - D3DXPARAMETER_TYPE Type; // Component type - - UINT Rows; // Number of rows - UINT Columns; // Number of columns - UINT Elements; // Number of array elements - UINT StructMembers; // Number of structure member sub-parameters - - UINT Bytes; // Data size, in bytes - LPCVOID DefaultValue; // Pointer to default value - -} D3DXCONSTANT_DESC, *LPD3DXCONSTANT_DESC; - - - -//---------------------------------------------------------------------------- -// ID3DXConstantTable: -//---------------------------------------------------------------------------- - -typedef interface ID3DXConstantTable ID3DXConstantTable; -typedef interface ID3DXConstantTable *LPD3DXCONSTANTTABLE; - -// {AB3C758F-093E-4356-B762-4DB18F1B3A01} -DEFINE_GUID(IID_ID3DXConstantTable, -0xab3c758f, 0x93e, 0x4356, 0xb7, 0x62, 0x4d, 0xb1, 0x8f, 0x1b, 0x3a, 0x1); - - -#undef INTERFACE -#define INTERFACE ID3DXConstantTable - -DECLARE_INTERFACE_(ID3DXConstantTable, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Buffer - STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; - STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; - - // Descs - STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE; - STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE; - STDMETHOD_(UINT, GetSamplerIndex)(THIS_ D3DXHANDLE hConstant) PURE; - - // Handle operations - STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; - - // Set Constants - STDMETHOD(SetDefaults)(THIS_ LPDIRECT3DDEVICE9 pDevice) PURE; - STDMETHOD(SetValue)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE; - STDMETHOD(SetBool)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, BOOL b) PURE; - STDMETHOD(SetBoolArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE; - STDMETHOD(SetInt)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, INT n) PURE; - STDMETHOD(SetIntArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE; - STDMETHOD(SetFloat)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, FLOAT f) PURE; - STDMETHOD(SetFloatArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE; - STDMETHOD(SetVector)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE; - STDMETHOD(SetVectorArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE; - STDMETHOD(SetMatrix)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixPointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTranspose)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixTransposeArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTransposePointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; -}; - - -//---------------------------------------------------------------------------- -// ID3DXTextureShader: -//---------------------------------------------------------------------------- - -typedef interface ID3DXTextureShader ID3DXTextureShader; -typedef interface ID3DXTextureShader *LPD3DXTEXTURESHADER; - -// {3E3D67F8-AA7A-405d-A857-BA01D4758426} -DEFINE_GUID(IID_ID3DXTextureShader, -0x3e3d67f8, 0xaa7a, 0x405d, 0xa8, 0x57, 0xba, 0x1, 0xd4, 0x75, 0x84, 0x26); - -#undef INTERFACE -#define INTERFACE ID3DXTextureShader - -DECLARE_INTERFACE_(ID3DXTextureShader, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // Gets - STDMETHOD(GetFunction)(THIS_ LPD3DXBUFFER *ppFunction) PURE; - STDMETHOD(GetConstantBuffer)(THIS_ LPD3DXBUFFER *ppConstantBuffer) PURE; - - // Descs - STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE; - STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE; - - // Handle operations - STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE; - STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; - - // Set Constants - STDMETHOD(SetDefaults)(THIS) PURE; - STDMETHOD(SetValue)(THIS_ D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE; - STDMETHOD(SetBool)(THIS_ D3DXHANDLE hConstant, BOOL b) PURE; - STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE; - STDMETHOD(SetInt)(THIS_ D3DXHANDLE hConstant, INT n) PURE; - STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE; - STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hConstant, FLOAT f) PURE; - STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE; - STDMETHOD(SetVector)(THIS_ D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE; - STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE; - STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; - STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; -}; - - -//---------------------------------------------------------------------------- -// D3DXINCLUDE_TYPE: -//---------------------------------------------------------------------------- - -typedef enum _D3DXINCLUDE_TYPE -{ - D3DXINC_LOCAL, - D3DXINC_SYSTEM, - - // force 32-bit size enum - D3DXINC_FORCE_DWORD = 0x7fffffff - -} D3DXINCLUDE_TYPE, *LPD3DXINCLUDE_TYPE; - - -//---------------------------------------------------------------------------- -// ID3DXInclude: -// ------------- -// This interface is intended to be implemented by the application, and can -// be used by various D3DX APIs. This enables application-specific handling -// of #include directives in source files. -// -// Open() -// Opens an include file. If successful, it should fill in ppData and -// pBytes. The data pointer returned must remain valid until Close is -// subsequently called. The name of the file is encoded in UTF-8 format. -// Close() -// Closes an include file. If Open was successful, Close is guaranteed -// to be called before the API using this interface returns. -//---------------------------------------------------------------------------- - -typedef interface ID3DXInclude ID3DXInclude; -typedef interface ID3DXInclude *LPD3DXINCLUDE; - -#undef INTERFACE -#define INTERFACE ID3DXInclude - -DECLARE_INTERFACE(ID3DXInclude) -{ - STDMETHOD(Open)(THIS_ D3DXINCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE; - STDMETHOD(Close)(THIS_ LPCVOID pData) PURE; -}; - - -////////////////////////////////////////////////////////////////////////////// -// APIs ////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -//---------------------------------------------------------------------------- -// D3DXAssembleShader: -// ------------------- -// Assembles a shader. -// -// Parameters: -// pSrcFile -// Source file name -// hSrcModule -// Module handle. if NULL, current module will be used -// pSrcResource -// Resource name in module -// pSrcData -// Pointer to source code -// SrcDataLen -// Size of source code, in bytes -// pDefines -// Optional NULL-terminated array of preprocessor macro definitions. -// pInclude -// Optional interface pointer to use for handling #include directives. -// If this parameter is NULL, #includes will be honored when assembling -// from file, and will error when assembling from resource or memory. -// Flags -// See D3DXSHADER_xxx flags -// ppShader -// Returns a buffer containing the created shader. This buffer contains -// the assembled shader code, as well as any embedded debug info. -// ppErrorMsgs -// Returns a buffer containing a listing of errors and warnings that were -// encountered during assembly. If you are running in a debugger, -// these are the same messages you will see in your debug output. -//---------------------------------------------------------------------------- - - -HRESULT WINAPI - D3DXAssembleShaderFromFileA( - LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - -HRESULT WINAPI - D3DXAssembleShaderFromFileW( - LPCWSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - -#ifdef UNICODE -#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileW -#else -#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileA -#endif - - -HRESULT WINAPI - D3DXAssembleShaderFromResourceA( - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - -HRESULT WINAPI - D3DXAssembleShaderFromResourceW( - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - -#ifdef UNICODE -#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceW -#else -#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceA -#endif - - -HRESULT WINAPI - D3DXAssembleShader( - LPCSTR pSrcData, - UINT SrcDataLen, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - - - -//---------------------------------------------------------------------------- -// D3DXCompileShader: -// ------------------ -// Compiles a shader. -// -// Parameters: -// pSrcFile -// Source file name. -// hSrcModule -// Module handle. if NULL, current module will be used. -// pSrcResource -// Resource name in module. -// pSrcData -// Pointer to source code. -// SrcDataLen -// Size of source code, in bytes. -// pDefines -// Optional NULL-terminated array of preprocessor macro definitions. -// pInclude -// Optional interface pointer to use for handling #include directives. -// If this parameter is NULL, #includes will be honored when compiling -// from file, and will error when compiling from resource or memory. -// pFunctionName -// Name of the entrypoint function where execution should begin. -// pProfile -// Instruction set to be used when generating code. Currently supported -// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "ps_1_1", -// "ps_1_2", "ps_1_3", "ps_1_4", "ps_2_0", "ps_2_a", "ps_2_sw", "tx_1_0" -// Flags -// See D3DXSHADER_xxx flags. -// ppShader -// Returns a buffer containing the created shader. This buffer contains -// the compiled shader code, as well as any embedded debug and symbol -// table info. (See D3DXGetShaderConstantTable) -// ppErrorMsgs -// Returns a buffer containing a listing of errors and warnings that were -// encountered during the compile. If you are running in a debugger, -// these are the same messages you will see in your debug output. -// ppConstantTable -// Returns a ID3DXConstantTable object which can be used to set -// shader constants to the device. Alternatively, an application can -// parse the D3DXSHADER_CONSTANTTABLE block embedded as a comment within -// the shader. -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCompileShaderFromFileA( - LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pFunctionName, - LPCSTR pProfile, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs, - LPD3DXCONSTANTTABLE* ppConstantTable); - -HRESULT WINAPI - D3DXCompileShaderFromFileW( - LPCWSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pFunctionName, - LPCSTR pProfile, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs, - LPD3DXCONSTANTTABLE* ppConstantTable); - -#ifdef UNICODE -#define D3DXCompileShaderFromFile D3DXCompileShaderFromFileW -#else -#define D3DXCompileShaderFromFile D3DXCompileShaderFromFileA -#endif - - -HRESULT WINAPI - D3DXCompileShaderFromResourceA( - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pFunctionName, - LPCSTR pProfile, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs, - LPD3DXCONSTANTTABLE* ppConstantTable); - -HRESULT WINAPI - D3DXCompileShaderFromResourceW( - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pFunctionName, - LPCSTR pProfile, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs, - LPD3DXCONSTANTTABLE* ppConstantTable); - -#ifdef UNICODE -#define D3DXCompileShaderFromResource D3DXCompileShaderFromResourceW -#else -#define D3DXCompileShaderFromResource D3DXCompileShaderFromResourceA -#endif - - -HRESULT WINAPI - D3DXCompileShader( - LPCSTR pSrcData, - UINT SrcDataLen, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPCSTR pFunctionName, - LPCSTR pProfile, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs, - LPD3DXCONSTANTTABLE* ppConstantTable); - - -//---------------------------------------------------------------------------- -// D3DXDisassembleShader: -// ---------------------- -// Takes a binary shader, and returns a buffer containing text assembly. -// -// Parameters: -// pShader -// Pointer to the shader byte code. -// ShaderSizeInBytes -// Size of the shader byte code in bytes. -// EnableColorCode -// Emit HTML tags for color coding the output? -// pComments -// Pointer to a comment string to include at the top of the shader. -// ppDisassembly -// Returns a buffer containing the disassembled shader. -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXDisassembleShader( - CONST DWORD* pShader, - BOOL EnableColorCode, - LPCSTR pComments, - LPD3DXBUFFER* ppDisassembly); - - -//---------------------------------------------------------------------------- -// D3DXGetPixelShaderProfile/D3DXGetVertexShaderProfile: -// ----------------------------------------------------- -// Returns the name of the HLSL profile best suited to a given device. -// -// Parameters: -// pDevice -// Pointer to the device in question -//---------------------------------------------------------------------------- - -LPCSTR WINAPI - D3DXGetPixelShaderProfile( - LPDIRECT3DDEVICE9 pDevice); - -LPCSTR WINAPI - D3DXGetVertexShaderProfile( - LPDIRECT3DDEVICE9 pDevice); - - -//---------------------------------------------------------------------------- -// D3DXFindShaderComment: -// ---------------------- -// Searches through a shader for a particular comment, denoted by a FourCC in -// the first DWORD of the comment. If the comment is not found, and no other -// error has occurred, S_FALSE is returned. -// -// Parameters: -// pFunction -// Pointer to the function DWORD stream -// FourCC -// FourCC used to identify the desired comment block. -// ppData -// Returns a pointer to the comment data (not including comment token -// and FourCC). Can be NULL. -// pSizeInBytes -// Returns the size of the comment data in bytes. Can be NULL. -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXFindShaderComment( - CONST DWORD* pFunction, - DWORD FourCC, - LPCVOID* ppData, - UINT* pSizeInBytes); - - -//---------------------------------------------------------------------------- -// D3DXGetShaderSize: -// ------------------ -// Returns the size of the shader byte-code, in bytes. -// -// Parameters: -// pFunction -// Pointer to the function DWORD stream -//---------------------------------------------------------------------------- - -UINT WINAPI - D3DXGetShaderSize( - CONST DWORD* pFunction); - - -//---------------------------------------------------------------------------- -// D3DXGetShaderVersion: -// ----------------------- -// Returns the shader version of a given shader. Returns zero if the shader -// function is NULL. -// -// Parameters: -// pFunction -// Pointer to the function DWORD stream -//---------------------------------------------------------------------------- - -DWORD WINAPI - D3DXGetShaderVersion( - CONST DWORD* pFunction); - -//---------------------------------------------------------------------------- -// D3DXGetShaderSemantics: -// ----------------------- -// Gets semantics for all input elements referenced inside a given shader. -// -// Parameters: -// pFunction -// Pointer to the function DWORD stream -// pSemantics -// Pointer to an array of D3DXSEMANTIC structures. The function will -// fill this array with the semantics for each input element referenced -// inside the shader. This array is assumed to contain at least -// MAXD3DDECLLENGTH elements. -// pCount -// Returns the number of elements referenced by the shader -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXGetShaderInputSemantics( - CONST DWORD* pFunction, - D3DXSEMANTIC* pSemantics, - UINT* pCount); - -HRESULT WINAPI - D3DXGetShaderOutputSemantics( - CONST DWORD* pFunction, - D3DXSEMANTIC* pSemantics, - UINT* pCount); - - -//---------------------------------------------------------------------------- -// D3DXGetShaderSamplers: -// ---------------------- -// Gets semantics for all input elements referenced inside a given shader. -// -// pFunction -// Pointer to the function DWORD stream -// pSamplers -// Pointer to an array of LPCSTRs. The function will fill this array -// with pointers to the sampler names contained within pFunction, for -// each sampler referenced inside the shader. This array is assumed to -// contain at least 16 elements. -// pCount -// Returns the number of samplers referenced by the shader -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXGetShaderSamplers( - CONST DWORD* pFunction, - LPCSTR* pSamplers, - UINT* pCount); - - -//---------------------------------------------------------------------------- -// D3DXGetShaderConstantTable: -// --------------------------- -// Gets shader constant table embedded inside shader. A constant table is -// generated by D3DXAssembleShader and D3DXCompileShader, and is embedded in -// the body of the shader. -// -// Parameters: -// pFunction -// Pointer to the function DWORD stream -// Flags -// See D3DXCONSTTABLE_xxx -// ppConstantTable -// Returns a ID3DXConstantTable object which can be used to set -// shader constants to the device. Alternatively, an application can -// parse the D3DXSHADER_CONSTANTTABLE block embedded as a comment within -// the shader. -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXGetShaderConstantTable( - CONST DWORD* pFunction, - LPD3DXCONSTANTTABLE* ppConstantTable); - -HRESULT WINAPI - D3DXGetShaderConstantTableEx( - CONST DWORD* pFunction, - DWORD Flags, - LPD3DXCONSTANTTABLE* ppConstantTable); - - - -//---------------------------------------------------------------------------- -// D3DXCreateTextureShader: -// ------------------------ -// Creates a texture shader object, given the compiled shader. -// -// Parameters -// pFunction -// Pointer to the function DWORD stream -// ppTextureShader -// Returns a ID3DXTextureShader object which can be used to procedurally -// fill the contents of a texture using the D3DXFillTextureTX functions. -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCreateTextureShader( - CONST DWORD* pFunction, - LPD3DXTEXTURESHADER* ppTextureShader); - - -//---------------------------------------------------------------------------- -// D3DXPreprocessShader: -// --------------------- -// Runs the preprocessor on the specified shader or effect, but does -// not actually compile it. This is useful for evaluating the #includes -// and #defines in a shader and then emitting a reformatted token stream -// for debugging purposes or for generating a self-contained shader. -// -// Parameters: -// pSrcFile -// Source file name -// hSrcModule -// Module handle. if NULL, current module will be used -// pSrcResource -// Resource name in module -// pSrcData -// Pointer to source code -// SrcDataLen -// Size of source code, in bytes -// pDefines -// Optional NULL-terminated array of preprocessor macro definitions. -// pInclude -// Optional interface pointer to use for handling #include directives. -// If this parameter is NULL, #includes will be honored when assembling -// from file, and will error when assembling from resource or memory. -// ppShaderText -// Returns a buffer containing a single large string that represents -// the resulting formatted token stream -// ppErrorMsgs -// Returns a buffer containing a listing of errors and warnings that were -// encountered during assembly. If you are running in a debugger, -// these are the same messages you will see in your debug output. -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXPreprocessShaderFromFileA( - LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPD3DXBUFFER* ppShaderText, - LPD3DXBUFFER* ppErrorMsgs); - -HRESULT WINAPI - D3DXPreprocessShaderFromFileW( - LPCWSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPD3DXBUFFER* ppShaderText, - LPD3DXBUFFER* ppErrorMsgs); - -#ifdef UNICODE -#define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileW -#else -#define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileA -#endif - -HRESULT WINAPI - D3DXPreprocessShaderFromResourceA( - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPD3DXBUFFER* ppShaderText, - LPD3DXBUFFER* ppErrorMsgs); - -HRESULT WINAPI - D3DXPreprocessShaderFromResourceW( - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPD3DXBUFFER* ppShaderText, - LPD3DXBUFFER* ppErrorMsgs); - -#ifdef UNICODE -#define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceW -#else -#define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceA -#endif - -HRESULT WINAPI - D3DXPreprocessShader( - LPCSTR pSrcData, - UINT SrcDataSize, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - LPD3DXBUFFER* ppShaderText, - LPD3DXBUFFER* ppErrorMsgs); - - -#ifdef __cplusplus -} -#endif //__cplusplus - - -////////////////////////////////////////////////////////////////////////////// -// Shader comment block layouts ////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DXSHADER_CONSTANTTABLE: -// ------------------------- -// Shader constant information; included as an CTAB comment block inside -// shaders. All offsets are BYTE offsets from start of CONSTANTTABLE struct. -// Entries in the table are sorted by Name in ascending order. -//---------------------------------------------------------------------------- - -typedef struct _D3DXSHADER_CONSTANTTABLE -{ - DWORD Size; // sizeof(D3DXSHADER_CONSTANTTABLE) - DWORD Creator; // LPCSTR offset - DWORD Version; // shader version - DWORD Constants; // number of constants - DWORD ConstantInfo; // D3DXSHADER_CONSTANTINFO[Constants] offset - DWORD Flags; // flags shader was compiled with - DWORD Target; // LPCSTR offset - -} D3DXSHADER_CONSTANTTABLE, *LPD3DXSHADER_CONSTANTTABLE; - - -typedef struct _D3DXSHADER_CONSTANTINFO -{ - DWORD Name; // LPCSTR offset - WORD RegisterSet; // D3DXREGISTER_SET - WORD RegisterIndex; // register number - WORD RegisterCount; // number of registers - WORD Reserved; // reserved - DWORD TypeInfo; // D3DXSHADER_TYPEINFO offset - DWORD DefaultValue; // offset of default value - -} D3DXSHADER_CONSTANTINFO, *LPD3DXSHADER_CONSTANTINFO; - - -typedef struct _D3DXSHADER_TYPEINFO -{ - WORD Class; // D3DXPARAMETER_CLASS - WORD Type; // D3DXPARAMETER_TYPE - WORD Rows; // number of rows (matrices) - WORD Columns; // number of columns (vectors and matrices) - WORD Elements; // array dimension - WORD StructMembers; // number of struct members - DWORD StructMemberInfo; // D3DXSHADER_STRUCTMEMBERINFO[Members] offset - -} D3DXSHADER_TYPEINFO, *LPD3DXSHADER_TYPEINFO; - - -typedef struct _D3DXSHADER_STRUCTMEMBERINFO -{ - DWORD Name; // LPCSTR offset - DWORD TypeInfo; // D3DXSHADER_TYPEINFO offset - -} D3DXSHADER_STRUCTMEMBERINFO, *LPD3DXSHADER_STRUCTMEMBERINFO; - - - -#endif //__D3DX9SHADER_H__ - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9shape.h b/jan/src/dep/mingw/include/directx9/d3dx9shape.h deleted file mode 100644 index 4c2309156..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9shape.h +++ /dev/null @@ -1,221 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9shapes.h -// Content: D3DX simple shapes -// -/////////////////////////////////////////////////////////////////////////// - -#include "d3dx9.h" - -#ifndef __D3DX9SHAPES_H__ -#define __D3DX9SHAPES_H__ - -/////////////////////////////////////////////////////////////////////////// -// Functions: -/////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -//------------------------------------------------------------------------- -// D3DXCreatePolygon: -// ------------------ -// Creates a mesh containing an n-sided polygon. The polygon is centered -// at the origin. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// Length Length of each side. -// Sides Number of sides the polygon has. (Must be >= 3) -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreatePolygon( - LPDIRECT3DDEVICE9 pDevice, - FLOAT Length, - UINT Sides, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateBox: -// -------------- -// Creates a mesh containing an axis-aligned box. The box is centered at -// the origin. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// Width Width of box (along X-axis) -// Height Height of box (along Y-axis) -// Depth Depth of box (along Z-axis) -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateBox( - LPDIRECT3DDEVICE9 pDevice, - FLOAT Width, - FLOAT Height, - FLOAT Depth, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateCylinder: -// ------------------- -// Creates a mesh containing a cylinder. The generated cylinder is -// centered at the origin, and its axis is aligned with the Z-axis. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// Radius1 Radius at -Z end (should be >= 0.0f) -// Radius2 Radius at +Z end (should be >= 0.0f) -// Length Length of cylinder (along Z-axis) -// Slices Number of slices about the main axis -// Stacks Number of stacks along the main axis -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateCylinder( - LPDIRECT3DDEVICE9 pDevice, - FLOAT Radius1, - FLOAT Radius2, - FLOAT Length, - UINT Slices, - UINT Stacks, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateSphere: -// ----------------- -// Creates a mesh containing a sphere. The sphere is centered at the -// origin. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// Radius Radius of the sphere (should be >= 0.0f) -// Slices Number of slices about the main axis -// Stacks Number of stacks along the main axis -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateSphere( - LPDIRECT3DDEVICE9 pDevice, - FLOAT Radius, - UINT Slices, - UINT Stacks, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateTorus: -// ---------------- -// Creates a mesh containing a torus. The generated torus is centered at -// the origin, and its axis is aligned with the Z-axis. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// InnerRadius Inner radius of the torus (should be >= 0.0f) -// OuterRadius Outer radius of the torue (should be >= 0.0f) -// Sides Number of sides in a cross-section (must be >= 3) -// Rings Number of rings making up the torus (must be >= 3) -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTorus( - LPDIRECT3DDEVICE9 pDevice, - FLOAT InnerRadius, - FLOAT OuterRadius, - UINT Sides, - UINT Rings, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateTeapot: -// ----------------- -// Creates a mesh containing a teapot. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTeapot( - LPDIRECT3DDEVICE9 pDevice, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateText: -// --------------- -// Creates a mesh containing the specified text using the font associated -// with the device context. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// hDC Device context, with desired font selected -// pText Text to generate -// Deviation Maximum chordal deviation from true font outlines -// Extrusion Amount to extrude text in -Z direction -// ppMesh The mesh object which will be created -// pGlyphMetrics Address of buffer to receive glyph metric data (or NULL) -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTextA( - LPDIRECT3DDEVICE9 pDevice, - HDC hDC, - LPCSTR pText, - FLOAT Deviation, - FLOAT Extrusion, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency, - LPGLYPHMETRICSFLOAT pGlyphMetrics); - -HRESULT WINAPI - D3DXCreateTextW( - LPDIRECT3DDEVICE9 pDevice, - HDC hDC, - LPCWSTR pText, - FLOAT Deviation, - FLOAT Extrusion, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency, - LPGLYPHMETRICSFLOAT pGlyphMetrics); - -#ifdef UNICODE -#define D3DXCreateText D3DXCreateTextW -#else -#define D3DXCreateText D3DXCreateTextA -#endif - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX9SHAPES_H__ - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9tex.h b/jan/src/dep/mingw/include/directx9/d3dx9tex.h deleted file mode 100644 index f259e7ff1..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9tex.h +++ /dev/null @@ -1,1735 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9tex.h -// Content: D3DX texturing APIs -// -////////////////////////////////////////////////////////////////////////////// - -#include "d3dx9.h" - -#ifndef __D3DX9TEX_H__ -#define __D3DX9TEX_H__ - - -//---------------------------------------------------------------------------- -// D3DX_FILTER flags: -// ------------------ -// -// A valid filter must contain one of these values: -// -// D3DX_FILTER_NONE -// No scaling or filtering will take place. Pixels outside the bounds -// of the source image are assumed to be transparent black. -// D3DX_FILTER_POINT -// Each destination pixel is computed by sampling the nearest pixel -// from the source image. -// D3DX_FILTER_LINEAR -// Each destination pixel is computed by linearly interpolating between -// the nearest pixels in the source image. This filter works best -// when the scale on each axis is less than 2. -// D3DX_FILTER_TRIANGLE -// Every pixel in the source image contributes equally to the -// destination image. This is the slowest of all the filters. -// D3DX_FILTER_BOX -// Each pixel is computed by averaging a 2x2(x2) box pixels from -// the source image. Only works when the dimensions of the -// destination are half those of the source. (as with mip maps) -// -// And can be OR'd with any of these optional flags: -// -// D3DX_FILTER_MIRROR_U -// Indicates that pixels off the edge of the texture on the U-axis -// should be mirrored, not wraped. -// D3DX_FILTER_MIRROR_V -// Indicates that pixels off the edge of the texture on the V-axis -// should be mirrored, not wraped. -// D3DX_FILTER_MIRROR_W -// Indicates that pixels off the edge of the texture on the W-axis -// should be mirrored, not wraped. -// D3DX_FILTER_MIRROR -// Same as specifying D3DX_FILTER_MIRROR_U | D3DX_FILTER_MIRROR_V | -// D3DX_FILTER_MIRROR_V -// D3DX_FILTER_DITHER -// Dithers the resulting image using a 4x4 order dither pattern. -// D3DX_FILTER_SRGB_IN -// Denotes that the input data is in sRGB (gamma 2.2) colorspace. -// D3DX_FILTER_SRGB_OUT -// Denotes that the output data is in sRGB (gamma 2.2) colorspace. -// D3DX_FILTER_SRGB -// Same as specifying D3DX_FILTER_SRGB_IN | D3DX_FILTER_SRGB_OUT -// -//---------------------------------------------------------------------------- - -#define D3DX_FILTER_NONE (1 << 0) -#define D3DX_FILTER_POINT (2 << 0) -#define D3DX_FILTER_LINEAR (3 << 0) -#define D3DX_FILTER_TRIANGLE (4 << 0) -#define D3DX_FILTER_BOX (5 << 0) - -#define D3DX_FILTER_MIRROR_U (1 << 16) -#define D3DX_FILTER_MIRROR_V (2 << 16) -#define D3DX_FILTER_MIRROR_W (4 << 16) -#define D3DX_FILTER_MIRROR (7 << 16) - -#define D3DX_FILTER_DITHER (1 << 19) -#define D3DX_FILTER_DITHER_DIFFUSION (2 << 19) - -#define D3DX_FILTER_SRGB_IN (1 << 21) -#define D3DX_FILTER_SRGB_OUT (2 << 21) -#define D3DX_FILTER_SRGB (3 << 21) - - -//----------------------------------------------------------------------------- -// D3DX_SKIP_DDS_MIP_LEVELS is used to skip mip levels when loading a DDS file: -//----------------------------------------------------------------------------- - -#define D3DX_SKIP_DDS_MIP_LEVELS_MASK 0x1F -#define D3DX_SKIP_DDS_MIP_LEVELS_SHIFT 26 -#define D3DX_SKIP_DDS_MIP_LEVELS(levels, filter) ((((levels) & D3DX_SKIP_DDS_MIP_LEVELS_MASK) << D3DX_SKIP_DDS_MIP_LEVELS_SHIFT) | ((filter) == D3DX_DEFAULT ? D3DX_FILTER_BOX : (filter))) - - - - -//---------------------------------------------------------------------------- -// D3DX_NORMALMAP flags: -// --------------------- -// These flags are used to control how D3DXComputeNormalMap generates normal -// maps. Any number of these flags may be OR'd together in any combination. -// -// D3DX_NORMALMAP_MIRROR_U -// Indicates that pixels off the edge of the texture on the U-axis -// should be mirrored, not wraped. -// D3DX_NORMALMAP_MIRROR_V -// Indicates that pixels off the edge of the texture on the V-axis -// should be mirrored, not wraped. -// D3DX_NORMALMAP_MIRROR -// Same as specifying D3DX_NORMALMAP_MIRROR_U | D3DX_NORMALMAP_MIRROR_V -// D3DX_NORMALMAP_INVERTSIGN -// Inverts the direction of each normal -// D3DX_NORMALMAP_COMPUTE_OCCLUSION -// Compute the per pixel Occlusion term and encodes it into the alpha. -// An Alpha of 1 means that the pixel is not obscured in anyway, and -// an alpha of 0 would mean that the pixel is completly obscured. -// -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- - -#define D3DX_NORMALMAP_MIRROR_U (1 << 16) -#define D3DX_NORMALMAP_MIRROR_V (2 << 16) -#define D3DX_NORMALMAP_MIRROR (3 << 16) -#define D3DX_NORMALMAP_INVERTSIGN (8 << 16) -#define D3DX_NORMALMAP_COMPUTE_OCCLUSION (16 << 16) - - - - -//---------------------------------------------------------------------------- -// D3DX_CHANNEL flags: -// ------------------- -// These flags are used by functions which operate on or more channels -// in a texture. -// -// D3DX_CHANNEL_RED -// Indicates the red channel should be used -// D3DX_CHANNEL_BLUE -// Indicates the blue channel should be used -// D3DX_CHANNEL_GREEN -// Indicates the green channel should be used -// D3DX_CHANNEL_ALPHA -// Indicates the alpha channel should be used -// D3DX_CHANNEL_LUMINANCE -// Indicates the luminaces of the red green and blue channels should be -// used. -// -//---------------------------------------------------------------------------- - -#define D3DX_CHANNEL_RED (1 << 0) -#define D3DX_CHANNEL_BLUE (1 << 1) -#define D3DX_CHANNEL_GREEN (1 << 2) -#define D3DX_CHANNEL_ALPHA (1 << 3) -#define D3DX_CHANNEL_LUMINANCE (1 << 4) - - - - -//---------------------------------------------------------------------------- -// D3DXIMAGE_FILEFORMAT: -// --------------------- -// This enum is used to describe supported image file formats. -// -//---------------------------------------------------------------------------- - -typedef enum _D3DXIMAGE_FILEFORMAT -{ - D3DXIFF_BMP = 0, - D3DXIFF_JPG = 1, - D3DXIFF_TGA = 2, - D3DXIFF_PNG = 3, - D3DXIFF_DDS = 4, - D3DXIFF_PPM = 5, - D3DXIFF_DIB = 6, - D3DXIFF_HDR = 7, //high dynamic range formats - D3DXIFF_PFM = 8, // - D3DXIFF_FORCE_DWORD = 0x7fffffff - -} D3DXIMAGE_FILEFORMAT; - - -//---------------------------------------------------------------------------- -// LPD3DXFILL2D and LPD3DXFILL3D: -// ------------------------------ -// Function types used by the texture fill functions. -// -// Parameters: -// pOut -// Pointer to a vector which the function uses to return its result. -// X,Y,Z,W will be mapped to R,G,B,A respectivly. -// pTexCoord -// Pointer to a vector containing the coordinates of the texel currently -// being evaluated. Textures and VolumeTexture texcoord components -// range from 0 to 1. CubeTexture texcoord component range from -1 to 1. -// pTexelSize -// Pointer to a vector containing the dimensions of the current texel. -// pData -// Pointer to user data. -// -//---------------------------------------------------------------------------- - -typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut, - CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData); - -typedef VOID (WINAPI *LPD3DXFILL3D)(D3DXVECTOR4 *pOut, - CONST D3DXVECTOR3 *pTexCoord, CONST D3DXVECTOR3 *pTexelSize, LPVOID pData); - - - -//---------------------------------------------------------------------------- -// D3DXIMAGE_INFO: -// --------------- -// This structure is used to return a rough description of what the -// the original contents of an image file looked like. -// -// Width -// Width of original image in pixels -// Height -// Height of original image in pixels -// Depth -// Depth of original image in pixels -// MipLevels -// Number of mip levels in original image -// Format -// D3D format which most closely describes the data in original image -// ResourceType -// D3DRESOURCETYPE representing the type of texture stored in the file. -// D3DRTYPE_TEXTURE, D3DRTYPE_VOLUMETEXTURE, or D3DRTYPE_CUBETEXTURE. -// ImageFileFormat -// D3DXIMAGE_FILEFORMAT representing the format of the image file. -// -//---------------------------------------------------------------------------- - -typedef struct _D3DXIMAGE_INFO -{ - UINT Width; - UINT Height; - UINT Depth; - UINT MipLevels; - D3DFORMAT Format; - D3DRESOURCETYPE ResourceType; - D3DXIMAGE_FILEFORMAT ImageFileFormat; - -} D3DXIMAGE_INFO; - - - - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - - -////////////////////////////////////////////////////////////////////////////// -// Image File APIs /////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -//; -//---------------------------------------------------------------------------- -// GetImageInfoFromFile/Resource: -// ------------------------------ -// Fills in a D3DXIMAGE_INFO struct with information about an image file. -// -// Parameters: -// pSrcFile -// File name of the source image. -// pSrcModule -// Module where resource is located, or NULL for module associated -// with image the os used to create the current process. -// pSrcResource -// Resource name -// pSrcData -// Pointer to file in memory. -// SrcDataSize -// Size in bytes of file in memory. -// pSrcInfo -// Pointer to a D3DXIMAGE_INFO structure to be filled in with the -// description of the data in the source image file. -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXGetImageInfoFromFileA( - LPCSTR pSrcFile, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXGetImageInfoFromFileW( - LPCWSTR pSrcFile, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileW -#else -#define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileA -#endif - - -HRESULT WINAPI - D3DXGetImageInfoFromResourceA( - HMODULE hSrcModule, - LPCSTR pSrcResource, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXGetImageInfoFromResourceW( - HMODULE hSrcModule, - LPCWSTR pSrcResource, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceW -#else -#define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceA -#endif - - -HRESULT WINAPI - D3DXGetImageInfoFromFileInMemory( - LPCVOID pSrcData, - UINT SrcDataSize, - D3DXIMAGE_INFO* pSrcInfo); - - - - -////////////////////////////////////////////////////////////////////////////// -// Load/Save Surface APIs //////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DXLoadSurfaceFromFile/Resource: -// --------------------------------- -// Load surface from a file or resource -// -// Parameters: -// pDestSurface -// Destination surface, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestRect -// Destination rectangle, or NULL for entire surface -// pSrcFile -// File name of the source image. -// pSrcModule -// Module where resource is located, or NULL for module associated -// with image the os used to create the current process. -// pSrcResource -// Resource name -// pSrcData -// Pointer to file in memory. -// SrcDataSize -// Size in bytes of file in memory. -// pSrcRect -// Source rectangle, or NULL for entire image -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// pSrcInfo -// Pointer to a D3DXIMAGE_INFO structure to be filled in with the -// description of the data in the source image file, or NULL. -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadSurfaceFromFileA( - LPDIRECT3DSURFACE9 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPCSTR pSrcFile, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXLoadSurfaceFromFileW( - LPDIRECT3DSURFACE9 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPCWSTR pSrcFile, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileW -#else -#define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileA -#endif - - - -HRESULT WINAPI - D3DXLoadSurfaceFromResourceA( - LPDIRECT3DSURFACE9 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXLoadSurfaceFromResourceW( - LPDIRECT3DSURFACE9 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - - -#ifdef UNICODE -#define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceW -#else -#define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceA -#endif - - - -HRESULT WINAPI - D3DXLoadSurfaceFromFileInMemory( - LPDIRECT3DSURFACE9 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPCVOID pSrcData, - UINT SrcDataSize, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - - - -//---------------------------------------------------------------------------- -// D3DXLoadSurfaceFromSurface: -// --------------------------- -// Load surface from another surface (with color conversion) -// -// Parameters: -// pDestSurface -// Destination surface, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestRect -// Destination rectangle, or NULL for entire surface -// pSrcSurface -// Source surface -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcRect -// Source rectangle, or NULL for entire surface -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadSurfaceFromSurface( - LPDIRECT3DSURFACE9 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPDIRECT3DSURFACE9 pSrcSurface, - CONST PALETTEENTRY* pSrcPalette, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey); - - -//---------------------------------------------------------------------------- -// D3DXLoadSurfaceFromMemory: -// -------------------------- -// Load surface from memory. -// -// Parameters: -// pDestSurface -// Destination surface, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestRect -// Destination rectangle, or NULL for entire surface -// pSrcMemory -// Pointer to the top-left corner of the source image in memory -// SrcFormat -// Pixel format of the source image. -// SrcPitch -// Pitch of source image, in bytes. For DXT formats, this number -// should represent the width of one row of cells, in bytes. -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcRect -// Source rectangle. -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadSurfaceFromMemory( - LPDIRECT3DSURFACE9 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPCVOID pSrcMemory, - D3DFORMAT SrcFormat, - UINT SrcPitch, - CONST PALETTEENTRY* pSrcPalette, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey); - - -//---------------------------------------------------------------------------- -// D3DXSaveSurfaceToFile: -// ---------------------- -// Save a surface to a image file. -// -// Parameters: -// pDestFile -// File name of the destination file -// DestFormat -// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. -// pSrcSurface -// Source surface, containing the image to be saved -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcRect -// Source rectangle, or NULL for the entire image -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXSaveSurfaceToFileA( - LPCSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DSURFACE9 pSrcSurface, - CONST PALETTEENTRY* pSrcPalette, - CONST RECT* pSrcRect); - -HRESULT WINAPI - D3DXSaveSurfaceToFileW( - LPCWSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DSURFACE9 pSrcSurface, - CONST PALETTEENTRY* pSrcPalette, - CONST RECT* pSrcRect); - -#ifdef UNICODE -#define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileW -#else -#define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileA -#endif - -//---------------------------------------------------------------------------- -// D3DXSaveSurfaceToFileInMemory: -// ---------------------- -// Save a surface to a image file. -// -// Parameters: -// ppDestBuf -// address of pointer to d3dxbuffer for returning data bits -// DestFormat -// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. -// pSrcSurface -// Source surface, containing the image to be saved -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcRect -// Source rectangle, or NULL for the entire image -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXSaveSurfaceToFileInMemory( - LPD3DXBUFFER* ppDestBuf, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DSURFACE9 pSrcSurface, - CONST PALETTEENTRY* pSrcPalette, - CONST RECT* pSrcRect); - - -////////////////////////////////////////////////////////////////////////////// -// Load/Save Volume APIs ///////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DXLoadVolumeFromFile/Resource: -// -------------------------------- -// Load volume from a file or resource -// -// Parameters: -// pDestVolume -// Destination volume, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestBox -// Destination box, or NULL for entire volume -// pSrcFile -// File name of the source image. -// pSrcModule -// Module where resource is located, or NULL for module associated -// with image the os used to create the current process. -// pSrcResource -// Resource name -// pSrcData -// Pointer to file in memory. -// SrcDataSize -// Size in bytes of file in memory. -// pSrcBox -// Source box, or NULL for entire image -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// pSrcInfo -// Pointer to a D3DXIMAGE_INFO structure to be filled in with the -// description of the data in the source image file, or NULL. -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadVolumeFromFileA( - LPDIRECT3DVOLUME9 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPCSTR pSrcFile, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXLoadVolumeFromFileW( - LPDIRECT3DVOLUME9 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPCWSTR pSrcFile, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileW -#else -#define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileA -#endif - - -HRESULT WINAPI - D3DXLoadVolumeFromResourceA( - LPDIRECT3DVOLUME9 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXLoadVolumeFromResourceW( - LPDIRECT3DVOLUME9 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceW -#else -#define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceA -#endif - - - -HRESULT WINAPI - D3DXLoadVolumeFromFileInMemory( - LPDIRECT3DVOLUME9 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPCVOID pSrcData, - UINT SrcDataSize, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - - - -//---------------------------------------------------------------------------- -// D3DXLoadVolumeFromVolume: -// ------------------------- -// Load volume from another volume (with color conversion) -// -// Parameters: -// pDestVolume -// Destination volume, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestBox -// Destination box, or NULL for entire volume -// pSrcVolume -// Source volume -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcBox -// Source box, or NULL for entire volume -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadVolumeFromVolume( - LPDIRECT3DVOLUME9 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPDIRECT3DVOLUME9 pSrcVolume, - CONST PALETTEENTRY* pSrcPalette, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey); - - - -//---------------------------------------------------------------------------- -// D3DXLoadVolumeFromMemory: -// ------------------------- -// Load volume from memory. -// -// Parameters: -// pDestVolume -// Destination volume, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestBox -// Destination box, or NULL for entire volume -// pSrcMemory -// Pointer to the top-left corner of the source volume in memory -// SrcFormat -// Pixel format of the source volume. -// SrcRowPitch -// Pitch of source image, in bytes. For DXT formats, this number -// should represent the size of one row of cells, in bytes. -// SrcSlicePitch -// Pitch of source image, in bytes. For DXT formats, this number -// should represent the size of one slice of cells, in bytes. -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcBox -// Source box. -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadVolumeFromMemory( - LPDIRECT3DVOLUME9 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPCVOID pSrcMemory, - D3DFORMAT SrcFormat, - UINT SrcRowPitch, - UINT SrcSlicePitch, - CONST PALETTEENTRY* pSrcPalette, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey); - - - -//---------------------------------------------------------------------------- -// D3DXSaveVolumeToFile: -// --------------------- -// Save a volume to a image file. -// -// Parameters: -// pDestFile -// File name of the destination file -// DestFormat -// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. -// pSrcVolume -// Source volume, containing the image to be saved -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcBox -// Source box, or NULL for the entire volume -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXSaveVolumeToFileA( - LPCSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DVOLUME9 pSrcVolume, - CONST PALETTEENTRY* pSrcPalette, - CONST D3DBOX* pSrcBox); - -HRESULT WINAPI - D3DXSaveVolumeToFileW( - LPCWSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DVOLUME9 pSrcVolume, - CONST PALETTEENTRY* pSrcPalette, - CONST D3DBOX* pSrcBox); - -#ifdef UNICODE -#define D3DXSaveVolumeToFile D3DXSaveVolumeToFileW -#else -#define D3DXSaveVolumeToFile D3DXSaveVolumeToFileA -#endif - - -//---------------------------------------------------------------------------- -// D3DXSaveVolumeToFileInMemory: -// --------------------- -// Save a volume to a image file. -// -// Parameters: -// pDestFile -// File name of the destination file -// DestFormat -// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. -// pSrcVolume -// Source volume, containing the image to be saved -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcBox -// Source box, or NULL for the entire volume -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXSaveVolumeToFileInMemory( - LPD3DXBUFFER* ppDestBuf, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DVOLUME9 pSrcVolume, - CONST PALETTEENTRY* pSrcPalette, - CONST D3DBOX* pSrcBox); - -////////////////////////////////////////////////////////////////////////////// -// Create/Save Texture APIs ////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DXCheckTextureRequirements: -// ----------------------------- -// Checks texture creation parameters. If parameters are invalid, this -// function returns corrected parameters. -// -// Parameters: -// -// pDevice -// The D3D device to be used -// pWidth, pHeight, pDepth, pSize -// Desired size in pixels, or NULL. Returns corrected size. -// pNumMipLevels -// Number of desired mipmap levels, or NULL. Returns corrected number. -// Usage -// Texture usage flags -// pFormat -// Desired pixel format, or NULL. Returns corrected format. -// Pool -// Memory pool to be used to create texture -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCheckTextureRequirements( - LPDIRECT3DDEVICE9 pDevice, - UINT* pWidth, - UINT* pHeight, - UINT* pNumMipLevels, - DWORD Usage, - D3DFORMAT* pFormat, - D3DPOOL Pool); - -HRESULT WINAPI - D3DXCheckCubeTextureRequirements( - LPDIRECT3DDEVICE9 pDevice, - UINT* pSize, - UINT* pNumMipLevels, - DWORD Usage, - D3DFORMAT* pFormat, - D3DPOOL Pool); - -HRESULT WINAPI - D3DXCheckVolumeTextureRequirements( - LPDIRECT3DDEVICE9 pDevice, - UINT* pWidth, - UINT* pHeight, - UINT* pDepth, - UINT* pNumMipLevels, - DWORD Usage, - D3DFORMAT* pFormat, - D3DPOOL Pool); - - -//---------------------------------------------------------------------------- -// D3DXCreateTexture: -// ------------------ -// Create an empty texture -// -// Parameters: -// -// pDevice -// The D3D device with which the texture is going to be used. -// Width, Height, Depth, Size -// size in pixels. these must be non-zero -// MipLevels -// number of mip levels desired. if zero or D3DX_DEFAULT, a complete -// mipmap chain will be created. -// Usage -// Texture usage flags -// Format -// Pixel format. -// Pool -// Memory pool to be used to create texture -// ppTexture, ppCubeTexture, ppVolumeTexture -// The texture object that will be created -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCreateTexture( - LPDIRECT3DDEVICE9 pDevice, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - LPDIRECT3DTEXTURE9* ppTexture); - -HRESULT WINAPI - D3DXCreateCubeTexture( - LPDIRECT3DDEVICE9 pDevice, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTexture( - LPDIRECT3DDEVICE9 pDevice, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - - - -//---------------------------------------------------------------------------- -// D3DXCreateTextureFromFile/Resource: -// ----------------------------------- -// Create a texture object from a file or resource. -// -// Parameters: -// -// pDevice -// The D3D device with which the texture is going to be used. -// pSrcFile -// File name. -// hSrcModule -// Module handle. if NULL, current module will be used. -// pSrcResource -// Resource name in module -// pvSrcData -// Pointer to file in memory. -// SrcDataSize -// Size in bytes of file in memory. -// Width, Height, Depth, Size -// Size in pixels. If zero or D3DX_DEFAULT, the size will be taken from -// the file and rounded up to a power of two. If D3DX_DEFAULT_NONPOW2, -// and the device supports NONPOW2 textures, the size will not be rounded. -// If D3DX_FROM_FILE, the size will be taken exactly as it is in the file, -// and the call will fail if this violates device capabilities. -// MipLevels -// Number of mip levels. If zero or D3DX_DEFAULT, a complete mipmap -// chain will be created. If D3DX_FROM_FILE, the size will be taken -// exactly as it is in the file, and the call will fail if this violates -// device capabilities. -// Usage -// Texture usage flags -// Format -// Desired pixel format. If D3DFMT_UNKNOWN, the format will be -// taken from the file. If D3DFMT_FROM_FILE, the format will be taken -// exactly as it is in the file, and the call will fail if the device does -// not support the given format. -// Pool -// Memory pool to be used to create texture -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// MipFilter -// D3DX_FILTER flags controlling how each miplevel is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_BOX. -// Use the D3DX_SKIP_DDS_MIP_LEVELS macro to specify both a filter and the -// number of mip levels to skip when loading DDS files. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// pSrcInfo -// Pointer to a D3DXIMAGE_INFO structure to be filled in with the -// description of the data in the source image file, or NULL. -// pPalette -// 256 color palette to be filled in, or NULL -// ppTexture, ppCubeTexture, ppVolumeTexture -// The texture object that will be created -// -//---------------------------------------------------------------------------- - -// FromFile - -HRESULT WINAPI - D3DXCreateTextureFromFileA( - LPDIRECT3DDEVICE9 pDevice, - LPCSTR pSrcFile, - LPDIRECT3DTEXTURE9* ppTexture); - -HRESULT WINAPI - D3DXCreateTextureFromFileW( - LPDIRECT3DDEVICE9 pDevice, - LPCWSTR pSrcFile, - LPDIRECT3DTEXTURE9* ppTexture); - -#ifdef UNICODE -#define D3DXCreateTextureFromFile D3DXCreateTextureFromFileW -#else -#define D3DXCreateTextureFromFile D3DXCreateTextureFromFileA -#endif - - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileA( - LPDIRECT3DDEVICE9 pDevice, - LPCSTR pSrcFile, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileW( - LPDIRECT3DDEVICE9 pDevice, - LPCWSTR pSrcFile, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -#ifdef UNICODE -#define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileW -#else -#define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileA -#endif - - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileA( - LPDIRECT3DDEVICE9 pDevice, - LPCSTR pSrcFile, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileW( - LPDIRECT3DDEVICE9 pDevice, - LPCWSTR pSrcFile, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - -#ifdef UNICODE -#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileW -#else -#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileA -#endif - - -// FromResource - -HRESULT WINAPI - D3DXCreateTextureFromResourceA( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - LPDIRECT3DTEXTURE9* ppTexture); - -HRESULT WINAPI - D3DXCreateTextureFromResourceW( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - LPDIRECT3DTEXTURE9* ppTexture); - -#ifdef UNICODE -#define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceW -#else -#define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceA -#endif - - -HRESULT WINAPI - D3DXCreateCubeTextureFromResourceA( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromResourceW( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -#ifdef UNICODE -#define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceW -#else -#define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceA -#endif - - -HRESULT WINAPI - D3DXCreateVolumeTextureFromResourceA( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromResourceW( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - -#ifdef UNICODE -#define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceW -#else -#define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceA -#endif - - -// FromFileEx - -HRESULT WINAPI - D3DXCreateTextureFromFileExA( - LPDIRECT3DDEVICE9 pDevice, - LPCSTR pSrcFile, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE9* ppTexture); - -HRESULT WINAPI - D3DXCreateTextureFromFileExW( - LPDIRECT3DDEVICE9 pDevice, - LPCWSTR pSrcFile, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE9* ppTexture); - -#ifdef UNICODE -#define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExW -#else -#define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExA -#endif - - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileExA( - LPDIRECT3DDEVICE9 pDevice, - LPCSTR pSrcFile, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileExW( - LPDIRECT3DDEVICE9 pDevice, - LPCWSTR pSrcFile, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -#ifdef UNICODE -#define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExW -#else -#define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExA -#endif - - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileExA( - LPDIRECT3DDEVICE9 pDevice, - LPCSTR pSrcFile, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileExW( - LPDIRECT3DDEVICE9 pDevice, - LPCWSTR pSrcFile, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - -#ifdef UNICODE -#define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExW -#else -#define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExA -#endif - - -// FromResourceEx - -HRESULT WINAPI - D3DXCreateTextureFromResourceExA( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE9* ppTexture); - -HRESULT WINAPI - D3DXCreateTextureFromResourceExW( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE9* ppTexture); - -#ifdef UNICODE -#define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExW -#else -#define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExA -#endif - - -HRESULT WINAPI - D3DXCreateCubeTextureFromResourceExA( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromResourceExW( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -#ifdef UNICODE -#define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExW -#else -#define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExA -#endif - - -HRESULT WINAPI - D3DXCreateVolumeTextureFromResourceExA( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromResourceExW( - LPDIRECT3DDEVICE9 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - -#ifdef UNICODE -#define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExW -#else -#define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExA -#endif - - -// FromFileInMemory - -HRESULT WINAPI - D3DXCreateTextureFromFileInMemory( - LPDIRECT3DDEVICE9 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - LPDIRECT3DTEXTURE9* ppTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileInMemory( - LPDIRECT3DDEVICE9 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileInMemory( - LPDIRECT3DDEVICE9 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - - -// FromFileInMemoryEx - -HRESULT WINAPI - D3DXCreateTextureFromFileInMemoryEx( - LPDIRECT3DDEVICE9 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE9* ppTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileInMemoryEx( - LPDIRECT3DDEVICE9 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE9* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileInMemoryEx( - LPDIRECT3DDEVICE9 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); - - - -//---------------------------------------------------------------------------- -// D3DXSaveTextureToFile: -// ---------------------- -// Save a texture to a file. -// -// Parameters: -// pDestFile -// File name of the destination file -// DestFormat -// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. -// pSrcTexture -// Source texture, containing the image to be saved -// pSrcPalette -// Source palette of 256 colors, or NULL -// -//---------------------------------------------------------------------------- - - -HRESULT WINAPI - D3DXSaveTextureToFileA( - LPCSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DBASETEXTURE9 pSrcTexture, - CONST PALETTEENTRY* pSrcPalette); - -HRESULT WINAPI - D3DXSaveTextureToFileW( - LPCWSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DBASETEXTURE9 pSrcTexture, - CONST PALETTEENTRY* pSrcPalette); - -#ifdef UNICODE -#define D3DXSaveTextureToFile D3DXSaveTextureToFileW -#else -#define D3DXSaveTextureToFile D3DXSaveTextureToFileA -#endif - - -//---------------------------------------------------------------------------- -// D3DXSaveTextureToFileInMemory: -// ---------------------- -// Save a texture to a file. -// -// Parameters: -// ppDestBuf -// address of a d3dxbuffer pointer to return the image data -// DestFormat -// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. -// pSrcTexture -// Source texture, containing the image to be saved -// pSrcPalette -// Source palette of 256 colors, or NULL -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXSaveTextureToFileInMemory( - LPD3DXBUFFER* ppDestBuf, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DBASETEXTURE9 pSrcTexture, - CONST PALETTEENTRY* pSrcPalette); - - - - -////////////////////////////////////////////////////////////////////////////// -// Misc Texture APIs ///////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DXFilterTexture: -// ------------------ -// Filters mipmaps levels of a texture. -// -// Parameters: -// pBaseTexture -// The texture object to be filtered -// pPalette -// 256 color palette to be used, or NULL for non-palettized formats -// SrcLevel -// The level whose image is used to generate the subsequent levels. -// Filter -// D3DX_FILTER flags controlling how each miplevel is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_BOX, -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXFilterTexture( - LPDIRECT3DBASETEXTURE9 pBaseTexture, - CONST PALETTEENTRY* pPalette, - UINT SrcLevel, - DWORD Filter); - -#define D3DXFilterCubeTexture D3DXFilterTexture -#define D3DXFilterVolumeTexture D3DXFilterTexture - - - -//---------------------------------------------------------------------------- -// D3DXFillTexture: -// ---------------- -// Uses a user provided function to fill each texel of each mip level of a -// given texture. -// -// Paramters: -// pTexture, pCubeTexture, pVolumeTexture -// Pointer to the texture to be filled. -// pFunction -// Pointer to user provided evalutor function which will be used to -// compute the value of each texel. -// pData -// Pointer to an arbitrary block of user defined data. This pointer -// will be passed to the function provided in pFunction -//----------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXFillTexture( - LPDIRECT3DTEXTURE9 pTexture, - LPD3DXFILL2D pFunction, - LPVOID pData); - -HRESULT WINAPI - D3DXFillCubeTexture( - LPDIRECT3DCUBETEXTURE9 pCubeTexture, - LPD3DXFILL3D pFunction, - LPVOID pData); - -HRESULT WINAPI - D3DXFillVolumeTexture( - LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture, - LPD3DXFILL3D pFunction, - LPVOID pData); - -//--------------------------------------------------------------------------- -// D3DXFillTextureTX: -// ------------------ -// Uses a TX Shader target to function to fill each texel of each mip level -// of a given texture. The TX Shader target should be a compiled function -// taking 2 paramters and returning a float4 color. -// -// Paramters: -// pTexture, pCubeTexture, pVolumeTexture -// Pointer to the texture to be filled. -// pTextureShader -// Pointer to the texture shader to be used to fill in the texture -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXFillTextureTX( - LPDIRECT3DTEXTURE9 pTexture, - LPD3DXTEXTURESHADER pTextureShader); - - -HRESULT WINAPI - D3DXFillCubeTextureTX( - LPDIRECT3DCUBETEXTURE9 pCubeTexture, - LPD3DXTEXTURESHADER pTextureShader); - - -HRESULT WINAPI - D3DXFillVolumeTextureTX( - LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture, - LPD3DXTEXTURESHADER pTextureShader); - - - -//---------------------------------------------------------------------------- -// D3DXComputeNormalMap: -// --------------------- -// Converts a height map into a normal map. The (x,y,z) components of each -// normal are mapped to the (r,g,b) channels of the output texture. -// -// Parameters -// pTexture -// Pointer to the destination texture -// pSrcTexture -// Pointer to the source heightmap texture -// pSrcPalette -// Source palette of 256 colors, or NULL -// Flags -// D3DX_NORMALMAP flags -// Channel -// D3DX_CHANNEL specifying source of height information -// Amplitude -// The constant value which the height information is multiplied by. -//--------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXComputeNormalMap( - LPDIRECT3DTEXTURE9 pTexture, - LPDIRECT3DTEXTURE9 pSrcTexture, - CONST PALETTEENTRY* pSrcPalette, - DWORD Flags, - DWORD Channel, - FLOAT Amplitude); - - - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX9TEX_H__ - diff --git a/jan/src/dep/mingw/include/directx9/d3dx9xof.h b/jan/src/dep/mingw/include/directx9/d3dx9xof.h deleted file mode 100644 index c513f0fc9..000000000 --- a/jan/src/dep/mingw/include/directx9/d3dx9xof.h +++ /dev/null @@ -1,299 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9xof.h -// Content: D3DX .X File types and functions -// -/////////////////////////////////////////////////////////////////////////// - -#include "d3dx9.h" - -#if !defined( __D3DX9XOF_H__ ) -#define __D3DX9XOF_H__ - -#if defined( __cplusplus ) -extern "C" { -#endif // defined( __cplusplus ) - -//---------------------------------------------------------------------------- -// D3DXF_FILEFORMAT -// This flag is used to specify what file type to use when saving to disk. -// _BINARY, and _TEXT are mutually exclusive, while -// _COMPRESSED is an optional setting that works with all file types. -//---------------------------------------------------------------------------- -typedef DWORD D3DXF_FILEFORMAT; - -#define D3DXF_FILEFORMAT_BINARY 0 -#define D3DXF_FILEFORMAT_TEXT 1 -#define D3DXF_FILEFORMAT_COMPRESSED 2 - -//---------------------------------------------------------------------------- -// D3DXF_FILESAVEOPTIONS -// This flag is used to specify where to save the file to. Each flag is -// mutually exclusive, indicates the data location of the file, and also -// chooses which additional data will specify the location. -// _TOFILE is paired with a filename (LPCSTR) -// _TOWFILE is paired with a filename (LPWSTR) -//---------------------------------------------------------------------------- -typedef DWORD D3DXF_FILESAVEOPTIONS; - -#define D3DXF_FILESAVE_TOFILE 0x00L -#define D3DXF_FILESAVE_TOWFILE 0x01L - -//---------------------------------------------------------------------------- -// D3DXF_FILELOADOPTIONS -// This flag is used to specify where to load the file from. Each flag is -// mutually exclusive, indicates the data location of the file, and also -// chooses which additional data will specify the location. -// _FROMFILE is paired with a filename (LPCSTR) -// _FROMWFILE is paired with a filename (LPWSTR) -// _FROMRESOURCE is paired with a (D3DXF_FILELOADRESOUCE*) description. -// _FROMMEMORY is paired with a (D3DXF_FILELOADMEMORY*) description. -//---------------------------------------------------------------------------- -typedef DWORD D3DXF_FILELOADOPTIONS; - -#define D3DXF_FILELOAD_FROMFILE 0x00L -#define D3DXF_FILELOAD_FROMWFILE 0x01L -#define D3DXF_FILELOAD_FROMRESOURCE 0x02L -#define D3DXF_FILELOAD_FROMMEMORY 0x03L - -//---------------------------------------------------------------------------- -// D3DXF_FILELOADRESOURCE: -//---------------------------------------------------------------------------- - -typedef struct _D3DXF_FILELOADRESOURCE -{ - HMODULE hModule; // Desc - LPCSTR lpName; // Desc - LPCSTR lpType; // Desc -} D3DXF_FILELOADRESOURCE; - -//---------------------------------------------------------------------------- -// D3DXF_FILELOADMEMORY: -//---------------------------------------------------------------------------- - -typedef struct _D3DXF_FILELOADMEMORY -{ - LPCVOID lpMemory; // Desc - SIZE_T dSize; // Desc -} D3DXF_FILELOADMEMORY; - -#if defined( _WIN32 ) && !defined( _NO_COM ) - -// {cef08cf9-7b4f-4429-9624-2a690a933201} -DEFINE_GUID( IID_ID3DXFile, -0xcef08cf9, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); - -// {cef08cfa-7b4f-4429-9624-2a690a933201} -DEFINE_GUID( IID_ID3DXFileSaveObject, -0xcef08cfa, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); - -// {cef08cfb-7b4f-4429-9624-2a690a933201} -DEFINE_GUID( IID_ID3DXFileSaveData, -0xcef08cfb, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); - -// {cef08cfc-7b4f-4429-9624-2a690a933201} -DEFINE_GUID( IID_ID3DXFileEnumObject, -0xcef08cfc, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); - -// {cef08cfd-7b4f-4429-9624-2a690a933201} -DEFINE_GUID( IID_ID3DXFileData, -0xcef08cfd, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); - -#endif // defined( _WIN32 ) && !defined( _NO_COM ) - -#if defined( __cplusplus ) -#if !defined( DECLSPEC_UUID ) -#if _MSC_VER >= 1100 -#define DECLSPEC_UUID( x ) __declspec( uuid( x ) ) -#else // !( _MSC_VER >= 1100 ) -#define DECLSPEC_UUID( x ) -#endif // !( _MSC_VER >= 1100 ) -#endif // !defined( DECLSPEC_UUID ) - -interface DECLSPEC_UUID( "cef08cf9-7b4f-4429-9624-2a690a933201" ) - ID3DXFile; -interface DECLSPEC_UUID( "cef08cfa-7b4f-4429-9624-2a690a933201" ) - ID3DXFileSaveObject; -interface DECLSPEC_UUID( "cef08cfb-7b4f-4429-9624-2a690a933201" ) - ID3DXFileSaveData; -interface DECLSPEC_UUID( "cef08cfc-7b4f-4429-9624-2a690a933201" ) - ID3DXFileEnumObject; -interface DECLSPEC_UUID( "cef08cfd-7b4f-4429-9624-2a690a933201" ) - ID3DXFileData; - -#if defined( _COM_SMARTPTR_TYPEDEF ) -_COM_SMARTPTR_TYPEDEF( ID3DXFile, - __uuidof( ID3DXFile ) ); -_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveObject, - __uuidof( ID3DXFileSaveObject ) ); -_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveData, - __uuidof( ID3DXFileSaveData ) ); -_COM_SMARTPTR_TYPEDEF( ID3DXFileEnumObject, - __uuidof( ID3DXFileEnumObject ) ); -_COM_SMARTPTR_TYPEDEF( ID3DXFileData, - __uuidof( ID3DXFileData ) ); -#endif // defined( _COM_SMARTPTR_TYPEDEF ) -#endif // defined( __cplusplus ) - -typedef interface ID3DXFile ID3DXFile; -typedef interface ID3DXFileSaveObject ID3DXFileSaveObject; -typedef interface ID3DXFileSaveData ID3DXFileSaveData; -typedef interface ID3DXFileEnumObject ID3DXFileEnumObject; -typedef interface ID3DXFileData ID3DXFileData; - -////////////////////////////////////////////////////////////////////////////// -// ID3DXFile ///////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#undef INTERFACE -#define INTERFACE ID3DXFile - -DECLARE_INTERFACE_( ID3DXFile, IUnknown ) -{ - STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; - STDMETHOD_( ULONG, AddRef )( THIS ) PURE; - STDMETHOD_( ULONG, Release )( THIS ) PURE; - - STDMETHOD( CreateEnumObject )( THIS_ LPCVOID, D3DXF_FILELOADOPTIONS, - ID3DXFileEnumObject** ) PURE; - STDMETHOD( CreateSaveObject )( THIS_ LPCVOID, D3DXF_FILESAVEOPTIONS, - D3DXF_FILEFORMAT, ID3DXFileSaveObject** ) PURE; - STDMETHOD( RegisterTemplates )( THIS_ LPCVOID, SIZE_T ) PURE; - STDMETHOD( RegisterEnumTemplates )( THIS_ ID3DXFileEnumObject* ) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DXFileSaveObject /////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#undef INTERFACE -#define INTERFACE ID3DXFileSaveObject - -DECLARE_INTERFACE_( ID3DXFileSaveObject, IUnknown ) -{ - STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; - STDMETHOD_( ULONG, AddRef )( THIS ) PURE; - STDMETHOD_( ULONG, Release )( THIS ) PURE; - - STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE; - STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*, - SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE; - STDMETHOD( Save )( THIS ) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DXFileSaveData ///////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#undef INTERFACE -#define INTERFACE ID3DXFileSaveData - -DECLARE_INTERFACE_( ID3DXFileSaveData, IUnknown ) -{ - STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; - STDMETHOD_( ULONG, AddRef )( THIS ) PURE; - STDMETHOD_( ULONG, Release )( THIS ) PURE; - - STDMETHOD( GetSave )( THIS_ ID3DXFileSaveObject** ) PURE; - STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE; - STDMETHOD( GetId )( THIS_ LPGUID ) PURE; - STDMETHOD( GetType )( THIS_ GUID* ) PURE; - STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*, - SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE; - STDMETHOD( AddDataReference )( THIS_ LPCSTR, CONST GUID* ) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DXFileEnumObject /////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#undef INTERFACE -#define INTERFACE ID3DXFileEnumObject - -DECLARE_INTERFACE_( ID3DXFileEnumObject, IUnknown ) -{ - STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; - STDMETHOD_( ULONG, AddRef )( THIS ) PURE; - STDMETHOD_( ULONG, Release )( THIS ) PURE; - - STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE; - STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE; - STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE; - STDMETHOD( GetDataObjectById )( THIS_ REFGUID, ID3DXFileData** ) PURE; - STDMETHOD( GetDataObjectByName )( THIS_ LPCSTR, ID3DXFileData** ) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// ID3DXFileData ///////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#undef INTERFACE -#define INTERFACE ID3DXFileData - -DECLARE_INTERFACE_( ID3DXFileData, IUnknown ) -{ - STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; - STDMETHOD_( ULONG, AddRef )( THIS ) PURE; - STDMETHOD_( ULONG, Release )( THIS ) PURE; - - STDMETHOD( GetEnum )( THIS_ ID3DXFileEnumObject** ) PURE; - STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE; - STDMETHOD( GetId )( THIS_ LPGUID ) PURE; - STDMETHOD( Lock )( THIS_ SIZE_T*, LPCVOID* ) PURE; - STDMETHOD( Unlock )( THIS ) PURE; - STDMETHOD( GetType )( THIS_ GUID* ) PURE; - STDMETHOD_( BOOL, IsReference )( THIS ) PURE; - STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE; - STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE; -}; - -STDAPI D3DXFileCreate( ID3DXFile** lplpDirectXFile ); - -/* - * DirectX File errors. - */ - -#define _FACD3DXF 0x876 - -#define D3DXFERR_BADOBJECT MAKE_HRESULT( 1, _FACD3DXF, 900 ) -#define D3DXFERR_BADVALUE MAKE_HRESULT( 1, _FACD3DXF, 901 ) -#define D3DXFERR_BADTYPE MAKE_HRESULT( 1, _FACD3DXF, 902 ) -#define D3DXFERR_NOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 903 ) -#define D3DXFERR_NOTDONEYET MAKE_HRESULT( 1, _FACD3DXF, 904 ) -#define D3DXFERR_FILENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 905 ) -#define D3DXFERR_RESOURCENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 906 ) -#define D3DXFERR_BADRESOURCE MAKE_HRESULT( 1, _FACD3DXF, 907 ) -#define D3DXFERR_BADFILETYPE MAKE_HRESULT( 1, _FACD3DXF, 908 ) -#define D3DXFERR_BADFILEVERSION MAKE_HRESULT( 1, _FACD3DXF, 909 ) -#define D3DXFERR_BADFILEFLOATSIZE MAKE_HRESULT( 1, _FACD3DXF, 910 ) -#define D3DXFERR_BADFILE MAKE_HRESULT( 1, _FACD3DXF, 911 ) -#define D3DXFERR_PARSEERROR MAKE_HRESULT( 1, _FACD3DXF, 912 ) -#define D3DXFERR_BADARRAYSIZE MAKE_HRESULT( 1, _FACD3DXF, 913 ) -#define D3DXFERR_BADDATAREFERENCE MAKE_HRESULT( 1, _FACD3DXF, 914 ) -#define D3DXFERR_NOMOREOBJECTS MAKE_HRESULT( 1, _FACD3DXF, 915 ) -#define D3DXFERR_NOMOREDATA MAKE_HRESULT( 1, _FACD3DXF, 916 ) -#define D3DXFERR_BADCACHEFILE MAKE_HRESULT( 1, _FACD3DXF, 917 ) - -/* - * DirectX File object types. - */ - -#ifndef WIN_TYPES -#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype -#endif - -WIN_TYPES(ID3DXFile, D3DXFILE); -WIN_TYPES(ID3DXFileEnumObject, D3DXFILEENUMOBJECT); -WIN_TYPES(ID3DXFileSaveObject, D3DXFILESAVEOBJECT); -WIN_TYPES(ID3DXFileData, D3DXFILEDATA); -WIN_TYPES(ID3DXFileSaveData, D3DXFILESAVEDATA); - -#if defined( __cplusplus ) -} // extern "C" -#endif // defined( __cplusplus ) - -#endif // !defined( __D3DX9XOF_H__ ) - - diff --git a/jan/src/dep/mingw/include/mingw_win32.h b/jan/src/dep/mingw/include/mingw_win32.h deleted file mode 100644 index 16d0aadc0..000000000 --- a/jan/src/dep/mingw/include/mingw_win32.h +++ /dev/null @@ -1,89 +0,0 @@ -// Additions to the Cygwin/MinGW win32 headers -// ***********************************************************************************************************// -// Updated August 18, 2008 - Made adjustmens for newer versions of MinGW Win32 API definitions (CaptainCPS-X) // -// ***********************************************************************************************************// -#include - -#undef NM_FIRST -#define NM_FIRST (0U - 0U) - -#if (_WIN32_IE >= 0x0300) - #define NMLVKEYDOWN LV_KEYDOWN -#endif - -#ifndef MNS_NOCHECK -#define MNS_NOCHECK (0x80000000) -#endif - -#ifndef MNS_MODELESS -#define MNS_MODELESS (0x40000000) -#endif - -#ifndef MNS_DRAGDROP -#define MNS_DRAGDROP (0x20000000) -#endif - -#ifndef MNS_AUTODISMISS -#define MNS_AUTODISMISS (0x10000000) -#endif - -#ifndef MNS_NOTIFYBYPOS -#define MNS_NOTIFYBYPOS (0x08000000) -#endif - -#ifndef MNS_CHECKORBMP -#define MNS_CHECKORBMP (0x04000000) -#endif - -//#define MIM_MAXHEIGHT (0x00000001) -//#define MIM_BACKGROUND (0x00000002) -//#define MIM_HELPID (0x00000004) -//#define MIM_MENUDATA (0x00000008) -//#define MIM_STYLE (0x00000010) -//#define MIM_APPLYTOSUBMENUS (0x80000000) - -#ifndef WM_UNINITMENUPOPUP -#define WM_UNINITMENUPOPUP (0x0125) -#endif - -#define ENM_SCROLLEVENTS (8) - -// Rich edit -#define ST_DEFAULT (0) -#define ST_KEEPUNDO (1) -#define ST_SELECTION (2) - -#if __W32API_MAJOR_VERSION >=3 && __W32API_MINOR_VERSION < 8 -typedef struct _settextex -{ - DWORD flags; - UINT codepage; -} SETTEXTEX; -#endif - -// Macro used for handling Window Messages -#if not defined HANDLE_WM_DISPLAYCHANGE - #define HANDLE_WM_DISPLAYCHANGE(hwnd, wParam, lParam, fn) ((fn)((hwnd), (UINT)(wParam), (UINT)LOWORD(lParam), (UINT)HIWORD(wParam)), 0L) -#endif - -#if _WIN32_WINNT < 0x0500 - #define VK_OEM_PLUS 0xBB - #define VK_OEM_COMMA 0xBC - #define VK_OEM_MINUS 0xBD - #define VK_OEM_PERIOD 0xBE -#endif - -#ifndef LVM_SORTITEMSEX -#define LVM_SORTITEMSEX (LVM_FIRST + 81) -#endif - -#ifndef ListView_SortItemsEx -#define ListView_SortItemsEx(hwndLV, _pfnCompare, _lPrm) \ - (BOOL)SNDMSG((hwndLV), LVM_SORTITEMSEX, (WPARAM)(LPARAM)(_lPrm), (LPARAM)(PFNLVCOMPARE)(_pfnCompare)) -#endif - -// prevent some warnings on some header defines (warning: right-hand operand of comma has no effect) -#undef HANDLE_WM_PAINT -#define HANDLE_WM_PAINT(hwnd,wParam,lParam,fn) ((fn)(hwnd)) -#undef HANDLE_WM_INITMENUPOPUP -#define HANDLE_WM_INITMENUPOPUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HMENU)(wParam),(UINT)LOWORD(lParam),(BOOL)HIWORD(lParam))) diff --git a/jan/src/dep/mingw/include/xaudio2/audiodefs.h b/jan/src/dep/mingw/include/xaudio2/audiodefs.h deleted file mode 100644 index ff995ecc7..000000000 --- a/jan/src/dep/mingw/include/xaudio2/audiodefs.h +++ /dev/null @@ -1,263 +0,0 @@ -/*************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * File: audiodefs.h - * Content: Basic constants and data types for audio work. - * - * Remarks: This header file defines all of the audio format constants and - * structures required for XAudio2 and XACT work. Providing these - * in a single location avoids certain dependency problems in the - * legacy audio headers (mmreg.h, mmsystem.h, ksmedia.h). - * - * NOTE: Including the legacy headers after this one may cause a - * compilation error, because they define some of the same types - * defined here without preprocessor guards to avoid multiple - * definitions. If a source file needs one of the old headers, - * it must include it before including audiodefs.h. - * - ***************************************************************************/ - -#ifndef __AUDIODEFS_INCLUDED__ -#define __AUDIODEFS_INCLUDED__ - -#include // For WORD, DWORD, etc. - -#pragma pack(push, 1) // Pack structures to 1-byte boundaries - - -/************************************************************************** - * - * WAVEFORMATEX: Base structure for many audio formats. Format-specific - * extensions can be defined for particular formats by using a non-zero - * cbSize value and adding extra fields to the end of this structure. - * - ***************************************************************************/ - -#ifndef _WAVEFORMATEX_ - - #define _WAVEFORMATEX_ - typedef struct tWAVEFORMATEX - { - WORD wFormatTag; // Integer identifier of the format - WORD nChannels; // Number of audio channels - DWORD nSamplesPerSec; // Audio sample rate - DWORD nAvgBytesPerSec; // Bytes per second (possibly approximate) - WORD nBlockAlign; // Size in bytes of a sample block (all channels) - WORD wBitsPerSample; // Size in bits of a single per-channel sample - WORD cbSize; // Bytes of extra data appended to this struct - } WAVEFORMATEX; - -#endif - -// Defining pointer types outside of the #if block to make sure they are -// defined even if mmreg.h or mmsystem.h is #included before this file - -typedef WAVEFORMATEX *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX; -typedef const WAVEFORMATEX *PCWAVEFORMATEX, *LPCWAVEFORMATEX; - - -/************************************************************************** - * - * WAVEFORMATEXTENSIBLE: Extended version of WAVEFORMATEX that should be - * used as a basis for all new audio formats. The format tag is replaced - * with a GUID, allowing new formats to be defined without registering a - * format tag with Microsoft. There are also new fields that can be used - * to specify the spatial positions for each channel and the bit packing - * used for wide samples (e.g. 24-bit PCM samples in 32-bit containers). - * - ***************************************************************************/ - -#ifndef _WAVEFORMATEXTENSIBLE_ - - #define _WAVEFORMATEXTENSIBLE_ - typedef struct - { - WAVEFORMATEX Format; // Base WAVEFORMATEX data - union - { - WORD wValidBitsPerSample; // Valid bits in each sample container - WORD wSamplesPerBlock; // Samples per block of audio data; valid - // if wBitsPerSample=0 (but rarely used). - WORD wReserved; // Zero if neither case above applies. - } Samples; - DWORD dwChannelMask; // Positions of the audio channels - GUID SubFormat; // Format identifier GUID - } WAVEFORMATEXTENSIBLE; - -#endif - -typedef WAVEFORMATEXTENSIBLE *PWAVEFORMATEXTENSIBLE, *LPWAVEFORMATEXTENSIBLE; -typedef const WAVEFORMATEXTENSIBLE *PCWAVEFORMATEXTENSIBLE, *LPCWAVEFORMATEXTENSIBLE; - - - -/************************************************************************** - * - * Define the most common wave format tags used in WAVEFORMATEX formats. - * - ***************************************************************************/ - -#ifndef WAVE_FORMAT_PCM // Pulse Code Modulation - - // If WAVE_FORMAT_PCM is not defined, we need to define some legacy types - // for compatibility with the Windows mmreg.h / mmsystem.h header files. - - // Old general format structure (information common to all formats) - typedef struct waveformat_tag - { - WORD wFormatTag; - WORD nChannels; - DWORD nSamplesPerSec; - DWORD nAvgBytesPerSec; - WORD nBlockAlign; - } WAVEFORMAT, *PWAVEFORMAT, NEAR *NPWAVEFORMAT, FAR *LPWAVEFORMAT; - - // Specific format structure for PCM data - typedef struct pcmwaveformat_tag - { - WAVEFORMAT wf; - WORD wBitsPerSample; - } PCMWAVEFORMAT, *PPCMWAVEFORMAT, NEAR *NPPCMWAVEFORMAT, FAR *LPPCMWAVEFORMAT; - - #define WAVE_FORMAT_PCM 0x0001 - -#endif - -#ifndef WAVE_FORMAT_ADPCM // Microsoft Adaptive Differental PCM - - // Replicate the Microsoft ADPCM type definitions from mmreg.h. - - typedef struct adpcmcoef_tag - { - short iCoef1; - short iCoef2; - } ADPCMCOEFSET; - - #pragma warning(push) - #pragma warning(disable:4200) // Disable zero-sized array warnings - - typedef struct adpcmwaveformat_tag { - WAVEFORMATEX wfx; - WORD wSamplesPerBlock; - WORD wNumCoef; - ADPCMCOEFSET aCoef[]; // Always 7 coefficient pairs for MS ADPCM - } ADPCMWAVEFORMAT; - - #pragma warning(pop) - - #define WAVE_FORMAT_ADPCM 0x0002 - -#endif - -// Other frequently used format tags - -#ifndef WAVE_FORMAT_UNKNOWN - #define WAVE_FORMAT_UNKNOWN 0x0000 // Unknown or invalid format tag -#endif - -#ifndef WAVE_FORMAT_IEEE_FLOAT - #define WAVE_FORMAT_IEEE_FLOAT 0x0003 // 32-bit floating-point -#endif - -#ifndef WAVE_FORMAT_MPEGLAYER3 - #define WAVE_FORMAT_MPEGLAYER3 0x0055 // ISO/MPEG Layer3 -#endif - -#ifndef WAVE_FORMAT_DOLBY_AC3_SPDIF - #define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 // Dolby Audio Codec 3 over S/PDIF -#endif - -#ifndef WAVE_FORMAT_WMAUDIO2 - #define WAVE_FORMAT_WMAUDIO2 0x0161 // Windows Media Audio -#endif - -#ifndef WAVE_FORMAT_WMAUDIO3 - #define WAVE_FORMAT_WMAUDIO3 0x0162 // Windows Media Audio Pro -#endif - -#ifndef WAVE_FORMAT_WMASPDIF - #define WAVE_FORMAT_WMASPDIF 0x0164 // Windows Media Audio over S/PDIF -#endif - -#ifndef WAVE_FORMAT_EXTENSIBLE - #define WAVE_FORMAT_EXTENSIBLE 0xFFFE // All WAVEFORMATEXTENSIBLE formats -#endif - - -/************************************************************************** - * - * Define the most common wave format GUIDs used in WAVEFORMATEXTENSIBLE - * formats. Note that including the Windows ksmedia.h header after this - * one will cause build problems; this cannot be avoided, since ksmedia.h - * defines these macros without preprocessor guards. - * - ***************************************************************************/ - -#ifdef __cplusplus // uuid() and __uuidof() are only available in C++ - - #ifndef KSDATAFORMAT_SUBTYPE_PCM - struct __declspec(uuid("00000001-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_PCM_STRUCT; - #define KSDATAFORMAT_SUBTYPE_PCM __uuidof(KSDATAFORMAT_SUBTYPE_PCM_STRUCT) - #endif - - #ifndef KSDATAFORMAT_SUBTYPE_ADPCM - struct __declspec(uuid("00000002-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT; - #define KSDATAFORMAT_SUBTYPE_ADPCM __uuidof(KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT) - #endif - - #ifndef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT - struct __declspec(uuid("00000003-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT; - #define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT __uuidof(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT) - #endif - -#endif - - -/************************************************************************** - * - * Speaker positions used in the WAVEFORMATEXTENSIBLE dwChannelMask field. - * - ***************************************************************************/ - -#ifndef SPEAKER_FRONT_LEFT - #define SPEAKER_FRONT_LEFT 0x00000001 - #define SPEAKER_FRONT_RIGHT 0x00000002 - #define SPEAKER_FRONT_CENTER 0x00000004 - #define SPEAKER_LOW_FREQUENCY 0x00000008 - #define SPEAKER_BACK_LEFT 0x00000010 - #define SPEAKER_BACK_RIGHT 0x00000020 - #define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040 - #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080 - #define SPEAKER_BACK_CENTER 0x00000100 - #define SPEAKER_SIDE_LEFT 0x00000200 - #define SPEAKER_SIDE_RIGHT 0x00000400 - #define SPEAKER_TOP_CENTER 0x00000800 - #define SPEAKER_TOP_FRONT_LEFT 0x00001000 - #define SPEAKER_TOP_FRONT_CENTER 0x00002000 - #define SPEAKER_TOP_FRONT_RIGHT 0x00004000 - #define SPEAKER_TOP_BACK_LEFT 0x00008000 - #define SPEAKER_TOP_BACK_CENTER 0x00010000 - #define SPEAKER_TOP_BACK_RIGHT 0x00020000 - #define SPEAKER_RESERVED 0x7FFC0000 - #define SPEAKER_ALL 0x80000000 - #define _SPEAKER_POSITIONS_ -#endif - -#ifndef SPEAKER_STEREO - #define SPEAKER_MONO (SPEAKER_FRONT_CENTER) - #define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) - #define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY) - #define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) - #define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) - #define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) - #define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) - #define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) - #define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) - #define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) -#endif - - -#pragma pack(pop) - -#endif // #ifndef __AUDIODEFS_INCLUDED__ diff --git a/jan/src/dep/mingw/include/xaudio2/sal.h b/jan/src/dep/mingw/include/xaudio2/sal.h deleted file mode 100644 index 3f99ab9a9..000000000 --- a/jan/src/dep/mingw/include/xaudio2/sal.h +++ /dev/null @@ -1,252 +0,0 @@ -#pragma once - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -/*#define __null*/ // << Conflicts with GCC internal type __null -#define __notnull -#define __maybenull -#define __readonly -#define __notreadonly -#define __maybereadonly -#define __valid -#define __notvalid -#define __maybevalid -#define __readableTo(extent) -#define __elem_readableTo(size) -#define __byte_readableTo(size) -#define __writableTo(size) -#define __elem_writableTo(size) -#define __byte_writableTo(size) -#define __deref -#define __pre -#define __post -#define __precond(expr) -#define __postcond(expr) -#define __exceptthat -#define __execeptthat -#define __inner_success(expr) -#define __inner_checkReturn -#define __inner_typefix(ctype) -#define __inner_override -#define __inner_callback -#define __inner_blocksOn(resource) -#define __inner_fallthrough_dec -#define __inner_fallthrough -#define __refparam -#define __inner_control_entrypoint(category) -#define __inner_data_entrypoint(category) - -#define __ecount(size) -#define __bcount(size) -#define __in -#define __in_ecount(size) -#define __in_bcount(size) -#define __in_z -#define __in_ecount_z(size) -#define __in_bcount_z(size) -#define __in_nz -#define __in_ecount_nz(size) -#define __in_bcount_nz(size) -#define __out -#define __out_ecount(size) -#define __out_bcount(size) -#define __out_ecount_part(size,length) -#define __out_bcount_part(size,length) -#define __out_ecount_full(size) -#define __out_bcount_full(size) -#define __out_z -#define __out_z_opt -#define __out_ecount_z(size) -#define __out_bcount_z(size) -#define __out_ecount_part_z(size,length) -#define __out_bcount_part_z(size,length) -#define __out_ecount_full_z(size) -#define __out_bcount_full_z(size) -#define __out_nz -#define __out_nz_opt -#define __out_ecount_nz(size) -#define __out_bcount_nz(size) -#define __inout -#define __inout_ecount(size) -#define __inout_bcount(size) -#define __inout_ecount_part(size,length) -#define __inout_bcount_part(size,length) -#define __inout_ecount_full(size) -#define __inout_bcount_full(size) -#define __inout_z -#define __inout_ecount_z(size) -#define __inout_bcount_z(size) -#define __inout_nz -#define __inout_ecount_nz(size) -#define __inout_bcount_nz(size) -#define __ecount_opt(size) -#define __bcount_opt(size) -#define __in_opt -#define __in_ecount_opt(size) -#define __in_bcount_opt(size) -#define __in_z_opt -#define __in_ecount_z_opt(size) -#define __in_bcount_z_opt(size) -#define __in_nz_opt -#define __in_ecount_nz_opt(size) -#define __in_bcount_nz_opt(size) -#define __out_opt -#define __out_ecount_opt(size) -#define __out_bcount_opt(size) -#define __out_ecount_part_opt(size,length) -#define __out_bcount_part_opt(size,length) -#define __out_ecount_full_opt(size) -#define __out_bcount_full_opt(size) -#define __out_ecount_z_opt(size) -#define __out_bcount_z_opt(size) -#define __out_ecount_part_z_opt(size,length) -#define __out_bcount_part_z_opt(size,length) -#define __out_ecount_full_z_opt(size) -#define __out_bcount_full_z_opt(size) -#define __out_ecount_nz_opt(size) -#define __out_bcount_nz_opt(size) -#define __inout_opt -#define __inout_ecount_opt(size) -#define __inout_bcount_opt(size) -#define __inout_ecount_part_opt(size,length) -#define __inout_bcount_part_opt(size,length) -#define __inout_ecount_full_opt(size) -#define __inout_bcount_full_opt(size) -#define __inout_z_opt -#define __inout_ecount_z_opt(size) -#define __inout_ecount_z_opt(size) -#define __inout_bcount_z_opt(size) -#define __inout_nz_opt -#define __inout_ecount_nz_opt(size) -#define __inout_bcount_nz_opt(size) -#define __deref_ecount(size) -#define __deref_bcount(size) -#define __deref_out -#define __deref_out_ecount(size) -#define __deref_out_bcount(size) -#define __deref_out_ecount_part(size,length) -#define __deref_out_bcount_part(size,length) -#define __deref_out_ecount_full(size) -#define __deref_out_bcount_full(size) -#define __deref_out_z -#define __deref_out_ecount_z(size) -#define __deref_out_bcount_z(size) -#define __deref_out_nz -#define __deref_out_ecount_nz(size) -#define __deref_out_bcount_nz(size) -#define __deref_inout -#define __deref_inout_z -#define __deref_inout_ecount(size) -#define __deref_inout_bcount(size) -#define __deref_inout_ecount_part(size,length) -#define __deref_inout_bcount_part(size,length) -#define __deref_inout_ecount_full(size) -#define __deref_inout_bcount_full(size) -#define __deref_inout_z -#define __deref_inout_ecount_z(size) -#define __deref_inout_bcount_z(size) -#define __deref_inout_nz -#define __deref_inout_ecount_nz(size) -#define __deref_inout_bcount_nz(size) -#define __deref_ecount_opt(size) -#define __deref_bcount_opt(size) -#define __deref_out_opt -#define __deref_out_ecount_opt(size) -#define __deref_out_bcount_opt(size) -#define __deref_out_ecount_part_opt(size,length) -#define __deref_out_bcount_part_opt(size,length) -#define __deref_out_ecount_full_opt(size) -#define __deref_out_bcount_full_opt(size) -#define __deref_out_z_opt -#define __deref_out_ecount_z_opt(size) -#define __deref_out_bcount_z_opt(size) -#define __deref_out_nz_opt -#define __deref_out_ecount_nz_opt(size) -#define __deref_out_bcount_nz_opt(size) -#define __deref_inout_opt -#define __deref_inout_ecount_opt(size) -#define __deref_inout_bcount_opt(size) -#define __deref_inout_ecount_part_opt(size,length) -#define __deref_inout_bcount_part_opt(size,length) -#define __deref_inout_ecount_full_opt(size) -#define __deref_inout_bcount_full_opt(size) -#define __deref_inout_z_opt -#define __deref_inout_ecount_z_opt(size) -#define __deref_inout_bcount_z_opt(size) -#define __deref_inout_nz_opt -#define __deref_inout_ecount_nz_opt(size) -#define __deref_inout_bcount_nz_opt(size) -#define __deref_opt_ecount(size) -#define __deref_opt_bcount(size) -#define __deref_opt_out -#define __deref_opt_out_z -#define __deref_opt_out_ecount(size) -#define __deref_opt_out_bcount(size) -#define __deref_opt_out_ecount_part(size,length) -#define __deref_opt_out_bcount_part(size,length) -#define __deref_opt_out_ecount_full(size) -#define __deref_opt_out_bcount_full(size) -#define __deref_opt_inout -#define __deref_opt_inout_ecount(size) -#define __deref_opt_inout_bcount(size) -#define __deref_opt_inout_ecount_part(size,length) -#define __deref_opt_inout_bcount_part(size,length) -#define __deref_opt_inout_ecount_full(size) -#define __deref_opt_inout_bcount_full(size) -#define __deref_opt_inout_z -#define __deref_opt_inout_ecount_z(size) -#define __deref_opt_inout_bcount_z(size) -#define __deref_opt_inout_nz -#define __deref_opt_inout_ecount_nz(size) -#define __deref_opt_inout_bcount_nz(size) -#define __deref_opt_ecount_opt(size) -#define __deref_opt_bcount_opt(size) -#define __deref_opt_out_opt -#define __deref_opt_out_ecount_opt(size) -#define __deref_opt_out_bcount_opt(size) -#define __deref_opt_out_ecount_part_opt(size,length) -#define __deref_opt_out_bcount_part_opt(size,length) -#define __deref_opt_out_ecount_full_opt(size) -#define __deref_opt_out_bcount_full_opt(size) -#define __deref_opt_out_z_opt -#define __deref_opt_out_ecount_z_opt(size) -#define __deref_opt_out_bcount_z_opt(size) -#define __deref_opt_out_nz_opt -#define __deref_opt_out_ecount_nz_opt(size) -#define __deref_opt_out_bcount_nz_opt(size) -#define __deref_opt_inout_opt -#define __deref_opt_inout_ecount_opt(size) -#define __deref_opt_inout_bcount_opt(size) -#define __deref_opt_inout_ecount_part_opt(size,length) -#define __deref_opt_inout_bcount_part_opt(size,length) -#define __deref_opt_inout_ecount_full_opt(size) -#define __deref_opt_inout_bcount_full_opt(size) -#define __deref_opt_inout_z_opt -#define __deref_opt_inout_ecount_z_opt(size) -#define __deref_opt_inout_bcount_z_opt(size) -#define __deref_opt_inout_nz_opt -#define __deref_opt_inout_ecount_nz_opt(size) -#define __deref_opt_inout_bcount_nz_opt(size) - -#define __success(expr) -#define __nullterminated -#define __nullnullterminated -#define __reserved -#define __checkReturn -#define __typefix(ctype) -#define __override -#define __callback -#define __format_string -#define __blocksOn(resource) -#define __control_entrypoint(category) -#define __data_entrypoint(category) - -#ifndef __fallthrough - #define __fallthrough __inner_fallthrough -#endif - -#ifndef __analysis_assume - #define __analysis_assume(expr) -#endif diff --git a/jan/src/dep/mingw/include/xaudio2/xaudio2.h b/jan/src/dep/mingw/include/xaudio2/xaudio2.h deleted file mode 100644 index ca5df8cbb..000000000 --- a/jan/src/dep/mingw/include/xaudio2/xaudio2.h +++ /dev/null @@ -1,1290 +0,0 @@ -/*------------------------------------------------------------------------- - Moddified by CaptainCPS for use with MinGW / GCC 4.6.1 - - Thanks to PortAudio for their 'sal.h' compatible with MinGW ! --------------------------------------------------------------------------*/ - -/************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * File: xaudio2.h - * Content: Declarations for the XAudio2 game audio API. - * - **************************************************************************/ - -#ifndef __XAUDIO2_INCLUDED__ -#define __XAUDIO2_INCLUDED__ - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -/************************************************************************** - * - * XAudio2 COM object class and interface IDs. - * - **************************************************************************/ - -//#include // For DEFINE_CLSID and DEFINE_IID - -// XAudio 2.0 (March 2008 SDK) -//DEFINE_CLSID(XAudio2, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, aa); -//DEFINE_CLSID(XAudio2_Debug, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, db); - -// XAudio 2.1 (June 2008 SDK) -//DEFINE_CLSID(XAudio2, e21a7345, eb21, 468e, be, 50, 80, 4d, b9, 7c, f7, 08); -//DEFINE_CLSID(XAudio2_Debug, f7a76c21, 53d4, 46bb, ac, 53, 8b, 45, 9c, ae, 46, bd); - -// XAudio 2.2 (August 2008 SDK) -//DEFINE_CLSID(XAudio2, b802058a, 464a, 42db, bc, 10, b6, 50, d6, f2, 58, 6a); -//DEFINE_CLSID(XAudio2_Debug, 97dfb7e7, 5161, 4015, 87, a9, c7, 9e, 6a, 19, 52, cc); - -// XAudio 2.3 (November 2008 SDK) -//DEFINE_CLSID(XAudio2, 4c5e637a, 16c7, 4de3, 9c, 46, 5e, d2, 21, 81, 96, 2d); -//DEFINE_CLSID(XAudio2_Debug, ef0aa05d, 8075, 4e5d, be, ad, 45, be, 0c, 3c, cb, b3); - -// XAudio 2.4 (March 2009 SDK) -//DEFINE_CLSID(XAudio2, 03219e78, 5bc3, 44d1, b9, 2e, f6, 3d, 89, cc, 65, 26); -//DEFINE_CLSID(XAudio2_Debug, 4256535c, 1ea4, 4d4b, 8a, d5, f9, db, 76, 2e, ca, 9e); - -// XAudio 2.5 (August 2009 SDK) -//DEFINE_CLSID(XAudio2, 4c9b6dde, 6809, 46e6, a2, 78, 9b, 6a, 97, 58, 86, 70); -//DEFINE_CLSID(XAudio2_Debug, 715bdd1a, aa82, 436b, b0, fa, 6a, ce, a3, 9b, d0, a1); - -// XAudio 2.6 (February 2010 SDK) -//DEFINE_CLSID(XAudio2, 3eda9b49, 2085, 498b, 9b, b2, 39, a6, 77, 84, 93, de); -//DEFINE_CLSID(XAudio2_Debug, 47199894, 7cc2, 444d, 98, 73, ce, d2, 56, 2c, c6, 0e); - -// XAudio 2.7 (June 2010 SDK) -DEFINE_GUID(CLSID_XAudio2, 0x5a508685, 0xa254, 0x4fba, 0x9b, 0x82, 0x9a, 0x24, 0xb0, 0x03, 0x06, 0xaf); -DEFINE_GUID(CLSID_XAudio2_Debug, 0xdb05ea35, 0x0329, 0x4d4b, 0xa5, 0x3a, 0x6d, 0xea, 0xd0, 0x3d, 0x38, 0x52); -DEFINE_GUID(IID_IXAudio2, 0x8bcf1f58, 0x9fe7, 0x4583, 0x8a, 0xc6, 0xe2, 0xad, 0xc4, 0x65, 0xc8, 0xbb); - -// Ignore the rest of this header if only the GUID definitions were requested -#ifndef GUID_DEFS_ONLY - -#ifdef _XBOX - #include // Xbox COM declarations (IUnknown, etc) -#else - #include // Windows COM declarations -#endif - -#include // Markers for documenting API semantics -#include // Basic audio data types and constants -#include // Data types and constants for XMA2 audio - -// All structures defined in this file use tight field packing -#pragma pack(push, 1) - - -/************************************************************************** - * - * XAudio2 constants, flags and error codes. - * - **************************************************************************/ - -// Numeric boundary values -#define XAUDIO2_MAX_BUFFER_BYTES 0x80000000 // Maximum bytes allowed in a source buffer -#define XAUDIO2_MAX_QUEUED_BUFFERS 64 // Maximum buffers allowed in a voice queue -#define XAUDIO2_MAX_BUFFERS_SYSTEM 2 // Maximum buffers allowed for system threads (Xbox 360 only) -#define XAUDIO2_MAX_AUDIO_CHANNELS 64 // Maximum channels in an audio stream -#define XAUDIO2_MIN_SAMPLE_RATE 1000 // Minimum audio sample rate supported -#define XAUDIO2_MAX_SAMPLE_RATE 200000 // Maximum audio sample rate supported -#define XAUDIO2_MAX_VOLUME_LEVEL 16777216.0f // Maximum acceptable volume level (2^24) -#define XAUDIO2_MIN_FREQ_RATIO (1/1024.0f) // Minimum SetFrequencyRatio argument -#define XAUDIO2_MAX_FREQ_RATIO 1024.0f // Maximum MaxFrequencyRatio argument -#define XAUDIO2_DEFAULT_FREQ_RATIO 2.0f // Default MaxFrequencyRatio argument -#define XAUDIO2_MAX_FILTER_ONEOVERQ 1.5f // Maximum XAUDIO2_FILTER_PARAMETERS.OneOverQ -#define XAUDIO2_MAX_FILTER_FREQUENCY 1.0f // Maximum XAUDIO2_FILTER_PARAMETERS.Frequency -#define XAUDIO2_MAX_LOOP_COUNT 254 // Maximum non-infinite XAUDIO2_BUFFER.LoopCount -#define XAUDIO2_MAX_INSTANCES 8 // Maximum simultaneous XAudio2 objects on Xbox 360 - -// For XMA voices on Xbox 360 there is an additional restriction on the MaxFrequencyRatio -// argument and the voice's sample rate: the product of these numbers cannot exceed 600000 -// for one-channel voices or 300000 for voices with more than one channel. -#define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO 600000 -#define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL 300000 - -// Numeric values with special meanings -#define XAUDIO2_COMMIT_NOW 0 // Used as an OperationSet argument -#define XAUDIO2_COMMIT_ALL 0 // Used in IXAudio2::CommitChanges -#define XAUDIO2_INVALID_OPSET (UINT32)(-1) // Not allowed for OperationSet arguments -#define XAUDIO2_NO_LOOP_REGION 0 // Used in XAUDIO2_BUFFER.LoopCount -#define XAUDIO2_LOOP_INFINITE 255 // Used in XAUDIO2_BUFFER.LoopCount -#define XAUDIO2_DEFAULT_CHANNELS 0 // Used in CreateMasteringVoice -#define XAUDIO2_DEFAULT_SAMPLERATE 0 // Used in CreateMasteringVoice - -// Flags -#define XAUDIO2_DEBUG_ENGINE 0x0001 // Used in XAudio2Create on Windows only -#define XAUDIO2_VOICE_NOPITCH 0x0002 // Used in IXAudio2::CreateSourceVoice -#define XAUDIO2_VOICE_NOSRC 0x0004 // Used in IXAudio2::CreateSourceVoice -#define XAUDIO2_VOICE_USEFILTER 0x0008 // Used in IXAudio2::CreateSource/SubmixVoice -#define XAUDIO2_VOICE_MUSIC 0x0010 // Used in IXAudio2::CreateSourceVoice -#define XAUDIO2_PLAY_TAILS 0x0020 // Used in IXAudio2SourceVoice::Stop -#define XAUDIO2_END_OF_STREAM 0x0040 // Used in XAUDIO2_BUFFER.Flags -#define XAUDIO2_SEND_USEFILTER 0x0080 // Used in XAUDIO2_SEND_DESCRIPTOR.Flags - -// Default parameters for the built-in filter -#define XAUDIO2_DEFAULT_FILTER_TYPE LowPassFilter -#define XAUDIO2_DEFAULT_FILTER_FREQUENCY XAUDIO2_MAX_FILTER_FREQUENCY -#define XAUDIO2_DEFAULT_FILTER_ONEOVERQ 1.0f - -// Internal XAudio2 constants -#ifdef _XBOX - #define XAUDIO2_QUANTUM_NUMERATOR 2 // On Xbox 360, XAudio2 processes audio - #define XAUDIO2_QUANTUM_DENOMINATOR 375 // in 5.333ms chunks (= 2/375 seconds) -#else - #define XAUDIO2_QUANTUM_NUMERATOR 1 // On Windows, XAudio2 processes audio - #define XAUDIO2_QUANTUM_DENOMINATOR 100 // in 10ms chunks (= 1/100 seconds) -#endif -#define XAUDIO2_QUANTUM_MS (1000.0f * XAUDIO2_QUANTUM_NUMERATOR / XAUDIO2_QUANTUM_DENOMINATOR) - -// XAudio2 error codes -#define FACILITY_XAUDIO2 0x896 -#define XAUDIO2_E_INVALID_CALL 0x88960001 // An API call or one of its arguments was illegal -#define XAUDIO2_E_XMA_DECODER_ERROR 0x88960002 // The XMA hardware suffered an unrecoverable error -#define XAUDIO2_E_XAPO_CREATION_FAILED 0x88960003 // XAudio2 failed to initialize an XAPO effect -#define XAUDIO2_E_DEVICE_INVALIDATED 0x88960004 // An audio device became unusable (unplugged, etc) - - -/************************************************************************** - * - * Forward declarations for the XAudio2 interfaces. - * - **************************************************************************/ - -#ifdef __cplusplus - #define FWD_DECLARE(x) interface x -#else - #define FWD_DECLARE(x) typedef interface x x -#endif - -FWD_DECLARE(IXAudio2); -FWD_DECLARE(IXAudio2Voice); -FWD_DECLARE(IXAudio2SourceVoice); -FWD_DECLARE(IXAudio2SubmixVoice); -FWD_DECLARE(IXAudio2MasteringVoice); -FWD_DECLARE(IXAudio2EngineCallback); -FWD_DECLARE(IXAudio2VoiceCallback); - - -/************************************************************************** - * - * XAudio2 structures and enumerations. - * - **************************************************************************/ - -// Used in IXAudio2::Initialize -#ifdef _XBOX - typedef enum XAUDIO2_XBOX_HWTHREAD_SPECIFIER - { - XboxThread0 = 0x01, - XboxThread1 = 0x02, - XboxThread2 = 0x04, - XboxThread3 = 0x08, - XboxThread4 = 0x10, - XboxThread5 = 0x20, - XAUDIO2_ANY_PROCESSOR = XboxThread4, - XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR - } XAUDIO2_XBOX_HWTHREAD_SPECIFIER, XAUDIO2_PROCESSOR; -#else - typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER - { - Processor1 = 0x00000001, - Processor2 = 0x00000002, - Processor3 = 0x00000004, - Processor4 = 0x00000008, - Processor5 = 0x00000010, - Processor6 = 0x00000020, - Processor7 = 0x00000040, - Processor8 = 0x00000080, - Processor9 = 0x00000100, - Processor10 = 0x00000200, - Processor11 = 0x00000400, - Processor12 = 0x00000800, - Processor13 = 0x00001000, - Processor14 = 0x00002000, - Processor15 = 0x00004000, - Processor16 = 0x00008000, - Processor17 = 0x00010000, - Processor18 = 0x00020000, - Processor19 = 0x00040000, - Processor20 = 0x00080000, - Processor21 = 0x00100000, - Processor22 = 0x00200000, - Processor23 = 0x00400000, - Processor24 = 0x00800000, - Processor25 = 0x01000000, - Processor26 = 0x02000000, - Processor27 = 0x04000000, - Processor28 = 0x08000000, - Processor29 = 0x10000000, - Processor30 = 0x20000000, - Processor31 = 0x40000000, - Processor32 = 0x80000000, - XAUDIO2_ANY_PROCESSOR = 0xffffffff, - XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR - } XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER, XAUDIO2_PROCESSOR; -#endif - -// Used in XAUDIO2_DEVICE_DETAILS below to describe the types of applications -// that the user has specified each device as a default for. 0 means that the -// device isn't the default for any role. -typedef enum XAUDIO2_DEVICE_ROLE -{ - NotDefaultDevice = 0x0, - DefaultConsoleDevice = 0x1, - DefaultMultimediaDevice = 0x2, - DefaultCommunicationsDevice = 0x4, - DefaultGameDevice = 0x8, - GlobalDefaultDevice = 0xf, - InvalidDeviceRole = ~GlobalDefaultDevice -} XAUDIO2_DEVICE_ROLE; - -// Returned by IXAudio2::GetDeviceDetails -typedef struct XAUDIO2_DEVICE_DETAILS -{ - WCHAR DeviceID[256]; // String identifier for the audio device. - WCHAR DisplayName[256]; // Friendly name suitable for display to a human. - XAUDIO2_DEVICE_ROLE Role; // Roles that the device should be used for. - WAVEFORMATEXTENSIBLE OutputFormat; // The device's native PCM audio output format. -} XAUDIO2_DEVICE_DETAILS; - -// Returned by IXAudio2Voice::GetVoiceDetails -typedef struct XAUDIO2_VOICE_DETAILS -{ - UINT32 CreationFlags; // Flags the voice was created with. - UINT32 InputChannels; // Channels in the voice's input audio. - UINT32 InputSampleRate; // Sample rate of the voice's input audio. -} XAUDIO2_VOICE_DETAILS; - -// Used in XAUDIO2_VOICE_SENDS below -typedef struct XAUDIO2_SEND_DESCRIPTOR -{ - UINT32 Flags; // Either 0 or XAUDIO2_SEND_USEFILTER. - IXAudio2Voice* pOutputVoice; // This send's destination voice. -} XAUDIO2_SEND_DESCRIPTOR; - -// Used in the voice creation functions and in IXAudio2Voice::SetOutputVoices -typedef struct XAUDIO2_VOICE_SENDS -{ - UINT32 SendCount; // Number of sends from this voice. - XAUDIO2_SEND_DESCRIPTOR* pSends; // Array of SendCount send descriptors. -} XAUDIO2_VOICE_SENDS; - -// Used in XAUDIO2_EFFECT_CHAIN below -typedef struct XAUDIO2_EFFECT_DESCRIPTOR -{ - IUnknown* pEffect; // Pointer to the effect object's IUnknown interface. - BOOL InitialState; // TRUE if the effect should begin in the enabled state. - UINT32 OutputChannels; // How many output channels the effect should produce. -} XAUDIO2_EFFECT_DESCRIPTOR; - -// Used in the voice creation functions and in IXAudio2Voice::SetEffectChain -typedef struct XAUDIO2_EFFECT_CHAIN -{ - UINT32 EffectCount; // Number of effects in this voice's effect chain. - XAUDIO2_EFFECT_DESCRIPTOR* pEffectDescriptors; // Array of effect descriptors. -} XAUDIO2_EFFECT_CHAIN; - -// Used in XAUDIO2_FILTER_PARAMETERS below -typedef enum XAUDIO2_FILTER_TYPE -{ - LowPassFilter, // Attenuates frequencies above the cutoff frequency. - BandPassFilter, // Attenuates frequencies outside a given range. - HighPassFilter, // Attenuates frequencies below the cutoff frequency. - NotchFilter // Attenuates frequencies inside a given range. -} XAUDIO2_FILTER_TYPE; - -// Used in IXAudio2Voice::Set/GetFilterParameters and Set/GetOutputFilterParameters -typedef struct XAUDIO2_FILTER_PARAMETERS -{ - XAUDIO2_FILTER_TYPE Type; // Low-pass, band-pass or high-pass. - float Frequency; // Radian frequency (2 * sin(pi*CutoffFrequency/SampleRate)); - // must be >= 0 and <= XAUDIO2_MAX_FILTER_FREQUENCY - // (giving a maximum CutoffFrequency of SampleRate/6). - float OneOverQ; // Reciprocal of the filter's quality factor Q; - // must be > 0 and <= XAUDIO2_MAX_FILTER_ONEOVERQ. -} XAUDIO2_FILTER_PARAMETERS; - -// Used in IXAudio2SourceVoice::SubmitSourceBuffer -typedef struct XAUDIO2_BUFFER -{ - UINT32 Flags; // Either 0 or XAUDIO2_END_OF_STREAM. - UINT32 AudioBytes; // Size of the audio data buffer in bytes. - const BYTE* pAudioData; // Pointer to the audio data buffer. - UINT32 PlayBegin; // First sample in this buffer to be played. - UINT32 PlayLength; // Length of the region to be played in samples, - // or 0 to play the whole buffer. - UINT32 LoopBegin; // First sample of the region to be looped. - UINT32 LoopLength; // Length of the desired loop region in samples, - // or 0 to loop the entire buffer. - UINT32 LoopCount; // Number of times to repeat the loop region, - // or XAUDIO2_LOOP_INFINITE to loop forever. - void* pContext; // Context value to be passed back in callbacks. -} XAUDIO2_BUFFER; - -// Used in IXAudio2SourceVoice::SubmitSourceBuffer when submitting XWMA data. -// NOTE: If an XWMA sound is submitted in more than one buffer, each buffer's -// pDecodedPacketCumulativeBytes[PacketCount-1] value must be subtracted from -// all the entries in the next buffer's pDecodedPacketCumulativeBytes array. -// And whether a sound is submitted in more than one buffer or not, the final -// buffer of the sound should use the XAUDIO2_END_OF_STREAM flag, or else the -// client must call IXAudio2SourceVoice::Discontinuity after submitting it. -typedef struct XAUDIO2_BUFFER_WMA -{ - const UINT32* pDecodedPacketCumulativeBytes; // Decoded packet's cumulative size array. - // Each element is the number of bytes accumulated - // when the corresponding XWMA packet is decoded in - // order. The array must have PacketCount elements. - UINT32 PacketCount; // Number of XWMA packets submitted. Must be >= 1 and - // divide evenly into XAUDIO2_BUFFER.AudioBytes. -} XAUDIO2_BUFFER_WMA; - -// Returned by IXAudio2SourceVoice::GetState -typedef struct XAUDIO2_VOICE_STATE -{ - void* pCurrentBufferContext; // The pContext value provided in the XAUDIO2_BUFFER - // that is currently being processed, or NULL if - // there are no buffers in the queue. - UINT32 BuffersQueued; // Number of buffers currently queued on the voice - // (including the one that is being processed). - UINT64 SamplesPlayed; // Total number of samples produced by the voice since - // it began processing the current audio stream. -} XAUDIO2_VOICE_STATE; - -// Returned by IXAudio2::GetPerformanceData -typedef struct XAUDIO2_PERFORMANCE_DATA -{ - // CPU usage information - UINT64 AudioCyclesSinceLastQuery; // CPU cycles spent on audio processing since the - // last call to StartEngine or GetPerformanceData. - UINT64 TotalCyclesSinceLastQuery; // Total CPU cycles elapsed since the last call - // (only counts the CPU XAudio2 is running on). - UINT32 MinimumCyclesPerQuantum; // Fewest CPU cycles spent processing any one - // audio quantum since the last call. - UINT32 MaximumCyclesPerQuantum; // Most CPU cycles spent processing any one - // audio quantum since the last call. - - // Memory usage information - UINT32 MemoryUsageInBytes; // Total heap space currently in use. - - // Audio latency and glitching information - UINT32 CurrentLatencyInSamples; // Minimum delay from when a sample is read from a - // source buffer to when it reaches the speakers. - UINT32 GlitchesSinceEngineStarted; // Audio dropouts since the engine was started. - - // Data about XAudio2's current workload - UINT32 ActiveSourceVoiceCount; // Source voices currently playing. - UINT32 TotalSourceVoiceCount; // Source voices currently existing. - UINT32 ActiveSubmixVoiceCount; // Submix voices currently playing/existing. - - UINT32 ActiveResamplerCount; // Resample xAPOs currently active. - UINT32 ActiveMatrixMixCount; // MatrixMix xAPOs currently active. - - // Usage of the hardware XMA decoder (Xbox 360 only) - UINT32 ActiveXmaSourceVoices; // Number of source voices decoding XMA data. - UINT32 ActiveXmaStreams; // A voice can use more than one XMA stream. -} XAUDIO2_PERFORMANCE_DATA; - -// Used in IXAudio2::SetDebugConfiguration -typedef struct XAUDIO2_DEBUG_CONFIGURATION -{ - UINT32 TraceMask; // Bitmap of enabled debug message types. - UINT32 BreakMask; // Message types that will break into the debugger. - BOOL LogThreadID; // Whether to log the thread ID with each message. - BOOL LogFileline; // Whether to log the source file and line number. - BOOL LogFunctionName; // Whether to log the function name. - BOOL LogTiming; // Whether to log message timestamps. -} XAUDIO2_DEBUG_CONFIGURATION; - -// Values for the TraceMask and BreakMask bitmaps. Only ERRORS and WARNINGS -// are valid in BreakMask. WARNINGS implies ERRORS, DETAIL implies INFO, and -// FUNC_CALLS implies API_CALLS. By default, TraceMask is ERRORS and WARNINGS -// and all the other settings are zero. -#define XAUDIO2_LOG_ERRORS 0x0001 // For handled errors with serious effects. -#define XAUDIO2_LOG_WARNINGS 0x0002 // For handled errors that may be recoverable. -#define XAUDIO2_LOG_INFO 0x0004 // Informational chit-chat (e.g. state changes). -#define XAUDIO2_LOG_DETAIL 0x0008 // More detailed chit-chat. -#define XAUDIO2_LOG_API_CALLS 0x0010 // Public API function entries and exits. -#define XAUDIO2_LOG_FUNC_CALLS 0x0020 // Internal function entries and exits. -#define XAUDIO2_LOG_TIMING 0x0040 // Delays detected and other timing data. -#define XAUDIO2_LOG_LOCKS 0x0080 // Usage of critical sections and mutexes. -#define XAUDIO2_LOG_MEMORY 0x0100 // Memory heap usage information. -#define XAUDIO2_LOG_STREAMING 0x1000 // Audio streaming information. - - -/************************************************************************** - * - * IXAudio2: Top-level XAudio2 COM interface. - * - **************************************************************************/ - -// Use default arguments if compiling as C++ -#ifdef __cplusplus - #define X2DEFAULT(x) =x -#else - #define X2DEFAULT(x) -#endif - -#undef INTERFACE -#define INTERFACE IXAudio2 -DECLARE_INTERFACE_(IXAudio2, IUnknown) -{ - // NAME: IXAudio2::QueryInterface - // DESCRIPTION: Queries for a given COM interface on the XAudio2 object. - // Only IID_IUnknown and IID_IXAudio2 are supported. - // - // ARGUMENTS: - // riid - IID of the interface to be obtained. - // ppvInterface - Returns a pointer to the requested interface. - // - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __deref_out void** ppvInterface) PURE; - - // NAME: IXAudio2::AddRef - // DESCRIPTION: Adds a reference to the XAudio2 object. - // - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - - // NAME: IXAudio2::Release - // DESCRIPTION: Releases a reference to the XAudio2 object. - // - STDMETHOD_(ULONG, Release) (THIS) PURE; - - // NAME: IXAudio2::GetDeviceCount - // DESCRIPTION: Returns the number of audio output devices available. - // - // ARGUMENTS: - // pCount - Returns the device count. - // - STDMETHOD(GetDeviceCount) (THIS_ __out UINT32* pCount) PURE; - - // NAME: IXAudio2::GetDeviceDetails - // DESCRIPTION: Returns information about the device with the given index. - // - // ARGUMENTS: - // Index - Index of the device to be queried. - // pDeviceDetails - Returns the device details. - // - STDMETHOD(GetDeviceDetails) (THIS_ UINT32 Index, __out XAUDIO2_DEVICE_DETAILS* pDeviceDetails) PURE; - - // NAME: IXAudio2::Initialize - // DESCRIPTION: Sets global XAudio2 parameters and prepares it for use. - // - // ARGUMENTS: - // Flags - Flags specifying the XAudio2 object's behavior. Currently unused. - // XAudio2Processor - An XAUDIO2_PROCESSOR enumeration value that specifies - // the hardware thread (Xbox) or processor (Windows) that XAudio2 will use. - // The enumeration values are platform-specific; platform-independent code - // can use XAUDIO2_DEFAULT_PROCESSOR to use the default on each platform. - // - STDMETHOD(Initialize) (THIS_ UINT32 Flags X2DEFAULT(0), - XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) PURE; - - // NAME: IXAudio2::RegisterForCallbacks - // DESCRIPTION: Adds a new client to receive XAudio2's engine callbacks. - // - // ARGUMENTS: - // pCallback - Callback interface to be called during each processing pass. - // - STDMETHOD(RegisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE; - - // NAME: IXAudio2::UnregisterForCallbacks - // DESCRIPTION: Removes an existing receiver of XAudio2 engine callbacks. - // - // ARGUMENTS: - // pCallback - Previously registered callback interface to be removed. - // - STDMETHOD_(void, UnregisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE; - - // NAME: IXAudio2::CreateSourceVoice - // DESCRIPTION: Creates and configures a source voice. - // - // ARGUMENTS: - // ppSourceVoice - Returns the new object's IXAudio2SourceVoice interface. - // pSourceFormat - Format of the audio that will be fed to the voice. - // Flags - XAUDIO2_VOICE flags specifying the source voice's behavior. - // MaxFrequencyRatio - Maximum SetFrequencyRatio argument to be allowed. - // pCallback - Optional pointer to a client-provided callback interface. - // pSendList - Optional list of voices this voice should send audio to. - // pEffectChain - Optional list of effects to apply to the audio data. - // - STDMETHOD(CreateSourceVoice) (THIS_ __deref_out IXAudio2SourceVoice** ppSourceVoice, - __in const WAVEFORMATEX* pSourceFormat, - UINT32 Flags X2DEFAULT(0), - float MaxFrequencyRatio X2DEFAULT(XAUDIO2_DEFAULT_FREQ_RATIO), - __in_opt IXAudio2VoiceCallback* pCallback X2DEFAULT(NULL), - __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL), - __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; - - // NAME: IXAudio2::CreateSubmixVoice - // DESCRIPTION: Creates and configures a submix voice. - // - // ARGUMENTS: - // ppSubmixVoice - Returns the new object's IXAudio2SubmixVoice interface. - // InputChannels - Number of channels in this voice's input audio data. - // InputSampleRate - Sample rate of this voice's input audio data. - // Flags - XAUDIO2_VOICE flags specifying the submix voice's behavior. - // ProcessingStage - Arbitrary number that determines the processing order. - // pSendList - Optional list of voices this voice should send audio to. - // pEffectChain - Optional list of effects to apply to the audio data. - // - STDMETHOD(CreateSubmixVoice) (THIS_ __deref_out IXAudio2SubmixVoice** ppSubmixVoice, - UINT32 InputChannels, UINT32 InputSampleRate, - UINT32 Flags X2DEFAULT(0), UINT32 ProcessingStage X2DEFAULT(0), - __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL), - __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; - - - // NAME: IXAudio2::CreateMasteringVoice - // DESCRIPTION: Creates and configures a mastering voice. - // - // ARGUMENTS: - // ppMasteringVoice - Returns the new object's IXAudio2MasteringVoice interface. - // InputChannels - Number of channels in this voice's input audio data. - // InputSampleRate - Sample rate of this voice's input audio data. - // Flags - XAUDIO2_VOICE flags specifying the mastering voice's behavior. - // DeviceIndex - Identifier of the device to receive the output audio. - // pEffectChain - Optional list of effects to apply to the audio data. - // - STDMETHOD(CreateMasteringVoice) (THIS_ __deref_out IXAudio2MasteringVoice** ppMasteringVoice, - UINT32 InputChannels X2DEFAULT(XAUDIO2_DEFAULT_CHANNELS), - UINT32 InputSampleRate X2DEFAULT(XAUDIO2_DEFAULT_SAMPLERATE), - UINT32 Flags X2DEFAULT(0), UINT32 DeviceIndex X2DEFAULT(0), - __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; - - // NAME: IXAudio2::StartEngine - // DESCRIPTION: Creates and starts the audio processing thread. - // - STDMETHOD(StartEngine) (THIS) PURE; - - // NAME: IXAudio2::StopEngine - // DESCRIPTION: Stops and destroys the audio processing thread. - // - STDMETHOD_(void, StopEngine) (THIS) PURE; - - // NAME: IXAudio2::CommitChanges - // DESCRIPTION: Atomically applies a set of operations previously tagged - // with a given identifier. - // - // ARGUMENTS: - // OperationSet - Identifier of the set of operations to be applied. - // - STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE; - - // NAME: IXAudio2::GetPerformanceData - // DESCRIPTION: Returns current resource usage details: memory, CPU, etc. - // - // ARGUMENTS: - // pPerfData - Returns the performance data structure. - // - STDMETHOD_(void, GetPerformanceData) (THIS_ __out XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE; - - // NAME: IXAudio2::SetDebugConfiguration - // DESCRIPTION: Configures XAudio2's debug output (in debug builds only). - // - // ARGUMENTS: - // pDebugConfiguration - Structure describing the debug output behavior. - // pReserved - Optional parameter; must be NULL. - // - STDMETHOD_(void, SetDebugConfiguration) (THIS_ __in_opt const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration, - __in_opt __reserved void* pReserved X2DEFAULT(NULL)) PURE; -}; - - -/************************************************************************** - * - * IXAudio2Voice: Base voice management interface. - * - **************************************************************************/ - -#undef INTERFACE -#define INTERFACE IXAudio2Voice -DECLARE_INTERFACE(IXAudio2Voice) -{ - // These methods are declared in a macro so that the same declarations - // can be used in the derived voice types (IXAudio2SourceVoice, etc). - - #define Declare_IXAudio2Voice_Methods() \ - \ - /* NAME: IXAudio2Voice::GetVoiceDetails - // DESCRIPTION: Returns the basic characteristics of this voice. - // - // ARGUMENTS: - // pVoiceDetails - Returns the voice's details. - */\ - STDMETHOD_(void, GetVoiceDetails) (THIS_ __out XAUDIO2_VOICE_DETAILS* pVoiceDetails) PURE; \ - \ - /* NAME: IXAudio2Voice::SetOutputVoices - // DESCRIPTION: Replaces the set of submix/mastering voices that receive - // this voice's output. - // - // ARGUMENTS: - // pSendList - Optional list of voices this voice should send audio to. - */\ - STDMETHOD(SetOutputVoices) (THIS_ __in_opt const XAUDIO2_VOICE_SENDS* pSendList) PURE; \ - \ - /* NAME: IXAudio2Voice::SetEffectChain - // DESCRIPTION: Replaces this voice's current effect chain with a new one. - // - // ARGUMENTS: - // pEffectChain - Structure describing the new effect chain to be used. - */\ - STDMETHOD(SetEffectChain) (THIS_ __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain) PURE; \ - \ - /* NAME: IXAudio2Voice::EnableEffect - // DESCRIPTION: Enables an effect in this voice's effect chain. - // - // ARGUMENTS: - // EffectIndex - Index of an effect within this voice's effect chain. - // OperationSet - Used to identify this call as part of a deferred batch. - */\ - STDMETHOD(EnableEffect) (THIS_ UINT32 EffectIndex, \ - UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ - \ - /* NAME: IXAudio2Voice::DisableEffect - // DESCRIPTION: Disables an effect in this voice's effect chain. - // - // ARGUMENTS: - // EffectIndex - Index of an effect within this voice's effect chain. - // OperationSet - Used to identify this call as part of a deferred batch. - */\ - STDMETHOD(DisableEffect) (THIS_ UINT32 EffectIndex, \ - UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ - \ - /* NAME: IXAudio2Voice::GetEffectState - // DESCRIPTION: Returns the running state of an effect. - // - // ARGUMENTS: - // EffectIndex - Index of an effect within this voice's effect chain. - // pEnabled - Returns the enabled/disabled state of the given effect. - */\ - STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, __out BOOL* pEnabled) PURE; \ - \ - /* NAME: IXAudio2Voice::SetEffectParameters - // DESCRIPTION: Sets effect-specific parameters. - // - // REMARKS: Unlike IXAPOParameters::SetParameters, this method may - // be called from any thread. XAudio2 implements - // appropriate synchronization to copy the parameters to the - // realtime audio processing thread. - // - // ARGUMENTS: - // EffectIndex - Index of an effect within this voice's effect chain. - // pParameters - Pointer to an effect-specific parameters block. - // ParametersByteSize - Size of the pParameters array in bytes. - // OperationSet - Used to identify this call as part of a deferred batch. - */\ - STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \ - __in_bcount(ParametersByteSize) const void* pParameters, \ - UINT32 ParametersByteSize, \ - UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ - \ - /* NAME: IXAudio2Voice::GetEffectParameters - // DESCRIPTION: Obtains the current effect-specific parameters. - // - // ARGUMENTS: - // EffectIndex - Index of an effect within this voice's effect chain. - // pParameters - Returns the current values of the effect-specific parameters. - // ParametersByteSize - Size of the pParameters array in bytes. - */\ - STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, \ - __out_bcount(ParametersByteSize) void* pParameters, \ - UINT32 ParametersByteSize) PURE; \ - \ - /* NAME: IXAudio2Voice::SetFilterParameters - // DESCRIPTION: Sets this voice's filter parameters. - // - // ARGUMENTS: - // pParameters - Pointer to the filter's parameter structure. - // OperationSet - Used to identify this call as part of a deferred batch. - */\ - STDMETHOD(SetFilterParameters) (THIS_ __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \ - UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ - \ - /* NAME: IXAudio2Voice::GetFilterParameters - // DESCRIPTION: Returns this voice's current filter parameters. - // - // ARGUMENTS: - // pParameters - Returns the filter parameters. - */\ - STDMETHOD_(void, GetFilterParameters) (THIS_ __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \ - \ - /* NAME: IXAudio2Voice::SetOutputFilterParameters - // DESCRIPTION: Sets the filter parameters on one of this voice's sends. - // - // ARGUMENTS: - // pDestinationVoice - Destination voice of the send whose filter parameters will be set. - // pParameters - Pointer to the filter's parameter structure. - // OperationSet - Used to identify this call as part of a deferred batch. - */\ - STDMETHOD(SetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ - __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \ - UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ - \ - /* NAME: IXAudio2Voice::GetOutputFilterParameters - // DESCRIPTION: Returns the filter parameters from one of this voice's sends. - // - // ARGUMENTS: - // pDestinationVoice - Destination voice of the send whose filter parameters will be read. - // pParameters - Returns the filter parameters. - */\ - STDMETHOD_(void, GetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ - __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \ - \ - /* NAME: IXAudio2Voice::SetVolume - // DESCRIPTION: Sets this voice's overall volume level. - // - // ARGUMENTS: - // Volume - New overall volume level to be used, as an amplitude factor. - // OperationSet - Used to identify this call as part of a deferred batch. - */\ - STDMETHOD(SetVolume) (THIS_ float Volume, \ - UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ - \ - /* NAME: IXAudio2Voice::GetVolume - // DESCRIPTION: Obtains this voice's current overall volume level. - // - // ARGUMENTS: - // pVolume: Returns the voice's current overall volume level. - */\ - STDMETHOD_(void, GetVolume) (THIS_ __out float* pVolume) PURE; \ - \ - /* NAME: IXAudio2Voice::SetChannelVolumes - // DESCRIPTION: Sets this voice's per-channel volume levels. - // - // ARGUMENTS: - // Channels - Used to confirm the voice's channel count. - // pVolumes - Array of per-channel volume levels to be used. - // OperationSet - Used to identify this call as part of a deferred batch. - */\ - STDMETHOD(SetChannelVolumes) (THIS_ UINT32 Channels, __in_ecount(Channels) const float* pVolumes, \ - UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ - \ - /* NAME: IXAudio2Voice::GetChannelVolumes - // DESCRIPTION: Returns this voice's current per-channel volume levels. - // - // ARGUMENTS: - // Channels - Used to confirm the voice's channel count. - // pVolumes - Returns an array of the current per-channel volume levels. - */\ - STDMETHOD_(void, GetChannelVolumes) (THIS_ UINT32 Channels, __out_ecount(Channels) float* pVolumes) PURE; \ - \ - /* NAME: IXAudio2Voice::SetOutputMatrix - // DESCRIPTION: Sets the volume levels used to mix from each channel of this - // voice's output audio to each channel of a given destination - // voice's input audio. - // - // ARGUMENTS: - // pDestinationVoice - The destination voice whose mix matrix to change. - // SourceChannels - Used to confirm this voice's output channel count - // (the number of channels produced by the last effect in the chain). - // DestinationChannels - Confirms the destination voice's input channels. - // pLevelMatrix - Array of [SourceChannels * DestinationChannels] send - // levels. The level used to send from source channel S to destination - // channel D should be in pLevelMatrix[S + SourceChannels * D]. - // OperationSet - Used to identify this call as part of a deferred batch. - */\ - STDMETHOD(SetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ - UINT32 SourceChannels, UINT32 DestinationChannels, \ - __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix, \ - UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ - \ - /* NAME: IXAudio2Voice::GetOutputMatrix - // DESCRIPTION: Obtains the volume levels used to send each channel of this - // voice's output audio to each channel of a given destination - // voice's input audio. - // - // ARGUMENTS: - // pDestinationVoice - The destination voice whose mix matrix to obtain. - // SourceChannels - Used to confirm this voice's output channel count - // (the number of channels produced by the last effect in the chain). - // DestinationChannels - Confirms the destination voice's input channels. - // pLevelMatrix - Array of send levels, as above. - */\ - STDMETHOD_(void, GetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ - UINT32 SourceChannels, UINT32 DestinationChannels, \ - __out_ecount(SourceChannels * DestinationChannels) float* pLevelMatrix) PURE; \ - \ - /* NAME: IXAudio2Voice::DestroyVoice - // DESCRIPTION: Destroys this voice, stopping it if necessary and removing - // it from the XAudio2 graph. - */\ - STDMETHOD_(void, DestroyVoice) (THIS) PURE - - Declare_IXAudio2Voice_Methods(); -}; - - -/************************************************************************** - * - * IXAudio2SourceVoice: Source voice management interface. - * - **************************************************************************/ - -#undef INTERFACE -#define INTERFACE IXAudio2SourceVoice -DECLARE_INTERFACE_(IXAudio2SourceVoice, IXAudio2Voice) -{ - // Methods from IXAudio2Voice base interface - Declare_IXAudio2Voice_Methods(); - - // NAME: IXAudio2SourceVoice::Start - // DESCRIPTION: Makes this voice start consuming and processing audio. - // - // ARGUMENTS: - // Flags - Flags controlling how the voice should be started. - // OperationSet - Used to identify this call as part of a deferred batch. - // - STDMETHOD(Start) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; - - // NAME: IXAudio2SourceVoice::Stop - // DESCRIPTION: Makes this voice stop consuming audio. - // - // ARGUMENTS: - // Flags - Flags controlling how the voice should be stopped. - // OperationSet - Used to identify this call as part of a deferred batch. - // - STDMETHOD(Stop) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; - - // NAME: IXAudio2SourceVoice::SubmitSourceBuffer - // DESCRIPTION: Adds a new audio buffer to this voice's input queue. - // - // ARGUMENTS: - // pBuffer - Pointer to the buffer structure to be queued. - // pBufferWMA - Additional structure used only when submitting XWMA data. - // - STDMETHOD(SubmitSourceBuffer) (THIS_ __in const XAUDIO2_BUFFER* pBuffer, __in_opt const XAUDIO2_BUFFER_WMA* pBufferWMA X2DEFAULT(NULL)) PURE; - - // NAME: IXAudio2SourceVoice::FlushSourceBuffers - // DESCRIPTION: Removes all pending audio buffers from this voice's queue. - // - STDMETHOD(FlushSourceBuffers) (THIS) PURE; - - // NAME: IXAudio2SourceVoice::Discontinuity - // DESCRIPTION: Notifies the voice of an intentional break in the stream of - // audio buffers (e.g. the end of a sound), to prevent XAudio2 - // from interpreting an empty buffer queue as a glitch. - // - STDMETHOD(Discontinuity) (THIS) PURE; - - // NAME: IXAudio2SourceVoice::ExitLoop - // DESCRIPTION: Breaks out of the current loop when its end is reached. - // - // ARGUMENTS: - // OperationSet - Used to identify this call as part of a deferred batch. - // - STDMETHOD(ExitLoop) (THIS_ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; - - // NAME: IXAudio2SourceVoice::GetState - // DESCRIPTION: Returns the number of buffers currently queued on this voice, - // the pContext value associated with the currently processing - // buffer (if any), and other voice state information. - // - // ARGUMENTS: - // pVoiceState - Returns the state information. - // - STDMETHOD_(void, GetState) (THIS_ __out XAUDIO2_VOICE_STATE* pVoiceState) PURE; - - // NAME: IXAudio2SourceVoice::SetFrequencyRatio - // DESCRIPTION: Sets this voice's frequency adjustment, i.e. its pitch. - // - // ARGUMENTS: - // Ratio - Frequency change, expressed as source frequency / target frequency. - // OperationSet - Used to identify this call as part of a deferred batch. - // - STDMETHOD(SetFrequencyRatio) (THIS_ float Ratio, - UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; - - // NAME: IXAudio2SourceVoice::GetFrequencyRatio - // DESCRIPTION: Returns this voice's current frequency adjustment ratio. - // - // ARGUMENTS: - // pRatio - Returns the frequency adjustment. - // - STDMETHOD_(void, GetFrequencyRatio) (THIS_ __out float* pRatio) PURE; - - // NAME: IXAudio2SourceVoice::SetSourceSampleRate - // DESCRIPTION: Reconfigures this voice to treat its source data as being - // at a different sample rate than the original one specified - // in CreateSourceVoice's pSourceFormat argument. - // - // ARGUMENTS: - // UINT32 - The intended sample rate of further submitted source data. - // - STDMETHOD(SetSourceSampleRate) (THIS_ UINT32 NewSourceSampleRate) PURE; -}; - - -/************************************************************************** - * - * IXAudio2SubmixVoice: Submixing voice management interface. - * - **************************************************************************/ - -#undef INTERFACE -#define INTERFACE IXAudio2SubmixVoice -DECLARE_INTERFACE_(IXAudio2SubmixVoice, IXAudio2Voice) -{ - // Methods from IXAudio2Voice base interface - Declare_IXAudio2Voice_Methods(); - - // There are currently no methods specific to submix voices. -}; - - -/************************************************************************** - * - * IXAudio2MasteringVoice: Mastering voice management interface. - * - **************************************************************************/ - -#undef INTERFACE -#define INTERFACE IXAudio2MasteringVoice -DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice) -{ - // Methods from IXAudio2Voice base interface - Declare_IXAudio2Voice_Methods(); - - // There are currently no methods specific to mastering voices. -}; - - -/************************************************************************** - * - * IXAudio2EngineCallback: Client notification interface for engine events. - * - * REMARKS: Contains methods to notify the client when certain events happen - * in the XAudio2 engine. This interface should be implemented by - * the client. XAudio2 will call these methods via the interface - * pointer provided by the client when it calls XAudio2Create or - * IXAudio2::Initialize. - * - **************************************************************************/ - -#undef INTERFACE -#define INTERFACE IXAudio2EngineCallback -DECLARE_INTERFACE(IXAudio2EngineCallback) -{ - // Called by XAudio2 just before an audio processing pass begins. - STDMETHOD_(void, OnProcessingPassStart) (THIS) PURE; - - // Called just after an audio processing pass ends. - STDMETHOD_(void, OnProcessingPassEnd) (THIS) PURE; - - // Called in the event of a critical system error which requires XAudio2 - // to be closed down and restarted. The error code is given in Error. - STDMETHOD_(void, OnCriticalError) (THIS_ HRESULT Error) PURE; -}; - - -/************************************************************************** - * - * IXAudio2VoiceCallback: Client notification interface for voice events. - * - * REMARKS: Contains methods to notify the client when certain events happen - * in an XAudio2 voice. This interface should be implemented by the - * client. XAudio2 will call these methods via an interface pointer - * provided by the client in the IXAudio2::CreateSourceVoice call. - * - **************************************************************************/ - -#undef INTERFACE -#define INTERFACE IXAudio2VoiceCallback -DECLARE_INTERFACE(IXAudio2VoiceCallback) -{ - // Called just before this voice's processing pass begins. - STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE; - - // Called just after this voice's processing pass ends. - STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE; - - // Called when this voice has just finished playing a buffer stream - // (as marked with the XAUDIO2_END_OF_STREAM flag on the last buffer). - STDMETHOD_(void, OnStreamEnd) (THIS) PURE; - - // Called when this voice is about to start processing a new buffer. - STDMETHOD_(void, OnBufferStart) (THIS_ void* pBufferContext) PURE; - - // Called when this voice has just finished processing a buffer. - // The buffer can now be reused or destroyed. - STDMETHOD_(void, OnBufferEnd) (THIS_ void* pBufferContext) PURE; - - // Called when this voice has just reached the end position of a loop. - STDMETHOD_(void, OnLoopEnd) (THIS_ void* pBufferContext) PURE; - - // Called in the event of a critical error during voice processing, - // such as a failing xAPO or an error from the hardware XMA decoder. - // The voice may have to be destroyed and re-created to recover from - // the error. The callback arguments report which buffer was being - // processed when the error occurred, and its HRESULT code. - STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) PURE; -}; - - -/************************************************************************** - * - * Macros to make it easier to use the XAudio2 COM interfaces in C code. - * - **************************************************************************/ - -#ifndef __cplusplus - -// IXAudio2 -#define IXAudio2_QueryInterface(This,riid,ppvInterface) ((This)->lpVtbl->QueryInterface(This,riid,ppvInterface)) -#define IXAudio2_AddRef(This) ((This)->lpVtbl->AddRef(This)) -#define IXAudio2_Release(This) ((This)->lpVtbl->Release(This)) -#define IXAudio2_GetDeviceCount(This,puCount) ((This)->lpVtbl->GetDeviceCount(This,puCount)) -#define IXAudio2_GetDeviceDetails(This,Index,pDeviceDetails) ((This)->lpVtbl->GetDeviceDetails(This,Index,pDeviceDetails)) -#define IXAudio2_Initialize(This,Flags,XAudio2Processor) ((This)->lpVtbl->Initialize(This,Flags,XAudio2Processor)) -#define IXAudio2_CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain) ((This)->lpVtbl->CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain)) -#define IXAudio2_CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain) ((This)->lpVtbl->CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain)) -#define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain)) -#define IXAudio2_StartEngine(This) ((This)->lpVtbl->StartEngine(This)) -#define IXAudio2_StopEngine(This) ((This)->lpVtbl->StopEngine(This)) -#define IXAudio2_CommitChanges(This,OperationSet) ((This)->lpVtbl->CommitChanges(This,OperationSet)) -#define IXAudio2_GetPerformanceData(This,pPerfData) ((This)->lpVtbl->GetPerformanceData(This,pPerfData)) -#define IXAudio2_SetDebugConfiguration(This,pDebugConfiguration,pReserved) ((This)->lpVtbl->SetDebugConfiguration(This,pDebugConfiguration,pReserved)) - -// IXAudio2Voice -#define IXAudio2Voice_GetVoiceDetails(This,pVoiceDetails) ((This)->lpVtbl->GetVoiceDetails(This,pVoiceDetails)) -#define IXAudio2Voice_SetOutputVoices(This,pSendList) ((This)->lpVtbl->SetOutputVoices(This,pSendList)) -#define IXAudio2Voice_SetEffectChain(This,pEffectChain) ((This)->lpVtbl->SetEffectChain(This,pEffectChain)) -#define IXAudio2Voice_EnableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->EnableEffect(This,EffectIndex,OperationSet)) -#define IXAudio2Voice_DisableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->DisableEffect(This,EffectIndex,OperationSet)) -#define IXAudio2Voice_GetEffectState(This,EffectIndex,pEnabled) ((This)->lpVtbl->GetEffectState(This,EffectIndex,pEnabled)) -#define IXAudio2Voice_SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize, OperationSet) ((This)->lpVtbl->SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize,OperationSet)) -#define IXAudio2Voice_GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize) ((This)->lpVtbl->GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize)) -#define IXAudio2Voice_SetFilterParameters(This,pParameters,OperationSet) ((This)->lpVtbl->SetFilterParameters(This,pParameters,OperationSet)) -#define IXAudio2Voice_GetFilterParameters(This,pParameters) ((This)->lpVtbl->GetFilterParameters(This,pParameters)) -#define IXAudio2Voice_SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet) ((This)->lpVtbl->SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet)) -#define IXAudio2Voice_GetOutputFilterParameters(This,pDestinationVoice,pParameters) ((This)->lpVtbl->GetOutputFilterParameters(This,pDestinationVoice,pParameters)) -#define IXAudio2Voice_SetVolume(This,Volume,OperationSet) ((This)->lpVtbl->SetVolume(This,Volume,OperationSet)) -#define IXAudio2Voice_GetVolume(This,pVolume) ((This)->lpVtbl->GetVolume(This,pVolume)) -#define IXAudio2Voice_SetChannelVolumes(This,Channels,pVolumes,OperationSet) ((This)->lpVtbl->SetChannelVolumes(This,Channels,pVolumes,OperationSet)) -#define IXAudio2Voice_GetChannelVolumes(This,Channels,pVolumes) ((This)->lpVtbl->GetChannelVolumes(This,Channels,pVolumes)) -#define IXAudio2Voice_SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet) ((This)->lpVtbl->SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet)) -#define IXAudio2Voice_GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix) ((This)->lpVtbl->GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix)) -#define IXAudio2Voice_DestroyVoice(This) ((This)->lpVtbl->DestroyVoice(This)) - -// IXAudio2SourceVoice -#define IXAudio2SourceVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails -#define IXAudio2SourceVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices -#define IXAudio2SourceVoice_SetEffectChain IXAudio2Voice_SetEffectChain -#define IXAudio2SourceVoice_EnableEffect IXAudio2Voice_EnableEffect -#define IXAudio2SourceVoice_DisableEffect IXAudio2Voice_DisableEffect -#define IXAudio2SourceVoice_GetEffectState IXAudio2Voice_GetEffectState -#define IXAudio2SourceVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters -#define IXAudio2SourceVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters -#define IXAudio2SourceVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters -#define IXAudio2SourceVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters -#define IXAudio2SourceVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters -#define IXAudio2SourceVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters -#define IXAudio2SourceVoice_SetVolume IXAudio2Voice_SetVolume -#define IXAudio2SourceVoice_GetVolume IXAudio2Voice_GetVolume -#define IXAudio2SourceVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes -#define IXAudio2SourceVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes -#define IXAudio2SourceVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix -#define IXAudio2SourceVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix -#define IXAudio2SourceVoice_DestroyVoice IXAudio2Voice_DestroyVoice -#define IXAudio2SourceVoice_Start(This,Flags,OperationSet) ((This)->lpVtbl->Start(This,Flags,OperationSet)) -#define IXAudio2SourceVoice_Stop(This,Flags,OperationSet) ((This)->lpVtbl->Stop(This,Flags,OperationSet)) -#define IXAudio2SourceVoice_SubmitSourceBuffer(This,pBuffer,pBufferWMA) ((This)->lpVtbl->SubmitSourceBuffer(This,pBuffer,pBufferWMA)) -#define IXAudio2SourceVoice_FlushSourceBuffers(This) ((This)->lpVtbl->FlushSourceBuffers(This)) -#define IXAudio2SourceVoice_Discontinuity(This) ((This)->lpVtbl->Discontinuity(This)) -#define IXAudio2SourceVoice_ExitLoop(This,OperationSet) ((This)->lpVtbl->ExitLoop(This,OperationSet)) -#define IXAudio2SourceVoice_GetState(This,pVoiceState) ((This)->lpVtbl->GetState(This,pVoiceState)) -#define IXAudio2SourceVoice_SetFrequencyRatio(This,Ratio,OperationSet) ((This)->lpVtbl->SetFrequencyRatio(This,Ratio,OperationSet)) -#define IXAudio2SourceVoice_GetFrequencyRatio(This,pRatio) ((This)->lpVtbl->GetFrequencyRatio(This,pRatio)) -#define IXAudio2SourceVoice_SetSourceSampleRate(This,NewSourceSampleRate) ((This)->lpVtbl->SetSourceSampleRate(This,NewSourceSampleRate)) - -// IXAudio2SubmixVoice -#define IXAudio2SubmixVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails -#define IXAudio2SubmixVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices -#define IXAudio2SubmixVoice_SetEffectChain IXAudio2Voice_SetEffectChain -#define IXAudio2SubmixVoice_EnableEffect IXAudio2Voice_EnableEffect -#define IXAudio2SubmixVoice_DisableEffect IXAudio2Voice_DisableEffect -#define IXAudio2SubmixVoice_GetEffectState IXAudio2Voice_GetEffectState -#define IXAudio2SubmixVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters -#define IXAudio2SubmixVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters -#define IXAudio2SubmixVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters -#define IXAudio2SubmixVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters -#define IXAudio2SubmixVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters -#define IXAudio2SubmixVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters -#define IXAudio2SubmixVoice_SetVolume IXAudio2Voice_SetVolume -#define IXAudio2SubmixVoice_GetVolume IXAudio2Voice_GetVolume -#define IXAudio2SubmixVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes -#define IXAudio2SubmixVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes -#define IXAudio2SubmixVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix -#define IXAudio2SubmixVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix -#define IXAudio2SubmixVoice_DestroyVoice IXAudio2Voice_DestroyVoice - -// IXAudio2MasteringVoice -#define IXAudio2MasteringVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails -#define IXAudio2MasteringVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices -#define IXAudio2MasteringVoice_SetEffectChain IXAudio2Voice_SetEffectChain -#define IXAudio2MasteringVoice_EnableEffect IXAudio2Voice_EnableEffect -#define IXAudio2MasteringVoice_DisableEffect IXAudio2Voice_DisableEffect -#define IXAudio2MasteringVoice_GetEffectState IXAudio2Voice_GetEffectState -#define IXAudio2MasteringVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters -#define IXAudio2MasteringVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters -#define IXAudio2MasteringVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters -#define IXAudio2MasteringVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters -#define IXAudio2MasteringVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters -#define IXAudio2MasteringVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters -#define IXAudio2MasteringVoice_SetVolume IXAudio2Voice_SetVolume -#define IXAudio2MasteringVoice_GetVolume IXAudio2Voice_GetVolume -#define IXAudio2MasteringVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes -#define IXAudio2MasteringVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes -#define IXAudio2MasteringVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix -#define IXAudio2MasteringVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix -#define IXAudio2MasteringVoice_DestroyVoice IXAudio2Voice_DestroyVoice - -#endif // #ifndef __cplusplus - - -/************************************************************************** - * - * Utility functions used to convert from pitch in semitones and volume - * in decibels to the frequency and amplitude ratio units used by XAudio2. - * These are only defined if the client #defines XAUDIO2_HELPER_FUNCTIONS - * prior to #including xaudio2.h. - * - **************************************************************************/ - -#ifdef XAUDIO2_HELPER_FUNCTIONS - -#define _USE_MATH_DEFINES // Make math.h define M_PI -#include // For powf, log10f, sinf and asinf - -// Calculate the argument to SetVolume from a decibel value -__inline float XAudio2DecibelsToAmplitudeRatio(float Decibels) -{ - return powf(10.0f, Decibels / 20.0f); -} - -// Recover a volume in decibels from an amplitude factor -__inline float XAudio2AmplitudeRatioToDecibels(float Volume) -{ - if (Volume == 0) - { - return -3.402823466e+38f; // Smallest float value (-FLT_MAX) - } - return 20.0f * log10f(Volume); -} - -// Calculate the argument to SetFrequencyRatio from a semitone value -__inline float XAudio2SemitonesToFrequencyRatio(float Semitones) -{ - // FrequencyRatio = 2 ^ Octaves - // = 2 ^ (Semitones / 12) - return powf(2.0f, Semitones / 12.0f); -} - -// Recover a pitch in semitones from a frequency ratio -__inline float XAudio2FrequencyRatioToSemitones(float FrequencyRatio) -{ - // Semitones = 12 * log2(FrequencyRatio) - // = 12 * log2(10) * log10(FrequencyRatio) - return 39.86313713864835f * log10f(FrequencyRatio); -} - -// Convert from filter cutoff frequencies expressed in Hertz to the radian -// frequency values used in XAUDIO2_FILTER_PARAMETERS.Frequency. Note that -// the highest CutoffFrequency supported is SampleRate/6. Higher values of -// CutoffFrequency will return XAUDIO2_MAX_FILTER_FREQUENCY. -__inline float XAudio2CutoffFrequencyToRadians(float CutoffFrequency, UINT32 SampleRate) -{ - if ((UINT32)(CutoffFrequency * 6.0f) >= SampleRate) - { - return XAUDIO2_MAX_FILTER_FREQUENCY; - } - return 2.0f * sinf((float)M_PI * CutoffFrequency / SampleRate); -} - -// Convert from radian frequencies back to absolute frequencies in Hertz -__inline float XAudio2RadiansToCutoffFrequency(float Radians, float SampleRate) -{ - return SampleRate * asinf(Radians / 2.0f) / (float)M_PI; -} -#endif // #ifdef XAUDIO2_HELPER_FUNCTIONS - - -/************************************************************************** - * - * XAudio2Create: Top-level function that creates an XAudio2 instance. - * - * On Windows this is just an inline function that calls CoCreateInstance - * and Initialize. The arguments are described above, under Initialize, - * except that the XAUDIO2_DEBUG_ENGINE flag can be used here to select - * the debug version of XAudio2. - * - * On Xbox, this function is implemented in the XAudio2 library, and the - * XAUDIO2_DEBUG_ENGINE flag has no effect; the client must explicitly - * link with the debug version of the library to obtain debug behavior. - * - **************************************************************************/ - -#ifdef _XBOX - -STDAPI XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0), - XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)); - -#else // Windows - -__inline HRESULT XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0), - XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) -{ - // Instantiate the appropriate XAudio2 engine - IXAudio2* pXAudio2; - - #ifdef __cplusplus - - HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? CLSID_XAudio2_Debug : CLSID_XAudio2, - NULL, CLSCTX_INPROC_SERVER, IID_IXAudio2, (void**)&pXAudio2); - if (SUCCEEDED(hr)) - { - hr = pXAudio2->Initialize(Flags, XAudio2Processor); - - if (SUCCEEDED(hr)) - { - *ppXAudio2 = pXAudio2; - } - else - { - pXAudio2->Release(); - } - } - - #else - - HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? &CLSID_XAudio2_Debug : &CLSID_XAudio2, - NULL, CLSCTX_INPROC_SERVER, &IID_IXAudio2, (void**)&pXAudio2); - if (SUCCEEDED(hr)) - { - hr = pXAudio2->lpVtbl->Initialize(pXAudio2, Flags, XAudio2Processor); - - if (SUCCEEDED(hr)) - { - *ppXAudio2 = pXAudio2; - } - else - { - pXAudio2->lpVtbl->Release(pXAudio2); - } - } - - #endif // #ifdef __cplusplus - - return hr; -} - -#endif // #ifdef _XBOX - - -// Undo the #pragma pack(push, 1) directive at the top of this file -#pragma pack(pop) - -#endif // #ifndef GUID_DEFS_ONLY -#endif // #ifndef __XAUDIO2_INCLUDED__ diff --git a/jan/src/dep/mingw/include/xaudio2/xaudio2fx.h b/jan/src/dep/mingw/include/xaudio2/xaudio2fx.h deleted file mode 100644 index 38aafcc66..000000000 --- a/jan/src/dep/mingw/include/xaudio2/xaudio2fx.h +++ /dev/null @@ -1,439 +0,0 @@ -/*------------------------------------------------------------------------- - Moddified by CaptainCPS for use with MinGW / GCC 4.6.1 - - Thanks to PortAudio for their 'sal.h' compatible with MinGW ! --------------------------------------------------------------------------*/ - -/************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * File: xaudio2fx.h - * Content: Declarations for the audio effects included with XAudio2. - * - **************************************************************************/ - -#ifndef __XAUDIO2FX_INCLUDED__ -#define __XAUDIO2FX_INCLUDED__ - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -/************************************************************************** - * - * XAudio2 effect class IDs. - * - **************************************************************************/ - -//#include "comdecl.h" // For DEFINE_CLSID and DEFINE_IID - -// XAudio 2.0 (March 2008 SDK) -//DEFINE_CLSID(AudioVolumeMeter, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, E2); -//DEFINE_CLSID(AudioVolumeMeter_Debug, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, DB); -//DEFINE_CLSID(AudioReverb, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, 63); -//DEFINE_CLSID(AudioReverb_Debug, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, DB); - -// XAudio 2.1 (June 2008 SDK) -//DEFINE_CLSID(AudioVolumeMeter, c1e3f122, a2ea, 442c, 85, 4f, 20, d9, 8f, 83, 57, a1); -//DEFINE_CLSID(AudioVolumeMeter_Debug, 6d97a461, b02d, 48ae, b5, 43, 82, bc, 35, fd, fa, e2); -//DEFINE_CLSID(AudioReverb, f4769300, b949, 4df9, b3, 33, 00, d3, 39, 32, e9, a6); -//DEFINE_CLSID(AudioReverb_Debug, aea2cabc, 8c7c, 46aa, ba, 44, 0e, 6d, 75, 88, a1, f2); - -// XAudio 2.2 (August 2008 SDK) -//DEFINE_CLSID(AudioVolumeMeter, f5ca7b34, 8055, 42c0, b8, 36, 21, 61, 29, eb, 7e, 30); -//DEFINE_CLSID(AudioVolumeMeter_Debug, f796f5f7, 6059, 4a9f, 98, 2d, 61, ee, c2, ed, 67, ca); -//DEFINE_CLSID(AudioReverb, 629cf0de, 3ecc, 41e7, 99, 26, f7, e4, 3e, eb, ec, 51); -//DEFINE_CLSID(AudioReverb_Debug, 4aae4299, 3260, 46d4, 97, cc, 6c, c7, 60, c8, 53, 29); - -// XAudio 2.3 (November 2008 SDK) -//DEFINE_CLSID(AudioVolumeMeter, e180344b, ac83, 4483, 95, 9e, 18, a5, c5, 6a, 5e, 19); -//DEFINE_CLSID(AudioVolumeMeter_Debug, 922a0a56, 7d13, 40ae, a4, 81, 3c, 6c, 60, f1, 14, 01); -//DEFINE_CLSID(AudioReverb, 9cab402c, 1d37, 44b4, 88, 6d, fa, 4f, 36, 17, 0a, 4c); -//DEFINE_CLSID(AudioReverb_Debug, eadda998, 3be6, 4505, 84, be, ea, 06, 36, 5d, b9, 6b); - -// XAudio 2.4 (March 2009 SDK) -//DEFINE_CLSID(AudioVolumeMeter, c7338b95, 52b8, 4542, aa, 79, 42, eb, 01, 6c, 8c, 1c); -//DEFINE_CLSID(AudioVolumeMeter_Debug, 524bd872, 5c0b, 4217, bd, b8, 0a, 86, 81, 83, 0b, a5); -//DEFINE_CLSID(AudioReverb, 8bb7778b, 645b, 4475, 9a, 73, 1d, e3, 17, 0b, d3, af); -//DEFINE_CLSID(AudioReverb_Debug, da7738a2, cd0c, 4367, 9a, ac, d7, ea, d7, c6, 4f, 98); - -// XAudio 2.5 (March 2009 SDK) -//DEFINE_CLSID(AudioVolumeMeter, 2139e6da, c341, 4774, 9a, c3, b4, e0, 26, 34, 7f, 64); -//DEFINE_CLSID(AudioVolumeMeter_Debug, a5cc4e13, ca00, 416b, a6, ee, 49, fe, e7, b5, 43, d0); -//DEFINE_CLSID(AudioReverb, d06df0d0, 8518, 441e, 82, 2f, 54, 51, d5, c5, 95, b8); -//DEFINE_CLSID(AudioReverb_Debug, 613604ec, 304c, 45ec, a4, ed, 7a, 1c, 61, 2e, 9e, 72); - -// XAudio 2.6 (February 2010 SDK) -//DEFINE_CLSID(AudioVolumeMeter, e48c5a3f, 93ef, 43bb, a0, 92, 2c, 7c, eb, 94, 6f, 27); -//DEFINE_CLSID(AudioVolumeMeter_Debug, 9a9eaef7, a9e0, 4088, 9b, 1b, 9c, a0, 3a, 1a, ec, d4); -//DEFINE_CLSID(AudioReverb, cecec95a, d894, 491a, be, e3, 5e, 10, 6f, b5, 9f, 2d); -//DEFINE_CLSID(AudioReverb_Debug, 99a1c72e, 364c, 4c1b, 96, 23, fd, 5c, 8a, bd, 90, c7); - -// XAudio 2.7 (June 2010 SDK) -DEFINE_GUID(CLSID_AudioVolumeMeter, 0xcac1105f, 0x619b, 0x4d04, 0x83, 0x1a, 0x44, 0xe1, 0xcb, 0xf1, 0x2d, 0x57); -DEFINE_GUID(CLSID_AudioVolumeMeter_Debug, 0x2d9a0f9c, 0xe67b, 0x4b24, 0xab, 0x44, 0x92, 0xb3, 0xe7, 0x70, 0xc0, 0x20); -DEFINE_GUID(CLSID_AudioReverb, 0x6a93130e, 0x1d53, 0x41d1, 0xa9, 0xcf, 0xe7, 0x58, 0x80, 0x0b, 0xb1, 0x79); -DEFINE_GUID(CLSID_AudioReverb_Debug, 0xc4f82dd4, 0xcb4e, 0x4ce1, 0x8b, 0xdb, 0xee, 0x32, 0xd4, 0x19, 0x82, 0x69); - -// Ignore the rest of this header if only the GUID definitions were requested -#ifndef GUID_DEFS_ONLY - -#ifdef _XBOX - #include // Xbox COM declarations (IUnknown, etc) -#else - #include // Windows COM declarations -#endif -#include // For log10() - -// All structures defined in this file should use tight packing -#pragma pack(push, 1) - - -/************************************************************************** - * - * Effect creation functions. On Windows, these are just inline functions - * that call CoCreateInstance and Initialize; the XAUDIO2FX_DEBUG flag can - * be used to select the debug version of the effects. On Xbox, these map - * to real functions included in xaudio2.lib, and the XAUDIO2FX_DEBUG flag - * is ignored; the application must link with the debug library to use the - * debug functionality. - * - **************************************************************************/ - -// Use default values for some parameters if building C++ code -#ifdef __cplusplus - #define DEFAULT(x) =x -#else - #define DEFAULT(x) -#endif - -#define XAUDIO2FX_DEBUG 1 // To select the debug version of an effect - -#ifdef _XBOX - - STDAPI CreateAudioVolumeMeter(__deref_out IUnknown** ppApo); - STDAPI CreateAudioReverb(__deref_out IUnknown** ppApo); - - __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0)) - { - return CreateAudioVolumeMeter(ppApo); - } - - __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0)) - { - return CreateAudioReverb(ppApo); - } - -#else // Windows - - __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0)) - { - #ifdef __cplusplus - return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? CLSID_AudioVolumeMeter_Debug - : CLSID_AudioVolumeMeter, - NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)ppApo); - #else - return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioVolumeMeter_Debug - : &CLSID_AudioVolumeMeter, - NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo); - #endif - } - - __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0)) - { - #ifdef __cplusplus - return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? CLSID_AudioReverb_Debug - : CLSID_AudioReverb, - NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)ppApo); - #else - return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioReverb_Debug - : &CLSID_AudioReverb, - NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo); - #endif - } - -#endif // #ifdef _XBOX - - - -/************************************************************************** - * - * Volume meter parameters. - * The volume meter supports FLOAT32 audio formats and must be used in-place. - * - **************************************************************************/ - -// XAUDIO2FX_VOLUMEMETER_LEVELS: Receives results from GetEffectParameters(). -// The user is responsible for allocating pPeakLevels, pRMSLevels, and -// initializing ChannelCount accordingly. -// The volume meter does not support SetEffectParameters(). -typedef struct XAUDIO2FX_VOLUMEMETER_LEVELS -{ - float* pPeakLevels; // Peak levels table: receives maximum absolute level for each channel - // over a processing pass; may be NULL if pRMSLevls != NULL, - // otherwise must have at least ChannelCount elements. - float* pRMSLevels; // Root mean square levels table: receives RMS level for each channel - // over a processing pass; may be NULL if pPeakLevels != NULL, - // otherwise must have at least ChannelCount elements. - UINT32 ChannelCount; // Number of channels being processed by the volume meter APO -} XAUDIO2FX_VOLUMEMETER_LEVELS; - - - -/************************************************************************** - * - * Reverb parameters. - * The reverb supports only FLOAT32 audio with the following channel - * configurations: - * Input: Mono Output: Mono - * Input: Mono Output: 5.1 - * Input: Stereo Output: Stereo - * Input: Stereo Output: 5.1 - * The framerate must be within [20000, 48000] Hz. - * - * When using mono input, delay filters associated with the right channel - * are not executed. In this case, parameters such as PositionRight and - * PositionMatrixRight have no effect. This also means the reverb uses - * less CPU when hosted in a mono submix. - * - **************************************************************************/ - -#define XAUDIO2FX_REVERB_MIN_FRAMERATE 20000 -#define XAUDIO2FX_REVERB_MAX_FRAMERATE 48000 - -// XAUDIO2FX_REVERB_PARAMETERS: Native parameter set for the reverb effect - -typedef struct XAUDIO2FX_REVERB_PARAMETERS -{ - // ratio of wet (processed) signal to dry (original) signal - float WetDryMix; // [0, 100] (percentage) - - // Delay times - UINT32 ReflectionsDelay; // [0, 300] in ms - BYTE ReverbDelay; // [0, 85] in ms - BYTE RearDelay; // [0, 5] in ms - - // Indexed parameters - BYTE PositionLeft; // [0, 30] no units - BYTE PositionRight; // [0, 30] no units, ignored when configured to mono - BYTE PositionMatrixLeft; // [0, 30] no units - BYTE PositionMatrixRight; // [0, 30] no units, ignored when configured to mono - BYTE EarlyDiffusion; // [0, 15] no units - BYTE LateDiffusion; // [0, 15] no units - BYTE LowEQGain; // [0, 12] no units - BYTE LowEQCutoff; // [0, 9] no units - BYTE HighEQGain; // [0, 8] no units - BYTE HighEQCutoff; // [0, 14] no units - - // Direct parameters - float RoomFilterFreq; // [20, 20000] in Hz - float RoomFilterMain; // [-100, 0] in dB - float RoomFilterHF; // [-100, 0] in dB - float ReflectionsGain; // [-100, 20] in dB - float ReverbGain; // [-100, 20] in dB - float DecayTime; // [0.1, inf] in seconds - float Density; // [0, 100] (percentage) - float RoomSize; // [1, 100] in feet -} XAUDIO2FX_REVERB_PARAMETERS; - - -// Maximum, minimum and default values for the parameters above -#define XAUDIO2FX_REVERB_MIN_WET_DRY_MIX 0.0f -#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_DELAY 0 -#define XAUDIO2FX_REVERB_MIN_REVERB_DELAY 0 -#define XAUDIO2FX_REVERB_MIN_REAR_DELAY 0 -#define XAUDIO2FX_REVERB_MIN_POSITION 0 -#define XAUDIO2FX_REVERB_MIN_DIFFUSION 0 -#define XAUDIO2FX_REVERB_MIN_LOW_EQ_GAIN 0 -#define XAUDIO2FX_REVERB_MIN_LOW_EQ_CUTOFF 0 -#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_GAIN 0 -#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_CUTOFF 0 -#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_FREQ 20.0f -#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_MAIN -100.0f -#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_HF -100.0f -#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_GAIN -100.0f -#define XAUDIO2FX_REVERB_MIN_REVERB_GAIN -100.0f -#define XAUDIO2FX_REVERB_MIN_DECAY_TIME 0.1f -#define XAUDIO2FX_REVERB_MIN_DENSITY 0.0f -#define XAUDIO2FX_REVERB_MIN_ROOM_SIZE 0.0f - -#define XAUDIO2FX_REVERB_MAX_WET_DRY_MIX 100.0f -#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY 300 -#define XAUDIO2FX_REVERB_MAX_REVERB_DELAY 85 -#define XAUDIO2FX_REVERB_MAX_REAR_DELAY 5 -#define XAUDIO2FX_REVERB_MAX_POSITION 30 -#define XAUDIO2FX_REVERB_MAX_DIFFUSION 15 -#define XAUDIO2FX_REVERB_MAX_LOW_EQ_GAIN 12 -#define XAUDIO2FX_REVERB_MAX_LOW_EQ_CUTOFF 9 -#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_GAIN 8 -#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_CUTOFF 14 -#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_FREQ 20000.0f -#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_MAIN 0.0f -#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_HF 0.0f -#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_GAIN 20.0f -#define XAUDIO2FX_REVERB_MAX_REVERB_GAIN 20.0f -#define XAUDIO2FX_REVERB_MAX_DENSITY 100.0f -#define XAUDIO2FX_REVERB_MAX_ROOM_SIZE 100.0f - -#define XAUDIO2FX_REVERB_DEFAULT_WET_DRY_MIX 100.0f -#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_DELAY 5 -#define XAUDIO2FX_REVERB_DEFAULT_REVERB_DELAY 5 -#define XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY 5 -#define XAUDIO2FX_REVERB_DEFAULT_POSITION 6 -#define XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX 27 -#define XAUDIO2FX_REVERB_DEFAULT_EARLY_DIFFUSION 8 -#define XAUDIO2FX_REVERB_DEFAULT_LATE_DIFFUSION 8 -#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_GAIN 8 -#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_CUTOFF 4 -#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_GAIN 8 -#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_CUTOFF 4 -#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_FREQ 5000.0f -#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_MAIN 0.0f -#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_HF 0.0f -#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_GAIN 0.0f -#define XAUDIO2FX_REVERB_DEFAULT_REVERB_GAIN 0.0f -#define XAUDIO2FX_REVERB_DEFAULT_DECAY_TIME 1.0f -#define XAUDIO2FX_REVERB_DEFAULT_DENSITY 100.0f -#define XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE 100.0f - - -// XAUDIO2FX_REVERB_I3DL2_PARAMETERS: Parameter set compliant with the I3DL2 standard - -typedef struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS -{ - // ratio of wet (processed) signal to dry (original) signal - float WetDryMix; // [0, 100] (percentage) - - // Standard I3DL2 parameters - INT32 Room; // [-10000, 0] in mB (hundredths of decibels) - INT32 RoomHF; // [-10000, 0] in mB (hundredths of decibels) - float RoomRolloffFactor; // [0.0, 10.0] - float DecayTime; // [0.1, 20.0] in seconds - float DecayHFRatio; // [0.1, 2.0] - INT32 Reflections; // [-10000, 1000] in mB (hundredths of decibels) - float ReflectionsDelay; // [0.0, 0.3] in seconds - INT32 Reverb; // [-10000, 2000] in mB (hundredths of decibels) - float ReverbDelay; // [0.0, 0.1] in seconds - float Diffusion; // [0.0, 100.0] (percentage) - float Density; // [0.0, 100.0] (percentage) - float HFReference; // [20.0, 20000.0] in Hz -} XAUDIO2FX_REVERB_I3DL2_PARAMETERS; - - -// ReverbConvertI3DL2ToNative: Utility function to map from I3DL2 to native parameters - -__inline void ReverbConvertI3DL2ToNative -( - __in const XAUDIO2FX_REVERB_I3DL2_PARAMETERS* pI3DL2, - __out XAUDIO2FX_REVERB_PARAMETERS* pNative -) -{ - float reflectionsDelay; - float reverbDelay; - - // RoomRolloffFactor is ignored - - // These parameters have no equivalent in I3DL2 - pNative->RearDelay = XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY; // 5 - pNative->PositionLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6 - pNative->PositionRight = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6 - pNative->PositionMatrixLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27 - pNative->PositionMatrixRight = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27 - pNative->RoomSize = XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE; // 100 - pNative->LowEQCutoff = 4; - pNative->HighEQCutoff = 6; - - // The rest of the I3DL2 parameters map to the native property set - pNative->RoomFilterMain = (float)pI3DL2->Room / 100.0f; - pNative->RoomFilterHF = (float)pI3DL2->RoomHF / 100.0f; - - if (pI3DL2->DecayHFRatio >= 1.0f) - { - INT32 index = (INT32)(-4.0 * log10(pI3DL2->DecayHFRatio)); - if (index < -8) index = -8; - pNative->LowEQGain = (BYTE)((index < 0) ? index + 8 : 8); - pNative->HighEQGain = 8; - pNative->DecayTime = pI3DL2->DecayTime * pI3DL2->DecayHFRatio; - } - else - { - INT32 index = (INT32)(4.0 * log10(pI3DL2->DecayHFRatio)); - if (index < -8) index = -8; - pNative->LowEQGain = 8; - pNative->HighEQGain = (BYTE)((index < 0) ? index + 8 : 8); - pNative->DecayTime = pI3DL2->DecayTime; - } - - reflectionsDelay = pI3DL2->ReflectionsDelay * 1000.0f; - if (reflectionsDelay >= XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY) // 300 - { - reflectionsDelay = (float)(XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY - 1); - } - else if (reflectionsDelay <= 1) - { - reflectionsDelay = 1; - } - pNative->ReflectionsDelay = (UINT32)reflectionsDelay; - - reverbDelay = pI3DL2->ReverbDelay * 1000.0f; - if (reverbDelay >= XAUDIO2FX_REVERB_MAX_REVERB_DELAY) // 85 - { - reverbDelay = (float)(XAUDIO2FX_REVERB_MAX_REVERB_DELAY - 1); - } - pNative->ReverbDelay = (BYTE)reverbDelay; - - pNative->ReflectionsGain = pI3DL2->Reflections / 100.0f; - pNative->ReverbGain = pI3DL2->Reverb / 100.0f; - pNative->EarlyDiffusion = (BYTE)(15.0f * pI3DL2->Diffusion / 100.0f); - pNative->LateDiffusion = pNative->EarlyDiffusion; - pNative->Density = pI3DL2->Density; - pNative->RoomFilterFreq = pI3DL2->HFReference; - - pNative->WetDryMix = pI3DL2->WetDryMix; -} - - -/************************************************************************** - * - * Standard I3DL2 reverb presets (100% wet). - * - **************************************************************************/ - -#define XAUDIO2FX_I3DL2_PRESET_DEFAULT {100,-10000, 0,0.0f, 1.00f,0.50f,-10000,0.020f,-10000,0.040f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_GENERIC {100, -1000, -100,0.0f, 1.49f,0.83f, -2602,0.007f, 200,0.011f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_PADDEDCELL {100, -1000,-6000,0.0f, 0.17f,0.10f, -1204,0.001f, 207,0.002f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_ROOM {100, -1000, -454,0.0f, 0.40f,0.83f, -1646,0.002f, 53,0.003f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_BATHROOM {100, -1000,-1200,0.0f, 1.49f,0.54f, -370,0.007f, 1030,0.011f,100.0f, 60.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_LIVINGROOM {100, -1000,-6000,0.0f, 0.50f,0.10f, -1376,0.003f, -1104,0.004f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_STONEROOM {100, -1000, -300,0.0f, 2.31f,0.64f, -711,0.012f, 83,0.017f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_AUDITORIUM {100, -1000, -476,0.0f, 4.32f,0.59f, -789,0.020f, -289,0.030f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_CONCERTHALL {100, -1000, -500,0.0f, 3.92f,0.70f, -1230,0.020f, -2,0.029f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_CAVE {100, -1000, 0,0.0f, 2.91f,1.30f, -602,0.015f, -302,0.022f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_ARENA {100, -1000, -698,0.0f, 7.24f,0.33f, -1166,0.020f, 16,0.030f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_HANGAR {100, -1000,-1000,0.0f,10.05f,0.23f, -602,0.020f, 198,0.030f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_CARPETEDHALLWAY {100, -1000,-4000,0.0f, 0.30f,0.10f, -1831,0.002f, -1630,0.030f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_HALLWAY {100, -1000, -300,0.0f, 1.49f,0.59f, -1219,0.007f, 441,0.011f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_STONECORRIDOR {100, -1000, -237,0.0f, 2.70f,0.79f, -1214,0.013f, 395,0.020f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_ALLEY {100, -1000, -270,0.0f, 1.49f,0.86f, -1204,0.007f, -4,0.011f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_FOREST {100, -1000,-3300,0.0f, 1.49f,0.54f, -2560,0.162f, -613,0.088f, 79.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_CITY {100, -1000, -800,0.0f, 1.49f,0.67f, -2273,0.007f, -2217,0.011f, 50.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_MOUNTAINS {100, -1000,-2500,0.0f, 1.49f,0.21f, -2780,0.300f, -2014,0.100f, 27.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_QUARRY {100, -1000,-1000,0.0f, 1.49f,0.83f,-10000,0.061f, 500,0.025f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_PLAIN {100, -1000,-2000,0.0f, 1.49f,0.50f, -2466,0.179f, -2514,0.100f, 21.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_PARKINGLOT {100, -1000, 0,0.0f, 1.65f,1.50f, -1363,0.008f, -1153,0.012f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_SEWERPIPE {100, -1000,-1000,0.0f, 2.81f,0.14f, 429,0.014f, 648,0.021f, 80.0f, 60.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_UNDERWATER {100, -1000,-4000,0.0f, 1.49f,0.10f, -449,0.007f, 1700,0.011f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_SMALLROOM {100, -1000, -600,0.0f, 1.10f,0.83f, -400,0.005f, 500,0.010f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_MEDIUMROOM {100, -1000, -600,0.0f, 1.30f,0.83f, -1000,0.010f, -200,0.020f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_LARGEROOM {100, -1000, -600,0.0f, 1.50f,0.83f, -1600,0.020f, -1000,0.040f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_MEDIUMHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -1300,0.015f, -800,0.030f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_LARGEHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -2000,0.030f, -1400,0.060f,100.0f,100.0f,5000.0f} -#define XAUDIO2FX_I3DL2_PRESET_PLATE {100, -1000, -200,0.0f, 1.30f,0.90f, 0,0.002f, 0,0.010f,100.0f, 75.0f,5000.0f} - - -// Undo the #pragma pack(push, 1) at the top of this file -#pragma pack(pop) - -#endif // #ifndef GUID_DEFS_ONLY -#endif // #ifndef __XAUDIO2FX_INCLUDED__ diff --git a/jan/src/dep/mingw/include/xaudio2/xma2defs.h b/jan/src/dep/mingw/include/xaudio2/xma2defs.h deleted file mode 100644 index ab80279d7..000000000 --- a/jan/src/dep/mingw/include/xaudio2/xma2defs.h +++ /dev/null @@ -1,728 +0,0 @@ -/*------------------------------------------------------------------------- - Moddified by CaptainCPS for use with MinGW / GCC 4.6.1 - - Thanks to PortAudio for their 'sal.h' compatible with MinGW ! --------------------------------------------------------------------------*/ - -/*************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * File: xma2defs.h - * Content: Constants, data types and functions for XMA2 compressed audio. - * - ***************************************************************************/ - -#ifndef __XMA2DEFS_INCLUDED__ -#define __XMA2DEFS_INCLUDED__ - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif - -#include // Markers for documenting API semantics -#include // For S_OK, E_FAIL -#include // Basic data types and constants for audio work - - -/*************************************************************************** - * Overview - ***************************************************************************/ - -// A typical XMA2 file contains these RIFF chunks: -// -// 'fmt' or 'XMA2' chunk (or both): A description of the XMA data's structure -// and characteristics (length, channels, sample rate, loops, block size, etc). -// -// 'seek' chunk: A seek table to help navigate the XMA data. -// -// 'data' chunk: The encoded XMA2 data. -// -// The encoded XMA2 data is structured as a set of BLOCKS, which contain PACKETS, -// which contain FRAMES, which contain SUBFRAMES (roughly speaking). The frames -// in a file may also be divided into several subsets, called STREAMS. -// -// FRAME: A variable-sized segment of XMA data that decodes to exactly 512 mono -// or stereo PCM samples. This is the smallest unit of XMA data that can -// be decoded in isolation. Frames are an arbitrary number of bits in -// length, and need not be byte-aligned. See "XMA frame structure" below. -// -// SUBFRAME: A region of bits in an XMA frame that decodes to 128 mono or stereo -// samples. The XMA decoder cannot decode a subframe in isolation; it needs -// a whole frame to work with. However, it can begin emitting the frame's -// decoded samples at any one of the four subframe boundaries. Subframes -// can be addressed for seeking and looping purposes. -// -// PACKET: A 2Kb region containing a 32-bit header and some XMA frames. Frames -// can (and usually do) span packets. A packet's header includes the offset -// in bits of the first frame that begins within that packet. All of the -// frames that begin in a given packet belong to the same "stream" (see the -// Multichannel Audio section below). -// -// STREAM: A set of packets within an XMA file that all contain data for the -// same mono or stereo component of a PCM file with more than two channels. -// The packets comprising a given stream may be interleaved with each other -// more or less arbitrarily; see Multichannel Audio. -// -// BLOCK: An array of XMA packets; or, to break it down differently, a series of -// consecutive XMA frames, padded at the end with reserved data. A block -// must contain at least one 2Kb packet per stream, and it can hold up to -// 4095 packets (8190Kb), but its size is typically in the 32Kb-128Kb range. -// (The size chosen involves a trade-off between memory use and efficiency -// of reading from permanent storage.) -// -// XMA frames do not span blocks, so a block is guaranteed to begin with a -// set of complete frames, one per stream. Also, a block in a multi-stream -// XMA2 file always contains the same number of samples for each stream; -// see Multichannel Audio. -// -// The 'data' chunk in an XMA2 file is an array of XMA2WAVEFORMAT.BlockCount XMA -// blocks, all the same size (as specified in XMA2WAVEFORMAT.BlockSizeInBytes) -// except for the last one, which may be shorter. - - -// MULTICHANNEL AUDIO: the XMA decoder can only decode raw XMA data into either -// mono or stereo PCM data. In order to encode a 6-channel file (say), the file -// must be deinterleaved into 3 stereo streams that are encoded independently, -// producing 3 encoded XMA data streams. Then the packets in these 3 streams -// are interleaved to produce a single XMA2 file, and some information is added -// to the file so that the original 6-channel audio can be reconstructed at -// decode time. This works using the concept of an XMA stream (see above). -// -// The frames for all the streams in an XMA file are interleaved in an arbitrary -// order. To locate a frame that belongs to a given stream in a given XMA block, -// you must examine the first few packets in the block. Here (and only here) the -// packets are guaranteed to be presented in stream order, so that all frames -// beginning in packet 0 belong to stream 0 (the first stereo pair), etc. -// -// (This means that when decoding multi-stream XMA files, only entire XMA blocks -// should be submitted to the decoder; otherwise it cannot know which frames -// belong to which stream.) -// -// Once you have one frame that belongs to a given stream, you can find the next -// one by looking at the frame's 'NextFrameOffsetBits' value (which is stored in -// its first 15 bits; see XMAFRAME below). The GetXmaFrameBitPosition function -// uses this technique. - - -// SEEKING IN XMA2 FILES: Here is some pseudocode to find the byte position and -// subframe in an XMA2 file which will contain sample S when decoded. -// -// 1. Traverse the seek table to find the XMA2 block containing sample S. The -// seek table is an array of big-endian DWORDs, one per block in the file. -// The Nth DWORD is the total number of PCM samples that would be obtained -// by decoding the entire XMA file up to the end of block N. Hence, the -// block we want is the first one whose seek table entry is greater than S. -// (See the GetXmaBlockContainingSample helper function.) -// -// 2. Calculate which frame F within the block found above contains sample S. -// Since each frame decodes to 512 samples, this is straightforward. The -// first frame in the block produces samples X to X + 512, where X is the -// seek table entry for the prior block. So F is (S - X) / 512. -// -// 3. Find the bit offset within the block where frame F starts. Since frames -// are variable-sized, this can only be done by traversing all the frames in -// the block until we reach frame F. (See GetXmaFrameBitPosition.) -// -// 4. Frame F has four 128-sample subframes. To find the subframe containing S, -// we can use the formula (S % 512) / 128. -// -// In the case of multi-stream XMA files, sample S is a multichannel sample with -// parts coming from several frames, one per stream. To find all these frames, -// steps 2-4 need to be repeated for each stream N, using the knowledge that the -// first packets in a block are presented in stream order. The frame traversal -// in step 3 must be started at the first frame in the Nth packet of the block, -// which will be the first frame for stream N. (And the packet header will tell -// you the first frame's start position within the packet.) -// -// Step 1 can be performed using the GetXmaBlockContainingSample function below, -// and steps 2-4 by calling GetXmaDecodePositionForSample once for each stream. - - - -/*************************************************************************** - * XMA constants - ***************************************************************************/ - -// Size of the PCM samples produced by the XMA decoder -#define XMA_OUTPUT_SAMPLE_BYTES 2u -#define XMA_OUTPUT_SAMPLE_BITS (XMA_OUTPUT_SAMPLE_BYTES * 8u) - -// Size of an XMA packet -#define XMA_BYTES_PER_PACKET 2048u -#define XMA_BITS_PER_PACKET (XMA_BYTES_PER_PACKET * 8u) - -// Size of an XMA packet header -#define XMA_PACKET_HEADER_BYTES 4u -#define XMA_PACKET_HEADER_BITS (XMA_PACKET_HEADER_BYTES * 8u) - -// Sample blocks in a decoded XMA frame -#define XMA_SAMPLES_PER_FRAME 512u - -// Sample blocks in a decoded XMA subframe -#define XMA_SAMPLES_PER_SUBFRAME 128u - -// Maximum encoded data that can be submitted to the XMA decoder at a time -#define XMA_READBUFFER_MAX_PACKETS 4095u -#define XMA_READBUFFER_MAX_BYTES (XMA_READBUFFER_MAX_PACKETS * XMA_BYTES_PER_PACKET) - -// Maximum size allowed for the XMA decoder's output buffers -#define XMA_WRITEBUFFER_MAX_BYTES (31u * 256u) - -// Required byte alignment of the XMA decoder's output buffers -#define XMA_WRITEBUFFER_BYTE_ALIGNMENT 256u - -// Decode chunk sizes for the XMA_PLAYBACK_INIT.subframesToDecode field -#define XMA_MIN_SUBFRAMES_TO_DECODE 1u -#define XMA_MAX_SUBFRAMES_TO_DECODE 8u -#define XMA_OPTIMAL_SUBFRAMES_TO_DECODE 4u - -// LoopCount<255 means finite repetitions; LoopCount=255 means infinite looping -#define XMA_MAX_LOOPCOUNT 254u -#define XMA_INFINITE_LOOP 255u - - - -/*************************************************************************** - * XMA format structures - ***************************************************************************/ - -// The currently recommended way to express format information for XMA2 files -// is the XMA2WAVEFORMATEX structure. This structure is fully compliant with -// the WAVEFORMATEX standard and contains all the information needed to parse -// and manage XMA2 files in a compact way. - -#define WAVE_FORMAT_XMA2 0x166 - -typedef struct XMA2WAVEFORMATEX -{ - WAVEFORMATEX wfx; - // Meaning of the WAVEFORMATEX fields here: - // wFormatTag; // Audio format type; always WAVE_FORMAT_XMA2 - // nChannels; // Channel count of the decoded audio - // nSamplesPerSec; // Sample rate of the decoded audio - // nAvgBytesPerSec; // Used internally by the XMA encoder - // nBlockAlign; // Decoded sample size; channels * wBitsPerSample / 8 - // wBitsPerSample; // Bits per decoded mono sample; always 16 for XMA - // cbSize; // Size in bytes of the rest of this structure (34) - - WORD NumStreams; // Number of audio streams (1 or 2 channels each) - DWORD ChannelMask; // Spatial positions of the channels in this file, - // stored as SPEAKER_xxx values (see audiodefs.h) - DWORD SamplesEncoded; // Total number of PCM samples the file decodes to - DWORD BytesPerBlock; // XMA block size (but the last one may be shorter) - DWORD PlayBegin; // First valid sample in the decoded audio - DWORD PlayLength; // Length of the valid part of the decoded audio - DWORD LoopBegin; // Beginning of the loop region in decoded sample terms - DWORD LoopLength; // Length of the loop region in decoded sample terms - BYTE LoopCount; // Number of loop repetitions; 255 = infinite - BYTE EncoderVersion; // Version of XMA encoder that generated the file - WORD BlockCount; // XMA blocks in file (and entries in its seek table) -} XMA2WAVEFORMATEX, *PXMA2WAVEFORMATEX; - - -// The legacy XMA format structures are described here for reference, but they -// should not be used in new content. XMAWAVEFORMAT was the structure used in -// XMA version 1 files. XMA2WAVEFORMAT was used in early XMA2 files; it is not -// placed in the usual 'fmt' RIFF chunk but in its own 'XMA2' chunk. - -#ifndef WAVE_FORMAT_XMA -#define WAVE_FORMAT_XMA 0x0165 - -// Values used in the ChannelMask fields below. Similar to the SPEAKER_xxx -// values defined in audiodefs.h, but modified to fit in a single byte. -#ifndef XMA_SPEAKER_LEFT - #define XMA_SPEAKER_LEFT 0x01 - #define XMA_SPEAKER_RIGHT 0x02 - #define XMA_SPEAKER_CENTER 0x04 - #define XMA_SPEAKER_LFE 0x08 - #define XMA_SPEAKER_LEFT_SURROUND 0x10 - #define XMA_SPEAKER_RIGHT_SURROUND 0x20 - #define XMA_SPEAKER_LEFT_BACK 0x40 - #define XMA_SPEAKER_RIGHT_BACK 0x80 -#endif - - -// Used in XMAWAVEFORMAT for per-stream data -typedef struct XMASTREAMFORMAT -{ - DWORD PsuedoBytesPerSec; // Used by the XMA encoder (typo preserved for legacy reasons) - DWORD SampleRate; // The stream's decoded sample rate (in XMA2 files, - // this is the same for all streams in the file). - DWORD LoopStart; // Bit offset of the frame containing the loop start - // point, relative to the beginning of the stream. - DWORD LoopEnd; // Bit offset of the frame containing the loop end. - BYTE SubframeData; // Two 4-bit numbers specifying the exact location of - // the loop points within the frames that contain them. - // SubframeEnd: Subframe of the loop end frame where - // the loop ends. Ranges from 0 to 3. - // SubframeSkip: Subframes to skip in the start frame to - // reach the loop. Ranges from 0 to 4. - BYTE Channels; // Number of channels in the stream (1 or 2) - WORD ChannelMask; // Spatial positions of the channels in the stream -} XMASTREAMFORMAT; - -// Legacy XMA1 format structure -typedef struct XMAWAVEFORMAT -{ - WORD FormatTag; // Audio format type (always WAVE_FORMAT_XMA) - WORD BitsPerSample; // Bit depth (currently required to be 16) - WORD EncodeOptions; // Options for XMA encoder/decoder - WORD LargestSkip; // Largest skip used in interleaving streams - WORD NumStreams; // Number of interleaved audio streams - BYTE LoopCount; // Number of loop repetitions; 255 = infinite - BYTE Version; // XMA encoder version that generated the file. - // Always 3 or higher for XMA2 files. - XMASTREAMFORMAT XmaStreams[1]; // Per-stream format information; the actual - // array length is in the NumStreams field. -} XMAWAVEFORMAT; - - -// Used in XMA2WAVEFORMAT for per-stream data -typedef struct XMA2STREAMFORMAT -{ - BYTE Channels; // Number of channels in the stream (1 or 2) - BYTE RESERVED; // Reserved for future use - WORD ChannelMask; // Spatial positions of the channels in the stream -} XMA2STREAMFORMAT; - -// Legacy XMA2 format structure (big-endian byte ordering) -typedef struct XMA2WAVEFORMAT -{ - BYTE Version; // XMA encoder version that generated the file. - // Always 3 or higher for XMA2 files. - BYTE NumStreams; // Number of interleaved audio streams - BYTE RESERVED; // Reserved for future use - BYTE LoopCount; // Number of loop repetitions; 255 = infinite - DWORD LoopBegin; // Loop begin point, in samples - DWORD LoopEnd; // Loop end point, in samples - DWORD SampleRate; // The file's decoded sample rate - DWORD EncodeOptions; // Options for the XMA encoder/decoder - DWORD PsuedoBytesPerSec; // Used internally by the XMA encoder - DWORD BlockSizeInBytes; // Size in bytes of this file's XMA blocks (except - // possibly the last one). Always a multiple of - // 2Kb, since XMA blocks are arrays of 2Kb packets. - DWORD SamplesEncoded; // Total number of PCM samples encoded in this file - DWORD SamplesInSource; // Actual number of PCM samples in the source - // material used to generate this file - DWORD BlockCount; // Number of XMA blocks in this file (and hence - // also the number of entries in its seek table) - XMA2STREAMFORMAT Streams[1]; // Per-stream format information; the actual - // array length is in the NumStreams field. -} XMA2WAVEFORMAT; - -#endif // #ifndef WAVE_FORMAT_XMA - - - -/*************************************************************************** - * XMA packet structure (in big-endian form) - ***************************************************************************/ - -typedef struct XMA2PACKET -{ - int FrameCount : 6; // Number of XMA frames that begin in this packet - int FrameOffsetInBits : 15; // Bit of XmaData where the first complete frame begins - int PacketMetaData : 3; // Metadata stored in the packet (always 1 for XMA2) - int PacketSkipCount : 8; // How many packets belonging to other streams must be - // skipped to find the next packet belonging to this one - BYTE XmaData[XMA_BYTES_PER_PACKET - sizeof(DWORD)]; // XMA encoded data -} XMA2PACKET; - -// E.g. if the first DWORD of a packet is 0x30107902: -// -// 001100 000001000001111 001 00000010 -// | | | |____ Skip 2 packets to find the next one for this stream -// | | |___________ XMA2 signature (always 001) -// | |_____________________ First frame starts 527 bits into packet -// |________________________________ Packet contains 12 frames - - -// Helper functions to extract the fields above from an XMA packet. (Note that -// the bitfields cannot be read directly on little-endian architectures such as -// the Intel x86, as they are laid out in big-endian form.) - -__inline DWORD GetXmaPacketFrameCount(__in_bcount(1) const BYTE* pPacket) -{ - return (DWORD)(pPacket[0] >> 2); -} - -__inline DWORD GetXmaPacketFirstFrameOffsetInBits(__in_bcount(3) const BYTE* pPacket) -{ - return ((DWORD)(pPacket[0] & 0x3) << 13) | - ((DWORD)(pPacket[1]) << 5) | - ((DWORD)(pPacket[2]) >> 3); -} - -__inline DWORD GetXmaPacketMetadata(__in_bcount(3) const BYTE* pPacket) -{ - return (DWORD)(pPacket[2] & 0x7); -} - -__inline DWORD GetXmaPacketSkipCount(__in_bcount(4) const BYTE* pPacket) -{ - return (DWORD)(pPacket[3]); -} - - - -/*************************************************************************** - * XMA frame structure - ***************************************************************************/ - -// There is no way to represent the XMA frame as a C struct, since it is a -// variable-sized string of bits that need not be stored at a byte-aligned -// position in memory. This is the layout: -// -// XMAFRAME -// { -// LengthInBits: A 15-bit number representing the length of this frame. -// XmaData: Encoded XMA data; its size in bits is (LengthInBits - 15). -// } - -// Size in bits of the frame's initial LengthInBits field -#define XMA_BITS_IN_FRAME_LENGTH_FIELD 15 - -// Special LengthInBits value that marks an invalid final frame -#define XMA_FINAL_FRAME_MARKER 0x7FFF - - - -/*************************************************************************** - * XMA helper functions - ***************************************************************************/ - -// We define a local ASSERT macro to equal the global one if it exists. -// You can define XMA2DEFS_ASSERT in advance to override this default. -#ifndef XMA2DEFS_ASSERT - #ifdef ASSERT - #define XMA2DEFS_ASSERT ASSERT - #else - #define XMA2DEFS_ASSERT(a) /* No-op by default */ - #endif -#endif - - -// GetXmaBlockContainingSample: Use a given seek table to find the XMA block -// containing a given decoded sample. Note that the seek table entries in an -// XMA file are stored in big-endian form and may need to be converted prior -// to calling this function. - -__inline HRESULT GetXmaBlockContainingSample -( - DWORD nBlockCount, // Blocks in the file (= seek table entries) - __in_ecount(nBlockCount) const DWORD* pSeekTable, // Pointer to the seek table data - DWORD nDesiredSample, // Decoded sample to locate - __out DWORD* pnBlockContainingSample, // Index of the block containing the sample - __out DWORD* pnSampleOffsetWithinBlock // Position of the sample in this block -) -{ - DWORD nPreviousTotalSamples = 0; - DWORD nBlock; - DWORD nTotalSamplesSoFar; - - XMA2DEFS_ASSERT(pSeekTable); - XMA2DEFS_ASSERT(pnBlockContainingSample); - XMA2DEFS_ASSERT(pnSampleOffsetWithinBlock); - - for (nBlock = 0; nBlock < nBlockCount; ++nBlock) - { - nTotalSamplesSoFar = pSeekTable[nBlock]; - if (nTotalSamplesSoFar > nDesiredSample) - { - *pnBlockContainingSample = nBlock; - *pnSampleOffsetWithinBlock = nDesiredSample - nPreviousTotalSamples; - return S_OK; - } - nPreviousTotalSamples = nTotalSamplesSoFar; - } - - return E_FAIL; -} - - -// GetXmaFrameLengthInBits: Reads a given frame's LengthInBits field. - -__inline DWORD GetXmaFrameLengthInBits -( - __in_bcount(nBitPosition / 8 + 3) - __in const BYTE* pPacket, // Pointer to XMA packet[s] containing the frame - DWORD nBitPosition // Bit offset of the frame within this packet -) -{ - DWORD nRegion; - DWORD nBytePosition = nBitPosition / 8; - DWORD nBitOffset = nBitPosition % 8; - - if (nBitOffset < 2) // Only need to read 2 bytes (and might not be safe to read more) - { - nRegion = (DWORD)(pPacket[nBytePosition+0]) << 8 | - (DWORD)(pPacket[nBytePosition+1]); - return (nRegion >> (1 - nBitOffset)) & 0x7FFF; // Last 15 bits - } - else // Need to read 3 bytes - { - nRegion = (DWORD)(pPacket[nBytePosition+0]) << 16 | - (DWORD)(pPacket[nBytePosition+1]) << 8 | - (DWORD)(pPacket[nBytePosition+2]); - return (nRegion >> (9 - nBitOffset)) & 0x7FFF; // Last 15 bits - } -} - - -// GetXmaFrameBitPosition: Calculates the bit offset of a given frame within -// an XMA block or set of blocks. Returns 0 on failure. - -__inline DWORD GetXmaFrameBitPosition -( - __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s] - DWORD nXmaDataBytes, // Size of pXmaData in bytes - DWORD nStreamIndex, // Stream within which to seek - DWORD nDesiredFrame // Frame sought -) -{ - const BYTE* pCurrentPacket; - DWORD nPacketsExamined = 0; - DWORD nFrameCountSoFar = 0; - DWORD nFramesToSkip; - DWORD nFrameBitOffset; - - XMA2DEFS_ASSERT(pXmaData); - XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0); - - // Get the first XMA packet belonging to the desired stream, relying on the - // fact that the first packets for each stream are in consecutive order at - // the beginning of an XMA block. - - pCurrentPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET; - for (;;) - { - // If we have exceeded the size of the XMA data, return failure - if (pCurrentPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes) - { - return 0; - } - - // If the current packet contains the frame we are looking for... - if (nFrameCountSoFar + GetXmaPacketFrameCount(pCurrentPacket) > nDesiredFrame) - { - // See how many frames in this packet we need to skip to get to it - XMA2DEFS_ASSERT(nDesiredFrame >= nFrameCountSoFar); - nFramesToSkip = nDesiredFrame - nFrameCountSoFar; - - // Get the bit offset of the first frame in this packet - nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pCurrentPacket); - - // Advance nFrameBitOffset to the frame of interest - while (nFramesToSkip--) - { - nFrameBitOffset += GetXmaFrameLengthInBits(pCurrentPacket, nFrameBitOffset); - } - - // The bit offset to return is the number of bits from pXmaData to - // pCurrentPacket plus the bit offset of the frame of interest - return (DWORD)(pCurrentPacket - pXmaData) * 8 + nFrameBitOffset; - } - - // If we haven't found the right packet yet, advance our counters - ++nPacketsExamined; - nFrameCountSoFar += GetXmaPacketFrameCount(pCurrentPacket); - - // And skip to the next packet belonging to the same stream - pCurrentPacket += XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pCurrentPacket) + 1); - } -} - - -// GetLastXmaFrameBitPosition: Calculates the bit offset of the last complete -// frame in an XMA block or set of blocks. - -__inline DWORD GetLastXmaFrameBitPosition -( - __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s] - DWORD nXmaDataBytes, // Size of pXmaData in bytes - DWORD nStreamIndex // Stream within which to seek -) -{ - const BYTE* pLastPacket; - DWORD nBytesToNextPacket; - DWORD nFrameBitOffset; - DWORD nFramesInLastPacket; - - XMA2DEFS_ASSERT(pXmaData); - XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0); - XMA2DEFS_ASSERT(nXmaDataBytes >= XMA_BYTES_PER_PACKET * (nStreamIndex + 1)); - - // Get the first XMA packet belonging to the desired stream, relying on the - // fact that the first packets for each stream are in consecutive order at - // the beginning of an XMA block. - pLastPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET; - - // Search for the last packet belonging to the desired stream - for (;;) - { - nBytesToNextPacket = XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pLastPacket) + 1); - XMA2DEFS_ASSERT(nBytesToNextPacket); - if (pLastPacket + nBytesToNextPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes) - { - break; // The next packet would extend beyond the end of pXmaData - } - pLastPacket += nBytesToNextPacket; - } - - // The last packet can sometimes have no seekable frames, in which case we - // have to use the previous one - if (GetXmaPacketFrameCount(pLastPacket) == 0) - { - pLastPacket -= nBytesToNextPacket; - } - - // Found the last packet. Get the bit offset of its first frame. - nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pLastPacket); - - // Traverse frames until we reach the last one - nFramesInLastPacket = GetXmaPacketFrameCount(pLastPacket); - while (--nFramesInLastPacket) - { - nFrameBitOffset += GetXmaFrameLengthInBits(pLastPacket, nFrameBitOffset); - } - - // The bit offset to return is the number of bits from pXmaData to - // pLastPacket plus the offset of the last frame in this packet. - return (DWORD)(pLastPacket - pXmaData) * 8 + nFrameBitOffset; -} - - -// GetXmaDecodePositionForSample: Obtains the information needed to make the -// decoder generate audio starting at a given sample position relative to the -// beginning of the given XMA block: the bit offset of the appropriate frame, -// and the right subframe within that frame. This data can be passed directly -// to the XMAPlaybackSetDecodePosition function. - -__inline HRESULT GetXmaDecodePositionForSample -( - __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s] - DWORD nXmaDataBytes, // Size of pXmaData in bytes - DWORD nStreamIndex, // Stream within which to seek - DWORD nDesiredSample, // Sample sought - __out DWORD* pnBitOffset, // Returns the bit offset within pXmaData of - // the frame containing the sample sought - __out DWORD* pnSubFrame // Returns the subframe containing the sample -) -{ - DWORD nDesiredFrame = nDesiredSample / XMA_SAMPLES_PER_FRAME; - DWORD nSubFrame = (nDesiredSample % XMA_SAMPLES_PER_FRAME) / XMA_SAMPLES_PER_SUBFRAME; - DWORD nBitOffset = GetXmaFrameBitPosition(pXmaData, nXmaDataBytes, nStreamIndex, nDesiredFrame); - - XMA2DEFS_ASSERT(pnBitOffset); - XMA2DEFS_ASSERT(pnSubFrame); - - if (nBitOffset) - { - *pnBitOffset = nBitOffset; - *pnSubFrame = nSubFrame; - return S_OK; - } - else - { - return E_FAIL; - } -} - - -// GetXmaSampleRate: Obtains the legal XMA sample rate (24, 32, 44.1 or 48Khz) -// corresponding to a generic sample rate. - -__inline DWORD GetXmaSampleRate(DWORD dwGeneralRate) -{ - DWORD dwXmaRate = 48000; // Default XMA rate for all rates above 44100Hz - - if (dwGeneralRate <= 24000) dwXmaRate = 24000; - else if (dwGeneralRate <= 32000) dwXmaRate = 32000; - else if (dwGeneralRate <= 44100) dwXmaRate = 44100; - - return dwXmaRate; -} - - -// Functions to convert between WAVEFORMATEXTENSIBLE channel masks (combinations -// of the SPEAKER_xxx flags defined in audiodefs.h) and XMA channel masks (which -// are limited to eight possible speaker positions: left, right, center, low -// frequency, side left, side right, back left and back right). - -__inline DWORD GetStandardChannelMaskFromXmaMask(BYTE bXmaMask) -{ - DWORD dwStandardMask = 0; - - if (bXmaMask & XMA_SPEAKER_LEFT) dwStandardMask |= SPEAKER_FRONT_LEFT; - if (bXmaMask & XMA_SPEAKER_RIGHT) dwStandardMask |= SPEAKER_FRONT_RIGHT; - if (bXmaMask & XMA_SPEAKER_CENTER) dwStandardMask |= SPEAKER_FRONT_CENTER; - if (bXmaMask & XMA_SPEAKER_LFE) dwStandardMask |= SPEAKER_LOW_FREQUENCY; - if (bXmaMask & XMA_SPEAKER_LEFT_SURROUND) dwStandardMask |= SPEAKER_SIDE_LEFT; - if (bXmaMask & XMA_SPEAKER_RIGHT_SURROUND) dwStandardMask |= SPEAKER_SIDE_RIGHT; - if (bXmaMask & XMA_SPEAKER_LEFT_BACK) dwStandardMask |= SPEAKER_BACK_LEFT; - if (bXmaMask & XMA_SPEAKER_RIGHT_BACK) dwStandardMask |= SPEAKER_BACK_RIGHT; - - return dwStandardMask; -} - -__inline BYTE GetXmaChannelMaskFromStandardMask(DWORD dwStandardMask) -{ - BYTE bXmaMask = 0; - - if (dwStandardMask & SPEAKER_FRONT_LEFT) bXmaMask |= XMA_SPEAKER_LEFT; - if (dwStandardMask & SPEAKER_FRONT_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT; - if (dwStandardMask & SPEAKER_FRONT_CENTER) bXmaMask |= XMA_SPEAKER_CENTER; - if (dwStandardMask & SPEAKER_LOW_FREQUENCY) bXmaMask |= XMA_SPEAKER_LFE; - if (dwStandardMask & SPEAKER_SIDE_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_SURROUND; - if (dwStandardMask & SPEAKER_SIDE_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_SURROUND; - if (dwStandardMask & SPEAKER_BACK_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_BACK; - if (dwStandardMask & SPEAKER_BACK_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_BACK; - - return bXmaMask; -} - - -// LocalizeXma2Format: Modifies a XMA2WAVEFORMATEX structure in place to comply -// with the current platform's byte-ordering rules (little- or big-endian). - -__inline HRESULT LocalizeXma2Format(__inout XMA2WAVEFORMATEX* pXma2Format) -{ - #define XMASWAP2BYTES(n) ((WORD)(((n) >> 8) | (((n) & 0xff) << 8))) - #define XMASWAP4BYTES(n) ((DWORD)((n) >> 24 | (n) << 24 | ((n) & 0xff00) << 8 | ((n) & 0xff0000) >> 8)) - - if (pXma2Format->wfx.wFormatTag == WAVE_FORMAT_XMA2) - { - return S_OK; - } - else if (XMASWAP2BYTES(pXma2Format->wfx.wFormatTag) == WAVE_FORMAT_XMA2) - { - pXma2Format->wfx.wFormatTag = XMASWAP2BYTES(pXma2Format->wfx.wFormatTag); - pXma2Format->wfx.nChannels = XMASWAP2BYTES(pXma2Format->wfx.nChannels); - pXma2Format->wfx.nSamplesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nSamplesPerSec); - pXma2Format->wfx.nAvgBytesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nAvgBytesPerSec); - pXma2Format->wfx.nBlockAlign = XMASWAP2BYTES(pXma2Format->wfx.nBlockAlign); - pXma2Format->wfx.wBitsPerSample = XMASWAP2BYTES(pXma2Format->wfx.wBitsPerSample); - pXma2Format->wfx.cbSize = XMASWAP2BYTES(pXma2Format->wfx.cbSize); - pXma2Format->NumStreams = XMASWAP2BYTES(pXma2Format->NumStreams); - pXma2Format->ChannelMask = XMASWAP4BYTES(pXma2Format->ChannelMask); - pXma2Format->SamplesEncoded = XMASWAP4BYTES(pXma2Format->SamplesEncoded); - pXma2Format->BytesPerBlock = XMASWAP4BYTES(pXma2Format->BytesPerBlock); - pXma2Format->PlayBegin = XMASWAP4BYTES(pXma2Format->PlayBegin); - pXma2Format->PlayLength = XMASWAP4BYTES(pXma2Format->PlayLength); - pXma2Format->LoopBegin = XMASWAP4BYTES(pXma2Format->LoopBegin); - pXma2Format->LoopLength = XMASWAP4BYTES(pXma2Format->LoopLength); - pXma2Format->BlockCount = XMASWAP2BYTES(pXma2Format->BlockCount); - return S_OK; - } - else - { - return E_FAIL; // Not a recognizable XMA2 format - } - - #undef XMASWAP2BYTES - #undef XMASWAP4BYTES -} - - -#endif // #ifndef __XMA2DEFS_INCLUDED__ diff --git a/jan/src/dep/qtcreator/SDL.h b/jan/src/dep/qtcreator/SDL.h deleted file mode 100644 index 47945dc07..000000000 --- a/jan/src/dep/qtcreator/SDL.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef FBA_SDL_H -#define FBA_SDL_H - -#include - -#endif \ No newline at end of file diff --git a/jan/src/dep/scripts/build_details.cpp b/jan/src/dep/scripts/build_details.cpp deleted file mode 100644 index ea514bc60..000000000 --- a/jan/src/dep/scripts/build_details.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include - -int main(int /*argc*/, char** /*argv*/) -{ - printf("#define BUILD_TIME %s\n", __TIME__); - printf("#define BUILD_DATE %s\n", __DATE__); - -#ifdef _UNICODE - printf("#define BUILD_CHAR Unicode\n"); -#else - printf("#define BUILD_CHAR ANSI\n"); -#endif - -#if !defined BUILD_X64_EXE - printf("#define BUILD_CPU X86\n"); -#else - printf("#define BUILD_CPU X64\n"); -#endif - -#if defined __GNUC__ - printf("#define BUILD_COMP GCC %i.%i.%i\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); -#elif defined _MSC_VER - #if _MSC_VER >= 1300 && _MSC_VER < 1310 - printf("#define BUILD_COMP Visual C++ 2002\n"); - #elif _MSC_VER >= 1310 && _MSC_VER < 1400 - printf("#define BUILD_COMP Visual C++ 2003\n"); - #elif _MSC_VER >= 1400 && _MSC_VER < 1500 - printf("#define BUILD_COMP Visual C++ 2005\n"); - #elif _MSC_VER >= 1500 && _MSC_VER < 1600 - printf("#define BUILD_COMP Visual C++ 2008\n"); - #elif _MSC_VER >= 1600 && _MSC_VER < 1700 - printf("#define BUILD_COMP Visual C++ 2010\n"); - #elif _MSC_VER >= 1700 && _MSC_VER < 1800 - #if defined BUILD_VS_XP_TARGET - printf("#define BUILD_COMP Visual C++ 2012 (XP)\n"); - #else - printf("#define BUILD_COMP Visual C++ 2012\n"); - #endif - #elif _MSC_VER >= 1800 && _MSC_VER < 1900 - #if defined BUILD_VS_XP_TARGET - printf("#define BUILD_COMP Visual C++ 2013 (XP)\n"); - #else - printf("#define BUILD_COMP Visual C++ 2013\n"); - #endif - #elif _MSC_VER >= 1900 && _MSC_VER < 1910 - #if defined BUILD_VS_XP_TARGET - printf("#define BUILD_COMP Visual C++ 2015 (XP)\n"); - #else - printf("#define BUILD_COMP Visual C++ 2015\n"); - #endif - #elif _MSC_VER >= 1910 && _MSC_VER < 1920 - printf("#define BUILD_COMP Visual C++ 2017\n"); - #else - printf("#define BUILD_COMP Visual C++ %i.%i\n", _MSC_VER / 100 - 6, _MSC_VER % 100 / 10); - #endif -#else - printf("#define BUILD_COMP Unknown compiler\n"); -#endif - -// Visual C's resource compiler doesn't define _MSC_VER, but we need it for VERSION resources -#ifdef _MSC_VER - printf("#ifndef _MSC_VER\n"); - printf(" #define _MSC_VER %i\n", _MSC_VER); - printf("#endif\n"); -#endif - - return 0; -} diff --git a/jan/src/dep/scripts/cave_sprite_func.pl b/jan/src/dep/scripts/cave_sprite_func.pl deleted file mode 100644 index b32a3c310..000000000 --- a/jan/src/dep/scripts/cave_sprite_func.pl +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -my $OutfileFun; -my $OutfileTab; - -# Process command line arguments -if ( $ARGV[0] =~ /^-o/i ) { - if ( $ARGV[0] =~ /^-o$/i ) { - $OutfileFun = $ARGV[1]; - } else { - $ARGV[0] =~ /(?<=-o)(.*)/i; - $OutfileFun = $1; - } -} - -unless ( $OutfileFun ) { - die "Usage: $0 -o \n\n"; -} - -$OutfileTab = $OutfileFun; -$OutfileTab =~ s/(\.\w+)/_table$1/; - -open( OUTFILEFUN, ">$OutfileFun" ) or die "\nError: Couldn't open OUTPUT file $OutfileFun: $!"; -open( OUTFILETAB, ">$OutfileTab" ) or die "\nError: Couldn't open OUTPUT file $OutfileTab: $!"; - -print "Generating $OutfileFun & $OutfileTab...\n"; - -# Generate optimized functions and a table with the function names - -print OUTFILEFUN "#define EIGHTBIT 1\n"; -print OUTFILEFUN "#define ROT 0\n\n"; -print OUTFILEFUN "#define BPP 16\n"; - -print OUTFILETAB "// Table with all function addresses.\n"; -print OUTFILETAB "static RenderSpriteFunction RenderSpriteFunctionTable[] = {\n"; - -for ( my $Size = 320; $Size <= 384; $Size += 64 ) { - my @ZBuffer = ( "_NOZBUFFER", "_RZBUFFER", "_WZBUFFER", "_RWZBUFFER" ); - my $Flip; - my $Zoom; - - print OUTFILEFUN "#define XSIZE $Size\n"; - - my $FunctionName = "&RenderSprite16_" . $Size . "_ROT0"; - - # No scaling - - print OUTFILEFUN "#define ZOOM 0\n"; - - for ( my $Function = 0; $Function < 8; $Function++ ) { - if ( ($Function & 3) == 0 ) { - print OUTFILEFUN "#define XFLIP " . (($Function & 4) / 4) . "\n"; - - if ( ($Function & 4) == 0 ) { - $Flip = "_NOFLIP"; - } else { - $Flip = "_FLIPX"; - } - - print OUTFILETAB "\t"; - } - - print OUTFILEFUN "#define ZBUFFER " . ($Function & 3) . "\n"; - - print OUTFILEFUN "#include \"cave_sprite_render.h\"\n"; - - print OUTFILETAB $FunctionName . $Flip . "_NOZOOM_CLIPX" . $ZBuffer[$Function & 3] . "_256, "; - - print OUTFILEFUN "#undef ZBUFFER\n"; - - if ( ($Function & 3) == 3 ) { - print OUTFILEFUN "#undef XFLIP\n"; - - print OUTFILETAB "\n"; - } - } - - print OUTFILEFUN "#undef ZOOM\n\n"; - - # Scale up/down - - print OUTFILEFUN "#define XFLIP 0\n"; - - for ( my $Function = 0; $Function < 8; $Function++ ) { - if ( ($Function & 3) == 0 ) { - print OUTFILEFUN "#define ZOOM " . (1 + ($Function & 4) / 4) . "\n"; - - if ( ($Function & 4) == 0 ) { - $Zoom = "_ZOOMOUT"; - } else { - $Zoom = "_ZOOMIN"; - } - - print OUTFILETAB "\t"; - } - print OUTFILEFUN "#define ZBUFFER " . ($Function & 3) . "\n"; - print OUTFILEFUN "#include \"cave_sprite_render_zoom.h\"\n"; - print OUTFILEFUN "#undef ZBUFFER\n"; - - print OUTFILETAB $FunctionName . "_NOFLIP" . $Zoom . "_NOCLIP" . $ZBuffer[$Function & 3] . "_256, "; - - if ( ($Function & 3) == 3 ) { - print OUTFILEFUN "#undef ZOOM\n\n"; - - print OUTFILETAB "\n"; - } - } - - print OUTFILEFUN "#undef XFLIP\n"; - print OUTFILEFUN "#undef XSIZE\n\n"; -} - -print OUTFILEFUN "#undef BPP\n\n"; -print OUTFILEFUN "#undef ROT\n\n"; -print OUTFILEFUN "#undef EIGHTBIT\n\n"; - -print OUTFILETAB "};\n\n"; - -$OutfileTab =~ /(?:.*[\\\/])(.*)/; -print OUTFILEFUN "#include \"$1\"\n"; - -print OUTFILETAB "static RenderSpriteFunction* RenderSprite_ROT0[2] = {\n\t&RenderSpriteFunctionTable[0],\n\t&RenderSpriteFunctionTable[16]\n};\n"; - -close( OUTFILETAB ); -close( OUTFILEFUN ); diff --git a/jan/src/dep/scripts/cave_tile_func.pl b/jan/src/dep/scripts/cave_tile_func.pl deleted file mode 100644 index e670e6a70..000000000 --- a/jan/src/dep/scripts/cave_tile_func.pl +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -my $OutfileFun; -my $OutfileTab; - -# Process command line arguments -if ( $ARGV[0] =~ /^-o/i ) { - if ( $ARGV[0] =~ /^-o$/i ) { - $OutfileFun = $ARGV[1]; - } else { - $ARGV[0] =~ /(?<=-o)(.*)/i; - $OutfileFun = $1; - } -} - -unless ( $OutfileFun ) { - die "Usage: $0 -o \n\n"; -} - -$OutfileTab = $OutfileFun; -$OutfileTab =~ s/(\.\w+)/_table$1/; - -open( OUTFILEFUN, ">$OutfileFun" ) or die "\nError: Couldn't open OUTPUT file $OutfileFun: $!"; -open( OUTFILETAB, ">$OutfileTab" ) or die "\nError: Couldn't open OUTPUT file $OutfileTab: $!"; - -print "Generating $OutfileFun & $OutfileTab...\n"; - -# Generate optimized functions and a table with the function names - -print OUTFILEFUN "#define XFLIP 0\n"; -print OUTFILEFUN "#define YFLIP 0\n"; -print OUTFILEFUN "#define ROT 0\n\n"; -print OUTFILEFUN "#define BPP 16\n"; - -print OUTFILETAB "// Table with all function addresses.\n"; -print OUTFILETAB "static RenderTileFunction RenderTileFunctionTable[] = {\n"; - -for ( my $Size = 320; $Size <= 384; $Size += 64 ) { - my $RowScroll; - my $RowSelect; - - print OUTFILEFUN "#define XSIZE $Size\n"; - print OUTFILEFUN "#define EIGHTBIT 1\n"; - - my $FunctionName = "&RenderTile16_" . $Size . "_ROT0_NOFLIP"; - - for ( my $Function = 0; $Function < 3; $Function++ ) { - if ( ($Function & 1) == 0 ) { - $RowScroll = "_NOROWSCROLL"; - - if ( ($Function & 2) == 0 ) { - $RowSelect = "_NOROWSELECT"; - } else { - $RowSelect = "_ROWSELECT"; - } - } else { - $RowScroll = "_ROWSCROLL"; - } - - print OUTFILEFUN "#define ROWSCROLL " . ($Function & 1) . "\n"; - print OUTFILEFUN "#define ROWSELECT " . (($Function & 2) / 2) . "\n"; - - print OUTFILETAB "\t"; - - print OUTFILEFUN "#define DOCLIP 0\n"; - print OUTFILEFUN "#include \"cave_tile_render.h\"\n"; - print OUTFILEFUN "#undef DOCLIP\n"; - - print OUTFILETAB $FunctionName . $RowScroll . $RowSelect . "_NOCLIP_256, "; - - print OUTFILEFUN "#define DOCLIP 1\n"; - print OUTFILEFUN "#include \"cave_tile_render.h\"\n"; - print OUTFILEFUN "#undef DOCLIP\n"; - - print OUTFILETAB $FunctionName . $RowScroll . $RowSelect . "_CLIP_256, "; - - print OUTFILEFUN "#undef ROWSELECT\n"; - print OUTFILEFUN "#undef ROWSCROLL\n"; - - print OUTFILETAB "\n"; - } - print OUTFILEFUN "#undef EIGHTBIT\n\n"; - print OUTFILEFUN "#undef XSIZE\n\n"; -} - -print OUTFILEFUN "#undef BPP\n\n"; -print OUTFILEFUN "#undef ROT\n\n"; - -print OUTFILEFUN "#undef YFLIP\n"; -print OUTFILEFUN "#undef XFLIP\n\n"; - -print OUTFILETAB "};\n\n"; - -$OutfileTab =~ /(?:.*[\\\/])(.*)/; -print OUTFILEFUN "#include \"$1\"\n"; - -print OUTFILETAB "static RenderTileFunction* RenderTile_ROT0[2] = {\n\t&RenderTileFunctionTable[0],\n\t&RenderTileFunctionTable[6]\n};\n"; - -close( OUTFILETAB ); -close( OUTFILEFUN ); - diff --git a/jan/src/dep/scripts/fixrc.pl b/jan/src/dep/scripts/fixrc.pl deleted file mode 100644 index f7540cc8b..000000000 --- a/jan/src/dep/scripts/fixrc.pl +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/perl -w - -# Fixes .rc files generated by Microsoft Developer Studio so that windres will -# correctly interpret them. To ensure correct paths to files, execute this script -# from the same place you will execute windres. - -use strict; - -my $Infile; -my $Outfile; -my $PathPrefix; - -# Process command line arguments -for ( my $i = 0; $i < scalar @ARGV; $i++ ) {{ - - # Output file - if ( $ARGV[$i] =~ /^-o/i ) { - if ( $ARGV[$i] =~ /^-o$/i ) { - $i++; - if ( $i < scalar @ARGV ) { - $Outfile = $ARGV[$i]; - } - } else { - $ARGV[$i] =~ /(?<=-o)(.*)/i; - $Outfile = $1; - } - next; - } - - # Input file - $Infile = $ARGV[$i]; -}} - -unless ( $Infile and $Outfile ) { - die "Usage: $0 -o \n\n"; -} - -if ( $Infile =~ /.*(?=\/.*$)/ ) { - $PathPrefix = "$&/"; -} else { - $PathPrefix = ""; -} - -open( INFILE, $Infile ) or die "\nError: Couldn't open INPUT file $Infile: $!"; -open( OUTFILE, ">$Outfile" ) or die "\nError: Couldn't open OUTPUT file $Outfile: $!"; - -print "Converting $Infile for use with windres...\n"; - -# first define missing constants and include needed files -print OUTFILE << "marker"; -// This file is a windres compatible version of $Infile -// It was fixed by $0 (perl $]) - -// afxres.h cannot be redistributed, so define constants and include files needed here -#ifndef _MSC_VER - - #ifndef RC_INVOKED - #define RC_INVOKED - #endif - - #include - #include - - #ifndef IDC_STATIC - #define IDC_STATIC (-1) - #endif - -#endif - -marker - -while ( my $line = ) { - chomp $line; - if ( $line =~ /^\#include \"afxres.h\"/ ) { - print OUTFILE "#ifdef _MSC_VER\n"; - print OUTFILE "$line\n"; - print OUTFILE "#endif\n"; - } else { - # add NOT WS_POPUP to all windows with WS_CHILD specified - $line =~ s/(? [-l ] [...]\n\n"; -} - -open( OUTFILE, ">$Outfile" ) or die "\nError: Couldn't open OUTPUT file $Outfile $!"; - -print "Generating gamelist in $Outfile...\n"; - -# Build a list of all drivers -foreach my $filename ( @Filelist ) { - open( INFILE, $filename ) or die "\nError: Couldn't read $filename $!"; - while ( my $line = ) { - - # Strip C++ style // comments - if ( $line =~ /(.*?)\/\// ) { - $line = $1; - } - - # Strip C style /* comments */ - if ( $line =~ /(.*)\/\*/ ) { - my $temp = $1; - while ( $line and !($line =~ /\*\/(.*)/) ) { - $line = ; - } - $line = $temp; - substr( $line, length( $line ) ) = $1; - } - - # get included .cpp.h files in the same directory - if ( $line =~ /^\s*#include "d_\w*.h"/ ) { - $line =~ /^\s*#include "(.*)"/; - my $newfile = $1; - $filename =~ /(.*[\/\\])[^\/\\]/; - push( @Filelist, "$1$newfile" ); - } - - if ( $line =~ /struct\s+BurnDriver([D|X]?)\s+(\w+)(.*)/ ) { - - # We're at the start of a BurnDriver declaration - - # Create a hash key with the name of the structure, - # Fill the first element of the array with the driver status - my $name = $2; - $Drivers{$name}[0] = "$1"; - - # Read the Burndriver structure into a variable - my $struct = $3; - do { - $line = ; - - # Strip C++ style // comments - if ( $line =~ /(.*?)\/\// ) { - $line = $1; - } - - substr( $struct, length( $struct ) ) = $line; - } until $line =~ /;/; - - # Strip anything after the ; - $struct =~ /(.*;)/s; - $struct = $1; - - # Strip C style /* comments */ - while ( $struct =~ /(.*)\/\*.*?\*\/(.*)/s ) { - $struct = $1; - substr( $struct, length( $struct ) ) = $2; - } - - # We now have the complete Burndriver structure without comments - - # Extract the strings from the variable - $struct =~ /\s*(".*"|null|0)\s*,\s*(".*"|null|0)\s*,\s*(".*"|null|0)\s*,\s*(".*"|null|0)\s*,\s*(".*"|null|0)\s*,\s*(".*"|null|0)\s*,\s*(".*"|null|0)\s*,\s*(".*"|null|0)\s*,\s*(".*"|null|0),\s*(L".*"|null|0)\s*,\s*(L".*"|null|0)\s*,\s*(L".*"|null|0)\s*,\s*(L".*"|null|0)\s*,\s*(\d|[^,]*)/si; - - $Drivers{$name}[1] = $1; # Name - $Drivers{$name}[2] = $6; # Full name - $Drivers{$name}[3] = $7; # Remarks - $Drivers{$name}[4] = $8; # Company - $Drivers{$name}[5] = $9; # Hardware - $Drivers{$name}[6] = $5; # Year of release - $Drivers{$name}[7] = $2; # Parent - - if ( $14 ne "1" && ($14 =~ /BDF_GAME_WORKING/) == 0 ) { # Working status - $Drivers{$name}[8] = "NOT WORKING"; - } else { - $Drivers{$name}[8] = ""; - } - $Drivers{$name}[9] = "$filename"; # Filename - - # Convert NULL/null/0 to empty string or remove quotes - foreach $line ( @{$Drivers{$name}} ) { - if ( $line =~ /^(null|NULL|0)/ ) { - $line = ""; - } else { - $line =~ /(^"?)(.*)\1/; - $line = $2; - } - } - - # We only want the 1st name - $Drivers{$name}[2] =~ /(.*)\\0.*/; - $Drivers{$name}[2] = $1; - - $Drivers{$name}[10] = $Drivers{$name}[2]; - if ( $struct =~ /BDF_PROTOTYPE/ || $struct =~ /BDF_BOOTLEG/ || $Drivers{$name}[3] ne "" ) { - $Drivers{$name}[10] = "$Drivers{$name}[10]" . " ["; - } - if ( $struct =~ /BDF_PROTOTYPE/ ) { - $Drivers{$name}[10] = "$Drivers{$name}[10]" . "Prototype"; - if ( $struct =~ /BDF_BOOTLEG/ || $Drivers{$name}[3] ne "" ) { - $Drivers{$name}[10] = "$Drivers{$name}[10]" . ", "; - } - } - if ( $struct =~ /BDF_BOOTLEG/ ) { - $Drivers{$name}[10] = "$Drivers{$name}[10]" . "Bootleg"; - if ( $Drivers{$name}[3] ne "" ) { - $Drivers{$name}[10] = "$Drivers{$name}[10]" . ", "; - } - } - if ( $Drivers{$name}[3] ne "" ) { - $Drivers{$name}[10] = "$Drivers{$name}[10]" . "$Drivers{$name}[3]"; - } - if ( $struct =~ /BDF_PROTOTYPE/ || $struct =~ /BDF_BOOTLEG/ || $Drivers{$name}[3] ne "" ) { - $Drivers{$name}[10] = "$Drivers{$name}[10]" . "]"; - } - } - } - close( INFILE ); -} - -# Sort the list of drivers using the decorated game name as the key -@Driverlist = sort { - lc( $Drivers{$a}[10] ) cmp lc( $Drivers{$b}[10] ); -} keys %Drivers; - -# first define needed constants and include needed files -print OUTFILE << "CPPEND"; -// This file was generated by $0 (perl $]) - -// Declaration of all drivers -#define DRV extern struct BurnDriver -CPPEND - -my $Debug = 0; -foreach my $name ( @Driverlist ) { - - if ( $Drivers{$name}[0] eq "X" ) { - print OUTFILE "//"; - } else { - if ( $Drivers{$name}[0] eq "D" ) { - unless ( $Debug == 1) { - $Debug = 1; - print OUTFILE "#if defined FBA_DEBUG\n"; - } - } else { - if ( $Debug == 1 ) { - $Debug = 0; - print OUTFILE "#endif\n"; - } - } - print OUTFILE "DRV"; - } - print OUTFILE "\t\t$name;"; - if ( $Drivers{$name}[0] eq "D" or $Drivers{$name}[0] eq "X" ) { - my $column = int( (9 + length( $name )) / 4 ); - while ( $column < 8 ) { - print OUTFILE "\t"; - $column ++; - } - print OUTFILE "// "; - if ( $Drivers{$name}[3] ) { - print OUTFILE "$Drivers{$name}[3]"; - } else { - print OUTFILE "no comment"; - } - if ( $Drivers{$name}[8] ) { - print OUTFILE " [$Drivers{$name}[8]]"; - } - print OUTFILE "\n"; - } else { - print OUTFILE "\n"; - } -} -if ( $Debug == 1 ) { - print OUTFILE "#endif\n"; -} - -print OUTFILE << "CPPEND"; -#undef DRV - -// Structure containing addresses of all drivers -// Needs to be kept sorted (using the full game name as the key) to prevent problems with the gamelist in Kaillera -static struct BurnDriver* pDriver[] = { -CPPEND - -$Debug = 0; -foreach my $name ( @Driverlist ) { - if ( $Drivers{$name}[0] eq "X" ) { - print OUTFILE "//"; - } else { - if ( $Drivers{$name}[0] eq "D" ) { - unless ( $Debug == 1) { - $Debug = 1; - print OUTFILE "#if defined FBA_DEBUG\n"; - } - } else { - if ( $Debug == 1 ) { - $Debug = 0; - print OUTFILE "#endif\n"; - } - } - } - print OUTFILE "\t&$name,"; - my $column = int( (6 + length( $name )) / 4 ); - while ( $column < 8 ) { - print OUTFILE "\t"; - $column++; - } - print OUTFILE "// $Drivers{$name}[2]"; - if ( $Drivers{$name}[0] eq "D" or $Drivers{$name}[0] eq "X" ) { - print OUTFILE " ["; - if ( $Drivers{$name}[3] ) { - print OUTFILE "$Drivers{$name}[3]"; - } else { - print OUTFILE "no comment"; - } - if ( $Drivers{$name}[8] ) { - print OUTFILE ", $Drivers{$name}[8]"; - } - print OUTFILE "]\n"; - } else { - if ( $Drivers{$name}[8] ) { - print OUTFILE " ["; - if ( $Drivers{$name}[3] ) { - print OUTFILE "$Drivers{$name}[3]"; - } else { - print OUTFILE "no comment"; - } - print OUTFILE ", $Drivers{$name}[8]]"; - } - print OUTFILE "\n"; - } -} -if ( $Debug == 1 ) { - print OUTFILE "#endif\n"; -} - -print OUTFILE "};\n"; - -close( OUTFILE ); - -if ( $Listfile ) { - - open( OUTFILE, ">$Listfile" ) or die "\nError: Couldn't open OUTPUT file $Listfile $!"; - - print "Generating gamelist.txt...\n"; - - print OUTFILE "This list contains all games supported by FB Alpha.\x0d\x0a\x0d\x0a"; - - print OUTFILE scalar @Driverlist . " games supported in total; "; - print OUTFILE "X = excluded from build; "; - print OUTFILE "D = included in debug build only; "; - print OUTFILE "NW = not working\x0d\x0a\x0d\x0a"; - - print OUTFILE " name\t\t status full name\t\t\t\t\t\t parent\t year\t company\t hardware\t remarks\x0d\x0a"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------+\x0d\x0a"; - - my $Text; - - foreach my $name ( @Driverlist ) { - - print OUTFILE "| $Drivers{$name}[1]"; - my $column = int( (2 + length( $Drivers{$name}[1] )) / 8 ); - while ( $column < 2 ) { - print OUTFILE "\t"; - $column++; - } - - print OUTFILE "| "; - if ( $Drivers{$name}[0] ) { - print OUTFILE "$Drivers{$name}[0]"; - } else { - print OUTFILE " "; - } - if ( $Drivers{$name}[8] ) { - print OUTFILE " NW"; - } - print OUTFILE "\t"; - $column++; - - $Text = substr( $Drivers{$name}[2], 0, 54); - print OUTFILE "| $Text"; - $column += int( (2 + length( $Text )) / 8 ); - while ( $column < 10 ) { - print OUTFILE "\t"; - $column++; - } - - print OUTFILE "| $Drivers{$name}[7]"; - $column += int( (2 + length( $Drivers{$name}[7] )) / 8 ); - while ( $column < 12 ) { - print OUTFILE "\t"; - $column++; - } - print OUTFILE "| $Drivers{$name}[6]"; - $column += int( (2 + length( $Drivers{$name}[6] )) / 8 ); - while ( $column < 13 ) { - print OUTFILE "\t"; - $column++; - } - - $Text = substr( $Drivers{$name}[4], 0, 14); - print OUTFILE "| $Text"; - $column += int( (2 + length( $Text )) / 8 ); - while ( $column < 15 ) { - print OUTFILE "\t"; - $column++; - } - - $Text = substr( $Drivers{$name}[5], 0, 14); - print OUTFILE "| $Text"; - $column += int( (2 + length( $Text )) / 8 ); - while ( $column < 17 ) { - print OUTFILE "\t"; - $column++; - } - - $Text = substr( $Drivers{$name}[3], 0, 38); - print OUTFILE "| $Text"; - $column += int( ( 2 + length( $Text )) / 8 ); - while ( $column < 22 ) { - print OUTFILE "\t"; - $column++; - } - print OUTFILE "|\x0d\x0a"; - } - - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "+-------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------"; - print OUTFILE "--------+\x0d\x0a"; - - close( OUTFILE ); -} diff --git a/jan/src/dep/scripts/license2rtf.pl b/jan/src/dep/scripts/license2rtf.pl deleted file mode 100644 index 3ff8c6d07..000000000 --- a/jan/src/dep/scripts/license2rtf.pl +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -my $Outfile; -my $Infile; - -my $Font = "Tahoma"; -my $FontSize = 16; - -my $escape = 0; - -# Process command line arguments -for ( my $i = 0; $i < scalar @ARGV; $i++ ) {{ - - # Output file - if ( $ARGV[$i] =~ /^-o/i ) { - if ( $ARGV[$i] =~ /^-o$/i ) { - $i++; - if ( $i < scalar @ARGV ) { - $Outfile = $ARGV[$i]; - } - } else { - $ARGV[$i] =~ /(?<=-o)(.*)/i; - $Outfile = $1; - } - next; - } - # Font - if ( $ARGV[$i] =~ /^-f/i ) { - if ( $ARGV[$i] =~ /^-f$/i ) { - $i++; - if ( $i < scalar @ARGV ) { - $Font = $ARGV[$i]; - } - } else { - $ARGV[$i] =~ /(?<=-f)(.*)/i; - $Font = $1; - } - next; - } - # Font size - if ( $ARGV[$i] =~ /^-s/i ) { - if ( $ARGV[$i] =~ /^-s$/i ) { - $i++; - if ( $i < scalar @ARGV ) { - $FontSize = $ARGV[$i]; - } - } else { - $ARGV[$i] =~ /(?<=-s)(.*)/i; - $FontSize = $1; - } - next; - } - if ( $ARGV[$i] =~ /^-esc/i ) { - $escape = 1; - } - - $Infile = $ARGV[$i]; - next; -}} - -unless ( $Outfile and $Font and $FontSize and $Infile ) { - die "Usage: $0 -o [-f -s -escape]\n\n"; -} - -open( INFILE, $Infile ) or die "\nError: Couldn't open INPUT file $Infile $!"; -open( OUTFILE, ">$Outfile" ) or die "\nError: Couldn't open OUTPUT file $Outfile $!"; - -print "Generating $Outfile...\n"; - -print OUTFILE "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl(\\f0\\fnil\\fcharset0 $Font;)}{\\colortbl\\red0\\green0\\blue0;\\red255\\green0\\blue0;\\red0\\green0\\blue191;}\\deflang1033\\horzdoc\\fromtext\\pard\\plain\\f0\\fs$FontSize"; - -while ( my $line = ) { - - # kill line endings (Cygin perl has problems with chomp) - $line =~ s/[\r\n]//gm; - - $line = "$line\\par"; - - # if a paragraph starts with " - " treat it as a bulleted paragraph - if ($line =~ /^\s-\s/) { - $line =~ s/^\s-\s//; - $line = "\\pard{\\*\\pn\\pnlvlblt\\pnindent0{\\pntxtb\\\'B7}}\\fi-144\\li144 $line\\pard"; - } - - # highlight URLs - $line =~ s/(http:\/\/[\w~\/\.\-]*)/\\cf2 $1\\cf0/g; - - # if a paragraph starts with "DISCLAIMER:" make the text bold and red - if ($line =~ /^DISCLAIMER/) { - $line = "\\cf1\\b $line\\b0\\cf0"; - } - - # if a paragraph starts with a quote make the text italic - if ($line =~ /^\"/) { - $line = "\\i $line\\i0"; - } - - if ($escape) { - # Escape quotes and backslashes - $line =~ s/([\"\\])/\$1/g; - } - - print OUTFILE "$line "; -} - -print OUTFILE "}"; - -close( OUTFILE ); -close( INFILE ); diff --git a/jan/src/dep/scripts/neo_sprite_func.pl b/jan/src/dep/scripts/neo_sprite_func.pl deleted file mode 100644 index 0b4679f1d..000000000 --- a/jan/src/dep/scripts/neo_sprite_func.pl +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -my $OutfileFun; -my $OutfileTab; - -# Process command line arguments -if ( $ARGV[0] =~ /^-o/i ) { - if ( $ARGV[0] =~ /^-o$/i ) { - $OutfileFun = $ARGV[1]; - } else { - $ARGV[0] =~ /(?<=-o)(.*)/i; - $OutfileFun = $1; - } -} - -unless ( $OutfileFun ) { - die "Usage: $0 -o \n\n"; -} - -$OutfileTab = $OutfileFun; -$OutfileTab =~ s/(\.\w+)/_table$1/; - -open( OUTFILEFUN, ">$OutfileFun" ) or die "\nError: Couldn't open OUTPUT file $OutfileFun: $!"; -open( OUTFILETAB, ">$OutfileTab" ) or die "\nError: Couldn't open OUTPUT file $OutfileTab: $!"; - -print "Generating $OutfileFun & $OutfileTab...\n"; - -# Generate optimized functions and a table with the function names - -print OUTFILETAB "// Table with all function addresses.\n"; -print OUTFILETAB "static RenderBankFunction RenderBankFunctionTable[] = {\n"; - -print OUTFILEFUN "#define ISOPAQUE 0\n\n"; - -for ( my $Bitdepth = 16; $Bitdepth <= 32; $Bitdepth += 8 ) { - print OUTFILEFUN "// " . $Bitdepth . "-bit rendering functions.\n"; - print OUTFILEFUN "#define BPP $Bitdepth\n\n"; - - my $FunctionName = "&RenderBank" . $Bitdepth; - my $DoClip; - - for ( my $Function = 0; $Function < 32; $Function++ ) { - if ( ($Function & 15) == 0 ) { - print OUTFILEFUN "#define DOCLIP " . ($Function & 16) / 16 . "\n"; - - if ( ($Function & 16) == 0 ) { - $DoClip = "_NOCLIP"; - } else { - $DoClip = "_CLIP"; - } - print OUTFILETAB "\t"; - } - - print OUTFILEFUN "#define XZOOM " . ($Function & 15) . "\n"; - print OUTFILEFUN "#include \"neo_sprite_render.h\"\n"; - print OUTFILEFUN "#undef XZOOM\n"; - - print OUTFILETAB "$FunctionName" . "_ZOOM" . ($Function & 15) . $DoClip . "_TRANS, "; - - if ( ($Function & 15) == 15 ) { - print OUTFILEFUN "#undef DOCLIP\n"; - - print OUTFILETAB "\n"; - } - - } - print OUTFILEFUN "#undef BPP\n\n"; -} -print OUTFILEFUN "#undef ISOPAQUE\n\n"; - -$OutfileTab =~ /(?:.*[\\\/])(.*)/; -print OUTFILEFUN "#include \"$1\"\n"; - -print OUTFILETAB "};\n\n"; -print OUTFILETAB "static RenderBankFunction* RenderBankNormal[3] = {\n\t&RenderBankFunctionTable[0],\n\t&RenderBankFunctionTable[32],\n\t&RenderBankFunctionTable[64]\n};\n"; - -close( OUTFILETAB ); -close( OUTFILEFUN ); - diff --git a/jan/src/dep/scripts/psikyo_tile_func.pl b/jan/src/dep/scripts/psikyo_tile_func.pl deleted file mode 100644 index dfa93d991..000000000 --- a/jan/src/dep/scripts/psikyo_tile_func.pl +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -my $OutfileFun; -my $OutfileTab; - -# Process command line arguments -if ( $ARGV[0] =~ /^-o/i ) { - if ( $ARGV[0] =~ /^-o$/i ) { - $OutfileFun = $ARGV[1]; - } else { - $ARGV[0] =~ /(?<=-o)(.*)/i; - $OutfileFun = $1; - } -} - -unless ( $OutfileFun ) { - die "Usage: $0 -o \n\n"; -} - -$OutfileTab = $OutfileFun; -$OutfileTab =~ s/(\.\w+)/_table$1/; - -open( OUTFILEFUN, ">$OutfileFun" ) or die "\nError: Couldn't open OUTPUT file $OutfileFun: $!"; -open( OUTFILETAB, ">$OutfileTab" ) or die "\nError: Couldn't open OUTPUT file $OutfileTab: $!"; - -print "Generating $OutfileFun & $OutfileTab...\n"; - -# Generate optimized functions and a table with the function names - -my @TransFun = ( 0, 15, -1 ); -my @TransTab = ( "_TRANS0", "_TRANS15", "_SOLID" ); - -my $RowScroll; -my $Clip; - -print OUTFILEFUN "#define ROT 0\n"; -print OUTFILEFUN "#define BPP 16\n"; -print OUTFILEFUN "#define FLIP 0\n"; -print OUTFILEFUN "#define ZOOM 0\n"; -print OUTFILEFUN "#define ZBUFFER 0\n"; -print OUTFILEFUN "\n"; - -print OUTFILETAB "// Table with all function addresses.\n"; -print OUTFILETAB "static RenderTileFunction RenderTile[] = {\n"; - -for ( my $Function = 0; $Function < 6; $Function++ ) { - my $FunctionName = "&RenderTile16" . $TransTab[($Function & 6) / 2] . "_NOFLIP_ROT0"; - - if ( ($Function & 1) == 0 ) { - $RowScroll = "_NOROWSCROLL"; - print OUTFILEFUN "#define TRANS " . $TransFun[($Function & 6) / 2] . "\n\n"; - } else { - $RowScroll = "_ROWSCROLL"; - } - - print OUTFILEFUN "#define ROWSCROLL " . (($Function & 1) / 1) . "\n"; - print OUTFILETAB "\t"; - - print OUTFILEFUN "#define DOCLIP 0\n"; - print OUTFILEFUN "#include \"psikyo_render.h\"\n"; - print OUTFILEFUN "#undef DOCLIP\n"; - - print OUTFILETAB $FunctionName . $RowScroll . "_NOZOOM_NOZBUFFER_NOCLIP, "; - - print OUTFILEFUN "#define DOCLIP 1\n"; - print OUTFILEFUN "#include \"psikyo_render.h\"\n"; - print OUTFILEFUN "#undef DOCLIP\n"; - - print OUTFILETAB $FunctionName . $RowScroll . "_NOZOOM_NOZBUFFER_CLIP, "; - - print OUTFILEFUN "#undef ROWSCROLL\n"; - if ( ($Function & 1) == 1 ) { - print OUTFILEFUN "\n#undef TRANS\n"; - } - - print OUTFILETAB "\n"; -} - -print OUTFILEFUN "#undef ZBUFFER\n"; -print OUTFILEFUN "#undef ZOOM\n"; -print OUTFILEFUN "#undef FLIP\n"; -print OUTFILEFUN "#undef BPP\n"; -print OUTFILEFUN "#undef ROT\n"; -print OUTFILEFUN "\n"; - -print OUTFILETAB "};\n\n"; - -$OutfileTab =~ /(?:.*[\\\/])(.*)/; -print OUTFILEFUN "#include \"$1\"\n"; - -close( OUTFILETAB ); -close( OUTFILEFUN ); - diff --git a/jan/src/dep/scripts/toa_gp9001_func.pl b/jan/src/dep/scripts/toa_gp9001_func.pl deleted file mode 100644 index ff0f2a476..000000000 --- a/jan/src/dep/scripts/toa_gp9001_func.pl +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -my $OutfileFun; -my $OutfileTab; - -# Process command line arguments -if ( $ARGV[0] =~ /^-o/i ) { - if ( $ARGV[0] =~ /^-o$/i ) { - $OutfileFun = $ARGV[1]; - } else { - $ARGV[0] =~ /(?<=-o)(.*)/i; - $OutfileFun = $1; - } -} - -unless ( $OutfileFun ) { - die "Usage: $0 -o \n\n"; -} - -$OutfileTab = $OutfileFun; -$OutfileTab =~ s/(\.\w+)/_table$1/; - -open( OUTFILEFUN, ">$OutfileFun" ) or die "\nError: Couldn't open OUTPUT file $OutfileFun: $!"; -open( OUTFILETAB, ">$OutfileTab" ) or die "\nError: Couldn't open OUTPUT file $OutfileTab: $!"; - -print "Generating $OutfileFun & $OutfileTab...\n"; - -# Generate optimized functions and a table with the function names - -print OUTFILETAB "// Table with all function addresses.\n"; -print OUTFILETAB "static RenderTileFunction RenderTileFunctionTable[] = {\n"; - -for ( my $Rot = 0; $Rot <= 270; $Rot += 270) { - my @Flip = ( "_NOFLIP", "_FLIPX", "_FLIPY", "_FLIPXY" ); - my $IsOpaque; - - if ( $Rot == 270 ) { - print OUTFILEFUN "#ifdef DRIVER_ROTATION\n"; - - print OUTFILETAB "#ifdef DRIVER_ROTATION\n"; - } - - print OUTFILEFUN "#define ROT $Rot\n\n"; - for ( my $Bitdepth = 16; $Bitdepth <= 32; $Bitdepth += 8 ) { - print OUTFILEFUN "// " . $Bitdepth . "-bit rendering functions.\n"; - print OUTFILEFUN "#define BPP $Bitdepth\n\n"; - - my $FunctionName = "&RenderTile" . $Bitdepth . "_ROT" . "$Rot"; - - for ( my $Function = 0; $Function < 8; $Function++ ) { - if ( ($Function & 3) == 0 ) { - print OUTFILEFUN "#define ISOPAQUE " . ($Function & 4) / 4 . "\n"; - - print OUTFILETAB "\t"; - - if ( ($Function & 4) == 0 ) { - $IsOpaque = "_TRANS"; - } else { - $IsOpaque = "_OPAQUE"; - } - } - print OUTFILEFUN "#define XFLIP " . ($Function & 1) . "\n"; - print OUTFILEFUN "#define YFLIP " . ($Function & 2) / 2 . "\n"; - - print OUTFILEFUN "#define DOCLIP 0\n"; - print OUTFILEFUN "#include \"toa_gp9001_render.h\"\n"; - print OUTFILEFUN "#undef DOCLIP\n"; - - print OUTFILETAB $FunctionName . $Flip[$Function & 3] . "_NOCLIP" . $IsOpaque . ", "; - - print OUTFILEFUN "#define DOCLIP 1\n"; - print OUTFILEFUN "#include \"toa_gp9001_render.h\"\n"; - print OUTFILEFUN "#undef DOCLIP\n"; - - print OUTFILETAB $FunctionName . $Flip[$Function & 3] . "_CLIP" . $IsOpaque . ", "; - - print OUTFILEFUN "#undef YFLIP\n"; - print OUTFILEFUN "#undef XFLIP\n\n"; - - if ( ($Function & 3) == 3 ) { - print OUTFILEFUN "#undef ISOPAQUE\n\n"; - - print OUTFILETAB "\n"; - } - } - print OUTFILEFUN "#undef BPP\n\n"; - } - print OUTFILEFUN "#undef ROT\n\n"; - - if ( $Rot == 270 ) { - print OUTFILEFUN "#endif\n"; - - print OUTFILETAB "#endif\n"; - } -} - -print OUTFILEFUN "\n"; - -print OUTFILETAB "};\n\n"; - -$OutfileTab =~ /(?:.*[\\\/])(.*)/; -print OUTFILEFUN "#include \"$1\"\n"; - -print OUTFILETAB "static RenderTileFunction* RenderTile_ROT0[3] = {\n\t&RenderTileFunctionTable[0],\n\t&RenderTileFunctionTable[16],\n\t&RenderTileFunctionTable[32]\n};\n"; -print OUTFILETAB "#ifdef DRIVER_ROTATION\n"; -print OUTFILETAB "static RenderTileFunction* RenderTile_ROT270[3] = {\n\t&RenderTileFunctionTable[48],\n\t&RenderTileFunctionTable[64],\n\t&RenderTileFunctionTable[80]\n};\n"; -print OUTFILETAB "#endif\n"; - -close( OUTFILETAB ); -close( OUTFILEFUN ); - diff --git a/jan/src/dep/vc/include/afxres.h b/jan/src/dep/vc/include/afxres.h deleted file mode 100644 index c867a1b80..000000000 --- a/jan/src/dep/vc/include/afxres.h +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include - -#ifndef IDC_STATIC - #define IDC_STATIC (-1) -#endif diff --git a/jan/src/dep/vc/include/d3d.h b/jan/src/dep/vc/include/d3d.h deleted file mode 100644 index 1cb8a966a..000000000 --- a/jan/src/dep/vc/include/d3d.h +++ /dev/null @@ -1,1688 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d.h - * Content: Direct3D include file - * - ****************************************************************************/ - -#ifndef _D3D_H_ -#define _D3D_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0700 -#endif - -// include this file content only if compiling for <=DX7 interfaces -#if(DIRECT3D_VERSION < 0x0800) - - -#include - -#define COM_NO_WINDOWS_H -#include - -#define D3DAPI WINAPI - -/* - * Interface IID's - */ -#if defined( _WIN32 ) && !defined( _NO_COM) -DEFINE_GUID( IID_IDirect3D, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3D2, 0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a); -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3D3, 0xbb223240,0xe72b,0x11d0,0xa9,0xb4,0x00,0xaa,0x00,0xc0,0x99,0x3e); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -DEFINE_GUID( IID_IDirect3D7, 0xf5049e77,0x4861,0x11d2,0xa4,0x7,0x0,0xa0,0xc9,0x6,0x29,0xa8); -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DRampDevice, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirect3DRGBDevice, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirect3DHALDevice, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -DEFINE_GUID( IID_IDirect3DMMXDevice, 0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 ); -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DRefDevice, 0x50936643, 0x13e9, 0x11d1, 0x89, 0xaa, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -DEFINE_GUID( IID_IDirect3DNullDevice, 0x8767df22, 0xbacc, 0x11d1, 0x89, 0x69, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -DEFINE_GUID( IID_IDirect3DTnLHalDevice, 0xf5049e78, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* - * Internal Guid to distinguish requested MMX from MMX being used as an RGB rasterizer - */ - -DEFINE_GUID( IID_IDirect3DDevice, 0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DDevice2, 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DDevice3, 0xb0ab3b60, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -DEFINE_GUID( IID_IDirect3DDevice7, 0xf5049e79, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DTexture2, 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -DEFINE_GUID( IID_IDirect3DLight, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); - -DEFINE_GUID( IID_IDirect3DMaterial, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DMaterial2, 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DMaterial3, 0xca9c46f4, 0xd3c5, 0x11d1, 0xb7, 0x5a, 0x0, 0x60, 0x8, 0x52, 0xb3, 0x12); -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -DEFINE_GUID( IID_IDirect3DViewport, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DViewport2, 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DViewport3, 0xb0ab3b61, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DVertexBuffer, 0x7a503555, 0x4a83, 0x11d1, 0xa5, 0xdb, 0x0, 0xa0, 0xc9, 0x3, 0x67, 0xf8); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -DEFINE_GUID( IID_IDirect3DVertexBuffer7, 0xf5049e7d, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#endif - -#ifdef __cplusplus -struct IDirect3D; -struct IDirect3DDevice; -struct IDirect3DLight; -struct IDirect3DMaterial; -struct IDirect3DExecuteBuffer; -struct IDirect3DTexture; -struct IDirect3DViewport; -typedef struct IDirect3D *LPDIRECT3D; -typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; -typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; -typedef struct IDirect3DLight *LPDIRECT3DLIGHT; -typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; -typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; -typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; - -#if(DIRECT3D_VERSION >= 0x0500) -struct IDirect3D2; -struct IDirect3DDevice2; -struct IDirect3DMaterial2; -struct IDirect3DTexture2; -struct IDirect3DViewport2; -typedef struct IDirect3D2 *LPDIRECT3D2; -typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; -typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; -typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; -typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -struct IDirect3D3; -struct IDirect3DDevice3; -struct IDirect3DMaterial3; -struct IDirect3DViewport3; -struct IDirect3DVertexBuffer; -typedef struct IDirect3D3 *LPDIRECT3D3; -typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3; -typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3; -typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3; -typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER; -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -struct IDirect3D7; -struct IDirect3DDevice7; -struct IDirect3DVertexBuffer7; -typedef struct IDirect3D7 *LPDIRECT3D7; -typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7; -typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#else - -typedef struct IDirect3D *LPDIRECT3D; -typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; -typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; -typedef struct IDirect3DLight *LPDIRECT3DLIGHT; -typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; -typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; -typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; - -#if(DIRECT3D_VERSION >= 0x0500) -typedef struct IDirect3D2 *LPDIRECT3D2; -typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; -typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; -typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; -typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -typedef struct IDirect3D3 *LPDIRECT3D3; -typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3; -typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3; -typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3; -typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER; -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -typedef struct IDirect3D7 *LPDIRECT3D7; -typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7; -typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#endif - -#include "d3dtypes.h" -#include "d3dcaps.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Direct3D interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3D - -DECLARE_INTERFACE_(IDirect3D, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D methods ***/ - STDMETHOD(Initialize)(THIS_ REFCLSID) PURE; - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE; - STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,IUnknown*) PURE; - STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL*,IUnknown*) PURE; - STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT*,IUnknown*) PURE; - STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE; -}; - -typedef struct IDirect3D *LPDIRECT3D; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) -#define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) -#define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) -#define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) -#define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) -#else -#define IDirect3D_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D_AddRef(p) (p)->AddRef() -#define IDirect3D_Release(p) (p)->Release() -#define IDirect3D_Initialize(p,a) (p)->Initialize(a) -#define IDirect3D_EnumDevices(p,a,b) (p)->EnumDevices(a,b) -#define IDirect3D_CreateLight(p,a,b) (p)->CreateLight(a,b) -#define IDirect3D_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) -#define IDirect3D_CreateViewport(p,a,b) (p)->CreateViewport(a,b) -#define IDirect3D_FindDevice(p,a,b) (p)->FindDevice(a,b) -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3D2 - -DECLARE_INTERFACE_(IDirect3D2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D2 methods ***/ - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE; - STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,IUnknown*) PURE; - STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL2*,IUnknown*) PURE; - STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT2*,IUnknown*) PURE; - STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE; - STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE,LPDIRECT3DDEVICE2*) PURE; -}; - -typedef struct IDirect3D2 *LPDIRECT3D2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D2_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) -#define IDirect3D2_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) -#define IDirect3D2_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) -#define IDirect3D2_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) -#define IDirect3D2_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) -#define IDirect3D2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#else -#define IDirect3D2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D2_AddRef(p) (p)->AddRef() -#define IDirect3D2_Release(p) (p)->Release() -#define IDirect3D2_EnumDevices(p,a,b) (p)->EnumDevices(a,b) -#define IDirect3D2_CreateLight(p,a,b) (p)->CreateLight(a,b) -#define IDirect3D2_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) -#define IDirect3D2_CreateViewport(p,a,b) (p)->CreateViewport(a,b) -#define IDirect3D2_FindDevice(p,a,b) (p)->FindDevice(a,b) -#define IDirect3D2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#undef INTERFACE -#define INTERFACE IDirect3D3 - -DECLARE_INTERFACE_(IDirect3D3, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D3 methods ***/ - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE; - STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,LPUNKNOWN) PURE; - STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL3*,LPUNKNOWN) PURE; - STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT3*,LPUNKNOWN) PURE; - STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE; - STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE4,LPDIRECT3DDEVICE3*,LPUNKNOWN) PURE; - STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC,LPDIRECT3DVERTEXBUFFER*,DWORD,LPUNKNOWN) PURE; - STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(EvictManagedTextures)(THIS) PURE; -}; - -typedef struct IDirect3D3 *LPDIRECT3D3; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D3_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D3_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) -#define IDirect3D3_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) -#define IDirect3D3_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) -#define IDirect3D3_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) -#define IDirect3D3_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) -#define IDirect3D3_CreateDevice(p,a,b,c,d) (p)->lpVtbl->CreateDevice(p,a,b,c,d) -#define IDirect3D3_CreateVertexBuffer(p,a,b,c,d) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d) -#define IDirect3D3_EnumZBufferFormats(p,a,b,c) (p)->lpVtbl->EnumZBufferFormats(p,a,b,c) -#define IDirect3D3_EvictManagedTextures(p) (p)->lpVtbl->EvictManagedTextures(p) -#else -#define IDirect3D3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D3_AddRef(p) (p)->AddRef() -#define IDirect3D3_Release(p) (p)->Release() -#define IDirect3D3_EnumDevices(p,a,b) (p)->EnumDevices(a,b) -#define IDirect3D3_CreateLight(p,a,b) (p)->CreateLight(a,b) -#define IDirect3D3_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) -#define IDirect3D3_CreateViewport(p,a,b) (p)->CreateViewport(a,b) -#define IDirect3D3_FindDevice(p,a,b) (p)->FindDevice(a,b) -#define IDirect3D3_CreateDevice(p,a,b,c,d) (p)->CreateDevice(a,b,c,d) -#define IDirect3D3_CreateVertexBuffer(p,a,b,c,d) (p)->CreateVertexBuffer(a,b,c,d) -#define IDirect3D3_EnumZBufferFormats(p,a,b,c) (p)->EnumZBufferFormats(a,b,c) -#define IDirect3D3_EvictManagedTextures(p) (p)->EvictManagedTextures() -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -#undef INTERFACE -#define INTERFACE IDirect3D7 - -DECLARE_INTERFACE_(IDirect3D7, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D7 methods ***/ - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK7,LPVOID) PURE; - STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE7,LPDIRECT3DDEVICE7*) PURE; - STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC,LPDIRECT3DVERTEXBUFFER7*,DWORD) PURE; - STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(EvictManagedTextures)(THIS) PURE; -}; - -typedef struct IDirect3D7 *LPDIRECT3D7; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D7_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D7_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) -#define IDirect3D7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IDirect3D7_CreateVertexBuffer(p,a,b,c) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c) -#define IDirect3D7_EnumZBufferFormats(p,a,b,c) (p)->lpVtbl->EnumZBufferFormats(p,a,b,c) -#define IDirect3D7_EvictManagedTextures(p) (p)->lpVtbl->EvictManagedTextures(p) -#else -#define IDirect3D7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D7_AddRef(p) (p)->AddRef() -#define IDirect3D7_Release(p) (p)->Release() -#define IDirect3D7_EnumDevices(p,a,b) (p)->EnumDevices(a,b) -#define IDirect3D7_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#define IDirect3D7_CreateVertexBuffer(p,a,b,c) (p)->CreateVertexBuffer(a,b,c) -#define IDirect3D7_EnumZBufferFormats(p,a,b,c) (p)->EnumZBufferFormats(a,b,c) -#define IDirect3D7_EvictManagedTextures(p) (p)->EvictManagedTextures() -#endif -#endif /* DIRECT3D_VERSION >= 0x0700 */ -/* - * Direct3D Device interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DDevice - -DECLARE_INTERFACE_(IDirect3DDevice, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D,LPGUID,LPD3DDEVICEDESC) PURE; - STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE; - STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE,LPDIRECT3DTEXTURE) PURE; - STDMETHOD(CreateExecuteBuffer)(THIS_ LPD3DEXECUTEBUFFERDESC,LPDIRECT3DEXECUTEBUFFER*,IUnknown*) PURE; - STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE; - STDMETHOD(Execute)(THIS_ LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD) PURE; - STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT) PURE; - STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT) PURE; - STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT,LPDIRECT3DVIEWPORT*,DWORD) PURE; - STDMETHOD(Pick)(THIS_ LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD,LPD3DRECT) PURE; - STDMETHOD(GetPickRecords)(THIS_ LPDWORD,LPD3DPICKRECORD) PURE; - STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(CreateMatrix)(THIS_ LPD3DMATRIXHANDLE) PURE; - STDMETHOD(SetMatrix)(THIS_ D3DMATRIXHANDLE,const LPD3DMATRIX) PURE; - STDMETHOD(GetMatrix)(THIS_ D3DMATRIXHANDLE,LPD3DMATRIX) PURE; - STDMETHOD(DeleteMatrix)(THIS_ D3DMATRIXHANDLE) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D*) PURE; -}; - -typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IDirect3DDevice_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirect3DDevice_SwapTextureHandles(p,a,b) (p)->lpVtbl->SwapTextureHandles(p,a,b) -#define IDirect3DDevice_CreateExecuteBuffer(p,a,b,c) (p)->lpVtbl->CreateExecuteBuffer(p,a,b,c) -#define IDirect3DDevice_GetStats(p,a) (p)->lpVtbl->GetStats(p,a) -#define IDirect3DDevice_Execute(p,a,b,c) (p)->lpVtbl->Execute(p,a,b,c) -#define IDirect3DDevice_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a) -#define IDirect3DDevice_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a) -#define IDirect3DDevice_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c) -#define IDirect3DDevice_Pick(p,a,b,c,d) (p)->lpVtbl->Pick(p,a,b,c,d) -#define IDirect3DDevice_GetPickRecords(p,a,b) (p)->lpVtbl->GetPickRecords(p,a,b) -#define IDirect3DDevice_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) -#define IDirect3DDevice_CreateMatrix(p,a) (p)->lpVtbl->CreateMatrix(p,a) -#define IDirect3DDevice_SetMatrix(p,a,b) (p)->lpVtbl->SetMatrix(p,a,b) -#define IDirect3DDevice_GetMatrix(p,a,b) (p)->lpVtbl->GetMatrix(p,a,b) -#define IDirect3DDevice_DeleteMatrix(p,a) (p)->lpVtbl->DeleteMatrix(p,a) -#define IDirect3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#else -#define IDirect3DDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice_AddRef(p) (p)->AddRef() -#define IDirect3DDevice_Release(p) (p)->Release() -#define IDirect3DDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#define IDirect3DDevice_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirect3DDevice_SwapTextureHandles(p,a,b) (p)->SwapTextureHandles(a,b) -#define IDirect3DDevice_CreateExecuteBuffer(p,a,b,c) (p)->CreateExecuteBuffer(a,b,c) -#define IDirect3DDevice_GetStats(p,a) (p)->GetStats(a) -#define IDirect3DDevice_Execute(p,a,b,c) (p)->Execute(a,b,c) -#define IDirect3DDevice_AddViewport(p,a) (p)->AddViewport(a) -#define IDirect3DDevice_DeleteViewport(p,a) (p)->DeleteViewport(a) -#define IDirect3DDevice_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c) -#define IDirect3DDevice_Pick(p,a,b,c,d) (p)->Pick(a,b,c,d) -#define IDirect3DDevice_GetPickRecords(p,a,b) (p)->GetPickRecords(a,b) -#define IDirect3DDevice_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) -#define IDirect3DDevice_CreateMatrix(p,a) (p)->CreateMatrix(a) -#define IDirect3DDevice_SetMatrix(p,a,b) (p)->SetMatrix(a,b) -#define IDirect3DDevice_GetMatrix(p,a,b) (p)->GetMatrix(a,b) -#define IDirect3DDevice_DeleteMatrix(p,a) (p)->DeleteMatrix(a) -#define IDirect3DDevice_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice_EndScene(p) (p)->EndScene() -#define IDirect3DDevice_GetDirect3D(p,a) (p)->GetDirect3D(a) -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3DDevice2 - -DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice2 methods ***/ - STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE; - STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE2,LPDIRECT3DTEXTURE2) PURE; - STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE; - STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE; - STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE; - STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT2,LPDIRECT3DVIEWPORT2*,DWORD) PURE; - STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D2*) PURE; - STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE; - STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2 *) PURE; - STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE,DWORD) PURE; - STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE *) PURE; - STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,DWORD) PURE; - STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(Vertex)(THIS_ LPVOID) PURE; - STDMETHOD(Index)(THIS_ WORD) PURE; - STDMETHOD(End)(THIS_ DWORD) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE; - STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE,LPDWORD) PURE; - STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE,DWORD) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; -}; - -typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice2_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirect3DDevice2_SwapTextureHandles(p,a,b) (p)->lpVtbl->SwapTextureHandles(p,a,b) -#define IDirect3DDevice2_GetStats(p,a) (p)->lpVtbl->GetStats(p,a) -#define IDirect3DDevice2_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a) -#define IDirect3DDevice2_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a) -#define IDirect3DDevice2_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c) -#define IDirect3DDevice2_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) -#define IDirect3DDevice2_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice2_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice2_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice2_SetCurrentViewport(p,a) (p)->lpVtbl->SetCurrentViewport(p,a) -#define IDirect3DDevice2_GetCurrentViewport(p,a) (p)->lpVtbl->GetCurrentViewport(p,a) -#define IDirect3DDevice2_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice2_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) -#define IDirect3DDevice2_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c) -#define IDirect3DDevice2_BeginIndexed(p,a,b,c,d,e) (p)->lpVtbl->BeginIndexed(p,a,b,c,d,e) -#define IDirect3DDevice2_Vertex(p,a) (p)->lpVtbl->Vertex(p,a) -#define IDirect3DDevice2_Index(p,a) (p)->lpVtbl->Index(p,a) -#define IDirect3DDevice2_End(p,a) (p)->lpVtbl->End(p,a) -#define IDirect3DDevice2_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice2_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice2_GetLightState(p,a,b) (p)->lpVtbl->GetLightState(p,a,b) -#define IDirect3DDevice2_SetLightState(p,a,b) (p)->lpVtbl->SetLightState(p,a,b) -#define IDirect3DDevice2_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice2_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice2_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice2_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e) -#define IDirect3DDevice2_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g) -#define IDirect3DDevice2_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice2_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#else -#define IDirect3DDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice2_AddRef(p) (p)->AddRef() -#define IDirect3DDevice2_Release(p) (p)->Release() -#define IDirect3DDevice2_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirect3DDevice2_SwapTextureHandles(p,a,b) (p)->SwapTextureHandles(a,b) -#define IDirect3DDevice2_GetStats(p,a) (p)->GetStats(a) -#define IDirect3DDevice2_AddViewport(p,a) (p)->AddViewport(a) -#define IDirect3DDevice2_DeleteViewport(p,a) (p)->DeleteViewport(a) -#define IDirect3DDevice2_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c) -#define IDirect3DDevice2_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) -#define IDirect3DDevice2_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice2_EndScene(p) (p)->EndScene() -#define IDirect3DDevice2_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice2_SetCurrentViewport(p,a) (p)->SetCurrentViewport(a) -#define IDirect3DDevice2_GetCurrentViewport(p,a) (p)->GetCurrentViewport(a) -#define IDirect3DDevice2_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice2_GetRenderTarget(p,a) (p)->GetRenderTarget(a) -#define IDirect3DDevice2_Begin(p,a,b,c) (p)->Begin(a,b,c) -#define IDirect3DDevice2_BeginIndexed(p,a,b,c,d,e) (p)->BeginIndexed(a,b,c,d,e) -#define IDirect3DDevice2_Vertex(p,a) (p)->Vertex(a) -#define IDirect3DDevice2_Index(p,a) (p)->Index(a) -#define IDirect3DDevice2_End(p,a) (p)->End(a) -#define IDirect3DDevice2_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice2_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice2_GetLightState(p,a,b) (p)->GetLightState(a,b) -#define IDirect3DDevice2_SetLightState(p,a,b) (p)->SetLightState(a,b) -#define IDirect3DDevice2_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice2_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice2_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice2_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e) -#define IDirect3DDevice2_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g) -#define IDirect3DDevice2_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice2_GetClipStatus(p,a) (p)->GetClipStatus(a) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#undef INTERFACE -#define INTERFACE IDirect3DDevice3 - -DECLARE_INTERFACE_(IDirect3DDevice3, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice3 methods ***/ - STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE; - STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE; - STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE; - STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE; - STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT3,LPDIRECT3DVIEWPORT3*,DWORD) PURE; - STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D3*) PURE; - STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE; - STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3 *) PURE; - STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4,DWORD) PURE; - STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4 *) PURE; - STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE,DWORD,DWORD) PURE; - STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(Vertex)(THIS_ LPVOID) PURE; - STDMETHOD(Index)(THIS_ WORD) PURE; - STDMETHOD(End)(THIS_ DWORD) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE; - STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE,LPDWORD) PURE; - STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE,DWORD) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,DWORD,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD) PURE; - STDMETHOD(GetTexture)(THIS_ DWORD,LPDIRECT3DTEXTURE2 *) PURE; - STDMETHOD(SetTexture)(THIS_ DWORD,LPDIRECT3DTEXTURE2) PURE; - STDMETHOD(GetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD) PURE; - STDMETHOD(SetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,DWORD) PURE; - STDMETHOD(ValidateDevice)(THIS_ LPDWORD) PURE; -}; - -typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice3_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirect3DDevice3_GetStats(p,a) (p)->lpVtbl->GetStats(p,a) -#define IDirect3DDevice3_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a) -#define IDirect3DDevice3_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a) -#define IDirect3DDevice3_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c) -#define IDirect3DDevice3_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) -#define IDirect3DDevice3_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice3_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice3_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice3_SetCurrentViewport(p,a) (p)->lpVtbl->SetCurrentViewport(p,a) -#define IDirect3DDevice3_GetCurrentViewport(p,a) (p)->lpVtbl->GetCurrentViewport(p,a) -#define IDirect3DDevice3_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice3_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) -#define IDirect3DDevice3_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c) -#define IDirect3DDevice3_BeginIndexed(p,a,b,c,d,e) (p)->lpVtbl->BeginIndexed(p,a,b,c,d,e) -#define IDirect3DDevice3_Vertex(p,a) (p)->lpVtbl->Vertex(p,a) -#define IDirect3DDevice3_Index(p,a) (p)->lpVtbl->Index(p,a) -#define IDirect3DDevice3_End(p,a) (p)->lpVtbl->End(p,a) -#define IDirect3DDevice3_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice3_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice3_GetLightState(p,a,b) (p)->lpVtbl->GetLightState(p,a,b) -#define IDirect3DDevice3_SetLightState(p,a,b) (p)->lpVtbl->SetLightState(p,a,b) -#define IDirect3DDevice3_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice3_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice3_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice3_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g) -#define IDirect3DDevice3_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice3_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#define IDirect3DDevice3_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveStrided(p,a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) -#define IDirect3DDevice3_DrawPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveVB(p,a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawIndexedPrimitiveVB(p,a,b,c,d,e) -#define IDirect3DDevice3_ComputeSphereVisibility(p,a,b,c,d,e) (p)->lpVtbl->ComputeSphereVisibility(p,a,b,c,d,e) -#define IDirect3DDevice3_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) -#define IDirect3DDevice3_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) -#define IDirect3DDevice3_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) -#define IDirect3DDevice3_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) -#define IDirect3DDevice3_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) -#else -#define IDirect3DDevice3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice3_AddRef(p) (p)->AddRef() -#define IDirect3DDevice3_Release(p) (p)->Release() -#define IDirect3DDevice3_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirect3DDevice3_GetStats(p,a) (p)->GetStats(a) -#define IDirect3DDevice3_AddViewport(p,a) (p)->AddViewport(a) -#define IDirect3DDevice3_DeleteViewport(p,a) (p)->DeleteViewport(a) -#define IDirect3DDevice3_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c) -#define IDirect3DDevice3_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) -#define IDirect3DDevice3_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice3_EndScene(p) (p)->EndScene() -#define IDirect3DDevice3_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice3_SetCurrentViewport(p,a) (p)->SetCurrentViewport(a) -#define IDirect3DDevice3_GetCurrentViewport(p,a) (p)->GetCurrentViewport(a) -#define IDirect3DDevice3_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice3_GetRenderTarget(p,a) (p)->GetRenderTarget(a) -#define IDirect3DDevice3_Begin(p,a,b,c) (p)->Begin(a,b,c) -#define IDirect3DDevice3_BeginIndexed(p,a,b,c,d,e) (p)->BeginIndexed(a,b,c,d,e) -#define IDirect3DDevice3_Vertex(p,a) (p)->Vertex(a) -#define IDirect3DDevice3_Index(p,a) (p)->Index(a) -#define IDirect3DDevice3_End(p,a) (p)->End(a) -#define IDirect3DDevice3_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice3_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice3_GetLightState(p,a,b) (p)->GetLightState(a,b) -#define IDirect3DDevice3_SetLightState(p,a,b) (p)->SetLightState(a,b) -#define IDirect3DDevice3_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice3_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice3_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice3_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g) -#define IDirect3DDevice3_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice3_GetClipStatus(p,a) (p)->GetClipStatus(a) -#define IDirect3DDevice3_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->DrawPrimitiveStrided(a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveStrided(a,b,c,d,e,f,g) -#define IDirect3DDevice3_DrawPrimitiveVB(p,a,b,c,d,e) (p)->DrawPrimitiveVB(a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitiveVB(p,a,b,c,d,e) (p)->DrawIndexedPrimitiveVB(a,b,c,d,e) -#define IDirect3DDevice3_ComputeSphereVisibility(p,a,b,c,d,e) (p)->ComputeSphereVisibility(a,b,c,d,e) -#define IDirect3DDevice3_GetTexture(p,a,b) (p)->GetTexture(a,b) -#define IDirect3DDevice3_SetTexture(p,a,b) (p)->SetTexture(a,b) -#define IDirect3DDevice3_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) -#define IDirect3DDevice3_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) -#define IDirect3DDevice3_ValidateDevice(p,a) (p)->ValidateDevice(a) -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -#undef INTERFACE -#define INTERFACE IDirect3DDevice7 - -DECLARE_INTERFACE_(IDirect3DDevice7, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice7 methods ***/ - STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC7) PURE; - STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D7*) PURE; - STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7,DWORD) PURE; - STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7 *) PURE; - STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT7) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT7) PURE; - STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL7) PURE; - STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL7) PURE; - STDMETHOD(SetLight)(THIS_ DWORD,LPD3DLIGHT7) PURE; - STDMETHOD(GetLight)(THIS_ DWORD,LPD3DLIGHT7) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE; - STDMETHOD(BeginStateBlock)(THIS) PURE; - STDMETHOD(EndStateBlock)(THIS_ LPDWORD) PURE; - STDMETHOD(PreLoad)(THIS_ LPDIRECTDRAWSURFACE7) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD) PURE; - STDMETHOD(GetTexture)(THIS_ DWORD,LPDIRECTDRAWSURFACE7 *) PURE; - STDMETHOD(SetTexture)(THIS_ DWORD,LPDIRECTDRAWSURFACE7) PURE; - STDMETHOD(GetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD) PURE; - STDMETHOD(SetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,DWORD) PURE; - STDMETHOD(ValidateDevice)(THIS_ LPDWORD) PURE; - STDMETHOD(ApplyStateBlock)(THIS_ DWORD) PURE; - STDMETHOD(CaptureStateBlock)(THIS_ DWORD) PURE; - STDMETHOD(DeleteStateBlock)(THIS_ DWORD) PURE; - STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE,LPDWORD) PURE; - STDMETHOD(Load)(THIS_ LPDIRECTDRAWSURFACE7,LPPOINT,LPDIRECTDRAWSURFACE7,LPRECT,DWORD) PURE; - STDMETHOD(LightEnable)(THIS_ DWORD,BOOL) PURE; - STDMETHOD(GetLightEnable)(THIS_ DWORD,BOOL*) PURE; - STDMETHOD(SetClipPlane)(THIS_ DWORD,D3DVALUE*) PURE; - STDMETHOD(GetClipPlane)(THIS_ DWORD,D3DVALUE*) PURE; - STDMETHOD(GetInfo)(THIS_ DWORD,LPVOID,DWORD) PURE; -}; - -typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice7_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice7_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirect3DDevice7_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) -#define IDirect3DDevice7_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice7_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice7_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice7_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice7_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) -#define IDirect3DDevice7_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) -#define IDirect3DDevice7_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice7_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice7_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DDevice7_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice7_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DDevice7_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DDevice7_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DDevice7_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) -#define IDirect3DDevice7_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) -#define IDirect3DDevice7_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice7_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice7_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) -#define IDirect3DDevice7_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) -#define IDirect3DDevice7_PreLoad(p,a) (p)->lpVtbl->PreLoad(p,a) -#define IDirect3DDevice7_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g) -#define IDirect3DDevice7_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice7_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#define IDirect3DDevice7_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveStrided(p,a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) -#define IDirect3DDevice7_DrawPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveVB(p,a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) -#define IDirect3DDevice7_ComputeSphereVisibility(p,a,b,c,d,e) (p)->lpVtbl->ComputeSphereVisibility(p,a,b,c,d,e) -#define IDirect3DDevice7_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) -#define IDirect3DDevice7_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) -#define IDirect3DDevice7_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) -#define IDirect3DDevice7_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) -#define IDirect3DDevice7_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) -#define IDirect3DDevice7_ApplyStateBlock(p,a) (p)->lpVtbl->ApplyStateBlock(p,a) -#define IDirect3DDevice7_CaptureStateBlock(p,a) (p)->lpVtbl->CaptureStateBlock(p,a) -#define IDirect3DDevice7_DeleteStateBlock(p,a) (p)->lpVtbl->DeleteStateBlock(p,a) -#define IDirect3DDevice7_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) -#define IDirect3DDevice7_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) -#define IDirect3DDevice7_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) -#define IDirect3DDevice7_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) -#define IDirect3DDevice7_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) -#define IDirect3DDevice7_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) -#define IDirect3DDevice7_GetInfo(p,a,b,c) (p)->lpVtbl->GetInfo(p,a,b,c) -#else -#define IDirect3DDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice7_AddRef(p) (p)->AddRef() -#define IDirect3DDevice7_Release(p) (p)->Release() -#define IDirect3DDevice7_GetCaps(p,a) (p)->GetCaps(a) -#define IDirect3DDevice7_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) -#define IDirect3DDevice7_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice7_EndScene(p) (p)->EndScene() -#define IDirect3DDevice7_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice7_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice7_GetRenderTarget(p,a) (p)->GetRenderTarget(a) -#define IDirect3DDevice7_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) -#define IDirect3DDevice7_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice7_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice7_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DDevice7_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice7_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DDevice7_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DDevice7_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DDevice7_SetLight(p,a,b) (p)->SetLight(a,b) -#define IDirect3DDevice7_GetLight(p,a,b) (p)->GetLight(a,b) -#define IDirect3DDevice7_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice7_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice7_BeginStateBlock(p) (p)->BeginStateBlock() -#define IDirect3DDevice7_EndStateBlock(p,a) (p)->EndStateBlock(a) -#define IDirect3DDevice7_PreLoad(p,a) (p)->PreLoad(a) -#define IDirect3DDevice7_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g) -#define IDirect3DDevice7_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice7_GetClipStatus(p,a) (p)->GetClipStatus(a) -#define IDirect3DDevice7_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->DrawPrimitiveStrided(a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveStrided(a,b,c,d,e,f,g) -#define IDirect3DDevice7_DrawPrimitiveVB(p,a,b,c,d,e) (p)->DrawPrimitiveVB(a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveVB(a,b,c,d,e,f,g) -#define IDirect3DDevice7_ComputeSphereVisibility(p,a,b,c,d,e) (p)->ComputeSphereVisibility(a,b,c,d,e) -#define IDirect3DDevice7_GetTexture(p,a,b) (p)->GetTexture(a,b) -#define IDirect3DDevice7_SetTexture(p,a,b) (p)->SetTexture(a,b) -#define IDirect3DDevice7_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) -#define IDirect3DDevice7_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) -#define IDirect3DDevice7_ValidateDevice(p,a) (p)->ValidateDevice(a) -#define IDirect3DDevice7_ApplyStateBlock(p,a) (p)->ApplyStateBlock(a) -#define IDirect3DDevice7_CaptureStateBlock(p,a) (p)->CaptureStateBlock(a) -#define IDirect3DDevice7_DeleteStateBlock(p,a) (p)->DeleteStateBlock(a) -#define IDirect3DDevice7_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) -#define IDirect3DDevice7_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) -#define IDirect3DDevice7_LightEnable(p,a,b) (p)->LightEnable(a,b) -#define IDirect3DDevice7_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) -#define IDirect3DDevice7_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) -#define IDirect3DDevice7_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) -#define IDirect3DDevice7_GetInfo(p,a,b,c) (p)->GetInfo(a,b,c) -#endif -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* - * Execute Buffer interface - */ -#undef INTERFACE -#define INTERFACE IDirect3DExecuteBuffer - -DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DExecuteBuffer methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE,LPD3DEXECUTEBUFFERDESC) PURE; - STDMETHOD(Lock)(THIS_ LPD3DEXECUTEBUFFERDESC) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(SetExecuteData)(THIS_ LPD3DEXECUTEDATA) PURE; - STDMETHOD(GetExecuteData)(THIS_ LPD3DEXECUTEDATA) PURE; - STDMETHOD(Validate)(THIS_ LPDWORD,LPD3DVALIDATECALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(Optimize)(THIS_ DWORD) PURE; -}; - -typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DExecuteBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DExecuteBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DExecuteBuffer_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DExecuteBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirect3DExecuteBuffer_Lock(p,a) (p)->lpVtbl->Lock(p,a) -#define IDirect3DExecuteBuffer_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DExecuteBuffer_SetExecuteData(p,a) (p)->lpVtbl->SetExecuteData(p,a) -#define IDirect3DExecuteBuffer_GetExecuteData(p,a) (p)->lpVtbl->GetExecuteData(p,a) -#define IDirect3DExecuteBuffer_Validate(p,a,b,c,d) (p)->lpVtbl->Validate(p,a,b,c,d) -#define IDirect3DExecuteBuffer_Optimize(p,a) (p)->lpVtbl->Optimize(p,a) -#else -#define IDirect3DExecuteBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DExecuteBuffer_AddRef(p) (p)->AddRef() -#define IDirect3DExecuteBuffer_Release(p) (p)->Release() -#define IDirect3DExecuteBuffer_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirect3DExecuteBuffer_Lock(p,a) (p)->Lock(a) -#define IDirect3DExecuteBuffer_Unlock(p) (p)->Unlock() -#define IDirect3DExecuteBuffer_SetExecuteData(p,a) (p)->SetExecuteData(a) -#define IDirect3DExecuteBuffer_GetExecuteData(p,a) (p)->GetExecuteData(a) -#define IDirect3DExecuteBuffer_Validate(p,a,b,c,d) (p)->Validate(a,b,c,d) -#define IDirect3DExecuteBuffer_Optimize(p,a) (p)->Optimize(a) -#endif - -/* - * Light interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DLight - -DECLARE_INTERFACE_(IDirect3DLight, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DLight methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(SetLight)(THIS_ LPD3DLIGHT) PURE; - STDMETHOD(GetLight)(THIS_ LPD3DLIGHT) PURE; -}; - -typedef struct IDirect3DLight *LPDIRECT3DLIGHT; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DLight_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DLight_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DLight_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DLight_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DLight_SetLight(p,a) (p)->lpVtbl->SetLight(p,a) -#define IDirect3DLight_GetLight(p,a) (p)->lpVtbl->GetLight(p,a) -#else -#define IDirect3DLight_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DLight_AddRef(p) (p)->AddRef() -#define IDirect3DLight_Release(p) (p)->Release() -#define IDirect3DLight_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DLight_SetLight(p,a) (p)->SetLight(a) -#define IDirect3DLight_GetLight(p,a) (p)->GetLight(a) -#endif - -/* - * Material interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DMaterial - -DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DMaterial methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE,LPD3DMATERIALHANDLE) PURE; - STDMETHOD(Reserve)(THIS) PURE; - STDMETHOD(Unreserve)(THIS) PURE; -}; - -typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DMaterial_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DMaterial_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DMaterial_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DMaterial_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DMaterial_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DMaterial_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DMaterial_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#define IDirect3DMaterial_Reserve(p) (p)->lpVtbl->Reserve(p) -#define IDirect3DMaterial_Unreserve(p) (p)->lpVtbl->Unreserve(p) -#else -#define IDirect3DMaterial_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DMaterial_AddRef(p) (p)->AddRef() -#define IDirect3DMaterial_Release(p) (p)->Release() -#define IDirect3DMaterial_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DMaterial_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DMaterial_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DMaterial_GetHandle(p,a,b) (p)->GetHandle(a,b) -#define IDirect3DMaterial_Reserve(p) (p)->Reserve() -#define IDirect3DMaterial_Unreserve(p) (p)->Unreserve() -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3DMaterial2 - -DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DMaterial2 methods ***/ - STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2,LPD3DMATERIALHANDLE) PURE; -}; - -typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DMaterial2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DMaterial2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DMaterial2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DMaterial2_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DMaterial2_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DMaterial2_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#else -#define IDirect3DMaterial2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DMaterial2_AddRef(p) (p)->AddRef() -#define IDirect3DMaterial2_Release(p) (p)->Release() -#define IDirect3DMaterial2_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DMaterial2_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DMaterial2_GetHandle(p,a,b) (p)->GetHandle(a,b) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#undef INTERFACE -#define INTERFACE IDirect3DMaterial3 - -DECLARE_INTERFACE_(IDirect3DMaterial3, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DMaterial3 methods ***/ - STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE3,LPD3DMATERIALHANDLE) PURE; -}; - -typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DMaterial3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DMaterial3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DMaterial3_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DMaterial3_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DMaterial3_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DMaterial3_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#else -#define IDirect3DMaterial3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DMaterial3_AddRef(p) (p)->AddRef() -#define IDirect3DMaterial3_Release(p) (p)->Release() -#define IDirect3DMaterial3_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DMaterial3_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DMaterial3_GetHandle(p,a,b) (p)->GetHandle(a,b) -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Texture interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DTexture - -DECLARE_INTERFACE_(IDirect3DTexture, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DTexture methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE,LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE,LPD3DTEXTUREHANDLE) PURE; - STDMETHOD(PaletteChanged)(THIS_ DWORD,DWORD) PURE; - STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE) PURE; - STDMETHOD(Unload)(THIS) PURE; -}; - -typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DTexture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DTexture_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DTexture_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DTexture_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirect3DTexture_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#define IDirect3DTexture_PaletteChanged(p,a,b) (p)->lpVtbl->PaletteChanged(p,a,b) -#define IDirect3DTexture_Load(p,a) (p)->lpVtbl->Load(p,a) -#define IDirect3DTexture_Unload(p) (p)->lpVtbl->Unload(p) -#else -#define IDirect3DTexture_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DTexture_AddRef(p) (p)->AddRef() -#define IDirect3DTexture_Release(p) (p)->Release() -#define IDirect3DTexture_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirect3DTexture_GetHandle(p,a,b) (p)->GetHandle(a,b) -#define IDirect3DTexture_PaletteChanged(p,a,b) (p)->PaletteChanged(a,b) -#define IDirect3DTexture_Load(p,a) (p)->Load(a) -#define IDirect3DTexture_Unload(p) (p)->Unload() -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3DTexture2 - -DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DTexture2 methods ***/ - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2,LPD3DTEXTUREHANDLE) PURE; - STDMETHOD(PaletteChanged)(THIS_ DWORD,DWORD) PURE; - STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE2) PURE; -}; - -typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DTexture2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DTexture2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DTexture2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DTexture2_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#define IDirect3DTexture2_PaletteChanged(p,a,b) (p)->lpVtbl->PaletteChanged(p,a,b) -#define IDirect3DTexture2_Load(p,a) (p)->lpVtbl->Load(p,a) -#else -#define IDirect3DTexture2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DTexture2_AddRef(p) (p)->AddRef() -#define IDirect3DTexture2_Release(p) (p)->Release() -#define IDirect3DTexture2_GetHandle(p,a,b) (p)->GetHandle(a,b) -#define IDirect3DTexture2_PaletteChanged(p,a,b) (p)->PaletteChanged(a,b) -#define IDirect3DTexture2_Load(p,a) (p)->Load(a) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -/* - * Viewport interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DViewport - -DECLARE_INTERFACE_(IDirect3DViewport, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DViewport methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE; - STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE; - STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE; - STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE; - STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE; - STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE; -}; - -typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DViewport_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DViewport_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DViewport_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DViewport_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DViewport_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DViewport_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DViewport_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d) -#define IDirect3DViewport_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b) -#define IDirect3DViewport_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a) -#define IDirect3DViewport_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b) -#define IDirect3DViewport_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a) -#define IDirect3DViewport_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b) -#define IDirect3DViewport_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c) -#define IDirect3DViewport_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) -#define IDirect3DViewport_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) -#define IDirect3DViewport_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c) -#else -#define IDirect3DViewport_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DViewport_AddRef(p) (p)->AddRef() -#define IDirect3DViewport_Release(p) (p)->Release() -#define IDirect3DViewport_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DViewport_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DViewport_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DViewport_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d) -#define IDirect3DViewport_LightElements(p,a,b) (p)->LightElements(a,b) -#define IDirect3DViewport_SetBackground(p,a) (p)->SetBackground(a) -#define IDirect3DViewport_GetBackground(p,a,b) (p)->GetBackground(a,b) -#define IDirect3DViewport_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a) -#define IDirect3DViewport_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b) -#define IDirect3DViewport_Clear(p,a,b,c) (p)->Clear(a,b,c) -#define IDirect3DViewport_AddLight(p,a) (p)->AddLight(a) -#define IDirect3DViewport_DeleteLight(p,a) (p)->DeleteLight(a) -#define IDirect3DViewport_NextLight(p,a,b,c) (p)->NextLight(a,b,c) -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3DViewport2 - -DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DViewport methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE; - STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE; - STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE; - STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE; - STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE; - STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE; - STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; - STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; -}; - -typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DViewport2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DViewport2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DViewport2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DViewport2_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DViewport2_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DViewport2_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DViewport2_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d) -#define IDirect3DViewport2_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b) -#define IDirect3DViewport2_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a) -#define IDirect3DViewport2_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b) -#define IDirect3DViewport2_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a) -#define IDirect3DViewport2_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b) -#define IDirect3DViewport2_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c) -#define IDirect3DViewport2_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) -#define IDirect3DViewport2_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) -#define IDirect3DViewport2_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c) -#define IDirect3DViewport2_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a) -#define IDirect3DViewport2_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a) -#else -#define IDirect3DViewport2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DViewport2_AddRef(p) (p)->AddRef() -#define IDirect3DViewport2_Release(p) (p)->Release() -#define IDirect3DViewport2_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DViewport2_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DViewport2_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DViewport2_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d) -#define IDirect3DViewport2_LightElements(p,a,b) (p)->LightElements(a,b) -#define IDirect3DViewport2_SetBackground(p,a) (p)->SetBackground(a) -#define IDirect3DViewport2_GetBackground(p,a,b) (p)->GetBackground(a,b) -#define IDirect3DViewport2_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a) -#define IDirect3DViewport2_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b) -#define IDirect3DViewport2_Clear(p,a,b,c) (p)->Clear(a,b,c) -#define IDirect3DViewport2_AddLight(p,a) (p)->AddLight(a) -#define IDirect3DViewport2_DeleteLight(p,a) (p)->DeleteLight(a) -#define IDirect3DViewport2_NextLight(p,a,b,c) (p)->NextLight(a,b,c) -#define IDirect3DViewport2_GetViewport2(p,a) (p)->GetViewport2(a) -#define IDirect3DViewport2_SetViewport2(p,a) (p)->SetViewport2(a) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - -#undef INTERFACE -#define INTERFACE IDirect3DViewport3 - -DECLARE_INTERFACE_(IDirect3DViewport3, IDirect3DViewport2) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DViewport2 methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE; - STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE; - STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE; - STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE; - STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE; - STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE; - STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; - STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; - STDMETHOD(SetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4) PURE; - STDMETHOD(GetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4*,LPBOOL) PURE; - STDMETHOD(Clear2)(THIS_ DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD) PURE; -}; - -typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DViewport3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DViewport3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DViewport3_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DViewport3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DViewport3_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DViewport3_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DViewport3_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d) -#define IDirect3DViewport3_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b) -#define IDirect3DViewport3_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a) -#define IDirect3DViewport3_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b) -#define IDirect3DViewport3_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a) -#define IDirect3DViewport3_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b) -#define IDirect3DViewport3_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c) -#define IDirect3DViewport3_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) -#define IDirect3DViewport3_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) -#define IDirect3DViewport3_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c) -#define IDirect3DViewport3_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a) -#define IDirect3DViewport3_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a) -#define IDirect3DViewport3_SetBackgroundDepth2(p,a) (p)->lpVtbl->SetBackgroundDepth2(p,a) -#define IDirect3DViewport3_GetBackgroundDepth2(p,a,b) (p)->lpVtbl->GetBackgroundDepth2(p,a,b) -#define IDirect3DViewport3_Clear2(p,a,b,c,d,e,f) (p)->lpVtbl->Clear2(p,a,b,c,d,e,f) -#else -#define IDirect3DViewport3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DViewport3_AddRef(p) (p)->AddRef() -#define IDirect3DViewport3_Release(p) (p)->Release() -#define IDirect3DViewport3_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DViewport3_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DViewport3_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DViewport3_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d) -#define IDirect3DViewport3_LightElements(p,a,b) (p)->LightElements(a,b) -#define IDirect3DViewport3_SetBackground(p,a) (p)->SetBackground(a) -#define IDirect3DViewport3_GetBackground(p,a,b) (p)->GetBackground(a,b) -#define IDirect3DViewport3_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a) -#define IDirect3DViewport3_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b) -#define IDirect3DViewport3_Clear(p,a,b,c) (p)->Clear(a,b,c) -#define IDirect3DViewport3_AddLight(p,a) (p)->AddLight(a) -#define IDirect3DViewport3_DeleteLight(p,a) (p)->DeleteLight(a) -#define IDirect3DViewport3_NextLight(p,a,b,c) (p)->NextLight(a,b,c) -#define IDirect3DViewport3_GetViewport2(p,a) (p)->GetViewport2(a) -#define IDirect3DViewport3_SetViewport2(p,a) (p)->SetViewport2(a) -#define IDirect3DViewport3_SetBackgroundDepth2(p,a) (p)->SetBackgroundDepth2(a) -#define IDirect3DViewport3_GetBackgroundDepth2(p,a,b) (p)->GetBackgroundDepth2(a,b) -#define IDirect3DViewport3_Clear2(p,a,b,c,d,e,f) (p)->Clear2(a,b,c,d,e,f) -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#undef INTERFACE -#define INTERFACE IDirect3DVertexBuffer - -DECLARE_INTERFACE_(IDirect3DVertexBuffer, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DVertexBuffer methods ***/ - STDMETHOD(Lock)(THIS_ DWORD,LPVOID*,LPDWORD) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(ProcessVertices)(THIS_ DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER,DWORD,LPDIRECT3DDEVICE3,DWORD) PURE; - STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC) PURE; - STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE3,DWORD) PURE; -}; - -typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVertexBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVertexBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVertexBuffer_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVertexBuffer_Lock(p,a,b,c) (p)->lpVtbl->Lock(p,a,b,c) -#define IDirect3DVertexBuffer_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DVertexBuffer_ProcessVertices(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f,g) -#define IDirect3DVertexBuffer_GetVertexBufferDesc(p,a) (p)->lpVtbl->GetVertexBufferDesc(p,a) -#define IDirect3DVertexBuffer_Optimize(p,a,b) (p)->lpVtbl->Optimize(p,a,b) -#else -#define IDirect3DVertexBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVertexBuffer_AddRef(p) (p)->AddRef() -#define IDirect3DVertexBuffer_Release(p) (p)->Release() -#define IDirect3DVertexBuffer_Lock(p,a,b,c) (p)->Lock(a,b,c) -#define IDirect3DVertexBuffer_Unlock(p) (p)->Unlock() -#define IDirect3DVertexBuffer_ProcessVertices(p,a,b,c,d,e,f,g) (p)->ProcessVertices(a,b,c,d,e,f,g) -#define IDirect3DVertexBuffer_GetVertexBufferDesc(p,a) (p)->GetVertexBufferDesc(a) -#define IDirect3DVertexBuffer_Optimize(p,a,b) (p)->Optimize(a,b) -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -#undef INTERFACE -#define INTERFACE IDirect3DVertexBuffer7 - -DECLARE_INTERFACE_(IDirect3DVertexBuffer7, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DVertexBuffer7 methods ***/ - STDMETHOD(Lock)(THIS_ DWORD,LPVOID*,LPDWORD) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(ProcessVertices)(THIS_ DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER7,DWORD,LPDIRECT3DDEVICE7,DWORD) PURE; - STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC) PURE; - STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE7,DWORD) PURE; - STDMETHOD(ProcessVerticesStrided)(THIS_ DWORD,DWORD,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPDIRECT3DDEVICE7,DWORD) PURE; -}; - -typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVertexBuffer7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVertexBuffer7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVertexBuffer7_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVertexBuffer7_Lock(p,a,b,c) (p)->lpVtbl->Lock(p,a,b,c) -#define IDirect3DVertexBuffer7_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DVertexBuffer7_ProcessVertices(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f,g) -#define IDirect3DVertexBuffer7_GetVertexBufferDesc(p,a) (p)->lpVtbl->GetVertexBufferDesc(p,a) -#define IDirect3DVertexBuffer7_Optimize(p,a,b) (p)->lpVtbl->Optimize(p,a,b) -#define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVerticesStrided(p,a,b,c,d,e,f,g) -#else -#define IDirect3DVertexBuffer7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVertexBuffer7_AddRef(p) (p)->AddRef() -#define IDirect3DVertexBuffer7_Release(p) (p)->Release() -#define IDirect3DVertexBuffer7_Lock(p,a,b,c) (p)->Lock(a,b,c) -#define IDirect3DVertexBuffer7_Unlock(p) (p)->Unlock() -#define IDirect3DVertexBuffer7_ProcessVertices(p,a,b,c,d,e,f,g) (p)->ProcessVertices(a,b,c,d,e,f,g) -#define IDirect3DVertexBuffer7_GetVertexBufferDesc(p,a) (p)->GetVertexBufferDesc(a) -#define IDirect3DVertexBuffer7_Optimize(p,a,b) (p)->Optimize(a,b) -#define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->ProcessVerticesStrided(a,b,c,d,e,f,g) -#endif -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION >= 0x0500) -/**************************************************************************** - * - * Flags for IDirect3DDevice::NextViewport - * - ****************************************************************************/ - -/* - * Return the next viewport - */ -#define D3DNEXT_NEXT 0x00000001l - -/* - * Return the first viewport - */ -#define D3DNEXT_HEAD 0x00000002l - -/* - * Return the last viewport - */ -#define D3DNEXT_TAIL 0x00000004l - - -/**************************************************************************** - * - * Flags for DrawPrimitive/DrawIndexedPrimitive - * Also valid for Begin/BeginIndexed - * Also valid for VertexBuffer::CreateVertexBuffer - ****************************************************************************/ - -/* - * Wait until the device is ready to draw the primitive - * This will cause DP to not return DDERR_WASSTILLDRAWING - */ -#define D3DDP_WAIT 0x00000001l -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if (DIRECT3D_VERSION == 0x0500) -/* - * Hint that it is acceptable to render the primitive out of order. - */ -#define D3DDP_OUTOFORDER 0x00000002l -#endif - - -#if(DIRECT3D_VERSION >= 0x0500) -/* - * Hint that the primitives have been clipped by the application. - */ -#define D3DDP_DONOTCLIP 0x00000004l - -/* - * Hint that the extents need not be updated. - */ -#define D3DDP_DONOTUPDATEEXTENTS 0x00000008l -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - -/* - * Hint that the lighting should not be applied on vertices. - */ - -#define D3DDP_DONOTLIGHT 0x00000010l - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Direct3D Errors - * DirectDraw error codes are used when errors not specified here. - */ -#define D3D_OK DD_OK -#define D3DERR_BADMAJORVERSION MAKE_DDHRESULT(700) -#define D3DERR_BADMINORVERSION MAKE_DDHRESULT(701) - -#if(DIRECT3D_VERSION >= 0x0500) -/* - * An invalid device was requested by the application. - */ -#define D3DERR_INVALID_DEVICE MAKE_DDHRESULT(705) -#define D3DERR_INITFAILED MAKE_DDHRESULT(706) - -/* - * SetRenderTarget attempted on a device that was - * QI'd off the render target. - */ -#define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#define D3DERR_EXECUTE_CREATE_FAILED MAKE_DDHRESULT(710) -#define D3DERR_EXECUTE_DESTROY_FAILED MAKE_DDHRESULT(711) -#define D3DERR_EXECUTE_LOCK_FAILED MAKE_DDHRESULT(712) -#define D3DERR_EXECUTE_UNLOCK_FAILED MAKE_DDHRESULT(713) -#define D3DERR_EXECUTE_LOCKED MAKE_DDHRESULT(714) -#define D3DERR_EXECUTE_NOT_LOCKED MAKE_DDHRESULT(715) - -#define D3DERR_EXECUTE_FAILED MAKE_DDHRESULT(716) -#define D3DERR_EXECUTE_CLIPPED_FAILED MAKE_DDHRESULT(717) - -#define D3DERR_TEXTURE_NO_SUPPORT MAKE_DDHRESULT(720) -#define D3DERR_TEXTURE_CREATE_FAILED MAKE_DDHRESULT(721) -#define D3DERR_TEXTURE_DESTROY_FAILED MAKE_DDHRESULT(722) -#define D3DERR_TEXTURE_LOCK_FAILED MAKE_DDHRESULT(723) -#define D3DERR_TEXTURE_UNLOCK_FAILED MAKE_DDHRESULT(724) -#define D3DERR_TEXTURE_LOAD_FAILED MAKE_DDHRESULT(725) -#define D3DERR_TEXTURE_SWAP_FAILED MAKE_DDHRESULT(726) -#define D3DERR_TEXTURE_LOCKED MAKE_DDHRESULT(727) -#define D3DERR_TEXTURE_NOT_LOCKED MAKE_DDHRESULT(728) -#define D3DERR_TEXTURE_GETSURF_FAILED MAKE_DDHRESULT(729) - -#define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730) -#define D3DERR_MATRIX_DESTROY_FAILED MAKE_DDHRESULT(731) -#define D3DERR_MATRIX_SETDATA_FAILED MAKE_DDHRESULT(732) -#define D3DERR_MATRIX_GETDATA_FAILED MAKE_DDHRESULT(733) -#define D3DERR_SETVIEWPORTDATA_FAILED MAKE_DDHRESULT(734) - -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DERR_INVALIDCURRENTVIEWPORT MAKE_DDHRESULT(735) -#define D3DERR_INVALIDPRIMITIVETYPE MAKE_DDHRESULT(736) -#define D3DERR_INVALIDVERTEXTYPE MAKE_DDHRESULT(737) -#define D3DERR_TEXTURE_BADSIZE MAKE_DDHRESULT(738) -#define D3DERR_INVALIDRAMPTEXTURE MAKE_DDHRESULT(739) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#define D3DERR_MATERIAL_CREATE_FAILED MAKE_DDHRESULT(740) -#define D3DERR_MATERIAL_DESTROY_FAILED MAKE_DDHRESULT(741) -#define D3DERR_MATERIAL_SETDATA_FAILED MAKE_DDHRESULT(742) -#define D3DERR_MATERIAL_GETDATA_FAILED MAKE_DDHRESULT(743) - -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DERR_INVALIDPALETTE MAKE_DDHRESULT(744) - -#define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745) -#define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY MAKE_DDHRESULT(746) -#define D3DERR_SURFACENOTINVIDMEM MAKE_DDHRESULT(747) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#define D3DERR_LIGHT_SET_FAILED MAKE_DDHRESULT(750) -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DERR_LIGHTHASVIEWPORT MAKE_DDHRESULT(751) -#define D3DERR_LIGHTNOTINTHISVIEWPORT MAKE_DDHRESULT(752) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#define D3DERR_SCENE_IN_SCENE MAKE_DDHRESULT(760) -#define D3DERR_SCENE_NOT_IN_SCENE MAKE_DDHRESULT(761) -#define D3DERR_SCENE_BEGIN_FAILED MAKE_DDHRESULT(762) -#define D3DERR_SCENE_END_FAILED MAKE_DDHRESULT(763) - -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DERR_INBEGIN MAKE_DDHRESULT(770) -#define D3DERR_NOTINBEGIN MAKE_DDHRESULT(771) -#define D3DERR_NOVIEWPORTS MAKE_DDHRESULT(772) -#define D3DERR_VIEWPORTDATANOTSET MAKE_DDHRESULT(773) -#define D3DERR_VIEWPORTHASNODEVICE MAKE_DDHRESULT(774) -#define D3DERR_NOCURRENTVIEWPORT MAKE_DDHRESULT(775) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#define D3DERR_INVALIDVERTEXFORMAT MAKE_DDHRESULT(2048) - -/* - * Attempted to CreateTexture on a surface that had a color key - */ -#define D3DERR_COLORKEYATTACHED MAKE_DDHRESULT(2050) - -#define D3DERR_VERTEXBUFFEROPTIMIZED MAKE_DDHRESULT(2060) -#define D3DERR_VBUF_CREATE_FAILED MAKE_DDHRESULT(2061) -#define D3DERR_VERTEXBUFFERLOCKED MAKE_DDHRESULT(2062) -#define D3DERR_VERTEXBUFFERUNLOCKFAILED MAKE_DDHRESULT(2063) - -#define D3DERR_ZBUFFER_NOTPRESENT MAKE_DDHRESULT(2070) -#define D3DERR_STENCILBUFFER_NOTPRESENT MAKE_DDHRESULT(2071) - -#define D3DERR_WRONGTEXTUREFORMAT MAKE_DDHRESULT(2072) -#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_DDHRESULT(2073) -#define D3DERR_UNSUPPORTEDCOLORARG MAKE_DDHRESULT(2074) -#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_DDHRESULT(2075) -#define D3DERR_UNSUPPORTEDALPHAARG MAKE_DDHRESULT(2076) -#define D3DERR_TOOMANYOPERATIONS MAKE_DDHRESULT(2077) -#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_DDHRESULT(2078) -#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_DDHRESULT(2079) -#define D3DERR_CONFLICTINGRENDERSTATE MAKE_DDHRESULT(2081) -#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_DDHRESULT(2082) -#define D3DERR_TOOMANYPRIMITIVES MAKE_DDHRESULT(2083) -#define D3DERR_INVALIDMATRIX MAKE_DDHRESULT(2084) -#define D3DERR_TOOMANYVERTICES MAKE_DDHRESULT(2085) -#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_DDHRESULT(2086) - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -#define D3DERR_INVALIDSTATEBLOCK MAKE_DDHRESULT(2100) -#define D3DERR_INBEGINSTATEBLOCK MAKE_DDHRESULT(2101) -#define D3DERR_NOTINBEGINSTATEBLOCK MAKE_DDHRESULT(2102) -#endif /* DIRECT3D_VERSION >= 0x0700 */ - - -#ifdef __cplusplus -}; -#endif - -#endif /* (DIRECT3D_VERSION < 0x0800) */ -#endif /* _D3D_H_ */ - diff --git a/jan/src/dep/vc/include/d3dcaps.h b/jan/src/dep/vc/include/d3dcaps.h deleted file mode 100644 index 701bf9c13..000000000 --- a/jan/src/dep/vc/include/d3dcaps.h +++ /dev/null @@ -1,601 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3dcaps.h - * Content: Direct3D capabilities include file - * - ***************************************************************************/ - -#ifndef _D3DCAPS_H -#define _D3DCAPS_H - -/* - * Pull in DirectDraw include file automatically: - */ -#include "ddraw.h" - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0700 -#endif - -#if defined(_X86_) || defined(_IA64_) -#pragma pack(4) -#endif - -/* Description of capabilities of transform */ - -typedef struct _D3DTRANSFORMCAPS { - DWORD dwSize; - DWORD dwCaps; -} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS; - -#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */ - -/* Description of capabilities of lighting */ - -typedef struct _D3DLIGHTINGCAPS { - DWORD dwSize; - DWORD dwCaps; /* Lighting caps */ - DWORD dwLightingModel; /* Lighting model - RGB or mono */ - DWORD dwNumLights; /* Number of lights that can be handled */ -} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS; - -#define D3DLIGHTINGMODEL_RGB 0x00000001L -#define D3DLIGHTINGMODEL_MONO 0x00000002L - -#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */ -#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */ -#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */ -#if(DIRECT3D_VERSION < 0x700) -#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */ -#endif -#if(DIRECT3D_VERSION < 0x500) -#define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */ -#endif - -/* Description of capabilities for each primitive type */ - -typedef struct _D3DPrimCaps { - DWORD dwSize; - DWORD dwMiscCaps; /* Capability flags */ - DWORD dwRasterCaps; - DWORD dwZCmpCaps; - DWORD dwSrcBlendCaps; - DWORD dwDestBlendCaps; - DWORD dwAlphaCmpCaps; - DWORD dwShadeCaps; - DWORD dwTextureCaps; - DWORD dwTextureFilterCaps; - DWORD dwTextureBlendCaps; - DWORD dwTextureAddressCaps; - DWORD dwStippleWidth; /* maximum width and height of */ - DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */ -} D3DPRIMCAPS, *LPD3DPRIMCAPS; - -/* D3DPRIMCAPS dwMiscCaps */ - -#define D3DPMISCCAPS_MASKPLANES 0x00000001L -#define D3DPMISCCAPS_MASKZ 0x00000002L -#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L -#define D3DPMISCCAPS_CONFORMANT 0x00000008L -#define D3DPMISCCAPS_CULLNONE 0x00000010L -#define D3DPMISCCAPS_CULLCW 0x00000020L -#define D3DPMISCCAPS_CULLCCW 0x00000040L - -/* D3DPRIMCAPS dwRasterCaps */ - -#define D3DPRASTERCAPS_DITHER 0x00000001L -#define D3DPRASTERCAPS_ROP2 0x00000002L -#define D3DPRASTERCAPS_XOR 0x00000004L -#define D3DPRASTERCAPS_PAT 0x00000008L -#define D3DPRASTERCAPS_ZTEST 0x00000010L -#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L -#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L -#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L -#define D3DPRASTERCAPS_FOGTABLE 0x00000100L -#define D3DPRASTERCAPS_STIPPLE 0x00000200L -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L -#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L -#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L -#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L -#define D3DPRASTERCAPS_ZBIAS 0x00004000L -#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L -#define D3DPRASTERCAPS_FOGRANGE 0x00010000L -#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -#define D3DPRASTERCAPS_WBUFFER 0x00040000L -#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L -#define D3DPRASTERCAPS_WFOG 0x00100000L -#define D3DPRASTERCAPS_ZFOG 0x00200000L -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */ - -#define D3DPCMPCAPS_NEVER 0x00000001L -#define D3DPCMPCAPS_LESS 0x00000002L -#define D3DPCMPCAPS_EQUAL 0x00000004L -#define D3DPCMPCAPS_LESSEQUAL 0x00000008L -#define D3DPCMPCAPS_GREATER 0x00000010L -#define D3DPCMPCAPS_NOTEQUAL 0x00000020L -#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L -#define D3DPCMPCAPS_ALWAYS 0x00000080L - -/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */ - -#define D3DPBLENDCAPS_ZERO 0x00000001L -#define D3DPBLENDCAPS_ONE 0x00000002L -#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L -#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L -#define D3DPBLENDCAPS_SRCALPHA 0x00000010L -#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L -#define D3DPBLENDCAPS_DESTALPHA 0x00000040L -#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L -#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L -#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L -#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L -#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L -#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L - -/* D3DPRIMCAPS dwShadeCaps */ - -#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L -#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L -#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L -#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L -#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L -#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L - -#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L -#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L -#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L -#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L -#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L -#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L - -#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L -#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L -#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L -#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L -#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L -#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L - -#define D3DPSHADECAPS_FOGFLAT 0x00040000L -#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L -#define D3DPSHADECAPS_FOGPHONG 0x00100000L - -/* D3DPRIMCAPS dwTextureCaps */ - -/* - * Perspective-correct texturing is supported - */ -#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L - -/* - * Power-of-2 texture dimensions are required - */ -#define D3DPTEXTURECAPS_POW2 0x00000002L - -/* - * Alpha in texture pixels is supported - */ -#define D3DPTEXTURECAPS_ALPHA 0x00000004L - -/* - * Color-keyed textures are supported - */ -#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L - -/* - * obsolete, see D3DPTADDRESSCAPS_BORDER - */ -#define D3DPTEXTURECAPS_BORDER 0x00000010L - -/* - * Only square textures are supported - */ -#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L - -#if(DIRECT3D_VERSION >= 0x0600) -/* - * Texture indices are not scaled by the texture size prior - * to interpolation. - */ -#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L - -/* - * Device can draw alpha from texture palettes - */ -#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L - -/* - * Device can use non-POW2 textures if: - * 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage - * 2) D3DRS_WRAP(N) is zero for this texture's coordinates - * 3) mip mapping is not enabled (use magnification filter only) - */ -#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L - -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) - -// 0x00000200L unused - -/* - * Device can divide transformed texture coordinates by the - * COUNTth texture coordinate (can do D3DTTFF_PROJECTED) - */ -#define D3DPTEXTURECAPS_PROJECTED 0x00000400L - -/* - * Device can do cubemap textures - */ -#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L - -#define D3DPTEXTURECAPS_COLORKEYBLEND 0x00001000L -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* D3DPRIMCAPS dwTextureFilterCaps */ - -#define D3DPTFILTERCAPS_NEAREST 0x00000001L -#define D3DPTFILTERCAPS_LINEAR 0x00000002L -#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L -#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L -#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L -#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L - -#if(DIRECT3D_VERSION >= 0x0600) -/* Device3 Min Filter */ -#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L -#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L -#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L - -/* Device3 Mip Filter */ -#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L -#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L - -/* Device3 Mag Filter */ -#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L -#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L -#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L -#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L -#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* D3DPRIMCAPS dwTextureBlendCaps */ - -#define D3DPTBLENDCAPS_DECAL 0x00000001L -#define D3DPTBLENDCAPS_MODULATE 0x00000002L -#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L -#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L -#define D3DPTBLENDCAPS_DECALMASK 0x00000010L -#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L -#define D3DPTBLENDCAPS_COPY 0x00000040L -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DPTBLENDCAPS_ADD 0x00000080L -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -/* D3DPRIMCAPS dwTextureAddressCaps */ -#define D3DPTADDRESSCAPS_WRAP 0x00000001L -#define D3DPTADDRESSCAPS_MIRROR 0x00000002L -#define D3DPTADDRESSCAPS_CLAMP 0x00000004L -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DPTADDRESSCAPS_BORDER 0x00000008L -#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - -/* D3DDEVICEDESC dwStencilCaps */ - -#define D3DSTENCILCAPS_KEEP 0x00000001L -#define D3DSTENCILCAPS_ZERO 0x00000002L -#define D3DSTENCILCAPS_REPLACE 0x00000004L -#define D3DSTENCILCAPS_INCRSAT 0x00000008L -#define D3DSTENCILCAPS_DECRSAT 0x00000010L -#define D3DSTENCILCAPS_INVERT 0x00000020L -#define D3DSTENCILCAPS_INCR 0x00000040L -#define D3DSTENCILCAPS_DECR 0x00000080L - -/* D3DDEVICEDESC dwTextureOpCaps */ - -#define D3DTEXOPCAPS_DISABLE 0x00000001L -#define D3DTEXOPCAPS_SELECTARG1 0x00000002L -#define D3DTEXOPCAPS_SELECTARG2 0x00000004L -#define D3DTEXOPCAPS_MODULATE 0x00000008L -#define D3DTEXOPCAPS_MODULATE2X 0x00000010L -#define D3DTEXOPCAPS_MODULATE4X 0x00000020L -#define D3DTEXOPCAPS_ADD 0x00000040L -#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L -#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L -#define D3DTEXOPCAPS_SUBTRACT 0x00000200L -#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L -#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L -#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L -#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L -#define D3DTEXOPCAPS_PREMODULATE 0x00010000L -#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L -#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L -#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L -#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L -#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L -#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L -#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L - -/* D3DDEVICEDESC dwFVFCaps flags */ - -#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ -#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Description for a device. - * This is used to describe a device that is to be created or to query - * the current device. - */ -typedef struct _D3DDeviceDesc { - DWORD dwSize; /* Size of D3DDEVICEDESC structure */ - DWORD dwFlags; /* Indicates which fields have valid data */ - D3DCOLORMODEL dcmColorModel; /* Color model of device */ - DWORD dwDevCaps; /* Capabilities of device */ - D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */ - BOOL bClipping; /* Device can do 3D clipping */ - D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */ - D3DPRIMCAPS dpcLineCaps; - D3DPRIMCAPS dpcTriCaps; - DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */ - DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ - DWORD dwMaxBufferSize; /* Maximum execute buffer size */ - DWORD dwMaxVertexCount; /* Maximum vertex count */ -#if(DIRECT3D_VERSION >= 0x0500) - // *** New fields for DX5 *** // - - // Width and height caps are 0 for legacy HALs. - DWORD dwMinTextureWidth, dwMinTextureHeight; - DWORD dwMaxTextureWidth, dwMaxTextureHeight; - DWORD dwMinStippleWidth, dwMaxStippleWidth; - DWORD dwMinStippleHeight, dwMaxStippleHeight; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - // New fields for DX6 - DWORD dwMaxTextureRepeat; - DWORD dwMaxTextureAspectRatio; - DWORD dwMaxAnisotropy; - - // Guard band that the rasterizer can accommodate - // Screen-space vertices inside this space but outside the viewport - // will get clipped properly. - D3DVALUE dvGuardBandLeft; - D3DVALUE dvGuardBandTop; - D3DVALUE dvGuardBandRight; - D3DVALUE dvGuardBandBottom; - - D3DVALUE dvExtentsAdjust; - DWORD dwStencilCaps; - - DWORD dwFVFCaps; - DWORD dwTextureOpCaps; - WORD wMaxTextureBlendStages; - WORD wMaxSimultaneousTextures; -#endif /* DIRECT3D_VERSION >= 0x0600 */ -} D3DDEVICEDESC, *LPD3DDEVICEDESC; - -#if(DIRECT3D_VERSION >= 0x0700) -typedef struct _D3DDeviceDesc7 { - DWORD dwDevCaps; /* Capabilities of device */ - D3DPRIMCAPS dpcLineCaps; - D3DPRIMCAPS dpcTriCaps; - DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */ - DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ - - DWORD dwMinTextureWidth, dwMinTextureHeight; - DWORD dwMaxTextureWidth, dwMaxTextureHeight; - - DWORD dwMaxTextureRepeat; - DWORD dwMaxTextureAspectRatio; - DWORD dwMaxAnisotropy; - - D3DVALUE dvGuardBandLeft; - D3DVALUE dvGuardBandTop; - D3DVALUE dvGuardBandRight; - D3DVALUE dvGuardBandBottom; - - D3DVALUE dvExtentsAdjust; - DWORD dwStencilCaps; - - DWORD dwFVFCaps; - DWORD dwTextureOpCaps; - WORD wMaxTextureBlendStages; - WORD wMaxSimultaneousTextures; - - DWORD dwMaxActiveLights; - D3DVALUE dvMaxVertexW; - GUID deviceGUID; - - WORD wMaxUserClipPlanes; - WORD wMaxVertexBlendMatrices; - - DWORD dwVertexProcessingCaps; - - DWORD dwReserved1; - DWORD dwReserved2; - DWORD dwReserved3; - DWORD dwReserved4; -} D3DDEVICEDESC7, *LPD3DDEVICEDESC7; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC)) -#define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7)) - -typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID); - -#if(DIRECT3D_VERSION >= 0x0700) -typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID); -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* D3DDEVICEDESC dwFlags indicating valid fields */ - -#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */ -#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */ -#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */ -#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */ -#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */ -#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */ -#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */ -#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */ -#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */ -#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */ -#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */ - -/* D3DDEVICEDESC dwDevCaps flags */ - -#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */ - /* for post-transform vertex data */ -#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z */ -#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z */ -#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */ - -#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ -#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ -#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ -#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ -#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ -#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ -#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ -#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */ -#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ -#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/ -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ -#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ -#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ - -/* - * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field - */ - -/* device can do texgen */ -#define D3DVTXPCAPS_TEXGEN 0x00000001L -/* device can do IDirect3DDevice7 colormaterialsource ops */ -#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L -/* device can do vertex fog */ -#define D3DVTXPCAPS_VERTEXFOG 0x00000004L -/* device can do directional lights */ -#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L -/* device can do positional lights (includes point and spot) */ -#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L -/* device can do local viewer */ -#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */ -#define D3DFDS_GUID 0x00000002L /* Match guid */ -#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */ -#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */ -#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */ -#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */ -#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */ -#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */ -#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */ -#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */ -#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */ -#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */ -#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */ -#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */ -#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */ -#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */ - -/* - * FindDevice arguments - */ -typedef struct _D3DFINDDEVICESEARCH { - DWORD dwSize; - DWORD dwFlags; - BOOL bHardware; - D3DCOLORMODEL dcmColorModel; - GUID guid; - DWORD dwCaps; - D3DPRIMCAPS dpcPrimCaps; -} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH; - -typedef struct _D3DFINDDEVICERESULT { - DWORD dwSize; - GUID guid; /* guid which matched */ - D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */ - D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */ -} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT; - -/* - * Description of execute buffer. - */ -typedef struct _D3DExecuteBufferDesc { - DWORD dwSize; /* size of this structure */ - DWORD dwFlags; /* flags indicating which fields are valid */ - DWORD dwCaps; /* capabilities of execute buffer */ - DWORD dwBufferSize; /* size of execute buffer data */ - LPVOID lpData; /* pointer to actual data */ -} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC; - -/* D3DEXECUTEBUFFER dwFlags indicating valid fields */ - -#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */ -#define D3DDEB_CAPS 0x00000002l /* caps valid */ -#define D3DDEB_LPDATA 0x00000004l /* lpData valid */ - -/* D3DEXECUTEBUFFER dwCaps */ - -#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */ -#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */ -#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY) - -#if(DIRECT3D_VERSION < 0x0800) - -#if(DIRECT3D_VERSION >= 0x0700) -typedef struct _D3DDEVINFO_TEXTUREMANAGER { - BOOL bThrashing; /* indicates if thrashing */ - DWORD dwApproxBytesDownloaded; /* Approximate number of bytes downloaded by texture manager */ - DWORD dwNumEvicts; /* number of textures evicted */ - DWORD dwNumVidCreates; /* number of textures created in video memory */ - DWORD dwNumTexturesUsed; /* number of textures used */ - DWORD dwNumUsedTexInVid; /* number of used textures present in video memory */ - DWORD dwWorkingSet; /* number of textures in video memory */ - DWORD dwWorkingSetBytes; /* number of bytes in video memory */ - DWORD dwTotalManaged; /* total number of managed textures */ - DWORD dwTotalBytes; /* total number of bytes of managed textures */ - DWORD dwLastPri; /* priority of last texture evicted */ -} D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER; - -typedef struct _D3DDEVINFO_TEXTURING { - DWORD dwNumLoads; /* counts Load() API calls */ - DWORD dwApproxBytesLoaded; /* Approximate number bytes loaded via Load() */ - DWORD dwNumPreLoads; /* counts PreLoad() API calls */ - DWORD dwNumSet; /* counts SetTexture() API calls */ - DWORD dwNumCreates; /* counts texture creates */ - DWORD dwNumDestroys; /* counts texture destroys */ - DWORD dwNumSetPriorities; /* counts SetPriority() API calls */ - DWORD dwNumSetLODs; /* counts SetLOD() API calls */ - DWORD dwNumLocks; /* counts number of texture locks */ - DWORD dwNumGetDCs; /* counts number of GetDCs to textures */ -} D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#endif //(DIRECT3D_VERSION < 0x0800) - -#pragma pack() - - -#endif /* _D3DCAPS_H_ */ - diff --git a/jan/src/dep/vc/include/d3dtypes.h b/jan/src/dep/vc/include/d3dtypes.h deleted file mode 100644 index d1759dcd2..000000000 --- a/jan/src/dep/vc/include/d3dtypes.h +++ /dev/null @@ -1,2119 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3dtypes.h - * Content: Direct3D types include file - * - ***************************************************************************/ - -#ifndef _D3DTYPES_H_ -#define _D3DTYPES_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0700 -#endif - -#if (DIRECT3D_VERSION >= 0x0800) -#pragma message("should not include d3dtypes.h when compiling for DX8 or newer interfaces") -#endif - -#include - -#include -#include "ddraw.h" - -#pragma warning(disable:4201) // anonymous unions warning -#if defined(_X86_) || defined(_IA64_) -#pragma pack(4) -#endif - - -/* D3DVALUE is the fundamental Direct3D fractional data type */ - -#define D3DVALP(val, prec) ((float)(val)) -#define D3DVAL(val) ((float)(val)) - -#ifndef DX_SHARED_DEFINES - -/* - * This definition is shared with other DirectX components whose header files - * might already have defined it. Therefore, we don't define this type if - * someone else already has (as indicated by the definition of - * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are - * other types in this header that are also shared. The last of these - * shared defines in this file will set DX_SHARED_DEFINES. - */ -typedef float D3DVALUE, *LPD3DVALUE; - -#endif /* DX_SHARED_DEFINES */ - -#define D3DDivide(a, b) (float)((double) (a) / (double) (b)) -#define D3DMultiply(a, b) ((a) * (b)) - -typedef LONG D3DFIXED; - -#ifndef RGB_MAKE -/* - * Format of CI colors is - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | alpha | color index | fraction | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ -#define CI_GETALPHA(ci) ((ci) >> 24) -#define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff) -#define CI_GETFRACTION(ci) ((ci) & 0xff) -#define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80) -#define CI_MASKALPHA(ci) ((ci) & 0xffffff) -#define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f)) - -/* - * Format of RGBA colors is - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | alpha | red | green | blue | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ -#define RGBA_GETALPHA(rgb) ((rgb) >> 24) -#define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff) -#define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff) -#define RGBA_GETBLUE(rgb) ((rgb) & 0xff) -#define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))) - -/* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs - * The float values must be in the range 0..1 - */ -#define D3DRGB(r, g, b) \ - (0xff000000L | ( ((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255)) -#define D3DRGBA(r, g, b, a) \ - ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \ - | (((long)((g) * 255)) << 8) | (long)((b) * 255) \ - ) - -/* - * Format of RGB colors is - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | ignored | red | green | blue | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ -#define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff) -#define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff) -#define RGB_GETBLUE(rgb) ((rgb) & 0xff) -#define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff)) -#define RGB_MAKE(r, g, b) ((D3DCOLOR) (((r) << 16) | ((g) << 8) | (b))) -#define RGBA_TORGB(rgba) ((D3DCOLOR) ((rgba) & 0xffffff)) -#define RGB_TORGBA(rgb) ((D3DCOLOR) ((rgb) | 0xff000000)) - -#endif - -/* - * Flags for Enumerate functions - */ - -/* - * Stop the enumeration - */ -#define D3DENUMRET_CANCEL DDENUMRET_CANCEL - -/* - * Continue the enumeration - */ -#define D3DENUMRET_OK DDENUMRET_OK - -typedef HRESULT (CALLBACK* LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset); -typedef HRESULT (CALLBACK* LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext); -typedef HRESULT (CALLBACK* LPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext); - -#ifndef DX_SHARED_DEFINES - -/* - * This definition is shared with other DirectX components whose header files - * might already have defined it. Therefore, we don't define this type if - * someone else already has (as indicated by the definition of - * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are - * other types in this header that are also shared. The last of these - * shared defines in this file will set DX_SHARED_DEFINES. - */ -#ifndef D3DCOLOR_DEFINED -typedef DWORD D3DCOLOR; -#define D3DCOLOR_DEFINED -#endif -typedef DWORD *LPD3DCOLOR; - -#endif /* DX_SHARED_DEFINES */ - -typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE; -typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE; -typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE; - -#ifndef D3DCOLORVALUE_DEFINED -typedef struct _D3DCOLORVALUE { - union { - D3DVALUE r; - D3DVALUE dvR; - }; - union { - D3DVALUE g; - D3DVALUE dvG; - }; - union { - D3DVALUE b; - D3DVALUE dvB; - }; - union { - D3DVALUE a; - D3DVALUE dvA; - }; -} D3DCOLORVALUE; -#define D3DCOLORVALUE_DEFINED -#endif -typedef struct _D3DCOLORVALUE *LPD3DCOLORVALUE; - -#ifndef D3DRECT_DEFINED -typedef struct _D3DRECT { - union { - LONG x1; - LONG lX1; - }; - union { - LONG y1; - LONG lY1; - }; - union { - LONG x2; - LONG lX2; - }; - union { - LONG y2; - LONG lY2; - }; -} D3DRECT; -#define D3DRECT_DEFINED -#endif -typedef struct _D3DRECT *LPD3DRECT; - -#ifndef DX_SHARED_DEFINES - -/* - * This definition is shared with other DirectX components whose header files - * might already have defined it. Therefore, we don't define this type if - * someone else already has (as indicated by the definition of - * DX_SHARED_DEFINES). - */ - -#ifndef D3DVECTOR_DEFINED -typedef struct _D3DVECTOR { - union { - D3DVALUE x; - D3DVALUE dvX; - }; - union { - D3DVALUE y; - D3DVALUE dvY; - }; - union { - D3DVALUE z; - D3DVALUE dvZ; - }; -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - -public: - - // ===================================== - // Constructors - // ===================================== - - _D3DVECTOR() { } - _D3DVECTOR(D3DVALUE f); - _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z); - _D3DVECTOR(const D3DVALUE f[3]); - - // ===================================== - // Access grants - // ===================================== - - const D3DVALUE&operator[](int i) const; - D3DVALUE&operator[](int i); - - // ===================================== - // Assignment operators - // ===================================== - - _D3DVECTOR& operator += (const _D3DVECTOR& v); - _D3DVECTOR& operator -= (const _D3DVECTOR& v); - _D3DVECTOR& operator *= (const _D3DVECTOR& v); - _D3DVECTOR& operator /= (const _D3DVECTOR& v); - _D3DVECTOR& operator *= (D3DVALUE s); - _D3DVECTOR& operator /= (D3DVALUE s); - - // ===================================== - // Unary operators - // ===================================== - - friend _D3DVECTOR operator + (const _D3DVECTOR& v); - friend _D3DVECTOR operator - (const _D3DVECTOR& v); - - - // ===================================== - // Binary operators - // ===================================== - - // Addition and subtraction - friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - // Scalar multiplication and division - friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s); - friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v); - friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s); - // Memberwise multiplication and division - friend _D3DVECTOR operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Vector dominance - friend int operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend int operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Bitwise equality - friend int operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Length-related functions - friend D3DVALUE SquareMagnitude (const _D3DVECTOR& v); - friend D3DVALUE Magnitude (const _D3DVECTOR& v); - - // Returns vector with same direction and unit length - friend _D3DVECTOR Normalize (const _D3DVECTOR& v); - - // Return min/max component of the input vector - friend D3DVALUE Min (const _D3DVECTOR& v); - friend D3DVALUE Max (const _D3DVECTOR& v); - - // Return memberwise min/max of input vectors - friend _D3DVECTOR Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Dot and cross product - friend D3DVALUE DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DVECTOR; -#define D3DVECTOR_DEFINED -#endif -typedef struct _D3DVECTOR *LPD3DVECTOR; - -/* - * As this is the last of the shared defines to be defined we now set - * D3D_SHARED_DEFINES to flag that fact that this header has defined these - * types. - */ -#define DX_SHARED_DEFINES - -#endif /* DX_SHARED_DEFINES */ - -/* - * Vertex data types supported in an ExecuteBuffer. - */ - -/* - * Homogeneous vertices - */ - -typedef struct _D3DHVERTEX { - DWORD dwFlags; /* Homogeneous clipping flags */ - union { - D3DVALUE hx; - D3DVALUE dvHX; - }; - union { - D3DVALUE hy; - D3DVALUE dvHY; - }; - union { - D3DVALUE hz; - D3DVALUE dvHZ; - }; -} D3DHVERTEX, *LPD3DHVERTEX; - -/* - * Transformed/lit vertices - */ -typedef struct _D3DTLVERTEX { - union { - D3DVALUE sx; /* Screen coordinates */ - D3DVALUE dvSX; - }; - union { - D3DVALUE sy; - D3DVALUE dvSY; - }; - union { - D3DVALUE sz; - D3DVALUE dvSZ; - }; - union { - D3DVALUE rhw; /* Reciprocal of homogeneous w */ - D3DVALUE dvRHW; - }; - union { - D3DCOLOR color; /* Vertex color */ - D3DCOLOR dcColor; - }; - union { - D3DCOLOR specular; /* Specular component of vertex */ - D3DCOLOR dcSpecular; - }; - union { - D3DVALUE tu; /* Texture coordinates */ - D3DVALUE dvTU; - }; - union { - D3DVALUE tv; - D3DVALUE dvTV; - }; -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DTLVERTEX() { } - _D3DTLVERTEX(const D3DVECTOR& v, float _rhw, - D3DCOLOR _color, D3DCOLOR _specular, - float _tu, float _tv) - { sx = v.x; sy = v.y; sz = v.z; rhw = _rhw; - color = _color; specular = _specular; - tu = _tu; tv = _tv; - } -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTLVERTEX, *LPD3DTLVERTEX; - -/* - * Untransformed/lit vertices - */ -typedef struct _D3DLVERTEX { - union { - D3DVALUE x; /* Homogeneous coordinates */ - D3DVALUE dvX; - }; - union { - D3DVALUE y; - D3DVALUE dvY; - }; - union { - D3DVALUE z; - D3DVALUE dvZ; - }; - DWORD dwReserved; - union { - D3DCOLOR color; /* Vertex color */ - D3DCOLOR dcColor; - }; - union { - D3DCOLOR specular; /* Specular component of vertex */ - D3DCOLOR dcSpecular; - }; - union { - D3DVALUE tu; /* Texture coordinates */ - D3DVALUE dvTU; - }; - union { - D3DVALUE tv; - D3DVALUE dvTV; - }; -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DLVERTEX() { } - _D3DLVERTEX(const D3DVECTOR& v, - D3DCOLOR _color, D3DCOLOR _specular, - float _tu, float _tv) - { x = v.x; y = v.y; z = v.z; dwReserved = 0; - color = _color; specular = _specular; - tu = _tu; tv = _tv; - } -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DLVERTEX, *LPD3DLVERTEX; - -/* - * Untransformed/unlit vertices - */ - -typedef struct _D3DVERTEX { - union { - D3DVALUE x; /* Homogeneous coordinates */ - D3DVALUE dvX; - }; - union { - D3DVALUE y; - D3DVALUE dvY; - }; - union { - D3DVALUE z; - D3DVALUE dvZ; - }; - union { - D3DVALUE nx; /* Normal */ - D3DVALUE dvNX; - }; - union { - D3DVALUE ny; - D3DVALUE dvNY; - }; - union { - D3DVALUE nz; - D3DVALUE dvNZ; - }; - union { - D3DVALUE tu; /* Texture coordinates */ - D3DVALUE dvTU; - }; - union { - D3DVALUE tv; - D3DVALUE dvTV; - }; -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DVERTEX() { } - _D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv) - { x = v.x; y = v.y; z = v.z; - nx = n.x; ny = n.y; nz = n.z; - tu = _tu; tv = _tv; - } -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DVERTEX, *LPD3DVERTEX; - - -/* - * Matrix, viewport, and tranformation structures and definitions. - */ - -#ifndef D3DMATRIX_DEFINED -typedef struct _D3DMATRIX { -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - union { - struct { -#endif - -#endif /* DIRECT3D_VERSION >= 0x0500 */ - D3DVALUE _11, _12, _13, _14; - D3DVALUE _21, _22, _23, _24; - D3DVALUE _31, _32, _33, _34; - D3DVALUE _41, _42, _43, _44; - -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - }; - D3DVALUE m[4][4]; - }; - _D3DMATRIX() { } - _D3DMATRIX( D3DVALUE _m00, D3DVALUE _m01, D3DVALUE _m02, D3DVALUE _m03, - D3DVALUE _m10, D3DVALUE _m11, D3DVALUE _m12, D3DVALUE _m13, - D3DVALUE _m20, D3DVALUE _m21, D3DVALUE _m22, D3DVALUE _m23, - D3DVALUE _m30, D3DVALUE _m31, D3DVALUE _m32, D3DVALUE _m33 - ) - { - m[0][0] = _m00; m[0][1] = _m01; m[0][2] = _m02; m[0][3] = _m03; - m[1][0] = _m10; m[1][1] = _m11; m[1][2] = _m12; m[1][3] = _m13; - m[2][0] = _m20; m[2][1] = _m21; m[2][2] = _m22; m[2][3] = _m23; - m[3][0] = _m30; m[3][1] = _m31; m[3][2] = _m32; m[3][3] = _m33; - } - - D3DVALUE& operator()(int iRow, int iColumn) { return m[iRow][iColumn]; } - const D3DVALUE& operator()(int iRow, int iColumn) const { return m[iRow][iColumn]; } -#if(DIRECT3D_VERSION >= 0x0600) - friend _D3DMATRIX operator* (const _D3DMATRIX&, const _D3DMATRIX&); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DMATRIX; -#define D3DMATRIX_DEFINED -#endif -typedef struct _D3DMATRIX *LPD3DMATRIX; - -#if (defined __cplusplus) && (defined D3D_OVERLOADS) -#include "d3dvec.inl" -#endif - -typedef struct _D3DVIEWPORT { - DWORD dwSize; - DWORD dwX; - DWORD dwY; /* Top left */ - DWORD dwWidth; - DWORD dwHeight; /* Dimensions */ - D3DVALUE dvScaleX; /* Scale homogeneous to screen */ - D3DVALUE dvScaleY; /* Scale homogeneous to screen */ - D3DVALUE dvMaxX; /* Min/max homogeneous x coord */ - D3DVALUE dvMaxY; /* Min/max homogeneous y coord */ - D3DVALUE dvMinZ; - D3DVALUE dvMaxZ; /* Min/max homogeneous z coord */ -} D3DVIEWPORT, *LPD3DVIEWPORT; - -#if(DIRECT3D_VERSION >= 0x0500) -typedef struct _D3DVIEWPORT2 { - DWORD dwSize; - DWORD dwX; - DWORD dwY; /* Viewport Top left */ - DWORD dwWidth; - DWORD dwHeight; /* Viewport Dimensions */ - D3DVALUE dvClipX; /* Top left of clip volume */ - D3DVALUE dvClipY; - D3DVALUE dvClipWidth; /* Clip Volume Dimensions */ - D3DVALUE dvClipHeight; - D3DVALUE dvMinZ; /* Min/max of clip Volume */ - D3DVALUE dvMaxZ; -} D3DVIEWPORT2, *LPD3DVIEWPORT2; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0700) -typedef struct _D3DVIEWPORT7 { - DWORD dwX; - DWORD dwY; /* Viewport Top left */ - DWORD dwWidth; - DWORD dwHeight; /* Viewport Dimensions */ - D3DVALUE dvMinZ; /* Min/max of clip Volume */ - D3DVALUE dvMaxZ; -} D3DVIEWPORT7, *LPD3DVIEWPORT7; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* - * Values for clip fields. - */ - -#if(DIRECT3D_VERSION >= 0x0700) - -// Max number of user clipping planes, supported in D3D. -#define D3DMAXUSERCLIPPLANES 32 - -// These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE -// -#define D3DCLIPPLANE0 (1 << 0) -#define D3DCLIPPLANE1 (1 << 1) -#define D3DCLIPPLANE2 (1 << 2) -#define D3DCLIPPLANE3 (1 << 3) -#define D3DCLIPPLANE4 (1 << 4) -#define D3DCLIPPLANE5 (1 << 5) - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#define D3DCLIP_LEFT 0x00000001L -#define D3DCLIP_RIGHT 0x00000002L -#define D3DCLIP_TOP 0x00000004L -#define D3DCLIP_BOTTOM 0x00000008L -#define D3DCLIP_FRONT 0x00000010L -#define D3DCLIP_BACK 0x00000020L -#define D3DCLIP_GEN0 0x00000040L -#define D3DCLIP_GEN1 0x00000080L -#define D3DCLIP_GEN2 0x00000100L -#define D3DCLIP_GEN3 0x00000200L -#define D3DCLIP_GEN4 0x00000400L -#define D3DCLIP_GEN5 0x00000800L - -/* - * Values for d3d status. - */ -#define D3DSTATUS_CLIPUNIONLEFT D3DCLIP_LEFT -#define D3DSTATUS_CLIPUNIONRIGHT D3DCLIP_RIGHT -#define D3DSTATUS_CLIPUNIONTOP D3DCLIP_TOP -#define D3DSTATUS_CLIPUNIONBOTTOM D3DCLIP_BOTTOM -#define D3DSTATUS_CLIPUNIONFRONT D3DCLIP_FRONT -#define D3DSTATUS_CLIPUNIONBACK D3DCLIP_BACK -#define D3DSTATUS_CLIPUNIONGEN0 D3DCLIP_GEN0 -#define D3DSTATUS_CLIPUNIONGEN1 D3DCLIP_GEN1 -#define D3DSTATUS_CLIPUNIONGEN2 D3DCLIP_GEN2 -#define D3DSTATUS_CLIPUNIONGEN3 D3DCLIP_GEN3 -#define D3DSTATUS_CLIPUNIONGEN4 D3DCLIP_GEN4 -#define D3DSTATUS_CLIPUNIONGEN5 D3DCLIP_GEN5 - -#define D3DSTATUS_CLIPINTERSECTIONLEFT 0x00001000L -#define D3DSTATUS_CLIPINTERSECTIONRIGHT 0x00002000L -#define D3DSTATUS_CLIPINTERSECTIONTOP 0x00004000L -#define D3DSTATUS_CLIPINTERSECTIONBOTTOM 0x00008000L -#define D3DSTATUS_CLIPINTERSECTIONFRONT 0x00010000L -#define D3DSTATUS_CLIPINTERSECTIONBACK 0x00020000L -#define D3DSTATUS_CLIPINTERSECTIONGEN0 0x00040000L -#define D3DSTATUS_CLIPINTERSECTIONGEN1 0x00080000L -#define D3DSTATUS_CLIPINTERSECTIONGEN2 0x00100000L -#define D3DSTATUS_CLIPINTERSECTIONGEN3 0x00200000L -#define D3DSTATUS_CLIPINTERSECTIONGEN4 0x00400000L -#define D3DSTATUS_CLIPINTERSECTIONGEN5 0x00800000L -#define D3DSTATUS_ZNOTVISIBLE 0x01000000L -/* Do not use 0x80000000 for any status flags in future as it is reserved */ - -#define D3DSTATUS_CLIPUNIONALL ( \ - D3DSTATUS_CLIPUNIONLEFT | \ - D3DSTATUS_CLIPUNIONRIGHT | \ - D3DSTATUS_CLIPUNIONTOP | \ - D3DSTATUS_CLIPUNIONBOTTOM | \ - D3DSTATUS_CLIPUNIONFRONT | \ - D3DSTATUS_CLIPUNIONBACK | \ - D3DSTATUS_CLIPUNIONGEN0 | \ - D3DSTATUS_CLIPUNIONGEN1 | \ - D3DSTATUS_CLIPUNIONGEN2 | \ - D3DSTATUS_CLIPUNIONGEN3 | \ - D3DSTATUS_CLIPUNIONGEN4 | \ - D3DSTATUS_CLIPUNIONGEN5 \ - ) - -#define D3DSTATUS_CLIPINTERSECTIONALL ( \ - D3DSTATUS_CLIPINTERSECTIONLEFT | \ - D3DSTATUS_CLIPINTERSECTIONRIGHT | \ - D3DSTATUS_CLIPINTERSECTIONTOP | \ - D3DSTATUS_CLIPINTERSECTIONBOTTOM | \ - D3DSTATUS_CLIPINTERSECTIONFRONT | \ - D3DSTATUS_CLIPINTERSECTIONBACK | \ - D3DSTATUS_CLIPINTERSECTIONGEN0 | \ - D3DSTATUS_CLIPINTERSECTIONGEN1 | \ - D3DSTATUS_CLIPINTERSECTIONGEN2 | \ - D3DSTATUS_CLIPINTERSECTIONGEN3 | \ - D3DSTATUS_CLIPINTERSECTIONGEN4 | \ - D3DSTATUS_CLIPINTERSECTIONGEN5 \ - ) - -#define D3DSTATUS_DEFAULT ( \ - D3DSTATUS_CLIPINTERSECTIONALL | \ - D3DSTATUS_ZNOTVISIBLE) - - -/* - * Options for direct transform calls - */ -#define D3DTRANSFORM_CLIPPED 0x00000001l -#define D3DTRANSFORM_UNCLIPPED 0x00000002l - -typedef struct _D3DTRANSFORMDATA { - DWORD dwSize; - LPVOID lpIn; /* Input vertices */ - DWORD dwInSize; /* Stride of input vertices */ - LPVOID lpOut; /* Output vertices */ - DWORD dwOutSize; /* Stride of output vertices */ - LPD3DHVERTEX lpHOut; /* Output homogeneous vertices */ - DWORD dwClip; /* Clipping hint */ - DWORD dwClipIntersection; - DWORD dwClipUnion; /* Union of all clip flags */ - D3DRECT drExtent; /* Extent of transformed vertices */ -} D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA; - -/* - * Structure defining position and direction properties for lighting. - */ -typedef struct _D3DLIGHTINGELEMENT { - D3DVECTOR dvPosition; /* Lightable point in model space */ - D3DVECTOR dvNormal; /* Normalised unit vector */ -} D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT; - -/* - * Structure defining material properties for lighting. - */ -typedef struct _D3DMATERIAL { - DWORD dwSize; - union { - D3DCOLORVALUE diffuse; /* Diffuse color RGBA */ - D3DCOLORVALUE dcvDiffuse; - }; - union { - D3DCOLORVALUE ambient; /* Ambient color RGB */ - D3DCOLORVALUE dcvAmbient; - }; - union { - D3DCOLORVALUE specular; /* Specular 'shininess' */ - D3DCOLORVALUE dcvSpecular; - }; - union { - D3DCOLORVALUE emissive; /* Emissive color RGB */ - D3DCOLORVALUE dcvEmissive; - }; - union { - D3DVALUE power; /* Sharpness if specular highlight */ - D3DVALUE dvPower; - }; - D3DTEXTUREHANDLE hTexture; /* Handle to texture map */ - DWORD dwRampSize; -} D3DMATERIAL, *LPD3DMATERIAL; - -#if(DIRECT3D_VERSION >= 0x0700) - -typedef struct _D3DMATERIAL7 { - union { - D3DCOLORVALUE diffuse; /* Diffuse color RGBA */ - D3DCOLORVALUE dcvDiffuse; - }; - union { - D3DCOLORVALUE ambient; /* Ambient color RGB */ - D3DCOLORVALUE dcvAmbient; - }; - union { - D3DCOLORVALUE specular; /* Specular 'shininess' */ - D3DCOLORVALUE dcvSpecular; - }; - union { - D3DCOLORVALUE emissive; /* Emissive color RGB */ - D3DCOLORVALUE dcvEmissive; - }; - union { - D3DVALUE power; /* Sharpness if specular highlight */ - D3DVALUE dvPower; - }; -} D3DMATERIAL7, *LPD3DMATERIAL7; - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DLIGHTTYPE { - D3DLIGHT_POINT = 1, - D3DLIGHT_SPOT = 2, - D3DLIGHT_DIRECTIONAL = 3, -// Note: The following light type (D3DLIGHT_PARALLELPOINT) -// is no longer supported from D3D for DX7 onwards. - D3DLIGHT_PARALLELPOINT = 4, -#if(DIRECT3D_VERSION < 0x0500) // For backward compatible headers - D3DLIGHT_GLSPOT = 5, -#endif - D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DLIGHTTYPE; - -#else -typedef enum _D3DLIGHTTYPE D3DLIGHTTYPE; -#define D3DLIGHT_PARALLELPOINT (D3DLIGHTTYPE)4 -#define D3DLIGHT_GLSPOT (D3DLIGHTTYPE)5 - -#endif //(DIRECT3D_VERSION < 0x0800) - -/* - * Structure defining a light source and its properties. - */ -typedef struct _D3DLIGHT { - DWORD dwSize; - D3DLIGHTTYPE dltType; /* Type of light source */ - D3DCOLORVALUE dcvColor; /* Color of light */ - D3DVECTOR dvPosition; /* Position in world space */ - D3DVECTOR dvDirection; /* Direction in world space */ - D3DVALUE dvRange; /* Cutoff range */ - D3DVALUE dvFalloff; /* Falloff */ - D3DVALUE dvAttenuation0; /* Constant attenuation */ - D3DVALUE dvAttenuation1; /* Linear attenuation */ - D3DVALUE dvAttenuation2; /* Quadratic attenuation */ - D3DVALUE dvTheta; /* Inner angle of spotlight cone */ - D3DVALUE dvPhi; /* Outer angle of spotlight cone */ -} D3DLIGHT, *LPD3DLIGHT; - -#if(DIRECT3D_VERSION >= 0x0700) - -typedef struct _D3DLIGHT7 { - D3DLIGHTTYPE dltType; /* Type of light source */ - D3DCOLORVALUE dcvDiffuse; /* Diffuse color of light */ - D3DCOLORVALUE dcvSpecular; /* Specular color of light */ - D3DCOLORVALUE dcvAmbient; /* Ambient color of light */ - D3DVECTOR dvPosition; /* Position in world space */ - D3DVECTOR dvDirection; /* Direction in world space */ - D3DVALUE dvRange; /* Cutoff range */ - D3DVALUE dvFalloff; /* Falloff */ - D3DVALUE dvAttenuation0; /* Constant attenuation */ - D3DVALUE dvAttenuation1; /* Linear attenuation */ - D3DVALUE dvAttenuation2; /* Quadratic attenuation */ - D3DVALUE dvTheta; /* Inner angle of spotlight cone */ - D3DVALUE dvPhi; /* Outer angle of spotlight cone */ -} D3DLIGHT7, *LPD3DLIGHT7; - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION >= 0x0500) -/* - * Structure defining a light source and its properties. - */ - -/* flags bits */ -#define D3DLIGHT_ACTIVE 0x00000001 -#define D3DLIGHT_NO_SPECULAR 0x00000002 -#define D3DLIGHT_ALL (D3DLIGHT_ACTIVE | D3DLIGHT_NO_SPECULAR) - -/* maximum valid light range */ -#define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX)) - -typedef struct _D3DLIGHT2 { - DWORD dwSize; - D3DLIGHTTYPE dltType; /* Type of light source */ - D3DCOLORVALUE dcvColor; /* Color of light */ - D3DVECTOR dvPosition; /* Position in world space */ - D3DVECTOR dvDirection; /* Direction in world space */ - D3DVALUE dvRange; /* Cutoff range */ - D3DVALUE dvFalloff; /* Falloff */ - D3DVALUE dvAttenuation0; /* Constant attenuation */ - D3DVALUE dvAttenuation1; /* Linear attenuation */ - D3DVALUE dvAttenuation2; /* Quadratic attenuation */ - D3DVALUE dvTheta; /* Inner angle of spotlight cone */ - D3DVALUE dvPhi; /* Outer angle of spotlight cone */ - DWORD dwFlags; -} D3DLIGHT2, *LPD3DLIGHT2; - -#endif /* DIRECT3D_VERSION >= 0x0500 */ -typedef struct _D3DLIGHTDATA { - DWORD dwSize; - LPD3DLIGHTINGELEMENT lpIn; /* Input positions and normals */ - DWORD dwInSize; /* Stride of input elements */ - LPD3DTLVERTEX lpOut; /* Output colors */ - DWORD dwOutSize; /* Stride of output colors */ -} D3DLIGHTDATA, *LPD3DLIGHTDATA; - -#if(DIRECT3D_VERSION >= 0x0500) -/* - * Before DX5, these values were in an enum called - * D3DCOLORMODEL. This was not correct, since they are - * bit flags. A driver can surface either or both flags - * in the dcmColorModel member of D3DDEVICEDESC. - */ -#define D3DCOLOR_MONO 1 -#define D3DCOLOR_RGB 2 - -typedef DWORD D3DCOLORMODEL; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -/* - * Options for clearing - */ -#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ -#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ -#if(DIRECT3D_VERSION >= 0x0600) -#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Execute buffers are allocated via Direct3D. These buffers may then - * be filled by the application with instructions to execute along with - * vertex data. - */ - -/* - * Supported op codes for execute instructions. - */ -typedef enum _D3DOPCODE { - D3DOP_POINT = 1, - D3DOP_LINE = 2, - D3DOP_TRIANGLE = 3, - D3DOP_MATRIXLOAD = 4, - D3DOP_MATRIXMULTIPLY = 5, - D3DOP_STATETRANSFORM = 6, - D3DOP_STATELIGHT = 7, - D3DOP_STATERENDER = 8, - D3DOP_PROCESSVERTICES = 9, - D3DOP_TEXTURELOAD = 10, - D3DOP_EXIT = 11, - D3DOP_BRANCHFORWARD = 12, - D3DOP_SPAN = 13, - D3DOP_SETSTATUS = 14, -#if(DIRECT3D_VERSION >= 0x0500) - D3DOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DOPCODE; - -typedef struct _D3DINSTRUCTION { - BYTE bOpcode; /* Instruction opcode */ - BYTE bSize; /* Size of each instruction data unit */ - WORD wCount; /* Count of instruction data units to follow */ -} D3DINSTRUCTION, *LPD3DINSTRUCTION; - -/* - * Structure for texture loads - */ -typedef struct _D3DTEXTURELOAD { - D3DTEXTUREHANDLE hDestTexture; - D3DTEXTUREHANDLE hSrcTexture; -} D3DTEXTURELOAD, *LPD3DTEXTURELOAD; - -/* - * Structure for picking - */ -typedef struct _D3DPICKRECORD { - BYTE bOpcode; - BYTE bPad; - DWORD dwOffset; - D3DVALUE dvZ; -} D3DPICKRECORD, *LPD3DPICKRECORD; - -/* - * The following defines the rendering states which can be set in the - * execute buffer. - */ - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DSHADEMODE { - D3DSHADE_FLAT = 1, - D3DSHADE_GOURAUD = 2, - D3DSHADE_PHONG = 3, -#if(DIRECT3D_VERSION >= 0x0500) - D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DSHADEMODE; - -typedef enum _D3DFILLMODE { - D3DFILL_POINT = 1, - D3DFILL_WIREFRAME = 2, - D3DFILL_SOLID = 3, -#if(DIRECT3D_VERSION >= 0x0500) - D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DFILLMODE; - -typedef struct _D3DLINEPATTERN { - WORD wRepeatFactor; - WORD wLinePattern; -} D3DLINEPATTERN; - -#endif //(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DTEXTUREFILTER { - D3DFILTER_NEAREST = 1, - D3DFILTER_LINEAR = 2, - D3DFILTER_MIPNEAREST = 3, - D3DFILTER_MIPLINEAR = 4, - D3DFILTER_LINEARMIPNEAREST = 5, - D3DFILTER_LINEARMIPLINEAR = 6, -#if(DIRECT3D_VERSION >= 0x0500) - D3DFILTER_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTEXTUREFILTER; - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DBLEND { - D3DBLEND_ZERO = 1, - D3DBLEND_ONE = 2, - D3DBLEND_SRCCOLOR = 3, - D3DBLEND_INVSRCCOLOR = 4, - D3DBLEND_SRCALPHA = 5, - D3DBLEND_INVSRCALPHA = 6, - D3DBLEND_DESTALPHA = 7, - D3DBLEND_INVDESTALPHA = 8, - D3DBLEND_DESTCOLOR = 9, - D3DBLEND_INVDESTCOLOR = 10, - D3DBLEND_SRCALPHASAT = 11, - D3DBLEND_BOTHSRCALPHA = 12, - D3DBLEND_BOTHINVSRCALPHA = 13, -#if(DIRECT3D_VERSION >= 0x0500) - D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DBLEND; - -#endif //(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DTEXTUREBLEND { - D3DTBLEND_DECAL = 1, - D3DTBLEND_MODULATE = 2, - D3DTBLEND_DECALALPHA = 3, - D3DTBLEND_MODULATEALPHA = 4, - D3DTBLEND_DECALMASK = 5, - D3DTBLEND_MODULATEMASK = 6, - D3DTBLEND_COPY = 7, -#if(DIRECT3D_VERSION >= 0x0500) - D3DTBLEND_ADD = 8, - D3DTBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTEXTUREBLEND; - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DTEXTUREADDRESS { - D3DTADDRESS_WRAP = 1, - D3DTADDRESS_MIRROR = 2, - D3DTADDRESS_CLAMP = 3, -#if(DIRECT3D_VERSION >= 0x0500) - D3DTADDRESS_BORDER = 4, - D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTEXTUREADDRESS; - -typedef enum _D3DCULL { - D3DCULL_NONE = 1, - D3DCULL_CW = 2, - D3DCULL_CCW = 3, -#if(DIRECT3D_VERSION >= 0x0500) - D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DCULL; - -typedef enum _D3DCMPFUNC { - D3DCMP_NEVER = 1, - D3DCMP_LESS = 2, - D3DCMP_EQUAL = 3, - D3DCMP_LESSEQUAL = 4, - D3DCMP_GREATER = 5, - D3DCMP_NOTEQUAL = 6, - D3DCMP_GREATEREQUAL = 7, - D3DCMP_ALWAYS = 8, -#if(DIRECT3D_VERSION >= 0x0500) - D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DCMPFUNC; - -#if(DIRECT3D_VERSION >= 0x0600) -typedef enum _D3DSTENCILOP { - D3DSTENCILOP_KEEP = 1, - D3DSTENCILOP_ZERO = 2, - D3DSTENCILOP_REPLACE = 3, - D3DSTENCILOP_INCRSAT = 4, - D3DSTENCILOP_DECRSAT = 5, - D3DSTENCILOP_INVERT = 6, - D3DSTENCILOP_INCR = 7, - D3DSTENCILOP_DECR = 8, - D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSTENCILOP; -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -typedef enum _D3DFOGMODE { - D3DFOG_NONE = 0, - D3DFOG_EXP = 1, - D3DFOG_EXP2 = 2, -#if(DIRECT3D_VERSION >= 0x0500) - D3DFOG_LINEAR = 3, - D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DFOGMODE; - -#if(DIRECT3D_VERSION >= 0x0600) -typedef enum _D3DZBUFFERTYPE { - D3DZB_FALSE = 0, - D3DZB_TRUE = 1, // Z buffering - D3DZB_USEW = 2, // W buffering - D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DZBUFFERTYPE; -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#endif //(DIRECT3D_VERSION < 0x0800) - -#if(DIRECT3D_VERSION >= 0x0500) -typedef enum _D3DANTIALIASMODE { - D3DANTIALIAS_NONE = 0, - D3DANTIALIAS_SORTDEPENDENT = 1, - D3DANTIALIAS_SORTINDEPENDENT = 2, - D3DANTIALIAS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DANTIALIASMODE; - -// Vertex types supported by Direct3D -typedef enum _D3DVERTEXTYPE { - D3DVT_VERTEX = 1, - D3DVT_LVERTEX = 2, - D3DVT_TLVERTEX = 3, - D3DVT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DVERTEXTYPE; - -#if(DIRECT3D_VERSION < 0x0800) - -// Primitives supported by draw-primitive API -typedef enum _D3DPRIMITIVETYPE { - D3DPT_POINTLIST = 1, - D3DPT_LINELIST = 2, - D3DPT_LINESTRIP = 3, - D3DPT_TRIANGLELIST = 4, - D3DPT_TRIANGLESTRIP = 5, - D3DPT_TRIANGLEFAN = 6, - D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DPRIMITIVETYPE; - -#endif //(DIRECT3D_VERSION < 0x0800) - -#endif /* DIRECT3D_VERSION >= 0x0500 */ -/* - * Amount to add to a state to generate the override for that state. - */ -#define D3DSTATE_OVERRIDE_BIAS 256 - -/* - * A state which sets the override flag for the specified state type. - */ -#define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS)) - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DTRANSFORMSTATETYPE { - D3DTRANSFORMSTATE_WORLD = 1, - D3DTRANSFORMSTATE_VIEW = 2, - D3DTRANSFORMSTATE_PROJECTION = 3, -#if(DIRECT3D_VERSION >= 0x0700) - D3DTRANSFORMSTATE_WORLD1 = 4, // 2nd matrix to blend - D3DTRANSFORMSTATE_WORLD2 = 5, // 3rd matrix to blend - D3DTRANSFORMSTATE_WORLD3 = 6, // 4th matrix to blend - D3DTRANSFORMSTATE_TEXTURE0 = 16, - D3DTRANSFORMSTATE_TEXTURE1 = 17, - D3DTRANSFORMSTATE_TEXTURE2 = 18, - D3DTRANSFORMSTATE_TEXTURE3 = 19, - D3DTRANSFORMSTATE_TEXTURE4 = 20, - D3DTRANSFORMSTATE_TEXTURE5 = 21, - D3DTRANSFORMSTATE_TEXTURE6 = 22, - D3DTRANSFORMSTATE_TEXTURE7 = 23, -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DTRANSFORMSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTRANSFORMSTATETYPE; - -#else - -// -// legacy transform state names -// -typedef enum _D3DTRANSFORMSTATETYPE D3DTRANSFORMSTATETYPE; -#define D3DTRANSFORMSTATE_WORLD (D3DTRANSFORMSTATETYPE)1 -#define D3DTRANSFORMSTATE_VIEW (D3DTRANSFORMSTATETYPE)2 -#define D3DTRANSFORMSTATE_PROJECTION (D3DTRANSFORMSTATETYPE)3 -#define D3DTRANSFORMSTATE_WORLD1 (D3DTRANSFORMSTATETYPE)4 -#define D3DTRANSFORMSTATE_WORLD2 (D3DTRANSFORMSTATETYPE)5 -#define D3DTRANSFORMSTATE_WORLD3 (D3DTRANSFORMSTATETYPE)6 -#define D3DTRANSFORMSTATE_TEXTURE0 (D3DTRANSFORMSTATETYPE)16 -#define D3DTRANSFORMSTATE_TEXTURE1 (D3DTRANSFORMSTATETYPE)17 -#define D3DTRANSFORMSTATE_TEXTURE2 (D3DTRANSFORMSTATETYPE)18 -#define D3DTRANSFORMSTATE_TEXTURE3 (D3DTRANSFORMSTATETYPE)19 -#define D3DTRANSFORMSTATE_TEXTURE4 (D3DTRANSFORMSTATETYPE)20 -#define D3DTRANSFORMSTATE_TEXTURE5 (D3DTRANSFORMSTATETYPE)21 -#define D3DTRANSFORMSTATE_TEXTURE6 (D3DTRANSFORMSTATETYPE)22 -#define D3DTRANSFORMSTATE_TEXTURE7 (D3DTRANSFORMSTATETYPE)23 - -#endif //(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DLIGHTSTATETYPE { - D3DLIGHTSTATE_MATERIAL = 1, - D3DLIGHTSTATE_AMBIENT = 2, - D3DLIGHTSTATE_COLORMODEL = 3, - D3DLIGHTSTATE_FOGMODE = 4, - D3DLIGHTSTATE_FOGSTART = 5, - D3DLIGHTSTATE_FOGEND = 6, - D3DLIGHTSTATE_FOGDENSITY = 7, -#if(DIRECT3D_VERSION >= 0x0600) - D3DLIGHTSTATE_COLORVERTEX = 8, -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DLIGHTSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DLIGHTSTATETYPE; - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DRENDERSTATETYPE { - D3DRENDERSTATE_ANTIALIAS = 2, /* D3DANTIALIASMODE */ - D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4, /* TRUE for perspective correction */ - D3DRENDERSTATE_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */ - D3DRENDERSTATE_FILLMODE = 8, /* D3DFILL_MODE */ - D3DRENDERSTATE_SHADEMODE = 9, /* D3DSHADEMODE */ - D3DRENDERSTATE_LINEPATTERN = 10, /* D3DLINEPATTERN */ - D3DRENDERSTATE_ZWRITEENABLE = 14, /* TRUE to enable z writes */ - D3DRENDERSTATE_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ - D3DRENDERSTATE_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ - D3DRENDERSTATE_SRCBLEND = 19, /* D3DBLEND */ - D3DRENDERSTATE_DESTBLEND = 20, /* D3DBLEND */ - D3DRENDERSTATE_CULLMODE = 22, /* D3DCULL */ - D3DRENDERSTATE_ZFUNC = 23, /* D3DCMPFUNC */ - D3DRENDERSTATE_ALPHAREF = 24, /* D3DFIXED */ - D3DRENDERSTATE_ALPHAFUNC = 25, /* D3DCMPFUNC */ - D3DRENDERSTATE_DITHERENABLE = 26, /* TRUE to enable dithering */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DRENDERSTATE_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ - D3DRENDERSTATE_FOGENABLE = 28, /* TRUE to enable fog blending */ - D3DRENDERSTATE_SPECULARENABLE = 29, /* TRUE to enable specular */ - D3DRENDERSTATE_ZVISIBLE = 30, /* TRUE to enable z checking */ - D3DRENDERSTATE_STIPPLEDALPHA = 33, /* TRUE to enable stippled alpha (RGB device only) */ - D3DRENDERSTATE_FOGCOLOR = 34, /* D3DCOLOR */ - D3DRENDERSTATE_FOGTABLEMODE = 35, /* D3DFOGMODE */ -#if(DIRECT3D_VERSION >= 0x0700) - D3DRENDERSTATE_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */ - D3DRENDERSTATE_FOGEND = 37, /* Fog end */ - D3DRENDERSTATE_FOGDENSITY = 38, /* Fog density */ -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DRENDERSTATE_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */ - D3DRENDERSTATE_COLORKEYENABLE = 41, /* TRUE to enable source colorkeyed textures */ - D3DRENDERSTATE_ZBIAS = 47, /* LONG Z bias */ - D3DRENDERSTATE_RANGEFOGENABLE = 48, /* Enables range-based fog */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - D3DRENDERSTATE_STENCILENABLE = 52, /* BOOL enable/disable stenciling */ - D3DRENDERSTATE_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */ - D3DRENDERSTATE_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */ - D3DRENDERSTATE_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */ - D3DRENDERSTATE_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ - D3DRENDERSTATE_STENCILREF = 57, /* Reference value used in stencil test */ - D3DRENDERSTATE_STENCILMASK = 58, /* Mask value used in stencil test */ - D3DRENDERSTATE_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */ - D3DRENDERSTATE_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */ -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0600) - - /* - * 128 values [128, 255] are reserved for texture coordinate wrap flags. - * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using - * a flags word preserves forward compatibility with texture coordinates - * that are >2D. - */ - D3DRENDERSTATE_WRAP0 = 128, /* wrap for 1st texture coord. set */ - D3DRENDERSTATE_WRAP1 = 129, /* wrap for 2nd texture coord. set */ - D3DRENDERSTATE_WRAP2 = 130, /* wrap for 3rd texture coord. set */ - D3DRENDERSTATE_WRAP3 = 131, /* wrap for 4th texture coord. set */ - D3DRENDERSTATE_WRAP4 = 132, /* wrap for 5th texture coord. set */ - D3DRENDERSTATE_WRAP5 = 133, /* wrap for 6th texture coord. set */ - D3DRENDERSTATE_WRAP6 = 134, /* wrap for 7th texture coord. set */ - D3DRENDERSTATE_WRAP7 = 135, /* wrap for 8th texture coord. set */ -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) - D3DRENDERSTATE_CLIPPING = 136, - D3DRENDERSTATE_LIGHTING = 137, - D3DRENDERSTATE_EXTENTS = 138, - D3DRENDERSTATE_AMBIENT = 139, - D3DRENDERSTATE_FOGVERTEXMODE = 140, - D3DRENDERSTATE_COLORVERTEX = 141, - D3DRENDERSTATE_LOCALVIEWER = 142, - D3DRENDERSTATE_NORMALIZENORMALS = 143, - D3DRENDERSTATE_COLORKEYBLENDENABLE = 144, - D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145, - D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146, - D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147, - D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148, - D3DRENDERSTATE_VERTEXBLEND = 151, - D3DRENDERSTATE_CLIPPLANEENABLE = 152, - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -// -// retired renderstates - not supported for DX7 interfaces -// - D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle for legacy interfaces (Texture,Texture2) */ - D3DRENDERSTATE_TEXTUREADDRESS = 3, /* D3DTEXTUREADDRESS */ - D3DRENDERSTATE_WRAPU = 5, /* TRUE for wrapping in u */ - D3DRENDERSTATE_WRAPV = 6, /* TRUE for wrapping in v */ - D3DRENDERSTATE_MONOENABLE = 11, /* TRUE to enable mono rasterization */ - D3DRENDERSTATE_ROP2 = 12, /* ROP2 */ - D3DRENDERSTATE_PLANEMASK = 13, /* DWORD physical plane mask */ - D3DRENDERSTATE_TEXTUREMAG = 17, /* D3DTEXTUREFILTER */ - D3DRENDERSTATE_TEXTUREMIN = 18, /* D3DTEXTUREFILTER */ - D3DRENDERSTATE_TEXTUREMAPBLEND = 21, /* D3DTEXTUREBLEND */ - D3DRENDERSTATE_SUBPIXEL = 31, /* TRUE to enable subpixel correction */ - D3DRENDERSTATE_SUBPIXELX = 32, /* TRUE to enable correction in X only */ - D3DRENDERSTATE_STIPPLEENABLE = 39, /* TRUE to enable stippling */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DRENDERSTATE_BORDERCOLOR = 43, /* Border color for texturing w/border */ - D3DRENDERSTATE_TEXTUREADDRESSU = 44, /* Texture addressing mode for U coordinate */ - D3DRENDERSTATE_TEXTUREADDRESSV = 45, /* Texture addressing mode for V coordinate */ - D3DRENDERSTATE_MIPMAPLODBIAS = 46, /* D3DVALUE Mipmap LOD bias */ - D3DRENDERSTATE_ANISOTROPY = 49, /* Max. anisotropy. 1 = no anisotropy */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ - D3DRENDERSTATE_FLUSHBATCH = 50, /* Explicit flush for DP batching (DX5 Only) */ -#if(DIRECT3D_VERSION >= 0x0600) - D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51, /* BOOL enable sort-independent transparency */ -#endif /* DIRECT3D_VERSION >= 0x0600 */ - D3DRENDERSTATE_STIPPLEPATTERN00 = 64, /* Stipple pattern 01... */ - D3DRENDERSTATE_STIPPLEPATTERN01 = 65, - D3DRENDERSTATE_STIPPLEPATTERN02 = 66, - D3DRENDERSTATE_STIPPLEPATTERN03 = 67, - D3DRENDERSTATE_STIPPLEPATTERN04 = 68, - D3DRENDERSTATE_STIPPLEPATTERN05 = 69, - D3DRENDERSTATE_STIPPLEPATTERN06 = 70, - D3DRENDERSTATE_STIPPLEPATTERN07 = 71, - D3DRENDERSTATE_STIPPLEPATTERN08 = 72, - D3DRENDERSTATE_STIPPLEPATTERN09 = 73, - D3DRENDERSTATE_STIPPLEPATTERN10 = 74, - D3DRENDERSTATE_STIPPLEPATTERN11 = 75, - D3DRENDERSTATE_STIPPLEPATTERN12 = 76, - D3DRENDERSTATE_STIPPLEPATTERN13 = 77, - D3DRENDERSTATE_STIPPLEPATTERN14 = 78, - D3DRENDERSTATE_STIPPLEPATTERN15 = 79, - D3DRENDERSTATE_STIPPLEPATTERN16 = 80, - D3DRENDERSTATE_STIPPLEPATTERN17 = 81, - D3DRENDERSTATE_STIPPLEPATTERN18 = 82, - D3DRENDERSTATE_STIPPLEPATTERN19 = 83, - D3DRENDERSTATE_STIPPLEPATTERN20 = 84, - D3DRENDERSTATE_STIPPLEPATTERN21 = 85, - D3DRENDERSTATE_STIPPLEPATTERN22 = 86, - D3DRENDERSTATE_STIPPLEPATTERN23 = 87, - D3DRENDERSTATE_STIPPLEPATTERN24 = 88, - D3DRENDERSTATE_STIPPLEPATTERN25 = 89, - D3DRENDERSTATE_STIPPLEPATTERN26 = 90, - D3DRENDERSTATE_STIPPLEPATTERN27 = 91, - D3DRENDERSTATE_STIPPLEPATTERN28 = 92, - D3DRENDERSTATE_STIPPLEPATTERN29 = 93, - D3DRENDERSTATE_STIPPLEPATTERN30 = 94, - D3DRENDERSTATE_STIPPLEPATTERN31 = 95, - -// -// retired renderstate names - the values are still used under new naming conventions -// - D3DRENDERSTATE_FOGTABLESTART = 36, /* Fog table start */ - D3DRENDERSTATE_FOGTABLEEND = 37, /* Fog table end */ - D3DRENDERSTATE_FOGTABLEDENSITY = 38, /* Fog table density */ - -#if(DIRECT3D_VERSION >= 0x0500) - D3DRENDERSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DRENDERSTATETYPE; - -#else - -typedef enum _D3DRENDERSTATETYPE D3DRENDERSTATETYPE; - -// -// legacy renderstate names -// -#define D3DRENDERSTATE_TEXTUREPERSPECTIVE (D3DRENDERSTATETYPE)4 -#define D3DRENDERSTATE_ZENABLE (D3DRENDERSTATETYPE)7 -#define D3DRENDERSTATE_FILLMODE (D3DRENDERSTATETYPE)8 -#define D3DRENDERSTATE_SHADEMODE (D3DRENDERSTATETYPE)9 -#define D3DRENDERSTATE_LINEPATTERN (D3DRENDERSTATETYPE)10 -#define D3DRENDERSTATE_ZWRITEENABLE (D3DRENDERSTATETYPE)14 -#define D3DRENDERSTATE_ALPHATESTENABLE (D3DRENDERSTATETYPE)15 -#define D3DRENDERSTATE_LASTPIXEL (D3DRENDERSTATETYPE)16 -#define D3DRENDERSTATE_SRCBLEND (D3DRENDERSTATETYPE)19 -#define D3DRENDERSTATE_DESTBLEND (D3DRENDERSTATETYPE)20 -#define D3DRENDERSTATE_CULLMODE (D3DRENDERSTATETYPE)22 -#define D3DRENDERSTATE_ZFUNC (D3DRENDERSTATETYPE)23 -#define D3DRENDERSTATE_ALPHAREF (D3DRENDERSTATETYPE)24 -#define D3DRENDERSTATE_ALPHAFUNC (D3DRENDERSTATETYPE)25 -#define D3DRENDERSTATE_DITHERENABLE (D3DRENDERSTATETYPE)26 -#define D3DRENDERSTATE_ALPHABLENDENABLE (D3DRENDERSTATETYPE)27 -#define D3DRENDERSTATE_FOGENABLE (D3DRENDERSTATETYPE)28 -#define D3DRENDERSTATE_SPECULARENABLE (D3DRENDERSTATETYPE)29 -#define D3DRENDERSTATE_ZVISIBLE (D3DRENDERSTATETYPE)30 -#define D3DRENDERSTATE_STIPPLEDALPHA (D3DRENDERSTATETYPE)33 -#define D3DRENDERSTATE_FOGCOLOR (D3DRENDERSTATETYPE)34 -#define D3DRENDERSTATE_FOGTABLEMODE (D3DRENDERSTATETYPE)35 -#define D3DRENDERSTATE_FOGSTART (D3DRENDERSTATETYPE)36 -#define D3DRENDERSTATE_FOGEND (D3DRENDERSTATETYPE)37 -#define D3DRENDERSTATE_FOGDENSITY (D3DRENDERSTATETYPE)38 -#define D3DRENDERSTATE_EDGEANTIALIAS (D3DRENDERSTATETYPE)40 -#define D3DRENDERSTATE_ZBIAS (D3DRENDERSTATETYPE)47 -#define D3DRENDERSTATE_RANGEFOGENABLE (D3DRENDERSTATETYPE)48 -#define D3DRENDERSTATE_STENCILENABLE (D3DRENDERSTATETYPE)52 -#define D3DRENDERSTATE_STENCILFAIL (D3DRENDERSTATETYPE)53 -#define D3DRENDERSTATE_STENCILZFAIL (D3DRENDERSTATETYPE)54 -#define D3DRENDERSTATE_STENCILPASS (D3DRENDERSTATETYPE)55 -#define D3DRENDERSTATE_STENCILFUNC (D3DRENDERSTATETYPE)56 -#define D3DRENDERSTATE_STENCILREF (D3DRENDERSTATETYPE)57 -#define D3DRENDERSTATE_STENCILMASK (D3DRENDERSTATETYPE)58 -#define D3DRENDERSTATE_STENCILWRITEMASK (D3DRENDERSTATETYPE)59 -#define D3DRENDERSTATE_TEXTUREFACTOR (D3DRENDERSTATETYPE)60 -#define D3DRENDERSTATE_WRAP0 (D3DRENDERSTATETYPE)128 -#define D3DRENDERSTATE_WRAP1 (D3DRENDERSTATETYPE)129 -#define D3DRENDERSTATE_WRAP2 (D3DRENDERSTATETYPE)130 -#define D3DRENDERSTATE_WRAP3 (D3DRENDERSTATETYPE)131 -#define D3DRENDERSTATE_WRAP4 (D3DRENDERSTATETYPE)132 -#define D3DRENDERSTATE_WRAP5 (D3DRENDERSTATETYPE)133 -#define D3DRENDERSTATE_WRAP6 (D3DRENDERSTATETYPE)134 -#define D3DRENDERSTATE_WRAP7 (D3DRENDERSTATETYPE)135 - -#define D3DRENDERSTATE_CLIPPING (D3DRENDERSTATETYPE)136 -#define D3DRENDERSTATE_LIGHTING (D3DRENDERSTATETYPE)137 -#define D3DRENDERSTATE_EXTENTS (D3DRENDERSTATETYPE)138 -#define D3DRENDERSTATE_AMBIENT (D3DRENDERSTATETYPE)139 -#define D3DRENDERSTATE_FOGVERTEXMODE (D3DRENDERSTATETYPE)140 -#define D3DRENDERSTATE_COLORVERTEX (D3DRENDERSTATETYPE)141 -#define D3DRENDERSTATE_LOCALVIEWER (D3DRENDERSTATETYPE)142 -#define D3DRENDERSTATE_NORMALIZENORMALS (D3DRENDERSTATETYPE)143 -#define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144 -#define D3DRENDERSTATE_DIFFUSEMATERIALSOURCE (D3DRENDERSTATETYPE)145 -#define D3DRENDERSTATE_SPECULARMATERIALSOURCE (D3DRENDERSTATETYPE)146 -#define D3DRENDERSTATE_AMBIENTMATERIALSOURCE (D3DRENDERSTATETYPE)147 -#define D3DRENDERSTATE_EMISSIVEMATERIALSOURCE (D3DRENDERSTATETYPE)148 -#define D3DRENDERSTATE_VERTEXBLEND (D3DRENDERSTATETYPE)151 -#define D3DRENDERSTATE_CLIPPLANEENABLE (D3DRENDERSTATETYPE)152 - -// -// retired renderstates - not supported for DX7 interfaces -// -#define D3DRENDERSTATE_TEXTUREHANDLE (D3DRENDERSTATETYPE)1 -#define D3DRENDERSTATE_ANTIALIAS (D3DRENDERSTATETYPE)2 -#define D3DRENDERSTATE_TEXTUREADDRESS (D3DRENDERSTATETYPE)3 -#define D3DRENDERSTATE_WRAPU (D3DRENDERSTATETYPE)5 -#define D3DRENDERSTATE_WRAPV (D3DRENDERSTATETYPE)6 -#define D3DRENDERSTATE_MONOENABLE (D3DRENDERSTATETYPE)11 -#define D3DRENDERSTATE_ROP2 (D3DRENDERSTATETYPE)12 -#define D3DRENDERSTATE_PLANEMASK (D3DRENDERSTATETYPE)13 -#define D3DRENDERSTATE_TEXTUREMAG (D3DRENDERSTATETYPE)17 -#define D3DRENDERSTATE_TEXTUREMIN (D3DRENDERSTATETYPE)18 -#define D3DRENDERSTATE_TEXTUREMAPBLEND (D3DRENDERSTATETYPE)21 -#define D3DRENDERSTATE_SUBPIXEL (D3DRENDERSTATETYPE)31 -#define D3DRENDERSTATE_SUBPIXELX (D3DRENDERSTATETYPE)32 -#define D3DRENDERSTATE_STIPPLEENABLE (D3DRENDERSTATETYPE)39 -#define D3DRENDERSTATE_OLDALPHABLENDENABLE (D3DRENDERSTATETYPE)42 -#define D3DRENDERSTATE_BORDERCOLOR (D3DRENDERSTATETYPE)43 -#define D3DRENDERSTATE_TEXTUREADDRESSU (D3DRENDERSTATETYPE)44 -#define D3DRENDERSTATE_TEXTUREADDRESSV (D3DRENDERSTATETYPE)45 -#define D3DRENDERSTATE_MIPMAPLODBIAS (D3DRENDERSTATETYPE)46 -#define D3DRENDERSTATE_ANISOTROPY (D3DRENDERSTATETYPE)49 -#define D3DRENDERSTATE_FLUSHBATCH (D3DRENDERSTATETYPE)50 -#define D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT (D3DRENDERSTATETYPE)51 -#define D3DRENDERSTATE_STIPPLEPATTERN00 (D3DRENDERSTATETYPE)64 -#define D3DRENDERSTATE_STIPPLEPATTERN01 (D3DRENDERSTATETYPE)65 -#define D3DRENDERSTATE_STIPPLEPATTERN02 (D3DRENDERSTATETYPE)66 -#define D3DRENDERSTATE_STIPPLEPATTERN03 (D3DRENDERSTATETYPE)67 -#define D3DRENDERSTATE_STIPPLEPATTERN04 (D3DRENDERSTATETYPE)68 -#define D3DRENDERSTATE_STIPPLEPATTERN05 (D3DRENDERSTATETYPE)69 -#define D3DRENDERSTATE_STIPPLEPATTERN06 (D3DRENDERSTATETYPE)70 -#define D3DRENDERSTATE_STIPPLEPATTERN07 (D3DRENDERSTATETYPE)71 -#define D3DRENDERSTATE_STIPPLEPATTERN08 (D3DRENDERSTATETYPE)72 -#define D3DRENDERSTATE_STIPPLEPATTERN09 (D3DRENDERSTATETYPE)73 -#define D3DRENDERSTATE_STIPPLEPATTERN10 (D3DRENDERSTATETYPE)74 -#define D3DRENDERSTATE_STIPPLEPATTERN11 (D3DRENDERSTATETYPE)75 -#define D3DRENDERSTATE_STIPPLEPATTERN12 (D3DRENDERSTATETYPE)76 -#define D3DRENDERSTATE_STIPPLEPATTERN13 (D3DRENDERSTATETYPE)77 -#define D3DRENDERSTATE_STIPPLEPATTERN14 (D3DRENDERSTATETYPE)78 -#define D3DRENDERSTATE_STIPPLEPATTERN15 (D3DRENDERSTATETYPE)79 -#define D3DRENDERSTATE_STIPPLEPATTERN16 (D3DRENDERSTATETYPE)80 -#define D3DRENDERSTATE_STIPPLEPATTERN17 (D3DRENDERSTATETYPE)81 -#define D3DRENDERSTATE_STIPPLEPATTERN18 (D3DRENDERSTATETYPE)82 -#define D3DRENDERSTATE_STIPPLEPATTERN19 (D3DRENDERSTATETYPE)83 -#define D3DRENDERSTATE_STIPPLEPATTERN20 (D3DRENDERSTATETYPE)84 -#define D3DRENDERSTATE_STIPPLEPATTERN21 (D3DRENDERSTATETYPE)85 -#define D3DRENDERSTATE_STIPPLEPATTERN22 (D3DRENDERSTATETYPE)86 -#define D3DRENDERSTATE_STIPPLEPATTERN23 (D3DRENDERSTATETYPE)87 -#define D3DRENDERSTATE_STIPPLEPATTERN24 (D3DRENDERSTATETYPE)88 -#define D3DRENDERSTATE_STIPPLEPATTERN25 (D3DRENDERSTATETYPE)89 -#define D3DRENDERSTATE_STIPPLEPATTERN26 (D3DRENDERSTATETYPE)90 -#define D3DRENDERSTATE_STIPPLEPATTERN27 (D3DRENDERSTATETYPE)91 -#define D3DRENDERSTATE_STIPPLEPATTERN28 (D3DRENDERSTATETYPE)92 -#define D3DRENDERSTATE_STIPPLEPATTERN29 (D3DRENDERSTATETYPE)93 -#define D3DRENDERSTATE_STIPPLEPATTERN30 (D3DRENDERSTATETYPE)94 -#define D3DRENDERSTATE_STIPPLEPATTERN31 (D3DRENDERSTATETYPE)95 - -// -// retired renderstates - not supported for DX8 interfaces -// -#define D3DRENDERSTATE_COLORKEYENABLE (D3DRENDERSTATETYPE)41 -#define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144 - -// -// retired renderstate names - the values are still used under new naming conventions -// -#define D3DRENDERSTATE_BLENDENABLE (D3DRENDERSTATETYPE)27 -#define D3DRENDERSTATE_FOGTABLESTART (D3DRENDERSTATETYPE)36 -#define D3DRENDERSTATE_FOGTABLEEND (D3DRENDERSTATETYPE)37 -#define D3DRENDERSTATE_FOGTABLEDENSITY (D3DRENDERSTATETYPE)38 - -#endif //(DIRECT3D_VERSION < 0x0800) - - -#if(DIRECT3D_VERSION < 0x0800) - -// Values for material source -typedef enum _D3DMATERIALCOLORSOURCE -{ - D3DMCS_MATERIAL = 0, // Color from material is used - D3DMCS_COLOR1 = 1, // Diffuse vertex color is used - D3DMCS_COLOR2 = 2, // Specular vertex color is used - D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DMATERIALCOLORSOURCE; - - -#if(DIRECT3D_VERSION >= 0x0500) -// For back-compatibility with legacy compilations -#define D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATE_ALPHABLENDENABLE -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - -// Bias to apply to the texture coordinate set to apply a wrap to. -#define D3DRENDERSTATE_WRAPBIAS 128UL - -/* Flags to construct the WRAP render states */ -#define D3DWRAP_U 0x00000001L -#define D3DWRAP_V 0x00000002L - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) - -/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ -#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U -#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V -#define D3DWRAPCOORD_2 0x00000004L -#define D3DWRAPCOORD_3 0x00000008L - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#endif //(DIRECT3D_VERSION < 0x0800) - -#define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y)) - -typedef struct _D3DSTATE { - union { -#if(DIRECT3D_VERSION < 0x0800) - D3DTRANSFORMSTATETYPE dtstTransformStateType; -#endif //(DIRECT3D_VERSION < 0x0800) - D3DLIGHTSTATETYPE dlstLightStateType; - D3DRENDERSTATETYPE drstRenderStateType; - }; - union { - DWORD dwArg[1]; - D3DVALUE dvArg[1]; - }; -} D3DSTATE, *LPD3DSTATE; - - -/* - * Operation used to load matrices - * hDstMat = hSrcMat - */ -typedef struct _D3DMATRIXLOAD { - D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */ - D3DMATRIXHANDLE hSrcMatrix; /* Source matrix */ -} D3DMATRIXLOAD, *LPD3DMATRIXLOAD; - -/* - * Operation used to multiply matrices - * hDstMat = hSrcMat1 * hSrcMat2 - */ -typedef struct _D3DMATRIXMULTIPLY { - D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */ - D3DMATRIXHANDLE hSrcMatrix1; /* First source matrix */ - D3DMATRIXHANDLE hSrcMatrix2; /* Second source matrix */ -} D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY; - -/* - * Operation used to transform and light vertices. - */ -typedef struct _D3DPROCESSVERTICES { - DWORD dwFlags; /* Do we transform or light or just copy? */ - WORD wStart; /* Index to first vertex in source */ - WORD wDest; /* Index to first vertex in local buffer */ - DWORD dwCount; /* Number of vertices to be processed */ - DWORD dwReserved; /* Must be zero */ -} D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES; - -#define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L -#define D3DPROCESSVERTICES_TRANSFORM 0x00000001L -#define D3DPROCESSVERTICES_COPY 0x00000002L -#define D3DPROCESSVERTICES_OPMASK 0x00000007L - -#define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L -#define D3DPROCESSVERTICES_NOCOLOR 0x00000010L - - -#if(DIRECT3D_VERSION >= 0x0600) - - -#if(DIRECT3D_VERSION < 0x0800) - -/* - * State enumerants for per-stage texture processing. - */ -typedef enum _D3DTEXTURESTAGESTATETYPE -{ - D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ - D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ - D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ - D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ - D3DTSS_BUMPENVMAT00 = 7, /* D3DVALUE (bump mapping matrix) */ - D3DTSS_BUMPENVMAT01 = 8, /* D3DVALUE (bump mapping matrix) */ - D3DTSS_BUMPENVMAT10 = 9, /* D3DVALUE (bump mapping matrix) */ - D3DTSS_BUMPENVMAT11 = 10, /* D3DVALUE (bump mapping matrix) */ - D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ - D3DTSS_ADDRESS = 12, /* D3DTEXTUREADDRESS for both coordinates */ - D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */ - D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */ - D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */ - D3DTSS_MAGFILTER = 16, /* D3DTEXTUREMAGFILTER filter to use for magnification */ - D3DTSS_MINFILTER = 17, /* D3DTEXTUREMINFILTER filter to use for minification */ - D3DTSS_MIPFILTER = 18, /* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification */ - D3DTSS_MIPMAPLODBIAS = 19, /* D3DVALUE Mipmap LOD bias */ - D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */ - D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */ - D3DTSS_BUMPENVLSCALE = 22, /* D3DVALUE scale for bump map luminance */ - D3DTSS_BUMPENVLOFFSET = 23, /* D3DVALUE offset for bump map luminance */ -#if(DIRECT3D_VERSION >= 0x0700) - D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ -#endif /* DIRECT3D_VERSION >= 0x0700 */ - D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTURESTAGESTATETYPE; - -#if(DIRECT3D_VERSION >= 0x0700) -// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position -// and normal in the camera space) should be taken as texture coordinates -// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from -// -#define D3DTSS_TCI_PASSTHRU 0x00000000 -#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 -#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 -#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000 -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* - * Enumerations for COLOROP and ALPHAOP texture blending operations set in - * texture processing stage controls in D3DRENDERSTATE. - */ -typedef enum _D3DTEXTUREOP -{ -// Control - D3DTOP_DISABLE = 1, // disables stage - D3DTOP_SELECTARG1 = 2, // the default - D3DTOP_SELECTARG2 = 3, - -// Modulate - D3DTOP_MODULATE = 4, // multiply args together - D3DTOP_MODULATE2X = 5, // multiply and 1 bit - D3DTOP_MODULATE4X = 6, // multiply and 2 bits - -// Add - D3DTOP_ADD = 7, // add arguments together - D3DTOP_ADDSIGNED = 8, // add with -0.5 bias - D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit - D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation - D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product - // Arg1 + Arg2 - Arg1*Arg2 - // = Arg1 + (1-Arg1)*Arg2 - -// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) - D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha - D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha - D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRENDERSTATE_TEXTUREFACTOR - // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) - D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha - D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color - -// Specular mapping - D3DTOP_PREMODULATE = 17, // modulate with next texture before use - D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB - // COLOROP only - D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A - // COLOROP only - D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB - // COLOROP only - D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A - // COLOROP only - -// Bump mapping - D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation - D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel - // This can do either diffuse or specular bump mapping with correct input. - // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) - // where each component has been scaled and offset to make it signed. - // The result is replicated into all four (including alpha) channels. - // This is a valid COLOROP only. - D3DTOP_DOTPRODUCT3 = 24, - - D3DTOP_FORCE_DWORD = 0x7fffffff, -} D3DTEXTUREOP; - -/* - * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations - * set in texture processing stage controls in D3DRENDERSTATE. - */ -#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector -#define D3DTA_DIFFUSE 0x00000000 // select diffuse color -#define D3DTA_CURRENT 0x00000001 // select result of previous stage -#define D3DTA_TEXTURE 0x00000002 // select texture color -#define D3DTA_TFACTOR 0x00000003 // select RENDERSTATE_TEXTUREFACTOR -#if(DIRECT3D_VERSION >= 0x0700) -#define D3DTA_SPECULAR 0x00000004 // select specular color -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x -#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components - -#endif //(DIRECT3D_VERSION < 0x0800) - -/* - * IDirect3DTexture2 State Filter Types - */ -typedef enum _D3DTEXTUREMAGFILTER -{ - D3DTFG_POINT = 1, // nearest - D3DTFG_LINEAR = 2, // linear interpolation - D3DTFG_FLATCUBIC = 3, // cubic - D3DTFG_GAUSSIANCUBIC = 4, // different cubic kernel - D3DTFG_ANISOTROPIC = 5, // -#if(DIRECT3D_VERSION >= 0x0700) -#endif /* DIRECT3D_VERSION >= 0x0700 */ - D3DTFG_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DTEXTUREMAGFILTER; - -typedef enum _D3DTEXTUREMINFILTER -{ - D3DTFN_POINT = 1, // nearest - D3DTFN_LINEAR = 2, // linear interpolation - D3DTFN_ANISOTROPIC = 3, // - D3DTFN_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DTEXTUREMINFILTER; - -typedef enum _D3DTEXTUREMIPFILTER -{ - D3DTFP_NONE = 1, // mipmapping disabled (use MAG filter) - D3DTFP_POINT = 2, // nearest - D3DTFP_LINEAR = 3, // linear interpolation - D3DTFP_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DTEXTUREMIPFILTER; - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Triangle flags - */ - -/* - * Tri strip and fan flags. - * START loads all three vertices - * EVEN and ODD load just v3 with even or odd culling - * START_FLAT contains a count from 0 to 29 that allows the - * whole strip or fan to be culled in one hit. - * e.g. for a quad len = 1 - */ -#define D3DTRIFLAG_START 0x00000000L -#define D3DTRIFLAG_STARTFLAT(len) (len) /* 0 < len < 30 */ -#define D3DTRIFLAG_ODD 0x0000001eL -#define D3DTRIFLAG_EVEN 0x0000001fL - -/* - * Triangle edge flags - * enable edges for wireframe or antialiasing - */ -#define D3DTRIFLAG_EDGEENABLE1 0x00000100L /* v0-v1 edge */ -#define D3DTRIFLAG_EDGEENABLE2 0x00000200L /* v1-v2 edge */ -#define D3DTRIFLAG_EDGEENABLE3 0x00000400L /* v2-v0 edge */ -#define D3DTRIFLAG_EDGEENABLETRIANGLE \ - (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3) - -/* - * Primitive structures and related defines. Vertex offsets are to types - * D3DVERTEX, D3DLVERTEX, or D3DTLVERTEX. - */ - -/* - * Triangle list primitive structure - */ -typedef struct _D3DTRIANGLE { - union { - WORD v1; /* Vertex indices */ - WORD wV1; - }; - union { - WORD v2; - WORD wV2; - }; - union { - WORD v3; - WORD wV3; - }; - WORD wFlags; /* Edge (and other) flags */ -} D3DTRIANGLE, *LPD3DTRIANGLE; - -/* - * Line list structure. - * The instruction count defines the number of line segments. - */ -typedef struct _D3DLINE { - union { - WORD v1; /* Vertex indices */ - WORD wV1; - }; - union { - WORD v2; - WORD wV2; - }; -} D3DLINE, *LPD3DLINE; - -/* - * Span structure - * Spans join a list of points with the same y value. - * If the y value changes, a new span is started. - */ -typedef struct _D3DSPAN { - WORD wCount; /* Number of spans */ - WORD wFirst; /* Index to first vertex */ -} D3DSPAN, *LPD3DSPAN; - -/* - * Point structure - */ -typedef struct _D3DPOINT { - WORD wCount; /* number of points */ - WORD wFirst; /* index to first vertex */ -} D3DPOINT, *LPD3DPOINT; - - -/* - * Forward branch structure. - * Mask is logically anded with the driver status mask - * if the result equals 'value', the branch is taken. - */ -typedef struct _D3DBRANCH { - DWORD dwMask; /* Bitmask against D3D status */ - DWORD dwValue; - BOOL bNegate; /* TRUE to negate comparison */ - DWORD dwOffset; /* How far to branch forward (0 for exit)*/ -} D3DBRANCH, *LPD3DBRANCH; - -/* - * Status used for set status instruction. - * The D3D status is initialised on device creation - * and is modified by all execute calls. - */ -typedef struct _D3DSTATUS { - DWORD dwFlags; /* Do we set extents or status */ - DWORD dwStatus; /* D3D status */ - D3DRECT drExtent; -} D3DSTATUS, *LPD3DSTATUS; - -#define D3DSETSTATUS_STATUS 0x00000001L -#define D3DSETSTATUS_EXTENTS 0x00000002L -#define D3DSETSTATUS_ALL (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS) - -#if(DIRECT3D_VERSION >= 0x0500) -typedef struct _D3DCLIPSTATUS { - DWORD dwFlags; /* Do we set 2d extents, 3D extents or status */ - DWORD dwStatus; /* Clip status */ - float minx, maxx; /* X extents */ - float miny, maxy; /* Y extents */ - float minz, maxz; /* Z extents */ -} D3DCLIPSTATUS, *LPD3DCLIPSTATUS; - -#define D3DCLIPSTATUS_STATUS 0x00000001L -#define D3DCLIPSTATUS_EXTENTS2 0x00000002L -#define D3DCLIPSTATUS_EXTENTS3 0x00000004L - -#endif /* DIRECT3D_VERSION >= 0x0500 */ -/* - * Statistics structure - */ -typedef struct _D3DSTATS { - DWORD dwSize; - DWORD dwTrianglesDrawn; - DWORD dwLinesDrawn; - DWORD dwPointsDrawn; - DWORD dwSpansDrawn; - DWORD dwVerticesProcessed; -} D3DSTATS, *LPD3DSTATS; - -/* - * Execute options. - * When calling using D3DEXECUTE_UNCLIPPED all the primitives - * inside the buffer must be contained within the viewport. - */ -#define D3DEXECUTE_CLIPPED 0x00000001l -#define D3DEXECUTE_UNCLIPPED 0x00000002l - -typedef struct _D3DEXECUTEDATA { - DWORD dwSize; - DWORD dwVertexOffset; - DWORD dwVertexCount; - DWORD dwInstructionOffset; - DWORD dwInstructionLength; - DWORD dwHVertexOffset; - D3DSTATUS dsStatus; /* Status after execute */ -} D3DEXECUTEDATA, *LPD3DEXECUTEDATA; - -/* - * Palette flags. - * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw. - */ -#define D3DPAL_FREE 0x00 /* Renderer may use this entry freely */ -#define D3DPAL_READONLY 0x40 /* Renderer may not set this entry */ -#define D3DPAL_RESERVED 0x80 /* Renderer may not use this entry */ - - -#if(DIRECT3D_VERSION >= 0x0600) - -typedef struct _D3DVERTEXBUFFERDESC { - DWORD dwSize; - DWORD dwCaps; - DWORD dwFVF; - DWORD dwNumVertices; -} D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC; - -#define D3DVBCAPS_SYSTEMMEMORY 0x00000800l -#define D3DVBCAPS_WRITEONLY 0x00010000l -#define D3DVBCAPS_OPTIMIZED 0x80000000l -#define D3DVBCAPS_DONOTCLIP 0x00000001l - -/* Vertex Operations for ProcessVertices */ -#define D3DVOP_LIGHT (1 << 10) -#define D3DVOP_TRANSFORM (1 << 0) -#define D3DVOP_CLIP (1 << 2) -#define D3DVOP_EXTENTS (1 << 3) - - -#if(DIRECT3D_VERSION < 0x0800) - -/* The maximum number of vertices user can pass to any d3d - drawing function or to create vertex buffer with -*/ -#define D3DMAXNUMVERTICES ((1<<16) - 1) -/* The maximum number of primitives user can pass to any d3d - drawing function. -*/ -#define D3DMAXNUMPRIMITIVES ((1<<16) - 1) - -#if(DIRECT3D_VERSION >= 0x0700) - -/* Bits for dwFlags in ProcessVertices call */ -#define D3DPV_DONOTCOPYDATA (1 << 0) - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#endif //(DIRECT3D_VERSION < 0x0800) - -//------------------------------------------------------------------- - -#if(DIRECT3D_VERSION < 0x0800) - -// Flexible vertex format bits -// -#define D3DFVF_RESERVED0 0x001 -#define D3DFVF_POSITION_MASK 0x00E -#define D3DFVF_XYZ 0x002 -#define D3DFVF_XYZRHW 0x004 -#if(DIRECT3D_VERSION >= 0x0700) -#define D3DFVF_XYZB1 0x006 -#define D3DFVF_XYZB2 0x008 -#define D3DFVF_XYZB3 0x00a -#define D3DFVF_XYZB4 0x00c -#define D3DFVF_XYZB5 0x00e - -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#define D3DFVF_NORMAL 0x010 -#define D3DFVF_RESERVED1 0x020 -#define D3DFVF_DIFFUSE 0x040 -#define D3DFVF_SPECULAR 0x080 - -#define D3DFVF_TEXCOUNT_MASK 0xf00 -#define D3DFVF_TEXCOUNT_SHIFT 8 -#define D3DFVF_TEX0 0x000 -#define D3DFVF_TEX1 0x100 -#define D3DFVF_TEX2 0x200 -#define D3DFVF_TEX3 0x300 -#define D3DFVF_TEX4 0x400 -#define D3DFVF_TEX5 0x500 -#define D3DFVF_TEX6 0x600 -#define D3DFVF_TEX7 0x700 -#define D3DFVF_TEX8 0x800 - -#define D3DFVF_RESERVED2 0xf000 // 4 reserved bits - -#else -#define D3DFVF_RESERVED1 0x020 -#endif //(DIRECT3D_VERSION < 0x0800) - -#define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 ) -#define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \ - D3DFVF_SPECULAR | D3DFVF_TEX1 ) -#define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \ - D3DFVF_TEX1 ) - - -typedef struct _D3DDP_PTRSTRIDE -{ - LPVOID lpvData; - DWORD dwStride; -} D3DDP_PTRSTRIDE; - -#define D3DDP_MAXTEXCOORD 8 - -typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA -{ - D3DDP_PTRSTRIDE position; - D3DDP_PTRSTRIDE normal; - D3DDP_PTRSTRIDE diffuse; - D3DDP_PTRSTRIDE specular; - D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD]; -} D3DDRAWPRIMITIVESTRIDEDDATA, *LPD3DDRAWPRIMITIVESTRIDEDDATA; -//--------------------------------------------------------------------- -// ComputeSphereVisibility return values -// -#define D3DVIS_INSIDE_FRUSTUM 0 -#define D3DVIS_INTERSECT_FRUSTUM 1 -#define D3DVIS_OUTSIDE_FRUSTUM 2 -#define D3DVIS_INSIDE_LEFT 0 -#define D3DVIS_INTERSECT_LEFT (1 << 2) -#define D3DVIS_OUTSIDE_LEFT (2 << 2) -#define D3DVIS_INSIDE_RIGHT 0 -#define D3DVIS_INTERSECT_RIGHT (1 << 4) -#define D3DVIS_OUTSIDE_RIGHT (2 << 4) -#define D3DVIS_INSIDE_TOP 0 -#define D3DVIS_INTERSECT_TOP (1 << 6) -#define D3DVIS_OUTSIDE_TOP (2 << 6) -#define D3DVIS_INSIDE_BOTTOM 0 -#define D3DVIS_INTERSECT_BOTTOM (1 << 8) -#define D3DVIS_OUTSIDE_BOTTOM (2 << 8) -#define D3DVIS_INSIDE_NEAR 0 -#define D3DVIS_INTERSECT_NEAR (1 << 10) -#define D3DVIS_OUTSIDE_NEAR (2 << 10) -#define D3DVIS_INSIDE_FAR 0 -#define D3DVIS_INTERSECT_FAR (1 << 12) -#define D3DVIS_OUTSIDE_FAR (2 << 12) - -#define D3DVIS_MASK_FRUSTUM (3 << 0) -#define D3DVIS_MASK_LEFT (3 << 2) -#define D3DVIS_MASK_RIGHT (3 << 4) -#define D3DVIS_MASK_TOP (3 << 6) -#define D3DVIS_MASK_BOTTOM (3 << 8) -#define D3DVIS_MASK_NEAR (3 << 10) -#define D3DVIS_MASK_FAR (3 << 12) - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION < 0x0800) - -#if(DIRECT3D_VERSION >= 0x0700) - -// To be used with GetInfo() -#define D3DDEVINFOID_TEXTUREMANAGER 1 -#define D3DDEVINFOID_D3DTEXTUREMANAGER 2 -#define D3DDEVINFOID_TEXTURING 3 - -typedef enum _D3DSTATEBLOCKTYPE -{ - D3DSBT_ALL = 1, // capture all state - D3DSBT_PIXELSTATE = 2, // capture pixel state - D3DSBT_VERTEXSTATE = 3, // capture vertex state - D3DSBT_FORCE_DWORD = 0xffffffff -} D3DSTATEBLOCKTYPE; - -// The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state. -// -typedef enum _D3DVERTEXBLENDFLAGS -{ - D3DVBLEND_DISABLE = 0, // Disable vertex blending - D3DVBLEND_1WEIGHT = 1, // blend between 2 matrices - D3DVBLEND_2WEIGHTS = 2, // blend between 3 matrices - D3DVBLEND_3WEIGHTS = 3, // blend between 4 matrices -} D3DVERTEXBLENDFLAGS; - -typedef enum _D3DTEXTURETRANSFORMFLAGS { - D3DTTFF_DISABLE = 0, // texture coordinates are passed directly - D3DTTFF_COUNT1 = 1, // rasterizer should expect 1-D texture coords - D3DTTFF_COUNT2 = 2, // rasterizer should expect 2-D texture coords - D3DTTFF_COUNT3 = 3, // rasterizer should expect 3-D texture coords - D3DTTFF_COUNT4 = 4, // rasterizer should expect 4-D texture coords - D3DTTFF_PROJECTED = 256, // texcoords to be divided by COUNTth element - D3DTTFF_FORCE_DWORD = 0x7fffffff, -} D3DTEXTURETRANSFORMFLAGS; - -// Macros to set texture coordinate format bits in the FVF id - -#define D3DFVF_TEXTUREFORMAT2 0 // Two floating point values -#define D3DFVF_TEXTUREFORMAT1 3 // One floating point value -#define D3DFVF_TEXTUREFORMAT3 1 // Three floating point values -#define D3DFVF_TEXTUREFORMAT4 2 // Four floating point values - -#define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16)) -#define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2) -#define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16)) -#define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16)) - - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#else -// -// legacy vertex blend names -// -typedef enum _D3DVERTEXBLENDFLAGS D3DVERTEXBLENDFLAGS; -#define D3DVBLEND_DISABLE (D3DVERTEXBLENDFLAGS)0 -#define D3DVBLEND_1WEIGHT (D3DVERTEXBLENDFLAGS)1 -#define D3DVBLEND_2WEIGHTS (D3DVERTEXBLENDFLAGS)2 -#define D3DVBLEND_3WEIGHTS (D3DVERTEXBLENDFLAGS)3 - -#endif //(DIRECT3D_VERSION < 0x0800) - -#pragma pack() -#pragma warning(default:4201) - -#endif /* _D3DTYPES_H_ */ - diff --git a/jan/src/dep/vc/include/d3dvec.inl b/jan/src/dep/vc/include/d3dvec.inl deleted file mode 100644 index b9d6db796..000000000 --- a/jan/src/dep/vc/include/d3dvec.inl +++ /dev/null @@ -1,255 +0,0 @@ - -/****************************************************************** - * * - * D3DVec.inl * - * * - * Float-valued 3D vector class for Direct3D. * - * * - * Copyright (c) Microsoft Corp. All rights reserved. * - * * - ******************************************************************/ - -#include - -// ===================================== -// Constructors -// ===================================== - -inline -_D3DVECTOR::_D3DVECTOR(D3DVALUE f) -{ - x = y = z = f; -} - -inline -_D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z) -{ - x = _x; y = _y; z = _z; -} - -inline -_D3DVECTOR::_D3DVECTOR(const D3DVALUE f[3]) -{ - x = f[0]; y = f[1]; z = f[2]; -} - -// ===================================== -// Access grants -// ===================================== - -inline const D3DVALUE& -_D3DVECTOR::operator[](int i) const -{ - return (&x)[i]; -} - -inline D3DVALUE& -_D3DVECTOR::operator[](int i) -{ - return (&x)[i]; -} - - -// ===================================== -// Assignment operators -// ===================================== - -inline _D3DVECTOR& -_D3DVECTOR::operator += (const _D3DVECTOR& v) -{ - x += v.x; y += v.y; z += v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator -= (const _D3DVECTOR& v) -{ - x -= v.x; y -= v.y; z -= v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator *= (const _D3DVECTOR& v) -{ - x *= v.x; y *= v.y; z *= v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator /= (const _D3DVECTOR& v) -{ - x /= v.x; y /= v.y; z /= v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator *= (D3DVALUE s) -{ - x *= s; y *= s; z *= s; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator /= (D3DVALUE s) -{ - x /= s; y /= s; z /= s; - return *this; -} - -inline _D3DVECTOR -operator + (const _D3DVECTOR& v) -{ - return v; -} - -inline _D3DVECTOR -operator - (const _D3DVECTOR& v) -{ - return _D3DVECTOR(-v.x, -v.y, -v.z); -} - -inline _D3DVECTOR -operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z); -} - -inline _D3DVECTOR -operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z); -} - -inline _D3DVECTOR -operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z); -} - -inline _D3DVECTOR -operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z); -} - -inline int -operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1[0] < v2[0] && v1[1] < v2[1] && v1[2] < v2[2]; -} - -inline int -operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1[0] <= v2[0] && v1[1] <= v2[1] && v1[2] <= v2[2]; -} - -inline _D3DVECTOR -operator * (const _D3DVECTOR& v, D3DVALUE s) -{ - return _D3DVECTOR(s*v.x, s*v.y, s*v.z); -} - -inline _D3DVECTOR -operator * (D3DVALUE s, const _D3DVECTOR& v) -{ - return _D3DVECTOR(s*v.x, s*v.y, s*v.z); -} - -inline _D3DVECTOR -operator / (const _D3DVECTOR& v, D3DVALUE s) -{ - return _D3DVECTOR(v.x/s, v.y/s, v.z/s); -} - -inline int -operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1.x==v2.x && v1.y==v2.y && v1.z == v2.z; -} - -inline D3DVALUE -Magnitude (const _D3DVECTOR& v) -{ - return (D3DVALUE) sqrt(SquareMagnitude(v)); -} - -inline D3DVALUE -SquareMagnitude (const _D3DVECTOR& v) -{ - return v.x*v.x + v.y*v.y + v.z*v.z; -} - -inline _D3DVECTOR -Normalize (const _D3DVECTOR& v) -{ - return v / Magnitude(v); -} - -inline D3DVALUE -Min (const _D3DVECTOR& v) -{ - D3DVALUE ret = v.x; - if (v.y < ret) ret = v.y; - if (v.z < ret) ret = v.z; - return ret; -} - -inline D3DVALUE -Max (const _D3DVECTOR& v) -{ - D3DVALUE ret = v.x; - if (ret < v.y) ret = v.y; - if (ret < v.z) ret = v.z; - return ret; -} - -inline _D3DVECTOR -Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR( v1[0] < v2[0] ? v1[0] : v2[0], - v1[1] < v2[1] ? v1[1] : v2[1], - v1[2] < v2[2] ? v1[2] : v2[2]); -} - -inline _D3DVECTOR -Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR( v1[0] > v2[0] ? v1[0] : v2[0], - v1[1] > v2[1] ? v1[1] : v2[1], - v1[2] > v2[2] ? v1[2] : v2[2]); -} - -inline D3DVALUE -DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1.x*v2.x + v1.y * v2.y + v1.z*v2.z; -} - -inline _D3DVECTOR -CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - _D3DVECTOR result; - - result[0] = v1[1] * v2[2] - v1[2] * v2[1]; - result[1] = v1[2] * v2[0] - v1[0] * v2[2]; - result[2] = v1[0] * v2[1] - v1[1] * v2[0]; - - return result; -} - -inline _D3DMATRIX -operator* (const _D3DMATRIX& a, const _D3DMATRIX& b) -{ - _D3DMATRIX ret; - for (int i=0; i<4; i++) { - for (int j=0; j<4; j++) { - ret(i, j) = 0.0f; - for (int k=0; k<4; k++) { - ret(i, j) += a(i, k) * b(k, j); - } - } - } - return ret; -} - diff --git a/jan/src/dep/vs2010/pre.bat b/jan/src/dep/vs2010/pre.bat deleted file mode 100644 index 6e7dbfd67..000000000 --- a/jan/src/dep/vs2010/pre.bat +++ /dev/null @@ -1,44 +0,0 @@ -@echo off -cd ..\..\src\dep\ -mkdir generated -cd scripts -echo %CD% -echo running perl scripts -perl cave_sprite_func.pl -o ../generated/cave_sprite_func.h -perl license2rtf.pl -o ../generated/license.rtf ../../license.txt -perl cave_tile_func.pl -o ../generated/cave_tile_func.h -perl neo_sprite_func.pl -o ../generated/neo_sprite_func.h -perl psikyo_tile_func.pl -o ../generated/psikyo_tile_func.h -perl toa_gp9001_func.pl -o ../generated/toa_gp9001_func.h -perl gamelist.pl -o ../generated/driverlist.h -l ../../gamelist.txt ../../burn/drv/capcom ../../burn/drv/cave ../../burn/drv/cps3 ../../burn/drv/dataeast ../../burn/drv/galaxian ../../burn/drv/irem ../../burn/drv/konami ../../burn/drv/megadrive ../../burn/drv/neogeo ../../burn/drv/pce ../../burn/drv/pgm ../../burn/drv/pst90s ../../burn/drv/pre90s ../../burn/drv/psikyo ../../burn/drv/sega ../../burn/drv/taito ../../burn/drv/toaplan ../../burn/drv/snes ../../burn/drv/sms - -echo %CD% -echo building buildinfo -%1/bin/cl" build_details.cpp -build_details > ../generated/build_details.h -del build_details.exe -del build_details.obj - -echo building ctv -cd .. -cd .. -cd burn -cd drv -cd capcom -echo %CD% -%1/bin/cl" ctv_make.cpp -ctv_make > ../../../dep/generated/ctv.h -del ctv_make.exe -del ctv_make.obj - -echo building 68k generator -cd .. -cd .. -cd .. -cd cpu -cd m68k -echo %CD% -%1/bin/cl" /DINLINE="__inline static" m68kmake.c -m68kmake ../../dep/generated/ m68k_in.c -del m68kmake.exe -del m68kmake.obj diff --git a/jan/src/dep/vs2010/readme.txt b/jan/src/dep/vs2010/readme.txt deleted file mode 100644 index a32faeba9..000000000 --- a/jan/src/dep/vs2010/readme.txt +++ /dev/null @@ -1,6 +0,0 @@ -Here live the files that are required to build with the visual studio 2010 IDE - -Depends on: -latest DX sdk -active perl -(maybe) visual studio 2010 sp1 diff --git a/jan/src/intf/audio/aud_dsp.cpp b/jan/src/intf/audio/aud_dsp.cpp deleted file mode 100644 index 8ef9bb272..000000000 --- a/jan/src/intf/audio/aud_dsp.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// DSP_ComaC module -// ---------------- -// by Daniel Moreno - ComaC (2001) < comac2k@teleline.es > -// -// This module just fakes the "dsp.c" functions of FinalBurn and uses -// a IIR low pass filter, which is pretty faster and has a better -// frequency response. - - -#include -#include "burner.h" -#include "lowpass2.h" - -// NOTE: don't modify these defines unless you are 100% sure you know how -// to deal with the parameters of a 2nd order resonant lowpass filter. -// DO NOT EVEN MODIFY SampleFreq!!!! -// -// BTW: if you are curious, these parameters imitate the behavour of -// finalburn's "old" convolution filter. -// ---------------------------------------------------------------------- -#define SampleFreq 44100.0 - -#define CutFreq 14000.0 -#define Q 0.4 -#define Gain 1.0 - -#define CutFreq2 1500.0 -#define Q2 0.3 -#define Gain2 1.475 - - -class LowPass2 *LP1 = NULL, *LP2 = NULL; - - -INT32 DspDo(INT16 *Buff, INT32 Len) -{ - if ((!LP1) || (!LP2)) { return 1; } - - LP1->Filter(Buff, Len); // Left - LP2->Filter(Buff+1, Len); // Right - - return 0; -} - - -INT32 DspInit(void) -{ - LP1 = new LowPass2(CutFreq, SampleFreq, Q, Gain, - CutFreq2, Q2, Gain2); - LP2 = new LowPass2(CutFreq, SampleFreq, Q, Gain, - CutFreq2, Q2, Gain2); - return 0; -} - -INT32 DspExit(void) -{ - delete LP1; - delete LP2; - - LP1 = NULL; - LP2 = NULL; - - return 0; -} diff --git a/jan/src/intf/audio/aud_dsp.h b/jan/src/intf/audio/aud_dsp.h deleted file mode 100644 index df1ecdb94..000000000 --- a/jan/src/intf/audio/aud_dsp.h +++ /dev/null @@ -1,4 +0,0 @@ -// dsp.cpp -INT32 DspInit(); -INT32 DspExit(); -INT32 DspDo(INT16* Wave, INT32 nCount); diff --git a/jan/src/intf/audio/aud_interface.cpp b/jan/src/intf/audio/aud_interface.cpp deleted file mode 100644 index a719f231b..000000000 --- a/jan/src/intf/audio/aud_interface.cpp +++ /dev/null @@ -1,198 +0,0 @@ -// Audio Output -#include "burner.h" - -INT32 nAudSampleRate[8] = { 44100, 44100, 22050, 22050, 22050, 22050, 22050, 22050 }; // sample rate -INT32 nAudVolume = 10000; // Sound volume (% * 100) -INT32 nAudSegCount = 6; // Segs in the pdsbLoop buffer -INT32 nAudSegLen = 0; // Seg length in samples (calculated from Rate/Fps) -INT32 nAudAllocSegLen = 0; -UINT8 bAudOkay = 0; // True if DSound was initted okay -UINT8 bAudPlaying = 0; // True if the Loop buffer is playing - -INT32 nAudDSPModule[8] = { 0, }; // DSP module to use: 0 = none, 1 = low-pass filter - -INT16* nAudNextSound = NULL; // The next sound seg we will add to the sample loop - -UINT32 nAudSelect = 0; // Which audio plugin is selected -static UINT32 nAudActive = 0; - -#if defined (BUILD_WIN32) - extern struct AudOut AudOutDx; - extern struct AudOut AudOutXAudio2; -#elif defined (BUILD_SDL) - extern struct AudOut AudOutSDL; -#elif defined (_XBOX) - extern struct AudOut AudOutXAudio2; -#elif defined (BUILD_QT) -#ifdef BUILD_QT_LINUX - extern struct AudOut AudOutPulseSimple; -#endif - extern struct AudOut AudOutQtSound; -#endif - -static struct AudOut *pAudOut[]= -{ -#if defined (BUILD_WIN32) - &AudOutDx, - &AudOutXAudio2, -#elif defined (BUILD_SDL) - &AudOutSDL, -#elif defined (_XBOX) - &AudOutXAudio2, -#elif defined (BUILD_QT) -#ifdef BUILD_QT_LINUX - &AudOutPulseSimple, -#endif - &AudOutQtSound, -#endif -}; - -#define AUD_LEN (sizeof(pAudOut)/sizeof(pAudOut[0])) - -static InterfaceInfo AudInfo = { NULL, NULL, NULL }; - -// for NeoGeo CD (WAV playback) -void wav_pause(bool bResume); - -INT32 AudBlankSound() -{ - wav_pause(false); // pause / stop if needed - - if (!bAudOkay || nAudActive >= AUD_LEN) { - return 1; - } - return pAudOut[nAudActive]->BlankSound(); -} - -// This function checks the Sound loop, and if necessary gets some more sound -INT32 AudSoundCheck() -{ - if(!bRunPause) wav_pause(true); // resume, if needed - - if (!bAudOkay || nAudActive >= AUD_LEN) { - return 1; - } - return pAudOut[nAudActive]->SoundCheck(); -} - -INT32 AudSoundInit() -{ - INT32 nRet; - - if (nAudSelect >= AUD_LEN) { - return 1; - } - - nAudActive = nAudSelect; - - if ((nRet = pAudOut[nAudActive]->SoundInit()) == 0) { - bAudOkay = true; - } - - return nRet; -} - -INT32 AudSetCallback(INT32 (*pCallback)(INT32)) -{ - if (!bAudOkay || nAudActive >= AUD_LEN) { - return 1; - } - return pAudOut[nAudActive]->SetCallback(pCallback); -} - -INT32 AudSoundPlay() -{ - if (!bAudOkay || nAudActive >= AUD_LEN) { - return 1; - } - - INT32 nRet = pAudOut[nAudActive]->SoundPlay(); - if (!nRet) { - bAudPlaying = true; - if (bCDEmuOkay) wav_pause(true); - } - - return nRet; -} - -INT32 AudSoundStop() -{ - if (nAudActive >= AUD_LEN) { - return 1; - } - - bAudPlaying = false; - if (bCDEmuOkay) wav_pause(false); - - return pAudOut[nAudActive]->SoundStop(); -} - -INT32 AudSoundExit() -{ - IntInfoFree(&AudInfo); - - if (!bAudOkay || nAudActive >= AUD_LEN) { - return 1; - } - bAudOkay = false; - - INT32 nRet = pAudOut[nAudActive]->SoundExit(); - - nAudActive = 0; - - return nRet; -} - -INT32 AudSoundSetVolume() -{ - if (!bAudOkay || nAudActive >= AUD_LEN) { - return 1; - } - return pAudOut[nAudActive]->SoundSetVolume(); -} - -InterfaceInfo* AudGetInfo() -{ - if (IntInfoInit(&AudInfo)) { - IntInfoFree(&AudInfo); - return NULL; - } - - if (bAudOkay) { - TCHAR szString[MAX_PATH] = _T(""); - - AudInfo.pszModuleName = pAudOut[nAudActive]->szModuleName; - - _sntprintf(szString, MAX_PATH, _T("Playback at %iHz, %i%% volume"), nAudSampleRate[nAudActive], nAudVolume / 100); - IntInfoAddStringInterface(&AudInfo, szString); - - if (nAudDSPModule[nAudActive]) { - IntInfoAddStringInterface(&AudInfo, _T("Applying low-pass filter")); - } - - if (pAudOut[nAudSelect]->GetPluginSettings) { - pAudOut[nAudSelect]->GetPluginSettings(&AudInfo); - } - } else { - IntInfoAddStringInterface(&AudInfo, _T("Audio plugin not initialised")); - } - - return &AudInfo; -} - -INT32 AudSelect(UINT32 nPlugIn) -{ - if (nPlugIn < AUD_LEN) { - nAudSelect = nPlugIn; - return 0; - } - - return 1; -} - -void AudWriteSilence() -{ - if (nAudNextSound) { - memset(nAudNextSound, 0, nAudAllocSegLen); - } -} diff --git a/jan/src/intf/audio/linux/aud_pulse_simple.cpp b/jan/src/intf/audio/linux/aud_pulse_simple.cpp deleted file mode 100644 index 332f59e56..000000000 --- a/jan/src/intf/audio/linux/aud_pulse_simple.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// C++11 simple pulse audio driver -#include -#include -#include -#include -#include -#include "burner.h" -#include "ringbuffer.h" - -static ring_buffer *buffer = nullptr; -static pa_simple *pa_stream = nullptr; -static std::thread *streamer_thread = nullptr; -static volatile bool streamer_stop = false; -static volatile bool streamer_is_running = false; - -// Samples per segment -static int samples_per_segment = 0; -static unsigned int pas_sound_fps; -static int (*pas_get_next_sound)(int); - -static int pas_default_sound_filler(int) -{ - if (nAudNextSound == nullptr) - return 1; - memset(nAudNextSound, 0, nAudSegLen * 4); - return 0; -} - -static int pas_blank_sound() -{ - if (nAudNextSound != nullptr) - AudWriteSilence(); - return 0; -} - -static int pas_sound_check() -{ - // 5 segments ahead... - if (buffer->size() >= (samples_per_segment * nAudSegCount)) { - std::this_thread::sleep_for(std::chrono::milliseconds(2)); - return 0; - } - - pas_get_next_sound(1); - buffer->write(nAudNextSound, samples_per_segment); - return 0; -} - -static int pas_exit() -{ - nAudNextSound = NULL; - return 0; -} - -static int pas_set_callback(int (*callback)(int)) -{ - if (callback == NULL) { - pas_get_next_sound = pas_default_sound_filler; - } else { - pas_get_next_sound = callback; - } - return 0; -} - -static void pas_audio_streamer(void) -{ - short *buf = new short[samples_per_segment]; - streamer_is_running = true; - - while (!streamer_stop) { - // playing... - if (bAudPlaying) { - - if (buffer->size() >= samples_per_segment) { - buffer->read(buf, samples_per_segment); - } else { - memset(buf, 0, samples_per_segment * 2); - } - - pa_simple_write(pa_stream, buf, samples_per_segment * 2, NULL); - } else { - std::this_thread::sleep_for(std::chrono::microseconds(10)); - } - } - delete [] buf; - streamer_is_running = false; - streamer_stop = false; -} - -static int pas_init() -{ - pas_sound_fps = nAppVirtualFps; - nAudSegLen = (nAudSampleRate[0] * 100 + (pas_sound_fps / 2)) / pas_sound_fps; - - // samples per segment - samples_per_segment = nAudSegLen * 2; - - // seglen * 2 channels * 2 bytes per sample (16bits) - nAudAllocSegLen = samples_per_segment * 2; - - nAudNextSound = new short[samples_per_segment]; - - pas_set_callback(nullptr); - pas_default_sound_filler(0); - - pBurnSoundOut = nAudNextSound; - nBurnSoundRate = nAudSampleRate[0]; - nBurnSoundLen = nAudAllocSegLen; - - pa_sample_spec specs; - specs.channels = 2; - specs.format = PA_SAMPLE_S16LE; - specs.rate = nAudSampleRate[0]; - - pa_buffer_attr attributes; - attributes.maxlength = -1; - attributes.minreq = -1; - attributes.prebuf = -1; - attributes.tlength = nAudAllocSegLen * nAudSegCount; - - if (streamer_thread) { - streamer_stop = true; - while (streamer_is_running) { - std::this_thread::yield(); - } - streamer_stop = false; - delete streamer_thread; - } - - // destroy previous pulse audio stream - if (pa_stream) { - pa_simple_flush(pa_stream, NULL); - pa_simple_free(pa_stream); - } - - // destroy previous ring buffer - if (buffer) { - delete buffer; - } - - // 6 segmentos no buffer - buffer = new ring_buffer(samples_per_segment * nAudSegCount * 2); - buffer->virtual_write(samples_per_segment * (nAudSegCount)); - pa_stream = pa_simple_new(NULL, - "fbalpha", - PA_STREAM_PLAYBACK, - NULL, - "fbalpha", - &specs, - NULL, - &attributes, - NULL); - streamer_thread = new std::thread(pas_audio_streamer); - streamer_thread->detach(); - bAudOkay = 1; - return 0; -} - -static int pas_play() -{ - bAudPlaying = 1; - return 0; -} - -static int pas_stop() -{ - bAudPlaying = 0; - return 0; -} - -static int pas_set_volume() -{ - return 1; -} - -static int pas_get_settings(InterfaceInfo *) -{ - return 0; -} - -struct AudOut AudOutPulseSimple = { - pas_blank_sound, - pas_sound_check, - pas_init, - pas_set_callback, - pas_play, - pas_stop, - pas_exit, - pas_set_volume, - pas_get_settings, - _T("PulseAudio (Simple) audio output") -}; diff --git a/jan/src/intf/audio/linux/ringbuffer.h b/jan/src/intf/audio/linux/ringbuffer.h deleted file mode 100644 index cdcff290b..000000000 --- a/jan/src/intf/audio/linux/ringbuffer.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef RINGBUFFER_H -#define RINGBUFFER_H - -#include - -template -class ring_buffer { - T *buffer; - uint64_t head; - uint64_t tail; - size_t buffer_size; - -public: - ring_buffer(size_t buffer_size_) : buffer_size(buffer_size_) { - buffer = new T[buffer_size]; - for (size_t i = 0; i < buffer_size; i++) - buffer[i] = 0; - head = 0; - tail = 0; - } - ~ring_buffer() { - delete [] buffer; - } - - void virtual_write(size_t lenght) { - tail += lenght; - } - - bool available() { - return (tail > head); - } - - size_t size() const { - return tail - head; - } - - void write(const T *buf, size_t lenght) { - uint64_t tail_ = tail; - for (auto i = 0; i < lenght; i++) { - buffer[tail_ % buffer_size] = buf[i]; - ++tail_; - } - tail = tail_; - } - - size_t read(T *buf, size_t lenght) { - uint64_t head_ = head; - if (lenght > size()) - lenght = size(); - - for (auto i = 0; i < lenght; i++) { - buf[i] = buffer[head_ % buffer_size]; - ++head_; - } - head = head_; - return lenght; - } -}; - -#endif // RINGBUFFER_H diff --git a/jan/src/intf/audio/lowpass2.cpp b/jan/src/intf/audio/lowpass2.cpp deleted file mode 100644 index 5b1f961da..000000000 --- a/jan/src/intf/audio/lowpass2.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// LowPass2 module -// --------------- -// by Daniel Moreno - ComaC (2001) < comac2k@teleline.es > -// -// This is a straight-forward implementation of a 2nd order resonant -// lowpass filter. Well... in fact there are two lowpass filters being -// calculated at the same time, since the old convolution filter cannot -// be emulated with only one. -// -// The only optimization i've made is to change doubles for fixed point -// integers. - -#include -#include "burner.h" -#include "lowpass2.h" - -#define PI 3.141592653589793238462643383279502884197169399375105820974944592307816 -#define FixBits 15 -#define Fixed(A) ( (int)((A) * (1 << FixBits)) ) - - -#define SATURATE(Min, Max, Val) ( (Val) <= (Min) ? (Min) : (Val) > (Max) ? (Max) : (Val) ) - -// In case we know we will not run out of range (speeds up by 5% on gcc2.95.3): -//#define SATURATE(Min, Max, Val) (Val) - - - -LowPass2::LowPass2(void) -{ -} - - -LowPass2::LowPass2(double Freq, double SampleRate, double Q, double Gain, - double Freq2, double Q2, double Gain2) -{ - SetParam(Freq, SampleRate, Q, Gain, Freq2, Q2, Gain2); -} - -void LowPass2::Reset() -{ - i0 = 0; - i1 = 0; - i2 = 0; - o0 = 0; - o1 = 0; - o2 = 0; - o0b = 0; - o1b = 0; - o2b = 0; - -} - -void LowPass2::Filter(INT16 *Buff, INT32 Tam) -{ - INT32 a; - INT32 Tmp, Tmp2; - - for (a = 0; a < Tam*2; a += 2) - { - Tmp = (b0*Buff[a] + b1*i1 + b2*i2 - - a1*o1 - a2*o2) / (1 << FixBits); - - Tmp2 = (b0b*Buff[a] + b1b*i1 + b2b*i2 - - a1b*o1b - a2b*o2b) / (1 << FixBits); - - i2 = i1; - i1 = Buff[a]; - o2 = o1; - o1 = Tmp; - - o2b = o1b; - o1b = Tmp2; - - // Buff[a] = (short)SATURATE(-32768, 32767, Tmp + Tmp2); - Buff[a] = (INT16)SATURATE(-32768, 32767, Tmp + Tmp2)*(1-bRunPause); - } -} - - - -void LowPass2::SetParam(double Freq, double SampleRate, double Q, double Gain, - double Freq2, double Q2, double Gain2) -{ - double omega, sn, cs, alpha; - - if (Q < 0) { Q = 0; } - - if (Freq < 0) { Freq = 0; } - if (Freq > SampleRate/2) { Freq = SampleRate/2; } - - omega = PI * 2 * Freq / SampleRate; - sn = sin(omega); - cs = cos(omega); - alpha = sn / (2 * Q); - - a0 = Fixed(1 + alpha); - b0 = Fixed( ((1 - cs) / 2) * Gain / (1 + alpha) ); - b1 = Fixed( (1 - cs) * Gain / (1 + alpha) ); - b2 = Fixed( ((1 - cs) / 2) * Gain / (1 + alpha) ); - a1 = Fixed( (-2 * cs) / (1 + alpha) ); - a2 = Fixed( (1 - alpha) / (1 + alpha) ); - - - if (Q2 < 0) { Q2 = 0; } - - if (Freq2 < 0) { Freq2 = 0; } - if (Freq2 > SampleRate/2) { Freq2 = SampleRate/2; } - - omega = PI * 2 * Freq2 / SampleRate; - sn = sin(omega); - cs = cos(omega); - alpha = sn / (2 * Q2); - - a0b = Fixed(1 + alpha); - b0b = Fixed( ((1 - cs) / 2) * Gain2 / (1 + alpha) ); - b1b = Fixed( (1 - cs) * Gain2 / (1 + alpha) ); - b2b = Fixed( ((1 - cs) / 2) * Gain2 / (1 + alpha) ); - a1b = Fixed( (-2 * cs) / (1 + alpha) ); - a2b = Fixed( (1 - alpha) / (1 + alpha) ); - - i0 = 0; - i1 = 0; - i2 = 0; - o0 = 0; - o1 = 0; - o2 = 0; - o0b = 0; - o1b = 0; - o2b = 0; -} diff --git a/jan/src/intf/audio/lowpass2.h b/jan/src/intf/audio/lowpass2.h deleted file mode 100644 index e59a39d37..000000000 --- a/jan/src/intf/audio/lowpass2.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef HIPASS_INCLUDED -#define HIPASS_INCLUDED - -class LowPass2 -{ -public: - LowPass2(void); - LowPass2(double Freq, double SampleRate, double Q, double Gain, - double Freq2, double Q2, double Gain2); - - void Filter(INT16 *Buff, INT32 Tam); - void SetParam(double Freq, double SampleRate, double Q, double Gain, - double Freq2, double Q2, double Gain2); - void Reset(void); - -private: - INT32 a0, a1, a2, b0, b1, b2; - INT32 i0, i1, i2, o0, o1, o2; - - INT32 a0b, a1b, a2b, b0b, b1b, b2b; - INT32 o0b, o1b, o2b; - - // Yes, I know some of these are not used -}; - -#endif diff --git a/jan/src/intf/audio/psp/aud_psp.cpp b/jan/src/intf/audio/psp/aud_psp.cpp deleted file mode 100644 index d3746fe5a..000000000 --- a/jan/src/intf/audio/psp/aud_psp.cpp +++ /dev/null @@ -1,232 +0,0 @@ -// psp sound module -#include "burner.h" -#include -#include - -static unsigned int nSoundFps; - -static int nAudLoopLenSample; -static int nAudLoopLen; - -static short* pAudioSndBuf[2] = {NULL, NULL}; -static int nAudioThreadId = -1; -static int nAudioChannel = -1; -static volatile int bAudioTerminate = 1; -static volatile int nAudioBufIdx = 0; -static volatile int nCurrentSeg = 0; - -extern "C" void pspSoundCopy11025(short *pDest, short *pSrc, int nLen); -extern "C" void pspSoundCopy22050(short *pDest, short *pSrc, int nLen); -extern "C" void pspSoundCopy44100(short *pDest, short *pSrc, int nLen); - -static void (*pspSoundCopy) (short *pDest, short *pSrc, int nLen); - -/** SOUND THREAD **/ - -static int AudioChannelThread(SceSize args, void *argp) -{ - while (!bAudioTerminate) { - if (bAudPlaying && (nCurrentSeg == nAudSegCount)) { - nAudioBufIdx ^= 1; - nCurrentSeg = 0; - sceAudioOutputPannedBlocking(nAudioChannel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, pAudioSndBuf[1 - nAudioBufIdx]); - //} else { - // sceKernelSleepThread(); - } - } - - sceKernelExitThread(0); - - return 0; -} - -/************************************/ - -static int pspBlankSound() -{ - if (pAudioSndBuf[0]) { - /* Check to see if there's any Cache issue between the CPU and the sound hardware */ - memset(pAudioSndBuf[0], 0, (nAudLoopLen << 1) + (nAudSegLen << 2)); - } - - return 0; -} - -static int pspSoundGetNextSoundFiller(int) // int bDraw -{ - if (nAudNextSound == NULL) { - return 1; - } - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - - return 0; -} - -int (*pspSoundGetNextSound) (int bDraw) = pspSoundGetNextSoundFiller; // Callback used to request more sound - -static int pspSoundCheck() -{ - char *pData; - int nPspSegLen; - - if (pAudioSndBuf[0] == NULL) - return 1; - - if (nCurrentSeg == nAudSegCount) { - //Sleep(2); // Don't need to do anything for a bit - return 0; - } - - pData = (char*)pAudioSndBuf[nAudioBufIdx]; - nPspSegLen = nAudSegLen; - - if (nAudSampleRate == 22050) - nPspSegLen <<= 1; - else if (nAudSampleRate == 11025) - nPspSegLen <<= 2; - - pData += nCurrentSeg * nPspSegLen; - - pspSoundCopy((short*)pData, nAudNextSound, nAudSegLen); - pspSoundGetNextSound(1); // get more sound into nAudNextSound - - nCurrentSeg++; - //if ((nCurrentSeg == nAudSegCount) && (nAudioThreadId >= 0)) { - // sceKernelWakeupThread(nAudioThreadId); - //} - if (bAudPlaying && (nCurrentSeg == nAudSegCount)) { - sceAudioOutputPanned(nAudioChannel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, pAudioSndBuf[nAudioBufIdx]); - nAudioBufIdx ^= 1; - nCurrentSeg = 0; - } - - return 0; -} - -static int pspSetCallback(int (*pCallback)(int)) -{ - if (pCallback == NULL) { - pspSoundGetNextSound = pspSoundGetNextSoundFiller; - } else { - pspSoundGetNextSound = pCallback; - } - return 0; -} - -static int pspSoundExit() -{ - bAudPlaying = 0; - bAudioTerminate = 1; - bAudOkay = 0; // This module is no longer okay - - if (nAudioThreadId >= 0) { - sceKernelDeleteThread(nAudioThreadId); - nAudioThreadId = -1; - } - - if (nAudioChannel >= 0) { - sceAudioChRelease(nAudioChannel); - nAudioChannel = -1; - } - - if (pAudioSndBuf[0]) { - free(pAudioSndBuf[0]); - pAudioSndBuf[0] = NULL; - pAudioSndBuf[1] = NULL; - nAudNextSound = NULL; - } - - return 0; -} - -static int pspSoundInit() -{ - //if (nAudSampleRate <= 0) { - // return 1; - //} - if ((nAudSampleRate != 11025) && (nAudSampleRate != 22050) && (nAudSampleRate != 44100)) { - return 1; - } - nSoundFps = nAppVirtualFps; - nAudSegLen = (nAudSampleRate * 100 + (nSoundFps >> 1)) / nSoundFps; - nAudLoopLenSample = nAudSegLen * nAudSegCount; - - if (nAudSampleRate == 11025) { - nAudLoopLenSample << 2; - pspSoundCopy = pspSoundCopy11025; - } else if (nAudSampleRate == 22050) { - nAudLoopLenSample << 1; - pspSoundCopy = pspSoundCopy22050; - } else { - pspSoundCopy = pspSoundCopy44100; - } - - nAudLoopLenSample = PSP_AUDIO_SAMPLE_ALIGN(nAudLoopLenSample); - nAudLoopLen = nAudLoopLenSample << 2; - - pAudioSndBuf[0] = (short*)malloc((nAudLoopLen << 1) + (nAudSegLen << 2)); - pAudioSndBuf[1] = pAudioSndBuf[0] + (nAudLoopLenSample << 1); - nAudNextSound = pAudioSndBuf[1] + (nAudLoopLenSample << 1); // The next sound block to put in the stream - - if (pAudioSndBuf[0] == NULL) { - pspSoundExit(); - return 1; - } - - nAudioChannel = sceAudioChReserve(PSP_AUDIO_NEXT_CHANNEL, nAudLoopLenSample, PSP_AUDIO_FORMAT_STEREO); - - if (nAudioChannel < 0) { - pspSoundExit(); - return 1; - } - - //nAudioThreadId = sceKernelCreateThread("audio_thread", AudioChannelThread, 0x18, 0x1000, PSP_THREAD_ATTR_USER, NULL); - - //if (nAudioThreadId < 0) { - // pspSoundExit(); - // return 1; - //} - - memset(pAudioSndBuf[0], 0, (nAudLoopLen << 1) + (nAudSegLen << 2)); - - bAudioTerminate = 0; - - //if (sceKernelStartThread(nAudioThreadId, 0, NULL)) { - // pspSoundExit(); - // return 1; - //} - - bAudOkay = 1; // This module was initted okay - return 0; -} - -static int pspSoundPlay() -{ - if (bAudOkay == 0) { - return 1; - } - pspBlankSound(); - bAudPlaying = 1; - - return 0; -} - -static int pspSoundStop() -{ - bAudPlaying = 0; - return 0; -} - -static int pspSoundSetVolume() -{ - return 1; -} - -static int pspSoundGetSettings(InterfaceInfo* pInfo) -{ - { - } - return 1; -} - -struct AudOut AudOutPSP = { pspBlankSound, pspSoundCheck, pspSoundInit, pspSetCallback, pspSoundPlay, pspSoundStop, pspSoundExit, pspSoundSetVolume, pspSoundGetSettings, _T("psp audio output") }; diff --git a/jan/src/intf/audio/psp/aud_psp_a.s b/jan/src/intf/audio/psp/aud_psp_a.s deleted file mode 100644 index 160260c8c..000000000 --- a/jan/src/intf/audio/psp/aud_psp_a.s +++ /dev/null @@ -1,70 +0,0 @@ - - .set arch=allegrex - .set noreorder - .set nomacro - .set nobopt - .set noat - - .globl pspSoundCopy44100 - .globl pspSoundCopy22050 - .globl pspSoundCopy11025 - - .text - - - .ent pspSoundCopy44100 -pspSoundCopy44100: - .frame $sp, 0, $ra - -0: - lw $t0, ($a1) - addiu $a2, $a2, -1 - sw $t0, ($a0) - addiu $a1, $a1, 4 - bne $a2, $zero, 0b - addiu $a0, $a0, 4 - - jr $ra - nop - - .end pspSoundCopy44100 - - - .ent pspSoundCopy22050 -pspSoundCopy22050: - .frame $sp, 0, $ra - -0: - lw $t0, ($a1) - addiu $a2, $a2, -1 - sw $t0, 0($a0) - sw $t0, 4($a0) - addiu $a1, $a1, 4 - bne $a2, $zero, 0b - addiu $a0, $a0, 8 - - jr $ra - nop - - .end pspSoundCopy22050 - - - .ent pspSoundCopy11025 -pspSoundCopy11025: - .frame $sp, 0, $ra - -0: - lw $t0, ($a1) - addiu $a2, $a2, -1 - sw $t0, 0($a0) - sw $t0, 4($a0) - sw $t0, 8($a0) - sw $t0, 12($a0) - addiu $a1, $a1, 4 - bne $a2, $zero, 0b - addiu $a0, $a0, 16 - - jr $ra - nop - - .end pspSoundCopy11025 diff --git a/jan/src/intf/audio/sdl/aud_sdl.cpp b/jan/src/intf/audio/sdl/aud_sdl.cpp deleted file mode 100644 index 28f204f2a..000000000 --- a/jan/src/intf/audio/sdl/aud_sdl.cpp +++ /dev/null @@ -1,230 +0,0 @@ -// SDL_Sound module - -#include -#include "burner.h" -#include "aud_dsp.h" -#include - -static unsigned int nSoundFps; - -int (*GetNextSound)(int); // Callback used to request more sound - -static SDL_AudioSpec audiospec; - -static short* SDLAudBuffer; -static int nSDLPlayPos; -static int nSDLFillSeg; -static int nAudLoopLen; - -void audiospec_callback(void* /* data */, Uint8* stream, int len) -{ -// dprintf(_T("audiospec_callback %i"), len); - - int end = nSDLPlayPos + len; - if (end > nAudLoopLen) { - -// dprintf(_T(" %i - %i"), nSDLPlayPos, nSDLPlayPos + nAudLoopLen - nSDLPlayPos); - - SDL_MixAudio(stream, (Uint8*)SDLAudBuffer + nSDLPlayPos, nAudLoopLen - nSDLPlayPos, SDL_MIX_MAXVOLUME); - end -= nAudLoopLen; - -// dprintf(_T(", %i - %i (%i)"), 0, end, nAudLoopLen - nSDLPlayPos + end); - - SDL_MixAudio(stream + nAudLoopLen - nSDLPlayPos, (Uint8*)SDLAudBuffer, end, SDL_MIX_MAXVOLUME); - nSDLPlayPos = end; - } else { - SDL_MixAudio(stream, (Uint8*)SDLAudBuffer + nSDLPlayPos, len, SDL_MIX_MAXVOLUME); - nSDLPlayPos = end; - - if (nSDLPlayPos == nAudLoopLen) { - nSDLPlayPos = 0; - } - } - -// dprintf(_T("\n")); -} - -static int SDLSoundGetNextSoundFiller(int) // int bDraw -{ - if (nAudNextSound == NULL) { - return 1; - } - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - - return 0; -} - -static int SDLSoundBlankSound() -{ - dprintf (_T("SDLBlankSound\n")); - if (nAudNextSound) { - dprintf (_T("blanking nAudNextSound\n")); - memset(nAudNextSound, 0, nAudSegLen << 2); - } - return 0; -} - -#define WRAP_INC(x) { x++; if (x >= nAudSegCount) x = 0; } - -static int SDLSoundCheck() -{ - int nPlaySeg, nFollowingSeg; - - if (!bAudPlaying) { - dprintf(_T("SDLSoundCheck (not playing)\n")); - return 0; - } - - // Since the SDL buffer is smaller than a segment, only fill the buffer up to the start of the currently playing segment - nPlaySeg = nSDLPlayPos / (nAudSegLen << 2) - 1; - -// dprintf(_T("SDLSoundCheck (seg %i)\n"), nPlaySeg); - - if (nPlaySeg >= nAudSegCount) { - nPlaySeg -= nAudSegCount; - } - if (nPlaySeg < 0) { - nPlaySeg = nAudSegCount - 1; - } - - if (nSDLFillSeg == nPlaySeg) { - SDL_Delay(1); - return 0; - } - - // work out which seg we will fill next - nFollowingSeg = nSDLFillSeg; - WRAP_INC(nFollowingSeg); - - while (nSDLFillSeg != nPlaySeg) { - int bDraw; - - // fill nSDLFillSeg -// dprintf(_T("Filling seg %i at %i\n"), nSDLFillSeg, nSDLFillSeg * (nAudSegLen << 2)); - - bDraw = (nFollowingSeg == nPlaySeg);// || bAlwaysDrawFrames; // If this is the last seg of sound, flag bDraw (to draw the graphics) - -// nAudNextSound = SDLAudBuffer + nSDLFillSeg * (nAudSegLen << 1); - GetNextSound(bDraw); // get more sound into nAudNextSound - -// if (nAudDSPModule) { -// DspDo(nAudNextSound, nAudSegLen); -// } - - memcpy((char*)SDLAudBuffer + nSDLFillSeg * (nAudSegLen << 2), nAudNextSound, nAudSegLen << 2); - - nSDLFillSeg = nFollowingSeg; - WRAP_INC(nFollowingSeg); - } - - return 0; -} - -static int SDLSoundExit() -{ - dprintf(_T("SDLSoundExit\n")); - - SDL_CloseAudio(); - - free(SDLAudBuffer); - SDLAudBuffer = NULL; - - free(nAudNextSound); - nAudNextSound = NULL; - - return 0; -} - -static int SDLSetCallback(int (*pCallback)(int)) -{ - if (pCallback == NULL) { - GetNextSound = SDLSoundGetNextSoundFiller; - } else { - GetNextSound = pCallback; - dprintf(_T("SDL callback set\n")); - } - return 0; -} - -static int SDLSoundInit() -{ - SDL_AudioSpec audiospec_req; - int nSDLBufferSize; - - dprintf(_T("SDLSoundInit (%dHz)\n"), nAudSampleRate[0]); - - if (nAudSampleRate[0] <= 0) { - return 1; - } - - nSoundFps = nAppVirtualFps; - nAudSegLen = (nAudSampleRate[0] * 100 + (nSoundFps >> 1)) / nSoundFps; - nAudLoopLen = (nAudSegLen * nAudSegCount) << 2; - for (nSDLBufferSize = 64; nSDLBufferSize < (nAudSegLen >> 1); nSDLBufferSize <<= 1) { } - - audiospec_req.freq = nAudSampleRate[0]; - audiospec_req.format = AUDIO_S16; - audiospec_req.channels = 2; - audiospec_req.samples = nSDLBufferSize; - audiospec_req.callback = audiospec_callback; - - SDLAudBuffer = (short*)malloc(nAudLoopLen); - if (SDLAudBuffer == NULL) { - dprintf(_T("Couldn't malloc SDLAudBuffer\n")); - SDLSoundExit(); - return 1; - } - memset(SDLAudBuffer, 0, nAudLoopLen); - - nAudNextSound = (short*)malloc(nAudSegLen << 2); - if (nAudNextSound == NULL) { - SDLSoundExit(); - return 1; - } - - nSDLPlayPos = 0; - nSDLFillSeg = nAudSegCount - 1; - - if(SDL_OpenAudio(&audiospec_req, &audiospec)) { - fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError()); - dprintf(_T("Couldn't open audio: %s\n"), SDL_GetError()); - return 1; - } - - SDLSetCallback(NULL); - - return 0; -} - -static int SDLSoundPlay() -{ - dprintf(_T("SDLSoundPlay\n")); - - SDL_PauseAudio(0); - bAudPlaying = 1; - - return 0; -} - -static int SDLSoundStop() -{ - dprintf(_T("SDLSoundStop\n")); - - SDL_PauseAudio(1); - bAudPlaying = 0; - - return 0; -} - -static int SDLSoundSetVolume() -{ - dprintf(_T("SDLSoundSetVolume\n")); - return 1; -} - -static int SDLGetSettings(InterfaceInfo* /* pInfo */) -{ - return 0; -} - -struct AudOut AudOutSDL = { SDLSoundBlankSound, SDLSoundCheck, SDLSoundInit, SDLSetCallback, SDLSoundPlay, SDLSoundStop, SDLSoundExit, SDLSoundSetVolume, SDLGetSettings, _T("SDL audio output") }; diff --git a/jan/src/intf/audio/win32/aud_dsound3.cpp b/jan/src/intf/audio/win32/aud_dsound3.cpp deleted file mode 100644 index 0a4f306e9..000000000 --- a/jan/src/intf/audio/win32/aud_dsound3.cpp +++ /dev/null @@ -1,304 +0,0 @@ -// DirectSound module -#include "burner.h" -#include "aud_dsp.h" -#include - -#include -#define DIRECTSOUND_VERSION 0x0300 // Only need version from DirectX 3 -#include - -#include "dsound_core.h" - -// Sound is split into a series of 'segs', one seg for each frame -// The Loop buffer is a multiple of this seg length. - -static IDirectSound* pDS = NULL; // DirectSound interface -static IDirectSoundBuffer* pdsbPrim = NULL; // Primary buffer -static IDirectSoundBuffer* pdsbLoop = NULL; // (Secondary) Loop buffer -static int cbLoopLen = 0; // Loop length (in bytes) calculated - -int (*DSoundGetNextSound)(int); // Callback used to request more sound - -static int nDSoundFps; // Application fps * 100 -static long nDSoundVol = 0; - -static int DSoundGetNextSoundFiller(int) // int bDraw -{ - if (nAudNextSound == NULL) { - return 1; - } - memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer - - return 0; -} - -static inline int DxSetCallback(int (*pCallback)(int)) -{ - if (pCallback == NULL) { - DSoundGetNextSound = DSoundGetNextSoundFiller; - } else { - DSoundGetNextSound = pCallback; - } - - return 0; -} - -static int DxBlankSound() -{ - void *pData = NULL, *pData2 = NULL; - DWORD cbLen = 0, cbLen2 = 0; - - // Lock the Loop buffer - if (FAILED(pdsbLoop->Lock(0, cbLoopLen, &pData, &cbLen, &pData2, &cbLen2, 0))) { - return 1; - } - memset(pData, 0, cbLen); - - // Unlock (2nd 0 is because we wrote nothing to second part) - pdsbLoop->Unlock(pData, cbLen, pData2, 0); - - // Also blank the nAudNextSound buffer - if (nAudNextSound) { - memset(nAudNextSound, 0, nAudSegLen << 2); - } - - return 0; -} - -static int nDSoundNextSeg = 0; // We have filled the sound in the loop up to the beginning of 'nNextSeg' - -#define WRAP_INC(x) { x++; if (x >= nAudSegCount) x = 0; } - -bool bRunFrame = false; - -// This function checks the DSound loop, and if necessary does a callback to update the emulation -static int DxSoundCheck() -{ - int nPlaySeg = 0, nFollowingSeg = 0; - DWORD nPlay = 0, nWrite = 0; - - if (pdsbLoop == NULL) { - return 1; - } - - // We should do nothing until nPlay has left nDSoundNextSeg - pdsbLoop->GetCurrentPosition(&nPlay, &nWrite); - - nPlaySeg = nPlay / (nAudSegLen << 2); - - if (nPlaySeg > nAudSegCount -1 ) { - nPlaySeg = nAudSegCount - 1; - } - if (nPlaySeg < 0) { // important to ensure nPlaySeg clipped for below - nPlaySeg = 0; - } - - if (nDSoundNextSeg == nPlaySeg) { - Sleep(2); // Don't need to do anything for a bit - //bRunFrame = true; - return 0; - } - - // work out which seg we will fill next - nFollowingSeg = nDSoundNextSeg; - WRAP_INC(nFollowingSeg); - - while (nDSoundNextSeg != nPlaySeg) { - void *pData = NULL, *pData2 = NULL; - DWORD cbLen = 0, cbLen2 = 0; - int bDraw; - - // fill nNextSeg - - // Lock the relevant seg of the loop buffer - if (SUCCEEDED(pdsbLoop->Lock(nDSoundNextSeg * (nAudSegLen << 2), nAudSegLen << 2, &pData, &cbLen, &pData2, &cbLen2, 0))) { - // Locked the segment, so write the sound we calculated last time - memcpy(pData, nAudNextSound, nAudSegLen << 2); - - // Unlock (2nd 0 is because we wrote nothing to second part) - pdsbLoop->Unlock(pData, cbLen, pData2, 0); - } - - bDraw = (nFollowingSeg == nPlaySeg) || bAlwaysDrawFrames; // If this is the last seg of sound, flag bDraw (to draw the graphics) - - if(bDraw) { - DSoundGetNextSound(bDraw); // get more sound into nAudNextSound - } - - if(!bDraw) { - bRunFrame = true; - RunIdle(); - } - - if (nAudDSPModule[0]) { - DspDo(nAudNextSound, nAudSegLen); - } - - nDSoundNextSeg = nFollowingSeg; - WRAP_INC(nFollowingSeg); - } - - return 0; -} - -static int DxSoundExit() -{ - DspExit(); - - if (nAudNextSound) { - free(nAudNextSound); - nAudNextSound = NULL; - } - - DSoundGetNextSound = NULL; - - // Release the (Secondary) Loop Sound Buffer - RELEASE(pdsbLoop); - // Release the Primary Sound Buffer - RELEASE(pdsbPrim); - // Release the DirectSound interface - RELEASE(pDS); - - return 0; -} - -static int DxSoundInit() -{ - int nRet = 0; - DSBUFFERDESC dsbd; - WAVEFORMATEX wfx; - - if (nAudSampleRate <= 0) { - return 1; - } - - nDSoundFps = nAppVirtualFps; - - // Calculate the Seg Length and Loop length (round to nearest sample) - nAudSegLen = (nAudSampleRate[0] * 100 + (nDSoundFps >> 1)) / nDSoundFps; - cbLoopLen = (nAudSegLen * nAudSegCount) << 2; - - // Make the format of the sound - memset(&wfx, 0, sizeof(wfx)); - wfx.cbSize = sizeof(wfx); - wfx.wFormatTag = WAVE_FORMAT_PCM; - wfx.nChannels = 2; // stereo - wfx.nSamplesPerSec = nAudSampleRate[0]; // sample rate - wfx.wBitsPerSample = 16; // 16-bit - wfx.nBlockAlign = 4; // bytes per sample - wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; - - // Create the DirectSound interface - if (FAILED(_DirectSoundCreate(NULL, &pDS, NULL))) { - return 1; - } - - // Set the coop level - nRet = pDS->SetCooperativeLevel(hScrnWnd, DSSCL_PRIORITY); - - // Make the primary sound buffer - memset(&dsbd, 0, sizeof(dsbd)); - dsbd.dwSize = sizeof(dsbd); - dsbd.dwFlags = DSBCAPS_PRIMARYBUFFER; - if (FAILED(pDS->CreateSoundBuffer(&dsbd, &pdsbPrim, NULL))) { - DxSoundExit(); - return 1; - } - - { - // Set the format of the primary sound buffer (not critical if it fails) - if (nAudSampleRate[0] < 44100) { - wfx.nSamplesPerSec = 44100; - } - pdsbPrim->SetFormat(&wfx); - - wfx.nSamplesPerSec = nAudSampleRate[0]; - } - - // Make the loop sound buffer - memset(&dsbd, 0, sizeof(dsbd)); - dsbd.dwSize = sizeof(dsbd); - // A standard secondary buffer (accurate position, plays in the background, and can notify). - dsbd.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLPOSITIONNOTIFY | DSBCAPS_CTRLVOLUME; - dsbd.dwBufferBytes = cbLoopLen; - dsbd.lpwfxFormat = &wfx; // Same format as the primary buffer - if (FAILED(pDS->CreateSoundBuffer(&dsbd, &pdsbLoop, NULL))) { - AudSoundExit(); - return 1; - } - - nAudNextSound = (short*)malloc(nAudSegLen << 2); // The next sound block to put in the stream - if (nAudNextSound == NULL) { - DxSoundExit(); - return 1; - } - - DxSetCallback(NULL); - - DspInit(); - - return 0; -} - -static int DxSoundPlay() -{ - DxBlankSound(); - pdsbLoop->SetVolume(nDSoundVol); - - // Play the looping buffer - if (FAILED(pdsbLoop->Play(0, 0, DSBPLAY_LOOPING))) { - return 1; - } - bAudPlaying = 1; - - return 0; -} - -static int DxSoundStop() -{ - bAudPlaying = 0; - - if (bAudOkay == 0) { - return 1; - } - - // Stop the looping buffer - pdsbLoop->Stop(); - - return 0; -} - -static int DxSoundSetVolume() -{ - if (nAudVolume == 10000) { - nDSoundVol = DSBVOLUME_MAX; - } else { - if (nAudVolume == 0) { - nDSoundVol = DSBVOLUME_MIN; - } else { - nDSoundVol = DSBVOLUME_MAX - (long)(10000.0 * pow(10.0, nAudVolume / -5000.0)) + 100; - } - } - - if (nDSoundVol < DSBVOLUME_MIN) { - nDSoundVol = DSBVOLUME_MIN; - } - - if (FAILED(pdsbLoop->SetVolume(nDSoundVol))) { - return 0; - } - - return 1; -} - -static int DxGetSettings(InterfaceInfo* pInfo) -{ - TCHAR szString[MAX_PATH] = _T(""); - - _sntprintf(szString, MAX_PATH, _T("Audio is delayed by approx. %ims"), int(100000.0 / (nDSoundFps / (nAudSegCount - 1.0)))); - IntInfoAddStringModule(pInfo, szString); - - return 0; -} - -struct AudOut AudOutDx = { DxBlankSound, DxSoundCheck, DxSoundInit, DxSetCallback, DxSoundPlay, DxSoundStop, DxSoundExit, DxSoundSetVolume, DxGetSettings, _T("DirectSound3 audio output") }; diff --git a/jan/src/intf/audio/win32/aud_xaudio2.cpp b/jan/src/intf/audio/win32/aud_xaudio2.cpp deleted file mode 100644 index a6d534b89..000000000 --- a/jan/src/intf/audio/win32/aud_xaudio2.cpp +++ /dev/null @@ -1,379 +0,0 @@ -#include "burner.h" -#include "aud_dsp.h" - -//#ifdef _MSC_VER -#include -#include -#include - -static IXAudio2* pXAudio2 = NULL; -static IXAudio2MasteringVoice* pMasterVoice = NULL; -static IXAudio2SourceVoice* pSourceVoice = NULL; -static XAUDIO2_BUFFER sAudioBuffer; -static XAUDIO2_VOICE_STATE vState; -static IUnknown* pXAPO = NULL; -static bool effectEnable = false; - -int (*XAudio2GetNextSound)(int); - -BYTE* pAudioBuffers = NULL; -int currentBuffer = 0; - -static int cbLoopLen = 0; // Loop length (in bytes) calculated -static int nXAudio2Fps = 0; // Application fps * 100 -static float nXAudio2Vol = 1.0f; - -struct StreamingVoiceContext : public IXAudio2VoiceCallback -{ - HANDLE hBufferEndEvent; - - StreamingVoiceContext() { - hBufferEndEvent = NULL; - hBufferEndEvent = CreateEvent( NULL, FALSE, FALSE, NULL); - } - virtual ~StreamingVoiceContext() { - CloseHandle(hBufferEndEvent); - hBufferEndEvent = NULL; - } - - STDMETHOD_(void, OnBufferEnd) (void * /*pBufferContext*/) { - SetEvent(hBufferEndEvent); - } - - // dummies: - STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32 /*BytesRequired*/) {} - STDMETHOD_(void, OnVoiceProcessingPassEnd) () {} - STDMETHOD_(void, OnStreamEnd) () {} - STDMETHOD_(void, OnBufferStart) (void * /*pBufferContext*/) {} - STDMETHOD_(void, OnLoopEnd) (void * /*pBufferContext*/) {} - STDMETHOD_(void, OnVoiceError) (void * /*pBufferContext*/, HRESULT /*Error*/) {}; -}; -StreamingVoiceContext voiceContext; - -static int XAudio2GetNextSoundFiller(int) -{ - if (nAudNextSound == NULL) { - return 1; - } - AudWriteSilence(); - - return 0; -} - -static int XAudio2SetCallback(int (*pCallback)(int)) -{ - if (pCallback == NULL) { - XAudio2GetNextSound = XAudio2GetNextSoundFiller; - } else { - XAudio2GetNextSound = pCallback; - } - - return 0; -} - -static int XAudio2BlankSound() -{ - if (pAudioBuffers) { - memset(pAudioBuffers, 0, cbLoopLen); - } - - // Also blank the nAudNextSound buffer - if (nAudNextSound) { - AudWriteSilence(); - } - - return 0; -} - -static int XAudio2Check() -{ - if (!pSourceVoice || !pAudioBuffers) { - return 1; - } - - while (true) { - pSourceVoice->GetState(&vState); - - assert(vState.BuffersQueued < (unsigned int)nAudSegCount); - - if (vState.BuffersQueued < (unsigned int)nAudSegCount - 1) { - if (vState.BuffersQueued == 0) { - // buffers ran dry - } - // there is at least one free buffer - break; - } else { - // the maximum number of buffers is currently queued - if (bAlwaysDrawFrames) { - // wait for one buffer to finish playing - WaitForSingleObject(voiceContext.hBufferEndEvent, INFINITE); - } else { - // drop current audio frame - Sleep(2); - return 0; - } - } - } - - XAudio2GetNextSound(true); - - // dsp update - if (nAudDSPModule[1] & 1) { - if (bRunPause) - AudWriteSilence(); - else - DspDo(nAudNextSound, nAudSegLen); - } - - if (nAudDSPModule[1] & 2) { - if (!effectEnable) { - pSourceVoice->EnableEffect(0); - effectEnable = true; - } - } else { - if (effectEnable) { - pSourceVoice->DisableEffect(0); - effectEnable = false; - } - } - - // copy & protect the audio data in own memory area while playing it - memcpy(&pAudioBuffers[currentBuffer * nAudAllocSegLen], nAudNextSound, nAudAllocSegLen); - - sAudioBuffer.AudioBytes = nAudAllocSegLen; - sAudioBuffer.pAudioData = &pAudioBuffers[currentBuffer * nAudAllocSegLen]; - - currentBuffer++; - currentBuffer %= (nAudSegCount); - - HRESULT hr = pSourceVoice->SubmitSourceBuffer(&sAudioBuffer); // send buffer to queue - assert(hr == S_OK); - - return 0; -} - -static int XAudio2EffectInit() -{ - HRESULT hr = XAudio2CreateReverb(&pXAPO); - if (FAILED(hr)) { - return 1; - } - - XAUDIO2_EFFECT_DESCRIPTOR descriptor; - descriptor.InitialState = TRUE; - descriptor.OutputChannels = 2; - descriptor.pEffect = pXAPO; - - XAUDIO2_EFFECT_CHAIN chain; - chain.EffectCount = 1; - chain.pEffectDescriptors = &descriptor; - - hr = pSourceVoice->SetEffectChain(&chain); - if (FAILED(hr)) { - return 1; - } - - if (nAudDSPModule[1] & 2) { - pSourceVoice->EnableEffect(0); - effectEnable = true; - } else { - pSourceVoice->DisableEffect(0); - effectEnable = false; - } - - return 0; -} - -static void XAudio2EffectExit() -{ - RELEASE(pXAPO); -} - -static void XAudio2ExitVoices() -{ - if (pSourceVoice) { - pSourceVoice->Stop(0); - pSourceVoice->DestroyVoice(); - pSourceVoice = NULL; - } - if (pMasterVoice) { - pMasterVoice->DestroyVoice(); - pMasterVoice = NULL; - } -} - -static int XAudio2Exit() -{ - DspExit(); - - // Cleanup XAudio2 - - XAudio2EffectExit(); - - XAudio2ExitVoices(); - - RELEASE(pXAudio2); - CoUninitialize(); - - if (nAudNextSound) { - free(nAudNextSound); - nAudNextSound = NULL; - } - - if (pAudioBuffers) { - free(pAudioBuffers); - pAudioBuffers = NULL; - } - - XAudio2GetNextSound = NULL; - - return 0; -} - -static int XAudio2InitVoices() -{ - HRESULT hr; - - // Create a mastering voice - if (FAILED(hr = pXAudio2->CreateMasteringVoice(&pMasterVoice, XAUDIO2_DEFAULT_CHANNELS, nAudSampleRate[1], 0, 0, NULL))) { - return 1; - } - - // Make the format of the sound - WAVEFORMATEX wfx; - memset(&wfx, 0, sizeof(wfx)); - wfx.cbSize = sizeof(wfx); - wfx.wFormatTag = WAVE_FORMAT_PCM; - wfx.nChannels = 2; // stereo - wfx.nSamplesPerSec = nAudSampleRate[1]; // sample rate - wfx.wBitsPerSample = 16; // 16-bit - wfx.nBlockAlign = wfx.wBitsPerSample * wfx.nChannels / 8; // bytes per sample - wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; - - // Create the source voice - if (FAILED(hr = pXAudio2->CreateSourceVoice(&pSourceVoice, &wfx, 0, XAUDIO2_DEFAULT_FREQ_RATIO, &voiceContext, NULL, NULL))) { - return 1; - } - - return 0; -} - -static int XAudio2Init() -{ - if (nAudSampleRate[1] <= 0) { - return 0; - } - - nXAudio2Fps = nAppVirtualFps; - - // Calculate the Seg Length and Loop length (round to nearest sample) - nAudSegLen = (nAudSampleRate[1] * 100 + (nXAudio2Fps >> 1)) / nXAudio2Fps; - nAudAllocSegLen = nAudSegLen << 2; - cbLoopLen = (nAudSegLen * nAudSegCount) << 2; - - // Initialize XAudio2 - - if (FAILED(CoInitializeEx(NULL, COINIT_MULTITHREADED))) { - return 1; - } - - HRESULT hr; - if (FAILED(hr = XAudio2Create(&pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR))) { - CoUninitialize(); - return 1; - } - - if (XAudio2InitVoices()) { - XAudio2Exit(); - return 1; - } - - ZeroMemory(&sAudioBuffer, sizeof(sAudioBuffer)); - - nAudNextSound = (short*)malloc(nAudAllocSegLen); // The next sound block to put in the stream - if (nAudNextSound == NULL) { - XAudio2Exit(); - return 1; - } - - // create own buffers to store sound data because it must not be - // manipulated while the voice plays from it - pAudioBuffers = (BYTE *)malloc(cbLoopLen); - if (pAudioBuffers == NULL) { - XAudio2Exit(); - return 1; - } - currentBuffer = 0; - - XAudio2SetCallback(NULL); - - DspInit(); - - XAudio2EffectInit(); - - return 0; -} - -static int XAudio2Play() -{ - if (pSourceVoice == NULL) { - return 1; - } - - XAudio2BlankSound(); - pSourceVoice->SetVolume(nXAudio2Vol); - - if (FAILED(pSourceVoice->Start(0))) { - return 1; - } - return 0; -} - -static int XAudio2Stop() -{ - if (!bAudOkay) { - return 1; - } - - if (pSourceVoice) { - pSourceVoice->Stop(0); - } - - return 0; -} - -static int XAudio2SetVolume() -{ - if (nAudVolume == 10000) { - nXAudio2Vol = 1.0f; - } else { - if (nAudVolume == 0) { - nXAudio2Vol = 0.0f; - } else { - nXAudio2Vol = 1.0f - (1.0f * pow(10.0, nAudVolume / -5000.0)) + 0.01f; - } - } - - if (nXAudio2Vol < 0.0f) { - nXAudio2Vol = 0.0f; - } - - if (!pSourceVoice || FAILED(pSourceVoice->SetVolume(nXAudio2Vol))) { - return 1; - } - - return 0; -} - -static int XAudio2GetSettings(InterfaceInfo* pInfo) -{ - TCHAR szString[MAX_PATH] = _T(""); - _sntprintf(szString, MAX_PATH, _T("Audio is delayed by approx. %ims"), int(100000.0 / (nXAudio2Fps / (nAudSegCount - 1.0)))); - IntInfoAddStringModule(pInfo, szString); - return 0; -} - -struct AudOut AudOutXAudio2 = { XAudio2BlankSound, XAudio2Check, XAudio2Init, XAudio2SetCallback, XAudio2Play, XAudio2Stop, XAudio2Exit, XAudio2SetVolume, XAudio2GetSettings, _T("XAudio2 audio output") }; -//#else -//struct AudOut AudOutXAudio2 = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, _T("XAudio2 audio output") }; -//#endif diff --git a/jan/src/intf/audio/win32/dsound_core.cpp b/jan/src/intf/audio/win32/dsound_core.cpp deleted file mode 100644 index 41a19e6b4..000000000 --- a/jan/src/intf/audio/win32/dsound_core.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "burner.h" -#include "dsound_core.h" - -// DirectSoundCreate -HRESULT (WINAPI *_DirectSoundCreate) (LPGUID, LPDIRECTSOUND*, LPUNKNOWN); -HRESULT WINAPI Empty_DirectSoundCreate (LPGUID, LPDIRECTSOUND*, LPUNKNOWN) { return 0; } - -static HINSTANCE hDSCore; -static BOOL nDSCoreInit = FALSE; - -/* -static void DSCore_Exit() -{ - FreeLibrary(hDSCore); -} -*/ - -// Macro for easy handling of functions -#define _LOADFN(_rettype, _name, _empty, _params, _hinst, _str ) \ - \ - _name = (_rettype (WINAPI *)_params) GetProcAddress(_hinst, _str); \ - \ - if(!_name) { \ - _name = _empty; \ - return 0; \ - } - -static INT32 DSCore_GetFunctions() -{ - if(!nDSCoreInit) return 0; - - _LOADFN(HRESULT, _DirectSoundCreate, Empty_DirectSoundCreate, (LPGUID, LPDIRECTSOUND*, LPUNKNOWN), hDSCore, "DirectSoundCreate"); - - return 1; -} - -INT32 DSCore_Init() -{ - hDSCore = LoadLibrary(_T("dsound.dll")); - - if(!hDSCore) { - MessageBox(NULL, _T("Loading of DSOUND.DLL failed."), _T("Error"), MB_OK | MB_ICONERROR); - nDSCoreInit = FALSE; - return 0; - } - - nDSCoreInit = TRUE; - if(!DSCore_GetFunctions()) { - MessageBox(NULL, _T("There was a problem while loading functions from DSOUND.DLL"), _T("Error"), MB_OK | MB_ICONERROR); - return 0; - } - - return 1; -} diff --git a/jan/src/intf/audio/win32/dsound_core.h b/jan/src/intf/audio/win32/dsound_core.h deleted file mode 100644 index 7fadd972e..000000000 --- a/jan/src/intf/audio/win32/dsound_core.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _DSOUND_CORE_ -#define _DSOUND_CORE_ - -#include - -// DirectSoundCreate -extern HRESULT (WINAPI *_DirectSoundCreate)(LPGUID, LPDIRECTSOUND*, LPUNKNOWN); - -INT32 DSCore_Init(); - -#endif diff --git a/jan/src/intf/cd/cd_interface.cpp b/jan/src/intf/cd/cd_interface.cpp deleted file mode 100644 index c7f69d9a2..000000000 --- a/jan/src/intf/cd/cd_interface.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// CD/CD-ROM support -#include "burner.h" - -bool bCDEmuOkay = false; -UINT32 nCDEmuSelect = 0; - -CDEmuStatusValue CDEmuStatus; - -static InterfaceInfo CDEmuInfo = { NULL, NULL, NULL }; - -#if defined BUILD_WIN32 - extern struct CDEmuDo isowavDo; -#elif defined BUILD_SDL - // CD emulation module -#elif defined (_XBOX) - extern struct CDEmuDo isowavDo; -#endif - -static struct CDEmuDo* pCDEmuDo[] = -{ -#if defined BUILD_WIN32 - &isowavDo, -#elif defined BUILD_SDL - // CD emulation module -#elif defined (_XBOX) - &isowavDo, -#endif -}; - -#define CDEMU_LEN (sizeof(pCDEmuDo) / sizeof(pCDEmuDo[0])) - -TCHAR CDEmuImage[MAX_PATH] = _T(""); - - -// ---------------------------------------------------------------------------- - -INT32 CDEmuExit() -{ - IntInfoFree(&CDEmuInfo); - - if (!bCDEmuOkay || nCDEmuSelect >= CDEMU_LEN) { - return 1; - } - bCDEmuOkay = false; - - return pCDEmuDo[nCDEmuSelect]->CDEmuExit(); -} - -INT32 CDEmuInit() -{ - INT32 nRet; - - if (nCDEmuSelect >= CDEMU_LEN) { - return 1; - } - - CDEmuStatus = idle; - - if ((nRet = pCDEmuDo[nCDEmuSelect]->CDEmuInit()) == 0) { - bCDEmuOkay = true; - } - - return nRet; -} - -INT32 CDEmuStop() -{ - if (!bCDEmuOkay || nCDEmuSelect >= CDEMU_LEN) { - return 1; - } - - return pCDEmuDo[nCDEmuSelect]->CDEmuStop(); -} - -INT32 CDEmuPlay(UINT8 M, UINT8 S, UINT8 F) -{ - if (!bCDEmuOkay || nCDEmuSelect >= CDEMU_LEN) { - return 1; - } - - return pCDEmuDo[nCDEmuSelect]->CDEmuPlay(M, S, F); -} - -INT32 CDEmuLoadSector(INT32 LBA, char* pBuffer) -{ - if (!bCDEmuOkay || nCDEmuSelect >= CDEMU_LEN) { - return 0; - } - - return pCDEmuDo[nCDEmuSelect]->CDEmuLoadSector(LBA, pBuffer); -} - -UINT8* CDEmuReadTOC(INT32 track) -{ - if (!bCDEmuOkay || nCDEmuSelect >= CDEMU_LEN) { - return NULL; - } - - return pCDEmuDo[nCDEmuSelect]->CDEmuReadTOC(track); -} - -UINT8* CDEmuReadQChannel() -{ - if (!bCDEmuOkay || nCDEmuSelect >= CDEMU_LEN) { - return NULL; - } - - return pCDEmuDo[nCDEmuSelect]->CDEmuReadQChannel(); -} - -INT32 CDEmuGetSoundBuffer(INT16* buffer, INT32 samples) -{ - if (!bCDEmuOkay || nCDEmuSelect >= CDEMU_LEN) { - return 1; - } - - return pCDEmuDo[nCDEmuSelect]->CDEmuGetSoundBuffer(buffer, samples); -} - -InterfaceInfo* CDEmuGetInfo() -{ - if (IntInfoInit(&CDEmuInfo)) { - IntInfoFree(&CDEmuInfo); - return NULL; - } - - if (bCDEmuOkay) { - - CDEmuInfo.pszModuleName = pCDEmuDo[nCDEmuSelect]->szModuleName; - - if (pCDEmuDo[nCDEmuSelect]->GetPluginSettings) { - pCDEmuDo[nCDEmuSelect]->GetPluginSettings(&CDEmuInfo); - } - } else { - IntInfoAddStringInterface(&CDEmuInfo, _T("CD/CD-ROM emulation module not initialised")); - } - - return &CDEmuInfo; - - return NULL; -} diff --git a/jan/src/intf/cd/cd_interface.h b/jan/src/intf/cd/cd_interface.h deleted file mode 100644 index 2b112276f..000000000 --- a/jan/src/intf/cd/cd_interface.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef CD_INTERFACE_H_ -#define CD_INTERFACE_H_ - -// ---------------------------------------------------------------------------- -// CD emulation module - -enum CDEmuStatusValue { idle = 0, reading, playing, paused, seeking, fastforward, fastreverse }; - -extern TCHAR CDEmuImage[MAX_PATH]; - -INT32 CDEmuInit(); -INT32 CDEmuExit(); -INT32 CDEmuStop(); -INT32 CDEmuPlay(UINT8 M, UINT8 S, UINT8 F); -INT32 CDEmuLoadSector(INT32 LBA, char* pBuffer); -UINT8* CDEmuReadTOC(INT32 track); -UINT8* CDEmuReadQChannel(); -INT32 CDEmuGetSoundBuffer(INT16* buffer, INT32 samples); - -static inline CDEmuStatusValue CDEmuGetStatus() -{ - extern CDEmuStatusValue CDEmuStatus; - - return CDEmuStatus; -} - -static inline void CDEmuStartRead() -{ - extern CDEmuStatusValue CDEmuStatus; - - CDEmuStatus = seeking; -} - -static inline void CDEmuPause() -{ - extern CDEmuStatusValue CDEmuStatus; - - CDEmuStatus = paused; -} - -#endif /*CD_INTERFACE_H_*/ diff --git a/jan/src/intf/cd/sdl/cd_isowav.cpp b/jan/src/intf/cd/sdl/cd_isowav.cpp deleted file mode 100644 index 1cb705597..000000000 --- a/jan/src/intf/cd/sdl/cd_isowav.cpp +++ /dev/null @@ -1,595 +0,0 @@ -// ---------------------------------------------------------------------------- -// iso/cue/wav support -/*----------------------------------------------------------------------------- -Modified by: CaptainCPS-X -Updates: - (10/24/2011) - - removed libmad and MP3 support - - added my custom DirectSound library to add WAV support - - removed most (if not all) references to MP3 - - modified a few other things as needed -------------------------------------------------------------------------------*/ -#include "burner.h" -#include "cdsound.h" - -#define MAXIMUM_NUMBER_TRACKS (100) - -#define CD_FRAMES_MINUTE (60 * 75) -#define CD_FRAMES_SECOND ( 75) -#define CD_FRAMES_PREGAP ( 2 * 75) - -struct isowavTRACK_DATA { - char Control; - char TrackNumber; - char Address[4]; - TCHAR* Filename; -}; - -struct isowavCDROM_TOC { - char FirstTrack; - char LastTrack; - isowavTRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS]; -}; - -static isowavCDROM_TOC* isowavTOC; - -static FILE* isowavFile = NULL; -static int isowavTrack = 0; -static int isowavLBA = 0; - -// ----------------------------------------------------------------------------- - -static const char* isowavLBAToMSF(const int LBA) -{ - static char address[4]; - - address[0] = 0; - address[1] = LBA / CD_FRAMES_MINUTE; - address[2] = LBA % CD_FRAMES_MINUTE / CD_FRAMES_SECOND; - address[3] = LBA % CD_FRAMES_SECOND; - - return address; -} - -static int isowavMSFToLBA(const char* address) -{ - int LBA; - - LBA = address[3]; - LBA += address[2] * CD_FRAMES_SECOND; - LBA += address[1] * CD_FRAMES_MINUTE; - - return LBA; -} - -// ----------------------------------------------------------------------------- - -static int isowavGetTrackSizes() -{ - // determine the lenght of the .iso / .mp3 files to complete the TOC - - FILE* h; - - for (int i = isowavTOC->FirstTrack - 1; i < isowavTOC->LastTrack; i++) { - - const char* address; - - if (isowavTOC->TrackData[i].Control & 4) { - - // data track - - h = _tfopen(isowavTOC->TrackData[i].Filename, _T("rb")); - if (h == NULL) return 1; - - fseek(h, 0, SEEK_END); - - address = isowavLBAToMSF((ftell(h) + 2047) / 2048 + isowavMSFToLBA(isowavTOC->TrackData[i].Address)); - - if(h) fclose(h); - - } else { - - // audio track - - h = _tfopen(isowavTOC->TrackData[i].Filename, _T("rb")); - if (h == NULL)return 1; - - fseek(h, 0, SEEK_END); - - address = isowavLBAToMSF(((ftell(h) + 2047) / 2048) + isowavMSFToLBA(isowavTOC->TrackData[i].Address)); - if(h) fclose(h); - } - - isowavTOC->TrackData[i + 1].Address[0] += 0; // always 0 [?] - isowavTOC->TrackData[i + 1].Address[1] += address[1]; // M - isowavTOC->TrackData[i + 1].Address[2] += address[2]; // S - isowavTOC->TrackData[i + 1].Address[3] += address[3]; // F - } - - return 0; -} - -static int isowavTestISO() -{ - TCHAR fullname[MAX_PATH]; - TCHAR* filename; - int length = 0; - int offset = 0; - int track = 2; - FILE* h; - - _tcscpy(fullname, CDEmuImage); - length = _tcslen(fullname); - - // assume CD-ROM mode1/2048 format - - if (length <= 4 && (_tcscmp(_T(".iso"), fullname + length - 4) || _tcscmp(_T(".bin"), fullname + length - 4))) { - return 1; - } - - // create a TOC with only the data track first - - isowavTOC->FirstTrack = 1; - isowavTOC->LastTrack = 1; - - isowavTOC->TrackData[0].TrackNumber = 1; - - isowavTOC->TrackData[0].Address[1] = 0; - isowavTOC->TrackData[0].Address[2] = 2; - isowavTOC->TrackData[0].Address[3] = 0; - - isowavTOC->TrackData[0].Filename = (TCHAR*)malloc((length + 1) * sizeof(TCHAR)); - if (isowavTOC->TrackData[0].Filename == NULL) { - return 1; - } - _tcscpy(isowavTOC->TrackData[0].Filename, fullname); - - isowavTOC->TrackData[0].Control = 4; - - // if the filename has a number in it, try to find .mp3 tracks - - filename = ExtractFilename(fullname); - offset = (filename - fullname) + length - 6; - while (offset >= 0 && fullname[offset] != _T('0') && fullname[offset + 1] != _T('1')) { - offset--; - } - if (offset < 0) { - return isowavGetTrackSizes(); - } - - _stprintf(fullname + length - 4, _T(".wav")); - - while (1) { - fullname[offset] = _T('0') + track / 10; fullname[offset + 1] = _T('0') + track % 10; - - if ((h = _tfopen(fullname, _T("rb"))) == NULL) { - break; - } - fclose(h); - - isowavTOC->TrackData[track - 1].TrackNumber = track; - - isowavTOC->TrackData[track - 1].Filename = (TCHAR*)malloc((length + 1) * sizeof(TCHAR)); - if (isowavTOC->TrackData[track - 1].Filename == NULL) { - return 1; - } - _tcscpy(isowavTOC->TrackData[track - 1].Filename, fullname); - - isowavTOC->LastTrack = track; - - track++; - } - - return isowavGetTrackSizes(); -} - -static int isowavParseCueFile() -{ - TCHAR szLine[1024]; - TCHAR szFile[1024]; - TCHAR* s; - TCHAR* t; - FILE* h; - int track = 0; - int length; - - isowavTOC->FirstTrack = 1; - isowavTOC->LastTrack = 1; - - isowavTOC->TrackData[0].Address[1] = 0; - isowavTOC->TrackData[0].Address[2] = 2; - isowavTOC->TrackData[0].Address[3] = 0; - - h = _tfopen(CDEmuImage, _T("rt")); - if (h == NULL) { - return 1; - } - - while (1) { - if (_fgetts(szLine, sizeof(szLine), h) == NULL) { - break; - } - - length = _tcslen(szLine); - // get rid of the linefeed at the end - while (length && (szLine[length - 1] == _T('\r') || szLine[length - 1] == _T('\n'))) { - szLine[length - 1] = 0; - length--; - } - - s = szLine; - - // file info - if ((t = LabelCheck(s, _T("FILE"))) != 0) { - s = t; - - TCHAR* szQuote; - - // read filename - QuoteRead(&szQuote, NULL, s); - - _sntprintf(szFile, ExtractFilename(CDEmuImage) - CDEmuImage, _T("%s"), CDEmuImage); - _sntprintf(szFile + (ExtractFilename(CDEmuImage) - CDEmuImage), 1024 - (ExtractFilename(CDEmuImage) - CDEmuImage), _T("/%s"), szQuote); - - continue; - } - - // track info - if ((t = LabelCheck(s, _T("TRACK"))) != 0) { - s = t; - - // track number - track = _tcstol(s, &t, 10); - - if (track < 1 || track > MAXIMUM_NUMBER_TRACKS) { - fclose(h); - return 1; - } - - if (track < isowavTOC->FirstTrack) { - isowavTOC->FirstTrack = track; - } - if (track > isowavTOC->LastTrack) { - isowavTOC->LastTrack = track; - } - isowavTOC->TrackData[track - 1].TrackNumber = track; - - isowavTOC->TrackData[track - 1].Filename = (TCHAR*)malloc((_tcslen(szFile) + 1) * sizeof(TCHAR)); - if (isowavTOC->TrackData[track - 1].Filename == NULL) { - fclose(h); - return 1; - } - _tcscpy(isowavTOC->TrackData[track - 1].Filename, szFile); - - s = t; - - // type of track - - if ((t = LabelCheck(s, _T("MODE1/2048"))) != 0) { - isowavTOC->TrackData[track - 1].Control = 4; - - continue; - } - if ((t = LabelCheck(s, _T("AUDIO"))) != 0) { - isowavTOC->TrackData[track - 1].Control = 0; - - continue; - } - - fclose(h); - return 1; - } - - // pregap - if ((t = LabelCheck(s, _T("PREGAP"))) != 0) { - s = t; - - int M, S, F; - - // pregap M - M = _tcstol(s, &t, 10); - s = t + 1; - // pregap S - S = _tcstol(s, &t, 10); - s = t + 1; - // pregap F - F = _tcstol(s, &t, 10); - - if (M < 0 || M > 100 || S < 0 || S > 59 || F < 0 || F > 74) { - fclose(h); - return 1; - } - - isowavTOC->TrackData[track - 1].Address[1] = M; - isowavTOC->TrackData[track - 1].Address[2] = S; - isowavTOC->TrackData[track - 1].Address[3] = F; - - continue; - } - } - - fclose(h); - - return isowavGetTrackSizes(); -} - -// ----------------------------------------------------------------------------- - -static int isowavExit() -{ - wav_exit(); - - if (isowavFile) { - fclose(isowavFile); - isowavFile = NULL; - } - - isowavTrack = 0; - isowavLBA = 0; - - if (isowavTOC) { - for (int i = 0; i < MAXIMUM_NUMBER_TRACKS; i++) { - free(isowavTOC->TrackData[i].Filename); - } - - free(isowavTOC); - isowavTOC = NULL; - } - - return 0; -} - -static int isowavInit() -{ - wav_exit(); - - isowavTOC = (isowavCDROM_TOC*)malloc(sizeof(isowavCDROM_TOC)); - if (isowavTOC == NULL) { - return 1; - } - memset(isowavTOC, 0, sizeof(isowavCDROM_TOC)); - - TCHAR* filename = ExtractFilename(CDEmuImage); - - if (_tcslen(filename) < 4) { - return 1; - } - - if (_tcscmp(_T(".cue"), filename + _tcslen(filename) - 4) == 0) { - if (isowavParseCueFile()) { - dprintf(_T("*** Couldn't parse .cue file\n")); - isowavExit(); - - return 1; - } - } else { - if (isowavTestISO()) { - dprintf(_T("*** Couldn't find .iso / .bin file\n")); - isowavExit(); - - return 1; - } - } - - dprintf(_T(" CD image TOC read\n")); - - for (int i = isowavTOC->FirstTrack - 1; i < isowavTOC->LastTrack; i++) { - dprintf(_T(" track %2i start %02i:%02i:%02i control 0x%02X %s\n"), isowavTOC->TrackData[i].TrackNumber, isowavTOC->TrackData[i].Address[1], isowavTOC->TrackData[i].Address[2], isowavTOC->TrackData[i].Address[3], isowavTOC->TrackData[i].Control, isowavTOC->TrackData[i].Filename); - } - dprintf(_T(" total running time %02i:%02i:%02i\n"), isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[1], isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[2], isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[3]); - - CDEmuStatus = idle; - - return 0; -} - -TCHAR* GetIsoPath() -{ - if(isowavTOC) { - return isowavTOC->TrackData[0].Filename; - } - return NULL; -} - -static int isowavStop() -{ - wav_stop(); - - if (isowavFile) { - fclose(isowavFile); - isowavFile = NULL; - } - CDEmuStatus = idle; - return 0; -} - -static int isowavPlayLBA(int LBA) -{ - isowavLBA = LBA; - - for (isowavTrack = isowavTOC->FirstTrack - 1; isowavTrack < isowavTOC->LastTrack; isowavTrack++) { - if (isowavLBA < isowavMSFToLBA(isowavTOC->TrackData[isowavTrack + 1].Address)) { - break; - } - } - - if (isowavTrack >= isowavTOC->LastTrack) { - return 1; - } - - bprintf(PRINT_IMPORTANT, _T(" playing track %2i - %s\n"), isowavTrack + 1, isowavTOC->TrackData[isowavTrack].Filename); - - isowavFile = _tfopen(isowavTOC->TrackData[isowavTrack].Filename, _T("rb")); - if (isowavFile == NULL) { - return 1; - } - - if( strstr(isowavTOC->TrackData[isowavTrack].Filename, _T(".wav")) || strstr(isowavTOC->TrackData[isowavTrack].Filename, _T(".WAV"))) { - // is a wav, no need to keep this file pointer - if (isowavFile) { - fclose(isowavFile); - isowavFile = NULL; - } - - if(wav_open(isowavTOC->TrackData[isowavTrack].Filename)) { - wav_play(); - } else { - // error creating the WAV stream - return 1; - } - } - - //dprintf(_T("*** WAV: wBitsPerSample: %d \n"), wav->g_pStreamingSound->m_pWaveFile->m_pwfx->wBitsPerSample); - //dprintf(_T("*** WAV: nAvgBytesPerSec: %d \n"), wav->g_pStreamingSound->m_pWaveFile->m_pwfx->nAvgBytesPerSec); - //dprintf(_T("*** WAV: m_dwSize: %d \n"), wav->g_pStreamingSound->m_pWaveFile->m_dwSize); - //dprintf(_T("*** WAV: nBlockAlign: %d \n"), wav->g_pStreamingSound->m_pWaveFile->m_pwfx->nBlockAlign); - - isowavLBA = isowavMSFToLBA(isowavTOC->TrackData[isowavTrack].Address); - CDEmuStatus = playing; - - return 0; -} - -static int isowavPlay(unsigned char M, unsigned char S, unsigned char F) -{ - const char address[] = { 0, M, S, F }; - - return isowavPlayLBA(isowavMSFToLBA(address)); -} - -static int isowavLoadSector(int LBA, char* pBuffer) -{ - LBA += CD_FRAMES_PREGAP; - - if (LBA != isowavLBA) { - - int track; - - for (track = isowavTOC->FirstTrack - 1; track < isowavTOC->LastTrack; track++) { - if (LBA < isowavMSFToLBA(isowavTOC->TrackData[track + 1].Address)) { - break; - } - } - - if (isowavFile == NULL || track != isowavTrack) { - isowavStop(); - - isowavTrack = track; - - bprintf(PRINT_IMPORTANT, _T(" reading track %2i - %s\n"), isowavTrack + 1, isowavTOC->TrackData[isowavTrack].Filename); - - isowavFile = _tfopen(isowavTOC->TrackData[isowavTrack].Filename, _T("rb")); - if (isowavFile == NULL) { - return 0; - } - } - - if (fseek(isowavFile, (LBA - isowavMSFToLBA(isowavTOC->TrackData[isowavTrack].Address)) * 2048, SEEK_SET)) { - dprintf(_T("*** couldn't seek\n")); - - return 0; - } - - isowavLBA = (ftell(isowavFile) + 2047) / 2048; - - CDEmuStatus = reading; - } - - if (fread(pBuffer, 1, 2048, isowavFile) <= 0) { - dprintf(_T("*** couldn't read from file\n")); - - isowavStop(); - - return 0; - } - - isowavLBA = isowavMSFToLBA(isowavTOC->TrackData[isowavTrack].Address) + (ftell(isowavFile) + 2047) / 2048; - - return isowavLBA - CD_FRAMES_PREGAP; -} - -static unsigned char* isowavReadTOC(int track) -{ - static unsigned char TOCEntry[4]; - - if (track == -1) { - TOCEntry[0] = isowavTOC->FirstTrack - 1; - TOCEntry[1] = isowavTOC->LastTrack; - TOCEntry[2] = 0; - TOCEntry[3] = 0; - - return TOCEntry; - } - if (track == -2) { - TOCEntry[0] = isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[1]; - TOCEntry[1] = isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[2]; - TOCEntry[2] = isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[3]; - - TOCEntry[3] = 0; - - return TOCEntry; - } - - if (track >= isowavTOC->FirstTrack - 1 && track <= isowavTOC->LastTrack) { - TOCEntry[0] = isowavTOC->TrackData[track - 1].Address[1]; - TOCEntry[1] = isowavTOC->TrackData[track - 1].Address[2]; - TOCEntry[2] = isowavTOC->TrackData[track - 1].Address[3]; - TOCEntry[3] = isowavTOC->TrackData[track - 1].Control; - } - - return TOCEntry; -} - -static unsigned char* isowavReadQChannel() -{ - static unsigned char QChannelData[8]; - - switch (CDEmuStatus) { - case reading: - case playing: { - const char* AddressAbs = isowavLBAToMSF(isowavLBA); - const char* AddressRel = isowavLBAToMSF(isowavLBA - isowavMSFToLBA(isowavTOC->TrackData[isowavTrack].Address)); - - QChannelData[0] = isowavTOC->TrackData[isowavTrack].TrackNumber; - - QChannelData[1] = AddressAbs[1]; - QChannelData[2] = AddressAbs[2]; - QChannelData[3] = AddressAbs[3]; - - QChannelData[4] = AddressRel[1]; - QChannelData[5] = AddressRel[2]; - QChannelData[6] = AddressRel[3]; - - QChannelData[7] = isowavTOC->TrackData[isowavTrack].Control; - - break; - } - case paused: { - break; - } - default: { - memset(QChannelData, 0, sizeof(QChannelData)); - } - } - - return QChannelData; -} - -static int isowavGetSoundBuffer(short* /*buffer*/, int /*samples*/) -{ - // --------------------------------------------------------------------- - // TODO: - // Port the old 'isomp3GetSoundBuffer()' function from 'cd_isomp3.cpp' - // to use WAVE stream data, porting that function will fix the - // 00:00 progress status on the main NeoGeo CD BIOS menu. - // --------------------------------------------------------------------- - - return 0; -} - -static int isowavGetSettings(InterfaceInfo* /*pInfo*/) -{ - return 0; -} - -struct CDEmuDo isowavDo = { isowavExit, isowavInit, isowavStop, isowavPlay, isowavLoadSector, isowavReadTOC, isowavReadQChannel, isowavGetSoundBuffer, isowavGetSettings, _T("cue/iso/wav CD emulation") }; diff --git a/jan/src/intf/cd/sdl/cdsound.cpp b/jan/src/intf/cd/sdl/cdsound.cpp deleted file mode 100644 index 7c644bedd..000000000 --- a/jan/src/intf/cd/sdl/cdsound.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "burner.h" -#include "cd_interface.h" - -void wav_exit() -{ -} - -int wav_open(TCHAR* szFile) -{ -} - -void wav_stop() -{ -} - -void wav_play() -{ -} - -void wav_pause(bool bResume) -{ -} diff --git a/jan/src/intf/cd/sdl/cdsound.h b/jan/src/intf/cd/sdl/cdsound.h deleted file mode 100644 index 21dfa68af..000000000 --- a/jan/src/intf/cd/sdl/cdsound.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _WavClass_H_ -#define _WavClass_H_ - -void wav_exit(); -int wav_open(TCHAR* szFile); -void wav_stop(); -void wav_play(); - -#endif diff --git a/jan/src/intf/cd/win32/cd_isowav.cpp b/jan/src/intf/cd/win32/cd_isowav.cpp deleted file mode 100644 index 1beca47c9..000000000 --- a/jan/src/intf/cd/win32/cd_isowav.cpp +++ /dev/null @@ -1,595 +0,0 @@ -// ---------------------------------------------------------------------------- -// iso/cue/wav support -/*----------------------------------------------------------------------------- -Modified by: CaptainCPS-X -Updates: - (10/24/2011) - - removed libmad and MP3 support - - added my custom DirectSound library to add WAV support - - removed most (if not all) references to MP3 - - modified a few other things as needed -------------------------------------------------------------------------------*/ -#include "burner.h" -#include "cdsound.h" - -#define MAXIMUM_NUMBER_TRACKS (100) - -#define CD_FRAMES_MINUTE (60 * 75) -#define CD_FRAMES_SECOND ( 75) -#define CD_FRAMES_PREGAP ( 2 * 75) - -struct isowavTRACK_DATA { - char Control; - char TrackNumber; - char Address[4]; - TCHAR* Filename; -}; - -struct isowavCDROM_TOC { - char FirstTrack; - char LastTrack; - isowavTRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS]; -}; - -static isowavCDROM_TOC* isowavTOC; - -static FILE* isowavFile = NULL; -static int isowavTrack = 0; -static int isowavLBA = 0; - -// ----------------------------------------------------------------------------- - -static const char* isowavLBAToMSF(const int LBA) -{ - static char address[4]; - - address[0] = 0; - address[1] = LBA / CD_FRAMES_MINUTE; - address[2] = LBA % CD_FRAMES_MINUTE / CD_FRAMES_SECOND; - address[3] = LBA % CD_FRAMES_SECOND; - - return address; -} - -static int isowavMSFToLBA(const char* address) -{ - int LBA; - - LBA = address[3]; - LBA += address[2] * CD_FRAMES_SECOND; - LBA += address[1] * CD_FRAMES_MINUTE; - - return LBA; -} - -// ----------------------------------------------------------------------------- - -static int isowavGetTrackSizes() -{ - // determine the lenght of the .iso / .mp3 files to complete the TOC - - FILE* h; - - for (int i = isowavTOC->FirstTrack - 1; i < isowavTOC->LastTrack; i++) { - - const char* address; - - if (isowavTOC->TrackData[i].Control & 4) { - - // data track - - h = _tfopen(isowavTOC->TrackData[i].Filename, _T("rb")); - if (h == NULL) return 1; - - fseek(h, 0, SEEK_END); - - address = isowavLBAToMSF((ftell(h) + 2047) / 2048 + isowavMSFToLBA(isowavTOC->TrackData[i].Address)); - - if(h) fclose(h); - - } else { - - // audio track - - h = _tfopen(isowavTOC->TrackData[i].Filename, _T("rb")); - if (h == NULL)return 1; - - fseek(h, 0, SEEK_END); - - address = isowavLBAToMSF(((ftell(h) + 2047) / 2048) + isowavMSFToLBA(isowavTOC->TrackData[i].Address)); - if(h) fclose(h); - } - - isowavTOC->TrackData[i + 1].Address[0] += 0; // always 0 [?] - isowavTOC->TrackData[i + 1].Address[1] += address[1]; // M - isowavTOC->TrackData[i + 1].Address[2] += address[2]; // S - isowavTOC->TrackData[i + 1].Address[3] += address[3]; // F - } - - return 0; -} - -static int isowavTestISO() -{ - TCHAR fullname[MAX_PATH]; - TCHAR* filename; - int length = 0; - int offset = 0; - int track = 2; - FILE* h; - - _tcscpy(fullname, CDEmuImage); - length = _tcslen(fullname); - - // assume CD-ROM mode1/2048 format - - if (length <= 4 && (_tcscmp(_T(".iso"), fullname + length - 4) || _tcscmp(_T(".bin"), fullname + length - 4))) { - return 1; - } - - // create a TOC with only the data track first - - isowavTOC->FirstTrack = 1; - isowavTOC->LastTrack = 1; - - isowavTOC->TrackData[0].TrackNumber = 1; - - isowavTOC->TrackData[0].Address[1] = 0; - isowavTOC->TrackData[0].Address[2] = 2; - isowavTOC->TrackData[0].Address[3] = 0; - - isowavTOC->TrackData[0].Filename = (TCHAR*)malloc((length + 1) * sizeof(TCHAR)); - if (isowavTOC->TrackData[0].Filename == NULL) { - return 1; - } - _tcscpy(isowavTOC->TrackData[0].Filename, fullname); - - isowavTOC->TrackData[0].Control = 4; - - // if the filename has a number in it, try to find .mp3 tracks - - filename = ExtractFilename(fullname); - offset = (filename - fullname) + length - 6; - while (offset >= 0 && fullname[offset] != _T('0') && fullname[offset + 1] != _T('1')) { - offset--; - } - if (offset < 0) { - return isowavGetTrackSizes(); - } - - _stprintf(fullname + length - 4, _T(".wav")); - - while (1) { - fullname[offset] = _T('0') + track / 10; fullname[offset + 1] = _T('0') + track % 10; - - if ((h = _tfopen(fullname, _T("rb"))) == NULL) { - break; - } - fclose(h); - - isowavTOC->TrackData[track - 1].TrackNumber = track; - - isowavTOC->TrackData[track - 1].Filename = (TCHAR*)malloc((length + 1) * sizeof(TCHAR)); - if (isowavTOC->TrackData[track - 1].Filename == NULL) { - return 1; - } - _tcscpy(isowavTOC->TrackData[track - 1].Filename, fullname); - - isowavTOC->LastTrack = track; - - track++; - } - - return isowavGetTrackSizes(); -} - -static int isowavParseCueFile() -{ - TCHAR szLine[1024]; - TCHAR szFile[1024]; - TCHAR* s; - TCHAR* t; - FILE* h; - int track = 0; - int length; - - isowavTOC->FirstTrack = 1; - isowavTOC->LastTrack = 1; - - isowavTOC->TrackData[0].Address[1] = 0; - isowavTOC->TrackData[0].Address[2] = 2; - isowavTOC->TrackData[0].Address[3] = 0; - - h = _tfopen(CDEmuImage, _T("rt")); - if (h == NULL) { - return 1; - } - - while (1) { - if (_fgetts(szLine, sizeof(szLine), h) == NULL) { - break; - } - - length = _tcslen(szLine); - // get rid of the linefeed at the end - while (length && (szLine[length - 1] == _T('\r') || szLine[length - 1] == _T('\n'))) { - szLine[length - 1] = 0; - length--; - } - - s = szLine; - - // file info - if ((t = LabelCheck(s, _T("FILE"))) != 0) { - s = t; - - TCHAR* szQuote; - - // read filename - QuoteRead(&szQuote, NULL, s); - - _sntprintf(szFile, ExtractFilename(CDEmuImage) - CDEmuImage, _T("%s"), CDEmuImage); - _sntprintf(szFile + (ExtractFilename(CDEmuImage) - CDEmuImage), 1024 - (ExtractFilename(CDEmuImage) - CDEmuImage), _T("/%s"), szQuote); - - continue; - } - - // track info - if ((t = LabelCheck(s, _T("TRACK"))) != 0) { - s = t; - - // track number - track = _tcstol(s, &t, 10); - - if (track < 1 || track > MAXIMUM_NUMBER_TRACKS) { - fclose(h); - return 1; - } - - if (track < isowavTOC->FirstTrack) { - isowavTOC->FirstTrack = track; - } - if (track > isowavTOC->LastTrack) { - isowavTOC->LastTrack = track; - } - isowavTOC->TrackData[track - 1].TrackNumber = track; - - isowavTOC->TrackData[track - 1].Filename = (TCHAR*)malloc((_tcslen(szFile) + 1) * sizeof(TCHAR)); - if (isowavTOC->TrackData[track - 1].Filename == NULL) { - fclose(h); - return 1; - } - _tcscpy(isowavTOC->TrackData[track - 1].Filename, szFile); - - s = t; - - // type of track - - if ((t = LabelCheck(s, _T("MODE1/2048"))) != 0) { - isowavTOC->TrackData[track - 1].Control = 4; - - continue; - } - if ((t = LabelCheck(s, _T("AUDIO"))) != 0) { - isowavTOC->TrackData[track - 1].Control = 0; - - continue; - } - - fclose(h); - return 1; - } - - // pregap - if ((t = LabelCheck(s, _T("PREGAP"))) != 0) { - s = t; - - int M, S, F; - - // pregap M - M = _tcstol(s, &t, 10); - s = t + 1; - // pregap S - S = _tcstol(s, &t, 10); - s = t + 1; - // pregap F - F = _tcstol(s, &t, 10); - - if (M < 0 || M > 100 || S < 0 || S > 59 || F < 0 || F > 74) { - fclose(h); - return 1; - } - - isowavTOC->TrackData[track - 1].Address[1] = M; - isowavTOC->TrackData[track - 1].Address[2] = S; - isowavTOC->TrackData[track - 1].Address[3] = F; - - continue; - } - } - - fclose(h); - - return isowavGetTrackSizes(); -} - -// ----------------------------------------------------------------------------- - -static int isowavExit() -{ - wav_exit(); - - if (isowavFile) { - fclose(isowavFile); - isowavFile = NULL; - } - - isowavTrack = 0; - isowavLBA = 0; - - if (isowavTOC) { - for (int i = 0; i < MAXIMUM_NUMBER_TRACKS; i++) { - free(isowavTOC->TrackData[i].Filename); - } - - free(isowavTOC); - isowavTOC = NULL; - } - - return 0; -} - -static int isowavInit() -{ - wav_exit(); - - isowavTOC = (isowavCDROM_TOC*)malloc(sizeof(isowavCDROM_TOC)); - if (isowavTOC == NULL) { - return 1; - } - memset(isowavTOC, 0, sizeof(isowavCDROM_TOC)); - - TCHAR* filename = ExtractFilename(CDEmuImage); - - if (_tcslen(filename) < 4) { - return 1; - } - - if (_tcscmp(_T(".cue"), filename + _tcslen(filename) - 4) == 0) { - if (isowavParseCueFile()) { - dprintf(_T("*** Couldn't parse .cue file\n")); - isowavExit(); - - return 1; - } - } else { - if (isowavTestISO()) { - dprintf(_T("*** Couldn't find .iso / .bin file\n")); - isowavExit(); - - return 1; - } - } - - dprintf(_T(" CD image TOC read\n")); - - for (int i = isowavTOC->FirstTrack - 1; i < isowavTOC->LastTrack; i++) { - dprintf(_T(" track %2i start %02i:%02i:%02i control 0x%02X %s\n"), isowavTOC->TrackData[i].TrackNumber, isowavTOC->TrackData[i].Address[1], isowavTOC->TrackData[i].Address[2], isowavTOC->TrackData[i].Address[3], isowavTOC->TrackData[i].Control, isowavTOC->TrackData[i].Filename); - } - dprintf(_T(" total running time %02i:%02i:%02i\n"), isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[1], isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[2], isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[3]); - - CDEmuStatus = idle; - - return 0; -} - -TCHAR* GetIsoPath() -{ - if(isowavTOC) { - return isowavTOC->TrackData[0].Filename; - } - return NULL; -} - -static int isowavStop() -{ - wav_stop(); - - if (isowavFile) { - fclose(isowavFile); - isowavFile = NULL; - } - CDEmuStatus = idle; - return 0; -} - -static int isowavPlayLBA(int LBA) -{ - isowavLBA = LBA; - - for (isowavTrack = isowavTOC->FirstTrack - 1; isowavTrack < isowavTOC->LastTrack; isowavTrack++) { - if (isowavLBA < isowavMSFToLBA(isowavTOC->TrackData[isowavTrack + 1].Address)) { - break; - } - } - - if (isowavTrack >= isowavTOC->LastTrack) { - return 1; - } - - bprintf(PRINT_IMPORTANT, _T(" playing track %2i - %s\n"), isowavTrack + 1, isowavTOC->TrackData[isowavTrack].Filename); - - isowavFile = _tfopen(isowavTOC->TrackData[isowavTrack].Filename, _T("rb")); - if (isowavFile == NULL) { - return 1; - } - - if( _tcsstr(isowavTOC->TrackData[isowavTrack].Filename, _T(".wav")) || _tcsstr(isowavTOC->TrackData[isowavTrack].Filename, _T(".WAV"))) { - // is a wav, no need to keep this file pointer - if (isowavFile) { - fclose(isowavFile); - isowavFile = NULL; - } - - if(wav_open(isowavTOC->TrackData[isowavTrack].Filename)) { - wav_play(); - } else { - // error creating the WAV stream - return 1; - } - } - - //dprintf(_T("*** WAV: wBitsPerSample: %d \n"), wav->g_pStreamingSound->m_pWaveFile->m_pwfx->wBitsPerSample); - //dprintf(_T("*** WAV: nAvgBytesPerSec: %d \n"), wav->g_pStreamingSound->m_pWaveFile->m_pwfx->nAvgBytesPerSec); - //dprintf(_T("*** WAV: m_dwSize: %d \n"), wav->g_pStreamingSound->m_pWaveFile->m_dwSize); - //dprintf(_T("*** WAV: nBlockAlign: %d \n"), wav->g_pStreamingSound->m_pWaveFile->m_pwfx->nBlockAlign); - - isowavLBA = isowavMSFToLBA(isowavTOC->TrackData[isowavTrack].Address); - CDEmuStatus = playing; - - return 0; -} - -static int isowavPlay(unsigned char M, unsigned char S, unsigned char F) -{ - const char address[] = { 0, M, S, F }; - - return isowavPlayLBA(isowavMSFToLBA(address)); -} - -static int isowavLoadSector(int LBA, char* pBuffer) -{ - LBA += CD_FRAMES_PREGAP; - - if (LBA != isowavLBA) { - - int track; - - for (track = isowavTOC->FirstTrack - 1; track < isowavTOC->LastTrack; track++) { - if (LBA < isowavMSFToLBA(isowavTOC->TrackData[track + 1].Address)) { - break; - } - } - - if (isowavFile == NULL || track != isowavTrack) { - isowavStop(); - - isowavTrack = track; - - bprintf(PRINT_IMPORTANT, _T(" reading track %2i - %s\n"), isowavTrack + 1, isowavTOC->TrackData[isowavTrack].Filename); - - isowavFile = _tfopen(isowavTOC->TrackData[isowavTrack].Filename, _T("rb")); - if (isowavFile == NULL) { - return 0; - } - } - - if (fseek(isowavFile, (LBA - isowavMSFToLBA(isowavTOC->TrackData[isowavTrack].Address)) * 2048, SEEK_SET)) { - dprintf(_T("*** couldn't seek\n")); - - return 0; - } - - isowavLBA = (ftell(isowavFile) + 2047) / 2048; - - CDEmuStatus = reading; - } - - if (fread(pBuffer, 1, 2048, isowavFile) <= 0) { - dprintf(_T("*** couldn't read from file\n")); - - isowavStop(); - - return 0; - } - - isowavLBA = isowavMSFToLBA(isowavTOC->TrackData[isowavTrack].Address) + (ftell(isowavFile) + 2047) / 2048; - - return isowavLBA - CD_FRAMES_PREGAP; -} - -static unsigned char* isowavReadTOC(int track) -{ - static unsigned char TOCEntry[4]; - - if (track == -1) { - TOCEntry[0] = isowavTOC->FirstTrack - 1; - TOCEntry[1] = isowavTOC->LastTrack; - TOCEntry[2] = 0; - TOCEntry[3] = 0; - - return TOCEntry; - } - if (track == -2) { - TOCEntry[0] = isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[1]; - TOCEntry[1] = isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[2]; - TOCEntry[2] = isowavTOC->TrackData[(int)isowavTOC->LastTrack].Address[3]; - - TOCEntry[3] = 0; - - return TOCEntry; - } - - if (track >= isowavTOC->FirstTrack - 1 && track <= isowavTOC->LastTrack) { - TOCEntry[0] = isowavTOC->TrackData[track - 1].Address[1]; - TOCEntry[1] = isowavTOC->TrackData[track - 1].Address[2]; - TOCEntry[2] = isowavTOC->TrackData[track - 1].Address[3]; - TOCEntry[3] = isowavTOC->TrackData[track - 1].Control; - } - - return TOCEntry; -} - -static unsigned char* isowavReadQChannel() -{ - static unsigned char QChannelData[8]; - - switch (CDEmuStatus) { - case reading: - case playing: { - const char* AddressAbs = isowavLBAToMSF(isowavLBA); - const char* AddressRel = isowavLBAToMSF(isowavLBA - isowavMSFToLBA(isowavTOC->TrackData[isowavTrack].Address)); - - QChannelData[0] = isowavTOC->TrackData[isowavTrack].TrackNumber; - - QChannelData[1] = AddressAbs[1]; - QChannelData[2] = AddressAbs[2]; - QChannelData[3] = AddressAbs[3]; - - QChannelData[4] = AddressRel[1]; - QChannelData[5] = AddressRel[2]; - QChannelData[6] = AddressRel[3]; - - QChannelData[7] = isowavTOC->TrackData[isowavTrack].Control; - - break; - } - case paused: { - break; - } - default: { - memset(QChannelData, 0, sizeof(QChannelData)); - } - } - - return QChannelData; -} - -static int isowavGetSoundBuffer(short* /*buffer*/, int /*samples*/) -{ - // --------------------------------------------------------------------- - // TODO: - // Port the old 'isomp3GetSoundBuffer()' function from 'cd_isomp3.cpp' - // to use WAVE stream data, porting that function will fix the - // 00:00 progress status on the main NeoGeo CD BIOS menu. - // --------------------------------------------------------------------- - - return 0; -} - -static int isowavGetSettings(InterfaceInfo* /*pInfo*/) -{ - return 0; -} - -struct CDEmuDo isowavDo = { isowavExit, isowavInit, isowavStop, isowavPlay, isowavLoadSector, isowavReadTOC, isowavReadQChannel, isowavGetSoundBuffer, isowavGetSettings, _T("cue/iso/wav CD emulation") }; diff --git a/jan/src/intf/cd/win32/cdsound.cpp b/jan/src/intf/cd/win32/cdsound.cpp deleted file mode 100644 index d49aff761..000000000 --- a/jan/src/intf/cd/win32/cdsound.cpp +++ /dev/null @@ -1,433 +0,0 @@ -#include "burner.h" -#include "cdsound.h" - -WavClass::WavClass() -{ - m_DirectSound = 0; - m_primaryBuffer = 0; - m_secondaryBuffer1 = 0; -} - -WavClass::WavClass(const WavClass&) -{ - // -} - -WavClass::~WavClass() -{ - // -} - -bool WavClass::Initialize(HWND hwnd, TCHAR* szFile) -{ - bool result; - - // Initialize direct sound and the primary sound buffer. - result = InitializeDirectSound(hwnd); - if(!result) - { - return false; - } - - // Load a wave audio file onto a secondary buffer. - result = LoadWaveFile(szFile, &m_secondaryBuffer1); - if(!result) - { - return false; - } - - return true; -} - -void WavClass::Shutdown() -{ - // Release the secondary buffer. - ShutdownWaveFile(&m_secondaryBuffer1); - - // Shutdown the Direct Sound API. - ShutdownDirectSound(); - - return; -} - -bool WavClass::InitializeDirectSound(HWND hwnd) -{ - HRESULT result; - DSBUFFERDESC bufferDesc; - WAVEFORMATEX waveFormat; - - // Initialize the direct sound interface pointer for the default sound device. - result = _DirectSoundCreate(NULL, &m_DirectSound, NULL); - if(FAILED(result)) - { - return false; - } - - // Set the cooperative level to priority so the format of the primary sound buffer can be modified. - result = m_DirectSound->SetCooperativeLevel(hwnd, DSSCL_PRIORITY); - if(FAILED(result)) - { - return false; - } - - GUID guidNULL; - memset(&guidNULL,0,sizeof(GUID)); - - // Setup the primary buffer description. - bufferDesc.dwSize = sizeof(DSBUFFERDESC); - bufferDesc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_CTRLVOLUME; - bufferDesc.dwBufferBytes = 0; - bufferDesc.dwReserved = 0; - bufferDesc.lpwfxFormat = NULL; - bufferDesc.guid3DAlgorithm = guidNULL; //GUID_NULL; - - // Get control of the primary sound buffer on the default sound device. - result = m_DirectSound->CreateSoundBuffer(&bufferDesc, &m_primaryBuffer, NULL); - if(FAILED(result)) - { - return false; - } - - // Setup the format of the primary sound bufffer. - // In this case it is a .WAV file recorded at 44,100 samples per second in 16-bit stereo (cd audio format). - waveFormat.wFormatTag = WAVE_FORMAT_PCM; - waveFormat.nSamplesPerSec = 44100; - waveFormat.wBitsPerSample = 16; - waveFormat.nChannels = 2; - waveFormat.nBlockAlign = (waveFormat.wBitsPerSample / 8) * waveFormat.nChannels; - waveFormat.nAvgBytesPerSec = waveFormat.nSamplesPerSec * waveFormat.nBlockAlign; - waveFormat.cbSize = 0; - - // Set the primary buffer to be the wave format specified. - result = m_primaryBuffer->SetFormat(&waveFormat); - if(FAILED(result)) - { - return false; - } - - return true; -} - -void WavClass::ShutdownDirectSound() -{ - // Release the primary sound buffer pointer. - if(m_primaryBuffer) - { - m_primaryBuffer->Release(); - m_primaryBuffer = 0; - } - - // Release the direct sound interface pointer. - if(m_DirectSound) - { - m_DirectSound->Release(); - m_DirectSound = 0; - } - - return; -} - -bool WavClass::LoadWaveFile(TCHAR* filename, IDirectSoundBuffer** secondaryBuffer) -{ - FILE* filePtr; - unsigned int count; - WaveHeaderType waveFileHeader; - WAVEFORMATEX waveFormat; - DSBUFFERDESC bufferDesc; - HRESULT result; - IDirectSoundBuffer* tempBuffer; - unsigned char* waveData; - unsigned char* bufferPtr; - unsigned long bufferSize; - - - // Open the wave file in binary. - filePtr = _tfopen(filename, _T("rb")); - if(!filePtr) - { - return false; - } - - // Read in the wave file header. - count = fread(&waveFileHeader, sizeof(waveFileHeader), 1, filePtr); - if(count != 1) - { - fclose(filePtr); - return false; - } - - // Check that the chunk ID is the RIFF format. - if((waveFileHeader.chunkId[0] != 'R') || (waveFileHeader.chunkId[1] != 'I') || - (waveFileHeader.chunkId[2] != 'F') || (waveFileHeader.chunkId[3] != 'F')) - { - fclose(filePtr); - return false; - } - - // Check that the file format is the WAVE format. - if((waveFileHeader.format[0] != 'W') || (waveFileHeader.format[1] != 'A') || - (waveFileHeader.format[2] != 'V') || (waveFileHeader.format[3] != 'E')) - { - fclose(filePtr); - return false; - } - - // Check that the sub chunk ID is the fmt format. - if((waveFileHeader.subChunkId[0] != 'f') || (waveFileHeader.subChunkId[1] != 'm') || - (waveFileHeader.subChunkId[2] != 't') || (waveFileHeader.subChunkId[3] != ' ')) - { - fclose(filePtr); - return false; - } - - // Check that the audio format is WAVE_FORMAT_PCM. - if(waveFileHeader.audioFormat != WAVE_FORMAT_PCM) - { - fclose(filePtr); - return false; - } - - // Check that the wave file was recorded in stereo format. - if(waveFileHeader.numChannels != 2) - { - fclose(filePtr); - return false; - } - - // Check that the wave file was recorded at a sample rate of 44.1 KHz. - if(waveFileHeader.sampleRate != 44100) - { - fclose(filePtr); - return false; - } - - // Ensure that the wave file was recorded in 16 bit format. - if(waveFileHeader.bitsPerSample != 16) - { - fclose(filePtr); - return false; - } - - // Check for the data chunk header. - if((waveFileHeader.dataChunkId[0] != 'd') || (waveFileHeader.dataChunkId[1] != 'a') || - (waveFileHeader.dataChunkId[2] != 't') || (waveFileHeader.dataChunkId[3] != 'a')) - { - fclose(filePtr); - return false; - } - - // Set the wave format of secondary buffer that this wave file will be loaded onto. - waveFormat.wFormatTag = WAVE_FORMAT_PCM; - waveFormat.nSamplesPerSec = 44100; - waveFormat.wBitsPerSample = 16; - waveFormat.nChannels = 2; - waveFormat.nBlockAlign = (waveFormat.wBitsPerSample / 8) * waveFormat.nChannels; - waveFormat.nAvgBytesPerSec = waveFormat.nSamplesPerSec * waveFormat.nBlockAlign; - waveFormat.cbSize = 0; - - GUID guidNULL; - memset(&guidNULL,0,sizeof(GUID)); - - // Set the buffer description of the secondary sound buffer that the wave file will be loaded onto. - bufferDesc.dwSize = sizeof(DSBUFFERDESC); - bufferDesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLPOSITIONNOTIFY | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLPAN | DSBCAPS_CTRLFREQUENCY; - bufferDesc.dwBufferBytes = waveFileHeader.dataSize; - bufferDesc.dwReserved = 0; - bufferDesc.lpwfxFormat = &waveFormat; - bufferDesc.guid3DAlgorithm = guidNULL; //GUID_NULL; - - // Create a temporary sound buffer with the specific buffer settings. - result = m_DirectSound->CreateSoundBuffer(&bufferDesc, &tempBuffer, NULL); - if(FAILED(result)) - { - fclose(filePtr); - return false; - } - - // Test the buffer format against the direct sound 8 interface and create the secondary buffer. - result = tempBuffer->QueryInterface(IID_IDirectSoundBuffer, (void**)&*secondaryBuffer); - if(FAILED(result)) - { - fclose(filePtr); - return false; - } - - // Release the temporary buffer. - tempBuffer->Release(); - tempBuffer = 0; - - // Move to the beginning of the wave data which starts at the end of the data chunk header. - fseek(filePtr, sizeof(WaveHeaderType), SEEK_SET); - - // Create a temporary buffer to hold the wave file data. - waveData = new unsigned char[waveFileHeader.dataSize]; - if(!waveData) - { - fclose(filePtr); - return false; - } - - // Read in the wave file data into the newly created buffer. - count = fread(waveData, 1, waveFileHeader.dataSize, filePtr); - if(count != waveFileHeader.dataSize) - { - delete [] waveData; - waveData = 0; - - fclose(filePtr); - return false; - } - - // Close the file once done reading. - int error = fclose(filePtr); - if(error != 0) - { - delete [] waveData; - waveData = 0; - return false; - } - - // Lock the secondary buffer to write wave data into it. - result = (*secondaryBuffer)->Lock(0, waveFileHeader.dataSize, (void**)&bufferPtr, (DWORD*)&bufferSize, NULL, 0, 0); - if(FAILED(result)) - { - delete [] waveData; - waveData = 0; - return false; - } - - // Copy the wave data into the buffer. - memcpy(bufferPtr, waveData, waveFileHeader.dataSize); - - // Unlock the secondary buffer after the data has been written to it. - result = (*secondaryBuffer)->Unlock((void*)bufferPtr, bufferSize, NULL, 0); - if(FAILED(result)) - { - delete [] waveData; - waveData = 0; - return false; - } - - // Release the wave data since it was copied into the secondary buffer. - delete [] waveData; - waveData = 0; - - return true; -} - -void WavClass::ShutdownWaveFile(IDirectSoundBuffer** secondaryBuffer) -{ - // Release the secondary sound buffer. - if(*secondaryBuffer) - { - (*secondaryBuffer)->Release(); - *secondaryBuffer = 0; - } - - return; -} - -#include "cd_interface.h" - -WavClass* wav; -extern HWND hScrnWnd; - -void wav_exit() -{ - if(wav) { - wav_stop(); - wav->Shutdown(); - wav = NULL; - } -} - -int wav_open(TCHAR* szFile) -{ - wav_exit(); - - if(hScrnWnd) { - wav = new WavClass; - wav->Initialize(hScrnWnd, szFile); - } else { - return 0; - } - - return 1; -} - -void wav_stop() -{ - if(!wav) return; - - wav->GetSecondaryBuffer()->Stop(); - wav->GetSecondaryBuffer()->SetCurrentPosition( 0 ); -} - -void wav_play() -{ - if(!wav) return; - - HRESULT result; - - // Play the contents of the secondary sound buffer. - IDirectSoundBuffer* m_secondaryBuffer1 = wav->GetSecondaryBuffer(); - if(!m_secondaryBuffer1) { - // - return; - } - - // Set volume of the buffer to 100%. - result = m_secondaryBuffer1->SetVolume(DSBVOLUME_MAX); - if(FAILED(result)) - { - return; - } - - result = m_secondaryBuffer1->Play(0, 0, DSBPLAY_LOOPING); - if(FAILED(result)) { - // - return; - } -} - -void wav_pause(bool bResume) -{ - if(!wav) return; - - if(!bResume) - { - DWORD pdwStatus; - wav->GetSecondaryBuffer()->GetStatus(&pdwStatus); - if((pdwStatus & DSBSTATUS_PLAYING) == DSBSTATUS_PLAYING) - { - HRESULT result; - result = wav->GetSecondaryBuffer()->Stop(); - if(FAILED(result)) { - // - } - } - - } else { - DWORD pdwStatus; - wav->GetSecondaryBuffer()->GetStatus(&pdwStatus); - if((pdwStatus & DSBSTATUS_PLAYING) != DSBSTATUS_PLAYING) - { - if(CDEmuGetStatus() == playing) - { - HRESULT result; - - // Set volume of the buffer to 100%. - result = wav->GetSecondaryBuffer()->SetVolume(DSBVOLUME_MAX); - if(FAILED(result)) - { - return; - } - - result = wav->GetSecondaryBuffer()->Play(0, 0, DSBPLAY_LOOPING); - if(FAILED(result)) { - // - } - } - } - } -} diff --git a/jan/src/intf/cd/win32/cdsound.h b/jan/src/intf/cd/win32/cdsound.h deleted file mode 100644 index 94d0b276b..000000000 --- a/jan/src/intf/cd/win32/cdsound.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _WavClass_H_ -#define _WavClass_H_ - -//#include -#include "dsound_core.h" - -class WavClass -{ -private: - struct WaveHeaderType - { - char chunkId[4]; - unsigned long chunkSize; - char format[4]; - char subChunkId[4]; - unsigned long subChunkSize; - unsigned short audioFormat; - unsigned short numChannels; - unsigned long sampleRate; - unsigned long bytesPerSecond; - unsigned short blockAlign; - unsigned short bitsPerSample; - char dataChunkId[4]; - unsigned long dataSize; - }; - -public: - WavClass(); - WavClass(const WavClass&); - ~WavClass(); - - bool Initialize(HWND, TCHAR*); - void Shutdown(); - - bool InitializeDirectSound(HWND); - void ShutdownDirectSound(); - - bool LoadWaveFile(TCHAR*, IDirectSoundBuffer**); - void ShutdownWaveFile(IDirectSoundBuffer**); - - bool PlayWaveFile(); - - IDirectSound* GetDirectSound() { return m_DirectSound; } - IDirectSoundBuffer* GetPrimaryBuffer() { return m_primaryBuffer; } - IDirectSoundBuffer* GetSecondaryBuffer() { return m_secondaryBuffer1; } - -private: - IDirectSound* m_DirectSound; - IDirectSoundBuffer* m_primaryBuffer; - IDirectSoundBuffer* m_secondaryBuffer1; -}; - -void wav_exit(); -int wav_open(TCHAR* szFile); -void wav_stop(); -void wav_play(); - -#endif diff --git a/jan/src/intf/input/inp_interface.cpp b/jan/src/intf/input/inp_interface.cpp deleted file mode 100644 index 7732aaaec..000000000 --- a/jan/src/intf/input/inp_interface.cpp +++ /dev/null @@ -1,521 +0,0 @@ -// Burner Input module -#include "burner.h" -#include - -UINT32 nInputSelect = 0; -bool bInputOkay = false; - -static bool bCinpOkay; - -#if defined (BUILD_WIN32) - extern struct InputInOut InputInOutDInput; -#elif defined (BUILD_SDL) - extern struct InputInOut InputInOutSDL; -#elif defined (_XBOX) - extern struct InputInOut InputInOutXInput2; -#elif defined (BUILD_QT) - extern struct InputInOut InputInOutQt; -#endif - -static struct InputInOut *pInputInOut[]= -{ -#if defined (BUILD_WIN32) - &InputInOutDInput, -#elif defined (BUILD_SDL) - &InputInOutSDL, -#elif defined (_XBOX) - &InputInOutXInput2, -#elif defined (BUILD_QT) - &InputInOutQt, -#endif -}; - -#define INPUT_LEN (sizeof(pInputInOut) / sizeof(pInputInOut[0])) - -std::vector InputGetInterfaces() -{ - std::vector list; - for (unsigned int i = 0; i < INPUT_LEN; i++) - list.push_back(pInputInOut[i]); - return list; -} - -static InterfaceInfo InpInfo = { NULL, NULL, NULL }; - -inline INT32 CinpState(const INT32 nCode) -{ - // Return off for keyboard inputs if current input is turned off - if (nCode < 0x4000 && !bCinpOkay) { - return 0; - } - - // Read from Direct Input - return pInputInOut[nInputSelect]->ReadSwitch(nCode); -} - -// Read an axis of a joystick -inline INT32 CinpJoyAxis(const INT32 i, const INT32 nAxis) -{ - // Read from Direct Input - return pInputInOut[nInputSelect]->ReadJoyAxis(i, nAxis); -} - -// Read an axis of a mouse -inline INT32 CinpMouseAxis(const INT32 i, const INT32 nAxis) -{ - // Read from Direct Input - return pInputInOut[nInputSelect]->ReadMouseAxis(i, nAxis); -} - -// Do one frames worth of keyboard input sliders -static INT32 InputTick() -{ - struct GameInp *pgi; - UINT32 i; - - for (i = 0, pgi = GameInp; i < nGameInpCount; i++, pgi++) { - INT32 nAdd = 0; - if ((pgi->nInput & GIT_GROUP_SLIDER) == 0) { // not a slider - continue; - } - - if (pgi->nInput == GIT_KEYSLIDER) { - // Get states of the two keys - if (CinpState(pgi->Input.Slider.SliderAxis.nSlider[0])) { - nAdd -= 0x100; - } - if (CinpState(pgi->Input.Slider.SliderAxis.nSlider[1])) { - nAdd += 0x100; - } - } - - if (pgi->nInput == GIT_JOYSLIDER) { - // Get state of the axis - nAdd = CinpJoyAxis(pgi->Input.Slider.JoyAxis.nJoy, pgi->Input.Slider.JoyAxis.nAxis); - nAdd /= 0x100; - } - - // nAdd is now -0x100 to +0x100 - - // Change to slider speed - nAdd *= pgi->Input.Slider.nSliderSpeed; - nAdd /= 0x100; - - if (pgi->Input.Slider.nSliderCenter) { // Attact to center - INT32 v = pgi->Input.Slider.nSliderValue - 0x8000; - v *= (pgi->Input.Slider.nSliderCenter - 1); - v /= pgi->Input.Slider.nSliderCenter; - v += 0x8000; - pgi->Input.Slider.nSliderValue = v; - } - - pgi->Input.Slider.nSliderValue += nAdd; - // Limit slider - if (pgi->Input.Slider.nSliderValue < 0x0100) { - pgi->Input.Slider.nSliderValue = 0x0100; - } - if (pgi->Input.Slider.nSliderValue > 0xFF00) { - pgi->Input.Slider.nSliderValue = 0xFF00; - } - } - return 0; -} - -INT32 InputInit() -{ - INT32 nRet; - - bInputOkay = false; - - if (nInputSelect >= INPUT_LEN) { - return 1; - } - - if ((nRet = pInputInOut[nInputSelect]->Init()) == 0) { - bInputOkay = true; - } - - return nRet; -} - -INT32 InputExit() -{ - IntInfoFree(&InpInfo); - - if (nInputSelect >= INPUT_LEN) { - return 1; - } - - bInputOkay = false; - - return pInputInOut[nInputSelect]->Exit(); -} - -// This will request exclusive access for mouse and/or request input processing if the application is in the foreground only -// - bExcusive = 1 - Request exclusive access to inputs (this may apply to only the mouse or all input, depending on the API) -// This function will show or hide the mouse cursor as appropriate -// - bForeground = 1 - Request input processing only if application is in foreground (this may not be supported by all APIs) -INT32 InputSetCooperativeLevel(const bool bExclusive, const bool bForeground) -{ - if (!bInputOkay || nInputSelect >= INPUT_LEN) { - return 1; - } - if (pInputInOut[nInputSelect]->SetCooperativeLevel == NULL) { - return 0; - } - - return pInputInOut[nInputSelect]->SetCooperativeLevel(bExclusive, bForeground); -} - -static INT32 nAutoFireCounter = 0; -static bool bLastAF[1000]; -INT32 nAutoFireRate = 12; - -static inline INT32 AutofirePick() { - INT32 c = nAutoFireCounter % nAutoFireRate; - - if (nAutoFireCounter <= 2) - return 1; - else - return (c > nAutoFireRate-4); -} - -// This will process all PC-side inputs and optionally update the emulated game side. -INT32 InputMake(bool bCopy) -{ - struct GameInp* pgi; - UINT32 i; - - if (!bInputOkay || nInputSelect >= INPUT_LEN) { - return 1; - } - - pInputInOut[nInputSelect]->NewFrame(); // Poll joysticks etc - - bCinpOkay = AppProcessKeyboardInput(); - - InputTick(); - - for (i = 0, pgi = GameInp; i < nGameInpCount; i++, pgi++) { - if (pgi->Input.pVal == NULL) { - continue; - } - - switch (pgi->nInput) { - case 0: // Undefined - pgi->Input.nVal = 0; - break; - case GIT_CONSTANT: // Constant value - pgi->Input.nVal = pgi->Input.Constant.nConst; - if (bCopy) { - *(pgi->Input.pVal) = pgi->Input.nVal; - } - break; - case GIT_SWITCH: { // Digital input - INT32 s = CinpState(pgi->Input.Switch.nCode); - - if (pgi->nType & BIT_GROUP_ANALOG) { - // Set analog controls to full - if (s) { - pgi->Input.nVal = 0xFFFF; - } else { - pgi->Input.nVal = 0x0001; - } - if (bCopy) { - *(pgi->Input.pShortVal) = pgi->Input.nVal; - } - } else { - // Binary controls - if (s) { - pgi->Input.nVal = 1; - } else { - pgi->Input.nVal = 0; - } - if (bCopy) { - *(pgi->Input.pVal) = pgi->Input.nVal; - } - } - - break; - } - case GIT_KEYSLIDER: // Keyboard slider - case GIT_JOYSLIDER: { // Joystick slider - INT32 nSlider = pgi->Input.Slider.nSliderValue; - if (pgi->nType == BIT_ANALOG_REL) { - nSlider -= 0x8000; - nSlider >>= 4; - } - - pgi->Input.nVal = (UINT16)nSlider; - if (bCopy) { - *(pgi->Input.pShortVal) = pgi->Input.nVal; - } - break; - } - case GIT_MOUSEAXIS: // Mouse axis - pgi->Input.nVal = (UINT16)(CinpMouseAxis(pgi->Input.MouseAxis.nMouse, pgi->Input.MouseAxis.nAxis) * nAnalogSpeed); - if (bCopy) { - *(pgi->Input.pShortVal) = pgi->Input.nVal; - } - break; - case GIT_JOYAXIS_FULL: { // Joystick axis - INT32 nJoy = CinpJoyAxis(pgi->Input.JoyAxis.nJoy, pgi->Input.JoyAxis.nAxis); - - if (pgi->nType == BIT_ANALOG_REL) { - nJoy *= nAnalogSpeed; - nJoy >>= 13; - - // Clip axis to 8 bits - if (nJoy < -32768) { - nJoy = -32768; - } - if (nJoy > 32767) { - nJoy = 32767; - } - } else { - nJoy >>= 1; - nJoy += 0x8000; - - // Clip axis to 16 bits - if (nJoy < 0x0001) { - nJoy = 0x0001; - } - if (nJoy > 0xFFFF) { - nJoy = 0xFFFF; - } - } - - pgi->Input.nVal = (UINT16)nJoy; - if (bCopy) { - *(pgi->Input.pShortVal) = pgi->Input.nVal; - } - - break; - } - case GIT_JOYAXIS_NEG: { // Joystick axis Lo - INT32 nJoy = CinpJoyAxis(pgi->Input.JoyAxis.nJoy, pgi->Input.JoyAxis.nAxis); - if (nJoy < 32767) { - nJoy = -nJoy; - - if (nJoy < 0x0000) { - nJoy = 0x0000; - } - if (nJoy > 0xFFFF) { - nJoy = 0xFFFF; - } - - pgi->Input.nVal = (UINT16)nJoy; - } else { - pgi->Input.nVal = 0; - } - - if (bCopy) { - *(pgi->Input.pShortVal) = pgi->Input.nVal; - } - break; - } - case GIT_JOYAXIS_POS: { // Joystick axis Hi - INT32 nJoy = CinpJoyAxis(pgi->Input.JoyAxis.nJoy, pgi->Input.JoyAxis.nAxis); - if (nJoy > 32767) { - - if (nJoy < 0x0000) { - nJoy = 0x0000; - } - if (nJoy > 0xFFFF) { - nJoy = 0xFFFF; - } - - pgi->Input.nVal = (UINT16)nJoy; - } else { - pgi->Input.nVal = 0; - } - - if (bCopy) { - *(pgi->Input.pShortVal) = pgi->Input.nVal; - } - break; - } - } - } - - nAutoFireCounter++; - - for (i = 0; i < nMacroCount; i++, pgi++) { - if (pgi->Macro.nMode == 1 && pgi->Macro.nSysMacro == 0) { // Macro is defined - if (bCopy && CinpState(pgi->Macro.Switch.nCode)) { - for (INT32 j = 0; j < 4; j++) { - if (pgi->Macro.pVal[j]) { - *(pgi->Macro.pVal[j]) = pgi->Macro.nVal[j]; - } - } - } - } - if (pgi->Macro.nSysMacro) { // System-Macro is defined -dink - if (CinpState(pgi->Macro.Switch.nCode)) { - if (pgi->Macro.pVal[0]) { - *(pgi->Macro.pVal[0]) = pgi->Macro.nVal[0]; - if (pgi->Macro.nSysMacro==15) { //Auto-Fire mode! - if (AutofirePick() || bLastAF[i]==0) - *(pgi->Macro.pVal[0]) = pgi->Macro.nVal[0]; - else - *(pgi->Macro.pVal[0]) = 0; - bLastAF[i] = 1; - } - } - } else { // Disable System-Macro when key up - if (pgi->Macro.pVal[0] && pgi->Macro.nSysMacro == 1) { - *(pgi->Macro.pVal[0]) = 0; - } else { - if (pgi->Macro.nSysMacro == 15) - bLastAF[i] = 0; - } - } - } - } - - return 0; -} - -// Use this function as follows: -// - First call with nFlags = 2 -// - Then call with nFlags = 4 until all controls are released -// - Then call with nFlags = 8 until a control is activated -// - Then call with nFlags = 16 until all controls are released again -// It will continue to return a control (reflecting the direction an axis is moved in) -// Use this to handle analog controls correctly -// -// Call with nFlags & 1 to indicate that controls need to be polled (when normal input processing is disabled) -INT32 InputFind(const INT32 nFlags) -{ - static INT32 nInputCode, nDelay, nJoyPrevPos; - - INT32 nFind; - - if (nInputSelect >= INPUT_LEN) { - return 1; - } - - if (nFlags & 1) { - pInputInOut[nInputSelect]->NewFrame(); - } - - nFind = pInputInOut[nInputSelect]->Find(nFlags & 2); - - switch (nFlags) { - case 4: { - return nFind; - } - case 8: { - if (nFind >= 0) { - nInputCode = nFind; - if ((nInputCode & 0x4000) && (nInputCode & 0xFF) < 0x10) { - nJoyPrevPos = CinpJoyAxis((nInputCode >> 8) & 0x3F, (nInputCode >> 1) & 0x07); - } - nDelay = 0; - } - - return nFind; - } - case 16: { - - // Treat joystick axes specially - // Wait until the axis reports no movement for some time - if ((nInputCode & 0x4000) && (nInputCode & 0xFF) < 0x10) { - INT32 nJoyPos = CinpJoyAxis((nInputCode >> 8) & 0x3F, (nInputCode >> 1) & 0x07); - INT32 nJoyDelta = nJoyPrevPos - nJoyPos; - - nJoyPrevPos = nJoyPos; - - if (nFind != -1) { - nInputCode = nFind; - } - - // While the movement is within the threshold, treat it as no movement - if (nJoyDelta > -0x0100 && nJoyDelta < 0x0100) { - nDelay++; - if (nDelay > 64) { - return -1; - } - } else { - nDelay = 0; - } - - return nInputCode; - } - - // Treat mouse axes specially - // Wait until the axis reports no movement/movement in the same direction for some time - if ((nInputCode & 0x8000) && (nInputCode & 0xFF) < 0x06) { - INT32 nMouseDelta = CinpMouseAxis((nInputCode >> 8) & 0x3F, (nInputCode >> 1) & 0x07); - if (nFind == -1 || ((nInputCode & 1) ? nMouseDelta > 0 : nMouseDelta < 0)) { - nDelay++; - if (nDelay > 128) { - return -1; - } - } else { - nDelay = 0; - nInputCode = nFind; - } - - return nInputCode; - } - - return nFind; - } - } - - return -1; -} - -// Get the name of a control and/or the device it's on (not all API's may support this) -// Either parameter can be passed as NULL -INT32 InputGetControlName(INT32 nCode, TCHAR* pszDeviceName, TCHAR* pszControlName) -{ - if (!bInputOkay || nInputSelect >= INPUT_LEN) { - return 1; - } - if (pInputInOut[nInputSelect]->GetControlName == NULL) { - return 1; - } - - return pInputInOut[nInputSelect]->GetControlName(nCode, pszDeviceName, pszControlName); -} - -InterfaceInfo* InputGetInfo() -{ - if (IntInfoInit(&InpInfo)) { - IntInfoFree(&InpInfo); - return NULL; - } - - if (bInputOkay) { - InpInfo.pszModuleName = pInputInOut[nInputSelect]->szModuleName; - - if (pInputInOut[nInputSelect]->GetPluginSettings) { - pInputInOut[nInputSelect]->GetPluginSettings(&InpInfo); - } - - for (INT32 nType = 0; nType < 3; nType++) { - INT32 nDeviceTypes[] = { 0x0000, 0x8000, 0x4000 }; - TCHAR nDeviceTypeNames[][16] = { _T("keyboard"), _T("mouse "), _T("joystick") }; - TCHAR nDeviceName[MAX_PATH] = _T(""); - INT32 nActiveDevice = 0; - - while (nActiveDevice < 16 && pInputInOut[nInputSelect]->GetControlName(nDeviceTypes[nType] | (nActiveDevice << 8), nDeviceName, NULL) == 0 && nDeviceName[0]) { - TCHAR szString[MAX_PATH] = _T(""); - - _sntprintf(szString, MAX_PATH, _T("%s %d %s"), nDeviceTypeNames[nType], nActiveDevice, nDeviceName); - - if (IntInfoAddStringInterface(&InpInfo, szString)) { - break; - } - - nActiveDevice++; - } - } - } else { - IntInfoAddStringInterface(&InpInfo, _T("Input plugin not initialised")); - } - - return &InpInfo; -} diff --git a/jan/src/intf/input/inp_keys.h b/jan/src/intf/input/inp_keys.h deleted file mode 100644 index 4d1318b6b..000000000 --- a/jan/src/intf/input/inp_keys.h +++ /dev/null @@ -1,148 +0,0 @@ -// FB Alpha key definitions - -#define FBK_ESCAPE 0x01 -#define FBK_1 0x02 -#define FBK_2 0x03 -#define FBK_3 0x04 -#define FBK_4 0x05 -#define FBK_5 0x06 -#define FBK_6 0x07 -#define FBK_7 0x08 -#define FBK_8 0x09 -#define FBK_9 0x0A -#define FBK_0 0x0B -#define FBK_MINUS 0x0C // - on main keyboard -#define FBK_EQUALS 0x0D -#define FBK_BACK 0x0E // backspace -#define FBK_TAB 0x0F -#define FBK_Q 0x10 -#define FBK_W 0x11 -#define FBK_E 0x12 -#define FBK_R 0x13 -#define FBK_T 0x14 -#define FBK_Y 0x15 -#define FBK_U 0x16 -#define FBK_I 0x17 -#define FBK_O 0x18 -#define FBK_P 0x19 -#define FBK_LBRACKET 0x1A -#define FBK_RBRACKET 0x1B -#define FBK_RETURN 0x1C // Enter on main keyboard -#define FBK_LCONTROL 0x1D -#define FBK_A 0x1E -#define FBK_S 0x1F -#define FBK_D 0x20 -#define FBK_F 0x21 -#define FBK_G 0x22 -#define FBK_H 0x23 -#define FBK_J 0x24 -#define FBK_K 0x25 -#define FBK_L 0x26 -#define FBK_SEMICOLON 0x27 -#define FBK_APOSTROPHE 0x28 -#define FBK_GRAVE 0x29 // accent grave -#define FBK_LSHIFT 0x2A -#define FBK_BACKSLASH 0x2B -#define FBK_Z 0x2C -#define FBK_X 0x2D -#define FBK_C 0x2E -#define FBK_V 0x2F -#define FBK_B 0x30 -#define FBK_N 0x31 -#define FBK_M 0x32 -#define FBK_COMMA 0x33 -#define FBK_PERIOD 0x34 // . on main keyboard -#define FBK_SLASH 0x35 // / on main keyboard -#define FBK_RSHIFT 0x36 -#define FBK_MULTIPLY 0x37 // * on numeric keypad -#define FBK_LALT 0x38 // left Alt -#define FBK_SPACE 0x39 -#define FBK_CAPITAL 0x3A -#define FBK_F1 0x3B -#define FBK_F2 0x3C -#define FBK_F3 0x3D -#define FBK_F4 0x3E -#define FBK_F5 0x3F -#define FBK_F6 0x40 -#define FBK_F7 0x41 -#define FBK_F8 0x42 -#define FBK_F9 0x43 -#define FBK_F10 0x44 -#define FBK_NUMLOCK 0x45 -#define FBK_SCROLL 0x46 // Scroll Lock -#define FBK_NUMPAD7 0x47 -#define FBK_NUMPAD8 0x48 -#define FBK_NUMPAD9 0x49 -#define FBK_SUBTRACT 0x4A // - on numeric keypad -#define FBK_NUMPAD4 0x4B -#define FBK_NUMPAD5 0x4C -#define FBK_NUMPAD6 0x4D -#define FBK_ADD 0x4E // + on numeric keypad -#define FBK_NUMPAD1 0x4F -#define FBK_NUMPAD2 0x50 -#define FBK_NUMPAD3 0x51 -#define FBK_NUMPAD0 0x52 -#define FBK_DECIMAL 0x53 // . on numeric keypad -#define FBK_OEM_102 0x56 // < > | on UK/Germany keyboards -#define FBK_F11 0x57 -#define FBK_F12 0x58 - -#define FBK_F13 0x64 // (NEC PC98) -#define FBK_F14 0x65 // (NEC PC98) -#define FBK_F15 0x66 // (NEC PC98) - -#define FBK_KANA 0x70 // (Japanese keyboard) -#define FBK_ABNT_C1 0x73 // / ? on Portugese (Brazilian) keyboards -#define FBK_CONVERT 0x79 // (Japanese keyboard) -#define FBK_NOCONVERT 0x7B // (Japanese keyboard) -#define FBK_YEN 0x7D // (Japanese keyboard) -#define FBK_ABNT_C2 0x7E // Numpad . on Portugese (Brazilian) keyboards -#define FBK_NUMPADEQUALS 0x8D // = on numeric keypad (NEC PC98) -#define FBK_PREVTRACK 0x90 // Previous Track (FBK_CIRCUMFLEX on Japanese keyboard) -#define FBK_AT 0x91 // (NEC PC98) -#define FBK_COLON 0x92 // (NEC PC98) -#define FBK_UNDERLINE 0x93 // (NEC PC98) -#define FBK_KANJI 0x94 // (Japanese keyboard) -#define FBK_STOP 0x95 // (NEC PC98) -#define FBK_AX 0x96 // (Japan AX) -#define FBK_UNLABELED 0x97 // (J3100) -#define FBK_NEXTTRACK 0x99 // Next Track -#define FBK_NUMPADENTER 0x9C // Enter on numeric keypad -#define FBK_RCONTROL 0x9D -#define FBK_MUTE 0xA0 // Mute -#define FBK_CALCULATOR 0xA1 // Calculator -#define FBK_PLAYPAUSE 0xA2 // Play / Pause -#define FBK_MEDIASTOP 0xA4 // Media Stop -#define FBK_VOLUMEDOWN 0xAE // Volume - -#define FBK_VOLUMEUP 0xB0 // Volume + -#define FBK_WEBHOME 0xB2 // Web home -#define FBK_NUMPADCOMMA 0xB3 // , on numeric keypad (NEC PC98) -#define FBK_DIVIDE 0xB5 // / on numeric keypad -#define FBK_SYSRQ 0xB7 -#define FBK_RALT 0xB8 // right Alt -#define FBK_PAUSE 0xC5 // Pause -#define FBK_HOME 0xC7 // Home on arrow keypad -#define FBK_UPARROW 0xC8 // UpArrow on arrow keypad -#define FBK_PRIOR 0xC9 // PgUp on arrow keypad -#define FBK_LEFTARROW 0xCB // LeftArrow on arrow keypad -#define FBK_RIGHTARROW 0xCD // RightArrow on arrow keypad -#define FBK_END 0xCF // End on arrow keypad -#define FBK_DOWNARROW 0xD0 // DownArrow on arrow keypad -#define FBK_NEXT 0xD1 // PgDn on arrow keypad -#define FBK_INSERT 0xD2 // Insert on arrow keypad -#define FBK_DELETE 0xD3 // Delete on arrow keypad -#define FBK_LWIN 0xDB // Left Windows key -#define FBK_RWIN 0xDC // Right Windows key -#define FBK_APPS 0xDD // AppMenu key -#define FBK_POWER 0xDE // System Power -#define FBK_SLEEP 0xDF // System Sleep -#define FBK_WAKE 0xE3 // System Wake -#define FBK_WEBSEARCH 0xE5 // Web Search -#define FBK_WEBFAVORITES 0xE6 // Web Favorites -#define FBK_WEBREFRESH 0xE7 // Web Refresh -#define FBK_WEBSTOP 0xE8 // Web Stop -#define FBK_WEBFORWARD 0xE9 // Web Forward -#define FBK_WEBBACK 0xEA // Web Back -#define FBK_MYCOMPUTER 0xEB // My Computer -#define FBK_MAIL 0xEC // Mail -#define FBK_MEDIASELECT 0xED // Media Select diff --git a/jan/src/intf/input/psp/inp_psp.cpp b/jan/src/intf/input/psp/inp_psp.cpp deleted file mode 100644 index 482d092dd..000000000 --- a/jan/src/intf/input/psp/inp_psp.cpp +++ /dev/null @@ -1,209 +0,0 @@ -// Module for input -#include "burner.h" - -#define MAX_JOYSTICKS (1) - -static int nInitedSubsytems = 0; -static int* JoyPrevAxes = NULL; -static int nJoystickCount = 0; // Number of joysticks connected to this machine - -static SceCtrlData myInput; - -int PSPinpSetCooperativeLevel(bool bExclusive, bool /*bForeGround*/) -{ - return 0; -} - -int PSPinpExit() -{ - nJoystickCount = 0; - - free(JoyPrevAxes); - JoyPrevAxes = NULL; - - return 0; -} - -int PSPinpInit() -{ - int nSize; - - nSize = MAX_JOYSTICKS * 8 * sizeof(int); - if ((JoyPrevAxes = (int*)malloc(nSize)) == NULL) { - return 1; - } - memset(JoyPrevAxes, 0, nSize); - // Set up the joysticks - nJoystickCount = 1; - return 0; -} - -static unsigned char bKeyboardRead = 0; - -static unsigned char bJoystickRead = 0; - -static unsigned char bMouseRead = 0; -static struct { unsigned char buttons; int xdelta; int ydelta; } PSPinpMouseState; - -// Call before checking for Input in a frame -int PSPinpStart() -{ - // Keyboard not read this frame - bKeyboardRead = 0; - - // No joysticks have been read for this frame - bJoystickRead = 0; - - // Mouse not read this frame - bMouseRead = 0; - - sceCtrlPeekBufferPositive( &myInput, 1 ); - - return 0; -} - -// Read one of the joysticks -static int ReadJoystick() -{ - if (bJoystickRead) { - return 0; - } - - // All joysticks have been Read this frame - bJoystickRead = 1; - - return 0; -} - -// Read one joystick axis -int PSPinpJoyAxis(int i, int nAxis) -{ - if (i < 0 || i >= nJoystickCount) { // This joystick number isn't connected - return 0; - } - - if (ReadJoystick() != 0) { // There was an error polling the joystick - return 0; - } - - return 0; -} - -// Read the keyboard -static int ReadKeyboard() -{ - int numkeys; - - if (bKeyboardRead) { // already read this frame - ready to go - return 0; - } - - // The keyboard has been successfully Read this frame - bKeyboardRead = 1; - - return 0; -} - -static int ReadMouse() -{ - if (bMouseRead) { - return 0; - } - - bMouseRead = 1; - - return 0; -} - -// Read one mouse axis -int PSPinpMouseAxis(int i, int nAxis) -{ - if (i < 0 || i >= 1) { // Only the system mouse is supported by SDL - return 0; - } - - return 0; -} - -// Check a subcode (the 40xx bit in 4001, 4102 etc) for a joystick input code -static int JoystickState(int i, int nSubCode) -{ - return 0; -} - -// Check a subcode (the 80xx bit in 8001, 8102 etc) for a mouse input code -static int CheckMouseState(unsigned int nSubCode) -{ - - return 0; -} - -// Get the state (pressed = 1, not pressed = 0) of a particular input code -// look in inp_keys.h to see what keycodes need mapping, e.g. 9 is used for the -// diag mode in cps, I think. Better check on the win32 version :-) -int PSPinpState(int nCode) -{ - switch(nCode) - { - case 0x02: // start - return ((myInput.Buttons & PSP_CTRL_START) ? 1 : 0); - break; - case 0x06: // coin - return ((myInput.Buttons & PSP_CTRL_SELECT) ? 1 : 0); - break; - case 0x3c: //f2 - break; - case 0x3D: //f3 - break; - case 0x4000: // left - return ((myInput.Buttons & PSP_CTRL_LEFT) ? 1 : 0); - break; - case 0x4001: // right - return ((myInput.Buttons & PSP_CTRL_RIGHT) ? 1 : 0); - break; - case 0x4002: // up - return ((myInput.Buttons & PSP_CTRL_UP) ? 1 : 0); - break; - case 0x4003: // down - return ((myInput.Buttons & PSP_CTRL_DOWN) ? 1 : 0); - break; - - case 0x4080: //fire1 - return ((myInput.Buttons & PSP_CTRL_SQUARE) ? 1 : 0); - break; - case 0x4081: //fire 2 - return ((myInput.Buttons & PSP_CTRL_CROSS) ? 1 : 0); - break; - case 0x4082: // etc - return ((myInput.Buttons & PSP_CTRL_CIRCLE) ? 1 : 0); - break; - case 0x4083: - return ((myInput.Buttons & PSP_CTRL_TRIANGLE) ? 1 : 0); - break; - case 0x4084: - return ((myInput.Buttons & PSP_CTRL_LTRIGGER) ? 1 : 0); - break; - case 0x4085: - return ((myInput.Buttons & PSP_CTRL_RTRIGGER) ? 1 : 0); - break; - //fba can map 2 more buttons but I dont think the psp has that many and no games use that much that I know of - default: - return 0; - } - return 0; -} - -// This function finds which key is pressed, and returns its code -int PSPinpFind(bool CreateBaseline) -{ - int nRetVal = -1; // assume nothing pressed - - return nRetVal; -} - -int PSPinpGetControlName(int nCode, TCHAR* pszDeviceName, TCHAR* pszControlName) -{ - return 0; -} - -struct InputInOut InputInOutPSP = { PSPinpInit, PSPinpExit, PSPinpSetCooperativeLevel, PSPinpStart, PSPinpState, PSPinpJoyAxis, PSPinpMouseAxis, PSPinpFind, PSPinpGetControlName, NULL, _T("PSP input") }; diff --git a/jan/src/intf/input/sdl/inp_sdl.cpp b/jan/src/intf/input/sdl/inp_sdl.cpp deleted file mode 100644 index a9890a226..000000000 --- a/jan/src/intf/input/sdl/inp_sdl.cpp +++ /dev/null @@ -1,464 +0,0 @@ -// Module for input using SDL -#include - -#include "burner.h" -#include "inp_sdl_keys.h" - -#define MAX_JOYSTICKS (8) - -static int FBKtoSDL[512]; - -static int nInitedSubsytems = 0; -static SDL_Joystick* JoyList[MAX_JOYSTICKS]; -static int* JoyPrevAxes = NULL; -static int nJoystickCount = 0; // Number of joysticks connected to this machine - -// Sets up one Joystick (for example the range of the joystick's axes) -static int SDLinpJoystickInit(int i) -{ - JoyList[i] = SDL_JoystickOpen(i); - return 0; -} - -// Set up the keyboard -static int SDLinpKeyboardInit() -{ - for (int i = 0; i < 512; i++) { - if (SDLtoFBK[i] > 0) - FBKtoSDL[SDLtoFBK[i]] = i; - } - - return 0; -} - -// Get an interface to the mouse -static int SDLinpMouseInit() -{ - return 0; -} - -int SDLinpSetCooperativeLevel(bool bExclusive, bool /*bForeGround*/) -{ - SDL_WM_GrabInput((bDrvOkay && (bExclusive || nVidFullscreen)) ? SDL_GRAB_ON : SDL_GRAB_OFF); - SDL_ShowCursor((bDrvOkay && (bExclusive || nVidFullscreen)) ? SDL_DISABLE : SDL_ENABLE); - - return 0; -} - -int SDLinpExit() -{ - // Close all joysticks - for (int i = 0; i < MAX_JOYSTICKS; i++) { - if (JoyList[i]) { - SDL_JoystickClose(JoyList[i]); - JoyList[i] = NULL; - } - } - - nJoystickCount = 0; - - free(JoyPrevAxes); - JoyPrevAxes = NULL; - - if (!(nInitedSubsytems & SDL_INIT_JOYSTICK)) { - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); - } - - nInitedSubsytems = 0; - - return 0; -} - -int SDLinpInit() -{ - int nSize; - - SDLinpExit(); - - memset(&JoyList, 0, sizeof(JoyList)); - - nSize = MAX_JOYSTICKS * 8 * sizeof(int); - if ((JoyPrevAxes = (int*)malloc(nSize)) == NULL) { - SDLinpExit(); - return 1; - } - memset(JoyPrevAxes, 0, nSize); - - nInitedSubsytems = SDL_WasInit(SDL_INIT_JOYSTICK); - - if (!(nInitedSubsytems & SDL_INIT_JOYSTICK)) { - SDL_InitSubSystem(SDL_INIT_JOYSTICK); - } - - // Set up the joysticks - nJoystickCount = SDL_NumJoysticks(); - for (int i = 0; i < nJoystickCount; i++) { - SDLinpJoystickInit(i); - } - SDL_JoystickEventState(SDL_IGNORE); - - // Set up the keyboard - SDLinpKeyboardInit(); - - // Set up the mouse - SDLinpMouseInit(); - - return 0; -} - -static unsigned char bKeyboardRead = 0; -static unsigned char* SDLinpKeyboardState; - -static unsigned char bJoystickRead = 0; - -static unsigned char bMouseRead = 0; -static struct { unsigned char buttons; int xdelta; int ydelta; } SDLinpMouseState; - -#define SDL_KEY_DOWN(key) (FBKtoSDL[key] > 0 ? SDLinpKeyboardState[FBKtoSDL[key]] : 0) - -// Call before checking for Input in a frame -int SDLinpStart() -{ - // Update SDL event queue - SDL_PumpEvents(); - - // Keyboard not read this frame - bKeyboardRead = 0; - - // No joysticks have been read for this frame - bJoystickRead = 0; - - // Mouse not read this frame - bMouseRead = 0; - - return 0; -} - -// Read one of the joysticks -static int ReadJoystick() -{ - if (bJoystickRead) { - return 0; - } - - SDL_JoystickUpdate(); - - // All joysticks have been Read this frame - bJoystickRead = 1; - - return 0; -} - -// Read one joystick axis -int SDLinpJoyAxis(int i, int nAxis) -{ - if (i < 0 || i >= nJoystickCount) { // This joystick number isn't connected - return 0; - } - - if (ReadJoystick() != 0) { // There was an error polling the joystick - return 0; - } - - if (nAxis >= SDL_JoystickNumAxes(JoyList[i])) { - return 0; - } - - return SDL_JoystickGetAxis(JoyList[i], nAxis) << 1; -} - -// Read the keyboard -static int ReadKeyboard() -{ - int numkeys; - - if (bKeyboardRead) { // already read this frame - ready to go - return 0; - } - - SDLinpKeyboardState = SDL_GetKeyState(&numkeys); - if (SDLinpKeyboardState == NULL) { - return 1; - } - - // The keyboard has been successfully Read this frame - bKeyboardRead = 1; - - return 0; -} - -static int ReadMouse() -{ - if (bMouseRead) { - return 0; - } - - SDLinpMouseState.buttons = SDL_GetRelativeMouseState(&(SDLinpMouseState.xdelta), &(SDLinpMouseState.ydelta)); - - bMouseRead = 1; - - return 0; -} - -// Read one mouse axis -int SDLinpMouseAxis(int i, int nAxis) -{ - if (i < 0 || i >= 1) { // Only the system mouse is supported by SDL - return 0; - } - - switch (nAxis) { - case 0: - return SDLinpMouseState.xdelta; - case 1: - return SDLinpMouseState.ydelta; - } - - return 0; -} - -// Check a subcode (the 40xx bit in 4001, 4102 etc) for a joystick input code -static int JoystickState(int i, int nSubCode) -{ - if (i < 0 || i >= nJoystickCount) { // This joystick isn't connected - return 0; - } - - if (ReadJoystick() != 0) { // Error polling the joystick - return 0; - } - - if (nSubCode < 0x10) { // Joystick directions - const int DEADZONE = 0x4000; - - if (SDL_JoystickNumAxes(JoyList[i]) <= nSubCode) { - return 0; - } - - switch (nSubCode) { - case 0x00: return SDL_JoystickGetAxis(JoyList[i], 0) < -DEADZONE; // Left - case 0x01: return SDL_JoystickGetAxis(JoyList[i], 0) > DEADZONE; // Right - case 0x02: return SDL_JoystickGetAxis(JoyList[i], 1) < -DEADZONE; // Up - case 0x03: return SDL_JoystickGetAxis(JoyList[i], 1) > DEADZONE; // Down - case 0x04: return SDL_JoystickGetAxis(JoyList[i], 2) < -DEADZONE; - case 0x05: return SDL_JoystickGetAxis(JoyList[i], 2) > DEADZONE; - case 0x06: return SDL_JoystickGetAxis(JoyList[i], 3) < -DEADZONE; - case 0x07: return SDL_JoystickGetAxis(JoyList[i], 3) > DEADZONE; - case 0x08: return SDL_JoystickGetAxis(JoyList[i], 4) < -DEADZONE; - case 0x09: return SDL_JoystickGetAxis(JoyList[i], 4) > DEADZONE; - case 0x0A: return SDL_JoystickGetAxis(JoyList[i], 5) < -DEADZONE; - case 0x0B: return SDL_JoystickGetAxis(JoyList[i], 5) > DEADZONE; - case 0x0C: return SDL_JoystickGetAxis(JoyList[i], 6) < -DEADZONE; - case 0x0D: return SDL_JoystickGetAxis(JoyList[i], 6) > DEADZONE; - case 0x0E: return SDL_JoystickGetAxis(JoyList[i], 7) < -DEADZONE; - case 0x0F: return SDL_JoystickGetAxis(JoyList[i], 7) > DEADZONE; - } - } - if (nSubCode < 0x20) { // POV hat controls - if (SDL_JoystickNumHats(JoyList[i]) <= ((nSubCode & 0x0F) >> 2)) { - return 0; - } - - switch (nSubCode & 3) { - case 0: // Left - return SDL_JoystickGetHat(JoyList[i], (nSubCode & 0x0F) >> 2) & SDL_HAT_LEFT; - case 1: // Right - return SDL_JoystickGetHat(JoyList[i], (nSubCode & 0x0F) >> 2) & SDL_HAT_RIGHT; - case 2: // Up - return SDL_JoystickGetHat(JoyList[i], (nSubCode & 0x0F) >> 2) & SDL_HAT_UP; - case 3: // Down - return SDL_JoystickGetHat(JoyList[i], (nSubCode & 0x0F) >> 2) & SDL_HAT_DOWN; - } - - return 0; - } - if (nSubCode < 0x80) { // Undefined - return 0; - } - if (nSubCode < 0x80 + SDL_JoystickNumButtons(JoyList[i])) { // Joystick buttons - return SDL_JoystickGetButton(JoyList[i], nSubCode & 0x7F); - } - - return 0; -} - -// Check a subcode (the 80xx bit in 8001, 8102 etc) for a mouse input code -static int CheckMouseState(unsigned int nSubCode) -{ - switch (nSubCode & 0x7F) { - case 0: - return (SDLinpMouseState.buttons & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0; - case 1: - return (SDLinpMouseState.buttons & SDL_BUTTON(SDL_BUTTON_RIGHT)) != 0; - case 2: - return (SDLinpMouseState.buttons & SDL_BUTTON(SDL_BUTTON_MIDDLE)) != 0; - } - - return 0; -} - -// Get the state (pressed = 1, not pressed = 0) of a particular input code -int SDLinpState(int nCode) -{ - if (nCode < 0) { - return 0; - } - - if (nCode < 0x100) { - if (ReadKeyboard() != 0) { // Check keyboard has been read - return not pressed on error - return 0; - } - return SDL_KEY_DOWN(nCode); // Return key state - } - - if (nCode < 0x4000) { - return 0; - } - - if (nCode < 0x8000) { - // Codes 4000-8000 = Joysticks - int nJoyNumber = (nCode - 0x4000) >> 8; - - // Find the joystick state in our array - return JoystickState(nJoyNumber, nCode & 0xFF); - } - - if (nCode < 0xC000) { - // Codes 8000-C000 = Mouse - if ((nCode - 0x8000) >> 8) { // Only the system mouse is supported by SDL - return 0; - } - if (ReadMouse() != 0) { // Error polling the mouse - return 0; - } - return CheckMouseState(nCode & 0xFF); - } - - return 0; -} - -// This function finds which key is pressed, and returns its code -int SDLinpFind(bool CreateBaseline) -{ - int nRetVal = -1; // assume nothing pressed - - // check if any keyboard keys are pressed - if (ReadKeyboard() == 0) { - for (int i = 0; i < 0x100; i++) { - if (SDL_KEY_DOWN(i) > 0) { - nRetVal = i; - goto End; - } - } - } - - // Now check all the connected joysticks - for (int i = 0; i < nJoystickCount; i++) { - int j; - if (ReadJoystick() != 0) { // There was an error polling the joystick - continue; - } - - for (j = 0; j < 0x10; j++) { // Axes - int nDelta = JoyPrevAxes[(i << 3) + (j >> 1)] - SDLinpJoyAxis(i, (j >> 1)); - if (nDelta < -0x4000 || nDelta > 0x4000) { - if (JoystickState(i, j)) { - nRetVal = 0x4000 | (i << 8) | j; - goto End; - } - } - } - - for (j = 0x10; j < 0x20; j++) { // POV hats - if (JoystickState(i, j)) { - nRetVal = 0x4000 | (i << 8) | j; - goto End; - } - } - - for (j = 0x80; j < 0x80 + SDL_JoystickNumButtons(JoyList[i]); j++) { - if (JoystickState(i, j)) { - nRetVal = 0x4000 | (i << 8) | j; - goto End; - } - } - } - - // Now the mouse - if (ReadMouse() == 0) { - int nDeltaX, nDeltaY; - - for (unsigned int j = 0x80; j < 0x80 + 0x80; j++) { - if (CheckMouseState(j)) { - nRetVal = 0x8000 | j; - goto End; - } - } - - nDeltaX = SDLinpMouseAxis(0, 0); - nDeltaY = SDLinpMouseAxis(0, 1); - if (abs(nDeltaX) < abs(nDeltaY)) { - if (nDeltaY != 0) { - return 0x8000 | 1; - } - } else { - if (nDeltaX != 0) { - return 0x8000 | 0; - } - } - } - -End: - - if (CreateBaseline) { - for (int i = 0; i < nJoystickCount; i++) { - for (int j = 0; j < 8; j++) { - JoyPrevAxes[(i << 3) + j] = SDLinpJoyAxis(i, j); - } - } - } - - return nRetVal; -} - -int SDLinpGetControlName(int nCode, TCHAR* pszDeviceName, TCHAR* pszControlName) -{ - if (pszDeviceName) { - pszDeviceName[0] = _T('\0'); - } - if (pszControlName) { - pszControlName[0] = _T('\0'); - } - - switch (nCode & 0xC000) { - case 0x0000: { - _tcscpy(pszDeviceName, _T("System keyboard")); - - break; - } - case 0x4000: { - int i = (nCode >> 8) & 0x3F; - - if (i >= nJoystickCount) { // This joystick isn't connected - return 0; - } - _tsprintf(pszDeviceName, "%hs", SDL_JoystickName(i)); - - break; - } - case 0x8000: { - int i = (nCode >> 8) & 0x3F; - - if (i >= 1) { - return 0; - } - _tcscpy(pszDeviceName, _T("System mouse")); - - break; - } - } - - return 0; -} - -struct InputInOut InputInOutSDL = { SDLinpInit, SDLinpExit, SDLinpSetCooperativeLevel, SDLinpStart, SDLinpState, SDLinpJoyAxis, SDLinpMouseAxis, SDLinpFind, SDLinpGetControlName, NULL, _T("SDL input") }; diff --git a/jan/src/intf/input/sdl/inp_sdl_keys.h b/jan/src/intf/input/sdl/inp_sdl_keys.h deleted file mode 100644 index c7f53953c..000000000 --- a/jan/src/intf/input/sdl/inp_sdl_keys.h +++ /dev/null @@ -1,324 +0,0 @@ -static int SDLtoFBK[512] = { - 0, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - FBK_BACK, - FBK_TAB, - -1, - -1, - -1, - FBK_RETURN, - -1, - -1, - -1, - -1, - -1, - FBK_PAUSE, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - FBK_ESCAPE, - -1, - -1, - -1, - -1, - FBK_SPACE, - -1, - -1, - -1, - -1, - -1, - -1, - FBK_APOSTROPHE, - -1, - -1, - -1, - -1, - FBK_COMMA, - FBK_MINUS, - FBK_PERIOD, - FBK_SLASH, - FBK_0, - FBK_1, - FBK_2, - FBK_3, - FBK_4, - FBK_5, - FBK_6, - FBK_7, - FBK_8, - FBK_9, - FBK_COLON, - FBK_SEMICOLON, - -1, - FBK_EQUALS, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - FBK_LBRACKET, - FBK_BACKSLASH, - FBK_RBRACKET, - -1, - -1, - FBK_GRAVE, - FBK_A, - FBK_B, - FBK_C, - FBK_D,FBK_E, - FBK_F, - FBK_G, - FBK_H, - FBK_I, - FBK_J, - FBK_K, - FBK_L, - FBK_M, - FBK_N, - FBK_O, - FBK_P, - FBK_Q, - FBK_R, - FBK_S, - FBK_T, - FBK_U, - FBK_V, - FBK_W, - FBK_X, - FBK_Y, - FBK_Z, - -1, - -1, - -1, - -1, - FBK_DELETE, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - FBK_NUMPAD0, - FBK_NUMPAD1, - FBK_NUMPAD2, - FBK_NUMPAD3, - FBK_NUMPAD4, - FBK_NUMPAD5, - FBK_NUMPAD6, - FBK_NUMPAD7, - FBK_NUMPAD8, - FBK_NUMPAD9, - FBK_DECIMAL, - FBK_DIVIDE, - FBK_MULTIPLY, - FBK_SUBTRACT, - FBK_ADD, - FBK_NUMPADENTER, - FBK_NUMPADEQUALS, - FBK_UPARROW, - FBK_DOWNARROW, - FBK_RIGHTARROW, - FBK_LEFTARROW, - FBK_INSERT, - FBK_HOME, - FBK_END, - FBK_PRIOR, - FBK_NEXT, - FBK_F1, - FBK_F2, - FBK_F3, - FBK_F4, - FBK_F5, - FBK_F6, - FBK_F7, - FBK_F8, - FBK_F9, - FBK_F10, - FBK_F11, - FBK_F12, - FBK_F13, - FBK_F14, - FBK_F15, - -1, - -1, - -1, - FBK_NUMLOCK, - FBK_CAPITAL, - FBK_SCROLL, - FBK_RSHIFT, - FBK_LSHIFT, - FBK_RCONTROL, - FBK_LCONTROL, - FBK_RALT, - FBK_LALT, - -1, - -1, - FBK_LWIN, - FBK_RWIN, - -1, - -1, - -1, - -1, - FBK_SYSRQ, - -1, - -1, - -1, - -1, - -1, -}; diff --git a/jan/src/intf/input/win32/dinput_core.cpp b/jan/src/intf/input/win32/dinput_core.cpp deleted file mode 100644 index f1c53fa2f..000000000 --- a/jan/src/intf/input/win32/dinput_core.cpp +++ /dev/null @@ -1,602 +0,0 @@ -#include "burner.h" -#include "dinput_core.h" - -#ifndef DIDFT_OPTIONAL -#define DIDFT_OPTIONAL 0x80000000 -#endif - -#define numObjects(x) (sizeof(x) / sizeof(x[0])) - -static const DIOBJECTDATAFORMAT dfDIJoystick[] = { - { &GUID_XAxis,DIJOFS_X,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_YAxis,DIJOFS_Y,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_ZAxis,DIJOFS_Z,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RxAxis,DIJOFS_RX,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RyAxis,DIJOFS_RY,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RzAxis,DIJOFS_RZ,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,DIJOFS_SLIDER(0),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,DIJOFS_SLIDER(1),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_POV,DIJOFS_POV(0),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, - { &GUID_POV,DIJOFS_POV(1),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, - { &GUID_POV,DIJOFS_POV(2),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, - { &GUID_POV,DIJOFS_POV(3),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(0),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(1),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(2),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(3),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(4),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(5),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(6),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(7),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(8),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(9),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(10),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(11),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(12),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(13),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(14),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(15),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(16),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(17),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(18),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(19),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(20),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(21),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(22),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(23),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(24),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(25),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(26),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(27),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(28),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(29),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(30),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(31),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, -}; - -const DIDATAFORMAT c_dfDIJoystick = { - sizeof(DIDATAFORMAT), - sizeof(DIOBJECTDATAFORMAT), - DIDF_ABSAXIS, - sizeof(DIJOYSTATE), - numObjects(dfDIJoystick), - (LPDIOBJECTDATAFORMAT)dfDIJoystick -}; - -static const DIOBJECTDATAFORMAT dfDIJoystick2[] = { - { &GUID_XAxis,DIJOFS_X,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_YAxis,DIJOFS_Y,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_ZAxis,DIJOFS_Z,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RxAxis,DIJOFS_RX,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RyAxis,DIJOFS_RY,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RzAxis,DIJOFS_RZ,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,DIJOFS_SLIDER(0),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,DIJOFS_SLIDER(1),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_POV,DIJOFS_POV(0),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, - { &GUID_POV,DIJOFS_POV(1),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, - { &GUID_POV,DIJOFS_POV(2),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, - { &GUID_POV,DIJOFS_POV(3),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(0),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(1),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(2),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(3),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(4),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(5),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(6),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(7),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(8),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(9),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(10),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(11),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(12),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(13),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(14),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(15),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(16),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(17),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(18),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(19),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(20),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(21),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(22),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(23),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(24),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(25),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(26),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(27),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(28),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(29),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(30),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(31),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(32),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(33),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(34),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(35),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(36),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(37),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(38),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(39),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(40),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(41),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(42),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(43),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(44),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(45),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(46),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(47),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(48),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(49),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(50),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(51),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(52),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(53),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(54),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(55),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(56),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(57),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(58),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(59),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(60),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(61),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(62),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(63),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(64),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(65),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(66),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(67),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(68),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(69),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(70),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(71),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(72),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(73),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(74),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(75),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(76),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(77),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(78),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(79),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(80),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(81),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(82),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(83),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(84),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(85),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(86),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(87),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(88),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(89),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(90),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(91),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(92),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(93),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(94),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(95),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(96),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(97),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(98),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(99),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(100),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(101),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(102),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(103),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(104),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(105),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(106),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(107),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(108),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(109),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(110),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(111),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(112),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(113),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(114),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(115),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(116),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(117),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(118),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(119),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(120),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(121),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(122),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(123),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(124),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(125),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(126),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { NULL,DIJOFS_BUTTON(127),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, - { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lVX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lVY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lVZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lVRx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lVRy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lVRz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglVSlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglVSlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lAX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lAY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lAZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lARx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lARy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lARz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglASlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglASlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lFX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lFY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lFZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lFRx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lFRy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lFRz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglFSlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, - { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglFSlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, -}; - -const DIDATAFORMAT c_dfDIJoystick2 = { - sizeof(DIDATAFORMAT), - sizeof(DIOBJECTDATAFORMAT), - DIDF_ABSAXIS, - sizeof(DIJOYSTATE2), - numObjects(dfDIJoystick2), - (LPDIOBJECTDATAFORMAT)dfDIJoystick2 -}; - -static const DIOBJECTDATAFORMAT dfDIMouse[] = { - { &GUID_XAxis, DIMOFS_X, DIDFT_ANYINSTANCE | DIDFT_AXIS, 0 }, - { &GUID_YAxis, DIMOFS_Y, DIDFT_ANYINSTANCE | DIDFT_AXIS, 0 }, - { &GUID_ZAxis, DIMOFS_Z, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_AXIS, 0 }, - { &GUID_Button, DIMOFS_BUTTON0, DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON1, DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON2, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON3, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 } -}; - -const DIDATAFORMAT c_dfDIMouse = { - sizeof(DIDATAFORMAT), - sizeof(DIOBJECTDATAFORMAT), - DIDF_RELAXIS, - sizeof(DIMOUSESTATE), - numObjects(dfDIMouse), - (LPDIOBJECTDATAFORMAT)dfDIMouse -}; - -static const DIOBJECTDATAFORMAT dfDIMouse2[] = { - { &GUID_XAxis, DIMOFS_X, DIDFT_ANYINSTANCE | DIDFT_AXIS, 0 }, - { &GUID_YAxis, DIMOFS_Y, DIDFT_ANYINSTANCE | DIDFT_AXIS, 0 }, - { &GUID_ZAxis, DIMOFS_Z, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_AXIS, 0 }, - { &GUID_Button, DIMOFS_BUTTON0, DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON1, DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON2, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON3, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON4, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON5, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON6, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 }, - { &GUID_Button, DIMOFS_BUTTON7, DIDFT_OPTIONAL | DIDFT_ANYINSTANCE | DIDFT_BUTTON, 0 } -}; - -const DIDATAFORMAT c_dfDIMouse2 = { - sizeof(DIDATAFORMAT), - sizeof(DIOBJECTDATAFORMAT), - DIDF_RELAXIS, - sizeof(DIMOUSESTATE2), - numObjects(dfDIMouse2), - (LPDIOBJECTDATAFORMAT)dfDIMouse2 -}; - -static const DIOBJECTDATAFORMAT dfDIKeyboard[] = { - { &GUID_Key,0,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(0),0}, - { &GUID_Key,1,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(1),0}, - { &GUID_Key,2,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(2),0}, - { &GUID_Key,3,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(3),0}, - { &GUID_Key,4,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(4),0}, - { &GUID_Key,5,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(5),0}, - { &GUID_Key,6,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(6),0}, - { &GUID_Key,7,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(7),0}, - { &GUID_Key,8,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(8),0}, - { &GUID_Key,9,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(9),0}, - { &GUID_Key,10,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(10),0}, - { &GUID_Key,11,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(11),0}, - { &GUID_Key,12,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(12),0}, - { &GUID_Key,13,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(13),0}, - { &GUID_Key,14,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(14),0}, - { &GUID_Key,15,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(15),0}, - { &GUID_Key,16,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(16),0}, - { &GUID_Key,17,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(17),0}, - { &GUID_Key,18,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(18),0}, - { &GUID_Key,19,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(19),0}, - { &GUID_Key,20,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(20),0}, - { &GUID_Key,21,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(21),0}, - { &GUID_Key,22,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(22),0}, - { &GUID_Key,23,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(23),0}, - { &GUID_Key,24,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(24),0}, - { &GUID_Key,25,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(25),0}, - { &GUID_Key,26,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(26),0}, - { &GUID_Key,27,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(27),0}, - { &GUID_Key,28,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(28),0}, - { &GUID_Key,29,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(29),0}, - { &GUID_Key,30,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(30),0}, - { &GUID_Key,31,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(31),0}, - { &GUID_Key,32,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(32),0}, - { &GUID_Key,33,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(33),0}, - { &GUID_Key,34,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(34),0}, - { &GUID_Key,35,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(35),0}, - { &GUID_Key,36,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(36),0}, - { &GUID_Key,37,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(37),0}, - { &GUID_Key,38,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(38),0}, - { &GUID_Key,39,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(39),0}, - { &GUID_Key,40,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(40),0}, - { &GUID_Key,41,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(41),0}, - { &GUID_Key,42,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(42),0}, - { &GUID_Key,43,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(43),0}, - { &GUID_Key,44,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(44),0}, - { &GUID_Key,45,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(45),0}, - { &GUID_Key,46,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(46),0}, - { &GUID_Key,47,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(47),0}, - { &GUID_Key,48,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(48),0}, - { &GUID_Key,49,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(49),0}, - { &GUID_Key,50,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(50),0}, - { &GUID_Key,51,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(51),0}, - { &GUID_Key,52,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(52),0}, - { &GUID_Key,53,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(53),0}, - { &GUID_Key,54,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(54),0}, - { &GUID_Key,55,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(55),0}, - { &GUID_Key,56,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(56),0}, - { &GUID_Key,57,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(57),0}, - { &GUID_Key,58,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(58),0}, - { &GUID_Key,59,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(59),0}, - { &GUID_Key,60,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(60),0}, - { &GUID_Key,61,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(61),0}, - { &GUID_Key,62,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(62),0}, - { &GUID_Key,63,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(63),0}, - { &GUID_Key,64,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(64),0}, - { &GUID_Key,65,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(65),0}, - { &GUID_Key,66,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(66),0}, - { &GUID_Key,67,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(67),0}, - { &GUID_Key,68,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(68),0}, - { &GUID_Key,69,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(69),0}, - { &GUID_Key,70,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(70),0}, - { &GUID_Key,71,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(71),0}, - { &GUID_Key,72,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(72),0}, - { &GUID_Key,73,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(73),0}, - { &GUID_Key,74,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(74),0}, - { &GUID_Key,75,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(75),0}, - { &GUID_Key,76,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(76),0}, - { &GUID_Key,77,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(77),0}, - { &GUID_Key,78,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(78),0}, - { &GUID_Key,79,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(79),0}, - { &GUID_Key,80,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(80),0}, - { &GUID_Key,81,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(81),0}, - { &GUID_Key,82,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(82),0}, - { &GUID_Key,83,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(83),0}, - { &GUID_Key,84,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(84),0}, - { &GUID_Key,85,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(85),0}, - { &GUID_Key,86,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(86),0}, - { &GUID_Key,87,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(87),0}, - { &GUID_Key,88,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(88),0}, - { &GUID_Key,89,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(89),0}, - { &GUID_Key,90,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(90),0}, - { &GUID_Key,91,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(91),0}, - { &GUID_Key,92,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(92),0}, - { &GUID_Key,93,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(93),0}, - { &GUID_Key,94,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(94),0}, - { &GUID_Key,95,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(95),0}, - { &GUID_Key,96,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(96),0}, - { &GUID_Key,97,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(97),0}, - { &GUID_Key,98,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(98),0}, - { &GUID_Key,99,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(99),0}, - { &GUID_Key,100,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(100),0}, - { &GUID_Key,101,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(101),0}, - { &GUID_Key,102,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(102),0}, - { &GUID_Key,103,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(103),0}, - { &GUID_Key,104,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(104),0}, - { &GUID_Key,105,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(105),0}, - { &GUID_Key,106,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(106),0}, - { &GUID_Key,107,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(107),0}, - { &GUID_Key,108,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(108),0}, - { &GUID_Key,109,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(109),0}, - { &GUID_Key,110,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(110),0}, - { &GUID_Key,111,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(111),0}, - { &GUID_Key,112,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(112),0}, - { &GUID_Key,113,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(113),0}, - { &GUID_Key,114,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(114),0}, - { &GUID_Key,115,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(115),0}, - { &GUID_Key,116,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(116),0}, - { &GUID_Key,117,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(117),0}, - { &GUID_Key,118,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(118),0}, - { &GUID_Key,119,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(119),0}, - { &GUID_Key,120,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(120),0}, - { &GUID_Key,121,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(121),0}, - { &GUID_Key,122,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(122),0}, - { &GUID_Key,123,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(123),0}, - { &GUID_Key,124,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(124),0}, - { &GUID_Key,125,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(125),0}, - { &GUID_Key,126,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(126),0}, - { &GUID_Key,127,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(127),0}, - { &GUID_Key,128,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(128),0}, - { &GUID_Key,129,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(129),0}, - { &GUID_Key,130,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(130),0}, - { &GUID_Key,131,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(131),0}, - { &GUID_Key,132,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(132),0}, - { &GUID_Key,133,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(133),0}, - { &GUID_Key,134,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(134),0}, - { &GUID_Key,135,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(135),0}, - { &GUID_Key,136,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(136),0}, - { &GUID_Key,137,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(137),0}, - { &GUID_Key,138,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(138),0}, - { &GUID_Key,139,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(139),0}, - { &GUID_Key,140,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(140),0}, - { &GUID_Key,141,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(141),0}, - { &GUID_Key,142,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(142),0}, - { &GUID_Key,143,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(143),0}, - { &GUID_Key,144,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(144),0}, - { &GUID_Key,145,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(145),0}, - { &GUID_Key,146,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(146),0}, - { &GUID_Key,147,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(147),0}, - { &GUID_Key,148,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(148),0}, - { &GUID_Key,149,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(149),0}, - { &GUID_Key,150,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(150),0}, - { &GUID_Key,151,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(151),0}, - { &GUID_Key,152,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(152),0}, - { &GUID_Key,153,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(153),0}, - { &GUID_Key,154,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(154),0}, - { &GUID_Key,155,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(155),0}, - { &GUID_Key,156,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(156),0}, - { &GUID_Key,157,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(157),0}, - { &GUID_Key,158,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(158),0}, - { &GUID_Key,159,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(159),0}, - { &GUID_Key,160,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(160),0}, - { &GUID_Key,161,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(161),0}, - { &GUID_Key,162,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(162),0}, - { &GUID_Key,163,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(163),0}, - { &GUID_Key,164,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(164),0}, - { &GUID_Key,165,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(165),0}, - { &GUID_Key,166,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(166),0}, - { &GUID_Key,167,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(167),0}, - { &GUID_Key,168,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(168),0}, - { &GUID_Key,169,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(169),0}, - { &GUID_Key,170,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(170),0}, - { &GUID_Key,171,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(171),0}, - { &GUID_Key,172,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(172),0}, - { &GUID_Key,173,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(173),0}, - { &GUID_Key,174,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(174),0}, - { &GUID_Key,175,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(175),0}, - { &GUID_Key,176,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(176),0}, - { &GUID_Key,177,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(177),0}, - { &GUID_Key,178,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(178),0}, - { &GUID_Key,179,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(179),0}, - { &GUID_Key,180,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(180),0}, - { &GUID_Key,181,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(181),0}, - { &GUID_Key,182,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(182),0}, - { &GUID_Key,183,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(183),0}, - { &GUID_Key,184,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(184),0}, - { &GUID_Key,185,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(185),0}, - { &GUID_Key,186,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(186),0}, - { &GUID_Key,187,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(187),0}, - { &GUID_Key,188,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(188),0}, - { &GUID_Key,189,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(189),0}, - { &GUID_Key,190,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(190),0}, - { &GUID_Key,191,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(191),0}, - { &GUID_Key,192,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(192),0}, - { &GUID_Key,193,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(193),0}, - { &GUID_Key,194,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(194),0}, - { &GUID_Key,195,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(195),0}, - { &GUID_Key,196,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(196),0}, - { &GUID_Key,197,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(197),0}, - { &GUID_Key,198,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(198),0}, - { &GUID_Key,199,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(199),0}, - { &GUID_Key,200,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(200),0}, - { &GUID_Key,201,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(201),0}, - { &GUID_Key,202,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(202),0}, - { &GUID_Key,203,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(203),0}, - { &GUID_Key,204,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(204),0}, - { &GUID_Key,205,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(205),0}, - { &GUID_Key,206,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(206),0}, - { &GUID_Key,207,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(207),0}, - { &GUID_Key,208,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(208),0}, - { &GUID_Key,209,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(209),0}, - { &GUID_Key,210,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(210),0}, - { &GUID_Key,211,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(211),0}, - { &GUID_Key,212,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(212),0}, - { &GUID_Key,213,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(213),0}, - { &GUID_Key,214,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(214),0}, - { &GUID_Key,215,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(215),0}, - { &GUID_Key,216,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(216),0}, - { &GUID_Key,217,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(217),0}, - { &GUID_Key,218,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(218),0}, - { &GUID_Key,219,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(219),0}, - { &GUID_Key,220,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(220),0}, - { &GUID_Key,221,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(221),0}, - { &GUID_Key,222,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(222),0}, - { &GUID_Key,223,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(223),0}, - { &GUID_Key,224,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(224),0}, - { &GUID_Key,225,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(225),0}, - { &GUID_Key,226,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(226),0}, - { &GUID_Key,227,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(227),0}, - { &GUID_Key,228,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(228),0}, - { &GUID_Key,229,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(229),0}, - { &GUID_Key,230,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(230),0}, - { &GUID_Key,231,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(231),0}, - { &GUID_Key,232,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(232),0}, - { &GUID_Key,233,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(233),0}, - { &GUID_Key,234,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(234),0}, - { &GUID_Key,235,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(235),0}, - { &GUID_Key,236,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(236),0}, - { &GUID_Key,237,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(237),0}, - { &GUID_Key,238,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(238),0}, - { &GUID_Key,239,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(239),0}, - { &GUID_Key,240,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(240),0}, - { &GUID_Key,241,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(241),0}, - { &GUID_Key,242,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(242),0}, - { &GUID_Key,243,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(243),0}, - { &GUID_Key,244,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(244),0}, - { &GUID_Key,245,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(245),0}, - { &GUID_Key,246,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(246),0}, - { &GUID_Key,247,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(247),0}, - { &GUID_Key,248,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(248),0}, - { &GUID_Key,249,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(249),0}, - { &GUID_Key,250,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(250),0}, - { &GUID_Key,251,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(251),0}, - { &GUID_Key,252,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(252),0}, - { &GUID_Key,253,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(253),0}, - { &GUID_Key,254,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(254),0}, - { &GUID_Key,255,DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_MAKEINSTANCE(255),0} -}; - -const DIDATAFORMAT c_dfDIKeyboard = { - sizeof(DIDATAFORMAT), - sizeof(DIOBJECTDATAFORMAT), - DIDF_RELAXIS, - 256, - numObjects(dfDIKeyboard), - (LPDIOBJECTDATAFORMAT)dfDIKeyboard -}; - -// DirectInput8Create -HRESULT (WINAPI* _DirectInput8Create) (HINSTANCE, DWORD, REFIID, LPVOID*, LPUNKNOWN); -HRESULT WINAPI Empty_DirectInput8Create (HINSTANCE, DWORD, REFIID, LPVOID*, LPUNKNOWN) { return 0; } - -static HINSTANCE hDICore; -static BOOL nDICoreInit = FALSE; - -/* -static void DICore_Exit() -{ - FreeLibrary(hDICore); -} -*/ - -// Macro for easy handling of functions -#define _LOADFN(_rettype, _name, _empty, _params, _hinst, _str ) \ - \ - _name = (_rettype (WINAPI *)_params) GetProcAddress(_hinst, _str); \ - \ - if(!_name) { \ - _name = _empty; \ - return 0; \ - } - -static INT32 DICore_GetFunctions() -{ - if(!nDICoreInit) return 0; - - _LOADFN(HRESULT, _DirectInput8Create, Empty_DirectInput8Create, (HINSTANCE, DWORD, REFIID, LPVOID*, LPUNKNOWN), hDICore, "DirectInput8Create"); - - return 1; -} - -INT32 DICore_Init() -{ - hDICore = LoadLibrary(_T("dinput8.dll")); - - if(!hDICore) { - MessageBox(NULL, _T("Loading of DINPUT8.DLL failed."), _T("Error"), MB_OK | MB_ICONERROR); - nDICoreInit = FALSE; - return 0; - } - - nDICoreInit = TRUE; - if(!DICore_GetFunctions()) { - MessageBox(NULL, _T("There was a problem while loading functions from DINPUT8.DLL"), _T("Error"), MB_OK | MB_ICONERROR); - return 0; - } - - return 1; -} diff --git a/jan/src/intf/input/win32/dinput_core.h b/jan/src/intf/input/win32/dinput_core.h deleted file mode 100644 index 34eb3e3c8..000000000 --- a/jan/src/intf/input/win32/dinput_core.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _DINPUT_CORE_ -#define _DINPUT_CORE_ - -#define DIRECTINPUT_VERSION 0x0800 -#include - -extern const DIDATAFORMAT c_dfDIJoystick2; -extern const DIDATAFORMAT c_dfDIMouse2; -extern const DIDATAFORMAT c_dfDIKeyboard; - -// DirectInput8Create -extern HRESULT (WINAPI* _DirectInput8Create) (HINSTANCE, DWORD, REFIID, LPVOID*, LPUNKNOWN); - -INT32 DICore_Init(); - -#endif diff --git a/jan/src/intf/input/win32/inp_dinput.cpp b/jan/src/intf/input/win32/inp_dinput.cpp deleted file mode 100644 index 476f32a16..000000000 --- a/jan/src/intf/input/win32/inp_dinput.cpp +++ /dev/null @@ -1,876 +0,0 @@ -// DirectInput module -// updated to dinput8 by regret - -#include "burner.h" -#include "inp_keys.h" - -#include - -#define DIRECTINPUT_VERSION 0x0800 -#include - -//#ifdef _MSC_VER -//#pragma comment(lib, "dinput8") -//#pragma comment(lib, "dxguid") -//#endif - -#include "dinput_core.h" - -#define MAX_KEYBOARD (1) -#define MAX_GAMEPAD (8) -#define MAX_JOYAXIS (8) -#define MAX_MOUSE (4) -#define MAX_MOUSEAXIS (3) - -static BOOL CALLBACK gamepadEnumAxesCallback(LPCDIDEVICEOBJECTINSTANCE, LPVOID); -static BOOL CALLBACK mouseEnumAxesCallback(LPCDIDEVICEOBJECTINSTANCE, LPVOID); -static BOOL CALLBACK gamepadEnumCallback(LPCDIDEVICEINSTANCE, LPVOID); -static BOOL CALLBACK mouseEnumCallback(LPCDIDEVICEINSTANCE, LPVOID); - - -//class InputDI : public Input { -//public: - struct keyboardData { - IDirectInputDevice8W* lpdid; - unsigned char state[256]; - unsigned char readStatus; - } keyboardProperties[MAX_KEYBOARD]; - - struct gamepadData { - IDirectInputDevice8W* lpdid; - DIJOYSTATE2 dijs; - DWORD dwAxisType[MAX_JOYAXIS]; - DWORD dwAxisBaseline[MAX_JOYAXIS]; - DWORD dwAxes; - DWORD dwPOVs; - DWORD dwButtons; - unsigned char readStatus; - } gamepadProperties[MAX_GAMEPAD]; - - struct mouseData { - IDirectInputDevice8W* lpdid; - DIMOUSESTATE2 dims; - DWORD dwAxisType[MAX_MOUSEAXIS]; - DWORD dwAxes; - DWORD dwButtons; - unsigned char readStatus; - } mouseProperties[MAX_MOUSE]; - - int keyboardCount; // Number of keyboards connected to this machine - int gamepadCount; // Number of gamepads connected to this machine - int mouseCount; // Number of mice connected to this machine - - IDirectInput8W* pDI; - HWND hDinpWnd; - - int gamepadInitSingle() - { - gamepadData* gamepad = &gamepadProperties[gamepadCount]; - if (gamepad->lpdid == NULL) { - return 1; - } - - if (FAILED(gamepad->lpdid->SetDataFormat(&c_dfDIJoystick2))) { - return 1; - } - - DIDEVCAPS didcl; - memset(&didcl, 0, sizeof(didcl)); - didcl.dwSize = sizeof(DIDEVCAPS); - if (FAILED(gamepad->lpdid->GetCapabilities(&didcl))) { - return 1; - } - - gamepad->dwAxes = didcl.dwAxes; - gamepad->dwPOVs = didcl.dwPOVs; - gamepad->dwButtons = didcl.dwButtons; - - gamepad->lpdid->SetCooperativeLevel(hDinpWnd, DISCL_EXCLUSIVE | DISCL_BACKGROUND); - gamepad->lpdid->EnumObjects(gamepadEnumAxesCallback, /*(void*)this*/ gamepad->lpdid, DIDFT_AXIS); - gamepad->lpdid->Acquire(); - - return 0; - } - - int mouseInitSingle() - { - mouseData* mouse = &mouseProperties[mouseCount]; - if (mouse->lpdid == NULL) { - return 1; - } - - if (FAILED(mouse->lpdid->SetDataFormat(&c_dfDIMouse2))) { - return 1; - } - - DIDEVCAPS didcl; - memset(&didcl, 0, sizeof(didcl)); - didcl.dwSize = sizeof(didcl); - mouse->lpdid->GetCapabilities(&didcl); - - mouse->dwAxes = didcl.dwAxes; - mouse->dwButtons = didcl.dwButtons; - - mouse->lpdid->SetCooperativeLevel(hDinpWnd, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND); - mouse->lpdid->EnumObjects(mouseEnumAxesCallback, /*(void*)this*/mouse->lpdid, DIDFT_AXIS); - mouse->lpdid->Acquire(); - - return 0; - } - - bool mouseEnumDevice(LPCDIDEVICEINSTANCE instance) - { - if (!instance) { - return DIENUM_CONTINUE; - } - - if (mouseCount >= MAX_MOUSE) { - return DIENUM_STOP; - } - - // Create the DirectInput interface - if (FAILED(pDI->CreateDevice(instance->guidInstance, &mouseProperties[mouseCount].lpdid, NULL))) { - return DIENUM_CONTINUE; - } - - if (!mouseInitSingle()) { - mouseCount++; - } - - return DIENUM_CONTINUE; - } - - bool gamepadEnumDevice(LPCDIDEVICEINSTANCE instance) - { - if (!instance) { - return DIENUM_CONTINUE; - } - - if (gamepadCount >= MAX_GAMEPAD) { - return DIENUM_STOP; - } - - // Create the DirectInput interface - if (FAILED(pDI->CreateDevice(instance->guidInstance, &gamepadProperties[gamepadCount].lpdid, NULL))) { - return DIENUM_CONTINUE; - } - - if (gamepadInitSingle() == 0) { - gamepadCount++; - } - - return DIENUM_CONTINUE; - } - - bool mouseEnumObject(LPCDIDEVICEOBJECTINSTANCE instance) - { - mouseData* p = &mouseProperties[mouseCount]; - - // Store the flags for later use - ((mouseData*)p)->dwAxisType[DIDFT_GETINSTANCE(instance->dwType)] = instance->dwType; - return DIENUM_CONTINUE; - } - - bool gamepadEnumObject(LPCDIDEVICEOBJECTINSTANCE instance) - { - if (!(DIDFT_GETTYPE(instance->dwType) & DIDFT_AXIS)) { - return DIENUM_CONTINUE; - } - - gamepadData* p = &gamepadProperties[gamepadCount]; - p->dwAxisType[DIDFT_GETINSTANCE(instance->dwType)] = instance->dwType; - - // Set axis range - DIPROPRANGE range; - range.diph.dwSize = sizeof(range); - range.diph.dwHeaderSize = sizeof(range.diph); - range.diph.dwHow = DIPH_BYID; - range.diph.dwObj = instance->dwType; - range.lMin = -32768; - range.lMax = +32767; - if (FAILED(p->lpdid->SetProperty(DIPROP_RANGE, &range.diph))) { - if (FAILED(p->lpdid->GetProperty(DIPROP_RANGE, &range.diph)) || range.lMin >= 0 || range.lMax <= 0) { - return DIENUM_CONTINUE; - } - } - - return DIENUM_CONTINUE; - } - - int setCooperativeLevel(bool exclusive, bool foreGround) - { - if (keyboardProperties[0].lpdid) { - keyboardProperties[0].lpdid->Unacquire(); - if (foreGround) { - keyboardProperties[0].lpdid->SetCooperativeLevel(hDinpWnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND | (nVidFullscreen ? DISCL_NOWINKEY : 0)); - } else { - keyboardProperties[0].lpdid->SetCooperativeLevel(hDinpWnd, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND | (nVidFullscreen ? DISCL_NOWINKEY : 0)); - } - keyboardProperties[0].lpdid->Acquire(); - } - - // mouse 0 is the system mouse - if (mouseProperties[0].lpdid) { - mouseProperties[0].lpdid->Unacquire(); - if (exclusive) { - POINT point = { 0, 0 }; - RECT rect; - - // Ensure the cursor is centered on the input window - ClientToScreen(hDinpWnd, &point); - GetClientRect(hDinpWnd, &rect); - SetCursorPos(point.x + rect.right / 2, point.y + rect.bottom / 2); - - SetForegroundWindow(hDinpWnd); - SetWindowPos(hDinpWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - - mouseProperties[0].lpdid->SetCooperativeLevel(hDinpWnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND); - } else { - mouseProperties[0].lpdid->SetCooperativeLevel(hDinpWnd, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND); - } - mouseProperties[0].lpdid->Acquire(); - } - - // Windows/DirectInput don't always hide the cursor for us - if (bDrvOkay && (exclusive || nVidFullscreen)) { - while (ShowCursor(FALSE) >= 0) {} - } else { - while (ShowCursor(TRUE) < 0) {} - } - - return 0; - } - - int exit() - { - // Release the keyboard interface - for (int i = 0; i < MAX_KEYBOARD; i++) { - RELEASE(keyboardProperties[i].lpdid) - } - keyboardCount = 0; - - // Release the gamepad interfaces - for (int i = 0; i < MAX_GAMEPAD; i++) { - RELEASE(gamepadProperties[i].lpdid) - } - gamepadCount = 0; - - // Release the mouse interface - for (int i = 0; i < MAX_MOUSE; i++) { - RELEASE(mouseProperties[i].lpdid) - } - mouseCount = 0; - - // Release the DirectInput interface - RELEASE(pDI) - - return 0; - } - - int init() - { - hDinpWnd = hScrnWnd; - - exit(); - - memset(&keyboardProperties, 0, sizeof(keyboardProperties)); - memset(&gamepadProperties, 0, sizeof(gamepadProperties)); - memset(&mouseProperties, 0, sizeof(mouseProperties)); - - if (FAILED(_DirectInput8Create(hAppInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&pDI, NULL))) { - return 1; - } - - // keyboard - if (FAILED(pDI->CreateDevice(GUID_SysKeyboard, &keyboardProperties[0].lpdid, NULL))) { - return 1; - } - keyboardProperties[0].lpdid->SetDataFormat(&c_dfDIKeyboard); - keyboardProperties[0].lpdid->SetCooperativeLevel(hDinpWnd, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND); - keyboardProperties[0].lpdid->Acquire(); - keyboardCount = 1; - - // Enumerate and set up the mice connected to the system - // Note that under Win2K/WinXP only one mouse device will be enumerated - if (FAILED(pDI->EnumDevices(DI8DEVTYPE_MOUSE, mouseEnumCallback, /*(void*)this*/pDI, DIEDFL_ATTACHEDONLY))) { - return 1; - } - - // Enumerate and set up the gamepads connected to the system - if (FAILED(pDI->EnumDevices(DI8DEVCLASS_GAMECTRL, gamepadEnumCallback, /*(void*)this*/pDI, DIEDFL_ATTACHEDONLY))) { - return 1; - } - - return 0; - } - - // Call before checking for Input in a frame - int newFrame() - { - // No gamepads have been read for this frame - for (int i = 0; i < gamepadCount; i++) { - gamepadProperties[i].readStatus = 0; - } - - // mouse not read this frame - for (int i = 0; i < mouseCount; i++) { - mouseProperties[i].readStatus = 0; - } - - // keyboard not read this frame - for (int i = 0; i < keyboardCount; i++) { - keyboardProperties[i].readStatus = 0; - } - - return 0; - } - - // Read the keyboard - int readKeyboard(keyboardData* keyboard) - { - if (keyboard->readStatus) { // Already read this frame - ready to go - return 0; - } - if (!keyboard->lpdid) { - return 1; - } - - // Read keyboard, reacquiring if neccesary - HRESULT ret = DI_OK; - for (int j = 0; j < 2; j++) { - ret = keyboard->lpdid->GetDeviceState(sizeof(keyboard->state), (void*)keyboard->state); - if (ret != DIERR_INPUTLOST && ret != DIERR_NOTACQUIRED) { - break; - } - keyboard->lpdid->Acquire(); // If DIERR_INPUTLOST, reacquire and try again - } - if (FAILED(ret)) { // Failed to read the keyboard - return 1; - } - - // The keyboard has been successfully Read this frame - keyboard->readStatus = 1; - - return 0; - } - - // Read one of the gamepads - int readGamepad(gamepadData* gamepad) - { - if (gamepad->readStatus == 1) { // Already read this frame - ready to go - return 0; - } - if (gamepad->readStatus == 2) { // Error reading gamepad - return 1; - } - if (!gamepad->lpdid) { - return 1; - } - - gamepad->readStatus = 2; // Mark gamepad as trying to read - - // Poll + read gamepad, reacquiring if neccesary - HRESULT ret = DI_OK; - for (int j = 0; j < 2; j++) { - gamepad->lpdid->Poll(); - - ret = gamepad->lpdid->GetDeviceState(sizeof(gamepad->dijs), &gamepad->dijs); - if (ret != DIERR_INPUTLOST && ret != DIERR_NOTACQUIRED) { - break; - } - gamepad->lpdid->Acquire(); // If DIERR_INPUTLOST, reacquire and try again - } - if (FAILED(ret)) { - return 1; - } - - // This gamepad had been successfully Read this frame - gamepad->readStatus = 1; - - return 0; - } - - // Check a subcode (the 40xx bit in 4001, 4102 etc) for a gamepad input code - int gamepadState(gamepadData* gamepad, unsigned int subCode) - { - if (subCode < 0x10) { // gamepad directions - // Some drivers don't assign unused axes a value of 0 - if (!(gamepad->dwAxisType[subCode >> 1] & DIDFT_AXIS)) { - return 0; - } - - const int DEADZONE = 0x4000; - - switch (subCode) { - case 0x00: return gamepad->dijs.lX < -DEADZONE; // Left - case 0x01: return gamepad->dijs.lX > DEADZONE; // Right - case 0x02: return gamepad->dijs.lY < -DEADZONE; // Up - case 0x03: return gamepad->dijs.lY > DEADZONE; // Down - case 0x04: return gamepad->dijs.lZ < -DEADZONE; - case 0x05: return gamepad->dijs.lZ > DEADZONE; - case 0x06: return gamepad->dijs.lRx < -DEADZONE; - case 0x07: return gamepad->dijs.lRx > DEADZONE; - case 0x08: return gamepad->dijs.lRy < -DEADZONE; - case 0x09: return gamepad->dijs.lRy > DEADZONE; - case 0x0A: return gamepad->dijs.lRz < -DEADZONE; - case 0x0B: return gamepad->dijs.lRz > DEADZONE; - case 0x0C: return gamepad->dijs.rglSlider[0] < -DEADZONE; - case 0x0D: return gamepad->dijs.rglSlider[0] > DEADZONE; - case 0x0E: return gamepad->dijs.rglSlider[1] < -DEADZONE; - case 0x0F: return gamepad->dijs.rglSlider[1] > DEADZONE; - } - } - - if (subCode < 0x10 + (gamepad->dwPOVs << 2)) { // POV hat controls - DWORD hatDirection = gamepad->dijs.rgdwPOV[(subCode & 0x0F) >> 2]; - if ((LOWORD(hatDirection) != 0xFFFF)) { - switch (subCode & 3) { - case 0: // Left - return (hatDirection >= 22500 && hatDirection <= 31500); - case 1: // Right - return (hatDirection >= 4500 && hatDirection <= 13500); - case 2: // Up - return (hatDirection >= 31500 || hatDirection <= 4500); - case 3: // Down - return (hatDirection >= 13500 && hatDirection <= 22500); - } - } - return 0; - } - if (subCode < 0x80) { // Undefined - return 0; - } - if (subCode < 0x80 + gamepad->dwButtons) { // gamepad buttons - return (gamepad->dijs.rgbButtons[subCode & 0x7F] & 0x80) ? 1 : 0; - } - - return 0; - } - - // Read the mouse - int readMouse(mouseData* mouse) - { - if (mouse->readStatus) { // Already read this frame - ready to go - return 0; - } - if (!mouse->lpdid) { - return 1; - } - - // Read mouse, reacquiring if neccesary - HRESULT ret = DI_OK; - for (int j = 0; j < 2; j++) { - ret = mouse->lpdid->GetDeviceState(sizeof(mouse->dims), (void*)&mouse->dims); - if (ret != DIERR_INPUTLOST) { - break; - } - mouse->lpdid->Acquire(); // If DIERR_INPUTLOST, reacquire and try again - } - if (FAILED(ret)) { // Failed to read the mouse - return 1; - } - - // The mouse has been successfully Read this frame - mouse->readStatus = 1; - - return 0; - } - - // Check a subcode (the 80xx bit in 8001, 8102 etc) for a mouse input code - int checkMouseState(mouseData* mouse, unsigned int subCode) - { - if (subCode < 0x80) { // Undefined - return 0; - } - if (subCode < 0x80 + mouse->dwButtons) { // mouse buttons - return (mouse->dims.rgbButtons[subCode & 0x7F] & 0x80) ? 1 : 0; - } - - return 0; - } - - // Get the state (pressed = 1, not pressed = 0) of a particular input code - int getState(int code) - { - if (code < 0) { - return 0; - } - - if (code < 256) { - if (readKeyboard(&keyboardProperties[0])) { // Check keyboard has been read - return not pressed on error - return 0; - } - return (keyboardProperties[0].state[code] & 0x80) ? 1 : 0; - } - - if (code < 0x4000) { - return 0; - } - - // Codes 4000-8000 = Joysticks - if (code < 0x8000) { - int i = (code - 0x4000) >> 8; - if (i >= gamepadCount) { // This gamepad number isn't connected - return 0; - } - if (readGamepad(&gamepadProperties[i])) { // Error polling the gamepad - return 0; - } - - // Find the gamepad state in our array - return gamepadState(&gamepadProperties[i], code & 0xFF); - } - - // Codes 8000-C000 = mouse - if (code < 0xC000) { - int i = (code - 0x8000) >> 8; - if (i >= mouseCount) { // This mouse number isn't connected - return 0; - } - if (readMouse(&mouseProperties[i])) { // Error Reading the mouse - return 0; - } - return checkMouseState(&mouseProperties[i], code & 0xFF); - } - - return 0; - } - - // Read one gamepad axis - int readGamepadAxis(int i, int axis) - { - gamepadData* gamepad = &gamepadProperties[i]; - - if (i < 0 || i >= gamepadCount) { // This gamepad isn't connected - return 0; - } - if (readGamepad(gamepad)) { // Error polling the gamepad - return 0; - } - - // Some drivers don't assign unused axes a value of 0 - if (!(gamepad->dwAxisType[axis & (MAX_JOYAXIS - 1)] & DIDFT_AXIS)) { - return 0; - } - - switch (axis) { - case 0: - return gamepad->dijs.lX; - case 1: - return gamepad->dijs.lY; - case 2: - return gamepad->dijs.lZ; - case 3: - return gamepad->dijs.lRx; - case 4: - return gamepad->dijs.lRy; - case 5: - return gamepad->dijs.lRz; - case 6: - return gamepad->dijs.rglSlider[0]; - case 7: - return gamepad->dijs.rglSlider[1]; - } - - return 0; - } - - // Read one mouse axis - int readMouseAxis(int i, int axis) - { - mouseData* mouse = &mouseProperties[i]; - - if (i < 0 || i >= mouseCount) { // This mouse isn't connected - return 0; - } - if (readMouse(mouse) != 0) { // Error polling the mouse - return 0; - } - - // Some drivers don't assign unused axes a value of 0 - if (!(mouse->dwAxisType[axis & (MAX_MOUSEAXIS - 1)] & DIDFT_AXIS)) { - return 0; - } - - switch (axis) { - case 0: - return mouse->dims.lX; - case 1: - return mouse->dims.lY; - case 2: - return mouse->dims.lZ / WHEEL_DELTA; - } - - return 0; - } - - // This function finds which key is pressed - // To ensure analog gamepad axes are handled correctly, call with createBaseline = true the 1st time - int find(bool createBaseline) - { - int retVal = -1; // assume nothing pressed - - // check if any keyboard keys are pressed - if (!readKeyboard(&keyboardProperties[0])) { - for (int i = 0; i < 256; i++) { - if (keyboardProperties[0].state[i] & 0x80) { - retVal = i; - goto End; - } - } - } - - // Now check all the connected gamepads - for (int i = 0; i < gamepadCount; i++) { - gamepadData* gamepad = &gamepadProperties[i]; - if (readGamepad(gamepad)) { // There was an error polling the gamepad - continue; - } - - for (unsigned int j = 0; j < 0x10; j++) { // Axes - int delta = gamepad->dwAxisBaseline[j >> 1] - readGamepadAxis(i, (j >> 1)); - if (delta < -0x4000 || delta > 0x4000) { - if (gamepadState(gamepad, j)) { - retVal = 0x4000 | (i << 8) | j; - goto End; - } - } - } - - for (unsigned int j = 0x10; j < 0x10 + (gamepad->dwPOVs << 2); j++) { // POV hats - if (gamepadState(gamepad, j)) { - retVal = 0x4000 | (i << 8) | j; - goto End; - } - } - - for (unsigned int j = 0x80; j < 0x80 + gamepad->dwButtons; j++) { // Buttons - if (gamepadState(gamepad, j)) { - retVal = 0x4000 | (i << 8) | j; - goto End; - } - } - } - - // Now check all the connected mice - for (int i = 0; i < mouseCount; i++) { - mouseData* mouse = &mouseProperties[i]; - if (readMouse(mouse)) { - continue; - } - - for (unsigned int j = 0x80; j < 0x80 + mouse->dwButtons; j++) { - if (checkMouseState(mouse, j)) { - retVal = 0x8000 | (i << 8) | j; - goto End; - } - } - - int maxDelta = 0, maxAxis = 0; - for (unsigned int j = 0; j < MAX_MOUSEAXIS; j++) { - int delta = readMouseAxis(i, j); - if (abs(maxDelta) < abs(delta)) { - maxDelta = delta; - maxAxis = j; - } - } - if (maxDelta < 0) { - return 0x8000 | (i << 8) | (maxAxis << 1) | 0; - } - if (maxDelta > 0) { - return 0x8000 | (i << 8) | (maxAxis << 1) | 1; - } - } - - End: - - if (createBaseline) { - for (int i = 0; i < gamepadCount; i++) { - for (int j = 0; j < MAX_JOYAXIS; j++) { - gamepadProperties[i].dwAxisBaseline[j] = readGamepadAxis(i, j); - } - } - } - - return retVal; - } - - int getControlName(int code, wchar_t* deviceName, wchar_t* controlName) - { - IDirectInputDevice8W* lpdid = NULL; - DWORD* pdwAxisType = NULL; - DWORD dwMouseAxes = 0, dwPOVs = 0, dwButtons = 0; - DWORD dwObj = 0; - int deviceType = code & 0xC000; - - if (deviceName) { - deviceName[0] = '\0'; - } - if (controlName) { - controlName[0] = '\0'; - } - - switch (deviceType) { - case 0x0000: { - int i = (code >> 8) & 0x3F; - - if (i >= keyboardCount) { // This keyboard isn't connected - return 0; - } - if (keyboardProperties[i].lpdid == NULL) { - return 1; - } - - if (deviceName) { - DIDEVICEINSTANCE didi; - - memset(&didi, 0, sizeof(didi)); - didi.dwSize = sizeof(didi); - - keyboardProperties[i].lpdid->GetDeviceInfo(&didi); - _snwprintf(deviceName, MAX_PATH, L"System keyboard: %s", didi.tszInstanceName); - } - if (controlName) { - DIDEVICEOBJECTINSTANCE didoi; - - memset(&didoi, 0, sizeof(didoi)); - didoi.dwSize = sizeof(didoi); - - if (SUCCEEDED(keyboardProperties[i].lpdid->GetObjectInfo(&didoi, DIDFT_MAKEINSTANCE(code & 0xFF) | DIDFT_PSHBUTTON, DIPH_BYID))) { - wcsncpy(controlName, didoi.tszName, MAX_PATH); - } - } - - return 0; - } - case 0x4000: { - int i = (code >> 8) & 0x3F; - - if (i >= gamepadCount) { // This gamepad isn't connected - return 0; - } - lpdid = gamepadProperties[i].lpdid; - pdwAxisType = gamepadProperties[i].dwAxisType; - dwPOVs = gamepadProperties[i].dwPOVs; - dwButtons = gamepadProperties[i].dwButtons; - break; - } - case 0x8000: { - int i = (code >> 8) & 0x3F; - - if (i >= mouseCount) { // This mouse isn't connected - return 0; - } - lpdid = mouseProperties[i].lpdid; - pdwAxisType = mouseProperties[i].dwAxisType; - dwMouseAxes = mouseProperties[i].dwAxes; - dwButtons = mouseProperties[i].dwButtons; - break; - } - } - - if (lpdid == NULL) { - return 1; - } - - if (deviceName) { - DIDEVICEINSTANCE didi; - - memset(&didi, 0, sizeof(didi)); - didi.dwSize = sizeof(didi); - - if (SUCCEEDED(lpdid->GetDeviceInfo(&didi))) { - - // Special treatment for the system mouse - if ((code & 0xFF00) == 0x8000) { - _snwprintf(deviceName, MAX_PATH, L"System mouse: %s", didi.tszInstanceName); - } else { - wcsncpy(deviceName, didi.tszInstanceName, MAX_PATH); - } - } - } - if (controlName) { - DIDEVICEOBJECTINSTANCE didoi; - - unsigned int subCode = code & 0xFF; - - if ((subCode >> 1) < ((deviceType == 0x4000) ? MAX_JOYAXIS : MAX_MOUSEAXIS)) { - if (pdwAxisType[subCode >> 1] & DIDFT_AXIS) { - dwObj = pdwAxisType[subCode >> 1]; - } - } - if (subCode >= 0x10 && subCode < 0x10 + (dwPOVs << 2)) { - dwObj = DIDFT_POV | DIDFT_MAKEINSTANCE((subCode & 0x0F) >> 2); - } - if (subCode >= 0x80 && subCode < 0x80 + dwButtons) { - dwObj = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE((subCode & 0x7F) + dwMouseAxes); - } - - memset(&didoi, 0, sizeof(didoi)); - didoi.dwSize = sizeof(didoi); - - if (SUCCEEDED(lpdid->GetObjectInfo(&didoi, dwObj, DIPH_BYID))) { - wcsncpy(controlName, didoi.tszName, MAX_PATH); - } - } - - return 0; - } - - int get(void* info) - { - InterfaceInfo* pInfo = (InterfaceInfo*)info; - if (!pInfo) { - return 1; - } - - return 0; - } - -/* InputDI() { - keyboardCount = 0; - gamepadCount = 0; - mouseCount = 0; - - pDI = NULL; - hDinpWnd = NULL; - - memset(&keyboardProperties, 0, sizeof(keyboardProperties)); - memset(&gamepadProperties, 0, sizeof(gamepadProperties)); - memset(&mouseProperties, 0, sizeof(mouseProperties)); - } - - ~InputDI() { - exit(); - } -};*/ - -// Callback that evaluates and sets up each gamepad axis -static BOOL CALLBACK gamepadEnumAxesCallback(LPCDIDEVICEOBJECTINSTANCE instance, LPVOID /*p*/) -{ -// return ((InputDI*)p)->gamepadEnumObject(instance); - return gamepadEnumObject(instance); -} - -// Callback that evaluates and sets up each mouse axis -static BOOL CALLBACK mouseEnumAxesCallback(LPCDIDEVICEOBJECTINSTANCE instance, LPVOID /*p*/) -{ -// return ((InputDI*)p)->mouseEnumObject(instance); - return mouseEnumObject(instance); -} - -// Callback that evaluates each gamepad DirectInput device -static BOOL CALLBACK gamepadEnumCallback(LPCDIDEVICEINSTANCE instance, LPVOID /*p*/) -{ -// return ((InputDI*)p)->gamepadEnumDevice(instance); - return gamepadEnumDevice(instance); -} - -// Callback that evaluates each mouse DirectInput device -static BOOL CALLBACK mouseEnumCallback(LPCDIDEVICEINSTANCE instance, LPVOID /*p*/) -{ -// return ((InputDI*)p)->mouseEnumDevice(instance); - return mouseEnumDevice(instance); -} - -struct InputInOut InputInOutDInput = { init, exit, setCooperativeLevel, newFrame, getState, readGamepadAxis, readMouseAxis, find, getControlName, NULL, _T("DirectInput8 input") }; diff --git a/jan/src/intf/interface.cpp b/jan/src/intf/interface.cpp deleted file mode 100644 index eab71d3d6..000000000 --- a/jan/src/intf/interface.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "burner.h" - -#define INT_INFO_STRINGS (8) - -INT32 IntInfoFree(InterfaceInfo* pInfo) -{ - if (pInfo->ppszInterfaceSettings) { - for (INT32 i = 0; i < INT_INFO_STRINGS; i++) { - if (pInfo->ppszInterfaceSettings[i]) { - free(pInfo->ppszInterfaceSettings[i]); - pInfo->ppszInterfaceSettings[i] = NULL; - } - } - } - if (pInfo->ppszInterfaceSettings) { - free(pInfo->ppszInterfaceSettings); - pInfo->ppszInterfaceSettings = NULL; - } - - if (pInfo->ppszModuleSettings) { - for (INT32 i = 0; i < INT_INFO_STRINGS; i++) { - if (pInfo->ppszModuleSettings[i]) { - free(pInfo->ppszModuleSettings[i]); - pInfo->ppszModuleSettings[i] = NULL; - } - } - } - if (pInfo->ppszModuleSettings) { - free(pInfo->ppszModuleSettings); - pInfo->ppszModuleSettings = NULL; - } - - memset(pInfo, 0, sizeof(InterfaceInfo)); - - return 0; -} - -INT32 IntInfoInit(InterfaceInfo* pInfo) -{ - IntInfoFree(pInfo); - - pInfo->ppszInterfaceSettings = (TCHAR**)malloc((INT_INFO_STRINGS + 1) * sizeof(TCHAR*)); - if (pInfo->ppszInterfaceSettings == NULL) { - return 1; - } - memset(pInfo->ppszInterfaceSettings, 0, (INT_INFO_STRINGS + 1) * sizeof(TCHAR*)); - - pInfo->ppszModuleSettings = (TCHAR**)malloc((INT_INFO_STRINGS + 1) * sizeof(TCHAR*)); - if (pInfo->ppszModuleSettings == NULL) { - return 1; - } - memset(pInfo->ppszModuleSettings, 0, (INT_INFO_STRINGS + 1) * sizeof(TCHAR*)); - - return 0; -} - -INT32 IntInfoAddStringInterface(InterfaceInfo* pInfo, TCHAR* szString) -{ - INT32 i; - - for (i = 0; pInfo->ppszInterfaceSettings[i] && i < INT_INFO_STRINGS; i++) { } - - if (i >= INT_INFO_STRINGS) { - return 1; - } - - pInfo->ppszInterfaceSettings[i] = (TCHAR*)malloc(MAX_PATH * sizeof(TCHAR)); - if (pInfo->ppszInterfaceSettings[i] == NULL) { - return 1; - } - - _tcsncpy(pInfo->ppszInterfaceSettings[i], szString, MAX_PATH); - - return 0; -} - -INT32 IntInfoAddStringModule(InterfaceInfo* pInfo, TCHAR* szString) -{ - INT32 i; - - for (i = 0; pInfo->ppszModuleSettings[i] && i < INT_INFO_STRINGS; i++) { } - - if (i >= INT_INFO_STRINGS) { - return 1; - } - - pInfo->ppszModuleSettings[i] = (TCHAR*)malloc(MAX_PATH * sizeof(TCHAR)); - if (pInfo->ppszModuleSettings[i] == NULL) { - return 1; - } - - _tcsncpy(pInfo->ppszModuleSettings[i], szString, MAX_PATH); - - return 0; -} - diff --git a/jan/src/intf/interface.h b/jan/src/intf/interface.h deleted file mode 100644 index 784b01d65..000000000 --- a/jan/src/intf/interface.h +++ /dev/null @@ -1,254 +0,0 @@ -#pragma once -#ifdef FBA_DEBUG - #define PRINT_DEBUG_INFO -#endif -#include - -// GameInp structure -#include "gameinp.h" -// Key codes -#include "inp_keys.h" - -// Interface info (used for all modules) -struct InterfaceInfo { - const TCHAR* pszModuleName; - TCHAR** ppszInterfaceSettings; - TCHAR** ppszModuleSettings; -}; - -INT32 IntInfoFree(InterfaceInfo* pInfo); -INT32 IntInfoInit(InterfaceInfo* pInfo); -INT32 IntInfoAddStringInterface(InterfaceInfo* pInfo, TCHAR* szString); -INT32 IntInfoAddStringModule(InterfaceInfo* pInfo, TCHAR* szString); - -// Input plugin: -struct InputInOut { - INT32 (*Init)(); - INT32 (*Exit)(); - INT32 (*SetCooperativeLevel)(bool bExclusive, bool bForeground); - // Setup new frame - INT32 (*NewFrame)(); - // Read digital - INT32 (*ReadSwitch)(INT32 nCode); - // Read analog - INT32 (*ReadJoyAxis)(INT32 i, INT32 nAxis); - INT32 (*ReadMouseAxis)(INT32 i, INT32 nAxis); - // Find out which control is activated - INT32 (*Find)(bool CreateBaseline); - // Get the name of a control - INT32 (*GetControlName)(INT32 nCode, TCHAR* pszDeviceName, TCHAR* pszControlName); - // Get plugin info - INT32 (*GetPluginSettings)(InterfaceInfo* pInfo); - const TCHAR* szModuleName; -}; - -INT32 InputInit(); -INT32 InputExit(); -INT32 InputSetCooperativeLevel(const bool bExclusive, const bool bForeGround); -INT32 InputMake(bool bCopy); -INT32 InputFind(const INT32 nFlags); -INT32 InputGetControlName(INT32 nCode, TCHAR* pszDeviceName, TCHAR* pszControlName); -InterfaceInfo* InputGetInfo(); -std::vector InputGetInterfaces(); - -extern bool bInputOkay; -extern UINT32 nInputSelect; - -// CD emulation module - -struct CDEmuDo { - INT32 (*CDEmuExit)(); - INT32 (*CDEmuInit)(); - INT32 (*CDEmuStop)(); - INT32 (*CDEmuPlay)(UINT8 M, UINT8 S, UINT8 F); - INT32 (*CDEmuLoadSector)(INT32 LBA, char* pBuffer); - UINT8* (*CDEmuReadTOC)(INT32 track); - UINT8* (*CDEmuReadQChannel)(); - INT32 (*CDEmuGetSoundBuffer)(INT16* buffer, INT32 samples); - // Get plugin info - INT32 (*GetPluginSettings)(InterfaceInfo* pInfo); - const TCHAR* szModuleName; -}; - -#include "cd_interface.h" - -InterfaceInfo* CDEmuGetInfo(); - -extern bool bCDEmuOkay; -extern UINT32 nCDEmuSelect; - -extern CDEmuStatusValue CDEmuStatus; - -// Profiling plugin -struct ProfileDo { - INT32 (*ProfileExit)(); - INT32 (*ProfileInit)(); - INT32 (*ProfileStart)(INT32 nSubSystem); - INT32 (*ProfileEnd)(INT32 nSubSystem); - double (*ProfileReadLast)(INT32 nSubSystem); - double (*ProfileReadAverage)(INT32 nSubSystem); - // Get plugin info - INT32 (*GetPluginSettings)(InterfaceInfo* pInfo); - const TCHAR* szModuleName; -}; - -extern bool bProfileOkay; -extern UINT32 nProfileSelect; - -INT32 ProfileInit(); -INT32 ProfileExit(); -INT32 ProfileProfileStart(INT32 nSubSystem); -INT32 ProfileProfileEnd(INT32 nSubSustem); -double ProfileProfileReadLast(INT32 nSubSustem); -double ProfileProfileReadAverage(INT32 nSubSustem); -InterfaceInfo* ProfileGetInfo(); - -// Audio Output plugin -struct AudOut { - INT32 (*BlankSound)(); - INT32 (*SoundCheck)(); - INT32 (*SoundInit)(); - INT32 (*SetCallback)(INT32 (*pCallback)(INT32)); - INT32 (*SoundPlay)(); - INT32 (*SoundStop)(); - INT32 (*SoundExit)(); - INT32 (*SoundSetVolume)(); - // Get plugin info - INT32 (*GetPluginSettings)(InterfaceInfo* pInfo); - const TCHAR* szModuleName; -}; - -INT32 AudSelect(UINT32 nPlugIn); -INT32 AudSoundInit(); -INT32 AudSoundExit(); -INT32 AudSetCallback(INT32 (*pCallback)(INT32)); -INT32 AudSoundPlay(); -INT32 AudSoundStop(); -INT32 AudBlankSound(); -INT32 AudSoundCheck(); -INT32 AudSoundSetVolume(); -InterfaceInfo* AudGetInfo(); -void AudWriteSilence(); - -extern INT32 nAudSampleRate[8]; // sample rate -extern INT32 nAudVolume; // Sound volume (% * 100) -extern INT32 nAudSegCount; // Segs in the pdsbLoop buffer -extern INT32 nAudSegLen; // Seg length in samples (calculated from Rate/Fps) -extern INT32 nAudAllocSegLen; -extern INT16 *nAudNextSound; // The next sound seg we will add to the sample loop -extern UINT8 bAudOkay; // True if DSound was initted okay -extern UINT8 bAudPlaying; // True if the Loop buffer is playing -extern INT32 nAudDSPModule[8]; // DSP module to use: 0 = none, 1 = low-pass filter -extern UINT32 nAudSelect; - -// Video Output plugin: -struct VidOut { - INT32 (*Init)(); - INT32 (*Exit)(); - INT32 (*Frame)(bool bRedraw); - INT32 (*Paint)(INT32 bValidate); - INT32 (*ImageSize)(RECT* pRect, INT32 nGameWidth, INT32 nGameHeight); - // Get plugin info - INT32 (*GetPluginSettings)(InterfaceInfo* pInfo); - const TCHAR* szModuleName; -}; - -INT32 VidSelect(UINT32 nPlugin); -INT32 VidInit(); -INT32 VidExit(); -INT32 VidReInitialise(); -INT32 VidFrame(); -INT32 VidRedraw(); -INT32 VidRecalcPal(); -INT32 VidPaint(INT32 bValidate); -INT32 VidImageSize(RECT* pRect, INT32 nGameWidth, INT32 nGameHeight); -const TCHAR* VidGetModuleName(); -InterfaceInfo* VidGetInfo(); - -#ifdef BUILD_WIN32 - extern HWND hVidWnd; -#endif - -#if defined (_XBOX) - extern HWND hVidWnd; -#endif - -extern bool bVidOkay; -extern UINT32 nVidSelect; -extern INT32 nVidWidth, nVidHeight, nVidDepth, nVidRefresh; - -extern INT32 nVidHorWidth, nVidHorHeight; -extern INT32 nVidVerWidth, nVidVerHeight; - -extern INT32 nVidFullscreen; -extern INT32 bVidBilinear; -extern INT32 bVidScanlines; -extern INT32 bVidScanRotate; -extern INT32 bVidScanBilinear; -extern INT32 nVidScanIntensity; -extern INT32 bVidScanHalf; -extern INT32 bVidScanDelay; -extern INT32 nVidFeedbackIntensity; -extern INT32 nVidFeedbackOverSaturation; -extern INT32 bVidCorrectAspect; -extern INT32 bVidArcaderes; - -extern INT32 bVidArcaderesHor; -extern INT32 bVidArcaderesVer; - -extern INT32 nVidRotationAdjust; -extern INT32 bVidUseHardwareGamma; -extern INT32 bVidAutoSwitchFull; -extern INT32 bVidForce16bit; -extern INT32 bVidForce16bitDx9Alt; -extern INT32 bVidForceFlip; -extern INT32 nVidTransferMethod; -extern float fVidScreenAngle; -extern float fVidScreenCurvature; -extern INT64 nVidBlitterOpt[]; -extern INT32 bVidFullStretch; -extern INT32 bVidTripleBuffer; -extern INT32 bVidVSync; -extern double dVidCubicB; -extern double dVidCubicC; -extern INT32 bVidDX9Bilinear; -extern INT32 bVidHardwareVertex; -extern INT32 bVidMotionBlur; -extern wchar_t HorScreen[32]; -extern wchar_t VerScreen[32]; -extern INT32 nVidScrnWidth, nVidScrnHeight; -extern INT32 nVidScrnDepth; - -extern INT32 nVidScrnAspectX, nVidScrnAspectY; - -extern UINT8* pVidImage; -extern INT32 nVidImageWidth, nVidImageHeight; -extern INT32 nVidImageLeft, nVidImageTop; -extern INT32 nVidImagePitch, nVidImageBPP; -extern INT32 nVidImageDepth; - -extern "C" UINT32 (__cdecl *VidHighCol) (INT32 r, INT32 g, INT32 b, INT32 i); - -// vid_directx_support.cpp - -INT32 VidSNewTinyMsg(const TCHAR* pText, INT32 nRGB = 0, INT32 nDuration = 0, INT32 nPriority = 5); -INT32 VidSNewJoystickMsg(const TCHAR* pText, INT32 nRGB = 0, INT32 nDuration = 0, INT32 nLineNo = 0); -INT32 VidSNewShortMsg(const TCHAR* pText, INT32 nRGB = 0, INT32 nDuration = 0, INT32 nPriority = 5); -void VidSKillShortMsg(); -void VidSKillTinyMsg(); - -INT32 VidSAddChatMsg(const TCHAR* pID, INT32 nIDRGB, const TCHAR* pMain, INT32 nMainRGB); - -#define MAX_CHAT_SIZE (128) - -extern INT32 nVidSDisplayStatus; -extern INT32 nMaxChatFontSize; -extern INT32 nMinChatFontSize; -extern bool bEditActive; -extern bool bEditTextChanged; -extern TCHAR EditText[MAX_CHAT_SIZE + 1]; - -// osd text display for dx9 -extern TCHAR OSDMsg[MAX_PATH]; -extern UINT32 nOSDTimer; -void VidSKillOSDMsg(); diff --git a/jan/src/intf/perfcount/prf_interface.cpp b/jan/src/intf/perfcount/prf_interface.cpp deleted file mode 100644 index 83d9397b4..000000000 --- a/jan/src/intf/perfcount/prf_interface.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// Profiling support -#include "burner.h" - -bool bProfileOkay = false; -UINT32 nProfileSelect = 0; - -static InterfaceInfo ProfileInfo = { NULL, NULL, NULL }; - -#if defined (BUILD_WIN32) - extern struct ProfileDo cntDoPerfCount; -#elif defined (BUILD_SDL) - extern struct ProfileDo cntDoPerfCount; -#elif defined (_XBOX) - extern struct ProfileDo cntDoPerfCount; -#endif - -static struct ProfileDo* pProfileDo[] = -{ -#if defined (BUILD_WIN32) - &cntDoPerfCount, -#elif defined (BUILD_SDL) - &cntDoPerfCount, -#elif defined (_XBOX) - &cntDoPerfCount, -#endif -}; - -#define PROFILE_LEN (sizeof(pProfileDo) / sizeof(pProfileDo[0])) - -INT32 ProfileExit() -{ - IntInfoFree(&ProfileInfo); - - if (!bProfileOkay || nProfileSelect >= PROFILE_LEN) { - return 1; - } - bProfileOkay = false; - - return pProfileDo[nProfileSelect]->ProfileExit(); -} - -INT32 ProfileInit() -{ - INT32 nRet; - - if (nProfileSelect >= PROFILE_LEN) { - return 1; - } - - if ((nRet = pProfileDo[nProfileSelect]->ProfileInit()) == 0) { - bProfileOkay = true; - } - - return nRet; -} - -INT32 ProfileProfileStart(INT32 nSubSystem) -{ - if (!bProfileOkay || nProfileSelect >= PROFILE_LEN) { - return 1; - } - - return pProfileDo[nProfileSelect]->ProfileStart(nSubSystem); -} - -INT32 ProfileProfileEnd(INT32 nSubSystem) -{ - if (!bProfileOkay || nProfileSelect >= PROFILE_LEN) { - return 1; - } - - return pProfileDo[nProfileSelect]->ProfileEnd(nSubSystem); -} - -double ProfileProfileReadLast(INT32 nSubSystem) -{ - if (!bProfileOkay || nProfileSelect >= PROFILE_LEN) { - return 0.0; - } - - return pProfileDo[nProfileSelect]->ProfileReadLast(nSubSystem); -} - -double ProfileProfileReadAverage(INT32 nSubSystem) -{ - if (!bProfileOkay || nProfileSelect >= PROFILE_LEN) { - return 0.0; - } - - return pProfileDo[nProfileSelect]->ProfileReadAverage(nSubSystem); -} - -InterfaceInfo* ProfileGetInfo() -{ - if (IntInfoInit(&ProfileInfo)) { - IntInfoFree(&ProfileInfo); - return NULL; - } - - if (bProfileOkay) { - - ProfileInfo.pszModuleName = pProfileDo[nProfileSelect]->szModuleName; - - if (pProfileDo[nProfileSelect]->GetPluginSettings) { - pProfileDo[nProfileSelect]->GetPluginSettings(&ProfileInfo); - } - } else { - IntInfoAddStringInterface(&ProfileInfo, _T("Profiling module not initialised")); - } - - return &ProfileInfo; -} diff --git a/jan/src/intf/perfcount/win32/prf_performance_counter.cpp b/jan/src/intf/perfcount/win32/prf_performance_counter.cpp deleted file mode 100644 index 04e657e6d..000000000 --- a/jan/src/intf/perfcount/win32/prf_performance_counter.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// Profiling support -#include "burner.h" - -static double dcntTimerFreq; - -static struct { LARGE_INTEGER start; LARGE_INTEGER count[256]; LARGE_INTEGER tally; int index; int max_count; } cntSubsysInfo[16]; - -int cntExit() -{ - return 0; -} - -int cntInit() -{ - LARGE_INTEGER f; - -// cntExit(); - - QueryPerformanceFrequency(&f); - - // Use milliseconds when reporting profile information - dcntTimerFreq = (double)f.QuadPart / 1000.0; - - for (int i = 0; i < 16; i++) { - for (int j = 0; j < 256; j++) { - cntSubsysInfo[i].count[j].QuadPart = 0; - } - cntSubsysInfo[i].start.QuadPart = 0; - cntSubsysInfo[i].tally.QuadPart = 0; - cntSubsysInfo[i].index = 0; - cntSubsysInfo[i].max_count = 32; - } - -#ifdef PRINT_DEBUG_INFO - dprintf(_T("*** PerformanceCounter profiler initialised (timer frequency is %.2lf MHz).\n"), (double)f.QuadPart / 1000000.0); -#endif - - return 0; -} - -int cntProfileStart(int nSubSystem) -{ - QueryPerformanceCounter(&cntSubsysInfo[nSubSystem].start); - - return 0; -} - -int cntProfileEnd(int nSubSystem) -{ - cntSubsysInfo[nSubSystem].index++; - if (cntSubsysInfo[nSubSystem].index >= cntSubsysInfo[nSubSystem].max_count) { - cntSubsysInfo[nSubSystem].index = 0; - } - - cntSubsysInfo[nSubSystem].tally.QuadPart -= cntSubsysInfo[nSubSystem].count[cntSubsysInfo[nSubSystem].index].QuadPart; - - QueryPerformanceCounter(&cntSubsysInfo[nSubSystem].count[cntSubsysInfo[nSubSystem].index]); - cntSubsysInfo[nSubSystem].count[cntSubsysInfo[nSubSystem].index].QuadPart -= cntSubsysInfo[nSubSystem].start.QuadPart; - - cntSubsysInfo[nSubSystem].tally.QuadPart += cntSubsysInfo[nSubSystem].count[cntSubsysInfo[nSubSystem].index].QuadPart; - - return 0; -} - -double cntProfileReadLast(int nSubSystem) -{ - return (double)cntSubsysInfo[nSubSystem].count[cntSubsysInfo[nSubSystem].index].QuadPart / dcntTimerFreq; -} - -double cntProfileReadAverage(int nSubSystem) -{ - return (double)(cntSubsysInfo[nSubSystem].tally.QuadPart / (cntSubsysInfo[nSubSystem].max_count)) / dcntTimerFreq; -} - -static int cntProfileGetSettings(InterfaceInfo* pInfo) -{ - TCHAR szString[MAX_PATH] = _T(""); - - LARGE_INTEGER f; - QueryPerformanceFrequency(&f); - - _sntprintf(szString, MAX_PATH, _T("timer frequency is %.2lfMHz\n"), (double)f.QuadPart / 1000000.0); - IntInfoAddStringModule(pInfo, szString); - - return 0; -} - -struct ProfileDo cntDoPerfCount = { cntExit, cntInit, cntProfileStart, cntProfileEnd, cntProfileReadLast, cntProfileReadAverage, cntProfileGetSettings, _T("PerformanceCounter profiler") }; diff --git a/jan/src/intf/video/opengl/shader.cpp b/jan/src/intf/video/opengl/shader.cpp deleted file mode 100644 index 9eb0283bd..000000000 --- a/jan/src/intf/video/opengl/shader.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include -#include "shader.h" - -void Shader::buildProgram(const string& vsrc, const string& fsrc) -{ - GLuint vs = glCreateShader(GL_VERTEX_SHADER); - GLuint fs = glCreateShader(GL_FRAGMENT_SHADER); - program = glCreateProgram(); - - bool vsLoaded = compileShader(vs, vsrc); - bool fsLoaded = compileShader(fs, fsrc); - - if (vsLoaded || fsLoaded) { - if (vsLoaded) - glAttachShader(program, vs); - if (fsLoaded) - glAttachShader(program, fs); - glLinkProgram(program); - - GLint result; - GLchar log[512]; - glGetProgramiv(program, GL_LINK_STATUS, &result); - - if (!result) { - glGetProgramInfoLog(program, sizeof(log), nullptr, log); - cerr << "Erro ao ligar o programa: " << log << endl; - } - } - - // Limpa o que não é mais necessário - glDeleteShader(vs); - glDeleteShader(fs); -} - -bool Shader::compileShader(GLuint shader, const string &source) -{ - if (source.empty()) { - cerr << "Shader erro: código fonte vazio!" << endl; - return false; - } - const char *ptr = source.c_str(); - glShaderSource(shader, 1, &ptr, nullptr); - glCompileShader(shader); - - GLint result; - GLchar log[512]; - glGetShaderiv(shader, GL_COMPILE_STATUS, &result); - - if (result) - return true; - - glGetShaderInfoLog(shader, sizeof(log), nullptr, log); - cerr << "Erro ao carregar o shader: " << log << endl; - - return false; -} - -Shader::Shader(const string &vertex, const string &fragment, bool isSource) -{ - if (isSource) { - buildProgram(vertex, fragment); - } else { - string vertexSrc; - string fragmentSrc; - try { - ifstream vsFile(vertex); - ifstream fsFile(fragment); - - stringstream vss, fss; - vss << vsFile.rdbuf(); - fss << fsFile.rdbuf(); - - vsFile.close(); - fsFile.close(); - - vertexSrc = vss.str(); - fragmentSrc = fss.str(); - } catch (exception e) { - cerr << "Falha ao carregar shader" << endl; - } - cout << "Shader carregado com sucesso!" << endl; - buildProgram(vertexSrc, fragmentSrc); - } -} - -Shader::~Shader() -{ - glDeleteProgram(program); -} - -void Shader::use() -{ - glUseProgram(program); -} - -void Shader::setUniform(const string &name, float v) -{ - GLuint loc = glGetUniformLocation(program, name.c_str()); - glUniform1f(loc, v); -} - -void Shader::setUniform(const string &name, GLint v) -{ - GLuint loc = glGetUniformLocation(program, name.c_str()); - glUniform1i(loc, v); -} diff --git a/jan/src/intf/video/opengl/shader.h b/jan/src/intf/video/opengl/shader.h deleted file mode 100644 index 406c4da94..000000000 --- a/jan/src/intf/video/opengl/shader.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include - -using namespace std; - -class Shader -{ - void buildProgram(const string &vsrc, const string &fsrc); - bool compileShader(GLuint shader, const string& source); -public: - GLuint program; - Shader(const string& vertex, const string& fragment, bool isSource=false); - ~Shader(); - void use(); - void setUniform(const string& name, float v); - void setUniform(const string& name, GLint v); -}; diff --git a/jan/src/intf/video/opengl/vid_opengl.cpp b/jan/src/intf/video/opengl/vid_opengl.cpp deleted file mode 100644 index 64c46ae61..000000000 --- a/jan/src/intf/video/opengl/vid_opengl.cpp +++ /dev/null @@ -1,212 +0,0 @@ -// OpenGL 3.3 Core Profile renderer -#include -#include -#include "burner.h" - -#include "shader.h" - -static int videoLenght = 0; -static int videoPitch = 0; -static int videoBpp = 0; -static int videoClipWidth = 0; -static int videoClipHeight = 0; -static int videoWidth = 0; -static int videoHeight = 0; -static unsigned char *videoMemory = nullptr; -static bool rotateVideo = false; - -static bool isGlewInitialized = false; -static GLuint vao, texture; - -static void (*oglSwapBuffers)(void*) = nullptr; -static void (*oglMakeCurrent)(void*) = nullptr; -static void (*oglDoneCurrent)(void*) = nullptr; -static void *oglContext = nullptr; -static Shader *stockShader = nullptr; - - -static const string defaultVertexShader = R"( - #version 330 core - - layout (location = 0) in vec2 position; - layout (location = 1) in vec2 uvCoord; - - out vec2 texCoord; - - void main() { - gl_Position = vec4(position, 0, 1.0f); - texCoord = uvCoord; - } -)"; - -static const string defaultFragmentShader = R"( - #version 330 core - - out vec4 color; - in vec2 texCoord; - - uniform sampler2D tex; - uniform float width; - uniform float height; - - void main() { - color = texture(tex, texCoord); - } -)"; - - -void OGLSetContext(void *ptr) -{ - oglContext = ptr; -} - -void OGLSetSwapBuffers(void (*f)(void*)) -{ - oglSwapBuffers = f; -} - -void OGLSetMakeCurrent(void (*f)(void*)) -{ - oglMakeCurrent = f; -} - -void OGLSetDoneCurrent(void (*f)(void*)) -{ - oglDoneCurrent = f; -} - -void OGLResize(int w, int h) -{ - glViewport(0, 0, w, h); -} - -static INT32 oglInit() -{ - if (!isGlewInitialized) { - glewExperimental = true; - glewInit(); - } - - stockShader = new Shader(defaultVertexShader, defaultFragmentShader, true); - - unsigned flags = BurnDrvGetFlags(); - - if (flags & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&videoClipHeight, &videoClipWidth); - BurnDrvGetFullSize(&videoWidth, &videoHeight); - rotateVideo = true; - } else { - BurnDrvGetVisibleSize(&videoClipWidth, &videoClipHeight); - BurnDrvGetFullSize(&videoWidth, &videoHeight); - rotateVideo = false; - } - - videoBpp = nBurnBpp = 2; - videoPitch = videoWidth * videoBpp; - videoLenght = videoHeight * videoPitch; - videoMemory = new unsigned char[videoLenght]; - SetBurnHighCol(16); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - - glGenVertexArrays(1, &vao); - glGenTextures(1, &texture); - - return 0; -} - -static INT32 oglExit() -{ - delete stockShader; - glDeleteTextures(1, &texture); - glDeleteVertexArrays(1, &vao); - delete [] videoMemory; - return 0; -} - -static INT32 oglFrame(bool bRedraw) -{ - nBurnBpp = 2; - - nBurnPitch = videoPitch; - pBurnDraw = videoMemory; - - if (bDrvOkay) { - pBurnSoundOut = nAudNextSound; - nBurnSoundLen = nAudSegLen; - BurnDrvFrame(); - } - - pBurnDraw = NULL; - nBurnPitch = 0; - return 0; -} - -static INT32 oglPaint(INT32 bValidate) -{ - if (oglMakeCurrent) - oglMakeCurrent(oglContext); - - glBindTexture(GL_TEXTURE_2D, texture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, videoWidth, videoHeight, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, videoMemory); - glGenerateMipmap(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, 0); - - const GLfloat vtx[] = { - // vtx uv - -1.0, 1.0, 0.0, 0.0, - -1.0, -1.0, 0.0, 1.0, - 1.0, 1.0, 1.0, 0.0, - 1.0, -1.0, 1.0, 1.0 - }; - glBindVertexArray(vao); - - GLuint vbo; - glGenBuffers(1, &vbo); - - glBindBuffer(GL_ARRAY_BUFFER, vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(vtx), vtx, GL_STATIC_DRAW); - - glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), 0); - glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), (void*) (2 * sizeof(GLfloat))); - - glEnableVertexAttribArray(0); - glEnableVertexAttribArray(1); - - stockShader->use(); - stockShader->setUniform("width", static_cast(videoWidth)); - stockShader->setUniform("height", static_cast(videoHeight)); - glBindTexture(GL_TEXTURE_2D, texture); - glBindVertexArray(vao); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - glBindVertexArray(0); - - glDeleteBuffers(1, &vbo); - glBindVertexArray(0); - - if (oglSwapBuffers) - oglSwapBuffers(oglContext); - - if (oglDoneCurrent) - oglDoneCurrent(oglContext); - return 0; -} - -static INT32 oglImageSize(RECT* pRect, INT32 nGameWidth, INT32 nGameHeight) -{ - return 0; -} - -// Get plugin info -static INT32 oglGetPluginSettings(InterfaceInfo* pInfo) -{ - return 0; -} - -struct VidOut VidOutOGL = { oglInit, oglExit, oglFrame, oglPaint, - oglImageSize, oglGetPluginSettings, - ("ogl-video") }; diff --git a/jan/src/intf/video/psp/vid_psp.c b/jan/src/intf/video/psp/vid_psp.c deleted file mode 100644 index 5bd0a1195..000000000 --- a/jan/src/intf/video/psp/vid_psp.c +++ /dev/null @@ -1,137 +0,0 @@ -#include "vid_psp.h" - -#define SLICE_SIZE 32 // change this to experiment with different page-cache sizes - -static unsigned int __attribute__((aligned(16))) list[262144]; - -unsigned short __attribute__((aligned(16))) g_BlitBuff[512*512*2]; - -unsigned short *g_pBlitBuff = NULL; - -struct Vertex -{ - unsigned short u, v; - unsigned short color; - short x, y, z; -}; - -void vidgu_init() -{ - - g_pBlitBuff = (unsigned short *)(0x40000000 | (unsigned int)&g_BlitBuff); - - sceGuInit(); - - // setup - sceGuStart(GU_DIRECT,list); - sceGuDrawBuffer(GU_PSM_5650,(void*)0,512); - sceGuDispBuffer(480,272,(void*)0x88000,512); - sceGuDepthBuffer((void*)0x110000,512); - sceGuOffset(2048 - (480/2),2048 - (272/2)); - sceGuViewport(2048,2048,480,272); - sceGuDepthRange(0xc350,0x2710); - sceGuScissor(0,0,480,272); - sceGuEnable(GU_SCISSOR_TEST); - sceGuFrontFace(GU_CW); - sceGuEnable(GU_TEXTURE_2D); - sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT); - sceGuFinish(); - sceGuSync(0,0); - - sceDisplayWaitVblankStart(); - sceGuDisplay(1); - -} - -void vidgu_exit() -{ - sceGuTerm(); -} - - - -void vidgu_render_nostretch(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh) -{ - int start, end; - - sceGuStart(GU_DIRECT,list); - sceGuTexMode(GU_PSM_5650,0,0,0); // 16-bit RGBA - sceGuTexImage(0,512,512,512,g_pBlitBuff); // setup texture as a 256x256 texture - //sceKernelDcacheWritebackAll(); - sceGuTexFunc(GU_TFX_REPLACE,GU_TCC_RGBA); // don't get influenced by any vertex colors - sceGuTexFilter(GU_NEAREST,GU_NEAREST); // point-filtered sampling - for (start = sx, end = sx+sw; start < end; start += SLICE_SIZE, dx += SLICE_SIZE) - { - struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(2 * sizeof(struct Vertex)); - int width = (start + SLICE_SIZE) < end ? SLICE_SIZE : end-start; - - vertices[0].u = start; vertices[0].v = sy; - vertices[0].color = 0; - vertices[0].x = dx; vertices[0].y = dy; vertices[0].z = 0; - - vertices[1].u = start + width; vertices[1].v = sy + sh; - vertices[1].color = 0; - vertices[1].x = dx + width; vertices[1].y = dy + sh; vertices[1].z = 0; - - sceGuDrawArray(GU_SPRITES,GU_TEXTURE_16BIT|GU_COLOR_5650|GU_VERTEX_16BIT|GU_TRANSFORM_2D,2,0,vertices); - } - sceGuFinish(); - sceGuSync(0,0); - sceDisplayWaitVblankStart(); - sceGuSwapBuffers(); - //sceGuSwapBuffers(); -} - - -void vidgu_render(int sx, int sy, int sw,int sh,int dx, int dy, int dw,int dh) -{ - unsigned int j,cx,cy; - struct Vertex* vertices; - - cx=(480-dw)/2; - cy=(272-dh)/2; - - sceGuStart(GU_DIRECT,list); - sceGuTexMode(GU_PSM_5650,0,0,0); // 16-bit RGBA - sceGuTexImage(0,512,512,512,g_pBlitBuff); // setup texture as a 256x256 texture - //sceKernelDcacheWritebackAll(); - sceGuTexFunc(GU_TFX_REPLACE,GU_TCC_RGBA); // don't get influenced by any vertex colors - sceGuTexFilter(GU_LINEAR,GU_LINEAR); // point-filtered sampling - - int start, end; - float ustart = (float)sx; - float ustep = (float)sw / (float)(dw / SLICE_SIZE); - - // blit maximizing the use of the texture-cache - - for (start = sx, end = sx+dw; start < end; start += SLICE_SIZE, dx += SLICE_SIZE) - { - struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(2 * sizeof(struct Vertex)); - int width = (start + SLICE_SIZE) < end ? SLICE_SIZE : end-start; - - vertices[0].u = ustart; - vertices[0].v = (float)sy; - vertices[0].color = 0; - vertices[0].x = dx; - vertices[0].y = dy; - vertices[0].z = 0; - - vertices[1].u = ustart + ustep; - vertices[1].v = (float)(sy + sh); - vertices[1].color = 0; - vertices[1].x = dx + width; - vertices[1].y = dy + dh; - vertices[1].z = 0; - - sceGuDrawArray(GU_SPRITES,GU_TEXTURE_16BIT|GU_COLOR_5650|GU_VERTEX_16BIT|GU_TRANSFORM_2D,2,0,vertices); - - ustart += ustep; - } - - - sceGuFinish(); - sceGuSync(0,0); - sceDisplayWaitVblankStart(); - sceGuSwapBuffers(); -} - diff --git a/jan/src/intf/video/psp/vid_psp.h b/jan/src/intf/video/psp/vid_psp.h deleted file mode 100644 index 72667ef57..000000000 --- a/jan/src/intf/video/psp/vid_psp.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef __VIDGU_H__ -#define __VIDGU_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -//extern unsigned short g_pBlitBuff[]; -extern unsigned short *g_pBlitBuff; - -void vidgu_init(); - -void vidgu_exit(); - -void vidgu_render_nostretch(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh); -void vidgu_render(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/jan/src/intf/video/psp/vid_pspfx.cpp b/jan/src/intf/video/psp/vid_pspfx.cpp deleted file mode 100644 index 454850994..000000000 --- a/jan/src/intf/video/psp/vid_pspfx.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// blitter effects via PSP GE -#include "burner.h" -#include "vid_support.h" -#include "vid_psp.h" - -static int clipx = 0; -static int clipy = 0; -static int sizex =0; -static int sizey =0; - -static int VidMemLen = 0; -static int VidMemPitch = 0; -static int VidBpp = 0; -static unsigned char* VidMem = NULL; - - -static int bRotateGame=0; -static int bFlipGame=0; - -static unsigned int HighCol16(int r, int g, int b, int /* i */) -{ - unsigned int t; - - t = (b << 8) & 0xf800; // rrrr r000 0000 0000 - t |= (g << 3) & 0x07e0; // 0000 0ggg ggg0 0000 - t |= (r >> 3) & 0x001f; // 0000 0000 000b bbbb - return t; -} - - -static int Exit() -{ - free(VidMem); - return 0; -} - -static int Init() -{ - bRotateGame = (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL); - bFlipGame = BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED; - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - BurnDrvGetVisibleSize(&clipy, &clipx); - BurnDrvGetFullSize(&sizex, &sizey); - } else { - BurnDrvGetVisibleSize(&clipx, &clipy); - BurnDrvGetFullSize(&sizex, &sizey); - } - VidBpp = nBurnBpp = 2; - VidMemPitch = sizex * VidBpp; - VidMemLen = sizey * VidMemPitch; - VidMem = (unsigned char*)malloc(VidMemLen); - SetBurnHighCol(16); - bVidScanlines = 0; // !!! - nVidFullscreen=0; - vidgu_init(); - return 0; -} - -static int vidScale(RECT* , int, int) -{ - return 0; -} - -// Run one frame and render the screen -static int Frame(bool bRedraw) // bRedraw = 0 -{ - nBurnBpp=2; - - nBurnPitch=VidMemPitch; - pBurnDraw=VidMem; - - if (bDrvOkay) { - BurnDrvFrame(); // Run one frame and draw the screen - } - - unsigned char* ps = VidMem; - unsigned char* pd = (unsigned char*)g_pBlitBuff; - int p = 512*2; - int s = sizex * nBurnBpp; - - for (int y = 0; y < sizey; y++, pd += p, ps += nBurnPitch) - { - memcpy(pd, ps, s); - } - - pBurnDraw = NULL; - nBurnPitch = 0; - return 0; -} - -// Paint the BlitFX surface onto the primary surface -static int Paint(int bValidate) -{ - vidgu_render(0,0,sizex,sizey,0,0,480,272); - return 0; -} - -static int GetSettings(InterfaceInfo* pInfo) -{ - return 0; -} - -// The Video Output plugin: -struct VidOut VidOutPSPFX = { Init, Exit, Frame, Paint, vidScale, GetSettings, _T("PSP video output") }; diff --git a/jan/src/intf/video/scalers/2xpm.cpp b/jan/src/intf/video/scalers/2xpm.cpp deleted file mode 100644 index 50a1d1953..000000000 --- a/jan/src/intf/video/scalers/2xpm.cpp +++ /dev/null @@ -1,548 +0,0 @@ -//--------------------------------------------------------------------------------------------------------------------------- -// 2xPM_LQ plugin for Kega Fusion - Pablo Medina (aka "pm") (pjmedina3@yahoo.com) -// Check for updated versions at: http://2xpm.freeservers.com -//--------------------------------------------------------------------------------------------------------------------------- - -//#include "2xpm_lq.h" - -//--------------------------------------------------------------------------------------------------------------------------- - -#define ENHANCE_COLORS 0 -#define LQ_ALPHA_BLEND 0 -#define SHOW_CHANGES 0 - -unsigned short int pg_red_mask; -unsigned short int pg_green_mask; -unsigned short int pg_blue_mask; -unsigned short int pg_lbmask; - -#define RED_MASK565 0xF800 -#define GREEN_MASK565 0x07E0 -#define BLUE_MASK565 0x001F - -#define RED_MASK555 0x7C00 -#define GREEN_MASK555 0x03E0 -#define BLUE_MASK555 0x001F - -#define PG_LBMASK565 0xF7DE -#define PG_LBMASK555 0x7BDE - -#if LQ_ALPHA_BLEND -#define ALPHA_BLEND_128_W(dst, src) dst = (src + dst) >> 1 -#else -#define ALPHA_BLEND_128_W(dst, src) dst = ((src & pg_lbmask) >> 1) + ((dst & pg_lbmask) >> 1) -#endif - -//--------------------------------------------------------------------------------------------------------------------------- - -static void _2xpm_lq_1516(void *SrcPtr, void *DstPtr, unsigned long SrcPitch, unsigned long DstPitch, unsigned long SrcW, unsigned long SrcH) -{ - unsigned long x, y; - unsigned char *src, *dest; - unsigned short int PA, PB, PC, PD, PE, PF, PG, PH, PI; - register unsigned short int *start_addr1, *start_addr2, *start_addr3; - unsigned long next_line, next_line_src; - unsigned short int *dst_pixel; - unsigned long src_width, src_height; - unsigned long complete_line_src, complete_line_dst; - unsigned char auto_blend; - unsigned short int E[4]; - unsigned long src_pitch; - unsigned char pprev; - unsigned char dont_reblit; - - src = (unsigned char *)SrcPtr; - dest = (unsigned char *)DstPtr; - src_pitch = SrcPitch; - - next_line_src = src_pitch >> 1; - next_line = DstPitch >> 1; - - src_width = SrcW; - src_height = SrcH; - complete_line_src = next_line_src - SrcW; - complete_line_dst = DstPitch - SrcW * 2; - - start_addr2 = (unsigned short int *)(src - 2); - start_addr1 = start_addr2; - start_addr3 = start_addr2 + src_pitch; - - dst_pixel = (unsigned short int *)(dest); - - y = src_height - 1; - //for (y = 0; y < src_height; y++) - do - { - //if (y == src_height - 1) - if (!y) - start_addr3 = start_addr2; - auto_blend = 0; - pprev = 1; - x = src_width - 1; - - //for (x = 0; x < src_width; x++) - do - { - PB = start_addr1[1]; - PE = start_addr2[1]; - PH = start_addr3[1]; - - PA = start_addr1[pprev]; - PD = start_addr2[pprev]; - PG = start_addr3[pprev]; - - //if (x < src_width - 1) - if (x) - { - PC = start_addr1[2]; - PF = start_addr2[2]; - PI = start_addr3[2]; - } else { - PC = PB; - PF = PE; - PI = PH; - } - -#if SHOW_CHANGES - unsigned short int PDE = PE; - PE = 0; -#endif - E[0] = E[1] = E[2] = E[3] = PE; - - dont_reblit = 0; - - // Horizontal - if (!dont_reblit) - if (PD != PF) - { - if ((PE != PD) && (PD == PH) && (PD == PI) && (PE != PG) - && ((PD != PG) || (PE != PF) || (PA != PD)) - && (!((PD == PA) && (PD == PG) && (PE == PB) && (PE == PF))) - ) - { - E[2] = PH; - ALPHA_BLEND_128_W(E[3], PH); - dont_reblit = 1; - } - - else if ((PE != PF) && (PF == PH) && (PF == PG) && (PE != PI) - && ((PF != PI) || (PE != PD) || (PC != PF)) - && (!((PF == PC) && (PF == PI) && (PE == PB) && (PE == PD))) - ) - { - ALPHA_BLEND_128_W(E[2], PH); - E[3] = PH; - dont_reblit = 1; - } - } - - if (!dont_reblit) - { - if ((PB != PH) && (PD != PF)) - { - if ((PB == PD) && (PE != PD) - && (!((PE == PF) && (((PE == PA) && (PB == PC)) - || ((PD == PA) && (PD == PC) && (PG != PD) && (PG != PE))))) - && (!((PB == PA) && (PB == PG)))) - ALPHA_BLEND_128_W(E[0], PB); - - else if ((PB == PF) && (PE != PF) - && (!((PE == PD) && (((PE == PC) && (PB == PA)) - || ((PF == PA) && (PF == PC) && (PE == PD) && (PI != PF) && (PI != PE))))) - && (!((PB == PC) && (PB == PI))) - ) - ALPHA_BLEND_128_W(E[1], PB); - - if ((PH == PD) && ((PE != PG) || (PE != PD) || ((PE != PF) && (PF == PI))) - && (!((PE == PF) && (((PE == PG) && (PH == PI)) - || ((PD == PG) && (PD == PI) && (PE == PF) && (PA != PD) && (PA != PE)) - || ((PE == PG) && (PH == PI))))) - && (!((PH == PG) && (PH == PA))) - ) - ALPHA_BLEND_128_W(E[2], PH); - - else if ((PH == PF) && ((PE != PI) || (PE != PF)) - && (!((PE == PD) && (((PE == PI) && (PH == PG)) - || ((PF == PG) && (PF == PI) && (PC != PF) && (PI != PE))))) - && (!((PH == PI) && (PH == PC))) - ) - ALPHA_BLEND_128_W(E[3], PH); - } else -#if SHOW_CHANGES - PE = PDE; -#endif - if ((PD == PB) && (PD == PF) && (PD == PH) && (PD != PE)) - { - if ((PD == PG) || (PD == PC)) - { - ALPHA_BLEND_128_W(E[1], PD); - E[2] = E[1]; - } - if ((PD == PA) || (PD == PI)) - { - ALPHA_BLEND_128_W(E[0], PD); - E[3] = E[0]; - } - } - } - - dst_pixel[0] = E[0]; - dst_pixel[1] = E[1]; - dst_pixel[next_line] = E[2]; - dst_pixel[next_line + 1] = E[3]; - - start_addr1++; - start_addr2++; - start_addr3++; - - dst_pixel += 2; - pprev = 0; - } while (x--); - - start_addr2 += complete_line_src; - start_addr1 = start_addr2 - next_line_src; - start_addr3 = start_addr2 + next_line_src; - dst_pixel += complete_line_dst; - } while(y--); -} - -//--------------------------------------------------------------------------------------------------------------------------- - -void _2xpm_lq(void *SrcPtr, void *DstPtr, unsigned long SrcPitch, unsigned long DstPitch, unsigned long SrcW, unsigned long SrcH, int nDepth) -{ - if (nDepth == 15) { - pg_red_mask = RED_MASK555; - pg_green_mask = GREEN_MASK555; - pg_blue_mask = BLUE_MASK555; - pg_lbmask = PG_LBMASK555; - } - else if (nDepth == 16) { - pg_red_mask = RED_MASK565; - pg_green_mask = GREEN_MASK565; - pg_blue_mask = BLUE_MASK565; - pg_lbmask = PG_LBMASK565; - } - else { - return; - } - - _2xpm_lq_1516(SrcPtr, DstPtr, SrcPitch, DstPitch, SrcW, SrcH); -} - -//--------------------------------------------------------------------------------------------------------------------------- - -//--------------------------------------------------------------------------------------------------------------------------- -// 2xPM plugin for Kega Fusion - Pablo Medina (aka "pm") (pjmedina3@yahoo.com) -// Check for updated versions at: http://2xpm.freeservers.com -//--------------------------------------------------------------------------------------------------------------------------- - -//#include "2xpm_hq.h" - -#define LQ_ALPHA_BLEND 0 -#define SHOW_CHANGES 0 - -#if LQ_ALPHA_BLEND -#define ALPHA_BLEND_128_W(dst, src) dst = ((src & pg_lbmask) >> 1) + ((dst & pg_lbmask) >> 1) -#define ALPHA_BLEND_64_W(dst, src) dst = src -#define ALPHA_BLEND_192_W(dst, src) dst = src -#else -#define ALPHA_BLEND_128_W(dst, src) dst = ((src & pg_lbmask) >> 1) + ((dst & pg_lbmask) >> 1) - -/* Weird */ -#define ALPHA_BLEND_64_W(dst, src) \ - dst = ( \ - (pg_red_mask & ((dst & pg_red_mask) + \ - ((((src & pg_red_mask) - \ - (dst & pg_red_mask))) >>2))) | \ - (pg_green_mask & ((dst & pg_green_mask) + \ - ((((src & pg_green_mask) - \ - (dst & pg_green_mask))) >>2))) | \ - (pg_blue_mask & ((dst & pg_blue_mask) + \ - ((((src & pg_blue_mask) - \ - (dst & pg_blue_mask))) >>2))) ) - -#define ALPHA_BLEND_192_W(dst, src) \ - dst = ( \ - (pg_red_mask & ((dst & pg_red_mask) + \ - ((((src & pg_red_mask) - \ - (dst & pg_red_mask)) * 192) >>8))) | \ - (pg_green_mask & ((dst & pg_green_mask) + \ - ((((src & pg_green_mask) - \ - (dst & pg_green_mask)) * 192) >>8))) | \ - (pg_blue_mask & ((dst & pg_blue_mask) + \ - ((((src & pg_blue_mask) - \ - (dst & pg_blue_mask)) * 192) >>8))) ); -#endif - -#define ALPHA_BLEND_W(dst, src, alpha) \ -dst = ( \ - (pg_red_mask & ((dst & pg_red_mask) + \ - ((((src & pg_red_mask) - \ - (dst & pg_red_mask)) * alpha) >>8))) | \ - (pg_green_mask & ((dst & pg_green_mask) + \ - ((((src & pg_green_mask) - \ - (dst & pg_green_mask)) * alpha) >>8))) | \ - (pg_blue_mask & ((dst & pg_blue_mask) + \ - ((((src & pg_blue_mask) - \ - (dst & pg_blue_mask)) * alpha) >>8))) ); \ - - //#define ALPHA_BLEND_128_W(dst, src) dst = src - -//--------------------------------------------------------------------------------------------------------------------------- - -static void _2xpm_hq_1516(void *SrcPtr, void *DstPtr, unsigned long SrcPitch, unsigned long DstPitch, unsigned long SrcW, unsigned long SrcH) -{ - unsigned long x, y; - unsigned char *src, *dest; - unsigned short int PA, PB, PC, PD, PE, PF, PG, PH, PI; - register unsigned short int *start_addr1, *start_addr2, *start_addr3; - unsigned long next_line, next_line_src; - unsigned short int *dst_pixel; - unsigned long src_width, src_height; - unsigned long complete_line_src, complete_line_dst; - unsigned char auto_blend; - unsigned short int E[4]; - unsigned long src_pitch; - unsigned char pprev; - unsigned char dont_reblit; - - src = (unsigned char *)SrcPtr; - dest = (unsigned char *)DstPtr; - src_pitch = SrcPitch; - - next_line_src = src_pitch >> 1; - next_line = DstPitch >> 1; - - src_width = SrcW; - src_height = SrcH; - complete_line_src = next_line_src - SrcW; - complete_line_dst = DstPitch - SrcW * 2; - - start_addr2 = (unsigned short int *)(src - 2); - start_addr1 = start_addr2; - start_addr3 = start_addr2 + src_pitch; - - dst_pixel = (unsigned short int *)(dest); - - y = src_height; - //for (y = 0; y < src_height; y++) - while(y--) - { - //if (y == src_height - 1) - if (!y) - start_addr3 = start_addr2; - auto_blend = 0; - pprev = 1; - x = src_width; - - //for (x = 0; x < src_width; x++) - while(x--) - { - PB = start_addr1[1]; - PE = start_addr2[1]; - PH = start_addr3[1]; - - PA = start_addr1[pprev]; - PD = start_addr2[pprev]; - PG = start_addr3[pprev]; - - //if (x < src_width - 1) - if (x) - { - PC = start_addr1[2]; - PF = start_addr2[2]; - PI = start_addr3[2]; - } else { - PC = start_addr1[1]; - PF = start_addr2[1]; - PI = start_addr3[1]; - } - -#if SHOW_CHANGES - unsigned short int PDE = PE; - PE = 0; -#endif - - - dont_reblit = 0; - - /* Color enhancer */ - /* - unsigned char pattern = ((PE == PA) << 0) | ((PE == PB) << 1) | ((PE == PC) << 2) - | ((PE == PD) << 3) | ((PE == PF) << 4) - | ((PE == PG) << 5) | ((PE == PH) << 6) | ((PE == PI) << 7); - */ - - E[0] = E[1] = E[2] = E[3] = PE; - - // Horizontal - if (!dont_reblit) - { - if (PD != PF) - { - if ((PE != PD) && (PD == PH) && (PD == PI) && (PE != PG) - && ((PD != PG) || (PE != PF) || (PA != PD)) - && (!((PD == PA) && (PD == PG) && (PE == PB) && (PE == PF))) - ) - { - E[2] = PH; - ALPHA_BLEND_128_W(E[3], PH); - dont_reblit = 1; - } - - else if ((PE != PF) && (PF == PH) && (PF == PG) && (PE != PI) - && ((PF != PI) || (PE != PD) || (PC != PF)) - && (!((PF == PC) && (PF == PI) && (PE == PB) && (PE == PD))) - ) - { - ALPHA_BLEND_128_W(E[2], PH); - E[3] = PH; - dont_reblit = 1; - } - } - // Vertical - if (PB != PH) - { - if (PE != PB) - { - if ((PA != PB) || (PB != PC) || (PE != PH)) - { - if ((PB == PD) && (PB == PG) && (PE != PA) - && (!((PD == PA) && (PD == PC) && (PE == PH) && (PE == PF))) - ) - { - ALPHA_BLEND_192_W(E[0], PB); - ALPHA_BLEND_64_W(E[2], PB); - dont_reblit = 1; - } - else if ((PB == PF) && (PB == PI) && (PE != PC) - && (!((PF == PC) && (PF == PA) && (PE == PH) && (PE == PD))) - ) - { - ALPHA_BLEND_192_W(E[1], PB); - ALPHA_BLEND_64_W(E[3], PB); - dont_reblit = 1; - } - } - } - - if (PE != PH) - { - if ((PG != PH) || (PE != PB) || (PH != PI)) - { - if ((PH == PD) && (PH == PA) && (PE != PG) - && (!((PD == PG) && (PD == PI) && (PE == PB) && (PE == PF))) - ) - { - ALPHA_BLEND_192_W(E[2], PH); - ALPHA_BLEND_64_W(E[0], PH); - dont_reblit = 1; - } - - else if ((PH == PF) && (PH == PC) && (PE != PI) - && (!((PF == PI) && (PF == PG) && (PE == PB) && (PE == PD))) - ) - { - ALPHA_BLEND_192_W(E[3], PH); - ALPHA_BLEND_64_W(E[1], PH); - dont_reblit = 1; - } - } - } - } - } - - if (!dont_reblit) - { - if ((PB != PH) && (PD != PF)) - { - if ((PB == PD) && (PE != PD) - && (!((PE == PA) && (PB == PC) && (PE == PF))) // Block - && (!((PB == PA) && (PB == PG))) - && (!((PD == PA) && (PD == PC) && (PE == PF) && (PG != PD) && (PG != PE))) // OK - ) - ALPHA_BLEND_128_W(E[0], PB); - - if ((PB == PF) && (PE != PF) - && (!((PE == PC) && (PB == PA) && (PE == PD))) // Block - && (!((PB == PC) && (PB == PI))) - && (!((PF == PA) && (PF == PC) && (PE == PD) && (PI != PF) && (PI != PE))) // OK - ) - ALPHA_BLEND_128_W(E[1], PB); - - if ((PH == PD) && ((PE != PG) || (PE != PD)) - && (!((PE == PG) && (PH == PI) && (PE == PF))) // Block - && (!((PH == PG) && (PH == PA))) - && (!((PD == PG) && (PD == PI) && (PE == PF) && (PA != PD) && (PA != PE))) // OK - ) - ALPHA_BLEND_128_W(E[2], PH); - - if ((PH == PF) && ((PE != PI) || (PE != PF)) - && (!((PE == PI) && (PH == PG) && (PE == PD))) // Block - && (!((PH == PI) && (PH == PC))) - && (!((PF == PG) && (PF == PI) && (PE == PD) && (PC != PF) && (PI != PE))) // OK - ) - ALPHA_BLEND_128_W(E[3], PH); - } else -#if SHOW_CHANGES - PE = PDE; -#endif - if ((PD == PB) && (PD == PF) && (PD == PH) && (PD != PE)) - { - if ((PD == PG) || (PD == PC)) - { - ALPHA_BLEND_128_W(E[1], PD); - E[2] = E[1]; - } - if ((PD == PA) || (PD == PI)) - { - ALPHA_BLEND_128_W(E[0], PD); - E[3] = E[0]; - } - } - } - - dst_pixel[0] = E[0]; - dst_pixel[1] = E[1]; - dst_pixel[next_line] = E[2]; - dst_pixel[next_line + 1] = E[3]; - - start_addr1++; - start_addr2++; - start_addr3++; - - dst_pixel += 2; - pprev = 0; - } - - start_addr2 += complete_line_src; - start_addr1 = start_addr2 - next_line_src; - start_addr3 = start_addr2 + next_line_src; - dst_pixel += complete_line_dst; - } -} - -//--------------------------------------------------------------------------------------------------------------------------- - -void _2xpm_hq(void *SrcPtr, void *DstPtr, unsigned long SrcPitch, unsigned long DstPitch, unsigned long SrcW, unsigned long SrcH, int nDepth) -{ - if (nDepth == 15) { - pg_red_mask = RED_MASK555; - pg_green_mask = GREEN_MASK555; - pg_blue_mask = BLUE_MASK555; - pg_lbmask = PG_LBMASK555; - } - else if (nDepth == 16) { - pg_red_mask = RED_MASK565; - pg_green_mask = GREEN_MASK565; - pg_blue_mask = BLUE_MASK565; - pg_lbmask = PG_LBMASK565; - } - else { - return; - } - - _2xpm_hq_1516(SrcPtr, DstPtr, SrcPitch, DstPitch, SrcW, SrcH); -} - -//--------------------------------------------------------------------------------------------------------------------------- diff --git a/jan/src/intf/video/scalers/2xsai.cpp b/jan/src/intf/video/scalers/2xsai.cpp deleted file mode 100644 index 36ed6885b..000000000 --- a/jan/src/intf/video/scalers/2xsai.cpp +++ /dev/null @@ -1,1208 +0,0 @@ -//ref: http://vba-rerecording.googlecode.com/svn/trunk/src/2xsai.cpp - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef int s32; - -static u32 colorMask = 0xF7DEF7DE; -static u32 lowPixelMask = 0x08210821; -static u32 qcolorMask = 0xE79CE79C; -static u32 qlowpixelMask = 0x18631863; -static u32 redblueMask = 0xF81F; -static u32 greenMask = 0x7E0; - -int Init_2xSaI(u32 BitFormat, u32 systemColorDepth) -{ - if(systemColorDepth == 16) { - if (BitFormat == 565) { - colorMask = 0xF7DEF7DE; - lowPixelMask = 0x08210821; - qcolorMask = 0xE79CE79C; - qlowpixelMask = 0x18631863; - redblueMask = 0xF81F; - greenMask = 0x7E0; - } else if (BitFormat == 555) { - colorMask = 0x7BDE7BDE; - lowPixelMask = 0x04210421; - qcolorMask = 0x739C739C; - qlowpixelMask = 0x0C630C63; - redblueMask = 0x7C1F; - greenMask = 0x3E0; - } else { - return 0; - } - } else if(systemColorDepth == 32) { - colorMask = 0xfefefe; - lowPixelMask = 0x010101; - qcolorMask = 0xfcfcfc; - qlowpixelMask = 0x030303; - } else - return 0; - - return 1; -} - -static inline int GetResult1 (u32 A, u32 B, u32 C, u32 D, - u32 /* E */) -{ - int x = 0; - int y = 0; - int r = 0; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r += 1; - if (y <= 1) - r -= 1; - return r; -} - -static inline int GetResult2 (u32 A, u32 B, u32 C, u32 D, - u32 /* E */) -{ - int x = 0; - int y = 0; - int r = 0; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r -= 1; - if (y <= 1) - r += 1; - return r; -} - -static inline int GetResult (u32 A, u32 B, u32 C, u32 D) -{ - int x = 0; - int y = 0; - int r = 0; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r += 1; - if (y <= 1) - r -= 1; - return r; -} - -static inline u32 INTERPOLATE (u32 A, u32 B) -{ - if (A != B) { - return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + - (A & B & lowPixelMask)); - } else - return A; -} - -static inline u32 Q_INTERPOLATE (u32 A, u32 B, u32 C, u32 D) -{ - register u32 x = ((A & qcolorMask) >> 2) + - ((B & qcolorMask) >> 2) + - ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2); - register u32 y = (A & qlowpixelMask) + - (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask); - - y = (y >> 2) & qlowpixelMask; - return x + y; -} - -static inline int GetResult1_32 (u32 A, u32 B, u32 C, u32 D, - u32 /* E */) -{ - int x = 0; - int y = 0; - int r = 0; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r += 1; - if (y <= 1) - r -= 1; - return r; -} - -static inline int GetResult2_32 (u32 A, u32 B, u32 C, u32 D, - u32 /* E */) -{ - int x = 0; - int y = 0; - int r = 0; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r -= 1; - if (y <= 1) - r += 1; - return r; -} - -#define BLUE_MASK565 0x001F001F -#define RED_MASK565 0xF800F800 -#define GREEN_MASK565 0x07E007E0 - -#define BLUE_MASK555 0x001F001F -#define RED_MASK555 0x7C007C00 -#define GREEN_MASK555 0x03E003E0 - -void Super2xSaI (u8 *srcPtr, u32 srcPitch, - u8 *deltaPtr, u8 *dstPtr, u32 dstPitch, - int width, int height) -{ - u16 *bP; - u8 *dP; - u32 inc_bP; - u32 Nextline = srcPitch >> 1; - - { - inc_bP = 1; - - for (; height; height--) { - bP = (u16 *) srcPtr; - dP = (u8 *) dstPtr; - - for (u32 finish = width; finish; finish -= inc_bP) { - u32 color4, color5, color6; - u32 color1, color2, color3; - u32 colorA0, colorA1, colorA2, colorA3, - colorB0, colorB1, colorB2, colorB3, colorS1, colorS2; - u32 product1a, product1b, product2a, product2b; - - //--------------------------------------- B1 B2 - // 4 5 6 S2 - // 1 2 3 S1 - // A1 A2 - - colorB0 = *(bP - Nextline - 1); - colorB1 = *(bP - Nextline); - colorB2 = *(bP - Nextline + 1); - colorB3 = *(bP - Nextline + 2); - - color4 = *(bP - 1); - color5 = *(bP); - color6 = *(bP + 1); - colorS2 = *(bP + 2); - - color1 = *(bP + Nextline - 1); - color2 = *(bP + Nextline); - color3 = *(bP + Nextline + 1); - colorS1 = *(bP + Nextline + 2); - - colorA0 = *(bP + Nextline + Nextline - 1); - colorA1 = *(bP + Nextline + Nextline); - colorA2 = *(bP + Nextline + Nextline + 1); - colorA3 = *(bP + Nextline + Nextline + 2); - - //-------------------------------------- - if (color2 == color6 && color5 != color3) { - product2b = product1b = color2; - } else if (color5 == color3 && color2 != color6) { - product2b = product1b = color5; - } else if (color5 == color3 && color2 == color6) { - register int r = 0; - - r += GetResult (color6, color5, color1, colorA1); - r += GetResult (color6, color5, color4, colorB1); - r += GetResult (color6, color5, colorA2, colorS1); - r += GetResult (color6, color5, colorB2, colorS2); - - if (r > 0) - product2b = product1b = color6; - else if (r < 0) - product2b = product1b = color5; - else { - product2b = product1b = INTERPOLATE (color5, color6); - } - } else { - if (color6 == color3 && color3 == colorA1 - && color2 != colorA2 && color3 != colorA0) - product2b = - Q_INTERPOLATE (color3, color3, color3, color2); - else if (color5 == color2 && color2 == colorA2 - && colorA1 != color3 && color2 != colorA3) - product2b = - Q_INTERPOLATE (color2, color2, color2, color3); - else - product2b = INTERPOLATE (color2, color3); - - if (color6 == color3 && color6 == colorB1 - && color5 != colorB2 && color6 != colorB0) - product1b = - Q_INTERPOLATE (color6, color6, color6, color5); - else if (color5 == color2 && color5 == colorB2 - && colorB1 != color6 && color5 != colorB3) - product1b = - Q_INTERPOLATE (color6, color5, color5, color5); - else - product1b = INTERPOLATE (color5, color6); - } - - if (color5 == color3 && color2 != color6 && color4 == color5 - && color5 != colorA2) - product2a = INTERPOLATE (color2, color5); - else - if (color5 == color1 && color6 == color5 - && color4 != color2 && color5 != colorA0) - product2a = INTERPOLATE (color2, color5); - else - product2a = color2; - - if (color2 == color6 && color5 != color3 && color1 == color2 - && color2 != colorB2) - product1a = INTERPOLATE (color2, color5); - else - if (color4 == color2 && color3 == color2 - && color1 != color5 && color2 != colorB0) - product1a = INTERPOLATE (color2, color5); - else - product1a = color5; - -#ifdef WORDS_BIGENDIAN - product1a = (product1a << 16) | product1b; - product2a = (product2a << 16) | product2b; -#else - product1a = product1a | (product1b << 16); - product2a = product2a | (product2b << 16); -#endif - - *((u32 *) dP) = product1a; - *((u32 *) (dP + dstPitch)) = product2a; - - bP += inc_bP; - dP += sizeof (u32); - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch << 1; - deltaPtr += srcPitch; - } // endof: for (; height; height--) - } -} - -void Super2xSaI32 (u8 *srcPtr, u32 srcPitch, - u8 * /* deltaPtr */, u8 *dstPtr, u32 dstPitch, - int width, int height) -{ - u32 *bP; - u32 *dP; - u32 inc_bP; - u32 Nextline = srcPitch >> 2; - inc_bP = 1; - - for (; height; height--) { - bP = (u32 *) srcPtr; - dP = (u32 *) dstPtr; - - for (u32 finish = width; finish; finish -= inc_bP) { - u32 color4, color5, color6; - u32 color1, color2, color3; - u32 colorA0, colorA1, colorA2, colorA3, - colorB0, colorB1, colorB2, colorB3, colorS1, colorS2; - u32 product1a, product1b, product2a, product2b; - - //--------------------------------------- B1 B2 - // 4 5 6 S2 - // 1 2 3 S1 - // A1 A2 - - colorB0 = *(bP - Nextline - 1); - colorB1 = *(bP - Nextline); - colorB2 = *(bP - Nextline + 1); - colorB3 = *(bP - Nextline + 2); - - color4 = *(bP - 1); - color5 = *(bP); - color6 = *(bP + 1); - colorS2 = *(bP + 2); - - color1 = *(bP + Nextline - 1); - color2 = *(bP + Nextline); - color3 = *(bP + Nextline + 1); - colorS1 = *(bP + Nextline + 2); - - colorA0 = *(bP + Nextline + Nextline - 1); - colorA1 = *(bP + Nextline + Nextline); - colorA2 = *(bP + Nextline + Nextline + 1); - colorA3 = *(bP + Nextline + Nextline + 2); - - //-------------------------------------- - if (color2 == color6 && color5 != color3) { - product2b = product1b = color2; - } else if (color5 == color3 && color2 != color6) { - product2b = product1b = color5; - } else if (color5 == color3 && color2 == color6) { - register int r = 0; - - r += GetResult (color6, color5, color1, colorA1); - r += GetResult (color6, color5, color4, colorB1); - r += GetResult (color6, color5, colorA2, colorS1); - r += GetResult (color6, color5, colorB2, colorS2); - - if (r > 0) - product2b = product1b = color6; - else if (r < 0) - product2b = product1b = color5; - else { - product2b = product1b = INTERPOLATE (color5, color6); - } - } else { - if (color6 == color3 && color3 == colorA1 - && color2 != colorA2 && color3 != colorA0) - product2b = - Q_INTERPOLATE (color3, color3, color3, color2); - else if (color5 == color2 && color2 == colorA2 - && colorA1 != color3 && color2 != colorA3) - product2b = - Q_INTERPOLATE (color2, color2, color2, color3); - else - product2b = INTERPOLATE (color2, color3); - - if (color6 == color3 && color6 == colorB1 - && color5 != colorB2 && color6 != colorB0) - product1b = - Q_INTERPOLATE (color6, color6, color6, color5); - else if (color5 == color2 && color5 == colorB2 - && colorB1 != color6 && color5 != colorB3) - product1b = - Q_INTERPOLATE (color6, color5, color5, color5); - else - product1b = INTERPOLATE (color5, color6); - } - - if (color5 == color3 && color2 != color6 && color4 == color5 - && color5 != colorA2) - product2a = INTERPOLATE (color2, color5); - else - if (color5 == color1 && color6 == color5 - && color4 != color2 && color5 != colorA0) - product2a = INTERPOLATE (color2, color5); - else - product2a = color2; - - if (color2 == color6 && color5 != color3 && color1 == color2 - && color2 != colorB2) - product1a = INTERPOLATE (color2, color5); - else - if (color4 == color2 && color3 == color2 - && color1 != color5 && color2 != colorB0) - product1a = INTERPOLATE (color2, color5); - else - product1a = color5; - *(dP) = product1a; - *(dP+1) = product1b; - *(dP + (dstPitch >> 2)) = product2a; - *(dP + (dstPitch >> 2) + 1) = product2b; - - bP += inc_bP; - dP += 2; - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch << 1; - // deltaPtr += srcPitch; - } // endof: for (; height; height--) -} - -void SuperEagle (u8 *srcPtr, u32 srcPitch, u8 *deltaPtr, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u8 *dP; - u16 *bP; - u16 *xP; - u32 inc_bP; - - { - inc_bP = 1; - - u32 Nextline = srcPitch >> 1; - - for (; height; height--) { - bP = (u16 *) srcPtr; - xP = (u16 *) deltaPtr; - dP = dstPtr; - for (u32 finish = width; finish; finish -= inc_bP) { - u32 color4, color5, color6; - u32 color1, color2, color3; - u32 colorA1, colorA2, colorB1, colorB2, colorS1, colorS2; - u32 product1a, product1b, product2a, product2b; - - colorB1 = *(bP - Nextline); - colorB2 = *(bP - Nextline + 1); - - color4 = *(bP - 1); - color5 = *(bP); - color6 = *(bP + 1); - colorS2 = *(bP + 2); - - color1 = *(bP + Nextline - 1); - color2 = *(bP + Nextline); - color3 = *(bP + Nextline + 1); - colorS1 = *(bP + Nextline + 2); - - colorA1 = *(bP + Nextline + Nextline); - colorA2 = *(bP + Nextline + Nextline + 1); - - // -------------------------------------- - if (color2 == color6 && color5 != color3) { - product1b = product2a = color2; - if ((color1 == color2) || (color6 == colorB2)) { - product1a = INTERPOLATE (color2, color5); - product1a = INTERPOLATE (color2, product1a); - // product1a = color2; - } else { - product1a = INTERPOLATE (color5, color6); - } - - if ((color6 == colorS2) || (color2 == colorA1)) { - product2b = INTERPOLATE (color2, color3); - product2b = INTERPOLATE (color2, product2b); - // product2b = color2; - } else { - product2b = INTERPOLATE (color2, color3); - } - } else if (color5 == color3 && color2 != color6) { - product2b = product1a = color5; - - if ((colorB1 == color5) || (color3 == colorS1)) { - product1b = INTERPOLATE (color5, color6); - product1b = INTERPOLATE (color5, product1b); - // product1b = color5; - } else { - product1b = INTERPOLATE (color5, color6); - } - - if ((color3 == colorA2) || (color4 == color5)) { - product2a = INTERPOLATE (color5, color2); - product2a = INTERPOLATE (color5, product2a); - // product2a = color5; - } else { - product2a = INTERPOLATE (color2, color3); - } - - } else if (color5 == color3 && color2 == color6) { - register int r = 0; - - r += GetResult (color6, color5, color1, colorA1); - r += GetResult (color6, color5, color4, colorB1); - r += GetResult (color6, color5, colorA2, colorS1); - r += GetResult (color6, color5, colorB2, colorS2); - - if (r > 0) { - product1b = product2a = color2; - product1a = product2b = INTERPOLATE (color5, color6); - } else if (r < 0) { - product2b = product1a = color5; - product1b = product2a = INTERPOLATE (color5, color6); - } else { - product2b = product1a = color5; - product1b = product2a = color2; - } - } else { - product2b = product1a = INTERPOLATE (color2, color6); - product2b = - Q_INTERPOLATE (color3, color3, color3, product2b); - product1a = - Q_INTERPOLATE (color5, color5, color5, product1a); - - product2a = product1b = INTERPOLATE (color5, color3); - product2a = - Q_INTERPOLATE (color2, color2, color2, product2a); - product1b = - Q_INTERPOLATE (color6, color6, color6, product1b); - - // product1a = color5; - // product1b = color6; - // product2a = color2; - // product2b = color3; - } -#ifdef WORDS_BIGENDIAN - product1a = (product1a << 16) | product1b; - product2a = (product2a << 16) | product2b; -#else - product1a = product1a | (product1b << 16); - product2a = product2a | (product2b << 16); -#endif - - *((u32 *) dP) = product1a; - *((u32 *) (dP + dstPitch)) = product2a; - *xP = color5; - - bP += inc_bP; - xP += inc_bP; - dP += sizeof (u32); - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch << 1; - deltaPtr += srcPitch; - } // endof: for (height; height; height--) - } -} - -void SuperEagle32 (u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u32 *dP; - u32 *bP; -// u32 *xP; - u32 inc_bP; - - inc_bP = 1; - - u32 Nextline = srcPitch >> 2; - - for (; height; height--) { - bP = (u32 *) srcPtr; -// xP = (u32 *) deltaPtr; - dP = (u32 *)dstPtr; - for (u32 finish = width; finish; finish -= inc_bP) { - u32 color4, color5, color6; - u32 color1, color2, color3; - u32 colorA1, colorA2, colorB1, colorB2, colorS1, colorS2; - u32 product1a, product1b, product2a, product2b; - - colorB1 = *(bP - Nextline); - colorB2 = *(bP - Nextline + 1); - - color4 = *(bP - 1); - color5 = *(bP); - color6 = *(bP + 1); - colorS2 = *(bP + 2); - - color1 = *(bP + Nextline - 1); - color2 = *(bP + Nextline); - color3 = *(bP + Nextline + 1); - colorS1 = *(bP + Nextline + 2); - - colorA1 = *(bP + Nextline + Nextline); - colorA2 = *(bP + Nextline + Nextline + 1); - - // -------------------------------------- - if (color2 == color6 && color5 != color3) { - product1b = product2a = color2; - if ((color1 == color2) || (color6 == colorB2)) { - product1a = INTERPOLATE (color2, color5); - product1a = INTERPOLATE (color2, product1a); - // product1a = color2; - } else { - product1a = INTERPOLATE (color5, color6); - } - - if ((color6 == colorS2) || (color2 == colorA1)) { - product2b = INTERPOLATE (color2, color3); - product2b = INTERPOLATE (color2, product2b); - // product2b = color2; - } else { - product2b = INTERPOLATE (color2, color3); - } - } else if (color5 == color3 && color2 != color6) { - product2b = product1a = color5; - - if ((colorB1 == color5) || (color3 == colorS1)) { - product1b = INTERPOLATE (color5, color6); - product1b = INTERPOLATE (color5, product1b); - // product1b = color5; - } else { - product1b = INTERPOLATE (color5, color6); - } - - if ((color3 == colorA2) || (color4 == color5)) { - product2a = INTERPOLATE (color5, color2); - product2a = INTERPOLATE (color5, product2a); - // product2a = color5; - } else { - product2a = INTERPOLATE (color2, color3); - } - - } else if (color5 == color3 && color2 == color6) { - register int r = 0; - - r += GetResult (color6, color5, color1, colorA1); - r += GetResult (color6, color5, color4, colorB1); - r += GetResult (color6, color5, colorA2, colorS1); - r += GetResult (color6, color5, colorB2, colorS2); - - if (r > 0) { - product1b = product2a = color2; - product1a = product2b = INTERPOLATE (color5, color6); - } else if (r < 0) { - product2b = product1a = color5; - product1b = product2a = INTERPOLATE (color5, color6); - } else { - product2b = product1a = color5; - product1b = product2a = color2; - } - } else { - product2b = product1a = INTERPOLATE (color2, color6); - product2b = - Q_INTERPOLATE (color3, color3, color3, product2b); - product1a = - Q_INTERPOLATE (color5, color5, color5, product1a); - - product2a = product1b = INTERPOLATE (color5, color3); - product2a = - Q_INTERPOLATE (color2, color2, color2, product2a); - product1b = - Q_INTERPOLATE (color6, color6, color6, product1b); - - // product1a = color5; - // product1b = color6; - // product2a = color2; - // product2b = color3; - } - *(dP) = product1a; - *(dP+1) = product1b; - *(dP + (dstPitch >> 2)) = product2a; - *(dP + (dstPitch >> 2) +1) = product2b; -// *xP = color5; - - bP += inc_bP; -// xP += inc_bP; - dP += 2; - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch << 1; -// deltaPtr += srcPitch; - } // endof: for (height; height; height--) -} - -void _2xSaI (u8 *srcPtr, u32 srcPitch, u8 *deltaPtr, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u8 *dP; - u16 *bP; - u32 inc_bP; - - { - inc_bP = 1; - - u32 Nextline = srcPitch >> 1; - - for (; height; height--) { - bP = (u16 *) srcPtr; - dP = dstPtr; - - for (u32 finish = width; finish; finish -= inc_bP) { - - register u32 colorA, colorB; - u32 colorC, colorD, - colorE, colorF, colorG, colorH, - colorI, colorJ, colorK, colorL, - - colorM, colorN, colorO, colorP; - u32 product, product1, product2; - - //--------------------------------------- - // Map of the pixels: I|E F|J - // G|A B|K - // H|C D|L - // M|N O|P - colorI = *(bP - Nextline - 1); - colorE = *(bP - Nextline); - colorF = *(bP - Nextline + 1); - colorJ = *(bP - Nextline + 2); - - colorG = *(bP - 1); - colorA = *(bP); - colorB = *(bP + 1); - colorK = *(bP + 2); - - colorH = *(bP + Nextline - 1); - colorC = *(bP + Nextline); - colorD = *(bP + Nextline + 1); - colorL = *(bP + Nextline + 2); - - colorM = *(bP + Nextline + Nextline - 1); - colorN = *(bP + Nextline + Nextline); - colorO = *(bP + Nextline + Nextline + 1); - colorP = *(bP + Nextline + Nextline + 2); - - if ((colorA == colorD) && (colorB != colorC)) { - if (((colorA == colorE) && (colorB == colorL)) || - ((colorA == colorC) && (colorA == colorF) - && (colorB != colorE) && (colorB == colorJ))) { - product = colorA; - } else { - product = INTERPOLATE (colorA, colorB); - } - - if (((colorA == colorG) && (colorC == colorO)) || - ((colorA == colorB) && (colorA == colorH) - && (colorG != colorC) && (colorC == colorM))) { - product1 = colorA; - } else { - product1 = INTERPOLATE (colorA, colorC); - } - product2 = colorA; - } else if ((colorB == colorC) && (colorA != colorD)) { - if (((colorB == colorF) && (colorA == colorH)) || - ((colorB == colorE) && (colorB == colorD) - && (colorA != colorF) && (colorA == colorI))) { - product = colorB; - } else { - product = INTERPOLATE (colorA, colorB); - } - - if (((colorC == colorH) && (colorA == colorF)) || - ((colorC == colorG) && (colorC == colorD) - && (colorA != colorH) && (colorA == colorI))) { - product1 = colorC; - } else { - product1 = INTERPOLATE (colorA, colorC); - } - product2 = colorB; - } else if ((colorA == colorD) && (colorB == colorC)) { - if (colorA == colorB) { - product = colorA; - product1 = colorA; - product2 = colorA; - } else { - register int r = 0; - - product1 = INTERPOLATE (colorA, colorC); - product = INTERPOLATE (colorA, colorB); - - r += - GetResult1 (colorA, colorB, colorG, colorE, - colorI); - r += - GetResult2 (colorB, colorA, colorK, colorF, - colorJ); - r += - GetResult2 (colorB, colorA, colorH, colorN, - colorM); - r += - GetResult1 (colorA, colorB, colorL, colorO, - colorP); - - if (r > 0) - product2 = colorA; - else if (r < 0) - product2 = colorB; - else { - product2 = - Q_INTERPOLATE (colorA, colorB, colorC, - colorD); - } - } - } else { - product2 = Q_INTERPOLATE (colorA, colorB, colorC, colorD); - - if ((colorA == colorC) && (colorA == colorF) - && (colorB != colorE) && (colorB == colorJ)) { - product = colorA; - } else if ((colorB == colorE) && (colorB == colorD) - && (colorA != colorF) && (colorA == colorI)) { - product = colorB; - } else { - product = INTERPOLATE (colorA, colorB); - } - - if ((colorA == colorB) && (colorA == colorH) - && (colorG != colorC) && (colorC == colorM)) { - product1 = colorA; - } else if ((colorC == colorG) && (colorC == colorD) - && (colorA != colorH) && (colorA == colorI)) { - product1 = colorC; - } else { - product1 = INTERPOLATE (colorA, colorC); - } - } - -#ifdef WORDS_BIGENDIAN - product = (colorA << 16) | product ; - product1 = (product1 << 16) | product2 ; -#else - product = colorA | (product << 16); - product1 = product1 | (product2 << 16); -#endif - *((s32 *) dP) = product; - *((u32 *) (dP + dstPitch)) = product1; - - bP += inc_bP; - dP += sizeof (u32); - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch << 1; - deltaPtr += srcPitch; - } // endof: for (height; height; height--) - } -} - -void _2xSaI32 (u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u32 *dP; - u32 *bP; - u32 inc_bP = 1; - - u32 Nextline = srcPitch >> 2; - - for (; height; height--) { - bP = (u32 *) srcPtr; - dP = (u32 *) dstPtr; - - for (u32 finish = width; finish; finish -= inc_bP) { - register u32 colorA, colorB; - u32 colorC, colorD, - colorE, colorF, colorG, colorH, - colorI, colorJ, colorK, colorL, - - colorM, colorN, colorO, colorP; - u32 product, product1, product2; - - //--------------------------------------- - // Map of the pixels: I|E F|J - // G|A B|K - // H|C D|L - // M|N O|P - colorI = *(bP - Nextline - 1); - colorE = *(bP - Nextline); - colorF = *(bP - Nextline + 1); - colorJ = *(bP - Nextline + 2); - - colorG = *(bP - 1); - colorA = *(bP); - colorB = *(bP + 1); - colorK = *(bP + 2); - - colorH = *(bP + Nextline - 1); - colorC = *(bP + Nextline); - colorD = *(bP + Nextline + 1); - colorL = *(bP + Nextline + 2); - - colorM = *(bP + Nextline + Nextline - 1); - colorN = *(bP + Nextline + Nextline); - colorO = *(bP + Nextline + Nextline + 1); - colorP = *(bP + Nextline + Nextline + 2); - - if ((colorA == colorD) && (colorB != colorC)) { - if (((colorA == colorE) && (colorB == colorL)) || - ((colorA == colorC) && (colorA == colorF) - && (colorB != colorE) && (colorB == colorJ))) { - product = colorA; - } else { - product = INTERPOLATE (colorA, colorB); - } - - if (((colorA == colorG) && (colorC == colorO)) || - ((colorA == colorB) && (colorA == colorH) - && (colorG != colorC) && (colorC == colorM))) { - product1 = colorA; - } else { - product1 = INTERPOLATE (colorA, colorC); - } - product2 = colorA; - } else if ((colorB == colorC) && (colorA != colorD)) { - if (((colorB == colorF) && (colorA == colorH)) || - ((colorB == colorE) && (colorB == colorD) - && (colorA != colorF) && (colorA == colorI))) { - product = colorB; - } else { - product = INTERPOLATE (colorA, colorB); - } - - if (((colorC == colorH) && (colorA == colorF)) || - ((colorC == colorG) && (colorC == colorD) - && (colorA != colorH) && (colorA == colorI))) { - product1 = colorC; - } else { - product1 = INTERPOLATE (colorA, colorC); - } - product2 = colorB; - } else if ((colorA == colorD) && (colorB == colorC)) { - if (colorA == colorB) { - product = colorA; - product1 = colorA; - product2 = colorA; - } else { - register int r = 0; - - product1 = INTERPOLATE (colorA, colorC); - product = INTERPOLATE (colorA, colorB); - - r += - GetResult1 (colorA, colorB, colorG, colorE, - colorI); - r += - GetResult2 (colorB, colorA, colorK, colorF, - colorJ); - r += - GetResult2 (colorB, colorA, colorH, colorN, - colorM); - r += - GetResult1 (colorA, colorB, colorL, colorO, - colorP); - - if (r > 0) - product2 = colorA; - else if (r < 0) - product2 = colorB; - else { - product2 = - Q_INTERPOLATE (colorA, colorB, colorC, - colorD); - } - } - } else { - product2 = Q_INTERPOLATE (colorA, colorB, colorC, colorD); - - if ((colorA == colorC) && (colorA == colorF) - && (colorB != colorE) && (colorB == colorJ)) { - product = colorA; - } else if ((colorB == colorE) && (colorB == colorD) - && (colorA != colorF) && (colorA == colorI)) { - product = colorB; - } else { - product = INTERPOLATE (colorA, colorB); - } - - if ((colorA == colorB) && (colorA == colorH) - && (colorG != colorC) && (colorC == colorM)) { - product1 = colorA; - } else if ((colorC == colorG) && (colorC == colorD) - && (colorA != colorH) && (colorA == colorI)) { - product1 = colorC; - } else { - product1 = INTERPOLATE (colorA, colorC); - } - } - *(dP) = colorA; - *(dP + 1) = product; - *(dP + (dstPitch >> 2)) = product1; - *(dP + (dstPitch >> 2) + 1) = product2; - - bP += inc_bP; - dP += 2; - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch << 1; - // deltaPtr += srcPitch; - } // endof: for (height; height; height--) -} - -static u32 Bilinear (u32 A, u32 B, u32 x) -{ - unsigned long areaA, areaB; - unsigned long result; - - if (A == B) - return A; - - areaB = (x >> 11) & 0x1f; // reduce 16 bit fraction to 5 bits - areaA = 0x20 - areaB; - - A = (A & redblueMask) | ((A & greenMask) << 16); - B = (B & redblueMask) | ((B & greenMask) << 16); - - result = ((areaA * A) + (areaB * B)) >> 5; - - return (result & redblueMask) | ((result >> 16) & greenMask); -} - -static u32 Bilinear4 (u32 A, u32 B, u32 C, u32 D, u32 x, - u32 y) -{ - unsigned long areaA, areaB, areaC, areaD; - unsigned long result, xy; - - x = (x >> 11) & 0x1f; - y = (y >> 11) & 0x1f; - xy = (x * y) >> 5; - - A = (A & redblueMask) | ((A & greenMask) << 16); - B = (B & redblueMask) | ((B & greenMask) << 16); - C = (C & redblueMask) | ((C & greenMask) << 16); - D = (D & redblueMask) | ((D & greenMask) << 16); - - areaA = 0x20 + xy - x - y; - areaB = x - xy; - areaC = y - xy; - areaD = xy; - - result = ((areaA * A) + (areaB * B) + (areaC * C) + (areaD * D)) >> 5; - - return (result & redblueMask) | ((result >> 16) & greenMask); -} - -void Scale_2xSaI (u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, - u32 dstWidth, u32 dstHeight, int width, int height) -{ - u8 *dP; - u16 *bP; - - u32 w; - u32 h; - u32 dw; - u32 dh; - u32 hfinish; - u32 wfinish; - - u32 Nextline = srcPitch >> 1; - - wfinish = (width - 1) << 16; // convert to fixed point - dw = wfinish / (dstWidth - 1); - hfinish = (height - 1) << 16; // convert to fixed point - dh = hfinish / (dstHeight - 1); - - for (h = 0; h < hfinish; h += dh) { - u32 y1, y2; - - y1 = h & 0xffff; // fraction part of fixed point - bP = (u16 *) (srcPtr + ((h >> 16) * srcPitch)); - dP = dstPtr; - y2 = 0x10000 - y1; - - w = 0; - - for (; w < wfinish;) { - u32 A, B, C, D; - u32 E, F, G, H; - u32 I, J, K, L; - u32 x1, x2, a1, f1, f2; - u32 position, product1 = 0; - - position = w >> 16; - A = bP[position]; // current pixel - B = bP[position + 1]; // next pixel - C = bP[position + Nextline]; - D = bP[position + Nextline + 1]; - E = bP[position - Nextline]; - F = bP[position - Nextline + 1]; - G = bP[position - 1]; - H = bP[position + Nextline - 1]; - I = bP[position + 2]; - J = bP[position + Nextline + 2]; - K = bP[position + Nextline + Nextline]; - L = bP[position + Nextline + Nextline + 1]; - - x1 = w & 0xffff; // fraction part of fixed point - x2 = 0x10000 - x1; - - /*0*/ - if (A == B && C == D && A == C) - product1 = A; - else /*1*/ if (A == D && B != C) { - f1 = (x1 >> 1) + (0x10000 >> 2); - f2 = (y1 >> 1) + (0x10000 >> 2); - if (y1 <= f1 && A == J && A != E) // close to B - { - a1 = f1 - y1; - product1 = Bilinear (A, B, a1); - } else if (y1 >= f1 && A == G && A != L) // close to C - { - a1 = y1 - f1; - product1 = Bilinear (A, C, a1); - } - else if (x1 >= f2 && A == E && A != J) // close to B - { - a1 = x1 - f2; - product1 = Bilinear (A, B, a1); - } - else if (x1 <= f2 && A == L && A != G) // close to C - { - a1 = f2 - x1; - product1 = Bilinear (A, C, a1); - } - else if (y1 >= x1) // close to C - { - a1 = y1 - x1; - product1 = Bilinear (A, C, a1); - } - else if (y1 <= x1) // close to B - { - a1 = x1 - y1; - product1 = Bilinear (A, B, a1); - } - } - else - /*2*/ - if (B == C && A != D) - { - f1 = (x1 >> 1) + (0x10000 >> 2); - f2 = (y1 >> 1) + (0x10000 >> 2); - if (y2 >= f1 && B == H && B != F) // close to A - { - a1 = y2 - f1; - product1 = Bilinear (B, A, a1); - } - else if (y2 <= f1 && B == I && B != K) // close to D - { - a1 = f1 - y2; - product1 = Bilinear (B, D, a1); - } - else if (x2 >= f2 && B == F && B != H) // close to A - { - a1 = x2 - f2; - product1 = Bilinear (B, A, a1); - } - else if (x2 <= f2 && B == K && B != I) // close to D - { - a1 = f2 - x2; - product1 = Bilinear (B, D, a1); - } - else if (y2 >= x1) // close to A - { - a1 = y2 - x1; - product1 = Bilinear (B, A, a1); - } - else if (y2 <= x1) // close to D - { - a1 = x1 - y2; - product1 = Bilinear (B, D, a1); - } - } - /*3*/ - else - { - product1 = Bilinear4 (A, B, C, D, x1, y1); - } - - //end First Pixel - *(u32 *) dP = product1; - dP += 2; - w += dw; - } - dstPtr += dstPitch; - } -} diff --git a/jan/src/intf/video/scalers/2xsaimmx.asm b/jan/src/intf/video/scalers/2xsaimmx.asm deleted file mode 100644 index 30e3f271b..000000000 --- a/jan/src/intf/video/scalers/2xsaimmx.asm +++ /dev/null @@ -1,2067 +0,0 @@ -;/*---------------------------------------------------------------------* -; * The following (piece of) code, (part of) the 2xSaI engine, * -; * copyright (c) 2001 by Derek Liauw Kie Fa. * -; * Non-Commercial use of the engine is allowed and is encouraged, * -; * provided that appropriate credit be given and that this copyright * -; * notice will not be removed under any circumstance. * -; * You may freely modify this code, but I request * -; * that any improvements to the engine be submitted to me, so * -; * that I can implement these improvements in newer versions of * -; * the engine. * -; * If you need more information, have any comments or suggestions, * -; * you can e-mail me. My e-mail: DerekL666@yahoo.com * -; *---------------------------------------------------------------------*/ - -;---------------------- -; 2xSaI, Super2xSaI, SuperEagle .. FINAL. no versioning anymore.. -;---------------------- - - BITS 32 -%ifdef __DJGPP__ -; GLOBAL __2xSaILine -; GLOBAL __2xSaISuperEagleLine -; GLOBAL _Init_2xSaIMMX -%else - global _2xSaILine - global __2xSaILine - global _2xSaISuperEagleLine - global __2xSaISuperEagleLine - global _2xSaISuper2xSaILine - global __2xSaISuper2xSaILine - global Init_2xSaIMMX - global _Init_2xSaIMMX -%endif - SECTION .text ALIGN = 32 - -%ifdef __DJGPP__ -;EXTERN_C void __2xSaILine (uint8 *srcPtr, uint32 srcPitch, uint32 width, -; uint8 *dstPtr, uint32 dstPitch, uint16 dstSegment); -%else -;EXTERN_C void _2xSaILine (uint8 *srcPtr, uint32 srcPitch, uint32 width, -; uint8 *dstPtr, uint32 dstPitch); -%endif - -srcPtr equ 8 -deltaPtr equ 12 -srcPitch equ 16 -width equ 20 -dstOffset equ 24 -dstPitch equ 28 -dstSegment equ 32 - - -colorB0 equ -2 -colorB1 equ 0 -colorB2 equ 2 -colorB3 equ 4 - -color7 equ -2 -color8 equ 0 -color9 equ 2 - -color4 equ -2 -color5 equ 0 -color6 equ 2 -colorS2 equ 4 - -color1 equ -2 -color2 equ 0 -color3 equ 2 -colorS1 equ 4 - -colorA0 equ -2 -colorA1 equ 0 -colorA2 equ 2 -colorA3 equ 4 - - - - - - - - - -_2xSaISuper2xSaILine: -__2xSaISuper2xSaILine: -; Store some stuff - push ebp - mov ebp, esp - pushad - -; Prepare the destination -%ifdef __DJGPP__ - ; Set the selector - mov eax, [ebp+dstSegment] - mov fs, ax -%endif - mov edx, [ebp+dstOffset] ; edx points to the screen -; Prepare the source - ; eax points to colorA - mov eax, [ebp+srcPtr] ;eax points to colorA - mov ebx, [ebp+srcPitch] ;ebx contains the source pitch - mov ecx, [ebp+width] ;ecx contains the number of pixels to process - ; eax now points to colorB1 - sub eax, ebx ;eax points to B1 which is the base - -; Main Loop -.Loop: push ecx - - ;-----Check Delta------------------ - mov ecx, [ebp+deltaPtr] - - - ;load source img - movq mm0, [eax+colorB0] - movq mm1, [eax+colorB3] - movq mm2, [eax+ebx+color4] - movq mm3, [eax+ebx+colorS2] - movq mm4, [eax+ebx+ebx+color1] - movq mm5, [eax+ebx+ebx+colorS1] - push eax - add eax, ebx - movq mm6, [eax+ebx+ebx+colorA0] - movq mm7, [eax+ebx+ebx+colorA3] - pop eax - - ;compare to delta - pcmpeqw mm0, [ecx+2+colorB0] - pcmpeqw mm1, [ecx+2+colorB3] - pcmpeqw mm2, [ecx+ebx+2+color4] - pcmpeqw mm3, [ecx+ebx+2+colorS2] - pcmpeqw mm4, [ecx+ebx+ebx+2+color1] - pcmpeqw mm5, [ecx+ebx+ebx+2+colorS1] - add ecx, ebx - pcmpeqw mm6, [ecx+ebx+ebx+2+colorA0] - pcmpeqw mm7, [ecx+ebx+ebx+2+colorA3] - sub ecx, ebx - - - ;compose results - pand mm0, mm1 - pand mm2, mm3 - pand mm4, mm5 - pand mm6, mm7 - pand mm0, mm2 - pand mm4, mm6 - pxor mm7, mm7 - pand mm0, mm4 - movq mm6, [eax+colorB0] - pcmpeqw mm7, mm0 ;did any compare give us a zero ? - - movq [ecx+2+colorB0], mm6 - - packsswb mm7, mm7 - movd ecx, mm7 - test ecx, ecx - jz near .SKIP_PROCESS ;no, so we can skip - - ;End Delta - - ;--------------------------------- - movq mm0, [eax+ebx+color5] - movq mm1, [eax+ebx+color6] - movq mm2, mm0 - movq mm3, mm1 - movq mm4, mm0 - movq mm5, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 ;mm0 contains the interpolated values - movq [I56Pixel], mm0 - movq mm7, mm0 - - ;------------------- - movq mm0, mm7 - movq mm1, mm4 ;5,5,5,6 - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 ;mm0 contains the interpolated values - movq [I5556Pixel], mm0 - ;-------------------- - - movq mm0, mm7 - movq mm1, mm5 ;6,6,6,5 - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 - movq [I5666Pixel], mm0 - - ;------------------------- - ;------------------------- - movq mm0, [eax+ebx+ebx+color2] - movq mm1, [eax+ebx+ebx+color3] - movq mm2, mm0 - movq mm3, mm1 - movq mm4, mm0 - movq mm5, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 - movq [I23Pixel], mm0 - movq mm7, mm0 - - ;--------------------- - movq mm0, mm7 - movq mm1, mm4 ;2,2,2,3 - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 - movq [I2223Pixel], mm0 - - ;---------------------- - movq mm0, mm7 - movq mm1, mm5 ;3,3,3,2 - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 - movq [I2333Pixel], mm0 - - - ;-------------------- -;//////////////////////////////// -; Decide which "branch" to take -;-------------------------------- - movq mm0, [eax+ebx+color5] - movq mm1, [eax+ebx+color6] - movq mm6, mm0 - movq mm7, mm1 - pcmpeqw mm0, [eax+ebx+ebx+color3] - pcmpeqw mm1, [eax+ebx+ebx+color2] - pcmpeqw mm6, mm7 - - movq mm2, mm0 - movq mm3, mm0 - - pand mm0, mm1 ;colorA == colorD && colorB == colorC - pxor mm7, mm7 - - pcmpeqw mm2, mm7 - pand mm6, mm0 - pand mm2, mm1 ;colorA != colorD && colorB == colorC - - pcmpeqw mm1, mm7 - - pand mm1, mm3 ;colorA == colorD && colorB != colorC - pxor mm0, mm6 - por mm1, mm6 - movq mm7, mm0 - movq [Mask26], mm2 - packsswb mm7, mm7 - movq [Mask35], mm1 - - movd ecx, mm7 - test ecx, ecx - jz near .SKIP_GUESS - -;--------------------------------------------- - movq mm6, mm0 - movq mm4, [eax+ebx+colorA] - movq mm5, [eax+ebx+colorB] - pxor mm7, mm7 - pand mm6, [ONE] - - movq mm0, [eax+colorE] - movq mm1, [eax+ebx+colorG] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - movq mm0, [eax+colorF] - movq mm1, [eax+ebx+colorK] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - push eax - add eax, ebx - movq mm0, [eax+ebx+colorH] - movq mm1, [eax+ebx+ebx+colorN] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - movq mm0, [eax+ebx+colorL] - movq mm1, [eax+ebx+ebx+colorO] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - pop eax - movq mm1, mm7 - pxor mm0, mm0 - pcmpgtw mm7, mm0 - pcmpgtw mm0, mm1 - - por mm7, [Mask35] - por mm0, [Mask26] - movq [Mask35], mm7 - movq [Mask26], mm0 - -.SKIP_GUESS: - - ;Start the ASSEMBLY !!! eh... compose all the results together to form the final image... - - - movq mm0, [eax+ebx+color5] - movq mm1, [eax+ebx+ebx+color2] - movq mm2, mm0 - movq mm3, mm1 - movq mm4, mm0 - movq mm5, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 ;mm0 contains the interpolated values - ;--------------------------- - - - -%ifdef dfhsdfhsdahdsfhdsfh - - if (color5 == color3 && color2 != color6 && color4 == color5 && color5 != colorA2) - product2a = INTERPOLATE (color2, color5); - else - if (color5 == color1 && color6 == color5 && color4 != color2 && color5 != colorA0) - product2a = INTERPOLATE(color2, color5); - else - product2a = color2; - - if (color2 == color6 && color5 != color3 && color1 == color2 && color2 != colorB2) - product1a = INTERPOLATE (color2, color5); - else - if (color4 == color2 && color3 == color2 && color1 != color5 && color2 != colorB0) - product1a = INTERPOLATE(color2, color5); - else - product1a = color5; - -%endif - - - movq mm7, [Mask26] - movq mm6, [eax+colorB2] - movq mm5, [eax+ebx+ebx+color2] - movq mm4, [eax+ebx+ebx+color1] - pcmpeqw mm4, mm5 - pcmpeqw mm6, mm5 - pxor mm5, mm5 - pand mm7, mm4 - pcmpeqw mm6, mm5 - pand mm7, mm6 - - - - movq mm6, [eax+ebx+ebx+color3] - movq mm5, [eax+ebx+ebx+color2] - movq mm4, [eax+ebx+ebx+color1] - movq mm2, [eax+ebx+color5] - movq mm1, [eax+ebx+color4] - movq mm3, [eax+colorB0] - - pcmpeqw mm2, mm4 - pcmpeqw mm6, mm5 - pcmpeqw mm1, mm5 - pcmpeqw mm3, mm5 - pxor mm5, mm5 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm6, mm1 - pand mm2, mm3 - pand mm6, mm2 - por mm7, mm6 - - - movq mm6, mm7 - pcmpeqw mm6, mm5 - pand mm7, mm0 - - movq mm1, [eax+ebx+color5] - pand mm6, mm1 - por mm7, mm6 - movq [final1a], mm7 ;finished 1a - - - - ;-------------------------------- - - movq mm7, [Mask35] - push eax - add eax, ebx - movq mm6, [eax+ebx+ebx+colorA2] - pop eax - movq mm5, [eax+ebx+color5] - movq mm4, [eax+ebx+color4] - pcmpeqw mm4, mm5 - pcmpeqw mm6, mm5 - pxor mm5, mm5 - pand mm7, mm4 - pcmpeqw mm6, mm5 - pand mm7, mm6 - - - - movq mm6, [eax+ebx+color6] - movq mm5, [eax+ebx+color5] - movq mm4, [eax+ebx+color4] - movq mm2, [eax+ebx+ebx+color2] - movq mm1, [eax+ebx+ebx+color1] - push eax - add eax, ebx - movq mm3, [eax+ebx+ebx+colorA0] - pop eax - - pcmpeqw mm2, mm4 - pcmpeqw mm6, mm5 - pcmpeqw mm1, mm5 - pcmpeqw mm3, mm5 - pxor mm5, mm5 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm6, mm1 - pand mm2, mm3 - pand mm6, mm2 - por mm7, mm6 - - - movq mm6, mm7 - pcmpeqw mm6, mm5 - pand mm7, mm0 - - movq mm1, [eax+ebx+ebx+color2] - pand mm6, mm1 - por mm7, mm6 - movq [final2a], mm7 ;finished 2a - - - ;-------------------------------------------- - - -%ifdef dfhsdfhsdahdsfhdsfh - if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0) - product2b = Q_INTERPOLATE (color3, color3, color3, color2); - else - if (color5 == color2 && color2 == colorA2 && colorA1 != color3 && color2 != colorA3) - product2b = Q_INTERPOLATE (color2, color2, color2, color3); - else - product2b = INTERPOLATE (color2, color3); - - if (color6 == color3 && color6 == colorB1 && color5 != colorB2 && color6 != colorB0) - product1b = Q_INTERPOLATE (color6, color6, color6, color5); - else - if (color5 == color2 && color5 == colorB2 && colorB1 != color6 && color5 != colorB3) - product1b = Q_INTERPOLATE (color6, color5, color5, color5); - else - product1b = INTERPOLATE (color5, color6); -%endif - - push eax - add eax, ebx - pxor mm7, mm7 - movq mm0, [eax+ebx+ebx+colorA0] - movq mm1, [eax+ebx+ebx+colorA1] - movq mm2, [eax+ebx+ebx+colorA2] - movq mm3, [eax+ebx+ebx+colorA3] - pop eax - movq mm4, [eax+ebx+ebx+color2] - movq mm5, [eax+ebx+ebx+color3] - movq mm6, [eax+ebx+color6] - - pcmpeqw mm6, mm5 - pcmpeqw mm1, mm5 - pcmpeqw mm4, mm2 - pcmpeqw mm0, mm5 - pcmpeqw mm4, mm7 - pcmpeqw mm0, mm7 - pand mm0, mm4 - pand mm6, mm1 - pand mm0, mm6 - - movq mm4, [eax+ebx+color2] - movq mm5, [eax+ebx+ebx+color5] - movq mm6, [eax+ebx+ebx+color3] - - pcmpeqw mm5, mm4 - pcmpeqw mm2, mm4 - pcmpeqw mm1, mm6 - pcmpeqw mm3, mm4 - pcmpeqw mm1, mm7 - pcmpeqw mm3, mm7 - pand mm2, mm5 - pand mm1, mm3 - pand mm1, mm2 - - movq mm2, mm0 - movq mm7, [I2333Pixel] - movq mm6, [I2223Pixel] - movq mm5, [I23Pixel] - movq mm4, [Mask35] - movq mm3, [Mask26] - - por mm2, mm4 - pand mm4, [eax+ebx+ebx+color3] - por mm2, mm3 - pand mm3, [eax+ebx+ebx+color2] - por mm2, mm1 - pand mm0, mm7 - pand mm1, mm6 - pxor mm7, mm7 - pcmpeqw mm2, mm7 - por mm0, mm1 - por mm3, mm4 - pand mm2, mm5 - por mm0, mm3 - por mm0, mm2 - movq [final2b], mm0 - - ;----------------------------------- - - - pxor mm7, mm7 - movq mm0, [eax+colorB0] - movq mm1, [eax+colorB1] - movq mm2, [eax+colorB2] - movq mm3, [eax+colorB3] - movq mm4, [eax+ebx+color5] - movq mm5, [eax+ebx+color6] - movq mm6, [eax+ebx+ebx+color3] - - pcmpeqw mm6, mm5 - pcmpeqw mm1, mm5 - pcmpeqw mm4, mm2 - pcmpeqw mm0, mm5 - pcmpeqw mm4, mm7 - pcmpeqw mm0, mm7 - pand mm0, mm4 - pand mm6, mm1 - pand mm0, mm6 - - movq mm4, [eax+ebx+color5] - movq mm5, [eax+ebx+ebx+color2] - movq mm6, [eax+ebx+color6] - - pcmpeqw mm5, mm4 - pcmpeqw mm2, mm4 - pcmpeqw mm1, mm6 - pcmpeqw mm3, mm4 - pcmpeqw mm1, mm7 - pcmpeqw mm3, mm7 - pand mm2, mm5 - pand mm1, mm3 - pand mm1, mm2 - - movq mm2, mm0 - movq mm7, [I5666Pixel] - movq mm6, [I5556Pixel] - movq mm5, [I56Pixel] - movq mm4, [Mask35] - movq mm3, [Mask26] - - por mm2, mm4 - pand mm4, [eax+ebx+color5] - por mm2, mm3 - pand mm3, [eax+ebx+color6] - por mm2, mm1 - pand mm0, mm7 - pand mm1, mm6 - pxor mm7, mm7 - pcmpeqw mm2, mm7 - por mm0, mm1 - por mm3, mm4 - pand mm2, mm5 - por mm0, mm3 - por mm0, mm2 - movq [final1b], mm0 - - ;--------- - - movq mm0, [final1a] - movq mm4, [final2a] - movq mm2, [final1b] - movq mm6, [final2b] - - movq mm1, mm0 - movq mm5, mm4 - - - punpcklwd mm0, mm2 - punpckhwd mm1, mm2 - - punpcklwd mm4, mm6 - punpckhwd mm5, mm6 - - -%ifdef FAR_POINTER - movq [fs:edx], mm0 - movq [fs:edx+8], mm1 - push edx - add edx, [ebp+dstPitch] - movq [fs:edx], mm4 - movq [fs:edx+8], mm5 - pop edx -%else - movq [es:edx], mm0 - movq [es:edx+8], mm1 - push edx - add edx, [ebp+dstPitch] - movq [es:edx], mm4 - movq [es:edx+8], mm5 - pop edx -%endif -.SKIP_PROCESS: - mov ecx, [ebp+deltaPtr] - add ecx, 8 - mov [ebp+deltaPtr], ecx - add edx, 16 - add eax, 8 - - pop ecx - sub ecx, 4 - cmp ecx, 0 - jg near .Loop - -; Restore some stuff - popad - mov esp, ebp - pop ebp - emms - ret - - -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- - - - - - - - -_2xSaISuperEagleLine: -__2xSaISuperEagleLine: -; Store some stuff - push ebp - mov ebp, esp - pushad - -; Prepare the destination -%ifdef __DJGPP__ - ; Set the selector - mov eax, [ebp+dstSegment] - mov fs, ax -%endif - mov edx, [ebp+dstOffset] ; edx points to the screen -; Prepare the source - ; eax points to colorA - mov eax, [ebp+srcPtr] - mov ebx, [ebp+srcPitch] - mov ecx, [ebp+width] - ; eax now points to colorB1 - sub eax, ebx - -; Main Loop -.Loop: push ecx - - ;-----Check Delta------------------ - mov ecx, [ebp+deltaPtr] - - movq mm0, [eax+colorB0] - movq mm1, [eax+colorB3] - movq mm2, [eax+ebx+color4] - movq mm3, [eax+ebx+colorS2] - movq mm4, [eax+ebx+ebx+color1] - movq mm5, [eax+ebx+ebx+colorS1] - push eax - add eax, ebx - movq mm6, [eax+ebx+ebx+colorA0] - movq mm7, [eax+ebx+ebx+colorA3] - pop eax - - pcmpeqw mm0, [ecx+2+colorB0] - pcmpeqw mm1, [ecx+2+colorB3] - pcmpeqw mm2, [ecx+ebx+2+color4] - pcmpeqw mm3, [ecx+ebx+2+colorS2] - pcmpeqw mm4, [ecx+ebx+ebx+2+color1] - pcmpeqw mm5, [ecx+ebx+ebx+2+colorS1] - add ecx, ebx - pcmpeqw mm6, [ecx+ebx+ebx+2+colorA0] - pcmpeqw mm7, [ecx+ebx+ebx+2+colorA3] - sub ecx, ebx - - - pand mm0, mm1 - pand mm2, mm3 - pand mm4, mm5 - pand mm6, mm7 - pand mm0, mm2 - pand mm4, mm6 - pxor mm7, mm7 - pand mm0, mm4 - movq mm6, [eax+colorB0] - pcmpeqw mm7, mm0 - - movq [ecx+2+colorB0], mm6 - - packsswb mm7, mm7 - movd ecx, mm7 - test ecx, ecx - jz near .SKIP_PROCESS - - ;End Delta - - ;--------------------------------- - movq mm0, [eax+ebx+color5] - movq mm1, [eax+ebx+color6] - movq mm2, mm0 - movq mm3, mm1 - movq mm4, mm0 - movq mm5, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 ;mm0 contains the interpolated values - movq [I56Pixel], mm0 - movq mm7, mm0 - - ;------------------- - movq mm0, mm7 - movq mm1, mm4 ;5,5,5,6 - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 ;mm0 contains the interpolated values - movq [product1a], mm0 - ;-------------------- - - movq mm0, mm7 - movq mm1, mm5 ;6,6,6,5 - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 - movq [product1b], mm0 - - ;------------------------- - ;------------------------- - movq mm0, [eax+ebx+ebx+color2] - movq mm1, [eax+ebx+ebx+color3] - movq mm2, mm0 - movq mm3, mm1 - movq mm4, mm0 - movq mm5, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 - movq [I23Pixel], mm0 - movq mm7, mm0 - - ;--------------------- - movq mm0, mm7 - movq mm1, mm4 ;2,2,2,3 - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 - movq [product2a], mm0 - - ;---------------------- - movq mm0, mm7 - movq mm1, mm5 ;3,3,3,2 - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 - movq [product2b], mm0 - - - ;//////////////////////////////// - ; Decide which "branch" to take - ;-------------------------------- - movq mm4, [eax+ebx+color5] - movq mm5, [eax+ebx+color6] - movq mm6, [eax+ebx+ebx+color3] - movq mm7, [eax+ebx+ebx+color2] - - pxor mm3, mm3 - movq mm0, mm4 - movq mm1, mm5 - - pcmpeqw mm0, mm6 - pcmpeqw mm1, mm7 - pcmpeqw mm1, mm3 - pand mm0, mm1 - movq [Mask35], mm0 - - movq mm0, [eax+ebx+ebx+colorS1] - movq mm1, [eax+ebx+color4] - push eax - add eax, ebx - movq mm2, [eax+ebx+ebx+colorA2] - pop eax - movq mm3, [eax+colorB1] - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm4 - pcmpeqw mm3, mm4 - pand mm0, mm1 - pand mm2, mm3 - por mm0, mm2 - pand mm0, [Mask35] - movq [Mask35b], mm0 - - ;----------- - pxor mm3, mm3 - movq mm0, mm4 - movq mm1, mm5 - - pcmpeqw mm0, mm6 - pcmpeqw mm1, mm7 - pcmpeqw mm0, mm3 - pand mm0, mm1 - movq [Mask26], mm0 - - movq mm0, [eax+ebx+ebx+color1] - movq mm1, [eax+ebx+colorS2] - push eax - add eax, ebx - movq mm2, [eax+ebx+ebx+colorA1] - pop eax - movq mm3, [eax+colorB2] - pcmpeqw mm0, mm5 - pcmpeqw mm1, mm5 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm1 - pand mm2, mm3 - por mm0, mm2 - pand mm0, [Mask26] - movq [Mask26b], mm0 - - ;-------------------- - movq mm0, mm4 - movq mm1, mm5 - movq mm2, mm0 - - pcmpeqw mm2, mm1 - pcmpeqw mm0, mm6 - pcmpeqw mm1, mm7 - pand mm0, mm1 - pand mm2, mm0 - pxor mm0, mm2 - movq mm7, mm0 - - ;------------------ - packsswb mm7, mm7 - movd ecx, mm7 - test ecx, ecx - jz near .SKIP_GUESS - -;--------------------------------------------- -; Map of the pixels: I|E F|J -; G|A B|K -; H|C D|L -; M|N O|P - movq mm6, mm0 - movq mm4, [eax+ebx+color5] - movq mm5, [eax+ebx+color6] - pxor mm7, mm7 - pand mm6, [ONE] - - movq mm0, [eax+colorB1] - movq mm1, [eax+ebx+color4] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - movq mm0, [eax+colorB2] - movq mm1, [eax+ebx+colorS2] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - push eax - add eax, ebx - movq mm0, [eax+ebx+color1] - movq mm1, [eax+ebx+ebx+colorA1] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - movq mm0, [eax+ebx+colorS1] - movq mm1, [eax+ebx+ebx+colorA2] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - pop eax - movq mm1, mm7 - pxor mm0, mm0 - pcmpgtw mm7, mm0 - pcmpgtw mm0, mm1 - - por mm7, [Mask35] - por mm1, [Mask26] - movq [Mask35], mm7 - movq [Mask26], mm1 - -.SKIP_GUESS: - ;Start the ASSEMBLY !!! - - movq mm4, [Mask35] - movq mm5, [Mask26] - movq mm6, [Mask35b] - movq mm7, [Mask26b] - - movq mm0, [eax+ebx+color5] - movq mm1, [eax+ebx+color6] - movq mm2, [eax+ebx+ebx+color2] - movq mm3, [eax+ebx+ebx+color3] - pcmpeqw mm0, mm2 - pcmpeqw mm1, mm3 - movq mm2, mm4 - movq mm3, mm5 - por mm0, mm1 - por mm2, mm3 - pand mm2, mm0 - pxor mm0, mm2 - movq mm3, mm0 - - movq mm2, mm0 - pxor mm0, mm0 - por mm2, mm4 - pxor mm4, mm6 - por mm2, mm5 - pxor mm5, mm7 - pcmpeqw mm2, mm0 - ;---------------- - - movq mm0, [eax+ebx+color5] - movq mm1, mm3 - por mm1, mm4 - por mm1, mm6 - pand mm0, mm1 - movq mm1, mm5 - pand mm1, [I56Pixel] - por mm0, mm1 - movq mm1, mm7 - pand mm1, [product1b] - por mm0, mm1 - movq mm1, mm2 - pand mm1, [product1a] - por mm0, mm1 - movq [final1a], mm0 - - movq mm0, [eax+ebx+color6] - movq mm1, mm3 - por mm1, mm5 - por mm1, mm7 - pand mm0, mm1 - movq mm1, mm4 - pand mm1, [I56Pixel] - por mm0, mm1 - movq mm1, mm6 - pand mm1, [product1a] - por mm0, mm1 - movq mm1, mm2 - pand mm1, [product1b] - por mm0, mm1 - movq [final1b], mm0 - - movq mm0, [eax+ebx+ebx+color2] - movq mm1, mm3 - por mm1, mm5 - por mm1, mm7 - pand mm0, mm1 - movq mm1, mm4 - pand mm1, [I23Pixel] - por mm0, mm1 - movq mm1, mm6 - pand mm1, [product2b] - por mm0, mm1 - movq mm1, mm2 - pand mm1, [product2a] - por mm0, mm1 - movq [final2a], mm0 - - movq mm0, [eax+ebx+ebx+color3] - movq mm1, mm3 - por mm1, mm4 - por mm1, mm6 - pand mm0, mm1 - movq mm1, mm5 - pand mm1, [I23Pixel] - por mm0, mm1 - movq mm1, mm7 - pand mm1, [product2a] - por mm0, mm1 - movq mm1, mm2 - pand mm1, [product2b] - por mm0, mm1 - movq [final2b], mm0 - - - movq mm0, [final1a] - movq mm2, [final1b] - movq mm1, mm0 - movq mm4, [final2a] - movq mm6, [final2b] - movq mm5, mm4 - punpcklwd mm0, mm2 - punpckhwd mm1, mm2 - punpcklwd mm4, mm6 - punpckhwd mm5, mm6 - - - - -%ifdef __DJGPP__ - movq [fs:edx], mm0 - movq [fs:edx+8], mm1 - push edx - add edx, [ebp+dstPitch] - movq [fs:edx], mm4 - movq [fs:edx+8], mm5 - pop edx -%else - movq [es:edx], mm0 - movq [es:edx+8], mm1 - push edx - add edx, [ebp+dstPitch] - movq [es:edx], mm4 - movq [es:edx+8], mm5 - pop edx -%endif -.SKIP_PROCESS: - mov ecx, [ebp+deltaPtr] - add ecx, 8 - mov [ebp+deltaPtr], ecx - add edx, 16 - add eax, 8 - - pop ecx - sub ecx, 4 - cmp ecx, 0 - jg near .Loop - -; Restore some stuff - popad - mov esp, ebp - pop ebp - emms - ret - - -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- - - -;This is 2xSaI -colorI equ -2 -colorE equ 0 -colorF equ 2 -colorJ equ 4 - -colorG equ -2 -colorA equ 0 -colorB equ 2 -colorK equ 4 - -colorH equ -2 -colorC equ 0 -colorD equ 2 -colorL equ 4 - -colorM equ -2 -colorN equ 0 -colorO equ 2 -colorP equ 4 - -_2xSaILine: -__2xSaILine: -; Store some stuff - push ebp - mov ebp, esp - pushad - -; Prepare the destination -%ifdef __DJGPP__ - ; Set the selector - mov eax, [ebp+dstSegment] - mov fs, ax -%endif - mov edx, [ebp+dstOffset] ; edx points to the screen -; Prepare the source - ; eax points to colorA - mov eax, [ebp+srcPtr] - mov ebx, [ebp+srcPitch] - mov ecx, [ebp+width] - ; eax now points to colorE - sub eax, ebx - - -; Main Loop -.Loop: push ecx - - ;-----Check Delta------------------ - mov ecx, [ebp+deltaPtr] - - movq mm0, [eax+colorI] - movq mm1, [eax+colorJ] - movq mm2, [eax+ebx+colorG] - movq mm3, [eax+ebx+colorK] - movq mm4, [eax+ebx+ebx+colorH] - movq mm5, [eax+ebx+ebx+colorL] - push eax - add eax, ebx - movq mm6, [eax+ebx+ebx+colorM] - movq mm7, [eax+ebx+ebx+colorP] - pop eax - - pcmpeqw mm0, [ecx+2+colorI] - pcmpeqw mm1, [ecx+2+colorK] - pcmpeqw mm2, [ecx+ebx+2+colorG] - pcmpeqw mm3, [ecx+ebx+2+colorK] - pcmpeqw mm4, [ecx+ebx+ebx+2+colorH] - pcmpeqw mm5, [ecx+ebx+ebx+2+colorL] - add ecx, ebx - pcmpeqw mm6, [ecx+ebx+ebx+2+colorM] - pcmpeqw mm7, [ecx+ebx+ebx+2+colorP] - sub ecx, ebx - - - pand mm0, mm1 - pand mm2, mm3 - pand mm4, mm5 - pand mm6, mm7 - pand mm0, mm2 - pand mm4, mm6 - pxor mm7, mm7 - pand mm0, mm4 - movq mm6, [eax+colorI] - pcmpeqw mm7, mm0 - - movq [ecx+2+colorI], mm6 - - packsswb mm7, mm7 - movd ecx, mm7 - test ecx, ecx - jz near .SKIP_PROCESS - - ;End Delta - - ;--------------------------------- - - -;1 - ;if ((colorA == colorD) && (colorB != colorC) && (colorA == colorE) && (colorB == colorL) - movq mm0, [eax+ebx+colorA] ;mm0 and mm1 contain colorA - movq mm2, [eax+ebx+colorB] ;mm2 and mm3 contain colorB - - movq mm1, mm0 - movq mm3, mm2 - - pcmpeqw mm0, [eax+ebx+ebx+colorD] - pcmpeqw mm1, [eax+colorE] - pcmpeqw mm2, [eax+ebx+ebx+colorL] - pcmpeqw mm3, [eax+ebx+ebx+colorC] - - pand mm0, mm1 - pxor mm1, mm1 - pand mm0, mm2 - pcmpeqw mm3, mm1 - pand mm0, mm3 ;result in mm0 - - ;if ((colorA == colorC) && (colorB != colorE) && (colorA == colorF) && (colorB == colorJ) - movq mm4, [eax+ebx+colorA] ;mm4 and mm5 contain colorA - movq mm6, [eax+ebx+colorB] ;mm6 and mm7 contain colorB - movq mm5, mm4 - movq mm7, mm6 - - pcmpeqw mm4, [eax+ebx+ebx+colorC] - pcmpeqw mm5, [eax+colorF] - pcmpeqw mm6, [eax+colorJ] - pcmpeqw mm7, [eax+colorE] - - pand mm4, mm5 - pxor mm5, mm5 - pand mm4, mm6 - pcmpeqw mm7, mm5 - pand mm4, mm7 ;result in mm4 - - por mm0, mm4 ;combine the masks - movq [Mask1], mm0 - - ;-------------------------------------------- - -;2 - ;if ((colorB == colorC) && (colorA != colorD) && (colorB == colorF) && (colorA == colorH) - movq mm0, [eax+ebx+colorB] ;mm0 and mm1 contain colorB - movq mm2, [eax+ebx+colorA] ;mm2 and mm3 contain colorA - movq mm1, mm0 - movq mm3, mm2 - - pcmpeqw mm0, [eax+ebx+ebx+colorC] - pcmpeqw mm1, [eax+colorF] - pcmpeqw mm2, [eax+ebx+ebx+colorH] - pcmpeqw mm3, [eax+ebx+ebx+colorD] - - pand mm0, mm1 - pxor mm1, mm1 - pand mm0, mm2 - pcmpeqw mm3, mm1 - pand mm0, mm3 ;result in mm0 - - ;if ((colorB == colorE) && (colorB == colorD) && (colorA != colorF) && (colorA == colorI) - movq mm4, [eax+ebx+colorB] ;mm4 and mm5 contain colorB - movq mm6, [eax+ebx+colorA] ;mm6 and mm7 contain colorA - movq mm5, mm4 - movq mm7, mm6 - - pcmpeqw mm4, [eax+ebx+ebx+colorD] - pcmpeqw mm5, [eax+colorE] - pcmpeqw mm6, [eax+colorI] - pcmpeqw mm7, [eax+colorF] - - pand mm4, mm5 - pxor mm5, mm5 - pand mm4, mm6 - pcmpeqw mm7, mm5 - pand mm4, mm7 ;result in mm4 - - por mm0, mm4 ;combine the masks - movq [Mask2], mm0 - - -;interpolate colorA and colorB - movq mm0, [eax+ebx+colorA] - movq mm1, [eax+ebx+colorB] - - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 ;mm0 contains the interpolated values - - ;assemble the pixels - movq mm1, [eax+ebx+colorA] - movq mm2, [eax+ebx+colorB] - - movq mm3, [Mask1] - movq mm5, mm1 - movq mm4, [Mask2] - movq mm6, mm1 - - pand mm1, mm3 - por mm3, mm4 - pxor mm7, mm7 - pand mm2, mm4 - - pcmpeqw mm3, mm7 - por mm1, mm2 - pand mm0, mm3 - - por mm0, mm1 - - punpcklwd mm5, mm0 - punpckhwd mm6, mm0 - -%ifdef __DJGPP__ - movq [fs:edx], mm5 - movq [fs:edx+8], mm6 -%else - movq [es:edx], mm5 - movq [es:edx+8], mm6 -%endif - -;------------------------------------------------ -; Create the Nextline -;------------------------------------------------ -;3 ;if ((colorA == colorD) && (colorB != colorC) && (colorA == colorG) && (colorC == colorO) - movq mm0, [eax+ebx+colorA] ;mm0 and mm1 contain colorA - movq mm2, [eax+ebx+ebx+colorC] ;mm2 and mm3 contain colorC - movq mm1, mm0 - movq mm3, mm2 - - push eax - add eax, ebx - pcmpeqw mm0, [eax+ebx+colorD] - pcmpeqw mm1, [eax+colorG] - pcmpeqw mm2, [eax+ebx+ebx+colorO] - pcmpeqw mm3, [eax+colorB] - pop eax - - pand mm0, mm1 - pxor mm1, mm1 - pand mm0, mm2 - pcmpeqw mm3, mm1 - pand mm0, mm3 ;result in mm0 - - ;if ((colorA == colorB) && (colorG != colorC) && (colorA == colorH) && (colorC == colorM) - movq mm4, [eax+ebx+colorA] ;mm4 and mm5 contain colorA - movq mm6, [eax+ebx+ebx+colorC] ;mm6 and mm7 contain colorC - movq mm5, mm4 - movq mm7, mm6 - - push eax - add eax, ebx - pcmpeqw mm4, [eax+ebx+colorH] - pcmpeqw mm5, [eax+colorB] - pcmpeqw mm6, [eax+ebx+ebx+colorM] - pcmpeqw mm7, [eax+colorG] - pop eax - - pand mm4, mm5 - pxor mm5, mm5 - pand mm4, mm6 - pcmpeqw mm7, mm5 - pand mm4, mm7 ;result in mm4 - - por mm0, mm4 ;combine the masks - movq [Mask1], mm0 - ;-------------------------------------------- - -;4 - ;if ((colorB == colorC) && (colorA != colorD) && (colorC == colorH) && (colorA == colorF) - movq mm0, [eax+ebx+ebx+colorC] ;mm0 and mm1 contain colorC - movq mm2, [eax+ebx+colorA] ;mm2 and mm3 contain colorA - movq mm1, mm0 - movq mm3, mm2 - - pcmpeqw mm0, [eax+ebx+colorB] - pcmpeqw mm1, [eax+ebx+ebx+colorH] - pcmpeqw mm2, [eax+colorF] - pcmpeqw mm3, [eax+ebx+ebx+colorD] - - pand mm0, mm1 - pxor mm1, mm1 - pand mm0, mm2 - pcmpeqw mm3, mm1 - pand mm0, mm3 ;result in mm0 - - ;if ((colorC == colorG) && (colorC == colorD) && (colorA != colorH) && (colorA == colorI) - movq mm4, [eax+ebx+ebx+colorC] ;mm4 and mm5 contain colorC - movq mm6, [eax+ebx+colorA] ;mm6 and mm7 contain colorA - movq mm5, mm4 - movq mm7, mm6 - - pcmpeqw mm4, [eax+ebx+ebx+colorD] - pcmpeqw mm5, [eax+ebx+colorG] - pcmpeqw mm6, [eax+colorI] - pcmpeqw mm7, [eax+ebx+ebx+colorH] - - pand mm4, mm5 - pxor mm5, mm5 - pand mm4, mm6 - pcmpeqw mm7, mm5 - pand mm4, mm7 ;result in mm4 - - por mm0, mm4 ;combine the masks - movq [Mask2], mm0 - ;---------------------------------------------- - -;interpolate colorA and colorC - movq mm0, [eax+ebx+colorA] - movq mm1, [eax+ebx+ebx+colorC] - - movq mm2, mm0 - movq mm3, mm1 - - pand mm0, [colorMask] - pand mm1, [colorMask] - - psrlw mm0, 1 - psrlw mm1, 1 - - pand mm3, [lowPixelMask] - paddw mm0, mm1 - - pand mm3, mm2 - paddw mm0, mm3 ;mm0 contains the interpolated values - ;------------- - - ;assemble the pixels - movq mm1, [eax+ebx+colorA] - movq mm2, [eax+ebx+ebx+colorC] - - movq mm3, [Mask1] - movq mm4, [Mask2] - - pand mm1, mm3 - pand mm2, mm4 - - por mm3, mm4 - pxor mm7, mm7 - por mm1, mm2 - - pcmpeqw mm3, mm7 - pand mm0, mm3 - por mm0, mm1 - movq [ACPixel], mm0 - -;//////////////////////////////// -; Decide which "branch" to take -;-------------------------------- - movq mm0, [eax+ebx+colorA] - movq mm1, [eax+ebx+colorB] - movq mm6, mm0 - movq mm7, mm1 - pcmpeqw mm0, [eax+ebx+ebx+colorD] - pcmpeqw mm1, [eax+ebx+ebx+colorC] - pcmpeqw mm6, mm7 - - movq mm2, mm0 - movq mm3, mm0 - - pand mm0, mm1 ;colorA == colorD && colorB == colorC - pxor mm7, mm7 - - pcmpeqw mm2, mm7 - pand mm6, mm0 - pand mm2, mm1 ;colorA != colorD && colorB == colorC - - pcmpeqw mm1, mm7 - - pand mm1, mm3 ;colorA == colorD && colorB != colorC - pxor mm0, mm6 - por mm1, mm6 - movq mm7, mm0 - movq [Mask2], mm2 - packsswb mm7, mm7 - movq [Mask1], mm1 - - movd ecx, mm7 - test ecx, ecx - jz near .SKIP_GUESS -;--------------------------------------------- -; Map of the pixels: I|E F|J -; G|A B|K -; H|C D|L -; M|N O|P - movq mm6, mm0 - movq mm4, [eax+ebx+colorA] - movq mm5, [eax+ebx+colorB] - pxor mm7, mm7 - pand mm6, [ONE] - - movq mm0, [eax+colorE] - movq mm1, [eax+ebx+colorG] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - movq mm0, [eax+colorF] - movq mm1, [eax+ebx+colorK] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - push eax - add eax, ebx - movq mm0, [eax+ebx+colorH] - movq mm1, [eax+ebx+ebx+colorN] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - movq mm0, [eax+ebx+colorL] - movq mm1, [eax+ebx+ebx+colorO] - movq mm2, mm0 - movq mm3, mm1 - pcmpeqw mm0, mm4 - pcmpeqw mm1, mm4 - pcmpeqw mm2, mm5 - pcmpeqw mm3, mm5 - pand mm0, mm6 - pand mm1, mm6 - pand mm2, mm6 - pand mm3, mm6 - paddw mm0, mm1 - paddw mm2, mm3 - - pxor mm3, mm3 - pcmpgtw mm0, mm6 - pcmpgtw mm2, mm6 - pcmpeqw mm0, mm3 - pcmpeqw mm2, mm3 - pand mm0, mm6 - pand mm2, mm6 - paddw mm7, mm0 - psubw mm7, mm2 - - pop eax - movq mm1, mm7 - pxor mm0, mm0 - pcmpgtw mm7, mm0 - pcmpgtw mm0, mm1 - - por mm7, [Mask1] - por mm1, [Mask2] - movq [Mask1], mm7 - movq [Mask2], mm1 - -.SKIP_GUESS: - ;---------------------------- - ;interpolate A, B, C and D - movq mm0, [eax+ebx+colorA] - movq mm1, [eax+ebx+colorB] - movq mm4, mm0 - movq mm2, [eax+ebx+ebx+colorC] - movq mm5, mm1 - movq mm3, [qcolorMask] - movq mm6, mm2 - movq mm7, [qlowpixelMask] - - pand mm0, mm3 - pand mm1, mm3 - pand mm2, mm3 - pand mm3, [eax+ebx+ebx+colorD] - - psrlw mm0, 2 - pand mm4, mm7 - psrlw mm1, 2 - pand mm5, mm7 - psrlw mm2, 2 - pand mm6, mm7 - psrlw mm3, 2 - pand mm7, [eax+ebx+ebx+colorD] - - paddw mm0, mm1 - paddw mm2, mm3 - - paddw mm4, mm5 - paddw mm6, mm7 - - paddw mm4, mm6 - paddw mm0, mm2 - psrlw mm4, 2 - pand mm4, [qlowpixelMask] - paddw mm0, mm4 ;mm0 contains the interpolated value of A, B, C and D - -;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - ;assemble the pixels - movq mm1, [Mask1] - movq mm2, [Mask2] - movq mm4, [eax+ebx+colorA] - movq mm5, [eax+ebx+colorB] - pand mm4, mm1 - pand mm5, mm2 - - pxor mm7, mm7 - por mm1, mm2 - por mm4, mm5 - pcmpeqw mm1, mm7 - pand mm0, mm1 - por mm4, mm0 ;mm4 contains the diagonal pixels - - movq mm0, [ACPixel] - movq mm1, mm0 - punpcklwd mm0, mm4 - punpckhwd mm1, mm4 - - push edx - add edx, [ebp+dstPitch] - -%ifdef __DJGPP__ - movq [fs:edx], mm0 - movq [fs:edx+8], mm1 -%else - movq [es:edx], mm0 - movq [es:edx+8], mm1 -%endif - pop edx - -.SKIP_PROCESS: - mov ecx, [ebp+deltaPtr] - add ecx, 8 - mov [ebp+deltaPtr], ecx - add edx, 16 - add eax, 8 - - pop ecx - sub ecx, 4 - cmp ecx, 0 - jg near .Loop - -; Restore some stuff - popad - mov esp, ebp - pop ebp - emms - ret - -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- - -Init_2xSaIMMX: -_Init_2xSaIMMX: -; Store some stuff - push ebp - mov ebp, esp - push edx - - -;Damn thing doesn't work -; mov eax,1 -; cpuid -; test edx, 0x00800000 ;test bit 23 -; jz end2 ;bit not set => no MMX detected - - mov eax, [ebp+8] ;PixelFormat - cmp eax, 555 - jz Bits555 - cmp eax, 565 - jz Bits565 -end2: - mov eax, 1 - jmp end -Bits555: - mov edx, 0x7BDE7BDE - mov eax, colorMask - mov [eax], edx - mov [eax+4], edx - mov edx, 0x04210421 - mov eax, lowPixelMask - mov [eax], edx - mov [eax+4], edx - mov edx, 0x739C739C - mov eax, qcolorMask - mov [eax], edx - mov [eax+4], edx - mov edx, 0x0C630C63 - mov eax, qlowpixelMask - mov [eax], edx - mov [eax+4], edx - mov eax, 0 - jmp end -Bits565: - mov edx, 0xF7DEF7DE - mov eax, colorMask - mov [eax], edx - mov [eax+4], edx - mov edx, 0x08210821 - mov eax, lowPixelMask - mov [eax], edx - mov [eax+4], edx - mov edx, 0xE79CE79C - mov eax, qcolorMask - mov [eax], edx - mov [eax+4], edx - mov edx, 0x18631863 - mov eax, qlowpixelMask - mov [eax], edx - mov [eax+4], edx - mov eax, 0 - jmp end -end: - pop edx - mov esp, ebp - pop ebp - ret - - -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- -;------------------------------------------------------------------------- - - SECTION .data ALIGN = 32 -;Some constants -colorMask dd 0xF7DEF7DE, 0xF7DEF7DE -lowPixelMask dd 0x08210821, 0x08210821 - -qcolorMask dd 0xE79CE79C, 0xE79CE79C -qlowpixelMask dd 0x18631863, 0x18631863 - -FALSE dd 0x00000000, 0x00000000 -TRUE dd 0xffffffff, 0xffffffff -ONE dd 0x00010001, 0x00010001 - - - SECTION .bss ALIGN = 32 -ACPixel resb 8 -Mask1 resb 8 -Mask2 resb 8 - -I56Pixel resb 8 -I23Pixel resb 8 -I5556Pixel resb 8 -I2223Pixel resb 8 -I5666Pixel resb 8 -I2333Pixel resb 8 -Mask26 resb 8 -Mask35 resb 8 -Mask26b resb 8 -Mask35b resb 8 -product1a resb 8 -product1b resb 8 -product2a resb 8 -product2b resb 8 -final1a resb 8 -final1b resb 8 -final2a resb 8 -final2b resb 8 - - - diff --git a/jan/src/intf/video/scalers/ddt3x.cpp b/jan/src/intf/video/scalers/ddt3x.cpp deleted file mode 100644 index 98f42de41..000000000 --- a/jan/src/intf/video/scalers/ddt3x.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* - Hyllian's Data Dependent Triangulation 3x - - Copyright (C) 2011, 2012 Hyllian/Jararaca - sergiogdb@gmail.com - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#include - -extern "C" -{ - static unsigned char initialized = 0; -// unsigned int RGBtoYUV[65536]; -// static unsigned int tbl_5_to_8[32]={0, 8, 16, 25, 33, 41, 49, 58, 66, 74, 82, 90, 99, 107, 115, 123, 132, 140, 148, 156, 165, 173, 181, 189, 197, 206, 214, 222, 230, 239, 247, 255}; -// static unsigned int tbl_6_to_8[64]={0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255}; -} - -unsigned short int ddt_red_blue_mask; -unsigned short int ddt_green_mask; - -#define RED_BLUE_MASK565 0xF81F -#define RED_MASK565 0xF800 -#define GREEN_MASK565 0x07E0 - -#define RGB_MASK 0x07E0F81F - - -#define ALPHA_BLEND_X_W(dst, src, alpha) \ - ts = src; td = dst;\ - td = ((td|(td<<16)) & RGB_MASK); ts = ((ts|(ts<<16)) & RGB_MASK);\ - td = ((( ( (ts-td)*alpha ) >> 5 ) + td ) & RGB_MASK); \ - dst= (td|(td>>16));\ - - -#define BIL3X(PF, PH, PI, N5, N7, N8) \ - ALPHA_BLEND_X_W(E[N5], PF, 5); \ - ALPHA_BLEND_X_W(E[N7], PH, 5); \ - ALPHA_BLEND_X_W(E[N8], PF, 9); \ - ALPHA_BLEND_X_W(E[N8], PH, 7); \ - ALPHA_BLEND_X_W(E[N8], PI, 3); \ - - -#define DDT3X_BC(PF, PH, PI, N5, N7, N8) \ - ALPHA_BLEND_X_W(E[N5], PF, 6); \ - ALPHA_BLEND_X_W(E[N7], PH, 6); \ - ALPHA_BLEND_X_W(E[N8], PI, 12); \ - - -#define DDT3X_D(PF, PH, N5, N7, N8) \ - ALPHA_BLEND_X_W(E[N5], PF, 6); \ - ALPHA_BLEND_X_W(E[N7], PH, 6); \ - ALPHA_BLEND_X_W(E[N8], PF, 12); \ - ALPHA_BLEND_X_W(E[N8], PH, 12); \ - - -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, N0, N1, N2, N3, N4, N5, N6, N7, N8) \ -{\ - if (PE!=PF || PE!=PH || PE!=PI) \ - {\ - ad = abs(PE-PI); bc = abs(PF-PH);\ - if (ad < bc)\ - {\ - DDT3X_BC(PF, PH, PI, N5, N7, N8);\ - }\ - else if (ad > bc)\ - {\ - DDT3X_D(PF, PH, N5, N7, N8);\ - }\ - else\ - {\ - BIL3X(PF, PH, PI, N5, N7, N8) \ - }\ - }\ -}\ - - -void ddt3x(unsigned char * src, unsigned int srcPitch, - unsigned char * dest, unsigned int dstPitch, - int Xres, int Yres) -{ - unsigned short int x, y; - unsigned short int PA, PB, PC, PD, PE, PF, PG, PH, PI; - register unsigned short int *sa1, *sa2, *sa3; // sa = start_address - unsigned short int nl, nl_src; // nl = new_line - unsigned short int nl1; - unsigned short int *E; // E = dst_pixel - unsigned short int src_width = (unsigned short int)Xres; - unsigned short int src_height = (unsigned short int)Yres; - unsigned short int dst_width = src_width * 3; -// unsigned short int dst_height = src_height * 3; - unsigned short int complete_line_src, complete_line_dst; - unsigned short int src_pitch = (unsigned short int)srcPitch; - unsigned char pprev; - unsigned int ad, bc; - unsigned int td, ts; - - if (!initialized) - { - ddt_red_blue_mask = RED_BLUE_MASK565; - ddt_green_mask = GREEN_MASK565; - - initialized = 1; - } - - nl_src = src_pitch >> 1; - nl = (unsigned short int)dstPitch >> 1; - nl1= (unsigned short int)dstPitch; - - // fixed by Steve Snake - complete_line_src = (src_pitch>>1) - src_width; - complete_line_dst = ((dstPitch*3)>>1) - dst_width; - - sa2 = (unsigned short int *)(src - 4); - sa1 = sa2; - sa3 = sa2 + src_pitch; - - E = (unsigned short int *)(dest); - - y = src_height; - - while(y--) - { - if (!y) sa3 = sa2; - pprev = 2; - x = src_width; - - while(x--) - { - PB = sa1[2]; - PE = sa2[2]; - PH = sa3[2]; - - PA = sa1[pprev]; - PD = sa2[pprev]; - PG = sa3[pprev]; - - PC = sa1[3]; - PF = sa2[3]; - PI = sa3[3]; - - if (!x) - { - PC = sa1[2]; - PF = sa2[2]; - PI = sa3[2]; - } - - E[0] = E[1] = E[2] = PE; - E[nl] = E[nl+1] = E[nl+2] = PE; // 3, 4, 5 - E[nl1] = E[nl1+1] = E[nl1+2] = PE; // 6, 7, 8 - -if (PE!=PH || PE!=PI || PE!=PF || PE!=PC || PE!=PB || PE!=PA || PE!=PD || PE!=PG) -{ - -FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, 0, 1, 2, nl, nl+1, nl+2, nl1, nl1+1, nl1+2); -FILTRO(PE, PC, PF, PB, PI, PA, PH, PD, PG, nl1, nl, 0, nl1+1, nl+1, 1, nl1+2, nl+2, 2); -FILTRO(PE, PA, PB, PD, PC, PG, PF, PH, PI, nl1+2, nl1+1, nl1, nl+2, nl+1, nl, 2, 1, 0); -FILTRO(PE, PG, PD, PH, PA, PI, PB, PF, PC, 2, nl+2, nl1+2, 1, nl+1, nl1+1, 0, nl, nl1); - -} - sa1++; - sa2++; - sa3++; - - E+=3; - - pprev = 1; - } - - sa2 += complete_line_src; - sa1 = sa2 - nl_src; - sa3 = sa2 + nl_src; - - E += complete_line_dst; - } -} diff --git a/jan/src/intf/video/scalers/eagle_fm.asm b/jan/src/intf/video/scalers/eagle_fm.asm deleted file mode 100644 index 4dc98775d..000000000 --- a/jan/src/intf/video/scalers/eagle_fm.asm +++ /dev/null @@ -1,462 +0,0 @@ -; -; Eagle.asm -; -; Eagle version 0.41 for NASM -; -; Written by Dirk Stevens -; -; compile with : nasm -f coff eagle.asm for use with DJGPP -; Using optimization with DJGPP and coff objects could result in -; erronous behaviour! -; -; History : -; Date Version Comments -; -; 30-Sep-1998 0.41 - Minor modification in 16bit MMX code -; -; 20-Jun-1998 0.40 -Added 16bit color support for MMX -; -Incorporated Larry Bank's suggestions -; -; 29-March-1998 0.31 -eagle_bmp for use in plain bmps -; -; 28-March-1998 0.30 -Handle buffer internally -; -Added optimised MMX copying (fast!) -; -Everything is done in one routine -; -; 15-March-1998 0.20 -First NASM version -; -Added parameter for Eagle_Lines -; -Added support for MMX -; -Optimised further for non-MMX -; -;------------------------------------------------------------ - -; -; This 16-bit MMX Eagle implementation uses a flat memory map -; -;------------------------------------------------------------ - - BITS 32 - GLOBAL _eagle_mmx16 - GLOBAL __eagle_mmx16 - SECTION .text - -; -; Eagle for 16bit color -; Supported for MMX *only* -; - -_eagle_mmx16: -__eagle_mmx16: - -; void eagle_mmx16(unsigned long *lb, -; unsigned long *lb2, -; short width, -; unsigned long *screen_address1, -; unsigned long *screen_address2); - - pushad - - push ebp - - mov esi,[esp+8+32] - mov ebx,[esp+12+32] - mov ecx,[esp+16+32] - mov edi, _eagle_buffer - mov eax, _eagle_buffer+4096 - and edi, 0xFFFFFFE0 - and eax, 0xFFFFFFE0 - - - mov ebp, ebx - - shr ecx, 3 ; divide by 8 because mmx registers / 16 bit color - - xor dx,dx - -.L0 - push ecx - xchg eax,ecx - - movq mm1,[ebp] - movq mm0,[esi] - add ebp,8 - add esi,8 - - ; added for mmx16 - - push ebp - push ecx - mov ebp, ecx - - mov word cx, [_dlx] - - ; end of added - - movd eax, mm0 - movd ebx, mm1 - -; cmp dhx, bx - cmp dx, bx - jne .L6001 -.L1001 - cmp bx, ax - jne .L3001 -.L2001 - mov [edi],ax -; mov [ecx],dhx - mov [ebp],dx - mov [edi+2],ax - mov [ebp+2],bx - jmp .L11 -.L3001 -; cmp dhx, dlx - cmp dx, cx - jne .L5001 -.L4001 -; mov [edi],dx ; mmmh -; mov [ecx],dx ; mmmh -; mov [edi],dl -; mov [ecx],dl -; mov [edi+1],dh -; mov [ecx+1],dh - mov [edi],cx - mov [ebp],cx - mov [edi+2],dx - mov [ebp+2],dx - - jmp .L11 -.L5001 - mov [edi],cx -; mov [ecx],dhx - mov [ebp],dx - mov [edi+2],ax - mov [ebp+2],bx - jmp .L11 -.L6001 -; cmp dlx, ax - cmp cx, ax - jne .L12001 -.L7001 -; cmp dlx, dhx - cmp cx, dx - jne .L9001 -.L8001 -; mov [edi],dx ; mmmh -; mov [ecx],dx ; mmmh -; mov [edi],dl -; mov [ecx],dl -; mov [edi+1],dh -; mov [ecx+1],dh -; mov [edi],dlx -; mov [ecx],dlx - mov [edi],cx - mov [ebp],cx -; mov [edi+2],dhx -; mov [ecx+2],dhx - mov [edi+2],dx - mov [ebp+2],dx - - jmp .L11 -.L9001 - cmp ax,bx - jne .L11001 -.L10001 -; mov [edi],dlx - mov [edi],cx - mov [ebp],bx - mov [edi+2],ax - mov [ebp+2],bx - jmp .L11 -.L11001 -.L12001 -; mov [edi],dlx -; mov [ecx],dhx - mov [edi],cx - mov [ebp],dx - mov [edi+2],ax - mov [ebp+2],bx - -.L11 - - movq mm4, mm1 - - movq mm2, mm0 - - pcmpeqd mm7, mm7 ; set mm7 to FFFFFFFFFFFFFFFF - - ;pcmpeqb mm4, mm0 ; byte compare equal mm0 with mm1 and store in mm4 - pcmpeqw mm4, mm0 ; word compare equal mm0 with mm1 and store in mm4 - - ;psllq mm2, 8 ; shift mm0 left one byte and store in mm2 - psllq mm2, 16 ; shift mm0 left one word and store in mm2 - - movq mm3, mm0 - - movq mm5, mm4 ; store byte compare mm0 with mm1 in mm5 - - ;pcmpeqb mm2, mm0 ; byte compare mm0 with mm2 and store in mm2 - pcmpeqw mm2, mm0 ; word compare mm0 with mm2 and store in mm2 - - ;psrlq mm3, 8 ; shift mm0 right one byte and store in mm3 - psrlq mm3, 16 ; shift mm0 right one word and store in mm3 - - pand mm2, mm5 - - movq mm6, mm1 ; and mm5 with mm1 - - movq mm5, mm2 ; not mm2 and store in mm5 - - pxor mm5, mm7 - -; psllq mm6, 8 - psllq mm6, 16 - - pand mm2, mm0 ; and mm0 with mm2 - - pand mm5, mm6 - - por mm2, mm5 ; mm2 now contains right-bottom of quad - - ;pcmpeqb mm3, mm0 ; byte compare mm3 with mm0 and store in mm3 - pcmpeqw mm3, mm0 ; word compare mm3 with mm0 and store in mm3 - - movq mm5, mm4 ; word compare of mm0 with mm1 store in mm5 - - pand mm3, mm4 - - movq mm5, mm3 ; not mm3 store in mm5 - - movq mm6, mm1 - - pxor mm5, mm7 - - pand mm3, mm0 - - ;psrlq mm6, 8 - psrlq mm6, 16 - - pand mm5, mm6 - - ;psrlq mm2, 8 - psrlq mm2, 16 - - por mm3, mm5 - -; now write the 16 bytes of the bottom line - - movq mm4, mm2 - - movq mm6, mm2 - -; punpcklbw mm4, mm3 - -; punpckhbw mm6, mm3 - - punpcklwd mm4, mm3 - - punpckhwd mm6, mm3 - -; movq [ecx+2],mm4 - movq [ebp+4],mm4 - -; movq [ecx+10],mm6 - movq [ebp+12],mm6 - - -; start with top line - - movq mm2, mm1 - movq mm3, mm1 - movq mm4, mm0 - - pcmpeqd mm7, mm7 ; set mm7 to FFFFFFFFFFFFFFFF - - ;pcmpeqb mm4, mm1 ; byte compare equal mm0 with mm1 and store in mm4 - pcmpeqw mm4, mm1 ; word compare equal mm0 with mm1 and store in mm4 - - ;psllq mm2, 8 ; shift mm0 left one byte and store in mm2 - psllq mm2, 16 ; shift mm0 left one word and store in mm2 - - ;psrlq mm3, 8 ; shift mm0 right one byte and store in mm3 - psrlq mm3, 16 ; shift mm0 right one word and store in mm3 - - movq mm5, mm4 ; store byte compare mm0 with mm1 in mm5 - - ;pcmpeqb mm2, mm1 ; byte compare mm0 with mm2 and store in mm2 - pcmpeqw mm2, mm1 ; word compare mm0 with mm2 and store in mm2 - - pand mm2, mm5 - - movq mm5, mm2 ; not mm2 and store in mm5 - pxor mm5, mm7 - - pand mm2, mm1 ; and mm0 with mm2 - - movq mm6, mm0 ; and mm5 with mm1 - ;psllq mm6, 8 - psllq mm6, 16 - pand mm5, mm6 - - por mm2, mm5 ; mm2 now contains right-bottom of quad - - - movq mm5, mm4 ; byte compare of mm0 with mm1 store in mm5 - - ;pcmpeqb mm3, mm1 ; byte compare mm3 with mm0 and store in mm3 - pcmpeqw mm3, mm1 ; word compare mm3 with mm0 and store in mm3 - - pand mm3, mm5 - - movq mm5, mm3 ; not mm3 store in mm5 - pxor mm5, mm7 - - pand mm3, mm1 - - movq mm6, mm0 - ;psrlq mm6, 8 - psrlq mm6, 16 - pand mm5, mm6 - - por mm3, mm5 - -; now write the 16 bytes of the top line - - ;psrlq mm2, 8 - psrlq mm2, 16 - - movq mm4, mm2 - - movq mm6, mm2 - -; punpcklbw mm4, mm3 - -; punpckhbw mm6, mm3 - - punpcklwd mm4, mm3 - - punpckhwd mm6, mm3 - -; movq [edi+2],mm4 - movq [edi+4],mm4 -; psrlq mm0, 56 ; 64-8 = 56 - psrlq mm0, 48 ; 64-16 = 48 -; movq [edi+10],mm6 - movq [edi+12],mm6 - ;psrlq mm1, 56 - psrlq mm1, 48 - - -; -; restore ebp and ecx -; - - pop ecx - pop ebp - -; -; End of restore -; - - add edi, 16 - add ecx, 16 - - movd edx, mm0 - mov word [_dlx], dx - movd ebx, mm1 - mov dx, bx - - pop eax - xchg eax,ecx - - dec ecx - jnz near .L0 - -.L333 - - mov esi, _eagle_buffer - mov ebx, _eagle_buffer+4096 - and esi, 0xFFFFFFE0 - and ebx, 0xFFFFFFE0 - - mov ecx,[esp+16+32] - mov edi,[esp+20+32] - mov eax,[esp+24+32] - - ;shr ecx, 5 - shr ecx, 4 - - push ecx - -.first_loop: - movq mm0, [ esi ] - movq mm1, [ esi + 8 ] - movq mm2, [ esi + 16] - movq mm3, [ esi + 24] - movq mm4, [ esi + 32] - movq mm5, [ esi + 40] - movq mm6, [ esi + 48] - movq mm7, [ esi + 56] - - movq [edi], mm0 - movq [edi + 8], mm1 - movq [edi + 16], mm2 - movq [edi + 24], mm3 - movq [edi + 32], mm4 - movq [edi + 40], mm5 - movq [edi + 48], mm6 - movq [edi + 56], mm7 - - add edi, 64 - add esi, 64 - - dec ecx - jnz .first_loop - - pop ecx - - mov edi, eax - mov esi, ebx - - -.second_loop: - movq mm0, [ esi ] - movq mm1, [ esi + 8 ] - movq mm2, [ esi + 16] - movq mm3, [ esi + 24] - movq mm4, [ esi + 32] - movq mm5, [ esi + 40] - movq mm6, [ esi + 48] - movq mm7, [ esi + 56] - - movq [edi], mm0 - movq [edi + 8], mm1 - movq [edi + 16], mm2 - movq [edi + 24], mm3 - movq [edi + 32], mm4 - movq [edi + 40], mm5 - movq [edi + 48], mm6 - movq [edi + 56], mm7 - - add edi, 64 - add esi, 64 - - dec ecx - jz .continue_here - jmp .second_loop - -.continue_here - pop eax - mov ebp, eax - - popad - - ret - - SECTION .bss -_offset32 resb 32 -_eagle_buffer resb 16384 -_tripline1 resb 8 -_tripline2 resb 8 -_tripline3 resb 8 -_dlx resb 32 - diff --git a/jan/src/intf/video/scalers/epx.cpp b/jan/src/intf/video/scalers/epx.cpp deleted file mode 100644 index a12ac8bff..000000000 --- a/jan/src/intf/video/scalers/epx.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// epxb, epxc filter, added by regret -// source from Snes9X rerecording (http://code.google.com/p/snes9x151-rerecording/) - -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef signed char int8; -typedef short int16; -typedef int int32; -typedef unsigned int uint32; -# ifdef __GNUC__ /* long long is not part of ISO C++ */ -__extension__ -# endif -typedef long long int64; -typedef unsigned long long uint64; - -#define Mask_2 0x07E0 // 00000 111111 00000 -#define Mask13 0xF81F // 11111 000000 11111 -#define Mask_1 0x001F // 00000 000000 11111 -#define Mask_3 0xF800 // 11111 000000 00000 -#define CONVERT_16_TO_32(pixel) \ - (((((pixel) >> 11) ) << /*RedShift+3*/ 19) | \ - ((((pixel) >> 6) & 0x1f) << /*GreenShift+3*/11) | \ - (((pixel) & 0x1f) << /*BlueShift+3*/ 3)) - -#define Interp01(c1, c2) \ - ((((c1) == (c2)) ? (c1) : \ - (((((((c1) & Mask_2) * 3) + ((c2) & Mask_2)) >> 2) & Mask_2) + \ - ((((((c1) & Mask13) * 3) + ((c2) & Mask13)) >> 2) & Mask13)))) - -#ifdef LSB_FIRST - #define TWO_PIX(left,right) ((left) | ((right) << 16)) - #define THREE_PIX(left,middle,right) uint48((left) | ((middle) << 16), (right)) - #define TWO_PIX_32(left,right) (CONVERT_16_TO_32(left) | ((uint64)CONVERT_16_TO_32(right) << 32)) - #define THREE_PIX_32(left,middle,right) uint96(CONVERT_16_TO_32(left) | ((uint64)CONVERT_16_TO_32(middle) << 32), CONVERT_16_TO_32(right)) -#else - #define TWO_PIX(left,right) ((right) | ((left) << 16)) - #define THREE_PIX(left,middle,right) uint48((middle) | ((left) << 16), (right)) // is this right? -// #define THREE_PIX(left,middle,right) uint48((right) | ((middle) << 16), (left)) // or this? -#endif - -// shared EPX-type loop macros -// All of these parameters will be constant values, -// so I hope the compiler is smart enough to optimize away "if(0) ..." - -#define DrawRows(scale,diags) \ - { \ - h = srcHeight - 1; \ - DoRow(0,1,scale,diags); \ - for (h = srcHeight - 2; h; h--) \ - DoRow(1,1,scale,diags); \ - DoRow(1,0,scale,diags); \ - } - -#define DoRow(topValid,botValid,scale,diags) \ - { \ - w = srcWidth - 1; \ - InitLine(topValid,botValid,scale,diags); \ - DrawPix(0,topValid,0,botValid); \ - for (w = srcWidth - 2; w; w--) \ - { \ - NextPixel(topValid,botValid,1,diags); \ - DrawPix(topValid,topValid,botValid,botValid); \ - } \ - NextPixel(topValid,botValid,0,diags); \ - DrawPix(topValid,0,botValid,0); \ - srcPtr += srcPitch; \ - dstPtr += dstPitch * scale; \ - } - -#define InitLine(topValid, botValid, scale, diags) \ - { \ - if(topValid) uP = (uint16 *) (srcPtr - srcPitch); \ - if(botValid) lP = (uint16 *) (srcPtr + srcPitch); \ - sP = (uint16 *) srcPtr; \ - dP1 = (destType *) dstPtr; \ - dP2 = (destType *) (dstPtr + dstPitch); \ - if(scale>=3) dP3 = (destType *) (dstPtr + (dstPitch<<1)); \ - if(topValid) colorD = *uP++; \ - if(botValid) colorB = *lP++; \ - colorX = *sP++; \ - colorC = *sP; \ - if(diags) if(topValid) colorH = *uP; \ - if(diags) if(botValid) colorG = *lP; \ - } - -#define NextPixel(topValid, botValid, rightValid, diags) \ - { \ - colorA = colorX; \ - colorX = colorC; \ - if(rightValid) colorC = *++sP; \ - if(diags) { \ - if(botValid){ \ - colorF = colorB; \ - colorB = colorG; \ - if(rightValid) colorG = *++lP; \ - } \ - if(topValid){ \ - colorE = colorD; \ - colorD = colorH; \ - if(rightValid) colorH = *++uP; \ - } \ - } else { \ - if(botValid) colorB = *lP++; \ - if(topValid) colorD = *uP++; \ - } \ - } - -#define DrawInit(scale,uintDest) \ - uint8 *srcPtr = src, *dstPtr = dst; \ - const uint32 srcPitch = srcpitch, dstPitch = dstpitch; \ - const uint32 srcHeight = nHeight; \ - const uint32 srcWidth = nWidth; \ - uint16 colorX, colorA, colorB, colorC, colorD, colorE=0, colorF=0, colorG=0, colorH=0; \ - uint16 *sP, *uP, *lP; \ - typedef uintDest destType; \ - destType *dP1, *dP2, *dP3=0; \ - int w, h; - -// code for improved 2X EPX, which tends to do better with diagonal edges than regular EPX -void RenderEPXB(unsigned char *src, unsigned int srcpitch, unsigned char *dst, unsigned int dstpitch, int nWidth, int nHeight, int vidDepth) -{ - // E D H - // A X C - // F B G - #define DrawPix(on00,on01,on10,on11) /* on00 on01 */ \ - { /* on10 on11 */ \ - if ((((on00||on10)?colorA:colorX) != ((on01||on11)?colorC:colorX)) \ - && (((on10||on11)?colorB:colorX) != ((on00||on01)?colorD:colorX)) \ - && ((!on00||!on01||!on10|!on11) || \ - ((colorX == colorA) || (colorX == colorB) || (colorX == colorC) || (colorX == colorD) || /* diagonal */ \ - (((colorE != colorG) || (colorX == colorF) || (colorX == colorH)) && /* edge */ \ - ((colorF != colorH) || (colorX == colorE) || (colorX == colorG)))))) /* smoothing */ \ - { \ - *dP1++ = _TWO_PIX((on00 && colorD == colorA && (colorX != colorE || colorX != colorG || colorD != colorH || colorA != colorF)) ? colorD : colorX, \ - (on01 && colorC == colorD && (colorX != colorH || colorX != colorF || colorC != colorG || colorD != colorE)) ? colorC : colorX); \ - *dP2++ = _TWO_PIX((on10 && colorA == colorB && (colorX != colorF || colorX != colorH || colorA != colorE || colorB != colorG)) ? colorA : colorX, \ - (on11 && colorB == colorC && (colorX != colorG || colorX != colorE || colorB != colorF || colorC != colorH)) ? colorB : colorX); \ - } else { \ - *dP1++ = _TWO_PIX(colorX, colorX); \ - *dP2++ = _TWO_PIX(colorX, colorX); \ - } \ - } - - // again, this supports 32-bit or 16-bit rendering - if(vidDepth == 32) - { -#define _TWO_PIX TWO_PIX_32 - DrawInit(2,uint64); - DrawRows(2,1); // 2x scale, and diags is on since we do use all 8 surrounding pixels -#undef _TWO_PIX - } - else - { -#define _TWO_PIX TWO_PIX - DrawInit(2,uint32); - DrawRows(2,1); // 2x scale, and diags is on since we do use all 8 surrounding pixels -#undef _TWO_PIX - } - - #undef DrawPix -} - -#define Interp44(c1, c2, c3, c4) \ - ((((((c1) & Mask_2) * 5 + ((c2) & Mask_2) + ((c3) & Mask_2) + ((c4) & Mask_2)) >> 3) & Mask_2) + \ - (((((c1) & Mask13) * 5 + ((c2) & Mask13) + ((c3) & Mask13) + ((c4) & Mask13)) >> 3) & Mask13)) - -// EPX3 scaled down to 2X -void RenderEPXC(unsigned char *src, unsigned int srcpitch, unsigned char *dst, unsigned int dstpitch, int nWidth, int nHeight, int vidDepth) -{ - // E D H - // A X C - // F B G - #define DrawPix(on00,on01,on10,on11) /* on00 on01 */ \ - { /* on10 on11 */ \ - if ((((on00||on10)?colorA:colorX) != ((on01||on11)?colorC:colorX)) \ - && (((on10||on11)?colorB:colorX) != ((on00||on01)?colorD:colorX))) \ - { \ - const bool XnE = colorX != colorE; \ - const bool XnF = colorX != colorF; \ - const bool XnG = colorX != colorG; \ - const bool XnH = colorX != colorH; \ - const bool DA = on00 && colorD == colorA && (XnE || XnG || colorD != colorH || colorA != colorF); \ - const bool AB = on10 && colorA == colorB && (XnF || XnH || colorA != colorE || colorB != colorG); \ - const bool BC = on11 && colorB == colorC && (XnG || XnE || colorB != colorF || colorC != colorH); \ - const bool CD = on01 && colorC == colorD && (XnH || XnF || colorC != colorG || colorD != colorE); \ - if (!on00||!on01||!on10||!on11 || ((colorA != colorC) && (colorB != colorD) && \ - ((colorX == colorA) || (colorX==colorB) || (colorX==colorC) || (colorX==colorD) || (colorX==colorE) || (colorX==colorF) || (colorX==colorG) || (colorX==colorH)))) \ - { \ - const uint16 colorAA = on00&&on10 && ((DA && XnF) || (AB && XnE)) ? colorA : colorX; \ - const uint16 colorBB = on10&&on11 && ((AB && XnG) || (BC && XnF)) ? colorB : colorX; \ - const uint16 colorCC = on01&&on11 && ((BC && XnH) || (CD && XnG)) ? colorC : colorX; \ - const uint16 colorDD = on00&&on01 && ((CD && XnE) || (DA && XnH)) ? colorD : colorX; \ - *dP1++ = _TWO_PIX(Interp44(on00 && DA ? colorA : colorX, colorDD, colorAA, colorX), Interp44(on01 && CD ? colorC : colorX, colorBB, colorCC, colorX)); \ - *dP2++ = _TWO_PIX(Interp44(on10 && AB ? colorA : colorX, colorAA, colorBB, colorX), Interp44(on11 && BC ? colorC : colorX, colorCC, colorDD, colorX)); \ - } else { \ - *dP1++ = _TWO_PIX(Interp01(colorX, on00 && DA && (colorX!=colorB&&colorX!=colorC) ? colorA : colorX), Interp01(colorX, on01 && CD && (colorX!=colorA&&colorX!=colorB) ? colorC : colorX)); \ - *dP2++ = _TWO_PIX(Interp01(colorX, on10 && AB && (colorX!=colorC&&colorX!=colorD) ? colorA : colorX), Interp01(colorX, on11 && BC && (colorX!=colorD&&colorX!=colorA) ? colorC : colorX)); \ - } \ - } else { \ - *dP1++ = _TWO_PIX(colorX, colorX); \ - *dP2++ = _TWO_PIX(colorX, colorX); \ - } \ - } - - if(vidDepth == 32) - { -#define _TWO_PIX TWO_PIX_32 - DrawInit(2,uint64); - DrawRows(2,1); // 2x scale, and diags is on since we do use all 8 surrounding pixels -#undef _TWO_PIX - } - else - { -#define _TWO_PIX TWO_PIX - DrawInit(2,uint32); - DrawRows(2,1); // 2x scale, and diags is on since we do use all 8 surrounding pixels -#undef _TWO_PIX - } - - #undef DrawPix -} diff --git a/jan/src/intf/video/scalers/hq2x32.asm b/jan/src/intf/video/scalers/hq2x32.asm deleted file mode 100644 index 86070f52f..000000000 --- a/jan/src/intf/video/scalers/hq2x32.asm +++ /dev/null @@ -1,1934 +0,0 @@ -;hq2x filter -;---------------------------------------------------------- -;Copyright (C) 2003 MaxSt ( maxst@hiend3d.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -GLOBAL _hq2x_32 - -EXTERN _LUT16to32 -EXTERN _RGBtoYUV - -SECTION .bss -linesleft resd 1 -xcounter resd 1 -cross resd 1 -nextline resd 1 -prevline resd 1 -w1 resd 1 -w2 resd 1 -w3 resd 1 -w4 resd 1 -w5 resd 1 -w6 resd 1 -w7 resd 1 -w8 resd 1 -w9 resd 1 -c1 resd 1 -c2 resd 1 -c3 resd 1 -c4 resd 1 -c5 resd 1 -c6 resd 1 -c7 resd 1 -c8 resd 1 -c9 resd 1 - -SECTION .data - -reg_blank dd 0,0 -const3 dd 0x00030003,0x00000003 -const5 dd 0x00050005,0x00000005 -const6 dd 0x00060006,0x00000006 -const14 dd 0x000E000E,0x0000000E -threshold dd 0x00300706,0x00000000 - -SECTION .text - -%macro TestDiff 2 - xor ecx,ecx - mov edx,[%1] - cmp edx,[%2] - je %%fin - mov ecx,_RGBtoYUV - movd mm1,[ecx+edx*4] - movq mm5,mm1 - mov edx,[%2] - movd mm2,[ecx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd ecx,mm1 -%%fin: -%endmacro - -%macro DiffOrNot 4 - TestDiff %1,%2 - test ecx,ecx - jz %%same - %3 - jmp %%fin -%%same: - %4 -%%fin -%endmacro - -%macro DiffOrNot 6 - TestDiff %1,%2 - test ecx,ecx - jz %%same - %3 - %4 - jmp %%fin -%%same: - %5 - %6 -%%fin -%endmacro - -%macro DiffOrNot 8 - TestDiff %1,%2 - test ecx,ecx - jz %%same - %3 - %4 - %5 - jmp %%fin -%%same: - %6 - %7 - %8 -%%fin -%endmacro - -%macro DiffOrNot 10 - TestDiff %1,%2 - test ecx,ecx - jz %%same - %3 - %4 - %5 - %6 - jmp %%fin -%%same: - %7 - %8 - %9 - %10 -%%fin -%endmacro - -%macro Interp1 3 - mov edx,%2 - shl edx,2 - add edx,%3 - sub edx,%2 - shr edx,2 - mov %1,edx -%endmacro - -%macro Interp2 4 - mov edx,%2 - shl edx,1 - add edx,%3 - add edx,%4 - shr edx,2 - mov %1,edx -%endmacro - -%macro Interp5 3 - mov edx,%2 - add edx,%3 - shr edx,1 - mov %1,edx -%endmacro - -%macro Interp6 3 - movd mm1, eax - movd mm2, %2 - movd mm3, %3 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - punpcklbw mm3, [reg_blank] - pmullw mm1, [const5] - psllw mm2, 1 - paddw mm1, mm3 - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro Interp7 3 - movd mm1, eax - movd mm2, %2 - movd mm3, %3 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - punpcklbw mm3, [reg_blank] - pmullw mm1, [const6] - paddw mm2, mm3 - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro Interp9 3 - movd mm1, eax - movd mm2, %2 - movd mm3, %3 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - punpcklbw mm3, [reg_blank] - psllw mm1, 1 - paddw mm2, mm3 - pmullw mm2, [const3] - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro Interp10 3 - movd mm1, eax - movd mm2, %2 - movd mm3, %3 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - punpcklbw mm3, [reg_blank] - pmullw mm1, [const14] - paddw mm2, mm3 - paddw mm1, mm2 - psrlw mm1, 4 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro PIXEL00_0 0 - mov [edi],eax -%endmacro - -%macro PIXEL00_10 0 - Interp1 [edi],eax,[c1] -%endmacro - -%macro PIXEL00_11 0 - Interp1 [edi],eax,[c4] -%endmacro - -%macro PIXEL00_12 0 - Interp1 [edi],eax,[c2] -%endmacro - -%macro PIXEL00_20 0 - Interp2 [edi],eax,[c4],[c2] -%endmacro - -%macro PIXEL00_21 0 - Interp2 [edi],eax,[c1],[c2] -%endmacro - -%macro PIXEL00_22 0 - Interp2 [edi],eax,[c1],[c4] -%endmacro - -%macro PIXEL00_60 0 - Interp6 [edi],[c2],[c4] -%endmacro - -%macro PIXEL00_61 0 - Interp6 [edi],[c4],[c2] -%endmacro - -%macro PIXEL00_70 0 - Interp7 [edi],[c4],[c2] -%endmacro - -%macro PIXEL00_90 0 - Interp9 [edi],[c4],[c2] -%endmacro - -%macro PIXEL00_100 0 - Interp10 [edi],[c4],[c2] -%endmacro - -%macro PIXEL01_0 0 - mov [edi+4],eax -%endmacro - -%macro PIXEL01_10 0 - Interp1 [edi+4],eax,[c3] -%endmacro - -%macro PIXEL01_11 0 - Interp1 [edi+4],eax,[c2] -%endmacro - -%macro PIXEL01_12 0 - Interp1 [edi+4],eax,[c6] -%endmacro - -%macro PIXEL01_20 0 - Interp2 [edi+4],eax,[c2],[c6] -%endmacro - -%macro PIXEL01_21 0 - Interp2 [edi+4],eax,[c3],[c6] -%endmacro - -%macro PIXEL01_22 0 - Interp2 [edi+4],eax,[c3],[c2] -%endmacro - -%macro PIXEL01_60 0 - Interp6 [edi+4],[c6],[c2] -%endmacro - -%macro PIXEL01_61 0 - Interp6 [edi+4],[c2],[c6] -%endmacro - -%macro PIXEL01_70 0 - Interp7 [edi+4],[c2],[c6] -%endmacro - -%macro PIXEL01_90 0 - Interp9 [edi+4],[c2],[c6] -%endmacro - -%macro PIXEL01_100 0 - Interp10 [edi+4],[c2],[c6] -%endmacro - -%macro PIXEL10_0 0 - mov [edi+ebx],eax -%endmacro - -%macro PIXEL10_10 0 - Interp1 [edi+ebx],eax,[c7] -%endmacro - -%macro PIXEL10_11 0 - Interp1 [edi+ebx],eax,[c8] -%endmacro - -%macro PIXEL10_12 0 - Interp1 [edi+ebx],eax,[c4] -%endmacro - -%macro PIXEL10_20 0 - Interp2 [edi+ebx],eax,[c8],[c4] -%endmacro - -%macro PIXEL10_21 0 - Interp2 [edi+ebx],eax,[c7],[c4] -%endmacro - -%macro PIXEL10_22 0 - Interp2 [edi+ebx],eax,[c7],[c8] -%endmacro - -%macro PIXEL10_60 0 - Interp6 [edi+ebx],[c4],[c8] -%endmacro - -%macro PIXEL10_61 0 - Interp6 [edi+ebx],[c8],[c4] -%endmacro - -%macro PIXEL10_70 0 - Interp7 [edi+ebx],[c8],[c4] -%endmacro - -%macro PIXEL10_90 0 - Interp9 [edi+ebx],[c8],[c4] -%endmacro - -%macro PIXEL10_100 0 - Interp10 [edi+ebx],[c8],[c4] -%endmacro - -%macro PIXEL11_0 0 - mov [edi+ebx+4],eax -%endmacro - -%macro PIXEL11_10 0 - Interp1 [edi+ebx+4],eax,[c9] -%endmacro - -%macro PIXEL11_11 0 - Interp1 [edi+ebx+4],eax,[c6] -%endmacro - -%macro PIXEL11_12 0 - Interp1 [edi+ebx+4],eax,[c8] -%endmacro - -%macro PIXEL11_20 0 - Interp2 [edi+ebx+4],eax,[c6],[c8] -%endmacro - -%macro PIXEL11_21 0 - Interp2 [edi+ebx+4],eax,[c9],[c8] -%endmacro - -%macro PIXEL11_22 0 - Interp2 [edi+ebx+4],eax,[c9],[c6] -%endmacro - -%macro PIXEL11_60 0 - Interp6 [edi+ebx+4],[c8],[c6] -%endmacro - -%macro PIXEL11_61 0 - Interp6 [edi+ebx+4],[c6],[c8] -%endmacro - -%macro PIXEL11_70 0 - Interp7 [edi+ebx+4],[c6],[c8] -%endmacro - -%macro PIXEL11_90 0 - Interp9 [edi+ebx+4],[c6],[c8] -%endmacro - -%macro PIXEL11_100 0 - Interp10 [edi+ebx+4],[c6],[c8] -%endmacro - -inbuffer equ 8 -outbuffer equ 12 -Xres equ 16 -Yres equ 20 -pitch equ 24 - -_hq2x_32: - push ebp - mov ebp,esp - pushad - - mov esi,[ebp+inbuffer] - mov edi,[ebp+outbuffer] - mov edx,[ebp+Yres] - mov [linesleft],edx - mov ebx,[ebp+Xres] - shl ebx,1 - mov dword[prevline],0 - mov dword[nextline],ebx -.loopy - push edi - mov ecx,[ebp+Xres] - sub ecx,2 ; x={Xres-2, Xres-1} are special cases. - mov dword[xcounter],ecx - ; x=0 - special case - mov ebx,[prevline] - movq mm5,[esi+ebx] - movq mm6,[esi] - mov ebx,[nextline] - movq mm7,[esi+ebx] - movd eax,mm5 - movzx edx,ax - mov [w1],edx - mov [w2],edx - shr eax,16 - mov [w3],eax - movd eax,mm6 - movzx edx,ax - mov [w4],edx - mov [w5],edx - shr eax,16 - mov [w6],eax - movd eax,mm7 - movzx edx,ax - mov [w7],edx - mov [w8],edx - shr eax,16 - mov [w9],eax - jmp .flags -.loopx - mov ebx,[prevline] - movq mm5,[esi+ebx-2] - movq mm6,[esi-2] - mov ebx,[nextline] - movq mm7,[esi+ebx-2] - movd eax,mm5 - movzx edx,ax - mov [w1],edx - shr eax,16 - mov [w2],eax - psrlq mm5,32 - movd eax,mm5 - movzx edx,ax - mov [w3],edx - movd eax,mm6 - movzx edx,ax - mov [w4],edx - shr eax,16 - mov [w5],eax - psrlq mm6,32 - movd eax,mm6 - movzx edx,ax - mov [w6],edx - movd eax,mm7 - movzx edx,ax - mov [w7],edx - shr eax,16 - mov [w8],eax - psrlq mm7,32 - movd eax,mm7 - movzx edx,ax - mov [w9],edx -.flags - mov ebx,_RGBtoYUV - mov eax,[w5] - xor ecx,ecx - movd mm5,[ebx+eax*4] - mov dword[cross],0 - - mov edx,[w2] - cmp eax,edx - je .noflag2 - or dword[cross],1 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag2 - or ecx,2 -.noflag2 - mov edx,[w4] - cmp eax,edx - je .noflag4 - or dword[cross],2 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag4 - or ecx,8 -.noflag4 - mov edx,[w6] - cmp eax,edx - je .noflag6 - or dword[cross],4 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag6 - or ecx,16 -.noflag6 - mov edx,[w8] - cmp eax,edx - je .noflag8 - or dword[cross],8 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag8 - or ecx,64 -.noflag8 - test ecx,ecx - jnz .testflag1 - mov ecx,[cross] - mov ebx,_LUT16to32 - mov eax,[ebx+eax*4] - jmp [FuncTable2+ecx*4] -.testflag1 - mov edx,[w1] - cmp eax,edx - je .noflag1 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag1 - or ecx,1 -.noflag1 - mov edx,[w3] - cmp eax,edx - je .noflag3 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag3 - or ecx,4 -.noflag3 - mov edx,[w7] - cmp eax,edx - je .noflag7 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag7 - or ecx,32 -.noflag7 - mov edx,[w9] - cmp eax,edx - je .noflag9 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag9 - or ecx,128 -.noflag9 - mov ebx,_LUT16to32 - mov eax,[ebx+eax*4] - mov edx,[w2] - mov edx,[ebx+edx*4] - mov [c2],edx - mov edx,[w4] - mov edx,[ebx+edx*4] - mov [c4],edx - mov edx,[w6] - mov edx,[ebx+edx*4] - mov [c6],edx - mov edx,[w8] - mov edx,[ebx+edx*4] - mov [c8],edx - test ecx,0x005A - jz .switch - mov edx,[w1] - mov edx,[ebx+edx*4] - mov [c1],edx - mov edx,[w3] - mov edx,[ebx+edx*4] - mov [c3],edx - mov edx,[w7] - mov edx,[ebx+edx*4] - mov [c7],edx - mov edx,[w9] - mov edx,[ebx+edx*4] - mov [c9],edx -.switch - mov ebx,[ebp+pitch] - jmp [FuncTable+ecx*4] - -..@flag0 -..@flag1 -..@flag4 -..@flag32 -..@flag128 -..@flag5 -..@flag132 -..@flag160 -..@flag33 -..@flag129 -..@flag36 -..@flag133 -..@flag164 -..@flag161 -..@flag37 -..@flag165 -; PIXEL00_20 -; PIXEL01_20 -; PIXEL10_20 -; PIXEL11_20 - -; the same, only optimized - shl eax,1 - mov ecx,eax - add ecx,[c2] - mov edx,ecx - add edx,[c4] - shr edx,2 - mov [edi],edx - add ecx,[c6] - shr ecx,2 - mov [edi+4],ecx - mov ecx,eax - add ecx,[c8] - mov edx,ecx - add edx,[c4] - shr edx,2 - mov [edi+ebx],edx - add ecx,[c6] - shr ecx,2 - mov [edi+ebx+4],ecx - jmp .loopx_end -..@flag2 -..@flag34 -..@flag130 -..@flag162 - PIXEL00_22 - PIXEL01_21 - PIXEL10_20 - PIXEL11_20 - jmp .loopx_end -..@flag16 -..@flag17 -..@flag48 -..@flag49 - PIXEL00_20 - PIXEL01_22 - PIXEL10_20 - PIXEL11_21 - jmp .loopx_end -..@flag64 -..@flag65 -..@flag68 -..@flag69 - PIXEL00_20 - PIXEL01_20 - PIXEL10_21 - PIXEL11_22 - jmp .loopx_end -..@flag8 -..@flag12 -..@flag136 -..@flag140 - PIXEL00_21 - PIXEL01_20 - PIXEL10_22 - PIXEL11_20 - jmp .loopx_end -..@flag3 -..@flag35 -..@flag131 -..@flag163 - PIXEL00_11 - PIXEL01_21 - PIXEL10_20 - PIXEL11_20 - jmp .loopx_end -..@flag6 -..@flag38 -..@flag134 -..@flag166 - PIXEL00_22 - PIXEL01_12 - PIXEL10_20 - PIXEL11_20 - jmp .loopx_end -..@flag20 -..@flag21 -..@flag52 -..@flag53 - PIXEL00_20 - PIXEL01_11 - PIXEL10_20 - PIXEL11_21 - jmp .loopx_end -..@flag144 -..@flag145 -..@flag176 -..@flag177 - PIXEL00_20 - PIXEL01_22 - PIXEL10_20 - PIXEL11_12 - jmp .loopx_end -..@flag192 -..@flag193 -..@flag196 -..@flag197 - PIXEL00_20 - PIXEL01_20 - PIXEL10_21 - PIXEL11_11 - jmp .loopx_end -..@flag96 -..@flag97 -..@flag100 -..@flag101 - PIXEL00_20 - PIXEL01_20 - PIXEL10_12 - PIXEL11_22 - jmp .loopx_end -..@flag40 -..@flag44 -..@flag168 -..@flag172 - PIXEL00_21 - PIXEL01_20 - PIXEL10_11 - PIXEL11_20 - jmp .loopx_end -..@flag9 -..@flag13 -..@flag137 -..@flag141 - PIXEL00_12 - PIXEL01_20 - PIXEL10_22 - PIXEL11_20 - jmp .loopx_end -..@flag18 -..@flag50 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_20 - PIXEL10_20 - PIXEL11_21 - jmp .loopx_end -..@flag80 -..@flag81 - PIXEL00_20 - PIXEL01_22 - PIXEL10_21 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_20 - jmp .loopx_end -..@flag72 -..@flag76 - PIXEL00_21 - PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_20 - PIXEL11_22 - jmp .loopx_end -..@flag10 -..@flag138 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_20 - PIXEL01_21 - PIXEL10_22 - PIXEL11_20 - jmp .loopx_end -..@flag66 - PIXEL00_22 - PIXEL01_21 - PIXEL10_21 - PIXEL11_22 - jmp .loopx_end -..@flag24 - PIXEL00_21 - PIXEL01_22 - PIXEL10_22 - PIXEL11_21 - jmp .loopx_end -..@flag7 -..@flag39 -..@flag135 - PIXEL00_11 - PIXEL01_12 - PIXEL10_20 - PIXEL11_20 - jmp .loopx_end -..@flag148 -..@flag149 -..@flag180 - PIXEL00_20 - PIXEL01_11 - PIXEL10_20 - PIXEL11_12 - jmp .loopx_end -..@flag224 -..@flag228 -..@flag225 - PIXEL00_20 - PIXEL01_20 - PIXEL10_12 - PIXEL11_11 - jmp .loopx_end -..@flag41 -..@flag169 -..@flag45 - PIXEL00_12 - PIXEL01_20 - PIXEL10_11 - PIXEL11_20 - jmp .loopx_end -..@flag22 -..@flag54 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_20 - PIXEL11_21 - jmp .loopx_end -..@flag208 -..@flag209 - PIXEL00_20 - PIXEL01_22 - PIXEL10_21 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag104 -..@flag108 - PIXEL00_21 - PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_22 - jmp .loopx_end -..@flag11 -..@flag139 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_21 - PIXEL10_22 - PIXEL11_20 - jmp .loopx_end -..@flag19 -..@flag51 - DiffOrNot w2,w6,PIXEL00_11,PIXEL01_10,PIXEL00_60,PIXEL01_90 - PIXEL10_20 - PIXEL11_21 - jmp .loopx_end -..@flag146 -..@flag178 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_10,PIXEL11_12,PIXEL01_90,PIXEL11_61 - PIXEL10_20 - jmp .loopx_end -..@flag84 -..@flag85 - PIXEL00_20 - DiffOrNot w6,w8,PIXEL01_11,PIXEL11_10,PIXEL01_60,PIXEL11_90 - PIXEL10_21 - jmp .loopx_end -..@flag112 -..@flag113 - PIXEL00_20 - PIXEL01_22 - DiffOrNot w6,w8,PIXEL10_12,PIXEL11_10,PIXEL10_61,PIXEL11_90 - jmp .loopx_end -..@flag200 -..@flag204 - PIXEL00_21 - PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_10,PIXEL11_11,PIXEL10_90,PIXEL11_60 - jmp .loopx_end -..@flag73 -..@flag77 - DiffOrNot w8,w4,PIXEL00_12,PIXEL10_10,PIXEL00_61,PIXEL10_90 - PIXEL01_20 - PIXEL11_22 - jmp .loopx_end -..@flag42 -..@flag170 - DiffOrNot w4,w2,PIXEL00_10,PIXEL10_11,PIXEL00_90,PIXEL10_60 - PIXEL01_21 - PIXEL11_20 - jmp .loopx_end -..@flag14 -..@flag142 - DiffOrNot w4,w2,PIXEL00_10,PIXEL01_12,PIXEL00_90,PIXEL01_61 - PIXEL10_22 - PIXEL11_20 - jmp .loopx_end -..@flag67 - PIXEL00_11 - PIXEL01_21 - PIXEL10_21 - PIXEL11_22 - jmp .loopx_end -..@flag70 - PIXEL00_22 - PIXEL01_12 - PIXEL10_21 - PIXEL11_22 - jmp .loopx_end -..@flag28 - PIXEL00_21 - PIXEL01_11 - PIXEL10_22 - PIXEL11_21 - jmp .loopx_end -..@flag152 - PIXEL00_21 - PIXEL01_22 - PIXEL10_22 - PIXEL11_12 - jmp .loopx_end -..@flag194 - PIXEL00_22 - PIXEL01_21 - PIXEL10_21 - PIXEL11_11 - jmp .loopx_end -..@flag98 - PIXEL00_22 - PIXEL01_21 - PIXEL10_12 - PIXEL11_22 - jmp .loopx_end -..@flag56 - PIXEL00_21 - PIXEL01_22 - PIXEL10_11 - PIXEL11_21 - jmp .loopx_end -..@flag25 - PIXEL00_12 - PIXEL01_22 - PIXEL10_22 - PIXEL11_21 - jmp .loopx_end -..@flag26 -..@flag31 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_22 - PIXEL11_21 - jmp .loopx_end -..@flag82 -..@flag214 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_21 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag88 -..@flag248 - PIXEL00_21 - PIXEL01_22 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag74 -..@flag107 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_21 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_22 - jmp .loopx_end -..@flag27 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_10 - PIXEL10_22 - PIXEL11_21 - jmp .loopx_end -..@flag86 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_21 - PIXEL11_10 - jmp .loopx_end -..@flag216 - PIXEL00_21 - PIXEL01_22 - PIXEL10_10 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag106 - PIXEL00_10 - PIXEL01_21 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_22 - jmp .loopx_end -..@flag30 - PIXEL00_10 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_22 - PIXEL11_21 - jmp .loopx_end -..@flag210 - PIXEL00_22 - PIXEL01_10 - PIXEL10_21 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag120 - PIXEL00_21 - PIXEL01_22 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_10 - jmp .loopx_end -..@flag75 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_21 - PIXEL10_10 - PIXEL11_22 - jmp .loopx_end -..@flag29 - PIXEL00_12 - PIXEL01_11 - PIXEL10_22 - PIXEL11_21 - jmp .loopx_end -..@flag198 - PIXEL00_22 - PIXEL01_12 - PIXEL10_21 - PIXEL11_11 - jmp .loopx_end -..@flag184 - PIXEL00_21 - PIXEL01_22 - PIXEL10_11 - PIXEL11_12 - jmp .loopx_end -..@flag99 - PIXEL00_11 - PIXEL01_21 - PIXEL10_12 - PIXEL11_22 - jmp .loopx_end -..@flag57 - PIXEL00_12 - PIXEL01_22 - PIXEL10_11 - PIXEL11_21 - jmp .loopx_end -..@flag71 - PIXEL00_11 - PIXEL01_12 - PIXEL10_21 - PIXEL11_22 - jmp .loopx_end -..@flag156 - PIXEL00_21 - PIXEL01_11 - PIXEL10_22 - PIXEL11_12 - jmp .loopx_end -..@flag226 - PIXEL00_22 - PIXEL01_21 - PIXEL10_12 - PIXEL11_11 - jmp .loopx_end -..@flag60 - PIXEL00_21 - PIXEL01_11 - PIXEL10_11 - PIXEL11_21 - jmp .loopx_end -..@flag195 - PIXEL00_11 - PIXEL01_21 - PIXEL10_21 - PIXEL11_11 - jmp .loopx_end -..@flag102 - PIXEL00_22 - PIXEL01_12 - PIXEL10_12 - PIXEL11_22 - jmp .loopx_end -..@flag153 - PIXEL00_12 - PIXEL01_22 - PIXEL10_22 - PIXEL11_12 - jmp .loopx_end -..@flag58 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - PIXEL10_11 - PIXEL11_21 - jmp .loopx_end -..@flag83 - PIXEL00_11 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - PIXEL10_21 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag92 - PIXEL00_21 - PIXEL01_11 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag202 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - PIXEL01_21 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - PIXEL11_11 - jmp .loopx_end -..@flag78 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - PIXEL01_12 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - PIXEL11_22 - jmp .loopx_end -..@flag154 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - PIXEL10_22 - PIXEL11_12 - jmp .loopx_end -..@flag114 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - PIXEL10_12 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag89 - PIXEL00_12 - PIXEL01_22 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag90 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag55 -..@flag23 - DiffOrNot w2,w6,PIXEL00_11,PIXEL01_0,PIXEL00_60,PIXEL01_90 - PIXEL10_20 - PIXEL11_21 - jmp .loopx_end -..@flag182 -..@flag150 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_0,PIXEL11_12,PIXEL01_90,PIXEL11_61 - PIXEL10_20 - jmp .loopx_end -..@flag213 -..@flag212 - PIXEL00_20 - DiffOrNot w6,w8,PIXEL01_11,PIXEL11_0,PIXEL01_60,PIXEL11_90 - PIXEL10_21 - jmp .loopx_end -..@flag241 -..@flag240 - PIXEL00_20 - PIXEL01_22 - DiffOrNot w6,w8,PIXEL10_12,PIXEL11_0,PIXEL10_61,PIXEL11_90 - jmp .loopx_end -..@flag236 -..@flag232 - PIXEL00_21 - PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_0,PIXEL11_11,PIXEL10_90,PIXEL11_60 - jmp .loopx_end -..@flag109 -..@flag105 - DiffOrNot w8,w4,PIXEL00_12,PIXEL10_0,PIXEL00_61,PIXEL10_90 - PIXEL01_20 - PIXEL11_22 - jmp .loopx_end -..@flag171 -..@flag43 - DiffOrNot w4,w2,PIXEL00_0,PIXEL10_11,PIXEL00_90,PIXEL10_60 - PIXEL01_21 - PIXEL11_20 - jmp .loopx_end -..@flag143 -..@flag15 - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_12,PIXEL00_90,PIXEL01_61 - PIXEL10_22 - PIXEL11_20 - jmp .loopx_end -..@flag124 - PIXEL00_21 - PIXEL01_11 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_10 - jmp .loopx_end -..@flag203 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_21 - PIXEL10_10 - PIXEL11_11 - jmp .loopx_end -..@flag62 - PIXEL00_10 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_11 - PIXEL11_21 - jmp .loopx_end -..@flag211 - PIXEL00_11 - PIXEL01_10 - PIXEL10_21 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag118 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_12 - PIXEL11_10 - jmp .loopx_end -..@flag217 - PIXEL00_12 - PIXEL01_22 - PIXEL10_10 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag110 - PIXEL00_10 - PIXEL01_12 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_22 - jmp .loopx_end -..@flag155 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_10 - PIXEL10_22 - PIXEL11_12 - jmp .loopx_end -..@flag188 - PIXEL00_21 - PIXEL01_11 - PIXEL10_11 - PIXEL11_12 - jmp .loopx_end -..@flag185 - PIXEL00_12 - PIXEL01_22 - PIXEL10_11 - PIXEL11_12 - jmp .loopx_end -..@flag61 - PIXEL00_12 - PIXEL01_11 - PIXEL10_11 - PIXEL11_21 - jmp .loopx_end -..@flag157 - PIXEL00_12 - PIXEL01_11 - PIXEL10_22 - PIXEL11_12 - jmp .loopx_end -..@flag103 - PIXEL00_11 - PIXEL01_12 - PIXEL10_12 - PIXEL11_22 - jmp .loopx_end -..@flag227 - PIXEL00_11 - PIXEL01_21 - PIXEL10_12 - PIXEL11_11 - jmp .loopx_end -..@flag230 - PIXEL00_22 - PIXEL01_12 - PIXEL10_12 - PIXEL11_11 - jmp .loopx_end -..@flag199 - PIXEL00_11 - PIXEL01_12 - PIXEL10_21 - PIXEL11_11 - jmp .loopx_end -..@flag220 - PIXEL00_21 - PIXEL01_11 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag158 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_22 - PIXEL11_12 - jmp .loopx_end -..@flag234 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - PIXEL01_21 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_11 - jmp .loopx_end -..@flag242 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - PIXEL10_12 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag59 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - PIXEL10_11 - PIXEL11_21 - jmp .loopx_end -..@flag121 - PIXEL00_12 - PIXEL01_22 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag87 - PIXEL00_11 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_21 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag79 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_12 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - PIXEL11_22 - jmp .loopx_end -..@flag122 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag94 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag218 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag91 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag229 - PIXEL00_20 - PIXEL01_20 - PIXEL10_12 - PIXEL11_11 - jmp .loopx_end -..@flag167 - PIXEL00_11 - PIXEL01_12 - PIXEL10_20 - PIXEL11_20 - jmp .loopx_end -..@flag173 - PIXEL00_12 - PIXEL01_20 - PIXEL10_11 - PIXEL11_20 - jmp .loopx_end -..@flag181 - PIXEL00_20 - PIXEL01_11 - PIXEL10_20 - PIXEL11_12 - jmp .loopx_end -..@flag186 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - PIXEL10_11 - PIXEL11_12 - jmp .loopx_end -..@flag115 - PIXEL00_11 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - PIXEL10_12 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag93 - PIXEL00_12 - PIXEL01_11 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag206 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - PIXEL01_12 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - PIXEL11_11 - jmp .loopx_end -..@flag205 -..@flag201 - PIXEL00_12 - PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70 - PIXEL11_11 - jmp .loopx_end -..@flag174 -..@flag46 - DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70 - PIXEL01_12 - PIXEL10_11 - PIXEL11_20 - jmp .loopx_end -..@flag179 -..@flag147 - PIXEL00_11 - DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70 - PIXEL10_20 - PIXEL11_12 - jmp .loopx_end -..@flag117 -..@flag116 - PIXEL00_20 - PIXEL01_11 - PIXEL10_12 - DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70 - jmp .loopx_end -..@flag189 - PIXEL00_12 - PIXEL01_11 - PIXEL10_11 - PIXEL11_12 - jmp .loopx_end -..@flag231 - PIXEL00_11 - PIXEL01_12 - PIXEL10_12 - PIXEL11_11 - jmp .loopx_end -..@flag126 - PIXEL00_10 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_10 - jmp .loopx_end -..@flag219 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_10 - PIXEL10_10 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag125 - DiffOrNot w8,w4,PIXEL00_12,PIXEL10_0,PIXEL00_61,PIXEL10_90 - PIXEL01_11 - PIXEL11_10 - jmp .loopx_end -..@flag221 - PIXEL00_12 - DiffOrNot w6,w8,PIXEL01_11,PIXEL11_0,PIXEL01_60,PIXEL11_90 - PIXEL10_10 - jmp .loopx_end -..@flag207 - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_12,PIXEL00_90,PIXEL01_61 - PIXEL10_10 - PIXEL11_11 - jmp .loopx_end -..@flag238 - PIXEL00_10 - PIXEL01_12 - DiffOrNot w8,w4,PIXEL10_0,PIXEL11_11,PIXEL10_90,PIXEL11_60 - jmp .loopx_end -..@flag190 - PIXEL00_10 - DiffOrNot w2,w6,PIXEL01_0,PIXEL11_12,PIXEL01_90,PIXEL11_61 - PIXEL10_11 - jmp .loopx_end -..@flag187 - DiffOrNot w4,w2,PIXEL00_0,PIXEL10_11,PIXEL00_90,PIXEL10_60 - PIXEL01_10 - PIXEL11_12 - jmp .loopx_end -..@flag243 - PIXEL00_11 - PIXEL01_10 - DiffOrNot w6,w8,PIXEL10_12,PIXEL11_0,PIXEL10_61,PIXEL11_90 - jmp .loopx_end -..@flag119 - DiffOrNot w2,w6,PIXEL00_11,PIXEL01_0,PIXEL00_60,PIXEL01_90 - PIXEL10_12 - PIXEL11_10 - jmp .loopx_end -..@flag237 -..@flag233 - PIXEL00_12 - PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100 - PIXEL11_11 - jmp .loopx_end -..@flag175 -..@flag47 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100 - PIXEL01_12 - PIXEL10_11 - PIXEL11_20 - jmp .loopx_end -..@flag183 -..@flag151 - PIXEL00_11 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100 - PIXEL10_20 - PIXEL11_12 - jmp .loopx_end -..@flag245 -..@flag244 - PIXEL00_20 - PIXEL01_11 - PIXEL10_12 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100 - jmp .loopx_end -..@flag250 - PIXEL00_10 - PIXEL01_10 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag123 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_10 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_10 - jmp .loopx_end -..@flag95 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_10 - PIXEL11_10 - jmp .loopx_end -..@flag222 - PIXEL00_10 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_10 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag252 - PIXEL00_21 - PIXEL01_11 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100 - jmp .loopx_end -..@flag249 - PIXEL00_12 - PIXEL01_22 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag235 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_21 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100 - PIXEL11_11 - jmp .loopx_end -..@flag111 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100 - PIXEL01_12 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_22 - jmp .loopx_end -..@flag63 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_11 - PIXEL11_21 - jmp .loopx_end -..@flag159 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100 - PIXEL10_22 - PIXEL11_12 - jmp .loopx_end -..@flag215 - PIXEL00_11 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100 - PIXEL10_21 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag246 - PIXEL00_22 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - PIXEL10_12 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100 - jmp .loopx_end -..@flag254 - PIXEL00_10 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100 - jmp .loopx_end -..@flag253 - PIXEL00_12 - PIXEL01_11 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100 - jmp .loopx_end -..@flag251 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_10 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag239 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100 - PIXEL01_12 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100 - PIXEL11_11 - jmp .loopx_end -..@flag127 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20 - PIXEL11_10 - jmp .loopx_end -..@flag191 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100 - PIXEL10_11 - PIXEL11_12 - jmp .loopx_end -..@flag223 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100 - PIXEL10_10 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20 - jmp .loopx_end -..@flag247 - PIXEL00_11 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100 - PIXEL10_12 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100 - jmp .loopx_end -..@flag255 - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100 - DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100 - DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100 - DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100 - jmp .loopx_end - - -..@cross0 - mov ebx,[ebp+pitch] - mov [edi],eax - mov [edi+4],eax - mov [edi+ebx],eax - mov [edi+ebx+4],eax - jmp .loopx_end -..@cross1 - mov ecx,[w2] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],edx - mov [edi+4],edx - mov [edi+ebx],eax - mov [edi+ebx+4],eax - jmp .loopx_end -..@cross2 - mov ecx,[w4] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],edx - mov [edi+4],eax - mov [edi+ebx],edx - mov [edi+ebx+4],eax - jmp .loopx_end -..@cross4 - mov ecx,[w6] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],eax - mov [edi+4],edx - mov [edi+ebx],eax - mov [edi+ebx+4],edx - jmp .loopx_end -..@cross8 - mov ecx,[w8] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],eax - mov [edi+4],eax - mov [edi+ebx],edx - mov [edi+ebx+4],edx - jmp .loopx_end -..@crossN - mov edx,[w2] - mov ecx,[ebx+edx*4] - mov [c2],ecx - mov edx,[w4] - mov ecx,[ebx+edx*4] - mov [c4],ecx - mov edx,[w6] - mov ecx,[ebx+edx*4] - mov [c6],ecx - mov edx,[w8] - mov ecx,[ebx+edx*4] - mov [c8],ecx - mov ebx,[ebp+pitch] - jmp ..@flag0 - -.loopx_end - add esi,2 - add edi,8 - dec dword[xcounter] - jle .xres_2 - jmp .loopx - -.xres_2 - ; x=Xres-2 - special case - jl .xres_1 - mov ebx,[prevline] - movq mm5,[esi+ebx-4] - movq mm6,[esi-4] - mov ebx,[nextline] - movq mm7,[esi+ebx-4] - psrlq mm5,16 - psrlq mm6,16 - psrlq mm7,16 - movd eax,mm5 - movzx edx,ax - mov [w1],edx - shr eax,16 - mov [w2],eax - psrlq mm5,32 - movd eax,mm5 - mov [w3],eax - movd eax,mm6 - movzx edx,ax - mov [w4],edx - shr eax,16 - mov [w5],eax - psrlq mm6,32 - movd eax,mm6 - mov [w6],eax - movd eax,mm7 - movzx edx,ax - mov [w7],edx - shr eax,16 - mov [w8],eax - psrlq mm7,32 - movd eax,mm7 - mov [w9],eax - jmp .flags - -.xres_1 - cmp dword[xcounter],-1 - jl .nexty - ; x=Xres-1 - special case - mov ebx,[prevline] - movq mm5,[esi+ebx-6] - movq mm6,[esi-6] - mov ebx,[nextline] - movq mm7,[esi+ebx-6] - psrlq mm5,32 - psrlq mm6,32 - psrlq mm7,32 - movd eax,mm5 - movzx edx,ax - mov [w1],edx - shr eax,16 - mov [w2],eax - mov [w3],eax - movd eax,mm6 - movzx edx,ax - mov [w4],edx - shr eax,16 - mov [w5],eax - mov [w6],eax - movd eax,mm7 - movzx edx,ax - mov [w7],edx - shr eax,16 - mov [w8],eax - mov [w9],eax - jmp .flags -.nexty - pop edi - add edi,ebx - add edi,ebx - dec dword[linesleft] - jz .fin - mov ebx,[ebp+Xres] - shl ebx,1 - cmp dword[linesleft],1 - je .lastline - mov dword[nextline],ebx - neg ebx - mov dword[prevline],ebx - jmp .loopy -.lastline - mov dword[nextline],0 - neg ebx - mov dword[prevline],ebx - jmp .loopy -.fin - emms - popad - mov esp,ebp - pop ebp - ret - -SECTION .data -FuncTable - dd ..@flag0, ..@flag1, ..@flag2, ..@flag3, ..@flag4, ..@flag5, ..@flag6, ..@flag7 - dd ..@flag8, ..@flag9, ..@flag10, ..@flag11, ..@flag12, ..@flag13, ..@flag14, ..@flag15 - dd ..@flag16, ..@flag17, ..@flag18, ..@flag19, ..@flag20, ..@flag21, ..@flag22, ..@flag23 - dd ..@flag24, ..@flag25, ..@flag26, ..@flag27, ..@flag28, ..@flag29, ..@flag30, ..@flag31 - dd ..@flag32, ..@flag33, ..@flag34, ..@flag35, ..@flag36, ..@flag37, ..@flag38, ..@flag39 - dd ..@flag40, ..@flag41, ..@flag42, ..@flag43, ..@flag44, ..@flag45, ..@flag46, ..@flag47 - dd ..@flag48, ..@flag49, ..@flag50, ..@flag51, ..@flag52, ..@flag53, ..@flag54, ..@flag55 - dd ..@flag56, ..@flag57, ..@flag58, ..@flag59, ..@flag60, ..@flag61, ..@flag62, ..@flag63 - dd ..@flag64, ..@flag65, ..@flag66, ..@flag67, ..@flag68, ..@flag69, ..@flag70, ..@flag71 - dd ..@flag72, ..@flag73, ..@flag74, ..@flag75, ..@flag76, ..@flag77, ..@flag78, ..@flag79 - dd ..@flag80, ..@flag81, ..@flag82, ..@flag83, ..@flag84, ..@flag85, ..@flag86, ..@flag87 - dd ..@flag88, ..@flag89, ..@flag90, ..@flag91, ..@flag92, ..@flag93, ..@flag94, ..@flag95 - dd ..@flag96, ..@flag97, ..@flag98, ..@flag99, ..@flag100, ..@flag101, ..@flag102, ..@flag103 - dd ..@flag104, ..@flag105, ..@flag106, ..@flag107, ..@flag108, ..@flag109, ..@flag110, ..@flag111 - dd ..@flag112, ..@flag113, ..@flag114, ..@flag115, ..@flag116, ..@flag117, ..@flag118, ..@flag119 - dd ..@flag120, ..@flag121, ..@flag122, ..@flag123, ..@flag124, ..@flag125, ..@flag126, ..@flag127 - dd ..@flag128, ..@flag129, ..@flag130, ..@flag131, ..@flag132, ..@flag133, ..@flag134, ..@flag135 - dd ..@flag136, ..@flag137, ..@flag138, ..@flag139, ..@flag140, ..@flag141, ..@flag142, ..@flag143 - dd ..@flag144, ..@flag145, ..@flag146, ..@flag147, ..@flag148, ..@flag149, ..@flag150, ..@flag151 - dd ..@flag152, ..@flag153, ..@flag154, ..@flag155, ..@flag156, ..@flag157, ..@flag158, ..@flag159 - dd ..@flag160, ..@flag161, ..@flag162, ..@flag163, ..@flag164, ..@flag165, ..@flag166, ..@flag167 - dd ..@flag168, ..@flag169, ..@flag170, ..@flag171, ..@flag172, ..@flag173, ..@flag174, ..@flag175 - dd ..@flag176, ..@flag177, ..@flag178, ..@flag179, ..@flag180, ..@flag181, ..@flag182, ..@flag183 - dd ..@flag184, ..@flag185, ..@flag186, ..@flag187, ..@flag188, ..@flag189, ..@flag190, ..@flag191 - dd ..@flag192, ..@flag193, ..@flag194, ..@flag195, ..@flag196, ..@flag197, ..@flag198, ..@flag199 - dd ..@flag200, ..@flag201, ..@flag202, ..@flag203, ..@flag204, ..@flag205, ..@flag206, ..@flag207 - dd ..@flag208, ..@flag209, ..@flag210, ..@flag211, ..@flag212, ..@flag213, ..@flag214, ..@flag215 - dd ..@flag216, ..@flag217, ..@flag218, ..@flag219, ..@flag220, ..@flag221, ..@flag222, ..@flag223 - dd ..@flag224, ..@flag225, ..@flag226, ..@flag227, ..@flag228, ..@flag229, ..@flag230, ..@flag231 - dd ..@flag232, ..@flag233, ..@flag234, ..@flag235, ..@flag236, ..@flag237, ..@flag238, ..@flag239 - dd ..@flag240, ..@flag241, ..@flag242, ..@flag243, ..@flag244, ..@flag245, ..@flag246, ..@flag247 - dd ..@flag248, ..@flag249, ..@flag250, ..@flag251, ..@flag252, ..@flag253, ..@flag254, ..@flag255 - -FuncTable2 - dd ..@cross0, ..@cross1, ..@cross2, ..@crossN, - dd ..@cross4, ..@crossN, ..@crossN, ..@crossN, - dd ..@cross8, ..@crossN, ..@crossN, ..@crossN, - dd ..@crossN, ..@crossN, ..@crossN, ..@crossN - diff --git a/jan/src/intf/video/scalers/hq2xs.cpp b/jan/src/intf/video/scalers/hq2xs.cpp deleted file mode 100644 index 80ca525c9..000000000 --- a/jan/src/intf/video/scalers/hq2xs.cpp +++ /dev/null @@ -1,352 +0,0 @@ -/* - * This file is part of the Advance project. - * - * Copyright (C) 2003 Andrea Mazzoleni - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * In addition, as a special exception, Andrea Mazzoleni - * gives permission to link the code of this program with - * the MAME library (or with modified versions of MAME that use the - * same license as MAME), and distribute linked combinations including - * the two. You must obey the GNU General Public License in all - * respects for all of the code used other than MAME. If you modify - * this file, you may extend this exception to your version of the - * file, but you are not obligated to do so. If you do not wish to - * do so, delete this exception statement from your version. - */ - -#include "interp.h" - -unsigned interp_mask[2]; -unsigned interp_bits_per_pixel; - -/***************************************************************************/ -/* HQ2xS C implementation */ - -/* - * This effect is derived from the hq2x effect made by Maxim Stepin - */ - -static void hq2xS_16_def(u16* dst0, u16* dst1, const u16* src0, const u16* src1, const u16* src2, unsigned count) -{ - unsigned i; - - for(i=0;i> 3; - r = (int)((c[j] & 0xF800)) >> 8; - } else { - b = (int)((c[j] & 0x1F)) << 3; - g = (int)((c[j] & 0x3E0)) >> 2; - r = (int)((c[j] & 0x7C00)) >> 7; - } - const int bright = r+r+r + g+g+g + b+b; - if(bright > maxBright) maxBright = bright; - if(bright < minBright) minBright = bright; - - brightArray[j] = bright; - } - int diffBright = ((maxBright - minBright) * 7) >> 4; - if(diffBright > 7) - { - #define ABS(x) ((x) < 0 ? -(x) : (x)) - - const int centerBright = brightArray[4]; - if(ABS(brightArray[0] - centerBright) > diffBright) - mask |= 1 << 0; - if(ABS(brightArray[1] - centerBright) > diffBright) - mask |= 1 << 1; - if(ABS(brightArray[2] - centerBright) > diffBright) - mask |= 1 << 2; - if(ABS(brightArray[3] - centerBright) > diffBright) - mask |= 1 << 3; - if(ABS(brightArray[5] - centerBright) > diffBright) - mask |= 1 << 4; - if(ABS(brightArray[6] - centerBright) > diffBright) - mask |= 1 << 5; - if(ABS(brightArray[7] - centerBright) > diffBright) - mask |= 1 << 6; - if(ABS(brightArray[8] - centerBright) > diffBright) - mask |= 1 << 7; - } - -#define P0 dst0[0] -#define P1 dst0[1] -#define P2 dst1[0] -#define P3 dst1[1] -#define MUR false//(ABS(brightArray[1] - brightArray[5]) > diffBright) // top-right -#define MDR false//(ABS(brightArray[5] - brightArray[7]) > diffBright) // bottom-right -#define MDL false//(ABS(brightArray[7] - brightArray[3]) > diffBright) // bottom-left -#define MUL false//(ABS(brightArray[3] - brightArray[1]) > diffBright) // top-left -#define IC(p0) c[p0] -#define I11(p0,p1) interp_16_11(c[p0], c[p1]) -#define I211(p0,p1,p2) interp_16_211(c[p0], c[p1], c[p2]) -#define I31(p0,p1) interp_16_31(c[p0], c[p1]) -#define I332(p0,p1,p2) interp_16_332(c[p0], c[p1], c[p2]) -#define I431(p0,p1,p2) interp_16_431(c[p0], c[p1], c[p2]) -#define I521(p0,p1,p2) interp_16_521(c[p0], c[p1], c[p2]) -#define I53(p0,p1) interp_16_53(c[p0], c[p1]) -#define I611(p0,p1,p2) interp_16_611(c[p0], c[p1], c[p2]) -#define I71(p0,p1) interp_16_71(c[p0], c[p1]) -#define I772(p0,p1,p2) interp_16_772(c[p0], c[p1], c[p2]) -#define I97(p0,p1) interp_16_97(c[p0], c[p1]) -#define I1411(p0,p1,p2) interp_16_1411(c[p0], c[p1], c[p2]) -#define I151(p0,p1) interp_16_151(c[p0], c[p1]) - - switch (mask) { -#include "hq2xs.h" - } - -#undef P0 -#undef P1 -#undef P2 -#undef P3 -#undef MUR -#undef MDR -#undef MDL -#undef MUL -#undef IC -#undef I11 -#undef I211 -#undef I31 -#undef I332 -#undef I431 -#undef I521 -#undef I53 -#undef I611 -#undef I71 -#undef I772 -#undef I97 -#undef I1411 -#undef I151 - - src0 += 1; - src1 += 1; - src2 += 1; - dst0 += 2; - dst1 += 2; - } -} - -static void hq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, const u32* src2, unsigned count) -{ - unsigned i; - - for(i=0;i> 8; - const int r = (int)((c[j] & 0xF80000)) >> 16; - const int bright = r+r+r + g+g+g + b+b; - if(bright > maxBright) maxBright = bright; - if(bright < minBright) minBright = bright; - - brightArray[j] = bright; - } - int diffBright = ((maxBright - minBright) * 7) >> 4; - if(diffBright > 7) - { - #define ABS(x) ((x) < 0 ? -(x) : (x)) - - const int centerBright = brightArray[4]; - if(ABS(brightArray[0] - centerBright) > diffBright) - mask |= 1 << 0; - if(ABS(brightArray[1] - centerBright) > diffBright) - mask |= 1 << 1; - if(ABS(brightArray[2] - centerBright) > diffBright) - mask |= 1 << 2; - if(ABS(brightArray[3] - centerBright) > diffBright) - mask |= 1 << 3; - if(ABS(brightArray[5] - centerBright) > diffBright) - mask |= 1 << 4; - if(ABS(brightArray[6] - centerBright) > diffBright) - mask |= 1 << 5; - if(ABS(brightArray[7] - centerBright) > diffBright) - mask |= 1 << 6; - if(ABS(brightArray[8] - centerBright) > diffBright) - mask |= 1 << 7; - } - -#define P0 dst0[0] -#define P1 dst0[1] -#define P2 dst1[0] -#define P3 dst1[1] -#define MUR false//(ABS(brightArray[1] - brightArray[5]) > diffBright) // top-right -#define MDR false//(ABS(brightArray[5] - brightArray[7]) > diffBright) // bottom-right -#define MDL false//(ABS(brightArray[7] - brightArray[3]) > diffBright) // bottom-left -#define MUL false//(ABS(brightArray[3] - brightArray[1]) > diffBright) // top-left -#define IC(p0) c[p0] -#define I11(p0,p1) interp_32_11(c[p0], c[p1]) -#define I211(p0,p1,p2) interp_32_211(c[p0], c[p1], c[p2]) -#define I31(p0,p1) interp_32_31(c[p0], c[p1]) -#define I332(p0,p1,p2) interp_32_332(c[p0], c[p1], c[p2]) -#define I431(p0,p1,p2) interp_32_431(c[p0], c[p1], c[p2]) -#define I521(p0,p1,p2) interp_32_521(c[p0], c[p1], c[p2]) -#define I53(p0,p1) interp_32_53(c[p0], c[p1]) -#define I611(p0,p1,p2) interp_32_611(c[p0], c[p1], c[p2]) -#define I71(p0,p1) interp_32_71(c[p0], c[p1]) -#define I772(p0,p1,p2) interp_32_772(c[p0], c[p1], c[p2]) -#define I97(p0,p1) interp_32_97(c[p0], c[p1]) -#define I1411(p0,p1,p2) interp_32_1411(c[p0], c[p1], c[p2]) -#define I151(p0,p1) interp_32_151(c[p0], c[p1]) - - switch (mask) { -#include "hq2xs.h" - } - -#undef P0 -#undef P1 -#undef P2 -#undef P3 -#undef MUR -#undef MDR -#undef MDL -#undef MUL -#undef IC -#undef I11 -#undef I211 -#undef I31 -#undef I332 -#undef I431 -#undef I521 -#undef I53 -#undef I611 -#undef I71 -#undef I772 -#undef I97 -#undef I1411 -#undef I151 - - src0 += 1; - src1 += 1; - src2 += 1; - dst0 += 2; - dst1 += 2; - } -} - -void hq2xS(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u16 *dst0 = (u16 *)dstPtr; - u16 *dst1 = dst0 + (dstPitch >> 1); - - u16 *src0 = (u16 *)srcPtr; - u16 *src1 = src0 + (srcPitch >> 1); - u16 *src2 = src1 + (srcPitch >> 1); - - hq2xS_16_def(dst0, dst1, src0, src0, src1, width); - - int count = height; - - count -= 2; - while(count) { - dst0 += dstPitch; - dst1 += dstPitch; - hq2xS_16_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 1; - --count; - } - dst0 += dstPitch; - dst1 += dstPitch; - hq2xS_16_def(dst0, dst1, src0, src1, src1, width); -} - -void hq2xS32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) -{ - u32 *dst0 = (u32 *)dstPtr; - u32 *dst1 = dst0 + (dstPitch >> 2); - - u32 *src0 = (u32 *)srcPtr; - u32 *src1 = src0 + (srcPitch >> 2); - u32 *src2 = src1 + (srcPitch >> 2); - hq2xS_32_def(dst0, dst1, src0, src0, src1, width); - - int count = height; - - count -= 2; - while(count) { - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - hq2xS_32_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 2; - --count; - } - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - hq2xS_32_def(dst0, dst1, src0, src1, src1, width); -} - -void hq2xS_init(unsigned bits_per_pixel) -{ - interp_set(bits_per_pixel); -} diff --git a/jan/src/intf/video/scalers/hq2xs.h b/jan/src/intf/video/scalers/hq2xs.h deleted file mode 100644 index 64c5778b5..000000000 --- a/jan/src/intf/video/scalers/hq2xs.h +++ /dev/null @@ -1,1824 +0,0 @@ -case 0 : -case 1 : -case 4 : -case 5 : -case 32 : -case 33 : -case 36 : -case 37 : -case 128 : -case 129 : -case 132 : -case 133 : -case 160 : -case 161 : -case 164 : -case 165 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 2 : -case 34 : -case 130 : -case 162 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 3 : -case 35 : -case 131 : -case 163 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 6 : -case 38 : -case 134 : -case 166 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 7 : -case 39 : -case 135 : -case 167 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 8 : -case 12 : -case 136 : -case 140 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - P2 = I31(4, 6); - P3 = I211(4, 5, 7); -} break; -case 9 : -case 13 : -case 137 : -case 141 : -{ - P0 = I31(4, 1); - P1 = I211(4, 1, 5); - P2 = I31(4, 6); - P3 = I211(4, 5, 7); -} break; -case 10 : -case 138 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 11 : -case 139 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 14 : -case 142 : -{ - P2 = I31(4, 6); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = I31(4, 0); - P1 = I31(4, 5); - } else { - P0 = I332(1, 3, 4); - P1 = I521(4, 1, 5); - } -} break; -case 15 : -case 143 : -{ - P2 = I31(4, 6); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = IC(4); - P1 = I31(4, 5); - } else { - P0 = I332(1, 3, 4); - P1 = I521(4, 1, 5); - } -} break; -case 16 : -case 17 : -case 48 : -case 49 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - P2 = I211(4, 3, 7); - P3 = I31(4, 8); -} break; -case 18 : -case 50 : -{ - P0 = I31(4, 0); - P2 = I211(4, 3, 7); - P3 = I31(4, 8); - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 19 : -case 51 : -{ - P2 = I211(4, 3, 7); - P3 = I31(4, 8); - if (MUR) { - P0 = I31(4, 3); - P1 = I31(4, 2); - } else { - P0 = I521(4, 1, 3); - P1 = I332(1, 5, 4); - } -} break; -case 20 : -case 21 : -case 52 : -case 53 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 1); - P2 = I211(4, 3, 7); - P3 = I31(4, 8); -} break; -case 22 : -case 54 : -{ - P0 = I31(4, 0); - P2 = I211(4, 3, 7); - P3 = I31(4, 8); - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 23 : -case 55 : -{ - P2 = I211(4, 3, 7); - P3 = I31(4, 8); - if (MUR) { - P0 = I31(4, 3); - P1 = IC(4); - } else { - P0 = I521(4, 1, 3); - P1 = I332(1, 5, 4); - } -} break; -case 24 : -case 66 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 25 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 26 : -case 31 : -case 95 : -{ - P2 = I31(4, 6); - P3 = I31(4, 8); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 27 : -case 75 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 8); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 28 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 29 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 30 : -case 86 : -{ - P0 = I31(4, 0); - P2 = I31(4, 6); - P3 = I31(4, 8); - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 40 : -case 44 : -case 168 : -case 172 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - P2 = I31(4, 7); - P3 = I211(4, 5, 7); -} break; -case 41 : -case 45 : -case 169 : -case 173 : -{ - P0 = I31(4, 1); - P1 = I211(4, 1, 5); - P2 = I31(4, 7); - P3 = I211(4, 5, 7); -} break; -case 42 : -case 170 : -{ - P1 = I31(4, 2); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = I31(4, 0); - P2 = I31(4, 7); - } else { - P0 = I332(1, 3, 4); - P2 = I521(4, 3, 7); - } -} break; -case 43 : -case 171 : -{ - P1 = I31(4, 2); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = IC(4); - P2 = I31(4, 7); - } else { - P0 = I332(1, 3, 4); - P2 = I521(4, 3, 7); - } -} break; -case 46 : -case 174 : -{ - P1 = I31(4, 5); - P2 = I31(4, 7); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 47 : -case 175 : -{ - P1 = I31(4, 5); - P2 = I31(4, 7); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } -} break; -case 56 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 7); - P3 = I31(4, 8); -} break; -case 57 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 7); - P3 = I31(4, 8); -} break; -case 58 : -{ - P2 = I31(4, 7); - P3 = I31(4, 8); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 59 : -{ - P2 = I31(4, 7); - P3 = I31(4, 8); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 60 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P2 = I31(4, 7); - P3 = I31(4, 8); -} break; -case 61 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - P2 = I31(4, 7); - P3 = I31(4, 8); -} break; -case 62 : -{ - P0 = I31(4, 0); - P2 = I31(4, 7); - P3 = I31(4, 8); - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 63 : -{ - P2 = I31(4, 7); - P3 = I31(4, 8); - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 64 : -case 65 : -case 68 : -case 69 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 67 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 70 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 71 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 72 : -case 76 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 73 : -case 77 : -{ - P1 = I211(4, 1, 5); - P3 = I31(4, 8); - if (MDL) { - P0 = I31(4, 1); - P2 = I31(4, 6); - } else { - P0 = I521(4, 3, 1); - P2 = I332(3, 7, 4); - } -} break; -case 74 : -case 107 : -case 123 : -{ - P1 = I31(4, 2); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 78 : -{ - P1 = I31(4, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 79 : -{ - P1 = I31(4, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 80 : -case 81 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 82 : -case 214 : -case 222 : -{ - P0 = I31(4, 0); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 83 : -{ - P0 = I31(4, 3); - P2 = I31(4, 6); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 84 : -case 85 : -{ - P0 = I211(4, 1, 3); - P2 = I31(4, 6); - if (MDR) { - P1 = I31(4, 1); - P3 = I31(4, 8); - } else { - P1 = I521(4, 5, 1); - P3 = I332(5, 7, 4); - } -} break; -case 87 : -{ - P0 = I31(4, 3); - P2 = I31(4, 6); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 88 : -case 248 : -case 250 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 89 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 90 : -{ - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 91 : -{ - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 92 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 93 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 94 : -{ - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 96 : -case 97 : -case 100 : -case 101 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 98 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 99 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 102 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 103 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 104 : -case 108 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 105 : -case 109 : -{ - P1 = I211(4, 1, 5); - P3 = I31(4, 8); - if (MDL) { - P0 = I31(4, 1); - P2 = IC(4); - } else { - P0 = I521(4, 3, 1); - P2 = I332(3, 7, 4); - } -} break; -case 106 : -case 120 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 110 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 111 : -{ - P1 = I31(4, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } -} break; -case 112 : -case 113 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - if (MDR) { - P2 = I31(4, 3); - P3 = I31(4, 8); - } else { - P2 = I521(4, 7, 3); - P3 = I332(5, 7, 4); - } -} break; -case 114 : -{ - P0 = I31(4, 0); - P2 = I31(4, 3); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 115 : -{ - P0 = I31(4, 3); - P2 = I31(4, 3); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 116 : -case 117 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 1); - P2 = I31(4, 3); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 118 : -{ - P0 = I31(4, 0); - P2 = I31(4, 3); - P3 = I31(4, 8); - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 119 : -{ - P2 = I31(4, 3); - P3 = I31(4, 8); - if (MUR) { - P0 = I31(4, 3); - P1 = IC(4); - } else { - P0 = I521(4, 1, 3); - P1 = I332(1, 5, 4); - } -} break; -case 121 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 122 : -{ - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 124 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 125 : -{ - P1 = I31(4, 1); - P3 = I31(4, 8); - if (MDL) { - P0 = I31(4, 1); - P2 = IC(4); - } else { - P0 = I521(4, 3, 1); - P2 = I332(3, 7, 4); - } -} break; -case 126 : -{ - P0 = I31(4, 0); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 127 : -{ - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 144 : -case 145 : -case 176 : -case 177 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - P2 = I211(4, 3, 7); - P3 = I31(4, 7); -} break; -case 146 : -case 178 : -{ - P0 = I31(4, 0); - P2 = I211(4, 3, 7); - if (MUR) { - P1 = I31(4, 2); - P3 = I31(4, 7); - } else { - P1 = I332(1, 5, 4); - P3 = I521(4, 5, 7); - } -} break; -case 147 : -case 179 : -{ - P0 = I31(4, 3); - P2 = I211(4, 3, 7); - P3 = I31(4, 7); - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 148 : -case 149 : -case 180 : -case 181 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 1); - P2 = I211(4, 3, 7); - P3 = I31(4, 7); -} break; -case 150 : -case 182 : -{ - P0 = I31(4, 0); - P2 = I211(4, 3, 7); - if (MUR) { - P1 = IC(4); - P3 = I31(4, 7); - } else { - P1 = I332(1, 5, 4); - P3 = I521(4, 5, 7); - } -} break; -case 151 : -case 183 : -{ - P0 = I31(4, 3); - P2 = I211(4, 3, 7); - P3 = I31(4, 7); - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 152 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 7); -} break; -case 153 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 7); -} break; -case 154 : -{ - P2 = I31(4, 6); - P3 = I31(4, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 155 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 156 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P2 = I31(4, 6); - P3 = I31(4, 7); -} break; -case 157 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - P2 = I31(4, 6); - P3 = I31(4, 7); -} break; -case 158 : -{ - P2 = I31(4, 6); - P3 = I31(4, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 159 : -{ - P2 = I31(4, 6); - P3 = I31(4, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 184 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 7); - P3 = I31(4, 7); -} break; -case 185 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 7); - P3 = I31(4, 7); -} break; -case 186 : -{ - P2 = I31(4, 7); - P3 = I31(4, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 187 : -{ - P1 = I31(4, 2); - P3 = I31(4, 7); - if (MUL) { - P0 = IC(4); - P2 = I31(4, 7); - } else { - P0 = I332(1, 3, 4); - P2 = I521(4, 3, 7); - } -} break; -case 188 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P2 = I31(4, 7); - P3 = I31(4, 7); -} break; -case 189 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - P2 = I31(4, 7); - P3 = I31(4, 7); -} break; -case 190 : -{ - P0 = I31(4, 0); - P2 = I31(4, 7); - if (MUR) { - P1 = IC(4); - P3 = I31(4, 7); - } else { - P1 = I332(1, 5, 4); - P3 = I521(4, 5, 7); - } -} break; -case 191 : -{ - P2 = I31(4, 7); - P3 = I31(4, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 192 : -case 193 : -case 196 : -case 197 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 194 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 195 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 198 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 199 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 200 : -case 204 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - if (MDL) { - P2 = I31(4, 6); - P3 = I31(4, 5); - } else { - P2 = I332(3, 7, 4); - P3 = I521(4, 7, 5); - } -} break; -case 201 : -case 205 : -{ - P0 = I31(4, 1); - P1 = I211(4, 1, 5); - P3 = I31(4, 5); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } -} break; -case 202 : -{ - P1 = I31(4, 2); - P3 = I31(4, 5); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 203 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 5); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 206 : -{ - P1 = I31(4, 5); - P3 = I31(4, 5); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 207 : -{ - P2 = I31(4, 6); - P3 = I31(4, 5); - if (MUL) { - P0 = IC(4); - P1 = I31(4, 5); - } else { - P0 = I332(1, 3, 4); - P1 = I521(4, 1, 5); - } -} break; -case 208 : -case 209 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 210 : -case 216 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 211 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 212 : -case 213 : -{ - P0 = I211(4, 1, 3); - P2 = I31(4, 6); - if (MDR) { - P1 = I31(4, 1); - P3 = IC(4); - } else { - P1 = I521(4, 5, 1); - P3 = I332(5, 7, 4); - } -} break; -case 215 : -{ - P0 = I31(4, 3); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 217 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 218 : -{ - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 219 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 220 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 221 : -{ - P0 = I31(4, 1); - P2 = I31(4, 6); - if (MDR) { - P1 = I31(4, 1); - P3 = IC(4); - } else { - P1 = I521(4, 5, 1); - P3 = I332(5, 7, 4); - } -} break; -case 223 : -{ - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 224 : -case 225 : -case 228 : -case 229 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 226 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 227 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 230 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 231 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 232 : -case 236 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - if (MDL) { - P2 = IC(4); - P3 = I31(4, 5); - } else { - P2 = I332(3, 7, 4); - P3 = I521(4, 7, 5); - } -} break; -case 233 : -case 237 : -{ - P0 = I31(4, 1); - P1 = I211(4, 1, 5); - P3 = I31(4, 5); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } -} break; -case 234 : -{ - P1 = I31(4, 2); - P3 = I31(4, 5); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 235 : -{ - P1 = I31(4, 2); - P3 = I31(4, 5); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 238 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - if (MDL) { - P2 = IC(4); - P3 = I31(4, 5); - } else { - P2 = I332(3, 7, 4); - P3 = I521(4, 7, 5); - } -} break; -case 239 : -{ - P1 = I31(4, 5); - P3 = I31(4, 5); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } -} break; -case 240 : -case 241 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - if (MDR) { - P2 = I31(4, 3); - P3 = IC(4); - } else { - P2 = I521(4, 7, 3); - P3 = I332(5, 7, 4); - } -} break; -case 242 : -{ - P0 = I31(4, 0); - P2 = I31(4, 3); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 243 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - if (MDR) { - P2 = I31(4, 3); - P3 = IC(4); - } else { - P2 = I521(4, 7, 3); - P3 = I332(5, 7, 4); - } -} break; -case 244 : -case 245 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 1); - P2 = I31(4, 3); - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } -} break; -case 246 : -{ - P0 = I31(4, 0); - P2 = I31(4, 3); - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 247 : -{ - P0 = I31(4, 3); - P2 = I31(4, 3); - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 249 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 251 : -{ - P1 = I31(4, 2); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 252 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } -} break; -case 253 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } -} break; -case 254 : -{ - P0 = I31(4, 0); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 255 : -{ - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; diff --git a/jan/src/intf/video/scalers/hq2xs_16.cpp b/jan/src/intf/video/scalers/hq2xs_16.cpp deleted file mode 100644 index d7671d750..000000000 --- a/jan/src/intf/video/scalers/hq2xs_16.cpp +++ /dev/null @@ -1,764 +0,0 @@ -// hq2xs, hq2xbold, hq3xs, hq3xbold filters, added by regret -// source from Snes9X v1.51+ (http://code.google.com/p/snes9x151-rerecording/) - -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef signed char int8; -typedef short int16; -typedef int int32; -typedef unsigned int uint32; - -#define Mask_2 0x07E0 // 00000 111111 00000 -#define Mask13 0xF81F // 11111 000000 11111 -#define Mask_1 0x001F // 00000 000000 11111 -#define Mask_3 0xF800 // 11111 000000 00000 -#define NUMBITS (16) - -static int RGBtoYUV[1<> 1) & Mask_2) + \ - (((((c1) & Mask13) + ((c2) & Mask13)) >> 1) & Mask13))) -#define Interp01(c1, c2) \ - ((((c1) == (c2)) ? (c1) : \ - (((((((c1) & Mask_2) * 3) + ((c2) & Mask_2)) >> 2) & Mask_2) + \ - ((((((c1) & Mask13) * 3) + ((c2) & Mask13)) >> 2) & Mask13)))) -#define Halve(c1) \ - ((((((c1) & Mask_2)) >> 1) & Mask_2) + \ - (((((c1) & Mask13)) >> 1) & Mask13)) -#define ThreeQuarters(c1) \ - ((((((c1) & Mask_2)*3) >> 2) & Mask_2) + \ - (((((c1) & Mask13)*3) >> 2) & Mask13)) - -#define Ymask 0xFF0000 -#define Umask 0x00FF00 -#define Vmask 0x0000FF -#define trY 0x300000 -#define trU 0x000700 -#define trV 0x000006 - -#define Absolute(c) \ - (!((c) & (1 << 31)) ? (c) : (~(c) + 1)) - -static inline bool Diff(int c1, int c2) -{ - int c1y = (c1 & Ymask) - (c2 & Ymask); - if (Absolute(c1y) > trY) return true; - int c1u = (c1 & Umask) - (c2 & Umask); - if (Absolute(c1u) > trU) return true; - int c1v = (c1 & Vmask) - (c2 & Vmask); - if (Absolute(c1v) > trV) return true; - - return false; -} - -void InitLUTs(void) -{ - int c, r, g, b, y, u, v; - - for (c = 0 ; c < (1<> 3; - r = (int)((c & 0xF800)) >> 8; - RGBtoBright[c] = r+r+r + g+g+g + b+b; - - y = (int)( 0.256788f*r + 0.504129f*g + 0.097906f*b + 0.5f) + 16; - u = (int)(-0.148223f*r - 0.290993f*g + 0.439216f*b + 0.5f) + 128; - v = (int)( 0.439216f*r - 0.367788f*g - 0.071427f*b + 0.5f) + 128; - - RGBtoYUV[c] = (y << 16) + (u << 8) + v; - -// y = (r + g + b) >> 2; -// u = 128 + ((r - b) >> 2); -// v = 128 + ((-r + 2 * g - b) >> 3); -// -// RGBtoYUVLQ[c] = (y << 16) + (u << 8) + v; - } -} - -#define Interp02(c1, c2, c3) \ - ((((((c1) & Mask_2) * 2 + ((c2) & Mask_2) + ((c3) & Mask_2) ) >> 2) & Mask_2) + \ - (((((c1) & Mask13) * 2 + ((c2) & Mask13) + ((c3) & Mask13) ) >> 2) & Mask13)) - -#define Interp06(c1, c2, c3) \ - ((((((c1) & Mask_2) * 5 + ((c2) & Mask_2) * 2 + ((c3) & Mask_2) ) >> 3) & Mask_2) + \ - (((((c1) & Mask13) * 5 + ((c2) & Mask13) * 2 + ((c3) & Mask13) ) >> 3) & Mask13)) - -#define Interp07(c1, c2, c3) \ - ((((((c1) & Mask_2) * 6 + ((c2) & Mask_2) + ((c3) & Mask_2) ) >> 3) & Mask_2) + \ - (((((c1) & Mask13) * 6 + ((c2) & Mask13) + ((c3) & Mask13) ) >> 3) & Mask13)) - -#define Interp09(c1, c2, c3) \ - ((((((c1) & Mask_2) * 2 + ((c2) & Mask_2) * 3 + ((c3) & Mask_2) * 3) >> 3) & Mask_2) + \ - (((((c1) & Mask13) * 2 + ((c2) & Mask13) * 3 + ((c3) & Mask13) * 3) >> 3) & Mask13)) - -#define Interp10(c1, c2, c3) \ - ((((((c1) & Mask_2) * 14 + ((c2) & Mask_2) + ((c3) & Mask_2) ) >> 4) & Mask_2) + \ - (((((c1) & Mask13) * 14 + ((c2) & Mask13) + ((c3) & Mask13) ) >> 4) & Mask13)) - - -// HQ2xS - -#define PIXEL00_0 *(dp) = w5 -#define PIXEL00_10 *(dp) = Interp01(w5, w1) -#define PIXEL00_11 *(dp) = Interp01(w5, w4) -#define PIXEL00_12 *(dp) = Interp01(w5, w2) -#define PIXEL00_20 *(dp) = Interp02(w5, w4, w2) -#define PIXEL00_21 *(dp) = Interp02(w5, w1, w2) -#define PIXEL00_22 *(dp) = Interp02(w5, w1, w4) -#define PIXEL00_60 *(dp) = Interp06(w5, w2, w4) -#define PIXEL00_61 *(dp) = Interp06(w5, w4, w2) -#define PIXEL00_70 *(dp) = Interp07(w5, w4, w2) -#define PIXEL00_90 *(dp) = Interp09(w5, w4, w2) -#define PIXEL00_100 *(dp) = Interp10(w5, w4, w2) - -#define PIXEL01_0 *(dp + 1) = w5 -#define PIXEL01_10 *(dp + 1) = Interp01(w5, w3) -#define PIXEL01_11 *(dp + 1) = Interp01(w5, w2) -#define PIXEL01_12 *(dp + 1) = Interp01(w5, w6) -#define PIXEL01_20 *(dp + 1) = Interp02(w5, w2, w6) -#define PIXEL01_21 *(dp + 1) = Interp02(w5, w3, w6) -#define PIXEL01_22 *(dp + 1) = Interp02(w5, w3, w2) -#define PIXEL01_60 *(dp + 1) = Interp06(w5, w6, w2) -#define PIXEL01_61 *(dp + 1) = Interp06(w5, w2, w6) -#define PIXEL01_70 *(dp + 1) = Interp07(w5, w2, w6) -#define PIXEL01_90 *(dp + 1) = Interp09(w5, w2, w6) -#define PIXEL01_100 *(dp + 1) = Interp10(w5, w2, w6) - -#define PIXEL10_0 *(dp + dst1line) = w5 -#define PIXEL10_10 *(dp + dst1line) = Interp01(w5, w7) -#define PIXEL10_11 *(dp + dst1line) = Interp01(w5, w8) -#define PIXEL10_12 *(dp + dst1line) = Interp01(w5, w4) -#define PIXEL10_20 *(dp + dst1line) = Interp02(w5, w8, w4) -#define PIXEL10_21 *(dp + dst1line) = Interp02(w5, w7, w4) -#define PIXEL10_22 *(dp + dst1line) = Interp02(w5, w7, w8) -#define PIXEL10_60 *(dp + dst1line) = Interp06(w5, w4, w8) -#define PIXEL10_61 *(dp + dst1line) = Interp06(w5, w8, w4) -#define PIXEL10_70 *(dp + dst1line) = Interp07(w5, w8, w4) -#define PIXEL10_90 *(dp + dst1line) = Interp09(w5, w8, w4) -#define PIXEL10_100 *(dp + dst1line) = Interp10(w5, w8, w4) - -#define PIXEL11_0 *(dp + dst1line + 1) = w5 -#define PIXEL11_10 *(dp + dst1line + 1) = Interp01(w5, w9) -#define PIXEL11_11 *(dp + dst1line + 1) = Interp01(w5, w6) -#define PIXEL11_12 *(dp + dst1line + 1) = Interp01(w5, w8) -#define PIXEL11_20 *(dp + dst1line + 1) = Interp02(w5, w6, w8) -#define PIXEL11_21 *(dp + dst1line + 1) = Interp02(w5, w9, w8) -#define PIXEL11_22 *(dp + dst1line + 1) = Interp02(w5, w9, w6) -#define PIXEL11_60 *(dp + dst1line + 1) = Interp06(w5, w8, w6) -#define PIXEL11_61 *(dp + dst1line + 1) = Interp06(w5, w6, w8) -#define PIXEL11_70 *(dp + dst1line + 1) = Interp07(w5, w6, w8) -#define PIXEL11_90 *(dp + dst1line + 1) = Interp09(w5, w6, w8) -#define PIXEL11_100 *(dp + dst1line + 1) = Interp10(w5, w6, w8) - - -#define HQ2XCASES \ - case 0: case 1: case 4: case 32: case 128: case 5: case 132: case 160: case 33: case 129: case 36: case 133: case 164: case 161: case 37: case 165: PIXEL00_20; PIXEL01_20; PIXEL10_20; PIXEL11_20; break; \ - case 2: case 34: case 130: case 162: PIXEL00_22; PIXEL01_21; PIXEL10_20; PIXEL11_20; break; \ - case 16: case 17: case 48: case 49: PIXEL00_20; PIXEL01_22; PIXEL10_20; PIXEL11_21; break; \ - case 64: case 65: case 68: case 69: PIXEL00_20; PIXEL01_20; PIXEL10_21; PIXEL11_22; break; \ - case 8: case 12: case 136: case 140: PIXEL00_21; PIXEL01_20; PIXEL10_22; PIXEL11_20; break; \ - case 3: case 35: case 131: case 163: PIXEL00_11; PIXEL01_21; PIXEL10_20; PIXEL11_20; break; \ - case 6: case 38: case 134: case 166: PIXEL00_22; PIXEL01_12; PIXEL10_20; PIXEL11_20; break; \ - case 20: case 21: case 52: case 53: PIXEL00_20; PIXEL01_11; PIXEL10_20; PIXEL11_21; break; \ - case 144: case 145: case 176: case 177: PIXEL00_20; PIXEL01_22; PIXEL10_20; PIXEL11_12; break; \ - case 192: case 193: case 196: case 197: PIXEL00_20; PIXEL01_20; PIXEL10_21; PIXEL11_11; break; \ - case 96: case 97: case 100: case 101: PIXEL00_20; PIXEL01_20; PIXEL10_12; PIXEL11_22; break; \ - case 40: case 44: case 168: case 172: PIXEL00_21; PIXEL01_20; PIXEL10_11; PIXEL11_20; break; \ - case 9: case 13: case 137: case 141: PIXEL00_12; PIXEL01_20; PIXEL10_22; PIXEL11_20; break; \ - case 18: case 50: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_20; PIXEL10_20; PIXEL11_21; break; \ - case 80: case 81: PIXEL00_20; PIXEL01_22; PIXEL10_21; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_20; break; \ - case 72: case 76: PIXEL00_21; PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_20; PIXEL11_22; break; \ - case 10: case 138: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_20; PIXEL01_21; PIXEL10_22; PIXEL11_20; break; \ - case 66: PIXEL00_22; PIXEL01_21; PIXEL10_21; PIXEL11_22; break; \ - case 24: PIXEL00_21; PIXEL01_22; PIXEL10_22; PIXEL11_21; break; \ - case 7: case 39: case 135: PIXEL00_11; PIXEL01_12; PIXEL10_20; PIXEL11_20; break; \ - case 148: case 149: case 180: PIXEL00_20; PIXEL01_11; PIXEL10_20; PIXEL11_12; break; \ - case 224: case 228: case 225: PIXEL00_20; PIXEL01_20; PIXEL10_12; PIXEL11_11; break; \ - case 41: case 169: case 45: PIXEL00_12; PIXEL01_20; PIXEL10_11; PIXEL11_20; break; \ - case 22: case 54: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_20; PIXEL11_21; break; \ - case 208: case 209: PIXEL00_20; PIXEL01_22; PIXEL10_21; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 104: case 108: PIXEL00_21; PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_22; break; \ - case 11: case 139: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_21; PIXEL10_22; PIXEL11_20; break; \ - case 19: case 51: if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL00_11, PIXEL01_10; else PIXEL00_60, PIXEL01_90; PIXEL10_20; PIXEL11_21; break; \ - case 146: case 178: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10, PIXEL11_12; else PIXEL01_90, PIXEL11_61; PIXEL10_20; break; \ - case 84: case 85: PIXEL00_20; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL01_11, PIXEL11_10; else PIXEL01_60, PIXEL11_90; PIXEL10_21; break; \ - case 112: case 113: PIXEL00_20; PIXEL01_22; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL10_12, PIXEL11_10; else PIXEL10_61, PIXEL11_90; break; \ - case 200: case 204: PIXEL00_21; PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10, PIXEL11_11; else PIXEL10_90, PIXEL11_60; break; \ - case 73: case 77: if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL00_12, PIXEL10_10; else PIXEL00_61, PIXEL10_90; PIXEL01_20; PIXEL11_22; break; \ - case 42: case 170: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10, PIXEL10_11; else PIXEL00_90, PIXEL10_60; PIXEL01_21; PIXEL11_20; break; \ - case 14: case 142: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10, PIXEL01_12; else PIXEL00_90, PIXEL01_61; PIXEL10_22; PIXEL11_20; break; \ - case 67: PIXEL00_11; PIXEL01_21; PIXEL10_21; PIXEL11_22; break; \ - case 70: PIXEL00_22; PIXEL01_12; PIXEL10_21; PIXEL11_22; break; \ - case 28: PIXEL00_21; PIXEL01_11; PIXEL10_22; PIXEL11_21; break; \ - case 152: PIXEL00_21; PIXEL01_22; PIXEL10_22; PIXEL11_12; break; \ - case 194: PIXEL00_22; PIXEL01_21; PIXEL10_21; PIXEL11_11; break; \ - case 98: PIXEL00_22; PIXEL01_21; PIXEL10_12; PIXEL11_22; break; \ - case 56: PIXEL00_21; PIXEL01_22; PIXEL10_11; PIXEL11_21; break; \ - case 25: PIXEL00_12; PIXEL01_22; PIXEL10_22; PIXEL11_21; break; \ - case 26: case 31: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_22; PIXEL11_21; break; \ - case 82: case 214: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_21; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 88: case 248: PIXEL00_21; PIXEL01_22; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 74: case 107: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_21; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_22; break; \ - case 27: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_10; PIXEL10_22; PIXEL11_21; break; \ - case 86: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_21; PIXEL11_10; break; \ - case 216: PIXEL00_21; PIXEL01_22; PIXEL10_10; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 106: PIXEL00_10; PIXEL01_21; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_22; break; \ - case 30: PIXEL00_10; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_22; PIXEL11_21; break; \ - case 210: PIXEL00_22; PIXEL01_10; PIXEL10_21; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 120: PIXEL00_21; PIXEL01_22; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_10; break; \ - case 75: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_21; PIXEL10_10; PIXEL11_22; break; \ - case 29: PIXEL00_12; PIXEL01_11; PIXEL10_22; PIXEL11_21; break; \ - case 198: PIXEL00_22; PIXEL01_12; PIXEL10_21; PIXEL11_11; break; \ - case 184: PIXEL00_21; PIXEL01_22; PIXEL10_11; PIXEL11_12; break; \ - case 99: PIXEL00_11; PIXEL01_21; PIXEL10_12; PIXEL11_22; break; \ - case 57: PIXEL00_12; PIXEL01_22; PIXEL10_11; PIXEL11_21; break; \ - case 71: PIXEL00_11; PIXEL01_12; PIXEL10_21; PIXEL11_22; break; \ - case 156: PIXEL00_21; PIXEL01_11; PIXEL10_22; PIXEL11_12; break; \ - case 226: PIXEL00_22; PIXEL01_21; PIXEL10_12; PIXEL11_11; break; \ - case 60: PIXEL00_21; PIXEL01_11; PIXEL10_11; PIXEL11_21; break; \ - case 195: PIXEL00_11; PIXEL01_21; PIXEL10_21; PIXEL11_11; break; \ - case 102: PIXEL00_22; PIXEL01_12; PIXEL10_12; PIXEL11_22; break; \ - case 153: PIXEL00_12; PIXEL01_22; PIXEL10_22; PIXEL11_12; break; \ - case 58: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; PIXEL10_11; PIXEL11_21; break; \ - case 83: PIXEL00_11; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; PIXEL10_21; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 92: PIXEL00_21; PIXEL01_11; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 202: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; PIXEL01_21; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; PIXEL11_11; break; \ - case 78: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; PIXEL01_12; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; PIXEL11_22; break; \ - case 154: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; PIXEL10_22; PIXEL11_12; break; \ - case 114: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; PIXEL10_12; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 89: PIXEL00_12; PIXEL01_22; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 90: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 55: case 23: if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL00_11, PIXEL01_0; else PIXEL00_60, PIXEL01_90; PIXEL10_20; PIXEL11_21; break; \ - case 182: case 150: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0, PIXEL11_12; else PIXEL01_90, PIXEL11_61; PIXEL10_20; break; \ - case 213: case 212: PIXEL00_20; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL01_11, PIXEL11_0; else PIXEL01_60, PIXEL11_90; PIXEL10_21; break; \ - case 241: case 240: PIXEL00_20; PIXEL01_22; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL10_12, PIXEL11_0; else PIXEL10_61, PIXEL11_90; break; \ - case 236: case 232: PIXEL00_21; PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0, PIXEL11_11; else PIXEL10_90, PIXEL11_60; break; \ - case 109: case 105: if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL00_12, PIXEL10_0; else PIXEL00_61, PIXEL10_90; PIXEL01_20; PIXEL11_22; break; \ - case 171: case 43: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0, PIXEL10_11; else PIXEL00_90, PIXEL10_60; PIXEL01_21; PIXEL11_20; break; \ - case 143: case 15: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0, PIXEL01_12; else PIXEL00_90, PIXEL01_61; PIXEL10_22; PIXEL11_20; break; \ - case 124: PIXEL00_21; PIXEL01_11; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_10; break; \ - case 203: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_21; PIXEL10_10; PIXEL11_11; break; \ - case 62: PIXEL00_10; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_11; PIXEL11_21; break; \ - case 211: PIXEL00_11; PIXEL01_10; PIXEL10_21; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 118: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_12; PIXEL11_10; break; \ - case 217: PIXEL00_12; PIXEL01_22; PIXEL10_10; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 110: PIXEL00_10; PIXEL01_12; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_22; break; \ - case 155: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_10; PIXEL10_22; PIXEL11_12; break; \ - case 188: PIXEL00_21; PIXEL01_11; PIXEL10_11; PIXEL11_12; break; \ - case 185: PIXEL00_12; PIXEL01_22; PIXEL10_11; PIXEL11_12; break; \ - case 61: PIXEL00_12; PIXEL01_11; PIXEL10_11; PIXEL11_21; break; \ - case 157: PIXEL00_12; PIXEL01_11; PIXEL10_22; PIXEL11_12; break; \ - case 103: PIXEL00_11; PIXEL01_12; PIXEL10_12; PIXEL11_22; break; \ - case 227: PIXEL00_11; PIXEL01_21; PIXEL10_12; PIXEL11_11; break; \ - case 230: PIXEL00_22; PIXEL01_12; PIXEL10_12; PIXEL11_11; break; \ - case 199: PIXEL00_11; PIXEL01_12; PIXEL10_21; PIXEL11_11; break; \ - case 220: PIXEL00_21; PIXEL01_11; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 158: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_22; PIXEL11_12; break; \ - case 234: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; PIXEL01_21; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_11; break; \ - case 242: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; PIXEL10_12; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 59: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; PIXEL10_11; PIXEL11_21; break; \ - case 121: PIXEL00_12; PIXEL01_22; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 87: PIXEL00_11; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_21; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 79: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_12; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; PIXEL11_22; break; \ - case 122: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 94: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 218: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 91: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 229: PIXEL00_20; PIXEL01_20; PIXEL10_12; PIXEL11_11; break; \ - case 167: PIXEL00_11; PIXEL01_12; PIXEL10_20; PIXEL11_20; break; \ - case 173: PIXEL00_12; PIXEL01_20; PIXEL10_11; PIXEL11_20; break; \ - case 181: PIXEL00_20; PIXEL01_11; PIXEL10_20; PIXEL11_12; break; \ - case 186: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; PIXEL10_11; PIXEL11_12; break; \ - case 115: PIXEL00_11; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; PIXEL10_12; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 93: PIXEL00_12; PIXEL01_11; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 206: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; PIXEL01_12; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; PIXEL11_11; break; \ - case 205: case 201: PIXEL00_12; PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_10; else PIXEL10_70; PIXEL11_11; break; \ - case 174: case 46: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_10; else PIXEL00_70; PIXEL01_12; PIXEL10_11; PIXEL11_20; break; \ - case 179: case 147: PIXEL00_11; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_10; else PIXEL01_70; PIXEL10_20; PIXEL11_12; break; \ - case 117: case 116: PIXEL00_20; PIXEL01_11; PIXEL10_12; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_10; else PIXEL11_70; break; \ - case 189: PIXEL00_12; PIXEL01_11; PIXEL10_11; PIXEL11_12; break; \ - case 231: PIXEL00_11; PIXEL01_12; PIXEL10_12; PIXEL11_11; break; \ - case 126: PIXEL00_10; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_10; break; \ - case 219: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_10; PIXEL10_10; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 125: if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL00_12, PIXEL10_0; else PIXEL00_61, PIXEL10_90; PIXEL01_11; PIXEL11_10; break; \ - case 221: PIXEL00_12; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL01_11, PIXEL11_0; else PIXEL01_60, PIXEL11_90; PIXEL10_10; break; \ - case 207: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0, PIXEL01_12; else PIXEL00_90, PIXEL01_61; PIXEL10_10; PIXEL11_11; break; \ - case 238: PIXEL00_10; PIXEL01_12; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0, PIXEL11_11; else PIXEL10_90, PIXEL11_60; break; \ - case 190: PIXEL00_10; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0, PIXEL11_12; else PIXEL01_90, PIXEL11_61; PIXEL10_11; break; \ - case 187: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0, PIXEL10_11; else PIXEL00_90, PIXEL10_60; PIXEL01_10; PIXEL11_12; break; \ - case 243: PIXEL00_11; PIXEL01_10; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL10_12, PIXEL11_0; else PIXEL10_61, PIXEL11_90; break; \ - case 119: if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL00_11, PIXEL01_0; else PIXEL00_60, PIXEL01_90; PIXEL10_12; PIXEL11_10; break; \ - case 237: case 233: PIXEL00_12; PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_100; PIXEL11_11; break; \ - case 175: case 47: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_100; PIXEL01_12; PIXEL10_11; PIXEL11_20; break; \ - case 183: case 151: PIXEL00_11; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_100; PIXEL10_20; PIXEL11_12; break; \ - case 245: case 244: PIXEL00_20; PIXEL01_11; PIXEL10_12; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_100; break; \ - case 250: PIXEL00_10; PIXEL01_10; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 123: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_10; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_10; break; \ - case 95: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_10; PIXEL11_10; break; \ - case 222: PIXEL00_10; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_10; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 252: PIXEL00_21; PIXEL01_11; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_100; break; \ - case 249: PIXEL00_12; PIXEL01_22; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_100; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 235: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_21; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_100; PIXEL11_11; break; \ - case 111: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_100; PIXEL01_12; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_22; break; \ - case 63: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_100; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_11; PIXEL11_21; break; \ - case 159: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_100; PIXEL10_22; PIXEL11_12; break; \ - case 215: PIXEL00_11; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_100; PIXEL10_21; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 246: PIXEL00_22; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; PIXEL10_12; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_100; break; \ - case 254: PIXEL00_10; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_100; break; \ - case 253: PIXEL00_12; PIXEL01_11; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_100; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_100; break; \ - case 251: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; PIXEL01_10; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_100; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 239: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_100; PIXEL01_12; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_100; PIXEL11_11; break; \ - case 127: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_100; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_20; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_20; PIXEL11_10; break; \ - case 191: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_100; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_100; PIXEL10_11; PIXEL11_12; break; \ - case 223: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_20; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_100; PIXEL10_10; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_20; break; \ - case 247: PIXEL00_11; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_100; PIXEL10_12; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_100; break; \ - case 255: if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) PIXEL00_0; else PIXEL00_100; if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) PIXEL01_0; else PIXEL01_100; if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) PIXEL10_0; else PIXEL10_100; if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) PIXEL11_0; else PIXEL11_100; break; - - -void RenderHQ2XS(unsigned char *src, unsigned int srcpitch, unsigned char *dst, unsigned int dstpitch, int nWidth, int nHeight, int type) -{ - uint8 *srcPtr = src; - uint8 *dstPtr = dst; - uint32 srcPitch = srcpitch; - uint32 dstPitch = dstpitch; - int width = nWidth; - int height = nHeight; - - int w1, w2, w3, w4, w5, w6, w7, w8, w9; - - uint32 src1line = srcPitch >> 1; - uint32 dst1line = dstPitch >> 1; - uint16 *sp = (uint16 *) srcPtr; - uint16 *dp = (uint16 *) dstPtr; - - const int* RGBtoYUVtable = RGBtoYUV; - - uint32 pattern; - int l, y; - - while (height--) - { - sp--; - - w1 = *(sp - src1line); - w4 = *(sp); - w7 = *(sp + src1line); - - sp++; - - w2 = *(sp - src1line); - w5 = *(sp); - w8 = *(sp + src1line); - - for (l = width; l; l--) - { - sp++; - - w3 = *(sp - src1line); - w6 = *(sp); - w9 = *(sp + src1line); - - pattern = 0; - - if (type == 0) // hq2xs - { - bool nosame = true; - if(w1 == w5 || w3 == w5 || w7 == w5 || w9 == w5) - nosame = false; - - if(nosame) - { - const uint16 avg = (RGBtoBright[w1] + RGBtoBright[w2] + RGBtoBright[w3] + RGBtoBright[w4] + RGBtoBright[w5] + RGBtoBright[w6] + RGBtoBright[w7] + RGBtoBright[w8] + RGBtoBright[w9]) / 9; - const bool diff5 = RGBtoBright[w5] > avg; - if((RGBtoBright[w1] > avg) != diff5) pattern |= (1 << 0); - if((RGBtoBright[w2] > avg) != diff5) pattern |= (1 << 1); - if((RGBtoBright[w3] > avg) != diff5) pattern |= (1 << 2); - if((RGBtoBright[w4] > avg) != diff5) pattern |= (1 << 3); - if((RGBtoBright[w6] > avg) != diff5) pattern |= (1 << 4); - if((RGBtoBright[w7] > avg) != diff5) pattern |= (1 << 5); - if((RGBtoBright[w8] > avg) != diff5) pattern |= (1 << 6); - if((RGBtoBright[w9] > avg) != diff5) pattern |= (1 << 7); - } - else - { - y = RGBtoYUV[w5]; - if ((w1 != w5) && (Diff(y, RGBtoYUV[w1]))) pattern |= (1 << 0); - if ((w2 != w5) && (Diff(y, RGBtoYUV[w2]))) pattern |= (1 << 1); - if ((w3 != w5) && (Diff(y, RGBtoYUV[w3]))) pattern |= (1 << 2); - if ((w4 != w5) && (Diff(y, RGBtoYUV[w4]))) pattern |= (1 << 3); - if ((w6 != w5) && (Diff(y, RGBtoYUV[w6]))) pattern |= (1 << 4); - if ((w7 != w5) && (Diff(y, RGBtoYUV[w7]))) pattern |= (1 << 5); - if ((w8 != w5) && (Diff(y, RGBtoYUV[w8]))) pattern |= (1 << 6); - if ((w9 != w5) && (Diff(y, RGBtoYUV[w9]))) pattern |= (1 << 7); - } - } - else if (type == 1) // hq2xbold - { - const uint16 avg = (RGBtoBright[w1] + RGBtoBright[w2] + RGBtoBright[w3] + RGBtoBright[w4] + RGBtoBright[w5] + RGBtoBright[w6] + RGBtoBright[w7] + RGBtoBright[w8] + RGBtoBright[w9]) / 9; - const bool diff5 = RGBtoBright[w5] > avg; - if ((w1 != w5) && ((RGBtoBright[w1] > avg) != diff5)) pattern |= (1 << 0); - if ((w2 != w5) && ((RGBtoBright[w2] > avg) != diff5)) pattern |= (1 << 1); - if ((w3 != w5) && ((RGBtoBright[w3] > avg) != diff5)) pattern |= (1 << 2); - if ((w4 != w5) && ((RGBtoBright[w4] > avg) != diff5)) pattern |= (1 << 3); - if ((w6 != w5) && ((RGBtoBright[w6] > avg) != diff5)) pattern |= (1 << 4); - if ((w7 != w5) && ((RGBtoBright[w7] > avg) != diff5)) pattern |= (1 << 5); - if ((w8 != w5) && ((RGBtoBright[w8] > avg) != diff5)) pattern |= (1 << 6); - if ((w9 != w5) && ((RGBtoBright[w9] > avg) != diff5)) pattern |= (1 << 7); - } - - switch (pattern) - { - HQ2XCASES - } - - w1 = w2; w4 = w5; w7 = w8; - w2 = w3; w5 = w6; w8 = w9; - - dp += 2; - } - - dp += ((dst1line - width) << 1); - sp += (src1line - width); - } -} - - -// HQ3xS - -#define PIXEL00_1M *(dp) = Interp01(w5, w1); -#define PIXEL00_1U *(dp) = Interp01(w5, w2); -#define PIXEL00_1L *(dp) = Interp01(w5, w4); -#define PIXEL00_2 *(dp) = Interp02(w5, w4, w2); -#define PIXEL00_4 *(dp) = Interp04(w5, w4, w2); -#define PIXEL00_5 *(dp) = Interp05(w4, w2); -#define PIXEL00_C *(dp) = w5; - -#define PIXEL01_1 *(dp + 1) = Interp01(w5, w2); -#define PIXEL01_3 *(dp + 1) = Interp03(w5, w2); -#define PIXEL01_6 *(dp + 1) = Interp01(w2, w5); -#define PIXEL01_C *(dp + 1) = w5; - -#define PIXEL02_1M *(dp + 2) = Interp01(w5, w3); -#define PIXEL02_1U *(dp + 2) = Interp01(w5, w2); -#define PIXEL02_1R *(dp + 2) = Interp01(w5, w6); -#define PIXEL02_2 *(dp + 2) = Interp02(w5, w2, w6); -#define PIXEL02_4 *(dp + 2) = Interp04(w5, w2, w6); -#define PIXEL02_5 *(dp + 2) = Interp05(w2, w6); -#define PIXEL02_C *(dp + 2) = w5; - -#define PIXEL10_1 *(dp + dst1line) = Interp01(w5, w4); -#define PIXEL10_3 *(dp + dst1line) = Interp03(w5, w4); -#define PIXEL10_6 *(dp + dst1line) = Interp01(w4, w5); -#define PIXEL10_C *(dp + dst1line) = w5; - -#define PIXEL11 *(dp + dst1line + 1) = w5; - -#define PIXEL12_1 *(dp + dst1line + 2) = Interp01(w5, w6); -#define PIXEL12_3 *(dp + dst1line + 2) = Interp03(w5, w6); -#define PIXEL12_6 *(dp + dst1line + 2) = Interp01(w6, w5); -#define PIXEL12_C *(dp + dst1line + 2) = w5; - -#define PIXEL20_1M *(dp + dst1line + dst1line) = Interp01(w5, w7); -#define PIXEL20_1D *(dp + dst1line + dst1line) = Interp01(w5, w8); -#define PIXEL20_1L *(dp + dst1line + dst1line) = Interp01(w5, w4); -#define PIXEL20_2 *(dp + dst1line + dst1line) = Interp02(w5, w8, w4); -#define PIXEL20_4 *(dp + dst1line + dst1line) = Interp04(w5, w8, w4); -#define PIXEL20_5 *(dp + dst1line + dst1line) = Interp05(w8, w4); -#define PIXEL20_C *(dp + dst1line + dst1line) = w5; - -#define PIXEL21_1 *(dp + dst1line + dst1line + 1) = Interp01(w5, w8); -#define PIXEL21_3 *(dp + dst1line + dst1line + 1) = Interp03(w5, w8); -#define PIXEL21_6 *(dp + dst1line + dst1line + 1) = Interp01(w8, w5); -#define PIXEL21_C *(dp + dst1line + dst1line + 1) = w5; - -#define PIXEL22_1M *(dp + dst1line + dst1line + 2) = Interp01(w5, w9); -#define PIXEL22_1D *(dp + dst1line + dst1line + 2) = Interp01(w5, w8); -#define PIXEL22_1R *(dp + dst1line + dst1line + 2) = Interp01(w5, w6); -#define PIXEL22_2 *(dp + dst1line + dst1line + 2) = Interp02(w5, w6, w8); -#define PIXEL22_4 *(dp + dst1line + dst1line + 2) = Interp04(w5, w6, w8); -#define PIXEL22_5 *(dp + dst1line + dst1line + 2) = Interp05(w6, w8); -#define PIXEL22_C *(dp + dst1line + dst1line + 2) = w5; - -#define Interp03(c1, c2) \ - (((c1 == c2) ? c1 : \ - ((((((c1) & Mask_2) * 7 + ((c2) & Mask_2)) >> 3) & Mask_2) + \ - (((((c1) & Mask13) * 7 + ((c2) & Mask13)) >> 3) & Mask13)))) - -#define Interp04(c1, c2, c3) \ - ((((((c1) & Mask_2) * 2 + ((c2) & Mask_2) * 7 + ((c3) & Mask_2) * 7) >> 4) & Mask_2) + \ - (((((c1) & Mask13) * 2 + ((c2) & Mask13) * 7 + ((c3) & Mask13) * 7) >> 4) & Mask13)) - -#define HQ3XCASES \ - case 0: case 1: case 4: case 32: case 128: case 5: case 132: case 160: case 33: case 129: case 36: case 133: case 164: case 161: case 37: case 165: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; }\ - case 2: case 34: case 130: case 162: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; }\ - case 16: case 17: case 48: case 49: { PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1M break; }\ - case 64: case 65: case 68: case 69: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; }\ - case 8: case 12: case 136: case 140: { PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; }\ - case 3: case 35: case 131: case 163: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; }\ - case 6: case 38: case 134: case 166: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; }\ - case 20: case 21: case 52: case 53: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1M break; }\ - case 144: case 145: case 176: case 177: { PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; }\ - case 192: case 193: case 196: case 197: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; }\ - case 96: case 97: case 100: case 101: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; }\ - case 40: case 44: case 168: case 172: { PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; }\ - case 9: case 13: case 137: case 141: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; }\ - case 18: case 50: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_1M PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 PIXEL22_1M break; }\ - case 80: case 81: { PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_1M } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 72: case 76: { PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_1M PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 10: case 138: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; }\ - case 66: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; }\ - case 24: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; }\ - case 7: case 39: case 135: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; }\ - case 148: case 149: case 180: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; }\ - case 224: case 228: case 225: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; }\ - case 41: case 169: case 45: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; }\ - case 22: case 54: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 PIXEL22_1M break; }\ - case 208: case 209: { PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 104: case 108: { PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 11: case 139: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; }\ - case 19: case 51: { if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL12_C } else { PIXEL00_2 PIXEL01_6 PIXEL02_5 PIXEL12_1 } PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 PIXEL22_1M break; }\ - case 146: case 178: { if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_1M PIXEL12_C PIXEL22_1D } else { PIXEL01_1 PIXEL02_5 PIXEL12_6 PIXEL22_2 } PIXEL00_1M PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 break; }\ - case 84: case 85: { if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL02_1U PIXEL12_C PIXEL21_C PIXEL22_1M } else { PIXEL02_2 PIXEL12_6 PIXEL21_1 PIXEL22_5 } PIXEL00_2 PIXEL01_1 PIXEL10_1 PIXEL11 PIXEL20_1M break; }\ - case 112: case 113: { if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL20_1L PIXEL21_C PIXEL22_1M } else { PIXEL12_1 PIXEL20_2 PIXEL21_6 PIXEL22_5 } PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 break; }\ - case 200: case 204: { if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_1M PIXEL21_C PIXEL22_1R } else { PIXEL10_1 PIXEL20_5 PIXEL21_6 PIXEL22_2 } PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 break; }\ - case 73: case 77: { if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL00_1U PIXEL10_C PIXEL20_1M PIXEL21_C } else { PIXEL00_2 PIXEL10_6 PIXEL20_5 PIXEL21_1 } PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 PIXEL22_1M break; }\ - case 42: case 170: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M PIXEL01_C PIXEL10_C PIXEL20_1D } else { PIXEL00_5 PIXEL01_1 PIXEL10_6 PIXEL20_2 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL21_1 PIXEL22_2 break; }\ - case 14: case 142: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_C } else { PIXEL00_5 PIXEL01_6 PIXEL02_2 PIXEL10_1 } PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; }\ - case 67: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; }\ - case 70: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; }\ - case 28: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; }\ - case 152: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; }\ - case 194: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; }\ - case 98: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; }\ - case 56: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; }\ - case 25: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; }\ - case 26: case 31: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL10_C } else { PIXEL00_4 PIXEL10_3 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C PIXEL12_C } else { PIXEL02_4 PIXEL12_3 } PIXEL11 PIXEL20_1M PIXEL21_1 PIXEL22_1M break; }\ - case 82: case 214: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C } else { PIXEL01_3 PIXEL02_4 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL21_C PIXEL22_C } else { PIXEL21_3 PIXEL22_4 } break; }\ - case 88: case 248: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C } else { PIXEL10_3 PIXEL20_4 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL22_C } else { PIXEL12_3 PIXEL22_4 } break; }\ - case 74: case 107: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C } else { PIXEL00_4 PIXEL01_3 } PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C PIXEL21_C } else { PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 27: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; }\ - case 86: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_1M PIXEL21_C PIXEL22_1M break; }\ - case 216: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 106: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 30: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 PIXEL20_1M PIXEL21_1 PIXEL22_1M break; }\ - case 210: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 120: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 75: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; }\ - case 29: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; }\ - case 198: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; }\ - case 184: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; }\ - case 99: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; }\ - case 57: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; }\ - case 71: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; }\ - case 156: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; }\ - case 226: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; }\ - case 60: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; }\ - case 195: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; }\ - case 102: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; }\ - case 153: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; }\ - case 58: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; }\ - case 83: { PIXEL00_1L PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 92: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 202: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; }\ - case 78: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1M break; }\ - case 154: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; }\ - case 114: { PIXEL00_1M PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 89: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 90: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 55: case 23: { if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL00_1L PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL00_2 PIXEL01_6 PIXEL02_5 PIXEL12_1 } PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 PIXEL22_1M break; }\ - case 182: case 150: { if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C PIXEL22_1D } else { PIXEL01_1 PIXEL02_5 PIXEL12_6 PIXEL22_2 } PIXEL00_1M PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 break; }\ - case 213: case 212: { if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL02_1U PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL02_2 PIXEL12_6 PIXEL21_1 PIXEL22_5 } PIXEL00_2 PIXEL01_1 PIXEL10_1 PIXEL11 PIXEL20_1M break; }\ - case 241: case 240: { if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL20_1L PIXEL21_C PIXEL22_C } else { PIXEL12_1 PIXEL20_2 PIXEL21_6 PIXEL22_5 } PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 break; }\ - case 236: case 232: { if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C PIXEL22_1R } else { PIXEL10_1 PIXEL20_5 PIXEL21_6 PIXEL22_2 } PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 break; }\ - case 109: case 105: { if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL00_1U PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL00_2 PIXEL10_6 PIXEL20_5 PIXEL21_1 } PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 PIXEL22_1M break; }\ - case 171: case 43: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C PIXEL20_1D } else { PIXEL00_5 PIXEL01_1 PIXEL10_6 PIXEL20_2 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL21_1 PIXEL22_2 break; }\ - case 143: case 15: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL02_1R PIXEL10_C } else { PIXEL00_5 PIXEL01_6 PIXEL02_2 PIXEL10_1 } PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; }\ - case 124: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 203: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; }\ - case 62: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 PIXEL20_1D PIXEL21_1 PIXEL22_1M break; }\ - case 211: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 118: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_1L PIXEL21_C PIXEL22_1M break; }\ - case 217: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 110: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 155: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; }\ - case 188: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; }\ - case 185: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; }\ - case 61: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; }\ - case 157: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; }\ - case 103: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; }\ - case 227: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; }\ - case 230: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; }\ - case 199: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; }\ - case 220: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 158: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 PIXEL20_1M PIXEL21_1 PIXEL22_1D break; }\ - case 234: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1M PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1R break; }\ - case 242: { PIXEL00_1M PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL20_1L if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 59: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; }\ - case 121: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 87: { PIXEL00_1L if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_1M PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 79: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1R PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1M break; }\ - case 122: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 94: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 218: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 91: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 229: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; }\ - case 167: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; }\ - case 173: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; }\ - case 181: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; }\ - case 186: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; }\ - case 115: { PIXEL00_1L PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 93: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 206: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; }\ - case 205: case 201: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; }\ - case 174: case 46: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; }\ - case 179: case 147: { PIXEL00_1L PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; }\ - case 117: case 116: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_1M } else { PIXEL22_2 } break; }\ - case 189: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; }\ - case 231: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; }\ - case 126: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 219: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; }\ - case 125: { if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL00_1U PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL00_2 PIXEL10_6 PIXEL20_5 PIXEL21_1 } PIXEL01_1 PIXEL02_1U PIXEL11 PIXEL12_C PIXEL22_1M break; }\ - case 221: { if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL02_1U PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL02_2 PIXEL12_6 PIXEL21_1 PIXEL22_5 } PIXEL00_1U PIXEL01_1 PIXEL10_C PIXEL11 PIXEL20_1M break; }\ - case 207: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL02_1R PIXEL10_C } else { PIXEL00_5 PIXEL01_6 PIXEL02_2 PIXEL10_1 } PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; }\ - case 238: { if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C PIXEL22_1R } else { PIXEL10_1 PIXEL20_5 PIXEL21_6 PIXEL22_2 } PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL11 PIXEL12_1 break; }\ - case 190: { if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C PIXEL22_1D } else { PIXEL01_1 PIXEL02_5 PIXEL12_6 PIXEL22_2 } PIXEL00_1M PIXEL10_C PIXEL11 PIXEL20_1D PIXEL21_1 break; }\ - case 187: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C PIXEL20_1D } else { PIXEL00_5 PIXEL01_1 PIXEL10_6 PIXEL20_2 } PIXEL02_1M PIXEL11 PIXEL12_C PIXEL21_1 PIXEL22_1D break; }\ - case 243: { if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL20_1L PIXEL21_C PIXEL22_C } else { PIXEL12_1 PIXEL20_2 PIXEL21_6 PIXEL22_5 } PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 break; }\ - case 119: { if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL00_1L PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL00_2 PIXEL01_6 PIXEL02_5 PIXEL12_1 } PIXEL10_1 PIXEL11 PIXEL20_1L PIXEL21_C PIXEL22_1M break; }\ - case 237: case 233: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; }\ - case 175: case 47: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; }\ - case 183: case 151: { PIXEL00_1L PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; }\ - case 245: case 244: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_C } else { PIXEL22_2 } break; }\ - case 250: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C } else { PIXEL10_3 PIXEL20_4 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL22_C } else { PIXEL12_3 PIXEL22_4 } break; }\ - case 123: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C } else { PIXEL00_4 PIXEL01_3 } PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C PIXEL21_C } else { PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 95: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL10_C } else { PIXEL00_4 PIXEL10_3 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C PIXEL12_C } else { PIXEL02_4 PIXEL12_3 } PIXEL11 PIXEL20_1M PIXEL21_C PIXEL22_1M break; }\ - case 222: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C } else { PIXEL01_3 PIXEL02_4 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL21_C PIXEL22_C } else { PIXEL21_3 PIXEL22_4 } break; }\ - case 252: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C } else { PIXEL10_3 PIXEL20_4 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_C } else { PIXEL22_2 } break; }\ - case 249: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL22_C } else { PIXEL12_3 PIXEL22_4 } break; }\ - case 235: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C } else { PIXEL00_4 PIXEL01_3 } PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; }\ - case 111: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C PIXEL21_C } else { PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 63: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C PIXEL12_C } else { PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 PIXEL20_1D PIXEL21_1 PIXEL22_1M break; }\ - case 159: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL10_C } else { PIXEL00_4 PIXEL10_3 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; }\ - case 215: { PIXEL00_1L PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL21_C PIXEL22_C } else { PIXEL21_3 PIXEL22_4 } break; }\ - case 246: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C } else { PIXEL01_3 PIXEL02_4 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_C } else { PIXEL22_2 } break; }\ - case 254: { PIXEL00_1M if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C } else { PIXEL01_3 PIXEL02_4 } PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C } else { PIXEL10_3 PIXEL20_4 } if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_2 } break; }\ - case 253: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_C } else { PIXEL22_2 } break; }\ - case 251: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C } else { PIXEL00_4 PIXEL01_3 } PIXEL02_1M PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_2 PIXEL21_3 } if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL12_C PIXEL22_C } else { PIXEL12_3 PIXEL22_4 } break; }\ - case 239: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; }\ - case 127: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_2 PIXEL01_3 PIXEL10_3 } if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C PIXEL12_C } else { PIXEL02_4 PIXEL12_3 } PIXEL11 if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C PIXEL21_C } else { PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; }\ - case 191: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; }\ - case 223: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C PIXEL10_C } else { PIXEL00_4 PIXEL10_3 } if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_2 PIXEL12_3 } PIXEL11 PIXEL20_1M if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL21_C PIXEL22_C } else { PIXEL21_3 PIXEL22_4 } break; }\ - case 247: { PIXEL00_1L PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_C } else { PIXEL22_2 } break; }\ - case 255: { if (Diff(RGBtoYUVtable[w4], RGBtoYUVtable[w2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C if (Diff(RGBtoYUVtable[w2], RGBtoYUVtable[w6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C if (Diff(RGBtoYUVtable[w8], RGBtoYUVtable[w4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C if (Diff(RGBtoYUVtable[w6], RGBtoYUVtable[w8])) { PIXEL22_C } else { PIXEL22_2 } break; } - - -void RenderHQ3XS(unsigned char *src, unsigned int srcpitch, unsigned char *dst, unsigned int dstpitch, int nWidth, int nHeight, int type) -{ - uint8 *srcPtr = src; - uint8 *dstPtr = dst; - uint32 srcPitch = srcpitch; - uint32 dstPitch = dstpitch; - int width = nWidth; - int height = nHeight; - - int w1, w2, w3, w4, w5, w6, w7, w8, w9; - - uint32 src1line = srcPitch >> 1; - uint32 dst1line = dstPitch >> 1; - uint16 *sp = (uint16 *) srcPtr; - uint16 *dp = (uint16 *) dstPtr; - - const int* RGBtoYUVtable = RGBtoYUV; - - uint32 pattern; - int l, y; - - while (height--) - { - sp--; - - w1 = *(sp - src1line); - w4 = *(sp); - w7 = *(sp + src1line); - - sp++; - - w2 = *(sp - src1line); - w5 = *(sp); - w8 = *(sp + src1line); - - for (l = width; l; l--) - { - sp++; - - w3 = *(sp - src1line); - w6 = *(sp); - w9 = *(sp + src1line); - - pattern = 0; - - if (type == 0) // hq3xs - { - bool nosame = true; - if(w1 == w5 || w3 == w5 || w7 == w5 || w9 == w5) - nosame = false; - - if(nosame) - { - const uint16 avg = (RGBtoBright[w1] + RGBtoBright[w2] + RGBtoBright[w3] + RGBtoBright[w4] + RGBtoBright[w5] + RGBtoBright[w6] + RGBtoBright[w7] + RGBtoBright[w8] + RGBtoBright[w9]) / 9; - const bool diff5 = RGBtoBright[w5] > avg; - if((RGBtoBright[w1] > avg) != diff5) pattern |= (1 << 0); - if((RGBtoBright[w2] > avg) != diff5) pattern |= (1 << 1); - if((RGBtoBright[w3] > avg) != diff5) pattern |= (1 << 2); - if((RGBtoBright[w4] > avg) != diff5) pattern |= (1 << 3); - if((RGBtoBright[w6] > avg) != diff5) pattern |= (1 << 4); - if((RGBtoBright[w7] > avg) != diff5) pattern |= (1 << 5); - if((RGBtoBright[w8] > avg) != diff5) pattern |= (1 << 6); - if((RGBtoBright[w9] > avg) != diff5) pattern |= (1 << 7); - } - else - { - y = RGBtoYUV[w5]; - if ((w1 != w5) && (Diff(y, RGBtoYUV[w1]))) pattern |= (1 << 0); - if ((w2 != w5) && (Diff(y, RGBtoYUV[w2]))) pattern |= (1 << 1); - if ((w3 != w5) && (Diff(y, RGBtoYUV[w3]))) pattern |= (1 << 2); - if ((w4 != w5) && (Diff(y, RGBtoYUV[w4]))) pattern |= (1 << 3); - if ((w6 != w5) && (Diff(y, RGBtoYUV[w6]))) pattern |= (1 << 4); - if ((w7 != w5) && (Diff(y, RGBtoYUV[w7]))) pattern |= (1 << 5); - if ((w8 != w5) && (Diff(y, RGBtoYUV[w8]))) pattern |= (1 << 6); - if ((w9 != w5) && (Diff(y, RGBtoYUV[w9]))) pattern |= (1 << 7); - } - } - else if (type == 1) // hq3xbold - { - const uint16 avg = (RGBtoBright[w1] + RGBtoBright[w2] + RGBtoBright[w3] + RGBtoBright[w4] + RGBtoBright[w5] + RGBtoBright[w6] + RGBtoBright[w7] + RGBtoBright[w8] + RGBtoBright[w9]) / 9; - const bool diff5 = RGBtoBright[w5] > avg; - if ((w1 != w5) && ((RGBtoBright[w1] > avg) != diff5)) pattern |= (1 << 0); - if ((w2 != w5) && ((RGBtoBright[w2] > avg) != diff5)) pattern |= (1 << 1); - if ((w3 != w5) && ((RGBtoBright[w3] > avg) != diff5)) pattern |= (1 << 2); - if ((w4 != w5) && ((RGBtoBright[w4] > avg) != diff5)) pattern |= (1 << 3); - if ((w6 != w5) && ((RGBtoBright[w6] > avg) != diff5)) pattern |= (1 << 4); - if ((w7 != w5) && ((RGBtoBright[w7] > avg) != diff5)) pattern |= (1 << 5); - if ((w8 != w5) && ((RGBtoBright[w8] > avg) != diff5)) pattern |= (1 << 6); - if ((w9 != w5) && ((RGBtoBright[w9] > avg) != diff5)) pattern |= (1 << 7); - } - - switch (pattern) - { - HQ3XCASES - } - - w1 = w2; w4 = w5; w7 = w8; - w2 = w3; w5 = w6; w8 = w9; - - dp += 3; - } - - dp += ((dst1line - width) * 3); - sp += (src1line - width); - } -} diff --git a/jan/src/intf/video/scalers/hq3x32.asm b/jan/src/intf/video/scalers/hq3x32.asm deleted file mode 100644 index e45deddd7..000000000 --- a/jan/src/intf/video/scalers/hq3x32.asm +++ /dev/null @@ -1,2475 +0,0 @@ -;hq3x filter -;---------------------------------------------------------- -;Copyright (C) 2003 MaxSt ( maxst@hiend3d.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -GLOBAL _hq3x_32 - -EXTERN _LUT16to32 -EXTERN _RGBtoYUV - -SECTION .bss -firstline resd 1 -linesleft resd 1 -xcounter resd 1 -cross resd 1 -nextline resd 1 -prevline resd 1 -w1 resd 1 -w2 resd 1 -w3 resd 1 -w4 resd 1 -w5 resd 1 -w6 resd 1 -w7 resd 1 -w8 resd 1 -w9 resd 1 -c1 resd 1 -c2 resd 1 -c3 resd 1 -c4 resd 1 -c5 resd 1 -c6 resd 1 -c7 resd 1 -c8 resd 1 -c9 resd 1 - -SECTION .data - -reg_blank dd 0,0 -const7 dd 0x00070007,0x00000007 -threshold dd 0x00300706,0x00000000 - -SECTION .text - -%macro TestDiff 2 - xor ecx,ecx - mov edx,[%1] - cmp edx,[%2] - je %%fin - mov ecx,_RGBtoYUV - movd mm1,[ecx+edx*4] - movq mm5,mm1 - mov edx,[%2] - movd mm2,[ecx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd ecx,mm1 -%%fin: -%endmacro - -%macro DiffOrNot 4 - TestDiff %1,%2 - test ecx,ecx - jz %%same - %3 - jmp %%fin -%%same: - %4 -%%fin -%endmacro - -%macro DiffOrNot 6 - TestDiff %1,%2 - test ecx,ecx - jz %%same - %3 - %4 - jmp %%fin -%%same: - %5 - %6 -%%fin -%endmacro - -%macro DiffOrNot 8 - TestDiff %1,%2 - test ecx,ecx - jz %%same - %3 - %4 - %5 - jmp %%fin -%%same: - %6 - %7 - %8 -%%fin -%endmacro - -%macro DiffOrNot 10 - TestDiff %1,%2 - test ecx,ecx - jz %%same - %3 - %4 - %5 - %6 - jmp %%fin -%%same: - %7 - %8 - %9 - %10 -%%fin -%endmacro - -%macro Interp1 3 - mov edx,%2 - shl edx,2 - add edx,%3 - sub edx,%2 - shr edx,2 - mov %1,edx -%endmacro - -%macro Interp2 4 - mov edx,%2 - shl edx,1 - add edx,%3 - add edx,%4 - shr edx,2 - mov %1,edx -%endmacro - -%macro Interp3 2 - movd mm1, eax - movd mm2, %2 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - pmullw mm1, [const7] - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro Interp4 3 - movd mm1, eax - movd mm2, %2 - movd mm3, %3 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - punpcklbw mm3, [reg_blank] - psllw mm1, 1 - paddw mm2, mm3 - pmullw mm2, [const7] - paddw mm1, mm2 - psrlw mm1, 4 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro Interp5 3 - mov edx,%2 - add edx,%3 - shr edx,1 - mov %1,edx -%endmacro - -%macro PIXEL00_1M 0 - Interp1 [edi],eax,[c1] -%endmacro - -%macro PIXEL00_1U 0 - Interp1 [edi],eax,[c2] -%endmacro - -%macro PIXEL00_1L 0 - Interp1 [edi],eax,[c4] -%endmacro - -%macro PIXEL00_2 0 - Interp2 [edi],eax,[c4],[c2] -%endmacro - -%macro PIXEL00_4 0 - Interp4 [edi],[c4],[c2] -%endmacro - -%macro PIXEL00_5 0 - Interp5 [edi],[c4],[c2] -%endmacro - -%macro PIXEL00_C 0 - mov [edi],eax -%endmacro - -%macro PIXEL01_1 0 - Interp1 [edi+4],eax,[c2] -%endmacro - -%macro PIXEL01_3 0 - Interp3 [edi+4],[c2] -%endmacro - -%macro PIXEL01_6 0 - Interp1 [edi+4],[c2],eax -%endmacro - -%macro PIXEL01_C 0 - mov [edi+4],eax -%endmacro - -%macro PIXEL02_1M 0 - Interp1 [edi+8],eax,[c3] -%endmacro - -%macro PIXEL02_1U 0 - Interp1 [edi+8],eax,[c2] -%endmacro - -%macro PIXEL02_1R 0 - Interp1 [edi+8],eax,[c6] -%endmacro - -%macro PIXEL02_2 0 - Interp2 [edi+8],eax,[c2],[c6] -%endmacro - -%macro PIXEL02_4 0 - Interp4 [edi+8],[c2],[c6] -%endmacro - -%macro PIXEL02_5 0 - Interp5 [edi+8],[c2],[c6] -%endmacro - -%macro PIXEL02_C 0 - mov [edi+8],eax -%endmacro - -%macro PIXEL10_1 0 - Interp1 [edi+ebx],eax,[c4] -%endmacro - -%macro PIXEL10_3 0 - Interp3 [edi+ebx],[c4] -%endmacro - -%macro PIXEL10_6 0 - Interp1 [edi+ebx],[c4],eax -%endmacro - -%macro PIXEL10_C 0 - mov [edi+ebx],eax -%endmacro - -%macro PIXEL11 0 - mov [edi+ebx+4],eax -%endmacro - -%macro PIXEL12_1 0 - Interp1 [edi+ebx+8],eax,[c6] -%endmacro - -%macro PIXEL12_3 0 - Interp3 [edi+ebx+8],[c6] -%endmacro - -%macro PIXEL12_6 0 - Interp1 [edi+ebx+8],[c6],eax -%endmacro - -%macro PIXEL12_C 0 - mov [edi+ebx+8],eax -%endmacro - -%macro PIXEL20_1M 0 - Interp1 [edi+ebx*2],eax,[c7] -%endmacro - -%macro PIXEL20_1D 0 - Interp1 [edi+ebx*2],eax,[c8] -%endmacro - -%macro PIXEL20_1L 0 - Interp1 [edi+ebx*2],eax,[c4] -%endmacro - -%macro PIXEL20_2 0 - Interp2 [edi+ebx*2],eax,[c8],[c4] -%endmacro - -%macro PIXEL20_4 0 - Interp4 [edi+ebx*2],[c8],[c4] -%endmacro - -%macro PIXEL20_5 0 - Interp5 [edi+ebx*2],[c8],[c4] -%endmacro - -%macro PIXEL20_C 0 - mov [edi+ebx*2],eax -%endmacro - -%macro PIXEL21_1 0 - Interp1 [edi+ebx*2+4],eax,[c8] -%endmacro - -%macro PIXEL21_3 0 - Interp3 [edi+ebx*2+4],[c8] -%endmacro - -%macro PIXEL21_6 0 - Interp1 [edi+ebx*2+4],[c8],eax -%endmacro - -%macro PIXEL21_C 0 - mov [edi+ebx*2+4],eax -%endmacro - -%macro PIXEL22_1M 0 - Interp1 [edi+ebx*2+8],eax,[c9] -%endmacro - -%macro PIXEL22_1D 0 - Interp1 [edi+ebx*2+8],eax,[c8] -%endmacro - -%macro PIXEL22_1R 0 - Interp1 [edi+ebx*2+8],eax,[c6] -%endmacro - -%macro PIXEL22_2 0 - Interp2 [edi+ebx*2+8],eax,[c6],[c8] -%endmacro - -%macro PIXEL22_4 0 - Interp4 [edi+ebx*2+8],[c6],[c8] -%endmacro - -%macro PIXEL22_5 0 - Interp5 [edi+ebx*2+8],[c6],[c8] -%endmacro - -%macro PIXEL22_C 0 - mov [edi+ebx*2+8],eax -%endmacro - -inbuffer equ 8 -outbuffer equ 12 -Xres equ 16 -Yres equ 20 -pitch equ 24 - -_hq3x_32: - push ebp - mov ebp,esp - pushad - - mov esi,[ebp+inbuffer] - mov edi,[ebp+outbuffer] - mov edx,[ebp+Yres] - mov [linesleft],edx - mov dword[firstline],1 -.loopy - push edi - mov ebx,[ebp+Xres] - shl ebx,1 - movzx eax,word[esi] - mov [w5],eax - mov [w6],eax - mov edx,eax - xor ecx,ecx - cmp dword[firstline],1 - je .firstline - sub ecx,ebx - movzx eax,word[esi+ecx] -.firstline - mov [prevline],ecx - mov [w2],eax - mov [w3],eax - xor ecx,ecx - cmp dword[linesleft],1 - je .lastline - add ecx,ebx - movzx edx,word[esi+ecx] -.lastline - mov [nextline],ecx - mov [w8],edx - mov [w9],edx - mov ecx,[ebp+Xres] - mov dword[xcounter],ecx -.loopx - mov eax,[w2] - mov ebx,[w5] - mov edx,[w8] - mov [w1],eax - mov [w4],ebx - mov [w7],edx - mov eax,[w3] - mov ebx,[w6] - mov edx,[w9] - mov [w2],eax - mov [w5],ebx - mov [w8],edx - cmp dword[xcounter],1 - je .flags - movzx eax,word[esi+2] - mov [w6],eax - mov ebx,[prevline] - movzx edx,word[esi+ebx+2] - mov [w3],edx - mov ebx,[nextline] - movzx eax,word[esi+ebx+2] - mov [w9],eax -.flags - mov ebx,_RGBtoYUV - mov eax,[w5] - xor ecx,ecx - movd mm5,[ebx+eax*4] - mov dword[cross],0 - - mov edx,[w2] - cmp eax,edx - je .noflag2 - or dword[cross],1 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag2 - or ecx,2 -.noflag2 - mov edx,[w4] - cmp eax,edx - je .noflag4 - or dword[cross],2 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag4 - or ecx,8 -.noflag4 - mov edx,[w6] - cmp eax,edx - je .noflag6 - or dword[cross],4 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag6 - or ecx,16 -.noflag6 - mov edx,[w8] - cmp eax,edx - je .noflag8 - or dword[cross],8 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag8 - or ecx,64 -.noflag8 - test ecx,ecx - jnz .testflag1 - mov ecx,[cross] - mov ebx,_LUT16to32 - mov eax,[ebx+eax*4] - jmp [FuncTable2+ecx*4] -.testflag1 - mov edx,[w1] - cmp eax,edx - je .noflag1 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag1 - or ecx,1 -.noflag1 - mov edx,[w3] - cmp eax,edx - je .noflag3 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag3 - or ecx,4 -.noflag3 - mov edx,[w7] - cmp eax,edx - je .noflag7 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag7 - or ecx,32 -.noflag7 - mov edx,[w9] - cmp eax,edx - je .noflag9 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag9 - or ecx,128 -.noflag9 - mov ebx,_LUT16to32 - mov eax,[ebx+eax*4] - mov edx,[w2] - mov edx,[ebx+edx*4] - mov [c2],edx - mov edx,[w4] - mov edx,[ebx+edx*4] - mov [c4],edx - mov edx,[w6] - mov edx,[ebx+edx*4] - mov [c6],edx - mov edx,[w8] - mov edx,[ebx+edx*4] - mov [c8],edx - test ecx,0x005A - jz .switch - mov edx,[w1] - mov edx,[ebx+edx*4] - mov [c1],edx - mov edx,[w3] - mov edx,[ebx+edx*4] - mov [c3],edx - mov edx,[w7] - mov edx,[ebx+edx*4] - mov [c7],edx - mov edx,[w9] - mov edx,[ebx+edx*4] - mov [c9],edx -.switch - mov ebx,[ebp+pitch] - jmp [FuncTable+ecx*4] - -..@flag0 -..@flag1 -..@flag4 -..@flag32 -..@flag128 -..@flag5 -..@flag132 -..@flag160 -..@flag33 -..@flag129 -..@flag36 -..@flag133 -..@flag164 -..@flag161 -..@flag37 -..@flag165 -; PIXEL00_2 -; PIXEL01_1 -; PIXEL02_2 -; PIXEL10_1 -; PIXEL11 -; PIXEL12_1 -; PIXEL20_2 -; PIXEL21_1 -; PIXEL22_2 - -; the same, only optimized - mov ecx,eax - shl ecx,1 - add ecx,[c2] - mov edx,ecx - add edx,[c4] - shr edx,2 - mov [edi],edx - mov edx,ecx - add edx,eax - shr edx,2 - mov [edi+4],edx - add ecx,[c6] - shr ecx,2 - mov [edi+8],ecx - mov ecx,eax - shl ecx,2 - sub ecx,eax - mov edx,ecx - add edx,[c4] - shr edx,2 - mov [edi+ebx],edx - mov [edi+ebx+4],eax - add ecx,[c6] - shr ecx,2 - mov [edi+ebx+8],ecx - mov ecx,eax - shl ecx,1 - add ecx,[c8] - mov edx,ecx - add edx,[c4] - shr edx,2 - mov [edi+ebx*2],edx - mov edx,ecx - add edx,eax - shr edx,2 - mov [edi+ebx*2+4],edx - add ecx,[c6] - shr ecx,2 - mov [edi+ebx*2+8],ecx - jmp .loopx_end -..@flag2 -..@flag34 -..@flag130 -..@flag162 - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag16 -..@flag17 -..@flag48 -..@flag49 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag64 -..@flag65 -..@flag68 -..@flag69 - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag8 -..@flag12 -..@flag136 -..@flag140 - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag3 -..@flag35 -..@flag131 -..@flag163 - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag6 -..@flag38 -..@flag134 -..@flag166 - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag20 -..@flag21 -..@flag52 -..@flag53 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag144 -..@flag145 -..@flag176 -..@flag177 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag192 -..@flag193 -..@flag196 -..@flag197 - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag96 -..@flag97 -..@flag100 -..@flag101 - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag40 -..@flag44 -..@flag168 -..@flag172 - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag9 -..@flag13 -..@flag137 -..@flag141 - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag18 -..@flag50 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_1M,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag80 -..@flag81 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL20_1M - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_1M,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag72 -..@flag76 - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_1M,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag10 -..@flag138 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag66 - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag24 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag7 -..@flag39 -..@flag135 - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag148 -..@flag149 -..@flag180 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag224 -..@flag228 -..@flag225 - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag41 -..@flag169 -..@flag45 - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag22 -..@flag54 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag208 -..@flag209 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL20_1M - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag104 -..@flag108 - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag11 -..@flag139 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag19 -..@flag51 - DiffOrNot w2,w6,PIXEL00_1L,PIXEL01_C,PIXEL02_1M,PIXEL12_C,PIXEL00_2,PIXEL01_6,PIXEL02_5,PIXEL12_1 - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag146 -..@flag178 - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_1M,PIXEL12_C,PIXEL22_1D,PIXEL01_1,PIXEL02_5,PIXEL12_6,PIXEL22_2 - PIXEL00_1M - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - jmp .loopx_end -..@flag84 -..@flag85 - DiffOrNot w6,w8,PIXEL02_1U,PIXEL12_C,PIXEL21_C,PIXEL22_1M,PIXEL02_2,PIXEL12_6,PIXEL21_1,PIXEL22_5 - PIXEL00_2 - PIXEL01_1 - PIXEL10_1 - PIXEL11 - PIXEL20_1M - jmp .loopx_end -..@flag112 -..@flag113 - DiffOrNot w6,w8,PIXEL12_C,PIXEL20_1L,PIXEL21_C,PIXEL22_1M,PIXEL12_1,PIXEL20_2,PIXEL21_6,PIXEL22_5 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - jmp .loopx_end -..@flag200 -..@flag204 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_1M,PIXEL21_C,PIXEL22_1R,PIXEL10_1,PIXEL20_5,PIXEL21_6,PIXEL22_2 - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - jmp .loopx_end -..@flag73 -..@flag77 - DiffOrNot w8,w4,PIXEL00_1U,PIXEL10_C,PIXEL20_1M,PIXEL21_C,PIXEL00_2,PIXEL10_6,PIXEL20_5,PIXEL21_1 - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - PIXEL22_1M - jmp .loopx_end -..@flag42 -..@flag170 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL01_C,PIXEL10_C,PIXEL20_1D,PIXEL00_5,PIXEL01_1,PIXEL10_6,PIXEL20_2 - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag14 -..@flag142 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL01_C,PIXEL02_1R,PIXEL10_C,PIXEL00_5,PIXEL01_6,PIXEL02_2,PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag67 - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag70 - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag28 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag152 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag194 - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag98 - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag56 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag25 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag26 -..@flag31 - DiffOrNot w4,w2,PIXEL00_C,PIXEL10_C,PIXEL00_4,PIXEL10_3 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_C,PIXEL12_C,PIXEL02_4,PIXEL12_3 - PIXEL11 - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag82 -..@flag214 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL01_3,PIXEL02_4 - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1M - DiffOrNot w6,w8,PIXEL21_C,PIXEL22_C,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag88 -..@flag248 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL11 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL10_3,PIXEL20_4 - PIXEL21_C - DiffOrNot w6,w8,PIXEL12_C,PIXEL22_C,PIXEL12_3,PIXEL22_4 - jmp .loopx_end -..@flag74 -..@flag107 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL00_4,PIXEL01_3 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_C,PIXEL21_C,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag27 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - PIXEL02_1M - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag86 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL10_1 - PIXEL11 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag216 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL20_1M - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag106 - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag30 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL10_C - PIXEL11 - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag210 - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL20_1M - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag120 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag75 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag29 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag198 - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag184 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag99 - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag57 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag71 - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag156 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag226 - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag60 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag195 - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag102 - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag153 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag58 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag83 - PIXEL00_1L - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag92 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag202 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag78 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag154 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag114 - PIXEL00_1M - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag89 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag90 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag55 -..@flag23 - DiffOrNot w2,w6,PIXEL00_1L,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL00_2,PIXEL01_6,PIXEL02_5,PIXEL12_1 - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag182 -..@flag150 - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL22_1D,PIXEL01_1,PIXEL02_5,PIXEL12_6,PIXEL22_2 - PIXEL00_1M - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - jmp .loopx_end -..@flag213 -..@flag212 - DiffOrNot w6,w8,PIXEL02_1U,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL02_2,PIXEL12_6,PIXEL21_1,PIXEL22_5 - PIXEL00_2 - PIXEL01_1 - PIXEL10_1 - PIXEL11 - PIXEL20_1M - jmp .loopx_end -..@flag241 -..@flag240 - DiffOrNot w6,w8,PIXEL12_C,PIXEL20_1L,PIXEL21_C,PIXEL22_C,PIXEL12_1,PIXEL20_2,PIXEL21_6,PIXEL22_5 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - jmp .loopx_end -..@flag236 -..@flag232 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL22_1R,PIXEL10_1,PIXEL20_5,PIXEL21_6,PIXEL22_2 - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - jmp .loopx_end -..@flag109 -..@flag105 - DiffOrNot w8,w4,PIXEL00_1U,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL00_2,PIXEL10_6,PIXEL20_5,PIXEL21_1 - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - PIXEL22_1M - jmp .loopx_end -..@flag171 -..@flag43 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL20_1D,PIXEL00_5,PIXEL01_1,PIXEL10_6,PIXEL20_2 - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag143 -..@flag15 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL02_1R,PIXEL10_C,PIXEL00_5,PIXEL01_6,PIXEL02_2,PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag124 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag203 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag62 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL10_C - PIXEL11 - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag211 - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL20_1M - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag118 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL10_1 - PIXEL11 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag217 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL20_1M - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag110 - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag155 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - PIXEL02_1M - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag188 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag185 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag61 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag157 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag103 - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag227 - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag230 - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag199 - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag220 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag158 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL10_C - PIXEL11 - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag234 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - PIXEL02_1M - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - PIXEL22_1R - jmp .loopx_end -..@flag242 - PIXEL00_1M - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL20_1L - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag59 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag121 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag87 - PIXEL00_1L - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL10_1 - PIXEL11 - PIXEL20_1M - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag79 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - PIXEL02_1R - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag122 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag94 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL10_C - PIXEL11 - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag218 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_C - PIXEL11 - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag91 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag229 - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag167 - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag173 - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag181 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag186 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag115 - PIXEL00_1L - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag93 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag206 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag205 -..@flag201 - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_1M,PIXEL20_2 - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag174 -..@flag46 - DiffOrNot w4,w2,PIXEL00_1M,PIXEL00_2 - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag179 -..@flag147 - PIXEL00_1L - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_1M,PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag117 -..@flag116 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_1M,PIXEL22_2 - jmp .loopx_end -..@flag189 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag231 - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag126 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_4,PIXEL12_3 - PIXEL11 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag219 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_4,PIXEL01_3,PIXEL10_3 - PIXEL02_1M - PIXEL11 - PIXEL20_1M - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag125 - DiffOrNot w8,w4,PIXEL00_1U,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL00_2,PIXEL10_6,PIXEL20_5,PIXEL21_1 - PIXEL01_1 - PIXEL02_1U - PIXEL11 - PIXEL12_C - PIXEL22_1M - jmp .loopx_end -..@flag221 - DiffOrNot w6,w8,PIXEL02_1U,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL02_2,PIXEL12_6,PIXEL21_1,PIXEL22_5 - PIXEL00_1U - PIXEL01_1 - PIXEL10_C - PIXEL11 - PIXEL20_1M - jmp .loopx_end -..@flag207 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL02_1R,PIXEL10_C,PIXEL00_5,PIXEL01_6,PIXEL02_2,PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag238 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL22_1R,PIXEL10_1,PIXEL20_5,PIXEL21_6,PIXEL22_2 - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL11 - PIXEL12_1 - jmp .loopx_end -..@flag190 - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL22_1D,PIXEL01_1,PIXEL02_5,PIXEL12_6,PIXEL22_2 - PIXEL00_1M - PIXEL10_C - PIXEL11 - PIXEL20_1D - PIXEL21_1 - jmp .loopx_end -..@flag187 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL20_1D,PIXEL00_5,PIXEL01_1,PIXEL10_6,PIXEL20_2 - PIXEL02_1M - PIXEL11 - PIXEL12_C - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag243 - DiffOrNot w6,w8,PIXEL12_C,PIXEL20_1L,PIXEL21_C,PIXEL22_C,PIXEL12_1,PIXEL20_2,PIXEL21_6,PIXEL22_5 - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - jmp .loopx_end -..@flag119 - DiffOrNot w2,w6,PIXEL00_1L,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL00_2,PIXEL01_6,PIXEL02_5,PIXEL12_1 - PIXEL10_1 - PIXEL11 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag237 -..@flag233 - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_C,PIXEL20_2 - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag175 -..@flag47 - DiffOrNot w4,w2,PIXEL00_C,PIXEL00_2 - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - jmp .loopx_end -..@flag183 -..@flag151 - PIXEL00_1L - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_C,PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag245 -..@flag244 - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_C,PIXEL22_2 - jmp .loopx_end -..@flag250 - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL11 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL10_3,PIXEL20_4 - PIXEL21_C - DiffOrNot w6,w8,PIXEL12_C,PIXEL22_C,PIXEL12_3,PIXEL22_4 - jmp .loopx_end -..@flag123 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL00_4,PIXEL01_3 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL20_C,PIXEL21_C,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag95 - DiffOrNot w4,w2,PIXEL00_C,PIXEL10_C,PIXEL00_4,PIXEL10_3 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_C,PIXEL12_C,PIXEL02_4,PIXEL12_3 - PIXEL11 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - jmp .loopx_end -..@flag222 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL01_3,PIXEL02_4 - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - DiffOrNot w6,w8,PIXEL21_C,PIXEL22_C,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag252 - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL10_3,PIXEL20_4 - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_C,PIXEL22_2 - jmp .loopx_end -..@flag249 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - DiffOrNot w8,w4,PIXEL20_C,PIXEL20_2 - PIXEL21_C - DiffOrNot w6,w8,PIXEL12_C,PIXEL22_C,PIXEL12_3,PIXEL22_4 - jmp .loopx_end -..@flag235 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL00_4,PIXEL01_3 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_C,PIXEL20_2 - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag111 - DiffOrNot w4,w2,PIXEL00_C,PIXEL00_2 - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_C,PIXEL21_C,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag63 - DiffOrNot w4,w2,PIXEL00_C,PIXEL00_2 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_C,PIXEL12_C,PIXEL02_4,PIXEL12_3 - PIXEL10_C - PIXEL11 - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - jmp .loopx_end -..@flag159 - DiffOrNot w4,w2,PIXEL00_C,PIXEL10_C,PIXEL00_4,PIXEL10_3 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_C,PIXEL02_2 - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag215 - PIXEL00_1L - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_C,PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1M - DiffOrNot w6,w8,PIXEL21_C,PIXEL22_C,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag246 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL01_3,PIXEL02_4 - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_C,PIXEL22_2 - jmp .loopx_end -..@flag254 - PIXEL00_1M - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL01_3,PIXEL02_4 - PIXEL11 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL10_3,PIXEL20_4 - DiffOrNot w6,w8,PIXEL12_C,PIXEL21_C,PIXEL22_C,PIXEL12_3,PIXEL21_3,PIXEL22_2 - jmp .loopx_end -..@flag253 - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL20_C,PIXEL20_2 - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_C,PIXEL22_2 - jmp .loopx_end -..@flag251 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL00_4,PIXEL01_3 - PIXEL02_1M - PIXEL11 - DiffOrNot w8,w4,PIXEL10_C,PIXEL20_C,PIXEL21_C,PIXEL10_3,PIXEL20_2,PIXEL21_3 - DiffOrNot w6,w8,PIXEL12_C,PIXEL22_C,PIXEL12_3,PIXEL22_4 - jmp .loopx_end -..@flag239 - DiffOrNot w4,w2,PIXEL00_C,PIXEL00_2 - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - DiffOrNot w8,w4,PIXEL20_C,PIXEL20_2 - PIXEL21_C - PIXEL22_1R - jmp .loopx_end -..@flag127 - DiffOrNot w4,w2,PIXEL00_C,PIXEL01_C,PIXEL10_C,PIXEL00_2,PIXEL01_3,PIXEL10_3 - DiffOrNot w2,w6,PIXEL02_C,PIXEL12_C,PIXEL02_4,PIXEL12_3 - PIXEL11 - DiffOrNot w8,w4,PIXEL20_C,PIXEL21_C,PIXEL20_4,PIXEL21_3 - PIXEL22_1M - jmp .loopx_end -..@flag191 - DiffOrNot w4,w2,PIXEL00_C,PIXEL00_2 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_C,PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - jmp .loopx_end -..@flag223 - DiffOrNot w4,w2,PIXEL00_C,PIXEL10_C,PIXEL00_4,PIXEL10_3 - DiffOrNot w2,w6,PIXEL01_C,PIXEL02_C,PIXEL12_C,PIXEL01_3,PIXEL02_2,PIXEL12_3 - PIXEL11 - PIXEL20_1M - DiffOrNot w6,w8,PIXEL21_C,PIXEL22_C,PIXEL21_3,PIXEL22_4 - jmp .loopx_end -..@flag247 - PIXEL00_1L - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_C,PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_C,PIXEL22_2 - jmp .loopx_end -..@flag255 - DiffOrNot w4,w2,PIXEL00_C,PIXEL00_2 - PIXEL01_C - DiffOrNot w2,w6,PIXEL02_C,PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_C - DiffOrNot w8,w4,PIXEL20_C,PIXEL20_2 - PIXEL21_C - DiffOrNot w6,w8,PIXEL22_C,PIXEL22_2 - jmp .loopx_end - -..@cross0 - mov ebx,[ebp+pitch] - mov [edi],eax - mov [edi+4],eax - mov [edi+8],eax - mov [edi+ebx],eax - mov [edi+ebx+4],eax - mov [edi+ebx+8],eax - mov [edi+ebx*2],eax - mov [edi+ebx*2+4],eax - mov [edi+ebx*2+8],eax - jmp .loopx_end -..@cross1 - mov ecx,[w2] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],edx - mov [edi+4],edx - mov [edi+8],edx - mov [edi+ebx],eax - mov [edi+ebx+4],eax - mov [edi+ebx+8],eax - mov [edi+ebx*2],eax - mov [edi+ebx*2+4],eax - mov [edi+ebx*2+8],eax - jmp .loopx_end -..@cross2 - mov ecx,[w4] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],edx - mov [edi+4],eax - mov [edi+8],eax - mov [edi+ebx],edx - mov [edi+ebx+4],eax - mov [edi+ebx+8],eax - mov [edi+ebx*2],edx - mov [edi+ebx*2+4],eax - mov [edi+ebx*2+8],eax - jmp .loopx_end -..@cross4 - mov ecx,[w6] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],eax - mov [edi+4],eax - mov [edi+8],edx - mov [edi+ebx],eax - mov [edi+ebx+4],eax - mov [edi+ebx+8],edx - mov [edi+ebx*2],eax - mov [edi+ebx*2+4],eax - mov [edi+ebx*2+8],edx - jmp .loopx_end -..@cross8 - mov ecx,[w8] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],eax - mov [edi+4],eax - mov [edi+8],eax - mov [edi+ebx],eax - mov [edi+ebx+4],eax - mov [edi+ebx+8],eax - mov [edi+ebx*2],edx - mov [edi+ebx*2+4],edx - mov [edi+ebx*2+8],edx - jmp .loopx_end -..@crossN - mov edx,[w2] - mov ecx,[ebx+edx*4] - mov [c2],ecx - mov edx,[w4] - mov ecx,[ebx+edx*4] - mov [c4],ecx - mov edx,[w6] - mov ecx,[ebx+edx*4] - mov [c6],ecx - mov edx,[w8] - mov ecx,[ebx+edx*4] - mov [c8],ecx - mov ebx,[ebp+pitch] - jmp ..@flag0 - -.loopx_end - add esi,2 - add edi,12 - dec dword[xcounter] - jz .nexty - jmp .loopx -.nexty - mov dword[firstline],0 - - pop edi - add edi,ebx - add edi,ebx - add edi,ebx - - dec dword[linesleft] - jz .fin - jmp .loopy -.fin - emms - popad - mov esp,ebp - pop ebp - ret - -SECTION .data -FuncTable - dd ..@flag0, ..@flag1, ..@flag2, ..@flag3, ..@flag4, ..@flag5, ..@flag6, ..@flag7 - dd ..@flag8, ..@flag9, ..@flag10, ..@flag11, ..@flag12, ..@flag13, ..@flag14, ..@flag15 - dd ..@flag16, ..@flag17, ..@flag18, ..@flag19, ..@flag20, ..@flag21, ..@flag22, ..@flag23 - dd ..@flag24, ..@flag25, ..@flag26, ..@flag27, ..@flag28, ..@flag29, ..@flag30, ..@flag31 - dd ..@flag32, ..@flag33, ..@flag34, ..@flag35, ..@flag36, ..@flag37, ..@flag38, ..@flag39 - dd ..@flag40, ..@flag41, ..@flag42, ..@flag43, ..@flag44, ..@flag45, ..@flag46, ..@flag47 - dd ..@flag48, ..@flag49, ..@flag50, ..@flag51, ..@flag52, ..@flag53, ..@flag54, ..@flag55 - dd ..@flag56, ..@flag57, ..@flag58, ..@flag59, ..@flag60, ..@flag61, ..@flag62, ..@flag63 - dd ..@flag64, ..@flag65, ..@flag66, ..@flag67, ..@flag68, ..@flag69, ..@flag70, ..@flag71 - dd ..@flag72, ..@flag73, ..@flag74, ..@flag75, ..@flag76, ..@flag77, ..@flag78, ..@flag79 - dd ..@flag80, ..@flag81, ..@flag82, ..@flag83, ..@flag84, ..@flag85, ..@flag86, ..@flag87 - dd ..@flag88, ..@flag89, ..@flag90, ..@flag91, ..@flag92, ..@flag93, ..@flag94, ..@flag95 - dd ..@flag96, ..@flag97, ..@flag98, ..@flag99, ..@flag100, ..@flag101, ..@flag102, ..@flag103 - dd ..@flag104, ..@flag105, ..@flag106, ..@flag107, ..@flag108, ..@flag109, ..@flag110, ..@flag111 - dd ..@flag112, ..@flag113, ..@flag114, ..@flag115, ..@flag116, ..@flag117, ..@flag118, ..@flag119 - dd ..@flag120, ..@flag121, ..@flag122, ..@flag123, ..@flag124, ..@flag125, ..@flag126, ..@flag127 - dd ..@flag128, ..@flag129, ..@flag130, ..@flag131, ..@flag132, ..@flag133, ..@flag134, ..@flag135 - dd ..@flag136, ..@flag137, ..@flag138, ..@flag139, ..@flag140, ..@flag141, ..@flag142, ..@flag143 - dd ..@flag144, ..@flag145, ..@flag146, ..@flag147, ..@flag148, ..@flag149, ..@flag150, ..@flag151 - dd ..@flag152, ..@flag153, ..@flag154, ..@flag155, ..@flag156, ..@flag157, ..@flag158, ..@flag159 - dd ..@flag160, ..@flag161, ..@flag162, ..@flag163, ..@flag164, ..@flag165, ..@flag166, ..@flag167 - dd ..@flag168, ..@flag169, ..@flag170, ..@flag171, ..@flag172, ..@flag173, ..@flag174, ..@flag175 - dd ..@flag176, ..@flag177, ..@flag178, ..@flag179, ..@flag180, ..@flag181, ..@flag182, ..@flag183 - dd ..@flag184, ..@flag185, ..@flag186, ..@flag187, ..@flag188, ..@flag189, ..@flag190, ..@flag191 - dd ..@flag192, ..@flag193, ..@flag194, ..@flag195, ..@flag196, ..@flag197, ..@flag198, ..@flag199 - dd ..@flag200, ..@flag201, ..@flag202, ..@flag203, ..@flag204, ..@flag205, ..@flag206, ..@flag207 - dd ..@flag208, ..@flag209, ..@flag210, ..@flag211, ..@flag212, ..@flag213, ..@flag214, ..@flag215 - dd ..@flag216, ..@flag217, ..@flag218, ..@flag219, ..@flag220, ..@flag221, ..@flag222, ..@flag223 - dd ..@flag224, ..@flag225, ..@flag226, ..@flag227, ..@flag228, ..@flag229, ..@flag230, ..@flag231 - dd ..@flag232, ..@flag233, ..@flag234, ..@flag235, ..@flag236, ..@flag237, ..@flag238, ..@flag239 - dd ..@flag240, ..@flag241, ..@flag242, ..@flag243, ..@flag244, ..@flag245, ..@flag246, ..@flag247 - dd ..@flag248, ..@flag249, ..@flag250, ..@flag251, ..@flag252, ..@flag253, ..@flag254, ..@flag255 - -FuncTable2 - dd ..@cross0, ..@cross1, ..@cross2, ..@crossN, - dd ..@cross4, ..@crossN, ..@crossN, ..@crossN, - dd ..@cross8, ..@crossN, ..@crossN, ..@crossN, - dd ..@crossN, ..@crossN, ..@crossN, ..@crossN - diff --git a/jan/src/intf/video/scalers/hq3xs.cpp b/jan/src/intf/video/scalers/hq3xs.cpp deleted file mode 100644 index 8a8f0cd24..000000000 --- a/jan/src/intf/video/scalers/hq3xs.cpp +++ /dev/null @@ -1,266 +0,0 @@ -// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. -// Copyright (C) 1999-2003 Forgotten -// Copyright (C) 2005 Forgotten and the VBA development team - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2, or(at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#include "hq_shared32.h" -#include "interp.h" - -#define SIZE_PIXEL 2 // 16bit = 2 bytes -#define PIXELTYPE unsigned short -#define Interp1 Interp1_16 -#define Interp2 Interp2_16 -#define Interp3 Interp3_16 -#define Interp4 Interp4_16 -#define Interp5 Interp5_16 - -void hq3xS(unsigned char * pIn, unsigned int srcPitch, - unsigned char *, - unsigned char * pOut, unsigned int dstPitch, - int Xres, int Yres) -{ - int i, j; - PIXELTYPE c[10]; - - // +----+----+----+ - // | | | | - // | c1 | c2 | c3 | - // +----+----+----+ - // | | | | - // | c4 | c5 | c6 | - // +----+----+----+ - // | | | | - // | c7 | c8 | c9 | - // +----+----+----+ - - for (j=0; j> 3; - r = (int)((c[j] & 0xF800)) >> 8; - } else { - b = (int)((c[j] & 0x1F)) << 3; - g = (int)((c[j] & 0x3E0)) >> 2; - r = (int)((c[j] & 0x7C00)) >> 7; - } - const int bright = r+r+r + g+g+g + b+b; - if(bright > maxBright) maxBright = bright; - if(bright < minBright) minBright = bright; - - brightArray[j] = bright; - } - const int diffBright = ((maxBright - minBright) * 7) >> 4; - if(diffBright > 7) - { - #define ABS(x) ((x) < 0 ? -(x) : (x)) - - const int centerBright = brightArray[5]; - if(ABS(brightArray[1] - centerBright) > diffBright) - pattern |= 1 << 0; - if(ABS(brightArray[2] - centerBright) > diffBright) - pattern |= 1 << 1; - if(ABS(brightArray[3] - centerBright) > diffBright) - pattern |= 1 << 2; - if(ABS(brightArray[4] - centerBright) > diffBright) - pattern |= 1 << 3; - if(ABS(brightArray[6] - centerBright) > diffBright) - pattern |= 1 << 4; - if(ABS(brightArray[7] - centerBright) > diffBright) - pattern |= 1 << 5; - if(ABS(brightArray[8] - centerBright) > diffBright) - pattern |= 1 << 6; - if(ABS(brightArray[9] - centerBright) > diffBright) - pattern |= 1 << 7; - } - -#define Diff(x,y) false//(ABS((x) - (y)) > diffBright) -#undef cget -#define cget(x) brightArray[x] -#include "hq3xs.h" -#undef cget -#undef Diff - pIn+=SIZE_PIXEL; - pOut+=3<<1; - } - pIn+=srcPitch-(Xres<<1); - pOut+=dstPitch-(3*Xres<<1); - pOut+=dstPitch<<1; - // pIn+=SIZE_PIXEL; - // pOut+=3*SIZE_PIXEL; - //} - //pIn+=srcPitch-(4*Xres); - //pOut+=dstPitch-(3*Xres*SIZE_PIXEL); - //pOut+=2*dstPitch; - } -} - -#undef Interp1 -#undef Interp2 -#undef Interp3 -#undef Interp4 -#undef Interp5 -#undef SIZE_PIXEL -#undef PIXELTYPE -#define SIZE_PIXEL 4 // 32bit = 4 bytes -#define PIXELTYPE unsigned int - -void hq3xS32(unsigned char * pIn, unsigned int srcPitch, - unsigned char *, - unsigned char * pOut, unsigned int dstPitch, - int Xres, int Yres) -{ - int i, j; - unsigned int line; - PIXELTYPE c[10]; - - // +----+----+----+ - // | | | | - // | c1 | c2 | c3 | - // +----+----+----+ - // | | | | - // | c4 | c5 | c6 | - // +----+----+----+ - // | | | | - // | c7 | c8 | c9 | - // +----+----+----+ - - for (j=0; j0) && (j0) - { - c[1] = *((PIXELTYPE*)(pIn - line - SIZE_PIXEL)); - c[4] = *((PIXELTYPE*)(pIn - SIZE_PIXEL)); - c[7] = *((PIXELTYPE*)(pIn + line - SIZE_PIXEL)); - } - else - { - c[1] = c[2]; - c[4] = c[5]; - c[7] = c[8]; - } - - if (i> 8; - const int r = (int)((c[j] & 0xF80000)) >> 16; - const int bright = r+r+r + g+g+g + b+b; - if(bright > maxBright) maxBright = bright; - if(bright < minBright) minBright = bright; - - brightArray[j] = bright; - } - int diffBright = ((maxBright - minBright) * 7) >> 4; - if(diffBright > 7) - { - #define ABS(x) ((x) < 0 ? -(x) : (x)) - - const int centerBright = brightArray[5]; - if(ABS(brightArray[1] - centerBright) > diffBright) - pattern |= 1 << 0; - if(ABS(brightArray[2] - centerBright) > diffBright) - pattern |= 1 << 1; - if(ABS(brightArray[3] - centerBright) > diffBright) - pattern |= 1 << 2; - if(ABS(brightArray[4] - centerBright) > diffBright) - pattern |= 1 << 3; - if(ABS(brightArray[6] - centerBright) > diffBright) - pattern |= 1 << 4; - if(ABS(brightArray[7] - centerBright) > diffBright) - pattern |= 1 << 5; - if(ABS(brightArray[8] - centerBright) > diffBright) - pattern |= 1 << 6; - if(ABS(brightArray[9] - centerBright) > diffBright) - pattern |= 1 << 7; - } - -#define Diff(x,y) false//(ABS((x) - (y)) > diffBright) -#undef cget -#define cget(x) brightArray[x] -#include "hq3xs.h" -#undef cget -#undef Diff - pIn+=SIZE_PIXEL; - pOut+=3<<2; - } - pIn+=srcPitch-(Xres<<2); - pOut+=dstPitch-(3*Xres<<2); - pOut+=dstPitch<<1; - // pIn+=SIZE_PIXEL; - // pOut+=3*SIZE_PIXEL; - //} - //pIn+=srcPitch-(4*Xres); - //pOut+=dstPitch-(3*Xres*SIZE_PIXEL); - //pOut+=2*dstPitch; - } -} diff --git a/jan/src/intf/video/scalers/hq3xs.h b/jan/src/intf/video/scalers/hq3xs.h deleted file mode 100644 index 36191542b..000000000 --- a/jan/src/intf/video/scalers/hq3xs.h +++ /dev/null @@ -1,3692 +0,0 @@ -// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. -// Copyright (C) 1999-2003 Forgotten -// Copyright (C) 2005 Forgotten and the VBA development team - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2, or(at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#define PIXEL00_1M Interp1( pOut, c[5], c[1] ); -#define PIXEL00_1U Interp1( pOut, c[5], c[2] ); -#define PIXEL00_1L Interp1( pOut, c[5], c[4] ); -#define PIXEL00_2 Interp2( pOut, c[5], c[4], c[2] ); -#define PIXEL00_4 Interp4( pOut, c[5], c[4], c[2] ); -#define PIXEL00_5 Interp5( pOut, c[4], c[2] ); -#define PIXEL00_C *((PIXELTYPE*)(pOut)) = c[5]; - -#define PIXEL01_1 Interp1( pOut+SIZE_PIXEL, c[5], c[2] ); -#define PIXEL01_3 Interp3( pOut+SIZE_PIXEL, c[5], c[2] ); -#define PIXEL01_6 Interp1( pOut+SIZE_PIXEL, c[2], c[5] ); -#define PIXEL01_C *((PIXELTYPE*)(pOut+SIZE_PIXEL)) = c[5]; - -#define PIXEL02_1M Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3] ); -#define PIXEL02_1U Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2] ); -#define PIXEL02_1R Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] ); -#define PIXEL02_2 Interp2( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] ); -#define PIXEL02_4 Interp4( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] ); -#define PIXEL02_5 Interp5( pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[6] ); -#define PIXEL02_C *((PIXELTYPE*)(pOut+SIZE_PIXEL+SIZE_PIXEL)) = c[5]; - -#define PIXEL10_1 Interp1( pOut+dstPitch, c[5], c[4] ); -#define PIXEL10_3 Interp3( pOut+dstPitch, c[5], c[4] ); -#define PIXEL10_6 Interp1( pOut+dstPitch, c[4], c[5] ); -#define PIXEL10_C *((PIXELTYPE*)(pOut+dstPitch)) = c[5]; - -#define PIXEL11 *((PIXELTYPE*)(pOut+dstPitch+SIZE_PIXEL)) = c[5]; - -#define PIXEL12_1 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] ); -#define PIXEL12_3 Interp3( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] ); -#define PIXEL12_6 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5] ); -#define PIXEL12_C *((PIXELTYPE*)(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5]; - -#define PIXEL20_1M Interp1( pOut+dstPitch+dstPitch, c[5], c[7] ); -#define PIXEL20_1D Interp1( pOut+dstPitch+dstPitch, c[5], c[8] ); -#define PIXEL20_1L Interp1( pOut+dstPitch+dstPitch, c[5], c[4] ); -#define PIXEL20_2 Interp2( pOut+dstPitch+dstPitch, c[5], c[8], c[4] ); -#define PIXEL20_4 Interp4( pOut+dstPitch+dstPitch, c[5], c[8], c[4] ); -#define PIXEL20_5 Interp5( pOut+dstPitch+dstPitch, c[8], c[4] ); -#define PIXEL20_C *((PIXELTYPE*)(pOut+dstPitch+dstPitch)) = c[5]; - -#define PIXEL21_1 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] ); -#define PIXEL21_3 Interp3( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] ); -#define PIXEL21_6 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5] ); -#define PIXEL21_C *((PIXELTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL)) = c[5]; - -#define PIXEL22_1M Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9] ); -#define PIXEL22_1D Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8] ); -#define PIXEL22_1R Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] ); -#define PIXEL22_2 Interp2( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] ); -#define PIXEL22_4 Interp4( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] ); -#define PIXEL22_5 Interp5( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[8] ); -#define PIXEL22_C *((PIXELTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5]; - -#ifndef cget -#define cget(x) c[x] -#endif - - switch (pattern) - { - case 0: - case 1: - case 4: - case 32: - case 128: - case 5: - case 132: - case 160: - case 33: - case 129: - case 36: - case 133: - case 164: - case 161: - case 37: - case 165: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - break; - } - case 2: - case 34: - case 130: - case 162: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - break; - } - case 16: - case 17: - case 48: - case 49: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - break; - } - case 64: - case 65: - case 68: - case 69: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - break; - } - case 8: - case 12: - case 136: - case 140: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - break; - } - case 3: - case 35: - case 131: - case 163: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - break; - } - case 6: - case 38: - case 134: - case 166: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - break; - } - case 20: - case 21: - case 52: - case 53: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - break; - } - case 144: - case 145: - case 176: - case 177: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - break; - } - case 192: - case 193: - case 196: - case 197: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - break; - } - case 96: - case 97: - case 100: - case 101: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - break; - } - case 40: - case 44: - case 168: - case 172: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - break; - } - case 9: - case 13: - case 137: - case 141: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - break; - } - case 18: - case 50: - { - PIXEL00_1M - - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_1M - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - break; - } - case 80: - case 81: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_1M - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 72: - case 76: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_1M - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 10: - case 138: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - break; - } - case 66: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - break; - } - case 24: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - break; - } - case 7: - case 39: - case 135: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - break; - } - case 148: - case 149: - case 180: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - break; - } - case 224: - case 228: - case 225: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - break; - } - case 41: - case 169: - case 45: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - break; - } - case 22: - case 54: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - break; - } - case 208: - case 209: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 104: - case 108: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 11: - case 139: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - break; - } - case 19: - case 51: - { - if (Diff(cget(2), cget(6))) - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL12_C - } - else - { - PIXEL00_2 - PIXEL01_6 - PIXEL02_5 - PIXEL12_1 - } - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - break; - } - case 146: - case 178: - { - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_1M - PIXEL12_C - PIXEL22_1D - } - else - { - PIXEL01_1 - PIXEL02_5 - PIXEL12_6 - PIXEL22_2 - } - PIXEL00_1M - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - break; - } - case 84: - case 85: - { - if (Diff(cget(6), cget(8))) - { - PIXEL02_1U - PIXEL12_C - PIXEL21_C - PIXEL22_1M - } - else - { - PIXEL02_2 - PIXEL12_6 - PIXEL21_1 - PIXEL22_5 - } - PIXEL00_2 - PIXEL01_1 - PIXEL10_1 - PIXEL11 - PIXEL20_1M - break; - } - case 112: - case 113: - { - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - } - else - { - PIXEL12_1 - PIXEL20_2 - PIXEL21_6 - PIXEL22_5 - } - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - break; - } - case 200: - case 204: - { - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - } - else - { - PIXEL10_1 - PIXEL20_5 - PIXEL21_6 - PIXEL22_2 - } - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - break; - } - case 73: - case 77: - { - if (Diff(cget(8), cget(4))) - { - PIXEL00_1U - PIXEL10_C - PIXEL20_1M - PIXEL21_C - } - else - { - PIXEL00_2 - PIXEL10_6 - PIXEL20_5 - PIXEL21_1 - } - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - PIXEL22_1M - break; - } - case 42: - case 170: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - PIXEL01_C - PIXEL10_C - PIXEL20_1D - } - else - { - PIXEL00_5 - PIXEL01_1 - PIXEL10_6 - PIXEL20_2 - } - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL21_1 - PIXEL22_2 - break; - } - case 14: - case 142: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_C - } - else - { - PIXEL00_5 - PIXEL01_6 - PIXEL02_2 - PIXEL10_1 - } - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - break; - } - case 67: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - break; - } - case 70: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - break; - } - case 28: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - break; - } - case 152: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - break; - } - case 194: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - break; - } - case 98: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - break; - } - case 56: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - break; - } - case 25: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - break; - } - case 26: - case 31: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL10_3 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL02_4 - PIXEL12_3 - } - PIXEL11 - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - break; - } - case 82: - case 214: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - } - else - { - PIXEL01_3 - PIXEL02_4 - } - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 88: - case 248: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - } - else - { - PIXEL10_3 - PIXEL20_4 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL22_4 - } - break; - } - case 74: - case 107: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - } - else - { - PIXEL00_4 - PIXEL01_3 - } - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 27: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - PIXEL02_1M - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - break; - } - case 86: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_1 - PIXEL11 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - break; - } - case 216: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 106: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 30: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_C - PIXEL11 - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - break; - } - case 210: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 120: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 75: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - break; - } - case 29: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1M - break; - } - case 198: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - break; - } - case 184: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - break; - } - case 99: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - break; - } - case 57: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - break; - } - case 71: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - break; - } - case 156: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - break; - } - case 226: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - break; - } - case 60: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - break; - } - case 195: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - break; - } - case 102: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - break; - } - case 153: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - break; - } - case 58: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - break; - } - case 83: - { - PIXEL00_1L - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 92: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 202: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - PIXEL22_1R - break; - } - case 78: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - PIXEL22_1M - break; - } - case 154: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - break; - } - case 114: - { - PIXEL00_1M - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 89: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 90: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_C - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 55: - case 23: - { - if (Diff(cget(2), cget(6))) - { - PIXEL00_1L - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL00_2 - PIXEL01_6 - PIXEL02_5 - PIXEL12_1 - } - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - PIXEL22_1M - break; - } - case 182: - case 150: - { - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - PIXEL22_1D - } - else - { - PIXEL01_1 - PIXEL02_5 - PIXEL12_6 - PIXEL22_2 - } - PIXEL00_1M - PIXEL10_1 - PIXEL11 - PIXEL20_2 - PIXEL21_1 - break; - } - case 213: - case 212: - { - if (Diff(cget(6), cget(8))) - { - PIXEL02_1U - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL02_2 - PIXEL12_6 - PIXEL21_1 - PIXEL22_5 - } - PIXEL00_2 - PIXEL01_1 - PIXEL10_1 - PIXEL11 - PIXEL20_1M - break; - } - case 241: - case 240: - { - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL20_1L - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_1 - PIXEL20_2 - PIXEL21_6 - PIXEL22_5 - } - PIXEL00_2 - PIXEL01_1 - PIXEL02_1M - PIXEL10_1 - PIXEL11 - break; - } - case 236: - case 232: - { - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - PIXEL22_1R - } - else - { - PIXEL10_1 - PIXEL20_5 - PIXEL21_6 - PIXEL22_2 - } - PIXEL00_1M - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - break; - } - case 109: - case 105: - { - if (Diff(cget(8), cget(4))) - { - PIXEL00_1U - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL00_2 - PIXEL10_6 - PIXEL20_5 - PIXEL21_1 - } - PIXEL01_1 - PIXEL02_2 - PIXEL11 - PIXEL12_1 - PIXEL22_1M - break; - } - case 171: - case 43: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - PIXEL20_1D - } - else - { - PIXEL00_5 - PIXEL01_1 - PIXEL10_6 - PIXEL20_2 - } - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL21_1 - PIXEL22_2 - break; - } - case 143: - case 15: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL02_1R - PIXEL10_C - } - else - { - PIXEL00_5 - PIXEL01_6 - PIXEL02_2 - PIXEL10_1 - } - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_1 - PIXEL22_2 - break; - } - case 124: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 203: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - PIXEL02_1M - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - break; - } - case 62: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_C - PIXEL11 - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - break; - } - case 211: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 118: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_1 - PIXEL11 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - break; - } - case 217: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 110: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 155: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - PIXEL02_1M - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - break; - } - case 188: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - break; - } - case 185: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - break; - } - case 61: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - break; - } - case 157: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - break; - } - case 103: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - break; - } - case 227: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - break; - } - case 230: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - break; - } - case 199: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - break; - } - case 220: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 158: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_C - PIXEL11 - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - break; - } - case 234: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - PIXEL02_1M - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1R - break; - } - case 242: - { - PIXEL00_1M - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_1 - PIXEL11 - PIXEL20_1L - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 59: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - break; - } - case 121: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 87: - { - PIXEL00_1L - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_1 - PIXEL11 - PIXEL20_1M - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 79: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - PIXEL02_1R - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - PIXEL22_1M - break; - } - case 122: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 94: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_C - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 218: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_C - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 91: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 229: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_2 - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - break; - } - case 167: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_2 - PIXEL21_1 - PIXEL22_2 - break; - } - case 173: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - break; - } - case 181: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - break; - } - case 186: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - break; - } - case 115: - { - PIXEL00_1L - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 93: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 206: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - PIXEL22_1R - break; - } - case 205: - case 201: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_1M - } - else - { - PIXEL20_2 - } - PIXEL21_C - PIXEL22_1R - break; - } - case 174: - case 46: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_1M - } - else - { - PIXEL00_2 - } - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - break; - } - case 179: - case 147: - { - PIXEL00_1L - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_1M - } - else - { - PIXEL02_2 - } - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - break; - } - case 117: - case 116: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_1M - } - else - { - PIXEL22_2 - } - break; - } - case 189: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - break; - } - case 231: - { - PIXEL00_1L - PIXEL01_C - PIXEL02_1R - PIXEL10_1 - PIXEL11 - PIXEL12_1 - PIXEL20_1L - PIXEL21_C - PIXEL22_1R - break; - } - case 126: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_4 - PIXEL12_3 - } - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 219: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL01_3 - PIXEL10_3 - } - PIXEL02_1M - PIXEL11 - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 125: - { - if (Diff(cget(8), cget(4))) - { - PIXEL00_1U - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL00_2 - PIXEL10_6 - PIXEL20_5 - PIXEL21_1 - } - PIXEL01_1 - PIXEL02_1U - PIXEL11 - PIXEL12_C - PIXEL22_1M - break; - } - case 221: - { - if (Diff(cget(6), cget(8))) - { - PIXEL02_1U - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL02_2 - PIXEL12_6 - PIXEL21_1 - PIXEL22_5 - } - PIXEL00_1U - PIXEL01_1 - PIXEL10_C - PIXEL11 - PIXEL20_1M - break; - } - case 207: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL02_1R - PIXEL10_C - } - else - { - PIXEL00_5 - PIXEL01_6 - PIXEL02_2 - PIXEL10_1 - } - PIXEL11 - PIXEL12_1 - PIXEL20_1M - PIXEL21_C - PIXEL22_1R - break; - } - case 238: - { - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - PIXEL22_1R - } - else - { - PIXEL10_1 - PIXEL20_5 - PIXEL21_6 - PIXEL22_2 - } - PIXEL00_1M - PIXEL01_C - PIXEL02_1R - PIXEL11 - PIXEL12_1 - break; - } - case 190: - { - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - PIXEL22_1D - } - else - { - PIXEL01_1 - PIXEL02_5 - PIXEL12_6 - PIXEL22_2 - } - PIXEL00_1M - PIXEL10_C - PIXEL11 - PIXEL20_1D - PIXEL21_1 - break; - } - case 187: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - PIXEL20_1D - } - else - { - PIXEL00_5 - PIXEL01_1 - PIXEL10_6 - PIXEL20_2 - } - PIXEL02_1M - PIXEL11 - PIXEL12_C - PIXEL21_1 - PIXEL22_1D - break; - } - case 243: - { - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL20_1L - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_1 - PIXEL20_2 - PIXEL21_6 - PIXEL22_5 - } - PIXEL00_1L - PIXEL01_C - PIXEL02_1M - PIXEL10_1 - PIXEL11 - break; - } - case 119: - { - if (Diff(cget(2), cget(6))) - { - PIXEL00_1L - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL00_2 - PIXEL01_6 - PIXEL02_5 - PIXEL12_1 - } - PIXEL10_1 - PIXEL11 - PIXEL20_1L - PIXEL21_C - PIXEL22_1M - break; - } - case 237: - case 233: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_2 - PIXEL10_C - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - } - else - { - PIXEL20_2 - } - PIXEL21_C - PIXEL22_1R - break; - } - case 175: - case 47: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - } - else - { - PIXEL00_2 - } - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - PIXEL20_1D - PIXEL21_1 - PIXEL22_2 - break; - } - case 183: - case 151: - { - PIXEL00_1L - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - } - else - { - PIXEL02_2 - } - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_2 - PIXEL21_1 - PIXEL22_1D - break; - } - case 245: - case 244: - { - PIXEL00_2 - PIXEL01_1 - PIXEL02_1U - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_C - } - else - { - PIXEL22_2 - } - break; - } - case 250: - { - PIXEL00_1M - PIXEL01_C - PIXEL02_1M - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - } - else - { - PIXEL10_3 - PIXEL20_4 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL22_4 - } - break; - } - case 123: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - } - else - { - PIXEL00_4 - PIXEL01_3 - } - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 95: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL10_3 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL02_4 - PIXEL12_3 - } - PIXEL11 - PIXEL20_1M - PIXEL21_C - PIXEL22_1M - break; - } - case 222: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - } - else - { - PIXEL01_3 - PIXEL02_4 - } - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 252: - { - PIXEL00_1M - PIXEL01_1 - PIXEL02_1U - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - } - else - { - PIXEL10_3 - PIXEL20_4 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_C - } - else - { - PIXEL22_2 - } - break; - } - case 249: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1M - PIXEL10_C - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - } - else - { - PIXEL20_2 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL22_4 - } - break; - } - case 235: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - } - else - { - PIXEL00_4 - PIXEL01_3 - } - PIXEL02_1M - PIXEL10_C - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - } - else - { - PIXEL20_2 - } - PIXEL21_C - PIXEL22_1R - break; - } - case 111: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - } - else - { - PIXEL00_2 - } - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 63: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - } - else - { - PIXEL00_2 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL02_4 - PIXEL12_3 - } - PIXEL10_C - PIXEL11 - PIXEL20_1D - PIXEL21_1 - PIXEL22_1M - break; - } - case 159: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL10_3 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - } - else - { - PIXEL02_2 - } - PIXEL11 - PIXEL12_C - PIXEL20_1M - PIXEL21_1 - PIXEL22_1D - break; - } - case 215: - { - PIXEL00_1L - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - } - else - { - PIXEL02_2 - } - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 246: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - } - else - { - PIXEL01_3 - PIXEL02_4 - } - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_C - } - else - { - PIXEL22_2 - } - break; - } - case 254: - { - PIXEL00_1M - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - } - else - { - PIXEL01_3 - PIXEL02_4 - } - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - } - else - { - PIXEL10_3 - PIXEL20_4 - } - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL21_3 - PIXEL22_2 - } - break; - } - case 253: - { - PIXEL00_1U - PIXEL01_1 - PIXEL02_1U - PIXEL10_C - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - } - else - { - PIXEL20_2 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_C - } - else - { - PIXEL22_2 - } - break; - } - case 251: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - } - else - { - PIXEL00_4 - PIXEL01_3 - } - PIXEL02_1M - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL10_C - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL10_3 - PIXEL20_2 - PIXEL21_3 - } - if (Diff(cget(6), cget(8))) - { - PIXEL12_C - PIXEL22_C - } - else - { - PIXEL12_3 - PIXEL22_4 - } - break; - } - case 239: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - } - else - { - PIXEL00_2 - } - PIXEL01_C - PIXEL02_1R - PIXEL10_C - PIXEL11 - PIXEL12_1 - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - } - else - { - PIXEL20_2 - } - PIXEL21_C - PIXEL22_1R - break; - } - case 127: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL01_C - PIXEL10_C - } - else - { - PIXEL00_2 - PIXEL01_3 - PIXEL10_3 - } - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL02_4 - PIXEL12_3 - } - PIXEL11 - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - PIXEL21_C - } - else - { - PIXEL20_4 - PIXEL21_3 - } - PIXEL22_1M - break; - } - case 191: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - } - else - { - PIXEL00_2 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - } - else - { - PIXEL02_2 - } - PIXEL10_C - PIXEL11 - PIXEL12_C - PIXEL20_1D - PIXEL21_1 - PIXEL22_1D - break; - } - case 223: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - PIXEL10_C - } - else - { - PIXEL00_4 - PIXEL10_3 - } - if (Diff(cget(2), cget(6))) - { - PIXEL01_C - PIXEL02_C - PIXEL12_C - } - else - { - PIXEL01_3 - PIXEL02_2 - PIXEL12_3 - } - PIXEL11 - PIXEL20_1M - if (Diff(cget(6), cget(8))) - { - PIXEL21_C - PIXEL22_C - } - else - { - PIXEL21_3 - PIXEL22_4 - } - break; - } - case 247: - { - PIXEL00_1L - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - } - else - { - PIXEL02_2 - } - PIXEL10_1 - PIXEL11 - PIXEL12_C - PIXEL20_1L - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_C - } - else - { - PIXEL22_2 - } - break; - } - case 255: - { - if (Diff(cget(4), cget(2))) - { - PIXEL00_C - } - else - { - PIXEL00_2 - } - PIXEL01_C - if (Diff(cget(2), cget(6))) - { - PIXEL02_C - } - else - { - PIXEL02_2 - } - PIXEL10_C - PIXEL11 - PIXEL12_C - if (Diff(cget(8), cget(4))) - { - PIXEL20_C - } - else - { - PIXEL20_2 - } - PIXEL21_C - if (Diff(cget(6), cget(8))) - { - PIXEL22_C - } - else - { - PIXEL22_2 - } - break; - } - } diff --git a/jan/src/intf/video/scalers/hq4x32.asm b/jan/src/intf/video/scalers/hq4x32.asm deleted file mode 100644 index 4987d10db..000000000 --- a/jan/src/intf/video/scalers/hq4x32.asm +++ /dev/null @@ -1,4015 +0,0 @@ -;hq4x filter -;---------------------------------------------------------- -;Copyright (C) 2003 MaxSt ( maxst@hiend3d.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -GLOBAL _hq4x_32 - -EXTERN _LUT16to32 -EXTERN _RGBtoYUV - -SECTION .bss -linesleft resd 1 -xcounter resd 1 -cross resd 1 -nextline resd 1 -prevline resd 1 -w1 resd 1 -w2 resd 1 -w3 resd 1 -w4 resd 1 -w5 resd 1 -w6 resd 1 -w7 resd 1 -w8 resd 1 -w9 resd 1 -c1 resd 1 -c2 resd 1 -c3 resd 1 -c4 resd 1 -c5 resd 1 -c6 resd 1 -c7 resd 1 -c8 resd 1 -c9 resd 1 - -SECTION .data - -reg_blank dd 0,0 -const3 dd 0x00030003,0x00000003 -const5 dd 0x00050005,0x00000005 -const6 dd 0x00060006,0x00000006 -const7 dd 0x00070007,0x00000007 -threshold dd 0x00300706,0x00000000 - -SECTION .text - -%macro AUXADDRESS 0 - mov ecx, edi - add ecx, ebx - add ecx, ebx -%endmacro - -%macro TestDiff 2 - mov edx,[%1] - sub edx,[%2] - jz %%fin - mov edx,[%1] - shl edx,2 - add edx,_RGBtoYUV - movd mm1,[edx] - movq mm5,mm1 - mov edx,[%2] - shl edx,2 - add edx,_RGBtoYUV - movd mm2,[edx] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 -%%fin: -%endmacro - -%macro DiffOrNot 4 - TestDiff %1,%2 - test edx,edx - jz %%same - %3 - jmp %%fin -%%same: - %4 -%%fin -%endmacro - -%macro DiffOrNot 8 - TestDiff %1,%2 - test edx,edx - jz %%same - %3 - %4 - %5 - jmp %%fin -%%same: - %6 - %7 - %8 -%%fin -%endmacro - -%macro DiffOrNot 10 - TestDiff %1,%2 - test edx,edx - jz %%same - %3 - %4 - %5 - %6 - jmp %%fin -%%same: - %7 - %8 - %9 - %10 -%%fin -%endmacro - -%macro DiffOrNot 14 - TestDiff %1,%2 - test edx,edx - jz %%same - %3 - %4 - %5 - %6 - %7 - %8 - jmp %%fin -%%same: - %9 - %10 - %11 - %12 - %13 - %14 -%%fin -%endmacro - -%macro Interp1 3 - mov edx,%2 - shl edx,2 - add edx,%3 - sub edx,%2 - shr edx,2 - mov %1,edx -%endmacro - -%macro Interp2 4 - mov edx,%2 - shl edx,1 - add edx,%3 - add edx,%4 - shr edx,2 - mov %1,edx -%endmacro - -%macro Interp3 2 - movd mm1, eax - movd mm2, %2 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - pmullw mm1, [const7] - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro Interp5 3 - mov edx,%2 - add edx,%3 - shr edx,1 - mov %1,edx -%endmacro - -%macro Interp6 3 - movd mm1, eax - movd mm2, %2 - movd mm3, %3 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - punpcklbw mm3, [reg_blank] - pmullw mm1, [const5] - psllw mm2, 1 - paddw mm1, mm3 - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro Interp7 3 - movd mm1, eax - movd mm2, %2 - movd mm3, %3 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - punpcklbw mm3, [reg_blank] - pmullw mm1, [const6] - paddw mm2, mm3 - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro Interp8 3 - movd mm1, %2 - movd mm2, %3 - punpcklbw mm1, [reg_blank] - punpcklbw mm2, [reg_blank] - pmullw mm1, [const5] - pmullw mm2, [const3] - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, [reg_blank] - movd %1, mm1 -%endmacro - -%macro PIXEL00_0 0 - mov [edi],eax -%endmacro - -%macro PIXEL00_11 0 - Interp1 [edi],eax,[c4] -%endmacro - -%macro PIXEL00_12 0 - Interp1 [edi],eax,[c2] -%endmacro - -%macro PIXEL00_20 0 - Interp2 [edi],eax,[c2],[c4] -%endmacro - -%macro PIXEL00_50 0 - Interp5 [edi],[c2],[c4] -%endmacro - -%macro PIXEL00_80 0 - Interp8 [edi],eax,[c1] -%endmacro - -%macro PIXEL00_81 0 - Interp8 [edi],eax,[c4] -%endmacro - -%macro PIXEL00_82 0 - Interp8 [edi],eax,[c2] -%endmacro - -%macro PIXEL01_0 0 - mov [edi+4],eax -%endmacro - -%macro PIXEL01_10 0 - Interp1 [edi+4],eax,[c1] -%endmacro - -%macro PIXEL01_12 0 - Interp1 [edi+4],eax,[c2] -%endmacro - -%macro PIXEL01_14 0 - Interp1 [edi+4],[c2],eax -%endmacro - -%macro PIXEL01_21 0 - Interp2 [edi+4],[c2],eax,[c4] -%endmacro - -%macro PIXEL01_31 0 - Interp3 [edi+4],[c4] -%endmacro - -%macro PIXEL01_50 0 - Interp5 [edi+4],[c2],eax -%endmacro - -%macro PIXEL01_60 0 - Interp6 [edi+4],[c2],[c4] -%endmacro - -%macro PIXEL01_61 0 - Interp6 [edi+4],[c2],[c1] -%endmacro - -%macro PIXEL01_82 0 - Interp8 [edi+4],eax,[c2] -%endmacro - -%macro PIXEL01_83 0 - Interp8 [edi+4],[c2],[c4] -%endmacro - -%macro PIXEL02_0 0 - mov [edi+8],eax -%endmacro - -%macro PIXEL02_10 0 - Interp1 [edi+8],eax,[c3] -%endmacro - -%macro PIXEL02_11 0 - Interp1 [edi+8],eax,[c2] -%endmacro - -%macro PIXEL02_13 0 - Interp1 [edi+8],[c2],eax -%endmacro - -%macro PIXEL02_21 0 - Interp2 [edi+8],[c2],eax,[c6] -%endmacro - -%macro PIXEL02_32 0 - Interp3 [edi+8],[c6] -%endmacro - -%macro PIXEL02_50 0 - Interp5 [edi+8],[c2],eax -%endmacro - -%macro PIXEL02_60 0 - Interp6 [edi+8],[c2],[c6] -%endmacro - -%macro PIXEL02_61 0 - Interp6 [edi+8],[c2],[c3] -%endmacro - -%macro PIXEL02_81 0 - Interp8 [edi+8],eax,[c2] -%endmacro - -%macro PIXEL02_83 0 - Interp8 [edi+8],[c2],[c6] -%endmacro - -%macro PIXEL03_0 0 - mov [edi+12],eax -%endmacro - -%macro PIXEL03_11 0 - Interp1 [edi+12],eax,[c2] -%endmacro - -%macro PIXEL03_12 0 - Interp1 [edi+12],eax,[c6] -%endmacro - -%macro PIXEL03_20 0 - Interp2 [edi+12],eax,[c2],[c6] -%endmacro - -%macro PIXEL03_50 0 - Interp5 [edi+12],[c2],[c6] -%endmacro - -%macro PIXEL03_80 0 - Interp8 [edi+12],eax,[c3] -%endmacro - -%macro PIXEL03_81 0 - Interp8 [edi+12],eax,[c2] -%endmacro - -%macro PIXEL03_82 0 - Interp8 [edi+12],eax,[c6] -%endmacro - -%macro PIXEL10_0 0 - mov [edi+ebx],eax -%endmacro - -%macro PIXEL10_10 0 - Interp1 [edi+ebx],eax,[c1] -%endmacro - -%macro PIXEL10_11 0 - Interp1 [edi+ebx],eax,[c4] -%endmacro - -%macro PIXEL10_13 0 - Interp1 [edi+ebx],[c4],eax -%endmacro - -%macro PIXEL10_21 0 - Interp2 [edi+ebx],[c4],eax,[c2] -%endmacro - -%macro PIXEL10_32 0 - Interp3 [edi+ebx],[c2] -%endmacro - -%macro PIXEL10_50 0 - Interp5 [edi+ebx],[c4],eax -%endmacro - -%macro PIXEL10_60 0 - Interp6 [edi+ebx],[c4],[c2] -%endmacro - -%macro PIXEL10_61 0 - Interp6 [edi+ebx],[c4],[c1] -%endmacro - -%macro PIXEL10_81 0 - Interp8 [edi+ebx],eax,[c4] -%endmacro - -%macro PIXEL10_83 0 - Interp8 [edi+ebx],[c4],[c2] -%endmacro - -%macro PIXEL11_0 0 - mov [edi+ebx+4],eax -%endmacro - -%macro PIXEL11_30 0 - Interp3 [edi+ebx+4],[c1] -%endmacro - -%macro PIXEL11_31 0 - Interp3 [edi+ebx+4],[c4] -%endmacro - -%macro PIXEL11_32 0 - Interp3 [edi+ebx+4],[c2] -%endmacro - -%macro PIXEL11_70 0 - Interp7 [edi+ebx+4],[c4],[c2] -%endmacro - -%macro PIXEL12_0 0 - mov [edi+ebx+8],eax -%endmacro - -%macro PIXEL12_30 0 - Interp3 [edi+ebx+8],[c3] -%endmacro - -%macro PIXEL12_31 0 - Interp3 [edi+ebx+8],[c2] -%endmacro - -%macro PIXEL12_32 0 - Interp3 [edi+ebx+8],[c6] -%endmacro - -%macro PIXEL12_70 0 - Interp7 [edi+ebx+8],[c6],[c2] -%endmacro - -%macro PIXEL13_0 0 - mov [edi+ebx+12],eax -%endmacro - -%macro PIXEL13_10 0 - Interp1 [edi+ebx+12],eax,[c3] -%endmacro - -%macro PIXEL13_12 0 - Interp1 [edi+ebx+12],eax,[c6] -%endmacro - -%macro PIXEL13_14 0 - Interp1 [edi+ebx+12],[c6],eax -%endmacro - -%macro PIXEL13_21 0 - Interp2 [edi+ebx+12],[c6],eax,[c2] -%endmacro - -%macro PIXEL13_31 0 - Interp3 [edi+ebx+12],[c2] -%endmacro - -%macro PIXEL13_50 0 - Interp5 [edi+ebx+12],[c6],eax -%endmacro - -%macro PIXEL13_60 0 - Interp6 [edi+ebx+12],[c6],[c2] -%endmacro - -%macro PIXEL13_61 0 - Interp6 [edi+ebx+12],[c6],[c3] -%endmacro - -%macro PIXEL13_82 0 - Interp8 [edi+ebx+12],eax,[c6] -%endmacro - -%macro PIXEL13_83 0 - Interp8 [edi+ebx+12],[c6],[c2] -%endmacro - -%macro PIXEL20_0 0 - mov [ecx],eax -%endmacro - -%macro PIXEL20_10 0 - Interp1 [ecx],eax,[c7] -%endmacro - -%macro PIXEL20_12 0 - Interp1 [ecx],eax,[c4] -%endmacro - -%macro PIXEL20_14 0 - Interp1 [ecx],[c4],eax -%endmacro - -%macro PIXEL20_21 0 - Interp2 [ecx],[c4],eax,[c8] -%endmacro - -%macro PIXEL20_31 0 - Interp3 [ecx],[c8] -%endmacro - -%macro PIXEL20_50 0 - Interp5 [ecx],[c4],eax -%endmacro - -%macro PIXEL20_60 0 - Interp6 [ecx],[c4],[c8] -%endmacro - -%macro PIXEL20_61 0 - Interp6 [ecx],[c4],[c7] -%endmacro - -%macro PIXEL20_82 0 - Interp8 [ecx],eax,[c4] -%endmacro - -%macro PIXEL20_83 0 - Interp8 [ecx],[c4],[c8] -%endmacro - -%macro PIXEL21_0 0 - mov [ecx+4],eax -%endmacro - -%macro PIXEL21_30 0 - Interp3 [ecx+4],[c7] -%endmacro - -%macro PIXEL21_31 0 - Interp3 [ecx+4],[c8] -%endmacro - -%macro PIXEL21_32 0 - Interp3 [ecx+4],[c4] -%endmacro - -%macro PIXEL21_70 0 - Interp7 [ecx+4],[c4],[c8] -%endmacro - -%macro PIXEL22_0 0 - mov [ecx+8],eax -%endmacro - -%macro PIXEL22_30 0 - Interp3 [ecx+8],[c9] -%endmacro - -%macro PIXEL22_31 0 - Interp3 [ecx+8],[c6] -%endmacro - -%macro PIXEL22_32 0 - Interp3 [ecx+8],[c8] -%endmacro - -%macro PIXEL22_70 0 - Interp7 [ecx+8],[c6],[c8] -%endmacro - -%macro PIXEL23_0 0 - mov [ecx+12],eax -%endmacro - -%macro PIXEL23_10 0 - Interp1 [ecx+12],eax,[c9] -%endmacro - -%macro PIXEL23_11 0 - Interp1 [ecx+12],eax,[c6] -%endmacro - -%macro PIXEL23_13 0 - Interp1 [ecx+12],[c6],eax -%endmacro - -%macro PIXEL23_21 0 - Interp2 [ecx+12],[c6],eax,[c8] -%endmacro - -%macro PIXEL23_32 0 - Interp3 [ecx+12],[c8] -%endmacro - -%macro PIXEL23_50 0 - Interp5 [ecx+12],[c6],eax -%endmacro - -%macro PIXEL23_60 0 - Interp6 [ecx+12],[c6],[c8] -%endmacro - -%macro PIXEL23_61 0 - Interp6 [ecx+12],[c6],[c9] -%endmacro - -%macro PIXEL23_81 0 - Interp8 [ecx+12],eax,[c6] -%endmacro - -%macro PIXEL23_83 0 - Interp8 [ecx+12],[c6],[c8] -%endmacro - -%macro PIXEL30_0 0 - mov [ecx+ebx],eax -%endmacro - -%macro PIXEL30_11 0 - Interp1 [ecx+ebx],eax,[c8] -%endmacro - -%macro PIXEL30_12 0 - Interp1 [ecx+ebx],eax,[c4] -%endmacro - -%macro PIXEL30_20 0 - Interp2 [ecx+ebx],eax,[c8],[c4] -%endmacro - -%macro PIXEL30_50 0 - Interp5 [ecx+ebx],[c8],[c4] -%endmacro - -%macro PIXEL30_80 0 - Interp8 [ecx+ebx],eax,[c7] -%endmacro - -%macro PIXEL30_81 0 - Interp8 [ecx+ebx],eax,[c8] -%endmacro - -%macro PIXEL30_82 0 - Interp8 [ecx+ebx],eax,[c4] -%endmacro - -%macro PIXEL31_0 0 - mov [ecx+ebx+4],eax -%endmacro - -%macro PIXEL31_10 0 - Interp1 [ecx+ebx+4],eax,[c7] -%endmacro - -%macro PIXEL31_11 0 - Interp1 [ecx+ebx+4],eax,[c8] -%endmacro - -%macro PIXEL31_13 0 - Interp1 [ecx+ebx+4],[c8],eax -%endmacro - -%macro PIXEL31_21 0 - Interp2 [ecx+ebx+4],[c8],eax,[c4] -%endmacro - -%macro PIXEL31_32 0 - Interp3 [ecx+ebx+4],[c4] -%endmacro - -%macro PIXEL31_50 0 - Interp5 [ecx+ebx+4],[c8],eax -%endmacro - -%macro PIXEL31_60 0 - Interp6 [ecx+ebx+4],[c8],[c4] -%endmacro - -%macro PIXEL31_61 0 - Interp6 [ecx+ebx+4],[c8],[c7] -%endmacro - -%macro PIXEL31_81 0 - Interp8 [ecx+ebx+4],eax,[c8] -%endmacro - -%macro PIXEL31_83 0 - Interp8 [ecx+ebx+4],[c8],[c4] -%endmacro - -%macro PIXEL32_0 0 - mov [ecx+ebx+8],eax -%endmacro - -%macro PIXEL32_10 0 - Interp1 [ecx+ebx+8],eax,[c9] -%endmacro - -%macro PIXEL32_12 0 - Interp1 [ecx+ebx+8],eax,[c8] -%endmacro - -%macro PIXEL32_14 0 - Interp1 [ecx+ebx+8],[c8],eax -%endmacro - -%macro PIXEL32_21 0 - Interp2 [ecx+ebx+8],[c8],eax,[c6] -%endmacro - -%macro PIXEL32_31 0 - Interp3 [ecx+ebx+8],[c6] -%endmacro - -%macro PIXEL32_50 0 - Interp5 [ecx+ebx+8],[c8],eax -%endmacro - -%macro PIXEL32_60 0 - Interp6 [ecx+ebx+8],[c8],[c6] -%endmacro - -%macro PIXEL32_61 0 - Interp6 [ecx+ebx+8],[c8],[c9] -%endmacro - -%macro PIXEL32_82 0 - Interp8 [ecx+ebx+8],eax,[c8] -%endmacro - -%macro PIXEL32_83 0 - Interp8 [ecx+ebx+8],[c8],[c6] -%endmacro - -%macro PIXEL33_0 0 - mov [ecx+ebx+12],eax -%endmacro - -%macro PIXEL33_11 0 - Interp1 [ecx+ebx+12],eax,[c6] -%endmacro - -%macro PIXEL33_12 0 - Interp1 [ecx+ebx+12],eax,[c8] -%endmacro - -%macro PIXEL33_20 0 - Interp2 [ecx+ebx+12],eax,[c8],[c6] -%endmacro - -%macro PIXEL33_50 0 - Interp5 [ecx+ebx+12],[c8],[c6] -%endmacro - -%macro PIXEL33_80 0 - Interp8 [ecx+ebx+12],eax,[c9] -%endmacro - -%macro PIXEL33_81 0 - Interp8 [ecx+ebx+12],eax,[c6] -%endmacro - -%macro PIXEL33_82 0 - Interp8 [ecx+ebx+12],eax,[c8] -%endmacro - -inbuffer equ 8 -outbuffer equ 12 -Xres equ 16 -Yres equ 20 -pitch equ 24 - -_hq4x_32: - push ebp - mov ebp,esp - pushad - - mov esi,[ebp+inbuffer] - mov edi,[ebp+outbuffer] - mov edx,[ebp+Yres] - mov [linesleft],edx - mov ebx,[ebp+Xres] - shl ebx,1 - mov dword[prevline],0 - mov dword[nextline],ebx -.loopy - push edi - mov ecx,[ebp+Xres] - sub ecx,2 ; x={Xres-2, Xres-1} are special cases. - mov dword[xcounter],ecx - ; x=0 - special case - mov ebx,[prevline] - movq mm5,[esi+ebx] - movq mm6,[esi] - mov ebx,[nextline] - movq mm7,[esi+ebx] - movd eax,mm5 - movzx edx,ax - mov [w1],edx - mov [w2],edx - shr eax,16 - mov [w3],eax - movd eax,mm6 - movzx edx,ax - mov [w4],edx - mov [w5],edx - shr eax,16 - mov [w6],eax - movd eax,mm7 - movzx edx,ax - mov [w7],edx - mov [w8],edx - shr eax,16 - mov [w9],eax - jmp .flags -.loopx - mov ebx,[prevline] - movq mm5,[esi+ebx-2] - movq mm6,[esi-2] - mov ebx,[nextline] - movq mm7,[esi+ebx-2] - movd eax,mm5 - movzx edx,ax - mov [w1],edx - shr eax,16 - mov [w2],eax - psrlq mm5,32 - movd eax,mm5 - movzx edx,ax - mov [w3],edx - movd eax,mm6 - movzx edx,ax - mov [w4],edx - shr eax,16 - mov [w5],eax - psrlq mm6,32 - movd eax,mm6 - movzx edx,ax - mov [w6],edx - movd eax,mm7 - movzx edx,ax - mov [w7],edx - shr eax,16 - mov [w8],eax - psrlq mm7,32 - movd eax,mm7 - movzx edx,ax - mov [w9],edx -.flags - mov ebx,_RGBtoYUV - mov eax,[w5] - xor ecx,ecx - movd mm5,[ebx+eax*4] - mov dword[cross],0 - - mov edx,[w2] - cmp eax,edx - je .noflag2 - or dword[cross],1 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag2 - or ecx,2 -.noflag2 - mov edx,[w4] - cmp eax,edx - je .noflag4 - or dword[cross],2 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag4 - or ecx,8 -.noflag4 - mov edx,[w6] - cmp eax,edx - je .noflag6 - or dword[cross],4 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag6 - or ecx,16 -.noflag6 - mov edx,[w8] - cmp eax,edx - je .noflag8 - or dword[cross],8 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag8 - or ecx,64 -.noflag8 - cmp dword[cross],0 - jnz .testflag1 - mov ebx,_LUT16to32 - mov eax,[ebx+eax*4] - mov ebx,[ebp+pitch] - AUXADDRESS - mov [edi],eax - mov [edi+4],eax - mov [edi+8],eax - mov [edi+12],eax - mov [edi+ebx],eax - mov [edi+ebx+4],eax - mov [edi+ebx+8],eax - mov [edi+ebx+12],eax - mov [ecx],eax - mov [ecx+4],eax - mov [ecx+8],eax - mov [ecx+12],eax - mov [ecx+ebx],eax - mov [ecx+ebx+4],eax - mov [ecx+ebx+8],eax - mov [ecx+ebx+12],eax - jmp .loopx_end -.testflag1 - mov edx,[w1] - cmp eax,edx - je .noflag1 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag1 - or ecx,1 -.noflag1 - mov edx,[w3] - cmp eax,edx - je .noflag3 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag3 - or ecx,4 -.noflag3 - mov edx,[w7] - cmp eax,edx - je .noflag7 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag7 - or ecx,32 -.noflag7 - mov edx,[w9] - cmp eax,edx - je .noflag9 - movq mm1,mm5 - movd mm2,[ebx+edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,[threshold] - movd edx,mm1 - test edx,edx - jz .noflag9 - or ecx,128 -.noflag9 - mov ebx,_LUT16to32 - mov eax,[ebx+eax*4] - mov edx,[w2] - mov edx,[ebx+edx*4] - mov [c2],edx - mov edx,[w4] - mov edx,[ebx+edx*4] - mov [c4],edx - mov edx,[w6] - mov edx,[ebx+edx*4] - mov [c6],edx - mov edx,[w8] - mov edx,[ebx+edx*4] - mov [c8],edx - test ecx,0x005A - jz .switch - mov edx,[w1] - mov edx,[ebx+edx*4] - mov [c1],edx - mov edx,[w3] - mov edx,[ebx+edx*4] - mov [c3],edx - mov edx,[w7] - mov edx,[ebx+edx*4] - mov [c7],edx - mov edx,[w9] - mov edx,[ebx+edx*4] - mov [c9],edx -.switch - mov ebx,[ebp+pitch] - jmp [FuncTable+ecx*4] - -..@flag0 -..@flag1 -..@flag4 -..@flag32 -..@flag128 -..@flag5 -..@flag132 -..@flag160 -..@flag33 -..@flag129 -..@flag36 -..@flag133 -..@flag164 -..@flag161 -..@flag37 -..@flag165 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_60 - PIXEL03_20 - PIXEL10_60 - PIXEL11_70 - PIXEL12_70 - PIXEL13_60 - PIXEL20_60 - PIXEL21_70 - PIXEL22_70 - PIXEL23_60 - PIXEL30_20 - PIXEL31_60 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag2 -..@flag34 -..@flag130 -..@flag162 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_10 - PIXEL03_80 - PIXEL10_61 - PIXEL11_30 - PIXEL12_30 - PIXEL13_61 - PIXEL20_60 - PIXEL21_70 - PIXEL22_70 - PIXEL23_60 - PIXEL30_20 - PIXEL31_60 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag16 -..@flag17 -..@flag48 -..@flag49 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_61 - PIXEL03_80 - PIXEL10_60 - PIXEL11_70 - PIXEL12_30 - PIXEL13_10 - PIXEL20_60 - PIXEL21_70 - PIXEL22_30 - PIXEL23_10 - PIXEL30_20 - PIXEL31_60 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag64 -..@flag65 -..@flag68 -..@flag69 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_60 - PIXEL03_20 - PIXEL10_60 - PIXEL11_70 - PIXEL12_70 - PIXEL13_60 - PIXEL20_61 - PIXEL21_30 - PIXEL22_30 - PIXEL23_61 - PIXEL30_80 - PIXEL31_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag8 -..@flag12 -..@flag136 -..@flag140 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_60 - PIXEL03_20 - PIXEL10_10 - PIXEL11_30 - PIXEL12_70 - PIXEL13_60 - PIXEL20_10 - PIXEL21_30 - PIXEL22_70 - PIXEL23_60 - PIXEL30_80 - PIXEL31_61 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag3 -..@flag35 -..@flag131 -..@flag163 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_10 - PIXEL03_80 - PIXEL10_81 - PIXEL11_31 - PIXEL12_30 - PIXEL13_61 - PIXEL20_60 - PIXEL21_70 - PIXEL22_70 - PIXEL23_60 - PIXEL30_20 - PIXEL31_60 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag6 -..@flag38 -..@flag134 -..@flag166 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_32 - PIXEL03_82 - PIXEL10_61 - PIXEL11_30 - PIXEL12_32 - PIXEL13_82 - PIXEL20_60 - PIXEL21_70 - PIXEL22_70 - PIXEL23_60 - PIXEL30_20 - PIXEL31_60 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag20 -..@flag21 -..@flag52 -..@flag53 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_81 - PIXEL03_81 - PIXEL10_60 - PIXEL11_70 - PIXEL12_31 - PIXEL13_31 - PIXEL20_60 - PIXEL21_70 - PIXEL22_30 - PIXEL23_10 - PIXEL30_20 - PIXEL31_60 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag144 -..@flag145 -..@flag176 -..@flag177 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_61 - PIXEL03_80 - PIXEL10_60 - PIXEL11_70 - PIXEL12_30 - PIXEL13_10 - PIXEL20_60 - PIXEL21_70 - PIXEL22_32 - PIXEL23_32 - PIXEL30_20 - PIXEL31_60 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag192 -..@flag193 -..@flag196 -..@flag197 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_60 - PIXEL03_20 - PIXEL10_60 - PIXEL11_70 - PIXEL12_70 - PIXEL13_60 - PIXEL20_61 - PIXEL21_30 - PIXEL22_31 - PIXEL23_81 - PIXEL30_80 - PIXEL31_10 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag96 -..@flag97 -..@flag100 -..@flag101 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_60 - PIXEL03_20 - PIXEL10_60 - PIXEL11_70 - PIXEL12_70 - PIXEL13_60 - PIXEL20_82 - PIXEL21_32 - PIXEL22_30 - PIXEL23_61 - PIXEL30_82 - PIXEL31_32 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag40 -..@flag44 -..@flag168 -..@flag172 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_60 - PIXEL03_20 - PIXEL10_10 - PIXEL11_30 - PIXEL12_70 - PIXEL13_60 - PIXEL20_31 - PIXEL21_31 - PIXEL22_70 - PIXEL23_60 - PIXEL30_81 - PIXEL31_81 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag9 -..@flag13 -..@flag137 -..@flag141 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_60 - PIXEL03_20 - PIXEL10_32 - PIXEL11_32 - PIXEL12_70 - PIXEL13_60 - PIXEL20_10 - PIXEL21_30 - PIXEL22_70 - PIXEL23_60 - PIXEL30_80 - PIXEL31_61 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag18 -..@flag50 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_50,PIXEL03_50,PIXEL12_0,PIXEL13_50 - PIXEL10_61 - PIXEL11_30 - PIXEL20_60 - PIXEL21_70 - PIXEL22_30 - PIXEL23_10 - PIXEL30_20 - PIXEL31_60 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag80 -..@flag81 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_61 - PIXEL03_80 - PIXEL10_60 - PIXEL11_70 - PIXEL12_30 - PIXEL13_10 - PIXEL20_61 - PIXEL21_30 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag72 -..@flag76 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_60 - PIXEL03_20 - PIXEL10_10 - PIXEL11_30 - PIXEL12_70 - PIXEL13_60 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_50,PIXEL21_0,PIXEL30_50,PIXEL31_50 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag10 -..@flag138 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_50,PIXEL01_50,PIXEL10_50,PIXEL11_0 - PIXEL02_10 - PIXEL03_80 - PIXEL12_30 - PIXEL13_61 - PIXEL20_10 - PIXEL21_30 - PIXEL22_70 - PIXEL23_60 - PIXEL30_80 - PIXEL31_61 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag66 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_10 - PIXEL03_80 - PIXEL10_61 - PIXEL11_30 - PIXEL12_30 - PIXEL13_61 - PIXEL20_61 - PIXEL21_30 - PIXEL22_30 - PIXEL23_61 - PIXEL30_80 - PIXEL31_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag24 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_61 - PIXEL03_80 - PIXEL10_10 - PIXEL11_30 - PIXEL12_30 - PIXEL13_10 - PIXEL20_10 - PIXEL21_30 - PIXEL22_30 - PIXEL23_10 - PIXEL30_80 - PIXEL31_61 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag7 -..@flag39 -..@flag135 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_32 - PIXEL03_82 - PIXEL10_81 - PIXEL11_31 - PIXEL12_32 - PIXEL13_82 - PIXEL20_60 - PIXEL21_70 - PIXEL22_70 - PIXEL23_60 - PIXEL30_20 - PIXEL31_60 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag148 -..@flag149 -..@flag180 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_81 - PIXEL03_81 - PIXEL10_60 - PIXEL11_70 - PIXEL12_31 - PIXEL13_31 - PIXEL20_60 - PIXEL21_70 - PIXEL22_32 - PIXEL23_32 - PIXEL30_20 - PIXEL31_60 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag224 -..@flag228 -..@flag225 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_60 - PIXEL03_20 - PIXEL10_60 - PIXEL11_70 - PIXEL12_70 - PIXEL13_60 - PIXEL20_82 - PIXEL21_32 - PIXEL22_31 - PIXEL23_81 - PIXEL30_82 - PIXEL31_32 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag41 -..@flag169 -..@flag45 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_60 - PIXEL03_20 - PIXEL10_32 - PIXEL11_32 - PIXEL12_70 - PIXEL13_60 - PIXEL20_31 - PIXEL21_31 - PIXEL22_70 - PIXEL23_60 - PIXEL30_81 - PIXEL31_81 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag22 -..@flag54 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_61 - PIXEL11_30 - PIXEL12_0 - PIXEL20_60 - PIXEL21_70 - PIXEL22_30 - PIXEL23_10 - PIXEL30_20 - PIXEL31_60 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag208 -..@flag209 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_61 - PIXEL03_80 - PIXEL10_60 - PIXEL11_70 - PIXEL12_30 - PIXEL13_10 - PIXEL20_61 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag104 -..@flag108 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_60 - PIXEL03_20 - PIXEL10_10 - PIXEL11_30 - PIXEL12_70 - PIXEL13_60 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag11 -..@flag139 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_61 - PIXEL20_10 - PIXEL21_30 - PIXEL22_70 - PIXEL23_60 - PIXEL30_80 - PIXEL31_61 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag19 -..@flag51 - AUXADDRESS - DiffOrNot w2,w6,PIXEL00_81,PIXEL01_31,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL00_12,PIXEL01_14,PIXEL02_83,PIXEL03_50,PIXEL12_70,PIXEL13_21 - PIXEL10_81 - PIXEL11_31 - PIXEL20_60 - PIXEL21_70 - PIXEL22_30 - PIXEL23_10 - PIXEL30_20 - PIXEL31_60 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag146 -..@flag178 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL23_32,PIXEL33_82,PIXEL02_21,PIXEL03_50,PIXEL12_70,PIXEL13_83,PIXEL23_13,PIXEL33_11 - PIXEL10_61 - PIXEL11_30 - PIXEL20_60 - PIXEL21_70 - PIXEL22_32 - PIXEL30_20 - PIXEL31_60 - PIXEL32_82 - jmp .loopx_end -..@flag84 -..@flag85 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_81 - DiffOrNot w6,w8,PIXEL03_81,PIXEL13_31,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL03_12,PIXEL13_14,PIXEL22_70,PIXEL23_83,PIXEL32_21,PIXEL33_50 - PIXEL10_60 - PIXEL11_70 - PIXEL12_31 - PIXEL20_61 - PIXEL21_30 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag112 -..@flag113 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_61 - PIXEL03_80 - PIXEL10_60 - PIXEL11_70 - PIXEL12_30 - PIXEL13_10 - PIXEL20_82 - PIXEL21_32 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL30_82,PIXEL31_32,PIXEL32_10,PIXEL33_80,PIXEL22_70,PIXEL23_21,PIXEL30_11,PIXEL31_13,PIXEL32_83,PIXEL33_50 - jmp .loopx_end -..@flag200 -..@flag204 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_60 - PIXEL03_20 - PIXEL10_10 - PIXEL11_30 - PIXEL12_70 - PIXEL13_60 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL32_31,PIXEL33_81,PIXEL20_21,PIXEL21_70,PIXEL30_50,PIXEL31_83,PIXEL32_14,PIXEL33_12 - PIXEL22_31 - PIXEL23_81 - jmp .loopx_end -..@flag73 -..@flag77 - AUXADDRESS - DiffOrNot w8,w4,PIXEL00_82,PIXEL10_32,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL00_11,PIXEL10_13,PIXEL20_83,PIXEL21_70,PIXEL30_50,PIXEL31_21 - PIXEL01_82 - PIXEL02_60 - PIXEL03_20 - PIXEL11_32 - PIXEL12_70 - PIXEL13_60 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag42 -..@flag170 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL20_31,PIXEL30_81,PIXEL00_50,PIXEL01_21,PIXEL10_83,PIXEL11_70,PIXEL20_14,PIXEL30_12 - PIXEL02_10 - PIXEL03_80 - PIXEL12_30 - PIXEL13_61 - PIXEL21_31 - PIXEL22_70 - PIXEL23_60 - PIXEL31_81 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag14 -..@flag142 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL02_32,PIXEL03_82,PIXEL10_10,PIXEL11_30,PIXEL00_50,PIXEL01_83,PIXEL02_13,PIXEL03_11,PIXEL10_21,PIXEL11_70 - PIXEL12_32 - PIXEL13_82 - PIXEL20_10 - PIXEL21_30 - PIXEL22_70 - PIXEL23_60 - PIXEL30_80 - PIXEL31_61 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag67 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_10 - PIXEL03_80 - PIXEL10_81 - PIXEL11_31 - PIXEL12_30 - PIXEL13_61 - PIXEL20_61 - PIXEL21_30 - PIXEL22_30 - PIXEL23_61 - PIXEL30_80 - PIXEL31_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag70 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_32 - PIXEL03_82 - PIXEL10_61 - PIXEL11_30 - PIXEL12_32 - PIXEL13_82 - PIXEL20_61 - PIXEL21_30 - PIXEL22_30 - PIXEL23_61 - PIXEL30_80 - PIXEL31_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag28 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_81 - PIXEL03_81 - PIXEL10_10 - PIXEL11_30 - PIXEL12_31 - PIXEL13_31 - PIXEL20_10 - PIXEL21_30 - PIXEL22_30 - PIXEL23_10 - PIXEL30_80 - PIXEL31_61 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag152 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_61 - PIXEL03_80 - PIXEL10_10 - PIXEL11_30 - PIXEL12_30 - PIXEL13_10 - PIXEL20_10 - PIXEL21_30 - PIXEL22_32 - PIXEL23_32 - PIXEL30_80 - PIXEL31_61 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag194 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_10 - PIXEL03_80 - PIXEL10_61 - PIXEL11_30 - PIXEL12_30 - PIXEL13_61 - PIXEL20_61 - PIXEL21_30 - PIXEL22_31 - PIXEL23_81 - PIXEL30_80 - PIXEL31_10 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag98 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_10 - PIXEL03_80 - PIXEL10_61 - PIXEL11_30 - PIXEL12_30 - PIXEL13_61 - PIXEL20_82 - PIXEL21_32 - PIXEL22_30 - PIXEL23_61 - PIXEL30_82 - PIXEL31_32 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag56 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_61 - PIXEL03_80 - PIXEL10_10 - PIXEL11_30 - PIXEL12_30 - PIXEL13_10 - PIXEL20_31 - PIXEL21_31 - PIXEL22_30 - PIXEL23_10 - PIXEL30_81 - PIXEL31_81 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag25 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_61 - PIXEL03_80 - PIXEL10_32 - PIXEL11_32 - PIXEL12_30 - PIXEL13_10 - PIXEL20_10 - PIXEL21_30 - PIXEL22_30 - PIXEL23_10 - PIXEL30_80 - PIXEL31_61 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag26 -..@flag31 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL11_0 - PIXEL12_0 - PIXEL20_10 - PIXEL21_30 - PIXEL22_30 - PIXEL23_10 - PIXEL30_80 - PIXEL31_61 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag82 -..@flag214 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_61 - PIXEL11_30 - PIXEL12_0 - PIXEL20_61 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag88 -..@flag248 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_61 - PIXEL03_80 - PIXEL10_10 - PIXEL11_30 - PIXEL12_30 - PIXEL13_10 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - jmp .loopx_end -..@flag74 -..@flag107 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_61 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag27 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_10 - PIXEL20_10 - PIXEL21_30 - PIXEL22_30 - PIXEL23_10 - PIXEL30_80 - PIXEL31_61 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag86 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_61 - PIXEL11_30 - PIXEL12_0 - PIXEL20_61 - PIXEL21_30 - PIXEL22_30 - PIXEL23_10 - PIXEL30_80 - PIXEL31_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag216 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_61 - PIXEL03_80 - PIXEL10_10 - PIXEL11_30 - PIXEL12_30 - PIXEL13_10 - PIXEL20_10 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag106 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_10 - PIXEL03_80 - PIXEL10_10 - PIXEL11_30 - PIXEL12_30 - PIXEL13_61 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag30 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_10 - PIXEL11_30 - PIXEL12_0 - PIXEL20_10 - PIXEL21_30 - PIXEL22_30 - PIXEL23_10 - PIXEL30_80 - PIXEL31_61 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag210 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_10 - PIXEL03_80 - PIXEL10_61 - PIXEL11_30 - PIXEL12_30 - PIXEL13_10 - PIXEL20_61 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag120 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_61 - PIXEL03_80 - PIXEL10_10 - PIXEL11_30 - PIXEL12_30 - PIXEL13_10 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag75 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_61 - PIXEL20_10 - PIXEL21_30 - PIXEL22_30 - PIXEL23_61 - PIXEL30_80 - PIXEL31_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag29 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_81 - PIXEL03_81 - PIXEL10_32 - PIXEL11_32 - PIXEL12_31 - PIXEL13_31 - PIXEL20_10 - PIXEL21_30 - PIXEL22_30 - PIXEL23_10 - PIXEL30_80 - PIXEL31_61 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag198 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_32 - PIXEL03_82 - PIXEL10_61 - PIXEL11_30 - PIXEL12_32 - PIXEL13_82 - PIXEL20_61 - PIXEL21_30 - PIXEL22_31 - PIXEL23_81 - PIXEL30_80 - PIXEL31_10 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag184 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_61 - PIXEL03_80 - PIXEL10_10 - PIXEL11_30 - PIXEL12_30 - PIXEL13_10 - PIXEL20_31 - PIXEL21_31 - PIXEL22_32 - PIXEL23_32 - PIXEL30_81 - PIXEL31_81 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag99 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_10 - PIXEL03_80 - PIXEL10_81 - PIXEL11_31 - PIXEL12_30 - PIXEL13_61 - PIXEL20_82 - PIXEL21_32 - PIXEL22_30 - PIXEL23_61 - PIXEL30_82 - PIXEL31_32 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag57 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_61 - PIXEL03_80 - PIXEL10_32 - PIXEL11_32 - PIXEL12_30 - PIXEL13_10 - PIXEL20_31 - PIXEL21_31 - PIXEL22_30 - PIXEL23_10 - PIXEL30_81 - PIXEL31_81 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag71 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_32 - PIXEL03_82 - PIXEL10_81 - PIXEL11_31 - PIXEL12_32 - PIXEL13_82 - PIXEL20_61 - PIXEL21_30 - PIXEL22_30 - PIXEL23_61 - PIXEL30_80 - PIXEL31_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag156 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_81 - PIXEL03_81 - PIXEL10_10 - PIXEL11_30 - PIXEL12_31 - PIXEL13_31 - PIXEL20_10 - PIXEL21_30 - PIXEL22_32 - PIXEL23_32 - PIXEL30_80 - PIXEL31_61 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag226 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_10 - PIXEL03_80 - PIXEL10_61 - PIXEL11_30 - PIXEL12_30 - PIXEL13_61 - PIXEL20_82 - PIXEL21_32 - PIXEL22_31 - PIXEL23_81 - PIXEL30_82 - PIXEL31_32 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag60 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_81 - PIXEL03_81 - PIXEL10_10 - PIXEL11_30 - PIXEL12_31 - PIXEL13_31 - PIXEL20_31 - PIXEL21_31 - PIXEL22_30 - PIXEL23_10 - PIXEL30_81 - PIXEL31_81 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag195 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_10 - PIXEL03_80 - PIXEL10_81 - PIXEL11_31 - PIXEL12_30 - PIXEL13_61 - PIXEL20_61 - PIXEL21_30 - PIXEL22_31 - PIXEL23_81 - PIXEL30_80 - PIXEL31_10 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag102 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_32 - PIXEL03_82 - PIXEL10_61 - PIXEL11_30 - PIXEL12_32 - PIXEL13_82 - PIXEL20_82 - PIXEL21_32 - PIXEL22_30 - PIXEL23_61 - PIXEL30_82 - PIXEL31_32 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag153 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_61 - PIXEL03_80 - PIXEL10_32 - PIXEL11_32 - PIXEL12_30 - PIXEL13_10 - PIXEL20_10 - PIXEL21_30 - PIXEL22_32 - PIXEL23_32 - PIXEL30_80 - PIXEL31_61 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag58 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL20_31 - PIXEL21_31 - PIXEL22_30 - PIXEL23_10 - PIXEL30_81 - PIXEL31_81 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag83 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL10_81 - PIXEL11_31 - PIXEL20_61 - PIXEL21_30 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag92 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_81 - PIXEL03_81 - PIXEL10_10 - PIXEL11_30 - PIXEL12_31 - PIXEL13_31 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - jmp .loopx_end -..@flag202 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - PIXEL02_10 - PIXEL03_80 - PIXEL12_30 - PIXEL13_61 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - PIXEL22_31 - PIXEL23_81 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag78 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - PIXEL02_32 - PIXEL03_82 - PIXEL12_32 - PIXEL13_82 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag154 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL20_10 - PIXEL21_30 - PIXEL22_32 - PIXEL23_32 - PIXEL30_80 - PIXEL31_61 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag114 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL10_61 - PIXEL11_30 - PIXEL20_82 - PIXEL21_32 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - PIXEL30_82 - PIXEL31_32 - jmp .loopx_end -..@flag89 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_61 - PIXEL03_80 - PIXEL10_32 - PIXEL11_32 - PIXEL12_30 - PIXEL13_10 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - jmp .loopx_end -..@flag90 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - jmp .loopx_end -..@flag55 -..@flag23 - AUXADDRESS - DiffOrNot w2,w6,PIXEL00_81,PIXEL01_31,PIXEL02_0,PIXEL03_0,PIXEL12_0,PIXEL13_0,PIXEL00_12,PIXEL01_14,PIXEL02_83,PIXEL03_50,PIXEL12_70,PIXEL13_21 - PIXEL10_81 - PIXEL11_31 - PIXEL20_60 - PIXEL21_70 - PIXEL22_30 - PIXEL23_10 - PIXEL30_20 - PIXEL31_60 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag182 -..@flag150 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL12_0,PIXEL13_0,PIXEL23_32,PIXEL33_82,PIXEL02_21,PIXEL03_50,PIXEL12_70,PIXEL13_83,PIXEL23_13,PIXEL33_11 - PIXEL10_61 - PIXEL11_30 - PIXEL20_60 - PIXEL21_70 - PIXEL22_32 - PIXEL30_20 - PIXEL31_60 - PIXEL32_82 - jmp .loopx_end -..@flag213 -..@flag212 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_81 - DiffOrNot w6,w8,PIXEL03_81,PIXEL13_31,PIXEL22_0,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL03_12,PIXEL13_14,PIXEL22_70,PIXEL23_83,PIXEL32_21,PIXEL33_50 - PIXEL10_60 - PIXEL11_70 - PIXEL12_31 - PIXEL20_61 - PIXEL21_30 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag241 -..@flag240 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_61 - PIXEL03_80 - PIXEL10_60 - PIXEL11_70 - PIXEL12_30 - PIXEL13_10 - PIXEL20_82 - PIXEL21_32 - DiffOrNot w6,w8,PIXEL22_0,PIXEL23_0,PIXEL30_82,PIXEL31_32,PIXEL32_0,PIXEL33_0,PIXEL22_70,PIXEL23_21,PIXEL30_11,PIXEL31_13,PIXEL32_83,PIXEL33_50 - jmp .loopx_end -..@flag236 -..@flag232 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_60 - PIXEL03_20 - PIXEL10_10 - PIXEL11_30 - PIXEL12_70 - PIXEL13_60 - DiffOrNot w8,w4,PIXEL20_0,PIXEL21_0,PIXEL30_0,PIXEL31_0,PIXEL32_31,PIXEL33_81,PIXEL20_21,PIXEL21_70,PIXEL30_50,PIXEL31_83,PIXEL32_14,PIXEL33_12 - PIXEL22_31 - PIXEL23_81 - jmp .loopx_end -..@flag109 -..@flag105 - AUXADDRESS - DiffOrNot w8,w4,PIXEL00_82,PIXEL10_32,PIXEL20_0,PIXEL21_0,PIXEL30_0,PIXEL31_0,PIXEL00_11,PIXEL10_13,PIXEL20_83,PIXEL21_70,PIXEL30_50,PIXEL31_21 - PIXEL01_82 - PIXEL02_60 - PIXEL03_20 - PIXEL11_32 - PIXEL12_70 - PIXEL13_60 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag171 -..@flag43 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL11_0,PIXEL20_31,PIXEL30_81,PIXEL00_50,PIXEL01_21,PIXEL10_83,PIXEL11_70,PIXEL20_14,PIXEL30_12 - PIXEL02_10 - PIXEL03_80 - PIXEL12_30 - PIXEL13_61 - PIXEL21_31 - PIXEL22_70 - PIXEL23_60 - PIXEL31_81 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag143 -..@flag15 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL02_32,PIXEL03_82,PIXEL10_0,PIXEL11_0,PIXEL00_50,PIXEL01_83,PIXEL02_13,PIXEL03_11,PIXEL10_21,PIXEL11_70 - PIXEL12_32 - PIXEL13_82 - PIXEL20_10 - PIXEL21_30 - PIXEL22_70 - PIXEL23_60 - PIXEL30_80 - PIXEL31_61 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag124 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_81 - PIXEL03_81 - PIXEL10_10 - PIXEL11_30 - PIXEL12_31 - PIXEL13_31 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag203 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_61 - PIXEL20_10 - PIXEL21_30 - PIXEL22_31 - PIXEL23_81 - PIXEL30_80 - PIXEL31_10 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag62 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_10 - PIXEL11_30 - PIXEL12_0 - PIXEL20_31 - PIXEL21_31 - PIXEL22_30 - PIXEL23_10 - PIXEL30_81 - PIXEL31_81 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag211 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_10 - PIXEL03_80 - PIXEL10_81 - PIXEL11_31 - PIXEL12_30 - PIXEL13_10 - PIXEL20_61 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag118 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_61 - PIXEL11_30 - PIXEL12_0 - PIXEL20_82 - PIXEL21_32 - PIXEL22_30 - PIXEL23_10 - PIXEL30_82 - PIXEL31_32 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag217 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_61 - PIXEL03_80 - PIXEL10_32 - PIXEL11_32 - PIXEL12_30 - PIXEL13_10 - PIXEL20_10 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag110 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_32 - PIXEL03_82 - PIXEL10_10 - PIXEL11_30 - PIXEL12_32 - PIXEL13_82 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag155 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_10 - PIXEL20_10 - PIXEL21_30 - PIXEL22_32 - PIXEL23_32 - PIXEL30_80 - PIXEL31_61 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag188 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_81 - PIXEL03_81 - PIXEL10_10 - PIXEL11_30 - PIXEL12_31 - PIXEL13_31 - PIXEL20_31 - PIXEL21_31 - PIXEL22_32 - PIXEL23_32 - PIXEL30_81 - PIXEL31_81 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag185 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_61 - PIXEL03_80 - PIXEL10_32 - PIXEL11_32 - PIXEL12_30 - PIXEL13_10 - PIXEL20_31 - PIXEL21_31 - PIXEL22_32 - PIXEL23_32 - PIXEL30_81 - PIXEL31_81 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag61 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_81 - PIXEL03_81 - PIXEL10_32 - PIXEL11_32 - PIXEL12_31 - PIXEL13_31 - PIXEL20_31 - PIXEL21_31 - PIXEL22_30 - PIXEL23_10 - PIXEL30_81 - PIXEL31_81 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag157 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_81 - PIXEL03_81 - PIXEL10_32 - PIXEL11_32 - PIXEL12_31 - PIXEL13_31 - PIXEL20_10 - PIXEL21_30 - PIXEL22_32 - PIXEL23_32 - PIXEL30_80 - PIXEL31_61 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag103 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_32 - PIXEL03_82 - PIXEL10_81 - PIXEL11_31 - PIXEL12_32 - PIXEL13_82 - PIXEL20_82 - PIXEL21_32 - PIXEL22_30 - PIXEL23_61 - PIXEL30_82 - PIXEL31_32 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag227 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_10 - PIXEL03_80 - PIXEL10_81 - PIXEL11_31 - PIXEL12_30 - PIXEL13_61 - PIXEL20_82 - PIXEL21_32 - PIXEL22_31 - PIXEL23_81 - PIXEL30_82 - PIXEL31_32 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag230 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_32 - PIXEL03_82 - PIXEL10_61 - PIXEL11_30 - PIXEL12_32 - PIXEL13_82 - PIXEL20_82 - PIXEL21_32 - PIXEL22_31 - PIXEL23_81 - PIXEL30_82 - PIXEL31_32 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag199 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_32 - PIXEL03_82 - PIXEL10_81 - PIXEL11_31 - PIXEL12_32 - PIXEL13_82 - PIXEL20_61 - PIXEL21_30 - PIXEL22_31 - PIXEL23_81 - PIXEL30_80 - PIXEL31_10 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag220 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_81 - PIXEL03_81 - PIXEL10_10 - PIXEL11_30 - PIXEL12_31 - PIXEL13_31 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - jmp .loopx_end -..@flag158 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL12_0 - PIXEL20_10 - PIXEL21_30 - PIXEL22_32 - PIXEL23_32 - PIXEL30_80 - PIXEL31_61 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag234 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - PIXEL02_10 - PIXEL03_80 - PIXEL12_30 - PIXEL13_61 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_31 - PIXEL23_81 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag242 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL10_61 - PIXEL11_30 - PIXEL20_82 - PIXEL21_32 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_82 - PIXEL31_32 - jmp .loopx_end -..@flag59 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL11_0 - PIXEL20_31 - PIXEL21_31 - PIXEL22_30 - PIXEL23_10 - PIXEL30_81 - PIXEL31_81 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag121 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_61 - PIXEL03_80 - PIXEL10_32 - PIXEL11_32 - PIXEL12_30 - PIXEL13_10 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - jmp .loopx_end -..@flag87 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_81 - PIXEL11_31 - PIXEL12_0 - PIXEL20_61 - PIXEL21_30 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag79 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_32 - PIXEL03_82 - PIXEL11_0 - PIXEL12_32 - PIXEL13_82 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag122 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - jmp .loopx_end -..@flag94 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL12_0 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - jmp .loopx_end -..@flag218 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - jmp .loopx_end -..@flag91 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL11_0 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - jmp .loopx_end -..@flag229 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_60 - PIXEL03_20 - PIXEL10_60 - PIXEL11_70 - PIXEL12_70 - PIXEL13_60 - PIXEL20_82 - PIXEL21_32 - PIXEL22_31 - PIXEL23_81 - PIXEL30_82 - PIXEL31_32 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag167 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_32 - PIXEL03_82 - PIXEL10_81 - PIXEL11_31 - PIXEL12_32 - PIXEL13_82 - PIXEL20_60 - PIXEL21_70 - PIXEL22_70 - PIXEL23_60 - PIXEL30_20 - PIXEL31_60 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag173 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_60 - PIXEL03_20 - PIXEL10_32 - PIXEL11_32 - PIXEL12_70 - PIXEL13_60 - PIXEL20_31 - PIXEL21_31 - PIXEL22_70 - PIXEL23_60 - PIXEL30_81 - PIXEL31_81 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag181 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_81 - PIXEL03_81 - PIXEL10_60 - PIXEL11_70 - PIXEL12_31 - PIXEL13_31 - PIXEL20_60 - PIXEL21_70 - PIXEL22_32 - PIXEL23_32 - PIXEL30_20 - PIXEL31_60 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag186 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL20_31 - PIXEL21_31 - PIXEL22_32 - PIXEL23_32 - PIXEL30_81 - PIXEL31_81 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag115 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL10_81 - PIXEL11_31 - PIXEL20_82 - PIXEL21_32 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - PIXEL30_82 - PIXEL31_32 - jmp .loopx_end -..@flag93 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_81 - PIXEL03_81 - PIXEL10_32 - PIXEL11_32 - PIXEL12_31 - PIXEL13_31 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - jmp .loopx_end -..@flag206 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - PIXEL02_32 - PIXEL03_82 - PIXEL12_32 - PIXEL13_82 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - PIXEL22_31 - PIXEL23_81 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag205 -..@flag201 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_60 - PIXEL03_20 - PIXEL10_32 - PIXEL11_32 - PIXEL12_70 - PIXEL13_60 - DiffOrNot w8,w4,PIXEL20_10,PIXEL21_30,PIXEL30_80,PIXEL31_10,PIXEL20_12,PIXEL21_0,PIXEL30_20,PIXEL31_11 - PIXEL22_31 - PIXEL23_81 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag174 -..@flag46 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_80,PIXEL01_10,PIXEL10_10,PIXEL11_30,PIXEL00_20,PIXEL01_12,PIXEL10_11,PIXEL11_0 - PIXEL02_32 - PIXEL03_82 - PIXEL12_32 - PIXEL13_82 - PIXEL20_31 - PIXEL21_31 - PIXEL22_70 - PIXEL23_60 - PIXEL30_81 - PIXEL31_81 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag179 -..@flag147 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - DiffOrNot w2,w6,PIXEL02_10,PIXEL03_80,PIXEL12_30,PIXEL13_10,PIXEL02_11,PIXEL03_20,PIXEL12_0,PIXEL13_12 - PIXEL10_81 - PIXEL11_31 - PIXEL20_60 - PIXEL21_70 - PIXEL22_32 - PIXEL23_32 - PIXEL30_20 - PIXEL31_60 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag117 -..@flag116 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_81 - PIXEL03_81 - PIXEL10_60 - PIXEL11_70 - PIXEL12_31 - PIXEL13_31 - PIXEL20_82 - PIXEL21_32 - DiffOrNot w6,w8,PIXEL22_30,PIXEL23_10,PIXEL32_10,PIXEL33_80,PIXEL22_0,PIXEL23_11,PIXEL32_12,PIXEL33_20 - PIXEL30_82 - PIXEL31_32 - jmp .loopx_end -..@flag189 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_81 - PIXEL03_81 - PIXEL10_32 - PIXEL11_32 - PIXEL12_31 - PIXEL13_31 - PIXEL20_31 - PIXEL21_31 - PIXEL22_32 - PIXEL23_32 - PIXEL30_81 - PIXEL31_81 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag231 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_32 - PIXEL03_82 - PIXEL10_81 - PIXEL11_31 - PIXEL12_32 - PIXEL13_82 - PIXEL20_82 - PIXEL21_32 - PIXEL22_31 - PIXEL23_81 - PIXEL30_82 - PIXEL31_32 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag126 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_10 - PIXEL11_30 - PIXEL12_0 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag219 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_10 - PIXEL20_10 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag125 - AUXADDRESS - DiffOrNot w8,w4,PIXEL00_82,PIXEL10_32,PIXEL20_0,PIXEL21_0,PIXEL30_0,PIXEL31_0,PIXEL00_11,PIXEL10_13,PIXEL20_83,PIXEL21_70,PIXEL30_50,PIXEL31_21 - PIXEL01_82 - PIXEL02_81 - PIXEL03_81 - PIXEL11_32 - PIXEL12_31 - PIXEL13_31 - PIXEL22_30 - PIXEL23_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag221 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_81 - DiffOrNot w6,w8,PIXEL03_81,PIXEL13_31,PIXEL22_0,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL03_12,PIXEL13_14,PIXEL22_70,PIXEL23_83,PIXEL32_21,PIXEL33_50 - PIXEL10_32 - PIXEL11_32 - PIXEL12_31 - PIXEL20_10 - PIXEL21_30 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag207 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL02_32,PIXEL03_82,PIXEL10_0,PIXEL11_0,PIXEL00_50,PIXEL01_83,PIXEL02_13,PIXEL03_11,PIXEL10_21,PIXEL11_70 - PIXEL12_32 - PIXEL13_82 - PIXEL20_10 - PIXEL21_30 - PIXEL22_31 - PIXEL23_81 - PIXEL30_80 - PIXEL31_10 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag238 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_32 - PIXEL03_82 - PIXEL10_10 - PIXEL11_30 - PIXEL12_32 - PIXEL13_82 - DiffOrNot w8,w4,PIXEL20_0,PIXEL21_0,PIXEL30_0,PIXEL31_0,PIXEL32_31,PIXEL33_81,PIXEL20_21,PIXEL21_70,PIXEL30_50,PIXEL31_83,PIXEL32_14,PIXEL33_12 - PIXEL22_31 - PIXEL23_81 - jmp .loopx_end -..@flag190 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL12_0,PIXEL13_0,PIXEL23_32,PIXEL33_82,PIXEL02_21,PIXEL03_50,PIXEL12_70,PIXEL13_83,PIXEL23_13,PIXEL33_11 - PIXEL10_10 - PIXEL11_30 - PIXEL20_31 - PIXEL21_31 - PIXEL22_32 - PIXEL30_81 - PIXEL31_81 - PIXEL32_82 - jmp .loopx_end -..@flag187 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL11_0,PIXEL20_31,PIXEL30_81,PIXEL00_50,PIXEL01_21,PIXEL10_83,PIXEL11_70,PIXEL20_14,PIXEL30_12 - PIXEL02_10 - PIXEL03_80 - PIXEL12_30 - PIXEL13_10 - PIXEL21_31 - PIXEL22_32 - PIXEL23_32 - PIXEL31_81 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag243 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_10 - PIXEL03_80 - PIXEL10_81 - PIXEL11_31 - PIXEL12_30 - PIXEL13_10 - PIXEL20_82 - PIXEL21_32 - DiffOrNot w6,w8,PIXEL22_0,PIXEL23_0,PIXEL30_82,PIXEL31_32,PIXEL32_0,PIXEL33_0,PIXEL22_70,PIXEL23_21,PIXEL30_11,PIXEL31_13,PIXEL32_83,PIXEL33_50 - jmp .loopx_end -..@flag119 - AUXADDRESS - DiffOrNot w2,w6,PIXEL00_81,PIXEL01_31,PIXEL02_0,PIXEL03_0,PIXEL12_0,PIXEL13_0,PIXEL00_12,PIXEL01_14,PIXEL02_83,PIXEL03_50,PIXEL12_70,PIXEL13_21 - PIXEL10_81 - PIXEL11_31 - PIXEL20_82 - PIXEL21_32 - PIXEL22_30 - PIXEL23_10 - PIXEL30_82 - PIXEL31_32 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag237 -..@flag233 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_60 - PIXEL03_20 - PIXEL10_32 - PIXEL11_32 - PIXEL12_70 - PIXEL13_60 - PIXEL20_0 - PIXEL21_0 - PIXEL22_31 - PIXEL23_81 - DiffOrNot w8,w4,PIXEL30_0,PIXEL30_20 - PIXEL31_0 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag175 -..@flag47 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_0 - PIXEL02_32 - PIXEL03_82 - PIXEL10_0 - PIXEL11_0 - PIXEL12_32 - PIXEL13_82 - PIXEL20_31 - PIXEL21_31 - PIXEL22_70 - PIXEL23_60 - PIXEL30_81 - PIXEL31_81 - PIXEL32_60 - PIXEL33_20 - jmp .loopx_end -..@flag183 -..@flag151 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_0 - DiffOrNot w2,w6,PIXEL03_0,PIXEL03_20 - PIXEL10_81 - PIXEL11_31 - PIXEL12_0 - PIXEL13_0 - PIXEL20_60 - PIXEL21_70 - PIXEL22_32 - PIXEL23_32 - PIXEL30_20 - PIXEL31_60 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag245 -..@flag244 - AUXADDRESS - PIXEL00_20 - PIXEL01_60 - PIXEL02_81 - PIXEL03_81 - PIXEL10_60 - PIXEL11_70 - PIXEL12_31 - PIXEL13_31 - PIXEL20_82 - PIXEL21_32 - PIXEL22_0 - PIXEL23_0 - PIXEL30_82 - PIXEL31_32 - PIXEL32_0 - DiffOrNot w6,w8,PIXEL33_0,PIXEL33_20 - jmp .loopx_end -..@flag250 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - PIXEL02_10 - PIXEL03_80 - PIXEL10_10 - PIXEL11_30 - PIXEL12_30 - PIXEL13_10 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - jmp .loopx_end -..@flag123 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_10 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag95 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL11_0 - PIXEL12_0 - PIXEL20_10 - PIXEL21_30 - PIXEL22_30 - PIXEL23_10 - PIXEL30_80 - PIXEL31_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag222 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_10 - PIXEL11_30 - PIXEL12_0 - PIXEL20_10 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag252 - AUXADDRESS - PIXEL00_80 - PIXEL01_61 - PIXEL02_81 - PIXEL03_81 - PIXEL10_10 - PIXEL11_30 - PIXEL12_31 - PIXEL13_31 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_0 - PIXEL23_0 - PIXEL32_0 - DiffOrNot w6,w8,PIXEL33_0,PIXEL33_20 - jmp .loopx_end -..@flag249 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_61 - PIXEL03_80 - PIXEL10_32 - PIXEL11_32 - PIXEL12_30 - PIXEL13_10 - PIXEL20_0 - PIXEL21_0 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - DiffOrNot w8,w4,PIXEL30_0,PIXEL30_20 - PIXEL31_0 - jmp .loopx_end -..@flag235 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_61 - PIXEL20_0 - PIXEL21_0 - PIXEL22_31 - PIXEL23_81 - DiffOrNot w8,w4,PIXEL30_0,PIXEL30_20 - PIXEL31_0 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag111 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_0 - PIXEL02_32 - PIXEL03_82 - PIXEL10_0 - PIXEL11_0 - PIXEL12_32 - PIXEL13_82 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_61 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag63 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_0 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_0 - PIXEL11_0 - PIXEL12_0 - PIXEL20_31 - PIXEL21_31 - PIXEL22_30 - PIXEL23_10 - PIXEL30_81 - PIXEL31_81 - PIXEL32_61 - PIXEL33_80 - jmp .loopx_end -..@flag159 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_0 - DiffOrNot w2,w6,PIXEL03_0,PIXEL03_20 - PIXEL11_0 - PIXEL12_0 - PIXEL13_0 - PIXEL20_10 - PIXEL21_30 - PIXEL22_32 - PIXEL23_32 - PIXEL30_80 - PIXEL31_61 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag215 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_0 - DiffOrNot w2,w6,PIXEL03_0,PIXEL03_20 - PIXEL10_81 - PIXEL11_31 - PIXEL12_0 - PIXEL13_0 - PIXEL20_61 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag246 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_61 - PIXEL11_30 - PIXEL12_0 - PIXEL20_82 - PIXEL21_32 - PIXEL22_0 - PIXEL23_0 - PIXEL30_82 - PIXEL31_32 - PIXEL32_0 - DiffOrNot w6,w8,PIXEL33_0,PIXEL33_20 - jmp .loopx_end -..@flag254 - AUXADDRESS - PIXEL00_80 - PIXEL01_10 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_10 - PIXEL11_30 - PIXEL12_0 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_0 - PIXEL23_0 - PIXEL32_0 - DiffOrNot w6,w8,PIXEL33_0,PIXEL33_20 - jmp .loopx_end -..@flag253 - AUXADDRESS - PIXEL00_82 - PIXEL01_82 - PIXEL02_81 - PIXEL03_81 - PIXEL10_32 - PIXEL11_32 - PIXEL12_31 - PIXEL13_31 - PIXEL20_0 - PIXEL21_0 - PIXEL22_0 - PIXEL23_0 - DiffOrNot w8,w4,PIXEL30_0,PIXEL30_20 - PIXEL31_0 - PIXEL32_0 - DiffOrNot w6,w8,PIXEL33_0,PIXEL33_20 - jmp .loopx_end -..@flag251 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_10 - PIXEL03_80 - PIXEL11_0 - PIXEL12_30 - PIXEL13_10 - PIXEL20_0 - PIXEL21_0 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - DiffOrNot w8,w4,PIXEL30_0,PIXEL30_20 - PIXEL31_0 - jmp .loopx_end -..@flag239 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_0 - PIXEL02_32 - PIXEL03_82 - PIXEL10_0 - PIXEL11_0 - PIXEL12_32 - PIXEL13_82 - PIXEL20_0 - PIXEL21_0 - PIXEL22_31 - PIXEL23_81 - DiffOrNot w8,w4,PIXEL30_0,PIXEL30_20 - PIXEL31_0 - PIXEL32_31 - PIXEL33_81 - jmp .loopx_end -..@flag127 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_0 - DiffOrNot w2,w6,PIXEL02_0,PIXEL03_0,PIXEL13_0,PIXEL02_50,PIXEL03_50,PIXEL13_50 - PIXEL10_0 - PIXEL11_0 - PIXEL12_0 - DiffOrNot w8,w4,PIXEL20_0,PIXEL30_0,PIXEL31_0,PIXEL20_50,PIXEL30_50,PIXEL31_50 - PIXEL21_0 - PIXEL22_30 - PIXEL23_10 - PIXEL32_10 - PIXEL33_80 - jmp .loopx_end -..@flag191 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_0 - PIXEL02_0 - DiffOrNot w2,w6,PIXEL03_0,PIXEL03_20 - PIXEL10_0 - PIXEL11_0 - PIXEL12_0 - PIXEL13_0 - PIXEL20_31 - PIXEL21_31 - PIXEL22_32 - PIXEL23_32 - PIXEL30_81 - PIXEL31_81 - PIXEL32_82 - PIXEL33_82 - jmp .loopx_end -..@flag223 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL01_0,PIXEL10_0,PIXEL00_50,PIXEL01_50,PIXEL10_50 - PIXEL02_0 - DiffOrNot w2,w6,PIXEL03_0,PIXEL03_20 - PIXEL11_0 - PIXEL12_0 - PIXEL13_0 - PIXEL20_10 - PIXEL21_30 - PIXEL22_0 - DiffOrNot w6,w8,PIXEL23_0,PIXEL32_0,PIXEL33_0,PIXEL23_50,PIXEL32_50,PIXEL33_50 - PIXEL30_80 - PIXEL31_10 - jmp .loopx_end -..@flag247 - AUXADDRESS - PIXEL00_81 - PIXEL01_31 - PIXEL02_0 - DiffOrNot w2,w6,PIXEL03_0,PIXEL03_20 - PIXEL10_81 - PIXEL11_31 - PIXEL12_0 - PIXEL13_0 - PIXEL20_82 - PIXEL21_32 - PIXEL22_0 - PIXEL23_0 - PIXEL30_82 - PIXEL31_32 - PIXEL32_0 - DiffOrNot w6,w8,PIXEL33_0,PIXEL33_20 - jmp .loopx_end -..@flag255 - AUXADDRESS - DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20 - PIXEL01_0 - PIXEL02_0 - DiffOrNot w2,w6,PIXEL03_0,PIXEL03_20 - PIXEL10_0 - PIXEL11_0 - PIXEL12_0 - PIXEL13_0 - PIXEL20_0 - PIXEL21_0 - PIXEL22_0 - PIXEL23_0 - DiffOrNot w8,w4,PIXEL30_0,PIXEL30_20 - PIXEL31_0 - PIXEL32_0 - DiffOrNot w6,w8,PIXEL33_0,PIXEL33_20 - jmp .loopx_end - - -..@cross0 - mov ebx,[ebp+pitch] - AUXADDRESS - mov [edi],eax - mov [edi+4],eax - mov [edi+8],eax - mov [edi+12],eax - mov [edi+ebx],eax - mov [edi+ebx+4],eax - mov [edi+ebx+8],eax - mov [edi+ebx+12],eax - mov [ecx],eax - mov [ecx+4],eax - mov [ecx+8],eax - mov [ecx+12],eax - mov [ecx+ebx],eax - mov [ecx+ebx+4],eax - mov [ecx+ebx+8],eax - mov [ecx+ebx+12],eax - jmp .loopx_end -..@cross1 - mov ecx,[w2] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov [edi],edx - mov [edi+4],edx - mov [edi+8],edx - mov [edi+12],edx - mov ebx,[ebp+pitch] - AUXADDRESS - mov [edi],edx - mov [edi+4],edx - mov [edi+ebx],eax - mov [edi+ebx+4],eax - jmp .loopx_end -..@cross2 - mov ecx,[w4] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],edx - mov [edi+4],eax - mov [edi+ebx],edx - mov [edi+ebx+4],eax - jmp .loopx_end -..@cross4 - mov ecx,[w6] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],eax - mov [edi+4],edx - mov [edi+ebx],eax - mov [edi+ebx+4],edx - jmp .loopx_end -..@cross8 - mov ecx,[w8] - mov edx,eax - shl edx,2 - add edx,[ebx+ecx*4] - sub edx,eax - shr edx,2 - mov ebx,[ebp+pitch] - mov [edi],eax - mov [edi+4],eax - mov [edi+ebx],edx - mov [edi+ebx+4],edx - jmp .loopx_end -..@crossN - mov edx,[w2] - mov ecx,[ebx+edx*4] - mov [c2],ecx - mov edx,[w4] - mov ecx,[ebx+edx*4] - mov [c4],ecx - mov edx,[w6] - mov ecx,[ebx+edx*4] - mov [c6],ecx - mov edx,[w8] - mov ecx,[ebx+edx*4] - mov [c8],ecx - mov ebx,[ebp+pitch] - jmp ..@flag0 - -.loopx_end - add esi,2 - add edi,16 - dec dword[xcounter] - jle .xres_2 - jmp .loopx -.xres_2 - ; x=Xres-2 - special case - jl .xres_1 - mov ebx,[prevline] - movq mm5,[esi+ebx-4] - movq mm6,[esi-4] - mov ebx,[nextline] - movq mm7,[esi+ebx-4] - psrlq mm5,16 - psrlq mm6,16 - psrlq mm7,16 - movd eax,mm5 - movzx edx,ax - mov [w1],edx - shr eax,16 - mov [w2],eax - psrlq mm5,32 - movd eax,mm5 - mov [w3],eax - movd eax,mm6 - movzx edx,ax - mov [w4],edx - shr eax,16 - mov [w5],eax - psrlq mm6,32 - movd eax,mm6 - mov [w6],eax - movd eax,mm7 - movzx edx,ax - mov [w7],edx - shr eax,16 - mov [w8],eax - psrlq mm7,32 - movd eax,mm7 - mov [w9],eax - jmp .flags -.xres_1 - cmp dword[xcounter],-1 - jl .nexty - ; x=Xres-1 - special case - mov ebx,[prevline] - movq mm5,[esi+ebx-6] - movq mm6,[esi-6] - mov ebx,[nextline] - movq mm7,[esi+ebx-6] - psrlq mm5,32 - psrlq mm6,32 - psrlq mm7,32 - movd eax,mm5 - movzx edx,ax - mov [w1],edx - shr eax,16 - mov [w2],eax - mov [w3],eax - movd eax,mm6 - movzx edx,ax - mov [w4],edx - shr eax,16 - mov [w5],eax - mov [w6],eax - movd eax,mm7 - movzx edx,ax - mov [w7],edx - shr eax,16 - mov [w8],eax - mov [w9],eax - jmp .flags -.nexty - pop edi - add edi,ebx - add edi,ebx - add edi,ebx - add edi,ebx - dec dword[linesleft] - jz .fin - mov ebx,[ebp+Xres] - shl ebx,1 - cmp dword[linesleft],1 - je .lastline - mov dword[nextline],ebx - neg ebx - mov dword[prevline],ebx - jmp .loopy -.lastline - mov dword[nextline],0 - neg ebx - mov dword[prevline],ebx - jmp .loopy -.fin - emms - popad - mov esp,ebp - pop ebp - ret - -SECTION .data -FuncTable - dd ..@flag0, ..@flag1, ..@flag2, ..@flag3, ..@flag4, ..@flag5, ..@flag6, ..@flag7 - dd ..@flag8, ..@flag9, ..@flag10, ..@flag11, ..@flag12, ..@flag13, ..@flag14, ..@flag15 - dd ..@flag16, ..@flag17, ..@flag18, ..@flag19, ..@flag20, ..@flag21, ..@flag22, ..@flag23 - dd ..@flag24, ..@flag25, ..@flag26, ..@flag27, ..@flag28, ..@flag29, ..@flag30, ..@flag31 - dd ..@flag32, ..@flag33, ..@flag34, ..@flag35, ..@flag36, ..@flag37, ..@flag38, ..@flag39 - dd ..@flag40, ..@flag41, ..@flag42, ..@flag43, ..@flag44, ..@flag45, ..@flag46, ..@flag47 - dd ..@flag48, ..@flag49, ..@flag50, ..@flag51, ..@flag52, ..@flag53, ..@flag54, ..@flag55 - dd ..@flag56, ..@flag57, ..@flag58, ..@flag59, ..@flag60, ..@flag61, ..@flag62, ..@flag63 - dd ..@flag64, ..@flag65, ..@flag66, ..@flag67, ..@flag68, ..@flag69, ..@flag70, ..@flag71 - dd ..@flag72, ..@flag73, ..@flag74, ..@flag75, ..@flag76, ..@flag77, ..@flag78, ..@flag79 - dd ..@flag80, ..@flag81, ..@flag82, ..@flag83, ..@flag84, ..@flag85, ..@flag86, ..@flag87 - dd ..@flag88, ..@flag89, ..@flag90, ..@flag91, ..@flag92, ..@flag93, ..@flag94, ..@flag95 - dd ..@flag96, ..@flag97, ..@flag98, ..@flag99, ..@flag100, ..@flag101, ..@flag102, ..@flag103 - dd ..@flag104, ..@flag105, ..@flag106, ..@flag107, ..@flag108, ..@flag109, ..@flag110, ..@flag111 - dd ..@flag112, ..@flag113, ..@flag114, ..@flag115, ..@flag116, ..@flag117, ..@flag118, ..@flag119 - dd ..@flag120, ..@flag121, ..@flag122, ..@flag123, ..@flag124, ..@flag125, ..@flag126, ..@flag127 - dd ..@flag128, ..@flag129, ..@flag130, ..@flag131, ..@flag132, ..@flag133, ..@flag134, ..@flag135 - dd ..@flag136, ..@flag137, ..@flag138, ..@flag139, ..@flag140, ..@flag141, ..@flag142, ..@flag143 - dd ..@flag144, ..@flag145, ..@flag146, ..@flag147, ..@flag148, ..@flag149, ..@flag150, ..@flag151 - dd ..@flag152, ..@flag153, ..@flag154, ..@flag155, ..@flag156, ..@flag157, ..@flag158, ..@flag159 - dd ..@flag160, ..@flag161, ..@flag162, ..@flag163, ..@flag164, ..@flag165, ..@flag166, ..@flag167 - dd ..@flag168, ..@flag169, ..@flag170, ..@flag171, ..@flag172, ..@flag173, ..@flag174, ..@flag175 - dd ..@flag176, ..@flag177, ..@flag178, ..@flag179, ..@flag180, ..@flag181, ..@flag182, ..@flag183 - dd ..@flag184, ..@flag185, ..@flag186, ..@flag187, ..@flag188, ..@flag189, ..@flag190, ..@flag191 - dd ..@flag192, ..@flag193, ..@flag194, ..@flag195, ..@flag196, ..@flag197, ..@flag198, ..@flag199 - dd ..@flag200, ..@flag201, ..@flag202, ..@flag203, ..@flag204, ..@flag205, ..@flag206, ..@flag207 - dd ..@flag208, ..@flag209, ..@flag210, ..@flag211, ..@flag212, ..@flag213, ..@flag214, ..@flag215 - dd ..@flag216, ..@flag217, ..@flag218, ..@flag219, ..@flag220, ..@flag221, ..@flag222, ..@flag223 - dd ..@flag224, ..@flag225, ..@flag226, ..@flag227, ..@flag228, ..@flag229, ..@flag230, ..@flag231 - dd ..@flag232, ..@flag233, ..@flag234, ..@flag235, ..@flag236, ..@flag237, ..@flag238, ..@flag239 - dd ..@flag240, ..@flag241, ..@flag242, ..@flag243, ..@flag244, ..@flag245, ..@flag246, ..@flag247 - dd ..@flag248, ..@flag249, ..@flag250, ..@flag251, ..@flag252, ..@flag253, ..@flag254, ..@flag255 - - diff --git a/jan/src/intf/video/scalers/hq_shared32.cpp b/jan/src/intf/video/scalers/hq_shared32.cpp deleted file mode 100644 index 93df36772..000000000 --- a/jan/src/intf/video/scalers/hq_shared32.cpp +++ /dev/null @@ -1,413 +0,0 @@ -// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. -// Copyright (C) 1999-2003 Forgotten -// Copyright (C) 2005 Forgotten and the VBA development team - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2, or(at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#include "hq_shared32.h" - -const unsigned __int64 reg_blank = 0x0000000000000000; -const unsigned __int64 const7 = 0x0000000700070007; -const unsigned __int64 treshold = 0x0000000000300706; - -void Interp1(unsigned char * pc, unsigned int c1, unsigned int c2) -{ - //*((int*)pc) = (c1*3+c2)/4; - -#ifdef MMX - __asm - { - mov eax, pc - movd mm1, c1 - movd mm2, c2 - movq mm0, mm1 - pslld mm0, 2 - psubd mm0, mm1 - paddd mm0, mm2 - psrld mm0, 2 - movd [eax], mm0 - EMMS - } -#else - __asm - { - mov eax, pc - mov edx, c1 - shl edx, 2 - add edx, c2 - sub edx, c1 - shr edx, 2 - mov [eax], edx - } -#endif -} - -void Interp2(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3) -{ - //*((int*)pc) = (c1*2+c2+c3)/4; - -#ifdef MMX - __asm - { - mov eax, pc - movd mm0, c1 - movd mm1, c2 - movd mm2, c3 - pslld mm0, 1 - paddd mm0, mm1 - paddd mm0, mm2 - psrad mm0, 2 - movd [eax], mm0 - EMMS - } -#else - __asm - { - mov eax, pc - mov edx, c1 - shl edx, 1 - add edx, c2 - add edx, c3 - shr edx, 2 - mov [eax], edx - } -#endif -} - -void Interp3(unsigned char * pc, unsigned int c1, unsigned int c2) -{ - //*((int*)pc) = (c1*7+c2)/8; - //*((int*)pc) = ((((c1 & 0x00FF00)*7 + (c2 & 0x00FF00) ) & 0x0007F800) + - // (((c1 & 0xFF00FF)*7 + (c2 & 0xFF00FF) ) & 0x07F807F8)) >> 3; - -#ifdef MMX - __asm - { - mov eax, pc - movd mm1, c1 - movd mm2, c2 - punpcklbw mm1, reg_blank - punpcklbw mm2, reg_blank - pmullw mm1, const7 - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, reg_blank - movd [eax], mm1 - EMMS - } -#else - __asm - { - mov eax, c1 - mov ebx, c2 - mov ecx, eax - shl ecx, 3 - sub ecx, eax - add ecx, ebx - shr ecx, 3 - mov eax, pc - mov [eax], ecx - } -#endif -} - -void Interp4(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3) -{ - //*((int*)pc) = (c1*2+(c2+c3)*7)/16; - //*((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*7 ) & 0x000FF000) + - // (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*7 ) & 0x0FF00FF0)) >> 4; - -#ifdef MMX - __asm - { - mov eax, pc - movd mm1, c1 - movd mm2, c2 - movd mm3, c3 - punpcklbw mm1, reg_blank - punpcklbw mm2, reg_blank - punpcklbw mm3, reg_blank - psllw mm1, 1 - paddw mm2, mm3 - pmullw mm2, const7 - paddw mm1, mm2 - psrlw mm1, 4 - packuswb mm1, reg_blank - movd [eax], mm1 - EMMS - } -#else - - __asm - { - mov eax, [c1] - and eax, 0FF00h - shl eax, 1 - mov ecx, [c2] - and ecx, 0FF00h - mov edx, [c3] - and edx, 0FF00h - add ecx, edx - imul ecx, ecx,7 - add eax, ecx - and eax, 0FF000h - - mov ebx, [c1] - and ebx, 0FF00FFh - shl ebx, 1 - mov ecx, [c2] - and ecx, 0FF00FFh - mov edx, [c3] - and edx, 0FF00FFh - add ecx, edx - imul ecx, ecx,7 - add ebx, ecx - and ebx, 0FF00FF0h - - add eax, ebx - shr eax, 4 - - mov ebx, pc - mov [ebx], eax - } -#endif -} - -void Interp5(unsigned char * pc, unsigned int c1, unsigned int c2) -{ - //*((int*)pc) = (c1+c2)/2; - -#ifdef MMX - __asm - { - mov eax, pc - movd mm0, c1 - movd mm1, c2 - paddd mm0, mm1 - psrad mm0, 1 - movd [eax], mm0 - EMMS - } -#else - __asm - { - mov eax, pc - mov edx, c1 - add edx, c2 - shr edx, 1 - mov [eax], edx - } -#endif -} - - -#include "interp.h" - -void Interp1_16(unsigned char * pc, unsigned short c1, unsigned short c2) -{ - *((unsigned short*)pc) = interp_16_31(c1, c2); - //*((int*)pc) = (c1*3+c2)/4; -} - -void Interp2_16(unsigned char * pc, unsigned short c1, unsigned short c2, unsigned short c3) -{ - *((unsigned short*)pc) = interp_16_211(c1, c2, c3); - //*((int*)pc) = (c1*2+c2+c3)/4; -} - -void Interp3_16(unsigned char * pc, unsigned short c1, unsigned short c2) -{ - *((unsigned short*)pc) = interp_16_71(c1, c2); -// *((unsigned short*)pc) = (c1*7+c2)/8; -// *((unsigned short*)pc) = ((((c1 & 0x00FF00)*7 + (c2 & 0x00FF00) ) & 0x0007F800) + -// (((c1 & 0xFF00FF)*7 + (c2 & 0xFF00FF) ) & 0x07F807F8)) >> 3; -} - -void Interp4_16(unsigned char * pc, unsigned short c1, unsigned short c2, unsigned short c3) -{ - *((unsigned short*)pc) = interp_16_772(c2, c3, c1); -// *((unsigned short*)pc) = (c1*2+(c2+c3)*7)/16; -// *((unsigned short*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*7 ) & 0x000FF000) + -// (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*7 ) & 0x0FF00FF0)) >> 4; -} - -void Interp5_16(unsigned char * pc, unsigned short c1, unsigned short c2) -{ - *((unsigned short*)pc) = interp_16_11(c1, c2); -} - - - - -bool Diff(unsigned int c1, unsigned int c2) -{ - unsigned int - YUV1 = RGBtoYUV(c1), - YUV2 = RGBtoYUV(c2); - - if (YUV1 == YUV2) return false; // Save some processing power - -#ifdef MMX - unsigned int retval; - __asm - { - mov eax, 0x7FFFFFFF - movd mm7, eax ;mm7 = ABS_MASK = 0x7FFFFFFF - - ; Copy source colors in first reg - movd mm0, YUV1 - movd mm1, YUV2 - - mov eax, 0x00FF0000 - movd mm6, eax ;mm6 = Ymask = 0x00FF0000 - - ; Calculate color Y difference - movq mm2, mm0 - movq mm3, mm1 - pand mm2, mm6 - pand mm3, mm6 - psubd mm2, mm3 - pand mm2, mm7 - - mov eax, 0x0000FF00 - movd mm6, eax ;mm6 = Umask = 0x0000FF00 - - ; Calculate color U difference - movq mm3, mm0 - movq mm4, mm1 - pand mm3, mm6 - pand mm4, mm6 - psubd mm3, mm4 - pand mm3, mm7 - - mov eax, 0x000000FF - movd mm6, eax ;mm6 = Vmask = 0x000000FF - - ; Calculate color V difference - movq mm4, mm0 - movq mm5, mm1 - pand mm4, mm6 - pand mm5, mm6 - psubd mm4, mm5 - pand mm4, mm7 - - mov eax, 0x00300000 - movd mm5, eax ;mm5 = trY = 0x00300000 - mov eax, 0x00000700 - movd mm6, eax ;mm6 = trU = 0x00000700 - mov eax, 0x00000006 - movd mm7, eax ;mm7 = trV = 0x00000006 - - ; Compare the results - pcmpgtd mm2, trY - pcmpgtd mm3, trU - pcmpgtd mm4, trV - por mm2, mm3 - por mm2, mm4 - - movd retval, mm2 - - EMMS - } - return (retval != 0); -#else - return - ( abs32((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || - ( abs32((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || - ( abs32((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ); -#endif -} - - -unsigned int RGBtoYUV(unsigned int c) -{ // Division through 3 slows down the emulation about 10% !!! -#ifdef MMX - unsigned int retval; - __asm - { - movd mm0, c - movq mm1, mm0 - movq mm2, mm0 ;mm0=mm1=mm2=c - - mov eax, 0x000000FF - movd mm5, eax ;mm5 = REDMASK = 0x000000FF - mov eax, 0x0000FF00 - movd mm6, eax ;mm6 = GREENMASK = 0x0000FF00 - mov eax, 0x00FF0000 - movd mm7, eax ;mm7 = BLUEMASK = 0x00FF0000 - - - pand mm0, mm5 - pand mm1, mm6 - pand mm2, mm7 ;mm0=R mm1=G mm2=B - - movq mm3, mm0 - paddd mm3, mm1 - paddd mm3, mm2 -; psrld mm3, 2 ;mm3=Y -; pslld mm3, 16 - pslld mm3, 14 ;mm3=Y<<16 - - mov eax, 512 - movd mm7, eax ;mm7 = 128 << 2 = 512 - - movq mm4, mm0 - psubd mm4, mm2 -; psrld mm4, 2 -; paddd mm4, mm7 ;mm4=U -; pslld mm4, 8 ;mm4=U<<8 - paddd mm4, mm7 - pslld mm4, 6 - - mov eax, 128 - movd mm7, eax ;mm7 = 128 - - movq mm5, mm1 - pslld mm5, 1 - psubd mm5, mm0 - psubd mm5, mm2 - psrld mm5, 3 - paddd mm5, mm7 ;mm5=V - - paddd mm5, mm4 - paddd mm5, mm3 - - movd retval, mm5 - - EMMS - } - return retval; -#else - unsigned char r, g, b, Y, u, v; - r = (c & 0x000000FF); - g = (c & 0x0000FF00) >> 8; - b = (c & 0x00FF0000) >> 16; - Y = (r + g + b) >> 2; - u = 128 + ((r - b) >> 2); - v = 128 + ((-r + 2*g -b)>>3); - return (Y<<16) + (u<<8) + v; - - // Extremely High Quality Code - //unsigned char r, g, b; - //r = c & 0xFF; - //g = (c >> 8) & 0xFF; - //b = (c >> 16) & 0xFF; - //unsigned char y, u, v; - //y = (0.256788 * r + 0.504129 * g + 0.097906 * b) + 16; - //u = (-0.148223 * r - 0.290993 * g + 0.439216 * b) + 128; - //v = (0.439216 * r - 0.367788 * g - 0.071427 * b) + 128; - //return (y << 16) + (u << 8) + v; -#endif -} diff --git a/jan/src/intf/video/scalers/hq_shared32.h b/jan/src/intf/video/scalers/hq_shared32.h deleted file mode 100644 index af071c426..000000000 --- a/jan/src/intf/video/scalers/hq_shared32.h +++ /dev/null @@ -1,41 +0,0 @@ -// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. -// Copyright (C) 1999-2003 Forgotten -// Copyright (C) 2005 Forgotten and the VBA development team - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2, or(at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -#define abs32(value) (value & 0x7FFFFFFF) -#define abs16(value) (value & 0x7FFF) - -const int Ymask = 0x00FF0000; -const int Umask = 0x0000FF00; -const int Vmask = 0x000000FF; -const int trY = 0x00300000; -const int trU = 0x00000700; -const int trV = 0x00000006; - -void Interp1(unsigned char * pc, unsigned int c1, unsigned int c2); -void Interp2(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3); -void Interp3(unsigned char * pc, unsigned int c1, unsigned int c2); -void Interp4(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3); -void Interp5(unsigned char * pc, unsigned int c1, unsigned int c2); -void Interp1_16(unsigned char * pc, unsigned short c1, unsigned short c2); -void Interp2_16(unsigned char * pc, unsigned short c1, unsigned short c2, unsigned short c3); -void Interp3_16(unsigned char * pc, unsigned short c1, unsigned short c2); -void Interp4_16(unsigned char * pc, unsigned short c1, unsigned short c2, unsigned short c3); -void Interp5_16(unsigned char * pc, unsigned short c1, unsigned short c2); -bool Diff(unsigned int c1, unsigned int c2); -unsigned int RGBtoYUV(unsigned int c); diff --git a/jan/src/intf/video/scalers/interp.h b/jan/src/intf/video/scalers/interp.h deleted file mode 100644 index 5e6049222..000000000 --- a/jan/src/intf/video/scalers/interp.h +++ /dev/null @@ -1,355 +0,0 @@ -/* - * This file is part of the Advance project. - * - * Copyright (C) 2003 Andrea Mazzoleni - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * In addition, as a special exception, Andrea Mazzoleni - * gives permission to link the code of this program with - * the MAME library (or with modified versions of MAME that use the - * same license as MAME), and distribute linked combinations including - * the two. You must obey the GNU General Public License in all - * respects for all of the code used other than MAME. If you modify - * this file, you may extend this exception to your version of the - * file, but you are not obligated to do so. If you do not wish to - * do so, delete this exception statement from your version. - */ - -#ifndef __INTERP_H -#define __INTERP_H - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; - -/***************************************************************************/ -/* Basic types */ - -/***************************************************************************/ -/* interpolation */ - -extern unsigned interp_mask[2]; -extern unsigned interp_bits_per_pixel; - -#define INTERP_16_MASK_1(v) (v & interp_mask[0]) -#define INTERP_16_MASK_2(v) (v & interp_mask[1]) - -static inline u16 interp_16_521(u16 p1, u16 p2, u16 p3) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*5 + INTERP_16_MASK_1(p2)*2 + INTERP_16_MASK_1(p3)*1) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*5 + INTERP_16_MASK_2(p2)*2 + INTERP_16_MASK_2(p3)*1) / 8); -} - -static inline u16 interp_16_332(u16 p1, u16 p2, u16 p3) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*3 + INTERP_16_MASK_1(p2)*3 + INTERP_16_MASK_1(p3)*2) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*3 + INTERP_16_MASK_2(p2)*3 + INTERP_16_MASK_2(p3)*2) / 8); -} - -static inline u16 interp_16_611(u16 p1, u16 p2, u16 p3) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*6 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*6 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 8); -} - -static inline u16 interp_16_71(u16 p1, u16 p2) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*7 + INTERP_16_MASK_1(p2)) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*7 + INTERP_16_MASK_2(p2)) / 8); -} - -static inline u16 interp_16_211(u16 p1, u16 p2, u16 p3) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*2 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 4) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*2 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 4); -} - -static inline u16 interp_16_772(u16 p1, u16 p2, u16 p3) -{ - return INTERP_16_MASK_1(((INTERP_16_MASK_1(p1) + INTERP_16_MASK_1(p2))*7 + INTERP_16_MASK_1(p3)*2) / 16) - | INTERP_16_MASK_2(((INTERP_16_MASK_2(p1) + INTERP_16_MASK_2(p2))*7 + INTERP_16_MASK_2(p3)*2) / 16); -} - -static inline u16 interp_16_11(u16 p1, u16 p2) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1) + INTERP_16_MASK_1(p2)) / 2) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1) + INTERP_16_MASK_2(p2)) / 2); -} - -static u16 interp_16_31(u16 p1, u16 p2) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*3 + INTERP_16_MASK_1(p2)) / 4) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*3 + INTERP_16_MASK_2(p2)) / 4); -} - -static inline u16 interp_16_1411(u16 p1, u16 p2, u16 p3) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*14 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 16) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*14 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 16); -} - -static inline u16 interp_16_431(u16 p1, u16 p2, u16 p3) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*4 + INTERP_16_MASK_1(p2)*3 + INTERP_16_MASK_1(p3)) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*4 + INTERP_16_MASK_2(p2)*3 + INTERP_16_MASK_2(p3)) / 8); -} - -static inline u16 interp_16_53(u16 p1, u16 p2) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*5 + INTERP_16_MASK_1(p2)*3) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*5 + INTERP_16_MASK_2(p2)*3) / 8); -} - -static inline u16 interp_16_151(u16 p1, u16 p2) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*15 + INTERP_16_MASK_1(p2)) / 16) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*15 + INTERP_16_MASK_2(p2)) / 16); -} - -static inline u16 interp_16_97(u16 p1, u16 p2) -{ - return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*9 + INTERP_16_MASK_1(p2)*7) / 16) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*9 + INTERP_16_MASK_2(p2)*7) / 16); -} - -#define INTERP_32_MASK_1(v) (v & 0xFF00FF) -#define INTERP_32_MASK_2(v) (v & 0x00FF00) - -static inline u32 interp_32_521(u32 p1, u32 p2, u32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*5 + INTERP_32_MASK_1(p2)*2 + INTERP_32_MASK_1(p3)*1) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*5 + INTERP_32_MASK_2(p2)*2 + INTERP_32_MASK_2(p3)*1) / 8); -} - -static inline u32 interp_32_332(u32 p1, u32 p2, u32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*3 + INTERP_32_MASK_1(p2)*3 + INTERP_32_MASK_1(p3)*2) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*3 + INTERP_32_MASK_2(p2)*3 + INTERP_32_MASK_2(p3)*2) / 8); -} - -static inline u32 interp_32_211(u32 p1, u32 p2, u32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*2 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 4) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*2 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 4); -} - -static inline u32 interp_32_611(u32 p1, u32 p2, u32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*6 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*6 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 8); -} - -static inline u32 interp_32_71(u32 p1, u32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*7 + INTERP_32_MASK_1(p2)) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*7 + INTERP_32_MASK_2(p2)) / 8); -} - -static inline u32 interp_32_772(u32 p1, u32 p2, u32 p3) -{ - return INTERP_32_MASK_1(((INTERP_32_MASK_1(p1) + INTERP_32_MASK_1(p2))*7 + INTERP_32_MASK_1(p3)*2) / 16) - | INTERP_32_MASK_2(((INTERP_32_MASK_2(p1) + INTERP_32_MASK_2(p2))*7 + INTERP_32_MASK_2(p3)*2) / 16); -} - -static inline u32 interp_32_11(u32 p1, u32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1) + INTERP_32_MASK_1(p2)) / 2) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1) + INTERP_32_MASK_2(p2)) / 2); -} - -static u32 interp_32_31(u32 p1, u32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*3 + INTERP_32_MASK_1(p2)) / 4) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*3 + INTERP_32_MASK_2(p2)) / 4); -} - -static inline u32 interp_32_1411(u32 p1, u32 p2, u32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*14 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 16) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*14 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 16); -} - -static inline u32 interp_32_431(u32 p1, u32 p2, u32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*4 + INTERP_32_MASK_1(p2)*3 + INTERP_32_MASK_1(p3)) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*4 + INTERP_32_MASK_2(p2)*3 + INTERP_32_MASK_2(p3)) / 8); -} - -static inline u32 interp_32_53(u32 p1, u32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*5 + INTERP_32_MASK_1(p2)*3) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*5 + INTERP_32_MASK_2(p2)*3) / 8); -} - -static inline u32 interp_32_151(u32 p1, u32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*15 + INTERP_32_MASK_1(p2)) / 16) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*15 + INTERP_32_MASK_2(p2)) / 16); -} - -static inline u32 interp_32_97(u32 p1, u32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*9 + INTERP_32_MASK_1(p2)*7) / 16) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*9 + INTERP_32_MASK_2(p2)*7) / 16); -} - -/***************************************************************************/ -/* diff */ -/* -#define INTERP_Y_LIMIT (0x30*4) -#define INTERP_U_LIMIT (0x07*4) -#define INTERP_V_LIMIT (0x06*8) - -static int interp_16_diff(u16 p1, u16 p2) -{ - int r, g, b; - int y, u, v; - - if (p1 == p2) - return 0; - - if (interp_bits_per_pixel == 16) { - b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; - g = (int)((p1 & 0x7E0) - (p2 & 0x7E0)) >> 3; - r = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8; - } else { - b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; - g = (int)((p1 & 0x3E0) - (p2 & 0x3E0)) >> 2; - r = (int)((p1 & 0x7C00) - (p2 & 0x7C00)) >> 7; - } - - y = r + g + b; - u = r - b; - v = -r + 2*g - b; - - if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT) - return 1; - - if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT) - return 1; - - if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT) - return 1; - -return 0; -} - -static int interp_32_diff(u32 p1, u32 p2) -{ - int r, g, b; - int y, u, v; - - if ((p1 & 0xF8F8F8) == (p2 & 0xF8F8F8)) - return 0; - - b = (int)((p1 & 0xFF) - (p2 & 0xFF)); - g = (int)((p1 & 0xFF00) - (p2 & 0xFF00)) >> 8; - r = (int)((p1 & 0xFF0000) - (p2 & 0xFF0000)) >> 16; - - y = r + g + b; - u = r - b; - v = -r + 2*g - b; - - if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT) - return 1; - - if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT) - return 1; - - if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT) - return 1; - - return 0; -} - - -#define INTERP_LIMIT2 (96000) -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#define MIN(x,y) ((x) < (y) ? (x) : (y)) - -static int interp_16_diff2(u16 p1, u16 p2) -{ - int r, g, b; - int y, u, v; - - if ((p1 & 0xF79E) == (p2 & 0xF79E)) - return 0; - - if (interp_bits_per_pixel == 16) { - b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; - g = (int)((p1 & 0x7E0) - (p2 & 0x7E0)) >> 3; - r = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8; - } else { - b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; - g = (int)((p1 & 0x3E0) - (p2 & 0x3E0)) >> 2; - r = (int)((p1 & 0x7C00) - (p2 & 0x7C00)) >> 7; - } - -// yb = 30*r + 58*g + 12*b; - y = 33*r + 36*g + 31*b; - u = -14*r - 29*g + 44*b; - v = 62*r - 51*g - 10*b; - - if (11*ABS(y) + 8*ABS(u) + 6*ABS(v) > INTERP_LIMIT2) - return 1; - return 0; -} - -static int interp_32_diff2(u32 p1, u32 p2) -{ - int r, g, b; - int y, u, v; - - if ((p1 & 0xF0F0F0) == (p2 & 0xF0F0F0)) - return 0; - - b = (int)((p1 & 0xF8) - (p2 & 0xF8)); - g = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8; - r = (int)((p1 & 0xF80000) - (p2 & 0xF80000)) >> 16; - -// y = 30*r + 58*g + 12*b; - y = 33*r + 36*g + 31*b; - u = -14*r - 29*g + 44*b; - v = 62*r - 51*g - 10*b; - - if (11*ABS(y) + 8*ABS(u) + 6*ABS(v) > INTERP_LIMIT2) - return 1; - - return 0; -} -*/ -static void interp_set(unsigned bits_per_pixel) -{ - interp_bits_per_pixel = bits_per_pixel; - - switch (bits_per_pixel) { - case 15 : - interp_mask[0] = 0x7C1F; - interp_mask[1] = 0x03E0; - break; - case 16 : - interp_mask[0] = 0xF81F; - interp_mask[1] = 0x07E0; - break; - case 32 : - interp_mask[0] = 0xFF00FF; - interp_mask[1] = 0x00FF00; - break; - } -} - -#endif diff --git a/jan/src/intf/video/scalers/scale2x.h b/jan/src/intf/video/scalers/scale2x.h deleted file mode 100644 index c277e9736..000000000 --- a/jan/src/intf/video/scalers/scale2x.h +++ /dev/null @@ -1,924 +0,0 @@ -/* - * This file is part of the Scale2x project. - * - * Copyright (C) 2001-2003 Andrea Mazzoleni - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * This file contains a C and MMX implementation of the Scale2x effect. - * - * You can find an high level description of the effect at : - * - * http://scale2x.sourceforge.net/ - * - * Alternatively at the previous license terms, you are allowed to use this - * code in your program with these conditions: - * - the program is not used in commercial activities. - * - the whole source code of the program is released with the binary. - * - derivative works of the program are allowed. - */ - -#ifndef __SCALE2X_H -#define __SCALE2X_H - -#include - -/***************************************************************************/ -/* Basic types */ - -typedef unsigned char scale2x_uint8; -typedef unsigned short scale2x_uint16; -typedef unsigned scale2x_uint32; - -/***************************************************************************/ -/* Scale2x C implementation */ - -static void scale2x_8_def_single(scale2x_uint8* dst, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count) -{ - assert(count >= 2); - - /* first pixel */ - dst[0] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0]) - dst[1] = src0[0]; - else - dst[1] = src1[0]; - ++src0; - ++src1; - ++src2; - dst += 2; - - /* central pixels */ - count -= 2; - while (count) { - if (src1[-1] == src0[0] && src2[0] != src0[0] && src1[1] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0] && src1[-1] != src0[0]) - dst[1] = src0[0]; - else - dst[1] = src1[0]; - - ++src0; - ++src1; - ++src2; - dst += 2; - --count; - } - - /* last pixel */ - if (src1[-1] == src0[0] && src2[0] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - dst[1] = src1[0]; -} - -static void scale2x_16_def_single(scale2x_uint16* dst, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count) -{ - assert(count >= 2); - - /* first pixel */ - dst[0] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0]) - dst[1] = src0[0]; - else - dst[1] = src1[0]; - ++src0; - ++src1; - ++src2; - dst += 2; - - /* central pixels */ - count -= 2; - while (count) { - if (src1[-1] == src0[0] && src2[0] != src0[0] && src1[1] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0] && src1[-1] != src0[0]) - dst[1] = src0[0]; - else - dst[1] = src1[0]; - - ++src0; - ++src1; - ++src2; - dst += 2; - --count; - } - - /* last pixel */ - if (src1[-1] == src0[0] && src2[0] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - dst[1] = src1[0]; -} - -static void scale2x_32_def_single(scale2x_uint32* dst, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count) -{ - assert(count >= 2); - - /* first pixel */ - dst[0] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0]) - dst[1] = src0[0]; - else - dst[1] = src1[0]; - ++src0; - ++src1; - ++src2; - dst += 2; - - /* central pixels */ - count -= 2; - while (count) { - if (src1[-1] == src0[0] && src2[0] != src0[0] && src1[1] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0] && src1[-1] != src0[0]) - dst[1] = src0[0]; - else - dst[1] = src1[0]; - - ++src0; - ++src1; - ++src2; - dst += 2; - --count; - } - - /* last pixel */ - if (src1[-1] == src0[0] && src2[0] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - dst[1] = src1[0]; -} - -/** - * Scale by a factor of 2 a row of pixels of 8 bits. - * The function is implemented in C. - * The pixels over the left and right borders are assumed of the same color of - * the pixels on the border. - * \param src0 Pointer at the first pixel of the previous row. - * \param src1 Pointer at the first pixel of the current row. - * \param src2 Pointer at the first pixel of the next row. - * \param count Length in pixels of the src0, src1 and src2 rows. - * It must be at least 2. - * \param dst0 First destination row, double length in pixels. - * \param dst1 Second destination row, double length in pixels. - */ -static inline void scale2x_8_def(scale2x_uint8* dst0, scale2x_uint8* dst1, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count) -{ - assert(count >= 2); - - scale2x_8_def_single(dst0, src0, src1, src2, count); - scale2x_8_def_single(dst1, src2, src1, src0, count); -} - -/** - * Scale by a factor of 2 a row of pixels of 16 bits. - * This function operates like scale2x_8_def() but for 16 bits pixels. - * \param src0 Pointer at the first pixel of the previous row. - * \param src1 Pointer at the first pixel of the current row. - * \param src2 Pointer at the first pixel of the next row. - * \param count Length in pixels of the src0, src1 and src2 rows. - * It must be at least 2. - * \param dst0 First destination row, double length in pixels. - * \param dst1 Second destination row, double length in pixels. - */ -static inline void scale2x_16_def(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count) -{ - assert(count >= 2); - - scale2x_16_def_single(dst0, src0, src1, src2, count); - scale2x_16_def_single(dst1, src2, src1, src0, count); -} - -/** - * Scale by a factor of 2 a row of pixels of 32 bits. - * This function operates like scale2x_8_def() but for 32 bits pixels. - * \param src0 Pointer at the first pixel of the previous row. - * \param src1 Pointer at the first pixel of the current row. - * \param src2 Pointer at the first pixel of the next row. - * \param count Length in pixels of the src0, src1 and src2 rows. - * It must be at least 2. - * \param dst0 First destination row, double length in pixels. - * \param dst1 Second destination row, double length in pixels. - */ -static inline void scale2x_32_def(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count) -{ - assert(count >= 2); - - scale2x_32_def_single(dst0, src0, src1, src2, count); - scale2x_32_def_single(dst1, src2, src1, src0, count); -} - -/***************************************************************************/ -/* Scale2x MMX implementation */ - -#if defined(__GNUC__) && defined(__i386__) - -/* - * Apply the Scale2x effect at a single row. - * This function must be called only by the other scale2x functions. - * - * Considering the pixel map : - * - * ABC (src0) - * DEF (src1) - * GHI (src2) - * - * this functions compute 2 new pixels in substitution of the source pixel E - * like this map : - * - * ab (dst) - * - * with these variables : - * - * ¤t -> E - * ¤t_left -> D - * ¤t_right -> F - * ¤t_upper -> B - * ¤t_lower -> H - * - * %0 -> current_upper - * %1 -> current - * %2 -> current_lower - * %3 -> dst - * %4 -> counter - * - * %mm0 -> *current_left - * %mm1 -> *current_next - * %mm2 -> tmp0 - * %mm3 -> tmp1 - * %mm4 -> tmp2 - * %mm5 -> tmp3 - * %mm6 -> *current_upper - * %mm7 -> *current - */ -static inline void scale2x_8_mmx_single(scale2x_uint8* dst, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count) -{ - assert(count >= 16); - assert(count % 8 == 0); - - /* always do the first and last run */ - count -= 2*8; - - __asm__ __volatile__( -/* first run */ - /* set the current, current_pre, current_next registers */ - "movq 0(%1), %%mm0\n" - "movq 0(%1), %%mm7\n" - "movq 8(%1), %%mm1\n" - "psllq $56, %%mm0\n" - "psllq $56, %%mm1\n" - "psrlq $56, %%mm0\n" - "movq %%mm7, %%mm2\n" - "movq %%mm7, %%mm3\n" - "psllq $8, %%mm2\n" - "psrlq $8, %%mm3\n" - "por %%mm2, %%mm0\n" - "por %%mm3, %%mm1\n" - - /* current_upper */ - "movq (%0), %%mm6\n" - - /* compute the upper-left pixel for dst on %%mm2 */ - /* compute the upper-right pixel for dst on %%mm4 */ - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "movq %%mm0, %%mm3\n" - "movq %%mm1, %%mm5\n" - "pcmpeqb %%mm6, %%mm2\n" - "pcmpeqb %%mm6, %%mm4\n" - "pcmpeqb (%2), %%mm3\n" - "pcmpeqb (%2), %%mm5\n" - "pandn %%mm2, %%mm3\n" - "pandn %%mm4, %%mm5\n" - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "pcmpeqb %%mm1, %%mm2\n" - "pcmpeqb %%mm0, %%mm4\n" - "pandn %%mm3, %%mm2\n" - "pandn %%mm5, %%mm4\n" - "movq %%mm2, %%mm3\n" - "movq %%mm4, %%mm5\n" - "pand %%mm6, %%mm2\n" - "pand %%mm6, %%mm4\n" - "pandn %%mm7, %%mm3\n" - "pandn %%mm7, %%mm5\n" - "por %%mm3, %%mm2\n" - "por %%mm5, %%mm4\n" - - /* set *dst */ - "movq %%mm2, %%mm3\n" - "punpcklbw %%mm4, %%mm2\n" - "punpckhbw %%mm4, %%mm3\n" - "movq %%mm2, (%3)\n" - "movq %%mm3, 8(%3)\n" - - /* next */ - "addl $8, %0\n" - "addl $8, %1\n" - "addl $8, %2\n" - "addl $16, %3\n" - -/* central runs */ - "shrl $3, %4\n" - "jz 1f\n" - - "0:\n" - - /* set the current, current_pre, current_next registers */ - "movq -8(%1), %%mm0\n" - "movq (%1), %%mm7\n" - "movq 8(%1), %%mm1\n" - "psrlq $56, %%mm0\n" - "psllq $56, %%mm1\n" - "movq %%mm7, %%mm2\n" - "movq %%mm7, %%mm3\n" - "psllq $8, %%mm2\n" - "psrlq $8, %%mm3\n" - "por %%mm2, %%mm0\n" - "por %%mm3, %%mm1\n" - - /* current_upper */ - "movq (%0), %%mm6\n" - - /* compute the upper-left pixel for dst on %%mm2 */ - /* compute the upper-right pixel for dst on %%mm4 */ - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "movq %%mm0, %%mm3\n" - "movq %%mm1, %%mm5\n" - "pcmpeqb %%mm6, %%mm2\n" - "pcmpeqb %%mm6, %%mm4\n" - "pcmpeqb (%2), %%mm3\n" - "pcmpeqb (%2), %%mm5\n" - "pandn %%mm2, %%mm3\n" - "pandn %%mm4, %%mm5\n" - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "pcmpeqb %%mm1, %%mm2\n" - "pcmpeqb %%mm0, %%mm4\n" - "pandn %%mm3, %%mm2\n" - "pandn %%mm5, %%mm4\n" - "movq %%mm2, %%mm3\n" - "movq %%mm4, %%mm5\n" - "pand %%mm6, %%mm2\n" - "pand %%mm6, %%mm4\n" - "pandn %%mm7, %%mm3\n" - "pandn %%mm7, %%mm5\n" - "por %%mm3, %%mm2\n" - "por %%mm5, %%mm4\n" - - /* set *dst */ - "movq %%mm2, %%mm3\n" - "punpcklbw %%mm4, %%mm2\n" - "punpckhbw %%mm4, %%mm3\n" - "movq %%mm2, (%3)\n" - "movq %%mm3, 8(%3)\n" - - /* next */ - "addl $8, %0\n" - "addl $8, %1\n" - "addl $8, %2\n" - "addl $16, %3\n" - - "decl %4\n" - "jnz 0b\n" - "1:\n" - -/* final run */ - /* set the current, current_pre, current_next registers */ - "movq (%1), %%mm1\n" - "movq (%1), %%mm7\n" - "movq -8(%1), %%mm0\n" - "psrlq $56, %%mm1\n" - "psrlq $56, %%mm0\n" - "psllq $56, %%mm1\n" - "movq %%mm7, %%mm2\n" - "movq %%mm7, %%mm3\n" - "psllq $8, %%mm2\n" - "psrlq $8, %%mm3\n" - "por %%mm2, %%mm0\n" - "por %%mm3, %%mm1\n" - - /* current_upper */ - "movq (%0), %%mm6\n" - - /* compute the upper-left pixel for dst on %%mm2 */ - /* compute the upper-right pixel for dst on %%mm4 */ - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "movq %%mm0, %%mm3\n" - "movq %%mm1, %%mm5\n" - "pcmpeqb %%mm6, %%mm2\n" - "pcmpeqb %%mm6, %%mm4\n" - "pcmpeqb (%2), %%mm3\n" - "pcmpeqb (%2), %%mm5\n" - "pandn %%mm2, %%mm3\n" - "pandn %%mm4, %%mm5\n" - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "pcmpeqb %%mm1, %%mm2\n" - "pcmpeqb %%mm0, %%mm4\n" - "pandn %%mm3, %%mm2\n" - "pandn %%mm5, %%mm4\n" - "movq %%mm2, %%mm3\n" - "movq %%mm4, %%mm5\n" - "pand %%mm6, %%mm2\n" - "pand %%mm6, %%mm4\n" - "pandn %%mm7, %%mm3\n" - "pandn %%mm7, %%mm5\n" - "por %%mm3, %%mm2\n" - "por %%mm5, %%mm4\n" - - /* set *dst */ - "movq %%mm2, %%mm3\n" - "punpcklbw %%mm4, %%mm2\n" - "punpckhbw %%mm4, %%mm3\n" - "movq %%mm2, (%3)\n" - "movq %%mm3, 8(%3)\n" - - : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) - : - : "cc" - ); -} - -static inline void scale2x_16_mmx_single(scale2x_uint16* dst, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count) -{ - assert(count >= 8); - assert(count % 4 == 0); - - /* always do the first and last run */ - count -= 2*4; - - __asm__ __volatile__( -/* first run */ - /* set the current, current_pre, current_next registers */ - "movq 0(%1), %%mm0\n" - "movq 0(%1), %%mm7\n" - "movq 8(%1), %%mm1\n" - "psllq $48, %%mm0\n" - "psllq $48, %%mm1\n" - "psrlq $48, %%mm0\n" - "movq %%mm7, %%mm2\n" - "movq %%mm7, %%mm3\n" - "psllq $16, %%mm2\n" - "psrlq $16, %%mm3\n" - "por %%mm2, %%mm0\n" - "por %%mm3, %%mm1\n" - - /* current_upper */ - "movq (%0), %%mm6\n" - - /* compute the upper-left pixel for dst on %%mm2 */ - /* compute the upper-right pixel for dst on %%mm4 */ - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "movq %%mm0, %%mm3\n" - "movq %%mm1, %%mm5\n" - "pcmpeqw %%mm6, %%mm2\n" - "pcmpeqw %%mm6, %%mm4\n" - "pcmpeqw (%2), %%mm3\n" - "pcmpeqw (%2), %%mm5\n" - "pandn %%mm2, %%mm3\n" - "pandn %%mm4, %%mm5\n" - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "pcmpeqw %%mm1, %%mm2\n" - "pcmpeqw %%mm0, %%mm4\n" - "pandn %%mm3, %%mm2\n" - "pandn %%mm5, %%mm4\n" - "movq %%mm2, %%mm3\n" - "movq %%mm4, %%mm5\n" - "pand %%mm6, %%mm2\n" - "pand %%mm6, %%mm4\n" - "pandn %%mm7, %%mm3\n" - "pandn %%mm7, %%mm5\n" - "por %%mm3, %%mm2\n" - "por %%mm5, %%mm4\n" - - /* set *dst */ - "movq %%mm2, %%mm3\n" - "punpcklwd %%mm4, %%mm2\n" - "punpckhwd %%mm4, %%mm3\n" - "movq %%mm2, (%3)\n" - "movq %%mm3, 8(%3)\n" - - /* next */ - "addl $8, %0\n" - "addl $8, %1\n" - "addl $8, %2\n" - "addl $16, %3\n" - -/* central runs */ - "shrl $2, %4\n" - "jz 1f\n" - - "0:\n" - - /* set the current, current_pre, current_next registers */ - "movq -8(%1), %%mm0\n" - "movq (%1), %%mm7\n" - "movq 8(%1), %%mm1\n" - "psrlq $48, %%mm0\n" - "psllq $48, %%mm1\n" - "movq %%mm7, %%mm2\n" - "movq %%mm7, %%mm3\n" - "psllq $16, %%mm2\n" - "psrlq $16, %%mm3\n" - "por %%mm2, %%mm0\n" - "por %%mm3, %%mm1\n" - - /* current_upper */ - "movq (%0), %%mm6\n" - - /* compute the upper-left pixel for dst on %%mm2 */ - /* compute the upper-right pixel for dst on %%mm4 */ - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "movq %%mm0, %%mm3\n" - "movq %%mm1, %%mm5\n" - "pcmpeqw %%mm6, %%mm2\n" - "pcmpeqw %%mm6, %%mm4\n" - "pcmpeqw (%2), %%mm3\n" - "pcmpeqw (%2), %%mm5\n" - "pandn %%mm2, %%mm3\n" - "pandn %%mm4, %%mm5\n" - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "pcmpeqw %%mm1, %%mm2\n" - "pcmpeqw %%mm0, %%mm4\n" - "pandn %%mm3, %%mm2\n" - "pandn %%mm5, %%mm4\n" - "movq %%mm2, %%mm3\n" - "movq %%mm4, %%mm5\n" - "pand %%mm6, %%mm2\n" - "pand %%mm6, %%mm4\n" - "pandn %%mm7, %%mm3\n" - "pandn %%mm7, %%mm5\n" - "por %%mm3, %%mm2\n" - "por %%mm5, %%mm4\n" - - /* set *dst */ - "movq %%mm2, %%mm3\n" - "punpcklwd %%mm4, %%mm2\n" - "punpckhwd %%mm4, %%mm3\n" - "movq %%mm2, (%3)\n" - "movq %%mm3, 8(%3)\n" - - /* next */ - "addl $8, %0\n" - "addl $8, %1\n" - "addl $8, %2\n" - "addl $16, %3\n" - - "decl %4\n" - "jnz 0b\n" - "1:\n" - -/* final run */ - /* set the current, current_pre, current_next registers */ - "movq (%1), %%mm1\n" - "movq (%1), %%mm7\n" - "movq -8(%1), %%mm0\n" - "psrlq $48, %%mm1\n" - "psrlq $48, %%mm0\n" - "psllq $48, %%mm1\n" - "movq %%mm7, %%mm2\n" - "movq %%mm7, %%mm3\n" - "psllq $16, %%mm2\n" - "psrlq $16, %%mm3\n" - "por %%mm2, %%mm0\n" - "por %%mm3, %%mm1\n" - - /* current_upper */ - "movq (%0), %%mm6\n" - - /* compute the upper-left pixel for dst on %%mm2 */ - /* compute the upper-right pixel for dst on %%mm4 */ - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "movq %%mm0, %%mm3\n" - "movq %%mm1, %%mm5\n" - "pcmpeqw %%mm6, %%mm2\n" - "pcmpeqw %%mm6, %%mm4\n" - "pcmpeqw (%2), %%mm3\n" - "pcmpeqw (%2), %%mm5\n" - "pandn %%mm2, %%mm3\n" - "pandn %%mm4, %%mm5\n" - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "pcmpeqw %%mm1, %%mm2\n" - "pcmpeqw %%mm0, %%mm4\n" - "pandn %%mm3, %%mm2\n" - "pandn %%mm5, %%mm4\n" - "movq %%mm2, %%mm3\n" - "movq %%mm4, %%mm5\n" - "pand %%mm6, %%mm2\n" - "pand %%mm6, %%mm4\n" - "pandn %%mm7, %%mm3\n" - "pandn %%mm7, %%mm5\n" - "por %%mm3, %%mm2\n" - "por %%mm5, %%mm4\n" - - /* set *dst */ - "movq %%mm2, %%mm3\n" - "punpcklwd %%mm4, %%mm2\n" - "punpckhwd %%mm4, %%mm3\n" - "movq %%mm2, (%3)\n" - "movq %%mm3, 8(%3)\n" - - : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) - : - : "cc" - ); -} - -static inline void scale2x_32_mmx_single(scale2x_uint32* dst, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count) -{ - assert(count >= 4); - assert(count % 2 == 0); - - /* always do the first and last run */ - count -= 2*2; - - __asm__ __volatile__( -/* first run */ - /* set the current, current_pre, current_next registers */ - "movq 0(%1), %%mm0\n" - "movq 0(%1), %%mm7\n" - "movq 8(%1), %%mm1\n" - "psllq $32, %%mm0\n" - "psllq $32, %%mm1\n" - "psrlq $32, %%mm0\n" - "movq %%mm7, %%mm2\n" - "movq %%mm7, %%mm3\n" - "psllq $32, %%mm2\n" - "psrlq $32, %%mm3\n" - "por %%mm2, %%mm0\n" - "por %%mm3, %%mm1\n" - - /* current_upper */ - "movq (%0), %%mm6\n" - - /* compute the upper-left pixel for dst on %%mm2 */ - /* compute the upper-right pixel for dst on %%mm4 */ - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "movq %%mm0, %%mm3\n" - "movq %%mm1, %%mm5\n" - "pcmpeqd %%mm6, %%mm2\n" - "pcmpeqd %%mm6, %%mm4\n" - "pcmpeqd (%2), %%mm3\n" - "pcmpeqd (%2), %%mm5\n" - "pandn %%mm2, %%mm3\n" - "pandn %%mm4, %%mm5\n" - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "pcmpeqd %%mm1, %%mm2\n" - "pcmpeqd %%mm0, %%mm4\n" - "pandn %%mm3, %%mm2\n" - "pandn %%mm5, %%mm4\n" - "movq %%mm2, %%mm3\n" - "movq %%mm4, %%mm5\n" - "pand %%mm6, %%mm2\n" - "pand %%mm6, %%mm4\n" - "pandn %%mm7, %%mm3\n" - "pandn %%mm7, %%mm5\n" - "por %%mm3, %%mm2\n" - "por %%mm5, %%mm4\n" - - /* set *dst */ - "movq %%mm2, %%mm3\n" - "punpckldq %%mm4, %%mm2\n" - "punpckhdq %%mm4, %%mm3\n" - "movq %%mm2, (%3)\n" - "movq %%mm3, 8(%3)\n" - - /* next */ - "addl $8, %0\n" - "addl $8, %1\n" - "addl $8, %2\n" - "addl $16, %3\n" - -/* central runs */ - "shrl $1, %4\n" - "jz 1f\n" - - "0:\n" - - /* set the current, current_pre, current_next registers */ - "movq -8(%1), %%mm0\n" - "movq (%1), %%mm7\n" - "movq 8(%1), %%mm1\n" - "psrlq $32, %%mm0\n" - "psllq $32, %%mm1\n" - "movq %%mm7, %%mm2\n" - "movq %%mm7, %%mm3\n" - "psllq $32, %%mm2\n" - "psrlq $32, %%mm3\n" - "por %%mm2, %%mm0\n" - "por %%mm3, %%mm1\n" - - /* current_upper */ - "movq (%0), %%mm6\n" - - /* compute the upper-left pixel for dst on %%mm2 */ - /* compute the upper-right pixel for dst on %%mm4 */ - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "movq %%mm0, %%mm3\n" - "movq %%mm1, %%mm5\n" - "pcmpeqd %%mm6, %%mm2\n" - "pcmpeqd %%mm6, %%mm4\n" - "pcmpeqd (%2), %%mm3\n" - "pcmpeqd (%2), %%mm5\n" - "pandn %%mm2, %%mm3\n" - "pandn %%mm4, %%mm5\n" - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "pcmpeqd %%mm1, %%mm2\n" - "pcmpeqd %%mm0, %%mm4\n" - "pandn %%mm3, %%mm2\n" - "pandn %%mm5, %%mm4\n" - "movq %%mm2, %%mm3\n" - "movq %%mm4, %%mm5\n" - "pand %%mm6, %%mm2\n" - "pand %%mm6, %%mm4\n" - "pandn %%mm7, %%mm3\n" - "pandn %%mm7, %%mm5\n" - "por %%mm3, %%mm2\n" - "por %%mm5, %%mm4\n" - - /* set *dst */ - "movq %%mm2, %%mm3\n" - "punpckldq %%mm4, %%mm2\n" - "punpckhdq %%mm4, %%mm3\n" - "movq %%mm2, (%3)\n" - "movq %%mm3, 8(%3)\n" - - /* next */ - "addl $8, %0\n" - "addl $8, %1\n" - "addl $8, %2\n" - "addl $16, %3\n" - - "decl %4\n" - "jnz 0b\n" - "1:\n" - -/* final run */ - /* set the current, current_pre, current_next registers */ - "movq (%1), %%mm1\n" - "movq (%1), %%mm7\n" - "movq -8(%1), %%mm0\n" - "psrlq $32, %%mm1\n" - "psrlq $32, %%mm0\n" - "psllq $32, %%mm1\n" - "movq %%mm7, %%mm2\n" - "movq %%mm7, %%mm3\n" - "psllq $32, %%mm2\n" - "psrlq $32, %%mm3\n" - "por %%mm2, %%mm0\n" - "por %%mm3, %%mm1\n" - - /* current_upper */ - "movq (%0), %%mm6\n" - - /* compute the upper-left pixel for dst on %%mm2 */ - /* compute the upper-right pixel for dst on %%mm4 */ - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "movq %%mm0, %%mm3\n" - "movq %%mm1, %%mm5\n" - "pcmpeqd %%mm6, %%mm2\n" - "pcmpeqd %%mm6, %%mm4\n" - "pcmpeqd (%2), %%mm3\n" - "pcmpeqd (%2), %%mm5\n" - "pandn %%mm2, %%mm3\n" - "pandn %%mm4, %%mm5\n" - "movq %%mm0, %%mm2\n" - "movq %%mm1, %%mm4\n" - "pcmpeqd %%mm1, %%mm2\n" - "pcmpeqd %%mm0, %%mm4\n" - "pandn %%mm3, %%mm2\n" - "pandn %%mm5, %%mm4\n" - "movq %%mm2, %%mm3\n" - "movq %%mm4, %%mm5\n" - "pand %%mm6, %%mm2\n" - "pand %%mm6, %%mm4\n" - "pandn %%mm7, %%mm3\n" - "pandn %%mm7, %%mm5\n" - "por %%mm3, %%mm2\n" - "por %%mm5, %%mm4\n" - - /* set *dst */ - "movq %%mm2, %%mm3\n" - "punpckldq %%mm4, %%mm2\n" - "punpckhdq %%mm4, %%mm3\n" - "movq %%mm2, (%3)\n" - "movq %%mm3, 8(%3)\n" - - : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) - : - : "cc" - ); -} - -/** - * Scale by a factor of 2 a row of pixels of 8 bits. - * This is a very fast MMX implementation. - * The implementation uses a combination of cmp/and/not operations to - * completly remove the need of conditional jumps. This trick give the - * major speed improvement. - * Also, using the 8 bytes MMX registers more than one pixel are computed - * at the same time. - * Before calling this function you must ensure that the currenct CPU supports - * the MMX instruction set. After calling it you must be sure to call the EMMS - * instruction before any floating-point operation. - * The pixels over the left and right borders are assumed of the same color of - * the pixels on the border. - * \param src0 Pointer at the first pixel of the previous row. - * \param src1 Pointer at the first pixel of the current row. - * \param src2 Pointer at the first pixel of the next row. - * \param count Length in pixels of the src0, src1 and src2 rows. It must - * be at least 16 and a multiple of 8. - * \param dst0 First destination row, double length in pixels. - * \param dst1 Second destination row, double length in pixels. - */ -#if 0 -static void scale2x_8_mmx(scale2x_uint8* dst0, scale2x_uint8* dst1, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count) -{ - assert(count >= 16); - assert(count % 8 == 0); - - scale2x_8_mmx_single(dst0, src0, src1, src2, count); - scale2x_8_mmx_single(dst1, src2, src1, src0, count); -} -#endif -/** - * Scale by a factor of 2 a row of pixels of 16 bits. - * This function operates like scale2x_8_mmx() but for 16 bits pixels. - * \param src0 Pointer at the first pixel of the previous row. - * \param src1 Pointer at the first pixel of the current row. - * \param src2 Pointer at the first pixel of the next row. - * \param count Length in pixels of the src0, src1 and src2 rows. It must - * be at least 8 and a multiple of 4. - * \param dst0 First destination row, double length in pixels. - * \param dst1 Second destination row, double length in pixels. - */ -static void scale2x_16_mmx(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count) -{ - assert(count >= 8); - assert(count % 4 == 0); - - scale2x_16_mmx_single(dst0, src0, src1, src2, count); - scale2x_16_mmx_single(dst1, src2, src1, src0, count); -} - -/** - * Scale by a factor of 2 a row of pixels of 32 bits. - * This function operates like scale2x_8_mmx() but for 32 bits pixels. - * \param src0 Pointer at the first pixel of the previous row. - * \param src1 Pointer at the first pixel of the current row. - * \param src2 Pointer at the first pixel of the next row. - * \param count Length in pixels of the src0, src1 and src2 rows. It must - * be at least 4 and a multiple of 2. - * \param dst0 First destination row, double length in pixels. - * \param dst1 Second destination row, double length in pixels. - */ -static void scale2x_32_mmx(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count) -{ - assert(count >= 4); - assert(count % 2 == 0); - - scale2x_32_mmx_single(dst0, src0, src1, src2, count); - scale2x_32_mmx_single(dst1, src2, src1, src0, count); -} - -#endif - -#endif diff --git a/jan/src/intf/video/scalers/scale2x_vc.h b/jan/src/intf/video/scalers/scale2x_vc.h deleted file mode 100644 index 49f99a44f..000000000 --- a/jan/src/intf/video/scalers/scale2x_vc.h +++ /dev/null @@ -1,443 +0,0 @@ -/* - * This file is part of the Advance project. - * - * Copyright (C) 1999-2002 Andrea Mazzoleni - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * This file contains an inline MMX implentation of the Scale2x effect, - * which compiles with Visual Studio. - * - * You can found an high level description of the effect at : - * - * http://scale2x.sourceforge.net/scale2x.html - * - * Alternatively at the previous license terms, you are allowed to use this - * code in your program with these conditions: - * - the program is not used in commercial activities. - * - the whole source code of the program is released with the binary. - * - derivative works of the program are allowed. - */ - -#ifndef __SCALE2XV_H -#define __SCALE2XV_H - -/* See scale2x.h for function descriptions and information */ -#include "scale2x.h" - -#ifdef _MSC_VER - -/***************************************************************************/ -/* Scale2x MMX implementation */ - -static void internal_scale2x_16_mmx_single(scale2x_uint16* dst, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count) { - /* always do the first and last run */ - count -= 2*4; - - __asm { - mov eax, src0; - mov ebx, src1; - mov ecx, src2; - mov edx, dst; - mov esi, count; - - /* first run */ - /* set the current, current_pre, current_next registers */ - pxor mm0,mm0; /* use a fake black out of screen */ - movq mm7, qword ptr [ebx]; - movq mm1, qword ptr [ebx + 8]; - psrlq mm0, 48; - psllq mm1, 48; - movq mm2, mm7; - movq mm3, mm7; - psllq mm2, 16; - psrlq mm3, 16; - por mm0, mm2; - por mm1, mm3; - - /* current_upper */ - movq mm6, qword ptr [eax]; - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - movq mm2, mm0; - movq mm4, mm1; - movq mm3, mm0; - movq mm5, mm1; - pcmpeqw mm2, mm6; - pcmpeqw mm4, mm6; - pcmpeqw mm3, qword ptr [ecx]; - pcmpeqw mm5, qword ptr [ecx]; - pandn mm3,mm2; - pandn mm5,mm4; - movq mm2,mm0; - movq mm4,mm1; - pcmpeqw mm2,mm1; - pcmpeqw mm4,mm0; - pandn mm2,mm3; - pandn mm4,mm5; - movq mm3,mm2; - movq mm5,mm4; - pand mm2,mm6; - pand mm4,mm6; - pandn mm3,mm7; - pandn mm5,mm7; - por mm2,mm3; - por mm4,mm5; - - /* set *dst0 */ - movq mm3,mm2; - punpcklwd mm2,mm4; - punpckhwd mm3,mm4; - movq qword ptr [edx], mm2; - movq qword ptr [edx + 8], mm3; - - /* next */ - add eax, 8; - add ebx, 8; - add ecx, 8; - add edx, 16; - - /* central runs */ - shr esi, 2; - jz label1; - align 4; - label0: - - /* set the current, current_pre, current_next registers */ - movq mm0, qword ptr [ebx-8]; - movq mm7, qword ptr [ebx]; - movq mm1, qword ptr [ebx+8]; - psrlq mm0,48; - psllq mm1,48; - movq mm2,mm7; - movq mm3,mm7; - psllq mm2,16; - psrlq mm3,16; - por mm0,mm2; - por mm1,mm3; - - /* current_upper */ - movq mm6, qword ptr [eax]; - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - movq mm2,mm0; - movq mm4,mm1; - movq mm3,mm0; - movq mm5,mm1; - pcmpeqw mm2,mm6; - pcmpeqw mm4,mm6; - pcmpeqw mm3, qword ptr [ecx]; - pcmpeqw mm5, qword ptr [ecx]; - pandn mm3,mm2; - pandn mm5,mm4; - movq mm2,mm0; - movq mm4,mm1; - pcmpeqw mm2,mm1; - pcmpeqw mm4,mm0; - pandn mm2,mm3; - pandn mm4,mm5; - movq mm3,mm2; - movq mm5,mm4; - pand mm2,mm6; - pand mm4,mm6; - pandn mm3,mm7; - pandn mm5,mm7; - por mm2,mm3; - por mm4,mm5; - - /* set *dst0 */ - movq mm3,mm2; - punpcklwd mm2,mm4; - punpckhwd mm3,mm4; - movq qword ptr [edx], mm2; - movq qword ptr [edx+8], mm3; - - /* next */ - add eax,8; - add ebx,8; - add ecx,8; - add edx,16; - - dec esi; - jnz label0; - label1: - - /* final run */ - /* set the current, current_pre, current_next registers */ - movq mm0, qword ptr [ebx-8]; - movq mm7, qword ptr [ebx]; - pxor mm1,mm1; /* use a fake black out of screen */ - psrlq mm0,48; - psllq mm1,48; - movq mm2,mm7; - movq mm3,mm7; - psllq mm2,16; - psrlq mm3,16; - por mm0,mm2; - por mm1,mm3; - - /* current_upper */ - movq mm6, qword ptr [eax]; - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - movq mm2,mm0; - movq mm4,mm1; - movq mm3,mm0; - movq mm5,mm1; - pcmpeqw mm2,mm6; - pcmpeqw mm4,mm6; - pcmpeqw mm3, qword ptr [ecx]; - pcmpeqw mm5, qword ptr [ecx]; - pandn mm3,mm2; - pandn mm5,mm4; - movq mm2,mm0; - movq mm4,mm1; - pcmpeqw mm2,mm1; - pcmpeqw mm4,mm0; - pandn mm2,mm3; - pandn mm4,mm5; - movq mm3,mm2; - movq mm5,mm4; - pand mm2,mm6; - pand mm4,mm6; - pandn mm3,mm7; - pandn mm5,mm7; - por mm2,mm3; - por mm4,mm5; - - /* set *dst0 */ - movq mm3,mm2; - punpcklwd mm2,mm4; - punpckhwd mm3,mm4; - movq qword ptr [edx], mm2; - movq qword ptr [edx+8], mm3; - - mov src0, eax; - mov src1, ebx; - mov src2, ecx; - mov dst, edx; - mov count, esi; - } -} - -static void internal_scale2x_32_mmx_single(scale2x_uint32* dst, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count) { - /* always do the first and last run */ - count -= 2*2; - - __asm { - mov eax, src0; - mov ebx, src1; - mov ecx, src2; - mov edx, dst; - mov esi, count; - - /* first run */ - /* set the current, current_pre, current_next registers */ - pxor mm0,mm0; - movq mm7,qword ptr [ebx]; - movq mm1,qword ptr [ebx + 8]; - psrlq mm0,32; - psllq mm1,32; - movq mm2,mm7; - movq mm3,mm7; - psllq mm2,32; - psrlq mm3,32; - por mm0,mm2; - por mm1,mm3; - - /* current_upper */ - movq mm6,qword ptr [eax]; - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - movq mm2,mm0; - movq mm4,mm1; - movq mm3,mm0; - movq mm5,mm1; - pcmpeqd mm2,mm6; - pcmpeqd mm4,mm6; - pcmpeqd mm3,qword ptr [ecx]; - pcmpeqd mm5,qword ptr [ecx]; - pandn mm3,mm2; - pandn mm5,mm4; - movq mm2,mm0; - movq mm4,mm1; - pcmpeqd mm2,mm1; - pcmpeqd mm4,mm0; - pandn mm2,mm3; - pandn mm4,mm5; - movq mm3,mm2; - movq mm5,mm4; - pand mm2,mm6; - pand mm4,mm6; - pandn mm3,mm7; - pandn mm5,mm7; - por mm2,mm3; - por mm4,mm5; - - /* set *dst0 */ - movq mm3,mm2; - punpckldq mm2,mm4; - punpckhdq mm3,mm4; - movq qword ptr [edx],mm2; - movq qword ptr [edx+8],mm3; - - /* next */ - add eax,8; - add ebx,8; - add ecx,8; - add edx,16; - - /* central runs */ - shr esi,1; - jz label1; -label0: - - /* set the current, current_pre, current_next registers */ - movq mm0,qword ptr [ebx-8]; - movq mm7,qword ptr [ebx]; - movq mm1,qword ptr [ebx+8]; - psrlq mm0,32; - psllq mm1,32; - movq mm2,mm7; - movq mm3,mm7; - psllq mm2,32; - psrlq mm3,32; - por mm0,mm2; - por mm1,mm3; - - /* current_upper */ - movq mm6,qword ptr[eax]; - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - movq mm2,mm0; - movq mm4,mm1; - movq mm3,mm0; - movq mm5,mm1; - pcmpeqd mm2,mm6; - pcmpeqd mm4,mm6; - pcmpeqd mm3,qword ptr[ecx]; - pcmpeqd mm5,qword ptr[ecx]; - pandn mm3,mm2; - pandn mm5,mm4; - movq mm2,mm0; - movq mm4,mm1; - pcmpeqd mm2,mm1; - pcmpeqd mm4,mm0; - pandn mm2,mm3; - pandn mm4,mm5; - movq mm3,mm2; - movq mm5,mm4; - pand mm2,mm6; - pand mm4,mm6; - pandn mm3,mm7; - pandn mm5,mm7; - por mm2,mm3; - por mm4,mm5; - - /* set *dst0 */ - movq mm3,mm2; - punpckldq mm2,mm4; - punpckhdq mm3,mm4; - movq qword ptr [edx],mm2; - movq qword ptr [edx+8],mm3; - - /* next */ - add eax,8; - add ebx,8; - add ecx,8; - add edx,16; - - dec esi; - jnz label0; -label1: - - /* final run */ - /* set the current, current_pre, current_next registers */ - movq mm0,qword ptr [ebx-8]; - movq mm7,qword ptr [ebx]; - pxor mm1,mm1; - psrlq mm0,32; - psllq mm1,32; - movq mm2,mm7; - movq mm3,mm7; - psllq mm2,32; - psrlq mm3,32; - por mm0,mm2; - por mm1,mm3; - - /* current_upper */ - movq mm6,qword ptr [eax]; - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - movq mm2,mm0; - movq mm4,mm1; - movq mm3,mm0; - movq mm5,mm1; - pcmpeqd mm2,mm6; - pcmpeqd mm4,mm6; - pcmpeqd mm3,qword ptr [ecx]; - pcmpeqd mm5,qword ptr [ecx]; - pandn mm3,mm2; - pandn mm5,mm4; - movq mm2,mm0; - movq mm4,mm1; - pcmpeqd mm2,mm1; - pcmpeqd mm4,mm0; - pandn mm2,mm3; - pandn mm4,mm5; - movq mm3,mm2; - movq mm5,mm4; - pand mm2,mm6; - pand mm4,mm6; - pandn mm3,mm7; - pandn mm5,mm7; - por mm2,mm3; - por mm4,mm5; - - /* set *dst0 */ - movq mm3,mm2; - punpckldq mm2,mm4; - punpckhdq mm3,mm4; - movq qword ptr [edx],mm2; - movq qword ptr [edx+8],mm3; - - mov src0, eax; - mov src1, ebx; - mov src2, ecx; - mov dst, edx; - mov count, esi; - } -} - -static void internal_scale2x_16_mmx(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count) { - internal_scale2x_16_mmx_single(dst0, src0, src1, src2, count); - internal_scale2x_16_mmx_single(dst1, src2, src1, src0, count); -} - -static void internal_scale2x_32_mmx(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count) { - internal_scale2x_32_mmx_single(dst0, src0, src1, src2, count); - internal_scale2x_32_mmx_single(dst1, src2, src1, src0, count); -} -#endif - -#endif diff --git a/jan/src/intf/video/scalers/scale3x.h b/jan/src/intf/video/scalers/scale3x.h deleted file mode 100644 index 2a836683d..000000000 --- a/jan/src/intf/video/scalers/scale3x.h +++ /dev/null @@ -1,292 +0,0 @@ -/* - * This file is part of the Scale2x project. - * - * Copyright (C) 2001-2003 Andrea Mazzoleni - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * This file contains a C implementation of the Scale3x effect. - * - * You can find an high level description of the effect at : - * - * http://scale2x.sourceforge.net/ - * - * Alternatively at the previous license terms, you are allowed to use this - * code in your program with these conditions: - * - the program is not used in commercial activities. - * - the whole source code of the program is released with the binary. - * - derivative works of the program are allowed. - */ - -#ifndef __SCALE3X_H -#define __SCALE3X_H - -#include - -/***************************************************************************/ -/* Basic types */ - -typedef unsigned char scale3x_uint8; -typedef unsigned short scale3x_uint16; -typedef unsigned scale3x_uint32; - -/***************************************************************************/ -/* Scale3x C implementation */ - -static void scale3x_8_def_single(scale3x_uint8* dst, const scale3x_uint8* src0, const scale3x_uint8* src1, const scale3x_uint8* src2, unsigned count) -{ - assert(count >= 2); - - /* first pixel */ - dst[0] = src1[0]; - dst[1] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0]) - dst[2] = src0[0]; - else - dst[2] = src1[0]; - ++src0; - ++src1; - ++src2; - dst += 3; - - /* central pixels */ - count -= 2; - while (count) { - if (src1[-1] == src0[0] && src2[0] != src0[0] && src1[1] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - dst[1] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0] && src1[-1] != src0[0]) - dst[2] = src0[0]; - else - dst[2] = src1[0]; - - ++src0; - ++src1; - ++src2; - - dst += 3; - --count; - } - - /* last pixel */ - if (src1[-1] == src0[0] && src2[0] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - dst[1] = src1[0]; - dst[2] = src1[0]; -} - -static void scale3x_8_def_fill(scale3x_uint8* dst, const scale3x_uint8* src, unsigned count) -{ - while (count) { - dst[0] = src[0]; - dst[1] = src[0]; - dst[2] = src[0]; - - ++src; - dst += 3; - --count; - } -} - -static void scale3x_16_def_single(scale3x_uint16* dst, const scale3x_uint16* src0, const scale3x_uint16* src1, const scale3x_uint16* src2, unsigned count) -{ - assert(count >= 2); - - /* first pixel */ - dst[0] = src1[0]; - dst[1] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0]) - dst[2] = src0[0]; - else - dst[2] = src1[0]; - ++src0; - ++src1; - ++src2; - dst += 3; - - /* central pixels */ - count -= 2; - while (count) { - if (src1[-1] == src0[0] && src2[0] != src0[0] && src1[1] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - dst[1] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0] && src1[-1] != src0[0]) - dst[2] = src0[0]; - else - dst[2] = src1[0]; - - ++src0; - ++src1; - ++src2; - - dst += 3; - --count; - } - - /* last pixel */ - if (src1[-1] == src0[0] && src2[0] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - dst[1] = src1[0]; - dst[2] = src1[0]; -} - -static void scale3x_16_def_fill(scale3x_uint16* dst, const scale3x_uint16* src, unsigned count) -{ - while (count) { - dst[0] = src[0]; - dst[1] = src[0]; - dst[2] = src[0]; - - ++src; - dst += 3; - --count; - } -} - -static void scale3x_32_def_single(scale3x_uint32* dst, const scale3x_uint32* src0, const scale3x_uint32* src1, const scale3x_uint32* src2, unsigned count) -{ - assert(count >= 2); - - /* first pixel */ - dst[0] = src1[0]; - dst[1] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0]) - dst[2] = src0[0]; - else - dst[2] = src1[0]; - ++src0; - ++src1; - ++src2; - dst += 3; - - /* central pixels */ - count -= 2; - while (count) { - if (src1[-1] == src0[0] && src2[0] != src0[0] && src1[1] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - dst[1] = src1[0]; - if (src1[1] == src0[0] && src2[0] != src0[0] && src1[-1] != src0[0]) - dst[2] = src0[0]; - else - dst[2] = src1[0]; - - ++src0; - ++src1; - ++src2; - - dst += 3; - --count; - } - - /* last pixel */ - if (src1[-1] == src0[0] && src2[0] != src0[0]) - dst[0] = src0[0]; - else - dst[0] = src1[0]; - dst[1] = src1[0]; - dst[2] = src1[0]; -} - -static void scale3x_32_def_fill(scale3x_uint32* dst, const scale3x_uint32* src, unsigned count) -{ - while (count) { - dst[0] = src[0]; - dst[1] = src[0]; - dst[2] = src[0]; - - ++src; - dst += 3; - --count; - } -} - -/** - * Scale by a factor of 3 a row of pixels of 8 bits. - * The function is implemented in C. - * The pixels over the left and right borders are assumed of the same color of - * the pixels on the border. - * \param src0 Pointer at the first pixel of the previous row. - * \param src1 Pointer at the first pixel of the current row. - * \param src2 Pointer at the first pixel of the next row. - * \param count Length in pixels of the src0, src1 and src2 rows. - * It must be at least 2. - * \param dst0 First destination row, triple length in pixels. - * \param dst1 Second destination row, triple length in pixels. - * \param dst2 Third destination row, triple length in pixels. - */ -static inline void scale3x_8_def(scale3x_uint8* dst0, scale3x_uint8* dst1, scale3x_uint8* dst2, const scale3x_uint8* src0, const scale3x_uint8* src1, const scale3x_uint8* src2, unsigned count) -{ - assert(count >= 2); - - scale3x_8_def_single(dst0, src0, src1, src2, count); - scale3x_8_def_fill(dst1, src1, count); - scale3x_8_def_single(dst2, src2, src1, src0, count); -} - -/** - * Scale by a factor of 3 a row of pixels of 16 bits. - * This function operates like scale3x_8_def() but for 16 bits pixels. - * \param src0 Pointer at the first pixel of the previous row. - * \param src1 Pointer at the first pixel of the current row. - * \param src2 Pointer at the first pixel of the next row. - * \param count Length in pixels of the src0, src1 and src2 rows. - * It must be at least 2. - * \param dst0 First destination row, triple length in pixels. - * \param dst1 Second destination row, triple length in pixels. - * \param dst2 Third destination row, triple length in pixels. - */ -static inline void scale3x_16_def(scale3x_uint16* dst0, scale3x_uint16* dst1, scale3x_uint16* dst2, const scale3x_uint16* src0, const scale3x_uint16* src1, const scale3x_uint16* src2, unsigned count) -{ - assert(count >= 2); - - scale3x_16_def_single(dst0, src0, src1, src2, count); - scale3x_16_def_fill(dst1, src1, count); - scale3x_16_def_single(dst2, src2, src1, src0, count); -} - -/** - * Scale by a factor of 3 a row of pixels of 32 bits. - * This function operates like scale3x_8_def() but for 32 bits pixels. - * \param src0 Pointer at the first pixel of the previous row. - * \param src1 Pointer at the first pixel of the current row. - * \param src2 Pointer at the first pixel of the next row. - * \param count Length in pixels of the src0, src1 and src2 rows. - * It must be at least 2. - * \param dst0 First destination row, triple length in pixels. - * \param dst1 Second destination row, triple length in pixels. - * \param dst2 Third destination row, triple length in pixels. - */ -static inline void scale3x_32_def(scale3x_uint32* dst0, scale3x_uint32* dst1, scale3x_uint32* dst2, const scale3x_uint32* src0, const scale3x_uint32* src1, const scale3x_uint32* src2, unsigned count) -{ - assert(count >= 2); - - scale3x_32_def_single(dst0, src0, src1, src2, count); - scale3x_32_def_fill(dst1, src1, count); - scale3x_32_def_single(dst2, src2, src1, src0, count); -} - -#endif diff --git a/jan/src/intf/video/scalers/superscale.asm b/jan/src/intf/video/scalers/superscale.asm deleted file mode 100644 index e33c68978..000000000 --- a/jan/src/intf/video/scalers/superscale.asm +++ /dev/null @@ -1,211 +0,0 @@ -;SuperScale by ElSemi -; -; Based on the original idea of 2xScale of AdvanceMAME. -; AdvanceMAME code is GPLed and I didn't get permisson to use it. so this code is -; my own implementation of that effect. -; similar to Kawaks' KScale effect -; -;It expands the central pixel of a 3x3 matrix to 2x2 pixels resulting in a 2x scale in -;both axis. -; -;A B C E0 E1 -;D E F -> E2 E3 -;G H I -; -; -;Original algorithm (AdvanceMAME) -; -;E0 = (D == B && B != F && D != H) ? D : E; -;E1 = (B == F && B != D && F != H) ? F : E; -;E2 = (D == H && D != B && H != F) ? D : E; -;E3 = (H == F && D != H && B != F) ? F : E; -; -; -;(I'll only put the first 2 equations as the 3rd and 4th -;are symmetrical ABC<->GHI) -; -;Reduce variable usage -; -;D==B => E0=D -> E0=B -; D!=H -> B!=H -; -;B==F => E1=F -> E1=B -; F!=H -> B!=H -; -;Group and reorder -; -;E0=(B==D && B!=F && B!=H)?B:E; -;E1=(B!=D && B==F && B!=H)?B:E; -; -;as you can see, there are only 3 "real" conditions (B==D, B==F, and B!=H). the other -;2 can be get reversing the first 1 conditions (B!=D, B!=F) that makes the code -;suitable to pcmpeqw,pand,pandn - - BITS 32 - SECTION .text ALIGN = 32 - GLOBAL _superscale_line - GLOBAL _superscale_line_75 - GLOBAL superscale_line - GLOBAL superscale_line_75 - -%macro ALIGN32 0 - times ($$-$)&31 nop -%endmacro - -_superscale_line: -superscale_line: - push ebp - mov ebp,esp - push eax - push esi - push ebx - push edi - push ecx - - mov eax,[ebp+8h] ;ABC ;line -1 - mov esi,[ebp+0Ch] ;DEF ;current line - mov ebx,[ebp+10h] ;GHI ;line +1 - mov edi,[ebp+14h] ;dst - mov ecx,[ebp+18h] ;count - shr ecx,2 ;/4, we'll make 4 pixels per loop - ALIGN32 -iloop: -;This code makes 4 pixels per loop -;The comments refer only to 1 pixel (the 3rd one to make explanations clearer and -;closer to the algorithm) -; v - movq mm0,[eax] ;xABC -;v movq mm1,[esi] ;xDEF - movq mm2,[ebx] ;xGHI - movq mm3,[esi-2] ;xxDE - movq mm1,[esi] ;xDEF - movq mm4,[esi+2] ;DEFx - -;Prepare basic comparisons - pcmpeqw mm2,mm0 ;mm2=xABC==xGHI (B==H) - pcmpeqw mm3,mm0 ;mm3=xABC==xxDE (B==D) - pcmpeqw mm4,mm0 ;mm4=xABC==DEFx (B==F) - movq mm5,mm2 ;mm5=(B==H) (we need this for both pixel conditions) - -;prepare pixel masks - pandn mm2,mm3 ;mm2=(B==D) && (B!=H) - pandn mm5,mm4 ;mm5=(B==F) && (B!=H) - pandn mm4,mm2 ;mm4=(B==D) && (B!=H) && (B!=F) -> left pixel mask - pandn mm3,mm5 ;mm3=(B==F) && (B!=H) && (B!=D) -> right pixel mask - -;Mask pixels and merge - movq mm2,mm4 ;store to temp as I will overwrite them in the masking process - movq mm5,mm3 ; - pand mm4,mm0 ;Mask out pixels that don't satisfy the conditions - pand mm3,mm0 ;leaving only the "new" pixels (E0,E1=B) - pandn mm2,mm1 ;Invert the mask and merge to get the pixels that remain - pandn mm5,mm1 ;unchanged (E0,E1=E) - por mm4,mm2 ;merge both data to get the final pixels xxE0x - por mm3,mm5 ;xxE1x - movq mm0,mm4 - ;merge both regs, interleaving E0 and E1 data - punpcklwd mm4,mm3 ;in 2 regs (mm4|mm0) - punpckhwd mm0,mm3 ; - movq [edi],mm4 - movq [edi+8],mm0 - add eax,8 - add esi,8 - add ebx,8 - add edi,16 - loop iloop - - pop ecx - pop edi - pop ebx - pop esi - pop eax - pop ebp - ret - -ALIGN32 - -_superscale_line_75: ;do a 75% reduction on the final pixel colour -superscale_line_75: ;do a 75% reduction on the final pixel colour - push ebp - mov ebp,esp - push eax - push esi - push ebx - push edi - push ecx - - mov eax,[ebp+8h] ;ABC ;line -1 - mov esi,[ebp+0Ch] ;DEF ;current line - mov ebx,[ebp+10h] ;GHI ;line +1 - mov edi,[ebp+14h] ;dst - mov ecx,[ebp+1Ch] ;mask - movq mm7,[ecx] ; - mov ecx,[ebp+18h] ;count - shr ecx,2 ;/4, we'll make 4 pixels per loop - ALIGN32 -iloop2: -;This code makes 4 pixels per loop resulting in 8 pixels expansion -;The comments refer only to 1 pixel (the 3rd one to make explanations clearer and -;closer to the algorithm) -; v - movq mm0,[eax] ;xABC -;v movq mm1,[esi] ;xDEF - movq mm2,[ebx] ;xGHI - movq mm3,[esi-2] ;xxDE - movq mm1,[esi] ;xDEF - movq mm4,[esi+2] ;DEFx - -;Prepare basic conditions - pcmpeqw mm2,mm0 ;mm2=xABC==xGHI (B==H) - pcmpeqw mm3,mm0 ;mm3=xABC==xxDE (B==D) - pcmpeqw mm4,mm0 ;mm4=xABC==DEFx (B==F) - movq mm5,mm2 ;mm5=(B==H) (we need this for both pixel conditions) - -;Prepare pixel masks - pandn mm2,mm3 ;mm2=(B==D) && (B!=H) - pandn mm5,mm4 ;mm5=(B==F) && (B!=H) - pandn mm4,mm2 ;mm4=(B==D) && (B!=H) && (B!=F) -> left pixel mask - pandn mm3,mm5 ;mm3=(B==F) && (B!=H) && (B!=D) -> right pixel mask - -;Mask pixels and merge - movq mm2,mm4 ;store to temp as I will overwrite them in the masking process - movq mm5,mm3 ; - pand mm4,mm0 ;Mask out pixels that don't satisfy the conditions - pand mm3,mm0 ;leaving only the "new" pixels (E0,E1=B) - pandn mm2,mm1 ;Invert the mask and merge to get the pixels that remain - pandn mm5,mm1 ;unchanged (E0,E1=E) - por mm4,mm2 ;merge both data to get the final pixels xxE0x - por mm3,mm5 ;xxE1x - movq mm0,mm4 ;merge both regs, interleaving E0 and E1 data - punpcklwd mm4,mm3 ;in 2 regs (mm4|mm0) - punpckhwd mm0,mm3 ; - -;Reduce color bright to 75% using shift/mask - psrlw mm4,1 - psrlw mm0,1 - pand mm4,mm7 - pand mm0,mm7 - movq mm2,mm4 - movq mm1,mm0 - psrlw mm2,1 - psrlw mm1,1 - pand mm2,mm7 - pand mm1,mm7 - paddw mm4,mm2 - paddw mm0,mm1 - movq [edi],mm4 - movq [edi+8],mm0 - add eax,8 - add esi,8 - add ebx,8 - add edi,16 - dec ecx - jnz near iloop2 - - pop ecx - pop edi - pop ebx - pop esi - pop eax - pop ebp - ret diff --git a/jan/src/intf/video/scalers/xbr.cpp b/jan/src/intf/video/scalers/xbr.cpp deleted file mode 100644 index 662240bf8..000000000 --- a/jan/src/intf/video/scalers/xbr.cpp +++ /dev/null @@ -1,925 +0,0 @@ -/* - Hyllian's 2xBR v3.3b - - Copyright (C) 2011, 2012 Hyllian/Jararaca - sergiogdb@gmail.com - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#include -#include - - -static unsigned int RGBtoYUV[65536]; -static unsigned int tbl_5_to_8[32]={0, 8, 16, 25, 33, 41, 49, 58, 66, 74, 82, 90, 99, 107, 115, 123, 132, 140, 148, 156, 165, 173, 181, 189, 197, 206, 214, 222, 230, 239, 247, 255}; -static unsigned int tbl_6_to_8[64]={0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255}; - -#define RED_MASK565 0xF800 -#define RED_BLUE_MASK565 0xF81F -#define GREEN_MASK565 0x07E0 -#define BLUE_MASK565 0x001F - -#define RED_MASK555 0x7C00 -#define GREEN_MASK555 0x03E0 -#define BLUE_MASK555 0x001F - -#define PG_LBMASK565 0xF7DE -#define PG_LBMASK555 0x7BDE - -static const unsigned short int pg_red_mask = RED_MASK565; -static const unsigned short int pg_red_blue_mask = RED_BLUE_MASK565; -static const unsigned short int pg_green_mask = GREEN_MASK565; -static const unsigned short int pg_blue_mask = BLUE_MASK565; -static const unsigned short int pg_lbmask = PG_LBMASK565; - -#define ALPHA_BLEND_128_W(dst, src) dst = ((src & pg_lbmask) >> 1) + ((dst & pg_lbmask) >> 1) - -#define ALPHA_BLEND_32_W(dst, src) \ - dst = ( \ - (pg_red_blue_mask & ((dst & pg_red_blue_mask) + \ - ((((src & pg_red_blue_mask) - \ - (dst & pg_red_blue_mask))) >>3))) | \ - (pg_green_mask & ((dst & pg_green_mask) + \ - ((((src & pg_green_mask) - \ - (dst & pg_green_mask))) >>3)))) - -#define ALPHA_BLEND_64_W(dst, src) \ - dst = ( \ - (pg_red_blue_mask & ((dst & pg_red_blue_mask) + \ - ((((src & pg_red_blue_mask) - \ - (dst & pg_red_blue_mask))) >>2))) | \ - (pg_green_mask & ((dst & pg_green_mask) + \ - ((((src & pg_green_mask) - \ - (dst & pg_green_mask))) >>2)))) - -#define ALPHA_BLEND_192_W(dst, src) \ - dst = ( \ - (pg_red_blue_mask & ((dst & pg_red_blue_mask) + \ - ((((src & pg_red_blue_mask) - \ - (dst & pg_red_blue_mask)) * 3) >>2))) | \ - (pg_green_mask & ((dst & pg_green_mask) + \ - ((((src & pg_green_mask) - \ - (dst & pg_green_mask)) * 3) >>2)))) - -#define ALPHA_BLEND_224_W(dst, src) \ - dst = ( \ - (pg_red_blue_mask & ((dst & pg_red_blue_mask) + \ - ((((src & pg_red_blue_mask) - \ - (dst & pg_red_blue_mask)) * 7) >>3))) | \ - (pg_green_mask & ((dst & pg_green_mask) + \ - ((((src & pg_green_mask) - \ - (dst & pg_green_mask)) * 7) >>3)))) - - -#define LEFT_UP_2_2X(N3, N2, N1, PIXEL)\ - ALPHA_BLEND_224_W(E[N3], PIXEL); \ - ALPHA_BLEND_64_W( E[N2], PIXEL); \ - E[N1] = E[N2]; \ - - -#define LEFT_2_2X(N3, N2, PIXEL)\ - ALPHA_BLEND_192_W(E[N3], PIXEL); \ - ALPHA_BLEND_64_W( E[N2], PIXEL); \ - -#define UP_2_2X(N3, N1, PIXEL)\ - ALPHA_BLEND_192_W(E[N3], PIXEL); \ - ALPHA_BLEND_64_W( E[N1], PIXEL); \ - -#define DIA_2X(N3, PIXEL)\ - ALPHA_BLEND_128_W(E[N3], PIXEL); \ - -#define df(A, B)\ - abs((int)RGBtoYUV[A] - (int)RGBtoYUV[B])\ - -#define eq(A, B)\ - (df(A, B) < 155)\ - -static void initialize(){ - static int initialized; - if (initialized){ - return; - } - initialized = 1; - - int format = 0; - - if (format == 0){ //565 - for (int c = 0; c < 65536; c++){ - unsigned int r = tbl_5_to_8[(c & RED_MASK565) >> 11]; - unsigned int g = tbl_6_to_8[(c & GREEN_MASK565) >> 5]; - unsigned int b = tbl_5_to_8[(c & BLUE_MASK565) ]; - unsigned int y = ((r<<4) + (g<<5) + (b<<2)); - unsigned int u = ( -r - (g<<1) + (b<<2)); - unsigned int v = ((r<<1) - (g<<1) - (b>>1)); - RGBtoYUV[c] = y + u + v; - } - } else if (format == 1){ //555 - for (int c = 0; c < 65536; c++) { - unsigned int r = tbl_5_to_8[(c & RED_MASK555) >> 10]; - unsigned int g = tbl_5_to_8[(c & GREEN_MASK555) >> 5]; - unsigned int b = tbl_5_to_8[(c & BLUE_MASK555) ]; - unsigned int y = ((r<<4) + (g<<5) + (b<<2)); - unsigned int u = ( -r - (g<<1) + (b<<2)); - unsigned int v = ((r<<1) - (g<<1) - (b>>1)); - RGBtoYUV[c] = y + u + v; - } - } -} - -#define xbr2x_do \ - initialize(); \ - \ - unsigned int e, i, px; \ - unsigned int ex, ex2, ex3; \ - unsigned int ke, ki; \ - \ - int nextOutputLine = dstPitch / 2; \ - \ - for (int y = 0; y < Yres; y++){ \ - unsigned short int * E = (unsigned short *)((char*) pOut + y * dstPitch * 2); \ - \ - unsigned short int * sa2 = (unsigned short *)((char*) pIn + y * srcPitch - 4); \ - unsigned short int * sa1 = sa2 - srcPitch / 2; \ - unsigned short int * sa0 = sa1 - srcPitch / 2; \ - unsigned short int * sa3 = sa2 + srcPitch / 2; \ - unsigned short int * sa4 = sa3 + srcPitch / 2; \ - \ - if (y <= 1){ \ - sa0 = sa1; \ - if (y == 0){ \ - sa0 = sa1 = sa2; \ - } \ - } \ - \ - if (y >= Yres - 2){ \ - sa4 = sa3; \ - if (y == Yres - 1){ \ - sa4 = sa3 = sa2; \ - } \ - } \ - \ - unsigned char pprev; \ - unsigned char pprev2; \ - pprev = pprev2 = 2; \ - \ - for (int x = 0; x < Xres; x++){ \ - unsigned short B1 = sa0[2]; \ - unsigned short PB = sa1[2]; \ - unsigned short PE = sa2[2]; \ - unsigned short PH = sa3[2]; \ - unsigned short H5 = sa4[2]; \ - \ - unsigned short A1 = sa0[pprev]; \ - unsigned short PA = sa1[pprev]; \ - unsigned short PD = sa2[pprev]; \ - unsigned short PG = sa3[pprev]; \ - unsigned short G5 = sa4[pprev]; \ - \ - unsigned short A0 = sa1[pprev2]; \ - unsigned short D0 = sa2[pprev2]; \ - unsigned short G0 = sa3[pprev2]; \ - \ - unsigned short C1 = 0; \ - unsigned short PC = 0; \ - unsigned short PF = 0; \ - unsigned short PI = 0; \ - unsigned short I5 = 0; \ - \ - unsigned short C4 = 0; \ - unsigned short F4 = 0; \ - unsigned short I4 = 0; \ - \ - if (x >= Xres - 2){ \ - if (x == Xres - 1){ \ - C1 = sa0[2]; \ - PC = sa1[2]; \ - PF = sa2[2]; \ - PI = sa3[2]; \ - I5 = sa4[2]; \ - \ - C4 = sa1[2]; \ - F4 = sa2[2]; \ - I4 = sa3[2]; \ - } else { \ - C1 = sa0[3]; \ - PC = sa1[3]; \ - PF = sa2[3]; \ - PI = sa3[3]; \ - I5 = sa4[3]; \ - \ - C4 = sa1[3]; \ - F4 = sa2[3]; \ - I4 = sa3[3]; \ - } \ - } else { \ - C1 = sa0[3]; \ - PC = sa1[3]; \ - PF = sa2[3]; \ - PI = sa3[3]; \ - I5 = sa4[3]; \ - \ - C4 = sa1[4]; \ - F4 = sa2[4]; \ - I4 = sa3[4]; \ - } \ - \ - E[0] = E[1] = E[nextOutputLine] = E[nextOutputLine + 1] = PE; \ - \ - FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, 0, 1, nextOutputLine, nextOutputLine+1); \ - FILTRO(PE, PC, PF, PB, PI, PA, PH, PD, PG, I4, A1, I5, H5, A0, D0, B1, C1, F4, C4, G5, G0, nextOutputLine, 0, nextOutputLine+1, 1); \ - FILTRO(PE, PA, PB, PD, PC, PG, PF, PH, PI, C1, G0, C4, F4, G5, H5, D0, A0, B1, A1, I4, I5, nextOutputLine+1, nextOutputLine, 1, 0); \ - FILTRO(PE, PG, PD, PH, PA, PI, PB, PF, PC, A0, I5, A1, B1, I4, F4, H5, G5, D0, G0, C1, C4, 1, nextOutputLine+1, 0, nextOutputLine); \ - \ - sa0 += 1; \ - sa1 += 1; \ - sa2 += 1; \ - sa3 += 1; \ - sa4 += 1; \ - \ - E += 2; \ - \ - if (pprev2){ \ - pprev2--; \ - pprev = 1; \ - } \ - } \ - } \ - -void xbr2x_a(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres) -{ -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N0, N1, N2, N3) \ - ex = (PE!=PH && PE!=PF); \ - if ( ex )\ - {\ - e = (df(PE,PC)+df(PE,PG)+df(PI,H5)+df(PI,F4))+(df(PH,PF)<<2); \ - i = (df(PH,PD)+df(PH,I5)+df(PF,I4)+df(PF,PB))+(df(PE,PI)<<2); \ - if ((e=(ki<<1)) && ex2 ) \ - {\ - LEFT_UP_2_2X(N3, N2, N1, px)\ - }\ - else if ( ((ke<<1)<=ki) && ex3 ) \ - {\ - LEFT_2_2X(N3, N2, px);\ - }\ - else if ( (ke>=(ki<<1)) && ex2 ) \ - {\ - UP_2_2X(N3, N1, px);\ - }\ - else \ - {\ - DIA_2X(N3, px);\ - }\ - }\ - else if (e<=i)\ - {\ - ALPHA_BLEND_128_W( E[N3], ((df(PE,PF) <= df(PE,PH)) ? PF : PH)); \ - }\ - }\ - - xbr2x_do - -#undef FILTRO -} - -void xbr2x_b(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres) -{ -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N0, N1, N2, N3) \ - ex = (PE!=PH && PE!=PF); \ - if ( ex )\ - {\ - e = (df(PE,PC)+df(PE,PG)+df(PI,H5)+df(PI,F4))+(df(PH,PF)<<2); \ - i = (df(PH,PD)+df(PH,I5)+df(PF,I4)+df(PF,PB))+(df(PE,PI)<<2); \ - if ((e=(ki<<1)) && ex2 ) \ - {\ - LEFT_UP_2_2X(N3, N2, N1, px)\ - }\ - else if ( ((ke<<1)<=ki) && ex3 ) \ - {\ - LEFT_2_2X(N3, N2, px);\ - }\ - else if ( (ke>=(ki<<1)) && ex2 ) \ - {\ - UP_2_2X(N3, N1, px);\ - }\ - else \ - {\ - DIA_2X(N3, px);\ - }\ - }\ - else if (e<=i)\ - {\ - ALPHA_BLEND_128_W( E[N3], ((df(PE,PF) <= df(PE,PH)) ? PF : PH)); \ - }\ - }\ - - xbr2x_do - -#undef FILTRO -} - -void xbr2x_c(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres) -{ -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N0, N1, N2, N3) \ - ex = (PE!=PH && PE!=PF); \ - if ( ex )\ - {\ - e = (df(PE,PC)+df(PE,PG)+df(PI,H5)+df(PI,F4))+(df(PH,PF)<<2); \ - i = (df(PH,PD)+df(PH,I5)+df(PF,I4)+df(PF,PB))+(df(PE,PI)<<2); \ - if (e=(ki<<1)) && ex2 ) \ - {\ - LEFT_UP_2_2X(N3, N2, N1, px)\ - }\ - else if ( ((ke<<1)<=ki) && ex3 ) \ - {\ - LEFT_2_2X(N3, N2, px);\ - }\ - else if ( (ke>=(ki<<1)) && ex2 ) \ - {\ - UP_2_2X(N3, N1, px);\ - }\ - else \ - {\ - DIA_2X(N3, px);\ - }\ - }\ - else if (e<=i)\ - {\ - ALPHA_BLEND_128_W( E[N3], ((df(PE,PF) <= df(PE,PH)) ? PF : PH)); \ - }\ - }\ - - xbr2x_do - -#undef FILTRO -} - -#undef xbr2x_do - -#define LEFT_UP_2_3X(N7, N5, N6, N2, N8, PIXEL)\ - ALPHA_BLEND_192_W(E[N7], PIXEL); \ - ALPHA_BLEND_64_W( E[N6], PIXEL); \ - E[N5] = E[N7]; \ - E[N2] = E[N6]; \ - E[N8] = PIXEL;\ - - -#define LEFT_2_3X(N7, N5, N6, N8, PIXEL)\ - ALPHA_BLEND_192_W(E[N7], PIXEL); \ - ALPHA_BLEND_64_W( E[N5], PIXEL); \ - ALPHA_BLEND_64_W( E[N6], PIXEL); \ - E[N8] = PIXEL;\ - -#define UP_2_3X(N5, N7, N2, N8, PIXEL)\ - ALPHA_BLEND_192_W(E[N5], PIXEL); \ - ALPHA_BLEND_64_W( E[N7], PIXEL); \ - ALPHA_BLEND_64_W( E[N2], PIXEL); \ - E[N8] = PIXEL;\ - -#define DIA_3X(N8, N5, N7, PIXEL)\ - ALPHA_BLEND_224_W(E[N8], PIXEL); \ - ALPHA_BLEND_32_W(E[N5], PIXEL); \ - ALPHA_BLEND_32_W(E[N7], PIXEL); \ - -#define xbr3x_do \ - initialize(); \ - \ - const int nl = dstPitch / 2; \ - const int nl1 = nl + nl; \ - \ - for (int y = 0; y < Yres; y++){ \ - unsigned short int * E = (unsigned short *)((char*) pOut + y * dstPitch * 3); \ - \ - unsigned short int * sa2 = (unsigned short *)((char*) pIn + y * srcPitch - 4); \ - unsigned short int * sa1 = sa2 - srcPitch / 2; \ - unsigned short int * sa0 = sa1 - srcPitch / 2; \ - unsigned short int * sa3 = sa2 + srcPitch / 2; \ - unsigned short int * sa4 = sa3 + srcPitch / 2; \ - \ - if (y <= 1){ \ - sa0 = sa1; \ - if (y == 0){ \ - sa0 = sa1 = sa2; \ - } \ - } \ - \ - if (y >= Yres - 2){ \ - sa4 = sa3; \ - if (y == Yres - 1){ \ - sa4 = sa3 = sa2; \ - } \ - } \ - \ - unsigned char pprev; \ - unsigned char pprev2; \ - pprev = pprev2 = 2; \ - \ - for (int x = 0; x < Xres; x++){ \ - unsigned short B1 = sa0[2]; \ - unsigned short PB = sa1[2]; \ - unsigned short PE = sa2[2]; \ - unsigned short PH = sa3[2]; \ - unsigned short H5 = sa4[2]; \ - \ - unsigned short A1 = sa0[pprev]; \ - unsigned short PA = sa1[pprev]; \ - unsigned short PD = sa2[pprev]; \ - unsigned short PG = sa3[pprev]; \ - unsigned short G5 = sa4[pprev]; \ - \ - unsigned short A0 = sa1[pprev2]; \ - unsigned short D0 = sa2[pprev2]; \ - unsigned short G0 = sa3[pprev2]; \ - \ - unsigned short C1 = 0; \ - unsigned short PC = 0; \ - unsigned short PF = 0; \ - unsigned short PI = 0; \ - unsigned short I5 = 0; \ - \ - unsigned short C4 = 0; \ - unsigned short F4 = 0; \ - unsigned short I4 = 0; \ - \ - if (x >= Xres - 2){ \ - if (x == Xres - 1){ \ - C1 = sa0[2]; \ - PC = sa1[2]; \ - PF = sa2[2]; \ - PI = sa3[2]; \ - I5 = sa4[2]; \ - \ - C4 = sa1[2]; \ - F4 = sa2[2]; \ - I4 = sa3[2]; \ - } else { \ - C1 = sa0[3]; \ - PC = sa1[3]; \ - PF = sa2[3]; \ - PI = sa3[3]; \ - I5 = sa4[3]; \ - \ - C4 = sa1[3]; \ - F4 = sa2[3]; \ - I4 = sa3[3]; \ - } \ - } else { \ - C1 = sa0[3]; \ - PC = sa1[3]; \ - PF = sa2[3]; \ - PI = sa3[3]; \ - I5 = sa4[3]; \ - \ - C4 = sa1[4]; \ - F4 = sa2[4]; \ - I4 = sa3[4]; \ - } \ - \ - unsigned int e, i, px; \ - unsigned int ex, ex2, ex3; \ - unsigned int ke, ki; \ - \ - E[0] = E[1] = E[2] = PE; \ - E[nl] = E[nl+1] = E[nl+2] = PE; \ - E[nl1] = E[nl1+1] = E[nl1+2] = PE; \ - \ - FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, 0, 1, 2, nl, nl+1, nl+2, nl1, nl1+1, nl1+2); \ - FILTRO(PE, PC, PF, PB, PI, PA, PH, PD, PG, I4, A1, I5, H5, A0, D0, B1, C1, F4, C4, G5, G0, nl1, nl, 0, nl1+1, nl+1, 1, nl1+2, nl+2, 2); \ - FILTRO(PE, PA, PB, PD, PC, PG, PF, PH, PI, C1, G0, C4, F4, G5, H5, D0, A0, B1, A1, I4, I5, nl1+2, nl1+1, nl1, nl+2, nl+1, nl, 2, 1, 0); \ - FILTRO(PE, PG, PD, PH, PA, PI, PB, PF, PC, A0, I5, A1, B1, I4, F4, H5, G5, D0, G0, C1, C4, 2, nl+2, nl1+2, 1, nl+1, nl1+1, 0, nl, nl1); \ - \ - sa0 += 1; \ - sa1 += 1; \ - sa2 += 1; \ - sa3 += 1; \ - sa4 += 1; \ - \ - E += 3; \ - \ - if (pprev2){ \ - pprev2--; \ - pprev = 1; \ - } \ - } \ - } \ - -void xbr3x_a(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres) -{ -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N0, N1, N2, N3, N4, N5, N6, N7, N8) \ - ex = (PE!=PH && PE!=PF); \ - if ( ex )\ - {\ - e = (df(PE,PC)+df(PE,PG)+df(PI,H5)+df(PI,F4))+(df(PH,PF)<<2); \ - i = (df(PH,PD)+df(PH,I5)+df(PF,I4)+df(PF,PB))+(df(PE,PI)<<2); \ - if ((e=(ki<<1)) && ex2 ) \ - {\ - LEFT_UP_2_3X(N7, N5, N6, N2, N8, px)\ - }\ - else if ( ((ke<<1)<=ki) && ex3 ) \ - {\ - LEFT_2_3X(N7, N5, N6, N8, px);\ - }\ - else if ( (ke>=(ki<<1)) && ex2 ) \ - {\ - UP_2_3X(N5, N7, N2, N8, px);\ - }\ - else \ - {\ - DIA_3X(N8, N5, N7, px);\ - }\ - }\ - else if (e<=i)\ - {\ - ALPHA_BLEND_128_W( E[N8], ((df(PE,PF) <= df(PE,PH)) ? PF : PH)); \ - }\ - }\ - - xbr3x_do - -#undef FILTRO -} - -void xbr3x_b(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres) -{ -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N0, N1, N2, N3, N4, N5, N6, N7, N8) \ - ex = (PE!=PH && PE!=PF); \ - if ( ex )\ - {\ - e = (df(PE,PC)+df(PE,PG)+df(PI,H5)+df(PI,F4))+(df(PH,PF)<<2); \ - i = (df(PH,PD)+df(PH,I5)+df(PF,I4)+df(PF,PB))+(df(PE,PI)<<2); \ - if ((e=(ki<<1)) && ex2 ) \ - {\ - LEFT_UP_2_3X(N7, N5, N6, N2, N8, px)\ - }\ - else if ( ((ke<<1)<=ki) && ex3 ) \ - {\ - LEFT_2_3X(N7, N5, N6, N8, px);\ - }\ - else if ( (ke>=(ki<<1)) && ex2 ) \ - {\ - UP_2_3X(N5, N7, N2, N8, px);\ - }\ - else \ - {\ - DIA_3X(N8, N5, N7, px);\ - }\ - }\ - else if (e<=i)\ - {\ - ALPHA_BLEND_128_W( E[N8], ((df(PE,PF) <= df(PE,PH)) ? PF : PH)); \ - }\ - }\ - - xbr3x_do - -#undef FILTRO -} - -void xbr3x_c(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres) -{ -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N0, N1, N2, N3, N4, N5, N6, N7, N8) \ - ex = (PE!=PH && PE!=PF); \ - if ( ex )\ - {\ - e = (df(PE,PC)+df(PE,PG)+df(PI,H5)+df(PI,F4))+(df(PH,PF)<<2); \ - i = (df(PH,PD)+df(PH,I5)+df(PF,I4)+df(PF,PB))+(df(PE,PI)<<2); \ - if (e=(ki<<1)) && ex2 ) \ - {\ - LEFT_UP_2_3X(N7, N5, N6, N2, N8, px)\ - }\ - else if ( ((ke<<1)<=ki) && ex3 ) \ - {\ - LEFT_2_3X(N7, N5, N6, N8, px);\ - }\ - else if ( (ke>=(ki<<1)) && ex2 ) \ - {\ - UP_2_3X(N5, N7, N2, N8, px);\ - }\ - else \ - {\ - DIA_3X(N8, N5, N7, px);\ - }\ - }\ - else if (e<=i)\ - {\ - ALPHA_BLEND_128_W( E[N8], ((df(PE,PF) <= df(PE,PH)) ? PF : PH)); \ - }\ - }\ - - xbr3x_do - -#undef FILTRO -} - -#undef xbr3x_do - -#define LEFT_UP_2(N15, N14, N11, N13, N12, N10, N7, N3, PIXEL)\ - ALPHA_BLEND_192_W(E[N13], PIXEL); \ - ALPHA_BLEND_64_W( E[N12], PIXEL); \ - E[N15] = E[N14] = E[N11] = PIXEL; \ - E[N10] = E[N3] = E[N12]; \ - E[N7] = E[N13]; \ - -#define LEFT_2(N15, N14, N11, N13, N12, N10, PIXEL)\ - ALPHA_BLEND_192_W(E[N11], PIXEL); \ - ALPHA_BLEND_192_W(E[N13], PIXEL); \ - ALPHA_BLEND_64_W( E[N10], PIXEL); \ - ALPHA_BLEND_64_W( E[N12], PIXEL); \ - E[N14] = PIXEL; \ - E[N15] = PIXEL; \ - -#define UP_2(N15, N14, N11, N3, N7, N10, PIXEL)\ - ALPHA_BLEND_192_W(E[N14], PIXEL); \ - ALPHA_BLEND_192_W(E[N7 ], PIXEL); \ - ALPHA_BLEND_64_W( E[N10], PIXEL); \ - ALPHA_BLEND_64_W( E[N3 ], PIXEL); \ - E[N11] = PIXEL; \ - E[N15] = PIXEL; \ - -#define DIA(N15, N14, N11, PIXEL)\ - ALPHA_BLEND_128_W(E[N11], PIXEL); \ - ALPHA_BLEND_128_W(E[N14], PIXEL); \ - E[N15] = PIXEL; \ - -#define xbr4x_do \ - initialize(); \ - \ - const int nl = dstPitch / 2; \ - const int nl1 = nl + nl; \ - const int nl2 = nl1 + nl; \ - \ - for (int y = 0; y < Yres; y++){ \ - unsigned short int * E = (unsigned short *)((char*) pOut + y * dstPitch * 4); \ - \ - unsigned short int * sa2 = (unsigned short *)((char*) pIn + y * srcPitch - 4); \ - unsigned short int * sa1 = sa2 - srcPitch / 2; \ - unsigned short int * sa0 = sa1 - srcPitch / 2; \ - unsigned short int * sa3 = sa2 + srcPitch / 2; \ - unsigned short int * sa4 = sa3 + srcPitch / 2; \ - \ - if (y <= 1){ \ - sa0 = sa1; \ - if (y == 0){ \ - sa0 = sa1 = sa2; \ - } \ - } \ - \ - if (y >= Yres - 2){ \ - sa4 = sa3; \ - if (y == Yres - 1){ \ - sa4 = sa3 = sa2; \ - } \ - } \ - \ - unsigned char pprev; \ - unsigned char pprev2; \ - pprev = pprev2 = 2; \ - \ - for (int x = 0; x < Xres; x++){ \ - unsigned short B1 = sa0[2]; \ - unsigned short PB = sa1[2]; \ - unsigned short PE = sa2[2]; \ - unsigned short PH = sa3[2]; \ - unsigned short H5 = sa4[2]; \ - \ - unsigned short A1 = sa0[pprev]; \ - unsigned short PA = sa1[pprev]; \ - unsigned short PD = sa2[pprev]; \ - unsigned short PG = sa3[pprev]; \ - unsigned short G5 = sa4[pprev]; \ - \ - unsigned short A0 = sa1[pprev2]; \ - unsigned short D0 = sa2[pprev2]; \ - unsigned short G0 = sa3[pprev2]; \ - \ - unsigned short C1 = 0; \ - unsigned short PC = 0; \ - unsigned short PF = 0; \ - unsigned short PI = 0; \ - unsigned short I5 = 0; \ - \ - unsigned short C4 = 0; \ - unsigned short F4 = 0; \ - unsigned short I4 = 0; \ - \ - if (x >= Xres - 2){ \ - if (x == Xres - 1){ \ - C1 = sa0[2]; \ - PC = sa1[2]; \ - PF = sa2[2]; \ - PI = sa3[2]; \ - I5 = sa4[2]; \ - \ - C4 = sa1[2]; \ - F4 = sa2[2]; \ - I4 = sa3[2]; \ - } else { \ - C1 = sa0[3]; \ - PC = sa1[3]; \ - PF = sa2[3]; \ - PI = sa3[3]; \ - I5 = sa4[3]; \ - \ - C4 = sa1[3]; \ - F4 = sa2[3]; \ - I4 = sa3[3]; \ - } \ - } else { \ - C1 = sa0[3]; \ - PC = sa1[3]; \ - PF = sa2[3]; \ - PI = sa3[3]; \ - I5 = sa4[3]; \ - \ - C4 = sa1[4]; \ - F4 = sa2[4]; \ - I4 = sa3[4]; \ - } \ - \ - unsigned int e, i, px; \ - unsigned int ex, ex2, ex3; \ - unsigned int ke, ki; \ - \ - E[0] = E[1] = E[2] = E[3] = PE; \ - E[nl] = E[nl+1] = E[nl+2] = E[nl+3] = PE; \ - E[nl1] = E[nl1+1] = E[nl1+2] = E[nl1+3] = PE; \ - E[nl2] = E[nl2+1] = E[nl2+2] = E[nl2+3] = PE; \ - \ - FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, nl2+3, nl2+2, nl1+3, 3, nl+3, nl1+2, nl2+1, nl2, nl1+1, nl+2, 2, 1, nl+1, nl1, nl, 0); \ - FILTRO(PE, PC, PF, PB, PI, PA, PH, PD, PG, I4, A1, I5, H5, A0, D0, B1, C1, F4, C4, G5, G0, 3, nl+3, 2, 0, 1, nl+2, nl1+3, nl2+3, nl1+2, nl+1, nl, nl1, nl1+1,nl2+2,nl2+1,nl2); \ - FILTRO(PE, PA, PB, PD, PC, PG, PF, PH, PI, C1, G0, C4, F4, G5, H5, D0, A0, B1, A1, I4, I5, 0, 1, nl, nl2, nl1, nl+1, 2, 3, nl+2, nl1+1, nl2+1,nl2+2,nl1+2, nl+3,nl1+3,nl2+3); \ - FILTRO(PE, PG, PD, PH, PA, PI, PB, PF, PC, A0, I5, A1, B1, I4, F4, H5, G5, D0, G0, C1, C4, nl2, nl1, nl2+1, nl2+3, nl2+2, nl1+1, nl, 0, nl+1, nl1+2, nl1+3, nl+3, nl+2, 1, 2, 3); \ - \ - sa0 += 1; \ - sa1 += 1; \ - sa2 += 1; \ - sa3 += 1; \ - sa4 += 1; \ - \ - E += 4; \ - \ - if (pprev2){ \ - pprev2--; \ - pprev = 1; \ - } \ - } \ - } \ - - -void xbr4x_a(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres) -{ -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N15, N14, N11, N3, N7, N10, N13, N12, N9, N6, N2, N1, N5, N8, N4, N0) \ - ex = (PE!=PH && PE!=PF); \ - if ( ex )\ - {\ - e = (df(PE,PC)+df(PE,PG)+df(PI,H5)+df(PI,F4))+(df(PH,PF)<<2); \ - i = (df(PH,PD)+df(PH,I5)+df(PF,I4)+df(PF,PB))+(df(PE,PI)<<2); \ - if ((e=(ki<<1)) && ex2 ) \ - {\ - LEFT_UP_2(N15, N14, N11, N13, N12, N10, N7, N3, px)\ - }\ - else if ( ((ke<<1)<=ki) && ex3 ) \ - {\ - LEFT_2(N15, N14, N11, N13, N12, N10, px)\ - }\ - else if ( (ke>=(ki<<1)) && ex2 ) \ - {\ - UP_2(N15, N14, N11, N3, N7, N10, px)\ - }\ - else \ - {\ - DIA(N15, N14, N11, px)\ - }\ - }\ - else if (e<=i)\ - {\ - ALPHA_BLEND_128_W( E[N15], ((df(PE,PF) <= df(PE,PH)) ? PF : PH)); \ - }\ - }\ - - xbr4x_do - -#undef FILTRO -} - -void xbr4x_b(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres) -{ -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N15, N14, N11, N3, N7, N10, N13, N12, N9, N6, N2, N1, N5, N8, N4, N0) \ - ex = (PE!=PH && PE!=PF); \ - if ( ex )\ - {\ - e = (df(PE,PC)+df(PE,PG)+df(PI,H5)+df(PI,F4))+(df(PH,PF)<<2); \ - i = (df(PH,PD)+df(PH,I5)+df(PF,I4)+df(PF,PB))+(df(PE,PI)<<2); \ - if ((e=(ki<<1)) && ex2 ) \ - {\ - LEFT_UP_2(N15, N14, N11, N13, N12, N10, N7, N3, px)\ - }\ - else if ( ((ke<<1)<=ki) && ex3 ) \ - {\ - LEFT_2(N15, N14, N11, N13, N12, N10, px)\ - }\ - else if ( (ke>=(ki<<1)) && ex2 ) \ - {\ - UP_2(N15, N14, N11, N3, N7, N10, px)\ - }\ - else \ - {\ - DIA(N15, N14, N11, px)\ - }\ - }\ - else if (e<=i)\ - {\ - ALPHA_BLEND_128_W( E[N15], ((df(PE,PF) <= df(PE,PH)) ? PF : PH)); \ - }\ - }\ - - xbr4x_do - -#undef FILTRO -} - -void xbr4x_c(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres) -{ -#define FILTRO(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N15, N14, N11, N3, N7, N10, N13, N12, N9, N6, N2, N1, N5, N8, N4, N0) \ - ex = (PE!=PH && PE!=PF); \ - if ( ex )\ - {\ - e = (df(PE,PC)+df(PE,PG)+df(PI,H5)+df(PI,F4))+(df(PH,PF)<<2); \ - i = (df(PH,PD)+df(PH,I5)+df(PF,I4)+df(PF,PB))+(df(PE,PI)<<2); \ - if (e=(ki<<1)) && ex2 ) \ - {\ - LEFT_UP_2(N15, N14, N11, N13, N12, N10, N7, N3, px)\ - }\ - else if ( ((ke<<1)<=ki) && ex3 ) \ - {\ - LEFT_2(N15, N14, N11, N13, N12, N10, px)\ - }\ - else if ( (ke>=(ki<<1)) && ex2 ) \ - {\ - UP_2(N15, N14, N11, N3, N7, N10, px)\ - }\ - else \ - {\ - DIA(N15, N14, N11, px)\ - }\ - }\ - else if (e<=i)\ - {\ - ALPHA_BLEND_128_W( E[N15], ((df(PE,PF) <= df(PE,PH)) ? PF : PH)); \ - }\ - }\ - - xbr4x_do - -#undef FILTRO -} - -#undef xbr4x_do diff --git a/jan/src/intf/video/scalers/xbr.h b/jan/src/intf/video/scalers/xbr.h deleted file mode 100644 index 815fe30ff..000000000 --- a/jan/src/intf/video/scalers/xbr.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _XBR_H -#define _XBR_H - -void xbr2x_a(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres); -void xbr2x_b(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres); -void xbr2x_c(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres); - -void xbr3x_a(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres); -void xbr3x_b(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres); -void xbr3x_c(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres); - -void xbr4x_a(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres); -void xbr4x_b(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres); -void xbr4x_c(unsigned char * pIn, unsigned int srcPitch, unsigned char * pOut, unsigned int dstPitch, int Xres, int Yres); - -#endif diff --git a/jan/src/intf/video/sdl/vid_sdlfx.cpp b/jan/src/intf/video/sdl/vid_sdlfx.cpp deleted file mode 100644 index 7677b41e6..000000000 --- a/jan/src/intf/video/sdl/vid_sdlfx.cpp +++ /dev/null @@ -1,294 +0,0 @@ -// Software blitter effects via SDL -#include "burner.h" -#include "vid_support.h" -#include "vid_softfx.h" - -static int nInitedSubsytems = 0; - -static int nGameWidth = 0, nGameHeight = 0; // screen size -SDL_Surface* sdlsBlitFX[2] = {NULL, }; // The image surfaces -SDL_Surface* sdlsFramebuf = NULL; - -static int nSize; -static int nUseBlitter; - -static int nUseSys; -static int nDirectAccess = 1; -static int nRotateGame = 0; - -static int PrimClear() -{ - SDL_FillRect(sdlsFramebuf, NULL, 0); - - if (nVidFullscreen) { - SDL_Flip(sdlsFramebuf); - SDL_FillRect(sdlsFramebuf, NULL, 0); - } - - return 0; -} - -// Create a secondary DD surface for the screen -static int BlitFXMakeSurf() -{ - sdlsBlitFX[0] = NULL; - sdlsBlitFX[1] = NULL; - - // Try to allocate buffer in Video memory if required, always allocate one in System memory - if (nUseSys == 0) { - sdlsBlitFX[0] = SDL_CreateRGBSurface(SDL_HWSURFACE, nGameWidth * nSize, nGameHeight * nSize, sdlsFramebuf->format->BitsPerPixel, sdlsFramebuf->format->Rmask, sdlsFramebuf->format->Gmask, sdlsFramebuf->format->Bmask, sdlsFramebuf->format->Amask); - if (sdlsBlitFX[0] == NULL) { - nDirectAccess = 0; - nUseSys = 1; - } - } - - if (nDirectAccess == 0) { - sdlsBlitFX[1] = SDL_CreateRGBSurface(SDL_SWSURFACE, nGameWidth * nSize, nGameHeight * nSize, sdlsFramebuf->format->BitsPerPixel, sdlsFramebuf->format->Rmask, sdlsFramebuf->format->Gmask, sdlsFramebuf->format->Bmask, sdlsFramebuf->format->Amask); - if (sdlsBlitFX[1] == NULL) { - return 1; - } - } - - SDL_FillRect(sdlsBlitFX[1 ^ nDirectAccess], NULL, 0); - - return 0; -} - -static int BlitFXExit() -{ - SDL_FreeSurface(sdlsBlitFX[0]); - sdlsBlitFX[0] = NULL; - SDL_FreeSurface(sdlsBlitFX[1]); - sdlsBlitFX[1] = NULL; - - VidSFreeVidImage(); - - nRotateGame = 0; - - return 0; -} - -static int BlitFXInit() -{ - if (nRotateGame & 1) { - nVidImageWidth = nGameHeight; - nVidImageHeight = nGameWidth; - } else { - nVidImageWidth = nGameWidth; - nVidImageHeight = nGameHeight; - } - - if (nUseBlitter >= 7 && nUseBlitter <= 9) { - nVidImageDepth = 16; // Use 565 format - } else { - nVidImageDepth = sdlsFramebuf->format->BitsPerPixel;// Use color depth of primary surface - } - nVidImageBPP = sdlsFramebuf->format->BytesPerPixel; - nBurnBpp = nVidImageBPP; // Set Burn library Bytes per pixel - - // Use our callback to get colors: - SetBurnHighCol(nVidImageDepth); - - // Make the normal memory buffer - if (VidSAllocVidImage()) { - BlitFXExit(); - return 1; - } - - if (BlitFXMakeSurf()) { - BlitFXExit(); - return 1; - } - - return 0; -} - -static int Exit() -{ - BlitFXExit(); - - if (!(nInitedSubsytems & SDL_INIT_VIDEO)) { - SDL_QuitSubSystem(SDL_INIT_VIDEO); - } - nInitedSubsytems = 0; - - return 0; -} - -static int Init() -{ - nInitedSubsytems = SDL_WasInit(SDL_INIT_VIDEO); - - if (!(nInitedSubsytems & SDL_INIT_VIDEO)) { - SDL_InitSubSystem(SDL_INIT_VIDEO); - } - - nUseBlitter = nVidBlitterOpt[nVidSelect] & 0xFF; - - nGameWidth = nVidImageWidth; nGameHeight = nVidImageHeight; - - nRotateGame = 0; - if (bDrvOkay) { - // Get the game screen size - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if (nVidRotationAdjust & 1) { - int n = nGameWidth; - nGameWidth = nGameHeight; - nGameHeight = n; - nRotateGame |= (nVidRotationAdjust & 2); - } else { - nRotateGame |= 1; - } - } - - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - nRotateGame ^= 2; - } - } - - nSize = VidSoftFXGetZoom(nUseBlitter); - bVidScanlines = 0; // !!! - - if (nVidFullscreen) { - - nVidScrnWidth = nVidWidth; nVidScrnHeight = nVidHeight; - - if ((sdlsFramebuf = SDL_SetVideoMode(nVidWidth, nVidHeight, nVidDepth, SDL_HWSURFACE | SDL_ANYFORMAT | SDL_DOUBLEBUF | SDL_FULLSCREEN)) == NULL) { - dprintf(_T("*** Couldn't enter fullscreen mode.\n")); - return 1; - } - } else { - if ((sdlsFramebuf = SDL_SetVideoMode(nGameWidth * nSize, nGameHeight * nSize, 0, SDL_RESIZABLE | SDL_HWSURFACE)) == NULL) { - return 1; - } - } - - SDL_SetClipRect(sdlsFramebuf, NULL); - - // Initialize the buffer surfaces - BlitFXInit(); - - if (VidSoftFXInit(nUseBlitter, nRotateGame)) { - if (VidSoftFXInit(0, nRotateGame)) { - Exit(); - return 1; - } - } - - return 0; -} - -static int vidScale(RECT* , int, int) -{ - return 0; -} - -static int MemToSurf() -{ - VidSoftFXApplyEffectSDL(sdlsBlitFX[1 ^ nDirectAccess]); - - if (nUseSys == 0 && nDirectAccess == 0) { - - // Lock the surface so we can write to it - if (SDL_LockSurface(sdlsBlitFX[1])) { - return 1; - } - unsigned char* Surf = (unsigned char*)sdlsBlitFX[1]->pixels; - int nPitch = sdlsBlitFX[1]->pitch; - - // Lock the surface so we can write to it - if (SDL_LockSurface(sdlsBlitFX[0])) { - return 1; - } - unsigned char* VidSurf = (unsigned char*)sdlsBlitFX[0]->pixels; - int nVidPitch = sdlsBlitFX[0]->pitch; - - unsigned char *pd, *ps; - - int nHeight = nGameHeight * nSize; - - pd = VidSurf; ps = Surf; - for (int y = 0; y < nHeight; y++, pd += nVidPitch, ps += nPitch) { - memcpy(pd, ps, nPitch); - } - - SDL_UnlockSurface(sdlsBlitFX[0]); - SDL_UnlockSurface(sdlsBlitFX[1]); - } - - return 0; -} - -// Run one frame and render the screen -static int Frame(bool bRedraw) // bRedraw = 0 -{ - if (pVidImage == NULL) { - return 1; - } - - if (bDrvOkay) { - if (bRedraw) { // Redraw current frame - if (BurnDrvRedraw()) { - BurnDrvFrame(); // No redraw function provided, advance one frame - } - } else { - BurnDrvFrame(); // Run one frame and draw the screen - } - } - - MemToSurf(); // Copy the memory buffer to the directdraw buffer for later blitting - - return 0; -} - -// Paint the BlitFX surface onto the primary surface -static int Paint(int bValidate) -{ - SDL_Rect sdlrDest = { 0, 0, nGameWidth * nSize, nGameHeight * nSize }; - - if (bValidate & 2) { - MemToSurf(); // Copy the memory buffer to the directdraw buffer for later blitting - } - - if (nVidFullscreen) { - // Double bufferring - - sdlrDest.x = (nVidScrnWidth - nGameWidth * nSize) / 2; - sdlrDest.y = (nVidScrnHeight - nGameHeight * nSize) / 2; - - if (SDL_BlitSurface(sdlsBlitFX[nUseSys], NULL, sdlsFramebuf, &sdlrDest)) { - return 1; - } - SDL_Flip(sdlsFramebuf); - } else { - // Normal - - if (SDL_BlitSurface(sdlsBlitFX[nUseSys], NULL, sdlsFramebuf, &sdlrDest)) { - return 1; - } - SDL_UpdateRect(sdlsFramebuf, 0, 0, 0, 0); - } - - return 0; -} - -static int GetSettings(InterfaceInfo* pInfo) -{ - TCHAR szString[MAX_PATH] = _T(""); - - _sntprintf(szString, MAX_PATH, _T("Prescaling using %s (%i zoom)"), VidSoftFXGetEffect(nUseBlitter), nSize); - IntInfoAddStringModule(pInfo, szString); - - if (nRotateGame) { - IntInfoAddStringModule(pInfo, _T("Using software rotation")); - } - - return 0; -} - -// The Video Output plugin: -struct VidOut VidOutSDLFX = { Init, Exit, Frame, Paint, vidScale, GetSettings, _T("SDL Software Effects video output") }; - diff --git a/jan/src/intf/video/sdl/vid_sdlopengl.cpp b/jan/src/intf/video/sdl/vid_sdlopengl.cpp deleted file mode 100644 index 9c9b10cbb..000000000 --- a/jan/src/intf/video/sdl/vid_sdlopengl.cpp +++ /dev/null @@ -1,378 +0,0 @@ -// OpenGL via SDL -#include "burner.h" -#include "vid_support.h" -#include "vid_softfx.h" - -#include -#include -#include - -#ifdef frame_timer -#include -#endif - -static int nInitedSubsytems = 0; - -static int nGamesWidth = 0, nGamesHeight = 0; // screen size - -static SDL_Surface *screen=NULL; -static unsigned char *texture = NULL; -static unsigned char *gamescreen=NULL; - -static GLint color_type = GL_RGB; -static GLint texture_type = GL_UNSIGNED_BYTE; - -static int nTextureWidth = 512; -static int nTextureHeight = 512; - -static int nSize; -static int nUseBlitter; - -static int nRotateGame = 0; -static bool bFlipped = false; - -static int PrimClear() -{ - return 0; -} - -// Create a secondary DD surface for the screen -static int BlitFXMakeSurf() -{ - return 0; -} - -static int BlitFXExit() -{ - SDL_FreeSurface(screen); - - free(texture); - free(gamescreen); - nRotateGame = 0; - - return 0; -} -static int GetTextureSize(int Size) -{ - int nTextureSize = 128; - - while (nTextureSize < Size) { - nTextureSize <<= 1; - } - - return nTextureSize; -} - -static int BlitFXInit() -{ - int nMemLen = 0; - - nVidImageDepth = bDrvOkay ? 16 : 32; - nVidImageBPP = (nVidImageDepth + 7) >> 3; - nBurnBpp = nVidImageBPP; - - SetBurnHighCol(nVidImageDepth); - - if (!nRotateGame) { - nVidImageWidth = nGamesWidth; - nVidImageHeight = nGamesHeight; - } else { - nVidImageWidth = nGamesHeight; - nVidImageHeight = nGamesWidth; - } - - nVidImagePitch = nVidImageWidth * nVidImageBPP; - nBurnPitch = nVidImagePitch; - - nMemLen = nVidImageWidth * nVidImageHeight * nVidImageBPP; - - printf("nVidImageWidth=%d nVidImageHeight=%d nVidImagePitch=%d\n", - nVidImageWidth, nVidImageHeight, nVidImagePitch); - printf("nTextureWidth=%d nTextureHeight=%d TexturePitch=%d\n", - nTextureWidth, nTextureHeight, nTextureWidth * nVidImageBPP); - - texture = (unsigned char *)malloc(nTextureWidth * nTextureHeight * nVidImageBPP); - - gamescreen = (unsigned char *)malloc(nMemLen); - if (gamescreen) { - memset(gamescreen, 0, nMemLen); - pVidImage = gamescreen; - return 0; - } else { - pVidImage = NULL; - return 1; - } - - return 0; -} - -static int Exit() -{ - BlitFXExit(); - - if (!(nInitedSubsytems & SDL_INIT_VIDEO)) { - SDL_QuitSubSystem(SDL_INIT_VIDEO); - } - - nInitedSubsytems = 0; - - return 0; -} - -void init_gl() -{ - const unsigned char *glVersion; - int isGL12 = GL_FALSE; - - printf("opengl config\n"); - - if ((BurnDrvGetFlags() & BDF_16BIT_ONLY) || (nVidImageBPP != 3)) { - texture_type = GL_UNSIGNED_SHORT_5_6_5; - } else { - texture_type = GL_UNSIGNED_BYTE; - } - - glShadeModel(GL_FLAT); - glDisable(GL_POLYGON_SMOOTH); - glDisable(GL_LINE_SMOOTH); - glDisable(GL_POINT_SMOOTH); - glDisable(GL_BLEND); - glDisable(GL_DEPTH_TEST); - glDepthMask(GL_FALSE); - glDisable(GL_CULL_FACE); - glEnable(GL_TEXTURE_2D); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, nTextureWidth, nTextureHeight, - 0, GL_RGB, texture_type, texture); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - if (!nRotateGame) { - glRotatef(0.0, 0.0, 0.0, 1.0); - glOrtho(0, nGamesWidth, nGamesHeight, 0, -1, 1); - } else { - glRotatef((bFlipped ? 270.0 : 90.0), 0.0, 0.0, 1.0); - glOrtho(0, nGamesHeight, nGamesWidth, 0, -1, 1); - } - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - printf("opengl config done . . . \n"); -} - -int VidSScaleImage(RECT* pRect) -{ - int nScrnWidth, nScrnHeight; - - int nGameAspectX = 4, nGameAspectY = 3; - int nWidth = pRect->right - pRect->left; - int nHeight = pRect->bottom - pRect->top; - - if (bVidFullStretch) { // Arbitrary stretch - return 0; - } - - if (bDrvOkay) { - if ((BurnDrvGetFlags() & (BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED))) { - BurnDrvGetAspect(&nGameAspectY, &nGameAspectX); - } else { - BurnDrvGetAspect(&nGameAspectX, &nGameAspectY); - } - } - - nScrnWidth = nGameAspectX; - nScrnHeight = nGameAspectY; - - int nWidthScratch = nHeight * nVidScrnAspectY * nGameAspectX * nScrnWidth / - (nScrnHeight * nVidScrnAspectX * nGameAspectY); - - if (nWidthScratch > nWidth) { // The image is too wide - if (nGamesWidth < nGamesHeight) { // Vertical games - nHeight = nWidth * nVidScrnAspectY * nGameAspectY * nScrnWidth / - (nScrnHeight * nVidScrnAspectX * nGameAspectX); - } else { // Horizontal games - nHeight = nWidth * nVidScrnAspectX * nGameAspectY * nScrnHeight / - (nScrnWidth * nVidScrnAspectY * nGameAspectX); - } - } else { - nWidth = nWidthScratch; - } - - pRect->left = (pRect->right + pRect->left) / 2; - pRect->left -= nWidth / 2; - pRect->right = pRect->left + nWidth; - - pRect->top = (pRect->top + pRect->bottom) / 2; - pRect->top -= nHeight / 2; - pRect->bottom = pRect->top + nHeight; - - return 0; -} - -static int Init() -{ - nInitedSubsytems = SDL_WasInit(SDL_INIT_VIDEO); - - if (!(nInitedSubsytems & SDL_INIT_VIDEO)) { - SDL_InitSubSystem(SDL_INIT_VIDEO); - } - - nGamesWidth = nVidImageWidth; - nGamesHeight = nVidImageHeight; - - nRotateGame = 0; - - if (bDrvOkay) { - // Get the game screen size - BurnDrvGetVisibleSize(&nGamesWidth, &nGamesHeight); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - printf("Vertical\n"); - nRotateGame = 1; - } - - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - printf("Flipped\n"); - bFlipped = true; - } - } - - if (!nRotateGame) { - nTextureWidth = GetTextureSize(nGamesWidth); - nTextureHeight = GetTextureSize(nGamesHeight); - } else { - nTextureWidth = GetTextureSize(nGamesHeight); - nTextureHeight = GetTextureSize(nGamesWidth); - } - - nSize = 2; - bVidScanlines = 0; - - RECT test_rect; - test_rect.left = 0; - test_rect.right = nGamesWidth; - test_rect.top = 0; - test_rect.bottom = nGamesHeight; - - printf("correctx before %d, %d\n", test_rect.right, test_rect.bottom); - VidSScaleImage(&test_rect); - printf("correctx after %d, %d\n", test_rect.right, test_rect.bottom); - - screen = SDL_SetVideoMode(test_rect.right * nSize, - test_rect.bottom * nSize, 32, SDL_OPENGL); - SDL_WM_SetCaption("FB Alpha", NULL); - - // Initialize the buffer surfaces - BlitFXInit(); - - // Init opengl - init_gl(); - - return 0; -} - -// Run one frame and render the screen -static int Frame(bool bRedraw) // bRedraw = 0 -{ - if (pVidImage == NULL) { - return 1; - } - - if (bDrvOkay) { - if (bRedraw) { // Redraw current frame - if (BurnDrvRedraw()) { - BurnDrvFrame(); // No redraw function provided, advance one frame - } - } else { - BurnDrvFrame(); // Run one frame and draw the screen - } - } - - return 0; -} - -static void SurfToTex() -{ - int nVidPitch = nTextureWidth * nVidImageBPP; - - unsigned char *ps = (unsigned char *)gamescreen; - unsigned char *pd = (unsigned char *)texture; - - for (int y = nVidImageHeight; y--;) { - memcpy(pd, ps, nVidImagePitch); - pd += nVidPitch; - ps += nVidImagePitch; - } - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, nTextureWidth, nTextureHeight, 0, - GL_RGB, texture_type, texture); -} - -static void TexToQuad() -{ - glBegin(GL_QUADS); - glTexCoord2f(0, 0); - glVertex2i(0, 0); - glTexCoord2f(0, 1); - glVertex2i(0, nTextureHeight); - glTexCoord2f(1, 1); - glVertex2i(nTextureWidth, nTextureHeight); - glTexCoord2f(1, 0); - glVertex2i(nTextureWidth, 0); - glEnd(); - glFinish(); - } - -// Paint the BlitFX surface onto the primary surface -static int Paint(int bValidate) -{ -#ifdef frame_timer - timeval start, end; - time_t sec; - suseconds_t usec; - gettimeofday(&start, NULL); -#endif - SurfToTex(); - TexToQuad(); - SDL_GL_SwapBuffers(); - -#ifdef frame_timer - gettimeofday(&end, NULL); - sec = end.tv_sec - start.tv_sec; - usec = end.tv_usec - start.tv_usec; - if (usec < 0) { - usec += 1000000; - sec--; - } - printf("Elapsed time : %ld.%ld\n", sec, usec); -#endif - - return 0; -} - -static int vidScale(RECT *, int, int) -{ - return 0; -} - - -static int GetSettings(InterfaceInfo *pInfo) -{ - TCHAR szString[MAX_PATH] = _T(""); - - _sntprintf(szString, MAX_PATH, _T("Prescaling using %s (%i zoom)"), - VidSoftFXGetEffect(nUseBlitter), nSize); - IntInfoAddStringModule(pInfo, szString); - - if (nRotateGame) { - IntInfoAddStringModule(pInfo, _T("Using software rotation")); - } - - return 0; -} - -// The Video Output plugin: -struct VidOut VidOutSDLOpenGL = { Init, Exit, Frame, Paint, vidScale, GetSettings, _T("SDL OpenGL Video output") }; diff --git a/jan/src/intf/video/vid_interface.cpp b/jan/src/intf/video/vid_interface.cpp deleted file mode 100644 index 8d112d1e7..000000000 --- a/jan/src/intf/video/vid_interface.cpp +++ /dev/null @@ -1,488 +0,0 @@ -// Video Output - (calls all the Vid Out plugins) -#include "burner.h" - -#define DEFAULT_IMAGE_WIDTH (304) -#define DEFAULT_IMAGE_HEIGHT (224) - -#define ENABLE_PREVIEW - -#if defined (BUILD_WIN32) - extern struct VidOut VidOutDDraw; - extern struct VidOut VidOutD3D; - extern struct VidOut VidOutDDrawFX; - extern struct VidOut VidOutDX9; - extern struct VidOut VidOutDX9Alt; -#elif defined (BUILD_SDL) - extern struct VidOut VidOutSDLOpenGL; - extern struct VidOut VidOutSDLFX; -#elif defined (_XBOX) - extern struct VidOut VidOutD3D; -#elif defined (BUILD_QT) - extern struct VidOut VidOutOGL; -#endif - -static struct VidOut *pVidOut[] = { -#if defined (BUILD_WIN32) - &VidOutDDraw, - &VidOutD3D, - &VidOutDDrawFX, - &VidOutDX9, - &VidOutDX9Alt, -#elif defined (BUILD_SDL) - &VidOutSDLOpenGL, - &VidOutSDLFX, -#elif defined (_XBOX) - &VidOutD3D, -#elif defined (BUILD_QT) - &VidOutOGL, -#endif -}; - -#define VID_LEN (sizeof(pVidOut) / sizeof(pVidOut[0])) - -INT64 nVidBlitterOpt[VID_LEN] = {0, }; // Options for the blitter module (meaning depens on module) - -static InterfaceInfo VidInfo = { NULL, NULL, NULL }; - -#if defined (BUILD_WIN32) -#if defined BUILD_X64_EXE -// set DDraw blitter as default for 64-bit builds (in case user doesn't have DX redistributable installed) -UINT32 nVidSelect = 0; // Which video output is selected -#else -// sec D3D7 Enhanced blitter as default -UINT32 nVidSelect = 1; // Which video output is selected -#endif -#else -UINT32 nVidSelect = 0; // Which video output is selected -#endif - -static UINT32 nVidActive = 0; - -bool bVidOkay = false; - -INT32 nVidWidth = 640, nVidHeight = 480, nVidDepth = 32, nVidRefresh = 0; - -INT32 nVidHorWidth = 640, nVidHorHeight = 480; // Default Horizontal oritated resolution -INT32 nVidVerWidth = 640, nVidVerHeight = 480; // Default Vertical oriented resoultion - -INT32 nVidFullscreen = 0; -INT32 bVidFullStretch = 0; // 1 = stretch to fill the entire window/screen -INT32 bVidCorrectAspect = 1; // 1 = stretch to fill the window/screen while maintaining the correct aspect ratio -INT32 bVidVSync = 0; // 1 = sync blits/pageflips/presents to the screen -INT32 bVidTripleBuffer = 0; // 1 = use triple buffering -INT32 bVidBilinear = 1; // 1 = enable bi-linear filtering (D3D blitter) -INT32 bVidScanlines = 0; // 1 = draw scanlines -INT32 bVidScanRotate = 1; // 1 = rotate scanlines and RGB effects for rotated games -INT32 bVidScanBilinear = 1; // 1 = use bi-linear filtering for scanlines (D3D blitter, debug variable) -INT32 nVidScanIntensity = 0x00BFBFBF; // The maximum colour-value for the scanlines (D3D blitter) -INT32 bVidScanHalf = 1; // Draw scanlines at half intensity instead of black (DDraw blitter) -INT32 bVidScanDelay = 0; // Blend the previous image with the current one -INT32 nVidFeedbackIntensity = 0x40; // Blend factor for previous frame (D3D blitter) -INT32 nVidFeedbackOverSaturation = 0x00; // Add this to the current frame blend factor -INT32 bVidUseHardwareGamma = 1; // Use the video hardware when correcting gamma -INT32 bVidAutoSwitchFull = 0; // 1 = auto switch to fullscreen on loading driver -INT32 bVidArcaderes = 0; // Use game resolution for fullscreen modes - -INT32 bVidArcaderesHor = 0; -INT32 bVidArcaderesVer = 0; - -INT32 nVidRotationAdjust = 0; // & 1: do not rotate the graphics for vertical games, & 2: Reverse flipping for vertical games -INT32 bVidForce16bit = 0; // Emulate the game in 16-bit even when the screen is 32-bit (D3D blitter) -INT32 bVidForce16bitDx9Alt = 0; // Emulate the game in 16-bit even when the screen is 32-bit (DX9 Alt blitter) -INT32 bVidForceFlip = 1; // Force flipping (DDraw blitter, hardware detection seems to fail on all? graphics hardware) -INT32 nVidTransferMethod = -1; // How to transfer the game image to video memory and/or a texture -- - // 0 = blit from system memory / use driver/DirectX texture management - // 1 = copy to a video memory surface, then use bltfast() - // -1 = autodetect for ddraw, equals 1 for d3d -float fVidScreenAngle = 0.174533f; // The angle at which to tilt the screen backwards (in radians, D3D blitter) -float fVidScreenCurvature = 0.698132f; // The angle of the maximum screen curvature (in radians, D3D blitter) -double dVidCubicB = 0.0; // Paremeters for the cubic filter (default is the CAtmull-Rom spline, DX9 blitter) -double dVidCubicC = 0.5; // - -INT32 bVidDX9Bilinear = 1; // 1 = enable bi-linear filtering (D3D9 Alt blitter) -INT32 bVidHardwareVertex = 0; // 1 = use hardware vertex processing -INT32 bVidMotionBlur = 0; // 1 = motion blur - -wchar_t HorScreen[32] = L""; -wchar_t VerScreen[32] = L""; - -#ifdef BUILD_WIN32 - HWND hVidWnd = NULL; // Actual window used for video -#endif - -#if defined (_XBOX) - HWND hVidWnd = NULL; // Actual window used for video -#endif - -INT32 nVidScrnWidth = 0, nVidScrnHeight = 0; // Actual Screen dimensions (0 if in windowed mode) -INT32 nVidScrnDepth = 0; // Actual screen depth - -INT32 nVidScrnAspectX = 4, nVidScrnAspectY = 3; // Aspect ratio of the display screen - -UINT8* pVidImage = NULL; // Memory buffer -INT32 nVidImageWidth = DEFAULT_IMAGE_WIDTH; // Memory buffer size -INT32 nVidImageHeight = DEFAULT_IMAGE_HEIGHT; // -INT32 nVidImageLeft = 0, nVidImageTop = 0; // Memory buffer visible area offsets -INT32 nVidImagePitch = 0, nVidImageBPP = 0; // Memory buffer pitch and bytes per pixel -INT32 nVidImageDepth = 0; // Memory buffer bits per pixel - -UINT32 (__cdecl *VidHighCol) (INT32 r, INT32 g, INT32 b, INT32 i); -static bool bVidRecalcPalette; - -static UINT8* pVidTransImage = NULL; -static UINT32* pVidTransPalette = NULL; -static INT32 bSkipNextFrame = 0; - -static UINT32 __cdecl HighCol15(INT32 r, INT32 g, INT32 b, INT32 /* i */) -{ - UINT32 t; - - t = (r << 7) & 0x7C00; - t |= (g << 2) & 0x03E0; - t |= (b >> 3) & 0x001F; - - return t; -} - -INT32 VidSelect(UINT32 nPlugin) -{ - if (nPlugin < VID_LEN) { - nVidSelect = nPlugin; - return 0; - } else { - return 1; - } -} - -// Forward to VidOut functions -INT32 VidInit() -{ -#if defined (BUILD_WIN32) && defined (ENABLE_PREVIEW) - HBITMAP hbitmap = NULL; - BITMAP bitmap; -#endif - - INT32 nRet = 1; - - VidExit(); - -#if defined (BUILD_WIN32) && defined (ENABLE_PREVIEW) - if (!bDrvOkay) { - //hbitmap = (HBITMAP)LoadImage(hAppInst, _T("BMP_SPLASH"), IMAGE_BITMAP, 304, 224, 0); - hbitmap = (HBITMAP)LoadImage(hAppInst, MAKEINTRESOURCE(BMP_SPLASH), IMAGE_BITMAP, 304, 224, 0); - - GetObject(hbitmap, sizeof(BITMAP), &bitmap); - - nVidImageWidth = bitmap.bmWidth; nVidImageHeight = bitmap.bmHeight; - nVidImageLeft = nVidImageTop = 0; - } -#endif - -#if defined (BUILD_WIN32) && defined (ENABLE_PREVIEW) - if ((nVidSelect < VID_LEN) && (bDrvOkay || hbitmap)) { -#else - if ((nVidSelect < VID_LEN) && bDrvOkay) { -#endif - nVidActive = nVidSelect; - if ((nRet = pVidOut[nVidActive]->Init()) == 0) { - nBurnBpp = nVidImageBPP; // Set Burn library Bytes per pixel - - bVidOkay = true; - - if (bDrvOkay && (BurnDrvGetFlags() & BDF_16BIT_ONLY) && nVidImageBPP > 2) { - nBurnBpp = 2; - - pVidTransPalette = (UINT32*)malloc(32768 * sizeof(UINT32)); - pVidTransImage = (UINT8*)malloc(nVidImageWidth * nVidImageHeight * sizeof(INT16)); - - BurnHighCol = HighCol15; - - if (pVidTransPalette == NULL || pVidTransImage == NULL) { - VidExit(); - nRet = 1; - } - } - } - } - -#if defined (BUILD_WIN32) && defined (ENABLE_PREVIEW) - if (bVidOkay && hbitmap) { - BITMAPINFO bitmapinfo; - UINT8* pLineBuffer = (UINT8*)malloc(bitmap.bmWidth * 4); - HDC hDC = GetDC(hVidWnd); - - if (hDC && pLineBuffer) { - - memset(&bitmapinfo, 0, sizeof(BITMAPINFO)); - bitmapinfo.bmiHeader.biSize = sizeof(BITMAPINFO); - bitmapinfo.bmiHeader.biWidth = bitmap.bmWidth; - bitmapinfo.bmiHeader.biHeight = bitmap.bmHeight; - bitmapinfo.bmiHeader.biPlanes = 1; - bitmapinfo.bmiHeader.biBitCount = 24; - bitmapinfo.bmiHeader.biCompression = BI_RGB; - - for (INT32 y = 0; y < nVidImageHeight; y++) { - UINT8* pd = pVidImage + y * nVidImagePitch; - UINT8* ps = pLineBuffer; - - GetDIBits(hDC, hbitmap, nVidImageHeight - 1 - y, 1, ps, &bitmapinfo, DIB_RGB_COLORS); - - for (INT32 x = 0; x < nVidImageWidth; x++, ps += 3) { - UINT32 nColour = VidHighCol(ps[2], ps[1], ps[0], 0); - switch (nVidImageBPP) { - case 2: - *((UINT16*)pd) = (UINT16)nColour; - pd += 2; - break; - case 3: - pd[0] = (nColour >> 16) & 0xFF; - ps[1] = (nColour >> 8) & 0xFF; - pd[2] = (nColour >> 0) & 0xFF; - pd += 3; - break; - case 4: - *((UINT32*)pd) = nColour; - pd += 4; - break; - } - } - } - } - if (hDC) { - ReleaseDC(hVidWnd, hDC); - } - if (pLineBuffer) { - free(pLineBuffer); - pLineBuffer = NULL; - } - } - - if (hbitmap) { - DeleteObject(hbitmap); - } -#endif - - return nRet; -} - -INT32 VidExit() -{ - IntInfoFree(&VidInfo); - - if (bVidOkay) { - INT32 nRet = pVidOut[nVidActive]->Exit(); - -#if defined (BUILD_WIN32) - hVidWnd = NULL; -#endif - - bVidOkay = false; - - nVidImageWidth = DEFAULT_IMAGE_WIDTH; nVidImageHeight = DEFAULT_IMAGE_HEIGHT; - - nVidImageBPP = nVidImageDepth = 0; - nBurnPitch = nBurnBpp = 0; - - if (pVidTransPalette) { - free(pVidTransPalette); - pVidTransPalette = NULL; - } - if (pVidTransImage) { - free(pVidTransImage); - pVidTransImage = NULL; - } - - return nRet; - } else { - return 1; - } -} - -static INT32 VidDoFrame(bool bRedraw) -{ - INT32 nRet; - - if (pVidTransImage && pVidTransPalette) { - UINT16* pSrc = (UINT16*)pVidTransImage; - UINT8* pDest = pVidImage; - - if (bVidRecalcPalette) { - for (INT32 r = 0; r < 256; r += 8) { - for (INT32 g = 0; g < 256; g += 8) { - for (INT32 b = 0; b < 256; b += 8) { - pVidTransPalette[(r << 7) | (g << 2) | (b >> 3)] = VidHighCol(r | (r >> 5), g | (g >> 5), b | (b >> 5), 0); - } - } - } - - bVidRecalcPalette = false; - } - - pBurnDraw = pVidTransImage; - nBurnPitch = nVidImageWidth * 2; - - nRet = pVidOut[nVidActive]->Frame(bRedraw); - - if (bSkipNextFrame) { - // if ReInitialise(); is called from the machine's reset function, it will crash below. This prevents that from happening. (Megadrive) - bSkipNextFrame = 0; - return 0; - } - - pBurnDraw = NULL; - nBurnPitch = 0; - - switch (nVidImageBPP) { - case 3: { - for (INT32 y = 0; y < nVidImageHeight; y++, pSrc += nVidImageWidth, pDest += nVidImagePitch) { - for (INT32 x = 0; x < nVidImageWidth; x++) { - UINT32 c = pVidTransPalette[pSrc[x]]; - *(pDest + (x * 3) + 0) = c & 0xFF; - *(pDest + (x * 3) + 1) = (c >> 8) & 0xFF; - *(pDest + (x * 3) + 2) = c >> 16; - } - } - break; - } - case 4: { - for (INT32 y = 0; y < nVidImageHeight; y++, pSrc += nVidImageWidth, pDest += nVidImagePitch) { - for (INT32 x = 0; x < nVidImageWidth; x++) { - ((UINT32*)pDest)[x] = pVidTransPalette[pSrc[x]]; - } - } - break; - } - } - } else { - pBurnDraw = pVidImage; - nBurnPitch = nVidImagePitch; - - nRet = pVidOut[nVidActive]->Frame(bRedraw); - - pBurnDraw = NULL; - nBurnPitch = 0; - } - - return nRet; -} - -INT32 VidReInitialise() -{ - if (pVidTransImage) { - free(pVidTransImage); - pVidTransImage = NULL; - } - pVidTransImage = (UINT8*)malloc(nVidImageWidth * nVidImageHeight * sizeof(INT16)); - bSkipNextFrame = 1; - - return 0; -} - -INT32 VidFrame() -{ - if (bVidOkay && bDrvOkay) { - return VidDoFrame(0); - } else { - return 1; - } -} - -INT32 VidRedraw() -{ - if (bVidOkay /* && bDrvOkay */) { - return VidDoFrame(1); - } else { - return 1; - } -} - -INT32 VidRecalcPal() -{ - bVidRecalcPalette = true; - - return BurnRecalcPal(); -} - -// If bValidate & 1, the video code should use ValidateRect() to validate the rectangle it draws. -INT32 VidPaint(INT32 bValidate) -{ - if (bVidOkay /* && bDrvOkay */) { - return pVidOut[nVidActive]->Paint(bValidate); - } else { - return 1; - } -} - -INT32 VidImageSize(RECT* pRect, INT32 nGameWidth, INT32 nGameHeight) -{ - if (bVidOkay) { - return pVidOut[nVidActive]->ImageSize(pRect, nGameWidth, nGameHeight); - } else { - return pVidOut[nVidSelect]->ImageSize(pRect, nGameWidth, nGameHeight); - } -} - -const TCHAR* VidGetModuleName() -{ - const TCHAR* pszName = NULL; - - if (bVidOkay) { - pszName = pVidOut[nVidActive]->szModuleName; - } else { - pszName = pVidOut[nVidSelect]->szModuleName; - } - - if (pszName) { - return pszName; - } -#if defined (BUILD_WIN32) - return FBALoadStringEx(hAppInst, IDS_ERR_UNKNOWN, true); -#else - return "There was an error with the video"; -#endif -} - -InterfaceInfo* VidGetInfo() -{ - if (IntInfoInit(&VidInfo)) { - IntInfoFree(&VidInfo); - return NULL; - } - - if (bVidOkay) { - TCHAR szString[MAX_PATH] = _T(""); - RECT rect; - - VidInfo.pszModuleName = pVidOut[nVidActive]->szModuleName; - -#if defined (BUILD_WIN32) - GetClientScreenRect(hVidWnd, &rect); - if (nVidFullscreen == 0) { - rect.top += nMenuHeight; - _sntprintf(szString, MAX_PATH, _T("Running in windowed mode, $ix%i, %ibpp"), rect.right - rect.left, rect.bottom - rect.top, nVidScrnDepth); - } else { - _sntprintf(szString, MAX_PATH, _T("Running fullscreen, $ix$i, %ibpp"), nVidScrnWidth, nVidScrnHeight, nVidScrnDepth); - } -#elif defined (BUILD_SDL) - _sntprintf(szString, MAX_PATH, _T("Filler for fullscreen/windowed mode & image size")); -#endif - - IntInfoAddStringInterface(&VidInfo, szString); - - _sntprintf(szString, MAX_PATH, _T("Source image %ix%i, %ibpp"), nVidImageWidth, nVidImageHeight, nVidImageDepth); - IntInfoAddStringInterface(&VidInfo, szString); - - if (pVidTransImage) { - _sntprintf(szString, MAX_PATH, _T("Using generic software 15->%ibpp wrapper"), nVidImageDepth); - IntInfoAddStringInterface(&VidInfo, szString); - } - - if (pVidOut[nVidActive]->GetPluginSettings) { - pVidOut[nVidActive]->GetPluginSettings(&VidInfo); - } - } else { - IntInfoAddStringInterface(&VidInfo, _T("Video plugin not initialised")); - } - - return &VidInfo; -} diff --git a/jan/src/intf/video/vid_softfx.cpp b/jan/src/intf/video/vid_softfx.cpp deleted file mode 100644 index 66c508778..000000000 --- a/jan/src/intf/video/vid_softfx.cpp +++ /dev/null @@ -1,1006 +0,0 @@ -// Software blitter effects - -#include "burner.h" -#include "vid_softfx.h" -#include "xbr.h" - -typedef unsigned long uint32; -typedef unsigned short uint16; -typedef unsigned char uint8; - -#ifndef _WIN32 -#ifndef WITH_QTCREATOR - typedef unsigned long DWORD; -#endif -#endif - -void _2xpm_lq(void *SrcPtr, void *DstPtr, unsigned long SrcPitch, unsigned long DstPitch, unsigned long SrcW, unsigned long SrcH, int nDepth); -void _2xpm_hq(void *SrcPtr, void *DstPtr, unsigned long SrcPitch, unsigned long DstPitch, unsigned long SrcW, unsigned long SrcH, int nDepth); - -extern void hq2xS_init(unsigned bits_per_pixel); -extern void hq2xS(unsigned char*, unsigned int, unsigned char*, unsigned char*, unsigned int, int, int); -extern void hq2xS32(unsigned char*, unsigned int, unsigned char*, unsigned char*, unsigned int, int, int); -#if defined _MSC_VER && defined BUILD_X86_ASM -extern void hq3xS(unsigned char*,unsigned int,unsigned char*,unsigned char*,unsigned int,int,int); -extern void hq3xS32(unsigned char*,unsigned int,unsigned char*,unsigned char*,unsigned int,int,int); -#endif - -extern int Init_2xSaI(unsigned int BitFormat, unsigned int systemColorDepth); -extern void _2xSaI32(unsigned char*, unsigned int, unsigned char*, unsigned char*, unsigned int, int, int); -extern void Super2xSaI32(unsigned char*, unsigned int, unsigned char*, unsigned char*, unsigned int, int, int); -extern void SuperEagle32(unsigned char*, unsigned int, unsigned char*, unsigned char*, unsigned int, int, int); - -extern void InitLUTs(); -extern void RenderHQ2XS(unsigned char*, unsigned int, unsigned char*, unsigned int, int, int, int type); -extern void RenderHQ3XS(unsigned char*, unsigned int, unsigned char*, unsigned int, int, int, int type); - -void RenderEPXB(unsigned char*, unsigned int, unsigned char*, unsigned int, int, int, int); -void RenderEPXC(unsigned char*, unsigned int, unsigned char*, unsigned int, int, int, int); - -void ddt3x(unsigned char * src, unsigned int srcPitch, unsigned char * dest, unsigned int dstPitch, int Xres, int Yres); - -#if defined __GNUC__ - #include "scale2x.h" -#elif defined _MSC_VER && defined BUILD_X86_ASM - #include "scale2x_vc.h" - #define scale2x_16_mmx internal_scale2x_16_mmx - #define scale2x_32_mmx internal_scale2x_32_mmx -#endif -#include "scale3x.h" - -#if defined BUILD_X86_ASM -extern "C" void __cdecl superscale_line(UINT16 *src0, UINT16 *src1, UINT16 *src2, UINT16 *dst, UINT32 width, UINT64 *mask); -extern "C" void __cdecl superscale_line_75(UINT16 *src0, UINT16 *src1, UINT16 *src2, UINT16 *dst, UINT32 width, UINT64 *mask); - -#ifdef __ELF__ - #define LUT16to32 _LUT16to32 - #define RGBtoYUV _RGBtoYUV - #define hq2x_32 _hq2x_32 - #define hq3x_32 _hq3x_32 - #define hq4x_32 _hq4x_32 -#endif - -extern "C" void __cdecl _eagle_mmx16(unsigned long* lb, unsigned long* lb2, short width, unsigned long* screen_address1, unsigned long* screen_address2); - -extern "C" void __cdecl _2xSaISuperEagleLine(uint8* srcPtr, uint8* deltaPtr, uint32 srcPitch, uint32 width, uint8* dstPtr, uint32 dstPitch, uint16 dstBlah); -extern "C" void __cdecl _2xSaILine(uint8* srcPtr, uint8* deltaPtr, uint32 srcPitch, uint32 width, uint8* dstPtr, uint32 dstPitch, uint16 dstBlah); -extern "C" void __cdecl _2xSaISuper2xSaILine(uint8* srcPtr, uint8* deltaPtr, uint32 srcPitch, uint32 width, uint8* dstPtr, uint32 dstPitch, uint16 dstBlah); -extern "C" void __cdecl Init_2xSaIMMX(uint32 BitFormat); - -extern "C" { - void __cdecl hq2x_32(unsigned char*, unsigned char*, DWORD, DWORD, DWORD); - void __cdecl hq3x_32(unsigned char*, unsigned char*, DWORD, DWORD, DWORD); - void __cdecl hq4x_32(unsigned char*, unsigned char*, DWORD, DWORD, DWORD); - - unsigned int LUT16to32[65536]; - unsigned int RGBtoYUV[65536]; -} -#endif - -#define FXF_MMX (unsigned int)(1 << 31) - -static struct { TCHAR* pszName; int nZoom; unsigned int nFlags; } SoftFXInfo[] = { - { _T("Plain Software Scale"), 2, 0 }, - { _T("AdvanceMAME Scale2x"), 2, FXF_MMX }, - { _T("AdvanceMAME Scale3x"), 3, 0 }, - { _T("2xPM LQ"), 2, FXF_MMX }, - { _T("2xPM HQ"), 2, FXF_MMX }, - { _T("Eagle Graphics"), 2, FXF_MMX }, - { _T("SuperEagle"), 2, FXF_MMX }, - { _T("2xSaI"), 2, FXF_MMX }, - { _T("Super 2xSaI"), 2, FXF_MMX }, - { _T("SuperEagle (VBA)"), 2, FXF_MMX }, - { _T("2xSaI (VBA)"), 2, FXF_MMX }, - { _T("Super 2xSaI (VBA)"), 2, FXF_MMX }, - { _T("SuperScale"), 2, FXF_MMX }, - { _T("SuperScale (75% Scanlines)"), 2, FXF_MMX }, - { _T("hq2x Filter"), 2, FXF_MMX }, - { _T("hq3x Filter"), 3, FXF_MMX }, - { _T("hq4x Filter"), 4, FXF_MMX }, - { _T("hq2xS (VBA) Filter"), 2, 0 }, - { _T("hq3xS (VBA) Filter"), 3, FXF_MMX }, - { _T("hq2xS (SNES9X) Filter"), 2, FXF_MMX }, - { _T("hq3xS (SNEX9X) Filter"), 3, FXF_MMX }, - { _T("hq2xBold Filter"), 2, FXF_MMX }, - { _T("hq3xBold Filter"), 3, FXF_MMX }, - { _T("EPXB Filter"), 2, FXF_MMX }, - { _T("EPXC Filter"), 2, FXF_MMX }, - { _T("2xBR (Squared) Filter"), 2, FXF_MMX }, - { _T("2xBR (Semi-Rounded) Filter"), 2, FXF_MMX }, - { _T("2xBR (Rounded) Filter"), 2, FXF_MMX }, - { _T("3xBR (Squared) Filter"), 3, FXF_MMX }, - { _T("3xBR (Semi-Rounded) Filter"), 3, FXF_MMX }, - { _T("3xBR (Rounded) Filter"), 3, FXF_MMX }, - { _T("4xBR (Squared) Filter"), 4, FXF_MMX }, - { _T("4xBR (Semi-Rounded) Filter"), 4, FXF_MMX }, - { _T("4xBR (Rounded) Filter"), 4, FXF_MMX }, - { _T("DDT3x"), 3, FXF_MMX }, -}; - -static unsigned char* pSoftFXImage = NULL; -static int nSoftFXImageWidth = 0; -static int nSoftFXImageHeight = 0; -static int nSoftFXImagePitch = 0; - -static unsigned char* pSoftFXXBuffer = NULL; - -static int nSoftFXRotate = 0; -static int nSoftFXBlitter = 0; -static bool nSoftFXEnlarge = 0; - -static bool MMXSupport() -{ -#if defined BUILD_X86_ASM - unsigned int nSignatureEAX = 0, nSignatureEBX = 0, nSignatureECX = 0, nSignatureEDX = 0; - - CPUID(1, nSignatureEAX, nSignatureEBX, nSignatureECX, nSignatureEDX); - - return (nSignatureEDX >> 23) & 1; // bit 23 of edx ndicates MMX support -#else - return 0; -#endif -} - -TCHAR* VidSoftFXGetEffect(int nEffect) -{ - return SoftFXInfo[nEffect].pszName; -} - -int VidSoftFXGetZoom(int nEffect) -{ - return SoftFXInfo[nEffect].nZoom; -} - -int VidSoftFXCheckDepth(int nEffect, int nDepth) -{ - switch (nEffect) { - case FILTER_PLAIN: - return nDepth; - case FILTER_ADVMAME_SCALE_2X: - case FILTER_ADVMAME_SCALE_3X: - case FILTER_HQ2XS_VBA: - case FILTER_HQ3XS_VBA: - if (nDepth == 16 || nDepth == 32) { - return nDepth; - } - break; - case FILTER_EAGLE: - case FILTER_HQ2XS_SNES9X: - case FILTER_HQ3XS_SNES9X: - case FILTER_HQ2XBOLD: - case FILTER_HQ3XBOLD: - case FILTER_EPXB: - case FILTER_EPXC: - case FILTER_2XBR_A: - case FILTER_2XBR_B: - case FILTER_2XBR_C: - case FILTER_3XBR_A: - case FILTER_3XBR_B: - case FILTER_3XBR_C: - case FILTER_4XBR_A: - case FILTER_4XBR_B: - case FILTER_4XBR_C: - case FILTER_DDT3X: - if (nDepth == 16) { - return nDepth; - } - break; - case FILTER_2XPM_LQ: - case FILTER_2XPM_HQ: - case FILTER_SUPEREAGLE: - case FILTER_2XSAI: - case FILTER_SUPER_2XSAI: - case FILTER_SUPERSCALE: - case FILTER_SUPERSCALE_75SCAN: - if (nDepth == 15 || nDepth == 16) { - return nDepth; - } - break; - case FILTER_SUPEREAGLE_VBA: - case FILTER_2XSAI_VBA: - case FILTER_SUPER_2XSAI_VBA: - if (nDepth == 15 || nDepth == 16 || nDepth == 32) { - return nDepth; - } - break; - case FILTER_HQ2X: - case FILTER_HQ3X: - case FILTER_HQ4X: - if (nDepth == 15 || nDepth == 16) { - return 32; - } - break; - } - - return 0; -} - -void VidSoftFXExit() -{ - if (pSoftFXXBuffer) { - free(pSoftFXXBuffer); - pSoftFXXBuffer = NULL; - } - - if (nSoftFXRotate) { - free(pSoftFXImage); - pSoftFXImage = NULL; - } - pSoftFXImage = NULL; - - nSoftFXRotate = 0; - nSoftFXEnlarge = 0; - nSoftFXBlitter = 0; - - return; -} - -int VidSoftFXInit(int nBlitter, int nRotate) -{ - nSoftFXBlitter = nBlitter; - nSoftFXEnlarge = true; - - if ((MMXSupport() == false && (SoftFXInfo[nSoftFXBlitter].nFlags & FXF_MMX)) || VidSoftFXCheckDepth(nSoftFXBlitter, nVidImageDepth) == 0) { - VidSoftFXExit(); - return 1; - } - - pSoftFXImage = pVidImage + nVidImageLeft * nVidImageBPP; - - nSoftFXImageWidth = nVidImageWidth; nSoftFXImageHeight = nVidImageHeight; - - nSoftFXRotate = 0; - if (bDrvOkay) { - BurnDrvGetFullSize(&nSoftFXImageWidth, &nSoftFXImageHeight); - - if ((nRotate & 1) && (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL)) { - nSoftFXRotate |= 1; - - BurnDrvGetFullSize(&nSoftFXImageHeight, &nSoftFXImageWidth); - } - - if ((nRotate & 2) && (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED)) { - nSoftFXRotate |= 2; - } - - if (nSoftFXRotate) { - pSoftFXImage = (unsigned char*)malloc(nSoftFXImageWidth * nSoftFXImageHeight * nVidImageBPP); - if (pSoftFXImage == NULL) { - VidSoftFXExit(); - return 1; - } - } - } - nSoftFXImagePitch = nSoftFXImageWidth * nVidImageBPP; - - if (nSoftFXBlitter >= FILTER_SUPEREAGLE && nSoftFXBlitter <= FILTER_SUPER_2XSAI) { // Initialize the 2xSaI engine - pSoftFXXBuffer = (unsigned char*)malloc((nSoftFXImageHeight + 2) * nSoftFXImagePitch); - if (pSoftFXXBuffer == NULL) { - VidSoftFXExit(); - return 1; - } - - memset(pSoftFXXBuffer, 0, (nSoftFXImageHeight + 2) * nSoftFXImagePitch); - -#if defined BUILD_X86_ASM - if (nVidImageDepth == 15) { - Init_2xSaIMMX(555); - } else { - Init_2xSaIMMX(565); - } -#endif - } - - if (nSoftFXBlitter >= FILTER_SUPEREAGLE_VBA && nSoftFXBlitter <= FILTER_SUPER_2XSAI_VBA) { - int nMemLen = (nSoftFXImageHeight + /*2*/4) * nSoftFXImagePitch; - pSoftFXXBuffer = (unsigned char*)malloc(nMemLen); - if (pSoftFXXBuffer == NULL) { - VidSoftFXExit(); - return 1; - } - - memset(pSoftFXXBuffer, 0, nMemLen); - -#if defined BUILD_X86_ASM - if (nVidImageDepth == 15) { - Init_2xSaIMMX(555); - } - else if (nVidImageDepth == 16) { - Init_2xSaIMMX(565); - } - else { - Init_2xSaI(565, 32); // 32 bit - } -#endif - } - -#if defined BUILD_X86_ASM - if (nSoftFXBlitter >= FILTER_HQ2X && nSoftFXBlitter <= FILTER_HQ4X) { - int i, j, k, r, g, b, Y, u, v; - - if (nVidImageDepth == 15) { - for (i = 0; i < 32768; i++) { - LUT16to32[i] = ((i & 0x7C00) << 9) + ((i & 0x03E0) << 6) + ((i & 0x001F) << 3); - } - - for (i = 0; i < 32; i++) { - for (j = 0; j < 32; j++) { - for (k = 0; k < 32; k++) { - r = i << 3; - g = j << 3; - b = k << 3; - Y = (r + g + b) >> 2; - u = 128 + ((r - b) >> 2); - v = 128 + ((-r + 2 * g - b) >> 3); - RGBtoYUV[(i << 10) + (j << 5) + k] = (Y << 16) + (u << 8) + v; - } - } - } - } else { - for (i = 0; i < 65536; i++) { - LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3); - } - - for (i = 0; i < 32; i++) { - for (j = 0; j < 64; j++) { - for (k = 0; k < 32; k++) { - r = i << 3; - g = j << 2; - b = k << 3; - Y = (r + g + b) >> 2; - u = 128 + ((r - b) >> 2); - v = 128 + ((-r + 2 * g - b) >> 3); - RGBtoYUV[(i << 11) + (j << 5) + k] = (Y << 16) + (u << 8) + v; - } - } - } - } - } -#endif - - if (nSoftFXBlitter >= FILTER_HQ2XS_VBA && nSoftFXBlitter <= FILTER_HQ3XS_VBA) { - hq2xS_init(nVidImageDepth); - } - - if (nSoftFXBlitter == FILTER_HQ2XS_SNES9X || nSoftFXBlitter == FILTER_HQ3XS_SNES9X || nSoftFXBlitter == FILTER_HQ2XBOLD || nSoftFXBlitter == FILTER_HQ3XBOLD) { - InitLUTs(); - } - -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * SoftFX initialised: using %s in %i-bit mode.\n"), SoftFXInfo[nSoftFXBlitter].pszName, nVidImageDepth); -#endif - - return 0; -} - -int VidSoftFXScale(RECT* pRect, int nGameWidth, int nGameHeight) -{ - int nWidth = pRect->right - pRect->left; - int nHeight = pRect->bottom - pRect->top; - - nSoftFXEnlarge = false; - - if ((nWidth >= (nGameWidth * SoftFXInfo[nSoftFXBlitter].nZoom)) && (nHeight >= (nGameHeight * SoftFXInfo[nSoftFXBlitter].nZoom))) { - nWidth = nGameWidth * SoftFXInfo[nSoftFXBlitter].nZoom; - nHeight = nGameHeight * SoftFXInfo[nSoftFXBlitter].nZoom; - nSoftFXEnlarge = true; - } - - if (!nSoftFXEnlarge) { - nWidth = nGameWidth; - nHeight = nGameHeight; - } - - pRect->left = (pRect->right + pRect->left) / 2; - pRect->left -= nWidth / 2; - pRect->right = pRect->left + nWidth; - - pRect->top = (pRect->bottom + pRect->top) / 2; - pRect->top -= nHeight / 2; - pRect->bottom = pRect->top + nHeight; - - return 0; -} - -static void VidSoftFXRotate() -{ - if (nSoftFXRotate) { - unsigned char* ps; - unsigned char* pd = pSoftFXImage; - if (nSoftFXRotate & 2) { - pd += nSoftFXImageHeight * nSoftFXImagePitch - nVidImageBPP; - } - - switch (nVidImageBPP) { - case 4: { - switch (nSoftFXRotate) { - case 1: { - for (int y = 0; y < nSoftFXImageHeight; y++) { - ps = pVidImage + (nSoftFXImageHeight + nVidImageLeft - 1 - y) * 4; - for (int x = 0; x < nSoftFXImageWidth; x++) { - *(int*)pd = *(int*)ps; - ps += nVidImagePitch; - pd += 4; - } - } - break; - } - case 2: { - for (int y = 0; y < nSoftFXImageHeight; y++) { - ps = pVidImage + y * nVidImagePitch + nVidImageLeft * 2; - for (int x = 0; x < nSoftFXImageWidth; x++) { - *(int*)pd = *(int*)ps; - ps += 4; - pd -= 4; - } - } - break; - } - case 3: { - for (int y = 0; y > 1; - UINT16 *dst0=(UINT16 *)pd; - UINT16 *dst1=(UINT16 *)(pd + nPitch); - UINT16 *src0=(UINT16 *)(ps - nSoftFXImagePitch); - UINT16 *src1=(UINT16 *)ps; - UINT16 *src2=(UINT16 *)(ps + nSoftFXImagePitch); - UINT64 mask = 0x7BEF7BEF7BEF7BEFLL; - if (nVidImageDepth == 15) mask = 0x3DEF3DEF3DEF3DEFLL; - - for (int y = 0; y < nSoftFXImageHeight; y++) { - superscale_line(src0, src1, src2, dst0, nSoftFXImageWidth, &mask); - superscale_line(src2, src1, src0, dst1, nSoftFXImageWidth, &mask); - - src0 = src1; - src1 = src2; - src2 += srcNextline; - - dst0 += nPitch; - dst1 += nPitch; - } -#ifdef __GNUC__ - __asm__ __volatile__( - "emms\n" - ); -#else - __asm { - emms; - } -#endif - break; - } - case FILTER_SUPERSCALE_75SCAN: { - UINT32 srcNextline = nSoftFXImagePitch >> 1; - UINT16 *dst0=(UINT16 *)pd; - UINT16 *dst1=(UINT16 *)(pd + nPitch); - UINT16 *src0=(UINT16 *)(ps - nSoftFXImagePitch); - UINT16 *src1=(UINT16 *)ps; - UINT16 *src2=(UINT16 *)(ps + nSoftFXImagePitch); - UINT64 mask = 0x7BEF7BEF7BEF7BEFLL; - if (nVidImageDepth == 15) mask = 0x3DEF3DEF3DEF3DEFLL; - - for (int y = 0; y < nSoftFXImageHeight; y++) { - superscale_line(src0, src1, src2, dst0, nSoftFXImageWidth, &mask); - superscale_line_75(src2, src1, src0, dst1, nSoftFXImageWidth, &mask); - - src0 = src1; - src1 = src2; - src2 += srcNextline; - - dst0 += nPitch; - dst1 += nPitch; - } -#ifdef __GNUC__ - __asm__ __volatile__( - "emms\n" - ); -#else - __asm { - emms; - } -#endif - break; - } - case FILTER_HQ2X: { // hq2x filter (16BPP -> 32BPP) - hq2x_32(ps, pd, nSoftFXImageWidth, nSoftFXImageHeight, nPitch); - break; - } - case FILTER_HQ3X: { // hq3x filter (16BPP -> 32BPP) - hq3x_32(ps, pd, nSoftFXImageWidth, nSoftFXImageHeight, nPitch); - break; - } - case FILTER_HQ4X: { // hq4x filter (16BPP -> 32BPP) - hq4x_32(ps, pd, nSoftFXImageWidth, nSoftFXImageHeight, nPitch); - break; - } -#endif - case FILTER_HQ2XS_VBA: { // hq2xS filter (16/32BPP only) - if (nVidImageDepth == 16) { - hq2xS(ps, nSoftFXImagePitch, NULL, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - } else if (nVidImageDepth == 32) { - hq2xS32(ps, nSoftFXImagePitch, NULL, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - } - break; - } - case FILTER_HQ3XS_VBA: { // hq3xS filter (16/32BPP only) -#if defined _MSC_VER && defined BUILD_X86_ASM - if (nVidImageDepth == 16) { - hq3xS(ps, nSoftFXImagePitch, NULL, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - } else if (nVidImageDepth == 32) { - hq3xS32(ps, nSoftFXImagePitch, NULL, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - } - break; -#endif - } - case FILTER_HQ2XS_SNES9X: { - RenderHQ2XS(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight, 0); - break; - } - case FILTER_HQ3XS_SNES9X: { - RenderHQ3XS(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight, 0); - break; - } - case FILTER_HQ2XBOLD: { - RenderHQ2XS(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight, 1); - break; - } - case FILTER_HQ3XBOLD: { - RenderHQ3XS(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight, 1); - break; - } - case FILTER_EPXB: { - RenderEPXB(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight, nVidImageDepth); - break; - } - case FILTER_EPXC: { - RenderEPXC(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight, nVidImageDepth); - break; - } - case FILTER_2XBR_A: { - xbr2x_a(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - case FILTER_2XBR_B: { - xbr2x_b(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - case FILTER_2XBR_C: { - xbr2x_c(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - case FILTER_3XBR_A: { - xbr3x_a(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - case FILTER_3XBR_B: { - xbr3x_b(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - case FILTER_3XBR_C: { - xbr3x_c(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - case FILTER_4XBR_A: { - xbr4x_a(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - case FILTER_4XBR_B: { - xbr4x_b(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - case FILTER_4XBR_C: { - xbr4x_c(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - case FILTER_DDT3X: { - ddt3x(ps, nSoftFXImagePitch, pd, nPitch, nSoftFXImageWidth, nSoftFXImageHeight); - break; - } - } -} - -#ifdef SOFTFX_ENABLE_DIRECTX - -int VidSoftFXApplyEffectDirectX(IDirectDrawSurface7* pSurf, RECT* pRect) -{ - DDSURFACEDESC2 ddsd; - - VidSoftFXRotate(); - - // Lock the surface so we can write to it - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - if (FAILED(pSurf->Lock(pRect, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL))) { - return 1; - } - - VidSoftFXApplyEffect(pSoftFXImage, (unsigned char*)ddsd.lpSurface, ddsd.lPitch); - - pSurf->Unlock(NULL); - - return 0; -} - -#endif - -#ifdef SOFTFX_ENABLE_SDL - -int VidSoftFXApplyEffectSDL(SDL_Surface* pSurf) -{ - VidSoftFXRotate(); - - // Lock the surface so we can write to it - if (SDL_LockSurface(pSurf)) { - return 1; - } - - VidSoftFXApplyEffect(pSoftFXImage, (unsigned char*)pSurf->pixels, pSurf->pitch); - - SDL_UnlockSurface(pSurf); - - return 0; -} - -#endif - -int VidFilterApplyEffect(unsigned char* pd, int pitch) -{ - if (!pd) { - return 1; - } - - VidSoftFXRotate(); - VidSoftFXApplyEffect(pSoftFXImage, pd, pitch); - - return 0; -} diff --git a/jan/src/intf/video/vid_softfx.h b/jan/src/intf/video/vid_softfx.h deleted file mode 100644 index 8570a7661..000000000 --- a/jan/src/intf/video/vid_softfx.h +++ /dev/null @@ -1,70 +0,0 @@ -// Sotfware effects - -#ifdef BUILD_WIN32 - #define SOFTFX_ENABLE_DIRECTX -#endif -#ifdef BUILD_SDL - #define SOFTFX_ENABLE_SDL -#endif - -#ifdef SOFTFX_ENABLE_DIRECTX - #include "vid_directx_support.h" -#endif -#ifdef SOFTFX_ENABLE_SDL - #include -#endif - -#define FILTER_PLAIN 0 -#define FILTER_ADVMAME_SCALE_2X 1 -#define FILTER_ADVMAME_SCALE_3X 2 -#define FILTER_2XPM_LQ 3 -#define FILTER_2XPM_HQ 4 -#define FILTER_EAGLE 5 -#define FILTER_SUPEREAGLE 6 -#define FILTER_2XSAI 7 -#define FILTER_SUPER_2XSAI 8 -#define FILTER_SUPEREAGLE_VBA 9 -#define FILTER_2XSAI_VBA 10 -#define FILTER_SUPER_2XSAI_VBA 11 -#define FILTER_SUPERSCALE 12 -#define FILTER_SUPERSCALE_75SCAN 13 -#define FILTER_HQ2X 14 -#define FILTER_HQ3X 15 -#define FILTER_HQ4X 16 -#define FILTER_HQ2XS_VBA 17 -#define FILTER_HQ3XS_VBA 18 -#define FILTER_HQ2XS_SNES9X 19 -#define FILTER_HQ3XS_SNES9X 20 -#define FILTER_HQ2XBOLD 21 -#define FILTER_HQ3XBOLD 22 -#define FILTER_EPXB 23 -#define FILTER_EPXC 24 -#define FILTER_2XBR_A 25 -#define FILTER_2XBR_B 26 -#define FILTER_2XBR_C 27 -#define FILTER_3XBR_A 28 -#define FILTER_3XBR_B 29 -#define FILTER_3XBR_C 30 -#define FILTER_4XBR_A 31 -#define FILTER_4XBR_B 32 -#define FILTER_4XBR_C 33 -#define FILTER_DDT3X 34 - -TCHAR* VidSoftFXGetEffect(int nEffect); -int VidSoftFXGetZoom(int nEffect); -int VidSoftFXCheckDepth(int nEffect, int nDepth); - -void VidSoftFXExit(); -int VidSoftFXInit(int nBlitter, int nRotate); - -int VidSoftFXScale(RECT* pRect, int nGameWidth, int nGameHeight); - -#ifdef SOFTFX_ENABLE_DIRECTX -int VidSoftFXApplyEffectDirectX(IDirectDrawSurface7* pSurf, RECT* pRect); -#endif - -#ifdef SOFTFX_ENABLE_SDL -int VidSoftFXApplyEffectSDL(SDL_Surface* pSurf); -#endif - -int VidFilterApplyEffect(unsigned char* pd, int pitch); diff --git a/jan/src/intf/video/vid_support.cpp b/jan/src/intf/video/vid_support.cpp deleted file mode 100644 index 40e2fc272..000000000 --- a/jan/src/intf/video/vid_support.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Support functions for all blitters -#include "burner.h" -#include "vid_support.h" - -// --------------------------------------------------------------------------- -// General - -static UINT8* pVidSFullImage = NULL; - -void VidSFreeVidImage() -{ - if (pVidSFullImage) { - free(pVidSFullImage); - pVidSFullImage = NULL; - } - pVidImage = NULL; -} - -INT32 VidSAllocVidImage() -{ - INT32 nMemLen = 0; - - VidSFreeVidImage(); - - // Allocate an extra line above and below the image to accomodate effects - nVidImagePitch = nVidImageWidth * ((nVidImageDepth + 7) >> 3); - nMemLen = (nVidImageHeight + 2) * nVidImagePitch; - pVidSFullImage = (UINT8*)malloc(nMemLen); - - if (pVidSFullImage) { - memset(pVidSFullImage, 0, nMemLen); - pVidImage = pVidSFullImage + nVidImagePitch; - return 0; - } else { - pVidImage = NULL; - return 1; - } -} - diff --git a/jan/src/intf/video/vid_support.h b/jan/src/intf/video/vid_support.h deleted file mode 100644 index e97fa3aed..000000000 --- a/jan/src/intf/video/vid_support.h +++ /dev/null @@ -1,2 +0,0 @@ -void VidSFreeVidImage(); -INT32 VidSAllocVidImage(); diff --git a/jan/src/intf/video/win32/ddraw_core.cpp b/jan/src/intf/video/win32/ddraw_core.cpp deleted file mode 100644 index 2cf61c304..000000000 --- a/jan/src/intf/video/win32/ddraw_core.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "burner.h" -#include "ddraw_core.h" - -// DirectDrawCreateEx -HRESULT (WINAPI* _DirectDrawCreateEx) (GUID FAR*, LPVOID*, REFIID, IUnknown FAR*); -HRESULT WINAPI Empty_DirectDrawCreateEx (GUID FAR*, LPVOID*, REFIID, IUnknown FAR*) { return 0; } - -// DirectDrawCreateClipper -HRESULT (WINAPI* _DirectDrawCreateClipper) (DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR*); -HRESULT WINAPI Empty_DirectDrawCreateClipper (DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR*) { return 0; } - -// DirectDrawEnumerateEx -#ifdef UNICODE -HRESULT (WINAPI* _DirectDrawEnumerateEx) (LPDDENUMCALLBACKEXW, LPVOID, DWORD); -HRESULT WINAPI Empty_DirectDrawEnumerateEx (LPDDENUMCALLBACKEXW, LPVOID, DWORD) { return 0; } -#else -HRESULT (WINAPI* _DirectDrawEnumerateEx) (LPDDENUMCALLBACKEXA, LPVOID, DWORD); -HRESULT WINAPI Empty_DirectDrawEnumerateEx (LPDDENUMCALLBACKEXA, LPVOID, DWORD) { return 0; } -#endif - -static HINSTANCE hDDCore; -static BOOL nDDCoreInit = FALSE; - -/* -static void DDCore_Exit() -{ - FreeLibrary(hDDCore); -} -*/ - -// Macro for easy handling of functions -#define _LOADFN(_rettype, _name, _empty, _params, _hinst, _str ) \ - \ - _name = (_rettype (WINAPI *)_params) GetProcAddress(_hinst, _str); \ - \ - if(!_name) { \ - _name = _empty; \ - return 0; \ - } - -static INT32 DDCore_GetFunctions() -{ - if(!nDDCoreInit) return 0; - - _LOADFN(HRESULT, _DirectDrawCreateEx, Empty_DirectDrawCreateEx, (GUID FAR*, LPVOID*, REFIID, IUnknown FAR*), hDDCore, "DirectDrawCreateEx"); - _LOADFN(HRESULT, _DirectDrawCreateClipper, Empty_DirectDrawCreateClipper, (DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR*), hDDCore, "DirectDrawCreateClipper"); -#ifdef UNICODE - _LOADFN(HRESULT, _DirectDrawEnumerateEx, Empty_DirectDrawEnumerateEx, (LPDDENUMCALLBACKEXW, LPVOID, DWORD), hDDCore, "DirectDrawEnumerateExW"); -#else - _LOADFN(HRESULT, _DirectDrawEnumerateEx, Empty_DirectDrawEnumerateEx, (LPDDENUMCALLBACKEXA, LPVOID, DWORD), hDDCore, "DirectDrawEnumerateExA"); -#endif - return 1; -} - -INT32 DDCore_Init() -{ - hDDCore = LoadLibrary(_T("ddraw.dll")); - - if(!hDDCore) { - MessageBox(NULL, _T("Loading of DDRAW.DLL failed."), _T("Error"), MB_OK | MB_ICONERROR); - nDDCoreInit = FALSE; - return 0; - } - - nDDCoreInit = TRUE; - if(!DDCore_GetFunctions()) { - MessageBox(NULL, _T("There was a problem while loading functions from DDRAW.DLL"), _T("Error"), MB_OK | MB_ICONERROR); - return 0; - } - - return 1; -} diff --git a/jan/src/intf/video/win32/ddraw_core.h b/jan/src/intf/video/win32/ddraw_core.h deleted file mode 100644 index bb7b26f55..000000000 --- a/jan/src/intf/video/win32/ddraw_core.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _DDRAW_CORE_ -#define _DDRAW_CORE_ - -#include - -// DirectDrawCreateEx -extern HRESULT (WINAPI* _DirectDrawCreateEx) (GUID FAR*, LPVOID*, REFIID, IUnknown FAR*); - -// DirectDrawCreateClipper -extern HRESULT (WINAPI* _DirectDrawCreateClipper) (DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR*); - -// DirectDrawEnumerateEx -#ifdef UNICODE -extern HRESULT (WINAPI* _DirectDrawEnumerateEx) (LPDDENUMCALLBACKEXW, LPVOID, DWORD); -#else -extern HRESULT (WINAPI* _DirectDrawEnumerateEx) (LPDDENUMCALLBACKEXA, LPVOID, DWORD); -#endif - -INT32 DDCore_Init(); - -#endif diff --git a/jan/src/intf/video/win32/directx9_core.cpp b/jan/src/intf/video/win32/directx9_core.cpp deleted file mode 100644 index e41eb98f9..000000000 --- a/jan/src/intf/video/win32/directx9_core.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include "burner.h" -#include "directx9_core.h" - -// Direct3DCreate9 -LPDIRECT3D9 (WINAPI* _Direct3DCreate9) (UINT); -LPDIRECT3D9 WINAPI Empty_Direct3DCreate9 (UINT) { return NULL; } - -// D3DXFillTextureTX -HRESULT (WINAPI* _D3DXFillTextureTX) (LPDIRECT3DTEXTURE9, LPD3DXTEXTURESHADER); -HRESULT WINAPI Empty_D3DXFillTextureTX (LPDIRECT3DTEXTURE9, LPD3DXTEXTURESHADER) { return 0; } - -// D3DXCreateBuffer -HRESULT (WINAPI* _D3DXCreateBuffer) (DWORD,LPD3DXBUFFER*); -HRESULT WINAPI Empty_D3DXCreateBuffer (DWORD,LPD3DXBUFFER*) { return 0; } - -// D3DXCreateEffectFromResource -#ifdef UNICODE -HRESULT (WINAPI* _D3DXCreateEffectFromResource) (LPDIRECT3DDEVICE9,HMODULE,LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*); -HRESULT WINAPI Empty_D3DXCreateEffectFromResource (LPDIRECT3DDEVICE9,HMODULE,LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*) { return 0; } -#else -HRESULT (WINAPI* _D3DXCreateEffectFromResource) (LPDIRECT3DDEVICE9,HMODULE,LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*); -HRESULT WINAPI Empty_D3DXCreateEffectFromResource (LPDIRECT3DDEVICE9,HMODULE,LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*) { return 0; } -#endif - -// D3DXCreateEffectFromFile -#ifdef UNICODE -HRESULT (WINAPI* _D3DXCreateEffectFromFile) (LPDIRECT3DDEVICE9,LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*); -HRESULT WINAPI Empty_D3DXCreateEffectFromFile (LPDIRECT3DDEVICE9,LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*) { return 0; } -#else -HRESULT (WINAPI* _D3DXCreateEffectFromFile) (LPDIRECT3DDEVICE9,LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*); -HRESULT WINAPI Empty_D3DXCreateEffectFromFile (LPDIRECT3DDEVICE9,LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*) { return 0; } -#endif - -// D3DXLoadSurfaceFromMemory -HRESULT (WINAPI* _D3DXLoadSurfaceFromMemory) (LPDIRECT3DSURFACE9,const PALETTEENTRY*,const RECT*,LPCVOID,D3DFORMAT,UINT,const PALETTEENTRY*,const RECT*,DWORD,D3DCOLOR); -HRESULT WINAPI Empty_D3DXLoadSurfaceFromMemory (LPDIRECT3DSURFACE9,const PALETTEENTRY*,const RECT*,LPCVOID,D3DFORMAT,UINT,const PALETTEENTRY*,const RECT*,DWORD,D3DCOLOR) { return 0; } - -// D3DXCompileShaderFromResource -#ifdef UNICODE -HRESULT (WINAPI* _D3DXCompileShaderFromResource) (HMODULE,LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*); -HRESULT WINAPI Empty_D3DXCompileShaderFromResource (HMODULE,LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*) { return 0; } -#else -HRESULT (WINAPI* _D3DXCompileShaderFromResource) (HMODULE,LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*); -HRESULT WINAPI Empty_D3DXCompileShaderFromResource (HMODULE,LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*) { return 0; } -#endif - -// D3DXCompileShaderFromFile -#ifdef UNICODE -HRESULT (WINAPI* _D3DXCompileShaderFromFile) (LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*); -HRESULT WINAPI Empty_D3DXCompileShaderFromFile (LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*) { return 0; } -#else -HRESULT (WINAPI* _D3DXCompileShaderFromFile) (LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*); -HRESULT WINAPI Empty_D3DXCompileShaderFromFile (LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*) { return 0; } -#endif - -// D3DXCreateTextureShader -HRESULT (WINAPI* _D3DXCreateTextureShader) (const DWORD*, LPD3DXTEXTURESHADER*); -HRESULT WINAPI Empty_D3DXCreateTextureShader (const DWORD*,LPD3DXTEXTURESHADER*) { return 0; } - -// D3DXCreateFont -#ifdef UNICODE -HRESULT (WINAPI* _D3DXCreateFont) (LPDIRECT3DDEVICE9,INT,UINT,UINT,UINT,BOOL,DWORD,DWORD,DWORD,DWORD,LPCWSTR,LPD3DXFONT*); -HRESULT WINAPI Empty_D3DXCreateFont (LPDIRECT3DDEVICE9,INT,UINT,UINT,UINT,BOOL,DWORD,DWORD,DWORD,DWORD,LPCWSTR,LPD3DXFONT*) { return 0; } -#else -HRESULT (WINAPI* _D3DXCreateFont) (LPDIRECT3DDEVICE9,INT,UINT,UINT,UINT,BOOL,DWORD,DWORD,DWORD,DWORD,LPCTSTR,LPD3DXFONT*); -HRESULT WINAPI Empty_D3DXCreateFont (LPDIRECT3DDEVICE9,INT,UINT,UINT,UINT,BOOL,DWORD,DWORD,DWORD,DWORD,LPCTSTR,LPD3DXFONT*) { return 0; } -#endif - -static HINSTANCE hDx9Core_D3D9; -static HINSTANCE hDx9Core_D3DX9; -static BOOL nDx9CoreInit = FALSE; - -/* -static void Dx9Core_Exit() -{ - FreeLibrary(hDx9Core_D3D9); - FreeLibrary(hDx9Core_D3DX9); -} -*/ - -// Macro for easy handling of functions -#define _LOADFN(_rettype, _name, _empty, _params, _hinst, _str ) \ - \ - _name = (_rettype (WINAPI *)_params) GetProcAddress(_hinst, _str); \ - \ - if(!_name) { \ - _name = _empty; \ - return 0; \ - } - -static INT32 Dx9Core_GetFunctions() -{ - if(!nDx9CoreInit) return 0; - - // D3D9.DLL - _LOADFN(LPDIRECT3D9, _Direct3DCreate9, Empty_Direct3DCreate9, (UINT), hDx9Core_D3D9, "Direct3DCreate9"); - - // D3DX9.DLL - _LOADFN(HRESULT, _D3DXFillTextureTX, Empty_D3DXFillTextureTX, (LPDIRECT3DTEXTURE9, LPD3DXTEXTURESHADER), hDx9Core_D3DX9, "D3DXFillTextureTX"); - -#ifdef UNICODE - _LOADFN(HRESULT, _D3DXCreateEffectFromResource, Empty_D3DXCreateEffectFromResource, (LPDIRECT3DDEVICE9, HMODULE, LPCWSTR, const D3DXMACRO*, LPD3DXINCLUDE, DWORD, LPD3DXEFFECTPOOL, LPD3DXEFFECT*, LPD3DXBUFFER*), hDx9Core_D3DX9, "D3DXCreateEffectFromResourceW"); -#else - _LOADFN(HRESULT, _D3DXCreateEffectFromResource, Empty_D3DXCreateEffectFromResource, (LPDIRECT3DDEVICE9, HMODULE, LPCTSTR, const D3DXMACRO*, LPD3DXINCLUDE, DWORD, LPD3DXEFFECTPOOL, LPD3DXEFFECT*, LPD3DXBUFFER*), hDx9Core_D3DX9, "D3DXCreateEffectFromResourceA"); -#endif - -#ifdef UNICODE - _LOADFN(HRESULT, _D3DXCreateEffectFromFile, Empty_D3DXCreateEffectFromFile, (LPDIRECT3DDEVICE9,LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*), hDx9Core_D3DX9, "D3DXCreateEffectFromFileW"); -#else - _LOADFN(HRESULT, _D3DXCreateEffectFromFile, Empty_D3DXCreateEffectFromFile, (LPDIRECT3DDEVICE9,LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*), hDx9Core_D3DX9, "D3DXCreateEffectFromFileA"); -#endif - - _LOADFN(HRESULT, _D3DXCreateBuffer, Empty_D3DXCreateBuffer, (DWORD,LPD3DXBUFFER*), hDx9Core_D3DX9, "D3DXCreateBuffer"); - - _LOADFN(HRESULT, _D3DXLoadSurfaceFromMemory, Empty_D3DXLoadSurfaceFromMemory, (LPDIRECT3DSURFACE9, const PALETTEENTRY*, const RECT*, LPCVOID,D3DFORMAT, UINT, const PALETTEENTRY*, const RECT*, DWORD, D3DCOLOR), hDx9Core_D3DX9, "D3DXLoadSurfaceFromMemory"); - -#ifdef UNICODE - _LOADFN(HRESULT, _D3DXCompileShaderFromResource, Empty_D3DXCompileShaderFromResource, (HMODULE, LPCWSTR, const D3DXMACRO*, LPD3DXINCLUDE, LPCSTR, LPCSTR, DWORD, LPD3DXBUFFER*, LPD3DXBUFFER*, LPD3DXCONSTANTTABLE*), hDx9Core_D3DX9, "D3DXCompileShaderFromResourceW"); -#else - _LOADFN(HRESULT, _D3DXCompileShaderFromResource, Empty_D3DXCompileShaderFromResource, (HMODULE, LPCTSTR, const D3DXMACRO*, LPD3DXINCLUDE, LPCSTR, LPCSTR, DWORD, LPD3DXBUFFER*, LPD3DXBUFFER*, LPD3DXCONSTANTTABLE*), hDx9Core_D3DX9, "D3DXCompileShaderFromResourceA"); -#endif - -#ifdef UNICODE - _LOADFN(HRESULT, _D3DXCompileShaderFromFile, Empty_D3DXCompileShaderFromFile, (LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*), hDx9Core_D3DX9, "D3DXCompileShaderFromFileW"); -#else - _LOADFN(HRESULT, _D3DXCompileShaderFromFile, Empty_D3DXCompileShaderFromFile, (LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*), hDx9Core_D3DX9, "D3DXCompileShaderFromFileA"); -#endif - - _LOADFN(HRESULT, _D3DXCreateTextureShader, Empty_D3DXCreateTextureShader, (const DWORD*, LPD3DXTEXTURESHADER*), hDx9Core_D3DX9, "D3DXCreateTextureShader"); - -#ifdef UNICODE - _LOADFN(HRESULT, _D3DXCreateFont, Empty_D3DXCreateFont, (LPDIRECT3DDEVICE9, INT, UINT, UINT, UINT, BOOL, DWORD, DWORD, DWORD, DWORD, LPCWSTR, LPD3DXFONT*), hDx9Core_D3DX9, "D3DXCreateFontW"); -#else - _LOADFN(HRESULT, _D3DXCreateFont, Empty_D3DXCreateFont, (LPDIRECT3DDEVICE9, INT, UINT, UINT, UINT, BOOL, DWORD, DWORD, DWORD, DWORD, LPCTSTR, LPD3DXFONT*), hDx9Core_D3DX9, "D3DXCreateFontA"); -#endif - - return 1; -} - -INT32 Dx9Core_Init() -{ - hDx9Core_D3D9 = LoadLibrary(_T("d3d9.dll")); - hDx9Core_D3DX9 = LoadLibrary(_T("D3DX9_43.dll")); - - if(!hDx9Core_D3D9 || !hDx9Core_D3DX9) { - //MessageBox(NULL, _T("Loading of D3D9.DLL and D3DX9_43.DLL failed."), _T("Error"), MB_OK | MB_ICONERROR); - nDx9CoreInit = FALSE; - return 0; - } - - nDx9CoreInit = TRUE; - if(!Dx9Core_GetFunctions()) { - //MessageBox(NULL, _T("There was a problem while loading functions from D3D9.DLL and D3DX9_43.DLL"), _T("Error"), MB_OK | MB_ICONERROR); - return 0; - } - - return 1; -} diff --git a/jan/src/intf/video/win32/directx9_core.h b/jan/src/intf/video/win32/directx9_core.h deleted file mode 100644 index 21d5d244b..000000000 --- a/jan/src/intf/video/win32/directx9_core.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef _DIRECTX9_CORE_ -#define _DIRECTX9_CORE_ - -#include -#include - -#ifndef D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY -#define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY 0x1000 -#endif - -// Direct3DCreate9 -extern LPDIRECT3D9 (WINAPI* _Direct3DCreate9) (UINT); - -// D3DXFillTextureTX -extern HRESULT (WINAPI* _D3DXFillTextureTX) (LPDIRECT3DTEXTURE9, LPD3DXTEXTURESHADER); - -// D3DXCreateBuffer -extern HRESULT (WINAPI* _D3DXCreateBuffer) (DWORD,LPD3DXBUFFER*); - -// D3DXCreateEffectFromResource -#ifdef UNICODE -extern HRESULT (WINAPI* _D3DXCreateEffectFromResource) (LPDIRECT3DDEVICE9, HMODULE, LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*); -#else -extern HRESULT (WINAPI* _D3DXCreateEffectFromResource) (LPDIRECT3DDEVICE9, HMODULE, LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*); -#endif - -// D3DXCreateEffectFromFile -#ifdef UNICODE -extern HRESULT (WINAPI* _D3DXCreateEffectFromFile) (LPDIRECT3DDEVICE9,LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*); -#else -extern HRESULT (WINAPI* _D3DXCreateEffectFromFile) (LPDIRECT3DDEVICE9,LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,DWORD,LPD3DXEFFECTPOOL,LPD3DXEFFECT*,LPD3DXBUFFER*); -#endif - -// D3DXLoadSurfaceFromMemory -extern HRESULT (WINAPI* _D3DXLoadSurfaceFromMemory) (LPDIRECT3DSURFACE9,const PALETTEENTRY*,const RECT*,LPCVOID,D3DFORMAT,UINT,const PALETTEENTRY*,const RECT*,DWORD,D3DCOLOR); - -// D3DXCompileShaderFromResource -#ifdef UNICODE -extern HRESULT (WINAPI* _D3DXCompileShaderFromResource) (HMODULE,LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*); -#else -extern HRESULT (WINAPI* _D3DXCompileShaderFromResource) (HMODULE,LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*); -#endif - -// D3DXCompileShaderFromFile -#ifdef UNICODE -extern HRESULT (WINAPI* _D3DXCompileShaderFromFile) (LPCWSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*); -#else -extern HRESULT (WINAPI* _D3DXCompileShaderFromFile) (LPCTSTR,const D3DXMACRO*,LPD3DXINCLUDE,LPCSTR,LPCSTR,DWORD,LPD3DXBUFFER*,LPD3DXBUFFER*,LPD3DXCONSTANTTABLE*); -#endif - -// D3DXCreateTextureShader -extern HRESULT (WINAPI* _D3DXCreateTextureShader) (const DWORD*, LPD3DXTEXTURESHADER*); - -// D3DXCreateFont -#ifdef UNICODE -extern HRESULT (WINAPI* _D3DXCreateFont) (LPDIRECT3DDEVICE9,INT,UINT,UINT,UINT,BOOL,DWORD,DWORD,DWORD,DWORD,LPCWSTR,LPD3DXFONT*); -#else -extern HRESULT (WINAPI* _D3DXCreateFont) (LPDIRECT3DDEVICE9,INT,UINT,UINT,UINT,BOOL,DWORD,DWORD,DWORD,DWORD,LPCTSTR,LPD3DXFONT*); -#endif - -INT32 Dx9Core_Init(); - -#endif diff --git a/jan/src/intf/video/win32/resource/bicubic.fx b/jan/src/intf/video/win32/resource/bicubic.fx deleted file mode 100644 index 4737b6a1f..000000000 --- a/jan/src/intf/video/win32/resource/bicubic.fx +++ /dev/null @@ -1,801 +0,0 @@ -// Bi-cubic filtering using 3D hardware - -// float4x4 worldViewProj : WorldViewProjection; - -// you need to change these if you load a different texture: -const float2 imageSize = { 512.0, 256.0 }; -const float2 intermediateSize = { 512.0*4, 256.0 }; -const float4 scanIntensity = { 0.5, 0.5, 0.5, 0.0 }; -const float scanSize = 1.0; - -#ifndef BC_MACROS - // Use variables to allow real-time adjustments - const float B = 1.0 / 3.0; - const float C = 1.0 / 3.0; -#else - // Use macros for speed - #ifndef B - #define B (1.0/3.0) - #endif - #ifndef C - #define C ((1.0 - B) / 2.0) - #endif -#endif - -texture imageTexture; -texture intermediateTexture; -texture scanTexture; -texture weightTex; - -sampler imageSampler = sampler_state -{ - texture = ; - MagFilter = Point; - MinFilter = Point; - MipFilter = None; - AddressU = Border; - AddressV = Border; -}; - -sampler intermediateSampler = sampler_state -{ - texture = ; - MagFilter = Point; - MinFilter = Point; - MipFilter = None; - AddressU = Border; - AddressV = Border; -}; - -sampler scanImageSampler = sampler_state -{ - texture = ; - MagFilter = Linear; - MinFilter = Linear; - MipFilter = None; - AddressU = Wrap; - AddressV = Wrap; -}; - -sampler weightSampler20 = sampler_state -{ - texture = ; - MagFilter = Linear; - MinFilter = Linear; - MipFilter = None; - AddressU = Clamp; - AddressV = Clamp; -}; - -sampler weightSampler14 = sampler_state -{ - texture = ; - MagFilter = Point; - MinFilter = Point; - MipFilter = None; - AddressU = Wrap; - AddressV = Clamp; -}; - -// vertex shader -struct a2v { - float4 pos : POSITION; - float4 texcoord : TEXCOORD0; -}; -struct v2f { - float4 pos : POSITION; - float4 texcoord : TEXCOORD0; -}; - -v2f defaultVS(a2v IN) -{ - v2f OUT; - OUT.pos = IN.pos;//mul(IN.pos, worldViewProj); - OUT.texcoord = IN.texcoord; - return OUT; -} - -v2f bicubicVS(a2v IN) -{ - v2f OUT; - OUT.pos = IN.pos;//mul(IN.pos, worldViewProj); - OUT.texcoord = IN.texcoord - 0.5 / imageSize.xyxy; - return OUT; -} - -struct a2v2 { - float4 pos : POSITION; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; -}; -struct v2f2 { - float4 pos : POSITION; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; -}; -struct v2f5 { - float4 pos : POSITION; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 texcoord3 : TEXCOORD3; - float4 texcoord4 : TEXCOORD4; -}; - -v2f5 bicubicP0VS(a2v2 IN) -{ - v2f5 OUT; - float4 offsets = float4(-1.0f, 0.0f, 1.0f, 2.0f) / imageSize.xxxx; - - OUT.pos = IN.pos; - OUT.texcoord0 = IN.texcoord0 - 0.5 / imageSize.xyxy; - OUT.texcoord1 = IN.texcoord1; - - OUT.texcoord2 = OUT.texcoord0; - OUT.texcoord3 = OUT.texcoord0; - OUT.texcoord4 = OUT.texcoord0; - - OUT.texcoord2.x += offsets.x; - OUT.texcoord3.x += offsets.z; - OUT.texcoord4.x += offsets.w; - - return OUT; -} - -v2f5 bicubicP1VS(a2v2 IN) -{ - v2f5 OUT; - float4 offsets = float4(-1.0f, 0.0f, 1.0f, 2.0f) / imageSize.yyyy; - - OUT.pos = IN.pos;//mul(IN.pos, worldViewProj); - OUT.texcoord0 = IN.texcoord0 + 0.5 / intermediateSize.xyxy; - OUT.texcoord1 = IN.texcoord1; - - OUT.texcoord2 = OUT.texcoord0; - OUT.texcoord3 = OUT.texcoord0; - OUT.texcoord4 = OUT.texcoord0; - - OUT.texcoord2.y += offsets.x; - OUT.texcoord3.y += offsets.z; - OUT.texcoord4.y += offsets.w; - - return OUT; -} - -v2f2 bicubicP1ScanVS(a2v2 IN) -{ - v2f2 OUT; - - OUT.pos = IN.pos;//mul(IN.pos, worldViewProj); - OUT.texcoord0 = IN.texcoord0; - OUT.texcoord1 = IN.texcoord1; - - return OUT; -} - -// Compute 4 weights using a Mitchell-Netravali cubic polynomial: -// w = (2 - B*3/2 - C) * x^3 + (-3 + B*2 + C ) * x^2 + (1 - B/3 ) for 0 < x < 1 -// w = ( -B/6 - C) * x^3 + ( B + C*5) * x^2 + (-B*2 - C*8) * x + ( B*4/3 + C*4) for 1 < x < 2 -// B = blurring, C = ringing, 0 <= B <= 1, B + 2*C = 1, using B = 0, C = 0.75 yields nVidia's sample -float4 computeWeights(float x) -{ - float4 w; - - // First calculate (x+1, x, 1-x, 2-x) - float4 x1 = x * float4(1, 1, -1, -1) + float4(1, 0, 1, 2); - float4 x2 = x1 * x1; - float4 x3 = x2 * x1; - - // Calculate the polynomial - w = x3 * float2(-B/6.0 - C, 2.0 - B*3.0/2.0 - C).xyyx; - w += x2 * float2( B + C*5.0, -3.0 + B*2.0 + C).xyyx; - w += x1 * float2(-B*2.0 - C*8.0, 0 ).xyyx; - w += float2( B*4.0/3.0 + C*4.0, 1.0 - B/3.0 ).xyyx; - - return w; -} - -// Generate the LUT texture -float4 genWeightTex20(float2 p : POSITION) : COLOR -{ - return computeWeights(p.x); -} -float4 genWeightTex14(float2 p : POSITION) : COLOR -{ - return abs(computeWeights(p.x)); -} - -// filter 4 values -float4 cubicFilter(float4 w, float4 c0, float4 c1, float4 c2, float4 c3) -{ - return c0*w[0] + c1*w[1] + c2*w[2] + c3*w[3]; -} -float4 cubicFilterh(half4 w, half4 c0, half4 c1, half4 c2, half4 c3) -{ - return c0*w[0] + c1*w[1] + c2*w[2] + c3*w[3]; -} - -// pixel shaders - -// Single-pass, use full precision -float4 tex2D_bicubicSPHQ(sampler2D tex, float2 t) -{ - float2 f = frac(t*imageSize); - - // filter in x - float4 w = computeWeights(f.x); - float4 t0 = cubicFilter(w, tex2D(tex, t+float2(-1, -1)/imageSize), - tex2D(tex, t+float2( 0, -1)/imageSize), - tex2D(tex, t+float2( 1, -1)/imageSize), - tex2D(tex, t+float2( 2, -1)/imageSize) ); - float4 t1 = cubicFilter(w, tex2D(tex, t+float2(-1, 0)/imageSize), - tex2D(tex, t+float2( 0, 0)/imageSize), - tex2D(tex, t+float2( 1, 0)/imageSize), - tex2D(tex, t+float2( 2, 0)/imageSize) ); - float4 t2 = cubicFilter(w, tex2D(tex, t+float2(-1, 1)/imageSize), - tex2D(tex, t+float2( 0, 1)/imageSize), - tex2D(tex, t+float2( 1, 1)/imageSize), - tex2D(tex, t+float2( 2, 1)/imageSize) ); - float4 t3 = cubicFilter(w, tex2D(tex, t+float2(-1, 2)/imageSize), - tex2D(tex, t+float2( 0, 2)/imageSize), - tex2D(tex, t+float2( 1, 2)/imageSize), - tex2D(tex, t+float2( 2, 2)/imageSize) ); - - // filter in y - w = computeWeights(f.y); - return cubicFilter(w, t0, t1, t2, t3); -} - -// Single-pass, use partial precision where possible -float4 tex2D_bicubicSP(sampler2D tex, sampler1D weightTex, float2 t) -{ - float2 f = frac(t*imageSize); - - // filter in x - float4 w = tex1D(weightTex, f.x); - half4 t0 = cubicFilterh(w, tex2D(tex, t+float2(-1, -1)/imageSize), - tex2D(tex, t+float2( 0, -1)/imageSize), - tex2D(tex, t+float2( 1, -1)/imageSize), - tex2D(tex, t+float2( 2, -1)/imageSize) ); - half4 t1 = cubicFilterh(w, tex2D(tex, t+float2(-1, 0)/imageSize), - tex2D(tex, t+float2( 0, 0)/imageSize), - tex2D(tex, t+float2( 1, 0)/imageSize), - tex2D(tex, t+float2( 2, 0)/imageSize) ); - half4 t2 = cubicFilterh(w, tex2D(tex, t+float2(-1, 1)/imageSize), - tex2D(tex, t+float2( 0, 1)/imageSize), - tex2D(tex, t+float2( 1, 1)/imageSize), - tex2D(tex, t+float2( 2, 1)/imageSize) ); - half4 t3 = cubicFilterh(w, tex2D(tex, t+float2(-1, 2)/imageSize), - tex2D(tex, t+float2( 0, 2)/imageSize), - tex2D(tex, t+float2( 1, 2)/imageSize), - tex2D(tex, t+float2( 2, 2)/imageSize) ); - - // filter in y - w = tex1D(weightTex, f.y); - return cubicFilterh(w, t0, t1, t2, t3); -} - -// Multi-pass, use full precision -float4 tex2D_bicubicP0HQ(sampler2D tex, float2 t) -{ - float2 f = frac(t*imageSize); - - // filter in x - float4 w = computeWeights(f.x); - return cubicFilter(w, tex2D(tex, t+float2(-1, 0)/imageSize), - tex2D(tex, t+float2( 0, 0)/imageSize), - tex2D(tex, t+float2( 1, 0)/imageSize), - tex2D(tex, t+float2( 2, 0)/imageSize) ); - -} - -float4 tex2D_bicubicP1HQ(sampler2D tex, float2 t) -{ - float2 f = frac(t*intermediateSize); - - // filter in y - float4 w = computeWeights(f.y); - return cubicFilter(w, tex2D(tex, t+float2(0, -1)/intermediateSize), - tex2D(tex, t+float2(0, 0)/intermediateSize), - tex2D(tex, t+float2(0, 1)/intermediateSize), - tex2D(tex, t+float2(0, 2)/intermediateSize) ); - -} - -// Multi-pass, PS2.0, use partial precision where possible -float4 tex2D_bicubicP020(sampler2D tex, sampler1D weightTex, float2 t, float2 t0, float2 t1, float2 t2, float2 t3) -{ - float2 f = frac(t*imageSize); - - // filter in x - float4 w = tex1D(weightTex, f.x); - return cubicFilterh(w, tex2D(tex, t0), - tex2D(tex, t1), - tex2D(tex, t2), - tex2D(tex, t3) ); -} - -float4 tex2D_bicubicP120(sampler2D tex, sampler1D weightTex, float2 t, float2 t0, float2 t1, float2 t2, float2 t3) -{ - float2 f = frac(t*intermediateSize); - - // filter in y - float4 w = tex1D(weightTex, f.y); - return cubicFilterh(w, tex2D(tex, t0), - tex2D(tex, t1), - tex2D(tex, t2), - tex2D(tex, t3) ); -} - -// Multi-pass, compatible with PS1.4, use partial precision where possible -float4 tex2D_bicubicP014(sampler2D tex, sampler1D weightTex, float2 t, float2 t0, float2 t1, float2 t2, float2 t3) -{ - // filter in x - float4 w = tex1D(weightTex, t.x); - return cubicFilterh(w, -tex2D(tex, t0), - tex2D(tex, t1), - tex2D(tex, t2), - -tex2D(tex, t3) ); -} - -float4 tex2D_bicubicP114(sampler2D tex, sampler1D weightTex, float2 t, float2 t0, float2 t1, float2 t2, float2 t3) -{ - // filter in y - float4 w = tex1D(weightTex, t.y); - return cubicFilterh(w, -tex2D(tex, t0), - tex2D(tex, t1), - tex2D(tex, t2), - -tex2D(tex, t3) ); -} - -float4 bicubicSPHQPS(v2f IN) : COLOR -{ - return tex2D_bicubicSPHQ(imageSampler, IN.texcoord); -} - -float4 bicubicSPPS(v2f IN) : COLOR -{ - return tex2D_bicubicSP(imageSampler, weightSampler20, IN.texcoord); -} - -float4 bicubicP0HQPS(v2f IN) : COLOR -{ - return tex2D_bicubicP0HQ(imageSampler, IN.texcoord); -} -float4 bicubicP1HQPS(v2f IN) : COLOR -{ - return tex2D_bicubicP1HQ(intermediateSampler, IN.texcoord); -} - -float4 bicubicP0PS20(v2f5 IN) : COLOR -{ - return tex2D_bicubicP020(imageSampler, weightSampler20, IN.texcoord0, IN.texcoord2, IN.texcoord0, IN.texcoord3, IN.texcoord4); -} -float4 bicubicP1PS20(v2f5 IN) : COLOR -{ - return tex2D_bicubicP120(intermediateSampler, weightSampler20, IN.texcoord0, IN.texcoord2, IN.texcoord0, IN.texcoord3, IN.texcoord4); -} - -float4 bicubicP0PS14(v2f5 IN) : COLOR -{ - return tex2D_bicubicP014(imageSampler, weightSampler14, IN.texcoord1, IN.texcoord2, IN.texcoord0, IN.texcoord3, IN.texcoord4); -} -float4 bicubicP1PS14(v2f5 IN) : COLOR -{ - return tex2D_bicubicP114(intermediateSampler, weightSampler14, IN.texcoord1, IN.texcoord2, IN.texcoord0, IN.texcoord3, IN.texcoord4); -} - -// use this for arbitrarily sized scanlines -float4 bicubicP1ScanPS(v2f2 IN) : COLOR -{ - float4 col1 = tex2D(intermediateSampler, IN.texcoord0); - float4 col2 = tex2D(scanImageSampler, frac(IN.texcoord1) * scanSize); - - return col1 * (scanIntensity + col2 - scanIntensity * col2); -} - -technique SinglePassHQBicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=geometry;"; - > { - VertexShader = compile vs_1_1 bicubicVS(); - PixelShader = compile ps_2_0 bicubicSPHQPS(); - } -} - -technique SinglePassBicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=geometry;"; - > { - VertexShader = compile vs_1_1 bicubicVS(); - PixelShader = compile ps_2_0 bicubicSPPS(); - } -} - -technique MultiPassHQBicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=texture;"; - > { - VertexShader = compile vs_1_1 bicubicP0VS(); - PixelShader = compile ps_2_0 bicubicP0HQPS(); - } - pass p1 < - string Script = "Draw=geometry;"; - > { - VertexShader = compile vs_1_1 bicubicP1VS(); - PixelShader = compile ps_2_0 bicubicP1HQPS(); - } -} - -technique MultiPassBicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=texture;"; - > { - VertexShader = compile vs_1_1 bicubicP0VS(); - PixelShader = compile ps_2_0 bicubicP0PS20(); - } - pass p1 < - string Script = "Draw=geometry;"; - > { - VertexShader = compile vs_1_1 bicubicP1VS(); - PixelShader = compile ps_2_0 bicubicP1PS20(); - } -} - -technique MultiPassHP20Bicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=texture;"; - > { - VertexShader = compile vs_1_1 bicubicP0VS(); - PixelShader = compile ps_2_0 bicubicP0PS14(); - } - pass p1 < - string Script = "Draw=geometry;"; - > { - VertexShader = compile vs_1_1 bicubicP1VS(); - PixelShader = compile ps_2_0 bicubicP1PS14(); - } -} - -technique MultiPassHP14Bicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=texture;"; - > { - VertexShader = compile vs_1_1 bicubicP0VS(); - PixelShader = compile ps_1_4 bicubicP0PS14(); - } - pass p1 < - string Script = "Draw=geometry;"; - > { - VertexShader = compile vs_1_1 bicubicP1VS(); - PixelShader = compile ps_1_4 bicubicP1PS14(); - } -} - -technique Bilinear < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=geometry;"; - > { - Texture[0] = ; - TexCoordIndex[0] = 0; - AddressU[0] = WRAP; - AddressV[0] = WRAP; - MinFilter[0] = LINEAR; - MagFilter[0] = LINEAR; - ColorArg1[0] = TEXTURE; - ColorOP[0] = SELECTARG1; - AlphaOp[0] = DISABLE; - - ColorOP[1] = DISABLE; - - VertexShader = NULL; - PixelShader = NULL; - } -} - -technique Point < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=geometry;"; - > { - Texture[0] = ; - TexCoordIndex[0] = 0; - AddressU[0] = CLAMP; - AddressV[0] = CLAMP; - MinFilter[0] = POINT; - MagFilter[0] = POINT; - ColorArg1[0] = TEXTURE; - ColorOP[0] = SELECTARG1; - - AlphaOp[0] = DISABLE; - ColorOP[1] = DISABLE; - - VertexShader = NULL; - PixelShader = NULL; - } -} - -technique ScanHQBicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=texture;"; - > { - VertexShader = compile vs_1_1 bicubicP0VS(); - PixelShader = compile ps_2_0 bicubicP0HQPS(); - } - pass p1 < - string Script = "Draw=geometry;"; - > { -#if 0 - VertexShader = compile vs_1_1 bicubicP1ScanVS(); - PixelShader = compile ps_2_0 bicubicP1ScanPS(); -#else - // Stage 0 has the scanlines - Texture[0] = ; - TexCoordIndex[0] = 1; - AddressU[0] = WRAP; - AddressV[0] = WRAP; - MinFilter[0] = LINEAR; - MagFilter[0] = LINEAR; - ColorArg1[0] = TEXTURE; - ColorArg2[0] = TFACTOR; - ColorOP[0] = ADDSMOOTH; - - AlphaOp[0] = DISABLE; - - // Stage 1 has the image - Texture[1] = ; - TexCoordIndex[1] = 0; - AddressU[1] = BORDER; - AddressV[1] = BORDER; - MinFilter[1] = LINEAR; - MagFilter[1] = POINT; - ColorArg1[1] = TEXTURE; - ColorArg2[1] = CURRENT; - ColorOP[1] = MODULATE; - - ColorOP[2] = DISABLE; - - VertexShader = NULL; - PixelShader = NULL; -#endif - } -} - -technique ScanBicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=texture;"; - > { - VertexShader = compile vs_1_1 bicubicP0VS(); - PixelShader = compile ps_2_0 bicubicP0PS20(); - } - pass p1 < - string Script = "Draw=geometry;"; - > { - // Stage 0 has the scanlines - Texture[0] = ; - TexCoordIndex[0] = 1; - AddressU[0] = WRAP; - AddressV[0] = WRAP; - MinFilter[0] = LINEAR; - MagFilter[0] = LINEAR; - ColorArg1[0] = TEXTURE; - ColorArg2[0] = TFACTOR; - ColorOP[0] = ADDSMOOTH; - - AlphaOp[0] = DISABLE; - - // Stage 1 has the image - Texture[1] = ; - TexCoordIndex[1] = 0; - AddressU[1] = BORDER; - AddressV[1] = BORDER; - MinFilter[1] = LINEAR; - MagFilter[1] = POINT; - ColorArg1[1] = TEXTURE; - ColorArg2[1] = CURRENT; - ColorOP[1] = MODULATE; - - ColorOP[2] = DISABLE; - - VertexShader = NULL; - PixelShader = NULL; - } -} - -technique ScanHP20Bicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=texture;"; - > { - VertexShader = compile vs_1_1 bicubicP0VS(); - PixelShader = compile ps_2_0 bicubicP0PS14(); - } - pass p1 < - string Script = "Draw=geometry;"; - > { - // Stage 0 has the scanlines - Texture[0] = ; - TexCoordIndex[0] = 1; - AddressU[0] = WRAP; - AddressV[0] = WRAP; - MinFilter[0] = LINEAR; - MagFilter[0] = LINEAR; - ColorArg1[0] = TEXTURE; - ColorArg2[0] = TFACTOR; - ColorOP[0] = ADDSMOOTH; - - AlphaOp[0] = DISABLE; - - // Stage 1 has the image - Texture[1] = ; - TexCoordIndex[1] = 0; - AddressU[1] = BORDER; - AddressV[1] = BORDER; - MinFilter[1] = LINEAR; - MagFilter[1] = POINT; - ColorArg1[1] = TEXTURE; - ColorArg2[1] = CURRENT; - ColorOP[1] = MODULATE; - - ColorOP[2] = DISABLE; - - VertexShader = NULL; - PixelShader = NULL; - } -} - -technique ScanHP14Bicubic < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=texture;"; - > { - VertexShader = compile vs_1_1 bicubicP0VS(); - PixelShader = compile ps_1_4 bicubicP0PS14(); - } - pass p1 < - string Script = "Draw=geometry;"; - > { - // Stage 0 has the scanlines - Texture[0] = ; - TexCoordIndex[0] = 1; - AddressU[0] = WRAP; - AddressV[0] = WRAP; - MinFilter[0] = LINEAR; - MagFilter[0] = LINEAR; - ColorArg1[0] = TEXTURE; - ColorArg2[0] = TFACTOR; - ColorOP[0] = ADDSMOOTH; - - AlphaOp[0] = DISABLE; - - // Stage 1 has the image - Texture[1] = ; - TexCoordIndex[1] = 0; - AddressU[1] = BORDER; - AddressV[1] = BORDER; - MinFilter[1] = LINEAR; - MagFilter[1] = POINT; - ColorArg1[1] = TEXTURE; - ColorArg2[1] = CURRENT; - ColorOP[1] = MODULATE; - - ColorOP[2] = DISABLE; - - VertexShader = NULL; - PixelShader = NULL; - } -} - -technique ScanBilinear < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=texture;"; - > { - Texture[0] = ; - TexCoordIndex[0] = 0; - AddressU[0] = BORDER; - AddressV[0] = BORDER; - MinFilter[0] = LINEAR; - MagFilter[0] = LINEAR; - ColorArg1[0] = TEXTURE; - ColorOP[0] = SELECTARG1; - AlphaOp[0] = DISABLE; - - ColorOP[1] = DISABLE; - - VertexShader = NULL; - PixelShader = NULL; - } - pass p1 < - string Script = "Draw=geometry;"; - > { - // Stage 0 has the scanlines - Texture[0] = ; - TexCoordIndex[0] = 1; - AddressU[0] = WRAP; - AddressV[0] = WRAP; - MinFilter[0] = LINEAR; - MagFilter[0] = POINT; - ColorArg1[0] = TEXTURE; - ColorArg2[0] = TFACTOR; - ColorOP[0] = ADDSMOOTH; - - AlphaOp[0] = DISABLE; - - // Stage 1 has the image - Texture[1] = ; - TexCoordIndex[1] = 0; - AddressU[1] = BORDER; - AddressV[1] = BORDER; - MinFilter[1] = LINEAR; - MagFilter[1] = POINT; - ColorArg1[1] = TEXTURE; - ColorArg2[1] = CURRENT; - ColorOP[1] = MODULATE; - - ColorOP[2] = DISABLE; - - VertexShader = NULL; - PixelShader = NULL; - } -} - -technique ScanPoint < - string Script = "Pass=p0;"; -> { - pass p0 < - string Script = "Draw=geometry;"; - > { - // Stage 0 has the scanlines - Texture[0] = ; - TexCoordIndex[0] = 1; - AddressU[0] = WRAP; - AddressV[0] = WRAP; - MinFilter[0] = LINEAR; - MagFilter[0] = LINEAR; - ColorArg1[0] = TEXTURE; - ColorArg2[0] = TFACTOR; - ColorOP[0] = ADDSMOOTH; - - AlphaOp[0] = DISABLE; - - // Stage 1 has the image - Texture[1] = ; - TexCoordIndex[1] = 0; - AddressU[1] = BORDER; - AddressV[1] = BORDER; - MinFilter[1] = LINEAR; - MagFilter[1] = POINT; - ColorArg1[1] = TEXTURE; - ColorArg2[1] = CURRENT; - ColorOP[1] = MODULATE; - - ColorOP[2] = DISABLE; - - VertexShader = NULL; - PixelShader = NULL; - } -} - diff --git a/jan/src/intf/video/win32/rgb_pattern.h b/jan/src/intf/video/win32/rgb_pattern.h deleted file mode 100644 index 9fe309617..000000000 --- a/jan/src/intf/video/win32/rgb_pattern.h +++ /dev/null @@ -1,210 +0,0 @@ -// d3d RGB effects patterns - -static const unsigned char pattern_18x10_large_round[] = -{ - 0x00,0x00,0x5f,0xff, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x3f,0x00,0x00,0xff, - 0x5f,0x00,0x00,0xff, 0x3f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x3f,0x00,0xff, - 0x00,0x5f,0x00,0xff, 0x00,0x3f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x3f,0xff, - - 0x00,0x00,0xdf,0xff, 0x00,0x00,0x9f,0xff, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x00,0x00, 0x3f,0x00,0x00,0xff, 0x9f,0x00,0x00,0xff, - 0xdf,0x00,0x00,0xff, 0x9f,0x00,0x00,0xff, 0x3f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x3f,0x00,0xff, 0x00,0x9f,0x00,0xff, - 0x00,0xdf,0x00,0xff, 0x00,0x9f,0x00,0xff, 0x00,0x3f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x9f,0xff, - - 0x00,0x00,0xff,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0x00,0x00, 0x5f,0x00,0x00,0xff, 0xe1,0x00,0x00,0xff, - 0xff,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x5f,0x00,0xff, 0x00,0xe1,0x00,0xff, - 0x00,0xff,0x00,0xff, 0x00,0xdf,0x00,0xff, 0x00,0x5f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xe1,0xff, - - 0x00,0x00,0xdf,0xff, 0x00,0x00,0x9f,0xff, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x00,0x00, 0x3f,0x00,0x00,0xff, 0x9f,0x00,0x00,0xff, - 0xdf,0x00,0x00,0xff, 0x9f,0x00,0x00,0xff, 0x3f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x3f,0x00,0xff, 0x00,0x9f,0x00,0xff, - 0x00,0xdf,0x00,0xff, 0x00,0x9f,0x00,0xff, 0x00,0x3f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x9f,0xff, - - 0x00,0x00,0x5f,0xff, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x3f,0x00,0x00,0xff, - 0x5f,0x00,0x00,0xff, 0x3f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x3f,0x00,0xff, - 0x00,0x5f,0x00,0xff, 0x00,0x3f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x3f,0xff, - - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x3f,0x00,0xff, 0x00,0x5f,0x00,0xff, 0x00,0x3f,0x00,0xff, 0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x3f,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x3f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, - - 0x00,0x00,0x00,0x00, 0x00,0x3f,0x00,0xff, 0x00,0x9f,0x00,0xff, 0x00,0xdf,0x00,0xff, 0x00,0x9f,0x00,0xff, 0x00,0x3f,0x00,0xff, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x9f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x9f,0xff, 0x00,0x00,0x3f,0xff, - 0x00,0x00,0x00,0x00, 0x3f,0x00,0x00,0xff, 0x9f,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x9f,0x00,0x00,0xff, 0x3f,0x00,0x00,0xff, - - 0x00,0x00,0x00,0x00, 0x00,0x5f,0x00,0xff, 0x00,0xe1,0x00,0xff, 0x00,0xff,0x00,0xff, 0x00,0xdf,0x00,0xff, 0x00,0x5f,0x00,0xff, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xe1,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, - 0x00,0x00,0x00,0x00, 0x5f,0x00,0x00,0xff, 0xe1,0x00,0x00,0xff, 0xff,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, - - 0x00,0x00,0x00,0x00, 0x00,0x3f,0x00,0xff, 0x00,0x9f,0x00,0xff, 0x00,0xdf,0x00,0xff, 0x00,0x9f,0x00,0xff, 0x00,0x3f,0x00,0xff, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x9f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x9f,0xff, 0x00,0x00,0x3f,0xff, - 0x00,0x00,0x00,0x00, 0x3f,0x00,0x00,0xff, 0x9f,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x9f,0x00,0x00,0xff, 0x3f,0x00,0x00,0xff, - - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x3f,0x00,0xff, 0x00,0x5f,0x00,0xff, 0x00,0x3f,0x00,0xff, 0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0x3f,0xff, 0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x3f,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x3f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00 -}; - -static const unsigned char pattern_12x10_large_ellipsoid[] = -{ - 0x5f,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x5f,0x00,0xff, 0x00,0xdf,0x00,0xff, - 0x00,0x5f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0x00,0x00, - - 0x7f,0x00,0x00,0xff, 0xff,0x00,0x00,0xff, 0x7f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x7f,0x00,0xff, 0x00,0xff,0x00,0xff, - 0x00,0x7f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x7f,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x00,0x00, - - 0x5f,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x5f,0x00,0xff, 0x00,0xdf,0x00,0xff, - 0x00,0x5f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0x00,0x00, - - 0x1f,0x00,0x00,0xff, 0x7f,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x1f,0x00,0xff, 0x00,0x7f,0x00,0xff, - 0x00,0x1f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x00,0x00, - - 0x00,0x1f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x00,0x00, - 0x1f,0x00,0x00,0xff, 0x7f,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x1f,0x00,0xff, 0x00,0x7f,0x00,0xff, - - 0x00,0x5f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0x00,0x00, - 0x5f,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x5f,0x00,0xff, 0x00,0xdf,0x00,0xff, - - 0x00,0x7f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x7f,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x00,0x00, - 0x7f,0x00,0x00,0xff, 0xff,0x00,0x00,0xff, 0x7f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x7f,0x00,0xff, 0x00,0xff,0x00,0xff, - - 0x00,0x5f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0x00,0x00, - 0x5f,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x5f,0x00,0xff, 0x00,0xdf,0x00,0xff, - - 0x00,0x1f,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x00,0x00, - 0x1f,0x00,0x00,0xff, 0x7f,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0x00,0x00,0x00, 0x00,0x1f,0x00,0xff, 0x00,0x7f,0x00,0xff, - - 0x1f,0x00,0x00,0x00, 0x7f,0x00,0x00,0xff, 0x1f,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x1f,0x00,0x00, 0x00,0x7f,0x00,0xff, - 0x00,0x1f,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x1f,0x00, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x1f,0x00, 0x00,0x00,0x00,0x00 -}; - -static const unsigned char pattern_10x6_large_dot[] = -{ - 0x00,0xff,0x00,0x00, 0x00,0x7f,0xff,0x00, 0x00,0x00,0xff,0x00, 0x00,0x00,0x00,0xff, 0x00,0x00,0x00,0xff, - 0x00,0x00,0x00,0xff, 0x00,0x00,0x00,0xff, 0x00,0x00,0x00,0xff, 0xff,0x00,0x00,0x00, 0xff,0x7f,0x00,0x00, - - 0x00,0xff,0x00,0x00, 0x00,0x3f,0xff,0x00, 0x00,0x00,0xbf,0x00, 0x00,0x00,0x00,0xff, 0xff,0x00,0x00,0x00, - 0x00,0xbf,0x00,0x00, 0x00,0x00,0xff,0x00, 0x00,0x00,0x00,0xff, 0xbf,0x00,0x00,0x00, 0xff,0x3f,0x00,0x00, - - 0x00,0xbf,0x00,0x00, 0x00,0x00,0xff,0x00, 0x00,0x00,0x00,0xff, 0xbf,0x00,0x00,0x00, 0xff,0x3f,0x00,0x00, - 0x00,0xff,0x00,0x00, 0x00,0x3f,0xff,0x00, 0x00,0x00,0xbf,0x00, 0x00,0x00,0x00,0xff, 0xff,0x00,0x00,0x00, - - 0x00,0x00,0x00,0xff, 0x00,0x00,0x00,0xff, 0x00,0x00,0x00,0xff, 0xff,0x00,0x00,0x00, 0xff,0x7f,0x00,0x00, - 0x00,0xff,0x00,0x00, 0x00,0x7f,0xff,0x00, 0x00,0x00,0xff,0x00, 0x00,0x00,0x00,0xff, 0x00,0x00,0x00,0xff, - - 0x00,0xbf,0x00,0x00, 0x00,0x00,0xff,0x00, 0x00,0x00,0x00,0xff, 0xbf,0x00,0x00,0x00, 0xff,0x3f,0x00,0x00, - 0x00,0xff,0x00,0x00, 0x00,0x3f,0xff,0x00, 0x00,0x00,0xbf,0x00, 0x00,0x00,0x00,0xff, 0xff,0x00,0x00,0x00, - - 0x00,0xff,0x00,0x00, 0x00,0x3f,0xff,0x00, 0x00,0x00,0xbf,0x00, 0x00,0x00,0x00,0xff, 0xff,0x00,0x00,0x00, - 0x00,0xbf,0x00,0x00, 0x00,0x00,0xff,0x00, 0x00,0x00,0x00,0xff, 0xbf,0x00,0x00,0x00, 0xff,0x3f,0x00,0x00 -}; - -static const unsigned char pattern_9x10_ellipsoid[] = -{ - 0x5f,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0x5f,0x00,0xff, 0x00,0xdf,0x00,0xff, - 0x00,0x5f,0x00,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, - 0x7f,0x00,0x00,0xff, 0xff,0x00,0x00,0xff, 0x7f,0x00,0x00,0xff, 0x00,0x7f,0x00,0xff, 0x00,0xff,0x00,0xff, - 0x00,0x7f,0x00,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x7f,0xff, - 0x5f,0x00,0x00,0xff, 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0x5f,0x00,0xff, 0x00,0xdf,0x00,0xff, - 0x00,0x5f,0x00,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, - 0x1f,0x00,0x00,0xff, 0x7f,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0x1f,0x00,0xff, 0x00,0x7f,0x00,0xff, - 0x00,0x1f,0x00,0xff, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x1f,0xff, - 0x00,0x1f,0x00,0xff, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x1f,0xff, 0x1f,0x00,0x00,0xff, - 0x7f,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0x1f,0x00,0xff, 0x00,0x7f,0x00,0xff, - 0x00,0x5f,0x00,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, 0x5f,0x00,0x00,0xff, - 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0x5f,0x00,0xff, 0x00,0xdf,0x00,0xff, - 0x00,0x7f,0x00,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x7f,0xff, 0x7f,0x00,0x00,0xff, - 0xff,0x00,0x00,0xff, 0x7f,0x00,0x00,0xff, 0x00,0x7f,0x00,0xff, 0x00,0xff,0x00,0xff, - 0x00,0x5f,0x00,0xff, 0x00,0x00,0x5f,0xff, 0x00,0x00,0xdf,0xff, 0x00,0x00,0x5f,0xff, 0x5f,0x00,0x00,0xff, - 0xdf,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0x5f,0x00,0xff, 0x00,0xdf,0x00,0xff, - 0x00,0x1f,0x00,0xff, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x1f,0xff, 0x1f,0x00,0x00,0xff, - 0x7f,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0x1f,0x00,0xff, 0x00,0x7f,0x00,0xff, - 0x1f,0x00,0x00,0xff, 0x7f,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0x1f,0x00,0xff, 0x00,0x7f,0x00,0xff, - 0x00,0x1f,0x00,0xff, 0x00,0x00,0x1f,0xff, 0x00,0x00,0x7f,0xff, 0x00,0x00,0x1f,0xff -}; - -static const unsigned char pattern_8x8_mame_rgbtiny[] = -{ - 0x00,0xff,0x00,0x00, 0x00,0x80,0x00,0x00, 0x00,0x80,0xff,0x00, 0x80,0x00,0xff,0x00, - 0x80,0x00,0x00,0x00, 0xff,0x00,0x00,0x00, 0xff,0xff,0xff,0x00, 0xff,0xff,0xff,0x00, - - 0x00,0xff,0x00,0x00, 0x00,0x80,0x00,0x00, 0x00,0x80,0xff,0x00, 0x80,0x00,0xff,0x00, - 0x80,0x00,0x00,0x00, 0xff,0x00,0x00,0x00, 0xff,0xff,0xff,0x00, 0xff,0xff,0xff,0x00, - - 0x00,0x80,0x00,0x00, 0x00,0x00,0x00,0x00, 0x80,0xff,0x80,0x00, 0xff,0x80,0x80,0x00, - 0x00,0x00,0x00,0x00, 0x80,0x00,0x00,0x00, 0xff,0xff,0xff,0x00, 0xff,0xff,0xff,0x00, - - 0x00,0x00,0x00,0x00, 0x80,0x00,0x00,0x00, 0xff,0xff,0xff,0x00, 0xff,0xff,0xff,0x00, - 0x00,0x80,0x00,0x00, 0x00,0x00,0x00,0x00, 0x80,0xff,0x80,0x00, 0xff,0x80,0x80,0x00, - - 0x80,0x00,0x00,0x00, 0xff,0x00,0x00,0x00, 0xff,0xff,0xff,0x00, 0xff,0xff,0xff,0x00, - 0x00,0xff,0x00,0x00, 0x00,0x80,0x00,0x00, 0x00,0x80,0xff,0x00, 0x80,0x00,0xff,0x00, - - 0x80,0x00,0x00,0x00, 0xff,0x00,0x00,0x00, 0xff,0xff,0xff,0x00, 0xff,0xff,0xff,0x00, - 0x00,0xff,0x00,0x00, 0x00,0x80,0x00,0x00, 0x00,0x80,0xff,0x00, 0x80,0x00,0xff,0x00, - - 0x00,0x00,0x00,0x00, 0x80,0x00,0x00,0x00, 0xff,0xff,0xff,0x00, 0xff,0xff,0xff,0x00, - 0x00,0x80,0x00,0x00, 0x00,0x00,0x00,0x00, 0x80,0xff,0x80,0x00, 0xff,0x80,0x80,0x00, - - 0x00,0x80,0x00,0x00, 0x00,0x00,0x00,0x00, 0x80,0xff,0x80,0x00, 0xff,0x80,0x80,0x00, - 0x00,0x00,0x00,0x00, 0x80,0x00,0x00,0x00, 0xff,0xff,0xff,0x00, 0xff,0xff,0xff,0x00 -}; - -static const unsigned char pattern_6x8_rgb_pattern[] = -{ - 0xbf,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0xbf,0x00,0xff, 0x00,0x1f,0x00,0xff, 0x00,0x00,0xbf,0xff, 0x00,0x00,0x1f,0xff, - 0xff,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, 0x00,0x5f,0x00,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x5f,0xff, - 0xbf,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0xbf,0x00,0xff, 0x00,0x1f,0x00,0xff, 0x00,0x00,0xbf,0xff, 0x00,0x00,0x1f,0xff, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, - 0x00,0x1f,0x00,0xff, 0x00,0x00,0xbf,0xff, 0x00,0x00,0x1f,0xff, 0xbf,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0xbf,0x00,0xff, - 0x00,0x5f,0x00,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x5f,0xff, 0xff,0x00,0x00,0xff, 0x5f,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, - 0x00,0x1f,0x00,0xff, 0x00,0x00,0xbf,0xff, 0x00,0x00,0x1f,0xff, 0xbf,0x00,0x00,0xff, 0x1f,0x00,0x00,0xff, 0x00,0xbf,0x00,0xff, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 -}; - -static const unsigned char pattern_4x6_rgb_pattern[] = -{ - 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, - 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, - 0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, - 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 -}; - -static const unsigned char pattern_4x4_mame_rgbtiny[] = -{ - 0x00,0xff,0x00,0x00, 0x00,0x00,0xff,0x00, 0xff,0x00,0x00,0x00, 0xff,0xff,0xff,0xff, - 0x00,0x00,0x00,0xff, 0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0xff, 0xff,0xff,0xff,0xff, - 0xff,0x00,0x00,0x00, 0xff,0xff,0xff,0xff, 0x00,0xff,0x00,0x00, 0x00,0x00,0xff,0x00, - 0x00,0x00,0x00,0xff, 0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0xff, 0xff,0xff,0xff,0xff -}; - -static const unsigned char pattern_4x4_rgb_pattern[] = -{ - 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, - 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, 0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, - 0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff -}; - -static const unsigned char pattern_3x1_aperture_grille[] = -{ - 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, 0x00,0x00,0xff,0xff -}; - -// pattern info - -static struct { const TCHAR* szName; const unsigned char* pData; } BuiltinPatternInfo[] = -{ - { _T("18x10_large_round.i.rgb"), pattern_18x10_large_round }, - { _T("12x10_large_ellipsoid.i.rgb"), pattern_12x10_large_ellipsoid }, - { _T("10x6_large_dot.i.rgb"), pattern_10x6_large_dot }, - { _T("9x10_ellipsoid.i.rgb"), pattern_9x10_ellipsoid }, - { _T("8x8_mame_rgbtiny.i.rgb"), pattern_8x8_mame_rgbtiny }, - { _T("6x8_rgb_pattern.i.rgb"), pattern_6x8_rgb_pattern }, - { _T("4x6_rgb_pattern.i.rgb"), pattern_4x6_rgb_pattern }, - { _T("4x4_mame_rgbtiny.i.rgb"), pattern_4x4_mame_rgbtiny }, - { _T("4x4_rgb_pattern.i.rgb"), pattern_4x4_rgb_pattern }, - { _T("3x1_aperture_grille.i.rgb"), pattern_3x1_aperture_grille }, - - { NULL, NULL } -}; diff --git a/jan/src/intf/video/win32/vid_d3d.cpp b/jan/src/intf/video/win32/vid_d3d.cpp deleted file mode 100644 index cc44fc15d..000000000 --- a/jan/src/intf/video/win32/vid_d3d.cpp +++ /dev/null @@ -1,2448 +0,0 @@ -// DirectD3D blitter - -// #define USE_D3D_REFERENCE_DEVICE - -#include "burner.h" - -#if !defined BUILD_X64_EXE - -// #include "vid_directx_support.h" -#include -#include "vid_softfx.h" - -// #define ENABLE_PROFILING FBA_DEBUG - -#define DIRECT3D_VERSION 0x0700 // Use this Direct3D version -#define D3D_OVERLOADS -#include - -#include "rgb_pattern.h" - -#include "ddraw_core.h" - -const float PI = 3.14159265358979323846f; - -typedef struct _D3DTLVERTEX2 { - union { D3DVALUE sx; D3DVALUE dvSX; }; - union { D3DVALUE sy; D3DVALUE dvSY; }; - union { D3DVALUE sz; D3DVALUE dvSZ; }; - union { D3DVALUE rhw; D3DVALUE dvRHW; }; - union { D3DCOLOR color; D3DCOLOR dcColor; }; - union { D3DCOLOR specular; D3DCOLOR dcSpecular; }; - union { D3DVALUE tu; D3DVALUE dvTU; }; - union { D3DVALUE tv; D3DVALUE dvTV; }; - union { D3DVALUE tu1; D3DVALUE dvTU1; }; - union { D3DVALUE tv1; D3DVALUE dvTV1; }; -#if(DIRECT3D_VERSION >= 0x0500) - #if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DTLVERTEX2() { } - _D3DTLVERTEX2(const D3DVECTOR& v, float _rhw, D3DCOLOR _color, D3DCOLOR _specular, float _tu, float _tv, float _tu1, float _tv1) - { - sx = v.x; sy = v.y; sz = v.z; rhw = _rhw; - color = _color; specular = _specular; - tu = _tu; tv = _tv; - tu1 = _tu1; tv1 = _tv1; - } - #endif -#endif -} D3DTLVERTEX2, *LPD3DTLVERTEX2; - -#define D3DFVF_TLVERTEX2 ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX2 | D3DFVF_TEXCOORDSIZE2(0) | D3DFVF_TEXCOORDSIZE2(1) ) - -typedef struct _D3DLVERTEX2 { - union { D3DVALUE x; D3DVALUE dvX; }; - union { D3DVALUE y; D3DVALUE dvY; }; - union { D3DVALUE z; D3DVALUE dvZ; }; - DWORD dwReserved; - union { D3DCOLOR color; D3DCOLOR dcColor; }; - union { D3DCOLOR specular; D3DCOLOR dcSpecular; }; - union { D3DVALUE tu; D3DVALUE dvTU; }; - union { D3DVALUE tv; D3DVALUE dvTV; }; - union { D3DVALUE tu1; D3DVALUE dvTU1; }; - union { D3DVALUE tv1; D3DVALUE dvTV1; }; -#if(DIRECT3D_VERSION >= 0x0500) - #if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DLVERTEX2() { } - _D3DLVERTEX2(const D3DVECTOR& v, D3DCOLOR _color, D3DCOLOR _specular, float _tu, float _tv, float _tu1, float _tv1) - { - x = v.x; y = v.y; z = v.z; dwReserved = 0; - color = _color; specular = _specular; - tu = _tu; tv = _tv; - tu1 = _tu1; tv1 = _tv1; - } - #endif -#endif -} D3DLVERTEX2, *LPD3DLVERTEX2; - -#define D3DFVF_LVERTEX2 ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX2 | D3DFVF_TEXCOORDSIZE2(0) | D3DFVF_TEXCOORDSIZE2(1) ) - -typedef struct _D3DVERTEX2 { - union { D3DVALUE x; D3DVALUE dvX; }; - union { D3DVALUE y; D3DVALUE dvY; }; - union { D3DVALUE z; D3DVALUE dvZ; }; - union { D3DVALUE nx; D3DVALUE dvNX; }; - union { D3DVALUE ny; D3DVALUE dvNY; }; - union { D3DVALUE nz; D3DVALUE dvNZ; }; - union { D3DVALUE tu; D3DVALUE dvTU; }; - union { D3DVALUE tv; D3DVALUE dvTV; }; - union { D3DVALUE tu1; D3DVALUE dvTU1; }; - union { D3DVALUE tv1; D3DVALUE dvTV1; }; -#if(DIRECT3D_VERSION >= 0x0500) - #if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DVERTEX2() { } - _D3DVERTEX2(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv, float _tu1, float _tv1) - { - x = v.x; y = v.y; z = v.z; - nx = n.x; ny = n.y; nz = n.z; - tu = _tu; tv = _tv; - tu1 = _tu1; tv1 = _tv1; - } - #endif -#endif -} D3DVERTEX2, *LPD3DVERTEX2; - -#define D3DFVF_VERTEX2 ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX2 | D3DFVF_TEXCOORDSIZE2(0) | D3DFVF_TEXCOORDSIZE2(1) ) - -static bool bLostControl; - -static bool bUsePageflip; // Use a flipping surface when in fullscreen mode -static bool bUseTriplebuffer; - -static bool bMultiTexturing; -static bool bRenderToTexture; - -struct EffectPreset { - int nUseFilter; // -1: disable, 1: enable, use specified settings, 0: don't change - int nUseEffects; // - int nUseScanlines; // - int nUseFeedback; // - int nUsePrescale; // - - int nIntensity; - int nFloor; - int nSaturation; - int nPatternMode; - TCHAR* pPatternName; - int nAttenuation; - int nBlendMode; - - int nScanIntensity; - - int nAmount; - int nOverSaturation; -}; - -static const EffectPreset PresetInfo[] = { - { 0, -1, -1, 0, -1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0 }, // 1x zoom - { 1, 1, 1, 0, 0, 0x0080, 0x20, 0x00, 0, _T("4x4_rgb_pattern.i.rgb"), 0x00, 0, 0x008F8F8F, 0, 0 }, // 2x zoom - { 1, 1, 1, 0, 0, 0x00A0, 0x30, 0x00, 2, _T("4x6_rgb_pattern.i.rgb"), 0x00, 0, 0x005F5F5F, 0, 0 }, // 3x zoom - { 1, 1, 1, 0, 1, 0x0080, 0x20, 0x00, 3, _T("6x8_rgb_pattern.i.rgb"), 0x20, 0, 0x004F4F4F, 0, 0 }, // 4x zoom - { 1, 1, 1, 0, 1, 0x0060, 0x10, 0x48, 3, _T("9x10_ellipsoid.i.rgb"), 0x20, 0, 0x005F5F5F, 0, 0 }, // 5x zoom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0 }, // 6x zoom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0 }, // 7x zoom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0 }, // 8x zoom - - // Selectable presets - { 0, 1, -1, 0, 0, 0x0100, 0x80, 0x40, 2, _T("4x6_rgb_pattern.i.rgb"), 0, 1, 0, 0, 0 }, // Small Faint RGB mask - { 0, 1, -1, 0, 0, 0x0100, 0x80, 0x40, 2, _T("10x6_large_dot.i.rgb"), 0, 1, 0, 0, 0 }, // Large RGB Dot mask - { 0, 1, -1, 0, 0, 0x0100, 0x90, 0x80, 2, _T("12x10_large_ellipsoid.i.rgb"), 0, 1, 0, 0, 0 }, // Large Faint RGB mask - { 0, 1, -1, 0, 0, 0x0100, 0xC0, 0x00, 0, _T("4x4_mame_rgbtiny.i.rgb"), 0, 1, 0, 0, 0 }, // MAME rgbtiny small - { 0, 1, -1, 0, 0, 0x0100, 0xD0, 0x00, 0, _T("8x8_mame_rgbtiny.i.rgb"), 0, 1, 0, 0, 0 }, // MAME rgbtiny large - { 0, 1, 1, 0, 0, 0x0030, 0x00, 0x00, 0, _T("3x1_aperture_grille.i.rgb"), 0x20, 0, 0x00BFBFBF, 0, 0 }, // Aperture Grille - { 0, 1, -1, 0, 0, 0x0040, 0x00, 0x00, 0, _T("10x6_large_dot.i.rgb"), 0x08, 0, 0, 0, 0 }, // Large Oversaturated RGB Dot - { 0, 1, -1, 0, 0, 0x00E0, 0x00, 0x40, 3, _T("18x10_large_round.i.rgb"), 0x10, 0, 0, 0, 0 }, // Huge Oversaturated pattern -}; - -static bool bCreateImage = false; - -static bool bUseRGBEffects = false; // Use RGB effects - -static int nRGBScanlineIntensity = 0; // Scanline intensity when RGB effects are used - -static int nRGBEffectIntensity = 0x0100; // Multiply pattern RGB values with this -static int nRGBEffectFloor = 0x00; // Minimum pattern colour grey-value -static int nRGBEffectSaturation = 0x00; // Minimum saturation of the pattern colours -static int nRGBEffectPatternmode = 0; // How to use the Floor/Saturation values -static int nRGBEffectAttenuation = 0; // How much to attenuate the image before applying RGB effects -static TCHAR* pRGBEffectPatternName = _T("4x6 RGB Pattern.rgb"); // Pattern to use -static int nRGBEffectBlendmode = 1; // Set of D3D blendmodes - -static int nRotateGame; -static bool bRotateEffects; // Use rotated scanlines/RGB patterns for rotated games - -static bool bUseLighting; -static bool bUse3DProjection; - -static float fPreviousScreenAngle; -static float fPreviousScreenCurvature; - -static int nPreScale = 0; -static int nPreScaleZoom = 0; -static int nPreScaleEffect = 0; - -static IDirectDraw7* pDD = NULL; // DirectDraw interface -static IDirect3D7* pD3D = NULL; // Direct3D interface -static IDirect3DDevice7* pD3DDevice = NULL; - -static D3DDEVICEDESC7 d3dDeviceDesc; // holds capabilities of the 3D hardware - -static IDirectDrawSurface7* pPrimarySurf = NULL; // Primary surface -static IDirectDrawSurface7* pBackbuffer = NULL; // Back buffer surface - -static D3DVIEWPORT7 Viewport = {0, 0, 0, 0, 0.0f, 10.0f}; - -static RECT Dest = { 0, 0, 0, 0 }; -static RECT Render; - -static int nZoomFactor; - -static int nGameWidth = 0, nGameHeight = 0; // Game screen size -static int nGameImageWidth, nGameImageHeight; - -static IDirectDrawSurface7* pEmuImage[4] = {NULL, }; // The emulator screen surfaces/textures - -static int nTextureWidth, nTextureHeight; -static int nPreScaleTextureWidth, nPreScaleTextureHeight; -static IDirectDrawSurface7* pScanlineTexture[2] = {NULL, }; // The scanline textures - -static IDirectDrawSurface7* pRGBEffectTexture = NULL; // The RGB effects texture - -static DWORD nScanlineOp; - -static int n3DScreenGridSize; - -static D3DTLVERTEX2 vScreen[4]; // Vectors for emulator image, screen coordinates -static D3DVERTEX2* v3DScreen = NULL; // Vectors for emulator image, 3D coordinates -static D3DTLVERTEX vFeedbackImage[4]; // Vectors for feedback - -static D3DMATRIX matWorld; -static D3DMATRIX matView; -static D3DMATRIX matProjection; -// static D3DMATRIX matIdentity = D3DMATRIX(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1); - -static void SetWorldMatrix() -{ -/* - matView._12 = matView._13 = matView._14 = 0.0f; - matView._21 = matView._23 = matView._24 = 0.0f; - matView._31 = matView._32 = matView._34 = 0.0f; - matView._41 = 0.0f; - matView._11 = matView._22 = matView._33 = matView._44 = 1.0f; - - matView._42 = -1.0f; - matView._43 = fNearPlane; - - pD3DDevice->SetTransform(D3DTRANSFORMSTATE_WORLD, &matView); -*/ - - matWorld._12 = matWorld._13 = matWorld._14 = matWorld._21 = matWorld._24 = 0.0f; - matWorld._31 = matWorld._34 = matWorld._41 = matWorld._42 = matWorld._43 = 0.0f; - matWorld._11 = matWorld._44 = 1.0f; - - matWorld._22 = (float)cos(fVidScreenAngle); - matWorld._23 = (float)sin(fVidScreenAngle); - matWorld._32 = -(float)sin(fVidScreenAngle); - matWorld._33 = (float)cos(fVidScreenAngle); - - pD3DDevice->SetTransform(D3DTRANSFORMSTATE_WORLD, &matWorld); - -// pD3DDevice->MultiplyTransform(D3DTRANSFORMSTATE_WORLD, &matWorld); -} - -static void SetViewMatrix(float fNearPlane) -{ - matView._12 = matView._13 = matView._14 = 0.0f; - matView._21 = matView._23 = matView._24 = 0.0f; - matView._31 = matView._32 = matView._34 = 0.0f; - matView._41 = 0.0f; - matView._11 = matView._22 = matView._33 = matView._44 = 1.0f; - - matView._42 = -1.0f; - matView._43 = fNearPlane; - - pD3DDevice->SetTransform(D3DTRANSFORMSTATE_VIEW, &matView); -} - -static void SetProjectionMatrix(float fNearPlane) -{ - // Set projection matrix for perspective - memset(&matProjection, 0, sizeof(D3DMATRIX)); - - float fFarPlane = 1000.0f; - float Q = fFarPlane / (fFarPlane - fNearPlane); - - matProjection._11 = fNearPlane; - matProjection._22 = fNearPlane; - matProjection._33 = Q; - matProjection._34 = 1.0f; - matProjection._43 = -Q * fNearPlane; - - pD3DDevice->SetTransform(D3DTRANSFORMSTATE_PROJECTION, &matProjection); -} - -static int GetTextureSize(int nSize) -{ - int nTextureSize = 128; - - while (nTextureSize < nSize) { - nTextureSize <<= 1; - } - - return nTextureSize; -} - -static int Update3DScreen() -{ - if (bUse3DProjection) { - - if (v3DScreen == NULL) { - v3DScreen = (D3DVERTEX2*)malloc(6 * n3DScreenGridSize * n3DScreenGridSize * sizeof(D3DVERTEX2)); - if (v3DScreen == NULL) { - return 1; - } - } - - // Use a 3D world and tilt the image backward - - if (fVidScreenCurvature == 0.0f && !bUseLighting) { - v3DScreen[nRotateGame & 2 ? 3 : 0] = D3DVERTEX2(D3DVECTOR(-1.0f, 2.0f, 0.0f), D3DVECTOR(0, 0, 1), vScreen[0].tu, vScreen[0].tv, vScreen[0].tu1, vScreen[0].tv1); - v3DScreen[nRotateGame & 2 ? 2 : 1] = D3DVERTEX2(D3DVECTOR( 1.0f, 2.0f, 0.0f), D3DVECTOR(0, 0, 1), vScreen[1].tu, vScreen[1].tv, vScreen[1].tu1, vScreen[1].tv1); - v3DScreen[nRotateGame & 2 ? 1 : 2] = D3DVERTEX2(D3DVECTOR(-1.0f, 0.0f, 0.0f), D3DVECTOR(0, 0, 1), vScreen[2].tu, vScreen[2].tv, vScreen[2].tu1, vScreen[2].tv1); - v3DScreen[nRotateGame & 2 ? 0 : 3] = D3DVERTEX2(D3DVECTOR( 1.0f, 0.0f, 0.0f), D3DVECTOR(0, 0, 1), vScreen[3].tu, vScreen[3].tv, vScreen[3].tu1, vScreen[3].tv1); - } else { - int nGameAspectX = 4, nGameAspectY = 3; - - double dXAngle, dYAngle; - - if (bDrvOkay) { - if ((BurnDrvGetFlags() & (BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED)) && nVidRotationAdjust) { - BurnDrvGetAspect(&nGameAspectY, &nGameAspectX); - } else { - BurnDrvGetAspect(&nGameAspectX, &nGameAspectY); - } - } - - if (nGameAspectX > nGameAspectY) { - dXAngle = (double)fVidScreenCurvature; - dYAngle = (double)fVidScreenCurvature * nGameAspectY / nGameAspectX; - } else { - dXAngle = (double)fVidScreenCurvature * nGameAspectX / nGameAspectY; - dYAngle = (double)fVidScreenCurvature; - } - - double dXFactor = 1.0 / sin(dXAngle / 2); - double dYFactor = 1.0 / sin(dYAngle / 2); - - for (int y = 0; y < n3DScreenGridSize; y++) { - - double dTop = dYFactor * sin(-dYAngle / 2 + dYAngle * y / n3DScreenGridSize); - double dBottom = dYFactor * sin(-dYAngle / 2 + dYAngle * (y + 1) / n3DScreenGridSize); - - double dTopFactor = cos(-dYAngle / 2 + dYAngle * y / n3DScreenGridSize); - double dBottomFactor = cos(-dYAngle / 2 + dYAngle * (y + 1) / n3DScreenGridSize); - - for (int x = 0; x < n3DScreenGridSize; x++) { - - double dLeft = dXFactor * sin(-dXAngle / 2 + dXAngle * x / n3DScreenGridSize); - double dRight = dXFactor * sin(-dXAngle / 2 + dXAngle * (x + 1) / n3DScreenGridSize); - - double dLeftFactor = cos(-dXAngle / 2 + dXAngle * x / n3DScreenGridSize); - double dRightFactor = cos(-dXAngle / 2 + dXAngle * (x + 1) / n3DScreenGridSize); - - if (nRotateGame & 1) { - v3DScreen[6 * y + ((n3DScreenGridSize - 1 - x) * 6 * n3DScreenGridSize) + 0] = D3DVERTEX2(D3DVECTOR((float)(dTopFactor * dLeft), (float)(1.0 - dLeftFactor * dTop), (float)(1.0 - dTopFactor * dLeftFactor) ), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - v3DScreen[6 * y + ((n3DScreenGridSize - 1 - x) * 6 * n3DScreenGridSize) + 1] = D3DVERTEX2(D3DVECTOR((float)(dTopFactor * dRight), (float)(1.0 - dRightFactor * dTop), (float)(1.0 - dTopFactor * dRightFactor)), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - v3DScreen[6 * y + ((n3DScreenGridSize - 1 - x) * 6 * n3DScreenGridSize) + 2] = D3DVERTEX2(D3DVECTOR((float)(dBottomFactor * dLeft), (float)(1.0 - dLeftFactor * dBottom), (float)(1.0 - dBottomFactor * dLeftFactor) ), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - - v3DScreen[6 * y + ((n3DScreenGridSize - 1 - x) * 6 * n3DScreenGridSize) + 3] = D3DVERTEX2(D3DVECTOR((float)(dTopFactor * dRight), (float)(1.0 - dRightFactor * dTop), (float)(1.0 - dTopFactor * dRightFactor)), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - v3DScreen[6 * y + ((n3DScreenGridSize - 1 - x) * 6 * n3DScreenGridSize) + 4] = D3DVERTEX2(D3DVECTOR((float)(dBottomFactor * dLeft), (float)(1.0 - dLeftFactor * dBottom), (float)(1.0 - dBottomFactor * dLeftFactor) ), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - v3DScreen[6 * y + ((n3DScreenGridSize - 1 - x) * 6 * n3DScreenGridSize) + 5] = D3DVERTEX2(D3DVECTOR((float)(dBottomFactor * dRight), (float)(1.0 - dRightFactor * dBottom), (float)(1.0 - dBottomFactor * dRightFactor)), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - } else { - v3DScreen[6 * x + (y * 6 * n3DScreenGridSize) + 0] = D3DVERTEX2(D3DVECTOR((float)(dTopFactor * dLeft), (float)(1.0 - dLeftFactor * dTop), (float)(1.0 - dTopFactor * dLeftFactor) ), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - v3DScreen[6 * x + (y * 6 * n3DScreenGridSize) + 1] = D3DVERTEX2(D3DVECTOR((float)(dTopFactor * dRight), (float)(1.0 - dRightFactor * dTop), (float)(1.0 - dTopFactor * dRightFactor)), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - v3DScreen[6 * x + (y * 6 * n3DScreenGridSize) + 2] = D3DVERTEX2(D3DVECTOR((float)(dBottomFactor * dLeft), (float)(1.0 - dLeftFactor * dBottom), (float)(1.0 - dBottomFactor * dLeftFactor) ), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - - v3DScreen[6 * x + (y * 6 * n3DScreenGridSize) + 3] = D3DVERTEX2(D3DVECTOR((float)(dTopFactor * dRight), (float)(1.0 - dRightFactor * dTop), (float)(1.0 - dTopFactor * dRightFactor)), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - v3DScreen[6 * x + (y * 6 * n3DScreenGridSize) + 4] = D3DVERTEX2(D3DVECTOR((float)(dBottomFactor * dLeft), (float)(1.0 - dLeftFactor * dBottom), (float)(1.0 - dBottomFactor * dLeftFactor) ), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - v3DScreen[6 * x + (y * 6 * n3DScreenGridSize) + 5] = D3DVERTEX2(D3DVECTOR((float)(dBottomFactor * dRight), (float)(1.0 - dRightFactor * dBottom), (float)(1.0 - dBottomFactor * dRightFactor)), D3DVECTOR(0, 0, 0), 0, 0, 0, 0); - } - } - } - - // Compute the vertex normals - for (int x = 0; x < n3DScreenGridSize; x++) { - for (int y = 0; y < n3DScreenGridSize; y++) { - int i = 6 * x + (y * 6 * n3DScreenGridSize); - - for (int j = 0; j < 6; j++) { - v3DScreen[i + j].nx = v3DScreen[i + j].x; v3DScreen[i + j].ny = v3DScreen[i + j].y - 1.0f; v3DScreen[i + j].nz = (1.0f - v3DScreen[i + j].z) / fVidScreenCurvature; - } - } - } - - // Texture mapping coordinates for the emulator image - for (int y = 0; y < n3DScreenGridSize; y++) { - float tuLeft, tuRight; - float tvTop, tvBottom; - - int ry = nRotateGame & 2 ? n3DScreenGridSize - 1 - y : y; - - tvTop = ((float)nGameImageHeight / nTextureHeight) * y / n3DScreenGridSize; - tvBottom = ((float)nGameImageHeight / nTextureHeight) * (y + 1) / n3DScreenGridSize; - - for (int x = 0; x < n3DScreenGridSize; x++) { - - int rx = nRotateGame & 2 ? n3DScreenGridSize - 1 - x : x; - - tuLeft = (float(nGameImageWidth) / nTextureWidth) * x / n3DScreenGridSize; - tuRight = (float(nGameImageWidth) / nTextureWidth) * (x + 1) / n3DScreenGridSize; - - if (nRotateGame & 1) { - int i = 6 * (n3DScreenGridSize - 1 - rx) + ((n3DScreenGridSize - 1 - ry) * 6 * n3DScreenGridSize); - v3DScreen[i + (nRotateGame & 2 ? 5 : 0)].tu = tuRight; v3DScreen[i + (nRotateGame & 2 ? 5 : 0)].tv = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 4 : 1)].tu = tuRight; v3DScreen[i + (nRotateGame & 2 ? 4 : 1)].tv = tvBottom; - v3DScreen[i + (nRotateGame & 2 ? 3 : 2)].tu = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 3 : 2)].tv = tvTop; - - v3DScreen[i + (nRotateGame & 2 ? 2 : 3)].tu = tuRight; v3DScreen[i + (nRotateGame & 2 ? 2 : 3)].tv = tvBottom; - v3DScreen[i + (nRotateGame & 2 ? 1 : 4)].tu = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 1 : 4)].tv = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 0 : 5)].tu = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 0 : 5)].tv = tvBottom; - } else { - int i = 6 * rx + (ry * 6 * n3DScreenGridSize); - v3DScreen[i + (nRotateGame & 2 ? 5 : 0)].tu = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 5 : 0)].tv = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 4 : 1)].tu = tuRight; v3DScreen[i + (nRotateGame & 2 ? 4 : 1)].tv = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 3 : 2)].tu = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 3 : 2)].tv = tvBottom; - - v3DScreen[i + (nRotateGame & 2 ? 2 : 3)].tu = tuRight; v3DScreen[i + (nRotateGame & 2 ? 2 : 3)].tv = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 1 : 4)].tu = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 1 : 4)].tv = tvBottom; - v3DScreen[i + (nRotateGame & 2 ? 0 : 5)].tu = tuRight; v3DScreen[i + (nRotateGame & 2 ? 0 : 5)].tv = tvBottom; - } - } - } - - // Texture mapping coordinates for the scanlines - for (int y = 0; y < n3DScreenGridSize; y++) { - float tuLeft, tuRight; - float tvTop, tvBottom; - - int ry = nRotateGame & 2 ? n3DScreenGridSize - 1 - y : y; - - tvTop = float(nGameImageHeight) * y / n3DScreenGridSize; - tvBottom = float(nGameImageHeight) * (y + 1) / n3DScreenGridSize; - - for (int x = 0; x < n3DScreenGridSize; x++) { - - int rx = nRotateGame & 2 ? n3DScreenGridSize - 1 - x : x; - - tuLeft = float(nGameImageWidth) * x / n3DScreenGridSize; - tuRight = float(nGameImageWidth) * (x + 1) / n3DScreenGridSize; - - if ((!(nRotateGame & 1) && bRotateEffects) || ((nRotateGame & 1) && !bRotateEffects)) { - int i = 6 * (n3DScreenGridSize - 1 - rx) + ((n3DScreenGridSize - 1 - ry) * 6 * n3DScreenGridSize); - v3DScreen[i + (nRotateGame & 2 ? 5 : 0)].tu1 = tuRight; v3DScreen[i + (nRotateGame & 2 ? 5 : 0)].tv1 = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 4 : 1)].tu1 = tuRight; v3DScreen[i + (nRotateGame & 2 ? 4 : 1)].tv1 = tvBottom; - v3DScreen[i + (nRotateGame & 2 ? 3 : 2)].tu1 = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 3 : 2)].tv1 = tvTop; - - v3DScreen[i + (nRotateGame & 2 ? 2 : 3)].tu1 = tuRight; v3DScreen[i + (nRotateGame & 2 ? 2 : 3)].tv1 = tvBottom; - v3DScreen[i + (nRotateGame & 2 ? 1 : 4)].tu1 = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 1 : 4)].tv1 = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 0 : 5)].tu1 = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 0 : 5)].tv1 = tvBottom; - } else { - int i = 6 * rx + (ry * 6 * n3DScreenGridSize); - v3DScreen[i + (nRotateGame & 2 ? 5 : 0)].tu1 = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 5 : 0)].tv1 = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 4 : 1)].tu1 = tuRight; v3DScreen[i + (nRotateGame & 2 ? 4 : 1)].tv1 = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 3 : 2)].tu1 = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 3 : 2)].tv1 = tvBottom; - - v3DScreen[i + (nRotateGame & 2 ? 2 : 3)].tu1 = tuRight; v3DScreen[i + (nRotateGame & 2 ? 2 : 3)].tv1 = tvTop; - v3DScreen[i + (nRotateGame & 2 ? 1 : 4)].tu1 = tuLeft; v3DScreen[i + (nRotateGame & 2 ? 1 : 4)].tv1 = tvBottom; - v3DScreen[i + (nRotateGame & 2 ? 0 : 5)].tu1 = tuRight; v3DScreen[i + (nRotateGame & 2 ? 0 : 5)].tv1 = tvBottom; - } - } - } - } - } - - return 0; -} - -static void PutPixel(unsigned char** ppSurface, unsigned int nColour) -{ - switch (nVidScrnDepth) { - case 15: - *((unsigned short*)(*ppSurface)) = ((nColour >> 9) & 0x7C00) | ((nColour >> 6) & 0x03E0) | ((nColour >> 3) & 0x001F); - *ppSurface += 2; - break; - case 16: - *((unsigned short*)(*ppSurface)) = ((nColour >> 8) & 0xF800) | ((nColour >> 5) & 0x07E0) | ((nColour >> 3) & 0x001F); - *ppSurface += 2; - break; - case 24: - (*ppSurface)[0] = (nColour >> 16) & 0xFF; - (*ppSurface)[1] = (nColour >> 8) & 0xFF; - (*ppSurface)[2] = (nColour >> 0) & 0xFF; - *ppSurface += 3; - break; - case 32: - *((unsigned int*)(*ppSurface)) = nColour; - *ppSurface += 4; - break; - } -} - -static int ReleaseSurfaces() -{ - // Release effects surfaces - RELEASE(pRGBEffectTexture); - RELEASE(pScanlineTexture[0]); - RELEASE(pScanlineTexture[1]); - - // Release game-image surfaces - RELEASE(pEmuImage[0]); - RELEASE(pEmuImage[1]); - RELEASE(pEmuImage[2]); - RELEASE(pEmuImage[3]); - - VidSFreeVidImage(); - - return 0; -} - -static int vidExit() -{ - VidSExitOSD(); - - if (v3DScreen) { - free(v3DScreen); - v3DScreen = NULL; - } - - VidSoftFXExit(); - - ReleaseSurfaces(); - - VidSRestoreGamma(); - - RELEASE(pD3DDevice); - RELEASE(pD3D); - - VidSRestoreScreenMode(); - - if (bUsePageflip == false) { - RELEASE(pBackbuffer); // explicitly free the off-screen surface when not usign pageflipping - } - RELEASE(pPrimarySurf); - pBackbuffer = NULL; - - VidSExit(); - - RELEASE(pDD); - - return 0; -} - -static HRESULT CALLBACK myEnumTexturesCallback(DDPIXELFORMAT* pddpf, void* pPreferredddpf) -{ - if (pddpf->dwFlags == DDPF_RGB && pddpf->dwRGBBitCount == 16) { - - if (VidSoftFXCheckDepth(nPreScaleEffect, 15) == 15) { - // Use 15-bit format if supported by the 3D hardware and the effects blitter - if(pddpf->dwRBitMask == 0x7C00 && pddpf->dwGBitMask == 0x03E0 && pddpf->dwBBitMask == 0x001F) { - memcpy(pPreferredddpf, pddpf, sizeof(DDPIXELFORMAT) ); - - return D3DENUMRET_CANCEL; - } - } - - // Use 16-bit format otherwise - if(pddpf->dwRBitMask == 0xF800 && pddpf->dwGBitMask == 0x07E0 && pddpf->dwBBitMask == 0x001F) { - memcpy(pPreferredddpf, pddpf, sizeof(DDPIXELFORMAT) ); - } - } - return D3DENUMRET_OK; -} - -static int vidCreateGameSurfaces() -{ - bool bForceTextureFormat; - - DDSURFACEDESC2 ddsd; - DDPIXELFORMAT ddpf; - - // Determine if we should use a texture format different from the screen format - bForceTextureFormat = false; - if ((VidSoftFXCheckDepth(nPreScaleEffect, 16) != 32 && nVidScrnDepth > 16 && - (/*bDrvOkay &&*/ VidSoftFXCheckDepth(nPreScaleEffect, 32) != 32)) || - (/*bDrvOkay &&*/ (bVidForce16bit || - (bDoGamma && nVidFullscreen && bVidUseHardwareGamma) || - (bDoGamma && !nVidFullscreen && bHardwareGammaOnly)))) - { - memset(&ddpf, 0, sizeof(DDPIXELFORMAT)); - - pD3DDevice->EnumTextureFormats(&myEnumTexturesCallback, (void*)&ddpf); - - if (ddpf.dwSize) { - bForceTextureFormat = true; // NOTE: this makes emulation=16bpp - } - } -/* - { // debug code for the above if-statement *keep!* :) - int ii; - ii = VidSoftFXCheckDepth(nPreScaleEffect, 16) != 32 && nVidScrnDepth > 16; - bprintf(0, _T("Part1 %d "), ii); - ii = (bDrvOkay || VidSoftFXCheckDepth(nPreScaleEffect, 32) != 32); - bprintf(0, _T("Part2 %d \n"), ii); - ii = (bDoGamma && nVidFullscreen && bVidUseHardwareGamma); - bprintf(0, _T("(bDoGamma && nVidFullscreen && bVidUseHardwareGamma) == [%d]\n"), ii); - ii = (bDoGamma && !nVidFullscreen && bHardwareGammaOnly); - bprintf(0, _T("(bDoGamma && !nVidFullscreen && bHardwareGammaOnly) == [%d]\n"), ii); - bprintf(0, _T("nPreScaleEffect [%X]\n"), nPreScaleEffect); - bprintf(0, _T("VidSoftFXCheckDepth(nPreScaleEffect, 16) [%d]\n"), VidSoftFXCheckDepth(nPreScaleEffect, 16)); - bprintf(0, _T("VidSoftFXCheckDepth(nPreScaleEffect, 32) [%d]\n"), VidSoftFXCheckDepth(nPreScaleEffect, 32)); - bprintf(0, _T("nVidScrnDepth [%X] bDrvOkay [%X]\n"), nVidScrnDepth, bDrvOkay); - bprintf(0, _T("bVidForce16bit[%X] forcetexture[%X]\n"), bVidForce16bit, bForceTextureFormat); - bprintf(0, _T("bDoGamma [%X] nVidFullscreen [%X] bVidUseHardwareGamma [%X] bHardwareGammaOnly [%X]\n"), bDoGamma, nVidFullscreen, bVidUseHardwareGamma, bHardwareGammaOnly); - } -*/ - // Create a secondary surface to render the game image onto for the feedback effect - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_3DDEVICE; - - ddsd.dwWidth = (nPreScale & 1) ? nPreScaleTextureWidth : nTextureWidth; - ddsd.dwHeight = (nPreScale & 2) ? nPreScaleTextureHeight : nTextureHeight; - - memset(&ddsd.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT)); - - if (FAILED(pDD->CreateSurface(&ddsd, &pEmuImage[1], NULL))) { - bRenderToTexture = false; - } else { - - IDirectDrawSurface7* pPreviousTarget; - if (FAILED(pD3DDevice->GetRenderTarget(&pPreviousTarget))) { - bRenderToTexture = false; - } else { - if (FAILED(pD3DDevice->SetRenderTarget(pEmuImage[1], 0))) { - bRenderToTexture = false; - } else { - bRenderToTexture = true; - - VidSClearSurface(pEmuImage[1], 0, NULL); - } - pD3DDevice->SetRenderTarget(pPreviousTarget, 0); - pPreviousTarget->Release(); - } - } - - if (!bRenderToTexture) { - -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Warning: Device can't render to textures. Using fall-back method for pre-scale/feedback.\n")); -#endif - - RELEASE(pEmuImage[1]); - - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; - - ddsd.dwWidth = (nPreScale & 1) ? nPreScaleTextureWidth : nTextureWidth; - ddsd.dwHeight = (nPreScale & 2) ? nPreScaleTextureHeight : nTextureHeight; - - memset(&ddsd.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT)); - - if (FAILED(pDD->CreateSurface(&ddsd, &pEmuImage[1], NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create secondary game surface(s) for pre-scale/feedback.\n")); -#endif - return 1; - } - - VidSClearSurface(pEmuImage[1], 0, NULL); - - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY; - - ddsd.dwWidth = (nPreScale & 1) ? nPreScaleTextureWidth : nTextureWidth; - ddsd.dwHeight = (nPreScale & 2) ? nPreScaleTextureHeight : nTextureHeight; - - if (FAILED(pDD->CreateSurface(&ddsd, &pEmuImage[3], NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create secondary game surface(s) for pre-scale/feedback.\n")); -#endif - return 1; - } - - VidSClearSurface(pEmuImage[3], 0, NULL); - } - - if (nVidTransferMethod <= 0) { - - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY; - - ddsd.dwWidth = nTextureWidth; - ddsd.dwHeight = nTextureHeight; - - if (nPreScaleEffect) { - ddsd.dwWidth = nPreScaleTextureWidth; - ddsd.dwHeight = nPreScaleTextureHeight; - } - - if (bForceTextureFormat) { - ddsd.dwFlags |= DDSD_PIXELFORMAT; - - memcpy(&ddsd.ddpfPixelFormat, &ddpf, sizeof(DDPIXELFORMAT)); - } - - if (FAILED(pDD->CreateSurface(&ddsd, &pEmuImage[2], NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create secondary game surface for transfer.\n")); -#endif - return 1; - } - - VidSClearSurface(pEmuImage[2], 0, NULL); - } - - // Create a surface for the texture that will contain the game image - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; - if (nVidTransferMethod > 0) { - ddsd.ddsCaps.dwCaps2 = DDSCAPS2_HINTDYNAMIC | DDSCAPS2_TEXTUREMANAGE; - } - - ddsd.dwWidth = nTextureWidth; - ddsd.dwHeight = nTextureHeight; - - if (nPreScaleEffect) { - ddsd.dwWidth = nPreScaleTextureWidth; - ddsd.dwHeight = nPreScaleTextureHeight; - } - - if (bForceTextureFormat) { - ddsd.dwFlags |= DDSD_PIXELFORMAT; - - memcpy(&ddsd.ddpfPixelFormat, &ddpf, sizeof(DDPIXELFORMAT)); - } - - if (FAILED(pDD->CreateSurface(&ddsd, &pEmuImage[0], NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create game texture surface.\n")); -#endif - return 1; - } - - VidSClearSurface(pEmuImage[0], 0, NULL); - - return 0; -} - -static int InitEffectsSurfaces() -{ - DDSURFACEDESC2 ddsd; - - for (int i = 0, nSize = 2; i < 2; i++, nSize <<= 1) { - int Scanlines[][8] = { { 0xFFFFFF, 0x000000 }, { 0x9F9F9F, 0xFFFFFF, 0x9F9F9F, 0x000000 } }; - - if (pScanlineTexture[i]) { - - if (FAILED(pScanlineTexture[i]->IsLost())) { - if (FAILED(pScanlineTexture[i]->Restore())) { - return 1; - } - } - - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - if (FAILED(pScanlineTexture[i]->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY | DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT, NULL))) { - return 1; - } - - for (int y = 0; y < nSize; y++) { - unsigned char* pSurface = (unsigned char*)ddsd.lpSurface + y * ddsd.lPitch; - int nColour = Scanlines[i][y]; - for (int x = 0; x < nSize; x++) { - PutPixel(&pSurface, nColour); - } - } - - pScanlineTexture[i]->Unlock(NULL); - } - } - - if (pRGBEffectTexture) { - TCHAR pFilename[MAX_PATH] = _T(""); - int nPatternSize, nPatternXSize, nPatternYSize; - unsigned char* RGBPattern = NULL; - - if (FAILED(pRGBEffectTexture->IsLost())) { - if (FAILED(pRGBEffectTexture->Restore())) { - return 1; - } - } - - // Get the filename and size of a pattern - _tcscpy(pFilename, _T("pattern/")); - _tcscat(pFilename, pRGBEffectPatternName); - _stscanf(pRGBEffectPatternName, _T("%i x %i"), &nPatternXSize, &nPatternYSize); - nPatternSize = nPatternXSize * nPatternYSize * 4; - - for (int i = 0; BuiltinPatternInfo[i].szName; i++) { - if (!_tcscmp(BuiltinPatternInfo[i].szName, pRGBEffectPatternName)) { - RGBPattern = (unsigned char*)malloc(nPatternSize); - memcpy(RGBPattern, BuiltinPatternInfo[i].pData, nPatternSize); - break; - } - } - - if (RGBPattern == NULL) { - FILE* fp = _tfopen(pFilename, _T("rb")); - if (fp) { - - // Read the file containing the pattern data - fseek(fp, 0, SEEK_END); - - // Check if the file is the correct size. - if (ftell(fp) != nPatternSize) { - - fclose(fp); - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("RGB pattern \'%s\' has an incorrect size.\nIt should be %i bytes long."), pRGBEffectPatternName, nPatternSize); - FBAPopupDisplay(PUF_TYPE_WARNING); - return 1; - } - - RGBPattern = (unsigned char*)malloc(nPatternSize); - fseek(fp, 0, SEEK_SET); - fread(RGBPattern, 1, nPatternSize, fp); - fclose(fp); - } - } - - if (RGBPattern) { - // Pre-process the pattern - for (int y = 0; y < nPatternYSize; y++) { - unsigned char* pPattern = &RGBPattern[y * (nPatternXSize << 2)]; - for (int x = 0; x < nPatternXSize; x++) { - switch (nRGBEffectPatternmode) { - case 0: - case 1: { - if (nRGBEffectPatternmode == 0 || pPattern[(x << 2) + 3]) { - int n; - for (int z = 0; z < 3; z++) { - n = nRGBEffectIntensity * pPattern[(x << 2) + z] / 256; - pPattern[(x << 2) + z] = (n > 255) ? 255 : nRGBEffectFloor + (n * (256 - nRGBEffectFloor) / 256); - } - } - break; - } - case 2: - case 3: { - int nSaturate = 0; - int nMax = 0; - int n; - - if (pPattern[(x << 2) + 0] != pPattern[(x << 2) + 1] || pPattern[(x << 2) + 0] != pPattern[(x << 2) + 2] || pPattern[(x << 2) + 1] != pPattern[(x << 2) + 2]) { - - if (pPattern[(x << 2) + 0] >= pPattern[(x << 2) + 1] && pPattern[(x << 2) + 0] >= pPattern[(x << 2) + 2]) { - nMax = pPattern[(x << 2) + 0]; - nSaturate |= 1; - } - if (pPattern[(x << 2) + 1] >= pPattern[(x << 2) + 0] && pPattern[(x << 2) + 1] >= pPattern[(x << 2) + 2]) { - nMax = pPattern[(x << 2) + 1]; - nSaturate |= 2; - } - if (pPattern[(x << 2) + 2] >= pPattern[(x << 2) + 0] && pPattern[(x << 2) + 2] >= pPattern[(x << 2) + 1]) { - nMax = pPattern[(x << 2) + 2]; - nSaturate |= 4; - } - - nSaturate ^= 7; - } - - for (int z = 0; z < 3; z++) { - if (nRGBEffectPatternmode == 2 || pPattern[(x << 2) + 3]) { - n = pPattern[(x << 2) + z]; - if (nSaturate & (1 << z)) { - n += (nMax - n) * nRGBEffectSaturation / 256; - } - n = n * nRGBEffectIntensity / 256; - pPattern[(x << 2) + z] = (n > 255) ? 255 : nRGBEffectFloor + (n * (256 - nRGBEffectFloor) / 256); - } - } - break; - } - } - } - } - - // Replicate the pattern over the needed size - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - if (FAILED(pRGBEffectTexture->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY | DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT, NULL))) { - return 1; - } else { - if ((!(nRotateGame & 1) && bRotateEffects) || ((nRotateGame & 1) && !bRotateEffects)) { - for (unsigned int y = 0; y < ddsd.dwHeight; y++) { - int ry = nRotateGame & 2 ? ddsd.dwHeight - 1 - y : y; - unsigned char* pSurface = (unsigned char*)ddsd.lpSurface + ddsd.lPitch * y; - unsigned char* pPattern = &RGBPattern[(ry % nPatternXSize) << 2]; - for (unsigned int x = 0; x < ddsd.dwWidth; x++) { - int rx = nRotateGame & 2 ? ddsd.dwWidth - 1 - x : x; - int nColour = pPattern[((rx % nPatternYSize) * (nPatternXSize << 2)) + 0] << 16; - nColour |= pPattern[((rx % nPatternYSize) * (nPatternXSize << 2)) + 1] << 8; - nColour |= pPattern[((rx % nPatternYSize) * (nPatternXSize << 2)) + 2]; - - PutPixel(&pSurface, nColour); - } - } - } else { - for (unsigned int y = 0; y < ddsd.dwHeight; y++) { - int ry = nRotateGame & 2 ? ddsd.dwHeight - 1 - y : y; - unsigned char* pSurface = (unsigned char*)ddsd.lpSurface + ddsd.lPitch * y; - unsigned char* pPattern = &RGBPattern[(ry % nPatternYSize) * nPatternXSize << 2]; - for (unsigned int x = 0; x < ddsd.dwWidth; x++) { - int rx = nRotateGame & 2 ? ddsd.dwWidth - 1 - x : x; - int nColour = pPattern[((rx % nPatternXSize) << 2) + 0] << 16; - nColour |= pPattern[((rx % nPatternXSize) << 2) + 1] << 8; - nColour |= pPattern[((rx % nPatternXSize) << 2) + 2]; - - PutPixel(&pSurface, nColour); - } - } - } - pRGBEffectTexture->Unlock(NULL); - } - - if (RGBPattern) { - free(RGBPattern); - RGBPattern = NULL; - } - } else { - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE, _T("Couldn't find RGB pattern.")); - FBAPopupDisplay(PUF_TYPE_WARNING); - return 1; - } - } - - return 0; -} - -// Create extra surfaces for textures and effects -static int vidCreateEffectsSurfaces() -{ - DDSURFACEDESC2 ddsd; - - // Create the scanline textures - for (int i = 0, nSize = 2; i < 2; i++, nSize <<= 1) { - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY; - - ddsd.dwWidth = nSize; - ddsd.dwHeight = nSize; - - if (FAILED(pDD->CreateSurface(&ddsd, &pScanlineTexture[i], NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create scanline texture.\n")); -#endif - return 1; - } - } - - if (bUseRGBEffects) { - // Create the RGB effect texture - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; -// ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - - if (!nVidFullscreen || (nVidFullscreen && bVidFullStretch)) { - ddsd.dwWidth = nVidScrnWidth; - ddsd.dwHeight = nVidScrnHeight; - } else { - if (bVidArcaderes) { - ddsd.dwWidth = nGameWidth; - ddsd.dwHeight = nGameHeight; - } else { - RECT rect = { 0, 0, nVidScrnWidth, nVidScrnHeight }; - - VidImageSize(&rect, nGameWidth, nGameHeight); - - ddsd.dwWidth = rect.right - rect.left; - ddsd.dwHeight = rect.bottom - rect.top; - } - } - - if (FAILED(pDD->CreateSurface(&ddsd, &pRGBEffectTexture, NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create RGB effects surface.\n")); -#endif - return 1; - } - } - - InitEffectsSurfaces(); - - return 0; -} - -static int vidAllocSurfaces() -{ - if (pDD == NULL || pD3DDevice == NULL) { - return 1; - } - - if (bDrvOkay) { - BurnDrvGetFullSize(&nVidImageWidth, &nVidImageHeight); - BurnDrvGetVisibleOffs(&nVidImageLeft, &nVidImageTop); - } - - if (nRotateGame & 1) { - nGameImageWidth = nGameHeight; - nGameImageHeight = nGameWidth; - } else { - nGameImageWidth = nGameWidth; - nGameImageHeight = nGameHeight; - } - - nTextureWidth = GetTextureSize(nGameImageWidth); - nTextureHeight = GetTextureSize(nGameImageHeight); - nPreScaleTextureWidth = GetTextureSize(nGameImageWidth * nPreScaleZoom); - nPreScaleTextureHeight = GetTextureSize(nGameImageHeight * nPreScaleZoom); - - // 2xSaI etc. needs an extra line below the image - if (nPreScaleEffect >= FILTER_SUPEREAGLE && nPreScaleEffect <= FILTER_SUPER_2XSAI && nGameImageHeight == nTextureHeight) { - nTextureHeight <<= 1; - } - - if (d3dDeviceDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) { - if (nTextureWidth < nTextureHeight) { - nTextureWidth = nTextureHeight; - } - if (nTextureHeight < nTextureWidth) { - nTextureHeight = nTextureWidth; - } - } - - if ((int)d3dDeviceDesc.dwMaxTextureWidth < nTextureWidth || (int)d3dDeviceDesc.dwMaxTextureHeight < nTextureHeight) { - FBAPopupAddText(PUF_TEXT_NO_TRANSLATE,_T("Required texture size not supported by 3D hardware.")); - FBAPopupDisplay(PUF_TYPE_ERROR); - return 1; - } - - // Allocate all DirectX surfaces - if (vidCreateGameSurfaces()) { - ReleaseSurfaces(); - return 1; - } - if (vidCreateEffectsSurfaces()) { - ReleaseSurfaces(); - return 1; - } - - nVidImageDepth = VidSGetSurfaceDepth(pEmuImage[0]); // Get colourdepth of game (texture) surface - - for (int i = 0; i < 2; i++) { - int nDepth[] = { 15, 16, 32 }; - if (VidSoftFXCheckDepth(nPreScaleEffect, nDepth[i]) == nVidImageDepth) { - nVidImageDepth = nDepth[i]; - break; - } - } - - nVidImageBPP = (nVidImageDepth + 7) >> 3; - - VidSAllocVidImage(); // Set up memory buffer for Burn library - - SetBurnHighCol(nVidImageDepth); - - return 0; -} - -static int vidClear() -{ - if (pPrimarySurf == NULL) { - return 1; - } - - //if(bVidVSync && !nVidFullscreen) { pDD->WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL); } - - if (nVidFullscreen) { - VidSClearSurface(pPrimarySurf, 0, NULL); // Clear front buffer - if (bUsePageflip) { - pPrimarySurf->Flip(NULL, DDFLIP_WAIT); - VidSClearSurface(pPrimarySurf, 0, NULL); // Clear 1st page of backbuffer - - if (bUseTriplebuffer) { - pPrimarySurf->Flip(NULL, DDFLIP_WAIT); - VidSClearSurface(pPrimarySurf, 0, NULL); // Clear 2nd page of backbuffer - } - - pPrimarySurf->Flip(NULL, DDFLIP_WAIT); - } else { - VidSClearSurface(pBackbuffer, 0, NULL); // Clear backbuffer - } - } else { - VidSClearSurface(pBackbuffer, 0, NULL); // Clear backbuffer - } - - return 0; -} - -static int vidInitBuffers(bool bTriple) -{ - DDSURFACEDESC2 ddsd; - DDSCAPS2 ddscaps; - - bUsePageflip = false; - - if (bDrvOkay && nVidFullscreen) { - if (bTriple) { - bUsePageflip = true; - } else { - DDCAPS ddcaps; - - memset(&ddcaps, 0, sizeof(ddcaps)); - ddcaps.dwSize = sizeof(ddcaps); - - pDD->GetCaps(&ddcaps, NULL); - //if (ddcaps.dwCaps2 & DDCAPS2_FLIPNOVSYNC) { - bUsePageflip = true; - //} - } - } - - // Create the primary surface - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - if (nVidFullscreen && bUsePageflip) { - // Allocate a complex surface that supports page flipping. - ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY; - ddsd.dwBackBufferCount = bVidTripleBuffer ? 2 : 1; - } else { - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - } - - if (FAILED(pDD->CreateSurface(&ddsd, &pPrimarySurf, NULL))) { - pPrimarySurf = NULL; - return 1; - } - - // Get the back buffer - if (nVidFullscreen && bUsePageflip) { - memset(&ddscaps, 0, sizeof(ddscaps)); - ddscaps.dwCaps = DDSCAPS_BACKBUFFER; - if (FAILED(pPrimarySurf->GetAttachedSurface(&ddscaps, &pBackbuffer))) { - RELEASE(pPrimarySurf); - pBackbuffer = NULL; - return 1; - } - - bUseTriplebuffer = bTriple; - - } else { - // Running in windowed mode or using blt() transfer the final image. Allocate an off-screen surface to render to. - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY; - ddsd.dwWidth = nVidScrnWidth; - ddsd.dwHeight = nVidScrnHeight; - if (FAILED(pDD->CreateSurface(&ddsd, &pBackbuffer, NULL))) { - RELEASE(pPrimarySurf); - pBackbuffer = NULL; - return 1; - } - } - - nVidScrnDepth = VidSGetSurfaceDepth(pPrimarySurf); // Get colourdepth of primary surface - - vidClear(); // Clear the surfaces we've just allocated - - return 0; -} - -static GUID MyGuid; -static int nWantDriver; - -#if 1 && defined(PRINT_DEBUG_INFO) -static int nCurrentDriver; -#ifdef UNICODE -static BOOL PASCAL MyEnumDisplayDrivers(GUID FAR* pGuid, LPWSTR pszDesc, LPWSTR /*pszName*/, LPVOID /*pContext*/, HMONITOR hMonitor) -#else -static BOOL PASCAL MyEnumDisplayDrivers(GUID FAR* pGuid, LPSTR pszDesc, LPSTR /*pszName*/, LPVOID /*pContext*/, HMONITOR hMonitor) -#endif -{ - if (nCurrentDriver == nWantDriver && pGuid) { - memcpy(&MyGuid, pGuid, sizeof(GUID)); - } - - if (nCurrentDriver == 0) { - dprintf(_T(" %s\n"), pszDesc); - } else { - MONITORINFOEX mi; - mi.cbSize = sizeof(mi); - - GetMonitorInfo(hMonitor, (MONITORINFO*)&mi); - - dprintf(_T(" Display %d (%s on %s"), nCurrentDriver, mi.szDevice, pszDesc); - if (mi.dwFlags & MONITORINFOF_PRIMARY) { - dprintf(_T(", primary")); - } - dprintf(_T(")\n")); - } - - nCurrentDriver++; - - return DDENUMRET_OK; -} -#endif - -#if 0 -static HRESULT CALLBACK MyEnumDevicesCallback(LPSTR lpDeviceDescription, LPSTR /*lpDeviceName*/, LPD3DDEVICEDESC7, LPVOID) -{ - dprintf(_T(" %s\n"), lpDeviceDescription); - - return DDENUMRET_OK; -} -#endif - -static int vidInit() -{ -#ifdef ENABLE_PROFILING - ProfileInit(); -#endif - - bCreateImage = true; - - bUseTriplebuffer = false; - - hVidWnd = hScrnWnd; // Use Screen window for video - - nWantDriver = 0; -#if 1 && defined(PRINT_DEBUG_INFO) - nCurrentDriver = 0; - memset(&MyGuid, 0, sizeof(GUID)); - dprintf(_T(" ** Enumerating available DirectDraw drivers:\n")); - _DirectDrawEnumerateEx(MyEnumDisplayDrivers, NULL, DDENUM_ATTACHEDSECONDARYDEVICES | DDENUM_DETACHEDSECONDARYDEVICES | DDENUM_NONDISPLAYDEVICES); -#endif - - // Get pointer to DirectDraw device - _DirectDrawCreateEx(nWantDriver ? &MyGuid : NULL, (void**)&pDD, IID_IDirectDraw7, NULL); - - VidSInit(pDD); - - // Get pointer to D3D device - if (FAILED(pDD->QueryInterface(IID_IDirect3D7, (void**)&pD3D))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't access Direct3D.\n")); -#endif - vidExit(); - return 1; - } - -#if 0 && defined(PRINT_DEBUG_INFO) - dprintf(_T(" ** Enumerating available 3D devices:\n")); - pD3D->EnumDevices(MyEnumDevicesCallback, NULL); -#endif - - pPrimarySurf = NULL; // No primary surface yet - pBackbuffer = NULL; - - nGameWidth = nVidImageWidth; nGameHeight = nVidImageHeight; - - nRotateGame = 0; - if (bDrvOkay) { - // Get the game screen size - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if (nVidRotationAdjust & 1) { - int n = nGameWidth; - nGameWidth = nGameHeight; - nGameHeight = n; - nRotateGame |= (nVidRotationAdjust & 2); - } else { - nRotateGame |= 1; - } - } - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - nRotateGame ^= 2; - } - } - - nPreScale = 0; - nPreScaleZoom = 2; - nPreScaleEffect = 0; - if (nVidBlitterOpt[nVidSelect] & 0x01000000) { - nPreScale = 3; - - if (nVidBlitterOpt[nVidSelect] & 0x02000000) { - nPreScaleEffect = (unsigned long long)(nVidBlitterOpt[nVidSelect] >> 32); - nPreScaleZoom = VidSoftFXGetZoom(nPreScaleEffect); - } else { - if (bVidScanlines) { - nPreScale &= 2; - } - } - } - - // Set up the display mode - if (nVidFullscreen) { - int nZoomlevel; - if (nVidBlitterOpt[nVidSelect] & 0x04000000) { - nZoomlevel = nPreScaleZoom; - } else { - nZoomlevel = nScreenSize; - } - if (VidSEnterFullscreenMode(nZoomlevel, 0)) { - vidExit(); - return 1; - } - } else { - RECT rect; - - SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0); - nVidScrnWidth = rect.right - rect.left; - nVidScrnHeight = rect.bottom - rect.top; - - pDD->SetCooperativeLevel(hVidWnd, DDSCL_NORMAL); - } - -#ifdef PRINT_DEBUG_INFO - { - // Display amount of free video memory - DDSCAPS2 ddsCaps2; - DWORD dwTotal; - DWORD dwFree; - - memset(&ddsCaps2, 0, sizeof(ddsCaps2)); - ddsCaps2.dwCaps = DDSCAPS_PRIMARYSURFACE; - - dprintf(_T(" ** Starting Direct3D7 blitter.\n")); - - if (SUCCEEDED(pDD->GetAvailableVidMem(&ddsCaps2, &dwTotal, &dwFree))) { - dprintf(_T(" * Initialising video: Total video memory minus display surface: %.2fMB.\n"), (double)dwTotal / (1024 * 1024)); - } - } -#endif - - if (bVidTripleBuffer) { - if (vidInitBuffers(1)) { // Try to make triple buffer -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Warning: Couldn't allocate a triple-buffering surface.\n")); -#endif - } - } - - if (pPrimarySurf == NULL) { // No primary surface yet, so try normal - vidInitBuffers(0); - } - - if (pPrimarySurf == NULL) { // No primary surface, fail -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create primary surface.\n")); -#endif - vidExit(); - return 1; - } - - if (nVidFullscreen) { - pDD->Compact(); - } - - VidSClipperInit(pPrimarySurf); // Initialise clipper - - VidSSetupGamma(pPrimarySurf); // Set up gamma controls - - if (bVidScanRotate && nGameWidth < nGameHeight) { - bRotateEffects = true; - } else { - bRotateEffects = false; - } - - if (nRotateGame & 1) { - bRotateEffects = !bRotateEffects; - } - - bUse3DProjection = false; - if (nVidBlitterOpt[nVidSelect] & 0x00100000) { - bUse3DProjection = true; - } - bUseLighting = false; - n3DScreenGridSize = 16; - if (nVidBlitterOpt[nVidSelect] & 0x00200000) { - bUseLighting = true; - n3DScreenGridSize *= 2; - } - - bUseRGBEffects = false; - if (nVidBlitterOpt[nVidSelect] & 0x00010000) { - int nPreset = -1; - - if (nVidBlitterOpt[nVidSelect] & 0x00020000) { - RECT rect = { 0, 0, 0, 0 }; - int nScaledSize, nOriginalSize; - - GetClientScreenRect(hVidWnd, &rect); - if (!nVidFullscreen) { - rect.top += nMenuHeight; - } - VidImageSize(&rect, nGameWidth, nGameHeight); - - if (bVidScanRotate && nGameWidth < nGameHeight) { - nScaledSize = rect.right - rect.left; - nOriginalSize = nGameWidth; - } else { - nScaledSize = rect.bottom - rect.top; - nOriginalSize = nGameHeight; - } - - for (int n = 7; n >= 0; n--) { - if (nScaledSize >= (n + 1) * nOriginalSize) { - nPreset = n; - break; - } - } - } else { - nPreset = nVidBlitterOpt[nVidSelect] & 0xFF; - } - - if (nPreset != -1) { - if (PresetInfo[nPreset].nUseFilter != 0) { - bVidBilinear = PresetInfo[nPreset].nUseFilter == 1 ? true : false; - } - - if (PresetInfo[nPreset].nUseEffects != 0) { - bUseRGBEffects = PresetInfo[nPreset].nUseEffects == 1 ? true : false; - if (PresetInfo[nPreset].nUseEffects == 1) { - nRGBEffectIntensity = PresetInfo[nPreset].nIntensity; - nRGBEffectFloor = PresetInfo[nPreset].nFloor; - nRGBEffectSaturation = PresetInfo[nPreset].nSaturation; - nRGBEffectPatternmode = PresetInfo[nPreset].nPatternMode; - pRGBEffectPatternName = PresetInfo[nPreset].pPatternName; - nRGBEffectAttenuation = PresetInfo[nPreset].nAttenuation; - nRGBEffectBlendmode = PresetInfo[nPreset].nBlendMode; - } - } - - if (PresetInfo[nPreset].nUseScanlines != 0) { - bVidScanlines = PresetInfo[nPreset].nUseScanlines == 1 ? true : false; - if (PresetInfo[nPreset].nUseScanlines == 1) { - nRGBScanlineIntensity = PresetInfo[nPreset].nScanIntensity; - } - } - - if (PresetInfo[nPreset].nUseFeedback != 0) { - bVidScanDelay = PresetInfo[nPreset].nUseFeedback == 1 ? true : false; - if (PresetInfo[nPreset].nUseFeedback == 1) { - nVidFeedbackIntensity = PresetInfo[nPreset].nAmount; - nVidFeedbackOverSaturation = PresetInfo[nPreset].nOverSaturation; - } - } - - if (PresetInfo[nPreset].nUsePrescale != 0) { - if (PresetInfo[nPreset].nUsePrescale == 1) { - nVidBlitterOpt[nVidSelect] |= 0x01000000; - } else { - nVidBlitterOpt[nVidSelect] &= ~0x01000000; - } - } - - if (nVidBlitterOpt[nVidSelect] & 0x00020000) { - // Modify the effect a bit if it's rotated - if ((!(nRotateGame & 1) && bRotateEffects) || ((nRotateGame & 1) && !bRotateEffects)) { - nRGBEffectIntensity = nRGBEffectIntensity * 0xF0 / 0x0100; - nRGBEffectSaturation += (0x0100 - nRGBEffectSaturation) * 0x70 / 0x0100; - int nScan = (((nRGBScanlineIntensity >> 16) & 0xFF) * 0xE0 / 0x0100) << 16; - nScan |= (((nRGBScanlineIntensity >> 8) & 0xFF) * 0xE0 / 0x0100) << 8; - nScan |= (((nRGBScanlineIntensity >> 0) & 0xFF) * 0xE0 / 0x0100) << 0; - nRGBScanlineIntensity = nScan; - } - } - } - } - - if (bRotateEffects) { - nPreScale = ((nPreScale >> 1) | (nPreScale << 1)) & 3; - } - - pD3DDevice = NULL; - -#ifdef USE_D3D_REFERENCE_DEVICE - if (FAILED(pD3D->CreateDevice(IID_IDirect3DRefDevice, pBackbuffer, &pD3DDevice))) { - #ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't access Direct3D Reference device.\n")); - #endif - vidExit(); - return 1; - } else { - dprintf(_T(" * Using Direct3D Reference device.\n")); - } -#else - if (bUse3DProjection) { - if (FAILED(pD3D->CreateDevice(IID_IDirect3DTnLHalDevice, pBackbuffer, &pD3DDevice))) { - pD3DDevice = NULL; - #ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Warning: Couldn't get TnL 3D hardware, falling back to software TnL.\n")); - #endif - } - } - if (pD3DDevice == NULL) { - if (FAILED(pD3D->CreateDevice(IID_IDirect3DHALDevice, pBackbuffer, &pD3DDevice))) { - #ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't access 3D hardware.\n")); - #endif - vidExit(); - return 1; - } - } -#endif - - pD3DDevice->GetCaps(&d3dDeviceDesc); // Get the capabilities of the 3D hardware - - bMultiTexturing = false; - if (d3dDeviceDesc.wMaxSimultaneousTextures >= 2 && d3dDeviceDesc.wMaxTextureBlendStages >= 2) { - bMultiTexturing = true; - } - -#ifdef PRINT_DEBUG_INFO - if (!bMultiTexturing) { - dprintf(_T(" * Warning: Using fall-back method for rendering scanlines.\n")); - } -#endif - - nScanlineOp = D3DTOP_ADD; - if (d3dDeviceDesc.dwTextureOpCaps & D3DTEXOPCAPS_ADDSMOOTH) { - nScanlineOp = D3DTOP_ADDSMOOTH; - } - -#ifdef PRINT_DEBUG_INFO - if (nScanlineOp != D3DTOP_ADDSMOOTH) { - dprintf(_T(" * Warning: Using fall-back method for blending scanlines.\n")); - } -#endif - - // Init the buffer surfaces - if (vidAllocSurfaces()) { - ReleaseSurfaces(); - return 1; - } - - if (nPreScaleEffect) { - if (VidSoftFXInit(nPreScaleEffect, 0)) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't initialise software SoftFX.\n")); -#endif - vidExit(); - return 1; - } - } - - // Add a viewport - Viewport.dwX = 0; - Viewport.dwY = 0; - Viewport.dwWidth = nVidScrnWidth; - Viewport.dwHeight = nVidScrnHeight; - - if (FAILED(pD3DDevice->SetViewport(&Viewport))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't set initial viewport.\n")); -#endif - vidExit(); - return 1; - } - - pD3DDevice->SetRenderState(D3DRENDERSTATE_LIGHTING, FALSE); - - if (bUse3DProjection) { - pD3DDevice->SetRenderState(D3DRENDERSTATE_COLORVERTEX, FALSE); - } - - pD3DDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - pD3DDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - - // The polygons for the emulator image on the screen - { - int nWidth = nGameImageWidth; - int nHeight = nGameImageHeight; - int nTexWidth = nTextureWidth; - int nTexHeight = nTextureHeight; - - if (nPreScaleEffect) { - if (nPreScale & 1) { - nWidth *= nPreScaleZoom; - nTexWidth = nPreScaleTextureWidth; - } - if (nPreScale & 2) { - nHeight *= nPreScaleZoom; - nTexHeight = nPreScaleTextureHeight; - } - } - - if (nRotateGame & 1) { - vScreen[nRotateGame & 2 ? 3 : 0] = D3DTLVERTEX2(D3DVECTOR(0, 0, 0), 1, 0xFFFFFFFF, 0, (float)nWidth / nTexWidth, 0, 0, 0); - vScreen[nRotateGame & 2 ? 2 : 1] = D3DTLVERTEX2(D3DVECTOR(0, 0, 0), 1, 0xFFFFFFFF, 0, (float)nWidth / nTexWidth, (float)nHeight / nTexHeight, 0, 0); - vScreen[nRotateGame & 2 ? 1 : 2] = D3DTLVERTEX2(D3DVECTOR(0, 0, 0), 1, 0xFFFFFFFF, 0, 0, 0, 0, 0); - vScreen[nRotateGame & 2 ? 0 : 3] = D3DTLVERTEX2(D3DVECTOR(0, 0, 0), 1, 0xFFFFFFFF, 0, 0, (float)nHeight / nTexHeight, 0, 0); - } else { - vScreen[nRotateGame & 2 ? 3 : 0] = D3DTLVERTEX2(D3DVECTOR(0, 0, 0), 1, 0xFFFFFFFF, 0, 0, 0, 0, 0); - vScreen[nRotateGame & 2 ? 2 : 1] = D3DTLVERTEX2(D3DVECTOR(0, 0, 0), 1, 0xFFFFFFFF, 0, (float)nWidth / nTexWidth, 0, 0, 0); - vScreen[nRotateGame & 2 ? 1 : 2] = D3DTLVERTEX2(D3DVECTOR(0, 0, 0), 1, 0xFFFFFFFF, 0, 0, (float)nHeight / nTexHeight, 0, 0); - vScreen[nRotateGame & 2 ? 0 : 3] = D3DTLVERTEX2(D3DVECTOR(0, 0, 0), 1, 0xFFFFFFFF, 0, (float)nWidth / nTexWidth, (float)nHeight / nTexHeight, 0, 0); - } - } - - // Set the texture coordinates for the scanlines - if ((!(nRotateGame & 1) && bRotateEffects) || ((nRotateGame & 1) && !bRotateEffects)) { - vScreen[nRotateGame & 2 ? 3 : 0].tu1 = float(nGameHeight); vScreen[nRotateGame & 2 ? 3 : 0].tv1 = 0; - vScreen[nRotateGame & 2 ? 2 : 1].tu1 = float(nGameHeight); vScreen[nRotateGame & 2 ? 2 : 1].tv1 = (float)nGameWidth; - vScreen[nRotateGame & 2 ? 1 : 2].tu1 = 0; vScreen[nRotateGame & 2 ? 1 : 2].tv1 = 0; - vScreen[nRotateGame & 2 ? 0 : 3].tu1 = 0; vScreen[nRotateGame & 2 ? 0 : 3].tv1 = (float)nGameWidth; - } else { - vScreen[nRotateGame & 2 ? 3 : 0].tu1 = 0; vScreen[nRotateGame & 2 ? 3 : 0].tv1 = 0; - vScreen[nRotateGame & 2 ? 2 : 1].tu1 = float(nGameWidth); vScreen[nRotateGame & 2 ? 2 : 1].tv1 = 0; - vScreen[nRotateGame & 2 ? 1 : 2].tu1 = 0; vScreen[nRotateGame & 2 ? 1 : 2].tv1 = (float)nGameHeight; - vScreen[nRotateGame & 2 ? 0 : 3].tu1 = float(nGameWidth); vScreen[nRotateGame & 2 ? 0 : 3].tv1 = (float)nGameHeight; - } - - { - int nWidth = nGameImageWidth; - int nHeight = nGameImageHeight; - - if (nPreScale & 1) { - nWidth *= nPreScaleZoom; - } - if (nPreScale & 2) { - nHeight *= nPreScaleZoom; - } - - vFeedbackImage[nRotateGame & 2 ? 3 : 0] = D3DTLVERTEX(D3DVECTOR(-0.5, -0.5, 2.0f), 1, 0, 0, 0, 0); - vFeedbackImage[nRotateGame & 2 ? 2 : 1] = D3DTLVERTEX(D3DVECTOR(-0.5 + nWidth, -0.5, 2.0f), 1, 0, 0, float(nGameImageWidth) / nTextureWidth, 0); - vFeedbackImage[nRotateGame & 2 ? 1 : 2] = D3DTLVERTEX(D3DVECTOR(-0.5, -0.5 + nHeight, 2.0f), 1, 0, 0, 0, float(nGameImageHeight) / nTextureHeight); - vFeedbackImage[nRotateGame & 2 ? 0 : 3] = D3DTLVERTEX(D3DVECTOR(-0.5 + nWidth, -0.5 + nHeight, 2.0f), 1, 0, 0, float(nGameImageWidth) / nTextureWidth, float(nGameImageHeight) / nTextureHeight); - } - - // Force an update of the matrices - fPreviousScreenAngle = 9999.0f; - fPreviousScreenCurvature = 9999.0f; - - if (Update3DScreen()) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't initialise 3D geometry.\n")); -#endif - vidExit(); - return 1; - } - - int nFlags = 0; - if (nVidScrnWidth < 1280) { - nFlags++; - if (nVidScrnWidth < 1024) { - nFlags++; - if (nVidScrnWidth < 640) { - nFlags++; - } - } - } - VidSInitOSD(nFlags); - -#ifdef PRINT_DEBUG_INFO - { - DDSCAPS2 ddsCaps2; - DWORD dwTotal; - DWORD dwFree; - - memset(&ddsCaps2, 0, sizeof(ddsCaps2)); - ddsCaps2.dwCaps = DDSCAPS_PRIMARYSURFACE; - - if (SUCCEEDED(pDD->GetAvailableVidMem(&ddsCaps2, &dwTotal, &dwFree))) { - dprintf(_T(" * Initialisation complete: %.2fMB video memory free.\n"), (double)dwFree / (1024 * 1024)); - dprintf(_T(" Displaying and rendering in %i-bit mode, emulation running in %i-bit mode.\n"), nVidScrnDepth, nVidImageDepth); - if (nVidFullscreen) { - dprintf(_T(" Running in fullscreen mode (%i x %i), "), nVidScrnWidth, nVidScrnHeight); - if (bUseTriplebuffer) { - dprintf(_T("using a triple buffer.\n")); - } else { - if (bUsePageflip) { - dprintf(_T("using a double buffer.\n")); - } else { - dprintf(_T("using BltFast() to transfer the final image.\n")); - } - } - } else { - dprintf(_T(" Running in windowed mode, using Blt() to transfer the final image.\n")); - } - } - } -#endif - - bLostControl = false; - - return 0; -} - -// Scale the image to fit the screen/window -static int vidScale(RECT* pRect, int nWidth, int nHeight) -{ - if ((nVidBlitterOpt[nVidSelect] & 0x07000000) == 0x07000000) { - return VidSoftFXScale(pRect, nWidth, nHeight); - } - - return VidSScaleImage(pRect, nWidth, nHeight, bVidScanRotate); -} - -// Render the polygons with the emulator image -static inline void RenderPolygons() -{ - if (bUse3DProjection) { - if (fVidScreenCurvature == 0.0f && !bUseLighting) { - pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_VERTEX2, (void*)v3DScreen, 4, 0); - } else { - pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, D3DFVF_VERTEX2, (void*)v3DScreen, 6 * n3DScreenGridSize * n3DScreenGridSize, 0); - } - } else { - pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_TLVERTEX2, (void*)vScreen, 4, 0); - } -} - -static int vidRenderImageA() -{ - if (bLostControl) { // We've lost control of the video hardware - return 1; - } - - if (FAILED(pBackbuffer->IsLost())) { // We've lost control of the video hardware - return 1; - } - - GetClientScreenRect(hVidWnd, &Dest); - - if (nVidFullscreen == 0) { - Dest.top += nMenuHeight; - } - - if (bVidArcaderes && nVidFullscreen) { - Dest.left = (Dest.right + Dest.left) / 2; - Dest.left -= nGameWidth / 2; - Dest.right = Dest.left + nGameWidth; - - Dest.top = (Dest.top + Dest.bottom) / 2; - Dest.top -= nGameHeight / 2; - Dest.bottom = Dest.top + nGameHeight; - } else { - vidScale(&Dest, nGameWidth, nGameHeight); - } - - if (nVidFullscreen) { - Render.left = Dest.left; - Render.right = Dest.right; - Render.top = Dest.top; - Render.bottom = Dest.bottom; - } else { - Render.left = 0; - Render.right = Dest.right - Dest.left; - Render.top = 0; - Render.bottom = Dest.bottom - Dest.top; - } - - if (((nRotateGame & 1) && !bRotateEffects) || (!(nRotateGame & 1) && bRotateEffects)) { - nZoomFactor = (Render.right - Render.left) / nGameWidth; - } else { - nZoomFactor = (Render.bottom - Render.top) / nGameHeight; - } - - if (bUseRGBEffects) { - RECT rect = {0, 0, Render.right - Render.left, Render.bottom - Render.top}; - pBackbuffer->BltFast(Render.left, Render.top, pRGBEffectTexture, &rect, DDBLTFAST_WAIT); - } else { - if (bUse3DProjection) { - RECT rect = { Render.left, Render.top, Render.right, Render.top + 52 }; - VidSClearSurface(pBackbuffer, 0, &rect); - } - } - - return 0; -} - -static int vidRenderImageB() -{ - int bScanlines = 0, nScanlineSize = 0; - unsigned int nColour; - int nPage; - - if (bLostControl) { // We've lost control of the video hardware - return 1; - } - - if (FAILED(pBackbuffer->IsLost())) { // We've lost control of the video hardware - return 1; - } - - if ((bDrvOkay && bVidScanDelay) || (nPreScale && nPreScaleEffect == 0)) { - - if (FAILED(pD3DDevice->BeginScene())) { - return 1; - } - - if (bRenderToTexture) { - pD3DDevice->SetRenderTarget(pEmuImage[1], 0); - } else { - pD3DDevice->SetRenderTarget(pEmuImage[3], 0); - } - - Viewport.dwX = 0; - Viewport.dwY = 0; - Viewport.dwWidth = nGameImageWidth; - Viewport.dwHeight = nGameImageHeight; - - if (nPreScale & 1) { - Viewport.dwWidth *= nPreScaleZoom; - } - - if (nPreScale & 2) { - Viewport.dwHeight *= nPreScaleZoom; - } - - pD3DDevice->SetViewport(&Viewport); - - nColour = (0xFF - nVidFeedbackIntensity) + nVidFeedbackOverSaturation; - nColour = (nColour > 0x0FF) ? 0xFF : nColour; - nColour = (nVidFeedbackIntensity << 24) | (nColour << 16) | (nColour << 8) | nColour; - - vFeedbackImage[0].color = nColour; - vFeedbackImage[1].color = nColour; - vFeedbackImage[2].color = nColour; - vFeedbackImage[3].color = nColour; - - pD3DDevice->SetTexture(0, pEmuImage[0]); - - pD3DDevice->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 0); - pD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_POINT); - pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - if (bDrvOkay && bVidScanDelay) { - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_CURRENT); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_CURRENT); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - - pD3DDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE); - pD3DDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCALPHA); - } else { - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - pD3DDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE); - pD3DDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO); - } - - pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_TLVERTEX, (void*)vFeedbackImage, 4, 0); - - if (FAILED(pD3DDevice->EndScene())) { - return 1; - } - - pD3DDevice->SetTexture(0, NULL); - - pD3DDevice->SetRenderTarget(pBackbuffer, 0); - - if (!bRenderToTexture) { - RECT rect = {0, 0, nGameImageWidth, nGameImageHeight}; - - if (nPreScale & 1) { - rect.right = nPreScaleTextureWidth; - } - if (nPreScale & 2) { - rect.bottom = nPreScaleTextureHeight; - } - - pEmuImage[1]->BltFast(0, 0, pEmuImage[3], &rect, DDBLTFAST_WAIT); - } - - nPage = 1; - } else { - nPage = 0; - } - - // Set up for the emulator image - if (FAILED(pD3DDevice->BeginScene())) { - return 1; - } - - if (bUse3DProjection) { - - // It should only do this when the window size/pos has changed - if (nVidFullscreen == 0) { - static RECT prevDest = { 0, 0, 0, 0 }; - if (Render.left != prevDest.left || Render.top != prevDest.top || Render.right != prevDest.right || Render.bottom != prevDest.bottom) { - prevDest.left = Render.left; - prevDest.top = Render.top; - prevDest.right = Render.right; - prevDest.bottom = Render.bottom; - - VidSClearSurface(pBackbuffer, 0, &Render); - } - } - - if (fVidScreenAngle != fPreviousScreenAngle || fVidScreenCurvature != fPreviousScreenCurvature) { - Update3DScreen(); - VidSClearSurface(pBackbuffer, 0, NULL); - SetWorldMatrix(); - SetViewMatrix(2.0f); - SetProjectionMatrix(2.0f); - - fPreviousScreenAngle = fVidScreenAngle; - fPreviousScreenCurvature = fVidScreenCurvature; - } - - Viewport.dwX = Render.left; - Viewport.dwY = Render.top; - Viewport.dwWidth = Render.right - Render.left; - Viewport.dwHeight = Render.bottom - Render.top; - } else { - Viewport.dwX = 0; - Viewport.dwY = 0; - Viewport.dwWidth = nVidScrnWidth; - Viewport.dwHeight = nVidScrnHeight; - - vScreen[0].sx = -0.5f + (float)Render.left; - vScreen[0].sy = -0.5f + (float)Render.top; - vScreen[1].sx = -0.5f + (float)Render.right; - vScreen[1].sy = -0.5f + (float)Render.top; - vScreen[2].sx = -0.5f + (float)Render.left; - vScreen[2].sy = -0.5f + (float)Render.bottom; - vScreen[3].sx = -0.5f + (float)Render.right; - vScreen[3].sy = -0.5f + (float)Render.bottom; - } - - pD3DDevice->SetViewport(&Viewport); - - if (bUseRGBEffects) { - nColour = ((0xFF - nRGBEffectAttenuation) << 24) | nRGBScanlineIntensity; - if (nRGBEffectBlendmode == 0) { - pD3DDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - pD3DDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCCOLOR); - } else { - pD3DDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_DESTCOLOR); - pD3DDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO); - } - } else { - nColour = ((0xFF - nRGBEffectAttenuation) << 24) | nVidScanIntensity; - - if (bUse3DProjection && bUseLighting) { - - pD3DDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE); - pD3DDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO); - - pD3DDevice->LightEnable(0, TRUE); - pD3DDevice->LightEnable(1, TRUE); - - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_CURRENT); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - RenderPolygons(); - - pD3DDevice->LightEnable(1, FALSE); - pD3DDevice->LightEnable(0, FALSE); - - pD3DDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_INVDESTCOLOR); - pD3DDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE); - } else { - pD3DDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE); - pD3DDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO); - } - } - - if (bVidScanlines) { - if (nZoomFactor >= 2) { - bScanlines = 1; - } - if (nZoomFactor >= 4 || bVidFullStretch) { - nScanlineSize++; - } - } - - pD3DDevice->SetRenderState(D3DRENDERSTATE_TEXTUREFACTOR, nColour); - - if (bMultiTexturing) { - - if (bScanlines) { - if (bVidScanBilinear) { - pD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_LINEAR); - pD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_ANISOTROPIC); - } else { - pD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_POINT); - pD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFG_POINT); - } - if (bVidBilinear) { - pD3DDevice->SetTextureStageState(1, D3DTSS_MAGFILTER, D3DTFG_LINEAR); - pD3DDevice->SetTextureStageState(1, D3DTSS_MINFILTER, D3DTFN_ANISOTROPIC); - } else { - pD3DDevice->SetTextureStageState(1, D3DTSS_MAGFILTER, D3DTFG_POINT); - pD3DDevice->SetTextureStageState(1, D3DTSS_MINFILTER, D3DTFN_ANISOTROPIC); - } - - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TFACTOR); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, nScanlineOp); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - pD3DDevice->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 1); - - pD3DDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pD3DDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT); - pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE); - pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - pD3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0); - - pD3DDevice->SetTexture(0, pScanlineTexture[nScanlineSize]); - pD3DDevice->SetTexture(1, pEmuImage[nPage]); - - } else { - if (bVidBilinear) { - pD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_LINEAR); - pD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_ANISOTROPIC); - } else { - pD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_POINT); - pD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFG_POINT); - } - - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - pD3DDevice->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 0); - - pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - pD3DDevice->SetTexture(0, pEmuImage[nPage]); - } - - RenderPolygons(); - - pD3DDevice->SetTexture(0, NULL); - pD3DDevice->SetTexture(1, NULL); - - } else { // multi-texturing not supported by hardware - - if (bVidBilinear) { - pD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_LINEAR); - pD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_ANISOTROPIC); - } else { - pD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_POINT); - pD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFG_POINT); - } - - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - pD3DDevice->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 0); - - pD3DDevice->SetTexture(0, pEmuImage[nPage]); - - pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - RenderPolygons(); - - pD3DDevice->SetTexture(0, NULL); - - if (bScanlines) { - - if (bVidScanBilinear) { - pD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_LINEAR); - pD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_ANISOTROPIC); - } else { - pD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_POINT); - pD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFG_POINT); - } - - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TFACTOR); - pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, nScanlineOp); - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - pD3DDevice->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 1); - - pD3DDevice->SetTexture(0, pScanlineTexture[nScanlineSize]); - - pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - pD3DDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_DESTCOLOR); - pD3DDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO); - - RenderPolygons(); - - pD3DDevice->SetTexture(0, NULL); - } - } - - if (FAILED(pD3DDevice->EndScene())) { - return 1; - } - - return 0; -} - -// Copy the game image to the texture and render the image using 3D hardware -static int vidBurnToSurf() -{ - if (bLostControl) { // We've lost control of the video hardware - return 1; - } - - RECT rect = { 0, 0, nGameImageWidth, nGameImageHeight }; - - DDSURFACEDESC2 ddsd; - - unsigned char *pd, *ps; - int nSize = nGameImageWidth * nVidImageBPP; - int nPitch; - - // Lock the surface so we can write to it - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - - if (nVidTransferMethod <= 0) { - if (nPreScaleEffect) { - - rect.right *= nPreScaleZoom; - rect.bottom *= nPreScaleZoom; - - VidSoftFXApplyEffectDirectX(pEmuImage[2], NULL); - } else { - // Copy the image to a surface (located in video memory), then use bltfast() to blit it to the texture - if (FAILED(pEmuImage[2]->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL))) { - return 1; - } - ps = pVidImage + nVidImageLeft * nVidImageBPP; - pd = (unsigned char*)ddsd.lpSurface; - nPitch = ddsd.lPitch; - - for (int y = 0; y < nGameImageHeight; y++, pd += nPitch, ps += nVidImagePitch) { - memcpy(pd, ps, nSize); - } - - pEmuImage[2]->Unlock(NULL); - } - - pEmuImage[0]->BltFast(0, 0, pEmuImage[2], &rect, DDBLTFAST_WAIT); - } else { - if (nPreScaleEffect) { - - rect.right *= nPreScaleZoom; - rect.bottom *= nPreScaleZoom; - - VidSoftFXApplyEffectDirectX(pEmuImage[0], &rect); - } else { - // Use the surface supplied by DirectX texture management and let it perform the blit - if (FAILED(pEmuImage[0]->Lock(&rect, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY | DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT, NULL))) { - return 1; - } - - ps = pVidImage + nVidImageLeft * nVidImageBPP; - pd = (unsigned char*)ddsd.lpSurface; - nPitch = ddsd.lPitch; - - for (int y = 0; y < nGameImageHeight; y++, pd += nPitch, ps += nVidImagePitch) { - memcpy(pd, ps, nSize); - } - - pEmuImage[0]->Unlock(NULL); - } - } - - return 0; -} - -// Run one frame and render the screen -static int vidFrame(bool bRedraw) // bRedraw = 0 -{ - // Check if we've lost control of the video hardware - if (FAILED(pPrimarySurf->IsLost()) || FAILED(pDD->TestCooperativeLevel())) { - bLostControl = true; - } - - // If we've lost control, see if we've regained it and attempt to restore surfaces - if (bLostControl) { - if (FAILED(pDD->TestCooperativeLevel())) { - return 1; - } - - if (nVidFullscreen) { - pDD->Compact(); - } - - if (FAILED(pPrimarySurf->IsLost())) { - if (FAILED(pPrimarySurf->Restore())) { - return 1; - } - } - - if (!bUsePageflip) { - if (FAILED(pBackbuffer->IsLost())) { - if (FAILED(pBackbuffer->Restore())) { - return 1; - } - } - } - - for (int i = 0; i < 4; i++) { - - // Skip texture 0 if we're using DirectX texture management - if (nVidTransferMethod > 0 && i == 0) { - continue; - } - - if (pEmuImage[i]) { - if (FAILED(pEmuImage[i]->IsLost())) { - if (FAILED(pEmuImage[i]->Restore())) { - return 1; - } - } - } - } - - if (InitEffectsSurfaces()) { // Restore RGB effects and/or scanline surfaces - return 1; - } - - if (VidSRestoreOSD()) { - return 1; - } - - vidClear(); // Clear screen - - bLostControl = false; - } - -#ifdef ENABLE_PROFILING - ProfileProfileStart(0); -#else - vidRenderImageA(); -#endif - - if (bDrvOkay) { - if (bRedraw) { // Redraw current frame - if (BurnDrvRedraw()) { - BurnDrvFrame(); // No redraw function provided, advance one frame - } - } else { - BurnDrvFrame(); // Run one frame and draw the screen - } - } -#ifdef ENABLE_PROFILING - ProfileProfileEnd(0); - - ProfileProfileStart(1); -#endif - - vidBurnToSurf(); // Copy the memory buffer - -#ifdef ENABLE_PROFILING - ProfileProfileStart(2); - vidRenderImageA(); -#endif - - vidRenderImageB(); // Use 3D hardware to render the image - -#ifdef ENABLE_PROFILING - { - // Force the D3D pipeline to be flushed - - DDSURFACEDESC2 ddsd; - - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - - if (SUCCEEDED(pBackbuffer->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL))) { - unsigned char c = *((unsigned char*)ddsd.lpSurface); - - pBackbuffer->Unlock(NULL); - } - } - - ProfileProfileEnd(2); - ProfileProfileEnd(1); - - dprintf(_T("burn %.2lfms; blit %.2lf; effect %.2lf\n"), ProfileProfileReadAverage(0), ProfileProfileReadAverage(1), ProfileProfileReadAverage(2)); -#endif - - return 0; -} - -// Paint the Dtos surface onto the primary surface -int vidPaint(int bValidate) -{ - RECT rect; - - if (bLostControl) { // We've lost control of the video hardware - return 1; - } - - if (FAILED(pPrimarySurf->IsLost())) { // We've lost control of the video hardware - return 1; - } - - if (!bUsePageflip) { - GetClientScreenRect(hVidWnd, &rect); - rect.top += nMenuHeight; - - vidScale(&rect, nGameWidth, nGameHeight); - - if ((rect.right - rect.left) != (Dest.right - Dest.left) || (rect.bottom - rect.top ) != (Dest.bottom - Dest.top)) { - bValidate |= 2; - } - } - - if (bValidate & 2) { - vidRenderImageA(); - vidRenderImageB(); - } - - // Display OSD text message - VidSDisplayOSD(pBackbuffer, &Render, 0); - - if(bVidVSync && !nVidFullscreen) { pDD->WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL); } - - // Display final image - if (bUsePageflip) { - if (bUseTriplebuffer) { - if (FAILED(pPrimarySurf->Flip(NULL, DDFLIP_WAIT))) { - return 1; - } - } else { - if (FAILED(pPrimarySurf->Flip(NULL, DDFLIP_NOVSYNC | DDFLIP_WAIT))) { - return 1; - } - } - } else { - - if (nVidFullscreen) { - if (FAILED(pPrimarySurf->BltFast(Dest.left, Dest.top, pBackbuffer, &Dest, DDBLTFAST_WAIT))) { - return 1; - } - } else { - RECT RGBDest = {0, 0, Dest.right - Dest.left, Dest.bottom - Dest.top}; - - if (FAILED(pPrimarySurf->Blt(&rect, pBackbuffer, &RGBDest, DDBLT_ASYNC, NULL))) { - if (FAILED(pPrimarySurf->Blt(&rect, pBackbuffer, &RGBDest, DDBLT_WAIT, NULL))) { - return 1; - } - } - //if(bVidVSync && !nVidFullscreen) { pDD->WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL); } - - } - - if (bValidate & 1) { - // Validate the rectangle we just drew - POINT c = {0, 0}; - ClientToScreen(hVidWnd, &c); - rect.left -= c.x; rect.right -= c.x; - rect.top -= c.y; rect.bottom -= c.y; - ValidateRect(hVidWnd, &rect); - } - } - - return 0; -} - -static int vidGetSettings(InterfaceInfo* pInfo) -{ - if (nVidFullscreen) { - if (bUseTriplebuffer) { - IntInfoAddStringModule(pInfo, _T("Using a triple buffer")); - } else { - if (bUsePageflip) { - IntInfoAddStringModule(pInfo, _T("Using a double buffer")); - } else { - IntInfoAddStringModule(pInfo, _T("Using Bltfast() to transfer the image")); - } - } - } else { - IntInfoAddStringModule(pInfo, _T("Using Blt() to transfer the image")); - } - - if (nPreScale) { - TCHAR szString[MAX_PATH] = _T(""); - - if (nPreScaleEffect) { - _sntprintf(szString, MAX_PATH, _T("Prescaling using %s (%ix zoom)"), VidSoftFXGetEffect(nPreScaleEffect), nPreScaleZoom); - } else { - _sntprintf(szString, MAX_PATH, _T("Prescaling using 3D hardware (%ix zoom)"), nPreScaleZoom); - } - IntInfoAddStringModule(pInfo, szString); - } - - if (bUse3DProjection || bUseRGBEffects || bVidScanDelay || bVidScanlines) { - TCHAR* pszEffect[8] = { _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), _T("") }; - TCHAR szString[MAX_PATH] = _T(""); - - if (bUse3DProjection) { - pszEffect[0] = _T("3D projection"); - } - if (bUseRGBEffects) { - pszEffect[0] = _T("RGB effects"); - } - - if (bVidScanDelay || bVidScanlines) { - pszEffect[1] = _T(","); - if (bVidScanDelay && bVidScanlines) { - pszEffect[2] = _T(" feedback"); - pszEffect[3] = _T(","); - pszEffect[4] = _T(" scanlines"); - } else { - if (bVidScanDelay) { - pszEffect[2] = _T(" feedback"); - } - if (bVidScanlines) { - pszEffect[2] = _T(" scanlines"); - } - } - } - - _sntprintf(szString, MAX_PATH, _T("Applying %s%s%s%s%s%s%s%s"), pszEffect[0], pszEffect[1], pszEffect[2], pszEffect[3], pszEffect[4], pszEffect[5], pszEffect[6], pszEffect[7]); - IntInfoAddStringModule(pInfo, szString); - } - - if (nVidTransferMethod > 0) { - TCHAR szString[MAX_PATH] = _T(""); - - _sntprintf(szString, MAX_PATH, _T("Using Direct3D texture management"), VidSoftFXGetEffect(nPreScaleEffect), nPreScaleZoom); - IntInfoAddStringModule(pInfo, szString); - } - - return 0; -} - -// The video output plugin: -struct VidOut VidOutD3D = { vidInit, vidExit, vidFrame, vidPaint, vidScale, vidGetSettings, _T("DirectDraw7 / Direct3D7 Enhanced video output") }; -#else -struct VidOut VidOutD3D = { NULL, NULL, NULL, NULL, NULL, NULL, _T("DirectDraw7 / Direct3D7 Enhanced video output") }; -#endif - diff --git a/jan/src/intf/video/win32/vid_ddraw.cpp b/jan/src/intf/video/win32/vid_ddraw.cpp deleted file mode 100644 index 55cfab76b..000000000 --- a/jan/src/intf/video/win32/vid_ddraw.cpp +++ /dev/null @@ -1,1147 +0,0 @@ -// DirectDraw blitter - -#include "burner.h" - -#if !defined BUILD_X64_EXE - #include "vid_directx_support.h" -#endif - -#include -#define DIRECT3D_VERSION 0x0700 // Use this Direct3D version - -#if defined BUILD_X64_EXE - #include "vid_directx_support.h" -#endif - -#include "ddraw_core.h" - -static IDirectDraw7* DtoDD = NULL; // DirectDraw interface -static IDirectDrawSurface7* DtoPrim = NULL; // Primary surface -static IDirectDrawSurface7* DtoBack = NULL; // Back buffer surface - -static int nRotateGame; -static bool bRotateScanlines; -static DDBLTFX* DtoBltFx = NULL; // We use mirrored blits for flipped games - -static IDirectDrawSurface7* pddsDtos = NULL; // The screen surface -static int nGameWidth = 0, nGameHeight = 0; // screen size - -static bool bDtosScan; - -static RECT Src = { 0, 0, 0, 0 }; -static RECT Dest = { 0, 0, 0, 0 }; - -static int nHalfMask = 0; - -static int nUseSys; // Use System or Video memory - -static int DtoPrimClear() -{ - if (DtoPrim == NULL) { - return 1; - } - - VidSClearSurface(DtoPrim, 0, NULL); // Clear 1st page - - if (DtoBack) { // We're using a triple buffer - VidSClearSurface(DtoBack, 0, NULL); // Clear 2nd page - DtoPrim->Flip(NULL, DDFLIP_WAIT); - VidSClearSurface(DtoBack, 0, NULL); // Clear 3rd page - } - - return 0; -} - -static int DtoPrimInit(int bTriple) -{ - DDSURFACEDESC2 ddsd; - - // Create the primary surface - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - if (bTriple) { // Make a primary surface capable of triple bufferring - ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_VIDEOMEMORY; - ddsd.dwBackBufferCount = 2; - } else { - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - } - - if (FAILED(DtoDD->CreateSurface(&ddsd, &DtoPrim, NULL))) { - return 1; - } - - if (bTriple) { - // Get the back buffer - memset(&ddsd.ddsCaps, 0, sizeof(ddsd.ddsCaps)); - ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER; - - if (FAILED(DtoPrim->GetAttachedSurface(&ddsd.ddsCaps, &DtoBack))) { // Failed to make triple buffer - RELEASE(DtoPrim) - return 1; - } - - DtoPrimClear(); // Clear surfaces - } - - return 0; -} - -// Try to autodetect the best secondary buffer type to use, based on the hardware capabilities -static int AutodetectUseSys() -{ - DDCAPS ddc; - - memset(&ddc, 0, sizeof(ddc)); - ddc.dwSize = sizeof(ddc); - DtoDD->GetCaps(&ddc, NULL); - - if (ddc.dwCaps & DDCAPS_BLTSTRETCH) { // If it can do a hardware stretch use video memory - return 0; - } else { // Otherwise use system memory: - return 1; - } -} - -// Create a secondary DirectDraw surface for the game image -static int DtosMakeSurf() -{ - int nRet; - - nUseSys = 0; - DDSURFACEDESC2 ddsd; - - if (DtoDD == NULL) { - return 1; - } - - nUseSys = nVidTransferMethod; - if (nUseSys < 0) { - nUseSys = AutodetectUseSys(); - } - - // Try to allocate buffer in Video memory first, if that fails use System memory - do { - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - if (nUseSys == 0) { - ddsd.ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY; - } else { - if (nUseSys == 1) { - ddsd.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY; - } - } - - ddsd.dwWidth = nGameWidth << 1; // Make the surface large enough to add scanlines - ddsd.dwHeight = nGameHeight << 1; // - - nRet = DtoDD->CreateSurface(&ddsd, &pddsDtos, NULL); - - if (SUCCEEDED(nRet)) { // Break early, so nUseSys will keep its value - break; - } - - } while (++nUseSys <= 1); - - if (FAILED(nRet)) { - return 1; - } - - nVidScrnDepth = VidSGetSurfaceDepth(pddsDtos); // Get colourdepth of primary surface - - VidSClearSurface(pddsDtos, 0, NULL); - - return 0; -} - -static int DtosExit() -{ - RELEASE(pddsDtos); - - VidSFreeVidImage(); - - VidSExitOSD(); - - return 0; -} - -static int DtosInit() -{ - if (DtoDD == NULL) { - return 1; - } - - if (nRotateGame & 1) { - nVidImageWidth = nGameHeight; - nVidImageHeight = nGameWidth; - } else { - nVidImageWidth = nGameWidth; - nVidImageHeight = nGameHeight; - } - - if (bVidScanRotate && nGameWidth < nGameHeight) { - bRotateScanlines = true; - } else { - bRotateScanlines = false; - } - - nVidImageDepth = VidSGetSurfaceDepth(DtoPrim); // Get color depth of primary surface - nVidImageBPP = (nVidImageDepth + 7) >> 3; - - // Make the mask to mask out all but the lowest intensity bit - if (nVidImageDepth == 15) { - nHalfMask = 0xFBDEFBDE; - } else { - if (nVidImageDepth == 16) { - nHalfMask = 0xF7DEF7DE; - } else { - nHalfMask = 0xFEFEFEFE; - } - } - - // Make the normal memory buffer - if (VidSAllocVidImage()) { - DtosExit(); - return 1; - } - - // Make the DirectDraw secondary surface - if (DtosMakeSurf()) { - DtosExit(); - return 1; - } - - // Use our callback to get colors: - SetBurnHighCol(nVidImageDepth); - - Dest.left = 0; Dest.right = -1; - - RECT rect = { 0, 0, 0, 0 }; - GetClientScreenRect(hVidWnd, &rect); - rect.top += nMenuHeight; - - VidSScaleImage(&rect, nGameWidth, nGameHeight, bVidScanRotate); - - VidSInitOSD(4); - - return 0; -} - -static int vidExit() -{ - VidSRestoreGamma(); - - VidSRestoreScreenMode(); - - DtosExit(); - - RELEASE(DtoPrim) // a single call releases all surfaces - DtoBack = NULL; - - VidSExit(); - - if (DtoBltFx) { - free(DtoBltFx); - DtoBltFx = NULL; - } - - RELEASE(DtoDD) - - return 0; -} - -static GUID MyGuid; -static int nWantDriver; - -#ifdef PRINT_DEBUG_INFO -static int nCurrentDriver; -#ifdef UNICODE -static BOOL PASCAL MyEnumDisplayDrivers(GUID FAR* pGuid, LPWSTR pszDesc, LPWSTR /*pszName*/, LPVOID /*pContext*/, HMONITOR /*hMonitor*/) -#else -static BOOL PASCAL MyEnumDisplayDrivers(GUID FAR* pGuid, LPSTR pszDesc, LPSTR /*pszName*/, LPVOID /*pContext*/, HMONITOR /*hMonitor*/) -#endif -{ - if (nCurrentDriver == nWantDriver) { - memcpy(&MyGuid, pGuid, sizeof(GUID)); - } - - if (nCurrentDriver == 0) { - dprintf(_T(" %s\n"), pszDesc); - } else { - dprintf(_T(" Display %d (on %s)\n"), nCurrentDriver, pszDesc); - } - - nCurrentDriver++; - - return DDENUMRET_OK; -} -#endif - -static int vidInit() -{ - hVidWnd = hScrnWnd; // Use Screen window for video - -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Enumerating available drivers:\n")); - nWantDriver = 0; - nCurrentDriver = 0; - _DirectDrawEnumerateEx(MyEnumDisplayDrivers, NULL, DDENUM_ATTACHEDSECONDARYDEVICES | DDENUM_DETACHEDSECONDARYDEVICES | DDENUM_NONDISPLAYDEVICES); -#endif - - // Get pointer to DirectDraw device - _DirectDrawCreateEx(nWantDriver ? &MyGuid : NULL, (void**)&DtoDD, IID_IDirectDraw7, NULL); - - VidSInit(DtoDD); - - nGameWidth = nVidImageWidth; nGameHeight = nVidImageHeight; - - nRotateGame = 0; - if (bDrvOkay) { - DtoBltFx = NULL; - - // Get the game screen size - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if (nVidRotationAdjust & 1) { - int n = nGameWidth; - nGameWidth = nGameHeight; - nGameHeight = n; - nRotateGame |= (nVidRotationAdjust & 2); - } else { - nRotateGame |= 1; - } - } - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - nRotateGame ^= 2; - } - - if (nRotateGame & 2) { - DDCAPS ddcaps; - - // Disable flipping until we've checked the hardware supports it - nRotateGame &= ~2; - - memset(&ddcaps, 0, sizeof(ddcaps)); - ddcaps.dwSize = sizeof(ddcaps); - - DtoDD->GetCaps(&ddcaps, NULL); - if (((ddcaps.dwFXCaps & DDFXCAPS_BLTMIRRORLEFTRIGHT) && (ddcaps.dwFXCaps & DDFXCAPS_BLTMIRRORUPDOWN)) || bVidForceFlip) { - - DtoBltFx = (DDBLTFX*)malloc(sizeof(DDBLTFX)); - if (DtoBltFx == NULL) { - vidExit(); - return 1; - } - - memset(DtoBltFx, 0, sizeof(DDBLTFX)); - - DtoBltFx->dwSize = sizeof(DDBLTFX); - DtoBltFx->dwDDFX = DDBLTFX_MIRRORLEFTRIGHT | DDBLTFX_MIRRORUPDOWN; - - // Enable flipping now - nRotateGame |= 2; - } - } - } - - DtoPrim = NULL; // No primary surface yet - DtoBack = NULL; - - // Remember the changes to the display - if (nVidFullscreen) { - if (VidSEnterFullscreenMode(nScreenSize, 0)) { - vidExit(); - return 1; - } - } else { - DtoDD->SetCooperativeLevel(hVidWnd, DDSCL_NORMAL); - } - -#ifdef PRINT_DEBUG_INFO - { - // Display amount of free video memory - DDSCAPS2 ddsCaps2; - DWORD dwTotal; - DWORD dwFree; - - memset(&ddsCaps2, 0, sizeof(ddsCaps2)); - ddsCaps2.dwCaps = DDSCAPS_PRIMARYSURFACE; - - dprintf(_T(" ** Starting DirectDraw7 blitter.\n")); - - if (SUCCEEDED(DtoDD->GetAvailableVidMem(&ddsCaps2, &dwTotal, &dwFree))) { - dprintf(_T(" * Initialising video: Total video memory minus display surface: %.2fMB.\n"), (double)dwTotal / (1024 * 1024)); - } - - if (bDrvOkay) { - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - if (nRotateGame & 2) { - dprintf(_T(" * Using graphics hardware to rotate the image 180 degrees.\n")); - } else { - dprintf(_T(" * Warning: Graphics hardware does not support mirroring blits.\n Image orientation will be incorrect.\n")); - } - } - } - } -#endif - - if (bVidTripleBuffer && nVidFullscreen) { - if (DtoPrimInit(1)) { // Try to make triple buffer - -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Warning: Couldn't allocate a triple-buffering surface.\n")); -#endif - - // If we fail, fail entirely and make a normal buffer - RELEASE(DtoPrim) - } - } - - if (DtoPrim == NULL) { - // No primary surface yet, so try normal - if (DtoPrimInit(0)) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create primary surface.\n")); -#endif - - vidExit(); - return 1; - } - } - - if (nVidFullscreen) { - DtoDD->Compact(); - } - - VidSClipperInit(DtoPrim); - - VidSSetupGamma(DtoPrim); - - // Init the buffer surfaces - if (DtosInit()) { - vidExit(); - return 1; - } - -#ifdef PRINT_DEBUG_INFO - { - DDSCAPS2 ddsCaps2; - DWORD dwTotal; - DWORD dwFree; - - memset(&ddsCaps2, 0, sizeof(ddsCaps2)); - ddsCaps2.dwCaps = DDSCAPS_PRIMARYSURFACE; - - if (SUCCEEDED(DtoDD->GetAvailableVidMem(&ddsCaps2, &dwTotal, &dwFree))) { - dprintf(_T(" * Initialisation complete: %.2fMB video memory free.\n"), (double)dwFree / (1024 * 1024)); - dprintf(_T(" Displaying and rendering in %i-bit mode, emulation running in %i-bit mode.\n"), nVidScrnDepth, nVidImageDepth); - if (nUseSys) { - dprintf(_T(" Blitting directly from system memory.\n")); - } else { - dprintf(_T(" Transferring the image to video memory before blitting.\n")); - } - if (nVidFullscreen) { - dprintf(_T(" Running in fullscreen mode (%i x %i)"), nVidScrnWidth, nVidScrnHeight); - if (DtoBack != NULL) { - dprintf(_T(", using a triple buffer")); - } - dprintf(_T(".\n")); - } else { - dprintf(_T(" Running in windowed mode.\n")); - } - } - } -#endif - - return 0; -} - -// Copy pVidImage to pddsDtos, rotate -static int vidRenderRotate(DDSURFACEDESC2* ddsd) -{ - unsigned char *pd, *ps, *pdd; - unsigned char *Surf; - int nPitch; - - Surf = (unsigned char*)ddsd->lpSurface; - nPitch = ddsd->lPitch; - - pd = Surf; - - if (bDtosScan) { - if (bVidScanHalf) { - if (bVidScanRotate) { - switch (nVidImageBPP) { - case 4: { - int t; - for (int y = 0; y < nGameHeight; y++, pd += nPitch) { - ps = pVidImage + (nGameHeight - 1 - y) * 4; - pdd = pd; - for (int x = 0; x < nGameWidth; x++) { - t = *(int*)ps; - ps += nVidImagePitch; - *(int*)pdd = t; - pdd += 4; - *(int*)pdd = (t & 0xFEFEFE) >> 1; - pdd += 4; - } - } - break; - } - case 3: { - for (int y = 0; y < nGameHeight; y++, pd += nPitch) { - ps = pVidImage + (nGameHeight - 1 - y) * 3; - pdd = pd; - for (int x = 0; x < nGameWidth; x++) { - pdd[0] = ps[0]; - pdd[1] = ps[1]; - pdd[2] = ps[2]; - pdd[3] = ps[0] >> 1; - pdd[4] = ps[1] >> 1; - pdd[5] = ps[2] >> 1; - ps += nVidImagePitch; - pdd +=6; - } - } - break; - } - case 2: { - short t; - for (int y = 0; y < nGameHeight; y++, pd += nPitch) { - ps = pVidImage + (nGameHeight - 1 - y) * 2; - pdd = pd; - for (int x = 0; x < nGameWidth; x++) { - t = *(short*)ps; - ps += nVidImagePitch; - *(short*)pdd = t; - pdd += 2; - *(short*)pdd = (t & nHalfMask) >> 1; - pdd += 2; - } - } - break; - } - } - - } else { - unsigned char* pBuffer = (unsigned char*)malloc(nPitch); - unsigned char* pd2; - - switch (nVidImageBPP) { - case 4: { - int t; - for (int y = 0; y < nGameHeight; y++, pd += nPitch * 2) { - ps = pVidImage + (nGameHeight - 1 - y) * 4; - pdd = pd; - pd2 = pBuffer; - for (int x = 0; x < nGameWidth; x++) { - t = *(int*)ps; - ps += nVidImagePitch; - *(int*)pdd = t; - *(int*)pd2 = t; - pdd += 4; - pd2 += 4; - } - pdd = pd + nPitch; - for (ps = pBuffer; ps < (pBuffer + nGameWidth * 4); ps += 4) { - *(int*)pdd = (*(int*)ps & 0xFEFEFE) >> 1; - pdd += 4; - } - } - break; - } - case 3: { - for (int y = 0; y < nGameHeight; y++, pd += nPitch * 2) { - ps = pVidImage + (nGameHeight - 1 - y) * 3; - pdd = pd; - pd2 = pBuffer; - for (int x = 0; x < nGameWidth; x++) { - pdd[0] = ps[0]; - pd2[0] = ps[0]; - pdd[1] = ps[1]; - pd2[1] = ps[1]; - pdd[2] = ps[2]; - pd2[2] = ps[2]; - ps += nVidImagePitch; - pdd += 3; - pd2 += 3; - } - pdd = pd + nPitch; - for (ps = pBuffer; ps < (pBuffer + nGameWidth * 3); ps += 3) { - pdd[0] = ps[0] >> 1; - pdd[1] = ps[1] >> 1; - pdd[2] = ps[2] >> 1; - pdd += 3; - } - } - break; - } - case 2: { - short t; - for (int y = 0; y < nGameHeight; y++, pd += nPitch * 2) { - ps = pVidImage + (nGameHeight - 1 - y) * 2; - pdd = pd; - pd2 = pBuffer; - for (int x = 0; x < nGameWidth; x++) { - t = *(short*)ps; - ps += nVidImagePitch; - *(short*)pdd = t; - *(short*)pd2 = t; - pdd += 2; - pd2 += 2; - } - pdd = pd + nPitch; - for (ps = pBuffer; ps < (pBuffer + nGameWidth * 2); ps += 4) { - *(unsigned int*)pdd = (*(unsigned int*)ps & nHalfMask) >> 1; - pdd += 4; - } - } - break; - } - } - if (pBuffer) { - free (pBuffer); - pBuffer = NULL; - } - } - } else { - int nPixelSize = nVidImageBPP; - if (bVidScanRotate) { - nPixelSize <<= 1; - } else { - nPitch <<= 1; - } - - switch (nVidImageBPP) { - case 4: { - for (int y = 0; y < nGameHeight; y++, pd += nPitch) { - ps = pVidImage + (nGameHeight - 1 - y) * 4; - pdd = pd; - for (int x = 0; x < nGameWidth; x++) { - *(int*)pdd = *(int*)ps; - ps += nVidImagePitch; - pdd += nPixelSize; - } - } - break; - } - case 3: { - for (int y = 0; y < nGameHeight; y++, pd += nPitch) { - ps = pVidImage + (nGameHeight - 1 - y) * 3; - pdd = pd; - for (int x = 0; x < nGameWidth; x++) { - pdd[0] = ps[0]; - pdd[1] = ps[1]; - pdd[2] = ps[2]; - ps += nVidImagePitch; - pdd += nPixelSize; - } - } - break; - } - case 2: { - for (int y = 0; y < nGameHeight; y++, pd += nPitch) { - ps = pVidImage + (nGameHeight - 1 - y) * 2; - pdd = pd; - for (int x = 0; x < nGameWidth; x++) { - *(short*)pdd = *(short*)ps; - ps += nVidImagePitch; - pdd += nPixelSize; - } - } - break; - } - } - } - } else { - switch (nVidImageBPP) { - case 4: { - for (int y = 0; y < nGameHeight; y++, pd += nPitch) { - ps = pVidImage + (nGameHeight - 1 - y) * 4; - pdd = pd; - for (int x = 0; x < nGameWidth; x++) { - *(int*)pdd = *(int*)ps; - ps += nVidImagePitch; - pdd += 4; - } - } - break; - } - case 3: { - for (int y = 0; y < nGameHeight; y++, pd += nPitch) { - ps = pVidImage + (nGameHeight - 1 - y) * 3; - pdd = pd; - for (int x = 0; x < nGameWidth; x++) { - pdd[0] = ps[0]; - pdd[1] = ps[1]; - pdd[2] = ps[2]; - ps += nVidImagePitch; - pdd +=3; - } - } - break; - } - case 2: { - for (int y = 0; y < nGameHeight; y++, pd += nPitch) { - ps = pVidImage + (nGameHeight - 1 - y) * 2; - pdd = pd; - for (int x = 0; x < nGameWidth; x++) { - *(short*)pdd = *(short*)ps; - ps += nVidImagePitch; - pdd += 2; - } - } - break; - } - } - } - - return 0; -} - -// Copy pVidImage to pddsDtos, don't rotate, add scanlines in odd lines if needed -static int vidRenderNoRotateHorScanlines(DDSURFACEDESC2* ddsd, int nField, int nHalf) -{ - unsigned char *pd, *ps; - - unsigned char* Surf = (unsigned char*)ddsd->lpSurface; - int nPitch = ddsd->lPitch; - if (bDtosScan) { - if (nField) { // copy to odd fields - Surf += nPitch; - } - nPitch <<= 1; - } - - pd = Surf; ps = pVidImage; - for (int y = 0; y < nVidImageHeight; y++, pd += nPitch, ps += nVidImagePitch) { - if (nHalf == 0) { - memcpy(pd, ps, nVidImagePitch); - } else { - unsigned char* psEnd = ps + nVidImagePitch; - unsigned char* pdp = pd; - unsigned char* psp = ps; - - do { - unsigned int t; - t = *((unsigned int *)(psp)); - t = (t & nHalfMask) >> 1; - *((unsigned int *)(pdp)) = t; - - psp += 4; - pdp += 4; - } while (psp < psEnd); - } - } - - return 0; -} - -// Copy pVidImage to pddsDtos, don't rotate, add rotated scanlines -static int vidRenderNoRotateVertScanlines(DDSURFACEDESC2* ddsd) -{ - unsigned char *pd, *ps; - unsigned char* Surf = (unsigned char*)ddsd->lpSurface; - int nPitch = ddsd->lPitch; - - if (bVidScanHalf) { - pd = Surf; ps = pVidImage; - switch (nVidImageBPP) { - case 4: { - unsigned char* pdp; - unsigned char* psp; - unsigned char* psEnd; - for (int y = 0; y < nVidImageHeight; y++, pd += nPitch, ps += nVidImagePitch) { - pdp = pd; - psp = ps; - psEnd = ps + nVidImagePitch; - do { - unsigned int t = *(unsigned int*)psp; - *(unsigned int*)pdp = t; - psp += 4; - pdp += 4; - *(unsigned int*)pdp = (t & 0xFEFEFE) >> 1; - pdp += 4; - } while (psp < psEnd); - } - break; - } - case 3: { - unsigned char* pdp; - unsigned char* psp; - unsigned char* psEnd; - for (int y = 0; y < nVidImageHeight; y++, pd += nPitch, ps += nVidImagePitch) { - pdp = pd; - psp = ps; - psEnd = ps + nVidImagePitch; - do { - pdp[0] = psp[0]; - pdp[1] = psp[1]; - pdp[2] = psp[2]; - pdp[3] = psp[0] >> 1; - pdp[4] = psp[1] >> 1; - pdp[5] = psp[2] >> 1; - psp += 3; - pdp += 6; - } while (psp < psEnd); - } - break; - } - case 2: { - unsigned char* pdp; - unsigned char* psp; - unsigned char* psEnd; - unsigned short t; - for (int y = 0; y < nVidImageHeight; y++, pd += nPitch, ps += nVidImagePitch) { - pdp = pd; - psp = ps; - psEnd = ps + nVidImagePitch; - do { - t = *(unsigned short*)psp; - *(unsigned short*)pdp = t; - psp += 2; - pdp += 2; - *(unsigned short*)pdp = (t & nHalfMask) >> 1; - pdp += 2; - } while (psp < psEnd); - } - break; - } - } - - } else { - pd = Surf; ps = pVidImage; - switch (nVidImageBPP) { - case 4: { - unsigned char* pdp; - unsigned char* psp; - unsigned char* psEnd; - for (int y = 0; y < nVidImageHeight; y++, pd += nPitch, ps += nVidImagePitch) { - pdp = pd; - psp = ps; - psEnd = ps + nVidImagePitch; - do { - *(unsigned int*)pdp = *(unsigned int*)psp; - - psp += 4; - pdp += 8; - } while (psp < psEnd); - } - break; - } - case 3: { - unsigned char* pdp; - unsigned char* psp; - unsigned char* psEnd; - for (int y = 0; y < nVidImageHeight; y++, pd += nPitch, ps += nVidImagePitch) { - pdp = pd; - psp = ps; - psEnd = ps + nVidImagePitch; - do { - pdp[0] = psp[0]; - pdp[1] = psp[1]; - pdp[2] = psp[2]; - - psp += 3; - pdp += 6; - } while (psp < psEnd); - } - break; - } - case 2: { - unsigned char* pdp; - unsigned char* psp; - unsigned char* psEnd; - for (int y = 0; y < nVidImageHeight; y++, pd += nPitch, ps += nVidImagePitch) { - pdp = pd; - psp = ps; - psEnd = ps + nVidImagePitch; - do { - *(unsigned short*)pdp = *(unsigned short*)psp; - - psp += 2; - pdp += 4; - } while (psp < psEnd); - } - break; - } - } - } - - return 0; -} - -static int vidBurnToSurf() -{ - DDSURFACEDESC2 ddsd; - - if (pddsDtos == NULL) { - return 1; - } - - if (DtoPrim->IsLost()) { // We've lost control of the screen - return 1; - } - - GetClientScreenRect(hVidWnd, &Dest); - - if (!nVidFullscreen) { - Dest.top += nMenuHeight; - } - - if (bVidArcaderes && nVidFullscreen) { - Dest.left = (Dest.right + Dest.left) / 2; - Dest.left -= nGameWidth / 2; - Dest.right = Dest.left + nGameWidth; - - Dest.top = (Dest.top + Dest.bottom) / 2; - Dest.top -= nGameHeight / 2; - Dest.bottom = Dest.top + nGameHeight; - } else { - VidSScaleImage(&Dest, nGameWidth, nGameHeight, bVidScanRotate); - } - - Src.right = nGameWidth; - Src.bottom = nGameHeight; - bool bScan = false; - - if (bVidScanlines) { // See if the display window is large enough to add scanlines if needed - if (bRotateScanlines) { - if (Dest.right - Dest.left >= (nGameWidth << 1)) { // We need to add vertical scanlines - Src.right <<= 1; - bScan = true; - } - } else { - if (Dest.bottom - Dest.top >= (nGameHeight << 1)) { // We need to add horizontal scanlines - Src.bottom <<= 1; - bScan = true; - } - } - } - - // Lock the surface so we can write to it - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - - if (FAILED(pddsDtos->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL))) { - return 1; - } - - if (bScan && !bDtosScan) { // Scanlines were just enabled. We need to clear the screen - for (int y = 0; y < (nVidImageHeight << 1); y++) { - memset(((unsigned char*)ddsd.lpSurface) + y * ddsd.lPitch, 0, ddsd.lPitch); - } - } - - bDtosScan = bScan; - - if (nRotateGame & 1) { - vidRenderRotate(&ddsd); - } else { - if (bDtosScan && bRotateScanlines) { - vidRenderNoRotateVertScanlines(&ddsd); - } else { - vidRenderNoRotateHorScanlines(&ddsd, 0, 0); - if (bDtosScan && bVidScanHalf) { - vidRenderNoRotateHorScanlines(&ddsd, 1, 1); - } - } - } - - pddsDtos->Unlock(NULL); - - return 0; -} - -// Run one frame and render the screen -int vidFrame(bool bRedraw) // bRedraw = 0 -{ - if (pVidImage == NULL) { - return 1; - } - - if (DtoPrim->IsLost()) { // We've lost control of the screen - if (VidSRestoreOSD()) { - return 1; - } - - if (FAILED(DtoDD->RestoreAllSurfaces())) { - return 1; - } - - DtoPrimClear(); - } - - if (bDrvOkay) { - if (bRedraw) { // Redraw current frame - if (BurnDrvRedraw()) { - BurnDrvFrame(); // No redraw function provided, advance one frame - } - } else { - BurnDrvFrame(); // Run one frame and draw the screen - } - } - - vidBurnToSurf(); - - return 0; -} - -// Paint the Dtos surface onto the primary surface -static int vidPaint(int bValidate) -{ - if (DtoPrim == NULL || pddsDtos == NULL) { - return 1; - } - - if (DtoPrim->IsLost()) { // We've lost control of the screen - return 1; - } - - if (!nVidFullscreen) { // Check if the window has changed since we prepared the image - RECT rect = { 0, 0, 0, 0 }; - - GetClientScreenRect(hVidWnd, &rect); - rect.top += nMenuHeight; - - VidSScaleImage(&rect, nGameWidth, nGameHeight, bVidScanRotate); - - if (Dest.left != rect.left || Dest.right != rect.right || Dest.top != rect.top || Dest.bottom != rect.bottom) { - bValidate |= 2; - } - } - - if (bValidate & 2) { - vidBurnToSurf(); - } - - DWORD dwBltFlags = 0; // See if we need to use blit effects - if (DtoBltFx) { - dwBltFlags |= DDBLT_DDFX; - } - - if (bVidVSync && !nVidFullscreen) { DtoDD->WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL); } - - if (DtoBack != NULL) { // Triple bufferring - if (FAILED(DtoBack->Blt(&Dest, pddsDtos, &Src, DDBLT_ASYNC | dwBltFlags, DtoBltFx))) { - if (FAILED(DtoBack->Blt(&Dest, pddsDtos, &Src, DDBLT_WAIT | dwBltFlags, DtoBltFx))) { - return 1; - } - } - VidSDisplayOSD(DtoBack, &Dest, 0); - - DtoPrim->Flip(NULL, DDFLIP_WAIT); - } else { // Normal - RECT rect = { 0, 0, nGameWidth, nGameHeight }; - int nFlags = 0; - - if (bDtosScan) { - if (bRotateScanlines) { - nFlags |= 0x01; - } else { - nFlags |= 0x02; - } - } - - // Display OSD text message - VidSDisplayOSD(pddsDtos, &rect, nFlags); - - if (FAILED(DtoPrim->Blt(&Dest, pddsDtos, &Src, DDBLT_ASYNC | dwBltFlags, DtoBltFx))) { - if (FAILED(DtoPrim->Blt(&Dest, pddsDtos, &Src, DDBLT_WAIT | dwBltFlags, DtoBltFx))) { - return 1; - } - } -/* - DWORD lpdwScanLine; - RECT window; - GetWindowRect(hVidWnd, &window); - - while (1) - { - DtoDD->GetScanLine(&lpdwScanLine); - if (lpdwScanLine >= (unsigned int)window.bottom) { - break; - } - //Sleep(1); - } -*/ - } - - if (bValidate & 1) { - // Validate the rectangle we just drew - POINT c = {0, 0}; - ClientToScreen(hVidWnd, &c); - Dest.left -= c.x; Dest.right -= c.x; - Dest.top -= c.y; Dest.bottom -= c.y; - ValidateRect(hVidWnd, &Dest); - } - - return 0; -} - -static int vidScale(RECT* pRect, int nWidth, int nHeight) -{ - return VidSScaleImage(pRect, nWidth, nHeight, bVidScanRotate); -} - -static int vidGetSettings(InterfaceInfo* pInfo) -{ - if (nVidFullscreen && DtoBack) { - IntInfoAddStringModule(pInfo, _T("Using a triple buffer")); - } else { - IntInfoAddStringModule(pInfo, _T("Using Blt() to transfer the image")); - } - - if (nUseSys) { - IntInfoAddStringModule(pInfo, _T("Using system memory")); - } else { - IntInfoAddStringModule(pInfo, _T("Using video memory for the final blit")); - } - - if (nRotateGame) { - TCHAR* pszEffect[8] = { _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), _T("") }; - TCHAR szString[MAX_PATH] = _T(""); - - pszEffect[0] = _T("Using "); - if (nRotateGame & 1) { - pszEffect[1] = _T("software rotation"); - } - if (nRotateGame & 2) { - if (nRotateGame & 1) { - pszEffect[2] = _T(" and"); - } - pszEffect[3] = _T(" hardware mirroring"); - } - pszEffect[4] = _T(", "); - - _sntprintf(szString, MAX_PATH, _T("%s%s%s%s%s%s%s%s"), pszEffect[0], pszEffect[1], pszEffect[2], pszEffect[3], pszEffect[4], pszEffect[5], pszEffect[6], pszEffect[7]); - IntInfoAddStringModule(pInfo, szString); - } - - if (bDtosScan) { - TCHAR* pszEffect[8] = { _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), _T("") }; - TCHAR szString[MAX_PATH] = _T(""); - - pszEffect[0] = _T("Applying "); - if (bVidScanHalf) { - pszEffect[1] = _T("50% "); - } - if (bVidScanRotate) { - pszEffect[2] = _T("rotated "); - } - pszEffect[3] = _T("scanlines"); - - _sntprintf(szString, MAX_PATH, _T("%s%s%s%s%s%s%s%s"), pszEffect[0], pszEffect[1], pszEffect[2], pszEffect[3], pszEffect[4], pszEffect[5], pszEffect[6], pszEffect[7]); - IntInfoAddStringModule(pInfo, szString); - } - - return 0; -} - -// The video output plugin: -struct VidOut VidOutDDraw = { vidInit, vidExit, vidFrame, vidPaint, vidScale, vidGetSettings, _T("DirectDraw7 video output") }; diff --git a/jan/src/intf/video/win32/vid_ddrawfx.cpp b/jan/src/intf/video/win32/vid_ddrawfx.cpp deleted file mode 100644 index 64917803d..000000000 --- a/jan/src/intf/video/win32/vid_ddrawfx.cpp +++ /dev/null @@ -1,573 +0,0 @@ -// Software blitter effects via DirectDraw -#include "burner.h" - -#if !defined BUILD_X64_EXE -// #include "vid_directx_support.h" - #include "vid_softfx.h" -#endif - -#include -#define DIRECT3D_VERSION 0x0700 // Use this Direct3D version - -#if defined BUILD_X64_EXE -// #include "vid_directx_support.h" - #include "vid_softfx.h" -#endif - -#include "ddraw_core.h" - -static IDirectDraw7* BlitFXDD = NULL; // DirectDraw interface -static IDirectDrawSurface7* BlitFXPrim = NULL; // Primary surface -static IDirectDrawSurface7* BlitFXBack = NULL; // Back buffer surface - -static int nGameWidth = 0, nGameHeight = 0; // screen size -IDirectDrawSurface7* pddsBlitFX[2] = {NULL, }; // The image surfaces - -static int nSize; -static int nUseBlitter; - -static int nUseSys; -static int nDirectAccess = 1; -static int nRotateGame = 0; - -static int PrimClear() -{ - if (BlitFXPrim == NULL) { - return 1; - } - VidSClearSurface(BlitFXPrim, 0, NULL); // Clear 1st page - - if (BlitFXBack == NULL) { - return 0; - } - - VidSClearSurface(BlitFXBack, 0, NULL); // Clear 2nd page - BlitFXPrim->Flip(NULL, DDFLIP_WAIT); // wait till the flip actually occurs - VidSClearSurface(BlitFXBack, 0, NULL); // Clear 3rd page - - return 0; -} - -static int AutodetectUseSys() -{ - // Try to autodetect the best secondary buffer type to use, based on the cards capabilities - DDCAPS ddc; - if (BlitFXDD == NULL) { - return 1; - } - memset(&ddc, 0, sizeof(ddc)); - ddc.dwSize = sizeof(ddc); - BlitFXDD->GetCaps(&ddc, NULL); - - if (ddc.dwCaps & DDCAPS_BLTSTRETCH) { // If it can do a hardware stretch use video memory - return 0; - } else { // Otherwise use system memory: - return 1; - } -} - -// Create a secondary DD surface for the screen -static int BlitFXMakeSurf() -{ - int nRet; - DDSURFACEDESC2 ddsd; - - if (BlitFXDD == NULL) { - return 1; - } - - nUseSys = nVidTransferMethod; - if (nUseSys < 0) { - nUseSys = AutodetectUseSys(); - } - - nDirectAccess = 0; - if (nUseSys == 0 && nUseBlitter != 0) { - nDirectAccess = ((nVidBlitterOpt[nVidSelect] >> 9) & 1) ^ 1; - } - - pddsBlitFX[0] = NULL; - pddsBlitFX[1] = NULL; - - // Try to allocate buffer in Video memory if required, always allocate one in System memory - if (nUseSys == 0) { - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - - ddsd.dwWidth = nGameWidth * nSize; - ddsd.dwHeight = nGameHeight * nSize; - - nRet = BlitFXDD->CreateSurface(&ddsd, &pddsBlitFX[0], NULL); - - if (nRet < 0 || pddsBlitFX[0] == NULL) { // Allocation in Video meory has failed, so use System memory only - pddsBlitFX[0] = NULL; - nDirectAccess = 0; - nUseSys = 1; - } - } - - if (nDirectAccess == 0) { - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; - - ddsd.dwWidth = nGameWidth * nSize; - ddsd.dwHeight = nGameHeight * nSize; - - nRet = BlitFXDD->CreateSurface(&ddsd, &pddsBlitFX[1], NULL); - - if (nRet < 0 || pddsBlitFX[1] == NULL) { - return 1; - } - } - - VidSClearSurface(pddsBlitFX[1 ^ nDirectAccess], 0, NULL); - - return 0; -} - -static int PrimInit(int bTriple) -{ - DDSURFACEDESC2 ddsd; - int nRet = 0; - - // Create the primary surface - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - if (bTriple) { - // Make a primary surface capable of triple bufferring - ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_VIDEOMEMORY; - ddsd.dwBackBufferCount = 2; - } else { - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - } - - BlitFXPrim = NULL; - nRet = BlitFXDD->CreateSurface(&ddsd, &BlitFXPrim, NULL); - if (nRet < 0 || BlitFXPrim == NULL) { - return 1; - } - - if (bTriple == 0) { // We are done - return 0; - } - - // Get the back buffer - memset(&ddsd.ddsCaps, 0, sizeof(ddsd.ddsCaps)); - ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER; - - BlitFXBack = NULL; - nRet = BlitFXPrim->GetAttachedSurface(&ddsd.ddsCaps, &BlitFXBack); - if (nRet < 0 || BlitFXBack == NULL) { // Failed to make triple buffer - RELEASE(BlitFXPrim) - return 1; - } - - PrimClear(); // Clear all three pages - return 0; -} - -static int BlitFXExit() -{ - RELEASE(pddsBlitFX[0]); - RELEASE(pddsBlitFX[1]); - - VidSFreeVidImage(); - - nRotateGame = 0; - - return 0; -} - -static int BlitFXInit() -{ - if (BlitFXDD == NULL) { - return 1; - } - - if (nRotateGame & 1) { - nVidImageWidth = nGameHeight; - nVidImageHeight = nGameWidth; - } else { - nVidImageWidth = nGameWidth; - nVidImageHeight = nGameHeight; - } - - RECT rect = { 0, 0, 0, 0 }; - GetClientScreenRect(hVidWnd, &rect); - if (!nVidFullscreen) { - rect.top += nMenuHeight; - } - - if (nUseBlitter >= FILTER_SUPEREAGLE && nUseBlitter <= FILTER_SUPER_2XSAI) { - nVidImageDepth = 16; // Use 565 format - } else { - nVidImageDepth = VidSGetSurfaceDepth(BlitFXPrim); // Use color depth of primary surface - } - nVidImageBPP = (nVidImageDepth + 7) >> 3; - nBurnBpp = nVidImageBPP; // Set Burn library Bytes per pixel - - // Use our callback to get colors: - SetBurnHighCol(nVidImageDepth); - - // Make the normal memory buffer - if (VidSAllocVidImage()) { - BlitFXExit(); - return 1; - } - - // Make the DirectDraw secondary surface - if (BlitFXMakeSurf()) { - BlitFXExit(); - return 1; - } - - return 0; -} - -static int Exit() -{ - VidSExitOSD(); - - BlitFXExit(); - - VidSRestoreGamma(); - - RELEASE(BlitFXPrim); // a single call releases all surfaces - BlitFXBack = NULL; - - VidSRestoreScreenMode(); - - VidSExit(); - - RELEASE(BlitFXDD) - - return 0; -} - -static int Init() -{ - if (hScrnWnd == NULL) { - return 1; - } - - hVidWnd = hScrnWnd; // Use Screen window for video - - nUseBlitter = nVidBlitterOpt[nVidSelect] & 0xFF; - - // Get pointer to DirectDraw device - _DirectDrawCreateEx(NULL, (void**)&BlitFXDD, IID_IDirectDraw7, NULL); - - VidSInit(BlitFXDD); - - nGameWidth = nVidImageWidth; nGameHeight = nVidImageHeight; - - nRotateGame = 0; - if (bDrvOkay) { - // Get the game screen size - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if (nVidRotationAdjust & 1) { - int n = nGameWidth; - nGameWidth = nGameHeight; - nGameHeight = n; - nRotateGame |= (nVidRotationAdjust & 2); - } else { - nRotateGame |= 1; - } - } - - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - nRotateGame ^= 2; - } - } - - BlitFXPrim = NULL; // No primary surface yet - BlitFXBack = NULL; - - bVidScanlines = 0; // !!! - nSize = VidSoftFXGetZoom(nUseBlitter); - - // Remember the changes to the display - if (nVidFullscreen) { - int nZoom = nSize; - if ((nVidBlitterOpt[nVidSelect] & 0x0100) == 0) { - nZoom = nScreenSize; - } - - if (VidSEnterFullscreenMode(nZoom, VidSoftFXCheckDepth(nUseBlitter, 16))) { - Exit(); - return 1; - } - - if (bVidTripleBuffer) { - if (PrimInit(1)) { // Try to make triple buffer - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_TRIPLE)); - FBAPopupDisplay(PUF_TYPE_WARNING); - - // If we fail, fail entirely and make a normal buffer - RELEASE(BlitFXBack); - RELEASE(BlitFXPrim); - } - } - } else { - BlitFXDD->SetCooperativeLevel(hVidWnd, DDSCL_NORMAL); - } - - if (BlitFXPrim == NULL) { - // No primary surface yet, so try normal - if (PrimInit(0)) { - RELEASE(BlitFXBack); - RELEASE(BlitFXPrim); - } - } - - if (BlitFXPrim == NULL) { // No primary surface - Exit(); - return 1; - } - - if (nVidFullscreen) { - BlitFXDD->Compact(); - } - - VidSClipperInit(BlitFXPrim); - - VidSSetupGamma(BlitFXPrim); - - // Initialize the buffer surfaces - BlitFXInit(); - - if (VidSoftFXInit(nUseBlitter, nRotateGame)) { - if (VidSoftFXInit(0, nRotateGame)) { - Exit(); - return 1; - } - } - - VidSInitOSD(4 - nSize); - - return 0; -} - -static int vidScale(RECT* pRect, int nWidth, int nHeight) -{ - if (nVidBlitterOpt[nVidSelect] & 0x0100) { - return VidSoftFXScale(pRect, nWidth, nHeight); - } - - return VidSScaleImage(pRect, nWidth, nHeight, false); -} - -// Copy BlitFXsMem to pddsBlitFX -static int MemToSurf() -{ - if (pddsBlitFX == NULL) { - return 1; - } - - if (BlitFXPrim->IsLost()) { // We've lost control of the screen - return 1; - } - - VidSoftFXApplyEffectDirectX(pddsBlitFX[1 ^ nDirectAccess], NULL); - - if (nUseSys == 0 && nDirectAccess == 0) { - DDSURFACEDESC2 ddsd; - DDSURFACEDESC2 ddsdVid; - - // Lock the surface so we can write to it - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - pddsBlitFX[1]->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); - if (ddsd.lpSurface == NULL) { - return 1; - } - unsigned char* Surf = (unsigned char*)ddsd.lpSurface; - int nPitch = ddsd.lPitch; - - // Lock the surface so we can write to it - memset(&ddsdVid, 0, sizeof(ddsdVid)); - ddsdVid.dwSize = sizeof(ddsdVid); - pddsBlitFX[0]->Lock(NULL, &ddsdVid, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); - if (ddsdVid.lpSurface == NULL) { - return 1; - } - - unsigned char *pd, *ps; - - unsigned char* VidSurf = (unsigned char*)ddsdVid.lpSurface; - int nVidPitch = ddsdVid.lPitch; - int nHeight = nGameHeight * nSize; - - pd = VidSurf; ps = Surf; - for (int y = 0; y < nHeight; y++, pd += nVidPitch, ps += nPitch) { - memcpy(pd, ps, nPitch); - } - - pddsBlitFX[0]->Unlock(NULL); - pddsBlitFX[1]->Unlock(NULL); - } - - return 0; -} - -// Run one frame and render the screen -static int Frame(bool bRedraw) // bRedraw = 0 -{ - if (pVidImage == NULL) { - return 1; - } - - if (BlitFXPrim->IsLost()) { // We've lost control of the screen - - if (VidSRestoreOSD()) { - return 1; - } - - if (FAILED(BlitFXDD->RestoreAllSurfaces())) { - return 1; - } - - PrimClear(); - } - - if (bDrvOkay) { - if (bRedraw) { // Redraw current frame - if (BurnDrvRedraw()) { - BurnDrvFrame(); // No redraw function provided, advance one frame - } - } else { - BurnDrvFrame(); // Run one frame and draw the screen - } - } - - MemToSurf(); // Copy the memory buffer to the directdraw buffer for later blitting - - return 0; -} - -// Paint the BlitFX surface onto the primary surface -static int Paint(int bValidate) -{ - RECT Dest = {0, 0, 0, 0}; - - if (BlitFXPrim == NULL || pddsBlitFX[nUseSys] == NULL) { - return 1; - } - - if (BlitFXPrim->IsLost()) { // We've lost control of the screen - return 1; - } - - GetClientScreenRect(hVidWnd, &Dest); - if (!nVidFullscreen) { - Dest.top += nMenuHeight; - } - - if (bVidArcaderes && nVidFullscreen) { - Dest.left = (Dest.right + Dest.left) / 2; - Dest.left -= nGameWidth / 2; - Dest.right = Dest.left + nGameWidth; - - Dest.top = (Dest.top + Dest.bottom) / 2; - Dest.top -= nGameHeight / 2; - Dest.bottom = Dest.top + nGameHeight; - } else { - if (!bVidFullStretch) { - vidScale(&Dest, nGameWidth, nGameHeight); - } - } - - if (bValidate & 2) { - MemToSurf(); // Copy the memory buffer to the directdraw buffer for later blitting - } - - RECT rect = { 0, 0, nGameWidth, nGameHeight }; - rect.right *= nSize; - rect.bottom *= nSize; - - // Display OSD text message - VidSDisplayOSD(pddsBlitFX[nUseSys], &rect, 0); - - if (bVidVSync && !nVidFullscreen) { BlitFXDD->WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL); } - - if (BlitFXBack != NULL) { - // Triple bufferring - if (BlitFXBack->Blt(&Dest, pddsBlitFX[nUseSys], NULL, DDBLT_WAIT, NULL) < 0) { - return 1; - } - BlitFXPrim->Flip(NULL, DDFLIP_WAIT); - } else { - // Normal - if (BlitFXPrim->Blt(&Dest, pddsBlitFX[nUseSys], NULL, DDBLT_WAIT, NULL) < 0) { - return 1; - } - } - - - -/* - DWORD lpdwScanLine; - RECT window; - GetWindowRect(hVidWnd, &window); - - while(1) { - BlitFXDD->GetScanLine(&lpdwScanLine); - if (lpdwScanLine >= (unsigned int)window.bottom) { - break; - } - //Sleep(1); - } -*/ - - if (bValidate & 1) { - // Validate the rectangle we just drew - POINT c = {0, 0}; - ClientToScreen(hVidWnd, &c); - Dest.left -= c.x; Dest.right -= c.x; - Dest.top -= c.y; Dest.bottom -= c.y; - ValidateRect(hVidWnd, &Dest); - } - - return 0; -} - -static int GetSettings(InterfaceInfo* pInfo) -{ - TCHAR szString[MAX_PATH] = _T(""); - - if (nVidFullscreen && BlitFXBack) { - IntInfoAddStringModule(pInfo, _T("Using a triple buffer")); - } else { - IntInfoAddStringModule(pInfo, _T("Using Blt() to transfer the image")); - } - - _sntprintf(szString, MAX_PATH, _T("Prescaling using %s (%ix zoom)"), VidSoftFXGetEffect(nUseBlitter), nSize); - IntInfoAddStringModule(pInfo, szString); - - if (nUseSys) { - IntInfoAddStringModule(pInfo, _T("Using system memory")); - } else { - if (nDirectAccess) { - IntInfoAddStringModule(pInfo, _T("Using video memory for effect buffers")); - } else { - IntInfoAddStringModule(pInfo, _T("Using video memory for the final blit")); - } - } - - if (nRotateGame) { - IntInfoAddStringModule(pInfo, _T("Using software rotation")); - } - - return 0; -} - -// The Video Output plugin: -struct VidOut VidOutDDrawFX = { Init, Exit, Frame, Paint, vidScale, GetSettings, _T("DirectDraw7 Software Effects video output") }; diff --git a/jan/src/intf/video/win32/vid_directx9.cpp b/jan/src/intf/video/win32/vid_directx9.cpp deleted file mode 100644 index 3e2796d47..000000000 --- a/jan/src/intf/video/win32/vid_directx9.cpp +++ /dev/null @@ -1,2296 +0,0 @@ -// DirectX9 Enhanced video output -#include "burner.h" -#include "vid_softfx.h" - -//#ifdef _MSC_VER -//#pragma comment(lib, "d3d9") -//#pragma comment(lib, "d3dx9") - - -// #define ENABLE_PROFILING FBA_DEBUG -// #define LOAD_EFFECT_FROM_FILE - -#include -#define DIRECT3D_VERSION 0x0900 // Use this Direct3D version -#define D3D_OVERLOADS -#include -#include - -#include "directx9_core.h" - -const float PI = 3.14159265358979323846f; - -typedef struct _D3DLVERTEX2 { - union { FLOAT x; FLOAT dvX; }; - union { FLOAT y; FLOAT dvY; }; - union { FLOAT z; FLOAT dvZ; }; - union { D3DCOLOR color; D3DCOLOR dcColor; }; - union { D3DCOLOR specular; D3DCOLOR dcSpecular; }; - union { FLOAT tu; FLOAT dvTU; }; - union { FLOAT tv; FLOAT dvTV; }; - union { FLOAT tu1; FLOAT dvTU1; }; - union { FLOAT tv1; FLOAT dvTV1; }; -#if(DIRECT3D_VERSION >= 0x0500) - #if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DLVERTEX2() { } - _D3DLVERTEX2(FLOAT _x, FLOAT _y, FLOAT _z, D3DCOLOR _color, D3DCOLOR _specular, FLOAT _tu, FLOAT _tv, FLOAT _tu1, FLOAT _tv1) - { - x = _x; y = _y; z = _z; - color = _color; specular = _specular; - tu = _tu; tv = _tv; - tu1 = _tu1; tv1 = _tv1; - } - #endif -#endif -} D3DLVERTEX2, *LPD3DLVERTEX2; - -#define D3DFVF_LVERTEX2 ( D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX2 | D3DFVF_TEXCOORDSIZE2(0) | D3DFVF_TEXCOORDSIZE2(1) | D3DFVF_TEXCOORDSIZE2(2) | D3DFVF_TEXCOORDSIZE2(3) ) - -#define RENDER_STRIPS (4) - -#define DX9_SHADERPRECISION ((nVidBlitterOpt[nVidSelect] & (7 << 28)) >> 28) -#define DX9_FILTER ((nVidBlitterOpt[nVidSelect] & (3 << 24)) >> 24) -#define DX9_USE_PS20 ( nVidBlitterOpt[nVidSelect] & (1 << 9)) -#define DX9_USE_FPTEXTURE ( nVidBlitterOpt[nVidSelect] & (1 << 8)) - -static IDirect3D9* pD3D = NULL; // Direct3D interface -static D3DPRESENT_PARAMETERS d3dpp; -static IDirect3DDevice9* pD3DDevice = NULL; -static IDirect3DVertexBuffer9* pVB[RENDER_STRIPS] = { NULL, }; -static IDirect3DTexture9* pTexture = NULL; -static IDirect3DTexture9* pScanlineTexture[2] = { NULL, }; -static int nTextureWidth = 0, nTextureHeight = 0; -static IDirect3DSurface9* pSurface = NULL; - -static IDirect3DVertexBuffer9* pIntermediateVB = NULL; -static IDirect3DTexture9* pIntermediateTexture = NULL; -static int nIntermediateTextureWidth, nIntermediateTextureHeight; - -static ID3DXEffect* pEffect = NULL; -static ID3DXTextureShader* pEffectShader = NULL; -static D3DXHANDLE hTechnique = NULL; -//static D3DXHANDLE hScanIntensity = NULL; -static IDirect3DTexture9* pEffectTexture = NULL; - -static ID3DXFont* pFont = NULL; // OSD font -static D3DCOLOR osdColor = D3DCOLOR_ARGB(0xFF, 0xFF, 0xFF, 0xFF); - -static double dPrevCubicB, dPrevCubicC; - -static bool bUsePS14; - -static int nGameWidth = 0, nGameHeight = 0; // Game screen size -static int nGameImageWidth, nGameImageHeight; - -static int nRotateGame; -static int nImageWidth, nImageHeight/*, nImageZoom*/; - -static RECT Dest; - -static unsigned int nD3DAdapter; - -// ---------------------------------------------------------------------------- -#ifdef PRINT_DEBUG_INFO -static TCHAR* TextureFormatString(D3DFORMAT nFormat) -{ - switch (nFormat) { - case D3DFMT_X1R5G5B5: - return _T("16-bit xRGB 1555"); - case D3DFMT_R5G6B5: - return _T("16-bit RGB 565"); - case D3DFMT_X8R8G8B8: - return _T("32-bit xRGB 8888"); - case D3DFMT_A8R8G8B8: - return _T("32-bit ARGB 8888"); - case D3DFMT_A16B16G16R16F: - return _T("64-bit ARGB 16161616fp"); - case D3DFMT_A32B32G32R32F: - return _T("128-bit ARGB 32323232fp"); - default: - return _T("unknown format"); - } - - return _T("unknown format"); -} -#endif -// ---------------------------------------------------------------------------- - -static int GetTextureSize(int nSize) -{ - int nTextureSize = 128; - - while (nTextureSize < nSize) { - nTextureSize <<= 1; - } - - return nTextureSize; -} - -/* -static void PutPixel(unsigned char** ppSurface, unsigned int nColour) -{ - switch (nVidScrnDepth) { - case 15: - *((unsigned short*)(*ppSurface)) = ((nColour >> 9) & 0x7C00) | ((nColour >> 6) & 0x03E0) | ((nColour >> 3) & 0x001F); - *ppSurface += 2; - break; - case 16: - *((unsigned short*)(*ppSurface)) = ((nColour >> 8) & 0xF800) | ((nColour >> 5) & 0x07E0) | ((nColour >> 3) & 0x001F); - *ppSurface += 2; - break; - case 24: - (*ppSurface)[0] = (nColour >> 16) & 0xFF; - (*ppSurface)[1] = (nColour >> 8) & 0xFF; - (*ppSurface)[2] = (nColour >> 0) & 0xFF; - *ppSurface += 3; - break; - case 32: - *((unsigned int*)(*ppSurface)) = nColour; - *ppSurface += 4; - break; - } -} -*/ - -static UINT dx9GetAdapter(wchar_t* name) -{ - for (int a = pD3D->GetAdapterCount() - 1; a >= 0; a--) - { - D3DADAPTER_IDENTIFIER9 identifier; - - pD3D->GetAdapterIdentifier(a, 0, &identifier); - - if (identifier.DeviceName[11] == name[11]) { - return a; - } - } - - return 0; -} - -// Select optimal full-screen resolution -int dx9SelectFullscreenMode(VidSDisplayScoreInfo* pScoreInfo) -{ - //int nWidth, nHeight; - - if (bVidArcaderes) { - if (!VidSGetArcaderes((int*)&(pScoreInfo->nBestWidth), (int*)&(pScoreInfo->nBestHeight))) { - return 1; - } - } else { - if (nScreenSize) { - D3DFORMAT nFormat = (nVidDepth == 16) ? D3DFMT_R5G6B5 : D3DFMT_X8R8G8B8; - D3DDISPLAYMODE dm; - - memset(pScoreInfo, 0, sizeof(VidSDisplayScoreInfo)); - pScoreInfo->nRequestedZoom = nScreenSize; - VidSInitScoreInfo(pScoreInfo); - - // Enumerate the available screenmodes - for (int i = pD3D->GetAdapterModeCount(nD3DAdapter, nFormat) - 1; i >= 0; i--) { - if (FAILED(pD3D->EnumAdapterModes(nD3DAdapter, nFormat, i, &dm))) { - return 1; - } - pScoreInfo->nModeWidth = dm.Width; - pScoreInfo->nModeHeight = dm.Height; - - VidSScoreDisplayMode(pScoreInfo); - } - - if (pScoreInfo->nBestWidth == -1U) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_FULL_NOMODE)); - FBAPopupDisplay(PUF_TYPE_ERROR); - return 1; - } - } else { - pScoreInfo->nBestWidth = nVidWidth; - pScoreInfo->nBestHeight = nVidHeight; - } - } - - if (!bDrvOkay && (pScoreInfo->nBestWidth < 640 || pScoreInfo->nBestHeight < 480)) { - return 1; - } - - return 0; -} - -// ---------------------------------------------------------------------------- - -static void FillEffectTexture() -{ - FLOAT B = (FLOAT)dVidCubicB; - FLOAT C = (FLOAT)dVidCubicC; - - if (pEffect == NULL) { - return; - } - -/* - if (dVidCubicSharpness > 0.5) { - C = dVidCubicSharpness; - B = 0.0; - } else { - C = dVidCubicSharpness; - B = 1.0 - 2.0 * C; - } -*/ - - if (DX9_SHADERPRECISION == 4 || bUsePS14) { - B = 0.0; - } - - if (pEffectShader && pEffectTexture) { - pEffectShader->SetFloat("B", B); - pEffectShader->SetFloat("C", C); - - _D3DXFillTextureTX(pEffectTexture, pEffectShader); - } - - pEffect->SetFloat("B", B); - pEffect->SetFloat("C", C); -} - -// ---------------------------------------------------------------------------- - -static void dx9ReleaseResources() -{ - RELEASE(pEffect); - RELEASE(pEffectShader); - RELEASE(pEffectTexture); - - RELEASE(pScanlineTexture[0]); - RELEASE(pScanlineTexture[1]); - RELEASE(pIntermediateTexture); - - RELEASE(pSurface); - RELEASE(pTexture); - - for (int y = 0; y < RENDER_STRIPS; y++) { - RELEASE(pVB[y]); - } - RELEASE(pIntermediateVB); -} - -static int dx9Exit() -{ - dx9ReleaseResources(); - - VidSFreeVidImage(); - - RELEASE(pFont); - RELEASE(pD3DDevice); - RELEASE(pD3D); - - nRotateGame = 0; - - return 0; -} - -static int dx9SurfaceInit() -{ - D3DFORMAT nFormat = D3DFMT_UNKNOWN; - - if (nRotateGame & 1) { - nVidImageWidth = nGameHeight; - nVidImageHeight = nGameWidth; - } else { - nVidImageWidth = nGameWidth; - nVidImageHeight = nGameHeight; - } - - nGameImageWidth = nVidImageWidth; - nGameImageHeight = nVidImageHeight; - - if (bDrvOkay && (BurnDrvGetFlags() & BDF_16BIT_ONLY)) { - nVidImageDepth = 15; - } else { - nVidImageDepth = nVidScrnDepth; - } - - switch (nVidImageDepth) { - case 32: - nFormat = D3DFMT_X8R8G8B8; - break; - case 24: - nFormat = D3DFMT_R8G8B8; - break; - case 16: - nFormat = D3DFMT_R5G6B5; - break; - case 15: - nFormat = D3DFMT_X1R5G5B5; - break; - } - - nVidImageBPP = (nVidImageDepth + 7) >> 3; - nBurnBpp = nVidImageBPP; // Set Burn library Bytes per pixel - - // Use our callback to get colors: - SetBurnHighCol(nVidImageDepth); - - // Make the normal memory buffer - if (VidSAllocVidImage()) { - dx9Exit(); - return 1; - } - - if (FAILED(pD3DDevice->CreateOffscreenPlainSurface(nVidImageWidth, nVidImageHeight, nFormat, D3DPOOL_DEFAULT, &pSurface, NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create surface.\n")); -#endif - return 1; - } -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Allocated a %i x %i (%s) surface.\n"), nVidImageWidth, nVidImageHeight, TextureFormatString(nFormat)); -#endif - - nTextureWidth = GetTextureSize(nGameImageWidth); - nTextureHeight = GetTextureSize(nGameImageHeight); - - if (FAILED(pD3DDevice->CreateTexture(nTextureWidth, nTextureHeight, 1, D3DUSAGE_RENDERTARGET, nFormat, D3DPOOL_DEFAULT, &pTexture, NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create texture.\n")); -#endif - return 1; - } -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Allocated a %i x %i (%s) image texture.\n"), nTextureWidth, nTextureHeight, TextureFormatString(nFormat)); -#endif - - return 0; -} - -static int dx9EffectSurfaceInit() -{ - D3DFORMAT nFormat; - - if (DX9_FILTER == 2 && (bUsePS14 || (DX9_SHADERPRECISION != 0 && DX9_SHADERPRECISION != 2))) { - switch (DX9_SHADERPRECISION) { - case 0: - nFormat = D3DFMT_A32B32G32R32F; - break; - case 1: - nFormat = D3DFMT_A16B16G16R16F; - break; - case 2: - nFormat = D3DFMT_A32B32G32R32F; - break; - case 3: - nFormat = D3DFMT_A16B16G16R16F; - break; - default: - nFormat = D3DFMT_A8R8G8B8; - } - - if (bUsePS14) { - nFormat = D3DFMT_A8R8G8B8; - } - - if (FAILED(pD3DDevice->CreateTexture(1024, 1, 1, D3DUSAGE_RENDERTARGET, nFormat, D3DPOOL_DEFAULT, &pEffectTexture, NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create effects texture.\n")); -#endif - return 1; - } -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Allocated a %i x %i (%s) LUT texture.\n"), 1024, 1, TextureFormatString(nFormat)); -#endif - } - - if ((DX9_FILTER == 1 && bVidScanlines) || (DX9_FILTER == 2 && (bUsePS14 || DX9_SHADERPRECISION >= 2 || bVidScanlines))) { - if (nVidFullscreen) { - nIntermediateTextureWidth = GetTextureSize(nRotateGame ? nVidScrnHeight : nVidScrnWidth); - } else { - nIntermediateTextureWidth = GetTextureSize(nRotateGame ? SystemWorkArea.bottom - SystemWorkArea.top : SystemWorkArea.right - SystemWorkArea.left); - } - nIntermediateTextureHeight = nTextureHeight; - - nFormat = D3DFMT_A8R8G8B8; - if ((DX9_FILTER == 2) && !bUsePS14 && DX9_USE_FPTEXTURE) { -#if 0 - if ((DX9_SHADERPRECISION == 0 || DX9_SHADERPRECISION == 2) && !bVidScanlines) { - nFormat = D3DFMT_A32B32G32R32F; - } else { - nFormat = D3DFMT_A16B16G16R16F; - } -#else - nFormat = D3DFMT_A16B16G16R16F; -#endif - } - - if (FAILED(pD3DDevice->CreateTexture(nIntermediateTextureWidth, nIntermediateTextureHeight, 1, D3DUSAGE_RENDERTARGET, nFormat, D3DPOOL_DEFAULT, &pIntermediateTexture, NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create intermediate texture.\n")); -#endif - return 1; - } -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Allocated a %i x %i (%s) intermediate texture.\n"), nIntermediateTextureWidth, nIntermediateTextureHeight, TextureFormatString(nFormat)); -#endif - } - - { - // Clear textures and set border colour - - IDirect3DSurface9* pSurf; - - pTexture->GetSurfaceLevel(0, &pSurf); - pD3DDevice->ColorFill(pSurf, 0, D3DCOLOR_XRGB(0, 0, 0)); - RELEASE(pSurf); - - if (pIntermediateTexture) { - pIntermediateTexture->GetSurfaceLevel(0, &pSurf); - pD3DDevice->ColorFill(pSurf, 0, D3DCOLOR_XRGB(0, 0, 0)); - RELEASE(pSurf); - } - - pD3DDevice->SetSamplerState(0, D3DSAMP_BORDERCOLOR, D3DCOLOR_XRGB(0, 0, 0)); - pD3DDevice->SetSamplerState(1, D3DSAMP_BORDERCOLOR, D3DCOLOR_XRGB(0, 0, 0)); - } - - // Allocate scanline textures - for (int i = 0, nSize = 2; i < 2; i++, nSize <<= 1) { - RECT rect = { 0, 0, nSize, nSize }; - IDirect3DSurface9* pSurf = NULL; - - unsigned int scan2x2[] = { 0xFFFFFF, 0xFFFFFF, - 0x000000, 0x000000 }; - - unsigned int scan4x4[] = { 0x9F9F9F, 0x9F9F9F, 0x9F9F9F, 0x9F9F9F, - 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, - 0x9F9F9F, 0x9F9F9F, 0x9F9F9F, 0x9F9F9F, - 0x000000, 0x000000, 0x000000, 0x000000 }; - - unsigned int* scandata[] = { scan2x2, scan4x4 }; - - if (FAILED(pD3DDevice->CreateTexture(nSize, nSize, 1, D3DUSAGE_DYNAMIC, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &(pScanlineTexture[i]), NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create texture.\n")); -#endif - return 1; - } - if (FAILED(pScanlineTexture[i]->GetSurfaceLevel(0, &pSurf))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't get texture surface.\n")); -#endif - } - - if (FAILED(_D3DXLoadSurfaceFromMemory(pSurf, NULL, &rect, scandata[i], D3DFMT_X8R8G8B8, nSize * sizeof(int), NULL, &rect, D3DX_FILTER_NONE, 0))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: D3DXLoadSurfaceFromMemory failed.\n")); -#endif - } - - RELEASE(pSurf); - } - - return 0; -} - -int dx9GeometryInit() -{ - for (int y = 0; y < RENDER_STRIPS; y++) { - - D3DLVERTEX2 vScreen[4]; - - // The polygons for the emulator image on the screen - { - int nWidth = pIntermediateTexture ? nImageWidth : nGameImageWidth; - int nHeight = nGameImageHeight; - int nTexWidth = pIntermediateTexture ? nIntermediateTextureWidth : nTextureWidth; - int nTexHeight = nTextureHeight; - - // Add 0.0000001 to ensure consistent rounding - double dTexCoordXl = 0.0000001; - double dTexCoordXr = (double)nWidth / (double)nTexWidth + 0.0000001; - double dTexCoordYt = (double)nHeight * (double)(y + 0) / (double)(nTexHeight * RENDER_STRIPS) + 0.0000001; - double dTexCoordYb = (double)nHeight * (double)(y + 1) / (double)(nTexHeight * RENDER_STRIPS) + 0.0000001; - - double dLeft = 1.0 - 2.0; - double dRight = 1.0 - 0.0; - double dTop = 1.0 - (((double)((nRotateGame & 1) ? (RENDER_STRIPS - y - 0) : (y + 0))) * 2.0 / RENDER_STRIPS); - double dBottom = 1.0 - (((double)((nRotateGame & 1) ? (RENDER_STRIPS - y - 1) : (y + 1))) * 2.0 / RENDER_STRIPS); - - // ugly fix for flipped game, modified by regret - if ((nRotateGame & 1) && (nRotateGame & 2)) { - dTop = 1.0 - (((double)(y + 0)) * 2.0 / RENDER_STRIPS); - dBottom = 1.0 - (((double)(y + 1)) * 2.0 / RENDER_STRIPS); - } - else if (nRotateGame & 2) { - dTop = 1.0 - (((double)(RENDER_STRIPS - y - 0)) * 2.0 / RENDER_STRIPS); - dBottom = 1.0 - (((double)(RENDER_STRIPS - y - 1)) * 2.0 / RENDER_STRIPS); - } - - if (pIntermediateTexture && bVidScanlines) { - dTexCoordXl += 0.5 / (double)nIntermediateTextureWidth; - dTexCoordXr += 0.5 / (double)nIntermediateTextureWidth; - dTexCoordYt += 1.0 / (double)nIntermediateTextureHeight; - dTexCoordYb += 1.0 / (double)nIntermediateTextureHeight; - } - -#if 0 - if (nPreScaleEffect) { - if (nPreScale & 1) { - nWidth *= nPreScaleZoom; - nTexWidth = nPreScaleTextureWidth; - } - if (nPreScale & 2) { - nHeight *= nPreScaleZoom; - nTexHeight = nPreScaleTextureHeight; - } - } -#endif - - // Set up the vertices for the game image, including the texture coordinates for the game image only - // ugly fix for flipped game, modified by regret - if (nRotateGame & 1) { - vScreen[(nRotateGame & 2) ? 3 : 0] = D3DLVERTEX2(dTop, dLeft, 0.0, 0xFFFFFFFF, 0, (nRotateGame & 2) ? dTexCoordXr : dTexCoordXl, dTexCoordYt, 0, 0); - vScreen[(nRotateGame & 2) ? 2 : 1] = D3DLVERTEX2(dTop, dRight, 0.0, 0xFFFFFFFF, 0, (nRotateGame & 2) ? dTexCoordXl : dTexCoordXr, dTexCoordYt, 0, 0); - vScreen[(nRotateGame & 2) ? 1 : 2] = D3DLVERTEX2(dBottom, dLeft, 0.0, 0xFFFFFFFF, 0, (nRotateGame & 2) ? dTexCoordXr : dTexCoordXl, dTexCoordYb, 0, 0); - vScreen[(nRotateGame & 2) ? 0 : 3] = D3DLVERTEX2(dBottom, dRight, 0.0, 0xFFFFFFFF, 0, (nRotateGame & 2) ? dTexCoordXl : dTexCoordXr, dTexCoordYb, 0, 0); - } else { - vScreen[(nRotateGame & 2) ? 3 : 0] = D3DLVERTEX2(dLeft, dTop, 0.0, 0xFFFFFFFF, 0, (nRotateGame & 2) ? dTexCoordXr : dTexCoordXl, dTexCoordYt, 0, 0); - vScreen[(nRotateGame & 2) ? 2 : 1] = D3DLVERTEX2(dRight, dTop, 0.0, 0xFFFFFFFF, 0, (nRotateGame & 2) ? dTexCoordXl : dTexCoordXr, dTexCoordYt, 0, 0); - vScreen[(nRotateGame & 2) ? 1 : 2] = D3DLVERTEX2(dLeft, dBottom, 0.0, 0xFFFFFFFF, 0, (nRotateGame & 2) ? dTexCoordXr : dTexCoordXl, dTexCoordYb, 0, 0); - vScreen[(nRotateGame & 2) ? 0 : 3] = D3DLVERTEX2(dRight, dBottom, 0.0, 0xFFFFFFFF, 0, (nRotateGame & 2) ? dTexCoordXl : dTexCoordXr, dTexCoordYb, 0, 0); - } - - { - // Set up the 2nd pair of texture coordinates, used for scanlines or the high performance version of the cubic filter - - double dScanOffset = nGameImageHeight / -2.0; - - if (bVidScanlines) { - int s, z = nImageHeight / nGameImageHeight; - - for (s = 2; s < z; s <<= 1) { } - dScanOffset += 0.5 / s; - } else { - dScanOffset += 0.5; - } - - // Set the texture coordinates for the scanlines - if (nRotateGame & 1) { - vScreen[nRotateGame & 2 ? 3 : 0].tu1 = dScanOffset + 0.0; vScreen[nRotateGame & 2 ? 3 : 0].tv1 = dScanOffset + 0.0 + 0.0000001; - vScreen[nRotateGame & 2 ? 2 : 1].tu1 = dScanOffset + (double)nGameHeight; vScreen[nRotateGame & 2 ? 2 : 1].tv1 = dScanOffset + 0.0 + 0.0000001; - vScreen[nRotateGame & 2 ? 1 : 2].tu1 = dScanOffset + 0.0; vScreen[nRotateGame & 2 ? 1 : 2].tv1 = dScanOffset + (double)nGameWidth / RENDER_STRIPS + 0.0000001; - vScreen[nRotateGame & 2 ? 0 : 3].tu1 = dScanOffset + (double)nGameHeight; vScreen[nRotateGame & 2 ? 0 : 3].tv1 = dScanOffset + (double)nGameWidth / RENDER_STRIPS + 0.0000001; - } else { - vScreen[nRotateGame & 2 ? 3 : 0].tu1 = dScanOffset + 0.0; vScreen[nRotateGame & 2 ? 3 : 0].tv1 = dScanOffset + 0.0 + 0.0000001; - vScreen[nRotateGame & 2 ? 2 : 1].tu1 = dScanOffset + (double)nGameWidth; vScreen[nRotateGame & 2 ? 2 : 1].tv1 = dScanOffset + 0.0 + 0.0000001; - vScreen[nRotateGame & 2 ? 1 : 2].tu1 = dScanOffset + 0.0; vScreen[nRotateGame & 2 ? 1 : 2].tv1 = dScanOffset + (double)nGameHeight / RENDER_STRIPS + 0.0000001; - vScreen[nRotateGame & 2 ? 0 : 3].tu1 = dScanOffset + (double)nGameWidth; vScreen[nRotateGame & 2 ? 0 : 3].tv1 = dScanOffset + (double)nGameHeight / RENDER_STRIPS + 0.0000001; - } - } - } - - { - D3DLVERTEX2* pVertexData; - - if (FAILED(pVB[y]->Lock(0, 4 * sizeof(D3DLVERTEX2), (void**)&pVertexData, 0))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create vertex buffer.\n")); -#endif - return 1; - } - memcpy(pVertexData, &vScreen, 4 * sizeof(D3DLVERTEX2)); - pVB[y]->Unlock(); - } - } - - if (bVidScanlines) { - pEffect->SetTexture("scanTexture", pScanlineTexture[(nImageHeight / nGameImageHeight >= 4) ? 1 : 0]); - } - - if (pIntermediateTexture) { - D3DLVERTEX2* pVertexData; - D3DLVERTEX2 vTemp[4]; - - double dTexCoordXl = 0.0; - double dTexCoordXr = (double)nGameImageWidth / (double)nTextureWidth; - double dTexCoordYt = 0.0 + 0.0000001; - double dTexCoordYb = 1.0 + 0.0000001; - - if (DX9_FILTER == 1) { - dTexCoordYt -= 0.5 / nTextureHeight; - dTexCoordYb -= 0.5 / nTextureHeight; - } - - vTemp[0] = D3DLVERTEX2(-1.0, 1.0, 0.0, 0xFFFFFFFF, 0, dTexCoordXl, dTexCoordYt, 0.5 , 0.5); - vTemp[1] = D3DLVERTEX2( 1.0, 1.0, 0.0, 0xFFFFFFFF, 0, dTexCoordXr, dTexCoordYt, 0.5 + nGameImageWidth, 0.5); - vTemp[2] = D3DLVERTEX2(-1.0, -1.0, 0.0, 0xFFFFFFFF, 0, dTexCoordXl, dTexCoordYb, 0.5, 0.5 + nGameImageHeight); - vTemp[3] = D3DLVERTEX2( 1.0, -1.0, 0.0, 0xFFFFFFFF, 0, dTexCoordXr, dTexCoordYb, 0.5 + nGameImageWidth, 0.5 + nGameImageHeight); - - if (FAILED(pIntermediateVB->Lock(0, 4 * sizeof(D3DLVERTEX2), (void**)&pVertexData, 0))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create vertex buffer.\n")); -#endif - return 1; - } - - memcpy(pVertexData, &vTemp, 4 * sizeof(D3DLVERTEX2)); - pIntermediateVB->Unlock(); - } - - return 0; -} - -int dx9EffectInit() -{ -// Set up the bicubic filter - -// char szB[MAX_PATH] = "(1.0)"; -// char szC[MAX_PATH] = "(0.0)"; -// D3DXMACRO d3dxm[] = {{ "USE_BC_MACRO", "1", }, { "B", szB, }, { "C", szC, }, { NULL, NULL, }}; - - char* pszTechniqueOpt[] = { "ScanBilinear", "Bilinear", "ScanPoint", "Point" }; - char* pszTechnique = NULL; - - ID3DXBuffer* pErrorBuffer = NULL; - FLOAT pFloatArray[2]; - - pEffect = NULL; - pEffectShader = NULL; - - _D3DXCreateBuffer(0x10000, &pErrorBuffer); - -#ifdef LOAD_EFFECT_FROM_FILE - if (FAILED(_D3DXCreateEffectFromFile(pD3DDevice, _T("bicubic.fx"), NULL /* d3dxm */, NULL, D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY, NULL, &pEffect, &pErrorBuffer))) { -#else - if (FAILED(_D3DXCreateEffectFromResource(pD3DDevice, NULL, MAKEINTRESOURCE(ID_DX9EFFECT), NULL /* d3dxm */, NULL, D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY, NULL, &pEffect, &pErrorBuffer))) { -#endif -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't compile effect.\n")); - dprintf(_T("\n%hs\n\n"), pErrorBuffer->GetBufferPointer()); -#endif - goto HANDLE_ERROR; - } - - // Check if we need to use PS1.4 (instead of 2.0) - bUsePS14 = !DX9_USE_PS20; - if (pEffect->GetTechniqueByName("SinglePassHQBicubic") == NULL) { - bUsePS14 = true; - } - - if (dx9EffectSurfaceInit()) { - goto HANDLE_ERROR; - } - - switch (DX9_FILTER) { - case 1: { - pszTechnique = bVidScanlines ? pszTechniqueOpt[0] : pszTechniqueOpt[1]; - break; - } - case 2: { - if (bVidScanlines) { - char* pszFunction[8] = { "ScanHQBicubic", "ScanBicubic", "ScanHQBicubic", "ScanBicubic", "ScanHP20Bicubic", "ScanHP14Bicubic", "ScanHP14Bicubic", "ScanHP14Bicubic" }; - pszTechnique = pszFunction[bUsePS14 ? 7 : DX9_SHADERPRECISION]; - } else { - char* pszFunction[8] = { "SinglePassHQBicubic", "SinglePassBicubic", "MultiPassHQBicubic", "MultiPassBicubic", "MultiPassHP20Bicubic", "MultiPassHP14Bicubic", "MultiPassHP14Bicubic", "MultiPassHP14Bicubic" }; - pszTechnique = pszFunction[bUsePS14 ? 7 : DX9_SHADERPRECISION]; - } - break; - } - default: { - pszTechnique = bVidScanlines ? pszTechniqueOpt[2] : pszTechniqueOpt[3]; - break; - } - } - - pEffect->SetTexture("imageTexture", pTexture); - pEffect->SetTexture("intermediateTexture", pIntermediateTexture); - pEffect->SetTexture("scanTexture", pScanlineTexture[(nImageHeight / nGameImageHeight >= 4) ? 1 : 0]); - - pFloatArray[0] = nTextureWidth; pFloatArray[1] = nTextureHeight; - pEffect->SetFloatArray("imageSize", pFloatArray, 2); - pFloatArray[0] = 1.0 / nTextureWidth; pFloatArray[1] = 1.0 / nTextureHeight; - pEffect->SetFloatArray("texelSize", pFloatArray, 2); - -/* - { - FLOAT fScanIntensity[4] = { (float)((nVidScanIntensity >> 16) & 255) / 255.0, - (float)((nVidScanIntensity >> 8) & 255) / 255.0, - (float)((nVidScanIntensity >> 0) & 255) / 255.0, - (float)((nVidScanIntensity >> 24) & 255) / 255.0 }; - - pEffect->SetFloatArray("scanIntensity", fScanIntensity, 4); - } -*/ - hTechnique = pEffect->GetTechniqueByName(pszTechnique); - if (FAILED(pEffect->SetTechnique(hTechnique))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't set technique.\n")); -#endif - goto HANDLE_ERROR; - } - - pEffect->SetTexture("weightTex", pEffectTexture); - - { - ID3DXBuffer* pEffectShaderBuffer = NULL; - _D3DXCreateBuffer(0x10000, &pEffectShaderBuffer); - -#ifdef LOAD_EFFECT_FROM_FILE - if (FAILED(_D3DXCompileShaderFromFile(_T("bicubic.fx"), NULL, NULL, (DX9_SHADERPRECISION < 4 && !bUsePS14) ? "genWeightTex20" : "genWeightTex14", "tx_1_0", 0, &pEffectShaderBuffer, &pErrorBuffer, NULL))) { -#else - if (FAILED(_D3DXCompileShaderFromResource(NULL, MAKEINTRESOURCE(ID_DX9EFFECT), NULL, NULL, (DX9_SHADERPRECISION < 4 && !bUsePS14) ? "genWeightTex20" : "genWeightTex14", "tx_1_0", 0, &pEffectShaderBuffer, &pErrorBuffer, NULL))) { -#endif -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't compile shader.\n")); - dprintf(_T("\n%hs\n\n"), pErrorBuffer->GetBufferPointer()); -#endif - goto HANDLE_ERROR; - } - - if (FAILED(_D3DXCreateTextureShader((DWORD*)(pEffectShaderBuffer->GetBufferPointer()), &pEffectShader))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create texture shader.\n")); -#endif - RELEASE(pEffectShaderBuffer); - - goto HANDLE_ERROR; - } - - FillEffectTexture(); - - RELEASE(pEffectShaderBuffer); - } - - RELEASE(pErrorBuffer); - - return 0; - -HANDLE_ERROR: - - RELEASE(pErrorBuffer); - - return 1; -} - -// ==> osd for dx9 video output (ugly), added by regret -static int dx9CreateFont() -{ - if (pFont) { - return 0; - } - - HRESULT hr = _D3DXCreateFont(pD3DDevice, d3dpp.BackBufferHeight / 18, - 0, FW_DEMIBOLD, 1, FALSE, - DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, - DEFAULT_PITCH || FF_DONTCARE, - _T("Arial"), &pFont); - - if (FAILED(hr)) { - return 1; - } - return 0; -} - -static void dx9DrawText() -{ - if (nVidSDisplayStatus == 0 || nOSDTimer == 0) { - return; - } - - if (nFramesEmulated > nOSDTimer) { - VidSKillShortMsg(); - VidSKillOSDMsg(); - } - - RECT osdRect; - if (nVidFullscreen) { - osdRect.left = Dest.left; - osdRect.top = Dest.top; - osdRect.right = Dest.right - 1; - osdRect.bottom = Dest.bottom - 1; - } else { - osdRect.left = 0; - osdRect.top = 0; - osdRect.right = Dest.right - Dest.left - 1; - osdRect.bottom = Dest.bottom - Dest.top - 1; - } - - pFont->DrawText(NULL, OSDMsg, -1, &osdRect, DT_RIGHT | DT_TOP, osdColor); -} -// <== osd for dx9 video output (ugly) - -static int dx9Init() -{ - if (nVidFullscreen && !hScrnWnd) { - return 1; - } - -#ifdef ENABLE_PROFILING - ProfileInit(); -#endif - -#ifdef PRINT_DEBUG_INFO - dprintf(_T("*** Initialising Direct3D 9 blitter.\n")); -#endif - - hVidWnd = hScrnWnd; // Use Screen window for video - - // Get pointer to Direct3D - if ((pD3D = _Direct3DCreate9(D3D_SDK_VERSION)) == NULL) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't initialise Direct3D.\n")); -#endif - dx9Exit(); - return 1; - } - - nRotateGame = 0; - if (bDrvOkay) { - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if (nVidRotationAdjust & 1) { - nRotateGame |= (nVidRotationAdjust & 2); - } else { - nRotateGame |= 1; - } - } - - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - nRotateGame ^= 2; - } - } - - nD3DAdapter = D3DADAPTER_DEFAULT; - if (nRotateGame & 1 && VerScreen[0]) { - nD3DAdapter = dx9GetAdapter(VerScreen); - } else { - if (HorScreen[0]) { - nD3DAdapter = dx9GetAdapter(HorScreen); - } - } - - memset(&d3dpp, 0, sizeof(d3dpp)); - if (nVidFullscreen) { - VidSDisplayScoreInfo ScoreInfo; - if (dx9SelectFullscreenMode(&ScoreInfo)) { - dx9Exit(); -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't determine display mode.\n")); -#endif - return 1; - } - - d3dpp.BackBufferWidth = ScoreInfo.nBestWidth; - d3dpp.BackBufferHeight = ScoreInfo.nBestHeight; - d3dpp.BackBufferFormat = (nVidDepth == 16) ? D3DFMT_R5G6B5 : D3DFMT_X8R8G8B8; - d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP; - d3dpp.BackBufferCount = bVidTripleBuffer ? 2 : 1; - d3dpp.hDeviceWindow = hVidWnd; - d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - } else { - d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; - d3dpp.SwapEffect = D3DSWAPEFFECT_COPY; - d3dpp.hDeviceWindow = hVidWnd; - d3dpp.Windowed = TRUE; - d3dpp.PresentationInterval = bVidVSync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; - } - - DWORD dwBehaviorFlags = bVidVSync ? (D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED) : (D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE); -#ifdef _DEBUG - dwBehaviorFlags |= D3DCREATE_DISABLE_DRIVER_MANAGEMENT; -#endif - - if (FAILED(pD3D->CreateDevice(nD3DAdapter, D3DDEVTYPE_HAL, hVidWnd, dwBehaviorFlags, &d3dpp, &pD3DDevice))) { -// if (FAILED(pD3D->CreateDevice(pD3D->GetAdapterCount() - 1, D3DDEVTYPE_REF, hVidWnd, dwBehaviorFlags, &d3dpp, &pD3DDevice))) { - -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create Direct3D device.\n")); -#endif - - if (nVidFullscreen) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_FULL_PROBLEM)); - if (bVidArcaderes && (d3dpp.BackBufferWidth != 320 && d3dpp.BackBufferHeight != 240)) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_FULL_CUSTRES)); - } - FBAPopupDisplay(PUF_TYPE_ERROR); - } - - dx9Exit(); - return 1; - } - - { - D3DDISPLAYMODE dm; - pD3D->GetAdapterDisplayMode(nD3DAdapter, &dm); - nVidScrnWidth = dm.Width; nVidScrnHeight = dm.Height; - nVidScrnDepth = (dm.Format == D3DFMT_R5G6B5) ? 16 : 32; - } - - nGameWidth = nVidImageWidth; nGameHeight = nVidImageHeight; - - nRotateGame = 0; - if (bDrvOkay) { - // Get the game screen size - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if (nVidRotationAdjust & 1) { - int n = nGameWidth; - nGameWidth = nGameHeight; - nGameHeight = n; - nRotateGame |= (nVidRotationAdjust & 2); - } else { - nRotateGame |= 1; - } - } - - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - nRotateGame ^= 2; - } - } - -// VidSSetupGamma(BlitFXPrim); - - // Initialize the buffer surfaces - if (dx9SurfaceInit()) { - dx9Exit(); - return 1; - } - if (dx9EffectInit()) { - dx9Exit(); - return 1; - } - - for (int y = 0; y < RENDER_STRIPS; y++) { - if (FAILED(pD3DDevice->CreateVertexBuffer(4 * sizeof(D3DLVERTEX2), D3DUSAGE_WRITEONLY, D3DFVF_LVERTEX2, D3DPOOL_DEFAULT, &pVB[y], NULL))) { - dx9Exit(); - return 1; - } - } - if (FAILED(pD3DDevice->CreateVertexBuffer(4 * sizeof(D3DLVERTEX2), D3DUSAGE_WRITEONLY, D3DFVF_LVERTEX2, D3DPOOL_DEFAULT, &pIntermediateVB, NULL))) { - dx9Exit(); - return 1; - } - - nImageWidth = 0; nImageHeight = 0; - - dPrevCubicB = dPrevCubicC = -999; - - pD3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE); - pD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); - pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); - - // Clear the swapchain's buffers - if (nVidFullscreen) { - for (int i = 0; i < 3; i++) { - pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); - pD3DDevice->Present(NULL, NULL, NULL, NULL); - } - } else { - RECT rect; - - GetClientScreenRect(hVidWnd, &rect); - rect.top += nMenuHeight; rect.bottom += nMenuHeight; - pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); - pD3DDevice->Present(&rect, &rect, NULL, NULL); - } - - // Create osd font - dx9CreateFont(); - -#ifdef PRINT_DEBUG_INFO - { - dprintf(_T(" * Initialisation complete: %.2lfMB texture memory free (total).\n"), (double)pD3DDevice->GetAvailableTextureMem() / (1024 * 1024)); - dprintf(_T(" Displaying and rendering in %i-bit mode, emulation running in %i-bit mode.\n"), nVidScrnDepth, nVidImageDepth); - if (nVidFullscreen) { - dprintf(_T(" Running in fullscreen mode (%i x %i), "), nVidScrnWidth, nVidScrnHeight); - dprintf(_T("using a %s buffer.\n"), bVidTripleBuffer ? _T("triple") : _T("double")); - } else { - dprintf(_T(" Running in windowed mode, using D3DSWAPEFFECT_COPY to present the image.\n")); - } - } -#endif - - return 0; -} - -static int dx9Reset() -{ -#ifdef PRINT_DEBUG_INFO - dprintf(_T("*** Resestting Direct3D device.\n")); -#endif - - if (pFont) { - pFont->OnLostDevice(); - } - - dx9ReleaseResources(); - - if (FAILED(pD3DDevice->Reset(&d3dpp))) { - return 1; - } - - if (pFont) { - pFont->OnResetDevice(); - } - - dx9SurfaceInit(); - dx9EffectInit(); - - for (int y = 0; y < RENDER_STRIPS; y++) { - pD3DDevice->CreateVertexBuffer(4 * sizeof(D3DLVERTEX2), D3DUSAGE_WRITEONLY, D3DFVF_LVERTEX2, D3DPOOL_DEFAULT, &pVB[y], NULL); - } - pD3DDevice->CreateVertexBuffer(4 * sizeof(D3DLVERTEX2), D3DUSAGE_WRITEONLY, D3DFVF_LVERTEX2, D3DPOOL_DEFAULT, &pIntermediateVB, NULL); - - pD3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE); - pD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); - pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); - - nImageWidth = 0; nImageHeight = 0; - - dPrevCubicB = dPrevCubicC = -999; - - return 0; -} - -static int dx9Scale(RECT* pRect, int nWidth, int nHeight) -{ - return VidSScaleImage(pRect, nWidth, nHeight, bVidScanRotate); -} - -// Copy BlitFXsMem to pddsBlitFX -static int dx9MemToSurf() -{ - GetClientRect(hVidWnd, &Dest); - - if (nVidFullscreen == 0) { - Dest.top += nMenuHeight; - } - - if (bVidArcaderes && nVidFullscreen) { - Dest.left = (Dest.right + Dest.left) / 2; - Dest.left -= nGameWidth / 2; - Dest.right = Dest.left + nGameWidth; - - Dest.top = (Dest.top + Dest.bottom) / 2; - Dest.top -= nGameHeight / 2; - Dest.bottom = Dest.top + nGameHeight; - } else { - dx9Scale(&Dest, nGameWidth, nGameHeight); - } - - { - int nNewImageWidth = nRotateGame ? (Dest.bottom - Dest.top) : (Dest.right - Dest.left); - int nNewImageHeight = nRotateGame ? (Dest.right - Dest.left) : (Dest.bottom - Dest.top); - - if (nImageWidth != nNewImageWidth || nImageHeight != nNewImageHeight) { - nImageWidth = nNewImageWidth; - nImageHeight = nNewImageHeight; - dx9GeometryInit(); - } - } - - { - if (dPrevCubicB != dVidCubicB || dPrevCubicC != dVidCubicC) { - dPrevCubicB = dVidCubicB; - dPrevCubicC = dVidCubicC; - FillEffectTexture(); - } - } - - { - // Copy the game image to a surface in video memory - - D3DLOCKED_RECT lr; - - if (FAILED(pSurface->LockRect(&lr, NULL, 0))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't lock surface.\n")); -#endif - return 1; - } - - unsigned char* ps = pVidImage + nVidImageLeft * nVidImageBPP; - unsigned char* pd = (unsigned char*)lr.pBits; - int p = lr.Pitch; - int s = nVidImageWidth * nVidImageBPP; - - for (int y = 0; y < nVidImageHeight; y++, pd += p, ps += nVidImagePitch) { - memcpy(pd, ps, s); - } - - pSurface->UnlockRect(); - } - - { - // Copy the game image onto a texture for rendering - - RECT rect = { 0, 0, nVidImageWidth, nVidImageHeight }; - IDirect3DSurface9* pDest; - - if (FAILED(pTexture->GetSurfaceLevel(0, &pDest))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't get texture surface.\n")); - return 1; -#endif - } - - if (FAILED(pD3DDevice->StretchRect(pSurface, &rect, pDest, &rect, D3DTEXF_NONE))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't copy image.\n")); -#endif - } - - pDest->Release(); - } - -#ifdef ENABLE_PROFILING - { - // Force the D3D pipeline to be flushed - - D3DLVERTEX2* pVertexData; - - if (SUCCEEDED(pIntermediateVB->Lock(0, 4 * sizeof(D3DLVERTEX2), (void**)&pVertexData, 0))) { - pIntermediateVB->Unlock(); - } - - ProfileProfileStart(2); - } -#endif - - pD3DDevice->SetRenderState(D3DRS_TEXTUREFACTOR, nVidScanIntensity); - - UINT nTotalPasses, nPass = 0; - pEffect->Begin(&nTotalPasses, D3DXFX_DONOTSAVESTATE); - - if (nTotalPasses > 1) { - IDirect3DSurface9* pPreviousTarget; - IDirect3DSurface9* pNewTarget; - D3DVIEWPORT9 vp; - - pD3DDevice->GetRenderTarget(0, &pPreviousTarget); - pIntermediateTexture->GetSurfaceLevel(0, &pNewTarget); - pD3DDevice->SetRenderTarget(0, pNewTarget); - - vp.X = 0; - vp.Y = 0; - vp.Width = nImageWidth; - vp.Height = nTextureHeight; - vp.MinZ = 0.0f; - vp.MaxZ = 1.0f; - - pD3DDevice->SetViewport(&vp); - - pD3DDevice->BeginScene(); - - pD3DDevice->SetFVF(D3DFVF_LVERTEX2); - - pEffect->BeginPass(nPass); - pEffect->CommitChanges(); - - pD3DDevice->SetStreamSource(0, pIntermediateVB, 0, sizeof(D3DLVERTEX2)); - pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); - pEffect->EndPass(); - - pD3DDevice->EndScene(); - - pD3DDevice->SetRenderTarget(0, pPreviousTarget); - - RELEASE(pPreviousTarget); - RELEASE(pNewTarget); - - nPass++; - } - -#if 0 - { - // blit the intermediate texture to the screen - - RECT srect = { 0, 0, Dest.right - Dest.left, 256 }; - RECT drect = { 0, nMenuHeight, Dest.right - Dest.left, nMenuHeight + 256 }; - IDirect3DSurface9* pDest; - IDirect3DSurface9* pSrc; - - pD3DDevice->GetRenderTarget(0, &pDest); - pIntermediateTexture->GetSurfaceLevel(0, &pSrc); - - pD3DDevice->StretchRect(pSrc, &srect, pDest, &drect, D3DTEXF_NONE); - - pSrc->Release(); - pDest->Release(); - - pEffect->End(); - - return 0; - } -#endif - -#ifdef ENABLE_PROFILING - { - // Force the D3D pipeline to be flushed - - D3DLVERTEX2* pVertexData; - - if (SUCCEEDED(pIntermediateVB->Lock(0, 4 * sizeof(D3DLVERTEX2), (void**)&pVertexData, 0))) { - pIntermediateVB->Unlock(); - } - - ProfileProfileEnd(2); - } - ProfileProfileStart(0); -#endif - - { - D3DVIEWPORT9 vp; - - // Set the size of the image on the PC screen - if (nVidFullscreen) { - vp.X = Dest.left; - vp.Y = Dest.top; - vp.Width = Dest.right - Dest.left; - vp.Height = Dest.bottom - Dest.top; - vp.MinZ = 0.0f; - vp.MaxZ = 1.0f; - } else { - vp.X = 0; - vp.Y = 0; - vp.Width = Dest.right - Dest.left; - vp.Height = Dest.bottom - Dest.top; - vp.MinZ = 0.0f; - vp.MaxZ = 1.0f; - } - - pD3DDevice->SetViewport(&vp); - - pD3DDevice->BeginScene(); - - pD3DDevice->SetFVF(D3DFVF_LVERTEX2); - -// pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - - pEffect->BeginPass(nPass); - pEffect->CommitChanges(); - - for (int y = 0; y < RENDER_STRIPS; y++) { - pD3DDevice->SetStreamSource(0, pVB[y], 0, sizeof(D3DLVERTEX2)); - pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); - } - pEffect->EndPass(); - - // draw osd text - dx9DrawText(); - - pD3DDevice->EndScene(); - } - - pEffect->End(); - -#ifdef ENABLE_PROFILING - { - // Force the D3D pipeline to be flushed - - D3DLVERTEX2* pVertexData; - - if (SUCCEEDED(pVB[RENDER_STRIPS - 1]->Lock(0, 4 * sizeof(D3DLVERTEX2), (void**)&pVertexData, 0))) { - pVB[RENDER_STRIPS - 1]->Unlock(); - } - - ProfileProfileEnd(0); - } -#endif - - return 0; -} - -// Run one frame and render the screen -static int dx9Frame(bool bRedraw) // bRedraw = 0 -{ - if (pVidImage == NULL) { - return 1; - } - - HRESULT nCoopLevel = pD3DDevice->TestCooperativeLevel(); - if (nCoopLevel != D3D_OK) { // We've lost control of the screen - if (nCoopLevel != D3DERR_DEVICENOTRESET) { - return 1; - } - - if (dx9Reset()) { - return 1; - } - } - -#ifdef ENABLE_PROFILING -// ProfileProfileStart(0); -#endif - - if (bDrvOkay) { - if (bRedraw) { // Redraw current frame - if (BurnDrvRedraw()) { - BurnDrvFrame(); // No redraw function provided, advance one frame - } - } else { - BurnDrvFrame(); // Run one frame and draw the screen - } - } - -#ifdef ENABLE_PROFILING -// ProfileProfileEnd(0); - ProfileProfileStart(1); -#endif - - dx9MemToSurf(); // Copy the memory buffer to the directdraw buffer for later blitting - -#ifdef ENABLE_PROFILING - ProfileProfileEnd(1); - - dprintf(_T(" blit %3.2lf (effect p1 %3.2lf - effect p2 %3.2lf)\n"), ProfileProfileReadAverage(1), ProfileProfileReadAverage(2), ProfileProfileReadAverage(0)); -#endif - - return 0; -} - -// Paint the BlitFX surface onto the primary surface -static int dx9Paint(int bValidate) -{ - if (pD3DDevice->TestCooperativeLevel()) { // We've lost control of the screen - return 1; - } - - RECT rect = { 0, 0, 0, 0 }; - - if (!nVidFullscreen) { - GetClientScreenRect(hVidWnd, &rect); - rect.top += nMenuHeight; - - dx9Scale(&rect, nGameWidth, nGameHeight); - - if ((rect.right - rect.left) != (Dest.right - Dest.left) || (rect.bottom - rect.top ) != (Dest.bottom - Dest.top)) { - bValidate |= 2; - } - } - - if (bValidate & 2) { - dx9MemToSurf(); // Copy the memory buffer to the directdraw buffer for later blitting - } - - // Display OSD text message -// VidSDisplayOSD(pddsBlitFX[nUseSys], &rect, 0); - - if (nVidFullscreen) { - pD3DDevice->Present(NULL, NULL, NULL, NULL); - } else { - RECT src = { 0, 0, Dest.right - Dest.left, Dest.bottom - Dest.top }; - - POINT c = { 0, 0 }; - ClientToScreen(hVidWnd, &c); - RECT dst = { rect.left - c.x, rect.top - c.y, rect.right - c.x, rect.bottom - c.y }; - - /* - if (bVidVSync) { - D3DRASTER_STATUS rs; - RECT window; - - GetWindowRect(hVidWnd, &window); - - while (1) { - pD3DDevice->GetRasterStatus(0, &rs); - if (rs.InVBlank || rs.ScanLine >= window.bottom) { - break; - } - Sleep(1); - } - } - */ - - pD3DDevice->Present(&src, &dst, NULL, NULL); - - // Validate the rectangle we just drew - if (bValidate & 1) { - ValidateRect(hVidWnd, &dst); - } - } - - return 0; -} - -// ---------------------------------------------------------------------------- - -static int dx9GetSettings(InterfaceInfo* pInfo) -{ - TCHAR szString[MAX_PATH] = _T(""); - - if (nVidFullscreen) { - if (bVidTripleBuffer) { - IntInfoAddStringModule(pInfo, _T("Using a triple buffer")); - } else { - IntInfoAddStringModule(pInfo, _T("Using a double buffer")); - } - } else { - IntInfoAddStringModule(pInfo, _T("Using D3DSWAPEFFECT_COPY to present the image")); - } - switch (DX9_FILTER) { - case 1: { - IntInfoAddStringModule(pInfo, _T("Applying linear filter")); - break; - } - case 2: { - _sntprintf(szString, MAX_PATH, _T("Applying cubic filter using VS1.1 & %s"), bUsePS14 ? _T("PS1.4") : _T("PS2.0")); - IntInfoAddStringModule(pInfo, szString); - - if (bUsePS14) { - IntInfoAddStringModule(pInfo, _T("Using high-performance implementation")); - break; - } - - if (bVidScanlines) { - switch (DX9_SHADERPRECISION) { - case 0: - case 2: - IntInfoAddStringModule(pInfo, _T("Using reference implementation")); - break; - case 1: - case 3: - IntInfoAddStringModule(pInfo, _T("Using partial precision implementation")); - break; - case 4: - IntInfoAddStringModule(pInfo, _T("Using high-performance implementation")); - break; - } - } else { - switch (DX9_SHADERPRECISION) { - case 0: - IntInfoAddStringModule(pInfo, _T("Using single-pass reference implementation")); - break; - case 1: - IntInfoAddStringModule(pInfo, _T("Using partial precision single-pass implementation")); - break; - case 2: - IntInfoAddStringModule(pInfo, _T("Using full precision multi-pass implementation")); - break; - case 3: - IntInfoAddStringModule(pInfo, _T("Using partial precision multi-pass implementation")); - break; - case 4: - IntInfoAddStringModule(pInfo, _T("Using high-performance multi-pass implementation")); - break; - } - } - if (DX9_USE_FPTEXTURE) { - _sntprintf(szString, MAX_PATH, _T("Using floating-point textures where applicable")); - IntInfoAddStringModule(pInfo, szString); - } - break; - } - default: { - IntInfoAddStringModule(pInfo, _T("Applying point filter")); - } - } - if (bVidScanlines) { - _sntprintf(szString, MAX_PATH, _T("Applying scanlines at %.1lf%% brightness"), (double)(nVidScanIntensity & 255) / 2.55); - IntInfoAddStringModule(pInfo, szString); - } - - return 0; -} - -// The Video Output plugin: -struct VidOut VidOutDX9 = { dx9Init, dx9Exit, dx9Frame, dx9Paint, dx9Scale, dx9GetSettings, _T("DirectX9 Experimental video output") }; -//#else -//struct VidOut VidOutDX9 = { NULL, NULL, NULL, NULL, NULL, NULL, _T("DirectX9 Experimental video output") }; -//#endif - - - - - - - - - - - -// Direct3D9 video output -// rewritten by regret (Motion Blur source from VBA-M) - -struct d3dvertex { - float x, y, z, rhw; //screen coords - float u, v; //texture coords -}; - -struct transp_vertex { - float x, y, z, rhw; - D3DCOLOR color; - float u, v; -}; - -#undef D3DFVF_LVERTEX2 -#define D3DFVF_LVERTEX2 (D3DFVF_XYZRHW | D3DFVF_TEX1) - -IDirect3DTexture9* emuTexture[2]; -static unsigned char mbCurrentTexture = 0; // current texture for motion blur -static bool mbTextureEmpty = true; -static d3dvertex vertex[4]; -static transp_vertex transpVertex[4]; - -D3DFORMAT textureFormat; - -static int nPreScale = 0; -static int nPreScaleZoom = 0; -static int nPreScaleEffect = 0; - -// Select optimal full-screen resolution -static int dx9AltSelectFullscreenMode(VidSDisplayScoreInfo* pScoreInfo) -{ - if (bVidArcaderes) { - if (!VidSGetArcaderes((int*)&(pScoreInfo->nBestWidth), (int*)&(pScoreInfo->nBestHeight))) { - return 1; - } - } else { - pScoreInfo->nBestWidth = nVidWidth; - pScoreInfo->nBestHeight = nVidHeight; - } - - if (!bDrvOkay && (pScoreInfo->nBestWidth < 640 || pScoreInfo->nBestHeight < 480)) { - return 1; - } - - return 0; -} - -static void dx9AltReleaseTexture() -{ - RELEASE(pTexture) - RELEASE(emuTexture[0]) - RELEASE(emuTexture[1]) -} - -static int dx9AltExit() -{ - VidSoftFXExit(); - - dx9AltReleaseTexture(); - - VidSFreeVidImage(); - - RELEASE(pFont) - RELEASE(pD3DDevice) - RELEASE(pD3D) - - nRotateGame = 0; - - VidSKillShortMsg(); - VidSKillOSDMsg(); - - return 0; -} - -static int dx9AltResize(int width, int height) -{ - if (FAILED(pD3DDevice->CreateTexture(width, height, 1, 0, textureFormat, D3DPOOL_SYSTEMMEM, &pTexture, NULL))) { - return 1; - } - - if (!emuTexture[0]) { - if (FAILED(pD3DDevice->CreateTexture(width, height, 1, 0, textureFormat, D3DPOOL_DEFAULT, &emuTexture[0], NULL))) { - return 1; - } - } - - if (!emuTexture[1] && bVidMotionBlur) { - if (FAILED(pD3DDevice->CreateTexture(width, height, 1, 0, textureFormat, D3DPOOL_DEFAULT, &emuTexture[1], NULL))) { - return 1; - } - mbTextureEmpty = true; - } - - return 0; -} - -static int dx9AltTextureInit() -{ - if (nRotateGame & 1) { - nVidImageWidth = nGameHeight; - nVidImageHeight = nGameWidth; - } else { - nVidImageWidth = nGameWidth; - nVidImageHeight = nGameHeight; - } - - nGameImageWidth = nVidImageWidth; - nGameImageHeight = nVidImageHeight; - - nVidImageDepth = nVidScrnDepth; - - // Determine if we should use a texture format different from the screen format - if ((bDrvOkay && VidSoftFXCheckDepth(nPreScaleEffect, 32) != 32) || (bDrvOkay && bVidForce16bitDx9Alt)) { - nVidImageDepth = 16; - } - - switch (nVidImageDepth) { - case 32: - textureFormat = D3DFMT_X8R8G8B8; - break; - case 24: - textureFormat = D3DFMT_R8G8B8; - break; - case 16: - textureFormat = D3DFMT_R5G6B5; - break; - case 15: - textureFormat = D3DFMT_X1R5G5B5; - break; - } - - nVidImageBPP = (nVidImageDepth + 7) >> 3; - nBurnBpp = nVidImageBPP; // Set Burn library Bytes per pixel - - // Use our callback to get colors: - SetBurnHighCol(nVidImageDepth); - - // Make the normal memory buffer - if (VidSAllocVidImage()) { - dx9AltExit(); - return 1; - } - - nTextureWidth = GetTextureSize(nGameImageWidth * nPreScaleZoom); - nTextureHeight = GetTextureSize(nGameImageHeight * nPreScaleZoom); - - if (dx9AltResize(nTextureWidth, nTextureHeight)) { - return 1; - } - - return 0; -} - -// Vertex format: -// -// 0---------1 -// | /| -// | / | -// | / | -// | / | -// |/ | -// 2---------3 -// -// (x,y) screen coords, in pixels -// (u,v) texture coords, betweeen 0.0 (top, left) to 1.0 (bottom, right) -static int dx9AltSetVertex(unsigned int px, unsigned int py, unsigned int pw, unsigned int ph, unsigned int tw, unsigned int th, unsigned int x, unsigned int y, unsigned int w, unsigned int h) -{ - // configure triangles - // -0.5f is necessary in order to match texture alignment to display pixels - float diff = -0.5f; - if (nRotateGame & 1) { - if (nRotateGame & 2) { - vertex[2].x = vertex[3].x = (double)(y ) + diff; - vertex[0].x = vertex[1].x = (double)(y + h) + diff; - vertex[1].y = vertex[3].y = (double)(x + w) + diff; - vertex[0].y = vertex[2].y = (double)(x ) + diff; - } else { - vertex[0].x = vertex[1].x = (double)(y ) + diff; - vertex[2].x = vertex[3].x = (double)(y + h) + diff; - vertex[1].y = vertex[3].y = (double)(x ) + diff; - vertex[0].y = vertex[2].y = (double)(x + w) + diff; - } - } else { - if (nRotateGame & 2) { - vertex[1].x = vertex[3].x = (double)(y ) + diff; - vertex[0].x = vertex[2].x = (double)(y + h) + diff; - vertex[2].y = vertex[3].y = (double)(x ) + diff; - vertex[0].y = vertex[1].y = (double)(x + w) + diff; - } else { - vertex[0].x = vertex[2].x = (double)(x ) + diff; - vertex[1].x = vertex[3].x = (double)(x + w) + diff; - vertex[0].y = vertex[1].y = (double)(y ) + diff; - vertex[2].y = vertex[3].y = (double)(y + h) + diff; - } - } - - double rw = (double)w / (double)pw * (double)tw; - double rh = (double)h / (double)ph * (double)th; - vertex[0].u = vertex[2].u = (double)(px ) / rw; - vertex[1].u = vertex[3].u = (double)(px + w) / rw; - vertex[0].v = vertex[1].v = (double)(py ) / rh; - vertex[2].v = vertex[3].v = (double)(py + h) / rh; - - // Z-buffer and RHW are unused for 2D blit, set to normal values - vertex[0].z = vertex[1].z = vertex[2].z = vertex[3].z = 0.0f; - vertex[0].rhw = vertex[1].rhw = vertex[2].rhw = vertex[3].rhw = 1.0f; - - // configure semi-transparent triangles - if (bVidMotionBlur) { - D3DCOLOR semiTrans = D3DCOLOR_ARGB(0x7F, 0xFF, 0xFF, 0xFF); - transpVertex[0].x = vertex[0].x; - transpVertex[0].y = vertex[0].y; - transpVertex[0].z = vertex[0].z; - transpVertex[0].rhw = vertex[0].rhw; - transpVertex[0].color = semiTrans; - transpVertex[0].u = vertex[0].u; - transpVertex[0].v = vertex[0].v; - transpVertex[1].x = vertex[1].x; - transpVertex[1].y = vertex[1].y; - transpVertex[1].z = vertex[1].z; - transpVertex[1].rhw = vertex[1].rhw; - transpVertex[1].color = semiTrans; - transpVertex[1].u = vertex[1].u; - transpVertex[1].v = vertex[1].v; - transpVertex[2].x = vertex[2].x; - transpVertex[2].y = vertex[2].y; - transpVertex[2].z = vertex[2].z; - transpVertex[2].rhw = vertex[2].rhw; - transpVertex[2].color = semiTrans; - transpVertex[2].u = vertex[2].u; - transpVertex[2].v = vertex[2].v; - transpVertex[3].x = vertex[3].x; - transpVertex[3].y = vertex[3].y; - transpVertex[3].z = vertex[3].z; - transpVertex[3].rhw = vertex[3].rhw; - transpVertex[3].color = semiTrans; - transpVertex[3].u = vertex[3].u; - transpVertex[3].v = vertex[3].v; - } - - return 0; -} - -// ==> osd for dx9 video output (ugly), added by regret -static int dx9AltCreateFont() -{ - if (pFont) { - return 0; - } - - HRESULT hr = _D3DXCreateFont(pD3DDevice, d3dpp.BackBufferHeight / 40, 0, FW_NORMAL, 1, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH || FF_DONTCARE, _T("Arial"), &pFont); - - if (FAILED(hr)) { - return 1; - } - - return 0; -} - -static void dx9AltDrawText() -{ - if (!nOSDTimer) { - return; - } - - if (nFramesEmulated > nOSDTimer) { - VidSKillShortMsg(); - VidSKillOSDMsg(); - } - - RECT osdRect; - if (nVidFullscreen) { - osdRect.left = Dest.left; - osdRect.top = Dest.top; - osdRect.right = Dest.right - 1; - osdRect.bottom = Dest.bottom - 1; - } else { - osdRect.left = 0; - osdRect.top = 0; - osdRect.right = Dest.right - Dest.left - 1; - osdRect.bottom = Dest.bottom - Dest.top - 1; - } - - if (nOSDTimer) { - pFont->DrawText(NULL, OSDMsg, -1, &osdRect, DT_RIGHT | DT_TOP, osdColor); - } -} -// <== osd for dx9 video output (ugly) - -static int dx9AltInit() -{ - if (hScrnWnd == NULL) { - return 1; - } - - hVidWnd = hScrnWnd; - - // Get pointer to Direct3D - if ((pD3D = _Direct3DCreate9(D3D_SDK_VERSION)) == NULL) { - dx9AltExit(); - return 1; - } - - nRotateGame = 0; - if (bDrvOkay) { - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if (nVidRotationAdjust & 1) { - nRotateGame |= (nVidRotationAdjust & 2); - } else { - nRotateGame |= 1; - } - } - - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - nRotateGame ^= 2; - } - } - - nD3DAdapter = D3DADAPTER_DEFAULT; - if (nRotateGame & 1 && VerScreen[0]) { - nD3DAdapter = dx9GetAdapter(VerScreen); - } else { - if (HorScreen[0]) { - nD3DAdapter = dx9GetAdapter(HorScreen); - } - } - - // check selected atapter - D3DDISPLAYMODE dm; - pD3D->GetAdapterDisplayMode(nD3DAdapter, &dm); - - memset(&d3dpp, 0, sizeof(d3dpp)); - if (nVidFullscreen) { - VidSDisplayScoreInfo ScoreInfo; - memset(&ScoreInfo, 0, sizeof(VidSDisplayScoreInfo)); - - if (dx9AltSelectFullscreenMode(&ScoreInfo)) { - dx9AltExit(); - return 1; - } - - bool sizefit = true; - if (ScoreInfo.nBestWidth > dm.Width || ScoreInfo.nBestHeight > dm.Height) { - sizefit = false; - } - - d3dpp.BackBufferWidth = sizefit ? ScoreInfo.nBestWidth : dm.Width; - d3dpp.BackBufferHeight = sizefit ? ScoreInfo.nBestHeight : dm.Height; - d3dpp.BackBufferFormat = (nVidDepth == 16) ? D3DFMT_R5G6B5 : D3DFMT_X8R8G8B8; - d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP; - d3dpp.BackBufferCount = bVidTripleBuffer ? 2 : 1; - d3dpp.hDeviceWindow = hVidWnd; - d3dpp.FullScreen_RefreshRateInHz = dm.RefreshRate; - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - } else { - d3dpp.BackBufferWidth = dm.Width; - d3dpp.BackBufferHeight = dm.Height; - d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - d3dpp.BackBufferCount = 1; - d3dpp.hDeviceWindow = hVidWnd; - d3dpp.Windowed = TRUE; - d3dpp.PresentationInterval = bVidVSync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; - } - - DWORD dwBehaviorFlags = D3DCREATE_FPU_PRESERVE; - if (bVidHardwareVertex) { - dwBehaviorFlags |= D3DCREATE_HARDWARE_VERTEXPROCESSING; - } else { - dwBehaviorFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING; - } - - if (FAILED(pD3D->CreateDevice(nD3DAdapter, D3DDEVTYPE_HAL, hVidWnd, dwBehaviorFlags, &d3dpp, &pD3DDevice))) { - if (nVidFullscreen) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_FULL_PROBLEM), d3dpp.BackBufferWidth, d3dpp.BackBufferHeight, d3dpp.BackBufferFormat, d3dpp.FullScreen_RefreshRateInHz); - if (bVidArcaderes && (d3dpp.BackBufferWidth != 320 && d3dpp.BackBufferHeight != 240)) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_FULL_CUSTRES)); - } - FBAPopupDisplay(PUF_TYPE_ERROR); - } - - dx9AltExit(); - return 1; - } - - { - nVidScrnWidth = dm.Width; nVidScrnHeight = dm.Height; - nVidScrnDepth = (dm.Format == D3DFMT_R5G6B5) ? 16 : 32; - } - - nGameWidth = nVidImageWidth; - nGameHeight = nVidImageHeight; - nRotateGame = 0; - - if (bDrvOkay) { - // Get the game screen size - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if (nVidRotationAdjust & 1) { - int n = nGameWidth; - nGameWidth = nGameHeight; - nGameHeight = n; - nRotateGame |= (nVidRotationAdjust & 2); - } else { - nRotateGame |= 1; - } - } - - if (BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED) { - nRotateGame ^= 2; - } - } - - // enable vertex alpha blending - if (bVidMotionBlur) { - pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); - } else { - mbCurrentTexture = 0; - pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); - } - pD3DDevice->SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1); - pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - // apply vertex alpha values to texture - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); - - // for filter - nPreScale = 3; - nPreScaleZoom = 2; - nPreScaleEffect = 0; - if (bDrvOkay) { - nPreScaleEffect = nVidBlitterOpt[nVidSelect] & 0xFF; - nPreScaleZoom = VidSoftFXGetZoom(nPreScaleEffect); - } - - // Initialize the buffer surfaces - if (dx9AltTextureInit()) { - dx9AltExit(); - return 1; - } - - if (nPreScaleEffect) { - if (VidSoftFXInit(nPreScaleEffect, 0)) { - dx9AltExit(); - return 1; - } - } - - pD3DDevice->SetSamplerState(0, D3DSAMP_MINFILTER, bVidDX9Bilinear ? D3DTEXF_LINEAR : D3DTEXF_POINT); - pD3DDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, bVidDX9Bilinear ? D3DTEXF_LINEAR : D3DTEXF_POINT); - - nImageWidth = 0; nImageHeight = 0; - - // Clear the swapchain's buffers - if (nVidFullscreen) { - for (int i = 0; i < 3; i++) { - pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); - pD3DDevice->Present(NULL, NULL, NULL, NULL); - } - } else { - RECT rect; - GetClientScreenRect(hVidWnd, &rect); - - pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); - pD3DDevice->Present(&rect, &rect, NULL, NULL); - } - - // Create osd font - dx9AltCreateFont(); - - return 0; -} - -static int dx9AltReset() -{ - if (pFont) { - pFont->OnLostDevice(); - } - - dx9AltReleaseTexture(); - - if (FAILED(pD3DDevice->Reset(&d3dpp))) { - return 1; - } - - if (pFont) { - pFont->OnResetDevice(); - } - - if (bVidMotionBlur) { - pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); - } else { - mbCurrentTexture = 0; - pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); - } - pD3DDevice->SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1); - pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - // apply vertex alpha values to texture - pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); - - dx9AltTextureInit(); - - nImageWidth = 0; nImageHeight = 0; - - return 0; -} - -static int dx9AltScale(RECT* rect, int width, int height) -{ - if (nVidBlitterOpt[nVidSelect] & 0x0100) { - return VidSoftFXScale(rect, width, height); - } - return VidSScaleImage(rect, width, height, bVidScanRotate); -} - -static void VidSCpyImg32(unsigned char* dst, unsigned int dstPitch, unsigned char *src, unsigned int srcPitch, unsigned short width, unsigned short height) -{ - // fast, iterative C version - // copies an width*height array of visible pixels from src to dst - // srcPitch and dstPitch are the number of garbage bytes after a scanline - register unsigned short lineSize = width << 2; - - while (height--) { - memcpy(dst, src, lineSize); - src += srcPitch; - dst += dstPitch; - } -} - -static void VidSCpyImg16(unsigned char* dst, unsigned int dstPitch, unsigned char *src, unsigned int srcPitch, unsigned short width, unsigned short height) -{ - register unsigned short lineSize = width << 1; - - while (height--) { - memcpy(dst, src, lineSize); - src += srcPitch; - dst += dstPitch; - } -} - -// Copy BlitFXsMem to pddsBlitFX -static int dx9AltRender() -{ - GetClientRect(hVidWnd, &Dest); - - if (bVidArcaderes && nVidFullscreen) { - Dest.left = (Dest.right + Dest.left) / 2; - Dest.left -= nGameWidth / 2; - Dest.right = Dest.left + nGameWidth; - - Dest.top = (Dest.top + Dest.bottom) / 2; - Dest.top -= nGameHeight / 2; - Dest.bottom = Dest.top + nGameHeight; - } else { - dx9AltScale(&Dest, nGameWidth, nGameHeight); - } - - { - int nNewImageWidth = nRotateGame ? (Dest.bottom - Dest.top) : (Dest.right - Dest.left); - int nNewImageHeight = nRotateGame ? (Dest.right - Dest.left) : (Dest.bottom - Dest.top); - - if (nImageWidth != nNewImageWidth || nImageHeight != nNewImageHeight) { - nImageWidth = nNewImageWidth; - nImageHeight = nNewImageHeight; - - int nWidth = nGameImageWidth; - int nHeight = nGameImageHeight; - - if (nPreScaleEffect) { - if (nPreScale & 1) { - nWidth *= nPreScaleZoom; - } - if (nPreScale & 2) { - nHeight *= nPreScaleZoom; - } - } - - if (nVidFullscreen) { - dx9AltSetVertex(0, 0, nWidth, nHeight, nTextureWidth, nTextureHeight, nRotateGame ? Dest.top : Dest.left, nRotateGame ? Dest.left : Dest.top, nImageWidth, nImageHeight); - } else { - dx9AltSetVertex(0, 0, nWidth, nHeight, nTextureWidth, nTextureHeight, 0, 0, nImageWidth, nImageHeight); - } - - D3DVIEWPORT9 vp; - - // Set the size of the image on the PC screen - if (nVidFullscreen) { - vp.X = Dest.left; - vp.Y = Dest.top; - vp.Width = Dest.right - Dest.left; - vp.Height = Dest.bottom - Dest.top; - vp.MinZ = 0.0f; - vp.MaxZ = 1.0f; - } else { - vp.X = 0; - vp.Y = 0; - vp.Width = Dest.right - Dest.left; - vp.Height = Dest.bottom - Dest.top; - vp.MinZ = 0.0f; - vp.MaxZ = 1.0f; - } - - pD3DDevice->SetViewport(&vp); - } - } - - pD3DDevice->BeginScene(); - - { - // Copy the game image onto a texture for rendering - D3DLOCKED_RECT d3dlr; - pTexture->LockRect(0, &d3dlr, 0, 0); - - int pitch = d3dlr.Pitch; - unsigned char* pd = (unsigned char*)d3dlr.pBits; - - if (nPreScaleEffect) { - VidFilterApplyEffect(pd, pitch); - } else { - unsigned char* ps = pVidImage + nVidImageLeft * nVidImageBPP; - int s = nVidImageWidth * nVidImageBPP; - - switch (nVidImageDepth) { - case 32: - VidSCpyImg32(pd, pitch, ps, s, nVidImageWidth, nVidImageHeight); - break; - case 16: - VidSCpyImg16(pd, pitch, ps, s, nVidImageWidth, nVidImageHeight); - break; - } - } - - pTexture->UnlockRect(0); - } - - pD3DDevice->UpdateTexture(pTexture, emuTexture[mbCurrentTexture]); - - if (bVidMotionBlur) { - // Motion Blur enabled - if (!mbTextureEmpty) { - // draw previous frame to the screen - pD3DDevice->SetTexture( 0, emuTexture[mbCurrentTexture ^ 1]); - pD3DDevice->SetFVF(D3DFVF_LVERTEX2); - pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vertex, sizeof(d3dvertex)); - // draw the current frame with transparency to the screen - pD3DDevice->SetTexture(0, emuTexture[mbCurrentTexture]); - pD3DDevice->SetFVF(D3DFVF_LVERTEX2 | D3DFVF_DIFFUSE); - pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, transpVertex, sizeof(transp_vertex)); - } else { - mbTextureEmpty = false; - // draw the current frame to the screen - pD3DDevice->SetTexture(0, emuTexture[ mbCurrentTexture]); - pD3DDevice->SetFVF(D3DFVF_LVERTEX2); - pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vertex, sizeof(d3dvertex)); - } - mbCurrentTexture ^= 1; // switch current texture - } else { - // draw the current frame to the screen - pD3DDevice->SetTexture( 0, emuTexture[mbCurrentTexture] ); - pD3DDevice->SetFVF(D3DFVF_LVERTEX2); - pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vertex, sizeof(d3dvertex)); - } - - // draw osd text - dx9AltDrawText(); - - pD3DDevice->EndScene(); - - return 0; -} - -// Run one frame and render the screen -static int dx9AltFrame(bool bRedraw) // bRedraw = 0 -{ - if (pVidImage == NULL) { - return 1; - } - - HRESULT nCoopLevel = pD3DDevice->TestCooperativeLevel(); - if (nCoopLevel != D3D_OK) { // We've lost control of the screen - if (nCoopLevel != D3DERR_DEVICENOTRESET) { - return 1; - } - - if (dx9AltReset()) { - return 1; - } - } - - if (bDrvOkay) { - if (bRedraw) { // Redraw current frame - if (BurnDrvRedraw()) { - BurnDrvFrame(); // No redraw function provided, advance one frame - } - } else { - BurnDrvFrame(); // Run one frame and draw the screen - } - } - - dx9AltRender(); - - return 0; -} - -// Paint the BlitFX surface onto the primary surface -static int dx9AltPaint(int bValidate) -{ - if (pD3DDevice->TestCooperativeLevel()) { // We've lost control of the screen - return 1; - } - - RECT rect = { 0, 0, 0, 0 }; - - if (!nVidFullscreen) { - GetClientScreenRect(hVidWnd, &rect); - rect.top += nMenuHeight; - - dx9AltScale(&rect, nGameWidth, nGameHeight); - - if ((rect.right - rect.left) != (Dest.right - Dest.left) || (rect.bottom - rect.top ) != (Dest.bottom - Dest.top)) { - bValidate |= 2; - } - } - - if (bValidate & 2) { - dx9AltRender(); - } - - if (nVidFullscreen) { - pD3DDevice->Present(NULL, NULL, NULL, NULL); - } else { - RECT src = { 0, 0, Dest.right - Dest.left, Dest.bottom - Dest.top }; - POINT c = { 0, 0 }; - ClientToScreen(hVidWnd, &c); - RECT dst = { rect.left - c.x, rect.top - c.y, rect.right - c.x, rect.bottom - c.y }; - - pD3DDevice->Present(&src, &dst, NULL, NULL); - - // Validate the rectangle we just drew - if (bValidate & 1) { - ValidateRect(hVidWnd, &dst); - } - } - - return 0; -} - -static int dx9AltGetSettings(InterfaceInfo* pInfo) -{ - if (nVidFullscreen) { - if (bVidTripleBuffer) { - IntInfoAddStringModule(pInfo, _T("Using a triple buffer")); - } else { - IntInfoAddStringModule(pInfo, _T("Using a double buffer")); - } - } - - if (bDrvOkay) { - TCHAR szString[MAX_PATH] = _T(""); - - _sntprintf(szString, MAX_PATH, _T("Prescaling using %s (%ix zoom)"), VidSoftFXGetEffect(nPreScaleEffect), nPreScaleZoom); - IntInfoAddStringModule(pInfo, szString); - } - - if (bVidDX9Bilinear) { - IntInfoAddStringModule(pInfo, _T("Applying linear filter")); - } else { - IntInfoAddStringModule(pInfo, _T("Applying point filter")); - } - - if (bVidMotionBlur) { - IntInfoAddStringModule(pInfo, _T("Applying motion blur effect")); - } - - return 0; -} - -// The Video Output plugin: -struct VidOut VidOutDX9Alt = { dx9AltInit, dx9AltExit, dx9AltFrame, dx9AltPaint, dx9AltScale, dx9AltGetSettings, _T("DirectX9 Alternate video output") }; - - - - - - diff --git a/jan/src/intf/video/win32/vid_directx_support.cpp b/jan/src/intf/video/win32/vid_directx_support.cpp deleted file mode 100644 index 8d35fe033..000000000 --- a/jan/src/intf/video/win32/vid_directx_support.cpp +++ /dev/null @@ -1,1851 +0,0 @@ -// Support functions for blitters that use DirectX -#include "burner.h" - -#if !defined BUILD_X64_EXE - #include "vid_directx_support.h" -#endif - -#include -#define DIRECT3D_VERSION 0x0700 // Use this Direct3D version - -#if defined BUILD_X64_EXE - #include "vid_directx_support.h" -#endif - -#include "ddraw_core.h" - -// --------------------------------------------------------------------------- -// General - -static IDirectDraw7* pDD = NULL; - -void VidSExit() -{ - pDD = NULL; -} - -int VidSInit(IDirectDraw7* pDD7) -{ - pDD = pDD7; - - if (pDD == NULL) { - return 1; - } - - return 0; -} - -// --------------------------------------------------------------------------- - -// Get bit-depth of a surface (15/16/24/32) - -int VidSGetSurfaceDepth(IDirectDrawSurface7* pSurf) -{ - DDPIXELFORMAT ddpf; - if (pSurf == NULL) { - return 0; - } - - // Find out the pixelformat of the screen surface - memset(&ddpf, 0, sizeof(ddpf)); - ddpf.dwSize = sizeof(ddpf); - - if (SUCCEEDED(pSurf->GetPixelFormat(&ddpf))) { - int nDepth = ddpf.dwRGBBitCount; - if (nDepth == 16 && ddpf.dwGBitMask == 0x03E0) { - nDepth = 15; - } - - return nDepth; - } - - return 0; -} - -// Clear a surface to a specified colour - -int VidSClearSurface(IDirectDrawSurface7* pSurf, unsigned int nColour, RECT* pRect) -{ - DDBLTFX BltFx; - - if (pSurf == NULL) { - return 1; - } - - memset(&BltFx, 0, sizeof(BltFx)); - BltFx.dwSize = sizeof(BltFx); - BltFx.dwFillColor = nColour; - - if (FAILED(pSurf->Blt(NULL, NULL, pRect, DDBLT_COLORFILL, &BltFx))) { - return 1; - } else { - return 0; - } -} - -// Clipper - -int VidSClipperInit(IDirectDrawSurface7* pSurf) -{ - if (nVidFullscreen && bDrvOkay) { - return 0; - } - - IDirectDrawClipper *pClipper = NULL; - - if (SUCCEEDED(_DirectDrawCreateClipper(0, &pClipper, NULL))) { - if (SUCCEEDED(pClipper->SetHWnd(0, hVidWnd))) { - pSurf->SetClipper(pClipper); - RELEASE(pClipper); - - return 0; - } - } - - return 1; -} - -// --------------------------------------------------------------------------- -// Gamma controls - -static IDirectDrawGammaControl* pGammaControl; -static DDGAMMARAMP* pFBAGamma = NULL; -static DDGAMMARAMP* pSysGamma = NULL; - -void VidSRestoreGamma() -{ - if (pGammaControl) { - if (pSysGamma) { - pGammaControl->SetGammaRamp(0, pSysGamma); - } - - if (pSysGamma) { - free(pSysGamma); - pSysGamma = NULL; - } - if (pFBAGamma) { - free(pFBAGamma); - pFBAGamma = NULL; - } - - RELEASE(pGammaControl); - } -} - -int VidSUpdateGamma() -{ - if (pGammaControl) { - if (bDoGamma) { - for (int i = 0; i < 256; i++) { - int nValue = (int)(65535.0 * pow((i / 255.0), nGamma)); - pFBAGamma->red[i] = nValue; - pFBAGamma->green[i] = nValue; - pFBAGamma->blue[i] = nValue; - } - pGammaControl->SetGammaRamp(0, pFBAGamma); - } else { - pGammaControl->SetGammaRamp(0, pSysGamma); - } - } - - return 0; -} - -int VidSSetupGamma(IDirectDrawSurface7* pSurf) -{ - pGammaControl = NULL; - - if (!bVidUseHardwareGamma || !nVidFullscreen) { - return 0; - } - - if (FAILED(pSurf->QueryInterface(IID_IDirectDrawGammaControl, (void**)&pGammaControl))) { - pGammaControl = NULL; -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Warning: Couldn't use hardware gamma controls.\n")); -#endif - - return 1; - } - - pSysGamma = (DDGAMMARAMP*)malloc(sizeof(DDGAMMARAMP)); - if (pSysGamma == NULL) { - VidSRestoreGamma(); - return 1; - } - pGammaControl->GetGammaRamp(0, pSysGamma); - - pFBAGamma = (DDGAMMARAMP*)malloc(sizeof(DDGAMMARAMP)); - if (pFBAGamma == NULL) { - VidSRestoreGamma(); - return 1; - } - - VidSUpdateGamma(); - - return 0; -} - -// --------------------------------------------------------------------------- -// Fullscreen mode support routines - -int VidSScoreDisplayMode(VidSDisplayScoreInfo* pScoreInfo) -{ - // Continue if the resolution is too low - if (pScoreInfo->nModeWidth < pScoreInfo->nRequestedWidth || pScoreInfo->nModeHeight < pScoreInfo->nRequestedHeight) { - return 0; - } - - // Only test standard resolutions if below 512 x 384 - if ((pScoreInfo->nModeWidth == 320 && pScoreInfo->nModeHeight == 240) || (pScoreInfo->nModeWidth == 400 && pScoreInfo->nModeHeight == 300) || (pScoreInfo->nModeWidth >= 512 && pScoreInfo->nModeHeight >= 384)) { - - if (pScoreInfo->nRequestedWidth == 0 || pScoreInfo->nRequestedHeight == 0) { - RECT rect = {0, 0, 0, 0}; - int nGameWidth = nVidImageWidth, nGameHeight = nVidImageHeight; - unsigned int nScore; - - if (bDrvOkay) { - if ((BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) && (nVidRotationAdjust & 1)) { - BurnDrvGetVisibleSize(&nGameHeight, &nGameWidth); - } else { - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - } - } - - nVidScrnWidth = rect.right = pScoreInfo->nModeWidth; - nVidScrnHeight = rect.bottom = pScoreInfo->nModeHeight; - VidImageSize(&rect, nGameWidth, nGameHeight); - - // Continue if the resolution is too low - if (!bDrvOkay) { - if ((unsigned int)(rect.bottom - rect.top) < pScoreInfo->nRequestedHeight) { - return 0; - } - } else { - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - if ((unsigned int)(rect.right - rect.left) < pScoreInfo->nRequestedWidth) { - return 0; - } - } else { - if ((unsigned int)(rect.bottom - rect.top) < pScoreInfo->nRequestedHeight) { - return 0; - } - } - } - - // Score resolutions based on how many pixels are unused and the pixel aspect - nScore = 65536 * (pScoreInfo->nModeWidth - (unsigned)(rect.right - rect.left)) + (pScoreInfo->nModeHeight - (unsigned)(rect.bottom - rect.top)); - nScore = (int)((double)nScore * ((double)pScoreInfo->nModeWidth * nVidScrnAspectY / pScoreInfo->nModeHeight / nVidScrnAspectX)); - if (nScore < pScoreInfo->nBestScore) { - pScoreInfo->nBestScore = nScore; - pScoreInfo->nBestWidth = pScoreInfo->nModeWidth; - pScoreInfo->nBestHeight = pScoreInfo->nModeHeight; - } - } else { - // Select the lowest resolution that will fit the image - if (pScoreInfo->nModeWidth < pScoreInfo->nBestWidth && pScoreInfo->nModeHeight < pScoreInfo->nBestHeight) { - pScoreInfo->nBestWidth = pScoreInfo->nModeWidth; - pScoreInfo->nBestHeight = pScoreInfo->nModeHeight; - } - } - } - - return 0; -} - -int VidSInitScoreInfo(VidSDisplayScoreInfo* pScoreInfo) -{ - int nGameWidth = nVidImageWidth, nGameHeight = nVidImageHeight; - int nGameAspectX = 4, nGameAspectY = 3; - - pScoreInfo->nBestWidth = -1U; - pScoreInfo->nBestHeight = -1U; - pScoreInfo->nBestScore = -1U; - - if (pScoreInfo->nRequestedZoom == 0) { - return 0; - } - - pScoreInfo->nRequestedWidth = 0; - pScoreInfo->nRequestedHeight = 0; - - if (bDrvOkay) { - if ((BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) && (nVidRotationAdjust & 1)) { - BurnDrvGetVisibleSize(&nGameHeight, &nGameWidth); - BurnDrvGetAspect(&nGameAspectY, &nGameAspectX); - } else { - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - BurnDrvGetAspect(&nGameAspectX, &nGameAspectY); - } - } - - if (!bVidCorrectAspect || bVidFullStretch || (nVidSelect == 1 && (nVidBlitterOpt[1] & 0x07000000) == 0x07000000) || (nVidSelect == 2 && nVidBlitterOpt[2] & 0x00000100)) { - pScoreInfo->nRequestedWidth = nGameWidth * pScoreInfo->nRequestedZoom; - pScoreInfo->nRequestedHeight = nGameHeight * pScoreInfo->nRequestedZoom; - } else { - if (bDrvOkay) { - if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) { - pScoreInfo->nRequestedWidth = nGameWidth * pScoreInfo->nRequestedZoom; - } else { - pScoreInfo->nRequestedHeight = nGameHeight * pScoreInfo->nRequestedZoom; - } - } - } - - return 0; -} - -static HRESULT WINAPI myEnumModesCallback(LPDDSURFACEDESC2 pSurfaceDesc, void* lpContext) -{ - ((VidSDisplayScoreInfo*)lpContext)->nModeWidth = pSurfaceDesc->dwWidth; - ((VidSDisplayScoreInfo*)lpContext)->nModeHeight = pSurfaceDesc->dwHeight; - - VidSScoreDisplayMode((VidSDisplayScoreInfo*)lpContext); - - return DDENUMRET_OK; -} - -void VidSRestoreScreenMode() -{ - if (pDD == NULL) { - return; - } - - // Undo the changes we made to the display - pDD->SetCooperativeLevel(NULL, DDSCL_NORMAL); - - nVidScrnWidth = 0; - nVidScrnHeight = 0; - - return; -} - -// Enter fullscreen mode, select optimal full-screen resolution -int VidSEnterFullscreenMode(int nZoom, int nDepth) -{ - int nWidth, nHeight; - - if (pDD == NULL) { - return 1; - } - - if (nDepth == 0) { - nDepth = nVidDepth; - } - if (nDepth == 15) { - nDepth = 16; - } - - if (FAILED(pDD->SetCooperativeLevel(hVidWnd, DDSCL_ALLOWREBOOT | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN))) { - return 1; - } - - if (bVidArcaderes) { - if (!VidSGetArcaderes(&nWidth, &nHeight)) { - return 1; - } - } else { - if (nZoom) { - DDSURFACEDESC2 ddsd; - VidSDisplayScoreInfo ScoreInfo; - - memset(&ScoreInfo, 0, sizeof(VidSDisplayScoreInfo)); - ScoreInfo.nRequestedZoom = nZoom; - VidSInitScoreInfo(&ScoreInfo); - - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_PIXELFORMAT; - - ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; - ddsd.ddpfPixelFormat.dwRGBBitCount = nDepth; - - pDD->EnumDisplayModes(0, &ddsd, (void*)&ScoreInfo, myEnumModesCallback); - - if (ScoreInfo.nBestWidth == -1U) { - - VidSRestoreScreenMode(); - - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_FULL_NOMODE)); - FBAPopupDisplay(PUF_TYPE_ERROR); - - return 1; - } - - nWidth = ScoreInfo.nBestWidth; - nHeight = ScoreInfo.nBestHeight; - } else { - nWidth = nVidWidth; - nHeight = nVidHeight; - } - } - - if (!bDrvOkay && (nWidth < 640 || nHeight < 480)) { - return 1; - } - - if (FAILED(pDD->SetDisplayMode(nWidth, nHeight, nDepth, nVidRefresh, 0))) { - VidSRestoreScreenMode(); - - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_FULL_PROBLEM)); - if (bVidArcaderes && (nWidth != 320 && nHeight != 240)) { - FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_UI_FULL_CUSTRES)); - } - FBAPopupDisplay(PUF_TYPE_ERROR); - - nVidScrnWidth = 0; - nVidScrnHeight = 0; - - return 1; - } - - nVidScrnWidth = nWidth; - nVidScrnHeight = nHeight; - - return 0; -} - -// --------------------------------------------------------------------------- - -// Compute the resolution needed to run a game without scaling and filling the screen -// (taking into account the aspect ratios of the game and monitor) -bool VidSGetArcaderes(int* pWidth, int* pHeight) -{ - int nGameWidth, nGameHeight; - int nGameAspectX, nGameAspectY; - - if (bDrvOkay) { - if ((BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) && (nVidRotationAdjust & 1)) { - BurnDrvGetVisibleSize(&nGameHeight, &nGameWidth); - BurnDrvGetAspect(&nGameAspectY, &nGameAspectX); - } else { - BurnDrvGetVisibleSize(&nGameWidth, &nGameHeight); - BurnDrvGetAspect(&nGameAspectX, &nGameAspectY); - } - - double dMonAspect = (double)nVidScrnAspectX / nVidScrnAspectY; - double dGameAspect = (double)nGameAspectX / nGameAspectY; - - if (dMonAspect > dGameAspect) { - *pWidth = nGameHeight * nGameAspectY * nGameWidth * nVidScrnAspectX / (nGameHeight * nGameAspectX * nVidScrnAspectY); - *pHeight = nGameHeight; - } else { - *pWidth = nGameWidth; - *pHeight = nGameWidth * nGameAspectX * nGameHeight * nVidScrnAspectY / (nGameWidth * nGameAspectY * nVidScrnAspectX); - } - - // Horizontal resolution must be a multiple of 8 - if (*pWidth - nGameWidth < 8) { - *pWidth = (*pWidth + 7) & ~7; - } else { - *pWidth = (*pWidth + 4) & ~7; - } - } else { - return false; - } - - return true; -} - -// This function takes a rectangle and scales it to either: -// - The largest possible multiple of both X and Y; -// - The largest possible multiple of Y, modifying X to ensure the correct aspect ratio; -// - The window size -int VidSScaleImage(RECT* pRect, int nGameWidth, int nGameHeight, bool bVertScanlines) -{ - int xm, ym; // The multiple of nScrnWidth and nScrnHeight we can fit in - int nScrnWidth, nScrnHeight; - - int nGameAspectX = 4, nGameAspectY = 3; - int nWidth = pRect->right - pRect->left; - int nHeight = pRect->bottom - pRect->top; - - if (bVidFullStretch) { // Arbitrary stretch - return 0; - } - - if (bDrvOkay) { - if ((BurnDrvGetFlags() & (BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED)) && (nVidRotationAdjust & 1)) { - BurnDrvGetAspect(&nGameAspectY, &nGameAspectX); - } else { - BurnDrvGetAspect(&nGameAspectX, &nGameAspectY); - } - } - - xm = nWidth / nGameWidth; - ym = nHeight / nGameHeight; - - if (nVidFullscreen) { - nScrnWidth = nVidScrnWidth; - nScrnHeight = nVidScrnHeight; - } else { - nScrnWidth = SystemWorkArea.right - SystemWorkArea.left; - nScrnHeight = SystemWorkArea.bottom - SystemWorkArea.top; - } - - if (bVidCorrectAspect && bVidScanlines && ((ym >= 2 && xm) || (ym && xm >= 2 && bVertScanlines))) { // Correct aspect ratio with scanlines - int nWidthScratch, nHeightScratch; - if (nGameWidth < nGameHeight && bVertScanlines) { - int xmScratch = xm; - do { - nWidthScratch = nGameWidth * xmScratch; - nHeightScratch = nWidthScratch * nVidScrnAspectX * nGameAspectY * nScrnHeight / (nScrnWidth * nVidScrnAspectY * nGameAspectX); - xmScratch--; - } while (nHeightScratch > nHeight && xmScratch >= 2); - if (nHeightScratch > nHeight) { // The image is too high - if (nGameWidth < nGameHeight) { // Vertical games - nWidth = nHeight * nVidScrnAspectX * nGameAspectX * nScrnHeight / (nScrnWidth * nVidScrnAspectY * nGameAspectY); - } else { // Horizontal games - nWidth = nHeight * nVidScrnAspectY * nGameAspectX * nScrnWidth / (nScrnHeight * nVidScrnAspectX * nGameAspectY); - } - } else { - nWidth = nWidthScratch; - nHeight = nHeightScratch; - } - } else { - int ymScratch = ym; - do { - nHeightScratch = nGameHeight * ymScratch; - nWidthScratch = nHeightScratch * nVidScrnAspectY * nGameAspectX * nScrnWidth / (nScrnHeight * nVidScrnAspectX * nGameAspectY); - ymScratch--; - } while (nWidthScratch > nWidth && ymScratch >= 2); - if (nWidthScratch > nWidth) { // The image is too wide - if (nGameWidth < nGameHeight) { // Vertical games - nHeight = nWidth * nVidScrnAspectY * nGameAspectY * nScrnWidth / (nScrnHeight * nVidScrnAspectX * nGameAspectX); - } else { // Horizontal games - nHeight = nWidth * nVidScrnAspectX * nGameAspectY * nScrnHeight / (nScrnWidth * nVidScrnAspectY * nGameAspectX); - } - } else { - nWidth = nWidthScratch; - nHeight = nHeightScratch; - } - } - } else { - if (bVidCorrectAspect) { // Correct aspect ratio - int nWidthScratch; - nWidthScratch = nHeight * nVidScrnAspectY * nGameAspectX * nScrnWidth / (nScrnHeight * nVidScrnAspectX * nGameAspectY); - if (nWidthScratch > nWidth) { // The image is too wide - if (nGameWidth < nGameHeight) { // Vertical games - nHeight = nWidth * nVidScrnAspectY * nGameAspectY * nScrnWidth / (nScrnHeight * nVidScrnAspectX * nGameAspectX); - } else { // Horizontal games - nHeight = nWidth * nVidScrnAspectX * nGameAspectY * nScrnHeight / (nScrnWidth * nVidScrnAspectY * nGameAspectX); - } - } else { - nWidth = nWidthScratch; - } - } else { - if (xm && ym) { // Don't correct aspect ratio - if (xm > ym) { - xm = ym; - } else { - ym = xm; - } - nWidth = nGameWidth * xm; - nHeight = nGameHeight * ym; - } else { - if (xm) { - nWidth = nGameWidth * xm * nHeight / nGameHeight; - } else { - if (ym) { - nHeight = nGameHeight * ym * nWidth / nGameWidth; - } - } - } - } - } - - pRect->left = (pRect->right + pRect->left) / 2; - pRect->left -= nWidth / 2; - pRect->right = pRect->left + nWidth; - - pRect->top = (pRect->top + pRect->bottom) / 2; - pRect->top -= nHeight / 2; - pRect->bottom = pRect->top + nHeight; - - return 0; -} - -// --------------------------------------------------------------------------- -// Text display routines - -static struct { TCHAR pMsgText[32]; COLORREF nColour; int nPriority; unsigned int nTimer; } VidSShortMsg = { _T(""), 0, 0, 0,}; -static HFONT ShortMsgFont = NULL; - -static unsigned char nStatusSymbols[4] = {0x3B, 0xC2, 0x3D, 0x34}; //"pause", "record", "kaillera" and "play" in font Webdings, respectivelly -static HFONT StatusFont = NULL; -static HFONT StatusFontTiny = NULL; - -#define CHAT_SIZE 11 - -static struct { TCHAR* pIDText; COLORREF nIDColour; TCHAR* pMainText; COLORREF nMainColour; } VidSChatMessage[CHAT_SIZE]; -static bool bChatInitialised = false; - -static HFONT ChatIDFont = NULL; -static HFONT ChatMainFont = NULL; -static unsigned int nChatTimer; -static int nChatFontSize; -static int nChatShadowOffset; -static int nChatOverFlow; -static bool bDrawChat; - -static HFONT EditTextFont = NULL; -static HFONT EditCursorFont = NULL; -static DWORD nPrevStart, nPrevEnd; -static int nCursorTime; -static int nCursorState = 0; -static int nEditSize; -static int nEditShadowOffset; - -static struct { TCHAR pMsgText[64]; COLORREF nColour; int nPriority; unsigned int nTimer; } VidSTinyMsg = {_T(""), 0, 0, 0}; -static HFONT TinyMsgFont = NULL; - -static struct { TCHAR pMsgText[64]; COLORREF nColour; int nLineNo; unsigned int nTimer; } VidSJoystickMsg = {_T(""), 0, 0, 0}; -static HFONT JoystickMsgFont = NULL; - -static IDirectDrawSurface7* pShortMsgSurf = NULL; -static IDirectDrawSurface7* pStatusSurf = NULL; -static IDirectDrawSurface7* pChatSurf = NULL; -static IDirectDrawSurface7* pEditSurf = NULL; -static IDirectDrawSurface7* pTinyMsgSurf = NULL; -static IDirectDrawSurface7* pJoystickMsgSurf = NULL; - -static unsigned int nKeyColour = 0x000001; - -static int nStatus = 0; -static int nPrevStatus = -1; - -int nVidSDisplayStatus = 1; // 1 = display pause/record/replay/kaillera icons in the upper right corner of the display - -int nMaxChatFontSize = 36; // Maximum size of the font used for the Kaillera chat function (1280x960 or higher) -int nMinChatFontSize = 12; // Minimum size of the font used for the Kaillera chat function (arcade resolution) - -static int nZoom; // & 1: zoom X, & 2: zoom Y - -static int nShortMsgFlags; -static int nStatusFlags; - -bool bEditActive = false; -bool bEditTextChanged = false; -TCHAR EditText[MAX_CHAT_SIZE + 1] = _T(""); - -TCHAR OSDMsg[MAX_PATH] = _T(""); -unsigned int nOSDTimer = 0; - -static BOOL MyTextOut(HDC hdc, int nXStart, int nYStart, LPCTSTR lpString, int cbString, int nShadowOffset, int nColour) -{ - // Print a black shadow - SetTextColor(hdc, 0); - if (nShadowOffset >= 2) { - TextOut(hdc, nXStart + nShadowOffset, nYStart + nShadowOffset, lpString, cbString); - } - // Print a black outline - TextOut(hdc, nXStart - 1, nYStart - 1, lpString, cbString); - TextOut(hdc, nXStart + 0, nYStart - 1, lpString, cbString); - TextOut(hdc, nXStart + 1, nYStart - 1, lpString, cbString); - TextOut(hdc, nXStart + 1, nYStart + 0, lpString, cbString); - TextOut(hdc, nXStart + 1, nYStart + 1, lpString, cbString); - TextOut(hdc, nXStart + 0, nYStart + 1, lpString, cbString); - TextOut(hdc, nXStart - 1, nYStart + 1, lpString, cbString); - TextOut(hdc, nXStart - 1, nYStart + 0, lpString, cbString); - // Print the text on top - SetTextColor(hdc, nColour); - - return TextOut(hdc, nXStart, nYStart, lpString, cbString); -} - -static BOOL MyExtTextOut(HDC hdc, int X, int Y, UINT fuOptions, CONST RECT* lprc, LPCTSTR lpString, UINT cbCount, CONST INT* lpDx, int nShadowOffset, int nColour) -{ - // Print a black shadow - SetTextColor(hdc, 0); - if (nShadowOffset >= 2) { - ExtTextOut(hdc, X + nShadowOffset, Y + nShadowOffset, fuOptions, lprc, lpString, cbCount, lpDx); - } - // Print a black outline - ExtTextOut(hdc, X - 1, Y - 1, fuOptions, lprc, lpString, cbCount, lpDx); - ExtTextOut(hdc, X + 0, Y - 1, fuOptions, lprc, lpString, cbCount, lpDx); - ExtTextOut(hdc, X + 1, Y - 1, fuOptions, lprc, lpString, cbCount, lpDx); - ExtTextOut(hdc, X + 1, Y + 0, fuOptions, lprc, lpString, cbCount, lpDx); - ExtTextOut(hdc, X + 1, Y + 1, fuOptions, lprc, lpString, cbCount, lpDx); - ExtTextOut(hdc, X + 0, Y + 1, fuOptions, lprc, lpString, cbCount, lpDx); - ExtTextOut(hdc, X - 1, Y + 1, fuOptions, lprc, lpString, cbCount, lpDx); - ExtTextOut(hdc, X - 1, Y + 0, fuOptions, lprc, lpString, cbCount, lpDx); - // Print the text on top - SetTextColor(hdc, nColour); - - return ExtTextOut(hdc, X, Y, fuOptions, lprc, lpString, cbCount, lpDx); -} - -static void VidSExitTinyMsg() -{ - VidSTinyMsg.nTimer = 0; - - if (TinyMsgFont) { - DeleteObject(TinyMsgFont); - TinyMsgFont = NULL; - } - - RELEASE(pTinyMsgSurf); -} - -static void VidSExitJoystickMsg() -{ - VidSJoystickMsg.nTimer = 0; - - if (JoystickMsgFont) { - DeleteObject(JoystickMsgFont); - JoystickMsgFont = NULL; - } - - RELEASE(pJoystickMsgSurf); -} - -static void VidSExitShortMsg() -{ - VidSShortMsg.nTimer = 0; - - if (ShortMsgFont) { - DeleteObject(ShortMsgFont); - ShortMsgFont = NULL; - } - - RELEASE(pShortMsgSurf); -} - -static void VidSExitStatus() -{ - if (StatusFont) { - DeleteObject(StatusFont); - StatusFont = NULL; - } - - if (StatusFontTiny) { - DeleteObject(StatusFontTiny); - StatusFontTiny = NULL; - } - - RELEASE(pStatusSurf); -} - -void VidSExitChat() -{ - nChatTimer = 0; - - if (ChatIDFont) { - DeleteObject(ChatIDFont); - ChatIDFont = NULL; - } - if (ChatMainFont) { - DeleteObject(ChatMainFont); - ChatMainFont = NULL; - } - - for (int i = 0; i < CHAT_SIZE; i++) { - if (VidSChatMessage[i].pIDText) { - free(VidSChatMessage[i].pIDText); - VidSChatMessage[i].pIDText = NULL; - } - if (VidSChatMessage[i].pMainText) { - free(VidSChatMessage[i].pMainText); - VidSChatMessage[i].pMainText = NULL; - } - } - - RELEASE(pChatSurf); -} - -static void VidSExitEdit() -{ - bEditActive = false; - - if (EditTextFont) { - DeleteObject(EditTextFont); - EditTextFont = NULL; - } - if (EditCursorFont) { - DeleteObject(EditCursorFont); - EditCursorFont = NULL; - } - - RELEASE(pEditSurf); -} - -void VidSExitOSD() -{ - VidSExitTinyMsg(); - VidSExitJoystickMsg(); - if (kNetGame) { - VidSExitEdit(); - } - VidSExitChat(); - VidSExitShortMsg(); - VidSExitStatus(); -} - -static int VidSInitTinyMsg(int /*nFlags*/) -{ - DDSURFACEDESC2 ddsd; - - VidSExitTinyMsg(); - - TinyMsgFont = CreateFont(12, 0, 0, 0, FW_SEMIBOLD, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("MS Sans Serif")); - VidSTinyMsg.nTimer = 0; - - // create surface to display the text - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CKSRCBLT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - - ddsd.dwWidth = 300; - ddsd.dwHeight = 20; - - ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = nKeyColour; - ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = nKeyColour; - - if (FAILED(pDD->CreateSurface(&ddsd, &pTinyMsgSurf, NULL))) { -#ifdef PRINT_DEBUG_INFO - printf(" * Error: Couldn't create OSD texture.\n"); -#endif - return 1; - } - - VidSClearSurface(pTinyMsgSurf, nKeyColour, NULL); - - return 0; -} - -static int VidSInitJoystickMsg(int /*nFlags*/) -{ - DDSURFACEDESC2 ddsd; - - VidSExitJoystickMsg(); - - //JoystickMsgFont = CreateFont(12, 0, 0, 0, FW_DEMIBOLD, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("Courier New")); - JoystickMsgFont = CreateFont(8, 0, 0, 0, FW_THIN, 0, 0, 0, OUT_OUTLINE_PRECIS, 0, 0, NONANTIALIASED_QUALITY, FF_SWISS, _T("Courier New")); - VidSJoystickMsg.nTimer = 0; - - // create surface to display the text - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CKSRCBLT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - - ddsd.dwWidth = 300; - ddsd.dwHeight = 60; - - ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = nKeyColour; - ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = nKeyColour; - - if (FAILED(pDD->CreateSurface(&ddsd, &pJoystickMsgSurf, NULL))) { -#ifdef PRINT_DEBUG_INFO - printf(" * Error: Couldn't create OSD texture.\n"); -#endif - return 1; - } - - VidSClearSurface(pJoystickMsgSurf, nKeyColour, NULL); - - return 0; -} - -static int VidSInitShortMsg(int nFlags) -{ - DDSURFACEDESC2 ddsd; - - VidSExitShortMsg(); - - nShortMsgFlags = nFlags; - - ShortMsgFont = CreateFont(24, 0, 0, 0, FW_DEMIBOLD, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("Lucida")); - VidSShortMsg.nTimer = 0; - - // create surface to display the text - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CKSRCBLT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - - ddsd.dwWidth = 256; - ddsd.dwHeight = 32; - - ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = nKeyColour; - ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = nKeyColour; - - if (FAILED(pDD->CreateSurface(&ddsd, &pShortMsgSurf, NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create OSD texture.\n")); -#endif - return 1; - } - - VidSClearSurface(pShortMsgSurf, nKeyColour, NULL); - - return 0; -} - -static int VidSInitStatus(int nFlags) -{ - DDSURFACEDESC2 ddsd; - - VidSExitStatus(); - - nStatusFlags = nFlags; - - StatusFont = CreateFont(48, 0, 0, 0, FW_DEMIBOLD, 0, 0, 0, DEFAULT_CHARSET, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("Webdings")); - StatusFontTiny = CreateFont(20, 0, 0, 0, FW_DEMIBOLD, 0, 0, 0, DEFAULT_CHARSET, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("Webdings")); - nPrevStatus = -1; - - // create surface to display the text - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CKSRCBLT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - - ddsd.dwWidth = 192; - ddsd.dwHeight = 50; - - ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = nKeyColour; - ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = nKeyColour; - - if (FAILED(pDD->CreateSurface(&ddsd, &pStatusSurf, NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create OSD texture.\n")); -#endif - return 1; - } - - VidSClearSurface(pStatusSurf, nKeyColour, NULL); - - return 0; -} - -static int VidSInitChat(int /*nFlags*/) -{ - DDSURFACEDESC2 ddsd; - - if (bChatInitialised) { - VidSExitChat(); - } else { -// for (int i = 0; i < CHAT_SIZE + (CHAT_SIZE >> 1); i++) { - for (int i = 0; i < CHAT_SIZE; i++) { - VidSChatMessage[i].pIDText = NULL; - VidSChatMessage[i].pMainText = NULL; - } - bChatInitialised = true; - } - - //nChatFontSize = nMaxChatFontSize - ((nMaxChatFontSize - nMinChatFontSize) * nFlags) / 4; - nChatFontSize = 20; // used for cheat search only at the minute so only used in a window - - ChatIDFont = CreateFont(nChatFontSize, 0, 0, 0, FW_BOLD, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("Lucida")); - if (nChatFontSize > 20) { - ChatMainFont = CreateFont(nChatFontSize, 0, 0, 0, FW_NORMAL, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("Lucida")); - } else { - ChatMainFont = CreateFont(nChatFontSize, 0, 0, 0, FW_BOLD, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("Lucida")); - } - - nChatShadowOffset = (nChatFontSize / 16) + 1; - nChatOverFlow = 0; - bDrawChat = false; - - // create surface to display the text - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CKSRCBLT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - - if (nVidFullscreen) { - RECT rect; - GetClientScreenRect(hScrnWnd, &rect); - ddsd.dwWidth = rect.right - rect.left; - } else { - extern RECT SystemWorkArea; - ddsd.dwWidth = SystemWorkArea.right - SystemWorkArea.left; - } - ddsd.dwHeight = nChatFontSize * (CHAT_SIZE + (CHAT_SIZE >> 1)); - - ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = nKeyColour; - ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = nKeyColour; - - if (FAILED(pDD->CreateSurface(&ddsd, &pChatSurf, NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create Chat texture.\n")); -#endif - return 1; - } - - VidSClearSurface(pChatSurf, nKeyColour, NULL); - - bDrawChat = true; - - return 0; -} - -static int VidSInitEdit(int nFlags) -{ - DDSURFACEDESC2 ddsd; - - VidSExitEdit(); - - nEditSize = nMaxChatFontSize + 8 - ((nMaxChatFontSize - nMinChatFontSize) * nFlags) / 4; - - EditTextFont = CreateFont(nEditSize - 8, 0, 0, 0, FW_BOLD, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("Lucida")); - EditCursorFont = CreateFont(nEditSize - 8, 0, 0, 0, FW_BOLD, 0, TRUE, 0, 0, 0, 0, ANTIALIASED_QUALITY, FF_SWISS, _T("Lucida")); - - nEditShadowOffset = ((nEditSize - 8) / 16) + 1; - - // create surface to display the text - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CKSRCBLT; - - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - - if (nVidFullscreen) { - RECT rect; - GetClientScreenRect(hScrnWnd, &rect); - ddsd.dwWidth = rect.right - rect.left; - } else { - extern RECT SystemWorkArea; - ddsd.dwWidth = SystemWorkArea.right - SystemWorkArea.left; - } - ddsd.dwHeight = nEditSize; - - ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = nKeyColour; - ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = nKeyColour; - - if (FAILED(pDD->CreateSurface(&ddsd, &pEditSurf, NULL))) { -#ifdef PRINT_DEBUG_INFO - dprintf(_T(" * Error: Couldn't create OSD texture.\n")); -#endif - return 1; - } - - VidSClearSurface(pEditSurf, nKeyColour, NULL); - - return 0; -} - -int VidSInitOSD(int nFlags) -{ -#ifdef PRINT_DEBUG_INFO -// dprintf(_T(" ** OSD initialised.\n")); -#endif - - if (pDD == NULL) { - return 1; - } - - if (VidSInitStatus(nFlags)) { - return 1; - } - if (VidSInitShortMsg(nFlags)) { - return 1; - } - if (VidSInitChat(nFlags)) { - return 1; - } - if (kNetGame) { - if (VidSInitEdit(nFlags)) { - return 1; - } - } - if (VidSInitTinyMsg(nFlags)) { - return 1; - } - if (VidSInitJoystickMsg(nFlags)) { - return 1; - } - - return 0; -} - -int VidSRestoreOSD() -{ - if (pShortMsgSurf) { - if (FAILED(pShortMsgSurf->IsLost())) { - if (FAILED(pShortMsgSurf->Restore())) { - return 1; - } - VidSClearSurface(pShortMsgSurf, nKeyColour, NULL); - - VidSShortMsg.nTimer = 0; - } - } - - if (pTinyMsgSurf) { - if (FAILED(pTinyMsgSurf->IsLost())) { - if (FAILED(pTinyMsgSurf->Restore())) { - return 1; - } - VidSClearSurface(pTinyMsgSurf, nKeyColour, NULL); - - VidSTinyMsg.nTimer = 0; - } - } - - if (pJoystickMsgSurf) { - if (FAILED(pJoystickMsgSurf->IsLost())) { - if (FAILED(pJoystickMsgSurf->Restore())) { - return 1; - } - VidSClearSurface(pJoystickMsgSurf, nKeyColour, NULL); - - VidSJoystickMsg.nTimer = 0; - } - } - - if (pStatusSurf) { - if (FAILED(pStatusSurf->IsLost())) { - if (FAILED(pStatusSurf->Restore())) { - return 1; - } - VidSClearSurface(pStatusSurf, nKeyColour, NULL); - - nPrevStatus = -1; - } - } - - if (pChatSurf) { - if (FAILED(pChatSurf->IsLost())) { - if (FAILED(pChatSurf->Restore())) { - return 1; - } - VidSClearSurface(pChatSurf, nKeyColour, NULL); - } - } - - if (kNetGame) { - if (pEditSurf) { - if (FAILED(pEditSurf->IsLost())) { - if (FAILED(pEditSurf->Restore())) { - return 1; - } - VidSClearSurface(pEditSurf, nKeyColour, NULL); - } - } - } - - return 0; -} - -static void VidSDisplayTinyMsg(IDirectDrawSurface7* pSurf, RECT* pRect) -{ - if (VidSTinyMsg.nTimer) { - RECT src = { 0, 0, 300, 20 }; - RECT dest = { pRect->right - 320, pRect->bottom - 24, pRect->right - 8, pRect->bottom - 4 }; - - // Switch off message display when the message has been displayed long enough - if (nFramesEmulated > VidSTinyMsg.nTimer) { - VidSTinyMsg.nTimer = 0; - } - - if (dest.left < pRect->left) { - src.left = pRect->left - dest.left; - dest.left = pRect->left; - } - - if (nZoom & 2) { - dest.top <<= 1; - dest.bottom <<= 1; - } - - if (nZoom & 1) { - dest.left <<= 1; - dest.right <<= 1; - } - - // Blit the message to the surface using a colourkey - pSurf->Blt(&dest, pTinyMsgSurf, &src, DDBLT_ASYNC | DDBLT_KEYSRC, NULL); - } -} - -static void VidSDisplayJoystickMsg(IDirectDrawSurface7* pSurf, RECT* pRect) -{ - if (VidSJoystickMsg.nTimer) { - RECT src = { 0, 0, 300, 60 }; // left top right bottom - RECT dest = { pRect->left, pRect->bottom - 60, pRect->left + 300, pRect->bottom }; - - // Switch off message display when the message has been displayed long enough - if (nFramesEmulated > VidSJoystickMsg.nTimer) { - VidSJoystickMsg.nTimer = 0; - } - - if (dest.left < pRect->left) { - src.left = pRect->left - dest.left; - dest.left = pRect->left; - } - - if (nZoom & 2) { - dest.top <<= 1; - dest.bottom <<= 1; - } - - if (nZoom & 1) { - dest.left <<= 1; - dest.right <<= 1; - } - - // Blit the message to the surface using a colourkey - pSurf->Blt(&dest, pJoystickMsgSurf, &src, DDBLT_ASYNC | DDBLT_KEYSRC, NULL); - } -} - -static void VidSDisplayShortMsg(IDirectDrawSurface7* pSurf, RECT* pRect) -{ - if (VidSShortMsg.nTimer) { - RECT src = { 0, 0, 256, 32 }; - RECT dest = { 0, pRect->top + 4, pRect->right - 8, pRect->top + 36 }; - - // Switch off message display when the message has been displayed long enough - if (nFramesEmulated > VidSShortMsg.nTimer) { - VidSShortMsg.nTimer = 0; - } - - if (nStatus) { - for (int x = 0; x < 4; x++) { - if (nStatus & (1 << x)) { - dest.right -= 48; - } - } - - dest.top += 10; - dest.bottom += 10; - } - - dest.left = dest.right - 256; - if (dest.left < pRect->left) { - src.left = pRect->left - dest.left; - dest.left = pRect->left; - } - - if (nZoom & 2) { - dest.top <<= 1; - dest.bottom <<= 1; - } - - if (nZoom & 1) { - dest.left <<= 1; - dest.right <<= 1; - } - - // Blit the message to the surface using a colourkey - pSurf->Blt(&dest, pShortMsgSurf, &src, DDBLT_ASYNC | DDBLT_KEYSRC, NULL); - } -} - -static void VidSDisplayStatus(IDirectDrawSurface7* pSurf, RECT* pRect) -{ - nStatus = 0; - - if (nVidSDisplayStatus == 0) { - return; - } - - if (bRunPause) { - nStatus |= 1; - } - if (kNetGame) { - nStatus |= 2; - } - if (nReplayStatus == 1) { - nStatus |= 4; - } - if (nReplayStatus == 2) { - nStatus |= 8; - } - - if (nStatus != nPrevStatus) { - nPrevStatus = nStatus; - if (nStatus) { - // Print the message - HDC hDC; - HFONT hFont; - TCHAR szStatus[8]; - - // Clear the surface first - VidSClearSurface(pStatusSurf, nKeyColour, NULL); - - // Make the status string - memset(szStatus, 0, sizeof(szStatus)); - for (int i = 0, j = 0; i < 4; i++) { - if (nStatus & (1 << i)) { - szStatus[j] = nStatusSymbols[i]; - j++; - } - } - - pStatusSurf->GetDC(&hDC); - SetBkMode(hDC, TRANSPARENT); - hFont = (HFONT)SelectObject(hDC, (nReplayStatus == 1) ? StatusFontTiny : StatusFont); - SetTextAlign(hDC, TA_TOP | TA_RIGHT); - - MyTextOut(hDC, 192 - 2, 0, szStatus, _tcslen(szStatus), 2, RGB(0xFF, 0x3F, 0x3F)); - - // Clean up - SelectObject(hDC, hFont); - pStatusSurf->ReleaseDC(hDC); - } - } - - if (nStatus) { - RECT src = { 192, 0, 192, 48 }; - RECT dest = { 0, pRect->top + 4, pRect->right - 4, pRect->top + 52 }; - for (int x = 0; x < 4; x++) { - if (nStatus & (1 << x)) { - src.left -= 48; - } - } - dest.left = dest.right - (src.right - src.left); - - if (nZoom & 2) { - dest.top <<= 1; - dest.bottom <<= 1; - } - - if (nZoom & 1) { - dest.left <<= 1; - dest.right <<= 1; - } - - // Blit the message to the surface using a colourkey - pSurf->Blt(&dest, pStatusSurf, &src, DDBLT_ASYNC | DDBLT_KEYSRC, NULL); - } -} - -static int VidSDrawChat(RECT* dest) -{ - bool bContent = false; - - if (pChatSurf == NULL) { - return 1; - } - - VidSClearSurface(pChatSurf, nKeyColour, NULL); - - for (int i = 0; i < CHAT_SIZE; i++) { - if (VidSChatMessage[i].pIDText || VidSChatMessage[i].pMainText) { - bContent = true; - break; - } - } - - if (bContent) { - - nChatTimer = nFramesEmulated + 300; - - // Print the message - HDC hDC; - HFONT hFont; - int nStringLength; - int nFit = 0; - SIZE sizeID, sizeMain; - - // Clear the surface first - VidSClearSurface(pChatSurf, nKeyColour, NULL); - - pChatSurf->GetDC(&hDC); - SetBkMode(hDC, TRANSPARENT); - - hFont = (HFONT)SelectObject(hDC, ChatIDFont); - SetTextAlign(hDC, TA_TOP | TA_LEFT); - - nChatOverFlow = 0; - - for (int i = 0; i < CHAT_SIZE; i++) { - - // Exit when too many lines are displayed - if (nChatOverFlow > (CHAT_SIZE >> 1)) { - break; - } - - if (VidSChatMessage[i].pIDText) { - SelectObject(hDC, ChatIDFont); - nStringLength = _tcslen(VidSChatMessage[i].pIDText); - MyExtTextOut(hDC, 0, (i + nChatOverFlow) * nChatFontSize, ETO_CLIPPED, dest, VidSChatMessage[i].pIDText, nStringLength, NULL, nChatShadowOffset, VidSChatMessage[i].nIDColour); - GetTextExtentPoint32(hDC, VidSChatMessage[i].pIDText, nStringLength, &sizeID); - } else { - sizeID.cx = 0; - } - - if (VidSChatMessage[i].pMainText) { - SelectObject(hDC, ChatMainFont); - nStringLength = _tcslen(VidSChatMessage[i].pMainText); - GetTextExtentExPoint(hDC, VidSChatMessage[i].pMainText, nStringLength, dest->right - sizeID.cx, &nFit, NULL, &sizeMain); - - if (nFit < nStringLength) { - // The string doesn't fit on the screen in one line, break the line on the last space that fits - while (nFit > 0 && (VidSChatMessage[i].pMainText[nFit] != ' ')) { - nFit--; - } - - nStringLength = nFit; - MyExtTextOut(hDC, sizeID.cx, (i + nChatOverFlow) * nChatFontSize, ETO_CLIPPED, dest, VidSChatMessage[i].pMainText, nStringLength, NULL, nChatShadowOffset, VidSChatMessage[i].nMainColour); - - nChatOverFlow++; - - nStringLength = _tcslen(&(VidSChatMessage[i].pMainText[nFit + 1])); - MyExtTextOut(hDC, sizeID.cx, (i + nChatOverFlow) * nChatFontSize, ETO_CLIPPED, dest, &(VidSChatMessage[i].pMainText[nFit + 1]), nStringLength, NULL, nChatShadowOffset, VidSChatMessage[i].nMainColour); - } else { - SelectObject(hDC, ChatMainFont); - MyTextOut(hDC, sizeID.cx, (i + nChatOverFlow) * nChatFontSize, VidSChatMessage[i].pMainText, nStringLength, nChatShadowOffset, VidSChatMessage[i].nMainColour); - } - } - } - - // Clean up - SelectObject(hDC, hFont); - pChatSurf->ReleaseDC(hDC); - } else { - nChatTimer = 0; - } - - return 0; -} - -static void VidSDisplayChat(IDirectDrawSurface7* pSurf, RECT* pRect) -{ - if (nChatTimer || bDrawChat) { - // Blit the message to the surface using a colourkey - RECT src = { 0, 0, pRect->right - pRect->left, nChatFontSize * (CHAT_SIZE + (CHAT_SIZE >> 1)) }; - - // Update the message if needed - if (bDrawChat) { - VidSDrawChat(&src); - bDrawChat = false; - } - - if (nChatTimer) { - RECT dest = { pRect->left, pRect->bottom - nChatFontSize * (CHAT_SIZE + nChatOverFlow), pRect->right, pRect->bottom }; - src.bottom = nChatFontSize * (CHAT_SIZE + nChatOverFlow); - - if (bEditActive) { - dest.top -= nEditSize; - dest.bottom -= nEditSize; - } else { - dest.top -= 4; - dest.bottom -= 4; - } - - if (nZoom & 2) { - dest.top <<= 1; - dest.bottom <<= 1; - } - - if (nZoom & 1) { - dest.left <<= 1; - dest.right <<= 1; - } - - pSurf->Blt(&dest, pChatSurf, &src, DDBLT_ASYNC | DDBLT_KEYSRC, NULL); - } - - // Scroll message if needed - if (nFramesEmulated > nChatTimer) { - nChatTimer = 0; - VidSAddChatMsg(NULL, 0, NULL, 0); - bDrawChat = true; - } - } -} - -static void VidSDisplayEdit(IDirectDrawSurface7* pSurf, RECT* pRect) -{ - if (bEditActive) { - RECT src = { 0, 0, pRect->right - pRect->left, nEditSize }; - RECT dest = { pRect->left, pRect->bottom - nEditSize, pRect->right, pRect->bottom }; - - if (nZoom & 2) { - dest.top <<= 1; - dest.bottom <<= 1; - } - - if (nZoom & 1) { - dest.left <<= 1; - dest.right <<= 1; - } - - DWORD nStart, nEnd; - SendMessage(hwndChat, EM_GETSEL, (WPARAM)&nStart, (WPARAM)&nEnd); - - if (nStart != nPrevStart || nEnd != nPrevEnd) { - nPrevStart = nStart; - nPrevEnd = nEnd; - bEditTextChanged = true; - nCursorTime = nFramesEmulated + 30; - nCursorState = 1; - } else { - if (GetCurrentFrame() > nCursorTime) { - nCursorTime = nFramesEmulated + 30; - nCursorState = !nCursorState; - bEditTextChanged = true; - } - } - - if (bEditTextChanged) { - if (pEditSurf == NULL) { - return; - } - - // Print the message - HDC hDC; - HFONT hFont; - SIZE size; - int pos; - - TCHAR Space[] = _T(" "); - unsigned int nFit = 0; - TCHAR* pText = EditText; - -// bool bDisplayCursor = false; -// if (GetFocus()) { -// bDisplayCursor = true; -// } - - // Clear the surface first - VidSClearSurface(pEditSurf, nKeyColour, NULL); - - pEditSurf->GetDC(&hDC); - SetBkMode(hDC, TRANSPARENT); - hFont = (HFONT)SelectObject(hDC, EditTextFont); - SetTextAlign(hDC, TA_TOP | TA_LEFT); - - // If the string is wider than the screen, shift the display to the right. - pos = 0; - do { - GetTextExtentExPoint(hDC, pText, _tcslen(pText), src.right - pos - nEditSize, (int*)&nFit, NULL, &size); - if (nFit < nStart) { - pos -= src.right * 3 / 5; - } - } while (nFit < nStart); - - if (nStart == _tcslen(pText)) { - if (nStart) { - MyExtTextOut(hDC, pos + 3, 3, ETO_CLIPPED, &src, pText, nStart, NULL, nEditShadowOffset, RGB(0xDF, 0xDF, 0xFF)); - } - - GetTextExtentPoint32(hDC, pText, nStart, &size); - pos += size.cx; - - if (nCursorState) { - SelectObject(hDC, EditCursorFont); - } - MyExtTextOut(hDC, pos + 3, 3, ETO_CLIPPED, &src, Space, 1, NULL, nEditShadowOffset, RGB(0xFF, 0xFF, 0xFF)); - } else { - if (nStart) { - MyExtTextOut(hDC, pos + 3, 3, ETO_CLIPPED, &src, pText, nStart, NULL, nEditShadowOffset, RGB(0xDF, 0xDF, 0xFF)); - } - - GetTextExtentPoint32(hDC, pText, nStart, &size); - pos += size.cx; - - if (nEnd == nStart) { - if (nCursorState) { - SelectObject(hDC, EditCursorFont); - } - MyExtTextOut(hDC, pos + 3, 3, ETO_CLIPPED, &src, pText + nStart, 1, NULL, nEditShadowOffset, RGB(0xFF, 0xFF, 0xFF)); - - GetTextExtentPoint32(hDC, pText + nStart, 1, &size); - pos += size.cx; - - // We really printed one character past the end of the selection - nEnd++; - } else { - // Highlight selected characters - SelectObject(hDC, EditTextFont); - // SetTextColor(hDC, RGB(0x7F, 0x1F, 0x1F)); - MyExtTextOut(hDC, pos + 3, 3, ETO_CLIPPED, &src, pText + nStart, nEnd - nStart, NULL, nEditShadowOffset, RGB(0xFF, 0xFF, 0xDF)); - - GetTextExtentPoint32(hDC, pText + nStart, nEnd - nStart, &size); - pos += size.cx; - } - - if (nEnd < _tcslen(EditText)) { - SelectObject(hDC, EditTextFont); - MyExtTextOut(hDC, pos + 3, 3, ETO_CLIPPED, &src, pText + nEnd, _tcslen(pText) - nEnd, NULL, nEditShadowOffset, RGB(0xDF, 0xDF, 0xFF)); - } - } - - // Clean up - SelectObject(hDC, hFont); - pEditSurf->ReleaseDC(hDC); - - bEditTextChanged = false; - } - - // Blit the message to the surface using a colourkey - pSurf->Blt(&dest, pEditSurf, &src, DDBLT_ASYNC | DDBLT_KEYSRC, NULL); - } -} - -void VidSDisplayOSD(IDirectDrawSurface7* pSurf, RECT* pRect, int nFlags) -{ - nZoom = nFlags & 3; - - VidSDisplayStatus(pSurf, pRect); - VidSDisplayTinyMsg(pSurf, pRect); - VidSDisplayJoystickMsg(pSurf, pRect); - VidSDisplayShortMsg(pSurf, pRect); - VidSDisplayChat(pSurf, pRect); - if (kNetGame) { - VidSDisplayEdit(pSurf, pRect); - } -} - -int VidSNewTinyMsg(const TCHAR* pText, int nRGB, int nDuration, int nPriority) // int nRGB = 0, int nDuration = 0, int nPriority = 5 -{ - // If a message with a higher priority is being displayed, exit. - if (VidSTinyMsg.nTimer && VidSTinyMsg.nPriority > nPriority) { - return 1; - } - - int nSize = _tcslen(pText); - if (nSize > 63) { - nSize = 63; - } - _tcsncpy(VidSTinyMsg.pMsgText, pText, nSize); - VidSTinyMsg.pMsgText[nSize] = 0; - - if (nRGB) { - // Convert RGB value to COLORREF - VidSTinyMsg.nColour = RGB((nRGB >> 16), ((nRGB >> 8) & 0xFF), (nRGB & 0xFF)); - } else { - // Default message colour (yellow) - VidSTinyMsg.nColour = RGB(0xFF, 0xFF, 0x7F); - } - if (nDuration) { - VidSTinyMsg.nTimer = nFramesEmulated + nDuration; - } else { - VidSTinyMsg.nTimer = nFramesEmulated + 120; - } - VidSTinyMsg.nPriority = nPriority; - - { - if (pTinyMsgSurf == NULL) { - return 1; - } - - // Print the message - HDC hDC; - HFONT hFont; - - // Clear the surface first - VidSClearSurface(pTinyMsgSurf, nKeyColour, NULL); - - pTinyMsgSurf->GetDC(&hDC); - SetBkMode(hDC, TRANSPARENT); - hFont = (HFONT)SelectObject(hDC, TinyMsgFont); - SetTextAlign(hDC, TA_BOTTOM | TA_RIGHT); - - // Print a black shadow - SetTextColor(hDC, 0); - TextOut(hDC, 300, 20, VidSTinyMsg.pMsgText, _tcslen(VidSTinyMsg.pMsgText)); - // Print the text on top - SetTextColor(hDC, VidSTinyMsg.nColour); - TextOut(hDC, 300 - 1, 20 - 1, VidSTinyMsg.pMsgText, _tcslen(VidSTinyMsg.pMsgText)); - - // Clean up - SelectObject(hDC, hFont); - pTinyMsgSurf->ReleaseDC(hDC); - } - - return 0; -} - -int VidSNewJoystickMsg(const TCHAR* pText, int nRGB, int nDuration, int nLineNo) // int nRGB = 0, int nDuration = 0, int nLineNo = 0 -{ - if (!pText) { // NULL passed, clear surface - VidSClearSurface(pJoystickMsgSurf, nKeyColour, NULL); - return 0; - } - - int nSize = _tcslen(pText); - if (nSize > 63) { - nSize = 63; - } - _tcsncpy(VidSJoystickMsg.pMsgText, pText, nSize); - VidSJoystickMsg.pMsgText[nSize] = 0; - - if (nRGB) { - // Convert RGB value to COLORREF - VidSJoystickMsg.nColour = RGB((nRGB >> 16), ((nRGB >> 8) & 0xFF), (nRGB & 0xFF)); - } else { - // Default message colour (yellow) - VidSJoystickMsg.nColour = RGB(0xFF, 0xFF, 0x7F); - } - if (nDuration) { - VidSJoystickMsg.nTimer = nFramesEmulated + nDuration; - } else { - VidSJoystickMsg.nTimer = nFramesEmulated + 120; - } - VidSJoystickMsg.nLineNo = nLineNo; - - { - if (pJoystickMsgSurf == NULL) { - return 1; - } - - // Print the message - HDC hDC; - HFONT hFont; - - pJoystickMsgSurf->GetDC(&hDC); - SetBkMode(hDC, TRANSPARENT); - hFont = (HFONT)SelectObject(hDC, JoystickMsgFont); - SetTextAlign(hDC, TA_TOP | TA_LEFT); - - MyTextOut(hDC, 40, 7+(nLineNo*8), VidSJoystickMsg.pMsgText, _tcslen(VidSJoystickMsg.pMsgText), 0, VidSJoystickMsg.nColour); - - // Clean up - SelectObject(hDC, hFont); - pJoystickMsgSurf->ReleaseDC(hDC); - } - - return 0; -} - -int VidSNewShortMsg(const TCHAR* pText, int nRGB, int nDuration, int nPriority) // int nRGB = 0, int nDuration = 0, int nPriority = 5 -{ - // If a message with a higher priority is being displayed, exit. - if (VidSShortMsg.nTimer && VidSShortMsg.nPriority > nPriority) { - return 1; - } - - int nSize = _tcslen(pText); - if (nSize > 31) { - nSize = 31; - } - _tcsncpy(VidSShortMsg.pMsgText, pText, nSize); - VidSShortMsg.pMsgText[nSize] = 0; - - // copy osd message - memset(OSDMsg, '\0', MAX_PATH); - _tcsncpy(OSDMsg, pText, nSize); - - if (nRGB) { - // Convert RGB value to COLORREF - VidSShortMsg.nColour = RGB((nRGB >> 16), ((nRGB >> 8) & 0xFF), (nRGB & 0xFF)); - } else { - // Default message colour (yellow) - VidSShortMsg.nColour = RGB(0xFF, 0xFF, 0x7F); - } - if (nDuration) { - VidSShortMsg.nTimer = nFramesEmulated + nDuration; - } else { - VidSShortMsg.nTimer = nFramesEmulated + 120; - } - nOSDTimer = VidSShortMsg.nTimer; - VidSShortMsg.nPriority = nPriority; - - { - if (pShortMsgSurf == NULL) { - return 1; - } - - // Print the message - HDC hDC; - HFONT hFont; - - // Clear the surface first - VidSClearSurface(pShortMsgSurf, nKeyColour, NULL); - - pShortMsgSurf->GetDC(&hDC); - SetBkMode(hDC, TRANSPARENT); - hFont = (HFONT)SelectObject(hDC, ShortMsgFont); - SetTextAlign(hDC, TA_TOP | TA_RIGHT); - - MyTextOut(hDC, 256 - 2, 0, VidSShortMsg.pMsgText, _tcslen(VidSShortMsg.pMsgText), 2, VidSShortMsg.nColour); - - // Clean up - SelectObject(hDC, hFont); - pShortMsgSurf->ReleaseDC(hDC); - } - - return 0; -} - -void VidSKillShortMsg() -{ - VidSShortMsg.nTimer = 0; -} - -void VidSKillTinyMsg() -{ - VidSTinyMsg.nTimer = 0; -} - -void VidSKillJoystickMsg() -{ - VidSTinyMsg.nTimer = 0; -} - -void VidSKillOSDMsg() -{ - nOSDTimer = 0; -} - -int VidSAddChatMsg(const TCHAR* pID, int nIDRGB, const TCHAR* pMain, int nMainRGB) -{ - if (pID || pMain) { - // Scroll the text buffers up one entry - if (VidSChatMessage[0].pIDText) { - free(VidSChatMessage[0].pIDText); - VidSChatMessage[0].pIDText = NULL; - } - if (VidSChatMessage[0].pMainText) { - free(VidSChatMessage[0].pMainText); - VidSChatMessage[0].pMainText = NULL; - } - - for (int i = 1; i < CHAT_SIZE; i++) { - VidSChatMessage[i - 1].pIDText = VidSChatMessage[i].pIDText; - VidSChatMessage[i - 1].nIDColour = VidSChatMessage[i].nIDColour; - VidSChatMessage[i - 1].pMainText = VidSChatMessage[i].pMainText; - VidSChatMessage[i - 1].nMainColour = VidSChatMessage[i].nMainColour; - } - - // Put the new entry in the last position - if (pID) { - int nSize = _tcslen(pID); - VidSChatMessage[CHAT_SIZE - 1].pIDText = (TCHAR*)malloc((nSize + 1) * sizeof(TCHAR)); - _tcscpy(VidSChatMessage[CHAT_SIZE - 1].pIDText, pID); - VidSChatMessage[CHAT_SIZE - 1].pIDText[nSize] = 0; - VidSChatMessage[CHAT_SIZE - 1].nIDColour = RGB((nIDRGB >> 16), ((nIDRGB >> 8) & 0xFF), (nIDRGB & 0xFF)); - } else { - VidSChatMessage[CHAT_SIZE - 1].pIDText = NULL; - } - if (pMain) { - int nSize = _tcslen(pMain); - VidSChatMessage[CHAT_SIZE - 1].pMainText = (TCHAR*)malloc((nSize + 1) * sizeof(TCHAR)); - _tcscpy(VidSChatMessage[CHAT_SIZE - 1].pMainText, pMain); - VidSChatMessage[CHAT_SIZE - 1].pMainText[nSize] = 0; - VidSChatMessage[CHAT_SIZE - 1].nMainColour = RGB((nMainRGB >> 16), ((nMainRGB >> 8) & 0xFF), (nMainRGB & 0xFF)); - } else { - VidSChatMessage[CHAT_SIZE - 1].pMainText = NULL; - } - } else { - for (int i = 0; i < CHAT_SIZE; i++) { - if (VidSChatMessage[i].pIDText || VidSChatMessage[i].pMainText) { - if (VidSChatMessage[i].pIDText) { - free(VidSChatMessage[i].pIDText); - VidSChatMessage[i].pIDText = NULL; - } - if (VidSChatMessage[i].pMainText) { - free(VidSChatMessage[i].pMainText); - VidSChatMessage[i].pMainText = NULL; - } - - break; - } - } - } - - bDrawChat = true; - - return 0; -} diff --git a/jan/src/intf/video/win32/vid_directx_support.h b/jan/src/intf/video/win32/vid_directx_support.h deleted file mode 100644 index 9ed0ec3ab..000000000 --- a/jan/src/intf/video/win32/vid_directx_support.h +++ /dev/null @@ -1,46 +0,0 @@ -//#define DIRECTDRAW_VERSION 7 // Use this DirectDraw version -#include -#include "vid_support.h" - -// General -void VidSExit(); -int VidSInit(IDirectDraw7* pDD7); - -// Miscellaneous -int VidSGetSurfaceDepth(IDirectDrawSurface7* pSurf); -int VidSClearSurface(IDirectDrawSurface7* pSurf, unsigned int nColour, RECT* pRect); - -// Clipper -int VidSClipperInit(IDirectDrawSurface7* pSurf); - -// Gamma controls -void VidSRestoreGamma(); -int VidSUpdateGamma(); -int VidSSetupGamma(IDirectDrawSurface7* pSurf); - -// Select optimal full-screen resolution -struct VidSDisplayScoreInfo { - // Filled in advance by the caller - unsigned int nRequestedWidth; unsigned int nRequestedHeight; unsigned int nRequestedDepth; unsigned int nRequestedZoom; - unsigned int nModeWidth; unsigned int nModeHeight; unsigned int nModeDepth; - // Filled by the scoring routine - unsigned int nBestWidth; unsigned int nBestHeight; unsigned int nBestDepth; - unsigned int nBestScore; -}; - -int VidSScoreDisplayMode(VidSDisplayScoreInfo* pScoreInfo); -int VidSInitScoreInfo(VidSDisplayScoreInfo* pScoreInfo); - -void VidSRestoreScreenMode(); -int VidSEnterFullscreenMode(int nZoom, int nDepth); - -// Image size -int VidSScaleImage(RECT* pRect, int nGameWidth, int nGameHeight, bool bVertScanlines); -bool VidSGetArcaderes(int* pWidth, int* pHeight); - -// Text display -void VidSExitOSD(); -int VidSInitOSD(int nFlags); -int VidSRestoreOSD(); -void VidSDisplayOSD(IDirectDrawSurface7* pSurf, RECT* pRect, int nFlags); - diff --git a/jan/src/license.txt b/jan/src/license.txt deleted file mode 100644 index a7651ad08..000000000 --- a/jan/src/license.txt +++ /dev/null @@ -1,85 +0,0 @@ -You may freely use, modify, and distribute both the FB Alpha source code and binary, however the following restrictions apply to the FB Alpha original material (see below for a list of libraries with differing licenses, please consult their respective documentation for more information): - - - You may not sell, lease, rent or otherwise seek to gain monetary profit from FB Alpha; - - You must make public any changes you make to the source code; - - You must include, verbatim, the full text of this license; - - You may not distribute binaries which support games with copyright dates less then three years old; - - You may not distribute FB Alpha with ROM images unless you have the legal right to distribute them; - - You may use dynamic linked libraries (dlls) for network play only (all other use is prohibited); - - You may not ask for donations to support your work on any project that uses the FB Alpha source code. - -FB Alpha can currently be obtained from https://www.fbalpha.com. - -FB Alpha would not exist without a lot of code from the MAME project. The MAME project is subject to it's own license, which can be found at http://mamedev.org/legal.html. Due to the use of MAME code in FB Alpha, FB Alpha is also subject to the terms of the MAME license. - -FB Alpha is based on Final Burn (formally at http://www.finalburn.com), see additional text below. -Musashi MC68000/MC68010/MC68EC020 CPU core by Karl Stenerud (http://www.mamedev.org). -A68K MC68000 CPU core by Mike Coates & Darren Olafson (http://www.mamedev.org). -Z80 CPU core by Juergen Buchmueller (http://www.mamedev.org). -ARM CPU core by Bryan McPhail, Phil Stroffolino (http://www.mamedev.org). -ARM7 CPU core by Steve Ellenoff (http://www.mamedev.org). -H6280 CPU core by Brian McPhail (http://www.mamedev.org). -HD6309 CPU core by John Butler, Tim Lindner (http://www.mamedev.org). -I8039 CPU core by Mirko Buffoni (http://www.mamedev.org). -Konami CPU core by MAMEdev (http://www.mamedev.org). -M6502 CPU core by Juergen Buchmueller (http://www.mamedev.org). -M6800/M6801/M6802/M6803/M6808/HD63701/NSC8105 CPU core by MAMEdev (http://www.mamedev.org). -M6805 CPU core by MAMEdev (http://www.mamedev.org). -M6809 CPU core by John Bulter (http://www.mamedev.org). -NEC V20/V30/V33 CPU core by MAMEdev (http://www.mamedev.org). -PIC16C5X CPU core by Tony La Porta (http://www.mamedev.org). -S2650 CPU core by Juergen Buchmueller (http://www.mamedev.org). -SH-2 CPU core by Juergen Buchmueller (http://www.mamedev.org). -TLCS90 CPU core by Luca Elia (http://www.mamedev.org). -ADSP21XX CPU core by Aaron Giles (http://www.mamedev.org). -AY8910/YM2149 sound core by various authors (http://www.mamedev.org). -C6280 sound core by Charles MacDonald (http://cgfm2.emuviews.com). -DAC sound core by MAMEdev (http://www.mamedev.org). -ES8712 sound core by MAMEdev (http://www.mamedev.org). -ICS2115 sound core by O.Galibert, El-Semi (http://www.mamedev.org). -IREM GA20 sound core by MAMEdev (http://www.mamedev.org). -K005289 sound core by Brian McPhail (http://www.mamedev.org). -K007232 sound core by MAMEdev (http://www.mamedev.org). -K051649 sound core by Brian McPhail (http://www.mamedev.org). -K053260 sound core by MAMEdev (http://www.mamedev.org). -K054539 sound core by MAMEdev (http://www.mamedev.org). -MSM5205 sound core by Aaron Giles (http://www.mamedev.org). -MSM5232 sound core by MAMEdev (http://www.mamedev.org). -RF5C68 sound core by MAMEdev (http://www.mamedev.org). -SAA1099 sound core by Juergen Buchmueller, Manuel Abadia (http://www.mamedev.org). -Sega PCM sound core by MAMEdev (http://www.mamedev.org). -SN76496 sound core by Nicola Salmoria (http://www.mamedev.org). -UPD7759 sound core by Juergen Buchmueller, Mike Balfour, Howie Cohen, Olivier Galibert, Aaron Giles (http://www.mamedev.org). -VLM5030 sound core by Tatsuyuki Satoh (http://www.mamedev.org). -X1010 sound core by Luca Elia, Manbow-J (http://www.mamedev.org). -Y8950/YM3526/YM3812 sound core by Jarek Burczynski & Tatsuyuki Satoh (http://www.mamedev.org). -YM2151 sound core by Jarek Burczynski (http://www.mamedev.org). -YM2203/YM2608/YM2610/YM2612 sound cores by Jarek Burczynski & Tatsuyuki Satoh (http://www.mamedev.org). -YM2413 sound core by Jarek Burczynski (http://www.mamedev.org). -YMF278B sound core by R. Belmont & O.Galibert (http://www.mamedev.org). - -Uses SMS Plus by Charles MacDonald (http://www.techno-junk.org). - -7Z functionality provided by LZMA SDK (http://www.7-zip.org/sdk.html) -PNG functionality provided by libpng (http://www.libpng.org) -Zip functionality provided by zlib (http://www.zlib.net). - -Uses Xbyak (JIT assembler for x86/x64) by Herumi (https://github.com/herumi/xbyak) - -Some graphics effects provided by the Scale2x, 2xPM, Eagle Graphics, 2xSaI, hq2x/hq3x/hq4x, hq2xS/hq3xS/SuperEagle/2xSaI (VBA), hq2xS/hq3xS/hq2xBold/hq3xBold/EPXB/EPXC (SNES9X ReRecording) and SuperScale libraries (http://scale2x.sourceforge.net, http://2xpm.freeservers.com, http://retrofx.com, http://elektron.its.tudelft.nl/~dalikifa, http://www.hiend3d.com, http://code.google.com/p/vba-rerecording, http://code.google.com/p/snes9x151-rerecording, http://nebula.emulatronia.com). - -Miscellaneous other components from various sources. Copyright and license information are contained in the relevant parts of the source code. - -All material not covered above 2004-2017 Team FB Alpha. - -DISCLAIMER: The authors of FB Alpha don't guarantee its fitness for any purpose, implied or otherwise, and do not accept responsibility for any damages whatsoever that might occur when using FB Alpha. All games emulated by FB Alpha, including any images and sounds therein, are copyrighted by their respective copyright holders. FB Alpha DOES NOT INCLUDE any ROM images of emulated games. - -The following information and license conditions accompanied the original Final Burn emulator. They also apply to FB Alpha: - -"Copyright (c)2001 Dave (formally of www.finalburn.com), all rights reserved. This refers to all code except where stated otherwise (e.g. unzip and zlib code)." - -"You can use, modify and redistribute this code freely as long as you don't do so commercially. This copyright notice must remain with the code. If your program uses this code, you must either distribute or link to the source code. If you modify or improve this code, you must distribute the source code improvements." - -"Dave" -"Former Homepage: www.finalburn.com" -"E-mail: dave@finalburn.com" diff --git a/jan/whatsnew.html b/jan/whatsnew.html deleted file mode 100644 index 0c4f8c57d..000000000 --- a/jan/whatsnew.html +++ /dev/null @@ -1,4112 +0,0 @@ - - - - - -FB Alpha - What's New - - - - - -
-

FB Alpha - What's New

-

https://www.fbalpha.com
-http://neosource.1emu.net/forums

- -

v0.2.97.41

-

Fixes and new features

-
    - -
  • Add driver for Time Soldiers/Battle Field, Sky Soldiers, Sky Adventure, Gang Wars, Super Champion Baseball on Alpha68k II and VI hardware [iq_132, dink]
  • -
  • Fixed missing background layer in Bio-ship Paladin level 2 [dink]
  • -
  • Fixed an issue with Pururun's sound [dink]
  • -
  • Added clone of Gals Panic DX (Asia) [arcade mod bios]
  • -
  • Fixed 16-bit rendering for most games on Konami and Metro hardware [iq_132]
  • -
  • Fixed 16-bit RGB555 rendering in Taito F3 [dink]
  • -
  • Separate Force 16-Bit Video option between D3D Enhanced blitter and DX9 Alt blitter [Barry]
  • -
  • Fixed scfinals coin-up issue with a kludge [dink]
  • -
  • Added American Horseshoes (Taito-L) - was missing from the .40 release by accident [dink]
  • -
  • Massive Taito-F3 video fix-a-thon
      -
    • Arabian Magic: ugly line down the screen at stage start, caused by off-by-one clipping
    • -
    • Arabian Magic: missing text in the cutscenes
    • -
    • Puzzle Bobble 4: missing end-of-round you won/lost animations
    • -
    • Land Maker: missing you won/lost text
    • -
    • Land Maker: tilemap alignment issues
    • -
    • Grid Seeker: missing continue screen
    • -
  • -
  • Remove unneeded DWM and MDI code, causes issues in Win10 [Barry]
  • -
  • Updated modern Windows builds to use the Segoe font recommended by Microsoft [Barry]
  • -
  • Fixed broken background issue in Ashura Blaster [dink]
  • -
  • Fixed animated background in Universal's Space Raider [dink]
  • -
  • Added driver for Toypop and Libble Rabble on misc. Namco Hardware [iq_132]
  • -
  • Added Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin (Special 2017, hack) [GSC2007, JacKc]
  • -
  • Updated The King of Fighters '98 (Combo) to Ver. 2017/04/08 [JacKc]
  • -
  • Add driver for Mappy, Dig Dug II, Super Pacman, Pac & Pal, Grobda and The Tower of Druaga [iq_132, dink]
  • -
  • Add driver for Gaplus / Galaga 3 [iq_132]
  • -
  • EEPROM saves path now configurable [Barry]
  • -
  • Added clone of Bucky O'Hare (ver JA) [ShouTime, The Dumping Union, JacKc]
  • -
  • Added experimental SekBurnUntilInt() code to the 68k core [dink]
  • -
  • Fixed layer alignments and screensize in Ajax / Typhoon [dink]
  • -
  • Added clone of Rastan Saga (Japan Rev 1) [Michel BLANCO, JacKc]
  • -
  • Added clone of Captain Silver (Japan, revision 1) [Apocalypse, The Dumping Union, JacKc]
  • -
  • Added clone of Super Street Fighter II to the CPS-2 driver [Barry, idc/Team Avalaunch]
  • -
  • Added Ultimate Mortal Kombat Trilogy Hack r.5149 to Megadrive [dink]
  • -
  • Fix shadow/highlights for 2-cell column vscroll in Megadrive, in particular fixes the intro to Trouble Shooter / Battle Mania [dink]
  • -
  • Fix Super Real Darwin sprite:tile priorities [dink]
  • -
  • Added Nebulous Bee, clone of Galaga [JacKc]
  • -
  • Added clone of Jackal (bootleg, Rotary Joystick) [f205v, The Iron Goat, JacKc]
  • -
  • Fix timing inconsistencies / framerate issues on some Win 10 machines (high precision timer) [dink]
  • -
  • Fix Galaxian-custom sound that dink broke [Barry]
  • -
  • Add ability to rotate player digitally in Forgotten Worlds [dink]
  • -
  • Fix layer priorities in G-Loc (gloc) [Barry]
  • -
  • Fix cutscene crystal ball in some sets of Altered Beast [Barry]
  • -
  • Added Revenger '84 to the EPOS driver [dink]
  • -
  • Fixed broken sound in Puzzle King (4in1boot) [dink]
  • -
  • Disabled Force 16-bit emulation by default, can still be enabled by user, but causes issues with some systems, eg, Taito F3 [Barry]
  • -
  • Made the Enhanced blitter the default for normal builds [Barry]
  • -
  • Made force flip a default option for the Direct Draw blitter [Barry]
  • -
  • Set the full-screen resolution to the desktop resolution on first program start [Barry]
  • -
  • Fixed blue squares in Street Fighter Alpha 2 high score entry screen [Barry]
  • -
  • Added a message to install the Direct X runtimes if the DLLs are missing when starting the DirectX9 blitters, removed the message that showed at every FB Alpha start [Barry]
  • -
  • Added ability to choose which monitor (separated for Horizontal and Vertical games) to use for fullscreen in the DirectX 9 blitters [Barry]
  • -
  • General source tidy-up/maintenance, and conversion to BurnMalloc/BurnFree [Barry]
  • -
  • Add support for the new format hiscore.dat file [Barry]
  • -
  • Documentation Update [Barry]
  • -
  • Fix issue with IPS Manager sometimes saving ini file incorrectly [Barry]
  • -
  • Sync sets with MAME 0.186 [Barry]
  • -
  • Added alpha transparencies to Raiga Strato Fighter [iq_132]
  • -
  • Added driver for Cannon Ball, Magix / Rock and Rock Tris on Yun Sung 8 hardware [iq_132]
  • -
  • Fixed video offset issue in Gundhara [dink]
  • -
  • Added driver for US Games trivia [iq_132]
  • -
  • Fixed alpha blending and many sprite:tile priority issues in Nitro Ball [dink]
  • -
  • Added driver for Double Wings on Data East 16-bit Hardware [iq_132]
  • -
  • Fixed MSM6295 Banking in Boogie Wings [dink]
  • -
  • For debug builds: show negative numbers with the debug counter ('m' and 'n') [dink]
  • -
  • Fixed the road and sky levels (broken raster effects) in Ed Randy / The Cliffhanger [dink]
  • -
  • Fixed "stuck" sprites in Pitfall II on Sega System 1 hardware [dink]
  • -
  • Fixed slow music tempo when sound rate set to 44100 in Contra, Jaleco Megasystem 1 games, Konami's Surprise Attack and several Data East 16-Bit games [dink]
  • -
  • Fixed strange music tempo in Route 16 [dink]
  • -
  • Fixed un-smooth scrolling and cut-off end-of-level message in Konami's Surprise Attack [dink]
  • -
  • Fixed video offset issue in X-Multiply m81 version [dink]
  • -
  • Added Dottori-Man Jr. to the Dottori Kun driver [hap, JacKc]
  • -
  • Ported the Namco C140 sound core to FBAlpha [dink]
  • -
  • Added resampling to the Konami K054539 Soundcore, now most later Konami games (Xexex, Moo Mesa, Bucky O'Hare, etc) will sound great at any user-selected soundrate [dink]
  • -
  • Fixed occasional sprite flickering in Mystic Warriors [dink]
  • -
  • Fixed occasional freeze in Atomic Robo-Kid when playing via keyboard and up+down or left+right is pressed at the same time [dink]
  • -
  • Fixed music, graphics, timing and color issues in Psychic 5 [dink]
  • -
  • Added checkbox filters to the HTML debug log, and added ten new output levels [Barry]
  • -
  • []
  • -
  • []
  • -
  • []
  • -
  • []
  • -
- -

v0.2.97.40

-

Fixes and new features

-
    - -
  • Added Favorites feature: mark games as favorite from the Game Info window, or right-click in the list. Toggle favorites mode in the "Filters" section [dink]
  • -
  • Added right-click context menu (Play game, View in Progetto Emma, Game Info and Mark as Favorite) [Barry]
  • -
  • Added a gear-shifter display for Chequered Flag, Contental Circus, Super Chase, Chase HQ, SCI, Double Axle, Racing Beat, Top Speed, KonamiGT / RF2, OutRun / Turbo Outrun and Power Drift. Can be enabled/disabled in Misc -> Options. [dink]
  • -
  • Hooked up newly dumped sound-MCU's in Fire Shark, Vimana and Teki Paki, giving these games sound! Thank you CapsOff!! [dink]
  • -
  • Added bSkipStartupCheck - hidden .ini option for developers or those who never scan their romsets [dink]
  • -
  • Fixed odd-word/long reads and writes in the m68000 cpu interface which in turn fixes the nasty 68x020 bug that has been plaguing us for ages. This fixes freeze-ups in Asura Buster and other 68ec020-based games. [iq_132/dink]
  • -
  • Fixed in Asura Buster / Blade: Sprite & tile glitches, music synchronization [dink]
  • -
  • Fixed several issues which caused FBAlpha to crash when loading romsets with missing roms [dink]
  • -
  • Fixed Tail 2 Nose missing backgrounds [dink]
  • -
  • Added TMS32010 cpu core for the Flying Shark/Twin Cobra/Wardner drivers [dink]
  • -
  • Fixed Demon World sprite and tile offsets, also hooked up TMS32010 cpu and removed the no-TMS32010 hack [iq_132 / dink]
  • -
  • Fixed Flicky on SG-1000 hw [dink]
  • -
  • Fixed default eeprom settings for Charlie Ninja [dink]
  • -
  • Fixed sound in regulusu [dink]
  • -
  • Fixed Head Panic default settings, game is now playable [dink]
  • -
  • Fixed broken graphics/corruption in Mille Miglia 2: Great 1000 Miles Rally [dink]
  • -
  • Increased the Icon limit [dink]
  • -
  • Fixed P2 Start in Asterix [dink]
  • -
  • Added 1-bit dac/key clicker, map joy to cursor keys, Swap tape side A/B and lots of games to the MSX driver [dink]
  • -
  • Improved savestate stability/reliability with the MSX driver [dink]
  • -
  • Improved the MSM5205 interface w/MSM5205NewFrame() and MSM5205UpdateScanline(), for games that need a 256 interleave. [dink]
  • -
  • Fixed diagonal movements in Toaplan/Taito's GetStar / Guardian [dink]
  • -
  • Fixed a crash-scenario w/DonPachi on ARM and 64-bit systems [dink]
  • -
  • Fixed sound in Speed Spin [iq_132]
  • -
  • Added encrypted DataEast cpus to the M6502 core [iq_132]
  • -
  • Fixed service mode, sprite offsets and corrupt tilemaps in G.I.Joe [dink]
  • -
  • Fixed audio issues, movement issues, slowdowns in Captain Silver [dink]
  • -
  • Mega-update to the ES5506 core: dynamic resampling, volume functions [iq_132], 5505-interface fix, clipping issues and savestate support [dink]
  • -
  • Add NEC-V60 CPU Core [iq_132 / Romhack]
  • -
  • Add UPD-7725 DSP Core [iq_132]
  • -
  • Fixed sound, video issues and crash issues in Welltris [dink]
  • -
  • Fixed sound and hooked up proper analogue inputs for Taito's Super Chase [dink]
  • -
  • Fixed DAC speech and reboot issues in Baraduke / Alien Sector [dink]
  • -
  • Fixed missing sounds in Pac-Land and Sky Kid [dink]
  • -
  • Fixed a bug in the M6502 core where it wouldn't save the subtype and instruction handler [dink]
  • -
  • Added rotation code for Caliber 50 and DownTown [dink]
  • -
  • Fixed video layer offsets in namcos86 driver, improving video for Rolling Thunder, Hopping Mappy and SkyKid DX [dink]
  • -
  • Fixed Taito/Toaplan's RallyBike titlescreen [dink]
  • -
  • Added M6502ReleaseSlice() the the M6502 cpu core interface [dink]
  • -
  • Add UPD-7810 CPU Core [iq_132]
  • -
  • Fixed Thunder Cross 2 Japan and Asian versions [dink]
  • -
  • Fixed dim palette in Lightning Fighters [dink]
  • -
  • Enhanced the glass effect in Surprise Attack [dink]
  • -
  • Fixed grapics issues in Konami's Xexex: Sprite masking effect in intro, flashes between scene changes, offset issue in the highscore table, missing effect in Japanese version continue screen [dink]
  • -
  • Added new tilemap system with all the bells & whistles [iq_132]
  • -
  • Fixed dips in Dam Busters [dink]
  • -
  • Fixed gameover animation in Vapor Trail [rb6502]
  • -
  • Fixed titlescreen raster effect in R-Type Leo [dink]
  • -
  • Fixed sprite glitching in Shogun Warriors [dink]
  • -
  • Fixed strangely flipped tiles in Cosmic Cop [dink]
  • -
  • Ported latest i8051 core with DS5002FP support [dink]
  • -
  • Added support for 6821 PIA devices [dink]
  • -
  • Added apan callback support to the K054539 soundchip [dink]
  • -
  • Fixed service mode in Xexex. Bucky O`Hare and Moo Mesa [dink]
  • -
  • Fixed tile priority issue in Shackled [dink]
  • -
  • Re-wrote driver for Shadow Force and added raster effects [iq_132]
  • -
  • Re-wrote driver for Exed Exes [iq_132]
  • -
  • Fixed screen priority & graphics issues in Chase HQ, SCI and Night Striker [dink]
  • -
  • Fixed DIPs for Mars by Artic [dink]
  • -
  • Added proper MCU emulation on Heavy Barrel with the new i8051 core [dink]
  • -
  • Fixed Speed Coin - freezes up when the coin breaks if audio set to 48khz [dink]
  • -
  • timer.cpp: added ability to attach a timer to a NULL cpu for for instances where the main cpu cycles possibly vary [dink]
  • -
  • Added BDF_GAME_NOT_WORKING flag to burn.h [dink]
  • -
  • Fixed 8-way movements in Jump Shot [dink]
  • -
  • System 16 Updates [Barry]
      -
    • Added support for the Sega 315 5195 Memory Mapper chip
        -
      • Hooked up in Sega System 16B driver
      • -
      • Hooked up in Sega OutRun driver
      • -
      • Hooked up in Sega System 18 driver
      • -
      • Added Moonwalker and clones to the Sega System 18 driver now they can be supported
      • -
    • -
    • Properly emulate the shadow/hilight palettes in Sega System 16 and associated drivers
    • -
    • Emulate priority buffer for Y-Board driver when mixing in System 16B sprites
    • -
    • Added Lock On (Philko) to the Sega System 16B driver
    • -
    • Fixed tile banking in some Altered Beast sets
    • -
    • Emulated the I8751 MCU in the parent set of Altered Beast
    • -
    • Emulated the I8751 MCU in the parent set of Golden Axe
    • -
    • Emulated the I8751 MCU in the parent set of Body Slam
    • -
    • Emulated the I8751 MCU in the clone Quartet 2 (8751 317-0010)
    • -
    • Added 5 bootlegs of SDI to the Sega System 16B driver
    • -
    • Fixed game ini saving for SDI & clones
    • -
    • Implemented full controls in Ace Attacker in the Sega System 16B driver
    • -
    • Fix outrundxj
    • -
    • Hooked up PPI8255 reads in Major League
    • -
    • Fix life counter in Space Harrier
    • -
    • Added support for screen flipping in Sega System 16A/16B drivers - fixes some levels of SDI which rely on it
    • -
  • -
  • Added a module for Resister Networks (Palette Generation) [Barry]
  • -
  • Update lzma sdk to 16.04 [Barry]
  • -
  • Update libpng to 1.6.28 [Barry]
  • -
  • Update zlib to 1.2.11 [Barry]
  • -
  • Synchronize romsets with the latest MAME [Barry]
  • -
  • Fixed sprite priority issues in Task Force Harrier [dink]
  • -
  • Fixed alignment issues in Swat Police and Head Panic, x-scroll issues, and added missing flashing sprite effect on ESD16 Hardware [dink]
  • -
  • Synthesized a proper color palette for Time Limit [dink]
  • -
  • Improvements/Fixes for Super Kaneko Nova System: [dink]
      -
    • New cpu-based speedhack for most games - dip option
    • -
    • Fixed Music and SFX in Gals Panic S
    • -
    • Fixed attract-mode music cut short in VS Block Breaker/Saru Kani
    • -
    • Fixed garbage on screen when the game starts in VS Block Breaker/Saru Kani
    • -
    -
  • Updated KonamiBlendCopy() to be faster/more efficient [iq_132]
  • -
  • Fixed a crash in Donkey Kong 3 Japanese version [dink]
  • -
  • Fixed Z80's ZetRunEnd(); *revisited*. This fixes slowdown issues with Strikers 1945 Plus [dink]
  • -
  • Added newer-style VezMapMemory() function to the NEC V20-35 cpu interfaces. [dink]
  • -
  • Fixed a masking issue in NEC V20-35's read port interface [dink]
  • -
  • Fixed a blitter issue in Kangaroo, fixed savestates: video banking and lost music [dink]
  • -
  • Fixed nasty crackling/popping noises in Darius 2 [dink]
  • -
  • Hooked up shot and explosion samples to Seibu Stinger and Scion[c] [dink]
  • -
  • Fixed sprite flickering and freeze-ups in Xain'd Sleena [dink]
  • -
  • Front-End fix: when starting a game from the commandline, only init the blitter once. also don't get stuck in fullscreen when loading fails due to a bad romset [dink]
  • -
  • Fix some structure alignment issues so drivers can benefit from vectorization/SIMD optimizations present in latest gcc w/ -O3 and other recent compilers [dink, barbudreadmon]
  • -
  • Fix dipswitch issues in several games thanks to info from the libretro/fba guys [barbudreadmon, dink]
  • -
  • Fixed Dac and scrolling issues in Konami's Finalizer [dink]
  • -
  • Fixed a crash issue in Super-X (NTC) when up + down was pressed [dink]
  • -
  • Default Full Screen depth to 32bpp [dink]
  • -
  • Fixed DAC DC Offset on some System16 games: Shinobi, Quartet 1 and 2, eliminating pops and clicks [dink]
  • -
  • Added proper inputs for Wall Crash [dink]
  • -
  • Add default gun calibrations and fix sprite:tile priority issues in Operation Wolf 3 [dink]
  • -
  • Reduce the time duration "state loaded/saved" is displayed on the screen [dink]
  • -
  • Fixed mosaic tile effect on scene transitions in FixEight [dink]
  • -
  • Fixed sound synchronization issues in Batrider [dink]
  • -
  • Improvements and Fixes to the Input (re)Recording/Playback feature: [dink]
      -
    • Add Record from Power On option to replay/input recording
    • -
    • Shift+Backspace to disable/enable the frame counter while recording or playing back recordings
    • -
    • Fix a nasty bug that caused desynchs in some recordings
    • -
    -
  • Add original author(s) credit to each driver and core [iq_132]
  • -
  • Add trackball support to Capcom Bowling and Krazy Bowl [dink]
  • -
  • Fix crash with Force 16bit Emulation and Megadrive [dink]
  • -
  • Fix Gun & Frontier sprite lag issue [dink]
  • -
  • Fix Zero Point 1 and 2 Sprite priorities and sound effects in Zero Point 2 [dink]
  • -
  • Slight speedup with the search function [tumu]
  • -
  • Fix Demon World savestates [dink]
  • -
  • Fix timing issue in D-Con [dink]
  • -
  • Fix sprite alignment in oisipuzl [dink]
  • -
  • Fix savestate compatibility between 32bit/64bit systems [barbudreadmon & libretro guys, dink]
  • -
  • Fix Ghost 'n Goblins savestate banking issue, improve timing [dink]
  • -
  • Fix timing issue in Toki that occasionally caused tiles in the map-screen to jitter [dink]
  • -
  • Fix Hit the Ice inputs and graphics issues [dink]
  • -
  • Fix timing issues in 4 En Raya [dink]
  • -
  • Fix missing button #3 and video issues in Strategy X [dink]
  • -
  • Hook up trackball and fix palette issues - U.S. Classic now playable [dink]
  • -
  • Fix music and banking issues in Funny Bubble [dink]
  • -
  • Fix soundfx and timing in Tripool [dink]
  • -
  • Fixed soundcpu communications in Gauntlet, hooked up the Pokey sound generator and savestates [dink]
  • -
  • Improved M6502 core by properly handling indexed read/writes, fixed pulsing the nmi line with CPU_IRQSTATUS_AUTO [dink]
  • - -
-

New drivers

-
    -
  • Konami's The Main Event and Cosmo Police Galivan / Ninja Emaki / UFO Robo Dangar were accidentally left out of the last release, sorry!
  • -
  • Added driver for Twin Cobra, Flying Shark / Sky Shark / Gulf War II [iq_132]
  • -
  • Added driver for Wardner [iq_132]
  • -
  • Added driver for Taito System-L (Fighting Hawk, Raimais, Champion Wrestler, Puzznic, Kuri Kinton, Evil Stone, etc) [iq_132]
  • -
  • Added driver for Dacholer / KickBoy and Itazura Tenshi [iq_132]
  • -
  • Add driver for games on SSV hardware: Twin Eagle 2, Vasara I and II, Change Air Blade, Dyna Gear, Survival Arts, Drift Out '94, Mobil Suit Gundam Final Shooting, Ultra-X-Weapons, Storm Blade and more [iq_132]
  • -
  • Added driver for FireTrap by WoodPlace [iq_132]
  • -
  • Added driver for games on Metro hardware: Blazing Tornado, Gun Master, Pang Poms, Sky Alert, Puzzli, Mouse Shooter GoGo/Bang Bang Ball/Battle Bubble, Bal Cube, Dharma Doujou [iq_132]
  • -
  • Added driver for Bogey Manor by Technos on modified Data East hardware [iq_132]
  • -
  • Added driver for Cloak and Dagger [iq_132 w/dink]
  • -
  • Added driver for B-Wings and Zaviga [iq_132]
  • -
  • Added driver for Sigma's Submarine [iq_132]
  • -
  • Added driver for Macross Plus [iq_132]
  • -
  • Added driver for Atari's Canyon Bomber [iq_132]
  • -
  • Added driver for Gaelco's World Rally [iq_132, dink]
  • -
  • Added driver for Dream World, Cute Fighter, Baryon Future Assault, Rolling Crush, Gaia on SemiCom DreamWorld Hardware [iq_132]
  • -
  • Added driver for Puzzle Bobble 2, 3 & 4, Gunlock/Rayforce, Bubble Bobble 2 & 3, Gekirindan, Grid Seeker, Twin Cobra II, Recalhorn, Land Maker and a whole bunch more on Taito F3 hardware [iq_132, dink]
  • -
  • Added driver for Shadow Land, Dragon Spirit, Pac-Mania, Galaga '88, Splatter House and others on Namco System 1 Hardware [iq_132, dink]
  • -
  • Added driver for Fantasy Land, Galaxy Gunner and Wheels Runner [iq_132, dink]
  • -
  • Added driver for Susume! / Go Go! Mile Smile and Gyakuten! Puzzle Bancho on Fuuki 16-bit Hardware [iq_132, dink]
  • -
  • Added driver for Karate Champ by Data East [iq_132, dink]
  • -
  • Added driver for Shot Rider, Zippy Race / Traverse USA [iq_132, dink]
  • -
  • Added driver for Konami's Hyper Sports and Road Fighter [iq_132]
  • -
  • Added driver for Konami's Juno First [iq_132]
  • -
  • Added driver for Battle Cross and DodgeMan [iq_132]
  • -
  • Added driver for Shoot Out by Data East [iq_132, dink]
  • -
  • Added driver for Acrobatic Dog Fight [iq_132, dink]
  • -
  • Added driver for Tetris, Hang-On Jr. and Transformer on Sega System E hardware [vbt]
  • -
  • Added drivers for Big Striker bootlegs [iq_132]
  • -
  • Added driver for Kusayakyuu (Baseball) [iq_132]
  • -
  • Added driver for Paddle Mania and The Next Space on Alpha 68k I hardware [iq_132]
  • - -
-

New additions to existing drivers

-
    -
  • Added Mini Planets (REV02) to the Megadrive driver [dink]
  • -
  • Added Miss World 2002 [NeoGeo de Ahuizotla, Artemio Urbina, The Dumping Union, JacKc]
  • -
  • Added Eeekk!! on pacman hardware [iq_132]
  • -
  • Added Sky Robo and Tatakae! Big Fighter to the armedf driver. Thanks to CapsOff for dumping the impossible protection MCU! [dink]
  • -
  • Added Hangzo! to the DataEast Rohga driver [iq_132]
  • -
  • Added Gals Panic S2 (Europe), now its the parent [rtw, JacKc]
  • -
  • Added Samurai Shodown II (Spacial 2017) [GSC2007, JacKc, iq_132]
  • -
  • Finished emulation of early Seta games: Caliber 50, ThunderCade, Twin Eagle, DownTown, Meta Fox and Arbalester [dink]
  • -
  • Added Ken Sei Mogura: Street Fighter II (Japan 940418, Ver 1.00) [Barry]
  • - -
-

Clones and updated romsets in existing drivers

-
    -
  • Update kof98cb to 20170108 version [JacKc]
  • -
  • Replaced Mutant Night (mnight) with World version, Kawakus license now mnightj [JacKc]
  • -
  • Added clone of Burning Fight (prototype, ver 23.3, 910326) [Collin Foust, JacKc]
  • -
  • Added clone of WWF WrestleFest (World) [Hammy, The Dumping Union, JacKc]
  • -
  • Added clone of Mustache Boy (Italy) [ShouTime, JacKc]
  • -
  • Added clone of ORIENTAL SOFT 1945k III OPCX1 2000 Version (Korea) [ShouTime, JacKc]
  • -
  • Added clone of Forgotten Worlds (USA, B-Board 88618B-2, Rev. E) [Corrado Tomaselli, The Dumping Union, JacKc]
  • -
  • Added clone of Vendetta (World, 2 Players, ver. ?) [Corrado Tomaselli, The Dumping Union, JacKc]
  • -
  • Added clone of Sol Divide - The Sword Of Darkness (Korea) [Nomax, The Dumping Union, JacKc, dink]
  • -
  • Added clone of Raiden (Korea, bootleg) [Tirino73, JacKc]
  • -
  • Added clone of Real Bout Fatal Fury / Real Bout Garou Densetsu (Korean release) [Brian Hargrove, JacKc]
  • -
  • Added clone of Flicky (128k Version, 315-5051, larger roms) [system11, JacKc]
  • -
  • Added clone of Momoko 120% (English text) [Paul Hogger, JacKc]
  • -
  • Added clone of The NewZealand Story (World, old version) (older PCB) [Porchy, The Dumping Union, JacKc]
  • -
  • Added clone of Dynamite Duke (Japan, 25JUL89) [Corrado Tomaselli, The Dumping Union, JacKc]
  • -
  • Added clone of Fighting Fantasy (Japan revision ?) [Hammy, The Dumping Union, JacKc]
  • -
  • Added clone of King of the Monsters 2 - The Next Thing (older) [NeoSD, JacKc]
  • -
  • Added clone of Three Wonders (3wondersha) [Barry]
  • -
  • Added clone of The King of Fighters '99 - Millennium Battle (Korean release) [Brian Hargrove, JacKc]
  • -
  • Added clone of Deroon DeroDero (alt set) [arcademodbios, JacKc]
  • -
  • Added clone of Puzznic (US) [Coolmod, JacKc]
  • -
  • Added clone of Head Panic (ver. 0702, 02/07/1999) [hammy, Brian Troha, The Dumping Union, JacKc]
  • -
  • Added clone of Red Hawk (Greece) [Abelardator2, JacKc, iq_132]
  • -
  • Added clone of Dungeons & Dragons: Shadow over Mystara (Japan 960223) [ShouTime, Steven Fairbrother, Smitdogg, The Dumping Union, JacKc]
  • -
  • Added clone of Raiden II (Germany) [Caius, JacKc]
  • -
  • Update Samurai Shodown II Special to v1.0.0311 [GSC2007, JacKc]
  • -
  • Added clone of Street Fighter II: The World Warrior (World 910129) [Janniz, JacKc]
  • -
  • Added clone of Radical Radial (Japan) [ShouTime, JacKc]
  • -
  • Added clone of Flashgal (set 1, Kyugo logo) [Corrado Tomaselli, The Dumping Union, JacKc]
  • -
  • Added clone of Martial Masters / Xing Yi (V103, 102, 102, China) [kuze, JacKc]
  • -
  • Added clone of Rastan (World, Earlier code base) [System11, The Dumping Union, JacKc]
  • -
  • Added clone of Street Fighter II - The World Warrior (911210 Japan, rev L) [Bonky0013, The Dumping Union, JacKc]
  • -
  • Added clone of Sonic Blast Man (US) [coolmod, The Dumping Union, JacKc]
  • -
  • Added clone of Street Fighter II' - Champion Edition (UPL bootleg) [Shoutime, The Dumping Union, JacKc]
  • -
  • Added clone of Prehistoric Isle in 1930 (World, bootleg) [The Iron Goat, JacKc]
  • -
  • Added clone of Knights of Valour - Sangoku Senki (V100, Hong Kong) [Pasky Junk, JacKc]
  • -
  • Added clone of Sangokushi II: Sheng Jian Sanguo (Chinese bootleg set 4, 921005 Asia) [Unknown, Barry]
  • -
  • Sync. PGM romsets with MAME 0.184 [JacKc]
  • -
  • Added clone of Bionic Commandos (bootleg, set 2) [The Dumping Union, JacKc]
  • -
- -

v0.2.97.39

-

Fixes and new features

-
    - -
  • Shots Factory update: esc to close window, change "All Sprites" to "Layer 1" [dink]
  • -
  • Fixed Palette Viewer color issues [dink]
  • -
  • Fixed Clear and ClearLock for Analogue & Mouse in the Input Editor [dink]
  • -
  • Fixed regression in FB Alpha v0.2.97.38 for E.D.F. : Earth Defense Force (Parent and Clones) [dink]
  • -
  • Fixed graphics issues for Heavyweight Champ (Japan, FD1094 317-0046 decrypted) in SEGA System16B driver [JacKc]
  • -
  • Haunted Castle is most likely-probably fixed now (sorry!) [dink]
  • -
  • Fixed Van Van Car [dink]
  • -
  • Added nsc8105 mcu support to the m6800 cpu core [dink]
  • -
  • Fixed road issues with Turbo Outrun [Barry]
  • -
  • Added i8051 mcu core [iq_132]
  • -
  • Fixed rowscrolling issues in Caveman Ninja (tree level and ending), Joe and Mac Returns (ending), Mutant Fighter intro [dink]
  • -
  • Sync. romsets with MAME 0.175 [Barry]
  • -
  • Fixed sprite issues on the Hacha Mecha Fighter bootleg titlescreen [dink]
  • -
  • When writing an .avi, don't lose frames when F1 (ffwd) is pressed [dink]
  • -
  • Added SN76477 soundcore [dink]
  • -
  • Fixed explosions and missing SFX in Stratovox / Speak and Rescue by hooking up the SN76477 soundcore [dink]
  • -
  • Fixed sound in Porky [dink]
  • -
  • Fixed booting & DIP issues with Main Event (SNK) [dink]
  • -
  • Fixed P2 inputs in Cabal [dink]
  • -
  • Fixed Gwar (Japanese version) [dink]
  • -
  • Fixed the apple sprite in Pooyan [dink, Zazzone]
  • -
  • Fixed the music tempo in Darkseal and used this new fix for Vapor Trail and Crude Buster as well [dink, Gab75]
  • -
  • Fixed Konami's The Main Event, it had sprite and priority issues (K052109 custom) [dink]
  • -
  • Fixed Highlight mode in Sunset Riders, fix also needed by Chequered Flag [iq_132, dink]
  • -
  • Operation Wolf, allow continue by default [dink, gamezfan]
  • -
  • Added re-recording functionality [blip, dink]
  • -
  • Split avi files every 2 gig while recording to prevent corrupted video [dink]
  • -
  • Added selectable 1x, 2x and 3x pixel modes to the avi writer [dink]
  • -
  • Fixed Warriors of Fate 3rd fire button on clones [gxb]
  • -
  • Improved the speed of the search function [dink]
  • -
  • Fixed crash loading a savestate or replay while a different game is running [dink]
  • -
  • Improved desynch issues with netplay and input recording of Capcom CPS1, CPS2, PGM and certain Cave games [dink]
  • -
  • Fixed possible crash with Battle Bakraid loading a state when the game isn't running [dink]
  • -
  • Made the recording icon smaller to be less intrusive while playing games and recording inputs [dink]
  • -
  • Added an option to display joystick/button movements while playing input recordings. [dink]
  • -
  • Fixed choppy sound on music fade-outs in DoDonPachi II: Bee Storm [dink]
  • -
  • Fixed gear shifting in Continental Circus [dink, Gab75]
  • -
  • Added new feature: Shift+F1 toggles FFWD on/off [dink]
  • -
  • Temporary work-around to Data East Backfire! to prevent crash [dink]
  • -
  • Under some circumstances certain macros could not be mapped [dink]
  • -
  • Fixed "smoke" and "dust" sprites in Super Hangon [dink]
  • -
  • Fixed crash when dieing in certain situations in Bonze Adventure [dink]
  • -
  • Fixed gear shifter in Contental Circus, Chase HQ, SCI, Racing Beat, Double Axle and Top Speed [dink]
  • -
  • Fixed missing SFX and graphics glitches in Top Speed [dink]
  • -
  • Fixed the adventure world in UFO Senshi Yohko Chan [dink]
  • -
  • Fixed video issues with savestates for certain Kaneko Supernova games [dink]
  • -
  • Fixed some broken sprites in Guwange [dink]
  • -
  • Fixed the big alien in Turbo Force (revisited) [dink]
  • -
  • Allow movement of the "Scanning ROMs" window [dink]
  • -
  • Fixed remaining lives issue in Woodpecker [dink]
  • -
  • Fixed missing line of pixels at the top of the screen in Air Gallete [dink]
  • -
  • Fixed some missing samples in Seta games w/ X1-010 soundchip [dink]
  • -
  • Fixed crash issue with X1-010 soundchip and 64bit systems [dink, Gab75]
  • -
  • Fixed graphics issues in US AAF Mustang and Twin Action in the NMK16 driver [dink]
  • -
  • Fixed analog controls and shifting in Konami GT / RF2 and Hyper Crash [dink]
  • -
  • Fixed crash issue with xx-in-1 Megadrive pirate carts [dink]
  • -
  • Fixed "BAD HARDWARE" issue with Arkanoid [dink]
  • -
  • Fixed life counter in Zzyzzyxx [dink]
  • -
  • Fixed dips and possible crash issue on 64bit systems with the Seta2 hunting games [dink]
  • -
  • Fixed the HUD face icon in Warrior Blade [dink]
  • -
  • Fixed several graphics issues in Gaiapolis [dink]
  • -
  • Fixed transparent color issue in Metamorphic Force and Violent Storm [dink]
  • -
  • Added YM2610 ADPCM samplebanking support for KOF98AE [dink]
  • -
  • Fixed choppy scrolling on the left side of the screen in Blazing Star [dink]
  • -
  • Fixed minor graphic glitch in X-Men [dink]
  • -
  • Fixed Funky Bee and Sky Lancer palette issues [dink]
  • -
  • Fixed timing issues in Martial Champion, now works but with graphical issues [dink]
  • -
  • Updated the cheat engine to support more modes: Watch, Wait for Modification, Level Selection and One-Shot [dink]
  • -
  • Fixed "Break the Statue" text in Metamorphic Force and spotlight on the belly dancer in Violent Storm [dink]
  • -
  • Fixed oddly-placed black lines and opaque windows in Lethal Enforcers [dink]
  • -
  • Fixed several bugs in the Konami-scc (K051649) core [dink]
  • -
  • Updated the Quiz Olympic driver [iq_132]
  • -
  • Updated the TMS9928a vdp to a newer core/line-based version [dink]
  • -
    • -
    • Fixes Magical Tree in SG-1000
    • -
    • Fixes the Radar screen in Colecovision Defender
    • -
  • -
  • Updated the Sunset Riders protection chip emulation, fixes walking on slanted surfaces [Angelo Salese]
  • -
  • Fixed the sprite offsets in Konami's Vendetta/Crime Fighters [dink]
  • -
  • Fixed the roms of Moon Alien 2 (Older Version) [JacKc]
  • -
  • Added configurable clipping to generic tile drawing [iq_132]
  • - -
-

Clones and updated romsets in existing drivers

-
    -
  • Added clone of Street Fighter II' - Magic Delta Turbo (bootleg set 4 (with YM2151 + 2xMSM5205), 920313 etc) [f205v, maru79, JacKc]
  • -
  • Added clone of Street Fighter II' - Champion Edition (920313 etc bootleg set 3) [f205v, maru79, JacKc]
  • -
  • Added clone of Street Fighter II' - Champion Edition (920313 etc bootleg set 4) [f205v, maru79, JacKc]
  • -
  • Added clone of Street Fighter II' - Champion Edition (920313 etc bootleg set 5) [Janniz, f205v, JacKc]
  • -
  • Added clone of 1945k III (older, OPCX1 PCB) [system11, iq_132]
  • -
  • Added clone of Operation Thunderbolt (World, rev 1) [Muddymusic, The Dumping Union, JacKc]
  • -
  • Added clone of Fighting Fantasy world rev. 3 [bmcphail, JacKc]
  • -
  • Added clone of The NewZealand Story (US, old version) (older PCB) [Alex Cmaylo, The Dumping Union, JacKc]
  • -
  • Added clone of Metamorphic Force (ver AAA) [Abelardo Vidal, JacKc]
  • -
  • Added clone of Super Street Fighter II X: Grand Master Challenge (Japan 940311) [undamned, ShouTime, JacKc]
  • -
  • Added clone of Air Gallet (Europe, older) [Artemio Urbina, JacKc]
  • -
  • Added clone of New Zero Team (V33 SYSTEM TYPE_B hardware) [caius, JacKc]
  • -
  • Added clone of Teenage Mutant Ninja Turtles (US 4 Players, version H) [The Iron Goat, JacKc]
  • -
  • Added clone of Gulf Storm (Korea) to the Dooyong driver [system11, JacKc]
  • -
  • Updated The King of Fighters '99 (15th Anniversary Edition) to 20160827 Build [JacKc]
  • -
  • Updated The King of Fighters '98 (Combo/Ivex Hack) to 20161004 Build [JacKc]
  • -
  • Added clone of Street Fighter (Japan, pneumatic buttons) [ShouTime, Smitdogg, Jan Stuhler, Paul Thacker, Sean Sutton, The Dumping Union, JacKc]
  • -
  • Added 2 new Phoenix clones: Amstar Set 2 and Condor (S C Novar bootleg of Phoenix) [f205v, JacKc]
  • -
  • Added clone of Bubble Bobble: Ultra (Hack by Penta Penguin) [dink]
  • -
  • Added clone of Demon's World / Horror Story (set 2) [Sugoi Helsinki, JacKc]
  • -
  • Added clone of Teenage Mutant Ninja Turtles (Asia 4 Players, version ?) [Abelardo Vidal, The Dumping Union, JacKc]
  • - -
-

New additions to existing drivers

-
    -
  • Added Triki Triki (Lover Boy bootleg) [Rafael Alonso (from ARCADE VINTAGE), JacKc]
  • -
  • Added Mercenario (Commando bootleg) [Rockman, JacKc]
  • -
  • Added Super Street Fighter II: The Tournament Battle (Japan 931005) [ShouTime, JacKc]
  • -
  • Added Mutant Warrior ( Altered Beast Datsu bootleg) [The Dumping Union, JacKc]
  • -
  • Added Shogun Warriors (Korea?) to the Kaneko 16 driver [Barry]
  • -
  • Added Dai Makai Mura debug edition to the PCE-SGX driver [dink]
  • -
  • Added Jungler, Tactician, Commando (Sega) & Loco-Motion to the RallyX driver [dink]
  • -
  • Added Bang!, Snowboard Championship and Touch 'n Go (Korea, Unprotected) to the Gaelco2 driver [dink, iq_132]
  • -
  • Added '96 Flag Rally to the 1945kiii driver [dink]
  • -
  • Added Mega Q-Bert to the Megadrive driver [dink]
  • -
  • Added Sega Master System Brawl to the Megadrive driver [dink]
  • -
  • Added Bomb on Basic City by vetea to the Megadrive driver [dink]
  • -
  • Added Bara Buru to the Sega MasterSystem driver [dink]
  • -
  • Added Data Storm to the Sega MasterSystem driver [dink]
  • -
  • Added Deluxe 4 U and Deluxe 5 to the ESD16 driver [JacKc]
  • -
  • Added Super UWOL! SG-1000 to the SG-1000 driver [dink]
  • - -
-

New drivers

-
    -
  • Added driver for Parallel Turn [iq_132, dink]
  • -
  • Added driver for Breakthru and Darwin 4078 [iq_132, dink]
  • -
  • Added driver for Crazy Climber, Guzzler, Swimmer, River Patrol, Silver Land and Yamato [dink, iq_132]
  • -
  • Added driver for Zodiack, Mogu Chan, Dogfight, The Bounty, The Percussor. [dink]
  • -
  • Added driver for Dr. Micro [dink]
  • -
  • Added driver for Seicross, Radical Radial and Frisky Tom [iq_132]
  • -
  • Added driver for Calorie Kun [iq_132, dink]
  • -
  • Added driver for Jr. PacMan [iq_132, dink]
  • -
  • Added driver for Burger Time, Lock 'n Chase, Bump 'n Jump / Burnin' Rubber, Minky Monkey, Disco no.1 [dink, iq_132]
  • -
  • Added driver for Metal Freezer [Angelo Salese, iq_132]
  • -
  • Added driver for Fast Freddie / Fly Boy, Jump Coaster, Boggy '84, Red Robin, Imago [dink, iq_132]
  • -
  • Added driver for Heavy Unit [iq_132]
  • -
  • Added driver for Dangar, Galivan and Ninja Emaki [iq_132]
  • -
  • Added driver fot The Deep [Lucia Elia, iq_132]
  • -
  • Added driver for Zero Team 2000, New Zero Team and Raiden2DX v33 [iq_132]
  • -
  • Added driver for Chequered Flag [iq_132]
  • -
  • Added driver for Naughty Boy, Pop Flamer, Trivia Master/Genius [iq_132, dink]
  • -
  • Added driver for Cheeky Mouse [dink]
  • -
  • Added driver for Zodiack, Mogu Chan, Dogfight, The Bounty, The Percussor [dink]
  • -
  • Added driver for Jaleco's City Connection [iq_132]
  • -
  • Added driver for Phoenix & Pleiads [iq_132, dink (sound)]
  • -
  • Added driver for Syusse Oozumou [iq_132]
  • -
  • Added driver for Aeroboto / Formation Z [iq_132]
  • -
  • Added driver for Syvalion, Tetristh, Record Breaker and Dynamite League on Taito H hardware [iq_132]
  • -
  • Added driver for Track and Field / Hyper Olympic, Masters of Kin, Reaktor and Yie Ar Kung-Fu (GX361 conversion) [iq_132, dink]
  • -
  • Added driver for Gigas, Freekick, Counter Run and Perfect Billiard [vbt]
  • -
  • Added driver for MSX1-based games [dink]
  • -
  • Added driver for Konami's Ping Pong [iq_132]
  • -
  • Added driver for One + Two [iq_132]
  • -
- -

v0.2.97.38

-

Fixes and new features

-
    - -
  • Fixed BurnSamplesSetLoop() in the sample core [dink]
  • -
  • Added the Toki devlopers' debug mode to Toki [dink]
  • -
  • Added several behind-the-scene improvements to the Galaga/Dig-Dug driver [dink]
  • -
  • Fixed a crash-situation with the Namco sound-core that only seemed to affect 64bit systems [dink, Gab75]
  • -
  • Capcom CPS3 is now friendly towards slower/embedded systems (Raspberry Pi etc.) [dink]
  • -
  • Fixed Capcom's The Speed Rumber: broken Boot-up messages, random slowdowns, screen priority issues [dink]
  • -
  • Fixed music in SD Gundam Psycho Salamander [dink]
  • -
  • Fixed extra buttons in Olds [iq_132]
  • -
  • Added default rom paths for SMS & GameGear systems [dink]
  • -
  • Fixed music in Haunted Castle [dink, SNK_Dude]
  • -
  • Fixed display of total sets in game selection dialog [Barry]
  • -
  • Fixed missing tiles in Sand Scorpion due to incorrect 2-D pointer indexing in kaneko_tmap.cpp, possibly improving other games that use this. [dink]
  • -
  • Fixed missing music in Pass level 3+ [dink]
  • -
  • Fixed music tempo in Nostradamus [dink]
  • -
  • Tidy up makefiles and fix for non C++11 compilers [Barry]
  • -
  • Fixed Skyarmy, sometimes the bridge-piece chinook (heli w/2 props) doesn`t deliver the pieces when at home base. [dink]
  • -
  • Fixed Oki MSM6295 banking in Shadow Force [dink]
  • -
  • Fixed a crash issue when using savestates in Taito's Master of Weapon [dink]
  • -
  • Fixed music in Knuckle Bash 2 [dink]
  • -
  • Fixed Oops: forgot to mark Air Duel's parent as Working. [dink]
  • -
  • Fixed missing sprites in ZigZagb [dink, Zazzone]
  • -
  • Fixed endgame boss & stage 6 boss in Nostradamus [dink, Haze]
  • -
  • Fixed doorway/scene transitions in Tiger Road [iq_132]
  • -
  • Fixed graphics issues in Varia Metal [iq_132, dink]
  • -
  • Added unicode titles and service dips to several Toaplan games [BisonSAS]
  • -
  • Fixed the analog speed setting in config/games/game.ini was getting clobbered [dink]
  • -
  • Fixed sprite priority issues in Blood Brothers, most notably in the mine-level [dink]
  • -
  • Fixed music updated palette handling in Mysterious Stones [dink]
  • -
  • Fixed the bitmap layer alignment in Chak 'n Pop [dink]
  • -
  • Added the breakable-background fix to 64th Street [Haze]
  • -
  • Fixed PCM sounds in Rohga / Wolf Fang [dink]
  • -
  • Fixed crash in Shadow force in the Laboratory level when the bridge breaks apart [dink, Pityesz]
  • -
  • Fixed clicking noise when a replayed input ends [dink]
  • -
  • Fixed many Megadrive games: The Chaos Engine, Ooze, Rock 'n Roll Racing, Outrunners, Buck Rogers, Dragon Slayer I & II, Krusty's Super Funhouse, S.S. Lucifer, The Earth Defense, Super Mario Bros. and Battle City, Klax, Feng Shen Ying Jie Chuan (Chi), Tiny Toon Adventures 3, Back to the Future part III (USA), Mickey Mania and possibly others. [dink]
  • -
  • Mega Megadrive Overhaul pt.2: [dink]
  • -
    • -
    • Added support for mid-frame palette changes (For water effects in Sonic, Rocket Knight Adventures, Burning Force scrolls now..etc.)
    • -
    • Fixed audio glitches in Doom Troopers and Battle Squadron
    • -
    • Fixed Mickey Mania Moose level
    • -
    • Fixed Sonic 3D jittery SEGA logo
    • -
    • Fixed flickering in Ayrton Senna's Super Monaco GP II and Gunstar Heroes
    • -
  • -
  • Enabled Hi-Score saving in most classic/pre-90's Capcom games [dink]
  • -
  • Added 3x-sized avi output, for 720p/60hz Youtube video uploads [dink, Barry]
  • -
  • New Rotary-button feature for Midnight Resistance, Heavy Barrel, Ikari/Victory Road and other games in the new SNK 3xZ80 driver, Ikari III, SAR Search and Rescue and Jackal [dink]
  • -
    • -
    • When this button is pressed: rotary direction becomes joystick direction
    • -
  • -
  • Fixed some screen-related quirks in the legendary classic: Ambush [dink]
  • -
  • Fixed Donkey Kong III save states [dink]
  • -
  • Fixed sample engine broken since the last version of FBAlpha [dink]
  • -
  • Fixed graphics and timing issues in Gradius III [dink]
  • -
  • Fixed some issues with the cheat engine - some cheats would not disable [dink]
  • -
  • Fixed coin inputs for Kamen Riders [dink, Gab75]
  • -
  • Fixed music in Guardians / Denjin Makai II [dink]
  • -
  • Fixed music in The Punisher (change cps1 qsound cpu to proper 8mhz) [dink]
  • -
  • Fixed music in Karnov's Revenge [dink]
  • -
  • Updated lzma lib. to 15.14 [Barry]
  • -
  • Updated the libpng library to v1.6.21 [Barry]
  • - -
-

Clones and updated romsets in existing drivers

-
    -
  • Sync. romsets with current MAME [Barry, JacKc]
  • -
  • Added clone of Sengoku Ace (Japan, set 2) [Alex Cmaylo, JacKc]
  • -
  • Added clone of Final Fight US [Coolmod, JacKc]
  • -
  • Added clone of Rolling Thunder (rev 3, alternate?) [caius, JacKc]
  • -
  • Added clone of 1943 (US) [caius, The Dumping Union, JacKc]
  • -
  • Added clone of Out Run (deluxe sitdown) (Enhanced Edition v1.0.3) [JacKc]
  • -
  • Added clone of Out Run (sitdown/upright, Rev B) (Enhanced Edition v1.1.0) [JacKc]
  • -
  • Added clone of Lethal Enforcers (ver EAA, 09/09/92 09:44) [caius, JacKc]
  • -
  • Added clone of Orius (ver UAA) / clone of Xexex [Ryan Holtz, Smitdogg, The Dumping Union, JacKc]
  • -
  • Added clone of Super Street Fighter II Turbo (Hispanic 940223) [Artemio Urbina, JacKc]
  • -
  • Added clone of Ninja-Kid II / NinjaKun Ashura no Shou (set 4) [system11, JacKc]
  • -
  • Added clone of Ring of Destruction: Slammasters II (Hispanic 940902) [Raul Delgado, JacKc]
  • -
  • Added clone of Miss World 96 Nude (alt) [system11, JacKc]
  • -
  • Added clone of Double Dragon II - The Revenge (US, bootleg) [system11, JacKc]
  • -
  • Added clone of Pirates (set 2) [caius, JacKc]
  • -
  • Added clone of Street Fighter II' - Champion Edition (920313 'Taiwan' bootleg with PAL) [rtw, Smitdogg, The Dumping Union, JacKc]
  • -
  • Added clone of Strider (USA, B-Board 90629B-3, Street Fighter II conversion) [system11, JacKc]
  • -
  • Added clone of Sangokushi III Gaiden: Kakou-On's Revenge DX (hack) [system11, JacKc]
  • -
  • Added clone of Multi Game '96 (Italy) [system11, JacKc]
  • -
  • Added clone of Halfway To Hell: Progear Red label (2016-1-17 Red Label Ver) [The Halfway House, JacKc]
  • -
  • Added clone of Multi Champ (World, older) [f205v, JacKc]
  • -
  • Added clone of 1000 Miglia: Great 1000 Miles Rally (94/05/26) [caius, JacKc]
  • -
  • Added clone of 64th. Street - A Detective Story (Japan, set 2) [Corrado Tomaselli, JacKc]
  • -
  • Added clone of Donkey Kong - Arcade Rainbow (hack) [John Kowlski, JacKc]
  • -
  • Added clone of Block Block (World 911219 Joystick) [caius, The Dumping Union, JacKc]
  • -
  • Added clone of The King of Fighters '98 (Anniversary Edition 2016, EGHT hack) [EGCG 2016, JacKc]
  • -
  • Added clone of The King of Fighters '98 (Combo) to 2016/03/21 version [Ivex, JacKc]
  • -
  • Added clone of Armed Police Batrider - A Version (Hong Kong) (Mon Dec 22 1997) [Trap15, JacKc]
  • -
  • Added clone of Batsugun (Korean PCB) [Alex Cmaylo, iq_132]
  • -
  • Added clone of Last Resort (prototype) [Chris Ransley, JacKc]
  • -
  • Added clone of Moon Cresta (SegaSA / Sonic) [Roselson (from AUMAP), JacKc]
  • -
  • Added clone of Major Title 2 (World, alt sound CPU) [Mathieu Patard, JacKc]
  • -
  • Added clone of Pac-Man (SegaSA / Sonic) [A.R.P.A., JacKc]
  • -
  • Added clone of Come Come (Petaco SA bootleg of Puck Man) [Manuel Giron, JacKc]
  • -
  • Added clone of Come-Cocos (Ms. Pac-Man) ('Made in Greece' Herle SA bootleg) [Heckler, JacKc]
  • -
  • Added clone of My Hero (bootleg, 315-5132 encryption) [Andrew Welburn, JacKc]
  • -
  • Added clone of Toki (US, prototype?) [Kevin Eshbach, JacKc]
  • -
  • Added clone of Super Bishi Bashi Championship (ver KAB, 3 Players) [Skate, JacKc]
  • -
  • Added clone of Majestic Twelve - The Space Invaders Part IV (US) [Artemio Urbina, The Dumping Union, JacKc]
  • -
  • Added clone of Major Title 2 (World, set 2) [Porchy, JacKc]
  • -
  • Added clone of Atomic Robo-kid (Japan) [Alex Cmaylo, JacKc]
  • -
  • Added clone of Beast Busters (Japan, Version 2) [ShouTime, JacKc]
  • -
  • Added clone of Mystic Warriors (ver AAB) [Bill D / The Dumping Union, JacKc]
  • -
  • Added clone of Raiden DX (Japan, set 2) [Alex Cmaylo, JacKc]
  • -
  • Updated the NeoGeo driver with the latest Unibios [JacKc]
  • - -
-

New additions to existing drivers

-
    -
  • Added Fix-it Felix Jr. to the Megadrive driver [dink]
  • -
  • Added Waimanu: Scary Monsters Saga to SMS driver [dink]
  • -
  • Added Wing Force to the Kaneko16 driver [dink]
  • -
  • Added MegaCart support to the Colecovision driver [dink]
  • -
  • Added Princess Quest (MegaCart), Digger and Quest for the Golden Chalice to the Colecovision driver [dink]
  • -
  • Added T*GunII, Chase and Papi CommandoMD to the Megadrive driver [dink]
  • -
  • Added Big's Fishing Derby and Thunderbolt II to the Megadrive driver [dink]
  • -
  • Added FatalSmarties to the Megadrive driver [dink]
  • -
  • Added '96 Flag Rally to 1945kiii driver [dink]
  • -
  • Added Ozma Wars to the Space Invaders driver [iq_132]
  • -
  • Added Fire Ball (FM Work) to the Legendary Wings driver [iq_132]
  • -
  • Added Unknown Neo-Geo Vs. Fighter (prototype) [Brian Hargrove, JacKc] to the NeoGeo driver
  • - -
-

New drivers

-
    -
  • Added driver for Appoooh [vbt]
  • -
  • Added driver for Cabal [iq_132, dink]
  • -
  • Added driver for Fighting Roller [iq_132]
  • -
  • Added driver for Battle Lane [iq_132]
  • -
  • Added driver for Alligator Hunt and Maniac Square on Gaelco CG-1V/GAE1-based hardware [iq_132, dink]
  • -
  • Added driver for Ikari Warriors, Victory Road, TNK3, Guerilla War, Chopper I, Bermuda Triangle, Psycho Soldier, Athena, ASO/Alpha Mission, Fighting Golf, Jumping Cross, HAL21, Vanguard II, Mad Crasher and Marvin's Maze on SNK 3xZ80 hardware [iq_132, dink]
  • -
  • Added driver for Main Event and Canvas Croquis [iq_132]
  • -
  • Added driver for Joyful Road / Munch Mobile [iq_132]
  • -
  • Added driver for Himeshikibu and Android [iq_132]
  • -
  • Added driver for Beast Busters and Mechanized Attack [iq_132]
  • -
  • Added driver for Safari Rally [iq_132]
  • -
  • Added driver for Mr. Jong and Crazy Blocks [vbt]
  • -
  • Added driver for Lasso, Chameleon, Wai Wai Jockey Gate-In and Pinbo [iq_132]
  • -
- - -

v0.2.97.37

-
    -
  • Added clone of Contra (US / Asia, set 3) [system11, iq_132, JacKc]
  • -
  • Added several fixes for the SDL version of FBAlpha [Dmitry Smagin]
  • -
  • Fixed all SFX hard-panned to the right in Mars Matrix [dink]
  • -
  • Added Packetman bootleg [Mooglyguy, Smitdogg, The Dumping Union, iq_132]
  • -
  • Removed unused dips for Gunforce2/Geostorm [dink]
  • -
  • Fixed continious distortion in R-Type II level 4 after death while also killing an air-tank [dink]
  • -
  • Fixed TRUN bit masking (timers start/stop) in TCLS-90 CPU [Rainer Keuchel, dink]
  • -
  • Fixed PCM audio in Avengers/Buraiken [dink]
  • -
  • Fixed slight video glitchery on fade outs/cutscene/fast screen changes in Ghost 'n Goblins [dink]
  • -
  • Added clone of Gradius III (Japan, program code S, split) [system11, JacKc]
  • -
  • Added 1998 copyright Fantasia 2 version, single ROM difference [system11, JacKc]
  • -
  • Added clone of G-LOC Air Battle (World) [Arzeno Fabrice, The Dumping Union, JacKc]
  • -
  • Added 1943: The Battle of Midway (hack of Japan set) [Artemio Urbina, JacKc]
  • -
  • Correct rom labels for the Stern Electronics license of The End. [caius, JacKc]
  • -
  • Added clone of Gundhara (Chinese, bootleg?) [system11, JacKc]
  • -
  • Added clone of Bells & Whistles (Asia, Version M) [rtw, The Dumping Union, JacKc]
  • -
  • Added clone of Dunk Shot (Rev A, FD1089 317-0022) [coolmod, The Dumping Union, JacKc]
  • -
  • Added Bionic Commandos (bootleg, hack of Japan set) [TeamEurope, MikeMcBike, JacKc]
  • -
  • Added driver for Centipede and Millipede [dink]
  • -
  • Added driver for Popeye and Sky Skipper [dink]
  • -
  • Emulate mosaic-effect in Takeda Shingen / Shingen Samurai Warrior [dink, iq_132]
  • -
  • Fixed broken sprites in Mikie [dink, WILOWAR]
  • -
  • Added driver for Wiz, Kung-Fu Taikun, Scion and Stinger [vbt]
  • -
  • Added clone of Street Fighter Alpha 3 (USA 980616, SAMPLE Version) [Guru, JacKc]
  • -
  • Added driver for Mr. Do`s Castle, Do! Run Run, Mr. Do`s Wild Ride, Jumping Jack and Kick Rider [dink]
  • -
  • Added new clones for: Vigilante, Galaxy Force 2, & Super Cobra [Barry]
  • -
  • Fixed ZetRunEnd(); in the Z80 cpu interface [dink]
  • -
  • Added correct dump of VA63B.1A for Varth [Caius, The Dumping Union, JacKc]
  • -
  • Fixed sound-rom loading for Wizard Fire [Barry]
  • -
  • Added clone of Final Fight (900424 USA) [Bonky0013, JacKc]
  • -
  • Added driver for Warp Warp [dink]
  • -
  • Added clone of Oriental Legend (ver. 111, Korean Board) [Darksoft, JacKc]
  • -
  • Fixed the loud beeping noise when the little guys jump on the enemy in Zupapa [dink]
  • -
  • Improved inputs in Ladybug and Pac-Man by converting them to 4-Way mode [dink]
  • -
  • Added driver for Mirax [dink]
  • -
  • Fixed savestates in Konami's Roc 'n Rope [dink]
  • -
  • Added driver for Qbert, Qbert's Qubes, Faster Harder More Challenging Qbert and Mad Planets [dink]
  • -
  • Added driver for China Gate [iq_132]
  • -
  • Properly clone-ize the Coleco game collection [dink]
  • -
  • Some timing improvements for Gun.Smoke [dink]
  • -
  • Improved timing in Commando - fixes some sounds/SFX, and glitching sprites [dink]
  • -
  • Fixed sprite buffering in Ghosts and Goblins, fixes "jittery gravestones" when walking. Also fixed the boot-up messages [dink]
  • -
  • Fixed a sprite wrapping issue in Son Son, certain sprites would disapear when they got too close to the edge of the screen [dink]
  • -
  • Fixed and improved timing in Pirate Ship Higemaru [dink]
  • -
  • Improved timing in Nemesis & Gradius, fixes glitchy video, proper laser & missile sounds [dink]
  • -
  • Fixed broken sprites in Lethal Enforcers [dink]
  • -
  • Added Sega decrypted romsets [Barry]
  • -
  • Added driver for Chanbara [iq_132]
  • -
  • Added New parent set for Ken-Go called Lightning Swords [System11, The Dumping Union, JacKc]
  • -
  • Added Ken-Go (set 2) [caius, JacKc]
  • -
  • Improved the timing in Snow Bros. Fixes slowdowns and other timing issues notable later in the game.[dink, Zazzone]
  • -
  • Added .AVI-writer feature from FBAPlus, somewhat re-written and greatly improved. [dink, Gangta, JAVH, bms888]
  • -
  • Added clone of Wonder Stick (set 2, censored) [Any, The Dumping Union, JacKc]
  • -
  • Fixed music speed in Dingo [dink]
  • -
  • Fixed music synchronization and SFX in Caveman Ninja (timer issue) [dink]
  • -
  • Fixed PCM sample playback in the LastDuel driver [dink]
  • -
  • Fixed screen priorities in the LastDuel driver [iq_132]
  • -
  • Added good sprite dump of Led Storm 2011 Rally (US) [Guru, JacKc, iq_132]
  • -
  • Added new parent of Led Storm Rally 2011 (World) [system11, JacKc]
  • -
  • Added clone of Joe & Mac Returns (Japan, Version 1.2, 1994.06.06) [rtw, The Dumping Union, JacKc]
  • -
  • Added clone of Sonic 1-FM v1.02 for SMS - info and patches @ http://www.smspower.org/Hacks/SonicTheHedgehog-SMS-FM-Mod [dink]
  • -
  • Added Changes, Hopper Robo, Battle Cruiser M12, Hoccer and Wanted to the Marine Boy driver [dink]
  • -
  • Fixed the positional mini-map in Rygar [dink]
  • -
  • Fixed bg priorities and added volume attenuation to the flstory driver, fixes Onna Sansirou sprite issue, freeze-up at GAME OVER and missing pcm samples [dink]
  • -
  • Added Rumba Lumber to the flstory driver [dink]
  • -
  • Added driver for Konami's Jackal [iq_132, dink]
  • -
  • Fixed music, add savestate support and fix crash on exit in Dynamite Duke [dink]
  • -
  • Added driver for Taito's Super Rider [iq_132, dink]
  • -
  • Added System 2 support to the Sega System 1 driver [vbt, dink]
  • -
  • Fixed sound/music in Regulus [dink]
  • -
  • Fixed sound/music in Driftout [dink]
  • -
  • Added new NeoGeo BIOS and fixed various issues in the NeoGeo BIOS [Barry]
  • -
  • Added clone of Air Duel [dink]
  • -
  • Added clone of Forgotten Worlds (World, newer) [Bill D, The Dumping Union, Barry]
  • -
  • Added bootleg of Cadillacs and Dinosaurs to the CPS-1 driver [Barry, Bonky0013]
  • -
  • Added clone of The Punisher to the CPS-1 driver [Barry, Bonky0013]
  • -
  • Improved analog controls in Forgotten Worlds [dink]
  • -
  • Added Moggy Master and Geki oko Punpun to the Master System driver [dink]
  • -
  • Added clone of Karate Blazers (World, set 2) [caius, JacKc]
  • -
  • Added Tr-606 drumkit support to Kid Niki, Horizon, Spelunker and Spelunker II. Grab the public domain/royalty-free drumkit @ http://sharesend.com/32ux720g and throw it in "fba dir"\support\samples [dink]
  • -
  • Fixed Kabuki-Z graphics issues making the game playable [dink]
  • -
  • Fixed Kozure Ookami & Terra Force and is now fully playable. Also: Added color lookup-table feature to the sprite engine, which improves these games as well as Legion & Armed F. [dink]
  • -
  • Added Raiders5, Nova2001 & Ninja Kun to the Penguin-Kun Wars driver [vbt w/help from dink & iq_132]
  • -
  • Added Dig-Dug to the Galaga driver [dink]
  • -
  • Added Pack 'n Bang Bang to the Kaneko16 driver [dink]
  • -
  • Added driver for Sky Kid Deluxe, Hopping Mappy, The Return of Ishtar, Genpei ToumaDen, Rolling Thunder & Wonder Momo on Namcos86 hardware [iq_132]
  • -
  • Improved the sound/music in Finalizer [dink]
  • -
  • Fixed coin insertion issues in Raiden 2 / DX [dink]
  • -
  • Fixed player color in Spark Man [gamez fan]
  • -
  • Fixed palette issue with Congo Bongo [dink]
  • -
  • Enabled High score saving for a lot of classic games [dink]
  • -
  • Updated the PGM sound-core (ICS2115) thus improving sound and music on all PGM-based games [iq_132]
  • -
  • Added port of the Pokey sound-core to FBA and hooked it up to Atari Tetris [dink]
  • -
  • Added driver for Bomb Bee, Cutie Q, Gee Bee, Kaitei Takara Sagashi, Navarone, and SOS [dink]
  • -
  • Added driver for Mouser [vbt]
  • -
  • Added driver for Toki no Senshi - Chrono Soldier [vbt]
  • -
  • Added driver for UFO Senshi Yohko Chan [dink]
  • -
  • Added driver for Wonder Boy in Monster Land [vbt]
  • -
  • Added support for downloading localisation templates from the FB Alpha web-site into FB Alpha [Barry]
  • -
  • Fixed issue with Dip Switches (increased max from 4 to 8) [Barry]
  • -
  • Added compiling support for GCC 5.1.0 [Barry]
  • -
  • Added compiling support for Visual Studio 2015 [Barry]
  • -
  • Removed sample filename extensions from drivers [Barry]
  • -
  • Updated lzma lib. to 15.08 [Barry]
  • -
  • Updated the libpng library to v1.6.18 [barry]
  • -
  • Synced sets with MAME 0.167 [barry, JacKc]
  • -
- - -

v0.2.97.36

-
    -
  • Fix Time Pilot '84 palette banking. [iq_132]
  • -
  • Added clone of Pang (bootleg, set 5) [f205v, Vincenzo Femia, JacKc]
  • -
  • Added clone of Daioh (prototype) [CoolMod, trap15, iq_132]
  • -
  • Added clone of Jigoku Meguri (Japan, hack?) [Tormod, JacKc]
  • -
  • Added driver for Vastar and Planet Probe [iq_132]
  • -
  • Fixed a handfull of broken games on Sega Master System [dink]
  • -
  • Added FM sound capability to the Sega Master System, better integration and remove external dependancies [dink, Barry]
  • -
  • Added ability to use CD-Quality soundtrack from the Sega Saturn version of DonPachi [iq_132, dink]
  • -
  • Added feature to trim silence at the end of looped samples in the sample playback core [dink]
  • -
  • Small improvement to the ESP Ra.De virtual mixer [dink]
  • -
  • Added Trap15's nice sheild warning mod DIP setting for GunNail [Trap15, dink]
  • -
  • Added clone of Same! Same! Same! NEW VER! (v1.00 by Trap15) [Trap15, JacKc]
  • -
  • Added clone of Ketsui Kizuna Jigoku Tachi (Arrange Mode version 1.7 by Trap15) [Trap15, JacKc]
  • -
  • Added Alex Kidd in Radaxian Rumble, Bruce Lee, DARC, Hong kil Dong and Lambo to the SMS driver [dink]
  • -
  • Added several fixes for the SDL version of FBAlpha [Dmitry Smagin]
  • -
  • Added ZetSetSP() and fix ZetSetHL() in the z80 interface [dink]
  • -
  • Fixed Toki palette recalculation [iq_132, ArcadeTV]
  • -
  • Added more simulation to Chelnov's MCU [iq_132]
  • -
  • Fixed null file crash with T7Zipped romsets [Barry]
  • -
  • Added Metal Slug 2 - Super Vehicle-001/II Turbo(NGM-9410) (slowdown fix) [Trap15]
  • -
  • Fixed map raster effect rowscroll offset in Ninja Baseball Batman [dink]
  • -
  • Added clone of Hexion bootleg [System11, iq_132]
  • -
  • Added clone of Scramble (Centromatic S.A.) Spanish Bootleg [Manuel Giron, JacKc]
  • -
  • Added clone of Mutant Fighter (World EM-2) [Simon Dennison, JacKc]
  • -
  • Added clone of Dragon World 3 (ver. 103, Japan) [arcademodbios, JacKc]
  • -
  • Added clone of Red Hawk (Korea) [system11, JacKc]
  • -
  • Added clone of Robocop 2 (US v0.10) [Bill D, The Dumping Union, JacKc]
  • -
  • Added clone of Super Puzzle Fighter II Turbo (Euro 960529) [fluxcore, idc/Team Avalaunch, JacKc]
  • -
  • Added clone of Hot Bubble (Korea) [system11, The Dumping Union, JacKc]
  • -
  • Added clone of Thunder Deity Biography (Chinese hack of Battle Garegga) [caius, JacKc]
  • -
  • Added clone of Willow (World) [Jets (from Emu-france) and Layer (from Neo-arcadia), JacKc]
  • -
  • Added clone of Adventure Quiz Capcom World 2 (Japan 920611, B-Board 91634B-2) [Bonky, JacKc]
  • -
  • Added clone of Battle K-Road (Korean PCB) [Manuel Assoni, JacKc]
  • -
  • Added clone of X-Men (2 Players ver UAB) [Andrew Welburn, The Dumping Union, JacKc]
  • -
  • Fixed the eerie/droning background noise in Galaxian and King & Balloon [dink]
  • -
  • Fixed freeze after character selection in Oriental Legend Super [iq_132]
  • -
  • Windows 10 support [barry]
  • -
  • Updated the libpng library to v1.6.17 [barry]
  • -
  • Synced sets with MAME 0.161 [barry, JacKc]
  • -
- - -

v0.2.97.35

-
    -
  • Fixed VS Block Breaker / Saru-Kani-Hamu-Zou on Super Kakeko Nova System is now fully working/playable [dink]
  • -
  • Fixed Ken-Go on Irem m72 hardware [dink]
  • -
  • Fixed graphics glitching/screen flashing in Mr. Heli / Battle Chopper [dink]
  • -
  • Fixed bad static/clipping noise on several Neo-Geo games (Art of Fighting, Football Frenzy, etc) with FM Interpolation [dink]
  • -
  • Fixed unclear/staticy sample/instruments in all games on Irem m72 hardware [dink]
  • -
  • Fixed sound in Renegade, replacing custom ADPCM with MSM5205 [barry, Alex Jackson]
  • -
  • Reduced MSVC compiler optimisation level (fixes Tetris Plus 2 and maybe others) [barry]
  • -
  • Fixed Thunder Dragon 2 sprite priorities and missing instruments/sounds [dink]
  • -
  • Fixed background glitching in level 2 of R-Type Leo [dink]
  • -
  • Fixed Turbo Force sprite priorities [dink]
  • -
  • Fixed broken music in Hammer Away level 2+, including a fix to the rf5c68 pcm core buffer handling [dink]
  • -
  • Fixed distorted music in Air Duel after the level 1 boss [dink]
  • -
  • Fixed Karnov - broken after updating to the latest Musashi core [dink]
  • -
  • Fixed Vapor Trail running too slow (vblank timing) [dink]
  • -
  • Fixed Land Stalker (Megadrive), hang after character selection [dink]
  • -
  • Fixed SFX and music in Bucky O'Hare, improve synchronization [dink, iq_132]
  • -
  • Fixed Sega GP Rider hang at start [dink]
  • -
  • Fixed highlights in Mystic Warriors and other konamigx games [iq_132]
  • -
  • Added driver for SunA 8-bit games: Hard Head, Hard Head 2, Super Ranger, Sparkman and Star Fighter [iq_132]
  • -
  • New Game Info feature, with history.dat support, pcb, marquee, in-game, boss, marquee, flyer, pcb and more [Barry]
  • -
  • Add Aetherbyte Santatlantean to the PC Engine driver [dink]
  • -
  • Misc. Konami driver cleanups [iq_132]
  • -
  • Preserve NEC v25/v35 decode pointer on state load/save, fixes savestate issues with Ken-go and other V25/V35 games that use encryption [dink]
  • -
  • Added driver for Tecmo Bowl [iq_132]
  • -
  • Fixed MSM5205 sound in Tecmo Bowl [barry]
  • -
  • Added driver for Zaxxon, Super Zaxxon and Congo Bongo [vbt, iq_132]
  • -
  • Added Fantasy Zone Time Attack bootleg to the Sega System-16B driver [Barry]
  • -
  • Fixed Battle Bakraid crash in level 5 at the first mid-boss [dink]
  • -
  • Added Battle Garegga Zakk version [dink]
  • -
  • Added clone of Dungeons & Dragons - Shadow Over Mystara (960208 Asia) [ArcadeHacker, The Dumping Union, JacKc]
  • -
  • Fixed warped record tempo effect in Exed Exes and Vulgus [dink]
  • -
  • Fixed music and flipped screen-on-coinup issue in Terra Cresta [dink]
  • -
  • Fixed music in the game Blue Print [dink]
  • -
  • Added game Grasspin to the Blue Print driver [dink]
  • -
  • Added driver for Gulf Storm, The Last Day, Pollux, Blue Hawk, Sadari, Flying Tiger, Gun Dealer '94, Super-X, R-Shark and Pop Bingo on Dooyong hardware [iq_132]
  • -
  • Added Uncle Poo to the Jack and the Giantkiller driver [dink]
  • -
  • Added clone of Capcom World 2 (920611 Japan, alt) [Bonky0013, manimani, JacKc]
  • -
  • Added driver for Konami's Finalizer [iq_132]
  • -
  • Added clone of Battle K-Road (alternate sound) [Manuel Assoni, JacKc]
  • -
  • Slightly improved the music/sfx in Wyvern-F0 [dink]
  • -
  • Sync the Psychic5 driver romsets with MAME [JacKc]
  • -
  • Added driver for Konami's Rock 'n Rage [iq_132]
  • -
  • Added driver for Konami's Blades of Steel [iq_132]
  • -
  • Added driver for Konami's Jail Break [iq_132]
  • -
  • Added game Come Back Toto on Snow Bros. / Hyper-Pac hardware [system11, David Haywood]
  • -
  • Preserve AY8910 port handler pointers on state load/save, fixes savestate stability issues [dink]
  • -
  • Added driver for Konami's Battlantis [iq_132]
  • -
  • Fixed slowdowns/sprite flicker/crash on exit in several Dataeast Dec8 games [dink]
  • -
  • Added Birdie Try to the Dataeast Dec0 driver [gamezfan, dink]
  • -
  • Fixed the music tempo fluxuations in Vapor Trail and Crude Buster [dink]
  • -
  • Fixed mis-aligned sprite:bg layer in Vapor Trail [dink]
  • -
  • Fixed slowdowns in Air Buster [dink]
  • -
  • Improved the sound in 1942 [dink]
  • -
  • Fixed music in Pocket Gal Deluxe [dink]
  • -
  • Added driver for Konami's Labyrinth Runner / Trick Trap [iq_132]
  • -
  • Added driver for Konami's Iron Horse [iq_132]
  • -
  • Sega SG-1000 driver improvements - add games to the clone tree, fixed most non-working games [dink]
  • -
  • Hooked up Analogue steering for Konami GT, Red Force and Hyper Crash [dink]
  • -
  • Fixed lost irq state in the 68k core with savestates, fixes Gradius II's savestates [dink]
  • -
  • Added PuzzLove to the Silver Millenium driver [iq_132]
  • -
  • Added driver for Konami's Circus Charlie [iq_132]
  • -
  • Added clone of Side Arms - Hyper Dyne (US, 861202) [system11, JacKc]
  • -
  • Fixed graphics issues in Marine Boy level 4+ [dink]
  • -
  • Correct rom names for the Pang / Buster Bros. sets. [Bad A Billy, Smitdogg, Tormod, The Dumping Union, JacKc]
  • -
  • Hook up filters to Pooyan and fix music [dink]
  • -
  • Added driver for Konami's Tutanham [iq_132]
  • -
  • Added driver for Roc 'n Rope [iq_132]
  • -
  • Added driver for MegaZone [iq_132]
  • -
  • Added driver for Time Pilot/Space Pilot [iq_132]
  • -
  • Added driver for Time Pilot '84 [iq_132]
  • -
  • Fixed music, sound and sprite flickering in Gyruss [dink]
  • -
  • Standardized IRQ status and RAM/ROM mapping amongst the cpu cores [iq_132]
  • -
  • Added ability to output to MONO in the sn76496 sound core [iq_132]
  • -
  • Fixed occasional missing explosion sound trigger in Galaga [dink]
  • -
  • Added Sengoku 3 / Sengoku Densho 2001 (Evolution 1.0, FCHT hack) [JacKc]
  • -
  • Fixed the alignment of the text layer in Pac-Land [dink]
  • -
  • Added the ability to change the samplerate of the MSM6295 at any time [iq_132]
  • -
  • Added driver for Legend of Makai, P-47, Kick Off, Takeda Shingen, Ninja Kazan, Astyanax, Hachoo!, Jitsuryoku!! Pro Yakyoo, Plus Alpha, Saint Dragon, RodLand, Phantasm, Avenging Spirit, Earth Defense Force, 64th Street, Soldam, Big Striker, Chimera Beast, Cybattler, Hayaoshi Quiz Ouza Ketteisen and Peek-a-Boo! on Jaleco Megasys1 hardware [iq_132]
  • -
  • Added CPU_IRQSTATUS_HOLD (like _AUTO but with long ACK) to the Z80 interface [dink]
  • -
  • Added the Sky Army tuturial driver [iq_132]
  • -
  • Added clone of Asura Buster - Eternal Warriors (Japan) (ARCADIA review build) [ShouTime, JacKc]
  • -
  • Added clone of Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II (GAMEST review build) [ShouTime, JacKc]
  • -
  • Added driver for Sega Master System and Game Gear [dink]
  • -
  • Added blending effects to the tecmo16 driver to fix Riot's intro [iq_132]
  • -
  • Added clone of Gemini Wing (World, bootleg) [f205v, Tirino73, JacKc]
  • -
  • Added stereo capability and reset function to the SN76496 sound core [dink]
  • -
  • Added driver for Pandora's Palace on Konami GX328 hardware [iq_132]
  • -
  • Added preliminary driver for games on Alpha 68K hardware [barry]
  • -
  • Fixed various issues in the localisation templates [barry]
  • -
  • Added support to the interface for a third YM2203 [barry]
  • -
  • Added dat file support for Sega Master System and Game Gear [barry]
  • -
  • Added filter to Game Selection dialog for Game Gear [barry]
  • -
  • Updated the libpng library to v1.6.16 [barry]
  • -
  • Synced sets with MAME 0.159 [barry, JacKc]
  • -
- - -

v0.2.97.34

-
    -
  • Ported Musashi 3.32 from MAME 0.128 [barry]
  • -
  • Minor fixes to new Musashi port [dink]
  • -
  • Fixed TLCS90 core, calculate the timer period based on the clock [dink]
  • -
  • Fixed: the Z80 Vector should be reset to default on every reset Z80 Core [iq_132]
  • -
  • Fixed buzzing sounds in the DAC [iq_132]
  • -
  • Added multiple chip support to the YM3812 interface [barry]
  • -
  • Added driver for Alien Invader [iq_132]
  • -
  • Added driver for Knuckle Joe [iq_132]
  • -
  • Added driver for Mario Bros. [iq_132]
  • -
  • Added driver for Samurai Nihon-Ichi, VS Gong Fight, Mission 660, Go Go Mr. Yamaguchi, Nunchackun, and Lady Master of Kung Fu [iq_132]
  • -
  • Added driver for Capcom's Side-Arms, Turtle Ship, Dyger, Twin Falcons and Whizz [iq_132, dink]
  • -
  • Added driver for Space Invaders [iq_132]
  • -
  • Added driver for Tetris Pro. 2 [iq_132]
  • -
  • Added driver for XX Mission by UPL [iq_132]
  • -
  • Added Hammer Away to the Sega System 18 driver [barry, haze, Atro, _rm_ aka Ricardo Marques, 1up aka Daniel "casebres"]
  • -
  • Added clone of Darius to the Darius driver [barry, JacKc]
  • -
  • Added clone of Cobra Command (Japan, bootleg) to the Data East DEC8 driver [f205v, JacKc]
  • -
  • Added clone of Ninja Kid 2 - JT-104 to the Ninja Kid II driver [JacKc]
  • -
  • Added clone of Dragon World II (V100H, Hong Kong) to the PGM driver [iq_132, JacKc, rtw]
  • -
  • Added protection routines to Dragon World II (V100H, Hong Kong) in the PGM driver and marked as working [iq_132]
  • -
  • Added clone of Raiden II to the driver [rtw, Smitdogg, Kranser, Mucci, Dullaron, B2K24, The Dumping Union, JacKc]
  • -
  • Added clone of Dunk Shot to the Sega System 16B driver [JacKc, ShinobiZ & COY]
  • -
  • Added clones of Cadash to the Taito Asuka driver [ShouTime, JacKc] -
  • Added clone of Teenage Mutant Hero Turtles to the Teenage Mutant Ninja Turtles driver [JacKc, caius]
  • -
  • Added clone of Battle Bakraid - Unlimited Version (China) (Tue Jun 8 1999) to the Topalan-2 driver [JacKc, Bill D, The Dumping Union]
  • -
  • Added clone of Vigilante to the Vigilate driver [iq_132, JacKc, system11]
  • -
  • Added clone of Xain'd Sleena to the driver[f205v, JacKc]
  • -
  • Added clone of Magic Bubble to the Yun Sung 16 driver [iq_132, JacKc, caius, The Dumping Union]
  • -
  • Added prototypes of Zombie Raid to the Zombie Raid driver [JacKc, iq_132]
  • -
  • WIP: Get sound working in Donkey Kong 3 - hook up the NES APU [iq_132]
  • -
  • Fixed sprite corruption in Alien Syndrome when playing with the keyboard and up+down or left+right is pressed at the same time [dink]
  • -
  • Fixed music playback speed in Arbalester [dink]
  • -
  • Fixed occasional loud weird buzzing noise (DAC) in Armed Formation [dink]
  • -
  • Fixed ymf278b sound in Asura Buster/Asura Blade [dink]
  • -
  • Fixed Battle Shark, Space Gun and Night Striker - hang on level 2+ [dink]
  • -
  • Black Tiger and F1 Dream: Lower SFX volume so the music can be heard better, add BurnYM2203SetPSGVolume macro to burn_ym2203.h [dink]
  • -
  • Fixed colors in Cuebrick [Alex Jackson]
  • -
  • Fixed Escape Kids Crashes during the boot sequence [dink]
  • -
  • Small music mixing improvement in ESP Ra.De [the shmup kings, dink]
  • -
  • Fixed choppiness in Gaiapolis on older pc's [dink]
  • -
  • Fixed Gradius 3 in 16-bit color modes [Gamez Fan, iq_132]
  • -
  • Fix misc. timing issues with Gradius 3 that appeared after the introduction of the new Musashi 68k core [barry, dink]
  • -
  • Fixed Drumroll fade-in in Gradius 3 [dink]
  • -
  • Fixed gun inputs in Konami's Lethal Enforcers, add a hack/gun-reload button [dink]
  • -
  • Fixed Layer alignment in Metamorphic Force, it improves the intro and first boss graphical effects [iq_132]
  • -
  • Fixed Moo Mesa and Xexex music out-of-key at 44100hz sample rate [dink]
  • -
  • Fixed the ear-piercing sounds in Nostradomus and Magical Cat Adventure [dink]
  • -
  • Fixed too much slowdown in Nostradamus, needs a little helping boost [dink]
  • -
  • Fixed Operation Thunderbolt: gunshot sfx can only be heard in the left speaker [dink]
  • -
  • Fixed music tempo/warped-record effect in Pang [dink]
  • -
  • Fix Psychic 5 default DIP settings [dink]
  • -
  • Fixed FB Alpha GFX Loading routine for Punch-Out!! and added correct color PROMs set for Super Punch-Out (Japan)!! [JacKc] -
  • Fixed Sand Scorpion won't boot after Raiden II/DX [dink]
  • -
  • Fixed crash in Soko Nuke [dink]
  • -
  • Fixed graphical issues/corruption in Konami's Special Project Y (spy) [iq_132]
  • -
  • Fixed flickering status for players 2, 3 and 4 in Sunset Riders [dink]
  • -
  • Fixed Surprise Attack by Konami now runs at the right speed [dink]
  • -
  • Fixed music tempo/warped record effect in Trojan, Avengers, Section-Z, fix PCM/MSM5205 samples in Trojan [dink]
  • -
  • Fixed the sounds in Konami's Yie Ar Kung-Fu and Mikie - some SN76489A soundchip commands were getting skipped because the chip updates needed to be interlaced [dink]
  • -
  • Fixed Double Dragon II on Megadrive [dink]
  • -
  • Fixed Gargoyles and Ex-Mutants in Megadrive (TAS Callback with new Musashi) [barry]
  • -
  • Add Oh Mummy and Lego Batman to Megadrive, fix crash on Z80 <-> 68K communications [dink]
  • -
  • Fixed more Megadrive games where PAL auto-detection fails, if you already have settings saved for these games, then set dips to default in the dialog [JacKc]
  • -
  • Fixed crash in Samurai Showdown 5 and Garou with Alpha blend effects enabled [dink]
  • -
  • New feature: auto-hide crosshair after 4 seconds for lightgun games [dink]
  • -
  • Added 8x8 .blde support to Neo-Geo [iq_132]
  • -
  • Added Alpha Blending/Transparency support to PGM - supports Nebula/Kawaks-style blend (.bld) files [iq_132]
  • -
  • Misc. documentation updates to Neo-Geo driver [JacKc] -
      -
    • Identified and documented more sets (MVS and AES version) with different Cx and/or Px layout
    • -
    • Added redumped p1/p2 to fightfeva [DsNo]
    • -
    • s1 redump by DsNO has one byte diff at 0: 00 11 compared to MAME dump (probably a bitrot)
    • -
  • -
  • Updated the libpng library to v1.6.15 [barry]
  • -
  • Synced sets with MAME 0.156 [barry, JacKc]
  • -
- - -

v0.2.97.33

-
    -
  • Added driver for Sand Scorpion (this was actually in last release but missed the what's new) [iq_132]
  • -
  • Added hack of Samurai Shodown V to the Neo Geo driver [iq_132, JacKc]
  • -
  • Fixed collisions in Zero Team, game is now working and enabled in release builds [gamez fan, dink]
  • -
  • Note: Zero Team, Raiden II and Raiden DX need the insert-coin button to be held down a little longer than usual
  • -
  • Fixed sound in Shaolins Road driver [dink]
  • -
  • Fixed tilemap scrolling in Shaolins Road driver [barry]
  • -
  • Fixed service mode in Violent Storm [iq_132]
  • -
  • Fixed some Megadrive games where PAL auto-detection fails, if you already have settings saved for these games, then set dips to default in the dialog (Comix Zone, Jimmy White's Whirlwind Snooker, and Robocop v Termininator) [barry]
  • -
  • Fixed bug with incomplete translation templates [barry]
  • -
- - -

v0.2.97.32

-
    -
  • Added proper saving of cpu registers/variables to M6800/6801/6803/HD63701 core [dink]
  • -
  • Added support for NMK004. Special thanks to Trap15! [Trap15, Haze, iq_132]
  • -
  • Standardized CPU related functions [iq_132]
  • -
  • Fixed delta calculation and proper sample size checking in the MSM6295 core, fixes missing samples in some NMK004 games (and possibly others) [dink]
  • -
  • Fixed mixing distortion/crackles in K054539 sound core [dink]
  • -
  • Improved the quality of the voice samples in the K053260 sound core (The Simpsons and possibly other Konami games) [AWJ]
  • -
  • Added driver for DJ Boy [iq_132]
  • -
  • Added driver for Konami's Asterix [iq_132]
  • -
  • Added driver for Konami's Bishi Bashi and Super Bishi Bashi Championship Minigames[iq_132]
  • -
  • Added driver for Konami's Dragonball Z and Dragonball Z 2 - Super Battle hardware [iq_132]
  • -
  • Added driver for Konami's G.I. Joe [iq_132]
  • -
  • Added driver for Konami's Lethal Enforcers [iq_132]
  • -
  • Added driver for Konami's Mystic Warriors (and other games on the hardware) [iq_132]
  • -
  • Added driver for Konami's Shaolins Road [iq_132]
  • -
  • Added driver for Konami's Wild West C.O.W.-Boys of Moo Mesa and Bucky O'Hare [iq_132]
  • -
  • Added driver for Konami's Yie-Ar Kung Fu [iq_132]
  • -
  • Added driver for Konami's Xexex [iq_132]
  • -
  • Added driver for Raiden II, Raiden DX, X Se Dae Quiz and Zero Team [iq_132]
  • -
  • Added driver for Colecovision games [iq_132, dink]
  • -
  • Added driver for Sega SG-1000 games [iq_132, dink]
  • -
  • Added Shogun Warriors and B.Rap Boys to Kaneko16 driver [iq_132]
  • -
  • Added Candory (James Greenhalgh) to the Pacman driver [iq_132]
  • -
  • Added bootleg of Street Fighter II - The World Warrior to the Capcom CPS-1 driver [barry, any, JacKc]
  • -
  • Added bootleg of Varth to the CPS-1 driver [Barry, Caius]
  • -
  • Added clone of 19XX: The War Against Destiny to the Capcom CPS-2 driver [system11, The Dumping Union, JacKc]
  • -
  • Added clone of Mega Man: The Power Battle to the Capcom CPS-2 driver [Asure, JacKc]
  • -
  • Added clone of Super Street Fighter II: The New Challengers to the Capcom CPS-2 driver [palindrome, JacKc]
  • -
  • Added clone of Secret Agent to the DataEast driver [ShouTime, The Dumping Union, JacKc]
  • -
  • Added hack of Donkey Kong to the Donkey Kong driver [Clay Cowgill, JacKc]
  • -
  • Added clone of Fantasia to the Gals Panic [system11, JacKc]
  • -
  • Added clone of The Simpsons to the Konami Simpsons driver [Ben76, JacKc]
  • -
  • Added clone of Vendetta to the Konami Vendetta driver [caius, JacKc]
  • -
  • Added hack of The King Of Fighters '98 to the Neo Geo driver [JacKc]
  • -
  • Added hack of The King of Fighters '99 to the Neo Geo driver [JacKc]
  • -
  • Added hack of The King Of Fighters 2000 to the Neo Geo driver [JacKc]
  • -
  • Added clone of Robo Army to the Neo Geo driver [JacKc]
  • -
  • Added clone of Search Eye to the NMG5 driver [system11, The Dumping Union, JacKc]
  • -
  • Added clone of Ms. Pac-Man to the Pacman driver [elnaib (AUMAP), JacKc]
  • -
  • Added clone of Oriental Legend / Xi You Shi E Zhuan to the PGM driver [bytestorm, JacKc]
  • -
  • Added clone of Bonze Adventure (World, Prototype) to the Taito Asuka driver [Silvio Grazini, iq_132]
  • -
  • Added clone of Growl to the Taito F2 driver [barry]
  • -
  • Added clone of Jumping to the Taito Misc driver [barry]
  • -
  • Added clone of F-1 Dream to the Tiger Road driver [JacKc]
  • -
  • Added clone of Dr. Toppel's Adventure to the TNZS driver [caius, f205v, JacKc]
  • -
  • Added The Mojon Twins': UWOL Quest for Money to the Megadrive driver [dink]
  • -
  • Added SMB4MD 1.4.2 aka Super Mario Bros. port to the Megadrive driver [dink]
  • -
  • Added Atherbyte's Reflectron to the PCEngine driver [dink]
  • -
  • Added proper protection simulation to 1943 [iq_132]
  • -
  • Fixed The Irritating Maze [iq_132, JacKc]
  • -
  • Fixed boblbobl2 [Darq, iq_132]
  • -
  • Fixed Tail2Nose [iq_132]
  • -
  • Fixed and tweaked IREM M92 driver to get Ninja Baseball Batman running perfectly [iq_132, dink]
  • -
  • Fixed IRQ timing in Mustache Boy, now he runs at the right speed [dink]
  • -
  • Fixed skewed backgrounds in In the Hunt on IREM M92 [dink]
  • -
  • Fixed Kero Kero Keroppi's Let's Play Together (USA) [csmart, iq_132]
  • -
  • Fixed Robocop 2 Driving level and sprite offset [iq_132, dink]
  • -
  • Improvements to Data East's BackFire in single-screen mode [iq_132]
  • -
  • Konami driver-update - fixed sprite-priority problems and clipping. Added shadows. Affects Vendetta, Escape Kids, TMNT2 and more [iq_132]
  • -
  • Fix sprite flipping in the Konami K053247 core [iq_132]
  • -
  • Fixed text layer in Kotetsu Yousai Strahl [iq_132]
  • -
  • Fixed flickering score and player status in Sunset Riders [dink]
  • -
  • Fix statusbar and power-up message clipping in Bioship Paladin [dink]
  • -
  • NMK16 driver fixups: missing score line in tdragon, hachamfb and VanDyke, clipped text in Strahl [dink]
  • -
  • Tweaked the IRQ timing in the NMK16 driver to fix the Life-bar in VanDyke [dink]
  • -
  • Fixed missing top line in the game statusbar for Acrobat Mission, Air Attack, S.S. Mission (NMK16) [dink]
  • -
  • Fix and hook-up the seibusound device to the NMK16 bootlegs Thunder Dragon (tdragonb) and US AAF Mustang (mustangb) [iq_132]
  • -
  • Fixed missing sound in Galaga and Rally-X [barry]
  • -
  • Fixed music tempo in Raiden [iq_132, dink]
  • -
  • Fixed music in Air Duel on IREM M72 Hardware [dink]
  • -
  • Fixed sound in Dragon Master [iq_132]
  • -
  • Fixed clicks when firing and slow music tempo in S.S. Mission [dink]
  • -
  • Fixed Dolmen and Twin Action: sound banking issues (music disappears on level2+) [dink]
  • -
  • Fixed occasional hung sound in Green Beret [dink]
  • -
  • Added proper Seibu Sound device to Toki [iq_132]
  • -
  • Fixed sound panning in Cyber Tank [dink]
  • -
  • Updated kof99ae driver to 20140801 version [JacKc]
  • -
  • Megadrive timing and other improvements [barry, dink]
  • -
  • Megadrive window drawning fix (missing line in Streets of Rage) [barry]
  • -
  • Fixed Psy-O-Blade on Megadrive [iq_132]
  • -
  • Added protection patch for Puggsy on Megadrive [dink]
  • -
  • Fixed Megadrive Ghouls`n Ghosts (Euro, USA, Kor, Rev. A) (md_ghouls) and Ghouls`n Ghosts (Euro, USA) (md_ghouls1) [dink]
  • -
  • Fixed X-Men 2 and Moonwalker on Megadrive [dink, Freddy]
  • -
  • Fixed Alien Soldier (PAL) on Megadrive won't boot, is wrongly detected as NTSC [dink]
  • -
  • Fixed broken reset with some Megadrive games, get rid of the garbage line at the bottom of the screen [dink]
  • -
  • PCEngine sound-core and timing improvements [dink, barry]
  • -
  • Increased screen size by 2 pixels for PCEngine Side-Arms Hyperdyne [dink]
  • -
  • Fixed savestates for IREM M62 Hardware - Kung-Fu Master, The Battle Road, Lode Runner I - IV, LotLot, Kid Niki, Spelunker, Youjyuden and Horizon [dink]
  • -
  • Fixed savestates for Pac-Land, Sky Kid, Dragon Buster [dink]
  • -
  • Fixed savestates and Music for Baraduke, Alien Sector and Metro-Cross [dink]
  • -
  • Added more powerful BurnLoad function for loading roms [iq_132]
  • -
  • Added Alpha Blending/Transparency support to Neo Geo, CPS-1 and CPS-2 - supports Nebula/Kawaks-style blend (.bld) files [iq_132]
  • -
  • Added user configurable path for blend files and global enable/disable option [barry]
  • -
  • Added a shiny new Auto-Fire feature! [dink]
  • -
  • Input editor feature: clear input and clear-lock checkbox [dink]
  • -
  • Added option to disable support folder creation on creation [barry]
  • -
  • Added default rom paths for consoles to the folder creation startup routine [JacKc, barry]
  • -
  • Savestate Undo improvement: display an error message if there is nothing to be undone, don't undo the last savestate [dink]
  • -
  • Added ability to input-map Pause, FFWD, Save/Load/Undo States [dink]
  • -
  • Game selection dialog search box can now search hardware/system text (eg, NMK) [dink]
  • -
  • Tidy-up source code fixing compile warnings and portability issues [barry]
  • -
  • Updated the libpng library to v1.6.13 [Barry]
  • -
  • Synced sets with MAME 0.155 [barry, JacKc]
  • -
- - -

v0.2.97.31

-
    -
  • Added driver for Psychic 5 [Barry, iq_132]
  • -
  • Added clone of Toki to the driver [JacKc]
  • -
  • Preliminary savestate support for the Megadrive driver [dink]
  • -
  • Fixed an issue with the Enhanced D3D blitter [dink]
  • -
- - -

v0.2.97.30

-
    -
  • Ported K005289 sound core from MAME [iq_132]
  • -
  • Ported MSM5232 sound from MAME and updated Fairyland Story to use it [iq_132]
  • -
  • Fixed mixing in the MSM5232 core [Barry]
  • -
  • Ported NES APU core from MAME [iq_132]
  • -
  • Ported T5182 device from MAME [iq_132]
  • -
  • Ported TMS34061 video chip from MAME [iq_132]
  • -
  • Ported VLM5030 sound core from MAME [iq_132]
  • -
  • Added support for new modules to debug tracking [Barry]
  • -
  • Fixed interpolation for the YM2203 interface [Barry, dink]
  • -
  • Fixed a pointer overwrite issue in the M68K driver on savestate load [dink]
  • -
  • Fixed blank game screen when the system returns from Hibernation [dink]
  • -
  • Fixed loss of Music & SFX on savestate load with games using the YM2151 sound chip [dink]
  • -
  • Fixed savestates with multiple chips and fix for setting singular channel volume in K007232 core [dink, iq_132]
  • -
  • Fixed savestates in Irem GA20 sound core [iq_132]
  • -
  • Fixed bug in generic sprite zoom drawing routines [iq_132]
  • -
  • Fixed idle skip (timers) & crash with FAST_OP_FETCH in SH-2 CPU core [dink]
  • -
  • Added driver for Choplifter (unprotected, working) and Choplifter (bootleg, working) to Sega System1 (Parent ROM NW) [vbt]
  • -
  • Added driver for Mighty Warrior, Steel Force & Twin Brats on Elettronica Video-Games S.R.L hardware [iq_132]
  • -
  • Added driver for Capcom Bowling [iq_132]
  • -
  • Added driver for Fire Barrel/Air Assault, Dream Soccer '94, Kick for the Goal & World PK Soccer on Irem M107 hardware [iq_132]
  • -
  • Added driver for The Lost Castle In Darkmist [iq_132]
  • -
  • Added driver for Mikie/Shinnyuushain Tooru-kun (Konami) [iq_132]
  • -
  • Added driver for Mustache Boy [iq_132]
  • -
  • Added driver for Nemesis/Gradius, Salamander/Lifeforce, Twinbee, Galactic Warriors, Konami GT, Red Fighter, Black Panther, City Bomber, Kitten Kaboodle/Nyan Nyan Panic & Hyper Crash on Konami GX400 hardware [iq_132]
  • -
  • Added driver for Punch Out [iq_132]
  • -
  • Added driver for Kaneko Super Nova hardware (Cyvern, Sengeki Striker, Puzzloop, Guts'N, Jan Jan Paradise 1 & 2, Sen-Know, VS. Block Breaker) [iq_132, dink]
  • -
  • Added driver for Tail 2 Nose [iq_132]
  • -
  • Added driver for Wyvern F-0 [iq_132]
  • -
  • Added driver for Xain'd Sleena/Solar Warrior [iq_132]
  • -
  • Added driver for Exzisus (Taito) [iq_132]
  • -
  • Added driver for Ninja-Kid II, Mutant Night, Ark Area, Atomic Robo-kid, Omega Fighter & Omega Fighter Special on UPL Hardware [iq_132]
  • -
  • Added TLCS90 CPU Core [iq_132]
  • -
  • Hooked-up the TLCS90 audiocpu core to Arcadian/Rapid Hero enabling Music & SFX [iq_132]
  • -
  • Enable stereo Music & SFX in Thunder Cross 2 by default (delete your old config/games/thndrx2.nv, if available) [iq_132 & dink]
  • -
  • Updated the protection emulation for Uballoon and Alien Challenge [iq_132]
  • -
  • Added Crouching Poney Hidden Dragon (DEMO) (Le Cortex) to the Neo Geo driver [iq_132, JacKc]
  • -
  • Added SDI - Strategic Defense Initiative (Japan, old, System 16A, FD1089B 317-0027) [JacKc]
  • -
  • Added Dolem to the NMK16 driver [iq_132]
  • -
  • Fixed PCB version of Spectral vs Generation [iq_132, rtw, David Haywood]
  • -
  • Added bootleg of 1942 to the driver [JacKc]
  • -
  • Added clone of 4 En Raya to the driver [JacKc, Unigame]
  • -
  • Added clone of Black Tiger to the driver [JacKc, Bonky0013, iq_132]
  • -
  • Added clone of Bubble Bobble to the driver [JacKc, Bisboch and Aladar]
  • -
  • Added clone of Commando to the driver [JacKc, Kevin Eshbach]
  • -
  • Added clone of Crude Buster to the driver [JacKc, system11]
  • -
  • Added bootleg of Cadillacs and Dinosaurs to the CPS-1 driver [JacKc, Bonky0013, The Dumping Union]
  • -
  • Added clone of Final Fight to the CPS-1 driver [JacKc, Smitdogg, The Dumping Union]
  • -
  • Added bootleg of Final Fight to the CPS-1 driver [JacKc]
  • -
  • Added clone of Nemo to the CPS-1 driver [muddymusic]
  • -
  • Added clone of Street Fighter II to the CPS-1 driver [JacKc, Tormod, Layne, Smitdogg, The Dumping Union]
  • -
  • Added clone of Street Fighter II to the CPS-1 driver [JacKc, Yohji, Kevin Eshbach, bodger319, Smitdogg, The Dumping Union]
  • -
  • Added clone of Street Fighter II to the CPS-1 driver [JacKc, Kevin Eshbach, Bill D., Layne, Smitdogg, The Dumping Union]
  • -
  • Added clone of Street Fighter II to the CPS-1 driver [JacKc, Any, The Dumping Union]
  • -
  • Added clone of Street Fighter II - champion edition to the CPS-1 driver [JacKc, Andrew Welburn, The Dumping Union]
  • -
  • Added clone of Street Fighter II - champion edition to the CPS-1 driver [JacKc, iq_132, Barry]
  • -
  • Added clone of Street Fighter II - champion edition to the CPS-1 driver [JacKc, Drakon]
  • -
  • Added clone of Street Fighter II - champion edition to the CPS-1 driver [JacKc, Barry, any]
  • -
  • Added clone of Street Fighter II - champion edition to the CPS-1 driver [JacKc, any]
  • -
  • Added bootleg of 1944 - the loop master to the CPS-2 driver [JacKc]
  • -
  • Added rent version of 19XX to the CPS-2 driver [Barry, JacKc, Tormod]
  • -
  • Added clone of Armored Warriors to the CPS-2 driver [JacKc, system11, The Dumping Union]
  • -
  • Added bootleg of Cyberbots: Fullmetal Madness to the CPS-2 driver [JacKc, Yohji, Smitdogg, The Dumping Union]
  • -
  • Added clone of Dungeons & Dragons: Tower of Doom to the CPS-2 driver [JacKc, tormod, The Dumping Union]
  • -
  • Added bootleg of Mighty! Pang to the CPS-2 driver [JacKc]
  • -
  • Added clone of Street Fighter Alpha to the CPS-2 driver [JacKc, Smitdogg, The Dumping Union]
  • -
  • Added clone of X-Men Vs. Street Fighter to the CPS-2 driver [JacKc, Smitdogg, The Dumping Union]
  • -
  • Added clone of Street Fighter III to the CPS-3 driver [JacKc, Layne, Smitdogg, The Dumping Union]
  • -
  • Added clone of Street Fighter III to the CPS-3 driver [JacKc, Smitdogg]
  • -
  • Added clone of Street Fighter III to the CPS-3 driver [JacKc, Bonky0013]
  • -
  • Added bootleg of Robocop to the DEC-0 driver [JacKc, any]
  • -
  • Added clone of Donkey Kong to the driver [JacKc, Matt Ziolkowski, Rob Rings]
  • -
  • Added clone of Donkey Kong Jr to the driver [JacKc, Chris Psaros]
  • -
  • Added clone of Funky Jet to the driver [JacKc, Arzeno Fabrice, The Dumping Union]
  • -
  • Added clone of Dragon Bowl to the Gaiden driver [iq_132, JacKc]
  • -
  • Added clone of Galaxian to the driver [JacKc, DamagedGoods]
  • -
  • Added clone of Galaxian to the driver [JacKc, Roselson from AUMAP]
  • -
  • Added bootleg of Scramble to the Galaxian driver [JacKc, Basilio Garcia]
  • -
  • Added clone of Fantasia to the Gals Panic driver [JacKc, system11]
  • -
  • Added two clones of Miss World '96 (Nude) to the Gals Panic driver [JacKc, system11]
  • -
  • Added clone of New Fantasia to the Gals Panic driver [JacKc, system11]
  • -
  • Added two clones of Gals Hustler to the Gals Panic driver [iq_132]
  • -
  • Added bootleg of Gun Smoke to the driver [JacKc, Felipe Sanches]
  • -
  • Added clone of Cookie & Bibi to the Hyper Pacman driver [JacKc, any, David Haywood]
  • -
  • Added bootleg of Snow Bros. to Hyper Pacman driver [Barry, JacKc, The Dumping Union, David Haywood]
  • -
  • Added clone of Ikari III to the Ikari III driver [JacKc, DsNo, jysx012]
  • -
  • Added clone of Bomber Man World to the Irem M90 driver [JacKc, Artemio Urbina, The Dumping Union]
  • -
  • Added clone of The Berlin Wall to the Kaneko 16 driver [JacKc, system11]
  • -
  • Added clone of Trojan to the Legendary Wings driver [JacKc, any]
  • -
  • Added clone of Pang to the Mitchell driver [JacKc, any]
  • -
  • Added clone of Last Blade to the Neo Geo driver [JacKc]
  • -
  • Added support for Universe BIOS 3.1 to the Neo Geo driver [Razoola, iq_132, Jackc]
  • -
  • Added clone of Multi 5 / New Multi Game 5 to the NMG5 driver [JacKc, system11]
  • -
  • Added clone of Guardian Storm to the NMK16 driver [JacKc, Shoutime]
  • -
  • Added clone of Rapid Hero to the NMK16 driver [Barry, JacKc, Brian Troha, system11]
  • -
  • Added clone of Spectrum 2000 to the NMK16 driver [iq_132]
  • -
  • Added clone of Pacman to the Pacman driver [JacKc, AUMAP]
  • -
  • Added clone of DoDonPachi Dai-Ou-Jou to the PGM driver [JacKc, djvinc]
  • -
  • Added clone of Happy 6-In-1 to the PGM driver [JacKc, rtw, iq_132]
  • -
  • Added clone of Ketsui Kizuna Jigoku Tachi to the PGM driver [JacKc, Artemio Urbina]
  • -
  • Added clone of Knights of Valour Super Heroes Plus / Sangoku Senki Super Heroes Plus to the PGM driver [JacKc, XingXing]
  • -
  • Added clone of Knights of Valour: Quan Huang San Guo Special / Sangoku Senki: Quan Huang San Guo Special to the PGM driver [JacKc]
  • -
  • Added clone of Knights of Valour 2 - Nine Dragons to the PGM driver [JacKc, 69mustang, iq_132]
  • -
  • Added clone of Excelsior to the Playmark driver [JacKc, Bonky0013, The Dumping Union]
  • -
  • Added clone of Bouncing Balls to the Pushman driver [JacKc, system11, The Dumping Union]
  • -
  • Added clone of Fire Shark to the Same Same driver [JacKc, ShouTime, The Dumping Union]
  • -
  • Added bootleg of Altered Beast to the Sega System 16B driver [Barry]
  • -
  • Added clone of Altered Beast to the Sega System 16B driver [JacKc, Chris Hardy, Andreas Naive]
  • -
  • Added clone of Cotton to the Sega System 16B driver [JacKc, Charles MacDonald, ShouTime, The Dumping Union]
  • -
  • Added clone of Dynamite Dux to the Sega System 16B driver [Barry, JacKc]
  • -
  • Added clone of E-Swat to the Sega System 16B driver [Barry, JacKc]
  • -
  • Added clone of Out Run to the Sega Out Run driver [JacKc]
  • -
  • Added clone of Turbo Out Run to the Sega Out Run driver [JacKc, Charles MacDonald, ShouTime, The Dumping Union]
  • -
  • Added clone of After Burner II to the Sega X-Board driver [JacKc, Andrew Welburn, The Dumping Union]
  • -
  • Added clone of Strike Fighter to the Sega Y-Board driver [JacKc, ShouTime, The Dumping Union]
  • -
  • Added Yukiwo to the Taito B driver [iq_132, Unigame, David Haywood, JackC]
  • -
  • Added clone of Cadash to the Taito F2 driver [JacKc, Unigame]
  • -
  • Added clone of Chase HQ to the Taito Z driver [JacKc, any]
  • -
  • Added clone of Enforce to the Taito Z driver [JacKc, Barry]
  • -
  • Added clone of Racing Beat to the Taito Z driver [JacKc, ShouTime]
  • -
  • Added two bootlegs of World Cup '90 to the driver [JacKc, any]
  • -
  • Added clone of Zero Wing to the driver [JacKc, System11, The Dumping Union]
  • -
  • Added clone of Double Dragon II - The Revenge (bootleg) to the Double Dragon driver [Barry]
  • -
  • Added clone of Saulabi Spirits / Jin Saulabi Tu Hon (Korean release of Samurai Shodown II, set 2) from Winkawaks 1.63 [JacKc]
  • -
  • Added clone of Passing shot: Center Court (prototype, MC-8123B) to the Sega 16B driver [Alan Meades, Porchy, JacKc]
  • -
  • Added clone of The King of Fighters '96 (Anniversary Edition 2.0.0296, EGHT hack) to the Neo Geo driver [JacKc]
  • -
  • Fixed Gauntlet by going back to the previous Slapstic implementation [Barry]
  • -
  • Fixed crash in Oriental Legends Super intro [iq_132]
  • -
  • Updates to PGM protection routines [iq_132, rockywall, Creamy Mami, JacKc, iq_132]
  • -
  • Various PGM updates/fixes [iq_132]
  • -
  • CPS-3 sound updates [iq_132, Captain CPS-X]
  • -
  • Small improvement to the MSM6295 core [iq_132]
  • -
  • Various sound clipping fixes [dink]
  • -
  • Sound tweaks/improvements for Legendary Wings, Armed Formation & Puzzle de Bowling [dink]
  • -
  • Updated the YMF278b soundchip driver, notably improving the Music & SFX in Tengai [dink]
  • -
  • Small update to FM.C sine initialization table improves the clarity of some FM sound emulations [dink]
  • -
  • Fixed clipping/distortion with PCM sample playback in Enduro Racer [dink]
  • -
  • Moved the YM2608 internal ROM to an external file (ym2608.zip) [Barry]
  • -
  • PC Engine update [iq_132]
  • -
  • Fixed Battle Garegga savestate load crash [dink]
  • -
  • Fixed sound desync in Tengai and tile corruption in Samurai Aces on savestate load [dink]
  • -
  • Added savestate capability to Irem M72 driver - R-Type, R-Type II, Ninja Spirit, Mr. Heli, X-Multiply, Dragon Breed, Hammerin' Harry, Cosmic Cop, Legend of Hero Tonma, Air Duel [dink]
  • -
  • Fixed savestate load crash for Aero Fighters, Sonic Wings, Turbo Force, Spinal Break and Karate Blazers [dink]
  • -
  • Fxied savestate load crash for Raiden [dink]
  • -
  • Added savestate capability to NMK16 driver - Bombjack Twin, Thunder Dragon 2, Twin Action, US AAF Mustang, Stagger (RedHawk), Guardian Storm, Fire Hawk, GunNail, Saboten Bombers, Super Spacefortress Macross [dink]
  • -
  • Added savestate capability to Kangaroo driver [dink]
  • -
  • Fixed palette issues on savestate load with DataEast Act Fancer [dink]
  • -
  • Fixed stuck noise at the end of short samples in games that use the Toaplan samples hack. FireShark, SameSameSame!, Ghox, Vimana and TekiPaki [dink]
  • -
  • Fixed Toaplan samples hack and savestates, and added loading samples status [dink]
  • -
  • SFX lost after savestate load in NMK004 games, Super Spacefortress Macross and possibly others [dink]
  • -
  • Probable fix for Toaplans FixEight hang on savestate load [dink]
  • -
  • Various NMK16 fixes [dink]
  • -
  • Fixed crash on savestate load for Visco/Taito Galmedes [dink]
  • -
  • New gun rotation method for Heavy Barrel and Midnight Resistance & fix for Heavy Barrel level transistion after level 2 [dink]
  • -
  • Fixed savestates for games that use the SN76496 soundchip [dink]
  • -
  • Fixed savestates for Pacman S2650 games [dink]
  • -
  • Fixed savestate load crash and sound/music volume in The New Zealand Story new pcb [dink]
  • -
  • Fixed speed issue in Contra [dink]
  • -
  • Fixed tilemaps in Contra [Barry]
  • -
  • Fixed Ash No Joe save states [iq_132]
  • -
  • Fixed The New Zealand savetates [dink]
  • -
  • Reorganised some inputs to support kaillera (Contra, Double Dragon I - III, TMNT, Sunset Riders, M.I.A., Green Beret) [dink]
  • -
  • Windows savestate enhancements - shift-F8 for savestate undo, 10 levels of undo for each slot [dink]
  • -
  • Show savestate messages (prev/next slot, load & save) while paused [dink]
  • -
  • Fix savestates for YM2151, UPD7759 and clipping/distortion in UPD7759 [dink]
  • -
  • Added savestate support to Toki driver [dink]
  • -
  • Added savestate support to Donkey Kong driver [dink]
  • -
  • Fixed missing music in Sol Divide [dink]
  • -
  • Fixed sound effects and cutscene/music timing in Gun Smoke [dink]
  • -
  • Fixed reset causes crash in Wonder Planet, Karnov and Chelnov - Atomic Runner [dink]
  • -
  • Fixed reset in The Berlin Wall [dink]
  • -
  • Fixed sound effects and music in GunNail [dink]
  • -
  • Fixed music in Spinal Breakers (Z80 banking issue) [dink]
  • -
  • Fixed corrupted graphics in the last couple levels of Spinal Breakers [iq_132]
  • -
  • Added savestate cability to Fairyland Story [dink]
  • -
  • Save all screens when saving states with multiple TC0100SCN chips, fixes savestates for Darius II, Ninja Warriors and Rastan 3 - Warrior Blade [dink]
  • -
  • Impoved analog controls in Afterburner [dink]
  • -
  • Fixed speed in Joe & Mac Returns [dink]
  • -
  • Fix for the graphical glitches on the volcano level in Caveman Ninja [dink]
  • -
  • Fixed sprite priority and colours in Psycho-nics Oscar [dink]
  • -
  • Improved Irem M92 driver savestates [dink]
  • -
  • Interleave the CPUs in Battle Shark to avoid game crashing on level 2 [Barry]
  • -
  • Fixed music in Masked Riders Club Battle Race and Mad Shark [dink]
  • -
  • Fixed music in War of Aero - Project MEIOU [dink]
  • -
  • Fixed sample banking issues with Eight Forces, Blandia and Gundhara [dink]
  • -
  • Fixed pallete after loading savestate in Gaelco driver [dink]
  • -
  • Fixed savestates in The Main Event driver [dink]
  • -
  • Fixed wrong sounds and music in Green Beret [dink]
  • -
  • Fixed sprite priority issue in Konami's Ajax/Typhoon [Barry]
  • -
  • Fixed sfx volume fluxuations in Ajax driver [dink]
  • -
  • Added third button to Warriers of Fate: Sangokushi II [dink]
  • -
  • Fixed loud crashing noise in Scramble! and Super Cobra [dink]
  • -
  • Fixed NMK16 sprite rendering [iq_132]
  • -
  • Fixed graphics issues in Guardian/Tiger Heli/Slap Fight [iq_132]
  • -
  • Added Performan (Toaplan/Dataeast) to the Slap Fight driver [iq_132]
  • -
  • Fixed cheats in Z80 based games [iq_132]
  • -
  • Fixed sound effects in Task Force Harrier [dink]
  • -
  • Fixed 32bpp is now possible with the Enhanced (Direct3D) blitter [dink]
  • -
  • Fixed text layer alignment in Task Force Harrier [iq_132]
  • -
  • Improved analog controls in Night Striker [dink]
  • -
  • Savestate improvements for some Toaplan drivers [dink]
  • -
  • Fixed Boogie Wings, Diet Go Go, Crude Buster, Darkseal, Funky Jet, Rohga Armor Force, Super Burger Time, Tumble Pop and Vapor Trail on Deco16 Hardware to run at the proper speed [dink]
  • -
  • Fixed occasional stuck sprite in OutZone [dink]
  • -
  • Fixed Haunted Castle sound banking [iq_132]
  • -
  • Fixed tilemaps in Midnight Resistence, Hippodrome and Robocop [Barry]
  • -
  • Big Endian fixes for The Gladiator and Killing Blade [lantus]
  • -
  • Avoided use of deprecated function in libpng
  • -
  • Microsoft Visual Studio 2013 support [Barry]
  • -
  • Update System Info adding Windows 8.1 support to detection routines and simply CPU detection routines [Barry]
  • -
  • Fixed deselecting all hardware in the game selection dialog [Barry]
  • -
  • Fixed Neo Geo macro buttons [Barry]
  • -
  • Fixed & improved reliability of Neo Geo savestates [dink]
  • -
  • Started eradicating use of BurnDrvGetText in drivers [Barry]
  • -
  • Updated the libpng library to v1.6.12 [Barry]
  • -
  • Synced sets with MAME 0.154 [Barry, JacKc]
  • -
- - -

v0.2.97.29

-
    -
  • Ported PIC16C5X core from MAME [iq_132]
  • -
  • Updated PIC16C5X core and fixed a bug in RAM/ROM handline [Barry]
  • -
  • Added driver for Dragon Master [iq_132]
  • -
  • Added driver for various games on Playmark hardware [Barry]
  • -
  • Added clone of Ambush to the driver [Barry]
  • -
  • Added clone of Bomb Jack to the driver [Barry]
  • -
  • Added Bubble Bobble Lost Cave v1.1 to the Bubble Bobble driver [Barry, Bisboch, Aladar]
  • -
  • Added bootleg of Cadillacs and Dinosaurs to the CPS-1 driver [JacKc, Smitdogg, The Dumping Union]
  • -
  • Added clone of Final Fight to the CPS-1 driver [JacKc, any]
  • -
  • Added clone of Forgotten Worlds to the CPS-1 driver [JacKc, system11]
  • -
  • Added bootleg of Pang 3 to the CPS-1 driver [JacKc, Bonky0013]
  • -
  • Added clone of Pang 3 to the CPS-1 driver [Barry, JacKc, Smitdogg, The Dumping Union]
  • -
  • Added clone of Saturday Night Slam Masters to the CPS-1 driver [Barry, any, The Dumping Union]
  • -
  • Added various clones and bootlegs of Street Fighter II to the CPS-1 driver [Barry, iq_132, JacKc, Brian Troha, Smitdogg, The Dumping Union]
  • -
  • Added clone of Three Wonders to the CPS-1 driver [Bonky0013, JacKc]
  • -
  • Added bootleg of Three Wonders to the CPS-1 driver [Barry, JacKc, any]
  • -
  • Added clone of Hyper Street Fighter II to the CPS-2 driver [JacKc, f205v]
  • -
  • Added clone of Street Fighter II Alpha to the CPS-2 driver [JacKc, Razoola]
  • -
  • Added clone of Super Street Fighter II Tournament Battle to the CPS-2 driver [Artemio Urbina, David Haywood, JacKc]
  • -
  • Added clone of Super Street Fighter II Turbo to the CPS-2 driver [JacKc]
  • -
  • Added bootleg of Commando to the driver [JacKc, Kevin Eshbach]
  • -
  • Added clone of Galaxian to the Galaxian driver [Barry]
  • -
  • Added clone of Galaxian to the Galaxian driver [Barry, any]
  • -
  • Added bootleg of Moon Cresta to the Galaxian driver [JacKc, Ricky2001 (from AUMAP)]
  • -
  • Added clone of Moon Cresta to the Galaxian driver [Barry]
  • -
  • Added clone of Moon Cresta to the Galaxian driver [Barry, Roselson (from AUMAP)]
  • -
  • Added two clones of Scramble to the Galaxian driver [Barry, Basilio Garcia]
  • -
  • Added clone of Scramble to the Galaxian driver [Barry, Roselson (from Aumap)]
  • -
  • Added Star Fighter (bootleg of Moon Cresta) to Galaxian driver [Barry, David Haywood, RevisionX]
  • -
  • Added Time Fighter to the Galaxian driver [Barry]
  • -
  • Added clone of Uni War S to the Galaxian driver [Barry]
  • -
  • Added clone of Uni War S to the Galaxian driver [Barry, Basilio Garcia]
  • -
  • Added clone of Ghouls 'n Ghosts to the driver [JacKc, f205v, RanaElia]
  • -
  • Added clone of Snow Bros. to the Hyper Pacman driver [JacKc, The Dumping Union]
  • -
  • Added clone of Karnov to the driver [JacKc, Smitdogg, The Dumping Union]
  • -
  • Added bootleg of Pang to the Mitchell driver [Barry]
  • -
  • Added clone of Mysterious Stones to the driver [Barry, Ricky2001 (from AUMAP)]
  • -
  • Added NeoGeo 2-Player Tetris to the Neo Geo driver [Barry, Fred/Front, Crim/Stephen]
  • -
  • Added Neo Galaga demos to the Neo Geo driver [Barry, Fred/Front, Cristiano Bei/www.iocerom.com]
  • -
  • Added clone of Guardian Storm to the NMK-16 driver [JacKc, Brian Troha, The Dumping Union]
  • -
  • Added clone of Guardian Storm to the NMK-16 driver [Barry, The Dumping Union, David Haywood]
  • -
  • Added clone of Guardian Storm to the NMK-16 driver [JacKc, iq_132, Barry, David Haywood]
  • -
  • Added bootleg of Crush Roller to the Pacman driver [any]
  • -
  • Added clone of Pacman to the Ms. Pacman driver [Barry]
  • -
  • Added clone of Pacman to the Pacman driver [Barry]
  • -
  • Added clone of Demon Front to the PGM driver [JacKc, R. Mucciarelli, Layne, Smitdogg, The Dumping Union]
  • -
  • Added many clones of Do Don Pachi II to the PGM driver [JacKc, Barry]
  • -
  • Added clone of Knights of Valour Super Heroes to the PGM driver [JacKc, XingXing]
  • -
  • Added clone of Oriental Legend Special to the PGM driver [JacKc]
  • -
  • Added clone of Rally-X to the driver [JacKc, any]
  • -
  • Added clone of Hang-On to the Sega Hang-On driver [JacKc, cmonkey]
  • -
  • Added bootleg of Teddy Boy Blues to the Sega System 1 driver [JacKc, any]
  • -
  • Added clone of Wonder Boy III to the Sega System 16A driver [Barry, Chris Hardy, Charles MacDonald, Brian Troha]
  • -
  • Added clone of Alien Syndrome to the Sega System 16B driver [Barry, Arzeno Fabrice, hap, Charles MacDonald]
  • -
  • Added clone of D.D. Crew to the Sega System 18 driver [JacKc, Porchy, The Dumping Union]
  • -
  • Added clone of Wing Shooting Chamionship to the Seta-2 driver [JacKc, Brian Troha, The Dumping Union]
  • -
  • Added clone of Silk Road to the driver [Barry]
  • -
  • Added clone of Super Chase - Criminal Termination to the driver [JacKc, Porchy, The Dumping Union]
  • -
  • Added clone of Continental Circus to the Taito-Z driver [Barry, Brian Troha, ShouTime, The Dumping Union]
  • -
  • Added clone of WWF Superstars to the driver [Barry, Brian Troha]
  • -
  • Added clone of WWF Wrestlefest to the driver [JacKc, Simon Dennison, Brian Troha]
  • -
  • Added clone of X-Men to the driver [JacKc, Brian Troha]
  • -
  • Added clone of Bomb Kick to Yun Sung 16 driver [JacKc, ANY, David Haywood]
  • -
  • Added a preliminary driver for Sega Master System hardware (port of Dega), enabled in debug builds only [kev]
  • -
  • Optimised the Taito TC0100SCN rendering routines, particuarly helps multi-screen games [Barry]
  • -
  • Added sound sample support to various Toaplan drivers [Barry, ThunderMAME]
  • -
  • Added Fire button to Sangokushi II: San Jian Sheng sets [Barry, money_114]
  • -
  • Added filter support to Scorpion and SF-X [Barry]
  • -
  • Endian fixes for palette in Oh My God!, Hyper Pacman and Konami drivers [Twinaphex]
  • -
  • Various fixes from visual studio leak detector [Wizard Coder, kev]
  • -
  • Fixed some GUI memory leaks [Captain CPS-X]
  • -
  • Applied libretro patch [Twinaphex]
  • -
  • Updated the zlib library to v1.2.8 [Barry]
  • -
  • Updated the libpng library to v1.6.2 [Barry]
  • -
  • Synced sets with MAME 0.149 [Barry, JacKc]
  • -
- - -

v0.2.97.28

-
    -
  • Added Ganbare Marin-kun to the CPS-1 driver [Barry, smitdogg, The Dumping Union]
  • -
  • Added Ghost Muncher to the Galaxian driver [Barry, Robbbert, Misfitmame]
  • -
  • Added Bubble Bobble Lost Cave to the Bubble Bobble driver [Barry, Bisboch, Aladar]
  • -
  • Added bootleg of Carrier Air Wing to the CPS-1 driver [Barry, JacKc, Bonky0013]
  • -
  • Added various bootlegs of Street Fighter II Champion Edition to the CPS-1 driver [Barry, JacKc, bonky0013]
  • -
  • Added clone of The Punisher to the CPS-1 driver [JacKc, Artemio Urbina]
  • -
  • Added clone of Marvel vs. Capcom to the CPS-2 driver [Barry, ranger_lennier, Yohji, Tormod, Smitdogg, The Dumping Union]
  • -
  • Added clone of X-Men Children of the Atom to the CPS-2 driver [Barry, Bonky0013]
  • -
  • Added clone of Bagman to the Galaxian driver [Barry, Robbbert, Misfitmame]
  • -
  • Added clone of Frogger to the Galaxian driver [Barry, Robbbert, Misfitmame]
  • -
  • Added clone of Galaxian to the Galaxian driver [Barry, Robbbert, Misfitmame]
  • -
  • Added clone of Moon Cresta to the Galaxian driver [Barry, Robbbert, Misfitmame]
  • -
  • Added clone of Scramble to the Galaxian driver [Barry, Robbbert, Misfitmame]
  • -
  • Added clone of Triple Punch to the Galaxian driver [Barry, lucaelia, Siftware]
  • -
  • Added clone of Fantasia to the Gals Panic driver [JacKc, Brian Troha, The Dumping Union]
  • -
  • Added clone of Ghosts 'n Goblins to the driver [JacKc, Antonio Gonzalez Jr., tafoid]
  • -
  • Added clone of Haunted Castle to the Konami driver [JacKc, Andrew Welburn, Phil Bennett]
  • -
  • Added clone of Sunset Riders to the Konami driver [JacKc, hap, Dave F]
  • -
  • Added clone of Sunset Riders to the Konami driver [JacKc, Any, The Dumping Union]
  • -
  • Added clone of Thunder Zone to the Konami driver [JacKc]
  • -
  • Added clone of King of Fighters '97 to the Neo Geo driver [iq_132, smitdogg]
  • -
  • Added Time's UP! Demo to the Neo Geo driver [Barry, NGF Dev. Inc, Fred/FRONT]
  • -
  • Added clone of Ms Pacman to the Pacman driver [JacKc, hap]
  • -
  • Added three clones of Knights of Valour Superheroes to the PGM driver [JacKc, Joerg Hartenberger, iq_132, smitdogg]
  • -
  • Added some Ketsui Arrange versions to the PGM driver [JacKc]
  • -
  • Added clone of Puzzli 2 to the PGM driver [Tormod, Smitdogg, The Dumping Union, JackC, iq_132]
  • -
  • Added clone of Speed Rumbler to the driver [iq_132, Corrado Tomaselli, JacKc]
  • -
  • Added clone of Superman to the Taito-X driver [Barry, JacKc, Brian Troha, Dave France, The Dumping Union]
  • -
  • Added clone of Zero Point to the Unico driver [JacKc, Takahiro Nogi, hap]
  • -
  • Simulated the protection in Metal Slug X and removed a nasty patch [iq_132]
  • -
  • Emulated the protection in Lord of Gun and removed a nasty patch [iq_132]
  • -
  • Emulated protection in Street Fighter II Rainbow Edition (set 1 and 2) and removed a nasty patch [iq_132]
  • -
  • Emulated protection in Street Fighter II Mega sets and removed a nasty patch [iq_132]
  • -
  • Emulated protection in Dinosaur Hunter and removed a nasty patch [iq_132]
  • -
  • Emulated protection in some Warriors of Fate bootlegs and removed nasty patches [iq_132]
  • -
  • Fix kov command CC (fixes game stage 6) [iq_132]
  • -
  • Fixed graphics banking in Port Man [Barry, Robbbert]
  • -
  • Added support for the digital volume slider in CPS-2 test screens, also added support for single board games with no digital slider [Barry]
  • -
  • Added the Turbo mode dip switch to Street Fighter II Alpha Magic F [Barry, MAME]
  • -
  • Identified various Street Fighter II Champion Edition bootlegs and game them more descriptive names and descriptions, eliminating the sf2m* naming convention [Barry]
  • -
  • Improved emulation of bootleg hardware in King of Dragons bootleg [Barry]
  • -
  • Added variants to the Time Keeper module [Barry]
  • -
  • Changed UniBIOS 3.0 to the free version release [JacKc]
  • -
  • Big-endian fixes for some Data East drivers [MagicSeb]
  • -
  • Updated the ZET and VEZ CPU interfaces [iq_132]
  • -
  • Improved CPS-2 rom loading [Barry]
  • -
  • Fixed Japanese Romanization of some game titles [JacKc]
  • -
  • Improved Visual Studio version reporting and added Windows 8 support to the System Info module [Barry]
  • -
  • Updated Visual Studio makefile to support Visual Studio 2012, and fixed some related issues [Barry]
  • -
  • Added support for targeting Windows XP using Visual Studio 2012 via a makefile flag [Barry]
  • -
  • Updated GCC makefile to 4.7.1 and fixed warnings [Barry]
  • -
  • Updated the dat file writer to give each dat file a seperate id to ClrMAME gives each a separate profile [Barry]
  • -
  • Applied libretro patch [Twinaphex]
  • -
  • Matched the Megadrive sets to MESS 0.147u4 [Barry]
  • -
  • Synced sets with MAME 0.147u4 [Barry, JacKc]
  • -
- - -

v0.2.97.27

-
    -
  • Sound Improvements -
      -
    • Tidied sound chip interfaces, adding support for volume and left/right selection for individual routes. Updated all drivers to support. Many drivers sound much better with these updates [Barry]
    • -
    • Fixed an issue with multiple YM2203 chips that resulted in static noise in the sound output [Barry]
    • -
    • Added pan support to Taito drivers that use panning with the YM2610 sound chip [Barry]
    • -
    • Added pan support to the Darius driver [Barry]
    • -
    • Added support for an RC filter, and added support to the Galaxian Konami sound based drivers [Barry]
    • -
    • Fixed various drivers that rendered the MSM5205 sound too fast when the sample rate was greater than 22050Hz [Barry]
    • -
    • Applied a YM2413 fix from MAME [Barry]
    • -
    • Added support for a selectable number of voices in the Namco sound module (fixes sound in the Baraduke, Pac Land and Sky Kid drivers [Barry]
    • -
    • Added multiple chip support to the Sega PCM module, updated Super Monaco Grand Prix to support the extra sound board [Barry]
    • -
    • Added support for the MSM6585 chip to the MSM5205 core [iq_132]
    • -
    • Added multiple chip support to the Y8950 interface, and hooked up in the Cybertank driver [Barry]
    • -
    • Small speedup in the DAC core [iq_132]
    • -
  • -
  • Standardised some CPU interfaces [iq_132]
  • -
  • Improved Atari slapstic emulation, and updated the Gauntlet driver to support it [iq_132]
  • -
  • Added driver for Atari Tetris [iq_132]
  • -
  • Added driver for Cybertank [iq_132]
  • -
  • Hooked up analog inputs in the Cybertank driver [Barry]
  • -
  • Added driver for games on Donkey Kong hardware [iq_132]
  • -
  • Tidied Donkey Kong driver to build with current FB Alpha, and fixed some bugs and crashes [Barry]
  • -
  • Added driver for Konami Test Board (GX800) [iq_132]
  • -
  • Added Bang 2 Busters to the Neo Geo driver [lantus]
  • -
  • Added Treasures of the Carribean to the Neo Geo driver [lantus]
  • -
  • Added Last Survivor to the Sega X-Board driver [Barry, JacKc, ShouTime, Charles MacDonald, Aaron Giles, 9ofzeven, TrevEB, Dr. Spankenstein, ghoolster, Surgeville, Tormod, Tjaberg, Waremonger]
  • -
  • Added Racing Beats to the Taito Z driver [Barry]
  • -
  • Added bootleg of 1943 to the driver [Barry, JacKc, bonky0013]
  • -
  • Added clone of Arkanoid to the driver [Barry]
  • -
  • Added bootleg of Pang! 3 to the CPS-1 driver [JacKc, porchy]
  • -
  • Added some bootlegs of Street Fighter II to the CPS-1 driver [Barry, JacKc, smitdogg]
  • -
  • Added clone of Super Street Fighter II to the CPS-2 driver [JacKc]
  • -
  • Added two clones of Thunder Zone to the Data East drivers [ShouTime, JacKc]
  • -
  • Added two clones of Dynamite Duke to the driver [JacKc, Arzeno Fabrice]
  • -
  • Added clone of War of the Bugs or Monsterous Manouvers in a Mushroom Maze to the Galaxian driver [Barry]
  • -
  • Added clone of Jumping Pop to the driver [Barry, The Dumping Union]
  • -
  • Added clone of Parodius to the Konami driver [Barry, Andrew Welburn, The Dumping Union]
  • -
  • Added King of Gladiators Plus to the Neo Geo driver [JacKc]
  • -
  • Added homebrew WW2 Demo to the Neo Geo driver [Barry]
  • -
  • Added homebrew Spiderman Intro demo, and added alt sets of TMNT and Dark Wing Duck intro sets to the Neo Geo driver [Barry]
  • -
  • Added clone of Ketsui Arrange to the PGM driver [JacKc]
  • -
  • Added clone of Raiden to the driver [Barry, JacKc]
  • -
  • Added two clones of Fantasy Zone II (System 16C version) to the Sega System 16B driver [Barry]
  • -
  • Added clone of Turbo Outrun to the Sega Outrun driver [JacKc]
  • -
  • Added clone of AB Cop to the Sega X-Board driver [JacKc]
  • -
  • Added clone of GP Rider to the Sega X-Board driver [Barry]
  • -
  • Added clone of Deer Hunter to the Seta 2 driver [JacKc]
  • -
  • Added clone of Drift Out to the Taito F2 driver [JacKc, Hammy]
  • -
  • Added clone of Rygar to the Tecmo driver [JacKc, smitdogg]
  • -
  • Added clone of Pipi & Bibis / Whoopee!! to the Toaplan 2 driver [Barry, Antonio Gonzalez Jr.]
  • -
  • Added bootleg of Toki to the driver [Barry, skiltz]
  • -
  • Added clone of Trojan to the driver [JacKc]
  • -
  • Fixed bugs in 4 Fun in 1 and Ghostmuncher Galaxian in the Galaxian driver, promoting them to working [Barry]
  • -
  • Changed Fantastic to use the proper PROM dump in the Galaxian driver, fixing the game colours [Barry]
  • -
  • Changed Super Bond to use the proper PROM dump in the Galaxian driver, fixing the game colours [Barry]
  • -
  • Various PGM improvements [iq_132, JacKc]
  • -
  • Fixed a graphics glitch in the Super Monaco Grand Prix title screen [Barry]
  • -
  • Fixed issue with Top Speed crashing on driver init [Barry]
  • -
  • Big-endian fixes for the Cybertank driver [lantus]
  • -
  • Big-endian fixes for the Sega System 16A and Tecmo drivers [lantus]
  • -
  • Big-endian fix for Street Fighter II: Magic Delta Turbo sprite x position [lantus]
  • -
  • Applied various libretro patches [Twinaphex]
  • -
  • Updated the zlib library to v1.2.7 [Barry]
  • -
  • Updated the libpng library to v1.5.12 [Barry]
  • -
  • Matched the Megadrive sets to MESS 0.146u5 [Barry]
  • -
  • Synced sets with MAME 0.146u5 [Barry]
  • -
- - -

v0.2.97.26

-
    -
  • Added two clones of Arkanoid to the Arkanoid driver[Barry, f205v]
  • -
  • Added Gigaman 2 to the CPS-2 driver, adding ability to disable Q-Sound in the CPS-2 drivers [Barry]
  • -
  • Added Phoenix clone of Street Fighter Alpha to the CPS-2 driver [JacKc]
  • -
  • Added Phoenix clone of Super Street Fighter II Turbo to the CPS-2 driver [JacKc]
  • -
  • Added bootleg of Dragon Ninja to the DEC-0 driver [Barry, f205v]
  • -
  • Added bootleg of Cobra Command to the DEC-8 driver [Barry, f205v]
  • -
  • Added clone of Driving Force to the Galaxian driver [Barry, Team Europe]
  • -
  • Added clone of Moon Cresta to the Galaxian driver [JacKc, Andy Welburn]
  • -
  • Added clone of F-X to the Kyugo driver [Barry, f205v]
  • -
  • Added Oxygene's NeoGeo 3D! demo to the Neo Geo driver [Barry]
  • -
  • Added clone of Guardian Storm to the NMK16 driver [JacKc, B. Ståhl, Smitdogg, The Dumping Union]
  • -
  • Added clone of Knights of Valour 2 to the PGM driver [JacKc, XingXing]
  • -
  • Added clones of Flicky (alt graphics roms for 128k sets) to the Sega System 1 driver [Barry, f205v]
  • -
  • Improvements to Street Fighter 2: Magic Delta Turbo which now works correctly [Barry]
  • -
  • Fixed missing sounds in games based on Final Crash or Street Fighter 2: Magic Delta Turbo sound [Barry]
  • -
  • Added support for missing priority mode writes in knightsb, knightsb4, the punipic sets, and wofb [Barry]
  • -
  • Changed knights and knightsb4 to get the sprite mask values from work RAM [Barry]
  • -
  • Changed the Daimakai bootleg to use the bootleg Sprite RAM it writes, and get the sprite priority masks from work RAM [Barry]
  • -
  • Changed the punipic sets to get the scroll layer RAM offsets and sprite priority masks from work RAM [Barry]
  • -
  • Changed wofb, and other wof sets that don't write the registers to get the sprite priority masks from work RAM [Barry]
  • -
  • Hooked up the EEPROM in the dino, punipic and wof bootleg sets that don't read dip switches [Barry]
  • -
  • Updated the EPOS driver, adding sound for Dealer and implementing the watchdog [iq_132]
  • -
  • Tidied the Phoenix sets in the CPS-2 driver [Barry, based on info from Pythagoras]
  • -
  • Fixed some unicode titles [JacKc, XingXing]
  • -
  • Added Hyllian's Data Dependent Triangulation 3X to the softFX blitters [Hyllian, msbhvn]
  • -
  • Optimised the xBR filters [Hyllian, Barry]
  • -
  • Sync some sets and titles with latest MAME SVN [JacKc]
  • -
- - -

v0.2.97.25

-
    -
  • CPS-1 Updates, most of the bootlegs now work well and without patches to hack them to work like the originals (brief, incomplete summary below) [Barry, JacKc, bonky_0013, f205v] -
      -
    • Added some Street Fighter II M bootlegs
    • -
    • Street Fighter II - Champion Edition (Turbo Hack) now works
    • -
    • Added an alternate set for Street Fighter II - Champion Edition (Turbo Hack)
    • -
    • Street Fighter II - Champion Edition (M1 bootleg) now works
    • -
    • Added support for the dumped Street Fighter II - Champion Edition (Koryu bootleg) graphics roms
    • -
    • Added Street Fighter II: Magic Delta Turbo (some issues with row-scroll)
    • -
    • Added an alternate set for Street Fighter II: Magic Delta Turbo
    • -
    • Added an alternate set for Street Fighter II - Hyper Fighting (bootleg)
    • -
    • Added a new bootleg of Captain Commando to the driver
    • -
    • Added new bootlegs of Knights of the Round to the driver
    • -
    • Daimakai (bootleg) now works
    • -
    • Carrier Air Wing (bootleg) now works
    • -
    • King of Dragons (bootleg) now works
    • -
    • Added Final Crash to the driver
    • -
    • Emulated the alternative sprite system used in Final Crash and hooked it up in other bootlegs that use it
    • -
    • Emulated the alternative sound system used in Final Crash and added it to Carrier Air Wing (bootleg) as well
    • -
    • Emulated the alternative sound system used in Street Fighter: Magic Delta Turbo and added it to a Captain Commando bootleg and Knights of the Round bootleg as well
    • -
    • Improved sprite list end detection
    • -
    • Added optional end of sprite list detection, fixes some more of the bootleg sets
    • -
    • All Warriors of Fate bootlegs now work properly or at least well
    • -
    • Added some more Warriors of Fate bootlegs
    • -
    • All the PIC sets now work, without sound obviously due to no good dump of the PIC data being available
    • -
    • Tidied the driver
    • -
    • Removed the CPS Changer region hacks
    • -
  • -
  • Updated the ARM7 core to avoid out of page range accesses [iq_132]
  • -
  • Added driver for Silver Millenium [iq_132]
  • -
  • Added bootleg of Dragon Ninja to the DEC-0 driver [Barry]
  • -
  • Added bootleg of Kung Fu Master to the Irem M62 driver [JacKc, bonky_0013]
  • -
  • Added clone of Super Triv to the Jack the Giantkiller [JacKc]
  • -
  • Added Neo Castlevania demo to the Neo Geo driver [Barry]
  • -
  • Added Neo Thunder homebrew game to the Neo Geo driver [iq_132]
  • -
  • Added NGF Transparency demo to the Neo Geo driver [Barry]
  • -
  • Added Dragon World: Pretty Chance to the PGM driver (debug builds only) [iq_132]
  • -
  • Added Ketsui Arrange to the PGM driver [iq_132]
  • -
  • Added clone of Wonder Boy to the Sega System 1 driver [JacKc]
  • -
  • Added clone of Rastan to the Misc Taito driver [Barry]
  • -
  • Added clone of Rastan to the Misc Taito driver [JacKc]
  • -
  • Tidied the Funky Bee driver [iq_132]
  • -
  • Tidied the Meijinsen [iq_132]
  • -
  • Tidied the PGM driver [iq_132]
  • -
  • Improved protection simulation for some PGM sets [iq_132]
  • -
  • Fixed sprites alignment in Knights of Valour [iq_132]
  • -
  • Fixed a crash in PGM rendering code [iq_132]
  • -
  • Improved sound in the PGM driver [lantus]
  • -
  • Fixed a crash in the Hunchback sets in the Galaxian driver [Barry]
  • -
  • Improvements to the Black Tiger driver [iq_132, issues reported by JacKc]
  • -
  • Fixed savestates in the CPS-3 driver [Twinaphex]
  • -
  • Fixed a potential crash in the EEPROM module [Twinaphex]
  • -
  • Fixed custom-sized tile rendering in the generic tiles module [iq_132]
  • -
  • Big-endian fixes for the ARM CPU interface [lantus]
  • -
  • Big-endian fixes for the CPS-1, Data East, Neo Geo, Sega and Silver Millenium drivers [lantus]
  • -
  • Big-endian fix for the Pskiyo 4 driver [Twinaphex]
  • -
  • Added BRAM support to the PC-Engine driver [kev]
  • -
  • Added some unicode titles [JacKc]
  • -
  • Added BDF_CLONE to sfiii3u [iq_132, reported by DsNo]
  • -
  • Tidied the SNES driver a bit [kev]
  • -
  • Added SoftFX xBR filters [msbhvn, Hyllian, Barry]
  • -
  • Fixed a UI issue with unidentified CDs [Barry]
  • -
  • Rename endian.h to burn_endian.h [Barry]
  • -
  • Improve portability by checking defines before defining them [Twinaphex]
  • -
  • Updates to libsnes [Squarepusher2]
  • -
  • Synced sets with MAME 0.145u7 [Barry]
  • -
- - -

v0.2.97.24

-
    -
  • Rewrote the DAC core, improving performance and timing [iq_132]
  • -
  • Updated the Mogura and The FairyLand Story drivers to use the new DAC core [iq_132]
  • -
  • Updated the Armed Formation, King & Balloon, Irem M72 and M90, Route16, Sega System 16A, SunA16, Terra Cresta, The New Zealand Story, Vigilante drivers to use the new DAC core [Barry]
  • -
  • Fixed the new DAC core with GCC 3.4.5 [Barry]
  • -
  • Updated Z80 cycle counting, improving accuracy [iq_132]
  • -
  • Added cycle counting to the I8039 CPU core [iq_132]
  • -
  • Updated PGM driver making Bee Storm - DoDonPachi II and Demon Front playable [iq_132]
  • -
  • Added Fantasic and Kong to the Galaxian driver [Barry]
  • -
  • Added Arange Mode hack of DoDonPachi to the Cave driver [JacKc]
  • -
  • Added clone of 1941 to the CPS-1 driver [Bonky0013, JacKc, Techmotour]
  • -
  • Added clone of King of Dragons to the CPS-1 driver [Barry]
  • -
  • Added clone of Street Fighter II: Champion Edition to the CPS-1 driver [Barry]
  • -
  • Added clone of UniWar S to the Galaxian driver [Barry]
  • -
  • Added clone of Deer Hunting to the Seta2 driver [Barry]
  • -
  • Added clone of Super Chase to the Taito driver [Barry]
  • -
  • Added clone of Arkanoid 2 to the The New Zealand Story driver [Barry]
  • -
  • Added 1945 Part 2 (hack of Battle Garegga) to the Toaplan-2 driver [Barry]
  • -
  • Fixed sound samples in the Kageki driver [Barry]
  • -
  • Fixed sample sounds in King & Balloon [Barry]
  • -
  • Fixed 68000 CPU speed in Best of the Best driver [iq_132, reported by Cmart]
  • -
  • Updated dip switches in the Side Pocket driver [Barry]
  • -
  • Changed CPS-1 sprite timing for bootlegs/hacks that render the sprites in reverse order [Barry, identied by manliodp]
  • -
  • Big-endian fixes for Data East, various Misc, and PGM drivers [lantus]
  • -
  • Added Unicode title for 1945 Part 2 [JacKc]
  • -
  • Added support for insane cheat file lengths [Barry, reported by money_114]
  • -
  • Fixed issue with the load progress dialog not being killed when loading unavailable sets [Barry, reported by BisonSAS]
  • -
  • Fixed crash if SampleInit is called without a sample list [iq_132]
  • -
  • Removed sek.h and zet.h from burnint.h, and added to drivers where necessary [Barry]
  • -
  • Synced sets with MAME 0.145u5 [Barry]
  • -
- - -

v0.2.97.23

-
    -
  • Added clone of Caveman Ninja to the Data East drivers [JacKc, Corrado Tomaselli]
  • -
  • Added bootleg of Side Pocket to the Data East drivers [Barry, Corrado Tomaselli]
  • -
  • Allowed Neo Geo drivers to disable the watchdog reset, and used it to fix Neo Pong v1.0 which is now added to release builds [Barry]
  • -
  • Changed the game selection dialog back to the old size and updated the dialog to be resizable [Barry]
  • -
  • Fixed issue with disappearing preview images in game selection dialog when switching back to the window [Barry]
  • -
  • Applied latest libsnes patches [Themaister]
  • -
  • Standardised revision info in game titles [Barry]
  • -
  • Made inclusion of png.h in burner.h optional in makefile via INCLUDE_LIB_PNGH flag [Barry]
  • -
  • Updated the helpfile with the game selection dialog changes [Barry]
  • -
- - -

v0.2.97.22

-
    -
  • Added support for 7z files for roms and samples [Barry]
  • -
  • Added driver for Act Fancer [iq_132]
  • -
  • Added driver for Gals Pinball [iq_132]
  • -
  • Added driver for Momoko 120% [iq_132]
  • -
  • Added clone of Final Fight to the CPS-1 driver JacKc, Bonky0013
  • -
  • Added clone of Forgotton Worlds to the CPS-1 driver [JacKc, Bonky0013]
  • -
  • Added clone of Street Fighter II to the CPS-1 driver [JacKc, Bonky0013]
  • -
  • Added clone of Street Fighter II: Champion Edition to the CPS-1 driver [Barry]
  • -
  • Added clone of Puzz Loop 2 to the CPS-2 driver [Barry]
  • -
  • Added clone of Super Street Fighter 2 X to the CPS-2 driver, and added support for the graphic rom format it uses [Barry]
  • -
  • Added clone of Vampire Hunter to the CPS-2 driver [Barry, JacKc]
  • -
  • Added clone of Jojo's Venture to the CPS-3 driver [Barry]
  • -
  • Added clone of Jojo's Bizarre Adventure to the CPS-3 driver [JacKc]
  • -
  • Added bootleg of Eyes [iq_132]
  • -
  • Added clone of X-Men to the Konami drivers [JacKc, Bonky0013]
  • -
  • Added Super Bubble Pop to the Neo Geo driver (player 1 inputs don't work, hence debug only builds) [Barry, iq_132, JacKc]
  • -
  • Added PCB version of Demon Front to the PGM driver (non-working, debug builds only) [JacKc]
  • -
  • Added clone of Altered Beast to the Sega System 16B driver [Barry]
  • -
  • Added bootleg of Silk Worm to the Tecmo driver [JacKc, Bonky0013]
  • -
  • Changed CPS-1/2 palette handling to be more accurate, should fix some glitches [Barry]
  • -
  • Changed CPS-2 video timing to use the values in MAME that have come from hardware measurements [Barry]
  • -
  • Improved CPS-2 sprite list end detection [Barry]
  • -
  • Moved the CpsGetObj() call, fixing sprite lag in Super Street Fighter II and clones [manliodp]
  • -
  • Fixed IRQ generation in the Irem M72 drivers, fixing video timing in Dragon Breed [Barry]
  • -
  • Fixed sound in the Irem M72 drivers [Barry]
  • -
  • Minor CPS-3 update with a small speedup [iq_132]
  • -
  • Update the Mysterious Stones driver [iq_132]
  • -
  • Removed duplicate set of Super Monaco Grand Prix [Barry]
  • -
  • Added savestate support to the the OPL based sound cores (YM3812, YM3526 and Y8950) and interfaces [Barry]
  • -
  • Removed previous attempt and added savestate support to the YM2413 core and interface [Barry]
  • -
  • Added savestate support to the DEC-8 driver [Barry]
  • -
  • Tidied and fixed Data East savestates where necessary [Barry]
  • -
  • Fixed Sengoku 3 Unicode title (string wasn't terminated) [Barry]
  • -
  • Moved the Pocket Gal Deluxe driver to the Data East filter [iq_132]
  • -
  • Big-endian fixes for the new CPS-1/2 palette code, CPS-2 raster interrupts, Konami drivers and devices, PGM driver, some Misc drivers, Sega FD1089, Seta drivers, and Toaplan games that use the V25 CPU for sound [lantus]
  • -
  • Fixed some invalid BRF_NODUMP definitions [Barry]
  • -
  • Overhauled the cheat system [iq_132]
  • -
  • Added overrides to allow drivers to exclude addresses from cheat searching, and used it to prevent a crash when searching for cheats in CPS Q-Sound games [Barry]
  • -
  • Tidied the game selection dialog a bit, and changed the behaviour of "show available" to allow showing available and/or unavailable sets [Barry]
  • -
  • Fixed TurboGrafx 16 games displaying as MVS cartridge hardware in the game selection dialog [iq_132]
  • -
  • Added a Ctrl+W shortcut to close the current game [Barry]
  • -
  • Made the cliprect for the OSD shortmsg wider, allowing more text to be displayed [Barry]
  • -
  • Prevented the 68K debugger opening if the 68k interface is not in use [iq_132]
  • -
  • Disabled menu item for 68k debugger if the 68k interface is not in use, and renamed the menu item to "Invoke 68k debugger" [Barry]
  • -
  • Removed definition of LSB_FIRST in epx.cpp since it is now defined (or not) in the makefile [Barry]
  • -
  • Fixed issue with definition of LSB_FIRST in makefile.mingw [Barry]
  • -
  • Added libsnes target files [Themaister, twinaphex]
  • -
  • Fixed some memory leaks and possible memory leaks [kev]
  • -
  • Identified and fixed some out of bounds array issues [kev, iq_132]
  • -
  • Updated the zlib library to v1.2.6 [Barry]
  • -
  • Updated the libpng library to v1.5.8 [Barry]
  • -
  • Matched all sets to MAME 0.145u3 [Barry]
  • -
  • Matched the Megadrive sets to MESS 0.145u1 [Barry]
  • -
  • Changed PC-Engine driver to be auto-generated from the MESS software list [Barry]
  • -
  • Matched the PC-Engine sets to MESS 0.145u1 [Barry]
  • -
- - -

v0.2.97.21

-
    -
  • Updated the H6280 core and interface to support multiple CPUs [iq_132]
  • -
  • Added multiple-CPU support to debug tracking in the H6280 core and interface [Barry]
  • -
  • Updated Final Romance 2 in the Neo Geo driver to use Razoola's updated version [Barry]
  • -
  • Tidied World Cup '90 driver and fixed video timing and save states [Barry]
  • -
  • Fixed negative sound samples causing an app crash in some PC-Engine games [lantus]
  • -
  • Big-endian fixes for Capcom CPS-1/2/3, Cave, Irem, Psikyo and Megadrive drivers [lantus]
  • -
  • Big-endian fixes for the NEC CPU core [lantus]
  • -
  • Fixed excessive CPU usage when FB Alpha isn't doing anything [Barry]
  • -
  • Fixed non-Ascii output in the gamelist translation template export [doomking]
  • -
  • Hopefully fixed gamelist translation on Chinese systems [Barry]
  • -
  • Changed gamelist localisation to use the system codepage by default [Barry]
  • -
  • Some small localisation fixes [Barry, reported by Benjamin Siskoo]
  • -
  • Reduced the OSD text size to fit in the cliparea [Barry]
  • -
  • Fixed dat file writing from the command-line and added command-line options for PC-Engine dats, as found by MSVC SYMBOL build [Barry]
  • -
  • Fixed bug in game selection dialog with not allocating enough memory for gamenames when scanning sets [Barry]
  • -
  • Updated the default rom path to be the last path again (ie, 20 instead of 8) [Barry]
  • -
  • Updated helpfile with command-line changes [Barry]
  • -
- - -

v0.2.97.20

-
    -
  • Fixed a possible crash when scanning roms (seemed to affect x64 builds) [Barry]
  • -
  • Updated dat handling to support PC-Engine console (completely forgot for the last release) [Barry]
  • -
  • Updated help file [Barry]
  • -
- - -

v0.2.97.19

-
    -
  • Fixed the issue in the H6280 core [Barry]
  • -
  • Updated H6280 core with some fixes from MAME versions newer than the original core port [iq_132]
  • -
  • Added H6280 support to the YM3812 core [Barry]
  • -
  • Ported C6280 sound core from MAME for PC-Engine driver [iq_132]
  • -
  • Added a driver for PC-Engine/TurboGrafx 16/SuprGrafx console hardware [iq_132]
  • -
  • Added driver for Blomby Car [Barry]
  • -
  • Added driver for Jackie Chan [iq_132]
  • -
  • Added driver for Side Pocket [Barry]
  • -
  • Added driver for games on Terra Cresta hardware [Barry]
  • -
  • Added clone of Street Fighter III 3rd Strike to the CPS-3 driver [Barry]
  • -
  • Added Boulder Dash, Hippodrome Midnight Resistance and Sly Spy to the DEC0 driver [Barry]
  • -
  • Added Heavy Metal to the Sega System 1 driver [Barry]
  • -
  • Fixed non-bootleg version of Robocop, and added all clones to the DEC0 driver [Barry]
  • -
  • Fixed Caveman Ninja and Edward Randy in the DECO 16 drivers and enabled in release builds [Barry]
  • -
  • Added full sound to all the DECO16 drivers now that the H6280 core works [Barry]
  • -
  • Fixed crash when loading in the Konami Twin16 driver [Barry]
  • -
  • Fixed loading of UPD7759 samples in Gradius2 in the Konami Twin16 driver [Barry]
  • -
  • Fixed Naname de Magic! in the Oh My God! driver and enabled in release builds [Barry]
  • -
  • Fixed missing ADPCM sounds in Superman in the Taito X driver [Barry]
  • -
  • Updated PC-Engine driver to use the same zip names as the MESS software lists, similar to the Megadrive support (see help file for more info) [Barry]
  • -
  • Fixed row and column scroll in the DEC-0 driver, and added support for Tile Ram Banking [Barry]
  • -
  • Reverted the CPS-2 VBlank IRQ timing change from the last version, it broke raster effects [Barry]
  • -
  • Fixed savestates in the Batrider driver [Barry]
  • -
  • Fixed savestates in the Cave drivers where necessary [Barry]
  • -
  • Added savestate support to the Double Dragon driver [Barry]
  • -
  • Fixed savestates in the News driver [Barry]
  • -
  • Fixed savestates in the Sega System 1 driver where necessary [Barry]
  • -
  • Fixed savestates in the Sega System 16 and similar drivers where necessary [Barry]
  • -
  • Added savestate support to the HD6309 interface [Barry]
  • -
  • Fixed savestates in the I8039 core [Barry]
  • -
  • Fixed savestates in the DAC sound core [Barry]
  • -
  • Fixed savestates in the Q-Sound sound core [Barry]
  • -
  • Added savestate support to the RF5C68PCM sound core [Barry]
  • -
  • Fixed savestates in the SegaPCM sound core [Barry]
  • -
  • Fixed savestates in the SN76496 sound core [Barry]
  • -
  • Fixed bug in the YM2151 interface when enabling FM interpolation [Barry]
  • -
  • Added volume control to the SN76496 core and normalised sound in drivers which were too loud [Barry]
  • -
  • Added support for up to 20 rom paths, with the last ten being supplementary [Barry]
  • -
  • Added filter for PC-Engine to game selection dialog [Barry]
  • -
  • Added support to disable __fastcall in the vez interface via the FASTCALL makefile flag [Barry]
  • -
  • Added support for localising the gamelist (see the help file for more information) [Barry]
  • -
  • Readded Captain CPS's game selection dialog icon support [Barry, CaptainCPS]
  • -
  • Fixed various localisation issues [Barry, reported by Benjamin Siskoo]
  • -
  • Updated the help file [Barry]
  • -
  • Split makefile.rules into makefile.burn_rules and makefile.burner_win32_rules [Barry]
  • -
  • Reorganised the tree to work around the Windows CreateProcess 32Kb limit [Barry]
  • -
  • Tidied the tree enough for FB Alpha to compile on Ubuntu 11.10 (linking fails) [kev]
  • -
  • Added old code from an unreleased PSP port, including the MIP A68K module [kev]
  • -
  • Added the required D3D headers from previous SDKs to the dec/vc/include folder [Barry]
  • -
  • Fixed some warnings thrown up by symbol builds in different compilers [Barry]
  • -
  • Fixed some dialog initial path issues [Barry]
  • -
  • Matched all sets to MAME 0.144u6 [Barry]
  • -
  • Matched the Megadrive sets to MESS 0.144u5 [Barry]
  • -
- - -

v0.2.97.18

-
    -
  • Added driver for Lemmings [iq_132]
  • -
  • Added support for trackball in Lemmings [Barry]
  • -
  • Added driver for Pac-Land [iq_132]
  • -
  • Added driver for games on Psikyo4 hardware [iq_132]
  • -
  • Added driver for games on Rabbit Punch hardware [iq_132]
  • -
  • Added a preliminary driver for SNES hardware, enabled in debug builds only [kev]
  • -
  • Changed CPS-3 driver to use MAME flash dumps, and added verification for CPS-3 driver back to ROM_VERIFY dat [Barry, suggested by Haze]
  • -
  • Added preliminary Puzzli2 protection simulation and removed the patches from the PGM driver [iq_132]
  • -
  • Delayed the VBlank IRQ in the CPS-2 driver to part through the VBlank period, fixes disappearing text in the Dungeons & Dragons games [Barry]
  • -
  • Added sound to fantzonep in the Sega System 16A driver [Barry]
  • -
  • Improved IRQ timing in Sega System Y driver [Barry]
  • -
  • Reduced the volume of some CPS-2 games that were too loud [Barry]
  • -
  • Fixed sound in Konami drivers which weren't generating enough IRQs per frame to drive the sound [Barry]
  • -
  • Fixed a bug in the K052360 sound core, fixes Parodius booting [Barry]
  • -
  • Fixed inputs in Dream Land in the Bubble Bobble driver [Barry]
  • -
  • Fixed Rambo III in the Taito B driver [Barry]
  • -
  • Fixed default dips in Yes/No Sinri Tokimeki Chart in the Taito F2 driver [Barry]
  • -
  • Tidied the CPS-1, CPS-2, Galaxian, Irem, Konami, Neo Geo, Sega and Taito drivers [Barry]
  • -
  • Changed the Zet interface to initialise a single CPU at a time, updated all affected drivers [iq_132]
  • -
  • Made sure the BurnYM2151 handlers are NULLed on exit [Barry]
  • -
  • Incorporated endian fixes from FBANext for various CPU cores and interfaces, as well as the CPS-3, Neo Geo, Psikyo, Sega, Taito and Toaplan drivers [Barry, FBANext by Lantus]
  • -
  • Added support for various MAME graphics decoding macros [iq_132]
  • -
  • Added some Unicode titles to the PGM driver [JacKc]
  • -
  • Fixed various localisation issues [Barry, reported by Benjamin Siskoo]
  • -
  • Changed default of the "Don't change Num Lock status" option to on [Barry]
  • -
  • Added SDL audio, input and video plugins so I can re-port to SDL [kev]
  • -
  • Moved the burner/win32 folder to burner/platform/win32 [kev]
  • -
  • Changed interface directory layout [kev]
  • -
  • Changed the path handling to be more portable (changed // to \) [kev]
  • -
  • Updated unzip.c to the latest version [kev]
  • -
  • Improved the gamelist filter functionality and added support for Capcom (Other), Data East, Seta, SNES and Technos filters, updating relevant drivers [Barry]
  • -
  • Moved any Irem, Kaneko, Sega, Taito or Toaplan drivers in the misc filters to the relevant filter [Barry]
  • -
  • Moved Konami drivers from misc to the Konami filter [iq_132]
  • -
  • Added defines for _XBOX headers and plugins in the burner and interface folders [Barry]
  • -
  • Reduced the optimisation levels for GCC 3.4.5 to match other GCC builds, fixed some warnings that are now generated by GCC 3.4.5 [Barry]
  • -
  • Matched all sets to MAME 0.144u4 [Barry]
  • -
- - -

v0.2.97.17

-
    -
  • Fixed various localisation issues [Barry, reported by Benjamin Siskoo]
  • -
  • Fixed some dipswitch descriptions in Boogie Wings and Major Title 2 [doomking]
  • -
  • Fixed CRC error in CPS Changer version of Warriors of Fate [pmc2]
  • -
  • Fixed Unicode title for Japanese versions of Dynasty Wars [kof2112]
  • -
  • Fixed Unicode title for Japanese versions of Warriors of Fate [DsNo]
  • -
- - -

v0.2.97.16

-
    -
  • Added driver for Super Locomotive [iq_132]
  • -
  • Added clone of Warriors of Fate to the CPS-1 driver [Barry]
  • -
  • Added Bygone to the Legend of Kage driver [iq_132]
  • -
  • Added colour PROMs to Birdiy in Pacman driver [iq_132]
  • -
  • Fixed spriteram2 mapping and sprite rendering in Birdiy in Pacman driver [Barry]
  • -
  • Added correct dumps to kovsgqyz and kovsgqyza in the PGM driver [iq_132]
  • -
  • Added clone of kovsgqyz to the PGM driver [iq_132]
  • -
  • Fixed character selection screen in kovsgqyz and clones in the PGM driver [iq_132]
  • -
  • Improved PGM sprite rendering [iq_132]
  • -
  • Added PGM sprite generator to makefiles [Barry]
  • -
  • Made V3021 RTC an external device, seperate from the PGM driver [iq_132]
  • -
  • Removed Street Fighter II' - champion edition (street fighter 2' 920803 USA, alt) as it is a bad dump [Barry]
  • -
  • Fixed some input and dip switch issues in the Bank Panic driver [Barry]
  • -
  • Added a debug device tracking module and updated all device, sound and CPU modules to support it [Barry]
  • -
  • Tidied all drivers in the cave, cps-3, megadrive, pgm, psikyo and toaplan folders, and updated to use Burn Memory module, as well as correcting any issues reported by debug tracker [Barry]
  • -
  • Updated M6502 CPU core interface to allocate memory rather than use an array [iq_132]
  • -
  • Updated Vez CPU core interface to allocate memory rather than use an array, and added support for auto-acknowledging IRQs [iq_132]
  • -
  • Fixed crash when taking screenshots of vertical or flipped games using blitters other than the D3D enhanced blitter [Barry]
  • -
  • Added option to DirectDraw blitter to force flipping as it isn't usually detected as available, see help file for more information [Barry]
  • -
  • Fixed issue with string translation in localisation templates [Barry, doomking]
  • -
  • Fixed issue with exporting localisation templates in GCC builds [Barry, doomking]
  • -
  • Converted all the outstanding hard-coded strings I could see to translatable strings, let me know if you see any untranslatable strings [Barry]
  • -
  • Tidied the string resource ids to minimise future impact on translators [Barry]
  • -
  • Updated help file [Barry]
  • -
  • Matched all sets to MAME 0.144u3 [Barry]
  • -
  • Matched the Megadrive sets to MESS 0.144u3 [Barry]
  • -
  • Updated the libpng library to v1.5.6 [Barry]
  • -
- - -

v0.2.97.15

-
    -
  • Fixed missing menu in Windows XP [CaptainCPS, doomking]
  • -
  • Fixed Neo Geo CD dialog game scanning timeout [CaptainCPS]
  • -
  • Better organised the Neo Geo menu items [CaptainCPS]
  • -
- - -

v0.2.97.14

-
    -
  • Ported the V20/V30/V33/V25/V35 CPU core from MAME [iq_132]
  • -
  • Updated Vez interface to support above CPU core port [iq_132]
  • -
  • Updated the M72, M90, Dynamite Duke and Raiden drivers to support the new Vez interface [iq_132]
  • -
  • Added sound support to the V25 based Toaplan drivers Batsugun, Dogyuun, Knuckle Bash and Grind Stormer [iq_132]
  • -
  • Added Risky Challenge and Gussun to release builds [iq_132]
  • -
  • Ported the M6502 CPU core from MAME, and added an interface for it, replacing the old core [Barry]
  • -
  • Enabled the sub-CPU types in the M6502 CPU Core and added support for them in the interface [iq_132]
  • -
  • Added support for the new M6502 core to the Renegade driver, fixing some graphic issues [Barry]
  • -
  • Added support for the new M6502 core to the DEC-8 driver, adding sound to all games [Barry]
  • -
  • Added support for the new M6502 core to the Karnov driver, adding sound to all games [Barry]
  • -
  • Updated the Gauntlet, Mole Attack, Mysterious Stones and Scrambled Egg drivers to support the new M6502 core [Barry]
  • -
  • Added SAA1099 sound core module and added support to the XOR World driver which now has sound [iq_132]
  • -
  • Added support to the DAC module for up to eight DACs [Barry]
  • -
  • Added BURN_SND_CLIP macro [Barry]
  • -
  • Fixed rendering MSM6295 sound in Seibu sound module [Barry]
  • -
  • Added Neo Geo CD Load Game dialog [CaptainCPS]
  • -
  • Integrated the Neo Geo CD Load Game dialog with the rest of the application and fixed several x64 issues [Barry]
  • -
  • Removed the BurnMedia functionality since it is replaced by the Neo Geo CD id module, and updated all drivers to reflect the new structure [Barry]
  • -
  • Changed the burn, burn/devices, burn/drivers, burn/sound, burner and interface folders to use defined variable types, allowing better control for ports to other architectures [Barry]
  • -
  • Changed the CPU interfaces to use defined variable types [Barry]
  • -
  • Fixed the source code tree to build with MinGW64 and GCC 4.6.1 allowing MinGW to build x86 and x64 builds [Barry]
  • -
  • Consolidated the mingw345 and mingw452 makefiles, and added support for GCC 4.6.1 to the makefile [Barry]
  • -
  • Moved the rules to makefile.rules and included makefile.rules in the mingw and vc makefiles [Barry]
  • -
  • Moved some win32 specific stuff from burner.h to burner_win32.h [kev]
  • -
  • Some 64-bit code fixes [TheMaister]
  • -
  • Changed the DirectX support to load the functions at runtime, removing the need for linking to the libraries [CaptainCPS]
  • -
  • Added support for building the experimental DirectX9 blitter and xAudio2 module with MinGW [CaptainCPS]
  • -
  • Tidied the DirectX changes to compile cleanly [Barry]
  • -
  • Added an alternative DirectX 9 blitter written by regret and modified it to work with FB Alpha [Barry, regret]
  • -
  • Added driver for Dragon Ninja, Heavy Barrel and Robocop on DEC-0 hardware [Barry]
  • -
  • Added bootleg of Knights of the Round to the CPS-1 driver [Barry, JacKc]
  • -
  • Added clone of Pang 3 to the CPS-1 driver [Barry]
  • -
  • Added clone of Street Fighter II Champion Edition to the CPS-1 driver [Barry]
  • -
  • Added clone of Cobra Command to the DEC-8 driver [Barry]
  • -
  • Added clone of Puckman to the Pacman driver [JacKc]
  • -
  • Improved the asic27_kov protection simulation, allowing Knights of Valour: SanGuo QunYingZhuan / Sangoku Senki: SanGuo QunYingZhuan to work, albeit with incorrect roms due to rom-hoarding [iq_132]
  • -
  • Added clone of Ninja Warriors to the Taito drivers [JacKc]
  • -
  • Added Fix Eight to the Toaplan drivers [iq_132]
  • -
  • Added Ghox to the Toaplan drivers [iq_132]
  • -
  • Added support for the analog paddle in Ghox [Barry]
  • -
  • Added clone of Alien Storm to the Sega System 18 driver [JacKc]
  • -
  • Added clone of JJ Squakwers to the Seta driver [JacKc]
  • -
  • Added clone of Ikari III to the SNK68 driver [JacKc]
  • -
  • Added Pipi & Bibis to the Toaplan drivers [iq_132]
  • -
  • Cleaned up 1945K-III driver and added support for generic rendering [iq_132]
  • -
  • Cleaned up the 4 Enraya driver and added support for 'unknown Pacman gambling game' [iq_132]
  • -
  • Fixed sound in Aquarium driver [Barry]
  • -
  • Fixed sound in Armed Formation driver [Barry]
  • -
  • Fixed crash in the Baraduke driver [Barry]
  • -
  • Fixed Saturn in the Blue Print driver [Barry]
  • -
  • Fixed sound in Caveman Ninja bootleg in the Caveman Ninja driver [Barry]
  • -
  • Fixed crash when exiting CPS-1 drivers [Barry]
  • -
  • Fixed sound in SD Gundam Psycho Salamander no Kyoui in D-Con driver [Barry]
  • -
  • Fixed coin inputs in Garyoret in the DEC-8 driver [Barry]
  • -
  • Fixed an app crash in the Garyoret and Gondo drivers in the DEC-8 driver [Barry]
  • -
  • Fixed orientation in Last Mission in the DEC-8 driver [Barry]
  • -
  • Fixed Shackled in the DEC-8 driver [Barry]
  • -
  • Corrected main and sub CPU clocks in the Double Dragon driver [Barry]
  • -
  • Fixed music tempo in Double Dragon [Barry]
  • -
  • Improved the volume balance between the YM2151 and the MSM5205's in the Double Dragon driver [Barry]
  • -
  • Added overclocking support to the Double Dragon driver [Barry]
  • -
  • Improved video timing and sound balance in the Exed Exes driver [Barry]
  • -
  • Added sample support to the Galaga driver [Barry]
  • -
  • Fixed sound in Got-cha Mini Game Festival [Barry]
  • -
  • Fixed clone of Gyrodine in the Kyugo driver [Barry]
  • -
  • Fixed orientation of vertical games in the Lady Bug driver [Barry]
  • -
  • Fixed bootleg of Legend of Kage in the Legend of Kage driver [Barry]
  • -
  • Added ADPCM sound to Avengers and Trojan in the Legendary Wings driver [Barry]
  • -
  • Fixed music tempo in the M92 driver [Barry]
  • -
  • Fixed crash in Magical Cat Adventure driver [Barry]
  • -
  • Added support for second DAC in Mogua Desse driver [Barry]
  • -
  • Fixed sound in Mug Smashers driver [Barry]
  • -
  • Added support for the NeoOpen BIOS v0.1 beta to the NeoGeo driver [Barry]
  • -
  • Fixed driver reset in Task Force Harrier in the NMK16 driver [Barry]
  • -
  • Fixed sound in the Afega games in the NMK16 driver [Barry]
  • -
  • Fixed music tempo in Macross 2 and Thunder Dragon in the NMK16 driver [Barry]
  • -
  • Big cleanup of the Pacman driver, adding support for Pengo and a few clones [iq_132]
  • -
  • Fixed orientation of all games in the Pacman driver [Barry]
  • -
  • Fixed Paint Roller in the Pacman driver and added to release builds [Barry]
  • -
  • Fixed inputs in Ponpoko in the Pacman driver [Barry]
  • -
  • Fixed Woodpecker (set 2) in the Pacman driver and added to release builds [Barry]
  • -
  • Fixed sound in Pass driver [Barry]
  • -
  • Fixed sound in Power Instinct (bootleg set 2) [Barry]
  • -
  • Fixed service mode dips in Pushman driver [Barry]
  • -
  • Fixed crash in Pushman (Korea, set 2) [Barry]
  • -
  • Added Rally X to release builds since I obviously forgot when I wrote the driver! [Barry]
  • -
  • Emulated the MCU in the Renegade driver [Barry]
  • -
  • Emulated the custom ADPCM sound in the Renegade driver [Barry]
  • -
  • Fixed DAC sound in Route 16 driver [Barry]
  • -
  • Added NVRAM saving in the Seta 2 driver, meaning that gun callibrations are stored when exiting [Barry]
  • -
  • Fixed clone of Joe & Mac Returns in Simple 156 driver [Barry]
  • -
  • Fixed sound in SUNA16 driver [Barry]
  • -
  • Fixed Get Star (bootleg set 1) in Tiger Heli driver [Barry]
  • -
  • Emulated MCU in non-bootleg versions of Alcon and Slapfight in Tiger Heli drivers which are now working [Barry]
  • -
  • Simulated MCU in non-bootleg version of Get Star in Tiger Heli driver which is now working [Barry]
  • -
  • Added clone of Get Star to the Tiger Heli driver [Barry]
  • -
  • Added ADPCM sound to Toramich in the Tiger Road driver [Barry]
  • -
  • Fixed DAC sound in Kabuki-Z in the TNZS driver [Barry]
  • -
  • Fixed inputs and added sound in bootleg of Toki in the Toki driver [Barry]
  • -
  • Fixed sound in Jumping Pop in Tumble Pop bootleg driver [Barry]
  • -
  • Fixed sound in Buccaneers and Kickle Cubele in the Vigilante driver [Barry]
  • -
  • Fixed orientation in Vulgus [Barry]
  • -
  • Fixed WWF WrestleFest (US bootleg) in WWF Wrestlefest driver [Barry]
  • -
  • Fixed sound in Magic Bubble in the Yun Sung 16 driver [Barry]
  • -
  • Fixed a crash when starting the Neo Geo driver from the command-line [Barry]
  • -
  • Removed a 64Mb rom limit on Neo Geo sprite ROM size, fixing kof98ae and maybe some others [Barry]
  • -
  • Fixed an app crash when exiting drivers using the taito_m68705 module [Barry]
  • -
  • Moved Atari and Kaneko16 into the misc categories and added a category for Irem to the game selection dialog [Barry]
  • -
  • Fixed nullifying pointers in BurnFree in the Burn memory module [Barry]
  • -
  • Tidied all drivers in the misc_post90s and misc_pre90s folders, and updated to use Burn Memory module and BURN_SND_CLIP macro [Barry]
  • -
  • Moved Kaneko Pandora code to it's own file [Barry]
  • -
  • Moved Air Buster driver to misc_post90s folder [Barry]
  • -
  • Changed sega_decode_317 in the System1 driver to support external use and removed the duplicated code in the Angel Kids driver [Barry]
  • -
  • Matched all sets to MAME 0.144u1 [Barry]
  • -
- - -

v0.2.97.13

-

This version features what is effectively a new Neo Geo driver. The emulation should be at least as good as before, but now with added support for MVS Multislot and Neo Geo CD. The Neo Geo CD support is preliminary at this stage, compatibility is pretty good, but some games don't work currently.

-
    -
  • Neo Geo Updates
      -
    • Added support for Neo Geo MVS multi-slot emulation and Neo Geo CDZ [Barry, heavily based on some old code from Jan_Klaassen]
    • -
    • Changed the ISO+MP3 CD Interface module to ISO+WAV [CaptainCPS]
    • -
    • Added some demo roms to the Neo Geo driver [Barry]
    • -
    • Added support for the prototype sprite roms to the Neo Geo driver [Barry]
    • -
    • Fixed text layer tiles in kof10th [iq_132]
    • -
    • Added a hack to the sprite routines for Samurai Shodown RPG text boxes [iq_132]
    • -
    • Added prototype of Alpha Mission II to the Neo Geo driver [Barry]
    • -
    • Added prototype of Burning Fight to the Neo Geo driver [Barry]
    • -
    • Added prototype of King of the Monsters 2 to the Neo Geo driver [Barry, JacKc]
    • -
    • Fixed "most recent games" list when using Neo Geo multi-slot [Barry]
    • -
    • Added a module to identify Neo Geo CD games [CaptainCPS]
    • -
  • -
  • Ported H6280 CPU Core from MAME [iq_132]
  • -
  • Added module to support vector games [iq_132]
  • -
  • Added driver for Aztarac [iq_132]
  • -
  • Hooked up analog joystick and dial in Aztarac driver [Barry]
  • -
  • Added driver for games on Data East DECO16 hardware [iq_132]
  • -
  • Added clone of Guwange to the Cave driver [Barry]
  • -
  • Added alternate bootleg of Street Fighter II - champion edition Accelerator! to the CPS-1 driver [JacKc]
  • -
  • Added two clones of Battle Shark to the Taito-Z driver [Barry]
  • -
  • Updated all source code with checks for memory used before freeing and NULLing all allocated memory after freeing [Barry]
  • -
  • Optimised the Irem GA20 sound core [iq_132]
  • -
  • Changed the MS5205 stream buffer allocation to account for differing refresh rates, fixing the crash in the Double Dragon driver when exiting games [Barry]
  • -
  • Fixed some stability issues in the Cave drivers [Barry]
  • -
  • Fixed inputs in Robocop 2 in the DECO16 driver [Barry]
  • -
  • Fixed savestate support in the Taito-Z driver when no Z80 is present [Barry]
  • -
  • Fixed an issue where the state of Tatio games was being auto-saved when it shouldn't be [Barry]
  • -
  • Fixed screen clear code in Toaplan-1 games [Barry]
  • -
  • Fixed Sound Error in Battle Bakraid [Barry]
  • -
  • Fixed some stability issues in the Toaplan drivers [Barry]
  • -
  • Fixed dat file generation module to output the html entities for the characters <> [Barry]
  • -
  • Updated the description tag of the generated dat files to identify between arcade and Megadrive [Barry]
  • -
  • Fixed some duplicate game descriptions [Barry]
  • -
  • Removed a duplicate set of Demon World from the driver [Barry]
  • -
  • Removed bioses from the driver count in the game selection dialog [Barry]
  • -
  • Changed the background colour of clones in the game selection dialog to make them stand out a little bit more [Barry]
  • -
  • Matched all sets to MAME 0.143u9 [Barry]
  • -
  • Matched the Megadrive sets to MESS 0.143u8 [Barry]
  • -
  • Updated the help file to reflect above changes [Barry]
  • -
- - -

v0.2.97.12

-

Note: This version has some changes to the Megadrive driver. The driver is now based on the MESS software list.

-

The game shortnames are prepended by md_ to differentiate them from the arcade games where conflicts occur. FB Alpha will look for your roms in the normal zip names, you do not need to create a new copy of the games and prepend md_. It is advisable to have the Megadrive roms in the seventh or eighth rom paths to avoid conflicts with arcade games. Support files will need to retain the md_ in order to avoid conflicts, however.

-

All Megadrive games are now enabled (except for Virtua Racing because the SVP isn't emulated), most should work, however, some may not.

-
    -
  • Megadrive Changes -
      -
    • Updated Megadrive driver based on MESS 0.143u7 software list [Barry]
    • -
    • Made the seventh rom path special like the eighth one so that Megadrive roms can be stored in one of the last two paths and still allow supplementary FB Alpha roms to be in a seperate path [Barry]
    • -
    • Made the short name in the game selection dialog slightly longer to accomodate the Megadrive short names [Barry]
    • -
    • Increased the maximum number for sek handlers to 10 [Barry]
    • -
    • Added better SRAM support and support for custom mappers as per MESS [Barry]
    • -
    • Removed menu option for making a datfile with both arcade games and Megadrive games, the two would conflict, and arcade and Megadrive dats need to be handled seperately [Barry]
    • -
    • Updated the dat file creation module to remove the md_ from the Megadrive shortnames [Barry]
    • -
  • -
  • Added clone of Aquajack to the Taito-Z driver [Barry]
  • -
  • Added clone of Vigilante to the Vigilante driver [Barry]
  • -
  • Fixed music tempo and continuity in Item M90 and M92 drivers [iq_132]
  • -
  • Added option to the YM2413 to decrease volume and used it to correct sound in the Mitchell driver [Barry]
  • -
  • Fixed the gun inputs in Zombie Raid [Barry]
  • -
  • Fixed the support file path creation for the IPS folders on app init [Barry]
  • -
  • Fixed immediate update of Apply Patches checkbox in game selection dialog when applying IPS Patches [Barry]
  • -
  • Added ability to search the drivers short name as well as the description in the Game Selection dialog [Barry]
  • -
  • Made the Game Selection dialog search interactive and removed the Search button [Barry]
  • -
  • Made the Game Selection dialog choose the current loaded game if a game is currently loaded [Barry]
  • -
  • Fixed crash when (de)selecting auto-frameskip and using the DirectSound audio module [Barry]
  • -
  • Restored the uxtheme style for the application [Barry]
  • -
  • Matched all sets to MAME 0.143u7 [Barry]
  • -
- - -

v0.2.97.11

-
    -
  • Readded the IPS Manager functionality, updating it to support x64 and the new PNG routines [Barry]
  • -
  • Added a search option to the Game Selection dialog [Barry]
  • -
  • Updated the help file to reflect above changes [Barry]
  • -
- - -

v0.2.97.10

-
    -
  • Redesigned the game selection dialog [Barry]
  • -
  • Added a dialog to view roms and/or samples required by a driver to the game selection dialog [Barry]
  • -
  • Removed the incomplete Neo Geo multi-slot implementation [Barry]
  • -
  • Removed the "save decrypted C roms" functionality [Barry]
  • -
  • Removed the jukebox functionality and resources [Barry]
  • -
  • Removed support for datfiles other than the latest ClrMAME format [Barry]
  • -
  • Removed the package importer and resources [Barry]
  • -
  • Removed the menu themes and resources [Barry]
  • -
  • Removed skins and resources [Barry]
  • -
  • Removed the gamelist translation module and resources [Barry]
  • -
  • Removed icons support and resources [Barry]
  • -
  • Removed the favourites functionality and resources [Barry]
  • -
  • Removed the context menu from the game selection dialog [Barry]
  • -
  • Removed IPS Patch functionality and resources [Barry]
  • -
  • Removed the game information dialog and resources [Barry]
  • -
  • Removed unneeded support file paths and resources [Barry]
  • -
  • Removed IPS Patch functionality and resources [Barry]
  • -
  • Restructured source code and removed any unneeded modules [Barry]
  • -
  • Removed PNGlib and updated preview loading code to use libPNG [Barry, heavily based on some old code from Jan_Klaassen]
  • -
  • Updated preview loading code to allow interpolation on resizing [Barry, heavily based on some old code from Jan_Klaassen]
  • -
  • Fixed the localisation template support [Barry]
  • -
  • Tidied up the resource files [Barry]
  • -
  • Added flag to the makefile allowing X86 assembly code to not be built, and added support in the code to not build X86 assembly when defined [Barry]
  • -
  • Fixed sound rendering in the YM2151 module when not using the MMX routines [Barry]
  • -
  • Tidied up the source code to compile with Microsoft tools when building in an X64 environment [Barry]
  • -
  • Added an option in the makefile to build an X64 binary, and updated the VC makefile and source code to support it [Barry]
  • -
  • Added ability to change the volume of the YM2203 module and used it to bring down the volume in the 1943 driver [Barry]
  • -
  • Fixed FM Interpolation rendering routine in the YM2203 module [Barry]
  • -
  • Added support for the YM2610 module to mix the sounds into one stream (mono) and updated the Bonze Adventure, Darius 2, Operation Thunderbolt, Taito-B, Taito-Z and Welltris drivers to use it [Barry]
  • -
  • Added Super Chase to release builds as it works fine except for sound [Barry]
  • -
  • Fixed missing sounds in the 1943 driver [Barry]
  • -
  • Disabled the corrupt boot screen in Last Hope in the Neo Geo driver [Barry, with info from Johnboy]
  • -
  • Corrected default dip values in the PS2 datafile System 16B version of Bloxeed [Barry]
  • -
  • Fixed some rom sizes in the Irem M72 driver [Barry]
  • -
  • Updated the help file based on the above feature cull [Barry]
  • -
- - -

v0.2.97.09

-
    -
  • Ported the ARM CPU core from MAME [iq_132]
  • -
  • Ported the MSM5205 sound core from MAME, replacing the old core [iq_132]
      -
    • Updated the Asuka driver to use it [Barry]
    • -
    • Updated the Double Dragon driver to use it [Barry]
    • -
    • Updated the Street Fighter driver to use it [iq_132]
    • -
    • Updated the Taito Misc driver to use it, giving ADPCM sound in Darius [Barry]
    • -
    • Updated the Tecmo driver to use it [Barry]
    • -
  • -
  • Ported the ES8712 sound core from MAME [iq_132]
  • -
  • Updated the TMZ280B core to support missing sound modes [iq_132]
  • -
  • Tidied up the samples interface [Barry]
      -
    • Updated the DrvBurnStruct to support sample filename, and sample lists
    • -
    • Updated the sample module initialisation to use the BurnSampleInfo struct
    • -
    • Updated the Rally X driver to use the new code
    • -
    • Added the sample path to the Support Path dialog and the config file making it configurable
    • -
    • Added a Sample Info tab to the game information dialog
    • -
    • Added "uses samples from" info to the game information, game selection, and jukebox dialogs
    • -
    • Added sample support to the dat file writing module
    • -
  • -
  • Updated the zlib library to v1.2.5 [Barry]
  • -
  • Updated the libpng library to v1.5.4 [Barry]
  • -
  • Added regret's DirectInput8 module and updated it for FB Alpha, replacing the DirectInput7 module [Barry]
  • -
  • Removed dependency on dxguid lib since it is no longer available [Barry]
  • -
  • Added ability to compile without A68K, definable via BUILD_A68K makefile option [Barry]
  • -
  • Rewrote the Taito TC0100SCN module and updated all the drivers that used it, adding support for multiple screens and hopefully making it faster [Barry]
  • -
  • Added double width support to the TC0480SCP module [Barry]
  • -
  • Added multiple chip support to the PC080SN module [Barry]
  • -
  • Fixed sprite rendering order in Warrior Blade [Barry]
  • -
  • Added a memory management module to the burn library [iq_132]
  • -
  • Added support to the generic tiles module to decode single tiles [Barry]
  • -
  • Reduced the volume in the K053260 core to remove distortion and corrected the left and right channels [Barry, reported by Huggybaby]
  • -
  • Fixed Loop Address in Sega PCM Module, as per MAME 0.141u1, fixing sound in Super Monaco Grand Prix [Barry]
  • -
  • Added driver for Backfire [iq_132]
  • -
  • Added driver for Chack'n Pop [iq_132]
  • -
  • Added driver for Darius II (dual screen) and Warrior Blade [Barry]
  • -
  • Added driver for games on Data East Simple 156 System hardware [iq_132]
  • -
  • Added driver for Dynamite Duke [iq_132]
  • -
  • Added driver for games on Gaelco hardware [iq_132]
  • -
  • Added driver for games on Irem M62 hardware [Barry]
  • -
  • Added driver for games on Irem M63 hardware [iq_132]
  • -
  • Added driver for games on Irem M72 hardware [iq_132]
  • -
  • Added driver for games on Irem M90 hardware, replacing old driver [iq_132]
  • -
  • Added driver for games on Irem M92 hardware, replacing old driver [iq_132]
  • -
  • Added driver for Lord of Gun and Alien Challenge [iq_132]
  • -
  • Added driver for Marine Boy [kenshiro]
  • -
  • Added driver for Operation Thunderbolt [Barry]
  • -
  • Added driver for Pocket Gal Deluxe [iq_132]
  • -
  • Added Cave games to the PGM driver and made other improvements to the driver [iq_132]
  • -
  • Added some non-working clones to the PGM driver [JacKc]
  • -
  • Added driver for the S2650 based Pacman games [iq_132]
  • -
  • Added Fantasy Zone 2 to the Sega System 16B driver [Barry]
  • -
  • Added driver for games on Seta hardware [iq_132]
  • -
  • Added driver for Success Joe [iq_132]
  • -
  • Added driver for games on Taito-B hardware [iq_132]
  • -
  • Added driver for games on Tecmo System hardware [iq_132]
  • -
  • Added driver for Varia Metal [iq_132]
  • -
  • Added driver for World Cup '90 bootleg hardware [Barry]
  • -
  • Added driver for Xor World [iq_132]
  • -
  • Added The Pit to the Galaxian driver [Barry]
  • -
  • Added Triple Draw Poker to the Galaxian driver [Barry]
  • -
  • Added Puzzle Break to the Hyper Pacman driver [Barry]
  • -
  • Added a module for the Taito TC0180VCU tilemap chip [iq_132]
  • -
  • Added a module for the Tatio TC0640FIO I/O chip [Barry]
  • -
  • Ported MAME's Time Keeper module to FB Alpha [Barry]
  • -
  • Fixed some inputs in the Taito B driver [Barry]
  • -
  • Added Thunder Fox to the Taito F2 driver [Barry]
  • -
  • Added Operation Wolf 3, Slapshot and Top Speed to the Taito Misc driver [Barry]
  • -
  • Added Volfied to the Taito Misc driver [Barry]
  • -
  • Added bootleg of 1943 to the 1943 driver [Barry]
  • -
  • Added 2 clones to the 1943 driver [Barry]
  • -
  • Added clone of Armed Formation to the Armed Formation driver [Barry]
  • -
  • Added clone of Black Tiger to the Black Tiger button [Barry]
  • -
  • Added clone of Blood Bros. to the Blood Bros. driver [BisonSAS]
  • -
  • Added Koro Koro Quest and Crusher Makochan to the Cave driver [iq_132]
  • -
  • Removed fake region switches and added clones to Air Gallet, Mazinger Z and Pretty Soldier Sailor Moon in the Cave driver [Barry]
  • -
  • Added clone of 1941 to the CPS-1 driver [Barry]
  • -
  • Added bootleg of Cadillacs and Dinosaurs (Dinosaur Hunter) to the CPS-1 driver [Barry, JacKc]
  • -
  • Added 2 clones of Captain Commando to the CPS-1 driver [Barry]
  • -
  • Added clone of Dynasty Wars to the CPS-1 driver [Barry]
  • -
  • Added clone of Final Fight to the CPS-1 driver [Barry]
  • -
  • Added 2 clones of Forgotten Worlds to the CPS-1 driver [Barry]
  • -
  • Added 2 clones of King of Dragons to the CPS-1 driver [Barry]
  • -
  • Added clone of Knights of the Round to the CPS-1 driver [Barry]
  • -
  • Added bootleg of The Punisher to the CPS-1 driver [JacKc]
  • -
  • Added bootleg of Street Fighter 2 to the CPS-1 driver [Barry]
  • -
  • Added 2 clones of Street Fighter 2 to the CPS-1 driver [Barry]
  • -
  • Added clone of Street Fighter 2 Champion Edition to the CPS-1 driver [Barry]
  • -
  • Added clone of UN Squadron to the CPS-1 driver [Barry]
  • -
  • Added clone of Dungeons & Dragons: Tower of Doom to the CPS-2 driver [Barry]
  • -
  • Added clone of Eco Fighters to the CPS-2 driver [Barry]
  • -
  • Added clone of Gigawing to the CPS-2 driver [Barry]
  • -
  • Added clone of Marvel vs. Capcom to the CPS-2 driver [Barry]
  • -
  • Added clone of Ring of Destruction to the CPS-2 driver [Barry]
  • -
  • Added clone of Street Fighter Alpha to the CPS-2 driver [Barry]
  • -
  • Added clone of Street Fighter Alpha 2 to the CPS-2 driver [Barry]
  • -
  • Added 2 clones of Street Fighter Alpha 3 to the CPS-2 driver [Barry]
  • -
  • Added 3 clones of X-Men: Children of the Atom to the CPS-2 driver [Barry]
  • -
  • Added clone of X-Men vs. Street Fighter to the CPS-2 driver [Barry]
  • -
  • Added several Phoenix sets to the CPS-2 driver [Barry]
  • -
  • Added clones of Red Earth to the CPS-3 driver [Barry]
  • -
  • Added support to the CPS-3 driver for JoJo's Venture USA BIOS [Barry]
  • -
  • Added support to the CPS-3 driver for Street Fighter III Hispanic BIOS [Barry]
  • -
  • Added 2 clones of Street Fighter Zero to the CPS Changer driver [Barry]
  • -
  • Added 3 clones of Street Fighter Zero to the CPS Changer driver [JacKc]
  • -
  • Added clone of Double Dragon to the Double Dragon driver [Barry]
  • -
  • Added clone of Biomechanical Toy to the Gaelco driver [Barry]
  • -
  • Added clone of Amidar to the Galaxian driver [Barry]
  • -
  • Added clone of Defend the Terra Attack on the Red UFO to the Galaxian driver [Barry]
  • -
  • Added clone of Hot Shocker to the Galaxian driver [Barry]
  • -
  • Added 2 clones of Moon Cresta to the Galaxian driver [Barry]
  • -
  • Added clone of Moon Shuttle to the Galaxian driver [Barry]
  • -
  • Added clone of Scorpion to the Galaxian driver [Barry]
  • -
  • Added clone of Scramble to the Galaxian driver [Barry]
  • -
  • Added clone of Streaking to the Galaxian driver [Barry]
  • -
  • Added bootleg of Gyruss to the Gyruss driver [Barry]
  • -
  • Added clone of Parodius DA! to the Konami driver [Barry]
  • -
  • Added clone of Teenage Mutant Ninja Turtles to the Konami driver [Barry]
  • -
  • Added clone of Iron Clad to the Neo Geo driver [JacKc]
  • -
  • Added clone of Jockey GP to the Neo Geo driver [Barry]
  • -
  • Added clone of King of Fighters '97 to the Neo Geo driver [Barry]
  • -
  • Added clone of King of Fighters '98 to the Neo Geo driver [Barry]
  • -
  • Added Last Hope to the Neo Geo driver [Barry, Robert]
  • -
  • Added clone of Quiz Daisousa Sen to the Neo Geo driver [Barry, JacKC]
  • -
  • Added clone of Quiz King of Fighters to the Neo Geo driver [Barry, JacKC]
  • -
  • Added clone of Real Bout Fatal Fury Special to the Neo Geo driver [Barry, JacKC]
  • -
  • Added Oriental Legend Special Plus to the PGM driver[iq_132, info from CreamyMami]
  • -
  • Added clone of Prehistoric Isle to the Prehistoric Isle driver [Barry]
  • -
  • Added clone of Space Bomber to the Psikyo SH-2 driver [Barry]
  • -
  • Added clone of Fantasy Zone to the Sega System 16A driver [Barry]
  • -
  • Added clone of Shinobi to the Sega System 16A driver [Barry]
  • -
  • Added clone of Bloxeed to the Sega System 16B driver [Barry]
  • -
  • Added clone of Fantasy Zone to the Sega System 16B driver [Barry]
  • -
  • Added clone of Heavyweight Champ to the Sega System 16B diver [Barry]
  • -
  • Added the ISG bootlegs to the Sega System 16B driver [Barry]
  • -
  • Added clone of Desert Breaker to the Sega System 18 driver [Barry]
  • -
  • Added clone of Galaxy Force 2 to the Sega Y-Board driver [Barry]
  • -
  • Added clone of Rail Chase to the Sega Y-Board driver [Barry]
  • -
  • Added clone of Street Fighter to the Street Fighter driver [Barry]
  • -
  • Added clone of Armed Police Batrider to the Toaplan-2 driver [Barry]
  • -
  • Added clone of Dogyuun to the Toaplan-2 driver [Barry]
  • -
  • Added clone of Vigilante to the Vigilante driver [Barry]
  • -
  • Made the foreground layer in Air Buster transparent [Barry, reported by BisonSAS]
  • -
  • Fixed the background rendering in Anteater [Barry]
  • -
  • Tidied the dips in the Blood Bros. driver [BisonSAS]
  • -
  • Tidied up the dips, titles, and manufacturers in the Cave driver as well as fixing EEPROM config in Hotdog Storm and Metomoquester and fixing savestates [BisonSAS]
  • -
  • Made the Resale versions of CPS-1 games run at 12MHz [Barry]
  • -
  • Tidied up dips and added Unicode title to the Crash Race driver [BisonSAS]
  • -
  • Forced the Demon World driver to use the Musashi 68000 core [iq_132]
  • -
  • Fixed the Gun Smoke driver video and sound speed [Lantus]
  • -
  • Added unicode titles, fixed some inputs and dips, and corrected some resolutions in all of the Konami drivers [BisonSAS]
  • -
  • Fixed the sprite offset in the Konami Ultraman driver [BisonSAS]
  • -
  • Fixed inputs and dips and added Unicode titles to the Magical Cat Adventure driver [BisonSAS]
  • -
  • Fixed an error in the Metal Slug 5 (bootleg) driver initialisation [kenshiro]
  • -
  • Fixed inputs and added Unicode title to the Mogura driver [BisonSAS]
  • -
  • Labelled the HyperFlip button in Moon War [Barry]
  • -
  • Tidied up the Power Instinct driver fixing some Z80 handling, Z80 reads and writes, sound hardware handling and boosted the interleave to fix the sound [Barry, reported by BisonSAS]
  • -
  • Fixed a romsize in the Robocop driver [JacKc]
  • -
  • Correctly cleared the screen in the Seta2 driver, fixing Subsino logo in Penguin Brothers [Barry, reported by BisonSAS]
  • -
  • Added unicode titles to the Tumble Pop bootleg driver [BisonSAS]
  • -
  • Fixed dip switches in the Turbo Outrun driver [Barry]
  • -
  • Fixed inputs and dips and added Unicode titles to the Welltris driver [BisonSAS]
  • -
  • Corrected clocks in the Double Dragon driver [Barry]
  • -
  • Corrected clocks in World Cup 90 as per MAME 0.136u4 [Barry]
  • -
  • Added ability to adjust CPU speed in the World Cup 90 driver [Barry]
  • -
  • Added ability to adjust CPU speed in the Sega drivers [Barry]
  • -
  • Added ability to adjust CPU speed in the Megadrive driver [Barry, suggested by manliodp]
  • -
  • Fixed a psikyosh crash and implemented the graphics banking[iq_132]
  • -
  • Fixed rotated screenshots [BisonSAS, regret (FBAShuffle)]
  • -
  • Fixed the "include" implementation in the cheat file parser [BisonSAS]
  • -
  • Removed kof95a as it seems to be a bad dump [JacKc]
  • -
  • Excluded Neo Geo "decrypted C sets" from the build [Barry]
  • -
  • Added support to the Neo Geo driver for a new BIOS rom [Barry]
  • -
  • Corrected the Iron Clad V3 rom in the Neo Geo driver [JacKc]
  • -
  • Updated the Forgotton Worlds alt gfx set loading routine to support the new rom layout [Barry]
  • -
  • Updated the CPS-1 mappers as per MAME [Barry]
  • -
  • Updated the dat file writing module to ignore the CPS-3 driver when writing the ROM_VERIFY dat [Barry]
  • -
  • Fixed priorities in Magical Cat Adventure driver [iq_132]
  • -
  • Fixed sprites in Bloxeed, making it working [Barry]
  • -
  • Improvements to the M68705 core [iq_132]
  • -
  • Tidied up the dips and the driver for Batrider, Battle Garegga, Batsugun and Dogyuun [JackC]
  • -
  • Added 1360x768 to the auto-detect aspect ratio code [CaptainCPS]
  • -
  • Fixed the favorites feature with drivers longer than 8 characters [CaptainCPS]
  • -
  • Reverted back to the perl script for generating driverlist.h and amended it to support the changes to the BurnDriver struct since it was last used [Barry]
  • -
  • Tidied code to build without warning using GCC 3.4.5 and GCC 4.5.2 [Barry]
  • -
  • Updated the compile guides to work with the newest available tools [Barry]
  • -
  • Matched all sets to MAME 0.143u6 [Barry]
  • -
- - -

v0.2.97.08

-
    -
  • Added a sample player to the Burn library to allow external samples to used with drivers [iq_132]
  • -
  • Added a module to display LEDs on screen [iq_132]
  • -
  • Ported MAME's M6805 core and added an interface for it to the burn library [iq_132]
  • -
  • Added an interface to the M68705 core for Taito games [iq_132]
  • -
  • Enabled the Y8950 emulation in fmopl.c and created a module for it in the burn library [Barry]
  • -
  • Fixed VSynch support in all blitters [CaptainCPS]
  • -
  • Added a RGB hex display to the Palette Viewer [Barry]
  • -
  • Added support to the System 16 FD1094 interface for multiple CPUs [Barry]
  • -
  • Added memory callback support to the HD6309 core interface [Barry]
  • -
  • Added custom tile size support to the Generic Tiles Rendering module [Barry]
  • -
  • Added generic rendering for games using transparency tables [iq_132]
  • -
  • Added support to the Namco Sound module for stereo sound and fixed the mono output [iq_132]
  • -
  • Added CUS30 handling to the Namco Sound module [iq_132]
  • -
  • Enabled m6803_internal_register_r in the M6800 CPU core [iq_132]
  • -
  • Added driver for Air Buster [iq_132]
  • -
  • Added driver for games on Angel Kids hardware [iq_132]
  • -
  • Added driver for Baraduke [iq_132]
  • -
  • Added driver for Egg Hunt [iq_132]
  • -
  • Added driver for Fairy Land Story [iq_132]
  • -
  • Added driver for Ginga NinkyouDen [iq_132]
  • -
  • Hooked up the Y8950 sound in Ginga NinkyouDen [Barry]
  • -
  • Added driver for games on Lady Bug hardware [iq_132]
  • -
  • Added driver for Markham [iq_132]
  • -
  • Added driver for Mogura Desse [iq_132]
  • -
  • Added driver for Pushman [iq_132]
  • -
  • Added driver for Sky Kid [iq_132]
  • -
  • Added driver for Speed Spin [iq_132]
  • -
  • Added driver for Asuka & Asuka and similar games on Taito hardware [iq_132 (thanks to JackC for testing)]
  • -
  • Added driver for Welltris [iq_132]
  • -
  • Added clone of 1942 to the 1942 driver [Barry]
  • -
  • Added clone of Arkanoid to the Arkanoid driver [Barry]
  • -
  • Enabled clones of Arkanoid that require the M68705 CPU [iq_132]
  • -
  • Added bootleg of Final Fight to the CPS-1 driver [Barry]
  • -
  • Added clone of Pang 3 to the CPS-1 driver [Barry]
  • -
  • Added Street Fighter 2 (Double K.O. Turbo II) bootleg to the CPS-1 driver [iq_132]
  • -
  • Added clone of Dark Stalkers to the CPS-2 driver [Barry]
  • -
  • Added clone of Dungeons & Dragons: Shadow Over Mystara to the CPS-2 driver [Barry]
  • -
  • Added clone of Hyper Street Fighter 2 to the CPS-2 driver [Barry]
  • -
  • Added clone of Mega Man 2 to the CPS-2 driver [Barry]
  • -
  • Added clone of Super Puzzle Fighter 2 Turbo to the CPS-2 driver [Barry]
  • -
  • Rewrote the Dec0 driver from scratch (currently preliminary) [Barry]
  • -
  • Added Dark Tower to the Double Dragon driver [Barry]
  • -
  • Added clone of Moon Cresta to the Galaxian driver [Barry]
  • -
  • Added clone of Scramble to the Galaxian driver [Barry]
  • -
  • Added WOW New Fantasia to the Gals Panic driver [BisonSAS]
  • -
  • Added clone of Ghosts n' Goblins to the Ghost's n' Goblins driver [Barry]
  • -
  • Added clone of X-Men to the Konami driver [Barry]
  • -
  • Added clone of Airwolf to the Kyugo driver [Barry]
  • -
  • Added clone of Last Duel to the Mad Gear driver [Barry]
  • -
  • Added clone of King of Fighters '95 to the Neo Geo driver [iq_132]
  • -
  • Added clone of Samurai Shodown II to the Neo Geo driver [Barry]
  • -
  • Added clone of Samurai Shodown IV to the Neo Geo driver [Barry]
  • -
  • Added Ironclad to the the Neo Geo driver [iq_132]
  • -
  • Added kof96ep, kof97pla, kf2k1pls, kf2k1pa, cthd2k3a, kf2k2plb, kf2k2plc, kf2k4pls, mslug5b, kof96cn, kof96ae, kof97cn, kof97xt, kof98ae and kf2k2ps2 to the Neo Geo driver [Barry]
  • -
  • Added Popeye-Man to the Pacman driver [Barry]
  • -
  • Added preliminary driver for Rally X [Barry]
  • -
  • Added clone of Alien Syndrome to the Sega System 16B driver [Barry]
  • -
  • Added clone of Super Hang-On to the Sega Hang-On driver (enabled in debug builds only because it doesn't work) [Barry]
  • -
  • Added clone of Mega Blast to the Taito F2 driver [Barry]
  • -
  • Enabled clones of Tiger Heli that require the M68705 core [iq_132]
  • -
  • Added Demon World, Fire Shark, Rally Bike, and Vimana to the Toaplan-1 driver [iq_132]
  • -
  • Added Knuckle Bash 2 to the Toaplan-2 driver [iq_132]
  • -
  • Added clone of Outzone to the Toaplan-1 driver [Barry]
  • -
  • PGM Changes [iq_132]
      -
    • 02-27-2010
        -
      • Added kov2a and kov2b (kov2b is disabled) partially dumped sets
      • -
      • Thanks to JackC for helping sort a few sets.
      • -
    • -
    • 12-05-2009
        -
      • Added Happy6in1 (XingXing)
      • -
      • Added newer 68k bios (XingXing)
      • -
      • Added fake dip switch to switch beween 68k bios versions
      • -
      • Added kovsh103 (XingXing)
      • -
      • Added martmastc102 (XingXing)
      • -
      • Added region dips for martmastc102
      • -
      • Added proper dump for demon front (alt) (XingXing)
      • -
      • Added several pgm bootleg/hacks from MAME Plus
      • -
      • Added proper dump for orlegendc
      • -
      • Labeled region dips as "fake" as they are really hacks since PGM games usually have their regions supplied by the protection devices.
      • -
    • -
  • -
  • Corrected the CPU clocks in the Outrun driver as per MAME 0.135u4 [Barry]
  • -
  • Fixed a memory issue when exiting the CPS-1 driver [iq_132]
  • -
  • Fixed a crash when loading games in the Blood Bros. driver [BisonSAS and iq_132]
  • -
  • Fixed graphics in My Angel 2 [iq_132]
  • -
  • Emulated the M68705 in Legend of Kage rather than simulate it [iq_132]
  • -
  • Added layer disable to the CPS-3 driver [iq_132]
  • -
  • Fixed CPS-3 sound synch when using non-standard frame rates [CaptainCPS]
  • -
  • Fixed a romname in mslug4nd [kenshiro]
  • -
  • Fixed init bug in Guardians in the Seta-2 driver [kenshiro]
  • -
  • Added UniCode titles and fixed some details in the Cross Pang driver [BisonSAS]
  • -
  • Fixed crash in the D-Con driver [BisonSAS and iq_132]
  • -
  • Corrected dipswitches in the F-1 Grand Prix driver [BisonSAS
  • -
  • Fixed graphics in Fantasia II (Less Explicit) in the Gals Panic driver [BisonSAS]
  • -
  • Fixed crash in Ultra Balloon (SunA16 driver) [Bruce Lee and iq_132]
  • -
  • Various fixes in the Tao Taido driver [BisonSAS]
  • -
  • Added a new support file importer module [CaptainCPS]
  • -
  • Added option to use a background image in the menu bar [CaptainCPS]
  • -
  • Updated the jukebox and improved Neo Geo support [CaptainCPS]
  • -
  • Converted the driver list generation perl script to C++ and changed the documentation output to HTML [CaptainCPS]
  • -
  • Fixed an issue when loading tracklists in the jukebox [CaptainCPS]
  • -
  • Updated the megadrive driver to the latest one generated from the database on barryharris.me.uk [Barry]
  • -
  • Matched all sets to MAME 0.136u3 [Barry]
  • -
  • Updated libpng to version 1.4.0 [Barry]
  • -
  • Fixed a MSVC compile issue with the latest libpng [CaptainCPS]
  • -
- -

v0.2.97.07

-
    -
  • Ported YM2413 core from SMS Plus and added an interface for it [Barry]
  • -
  • Added a seperate timer to the YM3812 interface allowing the chip to be used with other FM chips and updated all the drivers that use it [Barry]
  • -
  • Added support to the AY8910 core to handle the ports outside of the init function, and updated the YM2203 interface to use them [iq_132]
  • -
  • Fixed a stupid bug I introduced in the K051649 core [Barry]
  • -
  • Added timer support for the M6502 CPU [iq_132]
  • -
  • Seperated the op code area for the M6502 CPU [iq_132]
  • -
  • Fixed cheat support in the SH-2 CPU core [iq_132]
  • -
  • Small fix to the Z80 core to reset the registers [iq_132]
  • -
  • Fixed typo in the HD6309 core as per MAME 0.132u4 [iq_132]
  • -
  • Added a palette viewer for games on Cave, CPS-1/2/3, Megadrive, Neo Geo, PGM, Psikyo and Toaplan hardware and any game using the generic tiles module, which covers most games [Barry]
  • -
  • Fixed the XML Dat file output to properly support ampersands in rom names [Barry]
  • -
  • Made the maximum rom name length 100 characters instead of 32 [Barry]
  • -
  • Added a warning to BurnTransferCopy when BurnTransferInit hasn't been called [iq_132]
  • -
  • Fixed an issue with reporting some sound options in the System Info dialog that came about when changing the sound interface to plug-ins [Barry]
  • -
  • Removed the active Z80 core from the System Info dialog as the ZET interface only supports one core [Barry]
  • -
  • Added support for Vista, Server 2008 and Windows 7 detection to the System Info dialog [Barry]
  • -
  • Added an Atari filter to the game selection dialog [Barry]
  • -
  • Added driver for Blood Bros. and Sky Smasher [iq_132]
  • -
  • Added driver for D-Con and SD Gundam Psycho Salamander no Kyoui [iq_132]
  • -
  • Added a preliminary driver for games on DEC-8 hardware [iq_132]
  • -
  • Added a preliminary driver for Gauntlet [Barry]
  • -
  • Added driver for games on Karnov hardware [iq_132]
  • -
  • Added driver for Konami Twin 16 hardware [iq_132]
  • -
  • Added Bells & Whistles and Sunset Riders to the Konami drivers [Barry]
  • -
  • Added Lightning Fighters, Punk Shot, Quiz Gakumon no Susume, Teenage Mutant Ninja Turtles - Turtles in Time, Thunder Cross II to the Konami drivers [iq_132]
  • -
  • Added driver for Mitchell hardware [Barry]
  • -
  • Added driver for games on NMK16 hardware [iq_132]
  • -
  • Added driver for games on Psikyo SH hardware [iq_132]
  • -
  • Added driver for Return of the Invaders [iq_132]
  • -
  • Added driver for scooter Shooter [iq_132]
  • -
  • Added Atomic Point and Snapper to the Sega System 16B driver [Barry]
  • -
  • Added driver for Speed Rumbler [iq_132]
  • -
  • Added preliminary driver for Toki [iq_132]
  • -
  • Added driver for Vendetta, press F2 whilst booting to pass the ROM test [iq_132]
  • -
  • Added driver for games on Yun Sung 16 hardware [iq_132]
  • -
  • Added driver for WWF Superstars [iq_132]
  • -
  • Added bootleg of Street Fighter 2 to the CPS-1 driver [Barry]
  • -
  • Added Street Fighter II - Champion Edition Accelerator! bootleg to the CPS-1 driver [Barry]
  • -
  • Added Street Fighter II Quicken Pt-I bootleg to the CPS-1 driver [Barry]
  • -
  • Added sf2m9, sf2m10, sf2m11 and sf2m12 to the CPS-1 driver [Barry]
  • -
  • Added clone of Dungeons & Dragons to the CPS-2 driver [Barry]
  • -
  • Added clone of Battle of Atlantis to the Galaxian driver [Barry]
  • -
  • Added a clone of Dambusters to the Galaxian driver [Barry]
  • -
  • Added Kamakazi III to the Galaxian driver [Barry]
  • -
  • Added various games and clones to the New Zealand Story driver [iq_132]
  • -
  • Added clone of Pacman to the Galaxian driver [Barry]
  • -
  • Added Phoenix Part 2 to the Galaxian driver [Barry]
  • -
  • Added clone of Space War S to the Galaxian driver [Barry]
  • -
  • Added clone of Strategy X to the Galaxian driver [Barry]
  • -
  • Added clone of Metal Slug 4 to the Neo Geo driver [Barry]
  • -
  • Added clone of Outrun to the Outrun driver [Barry]
  • -
  • Added a clone to the Shadow Force driver [Barry]
  • -
  • Added Back Fire to the Tecmo driver [iq_132]
  • -
  • Added clone of Hellfire to the Toaplan-1 driver [Barry]
  • -
  • Added clone of Battle Garegga to the Toaplan-2 driver [Barry]
  • -
  • Added clone of X-Men to the X-Men driver [Barry]
  • -
  • Fixed potential memory leak in the Tengai driver rom loading [kenshiro]
  • -
  • Fixed the palette decoding in Dambusters to work with the correct PROM dump [Barry]
  • -
  • Added Z-Rejection support to the K053245 module, fixing sprites in Bells & Whistles and Sunset Riders [iq_132]
  • -
  • Added a module for the Konami K053936 IC module [iq_132]
  • -
  • Added shadow support to the Konami IC chips where necessary [iq_132]
  • -
  • Fixed Cue Brick [Barry]
  • -
  • Fixed an issue with coin inputs in the 2 Player versions of Crime Fighters [iq_132]
  • -
  • Fixed the Haunted Castle driver [Rasek, iq_132]
  • -
  • Fixed an issue with the Konami Twin 16 driver when compiling with VC [Barry]
  • -
  • Added support for the new graphic roms in gradius2 [Barry]
  • -
  • Fixed savestates in the Gyrus driver [iq_132]
  • -
  • Fixed the sound in Scooter Shoorer [Barry]
  • -
  • Tidied up the Mad Gear driver to support the new sets and increased interleave which fixes the music [Barry]
  • -
  • Modified the Power Instinct driver to use the generic drawing routines [iq_132]
  • -
  • Added Mobile Suit Gundam EX Revue and the Sammy shooting games to the Seta2 driver [iq_132]
  • -
  • Fixed the gun inputs in the Sammy shooting games [Barry]
  • -
  • Added the ability to read from the X1-010 sound chip and hooked it up in the Seta2 driver, improving the sound [Barry]
  • -
  • Fixed memory leaks in the Shadow Force driver's graphic rom loading [kenshiro]
  • -
  • Tidied the Toki driver and added sound [Barry]
  • -
  • PGM Updates [iq_132] -
      -
    • Fixed kov2106 thanks to the FBA Shuffle team :) [iq_132]
    • -
    • Added a few small speedups -
        -
      • Only recalculate the whole palette when needed now rather than every frame [iq_132]
      • -
      • Clear all video buffers in one loop [iq_132]
      • -
    • -
    • Fixed a crash when doing line scroll (see kovsh intro - fire stage background) [iq_132]
    • -
    • Fixed sound after save state load [iq_132]
    • -
  • -
  • Megadrive Updates [Barry] -
      -
    • Fixed an issue with games' buggy sound programs expecting certain results back [Barry]
    • -
    • Added support for some custom banking cartridges [Barry]
    • -
    • Updated the web-based Megadrive driver database with the new games from HazeMD 0.14a [Barry]
    • -
    • Removed rom editing capability from the web form [Barry]
    • -
    • Updated the web-based Megadrive driver generator to support games with multiple roms [Barry]
    • -
    • Added a check to the driver generator to make sure any non-working parents are included in release builds if they have working clones [Barry]
    • -
  • -
  • Matched all sets to MAME 0.134u3 [Barry]
  • -
  • Changed the dat file output using the ROM_VERIFY compile-time flag to produce the XML datfile type [Barry]
  • -
  • Updated libpng to version 1.2.40 [Barry]
  • -
  • Updated the compile guides to work with the newest available tools [Barry]
  • -
- -

v0.2.97.06

-

This version includes a big change in the Z80 CPU interface. Specifically MAME's Z80 core is now used for all games. This should give better results and make the program more portable. We have done a lot of testing but if you notice any new problems please let us know and we can fix them.

-

This version also includes changes in the EEPROM code and input assignment code. As well as the changed save states for the ZET interface, these render old config and save files pretty much useless. It is advised to delete the contents of the config\games folder before using this version. Savestates are a bit hit-and-miss at the moment anyway. I plan to pay some attention to savestates in the next version and hopefully boost compatibility.

-
    -
  • Fixed the ZET interface when used with MAME's Z80 CPU core and removed support for all other Z80 CPU cores [Barry]
  • -
  • Updated lots of drivers to work with the changes to the ZET interface [Barry]
  • -
  • Updated some more drivers to work with the ZET interface changes [iq_132]
  • -
  • Improved existing Konami IC chip emulation and added support for some new chips [iq_132]
  • -
  • Ported the K0051649, K053260 and K054539 sound cores from MAME [iq_132]
  • -
  • Fixed the K0051649, K053260 and K054539 sound cores sample rate support [Barry]
  • -
  • Added a seperate timer to the YM3526 interface allowing the chip to be used with other FM chips [Barry]
  • -
  • Added support for the M6801 CPU in the M6800 interface [Barry]
  • -
  • Finally, and I do mean finally fixed the bug in the RF5C68 core, giving full sound in Sega System 18 [Barry]
  • -
  • Fixed the issues with the YM2203 core [Barry]
  • -
  • Big update to the cheat interface supporting multiple CPUs [iq_132]
  • -
  • Added savestate support to the Namco Sound module [Barry]
  • -
  • Converted the Galaga driver to use the ZET interface and added savestate support [Barry]
  • -
  • Converted the Sega System 1 driver to use the ZET interface [Barry]
  • -
  • Converted the MC8123 Sega System 16B games to use the ZET interface [Barry]
  • -
  • Converted the games in the Galaxian driver that used a custom interface to use the ZET interface [Barry]
  • -
  • Fixed savestate support in the M6809 CPU interface [iq_132]
  • -
  • Fixed savestate support in the M6800 series CPU interface [Barry]
  • -
  • Replaced the EEPROM code with a port from MAME [iq_132]
  • -
  • Updated the Battle Bakraid, Cave, CPS-1, CPS-2, ESD 16, Kaneko 16, Midas, Space Gun and Zero Point 2 drivers to work with the new EEPROM code [Barry, iq_132]
  • -
  • Fixed problem with the low-pass filter in the DirectSound plugin [Barry]
  • -
  • Added lots of Konami games [iq_132]
  • -
  • Added driver for Bubble Bobble and clones [Barry]
  • -
  • Added driver for Arabian [iq_132]
  • -
  • Added a bootleg of SCI to the Taito Z driver [Barry]
  • -
  • Added a clone of Forgotten Worlds to the CPS-1 driver [Barry]
  • -
  • Added clone of The Combatribes [Barry]
  • -
  • Added clone of Final Star Force [iq_132]
  • -
  • Added clone of The Legend of Kage[iq_132]
  • -
  • Fixed the DAC sound in King & Balloon [Barry]
  • -
  • Fixed Mighty Monkey and clones and enabled in release builds [Barry]
  • -
  • Enabled the Kangaroo driver in release builds now that the ZET interface changes made it work [iq_132]
  • -
  • Added support for hardware specific input presets, cps.ini, Neo Geo.ini and pgm.ini [Barry]
  • -
  • Added a Save preset button to the input dialog to save the currently defined inputs into a hardware preset file [Barry]
  • -
  • Updated the help file with details of the new items in the Input Dialog [Barry]
  • -
  • Fixed some issues with saving and reading files for drivers with more than 8 characters in their name [Barry]
  • -
  • Fixed an issue when updating the previous games list with drivers with more than 8 characters in their name [Barry]
  • -
  • Widened the short gamename column in the selection dialog [Barry]
  • -
  • Disabled the rather annoying system beep in DEBUG builds [iq_132]
  • -
  • Matched all sets to MAME 0.131u3 [Barry]
  • -
- -

v0.2.97.05

-
    -
  • Tidied source to compile cleanly with GCC 3.4.5, GCC 4.3.3 and the latest Microsoft SDKs [Barry]
  • -
  • Wrote compile guides for the above which are available on my website [Barry]
  • -
  • Replaced the readme.txt with a detailed Windows help file [Barry]
  • -
  • Replaced the whatsnew.txt with a HTML document and added a link to it from the help menu [Barry]
  • -
  • Updated libpng to the current version (1.2.35) [Barry]
  • -
  • Made a new higher quality icon, with support for the nice big vista icon [Barry]
  • -
  • Ported MAME's Konami CPU core [iq_132]
  • -
  • Fixed an issue with the M6809 interface [iq_132]
  • -
  • Fixed Konami core to compile with VC [Barry]
  • -
  • Added Signed Write support to the DAC core [Barry]
  • -
  • Added control over the volume of the DAC core [Barry]
  • -
  • Added option to control whether the DAC core adds to the current buffer or not [Barry]
  • -
  • Big update to the Megadrive driver [Barry] -
      -
    • Greatly improved timing -
        -
      • Changed the YM2612 to use the 68000 for timing since the Z80 can be disabled
      • -
      • Properly supported PAL
      • -
      • Updated the reset routine to support switching between regions
      • -
    • -
    • Changed to MAME's Z80 core - it works much better
    • -
    • Basic SRAM support
    • -
    • Added support for most games that require special init functions
    • -
    • General tidy-up and many small fixes
    • -
    • Most games now work - testing is under way to enable games that are working (see my site for details on how you can help this effort)
    • -
    • Updated to the latest driver generated from the database
    • -
  • -
  • Added driver for 1943 [Barry]
  • -
  • Added driver for F1 Grand Prix [iq_132]
  • -
  • Added driver for games on Fuuki FG-3 hardware [iq_132]
  • -
  • Added driver for Gyrus [iq_132]
  • -
  • Added driver for Haunted Castle [iq_132]
  • -
  • Added driver for Lethal Crash Race [iq_132]
  • -
  • Added driver for Vigilante and games on similar hardware [Barry]
  • -
  • Added clone of Chase HQ to the Taito Z driver [Barry]
  • -
  • Added clone of Mighty Pang to the CPS-2 driver [Barry]
  • -
  • Added clone of Night Warriors to the CPS-2 driver [Barry]
  • -
  • Added clone of Operation Wolf to the Taito Misc driver [Barry]
  • -
  • Added support for the Neo Geo Deck BIOS [Barry]
  • -
  • Made the Neo Geo BIOS select more intuitive [Barry]
  • -
  • Improved the PGM driver, see changes.txt in the PGM folder for full details [iq_132]
  • -
  • Simulated the protection in Oriental Legends Special/Super making it playable [XingXing]
  • -
  • Fixed background colours and added savestates to 1943 [iq_132]
  • -
  • Fixed an issue with some sprites in World Cup '90 [Barry]
  • -
  • Fixed text layer in Metal Slug 4 Plus [kenshiro]
  • -
  • Added XAudio2 Sound plugin, partially based on FBA Shuffle [Barry]
  • -
  • Fixed an issue with the Neo Geo driver flags, fixing Memory Cards and Button Macros [Barry]
  • -
  • Added the full range of button combinations to the Neo Geo macros [Barry]
  • -
  • Added macro support for the PGM driver [Barry]
  • -
  • Changed the parent filters in the selection dialog to behave in the expected way [Barry]
  • -
  • Fixed MAWS links [Barry]
  • -
  • Moved the FPS display in the DirectX 9 blitter to the top right [FBAShuffle]
  • -
  • Matched all sets to MAME 0.131 [Barry]
  • -
- -

v0.2.97.04

-
    -
  • Moved Namco sound to it's own module and updated the Pac-Man driver [Barry]
  • -
  • Added driver for Galaga [Barry]
  • -
  • Added driver for Pass [iq_132]
  • -
  • Added a hack to get Knights of Valour 2 Plus working [XingXing]
  • -
  • Tidied up the SoftFX blitters [Barry] -
      -
    • Updated the Enhanced blitter to allow more filters
    • -
    • Added support to the ini file for long long integers to support the Enhanced blitter
    • -
    • Added hq2xS, hq3xS, hq2xBold, hq3xBold, EPXB and EPXC filters from SNES9X ReRecording
    • -
    • Added SuperEagle, 2xSaI, Super 2xSaI filters from VBA ReRecording
    • -
  • -
  • Fixed issue with board roms in ClrMAME XML DAT generation [Barry]
  • -
  • Changed ampersands in the ClrMAME XML DAT output to their HTML entity [Barry]
  • -
  • Some updates to the Megadrive driver via the online generator [nj7, JackC, arturf]
  • -
  • Fixed some rom sizes in non-working parents [Barry, pointed out by JackC]
  • -
  • Fixed license2rtf.pl to allow hyphens in URLs [Barry]
  • -
  • Matched all sets to MAME 0.129u6
  • -
- -

v0.2.97.03

-
    -
  • Ported MAME's ARM7 CPU core and added an interface to it [iq_132]
  • -
  • Fixed some issues with the ARM7 code when compiled with VC [Barry]
  • -
  • Ported MAME's S2650 CPU core and added an interface for it [iq_132]
  • -
  • Added support for IRQ callbacks to the S2650 interface [Barry]
  • -
  • Added support to retrieve the PC from the S2650 interface [Barry]
  • -
  • Added support for hiscore.dat [Barry] -
      -
    • The default path is support\hiscores, and .hi files will be stored there
    • -
    • The path is configurable via the support files dialog
    • -
    • hiscore.dat should be placed in the path
    • -
    • Hi Scores are only loaded and saved if the option "Save high scores when supported" is enabled
    • -
    • Hi scores are only loaded and saved if a driver supports it (the various info dialogs will inform in the comments section if high scores are supported for a game)
    • -
    • Added support to the Galaxian and World Cup 90 drivers
    • -
  • -
  • Added S2650 support to the cheat and hiscore modules [Barry]
  • -
  • Added support for hq2xS and hq3xS filters from FBA Shuffle (hq3xS only built with VC) [Barry]
  • -
  • Added 2xPM LQ and 2xPM HQ to the SoftFX blitters [Barry]
  • -
  • Big update to the PGM driver (see driver for details) [iq_132, tested by JackC and Aquashark]
  • -
  • Added games on the S2650 CPU to the Galaxian driver [Barry]
  • -
  • Added clone of Super Cobra to the Galaxian driver [Barry]
  • -
  • Added clone of Dogyuun to the Toaplan2 driver [Barry]
  • -
  • Added clone of World Cup 90 to the driver [Barry]
  • -
  • Added driver for Diver Boy [iq_132]
  • -
  • Added driver for games on Armed Formation hardware [iq_132]
  • -
  • Added driver for games on Magical Cat Adventure hardware [iq_132]
  • -
  • Added driver for Sky Fox [iq_132]
  • -
  • Added driver for Got-cha Mini Game Festival [iq_132]
  • -
  • Updated EPOS driver, fixing Dealer [iq_132]
  • -
  • Added Warriors of Fate to the CPS Changer driver [iq_132]
  • -
  • Changed the Megadrive driver to be generated from a status database on my website [Barry]
  • -
  • Fixed sprite based Capcom logos in CPS-2 Phoenix games [Barry]
  • -
  • Fixed memory leak with CPS-2 games, noticed by kenshiro and Leaf [Barry]
  • -
  • Added savestate support to the Galaxian driver [Barry]
  • -
  • Fixed the default dips in Tiger Road and hooked up the correct dips in F1 Dream [Barry]
  • -
  • Corrected aspect ratio for Bank Panic [CaptainCPS]
  • -
  • Cleaned up the 4 En Raya, Ambush, Dotrikun, Minivader, Silkroad and Wall Crash drivers [iq_132]
  • -
  • Fixed an error in the selection dialog when pressing Cancel [CaptainCPS]
  • -
  • Corrected an issue with scaling some PNGs for the selection dialog [CaptainCPS]
  • -
  • Improved the Options tab in the selection dialog [CaptainCPS]
  • -
  • Stopped the selection dialog switching to the favourites tab when adding a game to your favourites [CaptainCPS]
  • -
  • Fixed the game information printed from the favourites game list [Barry]
  • -
  • Added new clrMame Pro XML dat file output [Barry]
  • -
  • Fixed rotated games when using the DirectX 9 blitter [fbashuffle]
  • -
  • Added FPS display to the DirectX 9 blitter [fbashuffle]
  • -
  • Matched all sets to MAME 0.129u5 [Barry]
  • -
- -

v0.2.97.02

-
    -
  • Added a driver for games on Galaxian hardware, 177 new sets [Barry]
  • -
  • Added support for insane sample Galaxian sound sample hardware and the various AY8910 interfaces in the Galaxian driver [Barry]
  • -
  • Moved PPI8255 module to the burn folder so it can be accessed by all drivers [Barry]
  • -
  • Added support for a third PPI8255 [Barry]
  • -
  • Added driver for Aquarium [iq_132]
  • -
  • Added driver for Dark Seal [iq_132]
  • -
  • Added driver for games on Deniam hardware [iq_132]
  • -
  • Added driver for games on Midas hardware [iq_132]
  • -
  • Changed the left and right sound channels in the CPS-3 driver [Barry]
  • -
  • Fixed the speed-up hacks for Jojo's Venture [Barry]
  • -
  • Improved analog controls in the Sega drivers when used with analog devices [CaptainCPS]
  • -
  • Added some clones to the Toaplan2 driver [Barry]
  • -
  • Added some new Phoenix sets to the CPS-2 driver (provided by bonky0013) [Barry]
  • -
  • Some renames of roms in Neo Geo decrypted sets as reported by pmc2 [Barry]
  • -
  • Fixed the aspect ratio in the Arkanoid driver [CaptainCPS]
  • -
  • Added support to the Game Information dialog for Select, Versus, How To, Scores, Bosses and Game over previews [Barry]
  • -
  • Added configurable path support for the above new previews [Barry]
  • -
  • Fixed issue with selection dialog when clicking filters too fast [CaptainCPS]
  • -
  • Added buttons to the selection dialog for tasks in the context-sensitive menu [CaptainCPS]
  • -
  • Moved the options in the selection dialog to their own tab [CaptainCPS]
  • -
  • Tidied the selection dialog [CaptainCPS]
  • -
  • Tidied the rom and support path dialogs and made them less cumbersome [CaptainCPS]
  • -
  • Changed the PNG load functions to use PNGlib [CaptainCPS]
  • -
  • Added support for loading support files from zips [CaptainCPS]
  • -
  • Added filter for Galaxian hardware to the selection dialog [Barry]
  • -
  • Matched all set to MAME 0.129u3 [Barry]
  • -
  • nb, the source is now doule-zipped similar to MAME for better compression
  • -
- -

v0.2.97.01

-
    -
  • Added driver for Black Tiger [iq_132]
  • -
  • Added driver for Block Out [iq_132]
  • -
  • Added driver for Blue Print [iq_132]
  • -
  • Added driver for Cross Pang [iq_132]
  • -
  • Added driver for Mug Smashers [iq_132]
  • -
  • Added driver for Pirates [iq_132]
  • -
  • Added driver for Tao Taido [iq_132]
  • -
  • Added clone of Double Dragon 3 to the Double Dragon 3 driver [Barry]
  • -
  • Added clone of Power Instinct to the Power Instinct driver [Barry]
  • -
  • Added Street Fighter 2 Rainbow Set 3 to the CPS-1 driver [Barry]
  • -
  • Applied fm.c fixes from MAME 0.128u2 [Barry]
  • -
  • Added support to Zet to get the DE register [iq_132]
  • -
  • Fixed the sound in Double Axle [Barry]
  • -
  • Corrected the clocks in Prehistoric Isle fixing the music tempo [Barry]
  • -
  • Fixed decryption for Street Fighter Zero 2 Alpha and clones [Barry]
  • -
  • Matched all sets to MAME 0.128u7 [Barry]
  • -
  • Changed the version string to include leading zeros in the final section [Barry]
  • -
- -

v0.2.96.99

-
    -
  • Added driver for Contra [iq_132]
  • -
  • Added driver Funny Bubble [iq_132]
  • -
  • Added driver for Legend of Kage [iq_132]
  • -
  • Added driver for games on Legendary Wings hardware [iq_132]
  • -
  • Added driver for Son Son [iq_132]
  • -
  • Added Cue Brick to the Konami driver [Barry]
  • -
  • Added clone of Armored Warriors to the CPS-2 driver [Barry]
  • -
  • Added clone of Capcom Sports Club to the CPS-2 driver [Barry]
  • -
  • Added clone of Giga Wing to the CPS-2 driver [Barry]
  • -
  • Small speed-up in the generic tile handling, improving the speed slightly in lots of drivers [Barry]
  • -
  • Corrected the text rom size in Samurai Shodown V and Samuari Shodown V Special [Barry]
  • -
  • Updated the Neo Geo Bios roms [Barry]
  • -
  • Added support for the Samurai Shodown V bootleg [Barry]
  • -
  • Hooked up the region dip switch in the PCB version of Metal Slug 5 - this won't work until we have dumps of the actual PCB program roms though [Barry]
  • -
  • Corrected the road colours in Enforce [Barry]
  • -
  • Fixed sound in Ali Baba [iq_132]
  • -
  • Fixed an issue with icon handling in the favourites module [CaptainCPS]
  • -
  • Disabled the Neo Geo multislot menu item until such time it does something useful [Barry]
  • -
  • Matched all sets to MAME 0.128
  • -
- -

v0.2.96.98

-
    -
  • Removed the keys for Neo Geo M1 decryption - the values are now derived from the rom, thanks to Haze and cyberwills [Barry]
  • -
  • Fixed a memory issue in the HD6309 and M6809 CPU interfaces [kev]
  • -
  • Allowed hi-res PNG images [CaptainCPS]
  • -
- -

v0.2.96.97

-
    -
  • Added decryption of the Neo Geo M1 roms, thanks to Andreas Naive and Haze [Barry]
  • -
  • Added clone of Marvel vs Capcom to the CPS-2 driver [Barry]
  • -
  • Added clone of Tengai to the Psikyo driver [Barry]
  • -
  • Moved Cps1Draw() out of a loop resuling in a big speed up for CPS-1 [Barry]
  • -
  • Added a "Deselect All" button to the IPS Manager dialog [Barry]
  • -
  • Fixed an issue with the menu translation template [Barry]
  • -
  • Matched all sets to MAME 0.127u4 [Barry]
  • -
- -

v0.2.96.96

-
    -
  • Ported MAME's M6809 CPU core [Barry]
  • -
  • Ported MAME's HD6309 CPU core [Barry]
  • -
  • Ported MAME's M6800, HD63701 CPU cores [Barry]
  • -
  • Added an interface to the M6809 core and added support for it to BurnTimer and the cheat module [Barry]
  • -
  • Added an interface to the HD6309 core and added support for it to BurnTimer and the cheat module [Barry]
  • -
  • Added an interface to the M6800 and family cores and added support for them to BurnTimer and the cheat module [Barry]
  • -
  • Added driver for Double Dragon and Double Dragon II [Barry]
  • -
  • Added driver for Ghouls & Ghosts [Barry]
  • -
  • Added driver for Renegade [Barry]
  • -
  • Added SNK16 driver [iq_132]
  • -
  • Added clone of The New Zealand Story to it's driver [iq_132]
  • -
  • Added analog inputs to the SNK16 driver [Barry]
  • -
  • Hooked up the sound CPU comms in the Power Instinct 2 driver [Barry]
  • -
  • Very big update to the Jukebox [CaptainCPS]
  • -
  • Rewrote favourites module - delete your old favorites.dat file [CaptainCPS]
  • -
  • Added support for icons in the gamelists [CaptainCPS]
  • -
  • Added options to configure vertical and horizontal full-screen resolutions seperately [CaptainCPS]
  • -
  • Fixed another bug when FBA was used under Vista [CaptainCPS]
  • -
  • Made the inputs dialog stop the sound properly when using the shortcut key [CaptainCPS]
  • -
  • Applied the dialog sound fix above to the dip switch and cheat dialogs [Barry]
  • -
  • Fixed a memory leak when loading PNGs [CaptainCPS]
  • -
  • Optimised the automatic support file download feature [CaptainCPS]
  • -
  • Matched all sets to MAME 0.127u2 [Barry]
  • -
- -

v0.2.96.95

-
    -
  • Added driver for Zero Zone and Las Vegas Girl [iq_132]
  • -
  • Added a clone of Three Wonders to the CPS-1 driver [Barry]
  • -
  • Changed the FD1089 module to use the external keys [Barry]
  • -
  • Set CPS-3 back to 60fps [Barry]
  • -
  • Matched all sets to MAME 0.127u1 [Barry]
  • -
- -

v0.2.96.94

-
    -
  • Fixed Windows Vista crash when opening the game selection dialog [CaptainCPS]
  • -
  • Added Missing In Action to the TMNT driver [Barry]
  • -
  • Removed an unnecessary array in sys16_run.cpp reducing the exe size [Barry]
  • -
- -

v0.2.96.93

-
    -
  • Added support for the K007232 sound chip [Barry]
  • -
  • Added support for the K051960 and K052109 gfx chips [Barry]
  • -
  • Rewrote the TMNT driver which is now fully working [Barry]
  • -
  • Added driver for Commando and clones [Barry]
  • -
  • Added ESD16 driver [iq_132]
  • -
  • Added NMG5 driver [iq_132]
  • -
  • Added Tecmo driver [iq_132]
  • -
  • Added SunA16 driver [iq_132]
  • -
  • Added Kangaroo driver to debug builds [iq_132]
  • -
  • Added daimakr2 to the CPS-1 driver [Barry]
  • -
  • Added snowbrod to the Snow Bros. driver [Barry]
  • -
  • Added sound to the Pacman driver and fixed some issues with the default inputs [Barry]
  • -
  • Added support for the YM3562 sound chip [Barry]
  • -
  • Added the YM3526 sound to bestbest in the SunA16 driver [Barry]
  • -
  • Added DAC support to Stratovox [iq_132]
  • -
  • Corrected the refresh rate in the CPS-1 driver [Barry]
  • -
  • Changed the refresh rate in the CPS-3 driver [Barry]
  • -
  • Imported fixes from MAME 0.126u5 for fm.c [Barry]
  • -
  • Reduced DAC volume in fm.c for YM2612 matching MAME 0.127 [Barry]
  • -
  • Marked the fake CHD CPS-3 sets as hacks so they can be filtered out [Barry]
  • -
  • Fixed an issue with cheats in Z80 (ZET) based games [Barry]
  • -
  • Added a feature to auto-download support files [CaptainCPS]
  • -
  • Merged all the LoadPNG() calls [CaptainCPS]
  • -
  • Added favourite gamelist support [CaptainCPS]
  • -
  • Allowed the recent gameslist to cycle games currently in the list [CaptainCPS]
  • -
  • Fixed issues with mouse events on the game window [CaptainCPS]
  • -
  • Added zlib/libPNG to FBA source, they are now compiled rather than using pre-compiled libraries [CaptainCPS]
  • -
  • Some updates to the minGW Win32 header file allowing Win32 API Versions 3.8+ to be used, and also to add support for some new functionality to older versions[Barry, CaptainCPS]
  • -
  • Added a filter for Konami games [Barry]
  • -
  • Matched all sets to MAME 0.127 [Barry]
  • -
- -
From this point forward, all releases are handled by Barry and each individual contribution is labelled.
- -

v0.2.96.92

-
    -
  • CaptainCPS readded netplay and removed the dependancy on any external dlls - use them at your own risk
  • -
  • Fixed a problem with the SuperScale filter on nVidia gfx cards
  • -
  • Merged in CaptainCPS's improvements to the game selection dialog
  • -
  • Fixed a problem with the game information dialog displaying incorrect images
  • -
  • Updated the romcenter dat module to support the latest romcenter
  • -
  • Imported fixes from MAME 0.126u4 for fm.c
  • -
  • Added a flag for MVS Cartidges and changed hardware description output
  • -
  • Matched all sets to MAME 0.126u4
  • -
- -

v0.2.96.91

-
    -
  • Added the 2xPM filter to the softfx filters with help from CaptainCPS
  • -
  • Added ElSemi's SuperScale and SuperScale75 filters
  • -
  • Made the IPS Manager fallback to Simplified Chinese as a last resort as this is the reference language for the MAME Plus IPS collection
  • -
  • Made the IPS Manager description vertically scrollable for long descriptions and reorganised the dialog
  • -
  • Added CaptainCPS's auto monitor aspect ratio code
  • -
  • Added driver for Unico games
  • -
  • Moved the drawing code in CPS-1/CPS-2 to happen after the VBLANK IRQ - this shouldn't cause any problems but if you see anything that didn't happen in previous builds let us know
  • -
- -

v0.2.96.90

-
    -
  • Burner (interface) changes -
      -
    • Added board type, genre and family filters to the game selection dialog -
        -
      • Updated all drivers with the new flags
      • -
      • Amended the relevant dialogs to display the new genre and family information
      • -
      • Added the genre and family flags to the -listextrainfo output
      • -
    • -
    • Added gamelist localisation functionality -
        -
      • It works in much the same way as the UI localisation, beware though, that if you have a large file it can take some time to start the program, try and keep the file small and with only the titles you want to translate
      • -
      • Maximum titles to translate is currently set at 5000
      • -
      • The advantage of doing it this way is that the whole program benefits from translated titles, not just certain parts and the speed hit is only felt once rather than every time a title is retrieved
      • -
      • Obviously this only works with UNICODE build
      • -
    • -
    • Fixed some issues with clicking behind some dialog boxes
    • -
    • Fixed a problem with the config file, allowing multi-byte paths to be specified
    • -
    • Double clicking on cheats in the dialog now selects the next option, thanks to sho
    • -
    • Changed the menu in the game selection dialog to a basic menu
    • -
    • Increased the width of the info boxes in the game selection dialog to use all available space (and not crop text unnecessarily)
    • -
  • -
  • Burn (emulation) changes -
      -
    • Hooked up the SN76496's in Van-Van Car
    • -
    • Finished up sf2m13 thanks to a small patch posted by iq_132 years ago
    • -
    • Added various homebrew games and demos (can be filtered out if you don't want to see them)
    • -
    • Added various decrypted C sets to the Neo Geo driver (can be filtered out if you don't want to see them)
    • -
    • Fixed a rom size issue in 8ballact
    • -
    • Matched all sets to MAME 0.126u3
    • -
  • -
- -

v0.2.96.89

-
    -
  • Added IPS support via a manager dialog. -
      -
    • Right click on the game list, open the manager, enable the patches you want, they are saved to a config file, then right click and play with your saved patches
    • -
  • -
  • Fixed a problem with the saving of config files where the game title has unicode in it
  • -
  • Added iq_132's Street Fighter driver
  • -
  • Seperated the pacman driver from the misc section
  • -
  • Removed some CPS-1 hacks
  • -
- -

v0.2.96.88

-
    -
  • Fixed an issue with the monitor aspect radio buttons
  • -
  • Various fixes to the themed menus
  • -
  • Added themed menus to the game selection dialog
  • -
  • Prevented modeless menus being used with themes
  • -
  • Added options to view details in MAWS, CAESAR, and progretto EMMA to the game selection context menu
  • -
  • Added PNG support to the place holder image
  • -
  • Added option to choose skins to the Misc menu
  • -
  • Improved the localisation support for the game selection dialog and the game information dialog
  • -
  • Added "Enable VSync" to the video menu
  • -
  • Matched all sets to MAME 0.126u2
  • -
- -

v0.2.96.87

-
    -
  • Added dynamic video size switching to the core
  • -
  • Merged in CaptainCPS's menu themes code and added the options to the misc menu (disabled by default)
  • -
  • Merged in kev's and oopswares changes to zet and added CZ80 to the source distribution
  • -
  • Fixed an issue causing the preview image not to display on program start when the Enhanced blitter was enable
  • -
  • Fixed an issue with localisation support and added an option to reset to UI default language
  • -
  • Changed the hotkeys for cheat search to be used with Ctrl
  • -
  • Added support for the widescreen mode in Street Fighter III 2nd Impact
  • -
  • Added a fake dipswitch to Street Fighter III for widescreen since the game seems to support it
  • -
  • Added extracted roms to all CPS-3 sets (noone is likely to port CHD support just for CPS-3 which already works anyway)
  • -
  • Added fake dip hack to make Red Earth and War Zard work
  • -
  • Added sf2m8 to release builds
  • -
  • Added tigerhb1 to the Tiger Heli driver
  • -
  • Fixed a potential crash in the ICS2115 reset routine (spotted by iq_132)
  • -
  • Matched all sets to MAME 0.126u1
  • -
- -

v0.2.96.86

-
    -
  • Burner (interface) changes -
      -
    • Added a game information dialog to burner
    • -
    • Tidied up the game selection dialog and seperated Kaneko 16 and Psikyo
    • -
    • Added a context menu to the game selection dialog
    • -
    • Added a most recently played games menu item
    • -
    • Changed the roms dir config dialog to support upto 8 paths
    • -
    • Fixed an issue with the roms dir config dialog that didn't let the user clear an entry
    • -
    • Added the roms dir config dialog to the Misc menu
    • -
    • Added a dialog to configure support files (previews, titles, flyers, marquees, controls, cabinets, pcbs, cheats and history) and added it to the Misc menu
    • -
    • Added an option to the Misc menu to stop FBA playing with the Num Lock status (don't use this if you use a Hotrod or X-Arcade stick)
    • -
    • Added an option to the Video menu to auto-switch to full screen after loading a game from the selection dialog
    • -
    • Added iq_132s improvements to the cheat system -
        -
      • Adds support for Nebula/Kawaks cheat dats
      • -
      • Adds limited (although most cheats work) support for the old format MAME cheat.dat file
      • -
      • Adds cheat support to drivers using the ZET interface, or NEC, SH-2 and M6502 CPUs
      • -
    • -
    • Added a basic cheat search engine
    • -
    • Added a jukebox player - this is very preliminary and only supports WWF Wrestlefest for now (it has many problems for now)
    • -
    • Added a menu item to write decrypted C Neo Geo roms to disk
    • -
    • Various little GUI fixes/improvements
    • -
  • -
  • Burn (emulation) changes -
      -
    • Merged in Oopsware's changes to the ZET interface improving support for MAME's Z80 emulator - some things are still broken though so DOZE is still the default
    • -
    • Added a function to the CPU interfaces to return the active CPU
    • -
    • Fixed a screen clearing issue in the CPS-1 and CPS-2 drivers when not using a 16-bit colour depth
    • -
    • Added various bootlegs to the CPS-1 driver in various states of working and attempted to differentiate between the good, the bad and the ugly (dumps)
    • -
    • Added offset support to the CPS-1 scroll layers
    • -
    • Added a flag to define whether or not CPS-1 sprite rendering should happen in reverse
    • -
    • Fixed an issue with rom loading in the sf2yyc driver
    • -
    • Got the sf2m3 set working and the sf2m1 set almost working
    • -
    • Added "Phoenix Edition" sets to the CPS-2 driver
    • -
    • Changed to iq_132s current Neo Geo driver (thanks to iq_132 for updating it)
    • -
    • Enabled the decrpyted C Neo Geo clones and bootlegs from Kawaks
    • -
    • Added two clones of Night Striker to the Taito driver
    • -
    • Changed some dip switches in the Double Dragon 3 driver
    • -
    • Added Wonder League '96 to the Tumble Pop bootleg driver
    • -
    • Updated dip switches in Wonder League Star and Jumping Pop
    • -
    • Added the 16-bit only flag to the megadrive games - fixes rendering issues in the basic blitters
    • -
    • Added iq_132s Vulgus driver
    • -
    • Matched all sets to MAME 0.126
    • -
  • -
- -

v0.2.96.85

-
    -
  • Added Mazinger Z, Metamoqester, Power Instinct 2 and Power Instinct Legends to the Cave driver
  • -
  • Lagged the sprite palette in all CPS-2 games - fixes issue in ssf2 attract
  • -
  • Tidied up the CPS-2 split graphics rom loading
  • -
  • Properly fixed the qadj ninja sprite bug without resorting to hacks
  • -
  • Changed the 68000 clock frequency in later CPS-1 games
  • -
  • Various fixes to the Double Dragon 3 / Combatribes driver
  • -
  • Added an Italian bootleg of The Combatribes to the ddragon3 driver
  • -
  • Added clone of Turbo Outrun and clone of Alien Storm to the Sega drivers
  • -
  • Added iq_132s Bionic Commando driver
  • -
  • Added iq_132s Ninja Gaiden driver
  • -
  • Matched all sets to MAME 0.125u6
  • -
- -

v0.2.96.84

-
    -
  • Added module to emulate the TC0280GRD/TC0430GRW Taito roz layer chips
  • -
  • Added support to the TC0100SCN module for double width rendering
  • -
  • Added support to the TC0100SCN and TC0110PCR emulation for multiple chips
  • -
  • Fixed priorities in Metal Black
  • -
  • Fixed the CPS-1 palette and added screen clearing to the last palette entry
  • -
  • Fixed a glitch in the ninja's sprite animation in qadj in the CPS-1 driver
  • -
  • Added support for split CPS-2 graphics roms
  • -
  • Added rent version of Capcom Sports Club to the CPS-2 driver
  • -
  • Added clone of Mighty Pang to the CPS-2 driver
  • -
  • Added Hotdog Storm to the Cave driver
  • -
  • Added iq_132s The Legend of Silkroad driver
  • -
  • Added BisonSAS's fixes to the CPS-3 driver
  • -
  • Added proper screen clearing to the Final Star Force driver
  • -
  • BisonSAS added various unicode titles and dip switches to 1943
  • -
  • Matched all sets to MAME 0.125u4
  • -
- -

v0.2.96.83

-
    -
  • Added a module to control the Taito IC chips in a more efficient way
  • -
  • Added a module to do all the common Taito functions and tidied the drivers
  • -
  • Rewrote the PC080SN and PC090OJ emulation adding support for row scroll, double width and other features
  • -
  • Added tile banking support to the TC0100SCN emulation
  • -
  • Added support for configurable bit-depths to the TC0100SCN emulation
  • -
  • Added palette offset support to the TC0480SCP emulation
  • -
  • Added driver for Darius
  • -
  • Added Dead Connection, Dino Rex, Growl, Koshien, Liquid Kids, Mahjong Quest, Mega Blast, Metal Black, Ninja Kids, Solitary Fighter and various quiz games to the Taito F2 driver
  • -
  • Rewrote the Operation Wolf, Rainbow Islands and Rastan drivers to support the new Taito IC module
  • -
  • Added Jumping and the original versions of Operation Wolf to the Taito PC080SN & PC090OJ based driver
  • -
  • Rewrote the Taito X driver to support the new Taito IC module
  • -
  • Added Balloon Brothers, Gigandes and Last Striker to the Taito X driver
  • -
  • Added iq_132s Dr. Tomy driver
  • -
  • Added iq_132s Exed Exes driver
  • -
  • Added proper screen clearing to the Hyper Pacman driver
  • -
  • Fixed a small bug in the ClrMAME dat generation with missing quotes
  • -
  • Matched all sets to MAME 0.125u2
  • -
- -

v0.2.96.82

-
    -
  • Added driver for Taito F-2 hardware supporting Final Blow, Football Champ, Gun & Frontier, Liquid Kids and Super Space Invaders '91
  • -
  • Added tilemap flip support to the TC0100SCN emulation
  • -
  • Added priority map support to the TC0100SCN emulation to allow sprite blending in the Taito F2 driver
  • -
  • Added support to the CPS-1 driver for loading stars from alternate format graphics roms
  • -
  • Corrected all dips in the CPS-1 driver
  • -
  • Updated mappers and configs in the CPS-1 driver to match MAME
  • -
  • Big tidy up of the CPS-1 and CPS-2 drivers
  • -
  • Added dynwaru and ffightj2 to the CPS-1 driver
  • -
  • Added clone of Street Fighter Alpha 2 to the CPS-2 driver
  • -
  • Added iq_132s driver for Pirate Ship Higemaru
  • -
  • Updated megadrive driver to nganiere's which fixes some game names
  • -
  • Matched all sets to MAME 0.125
  • -
- -

v0.2.96.81

-
    -
  • Added support for the TC0480SCP Taito tilemap controller
  • -
  • Rewrote the System 16 tile rendering to allow proper col and row scroll and also support alternate tilemap selection
  • -
  • Added Double Axle to the Taito Z driver
  • -
  • Added 1942w to the 1942 driver
  • -
  • Added more games to the System 1 driver
  • -
  • Added iq_132s Green Beret driver
  • -
  • Updated the CPS-1 mappers as per MAME
  • -
  • Corrected clock in Varth
  • -
  • Corrected clocks in the Kyugo driver as per MAME
  • -
  • Corrected sprite positioning in the Kyugo driver
  • -
  • Added a feature allowing users to go to fullscreen and back by double-clicking
  • -
  • Added command line option -listextrainfo
  • -
  • Fixed compile errors when using the MAME Z80 core with the Zet interface
  • -
  • Updated the Mole, Green Beret, Pooyan and Gun Smoke drivers with BisonSAS' changes
  • -
- -

v0.2.96.80

-
    -
  • Ported MAME's Z80 core to FBA
  • -
  • Hooked up MAME's Z80 core in the System 16 games that use MC-8123 encryption, sound now works in these games
  • -
  • Hooked up MAME's Z80 core in the Sega System 1 games, encrypted games now work
  • -
  • Added more games to the Sega System 1 driver
  • -
  • Changed the Sega System 1 drivers to appear in the Sega games list
  • -
  • Got the YM2151 sound working in Cotton
  • -
  • Added support for the UPD7759 sound chip
  • -
  • Hooked the UPD7759 chip up in the System 16B driver
  • -
  • Hooked the UPD7759 chip up in the prehisle driver
  • -
  • Hooked the UPD7759 chip up in the tmnt driver
  • -
  • Rewrote the Sega PCM support - solves quite a few problems, particuarly in enduror, outrun and smgp
  • -
  • Fixed an issue in the Sega System X driver which caused missing sounds in abcop and smgp
  • -
  • Fixed bug in the YM2612 emulation when more than one chip is emulated
  • -
  • Changed the CPS-1 rendering code to use the mapper tables from MAME
  • -
  • Added smgpja to the X-Board driver
  • -
  • Added shinobi4 to the System 16B driver
  • -
  • Added ledstrm2 to the madgear driver
  • -
  • Added command line options, -listinfowithmd and -listinfomdonly
  • -
  • Fixed the version output in dat files
  • -
  • Fixed bug where any rom errors weren't reported
  • -
  • Matched all sets to MAME 0.124u3
  • -
- -

v0.2.96.79

-
    -
  • Corrected sound in the tnzs driver
  • -
  • Correctly fixed coins in the wc90 driver
  • -
  • Enabled Tazmania in the megadrive driver (it works and I like it :) )
  • -
  • Added support to the FM core interfaces for sound mixing
  • -
  • Removed kaillera support. The client can be removed and probably should be due to being a potential security risk. Left netplay, chat, etc. code in the program so it has potential to be used with a different netplay system.
  • -
- -

v0.2.96.78

-
    -
  • Added oopsware's Picodrive Megadrive driver port and tidied up and improved
  • -
  • Started to go through Megadrive games and enabling ones that work in release builds. Only got to letter B and checked my favourites!
  • -
  • Added iq_132s Funky Bee driver
  • -
  • Added iq_132s Pooyan driver
  • -
  • Ported MAME's I8039 core to FBA
  • -
  • Added support for DAC sound
  • -
  • Hooked up the I8039 and DAC in System 16A to add voice support to the driver
  • -
  • Added gpilotsh and samshoh to the Neo Geo driver
  • -
  • Updated the SN7649 emulator to determine whether to add to the sound buffer or not
  • -
  • Removed the AY8910 part of the YM2612 emulation since it's not needed
  • -
  • Fixed sound in 1943
  • -
  • Fixed sound in Gunsmoke
  • -
  • Changed the default DAT file handling to not include Megadrive games
  • -
  • Added menu option to write DATs including Megadrive games
  • -
- -

v0.2.96.77

-
    -
  • Added driver for Taito Z hardware
  • -
  • Added oopsware's Raiden driver and updated the nec core and vez module
  • -
  • Retidied the nec core and vez module
  • -
  • Added iq_132s Gun Smoke driver
  • -
  • Added iq_132s Scrambled Egg driver
  • -
  • Changed the M6502 core to Marat's with the interface wrote by kev
  • -
  • Added kev's m90 driver and his updates to the m92 driver to debug builds
  • -
  • Tidied the m90 and m92 drivers and corrected the gfx decoding in the m90 driver
  • -
  • Updated Dec0 drivers to kev's latest version
  • -
  • Updated Jack the Giantkiller driver to the iq_132s latest version
  • -
  • Made the "In Game" tab the default on the game selection dialog
  • -
  • Added a checkbox for Taito to the game selection dialog
  • -
  • Changed some names to prevent duplicate descriptions
  • -
  • Matched all sets to MAME 0.124u1
  • -
- -

v0.2.96.76

-
    -
  • Added driver for games on Tumble Pop bootleg hardware
  • -
  • Tidied the System 1 driver and enabled working sets in normal builds
  • -
  • Added support for the SN76496 family of sound chips
  • -
  • Added sound to the Mr. Do driver
  • -
  • Added sound to the Bank Panic driver
  • -
  • Fixed missing music in Combatribes
  • -
  • Fixed a compile issue with VC in the Bank Panic and New Zealand Story drivers
  • -
  • Fixed an issue in VC builds with inputs not working in various drivers
  • -
  • Fixed a bug in the Mysterious Stones driver with AY8910 memory allocation
  • -
  • Corrected the ZetBc call in the 1943 driver making it playable (but still preliminary)
  • -
  • Updated the Jack the Giantkiller driver to iq_132s latest release
  • -
  • Updated the dec0 and tmnt drivers to the latest versions released by kev
  • -
  • Matched all sets to MAME 0.124a
  • -
- -

v0.2.96.75

-
    -
  • Added driver for Double Dragon 3 / Combatribes
  • -
  • Added driver for WWF Wrestlemania
  • -
  • Added driver for Kyugo Z80-based hardware
  • -
  • Updated the pacman driver to the latest version released by iq_132
  • -
  • Added iq_132s Bank Panic driver
  • -
  • Added iq_132s Mr. Do driver
  • -
  • Added iq_132s Mysterious Stones driver
  • -
  • Added iq_132s The New Zealand Story driver
  • -
  • Added clone of Real Bout Fatal Fury to Neo Geo driver
  • -
  • Added clone of Metal Slug 5 to Neo Geo driver
  • -
  • Added clone of Dungeons & Dragons: tower of doom to the CPS-2 driver
  • -
  • Matched all sets to MAME 0.123u4
  • -
- -

v0.2.96.74

-
    -
  • Updated the CPS-3 driver to include Oopsware's latest fixes
  • -
  • Fixed a problem with the size of m1 rom in Metal Slug 5
  • -
- -

v0.2.96.73

-

Thanks go to the neosource forum regulars for a lot of this stuff. iq_132 has -written many drivers for older games, and Oopsware has contributed some impressive -drivers too. CaptainCPS and KOF2112 have also tidied up some things. This list -is from memory and some stuff is sure to be missing. Here's what's new anyway;

- -
    -
  • Added a generic tiles decoding routine and updated various drivers to use it
  • -
  • Added support for 32x32 tiles in the generic tile rendering module
  • -
  • Added support for multiple YM2203s to the YM2203 interface
  • -
  • Updated all sets to match MAME 0.123u1
  • -
  • Tidied up all source code to compile cleanly for all builds (unicode, non-unicode, debug, non-debug)
  • -
  • Added support for M6502 CPU
  • -
  • Added support for SH-2 CPU
  • -
  • Added support for NEC V30 family CPU
  • -
  • Seperated misc drivers into "Misc (pre 90s)" and "Misc (post 90s)"
  • -
  • Moved some common sound cores into the burn folder
  • -
  • Added various clones and fixed some little issues in various games
  • -
  • Added driver for Madgear and Last Duel
  • -
  • Added driver for 1942
  • -
  • Added preliminary driver for 1943 and added support to the Zet interface to get the BC register
  • -
  • Added Oopsware's CPS-3 driver
  • -
  • Added various drivers by iq_132
  • -
  • Cleaned up the drivers by iq_132 (seperated into Misc pre 90s category, corrected aspect ratios, fixed rom-sets, etc.)
  • -
  • Added driver for seta2 hardware
  • -
  • Added preliminary driver for m92 hardware in debug builds
  • -
  • Added a d_parent module to put required parent drivers that don't have a specific driver
  • -
- -

v0.2.96.72

-

This list is nothing like exhaustive. These are only the highlights of a big new version;

- -
    -
  • Thanks to the contributions of OopsWare we have some nice new drivers -
      -
    • PGM Hardware
    • -
    • Video System Hardware
    • -
    • 1945k III
    • -
    • Gals Panic
    • -
    • Power Instinct
    • -
    • Shadow Force
    • -
  • -
  • I have been busy with the following -
      -
    • Added a Sega System 18 driver
    • -
    • Added Ace Attacker, Excite League and Super League to the Sega System 16 drivers
    • -
    • Added various bootlegs to the Sega System 16 driver
    • -
    • Added driver for Kaneko 16 Hardware
    • -
    • Added Honey Dolls, Snow Bros. 3, and The Winter Bobble to the Pandora based driver
    • -
    • Added a generic lightgun interface to the burn library and converted all existing drivers to use it
    • -
    • Emulated column and row scroll in System 16 tilemaps (still has a few issues with a few instances)
    • -
    • Added support for (multiple) YM2612/3438 sound chips (as used by System 18)
    • -
    • Added support for the RF5C68 PCM sound chip (still has issues which escape me at present, used by System 18)
    • -
    • Fixed an issue with high BPP support in the generic tiles interface
    • -
    • Matched all sets to MAME 0.117u3 and added some clones to various driver
    • -
  • -
  • Added Ganbare Ginkun and Riot to the Tecmo 16 driver [BisonSAS]
  • -
  • Added kev's preliminary Dec0 driver to debug builds [kev]
  • -
- -

v0.2.96.71

-
    -
  • Added driver for Galaxy Force 2 (gforce2, gforce2j)
  • -
  • Added driver for G-LOC (gloc, glocr360)
  • -
  • Added driver for Line of Fire (loffire, loffirej, loffireu)
  • -
  • Added driver for Major League (mjleague)
  • -
  • Added driver for Power Drift (pdrift, pdrifta, pdrifte, pdriftj)
  • -
  • Added driver for Rail Chase (rchase)
  • -
  • Added driver for Strike Fighter (strkgftr)
  • -
  • Fixed sprite flip in Sonic Boom
  • -
  • Added some unicode titles [BisonSAS]
  • -
  • Matched sets to MAME 0.114u1
  • -
- -

v0.2.96.70

-
    -
  • Datfiles should be sorted properly now - thanks to LogiqX for pointing out the errors again
  • -
- -

v0.2.96.69

-
    -
  • Optimised the FD1094 routines resulting in a big speedup for those games
  • -
  • Fixed some minor dat file issues - thanks to LogiqX for pointing them out
  • -
- -

v0.2.96.68

-
    -
  • Added driver for Bullet using Aaron's preliminary FD1094 key (bullet)
  • -
  • Added driver for Enduro Racer (enduror, enduror1, endurobl)
  • -
  • Added driver for Final Tetris (finalttr)
  • -
  • Added driver for Hang-On (hangon)
  • -
  • Added driver for SDI (sdi, sdib, sdibl, defense)
  • -
  • Added driver for Space Harrier (sharrier, sharrir1)
  • -
  • Added driver for Sukeban Jansi Ryuko (sjryuko, sjryuko1)
  • -
  • Added driver for Twin Adventure (twinadv, twinadvk)
  • -
  • Emulated the NVRAM for X-Board, Out Run, System 16B and System 16A drivers, although Out Run games don't seem to use it
  • -
  • Emulated the PPI I/O Chip and hooked it up for the System 16A and Out Run drivers
  • -
  • Fixed a bug in the System 16 Tilemap rendering (fixes Golden Axe, Wrestle War and some others)
  • -
  • Optimisations to the graphics rendering in the System 16, Out Run and X-Board drivers
  • -
  • Added an interface to the YM2203 FM sound core
  • -
  • Added mahjong controls to the default assignment routine and updated the mahjong games to use it
  • -
  • Fixed savestate support in some Cave drivers [BisonSAS]
  • -
  • Various driver cleanups [BisonSAS]
  • -
  • Improved the rom verify feature and moved the define to the makefile
  • -
  • Updated some unicode titles [BisonSAS]
  • -
  • Updated sets to match MAME 0.114
  • -
- -

v0.2.96.67

-
    -
  • Added driver for AB Cop (abcop)
  • -
  • Added driver for After Burner (aburner2, aburner)
  • -
  • Added driver for Dunk Shot (dunkshot)
  • -
  • Added driver for E-Swat (eswat, eswatj, eswatu)
  • -
  • Added driver for Golden Axe (goldnaxe, goldnaxj, goldnaxu, goldnax1, goldnax2, goldnax3)
  • -
  • Added driver for GP Rider (gprider, gprider1)
  • -
  • Added driver for Heavyweight Champ (hwchamp)
  • -
  • Added driver for Racing Hero (rachero)
  • -
  • Added driver for RyuKyu (ryukyu)
  • -
  • Added driver for Super Monaco GP (smgp, smgp5, smgp6, smgpj, smgpu, smgpu1, smgpu2, smgpu3)
  • -
  • Added driver for Thunder Blade (thndrbld, thndrbd1)
  • -
  • Added Jan's preliminary driver for Madgear in debug builds only (madgear)
  • -
  • Added Kev's preliminary driver for Teenage Mutant Ninja Turtles in debug builds only (tmnt, tmntu, tmntua, tmht, tmntj, tmht2p, tmnt2pj, tmnt2po)
  • -
  • Rewrite of the Bombjack driver [kev]
  • -
  • Fixed a crash in some FD-1094 encrypted games
  • -
  • Fixed the reset function for FD-1094 encrypted games
  • -
  • Cleanups to the Taito 68K drivers [BisonSAS]
  • -
  • Fixed bug in the preview cycling code for the Game Select dialog [CaptainCPS]
  • -
- -

v0.2.96.66

-
    -
  • Added driver for Cotton (cotton, cottonj, cottonu)
  • -
  • Added driver for Out Run (outrun, outrun1, outrun2, outrunb)
  • -
  • Added driver for Passing Shot (passshot, passshta, passshtj)
  • -
  • Added driver for Super Hang-On (shangon, shangon2, shangon3, shangnle)
  • -
  • Added driver for Turbo Out Run (toutrun, toutrun2)
  • -
  • Fixed a bug in the System 16 Sprite rendering [kev]
  • -
  • Fixed a problem with memory card support
  • -
  • Updated the region dips in the Battle Bakraid and Batrider drivers [BisonSAS]
  • -
  • Forced the Battle Bakraid driver to use the Musashi 68K core [BisonSAS]
  • -
  • Updated some unicode titles [BisonSAS]
  • -
- -

v0.2.96.65

-
    -
  • Corrected the rom size of the v4 rom in lastbldh and lastsold
  • -
  • Finally beat the bug that sometimes hides the license dialog (hopefully!)
  • -
  • Updated the load dialog based on code from CaptainCPS, should be the last change as I'm really happy with it
  • -
  • Updated sets to match MAME 0.112u4
  • -
- -

v0.2.96.64

-
    -
  • Big update to the System 16 drivers - these drivers are still preliminary and thus still have issues (major issues only listed); -
      -
    • Dynamic memory maps for System 16B are not emulated
    • -
    • Row and Column scroll not emulated for System 16A and B
    • -
    • Alernate tilemap select for System 16B not emulated
    • -
    • Some of the FD1094 encrypted games require a driver reset after loading before they boot
    • -
    • There are plenty of other small issues as well but most games are running well
    • -
  • -
  • Added driver for Biomechanical Toy (biomtoy) [kev, cleanup by BisonSAS]
  • -
  • Fixed blank tile bug in the Prehistoric Isle driver
  • -
  • Fixed bad tiles in The King of Fighters 99 driver [BisonSAS, Ryo, Robert, Yuri, Takuma)
  • -
  • Updated the CPS-1 drivers to allow brightness control in the palette
  • -
  • Removed the XOR from spf2ta now the decryption key is known
  • -
  • Cleanup to the Bombjack driver [BisonSAS]
  • -
  • Fixed issues with savestates in several drivers
  • -
  • Changed the game selection dialog again
  • -
  • Added/fixed several non-Latin titles [doomking, BisonSAS]
  • -
  • Updated several romsets to match MAME 0.112u3
  • -
  • Fixed the perl script that generates the driver list so that sets can be assigned to debug builds only again
  • -
- -

v0.2.96.63

-
    -
  • Added garoubl to the Garou driver
  • -
- -

v0.2.96.62

-
    -
  • Added driver for Choko (choko)
  • -
  • Added driver for Jyangokushi: Haoh no Saihai (jyangoku)
  • -
  • Added various CPS-2 clones now the decryption keys are known
  • -
  • Added rastsag1 to the Rastan driver
  • -
  • Fixed bug with EEPROM on startup in CPS games
  • -
  • Fixed crash bug in Q-Sound games with sound disabled
  • -
  • Enabled the "Tournament" mode in the tournament versions of Super Street Fighter 2 - now they try to connect to other terminals (if you just want to play the games then change the setup in the "Test Menu", access using F2)
  • -
  • Fixed bug in datfile generation module
  • -
  • Various rom changes to match MAME 0.112u2 (with the exception of the XOR for spf2ta)
  • -
- -

v0.2.96.61

-
    -
  • Fixed bug in System 16 sound - won't test with volume down in future!
  • -
- -

v0.2.96.60

-
    -
  • Added Sega System 16A driver supporting Action Fighter, Alex Kidd, Fantasy Zone, Quartet, Shinobi and Time Scanner
  • -
  • Added various clones to the CPS-2 driver as the keys are now known
  • -
  • Added driver for Street Fighter Alpha CPS-Changer
  • -
  • Various renames and XOR removals to match MAME 0.111u5
  • -
  • Improved save state support in numerous drivers
  • -
  • Dropped the "(BH)" monikor from the App title
  • -
- -

v0.2.96.59

-
    -
  • Fixed issues with sound in irrmaze, joyjoy, mahretsu, pspikes2 and socbrawl
  • -
  • Added sf2m2 to the Street Fighter 2 Champion Edition driver
  • -
  • Amended the game selection dialog and separated CPS-1/CPS-2 games
  • -
  • Widened the dip switch dialog
  • -
- -

v0.2.96.58

-

This is a fairly big update; changes are summarised below;

-
    -
  • Neo Geo -
      -
    • Added driver for Diggerman (diggerma)
    • -
    • Added driver for Jockey Grand Prix (jockeygp)
    • -
    • Added driver for Metal Slug 5 (mslug5, ms5plus, ms5pcb)
    • -
    • Added driver for Pochi and Nyaa (pnyaa)
    • -
    • Added driver for Samurai Shodown V (samsho5, samsho5h, samsho5b, samsh5sp, samsh5sh, samsh5sn)
    • -
    • Added driver for SvC Chaos - SNK vs Capcom (svc, svcboot, svcplus, svcplusa, svcsplus, svcpcb, svcpcba)
    • -
    • Added driver for The King of Fighters 2003 (kof2003, kf2k3bl, kf2k3bla, kf2k3pl, kf2k3upl, kf2k3pcb)
    • -
    • Added driver for V-Liner (vliner, vlinero)
    • -
    • Added driver for Zintrick (zintrckb)
    • -
    • Added aof3k to the Art of Fighting 3 driver
    • -
    • Added ct2k3sp to the Crouching Tiger Hidden Dragon 2003 driver
    • -
    • Added kog to the King of Fighters '97 driver
    • -
    • Added lastsold to the Last Blade driver
    • -
    • Added mslug3b6 to the Metal Slug 3 driver
    • -
    • Added ms4plus to the Metal Slug 4 driver
    • -
    • Added fswords to the Samurai Shodown III driver
    • -
    • Added lans2004 to the Shock Troopers 2 driver
    • -
    • Added kof10th, kf10thep, kf2k5uni, kf2k2mp, kf2k2mp2, kf2k2pls, kf2k2pla, kof2k4se to the King of Fighters 2002 driver
    • -
    • ROMset changes to match MAME affecting the kizuna, kof2000, kof2001, kof2002, lastblda, matrim, mslug4, and rbff1 drivers
    • -
    • Added emulation for PVC Protection
    • -
    • Added extra emulation for various bootlegs and gambling games
    • -
    • Enabled a protection patch for Metal Slug X making the game playable
    • -
    • Updated Universe BIOS to latest version (2.2)
    • -
    • Added missing bioses from MAME
    • -
    • Added a compile-time define in the Neo Geo driver to strictly match the MAME bios set for romset validation purposes
    • -
    • Removed driver for bangbedp
    • -
  • -
  • CPS-2 -
      -
    • Added the decryption algorithm routines to allow games to be decrytped without XORs
    • -
    • Removed the XORs from drivers where the decryption key is known
    • -
    • Added driver for Hyper Street Fighter 2 (hsf2a)
    • -
    • Added driver for Puzz Loop 2 (pzloop2, pzloop2j)
    • -
    • Added 19xxa to the 19XX driver
    • -
    • Added avspa to the Alien vs Predator driver
    • -
    • Added armwar to the Armored Warriors driver
    • -
    • Added ddsomr1, ddsomr3 to the Dungeons & Dragons: Shadow of Mystara driver
    • -
    • Added ddtodr1 to the Dungeons & Dragons: Tower of Doom driver
    • -
    • Added mshj to the Marvel Super Heroes driver
    • -
    • Added mshvsfj2 to the Marvel Super Heroes vs Street Fighter driver
    • -
    • Added spf2ta to the Super Puzzle Fighter 2 Turbo driver
    • -
    • Added ssf2tbr1 to the Super Street Fighter 2 driver
    • -
    • Added ssf2u to the Super Street Fighter 2 Turbo driver
    • -
    • Added xmvsfu to the X-Men vs Street Fighter driver
    • -
    • Emulated the paddles in Puzz Loop 2 (pzloop2, pzloop2j)
    • -
    • ROMset changes to match MAME affecting the armwar, avsp, ddsom, ddtod, dstlk, msh, mshvsf, msvc, progear, sfa, sfa3, sgemf, spf2t, vhunt2, and xmvsf drivers
    • -
    • Corrected the descriptions in the Cyberbots driver
    • -
    • Disabled drivers for games without XORs or decryption keys
    • -
  • -
  • CPS-1 -
      -
    • Added cawingr1 to the Carrier Air Wing driver
    • -
    • Added ffightua to the Final Fight driver
    • -
    • Fixed the Saturday Night Slam Masters driver so the games now boot
    • -
    • ROMset changes to match MAME affecting the forgottn, sf2, and varth drivers
    • -
    • Removed driver for knightsh
    • -
  • -
  • Toaplan -
      -
    • Added driver for Hell Fire (hellfire, hellfir1, hellfir2)
    • -
    • Added driver for Truxton (truxton)
    • -
    • Added driver for Zero wing (zerowing)
    • -
    • Added batsugna to the Batsugun driver
    • -
    • Added outzoneb, outzonec to the Out Zone driver
    • -
    • Fixed the dip switches in the Out Zone driver
    • -
    • ROMset changes to match MAME affecting the bbakraid, dogyuun, outzone and shippumd drivers
    • -
  • -
  • Cave -
      -
    • Added donpachk to the Donpachi driver
    • -
    • Added theroes to the Gaia driver
    • -
    • Added uopoko to the Puzzle Uo Poko driver
    • -
    • ROMset changes to match MAME affecting the btlkroad, ddonpach, dfeveron, donpach, gaia and uopoko drivers
    • -
  • -
  • Misc -
      -
    • Added driver for Cooki and Bibi 2
    • -
    • Added driver for Cooki and Bibi 3
    • -
    • Added driver for More More
    • -
    • Added driver for More More Plus
    • -
    • Added driver for Puzzle King
    • -
    • Added driver for Toppy & Rappy
    • -
    • Added driver for Twinkle
    • -
    • Added driver for XESS - The New Revolution (SemiCom 3-in-1)
    • -
    • Added gtstarba to the Guardian driver
    • -
    • Added newsa to the News driver
    • -
    • Added slapftuk, slapfgtr to the Slap Fight driver
    • -
    • Added snowbroc to the Snow Bros. driver
    • -
    • Added solomon to the Solomons Key driver
    • -
    • Added s1945a, s1945k to the Strikers 1945 driver
    • -
    • Added supermanj to the Superman driver
    • -
    • Added tigerhb2 to the Tiger Heli driver
    • -
    • Added daisenpu to the Twin Hawk driver
    • -
    • Fixed the sound generated by the YM2151 in the Final Star Force driver
    • -
    • Fixed the hang bug in the Rastan driver when starting the game
    • -
    • ROMset changes to match MAME affecting the gunbird, opwolf, rastan, s1945, solomon, tengai and tigerh drivers
    • -
  • -
  • Application -
      -
    • Added a NODUMP flag for rom definitions and updated DAT file generation and rom scan routines to support it
    • -
    • Increased the max length of a rom name to 32 characters
    • -
    • Added support for the extra V-Liner inputs to the input dialog
    • -
    • Made game selection dialog wider to accomodate longer game titles
    • -
    • Fixed the player descriptions in the input dialog (Player 0 becomes Player 1, etc.)
    • -
  • -
- -
From this point forward, all releases are handled by Barry and each external contribution is labelled.

The releases below were available on the old FBA site.
- -

v0.2.95.23

-

Time for another FinalBurn Alpha release, bringing with it an assortment of fixes and additions. Grab it while it's hot, from our files page. Any bugs / issues should be reported to the FBA official forums.

-
    -
  • This is still an alpha release!
  • -
  • Note that, if compiled with GCC, you will need to use version 3.3.x, and the experimental DirectX 9 blitter is not built
  • -
  • Changed the way FB Alpha looks for ROMs. Now, it will always check the last path for any given .zip file, even when a .zip file of the same name is present in another path. This way, we can keep ROMs that are only needed for FB Alpha seperate without sacrifising compatibility with other emulators
  • -
  • Changed the way Neo Geo memory cards work, allowing the use of 1 megabit cards
  • -
  • Emulated protection in Super Sidekicks (was patched before)
  • -
  • Fixed the last few bad game names / bad ROM definitions
  • -
  • Fixed a few minor issues in the makefile for mingw/cygwin
  • -
  • The debugger is now only compiled for debug builds
  • -
  • Minor updates to compile documentation
  • -
  • Fixed a crash at startup for some systems when autopause was activated
  • -
- -

v0.2.95.22

-

This release fixes a few bugs that crept into yesterdays release. GCC is supported in this release, with a few stipulations. See below for more details regarding compiling this release with GCC. Grab this latest release from our files page.

-
    -
  • This is still an alpha release!
  • -
  • Note that, if compiled with GCC, you will need to use version 3.3.x, and the experimental DirectX 9 blitter is not built
  • -
  • Implemented workarounds to the FB Alpha executable to allow the use of windres as the resource compiler (it cannot zero-terminate strings or use a string as an RCDATA resource)
  • -
  • Cleaned up the makefiles (variables/options now defined in the main makefile)
  • -
  • Fixed a few game names / bad ROM definitions
  • -
  • Fixed CPS1 games sound / crashing if started as the 1st game
  • -
  • Fixed the Psikyo games that use an YM2610 for sound
  • -
  • Fixed a few problems with ANSI builds
  • -
- -

v0.2.95.21

-

At long last its time for a new version of FBA! On offer are the standard build, the source code and an optimised binary for use on Win9x / Pentium machines. You can download the latest version, from our Files page.

-

This is still an alpha release!

-

Note that this version CANNOT be compiled with GCC!

-
    -
  • converted all code to optionally use unicode
  • -
  • Added a driver for 68EC020 based Psikyo hardware
  • -
  • Added a second 68000 CPU core. For plain 68000 CPUs you can select which core to use, the new one also emulates 68010 and 68EC020 CPUs
  • -
  • Fixed the overclock feature for Neo Geo
  • -
  • Added a DirectX Graphics 9 blitter (see system requirements, below)
  • -
  • Performed miscellaneous minor bugfixes
  • -
- -

v0.2.94.98

-

Special Christmas Eve Release!

-

A new version of FBA has been released, with the following fixes and updates. Please remember that this is still considered to be an alpha release and while we are pretty sure most of the nastier bugs have been squashed, a few may remain. So if you find a bug, please report it to the appropriate forum. All that remains is too wish our Christmas celebrating users a Merry Christmas! And to everyone else, happy Winter Solstice!

-
    -
  • Fixed all the new bugs introduced in the previous version
  • -
  • Fixed the raster effects in Samurai Shodown 3
  • -
  • Preview images can be any png file upto 1024×0124 pixels
  • -
  • Added descriptive text to screenshot png files
  • -
  • Added a system information dialog that's used when FB Alpha crashes
  • -
  • Added the english language versions of mahoudai and shippumd
  • -
- -

v0.2.94.97

-

There is a new version of FBA available from our downloads page. At present an upgrade .msi is unavailable. Any users wishing to upgrade, should download the standard fba_029497.exe and extract the contents to their installation directory.

-

This is an alpha release! Again, although we expect very few problems, there still might be some we've not seen.

-
    -
  • Fixed most of the remaining problems in v0.2.94.96
  • -
  • Shortcut keys have changed
  • -
  • Directories used by FB Alpha have changed
  • -
  • Readme updated (read it completely even if you've read the earlier versions)
  • -
  • The Neo Geo driver now always uses a real AES BIOS in AES mode, more differences between AES and MVS are emulated now as well
  • -
- -

v0.2.94.96

-

All the files are now back online. If you downloaded the previous installer, then you only have to download the smaller upgrade installer this time around. There is also an optimised build for K6 users; as after all, they are people too; Please remember to delete the contents of you cfg/ folder before you start FBA, as the old cfg files will not be fully compatible with the new release.

- -

v0.2.94.95

-

A new version of FBA has been released. This version fixes most of the problems in v0.2.94.56. If you downloaded the fba.msi last time, we recommend that you wait for the fba_029495_update.msi that should be released later this evening. For all the K6 people out there, an optimized K6 version will be available shortly as well. Please note that certain CPS1 games still lack sound. Downloads are currently available from the torrents page. Direct downloads will be available in a little while. If you are using FB Alpha v0.2.94.56, please upgrade. Delete all files in the FB Alpha cfg directory.

- -

v0.2.94.56

-
    -
  • Added a driver for Neo Geo games
  • -
  • too many other improvements to name
  • -
- -

v0.2.94

-
    -
  • Added a driver for Cave games
  • -
  • Added a driver for Rainbow Islands
  • -
  • Added support for X-Arcade joystick
  • -
  • Improved compatibility of the Direct3D blitter, and added new options
  • -
  • re-added 3x macros for Street Fighter 2 style games
  • -
  • Added 4-point interpolation to the ADPCM sound cores
  • -
- -

v0.2.92

-
    -
  • Small bug-fix release, relating to inputs (Z-Axis), NetPlay Chat font-size and a small speed increase
  • -
- -

v0.2.91

-

(This is basically a new emulator with far too many new features to list - the following is merely a very brief summary).

-
    -
  • Toaplan2 emulation
  • -
  • Massively improved CPS-2 emulation with support for all currently XORed games
  • -
  • Improved CPS-1 emulation with support for the recent (Chinese?) hacks
  • -
  • Many, many UI enhancements
  • -
  • New blitters - including RGB effects, etc
  • -
  • Demo recording and playback
  • -
- -

v0.2.6

-
    -
  • Added drivers for sgemf, sgemfa, pfghtj, ssf2a, ssf2ar1 & spf2t.
  • -
  • Added Dynasty Wars (World) and Knights of the Round (Hack).
  • -
  • Fixed the off-set of the sprites in the mvsc ending.
  • -
  • Fixed the sound in some CPS-1 games (all work fine now).
  • -
- -

v0.2.5

-
    -
  • Fixed menu/cheat incompatibilty bug
  • -
  • Added a suprise (in the source)
  • -
- -

v0.2.4.0

-
    -
  • Fixed dstlk driver for euro parent set
  • -
  • Added mvsc driver
  • -
- -

v0.2.3.0

-
    -
  • This build should fix the drop in performance that has been experienced by people with slow PC's. This was probably caused by new Platform SDK DirectX 8.0 elements. Please let us know if you still experience a drop in performance
  • -
  • Fixed bug with Mercs driver
  • -
- -

v0.2.2.7

-
    -
  • Added starfield emulation
  • -
  • Added support for changing layer-sprite priorities with raster effects. (fixes glitches in Manhattan and Apocalypse stages)
  • -
  • Fixed pgear/armwar glitch
  • -
  • Added hotkeys for savestate slots
  • -
  • Updated the cheat engine so it can use same cheats for multiple games
  • -
  • Added screenshot feature
  • -
  • Added a basic shot factory. F8 to activate
  • -
  • Slightly changed shot factory to include sprite toggle
  • -
  • Updated the fbcheat.dat file with a ton of cheats
  • -
  • Driver changes
  • -
  • Fixed controls for mercs & clones
  • -
- -

v0.2.2

-
    -
  • Fixed cawing & clones buildings gfx error
  • -
  • Fixed repeating sounds
  • -
  • Fixed sound crashing in DDTOD and other games
  • -
  • Changed keys for volume up and down
  • -
  • Fixed aspect ratio for vertical games
  • -
  • Added the third button to the mtwins driver
  • -
  • fixed crash bugs in cawingj, knightsj, qadj, striderj, varthj & varthu
  • -
  • Added more cheats
  • -
- -

v0.2.1

-
    -
  • Added drivers for ddtod, sfz3a, vsava, xmvsf & xmcota
  • -
- -

v0.200

-
    -
  • Re-added T key.
  • -
  • Fixed sound stop when you select menu.
  • -
  • Fixed slammast input players 3/4.
  • -
  • Fixed captcomm input player 4.
  • -
  • Fixed forgottn analogic input.
  • -
  • FBA version in About dialog is dynamically updated.
  • -
  • Show volume value.
  • -
  • Added Pang! 3 working driver.
  • -
  • Fixed the menu to disable a few options during netplay.
  • -
  • Added sprite masking.
  • -
  • Added small sprite fix.
  • -
  • Added BgHi. (thanks ElSemi)
  • -
  • Added scroll limits.
  • -
  • Added new load dialog.
  • -
  • Ported FBA to Cygwin/MinGW.
  • -
  • Added new stretch options.
  • -
  • Added switch to use arcade resolution for full-screen mode.
  • -
  • Added support for beam-synchronized interrupts.
  • -
  • Optimized sprite masking.
  • -
  • Numerous small fixes.
  • -
  • Added (and fixed) new sound interpolation routines by ComaC.
  • -
  • Added command line parsing.
  • -
  • Added automatic generation of the driver list & gamelist.txt.
  • -
  • Fixed the dip switch engine so it works with the sega games.
  • -
  • Fixed CpsFsStopOpposite so it won't stop 3kick and 3punch.
  • -
  • Added fix to cpst.cpp by TRAC of the SNEeSe Emulator to fix a sprite clipping bug on CPS games.
  • -
  • Redid most of the VC++ project files to allow the emulator to build.
  • -
  • Added Jan_Klaassen to the about box.
  • -
  • Alphabetically listed the drivers (so the Kaillera game list doesn't screw up).
  • -
  • Fixed batcir 4 player fix, so it actually works.
  • -
  • Added a huge amount of new cheats in the fbcheat.dat file.
  • -
  • Updated some of the docs and stuff.
  • -
  • Fixed the default controllers so they are set to different devices.
  • -
  • Removed the 'flip monitor as standard for XMvSF in netplay' fix as it's no longer needed.
  • -
  • Re-arranged the panel in netplay a little so it's a little more compact.
  • -
  • Updated the CpsFsStopOpposite function with lots of new input ports and updated a few CPS-2 drivers to use it.
  • -
  • Updated most CPS drivers so that the correct sound codes are blocked when the user selects that option.
  • -
- -

v0.138a

-
    -
  • Added Drivers for mshvsf, mshvsfj, mshvsfjr1, vsav & armwar
  • -
  • No further updates have been made to this version
  • -
- -

v0.137a

-
    -
  • Fixed auto-pause
  • -
  • Fixes to dozea.asm
  • -
  • Fixed HotRod inputs
  • -
  • Fixed an input menu bug when there's no DIP-SW data available
  • -
  • Updated and fixed dipinfo.dat file
  • -
  • Updated fbcheat.dat file
  • -
  • Added volume control
  • -
  • Added more accelerators
  • -
- -

v0.137

-

REALLY IMPORTANT BIT: We require your feedback/input, regarding any problems/bugs you may have with the Kaillera netplay & new menu. Please report any bugs to http://www.xsorbit.com/users/LEvilElmo/index.cgi - and use the FinalBurn Alpha Bug Report Board. Remember to provide details about your PC's spec's, OS, etc etc.

-

SECOND IMPORTANT BIT: Ayeye & HyperYagami have joined "Team FB Alpha."

-
    -
  • Added a new GUI
  • -
  • Added rom scanning to check what roms you have
  • -
  • Added options to show all, CPS-1 only or CPS-2 only games
  • -
  • Added option to only show the games you got
  • -
  • Added esc=exit for all dialogs
  • -
  • Added CPS1 QSound (thanks for info ElSemi)
  • -
  • Added IIR low pass filter
  • -
  • Added Dip Switches Engine
  • -
  • Fixed stupid error I made with the cheat dialog column widths :P
  • -
  • Set nApplyCheatEveryXFrame to 0 as standard
  • -
  • Fixed so the 4 player fix for batcirj only applies to netplay
  • -
  • Added light blue background as standard for SFA3 + clones in netplay
  • -
  • Added flip monitor as standard for XMvSF in netplay
  • -
  • Added drivers for ddsom, dstlk, dstlkr1, sfa & sfar1
  • -
  • Updated cheats file
  • -
- -

v0.136 WIP

-
    -
  • A small fix so the the option bReadInputEveryFrame is always *ON* during netplay. Changing the value in the .ini file now only effects local play
  • -
  • Disabled the T key during netplay until i can fix it and still make FB run under Win95
  • -
  • Fixed four player in Battle Circuit
  • -
- -

v0.136

-

REALLY IMPORTANT BIT: Delete all of the files in the "cfg folder" apart from the "finalburn file." The new cheat engine has "issues" with the old config files.

-
    -
  • Disabled the T (talk) key during netply until i can figure out a way of fixing the problem
  • -
  • A small fix so the the option bReadInputEveryFrame is now always ON during netplay. Changing the value in the .ini file now only effects local play
  • -
  • Merged in some changes from big fool
  • -
  • Added an options dialog, still needs a bit of work but works in its current state
  • -
  • Added the layer toggle code by gangta and removed the old Alt+L layer toggle stuff keys alt+6 -0 are used
  • -
  • Added version 2 of HyperYagami's Cheat engine. A lack of space on the cheat menu has ment that you cannot disable cheats, but that doesn't really matter. Also made a small change for netplay cus the input dialog was getting screwed
  • -
  • Removed the Dat type code from the .ini file. Use the buttons under options instead
  • -
  • Cheat options input screen added :)
  • -
  • Fixed 4 player under Battle Circuit
  • -
  • Added lots more cheats to the fbcheat.dat file
  • -
  • Fixed so the 4/3 player fixes only applies to the netplay games
  • -
  • Minor tweak to the Options Input screen
  • -
  • Added Mike's lovely FBA logo to all the doc's
  • -
- -

v0.135

-
    -
  • Readded Ayeye's pause code, works a lot better now. Also added his latest version which fixes a few bugs. the game will now pause when the panel is shown and when the window loses foucus. It is still disabled during netplay
  • -
  • Readded HyperYagami's multi rom path stuff
  • -
  • Fixed the updated Megaman driver
  • -
  • Added the first version of HyperYagami's cheat engine as well as making a few changes to disable it during multiplayer
  • -
  • A small fix so the the option bReadInputEveryFrame is always off during netplay. Changing the value in the .ini file now only effects local play
  • -
  • Fixed the warnings that were starting to creep in all over the place
  • -
  • Added region switches for: Battle Circuit, Eco Fighters, Armored Warriors & Street Fighter Zero 2 Alpha
  • -
  • Fixed player 2 & 3 controls in Mercs
  • -
  • Merged Logiqxs driver changes
  • -
  • Merged Logiqxs .dat generator and added .ini setting for it
  • -
  • Added Hotrod support in the ini
  • -
  • Added extra ports to CPS_RW.CPP to get the kicks working in sf2ue and gain more control over rotation in forgottn
  • -
  • Altered the Driver list so that all drivers are listed alphabetically, this fixes the "Alphabetical Doubling" in the game list, when creating an online game
  • -
  • Got 3Player controls working in Knights of the Round
  • -
  • Yet another tweak to the load menu - everything should now be in the correct order
  • -
  • Added AvsP 3 Player fix & DD:SoM 4 Player fix, should work fine in netplay now!
  • -
  • Fixed Ghouls, SSF2T & SF2T + Clones in netplay, they were unplayable before!
  • -
  • Fixed the region switches in netplay!
  • -
  • Added region switches for: DD:ToD, Pnickies, Mega Man
  • -
  • Added Infinite Time cheats to all 1 on 1 fighting games
  • -
  • Fixed the QNDream controller
  • -
- -

v0.134

-

FinalBurn Alpha is now updated by "Team FB Alpha" (LoopMaster, KEV, Mike_Haggar & TrebleWinner)

-
    -
  • Fixed FFightj GFX Loading
  • -
  • Added 2 new fields to the driver structure
  • -
  • Added Treble Winner's changes fixing descriptions of many of the inputs
  • -
  • Changed the load dialog to support the new text fields
  • -
  • Removed the multi rom path code as it needs fixing
  • -
  • Added Merged CPS1 Drivers (Rest of the games!)
  • -
  • Fixed Mercs and clones, Cawingj, Cworld2j, Pnickj & Qad GFX Loading
  • -
  • Fixed 3wonders and clones & willow and clones GFX Loading + Banks
  • -
  • Added the inputs that was missing, but were included in MAME
  • -
  • Added Captain Commando and clones driver
  • -
  • Added Mega Twins and clones driver (thanks to Diablo82 & Treble_Winner)
  • -
  • Fixed SF2 Init13 (thanks to Treble_Winner)
  • -
  • Added TrebleWinners default controls code. Default controls can now be set in the ini (eg: 0=keyboard, 1=joystick 1, 2=joystick 2, etc...
  • -
  • Minor tweak to the load menu display
  • -
  • Added Ayeye's Pause Code. FinalBurn Alpha will now pause when the window loses focus. NB: the gui must be hidden for this to occur
  • -
  • Fixed problems with Win95/Kaillera incompatabilities (KEV)
  • -
  • Added drivers for the new CPS2shock releases (Battle Circuit, Eco Fighters, SFA3 clones & Vampire clone)
  • -
- -

v0.133

-
    -
  • An apology for releasing the debug version by accident, sorry all. C++ caused several lock ups & crashes on my PC before I built the .exe file. Several configuration setting's fouled up & I lost a few unimportant files as well :(
  • -
- -

v0.132

-
    -
  • Hack Fixed the UN Squadron driver (KEV)
  • -
  • Add WIP for better Multiply protection
  • -
  • Patched Knights of the round so you can play it
  • -
  • Added King of Dragons driver By Mike_Haggar with a fix by KEV
  • -
  • Added Support for 1941 and clones
  • -
  • A fully working King Of the Dragons Driver
  • -
  • A very very small tweak to the game selection dialog
  • -
  • Re-added a few lines in drv.cpp to fix on-line mode and tweaked rom search path
  • -
  • Added Better support for the CPS1 board IDs to get all the games that need it working and changed drivers as needed
  • -
  • Added Merged CPS2 Drivers (All games!)
  • -
  • Added Merged CPS1 Drivers for : UN Squadron, Varth, Strider, MSword and Final Fight!
  • -
  • Added Merged Sf2 and Sf2ce drivers with all clones with thanks to JeldrosJ3 for SF2RB2
  • -
  • Fixed the problem with Marvel Super Heroes (Japan) loading the USA version instead of the Japan version.
  • -
- -

v0.131

-
    -
  • Now compiled with Christophe's Alpha 5 Kaillera code
  • -
  • Fixed the crash when using Strider Hiryu (USA)
  • -
  • Multiple ROM path support added courtesy of HyperYagami
  • -
- -

v0.130

-
    -
  • Now compiled with Christophe's Alpha 4 Kaillera code, a new version of the kailleraclient.dll is also included in this release
  • -
  • Added lots of new drivers for Street Fighter (C.E. & Turbo), mainly clones though, thanks to everyone who donated these. Too many to mention here, but SF2 Red Wave & Rainbow Edition are included
  • -
  • Drivers added for Magic Sword (Mike Haggar) and UN Squadron (KEV)
  • -
  • Added my own Knights of the Round driver, thanks go out to Mike Haggar for fixing the GFX issues. Unfortunately the in-game controls don't work at present :(
  • -
  • In theory it should be possible to play against someone who is using FinalBurn Kaillera Alpha 4, as both use the same code. That said, it would be better if you play against someone who is using Final Burn Alpha v0.130 :)
  • -
- -

v0.129

-
    -
  • There's no need to use patched XOR's anymore! Armwar, Pgear & Pgearr1 now use the original XOR tables released by Raz. A very big thankyou goes out to Raz & FinalDave for helping me solve this problem :)
  • -
  • Pgearr1 now works correctly, and no longer reports the "1010 EXCEPTION 0000716C" message
  • -
  • Re-ordered the games list. CPS-1/CPS-Changer games can now be found at the bottom of the game list, in alphabetical order
  • -
  • Forced "bReadInputEveryFrame" to default as "0" (off). According to Raz this should help with the netplay. The "bDrvSaveAll" option should also be set to "0" if you are using the netplay feature
  • -
- -

v0.128

-
    -
  • Added Christophe's Kaillera source code (Alpha3), so netplay is now available!
  • -
- -

v0.127

-
    -
  • Enabled the CPS-1 drivers for: -
      -
    • Megaman/Rockman: The Power Battle
    • -
    • Final Fight (World)
    • -
    • Ghouls & Ghosts
    • -
    • Strider
    • -
    • Street Fighter 2 (ETC)
    • -
    • Street Fighter 2: C.E. (ETC)
    • -
    • Street Fighter 2 Turbo (USA)
    • -
  • -
  • Enabled the CPS-Changer driver for: -
      -
    • Street Fighter Zero
    • -
  • -
- -

v0.126

-
    -
  • Updated all CPS-2 drivers, to be compliant with Logiqx CPS-2 DAT 20010727
  • -
  • Added drivers for Armwar, Pgear & Pgearr1 - they currently use Haze's patched XOR's
  • -
  • You need to add the following patched XOR's to the following ROMset's: -
      -
    • pgear_xor_haze.zip ------> pgear.zip
    • -
    • pgearr1_xor_haze.zip ----> pgearr1.zip
    • -
    • armwar_xor_haze.zip -----> armwar.zip
    • -
  • -
  • Pgearr1 loads but does not work properly, it only displays a "1010 EXCEPTION 0000716C"
  • -
- -

v0.125

-
    -
  • Altered Driver for Ddsomj so that it now points to Ddsomjr1
  • -
- -

v0.124

-
    -
  • Removed CPS-1 & Sega drivers
  • -
  • Added Drivers for all CPS-2 titles, with the exception of Armoured Warriors & Powered Gear
  • -
- -
- - - \ No newline at end of file